From 690dd7a33ddc90678367d73adf313533536e10f2 Mon Sep 17 00:00:00 2001 From: Alexey Sokolov Date: Fri, 29 Apr 2016 23:57:30 +0100 Subject: Apply clang-format --- src/modules/about/AboutDialog.cpp | 89 +- src/modules/about/AboutDialog.h | 3 +- src/modules/about/libkviabout.cpp | 36 +- src/modules/action/libkviaction.cpp | 163 +- src/modules/actioneditor/ActionEditor.cpp | 583 +- src/modules/actioneditor/ActionEditor.h | 68 +- src/modules/actioneditor/libkviactioneditor.cpp | 22 +- src/modules/addon/AddonFunctions.cpp | 138 +- src/modules/addon/AddonFunctions.h | 4 +- src/modules/addon/AddonManagementDialog.cpp | 192 +- src/modules/addon/AddonManagementDialog.h | 32 +- src/modules/addon/PackAddonDialog.cpp | 198 +- src/modules/addon/PackAddonDialog.h | 43 +- src/modules/addon/WebAddonInterfaceDialog.cpp | 20 +- src/modules/addon/WebAddonInterfaceDialog.h | 7 +- src/modules/addon/libkviaddon.cpp | 308 +- src/modules/aliaseditor/AliasEditorWindow.cpp | 819 +- src/modules/aliaseditor/AliasEditorWindow.h | 128 +- src/modules/aliaseditor/libkvialiaseditor.cpp | 25 +- src/modules/avatar/libkviavatar.cpp | 225 +- src/modules/avatar/libkviavatar.h | 11 +- src/modules/chan/libkvichan.cpp | 632 +- src/modules/channelsjoin/ChannelsJoinDialog.cpp | 134 +- src/modules/channelsjoin/ChannelsJoinDialog.h | 36 +- src/modules/channelsjoin/libkvichannelsjoin.cpp | 39 +- src/modules/classeditor/ClassEditorWindow.cpp | 834 +- src/modules/classeditor/ClassEditorWindow.h | 118 +- src/modules/classeditor/libkviclasseditor.cpp | 23 +- src/modules/codetester/CodeTesterWindow.cpp | 32 +- src/modules/codetester/CodeTesterWindow.h | 14 +- src/modules/codetester/libkvicodetester.cpp | 23 +- src/modules/config/libkviconfig.cpp | 258 +- src/modules/context/libkvicontext.cpp | 238 +- src/modules/dcc/DccBroker.cpp | 700 +- src/modules/dcc/DccBroker.h | 53 +- src/modules/dcc/DccCanvasWindow.cpp | 325 +- src/modules/dcc/DccCanvasWindow.h | 66 +- src/modules/dcc/DccChatWindow.cpp | 417 +- src/modules/dcc/DccChatWindow.h | 41 +- src/modules/dcc/DccDescriptor.cpp | 159 +- src/modules/dcc/DccDescriptor.h | 96 +- src/modules/dcc/DccDialog.cpp | 83 +- src/modules/dcc/DccDialog.h | 31 +- src/modules/dcc/DccFileTransfer.cpp | 1092 +- src/modules/dcc/DccFileTransfer.h | 174 +- src/modules/dcc/DccMarshal.cpp | 219 +- src/modules/dcc/DccMarshal.h | 47 +- src/modules/dcc/DccThread.cpp | 35 +- src/modules/dcc/DccThread.h | 18 +- src/modules/dcc/DccUtils.cpp | 38 +- src/modules/dcc/DccUtils.h | 2 +- src/modules/dcc/DccVideoWindow.cpp | 450 +- src/modules/dcc/DccVideoWindow.h | 83 +- src/modules/dcc/DccVoiceAdpcmCodec.cpp | 131 +- src/modules/dcc/DccVoiceAdpcmCodec.h | 10 +- src/modules/dcc/DccVoiceCodec.cpp | 138 +- src/modules/dcc/DccVoiceCodec.h | 26 +- src/modules/dcc/DccVoiceGsmCodec.cpp | 189 +- src/modules/dcc/DccVoiceGsmCodec.h | 45 +- src/modules/dcc/DccVoiceWindow.cpp | 493 +- src/modules/dcc/DccVoiceWindow.h | 85 +- src/modules/dcc/DccWindow.cpp | 12 +- src/modules/dcc/DccWindow.h | 18 +- src/modules/dcc/canvaswidget.cpp | 2469 +- src/modules/dcc/canvaswidget.h | 555 +- src/modules/dcc/libkvidcc.cpp | 856 +- src/modules/dcc/requests.cpp | 733 +- src/modules/dialog/libkvidialog.cpp | 421 +- src/modules/dialog/libkvidialog.h | 87 +- src/modules/editor/ScriptEditorImplementation.cpp | 511 +- src/modules/editor/ScriptEditorImplementation.h | 52 +- src/modules/editor/libkvieditor.cpp | 28 +- src/modules/eventeditor/EventEditorWindow.cpp | 292 +- src/modules/eventeditor/EventEditorWindow.h | 62 +- src/modules/eventeditor/libkvieventeditor.cpp | 22 +- src/modules/file/libkvifile.cpp | 475 +- .../filetransferwindow/FileTransferWindow.cpp | 506 +- .../filetransferwindow/FileTransferWindow.h | 68 +- .../libkvifiletransferwindow.cpp | 33 +- src/modules/fish/libkvifish.cpp | 426 +- src/modules/help/HelpIndex.cpp | 949 +- src/modules/help/HelpIndex.h | 144 +- src/modules/help/HelpWidget.cpp | 102 +- src/modules/help/HelpWidget.h | 51 +- src/modules/help/HelpWindow.cpp | 247 +- src/modules/help/HelpWindow.h | 55 +- src/modules/help/libkvihelp.cpp | 112 +- src/modules/http/HttpFileTransfer.cpp | 261 +- src/modules/http/HttpFileTransfer.h | 63 +- src/modules/http/libkvihttp.cpp | 128 +- src/modules/ident/libkviident.cpp | 324 +- src/modules/ident/libkviident.h | 41 +- src/modules/iograph/libkviiograph.cpp | 112 +- src/modules/iograph/libkviiograph.h | 16 +- src/modules/lamerizer/libkvilamerizer.cpp | 291 +- src/modules/lamerizer/libkvilamerizer.h | 32 +- src/modules/language/detector.cpp | 36646 +++++++++---------- src/modules/language/detector.h | 4 +- src/modules/language/libkvilanguage.cpp | 53 +- src/modules/links/LinksWindow.cpp | 384 +- src/modules/links/LinksWindow.h | 34 +- src/modules/links/libkvilinks.cpp | 32 +- src/modules/list/ListWindow.cpp | 227 +- src/modules/list/ListWindow.h | 41 +- src/modules/list/libkvilist.cpp | 30 +- src/modules/log/libkvilog.cpp | 93 +- src/modules/logview/LogFile.cpp | 43 +- src/modules/logview/LogFile.h | 38 +- src/modules/logview/LogViewWidget.cpp | 42 +- src/modules/logview/LogViewWidget.h | 9 +- src/modules/logview/LogViewWindow.cpp | 286 +- src/modules/logview/LogViewWindow.h | 58 +- src/modules/logview/libkvilogview.cpp | 36 +- src/modules/mask/libkvimask.cpp | 51 +- src/modules/math/libkvimath.cpp | 143 +- src/modules/mediaplayer/MpAmipInterface.cpp | 170 +- src/modules/mediaplayer/MpAmipInterface.h | 91 +- src/modules/mediaplayer/MpInterface.cpp | 63 +- src/modules/mediaplayer/MpInterface.h | 117 +- src/modules/mediaplayer/MpMp3.cpp | 375 +- src/modules/mediaplayer/MpMp3.h | 68 +- src/modules/mediaplayer/MpMprisInterface.cpp | 412 +- src/modules/mediaplayer/MpMprisInterface.h | 220 +- src/modules/mediaplayer/MpWinampInterface.cpp | 198 +- src/modules/mediaplayer/MpWinampInterface.h | 81 +- src/modules/mediaplayer/MpXmmsInterface.cpp | 191 +- src/modules/mediaplayer/MpXmmsInterface.h | 89 +- src/modules/mediaplayer/libkvimediaplayer.cpp | 455 +- src/modules/mediaplayer/winamp.cpp | 46 +- src/modules/mircimport/libkvimircimport.cpp | 165 +- src/modules/mircimport/libkvimircimport.h | 21 +- src/modules/my/Idle.cpp | 33 +- src/modules/my/Idle.h | 5 +- src/modules/my/Idle_mac.cpp | 251 +- src/modules/my/Idle_win.cpp | 143 +- src/modules/my/Idle_x11.cpp | 131 +- src/modules/my/libkvimy.cpp | 93 +- src/modules/notifier/NotifierMessage.cpp | 12 +- src/modules/notifier/NotifierMessage.h | 13 +- src/modules/notifier/NotifierSettings.h | 55 +- src/modules/notifier/NotifierWindow.cpp | 391 +- src/modules/notifier/NotifierWindow.h | 78 +- src/modules/notifier/NotifierWindowBorder.cpp | 42 +- src/modules/notifier/NotifierWindowBorder.h | 58 +- src/modules/notifier/NotifierWindowTab.cpp | 82 +- src/modules/notifier/NotifierWindowTab.h | 10 +- src/modules/notifier/libkvinotifier.cpp | 71 +- src/modules/objects/KvsObject_button.cpp | 51 +- src/modules/objects/KvsObject_button.h | 14 +- src/modules/objects/KvsObject_buttonGroup.cpp | 43 +- src/modules/objects/KvsObject_buttonGroup.h | 17 +- src/modules/objects/KvsObject_checkBox.cpp | 37 +- src/modules/objects/KvsObject_checkBox.h | 18 +- src/modules/objects/KvsObject_colorDialog.cpp | 127 +- src/modules/objects/KvsObject_colorDialog.h | 23 +- src/modules/objects/KvsObject_comboBox.cpp | 191 +- src/modules/objects/KvsObject_comboBox.h | 53 +- src/modules/objects/KvsObject_dateTimeEdit.cpp | 86 +- src/modules/objects/KvsObject_dateTimeEdit.h | 20 +- src/modules/objects/KvsObject_dialog.cpp | 17 +- src/modules/objects/KvsObject_dialog.h | 4 +- src/modules/objects/KvsObject_dockWindow.cpp | 73 +- src/modules/objects/KvsObject_dockWindow.h | 4 +- src/modules/objects/KvsObject_file.cpp | 321 +- src/modules/objects/KvsObject_file.h | 53 +- src/modules/objects/KvsObject_ftp.cpp | 234 +- src/modules/objects/KvsObject_ftp.h | 45 +- src/modules/objects/KvsObject_groupBox.cpp | 108 +- src/modules/objects/KvsObject_groupBox.h | 38 +- src/modules/objects/KvsObject_hBox.cpp | 86 +- src/modules/objects/KvsObject_hBox.h | 15 +- src/modules/objects/KvsObject_http.cpp | 511 +- src/modules/objects/KvsObject_http.h | 73 +- src/modules/objects/KvsObject_label.cpp | 95 +- src/modules/objects/KvsObject_label.h | 31 +- src/modules/objects/KvsObject_layout.cpp | 194 +- src/modules/objects/KvsObject_layout.h | 22 +- src/modules/objects/KvsObject_lcd.cpp | 84 +- src/modules/objects/KvsObject_lcd.h | 23 +- src/modules/objects/KvsObject_lineEdit.cpp | 245 +- src/modules/objects/KvsObject_lineEdit.h | 82 +- src/modules/objects/KvsObject_list.cpp | 131 +- src/modules/objects/KvsObject_list.h | 39 +- src/modules/objects/KvsObject_listWidget.cpp | 482 +- src/modules/objects/KvsObject_listWidget.h | 68 +- src/modules/objects/KvsObject_mainWindow.cpp | 27 +- src/modules/objects/KvsObject_mainWindow.h | 8 +- src/modules/objects/KvsObject_memoryBuffer.cpp | 62 +- src/modules/objects/KvsObject_memoryBuffer.h | 17 +- src/modules/objects/KvsObject_menuBar.cpp | 14 +- src/modules/objects/KvsObject_menuBar.h | 6 +- src/modules/objects/KvsObject_multiLineEdit.cpp | 374 +- src/modules/objects/KvsObject_multiLineEdit.h | 104 +- src/modules/objects/KvsObject_painter.cpp | 1738 +- src/modules/objects/KvsObject_painter.h | 154 +- src/modules/objects/KvsObject_pixmap.cpp | 576 +- src/modules/objects/KvsObject_pixmap.h | 64 +- src/modules/objects/KvsObject_popupMenu.cpp | 190 +- src/modules/objects/KvsObject_popupMenu.h | 28 +- src/modules/objects/KvsObject_process.cpp | 102 +- src/modules/objects/KvsObject_process.h | 37 +- src/modules/objects/KvsObject_progressBar.cpp | 42 +- src/modules/objects/KvsObject_progressBar.h | 18 +- src/modules/objects/KvsObject_radioButton.cpp | 42 +- src/modules/objects/KvsObject_radioButton.h | 15 +- src/modules/objects/KvsObject_slider.cpp | 122 +- src/modules/objects/KvsObject_slider.h | 36 +- src/modules/objects/KvsObject_socket.cpp | 342 +- src/modules/objects/KvsObject_socket.h | 56 +- src/modules/objects/KvsObject_spinBox.cpp | 94 +- src/modules/objects/KvsObject_spinBox.h | 34 +- src/modules/objects/KvsObject_sql.cpp | 376 +- src/modules/objects/KvsObject_sql.h | 42 +- src/modules/objects/KvsObject_tabWidget.cpp | 262 +- src/modules/objects/KvsObject_tabWidget.h | 40 +- src/modules/objects/KvsObject_tableWidget.cpp | 535 +- src/modules/objects/KvsObject_tableWidget.h | 102 +- src/modules/objects/KvsObject_textBrowser.cpp | 44 +- src/modules/objects/KvsObject_textBrowser.h | 20 +- src/modules/objects/KvsObject_toolBar.cpp | 25 +- src/modules/objects/KvsObject_toolBar.h | 14 +- src/modules/objects/KvsObject_toolButton.cpp | 148 +- src/modules/objects/KvsObject_toolButton.h | 45 +- src/modules/objects/KvsObject_trayIcon.cpp | 138 +- src/modules/objects/KvsObject_trayIcon.h | 23 +- src/modules/objects/KvsObject_treeWidget.cpp | 394 +- src/modules/objects/KvsObject_treeWidget.h | 80 +- src/modules/objects/KvsObject_treeWidgeteItem.cpp | 202 +- src/modules/objects/KvsObject_treeWidgeteItem.h | 46 +- src/modules/objects/KvsObject_vBox.cpp | 126 +- src/modules/objects/KvsObject_vBox.h | 14 +- src/modules/objects/KvsObject_webView.cpp | 898 +- src/modules/objects/KvsObject_webView.h | 58 +- src/modules/objects/KvsObject_widget.cpp | 1146 +- src/modules/objects/KvsObject_widget.h | 108 +- src/modules/objects/KvsObject_window.cpp | 62 +- src/modules/objects/KvsObject_window.h | 27 +- src/modules/objects/KvsObject_wizard.cpp | 195 +- src/modules/objects/KvsObject_wizard.h | 41 +- src/modules/objects/KvsObject_workspace.cpp | 108 +- src/modules/objects/KvsObject_workspace.h | 28 +- src/modules/objects/KvsObject_wrapper.cpp | 94 +- src/modules/objects/KvsObject_wrapper.h | 14 +- src/modules/objects/KvsObject_xmlreader.cpp | 100 +- src/modules/objects/KvsObject_xmlreader.h | 7 +- src/modules/objects/libkviobjects.cpp | 282 +- src/modules/objects/object_macros.h | 114 +- src/modules/objects/qtftp/qftp.cpp | 2309 +- src/modules/objects/qtftp/qftp.h | 437 +- src/modules/objects/qtftp/qurlinfo.cpp | 416 +- src/modules/objects/qtftp/qurlinfo.h | 114 +- src/modules/objects/qthttp/qhttp.cpp | 2876 +- src/modules/objects/qthttp/qhttp.h | 332 +- src/modules/objects/qthttp/qhttpauthenticator.cpp | 1675 +- src/modules/objects/qthttp/qhttpauthenticator_p.h | 128 +- src/modules/objects/qthttp/qringbuffer_p.h | 818 +- src/modules/options/OptionsDialog.cpp | 314 +- src/modules/options/OptionsDialog.h | 49 +- src/modules/options/OptionsInstanceManager.cpp | 5309 ++- src/modules/options/OptionsInstanceManager.h | 33 +- src/modules/options/OptionsWidgetContainer.cpp | 44 +- src/modules/options/OptionsWidgetContainer.h | 13 +- .../OptionsWidget_alertsAndHighlighting.cpp | 85 +- .../options/OptionsWidget_alertsAndHighlighting.h | 5 +- src/modules/options/OptionsWidget_antiSpam.cpp | 18 +- src/modules/options/OptionsWidget_antiSpam.h | 2 +- src/modules/options/OptionsWidget_avatar.cpp | 142 +- src/modules/options/OptionsWidget_avatar.h | 1 - src/modules/options/OptionsWidget_away.cpp | 26 +- src/modules/options/OptionsWidget_away.h | 11 +- src/modules/options/OptionsWidget_channel.cpp | 153 +- src/modules/options/OptionsWidget_channel.h | 2 + src/modules/options/OptionsWidget_connection.cpp | 271 +- src/modules/options/OptionsWidget_connection.h | 2 +- src/modules/options/OptionsWidget_ctcp.cpp | 43 +- src/modules/options/OptionsWidget_ctcp.h | 1 - .../options/OptionsWidget_ctcpFloodProtection.cpp | 48 +- .../options/OptionsWidget_ctcpFloodProtection.h | 2 +- src/modules/options/OptionsWidget_dcc.cpp | 486 +- src/modules/options/OptionsWidget_general.cpp | 12 +- src/modules/options/OptionsWidget_identity.cpp | 640 +- src/modules/options/OptionsWidget_identity.h | 112 +- src/modules/options/OptionsWidget_ignore.cpp | 19 +- src/modules/options/OptionsWidget_ignore.h | 1 + src/modules/options/OptionsWidget_input.cpp | 120 +- src/modules/options/OptionsWidget_input.h | 6 +- .../options/OptionsWidget_interfaceFeatures.cpp | 37 +- src/modules/options/OptionsWidget_irc.cpp | 41 +- src/modules/options/OptionsWidget_irc.h | 1 - src/modules/options/OptionsWidget_ircOutput.cpp | 73 +- src/modules/options/OptionsWidget_ircOutput.h | 3 +- src/modules/options/OptionsWidget_ircView.cpp | 144 +- src/modules/options/OptionsWidget_ircView.h | 4 +- src/modules/options/OptionsWidget_lag.cpp | 54 +- src/modules/options/OptionsWidget_logging.cpp | 44 +- src/modules/options/OptionsWidget_mediaTypes.cpp | 158 +- src/modules/options/OptionsWidget_mediaTypes.h | 30 +- src/modules/options/OptionsWidget_message.cpp | 405 +- src/modules/options/OptionsWidget_message.h | 53 +- src/modules/options/OptionsWidget_nickserv.cpp | 277 +- src/modules/options/OptionsWidget_nickserv.h | 26 +- src/modules/options/OptionsWidget_notifier.cpp | 176 +- src/modules/options/OptionsWidget_notifier.h | 6 +- src/modules/options/OptionsWidget_notify.cpp | 58 +- src/modules/options/OptionsWidget_protection.cpp | 2 +- src/modules/options/OptionsWidget_proxy.cpp | 146 +- src/modules/options/OptionsWidget_proxy.h | 42 +- src/modules/options/OptionsWidget_query.cpp | 124 +- src/modules/options/OptionsWidget_servers.cpp | 1263 +- src/modules/options/OptionsWidget_servers.h | 195 +- src/modules/options/OptionsWidget_sound.cpp | 118 +- src/modules/options/OptionsWidget_sound.h | 5 +- src/modules/options/OptionsWidget_textEncoding.cpp | 111 +- src/modules/options/OptionsWidget_textEncoding.h | 4 +- src/modules/options/OptionsWidget_textIcons.cpp | 140 +- src/modules/options/OptionsWidget_textIcons.h | 27 +- src/modules/options/OptionsWidget_theme.cpp | 188 +- src/modules/options/OptionsWidget_theme.h | 12 +- src/modules/options/OptionsWidget_tools.cpp | 10 +- src/modules/options/OptionsWidget_topicLabel.cpp | 11 +- src/modules/options/OptionsWidget_topicLabel.h | 1 - src/modules/options/OptionsWidget_tray.cpp | 46 +- src/modules/options/OptionsWidget_tray.h | 1 + src/modules/options/OptionsWidget_uparser.cpp | 47 +- src/modules/options/OptionsWidget_urlHandlers.cpp | 122 +- src/modules/options/OptionsWidget_urlHandlers.h | 1 + src/modules/options/OptionsWidget_userList.cpp | 172 +- src/modules/options/OptionsWidget_userList.h | 11 +- src/modules/options/OptionsWidget_windowList.cpp | 189 +- src/modules/options/OptionsWidget_windowList.h | 7 +- src/modules/options/libkvioptions.cpp | 113 +- src/modules/package/libkvipackage.cpp | 99 +- src/modules/perl/libkviperl.cpp | 113 +- src/modules/perlcore/libkviperlcore.cpp | 202 +- src/modules/perlcore/perlcoreinterface.h | 21 +- src/modules/perlcore/ppport.h | 2734 +- src/modules/popup/libkvipopup.cpp | 402 +- src/modules/popupeditor/PopupEditorWindow.cpp | 826 +- src/modules/popupeditor/PopupEditorWindow.h | 122 +- src/modules/popupeditor/libkvipopupeditor.cpp | 23 +- src/modules/proxydb/libkviproxydb.cpp | 295 +- src/modules/python/libkvipython.cpp | 111 +- src/modules/pythoncore/kvircmodule.cpp | 123 +- src/modules/pythoncore/kvircmodule.h | 77 +- src/modules/pythoncore/libkvipythoncore.cpp | 97 +- src/modules/pythoncore/pythoncoreinterface.h | 21 +- src/modules/raweditor/RawEditorWindow.cpp | 252 +- src/modules/raweditor/RawEditorWindow.h | 73 +- src/modules/raweditor/libkviraweditor.cpp | 23 +- src/modules/regchan/libkviregchan.cpp | 179 +- src/modules/reguser/RegisteredUserEntryDialog.cpp | 380 +- src/modules/reguser/RegisteredUserEntryDialog.h | 70 +- src/modules/reguser/RegisteredUsersDialog.cpp | 617 +- src/modules/reguser/RegisteredUsersDialog.h | 74 +- src/modules/reguser/RegistrationWizard.cpp | 232 +- src/modules/reguser/RegistrationWizard.h | 55 +- src/modules/reguser/libkvireguser.cpp | 332 +- src/modules/rijndael/BlowFish.cpp | 639 +- src/modules/rijndael/BlowFish.h | 38 +- src/modules/rijndael/InitVectorEngine.cpp | 2 +- src/modules/rijndael/InitVectorEngine.h | 2 +- src/modules/rijndael/Rijndael.cpp | 2334 +- src/modules/rijndael/Rijndael.h | 59 +- src/modules/rijndael/UglyBase64.cpp | 57 +- src/modules/rijndael/UglyBase64.h | 2 +- src/modules/rijndael/libkvirijndael.cpp | 1007 +- src/modules/rijndael/libkvirijndael.h | 299 +- src/modules/rot13/libkvirot13.cpp | 116 +- src/modules/rot13/libkvirot13.h | 25 +- src/modules/serverdb/libkviserverdb.cpp | 592 +- src/modules/setup/SetupWizard.cpp | 721 +- src/modules/setup/SetupWizard.h | 97 +- src/modules/setup/libkvisetup.cpp | 50 +- src/modules/sharedfile/libkvisharedfile.cpp | 100 +- .../sharedfileswindow/SharedFilesWindow.cpp | 201 +- src/modules/sharedfileswindow/SharedFilesWindow.h | 36 +- .../sharedfileswindow/libkvisharedfileswindow.cpp | 30 +- src/modules/snd/libkvisnd.cpp | 684 +- src/modules/snd/libkvisnd.h | 156 +- src/modules/socketspy/SocketSpyWindow.cpp | 21 +- src/modules/socketspy/SocketSpyWindow.h | 6 +- src/modules/socketspy/libkvisocketspy.cpp | 27 +- src/modules/spaste/SlowPasteController.cpp | 54 +- src/modules/spaste/SlowPasteController.h | 20 +- src/modules/spaste/libkvispaste.cpp | 128 +- src/modules/spaste/libkvispaste.h | 5 +- src/modules/spellchecker/libkvispellchecker.cpp | 85 +- src/modules/str/libkvistr.cpp | 875 +- src/modules/system/Plugin.cpp | 119 +- src/modules/system/Plugin.h | 55 +- src/modules/system/libkvisystem.cpp | 284 +- src/modules/term/TermWidget.cpp | 234 +- src/modules/term/TermWidget.h | 95 +- src/modules/term/TermWindow.cpp | 78 +- src/modules/term/TermWindow.h | 59 +- src/modules/term/libkviterm.cpp | 42 +- src/modules/texticons/libkvitexticons.cpp | 59 +- src/modules/theme/PackThemeDialog.cpp | 216 +- src/modules/theme/PackThemeDialog.h | 35 +- src/modules/theme/SaveThemeDialog.cpp | 188 +- src/modules/theme/SaveThemeDialog.h | 21 +- src/modules/theme/ThemeFunctions.cpp | 255 +- src/modules/theme/ThemeFunctions.h | 48 +- src/modules/theme/ThemeManagementDialog.cpp | 191 +- src/modules/theme/ThemeManagementDialog.h | 27 +- src/modules/theme/WebThemeInterfaceDialog.cpp | 29 +- src/modules/theme/WebThemeInterfaceDialog.h | 10 +- src/modules/theme/libkvitheme.cpp | 159 +- src/modules/tip/libkvitip.cpp | 149 +- src/modules/tip/libkvitip.h | 20 +- src/modules/tmphighlight/libkvitmphighlight.cpp | 94 +- src/modules/toolbar/libkvitoolbar.cpp | 147 +- .../toolbareditor/CustomizeToolBarsDialog.cpp | 265 +- .../toolbareditor/CustomizeToolBarsDialog.h | 30 +- src/modules/toolbareditor/libkvitoolbareditor.cpp | 38 +- src/modules/torrent/KTorrentDbusInterface.cpp | 283 +- src/modules/torrent/KTorrentDbusInterface.h | 69 +- src/modules/torrent/StatusBarApplet.cpp | 46 +- src/modules/torrent/StatusBarApplet.h | 4 +- src/modules/torrent/TorrentInterface.cpp | 2 +- src/modules/torrent/TorrentInterface.h | 136 +- src/modules/torrent/libkvitorrent.cpp | 349 +- src/modules/trayicon/libkvitrayicon.cpp | 415 +- src/modules/trayicon/libkvitrayicon.h | 9 +- src/modules/upnp/Manager.cpp | 198 +- src/modules/upnp/Manager.h | 117 +- src/modules/upnp/RootService.cpp | 481 +- src/modules/upnp/RootService.h | 94 +- src/modules/upnp/Service.cpp | 476 +- src/modules/upnp/Service.h | 149 +- src/modules/upnp/SsdpConnection.cpp | 186 +- src/modules/upnp/SsdpConnection.h | 28 +- src/modules/upnp/WanConnectionService.cpp | 257 +- src/modules/upnp/WanConnectionService.h | 114 +- src/modules/upnp/XmlFunctions.cpp | 114 +- src/modules/upnp/XmlFunctions.h | 24 +- src/modules/upnp/igdcontrolpoint.cpp | 190 +- src/modules/upnp/igdcontrolpoint.h | 81 +- src/modules/upnp/libkviupnp.cpp | 54 +- src/modules/url/libkviurl.cpp | 419 +- src/modules/url/libkviurl.h | 47 +- src/modules/userlist/libkviuserlist.cpp | 125 +- src/modules/window/UserWindow.cpp | 27 +- src/modules/window/UserWindow.h | 9 +- src/modules/window/libkviwindow.cpp | 451 +- 445 files changed, 63303 insertions(+), 60185 deletions(-) (limited to 'src/modules') diff --git a/src/modules/about/AboutDialog.cpp b/src/modules/about/AboutDialog.cpp index fcf9a9a38..8c8e48239 100644 --- a/src/modules/about/AboutDialog.cpp +++ b/src/modules/about/AboutDialog.cpp @@ -74,14 +74,14 @@ extern AboutDialog * g_pAboutDialog; #include "abouttext.inc" AboutDialog::AboutDialog() -: KviTalTabDialog(0) + : KviTalTabDialog(0) { - setWindowTitle(__tr2qs_ctx("About KVIrc","about")); - setOkButton(__tr2qs_ctx("Close","about")); + setWindowTitle(__tr2qs_ctx("About KVIrc", "about")); + setOkButton(__tr2qs_ctx("Close", "about")); // About tab QString buffer; - g_pApp->findImage(buffer,"kvi_release_art.png"); + g_pApp->findImage(buffer, "kvi_release_art.png"); QPixmap pix(buffer); @@ -96,17 +96,16 @@ AboutDialog::AboutDialog() l->setAlignment(Qt::AlignCenter); l->setPixmap(pix); - g->addWidget(l,0,0); + g->addWidget(l, 0, 0); - QString aboutString= "KVIrc " KVI_VERSION " '" KVI_RELEASE_NAME "'
"; - aboutString += __tr2qs_ctx("Forged by the KVIrc Development Team","about"); + QString aboutString = "KVIrc " KVI_VERSION " '" KVI_RELEASE_NAME "'
"; + aboutString += __tr2qs_ctx("Forged by the KVIrc Development Team", "about"); - l = new QLabel(aboutString,w); + l = new QLabel(aboutString, w); l->setAlignment(Qt::AlignCenter); - g->addWidget(l,1,0); - - addTab(w,__tr2qs_ctx("About","about")); + g->addWidget(l, 1, 0); + addTab(w, __tr2qs_ctx("About", "about")); // Info tab w = new QWidget(this); @@ -114,14 +113,14 @@ AboutDialog::AboutDialog() QTextEdit * v = new QTextEdit(w); v->setReadOnly(true); - g->addWidget(v,0,0); + g->addWidget(v, 0, 0); // Get info QString infoString = "KVIrc " KVI_VERSION " '" KVI_RELEASE_NAME "'

"; infoString += ""; - infoString += __tr2qs_ctx("Runtime Info","about"); + infoString += __tr2qs_ctx("Runtime Info", "about"); infoString += ":
"; - infoString += __tr2qs_ctx("System name","about"); + infoString += __tr2qs_ctx("System name", "about"); infoString += ": "; infoString += KviRuntimeInfo::name(); #ifndef COMPILE_ON_MAC @@ -129,74 +128,73 @@ AboutDialog::AboutDialog() infoString += KviRuntimeInfo::release(); #endif infoString += "
"; - infoString += __tr2qs_ctx("System version","about"); + infoString += __tr2qs_ctx("System version", "about"); infoString += ": "; infoString += KviRuntimeInfo::version(); infoString += "
"; - infoString += __tr2qs_ctx("Architecture","about"); + infoString += __tr2qs_ctx("Architecture", "about"); infoString += ": "; infoString += KviRuntimeInfo::machine(); infoString += "
"; - infoString += __tr2qs_ctx("Qt version","about"); + infoString += __tr2qs_ctx("Qt version", "about"); infoString += ": "; infoString += KviRuntimeInfo::qtVersion(); infoString += "
"; - infoString += __tr2qs_ctx("Qt theme","about"); + infoString += __tr2qs_ctx("Qt theme", "about"); infoString += ": "; infoString += KviRuntimeInfo::qtTheme(); infoString += "

"; infoString += ""; - infoString += __tr2qs_ctx("Build Info","about"); + infoString += __tr2qs_ctx("Build Info", "about"); infoString += ":
"; - infoString += __tr2qs_ctx("Build date","about"); + infoString += __tr2qs_ctx("Build date", "about"); infoString += ": "; infoString += KviBuildInfo::buildDate(); infoString += "
"; - infoString += __tr2qs_ctx("Sources date","about"); + infoString += __tr2qs_ctx("Sources date", "about"); infoString += ": "; infoString += KviBuildInfo::buildSourcesDate(); infoString += "
"; - infoString += __tr2qs_ctx("Revision number","about"); + infoString += __tr2qs_ctx("Revision number", "about"); infoString += ": "; infoString += KviBuildInfo::buildRevision(); infoString += "
"; - infoString += __tr2qs_ctx("System name","about"); + infoString += __tr2qs_ctx("System name", "about"); infoString += ": "; infoString += KviBuildInfo::buildSystem(); infoString += "
"; - infoString += __tr2qs_ctx("CPU name","about"); + infoString += __tr2qs_ctx("CPU name", "about"); infoString += ": "; infoString += KviBuildInfo::buildCPU(); infoString += "
"; - infoString += __tr2qs_ctx("Build command","about"); + infoString += __tr2qs_ctx("Build command", "about"); infoString += ": "; infoString += KviBuildInfo::buildCommand(); infoString += "
"; - infoString += __tr2qs_ctx("Build flags","about"); + infoString += __tr2qs_ctx("Build flags", "about"); infoString += ":
   "; QString flags = KviBuildInfo::buildFlags(); - infoString += flags.replace(QRegExp(";"),"
   "); + infoString += flags.replace(QRegExp(";"), "
   "); infoString += "
"; - infoString += __tr2qs_ctx("Compiler name","about"); + infoString += __tr2qs_ctx("Compiler name", "about"); infoString += ": "; infoString += KviBuildInfo::buildCompiler(); infoString += "
"; - infoString += __tr2qs_ctx("Compiler flags","about"); + infoString += __tr2qs_ctx("Compiler flags", "about"); infoString += ": "; infoString += KviBuildInfo::buildCompilerFlags(); infoString += "
"; - infoString += __tr2qs_ctx("Qt version","about"); + infoString += __tr2qs_ctx("Qt version", "about"); infoString += ": "; infoString += KviBuildInfo::qtVersion(); infoString += "
"; - infoString += __tr2qs_ctx("Features","about"); + infoString += __tr2qs_ctx("Features", "about"); infoString += ": "; infoString += KviBuildInfo::features(); v->setText(infoString); - addTab(w,__tr2qs_ctx("Executable Information","about")); - + addTab(w, __tr2qs_ctx("Executable Information", "about")); // Honor & Glory tab w = new QWidget(this); @@ -204,12 +202,11 @@ AboutDialog::AboutDialog() v = new QTextEdit(w); v->setReadOnly(true); - g->addWidget(v,0,0); + g->addWidget(v, 0, 0); v->setText(g_szAboutText); - addTab(w,__tr2qs_ctx("Honor && Glory","about")); - + addTab(w, __tr2qs_ctx("Honor && Glory", "about")); // License tab w = new QWidget(this); @@ -218,26 +215,26 @@ AboutDialog::AboutDialog() v = new QTextEdit(w); v->setReadOnly(true); v->setWordWrapMode(QTextOption::NoWrap); - g->addWidget(v,0,0); + g->addWidget(v, 0, 0); QString szLicense; QString szLicensePath; - g_pApp->getGlobalKvircDirectory(szLicensePath,KviApplication::License,"COPYING"); + g_pApp->getGlobalKvircDirectory(szLicensePath, KviApplication::License, "COPYING"); - if(!KviFileUtils::loadFile(szLicensePath,szLicense)) + if(!KviFileUtils::loadFile(szLicensePath, szLicense)) { - szLicense = __tr2qs_ctx("Oops! Can't find the license file.\n" \ - "It MUST be included in the distribution...\n" \ - "Please report to ","about"); + szLicense = __tr2qs_ctx("Oops! Can't find the license file.\n" + "It MUST be included in the distribution...\n" + "Please report to ", + "about"); } v->setText(szLicense); - addTab(w,__tr2qs_ctx("License","about")); - + addTab(w, __tr2qs_ctx("License", "about")); - connect(this,SIGNAL(applyButtonPressed()),this,SLOT(closeButtonPressed())); + connect(this, SIGNAL(applyButtonPressed()), this, SLOT(closeButtonPressed())); } AboutDialog::~AboutDialog() @@ -245,7 +242,7 @@ AboutDialog::~AboutDialog() g_pAboutDialog = 0; } -void AboutDialog::closeEvent(QCloseEvent *e) +void AboutDialog::closeEvent(QCloseEvent * e) { e->ignore(); delete this; diff --git a/src/modules/about/AboutDialog.h b/src/modules/about/AboutDialog.h index 7a94667cf..7f4f819df 100644 --- a/src/modules/about/AboutDialog.h +++ b/src/modules/about/AboutDialog.h @@ -32,8 +32,9 @@ class AboutDialog : public KviTalTabDialog public: AboutDialog(); ~AboutDialog(); + protected: - virtual void closeEvent(QCloseEvent *e); + virtual void closeEvent(QCloseEvent * e); protected slots: void closeButtonPressed(); }; diff --git a/src/modules/about/libkviabout.cpp b/src/modules/about/libkviabout.cpp index 9b2d726b6..05ed81adb 100644 --- a/src/modules/about/libkviabout.cpp +++ b/src/modules/about/libkviabout.cpp @@ -55,34 +55,35 @@ AboutDialog * g_pAboutDialog = 0; [/example] */ - static bool about_kvs_command_kvirc(KviKvsModuleCommandCall *) { - if(!g_pAboutDialog) + if(!g_pAboutDialog) { g_pAboutDialog = new AboutDialog(); g_pAboutDialog->show(); - } else { + } + else + { g_pAboutDialog->raise(); g_pAboutDialog->show(); } return true; } - // ======================================= // init routine // ======================================= static bool about_module_init(KviModule * m) { - KVSM_REGISTER_SIMPLE_COMMAND(m,"kvirc",about_kvs_command_kvirc) + KVSM_REGISTER_SIMPLE_COMMAND(m, "kvirc", about_kvs_command_kvirc) return true; } static bool about_module_cleanup(KviModule *) { - if(g_pAboutDialog)delete g_pAboutDialog; + if(g_pAboutDialog) + delete g_pAboutDialog; g_pAboutDialog = 0; return true; } @@ -97,15 +98,14 @@ static bool about_module_can_unload(KviModule *) // ======================================= KVIRC_MODULE( - "KVIrc about dialog", - "4.0.0", - "Till Bush \n" \ - "Szymon Stefanek " \ - "Elvio Basello ", - "Exports the /about.kvirc command\n", - about_module_init, - about_module_can_unload, - 0, - about_module_cleanup, - "about" -) + "KVIrc about dialog", + "4.0.0", + "Till Bush \n" + "Szymon Stefanek " + "Elvio Basello ", + "Exports the /about.kvirc command\n", + about_module_init, + about_module_can_unload, + 0, + about_module_cleanup, + "about") diff --git a/src/modules/action/libkviaction.cpp b/src/modules/action/libkviaction.cpp index cd61c9cd6..7683444f9 100644 --- a/src/modules/action/libkviaction.cpp +++ b/src/modules/action/libkviaction.cpp @@ -55,17 +55,17 @@ static bool action_kvs_cmd_list(KviKvsModuleCommandCall * c) { KviWindow * pOut = c->window(); - KviPointerHashTableIterator it(*(KviActionManager::instance()->actions())); + KviPointerHashTableIterator it(*(KviActionManager::instance()->actions())); while(KviAction * a = it.current()) { if(a->isKviUserActionNeverOverrideThis()) - pOut->output(KVI_OUT_VERBOSE,__tr2qs("%cCore action: %Q"),KviControlCodes::Bold,&(a->name())); + pOut->output(KVI_OUT_VERBOSE, __tr2qs("%cCore action: %Q"), KviControlCodes::Bold, &(a->name())); else - pOut->output(KVI_OUT_VERBOSE,__tr2qs("%cUser action: %Q"),KviControlCodes::Bold,&(a->name())); - pOut->output(KVI_OUT_VERBOSE,__tr2qs("Label: %Q"),&(a->visibleName())); - pOut->output(KVI_OUT_VERBOSE,__tr2qs("Category: %Q"),&(a->category()->visibleName())); - pOut->output(KVI_OUT_VERBOSE,__tr2qs("Description: %Q"),&(a->description())); - pOut->output(KVI_OUT_VERBOSE," "); // spacer + pOut->output(KVI_OUT_VERBOSE, __tr2qs("%cUser action: %Q"), KviControlCodes::Bold, &(a->name())); + pOut->output(KVI_OUT_VERBOSE, __tr2qs("Label: %Q"), &(a->visibleName())); + pOut->output(KVI_OUT_VERBOSE, __tr2qs("Category: %Q"), &(a->category()->visibleName())); + pOut->output(KVI_OUT_VERBOSE, __tr2qs("Description: %Q"), &(a->description())); + pOut->output(KVI_OUT_VERBOSE, " "); // spacer ++it; } return true; @@ -98,7 +98,7 @@ static bool action_kvs_cmd_trigger(KviKvsModuleCommandCall * c) { QString szName; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("name",KVS_PT_NONEMPTYSTRING,0,szName) + KVSM_PARAMETER("name", KVS_PT_NONEMPTYSTRING, 0, szName) KVSM_PARAMETERS_END(c) KviAction * a = KviActionManager::instance()->getAction(szName); @@ -107,11 +107,15 @@ static bool action_kvs_cmd_trigger(KviKvsModuleCommandCall * c) if(a->isEnabled()) { a->activate(); - } else { - if(!c->switches()->find('q',"quiet")) + } + else + { + if(!c->switches()->find('q', "quiet")) c->warning(__tr2qs("The action \"%1\" is disabled").arg(szName)); } - } else { + } + else + { c->warning(__tr2qs("The action \"%1\" doesn't exist").arg(szName)); } @@ -149,15 +153,18 @@ static bool action_kvs_cmd_enable(KviKvsModuleCommandCall * c) { QString szName; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("name",KVS_PT_NONEMPTYSTRING,0,szName) + KVSM_PARAMETER("name", KVS_PT_NONEMPTYSTRING, 0, szName) KVSM_PARAMETERS_END(c) KviAction * a = KviActionManager::instance()->getAction(szName); if(a) { - if(!a->isEnabled())a->setEnabled(true); - } else { - if(!c->switches()->find('q',"quiet")) + if(!a->isEnabled()) + a->setEnabled(true); + } + else + { + if(!c->switches()->find('q', "quiet")) c->warning(__tr2qs("The action \"%1\" doesn't exist").arg(szName)); } @@ -197,15 +204,18 @@ static bool action_kvs_cmd_disable(KviKvsModuleCommandCall * c) { QString szName; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("name",KVS_PT_NONEMPTYSTRING,0,szName) + KVSM_PARAMETER("name", KVS_PT_NONEMPTYSTRING, 0, szName) KVSM_PARAMETERS_END(c) KviAction * a = KviActionManager::instance()->getAction(szName); if(a) { - if(a->isEnabled())a->setEnabled(false); - } else { - if(!c->switches()->find('q',"quiet")) + if(a->isEnabled()) + a->setEnabled(false); + } + else + { + if(!c->switches()->find('q', "quiet")) c->warning(__tr2qs("The action \"%1\" doesn't exist").arg(szName)); } @@ -241,7 +251,7 @@ static bool action_kvs_cmd_destroy(KviKvsModuleCommandCall * c) { QString szName; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("name",KVS_PT_NONEMPTYSTRING,0,szName) + KVSM_PARAMETER("name", KVS_PT_NONEMPTYSTRING, 0, szName) KVSM_PARAMETERS_END(c) KviAction * a = KviActionManager::instance()->getAction(szName); @@ -250,12 +260,16 @@ static bool action_kvs_cmd_destroy(KviKvsModuleCommandCall * c) if(a->isKviUserActionNeverOverrideThis()) { a->suicide(); - } else { - if(!c->switches()->find('q',"quiet")) + } + else + { + if(!c->switches()->find('q', "quiet")) c->warning(__tr2qs("The action \"%1\" is a core action and can't be destroyed").arg(szName)); } - } else { - if(!c->switches()->find('q',"quiet")) + } + else + { + if(!c->switches()->find('q', "quiet")) c->warning(__tr2qs("The action \"%1\" doesn't exist").arg(szName)); } @@ -355,61 +369,68 @@ static bool action_kvs_cmd_destroy(KviKvsModuleCommandCall * c) static bool action_kvs_cmd_create(KviKvsModuleCallbackCommandCall * c) { - QString szName,szVisibleText,szDescription,szBigIconId,szSmallIconId; + QString szName, szVisibleText, szDescription, szBigIconId, szSmallIconId; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("name",KVS_PT_NONEMPTYSTRING,0,szName) - KVSM_PARAMETER_IGNORED("visible_label") - KVSM_PARAMETER_IGNORED("description") - KVSM_PARAMETER("big_icon_id",KVS_PT_NONEMPTYSTRING,0,szBigIconId) - KVSM_PARAMETER("small_icon_id",KVS_PT_STRING,KVS_PF_OPTIONAL,szSmallIconId) + KVSM_PARAMETER("name", KVS_PT_NONEMPTYSTRING, 0, szName) + KVSM_PARAMETER_IGNORED("visible_label") + KVSM_PARAMETER_IGNORED("description") + KVSM_PARAMETER("big_icon_id", KVS_PT_NONEMPTYSTRING, 0, szBigIconId) + KVSM_PARAMETER("small_icon_id", KVS_PT_STRING, KVS_PF_OPTIONAL, szSmallIconId) KVSM_PARAMETERS_END(c) - if(!(c->getParameterCode(1,szVisibleText) && c->getParameterCode(2,szDescription))) + if(!(c->getParameterCode(1, szVisibleText) && c->getParameterCode(2, szDescription))) { c->error(__tr2qs("Internal error: call a head-shrinker")); return false; } - QString szCategory,szWindows,szKeySequence; + QString szCategory, szWindows, szKeySequence; int iFlags = 0; - if(c->switches()->find('i',"bind-to-context"))iFlags |= KviAction::NeedsContext; - if(c->switches()->find('c',"bind-to-connection"))iFlags |= KviAction::NeedsConnection | KviAction::NeedsContext; - if(c->switches()->find('l',"enable-at-login")) + if(c->switches()->find('i', "bind-to-context")) + iFlags |= KviAction::NeedsContext; + if(c->switches()->find('c', "bind-to-connection")) + iFlags |= KviAction::NeedsConnection | KviAction::NeedsContext; + if(c->switches()->find('l', "enable-at-login")) { if(iFlags & KviAction::NeedsConnection) iFlags |= KviAction::EnableAtLogin; else c->warning(__tr2qs("The switch -l requires -c")); } - c->switches()->getAsStringIfExisting('t',"category",szCategory); - if(szCategory.isEmpty())szCategory = "generic"; - c->switches()->getAsStringIfExisting('w',"window-types",szWindows); + c->switches()->getAsStringIfExisting('t', "category", szCategory); + if(szCategory.isEmpty()) + szCategory = "generic"; + c->switches()->getAsStringIfExisting('w', "window-types", szWindows); if(!szWindows.isEmpty()) { - if(szWindows.indexOf('c',Qt::CaseInsensitive) != -1)iFlags |= KviAction::WindowChannel; - if(szWindows.indexOf('x',Qt::CaseInsensitive) != -1)iFlags |= KviAction::WindowConsole; - if(szWindows.indexOf('d',Qt::CaseInsensitive) != -1)iFlags |= KviAction::WindowDccChat; - if(szWindows.indexOf('q',Qt::CaseInsensitive) != -1)iFlags |= KviAction::WindowQuery; + if(szWindows.indexOf('c', Qt::CaseInsensitive) != -1) + iFlags |= KviAction::WindowChannel; + if(szWindows.indexOf('x', Qt::CaseInsensitive) != -1) + iFlags |= KviAction::WindowConsole; + if(szWindows.indexOf('d', Qt::CaseInsensitive) != -1) + iFlags |= KviAction::WindowDccChat; + if(szWindows.indexOf('q', Qt::CaseInsensitive) != -1) + iFlags |= KviAction::WindowQuery; } - if(c->switches()->find('s',"enable-on-selected")) + if(c->switches()->find('s', "enable-on-selected")) { if(iFlags & (KviAction::WindowChannel | KviAction::WindowConsole | KviAction::WindowQuery)) iFlags |= KviAction::WindowOnlyIfUsersSelected; else c->warning(__tr2qs("The switch -s requires -w with a combination of flags 'c','x' and 'q'")); } - c->switches()->getAsStringIfExisting('k',"key-sequence",szKeySequence); - + c->switches()->getAsStringIfExisting('k', "key-sequence", szKeySequence); KviAction * old = KviActionManager::instance()->getAction(szName); if(old) { if(old->isKviUserActionNeverOverrideThis()) old->suicide(); - else { + else + { c->warning(__tr2qs("The action \"%1\" is already defined as core action and can't be overridden").arg(szName)); return false; } @@ -426,12 +447,12 @@ static bool action_kvs_cmd_create(KviKvsModuleCallbackCommandCall * c) int iOldFlags = iFlags; iFlags = KviAction::validateFlags(iFlags); if(iFlags != iOldFlags) - qDebug("action.validate has provided invalid flags: %d fixed to %d",iOldFlags,iFlags); + qDebug("action.validate has provided invalid flags: %d fixed to %d", iOldFlags, iFlags); KviKvsUserAction * a = KviKvsUserAction::createInstance(KviActionManager::instance(), - szName,szCmd,szVisibleText, - szDescription,szCategory,szBigIconId, - szSmallIconId,iFlags,szKeySequence); + szName, szCmd, szVisibleText, + szDescription, szCategory, szBigIconId, + szSmallIconId, iFlags, szKeySequence); KviActionManager::instance()->registerAction(a); @@ -457,7 +478,7 @@ static bool action_kvs_fnc_exists(KviKvsModuleFunctionCall * c) { QString szName; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("action_name",KVS_PT_NONEMPTYSTRING,0,szName) + KVSM_PARAMETER("action_name", KVS_PT_NONEMPTYSTRING, 0, szName) KVSM_PARAMETERS_END(c) c->returnValue()->setBoolean(KviActionManager::instance()->getAction(szName) ? true : false); return true; @@ -482,7 +503,7 @@ static bool action_kvs_fnc_isEnabled(KviKvsModuleFunctionCall * c) { QString szName; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("action_name",KVS_PT_NONEMPTYSTRING,0,szName) + KVSM_PARAMETER("action_name", KVS_PT_NONEMPTYSTRING, 0, szName) KVSM_PARAMETERS_END(c) KviAction * a = KviActionManager::instance()->getAction(szName); if(a) @@ -492,20 +513,19 @@ static bool action_kvs_fnc_isEnabled(KviKvsModuleFunctionCall * c) return true; } - -static bool action_module_init(KviModule *m) +static bool action_module_init(KviModule * m) { // setlabel, $label, $position, move, $itempos, $itemexists, $itemtype - KVSM_REGISTER_SIMPLE_COMMAND(m,"list",action_kvs_cmd_list); - KVSM_REGISTER_SIMPLE_COMMAND(m,"trigger",action_kvs_cmd_trigger); - KVSM_REGISTER_SIMPLE_COMMAND(m,"enable",action_kvs_cmd_enable); - KVSM_REGISTER_SIMPLE_COMMAND(m,"disable",action_kvs_cmd_disable); - KVSM_REGISTER_SIMPLE_COMMAND(m,"destroy",action_kvs_cmd_destroy); + KVSM_REGISTER_SIMPLE_COMMAND(m, "list", action_kvs_cmd_list); + KVSM_REGISTER_SIMPLE_COMMAND(m, "trigger", action_kvs_cmd_trigger); + KVSM_REGISTER_SIMPLE_COMMAND(m, "enable", action_kvs_cmd_enable); + KVSM_REGISTER_SIMPLE_COMMAND(m, "disable", action_kvs_cmd_disable); + KVSM_REGISTER_SIMPLE_COMMAND(m, "destroy", action_kvs_cmd_destroy); - KVSM_REGISTER_CALLBACK_COMMAND(m,"create",action_kvs_cmd_create); + KVSM_REGISTER_CALLBACK_COMMAND(m, "create", action_kvs_cmd_create); - KVSM_REGISTER_FUNCTION(m,"exists",action_kvs_fnc_exists); - KVSM_REGISTER_FUNCTION(m,"isEnabled",action_kvs_fnc_isEnabled); + KVSM_REGISTER_FUNCTION(m, "exists", action_kvs_fnc_exists); + KVSM_REGISTER_FUNCTION(m, "isEnabled", action_kvs_fnc_isEnabled); return true; } @@ -515,13 +535,12 @@ static bool action_module_cleanup(KviModule *) } KVIRC_MODULE( - "action", // module name - "4.0.0", // module version - "Copyright (C) 2004 Szymon Stefanek (pragma at kvirc dot net)", // author & (C) - "Interface to the system actions", - action_module_init, - 0, - 0, - action_module_cleanup, - 0 -) + "action", // module name + "4.0.0", // module version + "Copyright (C) 2004 Szymon Stefanek (pragma at kvirc dot net)", // author & (C) + "Interface to the system actions", + action_module_init, + 0, + 0, + action_module_cleanup, + 0) diff --git a/src/modules/actioneditor/ActionEditor.cpp b/src/modules/actioneditor/ActionEditor.cpp index 5cb2e833d..925061a31 100644 --- a/src/modules/actioneditor/ActionEditor.cpp +++ b/src/modules/actioneditor/ActionEditor.cpp @@ -56,7 +56,6 @@ #include #include - extern ActionEditorWindow * g_pActionEditorWindow; static QString g_szLastEditedAction; @@ -66,8 +65,8 @@ static QString g_szLastEditedAction; #define LVI_SPACING 8 #define LVI_MINIMUM_CELL_WIDTH (LVI_MINIMUM_TEXT_WIDTH + LVI_BORDER + LVI_ICON_SIZE + LVI_SPACING + LVI_BORDER) -ActionEditorTreeWidgetItem::ActionEditorTreeWidgetItem(QTreeWidget * v,ActionData * a) -: QTreeWidgetItem(v) +ActionEditorTreeWidgetItem::ActionEditorTreeWidgetItem(QTreeWidget * v, ActionData * a) + : QTreeWidgetItem(v) { m_pActionData = a; m_pTreeWidget = v; @@ -75,9 +74,10 @@ ActionEditorTreeWidgetItem::ActionEditorTreeWidgetItem(QTreeWidget * v,ActionDat QString t = "" + m_pActionData->m_szName + ""; t += "
" + m_pActionData->m_szVisibleName + ""; m_szKey = m_pActionData->m_szName.toUpper(); - setText(0,t); + setText(0, t); QPixmap * p = g_pIconManager->getBigIcon(m_pActionData->m_szBigIcon); - if(p)setIcon(0,*p); + if(p) + setIcon(0, *p); } ActionEditorTreeWidgetItem::~ActionEditorTreeWidgetItem() @@ -85,197 +85,205 @@ ActionEditorTreeWidgetItem::~ActionEditorTreeWidgetItem() delete m_pActionData; } - -QString ActionEditorTreeWidgetItem::key(int,bool) const +QString ActionEditorTreeWidgetItem::key(int, bool) const { return m_szKey; } -SingleActionEditor::SingleActionEditor(QWidget * par,ActionEditor * ed) -: QWidget(par) +SingleActionEditor::SingleActionEditor(QWidget * par, ActionEditor * ed) + : QWidget(par) { m_pActionEditor = ed; m_pActionData = 0; QGridLayout * g = new QGridLayout(this); - QLabel * l = new QLabel(__tr2qs_ctx("Name:","editor"),this); - g->addWidget(l,0,0); + QLabel * l = new QLabel(__tr2qs_ctx("Name:", "editor"), this); + g->addWidget(l, 0, 0); m_pNameEdit = new QLineEdit(this); - g->addWidget(m_pNameEdit,0,1); - m_pNameEdit->setToolTip(__tr2qs_ctx("Internal unique name for the action","editor")); + g->addWidget(m_pNameEdit, 0, 1); + m_pNameEdit->setToolTip(__tr2qs_ctx("Internal unique name for the action", "editor")); - l = new QLabel(__tr2qs_ctx("Label:","editor"),this); - g->addWidget(l,1,0); + l = new QLabel(__tr2qs_ctx("Label:", "editor"), this); + g->addWidget(l, 1, 0); m_pVisibleNameEdit = new QLineEdit(this); - g->addWidget(m_pVisibleNameEdit,1,1); - m_pVisibleNameEdit->setToolTip(__tr2qs_ctx("Visible name for this action.
This string will be displayed to the user so it is a good idea to use $tr() here","editor")); - + g->addWidget(m_pVisibleNameEdit, 1, 1); + m_pVisibleNameEdit->setToolTip(__tr2qs_ctx("Visible name for this action.
This string will be displayed to the user so it is a good idea to use $tr() here", "editor")); QTabWidget * tw = new QTabWidget(this); - g->addWidget(tw,2,0,1,2); + g->addWidget(tw, 2, 0, 1, 2); // code tab QWidget * tab = new QWidget(tw); QGridLayout * gl = new QGridLayout(tab); m_pScriptEditor = KviScriptEditor::createInstance(tab); - gl->addWidget(m_pScriptEditor,0,0); - m_pScriptEditor->setToolTip(__tr2qs_ctx("Action code","editor")); + gl->addWidget(m_pScriptEditor, 0, 0); + m_pScriptEditor->setToolTip(__tr2qs_ctx("Action code", "editor")); - tw->addTab(tab,__tr2qs_ctx("Code","editor")); + tw->addTab(tab, __tr2qs_ctx("Code", "editor")); // properties tab tab = new QWidget(tw); gl = new QGridLayout(tab); - l = new QLabel(__tr2qs_ctx("Category:","editor"),tab); - gl->addWidget(l,0,0); + l = new QLabel(__tr2qs_ctx("Category:", "editor"), tab); + gl->addWidget(l, 0, 0); m_pCategoryCombo = new QComboBox(tab); - gl->addWidget(m_pCategoryCombo,0,1,1,3); - m_pCategoryCombo->setToolTip(__tr2qs_ctx("Choose the category that best fits for this action","editor")); + gl->addWidget(m_pCategoryCombo, 0, 1, 1, 3); + m_pCategoryCombo->setToolTip(__tr2qs_ctx("Choose the category that best fits for this action", "editor")); - l = new QLabel(__tr2qs_ctx("Description:","editor"),tab); - gl->addWidget(l,1,0); + l = new QLabel(__tr2qs_ctx("Description:", "editor"), tab); + gl->addWidget(l, 1, 0); m_pDescriptionEdit = new QLineEdit(tab); - gl->addWidget(m_pDescriptionEdit,1,1,1,3); - m_pDescriptionEdit->setToolTip(__tr2qs_ctx("Visible short description for this action.
This string will be displayed to the user so it is a good idea to use $tr() here","editor")); + gl->addWidget(m_pDescriptionEdit, 1, 1, 1, 3); + m_pDescriptionEdit->setToolTip(__tr2qs_ctx("Visible short description for this action.
This string will be displayed to the user so it is a good idea to use $tr() here", "editor")); - l = new QLabel(__tr2qs_ctx("Small icon:","editor"),tab); - gl->addWidget(l,2,0); + l = new QLabel(__tr2qs_ctx("Small icon:", "editor"), tab); + gl->addWidget(l, 2, 0); m_pSmallIconEdit = new QLineEdit(tab); - gl->addWidget(m_pSmallIconEdit,2,1); + gl->addWidget(m_pSmallIconEdit, 2, 1); m_pSmallIconButton = new QToolButton(tab); - m_pSmallIconButton->setMinimumSize(QSize(20,20)); - connect(m_pSmallIconButton,SIGNAL(clicked()),this,SLOT(chooseSmallIcon())); - gl->addWidget(m_pSmallIconButton,2,2); - QString s= __tr2qs_ctx("The small icon associated to this action.
" \ - "It will appear at least in the popup menus when this action is inserted.
" \ - "It has to be 16x16 pixels.","editor"); + m_pSmallIconButton->setMinimumSize(QSize(20, 20)); + connect(m_pSmallIconButton, SIGNAL(clicked()), this, SLOT(chooseSmallIcon())); + gl->addWidget(m_pSmallIconButton, 2, 2); + QString s = __tr2qs_ctx("The small icon associated to this action.
" + "It will appear at least in the popup menus when this action is inserted.
" + "It has to be 16x16 pixels.", + "editor"); m_pSmallIconEdit->setToolTip(s); m_pSmallIconButton->setToolTip(s); - l = new QLabel(__tr2qs_ctx("Big icon:","editor"),tab); - gl->addWidget(l,3,0); + l = new QLabel(__tr2qs_ctx("Big icon:", "editor"), tab); + gl->addWidget(l, 3, 0); m_pBigIconEdit = new QLineEdit(tab); - gl->addWidget(m_pBigIconEdit,3,1); + gl->addWidget(m_pBigIconEdit, 3, 1); m_pBigIconButton = new QToolButton(tab); - m_pBigIconButton->setMinimumSize(QSize(48,48)); - m_pBigIconButton->setIconSize(QSize(32,32)); - connect(m_pBigIconButton,SIGNAL(clicked()),this,SLOT(chooseBigIcon())); - gl->addWidget(m_pBigIconButton,3,2,2,2); - s = __tr2qs_ctx("The big icon associated to this action.
" \ - "It will appear at least in the toolbar buttons when this action is inserted.
" \ - "It has to be 32x32 pixels.","editor"); + m_pBigIconButton->setMinimumSize(QSize(48, 48)); + m_pBigIconButton->setIconSize(QSize(32, 32)); + connect(m_pBigIconButton, SIGNAL(clicked()), this, SLOT(chooseBigIcon())); + gl->addWidget(m_pBigIconButton, 3, 2, 2, 2); + s = __tr2qs_ctx("The big icon associated to this action.
" + "It will appear at least in the toolbar buttons when this action is inserted.
" + "It has to be 32x32 pixels.", + "editor"); m_pBigIconEdit->setToolTip(s); m_pBigIconButton->setToolTip(s); - l = new QLabel(__tr2qs_ctx("Key sequence:","editor"),tab); - gl->addWidget(l,4,0,2,1); + l = new QLabel(__tr2qs_ctx("Key sequence:", "editor"), tab); + gl->addWidget(l, 4, 0, 2, 1); m_pKeySequenceEdit = new QLineEdit(tab); - gl->addWidget(m_pKeySequenceEdit,4,1,2,1); - m_pKeySequenceEdit->setToolTip(__tr2qs_ctx("Optional keyboard sequence that will activate this action.
" \ - "The sequence has to be expressed as a string of up to four key codes separated by commas " \ - "eventually combined with the modifiers \"Ctrl\",\"Shift\",\"Alt\" and \"Meta\".
" \ - "Examples of such sequences are \"Ctrl+X\", \"Ctrl+Alt+Z\", \"Ctrl+X,Ctrl+C\" ...","editor")); + gl->addWidget(m_pKeySequenceEdit, 4, 1, 2, 1); + m_pKeySequenceEdit->setToolTip(__tr2qs_ctx("Optional keyboard sequence that will activate this action.
" + "The sequence has to be expressed as a string of up to four key codes separated by commas " + "eventually combined with the modifiers \"Ctrl\",\"Shift\",\"Alt\" and \"Meta\".
" + "Examples of such sequences are \"Ctrl+X\", \"Ctrl+Alt+Z\", \"Ctrl+X,Ctrl+C\" ...", + "editor")); l = new QLabel(tab); - gl->addWidget(l,6,0,1,4); + gl->addWidget(l, 6, 0, 1, 4); - gl->setColumnStretch(1,1); - gl->setRowStretch(6,1); + gl->setColumnStretch(1, 1); + gl->setRowStretch(6, 1); - tw->addTab(tab,__tr2qs_ctx("Properties","editor")); + tw->addTab(tab, __tr2qs_ctx("Properties", "editor")); // flags tab tab = new QWidget(tw); gl = new QGridLayout(tab); - - m_pNeedsContextCheck = new QCheckBox(__tr2qs_ctx("Needs IRC context","editor"),tab); - connect(m_pNeedsContextCheck,SIGNAL(toggled(bool)),this,SLOT(needsContextCheckToggled(bool))); - m_pNeedsContextCheck->setToolTip(__tr2qs_ctx("Check this option if this action should be enabled only when " \ - "the active window belongs to an IRC context","editor")); - gl->addWidget(m_pNeedsContextCheck,0,0,1,4); - + m_pNeedsContextCheck = new QCheckBox(__tr2qs_ctx("Needs IRC context", "editor"), tab); + connect(m_pNeedsContextCheck, SIGNAL(toggled(bool)), this, SLOT(needsContextCheckToggled(bool))); + m_pNeedsContextCheck->setToolTip(__tr2qs_ctx("Check this option if this action should be enabled only when " + "the active window belongs to an IRC context", + "editor")); + gl->addWidget(m_pNeedsContextCheck, 0, 0, 1, 4); l = new QLabel(tab); l->setMinimumWidth(40); - gl->addWidget(l,1,0); - - m_pNeedsConnectionCheck = new QCheckBox(__tr2qs_ctx("Needs IRC connection","editor"),tab); - connect(m_pNeedsConnectionCheck,SIGNAL(toggled(bool)),this,SLOT(needsConnectionCheckToggled(bool))); - m_pNeedsConnectionCheck->setToolTip(__tr2qs_ctx("Check this option if this action should be enabled only when " \ - "the active window has an active IRC connection","editor")); - gl->addWidget(m_pNeedsConnectionCheck,1,1,1,3); + gl->addWidget(l, 1, 0); + m_pNeedsConnectionCheck = new QCheckBox(__tr2qs_ctx("Needs IRC connection", "editor"), tab); + connect(m_pNeedsConnectionCheck, SIGNAL(toggled(bool)), this, SLOT(needsConnectionCheckToggled(bool))); + m_pNeedsConnectionCheck->setToolTip(__tr2qs_ctx("Check this option if this action should be enabled only when " + "the active window has an active IRC connection", + "editor")); + gl->addWidget(m_pNeedsConnectionCheck, 1, 1, 1, 3); l = new QLabel(tab); l->setMinimumWidth(40); - gl->addWidget(l,2,1); - - m_pEnableAtLoginCheck = new QCheckBox(__tr2qs_ctx("Enable at login","editor"),tab); - m_pEnableAtLoginCheck->setToolTip(__tr2qs_ctx("Check this option if this action should be enabled also during " \ - "the login operations (so when the logical IRC connection hasn't been established yet)","editor")); - gl->addWidget(m_pEnableAtLoginCheck,2,2,1,2); - - m_pSpecificWindowsCheck = new QCheckBox(__tr2qs_ctx("Enable only in specified windows","editor"),tab); - connect(m_pSpecificWindowsCheck,SIGNAL(toggled(bool)),this,SLOT(specificWindowsCheckToggled(bool))); - m_pSpecificWindowsCheck->setToolTip(__tr2qs_ctx("Check this option if this action should be enabled only when " \ - "the active window is of a specified type","editor")); - gl->addWidget(m_pSpecificWindowsCheck,3,0,1,4); - - - m_pWindowConsoleCheck = new QCheckBox(__tr2qs_ctx("Enable in console windows","editor"),tab); - m_pWindowConsoleCheck->setToolTip(__tr2qs_ctx("Check this option if this action should be enabled only when " \ - "the active window is a console","editor")); - connect(m_pWindowConsoleCheck,SIGNAL(toggled(bool)),this,SLOT(channelQueryOrConsoleWindowCheckToggled(bool))); - gl->addWidget(m_pWindowConsoleCheck,4,1,1,3); - - m_pConsoleOnlyIfUsersSelectedCheck = new QCheckBox(__tr2qs_ctx("Only if there are selected users","editor"),tab); - m_pConsoleOnlyIfUsersSelectedCheck->setToolTip(__tr2qs_ctx("This will enable the action only if there are " \ - "selected users in the active window","editor")); - gl->addWidget(m_pConsoleOnlyIfUsersSelectedCheck,5,2,1,2); - - m_pWindowChannelCheck = new QCheckBox(__tr2qs_ctx("Enable in channel windows","editor"),tab); - m_pWindowChannelCheck->setToolTip(__tr2qs_ctx("Check this option if this action should be enabled only when " \ - "the active window is a channel","editor")); - connect(m_pWindowChannelCheck,SIGNAL(toggled(bool)),this,SLOT(channelQueryOrConsoleWindowCheckToggled(bool))); - gl->addWidget(m_pWindowChannelCheck,6,1,1,3); - - m_pChannelOnlyIfUsersSelectedCheck = new QCheckBox(__tr2qs_ctx("Only if there are selected users","editor"),tab); - m_pChannelOnlyIfUsersSelectedCheck->setToolTip(__tr2qs_ctx("This will enable the action only if there are " \ - "selected users in the active window","editor")); - gl->addWidget(m_pChannelOnlyIfUsersSelectedCheck,7,2,1,2); - - m_pWindowQueryCheck = new QCheckBox(__tr2qs_ctx("Enable in query windows","editor"),tab); - m_pWindowQueryCheck->setToolTip(__tr2qs_ctx("Check this option if this action should be enabled only when " \ - "the active window is a query","editor")); - connect(m_pWindowQueryCheck,SIGNAL(toggled(bool)),this,SLOT(channelQueryOrConsoleWindowCheckToggled(bool))); - gl->addWidget(m_pWindowQueryCheck,8,1,1,3); - - m_pQueryOnlyIfUsersSelectedCheck = new QCheckBox(__tr2qs_ctx("Only if there are selected users","editor"),tab); - m_pQueryOnlyIfUsersSelectedCheck->setToolTip(__tr2qs_ctx("This will enable the action only if there are " \ - "selected users in the active window","editor")); - gl->addWidget(m_pQueryOnlyIfUsersSelectedCheck,9,2,1,2); - - m_pWindowDccChatCheck = new QCheckBox(__tr2qs_ctx("Enable in DCC chat windows","editor"),tab); - m_pWindowDccChatCheck->setToolTip(__tr2qs_ctx("Check this option if this action should be enabled only when " \ - "the active window is a DCC chat","editor")); - gl->addWidget(m_pWindowDccChatCheck,10,1,1,2); + gl->addWidget(l, 2, 1); + + m_pEnableAtLoginCheck = new QCheckBox(__tr2qs_ctx("Enable at login", "editor"), tab); + m_pEnableAtLoginCheck->setToolTip(__tr2qs_ctx("Check this option if this action should be enabled also during " + "the login operations (so when the logical IRC connection hasn't been established yet)", + "editor")); + gl->addWidget(m_pEnableAtLoginCheck, 2, 2, 1, 2); + + m_pSpecificWindowsCheck = new QCheckBox(__tr2qs_ctx("Enable only in specified windows", "editor"), tab); + connect(m_pSpecificWindowsCheck, SIGNAL(toggled(bool)), this, SLOT(specificWindowsCheckToggled(bool))); + m_pSpecificWindowsCheck->setToolTip(__tr2qs_ctx("Check this option if this action should be enabled only when " + "the active window is of a specified type", + "editor")); + gl->addWidget(m_pSpecificWindowsCheck, 3, 0, 1, 4); + + m_pWindowConsoleCheck = new QCheckBox(__tr2qs_ctx("Enable in console windows", "editor"), tab); + m_pWindowConsoleCheck->setToolTip(__tr2qs_ctx("Check this option if this action should be enabled only when " + "the active window is a console", + "editor")); + connect(m_pWindowConsoleCheck, SIGNAL(toggled(bool)), this, SLOT(channelQueryOrConsoleWindowCheckToggled(bool))); + gl->addWidget(m_pWindowConsoleCheck, 4, 1, 1, 3); + + m_pConsoleOnlyIfUsersSelectedCheck = new QCheckBox(__tr2qs_ctx("Only if there are selected users", "editor"), tab); + m_pConsoleOnlyIfUsersSelectedCheck->setToolTip(__tr2qs_ctx("This will enable the action only if there are " + "selected users in the active window", + "editor")); + gl->addWidget(m_pConsoleOnlyIfUsersSelectedCheck, 5, 2, 1, 2); + + m_pWindowChannelCheck = new QCheckBox(__tr2qs_ctx("Enable in channel windows", "editor"), tab); + m_pWindowChannelCheck->setToolTip(__tr2qs_ctx("Check this option if this action should be enabled only when " + "the active window is a channel", + "editor")); + connect(m_pWindowChannelCheck, SIGNAL(toggled(bool)), this, SLOT(channelQueryOrConsoleWindowCheckToggled(bool))); + gl->addWidget(m_pWindowChannelCheck, 6, 1, 1, 3); + + m_pChannelOnlyIfUsersSelectedCheck = new QCheckBox(__tr2qs_ctx("Only if there are selected users", "editor"), tab); + m_pChannelOnlyIfUsersSelectedCheck->setToolTip(__tr2qs_ctx("This will enable the action only if there are " + "selected users in the active window", + "editor")); + gl->addWidget(m_pChannelOnlyIfUsersSelectedCheck, 7, 2, 1, 2); + + m_pWindowQueryCheck = new QCheckBox(__tr2qs_ctx("Enable in query windows", "editor"), tab); + m_pWindowQueryCheck->setToolTip(__tr2qs_ctx("Check this option if this action should be enabled only when " + "the active window is a query", + "editor")); + connect(m_pWindowQueryCheck, SIGNAL(toggled(bool)), this, SLOT(channelQueryOrConsoleWindowCheckToggled(bool))); + gl->addWidget(m_pWindowQueryCheck, 8, 1, 1, 3); + + m_pQueryOnlyIfUsersSelectedCheck = new QCheckBox(__tr2qs_ctx("Only if there are selected users", "editor"), tab); + m_pQueryOnlyIfUsersSelectedCheck->setToolTip(__tr2qs_ctx("This will enable the action only if there are " + "selected users in the active window", + "editor")); + gl->addWidget(m_pQueryOnlyIfUsersSelectedCheck, 9, 2, 1, 2); + + m_pWindowDccChatCheck = new QCheckBox(__tr2qs_ctx("Enable in DCC chat windows", "editor"), tab); + m_pWindowDccChatCheck->setToolTip(__tr2qs_ctx("Check this option if this action should be enabled only when " + "the active window is a DCC chat", + "editor")); + gl->addWidget(m_pWindowDccChatCheck, 10, 1, 1, 2); l = new QLabel(tab); - gl->addWidget(l,11,0,1,4); - gl->setColumnStretch(3,1); - gl->setRowStretch(11,1); + gl->addWidget(l, 11, 0, 1, 4); + gl->setColumnStretch(3, 1); + gl->setRowStretch(11, 1); - tw->addTab(tab,__tr2qs_ctx("Flags","editor")); + tw->addTab(tab, __tr2qs_ctx("Flags", "editor")); tw->setCurrentIndex(0); - g->setRowStretch(2,1); - g->setColumnStretch(1,1); + g->setRowStretch(2, 1); + g->setColumnStretch(1, 1); - KviPointerHashTableIterator it(*(KviActionManager::instance()->categories())); + KviPointerHashTableIterator it(*(KviActionManager::instance()->categories())); while(KviActionCategory * ac = it.current()) { m_pCategoryCombo->addItem(ac->visibleName() + " (" + ac->name() + ")"); @@ -330,7 +338,7 @@ void SingleActionEditor::specificWindowsCheckToggled(bool) m_pWindowDccChatCheck->setEnabled(b); } -void SingleActionEditor::displaySmallIcon(const QString &szIconId) +void SingleActionEditor::displaySmallIcon(const QString & szIconId) { QPixmap * pix = g_pIconManager->getImage(szIconId); @@ -338,14 +346,15 @@ void SingleActionEditor::displaySmallIcon(const QString &szIconId) { m_pSmallIconEdit->setText(szIconId); m_pSmallIconButton->setIcon(QIcon(*pix)); - } else { + } + else + { m_pSmallIconEdit->setText(QString()); m_pSmallIconButton->setIcon(QIcon()); } - } -void SingleActionEditor::displayBigIcon(const QString &szIconId) +void SingleActionEditor::displayBigIcon(const QString & szIconId) { QPixmap * pix = g_pIconManager->getImage(szIconId); @@ -353,7 +362,9 @@ void SingleActionEditor::displayBigIcon(const QString &szIconId) { m_pBigIconEdit->setText(szIconId); m_pBigIconButton->setIcon(QIcon(*pix)); - } else { + } + else + { m_pBigIconEdit->setText(QString()); m_pBigIconButton->setIcon(QIcon()); } @@ -361,7 +372,8 @@ void SingleActionEditor::displayBigIcon(const QString &szIconId) void SingleActionEditor::chooseSmallIcon() { - if(!m_pActionData)return; + if(!m_pActionData) + return; KviImageDialog * d = new KviImageDialog(this); int ret = d->exec(); QString s = d->selectedImage(); @@ -374,8 +386,9 @@ void SingleActionEditor::chooseSmallIcon() void SingleActionEditor::chooseBigIcon() { - if(!m_pActionData)return; - KviImageDialog * d = new KviImageDialog(this,QString(),KID_TYPE_ALL,KID_TYPE_FULL_PATH); + if(!m_pActionData) + return; + KviImageDialog * d = new KviImageDialog(this, QString(), KID_TYPE_ALL, KID_TYPE_FULL_PATH); int ret = d->exec(); QString s = d->selectedImage(); delete d; @@ -394,7 +407,7 @@ void SingleActionEditor::setActionData(ActionData * d) unsigned int uOldFlags = d->m_uFlags; d->m_uFlags = KviAction::validateFlags(d->m_uFlags); if(d->m_uFlags != uOldFlags) - qDebug("invalid action flags in SingleActionEditor::setActionData(): %d fixed to %d",uOldFlags,d->m_uFlags); + qDebug("invalid action flags in SingleActionEditor::setActionData(): %d fixed to %d", uOldFlags, d->m_uFlags); m_pNameEdit->setText(d->m_szName); m_pNameEdit->setEnabled(true); @@ -402,7 +415,7 @@ void SingleActionEditor::setActionData(ActionData * d) m_pVisibleNameEdit->setEnabled(true); m_pCategoryCombo->setEnabled(true); int i; - for(i=0;icount();i++) + for(i = 0; i < m_pCategoryCombo->count(); i++) { QString t = m_pCategoryCombo->itemText(i); int idx = t.lastIndexOf('('); @@ -462,7 +475,9 @@ void SingleActionEditor::setActionData(ActionData * d) m_pQueryOnlyIfUsersSelectedCheck->setEnabled(b); m_pQueryOnlyIfUsersSelectedCheck->setChecked(b && (d->m_uFlags & KviAction::WindowOnlyIfUsersSelected)); m_pWindowDccChatCheck->setChecked(d->m_uFlags & KviAction::WindowDccChat); - } else { + } + else + { m_pNameEdit->setText(""); m_pNameEdit->setEnabled(false); m_pVisibleNameEdit->setText(""); @@ -509,7 +524,8 @@ void SingleActionEditor::setActionData(ActionData * d) void SingleActionEditor::commit() { - if(!m_pActionData)return; + if(!m_pActionData) + return; QString tmp = m_pNameEdit->text(); if(tmp != m_pActionData->m_szName) @@ -534,10 +550,13 @@ void SingleActionEditor::commit() m_pActionData->m_szKeySequence = m_pKeySequenceEdit->text(); QString szCat = m_pCategoryCombo->currentText(); int idx = szCat.lastIndexOf(')'); - if(idx != -1)m_pActionData->m_szCategory = szCat.left(idx); - else m_pActionData->m_szCategory = szCat; + if(idx != -1) + m_pActionData->m_szCategory = szCat.left(idx); + else + m_pActionData->m_szCategory = szCat; idx = m_pActionData->m_szCategory.lastIndexOf('('); - if(idx != -1)m_pActionData->m_szCategory.remove(0,idx+1); + if(idx != -1) + m_pActionData->m_szCategory.remove(0, idx + 1); m_pActionData->m_uFlags = 0; if(m_pNeedsContextCheck->isChecked()) { @@ -545,21 +564,23 @@ void SingleActionEditor::commit() if(m_pNeedsConnectionCheck->isChecked()) { m_pActionData->m_uFlags |= KviAction::NeedsConnection; - if(m_pEnableAtLoginCheck->isChecked())m_pActionData->m_uFlags |= KviAction::EnableAtLogin; + if(m_pEnableAtLoginCheck->isChecked()) + m_pActionData->m_uFlags |= KviAction::EnableAtLogin; } - } if(m_pSpecificWindowsCheck->isChecked()) { - if(m_pWindowConsoleCheck->isChecked())m_pActionData->m_uFlags |= KviAction::WindowConsole; - if(m_pWindowChannelCheck->isChecked())m_pActionData->m_uFlags |= KviAction::WindowChannel; - if(m_pWindowQueryCheck->isChecked())m_pActionData->m_uFlags |= KviAction::WindowQuery; - if(m_pWindowDccChatCheck->isChecked())m_pActionData->m_uFlags |= KviAction::WindowDccChat; + if(m_pWindowConsoleCheck->isChecked()) + m_pActionData->m_uFlags |= KviAction::WindowConsole; + if(m_pWindowChannelCheck->isChecked()) + m_pActionData->m_uFlags |= KviAction::WindowChannel; + if(m_pWindowQueryCheck->isChecked()) + m_pActionData->m_uFlags |= KviAction::WindowQuery; + if(m_pWindowDccChatCheck->isChecked()) + m_pActionData->m_uFlags |= KviAction::WindowDccChat; if(m_pActionData->m_uFlags & KviAction::InternalWindowMask) { - if(m_pConsoleOnlyIfUsersSelectedCheck->isChecked() || - m_pChannelOnlyIfUsersSelectedCheck->isChecked() || - m_pQueryOnlyIfUsersSelectedCheck->isChecked()) + if(m_pConsoleOnlyIfUsersSelectedCheck->isChecked() || m_pChannelOnlyIfUsersSelectedCheck->isChecked() || m_pQueryOnlyIfUsersSelectedCheck->isChecked()) { m_pActionData->m_uFlags |= KviAction::WindowOnlyIfUsersSelected; } @@ -569,22 +590,21 @@ void SingleActionEditor::commit() unsigned int uOldFlags = m_pActionData->m_uFlags; m_pActionData->m_uFlags = KviAction::validateFlags(m_pActionData->m_uFlags); if(m_pActionData->m_uFlags != uOldFlags) - qDebug("invalid action flags in SingleActionEditor::commit(): %d fixed to %d",uOldFlags,m_pActionData->m_uFlags); + qDebug("invalid action flags in SingleActionEditor::commit(): %d fixed to %d", uOldFlags, m_pActionData->m_uFlags); } - ActionEditorTreeView::ActionEditorTreeView(QWidget * pParent) -: QTreeWidget(pParent) + : QTreeWidget(pParent) { - setColumnCount (1); - setHeaderLabel(__tr2qs_ctx("Action","editor")); + setColumnCount(1); + setHeaderLabel(__tr2qs_ctx("Action", "editor")); setSelectionMode(QAbstractItemView::ExtendedSelection); setSortingEnabled(true); int iWidth = viewport()->width(); - if(iWidth < LVI_MINIMUM_CELL_WIDTH)iWidth = LVI_MINIMUM_CELL_WIDTH; + if(iWidth < LVI_MINIMUM_CELL_WIDTH) + iWidth = LVI_MINIMUM_CELL_WIDTH; setRootIsDecorated(false); - setColumnWidth(0,iWidth); - + setColumnWidth(0, iWidth); } ActionEditorTreeView::~ActionEditorTreeView() @@ -595,63 +615,61 @@ void ActionEditorTreeView::resizeEvent(QResizeEvent * e) { QTreeWidget::resizeEvent(e); int iWidth = viewport()->width(); - if(iWidth < LVI_MINIMUM_CELL_WIDTH)iWidth = LVI_MINIMUM_CELL_WIDTH; - setColumnWidth(0,iWidth); + if(iWidth < LVI_MINIMUM_CELL_WIDTH) + iWidth = LVI_MINIMUM_CELL_WIDTH; + setColumnWidth(0, iWidth); } - ActionEditor::ActionEditor(QWidget * par) -: QWidget(par) + : QWidget(par) { QGridLayout * l = new QGridLayout(this); - m_pSplitter = new QSplitter(Qt::Horizontal,this); + m_pSplitter = new QSplitter(Qt::Horizontal, this); m_pSplitter->setChildrenCollapsible(false); - l->addWidget(m_pSplitter,0,0); - + l->addWidget(m_pSplitter, 0, 0); KviTalVBox * box = new KviTalVBox(m_pSplitter); m_pTreeWidget = new ActionEditorTreeView(box); - KviTalIconAndRichTextItemDelegate *itemDelegate=new KviTalIconAndRichTextItemDelegate(m_pTreeWidget); + KviTalIconAndRichTextItemDelegate * itemDelegate = new KviTalIconAndRichTextItemDelegate(m_pTreeWidget); m_pTreeWidget->setItemDelegate(itemDelegate); //m_pTreeWidget->setShowSortIndicator(true); m_pTreeWidget->setFocusPolicy(Qt::StrongFocus); - connect(m_pTreeWidget,SIGNAL(currentItemChanged(QTreeWidgetItem *,QTreeWidgetItem *)),this,SLOT(currentItemChanged(QTreeWidgetItem *,QTreeWidgetItem *))); + connect(m_pTreeWidget, SIGNAL(currentItemChanged(QTreeWidgetItem *, QTreeWidgetItem *)), this, SLOT(currentItemChanged(QTreeWidgetItem *, QTreeWidgetItem *))); - m_pNewActionButton = new QPushButton(__tr2qs_ctx("New Action","editor"),box); - connect(m_pNewActionButton,SIGNAL(clicked()),this,SLOT(newAction())); + m_pNewActionButton = new QPushButton(__tr2qs_ctx("New Action", "editor"), box); + connect(m_pNewActionButton, SIGNAL(clicked()), this, SLOT(newAction())); - m_pDeleteActionsButton = new QPushButton(__tr2qs_ctx("Delete Actions","editor"),box); - connect(m_pDeleteActionsButton,SIGNAL(clicked()),this,SLOT(deleteActions())); + m_pDeleteActionsButton = new QPushButton(__tr2qs_ctx("Delete Actions", "editor"), box); + connect(m_pDeleteActionsButton, SIGNAL(clicked()), this, SLOT(deleteActions())); - m_pExportActionsButton = new QPushButton(__tr2qs_ctx("Export Actions...","editor"),box); - connect(m_pExportActionsButton,SIGNAL(clicked()),this,SLOT(exportActions())); + m_pExportActionsButton = new QPushButton(__tr2qs_ctx("Export Actions...", "editor"), box); + connect(m_pExportActionsButton, SIGNAL(clicked()), this, SLOT(exportActions())); box->setSpacing(1); - m_pSingleActionEditor = new SingleActionEditor(m_pSplitter,this); + m_pSingleActionEditor = new SingleActionEditor(m_pSplitter, this); ActionEditorTreeWidgetItem * last = 0; ActionEditorTreeWidgetItem * first = 0; - KviPointerHashTableIterator it(*(KviActionManager::instance()->actions())); + KviPointerHashTableIterator it(*(KviActionManager::instance()->actions())); while(KviAction * a = it.current()) { if(a->isKviUserActionNeverOverrideThis()) { ActionData * ad = new ActionData( - a->name(), - ((KviKvsUserAction *)a)->scriptCode(), - ((KviKvsUserAction *)a)->visibleNameCode(), - ((KviKvsUserAction *)a)->descriptionCode(), - a->category() ? a->category()->name() : KviActionManager::categoryGeneric()->name(), - a->bigIconId(), - a->smallIconId(), - a->flags(), - a->keySequence(), - 0 - ); - ActionEditorTreeWidgetItem * lvi = new ActionEditorTreeWidgetItem(m_pTreeWidget,ad); + a->name(), + ((KviKvsUserAction *)a)->scriptCode(), + ((KviKvsUserAction *)a)->visibleNameCode(), + ((KviKvsUserAction *)a)->descriptionCode(), + a->category() ? a->category()->name() : KviActionManager::categoryGeneric()->name(), + a->bigIconId(), + a->smallIconId(), + a->flags(), + a->keySequence(), + 0); + ActionEditorTreeWidgetItem * lvi = new ActionEditorTreeWidgetItem(m_pTreeWidget, ad); ad->m_pItem = lvi; if(ad->m_szName == g_szLastEditedAction) last = lvi; @@ -661,16 +679,18 @@ ActionEditor::ActionEditor(QWidget * par) ++it; } - if(!last)last = first; // try to sleect the first one then + if(!last) + last = first; // try to sleect the first one then if(last) { m_pTreeWidget->setCurrentItem(last); - currentItemChanged(last,last); - } else { - currentItemChanged(0,0); + currentItemChanged(last, last); + } + else + { + currentItemChanged(0, 0); } - } ActionEditor::~ActionEditor() @@ -680,48 +700,48 @@ ActionEditor::~ActionEditor() void ActionEditor::exportActions() { QString szName = QDir::homePath(); - if(!szName.endsWith(QString(KVI_PATH_SEPARATOR)))szName += KVI_PATH_SEPARATOR; + if(!szName.endsWith(QString(KVI_PATH_SEPARATOR))) + szName += KVI_PATH_SEPARATOR; szName += "myactions.kvs"; QString szFile; if(!KviFileDialog::askForSaveFileName( - szFile, - __tr2qs_ctx("Choose a Filename - KVIrc","editor"), - szName, - KVI_FILTER_SCRIPT, - true, - true, - true, - this - ))return; + szFile, + __tr2qs_ctx("Choose a Filename - KVIrc", "editor"), + szName, + KVI_FILTER_SCRIPT, + true, + true, + true, + this)) + return; QString szCode; - for (int i=0;itopLevelItemCount();i++) + for(int i = 0; i < m_pTreeWidget->topLevelItemCount(); i++) { if(m_pTreeWidget->topLevelItem(i)->isSelected()) { ActionData * a = ((ActionEditorTreeWidgetItem *)m_pTreeWidget->topLevelItem(i))->actionData(); KviKvsUserAction::exportToKvs( - szCode, - a->m_szName, - a->m_szScriptCode, - a->m_szVisibleName, - a->m_szDescription, - a->m_szCategory, - a->m_szBigIcon, - a->m_szSmallIcon, - a->m_uFlags, - a->m_szKeySequence - ); + szCode, + a->m_szName, + a->m_szScriptCode, + a->m_szVisibleName, + a->m_szDescription, + a->m_szCategory, + a->m_szBigIcon, + a->m_szSmallIcon, + a->m_uFlags, + a->m_szKeySequence); } } - if(!KviFileUtils::writeFile(szFile,szCode)) + if(!KviFileUtils::writeFile(szFile, szCode)) { - QMessageBox::warning(this,__tr2qs_ctx("Writing to File Failed - KVIrc","editor"),__tr2qs_ctx("Unable to write to the actions file.","editor"),__tr2qs_ctx("OK","editor")); + QMessageBox::warning(this, __tr2qs_ctx("Writing to File Failed - KVIrc", "editor"), __tr2qs_ctx("Unable to write to the actions file.", "editor"), __tr2qs_ctx("OK", "editor")); } } @@ -730,18 +750,19 @@ void ActionEditor::deleteActions() KviPointerList l; l.setAutoDelete(false); - for (int i=0;itopLevelItemCount();i++) + for(int i = 0; i < m_pTreeWidget->topLevelItemCount(); i++) { if(m_pTreeWidget->topLevelItem(i)->isSelected()) - l.append((ActionEditorTreeWidgetItem * )m_pTreeWidget->topLevelItem(i)); + l.append((ActionEditorTreeWidgetItem *)m_pTreeWidget->topLevelItem(i)); } - if(l.isEmpty())return; + if(l.isEmpty()) + return; //if(QMessageBox::question(this,__tr2qs_ctx("Confirm Actions Deletion - KVIrc","editor"),__tr2qs_ctx("Do you really want to delete the selected actions?","editor"),__tr2qs_ctx("Yes","editor"),__tr2qs_ctx("No","editor")) != 0) // return; - for(ActionEditorTreeWidgetItem * i = l.first();i;i = l.next()) + for(ActionEditorTreeWidgetItem * i = l.first(); i; i = l.next()) { if(m_pSingleActionEditor->actionData() == i->actionData()) m_pSingleActionEditor->setActionData(0); @@ -749,16 +770,16 @@ void ActionEditor::deleteActions() } } - -QString ActionEditor::nameForAutomaticAction(const QString &szTemplate) +QString ActionEditor::nameForAutomaticAction(const QString & szTemplate) { QString szRet; QString szT = szTemplate; - szT.replace(" ",""); - szT.replace(".","_"); + szT.replace(" ", ""); + szT.replace(".", "_"); int i = 1; - do { + do + { szRet = QString("%1%2").arg(szT).arg(i); i++; } while(actionExists(szRet)); @@ -768,9 +789,9 @@ QString ActionEditor::nameForAutomaticAction(const QString &szTemplate) void ActionEditor::newAction() { - QString szName = nameForAutomaticAction(__tr2qs_ctx("My Action","editor")); - QString szVis = __tr2qs_ctx("My Action","editor"); - QString szDes = __tr2qs_ctx("Put here a short description of your action","editor"); + QString szName = nameForAutomaticAction(__tr2qs_ctx("My Action", "editor")); + QString szVis = __tr2qs_ctx("My Action", "editor"); + QString szDes = __tr2qs_ctx("Put here a short description of your action", "editor"); szVis.prepend("$tr(\""); szVis.append("\")"); @@ -778,32 +799,33 @@ void ActionEditor::newAction() szDes.append("\")"); ActionData * ad = new ActionData(szName, - QString(), - szVis, - szDes, - KviActionManager::categoryGeneric()->name(), - KVI_BIGICON_USERACTION, - QString(), - 0, - QString(), - 0); - - ActionEditorTreeWidgetItem * lvi = new ActionEditorTreeWidgetItem(m_pTreeWidget,ad); + QString(), + szVis, + szDes, + KviActionManager::categoryGeneric()->name(), + KVI_BIGICON_USERACTION, + QString(), + 0, + QString(), + 0); + + ActionEditorTreeWidgetItem * lvi = new ActionEditorTreeWidgetItem(m_pTreeWidget, ad); ad->m_pItem = lvi; m_pTreeWidget->setCurrentItem(lvi); - currentItemChanged(lvi,lvi); + currentItemChanged(lvi, lvi); } -bool ActionEditor::actionExists(const QString &szName) +bool ActionEditor::actionExists(const QString & szName) { - for (int i=0;itopLevelItemCount();i++) + for(int i = 0; i < m_pTreeWidget->topLevelItemCount(); i++) { - if(((ActionEditorTreeWidgetItem *)m_pTreeWidget->topLevelItem(i))->actionData()->m_szName == szName)return true; + if(((ActionEditorTreeWidgetItem *)m_pTreeWidget->topLevelItem(i))->actionData()->m_szName == szName) + return true; } return false; } -void ActionEditor::currentItemChanged(QTreeWidgetItem * i,QTreeWidgetItem *) +void ActionEditor::currentItemChanged(QTreeWidgetItem * i, QTreeWidgetItem *) { if(m_pSingleActionEditor->actionData()) m_pSingleActionEditor->commit(); @@ -835,20 +857,20 @@ void ActionEditor::commit() KviActionManager::instance()->killAllKvsUserActions(); - for (int i=0;itopLevelItemCount();i++) + for(int i = 0; i < m_pTreeWidget->topLevelItemCount(); i++) { ActionEditorTreeWidgetItem * it = (ActionEditorTreeWidgetItem *)m_pTreeWidget->topLevelItem(i); KviKvsUserAction * a = KviKvsUserAction::createInstance( // msvc workaround - KviActionManager::instance(), - it->actionData()->m_szName, - it->actionData()->m_szScriptCode, - it->actionData()->m_szVisibleName, - it->actionData()->m_szDescription, - it->actionData()->m_szCategory, - it->actionData()->m_szBigIcon, - it->actionData()->m_szSmallIcon, - it->actionData()->m_uFlags, - it->actionData()->m_szKeySequence); + KviActionManager::instance(), + it->actionData()->m_szName, + it->actionData()->m_szScriptCode, + it->actionData()->m_szVisibleName, + it->actionData()->m_szDescription, + it->actionData()->m_szCategory, + it->actionData()->m_szBigIcon, + it->actionData()->m_szSmallIcon, + it->actionData()->m_uFlags, + it->actionData()->m_szKeySequence); KviActionManager::instance()->registerAction(a); } @@ -856,35 +878,34 @@ void ActionEditor::commit() KviCustomToolBarManager::instance()->updateVisibleToolBars(); } - ActionEditorWindow::ActionEditorWindow() -: KviWindow(KviWindow::ScriptEditor,"actioneditor",0) + : KviWindow(KviWindow::ScriptEditor, "actioneditor", 0) { g_pActionEditorWindow = this; - setFixedCaption(__tr2qs_ctx("Action Editor","editor")); + setFixedCaption(__tr2qs_ctx("Action Editor", "editor")); QGridLayout * g = new QGridLayout(); m_pEditor = new ActionEditor(this); - g->addWidget(m_pEditor,0,0,1,4); + g->addWidget(m_pEditor, 0, 0, 1, 4); - QPushButton * btn = new QPushButton(__tr2qs_ctx("OK","editor"),this); - connect(btn,SIGNAL(clicked()),this,SLOT(okClicked())); + QPushButton * btn = new QPushButton(__tr2qs_ctx("OK", "editor"), this); + connect(btn, SIGNAL(clicked()), this, SLOT(okClicked())); btn->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Accept))); - g->addWidget(btn,1,1); + g->addWidget(btn, 1, 1); - btn = new QPushButton(__tr2qs_ctx("Apply","editor"),this); - connect(btn,SIGNAL(clicked()),this,SLOT(applyClicked())); + btn = new QPushButton(__tr2qs_ctx("Apply", "editor"), this); + connect(btn, SIGNAL(clicked()), this, SLOT(applyClicked())); btn->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Accept))); - g->addWidget(btn,1,2); + g->addWidget(btn, 1, 2); - btn = new QPushButton(__tr2qs_ctx("Cancel","editor"),this); - connect(btn,SIGNAL(clicked()),this,SLOT(cancelClicked())); + btn = new QPushButton(__tr2qs_ctx("Cancel", "editor"), this); + connect(btn, SIGNAL(clicked()), this, SLOT(cancelClicked())); btn->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Discard))); - g->addWidget(btn,1,3); + g->addWidget(btn, 1, 3); - g->setRowStretch(0,1); - g->setColumnStretch(0,1); + g->setRowStretch(0, 1); + g->setColumnStretch(0, 1); setLayout(g); } @@ -914,23 +935,23 @@ QPixmap * ActionEditorWindow::myIconPtr() return g_pIconManager->getSmallIcon(KviIconManager::ActionEditor); } -void ActionEditorWindow::getConfigGroupName(QString &szName) +void ActionEditorWindow::getConfigGroupName(QString & szName) { szName = "actioneditor"; } -void ActionEditorWindow::saveProperties(KviConfigurationFile *cfg) +void ActionEditorWindow::saveProperties(KviConfigurationFile * cfg) { KviWindow::saveProperties(cfg); - cfg->writeEntry("Splitter",m_pEditor->m_pSplitter->sizes()); + cfg->writeEntry("Splitter", m_pEditor->m_pSplitter->sizes()); } -void ActionEditorWindow::loadProperties(KviConfigurationFile *cfg) +void ActionEditorWindow::loadProperties(KviConfigurationFile * cfg) { int w = width(); KviWindow::loadProperties(cfg); QList def; def.append((w * 25) / 100); def.append((w * 75) / 100); - m_pEditor->m_pSplitter->setSizes(cfg->readIntListEntry("Splitter",def)); + m_pEditor->m_pSplitter->setSizes(cfg->readIntListEntry("Splitter", def)); } diff --git a/src/modules/actioneditor/ActionEditor.h b/src/modules/actioneditor/ActionEditor.h index 32639399c..86470be3f 100644 --- a/src/modules/actioneditor/ActionEditor.h +++ b/src/modules/actioneditor/ActionEditor.h @@ -32,7 +32,6 @@ #include #include - class QLineEdit; class QComboBox; class QSimpleRichText; @@ -42,7 +41,6 @@ class ActionEditorTreeWidgetItem; class KviScriptEditor; class ActionEditor; - class ActionData { public: @@ -57,29 +55,28 @@ public: unsigned int m_uFlags; ActionEditorTreeWidgetItem * m_pItem; // ummigarba tanto... public: - ActionData(const QString &szName, - const QString &szScriptCode, - const QString &szVisibleName, - const QString &szDescription, - const QString &szCategory, - const QString &szBigIcon, - const QString &szSmallIcon, - unsigned int uFlags, - const QString &szKeySequence, - ActionEditorTreeWidgetItem * pItem) - : m_szName(szName), m_szScriptCode(szScriptCode), m_szVisibleName(szVisibleName), - m_szDescription(szDescription), m_szCategory(szCategory), m_szBigIcon(szBigIcon), - m_szSmallIcon(szSmallIcon), m_szKeySequence(szKeySequence), m_uFlags(uFlags), - m_pItem(pItem) - {}; + ActionData(const QString & szName, + const QString & szScriptCode, + const QString & szVisibleName, + const QString & szDescription, + const QString & szCategory, + const QString & szBigIcon, + const QString & szSmallIcon, + unsigned int uFlags, + const QString & szKeySequence, + ActionEditorTreeWidgetItem * pItem) + : m_szName(szName), m_szScriptCode(szScriptCode), m_szVisibleName(szVisibleName), + m_szDescription(szDescription), m_szCategory(szCategory), m_szBigIcon(szBigIcon), + m_szSmallIcon(szSmallIcon), m_szKeySequence(szKeySequence), m_uFlags(uFlags), + m_pItem(pItem){}; }; - class ActionEditorTreeWidgetItem : public QTreeWidgetItem { public: - ActionEditorTreeWidgetItem(QTreeWidget * v,ActionData * a); + ActionEditorTreeWidgetItem(QTreeWidget * v, ActionData * a); ~ActionEditorTreeWidgetItem(); + protected: ActionData * m_pActionData; //QSimpleRichText * m_pText; @@ -87,33 +84,34 @@ protected: QPixmap * m_pIcon; QTreeWidget * m_pTreeWidget; QString m_szKey; + public: - ActionData * actionData(){ return m_pActionData; }; + ActionData * actionData() { return m_pActionData; }; //void setupForActionData(); public: //virtual void paintCell(QPainter * p,const QColorGroup & cg,int column,int width,int align); //virtual void setup(); - virtual QString key(int,bool) const; + virtual QString key(int, bool) const; }; - class ActionEditorTreeView : public QTreeWidget { Q_OBJECT public: ActionEditorTreeView(QWidget * pParent); ~ActionEditorTreeView(); + protected: virtual void resizeEvent(QResizeEvent * e); }; - class SingleActionEditor : public QWidget { Q_OBJECT public: - SingleActionEditor(QWidget * par,ActionEditor * ed); + SingleActionEditor(QWidget * par, ActionEditor * ed); ~SingleActionEditor(); + protected: ActionEditor * m_pActionEditor; ActionData * m_pActionData; @@ -138,22 +136,22 @@ protected: QCheckBox * m_pConsoleOnlyIfUsersSelectedCheck; QCheckBox * m_pChannelOnlyIfUsersSelectedCheck; QCheckBox * m_pQueryOnlyIfUsersSelectedCheck; + public: - ActionData * actionData(){ return m_pActionData; }; + ActionData * actionData() { return m_pActionData; }; void setActionData(ActionData * d); void commit(); protected slots: void chooseSmallIcon(); void chooseBigIcon(); - void displaySmallIcon(const QString &szIconId); - void displayBigIcon(const QString &szIconId); + void displaySmallIcon(const QString & szIconId); + void displayBigIcon(const QString & szIconId); void needsContextCheckToggled(bool); void needsConnectionCheckToggled(bool); void specificWindowsCheckToggled(bool); void channelQueryOrConsoleWindowCheckToggled(bool); }; - class ActionEditor : public QWidget { friend class ActionEditorWindow; @@ -161,6 +159,7 @@ class ActionEditor : public QWidget public: ActionEditor(QWidget * par); ~ActionEditor(); + protected: ActionEditorTreeView * m_pTreeWidget; SingleActionEditor * m_pSingleActionEditor; @@ -168,31 +167,34 @@ protected: QPushButton * m_pNewActionButton; QPushButton * m_pDeleteActionsButton; QPushButton * m_pExportActionsButton; + public: void commit(); - bool actionExists(const QString &szName); + bool actionExists(const QString & szName); + protected: int selectedCount(); - QString nameForAutomaticAction(const QString &szTemplate); + QString nameForAutomaticAction(const QString & szTemplate); protected slots: - void currentItemChanged(QTreeWidgetItem * it,QTreeWidgetItem *prev); + void currentItemChanged(QTreeWidgetItem * it, QTreeWidgetItem * prev); void newAction(); void deleteActions(); void exportActions(); }; - class ActionEditorWindow : public KviWindow { Q_OBJECT public: ActionEditorWindow(); ~ActionEditorWindow(); + protected: ActionEditor * m_pEditor; + protected: virtual QPixmap * myIconPtr(); - virtual void getConfigGroupName(QString &szName); + virtual void getConfigGroupName(QString & szName); virtual void saveProperties(KviConfigurationFile *); virtual void loadProperties(KviConfigurationFile *); protected slots: diff --git a/src/modules/actioneditor/libkviactioneditor.cpp b/src/modules/actioneditor/libkviactioneditor.cpp index 7714b2cd6..a83450a03 100644 --- a/src/modules/actioneditor/libkviactioneditor.cpp +++ b/src/modules/actioneditor/libkviactioneditor.cpp @@ -30,7 +30,6 @@ ActionEditorWindow * g_pActionEditorWindow = 0; - /* @doc: actioneditor.open @type: @@ -59,7 +58,7 @@ static bool actioneditor_kvs_cmd_open(KviKvsModuleCommandCall *) static bool actioneditor_module_init(KviModule * m) { - KVSM_REGISTER_SIMPLE_COMMAND(m,"open",actioneditor_kvs_cmd_open); + KVSM_REGISTER_SIMPLE_COMMAND(m, "open", actioneditor_kvs_cmd_open); g_pActionEditorWindow = 0; return true; } @@ -78,13 +77,12 @@ static bool actioneditor_module_cleanup(KviModule *) } KVIRC_MODULE( - "ActionEditor", // module name - "4.0.0", // module version - "Copyright (C) 2004 Szymon Stefanek (pragma at kvirc dot net)", // author & (C) - "Editor for the script actions", - actioneditor_module_init, - actioneditor_module_can_unload, - 0, - actioneditor_module_cleanup, - "editor" -) + "ActionEditor", // module name + "4.0.0", // module version + "Copyright (C) 2004 Szymon Stefanek (pragma at kvirc dot net)", // author & (C) + "Editor for the script actions", + actioneditor_module_init, + actioneditor_module_can_unload, + 0, + actioneditor_module_cleanup, + "editor") diff --git a/src/modules/addon/AddonFunctions.cpp b/src/modules/addon/AddonFunctions.cpp index 192e0d8ac..487681942 100644 --- a/src/modules/addon/AddonFunctions.cpp +++ b/src/modules/addon/AddonFunctions.cpp @@ -44,20 +44,19 @@ #include #include - #include namespace AddonFunctions { - bool notAValidAddonPackage(QString &szError) + bool notAValidAddonPackage(QString & szError) { - szError = __tr2qs_ctx("The selected file doesn't seem to be a valid KVIrc addon package","addon"); + szError = __tr2qs_ctx("The selected file doesn't seem to be a valid KVIrc addon package", "addon"); return false; } - bool installAddonPackage(const QString &szAddonPackageFileName,QString &szError,QWidget * pDialogParent) + bool installAddonPackage(const QString & szAddonPackageFileName, QString & szError, QWidget * pDialogParent) { - KviPointerHashTable * pInfoFields; + KviPointerHashTable * pInfoFields; QString * pValue; QString szErr; QPixmap pix; @@ -72,7 +71,7 @@ namespace AddonFunctions if(!r.readHeader(szAddonPackageFileName)) { szErr = r.lastError(); - szError = QString(__tr2qs_ctx("The selected file doesn't seem to be a valid KVIrc package: %1","addon")).arg(szErr); + szError = QString(__tr2qs_ctx("The selected file doesn't seem to be a valid KVIrc package: %1", "addon")).arg(szErr); return false; } @@ -83,7 +82,7 @@ namespace AddonFunctions if(!pValue) return notAValidAddonPackage(szError); - if(!KviQString::equalCI(*pValue,"AddonPack")) + if(!KviQString::equalCI(*pValue, "AddonPack")) return notAValidAddonPackage(szError); pValue = pInfoFields->find("AddonPackVersion"); @@ -92,7 +91,7 @@ namespace AddonFunctions return notAValidAddonPackage(szError); // make sure the default fields exist - for(int i=0;i<6;i++) + for(int i = 0; i < 6; i++) { pValue = pInfoFields->find(check_fields[i]); if(!pValue) @@ -103,7 +102,7 @@ namespace AddonFunctions // load its picture pByteArray = r.binaryInfoFields()->find("Image"); if(pByteArray) - pix.loadFromData(*pByteArray,0,0); + pix.loadFromData(*pByteArray, 0, 0); if(pix.isNull()) { @@ -120,18 +119,18 @@ namespace AddonFunctions QString szPackageApplication; QString szMinKVIrcVersion; - QString szAuthor = __tr2qs_ctx("Author","addon"); - QString szCreatedAt = __tr2qs_ctx("Created at","addon"); - QString szCreatedWith = __tr2qs_ctx("Created with","addon"); + QString szAuthor = __tr2qs_ctx("Author", "addon"); + QString szCreatedAt = __tr2qs_ctx("Created at", "addon"); + QString szCreatedWith = __tr2qs_ctx("Created with", "addon"); - r.getStringInfoField("Name",szPackageName); - r.getStringInfoField("Version",szPackageVersion); - r.getStringInfoField("Author",szPackageAuthor); - r.getStringInfoField("Description",szPackageDescription); - r.getStringInfoField("Application",szPackageApplication); - r.getStringInfoField("Date",szPackageDate); - r.getStringInfoField("AddonPackVersion",szAddonPackVersion); - r.getStringInfoField("MinimumKVIrcVersion",szMinKVIrcVersion); + r.getStringInfoField("Name", szPackageName); + r.getStringInfoField("Version", szPackageVersion); + r.getStringInfoField("Author", szPackageAuthor); + r.getStringInfoField("Description", szPackageDescription); + r.getStringInfoField("Application", szPackageApplication); + r.getStringInfoField("Date", szPackageDate); + r.getStringInfoField("AddonPackVersion", szAddonPackVersion); + r.getStringInfoField("MinimumKVIrcVersion", szMinKVIrcVersion); QString szWarnings; QString szTmp; @@ -141,23 +140,22 @@ namespace AddonFunctions if(szPackageName.isEmpty() || szPackageVersion.isEmpty() || szAddonPackVersion.isEmpty()) bValid = false; - if(KviMiscUtils::compareVersions(szAddonPackVersion,KVI_CURRENT_ADDONS_ENGINE_VERSION) < 0) + if(KviMiscUtils::compareVersions(szAddonPackVersion, KVI_CURRENT_ADDONS_ENGINE_VERSION) < 0) bValid = false; if(!szMinKVIrcVersion.isEmpty()) { - if(KviMiscUtils::compareVersions(szMinKVIrcVersion,KVI_VERSION) < 0) + if(KviMiscUtils::compareVersions(szMinKVIrcVersion, KVI_VERSION) < 0) bValid = false; } if(!bValid) { szWarnings += "

"; - szWarnings += __tr2qs_ctx("Warning: The addon might be incompatible with this version of KVIrc","addon"); + szWarnings += __tr2qs_ctx("Warning: The addon might be incompatible with this version of KVIrc", "addon"); szWarnings += "

"; } - // clang-format off hd.szHtmlText = QString( "" \ @@ -186,17 +184,17 @@ namespace AddonFunctions "").arg(szPackageName,szPackageVersion,szPackageDescription,szAuthor,szPackageAuthor,szCreatedAt,szPackageDate,szCreatedWith,szPackageApplication).arg(szWarnings); // clang-format on - hd.addImageResource("addon_dialog_pack_image",pix); - hd.addHtmlResource("addon_dialog_main",hd.szHtmlText); + hd.addImageResource("addon_dialog_pack_image", pix); + hd.addHtmlResource("addon_dialog_main", hd.szHtmlText); QString beginCenter = "
"; QString endCenter = "
"; - hd.szCaption = __tr2qs_ctx("Install Addon Pack - KVIrc","addon"); - hd.szUpperLabelText = beginCenter + __tr2qs_ctx("You're about to install the following addon package","addon") + endCenter; - hd.szLowerLabelText = beginCenter + __tr2qs_ctx("Do you want to proceed with the installation?","addon") + endCenter; - hd.szButton1Text = __tr2qs_ctx("Do Not Install","addon"); - hd.szButton2Text = __tr2qs_ctx("Yes, Proceed","addon"); + hd.szCaption = __tr2qs_ctx("Install Addon Pack - KVIrc", "addon"); + hd.szUpperLabelText = beginCenter + __tr2qs_ctx("You're about to install the following addon package", "addon") + endCenter; + hd.szLowerLabelText = beginCenter + __tr2qs_ctx("Do you want to proceed with the installation?", "addon") + endCenter; + hd.szButton1Text = __tr2qs_ctx("Do Not Install", "addon"); + hd.szButton2Text = __tr2qs_ctx("Yes, Proceed", "addon"); hd.iDefaultButton = 2; hd.iCancelButton = 1; hd.pixIcon = *(g_pIconManager->getSmallIcon(KviIconManager::Addons)); @@ -204,7 +202,7 @@ namespace AddonFunctions hd.iMinimumHeight = 420; hd.iFlags = KviHtmlDialogData::ForceMinimumSize; - bInstall = KviHtmlDialog::display(pDialogParent,&hd) == 2; + bInstall = KviHtmlDialog::display(pDialogParent, &hd) == 2; if(!bInstall) return true; @@ -213,8 +211,8 @@ namespace AddonFunctions QString szTmpPath, szUnpackPath; QString szRandomDir = createRandomDir(); - g_pApp->getLocalKvircDirectory(szTmpPath,KviApplication::Tmp); - KviQString::ensureLastCharIs(szTmpPath,QChar(KVI_PATH_SEPARATOR_CHAR)); + g_pApp->getLocalKvircDirectory(szTmpPath, KviApplication::Tmp); + KviQString::ensureLastCharIs(szTmpPath, QChar(KVI_PATH_SEPARATOR_CHAR)); szUnpackPath = szTmpPath + szRandomDir; QDir szTmpDir(szUnpackPath); @@ -227,10 +225,10 @@ namespace AddonFunctions } // Unpack addon package into the random tmp dir - if(!r.unpack(szAddonPackageFileName,szUnpackPath)) + if(!r.unpack(szAddonPackageFileName, szUnpackPath)) { szErr = r.lastError(); - szError = QString(__tr2qs_ctx("Failed to unpack the selected file: %1","addon")).arg(szErr); + szError = QString(__tr2qs_ctx("Failed to unpack the selected file: %1", "addon")).arg(szErr); return false; } @@ -243,7 +241,7 @@ namespace AddonFunctions } if(!KviFileUtils::deleteDir(szUnpackPath)) - QMessageBox::warning(NULL,__tr2qs_ctx("Warning While Unpacking Addon - KVIrc","addon"),__tr2qs_ctx("Failed to delete the directory '%1'","addon").arg(szUnpackPath)); + QMessageBox::warning(NULL, __tr2qs_ctx("Warning While Unpacking Addon - KVIrc", "addon"), __tr2qs_ctx("Failed to delete the directory '%1'", "addon").arg(szUnpackPath)); return true; } @@ -252,17 +250,17 @@ namespace AddonFunctions { QString szDirName; char chars[] = { - 'A','B','C','D','E','F','G','H', - 'I','J','K','L','M','N','O','P', - 'Q','R','S','T','U','V','W','X', - 'Y','Z','a','b','c','d','e','f', - 'g','h','i','j','k','l','m','n', - 'o','p','q','r','s','t','u','v', - 'w','x','y','z','-','_','.' + 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', + 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', + 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', + 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', + 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', + 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', + 'w', 'x', 'y', 'z', '-', '_', '.' }; // Generate dir name - for(int i=0;i<10;i++) + for(int i = 0; i < 10; i++) { int n = rand() % sizeof(chars); szDirName.append(chars[n]); @@ -271,7 +269,7 @@ namespace AddonFunctions return szDirName; } - bool checkDirTree(const QString &szDirPath,QString * pszError) + bool checkDirTree(const QString & szDirPath, QString * pszError) { if(pszError) *pszError = ""; @@ -279,23 +277,23 @@ namespace AddonFunctions QDir addon(szDirPath); if(!addon.exists()) { - *pszError = __tr2qs_ctx("The selected directory doesn't exist.","addon"); + *pszError = __tr2qs_ctx("The selected directory doesn't exist.", "addon"); return false; } QFileInfo init(szDirPath + "/install.kvs"); if(!init.exists()) { - *pszError = __tr2qs_ctx("The initialization script (install.kvs) doesn't exist.","addon"); + *pszError = __tr2qs_ctx("The initialization script (install.kvs) doesn't exist.", "addon"); return false; } return true; } - bool pack(AddonInfo &info,QString &szError) + bool pack(AddonInfo & info, QString & szError) { - if(!checkDirTree(info.szDirPath,&szError)) + if(!checkDirTree(info.szDirPath, &szError)) return false; if(info.szMinVersion.isEmpty()) @@ -305,32 +303,32 @@ namespace AddonFunctions szTmp = QDateTime::currentDateTime().toString(Qt::ISODate); KviPackageWriter pw; - pw.addInfoField("PackageType","AddonPack"); - pw.addInfoField("AddonPackVersion",KVI_CURRENT_ADDONS_ENGINE_VERSION); - pw.addInfoField("Name",info.szName); - pw.addInfoField("Version",info.szVersion); - pw.addInfoField("Author",info.szAuthor); - pw.addInfoField("Description",info.szDescription); - pw.addInfoField("Date",szTmp); - pw.addInfoField("MinimumKVIrcVersion",info.szMinVersion); - pw.addInfoField("Application","KVIrc " KVI_VERSION "." KVI_SOURCES_DATE); + pw.addInfoField("PackageType", "AddonPack"); + pw.addInfoField("AddonPackVersion", KVI_CURRENT_ADDONS_ENGINE_VERSION); + pw.addInfoField("Name", info.szName); + pw.addInfoField("Version", info.szVersion); + pw.addInfoField("Author", info.szAuthor); + pw.addInfoField("Description", info.szDescription); + pw.addInfoField("Date", szTmp); + pw.addInfoField("MinimumKVIrcVersion", info.szMinVersion); + pw.addInfoField("Application", "KVIrc " KVI_VERSION "." KVI_SOURCES_DATE); if(!info.szImage.isEmpty()) { QPixmap pix(info.szImage); if(pix.isNull()) { - szError = __tr2qs_ctx("Failed to load the image at %1","addon").arg(info.szImage); + szError = __tr2qs_ctx("Failed to load the image at %1", "addon").arg(info.szImage); return false; } QByteArray * pba = new QByteArray(); - QBuffer bufferz(pba,0); + QBuffer bufferz(pba, 0); bufferz.open(QIODevice::WriteOnly); - pix.save(&bufferz,"PNG"); + pix.save(&bufferz, "PNG"); bufferz.close(); - pw.addInfoField("Image",pba); + pw.addInfoField("Image", pba); } QDir dir(info.szDirPath); @@ -338,17 +336,17 @@ namespace AddonFunctions if(ls.isEmpty()) { - szError = __tr2qs_ctx("The package file list is empty","addon"); + szError = __tr2qs_ctx("The package file list is empty", "addon"); return false; } - for(QFileInfoList::Iterator it = ls.begin();it != ls.end();++it) + for(QFileInfoList::Iterator it = ls.begin(); it != ls.end(); ++it) { - const QFileInfo &inf = *it; + const QFileInfo & inf = *it; if(inf.isDir()) { - if(!pw.addDirectory(inf.absoluteFilePath(),QString("%1/").arg(inf.fileName()))) + if(!pw.addDirectory(inf.absoluteFilePath(), QString("%1/").arg(inf.fileName()))) { szError = pw.lastError(); return false; @@ -358,18 +356,17 @@ namespace AddonFunctions } // must be a file - if(!pw.addFile(inf.absoluteFilePath(),inf.fileName())) + if(!pw.addFile(inf.absoluteFilePath(), inf.fileName())) { szError = pw.lastError(); return false; } } - // Create the addon package if(info.szSavePath.isEmpty()) { - szError = __tr2qs_ctx("Save path is empty","addon"); + szError = __tr2qs_ctx("Save path is empty", "addon"); return false; } @@ -381,5 +378,4 @@ namespace AddonFunctions return true; } - } diff --git a/src/modules/addon/AddonFunctions.h b/src/modules/addon/AddonFunctions.h index 27b27673f..6d4d9cae2 100644 --- a/src/modules/addon/AddonFunctions.h +++ b/src/modules/addon/AddonFunctions.h @@ -47,8 +47,8 @@ public: namespace AddonFunctions { - bool checkDirTree(const QString &szDirPath,QString * pszError); - bool pack(AddonInfo &info,QString &szError); + bool checkDirTree(const QString & szDirPath, QString * pszError); + bool pack(AddonInfo & info, QString & szError); bool notAValidAddonPackage(QString & szError); bool installAddonPackage(const QString & szAddonPackageFileName, QString & szError, QWidget * pDialogParent = 0); QString createRandomDir(); diff --git a/src/modules/addon/AddonManagementDialog.cpp b/src/modules/addon/AddonManagementDialog.cpp index 955fa01a5..3b96e47c4 100644 --- a/src/modules/addon/AddonManagementDialog.cpp +++ b/src/modules/addon/AddonManagementDialog.cpp @@ -57,15 +57,14 @@ #include #ifdef COMPILE_WEBKIT_SUPPORT - #include "WebAddonInterfaceDialog.h" +#include "WebAddonInterfaceDialog.h" #endif //COMPILE_WEBKIT_SUPPORT - AddonManagementDialog * AddonManagementDialog::m_pInstance = 0; extern QRect g_rectManagementDialogGeometry; -AddonListViewItem::AddonListViewItem(KviTalListWidget *v,KviKvsScriptAddon * a) -: KviTalListWidgetItem(v) +AddonListViewItem::AddonListViewItem(KviTalListWidget * v, KviKvsScriptAddon * a) + : KviTalListWidgetItem(v) { m_pAddon = new KviKvsScriptAddon(*a); m_pListWidget = v; @@ -83,11 +82,8 @@ AddonListViewItem::AddonListViewItem(KviTalListWidget *v,KviKvsScriptAddon * a) setText(t); QPixmap * p = a->icon(); - if (p) + if(p) setIcon(*p); - - - } AddonListViewItem::~AddonListViewItem() @@ -96,9 +92,9 @@ AddonListViewItem::~AddonListViewItem() } AddonManagementDialog::AddonManagementDialog(QWidget * p) -: QWidget(p) + : QWidget(p) { - setWindowTitle(__tr2qs_ctx("Manage Addons - KVIrc","addon")); + setWindowTitle(__tr2qs_ctx("Manage Addons - KVIrc", "addon")); setObjectName("Addon manager"); setWindowIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Addons))); @@ -109,31 +105,31 @@ AddonManagementDialog::AddonManagementDialog(QWidget * p) m_pInstance = this; QGridLayout * g = new QGridLayout(this); - KviTalHBox *hb = new KviTalHBox(this); + KviTalHBox * hb = new KviTalHBox(this); hb->setMargin(1); hb->setSpacing(1); - g->addWidget(hb,0,0); + g->addWidget(hb, 0, 0); QToolButton * tb; QFrame * sep; m_pConfigureButton = new QToolButton(hb); m_pConfigureButton->setIcon(*(g_pIconManager->getBigIcon(KVI_BIGICON_ADDONS))); - m_pConfigureButton->setIconSize(QSize(32,32)); - KviTalToolTip::add(m_pConfigureButton,__tr2qs_ctx("Configure addon...","addon")); - connect(m_pConfigureButton,SIGNAL(clicked()),this,SLOT(configureScript())); + m_pConfigureButton->setIconSize(QSize(32, 32)); + KviTalToolTip::add(m_pConfigureButton, __tr2qs_ctx("Configure addon...", "addon")); + connect(m_pConfigureButton, SIGNAL(clicked()), this, SLOT(configureScript())); m_pHelpButton = new QToolButton(hb); m_pHelpButton->setIcon(*(g_pIconManager->getBigIcon(KVI_BIGICON_HELP))); - m_pHelpButton->setIconSize(QSize(32,32)); - KviTalToolTip::add(m_pHelpButton,__tr2qs_ctx("Show help","addon")); - connect(m_pHelpButton,SIGNAL(clicked()),this,SLOT(showScriptHelp())); + m_pHelpButton->setIconSize(QSize(32, 32)); + KviTalToolTip::add(m_pHelpButton, __tr2qs_ctx("Show help", "addon")); + connect(m_pHelpButton, SIGNAL(clicked()), this, SLOT(showScriptHelp())); m_pUninstallButton = new QToolButton(hb); m_pUninstallButton->setIcon(*(g_pIconManager->getBigIcon(KVI_BIGICON_REMOVE))); - m_pUninstallButton->setIconSize(QSize(32,32)); - KviTalToolTip::add(m_pUninstallButton,__tr2qs_ctx("Delete selected addon","addon")); - connect(m_pUninstallButton,SIGNAL(clicked()),this,SLOT(uninstallScript())); + m_pUninstallButton->setIconSize(QSize(32, 32)); + KviTalToolTip::add(m_pUninstallButton, __tr2qs_ctx("Delete selected addon", "addon")); + connect(m_pUninstallButton, SIGNAL(clicked()), this, SLOT(uninstallScript())); sep = new QFrame(hb); sep->setFrameStyle(QFrame::VLine | QFrame::Sunken); @@ -141,9 +137,9 @@ AddonManagementDialog::AddonManagementDialog(QWidget * p) m_pPackButton = new QToolButton(hb); m_pPackButton->setIcon(*(g_pIconManager->getBigIcon(KVI_BIGICON_PACK))); - m_pPackButton->setIconSize(QSize(32,32)); - KviTalToolTip::add(m_pPackButton,__tr2qs_ctx("Create an addon as a distributable package","addon")); - connect(m_pPackButton,SIGNAL(clicked()),this,SLOT(packScript())); + m_pPackButton->setIconSize(QSize(32, 32)); + KviTalToolTip::add(m_pPackButton, __tr2qs_ctx("Create an addon as a distributable package", "addon")); + connect(m_pPackButton, SIGNAL(clicked()), this, SLOT(packScript())); sep = new QFrame(hb); sep->setFrameStyle(QFrame::VLine | QFrame::Sunken); @@ -151,53 +147,53 @@ AddonManagementDialog::AddonManagementDialog(QWidget * p) tb = new QToolButton(hb); tb->setIcon(*(g_pIconManager->getBigIcon(KVI_BIGICON_OPEN))); - tb->setIconSize(QSize(32,32)); - KviTalToolTip::add(tb,__tr2qs_ctx("Install addon package from disk","addon")); - connect(tb,SIGNAL(clicked()),this,SLOT(installScript())); + tb->setIconSize(QSize(32, 32)); + KviTalToolTip::add(tb, __tr2qs_ctx("Install addon package from disk", "addon")); + connect(tb, SIGNAL(clicked()), this, SLOT(installScript())); tb = new QToolButton(hb); tb->setIcon(*(g_pIconManager->getBigIcon(KVI_BIGICON_WWW))); - tb->setIconSize(QSize(32,32)); - KviTalToolTip::add(tb,__tr2qs_ctx("Get more addons...","addon")); - connect(tb,SIGNAL(clicked()),this,SLOT(getMoreScripts())); + tb->setIconSize(QSize(32, 32)); + KviTalToolTip::add(tb, __tr2qs_ctx("Get more addons...", "addon")); + connect(tb, SIGNAL(clicked()), this, SLOT(getMoreScripts())); - QWidget *w= new QWidget(hb); - w->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Minimum); + QWidget * w = new QWidget(hb); + w->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum); m_pListWidget = new KviTalListWidget(this); - KviTalIconAndRichTextItemDelegate *itemDelegate=new KviTalIconAndRichTextItemDelegate(m_pListWidget); + KviTalIconAndRichTextItemDelegate * itemDelegate = new KviTalIconAndRichTextItemDelegate(m_pListWidget); m_pListWidget->setItemDelegate(itemDelegate); m_pListWidget->setSelectionMode(QAbstractItemView::SingleSelection); m_pListWidget->setSortingEnabled(true); m_pListWidget->setMinimumHeight(400); m_pListWidget->setMinimumWidth(380); - g->addWidget(m_pListWidget,1,0); + g->addWidget(m_pListWidget, 1, 0); fillListView(); - currentChanged(0,0); - connect(m_pListWidget,SIGNAL(currentItemChanged(QListWidgetItem *,QListWidgetItem *)),this,SLOT(currentChanged(QListWidgetItem *,QListWidgetItem *))); + currentChanged(0, 0); + connect(m_pListWidget, SIGNAL(currentItemChanged(QListWidgetItem *, QListWidgetItem *)), this, SLOT(currentChanged(QListWidgetItem *, QListWidgetItem *))); m_pListWidget->setCurrentItem(m_pListWidget->item(0)); - QPushButton * pCloseBtn = new QPushButton(__tr2qs_ctx("Close","addon"),this); - pCloseBtn->setMaximumSize(pCloseBtn->sizeHint().width(),pCloseBtn->sizeHint().height()); - connect(pCloseBtn,SIGNAL(clicked()),this,SLOT(closeClicked())); - g->addWidget(pCloseBtn,2,0); + QPushButton * pCloseBtn = new QPushButton(__tr2qs_ctx("Close", "addon"), this); + pCloseBtn->setMaximumSize(pCloseBtn->sizeHint().width(), pCloseBtn->sizeHint().height()); + connect(pCloseBtn, SIGNAL(clicked()), this, SLOT(closeClicked())); + g->addWidget(pCloseBtn, 2, 0); g->setMargin(5); g->setSpacing(5); - g->setAlignment(pCloseBtn,Qt::AlignRight); + g->setAlignment(pCloseBtn, Qt::AlignRight); if(g_rectManagementDialogGeometry.y() < 5) { g_rectManagementDialogGeometry.setY(5); } resize(g_rectManagementDialogGeometry.width(), - g_rectManagementDialogGeometry.height()); + g_rectManagementDialogGeometry.height()); QRect rect = g_pApp->desktop()->screenGeometry(g_pMainWindow); - move(rect.x() + ((rect.width() - g_rectManagementDialogGeometry.width())/2),rect.y() + ((rect.height() - g_rectManagementDialogGeometry.height())/2)); + move(rect.x() + ((rect.width() - g_rectManagementDialogGeometry.width()) / 2), rect.y() + ((rect.height() - g_rectManagementDialogGeometry.height()) / 2)); new QShortcut(Qt::Key_Escape, this, SLOT(closeClicked())); } @@ -208,25 +204,26 @@ AddonManagementDialog::~AddonManagementDialog() if(m_pWebInterfaceDialog) delete m_pWebInterfaceDialog; #endif //COMPILE_WEBKIT_SUPPORT - g_rectManagementDialogGeometry = QRect(pos().x(),pos().y(),size().width(),size().height()); + g_rectManagementDialogGeometry = QRect(pos().x(), pos().y(), size().width(), size().height()); m_pInstance = NULL; } void AddonManagementDialog::fillListView() { m_pListWidget->clear(); - KviPointerHashTable * d = KviKvsScriptAddonManager::instance()->addonDict(); - if(!d)return; - KviPointerHashTableIterator it(*d); + KviPointerHashTable * d = KviKvsScriptAddonManager::instance()->addonDict(); + if(!d) + return; + KviPointerHashTableIterator it(*d); while(KviKvsScriptAddon * a = it.current()) { - new AddonListViewItem(m_pListWidget,a); + new AddonListViewItem(m_pListWidget, a); ++it; } } -void AddonManagementDialog::currentChanged(QListWidgetItem *item,QListWidgetItem *) +void AddonManagementDialog::currentChanged(QListWidgetItem * item, QListWidgetItem *) { AddonListViewItem * it = (AddonListViewItem *)item; if(!it) @@ -234,7 +231,9 @@ void AddonManagementDialog::currentChanged(QListWidgetItem *item,QListWidgetItem m_pConfigureButton->setEnabled(false); m_pUninstallButton->setEnabled(false); m_pHelpButton->setEnabled(false); - } else { + } + else + { m_pConfigureButton->setEnabled(!(it->addon()->configureCallbackCode().isEmpty())); m_pHelpButton->setEnabled(!(it->addon()->helpCallbackCode().isEmpty())); m_pUninstallButton->setEnabled(true); @@ -244,16 +243,20 @@ void AddonManagementDialog::currentChanged(QListWidgetItem *item,QListWidgetItem void AddonManagementDialog::showScriptHelp() { AddonListViewItem * it = (AddonListViewItem *)m_pListWidget->currentItem(); - if(!it)return; - if(it->addon()->helpCallbackCode().isEmpty())return; + if(!it) + return; + if(it->addon()->helpCallbackCode().isEmpty()) + return; it->addon()->executeHelpCallback(g_pActiveWindow); } void AddonManagementDialog::configureScript() { AddonListViewItem * it = (AddonListViewItem *)m_pListWidget->currentItem(); - if(!it)return; - if(it->addon()->configureCallbackCode().isEmpty())return; + if(!it) + return; + if(it->addon()->configureCallbackCode().isEmpty()) + return; it->addon()->executeConfigureCallback(g_pActiveWindow); } @@ -267,22 +270,24 @@ void AddonManagementDialog::packScript() void AddonManagementDialog::uninstallScript() { AddonListViewItem * it = (AddonListViewItem *)m_pListWidget->currentItem(); - if(!it)return; + if(!it) + return; QString txt = "

"; - txt += __tr2qs_ctx("Do you really want to uninstall the addon \"%1\"?","addon").arg(it->addon()->visibleName()); + txt += __tr2qs_ctx("Do you really want to uninstall the addon \"%1\"?", "addon").arg(it->addon()->visibleName()); txt += "

"; if(QMessageBox::question( - this, - __tr2qs_ctx("Confirm Addon Uninstallation - KVIrc","addon"), - txt, __tr2qs_ctx("Yes","addon"), __tr2qs_ctx("No","addon"),0,1 - ) != 0) return; + this, + __tr2qs_ctx("Confirm Addon Uninstallation - KVIrc", "addon"), + txt, __tr2qs_ctx("Yes", "addon"), __tr2qs_ctx("No", "addon"), 0, 1) + != 0) + return; - KviKvsScriptAddonManager::instance()->unregisterAddon(it->addon()->name(),g_pActiveWindow); + KviKvsScriptAddonManager::instance()->unregisterAddon(it->addon()->name(), g_pActiveWindow); fillListView(); - currentChanged(0,0); + currentChanged(0, 0); } void AddonManagementDialog::getMoreScripts() @@ -291,9 +296,9 @@ void AddonManagementDialog::getMoreScripts() if(m_pWebInterfaceDialog) return; m_pWebInterfaceDialog = new WebAddonInterfaceDialog(); -#else //!COMPILE_WEBKIT_SUPPORT +#else //!COMPILE_WEBKIT_SUPPORT // If change this introducing not-fixed text, remember to escape this using KviQString::escapeKvs()! - KviKvsScript::run("openurl http://www.kvirc.net/?id=addons&version=" KVI_VERSION "." KVI_SOURCES_DATE,g_pActiveWindow); + KviKvsScript::run("openurl http://www.kvirc.net/?id=addons&version=" KVI_VERSION "." KVI_SOURCES_DATE, g_pActiveWindow); #endif //!COMPILE_WEBKIT_SUPPORT } @@ -302,44 +307,44 @@ void AddonManagementDialog::installScript() QString szFileName, szError; if(!KviFileDialog::askForOpenFileName( - szFileName, - __tr2qs_ctx("Select a Installation File - KVIrc","addon"), - QString(),KVI_FILTER_ADDON,false,true,this - )) return; + szFileName, + __tr2qs_ctx("Select a Installation File - KVIrc", "addon"), + QString(), KVI_FILTER_ADDON, false, true, this)) + return; - szFileName.replace("\\","\\\\"); + szFileName.replace("\\", "\\\\"); // Sanity check if(szFileName.endsWith(".kva")) { - if(!AddonFunctions::installAddonPackage(szFileName,szError,this)) + if(!AddonFunctions::installAddonPackage(szFileName, szError, this)) { QMessageBox::critical( - this, - __tr2qs_ctx("Install Addon - KVIrc","addon"), - szError, - QMessageBox::Ok, - QMessageBox::NoButton, - QMessageBox::NoButton - ); + this, + __tr2qs_ctx("Install Addon - KVIrc", "addon"), + szError, + QMessageBox::Ok, + QMessageBox::NoButton, + QMessageBox::NoButton); return; } - } else { + } + else + { // Just for sanity check. We should NEVER enter here qDebug("Entered sanity check"); AddonFunctions::notAValidAddonPackage(szError); QMessageBox::critical( - this, - __tr2qs_ctx("Install Addon - KVIrc","addon"), - szError, - QMessageBox::Ok, - QMessageBox::NoButton, - QMessageBox::NoButton - ); + this, + __tr2qs_ctx("Install Addon - KVIrc", "addon"), + szError, + QMessageBox::Ok, + QMessageBox::NoButton, + QMessageBox::NoButton); } fillListView(); - currentChanged(0,0); + currentChanged(0, 0); //m_pListWidget->publicUpdateContents(); //m_pListWidget->triggerUpdate(); @@ -352,7 +357,8 @@ void AddonManagementDialog::closeClicked() void AddonManagementDialog::cleanup() { - if(!m_pInstance)return; + if(!m_pInstance) + return; delete m_pInstance; m_pInstance = 0; } @@ -367,17 +373,23 @@ void AddonManagementDialog::display(bool bTopLevel) { m_pInstance->setParent(0); } - } else { + } + else + { if(m_pInstance->parent() != g_pMainWindow->splitter()) { m_pInstance->setParent(g_pMainWindow->splitter()); } } - } else { + } + else + { if(bTopLevel) { m_pInstance = new AddonManagementDialog(0); - } else { + } + else + { m_pInstance = new AddonManagementDialog(g_pMainWindow->splitter()); } } diff --git a/src/modules/addon/AddonManagementDialog.h b/src/modules/addon/AddonManagementDialog.h index d39cf845a..2a1a50d74 100644 --- a/src/modules/addon/AddonManagementDialog.h +++ b/src/modules/addon/AddonManagementDialog.h @@ -42,44 +42,48 @@ class KviKvsScriptAddon; class AddonListViewItem : public KviTalListWidgetItem { public: - AddonListViewItem(KviTalListWidget * v,KviKvsScriptAddon * a); + AddonListViewItem(KviTalListWidget * v, KviKvsScriptAddon * a); ~AddonListViewItem(); + protected: KviKvsScriptAddon * m_pAddon; - QTextDocument * m_pText; - QPixmap * m_pIcon; - QListWidget * m_pListWidget; - QString m_szKey; + QTextDocument * m_pText; + QPixmap * m_pIcon; + QListWidget * m_pListWidget; + QString m_szKey; + public: - KviKvsScriptAddon * addon(){ return m_pAddon; }; + KviKvsScriptAddon * addon() { return m_pAddon; }; }; #ifdef COMPILE_WEBKIT_SUPPORT - class WebAddonInterfaceDialog; +class WebAddonInterfaceDialog; #endif //COMPILE_WEBKIT_SUPPORT - class AddonManagementDialog : public QWidget { Q_OBJECT protected: AddonManagementDialog(QWidget * p); + public: ~AddonManagementDialog(); + protected: - KviTalListWidget * m_pListWidget; + KviTalListWidget * m_pListWidget; static AddonManagementDialog * m_pInstance; - QToolButton * m_pConfigureButton; - QToolButton * m_pHelpButton; - QToolButton * m_pPackButton; - QToolButton * m_pUninstallButton; + QToolButton * m_pConfigureButton; + QToolButton * m_pHelpButton; + QToolButton * m_pPackButton; + QToolButton * m_pUninstallButton; #ifdef COMPILE_WEBKIT_SUPPORT QPointer m_pWebInterfaceDialog; #endif //COMPILE_WEBKIT_SUPPORT public: - static AddonManagementDialog * instance(){ return m_pInstance; }; + static AddonManagementDialog * instance() { return m_pInstance; }; static void display(bool bTopLevel); static void cleanup(); + protected: void fillListView(); virtual void closeEvent(QCloseEvent * e); diff --git a/src/modules/addon/PackAddonDialog.cpp b/src/modules/addon/PackAddonDialog.cpp index 4f0ccd5f6..b56fa3d12 100644 --- a/src/modules/addon/PackAddonDialog.cpp +++ b/src/modules/addon/PackAddonDialog.cpp @@ -42,58 +42,58 @@ #include PackAddonDialog::PackAddonDialog(QWidget * pParent) -: QWizard(pParent) + : QWizard(pParent) { - setMinimumSize(400,350); + setMinimumSize(400, 350); setObjectName("addon_package_wizard"); - setOption(QWizard::IndependentPages,true); - setWindowTitle(__tr2qs_ctx("Create Addon Package - KVIrc","addon")); + setOption(QWizard::IndependentPages, true); + setWindowTitle(__tr2qs_ctx("Create Addon Package - KVIrc", "addon")); QPixmap * pSide = g_pIconManager->getBigIcon("kvi_setup_label.png"); QPixmap * pLogo = g_pIconManager->getBigIcon("kvi_bigicon_addons.png"); #if defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW) - #if (_WIN32_WINNT >= 0x0600) - // We are on a Windows Vista / Seven - // It will fallback to XP if alpha compositing is disabled - setWizardStyle(QWizard::AeroStyle); - #else - // Windows XP - setWizardStyle(QWizard::ModernStyle); - setPixmap(QWizard::WatermarkPixmap,*pSide); - setPixmap(QWizard::LogoPixmap,*pLogo); - #endif +#if(_WIN32_WINNT >= 0x0600) + // We are on a Windows Vista / Seven + // It will fallback to XP if alpha compositing is disabled + setWizardStyle(QWizard::AeroStyle); +#else + // Windows XP + setWizardStyle(QWizard::ModernStyle); + setPixmap(QWizard::WatermarkPixmap, *pSide); + setPixmap(QWizard::LogoPixmap, *pLogo); +#endif #elif defined(COMPILE_ON_MAC) setWizardStyle(QWizard::MacStyle); - setPixmap(QWizard::BackgroundPixmap,*pSide); + setPixmap(QWizard::BackgroundPixmap, *pSide); #else // All other systems setWizardStyle(QWizard::ClassicStyle); - setPixmap(QWizard::WatermarkPixmap,*pSide); - setPixmap(QWizard::LogoPixmap,*pLogo); + setPixmap(QWizard::WatermarkPixmap, *pSide); + setPixmap(QWizard::LogoPixmap, *pLogo); #endif // Add a default property for file selectors - setDefaultProperty("KviFileSelector","tmpFile",SIGNAL(selectionChanged(const QString &))); + setDefaultProperty("KviFileSelector", "tmpFile", SIGNAL(selectionChanged(const QString &))); // Welcome page QWizardPage * pPage = new QWizardPage(this); QVBoxLayout * pLayout = new QVBoxLayout(pPage); pPage->setLayout(pLayout); - pPage->setTitle(__tr2qs_ctx("Welcome","addon")); + pPage->setTitle(__tr2qs_ctx("Welcome", "addon")); QLabel * pLabel = new QLabel(pPage); pLabel->setWordWrap(true); - pLabel->setText(__tr2qs_ctx("This procedure allows you to export the selected addon to a single package.
It is useful when you want to distribute your addon to the public.","addon")); + pLabel->setText(__tr2qs_ctx("This procedure allows you to export the selected addon to a single package.
It is useful when you want to distribute your addon to the public.", "addon")); pLayout->addWidget(pLabel); pLabel = new QLabel(pPage); pLabel->setWordWrap(true); QString szText; - szText += __tr2qs_ctx("You will be asked to provide some information like the package name, the version, a description and so on.","addon"); + szText += __tr2qs_ctx("You will be asked to provide some information like the package name, the version, a description and so on.", "addon"); szText += "

"; - szText += __tr2qs_ctx("Hit the \"Next\" button to begin.","addon"); + szText += __tr2qs_ctx("Hit the \"Next\" button to begin.", "addon"); pLabel->setText(szText); pLayout->addWidget(pLabel); @@ -116,7 +116,6 @@ PackAddonDialog::PackAddonDialog(QWidget * pParent) // Summary info m_pPackAddonSummaryInfoWidget = new PackAddonSummaryInfoWidget(this); addPage(m_pPackAddonSummaryInfoWidget); - } PackAddonDialog::~PackAddonDialog() @@ -146,7 +145,7 @@ bool PackAddonDialog::packAddon() if(info.szSavePath.isEmpty()) { info.szSavePath = QDir::homePath(); - KviQString::ensureLastCharIs(info.szSavePath,QChar(KVI_PATH_SEPARATOR_CHAR)); + KviQString::ensureLastCharIs(info.szSavePath, QChar(KVI_PATH_SEPARATOR_CHAR)); info.szSavePath += m_szName; info.szSavePath += "-"; info.szSavePath += m_szVersion; @@ -156,12 +155,12 @@ bool PackAddonDialog::packAddon() if(QFile::exists(info.szSavePath)) { if(QMessageBox::question( - this, - __tr2qs_ctx("Exporting Addon Confirmation - KVIrc","addon"), - __tr2qs_ctx("File %1 already exists. Do you want to overwrite it?","addon").arg(info.szSavePath), - QMessageBox::Yes, - QMessageBox::No - ) == QMessageBox::No) + this, + __tr2qs_ctx("Exporting Addon Confirmation - KVIrc", "addon"), + __tr2qs_ctx("File %1 already exists. Do you want to overwrite it?", "addon").arg(info.szSavePath), + QMessageBox::Yes, + QMessageBox::No) + == QMessageBox::No) return false; } @@ -176,136 +175,131 @@ bool PackAddonDialog::packAddon() QString szError; - if(!AddonFunctions::pack(info,szError)) + if(!AddonFunctions::pack(info, szError)) { QMessageBox::critical(this, - __tr2qs_ctx("Addon Packaging - KVIrc","addon"), - szError,QMessageBox::Ok,QMessageBox::NoButton,QMessageBox::NoButton - ); + __tr2qs_ctx("Addon Packaging - KVIrc", "addon"), + szError, QMessageBox::Ok, QMessageBox::NoButton, QMessageBox::NoButton); return false; } - QMessageBox::information(this,__tr2qs_ctx("Exporting Addon Completed - KVIrc","addon"),__tr2qs_ctx("The Package was saved successfully in %1","addon").arg(m_szSavePath),QMessageBox::Ok,QMessageBox::NoButton,QMessageBox::NoButton); + QMessageBox::information(this, __tr2qs_ctx("Exporting Addon Completed - KVIrc", "addon"), __tr2qs_ctx("The Package was saved successfully in %1", "addon").arg(m_szSavePath), QMessageBox::Ok, QMessageBox::NoButton, QMessageBox::NoButton); return true; } - PackAddonInfoPackageWidget::PackAddonInfoPackageWidget(PackAddonDialog * pParent) -: QWizardPage(pParent) + : QWizardPage(pParent) { setObjectName("addon_package_info_page"); - setTitle(__tr2qs_ctx("Package Information","addon")); - setSubTitle(__tr2qs_ctx("Here you need to provide information about you (the packager) and a short description of the package you're creating.","addon")); + setTitle(__tr2qs_ctx("Package Information", "addon")); + setSubTitle(__tr2qs_ctx("Here you need to provide information about you (the packager) and a short description of the package you're creating.", "addon")); QGridLayout * pLayout = new QGridLayout(this); QLabel * pLabel = new QLabel(this); - pLabel->setText(__tr2qs_ctx("Package &author:","addon")); - pLayout->addWidget(pLabel,0,0); + pLabel->setText(__tr2qs_ctx("Package &author:", "addon")); + pLayout->addWidget(pLabel, 0, 0); m_pPackageAuthorEdit = new QLineEdit(this); pLabel->setBuddy(m_pPackageAuthorEdit); - pLayout->addWidget(m_pPackageAuthorEdit,0,1); + pLayout->addWidget(m_pPackageAuthorEdit, 0, 1); pLabel = new QLabel(this); - pLabel->setText(__tr2qs_ctx("Package &name:","addon")); - pLayout->addWidget(pLabel,1,0); + pLabel->setText(__tr2qs_ctx("Package &name:", "addon")); + pLayout->addWidget(pLabel, 1, 0); m_pPackageNameEdit = new QLineEdit(this); - m_pPackageNameEdit->setPlaceholderText(__tr2qs_ctx("No spaces allowed","addon")); + m_pPackageNameEdit->setPlaceholderText(__tr2qs_ctx("No spaces allowed", "addon")); pLabel->setBuddy(m_pPackageNameEdit); - pLayout->addWidget(m_pPackageNameEdit,1,1); + pLayout->addWidget(m_pPackageNameEdit, 1, 1); pLabel = new QLabel(this); - pLabel->setText(__tr2qs_ctx("Package &version:","addon")); - pLayout->addWidget(pLabel,2,0); + pLabel->setText(__tr2qs_ctx("Package &version:", "addon")); + pLayout->addWidget(pLabel, 2, 0); m_pPackageVersionEdit = new QLineEdit(this); m_pPackageVersionEdit->setPlaceholderText("1.0"); pLabel->setBuddy(m_pPackageVersionEdit); - pLayout->addWidget(m_pPackageVersionEdit,2,1); + pLayout->addWidget(m_pPackageVersionEdit, 2, 1); pLabel = new QLabel(this); - pLabel->setText(__tr2qs_ctx("Package &description:","addon")); - pLayout->addWidget(pLabel,3,0); + pLabel->setText(__tr2qs_ctx("Package &description:", "addon")); + pLayout->addWidget(pLabel, 3, 0); m_pPackageDescriptionEdit = new QLineEdit(this); m_pPackageDescriptionEdit->setText(QString()); pLabel->setBuddy(m_pPackageDescriptionEdit); - pLayout->addWidget(m_pPackageDescriptionEdit,3,1); + pLayout->addWidget(m_pPackageDescriptionEdit, 3, 1); pLabel = new QLabel(this); - pLabel->setText(__tr2qs_ctx("Minimum &KVIrc version:","addon")); - pLayout->addWidget(pLabel,4,0); + pLabel->setText(__tr2qs_ctx("Minimum &KVIrc version:", "addon")); + pLayout->addWidget(pLabel, 4, 0); m_pPackageMinVersionEdit = new QLineEdit(this); m_pPackageMinVersionEdit->setText(KVI_VERSION); pLabel->setBuddy(m_pPackageMinVersionEdit); - pLayout->addWidget(m_pPackageMinVersionEdit,4,1); + pLayout->addWidget(m_pPackageMinVersionEdit, 4, 1); // Store data in the fields - registerField("packageAuthor*",m_pPackageAuthorEdit); - registerField("packageName*",m_pPackageNameEdit); - registerField("packageVersion*",m_pPackageVersionEdit); - registerField("packageDescription*",m_pPackageDescriptionEdit); - registerField("packageMinVersion",m_pPackageMinVersionEdit); + registerField("packageAuthor*", m_pPackageAuthorEdit); + registerField("packageName*", m_pPackageNameEdit); + registerField("packageVersion*", m_pPackageVersionEdit); + registerField("packageDescription*", m_pPackageDescriptionEdit); + registerField("packageMinVersion", m_pPackageMinVersionEdit); } PackAddonInfoPackageWidget::~PackAddonInfoPackageWidget() { } - PackAddonFileSelectionWidget::PackAddonFileSelectionWidget(PackAddonDialog * pParent) -: QWizardPage(pParent) + : QWizardPage(pParent) { setObjectName("addon_package_file_page"); - setTitle(__tr2qs_ctx("Package Files","addon")); - setSubTitle(__tr2qs_ctx("Here you need to select the directory where the addon files to be packed are located.","addon")); + setTitle(__tr2qs_ctx("Package Files", "addon")); + setSubTitle(__tr2qs_ctx("Here you need to select the directory where the addon files to be packed are located.", "addon")); QVBoxLayout * pLayout = new QVBoxLayout(this); // Select source directory - m_pDirPathSelector = new KviDirectorySelector(this,__tr2qs_ctx("Select the source directory:","addon"),&m_szDirPath,true,KviFileSelector::VerticalLayout); + m_pDirPathSelector = new KviDirectorySelector(this, __tr2qs_ctx("Select the source directory:", "addon"), &m_szDirPath, true, KviFileSelector::VerticalLayout); pLayout->addWidget(m_pDirPathSelector); // Select addon icon - m_pPackageImageEdit = new KviFileSelector(this,__tr2qs_ctx("Select the image file:","addon"),&m_szPackageImage,true,KviFileSelector::VerticalLayout,KVI_FILTER_IMAGE); + m_pPackageImageEdit = new KviFileSelector(this, __tr2qs_ctx("Select the image file:", "addon"), &m_szPackageImage, true, KviFileSelector::VerticalLayout, KVI_FILTER_IMAGE); pLayout->addWidget(m_pPackageImageEdit); // Store data in the fields - registerField("packageDirPath*",m_pDirPathSelector); - registerField("packageImage*",m_pPackageImageEdit); + registerField("packageDirPath*", m_pDirPathSelector); + registerField("packageImage*", m_pPackageImageEdit); } PackAddonFileSelectionWidget::~PackAddonFileSelectionWidget() { } - PackAddonSaveSelectionWidget::PackAddonSaveSelectionWidget(PackAddonDialog * pParent) -: QWizardPage(pParent) + : QWizardPage(pParent) { setObjectName("addon_package_save_page"); - setTitle(__tr2qs_ctx("Save Package","addon")); - setSubTitle(__tr2qs_ctx("Here you need to provide the path where to save the created addon package","addon")); + setTitle(__tr2qs_ctx("Save Package", "addon")); + setSubTitle(__tr2qs_ctx("Here you need to provide the path where to save the created addon package", "addon")); QVBoxLayout * pLayout = new QVBoxLayout(this); // Select save path m_pSavePathSelector = new KviFileSelector( - this, - __tr2qs_ctx("Select save path:","addon"), - &m_szFilePath, - true, - KviFileSelector::ChooseSaveFileName | KviFileSelector::VerticalLayout, - KVI_FILTER_ADDON - ); + this, + __tr2qs_ctx("Select save path:", "addon"), + &m_szFilePath, + true, + KviFileSelector::ChooseSaveFileName | KviFileSelector::VerticalLayout, + KVI_FILTER_ADDON); pLayout->addWidget(m_pSavePathSelector); // Store data in the fields - registerField("packageSavePath*",m_pSavePathSelector); + registerField("packageSavePath*", m_pSavePathSelector); } PackAddonSaveSelectionWidget::~PackAddonSaveSelectionWidget() @@ -320,7 +314,7 @@ void PackAddonSaveSelectionWidget::initializePage() // Create addon name QString szSavePath = QDir::homePath(); - KviQString::ensureLastCharIs(szSavePath,QChar(KVI_PATH_SEPARATOR_CHAR)); + KviQString::ensureLastCharIs(szSavePath, QChar(KVI_PATH_SEPARATOR_CHAR)); szSavePath += szName; szSavePath += "-"; szSavePath += szVersion; @@ -328,13 +322,12 @@ void PackAddonSaveSelectionWidget::initializePage() m_pSavePathSelector->setTmpFile(szSavePath); } - PackAddonSummaryInfoWidget::PackAddonSummaryInfoWidget(PackAddonDialog * pParent) -: QWizardPage(pParent) + : QWizardPage(pParent) { setObjectName("addon_package_summary_info_page"); - setTitle(__tr2qs_ctx("Final Information","addon")); - setSubTitle(__tr2qs_ctx("Here are the details you provided. If this information is correct, hit the \"Finish\" button to complete the packaging operations.","addon")); + setTitle(__tr2qs_ctx("Final Information", "addon")); + setSubTitle(__tr2qs_ctx("Here are the details you provided. If this information is correct, hit the \"Finish\" button to complete the packaging operations.", "addon")); QVBoxLayout * pLayout = new QVBoxLayout(this); m_pLabelInfo = new QLabel(this); @@ -357,56 +350,55 @@ void PackAddonSummaryInfoWidget::initializePage() QString szDirPath = field("packageDirPath").toString(); QString szSavePath = field("packageSavePath").toString(); - QString szText = __tr2qs_ctx("This is what I will check for:","addon"); + QString szText = __tr2qs_ctx("This is what I will check for:", "addon"); szText += "

"; - szText += __tr2qs_ctx("Package author","addon"); + szText += __tr2qs_ctx("Package author", "addon"); szText += ": "; szText += szAuthor; szText += "
"; - szText += __tr2qs_ctx("Package name","addon"); + szText += __tr2qs_ctx("Package name", "addon"); szText += ": "; szText += szName; szText += "
"; - szText += __tr2qs_ctx("Package version","addon"); + szText += __tr2qs_ctx("Package version", "addon"); szText += ": "; szText += szVersion; szText += "
"; - szText += __tr2qs_ctx("Package description","addon"); + szText += __tr2qs_ctx("Package description", "addon"); szText += ": "; szText += szDescription; szText += "
"; - szText += __tr2qs_ctx("Minimum KVIrc version","addon"); + szText += __tr2qs_ctx("Minimum KVIrc version", "addon"); szText += ": "; szText += szMinVersion; szText += "
"; - szText += __tr2qs_ctx("Image file","addon"); + szText += __tr2qs_ctx("Image file", "addon"); szText += ": "; szText += szImage; szText += "
"; - szText += __tr2qs_ctx("Source directory","addon"); + szText += __tr2qs_ctx("Source directory", "addon"); szText += ": "; szText += szDirPath; szText += "
"; - szText += __tr2qs_ctx("Save path","addon"); + szText += __tr2qs_ctx("Save path", "addon"); szText += ": "; szText += szSavePath; m_pLabelInfo->setText(szText); } - PackAddonSummaryFilesWidget::PackAddonSummaryFilesWidget(PackAddonDialog * pParent) -: QDialog(pParent) + : QDialog(pParent) { setObjectName("addon_package_summary_file_dialog"); - setWindowTitle(__tr2qs_ctx("File Summary Review - KVIrc","addon")); + setWindowTitle(__tr2qs_ctx("File Summary Review - KVIrc", "addon")); setWindowModality(Qt::WindowModal); setModal(true); QVBoxLayout * pLayout = new QVBoxLayout(this); QLabel * pLabel = new QLabel(this); - pLabel->setText(__tr2qs_ctx("Here are the files found in the directories you provided.\nIf the files listed below are correct, hit the \"Finish\" button to complete the packaging operation.","addon")); + pLabel->setText(__tr2qs_ctx("Here are the files found in the directories you provided.\nIf the files listed below are correct, hit the \"Finish\" button to complete the packaging operation.", "addon")); pLayout->addWidget(pLabel); m_pFiles = new QTextEdit(this); @@ -415,12 +407,12 @@ PackAddonSummaryFilesWidget::PackAddonSummaryFilesWidget(PackAddonDialog * pPare KviTalHBox * pBox = new KviTalHBox(this); QPushButton * pCancel = new QPushButton(pBox); - pCancel->setText(__tr2qs_ctx("Cancel","addon")); - connect(pCancel,SIGNAL(clicked()),this,SLOT(reject())); + pCancel->setText(__tr2qs_ctx("Cancel", "addon")); + connect(pCancel, SIGNAL(clicked()), this, SLOT(reject())); QPushButton * pAccept = new QPushButton(pBox); - pAccept->setText(__tr2qs_ctx("Finish","addon")); - connect(pAccept,SIGNAL(clicked()),this,SLOT(accept())); + pAccept->setText(__tr2qs_ctx("Finish", "addon")); + connect(pAccept, SIGNAL(clicked()), this, SLOT(accept())); pLayout->addWidget(pBox); } @@ -442,7 +434,7 @@ void PackAddonSummaryFilesWidget::showEvent(QShowEvent *) { QStringList list; - QDirIterator it(m_szPath,QDir::AllEntries | QDir::NoDotAndDotDot,QDirIterator::Subdirectories); + QDirIterator it(m_szPath, QDir::AllEntries | QDir::NoDotAndDotDot, QDirIterator::Subdirectories); // Iterate through the addon dir and its subdirs while(it.hasNext()) diff --git a/src/modules/addon/PackAddonDialog.h b/src/modules/addon/PackAddonDialog.h index e3d254aee..e9b88bc33 100644 --- a/src/modules/addon/PackAddonDialog.h +++ b/src/modules/addon/PackAddonDialog.h @@ -71,20 +71,22 @@ public: * \brief Destroys the wizard object */ ~PackAddonDialog(); + protected: - PackAddonInfoPackageWidget * m_pPackAddonInfoPackageWidget; + PackAddonInfoPackageWidget * m_pPackAddonInfoPackageWidget; PackAddonFileSelectionWidget * m_pPackAddonFileSelectionWidget; PackAddonSaveSelectionWidget * m_pPackAddonSaveSelectionWidget; - PackAddonSummaryInfoWidget * m_pPackAddonSummaryInfoWidget; - PackAddonSummaryFilesWidget * m_pPackAddonSummaryFilesWidget; - QString m_szAuthor; - QString m_szName; - QString m_szVersion; - QString m_szDescription; - QString m_szMinVersion; - QString m_szIcon; - QString m_szDirPath; - QString m_szSavePath; + PackAddonSummaryInfoWidget * m_pPackAddonSummaryInfoWidget; + PackAddonSummaryFilesWidget * m_pPackAddonSummaryFilesWidget; + QString m_szAuthor; + QString m_szName; + QString m_szVersion; + QString m_szDescription; + QString m_szMinVersion; + QString m_szIcon; + QString m_szDirPath; + QString m_szSavePath; + protected: /** * \brief Runs the packAddon() function and closes the wizard @@ -134,6 +136,7 @@ public: * \brief Destroys the wizard package info page object */ ~PackAddonInfoPackageWidget(); + protected: QLineEdit * m_pPackageAuthorEdit; QLineEdit * m_pPackageNameEdit; @@ -161,11 +164,12 @@ public: * \brief Destroys the wizard package source dir object */ ~PackAddonFileSelectionWidget(); + protected: KviDirectorySelector * m_pDirPathSelector; - KviFileSelector * m_pPackageImageEdit; - QString m_szDirPath; - QString m_szPackageImage; + KviFileSelector * m_pPackageImageEdit; + QString m_szDirPath; + QString m_szPackageImage; }; /** @@ -187,9 +191,11 @@ public: * \brief Destroys the wizard save page object */ ~PackAddonSaveSelectionWidget(); + protected: KviFileSelector * m_pSavePathSelector; QString m_szFilePath; + protected: /** * \brief Perform initial tasks before showing the widget @@ -217,12 +223,14 @@ public: * \brief Destroys the wizard summary info page object */ ~PackAddonSummaryInfoWidget(); + protected: QLabel * m_pLabelInfo; QLabel * m_pLabelAuthor; QLabel * m_pPackageName; QLabel * m_pPackageVersion; QLabel * m_pPackageDescription; + protected: /** * \brief Perform initial tasks before showing the widget @@ -231,18 +239,19 @@ protected: virtual void initializePage(); }; - class PackAddonSummaryFilesWidget : public QDialog { Q_OBJECT public: PackAddonSummaryFilesWidget(PackAddonDialog * pParent); ~PackAddonSummaryFilesWidget(); + protected: QTextEdit * m_pFiles; - QString m_szPath; + QString m_szPath; + public: - void setPath(QString & szPath){ m_szPath = szPath; }; + void setPath(QString & szPath) { m_szPath = szPath; }; protected: virtual void showEvent(QShowEvent *); protected slots: diff --git a/src/modules/addon/WebAddonInterfaceDialog.cpp b/src/modules/addon/WebAddonInterfaceDialog.cpp index ba8b8e33c..b0f990571 100644 --- a/src/modules/addon/WebAddonInterfaceDialog.cpp +++ b/src/modules/addon/WebAddonInterfaceDialog.cpp @@ -24,7 +24,6 @@ #include "kvi_settings.h" - #ifdef COMPILE_WEBKIT_SUPPORT #include "WebAddonInterfaceDialog.h" @@ -38,25 +37,24 @@ #include "KviMiscUtils.h" WebAddonInterfaceDialog::WebAddonInterfaceDialog(QWidget * par) -: KviWebPackageManagementDialog(par) + : KviWebPackageManagementDialog(par) { - setWindowTitle(__tr2qs_ctx("Download Addons - KVIrc","theme")); + setWindowTitle(__tr2qs_ctx("Download Addons - KVIrc", "theme")); setPackagePageUrl( - QString::fromLatin1("http://www.kvirc.de/app/addons.php?version=" KVI_VERSION "&lang=%1") - .arg(QString::fromUtf8(KviLocale::instance()->localeName().ptr())) - ); + QString::fromLatin1("http://www.kvirc.de/app/addons.php?version=" KVI_VERSION "&lang=%1") + .arg(QString::fromUtf8(KviLocale::instance()->localeName().ptr()))); } WebAddonInterfaceDialog::~WebAddonInterfaceDialog() { } -bool WebAddonInterfaceDialog::installPackage(const QString &szPath,QString &szError) +bool WebAddonInterfaceDialog::installPackage(const QString & szPath, QString & szError) { - return AddonFunctions::installAddonPackage(szPath,szError,this); + return AddonFunctions::installAddonPackage(szPath, szError, this); } -bool WebAddonInterfaceDialog::packageIsInstalled(const QString &szId,const QString &szVersion) +bool WebAddonInterfaceDialog::packageIsInstalled(const QString & szId, const QString & szVersion) { KviKvsScriptAddon * pAddon = KviKvsScriptAddonManager::instance()->findAddon(szId); if(!pAddon) @@ -66,9 +64,7 @@ bool WebAddonInterfaceDialog::packageIsInstalled(const QString &szId,const QStri return true; // hum.... shouldn't happen ? // FIXME: If the version of the installed addon is lower then allow upgrading! - return KviMiscUtils::compareVersions(pAddon->version(),szVersion) < 0; + return KviMiscUtils::compareVersions(pAddon->version(), szVersion) < 0; } - - #endif //COMPILE_WEBKIT_SUPPORT diff --git a/src/modules/addon/WebAddonInterfaceDialog.h b/src/modules/addon/WebAddonInterfaceDialog.h index 0a5a5cf40..14872d1af 100644 --- a/src/modules/addon/WebAddonInterfaceDialog.h +++ b/src/modules/addon/WebAddonInterfaceDialog.h @@ -28,7 +28,6 @@ #ifdef COMPILE_WEBKIT_SUPPORT - #include "KviWebPackageManagementDialog.h" /// @@ -42,7 +41,6 @@ class WebAddonInterfaceDialog : public KviWebPackageManagementDialog Q_OBJECT public: - /// /// Creates an instance of WebAddonInterfaceDialog /// @@ -55,12 +53,11 @@ public: virtual ~WebAddonInterfaceDialog(); protected: - virtual bool packageIsInstalled(const QString &szId,const QString &szVersion); - virtual bool installPackage(const QString &szPath,QString &szError); + virtual bool packageIsInstalled(const QString & szId, const QString & szVersion); + virtual bool installPackage(const QString & szPath, QString & szError); }; // class WebAddonInterfaceDialog - #endif //COMPILE_WEBKIT_SUPPORT #endif //!_WebAddonInterfaceDialog_h_ diff --git a/src/modules/addon/libkviaddon.cpp b/src/modules/addon/libkviaddon.cpp index 33e0c6935..6b96a0cf0 100644 --- a/src/modules/addon/libkviaddon.cpp +++ b/src/modules/addon/libkviaddon.cpp @@ -43,7 +43,7 @@ #include #include -QRect g_rectManagementDialogGeometry(0,0,0,0); +QRect g_rectManagementDialogGeometry(0, 0, 0, 0); /* @doc: addon.exists @@ -67,8 +67,8 @@ static bool addon_kvs_fnc_exists(KviKvsModuleFunctionCall * c) QString szId; QString szVersion; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("id",KVS_PT_NONEMPTYSTRING,0,szId) - KVSM_PARAMETER("version",KVS_PT_STRING,KVS_PF_OPTIONAL,szVersion) + KVSM_PARAMETER("id", KVS_PT_NONEMPTYSTRING, 0, szId) + KVSM_PARAMETER("version", KVS_PT_STRING, KVS_PF_OPTIONAL, szVersion) KVSM_PARAMETERS_END(c) KviKvsScriptAddon * a = KviKvsScriptAddonManager::instance()->findAddon(szId); @@ -77,10 +77,14 @@ static bool addon_kvs_fnc_exists(KviKvsModuleFunctionCall * c) if(szVersion.isEmpty()) { c->returnValue()->setBoolean(true); - } else { - c->returnValue()->setBoolean(KviMiscUtils::compareVersions(a->version(),szVersion) < 0); } - } else { + else + { + c->returnValue()->setBoolean(KviMiscUtils::compareVersions(a->version(), szVersion) < 0); + } + } + else + { c->returnValue()->setBoolean(false); } return true; @@ -106,14 +110,16 @@ static bool addon_kvs_fnc_version(KviKvsModuleFunctionCall * c) { QString szId; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("id",KVS_PT_NONEMPTYSTRING,0,szId) + KVSM_PARAMETER("id", KVS_PT_NONEMPTYSTRING, 0, szId) KVSM_PARAMETERS_END(c) KviKvsScriptAddon * a = KviKvsScriptAddonManager::instance()->findAddon(szId); if(a) { c->returnValue()->setString(a->version()); - } else { + } + else + { c->returnValue()->setNothing(); } return true; @@ -137,21 +143,21 @@ static bool addon_kvs_fnc_version(KviKvsModuleFunctionCall * c) static bool addon_kvs_cmd_list(KviKvsModuleCommandCall * c) { - KviPointerHashTable * da = KviKvsScriptAddonManager::instance()->addonDict(); + KviPointerHashTable * da = KviKvsScriptAddonManager::instance()->addonDict(); int cnt = 0; - KviPointerHashTableIterator it(*da); + KviPointerHashTableIterator it(*da); while(KviKvsScriptAddon * a = it.current()) { - c->window()->output(KVI_OUT_SYSTEMMESSAGE,__tr2qs_ctx("%cAddon ID %Q, version %Q%c","addon"),KviControlCodes::Bold,&(a->name()),&(a->version()),KviControlCodes::Bold); - c->window()->output(KVI_OUT_SYSTEMMESSAGE,__tr2qs_ctx("Name: %Q","addon"),&(a->visibleName())); - c->window()->output(KVI_OUT_SYSTEMMESSAGE,__tr2qs_ctx("Description: %Q","addon"),&(a->description())); + c->window()->output(KVI_OUT_SYSTEMMESSAGE, __tr2qs_ctx("%cAddon ID %Q, version %Q%c", "addon"), KviControlCodes::Bold, &(a->name()), &(a->version()), KviControlCodes::Bold); + c->window()->output(KVI_OUT_SYSTEMMESSAGE, __tr2qs_ctx("Name: %Q", "addon"), &(a->visibleName())); + c->window()->output(KVI_OUT_SYSTEMMESSAGE, __tr2qs_ctx("Description: %Q", "addon"), &(a->description())); ++it; cnt++; } - c->window()->output(KVI_OUT_SYSTEMMESSAGE,__tr2qs_ctx("Total: %d addons installed","addon"),cnt); + c->window()->output(KVI_OUT_SYSTEMMESSAGE, __tr2qs_ctx("Total: %d addons installed", "addon"), cnt); return true; } @@ -184,20 +190,22 @@ static bool addon_kvs_cmd_uninstall(KviKvsModuleCommandCall * c) { QString szName; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("name",KVS_PT_NONEMPTYSTRING,0,szName) + KVSM_PARAMETER("name", KVS_PT_NONEMPTYSTRING, 0, szName) KVSM_PARAMETERS_END(c) KviKvsScriptAddon * a = KviKvsScriptAddonManager::instance()->findAddon(szName); if(a) { - if(!c->switches()->find('q',"quiet")) - c->window()->output(KVI_OUT_SYSTEMMESSAGE,__tr2qs_ctx("Uninstalling existing addon version %Q","addon"),&(a->version())); + if(!c->switches()->find('q', "quiet")) + c->window()->output(KVI_OUT_SYSTEMMESSAGE, __tr2qs_ctx("Uninstalling existing addon version %Q", "addon"), &(a->version())); // uninstall the existing version - KviKvsScriptAddonManager::instance()->unregisterAddon(szName,c->window(),!c->switches()->find('n',"no-callback")); - } else { - if(!c->switches()->find('q',"quiet")) - c->warning(__tr2qs_ctx("The addon \"%1\" doesn't exist","addon").arg(szName)); + KviKvsScriptAddonManager::instance()->unregisterAddon(szName, c->window(), !c->switches()->find('n', "no-callback")); + } + else + { + if(!c->switches()->find('q', "quiet")) + c->warning(__tr2qs_ctx("The addon \"%1\" doesn't exist", "addon").arg(szName)); } return true; @@ -227,7 +235,7 @@ static bool addon_kvs_cmd_configure(KviKvsModuleCommandCall * c) { QString szName; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("name",KVS_PT_NONEMPTYSTRING,0,szName) + KVSM_PARAMETER("name", KVS_PT_NONEMPTYSTRING, 0, szName) KVSM_PARAMETERS_END(c) KviKvsScriptAddon * a = KviKvsScriptAddonManager::instance()->findAddon(szName); @@ -236,14 +244,18 @@ static bool addon_kvs_cmd_configure(KviKvsModuleCommandCall * c) QString ss = a->configureCallbackCode(); if(ss.isEmpty()) { - if(!c->switches()->find('q',"quiet")) - c->warning(__tr2qs_ctx("The addon \"%1\" has no configure callback set","addon").arg(szName)); - } else { + if(!c->switches()->find('q', "quiet")) + c->warning(__tr2qs_ctx("The addon \"%1\" has no configure callback set", "addon").arg(szName)); + } + else + { a->executeConfigureCallback(c->window()); } - } else { - if(!c->switches()->find('q',"quiet")) - c->warning(__tr2qs_ctx("The addon \"%1\" doesn't exist","addon").arg(szName)); + } + else + { + if(!c->switches()->find('q', "quiet")) + c->warning(__tr2qs_ctx("The addon \"%1\" doesn't exist", "addon").arg(szName)); } return true; @@ -274,7 +286,7 @@ static bool addon_kvs_cmd_help(KviKvsModuleCommandCall * c) { QString szName; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("name",KVS_PT_NONEMPTYSTRING,0,szName) + KVSM_PARAMETER("name", KVS_PT_NONEMPTYSTRING, 0, szName) KVSM_PARAMETERS_END(c) KviKvsScriptAddon * a = KviKvsScriptAddonManager::instance()->findAddon(szName); @@ -283,14 +295,18 @@ static bool addon_kvs_cmd_help(KviKvsModuleCommandCall * c) QString ss = a->helpCallbackCode(); if(ss.isEmpty()) { - if(!c->switches()->find('q',"quiet")) - c->warning(__tr2qs_ctx("The addon \"%1\" has no help callback set","addon").arg(szName)); - } else { + if(!c->switches()->find('q', "quiet")) + c->warning(__tr2qs_ctx("The addon \"%1\" has no help callback set", "addon").arg(szName)); + } + else + { a->executeHelpCallback(c->window()); } - } else { - if(!c->switches()->find('q',"quiet")) - c->warning(__tr2qs_ctx("The addon \"%1\" doesn't exist","addon").arg(szName)); + } + else + { + if(!c->switches()->find('q', "quiet")) + c->warning(__tr2qs_ctx("The addon \"%1\" doesn't exist", "addon").arg(szName)); } return true; @@ -327,16 +343,18 @@ static bool addon_kvs_cmd_setconfigurecallback(KviKvsModuleCallbackCommandCall * QString szName; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("name",KVS_PT_NONEMPTYSTRING,0,szName) + KVSM_PARAMETER("name", KVS_PT_NONEMPTYSTRING, 0, szName) KVSM_PARAMETERS_END(c) KviKvsScriptAddon * a = KviKvsScriptAddonManager::instance()->findAddon(szName); if(a) { a->setConfigureCallback(c->callback()->code()); - } else { - if(!c->switches()->find('q',"quiet")) - c->warning(__tr2qs_ctx("The addon \"%1\" doesn't exist","addon").arg(szName)); + } + else + { + if(!c->switches()->find('q', "quiet")) + c->warning(__tr2qs_ctx("The addon \"%1\" doesn't exist", "addon").arg(szName)); } return true; @@ -374,16 +392,18 @@ static bool addon_kvs_cmd_sethelpcallback(KviKvsModuleCallbackCommandCall * c) QString szName; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("name",KVS_PT_NONEMPTYSTRING,0,szName) + KVSM_PARAMETER("name", KVS_PT_NONEMPTYSTRING, 0, szName) KVSM_PARAMETERS_END(c) KviKvsScriptAddon * a = KviKvsScriptAddonManager::instance()->findAddon(szName); if(a) { a->setHelpCallback(c->callback()->code()); - } else { - if(!c->switches()->find('q',"quiet")) - c->warning(__tr2qs_ctx("The addon \"%1\" doesn't exist","addon").arg(szName)); + } + else + { + if(!c->switches()->find('q', "quiet")) + c->warning(__tr2qs_ctx("The addon \"%1\" doesn't exist", "addon").arg(szName)); } return true; @@ -490,18 +510,17 @@ static bool addon_kvs_cmd_register(KviKvsModuleCallbackCommandCall * c) QString szMinKVIrcVersion; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("name",KVS_PT_NONEMPTYSTRING,0,(rd.szName)) - KVSM_PARAMETER("version",KVS_PT_NONEMPTYSTRING,0,(rd.szVersion)) - KVSM_PARAMETER_IGNORED("visible_text") - KVSM_PARAMETER_IGNORED("description") - KVSM_PARAMETER("min_kvirc_version",KVS_PT_NONEMPTYSTRING,0,szMinKVIrcVersion) - KVSM_PARAMETER("icon_id",KVS_PT_STRING,KVS_PF_OPTIONAL,(rd.szIconId)) + KVSM_PARAMETER("name", KVS_PT_NONEMPTYSTRING, 0, (rd.szName)) + KVSM_PARAMETER("version", KVS_PT_NONEMPTYSTRING, 0, (rd.szVersion)) + KVSM_PARAMETER_IGNORED("visible_text") + KVSM_PARAMETER_IGNORED("description") + KVSM_PARAMETER("min_kvirc_version", KVS_PT_NONEMPTYSTRING, 0, szMinKVIrcVersion) + KVSM_PARAMETER("icon_id", KVS_PT_STRING, KVS_PF_OPTIONAL, (rd.szIconId)) KVSM_PARAMETERS_END(c) - - if(!(c->getParameterCode(2,rd.szVisibleNameScript) && c->getParameterCode(3,rd.szDescriptionScript))) + if(!(c->getParameterCode(2, rd.szVisibleNameScript) && c->getParameterCode(3, rd.szDescriptionScript))) { - c->error(__tr2qs_ctx("Internal error: call a head-shrinker","addon")); + c->error(__tr2qs_ctx("Internal error: call a head-shrinker", "addon")); return false; } @@ -510,57 +529,57 @@ static bool addon_kvs_cmd_register(KviKvsModuleCallbackCommandCall * c) if(!KviMiscUtils::isValidVersionString(rd.szVersion)) { - c->error(__tr2qs_ctx("The specified version \"%Q\" is not a valid version string","addon"),&(rd.szVersion)); + c->error(__tr2qs_ctx("The specified version \"%Q\" is not a valid version string", "addon"), &(rd.szVersion)); return false; } if(!KviMiscUtils::isValidVersionString(szMinKVIrcVersion)) { - c->error(__tr2qs_ctx("The specified KVIrc version \"%Q\" is not a valid version string","addon"),&szMinKVIrcVersion); + c->error(__tr2qs_ctx("The specified KVIrc version \"%Q\" is not a valid version string", "addon"), &szMinKVIrcVersion); return false; } - if(KviMiscUtils::compareVersions(szMinKVIrcVersion,KVI_VERSION "." KVI_SOURCES_DATE) < 0) + if(KviMiscUtils::compareVersions(szMinKVIrcVersion, KVI_VERSION "." KVI_SOURCES_DATE) < 0) { - c->error(__tr2qs_ctx("This KVIrc executable is too old to run this addon (minimum version required is %Q)","addon"),&szMinKVIrcVersion); + c->error(__tr2qs_ctx("This KVIrc executable is too old to run this addon (minimum version required is %Q)", "addon"), &szMinKVIrcVersion); return false; } - if(!c->switches()->find('q',"quiet")) - c->window()->output(KVI_OUT_SYSTEMMESSAGE,__tr2qs_ctx("Attempting to register addon \"%Q\" with version %Q","addon"),&(rd.szName),&(rd.szVersion)); + if(!c->switches()->find('q', "quiet")) + c->window()->output(KVI_OUT_SYSTEMMESSAGE, __tr2qs_ctx("Attempting to register addon \"%Q\" with version %Q", "addon"), &(rd.szName), &(rd.szVersion)); KviKvsScriptAddon * a = KviKvsScriptAddonManager::instance()->findAddon(rd.szName); if(a) { // the same addon already exists - if(KviMiscUtils::compareVersions(a->version(),rd.szVersion) < 0) + if(KviMiscUtils::compareVersions(a->version(), rd.szVersion) < 0) { // and it has a higher version... // complain unless -f is used - if(!c->switches()->find('f',"force")) + if(!c->switches()->find('f', "force")) { - c->error(__tr2qs_ctx("The addon \"%Q\" already exists with version %Q which is higher than %Q","addon"),&(rd.szName),&(a->version()),&(rd.szVersion)); + c->error(__tr2qs_ctx("The addon \"%Q\" already exists with version %Q which is higher than %Q", "addon"), &(rd.szName), &(a->version()), &(rd.szVersion)); return false; } } - if(!c->switches()->find('q',"quiet")) - c->window()->output(KVI_OUT_SYSTEMMESSAGE,__tr2qs_ctx("Uninstalling existing addon version %Q","addon"),&(a->version())); + if(!c->switches()->find('q', "quiet")) + c->window()->output(KVI_OUT_SYSTEMMESSAGE, __tr2qs_ctx("Uninstalling existing addon version %Q", "addon"), &(a->version())); - bool bUninstall = !c->switches()->find('n',"no-uninstall"); + bool bUninstall = !c->switches()->find('n', "no-uninstall"); // uninstall the existing version - KviKvsScriptAddonManager::instance()->unregisterAddon(rd.szName,c->window(),bUninstall,bUninstall); + KviKvsScriptAddonManager::instance()->unregisterAddon(rd.szName, c->window(), bUninstall, bUninstall); } if(!KviKvsScriptAddonManager::instance()->registerAddon(&rd)) { - c->error(__tr2qs_ctx("Addon registration failed","addon")); + c->error(__tr2qs_ctx("Addon registration failed", "addon")); return false; } - if(!c->switches()->find('q',"quiet")) - c->window()->output(KVI_OUT_SYSTEMMESSAGE,__tr2qs_ctx("Addon successfully registered","addon")); + if(!c->switches()->find('q', "quiet")) + c->window()->output(KVI_OUT_SYSTEMMESSAGE, __tr2qs_ctx("Addon successfully registered", "addon")); return true; } @@ -608,39 +627,39 @@ static bool addon_kvs_cmd_installfiles(KviKvsModuleCommandCall * c) QStringList lEntries; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("name",KVS_PT_NONEMPTYSTRING,0,szName) - KVSM_PARAMETER("target",KVS_PT_NONEMPTYSTRING,0,szTarget) - KVSM_PARAMETER("files",KVS_PT_STRINGLIST,0,lEntries) + KVSM_PARAMETER("name", KVS_PT_NONEMPTYSTRING, 0, szName) + KVSM_PARAMETER("target", KVS_PT_NONEMPTYSTRING, 0, szTarget) + KVSM_PARAMETER("files", KVS_PT_STRINGLIST, 0, lEntries) KVSM_PARAMETERS_END(c) - bool bQuiet = c->switches()->find('q',"quiet"); + bool bQuiet = c->switches()->find('q', "quiet"); // we had a typo here, support the old switch name for backward scripts compatibility - bool bSkipNonExistent = c->switches()->find('i',"skip-nonexistent") || c->switches()->find('i',"skip-nonexisting"); + bool bSkipNonExistent = c->switches()->find('i', "skip-nonexistent") || c->switches()->find('i', "skip-nonexisting"); KviKvsScriptAddon * a = KviKvsScriptAddonManager::instance()->findAddon(szName); if(!a) { if(!bQuiet) - c->warning(__tr2qs_ctx("The addon \"%1\" doesn't exist","addon").arg(szName)); + c->warning(__tr2qs_ctx("The addon \"%1\" doesn't exist", "addon").arg(szName)); return true; } if(szTarget.isEmpty()) - return c->error(__tr2qs_ctx("The target path can't be empty","addon")); + return c->error(__tr2qs_ctx("The target path can't be empty", "addon")); if(szTarget.indexOf("..") != -1) - return c->error(__tr2qs_ctx("The target path can't contain ..","addon")); + return c->error(__tr2qs_ctx("The target path can't contain ..", "addon")); if(lEntries.isEmpty()) { if(!bQuiet) - c->warning(__tr2qs_ctx("Empty file list","addon")); + c->warning(__tr2qs_ctx("Empty file list", "addon")); return true; // nothing to do } QStringList lExpandedEntries; - foreach(QString szEntry,lEntries) + foreach(QString szEntry, lEntries) { KviFileUtils::adjustFilePath(szEntry); @@ -654,28 +673,29 @@ static bool addon_kvs_cmd_installfiles(KviKvsModuleCommandCall * c) { szPath = "."; szFilter = szEntry; - } else { + } + else + { szPath = szEntry.left(idx); - szFilter = szEntry.mid(idx+1); + szFilter = szEntry.mid(idx + 1); } QDir dir(szPath); if(!dir.exists()) { if(!bSkipNonExistent) - return c->error(__tr2qs_ctx("The directory '%1' doesn't exist","addon").arg(szPath)); + return c->error(__tr2qs_ctx("The directory '%1' doesn't exist", "addon").arg(szPath)); if(!bQuiet) - c->warning(__tr2qs_ctx("Skipping non-existent entry '%1'","addon").arg(szEntry)); + c->warning(__tr2qs_ctx("Skipping non-existent entry '%1'", "addon").arg(szEntry)); continue; } QStringList sl = dir.entryList( - QStringList(szFilter), - QDir::Files | QDir::NoSymLinks | QDir::Readable | QDir::Hidden | QDir::System, - QDir::Unsorted - ); + QStringList(szFilter), + QDir::Files | QDir::NoSymLinks | QDir::Readable | QDir::Hidden | QDir::System, + QDir::Unsorted); - foreach(QString sz,sl) + foreach(QString sz, sl) { lExpandedEntries.append(QString("%1%2%3").arg(szPath).arg(QString(KVI_PATH_SEPARATOR_CHAR)).arg(sz)); } @@ -686,18 +706,18 @@ static bool addon_kvs_cmd_installfiles(KviKvsModuleCommandCall * c) if(!inf.exists()) { if(!bSkipNonExistent) - return c->error(__tr2qs_ctx("The file '%1' doesn't exist","addon").arg(szEntry)); + return c->error(__tr2qs_ctx("The file '%1' doesn't exist", "addon").arg(szEntry)); if(!bQuiet) - c->warning(__tr2qs_ctx("Skipping non-existent entry '%1'","addon").arg(szEntry)); + c->warning(__tr2qs_ctx("Skipping non-existent entry '%1'", "addon").arg(szEntry)); continue; } if(!inf.isFile()) { if(!bSkipNonExistent) - return c->error(__tr2qs_ctx("The entry '%1' is not a file","addon").arg(szEntry)); + return c->error(__tr2qs_ctx("The entry '%1' is not a file", "addon").arg(szEntry)); if(!bQuiet) - c->warning(__tr2qs_ctx("Skipping invalid entry '%1'","addon").arg(szEntry)); + c->warning(__tr2qs_ctx("Skipping invalid entry '%1'", "addon").arg(szEntry)); continue; } @@ -706,26 +726,26 @@ static bool addon_kvs_cmd_installfiles(KviKvsModuleCommandCall * c) // create target path QString szTargetPath; - g_pApp->getLocalKvircDirectory(szTargetPath,KviApplication::None,szTarget); + g_pApp->getLocalKvircDirectory(szTargetPath, KviApplication::None, szTarget); KviFileUtils::makeDir(szTargetPath); - for(QStringList::Iterator it = lExpandedEntries.begin();it != lExpandedEntries.end();++it) + for(QStringList::Iterator it = lExpandedEntries.begin(); it != lExpandedEntries.end(); ++it) { QFileInfo inf(*it); if(!inf.exists()) { - qDebug("ERROR: file %s doesn't exist, but it should...",inf.fileName().toUtf8().data()); + qDebug("ERROR: file %s doesn't exist, but it should...", inf.fileName().toUtf8().data()); continue; // bleah.. should never happen } QString szEntry = QString("%1%2%3").arg(szTarget).arg(QString(KVI_PATH_SEPARATOR_CHAR)).arg(inf.fileName()); - g_pApp->getLocalKvircDirectory(szTargetPath,KviApplication::None,szEntry); + g_pApp->getLocalKvircDirectory(szTargetPath, KviApplication::None, szEntry); if(!bQuiet) - c->window()->output(KVI_OUT_SYSTEMMESSAGE,__tr2qs_ctx("Installing file '%1' into '%2'","addon").arg(*it).arg(szTargetPath)); + c->window()->output(KVI_OUT_SYSTEMMESSAGE, __tr2qs_ctx("Installing file '%1' into '%2'", "addon").arg(*it).arg(szTargetPath)); - KviFileUtils::copyFile(*it,szTargetPath); + KviFileUtils::copyFile(*it, szTargetPath); a->addInstalledFile(szEntry); } @@ -749,10 +769,10 @@ static bool addon_kvs_cmd_installfiles(KviKvsModuleCommandCall * c) otherwise it is opened as part of the current frame window.[br] */ -static bool addon_kvs_cmd_dialog(KviKvsModuleCommandCall *c) +static bool addon_kvs_cmd_dialog(KviKvsModuleCommandCall * c) { - AddonManagementDialog::display(c->hasSwitch('t',"toplevel")); + AddonManagementDialog::display(c->hasSwitch('t', "toplevel")); return true; } @@ -775,13 +795,13 @@ static bool addon_kvs_cmd_install(KviKvsModuleCommandCall * c) QString szAddonPackFile; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("package_path",KVS_PT_STRING,0,szAddonPackFile) + KVSM_PARAMETER("package_path", KVS_PT_STRING, 0, szAddonPackFile) KVSM_PARAMETERS_END(c) QString szError; - if(!AddonFunctions::installAddonPackage(szAddonPackFile,szError)) + if(!AddonFunctions::installAddonPackage(szAddonPackFile, szError)) { - c->error(__tr2qs_ctx("Error installing addon package: %Q","addon"),&szError); + c->error(__tr2qs_ctx("Error installing addon package: %Q", "addon"), &szError); return false; } @@ -817,61 +837,59 @@ static bool addon_kvs_cmd_pack(KviKvsModuleCommandCall * c) AddonInfo info; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("package_path",KVS_PT_NONEMPTYSTRING,0,info.szSavePath) - KVSM_PARAMETER("addon_name",KVS_PT_NONEMPTYSTRING,0,info.szName) - KVSM_PARAMETER("addon_version",KVS_PT_NONEMPTYSTRING,0,info.szVersion) - KVSM_PARAMETER("description",KVS_PT_STRING,0,info.szDescription) - KVSM_PARAMETER("author",KVS_PT_NONEMPTYSTRING,0,info.szAuthor) - KVSM_PARAMETER("min_kvirc_version",KVS_PT_STRING,0,info.szMinVersion) - KVSM_PARAMETER("image",KVS_PT_STRING,0,info.szImage) - KVSM_PARAMETER("addon_path",KVS_PT_NONEMPTYSTRING,0,info.szDirPath) + KVSM_PARAMETER("package_path", KVS_PT_NONEMPTYSTRING, 0, info.szSavePath) + KVSM_PARAMETER("addon_name", KVS_PT_NONEMPTYSTRING, 0, info.szName) + KVSM_PARAMETER("addon_version", KVS_PT_NONEMPTYSTRING, 0, info.szVersion) + KVSM_PARAMETER("description", KVS_PT_STRING, 0, info.szDescription) + KVSM_PARAMETER("author", KVS_PT_NONEMPTYSTRING, 0, info.szAuthor) + KVSM_PARAMETER("min_kvirc_version", KVS_PT_STRING, 0, info.szMinVersion) + KVSM_PARAMETER("image", KVS_PT_STRING, 0, info.szImage) + KVSM_PARAMETER("addon_path", KVS_PT_NONEMPTYSTRING, 0, info.szDirPath) KVSM_PARAMETERS_END(c) QString szError; - if(AddonFunctions::pack(info,szError)) + if(AddonFunctions::pack(info, szError)) return true; c->error(szError); return false; } - - -static bool addon_module_init(KviModule *m) +static bool addon_module_init(KviModule * m) { - KVSM_REGISTER_FUNCTION(m,"exists",addon_kvs_fnc_exists); - KVSM_REGISTER_FUNCTION(m,"version",addon_kvs_fnc_version); - - KVSM_REGISTER_SIMPLE_COMMAND(m,"dialog",addon_kvs_cmd_dialog); - KVSM_REGISTER_SIMPLE_COMMAND(m,"list",addon_kvs_cmd_list); - KVSM_REGISTER_SIMPLE_COMMAND(m,"install",addon_kvs_cmd_install); - KVSM_REGISTER_SIMPLE_COMMAND(m,"uninstall",addon_kvs_cmd_uninstall); - KVSM_REGISTER_SIMPLE_COMMAND(m,"configure",addon_kvs_cmd_configure); - KVSM_REGISTER_SIMPLE_COMMAND(m,"help",addon_kvs_cmd_help); - KVSM_REGISTER_SIMPLE_COMMAND(m,"installfiles",addon_kvs_cmd_installfiles); - KVSM_REGISTER_SIMPLE_COMMAND(m,"pack",addon_kvs_cmd_pack); - - KVSM_REGISTER_CALLBACK_COMMAND(m,"setconfigurecallback",addon_kvs_cmd_setconfigurecallback); - KVSM_REGISTER_CALLBACK_COMMAND(m,"sethelpcallback",addon_kvs_cmd_sethelpcallback); - KVSM_REGISTER_CALLBACK_COMMAND(m,"register",addon_kvs_cmd_register); + KVSM_REGISTER_FUNCTION(m, "exists", addon_kvs_fnc_exists); + KVSM_REGISTER_FUNCTION(m, "version", addon_kvs_fnc_version); + + KVSM_REGISTER_SIMPLE_COMMAND(m, "dialog", addon_kvs_cmd_dialog); + KVSM_REGISTER_SIMPLE_COMMAND(m, "list", addon_kvs_cmd_list); + KVSM_REGISTER_SIMPLE_COMMAND(m, "install", addon_kvs_cmd_install); + KVSM_REGISTER_SIMPLE_COMMAND(m, "uninstall", addon_kvs_cmd_uninstall); + KVSM_REGISTER_SIMPLE_COMMAND(m, "configure", addon_kvs_cmd_configure); + KVSM_REGISTER_SIMPLE_COMMAND(m, "help", addon_kvs_cmd_help); + KVSM_REGISTER_SIMPLE_COMMAND(m, "installfiles", addon_kvs_cmd_installfiles); + KVSM_REGISTER_SIMPLE_COMMAND(m, "pack", addon_kvs_cmd_pack); + + KVSM_REGISTER_CALLBACK_COMMAND(m, "setconfigurecallback", addon_kvs_cmd_setconfigurecallback); + KVSM_REGISTER_CALLBACK_COMMAND(m, "sethelpcallback", addon_kvs_cmd_sethelpcallback); + KVSM_REGISTER_CALLBACK_COMMAND(m, "register", addon_kvs_cmd_register); QString szBuf; m->getDefaultConfigFileName(szBuf); - KviConfigurationFile cfg(szBuf,KviConfigurationFile::Read); - g_rectManagementDialogGeometry = cfg.readRectEntry("EditorGeometry",QRect(10,10,390,440)); + KviConfigurationFile cfg(szBuf, KviConfigurationFile::Read); + g_rectManagementDialogGeometry = cfg.readRectEntry("EditorGeometry", QRect(10, 10, 390, 440)); return true; } -static bool addon_module_cleanup(KviModule *m) +static bool addon_module_cleanup(KviModule * m) { AddonManagementDialog::cleanup(); QString szBuf; m->getDefaultConfigFileName(szBuf); - KviConfigurationFile cfg(szBuf,KviConfigurationFile::Write); - cfg.writeEntry("EditorGeometry",g_rectManagementDialogGeometry); + KviConfigurationFile cfg(szBuf, KviConfigurationFile::Write); + cfg.writeEntry("EditorGeometry", g_rectManagementDialogGeometry); return true; } @@ -881,16 +899,14 @@ static bool addon_module_can_unload(KviModule *) return (!AddonManagementDialog::instance()); } - KVIRC_MODULE( - "Addon", // module name - "4.0.0", // module version - "Copyright (C) 2005 Szymon Stefanek (pragma at kvirc dot net)\n" \ - " 2008 Elvio Basello (hell at hellvis69 dot netsons dot org)", // author & (C) - "Addon management functions for the KVS engine", - addon_module_init, - addon_module_can_unload, - 0, - addon_module_cleanup, - "addon" -) + "Addon", // module name + "4.0.0", // module version + "Copyright (C) 2005 Szymon Stefanek (pragma at kvirc dot net)\n" + " 2008 Elvio Basello (hell at hellvis69 dot netsons dot org)", // author & (C) + "Addon management functions for the KVS engine", + addon_module_init, + addon_module_can_unload, + 0, + addon_module_cleanup, + "addon") diff --git a/src/modules/aliaseditor/AliasEditorWindow.cpp b/src/modules/aliaseditor/AliasEditorWindow.cpp index 71addacb5..665a0ed62 100644 --- a/src/modules/aliaseditor/AliasEditorWindow.cpp +++ b/src/modules/aliaseditor/AliasEditorWindow.cpp @@ -22,7 +22,6 @@ // //============================================================================= - #include "AliasEditorWindow.h" #include "KviIconManager.h" @@ -60,43 +59,48 @@ extern AliasEditorWindow * g_pAliasEditorWindow; extern KviModule * g_pAliasEditorModule; - -AliasEditorTreeWidgetItem::AliasEditorTreeWidgetItem(QTreeWidget * pTreeWidget,Type eType,const QString &szName) -: QTreeWidgetItem(pTreeWidget), KviHeapObject(), m_eType(eType), m_pParentItem(0) +AliasEditorTreeWidgetItem::AliasEditorTreeWidgetItem(QTreeWidget * pTreeWidget, Type eType, const QString & szName) + : QTreeWidgetItem(pTreeWidget), KviHeapObject(), m_eType(eType), m_pParentItem(0) { setName(szName); - m_cPos=0; - if(eType==AliasEditorTreeWidgetItem::Namespace) setIcon(0,QIcon(*(g_pIconManager->getSmallIcon(KviIconManager::NameSpace)))); - else setIcon(0,QIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Alias)))); + m_cPos = 0; + if(eType == AliasEditorTreeWidgetItem::Namespace) + setIcon(0, QIcon(*(g_pIconManager->getSmallIcon(KviIconManager::NameSpace)))); + else + setIcon(0, QIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Alias)))); } -AliasEditorTreeWidgetItem::AliasEditorTreeWidgetItem(AliasEditorTreeWidgetItem * pParentItem,Type eType,const QString &szName) -: QTreeWidgetItem(pParentItem), m_eType(eType), m_pParentItem(pParentItem) +AliasEditorTreeWidgetItem::AliasEditorTreeWidgetItem(AliasEditorTreeWidgetItem * pParentItem, Type eType, const QString & szName) + : QTreeWidgetItem(pParentItem), m_eType(eType), m_pParentItem(pParentItem) { setName(szName); - m_cPos=0; - setFlags(Qt::ItemIsEditable|Qt::ItemIsEnabled|Qt::ItemIsSelectable); - if(eType==AliasEditorTreeWidgetItem::Namespace) setIcon(0,QIcon(*(g_pIconManager->getSmallIcon(KviIconManager::NameSpace)))); - else setIcon(0,QIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Alias)))); + m_cPos = 0; + setFlags(Qt::ItemIsEditable | Qt::ItemIsEnabled | Qt::ItemIsSelectable); + if(eType == AliasEditorTreeWidgetItem::Namespace) + setIcon(0, QIcon(*(g_pIconManager->getSmallIcon(KviIconManager::NameSpace)))); + else + setIcon(0, QIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Alias)))); } -void AliasEditorTreeWidgetItem::setName(const QString &szName) +void AliasEditorTreeWidgetItem::setName(const QString & szName) { m_szName = szName; - setText(0,m_szName); + setText(0, m_szName); } void AliasEditorTreeWidgetItem::setType(Type t) { - m_eType=t; - if(t==AliasEditorTreeWidgetItem::Namespace) setIcon(0,QIcon(*(g_pIconManager->getSmallIcon(KviIconManager::NameSpace)))); - else setIcon(0,QIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Alias)))); + m_eType = t; + if(t == AliasEditorTreeWidgetItem::Namespace) + setIcon(0, QIcon(*(g_pIconManager->getSmallIcon(KviIconManager::NameSpace)))); + else + setIcon(0, QIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Alias)))); } AliasEditorTreeWidget::AliasEditorTreeWidget(QWidget * par) -: QTreeWidget(par) + : QTreeWidget(par) { - setColumnCount (1); - setHeaderLabel(__tr2qs_ctx("Alias","editor")); + setColumnCount(1); + setHeaderLabel(__tr2qs_ctx("Alias", "editor")); setSelectionMode(QAbstractItemView::ExtendedSelection); setSortingEnabled(true); setRootIsDecorated(true); @@ -109,11 +113,10 @@ AliasEditorTreeWidget::~AliasEditorTreeWidget() clear(); } - AliasEditorWidget::AliasEditorWidget(QWidget * par) -: QWidget(par) + : QWidget(par) { - m_pAliases=new KviPointerList; + m_pAliases = new KviPointerList; m_pAliases->setAutoDelete(false); m_bSaving = false; @@ -123,9 +126,9 @@ AliasEditorWidget::AliasEditorWidget(QWidget * par) QGridLayout * l = new QGridLayout(this); - m_pSplitter = new QSplitter(Qt::Horizontal,this); + m_pSplitter = new QSplitter(Qt::Horizontal, this); m_pSplitter->setChildrenCollapsible(false); - l->addWidget(m_pSplitter,0,0); + l->addWidget(m_pSplitter, 0, 0); KviTalVBox * box = new KviTalVBox(m_pSplitter); box->setSpacing(0); @@ -137,23 +140,23 @@ AliasEditorWidget::AliasEditorWidget(QWidget * par) KviTalHBox * hbox = new KviTalHBox(box); hbox->setSpacing(0); hbox->setMargin(0); - m_pNameLabel = new QLabel(__tr2qs_ctx("No item selected","editor"),hbox); - m_pRenameButton = new QPushButton(__tr2qs_ctx("Rename","editor"),hbox); + m_pNameLabel = new QLabel(__tr2qs_ctx("No item selected", "editor"), hbox); + m_pRenameButton = new QPushButton(__tr2qs_ctx("Rename", "editor"), hbox); m_pRenameButton->setEnabled(false); - connect(m_pRenameButton,SIGNAL(clicked()),this,SLOT(renameItem())); - hbox->setStretchFactor(m_pNameLabel,2); - m_pRenameButton->setToolTip(__tr2qs_ctx("Edit the alias or namespace name","editor")); + connect(m_pRenameButton, SIGNAL(clicked()), this, SLOT(renameItem())); + hbox->setStretchFactor(m_pNameLabel, 2); + m_pRenameButton->setToolTip(__tr2qs_ctx("Edit the alias or namespace name", "editor")); m_pEditor = KviScriptEditor::createInstance(box); m_pEditor->setFocus(); - connect(m_pEditor,SIGNAL(find(const QString &)),this,SLOT(slotFindWord(const QString &))); - connect(m_pEditor,SIGNAL(replaceAll(const QString &,const QString &)),this,SLOT(slotReplaceAll(const QString &,const QString &))); + connect(m_pEditor, SIGNAL(find(const QString &)), this, SLOT(slotFindWord(const QString &))); + connect(m_pEditor, SIGNAL(replaceAll(const QString &, const QString &)), this, SLOT(slotReplaceAll(const QString &, const QString &))); - m_pContextPopup = new QMenu(this); + m_pContextPopup = new QMenu(this); oneTimeSetup(); - currentItemChanged(0,0); + currentItemChanged(0, 0); } AliasEditorWidget::~AliasEditorWidget() @@ -162,10 +165,12 @@ AliasEditorWidget::~AliasEditorWidget() delete m_pAliases; } -void AliasEditorWidget::buildFullItemPath(AliasEditorTreeWidgetItem * it,QString &szBuffer) +void AliasEditorWidget::buildFullItemPath(AliasEditorTreeWidgetItem * it, QString & szBuffer) { - if (it->isAlias()) it=it->parentItem(); - if (!it) return; + if(it->isAlias()) + it = it->parentItem(); + if(!it) + return; while(it) { QString tmp = it->name(); @@ -180,7 +185,8 @@ void AliasEditorWidget::buildFullItemPath(AliasEditorTreeWidgetItem * it,QString QString AliasEditorWidget::buildFullItemName(AliasEditorTreeWidgetItem * it) { - if(!it) return QString(); + if(!it) + return QString(); QString szName = it->name(); AliasEditorTreeWidgetItem * nit = it->parentItem(); @@ -198,79 +204,84 @@ QString AliasEditorWidget::buildFullItemName(AliasEditorTreeWidgetItem * it) } //FIXME this should be called something like "findNamespace" -AliasEditorTreeWidgetItem * AliasEditorWidget::findTopLevelItem(const QString &szName) +AliasEditorTreeWidgetItem * AliasEditorWidget::findTopLevelItem(const QString & szName) { - AliasEditorTreeWidgetItem *pItem =0; - for(int i=0;itopLevelItemCount();i++) + AliasEditorTreeWidgetItem * pItem = 0; + for(int i = 0; i < m_pTreeWidget->topLevelItemCount(); i++) { - pItem = (AliasEditorTreeWidgetItem*) m_pTreeWidget->topLevelItem(i); - if (pItem->text(0)==szName && pItem->isNamespace()) - return (AliasEditorTreeWidgetItem*)m_pTreeWidget->topLevelItem(i); + pItem = (AliasEditorTreeWidgetItem *)m_pTreeWidget->topLevelItem(i); + if(pItem->text(0) == szName && pItem->isNamespace()) + return (AliasEditorTreeWidgetItem *)m_pTreeWidget->topLevelItem(i); } return 0; } -AliasEditorTreeWidgetItem * AliasEditorWidget::findItem(const QString &szFullName) +AliasEditorTreeWidgetItem * AliasEditorWidget::findItem(const QString & szFullName) { - QStringList lNamespaces=szFullName.split("::"); - if(!lNamespaces.count()) return 0; - AliasEditorTreeWidgetItem *pItem=findTopLevelItem(lNamespaces.at(0)); - if (!pItem) return 0; + QStringList lNamespaces = szFullName.split("::"); + if(!lNamespaces.count()) + return 0; + AliasEditorTreeWidgetItem * pItem = findTopLevelItem(lNamespaces.at(0)); + if(!pItem) + return 0; bool bFound; int i; int j; - for(i=1;ichildCount();j++) + bFound = false; + for(j = 0; j < pItem->childCount(); j++) { - if (KviQString::equalCI(pItem->child(j)->text(0),lNamespaces.at(i))) + if(KviQString::equalCI(pItem->child(j)->text(0), lNamespaces.at(i))) { - pItem=( AliasEditorTreeWidgetItem *)pItem->child(j); - bFound=true; + pItem = (AliasEditorTreeWidgetItem *)pItem->child(j); + bFound = true; break; } } - if (!bFound) return 0; + if(!bFound) + return 0; } return (AliasEditorTreeWidgetItem *)pItem; } - -AliasEditorTreeWidgetItem * AliasEditorWidget::createFullItem(const QString &szFullName) +AliasEditorTreeWidgetItem * AliasEditorWidget::createFullItem(const QString & szFullName) { - QStringList lNamespaces=szFullName.split("::"); - if(!lNamespaces.count()) return 0; - if (lNamespaces.count()==1) return new AliasEditorTreeWidgetItem(m_pTreeWidget,AliasEditorTreeWidgetItem::Alias,lNamespaces.at(0)); - AliasEditorTreeWidgetItem *pItem=findTopLevelItem(lNamespaces.at(0)); - if (!pItem) pItem=new AliasEditorTreeWidgetItem(m_pTreeWidget,AliasEditorTreeWidgetItem::Namespace,lNamespaces.at(0)); + QStringList lNamespaces = szFullName.split("::"); + if(!lNamespaces.count()) + return 0; + if(lNamespaces.count() == 1) + return new AliasEditorTreeWidgetItem(m_pTreeWidget, AliasEditorTreeWidgetItem::Alias, lNamespaces.at(0)); + AliasEditorTreeWidgetItem * pItem = findTopLevelItem(lNamespaces.at(0)); + if(!pItem) + pItem = new AliasEditorTreeWidgetItem(m_pTreeWidget, AliasEditorTreeWidgetItem::Namespace, lNamespaces.at(0)); bool bFound; int i; - for(i=1;ichildCount();j++) + bFound = false; + for(int j = 0; j < pItem->childCount(); j++) { - if (KviQString::equalCI(pItem->child(j)->text(0),lNamespaces.at(i))) + if(KviQString::equalCI(pItem->child(j)->text(0), lNamespaces.at(i))) { - pItem=( AliasEditorTreeWidgetItem *)pItem->child(j); - bFound=true; + pItem = (AliasEditorTreeWidgetItem *)pItem->child(j); + bFound = true; break; } } - if (!bFound) - pItem=new AliasEditorTreeWidgetItem(pItem,AliasEditorTreeWidgetItem::Namespace,lNamespaces.at(i)); + if(!bFound) + pItem = new AliasEditorTreeWidgetItem(pItem, AliasEditorTreeWidgetItem::Namespace, lNamespaces.at(i)); } - return new AliasEditorTreeWidgetItem(pItem,AliasEditorTreeWidgetItem::Alias,lNamespaces.at(i)); + return new AliasEditorTreeWidgetItem(pItem, AliasEditorTreeWidgetItem::Alias, lNamespaces.at(i)); } - void AliasEditorWidget::oneTimeSetup() { - KviPointerHashTable * a = KviKvsAliasManager::instance()->aliasDict(); - if(!a)return; + KviPointerHashTable * a = KviKvsAliasManager::instance()->aliasDict(); + if(!a) + return; - KviPointerHashTableIterator it(*a); + KviPointerHashTableIterator it(*a); AliasEditorTreeWidgetItem * item; while(it.current()) @@ -282,30 +293,30 @@ void AliasEditorWidget::oneTimeSetup() ++it; } - connect(m_pTreeWidget,SIGNAL(currentItemChanged(QTreeWidgetItem *,QTreeWidgetItem *)),this,SLOT(currentItemChanged(QTreeWidgetItem *,QTreeWidgetItem *))); + connect(m_pTreeWidget, SIGNAL(currentItemChanged(QTreeWidgetItem *, QTreeWidgetItem *)), this, SLOT(currentItemChanged(QTreeWidgetItem *, QTreeWidgetItem *))); m_pTreeWidget->setContextMenuPolicy(Qt::CustomContextMenu); - connect(m_pTreeWidget,SIGNAL(customContextMenuRequested(const QPoint &)),this,SLOT(customContextMenuRequested(const QPoint &))); - connect(m_pTreeWidget,SIGNAL(itemChanged(QTreeWidgetItem *,int)),this,SLOT(itemRenamed(QTreeWidgetItem *,int))); - connect(KviKvsAliasManager::instance(),SIGNAL(aliasRefresh(const QString &)),this,SLOT(aliasRefresh(const QString &))); - m_pTreeWidget->sortItems(0,Qt::AscendingOrder); + connect(m_pTreeWidget, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(customContextMenuRequested(const QPoint &))); + connect(m_pTreeWidget, SIGNAL(itemChanged(QTreeWidgetItem *, int)), this, SLOT(itemRenamed(QTreeWidgetItem *, int))); + connect(KviKvsAliasManager::instance(), SIGNAL(aliasRefresh(const QString &)), this, SLOT(aliasRefresh(const QString &))); + m_pTreeWidget->sortItems(0, Qt::AscendingOrder); } -void AliasEditorWidget::aliasRefresh(const QString &szName) +void AliasEditorWidget::aliasRefresh(const QString & szName) { if(m_bSaving) return; - AliasEditorTreeWidgetItem * item=0; + AliasEditorTreeWidgetItem * item = 0; KviKvsScript * alias = KviKvsAliasManager::instance()->aliasDict()->find(szName); // search for old alias with same name KviPointerList l; l.setAutoDelete(false); - appendAllItems(&l,AliasEditorTreeWidgetItem::Alias); - for(AliasEditorTreeWidgetItem * it = l.first();it;it = l.next()) + appendAllItems(&l, AliasEditorTreeWidgetItem::Alias); + for(AliasEditorTreeWidgetItem * it = l.first(); it; it = l.next()) { - if (KviQString::equalCI(buildFullItemName(it),szName)) + if(KviQString::equalCI(buildFullItemName(it), szName)) { - item=it; + item = it; break; } } @@ -315,85 +326,91 @@ void AliasEditorWidget::aliasRefresh(const QString &szName) m_pAliases->append(item); } - if(item!=m_pLastEditedItem) + if(item != m_pLastEditedItem) { item->setBuffer(alias->code()); return; } if( - QMessageBox::warning(0,__tr2qs_ctx("Confirm Overwriting Current - KVIrc","editor"), - __tr2qs_ctx("An external script has changed the alias you are currently editing. Do you want to accept the external changes?","editor"), - QMessageBox::Yes,QMessageBox::No|QMessageBox::Default|QMessageBox::Escape) != QMessageBox::Yes - ) + QMessageBox::warning(0, __tr2qs_ctx("Confirm Overwriting Current - KVIrc", "editor"), + __tr2qs_ctx("An external script has changed the alias you are currently editing. Do you want to accept the external changes?", "editor"), + QMessageBox::Yes, QMessageBox::No | QMessageBox::Default | QMessageBox::Escape) + != QMessageBox::Yes) return; item->setBuffer(alias->code()); m_pEditor->setText(alias->code()); } -void AliasEditorWidget::itemRenamed(QTreeWidgetItem *it,int col) +void AliasEditorWidget::itemRenamed(QTreeWidgetItem * it, int col) { - if(it!=m_pLastEditedItem) return; + if(it != m_pLastEditedItem) + return; ((AliasEditorTreeWidgetItem *)it)->setName(it->text(col)); QString szNam = buildFullItemName((AliasEditorTreeWidgetItem *)it); QString szLabelText; if(((AliasEditorTreeWidgetItem *)it)->isNamespace()) - szLabelText = __tr2qs_ctx("Namespace","editor"); + szLabelText = __tr2qs_ctx("Namespace", "editor"); else - szLabelText = __tr2qs_ctx("Alias","editor"); + szLabelText = __tr2qs_ctx("Alias", "editor"); szLabelText += ": "; szLabelText += szNam; szLabelText += ""; m_pNameLabel->setText(szLabelText); } - - bool AliasEditorWidget::hasSelectedItems() - { - return m_pTreeWidget->selectedItems().count()?1:0; +{ + return m_pTreeWidget->selectedItems().count() ? 1 : 0; } -bool AliasEditorWidget::itemExists(QTreeWidgetItem *pSearchFor) +bool AliasEditorWidget::itemExists(QTreeWidgetItem * pSearchFor) { - if(!pSearchFor)return false; - if (m_pAliases->findRef((AliasEditorTreeWidgetItem*) pSearchFor)!=-1) return true; - else return false; + if(!pSearchFor) + return false; + if(m_pAliases->findRef((AliasEditorTreeWidgetItem *)pSearchFor) != -1) + return true; + else + return false; } -void AliasEditorWidget::appendAllItems(KviPointerList * l,AliasEditorTreeWidgetItem::Type eType) +void AliasEditorWidget::appendAllItems(KviPointerList * l, AliasEditorTreeWidgetItem::Type eType) { - for (int i=0;itopLevelItemCount();i++) + for(int i = 0; i < m_pTreeWidget->topLevelItemCount(); i++) { - if (((AliasEditorTreeWidgetItem *)m_pTreeWidget->topLevelItem(i))->type()==eType) + if(((AliasEditorTreeWidgetItem *)m_pTreeWidget->topLevelItem(i))->type() == eType) { l->append(((AliasEditorTreeWidgetItem *)m_pTreeWidget->topLevelItem(i))); - } else { - appendAllItemsRecursive(l,m_pTreeWidget->topLevelItem(i),eType); + } + else + { + appendAllItemsRecursive(l, m_pTreeWidget->topLevelItem(i), eType); } } } -void AliasEditorWidget::appendAllItemsRecursive(KviPointerList * l,QTreeWidgetItem * pStartFrom,AliasEditorTreeWidgetItem::Type eType) +void AliasEditorWidget::appendAllItemsRecursive(KviPointerList * l, QTreeWidgetItem * pStartFrom, AliasEditorTreeWidgetItem::Type eType) { - for (int i=0;ichildCount();i++) + for(int i = 0; i < pStartFrom->childCount(); i++) { - if (((AliasEditorTreeWidgetItem *)pStartFrom->child(i))->type()==eType) + if(((AliasEditorTreeWidgetItem *)pStartFrom->child(i))->type() == eType) { l->append((AliasEditorTreeWidgetItem *)pStartFrom->child(i)); - } else { - appendAllItemsRecursive(l,pStartFrom->child(i),eType); + } + else + { + appendAllItemsRecursive(l, pStartFrom->child(i), eType); } } } -bool AliasEditorWidget::aliasExists(QString &szFullItemName) +bool AliasEditorWidget::aliasExists(QString & szFullItemName) { KviPointerList l; l.setAutoDelete(false); - appendAllItems(&l,AliasEditorTreeWidgetItem::Alias); - for(AliasEditorTreeWidgetItem * it = l.first();it;it = l.next()) + appendAllItems(&l, AliasEditorTreeWidgetItem::Alias); + for(AliasEditorTreeWidgetItem * it = l.first(); it; it = l.next()) { - if (KviQString::equalCI(buildFullItemName(it),szFullItemName)) + if(KviQString::equalCI(buildFullItemName(it), szFullItemName)) { return true; } @@ -401,15 +418,15 @@ bool AliasEditorWidget::aliasExists(QString &szFullItemName) return false; } -bool AliasEditorWidget::namespaceExists(QString &szFullItemName) +bool AliasEditorWidget::namespaceExists(QString & szFullItemName) { KviPointerList l; l.setAutoDelete(false); - appendAllItems(&l,AliasEditorTreeWidgetItem::Namespace); - for(AliasEditorTreeWidgetItem * it = l.first();it;it = l.next()) + appendAllItems(&l, AliasEditorTreeWidgetItem::Namespace); + for(AliasEditorTreeWidgetItem * it = l.first(); it; it = l.next()) { - if (KviQString::equalCI(buildFullItemName(it),szFullItemName)) + if(KviQString::equalCI(buildFullItemName(it), szFullItemName)) { return true; } @@ -418,7 +435,8 @@ bool AliasEditorWidget::namespaceExists(QString &szFullItemName) } void AliasEditorWidget::renameItem() { - if(!m_pLastEditedItem)return; + if(!m_pLastEditedItem) + return; //if(itemExists(m_pLastEditedItem))return; // dead ? QString szName = buildFullItemName(m_pLastEditedItem); QString szNewName; @@ -426,35 +444,39 @@ void AliasEditorWidget::renameItem() bool bAlias = m_pLastEditedItem->isAlias(); if(bAlias) - szNewName = askForAliasName(__tr2qs_ctx("Enter a New Name - KVIrc","editor"),__tr2qs_ctx("Please enter the new name for the alias.","editor"),szName); + szNewName = askForAliasName(__tr2qs_ctx("Enter a New Name - KVIrc", "editor"), __tr2qs_ctx("Please enter the new name for the alias.", "editor"), szName); else - szNewName = askForNamespaceName(__tr2qs_ctx("Enter a New Name - KVIrc","editor"),__tr2qs_ctx("Please enter the new name for the namespace.","editor"),szName); - if(szNewName.isEmpty())return; + szNewName = askForNamespaceName(__tr2qs_ctx("Enter a New Name - KVIrc", "editor"), __tr2qs_ctx("Please enter the new name for the namespace.", "editor"), szName); + if(szNewName.isEmpty()) + return; - if(szName == szNewName)return; + if(szName == szNewName) + return; // check if there is already an alias with this name - if (bAlias) + if(bAlias) { - if (aliasExists(szNewName)) + if(aliasExists(szNewName)) { g_pAliasEditorModule->lock(); QMessageBox::information(this, - __tr2qs_ctx("Name Already Exists - KVIrc","editor"), - __tr2qs_ctx("This name is already in use. Please choose another one.","editor"), - __tr2qs_ctx("OK, Let me try again...","editor")); + __tr2qs_ctx("Name Already Exists - KVIrc", "editor"), + __tr2qs_ctx("This name is already in use. Please choose another one.", "editor"), + __tr2qs_ctx("OK, Let me try again...", "editor")); g_pAliasEditorModule->unlock(); return; } - } else { - // check if there is already a namespace with this name - if (namespaceExists(szNewName)) + } + else + { + // check if there is already a namespace with this name + if(namespaceExists(szNewName)) { g_pAliasEditorModule->lock(); QMessageBox::information(this, - __tr2qs_ctx("Name Already Exists - KVIrc","editor"), - __tr2qs_ctx("This name is already in use. Please choose another one.","editor"), - __tr2qs_ctx("OK, Let me try again...","editor")); + __tr2qs_ctx("Name Already Exists - KVIrc", "editor"), + __tr2qs_ctx("This name is already in use. Please choose another one.", "editor"), + __tr2qs_ctx("OK, Let me try again...", "editor")); g_pAliasEditorModule->unlock(); return; } @@ -467,25 +489,25 @@ void AliasEditorWidget::renameItem() m_pEditor->getText(szCode); pntCursor = m_pEditor->getCursor(); } - QList lChildren= m_pLastEditedItem->takeChildren(); + QList lChildren = m_pLastEditedItem->takeChildren(); bool bYesToAll = true; - removeItem(m_pLastEditedItem,&bYesToAll,true); + removeItem(m_pLastEditedItem, &bYesToAll, true); - m_pLastEditedItem = 0; // make sure it's true (but it already should be because of removeItem()) + m_pLastEditedItem = 0; // make sure it's true (but it already should be because of removeItem()) m_pLastClickedItem = 0; // make sure it's true (but it already should be because of removeItem()) AliasEditorTreeWidgetItem * pItem = createFullItem(szNewName); if(bAlias) { pItem->setBuffer(szCode); pItem->setCursorPosition(pntCursor); - - } else { - for(int i=0;isetParentItem(pItem); - pItem->insertChild(pItem->childCount(),lChildren.at(i)); + ((AliasEditorTreeWidgetItem *)lChildren.at(i))->setParentItem(pItem); + pItem->insertChild(pItem->childCount(), lChildren.at(i)); } - } activateItem(pItem); m_pAliases->append(pItem); @@ -506,14 +528,14 @@ void AliasEditorWidget::saveLastEditedItem() ((AliasEditorTreeWidgetItem *)m_pLastEditedItem)->setBuffer(newCode); } -void AliasEditorWidget::currentItemChanged(QTreeWidgetItem *it,QTreeWidgetItem *) +void AliasEditorWidget::currentItemChanged(QTreeWidgetItem * it, QTreeWidgetItem *) { saveLastEditedItem(); m_pLastEditedItem = (AliasEditorTreeWidgetItem *)it; if(!m_pLastEditedItem) { - m_pNameLabel->setText(__tr2qs_ctx("No item selected","editor")); + m_pNameLabel->setText(__tr2qs_ctx("No item selected", "editor")); m_pRenameButton->setEnabled(false); m_pEditor->setText(""); m_pEditor->setEnabled(false); @@ -523,7 +545,7 @@ void AliasEditorWidget::currentItemChanged(QTreeWidgetItem *it,QTreeWidgetItem * QString szNam = buildFullItemName(m_pLastEditedItem); if(m_pLastEditedItem->isNamespace()) { - QString szLabelText = __tr2qs_ctx("Namespace","editor"); + QString szLabelText = __tr2qs_ctx("Namespace", "editor"); szLabelText += ": "; szLabelText += szNam; szLabelText += ""; @@ -535,7 +557,7 @@ void AliasEditorWidget::currentItemChanged(QTreeWidgetItem *it,QTreeWidgetItem * return; } - QString szLabelText = __tr2qs_ctx("Alias","editor"); + QString szLabelText = __tr2qs_ctx("Alias", "editor"); szLabelText += ": "; szLabelText += szNam; szLabelText += ""; @@ -548,81 +570,83 @@ void AliasEditorWidget::currentItemChanged(QTreeWidgetItem *it,QTreeWidgetItem * m_pEditor->setEnabled(true); } - void AliasEditorWidget::customContextMenuRequested(const QPoint pnt) { m_pContextPopup->clear(); m_pLastClickedItem = (AliasEditorTreeWidgetItem *)m_pTreeWidget->itemAt(pnt); m_pContextPopup->addAction( - *(g_pIconManager->getSmallIcon(KviIconManager::Alias)), - __tr2qs_ctx("Add Alias","editor"), - this,SLOT(newAlias())); + *(g_pIconManager->getSmallIcon(KviIconManager::Alias)), + __tr2qs_ctx("Add Alias", "editor"), + this, SLOT(newAlias())); m_pContextPopup->addAction( - *(g_pIconManager->getSmallIcon(KviIconManager::NameSpace)), - __tr2qs_ctx("Add Namespace","editor"), - this,SLOT(newNamespace())); + *(g_pIconManager->getSmallIcon(KviIconManager::NameSpace)), + __tr2qs_ctx("Add Namespace", "editor"), + this, SLOT(newNamespace())); bool bHasItems = m_pTreeWidget->topLevelItemCount(); bool bHasSelected = hasSelectedItems(); - m_pContextPopup->addSeparator(); + m_pContextPopup->addSeparator(); - QAction *pAction = m_pContextPopup->addAction( - *(g_pIconManager->getSmallIcon(KviIconManager::Discard)), - __tr2qs_ctx("Remove Selected","editor"), - this,SLOT(removeSelectedItems())); - pAction->setEnabled(bHasSelected); + QAction * pAction = m_pContextPopup->addAction( + *(g_pIconManager->getSmallIcon(KviIconManager::Discard)), + __tr2qs_ctx("Remove Selected", "editor"), + this, SLOT(removeSelectedItems())); + pAction->setEnabled(bHasSelected); - m_pContextPopup->addSeparator(); + m_pContextPopup->addSeparator(); m_pContextPopup->addAction( - *(g_pIconManager->getSmallIcon(KviIconManager::Save)), - __tr2qs_ctx("Export Selected...","editor"), - this,SLOT(exportSelected())) - ->setEnabled(bHasSelected); + *(g_pIconManager->getSmallIcon(KviIconManager::Save)), + __tr2qs_ctx("Export Selected...", "editor"), + this, SLOT(exportSelected())) + ->setEnabled(bHasSelected); m_pContextPopup->addAction( - *(g_pIconManager->getSmallIcon(KviIconManager::Save)), - __tr2qs_ctx("Export Selected into Single Files...","editor"), - this,SLOT(exportSelectedSepFiles())) - ->setEnabled(bHasSelected); + *(g_pIconManager->getSmallIcon(KviIconManager::Save)), + __tr2qs_ctx("Export Selected into Single Files...", "editor"), + this, SLOT(exportSelectedSepFiles())) + ->setEnabled(bHasSelected); m_pContextPopup->addAction( - *(g_pIconManager->getSmallIcon(KviIconManager::Save)), - __tr2qs_ctx("Export All...","editor"), - this,SLOT(exportAll())) - ->setEnabled(bHasItems); + *(g_pIconManager->getSmallIcon(KviIconManager::Save)), + __tr2qs_ctx("Export All...", "editor"), + this, SLOT(exportAll())) + ->setEnabled(bHasItems); - m_pContextPopup->addSeparator(); + m_pContextPopup->addSeparator(); m_pContextPopup->addAction( - *(g_pIconManager->getSmallIcon(KviIconManager::Search)), - __tr2qs_ctx("Find in Aliases...","editor"), - this,SLOT(slotFind())) - ->setEnabled(bHasItems); + *(g_pIconManager->getSmallIcon(KviIconManager::Search)), + __tr2qs_ctx("Find in Aliases...", "editor"), + this, SLOT(slotFind())) + ->setEnabled(bHasItems); m_pContextPopup->addAction( - *(g_pIconManager->getSmallIcon(KviIconManager::NameSpace)), - __tr2qs_ctx("Collapse All Namespaces","editor"), - this,SLOT(slotCollapseNamespaces())) - ->setEnabled(bHasItems); - m_pContextPopup->popup( m_pTreeWidget->mapToGlobal(pnt)); + *(g_pIconManager->getSmallIcon(KviIconManager::NameSpace)), + __tr2qs_ctx("Collapse All Namespaces", "editor"), + this, SLOT(slotCollapseNamespaces())) + ->setEnabled(bHasItems); + m_pContextPopup->popup(m_pTreeWidget->mapToGlobal(pnt)); } -void AliasEditorWidget::searchReplace(const QString &szSearch,bool bReplace,const QString &szReplace) +void AliasEditorWidget::searchReplace(const QString & szSearch, bool bReplace, const QString & szReplace) { - for(unsigned int i=0;icount();i++) + for(unsigned int i = 0; i < m_pAliases->count(); i++) { - AliasEditorTreeWidgetItem *pItem=m_pAliases->at(i); - if(pItem->buffer().indexOf(szSearch,0,Qt::CaseInsensitive) != -1) + AliasEditorTreeWidgetItem * pItem = m_pAliases->at(i); + if(pItem->buffer().indexOf(szSearch, 0, Qt::CaseInsensitive) != -1) { - pItem->setBackground(0, QColor(255,0,0,128)); - if (bReplace) ((QString &)pItem->buffer()).replace(szSearch,szReplace,Qt::CaseInsensitive); + pItem->setBackground(0, QColor(255, 0, 0, 128)); + if(bReplace) + ((QString &)pItem->buffer()).replace(szSearch, szReplace, Qt::CaseInsensitive); openParentItems(pItem); - } else { - pItem->setBackground(0, QColor(255,255,255)); + } + else + { + pItem->setBackground(0, QColor(255, 255, 255)); } } } @@ -634,28 +658,31 @@ void AliasEditorWidget::slotFind() bool bOk; QString szSearch = QInputDialog::getText(this, - __tr2qs_ctx("Find in Aliases","editor"), - __tr2qs_ctx("Please enter the text to be searched for. The matching aliases will be highlighted.","editor"), - QLineEdit::Normal, - "", - &bOk); + __tr2qs_ctx("Find in Aliases", "editor"), + __tr2qs_ctx("Please enter the text to be searched for. The matching aliases will be highlighted.", "editor"), + QLineEdit::Normal, + "", + &bOk); g_pAliasEditorModule->unlock(); - if(!bOk)return; - if(szSearch.isEmpty())return; + if(!bOk) + return; + if(szSearch.isEmpty()) + return; m_pEditor->setFindText(szSearch); searchReplace(szSearch); } -void AliasEditorWidget::slotFindWord(const QString &szSearch) +void AliasEditorWidget::slotFindWord(const QString & szSearch) { m_pEditor->setFindText(szSearch); } void AliasEditorWidget::recursiveCollapseNamespaces(AliasEditorTreeWidgetItem * it) { - if(!it)return; - for (int i=0;ichildCount();i++) + if(!it) + return; + for(int i = 0; i < it->childCount(); i++) { if(it->child(i)->childCount()) { @@ -667,22 +694,23 @@ void AliasEditorWidget::recursiveCollapseNamespaces(AliasEditorTreeWidgetItem * void AliasEditorWidget::slotCollapseNamespaces() { - for (int i=0;itopLevelItemCount();i++) + for(int i = 0; i < m_pTreeWidget->topLevelItemCount(); i++) { - if (m_pTreeWidget->topLevelItem(i)->childCount()){ + if(m_pTreeWidget->topLevelItem(i)->childCount()) + { m_pTreeWidget->topLevelItem(i)->setExpanded(false); recursiveCollapseNamespaces((AliasEditorTreeWidgetItem *)m_pTreeWidget->topLevelItem(i)); } } } -void AliasEditorWidget::slotReplaceAll(const QString &szFind,const QString &szReplace) +void AliasEditorWidget::slotReplaceAll(const QString & szFind, const QString & szReplace) { m_pEditor->setFindText(szReplace); - searchReplace(szFind,true,szReplace); + searchReplace(szFind, true, szReplace); } -void AliasEditorWidget::getExportAliasBuffer(QString &buffer,AliasEditorTreeWidgetItem * it) +void AliasEditorWidget::getExportAliasBuffer(QString & buffer, AliasEditorTreeWidgetItem * it) { QString szBuf = it->buffer(); KviCommandFormatter::blockFromBuffer(szBuf); @@ -702,7 +730,7 @@ void AliasEditorWidget::exportAll() void AliasEditorWidget::exportSelectedSepFiles() { - exportAliases (true,true); + exportAliases(true, true); } void AliasEditorWidget::exportSelected() @@ -710,70 +738,75 @@ void AliasEditorWidget::exportSelected() exportAliases(true); } -void AliasEditorWidget::exportSelectionInSinglesFiles(KviPointerList *l) +void AliasEditorWidget::exportSelectionInSinglesFiles(KviPointerList * l) { - if(!m_szDir.endsWith(QString(KVI_PATH_SEPARATOR)))m_szDir += KVI_PATH_SEPARATOR; - if (!l->first()) + if(!m_szDir.endsWith(QString(KVI_PATH_SEPARATOR))) + m_szDir += KVI_PATH_SEPARATOR; + if(!l->first()) { g_pAliasEditorModule->lock(); - QMessageBox::warning(this,__tr2qs_ctx("Warning While Exporting - KVIrc","editor"),__tr2qs_ctx("Must select an entry from the list to export!","editor"),__tr2qs_ctx("OK","editor")); + QMessageBox::warning(this, __tr2qs_ctx("Warning While Exporting - KVIrc", "editor"), __tr2qs_ctx("Must select an entry from the list to export!", "editor"), __tr2qs_ctx("OK", "editor")); g_pAliasEditorModule->unlock(); return; } g_pAliasEditorModule->lock(); if(!KviFileDialog::askForDirectoryName( - m_szDir, - __tr2qs_ctx("Choose a Directory - KVIrc","editor"), - m_szDir, - QString(), - false, - true, - this - ) - ){ + m_szDir, + __tr2qs_ctx("Choose a Directory - KVIrc", "editor"), + m_szDir, + QString(), + false, + true, + this)) + { g_pAliasEditorModule->unlock(); return; } - if(!m_szDir.endsWith(QString(KVI_PATH_SEPARATOR)))m_szDir += KVI_PATH_SEPARATOR; + if(!m_szDir.endsWith(QString(KVI_PATH_SEPARATOR))) + m_szDir += KVI_PATH_SEPARATOR; - bool bReplaceAll=false; + bool bReplaceAll = false; - for(AliasEditorTreeWidgetItem * it = l->first();it;it = l->next()) + for(AliasEditorTreeWidgetItem * it = l->first(); it; it = l->next()) { QString tmp; - getExportAliasBuffer(tmp,it); - QString szFileName=buildFullItemName(it); + getExportAliasBuffer(tmp, it); + QString szFileName = buildFullItemName(it); szFileName += ".kvs"; - szFileName.replace("::","_"); - QString szCompletePath=m_szDir+szFileName; - if (KviFileUtils::fileExists(szCompletePath) && !bReplaceAll) + szFileName.replace("::", "_"); + QString szCompletePath = m_szDir + szFileName; + if(KviFileUtils::fileExists(szCompletePath) && !bReplaceAll) { QString szMsg; - szMsg = QString(__tr2qs_ctx("The file \"%1\" exists. Do you want to replace it?","editor")).arg(szFileName); - int ret = QMessageBox::question(this,__tr2qs_ctx("Confirm Replacing File - KVIrc","editor"),szMsg,__tr2qs_ctx("Yes","editor"),__tr2qs_ctx("Yes to All","editor"),__tr2qs_ctx("No","editor")); - if (ret!=2) + szMsg = QString(__tr2qs_ctx("The file \"%1\" exists. Do you want to replace it?", "editor")).arg(szFileName); + int ret = QMessageBox::question(this, __tr2qs_ctx("Confirm Replacing File - KVIrc", "editor"), szMsg, __tr2qs_ctx("Yes", "editor"), __tr2qs_ctx("Yes to All", "editor"), __tr2qs_ctx("No", "editor")); + if(ret != 2) { - KviFileUtils::writeFile(szCompletePath,tmp); - if (ret==1) bReplaceAll=true; + KviFileUtils::writeFile(szCompletePath, tmp); + if(ret == 1) + bReplaceAll = true; } - } else { - KviFileUtils::writeFile(szCompletePath,tmp); + } + else + { + KviFileUtils::writeFile(szCompletePath, tmp); } } g_pAliasEditorModule->unlock(); } -void AliasEditorWidget::exportAliases(bool bSelectedOnly,bool bSingleFiles) +void AliasEditorWidget::exportAliases(bool bSelectedOnly, bool bSingleFiles) { saveLastEditedItem(); KviPointerList l; l.setAutoDelete(false); - if (bSelectedOnly) appendSelectedAliasItems(&l); - if (bSingleFiles) + if(bSelectedOnly) + appendSelectedAliasItems(&l); + if(bSingleFiles) { exportSelectionInSinglesFiles(&l); return; @@ -781,89 +814,93 @@ void AliasEditorWidget::exportAliases(bool bSelectedOnly,bool bSingleFiles) QString szOut; int count; - if (bSelectedOnly) + if(bSelectedOnly) + { + count = l.count(); + buildAliasesFile(&l, szOut); + } + else { - count=l.count(); - buildAliasesFile(&l,szOut); - } else { - count=m_pAliases->count(); - buildAliasesFile(m_pAliases,szOut); + count = m_pAliases->count(); + buildAliasesFile(m_pAliases, szOut); } QString szNameFile; if(szOut.isEmpty()) { g_pAliasEditorModule->lock(); - QMessageBox::warning(this,__tr2qs_ctx("Warning While Exporting - KVIrc","editor"),__tr2qs_ctx("The exported file could be empty: cowardly refusing to write it.","editor"),__tr2qs_ctx("OK","editor")); + QMessageBox::warning(this, __tr2qs_ctx("Warning While Exporting - KVIrc", "editor"), __tr2qs_ctx("The exported file could be empty: cowardly refusing to write it.", "editor"), __tr2qs_ctx("OK", "editor")); g_pAliasEditorModule->unlock(); return; } QString szName = m_szDir; - if(!szName.endsWith(QString(KVI_PATH_SEPARATOR)))szName += KVI_PATH_SEPARATOR; + if(!szName.endsWith(QString(KVI_PATH_SEPARATOR))) + szName += KVI_PATH_SEPARATOR; QString szFile; g_pAliasEditorModule->lock(); - if (count==1) + if(count == 1) { - QString tmp=buildFullItemName(l.at(0)); - szNameFile = tmp.replace("::","_"); - } else { - szNameFile="aliases"; + QString tmp = buildFullItemName(l.at(0)); + szNameFile = tmp.replace("::", "_"); + } + else + { + szNameFile = "aliases"; } szName += szNameFile; szName += ".kvs"; if(!KviFileDialog::askForSaveFileName( - szFile, - __tr2qs_ctx("Choose a Filename - KVIrc","editor"), - szName, - KVI_FILTER_SCRIPT, - false, - true, - true, - this - )) + szFile, + __tr2qs_ctx("Choose a Filename - KVIrc", "editor"), + szName, + KVI_FILTER_SCRIPT, + false, + true, + true, + this)) { g_pAliasEditorModule->unlock(); return; } - m_szDir=QFileInfo(szFile).absolutePath(); + m_szDir = QFileInfo(szFile).absolutePath(); g_pAliasEditorModule->unlock(); - if(!KviFileUtils::writeFile(szFile,szOut)) + if(!KviFileUtils::writeFile(szFile, szOut)) { g_pAliasEditorModule->lock(); - QMessageBox::warning(this,__tr2qs_ctx("Writing to File Failed - KVIrc","editor"),__tr2qs_ctx("Unable to write to the aliases file.","editor"),__tr2qs_ctx("OK","editor")); + QMessageBox::warning(this, __tr2qs_ctx("Writing to File Failed - KVIrc", "editor"), __tr2qs_ctx("Unable to write to the aliases file.", "editor"), __tr2qs_ctx("OK", "editor")); g_pAliasEditorModule->unlock(); } } -void AliasEditorWidget::buildAliasesFile(KviPointerList *l, QString & szBuffer) +void AliasEditorWidget::buildAliasesFile(KviPointerList * l, QString & szBuffer) { - for(AliasEditorTreeWidgetItem * it = l->first();it;it = l->next()) + for(AliasEditorTreeWidgetItem * it = l->first(); it; it = l->next()) { QString tmp; - getExportAliasBuffer(tmp,it); + getExportAliasBuffer(tmp, it); szBuffer += tmp; szBuffer += "\n"; } } -void AliasEditorWidget::saveProperties(KviConfigurationFile *cfg) +void AliasEditorWidget::saveProperties(KviConfigurationFile * cfg) { - cfg->writeEntry("Sizes",m_pSplitter->sizes()); + cfg->writeEntry("Sizes", m_pSplitter->sizes()); QString szName; if(m_pLastEditedItem) szName = buildFullItemName(m_pLastEditedItem); - cfg->writeEntry("LastAlias",szName); + cfg->writeEntry("LastAlias", szName); } -void AliasEditorWidget::loadProperties(KviConfigurationFile *cfg) +void AliasEditorWidget::loadProperties(KviConfigurationFile * cfg) { QList def; def.append(20); def.append(80); - m_pSplitter->setSizes(cfg->readIntListEntry("Sizes",def)); - QString tmp = cfg->readEntry("LastAlias",QString()); + m_pSplitter->setSizes(cfg->readIntListEntry("Sizes", def)); + QString tmp = cfg->readEntry("LastAlias", QString()); AliasEditorTreeWidgetItem * it = findItem(tmp); activateItem(it); @@ -871,51 +908,51 @@ void AliasEditorWidget::loadProperties(KviConfigurationFile *cfg) void AliasEditorWidget::appendSelectedAliasItems(KviPointerList * l) { - QList list=m_pTreeWidget->selectedItems(); - for(int i=0;i list = m_pTreeWidget->selectedItems(); + for(int i = 0; i < list.count(); i++) { - if (((AliasEditorTreeWidgetItem *)list.at(i))->isAlias()) + if(((AliasEditorTreeWidgetItem *)list.at(i))->isAlias()) { l->append((AliasEditorTreeWidgetItem *)list.at(i)); - } else { - appendSelectedAliasItemsRecursive(l,list.at(i)); + } + else + { + appendSelectedAliasItemsRecursive(l, list.at(i)); } } } -void AliasEditorWidget::appendSelectedAliasItemsRecursive(KviPointerList * l,QTreeWidgetItem * pStartFrom) +void AliasEditorWidget::appendSelectedAliasItemsRecursive(KviPointerList * l, QTreeWidgetItem * pStartFrom) { - for (int i=0;ichildCount();i++) + for(int i = 0; i < pStartFrom->childCount(); i++) { - if (((AliasEditorTreeWidgetItem *)pStartFrom->child(i))->isAlias()) + if(((AliasEditorTreeWidgetItem *)pStartFrom->child(i))->isAlias()) l->append(((AliasEditorTreeWidgetItem *)pStartFrom->child(i))); else - appendSelectedAliasItemsRecursive(l,pStartFrom->child(i)); + appendSelectedAliasItemsRecursive(l, pStartFrom->child(i)); } } - void AliasEditorWidget::appendSelectedItems(KviPointerList * l) { - QList list=m_pTreeWidget->selectedItems(); - for(int i=0;i list = m_pTreeWidget->selectedItems(); + for(int i = 0; i < list.count(); i++) { l->append((AliasEditorTreeWidgetItem *)list.at(i)); /* if (!((AliasEditorTreeWidgetItem *)list.at(i))->isAlias()) appendSelectedAliasItemsRecursive(l,list.at(i));*/ } - } -void AliasEditorWidget::appendSelectedItemsRecursive(KviPointerList * l,QTreeWidgetItem * pStartFrom) +void AliasEditorWidget::appendSelectedItemsRecursive(KviPointerList * l, QTreeWidgetItem * pStartFrom) { - for (int i=0;ichildCount();i++) + for(int i = 0; i < pStartFrom->childCount(); i++) { l->append(((AliasEditorTreeWidgetItem *)pStartFrom->child(i))); - if (!((AliasEditorTreeWidgetItem *)pStartFrom->child(i))->isAlias()) - appendSelectedAliasItemsRecursive(l,pStartFrom->child(i)); + if(!((AliasEditorTreeWidgetItem *)pStartFrom->child(i))->isAlias()) + appendSelectedAliasItemsRecursive(l, pStartFrom->child(i)); } } -void AliasEditorWidget::removeItemChildren(AliasEditorTreeWidgetItem *it) +void AliasEditorWidget::removeItemChildren(AliasEditorTreeWidgetItem * it) { while(it->childCount() > 0) { @@ -927,36 +964,38 @@ void AliasEditorWidget::removeItemChildren(AliasEditorTreeWidgetItem *it) } } -bool AliasEditorWidget::removeItem(AliasEditorTreeWidgetItem *it,bool * pbYesToAll,bool) +bool AliasEditorWidget::removeItem(AliasEditorTreeWidgetItem * it, bool * pbYesToAll, bool) { - if(!it)return true; + if(!it) + return true; QString szMsg; QString szName = it->name(); if(!*pbYesToAll) { if(it->isAlias()) - szMsg = QString(__tr2qs_ctx("Do you really want to remove the alias \"%1\"?","editor")).arg(szName); - else { - szMsg = QString(__tr2qs_ctx("Do you really want to remove the namespace \"%1\"?","editor")).arg(szName); + szMsg = QString(__tr2qs_ctx("Do you really want to remove the alias \"%1\"?", "editor")).arg(szName); + else + { + szMsg = QString(__tr2qs_ctx("Do you really want to remove the namespace \"%1\"?", "editor")).arg(szName); szMsg += "
"; - szMsg += __tr2qs_ctx("Please note that all the child items will be deleted too.","editor"); + szMsg += __tr2qs_ctx("Please note that all the child items will be deleted too.", "editor"); } g_pAliasEditorModule->lock(); - int ret = QMessageBox::question(this,__tr2qs_ctx("Confirm Removing Item - KVIrc","editor"),szMsg,__tr2qs_ctx("Yes","editor"),__tr2qs_ctx("Yes to All","editor"),__tr2qs_ctx("No","editor")); + int ret = QMessageBox::question(this, __tr2qs_ctx("Confirm Removing Item - KVIrc", "editor"), szMsg, __tr2qs_ctx("Yes", "editor"), __tr2qs_ctx("Yes to All", "editor"), __tr2qs_ctx("No", "editor")); g_pAliasEditorModule->unlock(); switch(ret) { case 0: // nothing - break; + break; case 1: *pbYesToAll = true; - break; + break; default: return false; - break; + break; } } @@ -964,7 +1003,7 @@ bool AliasEditorWidget::removeItem(AliasEditorTreeWidgetItem *it,bool * pbYesToA m_pLastEditedItem = 0; if(it == m_pLastClickedItem) m_pLastClickedItem = 0; - if (it->childCount()) + if(it->childCount()) removeItemChildren(it); delete it; m_pAliases->removeRef(it); @@ -977,13 +1016,14 @@ void AliasEditorWidget::removeSelectedItems() l.setAutoDelete(false); appendSelectedItems(&l); bool bYesToAll = false; - for(AliasEditorTreeWidgetItem *it = l.first();it;it = l.next()) + for(AliasEditorTreeWidgetItem * it = l.first(); it; it = l.next()) { - if(!removeItem(it,&bYesToAll,false))return; + if(!removeItem(it, &bYesToAll, false)) + return; } } -QString AliasEditorWidget::askForAliasName(const QString &szAction,const QString &szText,const QString &szInitialText) +QString AliasEditorWidget::askForAliasName(const QString & szAction, const QString & szText, const QString & szInitialText) { bool bOk = false; QString szNewName; @@ -991,20 +1031,21 @@ QString AliasEditorWidget::askForAliasName(const QString &szAction,const QString { g_pAliasEditorModule->lock(); szNewName = QInputDialog::getText(this, - szAction, - szText, - QLineEdit::Normal, - szInitialText, - &bOk); + szAction, + szText, + QLineEdit::Normal, + szInitialText, + &bOk); g_pAliasEditorModule->unlock(); - if(!bOk)return QString(); + if(!bOk) + return QString(); if(szNewName.isEmpty()) { g_pAliasEditorModule->lock(); QMessageBox::warning(this, - __tr2qs_ctx("Invalid or Missing Name - KVIrc","editor"), - __tr2qs_ctx("You must specify a valid name for the alias.","editor"), - __tr2qs_ctx("OK, Let me try again...","editor")); + __tr2qs_ctx("Invalid or Missing Name - KVIrc", "editor"), + __tr2qs_ctx("You must specify a valid name for the alias.", "editor"), + __tr2qs_ctx("OK, Let me try again...", "editor")); g_pAliasEditorModule->unlock(); continue; } @@ -1015,34 +1056,34 @@ QString AliasEditorWidget::askForAliasName(const QString &szAction,const QString { g_pAliasEditorModule->lock(); QMessageBox::information(this, - __tr2qs_ctx("Invalid Name - KVIrc","editor"), - __tr2qs_ctx("Aliases names can contain only letters, digits, underscores and '::' namespace separators.","editor"), - __tr2qs_ctx("OK, Let me try again...","editor")); + __tr2qs_ctx("Invalid Name - KVIrc", "editor"), + __tr2qs_ctx("Aliases names can contain only letters, digits, underscores and '::' namespace separators.", "editor"), + __tr2qs_ctx("OK, Let me try again...", "editor")); g_pAliasEditorModule->unlock(); szNewName = ""; continue; } // make sure that we have only doubled "::" and not ":" or ":::..." QString tmp = szNewName; - tmp.replace("::","@"); // @ is not allowed by the rule above - if(tmp.indexOf(":",Qt::CaseInsensitive) != -1) + tmp.replace("::", "@"); // @ is not allowed by the rule above + if(tmp.indexOf(":", Qt::CaseInsensitive) != -1) { g_pAliasEditorModule->lock(); QMessageBox::information(this, - __tr2qs_ctx("Invalid Name - KVIrc","editor"), - __tr2qs_ctx("Stray ':' character in alias name: did you mean ...::?","editor"), - __tr2qs_ctx("OK, Let me try again...","editor")); + __tr2qs_ctx("Invalid Name - KVIrc", "editor"), + __tr2qs_ctx("Stray ':' character in alias name: did you mean ...::?", "editor"), + __tr2qs_ctx("OK, Let me try again...", "editor")); g_pAliasEditorModule->unlock(); szNewName = ""; continue; } - if(tmp.indexOf("@@",Qt::CaseInsensitive) != -1) + if(tmp.indexOf("@@", Qt::CaseInsensitive) != -1) { g_pAliasEditorModule->lock(); QMessageBox::information(this, - __tr2qs_ctx("Invalid Name - KVIrc","editor"), - __tr2qs_ctx("Found an empty namespace in alias name.","editor"), - __tr2qs_ctx("OK, Let me try again...","editor")); + __tr2qs_ctx("Invalid Name - KVIrc", "editor"), + __tr2qs_ctx("Found an empty namespace in alias name.", "editor"), + __tr2qs_ctx("OK, Let me try again...", "editor")); g_pAliasEditorModule->unlock(); szNewName = ""; continue; @@ -1051,7 +1092,7 @@ QString AliasEditorWidget::askForAliasName(const QString &szAction,const QString return szNewName; } -QString AliasEditorWidget::askForNamespaceName(const QString &szAction,const QString &szText,const QString &szInitialText) +QString AliasEditorWidget::askForNamespaceName(const QString & szAction, const QString & szText, const QString & szInitialText) { bool bOk = false; QString szNewName; @@ -1059,20 +1100,21 @@ QString AliasEditorWidget::askForNamespaceName(const QString &szAction,const QSt { g_pAliasEditorModule->lock(); szNewName = QInputDialog::getText(this, - szAction, - szText, - QLineEdit::Normal, - szInitialText, - &bOk); + szAction, + szText, + QLineEdit::Normal, + szInitialText, + &bOk); g_pAliasEditorModule->unlock(); - if(!bOk)return QString(); + if(!bOk) + return QString(); if(szNewName.isEmpty()) { g_pAliasEditorModule->lock(); QMessageBox::warning(this, - __tr2qs_ctx("Invalid or Missing Name - KVIrc","editor"), - __tr2qs_ctx("You must specify a valid name for the namespace.","editor"), - __tr2qs_ctx("OK, Let me try again...","editor")); + __tr2qs_ctx("Invalid or Missing Name - KVIrc", "editor"), + __tr2qs_ctx("You must specify a valid name for the namespace.", "editor"), + __tr2qs_ctx("OK, Let me try again...", "editor")); g_pAliasEditorModule->unlock(); continue; } @@ -1083,34 +1125,34 @@ QString AliasEditorWidget::askForNamespaceName(const QString &szAction,const QSt { g_pAliasEditorModule->lock(); QMessageBox::information(this, - __tr2qs_ctx("Invalid Name - KVIrc","editor"), - __tr2qs_ctx("Namespace names can contain only letters, digits, underscores and '::' namespace separators.","editor"), - __tr2qs_ctx("OK, Let me try again...","editor")); + __tr2qs_ctx("Invalid Name - KVIrc", "editor"), + __tr2qs_ctx("Namespace names can contain only letters, digits, underscores and '::' namespace separators.", "editor"), + __tr2qs_ctx("OK, Let me try again...", "editor")); g_pAliasEditorModule->unlock(); szNewName = ""; continue; } // make sure that we have only doubled "::" and not ":" or ":::..." QString tmp = szNewName; - tmp.replace("::","@"); // @ is not allowed by the rule above - if(tmp.indexOf(":",Qt::CaseInsensitive) != -1) + tmp.replace("::", "@"); // @ is not allowed by the rule above + if(tmp.indexOf(":", Qt::CaseInsensitive) != -1) { g_pAliasEditorModule->lock(); QMessageBox::information(this, - __tr2qs_ctx("Invalid Name - KVIrc","editor"), - __tr2qs_ctx("Stray ':' character in namespace name: did you mean... ::?","editor"), - __tr2qs_ctx("OK, Let me try again...","editor")); + __tr2qs_ctx("Invalid Name - KVIrc", "editor"), + __tr2qs_ctx("Stray ':' character in namespace name: did you mean... ::?", "editor"), + __tr2qs_ctx("OK, Let me try again...", "editor")); g_pAliasEditorModule->unlock(); szNewName = ""; continue; } - if(tmp.indexOf("@@",Qt::CaseInsensitive) != -1) + if(tmp.indexOf("@@", Qt::CaseInsensitive) != -1) { g_pAliasEditorModule->lock(); QMessageBox::information(this, - __tr2qs_ctx("Invalid Name - KVIrc","editor"), - __tr2qs_ctx("Found an empty namespace in namespace name.","editor"), - __tr2qs_ctx("OK, Let me try again...","editor")); + __tr2qs_ctx("Invalid Name - KVIrc", "editor"), + __tr2qs_ctx("Found an empty namespace in namespace name.", "editor"), + __tr2qs_ctx("OK, Let me try again...", "editor")); g_pAliasEditorModule->unlock(); szNewName = ""; continue; @@ -1130,32 +1172,38 @@ void AliasEditorWidget::openParentItems(QTreeWidgetItem * it) void AliasEditorWidget::activateItem(QTreeWidgetItem * it) { - if (!it) return; + if(!it) + return; openParentItems(it); m_pTreeWidget->setCurrentItem(it); } void AliasEditorWidget::newAlias() { - QString szNewName = askForAliasName(__tr2qs_ctx("Enter a Filename - KVIrc","editor"),__tr2qs_ctx("Please enter the new name for the alias.","editor"),"myfunction"); - if(szNewName.isEmpty())return; - newItem(szNewName,AliasEditorTreeWidgetItem::Alias); + QString szNewName = askForAliasName(__tr2qs_ctx("Enter a Filename - KVIrc", "editor"), __tr2qs_ctx("Please enter the new name for the alias.", "editor"), "myfunction"); + if(szNewName.isEmpty()) + return; + newItem(szNewName, AliasEditorTreeWidgetItem::Alias); } void AliasEditorWidget::newNamespace() { - QString szName = askForNamespaceName(__tr2qs_ctx("Enter a Filename - KVIrc","editor"),__tr2qs_ctx("Please enter the new name for the namespace.","editor"),"mynamespace"); - if(szName.isEmpty())return; - newItem(szName,AliasEditorTreeWidgetItem::Namespace); + QString szName = askForNamespaceName(__tr2qs_ctx("Enter a Filename - KVIrc", "editor"), __tr2qs_ctx("Please enter the new name for the namespace.", "editor"), "mynamespace"); + if(szName.isEmpty()) + return; + newItem(szName, AliasEditorTreeWidgetItem::Namespace); } -void AliasEditorWidget::newItem(QString &szName,AliasEditorTreeWidgetItem::Type eType) +void AliasEditorWidget::newItem(QString & szName, AliasEditorTreeWidgetItem::Type eType) { if(m_pLastClickedItem) - if(!itemExists(m_pLastClickedItem)) m_pLastClickedItem=0; - if(m_pLastClickedItem) buildFullItemPath(m_pLastClickedItem,szName); - int idx=1; + if(!itemExists(m_pLastClickedItem)) + m_pLastClickedItem = 0; + if(m_pLastClickedItem) + buildFullItemPath(m_pLastClickedItem, szName); + int idx = 1; QString szTmp; - if(findItem(szName)) szName.append("1"); + if(findItem(szName)) + szName.append("1"); while(findItem(szName)) { szTmp.setNum(idx); @@ -1164,7 +1212,7 @@ void AliasEditorWidget::newItem(QString &szName,AliasEditorTreeWidgetItem::Type idx++; } AliasEditorTreeWidgetItem * it; - it=createFullItem(szName); + it = createFullItem(szName); it->setType(eType); m_pAliases->append(it); activateItem(it); @@ -1175,49 +1223,48 @@ void AliasEditorWidget::commit() m_bSaving = true; saveLastEditedItem(); KviKvsAliasManager::instance()->clear(); - for(unsigned int i=0;icount();i++) + for(unsigned int i = 0; i < m_pAliases->count(); i++) { //don't save empty aliases or namespace names if(m_pAliases->at(i)->buffer().isEmpty()) continue; QString szName = buildFullItemName(m_pAliases->at(i)); - KviKvsScript * a = new KviKvsScript(szName,m_pAliases->at(i)->buffer()); - KviKvsAliasManager::instance()->add(szName,a); + KviKvsScript * a = new KviKvsScript(szName, m_pAliases->at(i)->buffer()); + KviKvsAliasManager::instance()->add(szName, a); } g_pApp->saveAliases(); m_bSaving = false; } - AliasEditorWindow::AliasEditorWindow() -: KviWindow(KviWindow::ScriptEditor,"aliaseditor",0) + : KviWindow(KviWindow::ScriptEditor, "aliaseditor", 0) { g_pAliasEditorWindow = this; - setFixedCaption(__tr2qs_ctx("Alias Editor","editor")); + setFixedCaption(__tr2qs_ctx("Alias Editor", "editor")); QGridLayout * g = new QGridLayout(); m_pEditor = new AliasEditorWidget(this); - g->addWidget(m_pEditor,0,0,1,4); + g->addWidget(m_pEditor, 0, 0, 1, 4); - QPushButton * btn = new QPushButton(__tr2qs_ctx("&OK","editor"),this); - connect(btn,SIGNAL(clicked()),this,SLOT(okClicked())); + QPushButton * btn = new QPushButton(__tr2qs_ctx("&OK", "editor"), this); + connect(btn, SIGNAL(clicked()), this, SLOT(okClicked())); btn->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Accept))); - g->addWidget(btn,1,1); + g->addWidget(btn, 1, 1); - btn = new QPushButton(__tr2qs_ctx("&Apply","editor"),this); - connect(btn,SIGNAL(clicked()),this,SLOT(applyClicked())); + btn = new QPushButton(__tr2qs_ctx("&Apply", "editor"), this); + connect(btn, SIGNAL(clicked()), this, SLOT(applyClicked())); btn->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Accept))); - g->addWidget(btn,1,2); + g->addWidget(btn, 1, 2); - btn = new QPushButton(__tr2qs_ctx("Cancel","editor"),this); - connect(btn,SIGNAL(clicked()),this,SLOT(cancelClicked())); + btn = new QPushButton(__tr2qs_ctx("Cancel", "editor"), this); + connect(btn, SIGNAL(clicked()), this, SLOT(cancelClicked())); btn->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Discard))); - g->addWidget(btn,1,3); + g->addWidget(btn, 1, 3); - g->setRowStretch(0,1); - g->setColumnStretch(0,1); + g->setRowStretch(0, 1); + g->setColumnStretch(0, 1); setLayout(g); } @@ -1247,17 +1294,17 @@ QPixmap * AliasEditorWindow::myIconPtr() return g_pIconManager->getSmallIcon(KviIconManager::AliasEditor); } -void AliasEditorWindow::getConfigGroupName(QString &szName) +void AliasEditorWindow::getConfigGroupName(QString & szName) { szName = "aliaseditor"; } -void AliasEditorWindow::saveProperties(KviConfigurationFile *cfg) +void AliasEditorWindow::saveProperties(KviConfigurationFile * cfg) { m_pEditor->saveProperties(cfg); } -void AliasEditorWindow::loadProperties(KviConfigurationFile *cfg) +void AliasEditorWindow::loadProperties(KviConfigurationFile * cfg) { m_pEditor->loadProperties(cfg); } diff --git a/src/modules/aliaseditor/AliasEditorWindow.h b/src/modules/aliaseditor/AliasEditorWindow.h index f750f51a6..c9102b559 100644 --- a/src/modules/aliaseditor/AliasEditorWindow.h +++ b/src/modules/aliaseditor/AliasEditorWindow.h @@ -40,45 +40,48 @@ class QSplitter; class KviScriptEditor; - - class AliasEditorTreeWidgetItem : public QTreeWidgetItem, public KviHeapObject { public: - enum Type { Alias, Namespace }; + enum Type + { + Alias, + Namespace + }; + public: - AliasEditorTreeWidgetItem(QTreeWidget * pTreeWidget,Type eType,const QString &szName); - AliasEditorTreeWidgetItem(AliasEditorTreeWidgetItem * pParentItem,Type eType,const QString &szName); + AliasEditorTreeWidgetItem(QTreeWidget * pTreeWidget, Type eType, const QString & szName); + AliasEditorTreeWidgetItem(AliasEditorTreeWidgetItem * pParentItem, Type eType, const QString & szName); ~AliasEditorTreeWidgetItem(){}; + protected: Type m_eType; AliasEditorTreeWidgetItem * m_pParentItem; QString m_szName; QString m_szBuffer; - int m_cPos; + int m_cPos; + public: - inline const QString & name(){ return m_szName; }; - void setName(const QString &szName); - inline Type type(){ return m_eType; }; + inline const QString & name() { return m_szName; }; + void setName(const QString & szName); + inline Type type() { return m_eType; }; void setType(Type t); - inline bool isAlias(){ return m_eType == Alias; }; - inline bool isNamespace(){ return m_eType == Namespace; }; - void setParentItem(AliasEditorTreeWidgetItem* it){ m_pParentItem=it; }; - AliasEditorTreeWidgetItem * parentItem(){ return m_pParentItem; }; - inline void setBuffer(const QString &szBuffer){ m_szBuffer = szBuffer; }; - inline const QString & buffer(){ return m_szBuffer; }; - inline const int & cursorPosition(){return m_cPos; }; - - void setCursorPosition(const int &cPos){ m_cPos = cPos; }; + inline bool isAlias() { return m_eType == Alias; }; + inline bool isNamespace() { return m_eType == Namespace; }; + void setParentItem(AliasEditorTreeWidgetItem * it) { m_pParentItem = it; }; + AliasEditorTreeWidgetItem * parentItem() { return m_pParentItem; }; + inline void setBuffer(const QString & szBuffer) { m_szBuffer = szBuffer; }; + inline const QString & buffer() { return m_szBuffer; }; + inline const int & cursorPosition() { return m_cPos; }; + + void setCursorPosition(const int & cPos) { m_cPos = cPos; }; }; - - class AliasEditorTreeWidget : public QTreeWidget { Q_OBJECT public: - AliasEditorTreeWidget(QWidget*); + AliasEditorTreeWidget(QWidget *); ~AliasEditorTreeWidget(); }; @@ -88,33 +91,35 @@ class AliasEditorWidget : public QWidget public: AliasEditorWidget(QWidget * par); ~AliasEditorWidget(); + public: - KviScriptEditor * m_pEditor; - AliasEditorTreeWidget * m_pTreeWidget; - QLabel * m_pNameLabel; - QPushButton * m_pRenameButton; + KviScriptEditor * m_pEditor; + AliasEditorTreeWidget * m_pTreeWidget; + QLabel * m_pNameLabel; + QPushButton * m_pRenameButton; AliasEditorTreeWidgetItem * m_pLastEditedItem; AliasEditorTreeWidgetItem * m_pLastClickedItem; - QMenu * m_pContextPopup; - QSplitter * m_pSplitter; - QString m_szDir; - bool m_bSaving; + QMenu * m_pContextPopup; + QSplitter * m_pSplitter; + QString m_szDir; + bool m_bSaving; + public: //bool modified(){ return m_bModified; }; void commit(); - void exportAliases(bool,bool=false); - void exportSelectionInSinglesFiles(KviPointerList *l); + void exportAliases(bool, bool = false); + void exportSelectionInSinglesFiles(KviPointerList * l); void saveProperties(KviConfigurationFile *); void loadProperties(KviConfigurationFile *); - static void splitFullAliasOrNamespaceName(const QString &szFullName,QStringList &lNamespaces,QString &szName); + static void splitFullAliasOrNamespaceName(const QString & szFullName, QStringList & lNamespaces, QString & szName); protected slots: - void currentItemChanged(QTreeWidgetItem *it,QTreeWidgetItem *); + void currentItemChanged(QTreeWidgetItem * it, QTreeWidgetItem *); void renameItem(); void newAlias(); void customContextMenuRequested(const QPoint pnt); void newNamespace(); - void newItem(QString &szName,AliasEditorTreeWidgetItem::Type eType); + void newItem(QString & szName, AliasEditorTreeWidgetItem::Type eType); void exportAll(); void exportSelectedSepFiles(); @@ -124,60 +129,61 @@ protected slots: void slotFind(); void slotCollapseNamespaces(); void slotFindWord(const QString &); - void slotReplaceAll(const QString &before,const QString &after); - void itemRenamed(QTreeWidgetItem *it,int col); - void aliasRefresh(const QString &szName); + void slotReplaceAll(const QString & before, const QString & after); + void itemRenamed(QTreeWidgetItem * it, int col); + void aliasRefresh(const QString & szName); protected: - KviPointerList *m_pAliases; + KviPointerList * m_pAliases; void recursiveCollapseNamespaces(AliasEditorTreeWidgetItem * it); - void searchReplace(const QString &szSearch,bool bReplace=false,const QString &szReplace="n"); + void searchReplace(const QString & szSearch, bool bReplace = false, const QString & szReplace = "n"); - void getExportAliasBuffer(QString &buffer,AliasEditorTreeWidgetItem * it); + void getExportAliasBuffer(QString & buffer, AliasEditorTreeWidgetItem * it); void oneTimeSetup(); void saveLastEditedItem(); - void getUniqueItemName(AliasEditorTreeWidgetItem *item,QString &buffer,AliasEditorTreeWidgetItem::Type eType); + void getUniqueItemName(AliasEditorTreeWidgetItem * item, QString & buffer, AliasEditorTreeWidgetItem::Type eType); void appendSelectedAliasItems(KviPointerList * l); - void appendSelectedAliasItemsRecursive(KviPointerList * l,QTreeWidgetItem * pStartFrom); + void appendSelectedAliasItemsRecursive(KviPointerList * l, QTreeWidgetItem * pStartFrom); void appendSelectedItems(KviPointerList * l); - void appendSelectedItemsRecursive(KviPointerList * l,QTreeWidgetItem * pStartFrom); + void appendSelectedItemsRecursive(KviPointerList * l, QTreeWidgetItem * pStartFrom); void openParentItems(QTreeWidgetItem * it); void activateItem(QTreeWidgetItem * it); - bool removeItem(AliasEditorTreeWidgetItem *it,bool * pbYesToAll,bool bDeleteEmptyTree); - void removeItemChildren(AliasEditorTreeWidgetItem *it); - - QString askForAliasName(const QString &szAction,const QString &szText,const QString &szInitialText); - QString askForNamespaceName(const QString &szAction,const QString &szText,const QString &szInitialText); -// - bool itemExists(QTreeWidgetItem *pSearchFor); - bool namespaceExists(QString &szFullItemName); - bool aliasExists(QString &szFullItemName); - void appendAllItems(KviPointerList * l,AliasEditorTreeWidgetItem::Type); - void appendAllItemsRecursive(KviPointerList * l,QTreeWidgetItem * pStartFrom,AliasEditorTreeWidgetItem::Type); + bool removeItem(AliasEditorTreeWidgetItem * it, bool * pbYesToAll, bool bDeleteEmptyTree); + void removeItemChildren(AliasEditorTreeWidgetItem * it); + + QString askForAliasName(const QString & szAction, const QString & szText, const QString & szInitialText); + QString askForNamespaceName(const QString & szAction, const QString & szText, const QString & szInitialText); + // + bool itemExists(QTreeWidgetItem * pSearchFor); + bool namespaceExists(QString & szFullItemName); + bool aliasExists(QString & szFullItemName); + void appendAllItems(KviPointerList * l, AliasEditorTreeWidgetItem::Type); + void appendAllItemsRecursive(KviPointerList * l, QTreeWidgetItem * pStartFrom, AliasEditorTreeWidgetItem::Type); bool hasSelectedItems(); - void buildAliasesFile(KviPointerList *l, QString & szBuffer); + void buildAliasesFile(KviPointerList * l, QString & szBuffer); - void buildFullItemPath(AliasEditorTreeWidgetItem * it,QString &szBuffer); - AliasEditorTreeWidgetItem * findTopLevelItem(const QString &szName); - AliasEditorTreeWidgetItem * createFullItem(const QString &szFullName); - AliasEditorTreeWidgetItem * findItem(const QString &szName); + void buildFullItemPath(AliasEditorTreeWidgetItem * it, QString & szBuffer); + AliasEditorTreeWidgetItem * findTopLevelItem(const QString & szName); + AliasEditorTreeWidgetItem * createFullItem(const QString & szFullName); + AliasEditorTreeWidgetItem * findItem(const QString & szName); QString buildFullItemName(AliasEditorTreeWidgetItem * it); }; - class AliasEditorWindow : public KviWindow { Q_OBJECT public: AliasEditorWindow(); ~AliasEditorWindow(); + protected: AliasEditorWidget * m_pEditor; + protected: virtual QPixmap * myIconPtr(); - virtual void getConfigGroupName(QString &szName); + virtual void getConfigGroupName(QString & szName); virtual void saveProperties(KviConfigurationFile *); virtual void loadProperties(KviConfigurationFile *); protected slots: diff --git a/src/modules/aliaseditor/libkvialiaseditor.cpp b/src/modules/aliaseditor/libkvialiaseditor.cpp index 079312cc5..e7c0fbbab 100644 --- a/src/modules/aliaseditor/libkvialiaseditor.cpp +++ b/src/modules/aliaseditor/libkvialiaseditor.cpp @@ -28,11 +28,9 @@ #include "KviLocale.h" #include "KviMainWindow.h" - AliasEditorWindow * g_pAliasEditorWindow = 0; KviModule * g_pAliasEditorModule = 0; - /* @doc: aliaseditor.open @type: @@ -62,13 +60,13 @@ static bool aliaseditor_kvs_cmd_open(KviKvsModuleCommandCall *) static bool aliaseditor_module_init(KviModule * m) { - KVSM_REGISTER_SIMPLE_COMMAND(m,"open",aliaseditor_kvs_cmd_open); + KVSM_REGISTER_SIMPLE_COMMAND(m, "open", aliaseditor_kvs_cmd_open); g_pAliasEditorWindow = 0; g_pAliasEditorModule = m; return true; } -static bool aliaseditor_module_can_unload(KviModule * ) +static bool aliaseditor_module_can_unload(KviModule *) { return (g_pAliasEditorWindow == 0); } @@ -82,13 +80,12 @@ static bool aliaseditor_module_cleanup(KviModule *) } KVIRC_MODULE( - "AliasEditor", // module name - "4.0.0", // module version - "Copyright (C) 2002-2010 Szymon Stefanek (pragma at kvirc dot net)", // author & (C) - "Editor for the script aliases", - aliaseditor_module_init, - aliaseditor_module_can_unload, - 0, - aliaseditor_module_cleanup, - "editor" -) + "AliasEditor", // module name + "4.0.0", // module version + "Copyright (C) 2002-2010 Szymon Stefanek (pragma at kvirc dot net)", // author & (C) + "Editor for the script aliases", + aliaseditor_module_init, + aliaseditor_module_can_unload, + 0, + aliaseditor_module_cleanup, + "editor") diff --git a/src/modules/avatar/libkviavatar.cpp b/src/modules/avatar/libkviavatar.cpp index cbd2c7884..7f4f1fbca 100644 --- a/src/modules/avatar/libkviavatar.cpp +++ b/src/modules/avatar/libkviavatar.cpp @@ -58,8 +58,8 @@ static KviPointerList * g_pAvatarSelectionDialogList = 0; extern KVIRC_API KviSharedFilesManager * g_pSharedFilesManager; -KviAsyncAvatarSelectionDialog::KviAsyncAvatarSelectionDialog(QWidget * par,const QString &szInitialPath,KviIrcConnection * c) -: QDialog(par) +KviAsyncAvatarSelectionDialog::KviAsyncAvatarSelectionDialog(QWidget * par, const QString & szInitialPath, KviIrcConnection * c) + : QDialog(par) { setModal(false); setWindowFlags(Qt::Dialog | Qt::MSWindowsFixedSizeDialogHint | Qt::WindowStaysOnTopHint); @@ -71,18 +71,18 @@ KviAsyncAvatarSelectionDialog::KviAsyncAvatarSelectionDialog(QWidget * par,const QGridLayout * g = new QGridLayout(this); QString msg = "
"; - msg += __tr2qs("Please select an avatar image. " \ - "The full path to a local file or an image on the Web can be used.
" \ - "If you wish to use a local image file, click the \"Browse\" button to select the desired file.
" \ - "The full URL for an image (including http:// or https://) can also be entered manually."); + msg += __tr2qs("Please select an avatar image. " + "The full path to a local file or an image on the Web can be used.
" + "If you wish to use a local image file, click the \"Browse\" button to select the desired file.
" + "The full URL for an image (including http:// or https://) can also be entered manually."); msg += "

"; - QLabel * l = new QLabel(msg,this); + QLabel * l = new QLabel(msg, this); l->setWordWrap(true); l->setMinimumWidth(250); //g->addMultiCellWidget(l,0,0,0,2); - g->addWidget(l,0,0); + g->addWidget(l, 0, 0); KviTalHBox * h1 = new KviTalHBox(this); m_pLineEdit = new QLineEdit(h1); @@ -90,27 +90,26 @@ KviAsyncAvatarSelectionDialog::KviAsyncAvatarSelectionDialog(QWidget * par,const m_pLineEdit->setMinimumWidth(180); //g->addMultiCellWidget(m_pLineEdit,1,1,0,1); - QPushButton * b = new QPushButton(__tr2qs("&Browse..."),h1); - g->addWidget(h1,1,0); - connect(b,SIGNAL(clicked()),this,SLOT(chooseFileClicked())); + QPushButton * b = new QPushButton(__tr2qs("&Browse..."), h1); + g->addWidget(h1, 1, 0); + connect(b, SIGNAL(clicked()), this, SLOT(chooseFileClicked())); //g->addWidget(b,1,2); - KviTalHBox * h = new KviTalHBox(this); h->setSpacing(8); - g->addWidget(h,2,0); -// g->addMultiCellWidget(h,2,2,1,2); - b = new QPushButton(__tr2qs("&OK"),h); + g->addWidget(h, 2, 0); + // g->addMultiCellWidget(h,2,2,1,2); + b = new QPushButton(__tr2qs("&OK"), h); b->setMinimumWidth(80); b->setDefault(true); - connect(b,SIGNAL(clicked()),this,SLOT(okClicked())); + connect(b, SIGNAL(clicked()), this, SLOT(okClicked())); - b = new QPushButton(__tr2qs("Cancel"),h); + b = new QPushButton(__tr2qs("Cancel"), h); b->setMinimumWidth(80); - connect(b,SIGNAL(clicked()),this,SLOT(cancelClicked())); + connect(b, SIGNAL(clicked()), this, SLOT(cancelClicked())); - g->setRowStretch(0,1); - g->setColumnStretch(0,1); + g->setRowStretch(0, 1); + g->setColumnStretch(0, 1); } KviAsyncAvatarSelectionDialog::~KviAsyncAvatarSelectionDialog() @@ -122,14 +121,15 @@ void KviAsyncAvatarSelectionDialog::okClicked() { m_szAvatarName = m_pLineEdit->text(); - if(!g_pApp->connectionExists(m_pConnection))return; // the connection no longer exists :/ + if(!g_pApp->connectionExists(m_pConnection)) + return; // the connection no longer exists :/ if(!m_szAvatarName.isEmpty()) { QString tmp = m_szAvatarName; KviQString::escapeKvs(&tmp, KviQString::EscapeSpace); - QString szBuffer=QString("avatar.set %1").arg(tmp); - KviKvsScript::run(szBuffer,m_pConnection->console()); + QString szBuffer = QString("avatar.set %1").arg(tmp); + KviKvsScript::run(szBuffer, m_pConnection->console()); } accept(); @@ -146,16 +146,14 @@ void KviAsyncAvatarSelectionDialog::chooseFileClicked() { QString tmp; if( - KviFileDialog::askForOpenFileName( - tmp, - __tr2qs("Select a File - KVIrc"), - QString(), - QString(), - false, - true, - this - ) - ) + KviFileDialog::askForOpenFileName( + tmp, + __tr2qs("Select a File - KVIrc"), + QString(), + QString(), + false, + true, + this)) { m_pLineEdit->setText(tmp); } @@ -204,7 +202,7 @@ static bool avatar_kvs_cmd_set(KviKvsModuleCommandCall * c) { QString szAvatar; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("avatar",KVS_PT_NONEMPTYSTRING,KVS_PF_OPTIONAL,szAvatar) + KVSM_PARAMETER("avatar", KVS_PT_NONEMPTYSTRING, KVS_PF_OPTIONAL, szAvatar) KVSM_PARAMETERS_END(c) KVSM_REQUIRE_CONNECTION(c) @@ -213,7 +211,7 @@ static bool avatar_kvs_cmd_set(KviKvsModuleCommandCall * c) if(szAvatar.isEmpty()) { - KviAsyncAvatarSelectionDialog * d = new KviAsyncAvatarSelectionDialog(g_pMainWindow,QString(),c->window()->connection()); + KviAsyncAvatarSelectionDialog * d = new KviAsyncAvatarSelectionDialog(g_pMainWindow, QString(), c->window()->connection()); d->show(); return true; } @@ -227,21 +225,20 @@ static bool avatar_kvs_cmd_set(KviKvsModuleCommandCall * c) return true; } - KviAvatar * av = g_pIconManager->getAvatar(QString(),szAvatar); + KviAvatar * av = g_pIconManager->getAvatar(QString(), szAvatar); if(av) { // Ok...got it... e->setAvatar(av); c->window()->console()->avatarChanged(av, - c->window()->connection()->userInfo()->nickName(), - c->window()->connection()->userInfo()->userName(), - c->window()->connection()->userInfo()->hostName(), - QString()); - } else { - bool bIsUrl = ( - (KviQString::equalCIN(szAvatar,"http://",7) && (szAvatar.length() > 7)) || - (KviQString::equalCIN(szAvatar,"https://",8) && (szAvatar.length() > 8)) - ); + c->window()->connection()->userInfo()->nickName(), + c->window()->connection()->userInfo()->userName(), + c->window()->connection()->userInfo()->hostName(), + QString()); + } + else + { + bool bIsUrl = ((KviQString::equalCIN(szAvatar, "http://", 7) && (szAvatar.length() > 7)) || (KviQString::equalCIN(szAvatar, "https://", 8) && (szAvatar.length() > 8))); if(bIsUrl) { @@ -249,28 +246,32 @@ static bool avatar_kvs_cmd_set(KviKvsModuleCommandCall * c) QString szLocalFilePath; QString szLocalFile = szAvatar; g_pIconManager->urlToCachedFileName(szLocalFile); - g_pApp->getLocalKvircDirectory(szLocalFilePath,KviApplication::Avatars,szLocalFile); + g_pApp->getLocalKvircDirectory(szLocalFilePath, KviApplication::Avatars, szLocalFile); KviQString::escapeKvs(&szAvatar); KviQString::escapeKvs(&szLocalFilePath); QString szCommand = "http.get -w=nm "; // -i=e? - szCommand += szAvatar; - szCommand += " "; - szCommand += szLocalFilePath; + szCommand += szAvatar; + szCommand += " "; + szCommand += szLocalFilePath; - if(KviKvsScript::run(szCommand,c->window()->console())) + if(KviKvsScript::run(szCommand, c->window()->console())) { g_pApp->setAvatarOnFileReceived(c->window()->console(), - szAvatar, - c->window()->connection()->userInfo()->nickName(), - c->window()->connection()->userInfo()->userName(), - c->window()->connection()->userInfo()->hostName()); - } else { - c->warning(__tr2qs("Can't set the current avatar to '%Q': failed to start the http transfer"),&szAvatar); + szAvatar, + c->window()->connection()->userInfo()->nickName(), + c->window()->connection()->userInfo()->userName(), + c->window()->connection()->userInfo()->hostName()); + } + else + { + c->warning(__tr2qs("Can't set the current avatar to '%Q': failed to start the http transfer"), &szAvatar); return true; } - } else { - c->warning(__tr2qs("Can't set the current avatar to '%Q': can't load the image"),&szAvatar); + } + else + { + c->warning(__tr2qs("Can't set the current avatar to '%Q': can't load the image"), &szAvatar); return true; } } @@ -278,7 +279,6 @@ static bool avatar_kvs_cmd_set(KviKvsModuleCommandCall * c) return true; } - /* @doc: avatar.unset @type: @@ -310,10 +310,10 @@ static bool avatar_kvs_cmd_unset(KviKvsModuleCommandCall * c) e->setAvatar(0); c->window()->console()->avatarChanged(0, - c->window()->connection()->userInfo()->nickName(), - c->window()->connection()->userInfo()->userName(), - c->window()->connection()->userInfo()->hostName(), - QString()); + c->window()->connection()->userInfo()->nickName(), + c->window()->connection()->userInfo()->userName(), + c->window()->connection()->userInfo()->hostName(), + QString()); return true; } @@ -361,17 +361,17 @@ static bool avatar_kvs_cmd_notify(KviKvsModuleCommandCall * c) { QString szTarget; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("target",KVS_PT_NONEMPTYSTRING,0,szTarget) + KVSM_PARAMETER("target", KVS_PT_NONEMPTYSTRING, 0, szTarget) KVSM_PARAMETERS_END(c) KVSM_REQUIRE_CONNECTION(c) kvs_int_t iTimeout = (kvs_int_t)KVI_OPTION_UINT(KviOption_uintAvatarOfferTimeoutInSecs); - if(KviKvsVariant * pTimeout = c->switches()->find('t',"timeout")) + if(KviKvsVariant * pTimeout = c->switches()->find('t', "timeout")) { if(!pTimeout->asInteger(iTimeout)) { - if(!c->switches()->find('q',"quiet")) + if(!c->switches()->find('q', "quiet")) c->warning(__tr2qs("Invalid timeout specified, using default")); } } @@ -383,7 +383,7 @@ static bool avatar_kvs_cmd_notify(KviKvsModuleCommandCall * c) return true; } - QString absPath,avatar; + QString absPath, avatar; if(e->avatar()) { @@ -391,46 +391,48 @@ static bool avatar_kvs_cmd_notify(KviKvsModuleCommandCall * c) QString szTmp = e->avatar()->name(); if(KVI_OPTION_BOOL(KviOption_boolDCCFileTransferReplaceOutgoingSpacesWithUnderscores)) - szTmp.replace(" ","_"); + szTmp.replace(" ", "_"); // escape the spaces with the right octal code - KviIrcServerParser::encodeCtcpParameter(szTmp.toUtf8().data(),avatar); + KviIrcServerParser::encodeCtcpParameter(szTmp.toUtf8().data(), avatar); } KviSharedFile * o = 0; if((!absPath.isEmpty()) && (!avatar.isEmpty())) { bool bTargetIsChan = (szTarget.contains('#') || szTarget.contains('&') || szTarget.contains('!') || szTarget.contains('+')); - if(bTargetIsChan)o = g_pSharedFilesManager->lookupSharedFile(avatar,0); - else { + if(bTargetIsChan) + o = g_pSharedFilesManager->lookupSharedFile(avatar, 0); + else + { KviIrcMask u(szTarget); - o = g_pSharedFilesManager->lookupSharedFile(avatar,&u); + o = g_pSharedFilesManager->lookupSharedFile(avatar, &u); } if(!o) { // FIXME: #warning "OPTION FOR PERMANENT OR TIMEDOUT OFFER...TIMEDOUT WOULD ALSO NEED TO EXTEND EXISTING OFFERS LIFETIME" QString szUserMask = bTargetIsChan ? QString("*") : szTarget; szUserMask += "!*@*"; - o = g_pSharedFilesManager->addSharedFile(avatar,absPath,szUserMask,iTimeout); + o = g_pSharedFilesManager->addSharedFile(avatar, absPath, szUserMask, iTimeout); if(!o) { // Don't delete o...it has been already deleted by g_pFileTrader - if(!c->switches()->find('q',"quiet")) - c->warning(__tr2qs("Can't add a file offer for file %Q (huh? file not readable?)"),&absPath); + if(!c->switches()->find('q', "quiet")) + c->warning(__tr2qs("Can't add a file offer for file %Q (huh? file not readable?)"), &absPath); return true; } if(_OUTPUT_VERBOSE) { - if(!c->switches()->find('q',"quiet")) - c->window()->output(KVI_OUT_SYSTEMMESSAGE,__tr2qs("Added %d secs file offer for file %Q (%Q) and receiver %Q"), - iTimeout,&(o->absFilePath()),&avatar,&(o->userMask())); + if(!c->switches()->find('q', "quiet")) + c->window()->output(KVI_OUT_SYSTEMMESSAGE, __tr2qs("Added %d secs file offer for file %Q (%Q) and receiver %Q"), + iTimeout, &(o->absFilePath()), &avatar, &(o->userMask())); } } } - if(!c->switches()->find('q',"quiet")) - c->window()->output(KVI_OUT_AVATAR,__tr2qs("Notifying avatar '%Q' to %Q"),&avatar,&szTarget); + if(!c->switches()->find('q', "quiet")) + c->window()->output(KVI_OUT_AVATAR, __tr2qs("Notifying avatar '%Q' to %Q"), &avatar, &szTarget); QByteArray encodedTarget = c->window()->connection()->encodeText(szTarget); @@ -440,14 +442,18 @@ static bool avatar_kvs_cmd_notify(KviKvsModuleCommandCall * c) if(o) { - c->window()->connection()->sendFmtData("NOTICE %s :%cAVATAR %s %u%c",encodedTarget.data(),0x01, - encodedAvatar.data(),o->fileSize(),0x01); - } else { - c->window()->connection()->sendFmtData("NOTICE %s :%cAVATAR %s%c",encodedTarget.data(),0x01, - encodedAvatar.data(),0x01); + c->window()->connection()->sendFmtData("NOTICE %s :%cAVATAR %s %u%c", encodedTarget.data(), 0x01, + encodedAvatar.data(), o->fileSize(), 0x01); + } + else + { + c->window()->connection()->sendFmtData("NOTICE %s :%cAVATAR %s%c", encodedTarget.data(), 0x01, + encodedAvatar.data(), 0x01); } - } else { - c->window()->connection()->sendFmtData("NOTICE %s :%cAVATAR%c",encodedTarget.data(),0x01,0x01); + } + else + { + c->window()->connection()->sendFmtData("NOTICE %s :%cAVATAR%c", encodedTarget.data(), 0x01, 0x01); } return true; @@ -477,12 +483,13 @@ static bool avatar_kvs_fnc_name(KviKvsModuleFunctionCall * c) { QString szNick; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("nick",KVS_PT_STRING,KVS_PF_OPTIONAL,szNick) + KVSM_PARAMETER("nick", KVS_PT_STRING, KVS_PF_OPTIONAL, szNick) KVSM_PARAMETERS_END(c) KVSM_REQUIRE_CONNECTION(c) - if(szNick.isEmpty())szNick = c->window()->connection()->currentNickName(); + if(szNick.isEmpty()) + szNick = c->window()->connection()->currentNickName(); KviIrcUserEntry * e = c->window()->connection()->userDataBase()->find(szNick); if(e) @@ -521,12 +528,13 @@ static bool avatar_kvs_fnc_path(KviKvsModuleFunctionCall * c) { QString szNick; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("path",KVS_PT_STRING,KVS_PF_OPTIONAL,szNick) + KVSM_PARAMETER("path", KVS_PT_STRING, KVS_PF_OPTIONAL, szNick) KVSM_PARAMETERS_END(c) KVSM_REQUIRE_CONNECTION(c) - if(szNick.isEmpty())szNick = c->window()->connection()->currentNickName(); + if(szNick.isEmpty()) + szNick = c->window()->connection()->currentNickName(); KviIrcUserEntry * e = c->window()->connection()->userDataBase()->find(szNick); if(e) @@ -563,13 +571,13 @@ static bool avatar_kvs_cmd_query(KviKvsModuleCommandCall * c) { QString szName; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("target",KVS_PT_NONEMPTYSTRING,0,szName) + KVSM_PARAMETER("target", KVS_PT_NONEMPTYSTRING, 0, szName) KVSM_PARAMETERS_END(c) KVSM_REQUIRE_CONNECTION(c) QByteArray target = c->window()->connection()->encodeText(szName); - c->window()->connection()->sendFmtData("PRIVMSG %s :%cAVATAR%c",target.data(),0x01,0x01); + c->window()->connection()->sendFmtData("PRIVMSG %s :%cAVATAR%c", target.data(), 0x01, 0x01); return true; } @@ -579,13 +587,13 @@ static bool avatar_module_init(KviModule * m) g_pAvatarSelectionDialogList = new KviPointerList; g_pAvatarSelectionDialogList->setAutoDelete(false); - KVSM_REGISTER_SIMPLE_COMMAND(m,"query",avatar_kvs_cmd_query); - KVSM_REGISTER_SIMPLE_COMMAND(m,"set",avatar_kvs_cmd_set); - KVSM_REGISTER_SIMPLE_COMMAND(m,"unset",avatar_kvs_cmd_unset); - KVSM_REGISTER_SIMPLE_COMMAND(m,"notify",avatar_kvs_cmd_notify); + KVSM_REGISTER_SIMPLE_COMMAND(m, "query", avatar_kvs_cmd_query); + KVSM_REGISTER_SIMPLE_COMMAND(m, "set", avatar_kvs_cmd_set); + KVSM_REGISTER_SIMPLE_COMMAND(m, "unset", avatar_kvs_cmd_unset); + KVSM_REGISTER_SIMPLE_COMMAND(m, "notify", avatar_kvs_cmd_notify); - KVSM_REGISTER_FUNCTION(m,"name",avatar_kvs_fnc_name); - KVSM_REGISTER_FUNCTION(m,"path",avatar_kvs_fnc_path); + KVSM_REGISTER_FUNCTION(m, "name", avatar_kvs_fnc_name); + KVSM_REGISTER_FUNCTION(m, "path", avatar_kvs_fnc_path); return true; } @@ -604,13 +612,12 @@ static bool avatar_module_cleanup(KviModule *) } KVIRC_MODULE( - "Avatar", - "4.0.0", - "Copyright (C) 2004 Szymon Stefanek (pragma at kvirc dot net)", - "Avatar manipulation routines", - avatar_module_init, - avatar_module_can_unload, - 0, - avatar_module_cleanup, - 0 -) + "Avatar", + "4.0.0", + "Copyright (C) 2004 Szymon Stefanek (pragma at kvirc dot net)", + "Avatar manipulation routines", + avatar_module_init, + avatar_module_can_unload, + 0, + avatar_module_cleanup, + 0) diff --git a/src/modules/avatar/libkviavatar.h b/src/modules/avatar/libkviavatar.h index ed9bf4163..60b71af8d 100644 --- a/src/modules/avatar/libkviavatar.h +++ b/src/modules/avatar/libkviavatar.h @@ -36,20 +36,21 @@ class KviAsyncAvatarSelectionDialog : public QDialog { Q_OBJECT public: - KviAsyncAvatarSelectionDialog(QWidget * par,const QString &szInitialPath,KviIrcConnection * c); + KviAsyncAvatarSelectionDialog(QWidget * par, const QString & szInitialPath, KviIrcConnection * c); ~KviAsyncAvatarSelectionDialog(); + protected: - QLineEdit * m_pLineEdit; - QString m_szAvatarName; + QLineEdit * m_pLineEdit; + QString m_szAvatarName; KviIrcConnection * m_pConnection; + protected: virtual void closeEvent(QCloseEvent * e); - const QString &avatarName(){ return m_szAvatarName; }; + const QString & avatarName() { return m_szAvatarName; }; protected slots: void okClicked(); void cancelClicked(); void chooseFileClicked(); }; - #endif //!_LIBKVIAVATAR_H_ diff --git a/src/modules/chan/libkvichan.cpp b/src/modules/chan/libkvichan.cpp index 893535cc3..119339c2d 100644 --- a/src/modules/chan/libkvichan.cpp +++ b/src/modules/chan/libkvichan.cpp @@ -40,19 +40,28 @@ static KviChannelWindow * chan_kvs_find_channel(KviKvsModuleFunctionCall * c, QS { if(szChan.isEmpty()) { - if(c->window()->type() == KviWindow::Channel)return (KviChannelWindow *)(c->window()); - if(c->window()->type() == KviWindow::DeadChannel)return (KviChannelWindow *)(c->window()); - if(!bNoWarnings) c->warning(__tr2qs("The current window is not a channel")); - } else { + if(c->window()->type() == KviWindow::Channel) + return (KviChannelWindow *)(c->window()); + if(c->window()->type() == KviWindow::DeadChannel) + return (KviChannelWindow *)(c->window()); + if(!bNoWarnings) + c->warning(__tr2qs("The current window is not a channel")); + } + else + { KviWindow * w = g_pApp->findWindow(szChan); if(!w) { - if(!bNoWarnings) c->warning(__tr2qs("Can't find the window with ID '%Q'"),&szChan); + if(!bNoWarnings) + c->warning(__tr2qs("Can't find the window with ID '%Q'"), &szChan); return 0; } - if(w->type() == KviWindow::Channel)return (KviChannelWindow *)w; - if(w->type() == KviWindow::DeadChannel)return (KviChannelWindow *)w; - if(!bNoWarnings) c->warning(__tr2qs("The specified window (%Q) is not a channel"),&szChan); + if(w->type() == KviWindow::Channel) + return (KviChannelWindow *)w; + if(w->type() == KviWindow::DeadChannel) + return (KviChannelWindow *)w; + if(!bNoWarnings) + c->warning(__tr2qs("The specified window (%Q) is not a channel"), &szChan); } return 0; } @@ -80,10 +89,11 @@ static bool chan_kvs_fnc_name(KviKvsModuleFunctionCall * c) { QString szId; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("window id",KVS_PT_STRING,KVS_PF_OPTIONAL,szId) + KVSM_PARAMETER("window id", KVS_PT_STRING, KVS_PF_OPTIONAL, szId) KVSM_PARAMETERS_END(c) - KviChannelWindow * ch = chan_kvs_find_channel(c,szId); - if (ch) { + KviChannelWindow * ch = chan_kvs_find_channel(c, szId); + if(ch) + { c->returnValue()->setString(ch->windowName()); } return true; @@ -107,24 +117,30 @@ static bool chan_kvs_fnc_name(KviKvsModuleFunctionCall * c) static bool chan_kvs_fnc_getUrl(KviKvsModuleFunctionCall * c) { - QString szId,url; + QString szId, url; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("channel id",KVS_PT_STRING,KVS_PF_OPTIONAL,szId) + KVSM_PARAMETER("channel id", KVS_PT_STRING, KVS_PF_OPTIONAL, szId) KVSM_PARAMETERS_END(c) - KviChannelWindow * ch = chan_kvs_find_channel(c,szId,true); - if (ch) { - KviIrcUrl::join(url,ch->connection()->target()->server()); + KviChannelWindow * ch = chan_kvs_find_channel(c, szId, true); + if(ch) + { + KviIrcUrl::join(url, ch->connection()->target()->server()); url.append(ch->windowName()); if(ch->hasChannelMode('k')) { url.append("?"); url.append(ch->channelModeParam('k')); } - } else { - if(c->window()->connection()) { - KviIrcUrl::join(url,c->window()->connection()->target()->server()); + } + else + { + if(c->window()->connection()) + { + KviIrcUrl::join(url, c->window()->connection()->target()->server()); url.append(szId); - } else { + } + else + { c->error("There is no active IRC connection for current context"); } } @@ -152,10 +168,11 @@ static bool chan_kvs_fnc_isdead(KviKvsModuleFunctionCall * c) { QString szId; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("window id",KVS_PT_STRING,KVS_PF_OPTIONAL,szId) + KVSM_PARAMETER("window id", KVS_PT_STRING, KVS_PF_OPTIONAL, szId) KVSM_PARAMETERS_END(c) - KviChannelWindow * ch = chan_kvs_find_channel(c,szId); - if (ch) c->returnValue()->setBoolean((ch->type() == KviWindow::DeadChannel)); + KviChannelWindow * ch = chan_kvs_find_channel(c, szId); + if(ch) + c->returnValue()->setBoolean((ch->type() == KviWindow::DeadChannel)); return true; } @@ -186,10 +203,11 @@ static bool chan_kvs_fnc_topic(KviKvsModuleFunctionCall * c) { QString szId; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("window id",KVS_PT_STRING,KVS_PF_OPTIONAL,szId) + KVSM_PARAMETER("window id", KVS_PT_STRING, KVS_PF_OPTIONAL, szId) KVSM_PARAMETERS_END(c) - KviChannelWindow * ch = chan_kvs_find_channel(c,szId); - if (ch) c->returnValue()->setString(ch->topicWidget()->topic()); + KviChannelWindow * ch = chan_kvs_find_channel(c, szId); + if(ch) + c->returnValue()->setString(ch->topicWidget()->topic()); return true; } @@ -220,10 +238,11 @@ static bool chan_kvs_fnc_topicsetby(KviKvsModuleFunctionCall * c) { QString szId; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("window id",KVS_PT_STRING,KVS_PF_OPTIONAL,szId) + KVSM_PARAMETER("window id", KVS_PT_STRING, KVS_PF_OPTIONAL, szId) KVSM_PARAMETERS_END(c) - KviChannelWindow * ch = chan_kvs_find_channel(c,szId); - if (ch) c->returnValue()->setString(ch->topicWidget()->topicSetBy()); + KviChannelWindow * ch = chan_kvs_find_channel(c, szId); + if(ch) + c->returnValue()->setString(ch->topicWidget()->topicSetBy()); return true; } @@ -254,10 +273,11 @@ static bool chan_kvs_fnc_topicsetat(KviKvsModuleFunctionCall * c) { QString szId; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("window id",KVS_PT_STRING,KVS_PF_OPTIONAL,szId) + KVSM_PARAMETER("window id", KVS_PT_STRING, KVS_PF_OPTIONAL, szId) KVSM_PARAMETERS_END(c) - KviChannelWindow * ch = chan_kvs_find_channel(c,szId); - if (ch) c->returnValue()->setString(ch->topicWidget()->topicSetAt()); + KviChannelWindow * ch = chan_kvs_find_channel(c, szId); + if(ch) + c->returnValue()->setString(ch->topicWidget()->topicSetAt()); return true; } @@ -286,10 +306,11 @@ static bool chan_kvs_fnc_usercount(KviKvsModuleFunctionCall * c) { QString szId; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("window id",KVS_PT_STRING,KVS_PF_OPTIONAL,szId) + KVSM_PARAMETER("window id", KVS_PT_STRING, KVS_PF_OPTIONAL, szId) KVSM_PARAMETERS_END(c) - KviChannelWindow * ch = chan_kvs_find_channel(c,szId); - if (ch) c->returnValue()->setInteger(ch->count()); + KviChannelWindow * ch = chan_kvs_find_channel(c, szId); + if(ch) + c->returnValue()->setInteger(ch->count()); return true; } @@ -318,10 +339,11 @@ static bool chan_kvs_fnc_ownercount(KviKvsModuleFunctionCall * c) { QString szId; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("window id",KVS_PT_STRING,KVS_PF_OPTIONAL,szId) + KVSM_PARAMETER("window id", KVS_PT_STRING, KVS_PF_OPTIONAL, szId) KVSM_PARAMETERS_END(c) - KviChannelWindow * ch = chan_kvs_find_channel(c,szId); - if (ch) c->returnValue()->setInteger(ch->chanOwnerCount()); + KviChannelWindow * ch = chan_kvs_find_channel(c, szId); + if(ch) + c->returnValue()->setInteger(ch->chanOwnerCount()); return true; } @@ -350,10 +372,11 @@ static bool chan_kvs_fnc_admincount(KviKvsModuleFunctionCall * c) { QString szId; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("window id",KVS_PT_STRING,KVS_PF_OPTIONAL,szId) + KVSM_PARAMETER("window id", KVS_PT_STRING, KVS_PF_OPTIONAL, szId) KVSM_PARAMETERS_END(c) - KviChannelWindow * ch = chan_kvs_find_channel(c,szId); - if (ch) c->returnValue()->setInteger(ch->chanAdminCount()); + KviChannelWindow * ch = chan_kvs_find_channel(c, szId); + if(ch) + c->returnValue()->setInteger(ch->chanAdminCount()); return true; } @@ -382,10 +405,11 @@ static bool chan_kvs_fnc_opcount(KviKvsModuleFunctionCall * c) { QString szId; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("window id",KVS_PT_STRING,KVS_PF_OPTIONAL,szId) + KVSM_PARAMETER("window id", KVS_PT_STRING, KVS_PF_OPTIONAL, szId) KVSM_PARAMETERS_END(c) - KviChannelWindow * ch = chan_kvs_find_channel(c,szId); - if (ch) c->returnValue()->setInteger(ch->opCount()); + KviChannelWindow * ch = chan_kvs_find_channel(c, szId); + if(ch) + c->returnValue()->setInteger(ch->opCount()); return true; } @@ -414,10 +438,11 @@ static bool chan_kvs_fnc_voicecount(KviKvsModuleFunctionCall * c) { QString szId; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("window id",KVS_PT_STRING,KVS_PF_OPTIONAL,szId) + KVSM_PARAMETER("window id", KVS_PT_STRING, KVS_PF_OPTIONAL, szId) KVSM_PARAMETERS_END(c) - KviChannelWindow * ch = chan_kvs_find_channel(c,szId); - if (ch) c->returnValue()->setInteger(ch->voiceCount()); + KviChannelWindow * ch = chan_kvs_find_channel(c, szId); + if(ch) + c->returnValue()->setInteger(ch->voiceCount()); return true; } @@ -446,10 +471,11 @@ static bool chan_kvs_fnc_halfopcount(KviKvsModuleFunctionCall * c) { QString szId; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("window id",KVS_PT_STRING,KVS_PF_OPTIONAL,szId) + KVSM_PARAMETER("window id", KVS_PT_STRING, KVS_PF_OPTIONAL, szId) KVSM_PARAMETERS_END(c) - KviChannelWindow * ch = chan_kvs_find_channel(c,szId); - if (ch) c->returnValue()->setInteger(ch->halfOpCount()); + KviChannelWindow * ch = chan_kvs_find_channel(c, szId); + if(ch) + c->returnValue()->setInteger(ch->halfOpCount()); return true; } @@ -478,10 +504,11 @@ static bool chan_kvs_fnc_useropcount(KviKvsModuleFunctionCall * c) { QString szId; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("window id",KVS_PT_STRING,KVS_PF_OPTIONAL,szId) + KVSM_PARAMETER("window id", KVS_PT_STRING, KVS_PF_OPTIONAL, szId) KVSM_PARAMETERS_END(c) - KviChannelWindow * ch = chan_kvs_find_channel(c,szId); - if (ch) c->returnValue()->setInteger(ch->userOpCount()); + KviChannelWindow * ch = chan_kvs_find_channel(c, szId); + if(ch) + c->returnValue()->setInteger(ch->userOpCount()); return true; } @@ -510,10 +537,11 @@ static bool chan_kvs_fnc_bancount(KviKvsModuleFunctionCall * c) { QString szId; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("window id",KVS_PT_STRING,KVS_PF_OPTIONAL,szId) + KVSM_PARAMETER("window id", KVS_PT_STRING, KVS_PF_OPTIONAL, szId) KVSM_PARAMETERS_END(c) - KviChannelWindow * ch = chan_kvs_find_channel(c,szId); - if (ch) c->returnValue()->setInteger(ch->maskCount('b')); + KviChannelWindow * ch = chan_kvs_find_channel(c, szId); + if(ch) + c->returnValue()->setInteger(ch->maskCount('b')); return true; } @@ -542,10 +570,11 @@ static bool chan_kvs_fnc_banexceptioncount(KviKvsModuleFunctionCall * c) { QString szId; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("window id",KVS_PT_STRING,KVS_PF_OPTIONAL,szId) + KVSM_PARAMETER("window id", KVS_PT_STRING, KVS_PF_OPTIONAL, szId) KVSM_PARAMETERS_END(c) - KviChannelWindow * ch = chan_kvs_find_channel(c,szId); - if (ch) c->returnValue()->setInteger(ch->maskCount('e')); + KviChannelWindow * ch = chan_kvs_find_channel(c, szId); + if(ch) + c->returnValue()->setInteger(ch->maskCount('e')); return true; } @@ -573,10 +602,11 @@ static bool chan_kvs_fnc_invitecount(KviKvsModuleFunctionCall * c) { QString szId; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("window id",KVS_PT_STRING,KVS_PF_OPTIONAL,szId) + KVSM_PARAMETER("window id", KVS_PT_STRING, KVS_PF_OPTIONAL, szId) KVSM_PARAMETERS_END(c) - KviChannelWindow * ch = chan_kvs_find_channel(c,szId); - if (ch) c->returnValue()->setInteger(ch->maskCount('I')); + KviChannelWindow * ch = chan_kvs_find_channel(c, szId); + if(ch) + c->returnValue()->setInteger(ch->maskCount('I')); return true; } @@ -605,13 +635,14 @@ static bool chan_kvs_fnc_maskcount(KviKvsModuleFunctionCall * c) { QString szId, szMode; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("mode",KVS_PT_NONEMPTYSTRING,0,szMode) - KVSM_PARAMETER("window id",KVS_PT_STRING,KVS_PF_OPTIONAL,szId) + KVSM_PARAMETER("mode", KVS_PT_NONEMPTYSTRING, 0, szMode) + KVSM_PARAMETER("window id", KVS_PT_STRING, KVS_PF_OPTIONAL, szId) KVSM_PARAMETERS_END(c) char cMode = szMode.at(0).unicode(); - KviChannelWindow * ch = chan_kvs_find_channel(c,szId); - if (ch) c->returnValue()->setInteger(ch->maskCount(cMode)); + KviChannelWindow * ch = chan_kvs_find_channel(c, szId); + if(ch) + c->returnValue()->setInteger(ch->maskCount(cMode)); return true; } @@ -633,13 +664,14 @@ static bool chan_kvs_fnc_maskcount(KviKvsModuleFunctionCall * c) static bool chan_kvs_fnc_ison(KviKvsModuleFunctionCall * c) { - QString szId,szNick; + QString szId, szNick; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("nickname",KVS_PT_NONEMPTYSTRING,0,szNick) - KVSM_PARAMETER("window id",KVS_PT_STRING,KVS_PF_OPTIONAL,szId) + KVSM_PARAMETER("nickname", KVS_PT_NONEMPTYSTRING, 0, szNick) + KVSM_PARAMETER("window id", KVS_PT_STRING, KVS_PF_OPTIONAL, szId) KVSM_PARAMETERS_END(c) - KviChannelWindow * ch = chan_kvs_find_channel(c,szId); - if (ch) c->returnValue()->setBoolean(ch->isOn(szNick)); + KviChannelWindow * ch = chan_kvs_find_channel(c, szId); + if(ch) + c->returnValue()->setBoolean(ch->isOn(szNick)); return true; } @@ -670,12 +702,12 @@ static bool chan_kvs_fnc_ison(KviKvsModuleFunctionCall * c) static bool chan_kvs_fnc_getflag(KviKvsModuleFunctionCall * c) { - QString szId,szNick; + QString szId, szNick; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("nickname",KVS_PT_NONEMPTYSTRING,0,szNick) - KVSM_PARAMETER("window id",KVS_PT_STRING,KVS_PF_OPTIONAL,szId) + KVSM_PARAMETER("nickname", KVS_PT_NONEMPTYSTRING, 0, szNick) + KVSM_PARAMETER("window id", KVS_PT_STRING, KVS_PF_OPTIONAL, szId) KVSM_PARAMETERS_END(c) - KviChannelWindow * ch = chan_kvs_find_channel(c,szId); + KviChannelWindow * ch = chan_kvs_find_channel(c, szId); if(ch) { QChar cFlag = ch->userListView()->getUserFlag(szNick); @@ -683,25 +715,28 @@ static bool chan_kvs_fnc_getflag(KviKvsModuleFunctionCall * c) { QString szFlag = cFlag; c->returnValue()->setString(szFlag); - } else { + } + else + { c->returnValue()->setNothing(); } } return true; } -#define IS_KVS_FUNC(__clbkname,__chanfunc) \ -static bool __clbkname(KviKvsModuleFunctionCall * c) \ -{ \ - QString szId,szNick;\ - KVSM_PARAMETERS_BEGIN(c)\ - KVSM_PARAMETER("nickname",KVS_PT_NONEMPTYSTRING,0,szNick)\ - KVSM_PARAMETER("window id",KVS_PT_STRING,KVS_PF_OPTIONAL,szId)\ - KVSM_PARAMETERS_END(c)\ - KviChannelWindow * ch = chan_kvs_find_channel(c,szId); \ - if(ch) c->returnValue()->setBoolean(ch->__chanfunc(szNick,true)); \ - return true; \ -} +#define IS_KVS_FUNC(__clbkname, __chanfunc) \ + static bool __clbkname(KviKvsModuleFunctionCall * c) \ + { \ + QString szId, szNick; \ + KVSM_PARAMETERS_BEGIN(c) \ + KVSM_PARAMETER("nickname", KVS_PT_NONEMPTYSTRING, 0, szNick) \ + KVSM_PARAMETER("window id", KVS_PT_STRING, KVS_PF_OPTIONAL, szId) \ + KVSM_PARAMETERS_END(c) \ + KviChannelWindow * ch = chan_kvs_find_channel(c, szId); \ + if(ch) \ + c->returnValue()->setBoolean(ch->__chanfunc(szNick, true)); \ + return true; \ + } /* @doc: chan.isowner @@ -720,7 +755,7 @@ static bool __clbkname(KviKvsModuleFunctionCall * c) \ Note that if the user is not on the channel at all, you will get 0 as return value.[br] */ -IS_KVS_FUNC(chan_kvs_fnc_isowner,isChanOwner) +IS_KVS_FUNC(chan_kvs_fnc_isowner, isChanOwner) /* @doc: chan.isadmin @@ -739,7 +774,7 @@ IS_KVS_FUNC(chan_kvs_fnc_isowner,isChanOwner) Note that if the user is not on the channel at all, you will get 0 as return value.[br] */ -IS_KVS_FUNC(chan_kvs_fnc_isadmin,isChanAdmin) +IS_KVS_FUNC(chan_kvs_fnc_isadmin, isChanAdmin) /* @doc: chan.isop @@ -758,7 +793,7 @@ IS_KVS_FUNC(chan_kvs_fnc_isadmin,isChanAdmin) Note that if the user is not on the channel at all, you will get 0 as return value.[br] */ -IS_KVS_FUNC(chan_kvs_fnc_isop,isOp) +IS_KVS_FUNC(chan_kvs_fnc_isop, isOp) /* @doc: chan.isvoice @@ -777,7 +812,7 @@ IS_KVS_FUNC(chan_kvs_fnc_isop,isOp) Note that if the user is not on the channel at all, you will get 0 as return value.[br] */ -IS_KVS_FUNC(chan_kvs_fnc_isvoice,isVoice) +IS_KVS_FUNC(chan_kvs_fnc_isvoice, isVoice) /* @doc: chan.ishalfop @@ -796,7 +831,7 @@ IS_KVS_FUNC(chan_kvs_fnc_isvoice,isVoice) Note that if the user is not on the channel at all, you will get 0 as return value.[br] */ -IS_KVS_FUNC(chan_kvs_fnc_ishalfop,isHalfOp) +IS_KVS_FUNC(chan_kvs_fnc_ishalfop, isHalfOp) /* @doc: chan.isuserop @@ -815,19 +850,20 @@ IS_KVS_FUNC(chan_kvs_fnc_ishalfop,isHalfOp) Note that if the user is not on the channel at all, you will get 0 as return value.[br] */ -IS_KVS_FUNC(chan_kvs_fnc_isuserop,isUserOp) - -#define IS_ME_KVS_FUNC(__clbkname,__chanfunc) \ -static bool __clbkname(KviKvsModuleFunctionCall * c) \ -{ \ - QString szId;\ - KVSM_PARAMETERS_BEGIN(c)\ - KVSM_PARAMETER("window id",KVS_PT_STRING,KVS_PF_OPTIONAL,szId)\ - KVSM_PARAMETERS_END(c)\ - KviChannelWindow * ch = chan_kvs_find_channel(c,szId); \ - if(ch) c->returnValue()->setBoolean(ch->__chanfunc(true)); \ - return true; \ -} +IS_KVS_FUNC(chan_kvs_fnc_isuserop, isUserOp) + +#define IS_ME_KVS_FUNC(__clbkname, __chanfunc) \ + static bool __clbkname(KviKvsModuleFunctionCall * c) \ + { \ + QString szId; \ + KVSM_PARAMETERS_BEGIN(c) \ + KVSM_PARAMETER("window id", KVS_PT_STRING, KVS_PF_OPTIONAL, szId) \ + KVSM_PARAMETERS_END(c) \ + KviChannelWindow * ch = chan_kvs_find_channel(c, szId); \ + if(ch) \ + c->returnValue()->setBoolean(ch->__chanfunc(true)); \ + return true; \ + } /* @doc: chan.ismeowner @@ -847,7 +883,7 @@ static bool __clbkname(KviKvsModuleFunctionCall * c) \ This function is a [i]shortcut[/i] for [fnc]$chan.isowner[/fnc]([fnc]$me[/fnc]).[br] */ -IS_ME_KVS_FUNC(chan_kvs_fnc_ismeowner,isMeChanOwner) +IS_ME_KVS_FUNC(chan_kvs_fnc_ismeowner, isMeChanOwner) /* @doc: chan.ismeadmin @@ -867,7 +903,7 @@ IS_ME_KVS_FUNC(chan_kvs_fnc_ismeowner,isMeChanOwner) This function is a [i]shortcut[/i] for [fnc]$chan.isadmin[/fnc]([fnc]$me[/fnc]).[br] */ -IS_ME_KVS_FUNC(chan_kvs_fnc_ismeadmin,isMeChanAdmin) +IS_ME_KVS_FUNC(chan_kvs_fnc_ismeadmin, isMeChanAdmin) /* @doc: chan.ismeop @@ -887,7 +923,7 @@ IS_ME_KVS_FUNC(chan_kvs_fnc_ismeadmin,isMeChanAdmin) This function is a [i]shortcut[/i] for [fnc]$chan.isop[/fnc]([fnc]$me[/fnc]).[br] */ -IS_ME_KVS_FUNC(chan_kvs_fnc_ismeop,isMeOp) +IS_ME_KVS_FUNC(chan_kvs_fnc_ismeop, isMeOp) /* @doc: chan.ismehalfop @@ -907,7 +943,7 @@ IS_ME_KVS_FUNC(chan_kvs_fnc_ismeop,isMeOp) This function is a [i]shortcut[/i] for [fnc]$chan.ishalfop[/fnc]([fnc]$me[/fnc]).[br] */ -IS_ME_KVS_FUNC(chan_kvs_fnc_ismehalfop,isMeHalfOp) +IS_ME_KVS_FUNC(chan_kvs_fnc_ismehalfop, isMeHalfOp) /* @doc: chan.ismevoice @@ -927,7 +963,7 @@ IS_ME_KVS_FUNC(chan_kvs_fnc_ismehalfop,isMeHalfOp) This function is a [i]shortcut[/i] for [fnc]$chan.isvoice[/fnc]([fnc]$me[/fnc]).[br] */ -IS_ME_KVS_FUNC(chan_kvs_fnc_ismevoice,isMeVoice) +IS_ME_KVS_FUNC(chan_kvs_fnc_ismevoice, isMeVoice) /* @doc: chan.ismeuserop @@ -947,7 +983,7 @@ IS_ME_KVS_FUNC(chan_kvs_fnc_ismevoice,isMeVoice) This function is a [i]shortcut[/i] for [fnc]$chan.isuserop[/fnc]([fnc]$me[/fnc]).[br] */ -IS_ME_KVS_FUNC(chan_kvs_fnc_ismeuserop,isMeUserOp) +IS_ME_KVS_FUNC(chan_kvs_fnc_ismeuserop, isMeUserOp) /* @doc: chan.mode @@ -971,9 +1007,9 @@ static bool chan_kvs_fnc_mode(KviKvsModuleFunctionCall * c) { QString szId; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("window id",KVS_PT_STRING,KVS_PF_OPTIONAL,szId) + KVSM_PARAMETER("window id", KVS_PT_STRING, KVS_PF_OPTIONAL, szId) KVSM_PARAMETERS_END(c) - KviChannelWindow * ch = chan_kvs_find_channel(c,szId); + KviChannelWindow * ch = chan_kvs_find_channel(c, szId); if(ch) { QString chMode; @@ -1010,10 +1046,11 @@ static bool chan_kvs_fnc_key(KviKvsModuleFunctionCall * c) { QString szId; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("window id",KVS_PT_STRING,KVS_PF_OPTIONAL,szId) + KVSM_PARAMETER("window id", KVS_PT_STRING, KVS_PF_OPTIONAL, szId) KVSM_PARAMETERS_END(c) - KviChannelWindow * ch = chan_kvs_find_channel(c,szId); - if (ch) c->returnValue()->setString(ch->hasChannelMode('k') ? ch->channelModeParam('k') : ""); + KviChannelWindow * ch = chan_kvs_find_channel(c, szId); + if(ch) + c->returnValue()->setString(ch->hasChannelMode('k') ? ch->channelModeParam('k') : ""); return true; } @@ -1044,12 +1081,12 @@ static bool chan_kvs_fnc_limit(KviKvsModuleFunctionCall * c) { QString szId; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("window id",KVS_PT_STRING,KVS_PF_OPTIONAL,szId) + KVSM_PARAMETER("window id", KVS_PT_STRING, KVS_PF_OPTIONAL, szId) KVSM_PARAMETERS_END(c) - KviChannelWindow * ch = chan_kvs_find_channel(c,szId); - if (ch) + KviChannelWindow * ch = chan_kvs_find_channel(c, szId); + if(ch) { - kvs_int_t limit=0; + kvs_int_t limit = 0; if(ch->hasChannelMode('l')) limit = ch->channelModeParam('l').toInt(); c->returnValue()->setInteger(limit); @@ -1085,12 +1122,13 @@ static bool chan_kvs_fnc_modeParam(KviKvsModuleFunctionCall * c) QString szId; QString szMode; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("mode",KVS_PT_NONEMPTYSTRING,0,szMode) - KVSM_PARAMETER("window id",KVS_PT_STRING,KVS_PF_OPTIONAL,szId) + KVSM_PARAMETER("mode", KVS_PT_NONEMPTYSTRING, 0, szMode) + KVSM_PARAMETER("window id", KVS_PT_STRING, KVS_PF_OPTIONAL, szId) KVSM_PARAMETERS_END(c) - KviChannelWindow * ch = chan_kvs_find_channel(c,szId); + KviChannelWindow * ch = chan_kvs_find_channel(c, szId); char cMode = szMode.at(0).unicode(); - if (ch) c->returnValue()->setString(ch->hasChannelMode(cMode) ? ch->channelModeParam(cMode) : ""); + if(ch) + c->returnValue()->setString(ch->hasChannelMode(cMode) ? ch->channelModeParam(cMode) : ""); return true; } @@ -1152,36 +1190,37 @@ static bool chan_kvs_fnc_modeParam(KviKvsModuleFunctionCall * c) static bool chan_kvs_fnc_users(KviKvsModuleFunctionCall * c) { - QString szWinId,szMask,szFlags; + QString szWinId, szMask, szFlags; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("window id",KVS_PT_STRING,KVS_PF_OPTIONAL,szWinId) - KVSM_PARAMETER("mask",KVS_PT_STRING,KVS_PF_OPTIONAL,szMask) - KVSM_PARAMETER("flags",KVS_PT_STRING,KVS_PF_OPTIONAL,szFlags) + KVSM_PARAMETER("window id", KVS_PT_STRING, KVS_PF_OPTIONAL, szWinId) + KVSM_PARAMETER("mask", KVS_PT_STRING, KVS_PF_OPTIONAL, szMask) + KVSM_PARAMETER("flags", KVS_PT_STRING, KVS_PF_OPTIONAL, szFlags) KVSM_PARAMETERS_END(c) KviKvsArray * pArray = new KviKvsArray(); c->returnValue()->setArray(pArray); - KviChannelWindow * ch = chan_kvs_find_channel(c,szWinId); - if(!ch)return true; + KviChannelWindow * ch = chan_kvs_find_channel(c, szWinId); + if(!ch) + return true; KviUserListEntry * e = ch->userListView()->firstItem(); // Thnx Julien :) bool bCheckMask = !szMask.isEmpty(); - bool bOp = szFlags.contains(QChar('o'),Qt::CaseSensitive); - bool bVoice = szFlags.contains(QChar('v'),Qt::CaseSensitive); - bool bHalfOp = szFlags.contains(QChar('h'),Qt::CaseSensitive); - bool bChanAdmins = szFlags.contains(QChar('a'),Qt::CaseSensitive); - bool bUserOp = szFlags.contains(QChar('u'),Qt::CaseSensitive); - bool bNone = szFlags.contains(QChar('n'),Qt::CaseSensitive); + bool bOp = szFlags.contains(QChar('o'), Qt::CaseSensitive); + bool bVoice = szFlags.contains(QChar('v'), Qt::CaseSensitive); + bool bHalfOp = szFlags.contains(QChar('h'), Qt::CaseSensitive); + bool bChanAdmins = szFlags.contains(QChar('a'), Qt::CaseSensitive); + bool bUserOp = szFlags.contains(QChar('u'), Qt::CaseSensitive); + bool bNone = szFlags.contains(QChar('n'), Qt::CaseSensitive); bool bCheckFlags = bOp || bVoice || bHalfOp || bNone || bChanAdmins || bUserOp; - bool bAddMask = szFlags.contains(QChar('m'),Qt::CaseSensitive); + bool bAddMask = szFlags.contains(QChar('m'), Qt::CaseSensitive); int idx = 0; if(bAddMask || bCheckFlags || bCheckMask) { - bool bMaskMustMatch = !szFlags.contains(QChar('i'),Qt::CaseSensitive); + bool bMaskMustMatch = !szFlags.contains(QChar('i'), Qt::CaseSensitive); KviIrcMask mask(szMask); while(e) @@ -1220,14 +1259,14 @@ static bool chan_kvs_fnc_users(KviKvsModuleFunctionCall * c) } goto next_item; } -check_mask: + check_mask: if(bCheckMask) { - if(mask.matchesFixed(e->nick(),e->globalData()->user(),e->globalData()->host()) == bMaskMustMatch) + if(mask.matchesFixed(e->nick(), e->globalData()->user(), e->globalData()->host()) == bMaskMustMatch) goto add_item; goto next_item; } -add_item: + add_item: if(bAddMask) { QString x(e->nick()); @@ -1235,24 +1274,27 @@ add_item: x.append(e->globalData()->user()); x.append('@'); x.append(e->globalData()->host()); - pArray->set(idx,new KviKvsVariant(x)); - } else { - pArray->set(idx,new KviKvsVariant(e->nick())); + pArray->set(idx, new KviKvsVariant(x)); + } + else + { + pArray->set(idx, new KviKvsVariant(e->nick())); } idx++; -next_item: + next_item: e = e->next(); } - } else { + } + else + { while(e) { - pArray->set(idx,new KviKvsVariant(e->nick())); + pArray->set(idx, new KviKvsVariant(e->nick())); idx++; e = e->next(); } } - return true; } @@ -1278,26 +1320,28 @@ next_item: static bool chan_kvs_fnc_banlist(KviKvsModuleFunctionCall * c) { - QString szWinId,szMask,szFlags; + QString szWinId, szMask, szFlags; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("window id",KVS_PT_STRING,KVS_PF_OPTIONAL,szWinId) + KVSM_PARAMETER("window id", KVS_PT_STRING, KVS_PF_OPTIONAL, szWinId) KVSM_PARAMETERS_END(c) KviKvsArray * pArray = new KviKvsArray(); c->returnValue()->setArray(pArray); - KviChannelWindow * ch = chan_kvs_find_channel(c,szWinId); + KviChannelWindow * ch = chan_kvs_find_channel(c, szWinId); - if(!ch)return true; + if(!ch) + return true; int idx = 0; KviPointerList * l = ch->modeMasks('b'); - if(!l) return true; + if(!l) + return true; - for(KviMaskEntry * e = l->first();e;e = l->next()) + for(KviMaskEntry * e = l->first(); e; e = l->next()) { - pArray->set(idx,new KviKvsVariant(e->szMask)); + pArray->set(idx, new KviKvsVariant(e->szMask)); idx++; } @@ -1326,26 +1370,28 @@ static bool chan_kvs_fnc_banlist(KviKvsModuleFunctionCall * c) static bool chan_kvs_fnc_banexceptionlist(KviKvsModuleFunctionCall * c) { - QString szWinId,szMask,szFlags; + QString szWinId, szMask, szFlags; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("window id",KVS_PT_STRING,KVS_PF_OPTIONAL,szWinId) + KVSM_PARAMETER("window id", KVS_PT_STRING, KVS_PF_OPTIONAL, szWinId) KVSM_PARAMETERS_END(c) KviKvsArray * pArray = new KviKvsArray(); c->returnValue()->setArray(pArray); - KviChannelWindow * ch = chan_kvs_find_channel(c,szWinId); + KviChannelWindow * ch = chan_kvs_find_channel(c, szWinId); - if(!ch)return true; + if(!ch) + return true; int idx = 0; KviPointerList * l = ch->modeMasks('e'); - if(!l) return true; + if(!l) + return true; - for(KviMaskEntry * e = l->first();e;e = l->next()) + for(KviMaskEntry * e = l->first(); e; e = l->next()) { - pArray->set(idx,new KviKvsVariant(e->szMask)); + pArray->set(idx, new KviKvsVariant(e->szMask)); idx++; } @@ -1374,26 +1420,28 @@ static bool chan_kvs_fnc_banexceptionlist(KviKvsModuleFunctionCall * c) static bool chan_kvs_fnc_invitelist(KviKvsModuleFunctionCall * c) { - QString szWinId,szMask,szFlags; + QString szWinId, szMask, szFlags; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("window id",KVS_PT_STRING,KVS_PF_OPTIONAL,szWinId) + KVSM_PARAMETER("window id", KVS_PT_STRING, KVS_PF_OPTIONAL, szWinId) KVSM_PARAMETERS_END(c) KviKvsArray * pArray = new KviKvsArray(); c->returnValue()->setArray(pArray); - KviChannelWindow * ch = chan_kvs_find_channel(c,szWinId); + KviChannelWindow * ch = chan_kvs_find_channel(c, szWinId); - if(!ch)return true; + if(!ch) + return true; int idx = 0; KviPointerList * l = ch->modeMasks('I'); - if(!l) return true; + if(!l) + return true; - for(KviMaskEntry * e = l->first();e;e = l->next()) + for(KviMaskEntry * e = l->first(); e; e = l->next()) { - pArray->set(idx,new KviKvsVariant(e->szMask)); + pArray->set(idx, new KviKvsVariant(e->szMask)); idx++; } @@ -1422,10 +1470,10 @@ static bool chan_kvs_fnc_invitelist(KviKvsModuleFunctionCall * c) static bool chan_kvs_fnc_masklist(KviKvsModuleFunctionCall * c) { - QString szWinId,szMask,szMode; + QString szWinId, szMask, szMode; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("mode",KVS_PT_NONEMPTYSTRING,0,szMode) - KVSM_PARAMETER("window id",KVS_PT_STRING,KVS_PF_OPTIONAL,szWinId) + KVSM_PARAMETER("mode", KVS_PT_NONEMPTYSTRING, 0, szMode) + KVSM_PARAMETER("window id", KVS_PT_STRING, KVS_PF_OPTIONAL, szWinId) KVSM_PARAMETERS_END(c) char cMode = szMode.at(0).unicode(); @@ -1433,18 +1481,20 @@ static bool chan_kvs_fnc_masklist(KviKvsModuleFunctionCall * c) KviKvsArray * pArray = new KviKvsArray(); c->returnValue()->setArray(pArray); - KviChannelWindow * ch = chan_kvs_find_channel(c,szWinId); + KviChannelWindow * ch = chan_kvs_find_channel(c, szWinId); - if(!ch)return true; + if(!ch) + return true; int idx = 0; KviPointerList * l = ch->modeMasks(cMode); - if(!l) return true; + if(!l) + return true; - for(KviMaskEntry * e = l->first();e;e = l->next()) + for(KviMaskEntry * e = l->first(); e; e = l->next()) { - pArray->set(idx,new KviKvsVariant(e->szMask)); + pArray->set(idx, new KviKvsVariant(e->szMask)); idx++; } @@ -1471,13 +1521,13 @@ static bool chan_kvs_fnc_masklist(KviKvsModuleFunctionCall * c) static bool chan_kvs_fnc_matchban(KviKvsModuleFunctionCall * c) { - QString szWinId,szMask; + QString szWinId, szMask; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("window id",KVS_PT_STRING,0,szWinId) - KVSM_PARAMETER("mask",KVS_PT_STRING,0,szMask) + KVSM_PARAMETER("window id", KVS_PT_STRING, 0, szWinId) + KVSM_PARAMETER("mask", KVS_PT_STRING, 0, szMask) KVSM_PARAMETERS_END(c) - KviChannelWindow * ch = chan_kvs_find_channel(c,szWinId); + KviChannelWindow * ch = chan_kvs_find_channel(c, szWinId); if(!ch) { @@ -1492,9 +1542,9 @@ static bool chan_kvs_fnc_matchban(KviKvsModuleFunctionCall * c) return true; } - for(KviMaskEntry * e = l->first();e;e = l->next()) + for(KviMaskEntry * e = l->first(); e; e = l->next()) { - if(KviQString::matchString(e->szMask,szMask)) + if(KviQString::matchString(e->szMask, szMask)) { c->returnValue()->setString(e->szMask); return true; @@ -1525,13 +1575,13 @@ static bool chan_kvs_fnc_matchban(KviKvsModuleFunctionCall * c) static bool chan_kvs_fnc_matchbanexception(KviKvsModuleFunctionCall * c) { - QString szWinId,szMask; + QString szWinId, szMask; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("window id",KVS_PT_STRING,0,szWinId) - KVSM_PARAMETER("mask",KVS_PT_STRING,0,szMask) + KVSM_PARAMETER("window id", KVS_PT_STRING, 0, szWinId) + KVSM_PARAMETER("mask", KVS_PT_STRING, 0, szMask) KVSM_PARAMETERS_END(c) - KviChannelWindow * ch = chan_kvs_find_channel(c,szWinId); + KviChannelWindow * ch = chan_kvs_find_channel(c, szWinId); if(!ch) { @@ -1546,9 +1596,9 @@ static bool chan_kvs_fnc_matchbanexception(KviKvsModuleFunctionCall * c) return true; } - for(KviMaskEntry * e = l->first();e;e = l->next()) + for(KviMaskEntry * e = l->first(); e; e = l->next()) { - if(KviQString::matchString(e->szMask,szMask)) + if(KviQString::matchString(e->szMask, szMask)) { c->returnValue()->setString(e->szMask); return true; @@ -1579,13 +1629,13 @@ static bool chan_kvs_fnc_matchbanexception(KviKvsModuleFunctionCall * c) static bool chan_kvs_fnc_matchinvite(KviKvsModuleFunctionCall * c) { - QString szWinId,szMask; + QString szWinId, szMask; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("window id",KVS_PT_STRING,0,szWinId) - KVSM_PARAMETER("mask",KVS_PT_STRING,0,szMask) + KVSM_PARAMETER("window id", KVS_PT_STRING, 0, szWinId) + KVSM_PARAMETER("mask", KVS_PT_STRING, 0, szMask) KVSM_PARAMETERS_END(c) - KviChannelWindow * ch = chan_kvs_find_channel(c,szWinId); + KviChannelWindow * ch = chan_kvs_find_channel(c, szWinId); if(!ch) { @@ -1600,9 +1650,9 @@ static bool chan_kvs_fnc_matchinvite(KviKvsModuleFunctionCall * c) return true; } - for(KviMaskEntry * e = l->first();e;e = l->next()) + for(KviMaskEntry * e = l->first(); e; e = l->next()) { - if(KviQString::matchString(e->szMask,szMask)) + if(KviQString::matchString(e->szMask, szMask)) { c->returnValue()->setString(e->szMask); return true; @@ -1639,13 +1689,13 @@ static bool chan_kvs_fnc_matchinvite(KviKvsModuleFunctionCall * c) static bool chan_kvs_fnc_matchqban(KviKvsModuleFunctionCall * c) { - QString szWinId,szMask; + QString szWinId, szMask; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("window id",KVS_PT_STRING,0,szWinId) - KVSM_PARAMETER("mask",KVS_PT_STRING,0,szMask) + KVSM_PARAMETER("window id", KVS_PT_STRING, 0, szWinId) + KVSM_PARAMETER("mask", KVS_PT_STRING, 0, szMask) KVSM_PARAMETERS_END(c) - KviChannelWindow * ch = chan_kvs_find_channel(c,szWinId); + KviChannelWindow * ch = chan_kvs_find_channel(c, szWinId); szMask.prepend('%'); if(!ch) @@ -1661,9 +1711,9 @@ static bool chan_kvs_fnc_matchqban(KviKvsModuleFunctionCall * c) return true; } - for(KviMaskEntry * e = l->first();e;e = l->next()) + for(KviMaskEntry * e = l->first(); e; e = l->next()) { - if(KviQString::matchString(e->szMask,szMask)) + if(KviQString::matchString(e->szMask, szMask)) { c->returnValue()->setString(e->szMask); return true; @@ -1695,16 +1745,16 @@ static bool chan_kvs_fnc_matchqban(KviKvsModuleFunctionCall * c) static bool chan_kvs_fnc_matchmask(KviKvsModuleFunctionCall * c) { - QString szWinId,szMask,szMode; + QString szWinId, szMask, szMode; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("mode",KVS_PT_NONEMPTYSTRING,0,szMode) - KVSM_PARAMETER("mask",KVS_PT_STRING,0,szMask) - KVSM_PARAMETER("window id",KVS_PT_STRING,KVS_PF_OPTIONAL,szWinId) + KVSM_PARAMETER("mode", KVS_PT_NONEMPTYSTRING, 0, szMode) + KVSM_PARAMETER("mask", KVS_PT_STRING, 0, szMask) + KVSM_PARAMETER("window id", KVS_PT_STRING, KVS_PF_OPTIONAL, szWinId) KVSM_PARAMETERS_END(c) char cMode = szMode.at(0).unicode(); - KviChannelWindow * ch = chan_kvs_find_channel(c,szWinId); + KviChannelWindow * ch = chan_kvs_find_channel(c, szWinId); if(!ch) { @@ -1719,9 +1769,9 @@ static bool chan_kvs_fnc_matchmask(KviKvsModuleFunctionCall * c) return true; } - for(KviMaskEntry * e = l->first();e;e = l->next()) + for(KviMaskEntry * e = l->first(); e; e = l->next()) { - if(KviQString::matchString(e->szMask,szMask)) + if(KviQString::matchString(e->szMask, szMask)) { c->returnValue()->setString(e->szMask); return true; @@ -1760,15 +1810,16 @@ static bool chan_kvs_fnc_matchmask(KviKvsModuleFunctionCall * c) static bool chan_kvs_fnc_usermodelevel(KviKvsModuleFunctionCall * c) { - QString szNick,szWinId; + QString szNick, szWinId; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("nickname",KVS_PT_STRING,0,szNick) - KVSM_PARAMETER("window id",KVS_PT_STRING,KVS_PF_OPTIONAL,szWinId) + KVSM_PARAMETER("nickname", KVS_PT_STRING, 0, szNick) + KVSM_PARAMETER("window id", KVS_PT_STRING, KVS_PF_OPTIONAL, szWinId) KVSM_PARAMETERS_END(c) - KviChannelWindow * ch = chan_kvs_find_channel(c,szWinId); + KviChannelWindow * ch = chan_kvs_find_channel(c, szWinId); - kvs_int_t mode=0; - if(ch) mode=ch->userListView()->getUserModeLevel(szNick); + kvs_int_t mode = 0; + if(ch) + mode = ch->userListView()->getUserModeLevel(szNick); c->returnValue()->setInteger(mode); return true; } @@ -1796,15 +1847,16 @@ static bool chan_kvs_fnc_usermodelevel(KviKvsModuleFunctionCall * c) static bool chan_kvs_fnc_userjointime(KviKvsModuleFunctionCall * c) { - QString szNick,szWinId; + QString szNick, szWinId; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("nickname",KVS_PT_STRING,0,szNick) - KVSM_PARAMETER("window id",KVS_PT_STRING,KVS_PF_OPTIONAL,szWinId) + KVSM_PARAMETER("nickname", KVS_PT_STRING, 0, szNick) + KVSM_PARAMETER("window id", KVS_PT_STRING, KVS_PF_OPTIONAL, szWinId) KVSM_PARAMETERS_END(c) - KviChannelWindow * ch = chan_kvs_find_channel(c,szWinId); + KviChannelWindow * ch = chan_kvs_find_channel(c, szWinId); - kvs_int_t time=0; - if(ch) time=ch->userListView()->getUserJoinTime(szNick); + kvs_int_t time = 0; + if(ch) + time = ch->userListView()->getUserJoinTime(szNick); c->returnValue()->setInteger(time); return true; } @@ -1833,15 +1885,16 @@ static bool chan_kvs_fnc_userjointime(KviKvsModuleFunctionCall * c) static bool chan_kvs_fnc_userlastactiontime(KviKvsModuleFunctionCall * c) { - QString szNick,szWinId; + QString szNick, szWinId; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("nickname",KVS_PT_STRING,0,szNick) - KVSM_PARAMETER("window id",KVS_PT_STRING,KVS_PF_OPTIONAL,szWinId) + KVSM_PARAMETER("nickname", KVS_PT_STRING, 0, szNick) + KVSM_PARAMETER("window id", KVS_PT_STRING, KVS_PF_OPTIONAL, szWinId) KVSM_PARAMETERS_END(c) - KviChannelWindow * ch = chan_kvs_find_channel(c,szWinId); + KviChannelWindow * ch = chan_kvs_find_channel(c, szWinId); - kvs_int_t time=0; - if(ch) time=ch->userListView()->getUserLastActionTime(szNick); + kvs_int_t time = 0; + if(ch) + time = ch->userListView()->getUserLastActionTime(szNick); c->returnValue()->setInteger(time); return true; } @@ -1868,8 +1921,8 @@ static bool chan_kvs_fnc_common(KviKvsModuleFunctionCall * c) kvs_uint_t iContextId; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("nickname",KVS_PT_STRING,0,szNick) - KVSM_PARAMETER("context_id",KVS_PT_UINT,KVS_PF_OPTIONAL,iContextId) \ + KVSM_PARAMETER("nickname", KVS_PT_STRING, 0, szNick) + KVSM_PARAMETER("context_id", KVS_PT_UINT, KVS_PF_OPTIONAL, iContextId) KVSM_PARAMETERS_END(c) KviConsoleWindow * pConsole = NULL; @@ -1880,7 +1933,7 @@ static bool chan_kvs_fnc_common(KviKvsModuleFunctionCall * c) if(pConsole && pConsole->connection()) { - pConsole->connection()->getCommonChannels(szNick,szChans,false); + pConsole->connection()->getCommonChannels(szNick, szChans, false); c->returnValue()->setString(szChans); } @@ -1889,55 +1942,55 @@ static bool chan_kvs_fnc_common(KviKvsModuleFunctionCall * c) static bool chan_module_init(KviModule * m) { - KVSM_REGISTER_FUNCTION(m,"admincount",chan_kvs_fnc_admincount); - KVSM_REGISTER_FUNCTION(m,"bancount",chan_kvs_fnc_bancount); - KVSM_REGISTER_FUNCTION(m,"banexceptioncount",chan_kvs_fnc_banexceptioncount); - KVSM_REGISTER_FUNCTION(m,"banexceptionlist",chan_kvs_fnc_banexceptionlist); - KVSM_REGISTER_FUNCTION(m,"banlist",chan_kvs_fnc_banlist); - KVSM_REGISTER_FUNCTION(m,"common",chan_kvs_fnc_common); - KVSM_REGISTER_FUNCTION(m,"getflag",chan_kvs_fnc_getflag); - KVSM_REGISTER_FUNCTION(m,"geturl",chan_kvs_fnc_getUrl); - KVSM_REGISTER_FUNCTION(m,"halfopcount",chan_kvs_fnc_halfopcount); - KVSM_REGISTER_FUNCTION(m,"invitecount",chan_kvs_fnc_invitecount); - KVSM_REGISTER_FUNCTION(m,"invitelist",chan_kvs_fnc_invitelist); - KVSM_REGISTER_FUNCTION(m,"isadmin",chan_kvs_fnc_isadmin); - KVSM_REGISTER_FUNCTION(m,"isdead",chan_kvs_fnc_isdead); - KVSM_REGISTER_FUNCTION(m,"ishalfop",chan_kvs_fnc_ishalfop); - KVSM_REGISTER_FUNCTION(m,"ismeadmin",chan_kvs_fnc_ismeadmin); - KVSM_REGISTER_FUNCTION(m,"ismehalfop",chan_kvs_fnc_ismehalfop); - KVSM_REGISTER_FUNCTION(m,"ismeop",chan_kvs_fnc_ismeop); - KVSM_REGISTER_FUNCTION(m,"ismeowner",chan_kvs_fnc_ismeowner); - KVSM_REGISTER_FUNCTION(m,"ismeuserop",chan_kvs_fnc_ismeuserop); - KVSM_REGISTER_FUNCTION(m,"ismevoice",chan_kvs_fnc_ismevoice); - KVSM_REGISTER_FUNCTION(m,"ison",chan_kvs_fnc_ison); - KVSM_REGISTER_FUNCTION(m,"isop",chan_kvs_fnc_isop); - KVSM_REGISTER_FUNCTION(m,"isowner",chan_kvs_fnc_isowner); - KVSM_REGISTER_FUNCTION(m,"isuserop",chan_kvs_fnc_isuserop); - KVSM_REGISTER_FUNCTION(m,"isvoice",chan_kvs_fnc_isvoice); - KVSM_REGISTER_FUNCTION(m,"key",chan_kvs_fnc_key); - KVSM_REGISTER_FUNCTION(m,"limit",chan_kvs_fnc_limit); - KVSM_REGISTER_FUNCTION(m,"masklist",chan_kvs_fnc_masklist); - KVSM_REGISTER_FUNCTION(m,"maskcount",chan_kvs_fnc_maskcount); - KVSM_REGISTER_FUNCTION(m,"matchban",chan_kvs_fnc_matchban); - KVSM_REGISTER_FUNCTION(m,"matchqban",chan_kvs_fnc_matchqban); - KVSM_REGISTER_FUNCTION(m,"matchbanexception",chan_kvs_fnc_matchbanexception); - KVSM_REGISTER_FUNCTION(m,"matchinvite",chan_kvs_fnc_matchinvite); - KVSM_REGISTER_FUNCTION(m,"matchmask",chan_kvs_fnc_matchmask); - KVSM_REGISTER_FUNCTION(m,"mode",chan_kvs_fnc_mode); - KVSM_REGISTER_FUNCTION(m,"modeParam",chan_kvs_fnc_modeParam); - KVSM_REGISTER_FUNCTION(m,"name",chan_kvs_fnc_name); - KVSM_REGISTER_FUNCTION(m,"opcount",chan_kvs_fnc_opcount); - KVSM_REGISTER_FUNCTION(m,"ownercount",chan_kvs_fnc_ownercount); - KVSM_REGISTER_FUNCTION(m,"topic",chan_kvs_fnc_topic); - KVSM_REGISTER_FUNCTION(m,"topicsetat",chan_kvs_fnc_topicsetat); - KVSM_REGISTER_FUNCTION(m,"topicsetby",chan_kvs_fnc_topicsetby); - KVSM_REGISTER_FUNCTION(m,"usercount",chan_kvs_fnc_usercount); - KVSM_REGISTER_FUNCTION(m,"userjointime",chan_kvs_fnc_userjointime); - KVSM_REGISTER_FUNCTION(m,"userlastactiontime",chan_kvs_fnc_userlastactiontime); - KVSM_REGISTER_FUNCTION(m,"usermodelevel",chan_kvs_fnc_usermodelevel); - KVSM_REGISTER_FUNCTION(m,"useropcount",chan_kvs_fnc_useropcount); - KVSM_REGISTER_FUNCTION(m,"users",chan_kvs_fnc_users); - KVSM_REGISTER_FUNCTION(m,"voicecount",chan_kvs_fnc_voicecount); + KVSM_REGISTER_FUNCTION(m, "admincount", chan_kvs_fnc_admincount); + KVSM_REGISTER_FUNCTION(m, "bancount", chan_kvs_fnc_bancount); + KVSM_REGISTER_FUNCTION(m, "banexceptioncount", chan_kvs_fnc_banexceptioncount); + KVSM_REGISTER_FUNCTION(m, "banexceptionlist", chan_kvs_fnc_banexceptionlist); + KVSM_REGISTER_FUNCTION(m, "banlist", chan_kvs_fnc_banlist); + KVSM_REGISTER_FUNCTION(m, "common", chan_kvs_fnc_common); + KVSM_REGISTER_FUNCTION(m, "getflag", chan_kvs_fnc_getflag); + KVSM_REGISTER_FUNCTION(m, "geturl", chan_kvs_fnc_getUrl); + KVSM_REGISTER_FUNCTION(m, "halfopcount", chan_kvs_fnc_halfopcount); + KVSM_REGISTER_FUNCTION(m, "invitecount", chan_kvs_fnc_invitecount); + KVSM_REGISTER_FUNCTION(m, "invitelist", chan_kvs_fnc_invitelist); + KVSM_REGISTER_FUNCTION(m, "isadmin", chan_kvs_fnc_isadmin); + KVSM_REGISTER_FUNCTION(m, "isdead", chan_kvs_fnc_isdead); + KVSM_REGISTER_FUNCTION(m, "ishalfop", chan_kvs_fnc_ishalfop); + KVSM_REGISTER_FUNCTION(m, "ismeadmin", chan_kvs_fnc_ismeadmin); + KVSM_REGISTER_FUNCTION(m, "ismehalfop", chan_kvs_fnc_ismehalfop); + KVSM_REGISTER_FUNCTION(m, "ismeop", chan_kvs_fnc_ismeop); + KVSM_REGISTER_FUNCTION(m, "ismeowner", chan_kvs_fnc_ismeowner); + KVSM_REGISTER_FUNCTION(m, "ismeuserop", chan_kvs_fnc_ismeuserop); + KVSM_REGISTER_FUNCTION(m, "ismevoice", chan_kvs_fnc_ismevoice); + KVSM_REGISTER_FUNCTION(m, "ison", chan_kvs_fnc_ison); + KVSM_REGISTER_FUNCTION(m, "isop", chan_kvs_fnc_isop); + KVSM_REGISTER_FUNCTION(m, "isowner", chan_kvs_fnc_isowner); + KVSM_REGISTER_FUNCTION(m, "isuserop", chan_kvs_fnc_isuserop); + KVSM_REGISTER_FUNCTION(m, "isvoice", chan_kvs_fnc_isvoice); + KVSM_REGISTER_FUNCTION(m, "key", chan_kvs_fnc_key); + KVSM_REGISTER_FUNCTION(m, "limit", chan_kvs_fnc_limit); + KVSM_REGISTER_FUNCTION(m, "masklist", chan_kvs_fnc_masklist); + KVSM_REGISTER_FUNCTION(m, "maskcount", chan_kvs_fnc_maskcount); + KVSM_REGISTER_FUNCTION(m, "matchban", chan_kvs_fnc_matchban); + KVSM_REGISTER_FUNCTION(m, "matchqban", chan_kvs_fnc_matchqban); + KVSM_REGISTER_FUNCTION(m, "matchbanexception", chan_kvs_fnc_matchbanexception); + KVSM_REGISTER_FUNCTION(m, "matchinvite", chan_kvs_fnc_matchinvite); + KVSM_REGISTER_FUNCTION(m, "matchmask", chan_kvs_fnc_matchmask); + KVSM_REGISTER_FUNCTION(m, "mode", chan_kvs_fnc_mode); + KVSM_REGISTER_FUNCTION(m, "modeParam", chan_kvs_fnc_modeParam); + KVSM_REGISTER_FUNCTION(m, "name", chan_kvs_fnc_name); + KVSM_REGISTER_FUNCTION(m, "opcount", chan_kvs_fnc_opcount); + KVSM_REGISTER_FUNCTION(m, "ownercount", chan_kvs_fnc_ownercount); + KVSM_REGISTER_FUNCTION(m, "topic", chan_kvs_fnc_topic); + KVSM_REGISTER_FUNCTION(m, "topicsetat", chan_kvs_fnc_topicsetat); + KVSM_REGISTER_FUNCTION(m, "topicsetby", chan_kvs_fnc_topicsetby); + KVSM_REGISTER_FUNCTION(m, "usercount", chan_kvs_fnc_usercount); + KVSM_REGISTER_FUNCTION(m, "userjointime", chan_kvs_fnc_userjointime); + KVSM_REGISTER_FUNCTION(m, "userlastactiontime", chan_kvs_fnc_userlastactiontime); + KVSM_REGISTER_FUNCTION(m, "usermodelevel", chan_kvs_fnc_usermodelevel); + KVSM_REGISTER_FUNCTION(m, "useropcount", chan_kvs_fnc_useropcount); + KVSM_REGISTER_FUNCTION(m, "users", chan_kvs_fnc_users); + KVSM_REGISTER_FUNCTION(m, "voicecount", chan_kvs_fnc_voicecount); return true; } @@ -1948,14 +2001,13 @@ static bool chan_module_cleanup(KviModule *) } KVIRC_MODULE( - "Chan", // module name - "4.0.0", // module version - "Copyright (C) 2002 Szymon Stefanek (pragma at kvirc dot net)"\ - " (C) 2002 Juanjo Alvarez (juanjux at yahoo dot es)", - "Scripting interface for the channel management", - chan_module_init, - 0, - 0, - chan_module_cleanup, - 0 -) + "Chan", // module name + "4.0.0", // module version + "Copyright (C) 2002 Szymon Stefanek (pragma at kvirc dot net)" + " (C) 2002 Juanjo Alvarez (juanjux at yahoo dot es)", + "Scripting interface for the channel management", + chan_module_init, + 0, + 0, + chan_module_cleanup, + 0) diff --git a/src/modules/channelsjoin/ChannelsJoinDialog.cpp b/src/modules/channelsjoin/ChannelsJoinDialog.cpp index c18e4aa1e..343c55c88 100644 --- a/src/modules/channelsjoin/ChannelsJoinDialog.cpp +++ b/src/modules/channelsjoin/ChannelsJoinDialog.cpp @@ -49,15 +49,13 @@ #include #include - -extern ChannelsJoinDialog * g_pChannelsWindow; -extern QRect g_rectChannelsJoinGeometry; +extern ChannelsJoinDialog * g_pChannelsWindow; +extern QRect g_rectChannelsJoinGeometry; // KviApplication.cpp extern KVIRC_API KviRegisteredChannelDataBase * g_pRegisteredChannelDataBase; - ChannelsJoinDialog::ChannelsJoinDialog(const char * name) -: QDialog(g_pMainWindow) + : QDialog(g_pMainWindow) { setObjectName(name); setWindowTitle(__tr2qs("Join Channels - KVIrc")); @@ -71,58 +69,56 @@ ChannelsJoinDialog::ChannelsJoinDialog(const char * name) m_pTreeWidget->setHeaderLabel(__tr2qs("Channel")); m_pTreeWidget->setRootIsDecorated(true); m_pTreeWidget->setSelectionMode(QAbstractItemView::SingleSelection); - g->addWidget(m_pTreeWidget,0,0,1,2); + g->addWidget(m_pTreeWidget, 0, 0, 1, 2); //connect(m_pTreeWidget,SIGNAL(itemDoubleClicked(QTreeWidgetItem *,int)),this,SLOT(itemDoubleClicked(QTreeWidgetItem *,int))); - - m_pGroupBox = new KviTalGroupBox(Qt::Horizontal,__tr2qs("Channel"),this); + m_pGroupBox = new KviTalGroupBox(Qt::Horizontal, __tr2qs("Channel"), this); QString szMsg = __tr2qs("Name"); szMsg.append(":"); - new QLabel(szMsg,m_pGroupBox); + new QLabel(szMsg, m_pGroupBox); m_pChannelEdit = new QLineEdit(m_pGroupBox); - connect(m_pChannelEdit,SIGNAL(returnPressed()),this,SLOT(editReturnPressed())); - connect(m_pChannelEdit,SIGNAL(textChanged(const QString &)),this,SLOT(editTextChanged(const QString &))); + connect(m_pChannelEdit, SIGNAL(returnPressed()), this, SLOT(editReturnPressed())); + connect(m_pChannelEdit, SIGNAL(textChanged(const QString &)), this, SLOT(editTextChanged(const QString &))); szMsg = __tr2qs("Password"); szMsg.append(":"); - new QLabel(szMsg,m_pGroupBox); + new QLabel(szMsg, m_pGroupBox); m_pPass = new QLineEdit(m_pGroupBox); m_pPass->setEchoMode(QLineEdit::Password); - g->addWidget(m_pGroupBox,1,0,1,2); + g->addWidget(m_pGroupBox, 1, 0, 1, 2); KviTalHBox * hb = new KviTalHBox(this); hb->setSpacing(4); - g->addWidget(hb,2,0,1,2); + g->addWidget(hb, 2, 0, 1, 2); - m_pJoinButton = new QPushButton(__tr2qs("&Join"),hb); + m_pJoinButton = new QPushButton(__tr2qs("&Join"), hb); // Join on return pressed m_pJoinButton->setDefault(true); - connect(m_pJoinButton,SIGNAL(clicked()),this,SLOT(joinClicked())); + connect(m_pJoinButton, SIGNAL(clicked()), this, SLOT(joinClicked())); - m_pRegButton = new QPushButton(__tr2qs("&Register"),hb); + m_pRegButton = new QPushButton(__tr2qs("&Register"), hb); // Join on return pressed - connect(m_pRegButton,SIGNAL(clicked()),this,SLOT(regClicked())); + connect(m_pRegButton, SIGNAL(clicked()), this, SLOT(regClicked())); - m_pClearButton = new QPushButton(__tr2qs("Clear Recent"),hb); - connect(m_pClearButton,SIGNAL(clicked()),this,SLOT(clearClicked())); + m_pClearButton = new QPushButton(__tr2qs("Clear Recent"), hb); + connect(m_pClearButton, SIGNAL(clicked()), this, SLOT(clearClicked())); - m_pShowAtStartupCheck = new QCheckBox(__tr2qs("Show this window after connecting"),this); + m_pShowAtStartupCheck = new QCheckBox(__tr2qs("Show this window after connecting"), this); m_pShowAtStartupCheck->setChecked(KVI_OPTION_BOOL(KviOption_boolShowChannelsJoinOnIrc)); - g->addWidget(m_pShowAtStartupCheck,3,0); + g->addWidget(m_pShowAtStartupCheck, 3, 0); + QPushButton * cancelButton = new QPushButton(__tr2qs("Close"), this); + connect(cancelButton, SIGNAL(clicked()), this, SLOT(cancelClicked())); - QPushButton * cancelButton = new QPushButton(__tr2qs("Close"),this); - connect(cancelButton,SIGNAL(clicked()),this,SLOT(cancelClicked())); + g->addWidget(cancelButton, 3, 1, Qt::AlignRight); - g->addWidget(cancelButton,3,1,Qt::AlignRight); - -/* + /* KviTalHBox * hb = new KviTalHBox(this); hb->setSpacing(4); @@ -134,19 +130,19 @@ ChannelsJoinDialog::ChannelsJoinDialog(const char * name) g->addWidget(hb,2,0); */ - g->setRowStretch(0,1); - g->setColumnStretch(0,1); + g->setRowStretch(0, 1); + g->setColumnStretch(0, 1); fillListView(); if(g_rectChannelsJoinGeometry.y() < 5) g_rectChannelsJoinGeometry.setY(5); - resize(g_rectChannelsJoinGeometry.width(),g_rectChannelsJoinGeometry.height()); + resize(g_rectChannelsJoinGeometry.width(), g_rectChannelsJoinGeometry.height()); //move(g_rectChannelsJoinGeometry.x(),g_rectChannelsJoinGeometry.y()); QRect rect = g_pApp->desktop()->screenGeometry(g_pMainWindow); - move(rect.x() + ((rect.width() - g_rectChannelsJoinGeometry.width())/2),rect.y() + ((rect.height() - g_rectChannelsJoinGeometry.height())/2)); + move(rect.x() + ((rect.width() - g_rectChannelsJoinGeometry.width()) / 2), rect.y() + ((rect.height() - g_rectChannelsJoinGeometry.height()) / 2)); enableJoin(); } @@ -155,11 +151,11 @@ ChannelsJoinDialog::~ChannelsJoinDialog() { KVI_OPTION_BOOL(KviOption_boolShowChannelsJoinOnIrc) = m_pShowAtStartupCheck->isChecked(); - g_rectChannelsJoinGeometry = QRect(pos().x(),pos().y(),size().width(),size().height()); + g_rectChannelsJoinGeometry = QRect(pos().x(), pos().y(), size().width(), size().height()); g_pChannelsWindow = 0; } -void ChannelsJoinDialog::setConsole(KviConsoleWindow * pConsole) +void ChannelsJoinDialog::setConsole(KviConsoleWindow * pConsole) { m_pConsole = pConsole; fillListView(); @@ -174,24 +170,24 @@ void ChannelsJoinDialog::fillListView() // Registered channels go first QTreeWidgetItem * par = new QTreeWidgetItem(m_pTreeWidget, HeaderItem); - par->setText(0,__tr2qs("Registered Channels")); + par->setText(0, __tr2qs("Registered Channels")); par->setExpanded(true); - QHash * d = g_pRegisteredChannelDataBase->channelDict(); + QHash * d = g_pRegisteredChannelDataBase->channelDict(); if(d) { - for(QHash::Iterator it = d->begin();it != d->end();++it) + for(QHash::Iterator it = d->begin(); it != d->end(); ++it) { QTreeWidgetItem * chld = new QTreeWidgetItem(par, RegisteredChannelItem); - chld->setText(0,it.key()); - chld->setIcon(0,*(g_pIconManager->getSmallIcon(KviIconManager::Channel))); + chld->setText(0, it.key()); + chld->setIcon(0, *(g_pIconManager->getSmallIcon(KviIconManager::Channel))); } } par->sortChildren(0, Qt::AscendingOrder); par = new QTreeWidgetItem(m_pTreeWidget, HeaderItem); - par->setText(0,__tr2qs("Recent Channels")); + par->setText(0, __tr2qs("Recent Channels")); par->setExpanded(true); QTreeWidgetItem * chld; @@ -210,53 +206,53 @@ void ChannelsJoinDialog::fillListView() bGotChanOnCurrentNetwork = true; hdr = new QTreeWidgetItem(par, HeaderItem); - hdr->setText(0,__tr2qs("Current Network")); + hdr->setText(0, __tr2qs("Current Network")); hdr->setExpanded(true); for(QStringList::Iterator it = pList->begin(); it != pList->end(); ++it) { chld = new QTreeWidgetItem(hdr, RecentChannelItem); - chld->setText(0,*it); - chld->setIcon(0,*(g_pIconManager->getSmallIcon(KviIconManager::Channel))); + chld->setText(0, *it); + chld->setIcon(0, *(g_pIconManager->getSmallIcon(KviIconManager::Channel))); } hdr->sortChildren(0, Qt::AscendingOrder); } } } - KviPointerHashTable * pDict = g_pApp->recentChannels(); + KviPointerHashTable * pDict = g_pApp->recentChannels(); if(!pDict) return; hdr = new QTreeWidgetItem(par, HeaderItem); - hdr->setText(0,__tr2qs("All Networks")); + hdr->setText(0, __tr2qs("All Networks")); if(!bGotChanOnCurrentNetwork) hdr->setExpanded(true); // expand this one instead - QHash hNoDuplicates; + QHash hNoDuplicates; - for(QStringList * pChans = pDict->first();pChans;pChans = pDict->next()) + for(QStringList * pChans = pDict->first(); pChans; pChans = pDict->next()) { for(QStringList::Iterator it = pChans->begin(); it != pChans->end(); ++it) { QString chan = *it; if(hNoDuplicates.contains(chan.toLower())) continue; - hNoDuplicates.insert(chan.toLower(),1); + hNoDuplicates.insert(chan.toLower(), 1); chld = new QTreeWidgetItem(hdr, RecentChannelItem); - chld->setText(0,chan); - chld->setIcon(0,*(g_pIconManager->getSmallIcon(KviIconManager::Channel))); + chld->setText(0, chan); + chld->setIcon(0, *(g_pIconManager->getSmallIcon(KviIconManager::Channel))); } } hdr->sortChildren(0, Qt::AscendingOrder); } -void ChannelsJoinDialogTreeWidget::mousePressEvent(QMouseEvent *e) +void ChannelsJoinDialogTreeWidget::mousePressEvent(QMouseEvent * e) { e->ignore(); QTreeWidgetItem * it = itemAt(e->pos()); - ChannelsJoinDialog *pDialog = (ChannelsJoinDialog*) parentWidget(); + ChannelsJoinDialog * pDialog = (ChannelsJoinDialog *)parentWidget(); if(!it || !pDialog) { QTreeWidget::mousePressEvent(e); @@ -277,20 +273,22 @@ void ChannelsJoinDialogTreeWidget::mousePressEvent(QMouseEvent *e) if(!m_pJoinPopup) { m_pJoinPopup = new QMenu(this); - m_pJoinPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::Join)),__tr2qs("Join"),pDialog,SLOT(joinClicked())); - m_pJoinPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::Discard)),__tr2qs("Delete"),pDialog,SLOT(deleteClicked())); + m_pJoinPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::Join)), __tr2qs("Join"), pDialog, SLOT(joinClicked())); + m_pJoinPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::Discard)), __tr2qs("Delete"), pDialog, SLOT(deleteClicked())); } m_pJoinPopup->popup(QCursor::pos()); - } else { + } + else + { pDialog->itemSelected(); } } -void ChannelsJoinDialogTreeWidget::mouseDoubleClickEvent(QMouseEvent *e) +void ChannelsJoinDialogTreeWidget::mouseDoubleClickEvent(QMouseEvent * e) { QTreeWidgetItem * it = itemAt(e->pos()); - ChannelsJoinDialog *pDialog = (ChannelsJoinDialog*) parentWidget(); + ChannelsJoinDialog * pDialog = (ChannelsJoinDialog *)parentWidget(); if(!it || !pDialog || !(e->button() & Qt::LeftButton)) return; @@ -330,11 +328,15 @@ void ChannelsJoinDialog::enableJoin() { m_pJoinButton->setEnabled(false); m_pRegButton->setEnabled(false); - } else { + } + else + { m_pJoinButton->setEnabled(true); m_pRegButton->setEnabled(true); } - } else { + } + else + { m_pTreeWidget->setEnabled(false); m_pGroupBox->setEnabled(false); m_pJoinButton->setEnabled(false); @@ -361,7 +363,7 @@ void ChannelsJoinDialog::deleteClicked() { case RegisteredChannelItem: { - KviRegisteredChannel * ch = g_pRegisteredChannelDataBase->find(szChan,QString("*")); + KviRegisteredChannel * ch = g_pRegisteredChannelDataBase->find(szChan, QString("*")); if(ch) g_pRegisteredChannelDataBase->remove(ch); delete it; @@ -369,14 +371,14 @@ void ChannelsJoinDialog::deleteClicked() } case RecentChannelItem: { - KviPointerHashTable * pDict = g_pApp->recentChannels(); + KviPointerHashTable * pDict = g_pApp->recentChannels(); if(!pDict) return; - for(QStringList * pChans = pDict->first();pChans;pChans = pDict->next()) + for(QStringList * pChans = pDict->first(); pChans; pChans = pDict->next()) { for(QStringList::Iterator item = pChans->begin(); item != pChans->end(); ++item) { - if(*item==szChan) + if(*item == szChan) { pChans->removeAll(szChan); delete it; @@ -413,7 +415,7 @@ void ChannelsJoinDialog::joinClicked() if(w->console() != c) w = c; - KviKvsScript::run(szCmd,w); + KviKvsScript::run(szCmd, w); m_pChannelEdit->setText(""); m_pPass->setText(""); @@ -438,11 +440,11 @@ void ChannelsJoinDialog::regClicked() if(w->console() != c) w = c; - KviKvsScript::run(szCmd,w); + KviKvsScript::run(szCmd, w); fillListView(); //focus the new item (in reality, the first matching one) - QList items = m_pTreeWidget->findItems(szTmp, Qt::MatchRecursive | Qt::MatchExactly); + QList items = m_pTreeWidget->findItems(szTmp, Qt::MatchRecursive | Qt::MatchExactly); if(!items.empty()) { m_pTreeWidget->setCurrentItem(items.first()); @@ -462,7 +464,7 @@ void ChannelsJoinDialog::clearClicked() if(w->console() != c) w = c; - KviKvsScript::run(szCmd,w); + KviKvsScript::run(szCmd, w); fillListView(); } diff --git a/src/modules/channelsjoin/ChannelsJoinDialog.h b/src/modules/channelsjoin/ChannelsJoinDialog.h index 5ce69d59d..af54f6f1d 100644 --- a/src/modules/channelsjoin/ChannelsJoinDialog.h +++ b/src/modules/channelsjoin/ChannelsJoinDialog.h @@ -52,17 +52,16 @@ class ChannelsJoinDialogTreeWidget : public QTreeWidget Q_OBJECT public: ChannelsJoinDialogTreeWidget(QWidget * par) - :QTreeWidget(par), m_pJoinPopup(0) - { - }; + : QTreeWidget(par), m_pJoinPopup(0){}; ~ChannelsJoinDialogTreeWidget() { if(m_pJoinPopup) delete m_pJoinPopup; }; + protected: - QMenu * m_pJoinPopup; + QMenu * m_pJoinPopup; /** * \brief Called when the user clicks on the list * \param e mouse event descriptor @@ -80,6 +79,7 @@ class ChannelsJoinDialog : public QDialog { Q_OBJECT friend class ChannelsJoinDialogTreeWidget; + public: /** * \brief Constructs the channels join window @@ -94,17 +94,23 @@ public: ~ChannelsJoinDialog(); protected: - enum ItemTypes { HeaderItem, RecentChannelItem, RegisteredChannelItem }; - QLineEdit * m_pChannelEdit; - ChannelsJoinDialogTreeWidget * m_pTreeWidget; - KviTalGroupBox * m_pGroupBox; - QLineEdit * m_pPass; - QCheckBox * m_pShowAtStartupCheck; - QCheckBox * m_pCloseAfterJoinCheck; - QPushButton * m_pJoinButton; - QPushButton * m_pRegButton; - QPushButton * m_pClearButton; - KviConsoleWindow * m_pConsole; + enum ItemTypes + { + HeaderItem, + RecentChannelItem, + RegisteredChannelItem + }; + QLineEdit * m_pChannelEdit; + ChannelsJoinDialogTreeWidget * m_pTreeWidget; + KviTalGroupBox * m_pGroupBox; + QLineEdit * m_pPass; + QCheckBox * m_pShowAtStartupCheck; + QCheckBox * m_pCloseAfterJoinCheck; + QPushButton * m_pJoinButton; + QPushButton * m_pRegButton; + QPushButton * m_pClearButton; + KviConsoleWindow * m_pConsole; + public: virtual void closeEvent(QCloseEvent * e); diff --git a/src/modules/channelsjoin/libkvichannelsjoin.cpp b/src/modules/channelsjoin/libkvichannelsjoin.cpp index 7af136d9e..2d1fca457 100644 --- a/src/modules/channelsjoin/libkvichannelsjoin.cpp +++ b/src/modules/channelsjoin/libkvichannelsjoin.cpp @@ -33,7 +33,7 @@ #include ChannelsJoinDialog * g_pChannelsWindow = 0; -QRect g_rectChannelsJoinGeometry; +QRect g_rectChannelsJoinGeometry; /* @doc: channelsjoin.open @@ -53,7 +53,8 @@ QRect g_rectChannelsJoinGeometry; static bool channelsjoin_kvs_cmd_open(KviKvsModuleCommandCall * c) { - if(!g_pChannelsWindow)g_pChannelsWindow = new ChannelsJoinDialog("channelsjoin"); + if(!g_pChannelsWindow) + g_pChannelsWindow = new ChannelsJoinDialog("channelsjoin"); g_pChannelsWindow->setConsole(c->window()->console()); @@ -68,23 +69,24 @@ static bool channelsjoin_module_init(KviModule * m) { QString fName; m->getDefaultConfigFileName(fName); - KviConfigurationFile cfg(fName,KviConfigurationFile::Read); + KviConfigurationFile cfg(fName, KviConfigurationFile::Read); - g_rectChannelsJoinGeometry = cfg.readRectEntry("geometry",QRect(30,30,320,410)); + g_rectChannelsJoinGeometry = cfg.readRectEntry("geometry", QRect(30, 30, 320, 410)); - KVSM_REGISTER_SIMPLE_COMMAND(m,"open",channelsjoin_kvs_cmd_open); + KVSM_REGISTER_SIMPLE_COMMAND(m, "open", channelsjoin_kvs_cmd_open); return true; } -static bool channelsjoin_module_cleanup(KviModule *m) +static bool channelsjoin_module_cleanup(KviModule * m) { QString fName; m->getDefaultConfigFileName(fName); - KviConfigurationFile cfg(fName,KviConfigurationFile::Write); + KviConfigurationFile cfg(fName, KviConfigurationFile::Write); - cfg.writeEntry("geometry",g_rectChannelsJoinGeometry); + cfg.writeEntry("geometry", g_rectChannelsJoinGeometry); - if (g_pChannelsWindow)delete g_pChannelsWindow; + if(g_pChannelsWindow) + delete g_pChannelsWindow; g_pChannelsWindow = 0; return true; } @@ -95,13 +97,12 @@ static bool channelsjoin_module_can_unload(KviModule *) } KVIRC_MODULE( - "ChannelsJoin", - "4.0.0", - "Copyright (C) 2001-2006 Juanjo Alvarez (juanjux@yahoo.es), Alexey (wizard@opendoor.ru)", - "Window to join channels in a GUI", - channelsjoin_module_init, - channelsjoin_module_can_unload, - 0, - channelsjoin_module_cleanup, - 0 -) + "ChannelsJoin", + "4.0.0", + "Copyright (C) 2001-2006 Juanjo Alvarez (juanjux@yahoo.es), Alexey (wizard@opendoor.ru)", + "Window to join channels in a GUI", + channelsjoin_module_init, + channelsjoin_module_can_unload, + 0, + channelsjoin_module_cleanup, + 0) diff --git a/src/modules/classeditor/ClassEditorWindow.cpp b/src/modules/classeditor/ClassEditorWindow.cpp index 6d7c407f6..ec54bfe20 100644 --- a/src/modules/classeditor/ClassEditorWindow.cpp +++ b/src/modules/classeditor/ClassEditorWindow.cpp @@ -22,7 +22,6 @@ // //============================================================================= - #include "ClassEditorWindow.h" #include "KviIconManager.h" @@ -65,10 +64,10 @@ extern ClassEditorWindow * g_pClassEditorWindow; extern KviModule * g_pClassEditorModule; ClassEditorTreeWidget::ClassEditorTreeWidget(QWidget * pParent) -: QTreeWidget(pParent) + : QTreeWidget(pParent) { - setColumnCount (1); - setHeaderLabel(__tr2qs_ctx("Class","editor")); + setColumnCount(1); + setHeaderLabel(__tr2qs_ctx("Class", "editor")); setSelectionMode(QAbstractItemView::ExtendedSelection); setRootIsDecorated(true); setAnimated(true); @@ -86,39 +85,39 @@ void ClassEditorTreeWidget::mousePressEvent(QMouseEvent * e) { QTreeWidgetItem * pItem = itemAt(e->pos()); if(pItem) - emit rightButtonPressed(pItem,QCursor::pos()); + emit rightButtonPressed(pItem, QCursor::pos()); } QTreeWidget::mousePressEvent(e); } ClassEditorTreeWidgetItem::ClassEditorTreeWidgetItem(QTreeWidget * pTreeWidget, Type eType, const QString & szName) -: QTreeWidgetItem(pTreeWidget), KviHeapObject(), m_eType(eType) + : QTreeWidgetItem(pTreeWidget), KviHeapObject(), m_eType(eType) { setName(szName); m_szInheritsClassName = ""; - m_iPos = 0; - m_bInternal = false; - m_bClassModified = false; - QPixmap * pIcon = nullptr; + m_iPos = 0; + m_bInternal = false; + m_bClassModified = false; + QPixmap * pIcon = nullptr; if(eType == ClassEditorTreeWidgetItem::Namespace) pIcon = g_pIconManager->getSmallIcon(KviIconManager::NameSpace); else pIcon = g_pIconManager->getSmallIcon(KviIconManager::Class); - setIcon(0,QIcon(*pIcon)); + setIcon(0, QIcon(*pIcon)); } ClassEditorTreeWidgetItem::ClassEditorTreeWidgetItem(ClassEditorTreeWidgetItem * pParentItem, Type eType, const QString & szName) -: QTreeWidgetItem(pParentItem), m_eType(eType) + : QTreeWidgetItem(pParentItem), m_eType(eType) { - setFlags(Qt::ItemIsEditable|Qt::ItemIsEnabled|Qt::ItemIsSelectable); + setFlags(Qt::ItemIsEditable | Qt::ItemIsEnabled | Qt::ItemIsSelectable); setName(szName); m_szInheritsClassName = ""; - m_bInternal = false; - m_iPos = 0; - m_bClassModified = false; - QPixmap * pIcon = nullptr; + m_bInternal = false; + m_iPos = 0; + m_bClassModified = false; + QPixmap * pIcon = nullptr; if(eType == ClassEditorTreeWidgetItem::Namespace) pIcon = g_pIconManager->getSmallIcon(KviIconManager::NameSpace); @@ -127,7 +126,7 @@ ClassEditorTreeWidgetItem::ClassEditorTreeWidgetItem(ClassEditorTreeWidgetItem * else pIcon = g_pIconManager->getSmallIcon(KviIconManager::Function); - setIcon(0,QIcon(*pIcon)); + setIcon(0, QIcon(*pIcon)); } void ClassEditorTreeWidgetItem::setClassNotBuilt(bool bModified) @@ -140,13 +139,13 @@ void ClassEditorTreeWidgetItem::setClassNotBuilt(bool bModified) else pIcon = g_pIconManager->getSmallIcon(KviIconManager::Class); - setIcon(0,QIcon(*pIcon)); + setIcon(0, QIcon(*pIcon)); } void ClassEditorTreeWidgetItem::setName(const QString & szName) { m_szName = szName; - setText(0,m_szName); + setText(0, m_szName); } void ClassEditorTreeWidgetItem::setType(Type eType) @@ -161,13 +160,13 @@ void ClassEditorTreeWidgetItem::setType(Type eType) else pIcon = g_pIconManager->getSmallIcon(KviIconManager::Function); - setIcon(0,QIcon(*pIcon)); + setIcon(0, QIcon(*pIcon)); } ClassEditorWidget::ClassEditorWidget(QWidget * pParent) -: QWidget(pParent) + : QWidget(pParent) { - m_pClasses = new KviPointerHashTable(100,false); + m_pClasses = new KviPointerHashTable(100, false); m_pClasses->setAutoDelete(false); m_pLastEditedItem = 0; m_pLastClickedItem = 0; @@ -175,9 +174,9 @@ ClassEditorWidget::ClassEditorWidget(QWidget * pParent) QGridLayout * pLayout = new QGridLayout(this); - m_pSplitter = new QSplitter(Qt::Horizontal,this); + m_pSplitter = new QSplitter(Qt::Horizontal, this); m_pSplitter->setChildrenCollapsible(false); - pLayout->addWidget(m_pSplitter,0,0); + pLayout->addWidget(m_pSplitter, 0, 0); KviTalVBox * pVBox = new KviTalVBox(m_pSplitter); pVBox->setSpacing(0); @@ -189,13 +188,13 @@ ClassEditorWidget::ClassEditorWidget(QWidget * pParent) KviTalHBox * pHBox = new KviTalHBox(pVBox); pHBox->setSpacing(0); pHBox->setMargin(0); - m_pClassNameLabel = new QLabel(__tr2qs_ctx("No item selected","editor"),pHBox); - pHBox->setStretchFactor(m_pClassNameLabel,2); + m_pClassNameLabel = new QLabel(__tr2qs_ctx("No item selected", "editor"), pHBox); + pHBox->setStretchFactor(m_pClassNameLabel, 2); m_pClassNameLabel->setWordWrap(true); - m_pClassNameRenameButton = new QPushButton(__tr2qs_ctx("Rename","editor"),pHBox); - m_pClassNameRenameButton->setToolTip(__tr2qs_ctx("Edit the class or namespace name","editor")); + m_pClassNameRenameButton = new QPushButton(__tr2qs_ctx("Rename", "editor"), pHBox); + m_pClassNameRenameButton->setToolTip(__tr2qs_ctx("Edit the class or namespace name", "editor")); m_pClassNameRenameButton->setEnabled(false); - connect(m_pClassNameRenameButton,SIGNAL(clicked()),this,SLOT(renameItem())); + connect(m_pClassNameRenameButton, SIGNAL(clicked()), this, SLOT(renameItem())); pHBox = new KviTalHBox(pVBox); pHBox->setSpacing(0); @@ -204,26 +203,26 @@ ClassEditorWidget::ClassEditorWidget(QWidget * pParent) pHBox = new KviTalHBox(pVBox); pHBox->setSpacing(0); pHBox->setMargin(0); - m_pFunctionNameLabel = new QLabel(__tr2qs_ctx("No item selected","editor"),pHBox); - pHBox->setStretchFactor(m_pFunctionNameLabel,2); - m_pFunctionNameRenameButton = new QPushButton(__tr2qs_ctx("Rename","editor"),pHBox); - m_pFunctionNameRenameButton->setToolTip(__tr2qs_ctx("Edit the function member name","editor")); + m_pFunctionNameLabel = new QLabel(__tr2qs_ctx("No item selected", "editor"), pHBox); + pHBox->setStretchFactor(m_pFunctionNameLabel, 2); + m_pFunctionNameRenameButton = new QPushButton(__tr2qs_ctx("Rename", "editor"), pHBox); + m_pFunctionNameRenameButton->setToolTip(__tr2qs_ctx("Edit the function member name", "editor")); m_pFunctionNameRenameButton->setEnabled(false); - connect(m_pFunctionNameRenameButton,SIGNAL(clicked()),this,SLOT(renameFunction())); + connect(m_pFunctionNameRenameButton, SIGNAL(clicked()), this, SLOT(renameFunction())); - m_pReminderLabel = new QLabel(__tr2qs_ctx("No item selected","editor"),pVBox); + m_pReminderLabel = new QLabel(__tr2qs_ctx("No item selected", "editor"), pVBox); m_pReminderLabel->hide(); m_pReminderLabel->setWordWrap(true); m_pEditor = KviScriptEditor::createInstance(pVBox); m_pEditor->setFocus(); - connect(m_pEditor,SIGNAL(find(const QString &)),this,SLOT(slotFindWord(const QString &))); - connect(m_pEditor,SIGNAL(replaceAll(const QString &,const QString &)),this,SLOT(slotReplaceAll(const QString &,const QString &))); - m_pContextPopup = new QMenu(this); + connect(m_pEditor, SIGNAL(find(const QString &)), this, SLOT(slotFindWord(const QString &))); + connect(m_pEditor, SIGNAL(replaceAll(const QString &, const QString &)), this, SLOT(slotReplaceAll(const QString &, const QString &))); + m_pContextPopup = new QMenu(this); oneTimeSetup(); m_pTreeWidget->setSortingEnabled(true); - currentItemChanged(0,0); + currentItemChanged(0, 0); } ClassEditorWidget::~ClassEditorWidget() @@ -271,9 +270,9 @@ QString ClassEditorWidget::buildFullClassName(ClassEditorTreeWidgetItem * pItem) ClassEditorTreeWidgetItem * ClassEditorWidget::findTopLevelItem(const QString & szName) { - for(int i=0; i < m_pTreeWidget->topLevelItemCount(); i++) + for(int i = 0; i < m_pTreeWidget->topLevelItemCount(); i++) { - if(KviQString::equalCI(m_pTreeWidget->topLevelItem(i)->text(0),szName)) + if(KviQString::equalCI(m_pTreeWidget->topLevelItem(i)->text(0), szName)) return (ClassEditorTreeWidgetItem *)m_pTreeWidget->topLevelItem(i); } return nullptr; @@ -289,14 +288,14 @@ ClassEditorTreeWidgetItem * ClassEditorWidget::findItem(const QString & szFullNa if(!pItem) return nullptr; - for(int i=1; i < lNamespaces.count(); i++) + for(int i = 1; i < lNamespaces.count(); i++) { bFound = false; - for(int j=0; j < pItem->childCount(); j++) + for(int j = 0; j < pItem->childCount(); j++) { - if (KviQString::equalCI(pItem->child(j)->text(0),lNamespaces.at(i))) + if(KviQString::equalCI(pItem->child(j)->text(0), lNamespaces.at(i))) { - pItem=( ClassEditorTreeWidgetItem *)pItem->child(j); + pItem = (ClassEditorTreeWidgetItem *)pItem->child(j); bFound = true; break; } @@ -320,18 +319,18 @@ ClassEditorTreeWidgetItem * ClassEditorWidget::createFullItem(const QString & sz ClassEditorTreeWidgetItem * pItem = findTopLevelItem(lNamespaces.at(0)); if(pItem) return pItem; - return new ClassEditorTreeWidgetItem(m_pTreeWidget,ClassEditorTreeWidgetItem::Class,lNamespaces.at(0)); + return new ClassEditorTreeWidgetItem(m_pTreeWidget, ClassEditorTreeWidgetItem::Class, lNamespaces.at(0)); } ClassEditorTreeWidgetItem * pItem = findTopLevelItem(lNamespaces.at(0)); if(!pItem) - pItem = new ClassEditorTreeWidgetItem(m_pTreeWidget,ClassEditorTreeWidgetItem::Namespace,lNamespaces.at(0)); + pItem = new ClassEditorTreeWidgetItem(m_pTreeWidget, ClassEditorTreeWidgetItem::Namespace, lNamespaces.at(0)); - for(i=1; i < lNamespaces.count()-1; i++) + for(i = 1; i < lNamespaces.count() - 1; i++) { bFound = false; - for(int j=0; j < pItem->childCount();j++) + for(int j = 0; j < pItem->childCount(); j++) { - if(KviQString::equalCI(pItem->child(j)->text(0),lNamespaces.at(i))) + if(KviQString::equalCI(pItem->child(j)->text(0), lNamespaces.at(i))) { pItem = (ClassEditorTreeWidgetItem *)pItem->child(j); bFound = true; @@ -339,9 +338,9 @@ ClassEditorTreeWidgetItem * ClassEditorWidget::createFullItem(const QString & sz } } if(!bFound) - pItem = new ClassEditorTreeWidgetItem(pItem,ClassEditorTreeWidgetItem::Namespace,lNamespaces.at(i)); + pItem = new ClassEditorTreeWidgetItem(pItem, ClassEditorTreeWidgetItem::Namespace, lNamespaces.at(i)); } - return new ClassEditorTreeWidgetItem(pItem,ClassEditorTreeWidgetItem::Class,lNamespaces.at(i)); + return new ClassEditorTreeWidgetItem(pItem, ClassEditorTreeWidgetItem::Class, lNamespaces.at(i)); } ClassEditorTreeWidgetItem * ClassEditorWidget::createFullNamespace(const QString & szFullName) @@ -354,16 +353,16 @@ ClassEditorTreeWidgetItem * ClassEditorWidget::createFullNamespace(const QString return nullptr; ClassEditorTreeWidgetItem * pItem = findTopLevelItem(lNamespaces.at(0)); if(!pItem) - pItem = new ClassEditorTreeWidgetItem(m_pTreeWidget,ClassEditorTreeWidgetItem::Namespace,lNamespaces.at(0)); + pItem = new ClassEditorTreeWidgetItem(m_pTreeWidget, ClassEditorTreeWidgetItem::Namespace, lNamespaces.at(0)); if(lNamespaces.count() == 1) return pItem; - for(i=1; i < lNamespaces.count(); i++) + for(i = 1; i < lNamespaces.count(); i++) { bFound = false; - for(int j=0;jchildCount();j++) + for(int j = 0; j < pItem->childCount(); j++) { - if(KviQString::equalCI(pItem->child(j)->text(0),lNamespaces.at(i)) && (( ClassEditorTreeWidgetItem *)pItem->child(j))->isNamespace()) + if(KviQString::equalCI(pItem->child(j)->text(0), lNamespaces.at(i)) && ((ClassEditorTreeWidgetItem *)pItem->child(j))->isNamespace()) { pItem = (ClassEditorTreeWidgetItem *)pItem->child(j); bFound = true; @@ -371,7 +370,7 @@ ClassEditorTreeWidgetItem * ClassEditorWidget::createFullNamespace(const QString } } if(!bFound) - pItem = new ClassEditorTreeWidgetItem(pItem,ClassEditorTreeWidgetItem::Namespace,lNamespaces.at(i)); + pItem = new ClassEditorTreeWidgetItem(pItem, ClassEditorTreeWidgetItem::Namespace, lNamespaces.at(i)); } return pItem; } @@ -381,41 +380,41 @@ void ClassEditorWidget::oneTimeSetup() QStringList sl; QString szClassName; QString szPath; - g_pApp->getLocalKvircDirectory(szPath,KviApplication::Classes); + g_pApp->getLocalKvircDirectory(szPath, KviApplication::Classes); QDir d(szPath); QString szExtension = QString("*%1").arg(KVI_FILEEXTENSION_SCRIPT); // *.kvs sl = d.entryList(QStringList(szExtension), QDir::Files | QDir::NoDotAndDotDot); g_pModuleManager->getModule("objects"); - KviPointerHashTableIterator it(*KviKvsKernel::instance()->objectController()->classDict()); + KviPointerHashTableIterator it(*KviKvsKernel::instance()->objectController()->classDict()); KviKvsObjectClass * pClass = nullptr; ClassEditorTreeWidgetItem * pClassItem = nullptr; while(KviKvsObjectClass * pClass = it.current()) { if(pClass->isBuiltin()) - m_pClasses->insert(it.currentKey(),0); + m_pClasses->insert(it.currentKey(), 0); else { QString szTmp; szTmp = it.currentKey(); - szTmp.replace("::","--"); + szTmp.replace("::", "--"); szTmp.append(".kvs"); if(sl.indexOf(szTmp) == -1) { szClassName = it.currentKey(); pClassItem = createFullItem(szClassName); - createFullClass(it.current(),pClassItem,szClassName); + createFullClass(it.current(), pClassItem, szClassName); } } ++it; } - for(int i=0; i < sl.count(); i++) + for(int i = 0; i < sl.count(); i++) { szClassName = sl.at(i); - szClassName.replace("--","::"); + szClassName.replace("--", "::"); szClassName.chop(4); pClassItem = createFullItem(szClassName); pClass = KviKvsKernel::instance()->objectController()->lookupClass(szClassName); @@ -423,14 +422,14 @@ void ClassEditorWidget::oneTimeSetup() createFullClass(pClass, pClassItem, szClassName); } loadNotBuiltClasses(); - connect(m_pTreeWidget,SIGNAL(currentItemChanged(QTreeWidgetItem *,QTreeWidgetItem *)),this,SLOT(currentItemChanged(QTreeWidgetItem *,QTreeWidgetItem *))); + connect(m_pTreeWidget, SIGNAL(currentItemChanged(QTreeWidgetItem *, QTreeWidgetItem *)), this, SLOT(currentItemChanged(QTreeWidgetItem *, QTreeWidgetItem *))); m_pTreeWidget->setContextMenuPolicy(Qt::CustomContextMenu); - connect(m_pTreeWidget,SIGNAL(customContextMenuRequested(const QPoint &)),this,SLOT(customContextMenuRequested(const QPoint &))); + connect(m_pTreeWidget, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(customContextMenuRequested(const QPoint &))); } void ClassEditorWidget::createFullClass(KviKvsObjectClass * pClass, ClassEditorTreeWidgetItem * pClassItem, const QString & szClassName) { - KviPointerHashTableIterator it(* pClass->getHandlers()); + KviPointerHashTableIterator it(*pClass->getHandlers()); QStringList szFunctionsList; while(it.current()) { @@ -438,19 +437,20 @@ void ClassEditorWidget::createFullClass(KviKvsObjectClass * pClass, ClassEditorT ++it; } szFunctionsList.sort(); - ClassEditorTreeWidgetItem *pFunctionItem; - m_pClasses->insert(szClassName,pClassItem); + ClassEditorTreeWidgetItem * pFunctionItem; + m_pClasses->insert(szClassName, pClassItem); KviKvsObjectClass * pParentClass = pClass->parentClass(); pClassItem->setInheritsClass(pParentClass->name()); - for(int i=0;ilookupFunctionHandler(szFunctionsList.at(i)); - if (pClass->isScriptHandler(szFunctionsList.at(i)) && !pHandler->isClone()) + KviKvsObjectFunctionHandler * pHandler = pClass->lookupFunctionHandler(szFunctionsList.at(i)); + if(pClass->isScriptHandler(szFunctionsList.at(i)) && !pHandler->isClone()) { - pFunctionItem=findFunction(szFunctionsList.at(i), pClassItem); - if(!pFunctionItem) pFunctionItem = new ClassEditorTreeWidgetItem(pClassItem,ClassEditorTreeWidgetItem::Method,szFunctionsList.at(i)); - pClass->getFunctionCode(szCode,*pHandler); + pFunctionItem = findFunction(szFunctionsList.at(i), pClassItem); + if(!pFunctionItem) + pFunctionItem = new ClassEditorTreeWidgetItem(pClassItem, ClassEditorTreeWidgetItem::Method, szFunctionsList.at(i)); + pClass->getFunctionCode(szCode, *pHandler); pFunctionItem->setBuffer(szCode); pFunctionItem->setReminder(pClass->reminder(pHandler)); if(pHandler->flags() & KviKvsObjectFunctionHandler::Internal) @@ -459,7 +459,6 @@ void ClassEditorWidget::createFullClass(KviKvsObjectClass * pClass, ClassEditorT } } - /* void ClassEditorWidget::classRefresh(const QString & szName) { @@ -506,15 +505,15 @@ void ClassEditorWidget::renameFunction() QString szFunctionName = pFunction->name(); QString szReminder = pFunction->reminder(); QString szNewReminder = szReminder; - ClassEditorTreeWidgetItem * pParentClass = (ClassEditorTreeWidgetItem *) pFunction->parent(); + ClassEditorTreeWidgetItem * pParentClass = (ClassEditorTreeWidgetItem *)pFunction->parent(); QString szNewFunctionName = szFunctionName; bool bInternal = pFunction->isInternalFunction(); - if(!askForFunction(szNewFunctionName,szNewReminder,&bInternal,szClassName,true)) + if(!askForFunction(szNewFunctionName, szNewReminder, &bInternal, szClassName, true)) return; - if(KviQString::equalCS(szFunctionName,szNewFunctionName) && bInternal == pFunction->isInternalFunction()) + if(KviQString::equalCS(szFunctionName, szNewFunctionName) && bInternal == pFunction->isInternalFunction()) { - if(!KviQString::equalCS(szNewReminder,szReminder)) + if(!KviQString::equalCS(szNewReminder, szReminder)) { pFunction->setReminder(szNewReminder); KviKvsObjectClass * pClass = KviKvsKernel::instance()->objectController()->lookupClass(szClassName); @@ -523,22 +522,24 @@ void ClassEditorWidget::renameFunction() KviKvsObjectFunctionHandler * pHandler = pClass->lookupFunctionHandler(szFunctionName); if(pHandler) { - pClass->setReminder(szNewReminder,pHandler); + pClass->setReminder(szNewReminder, pHandler); QString szPath; QString szFileName = szClassName.toLower(); szFileName += ".kvs"; - szFileName.replace("::","--"); - g_pApp->getLocalKvircDirectory(szPath,KviApplication::Classes,szFileName); + szFileName.replace("::", "--"); + g_pApp->getLocalKvircDirectory(szPath, KviApplication::Classes, szFileName); pClass->save(szPath); } } - currentItemChanged(pFunction,pFunction); - } else { + currentItemChanged(pFunction, pFunction); + } + else + { g_pClassEditorModule->lock(); QMessageBox::information(this, - __tr2qs_ctx("Name Already Exists - KVIrc","editor"), - __tr2qs_ctx("This function name is already in use. Please choose another one.","editor"), - __tr2qs_ctx("OK, Let me try again...","editor")); + __tr2qs_ctx("Name Already Exists - KVIrc", "editor"), + __tr2qs_ctx("This function name is already in use. Please choose another one.", "editor"), + __tr2qs_ctx("OK, Let me try again...", "editor")); g_pClassEditorModule->unlock(); return; } @@ -546,24 +547,24 @@ void ClassEditorWidget::renameFunction() pFunction->setName(szNewFunctionName); pFunction->setReminder(szNewReminder); - currentItemChanged(pFunction,pFunction); + currentItemChanged(pFunction, pFunction); pFunction->setInternalFunction(bInternal); pParentClass->setClassNotBuilt(true); KviPointerList lInheritedClasses; lInheritedClasses.setAutoDelete(false); - searchInheritedClasses(szClassName,lInheritedClasses); - for(unsigned int i=0; i < lInheritedClasses.count(); i++) + searchInheritedClasses(szClassName, lInheritedClasses); + for(unsigned int i = 0; i < lInheritedClasses.count(); i++) lInheritedClasses.at(i)->setClassNotBuilt(true); activateItem(pFunction); } ClassEditorTreeWidgetItem * ClassEditorWidget::findFunction(const QString & szFunctionName, ClassEditorTreeWidgetItem * pClass) { - for(int i=0; i < pClass->childCount(); i++) + for(int i = 0; i < pClass->childCount(); i++) { - if(KviQString::equalCI(szFunctionName,((ClassEditorTreeWidgetItem *)pClass->child(i))->name())) - return (ClassEditorTreeWidgetItem *) pClass->child(i); + if(KviQString::equalCI(szFunctionName, ((ClassEditorTreeWidgetItem *)pClass->child(i))->name())) + return (ClassEditorTreeWidgetItem *)pClass->child(i); } return nullptr; } @@ -576,7 +577,8 @@ void ClassEditorWidget::renameItem() renameClass(m_pLastEditedItem); else if(m_pLastEditedItem->isNamespace()) renameNamespace(m_pLastEditedItem); - else { + else + { // is function ClassEditorTreeWidgetItem * pParent = (ClassEditorTreeWidgetItem *)m_pLastEditedItem->parent(); if(pParent->isClass()) @@ -591,16 +593,16 @@ void ClassEditorWidget::renameClass(ClassEditorTreeWidgetItem * pClassItem) QString szInheritsClassName = pClassItem->inheritsClass(); QString szNewInheritsClassName = szInheritsClassName; - bool bOk = askForClassName(szNewClassName,szNewInheritsClassName,true); + bool bOk = askForClassName(szNewClassName, szNewInheritsClassName, true); if(!bOk) return; - if(classExists(szNewClassName) && KviQString::equalCS(szClassName,szNewClassName) && KviQString::equalCS(szInheritsClassName,szNewInheritsClassName)) + if(classExists(szNewClassName) && KviQString::equalCS(szClassName, szNewClassName) && KviQString::equalCS(szInheritsClassName, szNewInheritsClassName)) { g_pClassEditorModule->lock(); QMessageBox::information(this, - __tr2qs_ctx("Name Already Exists - KVIrc","editor"), - __tr2qs_ctx("This class name is already in use. Please choose another one.","editor"), - __tr2qs_ctx("OK, Let me try again...","editor")); + __tr2qs_ctx("Name Already Exists - KVIrc", "editor"), + __tr2qs_ctx("This class name is already in use. Please choose another one.", "editor"), + __tr2qs_ctx("OK, Let me try again...", "editor")); g_pClassEditorModule->unlock(); return; } @@ -621,20 +623,22 @@ void ClassEditorWidget::renameClass(ClassEditorTreeWidgetItem * pClassItem) if(szNewClassName.contains("::")) { pNewItem = createFullNamespace(szNewClassName.left(szNewClassName.lastIndexOf("::"))); - pClassItem->setName(szNewClassName.section("::",-1,-1)); + pClassItem->setName(szNewClassName.section("::", -1, -1)); pNewItem->addChild(pClassItem); - } else { + } + else + { pClassItem->setName(szNewClassName); m_pTreeWidget->addTopLevelItem(pClassItem); } - m_pClasses->insert(szNewClassName,pClassItem); + m_pClasses->insert(szNewClassName, pClassItem); pClassItem->setInheritsClass(szNewInheritsClassName); pClassItem->setClassNotBuilt(true); KviPointerList lInheritedClasses; lInheritedClasses.setAutoDelete(false); - searchInheritedClasses(szClassName,lInheritedClasses); - for(unsigned int i=0; i < lInheritedClasses.count(); i++) + searchInheritedClasses(szClassName, lInheritedClasses); + for(unsigned int i = 0; i < lInheritedClasses.count(); i++) { lInheritedClasses.at(i)->setClassNotBuilt(true); lInheritedClasses.at(i)->setExpanded(true); @@ -645,12 +649,14 @@ void ClassEditorWidget::renameClass(ClassEditorTreeWidgetItem * pClassItem) { activateItem(pNewItem); pNewItem->setExpanded(true); - } else { + } + else + { activateItem(pClassItem); pClassItem->setExpanded(true); } - qDebug("delete class %s caused by rename",szClassName.toUtf8().data()); + qDebug("delete class %s caused by rename", szClassName.toUtf8().data()); KviKvsObjectClass * pClass = KviKvsKernel::instance()->objectController()->lookupClass(szClassName); if(pClass) KviKvsKernel::instance()->objectController()->deleteClass(pClass); @@ -659,9 +665,10 @@ void ClassEditorWidget::renameClass(ClassEditorTreeWidgetItem * pClassItem) void ClassEditorWidget::cutItem(ClassEditorTreeWidgetItem * pItem) { int iIdx = m_pTreeWidget->indexOfTopLevelItem(pItem); - if(iIdx!=-1) + if(iIdx != -1) m_pTreeWidget->takeTopLevelItem(iIdx); - else { + else + { ClassEditorTreeWidgetItem * pParent = (ClassEditorTreeWidgetItem *)pItem->parent(); pParent->removeChild(pItem); } @@ -671,9 +678,9 @@ void ClassEditorWidget::renameNamespace(ClassEditorTreeWidgetItem * pOldNamespac { QString szOldNameSpaceName = buildFullClassName(m_pLastEditedItem); QString szNewNameSpaceName; - if(!askForNamespaceName(__tr2qs_ctx("Enter a New Name - KVIrc","editor"),__tr2qs_ctx("Please enter the new name for the namespace.","editor"),szOldNameSpaceName,szNewNameSpaceName)) + if(!askForNamespaceName(__tr2qs_ctx("Enter a New Name - KVIrc", "editor"), __tr2qs_ctx("Please enter the new name for the namespace.", "editor"), szOldNameSpaceName, szNewNameSpaceName)) return; - if(KviQString::equalCI(szOldNameSpaceName,szNewNameSpaceName)) + if(KviQString::equalCI(szOldNameSpaceName, szNewNameSpaceName)) return; ClassEditorTreeWidgetItem * pNewItem = findItem(szNewNameSpaceName); if(pNewItem) @@ -682,34 +689,38 @@ void ClassEditorWidget::renameNamespace(ClassEditorTreeWidgetItem * pOldNamespac if(pNewItem->isClass()) { QMessageBox::information(this, - __tr2qs_ctx("Name Already Exists - KVIrc","editor"), - __tr2qs_ctx("This class name is already in use. Please choose another one.","editor"), - __tr2qs_ctx("OK, Let me try again...","editor")); - } else { + __tr2qs_ctx("Name Already Exists - KVIrc", "editor"), + __tr2qs_ctx("This class name is already in use. Please choose another one.", "editor"), + __tr2qs_ctx("OK, Let me try again...", "editor")); + } + else + { QMessageBox::information(this, - __tr2qs_ctx("Name Already Exists - KVIrc","editor"), - __tr2qs_ctx("This namespace name is already in use. Please choose another one.","editor"), - __tr2qs_ctx("OK, Let me try again...","editor")); + __tr2qs_ctx("Name Already Exists - KVIrc", "editor"), + __tr2qs_ctx("This namespace name is already in use. Please choose another one.", "editor"), + __tr2qs_ctx("OK, Let me try again...", "editor")); } g_pClassEditorModule->unlock(); return; } KviPointerList pList; pList.setAutoDelete(false); - appendAllClassItemsRecursive(&pList,pOldNamespaceItem); + appendAllClassItemsRecursive(&pList, pOldNamespaceItem); cutItem(pOldNamespaceItem); if(szNewNameSpaceName.contains("::")) { - pNewItem=createFullNamespace(szNewNameSpaceName.left(szNewNameSpaceName.lastIndexOf("::"))); - pOldNamespaceItem->setName(szNewNameSpaceName.section("::",-1,-1)); + pNewItem = createFullNamespace(szNewNameSpaceName.left(szNewNameSpaceName.lastIndexOf("::"))); + pOldNamespaceItem->setName(szNewNameSpaceName.section("::", -1, -1)); pNewItem->addChild(pOldNamespaceItem); - } else { + } + else + { m_pTreeWidget->addTopLevelItem(pOldNamespaceItem); pOldNamespaceItem->setName(szNewNameSpaceName); } - for(unsigned int u=0; u < pList.count(); u++) + for(unsigned int u = 0; u < pList.count(); u++) { - KviPointerHashTableEntry * pEntry = m_pClasses->findRef(pList.at(u)); + KviPointerHashTableEntry * pEntry = m_pClasses->findRef(pList.at(u)); if(pEntry) { KviPointerList lInheritedClasses; @@ -717,15 +728,15 @@ void ClassEditorWidget::renameNamespace(ClassEditorTreeWidgetItem * pOldNamespac QString szOldName = pEntry->key(); QString szNewName = buildFullClassName(pList.at(u)); - searchInheritedClasses(szOldName,lInheritedClasses); - for(unsigned int v=0; v < lInheritedClasses.count(); v++) + searchInheritedClasses(szOldName, lInheritedClasses); + for(unsigned int v = 0; v < lInheritedClasses.count(); v++) { lInheritedClasses.at(v)->setClassNotBuilt(true); lInheritedClasses.at(v)->setExpanded(true); lInheritedClasses.at(v)->setInheritsClass(szNewName); } m_pClasses->removeRef(pList.at(u)); - m_pClasses->insert(szNewName,pList.at(u)); + m_pClasses->insert(szNewName, pList.at(u)); pList.at(u)->setClassNotBuilt(true); KviKvsObjectClass * pClass = KviKvsKernel::instance()->objectController()->lookupClass(szOldName); @@ -738,7 +749,9 @@ void ClassEditorWidget::renameNamespace(ClassEditorTreeWidgetItem * pOldNamespac { activateItem(pNewItem); pNewItem->setExpanded(true); - } else { + } + else + { activateItem(pOldNamespaceItem); pOldNamespaceItem->setExpanded(true); } @@ -764,7 +777,7 @@ void ClassEditorWidget::currentItemChanged(QTreeWidgetItem * pTree, QTreeWidgetI m_pLastEditedItem = (ClassEditorTreeWidgetItem *)pTree; if(!m_pLastEditedItem) { - m_pClassNameLabel->setText(__tr2qs_ctx("No item selected","editor")); + m_pClassNameLabel->setText(__tr2qs_ctx("No item selected", "editor")); m_pClassNameRenameButton->setEnabled(false); m_pEditor->setText(""); m_pEditor->setEnabled(false); @@ -781,32 +794,32 @@ void ClassEditorWidget::currentItemChanged(QTreeWidgetItem * pTree, QTreeWidgetI if(m_pLastEditedItem->isNamespace()) { - QString szLabelText = __tr2qs_ctx("Namespace","editor"); + QString szLabelText = __tr2qs_ctx("Namespace", "editor"); szLabelText += ": "; szLabelText += szClassName; szLabelText += ""; m_pClassNameLabel->setText(szLabelText); m_pClassNameRenameButton->setEnabled(true); - m_pFunctionNameRenameButton->setEnabled(false); + m_pFunctionNameRenameButton->setEnabled(false); //m_pinheritsClassNameLabel->setText(""); - m_pFunctionNameLabel->setText(""); + m_pFunctionNameLabel->setText(""); m_pEditor->setText(""); m_pEditor->setEnabled(false); m_pTreeWidget->setFocus(); return; } - QString szLabelText = __tr2qs_ctx("Class","editor"); + QString szLabelText = __tr2qs_ctx("Class", "editor"); szLabelText += ": "; szLabelText += szClassName; szLabelText += ", "; - szLabelText += __tr2qs_ctx("inherits from class ","editor"); + szLabelText += __tr2qs_ctx("inherits from class ", "editor"); szLabelText += ": "; szLabelText += pClassItem->inheritsClass(); szLabelText += ""; m_pClassNameLabel->setText(szLabelText); - szLabelText = __tr2qs_ctx("Member Function","editor"); + szLabelText = __tr2qs_ctx("Member Function", "editor"); if(m_pLastEditedItem->isMethod()) { szLabelText += ": "; @@ -815,8 +828,9 @@ void ClassEditorWidget::currentItemChanged(QTreeWidgetItem * pTree, QTreeWidgetI m_pFunctionNameRenameButton->setEnabled(true); if(m_pLastEditedItem->reminder().isEmpty()) m_pReminderLabel->hide(); - else { - QString szReminderText =__tr2qs_ctx("Reminder text.","editor"); + else + { + QString szReminderText = __tr2qs_ctx("Reminder text.", "editor"); szReminderText += ": "; szReminderText += m_pLastEditedItem->reminder(); szReminderText += ""; @@ -827,7 +841,9 @@ void ClassEditorWidget::currentItemChanged(QTreeWidgetItem * pTree, QTreeWidgetI m_pFunctionNameLabel->setText(szLabelText); m_pFunctionNameLabel->show(); m_pFunctionNameRenameButton->show(); - } else { + } + else + { m_pReminderLabel->hide(); m_pFunctionNameLabel->hide(); m_pClassNameRenameButton->setEnabled(true); @@ -841,23 +857,23 @@ void ClassEditorWidget::currentItemChanged(QTreeWidgetItem * pTree, QTreeWidgetI m_pTreeWidget->setFocus(); QString szBuffer; QStringList szFunctionsList; - KviPointerHashTable lFunctions; + KviPointerHashTable lFunctions; lFunctions.setAutoDelete(false); ClassEditorTreeWidgetItem * pItem = 0; - for(int i=0; i < pTree->childCount(); i++) + for(int i = 0; i < pTree->childCount(); i++) { pItem = ((ClassEditorTreeWidgetItem *)pTree->child(i)); szFunctionsList.append(pItem->name()); - lFunctions.insert(pItem->name(),pItem); + lFunctions.insert(pItem->name(), pItem); } szFunctionsList.sort(); - for(int i=0; i < szFunctionsList.count(); i++) + for(int i = 0; i < szFunctionsList.count(); i++) { szBuffer += "Member Function: $" + szFunctionsList.at(i) + "
"; if(!lFunctions.find(szFunctionsList.at(i))->reminder().isEmpty()) - szBuffer+="Parameters reminder: "+lFunctions.find(szFunctionsList.at(i))->reminder()+"
"; - szBuffer+="
"; + szBuffer += "Parameters reminder: " + lFunctions.find(szFunctionsList.at(i))->reminder() + "
"; + szBuffer += "
"; } m_pEditor->setUnHighlightedText(szBuffer); m_pEditor->setReadOnly(true); @@ -876,107 +892,109 @@ void ClassEditorWidget::customContextMenuRequested(QPoint pnt) m_pLastClickedItem = (ClassEditorTreeWidgetItem *)m_pTreeWidget->itemAt(pnt); - QAction *pAction = m_pContextPopup->addAction( - *(g_pIconManager->getSmallIcon(KviIconManager::NameSpace)), - __tr2qs_ctx("Add Namespace","editor"), - this,SLOT(newNamespace())); + QAction * pAction = m_pContextPopup->addAction( + *(g_pIconManager->getSmallIcon(KviIconManager::NameSpace)), + __tr2qs_ctx("Add Namespace", "editor"), + this, SLOT(newNamespace())); if(!m_pLastClickedItem) - pAction->setEnabled(true); + pAction->setEnabled(true); else - pAction->setEnabled(m_pLastClickedItem->isNamespace()); + pAction->setEnabled(m_pLastClickedItem->isNamespace()); - pAction = m_pContextPopup->addAction( - *(g_pIconManager->getSmallIcon(KviIconManager::Class)), - __tr2qs_ctx("Add Class","editor"), - this,SLOT(newClass())); + pAction = m_pContextPopup->addAction( + *(g_pIconManager->getSmallIcon(KviIconManager::Class)), + __tr2qs_ctx("Add Class", "editor"), + this, SLOT(newClass())); if(!m_pLastClickedItem) - pAction->setEnabled(true); + pAction->setEnabled(true); else - pAction->setEnabled(m_pLastClickedItem->isNamespace()); + pAction->setEnabled(m_pLastClickedItem->isNamespace()); - pAction = m_pContextPopup->addAction( - *(g_pIconManager->getSmallIcon(KviIconManager::Function)), - __tr2qs_ctx("Add Member Function","editor"), - this,SLOT(newMemberFunction())); + pAction = m_pContextPopup->addAction( + *(g_pIconManager->getSmallIcon(KviIconManager::Function)), + __tr2qs_ctx("Add Member Function", "editor"), + this, SLOT(newMemberFunction())); if(!m_pLastClickedItem) - pAction->setEnabled(false); + pAction->setEnabled(false); else - pAction->setEnabled(m_pLastClickedItem->isClass()| m_pLastClickedItem->isMethod()); + pAction->setEnabled(m_pLastClickedItem->isClass() | m_pLastClickedItem->isMethod()); bool bHasItems = m_pTreeWidget->topLevelItemCount(); bool bHasSelected = hasSelectedItems(); - m_pContextPopup->addSeparator(); + m_pContextPopup->addSeparator(); - pAction = m_pContextPopup->addAction( - *(g_pIconManager->getSmallIcon(KviIconManager::Discard)), - __tr2qs_ctx("Remove Selected","editor"), - this,SLOT(removeSelectedItems())); - pAction->setEnabled(bHasSelected); + pAction = m_pContextPopup->addAction( + *(g_pIconManager->getSmallIcon(KviIconManager::Discard)), + __tr2qs_ctx("Remove Selected", "editor"), + this, SLOT(removeSelectedItems())); + pAction->setEnabled(bHasSelected); - m_pContextPopup->addSeparator(); + m_pContextPopup->addSeparator(); m_pContextPopup->addAction( - *(g_pIconManager->getSmallIcon(KviIconManager::Save)), - __tr2qs_ctx("Export Selected...","editor"), - this,SLOT(exportSelected())); - pAction->setEnabled(bHasSelected); + *(g_pIconManager->getSmallIcon(KviIconManager::Save)), + __tr2qs_ctx("Export Selected...", "editor"), + this, SLOT(exportSelected())); + pAction->setEnabled(bHasSelected); m_pContextPopup->addAction( - *(g_pIconManager->getSmallIcon(KviIconManager::Save)), - __tr2qs_ctx("Export Selected in Single Files...","editor"), - this,SLOT(exportSelectedSepFiles())); + *(g_pIconManager->getSmallIcon(KviIconManager::Save)), + __tr2qs_ctx("Export Selected in Single Files...", "editor"), + this, SLOT(exportSelectedSepFiles())); - pAction->setEnabled(bHasSelected); + pAction->setEnabled(bHasSelected); m_pContextPopup->addAction( - *(g_pIconManager->getSmallIcon(KviIconManager::Save)), - __tr2qs_ctx("Export All...","editor"), - this,SLOT(exportAll())); - pAction->setEnabled(bHasItems); + *(g_pIconManager->getSmallIcon(KviIconManager::Save)), + __tr2qs_ctx("Export All...", "editor"), + this, SLOT(exportAll())); + pAction->setEnabled(bHasItems); - m_pContextPopup->addSeparator(); + m_pContextPopup->addSeparator(); m_pContextPopup->addAction( - *(g_pIconManager->getSmallIcon(KviIconManager::Search)), - __tr2qs_ctx("Find in Classes...","editor"), - this,SLOT(slotFind())); - pAction->setEnabled(bHasItems); + *(g_pIconManager->getSmallIcon(KviIconManager::Search)), + __tr2qs_ctx("Find in Classes...", "editor"), + this, SLOT(slotFind())); + pAction->setEnabled(bHasItems); m_pContextPopup->addAction( - *(g_pIconManager->getSmallIcon(KviIconManager::NameSpace)), - __tr2qs_ctx("Collapse All Items","editor"), - this,SLOT(slotCollapseItems())); + *(g_pIconManager->getSmallIcon(KviIconManager::NameSpace)), + __tr2qs_ctx("Collapse All Items", "editor"), + this, SLOT(slotCollapseItems())); - pAction->setEnabled(bHasItems); + pAction->setEnabled(bHasItems); m_pContextPopup->popup(m_pTreeWidget->mapToGlobal(pnt)); } void ClassEditorWidget::searchReplace(const QString & szSearch, bool bReplace, const QString & szReplace) { - KviPointerHashTableIterator it (*m_pClasses); + KviPointerHashTableIterator it(*m_pClasses); while(it.current()) { ClassEditorTreeWidgetItem * pItem = it.current(); - for(int j=0; j < pItem->childCount(); j++) + for(int j = 0; j < pItem->childCount(); j++) { bool bOpened = false; - if(((ClassEditorTreeWidgetItem *)pItem->child(j))->buffer().indexOf(szSearch,0,Qt::CaseInsensitive) != -1) + if(((ClassEditorTreeWidgetItem *)pItem->child(j))->buffer().indexOf(szSearch, 0, Qt::CaseInsensitive) != -1) { - pItem->child(j)->setBackground(0, QColor(255,0,0,128)); + pItem->child(j)->setBackground(0, QColor(255, 0, 0, 128)); if(bReplace) { - QString &buffer=(QString &)((ClassEditorTreeWidgetItem *)pItem->child(j))->buffer(); + QString & buffer = (QString &)((ClassEditorTreeWidgetItem *)pItem->child(j))->buffer(); pItem->setClassNotBuilt(true); - buffer.replace(szSearch,szReplace,Qt::CaseInsensitive); + buffer.replace(szSearch, szReplace, Qt::CaseInsensitive); } if(!bOpened) { openParentItems(pItem->child(j)); bOpened = true; } - } else { - pItem->child(j)->setBackground(0, QColor(255,255,255)); + } + else + { + pItem->child(j)->setBackground(0, QColor(255, 255, 255)); } } ++it; @@ -989,11 +1007,11 @@ void ClassEditorWidget::slotFind() bool bOk; QString szSearch = QInputDialog::getText(this, - __tr2qs_ctx("Find In Classes","editor"), - __tr2qs_ctx("Please enter the text to be searched for. The matching function will be highlighted.","editor"), - QLineEdit::Normal, - "", - &bOk); + __tr2qs_ctx("Find In Classes", "editor"), + __tr2qs_ctx("Please enter the text to be searched for. The matching function will be highlighted.", "editor"), + QLineEdit::Normal, + "", + &bOk); g_pClassEditorModule->unlock(); if(!bOk) @@ -1013,7 +1031,7 @@ void ClassEditorWidget::recursiveCollapseItems(ClassEditorTreeWidgetItem * pItem { if(!pItem) return; - for(int i=0; i < pItem->childCount(); i++) + for(int i = 0; i < pItem->childCount(); i++) { if(pItem->child(i)->childCount()) { @@ -1025,7 +1043,7 @@ void ClassEditorWidget::recursiveCollapseItems(ClassEditorTreeWidgetItem * pItem void ClassEditorWidget::slotCollapseItems() { - for(int i=0; i < m_pTreeWidget->topLevelItemCount(); i++) + for(int i = 0; i < m_pTreeWidget->topLevelItemCount(); i++) { if(m_pTreeWidget->topLevelItem(i)->childCount()) { @@ -1038,7 +1056,7 @@ void ClassEditorWidget::slotCollapseItems() void ClassEditorWidget::slotReplaceAll(const QString & szFind, const QString & szReplace) { m_pEditor->setFindText(szReplace); - searchReplace(szFind,true,szReplace); + searchReplace(szFind, true, szReplace); /* for (int i=0;itopLevelItemCount();i++) { @@ -1061,7 +1079,7 @@ void ClassEditorWidget::exportClassBuffer(QString & szBuffer, ClassEditorTreeWid szBuffer += pItem->inheritsClass(); } szBuffer += "\")\n{\n"; - for(int i=0; i < pItem->childCount(); i++) + for(int i = 0; i < pItem->childCount(); i++) { ClassEditorTreeWidgetItem * pFunction = (ClassEditorTreeWidgetItem *)pItem->child(i); if(pFunction->isMethod()) @@ -1072,7 +1090,7 @@ void ClassEditorWidget::exportClassBuffer(QString & szBuffer, ClassEditorTreeWid szBuffer += "function "; szBuffer += pFunction->name(); szBuffer += "(" + pFunction->reminder() + ")\n"; - QString szCode=pFunction->buffer(); + QString szCode = pFunction->buffer(); KviCommandFormatter::blockFromBuffer(szCode); KviCommandFormatter::indent(szCode); @@ -1089,7 +1107,7 @@ void ClassEditorWidget::exportAll() void ClassEditorWidget::exportSelectedSepFiles() { - exportClasses(true,true); + exportClasses(true, true); } void ClassEditorWidget::exportSelected() @@ -1106,21 +1124,20 @@ void ClassEditorWidget::exportSelectionInSinglesFiles(KviPointerListfirst()) { g_pClassEditorModule->lock(); - QMessageBox::warning(this,__tr2qs_ctx("Warning While Exporting - KVIrc","editor"),__tr2qs_ctx("Must select an entry from the list to export!","editor"),__tr2qs_ctx("OK","editor")); + QMessageBox::warning(this, __tr2qs_ctx("Warning While Exporting - KVIrc", "editor"), __tr2qs_ctx("Must select an entry from the list to export!", "editor"), __tr2qs_ctx("OK", "editor")); g_pClassEditorModule->unlock(); return; } g_pClassEditorModule->lock(); if(!KviFileDialog::askForDirectoryName( - m_szDir, - __tr2qs_ctx("Choose a Directory - KVIrc","editor"), - m_szDir, - QString(), - false, - true, - this - )) + m_szDir, + __tr2qs_ctx("Choose a Directory - KVIrc", "editor"), + m_szDir, + QString(), + false, + true, + this)) { g_pClassEditorModule->unlock(); return; @@ -1132,24 +1149,24 @@ void ClassEditorWidget::exportSelectionInSinglesFiles(KviPointerListfirst(); pItem; pItem = pList->next()) { QString szTmp; - exportClassBuffer(szTmp,pItem); + exportClassBuffer(szTmp, pItem); QString szFileName = buildFullClassName(pItem); szFileName += ".kvs"; - szFileName.replace("::","_"); - QString szCompletePath = m_szDir+szFileName; + szFileName.replace("::", "_"); + QString szCompletePath = m_szDir + szFileName; if(KviFileUtils::fileExists(szCompletePath) && !bReplaceAll) { - QString szMsg = __tr2qs_ctx("The file \"%1\" exists. Do you want to replace it?","editor").arg(szFileName); - int iRet = QMessageBox::question(this,__tr2qs_ctx("Confirm Replacing File - KVIrc","editor"),szMsg,__tr2qs_ctx("Yes","editor"),__tr2qs_ctx("Yes to All","editor"),__tr2qs_ctx("No","editor")); + QString szMsg = __tr2qs_ctx("The file \"%1\" exists. Do you want to replace it?", "editor").arg(szFileName); + int iRet = QMessageBox::question(this, __tr2qs_ctx("Confirm Replacing File - KVIrc", "editor"), szMsg, __tr2qs_ctx("Yes", "editor"), __tr2qs_ctx("Yes to All", "editor"), __tr2qs_ctx("No", "editor")); if(iRet != 2) { - KviFileUtils::writeFile(szCompletePath,szTmp); + KviFileUtils::writeFile(szCompletePath, szTmp); if(iRet == 1) bReplaceAll = true; } } else - KviFileUtils::writeFile(szCompletePath,szTmp); + KviFileUtils::writeFile(szCompletePath, szTmp); } g_pClassEditorModule->unlock(); } @@ -1183,23 +1200,24 @@ void ClassEditorWidget::exportClasses(bool bSelectedOnly, bool bSingleFiles) for(ClassEditorTreeWidgetItem * pItem = list.first(); pItem; pItem = list.next()) { pTempItem = pItem; - if(skiplist.findRef(pItem)!=-1) continue; - ClassEditorTreeWidgetItem *pParentClass = m_pClasses->find(pItem->inheritsClass()); + if(skiplist.findRef(pItem) != -1) + continue; + ClassEditorTreeWidgetItem * pParentClass = m_pClasses->find(pItem->inheritsClass()); KviPointerList linkedClasses; linkedClasses.setAutoDelete(false); linkedClasses.append(pItem); while(pParentClass) { - if(skiplist.findRef(pParentClass)!=-1) + if(skiplist.findRef(pParentClass) != -1) break; linkedClasses.append(pParentClass); pParentClass = m_pClasses->find(pParentClass->inheritsClass()); } - for(int i = linkedClasses.count()-1; i >= 0; i--) + for(int i = linkedClasses.count() - 1; i >= 0; i--) { iCount++; QString szTmp; - exportClassBuffer(szTmp,linkedClasses.at(i)); + exportClassBuffer(szTmp, linkedClasses.at(i)); skiplist.append(linkedClasses.at(i)); szOut += szTmp; szOut += "\n"; @@ -1209,7 +1227,7 @@ void ClassEditorWidget::exportClasses(bool bSelectedOnly, bool bSingleFiles) if(szOut.isEmpty()) { g_pClassEditorModule->lock(); - QMessageBox::warning(this,__tr2qs_ctx("Warning While Exporting - KVIrc","editor"),__tr2qs_ctx("The exported class file could be empty: cowardly refusing to write it","editor"),__tr2qs_ctx("OK","editor")); + QMessageBox::warning(this, __tr2qs_ctx("Warning While Exporting - KVIrc", "editor"), __tr2qs_ctx("The exported class file could be empty: cowardly refusing to write it", "editor"), __tr2qs_ctx("OK", "editor")); g_pClassEditorModule->unlock(); return; } @@ -1223,45 +1241,45 @@ void ClassEditorWidget::exportClasses(bool bSelectedOnly, bool bSingleFiles) if(iCount != 1) szNameFile = "classes"; - else { + else + { QString szTmp = buildFullClassName(pTempItem); - szNameFile = szTmp.replace("::","_"); + szNameFile = szTmp.replace("::", "_"); } szName += szNameFile; szName += ".kvs"; if(!KviFileDialog::askForSaveFileName( - szFile, - __tr2qs_ctx("Choose a Filename - KVIrc","editor"), - szName, - KVI_FILTER_SCRIPT, - false, - true, - true, - this - )) + szFile, + __tr2qs_ctx("Choose a Filename - KVIrc", "editor"), + szName, + KVI_FILTER_SCRIPT, + false, + true, + true, + this)) { g_pClassEditorModule->unlock(); return; } - m_szDir=QFileInfo(szFile).absolutePath(); + m_szDir = QFileInfo(szFile).absolutePath(); g_pClassEditorModule->unlock(); - if(!KviFileUtils::writeFile(szFile,szOut)) + if(!KviFileUtils::writeFile(szFile, szOut)) { g_pClassEditorModule->lock(); - QMessageBox::warning(this,__tr2qs_ctx("Write to Classes File Failed - KVIrc","editor"),__tr2qs_ctx("Unable to write to the classes file.","editor"),__tr2qs_ctx("OK","editor")); + QMessageBox::warning(this, __tr2qs_ctx("Write to Classes File Failed - KVIrc", "editor"), __tr2qs_ctx("Unable to write to the classes file.", "editor"), __tr2qs_ctx("OK", "editor")); g_pClassEditorModule->unlock(); } } void ClassEditorWidget::saveProperties(KviConfigurationFile * pCfg) { - pCfg->writeEntry("Sizes",m_pSplitter->sizes()); + pCfg->writeEntry("Sizes", m_pSplitter->sizes()); QString szName; if(m_pLastEditedItem) szName = buildFullClassName(m_pLastEditedItem); - pCfg->writeEntry("LastClass",szName); + pCfg->writeEntry("LastClass", szName); } void ClassEditorWidget::loadProperties(KviConfigurationFile * pCfg) @@ -1269,8 +1287,8 @@ void ClassEditorWidget::loadProperties(KviConfigurationFile * pCfg) QList def; def.append(20); def.append(80); - m_pSplitter->setSizes(pCfg->readIntListEntry("Sizes",def)); - QString szTmp = pCfg->readEntry("LastClass",QString()); + m_pSplitter->setSizes(pCfg->readIntListEntry("Sizes", def)); + QString szTmp = pCfg->readEntry("LastClass", QString()); ClassEditorTreeWidgetItem * pItem = findItem(szTmp); activateItem(pItem); @@ -1279,28 +1297,29 @@ void ClassEditorWidget::loadProperties(KviConfigurationFile * pCfg) void ClassEditorWidget::appendSelectedClassItems(KviPointerList * pList) { QList list = m_pTreeWidget->selectedItems(); - for(int i=0; i < list.count(); i++) + for(int i = 0; i < list.count(); i++) { if(((ClassEditorTreeWidgetItem *)list.at(i))->isClass()) pList->append((ClassEditorTreeWidgetItem *)list.at(i)); - else appendSelectedClassItemsRecursive(pList,list.at(i)); + else + appendSelectedClassItemsRecursive(pList, list.at(i)); } } void ClassEditorWidget::appendSelectedClassItemsRecursive(KviPointerList * pList, QTreeWidgetItem * pStartFrom) { - for(int i=0; i < pStartFrom->childCount(); i++) + for(int i = 0; i < pStartFrom->childCount(); i++) { if(((ClassEditorTreeWidgetItem *)pStartFrom->child(i))->isClass()) pList->append(((ClassEditorTreeWidgetItem *)pStartFrom->child(i))); else - appendSelectedClassItemsRecursive(pList,pStartFrom->child(i)); + appendSelectedClassItemsRecursive(pList, pStartFrom->child(i)); } } void ClassEditorWidget::appendAllClassItems(KviPointerList * pList) { - KviPointerHashTableIterator it (*m_pClasses); + KviPointerHashTableIterator it(*m_pClasses); while(it.current()) { pList->append(it.current()); @@ -1310,25 +1329,27 @@ void ClassEditorWidget::appendAllClassItems(KviPointerList * pList, QTreeWidgetItem * pStartFrom) { - for(int i=0; i < pStartFrom->childCount(); i++) + for(int i = 0; i < pStartFrom->childCount(); i++) { if(((ClassEditorTreeWidgetItem *)pStartFrom->child(i))->isClass()) { pList->append((ClassEditorTreeWidgetItem *)pStartFrom->child(i)); - } else { - appendAllClassItemsRecursive(pList,pStartFrom->child(i)); + } + else + { + appendAllClassItemsRecursive(pList, pStartFrom->child(i)); } } } -void ClassEditorWidget::removeItemChildren(ClassEditorTreeWidgetItem * pItem, KviPointerList & lRemovedItems) +void ClassEditorWidget::removeItemChildren(ClassEditorTreeWidgetItem * pItem, KviPointerList & lRemovedItems) { if(pItem->isClass()) { KviPointerList lInheritedClasses; lInheritedClasses.setAutoDelete(false); - searchInheritedClasses(buildFullClassName(pItem),lInheritedClasses); - for(unsigned int u=0; u < lInheritedClasses.count(); u++) + searchInheritedClasses(buildFullClassName(pItem), lInheritedClasses); + for(unsigned int u = 0; u < lInheritedClasses.count(); u++) { lInheritedClasses.at(u)->setClassNotBuilt(true); lInheritedClasses.at(u)->setExpanded(true); @@ -1340,14 +1361,14 @@ void ClassEditorWidget::removeItemChildren(ClassEditorTreeWidgetItem * pItem, Kv { ClassEditorTreeWidgetItem * pChild = (ClassEditorTreeWidgetItem *)(pItem->child(0)); if(pChild->childCount()) - removeItemChildren(pChild,lRemovedItems); + removeItemChildren(pChild, lRemovedItems); if(pChild->isClass()) { m_pClasses->removeRef(pChild); KviKvsObjectClass * pClass = KviKvsKernel::instance()->objectController()->lookupClass(buildFullClassName(pChild)); if(pClass) KviKvsKernel::instance()->objectController()->deleteClass(pClass); - qDebug("removing class %s %p",buildFullClassName(pChild).toUtf8().data(), pClass); + qDebug("removing class %s %p", buildFullClassName(pChild).toUtf8().data(), pClass); } pItem->removeChild(pChild); lRemovedItems.append(pItem); @@ -1355,7 +1376,7 @@ void ClassEditorWidget::removeItemChildren(ClassEditorTreeWidgetItem * pItem, Kv } } -bool ClassEditorWidget::removeItem(ClassEditorTreeWidgetItem * pItem, KviPointerList & lRemovedItems, bool * pbYesToAll) +bool ClassEditorWidget::removeItem(ClassEditorTreeWidgetItem * pItem, KviPointerList & lRemovedItems, bool * pbYesToAll) { if(!pItem) return true; @@ -1367,31 +1388,33 @@ bool ClassEditorWidget::removeItem(ClassEditorTreeWidgetItem * pItem, KviPointer saveLastEditedItem(); if(pItem->isClass()) { - szMsg = QString(__tr2qs_ctx("Do you really want to remove the class \"%1\"?","editor")).arg(szName); - } else if(pItem->isNamespace()) + szMsg = QString(__tr2qs_ctx("Do you really want to remove the class \"%1\"?", "editor")).arg(szName); + } + else if(pItem->isNamespace()) { - szMsg = QString(__tr2qs_ctx("Do you really want to remove the namespace \"%1\"?","editor")).arg(szName); + szMsg = QString(__tr2qs_ctx("Do you really want to remove the namespace \"%1\"?", "editor")).arg(szName); szMsg += "
"; - szMsg += __tr2qs_ctx("Please note that all the child classes/functions will also be deleted.","editor"); - } else if(pItem->isMethod()) + szMsg += __tr2qs_ctx("Please note that all the child classes/functions will also be deleted.", "editor"); + } + else if(pItem->isMethod()) { - szMsg = QString(__tr2qs_ctx("Do you really want to remove the function \"%1\"?","editor")).arg(szName); + szMsg = QString(__tr2qs_ctx("Do you really want to remove the function \"%1\"?", "editor")).arg(szName); } g_pClassEditorModule->lock(); - int iRet = QMessageBox::question(this,__tr2qs_ctx("Confirm Removing Item - KVIrc","editor"),szMsg,__tr2qs_ctx("Yes","editor"),__tr2qs_ctx("Yes to All","editor"),__tr2qs_ctx("No","editor")); + int iRet = QMessageBox::question(this, __tr2qs_ctx("Confirm Removing Item - KVIrc", "editor"), szMsg, __tr2qs_ctx("Yes", "editor"), __tr2qs_ctx("Yes to All", "editor"), __tr2qs_ctx("No", "editor")); g_pClassEditorModule->unlock(); switch(iRet) { case 0: // nothing - break; + break; case 1: *pbYesToAll = true; - break; + break; default: return false; - break; + break; } } @@ -1400,25 +1423,25 @@ bool ClassEditorWidget::removeItem(ClassEditorTreeWidgetItem * pItem, KviPointer if(pItem == m_pLastClickedItem) m_pLastClickedItem = 0; if(pItem->childCount()) - removeItemChildren(pItem,lRemovedItems); + removeItemChildren(pItem, lRemovedItems); if(pItem->isClass()) { m_pClasses->removeRef(pItem); KviKvsObjectClass * pClass = KviKvsKernel::instance()->objectController()->lookupClass(buildFullClassName(pItem)); - qDebug("removing class %s %p",buildFullClassName(pItem).toUtf8().data(), pClass); + qDebug("removing class %s %p", buildFullClassName(pItem).toUtf8().data(), pClass); if(pClass) KviKvsKernel::instance()->objectController()->deleteClass(pClass); else { QString szFileName = buildFullClassName(pItem); - szFileName.replace("::","--"); + szFileName.replace("::", "--"); szFileName.append(KVI_FILEEXTENSION_SCRIPT); QString szPath; - g_pApp->getLocalKvircDirectory(szPath,KviApplication::Classes); + g_pApp->getLocalKvircDirectory(szPath, KviApplication::Classes); QDir d(szPath); if(d.exists(szFileName)) { - qDebug("Removing file %s from disk",szFileName.toUtf8().data()); + qDebug("Removing file %s from disk", szFileName.toUtf8().data()); d.remove(szFileName); } } @@ -1437,8 +1460,8 @@ void ClassEditorWidget::updateClassHierarchy(ClassEditorTreeWidgetItem * pClass) pClass->setClassNotBuilt(true); KviPointerList lInheritedClasses; lInheritedClasses.setAutoDelete(false); - searchInheritedClasses(pClass->name(),lInheritedClasses); - for(unsigned int u=0; u < lInheritedClasses.count(); u++) + searchInheritedClasses(pClass->name(), lInheritedClasses); + for(unsigned int u = 0; u < lInheritedClasses.count(); u++) { lInheritedClasses.at(u)->setClassNotBuilt(true); lInheritedClasses.at(u)->setInheritsClass(pClass->name()); @@ -1452,18 +1475,18 @@ void ClassEditorWidget::removeSelectedItems() lRemovedItems.setAutoDelete(false); QList list = m_pTreeWidget->selectedItems(); bool bYesToAll = false; - for(int i=0; i < list.count(); i++) + for(int i = 0; i < list.count(); i++) { - if(lRemovedItems.findRef((ClassEditorTreeWidgetItem *) list.at(i)) != -1) + if(lRemovedItems.findRef((ClassEditorTreeWidgetItem *)list.at(i)) != -1) continue; - if(!removeItem((ClassEditorTreeWidgetItem *) list.at(i),lRemovedItems,&bYesToAll)) + if(!removeItem((ClassEditorTreeWidgetItem *)list.at(i), lRemovedItems, &bYesToAll)) return; } } bool ClassEditorWidget::askForClassName(QString & szClassName, QString & szInheritsClassName, bool bEdit) { - KviClassEditorDialog * pDialog = new KviClassEditorDialog(this,"classdialog",m_pClasses,szClassName,szInheritsClassName,bEdit); + KviClassEditorDialog * pDialog = new KviClassEditorDialog(this, "classdialog", m_pClasses, szClassName, szInheritsClassName, bEdit); szClassName = ""; g_pClassEditorModule->lock(); bool bOk = pDialog->exec(); @@ -1481,7 +1504,7 @@ bool ClassEditorWidget::askForClassName(QString & szClassName, QString & szInher bool ClassEditorWidget::askForFunction(QString & szFunctionName, QString & szReminder, bool * bInternal, const QString & szClassName, bool bRenameMode) { - KviClassEditorFunctionDialog * pDialog = new KviClassEditorFunctionDialog(this,"function",szClassName,szFunctionName,szReminder,*bInternal, bRenameMode); + KviClassEditorFunctionDialog * pDialog = new KviClassEditorFunctionDialog(this, "function", szClassName, szFunctionName, szReminder, *bInternal, bRenameMode); szFunctionName = ""; g_pClassEditorModule->lock(); bool bOk = pDialog->exec(); @@ -1505,11 +1528,11 @@ bool ClassEditorWidget::askForNamespaceName(const QString & szAction, const QStr { g_pClassEditorModule->lock(); szNewName = QInputDialog::getText(this, - szAction, - szText, - QLineEdit::Normal, - szInitialText, - &bOk); + szAction, + szText, + QLineEdit::Normal, + szInitialText, + &bOk); g_pClassEditorModule->unlock(); if(!bOk) return false; @@ -1517,9 +1540,9 @@ bool ClassEditorWidget::askForNamespaceName(const QString & szAction, const QStr { g_pClassEditorModule->lock(); QMessageBox::warning(this, - __tr2qs_ctx("Invalid or Missing Name - KVIrc","editor"), - __tr2qs_ctx("You must specify a valid name for the namespace.","editor"), - __tr2qs_ctx("OK, Let me try again...","editor")); + __tr2qs_ctx("Invalid or Missing Name - KVIrc", "editor"), + __tr2qs_ctx("You must specify a valid name for the namespace.", "editor"), + __tr2qs_ctx("OK, Let me try again...", "editor")); g_pClassEditorModule->unlock(); continue; } @@ -1530,34 +1553,34 @@ bool ClassEditorWidget::askForNamespaceName(const QString & szAction, const QStr { g_pClassEditorModule->lock(); QMessageBox::information(this, - __tr2qs_ctx("Invalid Name - KVIrc","editor"), - __tr2qs_ctx("Namespace names can contain only letters, digits, underscores and '::' namespace separators.","editor"), - __tr2qs_ctx("OK, Let me try again...","editor")); + __tr2qs_ctx("Invalid Name - KVIrc", "editor"), + __tr2qs_ctx("Namespace names can contain only letters, digits, underscores and '::' namespace separators.", "editor"), + __tr2qs_ctx("OK, Let me try again...", "editor")); g_pClassEditorModule->unlock(); szNewName = ""; continue; } // make sure that we have only doubled "::" and not ":" or ":::..." QString szTmp = szNewName; - szTmp.replace("::","@"); // @ is not allowed by the rule above - if(szTmp.indexOf(":",Qt::CaseInsensitive) != -1) + szTmp.replace("::", "@"); // @ is not allowed by the rule above + if(szTmp.indexOf(":", Qt::CaseInsensitive) != -1) { g_pClassEditorModule->lock(); QMessageBox::information(this, - __tr2qs_ctx("Invalid Name - KVIrc","editor"), - __tr2qs_ctx("Stray ':' character in namespace name: did you mean ...::?","editor"), - __tr2qs_ctx("OK, Let me try again...","editor")); + __tr2qs_ctx("Invalid Name - KVIrc", "editor"), + __tr2qs_ctx("Stray ':' character in namespace name: did you mean ...::?", "editor"), + __tr2qs_ctx("OK, Let me try again...", "editor")); g_pClassEditorModule->unlock(); szNewName = ""; continue; } - if(szTmp.indexOf("@@",Qt::CaseInsensitive) != -1) + if(szTmp.indexOf("@@", Qt::CaseInsensitive) != -1) { g_pClassEditorModule->lock(); QMessageBox::information(this, - __tr2qs_ctx("Invalid Name - KVIrc","editor"), - __tr2qs_ctx("Found an empty namespace in namespace name.","editor"), - __tr2qs_ctx("OK, Let me try again...","editor")); + __tr2qs_ctx("Invalid Name - KVIrc", "editor"), + __tr2qs_ctx("Found an empty namespace in namespace name.", "editor"), + __tr2qs_ctx("OK, Let me try again...", "editor")); g_pClassEditorModule->unlock(); szNewName = ""; continue; @@ -1587,10 +1610,10 @@ void ClassEditorWidget::newClass() { QString szClassName; QString szinheritsClassName; - askForClassName(szClassName,szinheritsClassName,false); + askForClassName(szClassName, szinheritsClassName, false); if(szClassName.isEmpty()) return; - ClassEditorTreeWidgetItem * pItem = newItem(szClassName,ClassEditorTreeWidgetItem::Class); + ClassEditorTreeWidgetItem * pItem = newItem(szClassName, ClassEditorTreeWidgetItem::Class); KviQString::escapeKvs(&szClassName, KviQString::EscapeSpace); KviQString::escapeKvs(&szinheritsClassName, KviQString::EscapeSpace); @@ -1600,18 +1623,18 @@ void ClassEditorWidget::newClass() szClass += "){}\n"; pItem->setInheritsClass(szinheritsClassName); activateItem(pItem); - m_pClasses->insert(szClassName,pItem); - KviKvsScript::run(szClass,g_pActiveWindow); + m_pClasses->insert(szClassName, pItem); + KviKvsScript::run(szClass, g_pActiveWindow); } void ClassEditorWidget::newNamespace() { QString szName; - if(!askForNamespaceName(__tr2qs_ctx("Enter a Filename - KVIrc","editor"),__tr2qs_ctx("Please enter the name for the new namespace.","editor"),"mynamespace",szName)) + if(!askForNamespaceName(__tr2qs_ctx("Enter a Filename - KVIrc", "editor"), __tr2qs_ctx("Please enter the name for the new namespace.", "editor"), "mynamespace", szName)) return; if(szName.isEmpty()) return; - ClassEditorTreeWidgetItem * pItem = newItem(szName,ClassEditorTreeWidgetItem::Namespace); + ClassEditorTreeWidgetItem * pItem = newItem(szName, ClassEditorTreeWidgetItem::Namespace); activateItem(pItem); } @@ -1622,26 +1645,26 @@ void ClassEditorWidget::newMemberFunction() QString szReminder; if(m_pLastClickedItem->isMethod()) - m_pLastClickedItem = (ClassEditorTreeWidgetItem*)m_pLastClickedItem->parent(); + m_pLastClickedItem = (ClassEditorTreeWidgetItem *)m_pLastClickedItem->parent(); szClassName = buildFullClassName(m_pLastClickedItem); bool bInternal = false; - if(!askForFunction(szFunctionName, szReminder,&bInternal,szClassName,false)) + if(!askForFunction(szFunctionName, szReminder, &bInternal, szClassName, false)) return; if(szFunctionName.isEmpty()) return; - ClassEditorTreeWidgetItem * pItem = newItem(szFunctionName,ClassEditorTreeWidgetItem::Method); + ClassEditorTreeWidgetItem * pItem = newItem(szFunctionName, ClassEditorTreeWidgetItem::Method); pItem->setInternalFunction(bInternal); if(!szReminder.isEmpty()) pItem->setReminder(szReminder); activateItem(pItem); - ((ClassEditorTreeWidgetItem*)pItem->parent())->setClassNotBuilt(true); + ((ClassEditorTreeWidgetItem *)pItem->parent())->setClassNotBuilt(true); } ClassEditorTreeWidgetItem * ClassEditorWidget::newItem(QString & szName, ClassEditorTreeWidgetItem::Type eType) { if(m_pLastClickedItem) - buildFullItemPath(m_pLastClickedItem,szName); + buildFullItemPath(m_pLastClickedItem, szName); QString szTmp; if(findItem(szName)) @@ -1664,7 +1687,7 @@ ClassEditorTreeWidgetItem * ClassEditorWidget::newItem(QString & szName, ClassEd void ClassEditorWidget::build() { saveLastEditedItem(); - KviPointerHashTableIterator it (*m_pClasses); + KviPointerHashTableIterator it(*m_pClasses); KviPointerList linkedClasses; linkedClasses.setAutoDelete(false); KviPointerList skipClasses; @@ -1691,7 +1714,7 @@ void ClassEditorWidget::build() linkedClasses.append(pParentClass); pParentClass = m_pClasses->find(pParentClass->inheritsClass()); } - for(int i = linkedClasses.count()-1; i >= 0; i--) + for(int i = linkedClasses.count() - 1; i >= 0; i--) { QString szFullClassName = buildFullClassName(linkedClasses.at(i)); KviKvsObjectClass * pClass = KviKvsKernel::instance()->objectController()->lookupClass(szFullClassName); @@ -1699,29 +1722,29 @@ void ClassEditorWidget::build() KviKvsKernel::instance()->objectController()->deleteClass(pClass); QString szClass; exportClassBuffer(szClass, linkedClasses.at(i)); - KviKvsScript::run(szClass,g_pActiveWindow); + KviKvsScript::run(szClass, g_pActiveWindow); pClass = KviKvsKernel::instance()->objectController()->lookupClass(szFullClassName); if(!pClass) { bErrorWhilecompiling = true; - QString szError = __tr2qs_ctx("Unable to compile class: ","editor"); + QString szError = __tr2qs_ctx("Unable to compile class: ", "editor"); szError += szFullClassName + "\n"; KviPointerList lInheritedClasses; lInheritedClasses.setAutoDelete(false); - searchInheritedClasses(szFullClassName,lInheritedClasses); + searchInheritedClasses(szFullClassName, lInheritedClasses); if(lInheritedClasses.count()) { - szError += __tr2qs_ctx("These inherited classes will be not compiled too:","editor"); + szError += __tr2qs_ctx("These inherited classes will be not compiled too:", "editor"); szError += "\n"; - for(unsigned int u=0; u < lInheritedClasses.count(); u++) + for(unsigned int u = 0; u < lInheritedClasses.count(); u++) { szError += buildFullClassName(lInheritedClasses.at(u)) + "\n"; lInheritedClasses.at(u)->setClassNotBuilt(true); skipClasses.append(lInheritedClasses.at(u)); } } - QMessageBox::critical(this,__tr2qs_ctx("Compilation Error - KVIrc","editor"),szError, - QMessageBox::Ok,QMessageBox::NoButton,QMessageBox::NoButton); + QMessageBox::critical(this, __tr2qs_ctx("Compilation Error - KVIrc", "editor"), szError, + QMessageBox::Ok, QMessageBox::NoButton, QMessageBox::NoButton); break; } //else qDebug("class compiled %s :\n",szClass.toUtf8().data()); @@ -1733,11 +1756,12 @@ void ClassEditorWidget::build() } if(bErrorWhilecompiling) saveNotBuiltClasses(); - else { + else + { QString szFileName = "libkviclasseditortmp.kvc"; QString szBuffer; - g_pApp->getLocalKvircDirectory(szBuffer,KviApplication::ConfigPlugins,szFileName); - KviConfigurationFile cfg(szBuffer,KviConfigurationFile::Write); + g_pApp->getLocalKvircDirectory(szBuffer, KviApplication::ConfigPlugins, szFileName); + KviConfigurationFile cfg(szBuffer, KviConfigurationFile::Write); cfg.clear(); cfg.sync(); } @@ -1748,8 +1772,8 @@ void ClassEditorWidget::loadNotBuiltClasses() { QString szFileName = "libkviclasseditortmp.kvc"; QString szBuffer; - g_pApp->getLocalKvircDirectory(szBuffer,KviApplication::ConfigPlugins,szFileName); - KviConfigurationFile cfg(szBuffer,KviConfigurationFile::Read); + g_pApp->getLocalKvircDirectory(szBuffer, KviApplication::ConfigPlugins, szFileName); + KviConfigurationFile cfg(szBuffer, KviConfigurationFile::Read); KviConfigurationFileIterator it(*(cfg.dict())); KviPointerList l; @@ -1765,7 +1789,7 @@ void ClassEditorWidget::loadNotBuiltClasses() { cfg.setGroup(*pszTmp); ClassEditorTreeWidgetItem * pClassItem = createFullItem(*pszTmp); - m_pClasses->insert(*pszTmp,pClassItem); + m_pClasses->insert(*pszTmp, pClassItem); pClassItem->setClassNotBuilt(true); KviConfigurationFileGroup * pDict = cfg.dict()->find(*pszTmp); if(pDict) @@ -1781,21 +1805,21 @@ void ClassEditorWidget::loadNotBuiltClasses() for(QString * pszTmp = names.first(); pszTmp; pszTmp = names.next()) { - if(KviQString::equalCI(*pszTmp,"@Inherits")) + if(KviQString::equalCI(*pszTmp, "@Inherits")) { - pClassItem->setInheritsClass(cfg.readEntry(*pszTmp,"")); + pClassItem->setInheritsClass(cfg.readEntry(*pszTmp, "")); continue; } - if((*pszTmp).left(9) == "@Reminder") + if((*pszTmp).left(9) == "@Reminder") continue; - QString szCode = cfg.readEntry(*pszTmp,""); + QString szCode = cfg.readEntry(*pszTmp, ""); ClassEditorTreeWidgetItem * pFunctionItem = findFunction(*pszTmp, pClassItem); if(!pFunctionItem) - pFunctionItem = new ClassEditorTreeWidgetItem(pClassItem,ClassEditorTreeWidgetItem::Method,*pszTmp); + pFunctionItem = new ClassEditorTreeWidgetItem(pClassItem, ClassEditorTreeWidgetItem::Method, *pszTmp); pFunctionItem->setBuffer(szCode); - QString szEntry = "@Reminder|" + (*pszTmp); - QString szReminder = cfg.readEntry(szEntry,""); - pFunctionItem->setReminder(szReminder); + QString szEntry = "@Reminder|" + (*pszTmp); + QString szReminder = cfg.readEntry(szEntry, ""); + pFunctionItem->setReminder(szReminder); } } } @@ -1804,11 +1828,11 @@ void ClassEditorWidget::loadNotBuiltClasses() void ClassEditorWidget::saveNotBuiltClasses() { saveLastEditedItem(); - KviPointerHashTableIterator it (*m_pClasses); + KviPointerHashTableIterator it(*m_pClasses); QString szFileName = "libkviclasseditortmp.kvc"; QString szBuffer; - g_pApp->getLocalKvircDirectory(szBuffer,KviApplication::ConfigPlugins,szFileName); - KviConfigurationFile cfg(szBuffer,KviConfigurationFile::Write); + g_pApp->getLocalKvircDirectory(szBuffer, KviApplication::ConfigPlugins, szFileName); + KviConfigurationFile cfg(szBuffer, KviConfigurationFile::Write); cfg.clear(); while(it.current()) @@ -1820,16 +1844,16 @@ void ClassEditorWidget::saveNotBuiltClasses() KviKvsKernel::instance()->objectController()->deleteClass(pClass); cfg.setGroup(it.currentKey()); - cfg.writeEntry("@Inherits",it.current()->inheritsClass()); + cfg.writeEntry("@Inherits", it.current()->inheritsClass()); QString szReminderEntry; - for(int i=0; i < it.current()->childCount(); i++) + for(int i = 0; i < it.current()->childCount(); i++) { if(!((ClassEditorTreeWidgetItem *)it.current()->child(i))->reminder().isEmpty()) { - szReminderEntry="@Reminder|"+((ClassEditorTreeWidgetItem *)it.current()->child(i))->name(); - cfg.writeEntry(szReminderEntry,((ClassEditorTreeWidgetItem *)it.current()->child(i))->reminder()); + szReminderEntry = "@Reminder|" + ((ClassEditorTreeWidgetItem *)it.current()->child(i))->name(); + cfg.writeEntry(szReminderEntry, ((ClassEditorTreeWidgetItem *)it.current()->child(i))->reminder()); } - cfg.writeEntry(((ClassEditorTreeWidgetItem *)it.current()->child(i))->name(),((ClassEditorTreeWidgetItem *)it.current()->child(i))->buffer()); + cfg.writeEntry(((ClassEditorTreeWidgetItem *)it.current()->child(i))->name(), ((ClassEditorTreeWidgetItem *)it.current()->child(i))->buffer()); } } ++it; @@ -1839,44 +1863,44 @@ void ClassEditorWidget::saveNotBuiltClasses() void ClassEditorWidget::searchInheritedClasses(const QString szClass, KviPointerList & lInheritedClasses) { - KviPointerHashTableIterator it (*m_pClasses); + KviPointerHashTableIterator it(*m_pClasses); while(it.current()) { - if(KviQString::equalCI(szClass,it.current()->inheritsClass())) + if(KviQString::equalCI(szClass, it.current()->inheritsClass())) lInheritedClasses.append(it.current()); ++it; } } ClassEditorWindow::ClassEditorWindow() -: KviWindow(KviWindow::ScriptEditor,"classeditor",0) + : KviWindow(KviWindow::ScriptEditor, "classeditor", 0) { g_pClassEditorWindow = this; - setFixedCaption(__tr2qs_ctx("Class Editor","editor")); + setFixedCaption(__tr2qs_ctx("Class Editor", "editor")); QGridLayout * pLayout = new QGridLayout(); m_pEditor = new ClassEditorWidget(this); - pLayout->addWidget(m_pEditor,0,0,1,4); + pLayout->addWidget(m_pEditor, 0, 0, 1, 4); - QPushButton * pBtn = new QPushButton(__tr2qs_ctx("&Build","editor"),this); + QPushButton * pBtn = new QPushButton(__tr2qs_ctx("&Build", "editor"), this); pBtn->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Accept))); - pLayout->addWidget(pBtn,1,1); - connect(pBtn,SIGNAL(clicked()),this,SLOT(buildClicked())); + pLayout->addWidget(pBtn, 1, 1); + connect(pBtn, SIGNAL(clicked()), this, SLOT(buildClicked())); - pBtn = new QPushButton(__tr2qs_ctx("&Save","editor"),this); + pBtn = new QPushButton(__tr2qs_ctx("&Save", "editor"), this); pBtn->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Accept))); - pLayout->addWidget(pBtn,1,2); - connect(pBtn,SIGNAL(clicked()),this,SLOT(saveClicked())); + pLayout->addWidget(pBtn, 1, 2); + connect(pBtn, SIGNAL(clicked()), this, SLOT(saveClicked())); - pBtn = new QPushButton(__tr2qs_ctx("Close","editor"),this); + pBtn = new QPushButton(__tr2qs_ctx("Close", "editor"), this); pBtn->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Discard))); - pLayout->addWidget(pBtn,1,3); - connect(pBtn,SIGNAL(clicked()),this,SLOT(cancelClicked())); + pLayout->addWidget(pBtn, 1, 3); + connect(pBtn, SIGNAL(clicked()), this, SLOT(cancelClicked())); - pLayout->setRowStretch(0,1); - pLayout->setColumnStretch(0,1); + pLayout->setRowStretch(0, 1); + pLayout->setColumnStretch(0, 1); setLayout(pLayout); } @@ -1905,7 +1929,7 @@ QPixmap * ClassEditorWindow::myIconPtr() return g_pIconManager->getSmallIcon(KviIconManager::ClassEditor); } -void ClassEditorWindow::configGroupName(QString &szName) +void ClassEditorWindow::configGroupName(QString & szName) { szName = "classeditor"; } @@ -1920,8 +1944,8 @@ void ClassEditorWindow::loadProperties(KviConfigurationFile * pCfg) m_pEditor->loadProperties(pCfg); } -KviClassEditorDialog::KviClassEditorDialog(QWidget * pParent, const QString & szName, KviPointerHashTable * pClasses, const QString & szClassName, const QString & szInheritsClassName, bool bRenameMode) -: QDialog(pParent) +KviClassEditorDialog::KviClassEditorDialog(QWidget * pParent, const QString & szName, KviPointerHashTable * pClasses, const QString & szClassName, const QString & szInheritsClassName, bool bRenameMode) + : QDialog(pParent) { setObjectName(szName); @@ -1930,11 +1954,11 @@ KviClassEditorDialog::KviClassEditorDialog(QWidget * pParent, const QString & sz KviTalHBox * pHBox = new KviTalHBox(this); pHBox->setSpacing(0); pHBox->setMargin(0); - pLayout->addWidget(pHBox,0,0); + pLayout->addWidget(pHBox, 0, 0); QLabel * pLabel = new QLabel(pHBox); pLabel->setObjectName("classnamelabel"); - pLabel->setText(__tr2qs_ctx("Please enter the name for the class:","editor")); + pLabel->setText(__tr2qs_ctx("Please enter the name for the class:", "editor")); m_pClassNameLineEdit = new QLineEdit(pHBox); m_pClassNameLineEdit->setObjectName("classnameineedit"); @@ -1945,38 +1969,40 @@ KviClassEditorDialog::KviClassEditorDialog(QWidget * pParent, const QString & sz { // we allow only [\w:]+ class name re.setPattern("[\\w]+"); - m_pClassNameLineEdit->setToolTip(__tr2qs_ctx("Class names can contain only letters, digits and underscores","editor")); - } else { + m_pClassNameLineEdit->setToolTip(__tr2qs_ctx("Class names can contain only letters, digits and underscores", "editor")); + } + else + { // in editor mode we allow [\w:]+ and namespace separator re.setPattern("[\\w]+(::[\\w]+)+"); - m_pClassNameLineEdit->setToolTip(__tr2qs_ctx("In rename mode class names can contain only letters, digits and underscores and namespaces :: separator","editor")); + m_pClassNameLineEdit->setToolTip(__tr2qs_ctx("In rename mode class names can contain only letters, digits and underscores and namespaces :: separator", "editor")); } - QRegExpValidator * pValidator = new QRegExpValidator(re,this); + QRegExpValidator * pValidator = new QRegExpValidator(re, this); m_pClassNameLineEdit->setValidator(pValidator); m_pClassNameLineEdit->setObjectName("functionameineedit"); pHBox = new KviTalHBox(this); pHBox->setSpacing(0); pHBox->setMargin(0); - pLayout->addWidget(pHBox,1,0); + pLayout->addWidget(pHBox, 1, 0); pLabel = new QLabel(pHBox); pLabel->setObjectName("Inheritsclasslabel"); - pLabel->setText(__tr2qs_ctx("Inherits class:","editor")); + pLabel->setText(__tr2qs_ctx("Inherits class:", "editor")); m_pInheritsClassComboBox = new QComboBox(pHBox); pLabel->setBuddy(m_pInheritsClassComboBox); - KviPointerHashTableIterator pClassesIt(*pClasses); + KviPointerHashTableIterator pClassesIt(*pClasses); QStringList szClasses; while(pClassesIt.current()) { - if(!KviQString::equalCI(pClassesIt.currentKey(),szClassName)) + if(!KviQString::equalCI(pClassesIt.currentKey(), szClassName)) szClasses.append(pClassesIt.currentKey()); ++pClassesIt; } - KviPointerHashTableIterator pBuiltinClasses(*KviKvsKernel::instance()->objectController()->classDict()); + KviPointerHashTableIterator pBuiltinClasses(*KviKvsKernel::instance()->objectController()->classDict()); while(pBuiltinClasses.current()) { if(pBuiltinClasses.current()->isBuiltin()) @@ -1986,11 +2012,12 @@ KviClassEditorDialog::KviClassEditorDialog(QWidget * pParent, const QString & sz int iCurrentIdx; szClasses.sort(); - for(int i=0; i < szClasses.count(); i++) + for(int i = 0; i < szClasses.count(); i++) m_pInheritsClassComboBox->addItem(szClasses.at(i)); if(szInheritsClassName.isEmpty()) iCurrentIdx = m_pInheritsClassComboBox->findText("object"); - else { + else + { iCurrentIdx = m_pInheritsClassComboBox->findText(szInheritsClassName); if(iCurrentIdx == -1) iCurrentIdx = m_pInheritsClassComboBox->findText("object"); @@ -2002,21 +2029,22 @@ KviClassEditorDialog::KviClassEditorDialog(QWidget * pParent, const QString & sz pHBox = new KviTalHBox(this); pHBox->setSpacing(0); pHBox->setMargin(0); - pLayout->addWidget(pHBox,2,0); + pLayout->addWidget(pHBox, 2, 0); m_pNewClassButton = new QPushButton(pHBox); m_pNewClassButton->setObjectName("newclassbutton"); if(bRenameMode) - m_pNewClassButton->setText(__tr2qs_ctx("&Rename Class","editor")); - else { - m_pNewClassButton->setText(__tr2qs_ctx("&Create Class","editor")); + m_pNewClassButton->setText(__tr2qs_ctx("&Rename Class", "editor")); + else + { + m_pNewClassButton->setText(__tr2qs_ctx("&Create Class", "editor")); m_pNewClassButton->setEnabled(false); } connect(m_pNewClassButton, SIGNAL(clicked()), this, SLOT(accept())); QPushButton * pCancelButton = new QPushButton(pHBox); pCancelButton->setObjectName("cancelButton"); - pCancelButton->setText(__tr2qs_ctx("&Cancel","editor")); + pCancelButton->setText(__tr2qs_ctx("&Cancel", "editor")); connect(pCancelButton, SIGNAL(clicked()), this, SLOT(reject())); setLayout(pLayout); @@ -2032,7 +2060,7 @@ void KviClassEditorDialog::textChanged(const QString & szText) } KviClassEditorFunctionDialog::KviClassEditorFunctionDialog(QWidget * pParent, const QString & szName, const QString & szClassName, const QString & szFunctionName, const QString & szReminder, bool bIsInternal, bool bRenameMode) -: QDialog(pParent) + : QDialog(pParent) { setObjectName(szName); @@ -2041,41 +2069,41 @@ KviClassEditorFunctionDialog::KviClassEditorFunctionDialog(QWidget * pParent, co KviTalHBox * pHBox = new KviTalHBox(this); pHBox->setSpacing(0); pHBox->setMargin(0); - pLayout->addWidget(pHBox,0,0); + pLayout->addWidget(pHBox, 0, 0); QLabel * pLabel = new QLabel(pHBox); pLabel->setObjectName("classnamelabel"); - pLabel->setText("Class: "+szClassName+""); + pLabel->setText("Class: " + szClassName + ""); pHBox = new KviTalHBox(this); pHBox->setSpacing(0); pHBox->setMargin(0); - pLayout->addWidget(pHBox,1,0); + pLayout->addWidget(pHBox, 1, 0); pLabel = new QLabel(pHBox); pLabel->setObjectName("functionnamelabel"); - pLabel->setText(__tr2qs_ctx("Please enter the name for the member function:","editor")); + pLabel->setText(__tr2qs_ctx("Please enter the name for the member function:", "editor")); m_pFunctionNameLineEdit = new QLineEdit(pHBox); // we allow only [\w:]+ function name QRegExp re("[\\w]+"); - QRegExpValidator * pValidator = new QRegExpValidator(re,this); + QRegExpValidator * pValidator = new QRegExpValidator(re, this); m_pFunctionNameLineEdit->setValidator(pValidator); m_pFunctionNameLineEdit->setObjectName("functionameineedit"); - m_pFunctionNameLineEdit->setToolTip(__tr2qs_ctx("Function names can contain only letters, digits and underscores","editor")); + m_pFunctionNameLineEdit->setToolTip(__tr2qs_ctx("Function names can contain only letters, digits and underscores", "editor")); m_pFunctionNameLineEdit->setText(szFunctionName); pLabel->setBuddy(m_pFunctionNameLineEdit); pHBox = new KviTalHBox(this); pHBox->setSpacing(0); pHBox->setMargin(0); - pLayout->addWidget(pHBox,2,0); + pLayout->addWidget(pHBox, 2, 0); pLabel = new QLabel(pHBox); pLabel->setObjectName("reminderlabel"); pLabel->setWordWrap(1); - pLabel->setText(__tr2qs_ctx("Please enter the optional reminder string for the member function:","editor")); + pLabel->setText(__tr2qs_ctx("Please enter the optional reminder string for the member function:", "editor")); m_pReminderLineEdit = new QLineEdit(pHBox); m_pReminderLineEdit->setText(szReminder); @@ -2084,11 +2112,11 @@ KviClassEditorFunctionDialog::KviClassEditorFunctionDialog(QWidget * pParent, co pHBox = new KviTalHBox(this); pHBox->setSpacing(0); pHBox->setMargin(0); - pLayout->addWidget(pHBox,3,0); + pLayout->addWidget(pHBox, 3, 0); pLabel = new QLabel(pHBox); pLabel->setObjectName("functionnamelabel"); - pLabel->setText(__tr2qs_ctx("Set as Internal Function: ","editor")); + pLabel->setText(__tr2qs_ctx("Set as Internal Function: ", "editor")); m_pInternalCheckBox = new QCheckBox(pHBox); m_pInternalCheckBox->setChecked(bIsInternal); @@ -2096,21 +2124,21 @@ KviClassEditorFunctionDialog::KviClassEditorFunctionDialog(QWidget * pParent, co pLabel->setBuddy(m_pInternalCheckBox); connect(m_pFunctionNameLineEdit, SIGNAL(textChanged(const QString &)), this, SLOT(textChanged(const QString &))); - pHBox->setAlignment(m_pInternalCheckBox,Qt::AlignLeft); - pHBox->setStretchFactor(m_pInternalCheckBox,70); - pHBox->setStretchFactor(pLabel,30); + pHBox->setAlignment(m_pInternalCheckBox, Qt::AlignLeft); + pHBox->setStretchFactor(m_pInternalCheckBox, 70); + pHBox->setStretchFactor(pLabel, 30); pHBox = new KviTalHBox(this); pHBox->setSpacing(0); pHBox->setMargin(0); - pLayout->addWidget(pHBox,4,0); + pLayout->addWidget(pHBox, 4, 0); m_pNewFunctionButton = new QPushButton(pHBox); m_pNewFunctionButton->setObjectName("newfunctionbutton"); if(!bRenameMode) - m_pNewFunctionButton->setText(__tr2qs_ctx("&Add","editor")); + m_pNewFunctionButton->setText(__tr2qs_ctx("&Add", "editor")); else - m_pNewFunctionButton->setText(__tr2qs_ctx("&Rename","editor")); + m_pNewFunctionButton->setText(__tr2qs_ctx("&Rename", "editor")); if(szFunctionName.isEmpty()) m_pNewFunctionButton->setEnabled(false); @@ -2118,7 +2146,7 @@ KviClassEditorFunctionDialog::KviClassEditorFunctionDialog(QWidget * pParent, co QPushButton * pCancelButton = new QPushButton(pHBox); pCancelButton->setObjectName("cancelButton"); - pCancelButton->setText(__tr2qs_ctx("&Cancel","editor")); + pCancelButton->setText(__tr2qs_ctx("&Cancel", "editor")); connect(pCancelButton, SIGNAL(clicked()), this, SLOT(reject())); setLayout(pLayout); diff --git a/src/modules/classeditor/ClassEditorWindow.h b/src/modules/classeditor/ClassEditorWindow.h index b24ef1271..e12386a5e 100644 --- a/src/modules/classeditor/ClassEditorWindow.h +++ b/src/modules/classeditor/ClassEditorWindow.h @@ -71,6 +71,7 @@ public: * \brief Destroys the tree widget */ ~ClassEditorTreeWidget(); + protected: virtual void mousePressEvent(QMouseEvent * e); signals: @@ -96,10 +97,11 @@ public: */ enum Type { - Class, /**< The item is a class */ - Namespace, /**< The item is a namespace */ - Method /**< The item is a member function */ + Class, /**< The item is a class */ + Namespace, /**< The item is a namespace */ + Method /**< The item is a member function */ }; + public: /** * \brief Constructs the class editor tree widget item @@ -123,34 +125,36 @@ public: * \brief Destroys the class editor tree widget item */ ~ClassEditorTreeWidgetItem(){}; + protected: - Type m_eType; + Type m_eType; QString m_szName; QString m_szBuffer; QString m_szInheritsClassName; QString m_szReminder; - bool m_bClassModified; - bool m_bInternal; - int m_iPos; + bool m_bClassModified; + bool m_bInternal; + int m_iPos; + public: /** * \brief Sets the class name on which the class inherits from * \param szInheritsClassName The parent class name * \return void */ - void setInheritsClass(QString szInheritsClassName){ m_szInheritsClassName = szInheritsClassName; }; + void setInheritsClass(QString szInheritsClassName) { m_szInheritsClassName = szInheritsClassName; }; /** * \brief Returns the class name of the classes we inherit from * \return QString */ - QString inheritsClass(){ return m_szInheritsClassName; }; + QString inheritsClass() { return m_szInheritsClassName; }; /** * \brief Returns the name of the item * \return const QString & */ - const QString & name(){ return m_szName; }; + const QString & name() { return m_szName; }; /** * \brief Sets the name of the item @@ -164,13 +168,13 @@ public: * \param szRem The parameters' list * \return void */ - void setReminder(const QString & szRem){ m_szReminder = szRem; }; + void setReminder(const QString & szRem) { m_szReminder = szRem; }; /** * \brief Returns the parameters list * \return QString */ - QString reminder(){ return m_szReminder; }; + QString reminder() { return m_szReminder; }; /** * \brief Sets the state of the class as non-built @@ -183,26 +187,26 @@ public: * \brief Returns true if we class is not built yet, false otherwise * \return bool */ - bool classNotBuilt(){ return m_bClassModified; }; + bool classNotBuilt() { return m_bClassModified; }; /** * \brief Sets the function as internal * \param bInternal Whether the function is internal or not * \return void */ - void setInternalFunction(bool bInternal){ m_bInternal = bInternal; }; + void setInternalFunction(bool bInternal) { m_bInternal = bInternal; }; /** * \brief Returns true if the function is set as internal, false otherwise * \return bool */ - bool isInternalFunction(){ return m_bInternal; }; + bool isInternalFunction() { return m_bInternal; }; /** * \brief Returns the type of the item * \return Type */ - Type type(){ return m_eType; }; + Type type() { return m_eType; }; /** * \brief Sets the type of the item @@ -215,45 +219,45 @@ public: * \brief Returns true if the item is a class, false otherwise * \return bool */ - bool isClass(){ return m_eType == Class; }; + bool isClass() { return m_eType == Class; }; /** * \brief Returns true if the item is a namespace, false otherwise * \return bool */ - bool isNamespace(){ return m_eType == Namespace; }; + bool isNamespace() { return m_eType == Namespace; }; /** * \brief Returns true if the item is a member function, false otherwise * \return bool */ - bool isMethod(){ return m_eType == Method; }; + bool isMethod() { return m_eType == Method; }; /** * \brief Saves the code of the item in a buffer * \param szBuffer The buffer ;) * \return void */ - void setBuffer(const QString & szBuffer){ m_szBuffer = szBuffer; }; + void setBuffer(const QString & szBuffer) { m_szBuffer = szBuffer; }; /** * \brief Returns the buffer containing the code of the item * \return const QString & */ - const QString & buffer(){ return m_szBuffer; }; + const QString & buffer() { return m_szBuffer; }; /** * \brief Returns the cursor's position * \return const int & */ - const int & cursorPosition(){ return m_iPos; }; + const int & cursorPosition() { return m_iPos; }; /** * \brief Sets the cursor position * \param iPos The position of the cursor * \return void */ - void setCursorPosition(const int & iPos){ m_iPos = iPos; }; + void setCursorPosition(const int & iPos) { m_iPos = iPos; }; }; /** @@ -275,23 +279,26 @@ public: * \brief Destroys the class editor object */ ~ClassEditorWidget(); + public: - KviScriptEditor * m_pEditor; - ClassEditorTreeWidget * m_pTreeWidget; - QLabel * m_pClassNameLabel; - QPushButton * m_pClassNameRenameButton; - QLabel * m_pFunctionNameLabel; - QPushButton * m_pFunctionNameRenameButton; - QLabel * m_pReminderLabel; + KviScriptEditor * m_pEditor; + ClassEditorTreeWidget * m_pTreeWidget; + QLabel * m_pClassNameLabel; + QPushButton * m_pClassNameRenameButton; + QLabel * m_pFunctionNameLabel; + QPushButton * m_pFunctionNameRenameButton; + QLabel * m_pReminderLabel; ClassEditorTreeWidgetItem * m_pLastEditedItem; ClassEditorTreeWidgetItem * m_pLastClickedItem; - QMenu * m_pContextPopup; - QSplitter * m_pSplitter; - QString m_szDir; - bool m_bSaving; + QMenu * m_pContextPopup; + QSplitter * m_pSplitter; + QString m_szDir; + bool m_bSaving; + protected: - KviPointerHashTable * m_pClasses; + KviPointerHashTable * m_pClasses; + public: /** * \brief Called to save the window properties @@ -354,6 +361,7 @@ public: * \return void */ void cutItem(ClassEditorTreeWidgetItem * pItem); + protected: //void recursiveSearchReplace(const QString &szSearch,ClassEditorTreeWidgetItem * it,bool bReplace=false,const QString &szReplace="n"); @@ -367,7 +375,7 @@ protected: void appendSelectedClassItemsRecursive(KviPointerList * pList, QTreeWidgetItem * pStartFrom); void appendAllClassItems(KviPointerList * pList); - void appendAllClassItemsRecursive(KviPointerList * l,QTreeWidgetItem * pStartFrom); + void appendAllClassItemsRecursive(KviPointerList * l, QTreeWidgetItem * pStartFrom); void openParentItems(QTreeWidgetItem * pItem); void activateItem(QTreeWidgetItem * pItem); @@ -398,10 +406,10 @@ protected: */ void renameNamespace(ClassEditorTreeWidgetItem * pNamespace); - bool removeItem(ClassEditorTreeWidgetItem * pItem, KviPointerList & lRemovedItems, bool * pbYesToAll); + bool removeItem(ClassEditorTreeWidgetItem * pItem, KviPointerList & lRemovedItems, bool * pbYesToAll); void updateClassHierarchy(ClassEditorTreeWidgetItem * pClass); - void removeItemChildren(ClassEditorTreeWidgetItem * pItem, KviPointerList & lRemovedItems); + void removeItemChildren(ClassEditorTreeWidgetItem * pItem, KviPointerList & lRemovedItems); void buildFullItemPath(ClassEditorTreeWidgetItem * pItem, QString & szBuffer); QString buildFullClassName(ClassEditorTreeWidgetItem * pItem); ClassEditorTreeWidgetItem * createFullItem(const QString & szFullName); @@ -414,8 +422,6 @@ protected: */ ClassEditorTreeWidgetItem * findItem(const QString & szName); - - ClassEditorTreeWidgetItem * findTopLevelItem(const QString & szName); ClassEditorTreeWidgetItem * createFullItemRecursive(QTreeWidgetItem * pCurrent, QStringList & lNameSpaces, int & iLevel, bool bCreateNameSpace = 0); protected slots: @@ -482,8 +488,10 @@ public: * \brief Destroys the class editor window */ ~ClassEditorWindow(); + protected: ClassEditorWidget * m_pEditor; + protected: /** * \brief Returns the class editor small icon @@ -535,7 +543,7 @@ protected slots: * \class KviClassEditorDialog * \brief This class constructs the dialog to create a new class */ -class KviClassEditorDialog: public QDialog +class KviClassEditorDialog : public QDialog { Q_OBJECT public: @@ -549,28 +557,30 @@ public: * \param bRenameMode Whether the dialog is in rename mode * \return KviClassEditorDialog */ - KviClassEditorDialog(QWidget * pParent, const QString & szName, KviPointerHashTable * pClasses, const QString & szClassName, const QString & szInheritsClassName, bool bRenameMode = false); + KviClassEditorDialog(QWidget * pParent, const QString & szName, KviPointerHashTable * pClasses, const QString & szClassName, const QString & szInheritsClassName, bool bRenameMode = false); /** * \brief Destroys the class dialog */ ~KviClassEditorDialog(); + protected: QPushButton * m_pNewClassButton; - QLineEdit * m_pClassNameLineEdit; - QComboBox * m_pInheritsClassComboBox; + QLineEdit * m_pClassNameLineEdit; + QComboBox * m_pInheritsClassComboBox; + public: /** * \brief Returns the class name * \return QString */ - QString className(){ return m_pClassNameLineEdit->text(); }; + QString className() { return m_pClassNameLineEdit->text(); }; /** * \brief Returns the class name of the parent classes * \return QString */ - QString inheritsClassName(){ return m_pInheritsClassComboBox->currentText(); }; + QString inheritsClassName() { return m_pInheritsClassComboBox->currentText(); }; protected slots: /** * \brief Triggered when the name of the class change @@ -583,7 +593,7 @@ protected slots: * \class KviClassEditorFunctionDialog * \brief This class constructs the dialog to create a new member function */ -class KviClassEditorFunctionDialog: public QDialog +class KviClassEditorFunctionDialog : public QDialog { Q_OBJECT public: @@ -604,29 +614,31 @@ public: * \brief Destroys the function dialog */ ~KviClassEditorFunctionDialog(); + protected: QPushButton * m_pNewFunctionButton; - QLineEdit * m_pFunctionNameLineEdit; - QLineEdit * m_pReminderLineEdit; - QCheckBox * m_pInternalCheckBox; + QLineEdit * m_pFunctionNameLineEdit; + QLineEdit * m_pReminderLineEdit; + QCheckBox * m_pInternalCheckBox; + public: /** * \brief Returns the function name * \return QString */ - QString functionName(){ return m_pFunctionNameLineEdit->text(); }; + QString functionName() { return m_pFunctionNameLineEdit->text(); }; /** * \brief Returns the parameters of the function * \return QString */ - QString reminder(){ return m_pReminderLineEdit->text(); }; + QString reminder() { return m_pReminderLineEdit->text(); }; /** * \brief Returns true if the function is set as internal, false otherwise * \return bool */ - bool isInternalFunction(){ return m_pInternalCheckBox->isChecked(); }; + bool isInternalFunction() { return m_pInternalCheckBox->isChecked(); }; protected slots: /** * \brief Triggered when the name of the function change diff --git a/src/modules/classeditor/libkviclasseditor.cpp b/src/modules/classeditor/libkviclasseditor.cpp index f0a5e1b44..20b628aa1 100644 --- a/src/modules/classeditor/libkviclasseditor.cpp +++ b/src/modules/classeditor/libkviclasseditor.cpp @@ -28,11 +28,9 @@ #include "KviLocale.h" #include "KviMainWindow.h" - ClassEditorWindow * g_pClassEditorWindow = 0; KviModule * g_pClassEditorModule = 0; - /* @doc: classeditor.open @type: @@ -61,7 +59,7 @@ static bool classeditor_kvs_cmd_open(KviKvsModuleCommandCall *) static bool classeditor_module_init(KviModule * m) { - KVSM_REGISTER_SIMPLE_COMMAND(m,"open",classeditor_kvs_cmd_open); + KVSM_REGISTER_SIMPLE_COMMAND(m, "open", classeditor_kvs_cmd_open); g_pClassEditorWindow = 0; g_pClassEditorModule = m; return true; @@ -81,13 +79,12 @@ static bool classeditor_module_cleanup(KviModule *) } KVIRC_MODULE( - "ClassEditor", // module name - "4.0.0", // module version - "Copyright (C) 2010 Carbone Alessandro (elfonol at gmail dot com)", // author & (C) - "Editor for the script classes", - classeditor_module_init, - classeditor_module_can_unload, - 0, - classeditor_module_cleanup, - "editor" -) + "ClassEditor", // module name + "4.0.0", // module version + "Copyright (C) 2010 Carbone Alessandro (elfonol at gmail dot com)", // author & (C) + "Editor for the script classes", + classeditor_module_init, + classeditor_module_can_unload, + 0, + classeditor_module_cleanup, + "editor") diff --git a/src/modules/codetester/CodeTesterWindow.cpp b/src/modules/codetester/CodeTesterWindow.cpp index 3ed12bf9b..1a1d3d9dd 100644 --- a/src/modules/codetester/CodeTesterWindow.cpp +++ b/src/modules/codetester/CodeTesterWindow.cpp @@ -41,27 +41,25 @@ #include #include - extern KviPointerList * g_pCodeTesterWindowList; - CodeTesterWidget::CodeTesterWidget(QWidget * par) -: QWidget(par) + : QWidget(par) { setObjectName("code_tester"); QGridLayout * g = new QGridLayout(this); m_pEditor = KviScriptEditor::createInstance(this); - g->addWidget(m_pEditor,0,0,1,4); + g->addWidget(m_pEditor, 0, 0, 1, 4); //g->addMultiCellWidget(m_pEditor,0,0,0,3); - m_pExecuteButton = new QPushButton(__tr2qs_ctx("&Execute","editor"),this); - g->addWidget(m_pExecuteButton,1,3); - connect(m_pExecuteButton,SIGNAL(clicked()),this,SLOT(execute())); + m_pExecuteButton = new QPushButton(__tr2qs_ctx("&Execute", "editor"), this); + g->addWidget(m_pExecuteButton, 1, 3); + connect(m_pExecuteButton, SIGNAL(clicked()), this, SLOT(execute())); - m_pModeLabel = new QLabel(__tr2qs_ctx("Params:","editor"),this); - g->addWidget(m_pModeLabel,1,1); + m_pModeLabel = new QLabel(__tr2qs_ctx("Params:", "editor"), this); + g->addWidget(m_pModeLabel, 1, 1); m_pParams = new QLineEdit(this); - m_pParams->setToolTip(__tr2qs_ctx("Here you can specify a semicolon-separated list of parameters that will be available in the code as $0, $1, $2, ..","editor")); - g->addWidget(m_pParams,1,2); + m_pParams->setToolTip(__tr2qs_ctx("Here you can specify a semicolon-separated list of parameters that will be available in the code as $0, $1, $2, ..", "editor")); + g->addWidget(m_pParams, 1, 2); } CodeTesterWidget::~CodeTesterWidget() @@ -82,7 +80,7 @@ void CodeTesterWidget::execute() } CodeTesterWindow::CodeTesterWindow() -: KviWindow(KviWindow::ScriptEditor,"codetester",0) + : KviWindow(KviWindow::ScriptEditor, "codetester", 0) { g_pCodeTesterWindowList->append(this); @@ -101,22 +99,22 @@ QPixmap * CodeTesterWindow::myIconPtr() void CodeTesterWindow::resizeEvent(QResizeEvent *) { - m_pTester->setGeometry(0,0,width(),height()); + m_pTester->setGeometry(0, 0, width(), height()); } void CodeTesterWindow::fillCaptionBuffers() { - m_szPlainTextCaption = __tr2qs_ctx("Script Tester","editor"); + m_szPlainTextCaption = __tr2qs_ctx("Script Tester", "editor"); } -void CodeTesterWindow::getConfigGroupName(QString &szName) +void CodeTesterWindow::getConfigGroupName(QString & szName) { szName = "codetester"; } void CodeTesterWindow::saveProperties(KviConfigurationFile *) //cfg { -/* + /* #ifdef COMPILE_SCRIPTTOOLBAR cfg->writeEntry("Sizes",m_pEditor->sizes()); cfg->writeEntry("LastRaw",m_pEditor->lastEditedRaw().ptr()); @@ -127,7 +125,7 @@ void CodeTesterWindow::saveProperties(KviConfigurationFile *) //cfg void CodeTesterWindow::loadProperties(KviConfigurationFile *) //cfg { -/* + /* #ifdef COMPILE_SCRIPTTOOLBAR QValueList def; def.append(20); diff --git a/src/modules/codetester/CodeTesterWindow.h b/src/modules/codetester/CodeTesterWindow.h index 167c5acec..48588a8cc 100644 --- a/src/modules/codetester/CodeTesterWindow.h +++ b/src/modules/codetester/CodeTesterWindow.h @@ -33,18 +33,18 @@ class QPushButton; class QLabel; class KviScriptEditor; - class CodeTesterWidget : public QWidget { Q_OBJECT public: CodeTesterWidget(QWidget * par); ~CodeTesterWidget(); + private: KviScriptEditor * m_pEditor; - QLineEdit * m_pParams; - QPushButton * m_pExecuteButton; - QLabel * m_pModeLabel; + QLineEdit * m_pParams; + QPushButton * m_pExecuteButton; + QLabel * m_pModeLabel; private slots: void execute(); }; @@ -55,13 +55,15 @@ class CodeTesterWindow : public KviWindow public: CodeTesterWindow(); ~CodeTesterWindow(); + protected: CodeTesterWidget * m_pTester; + protected: virtual QPixmap * myIconPtr(); virtual void fillCaptionBuffers(); - virtual void resizeEvent(QResizeEvent *e); - virtual void getConfigGroupName(QString &szName); + virtual void resizeEvent(QResizeEvent * e); + virtual void getConfigGroupName(QString & szName); virtual void saveProperties(KviConfigurationFile *); virtual void loadProperties(KviConfigurationFile *); }; diff --git a/src/modules/codetester/libkvicodetester.cpp b/src/modules/codetester/libkvicodetester.cpp index eeb0d2c18..665e06119 100644 --- a/src/modules/codetester/libkvicodetester.cpp +++ b/src/modules/codetester/libkvicodetester.cpp @@ -29,10 +29,8 @@ #include "KviMainWindow.h" #include "KviPointerList.h" - KviPointerList * g_pCodeTesterWindowList = 0; - /* @doc: codetester.open @type: @@ -57,7 +55,7 @@ static bool codetester_kvs_cmd_open(KviKvsModuleCommandCall *) static bool codetester_module_init(KviModule * m) { - KVSM_REGISTER_SIMPLE_COMMAND(m,"open",codetester_kvs_cmd_open); + KVSM_REGISTER_SIMPLE_COMMAND(m, "open", codetester_kvs_cmd_open); g_pCodeTesterWindowList = new KviPointerList(); g_pCodeTesterWindowList->setAutoDelete(false); @@ -79,13 +77,12 @@ static bool codetester_module_cleanup(KviModule *) } KVIRC_MODULE( - "CodeTester", // module name - "4.0.0", // module version - "Copyright (C) 2002 Szymon Stefanek (pragma at kvirc dot net)", // author & (C) - "Code tester window", - codetester_module_init, - codetester_module_can_unload, - 0, - codetester_module_cleanup, - "editor" -) + "CodeTester", // module name + "4.0.0", // module version + "Copyright (C) 2002 Szymon Stefanek (pragma at kvirc dot net)", // author & (C) + "Code tester window", + codetester_module_init, + codetester_module_can_unload, + 0, + codetester_module_cleanup, + "editor") diff --git a/src/modules/config/libkviconfig.cpp b/src/modules/config/libkviconfig.cpp index 56628baec..f8dc47e80 100644 --- a/src/modules/config/libkviconfig.cpp +++ b/src/modules/config/libkviconfig.cpp @@ -30,7 +30,7 @@ #include "KviLocale.h" #include "KviPointerHashTable.h" -static KviPointerHashTable * g_pConfigDict = 0; +static KviPointerHashTable * g_pConfigDict = 0; static int g_iNextConfigId = 0; /* @@ -78,38 +78,45 @@ static int g_iNextConfigId = 0; [module:config]Config module documentation[/module] */ - static bool config_kvs_fnc_open(KviKvsModuleFunctionCall * c) { QString szFile; QString szMode; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("filename",KVS_PT_STRING,0,szFile) - KVSM_PARAMETER("mode",KVS_PT_STRING,KVS_PF_OPTIONAL,szMode) + KVSM_PARAMETER("filename", KVS_PT_STRING, 0, szFile) + KVSM_PARAMETER("mode", KVS_PT_STRING, KVS_PF_OPTIONAL, szMode) KVSM_PARAMETERS_END(c) KviConfigurationFile::FileMode fileMode; if(szMode.contains('r')) { - if(szMode.contains('w'))fileMode = KviConfigurationFile::ReadWrite; - else fileMode = KviConfigurationFile::Read; - } else { - if(szMode.contains('w'))fileMode = KviConfigurationFile::Write; - else fileMode = KviConfigurationFile::ReadWrite; + if(szMode.contains('w')) + fileMode = KviConfigurationFile::ReadWrite; + else + fileMode = KviConfigurationFile::Read; + } + else + { + if(szMode.contains('w')) + fileMode = KviConfigurationFile::Write; + else + fileMode = KviConfigurationFile::ReadWrite; } KviFileUtils::adjustFilePath(szFile); QString szAbsFile; - if(KviFileUtils::isAbsolutePath(szFile))szAbsFile = szFile; - else g_pApp->getLocalKvircDirectory(szAbsFile,KviApplication::ConfigScripts,szFile,true); + if(KviFileUtils::isAbsolutePath(szFile)) + szAbsFile = szFile; + else + g_pApp->getLocalKvircDirectory(szAbsFile, KviApplication::ConfigScripts, szFile, true); - KviPointerHashTableIterator it(*g_pConfigDict); + KviPointerHashTableIterator it(*g_pConfigDict); while(it.current()) { - if(KviQString::equalCI(it.current()->fileName(),szAbsFile)) + if(KviQString::equalCI(it.current()->fileName(), szAbsFile)) { c->returnValue()->setString(it.currentKey()); if(it.current()->readOnly() && (fileMode & KviConfigurationFile::Write)) @@ -121,10 +128,10 @@ static bool config_kvs_fnc_open(KviKvsModuleFunctionCall * c) ++it; } - KviConfigurationFile * cfg = new KviConfigurationFile(szAbsFile,fileMode); + KviConfigurationFile * cfg = new KviConfigurationFile(szAbsFile, fileMode); g_iNextConfigId++; QString tmp = QString("%1").arg(g_iNextConfigId); - g_pConfigDict->insert(tmp,cfg); + g_pConfigDict->insert(tmp, cfg); c->returnValue()->setString(tmp); return true; } @@ -152,20 +159,22 @@ static bool config_kvs_fnc_id(KviKvsModuleFunctionCall * c) QString szFile; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("file",KVS_PT_STRING,0,szFile) + KVSM_PARAMETER("file", KVS_PT_STRING, 0, szFile) KVSM_PARAMETERS_END(c) KviFileUtils::adjustFilePath(szFile); QString szAbsFile; - if(KviFileUtils::isAbsolutePath(szFile))szAbsFile = szFile; - else g_pApp->getLocalKvircDirectory(szAbsFile,KviApplication::ConfigScripts,szFile,true); + if(KviFileUtils::isAbsolutePath(szFile)) + szAbsFile = szFile; + else + g_pApp->getLocalKvircDirectory(szAbsFile, KviApplication::ConfigScripts, szFile, true); - KviPointerHashTableIterator it(*g_pConfigDict); + KviPointerHashTableIterator it(*g_pConfigDict); while(it.current()) { - if(KviQString::equalCI(it.current()->fileName(),szAbsFile)) + if(KviQString::equalCI(it.current()->fileName(), szAbsFile)) { c->returnValue()->setString(it.currentKey()); return true; @@ -205,18 +214,20 @@ static bool config_kvs_fnc_read(KviKvsModuleFunctionCall * c) QString szDefault; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("id",KVS_PT_STRING,0,szId) - KVSM_PARAMETER("key",KVS_PT_STRING,0,szKey) - KVSM_PARAMETER("default",KVS_PT_STRING,KVS_PF_OPTIONAL,szDefault) + KVSM_PARAMETER("id", KVS_PT_STRING, 0, szId) + KVSM_PARAMETER("key", KVS_PT_STRING, 0, szKey) + KVSM_PARAMETER("default", KVS_PT_STRING, KVS_PF_OPTIONAL, szDefault) KVSM_PARAMETERS_END(c) KviConfigurationFile * cfg = g_pConfigDict->find(szId); if(cfg) { - c->returnValue()->setString(cfg->readEntry(szKey,szDefault)); - } else { - c->warning(__tr2qs("The config file with ID '%Q' is not open"),&szId); + c->returnValue()->setString(cfg->readEntry(szKey, szDefault)); + } + else + { + c->warning(__tr2qs("The config file with ID '%Q' is not open"), &szId); } return true; } @@ -243,7 +254,7 @@ static bool config_kvs_fnc_section(KviKvsModuleFunctionCall * c) QString szId; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("id",KVS_PT_STRING,0,szId) + KVSM_PARAMETER("id", KVS_PT_STRING, 0, szId) KVSM_PARAMETERS_END(c) KviConfigurationFile * cfg = g_pConfigDict->find(szId); @@ -251,8 +262,10 @@ static bool config_kvs_fnc_section(KviKvsModuleFunctionCall * c) if(cfg) { c->returnValue()->setString(cfg->group()); - } else { - c->warning(__tr2qs("The config file with ID '%Q' is not open"),&szId); + } + else + { + c->warning(__tr2qs("The config file with ID '%Q' is not open"), &szId); } return true; } @@ -281,7 +294,7 @@ static bool config_kvs_fnc_readonly(KviKvsModuleFunctionCall * c) QString szId; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("id",KVS_PT_STRING,0,szId) + KVSM_PARAMETER("id", KVS_PT_STRING, 0, szId) KVSM_PARAMETERS_END(c) KviConfigurationFile * cfg = g_pConfigDict->find(szId); @@ -289,8 +302,10 @@ static bool config_kvs_fnc_readonly(KviKvsModuleFunctionCall * c) if(cfg) { c->returnValue()->setBoolean(cfg->readOnly()); - } else { - c->warning(__tr2qs("The config file with ID '%Q' is not open"),&szId); + } + else + { + c->warning(__tr2qs("The config file with ID '%Q' is not open"), &szId); c->returnValue()->setInteger(false); } return true; @@ -319,7 +334,7 @@ static bool config_kvs_fnc_filename(KviKvsModuleFunctionCall * c) QString szId; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("id",KVS_PT_STRING,0,szId) + KVSM_PARAMETER("id", KVS_PT_STRING, 0, szId) KVSM_PARAMETERS_END(c) KviConfigurationFile * cfg = g_pConfigDict->find(szId); @@ -355,8 +370,8 @@ static bool config_kvs_fnc_hassection(KviKvsModuleFunctionCall * c) QString szSect; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("id",KVS_PT_STRING,0,szId) - KVSM_PARAMETER("id",KVS_PT_STRING,0,szSect) + KVSM_PARAMETER("id", KVS_PT_STRING, 0, szId) + KVSM_PARAMETER("id", KVS_PT_STRING, 0, szSect) KVSM_PARAMETERS_END(c) KviConfigurationFile * cfg = g_pConfigDict->find(szId); @@ -364,8 +379,10 @@ static bool config_kvs_fnc_hassection(KviKvsModuleFunctionCall * c) if(cfg) { c->returnValue()->setBoolean(cfg->hasGroup(szSect)); - } else { - c->warning(__tr2qs("The config file with ID '%Q' is not open"),&szId); + } + else + { + c->warning(__tr2qs("The config file with ID '%Q' is not open"), &szId); } return true; } @@ -392,7 +409,7 @@ static bool config_kvs_fnc_sectionlist(KviKvsModuleFunctionCall * c) QString szId; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("id",KVS_PT_STRING,0,szId) + KVSM_PARAMETER("id", KVS_PT_STRING, 0, szId) KVSM_PARAMETERS_END(c) KviConfigurationFile * cfg = g_pConfigDict->find(szId); @@ -400,16 +417,18 @@ static bool config_kvs_fnc_sectionlist(KviKvsModuleFunctionCall * c) if(cfg) { KviConfigurationFileIterator it(*(cfg->dict())); - KviKvsArray* pArray = new KviKvsArray(); - int id=0; + KviKvsArray * pArray = new KviKvsArray(); + int id = 0; while(it.current()) { pArray->set(id++, new KviKvsVariant(it.currentKey())); ++it; } c->returnValue()->setArray(pArray); - } else { - c->warning(__tr2qs("The config file with ID '%Q' is not open"),&szId); + } + else + { + c->warning(__tr2qs("The config file with ID '%Q' is not open"), &szId); } return true; } @@ -436,7 +455,7 @@ static bool config_kvs_fnc_keylist(KviKvsModuleFunctionCall * c) QString szId; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("id",KVS_PT_STRING,0,szId) + KVSM_PARAMETER("id", KVS_PT_STRING, 0, szId) KVSM_PARAMETERS_END(c) KviConfigurationFile * cfg = g_pConfigDict->find(szId); @@ -444,12 +463,13 @@ static bool config_kvs_fnc_keylist(KviKvsModuleFunctionCall * c) if(cfg) { KviConfigurationFileGroup * d = cfg->dict()->find(cfg->group()); - if(!d)return true; + if(!d) + return true; KviConfigurationFileGroupIterator it(*d); - KviKvsArray* pArray = new KviKvsArray(); - int id=0; + KviKvsArray * pArray = new KviKvsArray(); + int id = 0; while(it.current()) { @@ -457,8 +477,10 @@ static bool config_kvs_fnc_keylist(KviKvsModuleFunctionCall * c) ++it; } c->returnValue()->setArray(pArray); - } else { - c->warning(__tr2qs("The config file with ID '%Q' is not open"),&szId); + } + else + { + c->warning(__tr2qs("The config file with ID '%Q' is not open"), &szId); } return true; } @@ -484,10 +506,10 @@ static bool config_kvs_fnc_filelist(KviKvsModuleFunctionCall * c) KVSM_PARAMETERS_BEGIN(c) KVSM_PARAMETERS_END(c) - KviKvsArray* pArray = new KviKvsArray(); - int id=0; + KviKvsArray * pArray = new KviKvsArray(); + int id = 0; - KviPointerHashTableIterator it(*g_pConfigDict); + KviPointerHashTableIterator it(*g_pConfigDict); while(it.current()) { pArray->set(id++, new KviKvsVariant(it.currentKey())); @@ -524,7 +546,7 @@ static bool config_kvs_cmd_close(KviKvsModuleCommandCall * c) { QString szId; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("id",KVS_PT_STRING,0,szId) + KVSM_PARAMETER("id", KVS_PT_STRING, 0, szId) KVSM_PARAMETERS_END(c) KviConfigurationFile * cfg = g_pConfigDict->find(szId); @@ -535,19 +557,23 @@ static bool config_kvs_cmd_close(KviKvsModuleCommandCall * c) { if(cfg->dirty()) { - if(!c->hasSwitch('q',"quiet")) - c->warning(__tr2qs("The config file '%Q' has been changed but is opened as read-only: changes will be lost"),&cfg->fileName()); + if(!c->hasSwitch('q', "quiet")) + c->warning(__tr2qs("The config file '%Q' has been changed but is opened as read-only: changes will be lost"), &cfg->fileName()); } - } else { + } + else + { // we force a save here if(!cfg->sync()) - if(!c->hasSwitch('q',"quiet")) - c->warning(__tr2qs("An error has occurred while trying to save the config file with ID '%Q'"),&szId); + if(!c->hasSwitch('q', "quiet")) + c->warning(__tr2qs("An error has occurred while trying to save the config file with ID '%Q'"), &szId); } g_pConfigDict->remove(szId); - } else { - if(!c->hasSwitch('q',"quiet")) - c->warning(__tr2qs("The config file with ID '%Q' is not open"),&szId); + } + else + { + if(!c->hasSwitch('q', "quiet")) + c->warning(__tr2qs("The config file with ID '%Q' is not open"), &szId); } return true; @@ -579,7 +605,7 @@ static bool config_kvs_cmd_flush(KviKvsModuleCommandCall * c) { QString szId; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("id",KVS_PT_STRING,0,szId) + KVSM_PARAMETER("id", KVS_PT_STRING, 0, szId) KVSM_PARAMETERS_END(c) KviConfigurationFile * cfg = g_pConfigDict->find(szId); @@ -587,12 +613,13 @@ static bool config_kvs_cmd_flush(KviKvsModuleCommandCall * c) if(cfg) { if(cfg->readOnly()) - c->warning(__tr2qs("The config file with ID '%Q' is read-only"),&szId); - else - if(!cfg->sync()) - c->warning(__tr2qs("An error has occurred while trying to save the config file with ID '%Q'"),&szId); - } else { - c->warning(__tr2qs("The config file with ID '%Q' is not open"),&szId); + c->warning(__tr2qs("The config file with ID '%Q' is read-only"), &szId); + else if(!cfg->sync()) + c->warning(__tr2qs("An error has occurred while trying to save the config file with ID '%Q'"), &szId); + } + else + { + c->warning(__tr2qs("The config file with ID '%Q' is not open"), &szId); } return true; @@ -624,7 +651,7 @@ static bool config_kvs_cmd_clear(KviKvsModuleCommandCall * c) { QString szId; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("id",KVS_PT_STRING,0,szId) + KVSM_PARAMETER("id", KVS_PT_STRING, 0, szId) KVSM_PARAMETERS_END(c) KviConfigurationFile * cfg = g_pConfigDict->find(szId); @@ -632,8 +659,10 @@ static bool config_kvs_cmd_clear(KviKvsModuleCommandCall * c) if(cfg) { cfg->clear(); - } else { - c->warning(__tr2qs("The config file with ID '%Q' is not open"),&szId); + } + else + { + c->warning(__tr2qs("The config file with ID '%Q' is not open"), &szId); } return true; @@ -667,8 +696,8 @@ static bool config_kvs_cmd_clearsection(KviKvsModuleCommandCall * c) QString szId; QString szSect; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("id",KVS_PT_STRING,0,szId) - KVSM_PARAMETER("section",KVS_PT_STRING,0,szSect) + KVSM_PARAMETER("id", KVS_PT_STRING, 0, szId) + KVSM_PARAMETER("section", KVS_PT_STRING, 0, szSect) KVSM_PARAMETERS_END(c) KviConfigurationFile * cfg = g_pConfigDict->find(szId); @@ -676,8 +705,10 @@ static bool config_kvs_cmd_clearsection(KviKvsModuleCommandCall * c) if(cfg) { cfg->clearGroup(szSect); - } else { - c->warning(__tr2qs("The config file with ID '%Q' is not open"),&szId); + } + else + { + c->warning(__tr2qs("The config file with ID '%Q' is not open"), &szId); } return true; @@ -716,9 +747,9 @@ static bool config_kvs_cmd_write(KviKvsModuleCommandCall * c) QString szVal; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("id",KVS_PT_STRING,0,szId) - KVSM_PARAMETER("key",KVS_PT_STRING,0,szKey) - KVSM_PARAMETER("value",KVS_PT_STRING,0,szVal) + KVSM_PARAMETER("id", KVS_PT_STRING, 0, szId) + KVSM_PARAMETER("key", KVS_PT_STRING, 0, szKey) + KVSM_PARAMETER("value", KVS_PT_STRING, 0, szVal) KVSM_PARAMETERS_END(c) KviConfigurationFile * cfg = g_pConfigDict->find(szId); @@ -726,11 +757,13 @@ static bool config_kvs_cmd_write(KviKvsModuleCommandCall * c) if(cfg) { if(!szVal.isEmpty()) - cfg->writeEntry(szKey,szVal); + cfg->writeEntry(szKey, szVal); else cfg->clearKey(szKey); - } else { - c->warning(__tr2qs("The config file with ID '%Q' is not open"),&szId); + } + else + { + c->warning(__tr2qs("The config file with ID '%Q' is not open"), &szId); } return true; @@ -763,8 +796,8 @@ static bool config_kvs_cmd_setsection(KviKvsModuleCommandCall * c) QString szSect; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("id",KVS_PT_STRING,0,szId) - KVSM_PARAMETER("section",KVS_PT_STRING,0,szSect) + KVSM_PARAMETER("id", KVS_PT_STRING, 0, szId) + KVSM_PARAMETER("section", KVS_PT_STRING, 0, szSect) KVSM_PARAMETERS_END(c) KviConfigurationFile * cfg = g_pConfigDict->find(szId); @@ -772,8 +805,10 @@ static bool config_kvs_cmd_setsection(KviKvsModuleCommandCall * c) if(cfg) { cfg->setGroup(szSect); - } else { - c->warning(__tr2qs("The config file with ID '%Q' is not open"),&szId); + } + else + { + c->warning(__tr2qs("The config file with ID '%Q' is not open"), &szId); } return true; @@ -839,26 +874,26 @@ static bool config_kvs_cmd_setsection(KviKvsModuleCommandCall * c) static bool config_module_init(KviModule * m) { - g_pConfigDict = new KviPointerHashTable; + g_pConfigDict = new KviPointerHashTable; g_pConfigDict->setAutoDelete(true); - KVSM_REGISTER_FUNCTION(m,"open",config_kvs_fnc_open); - KVSM_REGISTER_FUNCTION(m,"id",config_kvs_fnc_id); - KVSM_REGISTER_FUNCTION(m,"read",config_kvs_fnc_read); - KVSM_REGISTER_FUNCTION(m,"section",config_kvs_fnc_section); - KVSM_REGISTER_FUNCTION(m,"hassection",config_kvs_fnc_hassection); - KVSM_REGISTER_FUNCTION(m,"sectionlist",config_kvs_fnc_sectionlist); - KVSM_REGISTER_FUNCTION(m,"keylist",config_kvs_fnc_keylist); - KVSM_REGISTER_FUNCTION(m,"filelist",config_kvs_fnc_filelist); - KVSM_REGISTER_FUNCTION(m,"filename",config_kvs_fnc_filename); - KVSM_REGISTER_FUNCTION(m,"readonly",config_kvs_fnc_readonly); - - KVSM_REGISTER_SIMPLE_COMMAND(m,"close",config_kvs_cmd_close); - KVSM_REGISTER_SIMPLE_COMMAND(m,"flush",config_kvs_cmd_flush); - KVSM_REGISTER_SIMPLE_COMMAND(m,"clear",config_kvs_cmd_clear); - KVSM_REGISTER_SIMPLE_COMMAND(m,"clearsection",config_kvs_cmd_clearsection); - KVSM_REGISTER_SIMPLE_COMMAND(m,"setsection",config_kvs_cmd_setsection); - KVSM_REGISTER_SIMPLE_COMMAND(m,"write",config_kvs_cmd_write); + KVSM_REGISTER_FUNCTION(m, "open", config_kvs_fnc_open); + KVSM_REGISTER_FUNCTION(m, "id", config_kvs_fnc_id); + KVSM_REGISTER_FUNCTION(m, "read", config_kvs_fnc_read); + KVSM_REGISTER_FUNCTION(m, "section", config_kvs_fnc_section); + KVSM_REGISTER_FUNCTION(m, "hassection", config_kvs_fnc_hassection); + KVSM_REGISTER_FUNCTION(m, "sectionlist", config_kvs_fnc_sectionlist); + KVSM_REGISTER_FUNCTION(m, "keylist", config_kvs_fnc_keylist); + KVSM_REGISTER_FUNCTION(m, "filelist", config_kvs_fnc_filelist); + KVSM_REGISTER_FUNCTION(m, "filename", config_kvs_fnc_filename); + KVSM_REGISTER_FUNCTION(m, "readonly", config_kvs_fnc_readonly); + + KVSM_REGISTER_SIMPLE_COMMAND(m, "close", config_kvs_cmd_close); + KVSM_REGISTER_SIMPLE_COMMAND(m, "flush", config_kvs_cmd_flush); + KVSM_REGISTER_SIMPLE_COMMAND(m, "clear", config_kvs_cmd_clear); + KVSM_REGISTER_SIMPLE_COMMAND(m, "clearsection", config_kvs_cmd_clearsection); + KVSM_REGISTER_SIMPLE_COMMAND(m, "setsection", config_kvs_cmd_setsection); + KVSM_REGISTER_SIMPLE_COMMAND(m, "write", config_kvs_cmd_write); return true; } @@ -876,13 +911,12 @@ static bool config_module_can_unload(KviModule *) } KVIRC_MODULE( - "Config", // module name - "4.0.0", // module version - "Copyright (C) 2001 Szymon Stefanek (pragma at kvirc dot net)", // author & (C) - "Config file system for KVIrc", - config_module_init, - config_module_can_unload, - 0, - config_module_cleanup, - 0 -) + "Config", // module name + "4.0.0", // module version + "Copyright (C) 2001 Szymon Stefanek (pragma at kvirc dot net)", // author & (C) + "Config file system for KVIrc", + config_module_init, + config_module_can_unload, + 0, + config_module_cleanup, + 0) diff --git a/src/modules/context/libkvicontext.cpp b/src/modules/context/libkvicontext.cpp index 0cbcf7c4b..d8c1b87c6 100644 --- a/src/modules/context/libkvicontext.cpp +++ b/src/modules/context/libkvicontext.cpp @@ -44,56 +44,56 @@ #include "KviIrcSocket.h" #ifdef COMPILE_SSL_SUPPORT - #include "KviSSLMaster.h" +#include "KviSSLMaster.h" #endif -#define GET_CONSOLE_FROM_STANDARD_PARAMS \ - kvs_uint_t iContextId; \ - KVSM_PARAMETERS_BEGIN(c) \ - KVSM_PARAMETER("irc_context_id",KVS_PT_UINT,KVS_PF_OPTIONAL,iContextId) \ - KVSM_PARAMETERS_END(c) \ - KviConsoleWindow * pConsole = NULL; \ - if(c->parameterCount() > 0) \ - pConsole = g_pApp->findConsole(iContextId); \ - else \ +#define GET_CONSOLE_FROM_STANDARD_PARAMS \ + kvs_uint_t iContextId; \ + KVSM_PARAMETERS_BEGIN(c) \ + KVSM_PARAMETER("irc_context_id", KVS_PT_UINT, KVS_PF_OPTIONAL, iContextId) \ + KVSM_PARAMETERS_END(c) \ + KviConsoleWindow * pConsole = NULL; \ + if(c->parameterCount() > 0) \ + pConsole = g_pApp->findConsole(iContextId); \ + else \ pConsole = c->window()->console(); #define GET_CONNECTION_FROM_STANDARD_PARAMS \ - GET_CONSOLE_FROM_STANDARD_PARAMS \ - KviIrcConnection * pConnection = NULL; \ - if(pConsole) \ + GET_CONSOLE_FROM_STANDARD_PARAMS \ + KviIrcConnection * pConnection = NULL; \ + if(pConsole) \ pConnection = pConsole->context()->connection(); -#define STANDARD_IRC_CONNECTION_TARGET_PARAMETER(_fncName,_setCall) \ - static bool _fncName(KviKvsModuleFunctionCall * c) \ - { \ - GET_CONNECTION_FROM_STANDARD_PARAMS \ - if(pConnection) \ - { \ - if(pConnection->target()) \ - { \ - _setCall; \ - return true; \ - } \ - } \ - c->returnValue()->setNothing(); \ - return true; \ +#define STANDARD_IRC_CONNECTION_TARGET_PARAMETER(_fncName, _setCall) \ + static bool _fncName(KviKvsModuleFunctionCall * c) \ + { \ + GET_CONNECTION_FROM_STANDARD_PARAMS \ + if(pConnection) \ + { \ + if(pConnection->target()) \ + { \ + _setCall; \ + return true; \ + } \ + } \ + c->returnValue()->setNothing(); \ + return true; \ } -#define STANDARD_SERVERINFO_TARGET_PARAMETER(_fncName,_setCall) \ - static bool _fncName(KviKvsModuleFunctionCall * c) \ - { \ - GET_CONNECTION_FROM_STANDARD_PARAMS \ - if(pConnection) \ - { \ - if(pConnection->serverInfo()) \ - { \ - _setCall; \ - return true; \ - } \ - } \ - c->returnValue()->setNothing(); \ - return true; \ +#define STANDARD_SERVERINFO_TARGET_PARAMETER(_fncName, _setCall) \ + static bool _fncName(KviKvsModuleFunctionCall * c) \ + { \ + GET_CONNECTION_FROM_STANDARD_PARAMS \ + if(pConnection) \ + { \ + if(pConnection->serverInfo()) \ + { \ + _setCall; \ + return true; \ + } \ + } \ + c->returnValue()->setNothing(); \ + return true; \ } /* @@ -122,9 +122,8 @@ */ STANDARD_IRC_CONNECTION_TARGET_PARAMETER( - context_kvs_fnc_networkName, - c->returnValue()->setString(pConnection->currentNetworkName()) - ) + context_kvs_fnc_networkName, + c->returnValue()->setString(pConnection->currentNetworkName())) /* @doc: context.serverdbNetworkName @@ -154,9 +153,8 @@ STANDARD_IRC_CONNECTION_TARGET_PARAMETER( */ STANDARD_IRC_CONNECTION_TARGET_PARAMETER( - context_kvs_fnc_serverdbNetworkName, - c->returnValue()->setString(pConnection->target()->network()->name()) - ) + context_kvs_fnc_serverdbNetworkName, + c->returnValue()->setString(pConnection->target()->network()->name())) /* @doc: context.serverHostName @@ -190,9 +188,8 @@ STANDARD_IRC_CONNECTION_TARGET_PARAMETER( */ STANDARD_IRC_CONNECTION_TARGET_PARAMETER( - context_kvs_fnc_serverHostName, - c->returnValue()->setString(pConnection->currentServerName()) - ) + context_kvs_fnc_serverHostName, + c->returnValue()->setString(pConnection->currentServerName())) /* @doc: context.serverdbServerHostName @@ -224,9 +221,8 @@ STANDARD_IRC_CONNECTION_TARGET_PARAMETER( */ STANDARD_IRC_CONNECTION_TARGET_PARAMETER( - context_kvs_fnc_serverdbServerHostName, - c->returnValue()->setString(pConnection->target()->server()->hostName()) - ) + context_kvs_fnc_serverdbServerHostName, + c->returnValue()->setString(pConnection->target()->server()->hostName())) /* @doc: context.serverIpAddress @@ -252,9 +248,8 @@ STANDARD_IRC_CONNECTION_TARGET_PARAMETER( */ STANDARD_IRC_CONNECTION_TARGET_PARAMETER( - context_kvs_fnc_serverIpAddress, - c->returnValue()->setString(pConnection->target()->server()->ip()) - ) + context_kvs_fnc_serverIpAddress, + c->returnValue()->setString(pConnection->target()->server()->ip())) /* @doc: context.serverIsIPV6 @@ -281,9 +276,8 @@ STANDARD_IRC_CONNECTION_TARGET_PARAMETER( */ STANDARD_IRC_CONNECTION_TARGET_PARAMETER( - context_kvs_fnc_serverIsIPV6, - c->returnValue()->setBoolean(pConnection->target()->server()->isIPv6()) - ) + context_kvs_fnc_serverIsIPV6, + c->returnValue()->setBoolean(pConnection->target()->server()->isIPv6())) /* @doc: context.serverIsSSL @@ -310,9 +304,8 @@ STANDARD_IRC_CONNECTION_TARGET_PARAMETER( */ STANDARD_IRC_CONNECTION_TARGET_PARAMETER( - context_kvs_fnc_serverIsSSL, - c->returnValue()->setBoolean(pConnection->target()->server()->useSSL()) - ) + context_kvs_fnc_serverIsSSL, + c->returnValue()->setBoolean(pConnection->target()->server()->useSSL())) /* @doc: context.serverSoftware @@ -340,9 +333,8 @@ STANDARD_IRC_CONNECTION_TARGET_PARAMETER( */ STANDARD_SERVERINFO_TARGET_PARAMETER( - context_kvs_fnc_serverSoftware, - c->returnValue()->setString(pConnection->serverInfo()->software()) - ) + context_kvs_fnc_serverSoftware, + c->returnValue()->setString(pConnection->serverInfo()->software())) /* @doc: context.serverPassword @@ -368,10 +360,8 @@ STANDARD_SERVERINFO_TARGET_PARAMETER( */ STANDARD_IRC_CONNECTION_TARGET_PARAMETER( - context_kvs_fnc_serverPassword, - c->returnValue()->setString(pConnection->target()->server()->password()) - ) - + context_kvs_fnc_serverPassword, + c->returnValue()->setString(pConnection->target()->server()->password())) /* @doc: context.serverPort @@ -396,10 +386,8 @@ STANDARD_IRC_CONNECTION_TARGET_PARAMETER( */ STANDARD_IRC_CONNECTION_TARGET_PARAMETER( - context_kvs_fnc_serverPort, - c->returnValue()->setInteger(pConnection->target()->server()->port()) - ) - + context_kvs_fnc_serverPort, + c->returnValue()->setInteger(pConnection->target()->server()->port())) /* @doc: context.state @@ -433,22 +421,22 @@ static bool context_kvs_fnc_state(KviKvsModuleFunctionCall * c) { case KviIrcContext::Idle: c->returnValue()->setString(QString("idle")); - break; + break; case KviIrcContext::PendingReconnection: c->returnValue()->setString(QString("pending")); - break; + break; case KviIrcContext::Connecting: c->returnValue()->setString(QString("connecting")); - break; + break; case KviIrcContext::LoggingIn: c->returnValue()->setString(QString("loggingin")); - break; + break; case KviIrcContext::Connected: c->returnValue()->setString(QString("connected")); - break; + break; default: c->returnValue()->setString(QString("unknown")); - break; + break; } return true; } @@ -457,7 +445,6 @@ static bool context_kvs_fnc_state(KviKvsModuleFunctionCall * c) return true; } - /* @doc: context.list @type: @@ -485,11 +472,11 @@ static bool context_kvs_fnc_list(KviKvsModuleFunctionCall * c) KviPointerList * pWinList = g_pMainWindow->windowList(); int idx = 0; - for(KviWindow * pWnd = pWinList->first();pWnd;pWnd = pWinList->next()) + for(KviWindow * pWnd = pWinList->first(); pWnd; pWnd = pWinList->next()) { if(pWnd->type() == KviWindow::Console) { - pArray->set(idx,new KviKvsVariant((kvs_int_t)((KviConsoleWindow *)pWnd)->context()->id())); + pArray->set(idx, new KviKvsVariant((kvs_int_t)((KviConsoleWindow *)pWnd)->context()->id())); idx++; } } @@ -520,9 +507,8 @@ static bool context_kvs_fnc_list(KviKvsModuleFunctionCall * c) */ STANDARD_IRC_CONNECTION_TARGET_PARAMETER( - context_kvs_fnc_connectionStartTime, - c->returnValue()->setInteger((kvs_int_t)(pConnection->statistics()->connectionStartTime())); - ) + context_kvs_fnc_connectionStartTime, + c->returnValue()->setInteger((kvs_int_t)(pConnection->statistics()->connectionStartTime()));) /* @doc: context.lastMessageTime @@ -546,9 +532,8 @@ STANDARD_IRC_CONNECTION_TARGET_PARAMETER( */ STANDARD_IRC_CONNECTION_TARGET_PARAMETER( - context_kvs_fnc_lastMessageTime, - c->returnValue()->setInteger((kvs_int_t)(pConnection->statistics()->lastMessageTime())); - ) + context_kvs_fnc_lastMessageTime, + c->returnValue()->setInteger((kvs_int_t)(pConnection->statistics()->lastMessageTime()));) /* @doc: context.clearqueue @@ -576,7 +561,7 @@ static bool context_kvs_cmd_clearQueue(KviKvsModuleCommandCall * c) { KVSM_REQUIRE_CONNECTION(c) - c->window()->connection()->clearOutputQueue(!c->switches()->find('a',"all")); + c->window()->connection()->clearOutputQueue(!c->switches()->find('a', "all")); return true; } @@ -672,13 +657,13 @@ static bool context_kvs_fnc_getSSLCertInfo(KviKvsModuleFunctionCall * c) QString szQuery; QString szType; QString szParam1; - bool bRemote=true; + bool bRemote = true; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("query",KVS_PT_STRING,0,szQuery) - KVSM_PARAMETER("type",KVS_PT_STRING,KVS_PF_OPTIONAL,szType) - KVSM_PARAMETER("context_id",KVS_PT_UINT,KVS_PF_OPTIONAL,uContextId) - KVSM_PARAMETER("param1",KVS_PT_STRING,KVS_PF_OPTIONAL,szParam1) + KVSM_PARAMETER("query", KVS_PT_STRING, 0, szQuery) + KVSM_PARAMETER("type", KVS_PT_STRING, KVS_PF_OPTIONAL, szType) + KVSM_PARAMETER("context_id", KVS_PT_UINT, KVS_PF_OPTIONAL, uContextId) + KVSM_PARAMETER("param1", KVS_PT_STRING, KVS_PF_OPTIONAL, szParam1) KVSM_PARAMETERS_END(c) #ifndef COMPILE_SSL_SUPPORT @@ -702,12 +687,14 @@ static bool context_kvs_fnc_getSSLCertInfo(KviKvsModuleFunctionCall * c) return true; } - if(szType.compare("local")==0) + if(szType.compare("local") == 0) + { + bRemote = false; + } + else { - bRemote=false; - } else { // already defaults to true, we only catch the error condition - if(szType.compare("remote")!=0) + if(szType.compare("remote") != 0) { c->warning(__tr2qs("You specified a bad string for the parameter \"type\"")); c->returnValue()->setString(""); @@ -772,24 +759,24 @@ static bool context_kvs_fnc_getSSLCertInfo(KviKvsModuleFunctionCall * c) static bool context_module_init(KviModule * m) { - KVSM_REGISTER_FUNCTION(m,"serverHostName",context_kvs_fnc_serverHostName); - KVSM_REGISTER_FUNCTION(m,"serverIpAddress",context_kvs_fnc_serverIpAddress); - KVSM_REGISTER_FUNCTION(m,"serverPort",context_kvs_fnc_serverPort); - KVSM_REGISTER_FUNCTION(m,"serverIsIPV6",context_kvs_fnc_serverIsIPV6); - KVSM_REGISTER_FUNCTION(m,"serverIsSSL",context_kvs_fnc_serverIsSSL); - KVSM_REGISTER_FUNCTION(m,"serverPassword",context_kvs_fnc_serverPassword); - KVSM_REGISTER_FUNCTION(m,"networkName",context_kvs_fnc_networkName); - KVSM_REGISTER_FUNCTION(m,"serverdbNetworkName",context_kvs_fnc_serverdbNetworkName); - KVSM_REGISTER_FUNCTION(m,"serverdbServerHostName",context_kvs_fnc_serverdbServerHostName); - KVSM_REGISTER_FUNCTION(m,"state",context_kvs_fnc_state); - KVSM_REGISTER_FUNCTION(m,"list",context_kvs_fnc_list); - KVSM_REGISTER_FUNCTION(m,"serverSoftware",context_kvs_fnc_serverSoftware); - KVSM_REGISTER_FUNCTION(m,"connectionStartTime",context_kvs_fnc_connectionStartTime); - KVSM_REGISTER_FUNCTION(m,"lastMessageTime",context_kvs_fnc_lastMessageTime); - KVSM_REGISTER_FUNCTION(m,"queueSize",context_kvs_fnc_queueSize); - KVSM_REGISTER_FUNCTION(m,"getSSLCertInfo",context_kvs_fnc_getSSLCertInfo); - - KVSM_REGISTER_SIMPLE_COMMAND(m,"clearQueue",context_kvs_cmd_clearQueue); + KVSM_REGISTER_FUNCTION(m, "serverHostName", context_kvs_fnc_serverHostName); + KVSM_REGISTER_FUNCTION(m, "serverIpAddress", context_kvs_fnc_serverIpAddress); + KVSM_REGISTER_FUNCTION(m, "serverPort", context_kvs_fnc_serverPort); + KVSM_REGISTER_FUNCTION(m, "serverIsIPV6", context_kvs_fnc_serverIsIPV6); + KVSM_REGISTER_FUNCTION(m, "serverIsSSL", context_kvs_fnc_serverIsSSL); + KVSM_REGISTER_FUNCTION(m, "serverPassword", context_kvs_fnc_serverPassword); + KVSM_REGISTER_FUNCTION(m, "networkName", context_kvs_fnc_networkName); + KVSM_REGISTER_FUNCTION(m, "serverdbNetworkName", context_kvs_fnc_serverdbNetworkName); + KVSM_REGISTER_FUNCTION(m, "serverdbServerHostName", context_kvs_fnc_serverdbServerHostName); + KVSM_REGISTER_FUNCTION(m, "state", context_kvs_fnc_state); + KVSM_REGISTER_FUNCTION(m, "list", context_kvs_fnc_list); + KVSM_REGISTER_FUNCTION(m, "serverSoftware", context_kvs_fnc_serverSoftware); + KVSM_REGISTER_FUNCTION(m, "connectionStartTime", context_kvs_fnc_connectionStartTime); + KVSM_REGISTER_FUNCTION(m, "lastMessageTime", context_kvs_fnc_lastMessageTime); + KVSM_REGISTER_FUNCTION(m, "queueSize", context_kvs_fnc_queueSize); + KVSM_REGISTER_FUNCTION(m, "getSSLCertInfo", context_kvs_fnc_getSSLCertInfo); + + KVSM_REGISTER_SIMPLE_COMMAND(m, "clearQueue", context_kvs_cmd_clearQueue); return true; } @@ -800,13 +787,12 @@ static bool context_module_cleanup(KviModule *) } KVIRC_MODULE( - "context", - "4.0.0", - "Copyright (C) 2007 Szymon Stefanek (pragma at kvirc dot net)", - "IRC Context Related Functions", - context_module_init, - 0, - 0, - context_module_cleanup, - 0 -) + "context", + "4.0.0", + "Copyright (C) 2007 Szymon Stefanek (pragma at kvirc dot net)", + "IRC Context Related Functions", + context_module_init, + 0, + 0, + context_module_cleanup, + 0) diff --git a/src/modules/dcc/DccBroker.cpp b/src/modules/dcc/DccBroker.cpp index 53df4ffeb..08e9373d8 100644 --- a/src/modules/dcc/DccBroker.cpp +++ b/src/modules/dcc/DccBroker.cpp @@ -31,11 +31,11 @@ #include "DccVoiceWindow.h" #ifndef COMPILE_DISABLE_DCC_VIDEO - #include "DccVideoWindow.h" +#include "DccVideoWindow.h" #endif #ifdef COMPILE_DCC_CANVAS - #include "DccCanvasWindow.h" +#include "DccCanvasWindow.h" #endif #include "KviApplication.h" @@ -60,7 +60,7 @@ extern KVIRC_API KviSharedFilesManager * g_pSharedFilesManager; //#warning "The broker might lookup the remote host name" DccBroker::DccBroker() -: QObject(0) + : QObject(0) { setObjectName("dcc_broker"); DccFileTransfer::init(); @@ -71,22 +71,23 @@ DccBroker::DccBroker() m_pDccWindowList = new KviPointerList; m_pDccWindowList->setAutoDelete(false); - m_pZeroPortTags = new KviPointerHashTable(17); + m_pZeroPortTags = new KviPointerHashTable(17); m_pZeroPortTags->setAutoDelete(true); } DccBroker::~DccBroker() { delete m_pZeroPortTags; - while(m_pBoxList->first())delete m_pBoxList->first(); + while(m_pBoxList->first()) + delete m_pBoxList->first(); delete m_pBoxList; m_pBoxList = 0; - while(m_pDccWindowList->first())delete m_pDccWindowList->first(); + while(m_pDccWindowList->first()) + delete m_pDccWindowList->first(); delete m_pDccWindowList; DccFileTransfer::done(); } - KviDccZeroPortTag * DccBroker::addZeroPortTag() { static unsigned int g_uNextZeroPortTag = 0; @@ -97,14 +98,15 @@ KviDccZeroPortTag * DccBroker::addZeroPortTag() //t->m_szTag.prepend("mIrc-zero-port-"); t->m_uResumePosition = 0; // FIXME: we should clear this dict if it grows too high.... - m_pZeroPortTags->insert(t->m_szTag,t); + m_pZeroPortTags->insert(t->m_szTag, t); return t; } -KviDccZeroPortTag * DccBroker::findZeroPortTag(const QString &szTag) +KviDccZeroPortTag * DccBroker::findZeroPortTag(const QString & szTag) { KviDccZeroPortTag * t = m_pZeroPortTags->find(szTag); - if(!t)return 0; + if(!t) + return 0; if(t->m_tTimestamp.secsTo(QDateTime::currentDateTime()) > 180) { // too late man... @@ -114,7 +116,7 @@ KviDccZeroPortTag * DccBroker::findZeroPortTag(const QString &szTag) return t; } -void DccBroker::removeZeroPortTag(const QString &szTag) +void DccBroker::removeZeroPortTag(const QString & szTag) { m_pZeroPortTags->remove(szTag); } @@ -124,7 +126,7 @@ unsigned int DccBroker::dccBoxCount() return m_pBoxList->count(); } -void DccBroker::unregisterDccWindow(KviWindow *wnd) +void DccBroker::unregisterDccWindow(KviWindow * wnd) { m_pDccWindowList->removeRef(wnd); } @@ -141,9 +143,10 @@ void DccBroker::cancelDcc(DccDescriptor * dcc) dcc = 0; } -void DccBroker::cancelDcc(DccDialog *box,DccDescriptor * dcc) +void DccBroker::cancelDcc(DccDialog * box, DccDescriptor * dcc) { - if(box)box->forgetDescriptor(); + if(box) + box->forgetDescriptor(); delete dcc; dcc = 0; } @@ -156,42 +159,45 @@ void DccBroker::rsendManage(DccDescriptor * dcc) { // We need the filename... QFileInfo fi(dcc->szLocalFileName); - if(fi.exists())rsendExecute(0,dcc); - else rsendAskForFileName(dcc); + if(fi.exists()) + rsendExecute(0, dcc); + else + rsendAskForFileName(dcc); } void DccBroker::rsendAskForFileName(DccDescriptor * dcc) { QStringList filenames; if( - KviFileDialog::askForOpenFileNames( - filenames, - __tr2qs_ctx("Choose Files to Send - KVIrc","dcc"), - QString(), - QString(), - false, - true, - g_pMainWindow - ) - ) { - if(filenames.count() > 0) + KviFileDialog::askForOpenFileNames( + filenames, + __tr2qs_ctx("Choose Files to Send - KVIrc", "dcc"), + QString(), + QString(), + false, + true, + g_pMainWindow)) + { + if(filenames.count() > 0) + { + DccDescriptor * d; + QStringList::Iterator it = filenames.begin(); + while(it != filenames.end()) { - DccDescriptor * d; - QStringList::Iterator it=filenames.begin(); - while(it != filenames.end()) - { - d = new DccDescriptor(*dcc); - d->szLocalFileName = *(it); - d->szLocalFileName = d->szLocalFileName.trimmed(); - ++it; - if(d->szLocalFileName.isEmpty()) - cancelDcc(d); - else - rsendExecute(d); - } - delete dcc; + d = new DccDescriptor(*dcc); + d->szLocalFileName = *(it); + d->szLocalFileName = d->szLocalFileName.trimmed(); + ++it; + if(d->szLocalFileName.isEmpty()) + cancelDcc(d); + else + rsendExecute(d); } - } else { + delete dcc; + } + } + else + { cancelDcc(dcc); } } @@ -202,8 +208,8 @@ void DccBroker::rsendExecute(DccDescriptor * dcc) { // No way...we NEED the right IRC context... g_pApp->activeConsole()->output(KVI_OUT_DCCERROR, - __tr2qs_ctx("Can't send DCC %Q request to %Q: IRC connection has been terminated","dcc"), - &(dcc->szType),&(dcc->szNick)); + __tr2qs_ctx("Can't send DCC %Q request to %Q: IRC connection has been terminated", "dcc"), + &(dcc->szType), &(dcc->szNick)); delete dcc; return; } @@ -212,8 +218,8 @@ void DccBroker::rsendExecute(DccDescriptor * dcc) QFileInfo fi(dcc->szLocalFileName); if(!(fi.exists() && fi.isReadable() && (fi.isFile()) && (fi.size() > 0))) { - dcc->console()->output(KVI_OUT_DCCERROR,__tr2qs_ctx("Can't open file %Q for reading","dcc"), - &(dcc->szLocalFileName)); + dcc->console()->output(KVI_OUT_DCCERROR, __tr2qs_ctx("Can't open file %Q for reading", "dcc"), + &(dcc->szLocalFileName)); delete dcc; return; } @@ -222,7 +228,7 @@ void DccBroker::rsendExecute(DccDescriptor * dcc) dcc->szFileName = QFileInfo(dcc->szFileName).fileName(); QString fName = dcc->szFileName; - fName.replace(' ',"\\040"); // be cool :) + fName.replace(' ', "\\040"); // be cool :) QString szTag; if(dcc->isZeroPortRequest()) @@ -236,21 +242,23 @@ void DccBroker::rsendExecute(DccDescriptor * dcc) // DCC [ST]SEND dcc->console()->connection()->sendFmtData("PRIVMSG %s :%cDCC %s %s 127.0.0.1 0 %s %s%c", - dcc->console()->connection()->encodeText(dcc->szNick).data(), - 0x01, - dcc->console()->connection()->encodeText(dcc->szType).data(), - dcc->console()->connection()->encodeText(fName).data(), - dcc->console()->connection()->encodeText(QString::number(fi.size())).data(), - dcc->console()->connection()->encodeText(szTag).data(), - 0x01); - } else { + dcc->console()->connection()->encodeText(dcc->szNick).data(), + 0x01, + dcc->console()->connection()->encodeText(dcc->szType).data(), + dcc->console()->connection()->encodeText(fName).data(), + dcc->console()->connection()->encodeText(QString::number(fi.size())).data(), + dcc->console()->connection()->encodeText(szTag).data(), + 0x01); + } + else + { dcc->console()->connection()->sendFmtData("PRIVMSG %s :%cDCC %s %s %s%c", - dcc->console()->connection()->encodeText(dcc->szNick).data(), - 0x01, - dcc->console()->connection()->encodeText(dcc->szType).data(), - dcc->console()->connection()->encodeText(fName).data(), - dcc->console()->connection()->encodeText(QString::number(fi.size())).data(), - 0x01); + dcc->console()->connection()->encodeText(dcc->szNick).data(), + 0x01, + dcc->console()->connection()->encodeText(dcc->szType).data(), + dcc->console()->connection()->encodeText(fName).data(), + dcc->console()->connection()->encodeText(QString::number(fi.size())).data(), + 0x01); szTag = dcc->szFileName; } @@ -259,18 +267,18 @@ void DccBroker::rsendExecute(DccDescriptor * dcc) QString szMask = dcc->szNick; szMask += "!*@*"; - g_pSharedFilesManager->addSharedFile(szTag,dcc->szLocalFileName,szMask,120); + g_pSharedFilesManager->addSharedFile(szTag, dcc->szLocalFileName, szMask, 120); delete dcc; } -void DccBroker::rsendExecute(DccDialog * box,DccDescriptor * dcc) +void DccBroker::rsendExecute(DccDialog * box, DccDescriptor * dcc) { - if(box)box->forgetDescriptor(); + if(box) + box->forgetDescriptor(); rsendExecute(dcc); } - /////////////////////////////////////////////////////////////////////////////// // DCC CHAT /////////////////////////////////////////////////////////////////////////////// @@ -281,46 +289,51 @@ void DccBroker::handleChatRequest(DccDescriptor * dcc) { // FIXME: better message ? Secure Direct Client Connection...eventually // need confirmation - QString tmp = __tr2qs_ctx( \ - "%1 [%2@%3] requests a " \ - "Direct Client Connection in %4 mode.
", \ - "dcc").arg(dcc->szNick, dcc->szUser, dcc->szHost, dcc->szType); + QString tmp = __tr2qs_ctx( + "%1 [%2@%3] requests a " + "Direct Client Connection in %4 mode.
", + "dcc") + .arg(dcc->szNick, dcc->szUser, dcc->szHost, dcc->szType); #ifdef COMPILE_SSL_SUPPORT - if(dcc->bIsSSL)tmp += __tr2qs_ctx("The connection will be secured using SSL.
","dcc"); + if(dcc->bIsSSL) + tmp += __tr2qs_ctx("The connection will be secured using SSL.
", "dcc"); #endif if(dcc->isZeroPortRequest()) { - tmp += __tr2qs_ctx( \ - "You will be the passive side of the connection.
" \ - ,"dcc"); - } else { - tmp += __tr2qs_ctx( \ - "The connection target will be host %1 on port %2
" \ - ,"dcc").arg(dcc->szIp, dcc->szPort); + tmp += __tr2qs_ctx( + "You will be the passive side of the connection.
", "dcc"); + } + else + { + tmp += __tr2qs_ctx( + "The connection target will be host %1 on port %2
", "dcc") + .arg(dcc->szIp, dcc->szPort); } + QString caption = __tr2qs_ctx("DCC %1 Request - KVIrc", "dcc").arg(dcc->szType); - QString caption = __tr2qs_ctx("DCC %1 Request - KVIrc","dcc").arg(dcc->szType); - - DccAcceptDialog * box = new DccAcceptDialog(this,dcc,tmp,caption); + DccAcceptDialog * box = new DccAcceptDialog(this, dcc, tmp, caption); m_pBoxList->append(box); - connect(box,SIGNAL(accepted(DccDialog *,DccDescriptor *)), - this,SLOT(executeChat(DccDialog *,DccDescriptor *))); - connect(box,SIGNAL(rejected(DccDialog *,DccDescriptor *)), - this,SLOT(cancelDcc(DccDialog *,DccDescriptor *))); + connect(box, SIGNAL(accepted(DccDialog *, DccDescriptor *)), + this, SLOT(executeChat(DccDialog *, DccDescriptor *))); + connect(box, SIGNAL(rejected(DccDialog *, DccDescriptor *)), + this, SLOT(cancelDcc(DccDialog *, DccDescriptor *))); box->show(); - } else { + } + else + { // auto accept - executeChat(0,dcc); + executeChat(0, dcc); } } -void DccBroker::executeChat(DccDialog *box,DccDescriptor * dcc) +void DccBroker::executeChat(DccDialog * box, DccDescriptor * dcc) { - if(box)box->forgetDescriptor(); + if(box) + box->forgetDescriptor(); if(!g_pApp->windowExists(dcc->console())) { @@ -332,13 +345,11 @@ void DccBroker::executeChat(DccDialog *box,DccDescriptor * dcc) szSubProto.toLower(); QString tmp = QString("dcc: %1 %2@%3:%4").arg(szSubProto.ptr(), dcc->szNick, dcc->szIp, dcc->szPort); - DccChatWindow * chat = new DccChatWindow(dcc,tmp.toUtf8().data()); + DccChatWindow * chat = new DccChatWindow(dcc, tmp.toUtf8().data()); - bool bMinimized = dcc->bOverrideMinimize ? dcc->bShowMinimized : \ - (KVI_OPTION_BOOL(KviOption_boolCreateMinimizedDccChat) || \ - (dcc->bAutoAccept && KVI_OPTION_BOOL(KviOption_boolCreateMinimizedDccChatWhenAutoAccepted))); + bool bMinimized = dcc->bOverrideMinimize ? dcc->bShowMinimized : (KVI_OPTION_BOOL(KviOption_boolCreateMinimizedDccChat) || (dcc->bAutoAccept && KVI_OPTION_BOOL(KviOption_boolCreateMinimizedDccChatWhenAutoAccepted))); - g_pMainWindow->addWindow(chat,!bMinimized); + g_pMainWindow->addWindow(chat, !bMinimized); m_pDccWindowList->append(chat); } @@ -352,28 +363,31 @@ void DccBroker::activeVoiceManage(DccDescriptor * dcc) { // need confirmation QString tmp = __tr2qs_ctx( - "%1 [%2@%3] requests a
" \ - "Direct Client Connection in VOICE mode.
" \ - "The connection target will be host %4 on port %5
" \ - ,"dcc" \ - ).arg(dcc->szNick, dcc->szUser, dcc->szHost, dcc->szIp, dcc->szPort); + "%1 [%2@%3] requests a
" + "Direct Client Connection in VOICE mode.
" + "The connection target will be host %4 on port %5
", + "dcc") + .arg(dcc->szNick, dcc->szUser, dcc->szHost, dcc->szIp, dcc->szPort); - DccAcceptDialog * box = new DccAcceptDialog(this,dcc,tmp,__tr2qs_ctx("DCC VOICE request","dcc")); + DccAcceptDialog * box = new DccAcceptDialog(this, dcc, tmp, __tr2qs_ctx("DCC VOICE request", "dcc")); m_pBoxList->append(box); - connect(box,SIGNAL(accepted(DccDialog *,DccDescriptor *)), - this,SLOT(activeVoiceExecute(DccDialog *,DccDescriptor *))); - connect(box,SIGNAL(rejected(DccDialog *,DccDescriptor *)), - this,SLOT(cancelDcc(DccDialog *,DccDescriptor *))); + connect(box, SIGNAL(accepted(DccDialog *, DccDescriptor *)), + this, SLOT(activeVoiceExecute(DccDialog *, DccDescriptor *))); + connect(box, SIGNAL(rejected(DccDialog *, DccDescriptor *)), + this, SLOT(cancelDcc(DccDialog *, DccDescriptor *))); box->show(); - } else { + } + else + { // auto accept - activeVoiceExecute(0,dcc); + activeVoiceExecute(0, dcc); } } -void DccBroker::activeVoiceExecute(DccDialog *box,DccDescriptor * dcc) +void DccBroker::activeVoiceExecute(DccDialog * box, DccDescriptor * dcc) { - if(box)box->forgetDescriptor(); + if(box) + box->forgetDescriptor(); if(!g_pApp->windowExists(dcc->console())) { @@ -381,34 +395,30 @@ void DccBroker::activeVoiceExecute(DccDialog *box,DccDescriptor * dcc) dcc->setConsole(g_pApp->activeConsole()); } - KviCString tmp(KviCString::Format,"dcc: voice %s@%s:%s",dcc->szNick.toUtf8().data(),dcc->szIp.toUtf8().data(),dcc->szPort.toUtf8().data()); - DccVoiceWindow * v = new DccVoiceWindow(dcc,tmp.ptr()); + KviCString tmp(KviCString::Format, "dcc: voice %s@%s:%s", dcc->szNick.toUtf8().data(), dcc->szIp.toUtf8().data(), dcc->szPort.toUtf8().data()); + DccVoiceWindow * v = new DccVoiceWindow(dcc, tmp.ptr()); - bool bMinimized = dcc->bOverrideMinimize ? dcc->bShowMinimized : \ - (KVI_OPTION_BOOL(KviOption_boolCreateMinimizedDccVoice) || \ - (dcc->bAutoAccept && KVI_OPTION_BOOL(KviOption_boolCreateMinimizedDccVoiceWhenAutoAccepted))); + bool bMinimized = dcc->bOverrideMinimize ? dcc->bShowMinimized : (KVI_OPTION_BOOL(KviOption_boolCreateMinimizedDccVoice) || (dcc->bAutoAccept && KVI_OPTION_BOOL(KviOption_boolCreateMinimizedDccVoiceWhenAutoAccepted))); - g_pMainWindow->addWindow(v,!bMinimized); + g_pMainWindow->addWindow(v, !bMinimized); m_pDccWindowList->append(v); } - /////////////////////////////////////////////////////////////////////////////// // PASSIVE VOICE /////////////////////////////////////////////////////////////////////////////// void DccBroker::passiveVoiceExecute(DccDescriptor * dcc) { - KviCString tmp(KviCString::Format,"dcc: voice %s@%s:%s",dcc->szNick.toUtf8().data(),dcc->szIp.toUtf8().data(),dcc->szPort.toUtf8().data()); - DccVoiceWindow * v = new DccVoiceWindow(dcc,tmp.ptr()); + KviCString tmp(KviCString::Format, "dcc: voice %s@%s:%s", dcc->szNick.toUtf8().data(), dcc->szIp.toUtf8().data(), dcc->szPort.toUtf8().data()); + DccVoiceWindow * v = new DccVoiceWindow(dcc, tmp.ptr()); //#warning "Create minimized dcc voice ?... or maybe it's too much ? :)" bool bMinimized = dcc->bOverrideMinimize ? dcc->bShowMinimized : KVI_OPTION_BOOL(KviOption_boolCreateMinimizedDccChat); - g_pMainWindow->addWindow(v,!bMinimized); + g_pMainWindow->addWindow(v, !bMinimized); m_pDccWindowList->append(v); } - /////////////////////////////////////////////////////////////////////////////// // ACTIVE VIDEO /////////////////////////////////////////////////////////////////////////////// @@ -420,28 +430,31 @@ void DccBroker::activeVideoManage(DccDescriptor * dcc) { // need confirmation QString tmp = __tr2qs_ctx( - "%1 [%2@%3] requests a
" \ - "Direct Client Connection in VIDEO mode.
" \ - "The connection target will be host %4 on port %5
" \ - ,"dcc" \ - ).arg(dcc->szNick, dcc->szUser, dcc->szHost, dcc->szIp, dcc->szPort); + "%1 [%2@%3] requests a
" + "Direct Client Connection in VIDEO mode.
" + "The connection target will be host %4 on port %5
", + "dcc") + .arg(dcc->szNick, dcc->szUser, dcc->szHost, dcc->szIp, dcc->szPort); - DccAcceptDialog * box = new DccAcceptDialog(this,dcc,tmp,__tr2qs_ctx("DCC VIDEO request","dcc")); + DccAcceptDialog * box = new DccAcceptDialog(this, dcc, tmp, __tr2qs_ctx("DCC VIDEO request", "dcc")); m_pBoxList->append(box); - connect(box,SIGNAL(accepted(DccDialog *,DccDescriptor *)), - this,SLOT(activeVideoExecute(DccDialog *,DccDescriptor *))); - connect(box,SIGNAL(rejected(DccDialog *,DccDescriptor *)), - this,SLOT(cancelDcc(DccDialog *,DccDescriptor *))); + connect(box, SIGNAL(accepted(DccDialog *, DccDescriptor *)), + this, SLOT(activeVideoExecute(DccDialog *, DccDescriptor *))); + connect(box, SIGNAL(rejected(DccDialog *, DccDescriptor *)), + this, SLOT(cancelDcc(DccDialog *, DccDescriptor *))); box->show(); - } else { + } + else + { // auto accept - activeVideoExecute(0,dcc); + activeVideoExecute(0, dcc); } } -void DccBroker::activeVideoExecute(DccDialog *box,DccDescriptor * dcc) +void DccBroker::activeVideoExecute(DccDialog * box, DccDescriptor * dcc) { - if(box)box->forgetDescriptor(); + if(box) + box->forgetDescriptor(); if(!g_pApp->windowExists(dcc->console())) { @@ -449,23 +462,20 @@ void DccBroker::activeVideoExecute(DccDialog *box,DccDescriptor * dcc) dcc->setConsole(g_pApp->activeConsole()); } - KviCString tmp(KviCString::Format,"dcc: video %s@%s:%s",dcc->szNick.toUtf8().data(),dcc->szIp.toUtf8().data(),dcc->szPort.toUtf8().data()); - DccVideoWindow * v = new DccVideoWindow(dcc,tmp.ptr()); + KviCString tmp(KviCString::Format, "dcc: video %s@%s:%s", dcc->szNick.toUtf8().data(), dcc->szIp.toUtf8().data(), dcc->szPort.toUtf8().data()); + DccVideoWindow * v = new DccVideoWindow(dcc, tmp.ptr()); - bool bMinimized = dcc->bOverrideMinimize ? dcc->bShowMinimized : \ - (KVI_OPTION_BOOL(KviOption_boolCreateMinimizedDccVideo) || \ - (dcc->bAutoAccept && KVI_OPTION_BOOL(KviOption_boolCreateMinimizedDccVideoWhenAutoAccepted))); + bool bMinimized = dcc->bOverrideMinimize ? dcc->bShowMinimized : (KVI_OPTION_BOOL(KviOption_boolCreateMinimizedDccVideo) || (dcc->bAutoAccept && KVI_OPTION_BOOL(KviOption_boolCreateMinimizedDccVideoWhenAutoAccepted))); - g_pMainWindow->addWindow(v,!bMinimized); + g_pMainWindow->addWindow(v, !bMinimized); m_pDccWindowList->append(v); #else -void DccBroker::activeVideoExecute(DccDialog *,DccDescriptor *) +void DccBroker::activeVideoExecute(DccDialog *, DccDescriptor *) { #endif } - /////////////////////////////////////////////////////////////////////////////// // PASSIVE VIDEO /////////////////////////////////////////////////////////////////////////////// @@ -473,11 +483,11 @@ void DccBroker::activeVideoExecute(DccDialog *,DccDescriptor *) #ifndef COMPILE_DISABLE_DCC_VIDEO void DccBroker::passiveVideoExecute(DccDescriptor * dcc) { - KviCString tmp(KviCString::Format,"dcc: video %s@%s:%s",dcc->szNick.toUtf8().data(),dcc->szIp.toUtf8().data(),dcc->szPort.toUtf8().data()); - DccVideoWindow * v = new DccVideoWindow(dcc,tmp.ptr()); + KviCString tmp(KviCString::Format, "dcc: video %s@%s:%s", dcc->szNick.toUtf8().data(), dcc->szIp.toUtf8().data(), dcc->szPort.toUtf8().data()); + DccVideoWindow * v = new DccVideoWindow(dcc, tmp.ptr()); //#warning "Create minimized dcc video ?... or maybe it's too much ? :)" bool bMinimized = dcc->bOverrideMinimize ? dcc->bShowMinimized : KVI_OPTION_BOOL(KviOption_boolCreateMinimizedDccChat); - g_pMainWindow->addWindow(v,!bMinimized); + g_pMainWindow->addWindow(v, !bMinimized); m_pDccWindowList->append(v); #else void DccBroker::passiveVideoExecute(DccDescriptor *) @@ -485,7 +495,6 @@ void DccBroker::passiveVideoExecute(DccDescriptor *) #endif } - /////////////////////////////////////////////////////////////////////////////// // ACTIVE CANVAS /////////////////////////////////////////////////////////////////////////////// @@ -496,31 +505,34 @@ void DccBroker::activeCanvasManage(DccDescriptor * dcc) if(!dcc->bAutoAccept) { // need confirmation - QString tmp = __tr2qs_ctx( \ - "%1 [%2@%3] requests a
" \ - "Direct Client Connection in CANVAS mode.
" \ - "The connection target will be host %4 on port %5
" \ - ,"dcc" \ - ).arg(dcc->szNick, dcc->szUser, dcc->szHost, dcc->szIp, dcc->szPort); - - DccAcceptDialog * box = new DccAcceptDialog(this,dcc,tmp,__tr2qs_ctx("DCC CANVAS request","dcc")); + QString tmp = __tr2qs_ctx( + "%1 [%2@%3] requests a
" + "Direct Client Connection in CANVAS mode.
" + "The connection target will be host %4 on port %5
", + "dcc") + .arg(dcc->szNick, dcc->szUser, dcc->szHost, dcc->szIp, dcc->szPort); + + DccAcceptDialog * box = new DccAcceptDialog(this, dcc, tmp, __tr2qs_ctx("DCC CANVAS request", "dcc")); m_pBoxList->append(box); - connect(box,SIGNAL(accepted(DccDialog *,DccDescriptor *)), - this,SLOT(activeCanvasExecute(DccDialog *,DccDescriptor *))); - connect(box,SIGNAL(rejected(DccDialog *,DccDescriptor *)), - this,SLOT(cancelDcc(DccDialog *,DccDescriptor *))); + connect(box, SIGNAL(accepted(DccDialog *, DccDescriptor *)), + this, SLOT(activeCanvasExecute(DccDialog *, DccDescriptor *))); + connect(box, SIGNAL(rejected(DccDialog *, DccDescriptor *)), + this, SLOT(cancelDcc(DccDialog *, DccDescriptor *))); box->show(); - } else { + } + else + { // auto accept - activeCanvasExecute(0,dcc); + activeCanvasExecute(0, dcc); } } #endif #ifdef COMPILE_DCC_CANVAS -void DccBroker::activeCanvasExecute(DccDialog *box,DccDescriptor * dcc) +void DccBroker::activeCanvasExecute(DccDialog * box, DccDescriptor * dcc) { - if(box)box->forgetDescriptor(); + if(box) + box->forgetDescriptor(); if(!g_pApp->windowExists(dcc->console())) { @@ -528,19 +540,17 @@ void DccBroker::activeCanvasExecute(DccDialog *box,DccDescriptor * dcc) dcc->setConsole(g_pApp->activeConsole()); } - KviCString tmp(KviCString::Format,"dcc: canvas %s@%s:%s",dcc->szNick.toUtf8().data(),dcc->szIp.toUtf8().data(),dcc->szPort.toUtf8().data()); - DccCanvasWindow * cnv = new DccCanvasWindow(dcc,tmp.ptr()); + KviCString tmp(KviCString::Format, "dcc: canvas %s@%s:%s", dcc->szNick.toUtf8().data(), dcc->szIp.toUtf8().data(), dcc->szPort.toUtf8().data()); + DccCanvasWindow * cnv = new DccCanvasWindow(dcc, tmp.ptr()); //#warning "This option should be dedicated to Dcc Canvas!....for now we are using the DccChat options" - bool bMinimized = dcc->bOverrideMinimize ? dcc->bShowMinimized : \ - (KVI_OPTION_BOOL(KviOption_boolCreateMinimizedDccChat) || \ - (dcc->bAutoAccept && KVI_OPTION_BOOL(KviOption_boolCreateMinimizedDccChatWhenAutoAccepted))); + bool bMinimized = dcc->bOverrideMinimize ? dcc->bShowMinimized : (KVI_OPTION_BOOL(KviOption_boolCreateMinimizedDccChat) || (dcc->bAutoAccept && KVI_OPTION_BOOL(KviOption_boolCreateMinimizedDccChatWhenAutoAccepted))); - g_pMainWindow->addWindow(cnv,!bMinimized); + g_pMainWindow->addWindow(cnv, !bMinimized); m_pDccWindowList->append(cnv); #else -void DccBroker::activeCanvasExecute(DccDialog *,DccDescriptor *) +void DccBroker::activeCanvasExecute(DccDialog *, DccDescriptor *) { #endif } @@ -551,11 +561,11 @@ void DccBroker::activeCanvasExecute(DccDialog *,DccDescriptor *) #ifdef COMPILE_DCC_CANVAS void DccBroker::passiveCanvasExecute(DccDescriptor * dcc) { - KviCString tmp(KviCString::Format,"dcc: canvas %s@%s:%s",dcc->szNick.toUtf8().data(),dcc->szIp.toUtf8().data(),dcc->szPort.toUtf8().data()); - DccCanvasWindow * cnv = new DccCanvasWindow(dcc,tmp.ptr()); + KviCString tmp(KviCString::Format, "dcc: canvas %s@%s:%s", dcc->szNick.toUtf8().data(), dcc->szIp.toUtf8().data(), dcc->szPort.toUtf8().data()); + DccCanvasWindow * cnv = new DccCanvasWindow(dcc, tmp.ptr()); //#warning "This option should be dedicated to Dcc Canvas!....for now we are using the DccChat options" bool bMinimized = dcc->bOverrideMinimize ? dcc->bShowMinimized : KVI_OPTION_BOOL(KviOption_boolCreateMinimizedDccChat); - g_pMainWindow->addWindow(cnv,!bMinimized); + g_pMainWindow->addWindow(cnv, !bMinimized); m_pDccWindowList->append(cnv); } #endif @@ -570,9 +580,11 @@ void DccBroker::recvFileManage(DccDescriptor * dcc) { bool bOk; quint64 size = dcc->szFileSize.toULongLong(&bOk); - if(bOk) { - if(size>=KVI_OPTION_UINT(KviOption_uintMaximumRequestedAvatarSize)) { - cancelDcc(0,dcc); + if(bOk) + { + if(size >= KVI_OPTION_UINT(KviOption_uintMaximumRequestedAvatarSize)) + { + cancelDcc(0, dcc); return; } } @@ -586,94 +598,102 @@ void DccBroker::recvFileManage(DccDescriptor * dcc) if(dcc->bActive) { // Normal active send: we will be connecting - tmp = __tr2qs_ctx( \ - "%1 [%2@%3] " \ - "wants to send you the file " \ - "'%4', " \ - "%5 large.
" \ - "The connection target will be host %6 on port %7
" \ - ,"dcc" \ - ).arg(dcc->szNick, dcc->szUser, dcc->szHost, dcc->szFileName) - .arg(KviQString::makeSizeReadable(dcc->szFileSize.toULongLong())) - .arg(dcc->szIp, dcc->szPort); - - } else { + tmp = __tr2qs_ctx( + "%1 [%2@%3] " + "wants to send you the file " + "'%4', " + "%5 large.
" + "The connection target will be host %6 on port %7
", + "dcc") + .arg(dcc->szNick, dcc->szUser, dcc->szHost, dcc->szFileName) + .arg(KviQString::makeSizeReadable(dcc->szFileSize.toULongLong())) + .arg(dcc->szIp, dcc->szPort); + } + else + { // passive: we will be listening! - tmp = __tr2qs_ctx( \ - "%1 [%2@%3] " - "wants to send you the file " \ - "'%4', " \ - "%5 large.
" \ - "You will be the passive side of the connection.
" \ - ,"dcc" \ - ).arg(dcc->szNick, dcc->szUser, dcc->szHost, dcc->szFileName) - .arg(KviQString::makeSizeReadable(dcc->szFileSize.toULongLong())); + tmp = __tr2qs_ctx( + "%1 [%2@%3] " + "wants to send you the file " + "'%4', " + "%5 large.
" + "You will be the passive side of the connection.
", + "dcc") + .arg(dcc->szNick, dcc->szUser, dcc->szHost, dcc->szFileName) + .arg(KviQString::makeSizeReadable(dcc->szFileSize.toULongLong())); } if(dcc->bIsIncomingAvatar) { - tmp += __tr2qs_ctx( \ - "Note:" \ - "The file appears to be an avatar that you have requested. " \ - "You should not change its filename. " \ - "Save it in a location where KVIrc can find it, such as " \ - "the 'avatars', 'incoming', or 'pics' directories, " \ - "your home directory, or the save directory for the incoming file type. " \ - "The default save path will probably work. " \ - "You can instruct KVIrc to accept incoming avatars automatically " \ - "by setting the option boolAutoAcceptIncomingAvatars to true.
" \ - ,"dcc" \ - ); + tmp += __tr2qs_ctx( + "Note:" + "The file appears to be an avatar that you have requested. " + "You should not change its filename. " + "Save it in a location where KVIrc can find it, such as " + "the 'avatars', 'incoming', or 'pics' directories, " + "your home directory, or the save directory for the incoming file type. " + "The default save path will probably work. " + "You can instruct KVIrc to accept incoming avatars automatically " + "by setting the option boolAutoAcceptIncomingAvatars to true.
", + "dcc"); } //#warning "Maybe remove the pending avatar if rejected ?" - QString title = __tr2qs_ctx("DCC %1 Request - KVIrc","dcc").arg(dcc->szType); + QString title = __tr2qs_ctx("DCC %1 Request - KVIrc", "dcc").arg(dcc->szType); - DccAcceptDialog * box = new DccAcceptDialog(this,dcc,tmp,title); + DccAcceptDialog * box = new DccAcceptDialog(this, dcc, tmp, title); m_pBoxList->append(box); - connect(box,SIGNAL(accepted(DccDialog *,DccDescriptor *)), - this,SLOT(chooseSaveFileName(DccDialog *,DccDescriptor *))); - connect(box,SIGNAL(rejected(DccDialog *,DccDescriptor *)), - this,SLOT(cancelDcc(DccDialog *,DccDescriptor *))); + connect(box, SIGNAL(accepted(DccDialog *, DccDescriptor *)), + this, SLOT(chooseSaveFileName(DccDialog *, DccDescriptor *))); + connect(box, SIGNAL(rejected(DccDialog *, DccDescriptor *)), + this, SLOT(cancelDcc(DccDialog *, DccDescriptor *))); box->show(); - } else { + } + else + { // auto accept if(_OUTPUT_VERBOSE) { - dcc->console()->output(KVI_OUT_DCCMSG,__tr2qs_ctx("Auto-accepting DCC %Q request from %Q!%Q@%Q for file %Q","dcc"), - &(dcc->szType),&(dcc->szNick),&(dcc->szUser), - &(dcc->szHost),&(dcc->szFileName)); + dcc->console()->output(KVI_OUT_DCCMSG, __tr2qs_ctx("Auto-accepting DCC %Q request from %Q!%Q@%Q for file %Q", "dcc"), + &(dcc->szType), &(dcc->szNick), &(dcc->szUser), + &(dcc->szHost), &(dcc->szFileName)); } - chooseSaveFileName(0,dcc); + chooseSaveFileName(0, dcc); } } -void DccBroker::chooseSaveFileName(DccDialog *box,DccDescriptor *dcc) +void DccBroker::chooseSaveFileName(DccDialog * box, DccDescriptor * dcc) { - if(box)box->forgetDescriptor(); + if(box) + box->forgetDescriptor(); // Lookup the suggested save directory dcc->szLocalFileName = ""; - if(dcc->bIsIncomingAvatar)g_pApp->getLocalKvircDirectory(dcc->szLocalFileName,KviApplication::Avatars); - else { + if(dcc->bIsIncomingAvatar) + g_pApp->getLocalKvircDirectory(dcc->szLocalFileName, KviApplication::Avatars); + else + { if(KVI_OPTION_BOOL(KviOption_boolUseIncomingDccMediaTypeSavePath)) { g_pMediaManager->lock(); - if(KviMediaType * mt = g_pMediaManager->findMediaType(dcc->szFileName.toUtf8().data(),false)) + if(KviMediaType * mt = g_pMediaManager->findMediaType(dcc->szFileName.toUtf8().data(), false)) { if(mt->szSavePath.hasData()) { - if(KviFileUtils::directoryExists(mt->szSavePath.ptr()))dcc->szLocalFileName = mt->szSavePath; - else { - if(KviFileUtils::makeDir(mt->szSavePath.ptr()))dcc->szLocalFileName = mt->szSavePath; + if(KviFileUtils::directoryExists(mt->szSavePath.ptr())) + dcc->szLocalFileName = mt->szSavePath; + else + { + if(KviFileUtils::makeDir(mt->szSavePath.ptr())) + dcc->szLocalFileName = mt->szSavePath; } if(KVI_OPTION_BOOL(KviOption_boolSortReceivedByDccFilesByNicks)) { - KviQString::ensureLastCharIs(dcc->szLocalFileName,KVI_PATH_SEPARATOR_CHAR); + KviQString::ensureLastCharIs(dcc->szLocalFileName, KVI_PATH_SEPARATOR_CHAR); QString cleanNick = dcc->szNick; KviFileUtils::cleanFileName(cleanNick); dcc->szLocalFileName.append(cleanNick); @@ -687,10 +707,10 @@ void DccBroker::chooseSaveFileName(DccDialog *box,DccDescriptor *dcc) if(dcc->szLocalFileName.isEmpty()) { - g_pApp->getLocalKvircDirectory(dcc->szLocalFileName,KviApplication::Incoming); + g_pApp->getLocalKvircDirectory(dcc->szLocalFileName, KviApplication::Incoming); if(KVI_OPTION_BOOL(KviOption_boolSortReceivedByDccFilesByNicks)) { - KviQString::ensureLastCharIs(dcc->szLocalFileName,KVI_PATH_SEPARATOR_CHAR); + KviQString::ensureLastCharIs(dcc->szLocalFileName, KVI_PATH_SEPARATOR_CHAR); QString cleanNick = dcc->szNick; KviFileUtils::cleanFileName(cleanNick); dcc->szLocalFileName.append(cleanNick); @@ -700,7 +720,7 @@ void DccBroker::chooseSaveFileName(DccDialog *box,DccDescriptor *dcc) } } KviFileUtils::adjustFilePath(dcc->szLocalFileName); - KviQString::ensureLastCharIs(dcc->szLocalFileName,KVI_PATH_SEPARATOR_CHAR); + KviQString::ensureLastCharIs(dcc->szLocalFileName, KVI_PATH_SEPARATOR_CHAR); if(!(dcc->bAutoAccept)) { @@ -708,21 +728,24 @@ void DccBroker::chooseSaveFileName(DccDialog *box,DccDescriptor *dcc) KviFileUtils::cleanFileName(cleanFilename); dcc->szLocalFileName.append(cleanFilename); if(KviFileDialog::askForSaveFileName( - dcc->szLocalFileName, - __tr2qs_ctx("Choose Files to Save - KVIrc","dcc"), - dcc->szLocalFileName, - QString(), - false, - false, - true, - g_pMainWindow - )) + dcc->szLocalFileName, + __tr2qs_ctx("Choose Files to Save - KVIrc", "dcc"), + dcc->szLocalFileName, + QString(), + false, + false, + true, + g_pMainWindow)) + { + renameOverwriteResume(0, dcc); + } + else { - renameOverwriteResume(0,dcc); - } else { cancelDcc(dcc); } - } else { + } + else + { // auto accept // WE choose the filename QString cleanFilename = dcc->szFileName; @@ -731,17 +754,18 @@ void DccBroker::chooseSaveFileName(DccDialog *box,DccDescriptor *dcc) if(_OUTPUT_VERBOSE) { - dcc->console()->output(KVI_OUT_DCCMSG,__tr2qs_ctx("Auto-saving DCC %Q file %Q as \r![!dbl]play $0\r%Q\r","dcc"), - &(dcc->szType),&(dcc->szFileName),&(dcc->szLocalFileName)); + dcc->console()->output(KVI_OUT_DCCMSG, __tr2qs_ctx("Auto-saving DCC %Q file %Q as \r![!dbl]play $0\r%Q\r", "dcc"), + &(dcc->szType), &(dcc->szFileName), &(dcc->szLocalFileName)); } - renameOverwriteResume(0,dcc); + renameOverwriteResume(0, dcc); } } -void DccBroker::renameOverwriteResume(DccDialog *box,DccDescriptor * dcc) +void DccBroker::renameOverwriteResume(DccDialog * box, DccDescriptor * dcc) { - if(box)box->forgetDescriptor(); + if(box) + box->forgetDescriptor(); // Check if file exists QFileInfo fi(dcc->szLocalFileName); @@ -760,62 +784,67 @@ void DccBroker::renameOverwriteResume(DccDialog *box,DccDescriptor * dcc) bool bDisableResume = false; if( - (!bOk) || // remote size is unknown - (iRemoteSize > (quint64)fi.size()) // or it is larger than the actual size on disk - ) + (!bOk) || // remote size is unknown + (iRemoteSize > (quint64)fi.size()) // or it is larger than the actual size on disk + ) + { + tmp = __tr2qs_ctx( + "The file '%1' already exists " + "and is %2 large.
" + "Do you wish to
" + "auto-rename the new file,
" + "overwrite the existing file, or
" + "resume an incomplete download?", + "dcc") + .arg(dcc->szLocalFileName) + .arg(KviQString::makeSizeReadable(fi.size())); + } + else { - tmp = __tr2qs_ctx( \ - "The file '%1' already exists " \ - "and is %2 large.
" \ - "Do you wish to
" \ - "auto-rename the new file,
" \ - "overwrite the existing file, or
" \ - "resume an incomplete download?" \ - ,"dcc" \ - ).arg(dcc->szLocalFileName).arg(KviQString::makeSizeReadable(fi.size())); - } else { bDisableResume = true; // the file on disk is larger or equal to the remote one - tmp = __tr2qs_ctx( \ - "The file '%1' already exists " \ - "and is larger than the offered one.
" \ - "Do you wish to
" \ - "auto-rename the new file, or
" \ - "overwrite the existing file?" \ - ,"dcc" \ - ).arg(dcc->szLocalFileName); + tmp = __tr2qs_ctx( + "The file '%1' already exists " + "and is larger than the offered one.
" + "Do you wish to
" + "auto-rename the new file, or
" + "overwrite the existing file?", + "dcc") + .arg(dcc->szLocalFileName); } - DccRenameDialog * box = new DccRenameDialog(this,dcc,tmp,bDisableResume); + DccRenameDialog * box = new DccRenameDialog(this, dcc, tmp, bDisableResume); m_pBoxList->append(box); - connect(box,SIGNAL(renameSelected(DccDialog *,DccDescriptor *)), - this,SLOT(renameDccSendFile(DccDialog *,DccDescriptor *))); - connect(box,SIGNAL(overwriteSelected(DccDialog *,DccDescriptor *)), - this,SLOT(recvFileExecute(DccDialog *,DccDescriptor *))); - connect(box,SIGNAL(cancelSelected(DccDialog *,DccDescriptor *)), - this,SLOT(cancelDcc(DccDialog *,DccDescriptor *))); + connect(box, SIGNAL(renameSelected(DccDialog *, DccDescriptor *)), + this, SLOT(renameDccSendFile(DccDialog *, DccDescriptor *))); + connect(box, SIGNAL(overwriteSelected(DccDialog *, DccDescriptor *)), + this, SLOT(recvFileExecute(DccDialog *, DccDescriptor *))); + connect(box, SIGNAL(cancelSelected(DccDialog *, DccDescriptor *)), + this, SLOT(cancelDcc(DccDialog *, DccDescriptor *))); box->show(); return; } // auto resume ? if( - KVI_OPTION_BOOL(KviOption_boolAutoResumeDccSendWhenAutoAccepted) && - (bOk) && // only if the remote size is really known - (iRemoteSize > (quint64)fi.size()) && // only if the remote size is larger than the local size - (!DccFileTransfer::nonFailedTransferWithLocalFileName(dcc->szLocalFileName)) // only if there is no transfer with this local file name yet - ) + KVI_OPTION_BOOL(KviOption_boolAutoResumeDccSendWhenAutoAccepted) && (bOk) && // only if the remote size is really known + (iRemoteSize > (quint64)fi.size()) && // only if the remote size is larger than the local size + (!DccFileTransfer::nonFailedTransferWithLocalFileName(dcc->szLocalFileName)) // only if there is no transfer with this local file name yet + ) { // yep, auto resume... dcc->bResume = true; - recvFileExecute(0,dcc); - } else if(iRemoteSize == (quint64)fi.size()) + recvFileExecute(0, dcc); + } + else if(iRemoteSize == (quint64)fi.size()) + { + dcc->console()->output(KVI_OUT_DCCMSG, "Transfer aborted: file %Q already completed", &(dcc->szLocalFileName)); + cancelDcc(0, dcc); + } + else { - dcc->console()->output(KVI_OUT_DCCMSG,"Transfer aborted: file %Q already completed",&(dcc->szLocalFileName)); - cancelDcc(0,dcc); - } else { // otherwise auto rename - renameDccSendFile(0,dcc); + renameDccSendFile(0, dcc); } return; } @@ -823,19 +852,20 @@ void DccBroker::renameOverwriteResume(DccDialog *box,DccDescriptor * dcc) dcc->szLocalFileSize = "0"; // everything OK - recvFileExecute(0,dcc); + recvFileExecute(0, dcc); } -void DccBroker::renameDccSendFile(DccDialog *box,DccDescriptor * dcc) +void DccBroker::renameDccSendFile(DccDialog * box, DccDescriptor * dcc) { - if(box)box->forgetDescriptor(); - + if(box) + box->forgetDescriptor(); if(QFileInfo(dcc->szLocalFileName).exists()) { KviCString szOrig = dcc->szLocalFileName; int i = 1; - do { + do + { KviCString szNum; szNum.setNum(i); int idx = szOrig.findLastIdx('.'); @@ -845,7 +875,9 @@ void DccBroker::renameDccSendFile(DccDialog *box,DccDescriptor * dcc) dcc->szLocalFileName += "."; dcc->szLocalFileName += szNum; dcc->szLocalFileName += szOrig.right(szOrig.len() - idx); - } else { + } + else + { dcc->szLocalFileName = szOrig; dcc->szLocalFileName += "."; dcc->szLocalFileName += szNum; @@ -855,19 +887,20 @@ void DccBroker::renameDccSendFile(DccDialog *box,DccDescriptor * dcc) if(_OUTPUT_VERBOSE) { - dcc->console()->output(KVI_OUT_DCCMSG,__tr2qs_ctx("File %s exists, auto-renaming to %Q","dcc"), - szOrig.ptr(),&(dcc->szLocalFileName)); + dcc->console()->output(KVI_OUT_DCCMSG, __tr2qs_ctx("File %s exists, auto-renaming to %Q", "dcc"), + szOrig.ptr(), &(dcc->szLocalFileName)); } } dcc->szLocalFileSize = "0"; // 0 for sure - recvFileExecute(0,dcc); + recvFileExecute(0, dcc); } -void DccBroker::recvFileExecute(DccDialog *box,DccDescriptor * dcc) +void DccBroker::recvFileExecute(DccDialog * box, DccDescriptor * dcc) { - if(box)box->forgetDescriptor(); + if(box) + box->forgetDescriptor(); if(!g_pApp->windowExists(dcc->console())) { @@ -877,31 +910,27 @@ void DccBroker::recvFileExecute(DccDialog *box,DccDescriptor * dcc) DccFileTransfer * send = new DccFileTransfer(dcc); - bool bMinimized = dcc->bOverrideMinimize ? dcc->bShowMinimized : \ - (KVI_OPTION_BOOL(KviOption_boolCreateMinimizedDccSend) || \ - (dcc->bAutoAccept && KVI_OPTION_BOOL(KviOption_boolCreateMinimizedDccSendWhenAutoAccepted))); + bool bMinimized = dcc->bOverrideMinimize ? dcc->bShowMinimized : (KVI_OPTION_BOOL(KviOption_boolCreateMinimizedDccSend) || (dcc->bAutoAccept && KVI_OPTION_BOOL(KviOption_boolCreateMinimizedDccSendWhenAutoAccepted))); - send->invokeTransferWindow(bMinimized,bMinimized); + send->invokeTransferWindow(bMinimized, bMinimized); } - void DccBroker::sendFileManage(DccDescriptor * dcc) { QStringList filenames; if(KviFileDialog::askForOpenFileNames( - filenames, - __tr2qs_ctx("Choose Files to Send - KVIrc","dcc"), - QString(), - QString(), - false, - true, - g_pMainWindow - )) + filenames, + __tr2qs_ctx("Choose Files to Send - KVIrc", "dcc"), + QString(), + QString(), + false, + true, + g_pMainWindow)) { if(filenames.count() > 0) { DccDescriptor * d; - QStringList::Iterator it=filenames.begin(); + QStringList::Iterator it = filenames.begin(); while(it != filenames.end()) { d = new DccDescriptor(*dcc); @@ -911,18 +940,21 @@ void DccBroker::sendFileManage(DccDescriptor * dcc) if(d->szLocalFileName.isEmpty()) cancelDcc(d); else - sendFileExecute(0,d); + sendFileExecute(0, d); } delete dcc; } - } else { + } + else + { cancelDcc(dcc); } } -void DccBroker::sendFileExecute(DccDialog * box,DccDescriptor *dcc) +void DccBroker::sendFileExecute(DccDialog * box, DccDescriptor * dcc) { - if(box)box->forgetDescriptor(); + if(box) + box->forgetDescriptor(); if(!g_pApp->windowExists(dcc->console())) { @@ -933,8 +965,8 @@ void DccBroker::sendFileExecute(DccDialog * box,DccDescriptor *dcc) QFileInfo fi(dcc->szLocalFileName); if(!(fi.exists() && fi.isReadable() && (fi.isFile()) && (fi.size() > 0))) { - dcc->console()->output(KVI_OUT_DCCERROR,__tr2qs_ctx("Can't open file %Q for reading","dcc"), - &(dcc->szLocalFileName)); + dcc->console()->output(KVI_OUT_DCCERROR, __tr2qs_ctx("Can't open file %Q for reading", "dcc"), + &(dcc->szLocalFileName)); delete dcc; return; } @@ -948,30 +980,29 @@ void DccBroker::sendFileExecute(DccDialog * box,DccDescriptor *dcc) bool bMinimized = dcc->bOverrideMinimize ? dcc->bShowMinimized : KVI_OPTION_BOOL(KviOption_boolCreateMinimizedDccSend); - send->invokeTransferWindow(bMinimized,bMinimized); + send->invokeTransferWindow(bMinimized, bMinimized); } bool DccBroker::canUnload() { if(m_pBoxList) { - if((m_pBoxList->count() != 0) || - (m_pDccWindowList->count() != 0) || - (DccFileTransfer::transferCount() != 0))return false; + if((m_pBoxList->count() != 0) || (m_pDccWindowList->count() != 0) || (DccFileTransfer::transferCount() != 0)) + return false; } // else in the destructor anyway (going to die) return true; } -bool DccBroker::handleResumeAccepted(const char * filename,const char * port,const char * szZeroPortTag) +bool DccBroker::handleResumeAccepted(const char * filename, const char * port, const char * szZeroPortTag) { - return DccFileTransfer::handleResumeAccepted(filename,port,szZeroPortTag); + return DccFileTransfer::handleResumeAccepted(filename, port, szZeroPortTag); } -bool DccBroker::handleResumeRequest(KviDccRequest * dcc,const char * filename,const char * port,unsigned long filePos,const char * szZeroPortTag) +bool DccBroker::handleResumeRequest(KviDccRequest * dcc, const char * filename, const char * port, unsigned long filePos, const char * szZeroPortTag) { //qDebug("HANDLE %s %s %u %s",filename,port,filePos,szZeroPortTag); // the zeroPOrtTag is nonempty here only if port == 0 - if(kvi_strEqualCI("0",port) && szZeroPortTag) + if(kvi_strEqualCI("0", port) && szZeroPortTag) { // zero port resume request (we have sent out a DCC SEND 0 KviDccZeroPortTag * t = findZeroPortTag(QString(szZeroPortTag)); @@ -985,23 +1016,22 @@ bool DccBroker::handleResumeRequest(KviDccRequest * dcc,const char * filename,co t->m_uResumePosition = filePos; KviCString szBuffy; - KviIrcServerParser::encodeCtcpParameter(filename,szBuffy); + KviIrcServerParser::encodeCtcpParameter(filename, szBuffy); dcc->ctcpMsg->msg->console()->connection()->sendFmtData( - "PRIVMSG %s :%cDCC ACCEPT %s %s %s %s%c", - dcc->ctcpMsg->msg->console()->connection()->encodeText(dcc->ctcpMsg->pSource->nick()).data(), - 0x01, - szBuffy.ptr(), - port, - dcc->ctcpMsg->msg->console()->connection()->encodeText(QString::number(filePos)).data(), - szZeroPortTag, - 0x01 - ); + "PRIVMSG %s :%cDCC ACCEPT %s %s %s %s%c", + dcc->ctcpMsg->msg->console()->connection()->encodeText(dcc->ctcpMsg->pSource->nick()).data(), + 0x01, + szBuffy.ptr(), + port, + dcc->ctcpMsg->msg->console()->connection()->encodeText(QString::number(filePos)).data(), + szZeroPortTag, + 0x01); return true; } } //qDebug("NOT A ZeRO PORT"); - return DccFileTransfer::handleResumeRequest(filename,port,filePos); + return DccFileTransfer::handleResumeRequest(filename, port, filePos); } diff --git a/src/modules/dcc/DccBroker.h b/src/modules/dcc/DccBroker.h index 92421d428..651f3d8c4 100644 --- a/src/modules/dcc/DccBroker.h +++ b/src/modules/dcc/DccBroker.h @@ -42,14 +42,13 @@ class DccDialog; // #define COMPILE_DCC_CANVAS - class KviDccZeroPortTag { public: - QDateTime m_tTimestamp; - QString m_szTag; - unsigned long m_uFileSize; // outgoing file size, valid only for file transfers obviously - unsigned long m_uResumePosition; // if 0 = no resume, valid only for file transfers obviously + QDateTime m_tTimestamp; + QString m_szTag; + unsigned long m_uFileSize; // outgoing file size, valid only for file transfers obviously + unsigned long m_uResumePosition; // if 0 = no resume, valid only for file transfers obviously }; class DccBroker : public QObject @@ -58,20 +57,22 @@ class DccBroker : public QObject public: DccBroker(); ~DccBroker(); + protected: - KviPointerList * m_pBoxList; - KviPointerList * m_pDccWindowList; - KviPointerHashTable * m_pZeroPortTags; + KviPointerList * m_pBoxList; + KviPointerList * m_pDccWindowList; + KviPointerHashTable * m_pZeroPortTags; + public: KviDccZeroPortTag * addZeroPortTag(); - KviDccZeroPortTag * findZeroPortTag(const QString &szTag); - void removeZeroPortTag(const QString &szTag); + KviDccZeroPortTag * findZeroPortTag(const QString & szTag); + void removeZeroPortTag(const QString & szTag); - unsigned int dccWindowsCount(){ return m_pDccWindowList->count(); }; + unsigned int dccWindowsCount() { return m_pDccWindowList->count(); }; unsigned int dccBoxCount(); void unregisterDccBox(DccDialog * box); - void unregisterDccWindow(KviWindow *dcc); + void unregisterDccWindow(KviWindow * dcc); void rsendManage(DccDescriptor * dcc); void rsendAskForFileName(DccDescriptor * dcc); @@ -92,28 +93,28 @@ public: void recvFileManage(DccDescriptor * dcc); void sendFileManage(DccDescriptor * dcc); - bool handleResumeAccepted(const char * filename,const char * port,const char * szZeroPortTag); - bool handleResumeRequest(KviDccRequest * dcc,const char * filename,const char * port,unsigned long filePos,const char * szZeroPortTag); + bool handleResumeAccepted(const char * filename, const char * port, const char * szZeroPortTag); + bool handleResumeRequest(KviDccRequest * dcc, const char * filename, const char * port, unsigned long filePos, const char * szZeroPortTag); public slots: - void rsendExecute(DccDialog * box,DccDescriptor * dcc); + void rsendExecute(DccDialog * box, DccDescriptor * dcc); void rsendExecute(DccDescriptor * dcc); -// void activeChatExecute(DccDialog * box,DccDescriptor * dcc); - void executeChat(DccDialog * box,DccDescriptor * dcc); + // void activeChatExecute(DccDialog * box,DccDescriptor * dcc); + void executeChat(DccDialog * box, DccDescriptor * dcc); - void activeCanvasExecute(DccDialog * box,DccDescriptor * dcc); - void activeVoiceExecute(DccDialog * box,DccDescriptor * dcc); - void activeVideoExecute(DccDialog * box,DccDescriptor * dcc); + void activeCanvasExecute(DccDialog * box, DccDescriptor * dcc); + void activeVoiceExecute(DccDialog * box, DccDescriptor * dcc); + void activeVideoExecute(DccDialog * box, DccDescriptor * dcc); - void sendFileExecute(DccDialog * box,DccDescriptor * dcc); - void recvFileExecute(DccDialog * box,DccDescriptor * dcc); + void sendFileExecute(DccDialog * box, DccDescriptor * dcc); + void recvFileExecute(DccDialog * box, DccDescriptor * dcc); - void chooseSaveFileName(DccDialog *box,DccDescriptor * dcc); - void renameOverwriteResume(DccDialog *box,DccDescriptor * dcc); - void renameDccSendFile(DccDialog *box,DccDescriptor * dcc); + void chooseSaveFileName(DccDialog * box, DccDescriptor * dcc); + void renameOverwriteResume(DccDialog * box, DccDescriptor * dcc); + void renameDccSendFile(DccDialog * box, DccDescriptor * dcc); - void cancelDcc(DccDialog *box,DccDescriptor * dcc); + void cancelDcc(DccDialog * box, DccDescriptor * dcc); void cancelDcc(DccDescriptor * dcc); public: diff --git a/src/modules/dcc/DccCanvasWindow.cpp b/src/modules/dcc/DccCanvasWindow.cpp index 4f1129303..7701c0ce1 100644 --- a/src/modules/dcc/DccCanvasWindow.cpp +++ b/src/modules/dcc/DccCanvasWindow.cpp @@ -28,153 +28,160 @@ #ifdef COMPILE_DCC_CANVAS - #include "DccDialog.h" - #include "DccMarshal.h" - #include "canvaswidget.h" - - #define _KVI_DEBUG_CHECK_RANGE_ - #include "kvi_debug.h" - #include "KviOptions.h" - #include "KviInput.h" - #include "KviIrcView.h" - #include "KviIconManager.h" - #include "KviLocale.h" - #include "KviError.h" - #include "kvi_out.h" - #include "KviNetUtils.h" - #include "KviConsoleWindow.h" - #include "KviMainWindow.h" - #include "KviMemory.h" - #include "KviThread.h" - #include "KviIrcSocket.h" - #include "kvi_settings.h" - #include "KviIrcConnection.h" - - #include - - extern DccBroker * g_pDccBroker; - - - DccCanvasWindow::DccCanvasWindow(DccDescriptor * dcc,const char * name) - : DccWindow(KVI_WINDOW_TYPE_DCCCANVAS,name,dcc) - { - m_pSplitter = new QSplitter(QSplitter::Vertical,this,"splitter"); - - m_pCanvas = new DccCanvasWidget(m_pSplitter); - - m_pIrcView = new KviIrcView(m_pSplitter,this); - m_pInput = new KviInput(this); +#include "DccDialog.h" +#include "DccMarshal.h" +#include "canvaswidget.h" + +#define _KVI_DEBUG_CHECK_RANGE_ +#include "kvi_debug.h" +#include "KviOptions.h" +#include "KviInput.h" +#include "KviIrcView.h" +#include "KviIconManager.h" +#include "KviLocale.h" +#include "KviError.h" +#include "kvi_out.h" +#include "KviNetUtils.h" +#include "KviConsoleWindow.h" +#include "KviMainWindow.h" +#include "KviMemory.h" +#include "KviThread.h" +#include "KviIrcSocket.h" +#include "kvi_settings.h" +#include "KviIrcConnection.h" + +#include + +extern DccBroker * g_pDccBroker; + +DccCanvasWindow::DccCanvasWindow(DccDescriptor * dcc, const char * name) + : DccWindow(KVI_WINDOW_TYPE_DCCCANVAS, name, dcc) +{ + m_pSplitter = new QSplitter(QSplitter::Vertical, this, "splitter"); + + m_pCanvas = new DccCanvasWidget(m_pSplitter); + + m_pIrcView = new KviIrcView(m_pSplitter, this); + m_pInput = new KviInput(this); // setFocusHandler(m_pInput,this); - m_pMarshal = new DccMarshal(this); - connect(m_pMarshal,SIGNAL(error(int)),this,SLOT(handleMarshalError(int))); - connect(m_pMarshal,SIGNAL(connected()),this,SLOT(connected())); + m_pMarshal = new DccMarshal(this); + connect(m_pMarshal, SIGNAL(error(int)), this, SLOT(handleMarshalError(int))); + connect(m_pMarshal, SIGNAL(connected()), this, SLOT(connected())); - - if(!(m_pDescriptor->bActive)) + if(!(m_pDescriptor->bActive)) + { + // PASSIVE CONNECTION + output(KVI_OUT_DCCMSG, __tr2qs_ctx("Attempting a passive DCC CANVAS connection", "dcc")); + int ret = m_pMarshal->dccListen(dcc->szListenIp, dcc->szListenPort, m_pDescriptor->bDoTimeout); + if(ret != KviError_success) + handleMarshalError(ret); + else { - // PASSIVE CONNECTION - output(KVI_OUT_DCCMSG,__tr2qs_ctx("Attempting a passive DCC CANVAS connection","dcc")); - int ret = m_pMarshal->dccListen(dcc->szListenIp,dcc->szListenPort,m_pDescriptor->bDoTimeout); - if(ret != KviError_success)handleMarshalError(ret); - else { - - output(KVI_OUT_DCCMSG,__tr2qs_ctx("Listening on interface %Q port %Q","dcc"), - &(m_pMarshal->localIp()),&(m_pMarshal->localPort())); - - if(dcc->bSendRequest) - { - QString ip = !dcc->szFakeIp.isEmpty() ? dcc->szFakeIp : dcc->szListenIp; - QString port = !dcc->szFakePort.isEmpty() ? dcc->szFakePort.toUtf8().data() : m_pMarshal->localPort(); - //#warning "OPTION FOR SENDING 127.0.0.1 and so on (not an unsigned number)" - struct in_addr a; - if(kvi_stringIpToBinaryIp(ip.toUtf8().data(),&a))ip.setNum(htonl(a.s_addr)); - dcc->console()->connection()->sendFmtData("PRIVMSG %s :%cDCC CANVAS chat %Q %Q%c", - dcc->console()->connection()->encodeText( dcc->szNick.toUtf8().data() ).data(), - 0x01,&ip, - &port, - 0x01); - output(KVI_OUT_DCCMSG,__tr2qs_ctx("Sent DCC CANVAS request to %Q, waiting for the remote client to connect...","dcc"), - &(dcc->szNick)); - } else outputNoFmt(KVI_OUT_DCCMSG,__tr2qs_ctx("DCC CANVAS request not sent: awaiting manual connections","dcc")); + + output(KVI_OUT_DCCMSG, __tr2qs_ctx("Listening on interface %Q port %Q", "dcc"), + &(m_pMarshal->localIp()), &(m_pMarshal->localPort())); + + if(dcc->bSendRequest) + { + QString ip = !dcc->szFakeIp.isEmpty() ? dcc->szFakeIp : dcc->szListenIp; + QString port = !dcc->szFakePort.isEmpty() ? dcc->szFakePort.toUtf8().data() : m_pMarshal->localPort(); + //#warning "OPTION FOR SENDING 127.0.0.1 and so on (not an unsigned number)" + struct in_addr a; + if(kvi_stringIpToBinaryIp(ip.toUtf8().data(), &a)) + ip.setNum(htonl(a.s_addr)); + dcc->console()->connection()->sendFmtData("PRIVMSG %s :%cDCC CANVAS chat %Q %Q%c", + dcc->console()->connection()->encodeText(dcc->szNick.toUtf8().data()).data(), + 0x01, &ip, + &port, + 0x01); + output(KVI_OUT_DCCMSG, __tr2qs_ctx("Sent DCC CANVAS request to %Q, waiting for the remote client to connect...", "dcc"), + &(dcc->szNick)); } - } else { - // ACTIVE CONNECTION - outputNoFmt(KVI_OUT_DCCMSG,__tr2qs_ctx("Attempting an active DCC CANVAS connection","dcc")); - int ret = m_pMarshal->dccConnect(dcc->szIp.toUtf8().data(),dcc->szPort.toUtf8().data(),m_pDescriptor->bDoTimeout); - if(ret != KviError_success)handleMarshalError(ret); - else output(KVI_OUT_DCCMSG,__tr2qs_ctx("Contacting host %Q on port %Q","dcc"),&(dcc->szIp),&(dcc->szPort)); + else + outputNoFmt(KVI_OUT_DCCMSG, __tr2qs_ctx("DCC CANVAS request not sent: awaiting manual connections", "dcc")); } + } + else + { + // ACTIVE CONNECTION + outputNoFmt(KVI_OUT_DCCMSG, __tr2qs_ctx("Attempting an active DCC CANVAS connection", "dcc")); + int ret = m_pMarshal->dccConnect(dcc->szIp.toUtf8().data(), dcc->szPort.toUtf8().data(), m_pDescriptor->bDoTimeout); + if(ret != KviError_success) + handleMarshalError(ret); + else + output(KVI_OUT_DCCMSG, __tr2qs_ctx("Contacting host %Q on port %Q", "dcc"), &(dcc->szIp), &(dcc->szPort)); + } // m_pSlaveThread = 0; - } +} - DccCanvasWindow::~DccCanvasWindow() - { - g_pDccBroker->unregisterDccWindow(this); +DccCanvasWindow::~DccCanvasWindow() +{ + g_pDccBroker->unregisterDccWindow(this); // if(m_pSlaveThread) // { // m_pSlaveThread->terminate(); // delete m_pSlaveThread; // m_pSlaveThread = 0; // } - KviThreadManager::killPendingEvents(this); + KviThreadManager::killPendingEvents(this); // delete m_pDescriptor; // delete m_pMarshal; - } - - const QString & DccCanvasWindow::target() - { - // This may change on the fly... - m_szTarget.sprintf("%s@%s:%s", - m_pDescriptor->szNick.toUtf8().data(),m_pDescriptor->szIp.toUtf8().data(),m_pDescriptor->szPort.toUtf8().data()); - return m_szTarget; - } - - void DccCanvasWindow::fillCaptionBuffers() - { - KviCString tmp(KviCString::Format,"DCC Canvas %s@%s:%s", - m_pDescriptor->szNick.toUtf8().data(),m_pDescriptor->szIp.toUtf8().data(),m_pDescriptor->szPort.toUtf8().data()); - - m_szPlainTextCaption = tmp; - - m_szHtmlActiveCaption.sprintf("%s", - KVI_OPTION_COLOR(KviOption_colorCaptionTextActive).name().ascii(),tmp.ptr()); - m_szHtmlInactiveCaption.sprintf("%s", - KVI_OPTION_COLOR(KviOption_colorCaptionTextInactive).name().ascii(),tmp.ptr()); - } - - QPixmap * DccCanvasWindow::myIconPtr() - { - return g_pIconManager->getSmallIcon(KVI_SMALLICON_CANVAS); - } - - void DccCanvasWindow::getBaseLogFileName(KviCString &buffer) - { - buffer.sprintf("%s_%s_%s",m_pDescriptor->szNick.toUtf8().data(),m_pDescriptor->szIp.toUtf8().data(),m_pDescriptor->szPort.toUtf8().data()); - } - - void DccCanvasWindow::ownMessage(const char * text, bool bUserFeedback) - { - KviCString buf(KviCString::Format,"%s\r\n",text); +} + +const QString & DccCanvasWindow::target() +{ + // This may change on the fly... + m_szTarget.sprintf("%s@%s:%s", + m_pDescriptor->szNick.toUtf8().data(), m_pDescriptor->szIp.toUtf8().data(), m_pDescriptor->szPort.toUtf8().data()); + return m_szTarget; +} + +void DccCanvasWindow::fillCaptionBuffers() +{ + KviCString tmp(KviCString::Format, "DCC Canvas %s@%s:%s", + m_pDescriptor->szNick.toUtf8().data(), m_pDescriptor->szIp.toUtf8().data(), m_pDescriptor->szPort.toUtf8().data()); + + m_szPlainTextCaption = tmp; + + m_szHtmlActiveCaption.sprintf("%s", + KVI_OPTION_COLOR(KviOption_colorCaptionTextActive).name().ascii(), tmp.ptr()); + m_szHtmlInactiveCaption.sprintf("%s", + KVI_OPTION_COLOR(KviOption_colorCaptionTextInactive).name().ascii(), tmp.ptr()); +} + +QPixmap * DccCanvasWindow::myIconPtr() +{ + return g_pIconManager->getSmallIcon(KVI_SMALLICON_CANVAS); +} + +void DccCanvasWindow::getBaseLogFileName(KviCString & buffer) +{ + buffer.sprintf("%s_%s_%s", m_pDescriptor->szNick.toUtf8().data(), m_pDescriptor->szIp.toUtf8().data(), m_pDescriptor->szPort.toUtf8().data()); +} + +void DccCanvasWindow::ownMessage(const char * text, bool bUserFeedback) +{ + KviCString buf(KviCString::Format, "%s\r\n", text); // m_pSlaveThread->sendRawData(buf.ptr(),buf.len()); - if(bUserFeedback) - m_pFrm->firstConsole()->outputPrivmsg(this,KVI_OUT_OWNPRIVMSG, - m_pDescriptor->szLocalNick.toUtf8().data(),m_pDescriptor->szLocalUser.toUtf8().data(), - m_pDescriptor->szLocalHost.toUtf8().data(),text); - } + if(bUserFeedback) + m_pFrm->firstConsole()->outputPrivmsg(this, KVI_OUT_OWNPRIVMSG, + m_pDescriptor->szLocalNick.toUtf8().data(), m_pDescriptor->szLocalUser.toUtf8().data(), + m_pDescriptor->szLocalHost.toUtf8().data(), text); +} - void DccCanvasWindow::ownAction(const char * text) - { - KviCString buf(KviCString::Format,"%cACTION %s%c\r\n",text); +void DccCanvasWindow::ownAction(const char * text) +{ + KviCString buf(KviCString::Format, "%cACTION %s%c\r\n", text); // m_pSlaveThread->sendRawData(buf.ptr(),buf.len()); - output(KVI_OUT_ACTION,"%Q %s",&(m_pDescriptor->szLocalNick),text); - } + output(KVI_OUT_ACTION, "%Q %s", &(m_pDescriptor->szLocalNick), text); +} - bool DccCanvasWindow::event(QEvent *e) - { +bool DccCanvasWindow::event(QEvent * e) +{ // if(e->type() == KVI_THREAD_EVENT) // { // switch(((KviThreadEvent *)e)->id()) @@ -253,47 +260,47 @@ // break; // } // } - return KviWindow::event(e); - } + return KviWindow::event(e); +} - void DccCanvasWindow::resizeEvent(QResizeEvent *e) - { - int hght = m_pInput->heightHint(); +void DccCanvasWindow::resizeEvent(QResizeEvent * e) +{ + int hght = m_pInput->heightHint(); // int hght2 = m_pTopSplitter->sizeHint().height(); // m_pTopSplitter->setGeometry(0,0,width(),hght2); - m_pSplitter->setGeometry(0,0,width(),height() - hght); - m_pInput->setGeometry(0,height() - hght,width(),hght); - } - - QSize DccCanvasWindow::sizeHint() const - { - QSize ret(m_pIrcView->sizeHint().width(), - m_pIrcView->sizeHint().height() + m_pInput->heightHint()); - return ret; - } - - void DccCanvasWindow::handleMarshalError(int err) + m_pSplitter->setGeometry(0, 0, width(), height() - hght); + m_pInput->setGeometry(0, height() - hght, width(), hght); +} + +QSize DccCanvasWindow::sizeHint() const +{ + QSize ret(m_pIrcView->sizeHint().width(), + m_pIrcView->sizeHint().height() + m_pInput->heightHint()); + return ret; +} + +void DccCanvasWindow::handleMarshalError(int err) +{ + QString sss = KviError::getDescription(err); + output(KVI_OUT_DCCERROR, __tr2qs_ctx("DCC failed: %Q", "dcc"), &sss); +} + +void DccCanvasWindow::connected() +{ + output(KVI_OUT_DCCMSG, __tr2qs_ctx("Connected to %Q:%Q", "dcc"), + &(m_pMarshal->remoteIp()), &(m_pMarshal->remotePort())); + output(KVI_OUT_DCCMSG, __tr2qs_ctx("Local end is %Q:%Q", "dcc"), + &(m_pMarshal->localIp()), &(m_pMarshal->localPort())); + if(!(m_pDescriptor->bActive)) { - QString sss = KviError::getDescription(err); - output(KVI_OUT_DCCERROR,__tr2qs_ctx("DCC failed: %Q","dcc"),&sss); + // PASSIVE CONNECTION...Find out the remote end + m_pDescriptor->szIp = m_pMarshal->remoteIp(); + m_pDescriptor->szPort = m_pMarshal->remotePort(); + m_pDescriptor->szHost = m_pMarshal->remoteIp(); } - - void DccCanvasWindow::connected() - { - output(KVI_OUT_DCCMSG,__tr2qs_ctx("Connected to %Q:%Q","dcc"), - &(m_pMarshal->remoteIp()),&(m_pMarshal->remotePort())); - output(KVI_OUT_DCCMSG,__tr2qs_ctx("Local end is %Q:%Q","dcc"), - &(m_pMarshal->localIp()),&(m_pMarshal->localPort())); - if(!(m_pDescriptor->bActive)) - { - // PASSIVE CONNECTION...Find out the remote end - m_pDescriptor->szIp = m_pMarshal->remoteIp(); - m_pDescriptor->szPort = m_pMarshal->remotePort(); - m_pDescriptor->szHost = m_pMarshal->remoteIp(); - } - updateCaption(); + updateCaption(); // m_pSlaveThread = new KviDccCanvasThread(this,m_pMarshal->releaseSocket()); // m_pSlaveThread->start(); - } +} #endif diff --git a/src/modules/dcc/DccCanvasWindow.h b/src/modules/dcc/DccCanvasWindow.h index f34a5717f..6b89bc735 100644 --- a/src/modules/dcc/DccCanvasWindow.h +++ b/src/modules/dcc/DccCanvasWindow.h @@ -27,43 +27,45 @@ #include "DccBroker.h" #ifdef COMPILE_DCC_CANVAS - #include "DccDescriptor.h" - #include "DccWindow.h" - #include "DccThread.h" +#include "DccDescriptor.h" +#include "DccWindow.h" +#include "DccThread.h" - #include "KviWindow.h" - #include "KviCString.h" - #include "KviPointerList.h" +#include "KviWindow.h" +#include "KviCString.h" +#include "KviPointerList.h" - class DccMarshal; - class DccCanvasWidget; - class QSplitter; +class DccMarshal; +class DccCanvasWidget; +class QSplitter; - class DccCanvasWindow : public DccWindow - { - Q_OBJECT - public: - DccCanvasWindow(DccDescriptor * dcc,const char * name); - ~DccCanvasWindow(); - protected: +class DccCanvasWindow : public DccWindow +{ + Q_OBJECT +public: + DccCanvasWindow(DccDescriptor * dcc, const char * name); + ~DccCanvasWindow(); + +protected: // KviDccCanvasThread * m_pSlaveThread; - DccCanvasWidget * m_pCanvas; + DccCanvasWidget * m_pCanvas; // QSplitter * m_pTopSplitter; - QString m_szTarget; - protected: - virtual const QString &target(); - virtual void fillCaptionBuffers(); - virtual void getBaseLogFileName(KviCString &buffer); - virtual QPixmap * myIconPtr(); - virtual void resizeEvent(QResizeEvent *e); - virtual QSize sizeHint() const; - virtual bool event(QEvent *e); - virtual void ownMessage(const char *text, bool bUserFeedback = true); - virtual void ownAction(const char *text); - protected slots: - void handleMarshalError(int err); - void connected(); - }; + QString m_szTarget; + +protected: + virtual const QString & target(); + virtual void fillCaptionBuffers(); + virtual void getBaseLogFileName(KviCString & buffer); + virtual QPixmap * myIconPtr(); + virtual void resizeEvent(QResizeEvent * e); + virtual QSize sizeHint() const; + virtual bool event(QEvent * e); + virtual void ownMessage(const char * text, bool bUserFeedback = true); + virtual void ownAction(const char * text); +protected slots: + void handleMarshalError(int err); + void connected(); +}; #endif #endif // _CANVAS_H_ diff --git a/src/modules/dcc/DccChatWindow.cpp b/src/modules/dcc/DccChatWindow.cpp index 9a65e9994..4e9a3c50e 100644 --- a/src/modules/dcc/DccChatWindow.cpp +++ b/src/modules/dcc/DccChatWindow.cpp @@ -27,8 +27,8 @@ #include "DccBroker.h" #ifdef COMPILE_ON_WINDOWS - // Ugly Windoze compiler... - #include "DccDialog.h" +// Ugly Windoze compiler... +#include "DccDialog.h" #endif #include "kvi_debug.h" @@ -59,12 +59,12 @@ #include #ifdef COMPILE_CRYPT_SUPPORT - #include "KviCryptEngine.h" - #include "KviCryptController.h" +#include "KviCryptEngine.h" +#include "KviCryptController.h" #endif #ifdef COMPILE_SSL_SUPPORT - #include "KviSSLMaster.h" +#include "KviSSLMaster.h" #endif extern DccBroker * g_pDccBroker; @@ -79,43 +79,44 @@ extern DccBroker * g_pDccBroker; //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -DccChatWindow::DccChatWindow(DccDescriptor * dcc,const char * name) -: DccWindow(KviWindow::DccChat,name,dcc) +DccChatWindow::DccChatWindow(DccDescriptor * dcc, const char * name) + : DccWindow(KviWindow::DccChat, name, dcc) { m_pButtonBox = new KviTalHBox(this); m_pLabel = new KviThemedLabel(m_pButtonBox, this, "dcc_chat_label"); m_pLabel->setText(name); - m_pButtonBox->setStretchFactor(m_pLabel,1); + m_pButtonBox->setStretchFactor(m_pLabel, 1); - m_pButtonContainer= new KviTalHBox(m_pButtonBox); + m_pButtonContainer = new KviTalHBox(m_pButtonBox); createTextEncodingButton(m_pButtonContainer); #ifdef COMPILE_CRYPT_SUPPORT createCryptControllerButton(m_pButtonContainer); #endif - m_pSplitter = new KviTalSplitter(Qt::Horizontal,this); + m_pSplitter = new KviTalSplitter(Qt::Horizontal, this); m_pSplitter->setObjectName("dcc_chat_splitter"); m_pSplitter->setChildrenCollapsible(false); - m_pIrcView = new KviIrcView(m_pSplitter,this); - connect(m_pIrcView,SIGNAL(rightClicked()),this,SLOT(textViewRightClicked())); - m_pInput = new KviInput(this); + m_pIrcView = new KviIrcView(m_pSplitter, this); + connect(m_pIrcView, SIGNAL(rightClicked()), this, SLOT(textViewRightClicked())); + m_pInput = new KviInput(this); //setFocusHandler(m_pInput,this); m_pSlaveThread = 0; - if(KVI_OPTION_BOOL(KviOption_boolAutoLogDccChat))m_pIrcView->startLogging(); + if(KVI_OPTION_BOOL(KviOption_boolAutoLogDccChat)) + m_pIrcView->startLogging(); m_pMarshal = new DccMarshal(this); - connect(m_pMarshal,SIGNAL(error(KviError::Code)),this,SLOT(handleMarshalError(KviError::Code))); - connect(m_pMarshal,SIGNAL(connected()),this,SLOT(connected())); - connect(m_pMarshal,SIGNAL(inProgress()),this,SLOT(connectionInProgress())); + connect(m_pMarshal, SIGNAL(error(KviError::Code)), this, SLOT(handleMarshalError(KviError::Code))); + connect(m_pMarshal, SIGNAL(connected()), this, SLOT(connected())); + connect(m_pMarshal, SIGNAL(inProgress()), this, SLOT(connectionInProgress())); #ifdef COMPILE_SSL_SUPPORT - connect(m_pMarshal,SIGNAL(startingSSLHandshake()),this,SLOT(startingSSLHandshake())); - connect(m_pMarshal,SIGNAL(sslError(const char *)),this,SLOT(sslError(const char *))); + connect(m_pMarshal, SIGNAL(startingSSLHandshake()), this, SLOT(startingSSLHandshake())); + connect(m_pMarshal, SIGNAL(sslError(const char *)), this, SLOT(sslError(const char *))); #endif m_pSlaveThread = 0; @@ -137,17 +138,17 @@ DccChatWindow::~DccChatWindow() void DccChatWindow::textViewRightClicked() { - KVS_TRIGGER_EVENT_1(KviEvent_OnDCCChatPopupRequest,this,m_pDescriptor->idString()); + KVS_TRIGGER_EVENT_1(KviEvent_OnDCCChatPopupRequest, this, m_pDescriptor->idString()); } void DccChatWindow::triggerCreationEvents() { - KVS_TRIGGER_EVENT_1(KviEvent_OnDCCChatWindowCreated,this,m_pDescriptor->idString()); + KVS_TRIGGER_EVENT_1(KviEvent_OnDCCChatWindowCreated, this, m_pDescriptor->idString()); } void DccChatWindow::triggerDestructionEvents() { - KVS_TRIGGER_EVENT_1(KviEvent_OnDCCChatWindowClosing,this,m_pDescriptor->idString()); + KVS_TRIGGER_EVENT_1(KviEvent_OnDCCChatWindowClosing, this, m_pDescriptor->idString()); } void DccChatWindow::startConnection() @@ -155,21 +156,23 @@ void DccChatWindow::startConnection() if(!(m_pDescriptor->bActive)) { // PASSIVE CONNECTION - output(KVI_OUT_DCCMSG,__tr2qs_ctx("Attempting a passive DCC %s connection","dcc"),m_pDescriptor->szType.toUtf8().data()); + output(KVI_OUT_DCCMSG, __tr2qs_ctx("Attempting a passive DCC %s connection", "dcc"), m_pDescriptor->szType.toUtf8().data()); #ifdef COMPILE_SSL_SUPPORT - KviError::Code eError = m_pMarshal->dccListen(m_pDescriptor->szListenIp,m_pDescriptor->szListenPort,m_pDescriptor->bDoTimeout,m_pDescriptor->bIsSSL); + KviError::Code eError = m_pMarshal->dccListen(m_pDescriptor->szListenIp, m_pDescriptor->szListenPort, m_pDescriptor->bDoTimeout, m_pDescriptor->bIsSSL); #else - KviError::Code eError = m_pMarshal->dccListen(m_pDescriptor->szListenIp,m_pDescriptor->szListenPort,m_pDescriptor->bDoTimeout); + KviError::Code eError = m_pMarshal->dccListen(m_pDescriptor->szListenIp, m_pDescriptor->szListenPort, m_pDescriptor->bDoTimeout); #endif if(eError != KviError::Success) handleMarshalError(eError); - } else { + } + else + { // ACTIVE CONNECTION - output(KVI_OUT_DCCMSG,__tr2qs_ctx("Attempting an active DCC %s connection","dcc"),m_pDescriptor->szType.toUtf8().data()); + output(KVI_OUT_DCCMSG, __tr2qs_ctx("Attempting an active DCC %s connection", "dcc"), m_pDescriptor->szType.toUtf8().data()); #ifdef COMPILE_SSL_SUPPORT - KviError::Code eError = m_pMarshal->dccConnect(m_pDescriptor->szIp.toUtf8().data(),m_pDescriptor->szPort.toUtf8().data(),m_pDescriptor->bDoTimeout,m_pDescriptor->bIsSSL); + KviError::Code eError = m_pMarshal->dccConnect(m_pDescriptor->szIp.toUtf8().data(), m_pDescriptor->szPort.toUtf8().data(), m_pDescriptor->bDoTimeout, m_pDescriptor->bIsSSL); #else - KviError::Code eError = m_pMarshal->dccConnect(m_pDescriptor->szIp.toUtf8().data(),m_pDescriptor->szPort.toUtf8().data(),m_pDescriptor->bDoTimeout); + KviError::Code eError = m_pMarshal->dccConnect(m_pDescriptor->szIp.toUtf8().data(), m_pDescriptor->szPort.toUtf8().data(), m_pDescriptor->bDoTimeout); #endif if(eError != KviError::Success) handleMarshalError(eError); @@ -180,9 +183,11 @@ void DccChatWindow::connectionInProgress() { if(m_pDescriptor->bActive) { - output(KVI_OUT_DCCMSG,__tr2qs_ctx("Contacting host %Q on port %Q","dcc"),&(m_pDescriptor->szIp),&(m_pDescriptor->szPort)); - } else { - output(KVI_OUT_DCCMSG,__tr2qs_ctx("Listening on interface %Q port %Q","dcc"),&(m_pMarshal->localIp()),&(m_pMarshal->localPort())); + output(KVI_OUT_DCCMSG, __tr2qs_ctx("Contacting host %Q on port %Q", "dcc"), &(m_pDescriptor->szIp), &(m_pDescriptor->szPort)); + } + else + { + output(KVI_OUT_DCCMSG, __tr2qs_ctx("Listening on interface %Q port %Q", "dcc"), &(m_pMarshal->localIp()), &(m_pMarshal->localPort())); if(m_pDescriptor->bSendRequest) { @@ -190,7 +195,9 @@ void DccChatWindow::connectionInProgress() if(!m_pDescriptor->szFakeIp.isEmpty()) { ip = m_pDescriptor->szFakeIp; - } else { + } + else + { ip = m_pDescriptor->szListenIp; if(KVI_OPTION_BOOL(KviOption_boolDccGuessIpFromServerWhenLocalIsUnroutable)) @@ -204,54 +211,61 @@ void DccChatWindow::connectionInProgress() if(tmp.hasData()) { ip = tmp; - output(KVI_OUT_DCCMSG,__tr2qs_ctx("The local IP address is private, determining from IRC server: %s","dcc"),ip.ptr()); - } else { - output(KVI_OUT_DCCMSG,__tr2qs_ctx("The local IP address is private, but unable to determine it from the IRC server","dcc")); + output(KVI_OUT_DCCMSG, __tr2qs_ctx("The local IP address is private, determining from IRC server: %s", "dcc"), ip.ptr()); + } + else + { + output(KVI_OUT_DCCMSG, __tr2qs_ctx("The local IP address is private, but unable to determine it from the IRC server", "dcc")); } - } else { - output(KVI_OUT_DCCMSG,__tr2qs_ctx("The local IP address is private, but have no IRC server to determine it from","dcc")); + } + else + { + output(KVI_OUT_DCCMSG, __tr2qs_ctx("The local IP address is private, but have no IRC server to determine it from", "dcc")); } } } } - QString port = !m_pDescriptor->szFakePort.isEmpty() ? m_pDescriptor->szFakePort : QString(m_pMarshal->localPort()); + QString port = !m_pDescriptor->szFakePort.isEmpty() ? m_pDescriptor->szFakePort : QString(m_pMarshal->localPort()); //FIXME: #warning "OPTION FOR SENDING 127.0.0.1 and so on (not an unsigned number)" struct in_addr a; - if(KviNetUtils::stringIpToBinaryIp(ip.ptr(),&a))ip.setNum(htonl(a.s_addr)); + if(KviNetUtils::stringIpToBinaryIp(ip.ptr(), &a)) + ip.setNum(htonl(a.s_addr)); QString szReq = QString("PRIVMSG %1 :%2DCC %3 chat %4 %5").arg(m_pDescriptor->szNick, QChar(0x01), m_pDescriptor->szType, ip.ptr(), port); if(m_pDescriptor->isZeroPortRequest()) { szReq.append(" "); - szReq+=m_pDescriptor->zeroPortRequestTag(); + szReq += m_pDescriptor->zeroPortRequestTag(); } szReq.append((char)(0x01)); m_pDescriptor->console()->connection()->sendData(m_pDescriptor->console()->connection()->encodeText(szReq).data()); - output(KVI_OUT_DCCMSG,__tr2qs_ctx("Sent DCC %Q request to %Q, waiting for the remote client to connect...","dcc"), - &(m_pDescriptor->szType),&(m_pDescriptor->szNick)); + output(KVI_OUT_DCCMSG, __tr2qs_ctx("Sent DCC %Q request to %Q, waiting for the remote client to connect...", "dcc"), + &(m_pDescriptor->szType), &(m_pDescriptor->szNick)); //qDebug(m_pDescriptor->szNick); - } else output(KVI_OUT_DCCMSG,__tr2qs_ctx("DCC %Q request not sent, awaiting manual connection","dcc"),&(m_pDescriptor->szType)); + } + else + output(KVI_OUT_DCCMSG, __tr2qs_ctx("DCC %Q request not sent, awaiting manual connection", "dcc"), &(m_pDescriptor->szType)); } - KVS_TRIGGER_EVENT_1(KviEvent_OnDCCChatConnectionInProgress,this,m_pDescriptor->idString()); + KVS_TRIGGER_EVENT_1(KviEvent_OnDCCChatConnectionInProgress, this, m_pDescriptor->idString()); } void DccChatWindow::startingSSLHandshake() { #ifdef COMPILE_SSL_SUPPORT - outputNoFmt(KVI_OUT_SSL,__tr2qs_ctx("Low-level transport connection established","dcc")); - outputNoFmt(KVI_OUT_SSL,__tr2qs_ctx("Starting Secure Socket Layer handshake","dcc")); + outputNoFmt(KVI_OUT_SSL, __tr2qs_ctx("Low-level transport connection established", "dcc")); + outputNoFmt(KVI_OUT_SSL, __tr2qs_ctx("Starting Secure Socket Layer handshake", "dcc")); #endif } void DccChatWindow::sslError(const char * msg) { #ifdef COMPILE_SSL_SUPPORT - if(!KVS_TRIGGER_EVENT_2_HALTED(KviEvent_OnDCCChatError,this,QString(msg),m_pDescriptor->idString())) - output(KVI_OUT_DCCERROR,__tr2qs_ctx("[SSL ERROR]: %s","dcc"),msg); + if(!KVS_TRIGGER_EVENT_2_HALTED(KviEvent_OnDCCChatError, this, QString(msg), m_pDescriptor->idString())) + output(KVI_OUT_DCCERROR, __tr2qs_ctx("[SSL ERROR]: %s", "dcc"), msg); #endif } @@ -270,11 +284,11 @@ void DccChatWindow::fillCaptionBuffers() { QString tmp = QString("DCC %1 %2@%3:%4").arg( #ifdef COMPILE_SSL_SUPPORT - m_pDescriptor->bIsSSL ? "SChat" : "Chat", + m_pDescriptor->bIsSSL ? "SChat" : "Chat", #else - "Chat", + "Chat", #endif - m_pDescriptor->szNick, m_pDescriptor->szIp, m_pDescriptor->szPort); + m_pDescriptor->szNick, m_pDescriptor->szIp, m_pDescriptor->szPort); m_szPlainTextCaption = tmp; } @@ -284,22 +298,23 @@ QPixmap * DccChatWindow::myIconPtr() return g_pIconManager->getSmallIcon(KviIconManager::DccMsg); } -void DccChatWindow::getBaseLogFileName(QString &buffer) +void DccChatWindow::getBaseLogFileName(QString & buffer) { - buffer.sprintf("%s_%s_%s",m_pDescriptor->szNick.toUtf8().data(),m_pDescriptor->szIp.toUtf8().data(),m_pDescriptor->szPort.toUtf8().data()); + buffer.sprintf("%s_%s_%s", m_pDescriptor->szNick.toUtf8().data(), m_pDescriptor->szIp.toUtf8().data(), m_pDescriptor->szPort.toUtf8().data()); } -void DccChatWindow::ownMessage(const QString &text, bool bUserFeedback) +void DccChatWindow::ownMessage(const QString & text, bool bUserFeedback) { if(!m_pSlaveThread) { - output(KVI_OUT_SYSTEMWARNING,__tr2qs_ctx("Can't send data: no active connection","dcc")); + output(KVI_OUT_SYSTEMWARNING, __tr2qs_ctx("Can't send data: no active connection", "dcc")); return; } QByteArray szData = encodeText(text); const char * d = szData.data(); - if(!d)return; + if(!d) + return; #ifdef COMPILE_CRYPT_SUPPORT if(cryptSessionInfo()) @@ -310,28 +325,28 @@ void DccChatWindow::ownMessage(const QString &text, bool bUserFeedback) { KviCString encrypted; cryptSessionInfo()->m_pEngine->setMaxEncryptLen(-1); - switch(cryptSessionInfo()->m_pEngine->encrypt(d,encrypted)) + switch(cryptSessionInfo()->m_pEngine->encrypt(d, encrypted)) { case KviCryptEngine::Encrypted: { - KviCString buf(KviCString::Format,"%s\r\n",encrypted.ptr()); - m_pSlaveThread->sendRawData(buf.ptr(),buf.len()); + KviCString buf(KviCString::Format, "%s\r\n", encrypted.ptr()); + m_pSlaveThread->sendRawData(buf.ptr(), buf.len()); if(bUserFeedback) - g_pMainWindow->firstConsole()->outputPrivmsg(this,KVI_OUT_OWNPRIVMSGCRYPTED, - m_pDescriptor->szLocalNick.toUtf8().data(),m_pDescriptor->szLocalUser.toUtf8().data(), - m_pDescriptor->szLocalHost.toUtf8().data(),text,KviConsoleWindow::NoNotifications); + g_pMainWindow->firstConsole()->outputPrivmsg(this, KVI_OUT_OWNPRIVMSGCRYPTED, + m_pDescriptor->szLocalNick.toUtf8().data(), m_pDescriptor->szLocalUser.toUtf8().data(), + m_pDescriptor->szLocalHost.toUtf8().data(), text, KviConsoleWindow::NoNotifications); } break; case KviCryptEngine::Encoded: { - KviCString buf(KviCString::Format,"%s\r\n",encrypted.ptr()); - m_pSlaveThread->sendRawData(buf.ptr(),buf.len()); + KviCString buf(KviCString::Format, "%s\r\n", encrypted.ptr()); + m_pSlaveThread->sendRawData(buf.ptr(), buf.len()); if(bUserFeedback) { QString encr = decodeText(encrypted.ptr()); - g_pMainWindow->firstConsole()->outputPrivmsg(this,KVI_OUT_OWNPRIVMSG, - m_pDescriptor->szLocalNick.toUtf8().data(),m_pDescriptor->szLocalUser.toUtf8().data(), - m_pDescriptor->szLocalHost.toUtf8().data(),encr,KviConsoleWindow::NoNotifications); + g_pMainWindow->firstConsole()->outputPrivmsg(this, KVI_OUT_OWNPRIVMSG, + m_pDescriptor->szLocalNick.toUtf8().data(), m_pDescriptor->szLocalUser.toUtf8().data(), + m_pDescriptor->szLocalHost.toUtf8().data(), encr, KviConsoleWindow::NoNotifications); } } break; @@ -339,34 +354,36 @@ void DccChatWindow::ownMessage(const QString &text, bool bUserFeedback) { QString szErr = cryptSessionInfo()->m_pEngine->lastError(); output(KVI_OUT_SYSTEMERROR, - __tr2qs_ctx("The encryption engine was not able to encrypt the current message (%Q): %Q, no data was sent to the remote end","dcc"), - &text,&szErr); + __tr2qs_ctx("The encryption engine was not able to encrypt the current message (%Q): %Q, no data was sent to the remote end", "dcc"), + &text, &szErr); } break; } return; - } else { + } + else + { d++; //eat the escape code - KviCString buf(KviCString::Format,"%s\r\n",d); + KviCString buf(KviCString::Format, "%s\r\n", d); QString tmp = text.right(text.length() - 1); - m_pSlaveThread->sendRawData(buf.ptr(),buf.len()); + m_pSlaveThread->sendRawData(buf.ptr(), buf.len()); if(bUserFeedback) - g_pMainWindow->firstConsole()->outputPrivmsg(this,KVI_OUT_OWNPRIVMSG, - m_pDescriptor->szLocalNick.toUtf8().data(),m_pDescriptor->szLocalUser.toUtf8().data(), - m_pDescriptor->szLocalHost.toUtf8().data(),tmp,KviConsoleWindow::NoNotifications); + g_pMainWindow->firstConsole()->outputPrivmsg(this, KVI_OUT_OWNPRIVMSG, + m_pDescriptor->szLocalNick.toUtf8().data(), m_pDescriptor->szLocalUser.toUtf8().data(), + m_pDescriptor->szLocalHost.toUtf8().data(), tmp, KviConsoleWindow::NoNotifications); return; } } } #endif - KviCString buf(KviCString::Format,"%s\r\n",d); - m_pSlaveThread->sendRawData(buf.ptr(),buf.len()); + KviCString buf(KviCString::Format, "%s\r\n", d); + m_pSlaveThread->sendRawData(buf.ptr(), buf.len()); if(bUserFeedback) - g_pMainWindow->firstConsole()->outputPrivmsg(this,KVI_OUT_OWNPRIVMSG, - m_pDescriptor->szLocalNick.toUtf8().data(),m_pDescriptor->szLocalUser.toUtf8().data(), - m_pDescriptor->szLocalHost.toUtf8().data(),text,KviConsoleWindow::NoNotifications); + g_pMainWindow->firstConsole()->outputPrivmsg(this, KVI_OUT_OWNPRIVMSG, + m_pDescriptor->szLocalNick.toUtf8().data(), m_pDescriptor->szLocalUser.toUtf8().data(), + m_pDescriptor->szLocalHost.toUtf8().data(), text, KviConsoleWindow::NoNotifications); } const QString & DccChatWindow::localNick() @@ -376,7 +393,7 @@ const QString & DccChatWindow::localNick() return m_szLocalNick; } -void DccChatWindow::ownAction(const QString &text) +void DccChatWindow::ownAction(const QString & text) { if(m_pSlaveThread) { @@ -385,7 +402,9 @@ void DccChatWindow::ownAction(const QString &text) if(KVI_OPTION_BOOL(KviOption_boolStripMircColorsInUserMessages)) { szTmpBuffer = KviControlCodes::stripControlBytes(text); - } else { + } + else + { szTmpBuffer = text; } @@ -393,15 +412,17 @@ void DccChatWindow::ownAction(const QString &text) const char * d = szData.data(); if(!d) return; - KviCString buf(KviCString::Format,"%cACTION %s%c\r\n",0x01,d,0x01); - m_pSlaveThread->sendRawData(buf.ptr(),buf.len()); - output(KVI_OUT_ACTION,"%Q %Q",&(m_pDescriptor->szLocalNick),&szTmpBuffer); - } else { - output(KVI_OUT_SYSTEMWARNING,__tr2qs_ctx("Can't send data: no active connection","dcc")); + KviCString buf(KviCString::Format, "%cACTION %s%c\r\n", 0x01, d, 0x01); + m_pSlaveThread->sendRawData(buf.ptr(), buf.len()); + output(KVI_OUT_ACTION, "%Q %Q", &(m_pDescriptor->szLocalNick), &szTmpBuffer); + } + else + { + output(KVI_OUT_SYSTEMWARNING, __tr2qs_ctx("Can't send data: no active connection", "dcc")); } } -bool DccChatWindow::event(QEvent *e) +bool DccChatWindow::event(QEvent * e) { if(e->type() == KVI_THREAD_EVENT) { @@ -411,9 +432,9 @@ bool DccChatWindow::event(QEvent *e) { KviError::Code * pError = ((KviThreadDataEvent *)e)->getData(); QString szErr = KviError::getDescription(*pError); - if(!KVS_TRIGGER_EVENT_2_HALTED(KviEvent_OnDCCChatError,this,szErr,m_pDescriptor->idString())) - output(KVI_OUT_DCCERROR,__tr2qs_ctx("ERROR: %Q","dcc"),&szErr); - KVS_TRIGGER_EVENT_1(KviEvent_OnDCCChatDisconnected,this,m_pDescriptor->idString()); + if(!KVS_TRIGGER_EVENT_2_HALTED(KviEvent_OnDCCChatError, this, szErr, m_pDescriptor->idString())) + output(KVI_OUT_DCCERROR, __tr2qs_ctx("ERROR: %Q", "dcc"), &szErr); + KVS_TRIGGER_EVENT_1(KviEvent_OnDCCChatDisconnected, this, m_pDescriptor->idString()); delete pError; return true; } @@ -421,14 +442,16 @@ bool DccChatWindow::event(QEvent *e) case KVI_DCC_THREAD_EVENT_DATA: { KviCString * encoded = ((KviThreadDataEvent *)e)->getData(); - KviCString d=KviCString(decodeText(encoded->ptr())); + KviCString d = KviCString(decodeText(encoded->ptr())); if(d.firstCharIs(0x01)) { d.cutLeft(1); - if(d.lastCharIs(0x01))d.cutRight(1); - if(kvi_strEqualCIN("ACTION",d.ptr(),6))d.cutLeft(6); + if(d.lastCharIs(0x01)) + d.cutRight(1); + if(kvi_strEqualCIN("ACTION", d.ptr(), 6)) + d.cutLeft(6); d.stripLeftWhiteSpace(); - output(KVI_OUT_ACTION,"%Q %s",&(m_pDescriptor->szNick),d.ptr()); + output(KVI_OUT_ACTION, "%Q %s", &(m_pDescriptor->szNick), d.ptr()); if(!hasAttention(KviWindow::MainWindowIsVisible)) { if(KVI_OPTION_BOOL(KviOption_boolFlashDccChatWindowOnNewMessages)) @@ -442,10 +465,12 @@ bool DccChatWindow::event(QEvent *e) szMsg += "
"; szMsg += KviQString::toHtmlEscaped(QString(d.ptr())); //qDebug("KviIrcServerParser_ctcp.cpp:975 debug: %s",szMsg.data()); - g_pApp->notifierMessage(this,KVI_OPTION_MSGTYPE(KVI_OUT_ACTION).pixId(),szMsg,KVI_OPTION_UINT(KviOption_uintNotifierAutoHideTime)); + g_pApp->notifierMessage(this, KVI_OPTION_MSGTYPE(KVI_OUT_ACTION).pixId(), szMsg, KVI_OPTION_UINT(KviOption_uintNotifierAutoHideTime)); } } - } else { + } + else + { #ifdef COMPILE_CRYPT_SUPPORT if(KviCryptSessionInfo * cinf = cryptSessionInfo()) @@ -453,39 +478,41 @@ bool DccChatWindow::event(QEvent *e) if(cinf->m_bDoDecrypt) { KviCString decryptedStuff; - switch(cinf->m_pEngine->decrypt(d.ptr(),decryptedStuff)) + switch(cinf->m_pEngine->decrypt(d.ptr(), decryptedStuff)) { case KviCryptEngine::DecryptOkWasEncrypted: case KviCryptEngine::DecryptOkWasEncoded: case KviCryptEngine::DecryptOkWasPlainText: - if(!KVS_TRIGGER_EVENT_2_HALTED(KviEvent_OnDCCChatMessage,this,QString(decryptedStuff.ptr()),m_pDescriptor->idString())) + if(!KVS_TRIGGER_EVENT_2_HALTED(KviEvent_OnDCCChatMessage, this, QString(decryptedStuff.ptr()), m_pDescriptor->idString())) { - g_pMainWindow->firstConsole()->outputPrivmsg(this,KVI_OUT_DCCCHATMSG, - m_pDescriptor->szNick.toUtf8().data(),m_pDescriptor->szUser.toUtf8().data(), - m_pDescriptor->szHost.toUtf8().data(),decryptedStuff.ptr()); + g_pMainWindow->firstConsole()->outputPrivmsg(this, KVI_OUT_DCCCHATMSG, + m_pDescriptor->szNick.toUtf8().data(), m_pDescriptor->szUser.toUtf8().data(), + m_pDescriptor->szHost.toUtf8().data(), decryptedStuff.ptr()); } delete encoded; return true; - break; + break; default: // also case KviCryptEngine::DecryptError { QString szErr = cinf->m_pEngine->lastError(); output(KVI_OUT_SYSTEMERROR, - __tr2qs_ctx("The following message appears to be encrypted, but the encryption engine failed to decode it: %Q","dcc"), - &szErr); + __tr2qs_ctx("The following message appears to be encrypted, but the encryption engine failed to decode it: %Q", "dcc"), + &szErr); } break; } } - } else { + } + else + { #endif // FIXME! - if(!KVS_TRIGGER_EVENT_2_HALTED(KviEvent_OnDCCChatMessage,this,QString(d.ptr()),m_pDescriptor->idString())) + if(!KVS_TRIGGER_EVENT_2_HALTED(KviEvent_OnDCCChatMessage, this, QString(d.ptr()), m_pDescriptor->idString())) { - g_pMainWindow->firstConsole()->outputPrivmsg(this,KVI_OUT_DCCCHATMSG, - m_pDescriptor->szNick.toUtf8().data(),m_pDescriptor->szUser.toUtf8().data(), - m_pDescriptor->szHost.toUtf8().data(),d.ptr()); + g_pMainWindow->firstConsole()->outputPrivmsg(this, KVI_OUT_DCCCHATMSG, + m_pDescriptor->szNick.toUtf8().data(), m_pDescriptor->szUser.toUtf8().data(), + m_pDescriptor->szHost.toUtf8().data(), d.ptr()); if(!hasAttention(KviWindow::MainWindowIsVisible)) { if(KVI_OPTION_BOOL(KviOption_boolFlashDccChatWindowOnNewMessages)) @@ -495,7 +522,7 @@ bool DccChatWindow::event(QEvent *e) if(KVI_OPTION_BOOL(KviOption_boolPopupNotifierOnNewDccChatMessages)) { QString szMsg = KviQString::toHtmlEscaped(QString(d.ptr())); - g_pApp->notifierMessage(this,KviIconManager::DccChatMsg,szMsg,KVI_OPTION_UINT(KviOption_uintNotifierAutoHideTime)); + g_pApp->notifierMessage(this, KviIconManager::DccChatMsg, szMsg, KVI_OPTION_UINT(KviOption_uintNotifierAutoHideTime)); } } } @@ -516,23 +543,23 @@ void DccChatWindow::resizeEvent(QResizeEvent *) { int hght = m_pInput->heightHint(); int hght2 = m_pButtonBox->sizeHint().height(); - m_pButtonBox->setGeometry(0,0,width(),hght2); - m_pSplitter->setGeometry(0,hght2,width(),height() - (hght + hght2)); - m_pInput->setGeometry(0,height() - hght,width(),hght); + m_pButtonBox->setGeometry(0, 0, width(), hght2); + m_pSplitter->setGeometry(0, hght2, width(), height() - (hght + hght2)); + m_pInput->setGeometry(0, height() - hght, width(), hght); } QSize DccChatWindow::sizeHint() const { QSize ret(m_pIrcView->sizeHint().width(), - m_pIrcView->sizeHint().height() + m_pInput->heightHint()); + m_pIrcView->sizeHint().height() + m_pInput->heightHint()); return ret; } void DccChatWindow::handleMarshalError(KviError::Code eError) { QString szErr = KviError::getDescription(eError); - if(!KVS_TRIGGER_EVENT_2_HALTED(KviEvent_OnDCCChatError,this,szErr,m_pDescriptor->idString())) - output(KVI_OUT_DCCERROR,__tr2qs_ctx("DCC %Q failed: %Q","dcc"),&(m_pDescriptor->szType),&szErr); + if(!KVS_TRIGGER_EVENT_2_HALTED(KviEvent_OnDCCChatError, this, szErr, m_pDescriptor->idString())) + output(KVI_OUT_DCCERROR, __tr2qs_ctx("DCC %Q failed: %Q", "dcc"), &(m_pDescriptor->szType), &szErr); } void DccChatWindow::connected() @@ -540,31 +567,31 @@ void DccChatWindow::connected() if(!(m_pDescriptor->bActive)) { // PASSIVE CONNECTION...Find out the remote end - m_pDescriptor->szIp = m_pMarshal->remoteIp(); + m_pDescriptor->szIp = m_pMarshal->remoteIp(); m_pDescriptor->szPort = m_pMarshal->remotePort(); m_pDescriptor->szHost = m_pMarshal->remoteIp(); } updateCaption(); - m_pSlaveThread = new DccChatThread(this,m_pMarshal->releaseSocket()); + m_pSlaveThread = new DccChatThread(this, m_pMarshal->releaseSocket()); #ifdef COMPILE_SSL_SUPPORT KviSSL * s = m_pMarshal->releaseSSL(); if(s) { - KviSSLMaster::printSSLConnectionInfo(this,s); + KviSSLMaster::printSSLConnectionInfo(this, s); m_pSlaveThread->setSSL(s); } #endif m_pSlaveThread->start(); - if(!KVS_TRIGGER_EVENT_1_HALTED(KviEvent_OnDCCChatConnected,this,m_pDescriptor->idString())) + if(!KVS_TRIGGER_EVENT_1_HALTED(KviEvent_OnDCCChatConnected, this, m_pDescriptor->idString())) { - output(KVI_OUT_DCCMSG,__tr2qs_ctx("Connected to %Q:%Q","dcc"), - &(m_pMarshal->remoteIp()),&(m_pMarshal->remotePort())); - output(KVI_OUT_DCCMSG,__tr2qs_ctx("Local end is %Q:%Q","dcc"), - &(m_pMarshal->localIp()),&(m_pMarshal->localPort())); + output(KVI_OUT_DCCMSG, __tr2qs_ctx("Connected to %Q:%Q", "dcc"), + &(m_pMarshal->remoteIp()), &(m_pMarshal->remotePort())); + output(KVI_OUT_DCCMSG, __tr2qs_ctx("Local end is %Q:%Q", "dcc"), + &(m_pMarshal->localIp()), &(m_pMarshal->localPort())); #ifdef COMPILE_SSL_SUPPORT QString tmp = QString("dcc: %1 %2@%3:%4").arg(m_pDescriptor->bIsSSL ? "SChat" : "Chat", m_pDescriptor->szNick, m_pDescriptor->szIp, m_pDescriptor->szPort); #else @@ -584,9 +611,8 @@ void DccChatWindow::connected() //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -DccChatThread::DccChatThread(KviWindow *wnd,kvi_socket_t fd) -: DccThread(wnd,fd) +DccChatThread::DccChatThread(KviWindow * wnd, kvi_socket_t fd) + : DccThread(wnd, fd) { m_pOutBuffers = new KviPointerList; m_pOutBuffers->setAutoDelete(true); @@ -594,13 +620,14 @@ DccChatThread::DccChatThread(KviWindow *wnd,kvi_socket_t fd) DccChatThread::~DccChatThread() { - if(m_pOutBuffers)delete m_pOutBuffers; + if(m_pOutBuffers) + delete m_pOutBuffers; } void DccChatThread::run() { KviDccThreadIncomingData data; - data.iLen = 0; + data.iLen = 0; data.buffer = 0; for(;;) @@ -612,7 +639,9 @@ void DccChatThread::run() { delete e; goto out_of_the_loop; - } else { + } + else + { // Other events are senseless to us delete e; } @@ -620,32 +649,38 @@ void DccChatThread::run() bool bCanRead; bool bCanWrite; - if(kvi_select(m_fd,&bCanRead,&bCanWrite)) + if(kvi_select(m_fd, &bCanRead, &bCanWrite)) { if(bCanWrite) { - if(!tryFlushOutBuffers())goto out_of_the_loop; + if(!tryFlushOutBuffers()) + goto out_of_the_loop; } if(bCanRead) { - data.buffer = (char *) KviMemory::reallocate(data.buffer,(data.iLen + 512) * sizeof(char)); + data.buffer = (char *)KviMemory::reallocate(data.buffer, (data.iLen + 512) * sizeof(char)); int readLen; #ifdef COMPILE_SSL_SUPPORT if(m_pSSL) { - readLen = m_pSSL->read(data.buffer + data.iLen,512); - } else { + readLen = m_pSSL->read(data.buffer + data.iLen, 512); + } + else + { #endif - readLen = kvi_socket_recv(m_fd,data.buffer + data.iLen,512); + readLen = kvi_socket_recv(m_fd, data.buffer + data.iLen, 512); #ifdef COMPILE_SSL_SUPPORT } #endif if(readLen > 0) { data.iLen += readLen; - data.buffer = (char *)KviMemory::reallocate(data.buffer,data.iLen * sizeof(char)); - if(!handleIncomingData(&data,false))break; // non critical... - } else { + data.buffer = (char *)KviMemory::reallocate(data.buffer, data.iLen * sizeof(char)); + if(!handleIncomingData(&data, false)) + break; // non critical... + } + else + { #ifdef COMPILE_SSL_SUPPORT if(m_pSSL) @@ -655,11 +690,11 @@ void DccChatThread::run() { case KviSSL::ZeroReturn: readLen = 0; - break; + break; case KviSSL::WantRead: case KviSSL::WantWrite: // hmmm... - break; + break; case KviSSL::SyscallError: { int iE = m_pSSL->getLastError(true); @@ -682,21 +717,24 @@ void DccChatThread::run() // Raise unknown SSL ERROR postErrorEvent(KviError::SSLError); goto out_of_the_loop; - break; + break; } } #endif if(data.iLen > 0) { - data.buffer = (char *)KviMemory::reallocate(data.buffer,data.iLen * sizeof(char)); - } else { + data.buffer = (char *)KviMemory::reallocate(data.buffer, data.iLen * sizeof(char)); + } + else + { KviMemory::free(data.buffer); data.buffer = 0; } if(!handleInvalidSocketRead(readLen)) { - if(data.iLen)handleIncomingData(&data,true); // critical + if(data.iLen) + handleIncomingData(&data, true); // critical KVI_ASSERT(!data.iLen); break; // error } @@ -708,8 +746,8 @@ void DccChatThread::run() out_of_the_loop: - - if(data.iLen)KviMemory::free(data.buffer); + if(data.iLen) + KviMemory::free(data.buffer); #ifdef COMPILE_SSL_SUPPORT if(m_pSSL) @@ -719,11 +757,12 @@ out_of_the_loop: } #endif - if(m_fd != KVI_INVALID_SOCKET)::kvi_socket_close(m_fd); + if(m_fd != KVI_INVALID_SOCKET) + ::kvi_socket_close(m_fd); m_fd = KVI_INVALID_SOCKET; } -bool DccChatThread::handleIncomingData(KviDccThreadIncomingData * data,bool bCritical) +bool DccChatThread::handleIncomingData(KviDccThreadIncomingData * data, bool bCritical) { KVI_ASSERT(data->iLen); KVI_ASSERT(data->buffer); @@ -736,34 +775,39 @@ bool DccChatThread::handleIncomingData(KviDccThreadIncomingData * data,bool bCri KviThreadDataEvent * e = new KviThreadDataEvent(KVI_DCC_THREAD_EVENT_DATA); // The left part is len chars long int len = aux - data->buffer; -// qDebug("LEN = %d, iLen = %d",len,data->iLen); -//#warning "DO IT BETTER (the \r cutting)" - KviCString * s = new KviCString(data->buffer,len); - if(s->lastCharIs('\r'))s->cutRight(1); + // qDebug("LEN = %d, iLen = %d",len,data->iLen); + //#warning "DO IT BETTER (the \r cutting)" + KviCString * s = new KviCString(data->buffer, len); + if(s->lastCharIs('\r')) + s->cutRight(1); e->setData(s); // but we cut also \n (or \0) ++aux; // so len += 1; --> new data->iLen -= len; data->iLen -= (len + 1); -// qDebug("iLen now = %d",data->iLen); + // qDebug("iLen now = %d",data->iLen); KVI_ASSERT(data->iLen >= 0); if(data->iLen > 0) { // memmove the remaining part to the beginning // aux points after \n or \0 - KviMemory::move(data->buffer,aux,data->iLen); - data->buffer = (char *)KviMemory::reallocate(data->buffer,data->iLen); + KviMemory::move(data->buffer, aux, data->iLen); + data->buffer = (char *)KviMemory::reallocate(data->buffer, data->iLen); end = data->buffer + data->iLen; aux = data->buffer; - } else { + } + else + { // no more data in the buffer KVI_ASSERT(data->iLen == 0); KviMemory::free(data->buffer); data->buffer = end = aux = 0; } - postEvent(parent(),e); - } else aux++; -// qDebug("PASSING CHAR %c",*aux); + postEvent(parent(), e); + } + else + aux++; + // qDebug("PASSING CHAR %c",*aux); } // now aux == end if(bCritical) @@ -773,22 +817,23 @@ bool DccChatThread::handleIncomingData(KviDccThreadIncomingData * data,bool bCri { // in the last part there are no NULL and \n chars KviThreadDataEvent * e = new KviThreadDataEvent(KVI_DCC_THREAD_EVENT_DATA); - KviCString * s = new KviCString(data->buffer,data->iLen); - if(s->lastCharIs('\r'))s->cutRight(1); + KviCString * s = new KviCString(data->buffer, data->iLen); + if(s->lastCharIs('\r')) + s->cutRight(1); e->setData(s); data->iLen = 0; KviMemory::free(data->buffer); data->buffer = 0; - postEvent(parent(),e); + postEvent(parent(), e); } } return true; } -void DccChatThread::sendRawData(const void * buffer,int len) +void DccChatThread::sendRawData(const void * buffer, int len) { m_pMutex->lock(); - m_pOutBuffers->append(new KviDataBuffer((unsigned int)len,(const unsigned char *)buffer)); + m_pOutBuffers->append(new KviDataBuffer((unsigned int)len, (const unsigned char *)buffer)); m_pMutex->unlock(); } @@ -802,22 +847,28 @@ bool DccChatThread::tryFlushOutBuffers() #ifdef COMPILE_SSL_SUPPORT if(m_pSSL) { - sentLen = m_pSSL->write((const char *)b->data(),b->size()); - } else { + sentLen = m_pSSL->write((const char *)b->data(), b->size()); + } + else + { #endif - sentLen = kvi_socket_send(m_fd,b->data(),b->size()); + sentLen = kvi_socket_send(m_fd, b->data(), b->size()); #ifdef COMPILE_SSL_SUPPORT } #endif if(sentLen > 0) { - if(sentLen == b->size())m_pOutBuffers->removeFirst(); - else { + if(sentLen == b->size()) + m_pOutBuffers->removeFirst(); + else + { // just a part b->remove((unsigned int)sentLen); break; } - } else { + } + else + { #ifdef COMPILE_SSL_SUPPORT if(m_pSSL) { @@ -828,7 +879,7 @@ bool DccChatThread::tryFlushOutBuffers() case KviSSL::WantRead: // Async continue... goto handle_system_error; - break; + break; case KviSSL::SyscallError: if(sentLen == 0) { @@ -836,7 +887,9 @@ bool DccChatThread::tryFlushOutBuffers() postErrorEvent(KviError::RemoteEndClosedConnection); bRet = false; goto out_of_the_loop; - } else { + } + else + { int iSSLErr = m_pSSL->getLastError(true); if(iSSLErr != 0) { @@ -844,33 +897,35 @@ bool DccChatThread::tryFlushOutBuffers() postErrorEvent(KviError::SSLError); bRet = false; goto out_of_the_loop; - } else { + } + else + { goto handle_system_error; } } - break; + break; case KviSSL::SSLError: raiseSSLError(); postErrorEvent(KviError::SSLError); bRet = false; goto out_of_the_loop; - break; + break; default: postErrorEvent(KviError::SSLError); bRet = false; goto out_of_the_loop; - break; + break; } } #endif -handle_system_error: + handle_system_error: if(sentLen < 0) { int err = kvi_socket_error(); #if defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW) if((err != EAGAIN) || (err != EINTR) || (err != WSAEWOULDBLOCK)) #else - if((err != EAGAIN)||(err != EINTR)) + if((err != EAGAIN) || (err != EINTR)) #endif { postErrorEvent(KviError::translateSystemError(err)); diff --git a/src/modules/dcc/DccChatWindow.h b/src/modules/dcc/DccChatWindow.h index bb03c0840..54fb6556a 100644 --- a/src/modules/dcc/DccChatWindow.h +++ b/src/modules/dcc/DccChatWindow.h @@ -36,7 +36,7 @@ #include "KviError.h" #ifdef COMPILE_SSL_SUPPORT - class KviSSL; +class KviSSL; #endif class DccMarshal; @@ -45,10 +45,12 @@ class QSplitter; class DccChatThread : public DccThread { public: - DccChatThread(KviWindow * wnd,kvi_socket_t fd); + DccChatThread(KviWindow * wnd, kvi_socket_t fd); ~DccChatThread(); + protected: - KviPointerList * m_pOutBuffers; + KviPointerList * m_pOutBuffers; + protected: virtual void run(); bool tryFlushOutBuffers(); @@ -59,37 +61,38 @@ protected: // since the thread is going to die // It should return true if the handing was succesfull // or false if the thread should be stopped - virtual bool handleIncomingData(KviDccThreadIncomingData *data,bool bCritical); + virtual bool handleIncomingData(KviDccThreadIncomingData * data, bool bCritical); + public: - virtual void sendRawData(const void * buffer,int len); // mutex (m_pOutBuffers usage) + virtual void sendRawData(const void * buffer, int len); // mutex (m_pOutBuffers usage) }; - class DccChatWindow : public DccWindow { Q_OBJECT public: - DccChatWindow(DccDescriptor * dcc,const char * name); + DccChatWindow(DccDescriptor * dcc, const char * name); ~DccChatWindow(); - QFrame * buttonContainer() { return (QFrame*)m_pButtonContainer; }; + QFrame * buttonContainer() { return (QFrame *)m_pButtonContainer; }; protected: - DccChatThread * m_pSlaveThread; - QString m_szTarget; - QString m_szLocalNick; - KviThemedLabel * m_pLabel; - KviTalHBox * m_pButtonBox; - KviTalHBox * m_pButtonContainer; + DccChatThread * m_pSlaveThread; + QString m_szTarget; + QString m_szLocalNick; + KviThemedLabel * m_pLabel; + KviTalHBox * m_pButtonBox; + KviTalHBox * m_pButtonContainer; + protected: virtual const QString & target(); virtual void fillCaptionBuffers(); - virtual void getBaseLogFileName(QString &buffer); + virtual void getBaseLogFileName(QString & buffer); virtual QPixmap * myIconPtr(); - virtual void resizeEvent(QResizeEvent *e); + virtual void resizeEvent(QResizeEvent * e); virtual QSize sizeHint() const; virtual const QString & localNick(); - virtual bool event(QEvent *e); - virtual void ownMessage(const QString &text, bool bUserFeedback = true); - virtual void ownAction(const QString &text); + virtual bool event(QEvent * e); + virtual void ownMessage(const QString & text, bool bUserFeedback = true); + virtual void ownAction(const QString & text); virtual void triggerCreationEvents(); virtual void triggerDestructionEvents(); void startConnection(); diff --git a/src/modules/dcc/DccDescriptor.cpp b/src/modules/dcc/DccDescriptor.cpp index 036b032e2..a1db30716 100644 --- a/src/modules/dcc/DccDescriptor.cpp +++ b/src/modules/dcc/DccDescriptor.cpp @@ -32,9 +32,9 @@ #include "KviApplication.h" static unsigned int g_uNextDescriptorId = 1; // we use 0 as an invalid descriptor id -static KviPointerHashTable * g_pDescriptorDict = 0; +static KviPointerHashTable * g_pDescriptorDict = 0; -KviPointerHashTable * DccDescriptor::descriptorDict() +KviPointerHashTable * DccDescriptor::descriptorDict() { return g_pDescriptorDict; } @@ -46,7 +46,7 @@ DccDescriptor::DccDescriptor(const DccDescriptor & src) DccDescriptor::DccDescriptor(KviConsoleWindow * pConsole) { - m_pConsole = pConsole; + m_pConsole = pConsole; m_pDccWindow = 0; m_pDccTransfer = 0; @@ -57,38 +57,37 @@ DccDescriptor::DccDescriptor(KviConsoleWindow * pConsole) if(!g_pDescriptorDict) { - g_pDescriptorDict = new KviPointerHashTable; + g_pDescriptorDict = new KviPointerHashTable; g_pDescriptorDict->setAutoDelete(false); } - g_pDescriptorDict->replace((long)m_uId,this); + g_pDescriptorDict->replace((long)m_uId, this); - szNick = __tr_ctx("unknown","dcc"); - szUser = szNick; - szHost = szNick; + szNick = __tr_ctx("unknown", "dcc"); + szUser = szNick; + szHost = szNick; - szLocalNick = szNick; - szLocalUser = szNick; - szLocalHost = szNick; + szLocalNick = szNick; + szLocalUser = szNick; + szLocalHost = szNick; - szIp = szNick; - szPort = szNick; + szIp = szNick; + szPort = szNick; - - bSendRequest = true; - bDoTimeout = true; - bIsTdcc = false; + bSendRequest = true; + bDoTimeout = true; + bIsTdcc = false; bOverrideMinimize = false; - bShowMinimized = false; - bAutoAccept = false; + bShowMinimized = false; + bAutoAccept = false; #ifdef COMPILE_SSL_SUPPORT - bIsSSL = false; + bIsSSL = false; #endif - bRecvFile = false; - bResume = false; - bNoAcks = false; + bRecvFile = false; + bResume = false; + bNoAcks = false; bIsIncomingAvatar = false; - iSampleRate = 0; + iSampleRate = 0; m_bCreationEventTriggered = false; } @@ -103,7 +102,7 @@ DccDescriptor::~DccDescriptor() if(pEventWindow && g_pApp->windowExists(pEventWindow)) { - KVS_TRIGGER_EVENT_1(KviEvent_OnDCCSessionDestroyed,pEventWindow,m_szId); + KVS_TRIGGER_EVENT_1(KviEvent_OnDCCSessionDestroyed, pEventWindow, m_szId); } } @@ -116,7 +115,6 @@ DccDescriptor::~DccDescriptor() g_pDescriptorDict = 0; } } - } void DccDescriptor::triggerCreationEvent() @@ -134,17 +132,18 @@ void DccDescriptor::triggerCreationEvent() if(pEventWindow && g_pApp->windowExists(pEventWindow)) { - KVS_TRIGGER_EVENT_1(KviEvent_OnDCCSessionCreated,pEventWindow,m_szId); + KVS_TRIGGER_EVENT_1(KviEvent_OnDCCSessionCreated, pEventWindow, m_szId); } } DccDescriptor * DccDescriptor::find(unsigned int uId) { - if(!g_pDescriptorDict)return 0; + if(!g_pDescriptorDict) + return 0; return g_pDescriptorDict->find((long)uId); } -void DccDescriptor::copyFrom(const DccDescriptor &src) +void DccDescriptor::copyFrom(const DccDescriptor & src) { m_uId = g_uNextDescriptorId; g_uNextDescriptorId++; @@ -152,77 +151,85 @@ void DccDescriptor::copyFrom(const DccDescriptor &src) if(!g_pDescriptorDict) { - g_pDescriptorDict = new KviPointerHashTable; + g_pDescriptorDict = new KviPointerHashTable; g_pDescriptorDict->setAutoDelete(false); } - g_pDescriptorDict->replace((long)m_uId,this); - m_bCreationEventTriggered=false; - - m_pDccWindow = src.m_pDccWindow; - m_pDccTransfer = src.m_pDccTransfer; - szType = src.szType; - szNick = src.szNick; - szUser = src.szUser; - szHost = src.szHost; - szLocalNick = src.szLocalNick; - szLocalUser = src.szLocalUser; - szLocalHost = src.szLocalHost; - szIp = src.szIp; - szPort = src.szPort; - m_pConsole = src.console(); - m_szZeroPortRequestTag= src.zeroPortRequestTag(); - bActive = src.bActive; - szListenIp = src.szListenIp; - szListenPort = src.szListenPort; - szFakeIp = src.szFakeIp; - szFakePort = src.szFakePort; - bSendRequest = src.bSendRequest; - bDoTimeout = src.bDoTimeout; - szFileName = src.szFileName; - szFileSize = src.szFileSize; - bResume = src.bResume; - bRecvFile = src.bRecvFile; - bNoAcks = src.bNoAcks; - bIsTdcc = src.bIsTdcc; - bOverrideMinimize = src.bOverrideMinimize; - bShowMinimized = src.bShowMinimized; - bAutoAccept = src.bAutoAccept; - bIsIncomingAvatar = src.bIsIncomingAvatar; - szLocalFileName = src.szLocalFileName; - szLocalFileSize = src.szLocalFileSize; + g_pDescriptorDict->replace((long)m_uId, this); + m_bCreationEventTriggered = false; + + m_pDccWindow = src.m_pDccWindow; + m_pDccTransfer = src.m_pDccTransfer; + szType = src.szType; + szNick = src.szNick; + szUser = src.szUser; + szHost = src.szHost; + szLocalNick = src.szLocalNick; + szLocalUser = src.szLocalUser; + szLocalHost = src.szLocalHost; + szIp = src.szIp; + szPort = src.szPort; + m_pConsole = src.console(); + m_szZeroPortRequestTag = src.zeroPortRequestTag(); + bActive = src.bActive; + szListenIp = src.szListenIp; + szListenPort = src.szListenPort; + szFakeIp = src.szFakeIp; + szFakePort = src.szFakePort; + bSendRequest = src.bSendRequest; + bDoTimeout = src.bDoTimeout; + szFileName = src.szFileName; + szFileSize = src.szFileSize; + bResume = src.bResume; + bRecvFile = src.bRecvFile; + bNoAcks = src.bNoAcks; + bIsTdcc = src.bIsTdcc; + bOverrideMinimize = src.bOverrideMinimize; + bShowMinimized = src.bShowMinimized; + bAutoAccept = src.bAutoAccept; + bIsIncomingAvatar = src.bIsIncomingAvatar; + szLocalFileName = src.szLocalFileName; + szLocalFileSize = src.szLocalFileSize; #ifdef COMPILE_SSL_SUPPORT - bIsSSL = src.bIsSSL; + bIsSSL = src.bIsSSL; #endif // dcc voice only - szCodec = src.szCodec; - iSampleRate = src.iSampleRate; + szCodec = src.szCodec; + iSampleRate = src.iSampleRate; } bool DccDescriptor::isFileUpload() { - if(szType.toUpper()=="SEND")return true; - if(szType.toUpper()=="TSEND")return true; + if(szType.toUpper() == "SEND") + return true; + if(szType.toUpper() == "TSEND") + return true; #ifdef COMPILE_SSL_SUPPORT - if(szType.toUpper()=="SSEND")return true; + if(szType.toUpper() == "SSEND") + return true; #endif return false; } bool DccDescriptor::isFileDownload() { - if(szType.toUpper()=="RECV")return true; - if(szType.toUpper()=="TRECV")return true; + if(szType.toUpper() == "RECV") + return true; + if(szType.toUpper() == "TRECV") + return true; #ifdef COMPILE_SSL_SUPPORT - if(szType.toUpper()=="SRECV")return true; + if(szType.toUpper() == "SRECV") + return true; #endif return false; } bool DccDescriptor::isDccChat() { - if(szType.toUpper()=="CHAT")return true; + if(szType.toUpper() == "CHAT") + return true; #ifdef COMPILE_SSL_SUPPORT - if(szType.toUpper()=="SCHAT")return true; + if(szType.toUpper() == "SCHAT") + return true; #endif return false; } diff --git a/src/modules/dcc/DccDescriptor.h b/src/modules/dcc/DccDescriptor.h index 58d9d94e5..67718ccea 100644 --- a/src/modules/dcc/DccDescriptor.h +++ b/src/modules/dcc/DccDescriptor.h @@ -37,98 +37,101 @@ public: DccDescriptor(const DccDescriptor & src); ~DccDescriptor(); + protected: - KviConsoleWindow * m_pConsole; + KviConsoleWindow * m_pConsole; // mIrc zero port reverse send/chat extension - KviCString m_szZeroPortRequestTag; + KviCString m_szZeroPortRequestTag; - unsigned int m_uId; // this dcc session ID - QString m_szId; + unsigned int m_uId; // this dcc session ID + QString m_szId; - DccWindow * m_pDccWindow; // 0 if it has no window + DccWindow * m_pDccWindow; // 0 if it has no window DccFileTransfer * m_pDccTransfer; // 0 if it is not a transfer - bool m_bCreationEventTriggered; + bool m_bCreationEventTriggered; + public: // A console that this DCC is bound to (might be replaced while we wait for user acknowledge in dialogs) KviConsoleWindow * console() const { return m_pConsole; }; - void setConsole(KviConsoleWindow * c){ m_pConsole = c; }; + void setConsole(KviConsoleWindow * c) { m_pConsole = c; }; DccWindow * window() const { return m_pDccWindow; }; - void setWindow(DccWindow * w){ m_pDccWindow = w; }; + void setWindow(DccWindow * w) { m_pDccWindow = w; }; DccFileTransfer * transfer() const { return m_pDccTransfer; }; - void setTransfer(DccFileTransfer * t){ m_pDccTransfer = t; }; + void setTransfer(DccFileTransfer * t) { m_pDccTransfer = t; }; // mIrc zero port reverse send/chat extension bool isZeroPortRequest() const { return m_szZeroPortRequestTag.hasData(); }; const char * zeroPortRequestTag() const { return m_szZeroPortRequestTag.ptr(); }; - void setZeroPortRequestTag(const KviCString &szTag){ m_szZeroPortRequestTag = szTag; }; + void setZeroPortRequestTag(const KviCString & szTag) { m_szZeroPortRequestTag = szTag; }; unsigned int id() const { return m_uId; }; const QString & idString() const { return m_szId; }; static DccDescriptor * find(unsigned int uId); - static KviPointerHashTable * descriptorDict(); + static KviPointerHashTable * descriptorDict(); void triggerCreationEvent(); // this MUST be called by the creator of the descriptor! private: - void copyFrom(const DccDescriptor &src); + void copyFrom(const DccDescriptor & src); + public: // Generic parameters - QString szType; // DCC protocol : CHAT, SCHAT, SEND, TSSEND.... + QString szType; // DCC protocol : CHAT, SCHAT, SEND, TSSEND.... - bool bActive; // active or passive connection ? + bool bActive; // active or passive connection ? - QString szNick; // remote user nickname - QString szUser; // remote user name (unknown for passive dcc) - QString szHost; // remote user host (unknown for passive dcc) + QString szNick; // remote user nickname + QString szUser; // remote user name (unknown for passive dcc) + QString szHost; // remote user host (unknown for passive dcc) - QString szLocalNick; // local user nickname (always from irc) - QString szLocalUser; // local user username (always from irc) - QString szLocalHost; // local user hostname (always from irc) + QString szLocalNick; // local user nickname (always from irc) + QString szLocalUser; // local user username (always from irc) + QString szLocalHost; // local user hostname (always from irc) - QString szIp; // remote user ip (active dcc only) - QString szPort; // remote user port (active dcc only) + QString szIp; // remote user ip (active dcc only) + QString szPort; // remote user port (active dcc only) - QString szListenIp; // passive only : ip to listen on - QString szListenPort; // passive only : port to listen on + QString szListenIp; // passive only : ip to listen on + QString szListenPort; // passive only : port to listen on - bool bSendRequest; // passive only : true if we have to send the CTCP request + bool bSendRequest; // passive only : true if we have to send the CTCP request - QString szFakeIp; // passive only : fake ip to send in the CTCP - QString szFakePort; // passive only : fake port to send in the CTCP + QString szFakeIp; // passive only : fake ip to send in the CTCP + QString szFakePort; // passive only : fake port to send in the CTCP - bool bDoTimeout; // the marshall has to setup a timeout ? + bool bDoTimeout; // the marshall has to setup a timeout ? - bool bIsTdcc; // is this a TDCC ? + bool bIsTdcc; // is this a TDCC ? - bool bOverrideMinimize; // Override the default minimize option ? - bool bShowMinimized; // Show minimized ? (valid if bOverrideMinimize is true) + bool bOverrideMinimize; // Override the default minimize option ? + bool bShowMinimized; // Show minimized ? (valid if bOverrideMinimize is true) - bool bAutoAccept; // Auto accepted dcc send/chat ? + bool bAutoAccept; // Auto accepted dcc send/chat ? #ifdef COMPILE_SSL_SUPPORT - bool bIsSSL; // do we have to use SSL ? + bool bIsSSL; // do we have to use SSL ? #endif // Specific parameters // DCC SEND/RECV - QString szFileName; // RECVFILE: incoming file name, SENDFILE: filename sent to the remote end - QString szFileSize; // RECVFILE: incoming file size, SENDFILE: remote resume size + QString szFileName; // RECVFILE: incoming file name, SENDFILE: filename sent to the remote end + QString szFileSize; // RECVFILE: incoming file size, SENDFILE: remote resume size - QString szLocalFileName; // RECVFILE: save file name selected, SENDFILE: file to send - QString szLocalFileSize; // RECVFILE: local file size (to resume), SENDFILE: file to send size + QString szLocalFileName; // RECVFILE: save file name selected, SENDFILE: file to send + QString szLocalFileSize; // RECVFILE: local file size (to resume), SENDFILE: file to send size - bool bRecvFile; // do we have to RECEIVE the file or SEND it ? - bool bResume; // do we want to resume ? - bool bNoAcks; // blind dcc send ? (do not receive nor send acknowledges) + bool bRecvFile; // do we have to RECEIVE the file or SEND it ? + bool bResume; // do we want to resume ? + bool bNoAcks; // blind dcc send ? (do not receive nor send acknowledges) - bool bIsIncomingAvatar; // It is an Incoming Avatar DCC SEND ? + bool bIsIncomingAvatar; // It is an Incoming Avatar DCC SEND ? // DCC VOICE - KviCString szCodec; // codec name - int iSampleRate; // Sample rate + KviCString szCodec; // codec name + int iSampleRate; // Sample rate public: QString protocol() const { return szType; }; bool isActive() const { return bActive; }; @@ -149,9 +152,12 @@ public: bool isFileUpload(); bool isFileDownload(); bool isDccChat(); - bool isFileTransfer(){ return (isFileUpload() || isFileDownload()); }; + bool isFileTransfer() { return (isFileUpload() || isFileDownload()); }; #ifdef COMPILE_SSL_SUPPORT - bool isSSL() const { return bIsSSL; }; + bool isSSL() const + { + return bIsSSL; + }; #endif }; diff --git a/src/modules/dcc/DccDialog.cpp b/src/modules/dcc/DccDialog.cpp index 01704e529..151422d87 100644 --- a/src/modules/dcc/DccDialog.cpp +++ b/src/modules/dcc/DccDialog.cpp @@ -38,7 +38,7 @@ #include #include -DccDialog::DccDialog(DccBroker * br,DccDescriptor * dcc) +DccDialog::DccDialog(DccBroker * br, DccDescriptor * dcc) { m_pDescriptor = dcc; m_pBroker = br; @@ -46,7 +46,8 @@ DccDialog::DccDialog(DccBroker * br,DccDescriptor * dcc) DccDialog::~DccDialog() { - if(m_pDescriptor)delete m_pDescriptor; + if(m_pDescriptor) + delete m_pDescriptor; m_pDescriptor = 0; m_pBroker->unregisterDccBox(this); } @@ -56,29 +57,29 @@ void DccDialog::forgetDescriptor() m_pDescriptor = 0; } -DccAcceptDialog::DccAcceptDialog(DccBroker * br,DccDescriptor * dcc,const QString &text,const QString &capt) -: QWidget(0), DccDialog(br,dcc) +DccAcceptDialog::DccAcceptDialog(DccBroker * br, DccDescriptor * dcc, const QString & text, const QString & capt) + : QWidget(0), DccDialog(br, dcc) { setObjectName("dcc_accept_box"); //QVBoxLayout * vb = new QVBoxLayout(this,4,4); QVBoxLayout * vb = new QVBoxLayout(this); vb->setMargin(4); vb->setSpacing(4); - QLabel * l = new QLabel(text,this); + QLabel * l = new QLabel(text, this); l->setWordWrap(true); vb->addWidget(l); //QHBoxLayout *hb = new QHBoxLayout(4); - QHBoxLayout *hb = new QHBoxLayout(); + QHBoxLayout * hb = new QHBoxLayout(); hb->setSpacing(4); - vb->addLayout(hb,Qt::AlignCenter); - QPushButton * btn = new QPushButton(__tr2qs_ctx("&Accept","dcc"),this); + vb->addLayout(hb, Qt::AlignCenter); + QPushButton * btn = new QPushButton(__tr2qs_ctx("&Accept", "dcc"), this); btn->setDefault(true); //btn->setFocus(); hb->addWidget(btn); - connect(btn,SIGNAL(clicked()),this,SLOT(acceptClicked())); - btn = new QPushButton(__tr2qs_ctx("&Reject","dcc"),this); - connect(btn,SIGNAL(clicked()),this,SLOT(rejectClicked())); + connect(btn, SIGNAL(clicked()), this, SLOT(acceptClicked())); + btn = new QPushButton(__tr2qs_ctx("&Reject", "dcc"), this); + connect(btn, SIGNAL(clicked()), this, SLOT(rejectClicked())); hb->addWidget(btn); setWindowIcon(QIcon(*(g_pIconManager->getSmallIcon(KviIconManager::DccMsg)))); @@ -95,7 +96,7 @@ DccAcceptDialog::~DccAcceptDialog() void DccAcceptDialog::acceptClicked() { hide(); - emit accepted(this,m_pDescriptor); + emit accepted(this, m_pDescriptor); this->deleteLater(); //g_pApp->collectGarbage(this); } @@ -103,95 +104,95 @@ void DccAcceptDialog::acceptClicked() void DccAcceptDialog::rejectClicked() { hide(); - emit rejected(this,m_pDescriptor); + emit rejected(this, m_pDescriptor); this->deleteLater(); //g_pApp->collectGarbage(this); } -void DccAcceptDialog::closeEvent(QCloseEvent *e) +void DccAcceptDialog::closeEvent(QCloseEvent * e) { hide(); e->ignore(); - emit rejected(this,m_pDescriptor); + emit rejected(this, m_pDescriptor); this->deleteLater(); //g_pApp->collectGarbage(this); } -void DccAcceptDialog::showEvent(QShowEvent *e) +void DccAcceptDialog::showEvent(QShowEvent * e) { QRect rect = g_pApp->desktop()->screenGeometry(g_pApp->desktop()->primaryScreen()); - move((rect.width() - width())/2,(rect.height() - height())/2); + move((rect.width() - width()) / 2, (rect.height() - height()) / 2); QWidget::showEvent(e); } - -DccRenameDialog::DccRenameDialog(DccBroker * br,DccDescriptor * dcc,const QString &text,bool bDisableResume) -: QWidget(0), DccDialog(br,dcc) +DccRenameDialog::DccRenameDialog(DccBroker * br, DccDescriptor * dcc, const QString & text, bool bDisableResume) + : QWidget(0), DccDialog(br, dcc) { setObjectName("dcc_rename_box"); //QVBoxLayout * vb = new QVBoxLayout(this,4,4); QVBoxLayout * vb = new QVBoxLayout(this); vb->setMargin(4); vb->setSpacing(4); - QLabel * l = new QLabel(text,this); + QLabel * l = new QLabel(text, this); l->setWordWrap(true); vb->addWidget(l); //QHBoxLayout *hb = new QHBoxLayout(4); - QHBoxLayout *hb = new QHBoxLayout(); + QHBoxLayout * hb = new QHBoxLayout(); hb->setSpacing(4); - vb->addLayout(hb,Qt::AlignCenter); + vb->addLayout(hb, Qt::AlignCenter); - QPushButton * btn = new QPushButton(__tr2qs_ctx("&Rename","dcc"),this); + QPushButton * btn = new QPushButton(__tr2qs_ctx("&Rename", "dcc"), this); hb->addWidget(btn); - connect(btn,SIGNAL(clicked()),this,SLOT(renameClicked())); + connect(btn, SIGNAL(clicked()), this, SLOT(renameClicked())); - btn = new QPushButton(__tr2qs_ctx("Over&write","dcc"),this); + btn = new QPushButton(__tr2qs_ctx("Over&write", "dcc"), this); hb->addWidget(btn); - connect(btn,SIGNAL(clicked()),this,SLOT(overwriteClicked())); + connect(btn, SIGNAL(clicked()), this, SLOT(overwriteClicked())); - btn = new QPushButton(__tr2qs_ctx("Re&sume","dcc"),this); + btn = new QPushButton(__tr2qs_ctx("Re&sume", "dcc"), this); hb->addWidget(btn); - connect(btn,SIGNAL(clicked()),this,SLOT(resumeClicked())); - if(bDisableResume)btn->setEnabled(false); + connect(btn, SIGNAL(clicked()), this, SLOT(resumeClicked())); + if(bDisableResume) + btn->setEnabled(false); - btn = new QPushButton(__tr2qs_ctx("Cancel","dcc"),this); + btn = new QPushButton(__tr2qs_ctx("Cancel", "dcc"), this); hb->addWidget(btn); - connect(btn,SIGNAL(clicked()),this,SLOT(cancelClicked())); + connect(btn, SIGNAL(clicked()), this, SLOT(cancelClicked())); btn->setDefault(true); //btn->setFocus(); setWindowIcon(QIcon(*(g_pIconManager->getSmallIcon(KviIconManager::DccMsg)))); - setWindowTitle(__tr2qs_ctx("File Already Exists - KVIrc","dcc")); + setWindowTitle(__tr2qs_ctx("File Already Exists - KVIrc", "dcc")); } DccRenameDialog::~DccRenameDialog() { } -void DccRenameDialog::closeEvent(QCloseEvent *e) +void DccRenameDialog::closeEvent(QCloseEvent * e) { hide(); e->ignore(); if(m_pDescriptor) { - emit cancelSelected(this,m_pDescriptor); + emit cancelSelected(this, m_pDescriptor); //g_pApp->collectGarbage(this); this->deleteLater(); } } -void DccRenameDialog::showEvent(QShowEvent *e) +void DccRenameDialog::showEvent(QShowEvent * e) { QRect rect = g_pApp->desktop()->screenGeometry(g_pApp->desktop()->primaryScreen()); - move((rect.width() - width())/2,(rect.height() - height())/2); + move((rect.width() - width()) / 2, (rect.height() - height()) / 2); QWidget::showEvent(e); } void DccRenameDialog::renameClicked() { hide(); - emit renameSelected(this,m_pDescriptor); + emit renameSelected(this, m_pDescriptor); //g_pApp->collectGarbage(this); this->deleteLater(); } @@ -199,7 +200,7 @@ void DccRenameDialog::renameClicked() void DccRenameDialog::overwriteClicked() { hide(); - emit overwriteSelected(this,m_pDescriptor); + emit overwriteSelected(this, m_pDescriptor); //g_pApp->collectGarbage(this); this->deleteLater(); } @@ -208,7 +209,7 @@ void DccRenameDialog::resumeClicked() { hide(); m_pDescriptor->bResume = true; - emit overwriteSelected(this,m_pDescriptor); + emit overwriteSelected(this, m_pDescriptor); this->deleteLater(); //g_pApp->collectGarbage(this); } @@ -216,7 +217,7 @@ void DccRenameDialog::resumeClicked() void DccRenameDialog::cancelClicked() { hide(); - emit cancelSelected(this,m_pDescriptor); + emit cancelSelected(this, m_pDescriptor); this->deleteLater(); //g_pApp->collectGarbage(this); } diff --git a/src/modules/dcc/DccDialog.h b/src/modules/dcc/DccDialog.h index 3c57e2d22..ded6dc942 100644 --- a/src/modules/dcc/DccDialog.h +++ b/src/modules/dcc/DccDialog.h @@ -32,50 +32,53 @@ class DccDialog { protected: DccDescriptor * m_pDescriptor; - DccBroker * m_pBroker; + DccBroker * m_pBroker; + public: - DccDialog(DccBroker * br,DccDescriptor * dcc); + DccDialog(DccBroker * br, DccDescriptor * dcc); virtual ~DccDialog(); + public: virtual void forgetDescriptor(); }; - class DccAcceptDialog : public QWidget, public DccDialog { Q_OBJECT public: - DccAcceptDialog(DccBroker * br,DccDescriptor * dcc,const QString &text,const QString &capt); + DccAcceptDialog(DccBroker * br, DccDescriptor * dcc, const QString & text, const QString & capt); ~DccAcceptDialog(); + protected: - virtual void closeEvent(QCloseEvent *e); - virtual void showEvent(QShowEvent *e); + virtual void closeEvent(QCloseEvent * e); + virtual void showEvent(QShowEvent * e); private slots: void acceptClicked(); void rejectClicked(); signals: - void accepted(DccDialog *,DccDescriptor *); - void rejected(DccDialog *,DccDescriptor *); + void accepted(DccDialog *, DccDescriptor *); + void rejected(DccDialog *, DccDescriptor *); }; class DccRenameDialog : public QWidget, public DccDialog { Q_OBJECT public: - DccRenameDialog(DccBroker * br,DccDescriptor * dcc,const QString &text,bool bDisableResume); + DccRenameDialog(DccBroker * br, DccDescriptor * dcc, const QString & text, bool bDisableResume); ~DccRenameDialog(); + protected: - virtual void closeEvent(QCloseEvent *e); - virtual void showEvent(QShowEvent *e); + virtual void closeEvent(QCloseEvent * e); + virtual void showEvent(QShowEvent * e); private slots: void renameClicked(); void overwriteClicked(); void resumeClicked(); void cancelClicked(); signals: - void overwriteSelected(DccDialog *,DccDescriptor *); - void renameSelected(DccDialog *,DccDescriptor *); - void cancelSelected(DccDialog *,DccDescriptor *); + void overwriteSelected(DccDialog *, DccDescriptor *); + void renameSelected(DccDialog *, DccDescriptor *); + void cancelSelected(DccDialog *, DccDescriptor *); }; #endif diff --git a/src/modules/dcc/DccFileTransfer.cpp b/src/modules/dcc/DccFileTransfer.cpp index d74b1cef0..e1dca6012 100644 --- a/src/modules/dcc/DccFileTransfer.cpp +++ b/src/modules/dcc/DccFileTransfer.cpp @@ -54,8 +54,8 @@ #include "KviKvsScript.h" #ifdef COMPILE_ON_WINDOWS - // Ugly Windoze compiler... - #include "DccDialog.h" +// Ugly Windoze compiler... +#include "DccDialog.h" #endif #include @@ -83,33 +83,34 @@ extern DccBroker * g_pDccBroker; extern KVIRC_API KviMediaManager * g_pMediaManager; // KviApplication.cpp - static KviPointerList * g_pDccFileTransfers = 0; static QPixmap * g_pDccFileTransferIcon = 0; //#warning "The events that have a KviCString data pointer should become real classes, that take care of deleting the data pointer!" //#warning "Otherwise, when left undispatched we will be leaking memory (event class destroyed but not the data ptr)" -DccRecvThread::DccRecvThread(QObject * par,kvi_socket_t fd,KviDccRecvThreadOptions * opt) -: DccThread(par,fd) +DccRecvThread::DccRecvThread(QObject * par, kvi_socket_t fd, KviDccRecvThreadOptions * opt) + : DccThread(par, fd) { - m_pOpt = opt; - m_uAverageSpeed = 0; - m_uInstantSpeed = 0; - m_uFilePosition = 0; + m_pOpt = opt; + m_uAverageSpeed = 0; + m_uInstantSpeed = 0; + m_uFilePosition = 0; - m_uTotalReceivedBytes = 0; + m_uTotalReceivedBytes = 0; m_uInstantReceivedBytes = 0; - m_pFile = 0; - m_pTimeInterval = new KviMSecTimeInterval(); - m_uStartTime = 0; + m_pFile = 0; + m_pTimeInterval = new KviMSecTimeInterval(); + m_uStartTime = 0; m_uInstantSpeedInterval = 0; } DccRecvThread::~DccRecvThread() { - if(m_pOpt)delete m_pOpt; - if(m_pFile)delete m_pFile; + if(m_pOpt) + delete m_pOpt; + if(m_pFile) + delete m_pFile; delete m_pTimeInterval; } @@ -118,22 +119,22 @@ bool DccRecvThread::sendAck(qint64 filePos, bool bUse64BitAck) quint32 ack32 = htonl(filePos & 0xffffffff); quint64 ack64 = qToBigEndian(filePos); - char * ack = (char*) &ack32; + char * ack = (char *)&ack32; int ackSize = 4; if(bUse64BitAck) { ackSize = 8; - ack = (char*) &ack64; + ack = (char *)&ack64; } - int iRet=0; + int iRet = 0; #ifdef COMPILE_SSL_SUPPORT if(m_pSSL) - iRet = m_pSSL->write(ack,ackSize); + iRet = m_pSSL->write(ack, ackSize); else #endif //COMPILE_SSL_SUPPORT - iRet = kvi_socket_send(m_fd,(void *)(ack),ackSize); + iRet = kvi_socket_send(m_fd, (void *)(ack), ackSize); if(iRet == ackSize) return true; // everything sent @@ -155,7 +156,7 @@ bool DccRecvThread::sendAck(qint64 filePos, bool bUse64BitAck) if(iRet < 0) { - // Reported error. If it's EAGAIN or EINTR then no data has been sent. +// Reported error. If it's EAGAIN or EINTR then no data has been sent. #ifdef COMPILE_SSL_SUPPORT if(m_pSSL) { @@ -163,7 +164,7 @@ bool DccRecvThread::sendAck(qint64 filePos, bool bUse64BitAck) switch(m_pSSL->getProtocolError(iRet)) { case KviSSL::ZeroReturn: - //return false; check eagain + //return false; check eagain case KviSSL::Success: case KviSSL::WantRead: case KviSSL::WantWrite: @@ -183,7 +184,7 @@ bool DccRecvThread::sendAck(qint64 filePos, bool bUse64BitAck) int err = kvi_socket_error(); #if defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW) if((err != EAGAIN) && (err != EINTR) && (err != WSAEWOULDBLOCK)) -#else //!(defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW)) +#else //!(defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW)) if((err != EAGAIN) && (err != EINTR)) #endif //!(defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW)) { @@ -205,10 +206,10 @@ bool DccRecvThread::sendAck(qint64 filePos, bool bUse64BitAck) #ifdef COMPILE_SSL_SUPPORT if(m_pSSL) - iRet = m_pSSL->write(ack + iRet,iMissingPart); + iRet = m_pSSL->write(ack + iRet, iMissingPart); else #endif //COMPILE_SSL_SUPPORT - iRet = kvi_socket_send(m_fd,(void *)(ack + iRet),iMissingPart); + iRet = kvi_socket_send(m_fd, (void *)(ack + iRet), iMissingPart); if(iRet != iMissingPart) { @@ -226,7 +227,8 @@ void DccRecvThread::updateStats() m_pMutex->lock(); unsigned long uElapsedTime = uCurTime - m_uStartTime; - if(uElapsedTime < 1)uElapsedTime = 1; + if(uElapsedTime < 1) + uElapsedTime = 1; m_uFilePosition = m_pFile->pos(); m_uAverageSpeed = m_uTotalReceivedBytes / uElapsedTime; @@ -239,7 +241,9 @@ void DccRecvThread::updateStats() m_uInstantSpeed = (m_uInstantReceivedBytes * 1000) / m_uInstantSpeedInterval; m_uInstantReceivedBytes = 0; m_uInstantSpeedInterval = uMSecsOfTheNextInterval; - } else { + } + else + { if(uElapsedTime <= INSTANT_BANDWIDTH_CHECK_INTERVAL_IN_SECS) m_uInstantSpeed = m_uAverageSpeed; } @@ -250,7 +254,7 @@ void DccRecvThread::postMessageEvent(const char * m) { KviThreadDataEvent * e = new KviThreadDataEvent(KVI_DCC_THREAD_EVENT_MESSAGE); e->setData(new KviCString(m)); - postEvent(parent(),e); + postEvent(parent(), e); } // FIXME: This stuff should be somewhat related to the 1448 bytes TCP basic packet size @@ -259,7 +263,6 @@ void DccRecvThread::postMessageEvent(const char * m) #define KVI_DCC_RECV_BLOCK_SIZE 16384 #define KVI_DCC_RECV_75PERCENTOF_BLOCK_SIZE 12280 - void DccRecvThread::run() { // take care of sleeping a bit if we can't read stuff @@ -297,7 +300,9 @@ void DccRecvThread::run() postErrorEvent(KviError::CantOpenFileForAppending); goto exit_dcc; } // else pFile is already at end - } else { + } + else + { if(!m_pFile->open(QIODevice::WriteOnly)) { postErrorEvent(KviError::CantOpenFileForWriting); @@ -307,7 +312,7 @@ void DccRecvThread::run() if(m_pOpt->bSendZeroAck && (!m_pOpt->bNoAcks)) { - if(!sendAck(m_pFile->pos(),bSend64BitAck)) + if(!sendAck(m_pFile->pos(), bSend64BitAck)) goto exit_dcc; } @@ -320,7 +325,9 @@ void DccRecvThread::run() { delete e; goto exit_dcc; - } else { + } + else + { // Other events are senseless to us delete e; } @@ -329,7 +336,7 @@ void DccRecvThread::run() bool bCanRead; bool bDummy; - if(kvi_select(m_fd,&bCanRead,&bDummy,15000)) + if(kvi_select(m_fd, &bCanRead, &bDummy, 15000)) { // reset sleep time @@ -344,7 +351,8 @@ void DccRecvThread::run() unsigned int uMaxPossible = (m_pOpt->uMaxBandwidth < MAX_DCC_BANDWIDTH_LIMIT) ? m_pOpt->uMaxBandwidth * INSTANT_BANDWIDTH_CHECK_INTERVAL_IN_SECS : MAX_DCC_BANDWIDTH_LIMIT * INSTANT_BANDWIDTH_CHECK_INTERVAL_IN_SECS; m_pMutex->unlock(); unsigned int uToRead = uMaxPossible > m_uInstantReceivedBytes ? uMaxPossible - m_uInstantReceivedBytes : 0; - if(uToRead > KVI_DCC_RECV_BLOCK_SIZE)uToRead = KVI_DCC_RECV_BLOCK_SIZE; + if(uToRead > KVI_DCC_RECV_BLOCK_SIZE) + uToRead = KVI_DCC_RECV_BLOCK_SIZE; if(uToRead > 0) { @@ -352,10 +360,12 @@ void DccRecvThread::run() #ifdef COMPILE_SSL_SUPPORT if(m_pSSL) { - readLen = m_pSSL->read(buffer,uToRead); - } else { + readLen = m_pSSL->read(buffer, uToRead); + } + else + { #endif - readLen = kvi_socket_recv(m_fd,buffer,uToRead); + readLen = kvi_socket_recv(m_fd, buffer, uToRead); #ifdef COMPILE_SSL_SUPPORT } #endif @@ -365,19 +375,20 @@ void DccRecvThread::run() // Readed something useful...write back if(((uint)(readLen + m_pFile->pos())) > m_pOpt->uTotalFileSize) { - postMessageEvent(__tr_no_lookup_ctx("WARNING: the peer is sending garbage data past the end of the file","dcc")); - postMessageEvent(__tr_no_lookup_ctx("WARNING: ignoring data past the declared end of file and closing the connection","dcc")); + postMessageEvent(__tr_no_lookup_ctx("WARNING: the peer is sending garbage data past the end of the file", "dcc")); + postMessageEvent(__tr_no_lookup_ctx("WARNING: ignoring data past the declared end of file and closing the connection", "dcc")); readLen = m_pOpt->uTotalFileSize - m_pFile->pos(); if(readLen > 0) { - if(m_pFile->write(buffer,readLen) != readLen) + if(m_pFile->write(buffer, readLen) != readLen) postErrorEvent(KviError::FileIOError); } break; - - } else { - if(m_pFile->write(buffer,readLen) != readLen) + } + else + { + if(m_pFile->write(buffer, readLen) != readLen) { postErrorEvent(KviError::FileIOError); break; @@ -400,14 +411,16 @@ void DccRecvThread::run() { // Received the whole file...die KviThreadEvent * e = new KviThreadEvent(KVI_DCC_THREAD_EVENT_SUCCESS); - postEvent(parent(),e); + postEvent(parent(), e); break; } } - } else { + } + else + { // Must send the ack... the peer must close the connection - if(!sendAck(m_pFile->pos(),bSend64BitAck)) + if(!sendAck(m_pFile->pos(), bSend64BitAck)) break; } @@ -420,15 +433,18 @@ void DccRecvThread::run() if(iShortReadQuantifier > 500) iShortReadQuantifier = 500; msleep(iShortReadQuantifier); - } else { + } + else + { // don't allow it to go too low if(iShortReadQuantifier < -500) iShortReadQuantifier = -500; } - - } else { + } + else + { updateStats(); - // Read problem... +// Read problem... #ifdef COMPILE_SSL_SUPPORT if(m_pSSL) @@ -469,7 +485,7 @@ void DccRecvThread::run() // Raise unknown SSL ERROR postErrorEvent(KviError::SSLError); goto exit_dcc; - break; + break; } } #endif @@ -481,19 +497,21 @@ void DccRecvThread::run() { // success if we got the whole file or if we don't know the file size (we trust the peer) KviThreadEvent * e = new KviThreadEvent(KVI_DCC_THREAD_EVENT_SUCCESS); - postEvent(parent(),e); + postEvent(parent(), e); break; } } #ifdef COMPILE_SSL_SUPPORT - if (!m_pSSL && !handleInvalidSocketRead(readLen)) + if(!m_pSSL && !handleInvalidSocketRead(readLen)) break; #else - if (!handleInvalidSocketRead(readLen)) + if(!handleInvalidSocketRead(readLen)) break; #endif } - } else { + } + else + { updateStats(); // reached the bandwidth limit: slow down a bit @@ -502,12 +520,15 @@ void DccRecvThread::run() else if(m_uInstantSpeedInterval < (INSTANT_BANDWIDTH_CHECK_INTERVAL_IN_MSECS - 20)) msleep(20); } - } else { + } + else + { // Can't read stuff (can just write) updateStats(); // sleep up to 300 msecs (if data arrives...we want low exit latency here) - if(iFailedSelects < 100)iFailedSelects++; + if(iFailedSelects < 100) + iFailedSelects++; updateStats(); if(iFailedSelects > 3) msleep(3 * iFailedSelects); @@ -519,16 +540,18 @@ void DccRecvThread::run() { iProbableTerminationTime = (int)kvi_unixTime(); m_pFile->flush(); - postMessageEvent(__tr_no_lookup_ctx("Data transfer terminated, waiting 30 seconds for the peer to close the connection...","dcc")); + postMessageEvent(__tr_no_lookup_ctx("Data transfer terminated, waiting 30 seconds for the peer to close the connection...", "dcc")); // FIXME: Close the file ? - } else { + } + else + { int iDiff = (((int)kvi_unixTime()) - iProbableTerminationTime); if(iDiff > 30) { // success if we got the whole file or if we don't know the file size (we trust the peer) - postMessageEvent(__tr_no_lookup_ctx("Data transfer was terminated 30 seconds ago, closing the connection","dcc")); + postMessageEvent(__tr_no_lookup_ctx("Data transfer was terminated 30 seconds ago, closing the connection", "dcc")); KviThreadEvent * e = new KviThreadEvent(KVI_DCC_THREAD_EVENT_SUCCESS); - postEvent(parent(),e); + postEvent(parent(), e); break; } } @@ -537,9 +560,12 @@ void DccRecvThread::run() // include the artificial delay if needed if(m_pOpt->iIdleStepLengthInMSec > 0) msleep(m_pOpt->iIdleStepLengthInMSec); - } else { + } + else + { // sleep up to 200 msecs (if data arrives...we want low exit latency here) - if(iFailedSelects < 100)iFailedSelects++; + if(iFailedSelects < 100) + iFailedSelects++; updateStats(); if(iFailedSelects > 3) msleep(2 * iFailedSelects); @@ -576,23 +602,24 @@ void DccRecvThread::doneGetInfo() m_pMutex->unlock(); } -DccSendThread::DccSendThread(QObject * par,kvi_socket_t fd,KviDccSendThreadOptions * opt) -: DccThread(par,fd) +DccSendThread::DccSendThread(QObject * par, kvi_socket_t fd, KviDccSendThreadOptions * opt) + : DccThread(par, fd) { m_pOpt = opt; // stats - m_uAverageSpeed = 0; - m_uInstantSpeed = 0; - m_uFilePosition = 0; + m_uAverageSpeed = 0; + m_uInstantSpeed = 0; + m_uFilePosition = 0; m_uTotalSentBytes = 0; - m_pTimeInterval = new KviMSecTimeInterval(); - m_uStartTime = 0; + m_pTimeInterval = new KviMSecTimeInterval(); + m_uStartTime = 0; m_uInstantSpeedInterval = 0; } DccSendThread::~DccSendThread() { - if(m_pOpt)delete m_pOpt; + if(m_pOpt) + delete m_pOpt; delete m_pTimeInterval; } @@ -602,13 +629,16 @@ void DccSendThread::updateStats() m_pMutex->lock(); unsigned long uElapsedTime = m_pTimeInterval->secondsCounter() - m_uStartTime; - if(uElapsedTime < 1)uElapsedTime = 1; + if(uElapsedTime < 1) + uElapsedTime = 1; if(m_pOpt->bNoAcks) { // There are no acks : the avg bandwidth is based on the sent bytes m_uAverageSpeed = m_uTotalSentBytes / uElapsedTime; - } else { + } + else + { // acknowledges : we compute the avg bandwidth based on the acks we receive m_uAverageSpeed = (m_uAckedBytes - m_pOpt->uStartPosition) / uElapsedTime; } @@ -633,14 +663,17 @@ void DccSendThread::updateStats() m_uInstantSpeed = (m_uInstantSentBytes * 1000) / m_uInstantSpeedInterval; m_uInstantSpeedInterval = uMSecsOfNextPeriodUsed; m_uInstantSentBytes = 0; - } else { + } + else + { if(uElapsedTime <= INSTANT_BANDWIDTH_CHECK_INTERVAL_IN_SECS) m_uInstantSpeed = m_uAverageSpeed; } m_pMutex->unlock(); } -union _ack_buffer { +union _ack_buffer +{ char cAckBuffer[4]; quint32 i32AckBuffer; }; @@ -652,17 +685,18 @@ void DccSendThread::run() m_uStartTime = m_pTimeInterval->secondsCounter(); m_pMutex->unlock(); - m_uTotalSentBytes = 0; - m_uInstantSentBytes = 0; - int iFailedSelects = 0; + m_uTotalSentBytes = 0; + m_uInstantSentBytes = 0; + int iFailedSelects = 0; _ack_buffer ackbuffer; - int iBytesInAckBuffer = 0; - quint32 uLastAck = 0; - quint64 uTotLastAck = 0; - bool bAckHack = false; - quint64 iAckHackRounds = 0; - - if(m_pOpt->iPacketSize < 32)m_pOpt->iPacketSize = 32; + int iBytesInAckBuffer = 0; + quint32 uLastAck = 0; + quint64 uTotLastAck = 0; + bool bAckHack = false; + quint64 iAckHackRounds = 0; + + if(m_pOpt->iPacketSize < 32) + m_pOpt->iPacketSize = 32; char * buffer = (char *)KviMemory::allocate(m_pOpt->iPacketSize * sizeof(char)); QFile * pFile = new QFile(QString::fromUtf8(m_pOpt->szFileName.ptr())); @@ -682,7 +716,7 @@ void DccSendThread::run() if(pFile->size() >= 0xffffffff) { //dcc acks support only files up to 4GiB - bAckHack=true; + bAckHack = true; } if(m_pOpt->uStartPosition > 0) @@ -706,7 +740,9 @@ void DccSendThread::run() { delete e; goto exit_dcc; - } else { + } + else + { // Other events are senseless to us delete e; } @@ -715,7 +751,7 @@ void DccSendThread::run() bool bCanRead; bool bCanWrite; - if(kvi_select(m_fd,&bCanRead,&bCanWrite,15000)) + if(kvi_select(m_fd, &bCanRead, &bCanWrite, 15000)) { // reset the sleep time iFailedSelects = 0; @@ -729,10 +765,12 @@ void DccSendThread::run() #ifdef COMPILE_SSL_SUPPORT if(m_pSSL) { - readLen = m_pSSL->read((ackbuffer.cAckBuffer + iBytesInAckBuffer),iAckBytesToRead); - } else { + readLen = m_pSSL->read((ackbuffer.cAckBuffer + iBytesInAckBuffer), iAckBytesToRead); + } + else + { #endif - readLen = kvi_socket_recv(m_fd,(ackbuffer.cAckBuffer + iBytesInAckBuffer),iAckBytesToRead); + readLen = kvi_socket_recv(m_fd, (ackbuffer.cAckBuffer + iBytesInAckBuffer), iAckBytesToRead); #ifdef COMPILE_SSL_SUPPORT } #endif @@ -755,7 +793,9 @@ void DccSendThread::run() { //we reached the 4gb ack limit iAckHackRounds++; - } else { + } + else + { // the peer is drunk or is trying to fool us postErrorEvent(KviError::AcknowledgeError); break; @@ -765,13 +805,17 @@ void DccSendThread::run() if(bAckHack) { uTotLastAck = (iAckHackRounds << 32) + iNewAck; - } else { + } + else + { uTotLastAck = iNewAck; } iBytesInAckBuffer = 0; } - } else { + } + else + { #ifdef COMPILE_SSL_SUPPORT if(m_pSSL) { @@ -783,12 +827,12 @@ void DccSendThread::run() //if (!handleInvalidSocketRead(readLen) // break; readLen = 0; - break; + break; case KviSSL::Success: case KviSSL::WantRead: case KviSSL::WantWrite: // hmmm... - break; + break; case KviSSL::SyscallError: { int iE = m_pSSL->getLastError(true); @@ -811,18 +855,16 @@ void DccSendThread::run() // Raise unknown SSL ERROR postErrorEvent(KviError::SSLError); goto exit_dcc; - break; + break; } } - if (!m_pSSL && !handleInvalidSocketRead(readLen)) + if(!m_pSSL && !handleInvalidSocketRead(readLen)) break; #else - if (!handleInvalidSocketRead(readLen)) + if(!handleInvalidSocketRead(readLen)) break; #endif - - } // update stats @@ -833,10 +875,12 @@ void DccSendThread::run() if(uLastAck >= (quint64)pFile->size()) { KviThreadEvent * e = new KviThreadEvent(KVI_DCC_THREAD_EVENT_SUCCESS); - postEvent(parent(),e); + postEvent(parent(), e); break; } - } else { + } + else + { // No acknowledges if(m_pOpt->bIsTdcc) { @@ -848,10 +892,12 @@ void DccSendThread::run() #ifdef COMPILE_SSL_SUPPORT if(m_pSSL) { - readLen = m_pSSL->read((char*)&iAck,4); - } else { + readLen = m_pSSL->read((char *)&iAck, 4); + } + else + { #endif - readLen = kvi_socket_recv(m_fd,(char*)&iAck,4); + readLen = kvi_socket_recv(m_fd, (char *)&iAck, 4); #ifdef COMPILE_SSL_SUPPORT } #endif @@ -860,9 +906,11 @@ void DccSendThread::run() // done...success updateStats(); KviThreadEvent * e = new KviThreadEvent(KVI_DCC_THREAD_EVENT_SUCCESS); - postEvent(parent(),e); + postEvent(parent(), e); break; - } else { + } + else + { if(readLen < 0) { #ifdef COMPILE_SSL_SUPPORT @@ -874,12 +922,12 @@ void DccSendThread::run() case KviSSL::ZeroReturn: readLen = 0; - break; + break; case KviSSL::Success: case KviSSL::WantRead: case KviSSL::WantWrite: // hmmm... - break; + break; case KviSSL::SyscallError: { int iE = m_pSSL->getLastError(true); @@ -902,21 +950,22 @@ void DccSendThread::run() // Raise unknown SSL ERROR postErrorEvent(KviError::SSLError); goto exit_dcc; - break; + break; } } - if (!m_pSSL && !handleInvalidSocketRead(readLen)) + if(!m_pSSL && !handleInvalidSocketRead(readLen)) break; #else - if (!handleInvalidSocketRead(readLen)) + if(!handleInvalidSocketRead(readLen)) break; #endif - - } else { + } + else + { KviThreadDataEvent * e = new KviThreadDataEvent(KVI_DCC_THREAD_EVENT_MESSAGE); - e->setData(new KviCString(__tr2qs_ctx("WARNING: received data in a DCC TSEND, there should be no acknowledges","dcc"))); - postEvent(parent(),e); + e->setData(new KviCString(__tr2qs_ctx("WARNING: received data in a DCC TSEND, there should be no acknowledges", "dcc"))); + postEvent(parent(), e); } } } @@ -935,33 +984,39 @@ void DccSendThread::run() m_pMutex->lock(); // FIXME: how to remove this lock ? uint uMaxPossible = m_pOpt->uMaxBandwidth < MAX_DCC_BANDWIDTH_LIMIT ? m_pOpt->uMaxBandwidth * INSTANT_BANDWIDTH_CHECK_INTERVAL_IN_SECS : MAX_DCC_BANDWIDTH_LIMIT * INSTANT_BANDWIDTH_CHECK_INTERVAL_IN_SECS; m_pMutex->unlock(); - if(uMaxPossible < m_uInstantSentBytes)toRead = 0; // already sent too much! - else { + if(uMaxPossible < m_uInstantSentBytes) + toRead = 0; // already sent too much! + else + { uMaxPossible -= m_uInstantSentBytes; - if(toRead > uMaxPossible)toRead = uMaxPossible; + if(toRead > uMaxPossible) + toRead = uMaxPossible; } // limit to packet size - if(toRead > m_pOpt->iPacketSize)toRead = m_pOpt->iPacketSize; + if(toRead > m_pOpt->iPacketSize) + toRead = m_pOpt->iPacketSize; int written = 0; if(toRead > 0) { // read data - int readed = pFile->read(buffer,toRead); + int readed = pFile->read(buffer, toRead); if(readed < toRead) { postErrorEvent(KviError::FileIOError); break; } - // send it out +// send it out #ifdef COMPILE_SSL_SUPPORT if(m_pSSL) { - written = m_pSSL->write(buffer,toRead); - } else { + written = m_pSSL->write(buffer, toRead); + } + else + { #endif - written = kvi_socket_send(m_fd,buffer,toRead); + written = kvi_socket_send(m_fd, buffer, toRead); #ifdef COMPILE_SSL_SUPPORT } #endif @@ -981,47 +1036,50 @@ void DccSendThread::run() case KviSSL::WantRead: // Async continue... goto handle_system_error; - break; + break; case KviSSL::SyscallError: if(written == 0) { raiseSSLError(); postErrorEvent(KviError::RemoteEndClosedConnection); goto exit_dcc; - } else { + } + else + { int iSSLErr = m_pSSL->getLastError(true); if(iSSLErr != 0) { raiseSSLError(); postErrorEvent(KviError::SSLError); goto exit_dcc; - } else { + } + else + { goto handle_system_error; } } - break; + break; case KviSSL::SSLError: raiseSSLError(); postErrorEvent(KviError::SSLError); goto exit_dcc; - break; + break; default: postErrorEvent(KviError::SSLError); goto exit_dcc; - break; + break; } } - if (!m_pSSL && !handleInvalidSocketRead(written)) + if(!m_pSSL && !handleInvalidSocketRead(written)) break; #else - if (!handleInvalidSocketRead(written)) + if(!handleInvalidSocketRead(written)) break; #endif - -handle_system_error: + handle_system_error: int err = kvi_socket_error(); #if defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW) if((err != EAGAIN) && (err != EINTR) && (err != WSAEWOULDBLOCK)) @@ -1032,19 +1090,23 @@ handle_system_error: postErrorEvent(KviError::translateSystemError(err)); goto exit_dcc; } - - } else { + } + else + { // seek back to the right position pFile->seek(pFile->pos() - (toRead - written)); } } - } else { + } + else + { // just nothing to send out in this interval // sleep a while if(m_uInstantSpeedInterval < (INSTANT_BANDWIDTH_CHECK_INTERVAL_IN_MSECS - 100)) { msleep(100); - } else if(m_uInstantSpeedInterval < (INSTANT_BANDWIDTH_CHECK_INTERVAL_IN_MSECS - 20)) + } + else if(m_uInstantSpeedInterval < (INSTANT_BANDWIDTH_CHECK_INTERVAL_IN_MSECS - 20)) { msleep(20); } @@ -1055,30 +1117,39 @@ handle_system_error: m_uFilePosition = pFile->pos(); updateStats(); } - } else { + } + else + { if(m_pOpt->bNoAcks && !m_pOpt->bIsTdcc) { // at end of the file in a blind dcc send... // not in a tdcc: we can close the file... updateStats(); KviThreadEvent * e = new KviThreadEvent(KVI_DCC_THREAD_EVENT_SUCCESS); - postEvent(parent(),e); + postEvent(parent(), e); break; - } else { + } + else + { // upload finished but we're waiting for the last ack // sleep a bit: don't lag the kernie too much while waiting msleep(100); } } } - } else { + } + else + { // after 2 failed selects start to sleep if(iFailedSelects > 3) { // sleep up to 200 msecs - if(iFailedSelects < 100)iFailedSelects++; + if(iFailedSelects < 100) + iFailedSelects++; msleep(3 * iFailedSelects); - } else { + } + else + { iFailedSelects++; } } @@ -1117,9 +1188,8 @@ void DccSendThread::doneGetInfo() m_pMutex->unlock(); } - DccFileTransfer::DccFileTransfer(DccDescriptor * dcc) -: KviFileTransfer() + : KviFileTransfer() { init(); // ensure we're initialized g_pDccFileTransfers->append(this); @@ -1127,25 +1197,27 @@ DccFileTransfer::DccFileTransfer(DccDescriptor * dcc) m_pResumeTimer = 0; m_pBandwidthDialog = 0; - m_szTransferIdString = QString(__tr2qs_ctx("TRANSFER %1","dcc")).arg(id()); + m_szTransferIdString = QString(__tr2qs_ctx("TRANSFER %1", "dcc")).arg(id()); m_pDescriptor = dcc; m_pDescriptor->setTransfer(this); m_pMarshal = new DccMarshal(this); - connect(m_pMarshal,SIGNAL(error(KviError::Code)),this,SLOT(handleMarshalError(KviError::Code))); - connect(m_pMarshal,SIGNAL(connected()),this,SLOT(connected())); - connect(m_pMarshal,SIGNAL(inProgress()),this,SLOT(connectionInProgress())); + connect(m_pMarshal, SIGNAL(error(KviError::Code)), this, SLOT(handleMarshalError(KviError::Code))); + connect(m_pMarshal, SIGNAL(connected()), this, SLOT(connected())); + connect(m_pMarshal, SIGNAL(inProgress()), this, SLOT(connectionInProgress())); #ifdef COMPILE_SSL_SUPPORT - connect(m_pMarshal,SIGNAL(startingSSLHandshake()),this,SLOT(startingSSLHandshake())); - connect(m_pMarshal,SIGNAL(sslError(const char *)),this,SLOT(sslError(const char *))); + connect(m_pMarshal, SIGNAL(startingSSLHandshake()), this, SLOT(startingSSLHandshake())); + connect(m_pMarshal, SIGNAL(sslError(const char *)), this, SLOT(sslError(const char *))); #endif m_szDccType = dcc->bRecvFile ? "RECV" : "SEND"; - if(dcc->bIsTdcc) m_szDccType.prepend("T"); + if(dcc->bIsTdcc) + m_szDccType.prepend("T"); #ifdef COMPILE_SSL_SUPPORT - if(dcc->bIsSSL) m_szDccType.prepend("S"); + if(dcc->bIsSSL) + m_szDccType.prepend("S"); #endif m_pSlaveRecvThread = 0; m_pSlaveSendThread = 0; @@ -1153,17 +1225,18 @@ DccFileTransfer::DccFileTransfer(DccDescriptor * dcc) m_tTransferStartTime = 0; m_tTransferEndTime = 0; - m_szStatusString = __tr2qs_ctx("Setting up the connection","dcc"); + m_szStatusString = __tr2qs_ctx("Setting up the connection", "dcc"); m_eGeneralStatus = Connecting; bool bOk; - m_uTotalFileSize = dcc->bRecvFile ? dcc->szFileSize.toULongLong(&bOk) : dcc->szLocalFileSize.toULongLong(&bOk); - if(!bOk)m_uTotalFileSize = 0; + m_uTotalFileSize = dcc->bRecvFile ? dcc->szFileSize.toULongLong(&bOk) : dcc->szLocalFileSize.toULongLong(&bOk); + if(!bOk) + m_uTotalFileSize = 0; if(m_pDescriptor->bRecvFile) - m_uMaxBandwidth = KVI_OPTION_BOOL(KviOption_boolLimitDccRecvSpeed) ? KVI_OPTION_UINT(KviOption_uintMaxDccRecvSpeed) : MAX_DCC_BANDWIDTH_LIMIT; + m_uMaxBandwidth = KVI_OPTION_BOOL(KviOption_boolLimitDccRecvSpeed) ? KVI_OPTION_UINT(KviOption_uintMaxDccRecvSpeed) : MAX_DCC_BANDWIDTH_LIMIT; else - m_uMaxBandwidth = KVI_OPTION_BOOL(KviOption_boolLimitDccSendSpeed) ? KVI_OPTION_UINT(KviOption_uintMaxDccSendSpeed) : MAX_DCC_BANDWIDTH_LIMIT; + m_uMaxBandwidth = KVI_OPTION_BOOL(KviOption_boolLimitDccSendSpeed) ? KVI_OPTION_UINT(KviOption_uintMaxDccSendSpeed) : MAX_DCC_BANDWIDTH_LIMIT; startConnection(); } @@ -1172,8 +1245,10 @@ DccFileTransfer::~DccFileTransfer() { g_pDccFileTransfers->removeRef(this); - if(m_pResumeTimer)delete m_pResumeTimer; - if(m_pBandwidthDialog)delete m_pBandwidthDialog; + if(m_pResumeTimer) + delete m_pResumeTimer; + if(m_pBandwidthDialog) + delete m_pBandwidthDialog; if(m_pSlaveRecvThread) { @@ -1202,8 +1277,9 @@ void DccFileTransfer::bandwidthDialogDestroyed() KviWindow * DccFileTransfer::eventWindow() { - KviWindow *w = transferWindow(); - if(w)return w; + KviWindow * w = transferWindow(); + if(w) + return w; return m_pDescriptor->console(); } @@ -1212,37 +1288,40 @@ void DccFileTransfer::startConnection() if(!(m_pDescriptor->bActive)) { // PASSIVE CONNECTION - m_szStatusString = __tr2qs_ctx("Attempting a passive DCC %1 connection","dcc").arg(m_szDccType.ptr()); + m_szStatusString = __tr2qs_ctx("Attempting a passive DCC %1 connection", "dcc").arg(m_szDccType.ptr()); outputAndLog(m_szStatusString); - } else { + } + else + { // ACTIVE CONNECTION - m_szStatusString = __tr2qs_ctx("Attempting an active DCC %1 connection","dcc").arg(m_szDccType.ptr()); + m_szStatusString = __tr2qs_ctx("Attempting an active DCC %1 connection", "dcc").arg(m_szDccType.ptr()); outputAndLog(m_szStatusString); } - if(m_pDescriptor->bResume && m_pDescriptor->bRecvFile) { QString fName; - KviIrcServerParser::encodeCtcpParameter(m_pDescriptor->szFileName.toUtf8().data(),fName); + KviIrcServerParser::encodeCtcpParameter(m_pDescriptor->szFileName.toUtf8().data(), fName); if(m_pDescriptor->isZeroPortRequest()) { - m_pDescriptor->console()->connection()->sendFmtData("PRIVMSG %s :%cDCC RESUME %s %s %s %s%c", - m_pDescriptor->console()->connection()->encodeText(m_pDescriptor->szNick).data(), - 0x01, - m_pDescriptor->console()->connection()->encodeText(fName).data(), - m_pDescriptor->szPort.toUtf8().data(), - m_pDescriptor->szLocalFileSize.toUtf8().data(), - m_pDescriptor->zeroPortRequestTag(),0x01); - } else { + m_pDescriptor->console()->connection()->sendFmtData("PRIVMSG %s :%cDCC RESUME %s %s %s %s%c", + m_pDescriptor->console()->connection()->encodeText(m_pDescriptor->szNick).data(), + 0x01, + m_pDescriptor->console()->connection()->encodeText(fName).data(), + m_pDescriptor->szPort.toUtf8().data(), + m_pDescriptor->szLocalFileSize.toUtf8().data(), + m_pDescriptor->zeroPortRequestTag(), 0x01); + } + else + { m_pDescriptor->console()->connection()->sendFmtData("PRIVMSG %s :%cDCC RESUME %s %s %s%c", - m_pDescriptor->console()->connection()->encodeText(m_pDescriptor->szNick).data(), - 0x01, - m_pDescriptor->console()->connection()->encodeText(fName).data(), - m_pDescriptor->szPort.toUtf8().data(), - m_pDescriptor->szLocalFileSize.toUtf8().data(),0x01); + m_pDescriptor->console()->connection()->encodeText(m_pDescriptor->szNick).data(), + 0x01, + m_pDescriptor->console()->connection()->encodeText(fName).data(), + m_pDescriptor->szPort.toUtf8().data(), + m_pDescriptor->szLocalFileSize.toUtf8().data(), 0x01); } - m_szStatusString = __tr2qs_ctx("Sent DCC RESUME request to %1, waiting for ACCEPT","dcc").arg(m_pDescriptor->szNick); + m_szStatusString = __tr2qs_ctx("Sent DCC RESUME request to %1, waiting for ACCEPT", "dcc").arg(m_pDescriptor->szNick); outputAndLog(m_szStatusString); // setup the resume timer: we don't want to wait forever @@ -1250,13 +1329,16 @@ void DccFileTransfer::startConnection() if(KVI_OPTION_UINT(KviOption_uintDccSocketTimeout) < 5) KVI_OPTION_UINT(KviOption_uintDccSocketTimeout) = 5; - if(m_pResumeTimer)delete m_pResumeTimer; + if(m_pResumeTimer) + delete m_pResumeTimer; m_pResumeTimer = new QTimer(this); - connect(m_pResumeTimer,SIGNAL(timeout()),this,SLOT(resumeTimedOut())); + connect(m_pResumeTimer, SIGNAL(timeout()), this, SLOT(resumeTimedOut())); m_pResumeTimer->setInterval(KVI_OPTION_UINT(KviOption_uintDccSocketTimeout) * 1000); m_pResumeTimer->setSingleShot(true); m_pResumeTimer->start(); - } else { + } + else + { listenOrConnect(); } @@ -1268,17 +1350,19 @@ void DccFileTransfer::listenOrConnect() if(!(m_pDescriptor->bActive)) { #ifdef COMPILE_SSL_SUPPORT - KviError::Code eError = m_pMarshal->dccListen(m_pDescriptor->szListenIp,m_pDescriptor->szListenPort,m_pDescriptor->bDoTimeout,m_pDescriptor->bIsSSL); + KviError::Code eError = m_pMarshal->dccListen(m_pDescriptor->szListenIp, m_pDescriptor->szListenPort, m_pDescriptor->bDoTimeout, m_pDescriptor->bIsSSL); #else - KviError::Code eError = m_pMarshal->dccListen(m_pDescriptor->szListenIp,m_pDescriptor->szListenPort,m_pDescriptor->bDoTimeout); + KviError::Code eError = m_pMarshal->dccListen(m_pDescriptor->szListenIp, m_pDescriptor->szListenPort, m_pDescriptor->bDoTimeout); #endif if(eError != KviError::Success) handleMarshalError(eError); - } else { + } + else + { #ifdef COMPILE_SSL_SUPPORT - KviError::Code eError = m_pMarshal->dccConnect(m_pDescriptor->szIp.toUtf8().data(),m_pDescriptor->szPort.toUtf8().data(),m_pDescriptor->bDoTimeout,m_pDescriptor->bIsSSL); + KviError::Code eError = m_pMarshal->dccConnect(m_pDescriptor->szIp.toUtf8().data(), m_pDescriptor->szPort.toUtf8().data(), m_pDescriptor->bDoTimeout, m_pDescriptor->bIsSSL); #else - KviError::Code eError = m_pMarshal->dccConnect(m_pDescriptor->szIp.toUtf8().data(),m_pDescriptor->szPort.toUtf8().data(),m_pDescriptor->bDoTimeout); + KviError::Code eError = m_pMarshal->dccConnect(m_pDescriptor->szIp.toUtf8().data(), m_pDescriptor->szPort.toUtf8().data(), m_pDescriptor->bDoTimeout); #endif if(eError != KviError::Success) handleMarshalError(eError); @@ -1314,47 +1398,54 @@ QString DccFileTransfer::localFileName() void DccFileTransfer::abort() { - if(m_pSlaveRecvThread)m_pSlaveRecvThread->terminate(); - if(m_pSlaveSendThread)m_pSlaveSendThread->terminate(); - if(m_pMarshal)m_pMarshal->abort(); + if(m_pSlaveRecvThread) + m_pSlaveRecvThread->terminate(); + if(m_pSlaveSendThread) + m_pSlaveSendThread->terminate(); + if(m_pMarshal) + m_pMarshal->abort(); if(m_pDescriptor->bRecvFile) - g_pApp->fileDownloadTerminated(false,m_pDescriptor->szFileName.toUtf8().data(),m_pDescriptor->szLocalFileName.toUtf8().data(),m_pDescriptor->szNick.toUtf8().data(),__tr_ctx("Aborted","dcc")); + g_pApp->fileDownloadTerminated(false, m_pDescriptor->szFileName.toUtf8().data(), m_pDescriptor->szLocalFileName.toUtf8().data(), m_pDescriptor->szNick.toUtf8().data(), __tr_ctx("Aborted", "dcc")); QString tmp; - if(m_pSlaveRecvThread)tmp.setNum(m_pSlaveRecvThread->receivedBytes()); - else if(m_pSlaveSendThread)tmp.setNum(m_pSlaveSendThread->sentBytes()); - else tmp = '0'; + if(m_pSlaveRecvThread) + tmp.setNum(m_pSlaveRecvThread->receivedBytes()); + else if(m_pSlaveSendThread) + tmp.setNum(m_pSlaveSendThread->sentBytes()); + else + tmp = '0'; m_eGeneralStatus = Failure; m_tTransferEndTime = kvi_unixTime(); - m_szStatusString = __tr2qs_ctx("Transfer failed: ","dcc"); - m_szStatusString += __tr2qs_ctx("Aborted","dcc"); + m_szStatusString = __tr2qs_ctx("Transfer failed: ", "dcc"); + m_szStatusString += __tr2qs_ctx("Aborted", "dcc"); - KVS_TRIGGER_EVENT_3(KviEvent_OnDCCFileTransferFailed,eventWindow(),QString("Aborted by user"),tmp,m_pDescriptor->idString()); + KVS_TRIGGER_EVENT_3(KviEvent_OnDCCFileTransferFailed, eventWindow(), QString("Aborted by user"), tmp, m_pDescriptor->idString()); - outputAndLog(KVI_OUT_DCCERROR,m_szStatusString); + outputAndLog(KVI_OUT_DCCERROR, m_szStatusString); displayUpdate(); } void DccFileTransfer::fillContextPopup(QMenu * m) { - m->addAction(__tr2qs_ctx("Configure Bandwidth...","dcc"),this,SLOT(configureBandwidth())); - m->addSeparator(); - m->addAction(__tr2qs_ctx("Resend DCC","dcc"),this,SLOT(retryDCC())); - m->addAction(__tr2qs_ctx("Resend TDCC","dcc"),this,SLOT(retryTDCC())); - m->addAction(__tr2qs_ctx("Resend RevDCC","dcc"),this,SLOT(retryRevDCC())); - QAction *pAction = m->addAction(__tr2qs_ctx("Abort","dcc"),this,SLOT(abort())); - if(!active()) - pAction->setEnabled(false); + m->addAction(__tr2qs_ctx("Configure Bandwidth...", "dcc"), this, SLOT(configureBandwidth())); + m->addSeparator(); + m->addAction(__tr2qs_ctx("Resend DCC", "dcc"), this, SLOT(retryDCC())); + m->addAction(__tr2qs_ctx("Resend TDCC", "dcc"), this, SLOT(retryTDCC())); + m->addAction(__tr2qs_ctx("Resend RevDCC", "dcc"), this, SLOT(retryRevDCC())); + QAction * pAction = m->addAction(__tr2qs_ctx("Abort", "dcc"), this, SLOT(abort())); + if(!active()) + pAction->setEnabled(false); } void DccFileTransfer::configureBandwidth() { - if(m_pBandwidthDialog)return; - m_pBandwidthDialog = new DccFileTransferBandwidthDialog(g_pMainWindow,this); - connect(m_pBandwidthDialog,SIGNAL(destroyed()),this,SLOT(bandwidthDialogDestroyed())); + if(m_pBandwidthDialog) + return; + m_pBandwidthDialog = new DccFileTransferBandwidthDialog(g_pMainWindow, this); + connect(m_pBandwidthDialog, SIGNAL(destroyed()), this, SLOT(bandwidthDialogDestroyed())); m_pBandwidthDialog->setModal(true); m_pBandwidthDialog->show(); } @@ -1369,7 +1460,7 @@ void DccFileTransfer::retryDCC() KviQString::escapeKvs(&szFileName, KviQString::EscapeSpace); QString szCommand = "dcc.send -r=$console($dcc.irccontext(" + szId + ")) " + szRemoteNick + " " + szFileName; - KviKvsScript::run(szCommand,g_pActiveWindow); + KviKvsScript::run(szCommand, g_pActiveWindow); } void DccFileTransfer::retryTDCC() @@ -1382,7 +1473,7 @@ void DccFileTransfer::retryTDCC() KviQString::escapeKvs(&szFileName, KviQString::EscapeSpace); QString szCommand = "dcc.send -r=$console($dcc.irccontext(" + szId + ")) -t " + szRemoteNick + " " + szFileName; - KviKvsScript::run(szCommand,g_pActiveWindow); + KviKvsScript::run(szCommand, g_pActiveWindow); } void DccFileTransfer::retryRevDCC() @@ -1395,10 +1486,10 @@ void DccFileTransfer::retryRevDCC() KviQString::escapeKvs(&szFileName, KviQString::EscapeSpace); QString szCommand = "dcc.rsend -z -r=$console($dcc.irccontext(" + szId + ")) " + szRemoteNick + " " + szFileName; - KviKvsScript::run(szCommand,g_pActiveWindow); + KviKvsScript::run(szCommand, g_pActiveWindow); } -void DccFileTransfer::fillStatusString(QString &szBuffer) +void DccFileTransfer::fillStatusString(QString & szBuffer) { switch(m_eGeneralStatus) { @@ -1435,15 +1526,19 @@ int DccFileTransfer::bandwidthLimit() m_pSlaveRecvThread->initGetInfo(); iLimit = (int)m_pSlaveRecvThread->bandwidthLimit(); m_pSlaveRecvThread->doneGetInfo(); - if(iLimit < 0)iLimit = MAX_DCC_BANDWIDTH_LIMIT; + if(iLimit < 0) + iLimit = MAX_DCC_BANDWIDTH_LIMIT; } - } else { + } + else + { if(m_pSlaveSendThread) { m_pSlaveSendThread->initGetInfo(); iLimit = (int)m_pSlaveSendThread->bandwidthLimit(); m_pSlaveSendThread->doneGetInfo(); - if(iLimit < 0)iLimit = MAX_DCC_BANDWIDTH_LIMIT; + if(iLimit < 0) + iLimit = MAX_DCC_BANDWIDTH_LIMIT; } } return iLimit; @@ -1451,8 +1546,10 @@ int DccFileTransfer::bandwidthLimit() void DccFileTransfer::setBandwidthLimit(int iVal) { - if(iVal < 0)iVal = MAX_DCC_BANDWIDTH_LIMIT; - if(iVal > MAX_DCC_BANDWIDTH_LIMIT)iVal = MAX_DCC_BANDWIDTH_LIMIT; + if(iVal < 0) + iVal = MAX_DCC_BANDWIDTH_LIMIT; + if(iVal > MAX_DCC_BANDWIDTH_LIMIT) + iVal = MAX_DCC_BANDWIDTH_LIMIT; m_uMaxBandwidth = iVal; if(m_pDescriptor->bRecvFile) { @@ -1462,7 +1559,9 @@ void DccFileTransfer::setBandwidthLimit(int iVal) m_pSlaveRecvThread->setBandwidthLimit(iVal); m_pSlaveRecvThread->doneGetInfo(); } - } else { + } + else + { if(m_pSlaveSendThread) { m_pSlaveSendThread->initGetInfo(); @@ -1483,7 +1582,9 @@ unsigned int DccFileTransfer::averageSpeed() uAvgBandwidth = m_pSlaveRecvThread->averageSpeed(); m_pSlaveRecvThread->doneGetInfo(); } - } else { + } + else + { if(m_pSlaveSendThread) { m_pSlaveSendThread->initGetInfo(); @@ -1505,7 +1606,9 @@ unsigned int DccFileTransfer::instantSpeed() uInstBandwidth = m_pSlaveRecvThread->instantSpeed(); m_pSlaveRecvThread->doneGetInfo(); } - } else { + } + else + { if(m_pSlaveSendThread) { m_pSlaveSendThread->initGetInfo(); @@ -1527,7 +1630,9 @@ unsigned int DccFileTransfer::transferredBytes() uTransferred = m_pSlaveRecvThread->filePosition(); m_pSlaveRecvThread->doneGetInfo(); } - } else { + } + else + { if(m_pSlaveSendThread) { m_pSlaveSendThread->initGetInfo(); @@ -1538,7 +1643,7 @@ unsigned int DccFileTransfer::transferredBytes() return uTransferred; } -void DccFileTransfer::displayPaint(QPainter * p,int column, QRect rect) +void DccFileTransfer::displayPaint(QPainter * p, int column, QRect rect) { int width = rect.width(), height = rect.height(); QString txt; @@ -1548,19 +1653,29 @@ void DccFileTransfer::displayPaint(QPainter * p,int column, QRect rect) { case COLUMN_TRANSFERTYPE: { - if(!g_pDccFileTransferIcon)break; + if(!g_pDccFileTransferIcon) + break; int xoffset = 0; int yoffset = 0; - if(m_pDescriptor->bRecvFile)yoffset = 64; + if(m_pDescriptor->bRecvFile) + yoffset = 64; switch(m_eGeneralStatus) { - case Connecting: xoffset = 0; break; - case Transferring: xoffset = 48; break; - case Success: xoffset = 96; break; - case Failure: xoffset = 144; break; + case Connecting: + xoffset = 0; + break; + case Transferring: + xoffset = 48; + break; + case Success: + xoffset = 96; + break; + case Failure: + xoffset = 144; + break; } // 48 is width, 64 is height - p->drawPixmap(width / 2 - 48 / 2,rect.top() + height / 2 - 64 / 2,*g_pDccFileTransferIcon,xoffset,yoffset,48,64); + p->drawPixmap(width / 2 - 48 / 2, rect.top() + height / 2 - 64 / 2, *g_pDccFileTransferIcon, xoffset, yoffset, 48, 64); } break; case COLUMN_FILEINFO: @@ -1568,47 +1683,45 @@ void DccFileTransfer::displayPaint(QPainter * p,int column, QRect rect) QFontMetrics fm(p->font()); - QString szFrom = __tr2qs_ctx("From: ","dcc"); - QString szTo = __tr2qs_ctx("To: ","dcc"); + QString szFrom = __tr2qs_ctx("From: ", "dcc"); + QString szTo = __tr2qs_ctx("To: ", "dcc"); int daW1 = fm.width(szFrom); int daW2 = fm.width(szTo); - if(daW1 < daW2)daW1 = daW2; + if(daW1 < daW2) + daW1 = daW2; int iLineSpacing = fm.lineSpacing(); int iY = rect.top() + 4; p->setPen(Qt::black); - KviCString szRemote(KviCString::Format,"dcc://%s@%s:%s/%s",m_pDescriptor->szNick.toUtf8().data(),m_pDescriptor->szIp.toUtf8().data(),m_pDescriptor->szPort.toUtf8().data(), - m_pDescriptor->szFileName.toUtf8().data()); + KviCString szRemote(KviCString::Format, "dcc://%s@%s:%s/%s", m_pDescriptor->szNick.toUtf8().data(), m_pDescriptor->szIp.toUtf8().data(), m_pDescriptor->szPort.toUtf8().data(), + m_pDescriptor->szFileName.toUtf8().data()); - p->drawText(rect.left() + 4 + daW1,iY,width - (8 + daW1),height - 8,Qt::AlignTop | Qt::AlignLeft, - m_pDescriptor->bRecvFile ? szRemote.ptr() : m_pDescriptor->szLocalFileName.toUtf8().data()); + p->drawText(rect.left() + 4 + daW1, iY, width - (8 + daW1), height - 8, Qt::AlignTop | Qt::AlignLeft, + m_pDescriptor->bRecvFile ? szRemote.ptr() : m_pDescriptor->szLocalFileName.toUtf8().data()); iY += iLineSpacing; - p->drawText(rect.left() + 4 + daW1,iY,width - (8 + daW1),height - 8,Qt::AlignTop | Qt::AlignLeft, - m_pDescriptor->bRecvFile ? m_pDescriptor->szLocalFileName.toUtf8().data() : szRemote.ptr()); + p->drawText(rect.left() + 4 + daW1, iY, width - (8 + daW1), height - 8, Qt::AlignTop | Qt::AlignLeft, + m_pDescriptor->bRecvFile ? m_pDescriptor->szLocalFileName.toUtf8().data() : szRemote.ptr()); iY += iLineSpacing; - p->setPen(Qt::darkGray); - p->drawText(rect.left() + 4, rect.top() + 4,width - 8,height - 8,Qt::AlignTop | Qt::AlignLeft,szFrom); - p->drawText(rect.left() + 4, rect.top() + 4 + iLineSpacing,width - 8,height - 8,Qt::AlignTop | Qt::AlignLeft,szTo); + p->drawText(rect.left() + 4, rect.top() + 4, width - 8, height - 8, Qt::AlignTop | Qt::AlignLeft, szFrom); + p->drawText(rect.left() + 4, rect.top() + 4 + iLineSpacing, width - 8, height - 8, Qt::AlignTop | Qt::AlignLeft, szTo); - - p->setPen(QColor(180,180,200)); + p->setPen(QColor(180, 180, 200)); iLineSpacing += 2; - p->drawRect(rect.left() + 4, rect.top() + height - (iLineSpacing + 4),width - 8,iLineSpacing); - p->fillRect(rect.left() + 5, rect.top() + height - (iLineSpacing + 3),width - 10,iLineSpacing - 2,bIsTerminated ? QColor(210,210,210) : QColor(190,190,240)); + p->drawRect(rect.left() + 4, rect.top() + height - (iLineSpacing + 4), width - 8, iLineSpacing); + p->fillRect(rect.left() + 5, rect.top() + height - (iLineSpacing + 3), width - 10, iLineSpacing - 2, bIsTerminated ? QColor(210, 210, 210) : QColor(190, 190, 240)); p->setPen(Qt::black); - p->drawText(rect.left() + 7, rect.top() + height - (iLineSpacing + 4),width - 14,iLineSpacing,Qt::AlignVCenter | Qt::AlignLeft,m_szStatusString); - + p->drawText(rect.left() + 7, rect.top() + height - (iLineSpacing + 4), width - 14, iLineSpacing, Qt::AlignVCenter | Qt::AlignLeft, m_szStatusString); } break; case COLUMN_PROGRESS: @@ -1633,7 +1746,9 @@ void DccFileTransfer::displayPaint(QPainter * p,int column, QRect rect) uTransferred = m_pSlaveRecvThread->filePosition(); m_pSlaveRecvThread->doneGetInfo(); } - } else { + } + else + { if(m_pSlaveSendThread) { m_pSlaveSendThread->initGetInfo(); @@ -1645,8 +1760,8 @@ void DccFileTransfer::displayPaint(QPainter * p,int column, QRect rect) } } - p->setPen(bIsTerminated ? Qt::lightGray : QColor(210,210,240)); - p->drawRect(rect.left() + 4, rect.top() + 4,iW,12); + p->setPen(bIsTerminated ? Qt::lightGray : QColor(210, 210, 240)); + p->drawRect(rect.left() + 4, rect.top() + 4, iW, 12); iW -= 2; @@ -1663,30 +1778,34 @@ void DccFileTransfer::displayPaint(QPainter * p,int column, QRect rect) // we are sending a file and are getting acks double dPerc1 = (double)(((double)uTransferred) * 100.0) / (double)m_uTotalFileSize; - int iL1 = (int) ((((double)iW) * dPerc1) / 100.0); + int iL1 = (int)((((double)iW) * dPerc1) / 100.0); double dPerc2 = (double)(((double)uAckedBytes) * 100.0) / (double)m_uTotalFileSize; - int iL2 = (int) ((((double)iW) * dPerc2) / 100.0); + int iL2 = (int)((((double)iW) * dPerc2) / 100.0); int iW2 = iL1 - iL2; - if(iW2 > 0)p->fillRect(rect.left() + 5 + iL2,rect.top() + 5,iW2,10,bIsTerminated ? QColor(150,130,110) : QColor(220,170,100)); - p->fillRect(rect.left() + 5,rect.top() + 5,iL2,10,bIsTerminated ? QColor(140,110,110) : QColor(200,100,100)); + if(iW2 > 0) + p->fillRect(rect.left() + 5 + iL2, rect.top() + 5, iW2, 10, bIsTerminated ? QColor(150, 130, 110) : QColor(220, 170, 100)); + p->fillRect(rect.left() + 5, rect.top() + 5, iL2, 10, bIsTerminated ? QColor(140, 110, 110) : QColor(200, 100, 100)); - txt = QString(__tr2qs_ctx("%1 of %2 (%3%)","dcc")).arg(KviQString::makeSizeReadable(uAckedBytes)).arg(KviQString::makeSizeReadable(m_uTotalFileSize)).arg(dPerc2,0,'f',2); - } else { + txt = QString(__tr2qs_ctx("%1 of %2 (%3%)", "dcc")).arg(KviQString::makeSizeReadable(uAckedBytes)).arg(KviQString::makeSizeReadable(m_uTotalFileSize)).arg(dPerc2, 0, 'f', 2); + } + else + { // we are receiving a file or not sending acks double dPerc = (double)(((double)uTransferred) * 100.0) / (double)m_uTotalFileSize; - int iL = (int) ((((double)iW) * dPerc) / 100.0); - p->fillRect(rect.left() + 5,rect.top() + 5,iL,10,bIsTerminated ? QColor(140,110,110) : QColor(200,100,100)); + int iL = (int)((((double)iW) * dPerc) / 100.0); + p->fillRect(rect.left() + 5, rect.top() + 5, iL, 10, bIsTerminated ? QColor(140, 110, 110) : QColor(200, 100, 100)); - txt = QString(__tr2qs_ctx("%1 of %2 (%3%)","dcc")).arg(KviQString::makeSizeReadable(uTransferred)).arg(KviQString::makeSizeReadable(m_uTotalFileSize)).arg(dPerc,0,'f',2); + txt = QString(__tr2qs_ctx("%1 of %2 (%3%)", "dcc")).arg(KviQString::makeSizeReadable(uTransferred)).arg(KviQString::makeSizeReadable(m_uTotalFileSize)).arg(dPerc, 0, 'f', 2); } - - } else { - txt = QString(__tr2qs_ctx("%1","dcc")).arg(KviQString::makeSizeReadable(uTransferred)); + } + else + { + txt = QString(__tr2qs_ctx("%1", "dcc")).arg(KviQString::makeSizeReadable(uTransferred)); } p->setPen(Qt::black); - p->drawText(rect.left() + 4,rect.top() + 19,width - 8,height - 8,Qt::AlignTop | Qt::AlignLeft,txt); + p->drawText(rect.left() + 4, rect.top() + 19, width - 8, height - 8, Qt::AlignTop | Qt::AlignLeft, txt); int iLeftHalf = (iW - 2) / 2; int iRightHalf = iW - (iLeftHalf + 1); @@ -1694,21 +1813,23 @@ void DccFileTransfer::displayPaint(QPainter * p,int column, QRect rect) if(!bIsTerminated) { - txt = __tr2qs_ctx("Spd:","dcc"); + txt = __tr2qs_ctx("Spd:", "dcc"); txt += " "; QString tmpisp; - KviNetUtils::formatNetworkBandwidthString(tmpisp,uInstantSpeed); + KviNetUtils::formatNetworkBandwidthString(tmpisp, uInstantSpeed); txt += tmpisp; txt += " ["; - } else { + } + else + { txt = ""; } - txt += __tr2qs_ctx("Avg:","dcc"); + txt += __tr2qs_ctx("Avg:", "dcc"); txt += " "; QString tmpspd; - KviNetUtils::formatNetworkBandwidthString(tmpspd,uAvgBandwidth); + KviNetUtils::formatNetworkBandwidthString(tmpspd, uAvgBandwidth); txt += tmpspd; if(!bIsTerminated) @@ -1718,43 +1839,47 @@ void DccFileTransfer::displayPaint(QPainter * p,int column, QRect rect) int iDaH = height - (iLineSpacing + 4); - p->setPen(QColor(180,180,200)); - p->drawRect(rect.left() + 4,rect.top() + iDaH,iLeftHalf,iLineSpacing); - p->fillRect(rect.left() + 5,rect.top() + iDaH + 1,iLeftHalf - 2,iLineSpacing - 2,bIsTerminated ? QColor(210,210,210) : QColor(190,190,240)); + p->setPen(QColor(180, 180, 200)); + p->drawRect(rect.left() + 4, rect.top() + iDaH, iLeftHalf, iLineSpacing); + p->fillRect(rect.left() + 5, rect.top() + iDaH + 1, iLeftHalf - 2, iLineSpacing - 2, bIsTerminated ? QColor(210, 210, 210) : QColor(190, 190, 240)); p->setPen(bIsTerminated ? Qt::darkGray : Qt::black); - p->drawText(rect.left() + 6,rect.top() + iDaH,iLeftHalf - 4,iLineSpacing,Qt::AlignLeft | Qt::AlignVCenter,txt); + p->drawText(rect.left() + 6, rect.top() + iDaH, iLeftHalf - 4, iLineSpacing, Qt::AlignLeft | Qt::AlignVCenter, txt); if(bIsTerminated) { if((m_tTransferStartTime != 0) && (m_tTransferEndTime != 0)) { - QString tot = KviTimeUtils::formatTimeInterval(kvi_timeSpan(m_tTransferEndTime,m_tTransferStartTime),KviTimeUtils::NoLeadingEmptyIntervals | KviTimeUtils::NoLeadingZeroes); + QString tot = KviTimeUtils::formatTimeInterval(kvi_timeSpan(m_tTransferEndTime, m_tTransferStartTime), KviTimeUtils::NoLeadingEmptyIntervals | KviTimeUtils::NoLeadingZeroes); txt = "TOT: "; txt += tot; - } else { + } + else + { txt = ""; } - } else { + } + else + { if(iEta >= 0) { - QString eta = KviTimeUtils::formatTimeInterval(iEta,KviTimeUtils::NoLeadingEmptyIntervals | KviTimeUtils::NoLeadingZeroes); + QString eta = KviTimeUtils::formatTimeInterval(iEta, KviTimeUtils::NoLeadingEmptyIntervals | KviTimeUtils::NoLeadingZeroes); txt = "ETA: "; txt += eta; - } else { + } + else + { txt = "ETA: ?"; } } - p->setPen(QColor(180,180,200)); - p->drawRect(rect.left() + width - (4 + iRightHalf),rect.top() + iDaH,iRightHalf,iLineSpacing); - p->fillRect(rect.left() + width - (3 + iRightHalf),rect.top() + iDaH + 1,iRightHalf - 2,iLineSpacing - 2,bIsTerminated ? QColor(210,210,210) : QColor(190,190,240)); + p->setPen(QColor(180, 180, 200)); + p->drawRect(rect.left() + width - (4 + iRightHalf), rect.top() + iDaH, iRightHalf, iLineSpacing); + p->fillRect(rect.left() + width - (3 + iRightHalf), rect.top() + iDaH + 1, iRightHalf - 2, iLineSpacing - 2, bIsTerminated ? QColor(210, 210, 210) : QColor(190, 190, 240)); p->setPen(bIsTerminated ? Qt::darkGray : Qt::black); - p->drawText(rect.left() + width - (2 + iRightHalf),rect.top() + iDaH,iRightHalf - 4,iLineSpacing,Qt::AlignLeft | Qt::AlignVCenter,txt); - + p->drawText(rect.left() + width - (2 + iRightHalf), rect.top() + iDaH, iRightHalf - 4, iLineSpacing, Qt::AlignLeft | Qt::AlignVCenter, txt); } break; } - } int DccFileTransfer::displayHeight(int iLineSpacing) @@ -1770,7 +1895,7 @@ QString DccFileTransfer::tipText() s = QString("").arg(m_szDccType.ptr()).arg(id()); s += ""; s += ""; s += ""; s += "
DCC %1 (ID %2)
"; - s += __tr2qs_ctx("Transfer Log","dcc"); + s += __tr2qs_ctx("Transfer Log", "dcc"); s += "
"; s += m_szTransferLog; @@ -1782,36 +1907,43 @@ QString DccFileTransfer::tipText() void DccFileTransfer::init() { - if(g_pDccFileTransfers)return; + if(g_pDccFileTransfers) + return; g_pDccFileTransfers = new KviPointerList; g_pDccFileTransfers->setAutoDelete(false); QPixmap * pix = g_pIconManager->getImage("kvi_dccfiletransfericons.png", false); - if(pix)g_pDccFileTransferIcon = new QPixmap(*pix); - else g_pDccFileTransferIcon = 0; + if(pix) + g_pDccFileTransferIcon = new QPixmap(*pix); + else + g_pDccFileTransferIcon = 0; } void DccFileTransfer::done() { - if(!g_pDccFileTransfers)return; + if(!g_pDccFileTransfers) + return; while(DccFileTransfer * t = g_pDccFileTransfers->first()) delete t; delete g_pDccFileTransfers; g_pDccFileTransfers = 0; - if(g_pDccFileTransferIcon)delete g_pDccFileTransferIcon; + if(g_pDccFileTransferIcon) + delete g_pDccFileTransferIcon; g_pDccFileTransferIcon = 0; } unsigned int DccFileTransfer::transferCount() { - if(!g_pDccFileTransfers)return 0; + if(!g_pDccFileTransfers) + return 0; return g_pDccFileTransfers->count(); } -DccFileTransfer * DccFileTransfer::nonFailedTransferWithLocalFileName(const QString &szLocalFileName) +DccFileTransfer * DccFileTransfer::nonFailedTransferWithLocalFileName(const QString & szLocalFileName) { - if(!g_pDccFileTransfers)return 0; - for(DccFileTransfer * t = g_pDccFileTransfers->first();t;t = g_pDccFileTransfers->next()) + if(!g_pDccFileTransfers) + return 0; + for(DccFileTransfer * t = g_pDccFileTransfers->first(); t; t = g_pDccFileTransfers->next()) { #if defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW) // on windows the file names are case insensitive @@ -1829,62 +1961,67 @@ DccFileTransfer * DccFileTransfer::nonFailedTransferWithLocalFileName(const QStr unsigned int DccFileTransfer::runningTransfersCount() { - if(!g_pDccFileTransfers)return 0; + if(!g_pDccFileTransfers) + return 0; unsigned int cnt = 0; - for(DccFileTransfer * t = g_pDccFileTransfers->first();t;t = g_pDccFileTransfers->next()) + for(DccFileTransfer * t = g_pDccFileTransfers->first(); t; t = g_pDccFileTransfers->next()) { - if(t->active())cnt++; + if(t->active()) + cnt++; } return cnt; } -bool DccFileTransfer::handleResumeAccepted(const char * filename,const char * port,const char * szZeroPortTag) +bool DccFileTransfer::handleResumeAccepted(const char * filename, const char * port, const char * szZeroPortTag) { - if(!g_pDccFileTransfers)return false; + if(!g_pDccFileTransfers) + return false; - for(DccFileTransfer * t = g_pDccFileTransfers->first();t;t = g_pDccFileTransfers->next()) + for(DccFileTransfer * t = g_pDccFileTransfers->first(); t; t = g_pDccFileTransfers->next()) { - if(t->resumeAccepted(filename,port,szZeroPortTag))return true; + if(t->resumeAccepted(filename, port, szZeroPortTag)) + return true; } return false; } -bool DccFileTransfer::handleResumeRequest(const char * filename,const char * port,quint64 filePos) +bool DccFileTransfer::handleResumeRequest(const char * filename, const char * port, quint64 filePos) { if(!g_pDccFileTransfers) return false; - for(DccFileTransfer * t = g_pDccFileTransfers->first();t;t = g_pDccFileTransfers->next()) + for(DccFileTransfer * t = g_pDccFileTransfers->first(); t; t = g_pDccFileTransfers->next()) { - if(t->doResume(filename,port,filePos)) + if(t->doResume(filename, port, filePos)) return true; } return false; } -void DccFileTransfer::outputAndLog(const QString &s) +void DccFileTransfer::outputAndLog(const QString & s) { KviWindow * out = transferWindow(); addToTransferLog(s); - if(out)out->output(KVI_OUT_DCCMSG,"[%Q]: %Q",&m_szTransferIdString,&s); + if(out) + out->output(KVI_OUT_DCCMSG, "[%Q]: %Q", &m_szTransferIdString, &s); } -void DccFileTransfer::outputAndLog(int msgtype,const QString &s) +void DccFileTransfer::outputAndLog(int msgtype, const QString & s) { KviWindow * out = transferWindow(); addToTransferLog(s); - if(out)out->output(msgtype,"[%Q]: %Q",&m_szTransferIdString,&s); + if(out) + out->output(msgtype, "[%Q]: %Q", &m_szTransferIdString, &s); } - -void DccFileTransfer::addToTransferLog(const QString &s) +void DccFileTransfer::addToTransferLog(const QString & s) { QDateTime dt = QDateTime::currentDateTime(); QString ts; - ts.sprintf("[%4d.%2d.%2d %2d:%2d:%2d] ",dt.date().year(),dt.date().month(),dt.date().day(),dt.time().hour(),dt.time().minute(),dt.time().second()); - m_szTransferLog += ts+s; + ts.sprintf("[%4d.%2d.%2d %2d:%2d:%2d] ", dt.date().year(), dt.date().month(), dt.date().day(), dt.time().hour(), dt.time().minute(), dt.time().second()); + m_szTransferLog += ts + s; m_szTransferLog += "
"; } @@ -1893,22 +2030,22 @@ void DccFileTransfer::connectionInProgress() if(m_pDescriptor->bActive) { // ACTIVE CONNECTION -// if((kvi_strEqualCS(m_szDccType.ptr(), "RECV")) || (kvi_strEqualCS(m_szDccType.ptr(),"TRECV"))) -// { -// // FIXME: that's not true!... we're NOT connected here -// if(TRIGGER_EVENT_5PARAM_RETVALUE(KviEvent_OnDCCGetConnected,this,m_pDescriptor->szPort.ptr(),m_pDescriptor->szFileName.ptr(),m_pDescriptor->szNick.ptr(),m_pDescriptor->szUser.ptr(),m_pDescriptor->szHost.ptr())); -// } else { -// if(TRIGGER_EVENT_5PARAM_RETVALUE(KviEvent_OnDCCSendConnected,this,m_pDescriptor->szPort.ptr(),m_pDescriptor->szFileName.ptr(),m_pDescriptor->szNick.ptr(),m_pDescriptor->szUser.ptr(),m_pDescriptor->szHost.ptr())); -// } -// - m_szStatusString = __tr2qs_ctx("Contacting host %1 on port %2","dcc").arg(m_pDescriptor->szIp, m_pDescriptor->szPort); + // if((kvi_strEqualCS(m_szDccType.ptr(), "RECV")) || (kvi_strEqualCS(m_szDccType.ptr(),"TRECV"))) + // { + // // FIXME: that's not true!... we're NOT connected here + // if(TRIGGER_EVENT_5PARAM_RETVALUE(KviEvent_OnDCCGetConnected,this,m_pDescriptor->szPort.ptr(),m_pDescriptor->szFileName.ptr(),m_pDescriptor->szNick.ptr(),m_pDescriptor->szUser.ptr(),m_pDescriptor->szHost.ptr())); + // } else { + // if(TRIGGER_EVENT_5PARAM_RETVALUE(KviEvent_OnDCCSendConnected,this,m_pDescriptor->szPort.ptr(),m_pDescriptor->szFileName.ptr(),m_pDescriptor->szNick.ptr(),m_pDescriptor->szUser.ptr(),m_pDescriptor->szHost.ptr())); + // } + // + m_szStatusString = __tr2qs_ctx("Contacting host %1 on port %2", "dcc").arg(m_pDescriptor->szIp, m_pDescriptor->szPort); outputAndLog(m_szStatusString); displayUpdate(); return; } // PASSIVE CONNECTION - m_szStatusString = __tr2qs_ctx("Listening on interface %1 port %2","dcc").arg(m_pMarshal->localIp(), m_pMarshal->localPort()); + m_szStatusString = __tr2qs_ctx("Listening on interface %1 port %2", "dcc").arg(m_pMarshal->localIp(), m_pMarshal->localPort()); outputAndLog(m_szStatusString); if(m_pDescriptor->bSendRequest) @@ -1917,7 +2054,9 @@ void DccFileTransfer::connectionInProgress() if(!m_pDescriptor->szFakeIp.isEmpty()) { ip = m_pDescriptor->szFakeIp; - } else { + } + else + { ip = m_pDescriptor->szListenIp; if(KVI_OPTION_BOOL(KviOption_boolDccGuessIpFromServerWhenLocalIsUnroutable)) @@ -1931,67 +2070,78 @@ void DccFileTransfer::connectionInProgress() if(!tmp.isEmpty()) { ip = tmp; - outputAndLog(__tr2qs_ctx("The local IP address is private, determining from IRC server: %1","dcc").arg(ip)); - } else { - outputAndLog(__tr2qs_ctx("The local IP address is private, but unable to determine it from the IRC server","dcc")); + outputAndLog(__tr2qs_ctx("The local IP address is private, determining from IRC server: %1", "dcc").arg(ip)); } - } else { - outputAndLog(__tr2qs_ctx("The local IP address is private, but have no IRC server to determine it from","dcc")); + else + { + outputAndLog(__tr2qs_ctx("The local IP address is private, but unable to determine it from the IRC server", "dcc")); + } + } + else + { + outputAndLog(__tr2qs_ctx("The local IP address is private, but have no IRC server to determine it from", "dcc")); } } } } - KviCString port = !m_pDescriptor->szFakePort.isEmpty() ? m_pDescriptor->szFakePort : m_pMarshal->localPort(); + KviCString port = !m_pDescriptor->szFakePort.isEmpty() ? m_pDescriptor->szFakePort : m_pMarshal->localPort(); //#warning "OPTION FOR SENDING 127.0.0.1 and so on (not an unsigned nuumber)" struct in_addr a; - if(KviNetUtils::stringIpToBinaryIp(ip,&a))ip.setNum(htonl(a.s_addr)); + if(KviNetUtils::stringIpToBinaryIp(ip, &a)) + ip.setNum(htonl(a.s_addr)); QString tmp = m_pDescriptor->szFileName; // just to be sure - KviQString::cutToLast(tmp,'/'); - KviQString::cutToLast(tmp,'\\'); + KviQString::cutToLast(tmp, '/'); + KviQString::cutToLast(tmp, '\\'); QString fName; // BUG-TO-BUG mIrc compatibility if(KVI_OPTION_BOOL(KviOption_boolDCCFileTransferReplaceOutgoingSpacesWithUnderscores)) - tmp.replace(" ","_"); + tmp.replace(" ", "_"); - KviIrcServerParser::encodeCtcpParameter(tmp.toUtf8().data(),fName); + KviIrcServerParser::encodeCtcpParameter(tmp.toUtf8().data(), fName); // Zero port requests want DCC SEND as back-request KviCString szReq; if(m_pDescriptor->isZeroPortRequest()) { szReq = "SEND"; - if(m_pDescriptor->bIsTdcc) szReq.prepend("T"); + if(m_pDescriptor->bIsTdcc) + szReq.prepend("T"); #ifdef COMPILE_SSL_SUPPORT - if(m_pDescriptor->bIsSSL) szReq.prepend("S"); + if(m_pDescriptor->bIsSSL) + szReq.prepend("S"); #endif m_pDescriptor->console()->connection()->sendFmtData("PRIVMSG %s :%cDCC %s %s %s %s %s %s%c", - m_pDescriptor->console()->connection()->encodeText(m_pDescriptor->szNick).data(), - 0x01, - m_pDescriptor->console()->connection()->encodeText(szReq.ptr()).data(), - m_pDescriptor->console()->connection()->encodeText(fName).data(), - ip.toUtf8().data(),port.ptr(), - m_pDescriptor->szFileSize.toUtf8().data(),m_pDescriptor->zeroPortRequestTag(),0x01); - } else { + m_pDescriptor->console()->connection()->encodeText(m_pDescriptor->szNick).data(), + 0x01, + m_pDescriptor->console()->connection()->encodeText(szReq.ptr()).data(), + m_pDescriptor->console()->connection()->encodeText(fName).data(), + ip.toUtf8().data(), port.ptr(), + m_pDescriptor->szFileSize.toUtf8().data(), m_pDescriptor->zeroPortRequestTag(), 0x01); + } + else + { szReq = m_szDccType; m_pDescriptor->console()->connection()->sendFmtData("PRIVMSG %s :%cDCC %s %s %s %s %Q%c", - m_pDescriptor->console()->connection()->encodeText(m_pDescriptor->szNick).data(), - 0x01, - m_pDescriptor->console()->connection()->encodeText(szReq.ptr()).data(), - m_pDescriptor->console()->connection()->encodeText(fName).data(), - ip.toUtf8().data(),port.ptr(), - &(m_pDescriptor->szLocalFileSize),0x01); + m_pDescriptor->console()->connection()->encodeText(m_pDescriptor->szNick).data(), + 0x01, + m_pDescriptor->console()->connection()->encodeText(szReq.ptr()).data(), + m_pDescriptor->console()->connection()->encodeText(fName).data(), + ip.toUtf8().data(), port.ptr(), + &(m_pDescriptor->szLocalFileSize), 0x01); } - outputAndLog(__tr2qs_ctx("Sent DCC %1 request to %2, waiting for remote client to connect...","dcc").arg(szReq.ptr(), m_pDescriptor->szNick)); - } else { - outputAndLog(__tr2qs_ctx("DCC %1 request not sent, awaiting manual connection","dcc").arg(m_szDccType.ptr())); + outputAndLog(__tr2qs_ctx("Sent DCC %1 request to %2, waiting for remote client to connect...", "dcc").arg(szReq.ptr(), m_pDescriptor->szNick)); + } + else + { + outputAndLog(__tr2qs_ctx("DCC %1 request not sent, awaiting manual connection", "dcc").arg(m_szDccType.ptr())); } - KVS_TRIGGER_EVENT_1(KviEvent_OnDCCFileTransferConnectionInProgress,eventWindow(),m_pDescriptor->idString()); + KVS_TRIGGER_EVENT_1(KviEvent_OnDCCFileTransferConnectionInProgress, eventWindow(), m_pDescriptor->idString()); displayUpdate(); } @@ -1999,19 +2149,19 @@ void DccFileTransfer::connectionInProgress() void DccFileTransfer::startingSSLHandshake() { #ifdef COMPILE_SSL_SUPPORT - outputAndLog(KVI_OUT_SSL,__tr2qs_ctx("Low-level transport connection established","dcc")); - outputAndLog(KVI_OUT_SSL,__tr2qs_ctx("Starting Secure Socket Layer handshake","dcc")); + outputAndLog(KVI_OUT_SSL, __tr2qs_ctx("Low-level transport connection established", "dcc")); + outputAndLog(KVI_OUT_SSL, __tr2qs_ctx("Starting Secure Socket Layer handshake", "dcc")); #endif } void DccFileTransfer::sslError(const char * msg) { #ifdef COMPILE_SSL_SUPPORT - outputAndLog(KVI_OUT_DCCERROR,__tr2qs_ctx("[SSL ERROR]: %1","dcc").arg(msg)); + outputAndLog(KVI_OUT_DCCERROR, __tr2qs_ctx("[SSL ERROR]: %1", "dcc").arg(msg)); #endif } -bool DccFileTransfer::event(QEvent *e) +bool DccFileTransfer::event(QEvent * e) { if(e->type() == KVI_THREAD_EVENT) { @@ -2023,20 +2173,20 @@ bool DccFileTransfer::event(QEvent *e) QString szErrorString = KviError::getDescription(*pError); delete pError; if(m_pDescriptor->bRecvFile) - g_pApp->fileDownloadTerminated(false,m_pDescriptor->szFileName.toUtf8().data(),m_pDescriptor->szLocalFileName.toUtf8().data(),m_pDescriptor->szNick.toUtf8().data(),szErrorString.toUtf8().data()); + g_pApp->fileDownloadTerminated(false, m_pDescriptor->szFileName.toUtf8().data(), m_pDescriptor->szLocalFileName.toUtf8().data(), m_pDescriptor->szNick.toUtf8().data(), szErrorString.toUtf8().data()); - m_szStatusString = __tr2qs_ctx("Transfer failed: ","dcc"); + m_szStatusString = __tr2qs_ctx("Transfer failed: ", "dcc"); m_szStatusString += szErrorString; m_eGeneralStatus = Failure; m_tTransferEndTime = kvi_unixTime(); KVS_TRIGGER_EVENT_3(KviEvent_OnDCCFileTransferFailed, - eventWindow(), - szErrorString, - (kvs_int_t)(m_pSlaveRecvThread ? m_pSlaveRecvThread->receivedBytes() : m_pSlaveSendThread->sentBytes()), - m_pDescriptor->idString()); + eventWindow(), + szErrorString, + (kvs_int_t)(m_pSlaveRecvThread ? m_pSlaveRecvThread->receivedBytes() : m_pSlaveSendThread->sentBytes()), + m_pDescriptor->idString()); - outputAndLog(KVI_OUT_DCCERROR,m_szStatusString); + outputAndLog(KVI_OUT_DCCERROR, m_szStatusString); displayUpdate(); return true; } @@ -2047,13 +2197,15 @@ bool DccFileTransfer::event(QEvent *e) // File Upload/Download terminated, or something like this if(KVI_OPTION_BOOL(KviOption_boolNotifyDccSendSuccessInConsole)) { - KviConsoleWindow *c; - if(!g_pApp->windowExists(m_pDescriptor->console())) c=g_pApp->activeConsole(); - else c=m_pDescriptor->console(); - c->output(KVI_OUT_DCCMSG,__tr2qs_ctx("DCC %s transfer with %Q@%Q:%Q completed: \r![!dbl]play $0\r%s\r","dcc"), - m_pDescriptor->bIsTdcc ? (m_pDescriptor->bRecvFile ? "TRECV" : "TSEND") : (m_pDescriptor->bRecvFile ? "RECV" : "SEND"), - &(m_pDescriptor->szNick),&(m_pDescriptor->szIp),&(m_pDescriptor->szPort), - &(m_pDescriptor->szLocalFileName)); + KviConsoleWindow * c; + if(!g_pApp->windowExists(m_pDescriptor->console())) + c = g_pApp->activeConsole(); + else + c = m_pDescriptor->console(); + c->output(KVI_OUT_DCCMSG, __tr2qs_ctx("DCC %s transfer with %Q@%Q:%Q completed: \r![!dbl]play $0\r%s\r", "dcc"), + m_pDescriptor->bIsTdcc ? (m_pDescriptor->bRecvFile ? "TRECV" : "TSEND") : (m_pDescriptor->bRecvFile ? "RECV" : "SEND"), + &(m_pDescriptor->szNick), &(m_pDescriptor->szIp), &(m_pDescriptor->szPort), + &(m_pDescriptor->szLocalFileName)); } /* // Also add an optional message to the notifier, unless it is an AVATAR download! @@ -2063,39 +2215,42 @@ bool DccFileTransfer::event(QEvent *e) g_pApp->notifierMessage(0,KVI_SMALLICON_DCCMSG,szMsg,KVI_OPTION_UINT(KviOption_uintNotifierAutoHideTime)); } */ - if(m_pDescriptor->bRecvFile)g_pApp->fileDownloadTerminated(true,m_pDescriptor->szFileName.toUtf8().data(),m_pDescriptor->szLocalFileName.toUtf8().data(),m_pDescriptor->szNick.toUtf8().data()); - m_szStatusString = __tr2qs_ctx("Transfer completed","dcc"); + if(m_pDescriptor->bRecvFile) + g_pApp->fileDownloadTerminated(true, m_pDescriptor->szFileName.toUtf8().data(), m_pDescriptor->szLocalFileName.toUtf8().data(), m_pDescriptor->szNick.toUtf8().data()); + m_szStatusString = __tr2qs_ctx("Transfer completed", "dcc"); outputAndLog(m_szStatusString); m_eGeneralStatus = Success; m_tTransferEndTime = kvi_unixTime(); - if (m_pResumeTimer) delete m_pResumeTimer; + if(m_pResumeTimer) + delete m_pResumeTimer; KVS_TRIGGER_EVENT_2(KviEvent_OnDCCFileTransferSuccess, - eventWindow(), - (kvs_int_t)(m_pSlaveRecvThread ? m_pSlaveRecvThread->receivedBytes() : m_pSlaveSendThread->sentBytes()), - m_pDescriptor->idString()); + eventWindow(), + (kvs_int_t)(m_pSlaveRecvThread ? m_pSlaveRecvThread->receivedBytes() : m_pSlaveSendThread->sentBytes()), + m_pDescriptor->idString()); displayUpdate(); - if(KVI_OPTION_BOOL(KviOption_boolAutoCloseDccSendOnSuccess))die(); + if(KVI_OPTION_BOOL(KviOption_boolAutoCloseDccSendOnSuccess)) + die(); return true; } break; case KVI_DCC_THREAD_EVENT_MESSAGE: { KviCString * str = ((KviThreadDataEvent *)e)->getData(); - outputAndLog(QString(__tr_no_xgettext_ctx(str->ptr(),"dcc"))); + outputAndLog(QString(__tr_no_xgettext_ctx(str->ptr(), "dcc"))); delete str; return true; } break; default: - qDebug("Invalid event type %d received",((KviThreadEvent *)e)->id()); - break; + qDebug("Invalid event type %d received", ((KviThreadEvent *)e)->id()); + break; } } -//#warning "Remove this!" -// if(e->type() == QEvent::Close)qDebug("Close event received"); + //#warning "Remove this!" + // if(e->type() == QEvent::Close)qDebug("Close event received"); return KviFileTransfer::event(e); } @@ -2103,23 +2258,23 @@ void DccFileTransfer::handleMarshalError(KviError::Code eError) { QString szErr = KviError::getDescription(eError); m_eGeneralStatus = Failure; - m_szStatusString = __tr2qs_ctx("Transfer failed: ","dcc"); + m_szStatusString = __tr2qs_ctx("Transfer failed: ", "dcc"); m_szStatusString += szErr; outputAndLog(m_szStatusString); - KVS_TRIGGER_EVENT_3(KviEvent_OnDCCFileTransferFailed,eventWindow(),szErr,(kvs_int_t)0,m_pDescriptor->idString()); + KVS_TRIGGER_EVENT_3(KviEvent_OnDCCFileTransferFailed, eventWindow(), szErr, (kvs_int_t)0, m_pDescriptor->idString()); displayUpdate(); } void DccFileTransfer::connected() { - outputAndLog(__tr2qs_ctx("Connected to %1:%2","dcc").arg(m_pMarshal->remoteIp(), m_pMarshal->remotePort())); - outputAndLog(__tr2qs_ctx("Local end is %1:%2","dcc").arg(m_pMarshal->localIp(), m_pMarshal->localPort())); + outputAndLog(__tr2qs_ctx("Connected to %1:%2", "dcc").arg(m_pMarshal->remoteIp(), m_pMarshal->remotePort())); + outputAndLog(__tr2qs_ctx("Local end is %1:%2", "dcc").arg(m_pMarshal->localIp(), m_pMarshal->localPort())); m_tTransferStartTime = kvi_unixTime(); if(!(m_pDescriptor->bActive)) { - m_pDescriptor->szIp = m_pMarshal->remoteIp(); + m_pDescriptor->szIp = m_pMarshal->remoteIp(); m_pDescriptor->szPort = m_pMarshal->remotePort(); m_pDescriptor->szHost = m_pMarshal->remoteIp(); } @@ -2127,18 +2282,19 @@ void DccFileTransfer::connected() if(m_pDescriptor->bRecvFile) { KviDccRecvThreadOptions * o = new KviDccRecvThreadOptions; - o->szFileName = m_pDescriptor->szLocalFileName.toUtf8().data(); + o->szFileName = m_pDescriptor->szLocalFileName.toUtf8().data(); bool bOk; - o->uTotalFileSize = m_pDescriptor->szFileSize.toULongLong(&bOk); - if(!bOk)o->uTotalFileSize = 0; - o->bResume = m_pDescriptor->bResume; + o->uTotalFileSize = m_pDescriptor->szFileSize.toULongLong(&bOk); + if(!bOk) + o->uTotalFileSize = 0; + o->bResume = m_pDescriptor->bResume; o->iIdleStepLengthInMSec = KVI_OPTION_BOOL(KviOption_boolDccSendForceIdleStep) ? KVI_OPTION_UINT(KviOption_uintDccSendIdleStepInMSec) : 0; - o->bIsTdcc = m_pDescriptor->bIsTdcc; - o->bSendZeroAck = KVI_OPTION_BOOL(KviOption_boolSendZeroAckInDccRecv); - o->bSend64BitAck = KVI_OPTION_BOOL(KviOption_boolSend64BitAckInDccRecv); - o->bNoAcks = m_pDescriptor->bNoAcks; - o->uMaxBandwidth = m_uMaxBandwidth; - m_pSlaveRecvThread = new DccRecvThread(this,m_pMarshal->releaseSocket(),o); + o->bIsTdcc = m_pDescriptor->bIsTdcc; + o->bSendZeroAck = KVI_OPTION_BOOL(KviOption_boolSendZeroAckInDccRecv); + o->bSend64BitAck = KVI_OPTION_BOOL(KviOption_boolSend64BitAckInDccRecv); + o->bNoAcks = m_pDescriptor->bNoAcks; + o->uMaxBandwidth = m_uMaxBandwidth; + m_pSlaveRecvThread = new DccRecvThread(this, m_pMarshal->releaseSocket(), o); #ifdef COMPILE_SSL_SUPPORT KviSSL * s = m_pMarshal->releaseSSL(); @@ -2148,20 +2304,24 @@ void DccFileTransfer::connected() } #endif m_pSlaveRecvThread->start(); - } else { + } + else + { KviDccSendThreadOptions * o = new KviDccSendThreadOptions; - o->szFileName = m_pDescriptor->szLocalFileName.toUtf8().data(); - o->bFastSend = KVI_OPTION_BOOL(KviOption_boolUseFastDccSend); + o->szFileName = m_pDescriptor->szLocalFileName.toUtf8().data(); + o->bFastSend = KVI_OPTION_BOOL(KviOption_boolUseFastDccSend); o->iIdleStepLengthInMSec = KVI_OPTION_BOOL(KviOption_boolDccSendForceIdleStep) ? KVI_OPTION_UINT(KviOption_uintDccSendIdleStepInMSec) : 0; bool bOk; - o->bIsTdcc = m_pDescriptor->bIsTdcc; - o->uStartPosition = m_pDescriptor->szFileSize.toULongLong(&bOk); - if(!bOk) o->uStartPosition = 0; - o->iPacketSize = KVI_OPTION_UINT(KviOption_uintDccSendPacketSize); - if(o->iPacketSize < 32)o->iPacketSize = 32; - o->uMaxBandwidth = m_uMaxBandwidth; - o->bNoAcks = m_pDescriptor->bNoAcks; - m_pSlaveSendThread = new DccSendThread(this,m_pMarshal->releaseSocket(),o); + o->bIsTdcc = m_pDescriptor->bIsTdcc; + o->uStartPosition = m_pDescriptor->szFileSize.toULongLong(&bOk); + if(!bOk) + o->uStartPosition = 0; + o->iPacketSize = KVI_OPTION_UINT(KviOption_uintDccSendPacketSize); + if(o->iPacketSize < 32) + o->iPacketSize = 32; + o->uMaxBandwidth = m_uMaxBandwidth; + o->bNoAcks = m_pDescriptor->bNoAcks; + m_pSlaveSendThread = new DccSendThread(this, m_pMarshal->releaseSocket(), o); #ifdef COMPILE_SSL_SUPPORT KviSSL * s = m_pMarshal->releaseSSL(); if(s) @@ -2173,33 +2333,32 @@ void DccFileTransfer::connected() } m_eGeneralStatus = Transferring; - m_szStatusString = __tr2qs_ctx("Transferring data","dcc"); + m_szStatusString = __tr2qs_ctx("Transferring data", "dcc"); - KVS_TRIGGER_EVENT_1(KviEvent_OnDCCFileTransferBegin,eventWindow(),m_pDescriptor->idString()); + KVS_TRIGGER_EVENT_1(KviEvent_OnDCCFileTransferBegin, eventWindow(), m_pDescriptor->idString()); outputAndLog(m_szStatusString); displayUpdate(); } -bool DccFileTransfer::resumeAccepted(const char *filename,const char *port,const char *szZeroPortTag) +bool DccFileTransfer::resumeAccepted(const char * filename, const char * port, const char * szZeroPortTag) { - if(!(kvi_strEqualCI(filename,m_pDescriptor->szFileName.toUtf8().data()) || KVI_OPTION_BOOL(KviOption_boolAcceptBrokenFileNameDccResumeRequests))) + if(!(kvi_strEqualCI(filename, m_pDescriptor->szFileName.toUtf8().data()) || KVI_OPTION_BOOL(KviOption_boolAcceptBrokenFileNameDccResumeRequests))) return false; - if(!(kvi_strEqualCI(port,m_pDescriptor->szPort.toUtf8().data()) && - (!m_pSlaveRecvThread) && m_pDescriptor->bResume && m_pDescriptor->bRecvFile && m_pResumeTimer)) + if(!(kvi_strEqualCI(port, m_pDescriptor->szPort.toUtf8().data()) && (!m_pSlaveRecvThread) && m_pDescriptor->bResume && m_pDescriptor->bRecvFile && m_pResumeTimer)) return false; - if(kvi_strEqualCI(port,"0")) + if(kvi_strEqualCI(port, "0")) { - if(!kvi_strEqualCI(szZeroPortTag,m_pDescriptor->zeroPortRequestTag())) + if(!kvi_strEqualCI(szZeroPortTag, m_pDescriptor->zeroPortRequestTag())) return false; } delete m_pResumeTimer; m_pResumeTimer = 0; - outputAndLog(__tr2qs_ctx("RESUME accepted, transfer will begin at position %1","dcc").arg(m_pDescriptor->szLocalFileSize)); + outputAndLog(__tr2qs_ctx("RESUME accepted, transfer will begin at position %1", "dcc").arg(m_pDescriptor->szLocalFileSize)); listenOrConnect(); @@ -2218,7 +2377,7 @@ bool DccFileTransfer::resumeAccepted(const char *filename,const char *port,const return true; } -bool DccFileTransfer::doResume(const char * filename,const char * port,quint64 filePos) +bool DccFileTransfer::doResume(const char * filename, const char * port, quint64 filePos) { if(m_pSlaveRecvThread) return false; // we're already receiving stuff... @@ -2228,8 +2387,8 @@ bool DccFileTransfer::doResume(const char * filename,const char * port,quint64 f if(m_pDescriptor->bRecvFile) return false; // we're receiving... can't resume anything - bool bFileNameMatches = KviQString::equalCI(filename,m_pDescriptor->szFileName); - bool bPortMatches = KviQString::equalCI(port,m_pMarshal->dccPort()); + bool bFileNameMatches = KviQString::equalCI(filename, m_pDescriptor->szFileName); + bool bPortMatches = KviQString::equalCI(port, m_pMarshal->dccPort()); if(!bPortMatches) { @@ -2243,7 +2402,7 @@ bool DccFileTransfer::doResume(const char * filename,const char * port,quint64 f // hmm.. try to accept a mismatched port request if(_OUTPUT_VERBOSE) - outputAndLog(KVI_OUT_DCCMSG,__tr2qs_ctx("Processing RESUME request with mismatched port (%1)","dcc").arg(port)); + outputAndLog(KVI_OUT_DCCMSG, __tr2qs_ctx("Processing RESUME request with mismatched port (%1)", "dcc").arg(port)); } // port matches @@ -2260,16 +2419,15 @@ bool DccFileTransfer::doResume(const char * filename,const char * port,quint64 f { if(_OUTPUT_VERBOSE) outputAndLog( - KVI_OUT_DCCMSG, - __tr2qs_ctx("Invalid RESUME request: invalid file name (got '%1' but should be '%2')","dcc") - .arg(filename) - .arg(m_pDescriptor->szFileName) - ); + KVI_OUT_DCCMSG, + __tr2qs_ctx("Invalid RESUME request: invalid file name (got '%1' but should be '%2')", "dcc") + .arg(filename) + .arg(m_pDescriptor->szFileName)); return false; // bad file name } if(_OUTPUT_VERBOSE) - outputAndLog(KVI_OUT_DCCMSG,__tr2qs_ctx("Processing RESUME request with broken filename (%1)","dcc").arg(filename)); + outputAndLog(KVI_OUT_DCCMSG, __tr2qs_ctx("Processing RESUME request with broken filename (%1)", "dcc").arg(filename)); } bool bOk; @@ -2278,31 +2436,30 @@ bool DccFileTransfer::doResume(const char * filename,const char * port,quint64 f if(!bOk) { // ops...internal error - outputAndLog(KVI_OUT_DCCERROR,__tr2qs_ctx("Internal error in RESUME request","dcc")); + outputAndLog(KVI_OUT_DCCERROR, __tr2qs_ctx("Internal error in RESUME request", "dcc")); return false; } if(iLocalFileSize <= filePos) { - outputAndLog(KVI_OUT_DCCERROR,__tr2qs_ctx("Invalid RESUME request: position %1 is larger than file size","dcc").arg(filePos)); + outputAndLog(KVI_OUT_DCCERROR, __tr2qs_ctx("Invalid RESUME request: position %1 is larger than file size", "dcc").arg(filePos)); return false; } - outputAndLog(KVI_OUT_DCCERROR,__tr2qs_ctx("Accepting RESUME request, transfer will begin at position %1","dcc").arg(filePos)); + outputAndLog(KVI_OUT_DCCERROR, __tr2qs_ctx("Accepting RESUME request, transfer will begin at position %1", "dcc").arg(filePos)); m_pDescriptor->szFileSize.setNum(filePos); KviCString szBuffy; - KviIrcServerParser::encodeCtcpParameter(filename,szBuffy); + KviIrcServerParser::encodeCtcpParameter(filename, szBuffy); m_pDescriptor->console()->connection()->sendFmtData("PRIVMSG %s :%cDCC ACCEPT %s %s %s%c", - m_pDescriptor->console()->connection()->encodeText(m_pDescriptor->szNick).data(), - 0x01, - m_pDescriptor->console()->connection()->encodeText(szBuffy.ptr()).data(), - port, - m_pDescriptor->console()->connection()->encodeText(QString::number(filePos)).data(), - 0x01 - ); + m_pDescriptor->console()->connection()->encodeText(m_pDescriptor->szNick).data(), + 0x01, + m_pDescriptor->console()->connection()->encodeText(szBuffy.ptr()).data(), + port, + m_pDescriptor->console()->connection()->encodeText(QString::number(filePos)).data(), + 0x01); return true; } @@ -2312,56 +2469,57 @@ DccThread * DccFileTransfer::getSlaveThread() if(m_pDescriptor->bRecvFile) { return m_pSlaveRecvThread; - } else { + } + else + { return m_pSlaveSendThread; } } - -DccFileTransferBandwidthDialog::DccFileTransferBandwidthDialog(QWidget * pParent,DccFileTransfer * t) -: QDialog(pParent) +DccFileTransferBandwidthDialog::DccFileTransferBandwidthDialog(QWidget * pParent, DccFileTransfer * t) + : QDialog(pParent) { QGridLayout * g = new QGridLayout(this); m_pTransfer = t; int iVal = m_pTransfer->bandwidthLimit(); - QString szText = __tr2qs_ctx("Configure Bandwidth for DCC Transfer %1","dcc").arg(t->id()); + QString szText = __tr2qs_ctx("Configure Bandwidth for DCC Transfer %1", "dcc").arg(t->id()); setWindowTitle(szText); - szText = t->isFileUpload() ? __tr2qs_ctx("Limit upload bandwidth to:","dcc") : __tr2qs_ctx("Limit download bandwidth to:","dcc"); + szText = t->isFileUpload() ? __tr2qs_ctx("Limit upload bandwidth to:", "dcc") : __tr2qs_ctx("Limit download bandwidth to:", "dcc"); - m_pEnableLimitCheck = new QCheckBox(szText,this); - g->addWidget(m_pEnableLimitCheck,0,0); + m_pEnableLimitCheck = new QCheckBox(szText, this); + g->addWidget(m_pEnableLimitCheck, 0, 0); m_pEnableLimitCheck->setChecked((iVal >= 0) && (iVal < MAX_DCC_BANDWIDTH_LIMIT)); m_pLimitBox = new QSpinBox(this); m_pLimitBox->setMinimum(0); - m_pLimitBox->setMaximum(MAX_DCC_BANDWIDTH_LIMIT-1); + m_pLimitBox->setMaximum(MAX_DCC_BANDWIDTH_LIMIT - 1); m_pLimitBox->setSingleStep(1); m_pLimitBox->setEnabled((iVal >= 0) && (iVal < MAX_DCC_BANDWIDTH_LIMIT)); - connect(m_pEnableLimitCheck,SIGNAL(toggled(bool)),m_pLimitBox,SLOT(setEnabled(bool))); - g->addWidget(m_pLimitBox,0,1,1,2); + connect(m_pEnableLimitCheck, SIGNAL(toggled(bool)), m_pLimitBox, SLOT(setEnabled(bool))); + g->addWidget(m_pLimitBox, 0, 1, 1, 2); szText = " "; - szText += __tr2qs_ctx("bytes/sec","dcc"); + szText += __tr2qs_ctx("bytes/sec", "dcc"); m_pLimitBox->setSuffix(szText); m_pLimitBox->setValue(iVal < MAX_DCC_BANDWIDTH_LIMIT ? iVal : 0); - QPushButton * pb = new QPushButton(__tr2qs_ctx("OK","dcc"),this); - connect(pb,SIGNAL(clicked()),this,SLOT(okClicked())); + QPushButton * pb = new QPushButton(__tr2qs_ctx("OK", "dcc"), this); + connect(pb, SIGNAL(clicked()), this, SLOT(okClicked())); pb->setMinimumWidth(80); - g->addWidget(pb,2,2); + g->addWidget(pb, 2, 2); - pb = new QPushButton(__tr2qs_ctx("Cancel","dcc"),this); - connect(pb,SIGNAL(clicked()),this,SLOT(cancelClicked())); + pb = new QPushButton(__tr2qs_ctx("Cancel", "dcc"), this); + connect(pb, SIGNAL(clicked()), this, SLOT(cancelClicked())); pb->setMinimumWidth(80); - g->addWidget(pb,2,1); + g->addWidget(pb, 2, 1); - g->setColumnStretch(0,1); - g->setRowStretch(1,1); + g->setColumnStretch(0, 1); + g->setRowStretch(1, 1); } DccFileTransferBandwidthDialog::~DccFileTransferBandwidthDialog() @@ -2374,8 +2532,10 @@ void DccFileTransferBandwidthDialog::okClicked() if(m_pEnableLimitCheck->isChecked()) { iVal = m_pLimitBox->value(); - if(iVal < 0)iVal = MAX_DCC_BANDWIDTH_LIMIT; - if(iVal > MAX_DCC_BANDWIDTH_LIMIT)iVal = MAX_DCC_BANDWIDTH_LIMIT; + if(iVal < 0) + iVal = MAX_DCC_BANDWIDTH_LIMIT; + if(iVal > MAX_DCC_BANDWIDTH_LIMIT) + iVal = MAX_DCC_BANDWIDTH_LIMIT; } m_pTransfer->setBandwidthLimit(iVal); delete this; diff --git a/src/modules/dcc/DccFileTransfer.h b/src/modules/dcc/DccFileTransfer.h index 1e26acab1..f8fb48a05 100644 --- a/src/modules/dcc/DccFileTransfer.h +++ b/src/modules/dcc/DccFileTransfer.h @@ -53,46 +53,47 @@ class QMenu; typedef struct _KviDccSendThreadOptions { - KviCString szFileName; - quint64 uStartPosition; - int iPacketSize; - int iIdleStepLengthInMSec; - bool bFastSend; - bool bNoAcks; - bool bIsTdcc; + KviCString szFileName; + quint64 uStartPosition; + int iPacketSize; + int iIdleStepLengthInMSec; + bool bFastSend; + bool bNoAcks; + bool bIsTdcc; unsigned int uMaxBandwidth; } KviDccSendThreadOptions; - class DccSendThread : public DccThread { public: - DccSendThread(QObject * par,kvi_socket_t fd,KviDccSendThreadOptions * opt); + DccSendThread(QObject * par, kvi_socket_t fd, KviDccSendThreadOptions * opt); ~DccSendThread(); + private: // stats: SHARED!!! - uint m_uAverageSpeed; - uint m_uInstantSpeed; - quint64 m_uFilePosition; - quint64 m_uAckedBytes; - quint64 m_uTotalSentBytes; + uint m_uAverageSpeed; + uint m_uInstantSpeed; + quint64 m_uFilePosition; + quint64 m_uAckedBytes; + quint64 m_uTotalSentBytes; // internal - unsigned long m_uStartTime; - unsigned long m_uInstantSpeedInterval; - quint64 m_uInstantSentBytes; + unsigned long m_uStartTime; + unsigned long m_uInstantSpeedInterval; + quint64 m_uInstantSentBytes; KviDccSendThreadOptions * m_pOpt; - KviMSecTimeInterval * m_pTimeInterval; // used for computing the instant bandwidth but not only + KviMSecTimeInterval * m_pTimeInterval; // used for computing the instant bandwidth but not only public: void initGetInfo(); - uint averageSpeed(){ return m_uAverageSpeed; }; - uint instantSpeed(){ return m_uInstantSpeed; }; - quint64 filePosition(){ return m_uFilePosition; }; + uint averageSpeed() { return m_uAverageSpeed; }; + uint instantSpeed() { return m_uInstantSpeed; }; + quint64 filePosition() { return m_uFilePosition; }; // sent ONLY in this session - quint64 sentBytes(){ return m_uTotalSentBytes; }; - quint64 ackedBytes(){ return m_uAckedBytes; }; - unsigned int bandwidthLimit(){ return m_pOpt->uMaxBandwidth; }; - void setBandwidthLimit(unsigned int uMaxBandwidth){ m_pOpt->uMaxBandwidth = uMaxBandwidth; }; + quint64 sentBytes() { return m_uTotalSentBytes; }; + quint64 ackedBytes() { return m_uAckedBytes; }; + unsigned int bandwidthLimit() { return m_pOpt->uMaxBandwidth; }; + void setBandwidthLimit(unsigned int uMaxBandwidth) { m_pOpt->uMaxBandwidth = uMaxBandwidth; }; void doneGetInfo(); + protected: void updateStats(); virtual void run(); @@ -100,47 +101,50 @@ protected: typedef struct _KviDccRecvThreadOptions { - bool bResume; - KviCString szFileName; - quint64 uTotalFileSize; - int iIdleStepLengthInMSec; - bool bSendZeroAck; - bool bSend64BitAck; - bool bNoAcks; - bool bIsTdcc; + bool bResume; + KviCString szFileName; + quint64 uTotalFileSize; + int iIdleStepLengthInMSec; + bool bSendZeroAck; + bool bSend64BitAck; + bool bNoAcks; + bool bIsTdcc; unsigned int uMaxBandwidth; } KviDccRecvThreadOptions; class DccRecvThread : public DccThread { public: - DccRecvThread(QObject * par,kvi_socket_t fd,KviDccRecvThreadOptions * opt); + DccRecvThread(QObject * par, kvi_socket_t fd, KviDccRecvThreadOptions * opt); ~DccRecvThread(); + protected: KviDccRecvThreadOptions * m_pOpt; // stats: SHARED! - uint m_uAverageSpeed; - uint m_uInstantSpeed; - quint64 m_uFilePosition; - quint64 m_uTotalReceivedBytes; + uint m_uAverageSpeed; + uint m_uInstantSpeed; + quint64 m_uFilePosition; + quint64 m_uTotalReceivedBytes; // internal - unsigned long m_uStartTime; - KviMSecTimeInterval * m_pTimeInterval; // used for computing the instant bandwidth - quint64 m_uInstantReceivedBytes; - quint64 m_uInstantSpeedInterval; - QFile * m_pFile; + unsigned long m_uStartTime; + KviMSecTimeInterval * m_pTimeInterval; // used for computing the instant bandwidth + quint64 m_uInstantReceivedBytes; + quint64 m_uInstantSpeedInterval; + QFile * m_pFile; + public: void initGetInfo(); - uint averageSpeed(){ return m_uAverageSpeed; }; - uint instantSpeed(){ return m_uInstantSpeed; }; - quint64 filePosition(){ return m_uFilePosition; }; + uint averageSpeed() { return m_uAverageSpeed; }; + uint instantSpeed() { return m_uInstantSpeed; }; + quint64 filePosition() { return m_uFilePosition; }; // received ONLY in this session - quint64 receivedBytes(){ return m_uTotalReceivedBytes; }; - unsigned int bandwidthLimit(){ return m_pOpt->uMaxBandwidth; }; - void setBandwidthLimit(unsigned int uMaxBandwidth){ m_pOpt->uMaxBandwidth = uMaxBandwidth; }; + quint64 receivedBytes() { return m_uTotalReceivedBytes; }; + unsigned int bandwidthLimit() { return m_pOpt->uMaxBandwidth; }; + void setBandwidthLimit(unsigned int uMaxBandwidth) { m_pOpt->uMaxBandwidth = uMaxBandwidth; }; void doneGetInfo(); + protected: void postMessageEvent(const char * msg); void updateStats(); @@ -148,82 +152,89 @@ protected: virtual void run(); }; - class DccFileTransferBandwidthDialog : public QDialog { Q_OBJECT public: - DccFileTransferBandwidthDialog(QWidget * pParent,DccFileTransfer * t); + DccFileTransferBandwidthDialog(QWidget * pParent, DccFileTransfer * t); ~DccFileTransferBandwidthDialog(); + protected: DccFileTransfer * m_pTransfer; QCheckBox * m_pEnableLimitCheck; QSpinBox * m_pLimitBox; + protected: - virtual void closeEvent(QCloseEvent *e); + virtual void closeEvent(QCloseEvent * e); protected slots: void okClicked(); void cancelClicked(); }; - class DccFileTransfer : public KviFileTransfer, public DccMarshalOutputContext { - enum GeneralStatus { Connecting, Transferring, Success, Failure }; + enum GeneralStatus + { + Connecting, + Transferring, + Success, + Failure + }; Q_OBJECT public: DccFileTransfer(DccDescriptor * dcc); ~DccFileTransfer(); + private: - DccSendThread * m_pSlaveSendThread; - DccRecvThread * m_pSlaveRecvThread; - DccDescriptor * m_pDescriptor; - DccMarshal * m_pMarshal; + DccSendThread * m_pSlaveSendThread; + DccRecvThread * m_pSlaveRecvThread; + DccDescriptor * m_pDescriptor; + DccMarshal * m_pMarshal; - KviCString m_szTarget; - KviCString m_szDccType; - QString m_szTransferIdString; + KviCString m_szTarget; + KviCString m_szDccType; + QString m_szTransferIdString; - QString m_szStatusString; - GeneralStatus m_eGeneralStatus; + QString m_szStatusString; + GeneralStatus m_eGeneralStatus; - QString m_szTransferLog; // html + QString m_szTransferLog; // html - kvi_time_t m_tTransferStartTime; - kvi_time_t m_tTransferEndTime; + kvi_time_t m_tTransferStartTime; + kvi_time_t m_tTransferEndTime; // cached stats - quint64 m_uTotalFileSize; // total file size to transfer + quint64 m_uTotalFileSize; // total file size to transfer - unsigned int m_uMaxBandwidth; + unsigned int m_uMaxBandwidth; DccFileTransferBandwidthDialog * m_pBandwidthDialog; - QTimer * m_pResumeTimer; // used to signal resume timeout + QTimer * m_pResumeTimer; // used to signal resume timeout public: - bool resumeAccepted(const char * filename,const char * port,const char *szZeroPortTag); - bool doResume(const char * filename,const char * port,quint64 filePos); + bool resumeAccepted(const char * filename, const char * port, const char * szZeroPortTag); + bool doResume(const char * filename, const char * port, quint64 filePos); static void init(); static void done(); static unsigned int runningTransfersCount(); - static DccFileTransfer * nonFailedTransferWithLocalFileName(const QString &szLocalFileName); + static DccFileTransfer * nonFailedTransferWithLocalFileName(const QString & szLocalFileName); static unsigned int transferCount(); - static bool handleResumeAccepted(const char * filename,const char * port,const char * szZeroPortTag); - static bool handleResumeRequest(const char * filename,const char * port,quint64 filePos); + static bool handleResumeAccepted(const char * filename, const char * port, const char * szZeroPortTag); + static bool handleResumeRequest(const char * filename, const char * port, quint64 filePos); - virtual bool event(QEvent *e); + virtual bool event(QEvent * e); virtual KviWindow * dccMarshalOutputWindow(); virtual const char * dccMarshalOutputContextString(); - virtual void displayPaint(QPainter * p,int column, QRect rect); + virtual void displayPaint(QPainter * p, int column, QRect rect); virtual int displayHeight(int iLineSpacing); virtual void fillContextPopup(QMenu * m); - virtual void fillStatusString(QString &szBuffer); + virtual void fillStatusString(QString & szBuffer); virtual bool active(); virtual QString tipText(); virtual QString localFileName(); - bool isFileUpload(){ return m_pDescriptor->isFileUpload(); }; + bool isFileUpload() { return m_pDescriptor->isFileUpload(); }; unsigned int averageSpeed(); unsigned int instantSpeed(); @@ -232,12 +243,13 @@ public: int bandwidthLimit(); void setBandwidthLimit(int iVal); virtual DccThread * getSlaveThread(); + protected: void startConnection(); void listenOrConnect(); - void addToTransferLog(const QString &s); - void outputAndLog(const QString &s); - void outputAndLog(int msgtype,const QString &s); + void addToTransferLog(const QString & s); + void outputAndLog(const QString & s); + void outputAndLog(int msgtype, const QString & s); KviWindow * eventWindow(); protected slots: void connectionInProgress(); diff --git a/src/modules/dcc/DccMarshal.cpp b/src/modules/dcc/DccMarshal.cpp index 0575ab9e5..9f7b9af34 100644 --- a/src/modules/dcc/DccMarshal.cpp +++ b/src/modules/dcc/DccMarshal.cpp @@ -37,16 +37,16 @@ #include DccMarshal::DccMarshal(DccMarshalOutputContext * ctx) -: QObject(0) + : QObject(0) { setObjectName("dcc_marshal"); - m_pSn = 0; - m_fd = KVI_INVALID_SOCKET; - m_pTimeoutTimer = 0; - m_bIPv6 = false; - m_pOutputContext = ctx; + m_pSn = 0; + m_fd = KVI_INVALID_SOCKET; + m_pTimeoutTimer = 0; + m_bIPv6 = false; + m_pOutputContext = ctx; #ifdef COMPILE_SSL_SUPPORT - m_pSSL = 0; + m_pSSL = 0; #endif m_szIp = ""; m_szPort = ""; @@ -88,10 +88,10 @@ void DccMarshal::reset() m_fd = KVI_INVALID_SOCKET; } #ifdef COMPILE_SSL_SUPPORT -// qDebug("MARSHAL RESETTING (SSL=%d)",m_pSSL); + // qDebug("MARSHAL RESETTING (SSL=%d)",m_pSSL); if(m_pSSL) { -// qDebug("MARSHAL CLEARING THE SSL"); + // qDebug("MARSHAL CLEARING THE SSL"); KviSSLMaster::freeSSL(m_pSSL); m_pSSL = 0; } @@ -104,7 +104,7 @@ void DccMarshal::reset() m_bIPv6 = false; } -KviError::Code DccMarshal::dccListen(const QString &ip,const QString &port,bool bUseTimeout,bool bUseSSL) +KviError::Code DccMarshal::dccListen(const QString & ip, const QString & port, bool bUseTimeout, bool bUseSSL) { if(m_fd != KVI_INVALID_SOCKET) return KviError::AnotherConnectionInProgress; @@ -143,7 +143,9 @@ void DccMarshal::doListen() { emit error(KviError::InvalidIpAddress); return; - } else m_bIPv6 = true; + } + else + m_bIPv6 = true; #else emit error(KviError::InvalidIpAddress); return; @@ -166,12 +168,11 @@ void DccMarshal::doListen() } #endif - #ifdef COMPILE_IPV6_SUPPORT m_fd = kvi_socket_create(m_bIPv6 ? KVI_SOCKET_PF_INET6 : KVI_SOCKET_PF_INET, - KVI_SOCKET_TYPE_STREAM,KVI_SOCKET_PROTO_TCP); + KVI_SOCKET_TYPE_STREAM, KVI_SOCKET_PROTO_TCP); #else - m_fd = kvi_socket_create(KVI_SOCKET_PF_INET,KVI_SOCKET_TYPE_STREAM,KVI_SOCKET_PROTO_TCP); + m_fd = kvi_socket_create(KVI_SOCKET_PF_INET, KVI_SOCKET_TYPE_STREAM, KVI_SOCKET_PROTO_TCP); #endif if(m_fd == KVI_INVALID_SOCKET) @@ -183,9 +184,9 @@ void DccMarshal::doListen() if((!KVI_OPTION_BOOL(KviOption_boolUserDefinedPortRange)) || (m_uPort != 0)) { #ifdef COMPILE_IPV6_SUPPORT - KviSockaddr sa(m_szIp.toUtf8().data(),m_uPort,m_bIPv6); + KviSockaddr sa(m_szIp.toUtf8().data(), m_uPort, m_bIPv6); #else - KviSockaddr sa(m_szIp.toUtf8().data(),m_uPort,false); + KviSockaddr sa(m_szIp.toUtf8().data(), m_uPort, false); #endif if(!sa.socketAddress()) @@ -195,22 +196,25 @@ void DccMarshal::doListen() return; } - if(!kvi_socket_bind(m_fd,sa.socketAddress(),sa.addressLength())) + if(!kvi_socket_bind(m_fd, sa.socketAddress(), sa.addressLength())) { reset(); emit error(KviError::BindFailed); return; } - - } else { + } + else + { m_uPort = KVI_OPTION_UINT(KviOption_uintDccMinPort); - if(KVI_OPTION_UINT(KviOption_uintDccMaxPort) > 65535)KVI_OPTION_UINT(KviOption_uintDccMaxPort) = 65535; + if(KVI_OPTION_UINT(KviOption_uintDccMaxPort) > 65535) + KVI_OPTION_UINT(KviOption_uintDccMaxPort) = 65535; bool bBindSuccess; - do { + do + { #ifdef COMPILE_IPV6_SUPPORT - KviSockaddr sa(m_szIp.toUtf8().data(),m_uPort,m_bIPv6); + KviSockaddr sa(m_szIp.toUtf8().data(), m_uPort, m_bIPv6); #else - KviSockaddr sa(m_szIp.toUtf8().data(),m_uPort,false); + KviSockaddr sa(m_szIp.toUtf8().data(), m_uPort, false); #endif if(!sa.socketAddress()) { @@ -219,7 +223,7 @@ void DccMarshal::doListen() return; } - bBindSuccess = kvi_socket_bind(m_fd,sa.socketAddress(),sa.addressLength()); + bBindSuccess = kvi_socket_bind(m_fd, sa.socketAddress(), sa.addressLength()); if(!bBindSuccess) { @@ -240,41 +244,40 @@ void DccMarshal::doListen() emit error(KviError::BindFailed); return; } - } - if(!kvi_socket_listen(m_fd,1)) + if(!kvi_socket_listen(m_fd, 1)) { reset(); emit error(KviError::ListenFailed); return; } - - // Reread the port in case we're binding to a random one (0) +// Reread the port in case we're binding to a random one (0) #ifdef COMPILE_IPV6_SUPPORT - KviSockaddr sareal(0,m_bIPv6); + KviSockaddr sareal(0, m_bIPv6); #else - KviSockaddr sareal(0,false); + KviSockaddr sareal(0, false); #endif - int size = sareal.addressLength(); - if(kvi_socket_getsockname(m_fd,sareal.socketAddress(),&size)) + if(kvi_socket_getsockname(m_fd, sareal.socketAddress(), &size)) { -// qDebug("GETSOCKNAMEOK"); + // qDebug("GETSOCKNAMEOK"); m_szPort.setNum(sareal.port()); m_uPort = sareal.port(); -// qDebug("REALPORT %u",m_uPort); - } else { -// qDebug("GETSOCKNAMEFAILED"); + // qDebug("REALPORT %u",m_uPort); + } + else + { + // qDebug("GETSOCKNAMEFAILED"); } // and setup the READ notifier... - m_pSn = new QSocketNotifier(m_fd,QSocketNotifier::Read); - QObject::connect(m_pSn,SIGNAL(activated(int)),this,SLOT(snActivated(int))); + m_pSn = new QSocketNotifier(m_fd, QSocketNotifier::Read); + QObject::connect(m_pSn, SIGNAL(activated(int)), this, SLOT(snActivated(int))); m_pSn->setEnabled(true); // set the timer @@ -290,7 +293,7 @@ void DccMarshal::doListen() if(m_bUseTimeout) { m_pTimeoutTimer = new QTimer(); - connect(m_pTimeoutTimer,SIGNAL(timeout()),this,SLOT(connectionTimedOut())); + connect(m_pTimeoutTimer, SIGNAL(timeout()), this, SLOT(connectionTimedOut())); m_pTimeoutTimer->setSingleShot(true); m_pTimeoutTimer->setInterval((KVI_OPTION_UINT(KviOption_uintDccSocketTimeout) * 1000)); m_pTimeoutTimer->start(); @@ -300,7 +303,7 @@ void DccMarshal::doListen() emit inProgress(); } -KviError::Code DccMarshal::dccConnect(const char * ip,const char * port,bool bUseTimeout,bool bUseSSL) +KviError::Code DccMarshal::dccConnect(const char * ip, const char * port, bool bUseTimeout, bool bUseSSL) { if(m_fd != KVI_INVALID_SOCKET) return KviError::AnotherConnectionInProgress; @@ -336,7 +339,9 @@ void DccMarshal::doConnect() { emit error(KviError::InvalidIpAddress); return; - } else m_bIPv6 = true; + } + else + m_bIPv6 = true; #else emit error(KviError::InvalidIpAddress); return; @@ -351,14 +356,13 @@ void DccMarshal::doConnect() return; } - - // create the socket +// create the socket #ifdef COMPILE_IPV6_SUPPORT m_fd = kvi_socket_create(m_bIPv6 ? KVI_SOCKET_PF_INET6 : KVI_SOCKET_PF_INET, - KVI_SOCKET_TYPE_STREAM,KVI_SOCKET_PROTO_TCP); + KVI_SOCKET_TYPE_STREAM, KVI_SOCKET_PROTO_TCP); #else m_fd = kvi_socket_create(KVI_SOCKET_PF_INET, - KVI_SOCKET_TYPE_STREAM,KVI_SOCKET_PROTO_TCP); + KVI_SOCKET_TYPE_STREAM, KVI_SOCKET_PROTO_TCP); #endif if(m_fd == KVI_INVALID_SOCKET) { @@ -374,13 +378,12 @@ void DccMarshal::doConnect() return; } - - // fill the sockaddr structure +// fill the sockaddr structure #ifdef COMPILE_IPV6_SUPPORT - KviSockaddr sa(m_szIp.toUtf8().data(),m_uPort,m_bIPv6); + KviSockaddr sa(m_szIp.toUtf8().data(), m_uPort, m_bIPv6); #else - KviSockaddr sa(m_szIp.toUtf8().data(),m_uPort,false); + KviSockaddr sa(m_szIp.toUtf8().data(), m_uPort, false); #endif if(!sa.socketAddress()) @@ -390,34 +393,36 @@ void DccMarshal::doConnect() return; } - if(!kvi_socket_connect(m_fd,sa.socketAddress(),sa.addressLength())) + if(!kvi_socket_connect(m_fd, sa.socketAddress(), sa.addressLength())) { int err = kvi_socket_error(); if(!kvi_socket_recoverableConnectError(err)) { // Ops... - int sockError=err; - if(sockError==0) + int sockError = err; + if(sockError == 0) { // Zero error ?...let's look closer - int iSize=sizeof(int); - if(!kvi_socket_getsockopt(m_fd,SOL_SOCKET,SO_ERROR, - (void *)&sockError,&iSize))sockError=0; + int iSize = sizeof(int); + if(!kvi_socket_getsockopt(m_fd, SOL_SOCKET, SO_ERROR, + (void *)&sockError, &iSize)) + sockError = 0; } // Die reset(); // And declare problems :) - if(sockError)emit error(KviError::translateSystemError(sockError)); - else emit error(KviError::UnknownError); //Error 0 ? + if(sockError) + emit error(KviError::translateSystemError(sockError)); + else + emit error(KviError::UnknownError); //Error 0 ? return; } } - // and setup the WRITE notifier... - m_pSn = new QSocketNotifier(m_fd,QSocketNotifier::Write); - QObject::connect(m_pSn,SIGNAL(activated(int)),this,SLOT(snActivated(int))); + m_pSn = new QSocketNotifier(m_fd, QSocketNotifier::Write); + QObject::connect(m_pSn, SIGNAL(activated(int)), this, SLOT(snActivated(int))); m_pSn->setEnabled(true); // set the timer @@ -433,7 +438,7 @@ void DccMarshal::doConnect() if(m_bUseTimeout) { m_pTimeoutTimer = new QTimer(); - connect(m_pTimeoutTimer,SIGNAL(timeout()),this,SLOT(connectionTimedOut())); + connect(m_pTimeoutTimer, SIGNAL(timeout()), this, SLOT(connectionTimedOut())); m_pTimeoutTimer->setSingleShot(true); m_pTimeoutTimer->setInterval(KVI_OPTION_UINT(KviOption_uintDccSocketTimeout) * 1000); m_pTimeoutTimer->start(); @@ -443,7 +448,6 @@ void DccMarshal::doConnect() emit inProgress(); } - void DccMarshal::snActivated(int) { if(m_pTimeoutTimer) @@ -454,7 +458,7 @@ void DccMarshal::snActivated(int) #ifdef COMPILE_IPV6_SUPPORT struct sockaddr_in6 hostSockAddr6; #endif - struct sockaddr_in hostSockAddr; + struct sockaddr_in hostSockAddr; int size = sizeof(hostSockAddr); struct sockaddr * addr = (struct sockaddr *)&hostSockAddr; @@ -472,14 +476,17 @@ void DccMarshal::snActivated(int) // outgoing connection (we have called connect()) // Check for errors... int sockError; - int iSize=sizeof(int); - if(!kvi_socket_getsockopt(m_fd,SOL_SOCKET,SO_ERROR,(void *)&sockError,&iSize))sockError = -1; + int iSize = sizeof(int); + if(!kvi_socket_getsockopt(m_fd, SOL_SOCKET, SO_ERROR, (void *)&sockError, &iSize)) + sockError = -1; if(sockError != 0) { //failed KviError::Code eError; - if(sockError > 0)eError = KviError::translateSystemError(sockError); - else eError = KviError::UnknownError; //Error 0 ? + if(sockError > 0) + eError = KviError::translateSystemError(sockError); + else + eError = KviError::UnknownError; //Error 0 ? reset(); emit error(eError); return; @@ -488,29 +495,35 @@ void DccMarshal::snActivated(int) delete m_pSn; m_pSn = 0; // get the local address - if(!kvi_socket_getsockname(m_fd,addr,&size)) + if(!kvi_socket_getsockname(m_fd, addr, &size)) { m_szSecondaryIp = "localhost"; - m_szSecondaryPort = __tr2qs_ctx("unknown","dcc"); - } else { + m_szSecondaryPort = __tr2qs_ctx("unknown", "dcc"); + } + else + { #ifdef COMPILE_IPV6_SUPPORT if(m_bIPv6) { m_szSecondaryPort.setNum(ntohs(((struct sockaddr_in6 *)addr)->sin6_port)); - if(!KviNetUtils::binaryIpToStringIp_V6(((struct sockaddr_in6 *)addr)->sin6_addr,m_szSecondaryIp)) + if(!KviNetUtils::binaryIpToStringIp_V6(((struct sockaddr_in6 *)addr)->sin6_addr, m_szSecondaryIp)) m_szSecondaryIp = "localhost"; - } else { + } + else + { #endif m_szSecondaryPort.setNum(ntohs(((struct sockaddr_in *)addr)->sin_port)); - if(!KviNetUtils::binaryIpToStringIp(((struct sockaddr_in *)addr)->sin_addr,m_szSecondaryIp)) + if(!KviNetUtils::binaryIpToStringIp(((struct sockaddr_in *)addr)->sin_addr, m_szSecondaryIp)) m_szSecondaryIp = "localhost"; #ifdef COMPILE_IPV6_SUPPORT } #endif } - } else { + } + else + { // Incoming connection - int newsock = kvi_socket_accept(m_fd,addr,&size); + int newsock = kvi_socket_accept(m_fd, addr, &size); if(newsock != KVI_INVALID_SOCKET) { // Connected @@ -520,13 +533,15 @@ void DccMarshal::snActivated(int) if(m_bIPv6) { m_szSecondaryPort.setNum(ntohs(((struct sockaddr_in6 *)addr)->sin6_port)); - if(!KviNetUtils::binaryIpToStringIp_V6(((struct sockaddr_in6 *)addr)->sin6_addr,m_szSecondaryIp)) - m_szSecondaryIp = __tr2qs_ctx("unknown","dcc"); - } else { + if(!KviNetUtils::binaryIpToStringIp_V6(((struct sockaddr_in6 *)addr)->sin6_addr, m_szSecondaryIp)) + m_szSecondaryIp = __tr2qs_ctx("unknown", "dcc"); + } + else + { #endif m_szSecondaryPort.setNum(ntohs(((struct sockaddr_in *)addr)->sin_port)); - if(!KviNetUtils::binaryIpToStringIp(((struct sockaddr_in *)addr)->sin_addr,m_szSecondaryIp)) - m_szSecondaryIp = __tr2qs_ctx("unknown","dcc"); + if(!KviNetUtils::binaryIpToStringIp(((struct sockaddr_in *)addr)->sin_addr, m_szSecondaryIp)) + m_szSecondaryIp = __tr2qs_ctx("unknown", "dcc"); #ifdef COMPILE_IPV6_SUPPORT } #endif @@ -538,8 +553,9 @@ void DccMarshal::snActivated(int) emit error(KviError::AsyncSocketFailed); return; } - - } else { + } + else + { // Huh ?.. wait for the next notifier call return; } @@ -549,13 +565,15 @@ void DccMarshal::snActivated(int) // SSL Handshake needed ? if(m_bUseSSL) { - m_pSSL = KviSSLMaster::allocSSL(m_pOutputContext->dccMarshalOutputWindow(),m_fd,m_bOutgoing ? KviSSL::Client : KviSSL::Server,m_pOutputContext->dccMarshalOutputContextString()); + m_pSSL = KviSSLMaster::allocSSL(m_pOutputContext->dccMarshalOutputWindow(), m_fd, m_bOutgoing ? KviSSL::Client : KviSSL::Server, m_pOutputContext->dccMarshalOutputContextString()); if(m_pSSL) { emit startingSSLHandshake(); doSSLHandshake(0); - } else { + } + else + { reset(); emit error(KviError::SSLError); } @@ -569,7 +587,7 @@ void DccMarshal::snActivated(int) void DccMarshal::doSSLHandshake(int) { #ifdef COMPILE_SSL_SUPPORT -// qDebug("DO SSL HANDSHAKE"); + // qDebug("DO SSL HANDSHAKE"); if(m_pSn) { delete m_pSn; @@ -590,24 +608,24 @@ void DccMarshal::doSSLHandshake(int) { case KviSSL::Success: // done! -// qDebug("EMITTING CONNECTED"); + // qDebug("EMITTING CONNECTED"); emit connected(); -// qDebug("CONNECTED EMITTED"); - break; + // qDebug("CONNECTED EMITTED"); + break; case KviSSL::WantRead: - m_pSn = new QSocketNotifier((int)m_fd,QSocketNotifier::Read); - QObject::connect(m_pSn,SIGNAL(activated(int)),this,SLOT(doSSLHandshake(int))); + m_pSn = new QSocketNotifier((int)m_fd, QSocketNotifier::Read); + QObject::connect(m_pSn, SIGNAL(activated(int)), this, SLOT(doSSLHandshake(int))); m_pSn->setEnabled(true); - break; + break; case KviSSL::WantWrite: - m_pSn = new QSocketNotifier((int)m_fd,QSocketNotifier::Write); - QObject::connect(m_pSn,SIGNAL(activated(int)),this,SLOT(doSSLHandshake(int))); + m_pSn = new QSocketNotifier((int)m_fd, QSocketNotifier::Write); + QObject::connect(m_pSn, SIGNAL(activated(int)), this, SLOT(doSSLHandshake(int))); m_pSn->setEnabled(true); - break; + break; case KviSSL::RemoteEndClosedConnection: reset(); emit error(KviError::RemoteEndClosedConnection); - break; + break; case KviSSL::SyscallError: { // syscall problem @@ -615,11 +633,13 @@ void DccMarshal::doSSLHandshake(int) if(kvi_socket_recoverableError(err)) { // can recover ? (EAGAIN, EINTR ?) - m_pSn = new QSocketNotifier((int)m_fd,QSocketNotifier::Write); - QObject::connect(m_pSn,SIGNAL(activated(int)),this,SLOT(doSSLHandshake(int))); + m_pSn = new QSocketNotifier((int)m_fd, QSocketNotifier::Write); + QObject::connect(m_pSn, SIGNAL(activated(int)), this, SLOT(doSSLHandshake(int))); m_pSn->setEnabled(true); return; - } else { + } + else + { // Declare problems :) reset(); emit error(err ? KviError::translateSystemError(err) : KviError::UnknownError); @@ -629,7 +649,8 @@ void DccMarshal::doSSLHandshake(int) default: { KviCString buffer; - while(m_pSSL->getLastErrorString(buffer))emit sslError(buffer.ptr()); + while(m_pSSL->getLastErrorString(buffer)) + emit sslError(buffer.ptr()); reset(); emit error(KviError::SSLError); } diff --git a/src/modules/dcc/DccMarshal.h b/src/modules/dcc/DccMarshal.h index d60e86342..b9a3e17b1 100644 --- a/src/modules/dcc/DccMarshal.h +++ b/src/modules/dcc/DccMarshal.h @@ -37,16 +37,17 @@ class KviWindow; class DccMarshal; #ifdef COMPILE_SSL_SUPPORT - #include "KviSSLMaster.h" +#include "KviSSLMaster.h" #endif - class DccMarshalOutputContext { friend class DccMarshal; + public: DccMarshalOutputContext(){}; virtual ~DccMarshalOutputContext(){}; + protected: virtual KviWindow * dccMarshalOutputWindow() = 0; virtual const char * dccMarshalOutputContextString() = 0; @@ -58,26 +59,28 @@ class DccMarshal : public QObject public: DccMarshal(DccMarshalOutputContext * ctx); ~DccMarshal(); + protected: // DCC DESCRIPTOR - QString m_szIp; // Dcc initiator ip address (the one that listens) - QString m_szPort; // Dcc initiator port (the one that listens) + QString m_szIp; // Dcc initiator ip address (the one that listens) + QString m_szPort; // Dcc initiator port (the one that listens) // other info - bool m_bIPv6; // Dcc mode - kvi_u32_t m_uPort; // Dcc initiator port - bool m_bOutgoing; // true if WE have connected to the remote host (so m_szIp is the remote host ip) - QString m_szSecondaryIp; // Ip of the client that has connected to the remote host - QString m_szSecondaryPort; // Port of the client that has connected to the remote host + bool m_bIPv6; // Dcc mode + kvi_u32_t m_uPort; // Dcc initiator port + bool m_bOutgoing; // true if WE have connected to the remote host (so m_szIp is the remote host ip) + QString m_szSecondaryIp; // Ip of the client that has connected to the remote host + QString m_szSecondaryPort; // Port of the client that has connected to the remote host // internals - kvi_socket_t m_fd; // socket - QSocketNotifier * m_pSn; - bool m_bUseTimeout; - QTimer * m_pTimeoutTimer; + kvi_socket_t m_fd; // socket + QSocketNotifier * m_pSn; + bool m_bUseTimeout; + QTimer * m_pTimeoutTimer; #ifdef COMPILE_SSL_SUPPORT - KviSSL * m_pSSL; - bool m_bUseSSL; + KviSSL * m_pSSL; + bool m_bUseSSL; #endif DccMarshalOutputContext * m_pOutputContext; + public: const QString & dccIp() const { return m_szIp; }; const QString & dccPort() const { return m_szPort; }; @@ -85,21 +88,22 @@ public: const QString & localPort() const { return m_bOutgoing ? m_szSecondaryPort : m_szPort; }; const QString & remoteIp() const { return m_bOutgoing ? m_szIp : m_szSecondaryIp; }; const QString & remotePort() const { return m_bOutgoing ? m_szPort : m_szSecondaryPort; }; - KviError::Code dccListen(const QString &ip,const QString &port,bool bUseTimeout,bool bUseSSL = false); - KviError::Code dccConnect(const char * ip,const char * port,bool bUseTimeout,bool bUseSSL = false); + KviError::Code dccListen(const QString & ip, const QString & port, bool bUseTimeout, bool bUseSSL = false); + KviError::Code dccConnect(const char * ip, const char * port, bool bUseTimeout, bool bUseSSL = false); kvi_socket_t releaseSocket(); #ifdef COMPILE_SSL_SUPPORT KviSSL * releaseSSL(); #endif void abort(); + private: void reset(); -//#ifdef COMPILE_SSL_SUPPORT -// bool trySSLCertificate(); -//#endif + //#ifdef COMPILE_SSL_SUPPORT + // bool trySSLCertificate(); + //#endif private slots: void doSSLHandshake(int); -// void doListenSSLHandshake(); + // void doListenSSLHandshake(); void snActivated(int); void connectionTimedOut(); void doListen(); @@ -112,5 +116,4 @@ signals: void error(KviError::Code); }; - #endif //_MARSHAL_H_ diff --git a/src/modules/dcc/DccThread.cpp b/src/modules/dcc/DccThread.cpp index a2ace585e..d3ec9af52 100644 --- a/src/modules/dcc/DccThread.cpp +++ b/src/modules/dcc/DccThread.cpp @@ -33,28 +33,30 @@ #include "kvi_socket.h" #ifdef COMPILE_SSL_SUPPORT - #include "KviSSLMaster.h" +#include "KviSSLMaster.h" #endif -DccThread::DccThread(QObject * par,kvi_socket_t fd) -: KviSensitiveThread() +DccThread::DccThread(QObject * par, kvi_socket_t fd) + : KviSensitiveThread() { - m_pParent = par; - m_fd = fd; - m_pMutex = new KviMutex(); + m_pParent = par; + m_fd = fd; + m_pMutex = new KviMutex(); #ifdef COMPILE_SSL_SUPPORT -// qDebug("CLEARING SSL IN DccThread constructor"); - m_pSSL = 0; + // qDebug("CLEARING SSL IN DccThread constructor"); + m_pSSL = 0; #endif } DccThread::~DccThread() { #ifdef COMPILE_SSL_SUPPORT - if(m_pSSL)KviSSLMaster::freeSSL(m_pSSL); + if(m_pSSL) + KviSSLMaster::freeSSL(m_pSSL); m_pSSL = 0; #endif - if(m_fd != KVI_INVALID_SOCKET)kvi_socket_close(m_fd); + if(m_fd != KVI_INVALID_SOCKET) + kvi_socket_close(m_fd); KVI_ASSERT(!m_pMutex->locked()); delete m_pMutex; } @@ -62,7 +64,8 @@ DccThread::~DccThread() #ifdef COMPILE_SSL_SUPPORT void DccThread::setSSL(KviSSL * s) { - if(m_pSSL)KviSSLMaster::freeSSL(m_pSSL); + if(m_pSSL) + KviSSLMaster::freeSSL(m_pSSL); m_pSSL = s; } #endif @@ -75,7 +78,9 @@ bool DccThread::handleInvalidSocketRead(int readLen) // connection closed postErrorEvent(KviError::RemoteEndClosedConnection); return false; - } else { + } + else + { // error ? int err = kvi_socket_error(); if((err != EINTR) && (err != EAGAIN)) @@ -93,7 +98,7 @@ void DccThread::raiseSSLError() KviCString buffer; while(m_pSSL->getLastErrorString(buffer)) { - KviCString msg(KviCString::Format,"[SSL ERROR]: %s",buffer.ptr()); + KviCString msg(KviCString::Format, "[SSL ERROR]: %s", buffer.ptr()); postMessageEvent(msg.ptr()); } } @@ -103,12 +108,12 @@ void DccThread::postErrorEvent(int err) { KviThreadDataEvent * e = new KviThreadDataEvent(KVI_DCC_THREAD_EVENT_ERROR); e->setData(new int(err)); - postEvent(m_pParent,e); + postEvent(m_pParent, e); } void DccThread::postMessageEvent(const char * message) { KviThreadDataEvent * e = new KviThreadDataEvent(KVI_DCC_THREAD_EVENT_MESSAGE); e->setData(new KviCString(message)); - postEvent(m_pParent,e); + postEvent(m_pParent, e); } diff --git a/src/modules/dcc/DccThread.h b/src/modules/dcc/DccThread.h index 55041ed6e..25f6fc4fd 100644 --- a/src/modules/dcc/DccThread.h +++ b/src/modules/dcc/DccThread.h @@ -32,7 +32,7 @@ #include #ifdef COMPILE_SSL_SUPPORT - #include "KviSSL.h" +#include "KviSSL.h" #endif // KviThreadDataEvent @@ -48,26 +48,28 @@ typedef struct _KviDccThreadIncomingData { - int iLen; + int iLen; char * buffer; } KviDccThreadIncomingData; class DccThread : public KviSensitiveThread { public: - DccThread(QObject * par,kvi_socket_t fd); + DccThread(QObject * par, kvi_socket_t fd); ~DccThread(); + protected: - KviMutex * m_pMutex; // OWNED! PROTECTS m_pOutBuffers - kvi_socket_t m_fd; - QObject * m_pParent; // READ ONLY! + KviMutex * m_pMutex; // OWNED! PROTECTS m_pOutBuffers + kvi_socket_t m_fd; + QObject * m_pParent; // READ ONLY! #ifdef COMPILE_SSL_SUPPORT - KviSSL * m_pSSL; + KviSSL * m_pSSL; #endif protected: bool handleInvalidSocketRead(int readLen); + public: - QObject * parent(){ return m_pParent; }; + QObject * parent() { return m_pParent; }; void postErrorEvent(int err); // Warning!..newer call __tr() here!...use __tr_no_lookup() void postMessageEvent(const char * message); diff --git a/src/modules/dcc/DccUtils.cpp b/src/modules/dcc/DccUtils.cpp index 6d491b8f5..878f5ebd9 100644 --- a/src/modules/dcc/DccUtils.cpp +++ b/src/modules/dcc/DccUtils.cpp @@ -102,7 +102,7 @@ bool dcc_module_get_listen_ip_address(KviCommand *c,KviConsoleWindow * pConsole, } */ -bool dcc_kvs_get_listen_ip_address(KviKvsModuleCommandCall *c,KviConsoleWindow * pConsole,QString &szListenIp) +bool dcc_kvs_get_listen_ip_address(KviKvsModuleCommandCall * c, KviConsoleWindow * pConsole, QString & szListenIp) { // // Find an interface suitable for listening.... @@ -116,16 +116,19 @@ bool dcc_kvs_get_listen_ip_address(KviKvsModuleCommandCall *c,KviConsoleWindow * { if(KviNetUtils::isValidStringIp(KVI_OPTION_STRING(KviOption_stringDccListenDefaultInterface).toUtf8().data())) { - if(KviQString::equalCI(KVI_OPTION_STRING(KviOption_stringDccListenDefaultInterface),"0.0.0.0")) + if(KviQString::equalCI(KVI_OPTION_STRING(KviOption_stringDccListenDefaultInterface), "0.0.0.0")) { // Try to find the first available IPv4 interface if(!kvi_getLocalHostAddress(szListenIp)) { - if(c)c->warning(__tr2qs_ctx("Can't retrieve a suitable local IPv4 address","dcc"), - KVI_OPTION_STRING(KviOption_stringDccListenDefaultInterface).toUtf8().data()); + if(c) + c->warning(__tr2qs_ctx("Can't retrieve a suitable local IPv4 address", "dcc"), + KVI_OPTION_STRING(KviOption_stringDccListenDefaultInterface).toUtf8().data()); return false; } - } else { + } + else + { szListenIp = KVI_OPTION_STRING(KviOption_stringDccListenDefaultInterface); } return true; @@ -134,20 +137,25 @@ bool dcc_kvs_get_listen_ip_address(KviKvsModuleCommandCall *c,KviConsoleWindow * if(KviNetUtils::isValidStringIPv6(KVI_OPTION_STRING(KviOption_stringDccListenDefaultInterface).toUtf8().data())) { szListenIp = KVI_OPTION_STRING(KviOption_stringDccListenDefaultInterface); - } else { + } + else + { #endif - if(!KviNetUtils::getInterfaceAddress(KVI_OPTION_STRING(KviOption_stringDccListenDefaultInterface),szListenIp)) + if(!KviNetUtils::getInterfaceAddress(KVI_OPTION_STRING(KviOption_stringDccListenDefaultInterface), szListenIp)) { KVI_OPTION_BOOL(KviOption_boolDccListenOnSpecifiedInterfaceByDefault) = false; - if(c)c->warning(__tr2qs_ctx("Can't listen on default interface '%s': fix it in the options dialog, disabling the option (so the next DCC will work)","dcc"), - KVI_OPTION_STRING(KviOption_stringDccListenDefaultInterface).toUtf8().data()); + if(c) + c->warning(__tr2qs_ctx("Can't listen on default interface '%s': fix it in the options dialog, disabling the option (so the next DCC will work)", "dcc"), + KVI_OPTION_STRING(KviOption_stringDccListenDefaultInterface).toUtf8().data()); return false; } #ifdef COMPILE_IPV6_SUPPORT } #endif return true; - } else { + } + else + { // the option was empty.. disable it KVI_OPTION_BOOL(KviOption_boolDccListenOnSpecifiedInterfaceByDefault) = false; } @@ -158,11 +166,15 @@ bool dcc_kvs_get_listen_ip_address(KviKvsModuleCommandCall *c,KviConsoleWindow * if(pConsole->isConnected()) { //#warning "The IPV6 choice is not OK here.... and maybe allow to bind to specified ports" - pConsole->connection()->link()->socket()->getLocalHostIp(szListenIp,pConsole->isIPv6Connection()); - } else { + pConsole->connection()->link()->socket()->getLocalHostIp(szListenIp, pConsole->isIPv6Connection()); + } + else + { szListenIp = "0.0.0.0"; // huh ? :) } - } else { + } + else + { szListenIp = "0.0.0.0"; } diff --git a/src/modules/dcc/DccUtils.h b/src/modules/dcc/DccUtils.h index 150e88de6..6020557ee 100644 --- a/src/modules/dcc/DccUtils.h +++ b/src/modules/dcc/DccUtils.h @@ -30,7 +30,7 @@ #include "KviKvsModuleInterface.h" #ifndef _UTILS_CPP_ - extern bool dcc_kvs_get_listen_ip_address(KviKvsModuleCommandCall *c,KviConsoleWindow * pConsole,QString &szListenIp); +extern bool dcc_kvs_get_listen_ip_address(KviKvsModuleCommandCall * c, KviConsoleWindow * pConsole, QString & szListenIp); #endif #endif //_UTILS_H_ diff --git a/src/modules/dcc/DccVideoWindow.cpp b/src/modules/dcc/DccVideoWindow.cpp index 546043804..3cedf19af 100644 --- a/src/modules/dcc/DccVideoWindow.cpp +++ b/src/modules/dcc/DccVideoWindow.cpp @@ -48,11 +48,11 @@ #include #ifdef COMPILE_CRYPT_SUPPORT - #include "KviCryptController.h" +#include "KviCryptController.h" #endif #ifdef COMPILE_SSL_SUPPORT - #include "KviSSLMaster.h" +#include "KviSSLMaster.h" #endif #include @@ -63,10 +63,10 @@ extern DccBroker * g_pDccBroker; bool kvi_dcc_video_is_valid_codec(const char * codecName) { - if(kvi_strEqualCI("sjpeg",codecName)) + if(kvi_strEqualCI("sjpeg", codecName)) return true; #ifndef COMPILE_DISABLE_OGG_THEORA - if(kvi_strEqualCI("theora",codecName)) + if(kvi_strEqualCI("theora", codecName)) return true; #endif return false; @@ -76,15 +76,14 @@ static DccVideoCodec * kvi_dcc_video_get_codec(const char * codecName) { Q_UNUSED(codecName); #ifndef COMPILE_DISABLE_OGG_THEORA - if(kvi_strEqualCI("theora",codecName)) + if(kvi_strEqualCI("theora", codecName)) return new DccVideoTheoraCodec(); #endif return new DccVideoSJpegCodec(); } - -DccVideoThread::DccVideoThread(KviWindow * wnd,kvi_socket_t fd,KviDccVideoThreadOptions * opt) -: DccThread(wnd,fd) +DccVideoThread::DccVideoThread(KviWindow * wnd, kvi_socket_t fd, KviDccVideoThreadOptions * opt) + : DccThread(wnd, fd) { m_pOpt = opt; m_bPlaying = false; @@ -104,25 +103,28 @@ DccVideoThread::~DccVideoThread() bool DccVideoThread::readWriteStep() { -// qDebug("DccVideoThread::readWriteStep()"); + // qDebug("DccVideoThread::readWriteStep()"); // Socket management bool bCanRead; bool bCanWrite; - if(kvi_select(m_fd,&bCanRead,&bCanWrite)) + if(kvi_select(m_fd, &bCanRead, &bCanWrite)) { while(bCanRead) { unsigned int actualSize = m_inFrameBuffer.size(); m_inFrameBuffer.resize(actualSize + 16384); - int readLen = kvi_socket_recv(m_fd,(void *)(m_inFrameBuffer.data() + actualSize),16384); + int readLen = kvi_socket_recv(m_fd, (void *)(m_inFrameBuffer.data() + actualSize), 16384); if(readLen > 0) { - if(readLen < 16384)m_inFrameBuffer.resize(actualSize + readLen); - m_pOpt->pCodec->decode(&m_inFrameBuffer,&m_videoInSignalBuffer,&m_textInSignalBuffer); - } else { - bCanRead=false; -// if(!handleInvalidSocketRead(readLen))return false; + if(readLen < 16384) + m_inFrameBuffer.resize(actualSize + readLen); + m_pOpt->pCodec->decode(&m_inFrameBuffer, &m_videoInSignalBuffer, &m_textInSignalBuffer); + } + else + { + bCanRead = false; + // if(!handleInvalidSocketRead(readLen))return false; m_inFrameBuffer.resize(actualSize); } } @@ -132,12 +134,15 @@ bool DccVideoThread::readWriteStep() // Have somethihg to write ? if(m_outFrameBuffer.size() > 0) { - int written = kvi_socket_send(m_fd,m_outFrameBuffer.data(),m_outFrameBuffer.size()); + int written = kvi_socket_send(m_fd, m_outFrameBuffer.data(), m_outFrameBuffer.size()); if(written > 0) { m_outFrameBuffer.remove(written); - } else { - if(!handleInvalidSocketRead(written))return false; + } + else + { + if(!handleInvalidSocketRead(written)) + return false; } } } @@ -147,7 +152,7 @@ bool DccVideoThread::readWriteStep() bool DccVideoThread::videoStep() { -// qDebug("DccVideoThread::videoStep()"); + // qDebug("DccVideoThread::videoStep()"); // Are we playing ? if(m_bPlaying) @@ -164,17 +169,17 @@ bool DccVideoThread::videoStep() // Are we recording ? if(m_bRecording) { - QImage * pImage = ((DccVideoWindow*)parent())->m_pCameraImage; + QImage * pImage = ((DccVideoWindow *)parent())->m_pCameraImage; if(pImage) { // grab the frame - m_videoOutSignalBuffer.append((const unsigned char*) pImage->bits(), pImage->byteCount()); - m_pOpt->pCodec->encodeVideo(&m_videoOutSignalBuffer,&m_outFrameBuffer); + m_videoOutSignalBuffer.append((const unsigned char *)pImage->bits(), pImage->byteCount()); + m_pOpt->pCodec->encodeVideo(&m_videoOutSignalBuffer, &m_outFrameBuffer); // tell our parent to prepare a new frame KviThreadDataEvent * e = new KviThreadDataEvent(KVI_DCC_THREAD_EVENT_ACTION); e->setData(new int(KVI_DCC_VIDEO_THREAD_ACTION_GRAB_FRAME)); - postEvent(DccThread::parent(),e); + postEvent(DccThread::parent(), e); } } return true; @@ -182,7 +187,7 @@ bool DccVideoThread::videoStep() bool DccVideoThread::textStep() { -// qDebug("DccVideoThread::textStep()"); + // qDebug("DccVideoThread::textStep()"); // Are we playing ? if(m_bPlaying) { @@ -190,9 +195,9 @@ bool DccVideoThread::textStep() { KviDccThreadIncomingData data; data.iLen = m_textInSignalBuffer.size(); - data.buffer = (char*) KviMemory::allocate(data.iLen); + data.buffer = (char *)KviMemory::allocate(data.iLen); memcpy(data.buffer, m_textInSignalBuffer.data(), data.iLen); - handleIncomingData(&data,false); + handleIncomingData(&data, false); m_textInSignalBuffer.clear(); } @@ -201,20 +206,20 @@ bool DccVideoThread::textStep() // Are we recording ? if(m_bRecording) { - if(((DccVideoWindow*)parent())->m_tmpTextDataOut.size()) + if(((DccVideoWindow *)parent())->m_tmpTextDataOut.size()) { - m_textOutSignalBuffer.append((const unsigned char*) ((DccVideoWindow*)parent())->m_tmpTextDataOut.constData(), ((DccVideoWindow*)parent())->m_tmpTextDataOut.size()); - ((DccVideoWindow*)parent())->m_tmpTextDataOut.clear(); + m_textOutSignalBuffer.append((const unsigned char *)((DccVideoWindow *)parent())->m_tmpTextDataOut.constData(), ((DccVideoWindow *)parent())->m_tmpTextDataOut.size()); + ((DccVideoWindow *)parent())->m_tmpTextDataOut.clear(); } if(m_textOutSignalBuffer.size()) - m_pOpt->pCodec->encodeText(&m_textOutSignalBuffer,&m_outFrameBuffer); + m_pOpt->pCodec->encodeText(&m_textOutSignalBuffer, &m_outFrameBuffer); } return true; } -bool DccVideoThread::handleIncomingData(KviDccThreadIncomingData * data,bool bCritical) +bool DccVideoThread::handleIncomingData(KviDccThreadIncomingData * data, bool bCritical) { //qDebug("DccVideoThread::handleIncomingData"); KVI_ASSERT(data->iLen); @@ -228,34 +233,39 @@ bool DccVideoThread::handleIncomingData(KviDccThreadIncomingData * data,bool bCr KviThreadDataEvent * e = new KviThreadDataEvent(KVI_DCC_THREAD_EVENT_DATA); // The left part is len chars long int len = aux - data->buffer; -// qDebug("LEN = %d, iLen = %d",len,data->iLen); -//#warning "DO IT BETTER (the \r cutting)" - KviCString * s = new KviCString(data->buffer,len); - if(s->lastCharIs('\r'))s->cutRight(1); + // qDebug("LEN = %d, iLen = %d",len,data->iLen); + //#warning "DO IT BETTER (the \r cutting)" + KviCString * s = new KviCString(data->buffer, len); + if(s->lastCharIs('\r')) + s->cutRight(1); e->setData(s); // but we cut also \n (or \0) ++aux; // so len += 1; --> new data->iLen -= len; data->iLen -= (len + 1); -// qDebug("iLen now = %d",data->iLen); + // qDebug("iLen now = %d",data->iLen); KVI_ASSERT(data->iLen >= 0); if(data->iLen > 0) { // memmove the remaining part to the beginning // aux points after \n or \0 - KviMemory::move(data->buffer,aux,data->iLen); - data->buffer = (char *)KviMemory::reallocate(data->buffer,data->iLen); + KviMemory::move(data->buffer, aux, data->iLen); + data->buffer = (char *)KviMemory::reallocate(data->buffer, data->iLen); end = data->buffer + data->iLen; aux = data->buffer; - } else { + } + else + { // no more data in the buffer KVI_ASSERT(data->iLen == 0); KviMemory::free(data->buffer); data->buffer = end = aux = 0; } - postEvent(parent(),e); - } else aux++; -// qDebug("PASSING CHAR %c",*aux); + postEvent(parent(), e); + } + else + aux++; + // qDebug("PASSING CHAR %c",*aux); } // now aux == end if(bCritical) @@ -265,13 +275,14 @@ bool DccVideoThread::handleIncomingData(KviDccThreadIncomingData * data,bool bCr { // in the last part there are no NULL and \n chars KviThreadDataEvent * e = new KviThreadDataEvent(KVI_DCC_THREAD_EVENT_DATA); - KviCString * s = new KviCString(data->buffer,data->iLen); - if(s->lastCharIs('\r'))s->cutRight(1); + KviCString * s = new KviCString(data->buffer, data->iLen); + if(s->lastCharIs('\r')) + s->cutRight(1); e->setData(s); data->iLen = 0; KviMemory::free(data->buffer); data->buffer = 0; - postEvent(parent(),e); + postEvent(parent(), e); } } return true; @@ -279,7 +290,7 @@ bool DccVideoThread::handleIncomingData(KviDccThreadIncomingData * data,bool bCr void DccVideoThread::restartRecording(int iDevice, int iInput, int) { - m_bRecording=false; + m_bRecording = false; /* if(!g_pVideoDevicePool) g_pVideoDevicePool = Kopete::AV::VideoDevicePool::self(); @@ -291,21 +302,22 @@ void DccVideoThread::restartRecording(int iDevice, int iInput, int) g_pVideoDevicePool->selectInput(iInput); g_pVideoDevicePool->startCapturing(); */ - m_bRecording=true; + m_bRecording = true; } void DccVideoThread::startRecording() { //qDebug("Start recording"); - if(m_bRecording)return; // already started + if(m_bRecording) + return; // already started //ensure capturing -// g_pVideoDevicePool->startCapturing(); + // g_pVideoDevicePool->startCapturing(); //qDebug("Posting event"); KviThreadDataEvent * e = new KviThreadDataEvent(KVI_DCC_THREAD_EVENT_ACTION); e->setData(new int(KVI_DCC_VIDEO_THREAD_ACTION_START_RECORDING)); - postEvent(DccThread::parent(),e); + postEvent(DccThread::parent(), e); m_bRecording = true; } @@ -313,11 +325,12 @@ void DccVideoThread::startRecording() void DccVideoThread::stopRecording() { //qDebug("Stop recording"); - if(!m_bRecording)return; // already stopped + if(!m_bRecording) + return; // already stopped KviThreadDataEvent * e = new KviThreadDataEvent(KVI_DCC_THREAD_EVENT_ACTION); e->setData(new int(KVI_DCC_VIDEO_THREAD_ACTION_STOP_RECORDING)); - postEvent(DccThread::parent(),e); + postEvent(DccThread::parent(), e); m_bRecording = false; } @@ -325,22 +338,24 @@ void DccVideoThread::stopRecording() void DccVideoThread::startPlaying() { //qDebug("Start playing"); - if(m_bPlaying)return; + if(m_bPlaying) + return; KviThreadDataEvent * e = new KviThreadDataEvent(KVI_DCC_THREAD_EVENT_ACTION); e->setData(new int(KVI_DCC_VIDEO_THREAD_ACTION_START_PLAYING)); - postEvent(DccThread::parent(),e); + postEvent(DccThread::parent(), e); m_bPlaying = true; } void DccVideoThread::stopPlaying() { //qDebug("Stop playing"); - if(!m_bPlaying)return; + if(!m_bPlaying) + return; KviThreadDataEvent * e = new KviThreadDataEvent(KVI_DCC_THREAD_EVENT_ACTION); e->setData(new int(KVI_DCC_VIDEO_THREAD_ACTION_STOP_PLAYING)); - postEvent(DccThread::parent(),e); + postEvent(DccThread::parent(), e); m_bPlaying = false; } @@ -356,36 +371,43 @@ void DccVideoThread::run() { delete e; goto exit_dcc; - } else if(e->id() == KVI_DCC_THREAD_EVENT_ACTION) + } + else if(e->id() == KVI_DCC_THREAD_EVENT_ACTION) { int * act = ((KviThreadDataEvent *)e)->getData(); - if(*act)startRecording(); - else stopRecording(); + if(*act) + startRecording(); + else + stopRecording(); delete act; delete e; - } else { + } + else + { // Other events are senseless to us delete e; } } - if(!readWriteStep())goto exit_dcc; - if(!videoStep())goto exit_dcc; - if(!textStep())goto exit_dcc; + if(!readWriteStep()) + goto exit_dcc; + if(!videoStep()) + goto exit_dcc; + if(!textStep()) + goto exit_dcc; - usleep(FRAME_DURATION*1000); + usleep(FRAME_DURATION * 1000); //qDebug("in %d out %d in_sig %d out_sig %d", m_inFrameBuffer.size(), m_outFrameBuffer.size(), m_videoInSignalBuffer.size(), m_videoOutSignalBuffer.size()); } - exit_dcc: kvi_socket_close(m_fd); m_fd = KVI_INVALID_SOCKET; } -DccVideoWindow::DccVideoWindow(DccDescriptor * dcc,const char * name) -: DccWindow(KviWindow::DccVideo,name,dcc) +DccVideoWindow::DccVideoWindow(DccDescriptor * dcc, const char * name) + : DccWindow(KviWindow::DccVideo, name, dcc) { m_pDescriptor = dcc; m_pSlaveThread = 0; @@ -395,7 +417,7 @@ DccVideoWindow::DccVideoWindow(DccDescriptor * dcc,const char * name) m_pLabel = new KviThemedLabel(m_pButtonBox, this, "dcc_video_label"); m_pLabel->setText(name); - m_pButtonBox->setStretchFactor(m_pLabel,1); + m_pButtonBox->setStretchFactor(m_pLabel, 1); createTextEncodingButton(m_pButtonBox); @@ -404,7 +426,7 @@ DccVideoWindow::DccVideoWindow(DccDescriptor * dcc,const char * name) #endif // Central splitter - m_pSplitter = new KviTalSplitter(Qt::Horizontal,this); + m_pSplitter = new KviTalSplitter(Qt::Horizontal, this); m_pSplitter->setObjectName("dcc_video_splitter"); m_pSplitter->setChildrenCollapsible(false); @@ -412,9 +434,9 @@ DccVideoWindow::DccVideoWindow(DccDescriptor * dcc,const char * name) m_pLayout = new QGridLayout(m_pContainerWidget); m_pContainerWidget->setLayout(m_pLayout); - m_pIrcView = new KviIrcView(this,this); - connect(m_pIrcView,SIGNAL(rightClicked()),this,SLOT(textViewRightClicked())); - m_pInput = new KviInput(this); + m_pIrcView = new KviIrcView(this, this); + connect(m_pIrcView, SIGNAL(rightClicked()), this, SLOT(textViewRightClicked())); + m_pInput = new KviInput(this); //remote video m_pInVideoLabel = new QLabel(); @@ -427,7 +449,7 @@ DccVideoWindow::DccVideoWindow(DccDescriptor * dcc,const char * name) //local video QByteArray cameraDevice; - if (cameraDevice.isEmpty()) + if(cameraDevice.isEmpty()) m_pCamera = new QCamera; else m_pCamera = new QCamera(cameraDevice); @@ -445,39 +467,40 @@ DccVideoWindow::DccVideoWindow(DccDescriptor * dcc,const char * name) //local video input: config m_pVideoLabel[0] = new QLabel(); - m_pVideoLabel[0]->setText(__tr2qs_ctx("Video device:","dcc")); + m_pVideoLabel[0]->setText(__tr2qs_ctx("Video device:", "dcc")); m_pLayout->addWidget(m_pVideoLabel[0], 1, 2, 1, 1); m_pCDevices = new QComboBox(); m_pLayout->addWidget(m_pCDevices, 2, 2, 1, 1); m_pVideoLabel[1] = new QLabel(); - m_pVideoLabel[1]->setText(__tr2qs_ctx("Input:","dcc")); + m_pVideoLabel[1]->setText(__tr2qs_ctx("Input:", "dcc")); m_pLayout->addWidget(m_pVideoLabel[1], 3, 2, 1, 1); m_pCInputs = new QComboBox(); m_pLayout->addWidget(m_pCInputs, 4, 2, 1, 1); m_pVideoLabel[2] = new QLabel(); - m_pVideoLabel[2]->setText(__tr2qs_ctx("Standard:","dcc")); + m_pVideoLabel[2]->setText(__tr2qs_ctx("Standard:", "dcc")); m_pLayout->addWidget(m_pVideoLabel[2], 5, 2, 1, 1); m_pCStandards = new QComboBox(); m_pLayout->addWidget(m_pCStandards, 6, 2, 1, 1); m_pLayout->addWidget(m_pIrcView, 7, 0, 1, 3); - m_pLayout->setRowStretch(7,1); + m_pLayout->setRowStretch(7, 1); - if(KVI_OPTION_BOOL(KviOption_boolAutoLogDccChat))m_pIrcView->startLogging(); + if(KVI_OPTION_BOOL(KviOption_boolAutoLogDccChat)) + m_pIrcView->startLogging(); - connect(&m_Timer, SIGNAL(timeout()), this, SLOT(slotUpdateImage()) ); + connect(&m_Timer, SIGNAL(timeout()), this, SLOT(slotUpdateImage())); m_Timer.start(FRAME_DURATION); m_pMarshal = new DccMarshal(this); - connect(m_pMarshal,SIGNAL(error(KviError::Code)),this,SLOT(handleMarshalError(KviError::Code))); - connect(m_pMarshal,SIGNAL(connected()),this,SLOT(connected())); - connect(m_pMarshal,SIGNAL(inProgress()),this,SLOT(connectionInProgress())); + connect(m_pMarshal, SIGNAL(error(KviError::Code)), this, SLOT(handleMarshalError(KviError::Code))); + connect(m_pMarshal, SIGNAL(connected()), this, SLOT(connected())); + connect(m_pMarshal, SIGNAL(inProgress()), this, SLOT(connectionInProgress())); connect(m_pCDevices, SIGNAL(currentIndexChanged(int)), this, SLOT(videoInputChanged(int))); connect(m_pCInputs, SIGNAL(currentIndexChanged(int)), this, SLOT(videoInputChanged(int))); @@ -492,37 +515,37 @@ DccVideoWindow::~DccVideoWindow() if(m_pInVideoLabel) { delete m_pInVideoLabel; - m_pInVideoLabel=0; + m_pInVideoLabel = 0; } if(m_pCameraView) { delete m_pCameraView; - m_pCameraView=0; + m_pCameraView = 0; } if(m_pCameraImage) { delete m_pCameraImage; - m_pCameraImage=0; + m_pCameraImage = 0; } if(m_pCamera) { delete m_pCamera; - m_pCamera=0; + m_pCamera = 0; } if(m_pCDevices) { delete m_pCDevices; - m_pCDevices=0; + m_pCDevices = 0; } if(m_pCInputs) { delete m_pCInputs; - m_pCInputs=0; + m_pCInputs = 0; } if(m_pCStandards) { delete m_pCStandards; - m_pCStandards=0; + m_pCStandards = 0; } if(m_pVideoLabel[0]) { @@ -536,7 +559,7 @@ DccVideoWindow::~DccVideoWindow() if(m_pLayout) { delete m_pLayout; - m_pLayout=0; + m_pLayout = 0; } g_pDccBroker->unregisterDccWindow(this); @@ -561,31 +584,31 @@ void DccVideoWindow::resizeEvent(QResizeEvent *) { int iHeight = m_pInput->heightHint(); int iHeight2 = m_pButtonBox->sizeHint().height(); - m_pButtonBox->setGeometry(0,0,width(),iHeight2); - m_pSplitter->setGeometry(0,iHeight2,width(),height() - (iHeight + iHeight2)); - m_pInput->setGeometry(0,height() - iHeight, width(),iHeight); + m_pButtonBox->setGeometry(0, 0, width(), iHeight2); + m_pSplitter->setGeometry(0, iHeight2, width(), height() - (iHeight + iHeight2)); + m_pInput->setGeometry(0, height() - iHeight, width(), iHeight); } QSize DccVideoWindow::sizeHint() const { QSize ret(m_pSplitter->sizeHint().width(), - m_pContainerWidget->sizeHint().height() + m_pButtonBox->sizeHint().height()); + m_pContainerWidget->sizeHint().height() + m_pButtonBox->sizeHint().height()); return ret; } void DccVideoWindow::textViewRightClicked() { - KVS_TRIGGER_EVENT_1(KviEvent_OnDCCChatPopupRequest,this,m_pDescriptor->idString()); + KVS_TRIGGER_EVENT_1(KviEvent_OnDCCChatPopupRequest, this, m_pDescriptor->idString()); } void DccVideoWindow::triggerCreationEvents() { - KVS_TRIGGER_EVENT_1(KviEvent_OnDCCChatWindowCreated,this,m_pDescriptor->idString()); + KVS_TRIGGER_EVENT_1(KviEvent_OnDCCChatWindowCreated, this, m_pDescriptor->idString()); } void DccVideoWindow::triggerDestructionEvents() { - KVS_TRIGGER_EVENT_1(KviEvent_OnDCCChatWindowClosing,this,m_pDescriptor->idString()); + KVS_TRIGGER_EVENT_1(KviEvent_OnDCCChatWindowClosing, this, m_pDescriptor->idString()); } void DccVideoWindow::startConnection() @@ -593,14 +616,16 @@ void DccVideoWindow::startConnection() if(!(m_pDescriptor->bActive)) { // PASSIVE CONNECTION - output(KVI_OUT_DCCMSG,__tr2qs_ctx("Attempting a passive DCC VIDEO connection","dcc")); - KviError::Code eError = m_pMarshal->dccListen(m_pDescriptor->szListenIp,m_pDescriptor->szListenPort,m_pDescriptor->bDoTimeout); + output(KVI_OUT_DCCMSG, __tr2qs_ctx("Attempting a passive DCC VIDEO connection", "dcc")); + KviError::Code eError = m_pMarshal->dccListen(m_pDescriptor->szListenIp, m_pDescriptor->szListenPort, m_pDescriptor->bDoTimeout); if(eError != KviError::Success) handleMarshalError(eError); - } else { + } + else + { // ACTIVE CONNECTION - output(KVI_OUT_DCCMSG,__tr2qs_ctx("Attempting an active DCC VIDEO connection","dcc")); - KviError::Code eError = m_pMarshal->dccConnect(m_pDescriptor->szIp.toUtf8().data(),m_pDescriptor->szPort.toUtf8().data(),m_pDescriptor->bDoTimeout); + output(KVI_OUT_DCCMSG, __tr2qs_ctx("Attempting an active DCC VIDEO connection", "dcc")); + KviError::Code eError = m_pMarshal->dccConnect(m_pDescriptor->szIp.toUtf8().data(), m_pDescriptor->szPort.toUtf8().data(), m_pDescriptor->bDoTimeout); if(eError != KviError::Success) handleMarshalError(eError); } @@ -610,29 +635,34 @@ void DccVideoWindow::connectionInProgress() { if(m_pDescriptor->bActive) { - output(KVI_OUT_DCCMSG,__tr2qs_ctx("Contacting host %Q on port %Q","dcc"),&(m_pDescriptor->szIp),&(m_pDescriptor->szPort)); - } else { + output(KVI_OUT_DCCMSG, __tr2qs_ctx("Contacting host %Q on port %Q", "dcc"), &(m_pDescriptor->szIp), &(m_pDescriptor->szPort)); + } + else + { - output(KVI_OUT_DCCMSG,__tr2qs_ctx("Listening on interface %Q port %Q","dcc"), - &(m_pMarshal->localIp()),&(m_pMarshal->localPort())); + output(KVI_OUT_DCCMSG, __tr2qs_ctx("Listening on interface %Q port %Q", "dcc"), + &(m_pMarshal->localIp()), &(m_pMarshal->localPort())); if(m_pDescriptor->bSendRequest) { - QString ip = !m_pDescriptor->szFakeIp.isEmpty() ? m_pDescriptor->szFakeIp : m_pDescriptor->szListenIp; - KviCString port = !m_pDescriptor->szFakePort.isEmpty() ? m_pDescriptor->szFakePort : m_pMarshal->localPort(); -//#warning "OPTION FOR SENDING 127.0.0.1 and so on (not an unsigned nuumber)" + QString ip = !m_pDescriptor->szFakeIp.isEmpty() ? m_pDescriptor->szFakeIp : m_pDescriptor->szListenIp; + KviCString port = !m_pDescriptor->szFakePort.isEmpty() ? m_pDescriptor->szFakePort : m_pMarshal->localPort(); + //#warning "OPTION FOR SENDING 127.0.0.1 and so on (not an unsigned nuumber)" struct in_addr a; - if(KviNetUtils::stringIpToBinaryIp(ip,&a)) { + if(KviNetUtils::stringIpToBinaryIp(ip, &a)) + { ip.setNum(htonl(a.s_addr)); } m_pDescriptor->console()->connection()->sendFmtData("PRIVMSG %s :%cDCC VIDEO %s %Q %s %d%c", - m_pDescriptor->console()->connection()->encodeText(m_pDescriptor->szNick).data(), - 0x01,m_pDescriptor->szCodec.ptr(), - &ip,port.ptr(),m_pDescriptor->iSampleRate,0x01); - output(KVI_OUT_DCCMSG,__tr2qs_ctx("Sent DCC VIDEO (%s) request to %Q, waiting for the remote client to connect...","dcc"), - m_pDescriptor->szCodec.ptr(),&(m_pDescriptor->szNick)); - } else output(KVI_OUT_DCCMSG,__tr2qs_ctx("DCC VIDEO request not sent: awaiting manual connection","dcc")); + m_pDescriptor->console()->connection()->encodeText(m_pDescriptor->szNick).data(), + 0x01, m_pDescriptor->szCodec.ptr(), + &ip, port.ptr(), m_pDescriptor->iSampleRate, 0x01); + output(KVI_OUT_DCCMSG, __tr2qs_ctx("Sent DCC VIDEO (%s) request to %Q, waiting for the remote client to connect...", "dcc"), + m_pDescriptor->szCodec.ptr(), &(m_pDescriptor->szNick)); + } + else + output(KVI_OUT_DCCMSG, __tr2qs_ctx("DCC VIDEO request not sent: awaiting manual connection", "dcc")); } } @@ -642,20 +672,20 @@ const QString & DccVideoWindow::target() if(!m_pszTarget) m_pszTarget = new QString(); - m_pszTarget->sprintf("%s@%s:%s",m_pDescriptor->szNick.toUtf8().data(),m_pDescriptor->szIp.toUtf8().data(),m_pDescriptor->szPort.toUtf8().data()); + m_pszTarget->sprintf("%s@%s:%s", m_pDescriptor->szNick.toUtf8().data(), m_pDescriptor->szIp.toUtf8().data(), m_pDescriptor->szPort.toUtf8().data()); return *m_pszTarget; } -void DccVideoWindow::getBaseLogFileName(QString &buffer) +void DccVideoWindow::getBaseLogFileName(QString & buffer) { - buffer.sprintf("dccvideo_%s_%s_%s",m_pDescriptor->szNick.toUtf8().data(),m_pDescriptor->szLocalFileName.toUtf8().data(),m_pDescriptor->szPort.toUtf8().data()); + buffer.sprintf("dccvideo_%s_%s_%s", m_pDescriptor->szNick.toUtf8().data(), m_pDescriptor->szLocalFileName.toUtf8().data(), m_pDescriptor->szPort.toUtf8().data()); } void DccVideoWindow::fillCaptionBuffers() { - KviCString tmp(KviCString::Format,"DCC Video %s@%s:%s %s", - m_pDescriptor->szNick.toUtf8().data(),m_pDescriptor->szIp.toUtf8().data(),m_pDescriptor->szPort.toUtf8().data(), - m_pDescriptor->szLocalFileName.toUtf8().data()); + KviCString tmp(KviCString::Format, "DCC Video %s@%s:%s %s", + m_pDescriptor->szNick.toUtf8().data(), m_pDescriptor->szIp.toUtf8().data(), m_pDescriptor->szPort.toUtf8().data(), + m_pDescriptor->szLocalFileName.toUtf8().data()); m_szPlainTextCaption = tmp; } @@ -665,17 +695,18 @@ QPixmap * DccVideoWindow::myIconPtr() return g_pIconManager->getSmallIcon(KviIconManager::DccVoice); } -void DccVideoWindow::ownMessage(const QString &text, bool bUserFeedback) +void DccVideoWindow::ownMessage(const QString & text, bool bUserFeedback) { if(!m_pSlaveThread) { - output(KVI_OUT_SYSTEMWARNING,__tr2qs_ctx("Can't send data: no active connection","dcc")); + output(KVI_OUT_SYSTEMWARNING, __tr2qs_ctx("Can't send data: no active connection", "dcc")); return; } QByteArray szData = encodeText(text); const char * d = szData.data(); - if(!d)return; + if(!d) + return; #ifdef COMPILE_CRYPT_SUPPORT if(cryptSessionInfo()) @@ -686,28 +717,28 @@ void DccVideoWindow::ownMessage(const QString &text, bool bUserFeedback) { KviCString encrypted; cryptSessionInfo()->m_pEngine->setMaxEncryptLen(-1); - switch(cryptSessionInfo()->m_pEngine->encrypt(d,encrypted)) + switch(cryptSessionInfo()->m_pEngine->encrypt(d, encrypted)) { case KviCryptEngine::Encrypted: { - KviCString buf(KviCString::Format,"%s\r\n",encrypted.ptr()); + KviCString buf(KviCString::Format, "%s\r\n", encrypted.ptr()); m_tmpTextDataOut.append(buf.ptr(), buf.len()); if(bUserFeedback) - g_pMainWindow->firstConsole()->outputPrivmsg(this,KVI_OUT_OWNPRIVMSGCRYPTED, - m_pDescriptor->szLocalNick.toUtf8().data(),m_pDescriptor->szLocalUser.toUtf8().data(), - m_pDescriptor->szLocalHost.toUtf8().data(),text,KviConsoleWindow::NoNotifications); + g_pMainWindow->firstConsole()->outputPrivmsg(this, KVI_OUT_OWNPRIVMSGCRYPTED, + m_pDescriptor->szLocalNick.toUtf8().data(), m_pDescriptor->szLocalUser.toUtf8().data(), + m_pDescriptor->szLocalHost.toUtf8().data(), text, KviConsoleWindow::NoNotifications); } break; case KviCryptEngine::Encoded: { - KviCString buf(KviCString::Format,"%s\r\n",encrypted.ptr()); + KviCString buf(KviCString::Format, "%s\r\n", encrypted.ptr()); m_tmpTextDataOut.append(buf.ptr(), buf.len()); if(bUserFeedback) { QString encr = decodeText(encrypted.ptr()); - g_pMainWindow->firstConsole()->outputPrivmsg(this,KVI_OUT_OWNPRIVMSG, - m_pDescriptor->szLocalNick.toUtf8().data(),m_pDescriptor->szLocalUser.toUtf8().data(), - m_pDescriptor->szLocalHost.toUtf8().data(),encr,KviConsoleWindow::NoNotifications); + g_pMainWindow->firstConsole()->outputPrivmsg(this, KVI_OUT_OWNPRIVMSG, + m_pDescriptor->szLocalNick.toUtf8().data(), m_pDescriptor->szLocalUser.toUtf8().data(), + m_pDescriptor->szLocalHost.toUtf8().data(), encr, KviConsoleWindow::NoNotifications); } } break; @@ -715,34 +746,36 @@ void DccVideoWindow::ownMessage(const QString &text, bool bUserFeedback) { QString szErr = cryptSessionInfo()->m_pEngine->lastError(); output(KVI_OUT_SYSTEMERROR, - __tr2qs_ctx("The encryption engine was not able to encrypt the current message (%Q): %Q, no data was sent to the remote end","dcc"), - &text,&szErr); + __tr2qs_ctx("The encryption engine was not able to encrypt the current message (%Q): %Q, no data was sent to the remote end", "dcc"), + &text, &szErr); } break; } return; - } else { + } + else + { d++; //eat the escape code - KviCString buf(KviCString::Format,"%s\r\n",d); + KviCString buf(KviCString::Format, "%s\r\n", d); QString tmp = text.right(text.length() - 1); m_tmpTextDataOut.append(buf.ptr(), buf.len()); if(bUserFeedback) - g_pMainWindow->firstConsole()->outputPrivmsg(this,KVI_OUT_OWNPRIVMSG, - m_pDescriptor->szLocalNick.toUtf8().data(),m_pDescriptor->szLocalUser.toUtf8().data(), - m_pDescriptor->szLocalHost.toUtf8().data(),tmp,KviConsoleWindow::NoNotifications); + g_pMainWindow->firstConsole()->outputPrivmsg(this, KVI_OUT_OWNPRIVMSG, + m_pDescriptor->szLocalNick.toUtf8().data(), m_pDescriptor->szLocalUser.toUtf8().data(), + m_pDescriptor->szLocalHost.toUtf8().data(), tmp, KviConsoleWindow::NoNotifications); return; } } } #endif - KviCString buf(KviCString::Format,"%s\r\n",d); + KviCString buf(KviCString::Format, "%s\r\n", d); m_tmpTextDataOut.append(buf.ptr(), buf.len()); if(bUserFeedback) - g_pMainWindow->firstConsole()->outputPrivmsg(this,KVI_OUT_OWNPRIVMSG, - m_pDescriptor->szLocalNick.toUtf8().data(),m_pDescriptor->szLocalUser.toUtf8().data(), - m_pDescriptor->szLocalHost.toUtf8().data(),text,KviConsoleWindow::NoNotifications); + g_pMainWindow->firstConsole()->outputPrivmsg(this, KVI_OUT_OWNPRIVMSG, + m_pDescriptor->szLocalNick.toUtf8().data(), m_pDescriptor->szLocalUser.toUtf8().data(), + m_pDescriptor->szLocalHost.toUtf8().data(), text, KviConsoleWindow::NoNotifications); } const QString & DccVideoWindow::localNick() @@ -752,7 +785,7 @@ const QString & DccVideoWindow::localNick() return m_szLocalNick; } -void DccVideoWindow::ownAction(const QString &text) +void DccVideoWindow::ownAction(const QString & text) { if(m_pSlaveThread) { @@ -761,22 +794,27 @@ void DccVideoWindow::ownAction(const QString &text) if(KVI_OPTION_BOOL(KviOption_boolStripMircColorsInUserMessages)) { szTmpBuffer = KviControlCodes::stripControlBytes(text); - } else { + } + else + { szTmpBuffer = text; } QByteArray szData = encodeText(szTmpBuffer); const char * d = szData.data(); - if(!d)return; - KviCString buf(KviCString::Format,"%cACTION %s%c\r\n",0x01,d,0x01); + if(!d) + return; + KviCString buf(KviCString::Format, "%cACTION %s%c\r\n", 0x01, d, 0x01); m_tmpTextDataOut.append(buf.ptr(), buf.len()); - output(KVI_OUT_ACTION,"%Q %Q",&(m_pDescriptor->szLocalNick),&szTmpBuffer); - } else { - output(KVI_OUT_SYSTEMWARNING,__tr2qs_ctx("Can't send data: no active connection","dcc")); + output(KVI_OUT_ACTION, "%Q %Q", &(m_pDescriptor->szLocalNick), &szTmpBuffer); + } + else + { + output(KVI_OUT_SYSTEMWARNING, __tr2qs_ctx("Can't send data: no active connection", "dcc")); } } -bool DccVideoWindow::event(QEvent *e) +bool DccVideoWindow::event(QEvent * e) { if(e->type() == KVI_THREAD_EVENT) { @@ -786,7 +824,7 @@ bool DccVideoWindow::event(QEvent *e) { KviError::Code * pError = ((KviThreadDataEvent *)e)->getData(); QString ssss = KviError::getDescription(*pError); - output(KVI_OUT_DCCERROR,__tr2qs_ctx("ERROR: %Q","dcc"),&(ssss)); + output(KVI_OUT_DCCERROR, __tr2qs_ctx("ERROR: %Q", "dcc"), &(ssss)); delete pError; return true; } @@ -794,16 +832,16 @@ bool DccVideoWindow::event(QEvent *e) case KVI_DCC_THREAD_EVENT_DATA: { KviCString * encoded = ((KviThreadDataEvent *)e)->getData(); - KviCString d=KviCString(decodeText(encoded->ptr())); + KviCString d = KviCString(decodeText(encoded->ptr())); if(d.firstCharIs(0x01)) { d.cutLeft(1); if(d.lastCharIs(0x01)) d.cutRight(1); - if(kvi_strEqualCIN("ACTION",d.ptr(),6)) + if(kvi_strEqualCIN("ACTION", d.ptr(), 6)) d.cutLeft(6); d.stripLeftWhiteSpace(); - output(KVI_OUT_ACTION,"%Q %s",&(m_pDescriptor->szNick),d.ptr()); + output(KVI_OUT_ACTION, "%Q %s", &(m_pDescriptor->szNick), d.ptr()); if(!hasAttention(KviWindow::MainWindowIsVisible)) { if(KVI_OPTION_BOOL(KviOption_boolFlashDccChatWindowOnNewMessages)) @@ -817,10 +855,12 @@ bool DccVideoWindow::event(QEvent *e) szMsg += " "; szMsg += KviQString::toHtmlEscaped(QString(d.ptr())); //qDebug("KviIrcServerParser_ctcp.cpp:975 debug: %s",szMsg.data()); - g_pApp->notifierMessage(this,KVI_OPTION_MSGTYPE(KVI_OUT_ACTION).pixId(),szMsg,KVI_OPTION_UINT(KviOption_uintNotifierAutoHideTime)); + g_pApp->notifierMessage(this, KVI_OPTION_MSGTYPE(KVI_OUT_ACTION).pixId(), szMsg, KVI_OPTION_UINT(KviOption_uintNotifierAutoHideTime)); } } - } else { + } + else + { #ifdef COMPILE_CRYPT_SUPPORT if(KviCryptSessionInfo * cinf = cryptSessionInfo()) @@ -828,39 +868,41 @@ bool DccVideoWindow::event(QEvent *e) if(cinf->m_bDoDecrypt) { KviCString decryptedStuff; - switch(cinf->m_pEngine->decrypt(d.ptr(),decryptedStuff)) + switch(cinf->m_pEngine->decrypt(d.ptr(), decryptedStuff)) { case KviCryptEngine::DecryptOkWasEncrypted: case KviCryptEngine::DecryptOkWasEncoded: case KviCryptEngine::DecryptOkWasPlainText: - if(!KVS_TRIGGER_EVENT_2_HALTED(KviEvent_OnDCCChatMessage,this,QString(decryptedStuff.ptr()),m_pDescriptor->idString())) + if(!KVS_TRIGGER_EVENT_2_HALTED(KviEvent_OnDCCChatMessage, this, QString(decryptedStuff.ptr()), m_pDescriptor->idString())) { - g_pMainWindow->firstConsole()->outputPrivmsg(this,KVI_OUT_DCCCHATMSG, - m_pDescriptor->szNick.toUtf8().data(),m_pDescriptor->szUser.toUtf8().data(), - m_pDescriptor->szHost.toUtf8().data(),decryptedStuff.ptr()); + g_pMainWindow->firstConsole()->outputPrivmsg(this, KVI_OUT_DCCCHATMSG, + m_pDescriptor->szNick.toUtf8().data(), m_pDescriptor->szUser.toUtf8().data(), + m_pDescriptor->szHost.toUtf8().data(), decryptedStuff.ptr()); } delete encoded; return true; - break; + break; default: // also case KviCryptEngine::DecryptError { QString szErr = cinf->m_pEngine->lastError(); output(KVI_OUT_SYSTEMERROR, - __tr2qs_ctx("The following message appears to be encrypted, but the encryption engine failed to decode it: %Q","dcc"), - &szErr); + __tr2qs_ctx("The following message appears to be encrypted, but the encryption engine failed to decode it: %Q", "dcc"), + &szErr); } break; } } - } else { + } + else + { #endif // FIXME! - if(!KVS_TRIGGER_EVENT_2_HALTED(KviEvent_OnDCCChatMessage,this,QString(d.ptr()),m_pDescriptor->idString())) + if(!KVS_TRIGGER_EVENT_2_HALTED(KviEvent_OnDCCChatMessage, this, QString(d.ptr()), m_pDescriptor->idString())) { - g_pMainWindow->firstConsole()->outputPrivmsg(this,KVI_OUT_DCCCHATMSG, - m_pDescriptor->szNick.toUtf8().data(),m_pDescriptor->szUser.toUtf8().data(), - m_pDescriptor->szHost.toUtf8().data(),d.ptr()); + g_pMainWindow->firstConsole()->outputPrivmsg(this, KVI_OUT_DCCCHATMSG, + m_pDescriptor->szNick.toUtf8().data(), m_pDescriptor->szUser.toUtf8().data(), + m_pDescriptor->szHost.toUtf8().data(), d.ptr()); if(!hasAttention(KviWindow::MainWindowIsVisible)) { if(KVI_OPTION_BOOL(KviOption_boolFlashDccChatWindowOnNewMessages)) @@ -870,7 +912,7 @@ bool DccVideoWindow::event(QEvent *e) if(KVI_OPTION_BOOL(KviOption_boolPopupNotifierOnNewDccChatMessages)) { QString szMsg = KviQString::toHtmlEscaped(QString(d.ptr())); - g_pApp->notifierMessage(this,KviIconManager::DccChatMsg,szMsg,KVI_OPTION_UINT(KviOption_uintNotifierAutoHideTime)); + g_pApp->notifierMessage(this, KviIconManager::DccChatMsg, szMsg, KVI_OPTION_UINT(KviOption_uintNotifierAutoHideTime)); } } } @@ -885,7 +927,7 @@ bool DccVideoWindow::event(QEvent *e) case KVI_DCC_THREAD_EVENT_MESSAGE: { KviCString * str = ((KviThreadDataEvent *)e)->getData(); - outputNoFmt(KVI_OUT_DCCMSG,__tr_no_xgettext_ctx(str->ptr(),"dcc")); + outputNoFmt(KVI_OUT_DCCMSG, __tr_no_xgettext_ctx(str->ptr(), "dcc")); delete str; return true; } @@ -896,31 +938,29 @@ bool DccVideoWindow::event(QEvent *e) switch(*act) { case KVI_DCC_VIDEO_THREAD_ACTION_START_RECORDING: -// m_pRecordingLabel->setEnabled(true); - break; + // m_pRecordingLabel->setEnabled(true); + break; case KVI_DCC_VIDEO_THREAD_ACTION_STOP_RECORDING: -// m_pRecordingLabel->setEnabled(false); - break; + // m_pRecordingLabel->setEnabled(false); + break; case KVI_DCC_VIDEO_THREAD_ACTION_START_PLAYING: -// m_pPlayingLabel->setEnabled(true); - break; + // m_pPlayingLabel->setEnabled(true); + break; case KVI_DCC_VIDEO_THREAD_ACTION_STOP_PLAYING: -// m_pPlayingLabel->setEnabled(false); - break; + // m_pPlayingLabel->setEnabled(false); + break; case KVI_DCC_VIDEO_THREAD_ACTION_GRAB_FRAME: - m_pCameraView->render( m_pCameraImage ); - break; - + m_pCameraView->render(m_pCameraImage); + break; } delete act; return true; } break; default: - qDebug("Invalid event type %d received",((KviThreadEvent *)e)->id()); - break; + qDebug("Invalid event type %d received", ((KviThreadEvent *)e)->id()); + break; } - } return KviWindow::event(e); @@ -929,18 +969,18 @@ bool DccVideoWindow::event(QEvent *e) void DccVideoWindow::handleMarshalError(KviError::Code eError) { QString ssss = KviError::getDescription(eError); - output(KVI_OUT_DCCERROR,__tr2qs_ctx("DCC Failed: %Q","dcc"),&ssss); + output(KVI_OUT_DCCERROR, __tr2qs_ctx("DCC Failed: %Q", "dcc"), &ssss); } void DccVideoWindow::connected() { - output(KVI_OUT_DCCMSG,__tr2qs_ctx("Connected to %Q:%Q","dcc"), - &(m_pMarshal->remoteIp()),&(m_pMarshal->remotePort())); - output(KVI_OUT_DCCMSG,__tr2qs_ctx("Local end is %Q:%Q","dcc"), - &(m_pMarshal->localIp()),&(m_pMarshal->localPort())); + output(KVI_OUT_DCCMSG, __tr2qs_ctx("Connected to %Q:%Q", "dcc"), + &(m_pMarshal->remoteIp()), &(m_pMarshal->remotePort())); + output(KVI_OUT_DCCMSG, __tr2qs_ctx("Local end is %Q:%Q", "dcc"), + &(m_pMarshal->localIp()), &(m_pMarshal->localPort())); if(!(m_pDescriptor->bActive)) { - m_pDescriptor->szIp = m_pMarshal->remoteIp(); + m_pDescriptor->szIp = m_pMarshal->remoteIp(); m_pDescriptor->szPort = m_pMarshal->remotePort(); m_pDescriptor->szHost = m_pMarshal->remoteIp(); } @@ -950,10 +990,10 @@ void DccVideoWindow::connected() opt->pCodec = kvi_dcc_video_get_codec(m_pDescriptor->szCodec.ptr()); - output(KVI_OUT_DCCMSG,__tr2qs_ctx("Actual codec used is '%s'","dcc"),opt->pCodec->name()); + output(KVI_OUT_DCCMSG, __tr2qs_ctx("Actual codec used is '%s'", "dcc"), opt->pCodec->name()); - m_pSlaveThread = new DccVideoThread(this,m_pMarshal->releaseSocket(),opt); -/* + m_pSlaveThread = new DccVideoThread(this, m_pMarshal->releaseSocket(), opt); + /* #ifndef COMPILE_DISABLE_DCC_VIDEO if(g_pVideoDevicePool) { @@ -985,8 +1025,10 @@ void DccVideoWindow::startTalking() void DccVideoWindow::startOrStopTalking(bool bStart) { - if(bStart)startTalking(); - else stopTalking(); + if(bStart) + startTalking(); + else + stopTalking(); } void DccVideoWindow::slotUpdateImage() @@ -997,9 +1039,9 @@ void DccVideoWindow::slotUpdateImage() } } -void DccVideoWindow::videoInputChanged(int ) +void DccVideoWindow::videoInputChanged(int) { -// FIXME this currently leads to a segfault -// if(m_pSlaveThread) -// m_pSlaveThread->restartRecording(m_pCDevices->currentIndex(), m_pCInputs->currentIndex(), m_pCStandards->currentIndex()); + // FIXME this currently leads to a segfault + // if(m_pSlaveThread) + // m_pSlaveThread->restartRecording(m_pCDevices->currentIndex(), m_pCInputs->currentIndex(), m_pCStandards->currentIndex()); } diff --git a/src/modules/dcc/DccVideoWindow.h b/src/modules/dcc/DccVideoWindow.h index 8f7e846c7..eca3ed97f 100644 --- a/src/modules/dcc/DccVideoWindow.h +++ b/src/modules/dcc/DccVideoWindow.h @@ -48,14 +48,14 @@ #include #ifdef COMPILE_CRYPT_SUPPORT - class KviCryptSessionInfo; +class KviCryptSessionInfo; #endif class QSlider; class DccMarshal; #ifndef _DCC_VIDEO_CPP_ - extern bool kvi_dcc_video_is_valid_codec(const char * codecName); +extern bool kvi_dcc_video_is_valid_codec(const char * codecName); #endif #define KVI_DCC_VIDEO_THREAD_ACTION_START_RECORDING 0 @@ -66,29 +66,33 @@ class DccMarshal; typedef struct _KviDccVideoThreadOptions { - QString szVideoDevice; + QString szVideoDevice; DccVideoCodec * pCodec; } KviDccVideoThreadOptions; class DccVideoThread : public DccThread { friend class DccVideoWindow; + public: - DccVideoThread(KviWindow * wnd,kvi_socket_t fd,KviDccVideoThreadOptions * opt); + DccVideoThread(KviWindow * wnd, kvi_socket_t fd, KviDccVideoThreadOptions * opt); ~DccVideoThread(); + protected: KviDccVideoThreadOptions * m_pOpt; - KviDataBuffer m_outFrameBuffer; - KviDataBuffer m_inFrameBuffer; - KviDataBuffer m_videoInSignalBuffer; - KviDataBuffer m_textInSignalBuffer; - KviDataBuffer m_videoOutSignalBuffer; - KviDataBuffer m_textOutSignalBuffer; - bool m_bPlaying; - bool m_bRecording; + KviDataBuffer m_outFrameBuffer; + KviDataBuffer m_inFrameBuffer; + KviDataBuffer m_videoInSignalBuffer; + KviDataBuffer m_textInSignalBuffer; + KviDataBuffer m_videoOutSignalBuffer; + KviDataBuffer m_textOutSignalBuffer; + bool m_bPlaying; + bool m_bRecording; + protected: - QImage m_inImage; - QImage m_outImage; + QImage m_inImage; + QImage m_outImage; + protected: bool readWriteStep(); bool videoStep(); @@ -100,48 +104,50 @@ protected: void stopPlaying(); inline bool isPlaying() { return m_bPlaying; }; virtual void run(); - virtual bool handleIncomingData(KviDccThreadIncomingData *data,bool bCritical); + virtual bool handleIncomingData(KviDccThreadIncomingData * data, bool bCritical); }; - class DccVideoWindow : public DccWindow { Q_OBJECT friend class DccVideoThread; + public: - DccVideoWindow(DccDescriptor * dcc,const char * name); + DccVideoWindow(DccDescriptor * dcc, const char * name); ~DccVideoWindow(); + protected: - KviThemedLabel * m_pLabel; - QWidget * m_pContainerWidget; - QImage * m_pCameraImage; - QCameraViewfinder * m_pCameraView; - QCamera * m_pCamera; - QLabel * m_pInVideoLabel; - QComboBox * m_pCDevices; - QComboBox * m_pCInputs; - QComboBox * m_pCStandards; - QGridLayout * m_pLayout; - QTimer m_Timer; - QLabel * m_pVideoLabel[3]; - QString * m_pszTarget; - DccVideoThread * m_pSlaveThread; - QByteArray m_tmpTextDataOut; - QString m_szLocalNick; + KviThemedLabel * m_pLabel; + QWidget * m_pContainerWidget; + QImage * m_pCameraImage; + QCameraViewfinder * m_pCameraView; + QCamera * m_pCamera; + QLabel * m_pInVideoLabel; + QComboBox * m_pCDevices; + QComboBox * m_pCInputs; + QComboBox * m_pCStandards; + QGridLayout * m_pLayout; + QTimer m_Timer; + QLabel * m_pVideoLabel[3]; + QString * m_pszTarget; + DccVideoThread * m_pSlaveThread; + QByteArray m_tmpTextDataOut; + QString m_szLocalNick; + protected: virtual void triggerCreationEvents(); virtual void triggerDestructionEvents(); virtual const QString & target(); virtual void fillCaptionBuffers(); virtual QPixmap * myIconPtr(); - virtual bool event(QEvent *e); - virtual void getBaseLogFileName(QString &buffer); + virtual bool event(QEvent * e); + virtual void getBaseLogFileName(QString & buffer); void startTalking(); void stopTalking(); void startConnection(); virtual const QString & localNick(); - virtual void ownMessage(const QString &text, bool bUserFeedback = true); - virtual void ownAction(const QString &text); + virtual void ownMessage(const QString & text, bool bUserFeedback = true); + virtual void ownAction(const QString & text); virtual void resizeEvent(QResizeEvent *); virtual QSize sizeHint() const; protected slots: @@ -151,8 +157,7 @@ protected slots: void connectionInProgress(); void slotUpdateImage(); void textViewRightClicked(); - void videoInputChanged(int ); + void videoInputChanged(int); }; - #endif //_VIDEO_H_ diff --git a/src/modules/dcc/DccVoiceAdpcmCodec.cpp b/src/modules/dcc/DccVoiceAdpcmCodec.cpp index 2ac4f4156..70f2cb227 100644 --- a/src/modules/dcc/DccVoiceAdpcmCodec.cpp +++ b/src/modules/dcc/DccVoiceAdpcmCodec.cpp @@ -56,11 +56,9 @@ #include /*DBG*/ #ifndef __STDC__ - #define signed +#define signed #endif - - #define ADPCM_PACKED_FRAME_SIZE_IN_BYTES 512 #define ADPCM_UNPACKED_FRAME_SIZE_IN_BYTES 2048 #define ADPCM_UNPACKED_FRAME_SIZE_IN_SHORTS 1024 @@ -83,10 +81,10 @@ static int stepsizeTable[89] = { 15289, 16818, 18500, 20350, 22385, 24623, 27086, 29794, 32767 }; -void ADPCM_compress(short indata[],char outdata[],int len,ADPCM_state *state) +void ADPCM_compress(short indata[], char outdata[], int len, ADPCM_state * state) { - short *lpIn; /* Input buffer pointer */ - signed char *lpOut; /* output buffer pointer */ + short * lpIn; /* Input buffer pointer */ + signed char * lpOut; /* output buffer pointer */ int val; /* Current input sample value */ int sign; /* Current adpcm sign bit */ int delta; /* Current adpcm output value */ @@ -96,10 +94,10 @@ void ADPCM_compress(short indata[],char outdata[],int len,ADPCM_state *state) int vpdiff; /* Current change to valpred */ int index; /* Current step change index */ int outputbuffer = 0; /* place to keep previous 4-bit value */ - int bufferstep; /* toggle between outputbuffer/output */ + int bufferstep; /* toggle between outputbuffer/output */ lpOut = (signed char *)outdata; - lpIn = indata; + lpIn = indata; valpred = state->valprev; index = state->index; @@ -107,12 +105,14 @@ void ADPCM_compress(short indata[],char outdata[],int len,ADPCM_state *state) bufferstep = 1; - for ( ;len > 0;len-- ) { + for(; len > 0; len--) + { val = *lpIn++; // Step 1 - compute difference with previous value diff = val - valpred; sign = (diff < 0) ? 8 : 0; - if(sign)diff=(-diff); + if(sign) + diff = (-diff); // Step 2 - Divide and clamp // Note: // This code *approximately* computes: @@ -124,57 +124,69 @@ void ADPCM_compress(short indata[],char outdata[],int len,ADPCM_state *state) // delta = 0; vpdiff = (step >> 3); - if (diff >=step){ + if(diff >= step) + { delta = 4; diff -= step; vpdiff += step; } step >>= 1; - if (diff >= step) { + if(diff >= step) + { delta |= 2; diff -= step; vpdiff += step; } step >>= 1; - if ( diff >= step ) { + if(diff >= step) + { delta |= 1; vpdiff += step; } // Step 3 - Update previous value - if(sign)valpred -= vpdiff; - else valpred += vpdiff; + if(sign) + valpred -= vpdiff; + else + valpred += vpdiff; // Step 4 - Clamp previous value to 16 bits - if ( valpred > 32767 )valpred = 32767; - else if ( valpred < -32768 )valpred = -32768; + if(valpred > 32767) + valpred = 32767; + else if(valpred < -32768) + valpred = -32768; // Step 5 - Assemble value, update index and step values delta |= sign; index += indexTable[delta]; - if ( index < 0 ) index = 0; - if ( index > 88 ) index = 88; + if(index < 0) + index = 0; + if(index > 88) + index = 88; step = stepsizeTable[index]; // Step 6 - Output value - if ( bufferstep )outputbuffer = (delta << 4) & 0xf0; - else *lpOut++ = (delta & 0x0f) | outputbuffer; + if(bufferstep) + outputbuffer = (delta << 4) & 0xf0; + else + *lpOut++ = (delta & 0x0f) | outputbuffer; bufferstep = !bufferstep; } // Output last step, if needed - if (!bufferstep)*lpOut++ = outputbuffer; + if(!bufferstep) + *lpOut++ = outputbuffer; state->valprev = valpred; state->index = index; } -void ADPCM_uncompress(char indata[],short outdata[],int len,ADPCM_state *state) +void ADPCM_uncompress(char indata[], short outdata[], int len, ADPCM_state * state) { - signed char *inp; /* Input buffer pointer */ - short *outp; /* output buffer pointer */ - int sign; /* Current adpcm sign bit */ - int delta; /* Current adpcm output value */ - int step; /* Stepsize */ - int valpred; /* Predicted value */ - int vpdiff; /* Current change to valpred */ - int index; /* Current step change index */ - int inputbuffer=0; /* place to keep next 4-bit value */ - int bufferstep; /* toggle between inputbuffer/input */ + signed char * inp; /* Input buffer pointer */ + short * outp; /* output buffer pointer */ + int sign; /* Current adpcm sign bit */ + int delta; /* Current adpcm output value */ + int step; /* Stepsize */ + int valpred; /* Predicted value */ + int vpdiff; /* Current change to valpred */ + int index; /* Current step change index */ + int inputbuffer = 0; /* place to keep next 4-bit value */ + int bufferstep; /* toggle between inputbuffer/input */ outp = outdata; inp = (signed char *)indata; @@ -185,10 +197,13 @@ void ADPCM_uncompress(char indata[],short outdata[],int len,ADPCM_state *state) bufferstep = 0; - for ( ; len > 0 ; len-- ) { + for(; len > 0; len--) + { /* Step 1 - get the delta value */ - if ( bufferstep )delta = inputbuffer & 0xf; - else { + if(bufferstep) + delta = inputbuffer & 0xf; + else + { inputbuffer = *inp++; delta = (inputbuffer >> 4) & 0xf; } @@ -196,8 +211,10 @@ void ADPCM_uncompress(char indata[],short outdata[],int len,ADPCM_state *state) /* Step 2 - Find new index value (for later) */ index += indexTable[delta]; - if ( index < 0 ) index = 0; - if ( index > 88 ) index = 88; + if(index < 0) + index = 0; + if(index > 88) + index = 88; /* Step 3 - Separate sign and magnitude */ sign = delta & 8; @@ -209,16 +226,23 @@ void ADPCM_uncompress(char indata[],short outdata[],int len,ADPCM_state *state) ** in adpcm_coder. */ vpdiff = step >> 3; - if( delta & 4 )vpdiff += step; - if( delta & 2 )vpdiff += step>>1; - if( delta & 1 )vpdiff += step>>2; + if(delta & 4) + vpdiff += step; + if(delta & 2) + vpdiff += step >> 1; + if(delta & 1) + vpdiff += step >> 2; - if(sign)valpred -= vpdiff; - else valpred += vpdiff; + if(sign) + valpred -= vpdiff; + else + valpred += vpdiff; /* Step 5 - clamp output value */ - if(valpred > 32767)valpred = 32767; - else if(valpred < -32768)valpred = -32768; + if(valpred > 32767) + valpred = 32767; + else if(valpred < -32768) + valpred = -32768; /* Step 6 - Update step value */ step = stepsizeTable[index]; @@ -231,9 +255,8 @@ void ADPCM_uncompress(char indata[],short outdata[],int len,ADPCM_state *state) state->index = index; } - DccVoiceAdpcmCodec::DccVoiceAdpcmCodec() -: DccVoiceCodec() + : DccVoiceCodec() { m_pEncodeState = new ADPCM_state; m_pEncodeState->index = 0; @@ -250,9 +273,10 @@ DccVoiceAdpcmCodec::~DccVoiceAdpcmCodec() delete m_pDecodeState; } -void DccVoiceAdpcmCodec::encode(KviDataBuffer * signal,KviDataBuffer * stream) +void DccVoiceAdpcmCodec::encode(KviDataBuffer * signal, KviDataBuffer * stream) { - if(signal->size() < ADPCM_UNPACKED_FRAME_SIZE_IN_BYTES)return; // nothing to encode + if(signal->size() < ADPCM_UNPACKED_FRAME_SIZE_IN_BYTES) + return; // nothing to encode char * ptr = (char *)signal->data(); @@ -265,16 +289,17 @@ void DccVoiceAdpcmCodec::encode(KviDataBuffer * signal,KviDataBuffer * stream) while(ptr != endPtr) { - ADPCM_compress((short *)ptr,(char *)(stream->data() + uFrameOffset),ADPCM_UNPACKED_FRAME_SIZE_IN_SHORTS,m_pEncodeState); + ADPCM_compress((short *)ptr, (char *)(stream->data() + uFrameOffset), ADPCM_UNPACKED_FRAME_SIZE_IN_SHORTS, m_pEncodeState); ptr += ADPCM_UNPACKED_FRAME_SIZE_IN_BYTES; uFrameOffset += ADPCM_PACKED_FRAME_SIZE_IN_BYTES; } signal->remove(uTotalDataCompressed); } -void DccVoiceAdpcmCodec::decode(KviDataBuffer * stream,KviDataBuffer * signal) +void DccVoiceAdpcmCodec::decode(KviDataBuffer * stream, KviDataBuffer * signal) { - if(stream->size() < ADPCM_PACKED_FRAME_SIZE_IN_BYTES)return; // nothing to decode + if(stream->size() < ADPCM_PACKED_FRAME_SIZE_IN_BYTES) + return; // nothing to decode char * ptr = (char *)stream->data(); @@ -288,7 +313,7 @@ void DccVoiceAdpcmCodec::decode(KviDataBuffer * stream,KviDataBuffer * signal) while(ptr != endPtr) { - ADPCM_uncompress((char *)ptr,(short *)(signal->data() + uSignalOffset),ADPCM_UNPACKED_FRAME_SIZE_IN_SHORTS,m_pDecodeState); + ADPCM_uncompress((char *)ptr, (short *)(signal->data() + uSignalOffset), ADPCM_UNPACKED_FRAME_SIZE_IN_SHORTS, m_pDecodeState); ptr += ADPCM_PACKED_FRAME_SIZE_IN_BYTES; uSignalOffset += ADPCM_UNPACKED_FRAME_SIZE_IN_BYTES; } diff --git a/src/modules/dcc/DccVoiceAdpcmCodec.h b/src/modules/dcc/DccVoiceAdpcmCodec.h index 4e9ece4ff..e437c18b5 100644 --- a/src/modules/dcc/DccVoiceAdpcmCodec.h +++ b/src/modules/dcc/DccVoiceAdpcmCodec.h @@ -50,24 +50,24 @@ typedef struct adpcm_state { short valprev; /* Previous output value */ - char index; /* HelpIndex into stepsize table */ + char index; /* HelpIndex into stepsize table */ } ADPCM_state; - class DccVoiceAdpcmCodec : public DccVoiceCodec { public: DccVoiceAdpcmCodec(); virtual ~DccVoiceAdpcmCodec(); + private: ADPCM_state * m_pEncodeState; ADPCM_state * m_pDecodeState; + public: - virtual void encode(KviDataBuffer * signal,KviDataBuffer * stream); - virtual void decode(KviDataBuffer * stream,KviDataBuffer * signal); + virtual void encode(KviDataBuffer * signal, KviDataBuffer * stream); + virtual void decode(KviDataBuffer * stream, KviDataBuffer * signal); virtual int encodedFrameSize(); virtual int decodedFrameSize(); }; - #endif //_ADPCMCODEC_H_ diff --git a/src/modules/dcc/DccVoiceCodec.cpp b/src/modules/dcc/DccVoiceCodec.cpp index 0784c54b3..57be1681e 100644 --- a/src/modules/dcc/DccVoiceCodec.cpp +++ b/src/modules/dcc/DccVoiceCodec.cpp @@ -24,7 +24,6 @@ #include "DccVoiceCodec.h" - #include #include #include @@ -37,11 +36,11 @@ DccVoiceCodec::~DccVoiceCodec() { } -void DccVoiceCodec::encode(KviDataBuffer *,KviDataBuffer *) +void DccVoiceCodec::encode(KviDataBuffer *, KviDataBuffer *) { } -void DccVoiceCodec::decode(KviDataBuffer *,KviDataBuffer *) +void DccVoiceCodec::decode(KviDataBuffer *, KviDataBuffer *) { } @@ -61,7 +60,7 @@ const char * DccVoiceCodec::name() } DccVoiceNullCodec::DccVoiceNullCodec() -: DccVoiceCodec() + : DccVoiceCodec() { m_szName = "null (no compression)"; } @@ -70,17 +69,19 @@ DccVoiceNullCodec::~DccVoiceNullCodec() { } -void DccVoiceNullCodec::encode(KviDataBuffer * signal,KviDataBuffer * stream) +void DccVoiceNullCodec::encode(KviDataBuffer * signal, KviDataBuffer * stream) { - if(signal->size() < 1)return; - stream->append(signal->data(),signal->size()); + if(signal->size() < 1) + return; + stream->append(signal->data(), signal->size()); signal->resize(0); } -void DccVoiceNullCodec::decode(KviDataBuffer * stream,KviDataBuffer * signal) +void DccVoiceNullCodec::decode(KviDataBuffer * stream, KviDataBuffer * signal) { - if(stream->size() < 1)return; - signal->append(stream->data(),stream->size()); + if(stream->size() < 1) + return; + signal->append(stream->data(), stream->size()); stream->resize(0); } @@ -105,15 +106,15 @@ DccVideoCodec::~DccVideoCodec() { } -void DccVideoCodec::encodeVideo(KviDataBuffer *,KviDataBuffer *) +void DccVideoCodec::encodeVideo(KviDataBuffer *, KviDataBuffer *) { } -void DccVideoCodec::encodeText(KviDataBuffer *,KviDataBuffer *) +void DccVideoCodec::encodeText(KviDataBuffer *, KviDataBuffer *) { } -void DccVideoCodec::decode(KviDataBuffer *,KviDataBuffer *,KviDataBuffer *) +void DccVideoCodec::decode(KviDataBuffer *, KviDataBuffer *, KviDataBuffer *) { } @@ -133,7 +134,7 @@ const char * DccVideoCodec::name() } DccVideoSJpegCodec::DccVideoSJpegCodec() -: DccVideoCodec() + : DccVideoCodec() { m_szName = "sjpeg"; } @@ -142,10 +143,11 @@ DccVideoSJpegCodec::~DccVideoSJpegCodec() { } -void DccVideoSJpegCodec::encodeVideo(KviDataBuffer * videoSignal,KviDataBuffer * stream) +void DccVideoSJpegCodec::encodeVideo(KviDataBuffer * videoSignal, KviDataBuffer * stream) { - if(videoSignal->size() < 1) return; + if(videoSignal->size() < 1) + return; QImage img(videoSignal->data(), 320, 240, 1280, QImage::Format_ARGB32); QByteArray ba; @@ -157,65 +159,67 @@ void DccVideoSJpegCodec::encodeVideo(KviDataBuffer * videoSignal,KviDataBuffer * img.save(&buffer, "JPEG", 20); if(ba.size() > 0) { - stream->append((const unsigned char*)ba.data(),ba.size()); - } + stream->append((const unsigned char *)ba.data(), ba.size()); + } videoSignal->clear(); } void DccVideoSJpegCodec::encodeText(KviDataBuffer * textSignal, KviDataBuffer * stream) { - static unsigned const char *irct_magic_init = (unsigned const char*) "\0\0"; - static unsigned const char *irct_magic_end = (unsigned const char*) "\0\0"; + static unsigned const char * irct_magic_init = (unsigned const char *)"\0\0"; + static unsigned const char * irct_magic_end = (unsigned const char *)"\0\0"; - qDebug("encodeText %s %d",textSignal->data(), textSignal->size()); - if(textSignal->size() < 1) return; - stream->append(irct_magic_init,8); - stream->append((const unsigned char*)textSignal->data(),textSignal->size()); - stream->append(irct_magic_end,9); + qDebug("encodeText %s %d", textSignal->data(), textSignal->size()); + if(textSignal->size() < 1) + return; + stream->append(irct_magic_init, 8); + stream->append((const unsigned char *)textSignal->data(), textSignal->size()); + stream->append(irct_magic_end, 9); textSignal->clear(); return; } -void DccVideoSJpegCodec::decode(KviDataBuffer * stream,KviDataBuffer * videoSignal,KviDataBuffer * textSignal) +void DccVideoSJpegCodec::decode(KviDataBuffer * stream, KviDataBuffer * videoSignal, KviDataBuffer * textSignal) { - static unsigned const char jpg_magic_init[4] = { 0xFF, 0xD8, 0xFF, 0xE0}; //SOI + APP0 - static unsigned const char jpg_magic_end[2] = { 0xFF, 0xD9}; //EOI - - static unsigned const char *irct_magic_init = (unsigned const char*) "\0\0"; - static unsigned const char *irct_magic_end = (unsigned const char*) "\0\0"; + static unsigned const char jpg_magic_init[4] = { 0xFF, 0xD8, 0xFF, 0xE0 }; //SOI + APP0 + static unsigned const char jpg_magic_end[2] = { 0xFF, 0xD9 }; //EOI - if(stream->size() < 1)return; + static unsigned const char * irct_magic_init = (unsigned const char *)"\0\0"; + static unsigned const char * irct_magic_end = (unsigned const char *)"\0\0"; + if(stream->size() < 1) + return; int txtStart = stream->find(irct_magic_init, 8); int txtEnd = stream->find(irct_magic_end, 9); int jpgStart = stream->find(jpg_magic_init, 4); - if(txtStart!=-1 && txtEnd !=-1 && txtStartremove(txtStart+8); - int len = txtEnd - txtStart -8; //-8 irct_magic_init - if(len>0) + qDebug("a txtStart %d txtEnd %d", txtStart, txtEnd); + stream->remove(txtStart + 8); + int len = txtEnd - txtStart - 8; //-8 irct_magic_init + if(len > 0) { textSignal->append(stream->data(), len); - char*txt=(char*)malloc(len+1); - memcpy(txt,stream->data(), len); - txt[len]='\0'; - qDebug("a recv |%s| %d",txt,len); + char * txt = (char *)malloc(len + 1); + memcpy(txt, stream->data(), len); + txt[len] = '\0'; + qDebug("a recv |%s| %d", txt, len); } - stream->remove(len+9); + stream->remove(len + 9); } - if(stream->size() < 1)return; + if(stream->size() < 1) + return; jpgStart = stream->find(jpg_magic_init, 4); int jpgEnd = stream->find(jpg_magic_end, 2); if(jpgStart != -1 && jpgEnd != -1) { -// qDebug("jpgStart %d jpgEnd %d",jpgStart,jpgEnd); + // qDebug("jpgStart %d jpgEnd %d",jpgStart,jpgEnd); QImage img; //remove junk before jpeg start if(jpgStart > 0) @@ -227,7 +231,7 @@ void DccVideoSJpegCodec::decode(KviDataBuffer * stream,KviDataBuffer * videoSign if(!img.isNull()) { videoSignal->clear(); - videoSignal->append(img.bits(),img.byteCount()); + videoSignal->append(img.bits(), img.byteCount()); } stream->remove(len); } @@ -235,20 +239,20 @@ void DccVideoSJpegCodec::decode(KviDataBuffer * stream,KviDataBuffer * videoSign txtStart = stream->find(irct_magic_init, 8); txtEnd = stream->find(irct_magic_end, 9); - if(txtStart!=-1 && txtEnd !=-1) + if(txtStart != -1 && txtEnd != -1) { - qDebug("b txtStart %d txtEnd %d",txtStart,txtEnd); - stream->remove(txtStart+8); - int len = txtEnd - txtStart -8; //-8 irct_magic_init - if(len>0) + qDebug("b txtStart %d txtEnd %d", txtStart, txtEnd); + stream->remove(txtStart + 8); + int len = txtEnd - txtStart - 8; //-8 irct_magic_init + if(len > 0) { textSignal->append(stream->data(), len); - char*txt=(char*)malloc(len+1); - memcpy(txt,stream->data(), len); - txt[len]='\0'; - qDebug("b recv |%s| %d",txt,len); + char * txt = (char *)malloc(len + 1); + memcpy(txt, stream->data(), len); + txt[len] = '\0'; + qDebug("b recv |%s| %d", txt, len); } - stream->remove(len+9); + stream->remove(len + 9); } } @@ -262,10 +266,9 @@ int DccVideoSJpegCodec::decodedFrameSize() return 0; } - #ifndef COMPILE_DISABLE_OGG_THEORA DccVideoTheoraCodec::DccVideoTheoraCodec() -: DccVideoCodec() + : DccVideoCodec() { m_szName = "theora"; m_pEncoder = 0; @@ -276,38 +279,41 @@ DccVideoTheoraCodec::~DccVideoTheoraCodec() { if(m_pEncoder) delete m_pEncoder; - m_pEncoder=0; + m_pEncoder = 0; if(m_pDecoder) delete m_pDecoder; - m_pDecoder=0; + m_pDecoder = 0; } -void DccVideoTheoraCodec::encodeVideo(KviDataBuffer * videoSignal,KviDataBuffer * stream) +void DccVideoTheoraCodec::encodeVideo(KviDataBuffer * videoSignal, KviDataBuffer * stream) { - if(videoSignal->size() < 1) return; + if(videoSignal->size() < 1) + return; if(!m_pEncoder) m_pEncoder = new KviOggTheoraEncoder(stream); - m_pEncoder->addVideoFrame((QRgb *) videoSignal->data(),videoSignal->size()); + m_pEncoder->addVideoFrame((QRgb *)videoSignal->data(), videoSignal->size()); videoSignal->clear(); } void DccVideoTheoraCodec::encodeText(KviDataBuffer * textSignal, KviDataBuffer * stream) { - if(textSignal->size() < 1) return; + if(textSignal->size() < 1) + return; if(!m_pEncoder) m_pEncoder = new KviOggTheoraEncoder(stream); - m_pEncoder->addTextFrame(textSignal->data(),textSignal->size()); + m_pEncoder->addTextFrame(textSignal->data(), textSignal->size()); textSignal->clear(); } -void DccVideoTheoraCodec::decode(KviDataBuffer * stream,KviDataBuffer * videoSignal,KviDataBuffer * textSignal) +void DccVideoTheoraCodec::decode(KviDataBuffer * stream, KviDataBuffer * videoSignal, KviDataBuffer * textSignal) { - if(stream->size() < 1)return; + if(stream->size() < 1) + return; if(!m_pDecoder) m_pDecoder = new KviOggTheoraDecoder(videoSignal, textSignal); diff --git a/src/modules/dcc/DccVoiceCodec.h b/src/modules/dcc/DccVoiceCodec.h index 85c97de42..70e4ebddc 100644 --- a/src/modules/dcc/DccVoiceCodec.h +++ b/src/modules/dcc/DccVoiceCodec.h @@ -28,8 +28,8 @@ #include "KviDataBuffer.h" #ifndef COMPILE_DISABLE_OGG_THEORA - #include "KviOggTheoraDecoder.h" - #include "KviOggTheoraEncoder.h" +#include "KviOggTheoraDecoder.h" +#include "KviOggTheoraEncoder.h" #endif class DccVoiceCodec @@ -37,12 +37,14 @@ class DccVoiceCodec public: DccVoiceCodec(); virtual ~DccVoiceCodec(); + protected: KviCString m_szName; + public: const char * name(); - virtual void encode(KviDataBuffer * signal,KviDataBuffer * stream); - virtual void decode(KviDataBuffer * stream,KviDataBuffer * signal); + virtual void encode(KviDataBuffer * signal, KviDataBuffer * stream); + virtual void decode(KviDataBuffer * stream, KviDataBuffer * signal); virtual int encodedFrameSize(); virtual int decodedFrameSize(); }; @@ -52,9 +54,10 @@ class DccVoiceNullCodec : public DccVoiceCodec public: DccVoiceNullCodec(); virtual ~DccVoiceNullCodec(); + public: - virtual void encode(KviDataBuffer * signal,KviDataBuffer * stream); - virtual void decode(KviDataBuffer * stream,KviDataBuffer * signal); + virtual void encode(KviDataBuffer * signal, KviDataBuffer * stream); + virtual void decode(KviDataBuffer * stream, KviDataBuffer * signal); virtual int encodedFrameSize(); virtual int decodedFrameSize(); }; @@ -64,13 +67,15 @@ class DccVideoCodec public: DccVideoCodec(); virtual ~DccVideoCodec(); + protected: KviCString m_szName; + public: const char * name(); virtual void encodeVideo(KviDataBuffer * videoSignal, KviDataBuffer * stream); virtual void encodeText(KviDataBuffer * textSignal, KviDataBuffer * stream); - virtual void decode(KviDataBuffer * stream,KviDataBuffer * videoSignal,KviDataBuffer * textSignal); + virtual void decode(KviDataBuffer * stream, KviDataBuffer * videoSignal, KviDataBuffer * textSignal); virtual int encodedFrameSize(); virtual int decodedFrameSize(); }; @@ -80,10 +85,11 @@ class DccVideoSJpegCodec : public DccVideoCodec public: DccVideoSJpegCodec(); virtual ~DccVideoSJpegCodec(); + public: virtual void encodeVideo(KviDataBuffer * videoSignal, KviDataBuffer * stream); virtual void encodeText(KviDataBuffer * textSignal, KviDataBuffer * stream); - virtual void decode(KviDataBuffer * stream,KviDataBuffer * videoSignal,KviDataBuffer * textSignal); + virtual void decode(KviDataBuffer * stream, KviDataBuffer * videoSignal, KviDataBuffer * textSignal); virtual int encodedFrameSize(); virtual int decodedFrameSize(); }; @@ -94,12 +100,14 @@ class DccVideoTheoraCodec : public DccVideoCodec public: DccVideoTheoraCodec(); virtual ~DccVideoTheoraCodec(); + public: virtual void encodeVideo(KviDataBuffer * videoSignal, KviDataBuffer * stream); virtual void encodeText(KviDataBuffer * textSignal, KviDataBuffer * stream); - virtual void decode(KviDataBuffer * stream,KviDataBuffer * videoSignal,KviDataBuffer * textSignal); + virtual void decode(KviDataBuffer * stream, KviDataBuffer * videoSignal, KviDataBuffer * textSignal); virtual int encodedFrameSize(); virtual int decodedFrameSize(); + private: KviOggTheoraEncoder * m_pEncoder; KviOggTheoraDecoder * m_pDecoder; diff --git a/src/modules/dcc/DccVoiceGsmCodec.cpp b/src/modules/dcc/DccVoiceGsmCodec.cpp index 8f7fb6534..e2a23bb4e 100644 --- a/src/modules/dcc/DccVoiceGsmCodec.cpp +++ b/src/modules/dcc/DccVoiceGsmCodec.cpp @@ -27,122 +27,125 @@ #include "DccVoiceGsmCodec.h" #ifdef COMPILE_USE_GSM - #include +#include - #define GSM_PACKED_FRAME_SIZE_IN_BYTES 33 - #define GSM_UNPACKED_FRAME_SIZE_IN_BYTES 320 - #define GSM_UNPACKED_FRAME_SIZE_IN_SHORTS 160 +#define GSM_PACKED_FRAME_SIZE_IN_BYTES 33 +#define GSM_UNPACKED_FRAME_SIZE_IN_BYTES 320 +#define GSM_UNPACKED_FRAME_SIZE_IN_SHORTS 160 - void * (*gsm_session_create)() = 0; - void (*gsm_session_destroy)(void *) = 0; - void (*gsm_session_encode)(void *,short *,unsigned char *) = 0; - int (*gsm_session_decode)(void *,unsigned char *,short *) = 0; +void * (*gsm_session_create)() = 0; +void (*gsm_session_destroy)(void *) = 0; +void (*gsm_session_encode)(void *, short *, unsigned char *) = 0; +int (*gsm_session_decode)(void *, unsigned char *, short *) = 0; - void * g_pGSMCodecLibraryHandle = 0; +void * g_pGSMCodecLibraryHandle = 0; - bool kvi_gsm_codec_init() - { - if(g_pGSMCodecLibraryHandle)return true; // Already initialized - - g_pGSMCodecLibraryHandle = dlopen("libgsm.so",RTLD_NOW | RTLD_GLOBAL); - if(!g_pGSMCodecLibraryHandle)return false; // no way to open it - - gsm_session_create = (void * (*)()) dlsym(g_pGSMCodecLibraryHandle,"gsm_create"); - gsm_session_destroy = (void (*)(void *)) dlsym(g_pGSMCodecLibraryHandle,"gsm_destroy"); - gsm_session_encode = (void (*)(void *,short *,unsigned char *)) dlsym(g_pGSMCodecLibraryHandle,"gsm_encode"); - gsm_session_decode = (int (*)(void *,unsigned char *,short *)) dlsym(g_pGSMCodecLibraryHandle,"gsm_decode"); - - if(! (gsm_session_create && gsm_session_destroy && gsm_session_encode && gsm_session_decode)) - { - dlclose(g_pGSMCodecLibraryHandle); - g_pGSMCodecLibraryHandle = 0; - return false; - } - return true; - } +bool kvi_gsm_codec_init() +{ + if(g_pGSMCodecLibraryHandle) + return true; // Already initialized - void kvi_gsm_codec_done() - { - if(g_pGSMCodecLibraryHandle) - { - dlclose(g_pGSMCodecLibraryHandle); - g_pGSMCodecLibraryHandle = 0; - } - } + g_pGSMCodecLibraryHandle = dlopen("libgsm.so", RTLD_NOW | RTLD_GLOBAL); + if(!g_pGSMCodecLibraryHandle) + return false; // no way to open it + gsm_session_create = (void * (*)())dlsym(g_pGSMCodecLibraryHandle, "gsm_create"); + gsm_session_destroy = (void (*)(void *))dlsym(g_pGSMCodecLibraryHandle, "gsm_destroy"); + gsm_session_encode = (void (*)(void *, short *, unsigned char *))dlsym(g_pGSMCodecLibraryHandle, "gsm_encode"); + gsm_session_decode = (int (*)(void *, unsigned char *, short *))dlsym(g_pGSMCodecLibraryHandle, "gsm_decode"); - DccVoiceGsmCodec::DccVoiceGsmCodec() - : DccVoiceCodec() + if(!(gsm_session_create && gsm_session_destroy && gsm_session_encode && gsm_session_decode)) { - m_pEncodeState = gsm_session_create(); - m_pDecodeState = gsm_session_create(); - m_szName = "gsm (compression 33:320)"; + dlclose(g_pGSMCodecLibraryHandle); + g_pGSMCodecLibraryHandle = 0; + return false; } + return true; +} - DccVoiceGsmCodec::~DccVoiceGsmCodec() +void kvi_gsm_codec_done() +{ + if(g_pGSMCodecLibraryHandle) { - gsm_session_destroy(m_pEncodeState); - gsm_session_destroy(m_pDecodeState); + dlclose(g_pGSMCodecLibraryHandle); + g_pGSMCodecLibraryHandle = 0; } +} - void DccVoiceGsmCodec::encode(KviDataBuffer * signal,KviDataBuffer * stream) - { - if(signal->size() < GSM_UNPACKED_FRAME_SIZE_IN_BYTES)return; // nothing to encode +DccVoiceGsmCodec::DccVoiceGsmCodec() + : DccVoiceCodec() +{ + m_pEncodeState = gsm_session_create(); + m_pDecodeState = gsm_session_create(); + m_szName = "gsm (compression 33:320)"; +} - unsigned char * ptr = signal->data(); +DccVoiceGsmCodec::~DccVoiceGsmCodec() +{ + gsm_session_destroy(m_pEncodeState); + gsm_session_destroy(m_pDecodeState); +} - int uFrames = signal->size() / GSM_UNPACKED_FRAME_SIZE_IN_BYTES; - int uTotalDataCompressed = uFrames * GSM_UNPACKED_FRAME_SIZE_IN_BYTES; - int uFrameOffset = stream->size(); - unsigned char * endPtr = ptr + uTotalDataCompressed; +void DccVoiceGsmCodec::encode(KviDataBuffer * signal, KviDataBuffer * stream) +{ + if(signal->size() < GSM_UNPACKED_FRAME_SIZE_IN_BYTES) + return; // nothing to encode - stream->addSize(GSM_PACKED_FRAME_SIZE_IN_BYTES * uFrames); + unsigned char * ptr = signal->data(); - while(ptr != endPtr) - { - gsm_session_encode(m_pEncodeState,(short *)ptr,stream->data() + uFrameOffset); - ptr += GSM_UNPACKED_FRAME_SIZE_IN_BYTES; - uFrameOffset += GSM_PACKED_FRAME_SIZE_IN_BYTES; - } - signal->remove(uTotalDataCompressed); - } + int uFrames = signal->size() / GSM_UNPACKED_FRAME_SIZE_IN_BYTES; + int uTotalDataCompressed = uFrames * GSM_UNPACKED_FRAME_SIZE_IN_BYTES; + int uFrameOffset = stream->size(); + unsigned char * endPtr = ptr + uTotalDataCompressed; - void DccVoiceGsmCodec::decode(KviDataBuffer * stream,KviDataBuffer * signal) - { - if(stream->size() < GSM_PACKED_FRAME_SIZE_IN_BYTES)return; // nothing to decode - - unsigned char * ptr = stream->data(); - - // Gsm codec - int uFrames = stream->size() / GSM_PACKED_FRAME_SIZE_IN_BYTES; - int uTotalDataDecompressed = uFrames * GSM_PACKED_FRAME_SIZE_IN_BYTES; - int uSignalOffset = signal->size(); - unsigned char * endPtr = ptr + (uTotalDataDecompressed); - - signal->addSize(GSM_UNPACKED_FRAME_SIZE_IN_BYTES * uFrames); - - while(ptr != endPtr) - { - // We don't check the return value here - // Well..it is either an unrecoverable internal error - // or a broken frame... - // but if we receive broken frames over DCC...well....better - // check the hardware...or the remote codec as well... - gsm_session_decode(m_pDecodeState,ptr,(short *)(signal->data() + uSignalOffset)); - ptr += GSM_PACKED_FRAME_SIZE_IN_BYTES; - uSignalOffset += GSM_UNPACKED_FRAME_SIZE_IN_BYTES; - } - stream->remove(uTotalDataDecompressed); - } + stream->addSize(GSM_PACKED_FRAME_SIZE_IN_BYTES * uFrames); - int DccVoiceGsmCodec::encodedFrameSize() + while(ptr != endPtr) { - return GSM_PACKED_FRAME_SIZE_IN_BYTES; + gsm_session_encode(m_pEncodeState, (short *)ptr, stream->data() + uFrameOffset); + ptr += GSM_UNPACKED_FRAME_SIZE_IN_BYTES; + uFrameOffset += GSM_PACKED_FRAME_SIZE_IN_BYTES; } + signal->remove(uTotalDataCompressed); +} + +void DccVoiceGsmCodec::decode(KviDataBuffer * stream, KviDataBuffer * signal) +{ + if(stream->size() < GSM_PACKED_FRAME_SIZE_IN_BYTES) + return; // nothing to decode + + unsigned char * ptr = stream->data(); + + // Gsm codec + int uFrames = stream->size() / GSM_PACKED_FRAME_SIZE_IN_BYTES; + int uTotalDataDecompressed = uFrames * GSM_PACKED_FRAME_SIZE_IN_BYTES; + int uSignalOffset = signal->size(); + unsigned char * endPtr = ptr + (uTotalDataDecompressed); + + signal->addSize(GSM_UNPACKED_FRAME_SIZE_IN_BYTES * uFrames); - int DccVoiceGsmCodec::decodedFrameSize() + while(ptr != endPtr) { - return GSM_UNPACKED_FRAME_SIZE_IN_BYTES; + // We don't check the return value here + // Well..it is either an unrecoverable internal error + // or a broken frame... + // but if we receive broken frames over DCC...well....better + // check the hardware...or the remote codec as well... + gsm_session_decode(m_pDecodeState, ptr, (short *)(signal->data() + uSignalOffset)); + ptr += GSM_PACKED_FRAME_SIZE_IN_BYTES; + uSignalOffset += GSM_UNPACKED_FRAME_SIZE_IN_BYTES; } + stream->remove(uTotalDataDecompressed); +} + +int DccVoiceGsmCodec::encodedFrameSize() +{ + return GSM_PACKED_FRAME_SIZE_IN_BYTES; +} + +int DccVoiceGsmCodec::decodedFrameSize() +{ + return GSM_UNPACKED_FRAME_SIZE_IN_BYTES; +} #endif // COMPILE_USE_GSM diff --git a/src/modules/dcc/DccVoiceGsmCodec.h b/src/modules/dcc/DccVoiceGsmCodec.h index 36cc1ae95..9a86de7ba 100644 --- a/src/modules/dcc/DccVoiceGsmCodec.h +++ b/src/modules/dcc/DccVoiceGsmCodec.h @@ -26,30 +26,31 @@ #include "kvi_settings.h" - #ifdef COMPILE_USE_GSM - #include "DccVoiceCodec.h" - - #ifndef _GSMCODEC_CPP_ - extern bool kvi_gsm_codec_init(); - extern void kvi_gsm_codec_done(); - #endif //_GSMCODEC_CPP_ - - class DccVoiceGsmCodec : public DccVoiceCodec - { - public: - DccVoiceGsmCodec(); - virtual ~DccVoiceGsmCodec(); - private: - void * m_pEncodeState; - void * m_pDecodeState; - public: - virtual void encode(KviDataBuffer * signal,KviDataBuffer * stream); - virtual void decode(KviDataBuffer * stream,KviDataBuffer * signal); - virtual int encodedFrameSize(); - virtual int decodedFrameSize(); - }; +#include "DccVoiceCodec.h" + +#ifndef _GSMCODEC_CPP_ +extern bool kvi_gsm_codec_init(); +extern void kvi_gsm_codec_done(); +#endif //_GSMCODEC_CPP_ + +class DccVoiceGsmCodec : public DccVoiceCodec +{ +public: + DccVoiceGsmCodec(); + virtual ~DccVoiceGsmCodec(); + +private: + void * m_pEncodeState; + void * m_pDecodeState; + +public: + virtual void encode(KviDataBuffer * signal, KviDataBuffer * stream); + virtual void decode(KviDataBuffer * stream, KviDataBuffer * signal); + virtual int encodedFrameSize(); + virtual int decodedFrameSize(); +}; #endif //COMPILE_USE_GSM diff --git a/src/modules/dcc/DccVoiceWindow.cpp b/src/modules/dcc/DccVoiceWindow.cpp index 4356a274a..0a353bfaf 100644 --- a/src/modules/dcc/DccVoiceWindow.cpp +++ b/src/modules/dcc/DccVoiceWindow.cpp @@ -46,14 +46,14 @@ #include #if !defined(COMPILE_ON_WINDOWS) && !defined(COMPILE_ON_MINGW) - #include - #include - #include - #include - #include - //#include "KviError.h" - #include // for open() - #include // for ioctl() +#include +#include +#include +#include +#include +//#include "KviError.h" +#include // for open() +#include // for ioctl() #endif extern DccBroker * g_pDccBroker; @@ -61,25 +61,24 @@ extern DccBroker * g_pDccBroker; //Check for the *SS Api....we don't want to fail here... #ifndef COMPILE_DISABLE_DCC_VOICE - #ifdef HAVE_LINUX_SOUNDCARD_H - #include - #else - #ifdef HAVE_SYS_SOUNDCARD_H - #include - #else - #ifdef HAVE_SOUNDCARD_H - #include - #else - //CAN NOT COMPILE :( - #define COMPILE_DISABLE_DCC_VOICE - #if !defined(COMPILE_ON_WINDOWS) && !defined(COMPILE_ON_MINGW) - #warning "Can't find the soundcard.h header; you will NOT be able to use DCC Voice" - #endif - #endif - #endif - #endif +#ifdef HAVE_LINUX_SOUNDCARD_H +#include +#else +#ifdef HAVE_SYS_SOUNDCARD_H +#include +#else +#ifdef HAVE_SOUNDCARD_H +#include +#else +//CAN NOT COMPILE :( +#define COMPILE_DISABLE_DCC_VOICE +#if !defined(COMPILE_ON_WINDOWS) && !defined(COMPILE_ON_MINGW) +#warning "Can't find the soundcard.h header; you will NOT be able to use DCC Voice" +#endif +#endif +#endif +#endif #endif - //#define KVI_AUDIO_DEVICE "/dev/dsp" // 32 fragments, 512 bytes @@ -88,36 +87,39 @@ extern DccBroker * g_pDccBroker; #define KVI_FORMAT AFMT_S16_LE #define KVI_NUM_CHANNELS 1 - bool kvi_dcc_voice_is_valid_codec(const char * codecName) { #ifdef COMPILE_USE_GSM - if(kvi_strEqualCI("gsm",codecName)) + if(kvi_strEqualCI("gsm", codecName)) { return kvi_gsm_codec_init(); } #endif - if(kvi_strEqualCI("adpcm",codecName))return true; - if(kvi_strEqualCI("null",codecName))return true; + if(kvi_strEqualCI("adpcm", codecName)) + return true; + if(kvi_strEqualCI("null", codecName)) + return true; return false; } static DccVoiceCodec * kvi_dcc_voice_get_codec(const char * codecName) { #ifdef COMPILE_USE_GSM - if(kvi_strEqualCI("gsm",codecName)) + if(kvi_strEqualCI("gsm", codecName)) { - if(kvi_gsm_codec_init())return new DccVoiceGsmCodec(); + if(kvi_gsm_codec_init()) + return new DccVoiceGsmCodec(); } #endif - if(kvi_strEqualCI("adpcm",codecName))return new DccVoiceAdpcmCodec(); - if(kvi_strEqualCI("null",codecName))return new DccVoiceNullCodec(); + if(kvi_strEqualCI("adpcm", codecName)) + return new DccVoiceAdpcmCodec(); + if(kvi_strEqualCI("null", codecName)) + return new DccVoiceNullCodec(); return new DccVoiceAdpcmCodec(); } - -DccVoiceThread::DccVoiceThread(KviWindow * wnd,kvi_socket_t fd,KviDccVoiceThreadOptions * opt) -: DccThread(wnd,fd) +DccVoiceThread::DccVoiceThread(KviWindow * wnd, kvi_socket_t fd, KviDccVoiceThreadOptions * opt) + : DccThread(wnd, fd) { #ifndef COMPILE_DISABLE_DCC_VOICE m_pOpt = opt; @@ -148,7 +150,8 @@ bool DccVoiceThread::checkSoundcard() bool bOpened = false; if(m_soundFd == -1) { - if(!openSoundcard(O_RDONLY))return false; + if(!openSoundcard(O_RDONLY)) + return false; bOpened = true; } @@ -156,59 +159,66 @@ bool DccVoiceThread::checkSoundcard() m_bSoundcardChecked = true; - if(ioctl(m_soundFd,SNDCTL_DSP_GETCAPS,&caps) < 0) + if(ioctl(m_soundFd, SNDCTL_DSP_GETCAPS, &caps) < 0) { - postMessageEvent(__tr2qs_ctx("WARNING: failed to check the soundcard duplex capabilities: if this is a half-duplex soundcard, use the DCC VOICE option to force half-duplex algorithm","dcc").toUtf8().data()); - if(bOpened)closeSoundcard(); + postMessageEvent(__tr2qs_ctx("WARNING: failed to check the soundcard duplex capabilities: if this is a half-duplex soundcard, use the DCC VOICE option to force half-duplex algorithm", "dcc").toUtf8().data()); + if(bOpened) + closeSoundcard(); return false; } if(!(caps & DSP_CAP_DUPLEX)) { m_pOpt->bForceHalfDuplex = true; // the device is half duplex...use it in that way - postMessageEvent(__tr2qs_ctx("Half-duplex soundcard detected, you will not be able to talk and listen at the same time","dcc").toUtf8().data()); + postMessageEvent(__tr2qs_ctx("Half-duplex soundcard detected, you will not be able to talk and listen at the same time", "dcc").toUtf8().data()); } - if(bOpened)closeSoundcard(); + if(bOpened) + closeSoundcard(); return true; #endif } - bool DccVoiceThread::openSoundcard(int mode) { #ifdef COMPILE_DISABLE_DCC_VOICE return false; #else int speed = m_pOpt->iSampleRate; - static int chans=KVI_NUM_CHANNELS; - static int fmt=KVI_FORMAT; + static int chans = KVI_NUM_CHANNELS; + static int fmt = KVI_FORMAT; static int frag = KVI_SNDCTL_FRAG_SIZE; - if(m_soundFd != -1) { - if(m_soundFdMode == mode)return true; // already open + if(m_soundFdMode == mode) + return true; // already open closeSoundcard(); } - m_soundFd = ::open(m_pOpt->szSoundDevice.ptr(),mode | O_NONBLOCK); - if(m_soundFd < 0)return false; + m_soundFd = ::open(m_pOpt->szSoundDevice.ptr(), mode | O_NONBLOCK); + if(m_soundFd < 0) + return false; if(!m_pOpt->bForceHalfDuplex) { - if(ioctl(m_soundFd,SNDCTL_DSP_SETDUPLEX,0) < 0)goto exit_false; + if(ioctl(m_soundFd, SNDCTL_DSP_SETDUPLEX, 0) < 0) + goto exit_false; } - if(ioctl(m_soundFd,SNDCTL_DSP_SETFRAGMENT,&frag)<0)goto exit_false; - if(ioctl(m_soundFd,SNDCTL_DSP_SETFMT,&fmt)<0)goto exit_false; - if(ioctl(m_soundFd,SNDCTL_DSP_CHANNELS,&chans)<0)goto exit_false; - if(ioctl(m_soundFd,SNDCTL_DSP_SPEED,&speed)<0)goto exit_false; + if(ioctl(m_soundFd, SNDCTL_DSP_SETFRAGMENT, &frag) < 0) + goto exit_false; + if(ioctl(m_soundFd, SNDCTL_DSP_SETFMT, &fmt) < 0) + goto exit_false; + if(ioctl(m_soundFd, SNDCTL_DSP_CHANNELS, &chans) < 0) + goto exit_false; + if(ioctl(m_soundFd, SNDCTL_DSP_SPEED, &speed) < 0) + goto exit_false; if(speed != m_pOpt->iSampleRate) { - KviCString tmp(KviCString::Format,__tr2qs_ctx("WARNING: failed to set the requested sample rate (%d): the device used closest match (%d)","dcc").toUtf8().data(), - m_pOpt->iSampleRate,speed); + KviCString tmp(KviCString::Format, __tr2qs_ctx("WARNING: failed to set the requested sample rate (%d): the device used closest match (%d)", "dcc").toUtf8().data(), + m_pOpt->iSampleRate, speed); postMessageEvent(tmp.ptr()); } @@ -216,7 +226,6 @@ bool DccVoiceThread::openSoundcard(int mode) m_soundFdMode = mode; - return true; exit_false: @@ -228,7 +237,7 @@ exit_false: bool DccVoiceThread::openSoundcardForWriting() { #ifndef COMPILE_DISABLE_DCC_VOICE - return openSoundcardWithDuplexOption(O_WRONLY,O_RDONLY); + return openSoundcardWithDuplexOption(O_WRONLY, O_RDONLY); #else return false; #endif @@ -237,13 +246,13 @@ bool DccVoiceThread::openSoundcardForWriting() bool DccVoiceThread::openSoundcardForReading() { #ifndef COMPILE_DISABLE_DCC_VOICE - return openSoundcardWithDuplexOption(O_RDONLY,O_WRONLY); + return openSoundcardWithDuplexOption(O_RDONLY, O_WRONLY); #else return false; #endif } -bool DccVoiceThread::openSoundcardWithDuplexOption(int openMode,int failMode) +bool DccVoiceThread::openSoundcardWithDuplexOption(int openMode, int failMode) { #ifndef COMPILE_DISABLE_DCC_VOICE if(m_soundFd == -1) @@ -252,8 +261,11 @@ bool DccVoiceThread::openSoundcardWithDuplexOption(int openMode,int failMode) if(m_pOpt->bForceHalfDuplex) { // Forcing half duplex... (user option or the card does not support full duplex mode) - if(!openSoundcard(openMode))return false; - } else { + if(!openSoundcard(openMode)) + return false; + } + else + { // Try read/write open if(!openSoundcard(O_RDWR)) { @@ -262,15 +274,18 @@ bool DccVoiceThread::openSoundcardWithDuplexOption(int openMode,int failMode) { // We haven't checked the full-duplex support yet... // Try to open in RDONLY o WRONLY mode - if(!openSoundcard(openMode))return false; + if(!openSoundcard(openMode)) + return false; if(!checkSoundcard()) { - postMessageEvent(__tr2qs_ctx("Oops! Failed to test the soundcard capabilities, expect problems...","dcc").toUtf8().data()); + postMessageEvent(__tr2qs_ctx("Oops! Failed to test the soundcard capabilities, expect problems...", "dcc").toUtf8().data()); } } // else the test has been done and it is a full duplex card that is just busy } } - } else { + } + else + { // Hmmm...already open // If it is open in O_RDWR or O_WRONLY mode...it is ok for us // but if it is open in O_RDONLY mode...we can do nothing...just wait @@ -302,23 +317,27 @@ bool DccVoiceThread::readWriteStep() bool bCanRead; bool bCanWrite; - if(kvi_select(m_fd,&bCanRead,&bCanWrite)) + if(kvi_select(m_fd, &bCanRead, &bCanWrite)) { if(bCanRead) { unsigned int actualSize = m_inFrameBuffer.size(); m_inFrameBuffer.resize(actualSize + 1024); - int readLen = kvi_socket_recv(m_fd,(void *)(m_inFrameBuffer.data() + actualSize),1024); + int readLen = kvi_socket_recv(m_fd, (void *)(m_inFrameBuffer.data() + actualSize), 1024); if(readLen > 0) { - if(readLen < 1024)m_inFrameBuffer.resize(actualSize + readLen); - m_pOpt->pCodec->decode(&m_inFrameBuffer,&m_inSignalBuffer); -//#warning "A maximum length for the signal buffer is actually needed!!!" - } else { - if(!handleInvalidSocketRead(readLen))return false; + if(readLen < 1024) + m_inFrameBuffer.resize(actualSize + readLen); + m_pOpt->pCodec->decode(&m_inFrameBuffer, &m_inSignalBuffer); + //#warning "A maximum length for the signal buffer is actually needed!!!" + } + else + { + if(!handleInvalidSocketRead(readLen)) + return false; m_inFrameBuffer.resize(actualSize); } - }// else { + } // else { // m_uSleepTime += 100; //} @@ -327,21 +346,24 @@ bool DccVoiceThread::readWriteStep() // Have somethihg to write ? if(m_outFrameBuffer.size() > 0) { - int written = kvi_socket_send(m_fd,m_outFrameBuffer.data(),m_outFrameBuffer.size()); + int written = kvi_socket_send(m_fd, m_outFrameBuffer.data(), m_outFrameBuffer.size()); if(written > 0) { m_outFrameBuffer.remove(written); - } else { - if(!handleInvalidSocketRead(written))return false; } - }// else { - // m_uSleepTime += 100; - // } - }// else { - // m_uSleepTime += 100; -// } -//#warning "Usleep here ?" - }// else { + else + { + if(!handleInvalidSocketRead(written)) + return false; + } + } // else { + // m_uSleepTime += 100; + // } + } // else { + // m_uSleepTime += 100; + // } + //#warning "Usleep here ?" + } // else { // if(!(m_bPlaying || m_bRecording)) // { // // Really NOTHING is happening...sleep a bit more @@ -367,7 +389,7 @@ bool DccVoiceThread::soundStep() { // Get the number of fragments that can be written to the soundcard without blocking - if(ioctl(m_soundFd,SNDCTL_DSP_GETOSPACE,&info) < 0) + if(ioctl(m_soundFd, SNDCTL_DSP_GETOSPACE, &info) < 0) { qDebug("get o space failed"); info.bytes = KVI_FRAGMENT_SIZE_IN_BYTES; // dummy... if this is not correct...well...we will block for 1024/16000 of a sec @@ -378,29 +400,37 @@ bool DccVoiceThread::soundStep() { int toWrite = info.fragments * info.fragsize; //qDebug("Can write %d bytes",toWrite); - if(m_inSignalBuffer.size() < toWrite)toWrite = m_inSignalBuffer.size(); - int written = write(m_soundFd,m_inSignalBuffer.data(),toWrite); - if(written > 0)m_inSignalBuffer.remove(written); - else { -//#warning "Do something for -1 here ?" -//#warning "Usleep ?" + if(m_inSignalBuffer.size() < toWrite) + toWrite = m_inSignalBuffer.size(); + int written = write(m_soundFd, m_inSignalBuffer.data(), toWrite); + if(written > 0) + m_inSignalBuffer.remove(written); + else + { + //#warning "Do something for -1 here ?" + //#warning "Usleep ?" } } //else { - // No stuff can be written...we are running too fast ? - // m_uSleepTime += 100; // sleep for a while - //} - } else { + // No stuff can be written...we are running too fast ? + // m_uSleepTime += 100; // sleep for a while + //} + } + else + { // hmmmm....playing, but nothing to write, possible underrun or EOF // a nice idea would be to use SNDCTL_DSP_GETODELAY here... // but it appears to be broken on some audio devices - if(ioctl(m_soundFd,SNDCTL_DSP_GETOSPACE,&info) < 0)info.fragstotal = info.fragments; // dummy...but what should we do ? + if(ioctl(m_soundFd, SNDCTL_DSP_GETOSPACE, &info) < 0) + info.fragstotal = info.fragments; // dummy...but what should we do ? if(info.fragstotal == info.fragments) { // underrun or EOF: close the device stopPlaying(); } } - } else { + } + else + { // do we have anything to play ? if(m_inSignalBuffer.size() > 0) { @@ -410,11 +440,13 @@ bool DccVoiceThread::soundStep() startPlaying(); m_iLastSignalBufferSize = m_inSignalBuffer.size(); - } else { + } + else + { // have stuff to play, but it's not enough to fill the pre-buffer // struct timeval tv; - gettimeofday(&tv,0); + gettimeofday(&tv, 0); long int sigBufferTime = (tv.tv_sec * 1000) + (tv.tv_usec / 1000); @@ -431,16 +463,18 @@ bool DccVoiceThread::soundStep() if((sigBufferTime - m_iLastSignalBufferTime) > preBufferTime) { startPlaying(); - if(m_bPlaying)m_iLastSignalBufferSize = 0; + if(m_bPlaying) + m_iLastSignalBufferSize = 0; } - } else { + } + else + { // signal buffer size differs...we have received new packets // and still pre-buffering m_iLastSignalBufferSize = m_inSignalBuffer.size(); m_iLastSignalBufferTime = sigBufferTime; } } - } } @@ -449,16 +483,16 @@ bool DccVoiceThread::soundStep() { fd_set rs; FD_ZERO(&rs); - FD_SET(m_soundFd,&rs); + FD_SET(m_soundFd, &rs); struct timeval tv; tv.tv_sec = 0; tv.tv_usec = 10; - int ret = select(m_soundFd + 1,&rs,0,0,&tv); + int ret = select(m_soundFd + 1, &rs, 0, 0, &tv); if(ret > 0) { // This is rather easy... audio_buf_info info; - if(ioctl(m_soundFd,SNDCTL_DSP_GETISPACE,&info) < 0) + if(ioctl(m_soundFd, SNDCTL_DSP_GETISPACE, &info) < 0) { qDebug("Ispace failed"); info.fragments = 0; // dummy... @@ -478,23 +512,27 @@ bool DccVoiceThread::soundStep() int oldSize = m_outSignalBuffer.size(); int available = info.fragments * info.fragsize; m_outSignalBuffer.addSize(available); - int readed = read(m_soundFd,m_outSignalBuffer.data() + oldSize,available); + int readed = read(m_soundFd, m_outSignalBuffer.data() + oldSize, available); if(readed < available) { // huh ? ...error ? - if(readed >= 0)m_outSignalBuffer.resize(oldSize + readed); - else { + if(readed >= 0) + m_outSignalBuffer.resize(oldSize + readed); + else + { if((errno == EINTR) || (errno == EAGAIN)) { m_outSignalBuffer.resize(oldSize); - } else { -//#warning "Critical error...do something reasonable!" + } + else + { + //#warning "Critical error...do something reasonable!" m_outSignalBuffer.resize(oldSize); } } } -/* + /* qDebug("Signal buffer:"); for(int i=0;i<200;i+=2) { @@ -504,12 +542,12 @@ bool DccVoiceThread::soundStep() } qDebug("END\n"); */ - m_pOpt->pCodec->encode(&m_outSignalBuffer,&m_outFrameBuffer); + m_pOpt->pCodec->encode(&m_outSignalBuffer, &m_outFrameBuffer); } - }// else { - // Nothing to read - // m_uSleepTime += 100; - // } + } // else { + // Nothing to read + // m_uSleepTime += 100; + // } } #endif // !COMPILE_DISABLE_DCC_VOICE @@ -520,17 +558,20 @@ void DccVoiceThread::startRecording() { #ifndef COMPILE_DISABLE_DCC_VOICE //qDebug("Start recording"); - if(m_bRecording)return; // already started + if(m_bRecording) + return; // already started if(openSoundcardForReading()) { -// qDebug("Posting event"); + // qDebug("Posting event"); KviThreadDataEvent * e = new KviThreadDataEvent(KVI_DCC_THREAD_EVENT_ACTION); e->setData(new int(KVI_DCC_VOICE_THREAD_ACTION_START_RECORDING)); - postEvent(parent(),e); + postEvent(parent(), e); m_bRecording = true; m_bRecordingRequestPending = false; - } else { + } + else + { m_bRecordingRequestPending = true; } #endif @@ -541,14 +582,16 @@ void DccVoiceThread::stopRecording() #ifndef COMPILE_DISABLE_DCC_VOICE //qDebug("Stop recording"); m_bRecordingRequestPending = false; - if(!m_bRecording)return; // already stopped + if(!m_bRecording) + return; // already stopped KviThreadDataEvent * e = new KviThreadDataEvent(KVI_DCC_THREAD_EVENT_ACTION); e->setData(new int(KVI_DCC_VOICE_THREAD_ACTION_STOP_RECORDING)); - postEvent(parent(),e); + postEvent(parent(), e); m_bRecording = false; - if(!m_bPlaying)closeSoundcard(); + if(!m_bPlaying) + closeSoundcard(); #endif } @@ -556,13 +599,14 @@ void DccVoiceThread::startPlaying() { #ifndef COMPILE_DISABLE_DCC_VOICE //qDebug("Start playing"); - if(m_bPlaying)return; + if(m_bPlaying) + return; if(openSoundcardForWriting()) { KviThreadDataEvent * e = new KviThreadDataEvent(KVI_DCC_THREAD_EVENT_ACTION); e->setData(new int(KVI_DCC_VOICE_THREAD_ACTION_START_PLAYING)); - postEvent(parent(),e); + postEvent(parent(), e); m_bPlaying = true; } #endif @@ -572,14 +616,16 @@ void DccVoiceThread::stopPlaying() { #ifndef COMPILE_DISABLE_DCC_VOICE //qDebug("Stop playing"); - if(!m_bPlaying)return; + if(!m_bPlaying) + return; KviThreadDataEvent * e = new KviThreadDataEvent(KVI_DCC_THREAD_EVENT_ACTION); e->setData(new int(KVI_DCC_VOICE_THREAD_ACTION_STOP_PLAYING)); - postEvent(parent(),e); + postEvent(parent(), e); m_bPlaying = false; - if(!m_bRecording)closeSoundcard(); + if(!m_bRecording) + closeSoundcard(); #endif } @@ -588,7 +634,7 @@ void DccVoiceThread::run() #ifndef COMPILE_DISABLE_DCC_VOICE for(;;) { -// m_uSleepTime = 0; + // m_uSleepTime = 0; // Dequeue events while(KviThreadEvent * e = dequeueEvent()) @@ -597,21 +643,28 @@ void DccVoiceThread::run() { delete e; goto exit_dcc; - } else if(e->id() == KVI_DCC_THREAD_EVENT_ACTION) + } + else if(e->id() == KVI_DCC_THREAD_EVENT_ACTION) { int * act = ((KviThreadDataEvent *)e)->getData(); - if(*act)startRecording(); - else stopRecording(); + if(*act) + startRecording(); + else + stopRecording(); delete act; delete e; - } else { + } + else + { // Other events are senseless to us delete e; } } - if(!readWriteStep())goto exit_dcc; - if(!soundStep())goto exit_dcc; + if(!readWriteStep()) + goto exit_dcc; + if(!soundStep()) + goto exit_dcc; m_pInfoMutex->lock(); m_iInputBufferSize = m_inSignalBuffer.size(); @@ -621,13 +674,13 @@ void DccVoiceThread::run() // Actually the maximum that we can sleep here is // around 500 usecs... = 0.0005 sec -> 8 bytes at 8 KHz - // if(m_uSleepTime)usleep(m_uSleepTime); + // if(m_uSleepTime)usleep(m_uSleepTime); // Start recording if the request was not fulfilled yet - if(m_bRecordingRequestPending)startRecording(); + if(m_bRecordingRequestPending) + startRecording(); } - exit_dcc: #endif //! COMPILE_DISABLE_DCC_VOICE @@ -636,24 +689,23 @@ exit_dcc: m_fd = KVI_INVALID_SOCKET; } - -DccVoiceWindow::DccVoiceWindow(DccDescriptor * dcc,const char * name) -: DccWindow(KviWindow::DccVoice,name,dcc) +DccVoiceWindow::DccVoiceWindow(DccDescriptor * dcc, const char * name) + : DccWindow(KviWindow::DccVoice, name, dcc) { m_pDescriptor = dcc; m_pSlaveThread = 0; - m_pSplitter = new KviTalSplitter(Qt::Horizontal,this); + m_pSplitter = new KviTalSplitter(Qt::Horizontal, this); m_pSplitter->setObjectName("dcc_window_splitter"); - m_pIrcView = new KviIrcView(m_pSplitter,this); + m_pIrcView = new KviIrcView(m_pSplitter, this); m_pHBox = new KviTalHBox(this); KviTalVBox * vbox = new KviTalVBox(m_pHBox); - m_pInputLabel = new QLabel(__tr2qs_ctx("Input buffer","dcc"),vbox); + m_pInputLabel = new QLabel(__tr2qs_ctx("Input buffer", "dcc"), vbox); m_pInputLabel->setFrameStyle(QFrame::Sunken | QFrame::Panel); - m_pOutputLabel = new QLabel(__tr2qs_ctx("Output buffer","dcc"),vbox); + m_pOutputLabel = new QLabel(__tr2qs_ctx("Output buffer", "dcc"), vbox); m_pOutputLabel->setFrameStyle(QFrame::Sunken | QFrame::Panel); vbox->setSpacing(1); @@ -673,7 +725,7 @@ DccVoiceWindow::DccVoiceWindow(DccDescriptor * dcc,const char * name) //#warning "The volume slider should be enabled only when receiving data" //m_pVolumeSlider = new QSlider(-100, 0, 10, 0, Qt::Vertical, m_pHBox, "dcc_voice_volume_slider"); - m_pVolumeSlider = new QSlider(Qt::Vertical,m_pHBox); + m_pVolumeSlider = new QSlider(Qt::Vertical, m_pHBox); m_pVolumeSlider->setObjectName("dcc_voice_volume_slider"); m_pVolumeSlider->setMinimum(-100); m_pVolumeSlider->setMaximum(0); @@ -684,29 +736,29 @@ DccVoiceWindow::DccVoiceWindow(DccDescriptor * dcc,const char * name) /* Update the tooltip */ setMixerVolume(m_pVolumeSlider->value()); m_pVolumeSlider->setMaximumWidth(16); - m_pVolumeSlider->setMaximumHeight(2*m_pPlayingLabel->height()); + m_pVolumeSlider->setMaximumHeight(2 * m_pPlayingLabel->height()); connect(m_pVolumeSlider, SIGNAL(valueChanged(int)), this, SLOT(setMixerVolume(int))); m_pTalkButton = new QToolButton(m_pHBox); m_pTalkButton->setEnabled(false); m_pTalkButton->setCheckable(true); QIcon iset; - iset.addPixmap(*(g_pIconManager->getBigIcon(KVI_BIGICON_DISCONNECTED)),QIcon::Normal,QIcon::Off); - iset.addPixmap(*(g_pIconManager->getBigIcon(KVI_BIGICON_CONNECTED)),QIcon::Normal,QIcon::On); + iset.addPixmap(*(g_pIconManager->getBigIcon(KVI_BIGICON_DISCONNECTED)), QIcon::Normal, QIcon::Off); + iset.addPixmap(*(g_pIconManager->getBigIcon(KVI_BIGICON_CONNECTED)), QIcon::Normal, QIcon::On); m_pTalkButton->setIcon(iset); - m_pTalkButton->setIconSize(QSize(32,32)); - connect(m_pTalkButton,SIGNAL(toggled(bool)),this,SLOT(startOrStopTalking(bool))); + m_pTalkButton->setIconSize(QSize(32, 32)); + connect(m_pTalkButton, SIGNAL(toggled(bool)), this, SLOT(startOrStopTalking(bool))); - m_pHBox->setStretchFactor(vbox,1); + m_pHBox->setStretchFactor(vbox, 1); m_pHBox->setMargin(2); m_pHBox->setSpacing(1); //setFocusHandler(m_pIrcView,this); m_pMarshal = new DccMarshal(this); - connect(m_pMarshal,SIGNAL(error(KviError::Code)),this,SLOT(handleMarshalError(KviError::Code))); - connect(m_pMarshal,SIGNAL(connected()),this,SLOT(connected())); - connect(m_pMarshal,SIGNAL(inProgress()),this,SLOT(connectionInProgress())); + connect(m_pMarshal, SIGNAL(error(KviError::Code)), this, SLOT(handleMarshalError(KviError::Code))); + connect(m_pMarshal, SIGNAL(connected()), this, SLOT(connected())); + connect(m_pMarshal, SIGNAL(inProgress()), this, SLOT(connectionInProgress())); m_pUpdateTimer = new QTimer(); @@ -726,24 +778,25 @@ DccVoiceWindow::~DccVoiceWindow() KviThreadManager::killPendingEvents(this); delete m_pUpdateTimer; -// delete m_pDescriptor; -// delete m_pMarshal; + // delete m_pDescriptor; + // delete m_pMarshal; } - void DccVoiceWindow::startConnection() { if(!(m_pDescriptor->bActive)) { // PASSIVE CONNECTION - output(KVI_OUT_DCCMSG,__tr2qs_ctx("Attempting a passive DCC VOICE connection","dcc")); - KviError::Code eError = m_pMarshal->dccListen(m_pDescriptor->szListenIp,m_pDescriptor->szListenPort,m_pDescriptor->bDoTimeout); + output(KVI_OUT_DCCMSG, __tr2qs_ctx("Attempting a passive DCC VOICE connection", "dcc")); + KviError::Code eError = m_pMarshal->dccListen(m_pDescriptor->szListenIp, m_pDescriptor->szListenPort, m_pDescriptor->bDoTimeout); if(eError != KviError::Success) handleMarshalError(eError); - } else { + } + else + { // ACTIVE CONNECTION - output(KVI_OUT_DCCMSG,__tr2qs_ctx("Attempting an active DCC VOICE connection","dcc")); - KviError::Code eError = m_pMarshal->dccConnect(m_pDescriptor->szIp.toUtf8().data(),m_pDescriptor->szPort.toUtf8().data(),m_pDescriptor->bDoTimeout); + output(KVI_OUT_DCCMSG, __tr2qs_ctx("Attempting an active DCC VOICE connection", "dcc")); + KviError::Code eError = m_pMarshal->dccConnect(m_pDescriptor->szIp.toUtf8().data(), m_pDescriptor->szPort.toUtf8().data(), m_pDescriptor->bDoTimeout); if(eError != KviError::Success) handleMarshalError(eError); } @@ -753,29 +806,34 @@ void DccVoiceWindow::connectionInProgress() { if(m_pDescriptor->bActive) { - output(KVI_OUT_DCCMSG,__tr2qs_ctx("Contacting host %Q on port %Q","dcc"),&(m_pDescriptor->szIp),&(m_pDescriptor->szPort)); - } else { + output(KVI_OUT_DCCMSG, __tr2qs_ctx("Contacting host %Q on port %Q", "dcc"), &(m_pDescriptor->szIp), &(m_pDescriptor->szPort)); + } + else + { - output(KVI_OUT_DCCMSG,__tr2qs_ctx("Listening on interface %Q port %Q","dcc"), - &(m_pMarshal->localIp()),&(m_pMarshal->localPort())); + output(KVI_OUT_DCCMSG, __tr2qs_ctx("Listening on interface %Q port %Q", "dcc"), + &(m_pMarshal->localIp()), &(m_pMarshal->localPort())); if(m_pDescriptor->bSendRequest) { - QString ip = !m_pDescriptor->szFakeIp.isEmpty() ? m_pDescriptor->szFakeIp : m_pDescriptor->szListenIp; - KviCString port = !m_pDescriptor->szFakePort.isEmpty() ? m_pDescriptor->szFakePort : m_pMarshal->localPort(); -//#warning "OPTION FOR SENDING 127.0.0.1 and so on (not an unsigned nuumber)" + QString ip = !m_pDescriptor->szFakeIp.isEmpty() ? m_pDescriptor->szFakeIp : m_pDescriptor->szListenIp; + KviCString port = !m_pDescriptor->szFakePort.isEmpty() ? m_pDescriptor->szFakePort : m_pMarshal->localPort(); + //#warning "OPTION FOR SENDING 127.0.0.1 and so on (not an unsigned nuumber)" struct in_addr a; - if(KviNetUtils::stringIpToBinaryIp(ip,&a)) { + if(KviNetUtils::stringIpToBinaryIp(ip, &a)) + { ip.setNum(htonl(a.s_addr)); } m_pDescriptor->console()->connection()->sendFmtData("PRIVMSG %s :%cDCC VOICE %s %Q %s %d%c", - m_pDescriptor->console()->connection()->encodeText(m_pDescriptor->szNick).data(), - 0x01,m_pDescriptor->szCodec.ptr(), - &ip,port.ptr(),m_pDescriptor->iSampleRate,0x01); - output(KVI_OUT_DCCMSG,__tr2qs_ctx("Sent DCC VOICE (%s) request to %Q, waiting for the remote client to connect...","dcc"), - m_pDescriptor->szCodec.ptr(),&(m_pDescriptor->szNick)); - } else output(KVI_OUT_DCCMSG,__tr2qs_ctx("DCC VOICE request not sent: awaiting manual connections","dcc")); + m_pDescriptor->console()->connection()->encodeText(m_pDescriptor->szNick).data(), + 0x01, m_pDescriptor->szCodec.ptr(), + &ip, port.ptr(), m_pDescriptor->iSampleRate, 0x01); + output(KVI_OUT_DCCMSG, __tr2qs_ctx("Sent DCC VOICE (%s) request to %Q, waiting for the remote client to connect...", "dcc"), + m_pDescriptor->szCodec.ptr(), &(m_pDescriptor->szNick)); + } + else + output(KVI_OUT_DCCMSG, __tr2qs_ctx("DCC VOICE request not sent: awaiting manual connections", "dcc")); } } @@ -783,20 +841,20 @@ const QString & DccVoiceWindow::target() { // This may change on the fly... m_szTarget.sprintf("%s@%s:%s", - m_pDescriptor->szNick.toUtf8().data(),m_pDescriptor->szIp.toUtf8().data(),m_pDescriptor->szPort.toUtf8().data()); + m_pDescriptor->szNick.toUtf8().data(), m_pDescriptor->szIp.toUtf8().data(), m_pDescriptor->szPort.toUtf8().data()); return m_szTarget; } -void DccVoiceWindow::getBaseLogFileName(QString &buffer) +void DccVoiceWindow::getBaseLogFileName(QString & buffer) { - buffer.sprintf("dccvoice_%s_%s_%s",m_pDescriptor->szNick.toUtf8().data(),m_pDescriptor->szLocalFileName.toUtf8().data(),m_pDescriptor->szPort.toUtf8().data()); + buffer.sprintf("dccvoice_%s_%s_%s", m_pDescriptor->szNick.toUtf8().data(), m_pDescriptor->szLocalFileName.toUtf8().data(), m_pDescriptor->szPort.toUtf8().data()); } void DccVoiceWindow::fillCaptionBuffers() { - KviCString tmp(KviCString::Format,"DCC Voice %s@%s:%s %s", - m_pDescriptor->szNick.toUtf8().data(),m_pDescriptor->szIp.toUtf8().data(),m_pDescriptor->szPort.toUtf8().data(), - m_pDescriptor->szLocalFileName.toUtf8().data()); + KviCString tmp(KviCString::Format, "DCC Voice %s@%s:%s %s", + m_pDescriptor->szNick.toUtf8().data(), m_pDescriptor->szIp.toUtf8().data(), m_pDescriptor->szPort.toUtf8().data(), + m_pDescriptor->szLocalFileName.toUtf8().data()); m_szPlainTextCaption = tmp; } @@ -806,7 +864,7 @@ QPixmap * DccVoiceWindow::myIconPtr() return g_pIconManager->getSmallIcon(KviIconManager::DccVoice); } -bool DccVoiceWindow::event(QEvent *e) +bool DccVoiceWindow::event(QEvent * e) { if(e->type() == KVI_THREAD_EVENT) { @@ -816,7 +874,7 @@ bool DccVoiceWindow::event(QEvent *e) { KviError::Code * pError = ((KviThreadDataEvent *)e)->getData(); QString ssss = KviError::getDescription(*pError); - output(KVI_OUT_DCCERROR,__tr2qs_ctx("ERROR: %Q","dcc"),&(ssss)); + output(KVI_OUT_DCCERROR, __tr2qs_ctx("ERROR: %Q", "dcc"), &(ssss)); delete pError; m_pUpdateTimer->stop(); updateInfo(); @@ -829,7 +887,7 @@ bool DccVoiceWindow::event(QEvent *e) case KVI_DCC_THREAD_EVENT_MESSAGE: { KviCString * str = ((KviThreadDataEvent *)e)->getData(); - outputNoFmt(KVI_OUT_DCCMSG,__tr_no_xgettext_ctx(str->ptr(),"dcc")); + outputNoFmt(KVI_OUT_DCCMSG, __tr_no_xgettext_ctx(str->ptr(), "dcc")); delete str; return true; } @@ -841,26 +899,25 @@ bool DccVoiceWindow::event(QEvent *e) { case KVI_DCC_VOICE_THREAD_ACTION_START_RECORDING: m_pRecordingLabel->setEnabled(true); - break; + break; case KVI_DCC_VOICE_THREAD_ACTION_STOP_RECORDING: m_pRecordingLabel->setEnabled(false); - break; + break; case KVI_DCC_VOICE_THREAD_ACTION_START_PLAYING: m_pPlayingLabel->setEnabled(true); - break; + break; case KVI_DCC_VOICE_THREAD_ACTION_STOP_PLAYING: m_pPlayingLabel->setEnabled(false); - break; + break; } delete act; return true; } break; default: - qDebug("Invalid event type %d received",((KviThreadEvent *)e)->id()); - break; + qDebug("Invalid event type %d received", ((KviThreadEvent *)e)->id()); + break; } - } return KviWindow::event(e); @@ -874,9 +931,9 @@ void DccVoiceWindow::updateInfo() int iOSize = m_pSlaveThread->m_iOutputBufferSize; int iISize = m_pSlaveThread->m_iInputBufferSize; m_pSlaveThread->m_pInfoMutex->unlock(); - KviCString tmp(KviCString::Format,__tr_ctx("Input buffer: %d bytes","dcc"),iISize); + KviCString tmp(KviCString::Format, __tr_ctx("Input buffer: %d bytes", "dcc"), iISize); m_pInputLabel->setText(tmp.ptr()); - tmp.sprintf(__tr_ctx("Output buffer: %d bytes","dcc"),iOSize); + tmp.sprintf(__tr_ctx("Output buffer: %d bytes", "dcc"), iOSize); m_pOutputLabel->setText(tmp.ptr()); } } @@ -884,8 +941,8 @@ void DccVoiceWindow::updateInfo() void DccVoiceWindow::resizeEvent(QResizeEvent *) { int hght2 = m_pHBox->sizeHint().height(); - m_pHBox->setGeometry(0,0,width(),hght2); - m_pSplitter->setGeometry(0,hght2,width(),height() - hght2); + m_pHBox->setGeometry(0, 0, width(), hght2); + m_pSplitter->setGeometry(0, hght2, width(), height() - hght2); } QSize DccVoiceWindow::sizeHint() const @@ -899,7 +956,7 @@ QSize DccVoiceWindow::sizeHint() const void DccVoiceWindow::handleMarshalError(KviError::Code eError) { QString ssss = KviError::getDescription(eError); - output(KVI_OUT_DCCERROR,__tr2qs_ctx("DCC failed: %Q","dcc"),&ssss); + output(KVI_OUT_DCCERROR, __tr2qs_ctx("DCC failed: %Q", "dcc"), &ssss); m_pTalkButton->setEnabled(false); m_pTalkButton->setChecked(false); m_pRecordingLabel->setEnabled(false); @@ -908,36 +965,35 @@ void DccVoiceWindow::handleMarshalError(KviError::Code eError) void DccVoiceWindow::connected() { - output(KVI_OUT_DCCMSG,__tr2qs_ctx("Connected to %Q:%Q","dcc"), - &(m_pMarshal->remoteIp()),&(m_pMarshal->remotePort())); - output(KVI_OUT_DCCMSG,__tr2qs_ctx("Local end is %Q:%Q","dcc"), - &(m_pMarshal->localIp()),&(m_pMarshal->localPort())); + output(KVI_OUT_DCCMSG, __tr2qs_ctx("Connected to %Q:%Q", "dcc"), + &(m_pMarshal->remoteIp()), &(m_pMarshal->remotePort())); + output(KVI_OUT_DCCMSG, __tr2qs_ctx("Local end is %Q:%Q", "dcc"), + &(m_pMarshal->localIp()), &(m_pMarshal->localPort())); if(!(m_pDescriptor->bActive)) { - m_pDescriptor->szIp = m_pMarshal->remoteIp(); + m_pDescriptor->szIp = m_pMarshal->remoteIp(); m_pDescriptor->szPort = m_pMarshal->remotePort(); m_pDescriptor->szHost = m_pMarshal->remoteIp(); } updateCaption(); - connect(m_pUpdateTimer,SIGNAL(timeout()),this,SLOT(updateInfo())); + connect(m_pUpdateTimer, SIGNAL(timeout()), this, SLOT(updateInfo())); m_pUpdateTimer->start(1000); KviDccVoiceThreadOptions * opt = new KviDccVoiceThreadOptions; - opt->pCodec = kvi_dcc_voice_get_codec(m_pDescriptor->szCodec.ptr()); - output(KVI_OUT_DCCMSG,__tr2qs_ctx("Actual codec used is '%s'","dcc"),opt->pCodec->name()); + output(KVI_OUT_DCCMSG, __tr2qs_ctx("Actual codec used is '%s'", "dcc"), opt->pCodec->name()); opt->bForceHalfDuplex = KVI_OPTION_BOOL(KviOption_boolDccVoiceForceHalfDuplex); -// opt->bForceDummyReadTrigger = false; + // opt->bForceDummyReadTrigger = false; opt->iPreBufferSize = KVI_OPTION_UINT(KviOption_uintDccVoicePreBufferSize); opt->szSoundDevice = KVI_OPTION_STRING(KviOption_stringDccVoiceSoundDevice).toUtf8().data(); opt->iSampleRate = m_pDescriptor->iSampleRate; - m_pSlaveThread = new DccVoiceThread(this,m_pMarshal->releaseSocket(),opt); - connect(m_pUpdateTimer,SIGNAL(timeout()),this,SLOT(updateInfo())); + m_pSlaveThread = new DccVoiceThread(this, m_pMarshal->releaseSocket(), opt); + connect(m_pUpdateTimer, SIGNAL(timeout()), this, SLOT(updateInfo())); m_pSlaveThread->start(); m_pTalkButton->setEnabled(true); @@ -959,8 +1015,10 @@ void DccVoiceWindow::startTalking() void DccVoiceWindow::startOrStopTalking(bool bStart) { - if(bStart)startTalking(); - else stopTalking(); + if(bStart) + startTalking(); + else + stopTalking(); } int DccVoiceWindow::getMixerVolume(void) const @@ -978,14 +1036,14 @@ int DccVoiceWindow::getMixerVolume(void) const req = KVI_OPTION_BOOL(KviOption_boolDccVoiceVolumeSliderControlsPCM) ? SOUND_MIXER_READ_PCM : SOUND_MIXER_READ_VOLUME; - if(::ioctl(fd,req,&ret)) + if(::ioctl(fd, req, &ret)) { ::close(fd); return 0; } left = (ret & 0x00ff); -// right = (ret & 0xff00) >> 8; + // right = (ret & 0xff00) >> 8; ::close(fd); @@ -1011,17 +1069,16 @@ void DccVoiceWindow::setMixerVolume(int vol) ::ioctl(fd, req, &val); ::close(fd); - m_pVolumeSlider->setToolTip(__tr2qs_ctx("Volume: %1","dcc").arg(-vol)); + m_pVolumeSlider->setToolTip(__tr2qs_ctx("Volume: %1", "dcc").arg(-vol)); #endif } - /* The code below doesn't work. Guess I have to catch some other widget's focusInEvent. Which one ? */ /* The point is to move the volume slider to correct position if for example user switched to * another KVirc window, fired up xmms, changed the volume, and returned to our dcc voice window */ -void DccVoiceWindow::focusInEvent(QFocusEvent *e) +void DccVoiceWindow::focusInEvent(QFocusEvent * e) { -// qDebug("focusInEvent()"); + // qDebug("focusInEvent()"); m_pVolumeSlider->setValue(getMixerVolume()); setMixerVolume(m_pVolumeSlider->value()); diff --git a/src/modules/dcc/DccVoiceWindow.h b/src/modules/dcc/DccVoiceWindow.h index d641c766e..bc37ffecb 100644 --- a/src/modules/dcc/DccVoiceWindow.h +++ b/src/modules/dcc/DccVoiceWindow.h @@ -43,7 +43,7 @@ class QSlider; class DccMarshal; #ifndef _DCC_VOICE_CPP_ - extern bool kvi_dcc_voice_is_valid_codec(const char * codecName); +extern bool kvi_dcc_voice_is_valid_codec(const char * codecName); #endif #define KVI_DCC_VOICE_THREAD_ACTION_START_RECORDING 0 @@ -53,42 +53,45 @@ class DccMarshal; typedef struct _KviDccVoiceThreadOptions { - bool bForceHalfDuplex; - int iPreBufferSize; - int iSampleRate; - KviCString szSoundDevice; + bool bForceHalfDuplex; + int iPreBufferSize; + int iSampleRate; + KviCString szSoundDevice; DccVoiceCodec * pCodec; } KviDccVoiceThreadOptions; class DccVoiceThread : public DccThread { friend class DccVoiceWindow; + public: - DccVoiceThread(KviWindow * wnd,kvi_socket_t fd,KviDccVoiceThreadOptions * opt); + DccVoiceThread(KviWindow * wnd, kvi_socket_t fd, KviDccVoiceThreadOptions * opt); ~DccVoiceThread(); + protected: -// bool m_bUseGsm; + // bool m_bUseGsm; KviDccVoiceThreadOptions * m_pOpt; - int m_soundFd; - int m_soundFdMode; - KviDataBuffer m_outFrameBuffer; - KviDataBuffer m_inFrameBuffer; - KviDataBuffer m_inSignalBuffer; - KviDataBuffer m_outSignalBuffer; - bool m_bPlaying; - bool m_bRecording; - bool m_bRecordingRequestPending; - bool m_bSoundcardChecked; - int m_iLastSignalBufferSize; - long m_iLastSignalBufferTime; -// unsigned int m_uSleepTime; - KviMutex * m_pInfoMutex; + int m_soundFd; + int m_soundFdMode; + KviDataBuffer m_outFrameBuffer; + KviDataBuffer m_inFrameBuffer; + KviDataBuffer m_inSignalBuffer; + KviDataBuffer m_outSignalBuffer; + bool m_bPlaying; + bool m_bRecording; + bool m_bRecordingRequestPending; + bool m_bSoundcardChecked; + int m_iLastSignalBufferSize; + long m_iLastSignalBufferTime; + // unsigned int m_uSleepTime; + KviMutex * m_pInfoMutex; // stuff protected by the mutex: - int m_iInputBufferSize; - int m_iOutputBufferSize; + int m_iInputBufferSize; + int m_iOutputBufferSize; + protected: bool checkSoundcard(); - bool openSoundcardWithDuplexOption(int openMode,int failMode); + bool openSoundcardWithDuplexOption(int openMode, int failMode); bool openSoundcard(int mode); bool openSoundcardForWriting(); bool openSoundcardForReading(); @@ -102,33 +105,34 @@ protected: virtual void run(); }; - class DccVoiceWindow : public DccWindow { Q_OBJECT public: - DccVoiceWindow(DccDescriptor * dcc,const char * name); + DccVoiceWindow(DccDescriptor * dcc, const char * name); ~DccVoiceWindow(); + protected: - KviTalHBox * m_pHBox; - QSlider * m_pVolumeSlider; - QLabel * m_pInputLabel; - QLabel * m_pOutputLabel; - QLabel * m_pRecordingLabel; - QLabel * m_pPlayingLabel; - QToolButton * m_pTalkButton; - QTimer * m_pUpdateTimer; - QString m_szTarget; - DccVoiceThread * m_pSlaveThread; + KviTalHBox * m_pHBox; + QSlider * m_pVolumeSlider; + QLabel * m_pInputLabel; + QLabel * m_pOutputLabel; + QLabel * m_pRecordingLabel; + QLabel * m_pPlayingLabel; + QToolButton * m_pTalkButton; + QTimer * m_pUpdateTimer; + QString m_szTarget; + DccVoiceThread * m_pSlaveThread; + protected: virtual void focusInEvent(QFocusEvent *); virtual const QString & target(); virtual void fillCaptionBuffers(); virtual QPixmap * myIconPtr(); - virtual void resizeEvent(QResizeEvent *e); + virtual void resizeEvent(QResizeEvent * e); virtual QSize sizeHint() const; - virtual bool event(QEvent *e); - virtual void getBaseLogFileName(QString &buffer); + virtual bool event(QEvent * e); + virtual void getBaseLogFileName(QString & buffer); void startTalking(); void stopTalking(); void startConnection(); @@ -140,7 +144,7 @@ protected slots: void startOrStopTalking(bool bStart); void setMixerVolume(int); void connectionInProgress(); -// void stopTalking(); + // void stopTalking(); }; #if 0 @@ -437,7 +441,6 @@ void KviVoiceConference::conferenceThread() // read raw audio data at sample rate X, sample size Y // multiplex data always at this sample rate and sample size - #endif #endif //_VOICE_H_ diff --git a/src/modules/dcc/DccWindow.cpp b/src/modules/dcc/DccWindow.cpp index 3f4b47994..e9eb2c597 100644 --- a/src/modules/dcc/DccWindow.cpp +++ b/src/modules/dcc/DccWindow.cpp @@ -26,20 +26,22 @@ #include "KviTalHBox.h" -DccWindow::DccWindow(KviWindow::Type eType,const char * name,DccDescriptor * d) -: KviWindow(eType,name, d->console()) +DccWindow::DccWindow(KviWindow::Type eType, const char * name, DccDescriptor * d) + : KviWindow(eType, name, d->console()) { m_pDescriptor = d; m_pDescriptor->setWindow(this); - m_pMarshal = 0; + m_pMarshal = 0; m_pButtonBox = new KviTalHBox(this); createTextEncodingButton(m_pButtonBox); } DccWindow::~DccWindow() { - if(m_pMarshal)delete m_pMarshal; - if(m_pDescriptor)delete m_pDescriptor; + if(m_pMarshal) + delete m_pMarshal; + if(m_pDescriptor) + delete m_pDescriptor; } KviWindow * DccWindow::dccMarshalOutputWindow() diff --git a/src/modules/dcc/DccWindow.h b/src/modules/dcc/DccWindow.h index 58d6f3355..31a4710fd 100644 --- a/src/modules/dcc/DccWindow.h +++ b/src/modules/dcc/DccWindow.h @@ -35,17 +35,19 @@ class DccWindow : public KviWindow, public DccMarshalOutputContext { Q_OBJECT public: - DccWindow(KviWindow::Type eType,const char * name,DccDescriptor * d); + DccWindow(KviWindow::Type eType, const char * name, DccDescriptor * d); ~DccWindow(); + protected: - DccDescriptor * m_pDescriptor; - DccMarshal * m_pMarshal; + DccDescriptor * m_pDescriptor; + DccMarshal * m_pMarshal; + public: - DccDescriptor * descriptor() { return m_pDescriptor; }; - const DccMarshal * marshal() { return m_pMarshal; }; - virtual DccThread * getSlaveThread() { return 0; }; - virtual KviWindow * dccMarshalOutputWindow(); - virtual const char * dccMarshalOutputContextString(); + DccDescriptor * descriptor() { return m_pDescriptor; }; + const DccMarshal * marshal() { return m_pMarshal; }; + virtual DccThread * getSlaveThread() { return 0; }; + virtual KviWindow * dccMarshalOutputWindow(); + virtual const char * dccMarshalOutputContextString(); }; #endif //_WINDOW_H_ diff --git a/src/modules/dcc/canvaswidget.cpp b/src/modules/dcc/canvaswidget.cpp index 4660c3173..e89326c49 100644 --- a/src/modules/dcc/canvaswidget.cpp +++ b/src/modules/dcc/canvaswidget.cpp @@ -25,1035 +25,1124 @@ #include "canvaswidget.h" #ifdef COMPILE_DCC_CANVAS - #include "KviCString.h" - #include "KviLocale.h" +#include "KviCString.h" +#include "KviLocale.h" - #include - #include - #include - #include - #include - #include +#include +#include +#include +#include +#include +#include - #include - #include +#include +#include - ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - // - // KviCanvasRectangleItem - // +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// +// KviCanvasRectangleItem +// - KviCanvasRectangleItem::KviCanvasRectangleItem(QCanvas * c,int x,int y,int w,int h) - : QCanvasRectangle(x,y,w,h,c) - { - } +KviCanvasRectangleItem::KviCanvasRectangleItem(QCanvas * c, int x, int y, int w, int h) + : QCanvasRectangle(x, y, w, h, c) +{ +} - KviCanvasRectangleItem::~KviCanvasRectangleItem() - { - } +KviCanvasRectangleItem::~KviCanvasRectangleItem() +{ +} - void KviCanvasRectangleItem::drawSelection(QPainter &p) +void KviCanvasRectangleItem::drawSelection(QPainter & p) +{ + p.setRasterOp(NotROP); + p.fillRect((int)x() + 1, (int)y() + 1, width() - 2, height() - 2, QBrush(Dense6Pattern)); + p.setPen(QPen(DotLine)); + p.drawRect((int)x(), (int)y(), width(), height()); + p.setRasterOp(CopyROP); +} + +void KviCanvasRectangleItem::setProperty(const QString & property, const QVariant & val) +{ + if(m_properties[property].isValid()) { - p.setRasterOp(NotROP); - p.fillRect((int)x() + 1,(int)y() + 1,width() - 2,height() - 2,QBrush(Dense6Pattern)); - p.setPen(QPen(DotLine)); - p.drawRect((int)x(),(int)y(),width(),height()); - p.setRasterOp(CopyROP); + m_properties.replace(property, val); + hide(); + show(); } +} - void KviCanvasRectangleItem::setProperty(const QString &property,const QVariant &val) - { - if(m_properties[property].isValid()) +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// +// KviCanvasPolygon +// +KviCanvasPolygon::KviCanvasPolygon(QCanvas * c, int x, int y, QPointArray & pnts, double dScaleFactor) + : QCanvasPolygon(c) +{ + m_properties.insert("clrForeground", QVariant(QColor(0, 0, 0))); + m_properties.insert("uLineWidth", QVariant((unsigned int)0)); + + m_properties.insert("clrBackground", QVariant(QColor(0, 0, 0))); + m_properties.insert("bHasBackground", QVariant(false, 1)); + + m_dScaleFactor = dScaleFactor; + m_points = pnts; + + resetPoints(); + move(x, y); +} + +KviCanvasPolygon::~KviCanvasPolygon() +{ +} + +void KviCanvasPolygon::setScaleFactor(double dScaleFactor) +{ + m_dScaleFactor = dScaleFactor; + resetPoints(); +} + +void KviCanvasPolygon::setInternalPoints(const QPointArray & pnts) +{ + m_points = pnts; + resetPoints(); +} + +void KviCanvasPolygon::resetPoints() +{ + QPointArray scaled(m_points.size()); + for(unsigned int i = 0; i < m_points.size(); i++) + { + int px; + int py; + m_points.point(i, &px, &py); + px = (int)(px * m_dScaleFactor); + py = (int)(py * m_dScaleFactor); + scaled.setPoint(i, px, py); + } + setPoints(scaled); +} + +int KviCanvasPolygon::rtti() const +{ + return KVI_CANVAS_RTTI_POLYGON; +} + +void KviCanvasPolygon::setProperty(const QString & property, const QVariant & val) +{ + if(m_properties[property].isValid()) + { + m_properties.replace(property, val); + if((property == "clrForeground") || (property == "uLineWidth")) + { + setPen(QPen(m_properties["clrForeground"].asColor(), m_properties["uLineWidth"].toInt())); + } + else if((property == "clrBackground") || (property == "bHasBackground")) + { + if(m_properties["bHasBackground"].asBool()) + setBrush(QBrush(m_properties["clrBackground"].asColor())); + else + setBrush(QBrush()); + } + else { - m_properties.replace(property,val); hide(); show(); } } +} - - ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - // - // KviCanvasPolygon - // - KviCanvasPolygon::KviCanvasPolygon(QCanvas * c,int x,int y,QPointArray &pnts,double dScaleFactor) - : QCanvasPolygon(c) +void KviCanvasPolygon::draw(QPainter & p) +{ + if(isEnabled()) { - m_properties.insert("clrForeground",QVariant(QColor(0,0,0))); - m_properties.insert("uLineWidth",QVariant((unsigned int)0)); - - m_properties.insert("clrBackground",QVariant(QColor(0,0,0))); - m_properties.insert("bHasBackground",QVariant(false,1)); - - m_dScaleFactor = dScaleFactor; - m_points = pnts; - - resetPoints(); - move(x,y); + p.setBrush(brush()); + p.setPen(pen()); + p.drawPolygon(areaPoints()); } - KviCanvasPolygon::~KviCanvasPolygon() + if(isSelected()) { + p.setRasterOp(NotROP); + p.setPen(QPen(DotLine)); + p.drawPolygon(areaPoints()); + p.setBrush(QBrush()); + double dVal = 10; + p.drawEllipse((int)(x() - dVal), (int)(y() - dVal), (int)(dVal * 2), (int)(dVal * 2)); + p.drawLine((int)(x() - (dVal * 2)), (int)y(), (int)(x() + (dVal * 2)), (int)y()); + p.drawLine((int)x(), (int)(y() - (dVal * 2)), (int)x(), (int)(y() + (dVal * 2))); + p.setRasterOp(CopyROP); + canvas()->setChanged(QRect((int)(x() - dVal), (int)(y() - dVal), (int)(dVal * 4), (int)(dVal * 4))); } +} - void KviCanvasPolygon::setScaleFactor(double dScaleFactor) - { - m_dScaleFactor = dScaleFactor; - resetPoints(); - } +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// +// KviCanvasEllipticItem +// - void KviCanvasPolygon::setInternalPoints(const QPointArray &pnts) - { - m_points = pnts; - resetPoints(); +KviCanvasEllipticItem::KviCanvasEllipticItem(QCanvas * c, int x, int y, int w, int h) + : KviCanvasRectangleItem(c, x, y, w, h) +{ + m_properties.insert("clrForeground", QVariant(QColor(0, 0, 0))); + m_properties.insert("uLineWidth", QVariant((unsigned int)0)); - } + m_properties.insert("clrBackground", QVariant(QColor(0, 0, 0))); + m_properties.insert("bHasBackground", QVariant(false, 1)); - void KviCanvasPolygon::resetPoints() - { - QPointArray scaled(m_points.size()); - for(unsigned int i=0;isetChanged(QRect((int)(x() - dVal),(int)(y() - dVal),(int)(dVal * 4),(int)(dVal * 4))); + hide(); + show(); } } +} - ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - // - // KviCanvasEllipticItem - // - - KviCanvasEllipticItem::KviCanvasEllipticItem(QCanvas * c,int x,int y,int w,int h) - : KviCanvasRectangleItem(c,x,y,w,h) - { - m_properties.insert("clrForeground",QVariant(QColor(0,0,0))); - m_properties.insert("uLineWidth",QVariant((unsigned int)0)); +int KviCanvasEllipticItem::rtti() const +{ + return KVI_CANVAS_RTTI_ELLIPSE; +} - m_properties.insert("clrBackground",QVariant(QColor(0,0,0))); - m_properties.insert("bHasBackground",QVariant(false,1)); +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// +// KviCanvasEllipse +// - // m_properties.insert("iStartAngle",QVariant(0)); - // m_properties.insert("iEndAngle",QVariant(360)); - } +KviCanvasEllipse::KviCanvasEllipse(QCanvas * c, int x, int y, int w, int h) + : KviCanvasEllipticItem(c, x, y, w, h) +{ +} - KviCanvasEllipticItem::~KviCanvasEllipticItem() - { - } +KviCanvasEllipse::~KviCanvasEllipse() +{ +} - void KviCanvasEllipticItem::draw(QPainter &p) - { - if(isEnabled()) - { - QBrush b = p.brush(); - if(m_properties["bHasBackground"].asBool())p.setBrush(m_properties["clrBackground"].asColor()); - else p.setBrush(QBrush()); - p.setPen(pen()); - drawContent(p); - p.setBrush(b); - } +int KviCanvasEllipse::rtti() const +{ + return KVI_CANVAS_RTTI_ELLIPSE; +} - if(isSelected())drawSelection(p); - } +void KviCanvasEllipse::drawContent(QPainter & p) +{ + p.drawEllipse((int)x(), (int)y(), width(), height()); +} - void KviCanvasEllipticItem::drawContent(QPainter &p) - { - } +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// +// KviCanvasPie +// - void KviCanvasEllipticItem::setProperty(const QString & property,const QVariant &val) - { - if(m_properties[property].isValid()) +KviCanvasPie::KviCanvasPie(QCanvas * c, int x, int y, int w, int h) + : KviCanvasEllipticItem(c, x, y, w, h) +{ + m_properties.insert("iStartAngle", QVariant((int)0)); + m_properties.insert("iExtensionAngle", QVariant((int)360)); +} + +KviCanvasPie::~KviCanvasPie() +{ +} + +int KviCanvasPie::rtti() const +{ + return KVI_CANVAS_RTTI_PIE; +} + +void KviCanvasPie::drawContent(QPainter & p) +{ + int iStartAngle = m_properties["iStartAngle"].asInt() * 16; + int iEndAngle = m_properties["iExtensionAngle"].asInt() * 16; + p.drawPie((int)x(), (int)y(), width(), height(), iStartAngle, iEndAngle); +} + +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// +// KviCanvasChord +// +KviCanvasChord::KviCanvasChord(QCanvas * c, int x, int y, int w, int h) + : KviCanvasEllipticItem(c, x, y, w, h) +{ + m_properties.insert("iStartAngle", QVariant((int)0)); + m_properties.insert("iExtensionAngle", QVariant((int)360)); +} + +KviCanvasChord::~KviCanvasChord() +{ +} + +int KviCanvasChord::rtti() const +{ + return KVI_CANVAS_RTTI_CHORD; +} + +void KviCanvasChord::drawContent(QPainter & p) +{ + int iStartAngle = m_properties["iStartAngle"].asInt() * 16; + int iEndAngle = m_properties["iExtensionAngle"].asInt() * 16; + p.drawChord((int)x(), (int)y(), width(), height(), iStartAngle, iEndAngle); +} + +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// +// KviCanvasRectangle +// +KviCanvasRectangle::KviCanvasRectangle(QCanvas * c, int x, int y, int w, int h) + : KviCanvasRectangleItem(c, x, y, w, h) +{ + m_properties.insert("clrForeground", QVariant(QColor(0, 0, 0))); + m_properties.insert("uLineWidth", QVariant((unsigned int)0)); + + m_properties.insert("clrBackground", QVariant(QColor(0, 0, 0))); + m_properties.insert("bHasBackground", QVariant(false, 1)); +} + +KviCanvasRectangle::~KviCanvasRectangle() +{ +} + +int KviCanvasRectangle::rtti() const +{ + return KVI_CANVAS_RTTI_RECTANGLE; +} + +void KviCanvasRectangle::setProperty(const QString & property, const QVariant & val) +{ + if(m_properties[property].isValid()) + { + m_properties.replace(property, val); + if((property == "clrForeground") || (property == "uLineWidth")) { - m_properties.replace(property,val); - if((property == "clrForeground") || (property == "uLineWidth")) - { - setPen(QPen(m_properties["clrForeground"].asColor(),m_properties["uLineWidth"].toInt())); - } else { - hide(); show(); - } + setPen(QPen(m_properties["clrForeground"].asColor(), m_properties["uLineWidth"].toInt())); + } + else + { + hide(); + show(); } } +} - int KviCanvasEllipticItem::rtti() const +void KviCanvasRectangle::draw(QPainter & p) +{ + if(isEnabled()) { - return KVI_CANVAS_RTTI_ELLIPSE; + if(m_properties["bHasBackground"].asBool()) + { + p.fillRect((int)x() + 1, (int)y() + 1, width() - 2, height() - 2, m_properties["clrBackground"].asColor()); + } + p.setPen(pen()); + p.drawRect((int)x(), (int)y(), width(), height()); } + if(isSelected()) + drawSelection(p); +} - ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - // - // KviCanvasEllipse - // +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// +// KviCanvasRichText +// +KviCanvasRichText::KviCanvasRichText(QCanvas * c, int x, int y, int w, int h) + : KviCanvasRectangleItem(c, x, y, w, h) +{ + QFont f = QFont(); + f.setStyleHint(QFont::SansSerif); + f.setPointSize(12); + m_properties.insert("szText", QVariant(QString("Insert here your RICH TEXT"))); + m_properties.insert("fntDefault", QVariant(f)); +} + +KviCanvasRichText::~KviCanvasRichText() +{ +} + +int KviCanvasRichText::rtti() const +{ + return KVI_CANVAS_RTTI_RICHTEXT; +} + +void KviCanvasRichText::draw(QPainter & p) +{ + if(isEnabled()) + { + QString szText = m_properties["szText"].asString(); + QSimpleRichText text(szText, m_properties["fntDefault"].asFont()); + text.setWidth(width()); + text.draw(&p, (int)x() + 1, (int)y() + 1, QRegion(QRect((int)x() + 1, (int)y() + 1, width(), height())), QColorGroup()); + } + + if(isSelected()) + drawSelection(p); +} + +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// +// KviCanvasLine +// +KviCanvasLine::KviCanvasLine(QCanvas * c, int x1, int y1, int x2, int y2) + : QCanvasLine(c) +{ + setPoints(x1, y1, x2, y2); + m_properties.insert("uLineWidth", QVariant((unsigned int)0)); + m_properties.insert("clrForeground", QVariant(QColor())); +} +KviCanvasLine::~KviCanvasLine() +{ +} - KviCanvasEllipse::KviCanvasEllipse(QCanvas * c,int x,int y,int w,int h) - : KviCanvasEllipticItem(c,x,y,w,h) +void KviCanvasLine::setProperty(const QString & property, const QVariant & val) +{ + m_properties.replace(property, val); + if((property == "uLineWidth") || (property == "clrForeground")) { + setPen(QPen(m_properties["clrForeground"].asColor(), m_properties["uLineWidth"].toInt())); } +} - KviCanvasEllipse::~KviCanvasEllipse() - { - } +int KviCanvasLine::rtti() const +{ + return KVI_CANVAS_RTTI_LINE; +} - int KviCanvasEllipse::rtti() const +void KviCanvasLine::draw(QPainter & p) +{ + if(isEnabled()) { - return KVI_CANVAS_RTTI_ELLIPSE; + p.setPen(pen()); + p.drawLine(startPoint(), endPoint()); } - void KviCanvasEllipse::drawContent(QPainter &p) + if(isSelected()) { - p.drawEllipse((int)x(),(int)y(),width(),height()); + p.setRasterOp(NotROP); + p.setPen(QPen(DotLine)); + p.drawLine(startPoint(), endPoint()); + p.setRasterOp(CopyROP); } +} - ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - // - // KviCanvasPie - // - +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// +// KviCanvasView +// +KviCanvasView::KviCanvasView(QCanvas * c, DccCanvasWidget * cw, QWidget * par) + : QCanvasView(c, par) +{ + m_pCanvasWidget = cw; + m_state = Idle; + m_dragMode = None; + m_pSelectedItem = 0; + viewport()->setMouseTracking(true); +} + +KviCanvasView::~KviCanvasView() +{ +} + +void KviCanvasView::insertRectangle() +{ + m_state = SelectOrigin; + setCursor(crossCursor); + m_objectToInsert = Rectangle; +} + +void KviCanvasView::insertRichText() +{ + m_state = SelectOrigin; + setCursor(crossCursor); + m_objectToInsert = RichText; +} + +void KviCanvasView::insertLine() +{ + m_state = SelectOrigin; + setCursor(crossCursor); + m_objectToInsert = Line; +} + +void KviCanvasView::insertEllipse() +{ + m_state = SelectOrigin; + setCursor(crossCursor); + m_objectToInsert = Ellipse; +} + +void KviCanvasView::insertPie() +{ + m_state = SelectOrigin; + setCursor(crossCursor); + m_objectToInsert = Pie; +} + +void KviCanvasView::insertChord() +{ + m_state = SelectOrigin; + setCursor(crossCursor); + m_objectToInsert = Chord; +} + +void KviCanvasView::insertPolygonTriangle() +{ + m_state = SelectOrigin; + setCursor(crossCursor); + m_objectToInsert = PolygonTriangle; +} + +void KviCanvasView::insertPolygonRectangle() +{ + m_state = SelectOrigin; + setCursor(crossCursor); + m_objectToInsert = PolygonRectangle; +} + +void KviCanvasView::insertPolygonPentagon() +{ + m_state = SelectOrigin; + setCursor(crossCursor); + m_objectToInsert = PolygonPentagon; +} + +void KviCanvasView::insertPolygonHexagon() +{ + m_state = SelectOrigin; + setCursor(crossCursor); + m_objectToInsert = PolygonPentagon; +} + +#ifndef M_PI +#define M_PI 3.14159265358979323846 +#endif - KviCanvasPie::KviCanvasPie(QCanvas * c,int x,int y,int w,int h) - : KviCanvasEllipticItem(c,x,y,w,h) +static void calcPolygonPoints(QPointArray & pnts, unsigned int nVertices) +{ + double dDelta = (2 * M_PI) / nVertices; + for(unsigned int i = 0; i < nVertices; i++) { - m_properties.insert("iStartAngle",QVariant((int)0)); - m_properties.insert("iExtensionAngle",QVariant((int)360)); + double dAng = dDelta * i; + double theX = 300 * sin(dAng); + double theY = 300 * cos(dAng); + pnts.setPoint(i, (int)theX, (int)theY); } +} + +void KviCanvasView::insertObjectAt(const QPoint & pnt, ObjectType o) +{ + QCanvasItem * r = 0; - KviCanvasPie::~KviCanvasPie() + switch(o) { + case Rectangle: + r = new KviCanvasRectangle(canvas(), pnt.x(), pnt.y(), 0, 0); + break; + case RichText: + r = new KviCanvasRichText(canvas(), pnt.x(), pnt.y(), 0, 0); + break; + case Line: + r = new KviCanvasLine(canvas(), pnt.x(), pnt.y(), pnt.x(), pnt.y()); + break; + case Ellipse: + r = new KviCanvasEllipse(canvas(), pnt.x(), pnt.y(), 0, 0); + break; + case Pie: + r = new KviCanvasPie(canvas(), pnt.x(), pnt.y(), 0, 0); + break; + case Chord: + r = new KviCanvasChord(canvas(), pnt.x(), pnt.y(), 0, 0); + break; + case PolygonTriangle: + { + QPointArray pa(3); + pa.setPoint(0, 0, -500); + pa.setPoint(1, -450, 220); + pa.setPoint(2, 450, 220); + r = new KviCanvasPolygon(canvas(), pnt.x(), pnt.y(), pa, 0.1); + } + break; + case PolygonRectangle: + { + QPointArray pa(4); + pa.setPoint(0, -350, -350); + pa.setPoint(1, 350, -350); + pa.setPoint(2, 350, 350); + pa.setPoint(3, -350, 350); + r = new KviCanvasPolygon(canvas(), pnt.x(), pnt.y(), pa, 0.1); + } + break; + case PolygonPentagon: + { + QPointArray pa(5); + calcPolygonPoints(pa, 5); + r = new KviCanvasPolygon(canvas(), pnt.x(), pnt.y(), pa, 0.1); + } + break; + case PolygonHexagon: + { + QPointArray pa(6); + calcPolygonPoints(pa, 6); + r = new KviCanvasPolygon(canvas(), pnt.x(), pnt.y(), pa, 0.1); + } + break; } - int KviCanvasPie::rtti() const + if(r) { - return KVI_CANVAS_RTTI_PIE; + setItemSelected(r); + r->setEnabled(true); + r->show(); } - void KviCanvasPie::drawContent(QPainter &p) + switch(KVI_CANVAS_RTTI_CONTROL_TYPE(r)) { - int iStartAngle = m_properties["iStartAngle"].asInt() * 16; - int iEndAngle = m_properties["iExtensionAngle"].asInt() * 16; - p.drawPie((int)x(),(int)y(),width(),height(),iStartAngle,iEndAngle); + case KVI_CANVAS_RTTI_CONTROL_TYPE_RECTANGLE: + beginDragRectangle((KviCanvasRectangleItem *)r, pnt, true); + break; + case KVI_CANVAS_RTTI_CONTROL_TYPE_LINE: + beginDragLine((KviCanvasLine *)r, pnt, true); + break; + // case KVI_CANVAS_RTTI_CONTROL_TYPE_POLYGON: + // beginDragPolygon((KviCanvasPolygon *)r,pnt,true); + // break; } + // canvas()->update(); +} - ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - // - // KviCanvasChord - // - KviCanvasChord::KviCanvasChord(QCanvas * c,int x,int y,int w,int h) - : KviCanvasEllipticItem(c,x,y,w,h) - { - m_properties.insert("iStartAngle",QVariant((int)0)); - m_properties.insert("iExtensionAngle",QVariant((int)360)); - } +void KviCanvasView::setItemSelected(QCanvasItem * it) +{ + clearSelection(); + it->setSelected(true); + m_pSelectedItem = it; + m_pCanvasWidget->m_pPropertiesWidget->editItem(it); +} - KviCanvasChord::~KviCanvasChord() - { - } +void KviCanvasView::clearSelection() +{ + if(!m_pSelectedItem) + return; + m_pSelectedItem->setSelected(false); + m_pSelectedItem = 0; + m_pCanvasWidget->m_pPropertiesWidget->editItem(0); +} - int KviCanvasChord::rtti() const - { - return KVI_CANVAS_RTTI_CHORD; - } +void KviCanvasView::beginDragLine(KviCanvasLine * it, const QPoint & p, bool bInitial) +{ + QPoint sp = it->startPoint(); - void KviCanvasChord::drawContent(QPainter &p) - { - int iStartAngle = m_properties["iStartAngle"].asInt() * 16; - int iEndAngle = m_properties["iExtensionAngle"].asInt() * 16; - p.drawChord((int)x(),(int)y(),width(),height(),iStartAngle,iEndAngle); - } + m_dragBegin = p - sp; - ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - // - // KviCanvasRectangle - // - KviCanvasRectangle::KviCanvasRectangle(QCanvas * c,int x,int y,int w,int h) - : KviCanvasRectangleItem(c,x,y,w,h) + if(bInitial) { - m_properties.insert("clrForeground",QVariant(QColor(0,0,0))); - m_properties.insert("uLineWidth",QVariant((unsigned int)0)); - - m_properties.insert("clrBackground",QVariant(QColor(0,0,0))); - m_properties.insert("bHasBackground",QVariant(false,1)); + m_dragMode = Bottom; + setCursor(sizeAllCursor); + return; } - KviCanvasRectangle::~KviCanvasRectangle() + if((abs(p.x() - sp.x()) < 3) && (abs(p.y() - sp.y()) < 3)) { + m_dragMode = Top; + setCursor(sizeAllCursor); + return; } - int KviCanvasRectangle::rtti() const + sp = it->endPoint(); + if((abs(p.x() - sp.x()) < 3) && (abs(p.y() - sp.y()) < 3)) { - return KVI_CANVAS_RTTI_RECTANGLE; + m_dragMode = Bottom; + setCursor(sizeAllCursor); + return; } - void KviCanvasRectangle::setProperty(const QString &property,const QVariant &val) + m_dragMode = All; + setCursor(pointingHandCursor); +} + +void KviCanvasView::dragLine(KviCanvasLine * it, const QPoint & p) +{ + switch(m_dragMode) { - if(m_properties[property].isValid()) + case Bottom: { - m_properties.replace(property,val); - if((property == "clrForeground") || (property == "uLineWidth")) - { - setPen(QPen(m_properties["clrForeground"].asColor(),m_properties["uLineWidth"].toInt())); - } else { - hide(); show(); - } + QPoint sp = it->startPoint(); + it->setPoints(sp.x(), sp.y(), p.x(), p.y()); } - } - - void KviCanvasRectangle::draw(QPainter & p) - { - if(isEnabled()) + break; + case Top: { - if(m_properties["bHasBackground"].asBool()) - { - p.fillRect((int)x() + 1,(int)y() + 1,width() - 2,height() - 2,m_properties["clrBackground"].asColor()); - } - p.setPen(pen()); - p.drawRect((int)x(),(int)y(),width(),height()); + QPoint ep = it->endPoint(); + it->setPoints(p.x(), p.y(), ep.x(), ep.y()); } - - if(isSelected())drawSelection(p); + break; + case All: + { + QPoint sp = p - m_dragBegin; + QPoint ep = sp + (it->endPoint() - it->startPoint()); + it->setPoints(sp.x(), sp.y(), ep.x(), ep.y()); + } + break; + default: /* make gcc happy */ + break; } + canvas()->update(); +} - ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +static double ssm_2d_rotationAngleFromXAxis(double dx, double dy) +{ // - // KviCanvasRichText + // v1 . v2 dx * 1 + dy * 0 dx + //acos(---------) = acos(-----------------) = acos(---------) + // |v1||v2| |(dx,dy)| * 1 |(dx,dy)| // - KviCanvasRichText::KviCanvasRichText(QCanvas * c,int x,int y,int w,int h) - : KviCanvasRectangleItem(c,x,y,w,h) - { - QFont f = QFont(); - f.setStyleHint(QFont::SansSerif); - f.setPointSize(12); - m_properties.insert("szText",QVariant(QString("Insert here your RICH TEXT"))); - m_properties.insert("fntDefault",QVariant(f)); - } - KviCanvasRichText::~KviCanvasRichText() - { - } + //double dVal = hypot(dx,dy); + double dVal = sqrt((dx * dx) + (dy * dy)); - int KviCanvasRichText::rtti() const - { - return KVI_CANVAS_RTTI_RICHTEXT; - } + if(dVal == 0.0) + return 0; // ??? - void KviCanvasRichText::draw(QPainter & p) - { - if(isEnabled()) - { - QString szText = m_properties["szText"].asString(); - QSimpleRichText text(szText,m_properties["fntDefault"].asFont()); - text.setWidth(width()); - text.draw(&p,(int)x() + 1,(int)y() + 1,QRegion(QRect((int)x() + 1,(int)y() + 1,width(),height())),QColorGroup()); - } + dVal = acos(dx / dVal); - if(isSelected())drawSelection(p); - } + return (dy > 0.0) ? dVal : -dVal; +} +static double ssm_2d_rotationAngle(double drefx, double drefy, double drotatedx, double drotatedy) +{ + double dRefAngle = ssm_2d_rotationAngleFromXAxis(drefx, drefy); + double dRotAngle = ssm_2d_rotationAngleFromXAxis(drotatedx, drotatedy); + return dRotAngle - dRefAngle; +} - ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - // - // KviCanvasLine +static void ssm_2d_rotate(double & dx, double & dy, double dAngle) +{ + // Rotation matrix: // - KviCanvasLine::KviCanvasLine(QCanvas * c,int x1,int y1,int x2,int y2) - : QCanvasLine(c) - { - setPoints(x1,y1,x2,y2); - m_properties.insert("uLineWidth",QVariant((unsigned int)0)); - m_properties.insert("clrForeground",QVariant(QColor())); - } + // | cos(x) sin(x) | + // | | + // | -sin(x) cos(x) | - KviCanvasLine::~KviCanvasLine() - { - } + double s = sin(dAngle); + double c = cos(dAngle); - void KviCanvasLine::setProperty(const QString &property,const QVariant &val) - { - m_properties.replace(property,val); - if((property == "uLineWidth") || (property == "clrForeground")) - { - setPen(QPen(m_properties["clrForeground"].asColor(),m_properties["uLineWidth"].toInt())); - } - } + double tmpX = (dx * c) - (dy * s); + double tmpY = (dx * s) + (dy * c); - int KviCanvasLine::rtti() const - { - return KVI_CANVAS_RTTI_LINE; - } + dx = tmpX; + dy = tmpY; +} - void KviCanvasLine::draw(QPainter &p) - { - if(isEnabled()) - { - p.setPen(pen()); - p.drawLine(startPoint(),endPoint()); - } +static double ssm_hypot(double a, double b) +{ + return sqrt((a * a) + (b * b)); +} - if(isSelected()) - { - p.setRasterOp(NotROP); - p.setPen(QPen(DotLine)); - p.drawLine(startPoint(),endPoint()); - p.setRasterOp(CopyROP); - } - } +void KviCanvasView::beginDragPolygon(KviCanvasPolygon * it, const QPoint & p, bool bShift, bool bCtrl) +{ + m_dragBegin = QPoint((int)(p.x() - it->x()), (int)(p.y() - it->y())); - ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - // - // KviCanvasView - // - KviCanvasView::KviCanvasView(QCanvas * c,DccCanvasWidget * cw,QWidget * par) - : QCanvasView(c,par) - { - m_pCanvasWidget = cw; - m_state = Idle; - m_dragMode = None; - m_pSelectedItem = 0; - viewport()->setMouseTracking(true); - } + QPointArray pa = it->areaPoints(); - KviCanvasView::~KviCanvasView() + for(unsigned int i = 0; i < pa.size(); i++) { + QPoint pnt = pa.point(i); + double dX = pnt.x() - p.x(); + double dY = pnt.y() - p.y(); + double dHypot = sqrt((dX * dX) + (dY * dY)); + if(dHypot < 3.0) + { + // We're dragging a point + m_dragMode = SinglePoint; + m_dragPointIndex = i; + setCursor(crossCursor); + return; + } } - void KviCanvasView::insertRectangle() + if(bShift) { - m_state = SelectOrigin; - setCursor(crossCursor); - m_objectToInsert = Rectangle; + m_dragMode = Scale; + m_dragScaleFactor = it->scaleFactor(); + setCursor(sizeAllCursor); + return; } - void KviCanvasView::insertRichText() + if(bCtrl) { - m_state = SelectOrigin; - setCursor(crossCursor); - m_objectToInsert = RichText; + m_dragMode = Rotate; + m_dragPointArray = it->internalPoints(); + // qDebug("Here"); + setCursor(sizeHorCursor); + return; } - void KviCanvasView::insertLine() - { - m_state = SelectOrigin; - setCursor(crossCursor); - m_objectToInsert = Line; - } + m_dragMode = All; + setCursor(pointingHandCursor); +} - void KviCanvasView::insertEllipse() +void KviCanvasView::dragPolygon(KviCanvasPolygon * it, const QPoint & p) +{ + switch(m_dragMode) { - m_state = SelectOrigin; - setCursor(crossCursor); - m_objectToInsert = Ellipse; + case All: + it->move(p.x() - m_dragBegin.x(), p.y() - m_dragBegin.y()); + break; + case SinglePoint: + { + QPointArray pnt = it->internalPoints(); + pnt.setPoint(m_dragPointIndex, (int)((p.x() - it->x()) / it->scaleFactor()), (int)((p.y() - it->y()) / it->scaleFactor())); + it->setInternalPoints(pnt); + } + break; + case Scale: + { + double dDistance = ssm_hypot(p.x() - it->x(), p.y() - it->y()); + double dOriginal = ssm_hypot(m_dragBegin.x(), m_dragBegin.y()); + if(dOriginal < 1) + dOriginal = 1; + if(dDistance < 0.1) + dDistance = 0.1; + it->setScaleFactor(m_dragScaleFactor * dDistance / dOriginal); + } + break; + case Rotate: + { + QPoint act((int)(p.x() - it->x()), (int)(p.y() - it->y())); + double dAngle = ssm_2d_rotationAngle(m_dragBegin.x(), m_dragBegin.y(), act.x(), act.y()); + // qDebug("%d,%d %d,%d %f",m_dragBegin.x(),m_dragBegin.y(),act.x(),act.y(),dAngle); + QPointArray thePoints = m_dragPointArray.copy(); + for(unsigned int i = 0; i < thePoints.size(); i++) + { + QPoint tmp = thePoints.point(i); + double dx = tmp.x(); + double dy = tmp.y(); + ssm_2d_rotate(dx, dy, dAngle); + thePoints.setPoint(i, (int)dx, (int)dy); + } + it->setInternalPoints(thePoints); + } + break; + default: + break; } + canvas()->update(); +} - void KviCanvasView::insertPie() - { - m_state = SelectOrigin; - setCursor(crossCursor); - m_objectToInsert = Pie; - } +void KviCanvasView::beginDragRectangle(KviCanvasRectangleItem * it, const QPoint & p, bool bInitial) +{ + m_dragBegin = QPoint((int)(p.x() - it->x()), (int)(p.y() - it->y())); - void KviCanvasView::insertChord() + if(bInitial) { - m_state = SelectOrigin; - setCursor(crossCursor); - m_objectToInsert = Chord; + // Right bottom + m_dragMode = RightBottom; + setCursor(sizeFDiagCursor); + return; } - void KviCanvasView::insertPolygonTriangle() + if(p.x() < (((int)it->x()) + 2)) { - m_state = SelectOrigin; - setCursor(crossCursor); - m_objectToInsert = PolygonTriangle; + // Left edge + if(p.y() < (((int)it->y()) + 2)) + { + // Left top + m_dragMode = LeftTop; + setCursor(sizeFDiagCursor); + return; + } + if(p.y() > (it->bottom() - 2)) + { + // Left bottom + m_dragMode = LeftBottom; + setCursor(sizeBDiagCursor); + return; + } + m_dragMode = Left; + setCursor(sizeHorCursor); + return; } - void KviCanvasView::insertPolygonRectangle() + if(p.x() > (it->right() - 2)) { - m_state = SelectOrigin; - setCursor(crossCursor); - m_objectToInsert = PolygonRectangle; + // Right edge + if(p.y() < (((int)it->y()) + 2)) + { + // Right top + m_dragMode = RightTop; + setCursor(sizeBDiagCursor); + return; + } + if(p.y() > (it->bottom() - 2)) + { + // Right bottom + m_dragMode = RightBottom; + setCursor(sizeFDiagCursor); + return; + } + m_dragMode = Right; + setCursor(sizeHorCursor); + return; } - void KviCanvasView::insertPolygonPentagon() + // Somewhere in the middle + if(p.y() < (((int)it->y()) + 2)) { - m_state = SelectOrigin; - setCursor(crossCursor); - m_objectToInsert = PolygonPentagon; + // Top + m_dragMode = Top; + setCursor(sizeVerCursor); + return; } - - void KviCanvasView::insertPolygonHexagon() + if(p.y() > (it->bottom() - 2)) { - m_state = SelectOrigin; - setCursor(crossCursor); - m_objectToInsert = PolygonPentagon; + // Bottom + m_dragMode = Bottom; + setCursor(sizeVerCursor); + return; } - #ifndef M_PI - #define M_PI 3.14159265358979323846 - #endif + m_dragMode = All; + setCursor(pointingHandCursor); +} - static void calcPolygonPoints(QPointArray &pnts,unsigned int nVertices) - { - double dDelta = (2 * M_PI) / nVertices; - for(unsigned int i=0;imove(p.x() - m_dragBegin.x(), p.y() - m_dragBegin.y()); break; - case Line: - r = new KviCanvasLine(canvas(),pnt.x(),pnt.y(),pnt.x(),pnt.y()); + case Left: + aux1 = it->width() + (int)(it->x() - p.x()); + aux2 = p.x(); + if(aux1 < 1) + { + aux2 += (aux1 - 1); + aux1 = 1; + } + it->move(aux2, it->y()); + it->setSize(aux1, it->height()); break; - case Ellipse: - r = new KviCanvasEllipse(canvas(),pnt.x(),pnt.y(),0,0); + case Right: + aux1 = it->width() + (p.x() - it->right()); + if(aux1 < 1) + aux1 = 1; + it->setSize(aux1, it->height()); break; - case Pie: - r = new KviCanvasPie(canvas(),pnt.x(),pnt.y(),0,0); + case Top: + aux1 = it->height() + (int)(it->y() - p.y()); + aux2 = p.y(); + if(aux1 < 1) + { + aux2 += (aux1 - 1); + aux1 = 1; + } + it->move(it->x(), aux2); + it->setSize(it->width(), aux1); break; - case Chord: - r = new KviCanvasChord(canvas(),pnt.x(),pnt.y(),0,0); + case Bottom: + aux1 = (int)it->height() + (p.y() - it->bottom()); + if(aux1 < 1) + aux1 = 1; + it->setSize(it->width(), aux1); break; - case PolygonTriangle: + case LeftTop: + aux1 = it->width() + (int)(it->x() - p.x()); + aux3 = p.x(); + if(aux1 < 1) { - QPointArray pa(3); - pa.setPoint(0,0,-500); - pa.setPoint(1,-450,220); - pa.setPoint(2,450,220); - r = new KviCanvasPolygon(canvas(),pnt.x(),pnt.y(),pa,0.1); + aux3 += (aux1 - 1); + aux1 = 1; } - break; - case PolygonRectangle: + aux2 = it->height() + (int)(it->y() - p.y()); + aux4 = p.y(); + if(aux2 < 1) { - QPointArray pa(4); - pa.setPoint(0,-350,-350); - pa.setPoint(1,350,-350); - pa.setPoint(2,350,350); - pa.setPoint(3,-350,350); - r = new KviCanvasPolygon(canvas(),pnt.x(),pnt.y(),pa,0.1); + aux4 += (aux2 - 1); + aux2 = 1; } + it->setSize(aux1, aux2); + it->move(aux3, aux4); break; - case PolygonPentagon: + case RightTop: + aux1 = it->width() + (int)(p.x() - it->right()); + if(aux1 < 1) + aux1 = 1; + aux2 = it->height() + (int)(it->y() - p.y()); + aux4 = p.y(); + if(aux2 < 1) { - QPointArray pa(5); - calcPolygonPoints(pa,5); - r = new KviCanvasPolygon(canvas(),pnt.x(),pnt.y(),pa,0.1); + aux4 += (aux2 - 1); + aux2 = 1; } + it->setSize(aux1, aux2); + it->move(it->x(), aux4); break; - case PolygonHexagon: + case LeftBottom: + aux1 = it->width() + (int)(it->x() - p.x()); + aux3 = p.x(); + if(aux1 < 1) { - QPointArray pa(6); - calcPolygonPoints(pa,6); - r = new KviCanvasPolygon(canvas(),pnt.x(),pnt.y(),pa,0.1); + aux3 += (aux1 - 1); + aux1 = 1; } + aux2 = it->height() + (int)(p.y() - it->bottom()); + if(aux2 < 1) + aux2 = 1; + it->setSize(aux1, aux2); + it->move(aux3, it->y()); break; - } - - if(r) - { - setItemSelected(r); - r->setEnabled(true); - r->show(); - } - - switch(KVI_CANVAS_RTTI_CONTROL_TYPE(r)) - { - case KVI_CANVAS_RTTI_CONTROL_TYPE_RECTANGLE: - beginDragRectangle((KviCanvasRectangleItem *)r,pnt,true); + case RightBottom: + aux1 = it->width() + (int)(p.x() - it->right()); + if(aux1 < 1) + aux1 = 1; + aux2 = it->height() + (int)(p.y() - it->bottom()); + if(aux2 < 1) + aux2 = 1; + it->setSize(aux1, aux2); break; - case KVI_CANVAS_RTTI_CONTROL_TYPE_LINE: - beginDragLine((KviCanvasLine *)r,pnt,true); + default: break; - // case KVI_CANVAS_RTTI_CONTROL_TYPE_POLYGON: - // beginDragPolygon((KviCanvasPolygon *)r,pnt,true); - // break; - } - - // canvas()->update(); } - void KviCanvasView::setItemSelected(QCanvasItem * it) - { - clearSelection(); - it->setSelected(true); - m_pSelectedItem = it; - m_pCanvasWidget->m_pPropertiesWidget->editItem(it); - - } + canvas()->update(); +} - void KviCanvasView::clearSelection() +void KviCanvasView::contentsMouseMoveEvent(QMouseEvent * e) +{ + // QPoint p = inverseWorldMatrix().map(e->pos()); + QPoint p = e->pos(); + if(e->state() & Qt::LeftButton) { - if(!m_pSelectedItem)return; - m_pSelectedItem->setSelected(false); - m_pSelectedItem = 0; - m_pCanvasWidget->m_pPropertiesWidget->editItem(0); + if((m_dragMode != None) && (m_pSelectedItem)) + { + if(m_pSelectedItem->isEnabled()) + m_pSelectedItem->setEnabled(false); + switch(KVI_CANVAS_RTTI_CONTROL_TYPE(m_pSelectedItem)) + { + case KVI_CANVAS_RTTI_CONTROL_TYPE_RECTANGLE: + dragRectangle((KviCanvasRectangleItem *)m_pSelectedItem, p); + break; + case KVI_CANVAS_RTTI_CONTROL_TYPE_LINE: + dragLine((KviCanvasLine *)m_pSelectedItem, p); + break; + case KVI_CANVAS_RTTI_CONTROL_TYPE_POLYGON: + dragPolygon((KviCanvasPolygon *)m_pSelectedItem, p); + break; + } + } } - - void KviCanvasView::beginDragLine(KviCanvasLine * it,const QPoint &p,bool bInitial) + else { - QPoint sp = it->startPoint(); - - m_dragBegin = p - sp; - - if(bInitial) + // Without buttons + if(m_state == Idle) { - m_dragMode = Bottom; - setCursor(sizeAllCursor); - return; - } + QCanvasItemList l = canvas()->collisions(p); + QCanvasItemList::Iterator it = l.begin(); - if((abs(p.x() - sp.x()) < 3) && (abs(p.y() - sp.y()) < 3)) - { - m_dragMode = Top; - setCursor(sizeAllCursor); - return; - } - - sp = it->endPoint(); - if((abs(p.x() - sp.x()) < 3) && (abs(p.y() - sp.y()) < 3)) - { - m_dragMode = Bottom; - setCursor(sizeAllCursor); - return; - } - - m_dragMode = All; - setCursor(pointingHandCursor); - } - - void KviCanvasView::dragLine(KviCanvasLine * it,const QPoint &p) - { - switch(m_dragMode) - { - case Bottom: - { - QPoint sp = it->startPoint(); - it->setPoints(sp.x(),sp.y(),p.x(),p.y()); - } - break; - case Top: - { - QPoint ep = it->endPoint(); - it->setPoints(p.x(),p.y(),ep.x(),ep.y()); - } - break; - case All: + if(it != l.end()) { - QPoint sp = p - m_dragBegin; - QPoint ep = sp + (it->endPoint() - it->startPoint()); - it->setPoints(sp.x(),sp.y(),ep.x(),ep.y()); - } - break; - default: /* make gcc happy */ - break; - } - canvas()->update(); - } - - static double ssm_2d_rotationAngleFromXAxis(double dx,double dy) - { - // - // v1 . v2 dx * 1 + dy * 0 dx - //acos(---------) = acos(-----------------) = acos(---------) - // |v1||v2| |(dx,dy)| * 1 |(dx,dy)| - // - - //double dVal = hypot(dx,dy); - double dVal = sqrt((dx * dx) + (dy * dy)); - - if(dVal == 0.0)return 0; // ??? - - dVal = acos(dx / dVal); - - return (dy > 0.0) ? dVal : -dVal; - } - - static double ssm_2d_rotationAngle(double drefx,double drefy,double drotatedx,double drotatedy) - { - double dRefAngle = ssm_2d_rotationAngleFromXAxis(drefx,drefy); - double dRotAngle = ssm_2d_rotationAngleFromXAxis(drotatedx,drotatedy); - return dRotAngle - dRefAngle; - } - - static void ssm_2d_rotate(double &dx,double &dy,double dAngle) - { - // Rotation matrix: - // - // | cos(x) sin(x) | - // | | - // | -sin(x) cos(x) | - - double s = sin(dAngle); - double c = cos(dAngle); - - double tmpX = (dx * c) - (dy * s); - double tmpY = (dx * s) + (dy * c); - - dx = tmpX; - dy = tmpY; - } - - static double ssm_hypot(double a,double b) - { - return sqrt((a * a) + (b * b)); - } - - void KviCanvasView::beginDragPolygon(KviCanvasPolygon * it,const QPoint &p,bool bShift,bool bCtrl) - { - m_dragBegin = QPoint((int)(p.x() - it->x()),(int)(p.y() - it->y())); - - QPointArray pa = it->areaPoints(); - - for(unsigned int i=0;iscaleFactor(); - setCursor(sizeAllCursor); - return; - } - - if(bCtrl) - { - m_dragMode = Rotate; - m_dragPointArray = it->internalPoints(); - // qDebug("Here"); - setCursor(sizeHorCursor); - return; - } - - m_dragMode = All; - setCursor(pointingHandCursor); - } - - void KviCanvasView::dragPolygon(KviCanvasPolygon * it,const QPoint &p) - { - switch(m_dragMode) - { - case All: - it->move(p.x() - m_dragBegin.x(),p.y() - m_dragBegin.y()); - break; - case SinglePoint: - { - QPointArray pnt = it->internalPoints(); - pnt.setPoint(m_dragPointIndex,(int)((p.x() - it->x()) / it->scaleFactor()),(int)((p.y() - it->y()) / it->scaleFactor())); - it->setInternalPoints(pnt); - } - break; - case Scale: - { - double dDistance = ssm_hypot(p.x() - it->x(),p.y() - it->y()); - double dOriginal = ssm_hypot(m_dragBegin.x(),m_dragBegin.y()); - if(dOriginal < 1)dOriginal = 1; - if(dDistance < 0.1)dDistance = 0.1; - it->setScaleFactor(m_dragScaleFactor * dDistance / dOriginal); - } - break; - case Rotate: - { - QPoint act((int)(p.x() - it->x()),(int)(p.y() - it->y())); - double dAngle = ssm_2d_rotationAngle(m_dragBegin.x(),m_dragBegin.y(),act.x(),act.y()); - // qDebug("%d,%d %d,%d %f",m_dragBegin.x(),m_dragBegin.y(),act.x(),act.y(),dAngle); - QPointArray thePoints = m_dragPointArray.copy(); - for(unsigned int i=0;isetInternalPoints(thePoints); - } - break; - default: - break; - } - canvas()->update(); - } - - void KviCanvasView::beginDragRectangle(KviCanvasRectangleItem * it,const QPoint & p,bool bInitial) - { - m_dragBegin = QPoint((int)(p.x() - it->x()),(int)(p.y() - it->y())); - - if(bInitial) - { - // Right bottom - m_dragMode = RightBottom; - setCursor(sizeFDiagCursor); - return; - } - - if(p.x() < (((int)it->x()) + 2)) - { - // Left edge - if(p.y() < (((int)it->y()) + 2)) - { - // Left top - m_dragMode = LeftTop; - setCursor(sizeFDiagCursor); - return; - } - if(p.y() > ( it->bottom() - 2)) - { - // Left bottom - m_dragMode = LeftBottom; - setCursor(sizeBDiagCursor); - return; - } - m_dragMode = Left; - setCursor(sizeHorCursor); - return; - } - - if(p.x() > (it->right() - 2)) - { - // Right edge - if(p.y() < (((int)it->y()) + 2)) - { - // Right top - m_dragMode = RightTop; - setCursor(sizeBDiagCursor); - return; + else if(m_dragMode != None) + setCursor(arrowCursor); } - if(p.y() > ( it->bottom() - 2)) + else { - // Right bottom - m_dragMode = RightBottom; - setCursor(sizeFDiagCursor); - return; + if(m_dragMode != None) + setCursor(arrowCursor); } - m_dragMode = Right; - setCursor(sizeHorCursor); - return; - } - - // Somewhere in the middle - if(p.y() < (((int)it->y()) + 2)) - { - // Top - m_dragMode = Top; - setCursor(sizeVerCursor); - return; } - if(p.y() > ( it->bottom() - 2)) - { - // Bottom - m_dragMode = Bottom; - setCursor(sizeVerCursor); - return; - } - - m_dragMode = All; - setCursor(pointingHandCursor); } +} - void KviCanvasView::dragRectangle(KviCanvasRectangleItem * it,const QPoint & p) +void KviCanvasView::contentsMouseReleaseEvent(QMouseEvent * e) +{ + if(m_dragMode != None) { - - int aux1,aux2,aux3,aux4; - - switch(m_dragMode) + // Was just dragging a rectangle + m_dragMode = None; + setCursor(arrowCursor); + if(m_pSelectedItem) { - case All: - it->move(p.x() - m_dragBegin.x(),p.y() - m_dragBegin.y()); - break; - case Left: - aux1 = it->width() + (int)(it->x() - p.x()); - aux2 = p.x(); - if(aux1 < 1) - { - aux2 += (aux1 - 1); - aux1 = 1; - } - it->move(aux2,it->y()); - it->setSize(aux1,it->height()); - break; - case Right: - aux1 = it->width() + (p.x() - it->right()); - if(aux1 < 1)aux1 = 1; - it->setSize(aux1,it->height()); - break; - case Top: - aux1 = it->height() + (int)(it->y() - p.y()); - aux2 = p.y(); - if(aux1 < 1) - { - aux2 += (aux1 - 1); - aux1 = 1; - } - it->move(it->x(),aux2); - it->setSize(it->width(),aux1); - break; - case Bottom: - aux1 = (int)it->height() + (p.y() - it->bottom()); - if(aux1 < 1)aux1 = 1; - it->setSize(it->width(),aux1); - break; - case LeftTop: - aux1 = it->width() + (int)(it->x() - p.x()); - aux3 = p.x(); - if(aux1 < 1) - { - aux3 += (aux1 - 1); - aux1 = 1; - } - aux2 = it->height() + (int)(it->y() - p.y()); - aux4 = p.y(); - if(aux2 < 1) - { - aux4 += (aux2 - 1); - aux2 = 1; - } - it->setSize(aux1,aux2); - it->move(aux3,aux4); - break; - case RightTop: - aux1 = it->width() + (int)(p.x() - it->right()); - if(aux1 < 1)aux1 = 1; - aux2 = it->height() + (int)(it->y() - p.y()); - aux4 = p.y(); - if(aux2 < 1) - { - aux4 += (aux2 - 1); - aux2 = 1; - } - it->setSize(aux1,aux2); - it->move(it->x(),aux4); - break; - case LeftBottom: - aux1 = it->width() + (int)(it->x() - p.x()); - aux3 = p.x(); - if(aux1 < 1) - { - aux3 += (aux1 - 1); - aux1 = 1; - } - aux2 = it->height() + (int)(p.y() - it->bottom()); - if(aux2 < 1)aux2 = 1; - it->setSize(aux1,aux2); - it->move(aux3,it->y()); - break; - case RightBottom: - aux1 = it->width() + (int)(p.x() - it->right()); - if(aux1 < 1)aux1 = 1; - aux2 = it->height() + (int)(p.y() - it->bottom()); - if(aux2 < 1)aux2 = 1; - it->setSize(aux1,aux2); - break; - default: - break; + m_pSelectedItem->setEnabled(true); + canvas()->update(); } - - canvas()->update(); } +} - void KviCanvasView::contentsMouseMoveEvent(QMouseEvent *e) +void KviCanvasView::contentsMousePressEvent(QMouseEvent * e) +{ + if(e->button() & Qt::LeftButton) { - // QPoint p = inverseWorldMatrix().map(e->pos()); + // QPoint p = inverseWorldMatrix().map(e->pos()); QPoint p = e->pos(); - if(e->state() & Qt::LeftButton) + + switch(m_state) { - if((m_dragMode != None) && (m_pSelectedItem)) - { - if(m_pSelectedItem->isEnabled())m_pSelectedItem->setEnabled(false); - switch(KVI_CANVAS_RTTI_CONTROL_TYPE(m_pSelectedItem)) - { - case KVI_CANVAS_RTTI_CONTROL_TYPE_RECTANGLE: - dragRectangle((KviCanvasRectangleItem *)m_pSelectedItem,p); - break; - case KVI_CANVAS_RTTI_CONTROL_TYPE_LINE: - dragLine((KviCanvasLine *)m_pSelectedItem,p); - break; - case KVI_CANVAS_RTTI_CONTROL_TYPE_POLYGON: - dragPolygon((KviCanvasPolygon *)m_pSelectedItem,p); - break; - } - } - } else { - // Without buttons - if(m_state == Idle) + case SelectOrigin: + clearSelection(); + setCursor(arrowCursor); + m_state = Idle; + insertObjectAt(p, m_objectToInsert); + canvas()->update(); + break; + + case Idle: { QCanvasItemList l = canvas()->collisions(p); QCanvasItemList::Iterator it = l.begin(); @@ -1061,450 +1150,390 @@ if(it != l.end()) { // Got an item - QCanvasItem * hit = (QCanvasItem *)*it; + QCanvasItem * hit = *it; + if(hit != m_pSelectedItem) + { + // Was not selected yet + setItemSelected(hit); + canvas()->update(); + } // Now find the point on that we have clicked it - if(hit == m_pSelectedItem) + switch(KVI_CANVAS_RTTI_CONTROL_TYPE(hit)) { - switch(KVI_CANVAS_RTTI_CONTROL_TYPE(m_pSelectedItem)) - { - case KVI_CANVAS_RTTI_CONTROL_TYPE_RECTANGLE: - beginDragRectangle((KviCanvasRectangleItem *)m_pSelectedItem,p); + case KVI_CANVAS_RTTI_CONTROL_TYPE_RECTANGLE: + beginDragRectangle(((KviCanvasRectangleItem *)hit), p); break; - case KVI_CANVAS_RTTI_CONTROL_TYPE_LINE: - beginDragLine((KviCanvasLine *)m_pSelectedItem,p); + case KVI_CANVAS_RTTI_CONTROL_TYPE_LINE: + beginDragLine(((KviCanvasLine *)hit), p); break; - case KVI_CANVAS_RTTI_CONTROL_TYPE_POLYGON: - beginDragPolygon((KviCanvasPolygon *)m_pSelectedItem,p); + case KVI_CANVAS_RTTI_CONTROL_TYPE_POLYGON: + beginDragPolygon(((KviCanvasPolygon *)hit), p, e->state() & Qt::ShiftButton, e->state() & Qt::ControlButton); break; - } } - else if(m_dragMode != None)setCursor(arrowCursor); - } else { - if(m_dragMode != None)setCursor(arrowCursor); } - } - } - } - - void KviCanvasView::contentsMouseReleaseEvent(QMouseEvent *e) - { - if(m_dragMode != None) - { - // Was just dragging a rectangle - m_dragMode = None; - setCursor(arrowCursor); - if(m_pSelectedItem) - { - m_pSelectedItem->setEnabled(true); - canvas()->update(); - } - } - } - - void KviCanvasView::contentsMousePressEvent(QMouseEvent *e) - { - if(e->button() & Qt::LeftButton) - { - // QPoint p = inverseWorldMatrix().map(e->pos()); - QPoint p = e->pos(); - - switch(m_state) - { - case SelectOrigin: + else + { + // No item clearSelection(); - setCursor(arrowCursor); - m_state = Idle; - insertObjectAt(p,m_objectToInsert); canvas()->update(); - break; - - case Idle: - { - QCanvasItemList l = canvas()->collisions(p); - QCanvasItemList::Iterator it = l.begin(); - - if(it != l.end()) - { - // Got an item - QCanvasItem * hit = *it; - if(hit != m_pSelectedItem) - { - // Was not selected yet - setItemSelected(hit); - canvas()->update(); - } - // Now find the point on that we have clicked it - switch(KVI_CANVAS_RTTI_CONTROL_TYPE(hit)) - { - case KVI_CANVAS_RTTI_CONTROL_TYPE_RECTANGLE: - beginDragRectangle(((KviCanvasRectangleItem *)hit),p); - break; - case KVI_CANVAS_RTTI_CONTROL_TYPE_LINE: - beginDragLine(((KviCanvasLine *)hit),p); - break; - case KVI_CANVAS_RTTI_CONTROL_TYPE_POLYGON: - beginDragPolygon(((KviCanvasPolygon *)hit),p,e->state() & Qt::ShiftButton,e->state() & Qt::ControlButton); - break; - } - } else { - // No item - clearSelection(); - canvas()->update(); - } } - break; } + break; } } +} - void KviCanvasView::propertyChanged(const QString &s,const QVariant &v) - { - if(!m_pSelectedItem)return; +void KviCanvasView::propertyChanged(const QString & s, const QVariant & v) +{ + if(!m_pSelectedItem) + return; - switch(KVI_CANVAS_RTTI_CONTROL_TYPE(m_pSelectedItem)) - { - case KVI_CANVAS_RTTI_CONTROL_TYPE_RECTANGLE: - ((KviCanvasRectangleItem *)m_pSelectedItem)->setProperty(s,v); + switch(KVI_CANVAS_RTTI_CONTROL_TYPE(m_pSelectedItem)) + { + case KVI_CANVAS_RTTI_CONTROL_TYPE_RECTANGLE: + ((KviCanvasRectangleItem *)m_pSelectedItem)->setProperty(s, v); break; - case KVI_CANVAS_RTTI_CONTROL_TYPE_LINE: - ((KviCanvasLine *)m_pSelectedItem)->setProperty(s,v); + case KVI_CANVAS_RTTI_CONTROL_TYPE_LINE: + ((KviCanvasLine *)m_pSelectedItem)->setProperty(s, v); break; - case KVI_CANVAS_RTTI_CONTROL_TYPE_POLYGON: - ((KviCanvasPolygon *)m_pSelectedItem)->setProperty(s,v); + case KVI_CANVAS_RTTI_CONTROL_TYPE_POLYGON: + ((KviCanvasPolygon *)m_pSelectedItem)->setProperty(s, v); break; - } - - canvas()->update(); } + canvas()->update(); +} - ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - // - // KviVariantTableItem - // - KviVariantTableItem::KviVariantTableItem(QTable * t,const QVariant & property) - : QTableItem(t,QTableItem::WhenCurrent,QString()) - { - m_property = property; - } +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// +// KviVariantTableItem +// +KviVariantTableItem::KviVariantTableItem(QTable * t, const QVariant & property) + : QTableItem(t, QTableItem::WhenCurrent, QString()) +{ + m_property = property; +} - KviVariantTableItem::~KviVariantTableItem() - { - } +KviVariantTableItem::~KviVariantTableItem() +{ +} - QWidget * KviVariantTableItem::createEditor() const +QWidget * KviVariantTableItem::createEditor() const +{ + switch(m_property.type()) { - switch(m_property.type()) + case QVariant::String: { - case QVariant::String: - { - QLineEdit * e = new QLineEdit(table()->viewport()); - e->setText(m_property.toString()); - return e; - } - break; - case QVariant::Int: - { - QLineEdit * e = new QLineEdit(table()->viewport()); - QString sz; - sz.setNum(m_property.toInt()); - e->setText(sz); - e->setValidator(new QIntValidator(e)); - return e; - } - break; - case QVariant::UInt: - { - QLineEdit * e = new QLineEdit(table()->viewport()); - QString sz; - sz.setNum(m_property.toInt()); - e->setText(sz); - QIntValidator * i = new QIntValidator(e); - i->setBottom(0); - e->setValidator(i); - return e; - } - break; - case QVariant::Bool: - { - QComboBox * b = new QComboBox(false,table()->viewport()); - b->addAction("false"); - b->addAction("true"); - b->setCurrentItem(m_property.toBool() ? 1 : 0); - return b; - } - break; - case QVariant::Color: - { - QLineEdit * e = new QLineEdit(table()->viewport()); - e->setText(m_property.toColor().name()); - return e; - } - break; - case QVariant::Font: - { - QComboBox * b = new QComboBox(true,table()->viewport()); - QString tmp; - QString tmpDefault; - QFont f = QFont(); - f.setStyleHint(QFont::SansSerif); - tmpDefault = f.family(); - f.setStyleHint(QFont::TypeWriter); - tmp.setNum(m_property.toFont().pointSize()); - tmp.prepend(", "); - tmp.prepend(m_property.toFont().family()); - b->addAction(tmp); - b->addAction(tmpDefault + ", 8"); - b->addAction(tmpDefault + ", 10"); - b->addAction(tmpDefault + ", 12"); - b->addAction(tmpDefault + ", 14"); - b->addAction(tmpDefault + ", 16"); - b->addAction(tmpDefault + ", 18"); - b->addAction(tmpDefault + ", 20"); - b->addAction(tmpDefault + ", 24"); - b->addAction(tmpDefault + ", 28"); - b->addAction(tmpDefault + ", 32"); - b->addAction(tmpDefault + ", 40"); - b->addAction(tmpDefault + ", 48"); - b->addAction(f.family() + ", 12"); - b->setCurrentItem(0); - b->setCurrentItem(m_property.toBool() ? 1 : 0); - return b; - } - break; - default: - break; + QLineEdit * e = new QLineEdit(table()->viewport()); + e->setText(m_property.toString()); + return e; + } + break; + case QVariant::Int: + { + QLineEdit * e = new QLineEdit(table()->viewport()); + QString sz; + sz.setNum(m_property.toInt()); + e->setText(sz); + e->setValidator(new QIntValidator(e)); + return e; + } + break; + case QVariant::UInt: + { + QLineEdit * e = new QLineEdit(table()->viewport()); + QString sz; + sz.setNum(m_property.toInt()); + e->setText(sz); + QIntValidator * i = new QIntValidator(e); + i->setBottom(0); + e->setValidator(i); + return e; + } + break; + case QVariant::Bool: + { + QComboBox * b = new QComboBox(false, table()->viewport()); + b->addAction("false"); + b->addAction("true"); + b->setCurrentItem(m_property.toBool() ? 1 : 0); + return b; } - return 0; + break; + case QVariant::Color: + { + QLineEdit * e = new QLineEdit(table()->viewport()); + e->setText(m_property.toColor().name()); + return e; + } + break; + case QVariant::Font: + { + QComboBox * b = new QComboBox(true, table()->viewport()); + QString tmp; + QString tmpDefault; + QFont f = QFont(); + f.setStyleHint(QFont::SansSerif); + tmpDefault = f.family(); + f.setStyleHint(QFont::TypeWriter); + tmp.setNum(m_property.toFont().pointSize()); + tmp.prepend(", "); + tmp.prepend(m_property.toFont().family()); + b->addAction(tmp); + b->addAction(tmpDefault + ", 8"); + b->addAction(tmpDefault + ", 10"); + b->addAction(tmpDefault + ", 12"); + b->addAction(tmpDefault + ", 14"); + b->addAction(tmpDefault + ", 16"); + b->addAction(tmpDefault + ", 18"); + b->addAction(tmpDefault + ", 20"); + b->addAction(tmpDefault + ", 24"); + b->addAction(tmpDefault + ", 28"); + b->addAction(tmpDefault + ", 32"); + b->addAction(tmpDefault + ", 40"); + b->addAction(tmpDefault + ", 48"); + b->addAction(f.family() + ", 12"); + b->setCurrentItem(0); + b->setCurrentItem(m_property.toBool() ? 1 : 0); + return b; + } + break; + default: + break; } + return 0; +} - void KviVariantTableItem::setContentFromEditor(QWidget * w) +void KviVariantTableItem::setContentFromEditor(QWidget * w) +{ + switch(m_property.type()) { - switch(m_property.type()) - { - case QVariant::String: - m_property = QVariant(((QLineEdit *)w)->text()); + case QVariant::String: + m_property = QVariant(((QLineEdit *)w)->text()); break; - case QVariant::Int: - m_property = QVariant(((QLineEdit *)w)->text().toInt()); + case QVariant::Int: + m_property = QVariant(((QLineEdit *)w)->text().toInt()); break; - case QVariant::UInt: - m_property = QVariant(((QLineEdit *)w)->text().toUInt()); + case QVariant::UInt: + m_property = QVariant(((QLineEdit *)w)->text().toUInt()); break; - case QVariant::Bool: - m_property = QVariant(((QComboBox *)w)->currentItem(),1); + case QVariant::Bool: + m_property = QVariant(((QComboBox *)w)->currentItem(), 1); break; - case QVariant::Color: - m_property.asColor().setNamedColor(((QLineEdit *)w)->text()); + case QVariant::Color: + m_property.asColor().setNamedColor(((QLineEdit *)w)->text()); break; - case QVariant::Font: + case QVariant::Font: + { + KviCString txt = ((QComboBox *)w)->currentText(); + if(txt.hasData()) { - KviCString txt = ((QComboBox *)w)->currentText(); - if(txt.hasData()) - { - KviCString fam = txt; - fam.cutFromFirst(',',true); - fam.trimmed(); - KviCString psz = txt; - psz.cutToFirst(',',true); - psz.trimmed(); - bool bOk; - unsigned int uSize = psz.toUInt(&bOk); - if(!bOk)uSize = 12; - m_property = QVariant(QFont(fam.ptr(),uSize)); - } + KviCString fam = txt; + fam.cutFromFirst(',', true); + fam.trimmed(); + KviCString psz = txt; + psz.cutToFirst(',', true); + psz.trimmed(); + bool bOk; + unsigned int uSize = psz.toUInt(&bOk); + if(!bOk) + uSize = 12; + m_property = QVariant(QFont(fam.ptr(), uSize)); } - break; - default: - break; } + break; + default: + break; } +} - void KviVariantTableItem::paint(QPainter *p,const QColorGroup &cg,const QRect &cr,bool) - { - p->fillRect(0,0,cr.width(),cr.height(),cg.base()); +void KviVariantTableItem::paint(QPainter * p, const QColorGroup & cg, const QRect & cr, bool) +{ + p->fillRect(0, 0, cr.width(), cr.height(), cg.base()); - if(m_property.type() == QVariant::Color) + if(m_property.type() == QVariant::Color) + { + p->fillRect(3, 3, cr.width() - 6, cr.height() - 6, m_property.asColor()); + } + else + { + QString sz; + switch(m_property.type()) { - p->fillRect(3,3,cr.width() - 6,cr.height() - 6,m_property.asColor()); - } else { - QString sz; - switch(m_property.type()) - { - case QVariant::String: - sz = m_property.toString(); + case QVariant::String: + sz = m_property.toString(); break; - case QVariant::Bool: - sz = m_property.toBool() ? "true" : "false"; + case QVariant::Bool: + sz = m_property.toBool() ? "true" : "false"; break; - case QVariant::Font: - sz.setNum(m_property.toFont().pointSize()); - sz.prepend(", "); - sz.prepend(m_property.toFont().family()); + case QVariant::Font: + sz.setNum(m_property.toFont().pointSize()); + sz.prepend(", "); + sz.prepend(m_property.toFont().family()); break; - case QVariant::Int: - sz.setNum(m_property.toInt()); + case QVariant::Int: + sz.setNum(m_property.toInt()); break; - case QVariant::UInt: - sz.setNum(m_property.toUInt()); + case QVariant::UInt: + sz.setNum(m_property.toUInt()); break; - default: + default: break; - } - p->setPen(cg.text()); - p->drawText(0,0,cr.width(),cr.height(),Qt::AlignLeft | Qt::AlignTop,sz); } + p->setPen(cg.text()); + p->drawText(0, 0, cr.width(), cr.height(), Qt::AlignLeft | Qt::AlignTop, sz); } +} - - ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - // - // KviCanvasItemPropertiesWidget - // - KviCanvasItemPropertiesWidget::KviCanvasItemPropertiesWidget(QWidget * par) - : QTable(par) - { - setSelectionMode(QTable::NoSelection); - setColumnMovingEnabled(false); - setRowMovingEnabled(false); - setShowGrid(true); - setNumCols(2); - setSorting(false); - setLeftMargin(0); - verticalHeader()->hide(); - connect(this,SIGNAL(valueChanged(int,int)),this,SLOT(cellEdited(int,int))); - } - - KviCanvasItemPropertiesWidget::~KviCanvasItemPropertiesWidget() - { - } - - void KviCanvasItemPropertiesWidget::cellEdited(int row,int) - { - QTableItem * it = item(row,0); - if(!it)return; - QString szName = it->text(); - it = item(row,1); - if(!it)return; - emit propertyChanged(szName,((KviVariantTableItem *)it)->property()); - } - - void KviCanvasItemPropertiesWidget::editItem(QCanvasItem * it) - { - if(!it) +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// +// KviCanvasItemPropertiesWidget +// +KviCanvasItemPropertiesWidget::KviCanvasItemPropertiesWidget(QWidget * par) + : QTable(par) +{ + setSelectionMode(QTable::NoSelection); + setColumnMovingEnabled(false); + setRowMovingEnabled(false); + setShowGrid(true); + setNumCols(2); + setSorting(false); + setLeftMargin(0); + verticalHeader()->hide(); + connect(this, SIGNAL(valueChanged(int, int)), this, SLOT(cellEdited(int, int))); +} + +KviCanvasItemPropertiesWidget::~KviCanvasItemPropertiesWidget() +{ +} + +void KviCanvasItemPropertiesWidget::cellEdited(int row, int) +{ + QTableItem * it = item(row, 0); + if(!it) + return; + QString szName = it->text(); + it = item(row, 1); + if(!it) + return; + emit propertyChanged(szName, ((KviVariantTableItem *)it)->property()); +} + +void KviCanvasItemPropertiesWidget::editItem(QCanvasItem * it) +{ + if(!it) + { + for(int i = 0; i < numRows(); i++) { - for(int i=0;i * m = 0; + QMap * m = 0; - switch(KVI_CANVAS_RTTI_CONTROL_TYPE(it)) - { - case KVI_CANVAS_RTTI_CONTROL_TYPE_RECTANGLE: - m = ((KviCanvasRectangleItem *)it)->properties(); + switch(KVI_CANVAS_RTTI_CONTROL_TYPE(it)) + { + case KVI_CANVAS_RTTI_CONTROL_TYPE_RECTANGLE: + m = ((KviCanvasRectangleItem *)it)->properties(); break; - case KVI_CANVAS_RTTI_CONTROL_TYPE_LINE: - m = ((KviCanvasLine *)it)->properties(); + case KVI_CANVAS_RTTI_CONTROL_TYPE_LINE: + m = ((KviCanvasLine *)it)->properties(); break; - case KVI_CANVAS_RTTI_CONTROL_TYPE_POLYGON: - m = ((KviCanvasPolygon *)it)->properties(); + case KVI_CANVAS_RTTI_CONTROL_TYPE_POLYGON: + m = ((KviCanvasPolygon *)it)->properties(); break; - } - - if(!m) - { - editItem(0); - return; - } - - for(int i=0;icount()); - - QTableItem * item; - - int idx = 0; - - for(QMap::ConstIterator iter = m->begin();iter != m->end();++iter) - { - item = new QTableItem(this,QTableItem::Never,iter.key().toUtf8().data()); - setItem(idx,0,item); - item = new KviVariantTableItem(this,iter.data()); - setItem(idx,1,item); - idx++; - } - } - ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - // - // DccCanvasWidget - // - DccCanvasWidget::DccCanvasWidget(QWidget * par) - : QWidget(par,"canvas_widget") + if(!m) { - m_pCanvas = new QCanvas(this); - //#warning "Make this size as parameter of Dcc ?" - m_pCanvas->resize(648,480); - m_pMenuBar = new QMenuBar(this); - m_pSplitter = new QSplitter(QSplitter::Horizontal,this); - m_pCanvasView = new KviCanvasView(m_pCanvas,this,m_pSplitter); - m_pStatusLabel = new QLabel(this); - m_pPropertiesWidget = new KviCanvasItemPropertiesWidget(m_pSplitter); - QValueList l; - l.append(80); - l.append(20); - m_pSplitter->setSizes(l); - - connect(m_pPropertiesWidget,SIGNAL(propertyChanged(const QString &,const QVariant &)),m_pCanvasView,SLOT(propertyChanged(const QString &,const QVariant &))); - - QMenu * add = new QMenu(m_pMenuBar); - QMenu * shapes = new QMenu(add); - QMenu * polygons = new QMenu(add); - QMenu * items = new QMenu(add); - shapes->addAction(__tr2qs_ctx("&Line","dcc"),m_pCanvasView,SLOT(insertLine())); - shapes->addAction(__tr2qs_ctx("&Rectangle","dcc"),m_pCanvasView,SLOT(insertRectangle())); - shapes->addAction(__tr2qs_ctx("&Ellipse","dcc"),m_pCanvasView,SLOT(insertEllipse())); - shapes->addAction(__tr2qs_ctx("&Pie","dcc"),m_pCanvasView,SLOT(insertPie())); - shapes->addAction(__tr2qs_ctx("&Chord","dcc"),m_pCanvasView,SLOT(insertChord())); - - items->addAction(__tr2qs_ctx("&Rich text (html)","dcc"),m_pCanvasView,SLOT(insertRichText())); - - polygons->addAction(__tr2qs_ctx("&Triangle","dcc"),m_pCanvasView,SLOT(insertPolygonTriangle())); - polygons->addAction(__tr2qs_ctx("&Rectangle","dcc"),m_pCanvasView,SLOT(insertPolygonRectangle())); - polygons->addAction(__tr2qs_ctx("&Pentagon","dcc"),m_pCanvasView,SLOT(insertPolygonPentagon())); - polygons->addAction(__tr2qs_ctx("&Hexagon","dcc"),m_pCanvasView,SLOT(insertPolygonHexagon())); - - add->addAction(__tr2qs_ctx("&Shape","dcc"),shapes); - add->addAction(__tr2qs_ctx("&Item","dcc"),items); - add->addAction(__tr2qs_ctx("&Polygons","dcc"),polygons); - - m_pMenuBar->addAction(__tr2qs_ctx("&Insert","dcc"),add); + editItem(0); + return; } - DccCanvasWidget::~DccCanvasWidget() + for(int i = 0; i < numRows(); i++) { + clearCell(i, 0); + clearCell(i, 1); + clearCellWidget(i, 1); } - void DccCanvasWidget::resizeEvent(QResizeEvent *) + setNumRows(m->count()); + + QTableItem * item; + + int idx = 0; + + for(QMap::ConstIterator iter = m->begin(); iter != m->end(); ++iter) { - int h = m_pMenuBar->sizeHint().height(); - m_pMenuBar->setGeometry(0,0,width(),h); - int h2 = m_pStatusLabel->sizeHint().height(); - m_pStatusLabel->setGeometry(0,height() - h2,width(),h2); - m_pSplitter->setGeometry(0,h,width(),height() - (h + h2)); + item = new QTableItem(this, QTableItem::Never, iter.key().toUtf8().data()); + setItem(idx, 0, item); + item = new KviVariantTableItem(this, iter.data()); + setItem(idx, 1, item); + idx++; } +} + +////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// +// +// DccCanvasWidget +// +DccCanvasWidget::DccCanvasWidget(QWidget * par) + : QWidget(par, "canvas_widget") +{ + m_pCanvas = new QCanvas(this); + //#warning "Make this size as parameter of Dcc ?" + m_pCanvas->resize(648, 480); + m_pMenuBar = new QMenuBar(this); + m_pSplitter = new QSplitter(QSplitter::Horizontal, this); + m_pCanvasView = new KviCanvasView(m_pCanvas, this, m_pSplitter); + m_pStatusLabel = new QLabel(this); + m_pPropertiesWidget = new KviCanvasItemPropertiesWidget(m_pSplitter); + QValueList l; + l.append(80); + l.append(20); + m_pSplitter->setSizes(l); + + connect(m_pPropertiesWidget, SIGNAL(propertyChanged(const QString &, const QVariant &)), m_pCanvasView, SLOT(propertyChanged(const QString &, const QVariant &))); + + QMenu * add = new QMenu(m_pMenuBar); + QMenu * shapes = new QMenu(add); + QMenu * polygons = new QMenu(add); + QMenu * items = new QMenu(add); + shapes->addAction(__tr2qs_ctx("&Line", "dcc"), m_pCanvasView, SLOT(insertLine())); + shapes->addAction(__tr2qs_ctx("&Rectangle", "dcc"), m_pCanvasView, SLOT(insertRectangle())); + shapes->addAction(__tr2qs_ctx("&Ellipse", "dcc"), m_pCanvasView, SLOT(insertEllipse())); + shapes->addAction(__tr2qs_ctx("&Pie", "dcc"), m_pCanvasView, SLOT(insertPie())); + shapes->addAction(__tr2qs_ctx("&Chord", "dcc"), m_pCanvasView, SLOT(insertChord())); + + items->addAction(__tr2qs_ctx("&Rich text (html)", "dcc"), m_pCanvasView, SLOT(insertRichText())); + + polygons->addAction(__tr2qs_ctx("&Triangle", "dcc"), m_pCanvasView, SLOT(insertPolygonTriangle())); + polygons->addAction(__tr2qs_ctx("&Rectangle", "dcc"), m_pCanvasView, SLOT(insertPolygonRectangle())); + polygons->addAction(__tr2qs_ctx("&Pentagon", "dcc"), m_pCanvasView, SLOT(insertPolygonPentagon())); + polygons->addAction(__tr2qs_ctx("&Hexagon", "dcc"), m_pCanvasView, SLOT(insertPolygonHexagon())); + + add->addAction(__tr2qs_ctx("&Shape", "dcc"), shapes); + add->addAction(__tr2qs_ctx("&Item", "dcc"), items); + add->addAction(__tr2qs_ctx("&Polygons", "dcc"), polygons); + + m_pMenuBar->addAction(__tr2qs_ctx("&Insert", "dcc"), add); +} + +DccCanvasWidget::~DccCanvasWidget() +{ +} + +void DccCanvasWidget::resizeEvent(QResizeEvent *) +{ + int h = m_pMenuBar->sizeHint().height(); + m_pMenuBar->setGeometry(0, 0, width(), h); + int h2 = m_pStatusLabel->sizeHint().height(); + m_pStatusLabel->setGeometry(0, height() - h2, width(), h2); + m_pSplitter->setGeometry(0, h, width(), height() - (h + h2)); +} #endif diff --git a/src/modules/dcc/canvaswidget.h b/src/modules/dcc/canvaswidget.h index da40016e7..d6737cef4 100644 --- a/src/modules/dcc/canvaswidget.h +++ b/src/modules/dcc/canvaswidget.h @@ -27,276 +27,309 @@ #include "DccBroker.h" #ifdef COMPILE_DCC_CANVAS - #include - #include - #include - #include - #include - #include - #include - - class DccCanvasWidget; - - #define KVI_CANVAS_RTTI_CONTROL_TYPE_RECTANGLE 1 - #define KVI_CANVAS_RTTI_CONTROL_TYPE_LINE 2 - #define KVI_CANVAS_RTTI_CONTROL_TYPE_POLYGON 4 - - #define KVI_CANVAS_RTTI_CONTROL_TYPE_MASK 255 - - #define KVI_CANVAS_RTTI_RECTANGLE (KVI_CANVAS_RTTI_CONTROL_TYPE_RECTANGLE | (1 << 8)) - #define KVI_CANVAS_RTTI_RICHTEXT (KVI_CANVAS_RTTI_CONTROL_TYPE_RECTANGLE | (2 << 8)) - #define KVI_CANVAS_RTTI_LINE (KVI_CANVAS_RTTI_CONTROL_TYPE_LINE | (3 << 8)) - #define KVI_CANVAS_RTTI_ELLIPSE (KVI_CANVAS_RTTI_CONTROL_TYPE_RECTANGLE | (4 << 8)) - #define KVI_CANVAS_RTTI_CHORD (KVI_CANVAS_RTTI_CONTROL_TYPE_RECTANGLE | (5 << 8)) - #define KVI_CANVAS_RTTI_PIE (KVI_CANVAS_RTTI_CONTROL_TYPE_RECTANGLE | (6 << 8)) - #define KVI_CANVAS_RTTI_POLYGON (KVI_CANVAS_RTTI_CONTROL_TYPE_POLYGON | (7 << 8)) - - #define KVI_CANVAS_RTTI_CONTROL_TYPE(__item) (__item->rtti() & KVI_CANVAS_RTTI_CONTROL_TYPE_MASK) - - - - class KviCanvasPolygon : public QCanvasPolygon - { - public: - KviCanvasPolygon(QCanvas * c,int x,int y,QPointArray &pnts,double dScaleFactor); - virtual ~KviCanvasPolygon(); - protected: - QMap m_properties; - double m_dScaleFactor; - QPointArray m_points; - public: - virtual void draw(QPainter & p); - double scaleFactor(){ return m_dScaleFactor; }; - void setScaleFactor(double dScaleFactor); - void resetPoints(); - const QPointArray & internalPoints(){ return m_points; }; - void setInternalPoints(const QPointArray &pnts); - QMap * properties(){ return &m_properties; }; - virtual void setProperty(const QString &property,const QVariant &val); - virtual int rtti() const; - }; - - - class KviCanvasRectangleItem : public QCanvasRectangle - { - friend class KviCanvasRectangle; - friend class KviCanvasRichText; - friend class KviCanvasEllipticItem; - protected: - KviCanvasRectangleItem(QCanvas * c,int x,int y,int w,int h); - public: - virtual ~KviCanvasRectangleItem(); - protected: - QMap m_properties; - public: - int right(){ return ((int)x()) + width(); }; - int bottom(){ return ((int)y()) + height(); }; - QMap * properties(){ return &m_properties; }; - virtual void setProperty(const QString &property,const QVariant &val); +#include +#include +#include +#include +#include +#include +#include + +class DccCanvasWidget; + +#define KVI_CANVAS_RTTI_CONTROL_TYPE_RECTANGLE 1 +#define KVI_CANVAS_RTTI_CONTROL_TYPE_LINE 2 +#define KVI_CANVAS_RTTI_CONTROL_TYPE_POLYGON 4 + +#define KVI_CANVAS_RTTI_CONTROL_TYPE_MASK 255 + +#define KVI_CANVAS_RTTI_RECTANGLE (KVI_CANVAS_RTTI_CONTROL_TYPE_RECTANGLE | (1 << 8)) +#define KVI_CANVAS_RTTI_RICHTEXT (KVI_CANVAS_RTTI_CONTROL_TYPE_RECTANGLE | (2 << 8)) +#define KVI_CANVAS_RTTI_LINE (KVI_CANVAS_RTTI_CONTROL_TYPE_LINE | (3 << 8)) +#define KVI_CANVAS_RTTI_ELLIPSE (KVI_CANVAS_RTTI_CONTROL_TYPE_RECTANGLE | (4 << 8)) +#define KVI_CANVAS_RTTI_CHORD (KVI_CANVAS_RTTI_CONTROL_TYPE_RECTANGLE | (5 << 8)) +#define KVI_CANVAS_RTTI_PIE (KVI_CANVAS_RTTI_CONTROL_TYPE_RECTANGLE | (6 << 8)) +#define KVI_CANVAS_RTTI_POLYGON (KVI_CANVAS_RTTI_CONTROL_TYPE_POLYGON | (7 << 8)) + +#define KVI_CANVAS_RTTI_CONTROL_TYPE(__item) (__item->rtti() & KVI_CANVAS_RTTI_CONTROL_TYPE_MASK) + +class KviCanvasPolygon : public QCanvasPolygon +{ +public: + KviCanvasPolygon(QCanvas * c, int x, int y, QPointArray & pnts, double dScaleFactor); + virtual ~KviCanvasPolygon(); + +protected: + QMap m_properties; + double m_dScaleFactor; + QPointArray m_points; + +public: + virtual void draw(QPainter & p); + double scaleFactor() { return m_dScaleFactor; }; + void setScaleFactor(double dScaleFactor); + void resetPoints(); + const QPointArray & internalPoints() { return m_points; }; + void setInternalPoints(const QPointArray & pnts); + QMap * properties() { return &m_properties; }; + virtual void setProperty(const QString & property, const QVariant & val); + virtual int rtti() const; +}; + +class KviCanvasRectangleItem : public QCanvasRectangle +{ + friend class KviCanvasRectangle; + friend class KviCanvasRichText; + friend class KviCanvasEllipticItem; + +protected: + KviCanvasRectangleItem(QCanvas * c, int x, int y, int w, int h); + +public: + virtual ~KviCanvasRectangleItem(); + +protected: + QMap m_properties; + +public: + int right() { return ((int)x()) + width(); }; + int bottom() { return ((int)y()) + height(); }; + QMap * properties() { return &m_properties; }; + virtual void setProperty(const QString & property, const QVariant & val); // QVariant property(const QString &name){ return m_properties[name]; }; - protected: - void drawSelection(QPainter &p); - }; - - - class KviCanvasEllipticItem : public KviCanvasRectangleItem - { - friend class KviCanvasEllipse; - friend class KviCanvasChord; - friend class KviCanvasPie; - protected: - KviCanvasEllipticItem(QCanvas * c,int x,int y,int w,int h); - ~KviCanvasEllipticItem(); - public: - virtual void setProperty(const QString & property,const QVariant &val); - virtual void draw(QPainter & p); - virtual void drawContent(QPainter & p); - virtual int rtti() const; - }; - - - class KviCanvasEllipse : public KviCanvasEllipticItem - { - public: - KviCanvasEllipse(QCanvas * c,int x,int y,int w,int h); - ~KviCanvasEllipse(); - public: - virtual void drawContent(QPainter & p); - virtual int rtti() const; - }; - - - class KviCanvasPie : public KviCanvasEllipticItem - { - public: - KviCanvasPie(QCanvas * c,int x,int y,int w,int h); - ~KviCanvasPie(); - public: - virtual void drawContent(QPainter & p); - virtual int rtti() const; - }; - - - class KviCanvasChord : public KviCanvasEllipticItem - { - public: - KviCanvasChord(QCanvas * c,int x,int y,int w,int h); - ~KviCanvasChord(); - public: - virtual void drawContent(QPainter & p); - virtual int rtti() const; - }; - - - class KviCanvasLine : public QCanvasLine - { - public: - KviCanvasLine(QCanvas * c,int x1,int y1,int x2,int y2); - virtual ~KviCanvasLine(); - protected: - QMap m_properties; - public: - QMap * properties(){ return &m_properties; }; - virtual void setProperty(const QString &property,const QVariant &val); +protected: + void drawSelection(QPainter & p); +}; + +class KviCanvasEllipticItem : public KviCanvasRectangleItem +{ + friend class KviCanvasEllipse; + friend class KviCanvasChord; + friend class KviCanvasPie; + +protected: + KviCanvasEllipticItem(QCanvas * c, int x, int y, int w, int h); + ~KviCanvasEllipticItem(); + +public: + virtual void setProperty(const QString & property, const QVariant & val); + virtual void draw(QPainter & p); + virtual void drawContent(QPainter & p); + virtual int rtti() const; +}; + +class KviCanvasEllipse : public KviCanvasEllipticItem +{ +public: + KviCanvasEllipse(QCanvas * c, int x, int y, int w, int h); + ~KviCanvasEllipse(); + +public: + virtual void drawContent(QPainter & p); + virtual int rtti() const; +}; + +class KviCanvasPie : public KviCanvasEllipticItem +{ +public: + KviCanvasPie(QCanvas * c, int x, int y, int w, int h); + ~KviCanvasPie(); + +public: + virtual void drawContent(QPainter & p); + virtual int rtti() const; +}; + +class KviCanvasChord : public KviCanvasEllipticItem +{ +public: + KviCanvasChord(QCanvas * c, int x, int y, int w, int h); + ~KviCanvasChord(); + +public: + virtual void drawContent(QPainter & p); + virtual int rtti() const; +}; + +class KviCanvasLine : public QCanvasLine +{ +public: + KviCanvasLine(QCanvas * c, int x1, int y1, int x2, int y2); + virtual ~KviCanvasLine(); + +protected: + QMap m_properties; + +public: + QMap * properties() { return &m_properties; }; + virtual void setProperty(const QString & property, const QVariant & val); // QVariant property(const QString &name){ return m_properties[name]; }; - virtual void draw(QPainter & p); - virtual int rtti() const; - }; - - - class KviCanvasRectangle : public KviCanvasRectangleItem + virtual void draw(QPainter & p); + virtual int rtti() const; +}; + +class KviCanvasRectangle : public KviCanvasRectangleItem +{ +public: + KviCanvasRectangle(QCanvas * c, int x, int y, int w, int h); + ~KviCanvasRectangle(); + +public: + virtual void draw(QPainter & p); + virtual void setProperty(const QString & property, const QVariant & val); + virtual int rtti() const; +}; + +class KviCanvasRichText : public KviCanvasRectangleItem +{ +public: + KviCanvasRichText(QCanvas * c, int x, int y, int w, int h); + ~KviCanvasRichText(); + +public: + virtual void draw(QPainter & p); + virtual int rtti() const; +}; + +class KviCanvasView : public QCanvasView +{ + Q_OBJECT +public: + KviCanvasView(QCanvas * c, DccCanvasWidget * cw, QWidget * par); + ~KviCanvasView(); + +public: + enum State { - public: - KviCanvasRectangle(QCanvas * c,int x,int y,int w,int h); - ~KviCanvasRectangle(); - public: - virtual void draw(QPainter & p); - virtual void setProperty(const QString &property,const QVariant &val); - virtual int rtti() const; + Idle, + SelectOrigin }; - - - class KviCanvasRichText : public KviCanvasRectangleItem + enum ObjectType { - public: - KviCanvasRichText(QCanvas * c,int x,int y,int w,int h); - ~KviCanvasRichText(); - public: - virtual void draw(QPainter & p); - virtual int rtti() const; + Rectangle, + RichText, + Line, + Ellipse, + Chord, + Pie, + PolygonTriangle, + PolygonRectangle, + PolygonPentagon, + PolygonHexagon }; - - - class KviCanvasView : public QCanvasView - { - Q_OBJECT - public: - KviCanvasView(QCanvas * c,DccCanvasWidget * cw,QWidget * par); - ~KviCanvasView(); - public: - enum State { Idle, SelectOrigin }; - enum ObjectType { - Rectangle, RichText, Line, Ellipse, Chord, Pie, - PolygonTriangle, PolygonRectangle, PolygonPentagon, - PolygonHexagon - }; - enum DragMode { - None, All, Left, Right, Top, Bottom, LeftTop, RightTop, - LeftBottom, RightBottom, Scale, SinglePoint, Rotate - }; - protected: - DccCanvasWidget * m_pCanvasWidget; - - // Insertion of objects - State m_state; - ObjectType m_objectToInsert; - - // Selected item - QCanvasItem * m_pSelectedItem; - - DragMode m_dragMode; - QPoint m_dragBegin; - double m_dragScaleFactor; - unsigned int m_dragPointIndex; - QPointArray m_dragPointArray; - protected: - void beginDragRectangle(KviCanvasRectangleItem * it,const QPoint &p,bool bInitial = false); - void dragRectangle(KviCanvasRectangleItem * it,const QPoint & p); - - void beginDragLine(KviCanvasLine * it,const QPoint &p,bool bInitial = false); - void dragLine(KviCanvasLine * it,const QPoint &p); - - void beginDragPolygon(KviCanvasPolygon * it,const QPoint &p,bool bShift = false,bool bCtrl = false); - void dragPolygon(KviCanvasPolygon * it,const QPoint &p); - - void setItemSelected(QCanvasItem * it); - void clearSelection(); - void insertObjectAt(const QPoint & pnt,ObjectType o); - virtual void contentsMousePressEvent(QMouseEvent *e); - virtual void contentsMouseMoveEvent(QMouseEvent *e); - virtual void contentsMouseReleaseEvent(QMouseEvent *e); - public slots: - void insertRectangle(); - void insertRichText(); - void insertLine(); - void insertPie(); - void insertChord(); - void insertEllipse(); - void insertPolygonTriangle(); - void insertPolygonRectangle(); - void insertPolygonPentagon(); - void insertPolygonHexagon(); - void propertyChanged(const QString &s,const QVariant &v); - }; - - - class KviVariantTableItem : public QTableItem - { - public: - KviVariantTableItem(QTable * t,const QVariant & property); - ~KviVariantTableItem(); - private: - QVariant m_property; - public: - virtual QWidget * createEditor() const; - virtual void setContentFromEditor(QWidget *w); - QVariant & property(){ return m_property; }; - virtual void paint(QPainter *p,const QColorGroup &cg,const QRect &cr,bool selected); - }; - - - class KviCanvasItemPropertiesWidget : public QTable + enum DragMode { - Q_OBJECT - public: - KviCanvasItemPropertiesWidget(QWidget * par); - ~KviCanvasItemPropertiesWidget(); - public: - void editItem(QCanvasItem * it); - protected slots: - void cellEdited(int row,int col); - signals: - void propertyChanged(const QString &s,const QVariant &v); + None, + All, + Left, + Right, + Top, + Bottom, + LeftTop, + RightTop, + LeftBottom, + RightBottom, + Scale, + SinglePoint, + Rotate }; - - class DccCanvasWidget : public QWidget - { - friend class KviCanvasView; - Q_OBJECT - public: - DccCanvasWidget(QWidget * par); - ~DccCanvasWidget(); - protected: - QSplitter * m_pSplitter; - QCanvas * m_pCanvas; - QMenuBar * m_pMenuBar; - KviCanvasView * m_pCanvasView; - QLabel * m_pStatusLabel; - KviCanvasItemPropertiesWidget * m_pPropertiesWidget; - protected: - virtual void resizeEvent(QResizeEvent *); - }; +protected: + DccCanvasWidget * m_pCanvasWidget; + + // Insertion of objects + State m_state; + ObjectType m_objectToInsert; + + // Selected item + QCanvasItem * m_pSelectedItem; + + DragMode m_dragMode; + QPoint m_dragBegin; + double m_dragScaleFactor; + unsigned int m_dragPointIndex; + QPointArray m_dragPointArray; + +protected: + void beginDragRectangle(KviCanvasRectangleItem * it, const QPoint & p, bool bInitial = false); + void dragRectangle(KviCanvasRectangleItem * it, const QPoint & p); + + void beginDragLine(KviCanvasLine * it, const QPoint & p, bool bInitial = false); + void dragLine(KviCanvasLine * it, const QPoint & p); + + void beginDragPolygon(KviCanvasPolygon * it, const QPoint & p, bool bShift = false, bool bCtrl = false); + void dragPolygon(KviCanvasPolygon * it, const QPoint & p); + + void setItemSelected(QCanvasItem * it); + void clearSelection(); + void insertObjectAt(const QPoint & pnt, ObjectType o); + virtual void contentsMousePressEvent(QMouseEvent * e); + virtual void contentsMouseMoveEvent(QMouseEvent * e); + virtual void contentsMouseReleaseEvent(QMouseEvent * e); +public slots: + void insertRectangle(); + void insertRichText(); + void insertLine(); + void insertPie(); + void insertChord(); + void insertEllipse(); + void insertPolygonTriangle(); + void insertPolygonRectangle(); + void insertPolygonPentagon(); + void insertPolygonHexagon(); + void propertyChanged(const QString & s, const QVariant & v); +}; + +class KviVariantTableItem : public QTableItem +{ +public: + KviVariantTableItem(QTable * t, const QVariant & property); + ~KviVariantTableItem(); + +private: + QVariant m_property; + +public: + virtual QWidget * createEditor() const; + virtual void setContentFromEditor(QWidget * w); + QVariant & property() { return m_property; }; + virtual void paint(QPainter * p, const QColorGroup & cg, const QRect & cr, bool selected); +}; + +class KviCanvasItemPropertiesWidget : public QTable +{ + Q_OBJECT +public: + KviCanvasItemPropertiesWidget(QWidget * par); + ~KviCanvasItemPropertiesWidget(); + +public: + void editItem(QCanvasItem * it); +protected slots: + void cellEdited(int row, int col); +signals: + void propertyChanged(const QString & s, const QVariant & v); +}; + +class DccCanvasWidget : public QWidget +{ + friend class KviCanvasView; + Q_OBJECT +public: + DccCanvasWidget(QWidget * par); + ~DccCanvasWidget(); + +protected: + QSplitter * m_pSplitter; + QCanvas * m_pCanvas; + QMenuBar * m_pMenuBar; + KviCanvasView * m_pCanvasView; + QLabel * m_pStatusLabel; + KviCanvasItemPropertiesWidget * m_pPropertiesWidget; + +protected: + virtual void resizeEvent(QResizeEvent *); +}; #endif #endif //_CANVAS_WIDGET_H_ diff --git a/src/modules/dcc/libkvidcc.cpp b/src/modules/dcc/libkvidcc.cpp index 6acd8eddb..aa8bc979d 100644 --- a/src/modules/dcc/libkvidcc.cpp +++ b/src/modules/dcc/libkvidcc.cpp @@ -53,8 +53,8 @@ #include #ifdef COMPILE_ON_WINDOWS - // Ugly Windoze compiler... - #include "DccDialog.h" +// Ugly Windoze compiler... +#include "DccDialog.h" #endif //#warning "KviOption_boolIgnoreDccChat and other types too" @@ -63,21 +63,22 @@ DccBroker * g_pDccBroker = 0; - -static void dcc_module_set_dcc_type(DccDescriptor * d,const char * szBaseType) +static void dcc_module_set_dcc_type(DccDescriptor * d, const char * szBaseType) { d->szType = szBaseType; #ifdef COMPILE_SSL_SUPPORT - if(d->bIsSSL)d->szType.prepend('S'); + if(d->bIsSSL) + d->szType.prepend('S'); #endif - if(d->bIsTdcc)d->szType.prepend('T'); + if(d->bIsTdcc) + d->szType.prepend('T'); } -static bool dcc_kvs_parse_default_parameters(DccDescriptor * d,KviKvsModuleCommandCall *c) +static bool dcc_kvs_parse_default_parameters(DccDescriptor * d, KviKvsModuleCommandCall * c) { - d->bIsTdcc = c->switches()->find('t',"tdcc"); + d->bIsTdcc = c->switches()->find('t', "tdcc"); - KviKvsVariant * pSw = c->switches()->find('m',"minimize"); + KviKvsVariant * pSw = c->switches()->find('m', "minimize"); if(pSw != 0) d->bOverrideMinimize = pSw->asBoolean(); @@ -87,12 +88,14 @@ static bool dcc_kvs_parse_default_parameters(DccDescriptor * d,KviKvsModuleComma if(!d->console()) { // We don't need a console with -c and -n, otherwise we need it - if(!(c->switches()->find('c',"connect") || c->switches()->find('n',"no-ctcp"))) + if(!(c->switches()->find('c', "connect") || c->switches()->find('n', "no-ctcp"))) { delete d; - c->error(__tr2qs_ctx("This window has no associated IRC context (an IRC context is required unless -c or -n are passed)","dcc")); + c->error(__tr2qs_ctx("This window has no associated IRC context (an IRC context is required unless -c or -n are passed)", "dcc")); return false; - } else d->setConsole(g_pMainWindow->firstConsole()); + } + else + d->setConsole(g_pMainWindow->firstConsole()); } KVI_ASSERT(d->console()); @@ -100,83 +103,93 @@ static bool dcc_kvs_parse_default_parameters(DccDescriptor * d,KviKvsModuleComma if(!d->console()->isConnected()) { // We don't need a connection with -c and -n, otherwise we need it - if(!(c->switches()->find('c',"connect") || c->switches()->find('n',"no-ctcp"))) + if(!(c->switches()->find('c', "connect") || c->switches()->find('n', "no-ctcp"))) { delete d; - c->error(__tr2qs_ctx("You're not connected to a server (an active connection is required unless -c or -n are passed)","dcc")); + c->error(__tr2qs_ctx("You're not connected to a server (an active connection is required unless -c or -n are passed)", "dcc")); return false; - } else { + } + else + { // -c or -n, grab a local nick from somewhere - d->szLocalNick = KVI_OPTION_STRING(KviOption_stringNickname1).trimmed(); - if(d->szLocalNick.isEmpty())d->szLocalNick = KVI_DEFAULT_NICKNAME1; - d->szLocalUser = __tr2qs_ctx("unknown","dcc"); // we can live without it - d->szLocalHost = d->szLocalUser; // we can live without it + d->szLocalNick = KVI_OPTION_STRING(KviOption_stringNickname1).trimmed(); + if(d->szLocalNick.isEmpty()) + d->szLocalNick = KVI_DEFAULT_NICKNAME1; + d->szLocalUser = __tr2qs_ctx("unknown", "dcc"); // we can live without it + d->szLocalHost = d->szLocalUser; // we can live without it } - } else { + } + else + { // We know everything - d->szLocalNick = d->console()->connection()->userInfo()->nickName(); - d->szLocalUser = d->console()->connection()->userInfo()->userName(); - d->szLocalHost = d->console()->connection()->userInfo()->hostName(); + d->szLocalNick = d->console()->connection()->userInfo()->nickName(); + d->szLocalUser = d->console()->connection()->userInfo()->userName(); + d->szLocalHost = d->console()->connection()->userInfo()->hostName(); } - if( (pSw = c->switches()->find('i',"ip")) ) + if((pSw = c->switches()->find('i', "ip"))) { pSw->asString(d->szListenIp); if(!(d->szListenIp.contains('.') || d->szListenIp.contains(':'))) { // This will magically work with the same buffer as source and dst! - if(!KviNetUtils::getInterfaceAddress(d->szListenIp,d->szListenIp)) + if(!KviNetUtils::getInterfaceAddress(d->szListenIp, d->szListenIp)) { - c->error(__tr2qs_ctx("Unable to get address of interface %Q","dcc"),&(d->szListenIp)); + c->error(__tr2qs_ctx("Unable to get address of interface %Q", "dcc"), &(d->szListenIp)); delete d; return false; } } - } else { + } + else + { QString tmp; - if(!dcc_kvs_get_listen_ip_address(c,d->console(),tmp)) + if(!dcc_kvs_get_listen_ip_address(c, d->console(), tmp)) { delete d; - c->error(__tr2qs_ctx("No suitable interfaces to listen on, use -i","dcc")); + c->error(__tr2qs_ctx("No suitable interfaces to listen on, use -i", "dcc")); return false; } - d->szListenIp=tmp; + d->szListenIp = tmp; } - if( (pSw = c->switches()->find('p',"port")) ) + if((pSw = c->switches()->find('p', "port"))) { pSw->asString(d->szListenPort); // fixme! } - else d->szListenPort = "0"; // any port is ok + else + d->szListenPort = "0"; // any port is ok - if( (pSw = c->switches()->find('a',"fake-address")) ) + if((pSw = c->switches()->find('a', "fake-address"))) { pSw->asString(d->szFakeIp); } - else { + else + { if(KVI_OPTION_BOOL(KviOption_boolDccSendFakeAddressByDefault)) { d->szFakeIp = KVI_OPTION_STRING(KviOption_stringDefaultDccFakeAddress); - if(d->szFakeIp.isEmpty())KVI_OPTION_BOOL(KviOption_boolDccSendFakeAddressByDefault) = false; + if(d->szFakeIp.isEmpty()) + KVI_OPTION_BOOL(KviOption_boolDccSendFakeAddressByDefault) = false; } } - if( (pSw = c->switches()->find('f',"fake-port")) ) + if((pSw = c->switches()->find('f', "fake-port"))) { pSw->asString(d->szFakePort); } - d->bDoTimeout = (!c->switches()->find('u',"unlimited")); + d->bDoTimeout = (!c->switches()->find('u', "unlimited")); #ifdef COMPILE_SSL_SUPPORT - d->bIsSSL = c->switches()->find('s',"ssl"); + d->bIsSSL = c->switches()->find('s', "ssl"); #else - if(c->switches()->find('s',"ssl"))c->warning(__tr2qs_ctx("This executable was built without SSL support, -s switch ignored","dcc")); + if(c->switches()->find('s', "ssl")) + c->warning(__tr2qs_ctx("This executable was built without SSL support, -s switch ignored", "dcc")); #endif return true; } - /* @doc: dcc.chat @type: @@ -390,61 +403,63 @@ static bool dcc_kvs_cmd_chat(KviKvsModuleCommandCall * c) { QString szTarget; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("target",KVS_PT_NONEMPTYSTRING,0,szTarget) + KVSM_PARAMETER("target", KVS_PT_NONEMPTYSTRING, 0, szTarget) KVSM_PARAMETERS_END(c) DccDescriptor * d = new DccDescriptor(c->window()->console()); - d->szNick = szTarget; // we always specify the nickname - d->szUser = __tr2qs_ctx("unknown","dcc"); // username is always unknown - d->szHost = d->szUser; // host is always unknown + d->szNick = szTarget; // we always specify the nickname + d->szUser = __tr2qs_ctx("unknown", "dcc"); // username is always unknown + d->szHost = d->szUser; // host is always unknown - if(!dcc_kvs_parse_default_parameters(d,c))return false; - dcc_module_set_dcc_type(d,"CHAT"); + if(!dcc_kvs_parse_default_parameters(d, c)) + return false; + dcc_module_set_dcc_type(d, "CHAT"); - if(c->switches()->find('z',"zero-port")) + if(c->switches()->find('z', "zero-port")) { // we want to have it reversed... add a tag and send out the request KviDccZeroPortTag * t = g_pDccBroker->addZeroPortTag(); d->console()->connection()->sendFmtData("PRIVMSG %s :%cDCC %s chat 127.0.0.1 0 %s%c", - d->console()->connection()->encodeText(d->szNick).data(), - 0x01, - d->console()->connection()->encodeText(d->szType).data(), - d->console()->connection()->encodeText(t->m_szTag).data(), - 0x01); + d->console()->connection()->encodeText(d->szNick).data(), + 0x01, + d->console()->connection()->encodeText(d->szType).data(), + d->console()->connection()->encodeText(t->m_szTag).data(), + 0x01); return true; } - if(c->switches()->find('c',"connect")) + if(c->switches()->find('c', "connect")) { - if(!(c->switches()->find('i',"ip") && c->switches()->find('p',"port"))) + if(!(c->switches()->find('i', "ip") && c->switches()->find('p', "port"))) { delete d; - c->error(__tr2qs_ctx("-c requires -i and -p","dcc")); + c->error(__tr2qs_ctx("-c requires -i and -p", "dcc")); return false; } - d->szIp = d->szListenIp; - d->szPort = d->szListenPort; - d->szListenIp = ""; // useless + d->szIp = d->szListenIp; + d->szPort = d->szListenPort; + d->szListenIp = ""; // useless d->szListenPort = ""; // useless - d->bActive = true; - } else { - d->szIp = __tr2qs_ctx("unknown","dcc"); - d->szPort = d->szIp; - d->bActive = false; - d->bSendRequest = !c->switches()->find('n',"no-ctcp"); + d->bActive = true; + } + else + { + d->szIp = __tr2qs_ctx("unknown", "dcc"); + d->szPort = d->szIp; + d->bActive = false; + d->bSendRequest = !c->switches()->find('n', "no-ctcp"); } //c->window()->output(0,"%Q %Q %Q",&(d->szIp),&(d->szPort),&(d->szListenIp)); d->triggerCreationEvent(); - g_pDccBroker->executeChat(0,d); + g_pDccBroker->executeChat(0, d); return true; } - /* @doc: dcc.send @type: @@ -582,20 +597,20 @@ static bool dcc_kvs_cmd_chat(KviKvsModuleCommandCall * c) static bool dcc_kvs_cmd_send(KviKvsModuleCommandCall * c) { - QString szTarget,szFileName; + QString szTarget, szFileName; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("target",KVS_PT_NONEMPTYSTRING,0,szTarget) - KVSM_PARAMETER("file name",KVS_PT_NONEMPTYSTRING,KVS_PF_OPTIONAL,szFileName) + KVSM_PARAMETER("target", KVS_PT_NONEMPTYSTRING, 0, szTarget) + KVSM_PARAMETER("file name", KVS_PT_NONEMPTYSTRING, KVS_PF_OPTIONAL, szFileName) KVSM_PARAMETERS_END(c) DccDescriptor * d = new DccDescriptor(c->window()->console()); - d->szNick = szTarget; // we always specify the nickname + d->szNick = szTarget; // we always specify the nickname QString szTmp; KviKvsVariant * pSw = 0; - if( (pSw = c->switches()->find('g',"get")) ) + if((pSw = c->switches()->find('g', "get"))) { d->szFileName = QFileInfo(szFileName).fileName(); @@ -607,57 +622,68 @@ static bool dcc_kvs_cmd_send(KviKvsModuleCommandCall * c) pSw->asString(szTmp); // avoid sprintf as long as possible d->szFileSize = szTmp; - } else { - d->szFileSize = __tr_ctx("","dcc"); + } + else + { + d->szFileSize = __tr_ctx("", "dcc"); } } - } else { - d->szFileName = szFileName; + } + else + { + d->szFileName = szFileName; d->szLocalFileName = szFileName; } - d->szUser = __tr2qs_ctx("unknown","dcc"); // username is always unknown - d->szHost = d->szUser; // host is always unknown - d->bRecvFile = pSw != 0; - d->bNoAcks = c->switches()->find('b',"blind") || c->switches()->find('t',"tdcc"); - d->bResume = false; - d->bAutoAccept = pSw != 0; + d->szUser = __tr2qs_ctx("unknown", "dcc"); // username is always unknown + d->szHost = d->szUser; // host is always unknown + d->bRecvFile = pSw != 0; + d->bNoAcks = c->switches()->find('b', "blind") || c->switches()->find('t', "tdcc"); + d->bResume = false; + d->bAutoAccept = pSw != 0; d->bIsIncomingAvatar = false; - if(!dcc_kvs_parse_default_parameters(d,c))return false; + if(!dcc_kvs_parse_default_parameters(d, c)) + return false; - if(c->switches()->find('c',"connect")) + if(c->switches()->find('c', "connect")) { - if(!(c->switches()->find('i',"ip") && c->switches()->find('p',"port"))) + if(!(c->switches()->find('i', "ip") && c->switches()->find('p', "port"))) { delete d; - c->error(__tr2qs_ctx("-c requires -i and -p","dcc")); + c->error(__tr2qs_ctx("-c requires -i and -p", "dcc")); return false; } - d->szIp = d->szListenIp; - d->szPort = d->szListenPort; - d->szListenIp = ""; // useless + d->szIp = d->szListenIp; + d->szPort = d->szListenPort; + d->szListenIp = ""; // useless d->szListenPort = ""; // useless - d->bActive = true; - } else { - d->szIp = __tr2qs_ctx("unknown","dcc"); - d->szPort = d->szIp; - d->bActive = false; - d->bSendRequest = !c->switches()->find('n',"no-ctcp"); + d->bActive = true; + } + else + { + d->szIp = __tr2qs_ctx("unknown", "dcc"); + d->szPort = d->szIp; + d->bActive = false; + d->bSendRequest = !c->switches()->find('n', "no-ctcp"); } - if(c->switches()->find('g',"get")) + if(c->switches()->find('g', "get")) { - dcc_module_set_dcc_type(d,"RECV"); + dcc_module_set_dcc_type(d, "RECV"); d->triggerCreationEvent(); g_pDccBroker->recvFileManage(d); - } else { - dcc_module_set_dcc_type(d,"SEND"); + } + else + { + dcc_module_set_dcc_type(d, "SEND"); d->triggerCreationEvent(); if(!d->szLocalFileName.isEmpty()) { - g_pDccBroker->sendFileExecute(0,d); - } else { + g_pDccBroker->sendFileExecute(0, d); + } + else + { g_pDccBroker->sendFileManage(d); } } @@ -757,38 +783,40 @@ static bool dcc_kvs_cmd_send(KviKvsModuleCommandCall * c) static bool dcc_kvs_cmd_recv(KviKvsModuleCommandCall * c) { - QString szTarget,szFileName; + QString szTarget, szFileName; kvs_uint_t uSize; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("target",KVS_PT_NONEMPTYSTRING,0,szTarget) - KVSM_PARAMETER("filename",KVS_PT_NONEMPTYSTRING,0,szFileName) - KVSM_PARAMETER("size",KVS_PT_UINT,0,uSize) + KVSM_PARAMETER("target", KVS_PT_NONEMPTYSTRING, 0, szTarget) + KVSM_PARAMETER("filename", KVS_PT_NONEMPTYSTRING, 0, szFileName) + KVSM_PARAMETER("size", KVS_PT_UINT, 0, uSize) KVSM_PARAMETERS_END(c) DccDescriptor * d = new DccDescriptor(c->window()->console()); - d->szNick = szTarget; - d->szUser = __tr2qs_ctx("unknown","dcc"); - d->szHost = d->szUser; - d->szIp = __tr2qs_ctx("unknown","dcc"); - d->szPort = d->szIp; + d->szNick = szTarget; + d->szUser = __tr2qs_ctx("unknown", "dcc"); + d->szHost = d->szUser; + d->szIp = __tr2qs_ctx("unknown", "dcc"); + d->szPort = d->szIp; // -c is senseless here...but we accept it for compatibility - if(!dcc_kvs_parse_default_parameters(d,c))return false; + if(!dcc_kvs_parse_default_parameters(d, c)) + return false; - d->szFileName = szFileName; + d->szFileName = szFileName; d->szFileSize.setNum(uSize); - d->bActive = false; // we have to listen! - d->bResume = false; - d->bRecvFile = true; // we have to receive the file! - d->bSendRequest = !c->switches()->find('n',"no-ctcp"); - d->bNoAcks = d->bIsTdcc || c->switches()->find('b',"blind"); - d->bAutoAccept = KVI_OPTION_BOOL(KviOption_boolAutoAcceptDccSend); - d->bIsIncomingAvatar = g_pApp->findPendingAvatarChange(d->console(),d->szNick,d->szFileName); - - if(KVI_OPTION_BOOL(KviOption_boolAutoAcceptIncomingAvatars))d->bAutoAccept = d->bAutoAccept || d->bIsIncomingAvatar; - dcc_module_set_dcc_type(d,"RECV"); + d->bActive = false; // we have to listen! + d->bResume = false; + d->bRecvFile = true; // we have to receive the file! + d->bSendRequest = !c->switches()->find('n', "no-ctcp"); + d->bNoAcks = d->bIsTdcc || c->switches()->find('b', "blind"); + d->bAutoAccept = KVI_OPTION_BOOL(KviOption_boolAutoAcceptDccSend); + d->bIsIncomingAvatar = g_pApp->findPendingAvatarChange(d->console(), d->szNick, d->szFileName); + + if(KVI_OPTION_BOOL(KviOption_boolAutoAcceptIncomingAvatars)) + d->bAutoAccept = d->bAutoAccept || d->bIsIncomingAvatar; + dcc_module_set_dcc_type(d, "RECV"); d->triggerCreationEvent(); g_pDccBroker->recvFileManage(d); @@ -838,39 +866,38 @@ static bool dcc_kvs_cmd_recv(KviKvsModuleCommandCall * c) static bool dcc_kvs_cmd_rsend(KviKvsModuleCommandCall * c) { - QString szTarget,szFileName; + QString szTarget, szFileName; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("target",KVS_PT_NONEMPTYSTRING,0,szTarget) - KVSM_PARAMETER("filename",KVS_PT_NONEMPTYSTRING,KVS_PF_OPTIONAL,szFileName) + KVSM_PARAMETER("target", KVS_PT_NONEMPTYSTRING, 0, szTarget) + KVSM_PARAMETER("filename", KVS_PT_NONEMPTYSTRING, KVS_PF_OPTIONAL, szFileName) KVSM_PARAMETERS_END(c) KVSM_REQUIRE_CONNECTION(c) DccDescriptor * d = new DccDescriptor(c->window()->console()); - d->szNick = szTarget; - d->szLocalFileName = szFileName; - d->bIsTdcc = c->switches()->find('t',"tdcc"); + d->szNick = szTarget; + d->szLocalFileName = szFileName; + d->bIsTdcc = c->switches()->find('t', "tdcc"); #ifdef COMPILE_SSL_SUPPORT - d->bIsSSL = c->switches()->find('s',"ssl"); + d->bIsSSL = c->switches()->find('s', "ssl"); #else - if(c->switches()->find('s',"ssl"))c->warning(__tr2qs_ctx("This executable has been built without SSL support, -s switch ignored","dcc")); + if(c->switches()->find('s', "ssl")) + c->warning(__tr2qs_ctx("This executable has been built without SSL support, -s switch ignored", "dcc")); #endif //!COMPILE_SSL_SUPPORT - if(c->switches()->find('z',"zero-port")) + if(c->switches()->find('z', "zero-port")) { - dcc_module_set_dcc_type(d,"SEND"); + dcc_module_set_dcc_type(d, "SEND"); d->setZeroPortRequestTag("nonempty"); // just to tag it - } else - dcc_module_set_dcc_type(d,"RSEND"); + } + else + dcc_module_set_dcc_type(d, "RSEND"); d->triggerCreationEvent(); g_pDccBroker->rsendManage(d); return true; } - - - /* @doc: dcc.get @type: @@ -901,17 +928,17 @@ static bool dcc_kvs_cmd_rsend(KviKvsModuleCommandCall * c) static bool dcc_kvs_cmd_get(KviKvsModuleCommandCall * c) { - QString szTarget,szFileName; + QString szTarget, szFileName; kvs_uint_t uSize; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("target",KVS_PT_NONEMPTYSTRING,0,szTarget) - KVSM_PARAMETER("filename",KVS_PT_NONEMPTYSTRING,0,szFileName) - KVSM_PARAMETER("size",KVS_PT_UINT,KVS_PF_OPTIONAL,uSize) + KVSM_PARAMETER("target", KVS_PT_NONEMPTYSTRING, 0, szTarget) + KVSM_PARAMETER("filename", KVS_PT_NONEMPTYSTRING, 0, szFileName) + KVSM_PARAMETER("size", KVS_PT_UINT, KVS_PF_OPTIONAL, uSize) KVSM_PARAMETERS_END(c) KVSM_REQUIRE_CONNECTION(c) - KviQString::cutToLast(szFileName,'/'); + KviQString::cutToLast(szFileName, '/'); if(szFileName.contains(' ')) { @@ -921,36 +948,38 @@ static bool dcc_kvs_cmd_get(KviKvsModuleCommandCall * c) KviCString szDCC("GET"); #ifdef COMPILE_SSL_SUPPORT - if(c->switches()->find('s',"ssl"))szDCC.prepend('S'); + if(c->switches()->find('s', "ssl")) + szDCC.prepend('S'); #else - if(c->switches()->find('s',"ssl"))c->warning(__tr2qs_ctx("This executable has no SSL support, -s switch ignored","dcc")); + if(c->switches()->find('s', "ssl")) + c->warning(__tr2qs_ctx("This executable has no SSL support, -s switch ignored", "dcc")); #endif - if(c->switches()->find('t',"tdcc"))szDCC.prepend('T'); + if(c->switches()->find('t', "tdcc")) + szDCC.prepend('T'); if(uSize == 0) { c->window()->console()->connection()->sendFmtData("PRIVMSG %s :%cDCC %s %s%c", - c->window()->console()->connection()->encodeText(szTarget).data(), - 0x01, - c->window()->console()->connection()->encodeText(szDCC.ptr()).data(), - c->window()->console()->connection()->encodeText(szFileName).data(), - 0x01); - } else { + c->window()->console()->connection()->encodeText(szTarget).data(), + 0x01, + c->window()->console()->connection()->encodeText(szDCC.ptr()).data(), + c->window()->console()->connection()->encodeText(szFileName).data(), + 0x01); + } + else + { c->window()->console()->connection()->sendFmtData("PRIVMSG %s :%cDCC %s %s %s%c", - c->window()->console()->connection()->encodeText(szTarget).data(), - 0x01, - c->window()->console()->connection()->encodeText(szDCC.ptr()).data(), - c->window()->console()->connection()->encodeText(szFileName).data(), - c->window()->console()->connection()->encodeText(QString::number(uSize)).data(), - 0x01); + c->window()->console()->connection()->encodeText(szTarget).data(), + 0x01, + c->window()->console()->connection()->encodeText(szDCC.ptr()).data(), + c->window()->console()->connection()->encodeText(szFileName).data(), + c->window()->console()->connection()->encodeText(QString::number(uSize)).data(), + 0x01); } return true; } - - - // FIXME: SSL support for DCC VOICE ? (has a sense ?) /* @@ -1064,71 +1093,76 @@ static bool dcc_kvs_cmd_voice(KviKvsModuleCommandCall * c) { QString szTarget; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("target",KVS_PT_NONEMPTYSTRING,0,szTarget) + KVSM_PARAMETER("target", KVS_PT_NONEMPTYSTRING, 0, szTarget) KVSM_PARAMETERS_END(c) #ifdef COMPILE_DISABLE_DCC_VOICE - c->warning(__tr2qs_ctx("DCC VOICE support not enabled at compilation time","dcc")); + c->warning(__tr2qs_ctx("DCC VOICE support not enabled at compilation time", "dcc")); return true; #endif DccDescriptor * d = new DccDescriptor(c->window()->console()); - d->szNick = szTarget; // we always specify the nickname - d->szUser = __tr2qs_ctx("unknown","dcc"); // username is always unknown - d->szHost = d->szUser; // host is always unknown - d->iSampleRate = 8000; + d->szNick = szTarget; // we always specify the nickname + d->szUser = __tr2qs_ctx("unknown", "dcc"); // username is always unknown + d->szHost = d->szUser; // host is always unknown + d->iSampleRate = 8000; - if(!dcc_kvs_parse_default_parameters(d,c))return false; + if(!dcc_kvs_parse_default_parameters(d, c)) + return false; - if(KviKvsVariant * pSR = c->switches()->find('h',"sample-rate")) + if(KviKvsVariant * pSR = c->switches()->find('h', "sample-rate")) { kvs_int_t iSR; if(!pSR->asInteger(iSR)) { - c->warning(__tr2qs_ctx("Invalid sample rate specified, defaulting to 8000","dcc")); + c->warning(__tr2qs_ctx("Invalid sample rate specified, defaulting to 8000", "dcc")); d->iSampleRate = 8000; - } else { + } + else + { d->iSampleRate = iSR; } } d->szCodec = "adpcm"; - if(KviKvsVariant * pCodec = c->switches()->find('g',"codec")) + if(KviKvsVariant * pCodec = c->switches()->find('g', "codec")) { QString szCodec; pCodec->asString(szCodec); if(!kvi_dcc_voice_is_valid_codec(szCodec.toUtf8().data())) { - c->warning(__tr2qs_ctx("Invalid codec specified, defaulting to 'ADPCM'","dcc")); + c->warning(__tr2qs_ctx("Invalid codec specified, defaulting to 'ADPCM'", "dcc")); d->szCodec = "adpcm"; } } - dcc_module_set_dcc_type(d,"VOICE"); - if(c->switches()->find('c',"connect")) + dcc_module_set_dcc_type(d, "VOICE"); + if(c->switches()->find('c', "connect")) { - if(!(c->switches()->find('i',"ip") && c->switches()->find('p',"port"))) + if(!(c->switches()->find('i', "ip") && c->switches()->find('p', "port"))) { delete d; - c->error(__tr2qs_ctx("-c requires -i and -p","dcc")); + c->error(__tr2qs_ctx("-c requires -i and -p", "dcc")); return false; } - d->szIp = d->szListenIp; - d->szPort = d->szListenPort; - d->szListenIp = ""; // useless + d->szIp = d->szListenIp; + d->szPort = d->szListenPort; + d->szListenIp = ""; // useless d->szListenPort = ""; // useless - d->bActive = true; + d->bActive = true; d->triggerCreationEvent(); - g_pDccBroker->activeVoiceExecute(0,d); - } else { - d->szIp = __tr2qs_ctx("unknown","dcc"); - d->szPort = d->szIp; - d->bActive = false; - d->bSendRequest = !(c->switches()->find('n',"no-ctcp")); + g_pDccBroker->activeVoiceExecute(0, d); + } + else + { + d->szIp = __tr2qs_ctx("unknown", "dcc"); + d->szPort = d->szIp; + d->bActive = false; + d->bSendRequest = !(c->switches()->find('n', "no-ctcp")); d->triggerCreationEvent(); g_pDccBroker->passiveVoiceExecute(d); @@ -1137,65 +1171,69 @@ static bool dcc_kvs_cmd_voice(KviKvsModuleCommandCall * c) return true; } - static bool dcc_kvs_cmd_video(KviKvsModuleCommandCall * c) { QString szTarget; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("target",KVS_PT_NONEMPTYSTRING,0,szTarget) + KVSM_PARAMETER("target", KVS_PT_NONEMPTYSTRING, 0, szTarget) KVSM_PARAMETERS_END(c) #ifdef COMPILE_DISABLE_DCC_VIDEO - c->warning(__tr2qs_ctx("DCC VIDEO support not enabled at compilation time","dcc")); + c->warning(__tr2qs_ctx("DCC VIDEO support not enabled at compilation time", "dcc")); return true; #else DccDescriptor * d = new DccDescriptor(c->window()->console()); - d->szNick = szTarget; // we always specify the nickname - d->szUser = __tr2qs_ctx("unknown","dcc"); // username is always unknown - d->szHost = d->szUser; // host is always unknown + d->szNick = szTarget; // we always specify the nickname + d->szUser = __tr2qs_ctx("unknown", "dcc"); // username is always unknown + d->szHost = d->szUser; // host is always unknown - if(!dcc_kvs_parse_default_parameters(d,c))return false; + if(!dcc_kvs_parse_default_parameters(d, c)) + return false; d->szCodec = "sjpeg"; - if(KviKvsVariant * pCodec = c->switches()->find('g',"codec")) + if(KviKvsVariant * pCodec = c->switches()->find('g', "codec")) { QString szCodec; pCodec->asString(szCodec); if(!kvi_dcc_video_is_valid_codec(szCodec.toUtf8().data())) { - c->warning(__tr2qs_ctx("Invalid codec specified","dcc")); + c->warning(__tr2qs_ctx("Invalid codec specified", "dcc")); d->szCodec = "sjpeg"; - } else { + } + else + { d->szCodec = szCodec; } } - dcc_module_set_dcc_type(d,"VIDEO"); - if(c->switches()->find('c',"connect")) + dcc_module_set_dcc_type(d, "VIDEO"); + if(c->switches()->find('c', "connect")) { - if(!(c->switches()->find('i',"ip") && c->switches()->find('p',"port"))) + if(!(c->switches()->find('i', "ip") && c->switches()->find('p', "port"))) { delete d; - c->error(__tr2qs_ctx("-c requires -i and -p","dcc")); + c->error(__tr2qs_ctx("-c requires -i and -p", "dcc")); return false; } - d->szIp = d->szListenIp; - d->szPort = d->szListenPort; - d->szListenIp = ""; // useless + d->szIp = d->szListenIp; + d->szPort = d->szListenPort; + d->szListenIp = ""; // useless d->szListenPort = ""; // useless - d->bActive = true; + d->bActive = true; d->triggerCreationEvent(); - g_pDccBroker->activeVideoExecute(0,d); - } else { - d->szIp = __tr2qs_ctx("unknown","dcc"); - d->szPort = d->szIp; - d->bActive = false; - d->bSendRequest = !(c->switches()->find('n',"no-ctcp")); + g_pDccBroker->activeVideoExecute(0, d); + } + else + { + d->szIp = __tr2qs_ctx("unknown", "dcc"); + d->szPort = d->szIp; + d->bActive = false; + d->bSendRequest = !(c->switches()->find('n', "no-ctcp")); d->triggerCreationEvent(); g_pDccBroker->passiveVideoExecute(d); @@ -1205,7 +1243,6 @@ static bool dcc_kvs_cmd_video(KviKvsModuleCommandCall * c) #endif } - /* static bool dcc_module_cmd_canvas(KviModule *m,KviCommand *c) { @@ -1324,10 +1361,6 @@ static bool dcc_module_cmd_canvas(KviModule *m,KviCommand *c) } */ - - - - /* @doc: dcc_connection @type: @@ -1586,7 +1619,7 @@ static bool dcc_module_cmd_canvas(KviModule *m,KviCommand *c) [i]XDCC[/i] has exactly the same meaning as [i]DCC[/i] (at least in KVIrc).[br] */ -static DccDescriptor * dcc_kvs_find_dcc_descriptor(const kvs_uint_t &uId,KviKvsModuleRunTimeCall * c,bool bWarn = true) +static DccDescriptor * dcc_kvs_find_dcc_descriptor(const kvs_uint_t & uId, KviKvsModuleRunTimeCall * c, bool bWarn = true) { DccDescriptor * dcc = 0; if(uId == 0) @@ -1596,16 +1629,15 @@ static DccDescriptor * dcc_kvs_find_dcc_descriptor(const kvs_uint_t &uId,KviKvsM dcc = ((DccWindow *)(c->window()))->descriptor(); } if((!dcc) && bWarn) - c->warning(__tr2qs_ctx("The current window has no associated DCC session","dcc")); + c->warning(__tr2qs_ctx("The current window has no associated DCC session", "dcc")); return dcc; } dcc = DccDescriptor::find(uId); if((!dcc) && bWarn) - c->warning(__tr2qs_ctx("The specified parameter is not a valid DCC identifier","dcc")); + c->warning(__tr2qs_ctx("The specified parameter is not a valid DCC identifier", "dcc")); return dcc; } - /* @doc: dcc.abort @type: @@ -1634,10 +1666,10 @@ static bool dcc_kvs_cmd_abort(KviKvsModuleCommandCall * c) { kvs_uint_t uDccId; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("dcc_id",KVS_PT_UINT,KVS_PF_OPTIONAL,uDccId) + KVSM_PARAMETER("dcc_id", KVS_PT_UINT, KVS_PF_OPTIONAL, uDccId) KVSM_PARAMETERS_END(c) - DccDescriptor * dcc = dcc_kvs_find_dcc_descriptor(uDccId,c,!c->switches()->find('q',"quiet")); + DccDescriptor * dcc = dcc_kvs_find_dcc_descriptor(uDccId, c, !c->switches()->find('q', "quiet")); if(dcc) { @@ -1673,17 +1705,19 @@ static bool dcc_kvs_cmd_abort(KviKvsModuleCommandCall * c) */ static bool dcc_kvs_cmd_setBandwidthLimit(KviKvsModuleCommandCall * c) { - kvs_uint_t uDccId,uVal; + kvs_uint_t uDccId, uVal; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("limit_value",KVS_PT_UINT,0,uVal) - KVSM_PARAMETER("dcc_id",KVS_PT_UINT,KVS_PF_OPTIONAL,uDccId) + KVSM_PARAMETER("limit_value", KVS_PT_UINT, 0, uVal) + KVSM_PARAMETER("dcc_id", KVS_PT_UINT, KVS_PF_OPTIONAL, uDccId) KVSM_PARAMETERS_END(c) - DccDescriptor * dcc = dcc_kvs_find_dcc_descriptor(uDccId,c,!c->switches()->find('q',"quiet")); + DccDescriptor * dcc = dcc_kvs_find_dcc_descriptor(uDccId, c, !c->switches()->find('q', "quiet")); if(dcc) { - if (dcc->transfer())dcc->transfer()->setBandwidthLimit(uVal); - else if (!c->switches()->find('q',"quiet"))c->warning(__tr2qs_ctx("This DCC session is not a DCC transfer session","dcc")); + if(dcc->transfer()) + dcc->transfer()->setBandwidthLimit(uVal); + else if(!c->switches()->find('q', "quiet")) + c->warning(__tr2qs_ctx("This DCC session is not a DCC transfer session", "dcc")); } return true; } @@ -1714,16 +1748,16 @@ static bool dcc_kvs_fnc_protocol(KviKvsModuleFunctionCall * c) { kvs_uint_t uDccId; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("dcc_id",KVS_PT_UINT,KVS_PF_OPTIONAL,uDccId) + KVSM_PARAMETER("dcc_id", KVS_PT_UINT, KVS_PF_OPTIONAL, uDccId) KVSM_PARAMETERS_END(c) - DccDescriptor * dcc = dcc_kvs_find_dcc_descriptor(uDccId,c); + DccDescriptor * dcc = dcc_kvs_find_dcc_descriptor(uDccId, c); - if(dcc)c->returnValue()->setString(dcc->protocol()); + if(dcc) + c->returnValue()->setString(dcc->protocol()); return true; } - /* @doc: dcc.connectionType @type: @@ -1751,16 +1785,16 @@ static bool dcc_kvs_fnc_connectionType(KviKvsModuleFunctionCall * c) { kvs_uint_t uDccId; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("dcc_id",KVS_PT_UINT,KVS_PF_OPTIONAL,uDccId) + KVSM_PARAMETER("dcc_id", KVS_PT_UINT, KVS_PF_OPTIONAL, uDccId) KVSM_PARAMETERS_END(c) - DccDescriptor * dcc = dcc_kvs_find_dcc_descriptor(uDccId,c); + DccDescriptor * dcc = dcc_kvs_find_dcc_descriptor(uDccId, c); - if(dcc)c->returnValue()->setString(dcc->isActive() ? "ACTIVE" : "PASSIVE"); + if(dcc) + c->returnValue()->setString(dcc->isActive() ? "ACTIVE" : "PASSIVE"); return true; } - /* @doc: dcc.isFileTransfer @type: @@ -1787,16 +1821,16 @@ static bool dcc_kvs_fnc_isFileTransfer(KviKvsModuleFunctionCall * c) { kvs_uint_t uDccId; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("dcc_id",KVS_PT_UINT,KVS_PF_OPTIONAL,uDccId) + KVSM_PARAMETER("dcc_id", KVS_PT_UINT, KVS_PF_OPTIONAL, uDccId) KVSM_PARAMETERS_END(c) - DccDescriptor * dcc = dcc_kvs_find_dcc_descriptor(uDccId,c,false); + DccDescriptor * dcc = dcc_kvs_find_dcc_descriptor(uDccId, c, false); - if(dcc)c->returnValue()->setBoolean(dcc->isFileTransfer()); + if(dcc) + c->returnValue()->setBoolean(dcc->isFileTransfer()); return true; } - /* @doc: dcc.isFileUpload @type: @@ -1823,16 +1857,16 @@ static bool dcc_kvs_fnc_isFileUpload(KviKvsModuleFunctionCall * c) { kvs_uint_t uDccId; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("dcc_id",KVS_PT_UINT,KVS_PF_OPTIONAL,uDccId) + KVSM_PARAMETER("dcc_id", KVS_PT_UINT, KVS_PF_OPTIONAL, uDccId) KVSM_PARAMETERS_END(c) - DccDescriptor * dcc = dcc_kvs_find_dcc_descriptor(uDccId,c); + DccDescriptor * dcc = dcc_kvs_find_dcc_descriptor(uDccId, c); - if(dcc)c->returnValue()->setBoolean(dcc->isFileUpload()); + if(dcc) + c->returnValue()->setBoolean(dcc->isFileUpload()); return true; } - /* @doc: dcc.isFileDownload @type: @@ -1859,16 +1893,16 @@ static bool dcc_kvs_fnc_isFileDownload(KviKvsModuleFunctionCall * c) { kvs_uint_t uDccId; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("dcc_id",KVS_PT_UINT,KVS_PF_OPTIONAL,uDccId) + KVSM_PARAMETER("dcc_id", KVS_PT_UINT, KVS_PF_OPTIONAL, uDccId) KVSM_PARAMETERS_END(c) - DccDescriptor * dcc = dcc_kvs_find_dcc_descriptor(uDccId,c); + DccDescriptor * dcc = dcc_kvs_find_dcc_descriptor(uDccId, c); - if(dcc)c->returnValue()->setBoolean(dcc->isFileDownload()); + if(dcc) + c->returnValue()->setBoolean(dcc->isFileDownload()); return true; } - /* @doc: dcc.localNick @type: @@ -1894,16 +1928,16 @@ static bool dcc_kvs_fnc_localNick(KviKvsModuleFunctionCall * c) { kvs_uint_t uDccId; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("dcc_id",KVS_PT_UINT,KVS_PF_OPTIONAL,uDccId) + KVSM_PARAMETER("dcc_id", KVS_PT_UINT, KVS_PF_OPTIONAL, uDccId) KVSM_PARAMETERS_END(c) - DccDescriptor * dcc = dcc_kvs_find_dcc_descriptor(uDccId,c); + DccDescriptor * dcc = dcc_kvs_find_dcc_descriptor(uDccId, c); - if(dcc)c->returnValue()->setString(dcc->localNick()); + if(dcc) + c->returnValue()->setString(dcc->localNick()); return true; } - /* @doc: dcc.localUser @type: @@ -1929,12 +1963,13 @@ static bool dcc_kvs_fnc_localUser(KviKvsModuleFunctionCall * c) { kvs_uint_t uDccId; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("dcc_id",KVS_PT_UINT,KVS_PF_OPTIONAL,uDccId) + KVSM_PARAMETER("dcc_id", KVS_PT_UINT, KVS_PF_OPTIONAL, uDccId) KVSM_PARAMETERS_END(c) - DccDescriptor * dcc = dcc_kvs_find_dcc_descriptor(uDccId,c); + DccDescriptor * dcc = dcc_kvs_find_dcc_descriptor(uDccId, c); - if(dcc)c->returnValue()->setString(dcc->localUser()); + if(dcc) + c->returnValue()->setString(dcc->localUser()); return true; } @@ -1963,16 +1998,16 @@ static bool dcc_kvs_fnc_localHost(KviKvsModuleFunctionCall * c) { kvs_uint_t uDccId; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("dcc_id",KVS_PT_UINT,KVS_PF_OPTIONAL,uDccId) + KVSM_PARAMETER("dcc_id", KVS_PT_UINT, KVS_PF_OPTIONAL, uDccId) KVSM_PARAMETERS_END(c) - DccDescriptor * dcc = dcc_kvs_find_dcc_descriptor(uDccId,c); + DccDescriptor * dcc = dcc_kvs_find_dcc_descriptor(uDccId, c); - if(dcc)c->returnValue()->setString(dcc->localHost()); + if(dcc) + c->returnValue()->setString(dcc->localHost()); return true; } - /* @doc: dcc.localIp @type: @@ -1998,16 +2033,16 @@ static bool dcc_kvs_fnc_localIp(KviKvsModuleFunctionCall * c) { kvs_uint_t uDccId; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("dcc_id",KVS_PT_UINT,KVS_PF_OPTIONAL,uDccId) + KVSM_PARAMETER("dcc_id", KVS_PT_UINT, KVS_PF_OPTIONAL, uDccId) KVSM_PARAMETERS_END(c) - DccDescriptor * dcc = dcc_kvs_find_dcc_descriptor(uDccId,c); + DccDescriptor * dcc = dcc_kvs_find_dcc_descriptor(uDccId, c); - if(dcc)c->returnValue()->setString(dcc->localIp()); + if(dcc) + c->returnValue()->setString(dcc->localIp()); return true; } - /* @doc: dcc.localPort @type: @@ -2032,16 +2067,16 @@ static bool dcc_kvs_fnc_localPort(KviKvsModuleFunctionCall * c) { kvs_uint_t uDccId; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("dcc_id",KVS_PT_UINT,KVS_PF_OPTIONAL,uDccId) + KVSM_PARAMETER("dcc_id", KVS_PT_UINT, KVS_PF_OPTIONAL, uDccId) KVSM_PARAMETERS_END(c) - DccDescriptor * dcc = dcc_kvs_find_dcc_descriptor(uDccId,c); + DccDescriptor * dcc = dcc_kvs_find_dcc_descriptor(uDccId, c); - if(dcc)c->returnValue()->setString(dcc->localPort()); + if(dcc) + c->returnValue()->setString(dcc->localPort()); return true; } - /* @doc: dcc.localFileName @type: @@ -2064,16 +2099,16 @@ static bool dcc_kvs_fnc_localFileName(KviKvsModuleFunctionCall * c) { kvs_uint_t uDccId; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("dcc_id",KVS_PT_UINT,KVS_PF_OPTIONAL,uDccId) + KVSM_PARAMETER("dcc_id", KVS_PT_UINT, KVS_PF_OPTIONAL, uDccId) KVSM_PARAMETERS_END(c) - DccDescriptor * dcc = dcc_kvs_find_dcc_descriptor(uDccId,c); + DccDescriptor * dcc = dcc_kvs_find_dcc_descriptor(uDccId, c); - if(dcc)c->returnValue()->setString(dcc->localFileName()); + if(dcc) + c->returnValue()->setString(dcc->localFileName()); return true; } - /* @doc: dcc.localFileSize @type: @@ -2101,16 +2136,16 @@ static bool dcc_kvs_fnc_localFileSize(KviKvsModuleFunctionCall * c) { kvs_uint_t uDccId; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("dcc_id",KVS_PT_UINT,KVS_PF_OPTIONAL,uDccId) + KVSM_PARAMETER("dcc_id", KVS_PT_UINT, KVS_PF_OPTIONAL, uDccId) KVSM_PARAMETERS_END(c) - DccDescriptor * dcc = dcc_kvs_find_dcc_descriptor(uDccId,c); + DccDescriptor * dcc = dcc_kvs_find_dcc_descriptor(uDccId, c); - if(dcc)c->returnValue()->setString(dcc->localFileSize().isEmpty() ? QString("0") : dcc->localFileSize()); + if(dcc) + c->returnValue()->setString(dcc->localFileSize().isEmpty() ? QString("0") : dcc->localFileSize()); return true; } - /* @doc: dcc.remoteNick @type: @@ -2136,16 +2171,16 @@ static bool dcc_kvs_fnc_remoteNick(KviKvsModuleFunctionCall * c) { kvs_uint_t uDccId; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("dcc_id",KVS_PT_UINT,KVS_PF_OPTIONAL,uDccId) + KVSM_PARAMETER("dcc_id", KVS_PT_UINT, KVS_PF_OPTIONAL, uDccId) KVSM_PARAMETERS_END(c) - DccDescriptor * dcc = dcc_kvs_find_dcc_descriptor(uDccId,c); + DccDescriptor * dcc = dcc_kvs_find_dcc_descriptor(uDccId, c); - if(dcc)c->returnValue()->setString(dcc->remoteNick()); + if(dcc) + c->returnValue()->setString(dcc->remoteNick()); return true; } - /* @doc: dcc.remoteUser @type: @@ -2171,12 +2206,13 @@ static bool dcc_kvs_fnc_remoteUser(KviKvsModuleFunctionCall * c) { kvs_uint_t uDccId; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("dcc_id",KVS_PT_UINT,KVS_PF_OPTIONAL,uDccId) + KVSM_PARAMETER("dcc_id", KVS_PT_UINT, KVS_PF_OPTIONAL, uDccId) KVSM_PARAMETERS_END(c) - DccDescriptor * dcc = dcc_kvs_find_dcc_descriptor(uDccId,c); + DccDescriptor * dcc = dcc_kvs_find_dcc_descriptor(uDccId, c); - if(dcc)c->returnValue()->setString(dcc->remoteUser()); + if(dcc) + c->returnValue()->setString(dcc->remoteUser()); return true; } @@ -2205,12 +2241,13 @@ static bool dcc_kvs_fnc_remoteHost(KviKvsModuleFunctionCall * c) { kvs_uint_t uDccId; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("dcc_id",KVS_PT_UINT,KVS_PF_OPTIONAL,uDccId) + KVSM_PARAMETER("dcc_id", KVS_PT_UINT, KVS_PF_OPTIONAL, uDccId) KVSM_PARAMETERS_END(c) - DccDescriptor * dcc = dcc_kvs_find_dcc_descriptor(uDccId,c); + DccDescriptor * dcc = dcc_kvs_find_dcc_descriptor(uDccId, c); - if(dcc)c->returnValue()->setString(dcc->remoteHost()); + if(dcc) + c->returnValue()->setString(dcc->remoteHost()); return true; } @@ -2239,16 +2276,16 @@ static bool dcc_kvs_fnc_remoteIp(KviKvsModuleFunctionCall * c) { kvs_uint_t uDccId; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("dcc_id",KVS_PT_UINT,KVS_PF_OPTIONAL,uDccId) + KVSM_PARAMETER("dcc_id", KVS_PT_UINT, KVS_PF_OPTIONAL, uDccId) KVSM_PARAMETERS_END(c) - DccDescriptor * dcc = dcc_kvs_find_dcc_descriptor(uDccId,c); + DccDescriptor * dcc = dcc_kvs_find_dcc_descriptor(uDccId, c); - if(dcc)c->returnValue()->setString(dcc->remoteIp()); + if(dcc) + c->returnValue()->setString(dcc->remoteIp()); return true; } - /* @doc: dcc.remotePort @type: @@ -2274,16 +2311,16 @@ static bool dcc_kvs_fnc_remotePort(KviKvsModuleFunctionCall * c) { kvs_uint_t uDccId; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("dcc_id",KVS_PT_UINT,KVS_PF_OPTIONAL,uDccId) + KVSM_PARAMETER("dcc_id", KVS_PT_UINT, KVS_PF_OPTIONAL, uDccId) KVSM_PARAMETERS_END(c) - DccDescriptor * dcc = dcc_kvs_find_dcc_descriptor(uDccId,c); + DccDescriptor * dcc = dcc_kvs_find_dcc_descriptor(uDccId, c); - if(dcc)c->returnValue()->setString(dcc->remotePort()); + if(dcc) + c->returnValue()->setString(dcc->remotePort()); return true; } - /* @doc: dcc.remoteFileName @type: @@ -2306,16 +2343,16 @@ static bool dcc_kvs_fnc_remoteFileName(KviKvsModuleFunctionCall * c) { kvs_uint_t uDccId; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("dcc_id",KVS_PT_UINT,KVS_PF_OPTIONAL,uDccId) + KVSM_PARAMETER("dcc_id", KVS_PT_UINT, KVS_PF_OPTIONAL, uDccId) KVSM_PARAMETERS_END(c) - DccDescriptor * dcc = dcc_kvs_find_dcc_descriptor(uDccId,c); + DccDescriptor * dcc = dcc_kvs_find_dcc_descriptor(uDccId, c); - if(dcc)c->returnValue()->setString(dcc->remoteFileName()); + if(dcc) + c->returnValue()->setString(dcc->remoteFileName()); return true; } - /* @doc: dcc.remoteFileSize @type: @@ -2343,16 +2380,16 @@ static bool dcc_kvs_fnc_remoteFileSize(KviKvsModuleFunctionCall * c) { kvs_uint_t uDccId; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("dcc_id",KVS_PT_UINT,KVS_PF_OPTIONAL,uDccId) + KVSM_PARAMETER("dcc_id", KVS_PT_UINT, KVS_PF_OPTIONAL, uDccId) KVSM_PARAMETERS_END(c) - DccDescriptor * dcc = dcc_kvs_find_dcc_descriptor(uDccId,c); + DccDescriptor * dcc = dcc_kvs_find_dcc_descriptor(uDccId, c); - if(dcc)c->returnValue()->setString(dcc->remoteFileSize().isEmpty() ? QString("0") : dcc->remoteFileSize()); + if(dcc) + c->returnValue()->setString(dcc->remoteFileSize().isEmpty() ? QString("0") : dcc->remoteFileSize()); return true; } - /* @doc: dcc.ircContext @type: @@ -2381,10 +2418,10 @@ static bool dcc_kvs_fnc_ircContext(KviKvsModuleFunctionCall * c) { kvs_uint_t uDccId; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("dcc_id",KVS_PT_UINT,KVS_PF_OPTIONAL,uDccId) + KVSM_PARAMETER("dcc_id", KVS_PT_UINT, KVS_PF_OPTIONAL, uDccId) KVSM_PARAMETERS_END(c) - DccDescriptor * dcc = dcc_kvs_find_dcc_descriptor(uDccId,c); + DccDescriptor * dcc = dcc_kvs_find_dcc_descriptor(uDccId, c); if(dcc) { @@ -2392,16 +2429,16 @@ static bool dcc_kvs_fnc_ircContext(KviKvsModuleFunctionCall * c) if(pEventWindow && (g_pApp->windowExists(pEventWindow))) { c->returnValue()->setInteger(dcc->console()->context()->id()); - } else { - c->error(__tr2qs_ctx("The IRC context that originated the DCC doesn't exists anymore.","dcc")); + } + else + { + c->error(__tr2qs_ctx("The IRC context that originated the DCC doesn't exists anymore.", "dcc")); return false; } } return true; } - - /* @doc: dcc.transferStatus @type: @@ -2431,10 +2468,10 @@ static bool dcc_kvs_fnc_transferStatus(KviKvsModuleFunctionCall * c) { kvs_uint_t uDccId; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("dcc_id",KVS_PT_UINT,KVS_PF_OPTIONAL,uDccId) + KVSM_PARAMETER("dcc_id", KVS_PT_UINT, KVS_PF_OPTIONAL, uDccId) KVSM_PARAMETERS_END(c) - DccDescriptor * dcc = dcc_kvs_find_dcc_descriptor(uDccId,c); + DccDescriptor * dcc = dcc_kvs_find_dcc_descriptor(uDccId, c); if(dcc) { @@ -2448,7 +2485,6 @@ static bool dcc_kvs_fnc_transferStatus(KviKvsModuleFunctionCall * c) return true; } - /* @doc: dcc.transferredBytes @type: @@ -2476,25 +2512,25 @@ static bool dcc_kvs_fnc_transferredBytes(KviKvsModuleFunctionCall * c) { kvs_uint_t uDccId; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("dcc_id",KVS_PT_UINT,KVS_PF_OPTIONAL,uDccId) + KVSM_PARAMETER("dcc_id", KVS_PT_UINT, KVS_PF_OPTIONAL, uDccId) KVSM_PARAMETERS_END(c) - DccDescriptor * dcc = dcc_kvs_find_dcc_descriptor(uDccId,c); + DccDescriptor * dcc = dcc_kvs_find_dcc_descriptor(uDccId, c); if(dcc) { if(dcc->transfer()) { c->returnValue()->setInteger(dcc->transfer()->transferredBytes()); - } else { + } + else + { c->returnValue()->setInteger(0); } } return true; } - - /* @doc: dcc.averageSpeed @type: @@ -2522,17 +2558,19 @@ static bool dcc_kvs_fnc_averageSpeed(KviKvsModuleFunctionCall * c) { kvs_uint_t uDccId; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("dcc_id",KVS_PT_UINT,KVS_PF_OPTIONAL,uDccId) + KVSM_PARAMETER("dcc_id", KVS_PT_UINT, KVS_PF_OPTIONAL, uDccId) KVSM_PARAMETERS_END(c) - DccDescriptor * dcc = dcc_kvs_find_dcc_descriptor(uDccId,c); + DccDescriptor * dcc = dcc_kvs_find_dcc_descriptor(uDccId, c); if(dcc) { if(dcc->transfer()) { c->returnValue()->setInteger(dcc->transfer()->averageSpeed()); - } else { + } + else + { c->returnValue()->setInteger(0); } } @@ -2564,24 +2602,25 @@ static bool dcc_kvs_fnc_currentSpeed(KviKvsModuleFunctionCall * c) { kvs_uint_t uDccId; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("dcc_id",KVS_PT_UINT,KVS_PF_OPTIONAL,uDccId) + KVSM_PARAMETER("dcc_id", KVS_PT_UINT, KVS_PF_OPTIONAL, uDccId) KVSM_PARAMETERS_END(c) - DccDescriptor * dcc = dcc_kvs_find_dcc_descriptor(uDccId,c); + DccDescriptor * dcc = dcc_kvs_find_dcc_descriptor(uDccId, c); if(dcc) { if(dcc->transfer()) { c->returnValue()->setInteger(dcc->transfer()->instantSpeed()); - } else { + } + else + { c->returnValue()->setInteger(0); } } return true; } - /* @doc: dcc.session @type: @@ -2604,7 +2643,7 @@ static bool dcc_kvs_fnc_session(KviKvsModuleFunctionCall * c) { QString szWinId; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("window_id",KVS_PT_STRING,KVS_PF_OPTIONAL,szWinId) + KVSM_PARAMETER("window_id", KVS_PT_STRING, KVS_PF_OPTIONAL, szWinId) KVSM_PARAMETERS_END(c) DccDescriptor * dcc = 0; @@ -2614,9 +2653,11 @@ static bool dcc_kvs_fnc_session(KviKvsModuleFunctionCall * c) dcc = ((DccWindow *)(c->window()))->descriptor(); if(!dcc) { - c->warning(__tr2qs_ctx("The current window has no associated DCC session","dcc")); + c->warning(__tr2qs_ctx("The current window has no associated DCC session", "dcc")); c->returnValue()->setInteger(0); - } else { + } + else + { c->returnValue()->setInteger(dcc->id()); } return true; @@ -2625,7 +2666,7 @@ static bool dcc_kvs_fnc_session(KviKvsModuleFunctionCall * c) KviWindow * pWnd = g_pApp->findWindow(szWinId); if(!pWnd) { - c->warning(__tr2qs_ctx("The specified window identifier is not valid","dcc")); + c->warning(__tr2qs_ctx("The specified window identifier is not valid", "dcc")); c->returnValue()->setInteger(0); return true; } @@ -2634,15 +2675,16 @@ static bool dcc_kvs_fnc_session(KviKvsModuleFunctionCall * c) dcc = ((DccWindow *)pWnd)->descriptor(); if(!dcc) { - c->warning(__tr2qs_ctx("The current window has no associated DCC session","dcc")); + c->warning(__tr2qs_ctx("The current window has no associated DCC session", "dcc")); c->returnValue()->setInteger(0); - } else { + } + else + { c->returnValue()->setInteger(dcc->id()); } return true; } - /* @doc: dcc.sessionList @type: @@ -2667,16 +2709,17 @@ static bool dcc_kvs_fnc_sessionList(KviKvsModuleFunctionCall * c) { QString szFlags; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("filter",KVS_PT_STRING,KVS_PF_OPTIONAL,szFlags) + KVSM_PARAMETER("filter", KVS_PT_STRING, KVS_PF_OPTIONAL, szFlags) KVSM_PARAMETERS_END(c) KviKvsArray * a = new KviKvsArray(); c->returnValue()->setArray(a); - KviPointerHashTable * dict = DccDescriptor::descriptorDict(); - if(!dict)return true; + KviPointerHashTable * dict = DccDescriptor::descriptorDict(); + if(!dict) + return true; - KviPointerHashTableIterator it(*dict); + KviPointerHashTableIterator it(*dict); int idx = 0; @@ -2685,21 +2728,21 @@ static bool dcc_kvs_fnc_sessionList(KviKvsModuleFunctionCall * c) // all while(DccDescriptor * dcc = it.current()) { - a->set(idx++,new KviKvsVariant((kvs_int_t)(dcc->id()))); + a->set(idx++, new KviKvsVariant((kvs_int_t)(dcc->id()))); ++it; } - } else { - bool bWantFileUploads = szFlags.contains('u',Qt::CaseInsensitive); - bool bWantFileDownloads = szFlags.contains('d',Qt::CaseInsensitive); - bool bWantChats = szFlags.contains('c',Qt::CaseInsensitive); + } + else + { + bool bWantFileUploads = szFlags.contains('u', Qt::CaseInsensitive); + bool bWantFileDownloads = szFlags.contains('d', Qt::CaseInsensitive); + bool bWantChats = szFlags.contains('c', Qt::CaseInsensitive); while(DccDescriptor * dcc = it.current()) { - if((dcc->isFileUpload() && bWantFileUploads) || - (dcc->isFileDownload() && bWantFileDownloads) || - (dcc->isDccChat() && bWantChats)) + if((dcc->isFileUpload() && bWantFileUploads) || (dcc->isFileDownload() && bWantFileDownloads) || (dcc->isDccChat() && bWantChats)) { - a->set(idx++,new KviKvsVariant((kvs_int_t)(dcc->id()))); + a->set(idx++, new KviKvsVariant((kvs_int_t)(dcc->id()))); } ++it; } @@ -2708,7 +2751,6 @@ static bool dcc_kvs_fnc_sessionList(KviKvsModuleFunctionCall * c) return true; } - /* @doc: dcc.getSSLCertInfo @type: @@ -2772,39 +2814,41 @@ static bool dcc_kvs_fnc_getSSLCertInfo(KviKvsModuleFunctionCall * c) QString szQuery; QString szType; QString szParam1; - bool bRemote=true; + bool bRemote = true; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("query",KVS_PT_STRING,0,szQuery) - KVSM_PARAMETER("type",KVS_PT_STRING,KVS_PF_OPTIONAL,szType) - KVSM_PARAMETER("dcc_id",KVS_PT_UINT,KVS_PF_OPTIONAL,uDccId) - KVSM_PARAMETER("param1",KVS_PT_STRING,KVS_PF_OPTIONAL,szParam1) + KVSM_PARAMETER("query", KVS_PT_STRING, 0, szQuery) + KVSM_PARAMETER("type", KVS_PT_STRING, KVS_PF_OPTIONAL, szType) + KVSM_PARAMETER("dcc_id", KVS_PT_UINT, KVS_PF_OPTIONAL, uDccId) + KVSM_PARAMETER("param1", KVS_PT_STRING, KVS_PF_OPTIONAL, szParam1) KVSM_PARAMETERS_END(c) #ifndef COMPILE_SSL_SUPPORT - c->warning(__tr2qs_ctx("This executable was built without SSL support","dcc")); + c->warning(__tr2qs_ctx("This executable was built without SSL support", "dcc")); return true; #else - if(szType.compare("local")==0) + if(szType.compare("local") == 0) + { + bRemote = false; + } + else { - bRemote=false; - } else { // already defaults to true, we only catch the error condition - if(szType.compare("remote")!=0) + if(szType.compare("remote") != 0) { - c->warning(__tr2qs_ctx("You specified a bad string for the parameter \"type\"","dcc")); + c->warning(__tr2qs_ctx("You specified a bad string for the parameter \"type\"", "dcc")); c->returnValue()->setString(""); return true; } } - DccDescriptor * dcc = dcc_kvs_find_dcc_descriptor(uDccId,c); + DccDescriptor * dcc = dcc_kvs_find_dcc_descriptor(uDccId, c); if(dcc) { if(!dcc->isSSL()) { - c->warning(__tr2qs_ctx("Unable to get SSL information: DCC session is not using SSL","dcc")); + c->warning(__tr2qs_ctx("Unable to get SSL information: DCC session is not using SSL", "dcc")); c->returnValue()->setString(""); return true; } @@ -2817,7 +2861,7 @@ static bool dcc_kvs_fnc_getSSLCertInfo(KviKvsModuleFunctionCall * c) if(!pSlaveThread) { - c->warning(__tr2qs_ctx("Unable to get SSL information: DCC session not initialized yet","dcc")); + c->warning(__tr2qs_ctx("Unable to get SSL information: DCC session not initialized yet", "dcc")); c->returnValue()->setString(""); return true; } @@ -2825,7 +2869,7 @@ static bool dcc_kvs_fnc_getSSLCertInfo(KviKvsModuleFunctionCall * c) KviSSL * pSSL = pSlaveThread->getSSL(); if(!pSSL) { - c->warning(__tr2qs_ctx("Unable to get SSL information: SSL non initialized yet in DCC session","dcc")); + c->warning(__tr2qs_ctx("Unable to get SSL information: SSL non initialized yet in DCC session", "dcc")); c->returnValue()->setString(""); return true; } @@ -2834,7 +2878,7 @@ static bool dcc_kvs_fnc_getSSLCertInfo(KviKvsModuleFunctionCall * c) if(!pCert) { - c->warning(__tr2qs_ctx("Unable to get SSL information: no peer certificate available","dcc")); + c->warning(__tr2qs_ctx("Unable to get SSL information: no peer certificate available", "dcc")); c->returnValue()->setString(""); return true; } @@ -2842,7 +2886,7 @@ static bool dcc_kvs_fnc_getSSLCertInfo(KviKvsModuleFunctionCall * c) if(KviSSLMaster::getSSLCertInfo(pCert, szQuery, szParam1, c->returnValue())) return true; - c->warning(__tr2qs_ctx("Unable to get SSL information: query not recognized","dcc")); + c->warning(__tr2qs_ctx("Unable to get SSL information: query not recognized", "dcc")); c->returnValue()->setString(""); return true; } @@ -2850,7 +2894,6 @@ static bool dcc_kvs_fnc_getSSLCertInfo(KviKvsModuleFunctionCall * c) #endif } - /* @doc: dcc @type: @@ -2909,51 +2952,49 @@ static bool dcc_kvs_fnc_getSSLCertInfo(KviKvsModuleFunctionCall * c) [fnc]$dcc.getSSLCertInfo[/fnc][br] */ - static bool dcc_module_init(KviModule * m) { g_pDccBroker = new DccBroker(); - KVSM_REGISTER_SIMPLE_COMMAND(m,"send",dcc_kvs_cmd_send); - KVSM_REGISTER_SIMPLE_COMMAND(m,"chat",dcc_kvs_cmd_chat); - KVSM_REGISTER_SIMPLE_COMMAND(m,"video",dcc_kvs_cmd_video); - KVSM_REGISTER_SIMPLE_COMMAND(m,"voice",dcc_kvs_cmd_voice); - KVSM_REGISTER_SIMPLE_COMMAND(m,"recv",dcc_kvs_cmd_recv); - KVSM_REGISTER_SIMPLE_COMMAND(m,"rsend",dcc_kvs_cmd_rsend); - KVSM_REGISTER_SIMPLE_COMMAND(m,"get",dcc_kvs_cmd_get); - KVSM_REGISTER_SIMPLE_COMMAND(m,"abort",dcc_kvs_cmd_abort); - KVSM_REGISTER_SIMPLE_COMMAND(m,"setBandwidthLimit",dcc_kvs_cmd_setBandwidthLimit); - + KVSM_REGISTER_SIMPLE_COMMAND(m, "send", dcc_kvs_cmd_send); + KVSM_REGISTER_SIMPLE_COMMAND(m, "chat", dcc_kvs_cmd_chat); + KVSM_REGISTER_SIMPLE_COMMAND(m, "video", dcc_kvs_cmd_video); + KVSM_REGISTER_SIMPLE_COMMAND(m, "voice", dcc_kvs_cmd_voice); + KVSM_REGISTER_SIMPLE_COMMAND(m, "recv", dcc_kvs_cmd_recv); + KVSM_REGISTER_SIMPLE_COMMAND(m, "rsend", dcc_kvs_cmd_rsend); + KVSM_REGISTER_SIMPLE_COMMAND(m, "get", dcc_kvs_cmd_get); + KVSM_REGISTER_SIMPLE_COMMAND(m, "abort", dcc_kvs_cmd_abort); + KVSM_REGISTER_SIMPLE_COMMAND(m, "setBandwidthLimit", dcc_kvs_cmd_setBandwidthLimit); // FIXME: file upload / download state ? - KVSM_REGISTER_FUNCTION(m,"transferStatus",dcc_kvs_fnc_transferStatus); - KVSM_REGISTER_FUNCTION(m,"protocol",dcc_kvs_fnc_protocol); - KVSM_REGISTER_FUNCTION(m,"connectionType",dcc_kvs_fnc_connectionType); - KVSM_REGISTER_FUNCTION(m,"isFileTransfer",dcc_kvs_fnc_isFileTransfer); - KVSM_REGISTER_FUNCTION(m,"isFileUpload",dcc_kvs_fnc_isFileUpload); - KVSM_REGISTER_FUNCTION(m,"isFileDownload",dcc_kvs_fnc_isFileDownload); - KVSM_REGISTER_FUNCTION(m,"localNick",dcc_kvs_fnc_localNick); - KVSM_REGISTER_FUNCTION(m,"localUser",dcc_kvs_fnc_localUser); - KVSM_REGISTER_FUNCTION(m,"localHost",dcc_kvs_fnc_localHost); - KVSM_REGISTER_FUNCTION(m,"localIp",dcc_kvs_fnc_localIp); - KVSM_REGISTER_FUNCTION(m,"localPort",dcc_kvs_fnc_localPort); - KVSM_REGISTER_FUNCTION(m,"localFileName",dcc_kvs_fnc_localFileName); - KVSM_REGISTER_FUNCTION(m,"localFileSize",dcc_kvs_fnc_localFileSize); - KVSM_REGISTER_FUNCTION(m,"remoteNick",dcc_kvs_fnc_remoteNick); - KVSM_REGISTER_FUNCTION(m,"remoteUser",dcc_kvs_fnc_remoteUser); - KVSM_REGISTER_FUNCTION(m,"remoteHost",dcc_kvs_fnc_remoteHost); - KVSM_REGISTER_FUNCTION(m,"remoteIp",dcc_kvs_fnc_remoteIp); - KVSM_REGISTER_FUNCTION(m,"remotePort",dcc_kvs_fnc_remotePort); - KVSM_REGISTER_FUNCTION(m,"remoteFileName",dcc_kvs_fnc_remoteFileName); - KVSM_REGISTER_FUNCTION(m,"remoteFileSize",dcc_kvs_fnc_remoteFileSize); - KVSM_REGISTER_FUNCTION(m,"averageSpeed",dcc_kvs_fnc_averageSpeed); - KVSM_REGISTER_FUNCTION(m,"currentSpeed",dcc_kvs_fnc_currentSpeed); - KVSM_REGISTER_FUNCTION(m,"transferredBytes",dcc_kvs_fnc_transferredBytes); - KVSM_REGISTER_FUNCTION(m,"ircContext",dcc_kvs_fnc_ircContext); - KVSM_REGISTER_FUNCTION(m,"session",dcc_kvs_fnc_session); - KVSM_REGISTER_FUNCTION(m,"sessionList",dcc_kvs_fnc_sessionList); - KVSM_REGISTER_FUNCTION(m,"getSSLCertInfo",dcc_kvs_fnc_getSSLCertInfo); + KVSM_REGISTER_FUNCTION(m, "transferStatus", dcc_kvs_fnc_transferStatus); + KVSM_REGISTER_FUNCTION(m, "protocol", dcc_kvs_fnc_protocol); + KVSM_REGISTER_FUNCTION(m, "connectionType", dcc_kvs_fnc_connectionType); + KVSM_REGISTER_FUNCTION(m, "isFileTransfer", dcc_kvs_fnc_isFileTransfer); + KVSM_REGISTER_FUNCTION(m, "isFileUpload", dcc_kvs_fnc_isFileUpload); + KVSM_REGISTER_FUNCTION(m, "isFileDownload", dcc_kvs_fnc_isFileDownload); + KVSM_REGISTER_FUNCTION(m, "localNick", dcc_kvs_fnc_localNick); + KVSM_REGISTER_FUNCTION(m, "localUser", dcc_kvs_fnc_localUser); + KVSM_REGISTER_FUNCTION(m, "localHost", dcc_kvs_fnc_localHost); + KVSM_REGISTER_FUNCTION(m, "localIp", dcc_kvs_fnc_localIp); + KVSM_REGISTER_FUNCTION(m, "localPort", dcc_kvs_fnc_localPort); + KVSM_REGISTER_FUNCTION(m, "localFileName", dcc_kvs_fnc_localFileName); + KVSM_REGISTER_FUNCTION(m, "localFileSize", dcc_kvs_fnc_localFileSize); + KVSM_REGISTER_FUNCTION(m, "remoteNick", dcc_kvs_fnc_remoteNick); + KVSM_REGISTER_FUNCTION(m, "remoteUser", dcc_kvs_fnc_remoteUser); + KVSM_REGISTER_FUNCTION(m, "remoteHost", dcc_kvs_fnc_remoteHost); + KVSM_REGISTER_FUNCTION(m, "remoteIp", dcc_kvs_fnc_remoteIp); + KVSM_REGISTER_FUNCTION(m, "remotePort", dcc_kvs_fnc_remotePort); + KVSM_REGISTER_FUNCTION(m, "remoteFileName", dcc_kvs_fnc_remoteFileName); + KVSM_REGISTER_FUNCTION(m, "remoteFileSize", dcc_kvs_fnc_remoteFileSize); + KVSM_REGISTER_FUNCTION(m, "averageSpeed", dcc_kvs_fnc_averageSpeed); + KVSM_REGISTER_FUNCTION(m, "currentSpeed", dcc_kvs_fnc_currentSpeed); + KVSM_REGISTER_FUNCTION(m, "transferredBytes", dcc_kvs_fnc_transferredBytes); + KVSM_REGISTER_FUNCTION(m, "ircContext", dcc_kvs_fnc_ircContext); + KVSM_REGISTER_FUNCTION(m, "session", dcc_kvs_fnc_session); + KVSM_REGISTER_FUNCTION(m, "sessionList", dcc_kvs_fnc_sessionList); + KVSM_REGISTER_FUNCTION(m, "getSSLCertInfo", dcc_kvs_fnc_getSSLCertInfo); return true; } @@ -2975,14 +3016,13 @@ static bool dcc_module_can_unload(KviModule *) } KVIRC_MODULE( - "DCC", - "4.0.0", - "Copyright (C) 2000-2004:\n" \ - "Szymon Stefanek (pragma at kvirc dot net)\n", - "DCC extension for KVIrc\n", - dcc_module_init, - dcc_module_can_unload, - 0, - dcc_module_cleanup, - "dcc" -) + "DCC", + "4.0.0", + "Copyright (C) 2000-2004:\n" + "Szymon Stefanek (pragma at kvirc dot net)\n", + "DCC extension for KVIrc\n", + dcc_module_init, + dcc_module_can_unload, + 0, + dcc_module_cleanup, + "dcc") diff --git a/src/modules/dcc/requests.cpp b/src/modules/dcc/requests.cpp index b86e23528..d27ea9b65 100644 --- a/src/modules/dcc/requests.cpp +++ b/src/modules/dcc/requests.cpp @@ -28,7 +28,7 @@ #include "DccBroker.h" #ifndef COMPILE_DISABLE_DCC_VIDEO - #include "DccVideoWindow.h" +#include "DccVideoWindow.h" #endif #include "DccVoiceWindow.h" @@ -58,8 +58,8 @@ #include #ifdef COMPILE_ON_WINDOWS - // Ugly Windoze compiler... - #include "DccDialog.h" +// Ugly Windoze compiler... +#include "DccDialog.h" #endif //#warning "KviOption_boolIgnoreDccChat and other types too" @@ -67,27 +67,26 @@ extern KVIRC_API KviSharedFilesManager * g_pSharedFilesManager; extern DccBroker * g_pDccBroker; -static void dcc_module_reply_errmsg(KviDccRequest * dcc,const QString& errText) +static void dcc_module_reply_errmsg(KviDccRequest * dcc, const QString & errText) { dcc->ctcpMsg->msg->console()->connection()->sendFmtData( - "NOTICE %s :%cERRMSG %s%c", - dcc->ctcpMsg->msg->console()->connection()->encodeText(dcc->ctcpMsg->pSource->nick()).data(),0x01, - dcc->ctcpMsg->msg->console()->connection()->encodeText(errText).data() - ,0x01); + "NOTICE %s :%cERRMSG %s%c", + dcc->ctcpMsg->msg->console()->connection()->encodeText(dcc->ctcpMsg->pSource->nick()).data(), 0x01, + dcc->ctcpMsg->msg->console()->connection()->encodeText(errText).data(), 0x01); } -static void dcc_module_request_error(KviDccRequest * dcc,const QString& errText) +static void dcc_module_request_error(KviDccRequest * dcc, const QString & errText) { dcc->ctcpMsg->msg->console()->output(KVI_OUT_DCCERROR, - __tr2qs_ctx("Unable to process the above request: %Q, %Q","dcc"), - &errText, - KVI_OPTION_BOOL(KviOption_boolNotifyFailedDccHandshakes) ? &(__tr2qs_ctx("Ignoring and notifying failure","dcc")) : &(__tr2qs_ctx("Ignoring","dcc"))); + __tr2qs_ctx("Unable to process the above request: %Q, %Q", "dcc"), + &errText, + KVI_OPTION_BOOL(KviOption_boolNotifyFailedDccHandshakes) ? &(__tr2qs_ctx("Ignoring and notifying failure", "dcc")) : &(__tr2qs_ctx("Ignoring", "dcc"))); if(KVI_OPTION_BOOL(KviOption_boolNotifyFailedDccHandshakes)) { QString szError = QString("Sorry, your DCC %1 request can't be satisfied: %2").arg(dcc->szType.ptr(), errText); //since szError contains a user-suppplied string, we simplify it to avoid any kind of injection (bug #858) - dcc_module_reply_errmsg(dcc,szError.simplified()); + dcc_module_reply_errmsg(dcc, szError.simplified()); } } @@ -98,8 +97,8 @@ static bool dcc_module_check_concurrent_transfers_limit(KviDccRequest * dcc) unsigned int uTransfers = DccFileTransfer::runningTransfersCount(); if(uTransfers >= KVI_OPTION_UINT(KviOption_uintMaxDccSendTransfers)) { - QString szError = QString(__tr2qs_ctx("Concurrent transfer limit reached (%1 of %2 transfers running)","dcc")).arg(uTransfers).arg(KVI_OPTION_UINT(KviOption_uintMaxDccSendTransfers)); - dcc_module_request_error(dcc,szError); + QString szError = QString(__tr2qs_ctx("Concurrent transfer limit reached (%1 of %2 transfers running)", "dcc")).arg(uTransfers).arg(KVI_OPTION_UINT(KviOption_uintMaxDccSendTransfers)); + dcc_module_request_error(dcc, szError); return false; } } @@ -113,51 +112,55 @@ static bool dcc_module_check_limits(KviDccRequest * dcc) unsigned int uWindows = g_pDccBroker->dccWindowsCount(); if(uWindows >= KVI_OPTION_UINT(KviOption_uintMaxDccSlots)) { - QString szError = QString(__tr2qs_ctx("Slot limit reached (%1 slots of %2)","dcc")).arg(uWindows).arg(KVI_OPTION_UINT(KviOption_uintMaxDccSlots)); - dcc_module_request_error(dcc,szError); + QString szError = QString(__tr2qs_ctx("Slot limit reached (%1 slots of %2)", "dcc")).arg(uWindows).arg(KVI_OPTION_UINT(KviOption_uintMaxDccSlots)); + dcc_module_request_error(dcc, szError); return false; } } if(g_pDccBroker->dccBoxCount() >= 32) { // there are too many pending dcc requests: the user isn't watching.... - dcc_module_request_error(dcc,__tr2qs_ctx("Too many pending connections","dcc")); + dcc_module_request_error(dcc, __tr2qs_ctx("Too many pending connections", "dcc")); return false; } return true; } -static void dcc_fill_local_nick_user_host(DccDescriptor * d,KviDccRequest * dcc) +static void dcc_fill_local_nick_user_host(DccDescriptor * d, KviDccRequest * dcc) { if(dcc->pConsole->connection()) { - d->szLocalNick = dcc->pConsole->connection()->userInfo()->nickName(); - d->szLocalUser = dcc->pConsole->connection()->userInfo()->userName(); - d->szLocalHost = dcc->pConsole->connection()->userInfo()->hostName(); - } else { - d->szLocalNick = __tr_ctx("unknown","dcc"); - d->szLocalUser = __tr2qs_ctx("unknown","dcc"); - d->szLocalHost = __tr2qs_ctx("unknown","dcc"); + d->szLocalNick = dcc->pConsole->connection()->userInfo()->nickName(); + d->szLocalUser = dcc->pConsole->connection()->userInfo()->userName(); + d->szLocalHost = dcc->pConsole->connection()->userInfo()->hostName(); + } + else + { + d->szLocalNick = __tr_ctx("unknown", "dcc"); + d->szLocalUser = __tr2qs_ctx("unknown", "dcc"); + d->szLocalHost = __tr2qs_ctx("unknown", "dcc"); } } -static void dcc_module_set_dcc_type(DccDescriptor * d,const char * szBaseType) +static void dcc_module_set_dcc_type(DccDescriptor * d, const char * szBaseType) { d->szType = szBaseType; #ifdef COMPILE_SSL_SUPPORT - if(d->bIsSSL)d->szType.prepend('S'); + if(d->bIsSSL) + d->szType.prepend('S'); #endif - if(d->bIsTdcc)d->szType.prepend('T'); + if(d->bIsTdcc) + d->szType.prepend('T'); } -static bool dcc_module_normalize_target_data(KviDccRequest * dcc,KviCString &ipaddr,KviCString &port) +static bool dcc_module_normalize_target_data(KviDccRequest * dcc, KviCString & ipaddr, KviCString & port) { if(!port.isUnsignedNum()) { if(!dcc->ctcpMsg->msg->haltOutput()) { - QString szError = QString(__tr2qs_ctx("Invalid port number %1","dcc")).arg(port.ptr()); - dcc_module_request_error(dcc,szError); + QString szError = QString(__tr2qs_ctx("Invalid port number %1", "dcc")).arg(port.ptr()); + dcc_module_request_error(dcc, szError); } return false; } @@ -168,23 +171,25 @@ static bool dcc_module_normalize_target_data(KviDccRequest * dcc,KviCString &ipa { addr.s_addr = htonl((unsigned long)ipaddr.toULong()); QString tmp; - if(!KviNetUtils::binaryIpToStringIp(addr,tmp)) + if(!KviNetUtils::binaryIpToStringIp(addr, tmp)) { if(!dcc->ctcpMsg->msg->haltOutput()) { - QString szError = QString(__tr2qs_ctx("Invalid IP address in old format %1","dcc")).arg(ipaddr.ptr()); - dcc_module_request_error(dcc,szError); + QString szError = QString(__tr2qs_ctx("Invalid IP address in old format %1", "dcc")).arg(ipaddr.ptr()); + dcc_module_request_error(dcc, szError); } return false; } ipaddr = tmp; - } else { + } + else + { //FIXME: KviCString -> QString - if(!KviNetUtils::stringIpToBinaryIp(QString(ipaddr),&addr)) + if(!KviNetUtils::stringIpToBinaryIp(QString(ipaddr), &addr)) { #ifdef COMPILE_IPV6_SUPPORT struct in6_addr addr6; - if(KviNetUtils::stringIpToBinaryIp_V6(QString(ipaddr),&addr6)) + if(KviNetUtils::stringIpToBinaryIp_V6(QString(ipaddr), &addr6)) { dcc->bIPv6 = true; return true; // IPV6 address. @@ -192,8 +197,8 @@ static bool dcc_module_normalize_target_data(KviDccRequest * dcc,KviCString &ipa #endif if(!dcc->ctcpMsg->msg->haltOutput()) { - QString szError = QString(__tr2qs_ctx("Invalid IP address %1","dcc")).arg(ipaddr.ptr()); - dcc_module_request_error(dcc,szError); + QString szError = QString(__tr2qs_ctx("Invalid IP address %1", "dcc")).arg(ipaddr.ptr()); + dcc_module_request_error(dcc, szError); } return false; } @@ -201,12 +206,11 @@ static bool dcc_module_normalize_target_data(KviDccRequest * dcc,KviCString &ipa return true; } - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // CHAT //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -static void dccModuleParseDccChat(KviDccRequest *dcc) +static void dccModuleParseDccChat(KviDccRequest * dcc) { // // We have received a DCC CHAT request in the following form: @@ -249,17 +253,19 @@ static void dccModuleParseDccChat(KviDccRequest *dcc) // // First of all we check the dcc slot limits - if(!dcc_module_check_limits(dcc))return; + if(!dcc_module_check_limits(dcc)) + return; // Then we check the target host data - if(!dcc_module_normalize_target_data(dcc,dcc->szParam2,dcc->szParam3))return; + if(!dcc_module_normalize_target_data(dcc, dcc->szParam2, dcc->szParam3)) + return; - if(!kvi_strEqualCI(dcc->szParam1.ptr(),"chat")) + if(!kvi_strEqualCI(dcc->szParam1.ptr(), "chat")) { if(!dcc->ctcpMsg->msg->haltOutput()) { dcc->ctcpMsg->msg->console()->output(KVI_OUT_DCCMSG, - __tr2qs_ctx("The above request is broken: the second parameter is '%s' and should be 'chat', trying to continue","dcc"),dcc->szParam1.ptr()); + __tr2qs_ctx("The above request is broken: the second parameter is '%s' and should be 'chat', trying to continue", "dcc"), dcc->szParam1.ptr()); } } @@ -267,26 +273,25 @@ static void dccModuleParseDccChat(KviDccRequest *dcc) szExtensions.cutRight(4); // cut off CHAT #ifdef COMPILE_SSL_SUPPORT - bool bSSLExtension = szExtensions.contains('S',false); -#else //!COMPILE_SSL_SUPPORT - if(szExtensions.contains('S',false)) + bool bSSLExtension = szExtensions.contains('S', false); +#else //!COMPILE_SSL_SUPPORT + if(szExtensions.contains('S', false)) { - dcc_module_request_error(dcc,__tr2qs_ctx("This executable has been compiled without SSL support, the SSL extension to DCC CHAT is not available","dcc")); + dcc_module_request_error(dcc, __tr2qs_ctx("This executable has been compiled without SSL support, the SSL extension to DCC CHAT is not available", "dcc")); return; } #endif //!COMPILE_SSL_SUPPORT DccDescriptor * d = new DccDescriptor(dcc->pConsole); - d->szNick = dcc->ctcpMsg->pSource->nick(); - d->szUser = dcc->ctcpMsg->pSource->user(); - d->szHost = dcc->ctcpMsg->pSource->host(); - - dcc_fill_local_nick_user_host(d,dcc); + d->szNick = dcc->ctcpMsg->pSource->nick(); + d->szUser = dcc->ctcpMsg->pSource->user(); + d->szHost = dcc->ctcpMsg->pSource->host(); - d->szIp = dcc->szParam2.ptr(); - d->szPort = dcc->szParam3.ptr(); + dcc_fill_local_nick_user_host(d, dcc); + d->szIp = dcc->szParam2.ptr(); + d->szPort = dcc->szParam3.ptr(); if(dcc->szParam4.hasData()) { @@ -297,16 +302,21 @@ static void dccModuleParseDccChat(KviDccRequest *dcc) if(KVI_OPTION_BOOL(KviOption_boolDccSendFakeAddressByDefault)) { d->szFakeIp = KVI_OPTION_STRING(KviOption_stringDefaultDccFakeAddress); - if(d->szFakeIp.isEmpty())KVI_OPTION_BOOL(KviOption_boolDccSendFakeAddressByDefault) = false; + if(d->szFakeIp.isEmpty()) + KVI_OPTION_BOOL(KviOption_boolDccSendFakeAddressByDefault) = false; } d->setZeroPortRequestTag(dcc->szParam4.ptr()); QString tmp; - if(!dcc_kvs_get_listen_ip_address(0,d->console(),tmp))d->szListenIp = "0.0.0.0"; - else d->szListenIp=tmp; + if(!dcc_kvs_get_listen_ip_address(0, d->console(), tmp)) + d->szListenIp = "0.0.0.0"; + else + d->szListenIp = tmp; d->szListenPort = "0"; // any port is OK - d->bAutoAccept = KVI_OPTION_BOOL(KviOption_boolAutoAcceptDccChat); - d->bActive = false; // we must listen then... - } else { + d->bAutoAccept = KVI_OPTION_BOOL(KviOption_boolAutoAcceptDccChat); + d->bActive = false; // we must listen then... + } + else + { // zero port acknowledge // check if this is a tag that we have sent out QString szTag = QString(dcc->szParam4.ptr()); @@ -322,43 +332,45 @@ static void dccModuleParseDccChat(KviDccRequest *dcc) // request, but since we don't encourage bugs, we don't do it :D // Mail me at pragma at kvirc dot net if you really think it's necessary. dcc->ctcpMsg->msg->console()->output(KVI_OUT_DCCMSG, - __tr2qs_ctx("The above request is broken: it looks like a zero port tag acknowledge but I have either never seen this tag or it was sent more than 120 seconds ago","dcc")); - dcc_module_request_error(dcc,__tr2qs_ctx("It seems that I haven't requested this DCC chat","dcc")); + __tr2qs_ctx("The above request is broken: it looks like a zero port tag acknowledge but I have either never seen this tag or it was sent more than 120 seconds ago", "dcc")); + dcc_module_request_error(dcc, __tr2qs_ctx("It seems that I haven't requested this DCC chat", "dcc")); delete d; return; - } else { + } + else + { g_pDccBroker->removeZeroPortTag(szTag); } - d->bAutoAccept = true; // auto-accept it (we have sent it out) - d->bActive = true; + d->bAutoAccept = true; // auto-accept it (we have sent it out) + d->bActive = true; } - } else { - d->bAutoAccept = KVI_OPTION_BOOL(KviOption_boolAutoAcceptDccChat); - d->bActive = true; // we have to connect (standard active chat) + } + else + { + d->bAutoAccept = KVI_OPTION_BOOL(KviOption_boolAutoAcceptDccChat); + d->bActive = true; // we have to connect (standard active chat) } #ifdef COMPILE_SSL_SUPPORT - d->bIsSSL = bSSLExtension; + d->bIsSSL = bSSLExtension; #endif - dcc_module_set_dcc_type(d,"CHAT"); + dcc_module_set_dcc_type(d, "CHAT"); d->triggerCreationEvent(); g_pDccBroker->handleChatRequest(d); } - - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // SEND //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// static void dccModuleParseDccRecv(KviDccRequest * dcc); -static void dccModuleParseDccSend(KviDccRequest *dcc) +static void dccModuleParseDccSend(KviDccRequest * dcc) { -//#warning "Ignore files depending on file type ? (MediaType ?)" + //#warning "Ignore files depending on file type ? (MediaType ?)" // // We have received a DCC SEND request in the following form // @@ -402,7 +414,7 @@ static void dccModuleParseDccSend(KviDccRequest *dcc) // we have sent out a zero port request and the remote party acked it // - if((!kvi_strEqualCS(dcc->szParam3.ptr(),"0")) && dcc->szParam5.hasData()) + if((!kvi_strEqualCS(dcc->szParam3.ptr(), "0")) && dcc->szParam5.hasData()) { // DCC SEND // zero port acknowledge: treat as a RECV that should look like @@ -414,9 +426,11 @@ static void dccModuleParseDccSend(KviDccRequest *dcc) if(t) { // FIXME: #warning "%u will not support 64-bit numbers and won't work as intended here" - dcc->szParam4.sprintf("%u",t->m_uResumePosition); + dcc->szParam4.sprintf("%u", t->m_uResumePosition); g_pDccBroker->removeZeroPortTag(dcc->szParam5.ptr()); - } else { + } + else + { // this should never happen since we always add // a zero port tag for out outgoing requests // but well... maybe the user did something behind our back... @@ -432,21 +446,24 @@ static void dccModuleParseDccSend(KviDccRequest *dcc) } // First of all we check the transfer limits - dcc->szParam1=dcc->pConsole->decodeText(dcc->szParam1); - if(!dcc_module_check_limits(dcc))return; - if(!dcc_module_check_concurrent_transfers_limit(dcc))return; + dcc->szParam1 = dcc->pConsole->decodeText(dcc->szParam1); + if(!dcc_module_check_limits(dcc)) + return; + if(!dcc_module_check_concurrent_transfers_limit(dcc)) + return; // Then we ensure that the data that the remote end has sent are valid - if(!dcc_module_normalize_target_data(dcc,dcc->szParam2,dcc->szParam3))return; + if(!dcc_module_normalize_target_data(dcc, dcc->szParam2, dcc->szParam3)) + return; if(!(dcc->szParam4.isUnsignedNum())) { if(!dcc->ctcpMsg->msg->haltOutput()) { dcc->ctcpMsg->msg->console()->output(KVI_OUT_DCCMSG, - __tr2qs_ctx("The above request is broken: the fourth parameter should be the file size but doesn't appear to be an unsigned number; trying to continue","dcc"),dcc->szParam4.ptr()); + __tr2qs_ctx("The above request is broken: the fourth parameter should be the file size but doesn't appear to be an unsigned number; trying to continue", "dcc"), dcc->szParam4.ptr()); } - dcc->szParam4 = __tr2qs_ctx("","dcc"); + dcc->szParam4 = __tr2qs_ctx("", "dcc"); } if(dcc->szParam1.contains('/')) @@ -454,7 +471,7 @@ static void dccModuleParseDccSend(KviDccRequest *dcc) if(!dcc->ctcpMsg->msg->haltOutput()) { dcc->ctcpMsg->msg->console()->output(KVI_OUT_DCCMSG, - __tr2qs_ctx("The above request is broken: the filename contains path components, stripping the leading path and trying to continue","dcc"),dcc->szParam1.ptr()); + __tr2qs_ctx("The above request is broken: the filename contains path components, stripping the leading path and trying to continue", "dcc"), dcc->szParam1.ptr()); } dcc->szParam1.cutToLast('/'); } @@ -464,7 +481,7 @@ static void dccModuleParseDccSend(KviDccRequest *dcc) if(!dcc->ctcpMsg->msg->haltOutput()) { dcc->ctcpMsg->msg->console()->output(KVI_OUT_DCCMSG, - __tr2qs_ctx("The above request is broken: the filename contains path components, stripping the leading path and trying to continue","dcc"),dcc->szParam1.ptr()); + __tr2qs_ctx("The above request is broken: the filename contains path components, stripping the leading path and trying to continue", "dcc"), dcc->szParam1.ptr()); } dcc->szParam1.cutToLast("%2F"); } @@ -472,81 +489,85 @@ static void dccModuleParseDccSend(KviDccRequest *dcc) KviCString szExtensions = dcc->szType; szExtensions.cutRight(4); // cut off SEND - bool bTurboExtension = szExtensions.contains('T',false); + bool bTurboExtension = szExtensions.contains('T', false); #ifdef COMPILE_SSL_SUPPORT - bool bSSLExtension = szExtensions.contains('S',false); -#else //!COMPILE_SSL_SUPPORT - if(szExtensions.contains('S',false)) + bool bSSLExtension = szExtensions.contains('S', false); +#else //!COMPILE_SSL_SUPPORT + if(szExtensions.contains('S', false)) { - dcc_module_request_error(dcc,__tr2qs_ctx("This executable has been compiled without SSL support, the SSL extension to DCC SEND is not available","dcc")); + dcc_module_request_error(dcc, __tr2qs_ctx("This executable has been compiled without SSL support, the SSL extension to DCC SEND is not available", "dcc")); return; } #endif //!COMPILE_SSL_SUPPORT DccDescriptor * d = new DccDescriptor(dcc->pConsole); - d->szNick = dcc->ctcpMsg->pSource->nick(); - d->szUser = dcc->ctcpMsg->pSource->user(); - d->szHost = dcc->ctcpMsg->pSource->host(); - dcc_fill_local_nick_user_host(d,dcc); + d->szNick = dcc->ctcpMsg->pSource->nick(); + d->szUser = dcc->ctcpMsg->pSource->user(); + d->szHost = dcc->ctcpMsg->pSource->host(); + dcc_fill_local_nick_user_host(d, dcc); - d->szIp = dcc->szParam2.ptr(); - d->szPort = dcc->szParam3.ptr(); - d->szFileName = dcc->szParam1.ptr(); - d->szFileSize = dcc->szParam4.ptr(); + d->szIp = dcc->szParam2.ptr(); + d->szPort = dcc->szParam3.ptr(); + d->szFileName = dcc->szParam1.ptr(); + d->szFileSize = dcc->szParam4.ptr(); - if(d->szPort=="0" && dcc->szParam5.hasData()) + if(d->szPort == "0" && dcc->szParam5.hasData()) { if(KVI_OPTION_BOOL(KviOption_boolDccSendFakeAddressByDefault)) { d->szFakeIp = KVI_OPTION_STRING(KviOption_stringDefaultDccFakeAddress); - if(d->szFakeIp.isEmpty())KVI_OPTION_BOOL(KviOption_boolDccSendFakeAddressByDefault) = false; + if(d->szFakeIp.isEmpty()) + KVI_OPTION_BOOL(KviOption_boolDccSendFakeAddressByDefault) = false; } d->setZeroPortRequestTag(dcc->szParam5.ptr()); QString tmp; - if(!dcc_kvs_get_listen_ip_address(0,d->console(),tmp))d->szListenIp = "0.0.0.0"; - else d->szListenIp=QString(tmp); + if(!dcc_kvs_get_listen_ip_address(0, d->console(), tmp)) + d->szListenIp = "0.0.0.0"; + else + d->szListenIp = QString(tmp); d->szListenPort = "0"; // any port is OK d->bSendRequest = true; d->szLocalFileSize = d->szFileSize; } - d->bActive = !d->isZeroPortRequest(); // we have to connect unless it is a zero port request + d->bActive = !d->isZeroPortRequest(); // we have to connect unless it is a zero port request - d->bResume = false; - d->bRecvFile = true; - d->bIsTdcc = bTurboExtension; - d->bNoAcks = d->bIsTdcc; + d->bResume = false; + d->bRecvFile = true; + d->bIsTdcc = bTurboExtension; + d->bNoAcks = d->bIsTdcc; #ifdef COMPILE_SSL_SUPPORT - d->bIsSSL = bSSLExtension; + d->bIsSSL = bSSLExtension; #endif d->bOverrideMinimize = false; - d->bAutoAccept = KVI_OPTION_BOOL(KviOption_boolAutoAcceptDccSend); + d->bAutoAccept = KVI_OPTION_BOOL(KviOption_boolAutoAcceptDccSend); - d->bIsIncomingAvatar = g_pApp->findPendingAvatarChange(dcc->pConsole,d->szNick,d->szFileName); - dcc_module_set_dcc_type(d,"RECV"); - if(KVI_OPTION_BOOL(KviOption_boolAutoAcceptIncomingAvatars))d->bAutoAccept = d->bAutoAccept || d->bIsIncomingAvatar; + d->bIsIncomingAvatar = g_pApp->findPendingAvatarChange(dcc->pConsole, d->szNick, d->szFileName); + dcc_module_set_dcc_type(d, "RECV"); + if(KVI_OPTION_BOOL(KviOption_boolAutoAcceptIncomingAvatars)) + d->bAutoAccept = d->bAutoAccept || d->bIsIncomingAvatar; d->triggerCreationEvent(); g_pDccBroker->recvFileManage(d); } -static void dccModuleParseDccAccept(KviDccRequest *dcc) +static void dccModuleParseDccAccept(KviDccRequest * dcc) { // this is usually DCC ACCEPT // but may be also // DCC ACCEPT 0 - if(!g_pDccBroker->handleResumeAccepted(dcc->szParam1.ptr(),dcc->szParam2.ptr(),dcc->szParam4.ptr())) + if(!g_pDccBroker->handleResumeAccepted(dcc->szParam1.ptr(), dcc->szParam2.ptr(), dcc->szParam4.ptr())) { //#warning "IF KviOption_boolReplyCtcpErrmsgOnInvalidAccept..." if(!dcc->ctcpMsg->msg->haltOutput()) { - QString szError = QString(__tr2qs_ctx("Can't proceed with DCC RECV: transfer not initiated for file %1 on port %2","dcc")).arg(dcc->szParam1.ptr()).arg(dcc->szParam2.ptr()); - dcc_module_request_error(dcc,szError); + QString szError = QString(__tr2qs_ctx("Can't proceed with DCC RECV: transfer not initiated for file %1 on port %2", "dcc")).arg(dcc->szParam1.ptr()).arg(dcc->szParam2.ptr()); + dcc_module_request_error(dcc, szError); } } } -static void dccModuleParseDccResume(KviDccRequest *dcc) +static void dccModuleParseDccResume(KviDccRequest * dcc) { // This is usually RESUME @@ -565,24 +586,23 @@ static void dccModuleParseDccResume(KviDccRequest *dcc) { if(!dcc->ctcpMsg->msg->haltOutput()) { - QString szError = QString(__tr2qs_ctx("Invalid resume position argument '%1'","dcc")).arg(dcc->szParam3.ptr()); - dcc_module_request_error(dcc,szError); + QString szError = QString(__tr2qs_ctx("Invalid resume position argument '%1'", "dcc")).arg(dcc->szParam3.ptr()); + dcc_module_request_error(dcc, szError); } return; } - if(!g_pDccBroker->handleResumeRequest(dcc,dcc->szParam1.ptr(),dcc->szParam2.ptr(),filePos,dcc->szParam4.ptr())) + if(!g_pDccBroker->handleResumeRequest(dcc, dcc->szParam1.ptr(), dcc->szParam2.ptr(), filePos, dcc->szParam4.ptr())) { //#warning "IF KviOption_boolReplyCtcpErrmsgOnInvalidResume..." if(!dcc->ctcpMsg->msg->haltOutput()) { - QString szError = QString(__tr2qs_ctx("Can't proceed with DCC SEND: transfer not initiated for file %1 on port %2, or invalid resume size","dcc")).arg(dcc->szParam1.ptr()).arg(dcc->szParam2.ptr()); - dcc_module_request_error(dcc,szError); + QString szError = QString(__tr2qs_ctx("Can't proceed with DCC SEND: transfer not initiated for file %1 on port %2, or invalid resume size", "dcc")).arg(dcc->szParam1.ptr()).arg(dcc->szParam2.ptr()); + dcc_module_request_error(dcc, szError); } } } - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // RECV //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -590,17 +610,20 @@ static void dccModuleParseDccResume(KviDccRequest *dcc) static void dccModuleParseDccRecv(KviDccRequest * dcc) { // DCC [TS]RECV - if(!dcc_module_check_limits(dcc))return; - if(!dcc_module_check_concurrent_transfers_limit(dcc))return; + if(!dcc_module_check_limits(dcc)) + return; + if(!dcc_module_check_concurrent_transfers_limit(dcc)) + return; - if(!dcc_module_normalize_target_data(dcc,dcc->szParam2,dcc->szParam3))return; + if(!dcc_module_normalize_target_data(dcc, dcc->szParam2, dcc->szParam3)) + return; if(!(dcc->szParam4.isUnsignedNum())) { if(!dcc->ctcpMsg->msg->haltOutput()) { dcc->ctcpMsg->msg->console()->outputNoFmt(KVI_OUT_DCCMSG, - __tr2qs_ctx("The above request has resume file size missing, assuming a resume file size of 0","dcc")); + __tr2qs_ctx("The above request has resume file size missing, assuming a resume file size of 0", "dcc")); } dcc->szParam4 = "0"; } @@ -610,7 +633,7 @@ static void dccModuleParseDccRecv(KviDccRequest * dcc) if(!dcc->ctcpMsg->msg->haltOutput()) { dcc->ctcpMsg->msg->console()->output(KVI_OUT_DCCMSG, - __tr2qs_ctx("The above request is broken: the filename contains path components, stripping the leading path and trying to continue","dcc"),dcc->szParam1.ptr()); + __tr2qs_ctx("The above request is broken: the filename contains path components, stripping the leading path and trying to continue", "dcc"), dcc->szParam1.ptr()); } dcc->szParam1.cutToLast('/'); } @@ -618,19 +641,19 @@ static void dccModuleParseDccRecv(KviDccRequest * dcc) KviCString szExtensions = dcc->szType; szExtensions.cutRight(4); // cut off RECV - bool bTurboExtension = szExtensions.contains('T',false); + bool bTurboExtension = szExtensions.contains('T', false); #ifdef COMPILE_SSL_SUPPORT - bool bSSLExtension = szExtensions.contains('S',false); -#else //!COMPILE_SSL_SUPPORT - if(szExtensions.contains('S',false)) + bool bSSLExtension = szExtensions.contains('S', false); +#else //!COMPILE_SSL_SUPPORT + if(szExtensions.contains('S', false)) { - dcc_module_request_error(dcc,__tr2qs_ctx("This executable has been compiled without SSL support, the SSL extension to DCC RECV is not available","dcc")); + dcc_module_request_error(dcc, __tr2qs_ctx("This executable has been compiled without SSL support, the SSL extension to DCC RECV is not available", "dcc")); return; } #endif //!COMPILE_SSL_SUPPORT // If we have a file offer for this...do it automatically - KviSharedFile * o = g_pSharedFilesManager->lookupSharedFile(dcc->szParam1.ptr(),dcc->ctcpMsg->pSource,0); + KviSharedFile * o = g_pSharedFilesManager->lookupSharedFile(dcc->szParam1.ptr(), dcc->ctcpMsg->pSource, 0); if(o) { @@ -638,80 +661,81 @@ static void dccModuleParseDccRecv(KviDccRequest * dcc) if(uResumeSize >= o->fileSize()) { // senseless request - QString szError = QString(__tr2qs_ctx("Invalid RECV request: position %1 is larger than file size","dcc")).arg(uResumeSize); - dcc_module_request_error(dcc,szError); + QString szError = QString(__tr2qs_ctx("Invalid RECV request: position %1 is larger than file size", "dcc")).arg(uResumeSize); + dcc_module_request_error(dcc, szError); return; } // ok...we have requested this send -// #warning "Maybe remove this file offer now ?" + // #warning "Maybe remove this file offer now ?" DccDescriptor * d = new DccDescriptor(dcc->pConsole); - d->szNick = dcc->ctcpMsg->pSource->nick(); - d->szUser = dcc->ctcpMsg->pSource->user(); - d->szHost = dcc->ctcpMsg->pSource->host(); + d->szNick = dcc->ctcpMsg->pSource->nick(); + d->szUser = dcc->ctcpMsg->pSource->user(); + d->szHost = dcc->ctcpMsg->pSource->host(); - d->szFileName = dcc->szParam1.ptr(); - d->szFileSize = dcc->szParam4.ptr(); + d->szFileName = dcc->szParam1.ptr(); + d->szFileSize = dcc->szParam4.ptr(); //d->bResume = false; // This is actually useless - d->szLocalFileName = o->absFilePath(); + d->szLocalFileName = o->absFilePath(); d->szLocalFileSize.setNum(o->fileSize()); // Should we look it up again ? + d->bRecvFile = false; + d->bNoAcks = bTurboExtension; - d->bRecvFile = false; - d->bNoAcks = bTurboExtension; - - d->bAutoAccept = true; + d->bAutoAccept = true; d->bIsIncomingAvatar = false; - d->bIsTdcc = bTurboExtension; + d->bIsTdcc = bTurboExtension; #ifdef COMPILE_SSL_SUPPORT - d->bIsSSL = bSSLExtension; + d->bIsSSL = bSSLExtension; #endif d->bOverrideMinimize = false; // We know everything - dcc_fill_local_nick_user_host(d,dcc); - + dcc_fill_local_nick_user_host(d, dcc); - d->bDoTimeout = true; + d->bDoTimeout = true; - d->szIp = dcc->szParam2.ptr(); - d->szPort = dcc->szParam3.ptr(); + d->szIp = dcc->szParam2.ptr(); + d->szPort = dcc->szParam3.ptr(); - d->bActive = true; - dcc_module_set_dcc_type(d,"SEND"); + d->bActive = true; + dcc_module_set_dcc_type(d, "SEND"); d->triggerCreationEvent(); - g_pDccBroker->sendFileExecute(0,d); + g_pDccBroker->sendFileExecute(0, d); return; - - } else { + } + else + { dcc->ctcpMsg->msg->console()->output(KVI_OUT_DCCMSG, - __tr2qs_ctx("%Q [%Q@%Q] is ready to receive the file \"%s\"","dcc"), - &(dcc->ctcpMsg->pSource->nick()), - &(dcc->ctcpMsg->pSource->user()), - &(dcc->ctcpMsg->pSource->host()), - dcc->szParam1.ptr()); + __tr2qs_ctx("%Q [%Q@%Q] is ready to receive the file \"%s\"", "dcc"), + &(dcc->ctcpMsg->pSource->nick()), + &(dcc->ctcpMsg->pSource->user()), + &(dcc->ctcpMsg->pSource->host()), + dcc->szParam1.ptr()); dcc->ctcpMsg->msg->console()->output(KVI_OUT_DCCMSG, - __tr2qs_ctx("The remote client is listening on interface %s and port %s","dcc"),dcc->szParam2.ptr(),dcc->szParam3.ptr()); + __tr2qs_ctx("The remote client is listening on interface %s and port %s", "dcc"), dcc->szParam2.ptr(), dcc->szParam3.ptr()); KviCString szSwitches = "-c"; - if(bTurboExtension)szSwitches.prepend("-t "); + if(bTurboExtension) + szSwitches.prepend("-t "); #ifdef COMPILE_SSL_SUPPORT - if(bSSLExtension)szSwitches.prepend("-s "); + if(bSSLExtension) + szSwitches.prepend("-s "); #endif dcc->ctcpMsg->msg->console()->output(KVI_OUT_DCCMSG, - __tr2qs_ctx("Use %c\r![!dbl]dcc.send %s -i=%s -p=%s %Q\r/dcc.send %s -i=%s -p=%s %Q\r%c to send the file (or double-click on the socket)","dcc"), - KviControlCodes::Bold, - szSwitches.ptr(), - dcc->szParam2.ptr(),dcc->szParam3.ptr(),&(dcc->ctcpMsg->pSource->nick()), - szSwitches.ptr(), - dcc->szParam2.ptr(),dcc->szParam3.ptr(),&(dcc->ctcpMsg->pSource->nick()), - KviControlCodes::Bold); + __tr2qs_ctx("Use %c\r![!dbl]dcc.send %s -i=%s -p=%s %Q\r/dcc.send %s -i=%s -p=%s %Q\r%c to send the file (or double-click on the socket)", "dcc"), + KviControlCodes::Bold, + szSwitches.ptr(), + dcc->szParam2.ptr(), dcc->szParam3.ptr(), &(dcc->ctcpMsg->pSource->nick()), + szSwitches.ptr(), + dcc->szParam2.ptr(), dcc->szParam3.ptr(), &(dcc->ctcpMsg->pSource->nick()), + KviControlCodes::Bold); } } @@ -719,27 +743,29 @@ static void dccModuleParseDccRecv(KviDccRequest * dcc) // RSEND //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -static void dccModuleParseDccRSend(KviDccRequest *dcc) +static void dccModuleParseDccRSend(KviDccRequest * dcc) { // DCC RSEND -//#warning "Ignore files depending on file type ? (MediaType ?)" + //#warning "Ignore files depending on file type ? (MediaType ?)" // // We have received a DCC RSEND request in the following form // // DCC [ST]RSEND // dcc->szParam1 = dcc->pConsole->decodeText(dcc->szParam1); - if(!dcc_module_check_limits(dcc))return; - if(!dcc_module_check_concurrent_transfers_limit(dcc))return; + if(!dcc_module_check_limits(dcc)) + return; + if(!dcc_module_check_concurrent_transfers_limit(dcc)) + return; if(!(dcc->szParam2.isUnsignedNum())) { if(!dcc->ctcpMsg->msg->haltOutput()) { dcc->ctcpMsg->msg->console()->output(KVI_OUT_DCCMSG, - __tr2qs_ctx("The above request is broken: the fourth parameter should be the file size but doesn't appear to be an unsigned number; trying to continue","dcc"),dcc->szParam2.ptr()); + __tr2qs_ctx("The above request is broken: the fourth parameter should be the file size but doesn't appear to be an unsigned number; trying to continue", "dcc"), dcc->szParam2.ptr()); } - dcc->szParam2 = __tr_ctx("","dcc"); + dcc->szParam2 = __tr_ctx("", "dcc"); } if(dcc->szParam1.contains('/')) @@ -747,7 +773,7 @@ static void dccModuleParseDccRSend(KviDccRequest *dcc) if(!dcc->ctcpMsg->msg->haltOutput()) { dcc->ctcpMsg->msg->console()->output(KVI_OUT_DCCMSG, - __tr2qs_ctx("The above request is broken: the filename contains path components, stripping the leading path and trying to continue","dcc"),dcc->szParam1.ptr()); + __tr2qs_ctx("The above request is broken: the filename contains path components, stripping the leading path and trying to continue", "dcc"), dcc->szParam1.ptr()); } dcc->szParam1.cutToLast('/'); } @@ -755,13 +781,13 @@ static void dccModuleParseDccRSend(KviDccRequest *dcc) KviCString szExtensions = dcc->szType; szExtensions.cutRight(4); // cut off SEND - bool bTurboExtension = szExtensions.contains('T',false); + bool bTurboExtension = szExtensions.contains('T', false); #ifdef COMPILE_SSL_SUPPORT - bool bSSLExtension = szExtensions.contains('S',false); -#else //!COMPILE_SSL_SUPPORT - if(szExtensions.contains('S',false)) + bool bSSLExtension = szExtensions.contains('S', false); +#else //!COMPILE_SSL_SUPPORT + if(szExtensions.contains('S', false)) { - dcc_module_request_error(dcc,__tr2qs_ctx("This executable has been compiled without SSL support, the SSL extension to DCC RSEND is not available","dcc")); + dcc_module_request_error(dcc, __tr2qs_ctx("This executable has been compiled without SSL support, the SSL extension to DCC RSEND is not available", "dcc")); return; } #endif //!COMPILE_SSL_SUPPORT @@ -769,93 +795,96 @@ static void dccModuleParseDccRSend(KviDccRequest *dcc) //#warning "When behind a firewall, we should reply an error message and avoid setting up the listening connection" DccDescriptor * d = new DccDescriptor(dcc->pConsole); - d->szNick = dcc->ctcpMsg->pSource->nick(); - d->szUser = dcc->ctcpMsg->pSource->user(); - d->szHost = dcc->ctcpMsg->pSource->host(); - d->szIp = __tr2qs_ctx("(unknown)","dcc"); - d->szPort = d->szIp; + d->szNick = dcc->ctcpMsg->pSource->nick(); + d->szUser = dcc->ctcpMsg->pSource->user(); + d->szHost = dcc->ctcpMsg->pSource->host(); + d->szIp = __tr2qs_ctx("(unknown)", "dcc"); + d->szPort = d->szIp; QString tmp; - if(!dcc_kvs_get_listen_ip_address(0,d->console(),tmp)) + if(!dcc_kvs_get_listen_ip_address(0, d->console(), tmp)) { d->console()->output(KVI_OUT_DCCMSG, - __tr2qs_ctx("No suitable interface to listen on, trying to continue anyway...","dcc")); + __tr2qs_ctx("No suitable interface to listen on, trying to continue anyway...", "dcc")); d->szListenIp = "0.0.0.0"; - } else - d->szListenIp=QString(tmp); - - d->szListenPort = "0"; - dcc_fill_local_nick_user_host(d,dcc); + } + else + d->szListenIp = QString(tmp); + d->szListenPort = "0"; + dcc_fill_local_nick_user_host(d, dcc); - d->szFileName = dcc->szParam1.ptr(); - d->szFileSize = dcc->szParam2.ptr(); - d->bActive = false; // we have to listen! - d->bResume = false; - d->bRecvFile = true; // we have to receive the file! + d->szFileName = dcc->szParam1.ptr(); + d->szFileSize = dcc->szParam2.ptr(); + d->bActive = false; // we have to listen! + d->bResume = false; + d->bRecvFile = true; // we have to receive the file! #ifdef COMPILE_SSL_SUPPORT - d->bIsSSL = bSSLExtension; + d->bIsSSL = bSSLExtension; #endif - d->bIsTdcc = bTurboExtension; - d->bSendRequest = true; // we have to send the [ST]RECV request back - d->bNoAcks = d->bIsTdcc; + d->bIsTdcc = bTurboExtension; + d->bSendRequest = true; // we have to send the [ST]RECV request back + d->bNoAcks = d->bIsTdcc; d->bOverrideMinimize = false; - d->bAutoAccept = KVI_OPTION_BOOL(KviOption_boolAutoAcceptDccSend); - d->bIsIncomingAvatar = g_pApp->findPendingAvatarChange(dcc->pConsole,d->szNick.toUtf8().data(),d->szFileName.toUtf8().data()); + d->bAutoAccept = KVI_OPTION_BOOL(KviOption_boolAutoAcceptDccSend); + d->bIsIncomingAvatar = g_pApp->findPendingAvatarChange(dcc->pConsole, d->szNick.toUtf8().data(), d->szFileName.toUtf8().data()); if(KVI_OPTION_BOOL(KviOption_boolDccSendFakeAddressByDefault)) { d->szFakeIp = KVI_OPTION_STRING(KviOption_stringDefaultDccFakeAddress); - if(d->szFakeIp.isEmpty())KVI_OPTION_BOOL(KviOption_boolDccSendFakeAddressByDefault) = false; + if(d->szFakeIp.isEmpty()) + KVI_OPTION_BOOL(KviOption_boolDccSendFakeAddressByDefault) = false; } - if(KVI_OPTION_BOOL(KviOption_boolAutoAcceptIncomingAvatars))d->bAutoAccept = d->bAutoAccept || d->bIsIncomingAvatar; + if(KVI_OPTION_BOOL(KviOption_boolAutoAcceptIncomingAvatars)) + d->bAutoAccept = d->bAutoAccept || d->bIsIncomingAvatar; - dcc_module_set_dcc_type(d,"RECV"); + dcc_module_set_dcc_type(d, "RECV"); d->triggerCreationEvent(); g_pDccBroker->recvFileManage(d); } - - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // GET //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -static void dccModuleParseDccGet(KviDccRequest *dcc) +static void dccModuleParseDccGet(KviDccRequest * dcc) { // DCC [TS]GET [filesize] // -> DCC [TS]SEND // ... - dcc->szParam1=dcc->pConsole->decodeText(dcc->szParam1); + dcc->szParam1 = dcc->pConsole->decodeText(dcc->szParam1); bool bOk; unsigned int uSize = dcc->szParam2.toUInt(&bOk); - if(!bOk)uSize = 0; + if(!bOk) + uSize = 0; - if(!dcc_module_check_limits(dcc))return; - if(!dcc_module_check_concurrent_transfers_limit(dcc))return; + if(!dcc_module_check_limits(dcc)) + return; + if(!dcc_module_check_concurrent_transfers_limit(dcc)) + return; KviCString szExtensions = dcc->szType; szExtensions.cutRight(3); // cut off GET - bool bTurboExtension = szExtensions.contains('T',false); + bool bTurboExtension = szExtensions.contains('T', false); #ifdef COMPILE_SSL_SUPPORT - bool bSSLExtension = szExtensions.contains('S',false); -#else //!COMPILE_SSL_SUPPORT - if(szExtensions.contains('S',false)) + bool bSSLExtension = szExtensions.contains('S', false); +#else //!COMPILE_SSL_SUPPORT + if(szExtensions.contains('S', false)) { - dcc_module_request_error(dcc,__tr2qs_ctx("This executable has been compiled without SSL support, the SSL extension to DCC GET is not available","dcc")); + dcc_module_request_error(dcc, __tr2qs_ctx("This executable has been compiled without SSL support, the SSL extension to DCC GET is not available", "dcc")); return; } #endif //!COMPILE_SSL_SUPPORT - KviSharedFile * o = g_pSharedFilesManager->lookupSharedFile(dcc->szParam1.ptr(),dcc->ctcpMsg->pSource,uSize); + KviSharedFile * o = g_pSharedFilesManager->lookupSharedFile(dcc->szParam1.ptr(), dcc->ctcpMsg->pSource, uSize); if(!o) { if(!dcc->ctcpMsg->msg->haltOutput()) { - QString szError = QString(__tr2qs_ctx("No file offer named '%1' (with size %2) available for %3 [%4@%5]","dcc")).arg(dcc->szParam1.ptr()).arg(uSize > 0 ? dcc->szParam2.ptr() : __tr_ctx("\"any\"","dcc")).arg(dcc->ctcpMsg->pSource->nick(),dcc->ctcpMsg->pSource->user(),dcc->ctcpMsg->pSource->host()); - dcc_module_request_error(dcc,szError); + QString szError = QString(__tr2qs_ctx("No file offer named '%1' (with size %2) available for %3 [%4@%5]", "dcc")).arg(dcc->szParam1.ptr()).arg(uSize > 0 ? dcc->szParam2.ptr() : __tr_ctx("\"any\"", "dcc")).arg(dcc->ctcpMsg->pSource->nick(), dcc->ctcpMsg->pSource->user(), dcc->ctcpMsg->pSource->host()); + dcc_module_request_error(dcc, szError); } return; } @@ -872,7 +901,6 @@ static void dccModuleParseDccGet(KviDccRequest *dcc) KviCString szSubproto("RSEND"); szSubproto.prepend(szExtensions); - QString szFileName = QFileInfo(o->absFilePath()).fileName(); if(o->name() != szFileName) { @@ -885,91 +913,93 @@ static void dccModuleParseDccGet(KviDccRequest *dcc) // now add a file offer, so he we will accept it automatically // 120 secs is a reasonable timeout QString szMask; - dcc->ctcpMsg->pSource->mask(szMask,KviIrcMask::NickUserHost); + dcc->ctcpMsg->pSource->mask(szMask, KviIrcMask::NickUserHost); KviSharedFile * pOld = o; - o = g_pSharedFilesManager->addSharedFile(szFileName,o->absFilePath(),szMask,120); - if(!o)o = pOld; // give up (FIXME: should we notify that ?) + o = g_pSharedFilesManager->addSharedFile(szFileName, o->absFilePath(), szMask, 120); + if(!o) + o = pOld; // give up (FIXME: should we notify that ?) } if(!dcc->ctcpMsg->msg->haltOutput()) { dcc->ctcpMsg->msg->console()->output(KVI_OUT_DCCMSG, - __tr2qs_ctx("Accepting file request from %Q [%Q@%Q] for '%s' (real file: %Q), offering DCC %s since we can't accept incoming connections (user option)","dcc"), - &(dcc->ctcpMsg->pSource->nick()), - &(dcc->ctcpMsg->pSource->user()), - &(dcc->ctcpMsg->pSource->host()),dcc->szParam1.ptr(), - &(o->absFilePath()),szSubproto.ptr()); + __tr2qs_ctx("Accepting file request from %Q [%Q@%Q] for '%s' (real file: %Q), offering DCC %s since we can't accept incoming connections (user option)", "dcc"), + &(dcc->ctcpMsg->pSource->nick()), + &(dcc->ctcpMsg->pSource->user()), + &(dcc->ctcpMsg->pSource->host()), dcc->szParam1.ptr(), + &(o->absFilePath()), szSubproto.ptr()); } dcc->pConsole->connection()->sendFmtData("PRIVMSG %s :%cDCC %s %s %s%c", - dcc->pConsole->connection()->encodeText(dcc->ctcpMsg->pSource->nick()).data(), - 0x01,szSubproto.ptr(), - dcc->pConsole->connection()->encodeText(dcc->szParam1.ptr()).data(), - dcc->pConsole->connection()->encodeText(QString::number(o->fileSize())).data(), - 0x01); + dcc->pConsole->connection()->encodeText(dcc->ctcpMsg->pSource->nick()).data(), + 0x01, szSubproto.ptr(), + dcc->pConsole->connection()->encodeText(dcc->szParam1.ptr()).data(), + dcc->pConsole->connection()->encodeText(QString::number(o->fileSize())).data(), + 0x01); return; } - DccDescriptor * d = new DccDescriptor(dcc->pConsole); - d->szNick = dcc->ctcpMsg->pSource->nick(); - d->szLocalFileName = o->absFilePath(); - d->szUser = dcc->ctcpMsg->pSource->user(); - d->szHost = dcc->ctcpMsg->pSource->host(); - d->bRecvFile = false; - dcc_fill_local_nick_user_host(d,dcc); + d->szNick = dcc->ctcpMsg->pSource->nick(); + d->szLocalFileName = o->absFilePath(); + d->szUser = dcc->ctcpMsg->pSource->user(); + d->szHost = dcc->ctcpMsg->pSource->host(); + d->bRecvFile = false; + dcc_fill_local_nick_user_host(d, dcc); QString tmp; - if(!dcc_kvs_get_listen_ip_address(0,d->console(),tmp)) + if(!dcc_kvs_get_listen_ip_address(0, d->console(), tmp)) { d->console()->output(KVI_OUT_DCCMSG, - __tr2qs_ctx("No suitable interface to listen on, trying to continue anyway...","dcc")); + __tr2qs_ctx("No suitable interface to listen on, trying to continue anyway...", "dcc")); d->szListenIp = "0.0.0.0"; - } else - d->szListenIp=QString(tmp); + } + else + d->szListenIp = QString(tmp); //#warning "DO STH WITH THIS PORT (HOW TO SPECIFY IT ?)" - d->szListenPort = "0"; // any port is ok + d->szListenPort = "0"; // any port is ok if(KVI_OPTION_BOOL(KviOption_boolDccSendFakeAddressByDefault)) { d->szFakeIp = KVI_OPTION_STRING(KviOption_stringDefaultDccFakeAddress); - if(d->szFakeIp.isEmpty())KVI_OPTION_BOOL(KviOption_boolDccSendFakeAddressByDefault) = false; + if(d->szFakeIp.isEmpty()) + KVI_OPTION_BOOL(KviOption_boolDccSendFakeAddressByDefault) = false; } - d->bDoTimeout = true; - d->szIp = __tr2qs_ctx("(unknown)","dcc"); - d->szPort = d->szIp; - d->bActive = false; - d->bSendRequest = true; - d->bIsTdcc = bTurboExtension; + d->bDoTimeout = true; + d->szIp = __tr2qs_ctx("(unknown)", "dcc"); + d->szPort = d->szIp; + d->bActive = false; + d->bSendRequest = true; + d->bIsTdcc = bTurboExtension; #ifdef COMPILE_SSL_SUPPORT - d->bIsSSL = bSSLExtension; + d->bIsSSL = bSSLExtension; #endif - d->bNoAcks = d->bIsTdcc; + d->bNoAcks = d->bIsTdcc; d->bOverrideMinimize = false; - dcc_module_set_dcc_type(d,"SEND"); + dcc_module_set_dcc_type(d, "SEND"); if(!dcc->ctcpMsg->msg->haltOutput()) { dcc->ctcpMsg->msg->console()->output(KVI_OUT_DCCMSG, - __tr2qs_ctx("Accepting file request from %Q [%Q@%Q] for '%s' (real file: %Q), offering DCC %Q","dcc"), - &(dcc->ctcpMsg->pSource->nick()), - &(dcc->ctcpMsg->pSource->user()), - &(dcc->ctcpMsg->pSource->host()), - dcc->szParam1.ptr(), - &(o->absFilePath()),&(d->szType)); + __tr2qs_ctx("Accepting file request from %Q [%Q@%Q] for '%s' (real file: %Q), offering DCC %Q", "dcc"), + &(dcc->ctcpMsg->pSource->nick()), + &(dcc->ctcpMsg->pSource->user()), + &(dcc->ctcpMsg->pSource->host()), + dcc->szParam1.ptr(), + &(o->absFilePath()), &(d->szType)); } d->triggerCreationEvent(); - g_pDccBroker->sendFileExecute(0,d); + g_pDccBroker->sendFileExecute(0, d); } //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // VOICE //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -static void dccModuleParseDccVoice(KviDccRequest *dcc) +static void dccModuleParseDccVoice(KviDccRequest * dcc) { // // We have received a DCC VOICE request in the following form: @@ -980,15 +1010,17 @@ static void dccModuleParseDccVoice(KviDccRequest *dcc) // ... Easy task :) // - if(!dcc_module_check_limits(dcc))return; + if(!dcc_module_check_limits(dcc)) + return; - if(!dcc_module_normalize_target_data(dcc,dcc->szParam2,dcc->szParam3))return; + if(!dcc_module_normalize_target_data(dcc, dcc->szParam2, dcc->szParam3)) + return; #ifdef COMPILE_DISABLE_DCC_VOICE if(!dcc->ctcpMsg->msg->haltOutput()) { dcc->ctcpMsg->msg->console()->output(KVI_OUT_DCCERROR, - __tr2qs_ctx("The above request can't be accepted: DCC VOICE support not enabled at compilation time ","dcc")); + __tr2qs_ctx("The above request can't be accepted: DCC VOICE support not enabled at compilation time ", "dcc")); return; } #endif @@ -998,7 +1030,7 @@ static void dccModuleParseDccVoice(KviDccRequest *dcc) if(!dcc->ctcpMsg->msg->haltOutput()) { dcc->ctcpMsg->msg->console()->output(KVI_OUT_DCCERROR, - __tr2qs_ctx("The above request can't be accepted: unsupported codec '%s'","dcc"),dcc->szParam1.ptr()); + __tr2qs_ctx("The above request can't be accepted: unsupported codec '%s'", "dcc"), dcc->szParam1.ptr()); return; } } @@ -1011,39 +1043,36 @@ static void dccModuleParseDccVoice(KviDccRequest *dcc) if(!dcc->ctcpMsg->msg->haltOutput()) { dcc->ctcpMsg->msg->console()->output(KVI_OUT_DCCMSG, - __tr2qs_ctx("The above request appears to be broken: invalid sample-rate '%s', defaulting to 8000","dcc"),dcc->szParam4.ptr()); + __tr2qs_ctx("The above request appears to be broken: invalid sample-rate '%s', defaulting to 8000", "dcc"), dcc->szParam4.ptr()); } iSampleRate = 8000; } - DccDescriptor * d = new DccDescriptor(dcc->pConsole); - d->szNick = dcc->ctcpMsg->pSource->nick(); - d->szUser = dcc->ctcpMsg->pSource->user(); - d->szHost = dcc->ctcpMsg->pSource->host(); - dcc_fill_local_nick_user_host(d,dcc); - - - d->szIp = dcc->szParam2.ptr(); - d->szPort = dcc->szParam3.ptr(); - d->bActive = true; // we have to connect - d->bIsTdcc = false; - d->bNoAcks = false; // this has no meaning in voice - d->szCodec = dcc->szParam1; - d->iSampleRate = iSampleRate; + d->szNick = dcc->ctcpMsg->pSource->nick(); + d->szUser = dcc->ctcpMsg->pSource->user(); + d->szHost = dcc->ctcpMsg->pSource->host(); + dcc_fill_local_nick_user_host(d, dcc); + + d->szIp = dcc->szParam2.ptr(); + d->szPort = dcc->szParam3.ptr(); + d->bActive = true; // we have to connect + d->bIsTdcc = false; + d->bNoAcks = false; // this has no meaning in voice + d->szCodec = dcc->szParam1; + d->iSampleRate = iSampleRate; d->bOverrideMinimize = false; - d->bAutoAccept = KVI_OPTION_BOOL(KviOption_boolAutoAcceptDccVoice); - dcc_module_set_dcc_type(d,"VOICE"); + d->bAutoAccept = KVI_OPTION_BOOL(KviOption_boolAutoAcceptDccVoice); + dcc_module_set_dcc_type(d, "VOICE"); d->triggerCreationEvent(); g_pDccBroker->activeVoiceManage(d); } - //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // VIDEO //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -static void dccModuleParseDccVideo(KviDccRequest *dcc) +static void dccModuleParseDccVideo(KviDccRequest * dcc) { // // We have received a DCC VIDEO request in the following form: @@ -1054,15 +1083,17 @@ static void dccModuleParseDccVideo(KviDccRequest *dcc) // ... Easy task :) // - if(!dcc_module_check_limits(dcc))return; + if(!dcc_module_check_limits(dcc)) + return; - if(!dcc_module_normalize_target_data(dcc,dcc->szParam2,dcc->szParam3))return; + if(!dcc_module_normalize_target_data(dcc, dcc->szParam2, dcc->szParam3)) + return; #ifdef COMPILE_DISABLE_DCC_VIDEO if(!dcc->ctcpMsg->msg->haltOutput()) { dcc->ctcpMsg->msg->console()->output(KVI_OUT_DCCERROR, - __tr2qs_ctx("The above request can't be accepted: DCC VIDEO support not enabled at compilation time ","dcc")); + __tr2qs_ctx("The above request can't be accepted: DCC VIDEO support not enabled at compilation time ", "dcc")); return; } #else @@ -1072,42 +1103,40 @@ static void dccModuleParseDccVideo(KviDccRequest *dcc) if(!dcc->ctcpMsg->msg->haltOutput()) { dcc->ctcpMsg->msg->console()->output(KVI_OUT_DCCERROR, - __tr2qs_ctx("The above request can't be accepted: unsupported codec '%s'","dcc"),dcc->szParam1.ptr()); + __tr2qs_ctx("The above request can't be accepted: unsupported codec '%s'", "dcc"), dcc->szParam1.ptr()); return; } } -// bool bOk; - -// int iSampleRate = dcc->szParam4.toInt(&bOk); -// if(!bOk) -// { -// if(!dcc->ctcpMsg->msg->haltOutput()) -// { -// dcc->ctcpMsg->msg->console()->output(KVI_OUT_DCCMSG, -// __tr2qs_ctx("The above request appears to be broken: Invalid sample-rate '%s', defaulting to 8000","dcc"),dcc->szParam4.ptr()); -// } -// iSampleRate = 8000; -// } + // bool bOk; + // int iSampleRate = dcc->szParam4.toInt(&bOk); + // if(!bOk) + // { + // if(!dcc->ctcpMsg->msg->haltOutput()) + // { + // dcc->ctcpMsg->msg->console()->output(KVI_OUT_DCCMSG, + // __tr2qs_ctx("The above request appears to be broken: Invalid sample-rate '%s', defaulting to 8000","dcc"),dcc->szParam4.ptr()); + // } + // iSampleRate = 8000; + // } DccDescriptor * d = new DccDescriptor(dcc->pConsole); - d->szNick = dcc->ctcpMsg->pSource->nick(); - d->szUser = dcc->ctcpMsg->pSource->user(); - d->szHost = dcc->ctcpMsg->pSource->host(); - dcc_fill_local_nick_user_host(d,dcc); - - - d->szIp = dcc->szParam2.ptr(); - d->szPort = dcc->szParam3.ptr(); - d->bActive = true; // we have to connect - d->bIsTdcc = false; - d->bNoAcks = false; // this has no meaning in voice - d->szCodec = dcc->szParam1; -// d->iSampleRate = iSampleRate; + d->szNick = dcc->ctcpMsg->pSource->nick(); + d->szUser = dcc->ctcpMsg->pSource->user(); + d->szHost = dcc->ctcpMsg->pSource->host(); + dcc_fill_local_nick_user_host(d, dcc); + + d->szIp = dcc->szParam2.ptr(); + d->szPort = dcc->szParam3.ptr(); + d->bActive = true; // we have to connect + d->bIsTdcc = false; + d->bNoAcks = false; // this has no meaning in voice + d->szCodec = dcc->szParam1; + // d->iSampleRate = iSampleRate; d->bOverrideMinimize = false; - d->bAutoAccept = KVI_OPTION_BOOL(KviOption_boolAutoAcceptDccVideo); - dcc_module_set_dcc_type(d,"VIDEO"); + d->bAutoAccept = KVI_OPTION_BOOL(KviOption_boolAutoAcceptDccVideo); + dcc_module_set_dcc_type(d, "VIDEO"); d->triggerCreationEvent(); g_pDccBroker->activeVideoManage(d); #endif @@ -1117,7 +1146,7 @@ static void dccModuleParseDccVideo(KviDccRequest *dcc) // CANVAS //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -static void dccModuleParseDccCanvas(KviDccRequest *dcc) +static void dccModuleParseDccCanvas(KviDccRequest * dcc) { // // We have received a DCC CANVAS request in the following form: @@ -1127,9 +1156,11 @@ static void dccModuleParseDccCanvas(KviDccRequest *dcc) // This means that we're requested to setup an ACTIVE canvas connection // ... Easy task :) // - if(!dcc_module_check_limits(dcc))return; + if(!dcc_module_check_limits(dcc)) + return; - if(!dcc_module_normalize_target_data(dcc,dcc->szParam2,dcc->szParam3))return; + if(!dcc_module_normalize_target_data(dcc, dcc->szParam2, dcc->szParam3)) + return; // Actually unused parameter // if(!(kvi_strEqualCI("canvas",dcc->szParam1.ptr()))) @@ -1142,20 +1173,19 @@ static void dccModuleParseDccCanvas(KviDccRequest *dcc) // } #ifdef COMPILE_DCC_CANVAS DccDescriptor * d = new DccDescriptor(dcc->pConsole); - d->szNick = dcc->ctcpMsg->pSource->nick(); - d->szUser = dcc->ctcpMsg->pSource->username(); - d->szHost = dcc->ctcpMsg->pSource->host(); - dcc_fill_local_nick_user_host(d,dcc); - - - d->szIp = dcc->szParam2.ptr(); - d->szPort = dcc->szParam3.ptr(); - d->bActive = true; // we have to connect - d->bIsTdcc = false; - d->bNoAcks = false; // this has no meaning in canvas + d->szNick = dcc->ctcpMsg->pSource->nick(); + d->szUser = dcc->ctcpMsg->pSource->username(); + d->szHost = dcc->ctcpMsg->pSource->host(); + dcc_fill_local_nick_user_host(d, dcc); + + d->szIp = dcc->szParam2.ptr(); + d->szPort = dcc->szParam3.ptr(); + d->bActive = true; // we have to connect + d->bIsTdcc = false; + d->bNoAcks = false; // this has no meaning in canvas d->bOverrideMinimize = false; - d->bAutoAccept = KVI_OPTION_BOOL(KviOption_boolAutoAcceptDccCanvas); - dcc_module_set_dcc_type(d,"CANVAS"); + d->bAutoAccept = KVI_OPTION_BOOL(KviOption_boolAutoAcceptDccCanvas); + dcc_module_set_dcc_type(d, "CANVAS"); d->triggerCreationEvent(); g_pDccBroker->activeCanvasManage(d); #endif @@ -1176,8 +1206,7 @@ typedef struct _dccParseProcEntry #define KVI_NUM_KNOWN_DCC_TYPES 28 -static dccParseProcEntry dccParseProcTable[KVI_NUM_KNOWN_DCC_TYPES]= -{ +static dccParseProcEntry dccParseProcTable[KVI_NUM_KNOWN_DCC_TYPES] = { // clang-format off { "CHAT" , dccModuleParseDccChat }, { "SCHAT" , dccModuleParseDccChat }, @@ -1210,18 +1239,16 @@ static dccParseProcEntry dccParseProcTable[KVI_NUM_KNOWN_DCC_TYPES]= // clang-format on }; - - // We want C linkage on this one: we want to be able to dlsym() it with a simple name // FIXME: Is this portable enough ? Or is better to have a table entry ? -KVIMODULEEXPORTFUNC void dccModuleCtcpDccParseRoutine(KviDccRequest *dcc) +KVIMODULEEXPORTFUNC void dccModuleCtcpDccParseRoutine(KviDccRequest * dcc) { dcc->szType.toUpper(); - for(int i=0;iszType.ptr())) + if(kvi_strEqualCS(dccParseProcTable[i].type, dcc->szType.ptr())) { (dccParseProcTable[i].proc)(dcc); return; @@ -1230,7 +1257,7 @@ KVIMODULEEXPORTFUNC void dccModuleCtcpDccParseRoutine(KviDccRequest *dcc) // ops...we don't know this dcc type if(!dcc->ctcpMsg->msg->haltOutput()) { - QString szError = QString(__tr2qs_ctx("Unknown DCC type '%1'","dcc")).arg(dcc->szType.ptr()); - dcc_module_request_error(dcc,szError); + QString szError = QString(__tr2qs_ctx("Unknown DCC type '%1'", "dcc")).arg(dcc->szType.ptr()); + dcc_module_request_error(dcc, szError); } } diff --git a/src/modules/dialog/libkvidialog.cpp b/src/modules/dialog/libkvidialog.cpp index 17a2ef09b..6b636528e 100644 --- a/src/modules/dialog/libkvidialog.cpp +++ b/src/modules/dialog/libkvidialog.cpp @@ -22,7 +22,6 @@ // //============================================================================= - #include "libkvidialog.h" #include "KviLocale.h" @@ -51,17 +50,17 @@ static KviPointerList * g_pDialogModuleDialogList; KviKvsCallbackMessageBox::KviKvsCallbackMessageBox( - const QString &szCaption, - const QString &szText, - const QString &szIcon, - const QString &szButton0, - const QString &szButton1, - const QString &szButton2, - const QString &szCode, - KviKvsVariantList * pMagicParams, - KviWindow * pWindow,bool modal) -: QMessageBox(0), - KviKvsCallbackObject("dialog.message",pWindow,szCode,pMagicParams,0) + const QString & szCaption, + const QString & szText, + const QString & szIcon, + const QString & szButton0, + const QString & szButton1, + const QString & szButton2, + const QString & szCode, + KviKvsVariantList * pMagicParams, + KviWindow * pWindow, bool modal) + : QMessageBox(0), + KviKvsCallbackObject("dialog.message", pWindow, szCode, pMagicParams, 0) { setObjectName("dialog_message"); setWindowTitle(szCaption); @@ -69,12 +68,25 @@ KviKvsCallbackMessageBox::KviKvsCallbackMessageBox( setIcon(QMessageBox::NoIcon); setModal(modal); QMessageBox::StandardButtons buttons; - bool btn=false; - if (!szButton0.isEmpty()) {btn=true;buttons=QMessageBox::Yes;} - if (!szButton1.isEmpty()) {btn=true;buttons|=QMessageBox::No;} - if (!szButton2.isEmpty()) {btn=true;buttons|=QMessageBox::Cancel; } + bool btn = false; + if(!szButton0.isEmpty()) + { + btn = true; + buttons = QMessageBox::Yes; + } + if(!szButton1.isEmpty()) + { + btn = true; + buttons |= QMessageBox::No; + } + if(!szButton2.isEmpty()) + { + btn = true; + buttons |= QMessageBox::Cancel; + } - if (!btn) buttons=QMessageBox::Ok; + if(!btn) + buttons = QMessageBox::Ok; setStandardButtons(buttons); setDefaultButton(QMessageBox::Yes); if(szButton2.isEmpty()) @@ -86,15 +98,23 @@ KviKvsCallbackMessageBox::KviKvsCallbackMessageBox( QPixmap * pix = g_pIconManager->getImage(szIcon); - if(pix)setIconPixmap(*pix); - else { - if(KviQString::equalCI(szIcon,"information"))setIcon(QMessageBox::Information); - else if(KviQString::equalCI(szIcon,"warning"))setIcon(QMessageBox::Warning); - else if(KviQString::equalCI(szIcon,"critical"))setIcon(QMessageBox::Critical); + if(pix) + setIconPixmap(*pix); + else + { + if(KviQString::equalCI(szIcon, "information")) + setIcon(QMessageBox::Information); + else if(KviQString::equalCI(szIcon, "warning")) + setIcon(QMessageBox::Warning); + else if(KviQString::equalCI(szIcon, "critical")) + setIcon(QMessageBox::Critical); } - if(!szButton0.isEmpty())setButtonText(QMessageBox::Yes,szButton0); - if(!szButton1.isEmpty())setButtonText(QMessageBox::No,szButton1); - if(!szButton2.isEmpty())setButtonText(QMessageBox::Cancel,szButton2); + if(!szButton0.isEmpty()) + setButtonText(QMessageBox::Yes, szButton0); + if(!szButton1.isEmpty()) + setButtonText(QMessageBox::No, szButton1); + if(!szButton2.isEmpty()) + setButtonText(QMessageBox::Cancel, szButton2); } KviKvsCallbackMessageBox::~KviKvsCallbackMessageBox() @@ -110,8 +130,12 @@ void KviKvsCallbackMessageBox::done(int code) switch(code) { - case QMessageBox::No: iVal = 1; break; - case QMessageBox::Cancel: iVal = 2; break; + case QMessageBox::No: + iVal = 1; + break; + case QMessageBox::Cancel: + iVal = 2; + break; case 0: // user closed the dialog, fake an "escape button" press if(standardButtons() & QMessageBox::Cancel) @@ -128,7 +152,6 @@ void KviKvsCallbackMessageBox::done(int code) deleteLater(); } - /* @doc: dialog.message @type: @@ -183,45 +206,46 @@ void KviKvsCallbackMessageBox::done(int code) static bool dialog_kvs_cmd_message(KviKvsModuleCallbackCommandCall * c) { - QString szCaption,szMessage,szIcon,szButton0,szButton1,szButton2; + QString szCaption, szMessage, szIcon, szButton0, szButton1, szButton2; KviKvsVariantList params; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("caption",KVS_PT_STRING,0,szCaption) - KVSM_PARAMETER("message",KVS_PT_STRING,0,szMessage) - KVSM_PARAMETER("icon",KVS_PT_STRING,0,szIcon) - KVSM_PARAMETER("button0",KVS_PT_STRING,KVS_PF_OPTIONAL,szButton0) - KVSM_PARAMETER("button1",KVS_PT_STRING,KVS_PF_OPTIONAL,szButton1) - KVSM_PARAMETER("button2",KVS_PT_STRING,KVS_PF_OPTIONAL,szButton2) - KVSM_PARAMETER("magic",KVS_PT_VARIANTLIST,KVS_PF_OPTIONAL,params) + KVSM_PARAMETER("caption", KVS_PT_STRING, 0, szCaption) + KVSM_PARAMETER("message", KVS_PT_STRING, 0, szMessage) + KVSM_PARAMETER("icon", KVS_PT_STRING, 0, szIcon) + KVSM_PARAMETER("button0", KVS_PT_STRING, KVS_PF_OPTIONAL, szButton0) + KVSM_PARAMETER("button1", KVS_PT_STRING, KVS_PF_OPTIONAL, szButton1) + KVSM_PARAMETER("button2", KVS_PT_STRING, KVS_PF_OPTIONAL, szButton2) + KVSM_PARAMETER("magic", KVS_PT_VARIANTLIST, KVS_PF_OPTIONAL, params) KVSM_PARAMETERS_END(c) bool modal; - if(c->hasSwitch('b',"modal")) modal=true; - else modal=false; + if(c->hasSwitch('b', "modal")) + modal = true; + else + modal = false; QString szCmd = c->callback()->code(); KviKvsCallbackMessageBox * box = new KviKvsCallbackMessageBox( - szCaption,szMessage,szIcon,szButton0,szButton1,szButton2,szCmd,¶ms,c->window(),modal); + szCaption, szMessage, szIcon, szButton0, szButton1, szButton2, szCmd, ¶ms, c->window(), modal); box->show(); return true; } - KviKvsCallbackTextInput::KviKvsCallbackTextInput( - const QString &szCaption, - const QString &szLabel, - const QString &szDefaultText, - const QString &szIcon, - bool bMultiLine, - bool bPassword, - const QString &szButton0, - const QString &szButton1, - const QString &szButton2, - const QString &szCode, - KviKvsVariantList * pMagicParams, - KviWindow * pWindow,bool modal) - : QDialog(), KviKvsCallbackObject("dialog.textinput",pWindow,szCode,pMagicParams,0) + const QString & szCaption, + const QString & szLabel, + const QString & szDefaultText, + const QString & szIcon, + bool bMultiLine, + bool bPassword, + const QString & szButton0, + const QString & szButton1, + const QString & szButton2, + const QString & szCode, + KviKvsVariantList * pMagicParams, + KviWindow * pWindow, bool modal) + : QDialog(), KviKvsCallbackObject("dialog.textinput", pWindow, szCode, pMagicParams, 0) { setObjectName("dialog_textinput"); g_pDialogModuleDialogList->append(this); @@ -238,15 +262,17 @@ KviKvsCallbackTextInput::KviKvsCallbackTextInput( QLabel * il = new QLabel(this); il->setPixmap(*pix); il->setAlignment(Qt::AlignCenter); - g->addWidget(il,0,0); - QLabel * tl = new QLabel(szLabel,this); - g->addWidget(tl,0,1); - } else { - QLabel * tl = new QLabel(szLabel,this); - g->addWidget(tl,0,0,1,2); + g->addWidget(il, 0, 0); + QLabel * tl = new QLabel(szLabel, this); + g->addWidget(tl, 0, 1); + } + else + { + QLabel * tl = new QLabel(szLabel, this); + g->addWidget(tl, 0, 0, 1, 2); } - g->setColumnStretch(1,1); + g->setColumnStretch(1, 1); m_bMultiLine = bMultiLine; m_bPassword = bPassword; @@ -256,18 +282,20 @@ KviKvsCallbackTextInput::KviKvsCallbackTextInput( m_pEdit = new QTextEdit(this); ((QTextEdit *)m_pEdit)->setPlainText(szDefaultText); ((QTextEdit *)m_pEdit)->selectAll(); - } else { + } + else + { m_pEdit = new QLineEdit(this); - if (m_bPassword) + if(m_bPassword) ((QLineEdit *)m_pEdit)->setEchoMode(QLineEdit::Password); ((QLineEdit *)m_pEdit)->setText(szDefaultText); ((QLineEdit *)m_pEdit)->selectAll(); } - g->addWidget(m_pEdit,1,1,1,1); + g->addWidget(m_pEdit, 1, 1, 1, 1); KviTalHBox * box = new KviTalHBox(this); - g->addWidget(box,2,1,1,2); + g->addWidget(box, 2, 1, 1, 2); m_iEscapeButton = -1; m_iDefaultButton = 0; @@ -276,57 +304,63 @@ KviKvsCallbackTextInput::KviKvsCallbackTextInput( { QString szB = szButton0; bool bDef = false; - if(KviQString::equalCIN(szB,"default=",8)) + if(KviQString::equalCIN(szB, "default=", 8)) { bDef = true; - szB.remove(0,8); + szB.remove(0, 8); m_iDefaultButton = 0; - } else if(KviQString::equalCIN(szB,"escape=",7)) + } + else if(KviQString::equalCIN(szB, "escape=", 7)) { - szB.remove(0,7); + szB.remove(0, 7); m_iEscapeButton = 0; } - QPushButton * pb1 = new QPushButton(szB,box); - if(bDef)pb1->setDefault(true); - connect(pb1,SIGNAL(clicked()),this,SLOT(b0Clicked())); + QPushButton * pb1 = new QPushButton(szB, box); + if(bDef) + pb1->setDefault(true); + connect(pb1, SIGNAL(clicked()), this, SLOT(b0Clicked())); } if(!szButton1.isEmpty()) { QString szB = szButton1; bool bDef = false; - if(KviQString::equalCIN(szB,"default=",8)) + if(KviQString::equalCIN(szB, "default=", 8)) { bDef = true; - szB.remove(0,8); + szB.remove(0, 8); m_iDefaultButton = 1; - } else if(KviQString::equalCIN(szB,"escape=",7)) + } + else if(KviQString::equalCIN(szB, "escape=", 7)) { - szB.remove(0,7); + szB.remove(0, 7); m_iEscapeButton = 1; } - QPushButton * pb2 = new QPushButton(szB,box); - if(bDef)pb2->setDefault(true); - connect(pb2,SIGNAL(clicked()),this,SLOT(b1Clicked())); + QPushButton * pb2 = new QPushButton(szB, box); + if(bDef) + pb2->setDefault(true); + connect(pb2, SIGNAL(clicked()), this, SLOT(b1Clicked())); } if(!szButton2.isEmpty()) { QString szB = szButton2; bool bDef = false; - if(KviQString::equalCIN(szB,"default=",8)) + if(KviQString::equalCIN(szB, "default=", 8)) { bDef = true; - szB.remove(0,8); + szB.remove(0, 8); m_iDefaultButton = 2; - } else if(KviQString::equalCIN(szB,"escape=",7)) + } + else if(KviQString::equalCIN(szB, "escape=", 7)) { - szB.remove(0,7); + szB.remove(0, 7); m_iEscapeButton = 2; } - QPushButton * pb3 = new QPushButton(szB,box); - if(bDef)pb3->setDefault(true); - connect(pb3,SIGNAL(clicked()),this,SLOT(b2Clicked())); + QPushButton * pb3 = new QPushButton(szB, box); + if(bDef) + pb3->setDefault(true); + connect(pb3, SIGNAL(clicked()), this, SLOT(b2Clicked())); } if(m_iEscapeButton < 0) @@ -348,23 +382,23 @@ KviKvsCallbackTextInput::~KviKvsCallbackTextInput() void KviKvsCallbackTextInput::b0Clicked() { - done(0+10); + done(0 + 10); } void KviKvsCallbackTextInput::b1Clicked() { - done(1+10); + done(1 + 10); } void KviKvsCallbackTextInput::b2Clicked() { - done(2+10); + done(2 + 10); } -void KviKvsCallbackTextInput::closeEvent(QCloseEvent *e) +void KviKvsCallbackTextInput::closeEvent(QCloseEvent * e) { e->ignore(); - done(m_iEscapeButton+10); + done(m_iEscapeButton + 10); } void KviKvsCallbackTextInput::done(int code) @@ -372,15 +406,17 @@ void KviKvsCallbackTextInput::done(int code) if(code >= 10) { code -= 10; - } else { + } + else + { switch(code) { case QDialog::Accepted: code = m_iDefaultButton; - break; + break; default: code = m_iEscapeButton; - break; + break; } } @@ -389,7 +425,9 @@ void KviKvsCallbackTextInput::done(int code) if(m_bMultiLine) { txt = ((QTextEdit *)m_pEdit)->toPlainText(); - } else { + } + else + { txt = ((QLineEdit *)m_pEdit)->text(); } @@ -404,15 +442,14 @@ void KviKvsCallbackTextInput::done(int code) deleteLater(); } -void KviKvsCallbackTextInput::showEvent(QShowEvent *e) +void KviKvsCallbackTextInput::showEvent(QShowEvent * e) { QRect rect = g_pApp->desktop()->screenGeometry(g_pApp->desktop()->primaryScreen()); - move((rect.width() - width())/2,(rect.height() - height())/2); + move((rect.width() - width()) / 2, (rect.height() - height()) / 2); QDialog::showEvent(e); } - /* @doc: dialog.textinput @type: @@ -485,49 +522,49 @@ void KviKvsCallbackTextInput::showEvent(QShowEvent *e) static bool dialog_kvs_cmd_textinput(KviKvsModuleCallbackCommandCall * c) { - QString szCaption,szInfoText,szIcon,szDefaultText,szButton0,szButton1,szButton2; + QString szCaption, szInfoText, szIcon, szDefaultText, szButton0, szButton1, szButton2; KviKvsVariantList params; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("caption",KVS_PT_STRING,0,szCaption) - KVSM_PARAMETER("info_text",KVS_PT_STRING,0,szInfoText) - KVSM_PARAMETER("button0",KVS_PT_STRING,KVS_PF_OPTIONAL,szButton0) - KVSM_PARAMETER("button1",KVS_PT_STRING,KVS_PF_OPTIONAL,szButton1) - KVSM_PARAMETER("button2",KVS_PT_STRING,KVS_PF_OPTIONAL,szButton2) - KVSM_PARAMETER("magic",KVS_PT_VARIANTLIST,KVS_PF_OPTIONAL,params) + KVSM_PARAMETER("caption", KVS_PT_STRING, 0, szCaption) + KVSM_PARAMETER("info_text", KVS_PT_STRING, 0, szInfoText) + KVSM_PARAMETER("button0", KVS_PT_STRING, KVS_PF_OPTIONAL, szButton0) + KVSM_PARAMETER("button1", KVS_PT_STRING, KVS_PF_OPTIONAL, szButton1) + KVSM_PARAMETER("button2", KVS_PT_STRING, KVS_PF_OPTIONAL, szButton2) + KVSM_PARAMETER("magic", KVS_PT_VARIANTLIST, KVS_PF_OPTIONAL, params) KVSM_PARAMETERS_END(c) QString szCmd = c->callback()->code(); - c->switches()->getAsStringIfExisting('i',"icon",szIcon); - c->switches()->getAsStringIfExisting('d',"default",szDefaultText); + c->switches()->getAsStringIfExisting('i', "icon", szIcon); + c->switches()->getAsStringIfExisting('d', "default", szDefaultText); bool modal; - if(c->hasSwitch('b',"modal")) modal=true; - else modal=false; + if(c->hasSwitch('b', "modal")) + modal = true; + else + modal = false; KviKvsCallbackTextInput * box = new KviKvsCallbackTextInput( - szCaption,szInfoText,szDefaultText,szIcon,c->switches()->find('m',"multiline"),c->switches()->find('p',"password"), - szButton0,szButton1,szButton2,szCmd,¶ms,c->window(),modal); + szCaption, szInfoText, szDefaultText, szIcon, c->switches()->find('m', "multiline"), c->switches()->find('p', "password"), + szButton0, szButton1, szButton2, szCmd, ¶ms, c->window(), modal); box->show(); return true; } - - KviKvsCallbackFileDialog::KviKvsCallbackFileDialog( - const QString &szCaption, - const QString &szInitialSelection, - const QString &szFilter, - const QString &szCode, - KviKvsVariantList * pMagicParams, - KviWindow * pWindow,bool modal) - : KviFileDialog( - szInitialSelection, - szFilter, - NULL, // parent - 0, - modal - ), KviKvsCallbackObject("dialog.file",pWindow,szCode,pMagicParams,0) + const QString & szCaption, + const QString & szInitialSelection, + const QString & szFilter, + const QString & szCode, + KviKvsVariantList * pMagicParams, + KviWindow * pWindow, bool modal) + : KviFileDialog( + szInitialSelection, + szFilter, + NULL, // parent + 0, + modal), + KviKvsCallbackObject("dialog.file", pWindow, szCode, pMagicParams, 0) { g_pDialogModuleDialogList->append(this); setWindowTitle(szCaption); @@ -555,16 +592,20 @@ void KviKvsCallbackFileDialog::done(int code) KviKvsArray * a = new KviKvsArray(); QStringList sl = selectedFiles(); int idx = 0; - for(QStringList::Iterator it = sl.begin();it != sl.end();++it) + for(QStringList::Iterator it = sl.begin(); it != sl.end(); ++it) { - a->set(idx,new KviKvsVariant(*it)); + a->set(idx, new KviKvsVariant(*it)); idx++; } params.append(new KviKvsVariant(a)); - } else { + } + else + { params.append(new KviKvsVariant(selectedFiles().at(0))); } - } else { + } + else + { params.append(new KviKvsVariant(QString(""))); } @@ -620,33 +661,32 @@ void KviKvsCallbackFileDialog::done(int code) //#warning "Examples for these dialogs!" - static bool dialog_kvs_cmd_file(KviKvsModuleCallbackCommandCall * c) { - QString szMode,szCaption,szInitialSelection,szFilter; + QString szMode, szCaption, szInitialSelection, szFilter; KviKvsVariantList params; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("mode",KVS_PT_STRING,0,szMode) - KVSM_PARAMETER("caption",KVS_PT_STRING,0,szCaption) - KVSM_PARAMETER("initial_selection",KVS_PT_STRING,KVS_PF_OPTIONAL,szInitialSelection) - KVSM_PARAMETER("filter",KVS_PT_STRING,KVS_PF_OPTIONAL,szFilter) - KVSM_PARAMETER("magic",KVS_PT_VARIANTLIST,KVS_PF_OPTIONAL,params) + KVSM_PARAMETER("mode", KVS_PT_STRING, 0, szMode) + KVSM_PARAMETER("caption", KVS_PT_STRING, 0, szCaption) + KVSM_PARAMETER("initial_selection", KVS_PT_STRING, KVS_PF_OPTIONAL, szInitialSelection) + KVSM_PARAMETER("filter", KVS_PT_STRING, KVS_PF_OPTIONAL, szFilter) + KVSM_PARAMETER("magic", KVS_PT_VARIANTLIST, KVS_PF_OPTIONAL, params) KVSM_PARAMETERS_END(c) - bool modal = c->hasSwitch('b',"modal"); + bool modal = c->hasSwitch('b', "modal"); QString szCmd = c->callback()->code(); - KviKvsCallbackFileDialog * box = new KviKvsCallbackFileDialog(szCaption,szInitialSelection,szFilter,szCmd,¶ms,c->window(),modal); + KviKvsCallbackFileDialog * box = new KviKvsCallbackFileDialog(szCaption, szInitialSelection, szFilter, szCmd, ¶ms, c->window(), modal); KviFileDialog::FileMode md = KviFileDialog::ExistingFile; - if(KviQString::equalCI(szMode,"open")) + if(KviQString::equalCI(szMode, "open")) md = KviFileDialog::ExistingFiles; - else if(KviQString::equalCI(szMode,"save")) + else if(KviQString::equalCI(szMode, "save")) md = KviFileDialog::AnyFile; - else if(KviQString::equalCI(szMode,"dir")) + else if(KviQString::equalCI(szMode, "dir")) md = KviFileDialog::DirectoryOnly; box->setFileMode(md); @@ -656,16 +696,15 @@ static bool dialog_kvs_cmd_file(KviKvsModuleCallbackCommandCall * c) return true; } - KviKvsCallbackImageDialog::KviKvsCallbackImageDialog( - const QString &szCaption, - const QString &szInitialSelection, - int iType, - int iMaxSize, - const QString &szCode, - KviKvsVariantList * pMagicParams, - KviWindow * pWindow,bool modal) - : KviImageDialog(0,szCaption,iType,0,szInitialSelection,iMaxSize,modal), KviKvsCallbackObject("dialog.image",pWindow,szCode,pMagicParams,0) + const QString & szCaption, + const QString & szInitialSelection, + int iType, + int iMaxSize, + const QString & szCode, + KviKvsVariantList * pMagicParams, + KviWindow * pWindow, bool modal) + : KviImageDialog(0, szCaption, iType, 0, szInitialSelection, iMaxSize, modal), KviKvsCallbackObject("dialog.image", pWindow, szCode, pMagicParams, 0) { g_pDialogModuleDialogList->append(this); setObjectName("dialog_image"); @@ -684,7 +723,9 @@ void KviKvsCallbackImageDialog::done(int code) if(code == QDialog::Accepted) { params.append(new KviKvsVariant(selectedImage())); - } else { + } + else + { params.append(new KviKvsVariant(QString(""))); } @@ -694,7 +735,6 @@ void KviKvsCallbackImageDialog::done(int code) deleteLater(); } - /* @doc: dialog.image @type: @@ -740,34 +780,39 @@ void KviKvsCallbackImageDialog::done(int code) //#warning "Examples for these dialogs!" - static bool dialog_kvs_cmd_image(KviKvsModuleCallbackCommandCall * c) { - QString szType,szCaption,szInitialSelection; + QString szType, szCaption, szInitialSelection; kvs_uint_t iMaxSize; KviKvsVariantList params; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("mode",KVS_PT_STRING,0,szType) - KVSM_PARAMETER("caption",KVS_PT_STRING,0,szCaption) - KVSM_PARAMETER("initial_directory",KVS_PT_STRING,0,szInitialSelection) - KVSM_PARAMETER("maxsize",KVS_PT_UINT,KVS_PF_OPTIONAL,iMaxSize) - KVSM_PARAMETER("magic",KVS_PT_VARIANTLIST,KVS_PF_OPTIONAL,params) + KVSM_PARAMETER("mode", KVS_PT_STRING, 0, szType) + KVSM_PARAMETER("caption", KVS_PT_STRING, 0, szCaption) + KVSM_PARAMETER("initial_directory", KVS_PT_STRING, 0, szInitialSelection) + KVSM_PARAMETER("maxsize", KVS_PT_UINT, KVS_PF_OPTIONAL, iMaxSize) + KVSM_PARAMETER("magic", KVS_PT_VARIANTLIST, KVS_PF_OPTIONAL, params) KVSM_PARAMETERS_END(c) bool modal; - if(c->hasSwitch('b',"modal")) modal=true; - else modal=false; + if(c->hasSwitch('b', "modal")) + modal = true; + else + modal = false; QString szCmd = c->callback()->code(); int iType = 0; - if(szType.contains('s'))iType |= KID_TYPE_BUILTIN_IMAGES_SMALL; - if(szType.contains('f'))iType |= KID_TYPE_FULL_PATH; - if(szType.isEmpty())iType = KID_TYPE_ALL; + if(szType.contains('s')) + iType |= KID_TYPE_BUILTIN_IMAGES_SMALL; + if(szType.contains('f')) + iType |= KID_TYPE_FULL_PATH; + if(szType.isEmpty()) + iType = KID_TYPE_ALL; - if(iMaxSize < 1)iMaxSize = 256000; + if(iMaxSize < 1) + iMaxSize = 256000; - KviKvsCallbackImageDialog * box = new KviKvsCallbackImageDialog(szCaption,szInitialSelection,iType,iMaxSize,szCmd,¶ms,c->window(),modal); + KviKvsCallbackImageDialog * box = new KviKvsCallbackImageDialog(szCaption, szInitialSelection, iType, iMaxSize, szCmd, ¶ms, c->window(), modal); box->show(); @@ -797,13 +842,14 @@ static bool dialog_kvs_fnc_yesno(KviKvsModuleFunctionCall * c) QString szCaption; QString szText; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("caption",KVS_PT_STRING,0,szCaption) - KVSM_PARAMETER("text",KVS_PT_STRING,0,szText) + KVSM_PARAMETER("caption", KVS_PT_STRING, 0, szCaption) + KVSM_PARAMETER("text", KVS_PT_STRING, 0, szText) KVSM_PARAMETERS_END(c) c->enterBlockingSection(); - bool yes=KviMessageBox::yesNo(szCaption,szText); // this will happily crash on quit ? - if(!c->leaveBlockingSection())return true; // just die + bool yes = KviMessageBox::yesNo(szCaption, szText); // this will happily crash on quit ? + if(!c->leaveBlockingSection()) + return true; // just die c->returnValue()->setBoolean(yes); return true; } @@ -890,16 +936,16 @@ static bool dialog_module_fnc_textline(KviModule *m,KviCommand *c,KviParameterLi That's REAL programming. */ -static bool dialog_module_init(KviModule *m) +static bool dialog_module_init(KviModule * m) { g_pDialogModuleDialogList = new KviPointerList; g_pDialogModuleDialogList->setAutoDelete(false); - KVSM_REGISTER_CALLBACK_COMMAND(m,"message",dialog_kvs_cmd_message); - KVSM_REGISTER_CALLBACK_COMMAND(m,"textinput",dialog_kvs_cmd_textinput); - KVSM_REGISTER_CALLBACK_COMMAND(m,"file",dialog_kvs_cmd_file); - KVSM_REGISTER_CALLBACK_COMMAND(m,"image",dialog_kvs_cmd_image); - KVSM_REGISTER_FUNCTION(m,"yesno",dialog_kvs_fnc_yesno); + KVSM_REGISTER_CALLBACK_COMMAND(m, "message", dialog_kvs_cmd_message); + KVSM_REGISTER_CALLBACK_COMMAND(m, "textinput", dialog_kvs_cmd_textinput); + KVSM_REGISTER_CALLBACK_COMMAND(m, "file", dialog_kvs_cmd_file); + KVSM_REGISTER_CALLBACK_COMMAND(m, "image", dialog_kvs_cmd_image); + KVSM_REGISTER_FUNCTION(m, "yesno", dialog_kvs_fnc_yesno); return true; } @@ -907,7 +953,8 @@ static bool dialog_module_init(KviModule *m) static bool dialog_module_cleanup(KviModule *) { // Here we get a tragedy if g_iLocalEventLoops > 0! - while(g_pDialogModuleDialogList->first())delete g_pDialogModuleDialogList->first(); + while(g_pDialogModuleDialogList->first()) + delete g_pDialogModuleDialogList->first(); delete g_pDialogModuleDialogList; g_pDialogModuleDialogList = 0; return true; @@ -918,15 +965,13 @@ static bool dialog_module_can_unload(KviModule *) return g_pDialogModuleDialogList->isEmpty(); } - KVIRC_MODULE( - "KVIrc script dialogs", - "4.0.0", - "Szymon Stefanek ", - "Adds the /dialog.* commands functionality\n", - dialog_module_init, - dialog_module_can_unload, - 0, - dialog_module_cleanup, - 0 -) + "KVIrc script dialogs", + "4.0.0", + "Szymon Stefanek ", + "Adds the /dialog.* commands functionality\n", + dialog_module_init, + dialog_module_can_unload, + 0, + dialog_module_cleanup, + 0) diff --git a/src/modules/dialog/libkvidialog.h b/src/modules/dialog/libkvidialog.h index a69cdd722..70faa5697 100644 --- a/src/modules/dialog/libkvidialog.h +++ b/src/modules/dialog/libkvidialog.h @@ -39,48 +39,49 @@ class KviKvsCallbackMessageBox : public QMessageBox, public KviKvsCallbackObject Q_OBJECT public: KviKvsCallbackMessageBox( - const QString &szCaption, - const QString &szText, - const QString &szIcon, - const QString &szButton0, - const QString &szButton1, - const QString &szButton2, - const QString &szCode, - KviKvsVariantList * pMagicParams, - KviWindow * pWindow, bool modal=false); + const QString & szCaption, + const QString & szText, + const QString & szIcon, + const QString & szButton0, + const QString & szButton1, + const QString & szButton2, + const QString & szCode, + KviKvsVariantList * pMagicParams, + KviWindow * pWindow, bool modal = false); ~KviKvsCallbackMessageBox(); protected slots: virtual void done(int code); }; - class KviKvsCallbackTextInput : public QDialog, public KviKvsCallbackObject { Q_OBJECT public: KviKvsCallbackTextInput( - const QString &szCaption, - const QString &szLabel, - const QString &szDefaultText, - const QString &szIcon, - bool bMultiLine, - bool bPassword, - const QString &szButton0, - const QString &szButton1, - const QString &szButton2, - const QString &szCode, - KviKvsVariantList * pMagicParams, - KviWindow * pWindow, bool modal=false); + const QString & szCaption, + const QString & szLabel, + const QString & szDefaultText, + const QString & szIcon, + bool bMultiLine, + bool bPassword, + const QString & szButton0, + const QString & szButton1, + const QString & szButton2, + const QString & szCode, + KviKvsVariantList * pMagicParams, + KviWindow * pWindow, bool modal = false); ~KviKvsCallbackTextInput(); + protected: - bool m_bMultiLine; - bool m_bPassword; + bool m_bMultiLine; + bool m_bPassword; QWidget * m_pEdit; - int m_iEscapeButton; - int m_iDefaultButton; + int m_iEscapeButton; + int m_iDefaultButton; + protected: - virtual void closeEvent(QCloseEvent *e); - virtual void showEvent(QShowEvent *e); + virtual void closeEvent(QCloseEvent * e); + virtual void showEvent(QShowEvent * e); protected slots: void b0Clicked(); void b1Clicked(); @@ -88,37 +89,37 @@ protected slots: virtual void done(int code); }; - class KviKvsCallbackFileDialog : public KviFileDialog, public KviKvsCallbackObject { Q_OBJECT public: KviKvsCallbackFileDialog( - const QString &szCaption, - const QString &szInitialSelection, - const QString &szFilter, - const QString &szCode, - KviKvsVariantList * pMagicParams, - KviWindow * pWindow, bool modal=false); + const QString & szCaption, + const QString & szInitialSelection, + const QString & szFilter, + const QString & szCode, + KviKvsVariantList * pMagicParams, + KviWindow * pWindow, bool modal = false); ~KviKvsCallbackFileDialog(); + protected: virtual void done(int code); }; - class KviKvsCallbackImageDialog : public KviImageDialog, public KviKvsCallbackObject { Q_OBJECT public: KviKvsCallbackImageDialog( - const QString &szCaption, - const QString &szInitialSelection, - int iType, - int iMaxSize, - const QString &szCode, - KviKvsVariantList * pMagicParams, - KviWindow * pWindow,bool modal=false); + const QString & szCaption, + const QString & szInitialSelection, + int iType, + int iMaxSize, + const QString & szCode, + KviKvsVariantList * pMagicParams, + KviWindow * pWindow, bool modal = false); ~KviKvsCallbackImageDialog(); + protected: virtual void done(int code); }; diff --git a/src/modules/editor/ScriptEditorImplementation.cpp b/src/modules/editor/ScriptEditorImplementation.cpp index 8a7859a4a..afc49e8d9 100644 --- a/src/modules/editor/ScriptEditorImplementation.cpp +++ b/src/modules/editor/ScriptEditorImplementation.cpp @@ -60,43 +60,42 @@ #include #if defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW) - #include +#include #endif //COMPILE_ON_WINDOWS || COMPILE_ON_MINGW -extern KVIRC_API KviModuleManager * g_pModuleManager; +extern KVIRC_API KviModuleManager * g_pModuleManager; extern KviPointerList * g_pScriptEditorWindowList; -extern KviModule * g_pEditorModulePointer; - -static QColor g_clrBackground(0,0,0); -static QColor g_clrNormalText(100,255,0); -static QColor g_clrBracket(255,0,0); -static QColor g_clrComment(0,120,0); -static QColor g_clrFunction(255,255,0); -static QColor g_clrKeyword(120,120,150); -static QColor g_clrVariable(200,200,200); -static QColor g_clrPunctuation(180,180,0); -static QColor g_clrFind(255,0,0); +extern KviModule * g_pEditorModulePointer; + +static QColor g_clrBackground(0, 0, 0); +static QColor g_clrNormalText(100, 255, 0); +static QColor g_clrBracket(255, 0, 0); +static QColor g_clrComment(0, 120, 0); +static QColor g_clrFunction(255, 255, 0); +static QColor g_clrKeyword(120, 120, 150); +static QColor g_clrVariable(200, 200, 200); +static QColor g_clrPunctuation(180, 180, 0); +static QColor g_clrFind(255, 0, 0); #if defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW) - #define KVI_SCRIPTEDITOR_DEFAULT_FONT "Courier New" - #define KVI_SCRIPTEDITOR_DEFAULT_FONT_SIZE 8 +#define KVI_SCRIPTEDITOR_DEFAULT_FONT "Courier New" +#define KVI_SCRIPTEDITOR_DEFAULT_FONT_SIZE 8 #elif defined(COMPILE_ON_MAC) - #define KVI_SCRIPTEDITOR_DEFAULT_FONT "Monaco" - #define KVI_SCRIPTEDITOR_DEFAULT_FONT_SIZE 10 +#define KVI_SCRIPTEDITOR_DEFAULT_FONT "Monaco" +#define KVI_SCRIPTEDITOR_DEFAULT_FONT_SIZE 10 #else - #define KVI_SCRIPTEDITOR_DEFAULT_FONT "Monospace" - #define KVI_SCRIPTEDITOR_DEFAULT_FONT_SIZE 8 +#define KVI_SCRIPTEDITOR_DEFAULT_FONT "Monospace" +#define KVI_SCRIPTEDITOR_DEFAULT_FONT_SIZE 8 #endif -static QFont g_fntNormal(KVI_SCRIPTEDITOR_DEFAULT_FONT,KVI_SCRIPTEDITOR_DEFAULT_FONT_SIZE); - -static bool bSemaphore=false; -static bool bCompleterReady=false; +static QFont g_fntNormal(KVI_SCRIPTEDITOR_DEFAULT_FONT, KVI_SCRIPTEDITOR_DEFAULT_FONT_SIZE); +static bool bSemaphore = false; +static bool bCompleterReady = false; ScriptEditorWidget::ScriptEditorWidget(QWidget * pParent) -: QTextEdit(pParent) + : QTextEdit(pParent) { - m_pSyntaxHighlighter=0; + m_pSyntaxHighlighter = 0; setTabStopWidth(48); setAcceptRichText(false); setWordWrapMode(QTextOption::NoWrap); @@ -107,27 +106,31 @@ ScriptEditorWidget::ScriptEditorWidget(QWidget * pParent) m_pCompleter = 0; QStringList szListFunctionsCommands; QString tmp("kvscompleter.idx"); - iModulesCount=0; - iIndex=0; + iModulesCount = 0; + iIndex = 0; QString szPath; - g_pApp->getLocalKvircDirectory(szPath,KviApplication::ConfigPlugins,tmp); + g_pApp->getLocalKvircDirectory(szPath, KviApplication::ConfigPlugins, tmp); if(!KviFileUtils::fileExists(szPath)) { - if (!bSemaphore){ - bSemaphore=true; + if(!bSemaphore) + { + bSemaphore = true; m_pStartTimer = new QTimer(); m_pStartTimer->setInterval(1000); - connect(m_pStartTimer,SIGNAL(timeout()),this,SLOT(asyncCompleterCreation())); + connect(m_pStartTimer, SIGNAL(timeout()), this, SLOT(asyncCompleterCreation())); m_pStartTimer->start(500); } - else{ + else + { m_pStartTimer = new QTimer(); m_pStartTimer->setInterval(2000); - connect(m_pStartTimer,SIGNAL(timeout()),this,SLOT(checkReadyCompleter())); + connect(m_pStartTimer, SIGNAL(timeout()), this, SLOT(checkReadyCompleter())); m_pStartTimer->start(1000); } - } else loadCompleterFromFile(); + } + else + loadCompleterFromFile(); } ScriptEditorWidget::~ScriptEditorWidget() @@ -143,7 +146,7 @@ void ScriptEditorWidget::checkReadyCompleter() { m_pStartTimer->stop(); delete m_pStartTimer; - m_pStartTimer=0; + m_pStartTimer = 0; loadCompleterFromFile(); } } @@ -157,7 +160,7 @@ void ScriptEditorWidget::asyncCompleterCreation() m_pListCompletition = new QStringList(); QString szPath; - g_pApp->getGlobalKvircDirectory(szPath,KviApplication::Modules); + g_pApp->getGlobalKvircDirectory(szPath, KviApplication::Modules); QDir d(szPath); @@ -175,20 +178,20 @@ void ScriptEditorWidget::asyncCompleterCreation() iIndex++; #if defined(COMPILE_ON_WINDOWS) - szModuleName=szModuleName.replace("kvi",""); - szModuleName=szModuleName.replace(".dll",""); + szModuleName = szModuleName.replace("kvi", ""); + szModuleName = szModuleName.replace(".dll", ""); #elif defined(COMPILE_ON_MINGW) - szModuleName=szModuleName.replace("libkvi",""); - szModuleName=szModuleName.replace(".dll",""); + szModuleName = szModuleName.replace("libkvi", ""); + szModuleName = szModuleName.replace(".dll", ""); #else - szModuleName=szModuleName.replace("libkvi",""); - szModuleName=szModuleName.replace(".so",""); + szModuleName = szModuleName.replace("libkvi", ""); + szModuleName = szModuleName.replace(".so", ""); #endif KviModule * pModule = g_pModuleManager->getModule(szModuleName); if(pModule) { - pModule->getAllFunctionsCommandsModule(m_pListCompletition,szModuleName); + pModule->getAllFunctionsCommandsModule(m_pListCompletition, szModuleName); } if(iIndex == iModulesCount) @@ -198,7 +201,7 @@ void ScriptEditorWidget::asyncCompleterCreation() m_pStartTimer = 0; QString szTmp("kvscompleter.idx"); QString szPath; - g_pApp->getLocalKvircDirectory(szPath,KviApplication::ConfigPlugins,szTmp); + g_pApp->getLocalKvircDirectory(szPath, KviApplication::ConfigPlugins, szTmp); KviKvsKernel::instance()->getAllFunctionsCommandsCore(m_pListCompletition); QString szBuffer = m_pListCompletition->join(","); QFile f(szPath); @@ -208,7 +211,7 @@ void ScriptEditorWidget::asyncCompleterCreation() createCompleter(*m_pListCompletition); iIndex = 0; iModulesCount = 0; - bCompleterReady=true; + bCompleterReady = true; delete m_pListCompletition; delete m_pListModulesNames; } @@ -219,7 +222,7 @@ void ScriptEditorWidget::loadCompleterFromFile() QStringList szListFunctionsCommand; QString szTmp("kvscompleter.idx"); QString szPath; - g_pApp->getLocalKvircDirectory(szPath,KviApplication::ConfigPlugins,szTmp); + g_pApp->getLocalKvircDirectory(szPath, KviApplication::ConfigPlugins, szTmp); QString szBuffer; QFile f(szPath); f.open(QIODevice::ReadOnly); @@ -238,7 +241,7 @@ void ScriptEditorWidget::createCompleter(QStringList & list) m_pCompleter->setModelSorting(QCompleter::CaseSensitivelySortedModel); m_pCompleter->setCompletionMode(QCompleter::PopupCompletion); m_pCompleter->setCaseSensitivity(Qt::CaseInsensitive); - QObject::connect(m_pCompleter, SIGNAL(activated(const QString &)),this, SLOT(insertCompletion(const QString &))); + QObject::connect(m_pCompleter, SIGNAL(activated(const QString &)), this, SLOT(insertCompletion(const QString &))); } void ScriptEditorWidget::insertCompletion(const QString & szCompletion) @@ -250,7 +253,7 @@ void ScriptEditorWidget::insertCompletion(const QString & szCompletion) tc.movePosition(QTextCursor::EndOfWord); QString szTmp = szCompletion.right(iExtra); - if(szCompletion.left(1)=="$") + if(szCompletion.left(1) == "$") szTmp.append("("); else szTmp.append(" "); @@ -262,26 +265,28 @@ void ScriptEditorWidget::insertCompletion(const QString & szCompletion) void ScriptEditorWidget::contextMenuEvent(QContextMenuEvent * e) { QMenu * pMenu = createStandardContextMenu(); - pMenu->addAction(__tr2qs_ctx("Context Sensitive Help","editor"),this,SLOT(slotHelp()),Qt::CTRL+Qt::Key_H); - pMenu->addAction(__tr2qs_ctx("&Replace","editor"),this,SLOT(slotReplace()),Qt::CTRL+Qt::Key_R); + pMenu->addAction(__tr2qs_ctx("Context Sensitive Help", "editor"), this, SLOT(slotHelp()), Qt::CTRL + Qt::Key_H); + pMenu->addAction(__tr2qs_ctx("&Replace", "editor"), this, SLOT(slotReplace()), Qt::CTRL + Qt::Key_R); pMenu->exec(e->globalPos()); delete pMenu; } void ScriptEditorWidget::slotFind() { - m_szFind = ((ScriptEditorImplementation*)m_pParent)->findLineEdit()->text(); + m_szFind = ((ScriptEditorImplementation *)m_pParent)->findLineEdit()->text(); setText(toPlainText()); } void ScriptEditorWidget::slotReplace() { - ScriptEditorReplaceDialog * pDialog = new ScriptEditorReplaceDialog(this,__tr2qs_ctx("Find & Replace","editor")); - connect(pDialog,SIGNAL(replaceAll(const QString &,const QString &)),m_pParent,SLOT(slotReplaceAll(const QString &,const QString &))); - connect(pDialog,SIGNAL(initFind()),m_pParent,SLOT(slotInitFind())); - connect(pDialog,SIGNAL(nextFind(const QString &)),m_pParent,SLOT(slotNextFind(const QString &))); + ScriptEditorReplaceDialog * pDialog = new ScriptEditorReplaceDialog(this, __tr2qs_ctx("Find & Replace", "editor")); + connect(pDialog, SIGNAL(replaceAll(const QString &, const QString &)), m_pParent, SLOT(slotReplaceAll(const QString &, const QString &))); + connect(pDialog, SIGNAL(initFind()), m_pParent, SLOT(slotInitFind())); + connect(pDialog, SIGNAL(nextFind(const QString &)), m_pParent, SLOT(slotNextFind(const QString &))); - if(pDialog->exec()){}; + if(pDialog->exec()) + { + }; } void ScriptEditorWidget::slotHelp() @@ -292,35 +297,38 @@ void ScriptEditorWidget::enableSyntaxHighlighter() { // we currently delete and re-create the m_pSyntaxHighlighter // as a trick to ensure proper re-highlightning to occur - if (!m_pSyntaxHighlighter) - m_pSyntaxHighlighter = new ScriptEditorSyntaxHighlighter(this); + if(!m_pSyntaxHighlighter) + m_pSyntaxHighlighter = new ScriptEditorSyntaxHighlighter(this); } void ScriptEditorWidget::disableSyntaxHighlighter() { - if (m_pSyntaxHighlighter) delete m_pSyntaxHighlighter; + if(m_pSyntaxHighlighter) + delete m_pSyntaxHighlighter; m_pSyntaxHighlighter = 0; } void ScriptEditorWidget::updateOptions() { QPalette p = palette(); - p.setColor(QPalette::Base,g_clrBackground); - p.setColor(QPalette::Text,g_clrNormalText); + p.setColor(QPalette::Base, g_clrBackground); + p.setColor(QPalette::Text, g_clrNormalText); setPalette(p); setFont(g_fntNormal); setTextColor(g_clrNormalText); disableSyntaxHighlighter(); enableSyntaxHighlighter(); - p = ((ScriptEditorImplementation*)m_pParent)->findLineEdit()->palette(); - p.setColor(foregroundRole(),g_clrFind); - ((ScriptEditorImplementation*)m_pParent)->findLineEdit()->setPalette(p); + p = ((ScriptEditorImplementation *)m_pParent)->findLineEdit()->palette(); + p.setColor(foregroundRole(), g_clrFind); + ((ScriptEditorImplementation *)m_pParent)->findLineEdit()->setPalette(p); //set cursor custom width - if (KVI_OPTION_BOOL(KviOption_boolEnableCustomCursorWidth)) + if(KVI_OPTION_BOOL(KviOption_boolEnableCustomCursorWidth)) { setCursorWidth(KVI_OPTION_UINT(KviOption_uintCustomCursorWidth)); - } else { + } + else + { #if defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW) int iCursorWidth = 1; SystemParametersInfo(SPI_GETCARETWIDTH, 0, &iCursorWidth, 0); @@ -366,33 +374,33 @@ void ScriptEditorWidget::keyPressEvent(QKeyEvent * e) case Qt::Key_Enter: case Qt::Key_Return: case Qt::Key_PageUp: - e->ignore(); // allow the parent to process it - return; - break; + e->ignore(); // allow the parent to process it + return; + break; } } -// Adapted from QT4 QCompleter example + // Adapted from QT4 QCompleter example bool isShortcut = ((e->modifiers() & Qt::ControlModifier) && e->key() == Qt::Key_E); // CTRL+E - if (!m_pCompleter || !isShortcut) // don't process the shortcut when we have a completer + if(!m_pCompleter || !isShortcut) // don't process the shortcut when we have a completer QTextEdit::keyPressEvent(e); const bool ctrlOrShift = e->modifiers() & (Qt::ControlModifier | Qt::ShiftModifier); - if (!m_pCompleter || (ctrlOrShift && e->text().isEmpty())) + if(!m_pCompleter || (ctrlOrShift && e->text().isEmpty())) return; static QString eow("~!@#$%^&*()_+{}|:\"<>?,/;'[]\\-="); // end of word bool hasModifier = (e->modifiers() != Qt::NoModifier) && !ctrlOrShift; QString completionPrefix = textUnderCursor(); - if (!isShortcut && (hasModifier || e->text().isEmpty()|| completionPrefix.length() < 3 || eow.contains(e->text().right(1)))) + if(!isShortcut && (hasModifier || e->text().isEmpty() || completionPrefix.length() < 3 || eow.contains(e->text().right(1)))) { m_pCompleter->popup()->hide(); return; } - if (completionPrefix != m_pCompleter->completionPrefix()) + if(completionPrefix != m_pCompleter->completionPrefix()) { m_pCompleter->setCompletionPrefix(completionPrefix); m_pCompleter->popup()->setCurrentIndex(m_pCompleter->completionModel()->index(0, 0)); } QRect cr = cursorRect(); - cr.setWidth(m_pCompleter->popup()->sizeHintForColumn(0)+ m_pCompleter->popup()->verticalScrollBar()->sizeHint().width()); + cr.setWidth(m_pCompleter->popup()->sizeHintForColumn(0) + m_pCompleter->popup()->verticalScrollBar()->sizeHint().width()); m_pCompleter->complete(cr); } @@ -403,32 +411,35 @@ QString ScriptEditorWidget::textUnderCursor() const if(tc.atBlockStart()) return QString(); tc.clearSelection(); - tc.movePosition(QTextCursor::StartOfWord,QTextCursor::KeepAnchor); + tc.movePosition(QTextCursor::StartOfWord, QTextCursor::KeepAnchor); if(tc.atBlockStart()) { szWord.append(tc.selectedText()); - tc.movePosition(QTextCursor::EndOfWord,QTextCursor::KeepAnchor); + tc.movePosition(QTextCursor::EndOfWord, QTextCursor::KeepAnchor); szWord.append(tc.selectedText()); - if(tc.atBlockEnd()){ + if(tc.atBlockEnd()) + { return szWord; } - tc.movePosition(QTextCursor::NextCharacter,QTextCursor::KeepAnchor); + tc.movePosition(QTextCursor::NextCharacter, QTextCursor::KeepAnchor); szWord.append(tc.selectedText()); - if(szWord.right(1)!=".") + if(szWord.right(1) != ".") szWord.chop(1); return szWord; } - tc.movePosition(QTextCursor::PreviousCharacter,QTextCursor::KeepAnchor); - szWord=tc.selectedText(); - if(szWord.left(1)==".") + tc.movePosition(QTextCursor::PreviousCharacter, QTextCursor::KeepAnchor); + szWord = tc.selectedText(); + if(szWord.left(1) == ".") { tc.movePosition(QTextCursor::StartOfWord); tc.movePosition(QTextCursor::PreviousCharacter); tc.movePosition(QTextCursor::PreviousWord); - tc.movePosition(QTextCursor::EndOfWord,QTextCursor::KeepAnchor,1); + tc.movePosition(QTextCursor::EndOfWord, QTextCursor::KeepAnchor, 1); szWord.prepend(tc.selectedText()); - } else szWord.remove(0,1); + } + else + szWord.remove(0, 1); return szWord; } /* @@ -494,7 +505,7 @@ bool ScriptEditorWidget::contextSensitiveHelp() const */ QRect r = cursorRect(); - QTextCursor cur = cursorForPosition(QPoint(r.x(),r.y())); + QTextCursor cur = cursorForPosition(QPoint(r.x(), r.y())); cur.select(QTextCursor::WordUnderCursor); QString szText = cur.selectedText(); QString szTmp = szText; @@ -534,39 +545,39 @@ bool ScriptEditorWidget::contextSensitiveHelp() const } ScriptEditorWidgetColorOptions::ScriptEditorWidgetColorOptions(QWidget * pParent) -: QDialog(pParent) + : QDialog(pParent) { m_pSelectorInterfaceList = new KviPointerList; m_pSelectorInterfaceList->setAutoDelete(false); - setWindowTitle(__tr2qs_ctx("Editor Configuration - KVIrc","editor")); + setWindowTitle(__tr2qs_ctx("Editor Configuration - KVIrc", "editor")); QGridLayout * g = new QGridLayout(this); KviTalVBox * box = new KviTalVBox(this); - g->addWidget(box,0,0); + g->addWidget(box, 0, 0); box->setMargin(0); box->setSpacing(0); - KviFontSelector * f = new KviFontSelector(box,__tr2qs_ctx("Font:","editor"),&g_fntNormal,true); + KviFontSelector * f = new KviFontSelector(box, __tr2qs_ctx("Font:", "editor"), &g_fntNormal, true); m_pSelectorInterfaceList->append(f); - KviTalGroupBox * gbox = new KviTalGroupBox(Qt::Horizontal,__tr2qs_ctx("Colors","editor"),box); + KviTalGroupBox * gbox = new KviTalGroupBox(Qt::Horizontal, __tr2qs_ctx("Colors", "editor"), box); gbox->setInsideSpacing(0); - addColorSelector(gbox,__tr2qs_ctx("Background:","editor"),&g_clrBackground,true); - addColorSelector(gbox,__tr2qs_ctx("Normal text:","editor"),&g_clrNormalText,true); - addColorSelector(gbox,__tr2qs_ctx("Brackets:","editor"),&g_clrBracket,true); - addColorSelector(gbox,__tr2qs_ctx("Comments:","editor"),&g_clrComment,true); - addColorSelector(gbox,__tr2qs_ctx("Functions:","editor"),&g_clrFunction,true); - addColorSelector(gbox,__tr2qs_ctx("Keywords:","editor"),&g_clrKeyword,true); - addColorSelector(gbox,__tr2qs_ctx("Variables:","editor"),&g_clrVariable,true); - addColorSelector(gbox,__tr2qs_ctx("Punctuation:","editor"),&g_clrPunctuation,true); - addColorSelector(gbox,__tr2qs_ctx("Find:","editor"),&g_clrFind,true); + addColorSelector(gbox, __tr2qs_ctx("Background:", "editor"), &g_clrBackground, true); + addColorSelector(gbox, __tr2qs_ctx("Normal text:", "editor"), &g_clrNormalText, true); + addColorSelector(gbox, __tr2qs_ctx("Brackets:", "editor"), &g_clrBracket, true); + addColorSelector(gbox, __tr2qs_ctx("Comments:", "editor"), &g_clrComment, true); + addColorSelector(gbox, __tr2qs_ctx("Functions:", "editor"), &g_clrFunction, true); + addColorSelector(gbox, __tr2qs_ctx("Keywords:", "editor"), &g_clrKeyword, true); + addColorSelector(gbox, __tr2qs_ctx("Variables:", "editor"), &g_clrVariable, true); + addColorSelector(gbox, __tr2qs_ctx("Punctuation:", "editor"), &g_clrPunctuation, true); + addColorSelector(gbox, __tr2qs_ctx("Find:", "editor"), &g_clrFind, true); KviTalHBox * hbox = new KviTalHBox(box); - QPushButton * b = new QPushButton(__tr2qs_ctx("OK","editor"),hbox); + QPushButton * b = new QPushButton(__tr2qs_ctx("OK", "editor"), hbox); b->setDefault(true); - connect(b,SIGNAL(clicked()),this,SLOT(okClicked())); + connect(b, SIGNAL(clicked()), this, SLOT(okClicked())); - b = new QPushButton(__tr2qs_ctx("Cancel","editor"),hbox); - connect(b,SIGNAL(clicked()),this,SLOT(reject())); + b = new QPushButton(__tr2qs_ctx("Cancel", "editor"), hbox); + connect(b, SIGNAL(clicked()), this, SLOT(reject())); } ScriptEditorWidgetColorOptions::~ScriptEditorWidgetColorOptions() @@ -574,25 +585,24 @@ ScriptEditorWidgetColorOptions::~ScriptEditorWidgetColorOptions() delete m_pSelectorInterfaceList; } -KviColorSelector * ScriptEditorWidgetColorOptions::addColorSelector(QWidget * pParent,const QString & txt,QColor * pOption,bool bEnabled) +KviColorSelector * ScriptEditorWidgetColorOptions::addColorSelector(QWidget * pParent, const QString & txt, QColor * pOption, bool bEnabled) { - KviColorSelector * s = new KviColorSelector(pParent,txt,pOption,bEnabled); + KviColorSelector * s = new KviColorSelector(pParent, txt, pOption, bEnabled); m_pSelectorInterfaceList->append(s); - return s; + return s; } void ScriptEditorWidgetColorOptions::okClicked() { - for(KviSelectorInterface * i = m_pSelectorInterfaceList->first();i;i = m_pSelectorInterfaceList->next()) + for(KviSelectorInterface * i = m_pSelectorInterfaceList->first(); i; i = m_pSelectorInterfaceList->next()) { i->commit(); } accept(); } - ScriptEditorSyntaxHighlighter::ScriptEditorSyntaxHighlighter(ScriptEditorWidget * pWidget) -: QSyntaxHighlighter(pWidget),m_pTextEdit(pWidget) + : QSyntaxHighlighter(pWidget), m_pTextEdit(pWidget) { // code adpated from QT4 example @@ -603,25 +613,24 @@ ScriptEditorSyntaxHighlighter::ScriptEditorSyntaxHighlighter(ScriptEditorWidget KviScriptHighlightingRule rule; - rule.pattern=QRegExp("([=()[\\]!\"?<>;:.,+-])+"); - rule.format=punctuationFormat; + rule.pattern = QRegExp("([=()[\\]!\"?<>;:.,+-])+"); + rule.format = punctuationFormat; highlightingRules.append(rule); - rule.pattern=QRegExp("[{};](|[a-zA-Z]|[a-zA-Z]+[a-zA-Z0-9_\\.:]*)"); - rule.format=keywordFormat; + rule.pattern = QRegExp("[{};](|[a-zA-Z]|[a-zA-Z]+[a-zA-Z0-9_\\.:]*)"); + rule.format = keywordFormat; highlightingRules.append(rule); - - rule.pattern=QRegExp("[$](|[a-zA-Z0-9]+[a-zA-Z0-9_\\.:]*)"); - rule.format=functionFormat; + rule.pattern = QRegExp("[$](|[a-zA-Z0-9]+[a-zA-Z0-9_\\.:]*)"); + rule.format = functionFormat; highlightingRules.append(rule); - rule.pattern=QRegExp("[%](|[a-zA-Z]|[a-zA-Z]+[a-zA-Z0-9_\\.]*)"); - rule.format=variableFormat; + rule.pattern = QRegExp("[%](|[a-zA-Z]|[a-zA-Z]+[a-zA-Z0-9_\\.]*)"); + rule.format = variableFormat; highlightingRules.append(rule); - rule.pattern=QRegExp("([{}])+"); - rule.format=bracketFormat; + rule.pattern = QRegExp("([{}])+"); + rule.format = bracketFormat; highlightingRules.append(rule); } @@ -640,16 +649,18 @@ void ScriptEditorSyntaxHighlighter::updateSyntaxtTextFormat() findFormat.setForeground(g_clrFind); } -#define SKIP_SPACES \ - while(iIndexStart < szText.size()) \ - { \ - if(szText.at(iIndexStart).unicode()=='\t' || szText.at(iIndexStart).unicode()==' ') \ - { \ - iIndexStart++; \ - } else { \ - break; \ - } \ - } \ +#define SKIP_SPACES \ + while(iIndexStart < szText.size()) \ + { \ + if(szText.at(iIndexStart).unicode() == '\t' || szText.at(iIndexStart).unicode() == ' ') \ + { \ + iIndexStart++; \ + } \ + else \ + { \ + break; \ + } \ + } void ScriptEditorSyntaxHighlighter::highlightBlock(const QString & szText) { @@ -659,7 +670,7 @@ void ScriptEditorSyntaxHighlighter::highlightBlock(const QString & szText) return; } - int iIndexStart=0; + int iIndexStart = 0; setCurrentBlockState(0); if(previousBlockState() == 1) @@ -670,73 +681,74 @@ void ScriptEditorSyntaxHighlighter::highlightBlock(const QString & szText) { // not found: comment until the end of the block setCurrentBlockState(1); - setFormat(iIndexStart,szText.length(),commentFormat); + setFormat(iIndexStart, szText.length(), commentFormat); return; } // skip 2 chars - iCommentEnd+=2; + iCommentEnd += 2; // end of comment found - setFormat(iIndexStart,iCommentEnd - iIndexStart,commentFormat); + setFormat(iIndexStart, iCommentEnd - iIndexStart, commentFormat); iIndexStart = iCommentEnd; } SKIP_SPACES - if (iIndexStart == szText.size()) + if(iIndexStart == szText.size()) return; // check 'commands' and comments - int iCommandStart=iIndexStart; - if (szText.at(iIndexStart).unicode()!='$' && szText.at(iIndexStart).unicode()!='{' && szText.at(iIndexStart).unicode()!='}' && szText.at(iIndexStart).unicode()!='%') + int iCommandStart = iIndexStart; + if(szText.at(iIndexStart).unicode() != '$' && szText.at(iIndexStart).unicode() != '{' && szText.at(iIndexStart).unicode() != '}' && szText.at(iIndexStart).unicode() != '%') { switch(szText.at(iIndexStart).unicode()) { case '#': // single line comment, bash style - while(iIndexStart= 0) + while(index >= 0) { int length = expression.matchedLength(); setFormat(index, length, rule.format); @@ -774,29 +786,29 @@ void ScriptEditorSyntaxHighlighter::highlightBlock(const QString & szText) // 'found matches' highlighting ScriptEditorWidget * pEditor = ((ScriptEditorWidget *)textEdit()); QString szFind = pEditor->m_szFind; - if (!szFind.isEmpty()) + if(!szFind.isEmpty()) { - index = szText.indexOf(szFind,0,Qt::CaseInsensitive); - int length=szFind.length(); - while (index >= 0) + index = szText.indexOf(szFind, 0, Qt::CaseInsensitive); + int length = szFind.length(); + while(index >= 0) { setFormat(index, length, findFormat); - index = szText.indexOf(szFind,index + length,Qt::CaseInsensitive); + index = szText.indexOf(szFind, index + length, Qt::CaseInsensitive); } } } - ScriptEditorImplementation::ScriptEditorImplementation(QWidget * par) -:KviScriptEditor(par) + : KviScriptEditor(par) { - m_pOptionsDialog=0; - if(g_pScriptEditorWindowList->isEmpty())loadOptions(); + m_pOptionsDialog = 0; + if(g_pScriptEditorWindowList->isEmpty()) + loadOptions(); g_pScriptEditorWindowList->append(this); m_lastCursorPos = 0; QGridLayout * g = new QGridLayout(this); - m_pFindLineEdit = new QLineEdit(" ",this); + m_pFindLineEdit = new QLineEdit(" ", this); m_pFindLineEdit->setText(""); QPalette p = m_pFindLineEdit->palette(); @@ -805,8 +817,8 @@ ScriptEditorImplementation::ScriptEditorImplementation(QWidget * par) m_pEditor = new ScriptEditorWidget(this); - g->addWidget(m_pEditor, 0, 0, 1,4); - g->setRowStretch(0,1); + g->addWidget(m_pEditor, 0, 0, 1, 4); + g->setRowStretch(0, 1); QToolButton * b = new QToolButton(this); b->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Options))); @@ -815,34 +827,34 @@ ScriptEditorImplementation::ScriptEditorImplementation(QWidget * par) b->setMinimumWidth(24); b->setText(__tr2qs_ctx("Options", "editor")); b->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); - g->addWidget(b,1,0); + g->addWidget(b, 1, 0); QMenu * pop = new QMenu(b); - pop->addAction(__tr2qs_ctx("&Open...","editor"),this,SLOT(loadFromFile())); - pop->addAction(__tr2qs_ctx("&Save As...","editor"),this,SLOT(saveToFile())); + pop->addAction(__tr2qs_ctx("&Open...", "editor"), this, SLOT(loadFromFile())); + pop->addAction(__tr2qs_ctx("&Save As...", "editor"), this, SLOT(saveToFile())); pop->addSeparator(); - pop->addAction(__tr2qs_ctx("&Configure Editor...","editor"),this,SLOT(configureColors())); + pop->addAction(__tr2qs_ctx("&Configure Editor...", "editor"), this, SLOT(configureColors())); b->setMenu(pop); b->setPopupMode(QToolButton::InstantPopup); - g->setColumnStretch(1,1); - g->setColumnStretch(2,10); - g->addWidget(m_pFindLineEdit,1,2); + g->setColumnStretch(1, 1); + g->setColumnStretch(2, 10); + g->addWidget(m_pFindLineEdit, 1, 2); QLabel * pLab = new QLabel(this); - pLab->setText(__tr2qs_ctx("Find:","editor")); + pLab->setText(__tr2qs_ctx("Find:", "editor")); pLab->setAlignment(Qt::AlignRight | Qt::AlignVCenter); - g->addWidget(pLab,1,1); + g->addWidget(pLab, 1, 1); - m_pRowColLabel = new QLabel(QString(__tr2qs_ctx("Row: %1 Col: %2","editor")).arg(0).arg(0),this); + m_pRowColLabel = new QLabel(QString(__tr2qs_ctx("Row: %1 Col: %2", "editor")).arg(0).arg(0), this); m_pRowColLabel->setFrameStyle(QFrame::Sunken | QFrame::Panel); m_pRowColLabel->setMinimumWidth(80); - g->addWidget(m_pRowColLabel,1,3); + g->addWidget(m_pRowColLabel, 1, 3); - connect(m_pFindLineEdit,SIGNAL(returnPressed()),m_pEditor,SLOT(slotFind())); - connect(m_pFindLineEdit,SIGNAL(returnPressed()),this,SLOT(slotFind())); - connect(m_pEditor,SIGNAL(cursorPositionChanged()),this,SLOT(updateRowColLabel())); - connect(m_pEditor,SIGNAL(selectionChanged()),this,SLOT(updateRowColLabel())); + connect(m_pFindLineEdit, SIGNAL(returnPressed()), m_pEditor, SLOT(slotFind())); + connect(m_pFindLineEdit, SIGNAL(returnPressed()), this, SLOT(slotFind())); + connect(m_pEditor, SIGNAL(cursorPositionChanged()), this, SLOT(updateRowColLabel())); + connect(m_pEditor, SIGNAL(selectionChanged()), this, SLOT(updateRowColLabel())); m_lastCursorPos = 0; } @@ -851,7 +863,7 @@ ScriptEditorImplementation::~ScriptEditorImplementation() if(m_pOptionsDialog) { m_pOptionsDialog->deleteLater(); - m_pOptionsDialog=0; + m_pOptionsDialog = 0; } g_pScriptEditorWindowList->removeRef(this); if(g_pScriptEditorWindowList->isEmpty()) @@ -863,17 +875,17 @@ void ScriptEditorImplementation::loadOptions() QString szTmp; g_pEditorModulePointer->getDefaultConfigFileName(szTmp); - KviConfigurationFile cfg(szTmp,KviConfigurationFile::Read); - g_clrBackground = cfg.readColorEntry("Background",QColor(0,0,0)); - g_clrNormalText = cfg.readColorEntry("NormalText",QColor(100,255,0)); - g_clrBracket = cfg.readColorEntry("Bracket",QColor(255,0,0)); - g_clrComment = cfg.readColorEntry("Comment",QColor(0,120,0)); - g_clrFunction = cfg.readColorEntry("Function",QColor(255,255,0)); - g_clrKeyword = cfg.readColorEntry("Keyword",QColor(120,120,150)); - g_clrVariable = cfg.readColorEntry("Variable",QColor(200,200,200)); - g_clrPunctuation = cfg.readColorEntry("Punctuation",QColor(180,180,0)); - g_clrFind = cfg.readColorEntry("Find",QColor(255,0,0)); - g_fntNormal = cfg.readFontEntry("Font",QFont(KVI_SCRIPTEDITOR_DEFAULT_FONT,KVI_SCRIPTEDITOR_DEFAULT_FONT_SIZE)); + KviConfigurationFile cfg(szTmp, KviConfigurationFile::Read); + g_clrBackground = cfg.readColorEntry("Background", QColor(0, 0, 0)); + g_clrNormalText = cfg.readColorEntry("NormalText", QColor(100, 255, 0)); + g_clrBracket = cfg.readColorEntry("Bracket", QColor(255, 0, 0)); + g_clrComment = cfg.readColorEntry("Comment", QColor(0, 120, 0)); + g_clrFunction = cfg.readColorEntry("Function", QColor(255, 255, 0)); + g_clrKeyword = cfg.readColorEntry("Keyword", QColor(120, 120, 150)); + g_clrVariable = cfg.readColorEntry("Variable", QColor(200, 200, 200)); + g_clrPunctuation = cfg.readColorEntry("Punctuation", QColor(180, 180, 0)); + g_clrFind = cfg.readColorEntry("Find", QColor(255, 0, 0)); + g_fntNormal = cfg.readFontEntry("Font", QFont(KVI_SCRIPTEDITOR_DEFAULT_FONT, KVI_SCRIPTEDITOR_DEFAULT_FONT_SIZE)); } bool ScriptEditorImplementation::isModified() @@ -891,7 +903,7 @@ void ScriptEditorImplementation::slotFind() void ScriptEditorImplementation::slotNextFind(const QString &) //szText { -// emit nextFind(const QString & szText); + // emit nextFind(const QString & szText); } void ScriptEditorImplementation::slotInitFind() @@ -901,7 +913,7 @@ void ScriptEditorImplementation::slotInitFind() void ScriptEditorImplementation::slotReplaceAll(const QString & szToReplace, const QString & szReplaceWith) { - emit replaceAll(szToReplace,szReplaceWith); + emit replaceAll(szToReplace, szReplaceWith); } void ScriptEditorImplementation::saveOptions() @@ -909,17 +921,17 @@ void ScriptEditorImplementation::saveOptions() QString szTmp; g_pEditorModulePointer->getDefaultConfigFileName(szTmp); - KviConfigurationFile cfg(szTmp,KviConfigurationFile::Write); - cfg.writeEntry("Background",g_clrBackground); - cfg.writeEntry("NormalText",g_clrNormalText); - cfg.writeEntry("Bracket",g_clrBracket); - cfg.writeEntry("Comment",g_clrComment); - cfg.writeEntry("Function",g_clrFunction); - cfg.writeEntry("Keyword",g_clrKeyword); - cfg.writeEntry("Variable",g_clrVariable); - cfg.writeEntry("Punctuation",g_clrPunctuation); - cfg.writeEntry("Find",g_clrFind); - cfg.writeEntry("Font",g_fntNormal); + KviConfigurationFile cfg(szTmp, KviConfigurationFile::Write); + cfg.writeEntry("Background", g_clrBackground); + cfg.writeEntry("NormalText", g_clrNormalText); + cfg.writeEntry("Bracket", g_clrBracket); + cfg.writeEntry("Comment", g_clrComment); + cfg.writeEntry("Function", g_clrFunction); + cfg.writeEntry("Keyword", g_clrKeyword); + cfg.writeEntry("Variable", g_clrVariable); + cfg.writeEntry("Punctuation", g_clrPunctuation); + cfg.writeEntry("Find", g_clrFind); + cfg.writeEntry("Font", g_fntNormal); } void ScriptEditorImplementation::setFocus() @@ -943,20 +955,20 @@ void ScriptEditorImplementation::saveToFile() { QString szFileName; if(KviFileDialog::askForSaveFileName(szFileName, - __tr2qs_ctx("Choose a Filename - KVIrc","editor"), - QString::null, - QString::null,false,true,true,this)) + __tr2qs_ctx("Choose a Filename - KVIrc", "editor"), + QString::null, + QString::null, false, true, true, this)) { QString szBuffer = m_pEditor->toPlainText(); //if(tmp.isEmpty())tmp = ""; //KviCString buffer = tmp.toUtf8().data(); - if(!KviFileUtils::writeFile(szFileName,szBuffer)) + if(!KviFileUtils::writeFile(szFileName, szBuffer)) { QString szTmp; QMessageBox::warning(this, - __tr2qs_ctx("Writing to File Failed - KVIrc","editor"), - szTmp = QString(__tr2qs_ctx("Can't open file %1 for writing.","editor")).arg(szFileName)); + __tr2qs_ctx("Writing to File Failed - KVIrc", "editor"), + szTmp = QString(__tr2qs_ctx("Can't open file %1 for writing.", "editor")).arg(szFileName)); } } } @@ -989,7 +1001,7 @@ void ScriptEditorImplementation::setText(const QString & szText) { m_pEditor->enableSyntaxHighlighter(); m_pEditor->setPlainText(szText); - QTextCursor cur=m_pEditor->textCursor(); + QTextCursor cur = m_pEditor->textCursor(); cur.movePosition(QTextCursor::End); m_pEditor->setTextCursor(cur); m_pEditor->document()->setModified(false); @@ -1009,11 +1021,11 @@ void ScriptEditorImplementation::setFindText(const QString & szText) void ScriptEditorImplementation::updateRowColLabel() { - if(m_lastCursorPos==m_pEditor->textCursor().position()) + if(m_lastCursorPos == m_pEditor->textCursor().position()) return; int iRow = m_pEditor->textCursor().blockNumber(); int iCol = m_pEditor->textCursor().columnNumber(); - QString szTmp = QString(__tr2qs_ctx("Row: %1 Col: %2","editor")).arg(iRow).arg(iCol); + QString szTmp = QString(__tr2qs_ctx("Row: %1 Col: %2", "editor")).arg(iRow).arg(iCol); m_pRowColLabel->setText(szTmp); m_lastCursorPos = m_pEditor->textCursor().position(); } @@ -1030,21 +1042,23 @@ void ScriptEditorImplementation::loadFromFile() { QString szFileName; if(KviFileDialog::askForOpenFileName(szFileName, - __tr2qs_ctx("Select a File - KVIrc","editor"), - QString::null,KVI_FILTER_SCRIPT,false,true,this)) + __tr2qs_ctx("Select a File - KVIrc", "editor"), + QString::null, KVI_FILTER_SCRIPT, false, true, this)) { QString szBuffer; - if(KviFileUtils::loadFile(szFileName,szBuffer)) + if(KviFileUtils::loadFile(szFileName, szBuffer)) { - m_pEditor->setPlainText(szBuffer); + m_pEditor->setPlainText(szBuffer); setCursorPosition(0); //m_pEditor->moveCursor(QTextEdit::MoveEnd,false); //updateRowColLabel(); - } else { + } + else + { QString szTmp; QMessageBox::warning(this, - __tr2qs_ctx("Opening File Failed - KVIrc","editor"), - szTmp = QString(__tr2qs_ctx("Can't open file %1 for reading.","editor")).arg(szFileName)); + __tr2qs_ctx("Opening File Failed - KVIrc", "editor"), + szTmp = QString(__tr2qs_ctx("Can't open file %1 for reading.", "editor")).arg(szFileName)); } } } @@ -1054,7 +1068,7 @@ void ScriptEditorImplementation::configureColors() if(!m_pOptionsDialog) { m_pOptionsDialog = new ScriptEditorWidgetColorOptions(this); - connect(m_pOptionsDialog,SIGNAL(finished(int)),this,SLOT(optionsDialogFinished(int))); + connect(m_pOptionsDialog, SIGNAL(finished(int)), this, SLOT(optionsDialogFinished(int))); } m_pOptionsDialog->show(); } @@ -1069,7 +1083,7 @@ void ScriptEditorImplementation::optionsDialogFinished(int iResult) } ScriptEditorReplaceDialog::ScriptEditorReplaceDialog(QWidget * pParent, const QString & szName) -: QDialog(pParent) + : QDialog(pParent) { setObjectName(szName); setWindowTitle(__tr2qs("Find and Replace - KVIrc")); @@ -1077,8 +1091,8 @@ ScriptEditorReplaceDialog::ScriptEditorReplaceDialog(QWidget * pParent, const QS m_pParent = pParent; emit initFind(); QPalette p = palette(); - p.setColor(foregroundRole(),QColor( 0, 0, 0 )); - p.setColor(backgroundRole(),QColor( 236, 233, 216 )); + p.setColor(foregroundRole(), QColor(0, 0, 0)); + p.setColor(backgroundRole(), QColor(236, 233, 216)); setPalette(p); QGridLayout * pLayout = new QGridLayout(this); @@ -1086,40 +1100,39 @@ ScriptEditorReplaceDialog::ScriptEditorReplaceDialog(QWidget * pParent, const QS QLabel * m_pFindLabel = new QLabel(this); m_pFindLabel->setObjectName("findlabel"); - m_pFindLabel->setText(__tr2qs_ctx("Word to find:","editor")); - pLayout->addWidget(m_pFindLabel,0,0); + m_pFindLabel->setText(__tr2qs_ctx("Word to find:", "editor")); + pLayout->addWidget(m_pFindLabel, 0, 0); m_pFindLineEdit = new QLineEdit(this); m_pFindLineEdit->setObjectName("findlineedit"); - pLayout->addWidget(m_pFindLineEdit,0,1); + pLayout->addWidget(m_pFindLineEdit, 0, 1); QLabel * m_pReplaceLabel = new QLabel(this); m_pReplaceLabel->setObjectName("replacelabel"); - m_pReplaceLabel->setText(__tr2qs_ctx("Replace with:","editor")); - pLayout->addWidget(m_pReplaceLabel,1,0); + m_pReplaceLabel->setText(__tr2qs_ctx("Replace with:", "editor")); + pLayout->addWidget(m_pReplaceLabel, 1, 0); m_pReplaceLineEdit = new QLineEdit(this); m_pReplaceLineEdit->setObjectName("replacelineedit"); - pLayout->addWidget(m_pReplaceLineEdit,1,1); - + pLayout->addWidget(m_pReplaceLineEdit, 1, 1); m_pFindLineEdit->setFocus(); m_pCheckReplaceAll = new QCheckBox(this); m_pCheckReplaceAll->setObjectName("replaceAll"); - m_pCheckReplaceAll->setText(__tr2qs_ctx("&Replace in all editor's items","editor")); - pLayout->addWidget(m_pCheckReplaceAll,2,0); + m_pCheckReplaceAll->setText(__tr2qs_ctx("&Replace in all editor's items", "editor")); + pLayout->addWidget(m_pCheckReplaceAll, 2, 0); QPushButton * pCancelButton = new QPushButton(this); pCancelButton->setObjectName("cancelButton"); - pCancelButton->setText(__tr2qs_ctx("&Cancel","editor")); - pLayout->addWidget(pCancelButton,3,0); + pCancelButton->setText(__tr2qs_ctx("&Cancel", "editor")); + pLayout->addWidget(pCancelButton, 3, 0); m_pReplaceButton = new QPushButton(this); m_pReplaceButton->setObjectName("replacebutton"); - m_pReplaceButton->setText(__tr2qs_ctx("&Replace","editor")); + m_pReplaceButton->setText(__tr2qs_ctx("&Replace", "editor")); m_pReplaceButton->setEnabled(false); - pLayout->addWidget(m_pReplaceButton,3,1); + pLayout->addWidget(m_pReplaceButton, 3, 1); setLayout(pLayout); @@ -1145,14 +1158,14 @@ void ScriptEditorReplaceDialog::slotReplace() { QString szText = ((ScriptEditorWidget *)m_pParent)->toPlainText(); if(m_pCheckReplaceAll->isChecked()) - emit replaceAll(m_pFindLineEdit->text(),m_pReplaceLineEdit->text()); + emit replaceAll(m_pFindLineEdit->text(), m_pReplaceLineEdit->text()); - szText.replace(m_pFindLineEdit->text(),m_pReplaceLineEdit->text(),Qt::CaseInsensitive); + szText.replace(m_pFindLineEdit->text(), m_pReplaceLineEdit->text(), Qt::CaseInsensitive); ((ScriptEditorWidget *)m_pParent)->setText(szText); ((ScriptEditorWidget *)m_pParent)->document()->setModified(true); m_pFindLineEdit->setText(""); m_pReplaceLineEdit->setText(""); - setTabOrder(m_pFindLineEdit,m_pReplaceLineEdit); + setTabOrder(m_pFindLineEdit, m_pReplaceLineEdit); } void ScriptEditorReplaceDialog::slotNextFind() diff --git a/src/modules/editor/ScriptEditorImplementation.h b/src/modules/editor/ScriptEditorImplementation.h index ce22c98ba..f1d55fe2e 100644 --- a/src/modules/editor/ScriptEditorImplementation.h +++ b/src/modules/editor/ScriptEditorImplementation.h @@ -51,23 +51,26 @@ class ScriptEditorWidget : public QTextEdit public: ScriptEditorWidget(QWidget * pParent); virtual ~ScriptEditorWidget(); + public: QString m_szFind; + protected: ScriptEditorSyntaxHighlighter * m_pSyntaxHighlighter; - QCompleter * m_pCompleter; + QCompleter * m_pCompleter; QStringList * m_pListModulesNames; QStringList * m_pListCompletition; - QTimer * m_pStartTimer; - QWidget * m_pParent; - int iIndex,iModulesCount; - QString m_szHelp; + QTimer * m_pStartTimer; + QWidget * m_pParent; + int iIndex, iModulesCount; + QString m_szHelp; + public: - ScriptEditorSyntaxHighlighter * syntaxHighlighter(){return m_pSyntaxHighlighter;}; + ScriptEditorSyntaxHighlighter * syntaxHighlighter() { return m_pSyntaxHighlighter; }; void disableSyntaxHighlighter(); void enableSyntaxHighlighter(); - void createCompleter(QStringList &list); + void createCompleter(QStringList & list); void loadCompleterFromFile(); QCompleter * completer() const { return m_pCompleter; }; @@ -85,10 +88,11 @@ protected slots: void asyncCompleterCreation(); signals: void keyPressed(); + protected: void contextMenuEvent(QContextMenuEvent * e); virtual void keyPressEvent(QKeyEvent * e); -// void mouseReleaseEvent(QMouseEvent * e); + // void mouseReleaseEvent(QMouseEvent * e); }; class ScriptEditorWidgetColorOptions : public QDialog @@ -97,14 +101,15 @@ class ScriptEditorWidgetColorOptions : public QDialog public: ScriptEditorWidgetColorOptions(QWidget * pParent); ~ScriptEditorWidgetColorOptions(); + private: KviPointerList * m_pSelectorInterfaceList; + protected: - KviColorSelector * addColorSelector(QWidget * pParent,const QString & txt,QColor * pOption,bool bEnabled); + KviColorSelector * addColorSelector(QWidget * pParent, const QString & txt, QColor * pOption, bool bEnabled); protected slots: void okClicked(); - }; class ScriptEditorSyntaxHighlighter : public QSyntaxHighlighter @@ -112,12 +117,15 @@ class ScriptEditorSyntaxHighlighter : public QSyntaxHighlighter public: ScriptEditorSyntaxHighlighter(ScriptEditorWidget * pWidget); virtual ~ScriptEditorSyntaxHighlighter(); + public: QTextEdit * m_pTextEdit; + public: - QTextEdit * textEdit(){ return m_pTextEdit; } + QTextEdit * textEdit() { return m_pTextEdit; } void highlightBlock(const QString & szText); void updateSyntaxtTextFormat(); + private: struct KviScriptHighlightingRule { @@ -145,13 +153,16 @@ class ScriptEditorImplementation : public KviScriptEditor public: ScriptEditorImplementation(QWidget * par); virtual ~ScriptEditorImplementation(); + public: QLineEdit * m_pFindLineEdit; + protected: ScriptEditorWidgetColorOptions * m_pOptionsDialog; ScriptEditorWidget * m_pEditor; - QLabel * m_pRowColLabel; - int m_lastCursorPos; + QLabel * m_pRowColLabel; + int m_lastCursorPos; + public: virtual void setText(const char * txt); virtual void setText(const QString & szText); @@ -163,15 +174,14 @@ public: virtual void setReadOnly(bool bReadOnly); void setUnHighlightedText(const QString & szText); - virtual void setFocus(); virtual bool isModified(); virtual void setModified(bool); - int getCursor(){return m_pEditor->textCursor().position();}; + int getCursor() { return m_pEditor->textCursor().position(); }; void setCursorPosition(int iPos); - int cursor(){ return m_lastCursorPos; }; - QLineEdit * findLineEdit(){ return m_pFindLineEdit; }; + int cursor() { return m_lastCursorPos; }; + QLineEdit * findLineEdit() { return m_pFindLineEdit; }; protected: virtual void focusInEvent(QFocusEvent * e); void loadOptions(); @@ -193,19 +203,21 @@ signals: void nextFind(const QString & szText); }; -class ScriptEditorReplaceDialog: public QDialog +class ScriptEditorReplaceDialog : public QDialog { Q_OBJECT public: ScriptEditorReplaceDialog(QWidget * parent = 0, const QString & szName = QString()); ~ScriptEditorReplaceDialog(); + public: QLineEdit * m_pFindLineEdit; QLineEdit * m_pReplaceLineEdit; + protected: QPushButton * m_pReplaceButton; - QCheckBox * m_pCheckReplaceAll; - QWidget * m_pParent; + QCheckBox * m_pCheckReplaceAll; + QWidget * m_pParent; protected slots: void textChanged(const QString &); void slotReplace(); diff --git a/src/modules/editor/libkvieditor.cpp b/src/modules/editor/libkvieditor.cpp index 5b3b15ba2..1a71de977 100644 --- a/src/modules/editor/libkvieditor.cpp +++ b/src/modules/editor/libkvieditor.cpp @@ -27,7 +27,6 @@ #include "KviModule.h" #include "KviWindow.h" - KviModule * g_pEditorModulePointer = 0; KviPointerList * g_pScriptEditorWindowList = 0; @@ -59,12 +58,12 @@ static bool editor_module_cleanup(KviModule *) //qDebug("%s %s %i %s",__FILE__,__FUNCTION__,__LINE__,w->className()); if(w->inherits("KviWindow")) { - // qDebug("%s %s %i",__FILE__,__FUNCTION__,__LINE__); + // qDebug("%s %s %i",__FILE__,__FUNCTION__,__LINE__); //((KviWindow *)w)->close(); - // qDebug("%s %s %i",__FILE__,__FUNCTION__,__LINE__); + // qDebug("%s %s %i",__FILE__,__FUNCTION__,__LINE__); break; } - w = w->parent(); + w = w->parent(); } delete g_pScriptEditorWindowList->first(); } @@ -81,16 +80,15 @@ static bool editor_module_can_unload(KviModule *) } KVIRC_MODULE( - "Editor", // module name - "4.0.0", // module version - "Copyright (C) 2000 Szymon Stefanek (pragma at kvirc dot net)", // author & (C) - "Text editor extension", - editor_module_init, - editor_module_can_unload, - 0, - editor_module_cleanup, - "editor" -) + "Editor", // module name + "4.0.0", // module version + "Copyright (C) 2000 Szymon Stefanek (pragma at kvirc dot net)", // author & (C) + "Text editor extension", + editor_module_init, + editor_module_can_unload, + 0, + editor_module_cleanup, + "editor") // We want C linkage on this one: we want to be able to dlsym() it with a simple name // FIXME: Is this portable enough ? Or is better to have a table entry ? @@ -102,5 +100,5 @@ KVIMODULEEXPORTFUNC KviScriptEditor * editor_module_createScriptEditor(QWidget * KVIMODULEEXPORTFUNC void editor_module_destroyScriptEditor(KviScriptEditor * e) { - delete ((ScriptEditorImplementation *)e); + delete((ScriptEditorImplementation *)e); } diff --git a/src/modules/eventeditor/EventEditorWindow.cpp b/src/modules/eventeditor/EventEditorWindow.cpp index 75e2771c0..8136f69d9 100644 --- a/src/modules/eventeditor/EventEditorWindow.cpp +++ b/src/modules/eventeditor/EventEditorWindow.cpp @@ -50,49 +50,49 @@ extern EventEditorWindow * g_pEventEditorWindow; -EventEditorEventTreeWidgetItem::EventEditorEventTreeWidgetItem(QTreeWidget * par,unsigned int uEvIdx,const QString &name,const QString ¶ms) -: QTreeWidgetItem(par), m_uEventIdx(uEvIdx), m_szParams(params) +EventEditorEventTreeWidgetItem::EventEditorEventTreeWidgetItem(QTreeWidget * par, unsigned int uEvIdx, const QString & name, const QString & params) + : QTreeWidgetItem(par), m_uEventIdx(uEvIdx), m_szParams(params) { setName(name); } -void EventEditorEventTreeWidgetItem::setName(const QString &szName) +void EventEditorEventTreeWidgetItem::setName(const QString & szName) { m_szName = szName; - setText(0,m_szName); + setText(0, m_szName); } -EventEditorHandlerTreeWidgetItem::EventEditorHandlerTreeWidgetItem(QTreeWidgetItem * par,const QString &name,const QString &buffer,bool bEnabled) -: QTreeWidgetItem(par), m_szBuffer(buffer) +EventEditorHandlerTreeWidgetItem::EventEditorHandlerTreeWidgetItem(QTreeWidgetItem * par, const QString & name, const QString & buffer, bool bEnabled) + : QTreeWidgetItem(par), m_szBuffer(buffer) { - m_cPos=0; + m_cPos = 0; setEnabled(bEnabled); //this updates the icon too setName(name); } -void EventEditorHandlerTreeWidgetItem::setName(const QString &szName) +void EventEditorHandlerTreeWidgetItem::setName(const QString & szName) { m_szName = szName; - setText(0,m_szName); + setText(0, m_szName); } void EventEditorHandlerTreeWidgetItem::setEnabled(const bool bEnabled) { m_bEnabled = bEnabled; - setIcon(0,QIcon(*(g_pIconManager->getSmallIcon(m_bEnabled ? KviIconManager::Handler : KviIconManager::HandlerDisabled)))); + setIcon(0, QIcon(*(g_pIconManager->getSmallIcon(m_bEnabled ? KviIconManager::Handler : KviIconManager::HandlerDisabled)))); } EventEditor::EventEditor(QWidget * par) -: QWidget(par) + : QWidget(par) { setObjectName("event_editor"); QGridLayout * l = new QGridLayout(this); - QSplitter * spl = new QSplitter(Qt::Horizontal,this); + QSplitter * spl = new QSplitter(Qt::Horizontal, this); spl->setChildrenCollapsible(false); - l->addWidget(spl,0,0); + l->addWidget(spl, 0, 0); KviTalVBox * vbox = new KviTalVBox(spl); vbox->setSpacing(0); @@ -100,18 +100,18 @@ EventEditor::EventEditor(QWidget * par) m_pTreeWidget = new EventEditorTreeWidget(vbox); - QPushButton * pb = new QPushButton(__tr2qs_ctx("&Export All to...","editor"),vbox); - connect(pb,SIGNAL(clicked()),this,SLOT(exportAllEvents())); + QPushButton * pb = new QPushButton(__tr2qs_ctx("&Export All to...", "editor"), vbox); + connect(pb, SIGNAL(clicked()), this, SLOT(exportAllEvents())); KviTalVBox * box = new KviTalVBox(spl); - spl->setStretchFactor (1,20); - spl->setStretchFactor (2,80); + spl->setStretchFactor(1, 20); + spl->setStretchFactor(2, 80); box->setSpacing(0); box->setMargin(0); m_pNameEditor = new QLineEdit(box); - m_pNameEditor->setToolTip(__tr2qs_ctx("Edit the event handler name.","editor")); + m_pNameEditor->setToolTip(__tr2qs_ctx("Edit the event handler name.", "editor")); m_pEditor = KviScriptEditor::createInstance(box); m_pEditor->setFocus(); @@ -126,81 +126,82 @@ EventEditor::~EventEditor() void EventEditor::oneTimeSetup() { - if(m_bOneTimeSetupDone)return; + if(m_bOneTimeSetupDone) + return; m_bOneTimeSetupDone = true; EventEditorEventTreeWidgetItem * it; - for(unsigned int i = 0;i < KVI_KVS_NUM_APP_EVENTS;i++) + for(unsigned int i = 0; i < KVI_KVS_NUM_APP_EVENTS; i++) { KviKvsEvent * e = KviKvsEventManager::instance()->appEvent(i); - it = new EventEditorEventTreeWidgetItem(m_pTreeWidget,i,e->name(),e->parameterDescription()); + it = new EventEditorEventTreeWidgetItem(m_pTreeWidget, i, e->name(), e->parameterDescription()); if(KviPointerList * l = e->handlers()) { - for(KviKvsEventHandler * s = l->first();s;s = l->next()) + for(KviKvsEventHandler * s = l->first(); s; s = l->next()) { if(s->type() == KviKvsEventHandler::Script) { - new EventEditorHandlerTreeWidgetItem(it,((KviKvsScriptEventHandler *)s)->name(), - ((KviKvsScriptEventHandler *)s)->code(),((KviKvsScriptEventHandler *)s)->isEnabled()); + new EventEditorHandlerTreeWidgetItem(it, ((KviKvsScriptEventHandler *)s)->name(), + ((KviKvsScriptEventHandler *)s)->code(), ((KviKvsScriptEventHandler *)s)->isEnabled()); } } } - it->setIcon(0,QIcon(*(g_pIconManager->getSmallIcon(it->childCount() ? KviIconManager::Event : KviIconManager::EventNoHandlers)))); + it->setIcon(0, QIcon(*(g_pIconManager->getSmallIcon(it->childCount() ? KviIconManager::Event : KviIconManager::EventNoHandlers)))); } - connect(m_pTreeWidget,SIGNAL(currentItemChanged(QTreeWidgetItem *,QTreeWidgetItem *)),this,SLOT(currentItemChanged(QTreeWidgetItem *,QTreeWidgetItem *))); - connect(m_pTreeWidget,SIGNAL(rightButtonPressed(QTreeWidgetItem *,QPoint)), - this,SLOT(itemPressed(QTreeWidgetItem *,QPoint))); - connect(KviKvsEventManager::instance(),SIGNAL(eventHandlerDisabled(const QString &)),this,SLOT(eventHandlerDisabled(const QString &))); + connect(m_pTreeWidget, SIGNAL(currentItemChanged(QTreeWidgetItem *, QTreeWidgetItem *)), this, SLOT(currentItemChanged(QTreeWidgetItem *, QTreeWidgetItem *))); + connect(m_pTreeWidget, SIGNAL(rightButtonPressed(QTreeWidgetItem *, QPoint)), + this, SLOT(itemPressed(QTreeWidgetItem *, QPoint))); + connect(KviKvsEventManager::instance(), SIGNAL(eventHandlerDisabled(const QString &)), this, SLOT(eventHandlerDisabled(const QString &))); m_pContextPopup = new QMenu(this); - m_pTreeWidget->sortItems(0,Qt::AscendingOrder); + m_pTreeWidget->sortItems(0, Qt::AscendingOrder); } -void EventEditor::eventHandlerDisabled(const QString &szHandler) +void EventEditor::eventHandlerDisabled(const QString & szHandler) { - QString szEventName=szHandler.split("::")[0]; - QString szHandlerName=szHandler.split("::")[1]; - qDebug("Handler %s of event %s : disabled",szHandlerName.toUtf8().data(),szEventName.toUtf8().data()); - for(int i=0;itopLevelItemCount();i++) - { - EventEditorEventTreeWidgetItem *pItem=(EventEditorEventTreeWidgetItem*)m_pTreeWidget->topLevelItem(i); - if(!KviQString::equalCI(szEventName,pItem->name())) continue; - for(int j=0;jchildCount();j++) - { - if(KviQString::equalCI(szHandlerName,((EventEditorHandlerTreeWidgetItem *)pItem->child(j))->name())) - { - ((EventEditorHandlerTreeWidgetItem *)pItem->child(j))->setEnabled(false); - return; - } - - } - } - + QString szEventName = szHandler.split("::")[0]; + QString szHandlerName = szHandler.split("::")[1]; + qDebug("Handler %s of event %s : disabled", szHandlerName.toUtf8().data(), szEventName.toUtf8().data()); + for(int i = 0; i < m_pTreeWidget->topLevelItemCount(); i++) + { + EventEditorEventTreeWidgetItem * pItem = (EventEditorEventTreeWidgetItem *)m_pTreeWidget->topLevelItem(i); + if(!KviQString::equalCI(szEventName, pItem->name())) + continue; + for(int j = 0; j < pItem->childCount(); j++) + { + if(KviQString::equalCI(szHandlerName, ((EventEditorHandlerTreeWidgetItem *)pItem->child(j))->name())) + { + ((EventEditorHandlerTreeWidgetItem *)pItem->child(j))->setEnabled(false); + return; + } + } + } } EventEditorTreeWidget::EventEditorTreeWidget(QWidget * par) -: QTreeWidget(par) + : QTreeWidget(par) { - setColumnCount (1); - setHeaderLabel(__tr2qs_ctx("Event","editor")); + setColumnCount(1); + setHeaderLabel(__tr2qs_ctx("Event", "editor")); setSelectionMode(QAbstractItemView::ExtendedSelection); setSortingEnabled(true); setRootIsDecorated(true); setAnimated(true); } -void EventEditorTreeWidget::mousePressEvent (QMouseEvent *e) +void EventEditorTreeWidget::mousePressEvent(QMouseEvent * e) { - if (e->button() == Qt::RightButton) + if(e->button() == Qt::RightButton) { - QTreeWidgetItem *i=itemAt(e->pos()); - if (i) emit rightButtonPressed(i,QCursor::pos()); + QTreeWidgetItem * i = itemAt(e->pos()); + if(i) + emit rightButtonPressed(i, QCursor::pos()); } QTreeWidget::mousePressEvent(e); } -void EventEditor::itemPressed(QTreeWidgetItem *it,const QPoint &pnt) +void EventEditor::itemPressed(QTreeWidgetItem * it, const QPoint & pnt) { KVI_ASSERT(m_bOneTimeSetupDone); @@ -212,38 +213,41 @@ void EventEditor::itemPressed(QTreeWidgetItem *it,const QPoint &pnt) QString tmp; if(!(((EventEditorHandlerTreeWidgetItem *)it)->m_bEnabled)) m_pContextPopup->addAction( - *(g_pIconManager->getSmallIcon(KviIconManager::Handler)), - __tr2qs_ctx("&Enable Handler","editor"),this,SLOT(toggleCurrentHandlerEnabled())); + *(g_pIconManager->getSmallIcon(KviIconManager::Handler)), + __tr2qs_ctx("&Enable Handler", "editor"), this, SLOT(toggleCurrentHandlerEnabled())); else m_pContextPopup->addAction( - *(g_pIconManager->getSmallIcon(KviIconManager::HandlerDisabled)), - __tr2qs_ctx("&Disable Handler","editor"),this,SLOT(toggleCurrentHandlerEnabled())); + *(g_pIconManager->getSmallIcon(KviIconManager::HandlerDisabled)), + __tr2qs_ctx("&Disable Handler", "editor"), this, SLOT(toggleCurrentHandlerEnabled())); m_pContextPopup->addAction( - *(g_pIconManager->getSmallIcon(KviIconManager::Discard)), - __tr2qs_ctx("Re&move Handler","editor"), - this,SLOT(removeCurrentHandler())); + *(g_pIconManager->getSmallIcon(KviIconManager::Discard)), + __tr2qs_ctx("Re&move Handler", "editor"), + this, SLOT(removeCurrentHandler())); m_pContextPopup->addAction( - *(g_pIconManager->getSmallIcon(KviIconManager::Save)), - __tr2qs_ctx("&Export Handler to...","editor"), - this,SLOT(exportCurrentHandler())); - } else { + *(g_pIconManager->getSmallIcon(KviIconManager::Save)), + __tr2qs_ctx("&Export Handler to...", "editor"), + this, SLOT(exportCurrentHandler())); + } + else + { m_pContextPopup->addAction( - *(g_pIconManager->getSmallIcon(KviIconManager::Handler)), - __tr2qs_ctx("&New Handler","editor"), - this,SLOT(addHandlerForCurrentEvent())); + *(g_pIconManager->getSmallIcon(KviIconManager::Handler)), + __tr2qs_ctx("&New Handler", "editor"), + this, SLOT(addHandlerForCurrentEvent())); } m_pContextPopup->popup(pnt); } } -void EventEditor::getUniqueHandlerName(EventEditorEventTreeWidgetItem *it,QString &buffer) +void EventEditor::getUniqueHandlerName(EventEditorEventTreeWidgetItem * it, QString & buffer) { KVI_ASSERT(m_bOneTimeSetupDone); QString newName = buffer; - if(newName.isEmpty())newName = __tr2qs_ctx("unnamed","editor"); + if(newName.isEmpty()) + newName = __tr2qs_ctx("unnamed", "editor"); bool bFound = true; int idx = 1; @@ -252,10 +256,10 @@ void EventEditor::getUniqueHandlerName(EventEditorEventTreeWidgetItem *it,QStrin { bFound = false; - for(int i=0;ichildCount();i++) + for(int i = 0; i < it->childCount(); i++) //for(EventEditorHandlerTreeWidgetItem * ch = (EventEditorHandlerTreeWidgetItem *)(it->firstChild());ch;ch = (EventEditorHandlerTreeWidgetItem *)ch->nextSibling()) { - if(KviQString::equalCI(newName,((EventEditorHandlerTreeWidgetItem *)it->child(i))->m_szName)) + if(KviQString::equalCI(newName, ((EventEditorHandlerTreeWidgetItem *)it->child(i))->m_szName)) { bFound = true; newName = QString("%1_%2").arg(buffer).arg(idx); @@ -278,12 +282,12 @@ void EventEditor::addHandlerForCurrentEvent() if(it->parent() == 0) { - if(it->childCount()==0) - it->setIcon(0,QIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Event)))); + if(it->childCount() == 0) + it->setIcon(0, QIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Event)))); - QString buffer = __tr2qs_ctx("default","editor"); - getUniqueHandlerName((EventEditorEventTreeWidgetItem *)it,buffer); - QTreeWidgetItem * ch = new EventEditorHandlerTreeWidgetItem(it,buffer,"",true); + QString buffer = __tr2qs_ctx("default", "editor"); + getUniqueHandlerName((EventEditorEventTreeWidgetItem *)it, buffer); + QTreeWidgetItem * ch = new EventEditorHandlerTreeWidgetItem(it, buffer, "", true); it->setExpanded(true); ch->setSelected(true); } @@ -302,8 +306,8 @@ void EventEditor::removeCurrentHandler() if(parent) { - if(parent->childCount()==0) - parent->setIcon(0,QIcon(*(g_pIconManager->getSmallIcon(KviIconManager::EventNoHandlers)))); + if(parent->childCount() == 0) + parent->setIcon(0, QIcon(*(g_pIconManager->getSmallIcon(KviIconManager::EventNoHandlers)))); } m_pEditor->setEnabled(false); @@ -318,19 +322,20 @@ void EventEditor::toggleCurrentHandlerEnabled() { m_pLastEditedItem->setEnabled(!(m_pLastEditedItem->m_bEnabled)); m_pTreeWidget->repaint(m_pTreeWidget->visualItemRect(m_pLastEditedItem)); - currentItemChanged(m_pLastEditedItem,0); + currentItemChanged(m_pLastEditedItem, 0); } } void EventEditor::commit() { - if(!m_bOneTimeSetupDone)return; // nothing to commit + if(!m_bOneTimeSetupDone) + return; // nothing to commit saveLastEditedItem(); KviKvsEventManager::instance()->removeAllScriptAppHandlers(); - int count=m_pTreeWidget->topLevelItemCount(); - for (int i=0;itopLevelItemCount(); + for(int i = 0; i < count; i++) { QTreeWidgetItem * it = m_pTreeWidget->topLevelItem(i); int ccount = it->childCount(); @@ -338,18 +343,17 @@ void EventEditor::commit() { QString szContext; - for(int j=0;jchild(j); - szContext = QString("%1::%2").arg(((EventEditorEventTreeWidgetItem *)it)->m_szName,((EventEditorHandlerTreeWidgetItem *)ch)->m_szName); + szContext = QString("%1::%2").arg(((EventEditorEventTreeWidgetItem *)it)->m_szName, ((EventEditorHandlerTreeWidgetItem *)ch)->m_szName); KviKvsScriptEventHandler * s = KviKvsScriptEventHandler::createInstance( // msvc workaround - ((EventEditorHandlerTreeWidgetItem *)ch)->m_szName, - szContext, - ((EventEditorHandlerTreeWidgetItem *)ch)->m_szBuffer, - ((EventEditorHandlerTreeWidgetItem *)ch)->m_bEnabled - ); + ((EventEditorHandlerTreeWidgetItem *)ch)->m_szName, + szContext, + ((EventEditorHandlerTreeWidgetItem *)ch)->m_szBuffer, + ((EventEditorHandlerTreeWidgetItem *)ch)->m_bEnabled); - KviKvsEventManager::instance()->addAppHandler(((EventEditorEventTreeWidgetItem *)it)->m_uEventIdx,s); + KviKvsEventManager::instance()->addAppHandler(((EventEditorEventTreeWidgetItem *)it)->m_uEventIdx, s); } } } @@ -360,14 +364,15 @@ void EventEditor::commit() void EventEditor::saveLastEditedItem() { KVI_ASSERT(m_bOneTimeSetupDone); - if(!m_pLastEditedItem)return; + if(!m_pLastEditedItem) + return; ((EventEditorHandlerTreeWidgetItem *)m_pLastEditedItem)->setCursorPosition(m_pEditor->getCursor()); QString buffer = m_pNameEditor->text(); //not-so elaborate fix for #218, we'd better rework this buffer.replace(QRegExp("[^A-Za-z0-9_]"), ""); - if(!KviQString::equalCI(buffer,m_pLastEditedItem->m_szName)) + if(!KviQString::equalCI(buffer, m_pLastEditedItem->m_szName)) { - getUniqueHandlerName((EventEditorEventTreeWidgetItem *)(m_pLastEditedItem->parent()),buffer); + getUniqueHandlerName((EventEditorEventTreeWidgetItem *)(m_pLastEditedItem->parent()), buffer); } m_pLastEditedItem->setName(buffer); @@ -377,14 +382,14 @@ void EventEditor::saveLastEditedItem() m_pLastEditedItem->m_szBuffer = tmp; } -void EventEditor::currentItemChanged(QTreeWidgetItem * it,QTreeWidgetItem *) +void EventEditor::currentItemChanged(QTreeWidgetItem * it, QTreeWidgetItem *) { KVI_ASSERT(m_bOneTimeSetupDone); saveLastEditedItem(); if(!it) { - m_pNameEditor->setText(__tr2qs_ctx("No item selected","editor")); + m_pNameEditor->setText(__tr2qs_ctx("No item selected", "editor")); m_pEditor->setText(""); m_pEditor->setEnabled(false); return; @@ -399,29 +404,33 @@ void EventEditor::currentItemChanged(QTreeWidgetItem * it,QTreeWidgetItem *) m_pEditor->setFocus(); m_pEditor->setText(m_pLastEditedItem->m_szBuffer); m_pEditor->setCursorPosition(((EventEditorHandlerTreeWidgetItem *)it)->cursorPosition()); - } else { + } + else + { m_pLastEditedItem = 0; m_pNameEditor->setEnabled(false); m_pNameEditor->setText(""); m_pEditor->setEnabled(false); QString parms = ((EventEditorEventTreeWidgetItem *)it)->m_szParams; - if(parms.isEmpty())parms = __tr2qs_ctx("none","editor"); + if(parms.isEmpty()) + parms = __tr2qs_ctx("none", "editor"); KviCommandFormatter::indent(parms); KviCommandFormatter::indent(parms); - QString szTmp = QString(__tr2qs_ctx("\n\nEvent:\n%1\n\nParameters:\n%2","editor")).arg(((EventEditorEventTreeWidgetItem *)it)->m_szName,parms); + QString szTmp = QString(__tr2qs_ctx("\n\nEvent:\n%1\n\nParameters:\n%2", "editor")).arg(((EventEditorEventTreeWidgetItem *)it)->m_szName, parms); m_pEditor->setText(szTmp); } } -void EventEditor::showEvent(QShowEvent *e) +void EventEditor::showEvent(QShowEvent * e) { oneTimeSetup(); QWidget::showEvent(e); } -void EventEditor::getExportEventBuffer(QString &buffer,EventEditorHandlerTreeWidgetItem * it) +void EventEditor::getExportEventBuffer(QString & buffer, EventEditorHandlerTreeWidgetItem * it) { - if(!it->parent())return; + if(!it->parent()) + return; QString szBuf = it->m_szBuffer; @@ -447,12 +456,15 @@ void EventEditor::getExportEventBuffer(QString &buffer,EventEditorHandlerTreeWid void EventEditor::exportCurrentHandler() { - if(!m_pLastEditedItem)return; + if(!m_pLastEditedItem) + return; saveLastEditedItem(); - if(!m_pLastEditedItem)return; + if(!m_pLastEditedItem) + return; QString szName = QDir::homePath(); - if(!szName.endsWith(QString(KVI_PATH_SEPARATOR)))szName += KVI_PATH_SEPARATOR; + if(!szName.endsWith(QString(KVI_PATH_SEPARATOR))) + szName += KVI_PATH_SEPARATOR; szName += ((EventEditorEventTreeWidgetItem *)(m_pLastEditedItem->parent()))->m_szName; szName += "."; szName += m_pLastEditedItem->m_szName; @@ -460,14 +472,15 @@ void EventEditor::exportCurrentHandler() QString szFile; - if(!KviFileDialog::askForSaveFileName(szFile,__tr2qs_ctx("Enter a Filename - KVIrc","editor"),szName,KVI_FILTER_SCRIPT,true,true,true,this))return; + if(!KviFileDialog::askForSaveFileName(szFile, __tr2qs_ctx("Enter a Filename - KVIrc", "editor"), szName, KVI_FILTER_SCRIPT, true, true, true, this)) + return; QString szOut; - getExportEventBuffer(szOut,m_pLastEditedItem); + getExportEventBuffer(szOut, m_pLastEditedItem); - if(!KviFileUtils::writeFile(szFile,szOut)) + if(!KviFileUtils::writeFile(szFile, szOut)) { - QMessageBox::warning(this,__tr2qs_ctx("Writing to File Failed - KVIrc","editor"),__tr2qs_ctx("Unable to write to the events file.","editor"),__tr2qs_ctx("&OK","editor")); + QMessageBox::warning(this, __tr2qs_ctx("Writing to File Failed - KVIrc", "editor"), __tr2qs_ctx("Unable to write to the events file.", "editor"), __tr2qs_ctx("&OK", "editor")); } } @@ -477,65 +490,66 @@ void EventEditor::exportAllEvents() QString out; - int count=m_pTreeWidget->topLevelItemCount(); - for (int i=0;itopLevelItemCount(); + for(int i = 0; i < count; i++) { EventEditorEventTreeWidgetItem * it = (EventEditorEventTreeWidgetItem *)m_pTreeWidget->topLevelItem(i); int ccount = it->childCount(); - for(int j=0;jchild(j); + EventEditorHandlerTreeWidgetItem * item = (EventEditorHandlerTreeWidgetItem *)it->child(j); QString tmp; - getExportEventBuffer(tmp,item); + getExportEventBuffer(tmp, item); out += tmp; out += "\n"; } } QString szName = QDir::homePath(); - if(!szName.endsWith(QString(KVI_PATH_SEPARATOR)))szName += KVI_PATH_SEPARATOR; + if(!szName.endsWith(QString(KVI_PATH_SEPARATOR))) + szName += KVI_PATH_SEPARATOR; szName += "events.kvs"; QString szFile; - if(!KviFileDialog::askForSaveFileName(szFile,__tr2qs_ctx("Enter a Filename - KVIrc","editor"),szName,QString(),true,true,true,this))return; + if(!KviFileDialog::askForSaveFileName(szFile, __tr2qs_ctx("Enter a Filename - KVIrc", "editor"), szName, QString(), true, true, true, this)) + return; - if(!KviFileUtils::writeFile(szFile,out)) + if(!KviFileUtils::writeFile(szFile, out)) { - QMessageBox::warning(this,__tr2qs_ctx("Writing to File Failed","editor"),__tr2qs_ctx("Unable to write to the events file.","editor"),__tr2qs_ctx("OK","editor")); + QMessageBox::warning(this, __tr2qs_ctx("Writing to File Failed", "editor"), __tr2qs_ctx("Unable to write to the events file.", "editor"), __tr2qs_ctx("OK", "editor")); } } - EventEditorWindow::EventEditorWindow() -: KviWindow(KviWindow::ScriptEditor, "eventeditor",0) + : KviWindow(KviWindow::ScriptEditor, "eventeditor", 0) { g_pEventEditorWindow = this; QGridLayout * g = new QGridLayout(); m_pEditor = new EventEditor(this); - g->addWidget(m_pEditor,0,0,1,4); + g->addWidget(m_pEditor, 0, 0, 1, 4); - QPushButton * btn = new QPushButton(__tr2qs_ctx("&OK","editor"),this); - connect(btn,SIGNAL(clicked()),this,SLOT(okClicked())); + QPushButton * btn = new QPushButton(__tr2qs_ctx("&OK", "editor"), this); + connect(btn, SIGNAL(clicked()), this, SLOT(okClicked())); btn->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Accept))); - g->addWidget(btn,1,1); + g->addWidget(btn, 1, 1); - btn = new QPushButton(__tr2qs_ctx("&Apply","editor"),this); - connect(btn,SIGNAL(clicked()),this,SLOT(applyClicked())); + btn = new QPushButton(__tr2qs_ctx("&Apply", "editor"), this); + connect(btn, SIGNAL(clicked()), this, SLOT(applyClicked())); btn->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Accept))); - g->addWidget(btn,1,2); + g->addWidget(btn, 1, 2); - btn = new QPushButton(__tr2qs_ctx("Cancel","editor"),this); - connect(btn,SIGNAL(clicked()),this,SLOT(cancelClicked())); + btn = new QPushButton(__tr2qs_ctx("Cancel", "editor"), this); + connect(btn, SIGNAL(clicked()), this, SLOT(cancelClicked())); btn->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Discard))); - g->addWidget(btn,1,3); + g->addWidget(btn, 1, 3); - g->setRowStretch(0,1); - g->setColumnStretch(0,1); + g->setRowStretch(0, 1); + g->setColumnStretch(0, 1); setLayout(g); } @@ -567,17 +581,17 @@ QPixmap * EventEditorWindow::myIconPtr() void EventEditorWindow::fillCaptionBuffers() { - m_szPlainTextCaption = __tr2qs_ctx("Event Editor","editor"); + m_szPlainTextCaption = __tr2qs_ctx("Event Editor", "editor"); } -void EventEditorWindow::getConfigGroupName(QString &szName) +void EventEditorWindow::getConfigGroupName(QString & szName) { szName = "eventeditor"; } void EventEditorWindow::saveProperties(KviConfigurationFile *) //cfg { -/* + /* #ifdef COMPILE_SCRIPTTOOLBAR cfg->writeEntry("Sizes",m_pEditor->sizes()); cfg->writeEntry("LastEvent",m_pEditor->lastEditedEvent().ptr()); @@ -588,7 +602,7 @@ void EventEditorWindow::saveProperties(KviConfigurationFile *) //cfg void EventEditorWindow::loadProperties(KviConfigurationFile *) //cfg { -/* + /* #ifdef COMPILE_SCRIPTTOOLBAR QValueList def; def.append(20); diff --git a/src/modules/eventeditor/EventEditorWindow.h b/src/modules/eventeditor/EventEditorWindow.h index 84594951f..f6ca3644f 100644 --- a/src/modules/eventeditor/EventEditorWindow.h +++ b/src/modules/eventeditor/EventEditorWindow.h @@ -40,11 +40,13 @@ public: unsigned int m_uEventIdx; QString m_szName; QString m_szParams; + public: - EventEditorEventTreeWidgetItem(QTreeWidget * par,unsigned int uEvIdx,const QString &name,const QString ¶ms); - ~EventEditorEventTreeWidgetItem() {}; + EventEditorEventTreeWidgetItem(QTreeWidget * par, unsigned int uEvIdx, const QString & name, const QString & params); + ~EventEditorEventTreeWidgetItem(){}; + public: - void setName(const QString &szName); + void setName(const QString & szName); QString name() const { return m_szName; }; }; @@ -53,16 +55,22 @@ class EventEditorHandlerTreeWidgetItem : public QTreeWidgetItem public: QString m_szName; QString m_szBuffer; - bool m_bEnabled; + bool m_bEnabled; int m_cPos; + public: - EventEditorHandlerTreeWidgetItem(QTreeWidgetItem * par,const QString &name,const QString &buffer,bool bEnabled); - ~EventEditorHandlerTreeWidgetItem() {}; + EventEditorHandlerTreeWidgetItem(QTreeWidgetItem * par, const QString & name, const QString & buffer, bool bEnabled); + ~EventEditorHandlerTreeWidgetItem(){}; + public: - const int & cursorPosition(){return m_cPos; }; - void setCursorPosition(const int &cPos){qDebug("set cursor to %d",cPos); m_cPos = cPos; }; + const int & cursorPosition() { return m_cPos; }; + void setCursorPosition(const int & cPos) + { + qDebug("set cursor to %d", cPos); + m_cPos = cPos; + }; - void setName(const QString &szName); + void setName(const QString & szName); QString name() const { return m_szName; }; void setEnabled(const bool bEnabled); }; @@ -71,13 +79,13 @@ class EventEditorTreeWidget : public QTreeWidget { Q_OBJECT public: - EventEditorTreeWidget(QWidget*); + EventEditorTreeWidget(QWidget *); ~EventEditorTreeWidget(){}; -protected: - void mousePressEvent (QMouseEvent *e); +protected: + void mousePressEvent(QMouseEvent * e); signals: - void rightButtonPressed(QTreeWidgetItem *,QPoint); + void rightButtonPressed(QTreeWidgetItem *, QPoint); }; class EventEditor : public QWidget @@ -86,29 +94,33 @@ class EventEditor : public QWidget public: EventEditor(QWidget * par); ~EventEditor(); + public: KviScriptEditor * m_pEditor; - EventEditorTreeWidget * m_pTreeWidget; - QLineEdit * m_pNameEditor; - QMenu * m_pContextPopup; + EventEditorTreeWidget * m_pTreeWidget; + QLineEdit * m_pNameEditor; + QMenu * m_pContextPopup; EventEditorHandlerTreeWidgetItem * m_pLastEditedItem; - bool m_bOneTimeSetupDone; + bool m_bOneTimeSetupDone; + public: void commit(); void saveLastEditedItem(); - void getUniqueHandlerName(EventEditorEventTreeWidgetItem *it,QString &buffer); - void getExportEventBuffer(QString &szBuffer,EventEditorHandlerTreeWidgetItem * it); + void getUniqueHandlerName(EventEditorEventTreeWidgetItem * it, QString & buffer); + void getExportEventBuffer(QString & szBuffer, EventEditorHandlerTreeWidgetItem * it); protected slots: - void currentItemChanged(QTreeWidgetItem *it,QTreeWidgetItem *); - void itemPressed(QTreeWidgetItem *it,const QPoint &pnt); + void currentItemChanged(QTreeWidgetItem * it, QTreeWidgetItem *); + void itemPressed(QTreeWidgetItem * it, const QPoint & pnt); void toggleCurrentHandlerEnabled(); void removeCurrentHandler(); void addHandlerForCurrentEvent(); void exportAllEvents(); void exportCurrentHandler(); - void eventHandlerDisabled(const QString &szName); + void eventHandlerDisabled(const QString & szName); + protected: - void showEvent(QShowEvent *e); + void showEvent(QShowEvent * e); + private: void oneTimeSetup(); }; @@ -119,12 +131,14 @@ class EventEditorWindow : public KviWindow public: EventEditorWindow(); ~EventEditorWindow(); + protected: EventEditor * m_pEditor; + protected: virtual QPixmap * myIconPtr(); virtual void fillCaptionBuffers(); - virtual void getConfigGroupName(QString &szName); + virtual void getConfigGroupName(QString & szName); virtual void saveProperties(KviConfigurationFile *); virtual void loadProperties(KviConfigurationFile *); protected slots: diff --git a/src/modules/eventeditor/libkvieventeditor.cpp b/src/modules/eventeditor/libkvieventeditor.cpp index 7480f8bc9..a2ce4d8fa 100644 --- a/src/modules/eventeditor/libkvieventeditor.cpp +++ b/src/modules/eventeditor/libkvieventeditor.cpp @@ -30,7 +30,6 @@ EventEditorWindow * g_pEventEditorWindow = 0; - /* @doc: eventeditor.open @type: @@ -60,7 +59,7 @@ static bool eventeditor_kvs_cmd_open(KviKvsModuleCommandCall *) static bool eventeditor_module_init(KviModule * m) { - KVSM_REGISTER_SIMPLE_COMMAND(m,"open",eventeditor_kvs_cmd_open); + KVSM_REGISTER_SIMPLE_COMMAND(m, "open", eventeditor_kvs_cmd_open); g_pEventEditorWindow = 0; return true; @@ -80,13 +79,12 @@ static bool eventeditor_module_cleanup(KviModule *) } KVIRC_MODULE( - "EventEditor", // module name - "4.0.0", // module version - "Copyright (C) 2002 Szymon Stefanek (pragma at kvirc dot net)", // author & (C) - "Editor for the script events", - eventeditor_module_init, - eventeditor_module_can_unload, - 0, - eventeditor_module_cleanup, - "editor" -) + "EventEditor", // module name + "4.0.0", // module version + "Copyright (C) 2002 Szymon Stefanek (pragma at kvirc dot net)", // author & (C) + "Editor for the script events", + eventeditor_module_init, + eventeditor_module_can_unload, + 0, + eventeditor_module_cleanup, + "editor") diff --git a/src/modules/file/libkvifile.cpp b/src/modules/file/libkvifile.cpp index 0853b2c8e..9e25b7740 100644 --- a/src/modules/file/libkvifile.cpp +++ b/src/modules/file/libkvifile.cpp @@ -40,24 +40,23 @@ #include #if !defined(COMPILE_ON_WINDOWS) && !defined(COMPILE_ON_MINGW) - #include +#include #endif - #if defined(COMPILE_SSL_SUPPORT) - // Apple deprecated openSSL since OS X 10.7: +// Apple deprecated openSSL since OS X 10.7: - #ifdef DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER - #undef DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER - #define DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER - #endif +#ifdef DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER +#undef DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER +#define DEPRECATED_IN_MAC_OS_X_VERSION_10_7_AND_LATER +#endif - #include +#include #else - // The fallback we can always use, but with very limited set of - // functionality. - #include +// The fallback we can always use, but with very limited set of +// functionality. +#include #endif /* @@ -89,24 +88,24 @@ static bool file_kvs_cmd_copy(KviKvsModuleCommandCall * c) { - QString szSrc,szDst; + QString szSrc, szDst; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("source",KVS_PT_NONEMPTYSTRING,0,szSrc) - KVSM_PARAMETER("destination",KVS_PT_NONEMPTYSTRING,0,szDst) + KVSM_PARAMETER("source", KVS_PT_NONEMPTYSTRING, 0, szSrc) + KVSM_PARAMETER("destination", KVS_PT_NONEMPTYSTRING, 0, szDst) KVSM_PARAMETERS_END(c) - if (szSrc.left(2)!="\\\\") + if(szSrc.left(2) != "\\\\") KviFileUtils::adjustFilePath(szSrc); - if (szDst.left(2)!="\\\\") + if(szDst.left(2) != "\\\\") KviFileUtils::adjustFilePath(szDst); - if(KviFileUtils::fileExists(szDst) && !c->switches()->find('o',"overwrite")) + if(KviFileUtils::fileExists(szDst) && !c->switches()->find('o', "overwrite")) { c->warning(__tr2qs("Destination file exists: no copy made")); return true; } - if(!KviFileUtils::copyFile(szSrc,szDst)) + if(!KviFileUtils::copyFile(szSrc, szDst)) { - c->warning(__tr2qs("Failed to copy from '%Q' to '%Q'"),&szSrc,&szDst); + c->warning(__tr2qs("Failed to copy from '%Q' to '%Q'"), &szSrc, &szDst); c->warning(__tr2qs("Either the source doesn't exist or the destination can not be created")); } return true; @@ -134,16 +133,17 @@ static bool file_kvs_cmd_addimagepath(KviKvsModuleCommandCall * c) { QString szDst; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("path",KVS_PT_NONEMPTYSTRING,0,szDst) + KVSM_PARAMETER("path", KVS_PT_NONEMPTYSTRING, 0, szDst) KVSM_PARAMETERS_END(c) - if (szDst.left(2)!="\\\\") + if(szDst.left(2) != "\\\\") KviFileUtils::adjustFilePath(szDst); //QStringList::Iterator it = KVI_OPTION_STRINGLIST(KviOption_stringlistImageSearchPaths).find(szDst); int iIndex = KVI_OPTION_STRINGLIST(KviOption_stringlistImageSearchPaths).indexOf(szDst); //if(it == KVI_OPTION_STRINGLIST(KviOption_stringlistImageSearchPaths).end()) if(iIndex == -1) - KVI_OPTION_STRINGLIST(KviOption_stringlistImageSearchPaths).append(szDst); + KVI_OPTION_STRINGLIST(KviOption_stringlistImageSearchPaths) + .append(szDst); return true; } @@ -168,16 +168,17 @@ static bool file_kvs_cmd_delimagepath(KviKvsModuleCommandCall * c) { QString szDst; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("path",KVS_PT_NONEMPTYSTRING,0,szDst) + KVSM_PARAMETER("path", KVS_PT_NONEMPTYSTRING, 0, szDst) KVSM_PARAMETERS_END(c) - if (szDst.left(2)!="\\\\") + if(szDst.left(2) != "\\\\") KviFileUtils::adjustFilePath(szDst); //QStringList::Iterator it = KVI_OPTION_STRINGLIST(KviOption_stringlistImageSearchPaths).find(szDst); int iIndex = KVI_OPTION_STRINGLIST(KviOption_stringlistImageSearchPaths).indexOf(szDst); //if(it == KVI_OPTION_STRINGLIST(KviOption_stringlistImageSearchPaths).end()) if(iIndex != -1) - KVI_OPTION_STRINGLIST(KviOption_stringlistImageSearchPaths).removeAt(iIndex); + KVI_OPTION_STRINGLIST(KviOption_stringlistImageSearchPaths) + .removeAt(iIndex); return true; } @@ -215,21 +216,21 @@ static bool file_kvs_cmd_delimagepath(KviKvsModuleCommandCall * c) static bool file_kvs_cmd_write(KviKvsModuleCommandCall * c) { - QString szFileName,szData; + QString szFileName, szData; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("filename",KVS_PT_NONEMPTYSTRING,0,szFileName) - KVSM_PARAMETER("data",KVS_PT_NONEMPTYSTRING,0,szData) + KVSM_PARAMETER("filename", KVS_PT_NONEMPTYSTRING, 0, szFileName) + KVSM_PARAMETER("data", KVS_PT_NONEMPTYSTRING, 0, szData) KVSM_PARAMETERS_END(c) - if (szFileName.left(2)!="\\\\") + if(szFileName.left(2) != "\\\\") KviFileUtils::adjustFilePath(szFileName); bool bRet; - if(c->switches()->find('l',"local-8-bit")) - bRet = KviFileUtils::writeFileLocal8Bit(szFileName,szData,c->switches()->find('a',"append")); + if(c->switches()->find('l', "local-8-bit")) + bRet = KviFileUtils::writeFileLocal8Bit(szFileName, szData, c->switches()->find('a', "append")); else - bRet = KviFileUtils::writeFile(szFileName,szData,c->switches()->find('a',"append")); + bRet = KviFileUtils::writeFile(szFileName, szData, c->switches()->find('a', "append")); if(!bRet) - c->warning(__tr2qs("Failed to write to file '%Q': the destination couldn't be opened"),&szFileName); + c->warning(__tr2qs("Failed to write to file '%Q': the destination couldn't be opened"), &szFileName); return true; } @@ -273,18 +274,18 @@ static bool file_kvs_cmd_writeBytes(KviKvsModuleCommandCall * c) KviKvsArray * pArray = NULL; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("filename",KVS_PT_NONEMPTYSTRING,0,szFileName) - KVSM_PARAMETER("dataArray",KVS_PT_ARRAY,0,pArray) + KVSM_PARAMETER("filename", KVS_PT_NONEMPTYSTRING, 0, szFileName) + KVSM_PARAMETER("dataArray", KVS_PT_ARRAY, 0, pArray) KVSM_PARAMETERS_END(c) - if (szFileName.left(2)!="\\\\") + if(szFileName.left(2) != "\\\\") KviFileUtils::adjustFilePath(szFileName); if(!pArray) return c->error(__tr2qs("Missing data array")); KviFile f(szFileName); - if(!f.open(QFile::WriteOnly | (c->switches()->find('a',"append") ? QFile::Append : QFile::Truncate))) + if(!f.open(QFile::WriteOnly | (c->switches()->find('a', "append") ? QFile::Append : QFile::Truncate))) { c->warning(__tr2qs("Can't open file '%1' for writing").arg(szFileName)); return true; @@ -292,14 +293,16 @@ static bool file_kvs_cmd_writeBytes(KviKvsModuleCommandCall * c) QByteArray aBuffer; - for(kvs_uint_t i=0;isize();i++) + for(kvs_uint_t i = 0; i < pArray->size(); i++) { KviKvsVariant * pData = pArray->at(i); kvs_int_t iValue; if(pData->asInteger(iValue)) { aBuffer.append((char)iValue); - } else { + } + else + { QString szValue; pData->asString(szValue); aBuffer.append(szValue.toUtf8()); @@ -308,7 +311,7 @@ static bool file_kvs_cmd_writeBytes(KviKvsModuleCommandCall * c) if(!aBuffer.data()) return true; // nothing to do - if(f.write(aBuffer.data(),aBuffer.length()) != ((unsigned int)(aBuffer.length()))) + if(f.write(aBuffer.data(), aBuffer.length()) != ((unsigned int)(aBuffer.length()))) c->warning(__tr2qs("Error writing bytes to file '%1'").arg(szFileName)); return true; @@ -339,22 +342,22 @@ static bool file_kvs_cmd_writeBytes(KviKvsModuleCommandCall * c) static bool file_kvs_cmd_rename(KviKvsModuleCommandCall * c) { - QString szOld,szNew; + QString szOld, szNew; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("oldname",KVS_PT_NONEMPTYSTRING,0,szOld) - KVSM_PARAMETER("newname",KVS_PT_NONEMPTYSTRING,0,szNew) + KVSM_PARAMETER("oldname", KVS_PT_NONEMPTYSTRING, 0, szOld) + KVSM_PARAMETER("newname", KVS_PT_NONEMPTYSTRING, 0, szNew) KVSM_PARAMETERS_END(c) - if (szOld.left(2)!="\\\\") + if(szOld.left(2) != "\\\\") KviFileUtils::adjustFilePath(szOld); - if (szNew.left(2)!="\\\\") + if(szNew.left(2) != "\\\\") KviFileUtils::adjustFilePath(szNew); if(KviFileUtils::fileExists(szNew)) c->warning(__tr2qs("Destination file exists: file not renamed")); - if(!KviFileUtils::renameFile(szOld,szNew)) - c->warning(__tr2qs("Failed to rename '%Q' to '%Q'"),&szOld,&szNew); + if(!KviFileUtils::renameFile(szOld, szNew)) + c->warning(__tr2qs("Failed to rename '%Q' to '%Q'"), &szOld, &szNew); return true; } @@ -388,16 +391,16 @@ static bool file_kvs_cmd_mkdir(KviKvsModuleCommandCall * c) { QString szDir; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("directory",KVS_PT_NONEMPTYSTRING,0,szDir) + KVSM_PARAMETER("directory", KVS_PT_NONEMPTYSTRING, 0, szDir) KVSM_PARAMETERS_END(c) - if (szDir.left(2)!="\\\\") + if(szDir.left(2) != "\\\\") KviFileUtils::adjustFilePath(szDir); if(!KviFileUtils::makeDir(szDir)) { - if(!c->switches()->find('q',"quiet")) - c->warning(__tr2qs("Failed to make the directory '%Q'"),&szDir); + if(!c->switches()->find('q', "quiet")) + c->warning(__tr2qs("Failed to make the directory '%Q'"), &szDir); } - return !c->switches()->find('e',"error"); + return !c->switches()->find('e', "error"); } /* @@ -429,14 +432,14 @@ static bool file_kvs_cmd_remove(KviKvsModuleCommandCall * c) { QString szFileName; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("name",KVS_PT_NONEMPTYSTRING,0,szFileName) + KVSM_PARAMETER("name", KVS_PT_NONEMPTYSTRING, 0, szFileName) KVSM_PARAMETERS_END(c) - if (szFileName.left(2)!="\\\\") + if(szFileName.left(2) != "\\\\") KviFileUtils::adjustFilePath(szFileName); if(!KviFileUtils::removeFile(szFileName)) { - if(!c->switches()->find('q',"quiet")) - c->warning(__tr2qs("Failed to remove the file '%Q'"),&szFileName); + if(!c->switches()->find('q', "quiet")) + c->warning(__tr2qs("Failed to remove the file '%Q'"), &szFileName); } return true; } @@ -472,14 +475,14 @@ static bool file_kvs_cmd_rmdir(KviKvsModuleCommandCall * c) { QString szFileName; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("name",KVS_PT_NONEMPTYSTRING,0,szFileName) + KVSM_PARAMETER("name", KVS_PT_NONEMPTYSTRING, 0, szFileName) KVSM_PARAMETERS_END(c) - if (szFileName.left(2)!="\\\\") + if(szFileName.left(2) != "\\\\") KviFileUtils::adjustFilePath(szFileName); if(!KviFileUtils::removeDir(szFileName)) { - if(!c->switches()->find('q',"quiet")) - c->warning(__tr2qs("Failed to remove the directory '%Q'"),&szFileName); + if(!c->switches()->find('q', "quiet")) + c->warning(__tr2qs("Failed to remove the directory '%Q'"), &szFileName); } return true; } @@ -510,9 +513,9 @@ static bool file_kvs_fnc_exists(KviKvsModuleFunctionCall * c) { QString szFileName; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("filename",KVS_PT_STRING,0,szFileName) + KVSM_PARAMETER("filename", KVS_PT_STRING, 0, szFileName) KVSM_PARAMETERS_END(c) - if (szFileName.left(2)!="\\\\") + if(szFileName.left(2) != "\\\\") KviFileUtils::adjustFilePath(szFileName); QFileInfo f(szFileName); c->returnValue()->setBoolean(f.exists()); @@ -539,9 +542,9 @@ static bool file_kvs_fnc_type(KviKvsModuleFunctionCall * c) { QString szFileName; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("filename",KVS_PT_NONEMPTYSTRING,0,szFileName) + KVSM_PARAMETER("filename", KVS_PT_NONEMPTYSTRING, 0, szFileName) KVSM_PARAMETERS_END(c) - if (szFileName.left(2)!="\\\\") + if(szFileName.left(2) != "\\\\") KviFileUtils::adjustFilePath(szFileName); QFileInfo f(szFileName); if(f.isFile()) @@ -573,9 +576,9 @@ static bool file_kvs_fnc_size(KviKvsModuleFunctionCall * c) { QString szFileName; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("filename",KVS_PT_NONEMPTYSTRING,0,szFileName) + KVSM_PARAMETER("filename", KVS_PT_NONEMPTYSTRING, 0, szFileName) KVSM_PARAMETERS_END(c) - if (szFileName.left(2)!="\\\\") + if(szFileName.left(2) != "\\\\") KviFileUtils::adjustFilePath(szFileName); QFileInfo f(szFileName); c->returnValue()->setInteger(f.size()); @@ -601,15 +604,15 @@ static bool file_kvs_fnc_allSizes(KviKvsModuleFunctionCall * c) { QString szDir; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("directory",KVS_PT_NONEMPTYSTRING,0,szDir) + KVSM_PARAMETER("directory", KVS_PT_NONEMPTYSTRING, 0, szDir) KVSM_PARAMETERS_END(c) - if (szDir.left(2)!="\\\\") + if(szDir.left(2) != "\\\\") KviFileUtils::adjustFilePath(szDir); QDir d(szDir); if(!d.exists()) { - c->warning(__tr2qs("The specified directory doesn't exist '%Q'"),&szDir); + c->warning(__tr2qs("The specified directory doesn't exist '%Q'"), &szDir); return true; } @@ -621,11 +624,11 @@ static bool file_kvs_fnc_allSizes(KviKvsModuleFunctionCall * c) if(!sl.isEmpty()) { int iIdx = 0; - for(const auto& it : sl) + for(const auto & it : sl) { szFile = szDir + it; QFileInfo f(szFile); - pArray->set(iIdx,new KviKvsVariant((kvs_int_t)f.size())); + pArray->set(iIdx, new KviKvsVariant((kvs_int_t)f.size())); iIdx++; } } @@ -662,7 +665,7 @@ static bool file_kvs_fnc_fixpath(KviKvsModuleFunctionCall * c) { QString szFileName; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("filename",KVS_PT_STRING,0,szFileName) + KVSM_PARAMETER("filename", KVS_PT_STRING, 0, szFileName) KVSM_PARAMETERS_END(c) KviFileUtils::adjustFilePath(szFileName); c->returnValue()->setString(szFileName); @@ -739,63 +742,78 @@ static bool file_kvs_fnc_ps(KviKvsModuleFunctionCall * c) static bool file_kvs_fnc_ls(KviKvsModuleFunctionCall * c) { - QString szDir,szFlags,szFilter; + QString szDir, szFlags, szFilter; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("directory",KVS_PT_NONEMPTYSTRING,0,szDir) - KVSM_PARAMETER("flags",KVS_PT_STRING,KVS_PF_OPTIONAL,szFlags) - KVSM_PARAMETER("filter",KVS_PT_STRING,KVS_PF_OPTIONAL,szFilter) + KVSM_PARAMETER("directory", KVS_PT_NONEMPTYSTRING, 0, szDir) + KVSM_PARAMETER("flags", KVS_PT_STRING, KVS_PF_OPTIONAL, szFlags) + KVSM_PARAMETER("filter", KVS_PT_STRING, KVS_PF_OPTIONAL, szFilter) KVSM_PARAMETERS_END(c) - if (szDir.left(2)!="\\\\") + if(szDir.left(2) != "\\\\") KviFileUtils::adjustFilePath(szDir); - QDir d(szDir); if(!d.exists()) { - c->warning(__tr2qs("The specified directory doesn't exist '%Q'"),&szDir); + c->warning(__tr2qs("The specified directory doesn't exist '%Q'"), &szDir); return true; } QFlags iFlags = 0; if(szFlags.isEmpty()) iFlags = QDir::Dirs | QDir::Files | QDir::NoSymLinks | QDir::Readable | QDir::Writable | QDir::Executable | QDir::Hidden | QDir::System; - else { - if(szFlags.indexOf('d',Qt::CaseInsensitive) != -1)iFlags |= QDir::Dirs; - if(szFlags.indexOf('f',Qt::CaseInsensitive) != -1)iFlags |= QDir::Files; - if(szFlags.indexOf('l',Qt::CaseInsensitive) == -1)iFlags |= QDir::NoSymLinks; - if(szFlags.indexOf('r',Qt::CaseInsensitive) != -1)iFlags |= QDir::Readable; - if(szFlags.indexOf('w',Qt::CaseInsensitive) != -1)iFlags |= QDir::Writable; - if(szFlags.indexOf('x',Qt::CaseInsensitive) != -1)iFlags |= QDir::Executable; - if(szFlags.indexOf('h',Qt::CaseInsensitive) != -1)iFlags |= QDir::Hidden; - if(szFlags.indexOf('s',Qt::CaseInsensitive) != -1)iFlags |= QDir::System; + else + { + if(szFlags.indexOf('d', Qt::CaseInsensitive) != -1) + iFlags |= QDir::Dirs; + if(szFlags.indexOf('f', Qt::CaseInsensitive) != -1) + iFlags |= QDir::Files; + if(szFlags.indexOf('l', Qt::CaseInsensitive) == -1) + iFlags |= QDir::NoSymLinks; + if(szFlags.indexOf('r', Qt::CaseInsensitive) != -1) + iFlags |= QDir::Readable; + if(szFlags.indexOf('w', Qt::CaseInsensitive) != -1) + iFlags |= QDir::Writable; + if(szFlags.indexOf('x', Qt::CaseInsensitive) != -1) + iFlags |= QDir::Executable; + if(szFlags.indexOf('h', Qt::CaseInsensitive) != -1) + iFlags |= QDir::Hidden; + if(szFlags.indexOf('s', Qt::CaseInsensitive) != -1) + iFlags |= QDir::System; } QFlags iSort = 0; if(szFlags.isEmpty()) iSort = QDir::Unsorted; - else { - if(szFlags.indexOf('n',Qt::CaseInsensitive) != -1)iSort |= QDir::Name; - if(szFlags.indexOf('t',Qt::CaseInsensitive) != -1)iSort |= QDir::Time; - if(szFlags.indexOf('b',Qt::CaseInsensitive) != -1)iSort |= QDir::Size; - if(szFlags.indexOf('z',Qt::CaseInsensitive) != -1)iSort |= QDir::DirsFirst; - if(szFlags.indexOf('k',Qt::CaseInsensitive) != -1)iSort |= QDir::Reversed; - if(szFlags.indexOf('i',Qt::CaseInsensitive) != -1)iSort |= QDir::IgnoreCase; + else + { + if(szFlags.indexOf('n', Qt::CaseInsensitive) != -1) + iSort |= QDir::Name; + if(szFlags.indexOf('t', Qt::CaseInsensitive) != -1) + iSort |= QDir::Time; + if(szFlags.indexOf('b', Qt::CaseInsensitive) != -1) + iSort |= QDir::Size; + if(szFlags.indexOf('z', Qt::CaseInsensitive) != -1) + iSort |= QDir::DirsFirst; + if(szFlags.indexOf('k', Qt::CaseInsensitive) != -1) + iSort |= QDir::Reversed; + if(szFlags.indexOf('i', Qt::CaseInsensitive) != -1) + iSort |= QDir::IgnoreCase; } QStringList sl; if(!szFilter.isEmpty()) - sl = d.entryList(QStringList(szFilter),iFlags,iSort); + sl = d.entryList(QStringList(szFilter), iFlags, iSort); else - sl = d.entryList(iFlags,iSort); + sl = d.entryList(iFlags, iSort); KviKvsArray * pArray = new KviKvsArray(); if(!sl.isEmpty()) { int iIdx = 0; - for(const auto& it : sl) + for(const auto & it : sl) { - pArray->set(iIdx,new KviKvsVariant(it)); + pArray->set(iIdx, new KviKvsVariant(it)); iIdx++; } } @@ -844,17 +862,17 @@ static bool file_kvs_fnc_read(KviKvsModuleFunctionCall * c) kvs_uint_t uSize; QString szFlags; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("filename",KVS_PT_NONEMPTYSTRING,0,szFileName) - KVSM_PARAMETER("size",KVS_PT_UINT,KVS_PF_OPTIONAL,uSize) - KVSM_PARAMETER("flags",KVS_PT_STRING,KVS_PF_OPTIONAL,szFlags) + KVSM_PARAMETER("filename", KVS_PT_NONEMPTYSTRING, 0, szFileName) + KVSM_PARAMETER("size", KVS_PT_UINT, KVS_PF_OPTIONAL, uSize) + KVSM_PARAMETER("flags", KVS_PT_STRING, KVS_PF_OPTIONAL, szFlags) KVSM_PARAMETERS_END(c) - if (szFileName.left(2)!="\\\\") + if(szFileName.left(2) != "\\\\") KviFileUtils::adjustFilePath(szFileName); QFile f(szFileName); if(!f.open(QIODevice::ReadOnly)) { - c->warning(__tr2qs("Can't open the file '%Q' for reading"),&szFileName); + c->warning(__tr2qs("Can't open the file '%Q' for reading"), &szFileName); return true; } @@ -871,7 +889,7 @@ static bool file_kvs_fnc_read(KviKvsModuleFunctionCall * c) { // ops KviMemory::free(pcBuf); - c->warning(__tr2qs("Read error for file '%Q' (have been unable to read the requested size in 1000 retries)"),&szFileName); + c->warning(__tr2qs("Read error for file '%Q' (have been unable to read the requested size in 1000 retries)"), &szFileName); return true; } @@ -880,7 +898,7 @@ static bool file_kvs_fnc_read(KviKvsModuleFunctionCall * c) if(iReadedNow < 0) { KviMemory::free(pcBuf); - c->warning(__tr2qs("Read error for file '%Q'"),&szFileName); + c->warning(__tr2qs("Read error for file '%Q'"), &szFileName); return true; } @@ -890,7 +908,7 @@ static bool file_kvs_fnc_read(KviKvsModuleFunctionCall * c) pcBuf[uReaded] = '\0'; - if(szFlags.indexOf('l',Qt::CaseInsensitive) == -1) + if(szFlags.indexOf('l', Qt::CaseInsensitive) == -1) c->returnValue()->setString(QString::fromUtf8(pcBuf)); else c->returnValue()->setString(QString::fromLocal8Bit(pcBuf)); @@ -937,16 +955,16 @@ static bool file_kvs_fnc_readBytes(KviKvsModuleFunctionCall * c) kvs_uint_t uSize; QString szFlags; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("filename",KVS_PT_NONEMPTYSTRING,0,szFileName) - KVSM_PARAMETER("size",KVS_PT_UINT,KVS_PF_OPTIONAL,uSize) + KVSM_PARAMETER("filename", KVS_PT_NONEMPTYSTRING, 0, szFileName) + KVSM_PARAMETER("size", KVS_PT_UINT, KVS_PF_OPTIONAL, uSize) KVSM_PARAMETERS_END(c) - if (szFileName.left(2)!="\\\\") + if(szFileName.left(2) != "\\\\") KviFileUtils::adjustFilePath(szFileName); QFile f(szFileName); if(!f.open(QIODevice::ReadOnly)) { - c->warning(__tr2qs("Can't open the file '%Q' for reading"),&szFileName); + c->warning(__tr2qs("Can't open the file '%Q' for reading"), &szFileName); return true; } @@ -963,16 +981,16 @@ static bool file_kvs_fnc_readBytes(KviKvsModuleFunctionCall * c) { // ops KviMemory::free(pcBuf); - c->warning(__tr2qs("Read error for file '%Q' (have been unable to read the requested size in 1000 retries)"),&szFileName); + c->warning(__tr2qs("Read error for file '%Q' (have been unable to read the requested size in 1000 retries)"), &szFileName); return true; } - int iReadedNow = f.read((char *)(pcBuf + uReaded),uSize - uReaded); + int iReadedNow = f.read((char *)(pcBuf + uReaded), uSize - uReaded); if(iReadedNow < 0) { KviMemory::free(pcBuf); - c->warning(__tr2qs("Read error for file '%Q'"),&szFileName); + c->warning(__tr2qs("Read error for file '%Q'"), &szFileName); return true; } @@ -986,7 +1004,7 @@ static bool file_kvs_fnc_readBytes(KviKvsModuleFunctionCall * c) unsigned char * p = pcBuf; while(u < uReaded) { - pArray->set(u,new KviKvsVariant((kvs_int_t)(*p))); + pArray->set(u, new KviKvsVariant((kvs_int_t)(*p))); u++; p++; } @@ -1037,19 +1055,19 @@ static bool file_kvs_fnc_readLines(KviKvsModuleFunctionCall * c) kvs_int_t iStartLine; kvs_int_t iCount; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("filename",KVS_PT_NONEMPTYSTRING,0,szFileName) - KVSM_PARAMETER("startline",KVS_PT_INT,KVS_PF_OPTIONAL,iStartLine) - KVSM_PARAMETER("count",KVS_PT_INT,KVS_PF_OPTIONAL,iCount) - KVSM_PARAMETER("flags",KVS_PT_STRING,KVS_PF_OPTIONAL,szFlags) + KVSM_PARAMETER("filename", KVS_PT_NONEMPTYSTRING, 0, szFileName) + KVSM_PARAMETER("startline", KVS_PT_INT, KVS_PF_OPTIONAL, iStartLine) + KVSM_PARAMETER("count", KVS_PT_INT, KVS_PF_OPTIONAL, iCount) + KVSM_PARAMETER("flags", KVS_PT_STRING, KVS_PF_OPTIONAL, szFlags) KVSM_PARAMETERS_END(c) - if (szFileName.left(2)!="\\\\") + if(szFileName.left(2) != "\\\\") KviFileUtils::adjustFilePath(szFileName); QFile f(szFileName); if(!f.open(QIODevice::ReadOnly)) { - c->warning(__tr2qs("Can't open the file '%Q' for reading"),&szFileName); + c->warning(__tr2qs("Can't open the file '%Q' for reading"), &szFileName); return true; } @@ -1058,7 +1076,7 @@ static bool file_kvs_fnc_readLines(KviKvsModuleFunctionCall * c) if(c->params()->count() < 3) iCount = -1; - bool bLocal8Bit = szFlags.indexOf('l',0,Qt::CaseInsensitive) != -1; + bool bLocal8Bit = szFlags.indexOf('l', 0, Qt::CaseInsensitive) != -1; KviKvsArray * pArray = new KviKvsArray(); @@ -1079,17 +1097,19 @@ static bool file_kvs_fnc_readLines(KviKvsModuleFunctionCall * c) QString szLine = stream.readLine(); if(szLine.isNull()) break; // EOF (atEnd() is unreliable on files in /proc) - pArray->set(iIndex,new KviKvsVariant(szLine)); + pArray->set(iIndex, new KviKvsVariant(szLine)); iIndex++; iCount--; } - } else { + } + else + { for(;;) { QString szLine = stream.readLine(); if(szLine.isNull()) break; // EOF (atEnd() is unreliable on files in /proc) - pArray->set(iIndex,new KviKvsVariant(szLine)); + pArray->set(iIndex, new KviKvsVariant(szLine)); iIndex++; } } @@ -1141,27 +1161,27 @@ static bool file_kvs_fnc_readLines(KviKvsModuleFunctionCall * c) static bool file_kvs_cmd_writeLines(KviKvsModuleCommandCall * c) { - QString szFileName,szFlags; + QString szFileName, szFlags; KviKvsArrayCast a; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("filename",KVS_PT_NONEMPTYSTRING,0,szFileName) - KVSM_PARAMETER("lines",KVS_PT_ARRAYCAST,0,a) + KVSM_PARAMETER("filename", KVS_PT_NONEMPTYSTRING, 0, szFileName) + KVSM_PARAMETER("lines", KVS_PT_ARRAYCAST, 0, a) KVSM_PARAMETERS_END(c) - if (szFileName.left(2)!="\\\\") + if(szFileName.left(2) != "\\\\") KviFileUtils::adjustFilePath(szFileName); KviFile f(szFileName); - bool bAppend = c->switches()->find('a',"append"); - bool bLocal8Bit = c->switches()->find('l',"local-8-bit"); - bool bNoSeparator = c->switches()->find('n',"no-separator"); - bool bAddCR = c->switches()->find('c',"crlf"); + bool bAppend = c->switches()->find('a', "append"); + bool bLocal8Bit = c->switches()->find('l', "local-8-bit"); + bool bNoSeparator = c->switches()->find('n', "no-separator"); + bool bAddCR = c->switches()->find('c', "crlf"); if(!f.open(QFile::WriteOnly | (bAppend ? QFile::Append : QFile::Truncate))) { - if(!c->switches()->find('q',"quiet")) - c->warning(__tr2qs("Can't open the file '%Q' for writing"),&szFileName); + if(!c->switches()->find('q', "quiet")) + c->warning(__tr2qs("Can't open the file '%Q' for writing"), &szFileName); return true; } @@ -1183,7 +1203,7 @@ static bool file_kvs_cmd_writeLines(KviKvsModuleCommandCall * c) else dat += '\n'; } - f.write(dat.data(),dat.length()); + f.write(dat.data(), dat.length()); } u++; } @@ -1224,12 +1244,12 @@ static bool file_kvs_fnc_localdir(KviKvsModuleFunctionCall * c) { QString szFileName; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("relative_path",KVS_PT_STRING,KVS_PF_OPTIONAL,szFileName) + KVSM_PARAMETER("relative_path", KVS_PT_STRING, KVS_PF_OPTIONAL, szFileName) KVSM_PARAMETERS_END(c) if(szFileName.isEmpty()) szFileName.append(KVI_PATH_SEPARATOR_CHAR); QString szPath; - g_pApp->getLocalKvircDirectory(szPath,KviApplication::None,szFileName); + g_pApp->getLocalKvircDirectory(szPath, KviApplication::None, szFileName); KviFileUtils::adjustFilePath(szPath); c->returnValue()->setString(szPath); return true; @@ -1258,12 +1278,12 @@ static bool file_kvs_fnc_homedir(KviKvsModuleFunctionCall * c) { QString szFileName; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("relative_path",KVS_PT_STRING,KVS_PF_OPTIONAL,szFileName) + KVSM_PARAMETER("relative_path", KVS_PT_STRING, KVS_PF_OPTIONAL, szFileName) KVSM_PARAMETERS_END(c) if(szFileName.isEmpty()) szFileName.append(KVI_PATH_SEPARATOR_CHAR); QString szPath = QDir::homePath(); - KviQString::ensureLastCharIs(szPath,KVI_PATH_SEPARATOR_CHAR); + KviQString::ensureLastCharIs(szPath, KVI_PATH_SEPARATOR_CHAR); szPath.append(szFileName); KviFileUtils::adjustFilePath(szPath); c->returnValue()->setString(szPath); @@ -1294,12 +1314,12 @@ static bool file_kvs_fnc_rootdir(KviKvsModuleFunctionCall * c) { QString szFileName; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("relative_path",KVS_PT_STRING,KVS_PF_OPTIONAL,szFileName) + KVSM_PARAMETER("relative_path", KVS_PT_STRING, KVS_PF_OPTIONAL, szFileName) KVSM_PARAMETERS_END(c) if(szFileName.isEmpty()) szFileName.append(KVI_PATH_SEPARATOR_CHAR); QString szPath = QDir::rootPath(); - KviQString::ensureLastCharIs(szPath,KVI_PATH_SEPARATOR_CHAR); + KviQString::ensureLastCharIs(szPath, KVI_PATH_SEPARATOR_CHAR); szPath.append(szFileName); KviFileUtils::adjustFilePath(szPath); c->returnValue()->setString(szPath); @@ -1329,12 +1349,12 @@ static bool file_kvs_fnc_cwd(KviKvsModuleFunctionCall * c) { QString szFileName; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("relative_path",KVS_PT_STRING,KVS_PF_OPTIONAL,szFileName) + KVSM_PARAMETER("relative_path", KVS_PT_STRING, KVS_PF_OPTIONAL, szFileName) KVSM_PARAMETERS_END(c) if(szFileName.isEmpty()) szFileName.append(KVI_PATH_SEPARATOR_CHAR); QString szPath = QDir::currentPath(); - KviQString::ensureLastCharIs(szPath,KVI_PATH_SEPARATOR_CHAR); + KviQString::ensureLastCharIs(szPath, KVI_PATH_SEPARATOR_CHAR); szPath.append(szFileName); KviFileUtils::adjustFilePath(szPath); c->returnValue()->setString(szPath); @@ -1373,12 +1393,12 @@ static bool file_kvs_fnc_globaldir(KviKvsModuleFunctionCall * c) { QString szFileName; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("relative_path",KVS_PT_STRING,KVS_PF_OPTIONAL,szFileName) + KVSM_PARAMETER("relative_path", KVS_PT_STRING, KVS_PF_OPTIONAL, szFileName) KVSM_PARAMETERS_END(c) if(szFileName.isEmpty()) szFileName.append(KVI_PATH_SEPARATOR_CHAR); QString szPath; - g_pApp->getGlobalKvircDirectory(szPath,KviApplication::None,szFileName); + g_pApp->getGlobalKvircDirectory(szPath, KviApplication::None, szFileName); KviFileUtils::adjustFilePath(szPath); c->returnValue()->setString(szPath); return true; @@ -1408,7 +1428,7 @@ static bool file_kvs_fnc_extractpath(KviKvsModuleFunctionCall * c) { QString szFileName; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("filepath",KVS_PT_NONEMPTYSTRING,0,szFileName) + KVSM_PARAMETER("filepath", KVS_PT_NONEMPTYSTRING, 0, szFileName) KVSM_PARAMETERS_END(c) c->returnValue()->setString(QFileInfo(szFileName).absolutePath()); return true; @@ -1437,10 +1457,10 @@ static bool file_kvs_fnc_extractfilename(KviKvsModuleFunctionCall * c) { QString szFileName; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("filepath",KVS_PT_NONEMPTYSTRING,0,szFileName) + KVSM_PARAMETER("filepath", KVS_PT_NONEMPTYSTRING, 0, szFileName) KVSM_PARAMETERS_END(c) KviFileUtils::extractFileName(szFileName); - KviQString::cutToLast(szFileName,KVI_PATH_SEPARATOR_CHAR); + KviQString::cutToLast(szFileName, KVI_PATH_SEPARATOR_CHAR); c->returnValue()->setString(szFileName); return true; } @@ -1464,7 +1484,7 @@ static bool file_kvs_fnc_diskSpace(KviKvsModuleFunctionCall * c) { QString szPath; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("dir_path",KVS_PT_STRING,KVS_PF_OPTIONAL,szPath) + KVSM_PARAMETER("dir_path", KVS_PT_STRING, KVS_PF_OPTIONAL, szPath) KVSM_PARAMETERS_END(c) if(szPath.isEmpty()) szPath = "."; @@ -1472,22 +1492,22 @@ static bool file_kvs_fnc_diskSpace(KviKvsModuleFunctionCall * c) const char * pcPath = szPath.toUtf8().data(); long long int fTotal; long long int fFree; - // this for win - #if defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW) - ULARGE_INTEGER free,total; - GetDiskFreeSpaceExA( (LPCTSTR)pcPath , NULL , &total , &free ); - fFree = free.QuadPart; - fTotal = total.QuadPart; - #else - // this one for linux and macos - struct statvfs stFileSystem; - statvfs(pcPath,&stFileSystem); - fFree = stFileSystem.f_bavail*stFileSystem.f_bsize; - fTotal = stFileSystem.f_blocks*stFileSystem.f_bsize; - #endif +// this for win +#if defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW) + ULARGE_INTEGER free, total; + GetDiskFreeSpaceExA((LPCTSTR)pcPath, NULL, &total, &free); + fFree = free.QuadPart; + fTotal = total.QuadPart; +#else + // this one for linux and macos + struct statvfs stFileSystem; + statvfs(pcPath, &stFileSystem); + fFree = stFileSystem.f_bavail * stFileSystem.f_bsize; + fTotal = stFileSystem.f_blocks * stFileSystem.f_bsize; +#endif KviKvsHash * pHash = new KviKvsHash(); - pHash->set("freespace",new KviKvsVariant((kvs_int_t) fFree)); - pHash->set("totalspace",new KviKvsVariant((kvs_int_t) fTotal)); + pHash->set("freespace", new KviKvsVariant((kvs_int_t)fFree)); + pHash->set("totalspace", new KviKvsVariant((kvs_int_t)fTotal)); c->returnValue()->setHash(pHash); return true; } @@ -1511,11 +1531,11 @@ static bool file_kvs_fnc_diskSpace(KviKvsModuleFunctionCall * c) static bool file_kvs_fnc_digest(KviKvsModuleFunctionCall * c) { - QString szFile,szAlgo,szResult; + QString szFile, szAlgo, szResult; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("data",KVS_PT_NONEMPTYSTRING,0,szFile) - KVSM_PARAMETER("algorithm",KVS_PT_STRING,KVS_PF_OPTIONAL,szAlgo) + KVSM_PARAMETER("data", KVS_PT_NONEMPTYSTRING, 0, szFile) + KVSM_PARAMETER("algorithm", KVS_PT_STRING, KVS_PF_OPTIONAL, szAlgo) KVSM_PARAMETERS_END(c) KviFileUtils::adjustFilePath(szFile); @@ -1523,7 +1543,7 @@ static bool file_kvs_fnc_digest(KviKvsModuleFunctionCall * c) QFile file(szFile); if(!file.open(QIODevice::ReadOnly)) { - c->warning(__tr2qs("Can't open the file '%Q' for reading"),&szFile); + c->warning(__tr2qs("Can't open the file '%Q' for reading"), &szFile); return true; } @@ -1548,7 +1568,7 @@ static bool file_kvs_fnc_digest(KviKvsModuleFunctionCall * c) pMD = EVP_get_digestbyname(szAlgo.toUtf8().data()); if(!pMD) { - c->warning(__tr2qs("'%Q' algorithm is not supported"),&szAlgo); + c->warning(__tr2qs("'%Q' algorithm is not supported"), &szAlgo); return true; } @@ -1561,9 +1581,9 @@ static bool file_kvs_fnc_digest(KviKvsModuleFunctionCall * c) for(u = 0; u < uMDLen; u++) { #if defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW) - _snprintf(cBuffer,3,"%02x",ucMDValue[u]); + _snprintf(cBuffer, 3, "%02x", ucMDValue[u]); #else - snprintf(cBuffer,3,"%02x",ucMDValue[u]); + snprintf(cBuffer, 3, "%02x", ucMDValue[u]); #endif szResult.append(cBuffer); } @@ -1572,18 +1592,22 @@ static bool file_kvs_fnc_digest(KviKvsModuleFunctionCall * c) if(szAlgo.toLower() == "sha1") { qAlgo = QCryptographicHash::Sha1; - } else if(szAlgo.toLower() == "md4") + } + else if(szAlgo.toLower() == "md4") { qAlgo = QCryptographicHash::Md4; - } else if(szAlgo.toLower() == "md5") + } + else if(szAlgo.toLower() == "md5") { qAlgo = QCryptographicHash::Md5; - } else { + } + else + { c->warning(__tr2qs("KVIrc is compiled without Crypto++ or SSL support. $file.digest supports only MD4, MD5 and SHA1.")); return true; } - szResult.append(QCryptographicHash::hash(content,qAlgo).toHex()); + szResult.append(QCryptographicHash::hash(content, qAlgo).toHex()); #endif c->returnValue()->setString(szResult); @@ -1622,8 +1646,8 @@ static bool file_kvs_fnc_time(KviKvsModuleFunctionCall * c) QString szFileName, szType; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("filename",KVS_PT_STRING,0,szFileName) - KVSM_PARAMETER("type",KVS_PT_STRING,KVS_PF_OPTIONAL,szType) + KVSM_PARAMETER("filename", KVS_PT_STRING, 0, szFileName) + KVSM_PARAMETER("type", KVS_PT_STRING, KVS_PF_OPTIONAL, szType) KVSM_PARAMETERS_END(c) KviFileUtils::adjustFilePath(szFileName); @@ -1638,13 +1662,17 @@ static bool file_kvs_fnc_time(KviKvsModuleFunctionCall * c) if(szType.toLower() == "a") { time = f.lastRead(); - } else if(szType.toLower() == "c") + } + else if(szType.toLower() == "c") { time = f.created(); - } else if(szType.toLower() == "m") + } + else if(szType.toLower() == "m") { time = f.lastModified(); - } else { + } + else + { c->warning(__tr2qs("Unknown option '%1', defaulting to 'm'").arg(szType)); time = f.lastModified(); } @@ -1656,37 +1684,37 @@ static bool file_kvs_fnc_time(KviKvsModuleFunctionCall * c) static bool file_module_init(KviModule * m) { - KVSM_REGISTER_SIMPLE_COMMAND(m,"addimagepath",file_kvs_cmd_addimagepath); - KVSM_REGISTER_SIMPLE_COMMAND(m,"copy",file_kvs_cmd_copy); - KVSM_REGISTER_SIMPLE_COMMAND(m,"delimagepath",file_kvs_cmd_delimagepath); - KVSM_REGISTER_SIMPLE_COMMAND(m,"mkdir",file_kvs_cmd_mkdir); - KVSM_REGISTER_SIMPLE_COMMAND(m,"remove",file_kvs_cmd_remove); - KVSM_REGISTER_SIMPLE_COMMAND(m,"rename",file_kvs_cmd_rename); - KVSM_REGISTER_SIMPLE_COMMAND(m,"rmdir",file_kvs_cmd_rmdir); - KVSM_REGISTER_SIMPLE_COMMAND(m,"write",file_kvs_cmd_write); - KVSM_REGISTER_SIMPLE_COMMAND(m,"writeBytes",file_kvs_cmd_writeBytes); - KVSM_REGISTER_SIMPLE_COMMAND(m,"writeLines",file_kvs_cmd_writeLines); - - KVSM_REGISTER_FUNCTION(m,"allsizes",file_kvs_fnc_allSizes); - KVSM_REGISTER_FUNCTION(m,"cwd",file_kvs_fnc_cwd); - KVSM_REGISTER_FUNCTION(m,"digest",file_kvs_fnc_digest); - KVSM_REGISTER_FUNCTION(m,"diskspace",file_kvs_fnc_diskSpace); - KVSM_REGISTER_FUNCTION(m,"exists",file_kvs_fnc_exists); - KVSM_REGISTER_FUNCTION(m,"extractfilename",file_kvs_fnc_extractfilename); - KVSM_REGISTER_FUNCTION(m,"extractpath",file_kvs_fnc_extractpath); - KVSM_REGISTER_FUNCTION(m,"fixpath",file_kvs_fnc_fixpath); - KVSM_REGISTER_FUNCTION(m,"globaldir",file_kvs_fnc_globaldir); - KVSM_REGISTER_FUNCTION(m,"homedir",file_kvs_fnc_homedir); - KVSM_REGISTER_FUNCTION(m,"localdir",file_kvs_fnc_localdir); - KVSM_REGISTER_FUNCTION(m,"ls",file_kvs_fnc_ls); - KVSM_REGISTER_FUNCTION(m,"ps",file_kvs_fnc_ps); - KVSM_REGISTER_FUNCTION(m,"read",file_kvs_fnc_read); - KVSM_REGISTER_FUNCTION(m,"readBytes",file_kvs_fnc_readBytes); - KVSM_REGISTER_FUNCTION(m,"readLines",file_kvs_fnc_readLines); - KVSM_REGISTER_FUNCTION(m,"rootdir",file_kvs_fnc_rootdir); - KVSM_REGISTER_FUNCTION(m,"size",file_kvs_fnc_size); - KVSM_REGISTER_FUNCTION(m,"time",file_kvs_fnc_time); - KVSM_REGISTER_FUNCTION(m,"type",file_kvs_fnc_type); + KVSM_REGISTER_SIMPLE_COMMAND(m, "addimagepath", file_kvs_cmd_addimagepath); + KVSM_REGISTER_SIMPLE_COMMAND(m, "copy", file_kvs_cmd_copy); + KVSM_REGISTER_SIMPLE_COMMAND(m, "delimagepath", file_kvs_cmd_delimagepath); + KVSM_REGISTER_SIMPLE_COMMAND(m, "mkdir", file_kvs_cmd_mkdir); + KVSM_REGISTER_SIMPLE_COMMAND(m, "remove", file_kvs_cmd_remove); + KVSM_REGISTER_SIMPLE_COMMAND(m, "rename", file_kvs_cmd_rename); + KVSM_REGISTER_SIMPLE_COMMAND(m, "rmdir", file_kvs_cmd_rmdir); + KVSM_REGISTER_SIMPLE_COMMAND(m, "write", file_kvs_cmd_write); + KVSM_REGISTER_SIMPLE_COMMAND(m, "writeBytes", file_kvs_cmd_writeBytes); + KVSM_REGISTER_SIMPLE_COMMAND(m, "writeLines", file_kvs_cmd_writeLines); + + KVSM_REGISTER_FUNCTION(m, "allsizes", file_kvs_fnc_allSizes); + KVSM_REGISTER_FUNCTION(m, "cwd", file_kvs_fnc_cwd); + KVSM_REGISTER_FUNCTION(m, "digest", file_kvs_fnc_digest); + KVSM_REGISTER_FUNCTION(m, "diskspace", file_kvs_fnc_diskSpace); + KVSM_REGISTER_FUNCTION(m, "exists", file_kvs_fnc_exists); + KVSM_REGISTER_FUNCTION(m, "extractfilename", file_kvs_fnc_extractfilename); + KVSM_REGISTER_FUNCTION(m, "extractpath", file_kvs_fnc_extractpath); + KVSM_REGISTER_FUNCTION(m, "fixpath", file_kvs_fnc_fixpath); + KVSM_REGISTER_FUNCTION(m, "globaldir", file_kvs_fnc_globaldir); + KVSM_REGISTER_FUNCTION(m, "homedir", file_kvs_fnc_homedir); + KVSM_REGISTER_FUNCTION(m, "localdir", file_kvs_fnc_localdir); + KVSM_REGISTER_FUNCTION(m, "ls", file_kvs_fnc_ls); + KVSM_REGISTER_FUNCTION(m, "ps", file_kvs_fnc_ps); + KVSM_REGISTER_FUNCTION(m, "read", file_kvs_fnc_read); + KVSM_REGISTER_FUNCTION(m, "readBytes", file_kvs_fnc_readBytes); + KVSM_REGISTER_FUNCTION(m, "readLines", file_kvs_fnc_readLines); + KVSM_REGISTER_FUNCTION(m, "rootdir", file_kvs_fnc_rootdir); + KVSM_REGISTER_FUNCTION(m, "size", file_kvs_fnc_size); + KVSM_REGISTER_FUNCTION(m, "time", file_kvs_fnc_time); + KVSM_REGISTER_FUNCTION(m, "type", file_kvs_fnc_type); return true; } @@ -1697,15 +1725,14 @@ static bool file_module_cleanup(KviModule *) } KVIRC_MODULE( - "File", // module name - "4.0.0", // module version - "Copyright (C) 2001 Szymon Stefanek (pragma at kvirc dot net)" \ - " (C) 2010 Elvio Basello (hell at hellvis69 dot netsons dot org)" \ - " (C) 2012 Elvio Basello (hellvis69 at gmail dot com)", // author & (C) - "Interface to the file system", - file_module_init, - 0, - 0, - file_module_cleanup, - 0 -) + "File", // module name + "4.0.0", // module version + "Copyright (C) 2001 Szymon Stefanek (pragma at kvirc dot net)" + " (C) 2010 Elvio Basello (hell at hellvis69 dot netsons dot org)" + " (C) 2012 Elvio Basello (hellvis69 at gmail dot com)", // author & (C) + "Interface to the file system", + file_module_init, + 0, + 0, + file_module_cleanup, + 0) diff --git a/src/modules/filetransferwindow/FileTransferWindow.cpp b/src/modules/filetransferwindow/FileTransferWindow.cpp index 84151da57..5eb2ba172 100644 --- a/src/modules/filetransferwindow/FileTransferWindow.cpp +++ b/src/modules/filetransferwindow/FileTransferWindow.cpp @@ -52,28 +52,27 @@ #include #ifdef COMPILE_KDE4_SUPPORT - #include - #include - #include - #include - #include +#include +#include +#include +#include +#include #endif //COMPILE_KDE4_SUPPORT #if defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW) - #include +#include #endif #ifdef COMPILE_PSEUDO_TRANSPARENCY - extern KVIRC_API QPixmap * g_pShadedChildGlobalDesktopBackground; +extern KVIRC_API QPixmap * g_pShadedChildGlobalDesktopBackground; #endif #define FILETRANSFERW_CELLSIZE 70 extern FileTransferWindow * g_pFileTransferWindow; - -FileTransferItem::FileTransferItem(FileTransferWidget * v,KviFileTransfer * t) -: KviTalTableWidgetItemEx(v) +FileTransferItem::FileTransferItem(FileTransferWidget * v, KviFileTransfer * t) + : KviTalTableWidgetItemEx(v) { m_pTransfer = t; m_pTransfer->setDisplayItem(this); @@ -82,7 +81,7 @@ FileTransferItem::FileTransferItem(FileTransferWidget * v,KviFileTransfer * t) col1Item = new KviTalTableWidgetItem(v, row(), 1); col2Item = new KviTalTableWidgetItem(v, row(), 2); //FIXME fixed row height - tableWidget()->setRowHeight( row(), FILETRANSFERW_CELLSIZE ); + tableWidget()->setRowHeight(row(), FILETRANSFERW_CELLSIZE); } FileTransferItem::~FileTransferItem() @@ -95,30 +94,35 @@ FileTransferItem::~FileTransferItem() void FileTransferItem::displayUpdate() { //FIXME this hurts - int dummy = (int) time(NULL); - tableWidget()->model()->setData(tableWidget()->model()->index(row(),0), dummy, Qt::DisplayRole); - tableWidget()->model()->setData(tableWidget()->model()->index(row(),1), dummy, Qt::DisplayRole); - tableWidget()->model()->setData(tableWidget()->model()->index(row(),2), dummy, Qt::DisplayRole); + int dummy = (int)time(NULL); + tableWidget()->model()->setData(tableWidget()->model()->index(row(), 0), dummy, Qt::DisplayRole); + tableWidget()->model()->setData(tableWidget()->model()->index(row(), 1), dummy, Qt::DisplayRole); + tableWidget()->model()->setData(tableWidget()->model()->index(row(), 2), dummy, Qt::DisplayRole); } -QString FileTransferItem::key(int,bool) const +QString FileTransferItem::key(int, bool) const { QString ret; ret.setNum(m_pTransfer->id()); - if(ret.length() == 1)ret.prepend("0000000"); - else if(ret.length() == 2)ret.prepend("000000"); - else if(ret.length() == 3)ret.prepend("00000"); - else if(ret.length() == 4)ret.prepend("0000"); - else if(ret.length() == 5)ret.prepend("000"); - else if(ret.length() == 6)ret.prepend("00"); - else if(ret.length() == 7)ret.prepend("0"); + if(ret.length() == 1) + ret.prepend("0000000"); + else if(ret.length() == 2) + ret.prepend("000000"); + else if(ret.length() == 3) + ret.prepend("00000"); + else if(ret.length() == 4) + ret.prepend("0000"); + else if(ret.length() == 5) + ret.prepend("000"); + else if(ret.length() == 6) + ret.prepend("00"); + else if(ret.length() == 7) + ret.prepend("0"); return ret; } - - FileTransferWidget::FileTransferWidget(QWidget * pParent) -: KviTalTableWidget(pParent) + : KviTalTableWidget(pParent) { //hide the header verticalHeader()->hide(); @@ -135,9 +139,9 @@ FileTransferWidget::FileTransferWidget(QWidget * pParent) setColumnCount(3); QStringList colHeaders; - colHeaders << __tr2qs_ctx("Type","filetransferwindow") - << __tr2qs_ctx("Information","filetransferwindow") - << __tr2qs_ctx("Progress","filetransferwindow"); + colHeaders << __tr2qs_ctx("Type", "filetransferwindow") + << __tr2qs_ctx("Information", "filetransferwindow") + << __tr2qs_ctx("Progress", "filetransferwindow"); setHorizontalHeaderLabels(colHeaders); //default column widths setColumnWidth(0, FILETRANSFERW_CELLSIZE); @@ -150,38 +154,40 @@ FileTransferWidget::FileTransferWidget(QWidget * pParent) viewport()->setFocusPolicy(Qt::NoFocus); } -void FileTransferWidget::mousePressEvent (QMouseEvent *e) +void FileTransferWidget::mousePressEvent(QMouseEvent * e) { - if (e->button() == Qt::RightButton) + if(e->button() == Qt::RightButton) { // we have 3 items: the one on the first column is the real one (has a transfer() member) // others are just fakes - QTableWidgetItem *clicked = itemAt(e->pos()); + QTableWidgetItem * clicked = itemAt(e->pos()); if(clicked) { - FileTransferItem *i = (FileTransferItem*) item(clicked->row(),0); - if (i) emit rightButtonPressed(i, QCursor::pos()); + FileTransferItem * i = (FileTransferItem *)item(clicked->row(), 0); + if(i) + emit rightButtonPressed(i, QCursor::pos()); } } QTableWidget::mousePressEvent(e); } -void FileTransferWidget::mouseDoubleClickEvent (QMouseEvent *e) +void FileTransferWidget::mouseDoubleClickEvent(QMouseEvent * e) { // we have 3 items: the one on the first column is the real one (has a transfer() member) // others are just fakes - QTableWidgetItem *clicked = itemAt(e->pos()); + QTableWidgetItem * clicked = itemAt(e->pos()); if(clicked) { - FileTransferItem *i = (FileTransferItem*) item(clicked->row(),0); - if (i) emit doubleClicked(i,QCursor::pos()); + FileTransferItem * i = (FileTransferItem *)item(clicked->row(), 0); + if(i) + emit doubleClicked(i, QCursor::pos()); } QTableWidget::mouseDoubleClickEvent(e); } void FileTransferWidget::paintEvent(QPaintEvent * event) { - QPainter *p = new QPainter(viewport()); + QPainter * p = new QPainter(viewport()); QStyleOptionViewItem option = viewOptions(); QRect rect = event->rect(); @@ -190,18 +196,21 @@ void FileTransferWidget::paintEvent(QPaintEvent * event) { p->save(); p->setCompositionMode(QPainter::CompositionMode_Source); - QColor col=KVI_OPTION_COLOR(KviOption_colorGlobalTransparencyFade); + QColor col = KVI_OPTION_COLOR(KviOption_colorGlobalTransparencyFade); col.setAlphaF((float)((float)KVI_OPTION_UINT(KviOption_uintGlobalTransparencyChildFadeFactor) / (float)100)); p->fillRect(rect, col); p->restore(); - } else if(g_pShadedChildGlobalDesktopBackground) + } + else if(g_pShadedChildGlobalDesktopBackground) { QPoint pnt = g_pFileTransferWindow->isDocked() ? viewport()->mapTo(g_pMainWindow, rect.topLeft()) : viewport()->mapTo(g_pFileTransferWindow, rect.topLeft()); - p->drawTiledPixmap(rect,*(g_pShadedChildGlobalDesktopBackground), pnt); - } else { + p->drawTiledPixmap(rect, *(g_pShadedChildGlobalDesktopBackground), pnt); + } + else + { #endif //FIXME this is not the treewindowlist - p->fillRect(rect,KVI_OPTION_COLOR(KviOption_colorTreeWindowListBackground)); + p->fillRect(rect, KVI_OPTION_COLOR(KviOption_colorTreeWindowListBackground)); #ifdef COMPILE_PSEUDO_TRANSPARENCY } #endif @@ -214,22 +223,22 @@ void FileTransferWidget::paintEvent(QPaintEvent * event) void FileTransferItemDelegate::paint(QPainter * p, const QStyleOptionViewItem & option, const QModelIndex & index) const { //FIXME not exactly model/view coding style.. but we need to access data on the item by now - FileTransferWidget* tableWidget = (FileTransferWidget*)parent(); - FileTransferItem* item = (FileTransferItem*) tableWidget->itemFromIndex(index); - - if(!item) return; - KviFileTransfer* transfer = ((FileTransferItem*)tableWidget->item(item->row(), 0))->transfer(); + FileTransferWidget * tableWidget = (FileTransferWidget *)parent(); + FileTransferItem * item = (FileTransferItem *)tableWidget->itemFromIndex(index); + if(!item) + return; + KviFileTransfer * transfer = ((FileTransferItem *)tableWidget->item(item->row(), 0))->transfer(); p->setFont(option.font); p->setPen(option.state & QStyle::State_Selected ? option.palette.highlight().color() : option.palette.base().color()); p->drawRect(option.rect); - p->setPen(transfer->active() ? QColor(180,180,180) : QColor(200,200,200)); + p->setPen(transfer->active() ? QColor(180, 180, 180) : QColor(200, 200, 200)); - p->drawRect(option.rect.left() + 1, option.rect.top() + 1, option.rect.width() - 2,option.rect.height() - 2); - p->fillRect(option.rect.left() + 2, option.rect.top() + 2, option.rect.width() - 4, option.rect.height() - 4,transfer->active() ? QColor(240,240,240) : QColor(225,225,225)); + p->drawRect(option.rect.left() + 1, option.rect.top() + 1, option.rect.width() - 2, option.rect.height() - 2); + p->fillRect(option.rect.left() + 2, option.rect.top() + 2, option.rect.width() - 4, option.rect.height() - 4, transfer->active() ? QColor(240, 240, 240) : QColor(225, 225, 225)); transfer->displayPaint(p, index.column(), option.rect); } @@ -237,15 +246,15 @@ void FileTransferItemDelegate::paint(QPainter * p, const QStyleOptionViewItem & QSize FileTransferItemDelegate::sizeHint(const QStyleOptionViewItem &, const QModelIndex &) const { // FIXME fixed width - return QSize(((FileTransferWidget*)parent())->viewport()->size().width(), 68); + return QSize(((FileTransferWidget *)parent())->viewport()->size().width(), 68); } FileTransferWindow::FileTransferWindow( #if 0 KviModuleExtensionDescriptor * d #endif - ) -: KviWindow(KviWindow::Tool,"file transfer window",0) + ) + : KviWindow(KviWindow::Tool, "file transfer window", 0) #if 0 , KviModuleExtension(d) #endif @@ -258,23 +267,23 @@ FileTransferWindow::FileTransferWindow( m_pOpenFilePopup = 0; m_pTimer = new QTimer(this); - connect(m_pTimer,SIGNAL(timeout()),this,SLOT(heartbeat())); + connect(m_pTimer, SIGNAL(timeout()), this, SLOT(heartbeat())); - m_pSplitter = new KviTalSplitter(Qt::Horizontal,this); + m_pSplitter = new KviTalSplitter(Qt::Horizontal, this); m_pSplitter->setObjectName("transferwindow_hsplitter"); m_pSplitter->setChildrenCollapsible(false); - m_pVertSplitter = new KviTalSplitter(Qt::Vertical,m_pSplitter); + m_pVertSplitter = new KviTalSplitter(Qt::Vertical, m_pSplitter); m_pVertSplitter->setObjectName("transferwindow_vsplitter"); m_pVertSplitter->setChildrenCollapsible(false); - m_pTableWidget = new FileTransferWidget(m_pVertSplitter); + m_pTableWidget = new FileTransferWidget(m_pVertSplitter); //ad-hoc itemdelegate for this view m_pItemDelegate = new FileTransferItemDelegate(m_pTableWidget); m_pTableWidget->setItemDelegate(m_pItemDelegate); -/* + /* * TODO KviDynamicToolTip * tp = new KviDynamicToolTip(m_pTableWidget->viewport()); connect(tp,SIGNAL(tipRequest(KviDynamicToolTip *,const QPoint &)),this,SLOT(tipRequest(KviDynamicToolTip *,const QPoint &))); @@ -283,17 +292,17 @@ FileTransferWindow::FileTransferWindow( QFontMetrics fm(font()); m_iLineSpacing = fm.lineSpacing(); - m_pIrcView = new KviIrcView(m_pVertSplitter,this); + m_pIrcView = new KviIrcView(m_pVertSplitter, this); m_pTableWidget->installEventFilter(this); - connect(m_pTableWidget,SIGNAL(rightButtonPressed(FileTransferItem *,QPoint)), - this,SLOT(rightButtonPressed(FileTransferItem *,QPoint))); - connect(m_pTableWidget,SIGNAL(doubleClicked(FileTransferItem *,const QPoint &)),this,SLOT(doubleClicked(FileTransferItem *,const QPoint &))); + connect(m_pTableWidget, SIGNAL(rightButtonPressed(FileTransferItem *, QPoint)), + this, SLOT(rightButtonPressed(FileTransferItem *, QPoint))); + connect(m_pTableWidget, SIGNAL(doubleClicked(FileTransferItem *, const QPoint &)), this, SLOT(doubleClicked(FileTransferItem *, const QPoint &))); fillTransferView(); - connect(KviFileTransferManager::instance(),SIGNAL(transferRegistered(KviFileTransfer *)),this,SLOT(transferRegistered(KviFileTransfer *))); - connect(KviFileTransferManager::instance(),SIGNAL(transferUnregistering(KviFileTransfer *)),this,SLOT(transferUnregistering(KviFileTransfer *))); + connect(KviFileTransferManager::instance(), SIGNAL(transferRegistered(KviFileTransfer *)), this, SLOT(transferRegistered(KviFileTransfer *))); + connect(KviFileTransferManager::instance(), SIGNAL(transferUnregistering(KviFileTransfer *)), this, SLOT(transferUnregistering(KviFileTransfer *))); KviFileTransferManager::instance()->setTransferWindow(this); @@ -306,15 +315,15 @@ FileTransferWindow::~FileTransferWindow() g_pFileTransferWindow = 0; } -bool FileTransferWindow::eventFilter( QObject *obj, QEvent *ev ) +bool FileTransferWindow::eventFilter(QObject * obj, QEvent * ev) { - if( ( ev->type() == QEvent::KeyPress ) ) + if((ev->type() == QEvent::KeyPress)) { //m_pTableWidget could not have been initialized yet when FileTransferWindow //will receive the first events.. but it will surely be on a keypress event - if(obj==m_pTableWidget) + if(obj == m_pTableWidget) { - QKeyEvent *keyEvent = (QKeyEvent*)ev; + QKeyEvent * keyEvent = (QKeyEvent *)ev; switch(keyEvent->key()) { case Qt::Key_Delete: @@ -327,25 +336,27 @@ bool FileTransferWindow::eventFilter( QObject *obj, QEvent *ev ) } } } - return KviWindow::eventFilter( obj, ev ); + return KviWindow::eventFilter(obj, ev); } -void FileTransferWindow::tipRequest(KviDynamicToolTip * tip,const QPoint &pnt) +void FileTransferWindow::tipRequest(KviDynamicToolTip * tip, const QPoint & pnt) { FileTransferItem * it = (FileTransferItem *)m_pTableWidget->itemAt(pnt); - if(!it)return; + if(!it) + return; QString txt = it->transfer()->tipText(); - tip->tip(m_pTableWidget->visualItemRect(it),txt); + tip->tip(m_pTableWidget->visualItemRect(it), txt); } void FileTransferWindow::fillTransferView() { KviPointerList * l = KviFileTransferManager::instance()->transferList(); - if(!l)return; + if(!l) + return; FileTransferItem * it; - for(KviFileTransfer * t = l->first();t;t = l->next()) + for(KviFileTransfer * t = l->first(); t; t = l->next()) { - it = new FileTransferItem(m_pTableWidget,t); + it = new FileTransferItem(m_pTableWidget, t); t->setDisplayItem(it); } } @@ -355,10 +366,11 @@ FileTransferItem * FileTransferWindow::findItem(KviFileTransfer * t) int i; FileTransferItem * it; - for(i=0;irowCount();i++) + for(i = 0; i < m_pTableWidget->rowCount(); i++) { - it = (FileTransferItem *)m_pTableWidget->item(i,0); - if(!it) continue; + it = (FileTransferItem *)m_pTableWidget->item(i, 0); + if(!it) + continue; if(it->transfer() == t) return it; @@ -368,7 +380,7 @@ FileTransferItem * FileTransferWindow::findItem(KviFileTransfer * t) void FileTransferWindow::transferRegistered(KviFileTransfer * t) { - new FileTransferItem(m_pTableWidget,t); + new FileTransferItem(m_pTableWidget, t); //t->setDisplayItem(it); } @@ -383,24 +395,27 @@ void FileTransferWindow::transferUnregistering(KviFileTransfer * t) } } -void FileTransferWindow::doubleClicked(FileTransferItem *it,const QPoint &) +void FileTransferWindow::doubleClicked(FileTransferItem * it, const QPoint &) { - if(it) openLocalFile(); + if(it) + openLocalFile(); } -void FileTransferWindow::rightButtonPressed(FileTransferItem *it,const QPoint &pnt) +void FileTransferWindow::rightButtonPressed(FileTransferItem * it, const QPoint & pnt) { - if(!m_pContextPopup)m_pContextPopup = new QMenu(this); - if(!m_pLocalFilePopup)m_pLocalFilePopup = new QMenu(this); + if(!m_pContextPopup) + m_pContextPopup = new QMenu(this); + if(!m_pLocalFilePopup) + m_pLocalFilePopup = new QMenu(this); if(!m_pOpenFilePopup) { - m_pOpenFilePopup= new QMenu(this); - connect(m_pOpenFilePopup,SIGNAL(triggered(QAction*)),this,SLOT(openFilePopupActivated(QAction*))); + m_pOpenFilePopup = new QMenu(this); + connect(m_pOpenFilePopup, SIGNAL(triggered(QAction *)), this, SLOT(openFilePopupActivated(QAction *))); } m_pContextPopup->clear(); - QAction *pAction; + QAction * pAction; if(it) { @@ -421,7 +436,7 @@ void FileTransferWindow::rightButtonPressed(FileTransferItem *it,const QPoint &p QFileInfo fi(szFile); if(fi.exists()) { - tmp += __tr2qs_ctx("Size: %1","filetransferwindow").arg(KviQString::makeSizeReadable(fi.size())); + tmp += __tr2qs_ctx("Size: %1", "filetransferwindow").arg(KviQString::makeSizeReadable(fi.size())); } #ifdef COMPILE_KDE4_SUPPORT @@ -434,15 +449,15 @@ void FileTransferWindow::rightButtonPressed(FileTransferItem *it,const QPoint &p QLabel * l = new QLabel(tmp, m_pLocalFilePopup); QPalette p; l->setStyleSheet("background-color: " + p.color(QPalette::Normal, QPalette::Mid).name()); - l->setContentsMargins(5,5,5,5); + l->setContentsMargins(5, 5, 5, 5); pWaction->setDefaultWidget(l); m_pLocalFilePopup->addAction(pWaction); #ifdef COMPILE_KDE4_SUPPORT QString mimetype = KMimeType::findByPath(szFile)->name(); - KService::List offers = KMimeTypeTrader::self()->query(mimetype,"Application"); + KService::List offers = KMimeTypeTrader::self()->query(mimetype, "Application"); - pAction = m_pLocalFilePopup->addAction(__tr2qs_ctx("&Open","filetransferwindow"),this,SLOT(openLocalFile())); + pAction = m_pLocalFilePopup->addAction(__tr2qs_ctx("&Open", "filetransferwindow"), this, SLOT(openLocalFile())); pAction->setData(-1); m_pOpenFilePopup->clear(); @@ -450,62 +465,60 @@ void FileTransferWindow::rightButtonPressed(FileTransferItem *it,const QPoint &p int idx = 0; for(KService::List::Iterator itOffers = offers.begin(); - itOffers != offers.end(); ++itOffers) + itOffers != offers.end(); ++itOffers) { pAction = m_pOpenFilePopup->addAction( - SmallIcon((*itOffers).data()->icon()), - (*itOffers).data()->name() - ); + SmallIcon((*itOffers).data()->icon()), + (*itOffers).data()->name()); pAction->setData(idx); idx++; } - m_pOpenFilePopup->addSeparator(); + m_pOpenFilePopup->addSeparator(); - pAction = m_pOpenFilePopup->addAction(__tr2qs_ctx("&Other...","filetransferwindow"),this,SLOT(openLocalFileWith())); + pAction = m_pOpenFilePopup->addAction(__tr2qs_ctx("&Other...", "filetransferwindow"), this, SLOT(openLocalFileWith())); pAction->setData(-1); - m_pLocalFilePopup->addAction(__tr2qs_ctx("Open &With","filetransferwindow"))->setMenu(m_pOpenFilePopup); - m_pLocalFilePopup->addSeparator(); - m_pLocalFilePopup->addAction(__tr2qs_ctx("Open &Location","filetransferwindow"),this,SLOT(openLocalFileFolder())); - m_pLocalFilePopup->addAction(__tr2qs_ctx("Terminal at Location","filetransferwindow"),this,SLOT(openLocalFileTerminal())); - m_pLocalFilePopup->addSeparator(); + m_pLocalFilePopup->addAction(__tr2qs_ctx("Open &With", "filetransferwindow"))->setMenu(m_pOpenFilePopup); + m_pLocalFilePopup->addSeparator(); + m_pLocalFilePopup->addAction(__tr2qs_ctx("Open &Location", "filetransferwindow"), this, SLOT(openLocalFileFolder())); + m_pLocalFilePopup->addAction(__tr2qs_ctx("Terminal at Location", "filetransferwindow"), this, SLOT(openLocalFileTerminal())); + m_pLocalFilePopup->addSeparator(); #endif //COMPILE_KDE4_SUPPORT //-| Grifisx & Noldor |- #if defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW) - pAction = m_pLocalFilePopup->addAction(__tr2qs_ctx("&Open","filetransferwindow"),this,SLOT(openLocalFile())); + pAction = m_pLocalFilePopup->addAction(__tr2qs_ctx("&Open", "filetransferwindow"), this, SLOT(openLocalFile())); pAction->setData(-1); - m_pOpenFilePopup->addSeparator(); - m_pLocalFilePopup->addAction(__tr2qs_ctx("Open &With","filetransferwindow"),this,SLOT(openLocalFileWith())); - m_pLocalFilePopup->addSeparator(); - m_pLocalFilePopup->addAction(__tr2qs_ctx("Open &Location","filetransferwindow"),this,SLOT(openLocalFileFolder())); - m_pLocalFilePopup->addAction(__tr2qs_ctx("MS-DOS Prompt at Location","filetransferwindow"),this,SLOT(openLocalFileTerminal())); - m_pLocalFilePopup->addSeparator(); + m_pOpenFilePopup->addSeparator(); + m_pLocalFilePopup->addAction(__tr2qs_ctx("Open &With", "filetransferwindow"), this, SLOT(openLocalFileWith())); + m_pLocalFilePopup->addSeparator(); + m_pLocalFilePopup->addAction(__tr2qs_ctx("Open &Location", "filetransferwindow"), this, SLOT(openLocalFileFolder())); + m_pLocalFilePopup->addAction(__tr2qs_ctx("MS-DOS Prompt at Location", "filetransferwindow"), this, SLOT(openLocalFileTerminal())); + m_pLocalFilePopup->addSeparator(); #endif // G&N end - m_pLocalFilePopup->addAction(__tr2qs_ctx("&Copy Path to Clipboard","filetransferwindow"),this,SLOT(copyLocalFileToClipboard())); + m_pLocalFilePopup->addAction(__tr2qs_ctx("&Copy Path to Clipboard", "filetransferwindow"), this, SLOT(copyLocalFileToClipboard())); - pAction = m_pLocalFilePopup->addAction(__tr2qs_ctx("&Delete File","filetransferwindow"),this,SLOT(deleteLocalFile())); - pAction->setEnabled(i->transfer()->terminated()); - pAction = m_pContextPopup->addAction(__tr2qs_ctx("Local &File","filetransferwindow")); - pAction->setMenu(m_pLocalFilePopup); + pAction = m_pLocalFilePopup->addAction(__tr2qs_ctx("&Delete File", "filetransferwindow"), this, SLOT(deleteLocalFile())); + pAction->setEnabled(i->transfer()->terminated()); + pAction = m_pContextPopup->addAction(__tr2qs_ctx("Local &File", "filetransferwindow")); + pAction->setMenu(m_pLocalFilePopup); } i->transfer()->fillContextPopup(m_pContextPopup); - m_pContextPopup->addSeparator(); + m_pContextPopup->addSeparator(); } } - bool bHaveTerminated = false; int i; FileTransferItem * item; - for(i=0;irowCount();i++) + for(i = 0; i < m_pTableWidget->rowCount(); i++) { - item = (FileTransferItem *)m_pTableWidget->item(i,0); + item = (FileTransferItem *)m_pTableWidget->item(i, 0); if(!item) continue; @@ -516,49 +529,51 @@ void FileTransferWindow::rightButtonPressed(FileTransferItem *it,const QPoint &p } } - pAction = m_pContextPopup->addAction(__tr2qs_ctx("&Clear Terminated","filetransferwindow"),this,SLOT(clearTerminated())); + pAction = m_pContextPopup->addAction(__tr2qs_ctx("&Clear Terminated", "filetransferwindow"), this, SLOT(clearTerminated())); pAction->setEnabled(bHaveTerminated); bool bAreTransfersActive = false; if(m_pTableWidget->rowCount() >= 1) bAreTransfersActive = true; - pAction = m_pContextPopup->addAction(__tr2qs_ctx("Clear &All","filetransferwindow"),this,SLOT(clearAll())); + pAction = m_pContextPopup->addAction(__tr2qs_ctx("Clear &All", "filetransferwindow"), this, SLOT(clearAll())); pAction->setEnabled(bAreTransfersActive); m_pContextPopup->popup(pnt); } - KviFileTransfer * FileTransferWindow::selectedTransfer() { - if(m_pTableWidget->selectedItems().count() == 0) return 0; + if(m_pTableWidget->selectedItems().count() == 0) + return 0; FileTransferItem * it = (FileTransferItem *)m_pTableWidget->selectedItems().first(); - if(!it)return 0; + if(!it) + return 0; FileTransferItem * i = (FileTransferItem *)it; return i->transfer(); } -void FileTransferWindow::openFilePopupActivated(QAction *pAction) +void FileTransferWindow::openFilePopupActivated(QAction * pAction) { #ifdef COMPILE_KDE4_SUPPORT - bool bOk=false; + bool bOk = false; int ip = pAction->data().toInt(&bOk); if(!bOk || ip < 0) - return; + return; KviFileTransfer * t = selectedTransfer(); - if(!t)return; + if(!t) + return; QString tmp = t->localFileName(); - if(tmp.isEmpty())return; - + if(tmp.isEmpty()) + return; QString mimetype = KMimeType::findByPath(tmp)->name(); - KService::List offers = KMimeTypeTrader::self()->query(mimetype,"Application"); + KService::List offers = KMimeTypeTrader::self()->query(mimetype, "Application"); int idx = 0; for(KService::List::Iterator itOffers = offers.begin(); - itOffers != offers.end(); ++itOffers) + itOffers != offers.end(); ++itOffers) { if(idx == ip) { @@ -566,7 +581,7 @@ void FileTransferWindow::openFilePopupActivated(QAction *pAction) KUrl url; url.setPath(tmp); lst.append(url); - KRun::run(*((*itOffers).data()),lst,g_pMainWindow); + KRun::run(*((*itOffers).data()), lst, g_pMainWindow); break; } idx++; @@ -579,32 +594,38 @@ void FileTransferWindow::openLocalFileTerminal() //-| Grifisx & Noldor |- #if defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW) KviFileTransfer * t = selectedTransfer(); - if(!t)return; + if(!t) + return; QString tmp = t->localFileName(); - if(tmp.isEmpty())return; + if(tmp.isEmpty()) + return; int idx = tmp.lastIndexOf("/"); - if(idx == -1)return; + if(idx == -1) + return; tmp = tmp.left(idx); tmp.append("\""); // FIXME: this is not a solution ...because if the drive isn't system's drive the command 'cd' naturally doesn't work tmp.prepend("cmd.exe /k cd \""); system(tmp.toLocal8Bit().data()); #else // G&N end - #ifdef COMPILE_KDE4_SUPPORT - KviFileTransfer * t = selectedTransfer(); - if(!t)return; - QString tmp = t->localFileName(); - if(tmp.isEmpty())return; +#ifdef COMPILE_KDE4_SUPPORT + KviFileTransfer * t = selectedTransfer(); + if(!t) + return; + QString tmp = t->localFileName(); + if(tmp.isEmpty()) + return; - int idx = tmp.lastIndexOf("/"); - if(idx == -1)return; - tmp = tmp.left(idx); + int idx = tmp.lastIndexOf("/"); + if(idx == -1) + return; + tmp = tmp.left(idx); - tmp.prepend("konsole --workdir=\""); - tmp.append("\""); + tmp.prepend("konsole --workdir=\""); + tmp.append("\""); - KRun::runCommand(tmp,g_pMainWindow); - #endif //COMPILE_KDE4_SUPPORT + KRun::runCommand(tmp, g_pMainWindow); +#endif //COMPILE_KDE4_SUPPORT #endif } @@ -615,16 +636,17 @@ void FileTransferWindow::deleteLocalFile() return; QString szName = pTransfer->localFileName(); - QString szTmp = QString(__tr2qs_ctx("Do you really want to delete the file %1?","filetransferwindow")).arg(szName); + QString szTmp = QString(__tr2qs_ctx("Do you really want to delete the file %1?", "filetransferwindow")).arg(szName); - if(QMessageBox::warning(this,__tr2qs_ctx("Confirm File Delete - KVIrc","filetransferwindow"), - szTmp,__tr2qs_ctx("Yes","filetransferwindow"),__tr2qs_ctx("No","filetransferwindow")) != 0) + if(QMessageBox::warning(this, __tr2qs_ctx("Confirm File Delete - KVIrc", "filetransferwindow"), + szTmp, __tr2qs_ctx("Yes", "filetransferwindow"), __tr2qs_ctx("No", "filetransferwindow")) + != 0) return; if(!QFile::remove(szName)) - QMessageBox::warning(this,__tr2qs_ctx("Deleting File Failed - KVIrc","filetransferwindow"), - __tr2qs_ctx("Failed to remove the file","filetransferwindow"), - __tr2qs_ctx("OK","filetransferwindow")); + QMessageBox::warning(this, __tr2qs_ctx("Deleting File Failed - KVIrc", "filetransferwindow"), + __tr2qs_ctx("Failed to remove the file", "filetransferwindow"), + __tr2qs_ctx("OK", "filetransferwindow")); } void FileTransferWindow::openLocalFile() @@ -633,34 +655,38 @@ void FileTransferWindow::openLocalFile() #if defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW) KviFileTransfer * t = selectedTransfer(); - if(!t)return; + if(!t) + return; QString tmp = t->localFileName(); - if(tmp.isEmpty())return; - tmp.replace("/","\\"); - ShellExecute(0,"open",tmp.toLocal8Bit().data(),NULL,NULL,SW_SHOWNORMAL); //You have to link the shell32.lib + if(tmp.isEmpty()) + return; + tmp.replace("/", "\\"); + ShellExecute(0, "open", tmp.toLocal8Bit().data(), NULL, NULL, SW_SHOWNORMAL); //You have to link the shell32.lib #else // G&N end - #ifdef COMPILE_KDE4_SUPPORT - KviFileTransfer * t = selectedTransfer(); - if(!t)return; - QString tmp = t->localFileName(); - if(tmp.isEmpty())return; - - QString mimetype = KMimeType::findByPath(tmp)->name(); //KMimeType - KService::Ptr offer = KMimeTypeTrader::self()->preferredService(mimetype,"Application"); - if(!offer) - { - openLocalFileWith(); - return; - } +#ifdef COMPILE_KDE4_SUPPORT + KviFileTransfer * t = selectedTransfer(); + if(!t) + return; + QString tmp = t->localFileName(); + if(tmp.isEmpty()) + return; - KUrl::List lst; - KUrl url; - url.setPath(tmp); - lst.append(url); + QString mimetype = KMimeType::findByPath(tmp)->name(); //KMimeType + KService::Ptr offer = KMimeTypeTrader::self()->preferredService(mimetype, "Application"); + if(!offer) + { + openLocalFileWith(); + return; + } - KRun::run(*offer, lst, g_pMainWindow); - #endif //COMPILE_KDE4_SUPPORT + KUrl::List lst; + KUrl url; + url.setPath(tmp); + lst.append(url); + + KRun::run(*offer, lst, g_pMainWindow); +#endif //COMPILE_KDE4_SUPPORT #endif } @@ -669,35 +695,41 @@ void FileTransferWindow::openLocalFileWith() //-| Grifisx & Noldor |- #if defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW) KviFileTransfer * t = selectedTransfer(); - if(!t)return; + if(!t) + return; QString tmp = t->localFileName(); - if(tmp.isEmpty())return; - tmp.replace("/","\\"); + if(tmp.isEmpty()) + return; + tmp.replace("/", "\\"); tmp.prepend("rundll32.exe shell32.dll,OpenAs_RunDLL "); // this if to show the 'open with...' window - WinExec(tmp.toLocal8Bit().data(),SW_SHOWNORMAL); + WinExec(tmp.toLocal8Bit().data(), SW_SHOWNORMAL); #else // G&N end - #ifdef COMPILE_KDE4_SUPPORT - KviFileTransfer * t = selectedTransfer(); - if(!t)return; - QString tmp = t->localFileName(); - if(tmp.isEmpty())return; - - KUrl::List lst; - KUrl url; - url.setPath(tmp); - lst.append(url); - KRun::displayOpenWithDialog(lst,g_pMainWindow); - #endif //COMPILE_KDE4_SUPPORT +#ifdef COMPILE_KDE4_SUPPORT + KviFileTransfer * t = selectedTransfer(); + if(!t) + return; + QString tmp = t->localFileName(); + if(tmp.isEmpty()) + return; + + KUrl::List lst; + KUrl url; + url.setPath(tmp); + lst.append(url); + KRun::displayOpenWithDialog(lst, g_pMainWindow); +#endif //COMPILE_KDE4_SUPPORT #endif } void FileTransferWindow::copyLocalFileToClipboard() { KviFileTransfer * t = selectedTransfer(); - if(!t)return; + if(!t) + return; QString tmp = t->localFileName(); - if(tmp.isEmpty())return; + if(tmp.isEmpty()) + return; QApplication::clipboard()->setText(tmp); } @@ -706,35 +738,41 @@ void FileTransferWindow::openLocalFileFolder() //-| Grifisx & Noldor|- #if defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW) KviFileTransfer * t = selectedTransfer(); - if(!t)return; + if(!t) + return; QString tmp = t->localFileName(); - if(tmp.isEmpty())return; - tmp=QFileInfo(tmp).absolutePath(); - tmp.replace('/','\\'); + if(tmp.isEmpty()) + return; + tmp = QFileInfo(tmp).absolutePath(); + tmp.replace('/', '\\'); tmp.prepend("explorer.exe "); WinExec(tmp.toLocal8Bit().data(), SW_MAXIMIZE); #else // G&N end - #ifdef COMPILE_KDE4_SUPPORT - KviFileTransfer * t = selectedTransfer(); - if(!t)return; - QString tmp = t->localFileName(); - if(tmp.isEmpty())return; - - int idx = tmp.lastIndexOf("/"); - if(idx == -1)return; - tmp = tmp.left(idx); - - QString mimetype = KMimeType::findByPath(tmp)->name(); // inode/directory - KService::Ptr offer = KMimeTypeTrader::self()->preferredService(mimetype,"Application"); - if(!offer)return; - - KUrl::List lst; - KUrl url; - url.setPath(tmp); - lst.append(url); - KRun::run(*offer,lst,g_pMainWindow); - #endif //COMPILE_KDE4_SUPPORT +#ifdef COMPILE_KDE4_SUPPORT + KviFileTransfer * t = selectedTransfer(); + if(!t) + return; + QString tmp = t->localFileName(); + if(tmp.isEmpty()) + return; + + int idx = tmp.lastIndexOf("/"); + if(idx == -1) + return; + tmp = tmp.left(idx); + + QString mimetype = KMimeType::findByPath(tmp)->name(); // inode/directory + KService::Ptr offer = KMimeTypeTrader::self()->preferredService(mimetype, "Application"); + if(!offer) + return; + + KUrl::List lst; + KUrl url; + url.setPath(tmp); + lst.append(url); + KRun::run(*offer, lst, g_pMainWindow); +#endif //COMPILE_KDE4_SUPPORT #endif } @@ -742,21 +780,21 @@ void FileTransferWindow::heartbeat() { int i; QModelIndex index; - FileTransferItem* it; - int dummy = (int) time(NULL); + FileTransferItem * it; + int dummy = (int)time(NULL); - for(i=0;i<=m_pTableWidget->rowCount();i++) + for(i = 0; i <= m_pTableWidget->rowCount(); i++) { - it = (FileTransferItem *)m_pTableWidget->item(i,0); + it = (FileTransferItem *)m_pTableWidget->item(i, 0); if(!it) continue; if(it->transfer()->active()) { - m_pTableWidget->model()->setData(m_pTableWidget->model()->index(i,0), dummy, Qt::DisplayRole); - m_pTableWidget->model()->setData(m_pTableWidget->model()->index(i,1), dummy, Qt::DisplayRole); - m_pTableWidget->model()->setData(m_pTableWidget->model()->index(i,2), dummy, Qt::DisplayRole); + m_pTableWidget->model()->setData(m_pTableWidget->model()->index(i, 0), dummy, Qt::DisplayRole); + m_pTableWidget->model()->setData(m_pTableWidget->model()->index(i, 1), dummy, Qt::DisplayRole); + m_pTableWidget->model()->setData(m_pTableWidget->model()->index(i, 2), dummy, Qt::DisplayRole); } } } @@ -767,9 +805,9 @@ void FileTransferWindow::clearAll() int i; FileTransferItem * pItem; - for(i=0; i < m_pTableWidget->rowCount(); i++) + for(i = 0; i < m_pTableWidget->rowCount(); i++) { - pItem = (FileTransferItem *)m_pTableWidget->item(i,0); + pItem = (FileTransferItem *)m_pTableWidget->item(i, 0); if(!pItem) continue; @@ -780,11 +818,11 @@ void FileTransferWindow::clearAll() } } - QString szTmp = __tr2qs_ctx("Clear all transfers, including any in progress?","filetransferwindow"); + QString szTmp = __tr2qs_ctx("Clear all transfers, including any in progress?", "filetransferwindow"); // If any transfer is active asks for confirm if(!bHaveAllTerminated) - if(QMessageBox::warning(this,__tr2qs_ctx("Confirm Clearing All Transfers - KVIrc","filetransferwindow"), szTmp,__tr2qs_ctx("Yes","filetransferwindow"),__tr2qs_ctx("No","filetransferwindow")) != 0) + if(QMessageBox::warning(this, __tr2qs_ctx("Confirm Clearing All Transfers - KVIrc", "filetransferwindow"), szTmp, __tr2qs_ctx("Yes", "filetransferwindow"), __tr2qs_ctx("No", "filetransferwindow")) != 0) return; KviFileTransferManager::instance()->killAllTransfers(); @@ -795,7 +833,7 @@ void FileTransferWindow::clearTerminated() KviFileTransferManager::instance()->killTerminatedTransfers(); } -void FileTransferWindow::getBaseLogFileName(QString &buffer) +void FileTransferWindow::getBaseLogFileName(QString & buffer) { buffer.sprintf("FILETRANSFER"); } @@ -807,7 +845,7 @@ QPixmap * FileTransferWindow::myIconPtr() void FileTransferWindow::resizeEvent(QResizeEvent *) { - m_pSplitter->setGeometry(0,0,width(),height()); + m_pSplitter->setGeometry(0, 0, width(), height()); } QSize FileTransferWindow::sizeHint() const @@ -817,7 +855,7 @@ QSize FileTransferWindow::sizeHint() const void FileTransferWindow::fillCaptionBuffers() { - m_szPlainTextCaption = __tr2qs_ctx("File Transfers","filetransferwindow"); + m_szPlainTextCaption = __tr2qs_ctx("File Transfers", "filetransferwindow"); } void FileTransferWindow::die() diff --git a/src/modules/filetransferwindow/FileTransferWindow.h b/src/modules/filetransferwindow/FileTransferWindow.h index 28d98a466..120d87c50 100644 --- a/src/modules/filetransferwindow/FileTransferWindow.h +++ b/src/modules/filetransferwindow/FileTransferWindow.h @@ -50,29 +50,30 @@ class FileTransferWidget : public KviTalTableWidget Q_PROPERTY(int TransparencyCapable READ dummyRead) public: FileTransferWidget(QWidget * pParent); - ~FileTransferWidget() {}; + ~FileTransferWidget(){}; void paintEvent(QPaintEvent * event); int dummyRead() const { return 0; }; protected: - void mousePressEvent (QMouseEvent *e); - void mouseDoubleClickEvent (QMouseEvent *e); + void mousePressEvent(QMouseEvent * e); + void mouseDoubleClickEvent(QMouseEvent * e); signals: - void rightButtonPressed(FileTransferItem *,QPoint pnt); - void doubleClicked(FileTransferItem *,QPoint pnt); + void rightButtonPressed(FileTransferItem *, QPoint pnt); + void doubleClicked(FileTransferItem *, QPoint pnt); }; class FileTransferItem : public KviTalTableWidgetItemEx { public: - FileTransferItem(FileTransferWidget * v,KviFileTransfer * t); + FileTransferItem(FileTransferWidget * v, KviFileTransfer * t); ~FileTransferItem(); + protected: KviFileTransfer * m_pTransfer; KviTalTableWidgetItem * col1Item; //item on the second column KviTalTableWidgetItem * col2Item; //item on the third column public: - KviFileTransfer * transfer(){ return m_pTransfer; }; - virtual QString key(int column,bool bAcending) const; + KviFileTransfer * transfer() { return m_pTransfer; }; + virtual QString key(int column, bool bAcending) const; virtual void displayUpdate(); }; @@ -80,11 +81,11 @@ class FileTransferItemDelegate : public KviTalIconAndRichTextItemDelegate { Q_OBJECT public: - FileTransferItemDelegate(QAbstractItemView * pWidget=0) - : KviTalIconAndRichTextItemDelegate(pWidget) {}; + FileTransferItemDelegate(QAbstractItemView * pWidget = 0) + : KviTalIconAndRichTextItemDelegate(pWidget){}; ~FileTransferItemDelegate(){}; - QSize sizeHint(const QStyleOptionViewItem &option,const QModelIndex &index) const; - void paint ( QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index ) const; + QSize sizeHint(const QStyleOptionViewItem & option, const QModelIndex & index) const; + void paint(QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index) const; }; class FileTransferWindow : public KviWindow @@ -100,46 +101,49 @@ public: #if 0 KviModuleExtensionDescriptor * d #endif - ); + ); ~FileTransferWindow(); + protected: - QSplitter * m_pVertSplitter; - FileTransferWidget * m_pTableWidget; - QAbstractItemDelegate * m_pItemDelegate; - QMenu * m_pContextPopup; - QMenu * m_pLocalFilePopup; - QMenu * m_pOpenFilePopup; - QTimer * m_pTimer; - int m_iLineSpacing; // cached fm value -public: // Methods + QSplitter * m_pVertSplitter; + FileTransferWidget * m_pTableWidget; + QAbstractItemDelegate * m_pItemDelegate; + QMenu * m_pContextPopup; + QMenu * m_pLocalFilePopup; + QMenu * m_pOpenFilePopup; + QTimer * m_pTimer; + int m_iLineSpacing; // cached fm value +public: // Methods virtual void die(); + protected: virtual QPixmap * myIconPtr(); virtual void fillCaptionBuffers(); virtual void applyOptions(); - virtual void resizeEvent(QResizeEvent *e); - virtual void getBaseLogFileName(QString &buffer); + virtual void resizeEvent(QResizeEvent * e); + virtual void getBaseLogFileName(QString & buffer); FileTransferItem * findItem(KviFileTransfer * t); void fillTransferView(); KviFileTransfer * selectedTransfer(); - bool eventFilter( QObject *obj, QEvent *ev ); + bool eventFilter(QObject * obj, QEvent * ev); + public: virtual QSize sizeHint() const; - int lineSpacing(){ return m_iLineSpacing; }; + int lineSpacing() { return m_iLineSpacing; }; protected slots: - void transferRegistered(KviFileTransfer *t); - void transferUnregistering(KviFileTransfer *t); - void rightButtonPressed(FileTransferItem *it,const QPoint &pnt); - void doubleClicked(FileTransferItem *it,const QPoint &pnt); + void transferRegistered(KviFileTransfer * t); + void transferUnregistering(KviFileTransfer * t); + void rightButtonPressed(FileTransferItem * it, const QPoint & pnt); + void doubleClicked(FileTransferItem * it, const QPoint & pnt); void heartbeat(); void clearTerminated(); void clearAll(); - void tipRequest(KviDynamicToolTip * tip,const QPoint &pnt); + void tipRequest(KviDynamicToolTip * tip, const QPoint & pnt); void openLocalFile(); void openLocalFileWith(); void copyLocalFileToClipboard(); void openLocalFileFolder(); - void openFilePopupActivated(QAction *pAction); + void openFilePopupActivated(QAction * pAction); void openLocalFileTerminal(); void deleteLocalFile(); }; diff --git a/src/modules/filetransferwindow/libkvifiletransferwindow.cpp b/src/modules/filetransferwindow/libkvifiletransferwindow.cpp index 8bea5bd1a..c7b332d1c 100644 --- a/src/modules/filetransferwindow/libkvifiletransferwindow.cpp +++ b/src/modules/filetransferwindow/libkvifiletransferwindow.cpp @@ -34,12 +34,12 @@ FileTransferWindow * g_pFileTransferWindow = NULL; -static FileTransferWindow * filetransferwindow_alloc(bool bCreateMinimized,bool bNoRaise) +static FileTransferWindow * filetransferwindow_alloc(bool bCreateMinimized, bool bNoRaise) { if(!g_pFileTransferWindow) { g_pFileTransferWindow = new FileTransferWindow(); - g_pMainWindow->addWindow(g_pFileTransferWindow,!bCreateMinimized); + g_pMainWindow->addWindow(g_pFileTransferWindow, !bCreateMinimized); return g_pFileTransferWindow; } @@ -69,7 +69,7 @@ static FileTransferWindow * filetransferwindow_alloc(bool bCreateMinimized,bool static bool filetransferwindow_kvs_cmd_open(KviKvsModuleCommandCall * c) { - filetransferwindow_alloc(c->hasSwitch('m',QString::fromLatin1("minimized")),c->hasSwitch('n',QString::fromLatin1("noraise"))); + filetransferwindow_alloc(c->hasSwitch('m', QString::fromLatin1("minimized")), c->hasSwitch('n', QString::fromLatin1("noraise"))); return true; } @@ -95,7 +95,7 @@ static bool filetransferwindow_kvs_cmd_open(KviKvsModuleCommandCall * c) static bool filetransferwindow_kvs_cmd_clear(KviKvsModuleCommandCall * c) { - if(c->hasSwitch('a',QString::fromLatin1("all"))) + if(c->hasSwitch('a', QString::fromLatin1("all"))) KviFileTransferManager::instance()->killAllTransfers(); else KviFileTransferManager::instance()->killTerminatedTransfers(); @@ -103,11 +103,10 @@ static bool filetransferwindow_kvs_cmd_clear(KviKvsModuleCommandCall * c) return true; } - static bool filetransferwindow_module_init(KviModule * m) { - KVSM_REGISTER_SIMPLE_COMMAND(m,"open",filetransferwindow_kvs_cmd_open); - KVSM_REGISTER_SIMPLE_COMMAND(m,"clear",filetransferwindow_kvs_cmd_clear); + KVSM_REGISTER_SIMPLE_COMMAND(m, "open", filetransferwindow_kvs_cmd_open); + KVSM_REGISTER_SIMPLE_COMMAND(m, "clear", filetransferwindow_kvs_cmd_clear); return true; } @@ -126,14 +125,12 @@ static bool filetransferwindow_module_can_unload(KviModule *) } KVIRC_MODULE( - "FileTransferWindow", - "4.0.0", - "Copyright (C) 2008 Szymon Stefanek (pragma at kvirc dot net)", - "File Transfer Window Extension", - filetransferwindow_module_init, - filetransferwindow_module_can_unload, - 0, - filetransferwindow_module_cleanup, - "filetransferwindow" -) - + "FileTransferWindow", + "4.0.0", + "Copyright (C) 2008 Szymon Stefanek (pragma at kvirc dot net)", + "File Transfer Window Extension", + filetransferwindow_module_init, + filetransferwindow_module_can_unload, + 0, + filetransferwindow_module_cleanup, + "filetransferwindow") diff --git a/src/modules/fish/libkvifish.cpp b/src/modules/fish/libkvifish.cpp index 68e2509ce..9abcd9597 100644 --- a/src/modules/fish/libkvifish.cpp +++ b/src/modules/fish/libkvifish.cpp @@ -46,247 +46,248 @@ */ #ifdef COMPILE_CRYPT_SUPPORT - #include "KviMemory.h" - #include "KviPointerList.h" - #include "KviCryptEngine.h" - #include "KviCryptController.h" - // KviApplication.cpp - extern KVIRC_API KviCryptEngineManager * g_pCryptEngineManager; - - #if defined(COMPILE_SSL_SUPPORT) - - #include - #include - #include - #include - #include - #include - #include - - DH * g_fish_dh = 0; - - // ### new sophie-germain 1080bit prime number ### - // const char *g_fish_prime1080_bin="++ECLiPSE+is+proud+to+present+latest+FiSH+release+featuring+even+more+security+for+you+++shouts+go+out+to+TMG+for+helping+to+generate+this+cool+sophie+germain+prime+number++++/C32L"; - const char *g_fish_prime1080_hex="FBE1022E23D213E8ACFA9AE8B9DFADA3EA6B7AC7A7B7E95AB5EB2DF858921FEADE95E6AC7BE7DE6ADBAB8A783E7AF7A7FA6A2B7BEB1E72EAE2B72F9FA2BFB2A2EFBEFAC868BADB3E828FA8BADFADA3E4CC1BE7E8AFE85E9698A783EB68FA07A77AB6AD7BEB618ACF9CA2897EB28A6189EFA07AB99A8A7FA9AE299EFA7BA66DEAFEFBEFBF0B7D8B"; - // const char *g_fish_prime1080_dec="12745216229761186769575009943944198619149164746831579719941140425076456621824834322853258804883232842877311723249782818608677050956745409379781245497526069657222703636504651898833151008222772087491045206203033063108075098874712912417029101508315117935752962862335062591404043092163187352352197487303798807791605274487594646923"; - const char *g_fish_generator="2"; - #endif - - #define FISH_KEYLEN 180 - #define SHA256_LEN 32 - - static bool fish_DH1080_gen(unsigned char ** szPubKey, int * iLen) - { - #if defined(COMPILE_SSL_SUPPORT) - if(!g_fish_dh) - { - BIGNUM * dhp = BN_new(); - BN_init(dhp); - if(!BN_hex2bn(&dhp,g_fish_prime1080_hex)) - return false; +#include "KviMemory.h" +#include "KviPointerList.h" +#include "KviCryptEngine.h" +#include "KviCryptController.h" +// KviApplication.cpp +extern KVIRC_API KviCryptEngineManager * g_pCryptEngineManager; + +#if defined(COMPILE_SSL_SUPPORT) + +#include +#include +#include +#include +#include +#include +#include + +DH * g_fish_dh = 0; + +// ### new sophie-germain 1080bit prime number ### +// const char *g_fish_prime1080_bin="++ECLiPSE+is+proud+to+present+latest+FiSH+release+featuring+even+more+security+for+you+++shouts+go+out+to+TMG+for+helping+to+generate+this+cool+sophie+germain+prime+number++++/C32L"; +const char * g_fish_prime1080_hex = "FBE1022E23D213E8ACFA9AE8B9DFADA3EA6B7AC7A7B7E95AB5EB2DF858921FEADE95E6AC7BE7DE6ADBAB8A783E7AF7A7FA6A2B7BEB1E72EAE2B72F9FA2BFB2A2EFBEFAC868BADB3E828FA8BADFADA3E4CC1BE7E8AFE85E9698A783EB68FA07A77AB6AD7BEB618ACF9CA2897EB28A6189EFA07AB99A8A7FA9AE299EFA7BA66DEAFEFBEFBF0B7D8B"; +// const char *g_fish_prime1080_dec="12745216229761186769575009943944198619149164746831579719941140425076456621824834322853258804883232842877311723249782818608677050956745409379781245497526069657222703636504651898833151008222772087491045206203033063108075098874712912417029101508315117935752962862335062591404043092163187352352197487303798807791605274487594646923"; +const char * g_fish_generator = "2"; +#endif - BIGNUM * dhg = BN_new(); - BN_init(dhg); - if(!BN_hex2bn(&dhg,g_fish_generator)) - return false; +#define FISH_KEYLEN 180 +#define SHA256_LEN 32 - g_fish_dh = DH_new(); - g_fish_dh->p = dhp; - g_fish_dh->g = dhg; +static bool fish_DH1080_gen(unsigned char ** szPubKey, int * iLen) +{ +#if defined(COMPILE_SSL_SUPPORT) + if(!g_fish_dh) + { + BIGNUM * dhp = BN_new(); + BN_init(dhp); + if(!BN_hex2bn(&dhp, g_fish_prime1080_hex)) + return false; - DH_generate_key(g_fish_dh); - } + BIGNUM * dhg = BN_new(); + BN_init(dhg); + if(!BN_hex2bn(&dhg, g_fish_generator)) + return false; - *iLen = BN_num_bytes(g_fish_dh->pub_key); - *szPubKey = (unsigned char *) KviMemory::allocate(*iLen); - BN_bn2bin(g_fish_dh->pub_key, *szPubKey); + g_fish_dh = DH_new(); + g_fish_dh->p = dhp; + g_fish_dh->g = dhg; - return true; - #else - qDebug("%s",__tr2qs("FiSH has been compiled without SSL support, unable to proceed").toUtf8().data()); - return false; - #endif + DH_generate_key(g_fish_dh); } - bool fish_event_onQueryNotice(KviKvsModuleEventCall * c) - { - /* EVENT("OnQueryNotice", \ + *iLen = BN_num_bytes(g_fish_dh->pub_key); + *szPubKey = (unsigned char *)KviMemory::allocate(*iLen); + BN_bn2bin(g_fish_dh->pub_key, *szPubKey); + + return true; +#else + qDebug("%s", __tr2qs("FiSH has been compiled without SSL support, unable to proceed").toUtf8().data()); + return false; +#endif +} + +bool fish_event_onQueryNotice(KviKvsModuleEventCall * c) +{ + /* EVENT("OnQueryNotice", \ "$0 = source nick\n" \ "$1 = source username\n" \ "$2 = source host\n" \ "$3 = message"), */ - KviKvsVariantList * pParams = c->params(); - if(!pParams) - return true; + KviKvsVariantList * pParams = c->params(); + if(!pParams) + return true; - QString szNick, szMessage, szKey; + QString szNick, szMessage, szKey; - if(!pParams->firstAsString(szNick)) - return true; + if(!pParams->firstAsString(szNick)) + return true; - pParams->next(); - pParams->next(); + pParams->next(); + pParams->next(); - if(!pParams->nextAsString(szMessage)) - return true; + if(!pParams->nextAsString(szMessage)) + return true; - if(!szMessage.startsWith("DH1080_", Qt::CaseSensitive)) - return true; + if(!szMessage.startsWith("DH1080_", Qt::CaseSensitive)) + return true; - unsigned char * szMyPubKey = 0; - QByteArray szHisPubKey, szTmp; - int iMyPubKeyLen, * pMyPubKeyLen = &iMyPubKeyLen; - if(!fish_DH1080_gen(&szMyPubKey, pMyPubKeyLen)) - { - #if !defined(COMPILE_SSL_SUPPORT) - c->warning(__tr2qs("FiSH has been compiled without SSL support, unable to proceed")); - return false; - #endif - return false; - } + unsigned char * szMyPubKey = 0; + QByteArray szHisPubKey, szTmp; + int iMyPubKeyLen, *pMyPubKeyLen = &iMyPubKeyLen; + if(!fish_DH1080_gen(&szMyPubKey, pMyPubKeyLen)) + { +#if !defined(COMPILE_SSL_SUPPORT) + c->warning(__tr2qs("FiSH has been compiled without SSL support, unable to proceed")); + return false; +#endif + return false; + } - if(szMessage.startsWith("DH1080_INIT ", Qt::CaseSensitive) || szMessage.startsWith("DH1080_INIT_cbc ", Qt::CaseSensitive)) + if(szMessage.startsWith("DH1080_INIT ", Qt::CaseSensitive) || szMessage.startsWith("DH1080_INIT_cbc ", Qt::CaseSensitive)) + { + c->window()->output(KVI_OUT_SYSTEMMESSAGE, __tr2qs("FiSH: received DH1080 public key from %1, sending mine...").arg(szNick)); + // fish appends an 'A' to all base64 coded strings + if(szMessage.startsWith("DH1080_INIT_cbc ", Qt::CaseSensitive)) + szHisPubKey = szMessage.mid(16).toLatin1(); + else + szHisPubKey = szMessage.mid(12).toLatin1(); + szHisPubKey.truncate(FISH_KEYLEN); + szHisPubKey = QByteArray::fromBase64(szHisPubKey); + + szTmp = QByteArray((char *)szMyPubKey, iMyPubKeyLen).toBase64(); + if(szMessage.startsWith("DH1080_INIT_cbc ", Qt::CaseSensitive)) { - c->window()->output(KVI_OUT_SYSTEMMESSAGE,__tr2qs("FiSH: received DH1080 public key from %1, sending mine...").arg(szNick)); - // fish appends an 'A' to all base64 coded strings - if(szMessage.startsWith("DH1080_INIT_cbc ", Qt::CaseSensitive)) - szHisPubKey = szMessage.mid(16).toLatin1(); - else - szHisPubKey = szMessage.mid(12).toLatin1(); - szHisPubKey.truncate(FISH_KEYLEN); - szHisPubKey = QByteArray::fromBase64(szHisPubKey); - - szTmp = QByteArray((char *)szMyPubKey, iMyPubKeyLen).toBase64(); - if(szMessage.startsWith("DH1080_INIT_cbc ", Qt::CaseSensitive)) - { - c->window()->console()->connection()->sendFmtData("NOTICE %s :DH1080_FINISH_cbc %sA", - c->window()->console()->connection()->encodeText(szNick).data(), - szTmp.data() - ); - } - else - { - c->window()->console()->connection()->sendFmtData("NOTICE %s :DH1080_FINISH %sA", - c->window()->console()->connection()->encodeText(szNick).data(), - szTmp.data() - ); - } + c->window()->console()->connection()->sendFmtData("NOTICE %s :DH1080_FINISH_cbc %sA", + c->window()->console()->connection()->encodeText(szNick).data(), + szTmp.data()); } - - if(szMessage.startsWith("DH1080_FINISH ", Qt::CaseSensitive)) + else { - // fish appends an 'A' to all base64 coded strings - szHisPubKey = szMessage.mid(14).toLatin1(); - szHisPubKey.truncate(FISH_KEYLEN); - szHisPubKey = QByteArray::fromBase64(szHisPubKey); + c->window()->console()->connection()->sendFmtData("NOTICE %s :DH1080_FINISH %sA", + c->window()->console()->connection()->encodeText(szNick).data(), + szTmp.data()); } + } - if(!c->window()->connection()) - return false; + if(szMessage.startsWith("DH1080_FINISH ", Qt::CaseSensitive)) + { + // fish appends an 'A' to all base64 coded strings + szHisPubKey = szMessage.mid(14).toLatin1(); + szHisPubKey.truncate(FISH_KEYLEN); + szHisPubKey = QByteArray::fromBase64(szHisPubKey); + } - KviQueryWindow * pWnd = c->window()->connection()->findQuery(szNick); - if(!pWnd) + if(!c->window()->connection()) + return false; + + KviQueryWindow * pWnd = c->window()->connection()->findQuery(szNick); + if(!pWnd) + { + pWnd = c->window()->connection()->createQuery(szNick); + QString user; + QString host; + KviIrcUserDataBase * db = c->window()->connection()->userDataBase(); + if(db) { - pWnd = c->window()->connection()->createQuery(szNick); - QString user; - QString host; - KviIrcUserDataBase * db = c->window()->connection()->userDataBase(); - if(db) + KviIrcUserEntry * e = db->find(szNick); + if(e) { - KviIrcUserEntry * e = db->find(szNick); - if(e) - { - user = e->user(); - host = e->host(); - } + user = e->user(); + host = e->host(); } - pWnd->setTarget(szNick,user,host); - } - if(!pWnd) - { - c->warning(__tr2qs("Query not found: %Q"),&szNick); - return false; } + pWnd->setTarget(szNick, user, host); + } + if(!pWnd) + { + c->warning(__tr2qs("Query not found: %Q"), &szNick); + return false; + } - KviCString szFinalKey; + KviCString szFinalKey; - #if defined(COMPILE_SSL_SUPPORT) - unsigned char * secret=(unsigned char *) KviMemory::allocate(DH_size(g_fish_dh)); - int secretLen; - BIGNUM *bn = BN_bin2bn((unsigned char *) szHisPubKey.data(), szHisPubKey.size(),NULL); - if(-1 == (secretLen = DH_compute_key(secret, bn, g_fish_dh))) - { - c->warning(__tr2qs("FiSH: error verifying peer public key (size=%1)").arg(szHisPubKey.size())); - return false; - } - BN_zero(bn); - BN_free(bn); +#if defined(COMPILE_SSL_SUPPORT) + unsigned char * secret = (unsigned char *)KviMemory::allocate(DH_size(g_fish_dh)); + int secretLen; + BIGNUM * bn = BN_bin2bn((unsigned char *)szHisPubKey.data(), szHisPubKey.size(), NULL); + if(-1 == (secretLen = DH_compute_key(secret, bn, g_fish_dh))) + { + c->warning(__tr2qs("FiSH: error verifying peer public key (size=%1)").arg(szHisPubKey.size())); + return false; + } + BN_zero(bn); + BN_free(bn); - unsigned char * hashedSecret=(unsigned char *) KviMemory::allocate(SHA256_LEN); - SHA256(secret, secretLen, hashedSecret); + unsigned char * hashedSecret = (unsigned char *)KviMemory::allocate(SHA256_LEN); + SHA256(secret, secretLen, hashedSecret); - KviMemory::free(secret); + KviMemory::free(secret); - szFinalKey.bufferToBase64((char *) hashedSecret, SHA256_LEN); - //strip the trailing = - szFinalKey.stripRight('='); + szFinalKey.bufferToBase64((char *)hashedSecret, SHA256_LEN); + //strip the trailing = + szFinalKey.stripRight('='); - KviMemory::free(hashedSecret); - #else - c->warning(__tr2qs("FiSH has been compiled without SSL support, unable to proceed")); - return false; - #endif + KviMemory::free(hashedSecret); +#else + c->warning(__tr2qs("FiSH has been compiled without SSL support, unable to proceed")); + return false; +#endif - (void)g_pModuleManager->loadModulesByCaps("crypt"); + (void)g_pModuleManager->loadModulesByCaps("crypt"); - QString szEngine="Mircryption"; - KviCryptEngine * e = g_pCryptEngineManager->allocateEngine(szEngine); - if(e) + QString szEngine = "Mircryption"; + KviCryptEngine * e = g_pCryptEngineManager->allocateEngine(szEngine); + if(e) + { + if(e->init(szFinalKey.ptr(), szFinalKey.len(), szFinalKey.ptr(), szFinalKey.len())) { - if(e->init(szFinalKey.ptr(),szFinalKey.len(),szFinalKey.ptr(),szFinalKey.len())) - { - KviCryptSessionInfo * inf = KviCryptController::allocateCryptSessionInfo(); - inf->m_pEngine = e; - inf->m_szEngineName = szEngine; - inf->m_bDoEncrypt = true; - inf->m_bDoDecrypt = true; - - pWnd->setCryptSessionInfo(inf); - } else { - c->warning(__tr2qs("Failed to initialize the Mircryption engine: %Q"),&(e->lastError())); - g_pCryptEngineManager->deallocateEngine(e); - } - } else { - c->warning(__tr2qs("The Mircryption encryption engine doesn't exist")); - } + KviCryptSessionInfo * inf = KviCryptController::allocateCryptSessionInfo(); + inf->m_pEngine = e; + inf->m_szEngineName = szEngine; + inf->m_bDoEncrypt = true; + inf->m_bDoDecrypt = true; - c->window()->output(KVI_OUT_SYSTEMMESSAGE,__tr2qs("FiSH: key for %1 successfully set!").arg(szNick)); - return true; + pWnd->setCryptSessionInfo(inf); + } + else + { + c->warning(__tr2qs("Failed to initialize the Mircryption engine: %Q"), &(e->lastError())); + g_pCryptEngineManager->deallocateEngine(e); + } } - - static bool fish_cmd_keyx(KviKvsModuleCommandCall * c) + else { - QString szTarget; - KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("target",KVS_PT_NONEMPTYSTRING,0,szTarget) - KVSM_PARAMETERS_END(c) - - unsigned char * szMyPubKey = 0; - KviCString szHisPubKey, szTmp; - int iMyPubKeyLen, * pMyPubKeyLen = &iMyPubKeyLen; - if(!fish_DH1080_gen(&szMyPubKey, pMyPubKeyLen)) - return false; + c->warning(__tr2qs("The Mircryption encryption engine doesn't exist")); + } + + c->window()->output(KVI_OUT_SYSTEMMESSAGE, __tr2qs("FiSH: key for %1 successfully set!").arg(szNick)); + return true; +} - szTmp.bufferToBase64((char *) szMyPubKey, iMyPubKeyLen); - c->window()->console()->connection()->sendFmtData("NOTICE %s :DH1080_INIT %sA", - c->window()->console()->connection()->encodeText(szTarget).data(), - szTmp.ptr() - ); +static bool fish_cmd_keyx(KviKvsModuleCommandCall * c) +{ + QString szTarget; + KVSM_PARAMETERS_BEGIN(c) + KVSM_PARAMETER("target", KVS_PT_NONEMPTYSTRING, 0, szTarget) + KVSM_PARAMETERS_END(c) + + unsigned char * szMyPubKey = 0; + KviCString szHisPubKey, szTmp; + int iMyPubKeyLen, *pMyPubKeyLen = &iMyPubKeyLen; + if(!fish_DH1080_gen(&szMyPubKey, pMyPubKeyLen)) + return false; - c->window()->output(KVI_OUT_SYSTEMMESSAGE,__tr2qs("FiSH: sent my DH1080 public key to %1, waiting for reply...").arg(szTarget)); - return true; - } + szTmp.bufferToBase64((char *)szMyPubKey, iMyPubKeyLen); + c->window()->console()->connection()->sendFmtData("NOTICE %s :DH1080_INIT %sA", + c->window()->console()->connection()->encodeText(szTarget).data(), + szTmp.ptr()); + + c->window()->output(KVI_OUT_SYSTEMMESSAGE, __tr2qs("FiSH: sent my DH1080 public key to %1, waiting for reply...").arg(szTarget)); + return true; +} #endif //COMPILE_CRYPT_SUPPORT // ======================================= // module routines @@ -294,12 +295,12 @@ static bool fish_module_init(KviModule * m) { #ifdef COMPILE_CRYPT_SUPPORT - #if defined( COMPILE_SSL_SUPPORT) - KviSSL::globalSSLInit(); - #endif - m->kvsRegisterAppEventHandler(KviEvent_OnQueryNotice,fish_event_onQueryNotice); +#if defined(COMPILE_SSL_SUPPORT) + KviSSL::globalSSLInit(); +#endif + m->kvsRegisterAppEventHandler(KviEvent_OnQueryNotice, fish_event_onQueryNotice); - KVSM_REGISTER_SIMPLE_COMMAND(m,"keyx",fish_cmd_keyx); + KVSM_REGISTER_SIMPLE_COMMAND(m, "keyx", fish_cmd_keyx); return true; #else @@ -321,13 +322,12 @@ static bool fish_module_can_unload(KviModule *) // plugin definition structure // ======================================= KVIRC_MODULE( - "FISH crypt engine", - "4.0.0", - "Fabio Bas ", - "A FISH implementation", - fish_module_init, - fish_module_can_unload, - 0, - fish_module_cleanup, - 0 -) + "FISH crypt engine", + "4.0.0", + "Fabio Bas ", + "A FISH implementation", + fish_module_init, + fish_module_can_unload, + 0, + fish_module_cleanup, + 0) diff --git a/src/modules/help/HelpIndex.cpp b/src/modules/help/HelpIndex.cpp index 69a9c875b..3fba3c74d 100644 --- a/src/modules/help/HelpIndex.cpp +++ b/src/modules/help/HelpIndex.cpp @@ -52,38 +52,39 @@ QT_BEGIN_NAMESPACE -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 Term +{ + Term() : frequency(-1) {} + Term(const QString & t, int f, QVector l) : term(t), frequency(f), documents(l) {} + QString term; + int frequency; + QVector documents; + bool operator<(const Term & i2) const { return frequency < i2.frequency; } }; -QDataStream &operator>>( QDataStream &s, Document &l ) +QDataStream & operator>>(QDataStream & s, Document & l) { - s >> l.docNumber; - s >> l.frequency; - return s; + s >> l.docNumber; + s >> l.frequency; + return s; } -QDataStream &operator<<( QDataStream &s, const Document &l ) +QDataStream & operator<<(QDataStream & s, const Document & l) { - s << (qint16)l.docNumber; - s << (qint16)l.frequency; - return s; + s << (qint16)l.docNumber; + s << (qint16)l.frequency; + return s; } -HelpIndex::HelpIndex( const QString &dp, const QString &hp ) - : QObject( 0 ), docPath( dp ) +HelpIndex::HelpIndex(const QString & dp, const QString & hp) + : QObject(0), docPath(dp) { - Q_UNUSED(hp); + Q_UNUSED(hp); - alreadyHaveDocList = false; - lastWindowClosed = false; - connect( qApp, SIGNAL(lastWindowClosed()), - this, SLOT(setLastWinClosed()) ); + alreadyHaveDocList = false; + lastWindowClosed = false; + connect(qApp, SIGNAL(lastWindowClosed()), + this, SLOT(setLastWinClosed())); m_pTimer = new QTimer(this); m_pTimer->setSingleShot(true); @@ -91,44 +92,44 @@ HelpIndex::HelpIndex( const QString &dp, const QString &hp ) connect(m_pTimer, SIGNAL(timeout()), this, SLOT(filterNext())); } -HelpIndex::HelpIndex( const QStringList &dl, const QString &hp ) - : QObject( 0 ) +HelpIndex::HelpIndex(const QStringList & dl, const QString & hp) + : QObject(0) { - Q_UNUSED(hp); - docList = dl; - alreadyHaveDocList = true; - lastWindowClosed = false; - connect( qApp, SIGNAL(lastWindowClosed()), - this, SLOT(setLastWinClosed()) ); + Q_UNUSED(hp); + docList = dl; + alreadyHaveDocList = true; + lastWindowClosed = false; + connect(qApp, SIGNAL(lastWindowClosed()), + this, SLOT(setLastWinClosed())); } void HelpIndex::setLastWinClosed() { - lastWindowClosed = true; + lastWindowClosed = true; } -void HelpIndex::setDictionaryFile( const QString &f ) +void HelpIndex::setDictionaryFile(const QString & f) { - dictFile = f; + dictFile = f; } -void HelpIndex::setDocListFile( const QString &f ) +void HelpIndex::setDocListFile(const QString & f) { - docListFile = f; + docListFile = f; } -void HelpIndex::setDocList( const QStringList &lst ) +void HelpIndex::setDocList(const QStringList & lst) { - docList = lst; + docList = lst; } void HelpIndex::makeIndex() { - if ( !alreadyHaveDocList ) + if(!alreadyHaveDocList) setupDocumentList(); lastWindowClosed = false; - emit indexingStart( docList.count() ); + emit indexingStart(docList.count()); dict.clear(); m_iCurItem = 0; m_pTimer->start(); //singleshot @@ -139,465 +140,525 @@ void HelpIndex::filterNext() if(m_iCurItem < docList.count() && !lastWindowClosed) { QUrl url(docList.at(m_iCurItem)); - parseDocument( url.toLocalFile(), m_iCurItem ); - emit indexingProgress( m_iCurItem ); + parseDocument(url.toLocalFile(), m_iCurItem); + emit indexingProgress(m_iCurItem); m_iCurItem++; m_pTimer->start(); //singleshot - } else { + } + else + { emit indexingEnd(); } } void HelpIndex::setupDocumentList() { - docList.clear(); - titleList.clear(); - QDir d( docPath ); - QStringList filters; - filters.append(QLatin1String("*.html")); - QStringList lst = d.entryList(filters); - QStringList::ConstIterator it = lst.constBegin(); - for ( ; it != lst.constEnd(); ++it ) - { - QString filename=QLatin1String("file:///") + docPath + QLatin1String("/") + *it ; - docList.append(filename); - titleList.append(getDocumentTitle(filename)); - } + docList.clear(); + titleList.clear(); + QDir d(docPath); + QStringList filters; + filters.append(QLatin1String("*.html")); + QStringList lst = d.entryList(filters); + QStringList::ConstIterator it = lst.constBegin(); + for(; it != lst.constEnd(); ++it) + { + QString filename = QLatin1String("file:///") + docPath + QLatin1String("/") + *it; + docList.append(filename); + titleList.append(getDocumentTitle(filename)); + } } -void HelpIndex::insertInDict( const QString &str, int docNum ) +void HelpIndex::insertInDict(const QString & str, int docNum) { - if ( str == QLatin1String("amp") || str == QLatin1String("nbsp")) - return; - Entry *e = 0; - if ( dict.count() ) - e = dict[ str ]; - - if ( e ) { - if ( e->documents.last().docNumber != docNum ) - e->documents.append( Document(docNum, 1 ) ); - else - e->documents.last().frequency++; - } else { - dict.insert( str, new Entry( docNum ) ); - } + if(str == QLatin1String("amp") || str == QLatin1String("nbsp")) + return; + Entry * e = 0; + if(dict.count()) + e = dict[str]; + + if(e) + { + if(e->documents.last().docNumber != docNum) + e->documents.append(Document(docNum, 1)); + else + e->documents.last().frequency++; + } + else + { + dict.insert(str, new Entry(docNum)); + } } -QString HelpIndex::getCharsetForDocument(QFile *file) +QString HelpIndex::getCharsetForDocument(QFile * file) { - QTextStream s(file); - QString contents = s.readAll(); - - QString encoding; - int start = contents.indexOf(QLatin1String(" 0) { - int end = contents.indexOf(QLatin1String(">"), start); - QString meta = contents.mid(start+5, end-start); - meta = meta.toLower(); - QRegExp r(QLatin1String("charset=([^\"\\s]+)")); - if (r.indexIn(meta) != -1) { - encoding = r.cap(1); - } - } - - file->seek(0); - if (encoding.isEmpty()) - return QLatin1String("utf-8"); - return encoding; + QTextStream s(file); + QString contents = s.readAll(); + + QString encoding; + int start = contents.indexOf(QLatin1String(" 0) + { + int end = contents.indexOf(QLatin1String(">"), start); + QString meta = contents.mid(start + 5, end - start); + meta = meta.toLower(); + QRegExp r(QLatin1String("charset=([^\"\\s]+)")); + if(r.indexIn(meta) != -1) + { + encoding = r.cap(1); + } + } + + file->seek(0); + if(encoding.isEmpty()) + return QLatin1String("utf-8"); + return encoding; } -void HelpIndex::parseDocument( const QString &filename, int docNum ) +void HelpIndex::parseDocument(const QString & filename, int docNum) { - QFile file( filename ); - if ( !file.open(QFile::ReadOnly) ) { - qWarning( "Can't open file %s", qPrintable(filename) ); - return; - } - - QTextStream s(&file); - QString en = getCharsetForDocument(&file); - s.setCodec(QTextCodec::codecForName(en.toLatin1().constData())); - - QString text = s.readAll(); - if (text.isNull()) - return; - - 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 ) - insertInDict( 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 ) - insertInDict( QString(str,i), docNum ); - i = 0; - } - c = buf[++j]; - } - if ( i > 1 ) - insertInDict( QString(str,i), docNum ); - file.close(); + QFile file(filename); + if(!file.open(QFile::ReadOnly)) + { + qWarning("Can't open file %s", qPrintable(filename)); + return; + } + + QTextStream s(&file); + QString en = getCharsetForDocument(&file); + s.setCodec(QTextCodec::codecForName(en.toLatin1().constData())); + + QString text = s.readAll(); + if(text.isNull()) + return; + + 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) + insertInDict(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) + insertInDict(QString(str, i), docNum); + i = 0; + } + c = buf[++j]; + } + if(i > 1) + insertInDict(QString(str, i), docNum); + file.close(); } void HelpIndex::writeDict() { - QFile f( dictFile ); - qDebug ("Write dict to %s",f.fileName().toUtf8().data()); - if ( !f.open(QFile::WriteOnly ) ) - return; - QDataStream s( &f ); - for(QHash::Iterator it = dict.begin(); it != dict.end(); ++it) { - s << it.key(); - s << it.value()->documents.count(); - s << it.value()->documents; - } - f.close(); - writeDocumentList(); + QFile f(dictFile); + qDebug("Write dict to %s", f.fileName().toUtf8().data()); + if(!f.open(QFile::WriteOnly)) + return; + QDataStream s(&f); + for(QHash::Iterator it = dict.begin(); it != dict.end(); ++it) + { + s << it.key(); + s << it.value()->documents.count(); + s << it.value()->documents; + } + f.close(); + writeDocumentList(); } void HelpIndex::writeDocumentList() { - QFile f( docListFile ); - if ( !f.open(QFile::WriteOnly ) ) - return; - QDataStream s( &f ); - s << docList; - - QFile f1( docListFile+".titles" ); - if ( !f1.open(QFile::WriteOnly ) ) - return; - QDataStream s1( &f1 ); - s1 << titleList; - + QFile f(docListFile); + if(!f.open(QFile::WriteOnly)) + return; + QDataStream s(&f); + s << docList; + + QFile f1(docListFile + ".titles"); + if(!f1.open(QFile::WriteOnly)) + return; + QDataStream s1(&f1); + s1 << titleList; } void HelpIndex::readDict() { - QFile f( dictFile ); - if ( !f.open(QFile::ReadOnly ) ) - return; - - dict.clear(); - QDataStream s( &f ); - QString key; - int numOfDocs; - QVector docs; - while ( !s.atEnd() ) { - s >> key; - s >> numOfDocs; - docs.resize(numOfDocs); - s >> docs; - dict.insert( key, new Entry( docs ) ); - } - f.close(); - readDocumentList(); + QFile f(dictFile); + if(!f.open(QFile::ReadOnly)) + return; + + dict.clear(); + QDataStream s(&f); + QString key; + int numOfDocs; + QVector docs; + while(!s.atEnd()) + { + s >> key; + s >> numOfDocs; + docs.resize(numOfDocs); + s >> docs; + dict.insert(key, new Entry(docs)); + } + f.close(); + readDocumentList(); } void HelpIndex::readDocumentList() { - QFile f( docListFile ); - if ( !f.open(QFile::ReadOnly ) ) - return; - QDataStream s( &f ); - s >> docList; - QFile f1( docListFile+".titles" ); - if ( !f1.open(QFile::ReadOnly ) ) - return; - QDataStream s1( &f1 ); - s1 >> titleList; + QFile f(docListFile); + if(!f.open(QFile::ReadOnly)) + return; + QDataStream s(&f); + s >> docList; + QFile f1(docListFile + ".titles"); + if(!f1.open(QFile::ReadOnly)) + return; + QDataStream s1(&f1); + s1 >> titleList; } -QStringList HelpIndex::query( const QStringList &terms, const QStringList &termSeq, const QStringList &seqWords ) +QStringList HelpIndex::query(const QStringList & terms, const QStringList & termSeq, const QStringList & seqWords) { - QList termList; - for (QStringList::ConstIterator it = terms.begin(); it != terms.end(); ++it ) { - Entry *e = 0; - if ( (*it).contains(QLatin1Char('*')) ) { - QVector wcts = setupDummyTerm( getWildcardTerms( *it ) ); - termList.append( Term(QLatin1String("dummy"), wcts.count(), wcts ) ); - } else if ( dict[ *it ] ) { - e = dict[ *it ]; - termList.append( Term( *it, e->documents.count(), e->documents ) ); - } else { - return QStringList(); - } - } - if ( !termList.count() ) - return QStringList(); - qSort(termList); - - QVector minDocs = termList.takeFirst().documents; - for(QList::Iterator it = termList.begin(); it != termList.end(); ++it) { - Term *t = &(*it); - QVector docs = t->documents; - for(QVector::Iterator minDoc_it = minDocs.begin(); minDoc_it != minDocs.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 = minDocs.erase( minDoc_it ); - else - ++minDoc_it; - } - } - - QStringList results; - qSort( minDocs ); - if ( termSeq.isEmpty() ) { - for(QVector::Iterator it = minDocs.begin(); it != minDocs.end(); ++it) - results << docList.at((int)(*it).docNumber); - return results; - } - - QString fileName; - for(QVector::Iterator it = minDocs.begin(); it != minDocs.end(); ++it) { - fileName = docList[ (int)(*it).docNumber ]; - if ( searchForPattern( termSeq, seqWords, fileName ) ) - results << fileName; - } - return results; + QList termList; + for(QStringList::ConstIterator it = terms.begin(); it != terms.end(); ++it) + { + Entry * e = 0; + if((*it).contains(QLatin1Char('*'))) + { + QVector wcts = setupDummyTerm(getWildcardTerms(*it)); + termList.append(Term(QLatin1String("dummy"), wcts.count(), wcts)); + } + else if(dict[*it]) + { + e = dict[*it]; + termList.append(Term(*it, e->documents.count(), e->documents)); + } + else + { + return QStringList(); + } + } + if(!termList.count()) + return QStringList(); + qSort(termList); + + QVector minDocs = termList.takeFirst().documents; + for(QList::Iterator it = termList.begin(); it != termList.end(); ++it) + { + Term * t = &(*it); + QVector docs = t->documents; + for(QVector::Iterator minDoc_it = minDocs.begin(); minDoc_it != minDocs.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 = minDocs.erase(minDoc_it); + else + ++minDoc_it; + } + } + + QStringList results; + qSort(minDocs); + if(termSeq.isEmpty()) + { + for(QVector::Iterator it = minDocs.begin(); it != minDocs.end(); ++it) + results << docList.at((int)(*it).docNumber); + return results; + } + + QString fileName; + for(QVector::Iterator it = minDocs.begin(); it != minDocs.end(); ++it) + { + fileName = docList[(int)(*it).docNumber]; + if(searchForPattern(termSeq, seqWords, fileName)) + results << fileName; + } + return results; } -QString HelpIndex::getDocumentTitle( const QString &fullFileName ) +QString HelpIndex::getDocumentTitle(const QString & fullFileName) { - QUrl url(fullFileName); - QString fileName = url.toLocalFile(); - - if (documentTitleCache.contains(fileName)) - return documentTitleCache.value(fileName); - - QFile file( fileName ); - if ( !file.open( QFile::ReadOnly ) ) { - qWarning( "Can't open file %s", qPrintable(fileName) ); - return fileName; - } - QTextStream s( &file ); - QString text = s.readAll(); - - int start = text.indexOf(QLatin1String(""), 0, Qt::CaseInsensitive) + 7; - int end = text.indexOf(QLatin1String(""), 0, Qt::CaseInsensitive); - - QString title = tr("Untitled"); - if (end - start > 0) { - title = text.mid(start, end - start); - if (Qt::mightBeRichText(title)) { - QTextDocument doc; - doc.setHtml(title); - title = doc.toPlainText(); - } - } - documentTitleCache.insert(fileName, title); - return title; + QUrl url(fullFileName); + QString fileName = url.toLocalFile(); + + if(documentTitleCache.contains(fileName)) + return documentTitleCache.value(fileName); + + QFile file(fileName); + if(!file.open(QFile::ReadOnly)) + { + qWarning("Can't open file %s", qPrintable(fileName)); + return fileName; + } + QTextStream s(&file); + QString text = s.readAll(); + + int start = text.indexOf(QLatin1String(""), 0, Qt::CaseInsensitive) + 7; + int end = text.indexOf(QLatin1String(""), 0, Qt::CaseInsensitive); + + QString title = tr("Untitled"); + if(end - start > 0) + { + title = text.mid(start, end - start); + if(Qt::mightBeRichText(title)) + { + QTextDocument doc; + doc.setHtml(title); + title = doc.toPlainText(); + } + } + documentTitleCache.insert(fileName, title); + return title; } -QStringList HelpIndex::getWildcardTerms( const QString &term ) +QStringList HelpIndex::getWildcardTerms(const QString & term) { - QStringList lst; - QStringList terms = split( term ); - QStringList::Iterator iter; - - for(QHash::Iterator it = dict.begin(); it != dict.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; + QStringList lst; + QStringList terms = split(term); + QStringList::Iterator iter; + + for(QHash::Iterator it = dict.begin(); it != dict.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; } -QStringList HelpIndex::split( const QString &str ) +QStringList HelpIndex::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; + 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; } -QVector HelpIndex::setupDummyTerm( const QStringList &terms ) +QVector HelpIndex::setupDummyTerm(const QStringList & terms) { - QList termList; - for (QStringList::ConstIterator it = terms.begin(); it != terms.end(); ++it) { - Entry *e = 0; - if ( dict[ *it ] ) { - e = dict[ *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; + QList termList; + for(QStringList::ConstIterator it = terms.begin(); it != terms.end(); ++it) + { + Entry * e = 0; + if(dict[*it]) + { + e = dict[*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; } -void HelpIndex::buildMiniDict( const QString &str ) +void HelpIndex::buildMiniDict(const QString & str) { - if ( miniDict[ str ] ) - miniDict[ str ]->positions.append( wordNum ); - ++wordNum; + if(miniDict[str]) + miniDict[str]->positions.append(wordNum); + ++wordNum; } -bool HelpIndex::searchForPattern( const QStringList &patterns, const QStringList &words, const QString &fileName ) +bool HelpIndex::searchForPattern(const QStringList & patterns, const QStringList & words, const QString & fileName) { - QUrl url(fileName); - QString fName = url.toLocalFile(); - QFile file( fName ); - if ( !file.open( QFile::ReadOnly ) ) { - qWarning( "Can't open file %s", qPrintable(fName) ); - return false; - } - - wordNum = 3; - miniDict.clear(); - QStringList::ConstIterator cIt = words.begin(); - for ( ; cIt != words.end(); ++cIt ) - miniDict.insert( *cIt, new PosEntry( 0 ) ); - - QTextStream s( &file ); - 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 ) - buildMiniDict( 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 ) - buildMiniDict( QString(str,i) ); - i = 0; - } - c = buf[++j]; - } - if ( i > 1 ) - buildMiniDict( QString(str,i) ); - file.close(); - - QStringList::ConstIterator patIt = patterns.begin(); - QStringList wordLst; - QList a, b; - QList::iterator aIt; - for ( ; patIt != patterns.end(); ++patIt ) { - wordLst = (*patIt).split(QLatin1Char(' ')); - a = miniDict[ wordLst[0] ]->positions; - for ( int j = 1; j < (int)wordLst.count(); ++j ) { - b = miniDict[ 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; + QUrl url(fileName); + QString fName = url.toLocalFile(); + QFile file(fName); + if(!file.open(QFile::ReadOnly)) + { + qWarning("Can't open file %s", qPrintable(fName)); + return false; + } + + wordNum = 3; + miniDict.clear(); + QStringList::ConstIterator cIt = words.begin(); + for(; cIt != words.end(); ++cIt) + miniDict.insert(*cIt, new PosEntry(0)); + + QTextStream s(&file); + 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) + buildMiniDict(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) + buildMiniDict(QString(str, i)); + i = 0; + } + c = buf[++j]; + } + if(i > 1) + buildMiniDict(QString(str, i)); + file.close(); + + QStringList::ConstIterator patIt = patterns.begin(); + QStringList wordLst; + QList a, b; + QList::iterator aIt; + for(; patIt != patterns.end(); ++patIt) + { + wordLst = (*patIt).split(QLatin1Char(' ')); + a = miniDict[wordLst[0]]->positions; + for(int j = 1; j < (int)wordLst.count(); ++j) + { + b = miniDict[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; } QT_END_NAMESPACE diff --git a/src/modules/help/HelpIndex.h b/src/modules/help/HelpIndex.h index effe15f8e..0a6b401f8 100644 --- a/src/modules/help/HelpIndex.h +++ b/src/modules/help/HelpIndex.h @@ -50,88 +50,96 @@ class QTimer; QT_BEGIN_NAMESPACE -struct Document { - Document( int d, int 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 Document +{ + Document(int d, int 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; }; -QDataStream &operator>>( QDataStream &s, Document &l ); -QDataStream &operator<<( QDataStream &s, const Document &l ); +QDataStream & operator>>(QDataStream & s, Document & l); +QDataStream & operator<<(QDataStream & s, const Document & l); class HelpIndex : public QObject { - Q_OBJECT + Q_OBJECT public: - struct Entry { - Entry( int d ) { documents.append( Document( d, 1 ) ); } - Entry( QVector l ) : documents( l ) {} - QVector documents; - }; - struct PosEntry { - PosEntry( int p ) { positions.append( p ); } - QList positions; - }; + struct Entry + { + Entry(int d) { documents.append(Document(d, 1)); } + Entry(QVector l) : documents(l) {} + QVector documents; + }; + struct PosEntry + { + PosEntry(int p) { positions.append(p); } + QList positions; + }; - HelpIndex( const QString &dp, const QString &hp ); - HelpIndex( const QStringList &dl, const QString &hp ); - void writeDict(); - void readDict(); - void makeIndex(); - QStringList query( const QStringList&, const QStringList&, const QStringList& ); - QString getDocumentTitle( const QString& ); - void setDictionaryFile( const QString& ); - void setDocListFile( const QString& ); - void setDocList( const QStringList & ); + HelpIndex(const QString & dp, const QString & hp); + HelpIndex(const QStringList & dl, const QString & hp); + void writeDict(); + void readDict(); + void makeIndex(); + QStringList query(const QStringList &, const QStringList &, const QStringList &); + QString getDocumentTitle(const QString &); + void setDictionaryFile(const QString &); + void setDocListFile(const QString &); + void setDocList(const QStringList &); - const QStringList& documentList() { return docList; }; - const QStringList& titlesList() { return titleList; }; + const QStringList & documentList() { return docList; }; + const QStringList & titlesList() { return titleList; }; signals: - void indexingStart( int ); - void indexingProgress( int ); - void indexingEnd(); + void indexingStart(int); + void indexingProgress(int); + void indexingEnd(); private slots: - void setLastWinClosed(); + void setLastWinClosed(); void filterNext(); + private: - void setupDocumentList(); - void parseDocument( const QString&, int ); - void insertInDict( const QString&, int ); - void writeDocumentList(); - void readDocumentList(); - QStringList getWildcardTerms( const QString& ); - QStringList split( const QString& ); - QVector setupDummyTerm( const QStringList& ); - bool searchForPattern( const QStringList&, const QStringList&, const QString& ); - void buildMiniDict( const QString& ); - QString getCharsetForDocument(QFile *); - QStringList docList; - QStringList titleList; - QHash dict; - QHash miniDict; - uint wordNum; - QString docPath; - QString dictFile, docListFile; - bool alreadyHaveDocList; - bool lastWindowClosed; - QHash documentTitleCache; - QTimer * m_pTimer; - int m_iCurItem; + void setupDocumentList(); + void parseDocument(const QString &, int); + void insertInDict(const QString &, int); + void writeDocumentList(); + void readDocumentList(); + QStringList getWildcardTerms(const QString &); + QStringList split(const QString &); + QVector setupDummyTerm(const QStringList &); + bool searchForPattern(const QStringList &, const QStringList &, const QString &); + void buildMiniDict(const QString &); + QString getCharsetForDocument(QFile *); + QStringList docList; + QStringList titleList; + QHash dict; + QHash miniDict; + uint wordNum; + QString docPath; + QString dictFile, docListFile; + bool alreadyHaveDocList; + bool lastWindowClosed; + QHash documentTitleCache; + QTimer * m_pTimer; + int m_iCurItem; }; #endif diff --git a/src/modules/help/HelpWidget.cpp b/src/modules/help/HelpWidget.cpp index f09ff7f8c..bdf6ec329 100644 --- a/src/modules/help/HelpWidget.cpp +++ b/src/modules/help/HelpWidget.cpp @@ -40,7 +40,7 @@ #include #include -extern HelpIndex * g_pDocIndex; +extern HelpIndex * g_pDocIndex; extern KviPointerList * g_pHelpWindowList; extern KviPointerList * g_pHelpWidgetList; @@ -51,15 +51,16 @@ extern KviPointerList * g_pHelpWidgetList; #define HIGHLIGHT_FLAGS QWebPage::HighlightAllOccurrences HelpWidget::HelpWidget(QWidget * par, bool bIsStandalone) -: QWidget(par) + : QWidget(par) { setObjectName("help_widget"); setMinimumWidth(80); - if(bIsStandalone)g_pHelpWidgetList->append(this); + if(bIsStandalone) + g_pHelpWidgetList->append(this); m_bIsStandalone = bIsStandalone; - new QShortcut(QKeySequence::Copy,this,SLOT(slotCopy()),0,Qt::WidgetWithChildrenShortcut); - new QShortcut(QKeySequence::Find,this,SLOT(slotShowHideFind()),0, bIsStandalone ? Qt::WidgetWithChildrenShortcut : Qt::WindowShortcut); + new QShortcut(QKeySequence::Copy, this, SLOT(slotCopy()), 0, Qt::WidgetWithChildrenShortcut); + new QShortcut(QKeySequence::Find, this, SLOT(slotShowHideFind()), 0, bIsStandalone ? Qt::WidgetWithChildrenShortcut : Qt::WindowShortcut); // layout m_pLayout = new QVBoxLayout(this); @@ -76,33 +77,33 @@ HelpWidget::HelpWidget(QWidget * par, bool bIsStandalone) m_pTextBrowser->setObjectName("text_browser"); m_pTextBrowser->setStyleSheet("QTextBrowser { background-color:white; color:black; }"); m_pLayout->addWidget(m_pTextBrowser); - connect(m_pTextBrowser,SIGNAL(loadFinished(bool)),this,SLOT(slotLoadFinished(bool))); + connect(m_pTextBrowser, SIGNAL(loadFinished(bool)), this, SLOT(slotLoadFinished(bool))); // lower toolbar m_pToolBarHighlight = new QToolBar(this); m_pLayout->addWidget(m_pToolBarHighlight); m_pToolBarHighlight->hide(); - QLabel *pHighlightLabel = new QLabel(); + QLabel * pHighlightLabel = new QLabel(); pHighlightLabel->setText(__tr2qs("Highlight: ")); m_pToolBarHighlight->addWidget(pHighlightLabel); m_pFindText = new QLineEdit(); m_pToolBarHighlight->addWidget(m_pFindText); - connect(m_pFindText,SIGNAL(textChanged(const QString )),this,SLOT(slotTextChanged(const QString))); + connect(m_pFindText, SIGNAL(textChanged(const QString)), this, SLOT(slotTextChanged(const QString))); m_pToolBarHighlight->addAction(*g_pIconManager->getSmallIcon(KviIconManager::Discard), __tr2qs("Reset"), this, SLOT(slotResetFind())); m_pToolBarHighlight->addAction(*g_pIconManager->getSmallIcon(KviIconManager::Part), __tr2qs("Find previous"), this, SLOT(slotFindPrev())); m_pToolBarHighlight->addAction(*g_pIconManager->getSmallIcon(KviIconManager::Join), __tr2qs("Find next"), this, SLOT(slotFindNext())); // upper toolbar contents (depends on webview) - QLabel *pBrowsingLabel = new QLabel(); + QLabel * pBrowsingLabel = new QLabel(); pBrowsingLabel->setText(__tr2qs("Browsing: ")); m_pToolBar->addWidget(pBrowsingLabel); m_pToolBar->addAction(*g_pIconManager->getBigIcon(KVI_BIGICON_HELPINDEX), __tr2qs("Show index"), this, SLOT(showIndex())); - QAction *pAction; + QAction * pAction; pAction = m_pTextBrowser->pageAction(QWebPage::Back); pAction->setIcon(*g_pIconManager->getBigIcon(KVI_BIGICON_HELPBACK)); m_pToolBar->addAction(pAction); @@ -118,7 +119,6 @@ HelpWidget::HelpWidget(QWidget * par, bool bIsStandalone) setAttribute(Qt::WA_DeleteOnClose); m_pToolBar->addAction(*g_pIconManager->getBigIcon(KVI_BIGICON_HELPCLOSE), __tr2qs("Close"), this, SLOT(close())); } - } void HelpWidget::slotCopy() @@ -131,32 +131,34 @@ void HelpWidget::slotShowHideFind() if(m_pToolBarHighlight->isVisible()) { m_pToolBarHighlight->hide(); - } else { + } + else + { m_pToolBarHighlight->show(); m_pFindText->setFocus(); } } -void HelpWidget::slotLoadFinished(bool ) +void HelpWidget::slotLoadFinished(bool) { - m_pTextBrowser->findText(m_pFindText->text(),HIGHLIGHT_FLAGS); + m_pTextBrowser->findText(m_pFindText->text(), HIGHLIGHT_FLAGS); } void HelpWidget::slotTextChanged(const QString szFind) { - m_pTextBrowser->findText("",HIGHLIGHT_FLAGS); - m_pTextBrowser->findText(szFind,HIGHLIGHT_FLAGS); + m_pTextBrowser->findText("", HIGHLIGHT_FLAGS); + m_pTextBrowser->findText(szFind, HIGHLIGHT_FLAGS); } void HelpWidget::slotResetFind() { m_pFindText->setText(""); - m_pTextBrowser->findText("",HIGHLIGHT_FLAGS); + m_pTextBrowser->findText("", HIGHLIGHT_FLAGS); } void HelpWidget::slotFindPrev() { - m_pTextBrowser->findText(m_pFindText->text(),QWebPage::FindBackward); + m_pTextBrowser->findText(m_pFindText->text(), QWebPage::FindBackward); } void HelpWidget::slotFindNext() @@ -165,98 +167,104 @@ void HelpWidget::slotFindNext() } void HelpWidget::slotZoomIn() { - kvs_real_t dZoom=m_pTextBrowser->zoomFactor(); - if(dZoom>=2) return; - dZoom+= 0.05; + kvs_real_t dZoom = m_pTextBrowser->zoomFactor(); + if(dZoom >= 2) + return; + dZoom += 0.05; m_pTextBrowser->setZoomFactor(dZoom); } void HelpWidget::slotZoomOut() { - kvs_real_t dZoom=m_pTextBrowser->zoomFactor(); - if(dZoom<=0.5) return; - dZoom-= 0.05; + kvs_real_t dZoom = m_pTextBrowser->zoomFactor(); + if(dZoom <= 0.5) + return; + dZoom -= 0.05; m_pTextBrowser->setZoomFactor(dZoom); } #else HelpWidget::HelpWidget(QWidget * par, bool bIsStandalone) -: QWidget(par) + : QWidget(par) { setObjectName("help_widget"); setMinimumWidth(80); - if(bIsStandalone)g_pHelpWidgetList->append(this); + if(bIsStandalone) + g_pHelpWidgetList->append(this); m_bIsStandalone = bIsStandalone; m_pTextBrowser = new QTextBrowser(this); m_pTextBrowser->setObjectName("text_browser"); - m_pTextBrowser->setFrameStyle(QFrame::StyledPanel|QFrame::Sunken); + m_pTextBrowser->setFrameStyle(QFrame::StyledPanel | QFrame::Sunken); m_pTextBrowser->setStyleSheet("QTextBrowser { background-color:white; color:black; }"); m_pToolBar = new KviTalHBox(this); m_pBtnIndex = new QToolButton(m_pToolBar); m_pBtnIndex->setIcon(*g_pIconManager->getBigIcon(KVI_BIGICON_HELPINDEX)); - connect(m_pBtnIndex,SIGNAL(clicked()),this,SLOT(showIndex())); + connect(m_pBtnIndex, SIGNAL(clicked()), this, SLOT(showIndex())); m_pBtnBackward = new QToolButton(m_pToolBar); m_pBtnBackward->setIcon(*g_pIconManager->getBigIcon(KVI_BIGICON_HELPBACK)); - connect(m_pBtnBackward,SIGNAL(clicked()),m_pTextBrowser,SLOT(backward())); + connect(m_pBtnBackward, SIGNAL(clicked()), m_pTextBrowser, SLOT(backward())); m_pBtnBackward->setEnabled(false); m_pBtnForward = new QToolButton(m_pToolBar); m_pBtnForward->setIcon(*g_pIconManager->getBigIcon(KVI_BIGICON_HELPFORWARD)); - connect(m_pBtnForward,SIGNAL(clicked()),m_pTextBrowser,SLOT(forward())); + connect(m_pBtnForward, SIGNAL(clicked()), m_pTextBrowser, SLOT(forward())); m_pBtnForward->setEnabled(false); - QWidget* pSpacer=new QWidget(m_pToolBar); + QWidget * pSpacer = new QWidget(m_pToolBar); if(bIsStandalone) { setAttribute(Qt::WA_DeleteOnClose); QToolButton * b = new QToolButton(m_pToolBar); b->setIcon(*g_pIconManager->getBigIcon(KVI_BIGICON_HELPCLOSE)); - connect(b,SIGNAL(clicked()),this,SLOT(close())); + connect(b, SIGNAL(clicked()), this, SLOT(close())); } - m_pToolBar->setStretchFactor(pSpacer,1); - connect(m_pTextBrowser,SIGNAL(backwardAvailable(bool)),m_pBtnBackward,SLOT(setEnabled(bool))); - connect(m_pTextBrowser,SIGNAL(forwardAvailable(bool)),m_pBtnForward,SLOT(setEnabled(bool))); + m_pToolBar->setStretchFactor(pSpacer, 1); + connect(m_pTextBrowser, SIGNAL(backwardAvailable(bool)), m_pBtnBackward, SLOT(setEnabled(bool))); + connect(m_pTextBrowser, SIGNAL(forwardAvailable(bool)), m_pBtnForward, SLOT(setEnabled(bool))); } #endif HelpWidget::~HelpWidget() { - if(m_bIsStandalone)g_pHelpWidgetList->removeRef(this); + if(m_bIsStandalone) + g_pHelpWidgetList->removeRef(this); } void HelpWidget::showIndex() { QString szHelpDir; - QDir dirHelp; + QDir dirHelp; - g_pApp->getGlobalKvircDirectory(szHelpDir,KviApplication::Help); - dirHelp = QDir(szHelpDir); - #ifdef COMPILE_WEBKIT_SUPPORT + g_pApp->getGlobalKvircDirectory(szHelpDir, KviApplication::Help); + dirHelp = QDir(szHelpDir); +#ifdef COMPILE_WEBKIT_SUPPORT m_pTextBrowser->load(QUrl::fromLocalFile(dirHelp.absoluteFilePath("index.html"))); - #else +#else m_pTextBrowser->setSource(QUrl::fromLocalFile(dirHelp.absoluteFilePath("index.html"))); - #endif +#endif } void HelpWidget::resizeEvent(QResizeEvent *) { int hght = m_pToolBar->sizeHint().height(); - if(hght < 40)hght = 40; - m_pToolBar->setGeometry(0,0,width(),hght); - m_pTextBrowser->setGeometry(0,hght,width(),height() - hght); + if(hght < 40) + hght = 40; + m_pToolBar->setGeometry(0, 0, width(), hght); + m_pTextBrowser->setGeometry(0, hght, width(), height() - hght); } QSize HelpWidget::sizeHint() const { int wdth = m_pTextBrowser->sizeHint().width(); - if(m_pToolBar->sizeHint().width() > wdth)wdth = m_pToolBar->sizeHint().width(); - QSize s(wdth,m_pTextBrowser->sizeHint().height() + m_pToolBar->sizeHint().height()); + if(m_pToolBar->sizeHint().width() > wdth) + wdth = m_pToolBar->sizeHint().width(); + QSize s(wdth, m_pTextBrowser->sizeHint().height() + m_pToolBar->sizeHint().height()); return s; } diff --git a/src/modules/help/HelpWidget.h b/src/modules/help/HelpWidget.h index 79a3d78fa..9e73989dc 100644 --- a/src/modules/help/HelpWidget.h +++ b/src/modules/help/HelpWidget.h @@ -28,12 +28,12 @@ #include "kvi_settings.h" #ifdef COMPILE_WEBKIT_SUPPORT - #include - #include - #include +#include +#include +#include #else - #include "KviTalHBox.h" - #include +#include "KviTalHBox.h" +#include #endif #include @@ -45,25 +45,27 @@ class HelpWidget : public QWidget { Q_OBJECT public: - HelpWidget(QWidget *par, bool bIsStandalone = false); + HelpWidget(QWidget * par, bool bIsStandalone = false); ~HelpWidget(); + private: #ifdef COMPILE_WEBKIT_SUPPORT - QToolBar * m_pToolBar; - QToolBar * m_pToolBarHighlight; - QLineEdit * m_pFindText; - QVBoxLayout * m_pLayout; - QWebView * m_pTextBrowser; + QToolBar * m_pToolBar; + QToolBar * m_pToolBarHighlight; + QLineEdit * m_pFindText; + QVBoxLayout * m_pLayout; + QWebView * m_pTextBrowser; #else - QToolButton * m_pBtnIndex; - QToolButton * m_pBtnBackward; - QToolButton * m_pBtnForward; - KviTalHBox * m_pToolBar; + QToolButton * m_pBtnIndex; + QToolButton * m_pBtnBackward; + QToolButton * m_pBtnForward; + KviTalHBox * m_pToolBar; QTextBrowser * m_pTextBrowser; #endif - bool m_bIsStandalone; + bool m_bIsStandalone; + protected: - virtual void resizeEvent(QResizeEvent *e); + virtual void resizeEvent(QResizeEvent * e); protected slots: void showIndex(); #ifdef COMPILE_WEBKIT_SUPPORT @@ -79,12 +81,17 @@ protected slots: #endif public: virtual QSize sizeHint() const; - #ifdef COMPILE_WEBKIT_SUPPORT - QWebView * textBrowser() { return m_pTextBrowser; } - #else - QTextBrowser * textBrowser() { return m_pTextBrowser; } +#ifdef COMPILE_WEBKIT_SUPPORT + QWebView * textBrowser() + { + return m_pTextBrowser; + } +#else + QTextBrowser * textBrowser() + { + return m_pTextBrowser; + } #endif }; - #endif //_HELPWIDGET_H_ diff --git a/src/modules/help/HelpWindow.cpp b/src/modules/help/HelpWindow.cpp index 47c0fe854..541ca1ca8 100644 --- a/src/modules/help/HelpWindow.cpp +++ b/src/modules/help/HelpWindow.cpp @@ -43,62 +43,62 @@ #include #include -extern HelpIndex * g_pDocIndex; +extern HelpIndex * g_pDocIndex; extern KviPointerList * g_pHelpWindowList; extern KviPointerList * g_pHelpWidgetList; //bool g_bIndexingDone = false; HelpWindow::HelpWindow(const char * name) -: KviWindow(KviWindow::Help,name) + : KviWindow(KviWindow::Help, name) { g_pHelpWindowList->append(this); - m_pSplitter = new KviTalSplitter(Qt::Horizontal,this); + m_pSplitter = new KviTalSplitter(Qt::Horizontal, this); m_pSplitter->setObjectName("main_splitter"); m_pSplitter->setChildrenCollapsible(false); m_pHelpWidget = new HelpWidget(m_pSplitter); - m_pToolBar=new KviTalVBox(m_pSplitter); + m_pToolBar = new KviTalVBox(m_pSplitter); m_pTabWidget = new QTabWidget(m_pToolBar); m_pBottomLayout = new KviTalHBox(m_pToolBar); m_pProgressBar = new QProgressBar(m_pBottomLayout); m_pCancelButton = new QPushButton(m_pBottomLayout); - m_pCancelButton->setText(__tr2qs_ctx("Cancel","logview")); - connect(m_pCancelButton,SIGNAL(clicked()),g_pDocIndex,SLOT(setLastWinClosed())); + m_pCancelButton->setText(__tr2qs_ctx("Cancel", "logview")); + connect(m_pCancelButton, SIGNAL(clicked()), g_pDocIndex, SLOT(setLastWinClosed())); m_pBottomLayout->setVisible(false); - m_pIndexTab = new KviTalVBox(m_pTabWidget); - m_pTabWidget->addTab(m_pIndexTab,__tr2qs("Help Index")); + m_pIndexTab = new KviTalVBox(m_pTabWidget); + m_pTabWidget->addTab(m_pIndexTab, __tr2qs("Help Index")); - KviTalHBox* pSearchBox = new KviTalHBox(m_pIndexTab); + KviTalHBox * pSearchBox = new KviTalHBox(m_pIndexTab); m_pIndexSearch = new QLineEdit(pSearchBox); - connect( m_pIndexSearch, SIGNAL( textChanged(const QString&) ), - this, SLOT( searchInIndex(const QString&) ) ); - connect( m_pIndexSearch, SIGNAL( returnPressed() ), - this, SLOT( showIndexTopic() ) ); + connect(m_pIndexSearch, SIGNAL(textChanged(const QString &)), + this, SLOT(searchInIndex(const QString &))); + connect(m_pIndexSearch, SIGNAL(returnPressed()), + this, SLOT(showIndexTopic())); m_pBtnRefreshIndex = new QPushButton(pSearchBox); m_pBtnRefreshIndex->setIcon(*g_pIconManager->getBigIcon(KVI_REFRESH_IMAGE_NAME)); - connect(m_pBtnRefreshIndex,SIGNAL(clicked()),this,SLOT(refreshIndex())); - m_pBtnRefreshIndex->setToolTip(__tr2qs("Refresh index") ); + connect(m_pBtnRefreshIndex, SIGNAL(clicked()), this, SLOT(refreshIndex())); + m_pBtnRefreshIndex->setToolTip(__tr2qs("Refresh index")); m_pIndexListWidget = new KviTalListWidget(m_pIndexTab); - connect(m_pIndexListWidget,SIGNAL(itemActivated(QListWidgetItem *)),this,SLOT(indexSelected (QListWidgetItem * ))); + connect(m_pIndexListWidget, SIGNAL(itemActivated(QListWidgetItem *)), this, SLOT(indexSelected(QListWidgetItem *))); - m_pSearchTab = new KviTalVBox(m_pTabWidget); - m_pTabWidget->addTab(m_pSearchTab,__tr2qs("Search")); + m_pSearchTab = new KviTalVBox(m_pTabWidget); + m_pTabWidget->addTab(m_pSearchTab, __tr2qs("Search")); m_pTermsEdit = new QLineEdit(m_pSearchTab); - connect( m_pTermsEdit, SIGNAL( returnPressed() ), - this, SLOT( startSearch() ) ); + connect(m_pTermsEdit, SIGNAL(returnPressed()), + this, SLOT(startSearch())); m_pResultBox = new KviTalListWidget(m_pSearchTab); - connect(m_pResultBox,SIGNAL(itemActivated(QListWidgetItem *)),this,SLOT(searchSelected (QListWidgetItem *))); + connect(m_pResultBox, SIGNAL(itemActivated(QListWidgetItem *)), this, SLOT(searchSelected(QListWidgetItem *))); QList li; - li.append(width()-80); + li.append(width() - 80); li.append(80); m_pSplitter->setSizes(li); @@ -106,7 +106,7 @@ HelpWindow::HelpWindow(const char * name) connect(g_pDocIndex, SIGNAL(indexingProgress(int)), this, SLOT(indexingProgress(int))); connect(g_pDocIndex, SIGNAL(indexingEnd()), this, SLOT(indexingEnd())); - QTimer::singleShot(0,this,SLOT(initialSetup())); + QTimer::singleShot(0, this, SLOT(initialSetup())); } HelpWindow::~HelpWindow() @@ -118,36 +118,38 @@ void HelpWindow::initialSetup() { m_pIndexSearch->setFocus(); -/* if(!g_bIndexingDone) + /* if(!g_bIndexingDone) { g_bIndexingDone=true;*/ - QString szDoclist,szDict; - - g_pApp->getLocalKvircDirectory(szDoclist,KviApplication::Help,"help.doclist." KVI_SOURCES_DATE); - g_pApp->getLocalKvircDirectory(szDict,KviApplication::Help,"help.dict." KVI_SOURCES_DATE); - - if ( QFileInfo( szDoclist ).exists() && QFileInfo( szDict ).exists() ) { - g_pDocIndex->readDict(); - m_pIndexListWidget->clear(); - QStringList docList=g_pDocIndex->titlesList(); - m_pIndexListWidget->addItems(docList); - m_pIndexListWidget->sortItems(); - m_pBtnRefreshIndex->setEnabled(true); - } else { - g_pDocIndex->makeIndex(); - - } + QString szDoclist, szDict; + + g_pApp->getLocalKvircDirectory(szDoclist, KviApplication::Help, "help.doclist." KVI_SOURCES_DATE); + g_pApp->getLocalKvircDirectory(szDict, KviApplication::Help, "help.dict." KVI_SOURCES_DATE); + + if(QFileInfo(szDoclist).exists() && QFileInfo(szDict).exists()) + { + g_pDocIndex->readDict(); + m_pIndexListWidget->clear(); + QStringList docList = g_pDocIndex->titlesList(); + m_pIndexListWidget->addItems(docList); + m_pIndexListWidget->sortItems(); + m_pBtnRefreshIndex->setEnabled(true); + } + else + { + g_pDocIndex->makeIndex(); + } //} } -void HelpWindow::indexingStart( int iNum ) +void HelpWindow::indexingStart(int iNum) { m_pBtnRefreshIndex->setEnabled(false); m_pBottomLayout->setVisible(true); m_pProgressBar->setRange(0, iNum); m_pProgressBar->setValue(0); } -void HelpWindow::indexingProgress( int iNum ) +void HelpWindow::indexingProgress(int iNum) { m_pProgressBar->setValue(iNum); } @@ -158,25 +160,25 @@ void HelpWindow::indexingEnd() m_pBottomLayout->setVisible(false); g_pDocIndex->writeDict(); m_pIndexListWidget->clear(); - QStringList docList=g_pDocIndex->titlesList(); + QStringList docList = g_pDocIndex->titlesList(); m_pIndexListWidget->addItems(docList); m_pIndexListWidget->sortItems(); m_pBtnRefreshIndex->setEnabled(true); } -void HelpWindow::saveProperties(KviConfigurationFile *cfg) +void HelpWindow::saveProperties(KviConfigurationFile * cfg) { KviWindow::saveProperties(cfg); - cfg->writeEntry("Splitter",m_pSplitter->sizes()); + cfg->writeEntry("Splitter", m_pSplitter->sizes()); } -void HelpWindow::loadProperties(KviConfigurationFile *cfg) +void HelpWindow::loadProperties(KviConfigurationFile * cfg) { QList def; int w = width(); def.append((w * 82) / 100); def.append((w * 18) / 100); - m_pSplitter->setSizes(cfg->readIntListEntry("Splitter",def)); + m_pSplitter->setSizes(cfg->readIntListEntry("Splitter", def)); KviWindow::loadProperties(cfg); } @@ -188,79 +190,91 @@ void HelpWindow::refreshIndex() void HelpWindow::startSearch() { QString str = m_pTermsEdit->text(); - str = str.replace( "\'", "\"" ); - str = str.replace( "`", "\"" ); + str = str.replace("\'", "\""); + str = str.replace("`", "\""); QString buf = str; - str = str.replace( "-", " " ); - str = str.replace( QRegExp( "\\s[\\S]?\\s" ), " " ); - m_terms = str.split(" ",QString::SkipEmptyParts); + str = str.replace("-", " "); + str = str.replace(QRegExp("\\s[\\S]?\\s"), " "); + m_terms = str.split(" ", QString::SkipEmptyParts); QStringList termSeq; QStringList seqWords; QStringList::iterator it = m_terms.begin(); - for ( ; it != m_terms.end(); ++it ) { + for(; it != m_terms.end(); ++it) + { (*it) = (*it).simplified(); (*it) = (*it).toLower(); - (*it) = (*it).replace( "\"", "" ); + (*it) = (*it).replace("\"", ""); } - if ( str.contains( '\"' ) ) { - if ( (str.count( '\"' ))%2 == 0 ) { + if(str.contains('\"')) + { + if((str.count('\"')) % 2 == 0) + { int beg = 0; int end = 0; QString s; - beg = str.indexOf( '\"', beg ); - while ( beg != -1 ) { + beg = str.indexOf('\"', beg); + while(beg != -1) + { beg++; - end = str.indexOf( '\"', beg ); - s = str.mid( beg, end - beg ); + end = str.indexOf('\"', beg); + s = str.mid(beg, end - beg); s = s.toLower(); s = s.simplified(); - if ( s.contains( '*' ) ) { - QMessageBox::warning( this, tr( "Full Text Search - KVIrc" ), - tr( "Using a wildcard within phrases is not allowed." ) ); - return; + if(s.contains('*')) + { + QMessageBox::warning(this, tr("Full Text Search - KVIrc"), + tr("Using a wildcard within phrases is not allowed.")); + return; } - seqWords += s.split( ' ', QString::SkipEmptyParts ); + seqWords += s.split(' ', QString::SkipEmptyParts); termSeq << s; - beg = str.indexOf( '\"', end + 1); + beg = str.indexOf('\"', end + 1); } - } else { - QMessageBox::warning( this, tr( "Full Text Search - KVIrc" ), - tr( "The closing quotation mark is missing." ) ); + } + else + { + QMessageBox::warning(this, tr("Full Text Search - KVIrc"), + tr("The closing quotation mark is missing.")); return; } } - setCursor( Qt::WaitCursor ); + setCursor(Qt::WaitCursor); m_foundDocs.clear(); - m_foundDocs = g_pDocIndex->query( m_terms, termSeq, seqWords ); + m_foundDocs = g_pDocIndex->query(m_terms, termSeq, seqWords); m_pResultBox->clear(); - for ( it = m_foundDocs.begin(); it != m_foundDocs.end(); ++it ) - m_pResultBox->addItem( g_pDocIndex->getDocumentTitle( *it ) ); + for(it = m_foundDocs.begin(); it != m_foundDocs.end(); ++it) + m_pResultBox->addItem(g_pDocIndex->getDocumentTitle(*it)); m_terms.clear(); bool isPhrase = false; QString s = ""; - for ( int i = 0; i < (int)buf.length(); ++i ) { - if ( buf[i] == '\"' ) { + for(int i = 0; i < (int)buf.length(); ++i) + { + if(buf[i] == '\"') + { isPhrase = !isPhrase; s = s.simplified(); - if ( !s.isEmpty() ) + if(!s.isEmpty()) m_terms << s; s = ""; - } else if ( buf[i] == ' ' && !isPhrase ) { + } + else if(buf[i] == ' ' && !isPhrase) + { s = s.simplified(); - if ( !s.isEmpty() ) + if(!s.isEmpty()) m_terms << s; s = ""; - } else - s += buf[i]; + } + else + s += buf[i]; } - if ( !s.isEmpty() ) m_terms << s; + if(!s.isEmpty()) + m_terms << s; - setCursor( Qt::ArrowCursor ); + setCursor(Qt::ArrowCursor); } - #ifdef COMPILE_WEBKIT_SUPPORT QWebView * HelpWindow::textBrowser() #else @@ -272,52 +286,55 @@ QTextBrowser * HelpWindow::textBrowser() void HelpWindow::showIndexTopic() { - if (m_pIndexSearch->text().isEmpty()|| !m_pIndexListWidget->selectedItems().count()) return; - int i=g_pDocIndex->titlesList().indexOf(m_pIndexListWidget->selectedItems().at(0)->text()); - #ifdef COMPILE_WEBKIT_SUPPORT - textBrowser()->load(QUrl(g_pDocIndex->documentList()[ i ])); - #else - textBrowser()->setSource(QUrl(g_pDocIndex->documentList()[ i ])); - #endif + if(m_pIndexSearch->text().isEmpty() || !m_pIndexListWidget->selectedItems().count()) + return; + int i = g_pDocIndex->titlesList().indexOf(m_pIndexListWidget->selectedItems().at(0)->text()); +#ifdef COMPILE_WEBKIT_SUPPORT + textBrowser()->load(QUrl(g_pDocIndex->documentList()[i])); +#else + textBrowser()->setSource(QUrl(g_pDocIndex->documentList()[i])); +#endif } -void HelpWindow::searchInIndex( const QString &s ) +void HelpWindow::searchInIndex(const QString & s) { - QListWidgetItem *item ; + QListWidgetItem * item; QString sl = s.toLower(); - for(int i=0;icount();i++) + for(int i = 0; i < m_pIndexListWidget->count(); i++) { - item=m_pIndexListWidget->item(i); + item = m_pIndexListWidget->item(i); QString t = item->text(); - if ( t.length() >= sl.length() && - item->text().left(s.length()).toLower() == sl ) { - m_pIndexListWidget->setCurrentItem( item ); - m_pIndexListWidget->scrollToItem(item,QAbstractItemView::PositionAtTop); + if(t.length() >= sl.length() && item->text().left(s.length()).toLower() == sl) + { + m_pIndexListWidget->setCurrentItem(item); + m_pIndexListWidget->scrollToItem(item, QAbstractItemView::PositionAtTop); break; } } } -void HelpWindow::indexSelected ( QListWidgetItem *item ) +void HelpWindow::indexSelected(QListWidgetItem * item) { - if (!item) return; - int i=g_pDocIndex->titlesList().indexOf(item->text()); - #ifdef COMPILE_WEBKIT_SUPPORT - textBrowser()->load(QUrl(g_pDocIndex->documentList()[ i ])); - #else - textBrowser()->setSource(QUrl(g_pDocIndex->documentList()[ i ])); - #endif + if(!item) + return; + int i = g_pDocIndex->titlesList().indexOf(item->text()); +#ifdef COMPILE_WEBKIT_SUPPORT + textBrowser()->load(QUrl(g_pDocIndex->documentList()[i])); +#else + textBrowser()->setSource(QUrl(g_pDocIndex->documentList()[i])); +#endif } -void HelpWindow::searchSelected ( QListWidgetItem *item ) +void HelpWindow::searchSelected(QListWidgetItem * item) { - if (!item) return; - int i=g_pDocIndex->titlesList().indexOf(item->text()); - #ifdef COMPILE_WEBKIT_SUPPORT - textBrowser()->load(QUrl(g_pDocIndex->documentList()[ i ])); - #else - textBrowser()->setSource(QUrl(g_pDocIndex->documentList()[ i ])); - #endif + if(!item) + return; + int i = g_pDocIndex->titlesList().indexOf(item->text()); +#ifdef COMPILE_WEBKIT_SUPPORT + textBrowser()->load(QUrl(g_pDocIndex->documentList()[i])); +#else + textBrowser()->setSource(QUrl(g_pDocIndex->documentList()[i])); +#endif } QPixmap * HelpWindow::myIconPtr() @@ -327,7 +344,7 @@ QPixmap * HelpWindow::myIconPtr() void HelpWindow::resizeEvent(QResizeEvent *) { - m_pSplitter->setGeometry(0,0,width(),height()); + m_pSplitter->setGeometry(0, 0, width(), height()); } void HelpWindow::fillCaptionBuffers() diff --git a/src/modules/help/HelpWindow.h b/src/modules/help/HelpWindow.h index 0c4d5f831..1447d15dc 100644 --- a/src/modules/help/HelpWindow.h +++ b/src/modules/help/HelpWindow.h @@ -32,9 +32,9 @@ #include #ifdef COMPILE_WEBKIT_SUPPORT - #include +#include #else - class QTextBrowser; +class QTextBrowser; #endif #include @@ -50,48 +50,51 @@ class HelpWindow : public KviWindow public: HelpWindow(const char * name); ~HelpWindow(); + protected: HelpWidget * m_pHelpWidget; - KviTalVBox * m_pToolBar; - QTabWidget * m_pTabWidget; - KviTalVBox * m_pIndexTab; - KviTalVBox * m_pSearchTab; - KviTalHBox * m_pBottomLayout; - QPushButton * m_pCancelButton; - QProgressBar * m_pProgressBar; + KviTalVBox * m_pToolBar; + QTabWidget * m_pTabWidget; + KviTalVBox * m_pIndexTab; + KviTalVBox * m_pSearchTab; + KviTalHBox * m_pBottomLayout; + QPushButton * m_pCancelButton; + QProgressBar * m_pProgressBar; + + KviTalListWidget * m_pIndexListWidget; + QLineEdit * m_pIndexSearch; + QStringList m_foundDocs; + QStringList m_terms; + KviTalListWidget * m_pResultBox; + QLineEdit * m_pTermsEdit; + QPushButton * m_pBtnRefreshIndex; - KviTalListWidget* m_pIndexListWidget; - QLineEdit * m_pIndexSearch; - QStringList m_foundDocs; - QStringList m_terms; - KviTalListWidget* m_pResultBox; - QLineEdit * m_pTermsEdit; - QPushButton * m_pBtnRefreshIndex; public: - HelpWidget * helpWidget(){ return m_pHelpWidget; }; + HelpWidget * helpWidget() { return m_pHelpWidget; }; protected: virtual QPixmap * myIconPtr(); virtual void fillCaptionBuffers(); - virtual void resizeEvent(QResizeEvent *e); + virtual void resizeEvent(QResizeEvent * e); virtual void saveProperties(KviConfigurationFile * cfg); virtual void loadProperties(KviConfigurationFile * cfg); + public: - #ifdef COMPILE_WEBKIT_SUPPORT +#ifdef COMPILE_WEBKIT_SUPPORT QWebView * textBrowser(); - #else +#else QTextBrowser * textBrowser(); - #endif +#endif public slots: - void indexSelected ( QListWidgetItem * ); - void searchInIndex( const QString &s ); + void indexSelected(QListWidgetItem *); + void searchInIndex(const QString & s); void showIndexTopic(); void startSearch(); - void searchSelected ( QListWidgetItem * ); + void searchSelected(QListWidgetItem *); void refreshIndex(); void initialSetup(); - void indexingStart( int iNum ); - void indexingProgress( int iNum ); + void indexingStart(int iNum); + void indexingProgress(int iNum); void indexingEnd(); }; diff --git a/src/modules/help/libkvihelp.cpp b/src/modules/help/libkvihelp.cpp index 61b8bd1fd..c5dde5b99 100644 --- a/src/modules/help/libkvihelp.cpp +++ b/src/modules/help/libkvihelp.cpp @@ -36,7 +36,7 @@ #include #include -HelpIndex * g_pDocIndex = 0; +HelpIndex * g_pDocIndex = 0; KviPointerList * g_pHelpWidgetList = 0; KviPointerList * g_pHelpWindowList = 0; @@ -80,21 +80,20 @@ KviPointerList * g_pHelpWindowList = 0; [/example] */ - static bool help_kvs_cmd_open(KviKvsModuleCommandCall * c) { QString szDoc, szHelpDir, szParam; - QDir dirHelp; + QDir dirHelp; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("document",KVS_PT_STRING,KVS_PF_OPTIONAL | KVS_PF_APPENDREMAINING,szParam) + KVSM_PARAMETER("document", KVS_PT_STRING, KVS_PF_OPTIONAL | KVS_PF_APPENDREMAINING, szParam) KVSM_PARAMETERS_END(c) // no document => index if(szParam.isEmpty()) { szParam = QString("index.html"); - qDebug ("No file, use default at path %s",szDoc.toUtf8().data()); + qDebug("No file, use default at path %s", szDoc.toUtf8().data()); } /* @@ -109,20 +108,20 @@ static bool help_kvs_cmd_open(KviKvsModuleCommandCall * c) if(!f.exists() || !f.isAbsolute()) { // try relative path (to local help) - g_pApp->getLocalKvircDirectory(szHelpDir,KviApplication::Help); + g_pApp->getLocalKvircDirectory(szHelpDir, KviApplication::Help); dirHelp = QDir(szHelpDir); szDoc = dirHelp.absoluteFilePath(szParam); - qDebug("No abs path, trying local relative path: %s",szDoc.toUtf8().data()); + qDebug("No abs path, trying local relative path: %s", szDoc.toUtf8().data()); f.setFile(szDoc); if(!f.exists()) { //try relative path (to global help) - g_pApp->getGlobalKvircDirectory(szHelpDir,KviApplication::Help); + g_pApp->getGlobalKvircDirectory(szHelpDir, KviApplication::Help); dirHelp = QDir(szHelpDir); szDoc = dirHelp.absoluteFilePath(szParam); - qDebug("No local relative, trying global relative path: %s",szDoc.toUtf8().data()); + qDebug("No local relative, trying global relative path: %s", szDoc.toUtf8().data()); f.setFile(szDoc); } } @@ -133,33 +132,37 @@ static bool help_kvs_cmd_open(KviKvsModuleCommandCall * c) qDebug("No path, trying search.."); if(g_pDocIndex) { - if (!g_pDocIndex->documentList().count()) + if(!g_pDocIndex->documentList().count()) { - QString szDoclist,szDict; - g_pApp->getLocalKvircDirectory(szDoclist,KviApplication::Help,"help.doclist." KVI_SOURCES_DATE); - g_pApp->getLocalKvircDirectory(szDict,KviApplication::Help,"help.dict." KVI_SOURCES_DATE); - if ( KviFileUtils::fileExists(szDoclist) && KviFileUtils::fileExists( szDict )) + QString szDoclist, szDict; + g_pApp->getLocalKvircDirectory(szDoclist, KviApplication::Help, "help.doclist." KVI_SOURCES_DATE); + g_pApp->getLocalKvircDirectory(szDict, KviApplication::Help, "help.dict." KVI_SOURCES_DATE); + if(KviFileUtils::fileExists(szDoclist) && KviFileUtils::fileExists(szDict)) { g_pDocIndex->readDict(); - } else { + } + else + { g_pDocIndex->makeIndex(); g_pDocIndex->writeDict(); } } - int i=g_pDocIndex->titlesList().indexOf(QRegExp(QRegExp::escape(szParam), Qt::CaseInsensitive)); - if (i!=-1) + int i = g_pDocIndex->titlesList().indexOf(QRegExp(QRegExp::escape(szParam), Qt::CaseInsensitive)); + if(i != -1) { - szDoc=QUrl(g_pDocIndex->documentList()[ i ]).toLocalFile(); + szDoc = QUrl(g_pDocIndex->documentList()[i]).toLocalFile(); f.setFile(szDoc); - } else { + } + else + { QString szTmpDocName(".*/doc_"); szTmpDocName.append(QRegExp::escape(szParam)); szTmpDocName.append("\\.html"); - i=g_pDocIndex->documentList().indexOf(QRegExp(szTmpDocName, Qt::CaseInsensitive)); - if (i!=-1) + i = g_pDocIndex->documentList().indexOf(QRegExp(szTmpDocName, Qt::CaseInsensitive)); + if(i != -1) { - szDoc=QUrl(g_pDocIndex->documentList()[ i ]).toLocalFile(); + szDoc = QUrl(g_pDocIndex->documentList()[i]).toLocalFile(); f.setFile(szDoc); } } @@ -171,40 +174,42 @@ static bool help_kvs_cmd_open(KviKvsModuleCommandCall * c) { szDoc = dirHelp.absoluteFilePath("nohelpavailable.html"); - qDebug("Document not found, defaulting to error page: %s",szDoc.toUtf8().data()); + qDebug("Document not found, defaulting to error page: %s", szDoc.toUtf8().data()); f.setFile(szDoc); } - if(!c->switches()->find('n',"new")) + if(!c->switches()->find('n', "new")) { HelpWidget * w = (HelpWidget *)g_pMainWindow->findChild("help_widget"); if(w) { - #ifdef COMPILE_WEBKIT_SUPPORT +#ifdef COMPILE_WEBKIT_SUPPORT w->textBrowser()->load(QUrl::fromLocalFile(f.absoluteFilePath())); - #else +#else w->textBrowser()->setSource(QUrl::fromLocalFile(f.absoluteFilePath())); - #endif +#endif return true; } } - if(c->switches()->find('m',"mdi")) + if(c->switches()->find('m', "mdi")) { - HelpWindow *w = new HelpWindow("Help browser"); - #ifdef COMPILE_WEBKIT_SUPPORT + HelpWindow * w = new HelpWindow("Help browser"); +#ifdef COMPILE_WEBKIT_SUPPORT w->textBrowser()->load(QUrl::fromLocalFile(f.absoluteFilePath())); - #else +#else w->textBrowser()->setSource(QUrl::fromLocalFile(f.absoluteFilePath())); - #endif +#endif g_pMainWindow->addWindow(w); - } else { - HelpWidget *w = new HelpWidget(g_pMainWindow->splitter(), true); - #ifdef COMPILE_WEBKIT_SUPPORT + } + else + { + HelpWidget * w = new HelpWidget(g_pMainWindow->splitter(), true); +#ifdef COMPILE_WEBKIT_SUPPORT w->textBrowser()->load(QUrl::fromLocalFile(f.absoluteFilePath())); - #else +#else w->textBrowser()->setSource(QUrl::fromLocalFile(f.absoluteFilePath())); - #endif +#endif w->show(); } @@ -213,15 +218,15 @@ static bool help_kvs_cmd_open(KviKvsModuleCommandCall * c) static bool help_module_init(KviModule * m) { - QString szHelpDir,szDocList; + QString szHelpDir, szDocList; - g_pApp->getLocalKvircDirectory(szDocList,KviApplication::Help,"help.doclist." KVI_SOURCES_DATE); - g_pApp->getGlobalKvircDirectory(szHelpDir,KviApplication::Help); + g_pApp->getLocalKvircDirectory(szDocList, KviApplication::Help, "help.doclist." KVI_SOURCES_DATE); + g_pApp->getGlobalKvircDirectory(szHelpDir, KviApplication::Help); - g_pDocIndex = new HelpIndex(szHelpDir,szDocList); + g_pDocIndex = new HelpIndex(szHelpDir, szDocList); g_pDocIndex->setDocListFile(szDocList); - g_pApp->getLocalKvircDirectory(szHelpDir,KviApplication::Help,"help.dict." KVI_SOURCES_DATE); + g_pApp->getLocalKvircDirectory(szHelpDir, KviApplication::Help, "help.dict." KVI_SOURCES_DATE); g_pDocIndex->setDictionaryFile(szHelpDir); g_pHelpWidgetList = new KviPointerList; @@ -229,9 +234,7 @@ static bool help_module_init(KviModule * m) g_pHelpWindowList = new KviPointerList; g_pHelpWindowList->setAutoDelete(false); - KVSM_REGISTER_SIMPLE_COMMAND(m,"open",help_kvs_cmd_open); - - + KVSM_REGISTER_SIMPLE_COMMAND(m, "open", help_kvs_cmd_open); return true; } @@ -257,13 +260,12 @@ static bool help_module_can_unload(KviModule *) } KVIRC_MODULE( - "Help", // module name - "4.0.0", // module version - "Copyright (C) 2000 Szymon Stefanek (pragma at kvirc dot net)", // author & (C) - "Help browser extension", - help_module_init, - help_module_can_unload, - 0, - help_module_cleanup, - 0 -) + "Help", // module name + "4.0.0", // module version + "Copyright (C) 2000 Szymon Stefanek (pragma at kvirc dot net)", // author & (C) + "Help browser extension", + help_module_init, + help_module_can_unload, + 0, + help_module_cleanup, + 0) diff --git a/src/modules/http/HttpFileTransfer.cpp b/src/modules/http/HttpFileTransfer.cpp index b94838c62..2719bc611 100644 --- a/src/modules/http/HttpFileTransfer.cpp +++ b/src/modules/http/HttpFileTransfer.cpp @@ -40,9 +40,8 @@ static KviPointerList * g_pHttpFileTransfers = 0; static QPixmap * g_pHttpIcon = 0; - HttpFileTransfer::HttpFileTransfer() -: KviFileTransfer() + : KviFileTransfer() { init(); // ensure we're initialized g_pHttpFileTransfers->append(this); @@ -58,17 +57,17 @@ HttpFileTransfer::HttpFileTransfer() m_pHttpRequest = new KviHttpRequest(); - connect(m_pHttpRequest,SIGNAL(status(const QString &)),this,SLOT(statusMessage(const QString &))); - connect(m_pHttpRequest,SIGNAL(terminated(bool)),this,SLOT(transferTerminated(bool))); - connect(m_pHttpRequest,SIGNAL(header(KviPointerHashTable *)),this,SLOT(headersReceived(KviPointerHashTable *))); - connect(m_pHttpRequest,SIGNAL(resolvingHost(const QString &)),this,SLOT(resolvingHost(const QString &))); - connect(m_pHttpRequest,SIGNAL(requestSent(const QStringList &)),this,SLOT(requestSent(const QStringList &))); - connect(m_pHttpRequest,SIGNAL(contactingHost(const QString &)),this,SLOT(contactingHost(const QString &))); - connect(m_pHttpRequest,SIGNAL(receivedResponse(const QString &)),this,SLOT(receivedResponse(const QString &))); - connect(m_pHttpRequest,SIGNAL(connectionEstablished()),this,SLOT(connectionEstablished())); + connect(m_pHttpRequest, SIGNAL(status(const QString &)), this, SLOT(statusMessage(const QString &))); + connect(m_pHttpRequest, SIGNAL(terminated(bool)), this, SLOT(transferTerminated(bool))); + connect(m_pHttpRequest, SIGNAL(header(KviPointerHashTable *)), this, SLOT(headersReceived(KviPointerHashTable *))); + connect(m_pHttpRequest, SIGNAL(resolvingHost(const QString &)), this, SLOT(resolvingHost(const QString &))); + connect(m_pHttpRequest, SIGNAL(requestSent(const QStringList &)), this, SLOT(requestSent(const QStringList &))); + connect(m_pHttpRequest, SIGNAL(contactingHost(const QString &)), this, SLOT(contactingHost(const QString &))); + connect(m_pHttpRequest, SIGNAL(receivedResponse(const QString &)), this, SLOT(receivedResponse(const QString &))); + connect(m_pHttpRequest, SIGNAL(connectionEstablished()), this, SLOT(connectionEstablished())); m_eGeneralStatus = Initializing; - m_szStatusString = __tr2qs_ctx("Initializing","http"); + m_szStatusString = __tr2qs_ctx("Initializing", "http"); } HttpFileTransfer::~HttpFileTransfer() @@ -100,9 +99,9 @@ void HttpFileTransfer::abort() void HttpFileTransfer::fillContextPopup(QMenu * m) { - QAction *pAction = m->addAction(__tr2qs_ctx("Abort","http"),this,SLOT(abort())); - if(!active()) - pAction->setEnabled(false); + QAction * pAction = m->addAction(__tr2qs_ctx("Abort", "http"), this, SLOT(abort())); + if(!active()) + pAction->setEnabled(false); } bool HttpFileTransfer::active() @@ -110,7 +109,7 @@ bool HttpFileTransfer::active() return ((m_eGeneralStatus == Connecting) || (m_eGeneralStatus == Downloading)); } -void HttpFileTransfer::displayPaint(QPainter * p,int column, QRect rect) +void HttpFileTransfer::displayPaint(QPainter * p, int column, QRect rect) { int width = rect.width(), height = rect.height(); QString txt; @@ -124,53 +123,61 @@ void HttpFileTransfer::displayPaint(QPainter * p,int column, QRect rect) switch(m_eGeneralStatus) { case Initializing: - case Connecting: offset = 0; break; - case Downloading: offset = 48; break; - case Success: offset = 96; break; - case Failure: offset = 144; break; + case Connecting: + offset = 0; + break; + case Downloading: + offset = 48; + break; + case Success: + offset = 96; + break; + case Failure: + offset = 144; + break; } if(g_pHttpIcon) - p->drawPixmap(width / 2 - 48 / 2,rect.top() + height / 2 - 64 / 2,*g_pHttpIcon,offset,0,48,64); + p->drawPixmap(width / 2 - 48 / 2, rect.top() + height / 2 - 64 / 2, *g_pHttpIcon, offset, 0, 48, 64); } break; case COLUMN_FILEINFO: { QFontMetrics fm(p->font()); - QString szFrom = __tr2qs_ctx("From: ","http"); - QString szTo = __tr2qs_ctx("To: ","http"); + QString szFrom = __tr2qs_ctx("From: ", "http"); + QString szTo = __tr2qs_ctx("To: ", "http"); int daW1 = fm.width(szFrom); int daW2 = fm.width(szTo); - if(daW1 < daW2)daW1 = daW2; + if(daW1 < daW2) + daW1 = daW2; int iLineSpacing = fm.lineSpacing(); p->setPen(Qt::black); int iY = rect.top() + 4; - p->drawText(rect.left() + 4 + daW1,iY,width - (8 + daW1),height - 8,Qt::AlignTop | Qt::AlignLeft,m_pHttpRequest->url().url()); + p->drawText(rect.left() + 4 + daW1, iY, width - (8 + daW1), height - 8, Qt::AlignTop | Qt::AlignLeft, m_pHttpRequest->url().url()); iY += iLineSpacing; if(!(m_pHttpRequest->fileName().isEmpty())) { - p->drawText(rect.left() + 4 + daW1,iY,width - (8 + daW1),height - 8,Qt::AlignTop | Qt::AlignLeft,m_pHttpRequest->fileName()); + p->drawText(rect.left() + 4 + daW1, iY, width - (8 + daW1), height - 8, Qt::AlignTop | Qt::AlignLeft, m_pHttpRequest->fileName()); } iY += iLineSpacing; - p->setPen(Qt::darkGray); - p->drawText(rect.left() + 4, rect.top() + 4,width - 8,height - 8,Qt::AlignTop | Qt::AlignLeft,szFrom); - p->drawText(rect.left() + 4, rect.top() + 4 + iLineSpacing,width - 8,height - 8,Qt::AlignTop | Qt::AlignLeft,szTo); + p->drawText(rect.left() + 4, rect.top() + 4, width - 8, height - 8, Qt::AlignTop | Qt::AlignLeft, szFrom); + p->drawText(rect.left() + 4, rect.top() + 4 + iLineSpacing, width - 8, height - 8, Qt::AlignTop | Qt::AlignLeft, szTo); - p->setPen(QColor(180,180,200)); + p->setPen(QColor(180, 180, 200)); iLineSpacing += 2; - p->drawRect(rect.left() + 4, rect.top() + height - (iLineSpacing + 4),width - 8,iLineSpacing); - p->fillRect(rect.left() + 5, rect.top() + height - (iLineSpacing + 3),width - 10,iLineSpacing - 2,bIsTerminated ? QColor(210,210,210) : QColor(190,190,240)); + p->drawRect(rect.left() + 4, rect.top() + height - (iLineSpacing + 4), width - 8, iLineSpacing); + p->fillRect(rect.left() + 5, rect.top() + height - (iLineSpacing + 3), width - 10, iLineSpacing - 2, bIsTerminated ? QColor(210, 210, 210) : QColor(190, 190, 240)); p->setPen(Qt::black); - p->drawText(rect.left() + 7, rect.top() + height - (iLineSpacing + 4),width - 14,iLineSpacing,Qt::AlignVCenter | Qt::AlignLeft,m_szStatusString); + p->drawText(rect.left() + 7, rect.top() + height - (iLineSpacing + 4), width - 14, iLineSpacing, Qt::AlignVCenter | Qt::AlignLeft, m_szStatusString); } break; case COLUMN_PROGRESS: @@ -181,15 +188,15 @@ void HttpFileTransfer::displayPaint(QPainter * p,int column, QRect rect) unsigned int uRecvd = m_pHttpRequest->receivedSize(); int iW = width - 8; - p->setPen(bIsTerminated ? Qt::lightGray : QColor(210,210,240)); - p->drawRect(rect.left() + 4, rect.top() + 4,iW,12); + p->setPen(bIsTerminated ? Qt::lightGray : QColor(210, 210, 240)); + p->drawRect(rect.left() + 4, rect.top() + 4, iW, 12); int iAvgSpeed = -1; int iEta = -1; if(m_tTransferStartTime > 0) { - int tSpan = kvi_timeSpan(m_tTransferEndTime > 0 ? m_tTransferEndTime : kvi_unixTime(),m_tTransferStartTime); + int tSpan = kvi_timeSpan(m_tTransferEndTime > 0 ? m_tTransferEndTime : kvi_unixTime(), m_tTransferStartTime); if(tSpan > 0) { //qDebug("SPAN: %d (%d - %d)",tSpan,m_tTransferEndTime > 0 ? m_tTransferEndTime : kvi_unixTime(),m_tTransferStartTime); @@ -206,19 +213,20 @@ void HttpFileTransfer::displayPaint(QPainter * p,int column, QRect rect) { double dPerc = (double)(((double)uRecvd) * 100.0) / (double)uTotal; iW -= 2; - int iL = (int) ((((double)iW) * dPerc) / 100.0); + int iL = (int)((((double)iW) * dPerc) / 100.0); //iR = iW - iL; - p->fillRect(rect.left() + 5, rect.top() + 5,iL,10,bIsTerminated ? QColor(140,110,110) : QColor(200,100,100)); + p->fillRect(rect.left() + 5, rect.top() + 5, iL, 10, bIsTerminated ? QColor(140, 110, 110) : QColor(200, 100, 100)); - txt = QString(__tr2qs_ctx("%1 of %2 (%3 %)","http")).arg(KviQString::makeSizeReadable(uRecvd), - KviQString::makeSizeReadable(uTotal)).arg(dPerc,0,'f',2); - } else { + txt = QString(__tr2qs_ctx("%1 of %2 (%3 %)", "http")).arg(KviQString::makeSizeReadable(uRecvd), KviQString::makeSizeReadable(uTotal)).arg(dPerc, 0, 'f', 2); + } + else + { txt = KviQString::makeSizeReadable(m_pHttpRequest->receivedSize()); } p->setPen(Qt::black); - p->drawText(rect.left() + 4, rect.top() + 19,width - 8,height - 8,Qt::AlignTop | Qt::AlignLeft,txt); + p->drawText(rect.left() + 4, rect.top() + 19, width - 8, height - 8, Qt::AlignTop | Qt::AlignLeft, txt); int iLeftHalf = (iW - 2) / 2; int iRightHalf = iW - (iLeftHalf + 1); @@ -235,55 +243,64 @@ void HttpFileTransfer::displayPaint(QPainter * p,int column, QRect rect) txt += "? B/s"; } */ - txt = __tr2qs_ctx("Avg:","dcc"); + txt = __tr2qs_ctx("Avg:", "dcc"); txt += " "; if(iAvgSpeed >= 0) { QString tmpspd; - KviNetUtils::formatNetworkBandwidthString(tmpspd,iAvgSpeed); + KviNetUtils::formatNetworkBandwidthString(tmpspd, iAvgSpeed); txt += tmpspd; - } else { + } + else + { txt += "? B/s"; } - - int iDaH = height - (iLineSpacing + 4); - p->setPen(QColor(180,180,200)); - p->drawRect(rect.left() + 4, rect.top() + iDaH,iLeftHalf,iLineSpacing); - p->fillRect(rect.left() + 5, rect.top() + iDaH + 1,iLeftHalf - 2,iLineSpacing - 2,bIsTerminated ? QColor(210,210,210) : QColor(190,190,240)); + p->setPen(QColor(180, 180, 200)); + p->drawRect(rect.left() + 4, rect.top() + iDaH, iLeftHalf, iLineSpacing); + p->fillRect(rect.left() + 5, rect.top() + iDaH + 1, iLeftHalf - 2, iLineSpacing - 2, bIsTerminated ? QColor(210, 210, 210) : QColor(190, 190, 240)); p->setPen(bIsTerminated ? Qt::darkGray : Qt::black); - p->drawText(rect.left() + 6, rect.top() + iDaH,iLeftHalf - 4,iLineSpacing,Qt::AlignLeft | Qt::AlignVCenter,txt); + p->drawText(rect.left() + 6, rect.top() + iDaH, iLeftHalf - 4, iLineSpacing, Qt::AlignLeft | Qt::AlignVCenter, txt); - unsigned int uD,uH,uM,uS; + unsigned int uD, uH, uM, uS; if(bIsTerminated) { - KviTimeUtils::secondsToDaysHoursMinsSecs(kvi_timeSpan(m_tTransferEndTime,m_tTransferStartTime),&uD,&uH,&uM,&uS); + KviTimeUtils::secondsToDaysHoursMinsSecs(kvi_timeSpan(m_tTransferEndTime, m_tTransferStartTime), &uD, &uH, &uM, &uS); txt = "TOT: "; - if(uD > 0)txt += __tr2qs_ctx("%1d %2h %3m %4s","http").arg(uD).arg(uH).arg(uM).arg(uS); - else if(uH > 0)txt += __tr2qs_ctx("%1h %2m %3s","http").arg(uH).arg(uM).arg(uS); - else txt += __tr2qs_ctx("%1m %2s","http").arg(uM).arg(uS); - } else { + if(uD > 0) + txt += __tr2qs_ctx("%1d %2h %3m %4s", "http").arg(uD).arg(uH).arg(uM).arg(uS); + else if(uH > 0) + txt += __tr2qs_ctx("%1h %2m %3s", "http").arg(uH).arg(uM).arg(uS); + else + txt += __tr2qs_ctx("%1m %2s", "http").arg(uM).arg(uS); + } + else + { if(iEta >= 0) { - KviTimeUtils::secondsToDaysHoursMinsSecs(iEta,&uD,&uH,&uM,&uS); + KviTimeUtils::secondsToDaysHoursMinsSecs(iEta, &uD, &uH, &uM, &uS); txt = "ETA: "; - if(uD > 0)txt += __tr2qs_ctx("%1d %2h %3m %4s","http").arg(uD).arg(uH).arg(uM).arg(uS); - else if(uH > 0)txt += __tr2qs_ctx("%1h %2m %3s","http").arg(uH).arg(uM).arg(uS); - else txt += __tr2qs_ctx("%1m %2s","http").arg(uM).arg(uS); - } else { + if(uD > 0) + txt += __tr2qs_ctx("%1d %2h %3m %4s", "http").arg(uD).arg(uH).arg(uM).arg(uS); + else if(uH > 0) + txt += __tr2qs_ctx("%1h %2m %3s", "http").arg(uH).arg(uM).arg(uS); + else + txt += __tr2qs_ctx("%1m %2s", "http").arg(uM).arg(uS); + } + else + { txt = "ETA: Unknown"; } } - p->setPen(QColor(180,180,200)); - p->drawRect(rect.left() + width - (4 + iRightHalf), rect.top() + iDaH,iRightHalf,iLineSpacing); - p->fillRect(rect.left() + width - (3 + iRightHalf), rect.top() + iDaH + 1,iRightHalf - 2,iLineSpacing - 2,bIsTerminated ? QColor(210,210,210) : QColor(190,190,240)); + p->setPen(QColor(180, 180, 200)); + p->drawRect(rect.left() + width - (4 + iRightHalf), rect.top() + iDaH, iRightHalf, iLineSpacing); + p->fillRect(rect.left() + width - (3 + iRightHalf), rect.top() + iDaH + 1, iRightHalf - 2, iLineSpacing - 2, bIsTerminated ? QColor(210, 210, 210) : QColor(190, 190, 240)); p->setPen(bIsTerminated ? Qt::darkGray : Qt::black); - p->drawText(rect.left() + width - (2 + iRightHalf), rect.top() + iDaH,iRightHalf - 4,iLineSpacing,Qt::AlignLeft | Qt::AlignVCenter,txt); - + p->drawText(rect.left() + width - (2 + iRightHalf), rect.top() + iDaH, iRightHalf - 4, iLineSpacing, Qt::AlignLeft | Qt::AlignVCenter, txt); } break; } @@ -304,7 +321,7 @@ QString HttpFileTransfer::tipText() { s += "
Request Headers
"; - for(QStringList::ConstIterator it = m_lRequest.begin();it != m_lRequest.end();++it) + for(QStringList::ConstIterator it = m_lRequest.begin(); it != m_lRequest.end(); ++it) { s += "   "; s += *it; @@ -317,7 +334,7 @@ QString HttpFileTransfer::tipText() { s += "
Response Headers
"; - for(QStringList::ConstIterator it = m_lHeaders.begin();it != m_lHeaders.end();++it) + for(QStringList::ConstIterator it = m_lHeaders.begin(); it != m_lHeaders.end(); ++it) { s += "   "; s += *it; @@ -333,7 +350,8 @@ QString HttpFileTransfer::tipText() void HttpFileTransfer::init() { - if(g_pHttpFileTransfers)return; + if(g_pHttpFileTransfers) + return; g_pHttpFileTransfers = new KviPointerList; g_pHttpFileTransfers->setAutoDelete(false); @@ -346,7 +364,8 @@ void HttpFileTransfer::init() void HttpFileTransfer::done() { - if(!g_pHttpFileTransfers)return; + if(!g_pHttpFileTransfers) + return; while(HttpFileTransfer * t = g_pHttpFileTransfers->first()) delete t; delete g_pHttpFileTransfers; @@ -360,25 +379,27 @@ void HttpFileTransfer::done() unsigned int HttpFileTransfer::runningTransfers() { - if(!g_pHttpFileTransfers)return 0; + if(!g_pHttpFileTransfers) + return 0; return g_pHttpFileTransfers->count(); } -void HttpFileTransfer::requestSent(const QStringList &requestHeaders) +void HttpFileTransfer::requestSent(const QStringList & requestHeaders) { - m_szStatusString = __tr2qs_ctx("Request sent: waiting for reply...","http"); + m_szStatusString = __tr2qs_ctx("Request sent: waiting for reply...", "http"); displayUpdate(); KviWindow * out = transferWindow(); - if(!out)return; + if(!out) + return; if(!m_bNoOutput) - out->output(KVI_OUT_GENERICSTATUS,__tr2qs_ctx("[HTTP %d]: Request data sent:","http"),id()); + out->output(KVI_OUT_GENERICSTATUS, __tr2qs_ctx("[HTTP %d]: Request data sent:", "http"), id()); - for(QStringList::ConstIterator it = requestHeaders.begin();it != requestHeaders.end();++it) + for(QStringList::ConstIterator it = requestHeaders.begin(); it != requestHeaders.end(); ++it) { if(!m_bNoOutput) - out->output(KVI_OUT_GENERICSTATUS,"[HTTP %d]: %s",id(),(*it).toUtf8().data()); + out->output(KVI_OUT_GENERICSTATUS, "[HTTP %d]: %s", id(), (*it).toUtf8().data()); } m_lRequest = requestHeaders; @@ -386,37 +407,37 @@ void HttpFileTransfer::requestSent(const QStringList &requestHeaders) void HttpFileTransfer::connectionEstablished() { - m_szStatusString = __tr2qs_ctx("Connection established: sending request","http"); + m_szStatusString = __tr2qs_ctx("Connection established: sending request", "http"); displayUpdate(); } -void HttpFileTransfer::resolvingHost(const QString &hostname) +void HttpFileTransfer::resolvingHost(const QString & hostname) { - m_szStatusString = __tr2qs_ctx("Resolving host %1","http").arg(hostname); + m_szStatusString = __tr2qs_ctx("Resolving host %1", "http").arg(hostname); displayUpdate(); } -void HttpFileTransfer::contactingHost(const QString &ipandport) +void HttpFileTransfer::contactingHost(const QString & ipandport) { - m_szStatusString = __tr2qs_ctx("Contacting host %1","http").arg(ipandport); + m_szStatusString = __tr2qs_ctx("Contacting host %1", "http").arg(ipandport); displayUpdate(); } -void HttpFileTransfer::receivedResponse(const QString &response) +void HttpFileTransfer::receivedResponse(const QString & response) { m_lHeaders.clear(); m_lHeaders.append(response); - m_szStatusString = __tr2qs_ctx("Transferring data (%1)","http").arg(response); + m_szStatusString = __tr2qs_ctx("Transferring data (%1)", "http").arg(response); m_tTransferStartTime = kvi_unixTime(); m_eGeneralStatus = Downloading; displayUpdate(); } -void HttpFileTransfer::statusMessage(const QString &txt) +void HttpFileTransfer::statusMessage(const QString & txt) { KviWindow * out = transferWindow(); if(out && (!m_bNoOutput)) - out->output(KVI_OUT_GENERICSTATUS,"[HTTP %d]: %Q",id(),&txt); + out->output(KVI_OUT_GENERICSTATUS, "[HTTP %d]: %Q", id(), &txt); } void HttpFileTransfer::transferTerminated(bool bSuccess) @@ -433,66 +454,74 @@ void HttpFileTransfer::transferTerminated(bool bSuccess) if(m_szCompletionCallback.isNull()) { - KVS_TRIGGER_EVENT(KviEvent_OnHTTPGetTerminated,out ? out : (KviWindow *)(g_pApp->activeConsole()),&vParams) - } else { - KviKvsScript::run(m_szCompletionCallback,out ? out : (KviWindow *)(g_pApp->activeConsole()),&vParams); + KVS_TRIGGER_EVENT(KviEvent_OnHTTPGetTerminated, out ? out : (KviWindow *)(g_pApp->activeConsole()), &vParams) + } + else + { + KviKvsScript::run(m_szCompletionCallback, out ? out : (KviWindow *)(g_pApp->activeConsole()), &vParams); } if(bSuccess) { - m_szStatusString = __tr2qs_ctx("Transfer completed","http"); + m_szStatusString = __tr2qs_ctx("Transfer completed", "http"); m_eGeneralStatus = Success; displayUpdate(); - if(out && (!m_bNoOutput))out->output(KVI_OUT_GENERICSUCCESS,__tr2qs_ctx("[HTTP %d]: Transfer completed","http"),id()); + if(out && (!m_bNoOutput)) + out->output(KVI_OUT_GENERICSUCCESS, __tr2qs_ctx("[HTTP %d]: Transfer completed", "http"), id()); g_pApp->fileDownloadTerminated( - true, - m_pHttpRequest->url().url(), - m_pHttpRequest->fileName(), - QString(), - QString(), - !m_bNotifyCompletion - ); - } else { - m_szStatusString = __tr2qs_ctx("Transfer failed","http"); + true, + m_pHttpRequest->url().url(), + m_pHttpRequest->fileName(), + QString(), + QString(), + !m_bNotifyCompletion); + } + else + { + m_szStatusString = __tr2qs_ctx("Transfer failed", "http"); m_szStatusString += ": "; m_szStatusString += m_pHttpRequest->lastError(); m_eGeneralStatus = Failure; displayUpdate(); - if(out && (!m_bNoOutput))out->output(KVI_OUT_GENERICERROR,__tr2qs_ctx("[HTTP %d]: Transfer failed: %Q","http"),id(),&(m_pHttpRequest->lastError())); + if(out && (!m_bNoOutput)) + out->output(KVI_OUT_GENERICERROR, __tr2qs_ctx("[HTTP %d]: Transfer failed: %Q", "http"), id(), &(m_pHttpRequest->lastError())); g_pApp->fileDownloadTerminated( - false, - m_pHttpRequest->url().url(), - m_pHttpRequest->fileName(), - QString(), - m_pHttpRequest->lastError(), - !m_bNotifyCompletion - ); + false, + m_pHttpRequest->url().url(), + m_pHttpRequest->fileName(), + QString(), + m_pHttpRequest->lastError(), + !m_bNotifyCompletion); } if(m_bAutoClean) { - if(m_pAutoCleanTimer)delete m_pAutoCleanTimer; + if(m_pAutoCleanTimer) + delete m_pAutoCleanTimer; m_pAutoCleanTimer = new QTimer(); - connect(m_pAutoCleanTimer,SIGNAL(timeout()),this,SLOT(autoClean())); + connect(m_pAutoCleanTimer, SIGNAL(timeout()), this, SLOT(autoClean())); m_pAutoCleanTimer->start(100); - m_TimerId=m_pAutoCleanTimer->timerId(); + m_TimerId = m_pAutoCleanTimer->timerId(); } } -void HttpFileTransfer::headersReceived(KviPointerHashTable *h) +void HttpFileTransfer::headersReceived(KviPointerHashTable * h) { - if(!h)return; + if(!h) + return; KviWindow * out = transferWindow(); - if(out && (!m_bNoOutput))out->output(KVI_OUT_GENERICSTATUS,__tr2qs_ctx("[HTTP %d]: response headers:","http"),id()); - KviPointerHashTableIterator it(*h); + if(out && (!m_bNoOutput)) + out->output(KVI_OUT_GENERICSTATUS, __tr2qs_ctx("[HTTP %d]: response headers:", "http"), id()); + KviPointerHashTableIterator it(*h); while(KviCString * s = it.current()) { QString szHeader = it.currentKey(); szHeader += ": "; szHeader += s->ptr(); m_lHeaders.append(szHeader); - if(out && (!m_bNoOutput))out->output(KVI_OUT_GENERICSTATUS,"[HTTP %d]: %s: %s",id(),it.currentKey(),s->ptr()); + if(out && (!m_bNoOutput)) + out->output(KVI_OUT_GENERICSTATUS, "[HTTP %d]: %s: %s", id(), it.currentKey(), s->ptr()); ++it; } } diff --git a/src/modules/http/HttpFileTransfer.h b/src/modules/http/HttpFileTransfer.h index 2df25d587..95c94215c 100644 --- a/src/modules/http/HttpFileTransfer.h +++ b/src/modules/http/HttpFileTransfer.h @@ -37,60 +37,69 @@ class QMenu; class HttpFileTransfer : public KviFileTransfer { - enum GeneralStatus { Initializing, Connecting, Downloading, Success, Failure }; + enum GeneralStatus + { + Initializing, + Connecting, + Downloading, + Success, + Failure + }; Q_OBJECT public: HttpFileTransfer(); ~HttpFileTransfer(); + private: int m_TimerId; KviHttpRequest * m_pHttpRequest; - GeneralStatus m_eGeneralStatus; - QString m_szStatusString; + GeneralStatus m_eGeneralStatus; + QString m_szStatusString; + + QStringList m_lHeaders; + QStringList m_lRequest; - QStringList m_lHeaders; - QStringList m_lRequest; + kvi_time_t m_tStartTime; + kvi_time_t m_tTransferStartTime; + kvi_time_t m_tTransferEndTime; - kvi_time_t m_tStartTime; - kvi_time_t m_tTransferStartTime; - kvi_time_t m_tTransferEndTime; + KviKvsVariant m_vMagicIdentifier; + bool m_bNotifyCompletion; + bool m_bAutoClean; + bool m_bNoOutput; - KviKvsVariant m_vMagicIdentifier; - bool m_bNotifyCompletion; - bool m_bAutoClean; - bool m_bNoOutput; + QTimer * m_pAutoCleanTimer; + QString m_szCompletionCallback; - QTimer * m_pAutoCleanTimer; - QString m_szCompletionCallback; public: - KviHttpRequest * request(){ return m_pHttpRequest; }; + KviHttpRequest * request() { return m_pHttpRequest; }; static unsigned int runningTransfers(); static void init(); static void done(); virtual bool startDownload(); - void setCompletionCallback(const QString &szCallback){ m_szCompletionCallback = szCallback; }; - void setMagicIdentifier(const KviKvsVariant &vIdentifier){ m_vMagicIdentifier = vIdentifier; }; - void setNotifyCompletion(bool bNotify){ m_bNotifyCompletion = bNotify; }; - void setAutoClean(bool bAutoClean){ m_bAutoClean = bAutoClean; }; - void setNoOutput(bool bNoOutput){ m_bNoOutput = bNoOutput; }; + void setCompletionCallback(const QString & szCallback) { m_szCompletionCallback = szCallback; }; + void setMagicIdentifier(const KviKvsVariant & vIdentifier) { m_vMagicIdentifier = vIdentifier; }; + void setNotifyCompletion(bool bNotify) { m_bNotifyCompletion = bNotify; }; + void setAutoClean(bool bAutoClean) { m_bAutoClean = bAutoClean; }; + void setNoOutput(bool bNoOutput) { m_bNoOutput = bNoOutput; }; - virtual void displayPaint(QPainter * p,int column, QRect rect); + virtual void displayPaint(QPainter * p, int column, QRect rect); virtual int displayHeight(int iLineSpacing); virtual void fillContextPopup(QMenu * m); virtual bool active(); virtual QString tipText(); virtual QString localFileName(); protected slots: - void statusMessage(const QString &txt); + void statusMessage(const QString & txt); void transferTerminated(bool bSuccess); - void headersReceived(KviPointerHashTable *h); - void requestSent(const QStringList &sl); + void headersReceived(KviPointerHashTable * h); + void requestSent(const QStringList & sl); - void resolvingHost(const QString &hostname); - void contactingHost(const QString &ipandport); - void receivedResponse(const QString &response); + void resolvingHost(const QString & hostname); + void contactingHost(const QString & ipandport); + void receivedResponse(const QString & response); void connectionEstablished(); void abort(); void autoClean(); diff --git a/src/modules/http/libkvihttp.cpp b/src/modules/http/libkvihttp.cpp index 84dc98f50..0db294d0a 100644 --- a/src/modules/http/libkvihttp.cpp +++ b/src/modules/http/libkvihttp.cpp @@ -34,11 +34,11 @@ #include "KviCommandFormatter.h" #include "KviMainWindow.h" -static bool http_kvs_complete_get(KviKvsModuleCommandCall * c,QString &szUrl,QString &szFileName,const QString &szCallback) +static bool http_kvs_complete_get(KviKvsModuleCommandCall * c, QString & szUrl, QString & szFileName, const QString & szCallback) { if(szUrl.isEmpty()) { - c->warning(__tr2qs_ctx("No URL specified","http")); + c->warning(__tr2qs_ctx("No URL specified", "http")); return true; } @@ -48,40 +48,42 @@ static bool http_kvs_complete_get(KviKvsModuleCommandCall * c,QString &szUrl,QSt if(szFileName.isEmpty()) { - if(c->switches()->find('a',"auto-file-name")) + if(c->switches()->find('a', "auto-file-name")) { tmp = szUrl; - tmp.replace('/',"_"); - tmp.replace(':',"_"); - tmp.replace('@',"_"); - tmp.replace('?',"_"); + tmp.replace('/', "_"); + tmp.replace(':', "_"); + tmp.replace('@', "_"); + tmp.replace('?', "_"); // http____path_path2_path3_filename.ext - g_pApp->getLocalKvircDirectory(szFileName,KviApplication::Incoming,tmp); - } else { + g_pApp->getLocalKvircDirectory(szFileName, KviApplication::Incoming, tmp); + } + else + { if(!KviFileDialog::askForSaveFileName( - szFileName, - __tr2qs_ctx("Choose a filename to save","http"), - QString(), - QString(), - false, - false, - true, - g_pMainWindow - )) + szFileName, + __tr2qs_ctx("Choose a filename to save", "http"), + QString(), + QString(), + false, + false, + true, + g_pMainWindow)) + return true; + if(szFileName.isEmpty()) return true; - if(szFileName.isEmpty())return true; } } HttpFileTransfer * hft = new HttpFileTransfer(); - bool bHead = c->switches()->find('h',"head"); + bool bHead = c->switches()->find('h', "head"); - if(c->switches()->getAsStringIfExisting('p',"post-data",tmp)) + if(c->switches()->getAsStringIfExisting('p', "post-data", tmp)) { if(bHead) { - c->warning(__tr2qs_ctx("The switch -p is incompatible with -h: -p takes precedence","http")); + c->warning(__tr2qs_ctx("The switch -p is incompatible with -h: -p takes precedence", "http")); bHead = false; } hft->request()->setPostData(tmp); @@ -91,36 +93,38 @@ static bool http_kvs_complete_get(KviKvsModuleCommandCall * c,QString &szUrl,QSt hft->request()->setProcessingType(bHead ? KviHttpRequest::HeadersOnly : KviHttpRequest::StoreToFile); hft->request()->setFileName(szFileName); - if(c->switches()->getAsStringIfExisting('e',"existing-file-action",tmp)) + if(c->switches()->getAsStringIfExisting('e', "existing-file-action", tmp)) { - if(KviQString::equalCI(tmp,"e")) + if(KviQString::equalCI(tmp, "e")) hft->request()->setExistingFileAction(KviHttpRequest::RenameExisting); - else if(KviQString::equalCI(tmp,"i")) + else if(KviQString::equalCI(tmp, "i")) hft->request()->setExistingFileAction(KviHttpRequest::RenameIncoming); - else if(KviQString::equalCI(tmp,"o")) + else if(KviQString::equalCI(tmp, "o")) hft->request()->setExistingFileAction(KviHttpRequest::Overwrite); - else if(KviQString::equalCI(tmp,"r")) + else if(KviQString::equalCI(tmp, "r")) hft->request()->setExistingFileAction(KviHttpRequest::Resume); } // FIXME: this should be numeric - if(c->switches()->getAsStringIfExisting('m',"max-len",tmp)) + if(c->switches()->getAsStringIfExisting('m', "max-len", tmp)) { bool bOk; unsigned int uContentLength = tmp.toUInt(&bOk); - if(bOk)hft->request()->setMaxContentLength(uContentLength); + if(bOk) + hft->request()->setMaxContentLength(uContentLength); } // FIXME: this should be numeric - if(c->switches()->getAsStringIfExisting('o',"offset",tmp)) + if(c->switches()->getAsStringIfExisting('o', "offset", tmp)) { bool bOk; unsigned int uContentOffset = tmp.toUInt(&bOk); - if(bOk)hft->request()->setContentOffset(uContentOffset); + if(bOk) + hft->request()->setContentOffset(uContentOffset); } // FIXME: this should be numeric - if(c->switches()->getAsStringIfExisting('t',"timeout",tmp)) + if(c->switches()->getAsStringIfExisting('t', "timeout", tmp)) { bool bOk; unsigned int uConnectionTimeout = tmp.toUInt(&bOk); @@ -128,41 +132,42 @@ static bool http_kvs_complete_get(KviKvsModuleCommandCall * c,QString &szUrl,QSt hft->request()->setConnectionTimeout(uConnectionTimeout); } - if(c->switches()->getAsStringIfExisting('w',"winctrl",tmp)) + if(c->switches()->getAsStringIfExisting('w', "winctrl", tmp)) { if(!tmp.contains('h')) - hft->invokeTransferWindow(tmp.contains('m'),tmp.contains('n')); - } else { - hft->invokeTransferWindow(false,false); + hft->invokeTransferWindow(tmp.contains('m'), tmp.contains('n')); + } + else + { + hft->invokeTransferWindow(false, false); } - KviKvsVariant * v = c->switches()->find('i',"identifier"); + KviKvsVariant * v = c->switches()->find('i', "identifier"); if(v) hft->setMagicIdentifier(*v); - if(c->switches()->find('q',"quiet")) + if(c->switches()->find('q', "quiet")) hft->setNotifyCompletion(false); - if(c->switches()->find('y',"no-output")) + if(c->switches()->find('y', "no-output")) hft->setNoOutput(true); if(!szCallback.isEmpty()) hft->setCompletionCallback(szCallback); - if(c->switches()->find('c',"clear")) + if(c->switches()->find('c', "clear")) hft->setAutoClean(true); if(!hft->startDownload()) { tmp = hft->request()->lastError(); - c->warning(__tr2qs_ctx("Failed to start the get request: %Q","http"),&tmp); + c->warning(__tr2qs_ctx("Failed to start the get request: %Q", "http"), &tmp); delete hft; } return true; } - /* @doc: http.get @type: @@ -264,13 +269,13 @@ static bool http_kvs_complete_get(KviKvsModuleCommandCall * c,QString &szUrl,QSt static bool http_kvs_cmd_get(KviKvsModuleCommandCall * c) { - QString szUrl,szFileName; + QString szUrl, szFileName; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("url",KVS_PT_NONEMPTYSTRING,0,szUrl) - KVSM_PARAMETER("filename",KVS_PT_STRING,KVS_PF_OPTIONAL,szFileName) + KVSM_PARAMETER("url", KVS_PT_NONEMPTYSTRING, 0, szUrl) + KVSM_PARAMETER("filename", KVS_PT_STRING, KVS_PF_OPTIONAL, szFileName) KVSM_PARAMETERS_END(c) - return http_kvs_complete_get(c,szUrl,szFileName,QString()); + return http_kvs_complete_get(c, szUrl, szFileName, QString()); } /* @doc: http.asyncGet @@ -303,21 +308,21 @@ static bool http_kvs_cmd_get(KviKvsModuleCommandCall * c) static bool http_kvs_cmd_asyncGet(KviKvsModuleCallbackCommandCall * c) { - QString szUrl,szFileName; + QString szUrl, szFileName; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("url",KVS_PT_NONEMPTYSTRING,0,szUrl) - KVSM_PARAMETER("filename",KVS_PT_STRING,KVS_PF_OPTIONAL,szFileName) + KVSM_PARAMETER("url", KVS_PT_NONEMPTYSTRING, 0, szUrl) + KVSM_PARAMETER("filename", KVS_PT_STRING, KVS_PF_OPTIONAL, szFileName) KVSM_PARAMETERS_END(c) - return http_kvs_complete_get(c,szUrl,szFileName,c->callback()->code()); + return http_kvs_complete_get(c, szUrl, szFileName, c->callback()->code()); } static bool http_module_init(KviModule * m) { HttpFileTransfer::init(); - KVSM_REGISTER_SIMPLE_COMMAND(m,"get",http_kvs_cmd_get); - KVSM_REGISTER_CALLBACK_COMMAND(m,"asyncGet",http_kvs_cmd_asyncGet); + KVSM_REGISTER_SIMPLE_COMMAND(m, "get", http_kvs_cmd_get); + KVSM_REGISTER_CALLBACK_COMMAND(m, "asyncGet", http_kvs_cmd_asyncGet); return true; } @@ -334,13 +339,12 @@ static bool http_module_can_unload(KviModule *) } KVIRC_MODULE( - "Http", // module name - "4.0.0", // module version - "Copyright (C) 2003 Szymon Stefanek (pragma at kvirc dot net)", // author & (C) - "HTTP interface for KVIrc", - http_module_init, - http_module_can_unload, - 0, - http_module_cleanup, - "http" -) + "Http", // module name + "4.0.0", // module version + "Copyright (C) 2003 Szymon Stefanek (pragma at kvirc dot net)", // author & (C) + "HTTP interface for KVIrc", + http_module_init, + http_module_can_unload, + 0, + http_module_cleanup, + "http") diff --git a/src/modules/ident/libkviident.cpp b/src/modules/ident/libkviident.cpp index d79924bf7..8ec10f718 100644 --- a/src/modules/ident/libkviident.cpp +++ b/src/modules/ident/libkviident.cpp @@ -37,7 +37,6 @@ #define KVI_IDENT_THREAD_EVENT_EXITING KVI_THREAD_USER_EVENT_BASE + 111 #define KVI_IDENT_THREAD_EVENT_EXITING_ON_REQUEST KVI_THREAD_USER_EVENT_BASE + 112 - // FIXME: Should have a timeout on the requests!!! static KviIdentDaemon * g_pIdentDaemon = 0; @@ -47,9 +46,11 @@ extern KVIRC_API int g_iIdentDaemonRunningUsers; void startIdentService() { -// qDebug("Stargin"); - if(!g_pIdentDaemon)g_pIdentDaemon = new KviIdentDaemon(); - if(!g_pIdentDaemon->isRunning())g_pIdentDaemon->start(); + // qDebug("Stargin"); + if(!g_pIdentDaemon) + g_pIdentDaemon = new KviIdentDaemon(); + if(!g_pIdentDaemon->isRunning()) + g_pIdentDaemon->start(); while(g_pIdentDaemon->isStartingUp()) { #if defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW) @@ -58,19 +59,20 @@ void startIdentService() usleep(100); #endif } -// qDebug("Service started"); + // qDebug("Service started"); } void stopIdentService() { -// qDebug("Stopping"); - if(g_pIdentDaemon)delete g_pIdentDaemon; + // qDebug("Stopping"); + if(g_pIdentDaemon) + delete g_pIdentDaemon; g_pIdentDaemon = 0; -// qDebug("Stopped"); + // qDebug("Stopped"); } KviIdentSentinel::KviIdentSentinel() -: QObject(0) + : QObject(0) { } @@ -79,13 +81,12 @@ KviIdentSentinel::~KviIdentSentinel() KviThreadManager::killPendingEvents(this); } -bool KviIdentSentinel::event(QEvent *e) +bool KviIdentSentinel::event(QEvent * e) { - if(KVI_OPTION_UINT(KviOption_uintIdentdOutputMode)==KviIdentdOutputMode::Quiet || !g_pActiveWindow) + if(KVI_OPTION_UINT(KviOption_uintIdentdOutputMode) == KviIdentdOutputMode::Quiet || !g_pActiveWindow) return QObject::event(e); - KviWindow * pTarget = KVI_OPTION_UINT(KviOption_uintIdentdOutputMode)==KviIdentdOutputMode::ToActiveWindow ? - (KviWindow *)g_pActiveWindow : (KviWindow *)g_pApp->activeConsole(); + KviWindow * pTarget = KVI_OPTION_UINT(KviOption_uintIdentdOutputMode) == KviIdentdOutputMode::ToActiveWindow ? (KviWindow *)g_pActiveWindow : (KviWindow *)g_pApp->activeConsole(); if(e->type() == KVI_THREAD_EVENT) { @@ -99,29 +100,37 @@ bool KviIdentSentinel::event(QEvent *e) if(d->szAux.hasData()) { if(_OUTPUT_PARANOIC) - pTarget->output(KVI_OUT_IDENT,__tr("%s (%s) (%s:%u)"),d->szMessage.ptr(),d->szAux.ptr(),d->szHost.ptr(),d->uPort); + pTarget->output(KVI_OUT_IDENT, __tr("%s (%s) (%s:%u)"), d->szMessage.ptr(), d->szAux.ptr(), d->szHost.ptr(), d->uPort); else - pTarget->output(KVI_OUT_IDENT,__tr("%s (%s)"),d->szMessage.ptr(),d->szAux.ptr()); - } else { + pTarget->output(KVI_OUT_IDENT, __tr("%s (%s)"), d->szMessage.ptr(), d->szAux.ptr()); + } + else + { if(_OUTPUT_PARANOIC) - pTarget->output(KVI_OUT_IDENT,__tr("%s (%s:%u)"),d->szMessage.ptr(),d->szHost.ptr(),d->uPort); + pTarget->output(KVI_OUT_IDENT, __tr("%s (%s:%u)"), d->szMessage.ptr(), d->szHost.ptr(), d->uPort); else - pTarget->output(KVI_OUT_IDENT,__tr("%s"),d->szMessage.ptr()); + pTarget->output(KVI_OUT_IDENT, __tr("%s"), d->szMessage.ptr()); } - } else { - pTarget->output(KVI_OUT_IDENT,__tr("[IDENT]: %s"),d->szMessage.ptr()); + } + else + { + pTarget->output(KVI_OUT_IDENT, __tr("[IDENT]: %s"), d->szMessage.ptr()); } } delete d; - } else if(((KviThreadEvent *)e)->id() == KVI_IDENT_THREAD_EVENT_EXITING) + } + else if(((KviThreadEvent *)e)->id() == KVI_IDENT_THREAD_EVENT_EXITING) { if(_OUTPUT_VERBOSE) - if(pTarget)pTarget->outputNoFmt(KVI_OUT_IDENT,__tr("Shutting down Ident service (spontaneous action)")); + if(pTarget) + pTarget->outputNoFmt(KVI_OUT_IDENT, __tr("Shutting down Ident service (spontaneous action)")); stopIdentService(); - } else if(((KviThreadEvent *)e)->id() == KVI_IDENT_THREAD_EVENT_EXITING_ON_REQUEST) + } + else if(((KviThreadEvent *)e)->id() == KVI_IDENT_THREAD_EVENT_EXITING_ON_REQUEST) { if(_OUTPUT_VERBOSE) - if(pTarget)pTarget->outputNoFmt(KVI_OUT_IDENT,__tr("Shutting down Ident service (requested action)")); + if(pTarget) + pTarget->outputNoFmt(KVI_OUT_IDENT, __tr("Shutting down Ident service (requested action)")); } return true; @@ -130,8 +139,7 @@ bool KviIdentSentinel::event(QEvent *e) return QObject::event(e); } - -KviIdentRequest::KviIdentRequest(kvi_socket_t sock,const char * host,kvi_u32_t uPort) +KviIdentRequest::KviIdentRequest(kvi_socket_t sock, const char * host, kvi_u32_t uPort) { m_sock = sock; m_szHost = host; @@ -144,13 +152,13 @@ KviIdentRequest::~KviIdentRequest() kvi_socket_close(m_sock); } - KviIdentDaemon::KviIdentDaemon() -: KviSensitiveThread() + : KviSensitiveThread() { -// qDebug("Thread constructor"); + // qDebug("Thread constructor"); m_szUser = KVI_OPTION_STRING(KviOption_stringIdentdUser); - if(m_szUser.isEmpty())m_szUser = "kvirc"; + if(m_szUser.isEmpty()) + m_szUser = "kvirc"; m_uPort = KVI_OPTION_UINT(KviOption_uintIdentdPort); #ifdef COMPILE_IPV6_SUPPORT m_bEnableIPv6 = KVI_OPTION_BOOL(KviOption_boolIdentdEnableIPv6); @@ -158,42 +166,43 @@ KviIdentDaemon::KviIdentDaemon() m_bEnableIPv6 = false; #endif m_bIPv6ContainsIPv4 = KVI_OPTION_BOOL(KviOption_boolIdentdIPv6ContainsIPv4); -// qDebug("Thread constructor done"); + // qDebug("Thread constructor done"); } KviIdentDaemon::~KviIdentDaemon() { -// qDebug("Thread destructor"); + // qDebug("Thread destructor"); terminate(); g_iIdentDaemonRunningUsers = 0; g_pIdentDaemon = 0; -// qDebug("Destructor gone"); + // qDebug("Destructor gone"); } -void KviIdentDaemon::postMessage(const char * message,KviIdentRequest * r,const char * szAux) +void KviIdentDaemon::postMessage(const char * message, KviIdentRequest * r, const char * szAux) { KviThreadDataEvent * e = new KviThreadDataEvent(KVI_THREAD_EVENT_DATA); KviIdentMessageData * d = new KviIdentMessageData; d->szMessage = message; - if(szAux)d->szAux = szAux; + if(szAux) + d->szAux = szAux; if(r) { d->szHost = r->m_szHost; - d->uPort = r->m_uPort; + d->uPort = r->m_uPort; } e->setData(d); - postEvent(g_pIdentSentinel,e); + postEvent(g_pIdentSentinel, e); } void KviIdentDaemon::run() { -// qDebug("RUN STARTED"); - m_sock = KVI_INVALID_SOCKET; + // qDebug("RUN STARTED"); + m_sock = KVI_INVALID_SOCKET; m_sock6 = KVI_INVALID_SOCKET; bool bEventPosted = false; @@ -206,109 +215,106 @@ void KviIdentDaemon::run() #ifdef COMPILE_IPV6_SUPPORT // If we have enabled ipv6 and we have to use a single socket: this one is IPV6 // otherwise this one is IPV4 - KviSockaddr sa(m_uPort,m_bEnableIPv6 && m_bIPv6ContainsIPv4); + KviSockaddr sa(m_uPort, m_bEnableIPv6 && m_bIPv6ContainsIPv4); #else - KviSockaddr sa(m_uPort,false); + KviSockaddr sa(m_uPort, false); #endif KviIdentRequest * r; #ifdef COMPILE_IPV6_SUPPORT - m_sock = kvi_socket_create((m_bEnableIPv6 && m_bIPv6ContainsIPv4) ? KVI_SOCKET_PF_INET6 : KVI_SOCKET_PF_INET,KVI_SOCKET_TYPE_STREAM,KVI_SOCKET_PROTO_TCP); + m_sock = kvi_socket_create((m_bEnableIPv6 && m_bIPv6ContainsIPv4) ? KVI_SOCKET_PF_INET6 : KVI_SOCKET_PF_INET, KVI_SOCKET_TYPE_STREAM, KVI_SOCKET_PROTO_TCP); #else - m_sock = kvi_socket_create(KVI_SOCKET_PF_INET,KVI_SOCKET_TYPE_STREAM,KVI_SOCKET_PROTO_TCP); + m_sock = kvi_socket_create(KVI_SOCKET_PF_INET, KVI_SOCKET_TYPE_STREAM, KVI_SOCKET_PROTO_TCP); #endif if(m_sock == KVI_INVALID_SOCKET) { - postMessage(__tr("Can't start the Ident service : socket() failed"),0); + postMessage(__tr("Can't start the Ident service : socket() failed"), 0); goto exit_thread; } if(!kvi_socket_setNonBlocking(m_sock)) { - postMessage(__tr("Can't start the Ident service : async setting failed"),0); + postMessage(__tr("Can't start the Ident service : async setting failed"), 0); goto exit_thread; } if(!sa.socketAddress()) { - postMessage(__tr("Can't enable the Ident service : can't setup the listen address"),0); + postMessage(__tr("Can't enable the Ident service : can't setup the listen address"), 0); goto exit_thread; } - if(!kvi_socket_bind(m_sock,sa.socketAddress(),((int)(sa.addressLength())))) + if(!kvi_socket_bind(m_sock, sa.socketAddress(), ((int)(sa.addressLength())))) { - postMessage(__tr("Can't start the Ident service : bind() failed"),0); + postMessage(__tr("Can't start the Ident service : bind() failed"), 0); goto exit_thread; } - if(!kvi_socket_listen(m_sock,128)) + if(!kvi_socket_listen(m_sock, 128)) { - postMessage(__tr("Can't start the Ident service : listen() failed"),0); + postMessage(__tr("Can't start the Ident service : listen() failed"), 0); goto exit_thread; } - #ifdef COMPILE_IPV6_SUPPORT if(m_bEnableIPv6 && (!m_bIPv6ContainsIPv4)) { // Need to start the IPV6 socket too - KviSockaddr sa6(m_uPort,true); - m_sock6 = kvi_socket_create(KVI_SOCKET_PF_INET6,KVI_SOCKET_TYPE_STREAM,KVI_SOCKET_PROTO_TCP); + KviSockaddr sa6(m_uPort, true); + m_sock6 = kvi_socket_create(KVI_SOCKET_PF_INET6, KVI_SOCKET_TYPE_STREAM, KVI_SOCKET_PROTO_TCP); if(m_sock6 == KVI_INVALID_SOCKET) { - postMessage(__tr("Can't start the Ident service on IPv6 : socket() failed"),0); + postMessage(__tr("Can't start the Ident service on IPv6 : socket() failed"), 0); goto ipv6_failure; } if(!kvi_socket_setNonBlocking(m_sock6)) { - postMessage(__tr("Can't start the Ident service on IPv6 : async setting failed"),0); + postMessage(__tr("Can't start the Ident service on IPv6 : async setting failed"), 0); kvi_socket_close(m_sock6); m_sock6 = KVI_INVALID_SOCKET; goto ipv6_failure; } - #if defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW) - /* +#if defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW) + /* * under windows, ipv6 hosts behind an ipv4 NAT can use Teredo to be reachable from the outer internet using their * ipv6 address; the default protection level doesn't permit this, so we need to set this socket option * see bug ticket #393 */ - int iPlu = KVI_PROTECTION_LEVEL_UNRESTRICTED; - if(!kvi_socket_setsockopt(m_sock6,KVI_IPPROTO_IPV6,KVI_IPV6_PROTECTION_LEVEL,(const void*)&iPlu, sizeof(iPlu))) + int iPlu = KVI_PROTECTION_LEVEL_UNRESTRICTED; + if(!kvi_socket_setsockopt(m_sock6, KVI_IPPROTO_IPV6, KVI_IPV6_PROTECTION_LEVEL, (const void *)&iPlu, sizeof(iPlu))) { //this is not a fatal error - postMessage(__tr("Can't set the IPv6 Ident service protection level to unrestricted: the Ident service won't be exposed to the internet"),0); + postMessage(__tr("Can't set the IPv6 Ident service protection level to unrestricted: the Ident service won't be exposed to the internet"), 0); } - #endif +#endif if(!sa6.socketAddress()) { - postMessage(__tr("Can't enable the Ident service on IPv6 : can't setup the listen address"),0); + postMessage(__tr("Can't enable the Ident service on IPv6 : can't setup the listen address"), 0); kvi_socket_close(m_sock6); m_sock6 = KVI_INVALID_SOCKET; goto ipv6_failure; } - if(!kvi_socket_bind(m_sock6,sa6.socketAddress(),((int)(sa6.addressLength())))) + if(!kvi_socket_bind(m_sock6, sa6.socketAddress(), ((int)(sa6.addressLength())))) { - postMessage(__tr("Can't start the Ident service on IPv6 : bind() failed"),0); + postMessage(__tr("Can't start the Ident service on IPv6 : bind() failed"), 0); kvi_socket_close(m_sock6); m_sock6 = KVI_INVALID_SOCKET; goto ipv6_failure; - } - if(!kvi_socket_listen(m_sock6,128)) + if(!kvi_socket_listen(m_sock6, 128)) { - postMessage(__tr("Can't start the Ident service on IPv6 : listen() failed"),0); + postMessage(__tr("Can't start the Ident service on IPv6 : listen() failed"), 0); kvi_socket_close(m_sock6); m_sock6 = KVI_INVALID_SOCKET; goto ipv6_failure; } - } #endif @@ -317,24 +323,27 @@ ipv6_failure: #ifdef COMPILE_IPV6_SUPPORT if(m_bEnableIPv6) { - if(m_sock6 != KVI_INVALID_SOCKET) { + if(m_sock6 != KVI_INVALID_SOCKET) + { if(_OUTPUT_PARANOIC) - postMessage(__tr("Starting Ident service (IPv4/v6 on separate namespaces)"),0); - } else { + postMessage(__tr("Starting Ident service (IPv4/v6 on separate namespaces)"), 0); + } + else + { if(_OUTPUT_PARANOIC) - postMessage(__tr("Starting Ident service (IPv4/v6 in IPv6 namespace)"),0); + postMessage(__tr("Starting Ident service (IPv4/v6 in IPv6 namespace)"), 0); } - - } else { + } + else + { if(_OUTPUT_PARANOIC) - postMessage(__tr("Starting Ident service (IPv4)"),0); + postMessage(__tr("Starting Ident service (IPv4)"), 0); } -#else //!COMPILE_IPV6_SUPPORT +#else //!COMPILE_IPV6_SUPPORT if(_OUTPUT_PARANOIC) - postMessage(__tr("Service startup (IPv4)"),0); + postMessage(__tr("Service startup (IPv4)"), 0); #endif //!COMPILE_IPV6_SUPPORT - for(;;) { if(KviThreadEvent * e = dequeueEvent()) @@ -355,52 +364,55 @@ ipv6_failure: if(m_sock != KVI_INVALID_SOCKET) { - FD_SET(m_sock,&rs); - if(((unsigned int)m_sock) > ((unsigned int)nmax))nmax = m_sock; + FD_SET(m_sock, &rs); + if(((unsigned int)m_sock) > ((unsigned int)nmax)) + nmax = m_sock; } #ifdef COMPILE_IPV6_SUPPORT if(m_sock6 != KVI_INVALID_SOCKET) { - FD_SET(m_sock6,&rs); - if(((unsigned int)m_sock6) > ((unsigned int)nmax))nmax = m_sock6; + FD_SET(m_sock6, &rs); + if(((unsigned int)m_sock6) > ((unsigned int)nmax)) + nmax = m_sock6; } #endif - for(r = m_pRequestList->first();r;r = m_pRequestList->next()) + for(r = m_pRequestList->first(); r; r = m_pRequestList->next()) { - FD_SET(r->m_sock,&rs); - if(((unsigned int)r->m_sock) > ((unsigned int)nmax))nmax = r->m_sock; + FD_SET(r->m_sock, &rs); + if(((unsigned int)r->m_sock) > ((unsigned int)nmax)) + nmax = r->m_sock; } // FIXME: SO_REUSEADDR ? + int ret = kvi_socket_select(nmax + 1, &rs, 0, 0, &t); - int ret = kvi_socket_select(nmax + 1,&rs,0,0,&t); - - - if(ret == 0)msleep(100); - else { - + if(ret == 0) + msleep(100); + else + { if(m_sock != KVI_INVALID_SOCKET) { - if(FD_ISSET(m_sock,&rs)) + if(FD_ISSET(m_sock, &rs)) { #ifdef COMPILE_IPV6_SUPPORT - KviSockaddr satmp(0,m_bEnableIPv6 && m_bIPv6ContainsIPv4); + KviSockaddr satmp(0, m_bEnableIPv6 && m_bIPv6ContainsIPv4); #else - KviSockaddr satmp(0,false); + KviSockaddr satmp(0, false); #endif int salen = (int)satmp.addressLength(); - kvi_socket_t t = kvi_socket_accept(m_sock,satmp.socketAddress(),&salen); + kvi_socket_t t = kvi_socket_accept(m_sock, satmp.socketAddress(), &salen); if(t != KVI_INVALID_SOCKET) { QString szHost; - if(!satmp.getStringAddress(szHost))szHost = "unknown"; - KviIdentRequest * r = new KviIdentRequest(t,szHost.toUtf8().data(),satmp.port()); + if(!satmp.getStringAddress(szHost)) + szHost = "unknown"; + KviIdentRequest * r = new KviIdentRequest(t, szHost.toUtf8().data(), satmp.port()); m_pRequestList->append(r); - postMessage(__tr("Ident service accepting connection"),r); + postMessage(__tr("Ident service accepting connection"), r); } } } @@ -408,54 +420,59 @@ ipv6_failure: #ifdef COMPILE_IPV6_SUPPORT if(m_sock6 != KVI_INVALID_SOCKET) { - if(FD_ISSET(m_sock6,&rs)) + if(FD_ISSET(m_sock6, &rs)) { - KviSockaddr satmp(0,true); + KviSockaddr satmp(0, true); int salen = (int)satmp.addressLength(); - kvi_socket_t t = kvi_socket_accept(m_sock6,satmp.socketAddress(),&salen); + kvi_socket_t t = kvi_socket_accept(m_sock6, satmp.socketAddress(), &salen); if(t != KVI_INVALID_SOCKET) { QString szHost; - if(!satmp.getStringAddress(szHost))szHost = "unknown"; - KviIdentRequest * r = new KviIdentRequest(t,szHost.toUtf8().data(),satmp.port()); + if(!satmp.getStringAddress(szHost)) + szHost = "unknown"; + KviIdentRequest * r = new KviIdentRequest(t, szHost.toUtf8().data(), satmp.port()); m_pRequestList->append(r); - postMessage(__tr("Ident service accepting connection"),r); + postMessage(__tr("Ident service accepting connection"), r); } } } #endif - for(r = m_pRequestList->first();r;r = m_pRequestList->next()) + for(r = m_pRequestList->first(); r; r = m_pRequestList->next()) { - if(FD_ISSET(r->m_sock,&rs)) + if(FD_ISSET(r->m_sock, &rs)) { char buffer[1025]; - int readed = kvi_socket_recv(r->m_sock,buffer,1024); + int readed = kvi_socket_recv(r->m_sock, buffer, 1024); if(readed > 0) { buffer[readed] = '\0'; r->m_szData.append(buffer); - } else { + } + else + { // error ? if(readed < 0) { int err = kvi_socket_error(); if(!kvi_socket_recoverableConnectError(err)) { - postMessage(__tr("Ident service socket error : dropping connection"),r); + postMessage(__tr("Ident service socket error : dropping connection"), r); dying.append(r); } - } else { + } + else + { // connection closed - postMessage(__tr("Ident service connection closed by remote host"),r); + postMessage(__tr("Ident service connection closed by remote host"), r); dying.append(r); } } } } - for(r = m_pRequestList->first();r;r = m_pRequestList->next()) + for(r = m_pRequestList->first(); r; r = m_pRequestList->next()) { int idx = r->m_szData.findFirstIdx('\n'); @@ -469,77 +486,79 @@ ipv6_failure: if(szReq.hasData()) { - postMessage(__tr("Ident service processing request"),r,szReq.ptr()); + postMessage(__tr("Ident service processing request"), r, szReq.ptr()); - if(kvi_strEqualCI("VERSION",szReq.ptr())) + if(kvi_strEqualCI("VERSION", szReq.ptr())) { KviCString reply("Quad-Echelon 7.12-r-244"); - kvi_socket_write(r->m_sock,reply.ptr(),reply.len()); - } else { - KviCString reply(KviCString::Format,"%s : USERID : UNIX : %s\r\n",szReq.ptr(),m_szUser.ptr()); - kvi_socket_write(r->m_sock,reply.ptr(),reply.len()); + kvi_socket_write(r->m_sock, reply.ptr(), reply.len()); + } + else + { + KviCString reply(KviCString::Format, "%s : USERID : UNIX : %s\r\n", szReq.ptr(), m_szUser.ptr()); + kvi_socket_write(r->m_sock, reply.ptr(), reply.len()); } dying.append(r); + } + else + { - } else { - - postMessage(__tr("Empty request (EOT ?)"),r,szReq.ptr()); + postMessage(__tr("Empty request (EOT ?)"), r, szReq.ptr()); dying.append(r); } - - } else { + } + else + { // qDebug("Data is : (%s)",r->m_szData.ptr()); if(r->m_szData.len() > 1024) { // request too long...kill it dying.append(r); - postMessage(__tr("Dropping connection (request too long)"),r); + postMessage(__tr("Dropping connection (request too long)"), r); } } - } } time_t curTime = time(0); - for(r = m_pRequestList->first();r;r = m_pRequestList->next()) + for(r = m_pRequestList->first(); r; r = m_pRequestList->next()) { if((unsigned int)(curTime - r->m_tStart) > 30) { - postMessage(__tr("Timed out while waiting for the request : dropping connection"),r); + postMessage(__tr("Timed out while waiting for the request : dropping connection"), r); dying.append(r); } } - for(KviIdentRequest * ir = dying.first();ir;ir = dying.next()) - m_pRequestList->removeRef(ir); + for(KviIdentRequest * ir = dying.first(); ir; ir = dying.next()) + m_pRequestList->removeRef(ir); dying.clear(); - } exit_on_request: - postEvent(g_pIdentSentinel,new KviThreadEvent(KVI_IDENT_THREAD_EVENT_EXITING_ON_REQUEST)); + postEvent(g_pIdentSentinel, new KviThreadEvent(KVI_IDENT_THREAD_EVENT_EXITING_ON_REQUEST)); bEventPosted = true; exit_thread: if(!bEventPosted) - postEvent(g_pIdentSentinel,new KviThreadEvent(KVI_IDENT_THREAD_EVENT_EXITING)); - + postEvent(g_pIdentSentinel, new KviThreadEvent(KVI_IDENT_THREAD_EVENT_EXITING)); - if(m_sock != KVI_INVALID_SOCKET)kvi_socket_close(m_sock); - if(m_sock6 != KVI_INVALID_SOCKET)kvi_socket_close(m_sock6); + if(m_sock != KVI_INVALID_SOCKET) + kvi_socket_close(m_sock); + if(m_sock6 != KVI_INVALID_SOCKET) + kvi_socket_close(m_sock6); delete m_pRequestList; m_pRequestList = 0; -// qDebug("RUN EXITING"); + // qDebug("RUN EXITING"); } - /* @doc: ident.start @type: @@ -583,16 +602,18 @@ static bool ident_kvs_cmd_start(KviKvsModuleCommandCall *) static bool ident_kvs_cmd_stop(KviKvsModuleCommandCall *) { - if(g_iIdentDaemonRunningUsers) g_iIdentDaemonRunningUsers--; - if(!g_iIdentDaemonRunningUsers) stopIdentService(); + if(g_iIdentDaemonRunningUsers) + g_iIdentDaemonRunningUsers--; + if(!g_iIdentDaemonRunningUsers) + stopIdentService(); return true; } -static bool ident_module_init(KviModule *m) +static bool ident_module_init(KviModule * m) { g_pIdentSentinel = new KviIdentSentinel(); - KVSM_REGISTER_SIMPLE_COMMAND(m,"start",ident_kvs_cmd_start); - KVSM_REGISTER_SIMPLE_COMMAND(m,"stop",ident_kvs_cmd_stop); + KVSM_REGISTER_SIMPLE_COMMAND(m, "start", ident_kvs_cmd_start); + KVSM_REGISTER_SIMPLE_COMMAND(m, "stop", ident_kvs_cmd_stop); return true; } @@ -611,13 +632,12 @@ static bool ident_module_can_unload(KviModule *) } KVIRC_MODULE( - "Ident", // module name - "4.0.0", // module version - "Copyright (C) 2001 Szymon Stefanek (pragma at kvirc dot net)", // author & (C) - "Ident service", - ident_module_init, - ident_module_can_unload, - 0, - ident_module_cleanup, - 0 -) + "Ident", // module name + "4.0.0", // module version + "Copyright (C) 2001 Szymon Stefanek (pragma at kvirc dot net)", // author & (C) + "Ident service", + ident_module_init, + ident_module_can_unload, + 0, + ident_module_cleanup, + 0) diff --git a/src/modules/ident/libkviident.h b/src/modules/ident/libkviident.h index 0dab6afd4..238755aa6 100644 --- a/src/modules/ident/libkviident.h +++ b/src/modules/ident/libkviident.h @@ -36,22 +36,23 @@ class KviIdentRequest { public: - KviIdentRequest(kvi_socket_t sock,const char * host,kvi_u32_t uPort); + KviIdentRequest(kvi_socket_t sock, const char * host, kvi_u32_t uPort); ~KviIdentRequest(); + public: - kvi_socket_t m_sock; - KviCString m_szData; - KviCString m_szHost; + kvi_socket_t m_sock; + KviCString m_szData; + KviCString m_szHost; kvi_u32_t m_uPort; - time_t m_tStart; + time_t m_tStart; }; typedef struct _KviIdentMessageData { - KviCString szMessage; - KviCString szHost; - KviCString szAux; - unsigned int uPort; + KviCString szMessage; + KviCString szHost; + KviCString szAux; + unsigned int uPort; } KviIdentMessageData; class KviIdentSentinel : public QObject @@ -60,29 +61,31 @@ class KviIdentSentinel : public QObject public: KviIdentSentinel(); ~KviIdentSentinel(); + protected: virtual bool event(QEvent * e); }; - class KviIdentDaemon : public KviSensitiveThread { public: KviIdentDaemon(); ~KviIdentDaemon(); + private: - KviCString m_szUser; - kvi_u32_t m_uPort; - bool m_bEnableIPv6; - bool m_bIPv6ContainsIPv4; - kvi_socket_t m_sock; - kvi_socket_t m_sock6; - KviPointerList * m_pRequestList; + KviCString m_szUser; + kvi_u32_t m_uPort; + bool m_bEnableIPv6; + bool m_bIPv6ContainsIPv4; + kvi_socket_t m_sock; + kvi_socket_t m_sock6; + KviPointerList * m_pRequestList; + public: virtual void run(); + protected: - void postMessage(const char * message,KviIdentRequest * r,const char * szAux = 0); + void postMessage(const char * message, KviIdentRequest * r, const char * szAux = 0); }; - #endif //_LIBKVIIDENT_H_ diff --git a/src/modules/iograph/libkviiograph.cpp b/src/modules/iograph/libkviiograph.cpp index 0932cab98..7589676f9 100644 --- a/src/modules/iograph/libkviiograph.cpp +++ b/src/modules/iograph/libkviiograph.cpp @@ -37,13 +37,13 @@ #include #ifdef COMPILE_PSEUDO_TRANSPARENCY - extern KVIRC_API QPixmap * g_pShadedChildGlobalDesktopBackground; +extern KVIRC_API QPixmap * g_pShadedChildGlobalDesktopBackground; #endif -KviIOGraphWindow* g_pIOGraphWindow = 0; +KviIOGraphWindow * g_pIOGraphWindow = 0; KviIOGraphWindow::KviIOGraphWindow(const char * name) -: KviWindow(KviWindow::IOGraph, name) + : KviWindow(KviWindow::IOGraph, name) { m_pIOGraph = new KviIOGraphWidget(this); setAutoFillBackground(false); @@ -53,7 +53,7 @@ KviIOGraphWindow::~KviIOGraphWindow() { if(m_pIOGraph) delete m_pIOGraph; - m_pIOGraph=0; + m_pIOGraph = 0; g_pIOGraphWindow = 0; } @@ -65,7 +65,7 @@ QPixmap * KviIOGraphWindow::myIconPtr() void KviIOGraphWindow::resizeEvent(QResizeEvent *) { - m_pIOGraph->setGeometry(0,0,width(),height()); + m_pIOGraph->setGeometry(0, 0, width(), height()); } void KviIOGraphWindow::fillCaptionBuffers() @@ -102,25 +102,28 @@ void KviIOGraphWindow::paintEvent(QPaintEvent * e) { p.save(); p.setCompositionMode(QPainter::CompositionMode_Source); - QColor col=KVI_OPTION_COLOR(KviOption_colorGlobalTransparencyFade); + QColor col = KVI_OPTION_COLOR(KviOption_colorGlobalTransparencyFade); col.setAlphaF((float)((float)KVI_OPTION_UINT(KviOption_uintGlobalTransparencyChildFadeFactor) / (float)100)); p.fillRect(rect, col); p.restore(); - } else if(g_pShadedChildGlobalDesktopBackground) + } + else if(g_pShadedChildGlobalDesktopBackground) { QPoint pnt = isDocked() ? mapTo(g_pMainWindow, rect.topLeft()) : rect.topLeft(); - p.drawTiledPixmap(rect,*(g_pShadedChildGlobalDesktopBackground), pnt); - } else { + p.drawTiledPixmap(rect, *(g_pShadedChildGlobalDesktopBackground), pnt); + } + else + { #endif //FIXME this is not the treewindowlist - p.fillRect(rect,KVI_OPTION_COLOR(KviOption_colorTreeWindowListBackground)); + p.fillRect(rect, KVI_OPTION_COLOR(KviOption_colorTreeWindowListBackground)); #ifdef COMPILE_PSEUDO_TRANSPARENCY } #endif } KviIOGraphWidget::KviIOGraphWidget(QWidget * par) -: QWidget(par) + : QWidget(par) { m_uLastSentBytes = g_uOutgoingTraffic; m_uLastRecvBytes = g_uIncomingTraffic; @@ -129,7 +132,7 @@ KviIOGraphWidget::KviIOGraphWidget(QWidget * par) unsigned int iMax = qMax(m_uLastSentBytes, m_uLastRecvBytes); while(iMax > m_maxRate) - m_maxRate*=2; + m_maxRate *= 2; m_sendRates.prepend(0); m_recvRates.prepend(0); @@ -147,7 +150,7 @@ KviIOGraphWidget::KviIOGraphWidget(QWidget * par) void KviIOGraphWidget::timerEvent(QTimerEvent *) { - static int uLastResize=0; + static int uLastResize = 0; kvi_u64_t sB = g_uOutgoingTraffic; kvi_u64_t rB = g_uIncomingTraffic; @@ -161,30 +164,33 @@ void KviIOGraphWidget::timerEvent(QTimerEvent *) { if(m_maxRate > 1) { - m_maxRate=1; - for(int i=0;i m_maxRate) m_maxRate*=2; - for(int i=0;i m_maxRate) m_maxRate*=2; + m_maxRate = 1; + for(int i = 0; i < m_sendRates.count(); ++i) + while(m_sendRates.at(i) > m_maxRate) + m_maxRate *= 2; + for(int i = 0; i < m_recvRates.count(); ++i) + while(m_recvRates.at(i) > m_maxRate) + m_maxRate *= 2; } - } else uLastResize--; + } + else + uLastResize--; if(iMax > m_maxRate) { while(iMax > m_maxRate) - m_maxRate*=2; - uLastResize=KVI_IOGRAPH_NUMBER_POINTS; + m_maxRate *= 2; + uLastResize = KVI_IOGRAPH_NUMBER_POINTS; } m_uLastSentBytes = sB; m_uLastRecvBytes = rB; - m_sendRates.prepend(sDiff); - if(m_sendRates.count()>(KVI_IOGRAPH_NUMBER_POINTS+1)) + if(m_sendRates.count() > (KVI_IOGRAPH_NUMBER_POINTS + 1)) m_sendRates.removeLast(); m_recvRates.prepend(rDiff); - if(m_recvRates.count()>(KVI_IOGRAPH_NUMBER_POINTS+1)) + if(m_recvRates.count() > (KVI_IOGRAPH_NUMBER_POINTS + 1)) m_recvRates.removeLast(); update(); @@ -201,40 +207,39 @@ void KviIOGraphWidget::paintEvent(QPaintEvent *) float sw = (width() - 2.0) / KVI_IOGRAPH_VERT_SEGMENTS; float sh = (height() - 2.0) / KVI_IOGRAPH_HORIZ_SEGMENTS; - for(int i=0;i<=KVI_IOGRAPH_HORIZ_SEGMENTS;i++) + for(int i = 0; i <= KVI_IOGRAPH_HORIZ_SEGMENTS; i++) { p.drawLine(0, (int)c, width(), (int)c); - if(i>0) - p.drawText(2,(int)c,KviQString::makeSizeReadable(m_maxRate * (KVI_IOGRAPH_HORIZ_SEGMENTS - i) / KVI_IOGRAPH_HORIZ_SEGMENTS)); - c+=sh; + if(i > 0) + p.drawText(2, (int)c, KviQString::makeSizeReadable(m_maxRate * (KVI_IOGRAPH_HORIZ_SEGMENTS - i) / KVI_IOGRAPH_HORIZ_SEGMENTS)); + c += sh; } - c=1; - for(int i=0;i<=KVI_IOGRAPH_VERT_SEGMENTS;i++) + c = 1; + for(int i = 0; i <= KVI_IOGRAPH_VERT_SEGMENTS; i++) { p.drawLine((int)c, 0, (int)c, height()); - c+=sw; + c += sw; } QPainterPath sP, rP; - float wStep=(width() - 2.0) / KVI_IOGRAPH_NUMBER_POINTS; - + float wStep = (width() - 2.0) / KVI_IOGRAPH_NUMBER_POINTS; sP.moveTo(QPointF(width(), height())); c = 1.0; - for(int i = 0;(i <= (KVI_IOGRAPH_NUMBER_POINTS + 1)) && (i < m_sendRates.count());i++) + for(int i = 0; (i <= (KVI_IOGRAPH_NUMBER_POINTS + 1)) && (i < m_sendRates.count()); i++) { - sP.lineTo(QPointF(width()- c, height() - (height() * m_sendRates.at(i) / m_maxRate))); - c+=wStep; + sP.lineTo(QPointF(width() - c, height() - (height() * m_sendRates.at(i) / m_maxRate))); + c += wStep; } sP.lineTo(QPointF(0, height())); rP.moveTo(QPointF(width(), height())); c = 1.0; - for(int i = 0;(i <= (KVI_IOGRAPH_NUMBER_POINTS + 1)) && (i < m_recvRates.count());i++) + for(int i = 0; (i <= (KVI_IOGRAPH_NUMBER_POINTS + 1)) && (i < m_recvRates.count()); i++) { - rP.lineTo(QPointF(width()-c, height() - (height() * m_recvRates.at(i) / m_maxRate))); - c+=wStep; + rP.lineTo(QPointF(width() - c, height() - (height() * m_recvRates.at(i) / m_maxRate))); + c += wStep; } rP.lineTo(QPointF(0, height())); @@ -263,13 +268,13 @@ void KviIOGraphWidget::paintEvent(QPaintEvent *) static bool iograph_module_cmd_open(KviKvsModuleCommandCall * c) { QString dummy; - bool bCreateMinimized = c->hasSwitch('m',dummy); - bool bNoRaise = c->hasSwitch('n',dummy); + bool bCreateMinimized = c->hasSwitch('m', dummy); + bool bNoRaise = c->hasSwitch('n', dummy); if(!g_pIOGraphWindow) { g_pIOGraphWindow = new KviIOGraphWindow("IOGraph Window"); - g_pMainWindow->addWindow(g_pIOGraphWindow,!bCreateMinimized); + g_pMainWindow->addWindow(g_pIOGraphWindow, !bCreateMinimized); return true; } @@ -278,11 +283,11 @@ static bool iograph_module_cmd_open(KviKvsModuleCommandCall * c) return true; } -static bool iograph_module_init(KviModule *m) +static bool iograph_module_init(KviModule * m) { g_pIOGraphWindow = 0; - KVSM_REGISTER_SIMPLE_COMMAND(m,"open",iograph_module_cmd_open); + KVSM_REGISTER_SIMPLE_COMMAND(m, "open", iograph_module_cmd_open); return true; } @@ -300,13 +305,12 @@ static bool iograph_module_can_unload(KviModule *) } KVIRC_MODULE( - "IOGraph", // module name - "4.0.0", // module version - "Copyright (C) 2008 Szymon Stefanek (pragma at kvirc dot net)", // author & (C) - "IRC socket traffic monitor", - iograph_module_init, - iograph_module_can_unload, - 0, - iograph_module_cleanup, - 0 -) + "IOGraph", // module name + "4.0.0", // module version + "Copyright (C) 2008 Szymon Stefanek (pragma at kvirc dot net)", // author & (C) + "IRC socket traffic monitor", + iograph_module_init, + iograph_module_can_unload, + 0, + iograph_module_cleanup, + 0) diff --git a/src/modules/iograph/libkviiograph.h b/src/modules/iograph/libkviiograph.h index 22c0a3e3b..9c3a10667 100644 --- a/src/modules/iograph/libkviiograph.h +++ b/src/modules/iograph/libkviiograph.h @@ -40,17 +40,19 @@ class KviIOGraphWidget : public QWidget { Q_OBJECT public: - KviIOGraphWidget(QWidget *parent); - ~KviIOGraphWidget() {}; + KviIOGraphWidget(QWidget * parent); + ~KviIOGraphWidget(){}; + protected: QQueue m_sendRates; QQueue m_recvRates; unsigned int m_maxRate; kvi_u64_t m_uLastSentBytes; kvi_u64_t m_uLastRecvBytes; + protected: - virtual void timerEvent(QTimerEvent *e); - virtual void paintEvent (QPaintEvent *e); + virtual void timerEvent(QTimerEvent * e); + virtual void paintEvent(QPaintEvent * e); }; class KviIOGraphWindow : public KviWindow @@ -59,16 +61,18 @@ class KviIOGraphWindow : public KviWindow public: KviIOGraphWindow(const char * name); ~KviIOGraphWindow(); + private: KviIOGraphWidget * m_pIOGraph; virtual void updatePseudoTransparency(); + protected: virtual QPixmap * myIconPtr(); virtual void fillCaptionBuffers(); - virtual void resizeEvent(QResizeEvent *e); + virtual void resizeEvent(QResizeEvent * e); virtual void die(); virtual void moveEvent(QMoveEvent *); - virtual void paintEvent (QPaintEvent *e); + virtual void paintEvent(QPaintEvent * e); }; #endif diff --git a/src/modules/lamerizer/libkvilamerizer.cpp b/src/modules/lamerizer/libkvilamerizer.cpp index d5f6ffe37..b56e7f74c 100644 --- a/src/modules/lamerizer/libkvilamerizer.cpp +++ b/src/modules/lamerizer/libkvilamerizer.cpp @@ -28,8 +28,6 @@ #include "kvi_debug.h" #include "KviLocale.h" - - /* @doc: lamerizer @type: @@ -43,163 +41,159 @@ engine. Do [b]not[/b] use it! :D */ - - #ifdef COMPILE_CRYPT_SUPPORT - #include "KviMemory.h" - #include "KviPointerList.h" - #include "KviCryptEngineDescription.h" +#include "KviMemory.h" +#include "KviPointerList.h" +#include "KviCryptEngineDescription.h" - static KviPointerList * g_pEngineList = 0; - - KviLamerizerEngine::KviLamerizerEngine(bool bLight) - : KviCryptEngine() - { - m_bLight = bLight; - g_pEngineList->append(this); - } - - KviLamerizerEngine::~KviLamerizerEngine() - { - g_pEngineList->removeRef(this); - } - - bool KviLamerizerEngine::init(const char *,int,const char *,int) - { - return true; - } +static KviPointerList * g_pEngineList = 0; - static char subst_table[256] = - { - 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , // 007 - 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , // 015 - 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , // 023 - 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , // 031 - 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , // 039 : - 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , // 047 : - 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , // 055 : - 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , // 063 : - 0 , '4' , '8' , 'C' , 'D' , '3' , 'F' , 'G' , // 071 : - 'H' , '|' , 'J' , 'K' , 'L' , 'm' , 'N' , 'O' , // 079 : - 'P' , 'q' , 'R' , '5' , '7' , 'U' , 'V' , 'W' , // 087 : - 'x' , 'Y' , '2' , 0 , 0 , 0 , 0 , 0 , // 095 : - 0 , '4' , 'b' , 'c' , 'd' , '3' , 'f' , '9' , // 103 : - 'h' , '|' , 'j' , 'k' , '1' , 'm' , 'n' , '0' , - 'p' , 'q' , 'r' , '5' , '7' , 'u' , 'v' , 'w' , // 119 : - 'x' , 'y' , '2' , 0 , 0 , 0 , 0 , 0 , // 127 : - 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , // 135 : - 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , // 143 : - 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , // 151 : - 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , // 159 : - 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , // 167 : - 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , // 175 : - 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , // 183 : - 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , // 191 : - 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , // 199 : - 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , - 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , // 215 : - 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , // 223 : - 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , // 231 : - 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , // 239 : - 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , // 247 : - 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 - }; +KviLamerizerEngine::KviLamerizerEngine(bool bLight) + : KviCryptEngine() +{ + m_bLight = bLight; + g_pEngineList->append(this); +} - static char subst_table_light[256] = - { - 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , // 007 - 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , // 015 - 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , // 023 - 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , // 031 - 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , // 039 : - 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , // 047 : - 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , // 055 : - 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , // 063 : - 0 , '4' , 'B' , 'C' , 'D' , '3' , 'F' , 'G' , // 071 : - 'H' , '|' , 'J' , 'K' , 'L' , 'm' , 'N' , 'O' , // 079 : - 'P' , 'q' , 'R' , '5' , '7' , 'U' , 'V' , 'W' , // 087 : - 'x' , 'Y' , 'Z' , 0 , 0 , 0 , 0 , 0 , // 095 : - 0 , '4' , 'b' , 'c' , 'd' , '3' , 'f' , 'G' , // 103 : - 'h' , '|' , 'j' , 'k' , '1' , 'm' , 'n' , '0' , - 'p' , 'q' , 'r' , '5' , '7' , 'u' , 'v' , 'w' , // 119 : - 'x' , 'y' , 'z' , 0 , 0 , 0 , 0 , 0 , // 127 : - 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , // 135 : - 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , // 143 : - 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , // 151 : - 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , // 159 : - 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , // 167 : - 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , // 175 : - 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , // 183 : - 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , // 191 : - 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , // 199 : - 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , - 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , // 215 : - 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , // 223 : - 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , // 231 : - 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , // 239 : - 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , // 247 : - 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 - }; +KviLamerizerEngine::~KviLamerizerEngine() +{ + g_pEngineList->removeRef(this); +} +bool KviLamerizerEngine::init(const char *, int, const char *, int) +{ + return true; +} - KviCryptEngine::EncryptResult KviLamerizerEngine::encrypt(const char * plainText,KviCString &outBuffer) +static char subst_table[256] = { + 0, 0, 0, 0, 0, 0, 0, 0, // 007 + 0, 0, 0, 0, 0, 0, 0, 0, // 015 + 0, 0, 0, 0, 0, 0, 0, 0, // 023 + 0, 0, 0, 0, 0, 0, 0, 0, // 031 + 0, 0, 0, 0, 0, 0, 0, 0, // 039 : + 0, 0, 0, 0, 0, 0, 0, 0, // 047 : + 0, 0, 0, 0, 0, 0, 0, 0, // 055 : + 0, 0, 0, 0, 0, 0, 0, 0, // 063 : + 0, '4', '8', 'C', 'D', '3', 'F', 'G', // 071 : + 'H', '|', 'J', 'K', 'L', 'm', 'N', 'O', // 079 : + 'P', 'q', 'R', '5', '7', 'U', 'V', 'W', // 087 : + 'x', 'Y', '2', 0, 0, 0, 0, 0, // 095 : + 0, '4', 'b', 'c', 'd', '3', 'f', '9', // 103 : + 'h', '|', 'j', 'k', '1', 'm', 'n', '0', + 'p', 'q', 'r', '5', '7', 'u', 'v', 'w', // 119 : + 'x', 'y', '2', 0, 0, 0, 0, 0, // 127 : + 0, 0, 0, 0, 0, 0, 0, 0, // 135 : + 0, 0, 0, 0, 0, 0, 0, 0, // 143 : + 0, 0, 0, 0, 0, 0, 0, 0, // 151 : + 0, 0, 0, 0, 0, 0, 0, 0, // 159 : + 0, 0, 0, 0, 0, 0, 0, 0, // 167 : + 0, 0, 0, 0, 0, 0, 0, 0, // 175 : + 0, 0, 0, 0, 0, 0, 0, 0, // 183 : + 0, 0, 0, 0, 0, 0, 0, 0, // 191 : + 0, 0, 0, 0, 0, 0, 0, 0, // 199 : + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, // 215 : + 0, 0, 0, 0, 0, 0, 0, 0, // 223 : + 0, 0, 0, 0, 0, 0, 0, 0, // 231 : + 0, 0, 0, 0, 0, 0, 0, 0, // 239 : + 0, 0, 0, 0, 0, 0, 0, 0, // 247 : + 0, 0, 0, 0, 0, 0, 0, 0 +}; + +static char subst_table_light[256] = { + 0, 0, 0, 0, 0, 0, 0, 0, // 007 + 0, 0, 0, 0, 0, 0, 0, 0, // 015 + 0, 0, 0, 0, 0, 0, 0, 0, // 023 + 0, 0, 0, 0, 0, 0, 0, 0, // 031 + 0, 0, 0, 0, 0, 0, 0, 0, // 039 : + 0, 0, 0, 0, 0, 0, 0, 0, // 047 : + 0, 0, 0, 0, 0, 0, 0, 0, // 055 : + 0, 0, 0, 0, 0, 0, 0, 0, // 063 : + 0, '4', 'B', 'C', 'D', '3', 'F', 'G', // 071 : + 'H', '|', 'J', 'K', 'L', 'm', 'N', 'O', // 079 : + 'P', 'q', 'R', '5', '7', 'U', 'V', 'W', // 087 : + 'x', 'Y', 'Z', 0, 0, 0, 0, 0, // 095 : + 0, '4', 'b', 'c', 'd', '3', 'f', 'G', // 103 : + 'h', '|', 'j', 'k', '1', 'm', 'n', '0', + 'p', 'q', 'r', '5', '7', 'u', 'v', 'w', // 119 : + 'x', 'y', 'z', 0, 0, 0, 0, 0, // 127 : + 0, 0, 0, 0, 0, 0, 0, 0, // 135 : + 0, 0, 0, 0, 0, 0, 0, 0, // 143 : + 0, 0, 0, 0, 0, 0, 0, 0, // 151 : + 0, 0, 0, 0, 0, 0, 0, 0, // 159 : + 0, 0, 0, 0, 0, 0, 0, 0, // 167 : + 0, 0, 0, 0, 0, 0, 0, 0, // 175 : + 0, 0, 0, 0, 0, 0, 0, 0, // 183 : + 0, 0, 0, 0, 0, 0, 0, 0, // 191 : + 0, 0, 0, 0, 0, 0, 0, 0, // 199 : + 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, // 215 : + 0, 0, 0, 0, 0, 0, 0, 0, // 223 : + 0, 0, 0, 0, 0, 0, 0, 0, // 231 : + 0, 0, 0, 0, 0, 0, 0, 0, // 239 : + 0, 0, 0, 0, 0, 0, 0, 0, // 247 : + 0, 0, 0, 0, 0, 0, 0, 0 +}; + +KviCryptEngine::EncryptResult KviLamerizerEngine::encrypt(const char * plainText, KviCString & outBuffer) +{ + outBuffer = plainText; + unsigned char * aux = (unsigned char *)outBuffer.ptr(); + if(m_bLight) { - outBuffer = plainText; - unsigned char * aux = (unsigned char *)outBuffer.ptr(); - if(m_bLight) + while(*aux) { - while(*aux) - { - if(subst_table_light[*aux]) - { - *aux = subst_table_light[*aux]; - } - aux++; - } - } else { - while(*aux) + if(subst_table_light[*aux]) { - if(subst_table[*aux]) - { - *aux = subst_table[*aux]; - } - aux++; + *aux = subst_table_light[*aux]; } + aux++; } - - if(!m_bLight) + } + else + { + while(*aux) { - outBuffer.replaceAll("F","Ph"); - outBuffer.replaceAll("V","\\/"); + if(subst_table[*aux]) + { + *aux = subst_table[*aux]; + } + aux++; } - - return KviCryptEngine::Encoded; } - KviCryptEngine::DecryptResult KviLamerizerEngine::decrypt(const char * inBuffer,KviCString &plainText) + if(!m_bLight) { - plainText = inBuffer; - return KviCryptEngine::DecryptOkWasPlainText; + outBuffer.replaceAll("F", "Ph"); + outBuffer.replaceAll("V", "\\/"); } - static KviCryptEngine * allocLamerizerEngine() - { - return new KviLamerizerEngine(false); - } + return KviCryptEngine::Encoded; +} - static KviCryptEngine * allocLightLamerizerEngine() - { - return new KviLamerizerEngine(true); - } +KviCryptEngine::DecryptResult KviLamerizerEngine::decrypt(const char * inBuffer, KviCString & plainText) +{ + plainText = inBuffer; + return KviCryptEngine::DecryptOkWasPlainText; +} - static void deallocLamerizerEngine(KviCryptEngine * e) - { - delete e; - } +static KviCryptEngine * allocLamerizerEngine() +{ + return new KviLamerizerEngine(false); +} -#endif +static KviCryptEngine * allocLightLamerizerEngine() +{ + return new KviLamerizerEngine(true); +} + +static void deallocLamerizerEngine(KviCryptEngine * e) +{ + delete e; +} +#endif // ======================================= // module routines @@ -221,7 +215,6 @@ static bool lamerizer_module_init(KviModule * m) d->m_deallocFunc = deallocLamerizerEngine; m->registerCryptEngine(d); - d = new KviCryptEngineDescription; d->m_szName = "LamerizerLight"; d->m_szAuthor = "Szymon Stefanek and Jan Wagner"; @@ -237,10 +230,11 @@ static bool lamerizer_module_init(KviModule * m) #endif } -static bool lamerizer_module_cleanup(KviModule *m) +static bool lamerizer_module_cleanup(KviModule * m) { #ifdef COMPILE_CRYPT_SUPPORT - while(g_pEngineList->first())delete g_pEngineList->first(); + while(g_pEngineList->first()) + delete g_pEngineList->first(); delete g_pEngineList; g_pEngineList = 0; m->unregisterCryptEngines(); @@ -263,13 +257,12 @@ static bool lamerizer_module_can_unload(KviModule *) // plugin definition structure // ======================================= KVIRC_MODULE( - "Lamerizer crypt engine", - "4.0.0", - "Szymon Stefanek \n Jan Wagner ", - "Exports the lamerizer text transformation engine", - lamerizer_module_init, - lamerizer_module_can_unload, - 0, - lamerizer_module_cleanup, - 0 -) + "Lamerizer crypt engine", + "4.0.0", + "Szymon Stefanek \n Jan Wagner ", + "Exports the lamerizer text transformation engine", + lamerizer_module_init, + lamerizer_module_can_unload, + 0, + lamerizer_module_cleanup, + 0) diff --git a/src/modules/lamerizer/libkvilamerizer.h b/src/modules/lamerizer/libkvilamerizer.h index 9d3946e39..7ac35fd0a 100644 --- a/src/modules/lamerizer/libkvilamerizer.h +++ b/src/modules/lamerizer/libkvilamerizer.h @@ -29,21 +29,23 @@ #ifdef COMPILE_CRYPT_SUPPORT - #include "KviCryptEngine.h" - - class KviLamerizerEngine : public KviCryptEngine - { - Q_OBJECT - public: - KviLamerizerEngine(bool bLight); - ~KviLamerizerEngine(); - protected: - bool m_bLight; - public: - virtual bool init(const char *encKey,int encKeyLen,const char *decKey,int decKeyLen); - virtual KviCryptEngine::EncryptResult encrypt(const char * plainText,KviCString &outBuffer); - virtual KviCryptEngine::DecryptResult decrypt(const char * inBuffer,KviCString &plainText); - }; +#include "KviCryptEngine.h" + +class KviLamerizerEngine : public KviCryptEngine +{ + Q_OBJECT +public: + KviLamerizerEngine(bool bLight); + ~KviLamerizerEngine(); + +protected: + bool m_bLight; + +public: + virtual bool init(const char * encKey, int encKeyLen, const char * decKey, int decKeyLen); + virtual KviCryptEngine::EncryptResult encrypt(const char * plainText, KviCString & outBuffer); + virtual KviCryptEngine::DecryptResult decrypt(const char * inBuffer, KviCString & plainText); +}; #endif // COMPILE_CRYPT_SUPPORT diff --git a/src/modules/language/detector.cpp b/src/modules/language/detector.cpp index 8646369f2..2a641f0d5 100644 --- a/src/modules/language/detector.cpp +++ b/src/modules/language/detector.cpp @@ -58,7 +58,10 @@ static DetectorNGram X[] = { { 0, 0 } }; #define N static DetectorNGram #define D static DetectorDescriptor #define Z 0.000 -#define H {0,0} +#define H \ + { \ + 0, 0 \ + } #define W -0.100 #define Y -0.250 #define V -0.350 @@ -85,18792 +88,18466 @@ static DetectorNGram X[] = { { 0, 0 } }; #define x 120 #define y 121 #define z 122 -#define a 32,0 +#define a 32, 0 /////////////////////////////////////////////////////////////////////////////// // DATA TABLES /////////////////////////////////////////////////////////////////////////////// - - // // Lng: afrikaans // Enc: iso-8859-15 // - -S sig[]={e,a}; -S srg[]={n,a}; -S smi[]={i,e,0}; -S sxg[]={t,a}; -S smig[]={i,e,a}; -S sgl[]={32,h,0}; -S sgh[]={32,d,0}; -S swg[]={s,a}; -S siv[]={e,r,0}; -S sXr[]={97,n,0}; -S svg[]={r,a}; -S sXX[]={97,97,0}; -S shm[]={d,i,0}; -S sgz[]={32,v,0}; -S sgw[]={32,s,0}; -S sir[]={e,n,0}; -S s79g[]={y,a}; -S sghm[]={32,d,i,0}; -S sgq[]={32,m,0}; -S ski[]={g,e,0}; -S sgr[]={32,n,0}; -S sgi[]={32,e,0}; -S sg_[]={32,w,0}; -S six[]={e,t,0}; -S shmi[]={d,i,e,0}; -S shmig[]={d,i,e,a}; -S sixg[]={e,t,a}; -S sghmi[]={32,d,i,e,0}; -S sgs[]={32,o,0}; -S smr[]={i,n,0}; -S sxi[]={t,e,0}; -S sii[]={e,e,0}; -S srm[]={n,i,0}; -S sog[]={k,a}; -S sXrg[]={97,n,a}; -S sgX[]={32,97,0}; -S shi[]={d,e,0}; -S sgk[]={32,g,0}; -S shg[]={d,a}; -S sivg[]={e,r,a}; -S skg[]={g,a}; -S sirg[]={e,n,a}; -S srh[]={n,d,0}; -S sXv[]={97,r,0}; -S sli[]={h,e,0}; -S s_X[]={w,97,0}; -S sip[]={e,l,0}; -S sXx[]={97,t,0}; -S srmi[]={n,i,e,0}; -S sgm[]={32,i,0}; -S srmig[]={n,i,e,a}; -S sgrm[]={32,n,i,0}; -S ssi[]={o,e,0}; -S sss[]={o,o,0}; -S sgrmi[]={32,n,i,e,0}; -S sqg[]={m,a}; -S sgli[]={32,h,e,0}; -S sio[]={e,k,0}; -S sg_X[]={32,w,97,0}; -S sgY[]={32,98,0}; -S sgir[]={32,e,n,0}; -S sgki[]={32,g,e,0}; -S sgo[]={32,k,0}; -S sqi[]={m,e,0}; -S ssq[]={o,m,0}; -S sqX[]={m,97,0}; -S sgx[]={32,t,0}; -S szX[]={v,97,0}; -S spg[]={l,a}; -S sXXr[]={97,97,n,0}; -S sXxg[]={97,t,a}; -S smw[]={i,s,0}; -S ssr[]={o,n,0}; -S sgl79[]={32,h,y,0}; -S sl79[]={h,y,0}; -S sgl79g[]={32,h,y,a}; -S sl79g[]={h,y,a}; -S ssv[]={o,r,0}; -S sgirg[]={32,e,n,a}; -S siw[]={e,s,0}; -S sglix[]={32,h,e,t,0}; -S sXXv[]={97,97,r,0}; -S sXw[]={97,s,0}; -S smx[]={i,t,0}; -S slix[]={h,e,t,0}; -S slixg[]={h,e,t,a}; -S szXr[]={v,97,n,0}; -S shX[]={d,97,0}; -S ssqg[]={o,m,a}; -S ssy[]={o,u,0}; -S sxig[]={t,e,a}; -S svX[]={r,97,0}; -S spm[]={l,i,0}; -S sgqX[]={32,m,97,0}; -S sYi[]={98,e,0}; -S siog[]={e,k,a}; -S sXp[]={97,l,0}; -S sgzX[]={32,v,97,0}; -S sgw79g[]={32,s,y,a}; -S sw79[]={s,y,0}; -S sgw79[]={32,s,y,0}; -S sw79g[]={s,y,a}; -S srk[]={n,g,0}; -S svh[]={r,d,0}; -S sXwg[]={97,s,a}; -S soi[]={k,e,0}; -S sXvg[]={97,r,a}; -S sgzXr[]={32,v,97,n,0}; -S smwg[]={i,s,a}; -S s_i[]={w,e,0}; -S sXXvg[]={97,97,r,a}; -S swx[]={s,t,0}; -S smxg[]={i,t,a}; -S sgqi[]={32,m,e,0}; -S swi[]={s,e,0}; -S szXrg[]={v,97,n,a}; -S smrg[]={i,n,a}; -S sXk[]={97,g,0}; -S svs[]={r,o,0}; -S sXrh[]={97,n,d,0}; -S sls[]={h,o,0}; -S sim[]={e,i,0}; -S shiv[]={d,e,r,0}; -S sXXrg[]={97,97,n,a}; -S sgmr[]={32,i,n,0}; -S svi[]={r,e,0}; -S spi[]={l,e,0}; -S syg[]={u,a}; -S sos[]={k,o,0}; -S srhi[]={n,d,e,0}; -S sgYi[]={32,98,e,0}; -S sg27[]={32,39,0}; -S ssyg[]={o,u,a}; -S sqXX[]={m,97,97,0}; -S siq[]={e,m,0}; -S srw[]={n,s,0}; -S smo[]={i,k,0}; -S sqs[]={m,o,0}; -S sws[]={s,o,0}; -S smk[]={i,g,0}; -S sgxi[]={32,t,e,0}; -S svw[]={r,s,0}; -S sst[]={o,p,0}; -S sg27r[]={32,39,n,0}; -S sgzm[]={32,v,i,0}; -S sgmw[]={32,i,s,0}; -S sgmwg[]={32,i,s,a}; -S szs[]={v,o,0}; -S szm[]={v,i,0}; -S sgxig[]={32,t,e,a}; -S swm[]={s,i,0}; -S sgiog[]={32,e,k,a}; -S s27rg[]={39,n,a}; -S sgmrg[]={32,i,n,a}; -S szi[]={v,e,0}; -S s27r[]={39,n,0}; -S sg27rg[]={32,39,n,a}; -S sgio[]={32,e,k,0}; -S slX[]={h,97,0}; -S sgqs[]={32,m,o,0}; -S srx[]={n,t,0}; -S sghX[]={32,d,97,0}; -S s_s[]={w,o,0}; -S svx[]={r,t,0}; -S srs[]={n,o,0}; -S sgqXX[]={32,m,97,97,0}; -S sgt[]={32,p,0}; -S s_Xx[]={w,97,t,0}; -S sgzs[]={32,v,o,0}; -S sXkg[]={97,g,a}; -S siiv[]={e,e,r,0}; -S sg_Xx[]={32,w,97,t,0}; -S sgsr[]={32,o,n,0}; -S sgzi[]={32,v,e,0}; -S sgws[]={32,s,o,0}; -S swo[]={s,k,0}; -S sglX[]={32,h,97,0}; -S s_Xwg[]={w,97,s,a}; -S sipg[]={e,l,a}; -S sqsi[]={m,o,e,0}; -S s_Xw[]={w,97,s,0}; -S sXpg[]={97,l,a}; -S sjg[]={f,a}; -S sziv[]={v,e,r,0}; -S sg_Xw[]={32,w,97,s,0}; -S smrk[]={i,n,g,0}; -S sgXXr[]={32,97,97,n,0}; -S sri[]={n,e,0}; -S sgsq[]={32,o,m,0}; -S s_Xxg[]={w,97,t,a}; -S stg[]={p,a}; -S sgsqg[]={32,o,m,a}; -S sYp[]={98,l,0}; -S sgos[]={32,k,o,0}; -S sgXX[]={32,97,97,0}; -S shig[]={d,e,a}; -S sgls[]={32,h,o,0}; -S smv[]={i,r,0}; -S sstg[]={o,p,a}; -S sqix[]={m,e,t,0}; -S soX[]={k,97,0}; -S sssv[]={o,o,r,0}; -S ssvh[]={o,r,d,0}; -S sxX[]={t,97,0}; -S szmv[]={v,i,r,0}; -S sxs[]={t,o,0}; -S svhg[]={r,d,a}; -S sgXp[]={32,97,l,0}; -S sgziv[]={32,v,e,r,0}; -S sih[]={e,d,0}; -S sgrs[]={32,n,o,0}; -S szmvg[]={v,i,r,a}; -S sivw[]={e,r,s,0}; -S smvg[]={i,r,a}; -S sgqsi[]={32,m,o,e,0}; -S sqXXv[]={m,97,97,r,0}; -S szv[]={v,r,0}; -S si_[]={e,w,0}; -S sgzmv[]={32,v,i,r,0}; -S spmo[]={l,i,k,0}; -S sym[]={u,i,0}; -S sgn[]={32,j,0}; -S sqixg[]={m,e,t,a}; -S sgwi[]={32,s,e,0}; -S srhg[]={n,d,a}; -S sgzv[]={32,v,r,0}; -S sgst[]={32,o,p,0}; -S srki[]={n,g,e,0}; -S swxX[]={s,t,97,0}; -S sgqix[]={32,m,e,t,0}; -S sqXr[]={m,97,n,0}; -S svm[]={r,i,0}; -S svXX[]={r,97,97,0}; -S srhiv[]={n,d,e,r,0}; -S swmi[]={s,i,e,0}; -S sro[]={n,k,0}; -S spp[]={l,l,0}; -S sgxs[]={32,t,o,0}; -S svwg[]={r,s,a}; -S soig[]={k,e,a}; -S siwg[]={e,s,a}; -S ssvhg[]={o,r,d,a}; -S sgp[]={32,l,0}; -S siivg[]={e,e,r,a}; -S stv[]={p,r,0}; -S smkg[]={i,g,a}; -S sXg[]={97,a}; -S skiw[]={g,e,s,0}; -S sgv[]={32,r,0}; -S ssk[]={o,g,0}; -S si_i[]={e,w,e,0}; -S srX[]={n,97,0}; -S spX[]={l,97,0}; -S sik[]={e,g,0}; -S s_svh[]={w,o,r,d,0}; -S shmx[]={d,i,t,0}; -S sop[]={k,l,0}; -S sgri[]={32,n,e,0}; -S svxi[]={r,t,e,0}; -S sgwo[]={32,s,k,0}; -S ssig[]={o,e,a}; -S sskg[]={o,g,a}; -S shmr[]={d,i,n,0}; -S sgq79[]={32,m,y,0}; -S sq79g[]={m,y,a}; -S s_sv[]={w,o,r,0}; -S siy[]={e,u,0}; -S sq79[]={m,y,0}; -S siir[]={e,e,n,0}; -S skX[]={g,97,0}; -S sgtv[]={32,p,r,0}; -S slm[]={h,i,0}; -S sxXX[]={t,97,97,0}; -S sivwg[]={e,r,s,a}; -S sghmx[]={32,d,i,t,0}; -S sgq79g[]={32,m,y,a}; -S shmxg[]={d,i,t,a}; -S sglm[]={32,h,i,0}; -S sXXx[]={97,97,t,0}; -S stX[]={p,97,0}; -S sXo[]={97,k,0}; -S skig[]={g,e,a}; -S smh[]={i,d,0}; -S ssix[]={o,e,t,0}; -S srhX[]={n,d,97,0}; -S sgwx[]={32,s,t,0}; -S srkg[]={n,g,a}; -S syv[]={u,r,0}; -S sgkiw[]={32,g,e,s,0}; -S sYv[]={98,r,0}; -S sgss[]={32,o,o,0}; -S sghXx[]={32,d,97,t,0}; -S spmr[]={l,i,n,0}; -S sirh[]={e,n,d,0}; -S s_ii[]={w,e,e,0}; -S sivh[]={e,r,d,0}; -S shXxg[]={d,97,t,a}; -S sxii[]={t,e,e,0}; -S skiv[]={g,e,r,0}; -S skXXr[]={g,97,97,n,0}; -S sXq[]={97,m,0}; -S sgYp[]={32,98,l,0}; -S sxsi[]={t,o,e,0}; -S smiv[]={i,e,r,0}; -S shs[]={d,o,0}; -S shivg[]={d,e,r,a}; -S sYX[]={98,97,0}; -S sxsig[]={t,o,e,a}; -S spig[]={l,e,a}; -S ssixg[]={o,e,t,a}; -S shXx[]={d,97,t,0}; -S srwg[]={n,s,a}; -S sg_s[]={32,w,o,0}; -S symx[]={u,i,t,0}; -S smog[]={i,k,a}; -S smrh[]={i,n,d,0}; -S swxXX[]={s,t,97,97,0}; -S skXX[]={g,97,97,0}; -S swxi[]={s,t,e,0}; -S sgstg[]={32,o,p,a}; -S siyv[]={e,u,r,0}; -S srsk[]={n,o,g,0}; -S sirw[]={e,n,s,0}; -S sg_m[]={32,w,i,0}; -S sn79g[]={j,y,a}; -S s_m[]={w,i,0}; -S sXrhg[]={97,n,d,a}; -S sv79[]={r,y,0}; -S srmk[]={n,i,g,0}; -S sioi[]={e,k,e,0}; -S sgn79[]={32,j,y,0}; -S ssw[]={o,s,0}; -S sipm[]={e,l,i,0}; -S sps[]={l,o,0}; -S sirx[]={e,n,t,0}; -S s79h[]={y,d,0}; -S sgqXr[]={32,m,97,n,0}; -S smki[]={i,g,e,0}; -S sgn79g[]={32,j,y,a}; -S sirm[]={e,n,i,0}; -S slmiv[]={h,i,e,r,0}; -S sgXw[]={32,97,s,0}; -S ssrw[]={o,n,s,0}; -S slmi[]={h,i,e,0}; -S sXh[]={97,d,0}; -S srog[]={n,k,a}; -S sghi[]={32,d,e,0}; -S sppi[]={l,l,e,0}; -S smp[]={i,l,0}; -S sn79[]={j,y,0}; -S sqiv[]={m,e,r,0}; -S sov[]={k,r,0}; -S simh[]={e,i,d,0}; -S sg_sv[]={32,w,o,r,0}; -S siip[]={e,e,l,0}; -S sg_i[]={32,w,e,0}; -S shivw[]={d,e,r,s,0}; -S sgrsk[]={32,n,o,g,0}; -S ski_[]={g,e,w,0}; -S sgymx[]={32,u,i,t,0}; -S spmog[]={l,i,k,a}; -S srskg[]={n,o,g,a}; -S siqg[]={e,m,a}; -S sosq[]={k,o,m,0}; -S sXXo[]={97,97,k,0}; -S sxm[]={t,i,0}; -S sgop[]={32,k,l,0}; -S sivx[]={e,r,t,0}; -S sgym[]={32,u,i,0}; -S sgy[]={32,u,0}; -S sglmi[]={32,h,i,e,0}; -S sXj[]={97,f,0}; -S sglXX[]={32,h,97,97,0}; -S ssx[]={o,t,0}; -S ship[]={d,e,l,0}; -S shmw[]={d,i,s,0}; -S sqir[]={m,e,n,0}; -S ssrg[]={o,n,a}; -S sswg[]={o,s,a}; -S siiq[]={e,e,m,0}; -S sopm[]={k,l,i,0}; -S siY[]={e,98,0}; -S shXrg[]={d,97,n,a}; -S shv[]={d,r,0}; -S slXr[]={h,97,n,0}; -S sxiq[]={t,e,m,0}; -S sqsix[]={m,o,e,t,0}; -S sXXxg[]={97,97,t,a}; -S sgosr[]={32,k,o,n,0}; -S srmki[]={n,i,g,e,0}; -S skiY[]={g,e,98,0}; -S sppig[]={l,l,e,a}; -S syp[]={u,l,0}; -S smkig[]={i,g,e,a}; -S sYiw[]={98,e,s,0}; -S svp[]={r,l,0}; -S sXvx[]={97,r,t,0}; -S sXrhX[]={97,n,d,97,0}; -S slsyg[]={h,o,u,a}; -S ssrwg[]={o,n,s,a}; - -N l0n0[]={{siy,.108},H}; -N l0n1[]={{sl79g,.756},{stX,.108},H}; -N l0n2[]={{srmig,1.371},H}; -N l0n3[]={{ssv,.336},{sosq,.121},H}; -N l0n4[]={{sgss,.212},H}; -N l0n5[]={{smr,.645},{sxm,.081},H}; -N l0n6[]={{srx,.188},{sgYp,.212},{spmog,.242},{shmw,.101},H}; -N l0n7[]={{sghm,1.936},{s27r,.188},{sri,.161},H}; -N l0n8[]={{swo,.161},H}; -N l0n9[]={{slX,.188},H}; -N l0n10[]={{sYp,.161},{soig,.272},{sgosr,.202},H}; -N l0n11[]={{sghXx,.282},H}; -N l0n12[]={{sgp,.181},{sirm,.121},H}; -N l0n13[]={{swg,1.714},{sXr,1.116},{spm,.296},{sgzi,.393},H}; -N l0n14[]={{sgki,.907},{ssqg,.696},H}; -N l0n15[]={{sgst,.302},H}; -N l0n16[]={{shivw,.161},{ssrwg,.202},H}; -N l0n17[]={{sgqsi,.444},{shmx,.161},H}; -N l0n18[]={{sik,.108},H}; -N l0n20[]={{skiv,.141},{ssw,.081},H}; -N l0n21[]={{shm,1.008},{sog,.928},{skXX,.141},H}; -N l0n22[]={{sXXv,.484},{sgw79g,.807},{sglXX,.202},H}; -N l0n23[]={{shivg,.282},H}; -N l0n24[]={{sxii,.141},H}; -N l0n25[]={{sivh,.141},H}; -N l0n28[]={{sgwo,.242},H}; -N l0n29[]={{sgq,1.291},{sgn79,.181},H}; -N l0n30[]={{s_i,.255},{sivwg,.323},{srsk,.121},{sg_i,.181},H}; -N l0n31[]={{sgli,.998},{skiw,.181},{ssrg,.151},H}; -N l0n32[]={{symx,.141},H}; -N l0n33[]={{sxig,.665},{sop,.108},{srhX,.141},H}; -N l0n34[]={{si_,.148},{stv,.121},{ssix,.141},{sxsig,.282},H}; -N l0n36[]={{sym,.134},H}; -N l0n37[]={{sqXXv,.296},{ssx,.067},H}; -N l0n38[]={{ssi,.457},H}; -N l0n40[]={{sgrsk,.242},{sgym,.181},H}; -N l0n41[]={{srk,.269},{szmv,.222},{spig,.212},H}; -N l0n42[]={{sgmwg,.565},H}; -N l0n43[]={{sgzXr,.766},{s_Xwg,.484},H}; -N l0n44[]={{sxg,2.138},{sXXx,.161},H}; -N l0n45[]={{sivg,1.149},{svs,.229},H}; -N l0n46[]={{ski,.807},{sgr,1.170},{sgio,.423},H}; -N l0n48[]={{sXX,1.008},H}; -N l0n49[]={{sg27r,.423},{shig,.333},H}; -N l0n50[]={{smog,.212},H}; -N l0n52[]={{spg,.565},{sim,.229},H}; -N l0n54[]={{sghmi,1.976},{ssy,.296},{s_Xxg,.484},{siivg,.363},{sgtv,.242},H}; -N l0n57[]={{sgzm,.423},H}; -N l0n60[]={{shg,.786},{sq79,.108},H}; -N l0n61[]={{swmi,.202},H}; -N l0n62[]={{siwg,.272},{slmiv,.161},H}; -N l0n63[]={{sgs,.988},{svX,.296},{sn79g,.181},H}; -N l0n64[]={{spp,.121},H}; -N l0n65[]={{sstg,.333},H}; -N l0n66[]={{sgXw,.181},H}; -N l0n67[]={{szm,.188},H}; -N l0n68[]={{sqixg,.403},H}; -N l0n69[]={{sqsix,.134},{smkig,.202},H}; -N l0n72[]={{sgqX,.665},{sgws,.363},{ssk,.121},H}; -N l0n73[]={{slix,.484},{smv,.148},H}; -N l0n74[]={{sXXrg,.686},{sg_m,.181},H}; -N l0n75[]={{srm,.632},{syg,.323},{sgxig,.565},{sXpg,.363},{sg_Xw,.484},{sglm,.242},{s79h,.081},{ski_,.121},H}; -N l0n76[]={{sws,.202},H}; -N l0n77[]={{sli,.471},{srhi,.323},{sXvx,.101},H}; -N l0n78[]={{sg_Xx,.524},{sgsqg,.484},H}; -N l0n79[]={{sixg,1.512},{sgir,.938},{ssvh,.222},{sYX,.094},H}; -N l0n80[]={{sgt,.262},{sgq79,.242},H}; -N l0n81[]={{sgX,.847},{sXv,.484},{smrh,.141},H}; -N l0n82[]={{smiv,.141},H}; -N l0n83[]={{sqg,.665},H}; -N l0n84[]={{sos,.215},H}; -N l0n85[]={{srwg,.212},H}; -N l0n86[]={{sio,.444},{sw79g,.605},{srhg,.302},H}; -N l0n87[]={{syp,.067},H}; -N l0n89[]={{sXrh,.343},{sgxs,.272},H}; -N l0n90[]={{smw,.363},H}; -N l0n91[]={{sig,3.650},{sgl79g,1.008},{smh,.094},H}; -N l0n94[]={{sqXr,.202},{slsyg,.202},H}; -N l0n95[]={{skXXr,.188},H}; -N l0n98[]={{sgY,.645},{sXw,.323},{s_m,.081},H}; -N l0n99[]={{sgziv,.444},{sghmx,.323},{sXh,.081},H}; -N l0n100[]={{skiY,.101},H}; -N l0n101[]={{smrg,.544},H}; -N l0n102[]={{soX,.148},H}; -N l0n103[]={{sip,.471},{s27rg,.423},{sgkiw,.282},H}; -N l0n106[]={{svXX,.202},H}; -N l0n107[]={{smx,.323},{sgqXX,.524},{sxs,.148},H}; -N l0n108[]={{smi,1.654},{shmi,1.049},H}; -N l0n109[]={{sXrg,1.391},{sro,.121},H}; -N l0n111[]={{sgstg,.282},H}; -N l0n112[]={{sYv,.094},{sxiq,.101},H}; -N l0n113[]={{svw,.202},{shmxg,.323},H}; -N l0n114[]={{srg,2.501},{svh,.269},{smrk,.242},{sgv,.181},H}; -N l0n115[]={{sXx,.471},{sps,.081},H}; -N l0n116[]={{sgqi,.544},{sswg,.151},H}; -N l0n117[]={{szXr,.464},{s_ii,.141},{ship,.101},H}; -N l0n118[]={{sXXvg,.766},H}; -N l0n119[]={{sg27,.323},H}; -N l0n120[]={{siq,.202},H}; -N l0n121[]={{si_i,.161},H}; -N l0n122[]={{sjg,.242},{sirw,.121},{sglmi,.242},H}; -N l0n123[]={{sglix,.968},{sgzs,.393},{shs,.094},H}; -N l0n124[]={{sgXX,.363},{sXrhX,.134},H}; -N l0n125[]={{sxX,.148},{sgn79g,.242},H}; -N l0n126[]={{srskg,.242},H}; -N l0n127[]={{sgwx,.212},H}; -N l0n128[]={{srki,.202},{simh,.121},H}; -N l0n130[]={{svx,.175},{ssixg,.282},H}; -N l0n131[]={{sgw,1.412},{svi,.229},H}; -N l0n132[]={{sgh,1.795},{sgymx,.242},{sYiw,.101},H}; -N l0n133[]={{spX,.108},{sgri,.242},{sirx,.121},{sXj,.067},H}; -N l0n134[]={{ssig,.242},H}; -N l0n135[]={{sov,.081},H}; -N l0n137[]={{sir,.914},{szmvg,.444},{srkg,.212},{shXx,.141},H}; -N l0n140[]={{sg_s,.212},{sXXxg,.202},H}; -N l0n141[]={{shX,.309},{sgls,.333},H}; -N l0n142[]={{smk,.202},{sgiog,.565},{skig,.242},H}; -N l0n143[]={{sgzmv,.444},H}; -N l0n145[]={{sg27rg,.565},{slm,.108},H}; -N l0n146[]={{sqs,.202},{sgqXr,.242},H}; -N l0n147[]={{sYi,.282},{sgmr,.514},H}; -N l0n148[]={{sgx,.585},{siip,.121},H}; -N l0n149[]={{sgi,1.089},H}; -N l0n150[]={{sXk,.242},{ssyg,.484},H}; -N l0n151[]={{sppi,.121},H}; -N l0n153[]={{skg,.766},H}; -N l0n156[]={{sgzv,.302},{sq79g,.242},H}; -N l0n159[]={{sgop,.181},{siiq,.101},H}; -N l0n161[]={{sl79,.350},{swx,.255},H}; -N l0n162[]={{srmi,.706},{swi,.242},{sqir,.101},H}; -N l0n163[]={{srhiv,.269},H}; -N l0n164[]={{sqX,.390},{sopm,.101},H}; -N l0n165[]={{sgy,.121},H}; -N l0n166[]={{spmo,.202},H}; -N l0n167[]={{shXrg,.202},H}; -N l0n168[]={{sskg,.242},{sxXX,.161},H}; -N l0n169[]={{slixg,.968},{szs,.188},{smvg,.333},H}; -N l0n170[]={{soi,.255},{siir,.161},H}; -N l0n173[]={{sioi,.121},H}; -N l0n174[]={{ssq,.390},{s_sv,.161},{shv,.067},H}; -N l0n175[]={{sgirg,1.008},{sghX,.423},{ssvhg,.363},H}; -N l0n176[]={{stg,.242},{sgq79g,.323},{ssrw,.121},H}; -N l0n177[]={{sgrm,1.028},{sXvg,.575},{srs,.175},H}; -N l0n182[]={{sgz,1.452},{siog,.635},{sgw79,.605},{sssv,.222},H}; -N l0n183[]={{sgk,.827},{shiv,.343},H}; -N l0n184[]={{srmk,.121},H}; -N l0n185[]={{sgYi,.484},{sXrhg,.242},H}; -N l0n186[]={{smwg,.575},H}; -N l0n187[]={{szX,.376},H}; -N l0n189[]={{syv,.094},{siY,.067},H}; -N l0n190[]={{sivw,.222},H}; -N l0n191[]={{ssr,.350},H}; -N l0n192[]={{sgos,.363},H}; -N l0n193[]={{sxi,.645},H}; -N l0n194[]={{sXwg,.605},{sxsi,.141},H}; -N l0n195[]={{srX,.108},{slXr,.101},H}; -N l0n198[]={{sgXXr,.484},H}; -N l0n199[]={{s79g,1.291},{sg_,1.089},{sipg,.363},{svm,.134},{spmr,.141},H}; -N l0n200[]={{sgl,1.896},{s_s,.175},H}; -N l0n201[]={{spi,.229},{sXXo,.121},{sivx,.121},H}; -N l0n202[]={{sgmw,.423},H}; -N l0n203[]={{smxg,.544},{s_Xw,.242},H}; -N l0n204[]={{smig,2.964},{shmig,2.017},{swxX,.202},H}; -N l0n205[]={{siv,1.143},{srog,.181},H}; -N l0n206[]={{sqiv,.121},H}; -N l0n207[]={{sqXX,.302},{shmr,.161},H}; -N l0n208[]={{sss,.457},{sgqix,.403},H}; -N l0n209[]={{shi,.565},{svwg,.272},H}; -N l0n210[]={{smo,.202},{svhg,.333},H}; -N l0n211[]={{sXxg,.817},H}; -N l0n213[]={{szXrg,.726},{sirh,.141},H}; -N l0n214[]={{s_Xx,.262},{siiv,.262},H}; -N l0n215[]={{sv79,.081},H}; -N l0n216[]={{siqg,.181},H}; -N l0n217[]={{sgm,.706},{svxi,.161},H}; -N l0n218[]={{s_X,.471},{sgwi,.302},{s_svh,.215},{sXo,.108},H}; -N l0n219[]={{sghi,.181},H}; -N l0n220[]={{szv,.148},H}; -N l0n222[]={{siw,.323},H}; -N l0n223[]={{sih,.148},{sXg,.181},{sn79,.081},H}; -N l0n224[]={{sgrmi,1.331},H}; -N l0n225[]={{sgzX,.635},{sst,.202},H}; -N l0n226[]={{sgqs,.423},{sg_sv,.242},H}; -N l0n227[]={{smp,.081},H}; -N l0n228[]={{sqix,.222},H}; -N l0n229[]={{sziv,.242},{smki,.121},H}; -N l0n230[]={{swm,.188},{siyv,.121},H}; -N l0n231[]={{srmki,.134},H}; -N l0n232[]={{sqi,.390},{slmi,.121},H}; -N l0n233[]={{sirg,1.119},{sqsi,.242},{shXxg,.282},H}; -N l0n234[]={{sXXr,.565},{sgn,.202},{skX,.108},{sipm,.121},H}; -N l0n235[]={{sXp,.282},{sgxi,.454},H}; -N l0n238[]={{svg,1.533},{sgsq,.363},{smkg,.272},H}; -N l0n239[]={{six,.726},{swxXX,.188},H}; -N l0n240[]={{sii,.632},H}; -N l0n242[]={{sg_X,.998},H}; -N l0n243[]={{sgmrg,.565},{sglX,.363},{sgrs,.333},H}; -N l0n245[]={{srw,.202},{sgXp,.333},H}; -N l0n246[]={{srh,.484},{sw79,.269},{sXkg,.393},H}; -N l0n247[]={{sls,.229},{sppig,.202},H}; -N l0n248[]={{swxi,.141},H}; -N l0n249[]={{sgsr,.393},H}; -N l0n250[]={{svp,.067},H}; -N l0n251[]={{sgo,.605},{sgl79,.786},H}; -N l0n252[]={{sXq,.094},H}; -N l0n255[]={{szi,.188},H}; - -D l0_d = -{ +S sig[] = { e, a }; +S srg[] = { n, a }; +S smi[] = { i, e, 0 }; +S sxg[] = { t, a }; +S smig[] = { i, e, a }; +S sgl[] = { 32, h, 0 }; +S sgh[] = { 32, d, 0 }; +S swg[] = { s, a }; +S siv[] = { e, r, 0 }; +S sXr[] = { 97, n, 0 }; +S svg[] = { r, a }; +S sXX[] = { 97, 97, 0 }; +S shm[] = { d, i, 0 }; +S sgz[] = { 32, v, 0 }; +S sgw[] = { 32, s, 0 }; +S sir[] = { e, n, 0 }; +S s79g[] = { y, a }; +S sghm[] = { 32, d, i, 0 }; +S sgq[] = { 32, m, 0 }; +S ski[] = { g, e, 0 }; +S sgr[] = { 32, n, 0 }; +S sgi[] = { 32, e, 0 }; +S sg_[] = { 32, w, 0 }; +S six[] = { e, t, 0 }; +S shmi[] = { d, i, e, 0 }; +S shmig[] = { d, i, e, a }; +S sixg[] = { e, t, a }; +S sghmi[] = { 32, d, i, e, 0 }; +S sgs[] = { 32, o, 0 }; +S smr[] = { i, n, 0 }; +S sxi[] = { t, e, 0 }; +S sii[] = { e, e, 0 }; +S srm[] = { n, i, 0 }; +S sog[] = { k, a }; +S sXrg[] = { 97, n, a }; +S sgX[] = { 32, 97, 0 }; +S shi[] = { d, e, 0 }; +S sgk[] = { 32, g, 0 }; +S shg[] = { d, a }; +S sivg[] = { e, r, a }; +S skg[] = { g, a }; +S sirg[] = { e, n, a }; +S srh[] = { n, d, 0 }; +S sXv[] = { 97, r, 0 }; +S sli[] = { h, e, 0 }; +S s_X[] = { w, 97, 0 }; +S sip[] = { e, l, 0 }; +S sXx[] = { 97, t, 0 }; +S srmi[] = { n, i, e, 0 }; +S sgm[] = { 32, i, 0 }; +S srmig[] = { n, i, e, a }; +S sgrm[] = { 32, n, i, 0 }; +S ssi[] = { o, e, 0 }; +S sss[] = { o, o, 0 }; +S sgrmi[] = { 32, n, i, e, 0 }; +S sqg[] = { m, a }; +S sgli[] = { 32, h, e, 0 }; +S sio[] = { e, k, 0 }; +S sg_X[] = { 32, w, 97, 0 }; +S sgY[] = { 32, 98, 0 }; +S sgir[] = { 32, e, n, 0 }; +S sgki[] = { 32, g, e, 0 }; +S sgo[] = { 32, k, 0 }; +S sqi[] = { m, e, 0 }; +S ssq[] = { o, m, 0 }; +S sqX[] = { m, 97, 0 }; +S sgx[] = { 32, t, 0 }; +S szX[] = { v, 97, 0 }; +S spg[] = { l, a }; +S sXXr[] = { 97, 97, n, 0 }; +S sXxg[] = { 97, t, a }; +S smw[] = { i, s, 0 }; +S ssr[] = { o, n, 0 }; +S sgl79[] = { 32, h, y, 0 }; +S sl79[] = { h, y, 0 }; +S sgl79g[] = { 32, h, y, a }; +S sl79g[] = { h, y, a }; +S ssv[] = { o, r, 0 }; +S sgirg[] = { 32, e, n, a }; +S siw[] = { e, s, 0 }; +S sglix[] = { 32, h, e, t, 0 }; +S sXXv[] = { 97, 97, r, 0 }; +S sXw[] = { 97, s, 0 }; +S smx[] = { i, t, 0 }; +S slix[] = { h, e, t, 0 }; +S slixg[] = { h, e, t, a }; +S szXr[] = { v, 97, n, 0 }; +S shX[] = { d, 97, 0 }; +S ssqg[] = { o, m, a }; +S ssy[] = { o, u, 0 }; +S sxig[] = { t, e, a }; +S svX[] = { r, 97, 0 }; +S spm[] = { l, i, 0 }; +S sgqX[] = { 32, m, 97, 0 }; +S sYi[] = { 98, e, 0 }; +S siog[] = { e, k, a }; +S sXp[] = { 97, l, 0 }; +S sgzX[] = { 32, v, 97, 0 }; +S sgw79g[] = { 32, s, y, a }; +S sw79[] = { s, y, 0 }; +S sgw79[] = { 32, s, y, 0 }; +S sw79g[] = { s, y, a }; +S srk[] = { n, g, 0 }; +S svh[] = { r, d, 0 }; +S sXwg[] = { 97, s, a }; +S soi[] = { k, e, 0 }; +S sXvg[] = { 97, r, a }; +S sgzXr[] = { 32, v, 97, n, 0 }; +S smwg[] = { i, s, a }; +S s_i[] = { w, e, 0 }; +S sXXvg[] = { 97, 97, r, a }; +S swx[] = { s, t, 0 }; +S smxg[] = { i, t, a }; +S sgqi[] = { 32, m, e, 0 }; +S swi[] = { s, e, 0 }; +S szXrg[] = { v, 97, n, a }; +S smrg[] = { i, n, a }; +S sXk[] = { 97, g, 0 }; +S svs[] = { r, o, 0 }; +S sXrh[] = { 97, n, d, 0 }; +S sls[] = { h, o, 0 }; +S sim[] = { e, i, 0 }; +S shiv[] = { d, e, r, 0 }; +S sXXrg[] = { 97, 97, n, a }; +S sgmr[] = { 32, i, n, 0 }; +S svi[] = { r, e, 0 }; +S spi[] = { l, e, 0 }; +S syg[] = { u, a }; +S sos[] = { k, o, 0 }; +S srhi[] = { n, d, e, 0 }; +S sgYi[] = { 32, 98, e, 0 }; +S sg27[] = { 32, 39, 0 }; +S ssyg[] = { o, u, a }; +S sqXX[] = { m, 97, 97, 0 }; +S siq[] = { e, m, 0 }; +S srw[] = { n, s, 0 }; +S smo[] = { i, k, 0 }; +S sqs[] = { m, o, 0 }; +S sws[] = { s, o, 0 }; +S smk[] = { i, g, 0 }; +S sgxi[] = { 32, t, e, 0 }; +S svw[] = { r, s, 0 }; +S sst[] = { o, p, 0 }; +S sg27r[] = { 32, 39, n, 0 }; +S sgzm[] = { 32, v, i, 0 }; +S sgmw[] = { 32, i, s, 0 }; +S sgmwg[] = { 32, i, s, a }; +S szs[] = { v, o, 0 }; +S szm[] = { v, i, 0 }; +S sgxig[] = { 32, t, e, a }; +S swm[] = { s, i, 0 }; +S sgiog[] = { 32, e, k, a }; +S s27rg[] = { 39, n, a }; +S sgmrg[] = { 32, i, n, a }; +S szi[] = { v, e, 0 }; +S s27r[] = { 39, n, 0 }; +S sg27rg[] = { 32, 39, n, a }; +S sgio[] = { 32, e, k, 0 }; +S slX[] = { h, 97, 0 }; +S sgqs[] = { 32, m, o, 0 }; +S srx[] = { n, t, 0 }; +S sghX[] = { 32, d, 97, 0 }; +S s_s[] = { w, o, 0 }; +S svx[] = { r, t, 0 }; +S srs[] = { n, o, 0 }; +S sgqXX[] = { 32, m, 97, 97, 0 }; +S sgt[] = { 32, p, 0 }; +S s_Xx[] = { w, 97, t, 0 }; +S sgzs[] = { 32, v, o, 0 }; +S sXkg[] = { 97, g, a }; +S siiv[] = { e, e, r, 0 }; +S sg_Xx[] = { 32, w, 97, t, 0 }; +S sgsr[] = { 32, o, n, 0 }; +S sgzi[] = { 32, v, e, 0 }; +S sgws[] = { 32, s, o, 0 }; +S swo[] = { s, k, 0 }; +S sglX[] = { 32, h, 97, 0 }; +S s_Xwg[] = { w, 97, s, a }; +S sipg[] = { e, l, a }; +S sqsi[] = { m, o, e, 0 }; +S s_Xw[] = { w, 97, s, 0 }; +S sXpg[] = { 97, l, a }; +S sjg[] = { f, a }; +S sziv[] = { v, e, r, 0 }; +S sg_Xw[] = { 32, w, 97, s, 0 }; +S smrk[] = { i, n, g, 0 }; +S sgXXr[] = { 32, 97, 97, n, 0 }; +S sri[] = { n, e, 0 }; +S sgsq[] = { 32, o, m, 0 }; +S s_Xxg[] = { w, 97, t, a }; +S stg[] = { p, a }; +S sgsqg[] = { 32, o, m, a }; +S sYp[] = { 98, l, 0 }; +S sgos[] = { 32, k, o, 0 }; +S sgXX[] = { 32, 97, 97, 0 }; +S shig[] = { d, e, a }; +S sgls[] = { 32, h, o, 0 }; +S smv[] = { i, r, 0 }; +S sstg[] = { o, p, a }; +S sqix[] = { m, e, t, 0 }; +S soX[] = { k, 97, 0 }; +S sssv[] = { o, o, r, 0 }; +S ssvh[] = { o, r, d, 0 }; +S sxX[] = { t, 97, 0 }; +S szmv[] = { v, i, r, 0 }; +S sxs[] = { t, o, 0 }; +S svhg[] = { r, d, a }; +S sgXp[] = { 32, 97, l, 0 }; +S sgziv[] = { 32, v, e, r, 0 }; +S sih[] = { e, d, 0 }; +S sgrs[] = { 32, n, o, 0 }; +S szmvg[] = { v, i, r, a }; +S sivw[] = { e, r, s, 0 }; +S smvg[] = { i, r, a }; +S sgqsi[] = { 32, m, o, e, 0 }; +S sqXXv[] = { m, 97, 97, r, 0 }; +S szv[] = { v, r, 0 }; +S si_[] = { e, w, 0 }; +S sgzmv[] = { 32, v, i, r, 0 }; +S spmo[] = { l, i, k, 0 }; +S sym[] = { u, i, 0 }; +S sgn[] = { 32, j, 0 }; +S sqixg[] = { m, e, t, a }; +S sgwi[] = { 32, s, e, 0 }; +S srhg[] = { n, d, a }; +S sgzv[] = { 32, v, r, 0 }; +S sgst[] = { 32, o, p, 0 }; +S srki[] = { n, g, e, 0 }; +S swxX[] = { s, t, 97, 0 }; +S sgqix[] = { 32, m, e, t, 0 }; +S sqXr[] = { m, 97, n, 0 }; +S svm[] = { r, i, 0 }; +S svXX[] = { r, 97, 97, 0 }; +S srhiv[] = { n, d, e, r, 0 }; +S swmi[] = { s, i, e, 0 }; +S sro[] = { n, k, 0 }; +S spp[] = { l, l, 0 }; +S sgxs[] = { 32, t, o, 0 }; +S svwg[] = { r, s, a }; +S soig[] = { k, e, a }; +S siwg[] = { e, s, a }; +S ssvhg[] = { o, r, d, a }; +S sgp[] = { 32, l, 0 }; +S siivg[] = { e, e, r, a }; +S stv[] = { p, r, 0 }; +S smkg[] = { i, g, a }; +S sXg[] = { 97, a }; +S skiw[] = { g, e, s, 0 }; +S sgv[] = { 32, r, 0 }; +S ssk[] = { o, g, 0 }; +S si_i[] = { e, w, e, 0 }; +S srX[] = { n, 97, 0 }; +S spX[] = { l, 97, 0 }; +S sik[] = { e, g, 0 }; +S s_svh[] = { w, o, r, d, 0 }; +S shmx[] = { d, i, t, 0 }; +S sop[] = { k, l, 0 }; +S sgri[] = { 32, n, e, 0 }; +S svxi[] = { r, t, e, 0 }; +S sgwo[] = { 32, s, k, 0 }; +S ssig[] = { o, e, a }; +S sskg[] = { o, g, a }; +S shmr[] = { d, i, n, 0 }; +S sgq79[] = { 32, m, y, 0 }; +S sq79g[] = { m, y, a }; +S s_sv[] = { w, o, r, 0 }; +S siy[] = { e, u, 0 }; +S sq79[] = { m, y, 0 }; +S siir[] = { e, e, n, 0 }; +S skX[] = { g, 97, 0 }; +S sgtv[] = { 32, p, r, 0 }; +S slm[] = { h, i, 0 }; +S sxXX[] = { t, 97, 97, 0 }; +S sivwg[] = { e, r, s, a }; +S sghmx[] = { 32, d, i, t, 0 }; +S sgq79g[] = { 32, m, y, a }; +S shmxg[] = { d, i, t, a }; +S sglm[] = { 32, h, i, 0 }; +S sXXx[] = { 97, 97, t, 0 }; +S stX[] = { p, 97, 0 }; +S sXo[] = { 97, k, 0 }; +S skig[] = { g, e, a }; +S smh[] = { i, d, 0 }; +S ssix[] = { o, e, t, 0 }; +S srhX[] = { n, d, 97, 0 }; +S sgwx[] = { 32, s, t, 0 }; +S srkg[] = { n, g, a }; +S syv[] = { u, r, 0 }; +S sgkiw[] = { 32, g, e, s, 0 }; +S sYv[] = { 98, r, 0 }; +S sgss[] = { 32, o, o, 0 }; +S sghXx[] = { 32, d, 97, t, 0 }; +S spmr[] = { l, i, n, 0 }; +S sirh[] = { e, n, d, 0 }; +S s_ii[] = { w, e, e, 0 }; +S sivh[] = { e, r, d, 0 }; +S shXxg[] = { d, 97, t, a }; +S sxii[] = { t, e, e, 0 }; +S skiv[] = { g, e, r, 0 }; +S skXXr[] = { g, 97, 97, n, 0 }; +S sXq[] = { 97, m, 0 }; +S sgYp[] = { 32, 98, l, 0 }; +S sxsi[] = { t, o, e, 0 }; +S smiv[] = { i, e, r, 0 }; +S shs[] = { d, o, 0 }; +S shivg[] = { d, e, r, a }; +S sYX[] = { 98, 97, 0 }; +S sxsig[] = { t, o, e, a }; +S spig[] = { l, e, a }; +S ssixg[] = { o, e, t, a }; +S shXx[] = { d, 97, t, 0 }; +S srwg[] = { n, s, a }; +S sg_s[] = { 32, w, o, 0 }; +S symx[] = { u, i, t, 0 }; +S smog[] = { i, k, a }; +S smrh[] = { i, n, d, 0 }; +S swxXX[] = { s, t, 97, 97, 0 }; +S skXX[] = { g, 97, 97, 0 }; +S swxi[] = { s, t, e, 0 }; +S sgstg[] = { 32, o, p, a }; +S siyv[] = { e, u, r, 0 }; +S srsk[] = { n, o, g, 0 }; +S sirw[] = { e, n, s, 0 }; +S sg_m[] = { 32, w, i, 0 }; +S sn79g[] = { j, y, a }; +S s_m[] = { w, i, 0 }; +S sXrhg[] = { 97, n, d, a }; +S sv79[] = { r, y, 0 }; +S srmk[] = { n, i, g, 0 }; +S sioi[] = { e, k, e, 0 }; +S sgn79[] = { 32, j, y, 0 }; +S ssw[] = { o, s, 0 }; +S sipm[] = { e, l, i, 0 }; +S sps[] = { l, o, 0 }; +S sirx[] = { e, n, t, 0 }; +S s79h[] = { y, d, 0 }; +S sgqXr[] = { 32, m, 97, n, 0 }; +S smki[] = { i, g, e, 0 }; +S sgn79g[] = { 32, j, y, a }; +S sirm[] = { e, n, i, 0 }; +S slmiv[] = { h, i, e, r, 0 }; +S sgXw[] = { 32, 97, s, 0 }; +S ssrw[] = { o, n, s, 0 }; +S slmi[] = { h, i, e, 0 }; +S sXh[] = { 97, d, 0 }; +S srog[] = { n, k, a }; +S sghi[] = { 32, d, e, 0 }; +S sppi[] = { l, l, e, 0 }; +S smp[] = { i, l, 0 }; +S sn79[] = { j, y, 0 }; +S sqiv[] = { m, e, r, 0 }; +S sov[] = { k, r, 0 }; +S simh[] = { e, i, d, 0 }; +S sg_sv[] = { 32, w, o, r, 0 }; +S siip[] = { e, e, l, 0 }; +S sg_i[] = { 32, w, e, 0 }; +S shivw[] = { d, e, r, s, 0 }; +S sgrsk[] = { 32, n, o, g, 0 }; +S ski_[] = { g, e, w, 0 }; +S sgymx[] = { 32, u, i, t, 0 }; +S spmog[] = { l, i, k, a }; +S srskg[] = { n, o, g, a }; +S siqg[] = { e, m, a }; +S sosq[] = { k, o, m, 0 }; +S sXXo[] = { 97, 97, k, 0 }; +S sxm[] = { t, i, 0 }; +S sgop[] = { 32, k, l, 0 }; +S sivx[] = { e, r, t, 0 }; +S sgym[] = { 32, u, i, 0 }; +S sgy[] = { 32, u, 0 }; +S sglmi[] = { 32, h, i, e, 0 }; +S sXj[] = { 97, f, 0 }; +S sglXX[] = { 32, h, 97, 97, 0 }; +S ssx[] = { o, t, 0 }; +S ship[] = { d, e, l, 0 }; +S shmw[] = { d, i, s, 0 }; +S sqir[] = { m, e, n, 0 }; +S ssrg[] = { o, n, a }; +S sswg[] = { o, s, a }; +S siiq[] = { e, e, m, 0 }; +S sopm[] = { k, l, i, 0 }; +S siY[] = { e, 98, 0 }; +S shXrg[] = { d, 97, n, a }; +S shv[] = { d, r, 0 }; +S slXr[] = { h, 97, n, 0 }; +S sxiq[] = { t, e, m, 0 }; +S sqsix[] = { m, o, e, t, 0 }; +S sXXxg[] = { 97, 97, t, a }; +S sgosr[] = { 32, k, o, n, 0 }; +S srmki[] = { n, i, g, e, 0 }; +S skiY[] = { g, e, 98, 0 }; +S sppig[] = { l, l, e, a }; +S syp[] = { u, l, 0 }; +S smkig[] = { i, g, e, a }; +S sYiw[] = { 98, e, s, 0 }; +S svp[] = { r, l, 0 }; +S sXvx[] = { 97, r, t, 0 }; +S sXrhX[] = { 97, n, d, 97, 0 }; +S slsyg[] = { h, o, u, a }; +S ssrwg[] = { o, n, s, a }; + +N l0n0[] = { { siy, .108 }, H }; +N l0n1[] = { { sl79g, .756 }, { stX, .108 }, H }; +N l0n2[] = { { srmig, 1.371 }, H }; +N l0n3[] = { { ssv, .336 }, { sosq, .121 }, H }; +N l0n4[] = { { sgss, .212 }, H }; +N l0n5[] = { { smr, .645 }, { sxm, .081 }, H }; +N l0n6[] = { { srx, .188 }, { sgYp, .212 }, { spmog, .242 }, { shmw, .101 }, H }; +N l0n7[] = { { sghm, 1.936 }, { s27r, .188 }, { sri, .161 }, H }; +N l0n8[] = { { swo, .161 }, H }; +N l0n9[] = { { slX, .188 }, H }; +N l0n10[] = { { sYp, .161 }, { soig, .272 }, { sgosr, .202 }, H }; +N l0n11[] = { { sghXx, .282 }, H }; +N l0n12[] = { { sgp, .181 }, { sirm, .121 }, H }; +N l0n13[] = { { swg, 1.714 }, { sXr, 1.116 }, { spm, .296 }, { sgzi, .393 }, H }; +N l0n14[] = { { sgki, .907 }, { ssqg, .696 }, H }; +N l0n15[] = { { sgst, .302 }, H }; +N l0n16[] = { { shivw, .161 }, { ssrwg, .202 }, H }; +N l0n17[] = { { sgqsi, .444 }, { shmx, .161 }, H }; +N l0n18[] = { { sik, .108 }, H }; +N l0n20[] = { { skiv, .141 }, { ssw, .081 }, H }; +N l0n21[] = { { shm, 1.008 }, { sog, .928 }, { skXX, .141 }, H }; +N l0n22[] = { { sXXv, .484 }, { sgw79g, .807 }, { sglXX, .202 }, H }; +N l0n23[] = { { shivg, .282 }, H }; +N l0n24[] = { { sxii, .141 }, H }; +N l0n25[] = { { sivh, .141 }, H }; +N l0n28[] = { { sgwo, .242 }, H }; +N l0n29[] = { { sgq, 1.291 }, { sgn79, .181 }, H }; +N l0n30[] = { { s_i, .255 }, { sivwg, .323 }, { srsk, .121 }, { sg_i, .181 }, H }; +N l0n31[] = { { sgli, .998 }, { skiw, .181 }, { ssrg, .151 }, H }; +N l0n32[] = { { symx, .141 }, H }; +N l0n33[] = { { sxig, .665 }, { sop, .108 }, { srhX, .141 }, H }; +N l0n34[] = { { si_, .148 }, { stv, .121 }, { ssix, .141 }, { sxsig, .282 }, H }; +N l0n36[] = { { sym, .134 }, H }; +N l0n37[] = { { sqXXv, .296 }, { ssx, .067 }, H }; +N l0n38[] = { { ssi, .457 }, H }; +N l0n40[] = { { sgrsk, .242 }, { sgym, .181 }, H }; +N l0n41[] = { { srk, .269 }, { szmv, .222 }, { spig, .212 }, H }; +N l0n42[] = { { sgmwg, .565 }, H }; +N l0n43[] = { { sgzXr, .766 }, { s_Xwg, .484 }, H }; +N l0n44[] = { { sxg, 2.138 }, { sXXx, .161 }, H }; +N l0n45[] = { { sivg, 1.149 }, { svs, .229 }, H }; +N l0n46[] = { { ski, .807 }, { sgr, 1.170 }, { sgio, .423 }, H }; +N l0n48[] = { { sXX, 1.008 }, H }; +N l0n49[] = { { sg27r, .423 }, { shig, .333 }, H }; +N l0n50[] = { { smog, .212 }, H }; +N l0n52[] = { { spg, .565 }, { sim, .229 }, H }; +N l0n54[] = { { sghmi, 1.976 }, { ssy, .296 }, { s_Xxg, .484 }, { siivg, .363 }, { sgtv, .242 }, H }; +N l0n57[] = { { sgzm, .423 }, H }; +N l0n60[] = { { shg, .786 }, { sq79, .108 }, H }; +N l0n61[] = { { swmi, .202 }, H }; +N l0n62[] = { { siwg, .272 }, { slmiv, .161 }, H }; +N l0n63[] = { { sgs, .988 }, { svX, .296 }, { sn79g, .181 }, H }; +N l0n64[] = { { spp, .121 }, H }; +N l0n65[] = { { sstg, .333 }, H }; +N l0n66[] = { { sgXw, .181 }, H }; +N l0n67[] = { { szm, .188 }, H }; +N l0n68[] = { { sqixg, .403 }, H }; +N l0n69[] = { { sqsix, .134 }, { smkig, .202 }, H }; +N l0n72[] = { { sgqX, .665 }, { sgws, .363 }, { ssk, .121 }, H }; +N l0n73[] = { { slix, .484 }, { smv, .148 }, H }; +N l0n74[] = { { sXXrg, .686 }, { sg_m, .181 }, H }; +N l0n75[] = { { srm, .632 }, { syg, .323 }, { sgxig, .565 }, { sXpg, .363 }, { sg_Xw, .484 }, { sglm, .242 }, { s79h, .081 }, { ski_, .121 }, H }; +N l0n76[] = { { sws, .202 }, H }; +N l0n77[] = { { sli, .471 }, { srhi, .323 }, { sXvx, .101 }, H }; +N l0n78[] = { { sg_Xx, .524 }, { sgsqg, .484 }, H }; +N l0n79[] = { { sixg, 1.512 }, { sgir, .938 }, { ssvh, .222 }, { sYX, .094 }, H }; +N l0n80[] = { { sgt, .262 }, { sgq79, .242 }, H }; +N l0n81[] = { { sgX, .847 }, { sXv, .484 }, { smrh, .141 }, H }; +N l0n82[] = { { smiv, .141 }, H }; +N l0n83[] = { { sqg, .665 }, H }; +N l0n84[] = { { sos, .215 }, H }; +N l0n85[] = { { srwg, .212 }, H }; +N l0n86[] = { { sio, .444 }, { sw79g, .605 }, { srhg, .302 }, H }; +N l0n87[] = { { syp, .067 }, H }; +N l0n89[] = { { sXrh, .343 }, { sgxs, .272 }, H }; +N l0n90[] = { { smw, .363 }, H }; +N l0n91[] = { { sig, 3.650 }, { sgl79g, 1.008 }, { smh, .094 }, H }; +N l0n94[] = { { sqXr, .202 }, { slsyg, .202 }, H }; +N l0n95[] = { { skXXr, .188 }, H }; +N l0n98[] = { { sgY, .645 }, { sXw, .323 }, { s_m, .081 }, H }; +N l0n99[] = { { sgziv, .444 }, { sghmx, .323 }, { sXh, .081 }, H }; +N l0n100[] = { { skiY, .101 }, H }; +N l0n101[] = { { smrg, .544 }, H }; +N l0n102[] = { { soX, .148 }, H }; +N l0n103[] = { { sip, .471 }, { s27rg, .423 }, { sgkiw, .282 }, H }; +N l0n106[] = { { svXX, .202 }, H }; +N l0n107[] = { { smx, .323 }, { sgqXX, .524 }, { sxs, .148 }, H }; +N l0n108[] = { { smi, 1.654 }, { shmi, 1.049 }, H }; +N l0n109[] = { { sXrg, 1.391 }, { sro, .121 }, H }; +N l0n111[] = { { sgstg, .282 }, H }; +N l0n112[] = { { sYv, .094 }, { sxiq, .101 }, H }; +N l0n113[] = { { svw, .202 }, { shmxg, .323 }, H }; +N l0n114[] = { { srg, 2.501 }, { svh, .269 }, { smrk, .242 }, { sgv, .181 }, H }; +N l0n115[] = { { sXx, .471 }, { sps, .081 }, H }; +N l0n116[] = { { sgqi, .544 }, { sswg, .151 }, H }; +N l0n117[] = { { szXr, .464 }, { s_ii, .141 }, { ship, .101 }, H }; +N l0n118[] = { { sXXvg, .766 }, H }; +N l0n119[] = { { sg27, .323 }, H }; +N l0n120[] = { { siq, .202 }, H }; +N l0n121[] = { { si_i, .161 }, H }; +N l0n122[] = { { sjg, .242 }, { sirw, .121 }, { sglmi, .242 }, H }; +N l0n123[] = { { sglix, .968 }, { sgzs, .393 }, { shs, .094 }, H }; +N l0n124[] = { { sgXX, .363 }, { sXrhX, .134 }, H }; +N l0n125[] = { { sxX, .148 }, { sgn79g, .242 }, H }; +N l0n126[] = { { srskg, .242 }, H }; +N l0n127[] = { { sgwx, .212 }, H }; +N l0n128[] = { { srki, .202 }, { simh, .121 }, H }; +N l0n130[] = { { svx, .175 }, { ssixg, .282 }, H }; +N l0n131[] = { { sgw, 1.412 }, { svi, .229 }, H }; +N l0n132[] = { { sgh, 1.795 }, { sgymx, .242 }, { sYiw, .101 }, H }; +N l0n133[] = { { spX, .108 }, { sgri, .242 }, { sirx, .121 }, { sXj, .067 }, H }; +N l0n134[] = { { ssig, .242 }, H }; +N l0n135[] = { { sov, .081 }, H }; +N l0n137[] = { { sir, .914 }, { szmvg, .444 }, { srkg, .212 }, { shXx, .141 }, H }; +N l0n140[] = { { sg_s, .212 }, { sXXxg, .202 }, H }; +N l0n141[] = { { shX, .309 }, { sgls, .333 }, H }; +N l0n142[] = { { smk, .202 }, { sgiog, .565 }, { skig, .242 }, H }; +N l0n143[] = { { sgzmv, .444 }, H }; +N l0n145[] = { { sg27rg, .565 }, { slm, .108 }, H }; +N l0n146[] = { { sqs, .202 }, { sgqXr, .242 }, H }; +N l0n147[] = { { sYi, .282 }, { sgmr, .514 }, H }; +N l0n148[] = { { sgx, .585 }, { siip, .121 }, H }; +N l0n149[] = { { sgi, 1.089 }, H }; +N l0n150[] = { { sXk, .242 }, { ssyg, .484 }, H }; +N l0n151[] = { { sppi, .121 }, H }; +N l0n153[] = { { skg, .766 }, H }; +N l0n156[] = { { sgzv, .302 }, { sq79g, .242 }, H }; +N l0n159[] = { { sgop, .181 }, { siiq, .101 }, H }; +N l0n161[] = { { sl79, .350 }, { swx, .255 }, H }; +N l0n162[] = { { srmi, .706 }, { swi, .242 }, { sqir, .101 }, H }; +N l0n163[] = { { srhiv, .269 }, H }; +N l0n164[] = { { sqX, .390 }, { sopm, .101 }, H }; +N l0n165[] = { { sgy, .121 }, H }; +N l0n166[] = { { spmo, .202 }, H }; +N l0n167[] = { { shXrg, .202 }, H }; +N l0n168[] = { { sskg, .242 }, { sxXX, .161 }, H }; +N l0n169[] = { { slixg, .968 }, { szs, .188 }, { smvg, .333 }, H }; +N l0n170[] = { { soi, .255 }, { siir, .161 }, H }; +N l0n173[] = { { sioi, .121 }, H }; +N l0n174[] = { { ssq, .390 }, { s_sv, .161 }, { shv, .067 }, H }; +N l0n175[] = { { sgirg, 1.008 }, { sghX, .423 }, { ssvhg, .363 }, H }; +N l0n176[] = { { stg, .242 }, { sgq79g, .323 }, { ssrw, .121 }, H }; +N l0n177[] = { { sgrm, 1.028 }, { sXvg, .575 }, { srs, .175 }, H }; +N l0n182[] = { { sgz, 1.452 }, { siog, .635 }, { sgw79, .605 }, { sssv, .222 }, H }; +N l0n183[] = { { sgk, .827 }, { shiv, .343 }, H }; +N l0n184[] = { { srmk, .121 }, H }; +N l0n185[] = { { sgYi, .484 }, { sXrhg, .242 }, H }; +N l0n186[] = { { smwg, .575 }, H }; +N l0n187[] = { { szX, .376 }, H }; +N l0n189[] = { { syv, .094 }, { siY, .067 }, H }; +N l0n190[] = { { sivw, .222 }, H }; +N l0n191[] = { { ssr, .350 }, H }; +N l0n192[] = { { sgos, .363 }, H }; +N l0n193[] = { { sxi, .645 }, H }; +N l0n194[] = { { sXwg, .605 }, { sxsi, .141 }, H }; +N l0n195[] = { { srX, .108 }, { slXr, .101 }, H }; +N l0n198[] = { { sgXXr, .484 }, H }; +N l0n199[] = { { s79g, 1.291 }, { sg_, 1.089 }, { sipg, .363 }, { svm, .134 }, { spmr, .141 }, H }; +N l0n200[] = { { sgl, 1.896 }, { s_s, .175 }, H }; +N l0n201[] = { { spi, .229 }, { sXXo, .121 }, { sivx, .121 }, H }; +N l0n202[] = { { sgmw, .423 }, H }; +N l0n203[] = { { smxg, .544 }, { s_Xw, .242 }, H }; +N l0n204[] = { { smig, 2.964 }, { shmig, 2.017 }, { swxX, .202 }, H }; +N l0n205[] = { { siv, 1.143 }, { srog, .181 }, H }; +N l0n206[] = { { sqiv, .121 }, H }; +N l0n207[] = { { sqXX, .302 }, { shmr, .161 }, H }; +N l0n208[] = { { sss, .457 }, { sgqix, .403 }, H }; +N l0n209[] = { { shi, .565 }, { svwg, .272 }, H }; +N l0n210[] = { { smo, .202 }, { svhg, .333 }, H }; +N l0n211[] = { { sXxg, .817 }, H }; +N l0n213[] = { { szXrg, .726 }, { sirh, .141 }, H }; +N l0n214[] = { { s_Xx, .262 }, { siiv, .262 }, H }; +N l0n215[] = { { sv79, .081 }, H }; +N l0n216[] = { { siqg, .181 }, H }; +N l0n217[] = { { sgm, .706 }, { svxi, .161 }, H }; +N l0n218[] = { { s_X, .471 }, { sgwi, .302 }, { s_svh, .215 }, { sXo, .108 }, H }; +N l0n219[] = { { sghi, .181 }, H }; +N l0n220[] = { { szv, .148 }, H }; +N l0n222[] = { { siw, .323 }, H }; +N l0n223[] = { { sih, .148 }, { sXg, .181 }, { sn79, .081 }, H }; +N l0n224[] = { { sgrmi, 1.331 }, H }; +N l0n225[] = { { sgzX, .635 }, { sst, .202 }, H }; +N l0n226[] = { { sgqs, .423 }, { sg_sv, .242 }, H }; +N l0n227[] = { { smp, .081 }, H }; +N l0n228[] = { { sqix, .222 }, H }; +N l0n229[] = { { sziv, .242 }, { smki, .121 }, H }; +N l0n230[] = { { swm, .188 }, { siyv, .121 }, H }; +N l0n231[] = { { srmki, .134 }, H }; +N l0n232[] = { { sqi, .390 }, { slmi, .121 }, H }; +N l0n233[] = { { sirg, 1.119 }, { sqsi, .242 }, { shXxg, .282 }, H }; +N l0n234[] = { { sXXr, .565 }, { sgn, .202 }, { skX, .108 }, { sipm, .121 }, H }; +N l0n235[] = { { sXp, .282 }, { sgxi, .454 }, H }; +N l0n238[] = { { svg, 1.533 }, { sgsq, .363 }, { smkg, .272 }, H }; +N l0n239[] = { { six, .726 }, { swxXX, .188 }, H }; +N l0n240[] = { { sii, .632 }, H }; +N l0n242[] = { { sg_X, .998 }, H }; +N l0n243[] = { { sgmrg, .565 }, { sglX, .363 }, { sgrs, .333 }, H }; +N l0n245[] = { { srw, .202 }, { sgXp, .333 }, H }; +N l0n246[] = { { srh, .484 }, { sw79, .269 }, { sXkg, .393 }, H }; +N l0n247[] = { { sls, .229 }, { sppig, .202 }, H }; +N l0n248[] = { { swxi, .141 }, H }; +N l0n249[] = { { sgsr, .393 }, H }; +N l0n250[] = { { svp, .067 }, H }; +N l0n251[] = { { sgo, .605 }, { sgl79, .786 }, H }; +N l0n252[] = { { sXq, .094 }, H }; +N l0n255[] = { { szi, .188 }, H }; + +D l0_d = { "afrikaans", "iso-8859-15", - { - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,0.010,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - 0.001,0.180,0.030,0.001,0.106,0.333,0.014,0.068,0.056,0.152,0.007,0.067,0.068,0.071,0.167,0.127, - 0.024,W,0.123,0.115,0.112,0.032,0.045,0.042,W,0.045,W,W,W,W,W,W, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - Y,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V, - V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V, - V,V,V,V,V,V,V,V,V,0.001,0.005,0.006,V,V,V,0.001, - V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V - }, - { - l0n0,l0n1,l0n2,l0n3,l0n4,l0n5,l0n6,l0n7,l0n8,l0n9,l0n10,l0n11,l0n12,l0n13,l0n14,l0n15, - l0n16,l0n17,l0n18,X,l0n20,l0n21,l0n22,l0n23,l0n24,l0n25,X,X,l0n28,l0n29,l0n30,l0n31, - l0n32,l0n33,l0n34,X,l0n36,l0n37,l0n38,X,l0n40,l0n41,l0n42,l0n43,l0n44,l0n45,l0n46,X, - l0n48,l0n49,l0n50,X,l0n52,X,l0n54,X,X,l0n57,X,X,l0n60,l0n61,l0n62,l0n63, - l0n64,l0n65,l0n66,l0n67,l0n68,l0n69,X,X,l0n72,l0n73,l0n74,l0n75,l0n76,l0n77,l0n78,l0n79, - l0n80,l0n81,l0n82,l0n83,l0n84,l0n85,l0n86,l0n87,X,l0n89,l0n90,l0n91,X,X,l0n94,l0n95, - X,X,l0n98,l0n99,l0n100,l0n101,l0n102,l0n103,X,X,l0n106,l0n107,l0n108,l0n109,X,l0n111, - l0n112,l0n113,l0n114,l0n115,l0n116,l0n117,l0n118,l0n119,l0n120,l0n121,l0n122,l0n123,l0n124,l0n125,l0n126,l0n127, - l0n128,X,l0n130,l0n131,l0n132,l0n133,l0n134,l0n135,X,l0n137,X,X,l0n140,l0n141,l0n142,l0n143, - X,l0n145,l0n146,l0n147,l0n148,l0n149,l0n150,l0n151,X,l0n153,X,X,l0n156,X,X,l0n159, - X,l0n161,l0n162,l0n163,l0n164,l0n165,l0n166,l0n167,l0n168,l0n169,l0n170,X,X,l0n173,l0n174,l0n175, - l0n176,l0n177,X,X,X,X,l0n182,l0n183,l0n184,l0n185,l0n186,l0n187,X,l0n189,l0n190,l0n191, - l0n192,l0n193,l0n194,l0n195,X,X,l0n198,l0n199,l0n200,l0n201,l0n202,l0n203,l0n204,l0n205,l0n206,l0n207, - l0n208,l0n209,l0n210,l0n211,X,l0n213,l0n214,l0n215,l0n216,l0n217,l0n218,l0n219,l0n220,X,l0n222,l0n223, - l0n224,l0n225,l0n226,l0n227,l0n228,l0n229,l0n230,l0n231,l0n232,l0n233,l0n234,l0n235,X,X,l0n238,l0n239, - l0n240,X,l0n242,l0n243,X,l0n245,l0n246,l0n247,l0n248,l0n249,l0n250,l0n251,l0n252,X,X,l0n255 - } + { W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, 0.010, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + 0.001, 0.180, 0.030, 0.001, 0.106, 0.333, 0.014, 0.068, 0.056, 0.152, 0.007, 0.067, 0.068, 0.071, 0.167, 0.127, + 0.024, W, 0.123, 0.115, 0.112, 0.032, 0.045, 0.042, W, 0.045, W, W, W, W, W, W, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + Y, V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, + V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, + V, V, V, V, V, V, V, V, V, 0.001, 0.005, 0.006, V, V, V, 0.001, + V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, V }, + { l0n0, l0n1, l0n2, l0n3, l0n4, l0n5, l0n6, l0n7, l0n8, l0n9, l0n10, l0n11, l0n12, l0n13, l0n14, l0n15, + l0n16, l0n17, l0n18, X, l0n20, l0n21, l0n22, l0n23, l0n24, l0n25, X, X, l0n28, l0n29, l0n30, l0n31, + l0n32, l0n33, l0n34, X, l0n36, l0n37, l0n38, X, l0n40, l0n41, l0n42, l0n43, l0n44, l0n45, l0n46, X, + l0n48, l0n49, l0n50, X, l0n52, X, l0n54, X, X, l0n57, X, X, l0n60, l0n61, l0n62, l0n63, + l0n64, l0n65, l0n66, l0n67, l0n68, l0n69, X, X, l0n72, l0n73, l0n74, l0n75, l0n76, l0n77, l0n78, l0n79, + l0n80, l0n81, l0n82, l0n83, l0n84, l0n85, l0n86, l0n87, X, l0n89, l0n90, l0n91, X, X, l0n94, l0n95, + X, X, l0n98, l0n99, l0n100, l0n101, l0n102, l0n103, X, X, l0n106, l0n107, l0n108, l0n109, X, l0n111, + l0n112, l0n113, l0n114, l0n115, l0n116, l0n117, l0n118, l0n119, l0n120, l0n121, l0n122, l0n123, l0n124, l0n125, l0n126, l0n127, + l0n128, X, l0n130, l0n131, l0n132, l0n133, l0n134, l0n135, X, l0n137, X, X, l0n140, l0n141, l0n142, l0n143, + X, l0n145, l0n146, l0n147, l0n148, l0n149, l0n150, l0n151, X, l0n153, X, X, l0n156, X, X, l0n159, + X, l0n161, l0n162, l0n163, l0n164, l0n165, l0n166, l0n167, l0n168, l0n169, l0n170, X, X, l0n173, l0n174, l0n175, + l0n176, l0n177, X, X, X, X, l0n182, l0n183, l0n184, l0n185, l0n186, l0n187, X, l0n189, l0n190, l0n191, + l0n192, l0n193, l0n194, l0n195, X, X, l0n198, l0n199, l0n200, l0n201, l0n202, l0n203, l0n204, l0n205, l0n206, l0n207, + l0n208, l0n209, l0n210, l0n211, X, l0n213, l0n214, l0n215, l0n216, l0n217, l0n218, l0n219, l0n220, X, l0n222, l0n223, + l0n224, l0n225, l0n226, l0n227, l0n228, l0n229, l0n230, l0n231, l0n232, l0n233, l0n234, l0n235, X, X, l0n238, l0n239, + l0n240, X, l0n242, l0n243, X, l0n245, l0n246, l0n247, l0n248, l0n249, l0n250, l0n251, l0n252, X, X, l0n255 } }; - - // // Lng: albanian // Enc: utf8 // - -S sc3ab[]={195,171,0}; -S sc3abg[]={195,171,a}; -S sabg[]={171,a}; -S sxc3[]={t,195,0}; -S sxc3ab[]={t,195,171,0}; -S sxc3abg[]={t,195,171,a}; -S swl[]={s,h,0}; -S smg[]={i,a}; -S sabv[]={171,r,0}; -S sc3abv[]={195,171,r,0}; -S sgxc3[]={32,t,195,0}; -S sgxc3ab[]={32,t,195,171,0}; -S slx[]={h,t,0}; -S swlx[]={s,h,t,0}; -S sgig[]={32,e,a}; -S stc3[]={p,195,0}; -S stc3ab[]={p,195,171,0}; -S stc3abv[]={p,195,171,r,0}; -S smwl[]={i,s,h,0}; -S src3ab[]={n,195,171,0}; -S src3[]={n,195,0}; -S sng[]={j,a}; -S sgtc3[]={32,p,195,0}; -S sgtc3ab[]={32,p,195,171,0}; -S svc3[]={r,195,0}; -S ssg[]={o,a}; -S smwlx[]={i,s,h,t,0}; -S svc3ab[]={r,195,171,0}; -S slxi[]={h,t,e,0}; -S sni[]={j,e,0}; -S swlxi[]={s,h,t,e,0}; -S src3abg[]={n,195,171,a}; -S shl[]={d,h,0}; -S snc3[]={j,195,0}; -S snc3ab[]={j,195,171,0}; -S skn[]={g,j,0}; -S sin[]={e,j,0}; -S sc3abw[]={195,171,s,0}; -S sabw[]={171,s,0}; -S srn[]={n,j,0}; -S slxig[]={h,t,e,a}; -S sqm[]={m,i,0}; -S sing[]={e,j,a}; -S sc3abvg[]={195,171,r,a}; -S sabvg[]={171,r,a}; -S sgrc3ab[]={32,n,195,171,0}; -S sgrc3[]={32,n,195,0}; -S sgwl[]={32,s,h,0}; -S sabr[]={171,n,0}; -S soc3ab[]={k,195,171,0}; -S soy[]={k,u,0}; -S sc3abr[]={195,171,n,0}; -S soc3[]={k,195,0}; -S srnc3[]={n,j,195,0}; -S srnc3ab[]={n,j,195,171,0}; -S sgu[]={32,q,0}; -S sqig[]={m,e,a}; -S snc3abg[]={j,195,171,a}; -S sgwm[]={32,s,i,0}; -S sxl[]={t,h,0}; -S syvg[]={u,r,a}; -S sgtX[]={32,p,97,0}; -S som[]={k,i,0}; -S swig[]={s,e,a}; -S smq[]={i,m,0}; -S sts[]={p,o,0}; -S sqc3[]={m,195,0}; -S snX[]={j,97,0}; -S sqc3ab[]={m,195,171,0}; -S sgqig[]={32,m,e,a}; -S sXn[]={97,j,0}; -S sgrh[]={32,n,d,0}; -S sgj[]={32,f,0}; -S sgrn[]={32,n,j,0}; -S sc3a7[]={195,167,0}; -S sabwg[]={171,s,a}; -S sc3abwg[]={195,171,s,a}; -S svc3abg[]={r,195,171,a}; -S suc3ab[]={q,195,171,0}; -S suc3[]={q,195,0}; -S sgmg[]={32,i,a}; -S sc3abx[]={195,171,t,0}; -S sixc3ab[]={e,t,195,171,0}; -S sixc3[]={e,t,195,0}; -S sabx[]={171,t,0}; -S sgrnc3[]={32,n,j,195,0}; -S suc3abg[]={q,195,171,a}; -S sgrk[]={32,n,g,0}; -S sgkn[]={32,g,j,0}; -S shli[]={d,h,e,0}; -S slig[]={h,e,a}; -S somw[]={k,i,s,0}; -S sgom[]={32,k,i,0}; -S syX[]={u,97,0}; -S shlig[]={d,h,e,a}; -S sabrg[]={171,n,a}; -S sc3abrg[]={195,171,n,a}; -S svv[]={r,r,0}; -S sxy[]={t,u,0}; -S sgoc3[]={32,k,195,0}; -S swc3[]={s,195,0}; -S sguc3[]={32,q,195,0}; -S ssl[]={o,h,0}; -S sgoc3ab[]={32,k,195,171,0}; -S sguc3ab[]={32,q,195,171,0}; -S somwl[]={k,i,s,h,0}; -S swc3ab[]={s,195,171,0}; -S slc3[]={h,195,0}; -S snm[]={j,i,0}; -S sghl[]={32,d,h,0}; -S srkX[]={n,g,97,0}; -S sgoy[]={32,k,u,0}; -S sqc3abg[]={m,195,171,a}; -S sgrkX[]={32,n,g,97,0}; -S sXxc3[]={97,t,195,0}; -S srxig[]={n,t,e,a}; -S sgomw[]={32,k,i,s,0}; -S sXxc3ab[]={97,t,195,171,0}; -S syr[]={u,n,0}; -S slin[]={h,e,j,0}; -S srxi[]={n,t,e,0}; -S sling[]={h,e,j,a}; -S sns[]={j,o,0}; -S sgmwl[]={32,i,s,h,0}; -S svmg[]={r,i,a}; -S soyv[]={k,u,r,0}; -S sgqc3ab[]={32,m,195,171,0}; -S sghli[]={32,d,h,e,0}; -S sgqc3[]={32,m,195,0}; -S snsg[]={j,o,a}; -S sxXg[]={t,97,a}; -S sgts[]={32,p,o,0}; -S sknm[]={g,j,i,0}; -S soc3abx[]={k,195,171,t,0}; -S swlm[]={s,h,i,0}; -S spc3ab[]={l,195,171,0}; -S sYc3[]={98,195,0}; -S sXm[]={97,i,0}; -S sXt[]={97,p,0}; -S sly[]={h,u,0}; -S sYc3ab[]={98,195,171,0}; -S syo[]={u,k,0}; -S spc3[]={l,195,0}; -S sgqm[]={32,m,i,0}; -S swX[]={s,97,0}; -S srmg[]={n,i,a}; -S slc3ab[]={h,195,171,0}; -S sgzix[]={32,v,e,t,0}; -S sgwmp[]={32,s,i,l,0}; -S sxc3abv[]={t,195,171,r,0}; -S sknmx[]={g,j,i,t,0}; -S syXvg[]={u,97,r,a}; -S sgc3[]={32,195,0}; -S syXv[]={u,97,r,0}; -S srhs[]={n,d,o,0}; -S sgxl[]={32,t,h,0}; -S sxlX[]={t,h,97,0}; -S spz[]={l,v,0}; -S swmp[]={s,i,l,0}; -S sui[]={q,e,0}; -S szix[]={v,e,t,0}; -S sgZ[]={32,99,0}; -S ssli[]={o,h,e,0}; -S smpz[]={i,l,v,0}; -S smqm[]={i,m,i,0}; -S sqmv[]={m,i,r,0}; -S sqY[]={m,98,0}; -S sgxX[]={32,t,97,0}; -S snmx[]={j,i,t,0}; -S swmpz[]={s,i,l,v,0}; -S stsg[]={p,o,a}; -S sgxlX[]={32,t,h,97,0}; -S syog[]={u,k,a}; -S swc3abg[]={s,195,171,a}; -S sc3abvm[]={195,171,r,i,0}; -S stm[]={p,i,0}; -S smxl[]={i,t,h,0}; -S sgoX[]={32,k,97,0}; -S sky[]={g,u,0}; -S sgoyv[]={32,k,u,r,0}; -S sgry[]={32,n,u,0}; -S sslin[]={o,h,e,j,0}; -S snmxl[]={j,i,t,h,0}; -S snig[]={j,e,a}; -S syrh[]={u,n,d,0}; -S sgwig[]={32,s,e,a}; -S sry[]={n,u,0}; -S soXg[]={k,97,a}; -S sgYc3ab[]={32,98,195,171,0}; -S ssrx[]={o,n,t,0}; -S skXg[]={g,97,a}; -S sabvm[]={171,r,i,0}; -S srkXg[]={n,g,97,a}; -S svXg[]={r,97,a}; -S sgYc3[]={32,98,195,0}; -S szXg[]={v,97,a}; -S sgwX[]={32,s,97,0}; -S spzXg[]={l,v,97,a}; -S sqirh[]={m,e,n,d,0}; -S smpzX[]={i,l,v,97,0}; -S sc3abq[]={195,171,m,0}; -S svmx[]={r,i,t,0}; -S sryog[]={n,u,k,a}; -S slg[]={h,a}; -S snx[]={j,t,0}; -S sgrhs[]={32,n,d,o,0}; -S sjX[]={f,97,0}; -S sYm[]={98,i,0}; -S srmrg[]={n,i,n,a}; -S spzX[]={l,v,97,0}; -S sg7a[]={32,z,0}; -S svk[]={r,g,0}; -S sgryo[]={32,n,u,k,0}; -S sgqmv[]={32,m,i,r,0}; -S sryo[]={n,u,k,0}; -S ssrm[]={o,n,i,0}; -S slXg[]={h,97,a}; -S sxix[]={t,e,t,0}; -S svq[]={r,m,0}; -S sxlXg[]={t,h,97,a}; -S sabq[]={171,m,0}; -S sxXr[]={t,97,n,0}; -S svin[]={r,e,j,0}; -S srmr[]={n,i,n,0}; -S slxg[]={h,t,a}; -S ssrxi[]={o,n,t,e,0}; -S sghs[]={32,d,o,0}; -S srXg[]={n,97,a}; -S smn[]={i,j,0}; -S sxyv[]={t,u,r,0}; -S sgXm[]={32,97,i,0}; -S stvi[]={p,r,e,0}; -S sgtXw[]={32,p,97,s,0}; -S szc3ab[]={v,195,171,0}; -S sivc3[]={e,r,195,0}; -S sXmg[]={97,i,a}; -S sabxc3[]={171,t,195,0}; -S sgqir[]={32,m,e,n,0}; -S stXv[]={p,97,r,0}; -S shy[]={d,u,0}; -S sxmg[]={t,i,a}; -S swlxg[]={s,h,t,a}; -S sgc3a7[]={32,195,167,0}; -S sgXmg[]={32,97,i,a}; -S sxv[]={t,r,0}; -S siwl[]={e,s,h,0}; -S ssvg[]={o,r,a}; -S svc3abr[]={r,195,171,n,0}; -S s7am[]={z,i,0}; -S sgwlx[]={32,s,h,t,0}; -S soyvg[]={k,u,r,a}; -S sXrm[]={97,n,i,0}; -S sabxc3ab[]={171,t,195,171,0}; -S szc3[]={v,195,0}; -S sxXrm[]={t,97,n,i,0}; -S sgknm[]={32,g,j,i,0}; -S sgXx[]={32,97,t,0}; -S stXw[]={p,97,s,0}; -S sXu[]={97,q,0}; -S sivc3ab[]={e,r,195,171,0}; -S sc3abxc3[]={195,171,t,195,0}; -S sgxXr[]={32,t,97,n,0}; -S swlmr[]={s,h,i,n,0}; -S sXns[]={97,j,o,0}; -S sgqY[]={32,m,98,0}; -S sgtvi[]={32,p,r,e,0}; -S sgpi[]={32,l,e,0}; -S svmw[]={r,i,s,0}; -S sc3abp[]={195,171,l,0}; -S slxc3[]={h,t,195,0}; -S syq[]={u,m,0}; -S sgtsg[]={32,p,o,a}; -S sknc3ab[]={g,j,195,171,0}; -S sXrmg[]={97,n,i,a}; -S s79v[]={y,r,0}; -S slmrg[]={h,i,n,a}; -S sgZm[]={32,99,i,0}; -S sgYv[]={32,98,r,0}; -S sxn[]={t,j,0}; -S sving[]={r,e,j,a}; -S sgwc3[]={32,s,195,0}; -S sabp[]={171,l,0}; -S sug[]={q,a}; -S sxlc3[]={t,h,195,0}; -S si7a[]={e,z,0}; -S sgXns[]={32,97,j,o,0}; -S smoy[]={i,k,u,0}; -S slxc3ab[]={h,t,195,171,0}; -S sln[]={h,j,0}; -S stvin[]={p,r,e,j,0}; -S sZm[]={99,i,0}; - -N l1n0[]={{swlxi,.690},{sgc3a7,.181},{soyvg,.242},H}; -N l1n1[]={{stX,.253},H}; -N l1n2[]={{swig,.492},{sgoy,.337},{sgmwl,.414},H}; -N l1n3[]={{slxig,.898},{sabr,.397},{ssv,.184},{snmxl,.207},H}; -N l1n4[]={{shl,.334},H}; -N l1n5[]={{smr,.391},{sxm,.265},{sgrnc3,.552},{srmr,.138},H}; -N l1n6[]={{sgwm,.544},{srx,.207},{sknm,.190},H}; -N l1n7[]={{spc3,.127},H}; -N l1n9[]={{slX,.173},{sgxXr,.242},H}; -N l1n11[]={{svq,.092},H}; -N l1n12[]={{sgp,.311},{sgxl,.259},H}; -N l1n13[]={{swg,.483},{sXr,.230},{sgzi,.414},{spm,.150},H}; -N l1n16[]={{sryog,.276},H}; -N l1n17[]={{svin,.138},H}; -N l1n18[]={{sc3abrg,1.165},{sqmv,.173},{sik,.081},H}; -N l1n21[]={{sog,.242},{shm,.161},{sgts,.285},{spzX,.138},H}; -N l1n22[]={{sxn,.069},H}; -N l1n23[]={{somwl,.322},{sry,.104},H}; -N l1n24[]={{smpzX,.184},{sXmg,.181},H}; -N l1n25[]={{sc3abvm,.466},H}; -N l1n26[]={{svc3ab,.552},H}; -N l1n27[]={{szXg,.207},H}; -N l1n29[]={{sgq,1.208},{syvg,.544},H}; -N l1n31[]={{sxlX,.173},H}; -N l1n33[]={{sxig,1.398},H}; -N l1n34[]={{snc3ab,.483},{stv,.161},H}; -N l1n35[]={{srXg,.181},H}; -N l1n37[]={{ssx,.081},H}; -N l1n38[]={{sqc3,.207},{sgoX,.233},H}; -N l1n39[]={{svmg,.311},H}; -N l1n41[]={{srk,.230},H}; -N l1n42[]={{sYc3ab,.190},H}; -N l1n43[]={{sghli,.414},H}; -N l1n44[]={{sxg,.846},{sqm,.288},{sgXns,.207},H}; -N l1n45[]={{svs,.104},H}; -N l1n46[]={{sgr,1.588},{smwlx,.736},{sivc3,.121},H}; -N l1n47[]={{sXt,.127},{sgxlX,.311},{sivc3ab,.161},H}; -N l1n49[]={{swlxg,.242},H}; -N l1n50[]={{stc3abv,.944},H}; -N l1n52[]={{sgXmg,.242},H}; -N l1n53[]={{sns,.138},{sgry,.233},H}; -N l1n54[]={{sgtv,.285},H}; -N l1n55[]={{sxXr,.138},H}; -N l1n57[]={{sgmg,.440},{swc3ab,.242},{s79v,.069},H}; -N l1n58[]={{sgwig,.311},H}; -N l1n59[]={{sling,.449},H}; -N l1n60[]={{shg,.190},H}; -N l1n61[]={{szc3,.081},{sc3abxc3,.362},H}; -N l1n62[]={{sc3abvg,1.864},{sky,.104},H}; -N l1n63[]={{svX,.276},H}; -N l1n64[]={{spp,.207},{sXu,.081},H}; -N l1n65[]={{soc3ab,.397},H}; -N l1n66[]={{ssrm,.138},{sgXw,.181},H}; -N l1n69[]={{src3,.414},{sin,.322},{sgkn,.414},H}; -N l1n70[]={{syo,.127},H}; -N l1n71[]={{sabv,1.295},{snX,.207},H}; -N l1n72[]={{sqig,.570},{sgYv,.155},H}; -N l1n73[]={{sc3abwg,1.320},{smv,.115},{sghs,.181},H}; -N l1n74[]={{sgwmp,.345},{skXg,.233},H}; -N l1n75[]={{syg,.449},{srm,.253},H}; -N l1n76[]={{slx,.621},H}; -N l1n77[]={{sli,.518},{sgXx,.181},H}; -N l1n79[]={{sixg,.285},{stsg,.259},H}; -N l1n80[]={{sgt,1.502},{sixc3,.276},H}; -N l1n81[]={{sgX,.777},{sXv,.403},{sixc3ab,.368},H}; -N l1n83[]={{sqg,.190},{sgqY,.155},H}; -N l1n84[]={{sos,.150},{srkX,.224},H}; -N l1n85[]={{sxlc3,.104},{si7a,.069},H}; -N l1n86[]={{srhg,.285},{siwl,.121},H}; -N l1n87[]={{syp,.115},{sgwlx,.242},H}; -N l1n88[]={{sc3abg,12.467},{sxc3ab,2.054},{sabw,.466},{swlm,.190},{sgoyv,.311},H}; -N l1n89[]={{ssl,.161},H}; -N l1n90[]={{smw,.564},H}; -N l1n91[]={{sig,3.142},{suc3abg,.552},{shli,.276},{smh,.092},H}; -N l1n92[]={{srn,.311},{sgoc3,.362},H}; -N l1n93[]={{sgoc3ab,.483},{srxi,.224},{sly,.127},H}; -N l1n94[]={{swX,.127},H}; -N l1n96[]={{svv,.173},{spc3ab,.190},H}; -N l1n97[]={{sgu,.380},H}; -N l1n98[]={{sgY,.483},{sXw,.242},{sknmx,.230},H}; -N l1n99[]={{sabrg,.583},{ssvg,.181},{sgpi,.155},H}; -N l1n100[]={{sui,.115},{svc3abr,.161},H}; -N l1n101[]={{smrg,.621},{srmrg,.276},{sxmg,.181},{sgtvi,.207},H}; -N l1n102[]={{soX,.184},H}; -N l1n103[]={{sip,.081},H}; -N l1n104[]={{syq,.069},H}; -N l1n105[]={{sabx,.276},{sgzix,.345},{slXg,.207},H}; -N l1n107[]={{smx,.426},{sxs,.138},H}; -N l1n108[]={{smi,.069},H}; -N l1n112[]={{sYv,.104},H}; -N l1n113[]={{svw,.104},{sving,.207},H}; -N l1n114[]={{srg,.811},{sgv,.173},{sxXrm,.161},H}; -N l1n115[]={{sXx,.311},{sgZ,.173},{sps,.092},H}; -N l1n116[]={{sgqi,.751},H}; -N l1n117[]={{spzXg,.276},{sgtsg,.207},H}; -N l1n118[]={{sgryo,.276},H}; -N l1n119[]={{smqm,.173},H}; -N l1n121[]={{syr,.150},{stvi,.121},H}; -N l1n122[]={{sgrh,.466},{svc3abg,.587},H}; -N l1n123[]={{shs,.242},{sgtX,.518},H}; -N l1n125[]={{sxX,.253},H}; -N l1n126[]={{sgom,.388},{sgqc3,.311},H}; -N l1n127[]={{sqc3ab,.311},{sgqc3ab,.414},{sxlXg,.276},H}; -N l1n128[]={{sgknm,.242},H}; -N l1n130[]={{snc3abg,.759},{svx,.127},{syXv,.173},H}; -N l1n131[]={{sgw,1.450},{stc3,.483},{skn,.322},{svi,.276},H}; -N l1n132[]={{sgh,.690},H}; -N l1n133[]={{spX,.081},H}; -N l1n137[]={{sir,.380},{stm,.104},H}; -N l1n138[]={{swmp,.173},{snx,.092},H}; -N l1n139[]={{sni,.345},{slc3,.161},H}; -N l1n142[]={{sXns,.104},H}; -N l1n143[]={{sgrc3,.621},H}; -N l1n144[]={{sgrc3ab,.829},{sXrm,.121},H}; -N l1n145[]={{ssg,.552},{slm,.150},H}; -N l1n148[]={{sgx,1.916},H}; -N l1n149[]={{sgi,.898},{snsg,.311},H}; -N l1n150[]={{szc3ab,.121},H}; -N l1n153[]={{swc3abg,.311},H}; -N l1n155[]={{sgrk,.414},H}; -N l1n156[]={{syX,.173},{sc3abp,.233},H}; -N l1n157[]={{soc3abx,.253},H}; -N l1n158[]={{src3ab,.621},{sxv,.081},H}; -N l1n159[]={{svXg,.233},H}; -N l1n160[]={{soyv,.207},{sgqm,.285},H}; -N l1n161[]={{swx,.081},H}; -N l1n162[]={{swi,.242},{suc3,.196},{sqir,.173},{swlmr,.138},{sln,.069},H}; -N l1n163[]={{slxi,.535},H}; -N l1n164[]={{sqX,.081},H}; -N l1n165[]={{sing,.621},{sgy,.155},{svk,.092},H}; -N l1n166[]={{sgj,.311},{syog,.233},H}; -N l1n167[]={{sabvg,.932},{sc3abq,.311},H}; -N l1n170[]={{soi,.092},H}; -N l1n171[]={{srmg,.285},{slmrg,.207},H}; -N l1n172[]={{slxg,.181},H}; -N l1n173[]={{slig,.414},{slxc3,.104},H}; -N l1n174[]={{sxc3abv,.230},{sgwX,.207},{shv,.069},{slxc3ab,.138},H}; -N l1n176[]={{ssli,.173},{sryo,.138},H}; -N l1n177[]={{sgtc3,.880},{sXvg,.259},H}; -N l1n178[]={{sgtc3ab,1.174},{sc3abr,.893},H}; -N l1n180[]={{sc3a7,.466},{srkXg,.311},H}; -N l1n181[]={{sqY,.115},H}; -N l1n182[]={{sgz,.535},H}; -N l1n183[]={{sgk,.397},{sxyv,.121},{stvin,.138},H}; -N l1n184[]={{sxc3abg,3.383},{sabwg,.660},{sXm,.127},{slg,.138},{svmw,.104},H}; -N l1n186[]={{soy,.265},H}; -N l1n187[]={{shlig,.518},{szX,.115},{srhs,.173},{ssrx,.155},H}; -N l1n188[]={{sgrn,.466},H}; -N l1n189[]={{syv,.403},{srnc3,.380},{srxig,.449},{sxix,.138},H}; -N l1n190[]={{srnc3ab,.506},{sgrkX,.449},{sgqir,.242},H}; -N l1n191[]={{ssr,.253},{sgxX,.259},{s7am,.081},H}; -N l1n193[]={{sxi,.852},{svc3,.380},{smn,.081},H}; -N l1n194[]={{sguc3,.362},H}; -N l1n195[]={{sguc3ab,.483},{srX,.115},{sgYc3,.233},{svmx,.138},H}; -N l1n196[]={{sgYc3ab,.311},H}; -N l1n197[]={{syrh,.155},H}; -N l1n198[]={{soXg,.233},H}; -N l1n199[]={{svm,.541},{sgrhs,.276},H}; -N l1n200[]={{sgl,.259},H}; -N l1n201[]={{snc3,.322},{sXn,.207},{spi,.115},H}; -N l1n202[]={{sgmw,.311},{sabvm,.233},{sabxc3,.181},H}; -N l1n203[]={{smxg,.440},{snmx,.173},{sjX,.092},{sabxc3ab,.242},H}; -N l1n205[]={{siv,.288},H}; -N l1n206[]={{sqirh,.184},H}; -N l1n207[]={{snm,.150},{sug,.104},H}; -N l1n209[]={{swlx,.898},{sxy,.173},{sYc3,.127},{shi,.104},H}; -N l1n210[]={{smwl,.673},{smo,.196},H}; -N l1n211[]={{sgc3,.173},H}; -N l1n212[]={{sgqig,.621},{sXxc3,.224},{sgXm,.181},{sgtXw,.242},H}; -N l1n213[]={{sabg,5.541},{swl,1.024},{sirh,.242},{sXxc3ab,.299},H}; -N l1n215[]={{smg,1.346},{sgomw,.449},{sYm,.092},H}; -N l1n217[]={{sgm,.587},{smoy,.104},H}; -N l1n218[]={{sgwi,.259},{sXo,.104},H}; -N l1n219[]={{slin,.224},H}; -N l1n220[]={{stc3ab,.725},H}; -N l1n221[]={{sxXg,.285},H}; -N l1n222[]={{sc3abv,2.913},{siw,.242},H}; -N l1n223[]={{sXg,1.433},{somw,.259},{sqc3abg,.449},H}; -N l1n224[]={{swc3,.161},H}; -N l1n225[]={{shy,.081},{sabp,.104},H}; -N l1n226[]={{syXvg,.345},H}; -N l1n227[]={{smp,.196},{smxl,.155},H}; -N l1n228[]={{slc3ab,.190},{sgwc3,.155},H}; -N l1n229[]={{sknc3ab,.138},H}; -N l1n230[]={{swm,.276},H}; -N l1n231[]={{stXv,.121},H}; -N l1n232[]={{sqi,.472},{soc3,.265},H}; -N l1n233[]={{sc3abw,1.049},H}; -N l1n234[]={{skX,.161},{spz,.115},{sgn,.155},{ssrxi,.161},H}; -N l1n235[]={{sgxi,.285},{snig,.233},{sXp,.104},H}; -N l1n236[]={{swmpz,.230},H}; -N l1n238[]={{svg,1.105},{som,.219},{sslin,.207},H}; -N l1n239[]={{six,.495},{sts,.219},H}; -N l1n240[]={{sXrmg,.207},H}; -N l1n242[]={{sabq,.138},{stXw,.121},H}; -N l1n244[]={{sxl,.242},{smq,.219},{sc3abx,.621},H}; -N l1n245[]={{sgxc3,1.605},{sgig,1.269},{smpz,.173},H}; -N l1n246[]={{sgxc3ab,2.140},{srh,.529},{sng,.621},{sgqmv,.276},{sgZm,.155},{sZm,.069},H}; -N l1n248[]={{sc3ab,9.917},H}; -N l1n250[]={{sg7a,.138},H}; -N l1n251[]={{sgo,1.208},{sgwl,.621},{suc3ab,.293},{szix,.173},H}; -N l1n252[]={{sghl,.337},H}; -N l1n254[]={{src3abg,1.001},H}; -N l1n255[]={{sxc3,1.369},{szi,.230},H}; - -D l1_d = -{ +S sc3ab[] = { 195, 171, 0 }; +S sc3abg[] = { 195, 171, a }; +S sabg[] = { 171, a }; +S sxc3[] = { t, 195, 0 }; +S sxc3ab[] = { t, 195, 171, 0 }; +S sxc3abg[] = { t, 195, 171, a }; +S swl[] = { s, h, 0 }; +S smg[] = { i, a }; +S sabv[] = { 171, r, 0 }; +S sc3abv[] = { 195, 171, r, 0 }; +S sgxc3[] = { 32, t, 195, 0 }; +S sgxc3ab[] = { 32, t, 195, 171, 0 }; +S slx[] = { h, t, 0 }; +S swlx[] = { s, h, t, 0 }; +S sgig[] = { 32, e, a }; +S stc3[] = { p, 195, 0 }; +S stc3ab[] = { p, 195, 171, 0 }; +S stc3abv[] = { p, 195, 171, r, 0 }; +S smwl[] = { i, s, h, 0 }; +S src3ab[] = { n, 195, 171, 0 }; +S src3[] = { n, 195, 0 }; +S sng[] = { j, a }; +S sgtc3[] = { 32, p, 195, 0 }; +S sgtc3ab[] = { 32, p, 195, 171, 0 }; +S svc3[] = { r, 195, 0 }; +S ssg[] = { o, a }; +S smwlx[] = { i, s, h, t, 0 }; +S svc3ab[] = { r, 195, 171, 0 }; +S slxi[] = { h, t, e, 0 }; +S sni[] = { j, e, 0 }; +S swlxi[] = { s, h, t, e, 0 }; +S src3abg[] = { n, 195, 171, a }; +S shl[] = { d, h, 0 }; +S snc3[] = { j, 195, 0 }; +S snc3ab[] = { j, 195, 171, 0 }; +S skn[] = { g, j, 0 }; +S sin[] = { e, j, 0 }; +S sc3abw[] = { 195, 171, s, 0 }; +S sabw[] = { 171, s, 0 }; +S srn[] = { n, j, 0 }; +S slxig[] = { h, t, e, a }; +S sqm[] = { m, i, 0 }; +S sing[] = { e, j, a }; +S sc3abvg[] = { 195, 171, r, a }; +S sabvg[] = { 171, r, a }; +S sgrc3ab[] = { 32, n, 195, 171, 0 }; +S sgrc3[] = { 32, n, 195, 0 }; +S sgwl[] = { 32, s, h, 0 }; +S sabr[] = { 171, n, 0 }; +S soc3ab[] = { k, 195, 171, 0 }; +S soy[] = { k, u, 0 }; +S sc3abr[] = { 195, 171, n, 0 }; +S soc3[] = { k, 195, 0 }; +S srnc3[] = { n, j, 195, 0 }; +S srnc3ab[] = { n, j, 195, 171, 0 }; +S sgu[] = { 32, q, 0 }; +S sqig[] = { m, e, a }; +S snc3abg[] = { j, 195, 171, a }; +S sgwm[] = { 32, s, i, 0 }; +S sxl[] = { t, h, 0 }; +S syvg[] = { u, r, a }; +S sgtX[] = { 32, p, 97, 0 }; +S som[] = { k, i, 0 }; +S swig[] = { s, e, a }; +S smq[] = { i, m, 0 }; +S sts[] = { p, o, 0 }; +S sqc3[] = { m, 195, 0 }; +S snX[] = { j, 97, 0 }; +S sqc3ab[] = { m, 195, 171, 0 }; +S sgqig[] = { 32, m, e, a }; +S sXn[] = { 97, j, 0 }; +S sgrh[] = { 32, n, d, 0 }; +S sgj[] = { 32, f, 0 }; +S sgrn[] = { 32, n, j, 0 }; +S sc3a7[] = { 195, 167, 0 }; +S sabwg[] = { 171, s, a }; +S sc3abwg[] = { 195, 171, s, a }; +S svc3abg[] = { r, 195, 171, a }; +S suc3ab[] = { q, 195, 171, 0 }; +S suc3[] = { q, 195, 0 }; +S sgmg[] = { 32, i, a }; +S sc3abx[] = { 195, 171, t, 0 }; +S sixc3ab[] = { e, t, 195, 171, 0 }; +S sixc3[] = { e, t, 195, 0 }; +S sabx[] = { 171, t, 0 }; +S sgrnc3[] = { 32, n, j, 195, 0 }; +S suc3abg[] = { q, 195, 171, a }; +S sgrk[] = { 32, n, g, 0 }; +S sgkn[] = { 32, g, j, 0 }; +S shli[] = { d, h, e, 0 }; +S slig[] = { h, e, a }; +S somw[] = { k, i, s, 0 }; +S sgom[] = { 32, k, i, 0 }; +S syX[] = { u, 97, 0 }; +S shlig[] = { d, h, e, a }; +S sabrg[] = { 171, n, a }; +S sc3abrg[] = { 195, 171, n, a }; +S svv[] = { r, r, 0 }; +S sxy[] = { t, u, 0 }; +S sgoc3[] = { 32, k, 195, 0 }; +S swc3[] = { s, 195, 0 }; +S sguc3[] = { 32, q, 195, 0 }; +S ssl[] = { o, h, 0 }; +S sgoc3ab[] = { 32, k, 195, 171, 0 }; +S sguc3ab[] = { 32, q, 195, 171, 0 }; +S somwl[] = { k, i, s, h, 0 }; +S swc3ab[] = { s, 195, 171, 0 }; +S slc3[] = { h, 195, 0 }; +S snm[] = { j, i, 0 }; +S sghl[] = { 32, d, h, 0 }; +S srkX[] = { n, g, 97, 0 }; +S sgoy[] = { 32, k, u, 0 }; +S sqc3abg[] = { m, 195, 171, a }; +S sgrkX[] = { 32, n, g, 97, 0 }; +S sXxc3[] = { 97, t, 195, 0 }; +S srxig[] = { n, t, e, a }; +S sgomw[] = { 32, k, i, s, 0 }; +S sXxc3ab[] = { 97, t, 195, 171, 0 }; +S syr[] = { u, n, 0 }; +S slin[] = { h, e, j, 0 }; +S srxi[] = { n, t, e, 0 }; +S sling[] = { h, e, j, a }; +S sns[] = { j, o, 0 }; +S sgmwl[] = { 32, i, s, h, 0 }; +S svmg[] = { r, i, a }; +S soyv[] = { k, u, r, 0 }; +S sgqc3ab[] = { 32, m, 195, 171, 0 }; +S sghli[] = { 32, d, h, e, 0 }; +S sgqc3[] = { 32, m, 195, 0 }; +S snsg[] = { j, o, a }; +S sxXg[] = { t, 97, a }; +S sgts[] = { 32, p, o, 0 }; +S sknm[] = { g, j, i, 0 }; +S soc3abx[] = { k, 195, 171, t, 0 }; +S swlm[] = { s, h, i, 0 }; +S spc3ab[] = { l, 195, 171, 0 }; +S sYc3[] = { 98, 195, 0 }; +S sXm[] = { 97, i, 0 }; +S sXt[] = { 97, p, 0 }; +S sly[] = { h, u, 0 }; +S sYc3ab[] = { 98, 195, 171, 0 }; +S syo[] = { u, k, 0 }; +S spc3[] = { l, 195, 0 }; +S sgqm[] = { 32, m, i, 0 }; +S swX[] = { s, 97, 0 }; +S srmg[] = { n, i, a }; +S slc3ab[] = { h, 195, 171, 0 }; +S sgzix[] = { 32, v, e, t, 0 }; +S sgwmp[] = { 32, s, i, l, 0 }; +S sxc3abv[] = { t, 195, 171, r, 0 }; +S sknmx[] = { g, j, i, t, 0 }; +S syXvg[] = { u, 97, r, a }; +S sgc3[] = { 32, 195, 0 }; +S syXv[] = { u, 97, r, 0 }; +S srhs[] = { n, d, o, 0 }; +S sgxl[] = { 32, t, h, 0 }; +S sxlX[] = { t, h, 97, 0 }; +S spz[] = { l, v, 0 }; +S swmp[] = { s, i, l, 0 }; +S sui[] = { q, e, 0 }; +S szix[] = { v, e, t, 0 }; +S sgZ[] = { 32, 99, 0 }; +S ssli[] = { o, h, e, 0 }; +S smpz[] = { i, l, v, 0 }; +S smqm[] = { i, m, i, 0 }; +S sqmv[] = { m, i, r, 0 }; +S sqY[] = { m, 98, 0 }; +S sgxX[] = { 32, t, 97, 0 }; +S snmx[] = { j, i, t, 0 }; +S swmpz[] = { s, i, l, v, 0 }; +S stsg[] = { p, o, a }; +S sgxlX[] = { 32, t, h, 97, 0 }; +S syog[] = { u, k, a }; +S swc3abg[] = { s, 195, 171, a }; +S sc3abvm[] = { 195, 171, r, i, 0 }; +S stm[] = { p, i, 0 }; +S smxl[] = { i, t, h, 0 }; +S sgoX[] = { 32, k, 97, 0 }; +S sky[] = { g, u, 0 }; +S sgoyv[] = { 32, k, u, r, 0 }; +S sgry[] = { 32, n, u, 0 }; +S sslin[] = { o, h, e, j, 0 }; +S snmxl[] = { j, i, t, h, 0 }; +S snig[] = { j, e, a }; +S syrh[] = { u, n, d, 0 }; +S sgwig[] = { 32, s, e, a }; +S sry[] = { n, u, 0 }; +S soXg[] = { k, 97, a }; +S sgYc3ab[] = { 32, 98, 195, 171, 0 }; +S ssrx[] = { o, n, t, 0 }; +S skXg[] = { g, 97, a }; +S sabvm[] = { 171, r, i, 0 }; +S srkXg[] = { n, g, 97, a }; +S svXg[] = { r, 97, a }; +S sgYc3[] = { 32, 98, 195, 0 }; +S szXg[] = { v, 97, a }; +S sgwX[] = { 32, s, 97, 0 }; +S spzXg[] = { l, v, 97, a }; +S sqirh[] = { m, e, n, d, 0 }; +S smpzX[] = { i, l, v, 97, 0 }; +S sc3abq[] = { 195, 171, m, 0 }; +S svmx[] = { r, i, t, 0 }; +S sryog[] = { n, u, k, a }; +S slg[] = { h, a }; +S snx[] = { j, t, 0 }; +S sgrhs[] = { 32, n, d, o, 0 }; +S sjX[] = { f, 97, 0 }; +S sYm[] = { 98, i, 0 }; +S srmrg[] = { n, i, n, a }; +S spzX[] = { l, v, 97, 0 }; +S sg7a[] = { 32, z, 0 }; +S svk[] = { r, g, 0 }; +S sgryo[] = { 32, n, u, k, 0 }; +S sgqmv[] = { 32, m, i, r, 0 }; +S sryo[] = { n, u, k, 0 }; +S ssrm[] = { o, n, i, 0 }; +S slXg[] = { h, 97, a }; +S sxix[] = { t, e, t, 0 }; +S svq[] = { r, m, 0 }; +S sxlXg[] = { t, h, 97, a }; +S sabq[] = { 171, m, 0 }; +S sxXr[] = { t, 97, n, 0 }; +S svin[] = { r, e, j, 0 }; +S srmr[] = { n, i, n, 0 }; +S slxg[] = { h, t, a }; +S ssrxi[] = { o, n, t, e, 0 }; +S sghs[] = { 32, d, o, 0 }; +S srXg[] = { n, 97, a }; +S smn[] = { i, j, 0 }; +S sxyv[] = { t, u, r, 0 }; +S sgXm[] = { 32, 97, i, 0 }; +S stvi[] = { p, r, e, 0 }; +S sgtXw[] = { 32, p, 97, s, 0 }; +S szc3ab[] = { v, 195, 171, 0 }; +S sivc3[] = { e, r, 195, 0 }; +S sXmg[] = { 97, i, a }; +S sabxc3[] = { 171, t, 195, 0 }; +S sgqir[] = { 32, m, e, n, 0 }; +S stXv[] = { p, 97, r, 0 }; +S shy[] = { d, u, 0 }; +S sxmg[] = { t, i, a }; +S swlxg[] = { s, h, t, a }; +S sgc3a7[] = { 32, 195, 167, 0 }; +S sgXmg[] = { 32, 97, i, a }; +S sxv[] = { t, r, 0 }; +S siwl[] = { e, s, h, 0 }; +S ssvg[] = { o, r, a }; +S svc3abr[] = { r, 195, 171, n, 0 }; +S s7am[] = { z, i, 0 }; +S sgwlx[] = { 32, s, h, t, 0 }; +S soyvg[] = { k, u, r, a }; +S sXrm[] = { 97, n, i, 0 }; +S sabxc3ab[] = { 171, t, 195, 171, 0 }; +S szc3[] = { v, 195, 0 }; +S sxXrm[] = { t, 97, n, i, 0 }; +S sgknm[] = { 32, g, j, i, 0 }; +S sgXx[] = { 32, 97, t, 0 }; +S stXw[] = { p, 97, s, 0 }; +S sXu[] = { 97, q, 0 }; +S sivc3ab[] = { e, r, 195, 171, 0 }; +S sc3abxc3[] = { 195, 171, t, 195, 0 }; +S sgxXr[] = { 32, t, 97, n, 0 }; +S swlmr[] = { s, h, i, n, 0 }; +S sXns[] = { 97, j, o, 0 }; +S sgqY[] = { 32, m, 98, 0 }; +S sgtvi[] = { 32, p, r, e, 0 }; +S sgpi[] = { 32, l, e, 0 }; +S svmw[] = { r, i, s, 0 }; +S sc3abp[] = { 195, 171, l, 0 }; +S slxc3[] = { h, t, 195, 0 }; +S syq[] = { u, m, 0 }; +S sgtsg[] = { 32, p, o, a }; +S sknc3ab[] = { g, j, 195, 171, 0 }; +S sXrmg[] = { 97, n, i, a }; +S s79v[] = { y, r, 0 }; +S slmrg[] = { h, i, n, a }; +S sgZm[] = { 32, 99, i, 0 }; +S sgYv[] = { 32, 98, r, 0 }; +S sxn[] = { t, j, 0 }; +S sving[] = { r, e, j, a }; +S sgwc3[] = { 32, s, 195, 0 }; +S sabp[] = { 171, l, 0 }; +S sug[] = { q, a }; +S sxlc3[] = { t, h, 195, 0 }; +S si7a[] = { e, z, 0 }; +S sgXns[] = { 32, 97, j, o, 0 }; +S smoy[] = { i, k, u, 0 }; +S slxc3ab[] = { h, t, 195, 171, 0 }; +S sln[] = { h, j, 0 }; +S stvin[] = { p, r, e, j, 0 }; +S sZm[] = { 99, i, 0 }; + +N l1n0[] = { { swlxi, .690 }, { sgc3a7, .181 }, { soyvg, .242 }, H }; +N l1n1[] = { { stX, .253 }, H }; +N l1n2[] = { { swig, .492 }, { sgoy, .337 }, { sgmwl, .414 }, H }; +N l1n3[] = { { slxig, .898 }, { sabr, .397 }, { ssv, .184 }, { snmxl, .207 }, H }; +N l1n4[] = { { shl, .334 }, H }; +N l1n5[] = { { smr, .391 }, { sxm, .265 }, { sgrnc3, .552 }, { srmr, .138 }, H }; +N l1n6[] = { { sgwm, .544 }, { srx, .207 }, { sknm, .190 }, H }; +N l1n7[] = { { spc3, .127 }, H }; +N l1n9[] = { { slX, .173 }, { sgxXr, .242 }, H }; +N l1n11[] = { { svq, .092 }, H }; +N l1n12[] = { { sgp, .311 }, { sgxl, .259 }, H }; +N l1n13[] = { { swg, .483 }, { sXr, .230 }, { sgzi, .414 }, { spm, .150 }, H }; +N l1n16[] = { { sryog, .276 }, H }; +N l1n17[] = { { svin, .138 }, H }; +N l1n18[] = { { sc3abrg, 1.165 }, { sqmv, .173 }, { sik, .081 }, H }; +N l1n21[] = { { sog, .242 }, { shm, .161 }, { sgts, .285 }, { spzX, .138 }, H }; +N l1n22[] = { { sxn, .069 }, H }; +N l1n23[] = { { somwl, .322 }, { sry, .104 }, H }; +N l1n24[] = { { smpzX, .184 }, { sXmg, .181 }, H }; +N l1n25[] = { { sc3abvm, .466 }, H }; +N l1n26[] = { { svc3ab, .552 }, H }; +N l1n27[] = { { szXg, .207 }, H }; +N l1n29[] = { { sgq, 1.208 }, { syvg, .544 }, H }; +N l1n31[] = { { sxlX, .173 }, H }; +N l1n33[] = { { sxig, 1.398 }, H }; +N l1n34[] = { { snc3ab, .483 }, { stv, .161 }, H }; +N l1n35[] = { { srXg, .181 }, H }; +N l1n37[] = { { ssx, .081 }, H }; +N l1n38[] = { { sqc3, .207 }, { sgoX, .233 }, H }; +N l1n39[] = { { svmg, .311 }, H }; +N l1n41[] = { { srk, .230 }, H }; +N l1n42[] = { { sYc3ab, .190 }, H }; +N l1n43[] = { { sghli, .414 }, H }; +N l1n44[] = { { sxg, .846 }, { sqm, .288 }, { sgXns, .207 }, H }; +N l1n45[] = { { svs, .104 }, H }; +N l1n46[] = { { sgr, 1.588 }, { smwlx, .736 }, { sivc3, .121 }, H }; +N l1n47[] = { { sXt, .127 }, { sgxlX, .311 }, { sivc3ab, .161 }, H }; +N l1n49[] = { { swlxg, .242 }, H }; +N l1n50[] = { { stc3abv, .944 }, H }; +N l1n52[] = { { sgXmg, .242 }, H }; +N l1n53[] = { { sns, .138 }, { sgry, .233 }, H }; +N l1n54[] = { { sgtv, .285 }, H }; +N l1n55[] = { { sxXr, .138 }, H }; +N l1n57[] = { { sgmg, .440 }, { swc3ab, .242 }, { s79v, .069 }, H }; +N l1n58[] = { { sgwig, .311 }, H }; +N l1n59[] = { { sling, .449 }, H }; +N l1n60[] = { { shg, .190 }, H }; +N l1n61[] = { { szc3, .081 }, { sc3abxc3, .362 }, H }; +N l1n62[] = { { sc3abvg, 1.864 }, { sky, .104 }, H }; +N l1n63[] = { { svX, .276 }, H }; +N l1n64[] = { { spp, .207 }, { sXu, .081 }, H }; +N l1n65[] = { { soc3ab, .397 }, H }; +N l1n66[] = { { ssrm, .138 }, { sgXw, .181 }, H }; +N l1n69[] = { { src3, .414 }, { sin, .322 }, { sgkn, .414 }, H }; +N l1n70[] = { { syo, .127 }, H }; +N l1n71[] = { { sabv, 1.295 }, { snX, .207 }, H }; +N l1n72[] = { { sqig, .570 }, { sgYv, .155 }, H }; +N l1n73[] = { { sc3abwg, 1.320 }, { smv, .115 }, { sghs, .181 }, H }; +N l1n74[] = { { sgwmp, .345 }, { skXg, .233 }, H }; +N l1n75[] = { { syg, .449 }, { srm, .253 }, H }; +N l1n76[] = { { slx, .621 }, H }; +N l1n77[] = { { sli, .518 }, { sgXx, .181 }, H }; +N l1n79[] = { { sixg, .285 }, { stsg, .259 }, H }; +N l1n80[] = { { sgt, 1.502 }, { sixc3, .276 }, H }; +N l1n81[] = { { sgX, .777 }, { sXv, .403 }, { sixc3ab, .368 }, H }; +N l1n83[] = { { sqg, .190 }, { sgqY, .155 }, H }; +N l1n84[] = { { sos, .150 }, { srkX, .224 }, H }; +N l1n85[] = { { sxlc3, .104 }, { si7a, .069 }, H }; +N l1n86[] = { { srhg, .285 }, { siwl, .121 }, H }; +N l1n87[] = { { syp, .115 }, { sgwlx, .242 }, H }; +N l1n88[] = { { sc3abg, 12.467 }, { sxc3ab, 2.054 }, { sabw, .466 }, { swlm, .190 }, { sgoyv, .311 }, H }; +N l1n89[] = { { ssl, .161 }, H }; +N l1n90[] = { { smw, .564 }, H }; +N l1n91[] = { { sig, 3.142 }, { suc3abg, .552 }, { shli, .276 }, { smh, .092 }, H }; +N l1n92[] = { { srn, .311 }, { sgoc3, .362 }, H }; +N l1n93[] = { { sgoc3ab, .483 }, { srxi, .224 }, { sly, .127 }, H }; +N l1n94[] = { { swX, .127 }, H }; +N l1n96[] = { { svv, .173 }, { spc3ab, .190 }, H }; +N l1n97[] = { { sgu, .380 }, H }; +N l1n98[] = { { sgY, .483 }, { sXw, .242 }, { sknmx, .230 }, H }; +N l1n99[] = { { sabrg, .583 }, { ssvg, .181 }, { sgpi, .155 }, H }; +N l1n100[] = { { sui, .115 }, { svc3abr, .161 }, H }; +N l1n101[] = { { smrg, .621 }, { srmrg, .276 }, { sxmg, .181 }, { sgtvi, .207 }, H }; +N l1n102[] = { { soX, .184 }, H }; +N l1n103[] = { { sip, .081 }, H }; +N l1n104[] = { { syq, .069 }, H }; +N l1n105[] = { { sabx, .276 }, { sgzix, .345 }, { slXg, .207 }, H }; +N l1n107[] = { { smx, .426 }, { sxs, .138 }, H }; +N l1n108[] = { { smi, .069 }, H }; +N l1n112[] = { { sYv, .104 }, H }; +N l1n113[] = { { svw, .104 }, { sving, .207 }, H }; +N l1n114[] = { { srg, .811 }, { sgv, .173 }, { sxXrm, .161 }, H }; +N l1n115[] = { { sXx, .311 }, { sgZ, .173 }, { sps, .092 }, H }; +N l1n116[] = { { sgqi, .751 }, H }; +N l1n117[] = { { spzXg, .276 }, { sgtsg, .207 }, H }; +N l1n118[] = { { sgryo, .276 }, H }; +N l1n119[] = { { smqm, .173 }, H }; +N l1n121[] = { { syr, .150 }, { stvi, .121 }, H }; +N l1n122[] = { { sgrh, .466 }, { svc3abg, .587 }, H }; +N l1n123[] = { { shs, .242 }, { sgtX, .518 }, H }; +N l1n125[] = { { sxX, .253 }, H }; +N l1n126[] = { { sgom, .388 }, { sgqc3, .311 }, H }; +N l1n127[] = { { sqc3ab, .311 }, { sgqc3ab, .414 }, { sxlXg, .276 }, H }; +N l1n128[] = { { sgknm, .242 }, H }; +N l1n130[] = { { snc3abg, .759 }, { svx, .127 }, { syXv, .173 }, H }; +N l1n131[] = { { sgw, 1.450 }, { stc3, .483 }, { skn, .322 }, { svi, .276 }, H }; +N l1n132[] = { { sgh, .690 }, H }; +N l1n133[] = { { spX, .081 }, H }; +N l1n137[] = { { sir, .380 }, { stm, .104 }, H }; +N l1n138[] = { { swmp, .173 }, { snx, .092 }, H }; +N l1n139[] = { { sni, .345 }, { slc3, .161 }, H }; +N l1n142[] = { { sXns, .104 }, H }; +N l1n143[] = { { sgrc3, .621 }, H }; +N l1n144[] = { { sgrc3ab, .829 }, { sXrm, .121 }, H }; +N l1n145[] = { { ssg, .552 }, { slm, .150 }, H }; +N l1n148[] = { { sgx, 1.916 }, H }; +N l1n149[] = { { sgi, .898 }, { snsg, .311 }, H }; +N l1n150[] = { { szc3ab, .121 }, H }; +N l1n153[] = { { swc3abg, .311 }, H }; +N l1n155[] = { { sgrk, .414 }, H }; +N l1n156[] = { { syX, .173 }, { sc3abp, .233 }, H }; +N l1n157[] = { { soc3abx, .253 }, H }; +N l1n158[] = { { src3ab, .621 }, { sxv, .081 }, H }; +N l1n159[] = { { svXg, .233 }, H }; +N l1n160[] = { { soyv, .207 }, { sgqm, .285 }, H }; +N l1n161[] = { { swx, .081 }, H }; +N l1n162[] = { { swi, .242 }, { suc3, .196 }, { sqir, .173 }, { swlmr, .138 }, { sln, .069 }, H }; +N l1n163[] = { { slxi, .535 }, H }; +N l1n164[] = { { sqX, .081 }, H }; +N l1n165[] = { { sing, .621 }, { sgy, .155 }, { svk, .092 }, H }; +N l1n166[] = { { sgj, .311 }, { syog, .233 }, H }; +N l1n167[] = { { sabvg, .932 }, { sc3abq, .311 }, H }; +N l1n170[] = { { soi, .092 }, H }; +N l1n171[] = { { srmg, .285 }, { slmrg, .207 }, H }; +N l1n172[] = { { slxg, .181 }, H }; +N l1n173[] = { { slig, .414 }, { slxc3, .104 }, H }; +N l1n174[] = { { sxc3abv, .230 }, { sgwX, .207 }, { shv, .069 }, { slxc3ab, .138 }, H }; +N l1n176[] = { { ssli, .173 }, { sryo, .138 }, H }; +N l1n177[] = { { sgtc3, .880 }, { sXvg, .259 }, H }; +N l1n178[] = { { sgtc3ab, 1.174 }, { sc3abr, .893 }, H }; +N l1n180[] = { { sc3a7, .466 }, { srkXg, .311 }, H }; +N l1n181[] = { { sqY, .115 }, H }; +N l1n182[] = { { sgz, .535 }, H }; +N l1n183[] = { { sgk, .397 }, { sxyv, .121 }, { stvin, .138 }, H }; +N l1n184[] = { { sxc3abg, 3.383 }, { sabwg, .660 }, { sXm, .127 }, { slg, .138 }, { svmw, .104 }, H }; +N l1n186[] = { { soy, .265 }, H }; +N l1n187[] = { { shlig, .518 }, { szX, .115 }, { srhs, .173 }, { ssrx, .155 }, H }; +N l1n188[] = { { sgrn, .466 }, H }; +N l1n189[] = { { syv, .403 }, { srnc3, .380 }, { srxig, .449 }, { sxix, .138 }, H }; +N l1n190[] = { { srnc3ab, .506 }, { sgrkX, .449 }, { sgqir, .242 }, H }; +N l1n191[] = { { ssr, .253 }, { sgxX, .259 }, { s7am, .081 }, H }; +N l1n193[] = { { sxi, .852 }, { svc3, .380 }, { smn, .081 }, H }; +N l1n194[] = { { sguc3, .362 }, H }; +N l1n195[] = { { sguc3ab, .483 }, { srX, .115 }, { sgYc3, .233 }, { svmx, .138 }, H }; +N l1n196[] = { { sgYc3ab, .311 }, H }; +N l1n197[] = { { syrh, .155 }, H }; +N l1n198[] = { { soXg, .233 }, H }; +N l1n199[] = { { svm, .541 }, { sgrhs, .276 }, H }; +N l1n200[] = { { sgl, .259 }, H }; +N l1n201[] = { { snc3, .322 }, { sXn, .207 }, { spi, .115 }, H }; +N l1n202[] = { { sgmw, .311 }, { sabvm, .233 }, { sabxc3, .181 }, H }; +N l1n203[] = { { smxg, .440 }, { snmx, .173 }, { sjX, .092 }, { sabxc3ab, .242 }, H }; +N l1n205[] = { { siv, .288 }, H }; +N l1n206[] = { { sqirh, .184 }, H }; +N l1n207[] = { { snm, .150 }, { sug, .104 }, H }; +N l1n209[] = { { swlx, .898 }, { sxy, .173 }, { sYc3, .127 }, { shi, .104 }, H }; +N l1n210[] = { { smwl, .673 }, { smo, .196 }, H }; +N l1n211[] = { { sgc3, .173 }, H }; +N l1n212[] = { { sgqig, .621 }, { sXxc3, .224 }, { sgXm, .181 }, { sgtXw, .242 }, H }; +N l1n213[] = { { sabg, 5.541 }, { swl, 1.024 }, { sirh, .242 }, { sXxc3ab, .299 }, H }; +N l1n215[] = { { smg, 1.346 }, { sgomw, .449 }, { sYm, .092 }, H }; +N l1n217[] = { { sgm, .587 }, { smoy, .104 }, H }; +N l1n218[] = { { sgwi, .259 }, { sXo, .104 }, H }; +N l1n219[] = { { slin, .224 }, H }; +N l1n220[] = { { stc3ab, .725 }, H }; +N l1n221[] = { { sxXg, .285 }, H }; +N l1n222[] = { { sc3abv, 2.913 }, { siw, .242 }, H }; +N l1n223[] = { { sXg, 1.433 }, { somw, .259 }, { sqc3abg, .449 }, H }; +N l1n224[] = { { swc3, .161 }, H }; +N l1n225[] = { { shy, .081 }, { sabp, .104 }, H }; +N l1n226[] = { { syXvg, .345 }, H }; +N l1n227[] = { { smp, .196 }, { smxl, .155 }, H }; +N l1n228[] = { { slc3ab, .190 }, { sgwc3, .155 }, H }; +N l1n229[] = { { sknc3ab, .138 }, H }; +N l1n230[] = { { swm, .276 }, H }; +N l1n231[] = { { stXv, .121 }, H }; +N l1n232[] = { { sqi, .472 }, { soc3, .265 }, H }; +N l1n233[] = { { sc3abw, 1.049 }, H }; +N l1n234[] = { { skX, .161 }, { spz, .115 }, { sgn, .155 }, { ssrxi, .161 }, H }; +N l1n235[] = { { sgxi, .285 }, { snig, .233 }, { sXp, .104 }, H }; +N l1n236[] = { { swmpz, .230 }, H }; +N l1n238[] = { { svg, 1.105 }, { som, .219 }, { sslin, .207 }, H }; +N l1n239[] = { { six, .495 }, { sts, .219 }, H }; +N l1n240[] = { { sXrmg, .207 }, H }; +N l1n242[] = { { sabq, .138 }, { stXw, .121 }, H }; +N l1n244[] = { { sxl, .242 }, { smq, .219 }, { sc3abx, .621 }, H }; +N l1n245[] = { { sgxc3, 1.605 }, { sgig, 1.269 }, { smpz, .173 }, H }; +N l1n246[] = { { sgxc3ab, 2.140 }, { srh, .529 }, { sng, .621 }, { sgqmv, .276 }, { sgZm, .155 }, { sZm, .069 }, H }; +N l1n248[] = { { sc3ab, 9.917 }, H }; +N l1n250[] = { { sg7a, .138 }, H }; +N l1n251[] = { { sgo, 1.208 }, { sgwl, .621 }, { suc3ab, .293 }, { szix, .173 }, H }; +N l1n252[] = { { sghl, .337 }, H }; +N l1n254[] = { { src3abg, 1.001 }, H }; +N l1n255[] = { { sxc3, 1.369 }, { szi, .230 }, H }; + +D l1_d = { "albanian", "utf8", - { - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,0.005,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,0.123,0.019,0.006,0.053,0.174,0.013,0.031,0.086,0.142,0.073,0.060,0.041,0.058,0.112,0.057, - 0.055,0.019,0.128,0.104,0.164,0.060,0.021,0.000,0.002,0.009,0.014,W,W,W,W,W, - Y,Y,Y,Y,Y,Y,Y,0.001,Y,Y,Y,Y,Y,Y,Y,Y, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - Y,Y,Y,Y,Y,Y,Y,0.012,Y,Y,Y,0.264,Y,Y,Y,Y, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - Y,V,V,0.416,V,V,V,V,V,V,V,V,V,V,V,V, - V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V, - V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V, - V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V - }, - { - l1n0,l1n1,l1n2,l1n3,l1n4,l1n5,l1n6,l1n7,X,l1n9,X,l1n11,l1n12,l1n13,X,X, - l1n16,l1n17,l1n18,X,X,l1n21,l1n22,l1n23,l1n24,l1n25,l1n26,l1n27,X,l1n29,X,l1n31, - X,l1n33,l1n34,l1n35,X,l1n37,l1n38,l1n39,X,l1n41,l1n42,l1n43,l1n44,l1n45,l1n46,l1n47, - X,l1n49,l1n50,X,l1n52,l1n53,l1n54,l1n55,X,l1n57,l1n58,l1n59,l1n60,l1n61,l1n62,l1n63, - l1n64,l1n65,l1n66,X,X,l1n69,l1n70,l1n71,l1n72,l1n73,l1n74,l1n75,l1n76,l1n77,X,l1n79, - l1n80,l1n81,X,l1n83,l1n84,l1n85,l1n86,l1n87,l1n88,l1n89,l1n90,l1n91,l1n92,l1n93,l1n94,X, - l1n96,l1n97,l1n98,l1n99,l1n100,l1n101,l1n102,l1n103,l1n104,l1n105,X,l1n107,l1n108,X,X,X, - l1n112,l1n113,l1n114,l1n115,l1n116,l1n117,l1n118,l1n119,X,l1n121,l1n122,l1n123,X,l1n125,l1n126,l1n127, - l1n128,X,l1n130,l1n131,l1n132,l1n133,X,X,X,l1n137,l1n138,l1n139,X,X,l1n142,l1n143, - l1n144,l1n145,X,X,l1n148,l1n149,l1n150,X,X,l1n153,X,l1n155,l1n156,l1n157,l1n158,l1n159, - l1n160,l1n161,l1n162,l1n163,l1n164,l1n165,l1n166,l1n167,X,X,l1n170,l1n171,l1n172,l1n173,l1n174,X, - l1n176,l1n177,l1n178,X,l1n180,l1n181,l1n182,l1n183,l1n184,X,l1n186,l1n187,l1n188,l1n189,l1n190,l1n191, - X,l1n193,l1n194,l1n195,l1n196,l1n197,l1n198,l1n199,l1n200,l1n201,l1n202,l1n203,X,l1n205,l1n206,l1n207, - X,l1n209,l1n210,l1n211,l1n212,l1n213,X,l1n215,X,l1n217,l1n218,l1n219,l1n220,l1n221,l1n222,l1n223, - l1n224,l1n225,l1n226,l1n227,l1n228,l1n229,l1n230,l1n231,l1n232,l1n233,l1n234,l1n235,l1n236,X,l1n238,l1n239, - l1n240,X,l1n242,X,l1n244,l1n245,l1n246,X,l1n248,X,l1n250,l1n251,l1n252,X,l1n254,l1n255 - } + { W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, 0.005, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, 0.123, 0.019, 0.006, 0.053, 0.174, 0.013, 0.031, 0.086, 0.142, 0.073, 0.060, 0.041, 0.058, 0.112, 0.057, + 0.055, 0.019, 0.128, 0.104, 0.164, 0.060, 0.021, 0.000, 0.002, 0.009, 0.014, W, W, W, W, W, + Y, Y, Y, Y, Y, Y, Y, 0.001, Y, Y, Y, Y, Y, Y, Y, Y, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + Y, Y, Y, Y, Y, Y, Y, 0.012, Y, Y, Y, 0.264, Y, Y, Y, Y, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + Y, V, V, 0.416, V, V, V, V, V, V, V, V, V, V, V, V, + V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, + V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, + V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, V }, + { l1n0, l1n1, l1n2, l1n3, l1n4, l1n5, l1n6, l1n7, X, l1n9, X, l1n11, l1n12, l1n13, X, X, + l1n16, l1n17, l1n18, X, X, l1n21, l1n22, l1n23, l1n24, l1n25, l1n26, l1n27, X, l1n29, X, l1n31, + X, l1n33, l1n34, l1n35, X, l1n37, l1n38, l1n39, X, l1n41, l1n42, l1n43, l1n44, l1n45, l1n46, l1n47, + X, l1n49, l1n50, X, l1n52, l1n53, l1n54, l1n55, X, l1n57, l1n58, l1n59, l1n60, l1n61, l1n62, l1n63, + l1n64, l1n65, l1n66, X, X, l1n69, l1n70, l1n71, l1n72, l1n73, l1n74, l1n75, l1n76, l1n77, X, l1n79, + l1n80, l1n81, X, l1n83, l1n84, l1n85, l1n86, l1n87, l1n88, l1n89, l1n90, l1n91, l1n92, l1n93, l1n94, X, + l1n96, l1n97, l1n98, l1n99, l1n100, l1n101, l1n102, l1n103, l1n104, l1n105, X, l1n107, l1n108, X, X, X, + l1n112, l1n113, l1n114, l1n115, l1n116, l1n117, l1n118, l1n119, X, l1n121, l1n122, l1n123, X, l1n125, l1n126, l1n127, + l1n128, X, l1n130, l1n131, l1n132, l1n133, X, X, X, l1n137, l1n138, l1n139, X, X, l1n142, l1n143, + l1n144, l1n145, X, X, l1n148, l1n149, l1n150, X, X, l1n153, X, l1n155, l1n156, l1n157, l1n158, l1n159, + l1n160, l1n161, l1n162, l1n163, l1n164, l1n165, l1n166, l1n167, X, X, l1n170, l1n171, l1n172, l1n173, l1n174, X, + l1n176, l1n177, l1n178, X, l1n180, l1n181, l1n182, l1n183, l1n184, X, l1n186, l1n187, l1n188, l1n189, l1n190, l1n191, + X, l1n193, l1n194, l1n195, l1n196, l1n197, l1n198, l1n199, l1n200, l1n201, l1n202, l1n203, X, l1n205, l1n206, l1n207, + X, l1n209, l1n210, l1n211, l1n212, l1n213, X, l1n215, X, l1n217, l1n218, l1n219, l1n220, l1n221, l1n222, l1n223, + l1n224, l1n225, l1n226, l1n227, l1n228, l1n229, l1n230, l1n231, l1n232, l1n233, l1n234, l1n235, l1n236, X, l1n238, l1n239, + l1n240, X, l1n242, X, l1n244, l1n245, l1n246, X, l1n248, X, l1n250, l1n251, l1n252, X, l1n254, l1n255 } }; - - // // Lng: arabic // Enc: iso-8859-6 // - -S sIa7[]={216,167,0}; -S sgI[]={32,216,0}; -S sJ84[]={217,132,0}; -S sIa7J[]={216,167,217,0}; -S sa7J[]={167,217,0}; -S sgJ[]={32,217,0}; -S sIa7J84[]={216,167,217,132,0}; -S sa7J84[]={167,217,132,0}; -S sgIa7[]={32,216,167,0}; -S sJ8a[]={217,138,0}; -S sJ85[]={217,133,0}; -S sgIa7J[]={32,216,167,217,0}; -S s84I[]={132,216,0}; -S sJ84I[]={217,132,216,0}; -S sJ88[]={217,136,0}; -S sIaa[]={216,170,0}; -S sa7I[]={167,216,0}; -S sIa7I[]={216,167,216,0}; -S sa7J84I[]={167,217,132,216,0}; -S sJ86[]={217,134,0}; -S sa9g[]={169,a}; -S sIa9g[]={216,169,a}; -S sIa9[]={216,169,0}; -S sIb1[]={216,177,0}; -S sJ8aI[]={217,138,216,0}; -S s8aI[]={138,216,0}; -S sIb9[]={216,185,0}; -S s85I[]={133,216,0}; -S sJ85I[]={217,133,216,0}; -S s84J[]={132,217,0}; -S sJ84J[]={217,132,217,0}; -S sIa8[]={216,168,0}; -S sgc7[]={32,199,0}; -S sc7U[]={199,228,0}; -S sJ83[]={217,131,0}; -S sgc7U[]={32,199,228,0}; -S sJ88J[]={217,136,217,0}; -S s88J[]={136,217,0}; -S sgJ88[]={32,217,136,0}; -S sa7J84J[]={167,217,132,217,0}; -S sgJ85[]={32,217,133,0}; -S s85J[]={133,217,0}; -S sJ85J[]={217,133,217,0}; -S sIa7g[]={216,167,a}; -S saaI[]={170,216,0}; -S sIaf[]={216,175,0}; -S sIaaI[]={216,170,216,0}; -S sa7g[]={167,a}; -S sJ81[]={217,129,0}; -S sb9J[]={185,217,0}; -S sJ84Ia7[]={217,132,216,167,0}; -S s84Ia7[]={132,216,167,0}; -S sIb9J[]={216,185,217,0}; -S sIa8I[]={216,168,216,0}; -S sa8I[]={168,216,0}; -S s86g[]={134,a}; -S sIb1J[]={216,177,217,0}; -S s86I[]={134,216,0}; -S sJ86g[]={217,134,a}; -S sb1J[]={177,217,0}; -S sJ86I[]={217,134,216,0}; -S sIb3[]={216,179,0}; -S sJ88I[]={217,136,216,0}; -S s88I[]={136,216,0}; -S sc7g[]={199,a}; -S sWg[]={230,a}; -S saaJ[]={170,217,0}; -S sIaaJ[]={216,170,217,0}; -S sIad[]={216,173,0}; -S s8aIa9[]={138,216,169,0}; -S sJ8aIa9[]={217,138,216,169,0}; -S s8aIa9g[]={138,216,169,a}; -S sIb1I[]={216,177,216,0}; -S s8ag[]={138,a}; -S sb1I[]={177,216,0}; -S sJ8ag[]={217,138,a}; -S sJ87[]={217,135,0}; -S sIa8J[]={216,168,217,0}; -S sa8J[]={168,217,0}; -S sIaag[]={216,170,a}; -S sgIa8[]={32,216,168,0}; -S s84g[]={132,a}; -S saag[]={170,a}; -S sJ84g[]={217,132,a}; -S sJ83I[]={217,131,216,0}; -S s83I[]={131,216,0}; -S sIa7J86[]={216,167,217,134,0}; -S sa7Iaa[]={167,216,170,0}; -S sIa7Iaa[]={216,167,216,170,0}; -S s85Ia7[]={133,216,167,0}; -S s83J[]={131,217,0}; -S sge8[]={32,232,0}; -S sJ85Ia7[]={217,133,216,167,0}; -S sJ83J[]={217,131,217,0}; -S sa7J86[]={167,217,134,0}; -S sJ8aJ[]={217,138,217,0}; -S s8aJ[]={138,217,0}; -S sgJ85I[]={32,217,133,216,0}; -S sIb4[]={216,180,0}; -S sIb9I[]={216,185,216,0}; -S sIb3I[]={216,179,216,0}; -S sb9I[]={185,216,0}; -S sb3I[]={179,216,0}; -S sa7J85[]={167,217,133,0}; -S sIa7J85[]={216,167,217,133,0}; -S s84J85[]={132,217,133,0}; -S s88g[]={136,a}; -S sJ84J85[]={217,132,217,133,0}; -S sgJ85J[]={32,217,133,217,0}; -S sJ88g[]={217,136,a}; -S sJ82[]={217,130,0}; -S sgIa8I[]={32,216,168,216,0}; -S s89g[]={137,a}; -S sgV[]={32,229,0}; -S sJ89g[]={217,137,a}; -S sJ89[]={217,137,0}; -S s81J[]={129,217,0}; -S sJ81J[]={217,129,217,0}; -S s87I[]={135,216,0}; -S sJ87I[]={217,135,216,0}; -S sadI[]={173,216,0}; -S sIafI[]={216,175,216,0}; -S sIac[]={216,172,0}; -S sgJ88g[]={32,217,136,a}; -S sIadI[]={216,173,216,0}; -S safI[]={175,216,0}; -S s8aIb1[]={138,216,177,0}; -S seeg[]={238,a}; -S s84Iaa[]={132,216,170,0}; -S s84Ia7I[]={132,216,167,216,0}; -S sIb1g[]={216,177,a}; -S sb1g[]={177,a}; -S sJ8aIb1[]={217,138,216,177,0}; -S sJ84Iaa[]={217,132,216,170,0}; -S sgJ81[]={32,217,129,0}; -S sgJ81J[]={32,217,129,217,0}; -S sa7Iaag[]={167,216,170,a}; -S sJ81J8a[]={217,129,217,138,0}; -S sb9g[]={185,a}; -S sIb9g[]={216,185,a}; -S s81J8a[]={129,217,138,0}; -S sIb6[]={216,182,0}; -S s84Ia7J[]={132,216,167,217,0}; -S sIab[]={216,171,0}; -S sgJ84[]={32,217,132,0}; -S sIb9J84[]={216,185,217,132,0}; -S sgJ88J[]={32,217,136,217,0}; -S sJ81I[]={217,129,216,0}; -S s81I[]={129,216,0}; -S sb9J84[]={185,217,132,0}; -S s86J[]={134,217,0}; -S sIb5[]={216,181,0}; -S sJ86J[]={217,134,217,0}; -S sb1J8a[]={177,217,138,0}; -S sIa3[]={216,163,0}; -S seag[]={234,a}; -S sIb1J8a[]={216,177,217,138,0}; -S s87Ia7[]={135,216,167,0}; -S sIa7Ib1[]={216,167,216,177,0}; -S sJ87Ia7[]={217,135,216,167,0}; -S sgIaa[]={32,216,170,0}; -S sgJ88I[]={32,217,136,216,0}; -S sa7Ib1[]={167,216,177,0}; -S se8cf[]={232,207,0}; -S sb9J84J[]={185,217,132,217,0}; -S scce8cf[]={204,232,207,0}; -S sUe8[]={228,232,0}; -S s88Ia7[]={136,216,167,0}; -S sIb6I[]={216,182,216,0}; -S s84J85I[]={132,217,133,216,0}; -S sIafJ[]={216,175,217,0}; -S scce8[]={204,232,0}; -S sb4I[]={180,216,0}; -S s81J8ag[]={129,217,138,a}; -S sAc7[]={208,199,0}; -S sgIb9[]={32,216,185,0}; -S sJ88Ia7[]={217,136,216,167,0}; -S sadJ[]={173,217,0}; -S s82I[]={130,216,0}; -S se8cce8[]={232,204,232,0}; -S safJ[]={175,217,0}; -S se8cc[]={232,204,0}; -S se8cfg[]={232,207,a}; -S sIadJ[]={216,173,217,0}; -S se8cce8cf[]={232,204,232,207,0}; -S sb6I[]={182,216,0}; -S sIb4I[]={216,180,216,0}; -S scfg[]={207,a}; -S sJ82I[]={217,130,216,0}; -S sJ88J85[]={217,136,217,133,0}; -S s84J8a[]={132,217,138,0}; -S sJ84J8a[]={217,132,217,138,0}; -S sa7J86g[]={167,217,134,a}; -S s85Ib9[]={133,216,185,0}; -S sIa7Ib3[]={216,167,216,179,0}; -S sa7J85J[]={167,217,133,217,0}; -S sgc7Ue8[]={32,199,228,232,0}; -S sa7Ib3[]={167,216,179,0}; -S sf2g[]={242,a}; -S s87Ia7g[]={135,216,167,a}; -S sJ85Ib9[]={217,133,216,185,0}; -S s85g[]={133,a}; -S sc7Ue8[]={199,228,232,0}; -S sJU[]={217,228,0}; -S s88J85[]={136,217,133,0}; -S sJ85g[]={217,133,a}; -S sJ8aIa7[]={217,138,216,167,0}; -S s8aIa7[]={138,216,167,0}; -S sIa7Ib9[]={216,167,216,185,0}; -S s84J89g[]={132,217,137,a}; -S s84J89[]={132,217,137,0}; -S sa7Ib9[]={167,216,185,0}; -S sIb1Ia7[]={216,177,216,167,0}; -S sb1Ia7[]={177,216,167,0}; -S sJ84J89[]={217,132,217,137,0}; -S scce8cfg[]={204,232,207,a}; -S sa8Ia7[]={168,216,167,0}; -S sIae[]={216,174,0}; -S sUc7[]={228,199,0}; -S sUg[]={228,a}; -S s85J86[]={133,217,134,0}; -S sb1J8aI[]={177,217,138,216,0}; -S sJ86Iaa[]={217,134,216,170,0}; -S sIa8Ia7[]={216,168,216,167,0}; -S s83Ia7[]={131,216,167,0}; -S sIb3J[]={216,179,217,0}; -S se8c7[]={232,199,0}; -S sJ88J86[]={217,136,217,134,0}; -S sb3Iaa[]={179,216,170,0}; -S sJ83Ia7[]={217,131,216,167,0}; -S s86Ia7[]={134,216,167,0}; -S sIaaIb1[]={216,170,216,177,0}; -S sJ85J86[]={217,133,217,134,0}; -S sIaeI[]={216,174,216,0}; -S sIb3Iaa[]={216,179,216,170,0}; -S sa7Ib3I[]={167,216,179,216,0}; -S sgIb9J[]={32,216,185,217,0}; -S s86Iaa[]={134,216,170,0}; -S sb3J[]={179,217,0}; -S sJ86Ia7[]={217,134,216,167,0}; -S s88J86[]={136,217,134,0}; -S sIb2[]={216,178,0}; -S saeI[]={174,216,0}; -S saaIb1[]={170,216,177,0}; -S sgIa7I[]={32,216,167,216,0}; -S sa3I[]={163,216,0}; -S sacI[]={172,216,0}; -S sIa3I[]={216,163,216,0}; -S sb4J[]={180,217,0}; -S sIb4J[]={216,180,217,0}; -S sgJ83[]={32,217,131,0}; -S s84IaaJ[]={132,216,170,217,0}; -S se7g[]={231,a}; -S s85J8a[]={133,217,138,0}; -S s84J83[]={132,217,131,0}; -S s86IaaI[]={134,216,170,216,0}; -S sUe8cce8[]={228,232,204,232,0}; -S s84Ib9[]={132,216,185,0}; -S se9g[]={233,a}; -S sIafg[]={216,175,a}; -S s88J85I[]={136,217,133,216,0}; -S se7c7[]={231,199,0}; -S sc7W[]={199,230,0}; -S sIb0[]={216,176,0}; -S s85Ia7g[]={133,216,167,a}; -S sIba[]={216,186,0}; -S sUe8cc[]={228,232,204,0}; -S safg[]={175,a}; -S s85J86g[]={133,217,134,a}; -S sgR[]={32,225,0}; -S sJ84Ib9[]={217,132,216,185,0}; -S sJ84J83[]={217,132,217,131,0}; -S s85Ib9J[]={133,216,185,217,0}; -S sUV[]={228,229,0}; -S sBg[]={209,a}; -S sc7Ue8cc[]={199,228,232,204,0}; -S se7c7g[]={231,199,a}; -S sJ85J8a[]={217,133,217,138,0}; -S sIb7[]={216,183,0}; -S sgJ84J[]={32,217,132,217,0}; -S s8aIb1g[]={138,216,177,a}; -S s83Ia7J[]={131,216,167,217,0}; -S sb1Ia7I[]={177,216,167,216,0}; -S s84Ia9[]={132,216,169,0}; -S sb9Ia7[]={185,216,167,0}; -S sc7UV[]={199,228,229,0}; -S sgea[]={32,234,0}; -S sJ87J[]={217,135,217,0}; -S s88Ia7J[]={136,216,167,217,0}; -S sJ81Ia9[]={217,129,216,169,0}; -S s83g[]={131,a}; -S sb9J8a[]={185,217,138,0}; -S scdc7[]={205,199,0}; -S sIb9J8a[]={216,185,217,138,0}; -S s88J84[]={136,217,132,0}; -S sIadJ8a[]={216,173,217,138,0}; -S s84Iad[]={132,216,173,0}; -S sa7J86I[]={167,217,134,216,0}; -S s87J[]={135,217,0}; -S sgc7UV[]={32,199,228,229,0}; -S sgJ8a[]={32,217,138,0}; -S s8aIa7I[]={138,216,167,216,0}; -S s81Ia9[]={129,216,169,0}; -S sadJ8a[]={173,217,138,0}; -S sRea[]={225,234,0}; -S sacg[]={172,a}; -S sb5I[]={181,216,0}; -S sIb9Ia7[]={216,185,216,167,0}; -S sb6Ia7[]={182,216,167,0}; -S saaIa7[]={170,216,167,0}; -S sgIaaJ[]={32,216,170,217,0}; -S sJ88J84[]={217,136,217,132,0}; -S sJ83g[]={217,131,a}; -S sIb5I[]={216,181,216,0}; -S sJ84Iad[]={217,132,216,173,0}; -S sIacI[]={216,172,216,0}; -S sIaaIa7[]={216,170,216,167,0}; -S se8W[]={232,230,0}; -S s84Ia9g[]={132,216,169,a}; -S sIb6Ia7[]={216,182,216,167,0}; -S sadJ8aI[]={173,217,138,216,0}; -S sc7ca[]={199,202,0}; -S sJ84Ia9[]={217,132,216,169,0}; -S s81Ia9g[]={129,216,169,a}; -S s84J88[]={132,217,136,0}; -S sb5J[]={181,217,0}; -S sgc7W[]={32,199,230,0}; -S sgIb3[]={32,216,179,0}; -S sIb5J[]={216,181,217,0}; -S sgc7UJ[]={32,199,228,217,0}; -S sVc7[]={229,199,0}; -S sa8Ib9[]={168,216,185,0}; -S seae7[]={234,231,0}; -S saaIadI[]={170,216,173,216,0}; -S s83J88[]={131,217,136,0}; -S sIadIa7[]={216,173,216,167,0}; -S sIb4J83[]={216,180,217,131,0}; -S sIb1J86[]={216,177,217,134,0}; -S sJ88J81[]={217,136,217,129,0}; -S sb1J86[]={177,217,134,0}; -S sUe9[]={228,233,0}; -S sJ85J84[]={217,133,217,132,0}; -S sIa8Ib9[]={216,168,216,185,0}; -S sVWg[]={229,230,a}; -S sacJ[]={172,217,0}; -S sVW[]={229,230,0}; -S se8U[]={232,228,0}; -S sgJ84I[]={32,217,132,216,0}; -S sIaaJ8a[]={216,170,217,138,0}; -S sb1Ia9g[]={177,216,169,a}; -S s85Ia7J[]={133,216,167,217,0}; -S sJ8aIaa[]={217,138,216,170,0}; -S sb1Ia9[]={177,216,169,0}; -S sIbaJ[]={216,186,217,0}; -S sc8g[]={200,a}; -S s85Ib3[]={133,216,179,0}; -S sf0g[]={240,a}; -S sa7J85I[]={167,217,133,216,0}; -S sUe9g[]={228,233,a}; -S sb4J83[]={180,217,131,0}; -S s86J8a[]={134,217,138,0}; -S sgca[]={32,202,0}; -S s8aIaa[]={138,216,170,0}; -S s84Ib9I[]={132,216,185,216,0}; -S saaIad[]={170,216,173,0}; -S sIacJ[]={216,172,217,0}; -S seaW[]={234,230,0}; -S sJ86J8a[]={217,134,217,138,0}; -S se8Wg[]={232,230,a}; -S s85Ia7I[]={133,216,167,216,0}; -S sadIa7[]={173,216,167,0}; -S sIa8J8a[]={216,168,217,138,0}; -S s85J84[]={133,217,132,0}; -S sIb1Ia9[]={216,177,216,169,0}; -S sJ84J88[]={217,132,217,136,0}; -S s85Ib3I[]={133,216,179,216,0}; -S sUJ[]={228,217,0}; -S s84J8aI[]={132,217,138,216,0}; -S saaJ8a[]={170,217,138,0}; -S sa8J8a[]={168,217,138,0}; -S s84Ia7g[]={132,216,167,a}; -S sc7Wg[]={199,230,a}; -S sge7[]={32,231,0}; -S sa7Ib9J[]={167,216,185,217,0}; -S sbaJ[]={186,217,0}; -S sacIa7[]={172,216,167,0}; -S sc7UJ[]={199,228,217,0}; -S s88J81[]={136,217,129,0}; -S sAc7g[]={208,199,a}; -S sadIaf[]={173,216,175,0}; -S sIacIa7[]={216,172,216,167,0}; -S s83J88J[]={131,217,136,217,0}; -S sJ83J88[]={217,131,217,136,0}; -S sb9J8aI[]={185,217,138,216,0}; -S sIaaIad[]={216,170,216,173,0}; -S sgIad[]={32,216,173,0}; -S sIadIaf[]={216,173,216,175,0}; -S sJ85Ib3[]={217,133,216,179,0}; -S sgU[]={32,228,0}; - -N l2n0[]={{sgJ85,1.006},{s85Ia7g,.435},H}; -N l2n1[]={{scce8cf,.449},{sJ85J86,.489},{sVW,.163},H}; -N l2n4[]={{sUe8,.299},{sgU,.109},H}; -N l2n5[]={{sb3I,.344},{sUJ,.163},H}; -N l2n6[]={{s84J83,.217},H}; -N l2n7[]={{sb9J84J,.399},H}; -N l2n8[]={{s81J,.308},H}; -N l2n9[]={{s84Ia7I,.544},{se8cce8cf,.598},{s8aIb1g,.381},H}; -N l2n10[]={{scdc7,.190},{sb1Ia9,.163},H}; -N l2n11[]={{sJ84,5.084},{sIb3,.843},H}; -N l2n12[]={{s84Ia7J,.471},H}; -N l2n13[]={{sJ85J8a,.435},H}; -N l2n14[]={{s8aI,1.269},H}; -N l2n15[]={{sIafI,.652},{sa7Ib9J,.217},H}; -N l2n17[]={{sgIaaJ,.254},H}; -N l2n20[]={{sc7UV,.285},H}; -N l2n21[]={{sgV,.308},{sa3I,.145},{sUe9,.163},H}; -N l2n22[]={{s82I,.199},{sb3J,.163},H}; -N l2n23[]={{sgc7,.942},H}; -N l2n25[]={{se7g,.326},H}; -N l2n26[]={{sIafJ,.449},H}; -N l2n27[]={{sJ81Ia9,.381},{saaIa7,.190},H}; -N l2n28[]={{sJ85,2.990},{s84g,.598},{sIb4,.517},{s84J85,.489},{scce8,.299},H}; -N l2n30[]={{sIa7J84,6.579},{s83J88,.163},{sJ86J8a,.326},H}; -N l2n31[]={{s8aJ,.344},H}; -N l2n32[]={{sJ81I,.530},{s88J85I,.290},H}; -N l2n33[]={{sgJ88,1.115},{sIa7J85,1.033},H}; -N l2n36[]={{sIa7J86,1.087},{sb4I,.199},{s85Ib3,.163},H}; -N l2n37[]={{sJ88J81,.326},H}; -N l2n38[]={{sIb1Ia7,.544},H}; -N l2n39[]={{sIafg,.489},H}; -N l2n40[]={{s85Ia7I,.217},H}; -N l2n43[]={{sJ81J,.693},{sgIb9,.299},{s85Ia7J,.217},H}; -N l2n44[]={{sa7Ib1,.326},{sacI,.145},{sIb1Ia9,.326},H}; -N l2n45[]={{sJ86,2.093},{sIb5,.353},{s84IaaJ,.290},H}; -N l2n46[]={{sJ88J84,.381},H}; -N l2n48[]={{se7c7,.217},{sf0g,.245},{s85J84,.163},H}; -N l2n49[]={{sIb1I,.979},{scfg,.449},{sJ82I,.449},{sJ88J85,.544},H}; -N l2n52[]={{sJ88J86,.489},H}; -N l2n53[]={{s83I,.381},{sc7Ue8,.408},{sb4J,.145},H}; -N l2n55[]={{se8cfg,.673},{sJ83Ia7,.489},{sgJ8a,.190},{sge7,.109},H}; -N l2n56[]={{sgI,3.752},H}; -N l2n57[]={{sc7g,1.183},H}; -N l2n58[]={{s81Ia9,.190},H}; -N l2n59[]={{s85g,.272},{s8aIa7,.272},H}; -N l2n60[]={{sIb1J,1.305},{se8U,.163},H}; -N l2n61[]={{sc7U,1.386},{s84J88,.163},{sacJ,.109},H}; -N l2n62[]={{sJ87,.652},{sIb6,.381},{s87Ia7g,.544},H}; -N l2n63[]={{sIa7,8.074},{sa7Iaag,.761},H}; -N l2n65[]={{sIa8J8a,.326},H}; -N l2n66[]={{sJ83I,.856},{sa7Ib3,.272},H}; -N l2n67[]={{sIa3I,.326},{sb5I,.127},H}; -N l2n70[]={{s83J,.362},{s85J86,.245},{sb9J8aI,.217},H}; -N l2n71[]={{s84Ib9,.217},H}; -N l2n72[]={{sJ84Ia7,1.849},{sge8,.362},{s84J89,.272},H}; -N l2n73[]={{sgJ,2.483},{sIb1g,.918},H}; -N l2n74[]={{sadJ8a,.190},{sgca,.109},H}; -N l2n75[]={{sadI,.290},H}; -N l2n77[]={{sJ83J,.816},H}; -N l2n78[]={{sa7J84,3.289},{sb1J8aI,.326},{sJ84Ia9,.381},H}; -N l2n79[]={{sJ88,2.501},{se8c7,.245},{sIb7,.190},H}; -N l2n80[]={{sIa8,1.577},{sIb9J84,.707},H}; -N l2n81[]={{s8aIa9,.707},{sJ84Iaa,.816},{sIb3Iaa,.489},{safg,.217},H}; -N l2n83[]={{sJ84I,4.159},{sIb3I,.775},{s84J8a,.272},{sb3Iaa,.245},H}; -N l2n84[]={{s84I,1.849},{sb5J,.109},H}; -N l2n86[]={{s81J8ag,.598},H}; -N l2n87[]={{se9g,.326},H}; -N l2n88[]={{sc8g,.245},H}; -N l2n89[]={{sa7g,.951},{sJ85Ia7,1.087},{sa7J85,.517},{sacIa7,.163},H}; -N l2n90[]={{s86g,.870},{sJ83g,.428},{sJ84Iad,.381},H}; -N l2n92[]={{sadJ,.199},{s8aIaa,.163},H}; -N l2n93[]={{saaIad,.163},H}; -N l2n94[]={{sJ84J,2.569},{sIb3J,.367},{se8W,.190},H}; -N l2n95[]={{sgJ81J,.507},{sc7W,.217},H}; -N l2n96[]={{sJ89,.462},H}; -N l2n97[]={{sIa9,2.012},{scce8cfg,.816},{sVWg,.367},H}; -N l2n98[]={{sb6I,.199},{s83Ia7,.245},{sIb9J8a,.381},H}; -N l2n99[]={{sIaaJ8a,.326},H}; -N l2n100[]={{sJ85I,2.610},{sa7J86,.544},{sIb4I,.449},H}; -N l2n101[]={{sgIa7,3.154},{s84J,1.142},H}; -N l2n102[]={{s85Ib9,.272},H}; -N l2n103[]={{sAc7,.299},H}; -N l2n104[]={{s86IaaI,.290},H}; -N l2n106[]={{sJ86Ia7,.489},{saeI,.163},{sgea,.127},{sb1Ia9g,.326},H}; -N l2n107[]={{sJ84g,1.346},{sJU,.272},H}; -N l2n108[]={{s88J81,.163},H}; -N l2n110[]={{sf2g,.408},{sgc7UJ,.217},H}; -N l2n111[]={{sJ85J,1.468},{sIb4J,.326},{sBg,.326},H}; -N l2n112[]={{sgIa8,.598},H}; -N l2n113[]={{sJ8a,3.072},{sIb9,1.821},H}; -N l2n114[]={{sIaa,2.338},{s85J8a,.217},H}; -N l2n115[]={{s85I,1.160},{sJ86Iaa,.489},H}; -N l2n117[]={{sJ86I,1.305},{sIb5I,.285},{sUe9g,.367},H}; -N l2n118[]={{seag,.489},H}; -N l2n120[]={{sadIa7,.163},H}; -N l2n123[]={{sJ87Ia7,.652},{sIb6Ia7,.381},H}; -N l2n124[]={{sb9J84,.353},{sJ85g,.612},{sb1Ia7I,.254},H}; -N l2n125[]={{sgJ84I,.217},{sJ85Ib3,.326},H}; -N l2n126[]={{sJ84Ib9,.435},H}; -N l2n128[]={{sJ86J,.530},{sUe8cce8,.435},{sgJ84J,.254},{sIb5J,.245},H}; -N l2n129[]={{s84Ia7,.924},{sgJ88g,.580},H}; -N l2n130[]={{sIba,.217},H}; -N l2n131[]={{sIab,.353},{sc7ca,.190},H}; -N l2n132[]={{s85J,.652},{sa7Ib9,.272},H}; -N l2n133[]={{sIa7Iaa,1.087},H}; -N l2n134[]={{sJ87I,.652},{sgIaa,.326},{sIb6I,.449},H}; -N l2n135[]={{sIa7I,3.507},{sb9g,.381},H}; -N l2n136[]={{sgJ85I,.689},{s88Ia7J,.254},H}; -N l2n137[]={{safI,.290},{saaIb1,.245},H}; -N l2n139[]={{sgJ85J,.652},H}; -N l2n140[]={{sJ88Ia7,.598},H}; -N l2n141[]={{sJ86g,1.957},{sIa8Ia7,.489},{s88J84,.190},H}; -N l2n143[]={{sb1g,.408},{sJ85Ib9,.544},{sb6Ia7,.190},H}; -N l2n144[]={{se7c7g,.489},{sc7UJ,.245},H}; -N l2n145[]={{sa7I,1.559},{sJ87J,.285},{s86J8a,.163},H}; -N l2n146[]={{sIa7J,7.177},{s86I,.580},{sgc7UV,.254},H}; -N l2n148[]={{sIac,.435},H}; -N l2n150[]={{sIadJ8a,.381},H}; -N l2n151[]={{sa9g,2.012},{sJ88I,1.264},{s84Ia9,.190},H}; -N l2n152[]={{sIa8I,1.346},{s88g,.489},{s88J85,.272},H}; -N l2n153[]={{sc7Ue8cc,.435},H}; -N l2n154[]={{sIa7Ib1,.652},{safJ,.199},{s81Ia9g,.381},{sb1J86,.163},H}; -N l2n155[]={{sgc7Ue8,.362},H}; -N l2n156[]={{se8cce8,.449},{seaW,.163},H}; -N l2n159[]={{sIa7g,2.141},H}; -N l2n160[]={{s85Ia7,.544},{sIa7Ib3,.544},H}; -N l2n162[]={{sa7J,3.190},{sJ88J,1.753},{s84Iaa,.408},H}; -N l2n163[]={{sIa8J,.938},{s86J,.236},{s88J86,.245},{sa8Ib9,.163},H}; -N l2n164[]={{s84J85I,.399},{se8cc,.299},H}; -N l2n165[]={{sIad,.761},H}; -N l2n166[]={{s85J86g,.435},H}; -N l2n167[]={{sgIad,.163},H}; -N l2n168[]={{s84J89g,.544},H}; -N l2n169[]={{s8aIb1,.408},{sgJ88I,.435},{s83J88J,.217},H}; -N l2n172[]={{sgJ88J,.471},{s85Ib3I,.217},H}; -N l2n173[]={{seae7,.163},H}; -N l2n174[]={{sJ8aIa7,.544},{sIb9Ia7,.381},H}; -N l2n175[]={{sJ88g,1.101},{sIaaIa7,.381},{sa8J8a,.163},H}; -N l2n176[]={{sa8I,.598},H}; -N l2n177[]={{s8aIa9g,1.414},{s87I,.290},H}; -N l2n178[]={{sIa7Ib9,.544},H}; -N l2n180[]={{sJ8aIa9,1.414},H}; -N l2n182[]={{saag,.598},{sIae,.245},{sgIb9J,.326},H}; -N l2n183[]={{s89g,.462},{sJ8aIaa,.326},H}; -N l2n185[]={{sJ8aI,2.854},{sIb9I,.775},H}; -N l2n186[]={{sIaaI,1.427},H}; -N l2n188[]={{sUg,.367},H}; -N l2n190[]={{sb9J8a,.190},{se8Wg,.367},H}; -N l2n191[]={{sb9I,.344},{s86Ia7,.245},{sc7Wg,.367},H}; -N l2n192[]={{sJ89g,1.040},H}; -N l2n193[]={{sIa9g,4.526},{sa8J,.417},{sIaaIad,.326},H}; -N l2n194[]={{s87J,.127},H}; -N l2n195[]={{s84Iad,.190},{s8aIa7I,.254},{sIa8Ib9,.326},H}; -N l2n196[]={{sIb9J,1.386},{sJ8aJ,.775},{sa7J86g,.544},H}; -N l2n197[]={{sIaaJ,1.183},H}; -N l2n198[]={{sb1J8a,.326},H}; -N l2n199[]={{sIaf,.951},{sb1I,.435},{sAc7g,.367},H}; -N l2n200[]={{sUe8cc,.326},H}; -N l2n201[]={{sJ81J8a,.761},{sRea,.190},H}; -N l2n202[]={{sa7Ib3I,.326},H}; -N l2n204[]={{sJ8aIb1,.816},H}; -N l2n205[]={{sIaaIb1,.489},H}; -N l2n206[]={{sIb1J86,.326},H}; -N l2n207[]={{s84Ib9I,.217},H}; -N l2n208[]={{sb9J,.616},{s88I,.562},{sadIaf,.163},H}; -N l2n209[]={{sJ8ag,1.468},{sIb9g,.856},{sgR,.145},{sUV,.217},{sIacIa7,.326},H}; -N l2n210[]={{sIaag,1.346},{sadJ8aI,.254},H}; -N l2n211[]={{sgc3,.236},{sUc7,.245},H}; -N l2n212[]={{sgJ81,.408},H}; -N l2n213[]={{sIbaJ,.245},H}; -N l2n214[]={{sa7J84I,2.864},{s8ag,.652},{sb4J83,.163},H}; -N l2n215[]={{se8cf,.326},H}; -N l2n216[]={{sJ81,.924},{sb1J,.580},{sIb0,.217},H}; -N l2n217[]={{sa7J84J,1.341},H}; -N l2n218[]={{sIb1J8a,.652},H}; -N l2n219[]={{s84J8aI,.217},H}; -N l2n220[]={{sIacI,.285},H}; -N l2n221[]={{sa8Ia7,.245},H}; -N l2n222[]={{s87Ia7,.326},H}; -N l2n223[]={{sa7Iaa,.544},H}; -N l2n224[]={{s86Iaa,.245},H}; -N l2n225[]={{s88J,.779},{sa7J85I,.217},{s84Ia7g,.326},H}; -N l2n226[]={{sIadIa7,.326},H}; -N l2n227[]={{sgc7U,1.223},H}; -N l2n228[]={{sa7J85J,.362},H}; -N l2n229[]={{saaIadI,.217},{sJ83J88,.326},H}; -N l2n231[]={{sJ84J83,.435},{sIacJ,.245},H}; -N l2n233[]={{sIb1,1.930},{sJ82,.489},{sgIb3,.163},H}; -N l2n234[]={{sgJ83,.217},H}; -N l2n236[]={{sb9Ia7,.190},{sa7J86I,.254},H}; -N l2n237[]={{sJ84J85,.979},{sIadI,.652},{sgIa7I,.326},{s83Ia7J,.254},{saaJ8a,.163},H}; -N l2n238[]={{saaI,.634},H}; -N l2n239[]={{sbaJ,.109},H}; -N l2n240[]={{sgIa7J,3.878},H}; -N l2n241[]={{s85Ib9J,.290},H}; -N l2n242[]={{seeg,.612},{sVc7,.163},H}; -N l2n244[]={{sb1Ia7,.272},{sacg,.190},H}; -N l2n245[]={{sgJ84,.353},H}; -N l2n246[]={{s81J8a,.381},{sJ84J88,.326},H}; -N l2n247[]={{s81I,.236},{s84Ia9g,.381},H}; -N l2n248[]={{sgIa8I,.616},{sIadJ,.449},{sIb4J83,.326},H}; -N l2n249[]={{sJ84J89,.544},{sgc7W,.163},H}; -N l2n250[]={{sJ83,1.305},{sWg,1.183},{sIb2,.245},{sIadIaf,.326},H}; -N l2n251[]={{sIa3,.326},{sJ85J84,.326},H}; -N l2n252[]={{sJ84J8a,.544},H}; -N l2n253[]={{s88Ia7,.299},{s83g,.190},H}; -N l2n254[]={{sIaeI,.367},H}; -N l2n255[]={{saaJ,.526},H}; - -D l2_d = -{ +S sIa7[] = { 216, 167, 0 }; +S sgI[] = { 32, 216, 0 }; +S sJ84[] = { 217, 132, 0 }; +S sIa7J[] = { 216, 167, 217, 0 }; +S sa7J[] = { 167, 217, 0 }; +S sgJ[] = { 32, 217, 0 }; +S sIa7J84[] = { 216, 167, 217, 132, 0 }; +S sa7J84[] = { 167, 217, 132, 0 }; +S sgIa7[] = { 32, 216, 167, 0 }; +S sJ8a[] = { 217, 138, 0 }; +S sJ85[] = { 217, 133, 0 }; +S sgIa7J[] = { 32, 216, 167, 217, 0 }; +S s84I[] = { 132, 216, 0 }; +S sJ84I[] = { 217, 132, 216, 0 }; +S sJ88[] = { 217, 136, 0 }; +S sIaa[] = { 216, 170, 0 }; +S sa7I[] = { 167, 216, 0 }; +S sIa7I[] = { 216, 167, 216, 0 }; +S sa7J84I[] = { 167, 217, 132, 216, 0 }; +S sJ86[] = { 217, 134, 0 }; +S sa9g[] = { 169, a }; +S sIa9g[] = { 216, 169, a }; +S sIa9[] = { 216, 169, 0 }; +S sIb1[] = { 216, 177, 0 }; +S sJ8aI[] = { 217, 138, 216, 0 }; +S s8aI[] = { 138, 216, 0 }; +S sIb9[] = { 216, 185, 0 }; +S s85I[] = { 133, 216, 0 }; +S sJ85I[] = { 217, 133, 216, 0 }; +S s84J[] = { 132, 217, 0 }; +S sJ84J[] = { 217, 132, 217, 0 }; +S sIa8[] = { 216, 168, 0 }; +S sgc7[] = { 32, 199, 0 }; +S sc7U[] = { 199, 228, 0 }; +S sJ83[] = { 217, 131, 0 }; +S sgc7U[] = { 32, 199, 228, 0 }; +S sJ88J[] = { 217, 136, 217, 0 }; +S s88J[] = { 136, 217, 0 }; +S sgJ88[] = { 32, 217, 136, 0 }; +S sa7J84J[] = { 167, 217, 132, 217, 0 }; +S sgJ85[] = { 32, 217, 133, 0 }; +S s85J[] = { 133, 217, 0 }; +S sJ85J[] = { 217, 133, 217, 0 }; +S sIa7g[] = { 216, 167, a }; +S saaI[] = { 170, 216, 0 }; +S sIaf[] = { 216, 175, 0 }; +S sIaaI[] = { 216, 170, 216, 0 }; +S sa7g[] = { 167, a }; +S sJ81[] = { 217, 129, 0 }; +S sb9J[] = { 185, 217, 0 }; +S sJ84Ia7[] = { 217, 132, 216, 167, 0 }; +S s84Ia7[] = { 132, 216, 167, 0 }; +S sIb9J[] = { 216, 185, 217, 0 }; +S sIa8I[] = { 216, 168, 216, 0 }; +S sa8I[] = { 168, 216, 0 }; +S s86g[] = { 134, a }; +S sIb1J[] = { 216, 177, 217, 0 }; +S s86I[] = { 134, 216, 0 }; +S sJ86g[] = { 217, 134, a }; +S sb1J[] = { 177, 217, 0 }; +S sJ86I[] = { 217, 134, 216, 0 }; +S sIb3[] = { 216, 179, 0 }; +S sJ88I[] = { 217, 136, 216, 0 }; +S s88I[] = { 136, 216, 0 }; +S sc7g[] = { 199, a }; +S sWg[] = { 230, a }; +S saaJ[] = { 170, 217, 0 }; +S sIaaJ[] = { 216, 170, 217, 0 }; +S sIad[] = { 216, 173, 0 }; +S s8aIa9[] = { 138, 216, 169, 0 }; +S sJ8aIa9[] = { 217, 138, 216, 169, 0 }; +S s8aIa9g[] = { 138, 216, 169, a }; +S sIb1I[] = { 216, 177, 216, 0 }; +S s8ag[] = { 138, a }; +S sb1I[] = { 177, 216, 0 }; +S sJ8ag[] = { 217, 138, a }; +S sJ87[] = { 217, 135, 0 }; +S sIa8J[] = { 216, 168, 217, 0 }; +S sa8J[] = { 168, 217, 0 }; +S sIaag[] = { 216, 170, a }; +S sgIa8[] = { 32, 216, 168, 0 }; +S s84g[] = { 132, a }; +S saag[] = { 170, a }; +S sJ84g[] = { 217, 132, a }; +S sJ83I[] = { 217, 131, 216, 0 }; +S s83I[] = { 131, 216, 0 }; +S sIa7J86[] = { 216, 167, 217, 134, 0 }; +S sa7Iaa[] = { 167, 216, 170, 0 }; +S sIa7Iaa[] = { 216, 167, 216, 170, 0 }; +S s85Ia7[] = { 133, 216, 167, 0 }; +S s83J[] = { 131, 217, 0 }; +S sge8[] = { 32, 232, 0 }; +S sJ85Ia7[] = { 217, 133, 216, 167, 0 }; +S sJ83J[] = { 217, 131, 217, 0 }; +S sa7J86[] = { 167, 217, 134, 0 }; +S sJ8aJ[] = { 217, 138, 217, 0 }; +S s8aJ[] = { 138, 217, 0 }; +S sgJ85I[] = { 32, 217, 133, 216, 0 }; +S sIb4[] = { 216, 180, 0 }; +S sIb9I[] = { 216, 185, 216, 0 }; +S sIb3I[] = { 216, 179, 216, 0 }; +S sb9I[] = { 185, 216, 0 }; +S sb3I[] = { 179, 216, 0 }; +S sa7J85[] = { 167, 217, 133, 0 }; +S sIa7J85[] = { 216, 167, 217, 133, 0 }; +S s84J85[] = { 132, 217, 133, 0 }; +S s88g[] = { 136, a }; +S sJ84J85[] = { 217, 132, 217, 133, 0 }; +S sgJ85J[] = { 32, 217, 133, 217, 0 }; +S sJ88g[] = { 217, 136, a }; +S sJ82[] = { 217, 130, 0 }; +S sgIa8I[] = { 32, 216, 168, 216, 0 }; +S s89g[] = { 137, a }; +S sgV[] = { 32, 229, 0 }; +S sJ89g[] = { 217, 137, a }; +S sJ89[] = { 217, 137, 0 }; +S s81J[] = { 129, 217, 0 }; +S sJ81J[] = { 217, 129, 217, 0 }; +S s87I[] = { 135, 216, 0 }; +S sJ87I[] = { 217, 135, 216, 0 }; +S sadI[] = { 173, 216, 0 }; +S sIafI[] = { 216, 175, 216, 0 }; +S sIac[] = { 216, 172, 0 }; +S sgJ88g[] = { 32, 217, 136, a }; +S sIadI[] = { 216, 173, 216, 0 }; +S safI[] = { 175, 216, 0 }; +S s8aIb1[] = { 138, 216, 177, 0 }; +S seeg[] = { 238, a }; +S s84Iaa[] = { 132, 216, 170, 0 }; +S s84Ia7I[] = { 132, 216, 167, 216, 0 }; +S sIb1g[] = { 216, 177, a }; +S sb1g[] = { 177, a }; +S sJ8aIb1[] = { 217, 138, 216, 177, 0 }; +S sJ84Iaa[] = { 217, 132, 216, 170, 0 }; +S sgJ81[] = { 32, 217, 129, 0 }; +S sgJ81J[] = { 32, 217, 129, 217, 0 }; +S sa7Iaag[] = { 167, 216, 170, a }; +S sJ81J8a[] = { 217, 129, 217, 138, 0 }; +S sb9g[] = { 185, a }; +S sIb9g[] = { 216, 185, a }; +S s81J8a[] = { 129, 217, 138, 0 }; +S sIb6[] = { 216, 182, 0 }; +S s84Ia7J[] = { 132, 216, 167, 217, 0 }; +S sIab[] = { 216, 171, 0 }; +S sgJ84[] = { 32, 217, 132, 0 }; +S sIb9J84[] = { 216, 185, 217, 132, 0 }; +S sgJ88J[] = { 32, 217, 136, 217, 0 }; +S sJ81I[] = { 217, 129, 216, 0 }; +S s81I[] = { 129, 216, 0 }; +S sb9J84[] = { 185, 217, 132, 0 }; +S s86J[] = { 134, 217, 0 }; +S sIb5[] = { 216, 181, 0 }; +S sJ86J[] = { 217, 134, 217, 0 }; +S sb1J8a[] = { 177, 217, 138, 0 }; +S sIa3[] = { 216, 163, 0 }; +S seag[] = { 234, a }; +S sIb1J8a[] = { 216, 177, 217, 138, 0 }; +S s87Ia7[] = { 135, 216, 167, 0 }; +S sIa7Ib1[] = { 216, 167, 216, 177, 0 }; +S sJ87Ia7[] = { 217, 135, 216, 167, 0 }; +S sgIaa[] = { 32, 216, 170, 0 }; +S sgJ88I[] = { 32, 217, 136, 216, 0 }; +S sa7Ib1[] = { 167, 216, 177, 0 }; +S se8cf[] = { 232, 207, 0 }; +S sb9J84J[] = { 185, 217, 132, 217, 0 }; +S scce8cf[] = { 204, 232, 207, 0 }; +S sUe8[] = { 228, 232, 0 }; +S s88Ia7[] = { 136, 216, 167, 0 }; +S sIb6I[] = { 216, 182, 216, 0 }; +S s84J85I[] = { 132, 217, 133, 216, 0 }; +S sIafJ[] = { 216, 175, 217, 0 }; +S scce8[] = { 204, 232, 0 }; +S sb4I[] = { 180, 216, 0 }; +S s81J8ag[] = { 129, 217, 138, a }; +S sAc7[] = { 208, 199, 0 }; +S sgIb9[] = { 32, 216, 185, 0 }; +S sJ88Ia7[] = { 217, 136, 216, 167, 0 }; +S sadJ[] = { 173, 217, 0 }; +S s82I[] = { 130, 216, 0 }; +S se8cce8[] = { 232, 204, 232, 0 }; +S safJ[] = { 175, 217, 0 }; +S se8cc[] = { 232, 204, 0 }; +S se8cfg[] = { 232, 207, a }; +S sIadJ[] = { 216, 173, 217, 0 }; +S se8cce8cf[] = { 232, 204, 232, 207, 0 }; +S sb6I[] = { 182, 216, 0 }; +S sIb4I[] = { 216, 180, 216, 0 }; +S scfg[] = { 207, a }; +S sJ82I[] = { 217, 130, 216, 0 }; +S sJ88J85[] = { 217, 136, 217, 133, 0 }; +S s84J8a[] = { 132, 217, 138, 0 }; +S sJ84J8a[] = { 217, 132, 217, 138, 0 }; +S sa7J86g[] = { 167, 217, 134, a }; +S s85Ib9[] = { 133, 216, 185, 0 }; +S sIa7Ib3[] = { 216, 167, 216, 179, 0 }; +S sa7J85J[] = { 167, 217, 133, 217, 0 }; +S sgc7Ue8[] = { 32, 199, 228, 232, 0 }; +S sa7Ib3[] = { 167, 216, 179, 0 }; +S sf2g[] = { 242, a }; +S s87Ia7g[] = { 135, 216, 167, a }; +S sJ85Ib9[] = { 217, 133, 216, 185, 0 }; +S s85g[] = { 133, a }; +S sc7Ue8[] = { 199, 228, 232, 0 }; +S sJU[] = { 217, 228, 0 }; +S s88J85[] = { 136, 217, 133, 0 }; +S sJ85g[] = { 217, 133, a }; +S sJ8aIa7[] = { 217, 138, 216, 167, 0 }; +S s8aIa7[] = { 138, 216, 167, 0 }; +S sIa7Ib9[] = { 216, 167, 216, 185, 0 }; +S s84J89g[] = { 132, 217, 137, a }; +S s84J89[] = { 132, 217, 137, 0 }; +S sa7Ib9[] = { 167, 216, 185, 0 }; +S sIb1Ia7[] = { 216, 177, 216, 167, 0 }; +S sb1Ia7[] = { 177, 216, 167, 0 }; +S sJ84J89[] = { 217, 132, 217, 137, 0 }; +S scce8cfg[] = { 204, 232, 207, a }; +S sa8Ia7[] = { 168, 216, 167, 0 }; +S sIae[] = { 216, 174, 0 }; +S sUc7[] = { 228, 199, 0 }; +S sUg[] = { 228, a }; +S s85J86[] = { 133, 217, 134, 0 }; +S sb1J8aI[] = { 177, 217, 138, 216, 0 }; +S sJ86Iaa[] = { 217, 134, 216, 170, 0 }; +S sIa8Ia7[] = { 216, 168, 216, 167, 0 }; +S s83Ia7[] = { 131, 216, 167, 0 }; +S sIb3J[] = { 216, 179, 217, 0 }; +S se8c7[] = { 232, 199, 0 }; +S sJ88J86[] = { 217, 136, 217, 134, 0 }; +S sb3Iaa[] = { 179, 216, 170, 0 }; +S sJ83Ia7[] = { 217, 131, 216, 167, 0 }; +S s86Ia7[] = { 134, 216, 167, 0 }; +S sIaaIb1[] = { 216, 170, 216, 177, 0 }; +S sJ85J86[] = { 217, 133, 217, 134, 0 }; +S sIaeI[] = { 216, 174, 216, 0 }; +S sIb3Iaa[] = { 216, 179, 216, 170, 0 }; +S sa7Ib3I[] = { 167, 216, 179, 216, 0 }; +S sgIb9J[] = { 32, 216, 185, 217, 0 }; +S s86Iaa[] = { 134, 216, 170, 0 }; +S sb3J[] = { 179, 217, 0 }; +S sJ86Ia7[] = { 217, 134, 216, 167, 0 }; +S s88J86[] = { 136, 217, 134, 0 }; +S sIb2[] = { 216, 178, 0 }; +S saeI[] = { 174, 216, 0 }; +S saaIb1[] = { 170, 216, 177, 0 }; +S sgIa7I[] = { 32, 216, 167, 216, 0 }; +S sa3I[] = { 163, 216, 0 }; +S sacI[] = { 172, 216, 0 }; +S sIa3I[] = { 216, 163, 216, 0 }; +S sb4J[] = { 180, 217, 0 }; +S sIb4J[] = { 216, 180, 217, 0 }; +S sgJ83[] = { 32, 217, 131, 0 }; +S s84IaaJ[] = { 132, 216, 170, 217, 0 }; +S se7g[] = { 231, a }; +S s85J8a[] = { 133, 217, 138, 0 }; +S s84J83[] = { 132, 217, 131, 0 }; +S s86IaaI[] = { 134, 216, 170, 216, 0 }; +S sUe8cce8[] = { 228, 232, 204, 232, 0 }; +S s84Ib9[] = { 132, 216, 185, 0 }; +S se9g[] = { 233, a }; +S sIafg[] = { 216, 175, a }; +S s88J85I[] = { 136, 217, 133, 216, 0 }; +S se7c7[] = { 231, 199, 0 }; +S sc7W[] = { 199, 230, 0 }; +S sIb0[] = { 216, 176, 0 }; +S s85Ia7g[] = { 133, 216, 167, a }; +S sIba[] = { 216, 186, 0 }; +S sUe8cc[] = { 228, 232, 204, 0 }; +S safg[] = { 175, a }; +S s85J86g[] = { 133, 217, 134, a }; +S sgR[] = { 32, 225, 0 }; +S sJ84Ib9[] = { 217, 132, 216, 185, 0 }; +S sJ84J83[] = { 217, 132, 217, 131, 0 }; +S s85Ib9J[] = { 133, 216, 185, 217, 0 }; +S sUV[] = { 228, 229, 0 }; +S sBg[] = { 209, a }; +S sc7Ue8cc[] = { 199, 228, 232, 204, 0 }; +S se7c7g[] = { 231, 199, a }; +S sJ85J8a[] = { 217, 133, 217, 138, 0 }; +S sIb7[] = { 216, 183, 0 }; +S sgJ84J[] = { 32, 217, 132, 217, 0 }; +S s8aIb1g[] = { 138, 216, 177, a }; +S s83Ia7J[] = { 131, 216, 167, 217, 0 }; +S sb1Ia7I[] = { 177, 216, 167, 216, 0 }; +S s84Ia9[] = { 132, 216, 169, 0 }; +S sb9Ia7[] = { 185, 216, 167, 0 }; +S sc7UV[] = { 199, 228, 229, 0 }; +S sgea[] = { 32, 234, 0 }; +S sJ87J[] = { 217, 135, 217, 0 }; +S s88Ia7J[] = { 136, 216, 167, 217, 0 }; +S sJ81Ia9[] = { 217, 129, 216, 169, 0 }; +S s83g[] = { 131, a }; +S sb9J8a[] = { 185, 217, 138, 0 }; +S scdc7[] = { 205, 199, 0 }; +S sIb9J8a[] = { 216, 185, 217, 138, 0 }; +S s88J84[] = { 136, 217, 132, 0 }; +S sIadJ8a[] = { 216, 173, 217, 138, 0 }; +S s84Iad[] = { 132, 216, 173, 0 }; +S sa7J86I[] = { 167, 217, 134, 216, 0 }; +S s87J[] = { 135, 217, 0 }; +S sgc7UV[] = { 32, 199, 228, 229, 0 }; +S sgJ8a[] = { 32, 217, 138, 0 }; +S s8aIa7I[] = { 138, 216, 167, 216, 0 }; +S s81Ia9[] = { 129, 216, 169, 0 }; +S sadJ8a[] = { 173, 217, 138, 0 }; +S sRea[] = { 225, 234, 0 }; +S sacg[] = { 172, a }; +S sb5I[] = { 181, 216, 0 }; +S sIb9Ia7[] = { 216, 185, 216, 167, 0 }; +S sb6Ia7[] = { 182, 216, 167, 0 }; +S saaIa7[] = { 170, 216, 167, 0 }; +S sgIaaJ[] = { 32, 216, 170, 217, 0 }; +S sJ88J84[] = { 217, 136, 217, 132, 0 }; +S sJ83g[] = { 217, 131, a }; +S sIb5I[] = { 216, 181, 216, 0 }; +S sJ84Iad[] = { 217, 132, 216, 173, 0 }; +S sIacI[] = { 216, 172, 216, 0 }; +S sIaaIa7[] = { 216, 170, 216, 167, 0 }; +S se8W[] = { 232, 230, 0 }; +S s84Ia9g[] = { 132, 216, 169, a }; +S sIb6Ia7[] = { 216, 182, 216, 167, 0 }; +S sadJ8aI[] = { 173, 217, 138, 216, 0 }; +S sc7ca[] = { 199, 202, 0 }; +S sJ84Ia9[] = { 217, 132, 216, 169, 0 }; +S s81Ia9g[] = { 129, 216, 169, a }; +S s84J88[] = { 132, 217, 136, 0 }; +S sb5J[] = { 181, 217, 0 }; +S sgc7W[] = { 32, 199, 230, 0 }; +S sgIb3[] = { 32, 216, 179, 0 }; +S sIb5J[] = { 216, 181, 217, 0 }; +S sgc7UJ[] = { 32, 199, 228, 217, 0 }; +S sVc7[] = { 229, 199, 0 }; +S sa8Ib9[] = { 168, 216, 185, 0 }; +S seae7[] = { 234, 231, 0 }; +S saaIadI[] = { 170, 216, 173, 216, 0 }; +S s83J88[] = { 131, 217, 136, 0 }; +S sIadIa7[] = { 216, 173, 216, 167, 0 }; +S sIb4J83[] = { 216, 180, 217, 131, 0 }; +S sIb1J86[] = { 216, 177, 217, 134, 0 }; +S sJ88J81[] = { 217, 136, 217, 129, 0 }; +S sb1J86[] = { 177, 217, 134, 0 }; +S sUe9[] = { 228, 233, 0 }; +S sJ85J84[] = { 217, 133, 217, 132, 0 }; +S sIa8Ib9[] = { 216, 168, 216, 185, 0 }; +S sVWg[] = { 229, 230, a }; +S sacJ[] = { 172, 217, 0 }; +S sVW[] = { 229, 230, 0 }; +S se8U[] = { 232, 228, 0 }; +S sgJ84I[] = { 32, 217, 132, 216, 0 }; +S sIaaJ8a[] = { 216, 170, 217, 138, 0 }; +S sb1Ia9g[] = { 177, 216, 169, a }; +S s85Ia7J[] = { 133, 216, 167, 217, 0 }; +S sJ8aIaa[] = { 217, 138, 216, 170, 0 }; +S sb1Ia9[] = { 177, 216, 169, 0 }; +S sIbaJ[] = { 216, 186, 217, 0 }; +S sc8g[] = { 200, a }; +S s85Ib3[] = { 133, 216, 179, 0 }; +S sf0g[] = { 240, a }; +S sa7J85I[] = { 167, 217, 133, 216, 0 }; +S sUe9g[] = { 228, 233, a }; +S sb4J83[] = { 180, 217, 131, 0 }; +S s86J8a[] = { 134, 217, 138, 0 }; +S sgca[] = { 32, 202, 0 }; +S s8aIaa[] = { 138, 216, 170, 0 }; +S s84Ib9I[] = { 132, 216, 185, 216, 0 }; +S saaIad[] = { 170, 216, 173, 0 }; +S sIacJ[] = { 216, 172, 217, 0 }; +S seaW[] = { 234, 230, 0 }; +S sJ86J8a[] = { 217, 134, 217, 138, 0 }; +S se8Wg[] = { 232, 230, a }; +S s85Ia7I[] = { 133, 216, 167, 216, 0 }; +S sadIa7[] = { 173, 216, 167, 0 }; +S sIa8J8a[] = { 216, 168, 217, 138, 0 }; +S s85J84[] = { 133, 217, 132, 0 }; +S sIb1Ia9[] = { 216, 177, 216, 169, 0 }; +S sJ84J88[] = { 217, 132, 217, 136, 0 }; +S s85Ib3I[] = { 133, 216, 179, 216, 0 }; +S sUJ[] = { 228, 217, 0 }; +S s84J8aI[] = { 132, 217, 138, 216, 0 }; +S saaJ8a[] = { 170, 217, 138, 0 }; +S sa8J8a[] = { 168, 217, 138, 0 }; +S s84Ia7g[] = { 132, 216, 167, a }; +S sc7Wg[] = { 199, 230, a }; +S sge7[] = { 32, 231, 0 }; +S sa7Ib9J[] = { 167, 216, 185, 217, 0 }; +S sbaJ[] = { 186, 217, 0 }; +S sacIa7[] = { 172, 216, 167, 0 }; +S sc7UJ[] = { 199, 228, 217, 0 }; +S s88J81[] = { 136, 217, 129, 0 }; +S sAc7g[] = { 208, 199, a }; +S sadIaf[] = { 173, 216, 175, 0 }; +S sIacIa7[] = { 216, 172, 216, 167, 0 }; +S s83J88J[] = { 131, 217, 136, 217, 0 }; +S sJ83J88[] = { 217, 131, 217, 136, 0 }; +S sb9J8aI[] = { 185, 217, 138, 216, 0 }; +S sIaaIad[] = { 216, 170, 216, 173, 0 }; +S sgIad[] = { 32, 216, 173, 0 }; +S sIadIaf[] = { 216, 173, 216, 175, 0 }; +S sJ85Ib3[] = { 217, 133, 216, 179, 0 }; +S sgU[] = { 32, 228, 0 }; + +N l2n0[] = { { sgJ85, 1.006 }, { s85Ia7g, .435 }, H }; +N l2n1[] = { { scce8cf, .449 }, { sJ85J86, .489 }, { sVW, .163 }, H }; +N l2n4[] = { { sUe8, .299 }, { sgU, .109 }, H }; +N l2n5[] = { { sb3I, .344 }, { sUJ, .163 }, H }; +N l2n6[] = { { s84J83, .217 }, H }; +N l2n7[] = { { sb9J84J, .399 }, H }; +N l2n8[] = { { s81J, .308 }, H }; +N l2n9[] = { { s84Ia7I, .544 }, { se8cce8cf, .598 }, { s8aIb1g, .381 }, H }; +N l2n10[] = { { scdc7, .190 }, { sb1Ia9, .163 }, H }; +N l2n11[] = { { sJ84, 5.084 }, { sIb3, .843 }, H }; +N l2n12[] = { { s84Ia7J, .471 }, H }; +N l2n13[] = { { sJ85J8a, .435 }, H }; +N l2n14[] = { { s8aI, 1.269 }, H }; +N l2n15[] = { { sIafI, .652 }, { sa7Ib9J, .217 }, H }; +N l2n17[] = { { sgIaaJ, .254 }, H }; +N l2n20[] = { { sc7UV, .285 }, H }; +N l2n21[] = { { sgV, .308 }, { sa3I, .145 }, { sUe9, .163 }, H }; +N l2n22[] = { { s82I, .199 }, { sb3J, .163 }, H }; +N l2n23[] = { { sgc7, .942 }, H }; +N l2n25[] = { { se7g, .326 }, H }; +N l2n26[] = { { sIafJ, .449 }, H }; +N l2n27[] = { { sJ81Ia9, .381 }, { saaIa7, .190 }, H }; +N l2n28[] = { { sJ85, 2.990 }, { s84g, .598 }, { sIb4, .517 }, { s84J85, .489 }, { scce8, .299 }, H }; +N l2n30[] = { { sIa7J84, 6.579 }, { s83J88, .163 }, { sJ86J8a, .326 }, H }; +N l2n31[] = { { s8aJ, .344 }, H }; +N l2n32[] = { { sJ81I, .530 }, { s88J85I, .290 }, H }; +N l2n33[] = { { sgJ88, 1.115 }, { sIa7J85, 1.033 }, H }; +N l2n36[] = { { sIa7J86, 1.087 }, { sb4I, .199 }, { s85Ib3, .163 }, H }; +N l2n37[] = { { sJ88J81, .326 }, H }; +N l2n38[] = { { sIb1Ia7, .544 }, H }; +N l2n39[] = { { sIafg, .489 }, H }; +N l2n40[] = { { s85Ia7I, .217 }, H }; +N l2n43[] = { { sJ81J, .693 }, { sgIb9, .299 }, { s85Ia7J, .217 }, H }; +N l2n44[] = { { sa7Ib1, .326 }, { sacI, .145 }, { sIb1Ia9, .326 }, H }; +N l2n45[] = { { sJ86, 2.093 }, { sIb5, .353 }, { s84IaaJ, .290 }, H }; +N l2n46[] = { { sJ88J84, .381 }, H }; +N l2n48[] = { { se7c7, .217 }, { sf0g, .245 }, { s85J84, .163 }, H }; +N l2n49[] = { { sIb1I, .979 }, { scfg, .449 }, { sJ82I, .449 }, { sJ88J85, .544 }, H }; +N l2n52[] = { { sJ88J86, .489 }, H }; +N l2n53[] = { { s83I, .381 }, { sc7Ue8, .408 }, { sb4J, .145 }, H }; +N l2n55[] = { { se8cfg, .673 }, { sJ83Ia7, .489 }, { sgJ8a, .190 }, { sge7, .109 }, H }; +N l2n56[] = { { sgI, 3.752 }, H }; +N l2n57[] = { { sc7g, 1.183 }, H }; +N l2n58[] = { { s81Ia9, .190 }, H }; +N l2n59[] = { { s85g, .272 }, { s8aIa7, .272 }, H }; +N l2n60[] = { { sIb1J, 1.305 }, { se8U, .163 }, H }; +N l2n61[] = { { sc7U, 1.386 }, { s84J88, .163 }, { sacJ, .109 }, H }; +N l2n62[] = { { sJ87, .652 }, { sIb6, .381 }, { s87Ia7g, .544 }, H }; +N l2n63[] = { { sIa7, 8.074 }, { sa7Iaag, .761 }, H }; +N l2n65[] = { { sIa8J8a, .326 }, H }; +N l2n66[] = { { sJ83I, .856 }, { sa7Ib3, .272 }, H }; +N l2n67[] = { { sIa3I, .326 }, { sb5I, .127 }, H }; +N l2n70[] = { { s83J, .362 }, { s85J86, .245 }, { sb9J8aI, .217 }, H }; +N l2n71[] = { { s84Ib9, .217 }, H }; +N l2n72[] = { { sJ84Ia7, 1.849 }, { sge8, .362 }, { s84J89, .272 }, H }; +N l2n73[] = { { sgJ, 2.483 }, { sIb1g, .918 }, H }; +N l2n74[] = { { sadJ8a, .190 }, { sgca, .109 }, H }; +N l2n75[] = { { sadI, .290 }, H }; +N l2n77[] = { { sJ83J, .816 }, H }; +N l2n78[] = { { sa7J84, 3.289 }, { sb1J8aI, .326 }, { sJ84Ia9, .381 }, H }; +N l2n79[] = { { sJ88, 2.501 }, { se8c7, .245 }, { sIb7, .190 }, H }; +N l2n80[] = { { sIa8, 1.577 }, { sIb9J84, .707 }, H }; +N l2n81[] = { { s8aIa9, .707 }, { sJ84Iaa, .816 }, { sIb3Iaa, .489 }, { safg, .217 }, H }; +N l2n83[] = { { sJ84I, 4.159 }, { sIb3I, .775 }, { s84J8a, .272 }, { sb3Iaa, .245 }, H }; +N l2n84[] = { { s84I, 1.849 }, { sb5J, .109 }, H }; +N l2n86[] = { { s81J8ag, .598 }, H }; +N l2n87[] = { { se9g, .326 }, H }; +N l2n88[] = { { sc8g, .245 }, H }; +N l2n89[] = { { sa7g, .951 }, { sJ85Ia7, 1.087 }, { sa7J85, .517 }, { sacIa7, .163 }, H }; +N l2n90[] = { { s86g, .870 }, { sJ83g, .428 }, { sJ84Iad, .381 }, H }; +N l2n92[] = { { sadJ, .199 }, { s8aIaa, .163 }, H }; +N l2n93[] = { { saaIad, .163 }, H }; +N l2n94[] = { { sJ84J, 2.569 }, { sIb3J, .367 }, { se8W, .190 }, H }; +N l2n95[] = { { sgJ81J, .507 }, { sc7W, .217 }, H }; +N l2n96[] = { { sJ89, .462 }, H }; +N l2n97[] = { { sIa9, 2.012 }, { scce8cfg, .816 }, { sVWg, .367 }, H }; +N l2n98[] = { { sb6I, .199 }, { s83Ia7, .245 }, { sIb9J8a, .381 }, H }; +N l2n99[] = { { sIaaJ8a, .326 }, H }; +N l2n100[] = { { sJ85I, 2.610 }, { sa7J86, .544 }, { sIb4I, .449 }, H }; +N l2n101[] = { { sgIa7, 3.154 }, { s84J, 1.142 }, H }; +N l2n102[] = { { s85Ib9, .272 }, H }; +N l2n103[] = { { sAc7, .299 }, H }; +N l2n104[] = { { s86IaaI, .290 }, H }; +N l2n106[] = { { sJ86Ia7, .489 }, { saeI, .163 }, { sgea, .127 }, { sb1Ia9g, .326 }, H }; +N l2n107[] = { { sJ84g, 1.346 }, { sJU, .272 }, H }; +N l2n108[] = { { s88J81, .163 }, H }; +N l2n110[] = { { sf2g, .408 }, { sgc7UJ, .217 }, H }; +N l2n111[] = { { sJ85J, 1.468 }, { sIb4J, .326 }, { sBg, .326 }, H }; +N l2n112[] = { { sgIa8, .598 }, H }; +N l2n113[] = { { sJ8a, 3.072 }, { sIb9, 1.821 }, H }; +N l2n114[] = { { sIaa, 2.338 }, { s85J8a, .217 }, H }; +N l2n115[] = { { s85I, 1.160 }, { sJ86Iaa, .489 }, H }; +N l2n117[] = { { sJ86I, 1.305 }, { sIb5I, .285 }, { sUe9g, .367 }, H }; +N l2n118[] = { { seag, .489 }, H }; +N l2n120[] = { { sadIa7, .163 }, H }; +N l2n123[] = { { sJ87Ia7, .652 }, { sIb6Ia7, .381 }, H }; +N l2n124[] = { { sb9J84, .353 }, { sJ85g, .612 }, { sb1Ia7I, .254 }, H }; +N l2n125[] = { { sgJ84I, .217 }, { sJ85Ib3, .326 }, H }; +N l2n126[] = { { sJ84Ib9, .435 }, H }; +N l2n128[] = { { sJ86J, .530 }, { sUe8cce8, .435 }, { sgJ84J, .254 }, { sIb5J, .245 }, H }; +N l2n129[] = { { s84Ia7, .924 }, { sgJ88g, .580 }, H }; +N l2n130[] = { { sIba, .217 }, H }; +N l2n131[] = { { sIab, .353 }, { sc7ca, .190 }, H }; +N l2n132[] = { { s85J, .652 }, { sa7Ib9, .272 }, H }; +N l2n133[] = { { sIa7Iaa, 1.087 }, H }; +N l2n134[] = { { sJ87I, .652 }, { sgIaa, .326 }, { sIb6I, .449 }, H }; +N l2n135[] = { { sIa7I, 3.507 }, { sb9g, .381 }, H }; +N l2n136[] = { { sgJ85I, .689 }, { s88Ia7J, .254 }, H }; +N l2n137[] = { { safI, .290 }, { saaIb1, .245 }, H }; +N l2n139[] = { { sgJ85J, .652 }, H }; +N l2n140[] = { { sJ88Ia7, .598 }, H }; +N l2n141[] = { { sJ86g, 1.957 }, { sIa8Ia7, .489 }, { s88J84, .190 }, H }; +N l2n143[] = { { sb1g, .408 }, { sJ85Ib9, .544 }, { sb6Ia7, .190 }, H }; +N l2n144[] = { { se7c7g, .489 }, { sc7UJ, .245 }, H }; +N l2n145[] = { { sa7I, 1.559 }, { sJ87J, .285 }, { s86J8a, .163 }, H }; +N l2n146[] = { { sIa7J, 7.177 }, { s86I, .580 }, { sgc7UV, .254 }, H }; +N l2n148[] = { { sIac, .435 }, H }; +N l2n150[] = { { sIadJ8a, .381 }, H }; +N l2n151[] = { { sa9g, 2.012 }, { sJ88I, 1.264 }, { s84Ia9, .190 }, H }; +N l2n152[] = { { sIa8I, 1.346 }, { s88g, .489 }, { s88J85, .272 }, H }; +N l2n153[] = { { sc7Ue8cc, .435 }, H }; +N l2n154[] = { { sIa7Ib1, .652 }, { safJ, .199 }, { s81Ia9g, .381 }, { sb1J86, .163 }, H }; +N l2n155[] = { { sgc7Ue8, .362 }, H }; +N l2n156[] = { { se8cce8, .449 }, { seaW, .163 }, H }; +N l2n159[] = { { sIa7g, 2.141 }, H }; +N l2n160[] = { { s85Ia7, .544 }, { sIa7Ib3, .544 }, H }; +N l2n162[] = { { sa7J, 3.190 }, { sJ88J, 1.753 }, { s84Iaa, .408 }, H }; +N l2n163[] = { { sIa8J, .938 }, { s86J, .236 }, { s88J86, .245 }, { sa8Ib9, .163 }, H }; +N l2n164[] = { { s84J85I, .399 }, { se8cc, .299 }, H }; +N l2n165[] = { { sIad, .761 }, H }; +N l2n166[] = { { s85J86g, .435 }, H }; +N l2n167[] = { { sgIad, .163 }, H }; +N l2n168[] = { { s84J89g, .544 }, H }; +N l2n169[] = { { s8aIb1, .408 }, { sgJ88I, .435 }, { s83J88J, .217 }, H }; +N l2n172[] = { { sgJ88J, .471 }, { s85Ib3I, .217 }, H }; +N l2n173[] = { { seae7, .163 }, H }; +N l2n174[] = { { sJ8aIa7, .544 }, { sIb9Ia7, .381 }, H }; +N l2n175[] = { { sJ88g, 1.101 }, { sIaaIa7, .381 }, { sa8J8a, .163 }, H }; +N l2n176[] = { { sa8I, .598 }, H }; +N l2n177[] = { { s8aIa9g, 1.414 }, { s87I, .290 }, H }; +N l2n178[] = { { sIa7Ib9, .544 }, H }; +N l2n180[] = { { sJ8aIa9, 1.414 }, H }; +N l2n182[] = { { saag, .598 }, { sIae, .245 }, { sgIb9J, .326 }, H }; +N l2n183[] = { { s89g, .462 }, { sJ8aIaa, .326 }, H }; +N l2n185[] = { { sJ8aI, 2.854 }, { sIb9I, .775 }, H }; +N l2n186[] = { { sIaaI, 1.427 }, H }; +N l2n188[] = { { sUg, .367 }, H }; +N l2n190[] = { { sb9J8a, .190 }, { se8Wg, .367 }, H }; +N l2n191[] = { { sb9I, .344 }, { s86Ia7, .245 }, { sc7Wg, .367 }, H }; +N l2n192[] = { { sJ89g, 1.040 }, H }; +N l2n193[] = { { sIa9g, 4.526 }, { sa8J, .417 }, { sIaaIad, .326 }, H }; +N l2n194[] = { { s87J, .127 }, H }; +N l2n195[] = { { s84Iad, .190 }, { s8aIa7I, .254 }, { sIa8Ib9, .326 }, H }; +N l2n196[] = { { sIb9J, 1.386 }, { sJ8aJ, .775 }, { sa7J86g, .544 }, H }; +N l2n197[] = { { sIaaJ, 1.183 }, H }; +N l2n198[] = { { sb1J8a, .326 }, H }; +N l2n199[] = { { sIaf, .951 }, { sb1I, .435 }, { sAc7g, .367 }, H }; +N l2n200[] = { { sUe8cc, .326 }, H }; +N l2n201[] = { { sJ81J8a, .761 }, { sRea, .190 }, H }; +N l2n202[] = { { sa7Ib3I, .326 }, H }; +N l2n204[] = { { sJ8aIb1, .816 }, H }; +N l2n205[] = { { sIaaIb1, .489 }, H }; +N l2n206[] = { { sIb1J86, .326 }, H }; +N l2n207[] = { { s84Ib9I, .217 }, H }; +N l2n208[] = { { sb9J, .616 }, { s88I, .562 }, { sadIaf, .163 }, H }; +N l2n209[] = { { sJ8ag, 1.468 }, { sIb9g, .856 }, { sgR, .145 }, { sUV, .217 }, { sIacIa7, .326 }, H }; +N l2n210[] = { { sIaag, 1.346 }, { sadJ8aI, .254 }, H }; +N l2n211[] = { { sgc3, .236 }, { sUc7, .245 }, H }; +N l2n212[] = { { sgJ81, .408 }, H }; +N l2n213[] = { { sIbaJ, .245 }, H }; +N l2n214[] = { { sa7J84I, 2.864 }, { s8ag, .652 }, { sb4J83, .163 }, H }; +N l2n215[] = { { se8cf, .326 }, H }; +N l2n216[] = { { sJ81, .924 }, { sb1J, .580 }, { sIb0, .217 }, H }; +N l2n217[] = { { sa7J84J, 1.341 }, H }; +N l2n218[] = { { sIb1J8a, .652 }, H }; +N l2n219[] = { { s84J8aI, .217 }, H }; +N l2n220[] = { { sIacI, .285 }, H }; +N l2n221[] = { { sa8Ia7, .245 }, H }; +N l2n222[] = { { s87Ia7, .326 }, H }; +N l2n223[] = { { sa7Iaa, .544 }, H }; +N l2n224[] = { { s86Iaa, .245 }, H }; +N l2n225[] = { { s88J, .779 }, { sa7J85I, .217 }, { s84Ia7g, .326 }, H }; +N l2n226[] = { { sIadIa7, .326 }, H }; +N l2n227[] = { { sgc7U, 1.223 }, H }; +N l2n228[] = { { sa7J85J, .362 }, H }; +N l2n229[] = { { saaIadI, .217 }, { sJ83J88, .326 }, H }; +N l2n231[] = { { sJ84J83, .435 }, { sIacJ, .245 }, H }; +N l2n233[] = { { sIb1, 1.930 }, { sJ82, .489 }, { sgIb3, .163 }, H }; +N l2n234[] = { { sgJ83, .217 }, H }; +N l2n236[] = { { sb9Ia7, .190 }, { sa7J86I, .254 }, H }; +N l2n237[] = { { sJ84J85, .979 }, { sIadI, .652 }, { sgIa7I, .326 }, { s83Ia7J, .254 }, { saaJ8a, .163 }, H }; +N l2n238[] = { { saaI, .634 }, H }; +N l2n239[] = { { sbaJ, .109 }, H }; +N l2n240[] = { { sgIa7J, 3.878 }, H }; +N l2n241[] = { { s85Ib9J, .290 }, H }; +N l2n242[] = { { seeg, .612 }, { sVc7, .163 }, H }; +N l2n244[] = { { sb1Ia7, .272 }, { sacg, .190 }, H }; +N l2n245[] = { { sgJ84, .353 }, H }; +N l2n246[] = { { s81J8a, .381 }, { sJ84J88, .326 }, H }; +N l2n247[] = { { s81I, .236 }, { s84Ia9g, .381 }, H }; +N l2n248[] = { { sgIa8I, .616 }, { sIadJ, .449 }, { sIb4J83, .326 }, H }; +N l2n249[] = { { sJ84J89, .544 }, { sgc7W, .163 }, H }; +N l2n250[] = { { sJ83, 1.305 }, { sWg, 1.183 }, { sIb2, .245 }, { sIadIaf, .326 }, H }; +N l2n251[] = { { sIa3, .326 }, { sJ85J84, .326 }, H }; +N l2n252[] = { { sJ84J8a, .544 }, H }; +N l2n253[] = { { s88Ia7, .299 }, { s83g, .190 }, H }; +N l2n254[] = { { sIaeI, .367 }, H }; +N l2n255[] = { { saaJ, .526 }, H }; + +D l2_d = { "arabic", "iso-8859-6", - { - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,0.000,0.000,W,W,W,W,W,W,0.001,W,W,0.001,0.000,0.000,W, - W,W,0.000,0.000,W,0.000,W,0.000,W,W,W,W,W,W,W,W, - 0.001,0.025,0.013,0.035,0.136,0.080,0.056,0.017,0.067,0.012,0.082,0.001,0.001,Y,Y,Y, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - 0.001,0.003,Y,0.009,0.001,0.004,0.004,0.215,0.042,0.054,0.062,0.009,0.015,0.020,0.007,0.025, - 0.006,0.051,0.007,0.022,0.014,0.009,0.010,0.005,0.002,0.049,0.006,Y,Y,Y,Y,0.002, - Y,0.001,V,0.021,V,0.003,0.003,0.144,0.029,0.011,0.025,0.004,0.027,0.017,0.009,0.026, - 0.017,0.038,0.001,0.011,0.004,0.004,0.010,0.004,0.975,0.816,0.003,V,V,V,V,V, - V,0.023,0.012,0.025,0.097,0.049,0.051,0.035,0.078,0.009,0.054,0.001,V,0.003,0.027,0.015, - 0.009,0.007,0.017,V,V,V,V,V,V,V,V,V,V,V,V,V - }, - { - l2n0,l2n1,X,X,l2n4,l2n5,l2n6,l2n7,l2n8,l2n9,l2n10,l2n11,l2n12,l2n13,l2n14,l2n15, - X,l2n17,X,X,l2n20,l2n21,l2n22,l2n23,X,l2n25,l2n26,l2n27,l2n28,X,l2n30,l2n31, - l2n32,l2n33,X,X,l2n36,l2n37,l2n38,l2n39,l2n40,X,X,l2n43,l2n44,l2n45,l2n46,X, - l2n48,l2n49,X,X,l2n52,l2n53,X,l2n55,l2n56,l2n57,l2n58,l2n59,l2n60,l2n61,l2n62,l2n63, - X,l2n65,l2n66,l2n67,X,X,l2n70,l2n71,l2n72,l2n73,l2n74,l2n75,X,l2n77,l2n78,l2n79, - l2n80,l2n81,X,l2n83,l2n84,X,l2n86,l2n87,l2n88,l2n89,l2n90,X,l2n92,l2n93,l2n94,l2n95, - l2n96,l2n97,l2n98,l2n99,l2n100,l2n101,l2n102,l2n103,l2n104,X,l2n106,l2n107,l2n108,X,l2n110,l2n111, - l2n112,l2n113,l2n114,l2n115,X,l2n117,l2n118,X,l2n120,X,X,l2n123,l2n124,l2n125,l2n126,X, - l2n128,l2n129,l2n130,l2n131,l2n132,l2n133,l2n134,l2n135,l2n136,l2n137,X,l2n139,l2n140,l2n141,X,l2n143, - l2n144,l2n145,l2n146,X,l2n148,X,l2n150,l2n151,l2n152,l2n153,l2n154,l2n155,l2n156,X,X,l2n159, - l2n160,X,l2n162,l2n163,l2n164,l2n165,l2n166,l2n167,l2n168,l2n169,X,X,l2n172,l2n173,l2n174,l2n175, - l2n176,l2n177,l2n178,X,l2n180,X,l2n182,l2n183,X,l2n185,l2n186,X,l2n188,X,l2n190,l2n191, - l2n192,l2n193,l2n194,l2n195,l2n196,l2n197,l2n198,l2n199,l2n200,l2n201,l2n202,X,l2n204,l2n205,l2n206,l2n207, - l2n208,l2n209,l2n210,l2n211,l2n212,l2n213,l2n214,l2n215,l2n216,l2n217,l2n218,l2n219,l2n220,l2n221,l2n222,l2n223, - l2n224,l2n225,l2n226,l2n227,l2n228,l2n229,X,l2n231,X,l2n233,l2n234,X,l2n236,l2n237,l2n238,l2n239, - l2n240,l2n241,l2n242,X,l2n244,l2n245,l2n246,l2n247,l2n248,l2n249,l2n250,l2n251,l2n252,l2n253,l2n254,l2n255 - } + { W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, 0.000, 0.000, W, W, W, W, W, W, 0.001, W, W, 0.001, 0.000, 0.000, W, + W, W, 0.000, 0.000, W, 0.000, W, 0.000, W, W, W, W, W, W, W, W, + 0.001, 0.025, 0.013, 0.035, 0.136, 0.080, 0.056, 0.017, 0.067, 0.012, 0.082, 0.001, 0.001, Y, Y, Y, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + 0.001, 0.003, Y, 0.009, 0.001, 0.004, 0.004, 0.215, 0.042, 0.054, 0.062, 0.009, 0.015, 0.020, 0.007, 0.025, + 0.006, 0.051, 0.007, 0.022, 0.014, 0.009, 0.010, 0.005, 0.002, 0.049, 0.006, Y, Y, Y, Y, 0.002, + Y, 0.001, V, 0.021, V, 0.003, 0.003, 0.144, 0.029, 0.011, 0.025, 0.004, 0.027, 0.017, 0.009, 0.026, + 0.017, 0.038, 0.001, 0.011, 0.004, 0.004, 0.010, 0.004, 0.975, 0.816, 0.003, V, V, V, V, V, + V, 0.023, 0.012, 0.025, 0.097, 0.049, 0.051, 0.035, 0.078, 0.009, 0.054, 0.001, V, 0.003, 0.027, 0.015, + 0.009, 0.007, 0.017, V, V, V, V, V, V, V, V, V, V, V, V, V }, + { l2n0, l2n1, X, X, l2n4, l2n5, l2n6, l2n7, l2n8, l2n9, l2n10, l2n11, l2n12, l2n13, l2n14, l2n15, + X, l2n17, X, X, l2n20, l2n21, l2n22, l2n23, X, l2n25, l2n26, l2n27, l2n28, X, l2n30, l2n31, + l2n32, l2n33, X, X, l2n36, l2n37, l2n38, l2n39, l2n40, X, X, l2n43, l2n44, l2n45, l2n46, X, + l2n48, l2n49, X, X, l2n52, l2n53, X, l2n55, l2n56, l2n57, l2n58, l2n59, l2n60, l2n61, l2n62, l2n63, + X, l2n65, l2n66, l2n67, X, X, l2n70, l2n71, l2n72, l2n73, l2n74, l2n75, X, l2n77, l2n78, l2n79, + l2n80, l2n81, X, l2n83, l2n84, X, l2n86, l2n87, l2n88, l2n89, l2n90, X, l2n92, l2n93, l2n94, l2n95, + l2n96, l2n97, l2n98, l2n99, l2n100, l2n101, l2n102, l2n103, l2n104, X, l2n106, l2n107, l2n108, X, l2n110, l2n111, + l2n112, l2n113, l2n114, l2n115, X, l2n117, l2n118, X, l2n120, X, X, l2n123, l2n124, l2n125, l2n126, X, + l2n128, l2n129, l2n130, l2n131, l2n132, l2n133, l2n134, l2n135, l2n136, l2n137, X, l2n139, l2n140, l2n141, X, l2n143, + l2n144, l2n145, l2n146, X, l2n148, X, l2n150, l2n151, l2n152, l2n153, l2n154, l2n155, l2n156, X, X, l2n159, + l2n160, X, l2n162, l2n163, l2n164, l2n165, l2n166, l2n167, l2n168, l2n169, X, X, l2n172, l2n173, l2n174, l2n175, + l2n176, l2n177, l2n178, X, l2n180, X, l2n182, l2n183, X, l2n185, l2n186, X, l2n188, X, l2n190, l2n191, + l2n192, l2n193, l2n194, l2n195, l2n196, l2n197, l2n198, l2n199, l2n200, l2n201, l2n202, X, l2n204, l2n205, l2n206, l2n207, + l2n208, l2n209, l2n210, l2n211, l2n212, l2n213, l2n214, l2n215, l2n216, l2n217, l2n218, l2n219, l2n220, l2n221, l2n222, l2n223, + l2n224, l2n225, l2n226, l2n227, l2n228, l2n229, X, l2n231, X, l2n233, l2n234, X, l2n236, l2n237, l2n238, l2n239, + l2n240, l2n241, l2n242, X, l2n244, l2n245, l2n246, l2n247, l2n248, l2n249, l2n250, l2n251, l2n252, l2n253, l2n254, l2n255 } }; - - // // Lng: basque // Enc: iso-8859-15 // - -S sx7a[]={t,z,0}; -S s7ai[]={z,e,0}; -S sosg[]={k,o,a}; -S s7aX[]={z,97,0}; -S s7ag[]={z,a}; -S sx7ai[]={t,z,e,0}; -S sgYX[]={32,98,97,0}; -S sixX[]={e,t,97,0}; -S sm7a[]={i,z,0}; -S smX[]={i,97,0}; -S sks[]={g,o,0}; -S sX7a[]={97,z,0}; -S s7ao[]={z,k,0}; -S sivX[]={e,r,97,0}; -S s7air[]={z,e,n,0}; -S svvm[]={r,r,i,0}; -S sxmo[]={t,i,k,0}; -S ssX[]={o,97,0}; -S sixXg[]={e,t,97,a}; -S skm[]={g,i,0}; -S syw[]={u,s,0}; -S sXog[]={97,k,a}; -S s7airg[]={z,e,n,a}; -S si7ag[]={e,z,a}; -S sXy[]={97,u,0}; -S sgix[]={32,e,t,0}; -S sgi7a[]={32,e,z,0}; -S sgixX[]={32,e,t,97,0}; -S srx7a[]={n,t,z,0}; -S smos[]={i,k,o,0}; -S swoX[]={s,k,97,0}; -S siX[]={e,97,0}; -S sXxi[]={97,t,e,0}; -S sXY[]={97,98,0}; -S sXxm[]={97,t,i,0}; -S sxyg[]={t,u,a}; -S siywo[]={e,u,s,k,0}; -S sywo[]={u,s,k,0}; -S sikm[]={e,g,i,0}; -S sgiyw[]={32,e,u,s,0}; -S sxXrg[]={t,97,n,a}; -S sgiy[]={32,e,u,0}; -S siyw[]={e,u,s,0}; -S sx7aX[]={t,z,97,0}; -S sx7air[]={t,z,e,n,0}; -S s7ax[]={z,t,0}; -S sywoX[]={u,s,k,97,0}; -S smoX[]={i,k,97,0}; -S smx7a[]={i,t,z,0}; -S sYiv[]={98,e,r,0}; -S sYXx[]={98,97,t,0}; -S sgYXx[]={32,98,97,t,0}; -S svir[]={r,e,n,0}; -S sgiv[]={32,e,r,0}; -S sivi[]={e,r,e,0}; -S smY[]={i,98,0}; -S sgik[]={32,e,g,0}; -S sy7a[]={u,z,0}; -S sYmp[]={98,i,l,0}; -S sYXm[]={98,97,i,0}; -S sil[]={e,h,0}; -S sXx7a[]={97,t,z,0}; -S sXvX[]={97,r,97,0}; -S sit[]={e,p,0}; -S sXl[]={97,h,0}; -S sqXx[]={m,97,t,0}; -S shXg[]={d,97,a}; -S sXmx[]={97,i,t,0}; -S sios[]={e,k,o,0}; -S soXp[]={k,97,l,0}; -S sXxmo[]={97,t,i,k,0}; -S siosg[]={e,k,o,a}; -S sXmr[]={97,i,n,0}; -S sti[]={p,e,0}; -S sXvv[]={97,r,r,0}; -S sivv[]={e,r,r,0}; -S ssXg[]={o,97,a}; -S spXg[]={l,97,a}; -S sgm7a[]={32,i,z,0}; -S sXks[]={97,g,o,0}; -S svirg[]={r,e,n,a}; -S syi[]={u,e,0}; -S sgrX[]={32,n,97,0}; -S sXvm[]={97,r,i,0}; -S sXqX[]={97,m,97,0}; -S sXxy[]={97,t,u,0}; -S sXYm[]={97,98,i,0}; -S sXph[]={97,l,d,0}; -S smXg[]={i,97,a}; -S syx[]={u,t,0}; -S sqXxm[]={m,97,t,i,0}; -S sksg[]={g,o,a}; -S sph[]={l,d,0}; -S sgYiv[]={32,98,e,r,0}; -S srx7ai[]={n,t,z,e,0}; -S svmog[]={r,i,k,a}; -S svmo[]={r,i,k,0}; -S slXv[]={h,97,r,0}; -S sivXY[]={e,r,97,98,0}; -S sXos[]={97,k,o,0}; -S sgivX[]={32,e,r,97,0}; -S sirX[]={e,n,97,0}; -S sghy[]={32,d,u,0}; -S sghXg[]={32,d,97,a}; -S sosX[]={k,o,97,0}; -S sXpX[]={97,l,97,0}; -S sXYmp[]={97,98,i,l,0}; -S sgikm[]={32,e,g,i,0}; -S s7aos[]={z,k,o,0}; -S sosr[]={k,o,n,0}; -S svy[]={r,u,0}; -S sqy[]={m,u,0}; -S svXY[]={r,97,98,0}; -S sxiv[]={t,e,r,0}; -S s7axi[]={z,t,e,0}; -S svX7a[]={r,97,z,0}; -S sg7ai[]={32,z,e,0}; -S siXg[]={e,97,a}; -S svmX[]={r,i,97,0}; -S sivvm[]={e,r,r,i,0}; -S svXYm[]={r,97,98,i,0}; -S swy[]={s,u,0}; -S s7aoi[]={z,k,e,0}; -S smxX[]={i,t,97,0}; -S si7aX[]={e,z,97,0}; -S sipX[]={e,l,97,0}; -S soXv[]={k,97,r,0}; -S stxy[]={p,t,u,0}; -S sx7ait[]={t,z,e,p,0}; -S sgX7a[]={32,97,z,0}; -S ssvv[]={o,r,r,0}; -S smxy[]={i,t,u,0}; -S sxXx[]={t,97,t,0}; -S s7aXx[]={z,97,t,0}; -S swoXp[]={s,k,97,l,0}; -S sgkvX[]={32,g,r,97,0}; -S sgih[]={32,e,d,0}; -S sxirg[]={t,e,n,a}; -S s7aXrg[]={z,97,n,a}; -S srXl[]={n,97,h,0}; -S sX7axi[]={97,z,t,e,0}; -S skvXq[]={g,r,97,m,0}; -S skv[]={g,r,0}; -S stx[]={p,t,0}; -S sxw[]={t,s,0}; -S svXq[]={r,97,m,0}; -S sxir[]={t,e,n,0}; -S sms[]={i,o,0}; -S ssrx7a[]={o,n,t,z,0}; -S sitxy[]={e,p,t,u,0}; -S s7aitx[]={z,e,p,t,0}; -S stir[]={p,e,n,0}; -S sxmoX[]={t,i,k,97,0}; -S sgYm[]={32,98,i,0}; -S s7ait[]={z,e,p,0}; -S sirXg[]={e,n,97,a}; -S sxmos[]={t,i,k,o,0}; -S skvX[]={g,r,97,0}; -S sX7ax[]={97,z,t,0}; -S sgYXm[]={32,98,97,i,0}; -S s7aXr[]={z,97,n,0}; -S sm7ao[]={i,z,k,0}; -S srhm[]={n,d,i,0}; -S sgkv[]={32,g,r,0}; -S sgi7ag[]={32,e,z,a}; -S sgXg[]={32,97,a}; -S sm7aX[]={i,z,97,0}; -S sXx7ai[]={97,t,z,e,0}; -S smwx[]={i,s,t,0}; -S svXo[]={r,97,k,0}; -S sosrx[]={k,o,n,t,0}; -S siwx[]={e,s,t,0}; -S sitx[]={e,p,t,0}; -S spx[]={l,t,0}; -S sXvvm[]={97,r,r,i,0}; -S sgXh[]={32,97,d,0}; -S sviw[]={r,e,s,0}; -S smhi[]={i,d,e,0}; -S sphi[]={l,d,e,0}; -S sXqXx[]={97,m,97,t,0}; -S sXphi[]={97,l,d,e,0}; -S sghmv[]={32,d,i,r,0}; -S s7aosg[]={z,k,o,a}; -S sXlm[]={97,h,i,0}; -S sgXhm[]={32,97,d,i,0}; -S sXwy[]={97,s,u,0}; -S sxXo[]={t,97,k,0}; -S shmv[]={d,i,r,0}; -S sgm7aX[]={32,i,z,97,0}; -S svXqX[]={r,97,m,97,0}; -S si7ao[]={e,z,k,0}; -S sXpx[]={97,l,t,0}; -S s7ay[]={z,u,0}; -S sgkiv[]={32,g,e,r,0}; -S slmg[]={h,i,a}; -S sihs[]={e,d,o,0}; -S sso[]={o,k,0}; -S soXx[]={k,97,t,0}; -S svig[]={r,e,a}; -S sgihs[]={32,e,d,o,0}; -S smxi[]={i,t,e,0}; -S sxio[]={t,e,k,0}; -S sm7aXr[]={i,z,97,n,0}; -S smrx[]={i,n,t,0}; -S sXhm[]={97,d,i,0}; -S srXlm[]={n,97,h,i,0}; -S sXosg[]={97,k,o,a}; -S slm7a[]={h,i,z,0}; -S smosg[]={i,k,o,a}; -S sgrXl[]={32,n,97,h,0}; -S silXv[]={e,h,97,r,0}; -S sqyr[]={m,u,n,0}; -S sghip[]={32,d,e,l,0}; -S smXo[]={i,97,k,0}; -S ssxX[]={o,t,97,0}; -S svXr[]={r,97,n,0}; -S sXpm[]={97,l,i,0}; -S sX7ag[]={97,z,a}; -S ssh[]={o,d,0}; -S sixXr[]={e,t,97,n,0}; -S slXvg[]={h,97,r,a}; -S smXog[]={i,97,k,a}; -S sYXp[]={98,97,l,0}; -S svvmX[]={r,r,i,97,0}; -S sgyv[]={32,u,r,0}; -S sx7aXx[]={t,z,97,t,0}; -S sqsh[]={m,o,d,0}; -S sosXg[]={k,o,97,a}; -S sYyv[]={98,u,r,0}; -S sxyX[]={t,u,97,0}; -S sox[]={k,t,0}; -S sYXxg[]={98,97,t,a}; -S smx7aX[]={i,t,z,97,0}; -S sgog[]={32,k,a}; -S s7aXm[]={z,97,i,0}; -S smvi[]={i,r,e,0}; -S slXy[]={h,97,u,0}; -S sXvi[]={97,r,e,0}; -S silX[]={e,h,97,0}; -S sxXw[]={t,97,s,0}; -S sXwyr[]={97,s,u,n,0}; -S shsg[]={d,o,a}; -S sglXy[]={32,h,97,u,0}; -S swoXv[]={s,k,97,r,0}; -S sm7ag[]={i,z,a}; -S sgqy[]={32,m,u,0}; -S srhy[]={n,d,u,0}; - -N l3n0[]={{siy,.191},H}; -N l3n1[]={{stX,.137},{smrx,.143},H}; -N l3n2[]={{sgik,.369},H}; -N l3n3[]={{ssv,.328},H}; -N l3n4[]={{sX7axi,.219},H}; -N l3n5[]={{smr,.601},{sxm,.423},H}; -N l3n6[]={{srx,.382},{sitxy,.219},{s7aosg,.287},{svvmX,.164},H}; -N l3n7[]={{sghm,.369},{sri,.150},H}; -N l3n8[]={{swo,.314},{sXYmp,.246},H}; -N l3n9[]={{slX,.328},H}; -N l3n10[]={{soXp,.225},{soig,.307},{sgosr,.369},H}; -N l3n11[]={{skv,.109},H}; -N l3n12[]={{sgp,.410},{siXg,.277},H}; -N l3n13[]={{sXr,.765},{spm,.260},{swg,.184},H}; -N l3n14[]={{sgki,.277},{sosr,.184},H}; -N l3n15[]={{sgYiv,.410},{sghXg,.369},{sphi,.143},H}; -N l3n16[]={{slXy,.123},H}; -N l3n17[]={{svXqX,.191},{shmx,.123},H}; -N l3n18[]={{sik,.273},H}; -N l3n20[]={{ssw,.178},{skiv,.164},{sirXg,.328},H}; -N l3n21[]={{sog,.963},{shm,.464},{ssh,.082},H}; -N l3n22[]={{sXpX,.184},{sms,.109},{sxXo,.143},H}; -N l3n23[]={{sgm7a,.307},H}; -N l3n26[]={{sixX,.635},H}; -N l3n27[]={{sios,.225},H}; -N l3n29[]={{sgq,.328},H}; -N l3n30[]={{sivXY,.246},H}; -N l3n31[]={{sghip,.246},H}; -N l3n33[]={{sxig,.307},{smXog,.246},H}; -N l3n34[]={{stv,.096},H}; -N l3n35[]={{srXg,.430},{sil,.164},H}; -N l3n36[]={{sivi,.246},{sgqy,.184},H}; -N l3n37[]={{ssx,.164},H}; -N l3n38[]={{sx7a,.724},H}; -N l3n39[]={{sXqX,.205},{svmg,.277},H}; -N l3n40[]={{smX,.396},H}; -N l3n41[]={{srk,.205},{ssrx7a,.219},H}; -N l3n42[]={{sXlm,.143},H}; -N l3n44[]={{sxg,.430},H}; -N l3n45[]={{svs,.109},H}; -N l3n46[]={{sgr,.471},{ski,.150},{sgihs,.287},H}; -N l3n47[]={{sXt,.096},H}; -N l3n49[]={{sxyg,.430},{shig,.215},{sm7ag,.184},H}; -N l3n50[]={{smog,.615},{siywo,.382},H}; -N l3n51[]={{swoX,.307},{s7aXx,.164},{sgi7ag,.328},H}; -N l3n52[]={{spg,.164},{sim,.082},H}; -N l3n53[]={{s7air,.471},H}; -N l3n54[]={{skvX,.164},{sgtv,.215},H}; -N l3n55[]={{s7aX,.519},{sxXr,.287},{sXxmo,.301},{sXvv,.225},{sXph,.205},H}; -N l3n56[]={{sksg,.307},{s7aoi,.184},H}; -N l3n57[]={{smY,.164},{sX7ag,.184},H}; -N l3n58[]={{sXog,.523},{sgm7aX,.287},H}; -N l3n59[]={{srXl,.164},H}; -N l3n61[]={{svir,.266},{sgikm,.369},H}; -N l3n62[]={{sky,.150},H}; -N l3n63[]={{svX,.902},{sgs,.369},H}; -N l3n65[]={{sXY,.205},H}; -N l3n66[]={{ssXg,.307},H}; -N l3n68[]={{srx7a,.307},{stx,.109},H}; -N l3n69[]={{sy7a,.164},{sti,.150},H}; -N l3n70[]={{syo,.123},{sm7aXr,.191},H}; -N l3n73[]={{smv,.178},H}; -N l3n75[]={{syg,.451},{sYXx,.266},{srm,.178},{stxy,.164},{s7ait,.164},{sglm,.246},H}; -N l3n76[]={{soXv,.164},H}; -N l3n77[]={{sli,.150},{sXvx,.123},H}; -N l3n78[]={{silX,.123},H}; -N l3n79[]={{sYX,.560},{slXvg,.246},H}; -N l3n80[]={{sgt,.389},{ssxX,.123},H}; -N l3n81[]={{sXv,.779},{sgX,1.106},{sx7aX,.287},{sg7ai,.277},{s7aXrg,.328},H}; -N l3n82[]={{sglXy,.246},H}; -N l3n84[]={{sos,.915},H}; -N l3n85[]={{si7a,.519},H}; -N l3n86[]={{sio,.219},{smwx,.164},H}; -N l3n89[]={{sgrX,.307},H}; -N l3n90[]={{smw,.178},{sxio,.143},H}; -N l3n91[]={{sig,.881},{smh,.178},{sXks,.205},{sgog,.184},H}; -N l3n93[]={{sghmv,.287},H}; -N l3n94[]={{swX,.123},H}; -N l3n96[]={{svv,.464},{svmo,.184},H}; -N l3n98[]={{sgY,1.434},{sXw,.287},{soXx,.143},H}; -N l3n99[]={{sXh,.137},H}; -N l3n100[]={{sgkiv,.287},{sixXr,.164},H}; -N l3n101[]={{smrg,.307},H}; -N l3n102[]={{soX,.546},{sXphi,.191},H}; -N l3n103[]={{sywo,.287},{sip,.150},H}; -N l3n105[]={{sXwy,.143},H}; -N l3n106[]={{sm7ao,.164},{sosrx,.219},H}; -N l3n107[]={{smx,.560},H}; -N l3n108[]={{smi,.150},H}; -N l3n109[]={{sXrg,1.414},H}; -N l3n110[]={{sXpm,.123},{sxXw,.123},H}; -N l3n114[]={{srg,2.459},{skm,.246},{sXmr,.225},{smrk,.184},{smxy,.164},{sXvvm,.191},H}; -N l3n115[]={{sXx,.902},{srx7ai,.273},H}; -N l3n116[]={{sviw,.143},H}; -N l3n117[]={{svXY,.184},{ship,.123},H}; -N l3n118[]={{srXlm,.191},H}; -N l3n119[]={{swoXp,.219},H}; -N l3n120[]={{siq,.109},H}; -N l3n121[]={{syr,.396},{sYiv,.266},{sxXx,.164},{srhm,.164},H}; -N l3n122[]={{sixXg,.738},{s7ax,.191},{sXxy,.205},H}; -N l3n123[]={{s7ai,.615},{sgiv,.400},{sYmp,.246},{siosg,.451},{shs,.150},{sxir,.164},H}; -N l3n124[]={{sXvX,.246},H}; -N l3n125[]={{sxX,.929},{sx7ai,.635},{svX7a,.184},{skvXq,.219},H}; -N l3n127[]={{sosX,.184},H}; -N l3n128[]={{si7aX,.164},H}; -N l3n130[]={{svx,.328},H}; -N l3n131[]={{svi,.505},{sgw,.205},{sXqXx,.191},H}; -N l3n132[]={{sgh,1.352},{sXy,.232},{sYiw,.123},H}; -N l3n133[]={{spX,.355},H}; -N l3n136[]={{smXg,.307},H}; -N l3n137[]={{sir,1.188},{sYyv,.123},{swoXv,.164},H}; -N l3n138[]={{sywoX,.382},H}; -N l3n139[]={{sghy,.277},{s7ay,.096},{sgyv,.184},H}; -N l3n140[]={{sso,.096},H}; -N l3n141[]={{shX,.478},{sgYX,.953},H}; -N l3n143[]={{sgX7a,.246},H}; -N l3n145[]={{ssg,1.373},{slm,.260},{sgix,.492},{sgrXl,.287},H}; -N l3n146[]={{sqs,.137},{sipX,.164},H}; -N l3n147[]={{sYi,.437},{svy,.123},H}; -N l3n148[]={{sgx,.205},H}; -N l3n149[]={{sgi,1.967},{s7airg,.697},{sikm,.287},H}; -N l3n150[]={{sXk,.246},{smxX,.164},H}; -N l3n151[]={{smos,.307},{sxXrg,.574},H}; -N l3n156[]={{sgiy,.430},{syX,.164},H}; -N l3n157[]={{svirg,.410},{sgkv,.246},{sgXh,.215},H}; -N l3n158[]={{sxmo,.430},{sgivX,.369},H}; -N l3n159[]={{sXos,.184},{svXg,.277},H}; -N l3n160[]={{sqXx,.225},{smvi,.123},H}; -N l3n161[]={{swx,.301},H}; -N l3n164[]={{sqX,.287},{sihs,.143},{silXv,.164},H}; -N l3n165[]={{sgy,.246},H}; -N l3n166[]={{s7aos,.184},H}; -N l3n167[]={{sXl,.164},{sxiv,.184},{s7aitx,.219},{sitx,.164},H}; -N l3n168[]={{sXvi,.123},H}; -N l3n169[]={{smx7a,.266},{sox,.082},H}; -N l3n170[]={{soi,.287},H}; -N l3n171[]={{sit,.164},{sYXxg,.246},H}; -N l3n172[]={{siX,.205},H}; -N l3n173[]={{sx7aXx,.164},H}; -N l3n174[]={{ssq,.082},H}; -N l3n175[]={{sghX,.615},{sxw,.109},H}; -N l3n176[]={{svXYm,.246},H}; -N l3n177[]={{srs,.164},{sXx7a,.246},{sXvg,.246},{sgXg,.246},H}; -N l3n178[]={{swy,.123},{smhi,.143},{sqyr,.123},H}; -N l3n179[]={{sivv,.225},{sXwyr,.164},H}; -N l3n180[]={{sosg,1.260},{sgixX,.656},{sXmx,.225},{sirX,.184},H}; -N l3n181[]={{si7ag,.523},H}; -N l3n183[]={{sgk,.553},H}; -N l3n184[]={{sXm,.519},{sph,.137},H}; -N l3n185[]={{sgYi,.799},H}; -N l3n186[]={{s7aXm,.123},H}; -N l3n187[]={{ssrx,.164},H}; -N l3n189[]={{syv,.301},H}; -N l3n191[]={{ssr,.260},{s7am,.178},H}; -N l3n192[]={{sgos,.430},{svmog,.369},{sgkvX,.328},H}; -N l3n193[]={{sxi,.806},{sxmoX,.219},{smXo,.123},H}; -N l3n194[]={{smxi,.143},H}; -N l3n195[]={{srX,.423},H}; -N l3n196[]={{sXYm,.205},H}; -N l3n197[]={{syrh,.143},H}; -N l3n199[]={{svm,.628},{sx7air,.382},H}; -N l3n200[]={{sgl,.615},{sgYXm,.328},{spx,.109},H}; -N l3n201[]={{spi,.246},{sivx,.246},H}; -N l3n202[]={{sXxi,.307},H}; -N l3n204[]={{smx7aX,.164},H}; -N l3n205[]={{siv,.997},{sx7ait,.219},H}; -N l3n206[]={{syw,.246},H}; -N l3n207[]={{slm7a,.143},H}; -N l3n209[]={{shi,.533},{sxy,.478},{sm7a,.410},{s7axi,.184},H}; -N l3n210[]={{smo,.710},{sYXm,.246},H}; -N l3n211[]={{sgi7a,.492},{sXxg,.338},H}; -N l3n212[]={{sXvm,.205},H}; -N l3n213[]={{sX7ax,.164},H}; -N l3n215[]={{smg,.820},{sYm,.301},H}; -N l3n216[]={{sks,.328},{svXo,.164},{sgXhm,.287},H}; -N l3n217[]={{sgm,.574},{sX7a,.328},{svxi,.123},H}; -N l3n218[]={{sXo,.519},{siwx,.164},H}; -N l3n219[]={{sghi,.676},{sqXxm,.273},{sxirg,.328},{shsg,.184},H}; -N l3n221[]={{sxXg,.707},H}; -N l3n222[]={{siw,.382},{sqsh,.123},H}; -N l3n223[]={{sXg,2.541},{syx,.137},{sih,.123},{sosXg,.246},H}; -N l3n224[]={{syi,.137},{sXx7ai,.219},H}; -N l3n225[]={{s7ao,.314},{shy,.246},{sgih,.246},H}; -N l3n226[]={{ssX,.273},{sgqs,.215},H}; -N l3n227[]={{svvm,.430},{smp,.232},{svig,.215},H}; -N l3n229[]={{spXg,.307},{sgYm,.246},H}; -N l3n230[]={{s7ag,.717},{swm,.260},{sXhm,.143},H}; -N l3n231[]={{sXpx,.143},{stXv,.123},H}; -N l3n233[]={{sirg,1.752},{sgYXx,.533},{ssvv,.164},H}; -N l3n234[]={{skX,.164},{sgn,.143},H}; -N l3n235[]={{sXp,.628},{sxmos,.219},H}; -N l3n237[]={{shXg,.338},H}; -N l3n238[]={{svg,.307},{som,.191},{sivvm,.246},{svXq,.164},{si7ao,.143},H}; -N l3n239[]={{six,.451},{slXv,.184},H}; -N l3n241[]={{siyw,.287},{s7aXr,.164},{slmg,.215},H}; -N l3n242[]={{svmX,.184},H}; -N l3n243[]={{sglX,.338},{sYXp,.123},H}; -N l3n245[]={{sgiyw,.574},H}; -N l3n246[]={{srh,.260},{sXxm,.307},H}; -N l3n247[]={{smosg,.287},H}; -N l3n248[]={{sivX,.471},{swxi,.225},{sqy,.123},H}; -N l3n249[]={{svXr,.123},H}; -N l3n250[]={{sg7a,.307},H}; -N l3n251[]={{sgo,.553},{shmv,.143},H}; -N l3n252[]={{sXq,.164},{sm7aX,.164},{sxyX,.123},H}; -N l3n253[]={{smoX,.266},{srhy,.123},H}; -N l3n255[]={{stir,.164},{sXosg,.287},H}; - -D l3_d = -{ +S sx7a[] = { t, z, 0 }; +S s7ai[] = { z, e, 0 }; +S sosg[] = { k, o, a }; +S s7aX[] = { z, 97, 0 }; +S s7ag[] = { z, a }; +S sx7ai[] = { t, z, e, 0 }; +S sgYX[] = { 32, 98, 97, 0 }; +S sixX[] = { e, t, 97, 0 }; +S sm7a[] = { i, z, 0 }; +S smX[] = { i, 97, 0 }; +S sks[] = { g, o, 0 }; +S sX7a[] = { 97, z, 0 }; +S s7ao[] = { z, k, 0 }; +S sivX[] = { e, r, 97, 0 }; +S s7air[] = { z, e, n, 0 }; +S svvm[] = { r, r, i, 0 }; +S sxmo[] = { t, i, k, 0 }; +S ssX[] = { o, 97, 0 }; +S sixXg[] = { e, t, 97, a }; +S skm[] = { g, i, 0 }; +S syw[] = { u, s, 0 }; +S sXog[] = { 97, k, a }; +S s7airg[] = { z, e, n, a }; +S si7ag[] = { e, z, a }; +S sXy[] = { 97, u, 0 }; +S sgix[] = { 32, e, t, 0 }; +S sgi7a[] = { 32, e, z, 0 }; +S sgixX[] = { 32, e, t, 97, 0 }; +S srx7a[] = { n, t, z, 0 }; +S smos[] = { i, k, o, 0 }; +S swoX[] = { s, k, 97, 0 }; +S siX[] = { e, 97, 0 }; +S sXxi[] = { 97, t, e, 0 }; +S sXY[] = { 97, 98, 0 }; +S sXxm[] = { 97, t, i, 0 }; +S sxyg[] = { t, u, a }; +S siywo[] = { e, u, s, k, 0 }; +S sywo[] = { u, s, k, 0 }; +S sikm[] = { e, g, i, 0 }; +S sgiyw[] = { 32, e, u, s, 0 }; +S sxXrg[] = { t, 97, n, a }; +S sgiy[] = { 32, e, u, 0 }; +S siyw[] = { e, u, s, 0 }; +S sx7aX[] = { t, z, 97, 0 }; +S sx7air[] = { t, z, e, n, 0 }; +S s7ax[] = { z, t, 0 }; +S sywoX[] = { u, s, k, 97, 0 }; +S smoX[] = { i, k, 97, 0 }; +S smx7a[] = { i, t, z, 0 }; +S sYiv[] = { 98, e, r, 0 }; +S sYXx[] = { 98, 97, t, 0 }; +S sgYXx[] = { 32, 98, 97, t, 0 }; +S svir[] = { r, e, n, 0 }; +S sgiv[] = { 32, e, r, 0 }; +S sivi[] = { e, r, e, 0 }; +S smY[] = { i, 98, 0 }; +S sgik[] = { 32, e, g, 0 }; +S sy7a[] = { u, z, 0 }; +S sYmp[] = { 98, i, l, 0 }; +S sYXm[] = { 98, 97, i, 0 }; +S sil[] = { e, h, 0 }; +S sXx7a[] = { 97, t, z, 0 }; +S sXvX[] = { 97, r, 97, 0 }; +S sit[] = { e, p, 0 }; +S sXl[] = { 97, h, 0 }; +S sqXx[] = { m, 97, t, 0 }; +S shXg[] = { d, 97, a }; +S sXmx[] = { 97, i, t, 0 }; +S sios[] = { e, k, o, 0 }; +S soXp[] = { k, 97, l, 0 }; +S sXxmo[] = { 97, t, i, k, 0 }; +S siosg[] = { e, k, o, a }; +S sXmr[] = { 97, i, n, 0 }; +S sti[] = { p, e, 0 }; +S sXvv[] = { 97, r, r, 0 }; +S sivv[] = { e, r, r, 0 }; +S ssXg[] = { o, 97, a }; +S spXg[] = { l, 97, a }; +S sgm7a[] = { 32, i, z, 0 }; +S sXks[] = { 97, g, o, 0 }; +S svirg[] = { r, e, n, a }; +S syi[] = { u, e, 0 }; +S sgrX[] = { 32, n, 97, 0 }; +S sXvm[] = { 97, r, i, 0 }; +S sXqX[] = { 97, m, 97, 0 }; +S sXxy[] = { 97, t, u, 0 }; +S sXYm[] = { 97, 98, i, 0 }; +S sXph[] = { 97, l, d, 0 }; +S smXg[] = { i, 97, a }; +S syx[] = { u, t, 0 }; +S sqXxm[] = { m, 97, t, i, 0 }; +S sksg[] = { g, o, a }; +S sph[] = { l, d, 0 }; +S sgYiv[] = { 32, 98, e, r, 0 }; +S srx7ai[] = { n, t, z, e, 0 }; +S svmog[] = { r, i, k, a }; +S svmo[] = { r, i, k, 0 }; +S slXv[] = { h, 97, r, 0 }; +S sivXY[] = { e, r, 97, 98, 0 }; +S sXos[] = { 97, k, o, 0 }; +S sgivX[] = { 32, e, r, 97, 0 }; +S sirX[] = { e, n, 97, 0 }; +S sghy[] = { 32, d, u, 0 }; +S sghXg[] = { 32, d, 97, a }; +S sosX[] = { k, o, 97, 0 }; +S sXpX[] = { 97, l, 97, 0 }; +S sXYmp[] = { 97, 98, i, l, 0 }; +S sgikm[] = { 32, e, g, i, 0 }; +S s7aos[] = { z, k, o, 0 }; +S sosr[] = { k, o, n, 0 }; +S svy[] = { r, u, 0 }; +S sqy[] = { m, u, 0 }; +S svXY[] = { r, 97, 98, 0 }; +S sxiv[] = { t, e, r, 0 }; +S s7axi[] = { z, t, e, 0 }; +S svX7a[] = { r, 97, z, 0 }; +S sg7ai[] = { 32, z, e, 0 }; +S siXg[] = { e, 97, a }; +S svmX[] = { r, i, 97, 0 }; +S sivvm[] = { e, r, r, i, 0 }; +S svXYm[] = { r, 97, 98, i, 0 }; +S swy[] = { s, u, 0 }; +S s7aoi[] = { z, k, e, 0 }; +S smxX[] = { i, t, 97, 0 }; +S si7aX[] = { e, z, 97, 0 }; +S sipX[] = { e, l, 97, 0 }; +S soXv[] = { k, 97, r, 0 }; +S stxy[] = { p, t, u, 0 }; +S sx7ait[] = { t, z, e, p, 0 }; +S sgX7a[] = { 32, 97, z, 0 }; +S ssvv[] = { o, r, r, 0 }; +S smxy[] = { i, t, u, 0 }; +S sxXx[] = { t, 97, t, 0 }; +S s7aXx[] = { z, 97, t, 0 }; +S swoXp[] = { s, k, 97, l, 0 }; +S sgkvX[] = { 32, g, r, 97, 0 }; +S sgih[] = { 32, e, d, 0 }; +S sxirg[] = { t, e, n, a }; +S s7aXrg[] = { z, 97, n, a }; +S srXl[] = { n, 97, h, 0 }; +S sX7axi[] = { 97, z, t, e, 0 }; +S skvXq[] = { g, r, 97, m, 0 }; +S skv[] = { g, r, 0 }; +S stx[] = { p, t, 0 }; +S sxw[] = { t, s, 0 }; +S svXq[] = { r, 97, m, 0 }; +S sxir[] = { t, e, n, 0 }; +S sms[] = { i, o, 0 }; +S ssrx7a[] = { o, n, t, z, 0 }; +S sitxy[] = { e, p, t, u, 0 }; +S s7aitx[] = { z, e, p, t, 0 }; +S stir[] = { p, e, n, 0 }; +S sxmoX[] = { t, i, k, 97, 0 }; +S sgYm[] = { 32, 98, i, 0 }; +S s7ait[] = { z, e, p, 0 }; +S sirXg[] = { e, n, 97, a }; +S sxmos[] = { t, i, k, o, 0 }; +S skvX[] = { g, r, 97, 0 }; +S sX7ax[] = { 97, z, t, 0 }; +S sgYXm[] = { 32, 98, 97, i, 0 }; +S s7aXr[] = { z, 97, n, 0 }; +S sm7ao[] = { i, z, k, 0 }; +S srhm[] = { n, d, i, 0 }; +S sgkv[] = { 32, g, r, 0 }; +S sgi7ag[] = { 32, e, z, a }; +S sgXg[] = { 32, 97, a }; +S sm7aX[] = { i, z, 97, 0 }; +S sXx7ai[] = { 97, t, z, e, 0 }; +S smwx[] = { i, s, t, 0 }; +S svXo[] = { r, 97, k, 0 }; +S sosrx[] = { k, o, n, t, 0 }; +S siwx[] = { e, s, t, 0 }; +S sitx[] = { e, p, t, 0 }; +S spx[] = { l, t, 0 }; +S sXvvm[] = { 97, r, r, i, 0 }; +S sgXh[] = { 32, 97, d, 0 }; +S sviw[] = { r, e, s, 0 }; +S smhi[] = { i, d, e, 0 }; +S sphi[] = { l, d, e, 0 }; +S sXqXx[] = { 97, m, 97, t, 0 }; +S sXphi[] = { 97, l, d, e, 0 }; +S sghmv[] = { 32, d, i, r, 0 }; +S s7aosg[] = { z, k, o, a }; +S sXlm[] = { 97, h, i, 0 }; +S sgXhm[] = { 32, 97, d, i, 0 }; +S sXwy[] = { 97, s, u, 0 }; +S sxXo[] = { t, 97, k, 0 }; +S shmv[] = { d, i, r, 0 }; +S sgm7aX[] = { 32, i, z, 97, 0 }; +S svXqX[] = { r, 97, m, 97, 0 }; +S si7ao[] = { e, z, k, 0 }; +S sXpx[] = { 97, l, t, 0 }; +S s7ay[] = { z, u, 0 }; +S sgkiv[] = { 32, g, e, r, 0 }; +S slmg[] = { h, i, a }; +S sihs[] = { e, d, o, 0 }; +S sso[] = { o, k, 0 }; +S soXx[] = { k, 97, t, 0 }; +S svig[] = { r, e, a }; +S sgihs[] = { 32, e, d, o, 0 }; +S smxi[] = { i, t, e, 0 }; +S sxio[] = { t, e, k, 0 }; +S sm7aXr[] = { i, z, 97, n, 0 }; +S smrx[] = { i, n, t, 0 }; +S sXhm[] = { 97, d, i, 0 }; +S srXlm[] = { n, 97, h, i, 0 }; +S sXosg[] = { 97, k, o, a }; +S slm7a[] = { h, i, z, 0 }; +S smosg[] = { i, k, o, a }; +S sgrXl[] = { 32, n, 97, h, 0 }; +S silXv[] = { e, h, 97, r, 0 }; +S sqyr[] = { m, u, n, 0 }; +S sghip[] = { 32, d, e, l, 0 }; +S smXo[] = { i, 97, k, 0 }; +S ssxX[] = { o, t, 97, 0 }; +S svXr[] = { r, 97, n, 0 }; +S sXpm[] = { 97, l, i, 0 }; +S sX7ag[] = { 97, z, a }; +S ssh[] = { o, d, 0 }; +S sixXr[] = { e, t, 97, n, 0 }; +S slXvg[] = { h, 97, r, a }; +S smXog[] = { i, 97, k, a }; +S sYXp[] = { 98, 97, l, 0 }; +S svvmX[] = { r, r, i, 97, 0 }; +S sgyv[] = { 32, u, r, 0 }; +S sx7aXx[] = { t, z, 97, t, 0 }; +S sqsh[] = { m, o, d, 0 }; +S sosXg[] = { k, o, 97, a }; +S sYyv[] = { 98, u, r, 0 }; +S sxyX[] = { t, u, 97, 0 }; +S sox[] = { k, t, 0 }; +S sYXxg[] = { 98, 97, t, a }; +S smx7aX[] = { i, t, z, 97, 0 }; +S sgog[] = { 32, k, a }; +S s7aXm[] = { z, 97, i, 0 }; +S smvi[] = { i, r, e, 0 }; +S slXy[] = { h, 97, u, 0 }; +S sXvi[] = { 97, r, e, 0 }; +S silX[] = { e, h, 97, 0 }; +S sxXw[] = { t, 97, s, 0 }; +S sXwyr[] = { 97, s, u, n, 0 }; +S shsg[] = { d, o, a }; +S sglXy[] = { 32, h, 97, u, 0 }; +S swoXv[] = { s, k, 97, r, 0 }; +S sm7ag[] = { i, z, a }; +S sgqy[] = { 32, m, u, 0 }; +S srhy[] = { n, d, u, 0 }; + +N l3n0[] = { { siy, .191 }, H }; +N l3n1[] = { { stX, .137 }, { smrx, .143 }, H }; +N l3n2[] = { { sgik, .369 }, H }; +N l3n3[] = { { ssv, .328 }, H }; +N l3n4[] = { { sX7axi, .219 }, H }; +N l3n5[] = { { smr, .601 }, { sxm, .423 }, H }; +N l3n6[] = { { srx, .382 }, { sitxy, .219 }, { s7aosg, .287 }, { svvmX, .164 }, H }; +N l3n7[] = { { sghm, .369 }, { sri, .150 }, H }; +N l3n8[] = { { swo, .314 }, { sXYmp, .246 }, H }; +N l3n9[] = { { slX, .328 }, H }; +N l3n10[] = { { soXp, .225 }, { soig, .307 }, { sgosr, .369 }, H }; +N l3n11[] = { { skv, .109 }, H }; +N l3n12[] = { { sgp, .410 }, { siXg, .277 }, H }; +N l3n13[] = { { sXr, .765 }, { spm, .260 }, { swg, .184 }, H }; +N l3n14[] = { { sgki, .277 }, { sosr, .184 }, H }; +N l3n15[] = { { sgYiv, .410 }, { sghXg, .369 }, { sphi, .143 }, H }; +N l3n16[] = { { slXy, .123 }, H }; +N l3n17[] = { { svXqX, .191 }, { shmx, .123 }, H }; +N l3n18[] = { { sik, .273 }, H }; +N l3n20[] = { { ssw, .178 }, { skiv, .164 }, { sirXg, .328 }, H }; +N l3n21[] = { { sog, .963 }, { shm, .464 }, { ssh, .082 }, H }; +N l3n22[] = { { sXpX, .184 }, { sms, .109 }, { sxXo, .143 }, H }; +N l3n23[] = { { sgm7a, .307 }, H }; +N l3n26[] = { { sixX, .635 }, H }; +N l3n27[] = { { sios, .225 }, H }; +N l3n29[] = { { sgq, .328 }, H }; +N l3n30[] = { { sivXY, .246 }, H }; +N l3n31[] = { { sghip, .246 }, H }; +N l3n33[] = { { sxig, .307 }, { smXog, .246 }, H }; +N l3n34[] = { { stv, .096 }, H }; +N l3n35[] = { { srXg, .430 }, { sil, .164 }, H }; +N l3n36[] = { { sivi, .246 }, { sgqy, .184 }, H }; +N l3n37[] = { { ssx, .164 }, H }; +N l3n38[] = { { sx7a, .724 }, H }; +N l3n39[] = { { sXqX, .205 }, { svmg, .277 }, H }; +N l3n40[] = { { smX, .396 }, H }; +N l3n41[] = { { srk, .205 }, { ssrx7a, .219 }, H }; +N l3n42[] = { { sXlm, .143 }, H }; +N l3n44[] = { { sxg, .430 }, H }; +N l3n45[] = { { svs, .109 }, H }; +N l3n46[] = { { sgr, .471 }, { ski, .150 }, { sgihs, .287 }, H }; +N l3n47[] = { { sXt, .096 }, H }; +N l3n49[] = { { sxyg, .430 }, { shig, .215 }, { sm7ag, .184 }, H }; +N l3n50[] = { { smog, .615 }, { siywo, .382 }, H }; +N l3n51[] = { { swoX, .307 }, { s7aXx, .164 }, { sgi7ag, .328 }, H }; +N l3n52[] = { { spg, .164 }, { sim, .082 }, H }; +N l3n53[] = { { s7air, .471 }, H }; +N l3n54[] = { { skvX, .164 }, { sgtv, .215 }, H }; +N l3n55[] = { { s7aX, .519 }, { sxXr, .287 }, { sXxmo, .301 }, { sXvv, .225 }, { sXph, .205 }, H }; +N l3n56[] = { { sksg, .307 }, { s7aoi, .184 }, H }; +N l3n57[] = { { smY, .164 }, { sX7ag, .184 }, H }; +N l3n58[] = { { sXog, .523 }, { sgm7aX, .287 }, H }; +N l3n59[] = { { srXl, .164 }, H }; +N l3n61[] = { { svir, .266 }, { sgikm, .369 }, H }; +N l3n62[] = { { sky, .150 }, H }; +N l3n63[] = { { svX, .902 }, { sgs, .369 }, H }; +N l3n65[] = { { sXY, .205 }, H }; +N l3n66[] = { { ssXg, .307 }, H }; +N l3n68[] = { { srx7a, .307 }, { stx, .109 }, H }; +N l3n69[] = { { sy7a, .164 }, { sti, .150 }, H }; +N l3n70[] = { { syo, .123 }, { sm7aXr, .191 }, H }; +N l3n73[] = { { smv, .178 }, H }; +N l3n75[] = { { syg, .451 }, { sYXx, .266 }, { srm, .178 }, { stxy, .164 }, { s7ait, .164 }, { sglm, .246 }, H }; +N l3n76[] = { { soXv, .164 }, H }; +N l3n77[] = { { sli, .150 }, { sXvx, .123 }, H }; +N l3n78[] = { { silX, .123 }, H }; +N l3n79[] = { { sYX, .560 }, { slXvg, .246 }, H }; +N l3n80[] = { { sgt, .389 }, { ssxX, .123 }, H }; +N l3n81[] = { { sXv, .779 }, { sgX, 1.106 }, { sx7aX, .287 }, { sg7ai, .277 }, { s7aXrg, .328 }, H }; +N l3n82[] = { { sglXy, .246 }, H }; +N l3n84[] = { { sos, .915 }, H }; +N l3n85[] = { { si7a, .519 }, H }; +N l3n86[] = { { sio, .219 }, { smwx, .164 }, H }; +N l3n89[] = { { sgrX, .307 }, H }; +N l3n90[] = { { smw, .178 }, { sxio, .143 }, H }; +N l3n91[] = { { sig, .881 }, { smh, .178 }, { sXks, .205 }, { sgog, .184 }, H }; +N l3n93[] = { { sghmv, .287 }, H }; +N l3n94[] = { { swX, .123 }, H }; +N l3n96[] = { { svv, .464 }, { svmo, .184 }, H }; +N l3n98[] = { { sgY, 1.434 }, { sXw, .287 }, { soXx, .143 }, H }; +N l3n99[] = { { sXh, .137 }, H }; +N l3n100[] = { { sgkiv, .287 }, { sixXr, .164 }, H }; +N l3n101[] = { { smrg, .307 }, H }; +N l3n102[] = { { soX, .546 }, { sXphi, .191 }, H }; +N l3n103[] = { { sywo, .287 }, { sip, .150 }, H }; +N l3n105[] = { { sXwy, .143 }, H }; +N l3n106[] = { { sm7ao, .164 }, { sosrx, .219 }, H }; +N l3n107[] = { { smx, .560 }, H }; +N l3n108[] = { { smi, .150 }, H }; +N l3n109[] = { { sXrg, 1.414 }, H }; +N l3n110[] = { { sXpm, .123 }, { sxXw, .123 }, H }; +N l3n114[] = { { srg, 2.459 }, { skm, .246 }, { sXmr, .225 }, { smrk, .184 }, { smxy, .164 }, { sXvvm, .191 }, H }; +N l3n115[] = { { sXx, .902 }, { srx7ai, .273 }, H }; +N l3n116[] = { { sviw, .143 }, H }; +N l3n117[] = { { svXY, .184 }, { ship, .123 }, H }; +N l3n118[] = { { srXlm, .191 }, H }; +N l3n119[] = { { swoXp, .219 }, H }; +N l3n120[] = { { siq, .109 }, H }; +N l3n121[] = { { syr, .396 }, { sYiv, .266 }, { sxXx, .164 }, { srhm, .164 }, H }; +N l3n122[] = { { sixXg, .738 }, { s7ax, .191 }, { sXxy, .205 }, H }; +N l3n123[] = { { s7ai, .615 }, { sgiv, .400 }, { sYmp, .246 }, { siosg, .451 }, { shs, .150 }, { sxir, .164 }, H }; +N l3n124[] = { { sXvX, .246 }, H }; +N l3n125[] = { { sxX, .929 }, { sx7ai, .635 }, { svX7a, .184 }, { skvXq, .219 }, H }; +N l3n127[] = { { sosX, .184 }, H }; +N l3n128[] = { { si7aX, .164 }, H }; +N l3n130[] = { { svx, .328 }, H }; +N l3n131[] = { { svi, .505 }, { sgw, .205 }, { sXqXx, .191 }, H }; +N l3n132[] = { { sgh, 1.352 }, { sXy, .232 }, { sYiw, .123 }, H }; +N l3n133[] = { { spX, .355 }, H }; +N l3n136[] = { { smXg, .307 }, H }; +N l3n137[] = { { sir, 1.188 }, { sYyv, .123 }, { swoXv, .164 }, H }; +N l3n138[] = { { sywoX, .382 }, H }; +N l3n139[] = { { sghy, .277 }, { s7ay, .096 }, { sgyv, .184 }, H }; +N l3n140[] = { { sso, .096 }, H }; +N l3n141[] = { { shX, .478 }, { sgYX, .953 }, H }; +N l3n143[] = { { sgX7a, .246 }, H }; +N l3n145[] = { { ssg, 1.373 }, { slm, .260 }, { sgix, .492 }, { sgrXl, .287 }, H }; +N l3n146[] = { { sqs, .137 }, { sipX, .164 }, H }; +N l3n147[] = { { sYi, .437 }, { svy, .123 }, H }; +N l3n148[] = { { sgx, .205 }, H }; +N l3n149[] = { { sgi, 1.967 }, { s7airg, .697 }, { sikm, .287 }, H }; +N l3n150[] = { { sXk, .246 }, { smxX, .164 }, H }; +N l3n151[] = { { smos, .307 }, { sxXrg, .574 }, H }; +N l3n156[] = { { sgiy, .430 }, { syX, .164 }, H }; +N l3n157[] = { { svirg, .410 }, { sgkv, .246 }, { sgXh, .215 }, H }; +N l3n158[] = { { sxmo, .430 }, { sgivX, .369 }, H }; +N l3n159[] = { { sXos, .184 }, { svXg, .277 }, H }; +N l3n160[] = { { sqXx, .225 }, { smvi, .123 }, H }; +N l3n161[] = { { swx, .301 }, H }; +N l3n164[] = { { sqX, .287 }, { sihs, .143 }, { silXv, .164 }, H }; +N l3n165[] = { { sgy, .246 }, H }; +N l3n166[] = { { s7aos, .184 }, H }; +N l3n167[] = { { sXl, .164 }, { sxiv, .184 }, { s7aitx, .219 }, { sitx, .164 }, H }; +N l3n168[] = { { sXvi, .123 }, H }; +N l3n169[] = { { smx7a, .266 }, { sox, .082 }, H }; +N l3n170[] = { { soi, .287 }, H }; +N l3n171[] = { { sit, .164 }, { sYXxg, .246 }, H }; +N l3n172[] = { { siX, .205 }, H }; +N l3n173[] = { { sx7aXx, .164 }, H }; +N l3n174[] = { { ssq, .082 }, H }; +N l3n175[] = { { sghX, .615 }, { sxw, .109 }, H }; +N l3n176[] = { { svXYm, .246 }, H }; +N l3n177[] = { { srs, .164 }, { sXx7a, .246 }, { sXvg, .246 }, { sgXg, .246 }, H }; +N l3n178[] = { { swy, .123 }, { smhi, .143 }, { sqyr, .123 }, H }; +N l3n179[] = { { sivv, .225 }, { sXwyr, .164 }, H }; +N l3n180[] = { { sosg, 1.260 }, { sgixX, .656 }, { sXmx, .225 }, { sirX, .184 }, H }; +N l3n181[] = { { si7ag, .523 }, H }; +N l3n183[] = { { sgk, .553 }, H }; +N l3n184[] = { { sXm, .519 }, { sph, .137 }, H }; +N l3n185[] = { { sgYi, .799 }, H }; +N l3n186[] = { { s7aXm, .123 }, H }; +N l3n187[] = { { ssrx, .164 }, H }; +N l3n189[] = { { syv, .301 }, H }; +N l3n191[] = { { ssr, .260 }, { s7am, .178 }, H }; +N l3n192[] = { { sgos, .430 }, { svmog, .369 }, { sgkvX, .328 }, H }; +N l3n193[] = { { sxi, .806 }, { sxmoX, .219 }, { smXo, .123 }, H }; +N l3n194[] = { { smxi, .143 }, H }; +N l3n195[] = { { srX, .423 }, H }; +N l3n196[] = { { sXYm, .205 }, H }; +N l3n197[] = { { syrh, .143 }, H }; +N l3n199[] = { { svm, .628 }, { sx7air, .382 }, H }; +N l3n200[] = { { sgl, .615 }, { sgYXm, .328 }, { spx, .109 }, H }; +N l3n201[] = { { spi, .246 }, { sivx, .246 }, H }; +N l3n202[] = { { sXxi, .307 }, H }; +N l3n204[] = { { smx7aX, .164 }, H }; +N l3n205[] = { { siv, .997 }, { sx7ait, .219 }, H }; +N l3n206[] = { { syw, .246 }, H }; +N l3n207[] = { { slm7a, .143 }, H }; +N l3n209[] = { { shi, .533 }, { sxy, .478 }, { sm7a, .410 }, { s7axi, .184 }, H }; +N l3n210[] = { { smo, .710 }, { sYXm, .246 }, H }; +N l3n211[] = { { sgi7a, .492 }, { sXxg, .338 }, H }; +N l3n212[] = { { sXvm, .205 }, H }; +N l3n213[] = { { sX7ax, .164 }, H }; +N l3n215[] = { { smg, .820 }, { sYm, .301 }, H }; +N l3n216[] = { { sks, .328 }, { svXo, .164 }, { sgXhm, .287 }, H }; +N l3n217[] = { { sgm, .574 }, { sX7a, .328 }, { svxi, .123 }, H }; +N l3n218[] = { { sXo, .519 }, { siwx, .164 }, H }; +N l3n219[] = { { sghi, .676 }, { sqXxm, .273 }, { sxirg, .328 }, { shsg, .184 }, H }; +N l3n221[] = { { sxXg, .707 }, H }; +N l3n222[] = { { siw, .382 }, { sqsh, .123 }, H }; +N l3n223[] = { { sXg, 2.541 }, { syx, .137 }, { sih, .123 }, { sosXg, .246 }, H }; +N l3n224[] = { { syi, .137 }, { sXx7ai, .219 }, H }; +N l3n225[] = { { s7ao, .314 }, { shy, .246 }, { sgih, .246 }, H }; +N l3n226[] = { { ssX, .273 }, { sgqs, .215 }, H }; +N l3n227[] = { { svvm, .430 }, { smp, .232 }, { svig, .215 }, H }; +N l3n229[] = { { spXg, .307 }, { sgYm, .246 }, H }; +N l3n230[] = { { s7ag, .717 }, { swm, .260 }, { sXhm, .143 }, H }; +N l3n231[] = { { sXpx, .143 }, { stXv, .123 }, H }; +N l3n233[] = { { sirg, 1.752 }, { sgYXx, .533 }, { ssvv, .164 }, H }; +N l3n234[] = { { skX, .164 }, { sgn, .143 }, H }; +N l3n235[] = { { sXp, .628 }, { sxmos, .219 }, H }; +N l3n237[] = { { shXg, .338 }, H }; +N l3n238[] = { { svg, .307 }, { som, .191 }, { sivvm, .246 }, { svXq, .164 }, { si7ao, .143 }, H }; +N l3n239[] = { { six, .451 }, { slXv, .184 }, H }; +N l3n241[] = { { siyw, .287 }, { s7aXr, .164 }, { slmg, .215 }, H }; +N l3n242[] = { { svmX, .184 }, H }; +N l3n243[] = { { sglX, .338 }, { sYXp, .123 }, H }; +N l3n245[] = { { sgiyw, .574 }, H }; +N l3n246[] = { { srh, .260 }, { sXxm, .307 }, H }; +N l3n247[] = { { smosg, .287 }, H }; +N l3n248[] = { { sivX, .471 }, { swxi, .225 }, { sqy, .123 }, H }; +N l3n249[] = { { svXr, .123 }, H }; +N l3n250[] = { { sg7a, .307 }, H }; +N l3n251[] = { { sgo, .553 }, { shmv, .143 }, H }; +N l3n252[] = { { sXq, .164 }, { sm7aX, .164 }, { sxyX, .123 }, H }; +N l3n253[] = { { smoX, .266 }, { srhy, .123 }, H }; +N l3n255[] = { { stir, .164 }, { sXosg, .287 }, H }; + +D l3_d = { "basque", "iso-8859-15", - { - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,0.001,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,0.001,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,0.308,0.060,0.006,0.076,0.237,0.007,0.050,0.034,0.189,0.004,0.111,0.056,0.029,0.143,0.108, - 0.027,0.001,0.138,0.062,0.155,0.089,0.005,0.001,0.003,0.001,0.097,W,W,W,W,W, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - 0.001,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - Y,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V, - V,V,V,V,V,V,V,V,0.001,V,V,V,V,V,V,V, - V,V,V,V,V,V,V,0.001,V,V,V,V,V,V,V,V, - V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V - }, - { - l3n0,l3n1,l3n2,l3n3,l3n4,l3n5,l3n6,l3n7,l3n8,l3n9,l3n10,l3n11,l3n12,l3n13,l3n14,l3n15, - l3n16,l3n17,l3n18,X,l3n20,l3n21,l3n22,l3n23,X,X,l3n26,l3n27,X,l3n29,l3n30,l3n31, - X,l3n33,l3n34,l3n35,l3n36,l3n37,l3n38,l3n39,l3n40,l3n41,l3n42,X,l3n44,l3n45,l3n46,l3n47, - X,l3n49,l3n50,l3n51,l3n52,l3n53,l3n54,l3n55,l3n56,l3n57,l3n58,l3n59,X,l3n61,l3n62,l3n63, - X,l3n65,l3n66,X,l3n68,l3n69,l3n70,X,X,l3n73,X,l3n75,l3n76,l3n77,l3n78,l3n79, - l3n80,l3n81,l3n82,X,l3n84,l3n85,l3n86,X,X,l3n89,l3n90,l3n91,X,l3n93,l3n94,X, - l3n96,X,l3n98,l3n99,l3n100,l3n101,l3n102,l3n103,X,l3n105,l3n106,l3n107,l3n108,l3n109,l3n110,X, - X,X,l3n114,l3n115,l3n116,l3n117,l3n118,l3n119,l3n120,l3n121,l3n122,l3n123,l3n124,l3n125,X,l3n127, - l3n128,X,l3n130,l3n131,l3n132,l3n133,X,X,l3n136,l3n137,l3n138,l3n139,l3n140,l3n141,X,l3n143, - X,l3n145,l3n146,l3n147,l3n148,l3n149,l3n150,l3n151,X,X,X,X,l3n156,l3n157,l3n158,l3n159, - l3n160,l3n161,X,X,l3n164,l3n165,l3n166,l3n167,l3n168,l3n169,l3n170,l3n171,l3n172,l3n173,l3n174,l3n175, - l3n176,l3n177,l3n178,l3n179,l3n180,l3n181,X,l3n183,l3n184,l3n185,l3n186,l3n187,X,l3n189,X,l3n191, - l3n192,l3n193,l3n194,l3n195,l3n196,l3n197,X,l3n199,l3n200,l3n201,l3n202,X,l3n204,l3n205,l3n206,l3n207, - X,l3n209,l3n210,l3n211,l3n212,l3n213,X,l3n215,l3n216,l3n217,l3n218,l3n219,X,l3n221,l3n222,l3n223, - l3n224,l3n225,l3n226,l3n227,X,l3n229,l3n230,l3n231,X,l3n233,l3n234,l3n235,X,l3n237,l3n238,l3n239, - X,l3n241,l3n242,l3n243,X,l3n245,l3n246,l3n247,l3n248,l3n249,l3n250,l3n251,l3n252,l3n253,X,l3n255 - } + { W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, 0.001, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, 0.001, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, 0.308, 0.060, 0.006, 0.076, 0.237, 0.007, 0.050, 0.034, 0.189, 0.004, 0.111, 0.056, 0.029, 0.143, 0.108, + 0.027, 0.001, 0.138, 0.062, 0.155, 0.089, 0.005, 0.001, 0.003, 0.001, 0.097, W, W, W, W, W, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + 0.001, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + Y, V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, + V, V, V, V, V, V, V, V, 0.001, V, V, V, V, V, V, V, + V, V, V, V, V, V, V, 0.001, V, V, V, V, V, V, V, V, + V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, V }, + { l3n0, l3n1, l3n2, l3n3, l3n4, l3n5, l3n6, l3n7, l3n8, l3n9, l3n10, l3n11, l3n12, l3n13, l3n14, l3n15, + l3n16, l3n17, l3n18, X, l3n20, l3n21, l3n22, l3n23, X, X, l3n26, l3n27, X, l3n29, l3n30, l3n31, + X, l3n33, l3n34, l3n35, l3n36, l3n37, l3n38, l3n39, l3n40, l3n41, l3n42, X, l3n44, l3n45, l3n46, l3n47, + X, l3n49, l3n50, l3n51, l3n52, l3n53, l3n54, l3n55, l3n56, l3n57, l3n58, l3n59, X, l3n61, l3n62, l3n63, + X, l3n65, l3n66, X, l3n68, l3n69, l3n70, X, X, l3n73, X, l3n75, l3n76, l3n77, l3n78, l3n79, + l3n80, l3n81, l3n82, X, l3n84, l3n85, l3n86, X, X, l3n89, l3n90, l3n91, X, l3n93, l3n94, X, + l3n96, X, l3n98, l3n99, l3n100, l3n101, l3n102, l3n103, X, l3n105, l3n106, l3n107, l3n108, l3n109, l3n110, X, + X, X, l3n114, l3n115, l3n116, l3n117, l3n118, l3n119, l3n120, l3n121, l3n122, l3n123, l3n124, l3n125, X, l3n127, + l3n128, X, l3n130, l3n131, l3n132, l3n133, X, X, l3n136, l3n137, l3n138, l3n139, l3n140, l3n141, X, l3n143, + X, l3n145, l3n146, l3n147, l3n148, l3n149, l3n150, l3n151, X, X, X, X, l3n156, l3n157, l3n158, l3n159, + l3n160, l3n161, X, X, l3n164, l3n165, l3n166, l3n167, l3n168, l3n169, l3n170, l3n171, l3n172, l3n173, l3n174, l3n175, + l3n176, l3n177, l3n178, l3n179, l3n180, l3n181, X, l3n183, l3n184, l3n185, l3n186, l3n187, X, l3n189, X, l3n191, + l3n192, l3n193, l3n194, l3n195, l3n196, l3n197, X, l3n199, l3n200, l3n201, l3n202, X, l3n204, l3n205, l3n206, l3n207, + X, l3n209, l3n210, l3n211, l3n212, l3n213, X, l3n215, l3n216, l3n217, l3n218, l3n219, X, l3n221, l3n222, l3n223, + l3n224, l3n225, l3n226, l3n227, X, l3n229, l3n230, l3n231, X, l3n233, l3n234, l3n235, X, l3n237, l3n238, l3n239, + X, l3n241, l3n242, l3n243, X, l3n245, l3n246, l3n247, l3n248, l3n249, l3n250, l3n251, l3n252, l3n253, X, l3n255 } }; - - // // Lng: bulgarian // Enc: iso-8859-5 // - -S sAg[]={208,a}; -S sIg[]={216,a}; -S sOg[]={222,a}; -S sFg[]={213,a}; -S sNA[]={221,208,0}; -S sRS[]={225,226,0}; -S sgN[]={32,221,0}; -S sNI[]={221,216,0}; -S sNAg[]={221,208,a}; -S sgP[]={32,223,0}; -S sSF[]={226,213,0}; -S sSO[]={226,222,0}; -S sQA[]={224,208,0}; -S sgNA[]={32,221,208,0}; -S sSg[]={226,a}; -S sSA[]={226,208,0}; -S sAS[]={208,226,0}; -S sOS[]={222,226,0}; -S sIS[]={216,226,0}; -S sgNAg[]={32,221,208,a}; -S sFN[]={213,221,0}; -S sgK[]={32,218,0}; -S sAN[]={208,221,0}; -S sQF[]={224,213,0}; -S sPQ[]={223,224,0}; -S sgC[]={32,210,0}; -S sSOg[]={226,222,a}; -S sgO[]={32,222,0}; -S sCA[]={210,208,0}; -S sOR[]={222,225,0}; -S sISF[]={216,226,213,0}; -S sNO[]={221,222,0}; -S sKO[]={218,222,0}; -S sQI[]={224,216,0}; -S sgE[]={32,212,0}; -S sPO[]={223,222,0}; -S sefg[]={239,a}; -S sFS[]={213,226,0}; -S sgPQ[]={32,223,224,0}; -S sKA[]={218,208,0}; -S sQO[]={224,222,0}; -S sSI[]={226,216,0}; -S sSFg[]={226,213,a}; -S sgF[]={32,213,0}; -S sIef[]={216,239,0}; -S sNF[]={221,213,0}; -S sAC[]={208,210,0}; -S sHI[]={215,216,0}; -S sEA[]={212,208,0}; -S sISFg[]={216,226,213,a}; -S sRF[]={225,213,0}; -S sCg[]={210,a}; -S sSAg[]={226,208,a}; -S sAK[]={208,218,0}; -S sIefg[]={216,239,a}; -S sNIg[]={221,216,a}; -S sRK[]={225,218,0}; -S sAQ[]={208,224,0}; -S sgPO[]={32,223,222,0}; -S sIK[]={216,218,0}; -S sIH[]={216,215,0}; -S sLI[]={219,216,0}; -S sFR[]={213,225,0}; -S sFQ[]={213,224,0}; -S sgRF[]={32,225,213,0}; -S sHA[]={215,208,0}; -S sCF[]={210,213,0}; -S sIN[]={216,221,0}; -S sgQ[]={32,224,0}; -S sFE[]={213,212,0}; -S sgB[]={32,209,0}; -S sgIg[]={32,216,a}; -S sgS[]={32,226,0}; -S sgOS[]={32,222,226,0}; -S sRFg[]={225,213,a}; -S sgRFg[]={32,225,213,a}; -S sgM[]={32,220,0}; -S sCO[]={210,222,0}; -S sORS[]={222,225,226,0}; -S sASg[]={208,226,a}; -S sEAg[]={212,208,a}; -S sgH[]={32,215,0}; -S sKI[]={218,216,0}; -S sOD[]={222,211,0}; -S sSC[]={226,210,0}; -S sgHA[]={32,215,208,0}; -S sgEA[]={32,212,208,0}; -S sANI[]={208,221,216,0}; -S sFL[]={213,219,0}; -S sgCg[]={32,210,a}; -S sSN[]={226,221,0}; -S sFH[]={213,215,0}; -S sNISF[]={221,216,226,213,0}; -S sNIS[]={221,216,226,0}; -S sgEAg[]={32,212,208,a}; -S sKg[]={218,a}; -S sCI[]={210,216,0}; -S sIR[]={216,225,0}; -S sNS[]={221,226,0}; -S sgD[]={32,211,0}; -S sCAg[]={210,208,a}; -S sLF[]={219,213,0}; -S sRSC[]={225,226,210,0}; -S sIKg[]={216,218,a}; -S sLN[]={219,221,0}; -S sNOg[]={221,222,a}; -S sNR[]={221,225,0}; -S sRI[]={225,216,0}; -S sASA[]={208,226,208,0}; -S sDA[]={211,208,0}; -S sFSO[]={213,226,222,0}; -S sAH[]={208,215,0}; -S sMO[]={220,222,0}; -S sIQ[]={216,224,0}; -S sOB[]={222,209,0}; -S sEO[]={212,222,0}; -S sgbf[]={32,191,0}; -S sMI[]={220,216,0}; -S sIe7[]={216,231,0}; -S sFHI[]={213,215,216,0}; -S sHAg[]={215,208,a}; -S sOE[]={222,212,0}; -S sFRS[]={213,225,226,0}; -S sFSOg[]={213,226,222,a}; -S sKOg[]={218,222,a}; -S sgNF[]={32,221,213,0}; -S sIC[]={216,210,0}; -S sgQF[]={32,224,213,0}; -S sPQF[]={223,224,213,0}; -S sLA[]={219,208,0}; -S sMF[]={220,213,0}; -S sgKO[]={32,218,222,0}; -S sASAg[]={208,226,208,a}; -S sQAN[]={224,208,221,0}; -S sRKI[]={225,218,216,0}; -S sgA[]={32,208,0}; -S sBA[]={209,208,0}; -S sOC[]={222,210,0}; -S sWI[]={230,216,0}; -S sNg[]={221,a}; -S sEI[]={212,216,0}; -S se7I[]={231,216,0}; -S sIQA[]={216,224,208,0}; -S sRSF[]={225,226,213,0}; -S sEF[]={212,213,0}; -S sPQO[]={223,224,222,0}; -S sFNI[]={213,221,216,0}; -S sAR[]={208,225,0}; -S sSFQ[]={226,213,224,0}; -S sLg[]={219,a}; -S sPOR[]={223,222,225,0}; -S se7F[]={231,213,0}; -S sRg[]={225,a}; -S sAKS[]={208,218,226,0}; -S sKS[]={218,226,0}; -S sgPQF[]={32,223,224,213,0}; -S sIM[]={216,220,0}; -S sOL[]={222,219,0}; -S sOQ[]={222,224,0}; -S sRA[]={225,208,0}; -S sKAS[]={218,208,226,0}; -S sAU[]={208,228,0}; -S sOP[]={222,223,0}; -S sgKA[]={32,218,208,0}; -S sKea[]={218,234,0}; -S sAQI[]={208,224,216,0}; -S sRSA[]={225,226,208,0}; -S sKQ[]={218,224,0}; -S sRL[]={225,219,0}; -S sgFg[]={32,213,a}; -S sAL[]={208,219,0}; -S sOSO[]={222,226,222,0}; -S sgBA[]={32,209,208,0}; -S sANF[]={208,221,213,0}; -S sQFH[]={224,213,215,0}; -S sKIg[]={218,216,a}; -S sCef[]={210,239,0}; -S sNFg[]={221,213,a}; -S sgEO[]={32,212,222,0}; -S sINA[]={216,221,208,0}; -S sgOSg[]={32,222,226,a}; -S sRSFN[]={225,226,213,221,0}; -S sACef[]={208,210,239,0}; -S sIRS[]={216,225,226,0}; -S sFQI[]={213,224,216,0}; -S sFLN[]={213,219,221,0}; -S sBO[]={209,222,0}; -S sDO[]={211,222,0}; -S se7N[]={231,221,0}; -S sNOR[]={221,222,225,0}; -S sSFN[]={226,213,221,0}; -S sPQI[]={223,224,216,0}; -S sgHAg[]={32,215,208,a}; -S sISFL[]={216,226,213,219,0}; -S sFC[]={213,210,0}; -S sOSg[]={222,226,a}; -S sOSOg[]={222,226,222,a}; -S sBI[]={209,216,0}; -S sLAC[]={219,208,210,0}; -S sDQ[]={211,224,0}; -S sgPQI[]={32,223,224,216,0}; -S sgRS[]={32,225,226,0}; -S sSFL[]={226,213,219,0}; -S sIF[]={216,213,0}; -S sgc0[]={32,192,0}; -S sOJ[]={222,217,0}; -S sKSF[]={218,226,213,0}; -S sNIef[]={221,216,239,0}; -S sLNI[]={219,221,216,0}; -S sEg[]={212,a}; -S se7A[]={231,208,0}; -S sgT[]={32,227,0}; -S sCAS[]={210,208,226,0}; -S sSFLN[]={226,213,219,221,0}; -S sIHI[]={216,215,216,0}; -S sBAK[]={209,208,218,0}; -S sRC[]={225,210,0}; -S sSNO[]={226,221,222,0}; -S sIFg[]={216,213,a}; -S sNIefg[]={221,216,239,a}; -S sAKSF[]={208,218,226,213,0}; -S sgRea[]={32,225,234,0}; -S sAP[]={208,223,0}; -S sgc1[]={32,193,0}; -S sSFQI[]={226,213,224,216,0}; -S sOH[]={222,215,0}; -S sDQA[]={211,224,208,0}; -S sIL[]={216,219,0}; -S sRSO[]={225,226,222,0}; -S sBAKS[]={209,208,218,226,0}; -S sFNS[]={213,221,226,0}; -S sCAN[]={210,208,221,0}; -S sKSFQ[]={218,226,213,224,0}; -S sgPQO[]={32,223,224,222,0}; -S se9F[]={233,213,0}; -S sgRg[]={32,225,a}; -S sQAS[]={224,208,226,0}; -S sAB[]={208,209,0}; -S sRSg[]={225,226,a}; -S sgFE[]={32,213,212,0}; -S sFK[]={213,218,0}; -S sefS[]={239,226,0}; -S sMg[]={220,a}; -S sQAg[]={224,208,a}; -S sHIK[]={215,216,218,0}; -S sCea[]={210,234,0}; -S sgKea[]={32,218,234,0}; -S sASO[]={208,226,222,0}; -S sFSI[]={213,226,216,0}; -S sgRA[]={32,225,208,0}; -S sCASg[]={210,208,226,a}; -S sIRSF[]={216,225,226,213,0}; -S sgQFH[]={32,224,213,215,0}; -S sgc0A[]={32,192,208,0}; -S sTR[]={227,225,0}; -S sPA[]={223,208,0}; -S sII[]={216,216,0}; -S sSQ[]={226,224,0}; -S sRSI[]={225,226,216,0}; -S sc0A[]={192,208,0}; -S sHIR[]={215,216,225,0}; -S sNORS[]={221,222,225,226,0}; -S sAE[]={208,212,0}; -S sFNSN[]={213,221,226,221,0}; -S sNRK[]={221,225,218,0}; -S sCOg[]={210,222,a}; -S sPF[]={223,213,0}; -S sLACef[]={219,208,210,239,0}; -S sLIg[]={219,216,a}; -S sUA[]={228,208,0}; -S sQANI[]={224,208,221,216,0}; -S sQFHI[]={224,213,215,216,0}; -S sgc8[]={32,200,0}; -S sRKA[]={225,218,208,0}; -S sgc8A[]={32,200,208,0}; -S sRLA[]={225,219,208,0}; -S sHC[]={215,210,0}; -S sQT[]={224,227,0}; -S sefCA[]={239,210,208,0}; -S sefC[]={239,210,0}; -S sSCO[]={226,210,222,0}; -S sIIg[]={216,216,a}; -S sRAg[]={225,208,a}; -S sHIRS[]={215,216,225,226,0}; -S sgBAK[]={32,209,208,218,0}; -S sSNI[]={226,221,216,0}; -S sCefN[]={210,239,221,0}; -S sFNg[]={213,221,a}; -S sFM[]={213,220,0}; -S sgbd[]={32,189,0}; -S sHN[]={215,221,0}; -S sGN[]={214,221,0}; -S sON[]={222,221,0}; -S sQAB[]={224,208,209,0}; -S sc8A[]={200,208,0}; -S sCANF[]={210,208,221,213,0}; -S sgFH[]={32,213,215,0}; -S sgFHI[]={32,213,215,216,0}; -S sHIKg[]={215,216,218,a}; -S sDL[]={211,219,0}; -S sQFE[]={224,213,212,0}; -S sDAQ[]={211,208,224,0}; -S sefNRK[]={239,221,225,218,0}; -S sACefN[]={208,210,239,221,0}; -S sCefNR[]={210,239,221,225,0}; -S sefNR[]={239,221,225,0}; -S seaL[]={234,219,0}; -S sNRS[]={221,225,226,0}; -S sACA[]={208,210,208,0}; -S sSK[]={226,218,0}; -S sSFNS[]={226,213,221,226,0}; -S sRSCO[]={225,226,210,222,0}; -S sNef[]={221,239,0}; -S sRSAC[]={225,226,208,210,0}; -S sMA[]={220,208,0}; -S se9A[]={233,208,0}; -S sQIK[]={224,216,218,0}; -S sNSN[]={221,226,221,0}; -S sgb1[]={32,177,0}; -S sgc8AU[]={32,200,208,228,0}; -S sc8AU[]={200,208,228,0}; -S sgIH[]={32,216,215,0}; -S sQIKg[]={224,216,218,a}; -S sSAC[]={226,208,210,0}; -S sgPOR[]={32,223,222,225,0}; -S sgMO[]={32,220,222,0}; -S sFHIR[]={213,215,216,225,0}; -S sKAg[]={218,208,a}; -S sRLAC[]={225,219,208,210,0}; -S sefN[]={239,221,0}; -S sPI[]={223,216,0}; -S sgc0Ae8[]={32,192,208,232,0}; -S sABO[]={208,209,222,0}; -S sgKAS[]={32,218,208,226,0}; -S sAe8K[]={208,232,218,0}; -S sHM[]={215,220,0}; -S sgPOg[]={32,223,222,a}; -S sBOS[]={209,222,226,0}; -S sST[]={226,227,0}; -S sANFg[]={208,221,213,a}; -S sKASA[]={218,208,226,208,0}; -S sc8AUA[]={200,208,228,208,0}; -S sQABO[]={224,208,209,222,0}; -S sgb8[]={32,184,0}; -S sRO[]={225,222,0}; -S seaC[]={234,210,0}; -S sQIg[]={224,216,a}; -S sIW[]={216,230,0}; -S sPORS[]={223,222,225,226,0}; -S sFHIK[]={213,215,216,218,0}; -S sFEI[]={213,212,216,0}; -S sOef[]={222,239,0}; -S sUAQI[]={228,208,224,216,0}; -S sIO[]={216,222,0}; -S sQOR[]={224,222,225,0}; -S sgANS[]={32,208,221,226,0}; -S sICA[]={216,210,208,0}; -S sODQ[]={222,211,224,0}; -S sUI[]={228,216,0}; -S sRQ[]={225,224,0}; -S sDF[]={211,213,0}; -S sRP[]={225,223,0}; -S sgRAg[]={32,225,208,a}; -S sAQIK[]={208,224,216,218,0}; -S sgRQ[]={32,225,224,0}; -S sABOS[]={208,209,222,226,0}; -S sAUAQ[]={208,228,208,224,0}; -S sc0Ae8K[]={192,208,232,218,0}; -S sb7A[]={183,208,0}; -S sNOS[]={221,222,226,0}; -S sQg[]={224,a}; -S sRKIg[]={225,218,216,a}; -S sAe8[]={208,232,0}; -S sANSI[]={208,221,226,216,0}; -S sANS[]={208,221,226,0}; -S sgb7A[]={32,183,208,0}; -S se8K[]={232,218,0}; -S sIQAg[]={216,224,208,a}; -S sBQ[]={209,224,0}; -S sODQA[]={222,211,224,208,0}; -S sAUA[]={208,228,208,0}; -S sAe8KO[]={208,232,218,222,0}; -S sAM[]={208,220,0}; -S sNIFg[]={221,216,213,a}; -S sc0Ae8[]={192,208,232,0}; -S sgb7[]={32,183,0}; -S sgAN[]={32,208,221,0}; -S se9Fg[]={233,213,a}; -S sNOSO[]={221,222,226,222,0}; -S sJg[]={217,a}; -S sNIF[]={221,216,213,0}; -S se8KO[]={232,218,222,0}; -S sIWI[]={216,230,216,0}; -S sINAg[]={216,221,208,a}; -S sDOg[]={211,222,a}; -S sgQA[]={32,224,208,0}; - -N l4n1[]={{sRKI,.547},H}; -N l4n2[]={{sOg,4.334},{sIKg,1.010},{sSFN,.421},H}; -N l4n4[]={{sEI,.365},{sANF,.463},H}; -N l4n5[]={{sgF,.542},H}; -N l4n6[]={{sgMO,.196},H}; -N l4n7[]={{sIef,.814},{se9A,.196},{sgb7,.112},H}; -N l4n8[]={{sIQ,.421},{sPQF,.589},{sc8A,.196},{sc0Ae8,.252},H}; -N l4n10[]={{sQFHI,.393},{sICA,.252},H}; -N l4n11[]={{sSN,.505},H}; -N l4n12[]={{sHIR,.337},H}; -N l4n13[]={{sBO,.281},H}; -N l4n14[]={{sRP,.168},H}; -N l4n15[]={{sRA,.337},H}; -N l4n16[]={{sAQ,.701},{sc0A,.224},{sPORS,.337},H}; -N l4n17[]={{sefg,1.431},{sAB,.224},H}; -N l4n18[]={{sFH,.505},{sNRK,.295},{sACA,.295},H}; -N l4n21[]={{sFSI,.337},H}; -N l4n23[]={{sgHA,.533},H}; -N l4n24[]={{sgc8A,.196},{sDL,.196},{sgb8,.112},H}; -N l4n25[]={{sIR,.477},H}; -N l4n26[]={{sIC,.393},H}; -N l4n27[]={{sNI,2.076},{sANSI,.337},H}; -N l4n28[]={{sSO,1.571},{se8KO,.252},H}; -N l4n30[]={{se7F,.337},{sKIg,.694},H}; -N l4n31[]={{sBA,.365},{sHIKg,.589},{sRQ,.168},H}; -N l4n33[]={{sAR,.337},{sgFE,.224},{sgRAg,.224},H}; -N l4n34[]={{sAC,.786},{sASA,.673},H}; -N l4n35[]={{sSFQ,.505},{sBAKS,.505},H}; -N l4n36[]={{sKO,1.094},H}; -N l4n37[]={{sANI,.800},{sINAg,.505},H}; -N l4n38[]={{sPF,.196},H}; -N l4n39[]={{sgH,.374},{sFEI,.252},H}; -N l4n40[]={{sLACef,.393},{sgc8,.131},H}; -N l4n41[]={{sPQI,.421},{sOH,.252},H}; -N l4n42[]={{sIS,1.291},H}; -N l4n44[]={{sCO,.589},{sNOR,.421},H}; -N l4n46[]={{sSA,1.347},{sFNS,.379},H}; -N l4n47[]={{sKSFQ,.505},{sBQ,.168},{sgAN,.168},H}; -N l4n48[]={{sRLAC,.393},H}; -N l4n49[]={{sRSA,.463},{sRC,.252},{sgRg,.224},H}; -N l4n50[]={{sAS,1.319},{sgCg,.505},{sLN,.449},{sWI,.365},H}; -N l4n51[]={{sQT,.196},H}; -N l4n52[]={{sSAC,.295},H}; -N l4n54[]={{sKA,.898},{sQIKg,.589},H}; -N l4n55[]={{sge7,.206},{sNOS,.252},H}; -N l4n56[]={{sgI,.767},H}; -N l4n57[]={{sgPO,.701},{sHAg,.884},H}; -N l4n60[]={{sCANF,.393},H}; -N l4n61[]={{sLIg,.442},H}; -N l4n62[]={{sCA,1.122},{sSQ,.224},H}; -N l4n63[]={{sgBAK,.262},H}; -N l4n64[]={{sQg,.252},H}; -N l4n65[]={{sRS,2.272},{sABOS,.337},H}; -N l4n66[]={{sgFH,.196},{sNIF,.252},H}; -N l4n68[]={{sgEAg,.673},{sOSg,.631},{sAE,.224},{sNSN,.295},{sc8AUA,.337},{sAUA,.252},H}; -N l4n69[]={{sQF,1.178},{sFK,.224},H}; -N l4n70[]={{sKQ,.309},H}; -N l4n71[]={{sRSC,.673},H}; -N l4n72[]={{sIg,4.755},{sNFg,.694},{sgc0Ae8,.224},{seaC,.168},H}; -N l4n73[]={{sefNR,.295},H}; -N l4n74[]={{sgKA,.309},H}; -N l4n75[]={{sDO,.281},{sOJ,.252},H}; -N l4n77[]={{sCef,.309},{sIF,.281},H}; -N l4n78[]={{sIRSF,.449},H}; -N l4n79[]={{sgPQ,.926},H}; -N l4n80[]={{sAg,7.827},{sSC,.533},{sNISF,1.010},{sQAg,.505},H}; -N l4n81[]={{sISF,1.641},{se7I,.365},H}; -N l4n83[]={{sSNI,.295},H}; -N l4n84[]={{sgOS,.617},{sAU,.337},{sCASg,.673},H}; -N l4n85[]={{sLA,.393},H}; -N l4n86[]={{sFL,.505},H}; -N l4n87[]={{sFSO,.631},H}; -N l4n88[]={{sgRFg,.823},{sAQI,.463},{sIQAg,.505},H}; -N l4n89[]={{sPI,.168},H}; -N l4n90[]={{sgK,.804},{sFHI,.589},H}; -N l4n91[]={{sLAC,.421},H}; -N l4n92[]={{se9F,.224},{sKASA,.337},H}; -N l4n93[]={{sDA,.421},{sDQA,.379},H}; -N l4n95[]={{sRg,.505},H}; -N l4n96[]={{sAKS,.505},{sNIef,.379},H}; -N l4n97[]={{sHI,.786},{sQFE,.295},{sRKIg,.505},H}; -N l4n98[]={{sMO,.421},H}; -N l4n100[]={{sRF,.757},{sANFg,.505},H}; -N l4n101[]={{sgFg,.309},H}; -N l4n103[]={{sIefg,1.641},{sACef,.421},{sFM,.196},{sJg,.252},H}; -N l4n104[]={{sRSF,.547},{sKS,.337},{sgKea,.224},H}; -N l4n106[]={{sEO,.421},{sPOR,.505},{sNRS,.295},H}; -N l4n107[]={{sPQO,.547},H}; -N l4n108[]={{sgQFH,.299},{sUA,.196},H}; -N l4n109[]={{sOL,.337},{sDQ,.281},{sgbd,.131},H}; -N l4n110[]={{sOSO,.463},{sTR,.224},{sIW,.168},H}; -N l4n111[]={{sIH,.673},{sQAN,.547},{sRAg,.442},{sCefNR,.393},H}; -N l4n113[]={{sST,.168},{sgRQ,.168},H}; -N l4n114[]={{sFRS,.589},H}; -N l4n116[]={{sMA,.196},H}; -N l4n117[]={{sgIH,.196},H}; -N l4n119[]={{sAH,.421},{sgHAg,.374},H}; -N l4n120[]={{sFN,1.234},{sQI,1.094},H}; -N l4n122[]={{sLNI,.379},H}; -N l4n123[]={{sNIg,1.641},H}; -N l4n124[]={{sSOg,2.525},{sEA,.786},{sgM,.393},H}; -N l4n125[]={{sgNA,1.515},{sBAK,.379},H}; -N l4n126[]={{sSg,2.230},{sgEO,.281},H}; -N l4n127[]={{sIe7,.421},H}; -N l4n128[]={{sII,.224},H}; -N l4n129[]={{sNO,1.094},H}; -N l4n130[]={{sASAg,1.094},{sQFH,.463},H}; -N l4n131[]={{sSF,1.908},{sSFLN,.505},H}; -N l4n132[]={{sKOg,.884},H}; -N l4n133[]={{sQABO,.337},{sODQ,.252},H}; -N l4n134[]={{sKg,.715},H}; -N l4n135[]={{sgRS,.281},H}; -N l4n137[]={{sORS,.842},{sRSI,.337},{sQOR,.252},H}; -N l4n140[]={{sCOg,.442},H}; -N l4n141[]={{sgN,1.421},H}; -N l4n142[]={{sCg,1.136},{sSAg,1.704},H}; -N l4n143[]={{sgbf,.281},{sKSF,.379},{sON,.196},H}; -N l4n144[]={{sgc0A,.224},{sAe8KO,.337},H}; -N l4n146[]={{sASg,1.262},{se8K,.168},H}; -N l4n147[]={{sNA,2.665},{sCF,.645},{sANS,.252},H}; -N l4n148[]={{sUAQI,.337},H}; -N l4n149[]={{sSNO,.379},H}; -N l4n150[]={{sKAg,.442},{sc0Ae8K,.337},H}; -N l4n151[]={{sRI,.449},{sGN,.196},H}; -N l4n152[]={{sgIg,.617},{sAe8,.168},H}; -N l4n153[]={{sgPOg,.224},H}; -N l4n155[]={{sABO,.252},H}; -N l4n158[]={{sgO,.748},{sCAg,1.010},{sefN,.196},H}; -N l4n160[]={{sgc0,.187},H}; -N l4n161[]={{sRSg,.505},{sgb1,.131},H}; -N l4n162[]={{sIK,.673},{sNef,.196},{sNIFg,.505},H}; -N l4n165[]={{sLg,.505},{sHM,.168},H}; -N l4n166[]={{se7N,.281},{sQAS,.337},H}; -N l4n167[]={{sBI,.281},{sRSAC,.393},H}; -N l4n168[]={{sSFNS,.393},H}; -N l4n169[]={{sRKA,.295},H}; -N l4n170[]={{sAK,.729},{sLF,.449},H}; -N l4n171[]={{sFQ,.673},{sSFQI,.505},{sDOg,.379},H}; -N l4n173[]={{sIFg,.568},H}; -N l4n175[]={{sgP,1.272},H}; -N l4n176[]={{sgA,.243},{sgQA,.168},H}; -N l4n177[]={{sISFg,2.357},{sOP,.337},{sgBA,.309},{sgc1,.168},H}; -N l4n178[]={{sHIRS,.393},{sDF,.168},H}; -N l4n179[]={{sIL,.252},H}; -N l4n180[]={{sNR,.449},{sgNF,.393},{sgOSg,.374},H}; -N l4n182[]={{sSI,.842},{sHN,.196},{sIWI,.252},H}; -N l4n183[]={{sFSOg,1.178},{sIHI,.379},H}; -N l4n185[]={{sRK,.701},H}; -N l4n186[]={{sRLA,.295},H}; -N l4n187[]={{sAL,.309},H}; -N l4n188[]={{sFR,.673},{sASO,.337},{se9Fg,.379},H}; -N l4n189[]={{sFC,.281},{sCAN,.379},H}; -N l4n190[]={{sKI,.533},H}; -N l4n191[]={{sPO,1.010},{sHIK,.337},H}; -N l4n192[]={{sgQ,.430},{sFNI,.547},{sNIefg,.757},H}; -N l4n193[]={{sgB,.411},{sgRA,.224},{sOef,.168},H}; -N l4n194[]={{sOQ,.337},H}; -N l4n195[]={{sOB,.421},{sBOS,.252},H}; -N l4n196[]={{sRFg,1.389},{sIM,.337},{sMg,.337},{sgc8AU,.262},H}; -N l4n197[]={{sNS,.477},{sINA,.421},{sFNSN,.393},H}; -N l4n198[]={{sCI,.477},H}; -N l4n201[]={{sRea,.393},{sMF,.365},{se7A,.252},H}; -N l4n202[]={{sRL,.309},{sgFHI,.262},H}; -N l4n203[]={{sRSO,.379},H}; -N l4n204[]={{sEg,.379},{sCefN,.295},{sAM,.168},H}; -N l4n205[]={{sFS,.926},H}; -N l4n206[]={{sgPQF,.449},{sOSOg,.842},H}; -N l4n207[]={{sIRS,.421},H}; -N l4n209[]={{sgR,1.534},{sNIS,.757},{sEF,.365},{sPA,.224},{sNOSO,.337},H}; -N l4n210[]={{sgC,.767},{sNORS,.449},H}; -N l4n211[]={{sOR,1.094},{sefCA,.295},H}; -N l4n212[]={{sOC,.365},{sc8AU,.295},H}; -N l4n213[]={{sIN,.645},{sFLN,.421},{sgANS,.224},H}; -N l4n214[]={{sQIK,.295},H}; -N l4n215[]={{sgPQI,.374},{sefNRK,.393},H}; -N l4n216[]={{sFNg,.442},{sSK,.196},{sQIg,.379},H}; -N l4n217[]={{sHA,.645},H}; -N l4n218[]={{sSCO,.295},H}; -N l4n220[]={{sEAg,1.262},{sgPOR,.262},H}; -N l4n221[]={{sgNAg,1.683},{sAN,1.206},{sLI,.673},H}; -N l4n222[]={{sQO,.898},H}; -N l4n223[]={{sFE,.645},{sAKSF,.505},{sgRea,.252},H}; -N l4n224[]={{sIIg,.442},H}; -N l4n225[]={{sPQ,1.150},{sNOg,1.010},{seaL,.196},{sRSCO,.393},H}; -N l4n226[]={{sgS,.411},{sISFL,.561},H}; -N l4n227[]={{sSFg,1.894},{sgD,.318},{sNg,.547},{sefC,.196},H}; -N l4n228[]={{sOS,1.291},{sgEA,.533},{sgKO,.365},{sAUAQ,.337},H}; -N l4n229[]={{sOD,.533},H}; -N l4n230[]={{sIO,.168},{sAQIK,.337},H}; -N l4n231[]={{sgQF,.393},H}; -N l4n232[]={{sNF,.786},{sFHIK,.337},H}; -N l4n233[]={{sgPQO,.337},H}; -N l4n235[]={{sFg,4.040},{sQAB,.295},H}; -N l4n236[]={{sKAS,.505},{sSFL,.421},H}; -N l4n240[]={{sQA,1.543},{sKea,.309},{sgKAS,.224},H}; -N l4n243[]={{sNAg,4.356},{sFQI,.421},{sgT,.168},{sefS,.224},H}; -N l4n244[]={{sgE,.692},{sCAS,.379},{sUI,.168},H}; -N l4n245[]={{sODQA,.337},H}; -N l4n246[]={{sOE,.393},{sAe8K,.252},H}; -N l4n247[]={{sQANI,.393},{sgb7A,.168},H}; -N l4n248[]={{sgRF,.673},{sIQA,.547},{sCea,.224},H}; -N l4n249[]={{sb7A,.112},H}; -N l4n251[]={{sHC,.196},H}; -N l4n252[]={{sMI,.421},H}; -N l4n253[]={{sDAQ,.295},{sFHIR,.393},{sRO,.168},H}; -N l4n254[]={{sACefN,.393},H}; -N l4n255[]={{sRSFN,.561},{sAP,.252},H}; - -D l4_d = -{ +S sAg[] = { 208, a }; +S sIg[] = { 216, a }; +S sOg[] = { 222, a }; +S sFg[] = { 213, a }; +S sNA[] = { 221, 208, 0 }; +S sRS[] = { 225, 226, 0 }; +S sgN[] = { 32, 221, 0 }; +S sNI[] = { 221, 216, 0 }; +S sNAg[] = { 221, 208, a }; +S sgP[] = { 32, 223, 0 }; +S sSF[] = { 226, 213, 0 }; +S sSO[] = { 226, 222, 0 }; +S sQA[] = { 224, 208, 0 }; +S sgNA[] = { 32, 221, 208, 0 }; +S sSg[] = { 226, a }; +S sSA[] = { 226, 208, 0 }; +S sAS[] = { 208, 226, 0 }; +S sOS[] = { 222, 226, 0 }; +S sIS[] = { 216, 226, 0 }; +S sgNAg[] = { 32, 221, 208, a }; +S sFN[] = { 213, 221, 0 }; +S sgK[] = { 32, 218, 0 }; +S sAN[] = { 208, 221, 0 }; +S sQF[] = { 224, 213, 0 }; +S sPQ[] = { 223, 224, 0 }; +S sgC[] = { 32, 210, 0 }; +S sSOg[] = { 226, 222, a }; +S sgO[] = { 32, 222, 0 }; +S sCA[] = { 210, 208, 0 }; +S sOR[] = { 222, 225, 0 }; +S sISF[] = { 216, 226, 213, 0 }; +S sNO[] = { 221, 222, 0 }; +S sKO[] = { 218, 222, 0 }; +S sQI[] = { 224, 216, 0 }; +S sgE[] = { 32, 212, 0 }; +S sPO[] = { 223, 222, 0 }; +S sefg[] = { 239, a }; +S sFS[] = { 213, 226, 0 }; +S sgPQ[] = { 32, 223, 224, 0 }; +S sKA[] = { 218, 208, 0 }; +S sQO[] = { 224, 222, 0 }; +S sSI[] = { 226, 216, 0 }; +S sSFg[] = { 226, 213, a }; +S sgF[] = { 32, 213, 0 }; +S sIef[] = { 216, 239, 0 }; +S sNF[] = { 221, 213, 0 }; +S sAC[] = { 208, 210, 0 }; +S sHI[] = { 215, 216, 0 }; +S sEA[] = { 212, 208, 0 }; +S sISFg[] = { 216, 226, 213, a }; +S sRF[] = { 225, 213, 0 }; +S sCg[] = { 210, a }; +S sSAg[] = { 226, 208, a }; +S sAK[] = { 208, 218, 0 }; +S sIefg[] = { 216, 239, a }; +S sNIg[] = { 221, 216, a }; +S sRK[] = { 225, 218, 0 }; +S sAQ[] = { 208, 224, 0 }; +S sgPO[] = { 32, 223, 222, 0 }; +S sIK[] = { 216, 218, 0 }; +S sIH[] = { 216, 215, 0 }; +S sLI[] = { 219, 216, 0 }; +S sFR[] = { 213, 225, 0 }; +S sFQ[] = { 213, 224, 0 }; +S sgRF[] = { 32, 225, 213, 0 }; +S sHA[] = { 215, 208, 0 }; +S sCF[] = { 210, 213, 0 }; +S sIN[] = { 216, 221, 0 }; +S sgQ[] = { 32, 224, 0 }; +S sFE[] = { 213, 212, 0 }; +S sgB[] = { 32, 209, 0 }; +S sgIg[] = { 32, 216, a }; +S sgS[] = { 32, 226, 0 }; +S sgOS[] = { 32, 222, 226, 0 }; +S sRFg[] = { 225, 213, a }; +S sgRFg[] = { 32, 225, 213, a }; +S sgM[] = { 32, 220, 0 }; +S sCO[] = { 210, 222, 0 }; +S sORS[] = { 222, 225, 226, 0 }; +S sASg[] = { 208, 226, a }; +S sEAg[] = { 212, 208, a }; +S sgH[] = { 32, 215, 0 }; +S sKI[] = { 218, 216, 0 }; +S sOD[] = { 222, 211, 0 }; +S sSC[] = { 226, 210, 0 }; +S sgHA[] = { 32, 215, 208, 0 }; +S sgEA[] = { 32, 212, 208, 0 }; +S sANI[] = { 208, 221, 216, 0 }; +S sFL[] = { 213, 219, 0 }; +S sgCg[] = { 32, 210, a }; +S sSN[] = { 226, 221, 0 }; +S sFH[] = { 213, 215, 0 }; +S sNISF[] = { 221, 216, 226, 213, 0 }; +S sNIS[] = { 221, 216, 226, 0 }; +S sgEAg[] = { 32, 212, 208, a }; +S sKg[] = { 218, a }; +S sCI[] = { 210, 216, 0 }; +S sIR[] = { 216, 225, 0 }; +S sNS[] = { 221, 226, 0 }; +S sgD[] = { 32, 211, 0 }; +S sCAg[] = { 210, 208, a }; +S sLF[] = { 219, 213, 0 }; +S sRSC[] = { 225, 226, 210, 0 }; +S sIKg[] = { 216, 218, a }; +S sLN[] = { 219, 221, 0 }; +S sNOg[] = { 221, 222, a }; +S sNR[] = { 221, 225, 0 }; +S sRI[] = { 225, 216, 0 }; +S sASA[] = { 208, 226, 208, 0 }; +S sDA[] = { 211, 208, 0 }; +S sFSO[] = { 213, 226, 222, 0 }; +S sAH[] = { 208, 215, 0 }; +S sMO[] = { 220, 222, 0 }; +S sIQ[] = { 216, 224, 0 }; +S sOB[] = { 222, 209, 0 }; +S sEO[] = { 212, 222, 0 }; +S sgbf[] = { 32, 191, 0 }; +S sMI[] = { 220, 216, 0 }; +S sIe7[] = { 216, 231, 0 }; +S sFHI[] = { 213, 215, 216, 0 }; +S sHAg[] = { 215, 208, a }; +S sOE[] = { 222, 212, 0 }; +S sFRS[] = { 213, 225, 226, 0 }; +S sFSOg[] = { 213, 226, 222, a }; +S sKOg[] = { 218, 222, a }; +S sgNF[] = { 32, 221, 213, 0 }; +S sIC[] = { 216, 210, 0 }; +S sgQF[] = { 32, 224, 213, 0 }; +S sPQF[] = { 223, 224, 213, 0 }; +S sLA[] = { 219, 208, 0 }; +S sMF[] = { 220, 213, 0 }; +S sgKO[] = { 32, 218, 222, 0 }; +S sASAg[] = { 208, 226, 208, a }; +S sQAN[] = { 224, 208, 221, 0 }; +S sRKI[] = { 225, 218, 216, 0 }; +S sgA[] = { 32, 208, 0 }; +S sBA[] = { 209, 208, 0 }; +S sOC[] = { 222, 210, 0 }; +S sWI[] = { 230, 216, 0 }; +S sNg[] = { 221, a }; +S sEI[] = { 212, 216, 0 }; +S se7I[] = { 231, 216, 0 }; +S sIQA[] = { 216, 224, 208, 0 }; +S sRSF[] = { 225, 226, 213, 0 }; +S sEF[] = { 212, 213, 0 }; +S sPQO[] = { 223, 224, 222, 0 }; +S sFNI[] = { 213, 221, 216, 0 }; +S sAR[] = { 208, 225, 0 }; +S sSFQ[] = { 226, 213, 224, 0 }; +S sLg[] = { 219, a }; +S sPOR[] = { 223, 222, 225, 0 }; +S se7F[] = { 231, 213, 0 }; +S sRg[] = { 225, a }; +S sAKS[] = { 208, 218, 226, 0 }; +S sKS[] = { 218, 226, 0 }; +S sgPQF[] = { 32, 223, 224, 213, 0 }; +S sIM[] = { 216, 220, 0 }; +S sOL[] = { 222, 219, 0 }; +S sOQ[] = { 222, 224, 0 }; +S sRA[] = { 225, 208, 0 }; +S sKAS[] = { 218, 208, 226, 0 }; +S sAU[] = { 208, 228, 0 }; +S sOP[] = { 222, 223, 0 }; +S sgKA[] = { 32, 218, 208, 0 }; +S sKea[] = { 218, 234, 0 }; +S sAQI[] = { 208, 224, 216, 0 }; +S sRSA[] = { 225, 226, 208, 0 }; +S sKQ[] = { 218, 224, 0 }; +S sRL[] = { 225, 219, 0 }; +S sgFg[] = { 32, 213, a }; +S sAL[] = { 208, 219, 0 }; +S sOSO[] = { 222, 226, 222, 0 }; +S sgBA[] = { 32, 209, 208, 0 }; +S sANF[] = { 208, 221, 213, 0 }; +S sQFH[] = { 224, 213, 215, 0 }; +S sKIg[] = { 218, 216, a }; +S sCef[] = { 210, 239, 0 }; +S sNFg[] = { 221, 213, a }; +S sgEO[] = { 32, 212, 222, 0 }; +S sINA[] = { 216, 221, 208, 0 }; +S sgOSg[] = { 32, 222, 226, a }; +S sRSFN[] = { 225, 226, 213, 221, 0 }; +S sACef[] = { 208, 210, 239, 0 }; +S sIRS[] = { 216, 225, 226, 0 }; +S sFQI[] = { 213, 224, 216, 0 }; +S sFLN[] = { 213, 219, 221, 0 }; +S sBO[] = { 209, 222, 0 }; +S sDO[] = { 211, 222, 0 }; +S se7N[] = { 231, 221, 0 }; +S sNOR[] = { 221, 222, 225, 0 }; +S sSFN[] = { 226, 213, 221, 0 }; +S sPQI[] = { 223, 224, 216, 0 }; +S sgHAg[] = { 32, 215, 208, a }; +S sISFL[] = { 216, 226, 213, 219, 0 }; +S sFC[] = { 213, 210, 0 }; +S sOSg[] = { 222, 226, a }; +S sOSOg[] = { 222, 226, 222, a }; +S sBI[] = { 209, 216, 0 }; +S sLAC[] = { 219, 208, 210, 0 }; +S sDQ[] = { 211, 224, 0 }; +S sgPQI[] = { 32, 223, 224, 216, 0 }; +S sgRS[] = { 32, 225, 226, 0 }; +S sSFL[] = { 226, 213, 219, 0 }; +S sIF[] = { 216, 213, 0 }; +S sgc0[] = { 32, 192, 0 }; +S sOJ[] = { 222, 217, 0 }; +S sKSF[] = { 218, 226, 213, 0 }; +S sNIef[] = { 221, 216, 239, 0 }; +S sLNI[] = { 219, 221, 216, 0 }; +S sEg[] = { 212, a }; +S se7A[] = { 231, 208, 0 }; +S sgT[] = { 32, 227, 0 }; +S sCAS[] = { 210, 208, 226, 0 }; +S sSFLN[] = { 226, 213, 219, 221, 0 }; +S sIHI[] = { 216, 215, 216, 0 }; +S sBAK[] = { 209, 208, 218, 0 }; +S sRC[] = { 225, 210, 0 }; +S sSNO[] = { 226, 221, 222, 0 }; +S sIFg[] = { 216, 213, a }; +S sNIefg[] = { 221, 216, 239, a }; +S sAKSF[] = { 208, 218, 226, 213, 0 }; +S sgRea[] = { 32, 225, 234, 0 }; +S sAP[] = { 208, 223, 0 }; +S sgc1[] = { 32, 193, 0 }; +S sSFQI[] = { 226, 213, 224, 216, 0 }; +S sOH[] = { 222, 215, 0 }; +S sDQA[] = { 211, 224, 208, 0 }; +S sIL[] = { 216, 219, 0 }; +S sRSO[] = { 225, 226, 222, 0 }; +S sBAKS[] = { 209, 208, 218, 226, 0 }; +S sFNS[] = { 213, 221, 226, 0 }; +S sCAN[] = { 210, 208, 221, 0 }; +S sKSFQ[] = { 218, 226, 213, 224, 0 }; +S sgPQO[] = { 32, 223, 224, 222, 0 }; +S se9F[] = { 233, 213, 0 }; +S sgRg[] = { 32, 225, a }; +S sQAS[] = { 224, 208, 226, 0 }; +S sAB[] = { 208, 209, 0 }; +S sRSg[] = { 225, 226, a }; +S sgFE[] = { 32, 213, 212, 0 }; +S sFK[] = { 213, 218, 0 }; +S sefS[] = { 239, 226, 0 }; +S sMg[] = { 220, a }; +S sQAg[] = { 224, 208, a }; +S sHIK[] = { 215, 216, 218, 0 }; +S sCea[] = { 210, 234, 0 }; +S sgKea[] = { 32, 218, 234, 0 }; +S sASO[] = { 208, 226, 222, 0 }; +S sFSI[] = { 213, 226, 216, 0 }; +S sgRA[] = { 32, 225, 208, 0 }; +S sCASg[] = { 210, 208, 226, a }; +S sIRSF[] = { 216, 225, 226, 213, 0 }; +S sgQFH[] = { 32, 224, 213, 215, 0 }; +S sgc0A[] = { 32, 192, 208, 0 }; +S sTR[] = { 227, 225, 0 }; +S sPA[] = { 223, 208, 0 }; +S sII[] = { 216, 216, 0 }; +S sSQ[] = { 226, 224, 0 }; +S sRSI[] = { 225, 226, 216, 0 }; +S sc0A[] = { 192, 208, 0 }; +S sHIR[] = { 215, 216, 225, 0 }; +S sNORS[] = { 221, 222, 225, 226, 0 }; +S sAE[] = { 208, 212, 0 }; +S sFNSN[] = { 213, 221, 226, 221, 0 }; +S sNRK[] = { 221, 225, 218, 0 }; +S sCOg[] = { 210, 222, a }; +S sPF[] = { 223, 213, 0 }; +S sLACef[] = { 219, 208, 210, 239, 0 }; +S sLIg[] = { 219, 216, a }; +S sUA[] = { 228, 208, 0 }; +S sQANI[] = { 224, 208, 221, 216, 0 }; +S sQFHI[] = { 224, 213, 215, 216, 0 }; +S sgc8[] = { 32, 200, 0 }; +S sRKA[] = { 225, 218, 208, 0 }; +S sgc8A[] = { 32, 200, 208, 0 }; +S sRLA[] = { 225, 219, 208, 0 }; +S sHC[] = { 215, 210, 0 }; +S sQT[] = { 224, 227, 0 }; +S sefCA[] = { 239, 210, 208, 0 }; +S sefC[] = { 239, 210, 0 }; +S sSCO[] = { 226, 210, 222, 0 }; +S sIIg[] = { 216, 216, a }; +S sRAg[] = { 225, 208, a }; +S sHIRS[] = { 215, 216, 225, 226, 0 }; +S sgBAK[] = { 32, 209, 208, 218, 0 }; +S sSNI[] = { 226, 221, 216, 0 }; +S sCefN[] = { 210, 239, 221, 0 }; +S sFNg[] = { 213, 221, a }; +S sFM[] = { 213, 220, 0 }; +S sgbd[] = { 32, 189, 0 }; +S sHN[] = { 215, 221, 0 }; +S sGN[] = { 214, 221, 0 }; +S sON[] = { 222, 221, 0 }; +S sQAB[] = { 224, 208, 209, 0 }; +S sc8A[] = { 200, 208, 0 }; +S sCANF[] = { 210, 208, 221, 213, 0 }; +S sgFH[] = { 32, 213, 215, 0 }; +S sgFHI[] = { 32, 213, 215, 216, 0 }; +S sHIKg[] = { 215, 216, 218, a }; +S sDL[] = { 211, 219, 0 }; +S sQFE[] = { 224, 213, 212, 0 }; +S sDAQ[] = { 211, 208, 224, 0 }; +S sefNRK[] = { 239, 221, 225, 218, 0 }; +S sACefN[] = { 208, 210, 239, 221, 0 }; +S sCefNR[] = { 210, 239, 221, 225, 0 }; +S sefNR[] = { 239, 221, 225, 0 }; +S seaL[] = { 234, 219, 0 }; +S sNRS[] = { 221, 225, 226, 0 }; +S sACA[] = { 208, 210, 208, 0 }; +S sSK[] = { 226, 218, 0 }; +S sSFNS[] = { 226, 213, 221, 226, 0 }; +S sRSCO[] = { 225, 226, 210, 222, 0 }; +S sNef[] = { 221, 239, 0 }; +S sRSAC[] = { 225, 226, 208, 210, 0 }; +S sMA[] = { 220, 208, 0 }; +S se9A[] = { 233, 208, 0 }; +S sQIK[] = { 224, 216, 218, 0 }; +S sNSN[] = { 221, 226, 221, 0 }; +S sgb1[] = { 32, 177, 0 }; +S sgc8AU[] = { 32, 200, 208, 228, 0 }; +S sc8AU[] = { 200, 208, 228, 0 }; +S sgIH[] = { 32, 216, 215, 0 }; +S sQIKg[] = { 224, 216, 218, a }; +S sSAC[] = { 226, 208, 210, 0 }; +S sgPOR[] = { 32, 223, 222, 225, 0 }; +S sgMO[] = { 32, 220, 222, 0 }; +S sFHIR[] = { 213, 215, 216, 225, 0 }; +S sKAg[] = { 218, 208, a }; +S sRLAC[] = { 225, 219, 208, 210, 0 }; +S sefN[] = { 239, 221, 0 }; +S sPI[] = { 223, 216, 0 }; +S sgc0Ae8[] = { 32, 192, 208, 232, 0 }; +S sABO[] = { 208, 209, 222, 0 }; +S sgKAS[] = { 32, 218, 208, 226, 0 }; +S sAe8K[] = { 208, 232, 218, 0 }; +S sHM[] = { 215, 220, 0 }; +S sgPOg[] = { 32, 223, 222, a }; +S sBOS[] = { 209, 222, 226, 0 }; +S sST[] = { 226, 227, 0 }; +S sANFg[] = { 208, 221, 213, a }; +S sKASA[] = { 218, 208, 226, 208, 0 }; +S sc8AUA[] = { 200, 208, 228, 208, 0 }; +S sQABO[] = { 224, 208, 209, 222, 0 }; +S sgb8[] = { 32, 184, 0 }; +S sRO[] = { 225, 222, 0 }; +S seaC[] = { 234, 210, 0 }; +S sQIg[] = { 224, 216, a }; +S sIW[] = { 216, 230, 0 }; +S sPORS[] = { 223, 222, 225, 226, 0 }; +S sFHIK[] = { 213, 215, 216, 218, 0 }; +S sFEI[] = { 213, 212, 216, 0 }; +S sOef[] = { 222, 239, 0 }; +S sUAQI[] = { 228, 208, 224, 216, 0 }; +S sIO[] = { 216, 222, 0 }; +S sQOR[] = { 224, 222, 225, 0 }; +S sgANS[] = { 32, 208, 221, 226, 0 }; +S sICA[] = { 216, 210, 208, 0 }; +S sODQ[] = { 222, 211, 224, 0 }; +S sUI[] = { 228, 216, 0 }; +S sRQ[] = { 225, 224, 0 }; +S sDF[] = { 211, 213, 0 }; +S sRP[] = { 225, 223, 0 }; +S sgRAg[] = { 32, 225, 208, a }; +S sAQIK[] = { 208, 224, 216, 218, 0 }; +S sgRQ[] = { 32, 225, 224, 0 }; +S sABOS[] = { 208, 209, 222, 226, 0 }; +S sAUAQ[] = { 208, 228, 208, 224, 0 }; +S sc0Ae8K[] = { 192, 208, 232, 218, 0 }; +S sb7A[] = { 183, 208, 0 }; +S sNOS[] = { 221, 222, 226, 0 }; +S sQg[] = { 224, a }; +S sRKIg[] = { 225, 218, 216, a }; +S sAe8[] = { 208, 232, 0 }; +S sANSI[] = { 208, 221, 226, 216, 0 }; +S sANS[] = { 208, 221, 226, 0 }; +S sgb7A[] = { 32, 183, 208, 0 }; +S se8K[] = { 232, 218, 0 }; +S sIQAg[] = { 216, 224, 208, a }; +S sBQ[] = { 209, 224, 0 }; +S sODQA[] = { 222, 211, 224, 208, 0 }; +S sAUA[] = { 208, 228, 208, 0 }; +S sAe8KO[] = { 208, 232, 218, 222, 0 }; +S sAM[] = { 208, 220, 0 }; +S sNIFg[] = { 221, 216, 213, a }; +S sc0Ae8[] = { 192, 208, 232, 0 }; +S sgb7[] = { 32, 183, 0 }; +S sgAN[] = { 32, 208, 221, 0 }; +S se9Fg[] = { 233, 213, a }; +S sNOSO[] = { 221, 222, 226, 222, 0 }; +S sJg[] = { 217, a }; +S sNIF[] = { 221, 216, 213, 0 }; +S se8KO[] = { 232, 218, 222, 0 }; +S sIWI[] = { 216, 230, 216, 0 }; +S sINAg[] = { 216, 221, 208, a }; +S sDOg[] = { 211, 222, a }; +S sgQA[] = { 32, 224, 208, 0 }; + +N l4n1[] = { { sRKI, .547 }, H }; +N l4n2[] = { { sOg, 4.334 }, { sIKg, 1.010 }, { sSFN, .421 }, H }; +N l4n4[] = { { sEI, .365 }, { sANF, .463 }, H }; +N l4n5[] = { { sgF, .542 }, H }; +N l4n6[] = { { sgMO, .196 }, H }; +N l4n7[] = { { sIef, .814 }, { se9A, .196 }, { sgb7, .112 }, H }; +N l4n8[] = { { sIQ, .421 }, { sPQF, .589 }, { sc8A, .196 }, { sc0Ae8, .252 }, H }; +N l4n10[] = { { sQFHI, .393 }, { sICA, .252 }, H }; +N l4n11[] = { { sSN, .505 }, H }; +N l4n12[] = { { sHIR, .337 }, H }; +N l4n13[] = { { sBO, .281 }, H }; +N l4n14[] = { { sRP, .168 }, H }; +N l4n15[] = { { sRA, .337 }, H }; +N l4n16[] = { { sAQ, .701 }, { sc0A, .224 }, { sPORS, .337 }, H }; +N l4n17[] = { { sefg, 1.431 }, { sAB, .224 }, H }; +N l4n18[] = { { sFH, .505 }, { sNRK, .295 }, { sACA, .295 }, H }; +N l4n21[] = { { sFSI, .337 }, H }; +N l4n23[] = { { sgHA, .533 }, H }; +N l4n24[] = { { sgc8A, .196 }, { sDL, .196 }, { sgb8, .112 }, H }; +N l4n25[] = { { sIR, .477 }, H }; +N l4n26[] = { { sIC, .393 }, H }; +N l4n27[] = { { sNI, 2.076 }, { sANSI, .337 }, H }; +N l4n28[] = { { sSO, 1.571 }, { se8KO, .252 }, H }; +N l4n30[] = { { se7F, .337 }, { sKIg, .694 }, H }; +N l4n31[] = { { sBA, .365 }, { sHIKg, .589 }, { sRQ, .168 }, H }; +N l4n33[] = { { sAR, .337 }, { sgFE, .224 }, { sgRAg, .224 }, H }; +N l4n34[] = { { sAC, .786 }, { sASA, .673 }, H }; +N l4n35[] = { { sSFQ, .505 }, { sBAKS, .505 }, H }; +N l4n36[] = { { sKO, 1.094 }, H }; +N l4n37[] = { { sANI, .800 }, { sINAg, .505 }, H }; +N l4n38[] = { { sPF, .196 }, H }; +N l4n39[] = { { sgH, .374 }, { sFEI, .252 }, H }; +N l4n40[] = { { sLACef, .393 }, { sgc8, .131 }, H }; +N l4n41[] = { { sPQI, .421 }, { sOH, .252 }, H }; +N l4n42[] = { { sIS, 1.291 }, H }; +N l4n44[] = { { sCO, .589 }, { sNOR, .421 }, H }; +N l4n46[] = { { sSA, 1.347 }, { sFNS, .379 }, H }; +N l4n47[] = { { sKSFQ, .505 }, { sBQ, .168 }, { sgAN, .168 }, H }; +N l4n48[] = { { sRLAC, .393 }, H }; +N l4n49[] = { { sRSA, .463 }, { sRC, .252 }, { sgRg, .224 }, H }; +N l4n50[] = { { sAS, 1.319 }, { sgCg, .505 }, { sLN, .449 }, { sWI, .365 }, H }; +N l4n51[] = { { sQT, .196 }, H }; +N l4n52[] = { { sSAC, .295 }, H }; +N l4n54[] = { { sKA, .898 }, { sQIKg, .589 }, H }; +N l4n55[] = { { sge7, .206 }, { sNOS, .252 }, H }; +N l4n56[] = { { sgI, .767 }, H }; +N l4n57[] = { { sgPO, .701 }, { sHAg, .884 }, H }; +N l4n60[] = { { sCANF, .393 }, H }; +N l4n61[] = { { sLIg, .442 }, H }; +N l4n62[] = { { sCA, 1.122 }, { sSQ, .224 }, H }; +N l4n63[] = { { sgBAK, .262 }, H }; +N l4n64[] = { { sQg, .252 }, H }; +N l4n65[] = { { sRS, 2.272 }, { sABOS, .337 }, H }; +N l4n66[] = { { sgFH, .196 }, { sNIF, .252 }, H }; +N l4n68[] = { { sgEAg, .673 }, { sOSg, .631 }, { sAE, .224 }, { sNSN, .295 }, { sc8AUA, .337 }, { sAUA, .252 }, H }; +N l4n69[] = { { sQF, 1.178 }, { sFK, .224 }, H }; +N l4n70[] = { { sKQ, .309 }, H }; +N l4n71[] = { { sRSC, .673 }, H }; +N l4n72[] = { { sIg, 4.755 }, { sNFg, .694 }, { sgc0Ae8, .224 }, { seaC, .168 }, H }; +N l4n73[] = { { sefNR, .295 }, H }; +N l4n74[] = { { sgKA, .309 }, H }; +N l4n75[] = { { sDO, .281 }, { sOJ, .252 }, H }; +N l4n77[] = { { sCef, .309 }, { sIF, .281 }, H }; +N l4n78[] = { { sIRSF, .449 }, H }; +N l4n79[] = { { sgPQ, .926 }, H }; +N l4n80[] = { { sAg, 7.827 }, { sSC, .533 }, { sNISF, 1.010 }, { sQAg, .505 }, H }; +N l4n81[] = { { sISF, 1.641 }, { se7I, .365 }, H }; +N l4n83[] = { { sSNI, .295 }, H }; +N l4n84[] = { { sgOS, .617 }, { sAU, .337 }, { sCASg, .673 }, H }; +N l4n85[] = { { sLA, .393 }, H }; +N l4n86[] = { { sFL, .505 }, H }; +N l4n87[] = { { sFSO, .631 }, H }; +N l4n88[] = { { sgRFg, .823 }, { sAQI, .463 }, { sIQAg, .505 }, H }; +N l4n89[] = { { sPI, .168 }, H }; +N l4n90[] = { { sgK, .804 }, { sFHI, .589 }, H }; +N l4n91[] = { { sLAC, .421 }, H }; +N l4n92[] = { { se9F, .224 }, { sKASA, .337 }, H }; +N l4n93[] = { { sDA, .421 }, { sDQA, .379 }, H }; +N l4n95[] = { { sRg, .505 }, H }; +N l4n96[] = { { sAKS, .505 }, { sNIef, .379 }, H }; +N l4n97[] = { { sHI, .786 }, { sQFE, .295 }, { sRKIg, .505 }, H }; +N l4n98[] = { { sMO, .421 }, H }; +N l4n100[] = { { sRF, .757 }, { sANFg, .505 }, H }; +N l4n101[] = { { sgFg, .309 }, H }; +N l4n103[] = { { sIefg, 1.641 }, { sACef, .421 }, { sFM, .196 }, { sJg, .252 }, H }; +N l4n104[] = { { sRSF, .547 }, { sKS, .337 }, { sgKea, .224 }, H }; +N l4n106[] = { { sEO, .421 }, { sPOR, .505 }, { sNRS, .295 }, H }; +N l4n107[] = { { sPQO, .547 }, H }; +N l4n108[] = { { sgQFH, .299 }, { sUA, .196 }, H }; +N l4n109[] = { { sOL, .337 }, { sDQ, .281 }, { sgbd, .131 }, H }; +N l4n110[] = { { sOSO, .463 }, { sTR, .224 }, { sIW, .168 }, H }; +N l4n111[] = { { sIH, .673 }, { sQAN, .547 }, { sRAg, .442 }, { sCefNR, .393 }, H }; +N l4n113[] = { { sST, .168 }, { sgRQ, .168 }, H }; +N l4n114[] = { { sFRS, .589 }, H }; +N l4n116[] = { { sMA, .196 }, H }; +N l4n117[] = { { sgIH, .196 }, H }; +N l4n119[] = { { sAH, .421 }, { sgHAg, .374 }, H }; +N l4n120[] = { { sFN, 1.234 }, { sQI, 1.094 }, H }; +N l4n122[] = { { sLNI, .379 }, H }; +N l4n123[] = { { sNIg, 1.641 }, H }; +N l4n124[] = { { sSOg, 2.525 }, { sEA, .786 }, { sgM, .393 }, H }; +N l4n125[] = { { sgNA, 1.515 }, { sBAK, .379 }, H }; +N l4n126[] = { { sSg, 2.230 }, { sgEO, .281 }, H }; +N l4n127[] = { { sIe7, .421 }, H }; +N l4n128[] = { { sII, .224 }, H }; +N l4n129[] = { { sNO, 1.094 }, H }; +N l4n130[] = { { sASAg, 1.094 }, { sQFH, .463 }, H }; +N l4n131[] = { { sSF, 1.908 }, { sSFLN, .505 }, H }; +N l4n132[] = { { sKOg, .884 }, H }; +N l4n133[] = { { sQABO, .337 }, { sODQ, .252 }, H }; +N l4n134[] = { { sKg, .715 }, H }; +N l4n135[] = { { sgRS, .281 }, H }; +N l4n137[] = { { sORS, .842 }, { sRSI, .337 }, { sQOR, .252 }, H }; +N l4n140[] = { { sCOg, .442 }, H }; +N l4n141[] = { { sgN, 1.421 }, H }; +N l4n142[] = { { sCg, 1.136 }, { sSAg, 1.704 }, H }; +N l4n143[] = { { sgbf, .281 }, { sKSF, .379 }, { sON, .196 }, H }; +N l4n144[] = { { sgc0A, .224 }, { sAe8KO, .337 }, H }; +N l4n146[] = { { sASg, 1.262 }, { se8K, .168 }, H }; +N l4n147[] = { { sNA, 2.665 }, { sCF, .645 }, { sANS, .252 }, H }; +N l4n148[] = { { sUAQI, .337 }, H }; +N l4n149[] = { { sSNO, .379 }, H }; +N l4n150[] = { { sKAg, .442 }, { sc0Ae8K, .337 }, H }; +N l4n151[] = { { sRI, .449 }, { sGN, .196 }, H }; +N l4n152[] = { { sgIg, .617 }, { sAe8, .168 }, H }; +N l4n153[] = { { sgPOg, .224 }, H }; +N l4n155[] = { { sABO, .252 }, H }; +N l4n158[] = { { sgO, .748 }, { sCAg, 1.010 }, { sefN, .196 }, H }; +N l4n160[] = { { sgc0, .187 }, H }; +N l4n161[] = { { sRSg, .505 }, { sgb1, .131 }, H }; +N l4n162[] = { { sIK, .673 }, { sNef, .196 }, { sNIFg, .505 }, H }; +N l4n165[] = { { sLg, .505 }, { sHM, .168 }, H }; +N l4n166[] = { { se7N, .281 }, { sQAS, .337 }, H }; +N l4n167[] = { { sBI, .281 }, { sRSAC, .393 }, H }; +N l4n168[] = { { sSFNS, .393 }, H }; +N l4n169[] = { { sRKA, .295 }, H }; +N l4n170[] = { { sAK, .729 }, { sLF, .449 }, H }; +N l4n171[] = { { sFQ, .673 }, { sSFQI, .505 }, { sDOg, .379 }, H }; +N l4n173[] = { { sIFg, .568 }, H }; +N l4n175[] = { { sgP, 1.272 }, H }; +N l4n176[] = { { sgA, .243 }, { sgQA, .168 }, H }; +N l4n177[] = { { sISFg, 2.357 }, { sOP, .337 }, { sgBA, .309 }, { sgc1, .168 }, H }; +N l4n178[] = { { sHIRS, .393 }, { sDF, .168 }, H }; +N l4n179[] = { { sIL, .252 }, H }; +N l4n180[] = { { sNR, .449 }, { sgNF, .393 }, { sgOSg, .374 }, H }; +N l4n182[] = { { sSI, .842 }, { sHN, .196 }, { sIWI, .252 }, H }; +N l4n183[] = { { sFSOg, 1.178 }, { sIHI, .379 }, H }; +N l4n185[] = { { sRK, .701 }, H }; +N l4n186[] = { { sRLA, .295 }, H }; +N l4n187[] = { { sAL, .309 }, H }; +N l4n188[] = { { sFR, .673 }, { sASO, .337 }, { se9Fg, .379 }, H }; +N l4n189[] = { { sFC, .281 }, { sCAN, .379 }, H }; +N l4n190[] = { { sKI, .533 }, H }; +N l4n191[] = { { sPO, 1.010 }, { sHIK, .337 }, H }; +N l4n192[] = { { sgQ, .430 }, { sFNI, .547 }, { sNIefg, .757 }, H }; +N l4n193[] = { { sgB, .411 }, { sgRA, .224 }, { sOef, .168 }, H }; +N l4n194[] = { { sOQ, .337 }, H }; +N l4n195[] = { { sOB, .421 }, { sBOS, .252 }, H }; +N l4n196[] = { { sRFg, 1.389 }, { sIM, .337 }, { sMg, .337 }, { sgc8AU, .262 }, H }; +N l4n197[] = { { sNS, .477 }, { sINA, .421 }, { sFNSN, .393 }, H }; +N l4n198[] = { { sCI, .477 }, H }; +N l4n201[] = { { sRea, .393 }, { sMF, .365 }, { se7A, .252 }, H }; +N l4n202[] = { { sRL, .309 }, { sgFHI, .262 }, H }; +N l4n203[] = { { sRSO, .379 }, H }; +N l4n204[] = { { sEg, .379 }, { sCefN, .295 }, { sAM, .168 }, H }; +N l4n205[] = { { sFS, .926 }, H }; +N l4n206[] = { { sgPQF, .449 }, { sOSOg, .842 }, H }; +N l4n207[] = { { sIRS, .421 }, H }; +N l4n209[] = { { sgR, 1.534 }, { sNIS, .757 }, { sEF, .365 }, { sPA, .224 }, { sNOSO, .337 }, H }; +N l4n210[] = { { sgC, .767 }, { sNORS, .449 }, H }; +N l4n211[] = { { sOR, 1.094 }, { sefCA, .295 }, H }; +N l4n212[] = { { sOC, .365 }, { sc8AU, .295 }, H }; +N l4n213[] = { { sIN, .645 }, { sFLN, .421 }, { sgANS, .224 }, H }; +N l4n214[] = { { sQIK, .295 }, H }; +N l4n215[] = { { sgPQI, .374 }, { sefNRK, .393 }, H }; +N l4n216[] = { { sFNg, .442 }, { sSK, .196 }, { sQIg, .379 }, H }; +N l4n217[] = { { sHA, .645 }, H }; +N l4n218[] = { { sSCO, .295 }, H }; +N l4n220[] = { { sEAg, 1.262 }, { sgPOR, .262 }, H }; +N l4n221[] = { { sgNAg, 1.683 }, { sAN, 1.206 }, { sLI, .673 }, H }; +N l4n222[] = { { sQO, .898 }, H }; +N l4n223[] = { { sFE, .645 }, { sAKSF, .505 }, { sgRea, .252 }, H }; +N l4n224[] = { { sIIg, .442 }, H }; +N l4n225[] = { { sPQ, 1.150 }, { sNOg, 1.010 }, { seaL, .196 }, { sRSCO, .393 }, H }; +N l4n226[] = { { sgS, .411 }, { sISFL, .561 }, H }; +N l4n227[] = { { sSFg, 1.894 }, { sgD, .318 }, { sNg, .547 }, { sefC, .196 }, H }; +N l4n228[] = { { sOS, 1.291 }, { sgEA, .533 }, { sgKO, .365 }, { sAUAQ, .337 }, H }; +N l4n229[] = { { sOD, .533 }, H }; +N l4n230[] = { { sIO, .168 }, { sAQIK, .337 }, H }; +N l4n231[] = { { sgQF, .393 }, H }; +N l4n232[] = { { sNF, .786 }, { sFHIK, .337 }, H }; +N l4n233[] = { { sgPQO, .337 }, H }; +N l4n235[] = { { sFg, 4.040 }, { sQAB, .295 }, H }; +N l4n236[] = { { sKAS, .505 }, { sSFL, .421 }, H }; +N l4n240[] = { { sQA, 1.543 }, { sKea, .309 }, { sgKAS, .224 }, H }; +N l4n243[] = { { sNAg, 4.356 }, { sFQI, .421 }, { sgT, .168 }, { sefS, .224 }, H }; +N l4n244[] = { { sgE, .692 }, { sCAS, .379 }, { sUI, .168 }, H }; +N l4n245[] = { { sODQA, .337 }, H }; +N l4n246[] = { { sOE, .393 }, { sAe8K, .252 }, H }; +N l4n247[] = { { sQANI, .393 }, { sgb7A, .168 }, H }; +N l4n248[] = { { sgRF, .673 }, { sIQA, .547 }, { sCea, .224 }, H }; +N l4n249[] = { { sb7A, .112 }, H }; +N l4n251[] = { { sHC, .196 }, H }; +N l4n252[] = { { sMI, .421 }, H }; +N l4n253[] = { { sDAQ, .295 }, { sFHIR, .393 }, { sRO, .168 }, H }; +N l4n254[] = { { sACefN, .393 }, H }; +N l4n255[] = { { sRSFN, .561 }, { sAP, .252 }, H }; + +D l4_d = { "bulgarian", "iso-8859-5", - { - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,0.001,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,0.001,W,W,W,W,W,W,W,W,W,W,W,W,W, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - 0.005,0.005,0.004,0.001,0.001,0.001,Y,0.005,0.004,0.002,0.001,0.001,0.003,0.006,0.001,0.012, - 0.008,0.011,0.003,0.002,0.002,V,0.001,V,0.008,V,V,V,V,V,V,V, - 0.525,0.063,0.192,0.067,0.116,0.385,0.024,0.107,0.439,0.017,0.181,0.113,0.079,0.333,0.395,0.125, - 0.232,0.259,0.373,0.047,0.027,0.016,0.020,0.058,0.015,0.021,0.059,V,V,V,0.002,0.083, - V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V - }, - { - X,l4n1,l4n2,X,l4n4,l4n5,l4n6,l4n7,l4n8,X,l4n10,l4n11,l4n12,l4n13,l4n14,l4n15, - l4n16,l4n17,l4n18,X,X,l4n21,X,l4n23,l4n24,l4n25,l4n26,l4n27,l4n28,X,l4n30,l4n31, - X,l4n33,l4n34,l4n35,l4n36,l4n37,l4n38,l4n39,l4n40,l4n41,l4n42,X,l4n44,X,l4n46,l4n47, - l4n48,l4n49,l4n50,l4n51,l4n52,X,l4n54,l4n55,l4n56,l4n57,X,X,l4n60,l4n61,l4n62,l4n63, - l4n64,l4n65,l4n66,X,l4n68,l4n69,l4n70,l4n71,l4n72,l4n73,l4n74,l4n75,X,l4n77,l4n78,l4n79, - l4n80,l4n81,X,l4n83,l4n84,l4n85,l4n86,l4n87,l4n88,l4n89,l4n90,l4n91,l4n92,l4n93,X,l4n95, - l4n96,l4n97,l4n98,X,l4n100,l4n101,X,l4n103,l4n104,X,l4n106,l4n107,l4n108,l4n109,l4n110,l4n111, - X,l4n113,l4n114,X,l4n116,l4n117,X,l4n119,l4n120,X,l4n122,l4n123,l4n124,l4n125,l4n126,l4n127, - l4n128,l4n129,l4n130,l4n131,l4n132,l4n133,l4n134,l4n135,X,l4n137,X,X,l4n140,l4n141,l4n142,l4n143, - l4n144,X,l4n146,l4n147,l4n148,l4n149,l4n150,l4n151,l4n152,l4n153,X,l4n155,X,X,l4n158,X, - l4n160,l4n161,l4n162,X,X,l4n165,l4n166,l4n167,l4n168,l4n169,l4n170,l4n171,X,l4n173,X,l4n175, - l4n176,l4n177,l4n178,l4n179,l4n180,X,l4n182,l4n183,X,l4n185,l4n186,l4n187,l4n188,l4n189,l4n190,l4n191, - l4n192,l4n193,l4n194,l4n195,l4n196,l4n197,l4n198,X,X,l4n201,l4n202,l4n203,l4n204,l4n205,l4n206,l4n207, - X,l4n209,l4n210,l4n211,l4n212,l4n213,l4n214,l4n215,l4n216,l4n217,l4n218,X,l4n220,l4n221,l4n222,l4n223, - l4n224,l4n225,l4n226,l4n227,l4n228,l4n229,l4n230,l4n231,l4n232,l4n233,X,l4n235,l4n236,X,X,X, - l4n240,X,X,l4n243,l4n244,l4n245,l4n246,l4n247,l4n248,l4n249,X,l4n251,l4n252,l4n253,l4n254,l4n255 - } + { W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, 0.001, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, 0.001, W, W, W, W, W, W, W, W, W, W, W, W, W, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + 0.005, 0.005, 0.004, 0.001, 0.001, 0.001, Y, 0.005, 0.004, 0.002, 0.001, 0.001, 0.003, 0.006, 0.001, 0.012, + 0.008, 0.011, 0.003, 0.002, 0.002, V, 0.001, V, 0.008, V, V, V, V, V, V, V, + 0.525, 0.063, 0.192, 0.067, 0.116, 0.385, 0.024, 0.107, 0.439, 0.017, 0.181, 0.113, 0.079, 0.333, 0.395, 0.125, + 0.232, 0.259, 0.373, 0.047, 0.027, 0.016, 0.020, 0.058, 0.015, 0.021, 0.059, V, V, V, 0.002, 0.083, + V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, V }, + { X, l4n1, l4n2, X, l4n4, l4n5, l4n6, l4n7, l4n8, X, l4n10, l4n11, l4n12, l4n13, l4n14, l4n15, + l4n16, l4n17, l4n18, X, X, l4n21, X, l4n23, l4n24, l4n25, l4n26, l4n27, l4n28, X, l4n30, l4n31, + X, l4n33, l4n34, l4n35, l4n36, l4n37, l4n38, l4n39, l4n40, l4n41, l4n42, X, l4n44, X, l4n46, l4n47, + l4n48, l4n49, l4n50, l4n51, l4n52, X, l4n54, l4n55, l4n56, l4n57, X, X, l4n60, l4n61, l4n62, l4n63, + l4n64, l4n65, l4n66, X, l4n68, l4n69, l4n70, l4n71, l4n72, l4n73, l4n74, l4n75, X, l4n77, l4n78, l4n79, + l4n80, l4n81, X, l4n83, l4n84, l4n85, l4n86, l4n87, l4n88, l4n89, l4n90, l4n91, l4n92, l4n93, X, l4n95, + l4n96, l4n97, l4n98, X, l4n100, l4n101, X, l4n103, l4n104, X, l4n106, l4n107, l4n108, l4n109, l4n110, l4n111, + X, l4n113, l4n114, X, l4n116, l4n117, X, l4n119, l4n120, X, l4n122, l4n123, l4n124, l4n125, l4n126, l4n127, + l4n128, l4n129, l4n130, l4n131, l4n132, l4n133, l4n134, l4n135, X, l4n137, X, X, l4n140, l4n141, l4n142, l4n143, + l4n144, X, l4n146, l4n147, l4n148, l4n149, l4n150, l4n151, l4n152, l4n153, X, l4n155, X, X, l4n158, X, + l4n160, l4n161, l4n162, X, X, l4n165, l4n166, l4n167, l4n168, l4n169, l4n170, l4n171, X, l4n173, X, l4n175, + l4n176, l4n177, l4n178, l4n179, l4n180, X, l4n182, l4n183, X, l4n185, l4n186, l4n187, l4n188, l4n189, l4n190, l4n191, + l4n192, l4n193, l4n194, l4n195, l4n196, l4n197, l4n198, X, X, l4n201, l4n202, l4n203, l4n204, l4n205, l4n206, l4n207, + X, l4n209, l4n210, l4n211, l4n212, l4n213, l4n214, l4n215, l4n216, l4n217, l4n218, X, l4n220, l4n221, l4n222, l4n223, + l4n224, l4n225, l4n226, l4n227, l4n228, l4n229, l4n230, l4n231, l4n232, l4n233, X, l4n235, l4n236, X, X, X, + l4n240, X, X, l4n243, l4n244, l4n245, l4n246, l4n247, l4n248, l4n249, X, l4n251, l4n252, l4n253, l4n254, l4n255 } }; - - // // Lng: bulgarian // Enc: utf8 // - -S sAb0[]={208,176,0}; -S sAb8[]={208,184,0}; -S sAbe[]={208,190,0}; -S sAb5[]={208,181,0}; -S sB82[]={209,130,0}; -S sAbd[]={208,189,0}; -S sB82A[]={209,130,208,0}; -S s82A[]={130,208,0}; -S sbdA[]={189,208,0}; -S sAbdA[]={208,189,208,0}; -S sB81[]={209,129,0}; -S sB80[]={209,128,0}; -S sAb0g[]={208,176,a}; -S sb0g[]={176,a}; -S s80A[]={128,208,0}; -S sB80A[]={209,128,208,0}; -S sAb2[]={208,178,0}; -S sAb0A[]={208,176,208,0}; -S sb0A[]={176,208,0}; -S sAba[]={208,186,0}; -S sb5A[]={181,208,0}; -S sAb5A[]={208,181,208,0}; -S sAb8A[]={208,184,208,0}; -S sb8A[]={184,208,0}; -S sAb8B[]={208,184,209,0}; -S sb8B[]={184,209,0}; -S sAbeA[]={208,190,208,0}; -S sbeA[]={190,208,0}; -S sAbeB[]={208,190,209,0}; -S sbeB[]={190,209,0}; -S s81A[]={129,208,0}; -S sB81A[]={209,129,208,0}; -S sb0B[]={176,209,0}; -S sAb0B[]={208,176,209,0}; -S sb8g[]={184,a}; -S sAb8g[]={208,184,a}; -S sAb2A[]={208,178,208,0}; -S sb2A[]={178,208,0}; -S sAbf[]={208,191,0}; -S sAbeg[]={208,190,a}; -S s81B[]={129,209,0}; -S sAb4[]={208,180,0}; -S sB81B[]={209,129,209,0}; -S sbeg[]={190,a}; -S sAbaA[]={208,186,208,0}; -S sbaA[]={186,208,0}; -S sAbb[]={208,187,0}; -S sb5B[]={181,209,0}; -S sAb5B[]={208,181,209,0}; -S sb5g[]={181,a}; -S sAb5g[]={208,181,a}; -S sbdAb0[]={189,208,176,0}; -S sAb7[]={208,183,0}; -S sAbdAb0[]={208,189,208,176,0}; -S sAb7A[]={208,183,208,0}; -S sbbA[]={187,208,0}; -S sAbbA[]={208,187,208,0}; -S sgB81[]={32,209,129,0}; -S s81B82[]={129,209,130,0}; -S sB81B82[]={209,129,209,130,0}; -S sAb4A[]={208,180,208,0}; -S sb4A[]={180,208,0}; -S sgAbd[]={32,208,189,0}; -S sB8f[]={209,143,0}; -S sbdAb8[]={189,208,184,0}; -S sAbdAb8[]={208,189,208,184,0}; -S sgAbdA[]={32,208,189,208,0}; -S sAbc[]={208,188,0}; -S sbdAb0g[]={189,208,176,a}; -S sB82Ab5[]={209,130,208,181,0}; -S sgAbf[]={32,208,191,0}; -S s82Ab5[]={130,208,181,0}; -S sAb3[]={208,179,0}; -S s81B82A[]={129,209,130,208,0}; -S sbfA[]={191,208,0}; -S sAbfA[]={208,191,208,0}; -S sAb1[]={208,177,0}; -S sB82Abe[]={209,130,208,190,0}; -S sAbcA[]={208,188,208,0}; -S s82Abe[]={130,208,190,0}; -S sbcA[]={188,208,0}; -S s80Ab0[]={128,208,176,0}; -S sB80Ab0[]={209,128,208,176,0}; -S sB8a[]={209,138,0}; -S s82g[]={130,a}; -S sB82g[]={209,130,a}; -S sB87[]={209,135,0}; -S sAbfB[]={208,191,209,0}; -S sbfB[]={191,209,0}; -S sgB81A[]={32,209,129,208,0}; -S sB82Ab0[]={209,130,208,176,0}; -S s82Ab0[]={130,208,176,0}; -S sAb0B82[]={208,176,209,130,0}; -S sb0B82[]={176,209,130,0}; -S sbeB82[]={190,209,130,0}; -S sAbeB82[]={208,190,209,130,0}; -S sAb8B82[]={208,184,209,130,0}; -S sb8B82[]={184,209,130,0}; -S sB87A[]={209,135,208,0}; -S s87A[]={135,208,0}; -S sb8B82A[]={184,209,130,208,0}; -S sAb1A[]={208,177,208,0}; -S sb3A[]={179,208,0}; -S sb1A[]={177,208,0}; -S sb5Abd[]={181,208,189,0}; -S sAb3A[]={208,179,208,0}; -S sAb5Abd[]={208,181,208,189,0}; -S sb0Abd[]={176,208,189,0}; -S sgAba[]={32,208,186,0}; -S sAb0Abd[]={208,176,208,189,0}; -S sB80Ab5[]={209,128,208,181,0}; -S sB83[]={209,131,0}; -S sAbaB[]={208,186,209,0}; -S sbdB[]={189,209,0}; -S sAbdB[]={208,189,209,0}; -S sbaB[]={186,209,0}; -S s80Ab5[]={128,208,181,0}; -S sgAb8[]={32,208,184,0}; -S sAbfB80[]={208,191,209,128,0}; -S sbfB80[]={191,209,128,0}; -S sgAb2[]={32,208,178,0}; -S sAb2Ab0[]={208,178,208,176,0}; -S s82Abeg[]={130,208,190,a}; -S sbfB80A[]={191,209,128,208,0}; -S sb2Ab0[]={178,208,176,0}; -S sgAbe[]={32,208,190,0}; -S s80Ab8[]={128,208,184,0}; -S sbaAbe[]={186,208,190,0}; -S sbeB81[]={190,209,129,0}; -S sAbaAbe[]={208,186,208,190,0}; -S sbdAbe[]={189,208,190,0}; -S sB80Ab8[]={209,128,208,184,0}; -S sAbdAbe[]={208,189,208,190,0}; -S sAbeB81[]={208,190,209,129,0}; -S sgAb4[]={32,208,180,0}; -S sbfAbe[]={191,208,190,0}; -S sgAbfB[]={32,208,191,209,0}; -S sAbfAbe[]={208,191,208,190,0}; -S sb0AbdA[]={176,208,189,208,0}; -S s8aA[]={138,208,0}; -S sB8aA[]={209,138,208,0}; -S sbdAb8B[]={189,208,184,209,0}; -S s8fg[]={143,a}; -S sB8fg[]={209,143,a}; -S sgAb4A[]={32,208,180,208,0}; -S sAb5B82[]={208,181,209,130,0}; -S sbeB82A[]={190,209,130,208,0}; -S s80Ab0A[]={128,208,176,208,0}; -S sb5B82[]={181,209,130,0}; -S sAbaAb0[]={208,186,208,176,0}; -S s80Abe[]={128,208,190,0}; -S sAb2B[]={208,178,209,0}; -S sgAbfA[]={32,208,191,208,0}; -S sbaAb0[]={186,208,176,0}; -S sb2B[]={178,209,0}; -S sB80Abe[]={209,128,208,190,0}; -S s82Ab5g[]={130,208,181,a}; -S sB82Ab8[]={209,130,208,184,0}; -S sgAbaA[]={32,208,186,208,0}; -S s82Ab8[]={130,208,184,0}; -S sgAb5[]={32,208,181,0}; -S sAb8B8f[]={208,184,209,143,0}; -S sb8B8f[]={184,209,143,0}; -S sgAbeB[]={32,208,190,209,0}; -S sb5B82A[]={181,209,130,208,0}; -S s82B[]={130,209,0}; -S sb4Ab0[]={180,208,176,0}; -S sb7Ab8[]={183,208,184,0}; -S sAbdAb5[]={208,189,208,181,0}; -S sbdAb5[]={189,208,181,0}; -S sb0Ab2[]={176,208,178,0}; -S sAb7Ab8[]={208,183,208,184,0}; -S sAb4Ab0[]={208,180,208,176,0}; -S sAb0Ab2[]={208,176,208,178,0}; -S sB82B[]={209,130,209,0}; -S s80Ab5A[]={128,208,181,208,0}; -S s81Ab5[]={129,208,181,0}; -S sb2g[]={178,a}; -S s82Ab0g[]={130,208,176,a}; -S sB81Ab5[]={209,129,208,181,0}; -S sAb2g[]={208,178,a}; -S sb0Aba[]={176,208,186,0}; -S sAb0Aba[]={208,176,208,186,0}; -S sb8B8fg[]={184,209,143,a}; -S sb0B82A[]={176,209,130,208,0}; -S sbdAb8g[]={189,208,184,a}; -S s81Aba[]={129,208,186,0}; -S s82Ab5A[]={130,208,181,208,0}; -S sAb0B80[]={208,176,209,128,0}; -S sb0B80[]={176,209,128,0}; -S sb5AbdA[]={181,208,189,208,0}; -S sB81Aba[]={209,129,208,186,0}; -S sgB81B[]={32,209,129,209,0}; -S sb5B80[]={181,209,128,0}; -S sAb5B81[]={208,181,209,129,0}; -S sb8Aba[]={184,208,186,0}; -S sAb8Aba[]={208,184,208,186,0}; -S sAbbAb8[]={208,187,208,184,0}; -S s81AbaA[]={129,208,186,208,0}; -S sbbAb8[]={187,208,184,0}; -S sAb5B80[]={208,181,209,128,0}; -S sB84[]={209,132,0}; -S sAb8Ab7[]={208,184,208,183,0}; -S sb5B81[]={181,209,129,0}; -S sb8Ab7[]={184,208,183,0}; -S s80Ab8A[]={128,208,184,208,0}; -S sb5Ab4[]={181,208,180,0}; -S sAb7Ab0[]={208,183,208,176,0}; -S sAb5Ab4[]={208,181,208,180,0}; -S sAb2Ab5[]={208,178,208,181,0}; -S sAb8Abd[]={208,184,208,189,0}; -S sb2Ab5[]={178,208,181,0}; -S sbaAbeA[]={186,208,190,208,0}; -S sb8Abd[]={184,208,189,0}; -S sgB80[]={32,209,128,0}; -S sb7Ab0[]={183,208,176,0}; -S s80B[]={128,209,0}; -S sgAb1[]={32,208,177,0}; -S sgAb8g[]={32,208,184,a}; -S s81Ab5g[]={129,208,181,a}; -S sbeB81B[]={190,209,129,209,0}; -S sB8fA[]={209,143,208,0}; -S sgB82[]={32,209,130,0}; -S sb8Ab7A[]={184,208,183,208,0}; -S s8fA[]={143,208,0}; -S sB80B[]={209,128,209,0}; -S sgAbc[]={32,208,188,0}; -S sAb2Abe[]={208,178,208,190,0}; -S sb2Abe[]={178,208,190,0}; -S sAb6[]={208,182,0}; -S sb5B80A[]={181,209,128,208,0}; -S sb6A[]={182,208,0}; -S sAb6A[]={208,182,208,0}; -S sgAb7A[]={32,208,183,208,0}; -S sb0B82g[]={176,209,130,a}; -S s83B[]={131,209,0}; -S sB83A[]={209,131,208,0}; -S sB83B[]={209,131,209,0}; -S sgAb7[]={32,208,183,0}; -S s83A[]={131,208,0}; -S sgB80A[]={32,209,128,208,0}; -S sb4Ab0g[]={180,208,176,a}; -S s82Ab8A[]={130,208,184,208,0}; -S sb5Ab4A[]={181,208,180,208,0}; -S sbeAb3[]={190,208,179,0}; -S s82Ab2[]={130,208,178,0}; -S sbaAb8[]={186,208,184,0}; -S sB82Ab2[]={209,130,208,178,0}; -S sgAb1A[]={32,208,177,208,0}; -S sAbaAb8[]={208,186,208,184,0}; -S sAbeAb3[]={208,190,208,179,0}; -S sb0B80A[]={176,209,128,208,0}; -S sB89[]={209,137,0}; -S sgAb8A[]={32,208,184,208,0}; -S sB86[]={209,134,0}; -S s84A[]={132,208,0}; -S s82Abd[]={130,208,189,0}; -S sB82Abd[]={209,130,208,189,0}; -S sb5Abb[]={181,208,187,0}; -S sAb5Ab7[]={208,181,208,183,0}; -S s82AbdA[]={130,208,189,208,0}; -S sB8fB[]={209,143,209,0}; -S sgAb2g[]={32,208,178,a}; -S sb0Ab2A[]={176,208,178,208,0}; -S s82Ab2A[]={130,208,178,208,0}; -S s82Ab0A[]={130,208,176,208,0}; -S s8fB[]={143,209,0}; -S sB8aB[]={209,138,209,0}; -S sAb5Abb[]={208,181,208,187,0}; -S sB84A[]={209,132,208,0}; -S s8aB[]={138,209,0}; -S sb5Ab7[]={181,208,183,0}; -S sbdB82[]={189,209,130,0}; -S sbdAbeB[]={189,208,190,209,0}; -S s89A[]={137,208,0}; -S sAbag[]={208,186,a}; -S sb8B81[]={184,209,129,0}; -S s86A[]={134,208,0}; -S sbfAbeB[]={191,208,190,209,0}; -S sb2Ab8[]={178,208,184,0}; -S sB89A[]={209,137,208,0}; -S sgAb3[]={32,208,179,0}; -S sAb2Ab8[]={208,178,208,184,0}; -S sbag[]={186,a}; -S sAbdB82[]={208,189,209,130,0}; -S sAb8B81[]={208,184,209,129,0}; -S sB86A[]={209,134,208,0}; -S sgAbcA[]={32,208,188,208,0}; -S sbeB81A[]={190,209,129,208,0}; -S sAbbAb5[]={208,187,208,181,0}; -S sB81Ab8[]={209,129,208,184,0}; -S sbdAbeg[]={189,208,190,a}; -S sgAb5A[]={32,208,181,208,0}; -S s80AbeB[]={128,208,190,209,0}; -S sbbAbd[]={187,208,189,0}; -S s81Ab8[]={129,208,184,0}; -S sb8Abag[]={184,208,186,a}; -S sbdB82A[]={189,209,130,208,0}; -S sA9f[]={208,159,0}; -S sAbdB81[]={208,189,209,129,0}; -S sb5B81B[]={181,209,129,209,0}; -S sb0AbaB[]={176,208,186,209,0}; -S sb7Ab8B[]={183,208,184,209,0}; -S sAbbAbd[]={208,187,208,189,0}; -S sbdB81[]={189,209,129,0}; -S sb2Ab0g[]={178,208,176,a}; -S sbbAb5[]={187,208,181,0}; -S sbbAbdA[]={187,208,189,208,0}; -S sAb8B80[]={208,184,209,128,0}; -S sbeAb1[]={190,208,177,0}; -S sbaAb0B[]={186,208,176,209,0}; -S sb3Ab0[]={179,208,176,0}; -S sAbeAb1[]={208,190,208,177,0}; -S sb0Ab7[]={176,208,183,0}; -S s80AbeA[]={128,208,190,208,0}; -S sAb0Ab7[]={208,176,208,183,0}; -S sb5AbbA[]={181,208,187,208,0}; -S sbcAb8[]={188,208,184,0}; -S sb8B87[]={184,209,135,0}; -S sb8B80[]={184,209,128,0}; -S sAb4Abe[]={208,180,208,190,0}; -S sAbcAb8[]={208,188,208,184,0}; -S sb4Abe[]={180,208,190,0}; -S sb5Ab7A[]={181,208,183,208,0}; -S sAb3Ab0[]={208,179,208,176,0}; -S sAbcAbe[]={208,188,208,190,0}; -S sb8B80A[]={184,209,128,208,0}; -S sgA9f[]={32,208,159,0}; -S sb8B87A[]={184,209,135,208,0}; -S sAb9[]={208,185,0}; -S sbcAbe[]={188,208,190,0}; -S sAb8B87[]={208,184,209,135,0}; -S sbbAb0[]={187,208,176,0}; -S sb2Ab5B[]={178,208,181,209,0}; -S sb8AbdA[]={184,208,189,208,0}; -S sb7Ab0g[]={183,208,176,a}; -S s81B8a[]={129,209,138,0}; -S sb8Ab2[]={184,208,178,0}; -S sAbbAb0[]={208,187,208,176,0}; -S sB81B8a[]={209,129,209,138,0}; -S sbdAb8A[]={189,208,184,208,0}; -S sAbeAb4[]={208,190,208,180,0}; -S sb4B[]={180,209,0}; -S s80Ab5B[]={128,208,181,209,0}; -S sbaAbeg[]={186,208,190,a}; -S sbdAb0A[]={189,208,176,208,0}; -S s80Ab0B[]={128,208,176,209,0}; -S sB85[]={209,133,0}; -S sAb4B[]={208,180,209,0}; -S sbeAb4[]={190,208,180,0}; -S sAb8Ab2[]={208,184,208,178,0}; -S sgAbaB[]={32,208,186,209,0}; -S sgB82A[]={32,209,130,208,0}; -S s87Ab8[]={135,208,184,0}; -S sB88[]={209,136,0}; -S sAb4Ab8[]={208,180,208,184,0}; -S sb8Ab2A[]={184,208,178,208,0}; -S sbeAb2[]={190,208,178,0}; -S sgAb0[]={32,208,176,0}; -S sAb4Ab5[]={208,180,208,181,0}; -S sb1Ab0[]={177,208,176,0}; -S s82Ab5B[]={130,208,181,209,0}; -S s81B82B[]={129,209,130,209,0}; -S sB86Ab8[]={209,134,208,184,0}; -S s86Ab8[]={134,208,184,0}; -S sAbcAb5[]={208,188,208,181,0}; -S sAb1Ab0[]={208,177,208,176,0}; -S sbeAb3A[]={190,208,179,208,0}; -S sb0Ab7A[]={176,208,183,208,0}; -S sbfAbeA[]={191,208,190,208,0}; -S sbcAb5[]={188,208,181,0}; -S sbdg[]={189,a}; -S sb2Ab0B[]={178,208,176,209,0}; -S sB87Ab8[]={209,135,208,184,0}; -S sb4Ab8[]={180,208,184,0}; -S sAbeAb2[]={208,190,208,178,0}; -S sAbdg[]={208,189,a}; -S sb4Ab5[]={180,208,181,0}; -S sB88A[]={209,136,208,0}; -S s81Ab0[]={129,208,176,0}; -S sbeAbb[]={190,208,187,0}; -S sb1Ab0A[]={177,208,176,208,0}; -S sgAb2A[]={32,208,178,208,0}; -S sbeAbf[]={190,208,191,0}; -S sb0B81[]={176,209,129,0}; -S sB87Ab5[]={209,135,208,181,0}; -S sbdAb5A[]={189,208,181,208,0}; -S sAbaB82[]={208,186,209,130,0}; -S sAbeAbf[]={208,190,208,191,0}; -S sbbg[]={187,a}; -S sb5AbdB[]={181,208,189,209,0}; -S sAbeB80[]={208,190,209,128,0}; -S sbaB82[]={186,209,130,0}; -S sB81Ab0[]={209,129,208,176,0}; -S sAb0B84[]={208,176,209,132,0}; -S sAb1B[]={208,177,209,0}; -S sAbbg[]={208,187,a}; - -N l5n0[]={{sB82Ab5,1.909},H}; -N l5n2[]={{sAb2,2.400},{sbfB,.468},{sB83,.590},{sAb2Ab0,1.123},H}; -N l5n3[]={{sAb3A,.926},{sB84A,.379},{sbdg,.182},H}; -N l5n4[]={{sbbAbdA,.299},H}; -N l5n5[]={{sbbAb0,.197},H}; -N l5n7[]={{sAb0Abd,1.207},{sbeAbf,.168},H}; -N l5n8[]={{sgAb8A,.337},{sb5Ab7A,.281},H}; -N l5n9[]={{sAbfAbe,1.011},{sB82Ab8,.842},H}; -N l5n10[]={{s86A,.159},H}; -N l5n11[]={{sb5g,1.347},{sbdAb8A,.262},{sAbaB82,.337},H}; -N l5n13[]={{sb3Ab0,.211},H}; -N l5n14[]={{sbdAb8B,.636},H}; -N l5n16[]={{sAb8B8f,.814},H}; -N l5n17[]={{sAb2Ab5,.646},{s87Ab8,.182},H}; -N l5n19[]={{sAb3,.842},{sB84,.337},{sAb3Ab0,.421},H}; -N l5n20[]={{sAb4A,1.684},H}; -N l5n22[]={{s81B82,1.137},{sb8Aba,.337},H}; -N l5n23[]={{s80Ab5,.590},H}; -N l5n24[]={{sb8A,1.376},{s82Abeg,1.123},{sB82Abd,.505},H}; -N l5n25[]={{sb8B80A,.281},H}; -N l5n26[]={{sAb2Ab8,.477},H}; -N l5n27[]={{sB82Abe,1.572},{sbfAbe,.505},H}; -N l5n29[]={{s82AbdA,.337},{sAbdg,.411},H}; -N l5n30[]={{s82Ab0,.674},{sgAbaA,.561},{sb0Aba,.365},H}; -N l5n31[]={{sAb4B,.295},H}; -N l5n32[]={{sb0A,1.572},H}; -N l5n33[]={{s8fA,.206},{sb0B80A,.356},{sgAbaB,.243},H}; -N l5n34[]={{sbeg,1.446},H}; -N l5n36[]={{sAb4,1.446},{sAb4Ab0,.786},{sB85,.197},H}; -N l5n37[]={{sAb5A,3.116},{sb2Ab5,.323},{sB86A,.358},H}; -N l5n39[]={{sb0B82g,.561},H}; -N l5n41[]={{sb8B,1.226},{s87A,.430},H}; -N l5n44[]={{sb4Ab0,.393},{sAb2Abe,.590},H}; -N l5n46[]={{sAbeg,3.253},{sB8fg,1.074},{sb8Ab2A,.243},H}; -N l5n47[]={{sb8B82A,.842},H}; -N l5n48[]={{sAb5B,2.084},H}; -N l5n49[]={{sb0B,1.067},H}; -N l5n50[]={{s8fB,.168},H}; -N l5n51[]={{sAb4Ab5,.365},H}; -N l5n52[]={{s82Ab2,.267},{sgAbcA,.318},{sb5AbbA,.281},H}; -N l5n53[]={{sAb5,4.814},{sB86,.253},H}; -N l5n54[]={{sB87A,.968},{s81Ab5,.379},{sAb6A,.442},{sb0Ab2A,.337},H}; -N l5n55[]={{sb0B82A,.487},{sb8Abd,.323},H}; -N l5n56[]={{s80Ab8,.547},H}; -N l5n59[]={{sAbdB81,.449},H}; -N l5n60[]={{sbbAb5,.225},{sAb4Ab8,.365},H}; -N l5n61[]={{sbdAbeg,.449},H}; -N l5n62[]={{sbaAb8,.267},{sAbdB82,.477},H}; -N l5n63[]={{sgAbdA,1.329},{sb1A,.412},{sb0Abd,.604},{sb1Ab0A,.225},H}; -N l5n64[]={{sAb0g,5.874},{sgAb0,.182},H}; -N l5n65[]={{sAb5Ab4,.646},{sgB80,.323},H}; -N l5n67[]={{sbdAb0,1.333},H}; -N l5n70[]={{sB87,.730},{sAb6,.295},{sb2Ab8,.239},H}; -N l5n71[]={{sAb7A,1.853},{sB88A,.253},H}; -N l5n73[]={{sAbeB80,.337},H}; -N l5n74[]={{sb5AbdA,.468},{sAb5Ab7,.505},H}; -N l5n75[]={{sgAb1,.309},H}; -N l5n76[]={{sgB81,1.151},{sAbeB81,1.095},{sb5B80,.337},H}; -N l5n77[]={{sgAbeB,.543},{sB86Ab8,.365},{sb5AbdB,.225},H}; -N l5n78[]={{sb8B8f,.407},{sb2Ab0g,.449},{sAb4Abe,.421},H}; -N l5n79[]={{sAbeB82,1.291},{sbdB81,.225},H}; -N l5n80[]={{s80A,1.675},{s80Ab0A,.618},{sbdAbeB,.318},H}; -N l5n81[]={{sB82g,1.674},H}; -N l5n83[]={{s80Ab0B,.262},H}; -N l5n84[]={{sb7Ab8B,.299},H}; -N l5n85[]={{s82Ab5,.954},{sgAbfA,.599},{sB87Ab5,.337},H}; -N l5n86[]={{sbaA,.954},{sgAb2,.575},{sAb5Abb,.505},H}; -N l5n87[]={{sAb7,1.333},{sb5B81,.337},{sAb7Ab0,.646},{sgB82,.309},{s81Ab8,.225},{sB88,.182},H}; -N l5n88[]={{sAb8A,3.095},{sgAbfB,.674},{sB89A,.358},H}; -N l5n89[]={{sbaAb0B,.281},H}; -N l5n90[]={{sAbfB80,1.151},{sbdB82,.239},H}; -N l5n91[]={{sAb0B80,.702},{sbcAb5,.182},H}; -N l5n92[]={{sAb5Abd,1.235},H}; -N l5n93[]={{sbbAb8,.337},H}; -N l5n94[]={{sb2A,1.048},{sB87Ab8,.365},H}; -N l5n97[]={{sB81B82,2.274},{sAb0B82,1.319},{s80B,.206},{sgAb3,.239},{sb2Ab0B,.243},H}; -N l5n98[]={{sb5B82,.463},{sAb2g,.853},H}; -N l5n99[]={{sAb8B,2.758},{sb4Ab5,.182},H}; -N l5n101[]={{sb8Ab7A,.412},H}; -N l5n102[]={{sb8B87A,.281},H}; -N l5n103[]={{sbaB,.393},{s89A,.159},{sAb0B84,.337},H}; -N l5n104[]={{sAb8,5.488},{sb8g,1.586},{sB89,.267},H}; -N l5n105[]={{sB8aA,.737},H}; -N l5n108[]={{sgAb4,.519},H}; -N l5n109[]={{s81Aba,.351},{sbeAb1,.211},{sb0Ab7A,.243},H}; -N l5n110[]={{sbeB81,.547},{s81B8a,.197},{sAb8Ab2,.393},H}; -N l5n111[]={{s81A,1.085},{sb2B,.299},{sAb7Ab8,.786},H}; -N l5n112[]={{sb0g,2.611},H}; -N l5n113[]={{s8fg,.477},H}; -N l5n116[]={{sB8aB,.379},H}; -N l5n117[]={{sbbA,.786},H}; -N l5n118[]={{s82Ab8,.421},{sb8Abag,.449},H}; -N l5n119[]={{sgAb5,.407},{sb5Ab4,.323},H}; -N l5n120[]={{sbeAb2,.182},H}; -N l5n121[]={{sB8a,.744},{sbeB82,.646},{sAb9,.211},{sB81B8a,.393},H}; -N l5n122[]={{sAbaA,2.148},{s80Abe,.449},{sbdAb5,.393},H}; -N l5n124[]={{sbcAb8,.211},H}; -N l5n125[]={{sb3A,.412},{sAb8Ab7,.674},H}; -N l5n126[]={{s82Ab0g,.758},H}; -N l5n128[]={{s81B,.964},{sbaAbe,.547},H}; -N l5n130[]={{sbfB80,.575},H}; -N l5n131[]={{sbeAb3,.267},H}; -N l5n132[]={{sb4Ab8,.182},H}; -N l5n133[]={{sAbaB,.884},{sgA9f,.211},H}; -N l5n134[]={{s81B82A,1.123},{s8aA,.328},{sAb8Aba,.674},H}; -N l5n135[]={{s80Ab5A,.524},H}; -N l5n136[]={{sb2Abe,.295},H}; -N l5n137[]={{sb7Ab0,.323},{s81B82B,.243},H}; -N l5n138[]={{sAba,2.260},{sAbaAb0,.898},{s80Ab5B,.262},H}; -N l5n139[]={{sAbbA,1.769},{sbfAbeA,.243},H}; -N l5n140[]={{sb4Ab0g,.561},H}; -N l5n141[]={{sgAb7,.281},H}; -N l5n142[]={{s82A,2.349},{s82Ab0A,.337},{sbfAbeB,.318},{sbeAb4,.197},H}; -N l5n143[]={{sAb8Abd,.646},H}; -N l5n145[]={{sb0AbaB,.299},H}; -N l5n148[]={{sbcA,.524},{sbbAbd,.225},H}; -N l5n149[]={{sAb5g,3.032},H}; -N l5n150[]={{s81Ab5g,.618},H}; -N l5n151[]={{s8aB,.168},H}; -N l5n152[]={{sgAb8,.575},{sb5Ab7,.253},{sb2Ab5B,.262},H}; -N l5n155[]={{sAbb,1.418},{sbdAb8,1.039},{sAbbAb0,.393},H}; -N l5n156[]={{sb4A,.749},{sAbcA,1.179},H}; -N l5n159[]={{s82B,.262},H}; -N l5n162[]={{sAbaAb8,.533},H}; -N l5n163[]={{sbdAb0g,1.937},H}; -N l5n164[]={{s82Ab2A,.337},H}; -N l5n166[]={{sbag,.239},H}; -N l5n167[]={{sb8AbdA,.262},H}; -N l5n168[]={{s80Ab8A,.430},H}; -N l5n169[]={{sb8B80,.211},H}; -N l5n170[]={{sAbbAb5,.449},H}; -N l5n172[]={{sAbc,.983},H}; -N l5n173[]={{sAbdA,5.095},{s83A,.187},{s82Abd,.253},{sb4B,.131},H}; -N l5n174[]={{sgAba,.604},{sb2g,.379},{sb8B8fg,.730},H}; -N l5n175[]={{sb0AbdA,.655},H}; -N l5n176[]={{sgA,5.343},{sAb5B80,.674},H}; -N l5n177[]={{sb0B80,.351},{sgB80A,.374},H}; -N l5n179[]={{sbdA,2.265},{sAb5B81,.674},{sAbbAb8,.674},{sbdAb0A,.262},H}; -N l5n180[]={{sAbaAbe,1.095},{sb8B81,.239},H}; -N l5n181[]={{s82Ab5g,.842},H}; -N l5n182[]={{sAb5B82,.926},{sgAb2g,.337},H}; -N l5n184[]={{s82Abe,.786},{sAbdB,.884},H}; -N l5n187[]={{sb5A,1.385},{sgAb1A,.356},{sAbcAb5,.365},H}; -N l5n188[]={{sgB81A,.917},{sb5B80A,.393},{sb0B81,.168},H}; -N l5n189[]={{sAbd,4.169},{sAbdAb0,2.667},H}; -N l5n190[]={{sAbeA,2.758},{sB8fA,.463},{s83B,.187},{sbcAbe,.211},{sb8Ab2,.197},H}; -N l5n191[]={{sB80A,3.769},{sb8B82,.646},{sgB81B,.468},{sA9f,.225},H}; -N l5n193[]={{sgB,1.488},H}; -N l5n194[]={{sAbbAbd,.449},H}; -N l5n196[]={{sbdB,.393},{sgAbc,.295},{sb5Abb,.253},{sAbcAb8,.421},H}; -N l5n197[]={{s82Ab5A,.468},{sbbg,.168},H}; -N l5n198[]={{sb0Ab2,.393},{sb4Abe,.211},{sgAb2A,.225},H}; -N l5n199[]={{sb0B82,.660},{sgB82A,.243},H}; -N l5n200[]={{sAb8g,3.569},{s82Ab5B,.243},H}; -N l5n201[]={{sAbeB,2.484},{sB8fB,.379},H}; -N l5n202[]={{sB80B,.463},{sbdB82A,.299},{sb5B81B,.299},H}; -N l5n204[]={{sb5B,.926},{sAbdAb5,.786},{s84A,.168},H}; -N l5n206[]={{sAbe,4.941},{sB8f,1.039},H}; -N l5n207[]={{sB80,2.905},{sgAbd,1.067},{sAbfA,1.221},{sB80Ab0,1.544},{sb1Ab0,.182},H}; -N l5n208[]={{sAb0A,3.537},{sB81A,2.442},H}; -N l5n209[]={{sAbeAb1,.421},H}; -N l5n210[]={{sbeA,1.226},{sb5B82A,.543},H}; -N l5n212[]={{sAbeAb2,.365},H}; -N l5n213[]={{sAbdAb8,2.077},H}; -N l5n214[]={{sAbcAbe,.421},H}; -N l5n215[]={{sAbeAb3,.533},H}; -N l5n218[]={{sAbfB,1.053},{sb5Abd,.618},{sgAbe,.561},{sb6A,.197},{sAbeAb4,.393},H}; -N l5n219[]={{sAb0B,2.400},{sB81B,2.169},{sbeAbb,.168},H}; -N l5n220[]={{sgAb4A,.618},H}; -N l5n221[]={{sbdAbe,.547},{s81AbaA,.449},H}; -N l5n222[]={{s82g,.744},{sB80Ab5,1.179},{sbeB81A,.299},H}; -N l5n223[]={{sAbf,1.558},H}; -N l5n224[]={{sAb0,6.569},{sB81,3.242},{s80Ab0,.772},{sbaAbeg,.393},{sB81Ab0,.337},H}; -N l5n225[]={{sB82A,5.285},{sAb1A,.926},{sb7Ab8,.393},{sbeB81B,.412},H}; -N l5n227[]={{sbeB,1.104},{sAb8B80,.421},H}; -N l5n229[]={{sgAbf,.954},H}; -N l5n230[]={{sbaAb0,.449},{sAb0Ab2,.786},{s82Ab8A,.356},{sAb8B81,.477},H}; -N l5n231[]={{sB80Ab8,1.095},{sAbdAbe,1.095},{sb5Ab4A,.356},{sgAb5A,.299},H}; -N l5n233[]={{sAb8B82,1.291},{sbeB82A,.618},{sb7Ab0g,.393},H}; -N l5n234[]={{sAbag,.537},{s80AbeA,.281},{sbdAb5A,.225},H}; -N l5n236[]={{sB82B,.590},{sAb1B,.253},H}; -N l5n237[]={{s80AbeB,.299},H}; -N l5n238[]={{sb2Ab0,.561},H}; -N l5n239[]={{sB81Ab5,.758},H}; -N l5n240[]={{sbaAbeA,.430},H}; -N l5n241[]={{sB82,4.660},{sbfA,.543},{sAb1,.786},{sB82Ab0,1.347},{sAb1Ab0,.365},H}; -N l5n242[]={{sAb2A,2.358},{sbfB80A,.749},{sB83A,.421},{s86Ab8,.182},H}; -N l5n243[]={{sbeAb3A,.243},H}; -N l5n245[]={{sb8Ab7,.337},{sAb0Ab7,.421},H}; -N l5n246[]={{sb8B87,.211},H}; -N l5n247[]={{sB82Ab2,.533},H}; -N l5n248[]={{sgAb8g,.412},{sB81Ab8,.449},{sAb8B87,.421},H}; -N l5n249[]={{sb7A,.823},{sB80Abe,.898},H}; -N l5n251[]={{sbdAb8g,.730},{sAbeAbf,.337},{sAbbg,.379},H}; -N l5n253[]={{sAb2B,.674},{sgAb7A,.374},{sB83B,.421},{sb0Ab7,.211},{sbaB82,.168},H}; -N l5n254[]={{sAb0Aba,.730},{sB81Aba,.702},H}; -N l5n255[]={{s81Ab0,.168},H}; - -D l5_d = -{ +S sAb0[] = { 208, 176, 0 }; +S sAb8[] = { 208, 184, 0 }; +S sAbe[] = { 208, 190, 0 }; +S sAb5[] = { 208, 181, 0 }; +S sB82[] = { 209, 130, 0 }; +S sAbd[] = { 208, 189, 0 }; +S sB82A[] = { 209, 130, 208, 0 }; +S s82A[] = { 130, 208, 0 }; +S sbdA[] = { 189, 208, 0 }; +S sAbdA[] = { 208, 189, 208, 0 }; +S sB81[] = { 209, 129, 0 }; +S sB80[] = { 209, 128, 0 }; +S sAb0g[] = { 208, 176, a }; +S sb0g[] = { 176, a }; +S s80A[] = { 128, 208, 0 }; +S sB80A[] = { 209, 128, 208, 0 }; +S sAb2[] = { 208, 178, 0 }; +S sAb0A[] = { 208, 176, 208, 0 }; +S sb0A[] = { 176, 208, 0 }; +S sAba[] = { 208, 186, 0 }; +S sb5A[] = { 181, 208, 0 }; +S sAb5A[] = { 208, 181, 208, 0 }; +S sAb8A[] = { 208, 184, 208, 0 }; +S sb8A[] = { 184, 208, 0 }; +S sAb8B[] = { 208, 184, 209, 0 }; +S sb8B[] = { 184, 209, 0 }; +S sAbeA[] = { 208, 190, 208, 0 }; +S sbeA[] = { 190, 208, 0 }; +S sAbeB[] = { 208, 190, 209, 0 }; +S sbeB[] = { 190, 209, 0 }; +S s81A[] = { 129, 208, 0 }; +S sB81A[] = { 209, 129, 208, 0 }; +S sb0B[] = { 176, 209, 0 }; +S sAb0B[] = { 208, 176, 209, 0 }; +S sb8g[] = { 184, a }; +S sAb8g[] = { 208, 184, a }; +S sAb2A[] = { 208, 178, 208, 0 }; +S sb2A[] = { 178, 208, 0 }; +S sAbf[] = { 208, 191, 0 }; +S sAbeg[] = { 208, 190, a }; +S s81B[] = { 129, 209, 0 }; +S sAb4[] = { 208, 180, 0 }; +S sB81B[] = { 209, 129, 209, 0 }; +S sbeg[] = { 190, a }; +S sAbaA[] = { 208, 186, 208, 0 }; +S sbaA[] = { 186, 208, 0 }; +S sAbb[] = { 208, 187, 0 }; +S sb5B[] = { 181, 209, 0 }; +S sAb5B[] = { 208, 181, 209, 0 }; +S sb5g[] = { 181, a }; +S sAb5g[] = { 208, 181, a }; +S sbdAb0[] = { 189, 208, 176, 0 }; +S sAb7[] = { 208, 183, 0 }; +S sAbdAb0[] = { 208, 189, 208, 176, 0 }; +S sAb7A[] = { 208, 183, 208, 0 }; +S sbbA[] = { 187, 208, 0 }; +S sAbbA[] = { 208, 187, 208, 0 }; +S sgB81[] = { 32, 209, 129, 0 }; +S s81B82[] = { 129, 209, 130, 0 }; +S sB81B82[] = { 209, 129, 209, 130, 0 }; +S sAb4A[] = { 208, 180, 208, 0 }; +S sb4A[] = { 180, 208, 0 }; +S sgAbd[] = { 32, 208, 189, 0 }; +S sB8f[] = { 209, 143, 0 }; +S sbdAb8[] = { 189, 208, 184, 0 }; +S sAbdAb8[] = { 208, 189, 208, 184, 0 }; +S sgAbdA[] = { 32, 208, 189, 208, 0 }; +S sAbc[] = { 208, 188, 0 }; +S sbdAb0g[] = { 189, 208, 176, a }; +S sB82Ab5[] = { 209, 130, 208, 181, 0 }; +S sgAbf[] = { 32, 208, 191, 0 }; +S s82Ab5[] = { 130, 208, 181, 0 }; +S sAb3[] = { 208, 179, 0 }; +S s81B82A[] = { 129, 209, 130, 208, 0 }; +S sbfA[] = { 191, 208, 0 }; +S sAbfA[] = { 208, 191, 208, 0 }; +S sAb1[] = { 208, 177, 0 }; +S sB82Abe[] = { 209, 130, 208, 190, 0 }; +S sAbcA[] = { 208, 188, 208, 0 }; +S s82Abe[] = { 130, 208, 190, 0 }; +S sbcA[] = { 188, 208, 0 }; +S s80Ab0[] = { 128, 208, 176, 0 }; +S sB80Ab0[] = { 209, 128, 208, 176, 0 }; +S sB8a[] = { 209, 138, 0 }; +S s82g[] = { 130, a }; +S sB82g[] = { 209, 130, a }; +S sB87[] = { 209, 135, 0 }; +S sAbfB[] = { 208, 191, 209, 0 }; +S sbfB[] = { 191, 209, 0 }; +S sgB81A[] = { 32, 209, 129, 208, 0 }; +S sB82Ab0[] = { 209, 130, 208, 176, 0 }; +S s82Ab0[] = { 130, 208, 176, 0 }; +S sAb0B82[] = { 208, 176, 209, 130, 0 }; +S sb0B82[] = { 176, 209, 130, 0 }; +S sbeB82[] = { 190, 209, 130, 0 }; +S sAbeB82[] = { 208, 190, 209, 130, 0 }; +S sAb8B82[] = { 208, 184, 209, 130, 0 }; +S sb8B82[] = { 184, 209, 130, 0 }; +S sB87A[] = { 209, 135, 208, 0 }; +S s87A[] = { 135, 208, 0 }; +S sb8B82A[] = { 184, 209, 130, 208, 0 }; +S sAb1A[] = { 208, 177, 208, 0 }; +S sb3A[] = { 179, 208, 0 }; +S sb1A[] = { 177, 208, 0 }; +S sb5Abd[] = { 181, 208, 189, 0 }; +S sAb3A[] = { 208, 179, 208, 0 }; +S sAb5Abd[] = { 208, 181, 208, 189, 0 }; +S sb0Abd[] = { 176, 208, 189, 0 }; +S sgAba[] = { 32, 208, 186, 0 }; +S sAb0Abd[] = { 208, 176, 208, 189, 0 }; +S sB80Ab5[] = { 209, 128, 208, 181, 0 }; +S sB83[] = { 209, 131, 0 }; +S sAbaB[] = { 208, 186, 209, 0 }; +S sbdB[] = { 189, 209, 0 }; +S sAbdB[] = { 208, 189, 209, 0 }; +S sbaB[] = { 186, 209, 0 }; +S s80Ab5[] = { 128, 208, 181, 0 }; +S sgAb8[] = { 32, 208, 184, 0 }; +S sAbfB80[] = { 208, 191, 209, 128, 0 }; +S sbfB80[] = { 191, 209, 128, 0 }; +S sgAb2[] = { 32, 208, 178, 0 }; +S sAb2Ab0[] = { 208, 178, 208, 176, 0 }; +S s82Abeg[] = { 130, 208, 190, a }; +S sbfB80A[] = { 191, 209, 128, 208, 0 }; +S sb2Ab0[] = { 178, 208, 176, 0 }; +S sgAbe[] = { 32, 208, 190, 0 }; +S s80Ab8[] = { 128, 208, 184, 0 }; +S sbaAbe[] = { 186, 208, 190, 0 }; +S sbeB81[] = { 190, 209, 129, 0 }; +S sAbaAbe[] = { 208, 186, 208, 190, 0 }; +S sbdAbe[] = { 189, 208, 190, 0 }; +S sB80Ab8[] = { 209, 128, 208, 184, 0 }; +S sAbdAbe[] = { 208, 189, 208, 190, 0 }; +S sAbeB81[] = { 208, 190, 209, 129, 0 }; +S sgAb4[] = { 32, 208, 180, 0 }; +S sbfAbe[] = { 191, 208, 190, 0 }; +S sgAbfB[] = { 32, 208, 191, 209, 0 }; +S sAbfAbe[] = { 208, 191, 208, 190, 0 }; +S sb0AbdA[] = { 176, 208, 189, 208, 0 }; +S s8aA[] = { 138, 208, 0 }; +S sB8aA[] = { 209, 138, 208, 0 }; +S sbdAb8B[] = { 189, 208, 184, 209, 0 }; +S s8fg[] = { 143, a }; +S sB8fg[] = { 209, 143, a }; +S sgAb4A[] = { 32, 208, 180, 208, 0 }; +S sAb5B82[] = { 208, 181, 209, 130, 0 }; +S sbeB82A[] = { 190, 209, 130, 208, 0 }; +S s80Ab0A[] = { 128, 208, 176, 208, 0 }; +S sb5B82[] = { 181, 209, 130, 0 }; +S sAbaAb0[] = { 208, 186, 208, 176, 0 }; +S s80Abe[] = { 128, 208, 190, 0 }; +S sAb2B[] = { 208, 178, 209, 0 }; +S sgAbfA[] = { 32, 208, 191, 208, 0 }; +S sbaAb0[] = { 186, 208, 176, 0 }; +S sb2B[] = { 178, 209, 0 }; +S sB80Abe[] = { 209, 128, 208, 190, 0 }; +S s82Ab5g[] = { 130, 208, 181, a }; +S sB82Ab8[] = { 209, 130, 208, 184, 0 }; +S sgAbaA[] = { 32, 208, 186, 208, 0 }; +S s82Ab8[] = { 130, 208, 184, 0 }; +S sgAb5[] = { 32, 208, 181, 0 }; +S sAb8B8f[] = { 208, 184, 209, 143, 0 }; +S sb8B8f[] = { 184, 209, 143, 0 }; +S sgAbeB[] = { 32, 208, 190, 209, 0 }; +S sb5B82A[] = { 181, 209, 130, 208, 0 }; +S s82B[] = { 130, 209, 0 }; +S sb4Ab0[] = { 180, 208, 176, 0 }; +S sb7Ab8[] = { 183, 208, 184, 0 }; +S sAbdAb5[] = { 208, 189, 208, 181, 0 }; +S sbdAb5[] = { 189, 208, 181, 0 }; +S sb0Ab2[] = { 176, 208, 178, 0 }; +S sAb7Ab8[] = { 208, 183, 208, 184, 0 }; +S sAb4Ab0[] = { 208, 180, 208, 176, 0 }; +S sAb0Ab2[] = { 208, 176, 208, 178, 0 }; +S sB82B[] = { 209, 130, 209, 0 }; +S s80Ab5A[] = { 128, 208, 181, 208, 0 }; +S s81Ab5[] = { 129, 208, 181, 0 }; +S sb2g[] = { 178, a }; +S s82Ab0g[] = { 130, 208, 176, a }; +S sB81Ab5[] = { 209, 129, 208, 181, 0 }; +S sAb2g[] = { 208, 178, a }; +S sb0Aba[] = { 176, 208, 186, 0 }; +S sAb0Aba[] = { 208, 176, 208, 186, 0 }; +S sb8B8fg[] = { 184, 209, 143, a }; +S sb0B82A[] = { 176, 209, 130, 208, 0 }; +S sbdAb8g[] = { 189, 208, 184, a }; +S s81Aba[] = { 129, 208, 186, 0 }; +S s82Ab5A[] = { 130, 208, 181, 208, 0 }; +S sAb0B80[] = { 208, 176, 209, 128, 0 }; +S sb0B80[] = { 176, 209, 128, 0 }; +S sb5AbdA[] = { 181, 208, 189, 208, 0 }; +S sB81Aba[] = { 209, 129, 208, 186, 0 }; +S sgB81B[] = { 32, 209, 129, 209, 0 }; +S sb5B80[] = { 181, 209, 128, 0 }; +S sAb5B81[] = { 208, 181, 209, 129, 0 }; +S sb8Aba[] = { 184, 208, 186, 0 }; +S sAb8Aba[] = { 208, 184, 208, 186, 0 }; +S sAbbAb8[] = { 208, 187, 208, 184, 0 }; +S s81AbaA[] = { 129, 208, 186, 208, 0 }; +S sbbAb8[] = { 187, 208, 184, 0 }; +S sAb5B80[] = { 208, 181, 209, 128, 0 }; +S sB84[] = { 209, 132, 0 }; +S sAb8Ab7[] = { 208, 184, 208, 183, 0 }; +S sb5B81[] = { 181, 209, 129, 0 }; +S sb8Ab7[] = { 184, 208, 183, 0 }; +S s80Ab8A[] = { 128, 208, 184, 208, 0 }; +S sb5Ab4[] = { 181, 208, 180, 0 }; +S sAb7Ab0[] = { 208, 183, 208, 176, 0 }; +S sAb5Ab4[] = { 208, 181, 208, 180, 0 }; +S sAb2Ab5[] = { 208, 178, 208, 181, 0 }; +S sAb8Abd[] = { 208, 184, 208, 189, 0 }; +S sb2Ab5[] = { 178, 208, 181, 0 }; +S sbaAbeA[] = { 186, 208, 190, 208, 0 }; +S sb8Abd[] = { 184, 208, 189, 0 }; +S sgB80[] = { 32, 209, 128, 0 }; +S sb7Ab0[] = { 183, 208, 176, 0 }; +S s80B[] = { 128, 209, 0 }; +S sgAb1[] = { 32, 208, 177, 0 }; +S sgAb8g[] = { 32, 208, 184, a }; +S s81Ab5g[] = { 129, 208, 181, a }; +S sbeB81B[] = { 190, 209, 129, 209, 0 }; +S sB8fA[] = { 209, 143, 208, 0 }; +S sgB82[] = { 32, 209, 130, 0 }; +S sb8Ab7A[] = { 184, 208, 183, 208, 0 }; +S s8fA[] = { 143, 208, 0 }; +S sB80B[] = { 209, 128, 209, 0 }; +S sgAbc[] = { 32, 208, 188, 0 }; +S sAb2Abe[] = { 208, 178, 208, 190, 0 }; +S sb2Abe[] = { 178, 208, 190, 0 }; +S sAb6[] = { 208, 182, 0 }; +S sb5B80A[] = { 181, 209, 128, 208, 0 }; +S sb6A[] = { 182, 208, 0 }; +S sAb6A[] = { 208, 182, 208, 0 }; +S sgAb7A[] = { 32, 208, 183, 208, 0 }; +S sb0B82g[] = { 176, 209, 130, a }; +S s83B[] = { 131, 209, 0 }; +S sB83A[] = { 209, 131, 208, 0 }; +S sB83B[] = { 209, 131, 209, 0 }; +S sgAb7[] = { 32, 208, 183, 0 }; +S s83A[] = { 131, 208, 0 }; +S sgB80A[] = { 32, 209, 128, 208, 0 }; +S sb4Ab0g[] = { 180, 208, 176, a }; +S s82Ab8A[] = { 130, 208, 184, 208, 0 }; +S sb5Ab4A[] = { 181, 208, 180, 208, 0 }; +S sbeAb3[] = { 190, 208, 179, 0 }; +S s82Ab2[] = { 130, 208, 178, 0 }; +S sbaAb8[] = { 186, 208, 184, 0 }; +S sB82Ab2[] = { 209, 130, 208, 178, 0 }; +S sgAb1A[] = { 32, 208, 177, 208, 0 }; +S sAbaAb8[] = { 208, 186, 208, 184, 0 }; +S sAbeAb3[] = { 208, 190, 208, 179, 0 }; +S sb0B80A[] = { 176, 209, 128, 208, 0 }; +S sB89[] = { 209, 137, 0 }; +S sgAb8A[] = { 32, 208, 184, 208, 0 }; +S sB86[] = { 209, 134, 0 }; +S s84A[] = { 132, 208, 0 }; +S s82Abd[] = { 130, 208, 189, 0 }; +S sB82Abd[] = { 209, 130, 208, 189, 0 }; +S sb5Abb[] = { 181, 208, 187, 0 }; +S sAb5Ab7[] = { 208, 181, 208, 183, 0 }; +S s82AbdA[] = { 130, 208, 189, 208, 0 }; +S sB8fB[] = { 209, 143, 209, 0 }; +S sgAb2g[] = { 32, 208, 178, a }; +S sb0Ab2A[] = { 176, 208, 178, 208, 0 }; +S s82Ab2A[] = { 130, 208, 178, 208, 0 }; +S s82Ab0A[] = { 130, 208, 176, 208, 0 }; +S s8fB[] = { 143, 209, 0 }; +S sB8aB[] = { 209, 138, 209, 0 }; +S sAb5Abb[] = { 208, 181, 208, 187, 0 }; +S sB84A[] = { 209, 132, 208, 0 }; +S s8aB[] = { 138, 209, 0 }; +S sb5Ab7[] = { 181, 208, 183, 0 }; +S sbdB82[] = { 189, 209, 130, 0 }; +S sbdAbeB[] = { 189, 208, 190, 209, 0 }; +S s89A[] = { 137, 208, 0 }; +S sAbag[] = { 208, 186, a }; +S sb8B81[] = { 184, 209, 129, 0 }; +S s86A[] = { 134, 208, 0 }; +S sbfAbeB[] = { 191, 208, 190, 209, 0 }; +S sb2Ab8[] = { 178, 208, 184, 0 }; +S sB89A[] = { 209, 137, 208, 0 }; +S sgAb3[] = { 32, 208, 179, 0 }; +S sAb2Ab8[] = { 208, 178, 208, 184, 0 }; +S sbag[] = { 186, a }; +S sAbdB82[] = { 208, 189, 209, 130, 0 }; +S sAb8B81[] = { 208, 184, 209, 129, 0 }; +S sB86A[] = { 209, 134, 208, 0 }; +S sgAbcA[] = { 32, 208, 188, 208, 0 }; +S sbeB81A[] = { 190, 209, 129, 208, 0 }; +S sAbbAb5[] = { 208, 187, 208, 181, 0 }; +S sB81Ab8[] = { 209, 129, 208, 184, 0 }; +S sbdAbeg[] = { 189, 208, 190, a }; +S sgAb5A[] = { 32, 208, 181, 208, 0 }; +S s80AbeB[] = { 128, 208, 190, 209, 0 }; +S sbbAbd[] = { 187, 208, 189, 0 }; +S s81Ab8[] = { 129, 208, 184, 0 }; +S sb8Abag[] = { 184, 208, 186, a }; +S sbdB82A[] = { 189, 209, 130, 208, 0 }; +S sA9f[] = { 208, 159, 0 }; +S sAbdB81[] = { 208, 189, 209, 129, 0 }; +S sb5B81B[] = { 181, 209, 129, 209, 0 }; +S sb0AbaB[] = { 176, 208, 186, 209, 0 }; +S sb7Ab8B[] = { 183, 208, 184, 209, 0 }; +S sAbbAbd[] = { 208, 187, 208, 189, 0 }; +S sbdB81[] = { 189, 209, 129, 0 }; +S sb2Ab0g[] = { 178, 208, 176, a }; +S sbbAb5[] = { 187, 208, 181, 0 }; +S sbbAbdA[] = { 187, 208, 189, 208, 0 }; +S sAb8B80[] = { 208, 184, 209, 128, 0 }; +S sbeAb1[] = { 190, 208, 177, 0 }; +S sbaAb0B[] = { 186, 208, 176, 209, 0 }; +S sb3Ab0[] = { 179, 208, 176, 0 }; +S sAbeAb1[] = { 208, 190, 208, 177, 0 }; +S sb0Ab7[] = { 176, 208, 183, 0 }; +S s80AbeA[] = { 128, 208, 190, 208, 0 }; +S sAb0Ab7[] = { 208, 176, 208, 183, 0 }; +S sb5AbbA[] = { 181, 208, 187, 208, 0 }; +S sbcAb8[] = { 188, 208, 184, 0 }; +S sb8B87[] = { 184, 209, 135, 0 }; +S sb8B80[] = { 184, 209, 128, 0 }; +S sAb4Abe[] = { 208, 180, 208, 190, 0 }; +S sAbcAb8[] = { 208, 188, 208, 184, 0 }; +S sb4Abe[] = { 180, 208, 190, 0 }; +S sb5Ab7A[] = { 181, 208, 183, 208, 0 }; +S sAb3Ab0[] = { 208, 179, 208, 176, 0 }; +S sAbcAbe[] = { 208, 188, 208, 190, 0 }; +S sb8B80A[] = { 184, 209, 128, 208, 0 }; +S sgA9f[] = { 32, 208, 159, 0 }; +S sb8B87A[] = { 184, 209, 135, 208, 0 }; +S sAb9[] = { 208, 185, 0 }; +S sbcAbe[] = { 188, 208, 190, 0 }; +S sAb8B87[] = { 208, 184, 209, 135, 0 }; +S sbbAb0[] = { 187, 208, 176, 0 }; +S sb2Ab5B[] = { 178, 208, 181, 209, 0 }; +S sb8AbdA[] = { 184, 208, 189, 208, 0 }; +S sb7Ab0g[] = { 183, 208, 176, a }; +S s81B8a[] = { 129, 209, 138, 0 }; +S sb8Ab2[] = { 184, 208, 178, 0 }; +S sAbbAb0[] = { 208, 187, 208, 176, 0 }; +S sB81B8a[] = { 209, 129, 209, 138, 0 }; +S sbdAb8A[] = { 189, 208, 184, 208, 0 }; +S sAbeAb4[] = { 208, 190, 208, 180, 0 }; +S sb4B[] = { 180, 209, 0 }; +S s80Ab5B[] = { 128, 208, 181, 209, 0 }; +S sbaAbeg[] = { 186, 208, 190, a }; +S sbdAb0A[] = { 189, 208, 176, 208, 0 }; +S s80Ab0B[] = { 128, 208, 176, 209, 0 }; +S sB85[] = { 209, 133, 0 }; +S sAb4B[] = { 208, 180, 209, 0 }; +S sbeAb4[] = { 190, 208, 180, 0 }; +S sAb8Ab2[] = { 208, 184, 208, 178, 0 }; +S sgAbaB[] = { 32, 208, 186, 209, 0 }; +S sgB82A[] = { 32, 209, 130, 208, 0 }; +S s87Ab8[] = { 135, 208, 184, 0 }; +S sB88[] = { 209, 136, 0 }; +S sAb4Ab8[] = { 208, 180, 208, 184, 0 }; +S sb8Ab2A[] = { 184, 208, 178, 208, 0 }; +S sbeAb2[] = { 190, 208, 178, 0 }; +S sgAb0[] = { 32, 208, 176, 0 }; +S sAb4Ab5[] = { 208, 180, 208, 181, 0 }; +S sb1Ab0[] = { 177, 208, 176, 0 }; +S s82Ab5B[] = { 130, 208, 181, 209, 0 }; +S s81B82B[] = { 129, 209, 130, 209, 0 }; +S sB86Ab8[] = { 209, 134, 208, 184, 0 }; +S s86Ab8[] = { 134, 208, 184, 0 }; +S sAbcAb5[] = { 208, 188, 208, 181, 0 }; +S sAb1Ab0[] = { 208, 177, 208, 176, 0 }; +S sbeAb3A[] = { 190, 208, 179, 208, 0 }; +S sb0Ab7A[] = { 176, 208, 183, 208, 0 }; +S sbfAbeA[] = { 191, 208, 190, 208, 0 }; +S sbcAb5[] = { 188, 208, 181, 0 }; +S sbdg[] = { 189, a }; +S sb2Ab0B[] = { 178, 208, 176, 209, 0 }; +S sB87Ab8[] = { 209, 135, 208, 184, 0 }; +S sb4Ab8[] = { 180, 208, 184, 0 }; +S sAbeAb2[] = { 208, 190, 208, 178, 0 }; +S sAbdg[] = { 208, 189, a }; +S sb4Ab5[] = { 180, 208, 181, 0 }; +S sB88A[] = { 209, 136, 208, 0 }; +S s81Ab0[] = { 129, 208, 176, 0 }; +S sbeAbb[] = { 190, 208, 187, 0 }; +S sb1Ab0A[] = { 177, 208, 176, 208, 0 }; +S sgAb2A[] = { 32, 208, 178, 208, 0 }; +S sbeAbf[] = { 190, 208, 191, 0 }; +S sb0B81[] = { 176, 209, 129, 0 }; +S sB87Ab5[] = { 209, 135, 208, 181, 0 }; +S sbdAb5A[] = { 189, 208, 181, 208, 0 }; +S sAbaB82[] = { 208, 186, 209, 130, 0 }; +S sAbeAbf[] = { 208, 190, 208, 191, 0 }; +S sbbg[] = { 187, a }; +S sb5AbdB[] = { 181, 208, 189, 209, 0 }; +S sAbeB80[] = { 208, 190, 209, 128, 0 }; +S sbaB82[] = { 186, 209, 130, 0 }; +S sB81Ab0[] = { 209, 129, 208, 176, 0 }; +S sAb0B84[] = { 208, 176, 209, 132, 0 }; +S sAb1B[] = { 208, 177, 209, 0 }; +S sAbbg[] = { 208, 187, a }; + +N l5n0[] = { { sB82Ab5, 1.909 }, H }; +N l5n2[] = { { sAb2, 2.400 }, { sbfB, .468 }, { sB83, .590 }, { sAb2Ab0, 1.123 }, H }; +N l5n3[] = { { sAb3A, .926 }, { sB84A, .379 }, { sbdg, .182 }, H }; +N l5n4[] = { { sbbAbdA, .299 }, H }; +N l5n5[] = { { sbbAb0, .197 }, H }; +N l5n7[] = { { sAb0Abd, 1.207 }, { sbeAbf, .168 }, H }; +N l5n8[] = { { sgAb8A, .337 }, { sb5Ab7A, .281 }, H }; +N l5n9[] = { { sAbfAbe, 1.011 }, { sB82Ab8, .842 }, H }; +N l5n10[] = { { s86A, .159 }, H }; +N l5n11[] = { { sb5g, 1.347 }, { sbdAb8A, .262 }, { sAbaB82, .337 }, H }; +N l5n13[] = { { sb3Ab0, .211 }, H }; +N l5n14[] = { { sbdAb8B, .636 }, H }; +N l5n16[] = { { sAb8B8f, .814 }, H }; +N l5n17[] = { { sAb2Ab5, .646 }, { s87Ab8, .182 }, H }; +N l5n19[] = { { sAb3, .842 }, { sB84, .337 }, { sAb3Ab0, .421 }, H }; +N l5n20[] = { { sAb4A, 1.684 }, H }; +N l5n22[] = { { s81B82, 1.137 }, { sb8Aba, .337 }, H }; +N l5n23[] = { { s80Ab5, .590 }, H }; +N l5n24[] = { { sb8A, 1.376 }, { s82Abeg, 1.123 }, { sB82Abd, .505 }, H }; +N l5n25[] = { { sb8B80A, .281 }, H }; +N l5n26[] = { { sAb2Ab8, .477 }, H }; +N l5n27[] = { { sB82Abe, 1.572 }, { sbfAbe, .505 }, H }; +N l5n29[] = { { s82AbdA, .337 }, { sAbdg, .411 }, H }; +N l5n30[] = { { s82Ab0, .674 }, { sgAbaA, .561 }, { sb0Aba, .365 }, H }; +N l5n31[] = { { sAb4B, .295 }, H }; +N l5n32[] = { { sb0A, 1.572 }, H }; +N l5n33[] = { { s8fA, .206 }, { sb0B80A, .356 }, { sgAbaB, .243 }, H }; +N l5n34[] = { { sbeg, 1.446 }, H }; +N l5n36[] = { { sAb4, 1.446 }, { sAb4Ab0, .786 }, { sB85, .197 }, H }; +N l5n37[] = { { sAb5A, 3.116 }, { sb2Ab5, .323 }, { sB86A, .358 }, H }; +N l5n39[] = { { sb0B82g, .561 }, H }; +N l5n41[] = { { sb8B, 1.226 }, { s87A, .430 }, H }; +N l5n44[] = { { sb4Ab0, .393 }, { sAb2Abe, .590 }, H }; +N l5n46[] = { { sAbeg, 3.253 }, { sB8fg, 1.074 }, { sb8Ab2A, .243 }, H }; +N l5n47[] = { { sb8B82A, .842 }, H }; +N l5n48[] = { { sAb5B, 2.084 }, H }; +N l5n49[] = { { sb0B, 1.067 }, H }; +N l5n50[] = { { s8fB, .168 }, H }; +N l5n51[] = { { sAb4Ab5, .365 }, H }; +N l5n52[] = { { s82Ab2, .267 }, { sgAbcA, .318 }, { sb5AbbA, .281 }, H }; +N l5n53[] = { { sAb5, 4.814 }, { sB86, .253 }, H }; +N l5n54[] = { { sB87A, .968 }, { s81Ab5, .379 }, { sAb6A, .442 }, { sb0Ab2A, .337 }, H }; +N l5n55[] = { { sb0B82A, .487 }, { sb8Abd, .323 }, H }; +N l5n56[] = { { s80Ab8, .547 }, H }; +N l5n59[] = { { sAbdB81, .449 }, H }; +N l5n60[] = { { sbbAb5, .225 }, { sAb4Ab8, .365 }, H }; +N l5n61[] = { { sbdAbeg, .449 }, H }; +N l5n62[] = { { sbaAb8, .267 }, { sAbdB82, .477 }, H }; +N l5n63[] = { { sgAbdA, 1.329 }, { sb1A, .412 }, { sb0Abd, .604 }, { sb1Ab0A, .225 }, H }; +N l5n64[] = { { sAb0g, 5.874 }, { sgAb0, .182 }, H }; +N l5n65[] = { { sAb5Ab4, .646 }, { sgB80, .323 }, H }; +N l5n67[] = { { sbdAb0, 1.333 }, H }; +N l5n70[] = { { sB87, .730 }, { sAb6, .295 }, { sb2Ab8, .239 }, H }; +N l5n71[] = { { sAb7A, 1.853 }, { sB88A, .253 }, H }; +N l5n73[] = { { sAbeB80, .337 }, H }; +N l5n74[] = { { sb5AbdA, .468 }, { sAb5Ab7, .505 }, H }; +N l5n75[] = { { sgAb1, .309 }, H }; +N l5n76[] = { { sgB81, 1.151 }, { sAbeB81, 1.095 }, { sb5B80, .337 }, H }; +N l5n77[] = { { sgAbeB, .543 }, { sB86Ab8, .365 }, { sb5AbdB, .225 }, H }; +N l5n78[] = { { sb8B8f, .407 }, { sb2Ab0g, .449 }, { sAb4Abe, .421 }, H }; +N l5n79[] = { { sAbeB82, 1.291 }, { sbdB81, .225 }, H }; +N l5n80[] = { { s80A, 1.675 }, { s80Ab0A, .618 }, { sbdAbeB, .318 }, H }; +N l5n81[] = { { sB82g, 1.674 }, H }; +N l5n83[] = { { s80Ab0B, .262 }, H }; +N l5n84[] = { { sb7Ab8B, .299 }, H }; +N l5n85[] = { { s82Ab5, .954 }, { sgAbfA, .599 }, { sB87Ab5, .337 }, H }; +N l5n86[] = { { sbaA, .954 }, { sgAb2, .575 }, { sAb5Abb, .505 }, H }; +N l5n87[] = { { sAb7, 1.333 }, { sb5B81, .337 }, { sAb7Ab0, .646 }, { sgB82, .309 }, { s81Ab8, .225 }, { sB88, .182 }, H }; +N l5n88[] = { { sAb8A, 3.095 }, { sgAbfB, .674 }, { sB89A, .358 }, H }; +N l5n89[] = { { sbaAb0B, .281 }, H }; +N l5n90[] = { { sAbfB80, 1.151 }, { sbdB82, .239 }, H }; +N l5n91[] = { { sAb0B80, .702 }, { sbcAb5, .182 }, H }; +N l5n92[] = { { sAb5Abd, 1.235 }, H }; +N l5n93[] = { { sbbAb8, .337 }, H }; +N l5n94[] = { { sb2A, 1.048 }, { sB87Ab8, .365 }, H }; +N l5n97[] = { { sB81B82, 2.274 }, { sAb0B82, 1.319 }, { s80B, .206 }, { sgAb3, .239 }, { sb2Ab0B, .243 }, H }; +N l5n98[] = { { sb5B82, .463 }, { sAb2g, .853 }, H }; +N l5n99[] = { { sAb8B, 2.758 }, { sb4Ab5, .182 }, H }; +N l5n101[] = { { sb8Ab7A, .412 }, H }; +N l5n102[] = { { sb8B87A, .281 }, H }; +N l5n103[] = { { sbaB, .393 }, { s89A, .159 }, { sAb0B84, .337 }, H }; +N l5n104[] = { { sAb8, 5.488 }, { sb8g, 1.586 }, { sB89, .267 }, H }; +N l5n105[] = { { sB8aA, .737 }, H }; +N l5n108[] = { { sgAb4, .519 }, H }; +N l5n109[] = { { s81Aba, .351 }, { sbeAb1, .211 }, { sb0Ab7A, .243 }, H }; +N l5n110[] = { { sbeB81, .547 }, { s81B8a, .197 }, { sAb8Ab2, .393 }, H }; +N l5n111[] = { { s81A, 1.085 }, { sb2B, .299 }, { sAb7Ab8, .786 }, H }; +N l5n112[] = { { sb0g, 2.611 }, H }; +N l5n113[] = { { s8fg, .477 }, H }; +N l5n116[] = { { sB8aB, .379 }, H }; +N l5n117[] = { { sbbA, .786 }, H }; +N l5n118[] = { { s82Ab8, .421 }, { sb8Abag, .449 }, H }; +N l5n119[] = { { sgAb5, .407 }, { sb5Ab4, .323 }, H }; +N l5n120[] = { { sbeAb2, .182 }, H }; +N l5n121[] = { { sB8a, .744 }, { sbeB82, .646 }, { sAb9, .211 }, { sB81B8a, .393 }, H }; +N l5n122[] = { { sAbaA, 2.148 }, { s80Abe, .449 }, { sbdAb5, .393 }, H }; +N l5n124[] = { { sbcAb8, .211 }, H }; +N l5n125[] = { { sb3A, .412 }, { sAb8Ab7, .674 }, H }; +N l5n126[] = { { s82Ab0g, .758 }, H }; +N l5n128[] = { { s81B, .964 }, { sbaAbe, .547 }, H }; +N l5n130[] = { { sbfB80, .575 }, H }; +N l5n131[] = { { sbeAb3, .267 }, H }; +N l5n132[] = { { sb4Ab8, .182 }, H }; +N l5n133[] = { { sAbaB, .884 }, { sgA9f, .211 }, H }; +N l5n134[] = { { s81B82A, 1.123 }, { s8aA, .328 }, { sAb8Aba, .674 }, H }; +N l5n135[] = { { s80Ab5A, .524 }, H }; +N l5n136[] = { { sb2Abe, .295 }, H }; +N l5n137[] = { { sb7Ab0, .323 }, { s81B82B, .243 }, H }; +N l5n138[] = { { sAba, 2.260 }, { sAbaAb0, .898 }, { s80Ab5B, .262 }, H }; +N l5n139[] = { { sAbbA, 1.769 }, { sbfAbeA, .243 }, H }; +N l5n140[] = { { sb4Ab0g, .561 }, H }; +N l5n141[] = { { sgAb7, .281 }, H }; +N l5n142[] = { { s82A, 2.349 }, { s82Ab0A, .337 }, { sbfAbeB, .318 }, { sbeAb4, .197 }, H }; +N l5n143[] = { { sAb8Abd, .646 }, H }; +N l5n145[] = { { sb0AbaB, .299 }, H }; +N l5n148[] = { { sbcA, .524 }, { sbbAbd, .225 }, H }; +N l5n149[] = { { sAb5g, 3.032 }, H }; +N l5n150[] = { { s81Ab5g, .618 }, H }; +N l5n151[] = { { s8aB, .168 }, H }; +N l5n152[] = { { sgAb8, .575 }, { sb5Ab7, .253 }, { sb2Ab5B, .262 }, H }; +N l5n155[] = { { sAbb, 1.418 }, { sbdAb8, 1.039 }, { sAbbAb0, .393 }, H }; +N l5n156[] = { { sb4A, .749 }, { sAbcA, 1.179 }, H }; +N l5n159[] = { { s82B, .262 }, H }; +N l5n162[] = { { sAbaAb8, .533 }, H }; +N l5n163[] = { { sbdAb0g, 1.937 }, H }; +N l5n164[] = { { s82Ab2A, .337 }, H }; +N l5n166[] = { { sbag, .239 }, H }; +N l5n167[] = { { sb8AbdA, .262 }, H }; +N l5n168[] = { { s80Ab8A, .430 }, H }; +N l5n169[] = { { sb8B80, .211 }, H }; +N l5n170[] = { { sAbbAb5, .449 }, H }; +N l5n172[] = { { sAbc, .983 }, H }; +N l5n173[] = { { sAbdA, 5.095 }, { s83A, .187 }, { s82Abd, .253 }, { sb4B, .131 }, H }; +N l5n174[] = { { sgAba, .604 }, { sb2g, .379 }, { sb8B8fg, .730 }, H }; +N l5n175[] = { { sb0AbdA, .655 }, H }; +N l5n176[] = { { sgA, 5.343 }, { sAb5B80, .674 }, H }; +N l5n177[] = { { sb0B80, .351 }, { sgB80A, .374 }, H }; +N l5n179[] = { { sbdA, 2.265 }, { sAb5B81, .674 }, { sAbbAb8, .674 }, { sbdAb0A, .262 }, H }; +N l5n180[] = { { sAbaAbe, 1.095 }, { sb8B81, .239 }, H }; +N l5n181[] = { { s82Ab5g, .842 }, H }; +N l5n182[] = { { sAb5B82, .926 }, { sgAb2g, .337 }, H }; +N l5n184[] = { { s82Abe, .786 }, { sAbdB, .884 }, H }; +N l5n187[] = { { sb5A, 1.385 }, { sgAb1A, .356 }, { sAbcAb5, .365 }, H }; +N l5n188[] = { { sgB81A, .917 }, { sb5B80A, .393 }, { sb0B81, .168 }, H }; +N l5n189[] = { { sAbd, 4.169 }, { sAbdAb0, 2.667 }, H }; +N l5n190[] = { { sAbeA, 2.758 }, { sB8fA, .463 }, { s83B, .187 }, { sbcAbe, .211 }, { sb8Ab2, .197 }, H }; +N l5n191[] = { { sB80A, 3.769 }, { sb8B82, .646 }, { sgB81B, .468 }, { sA9f, .225 }, H }; +N l5n193[] = { { sgB, 1.488 }, H }; +N l5n194[] = { { sAbbAbd, .449 }, H }; +N l5n196[] = { { sbdB, .393 }, { sgAbc, .295 }, { sb5Abb, .253 }, { sAbcAb8, .421 }, H }; +N l5n197[] = { { s82Ab5A, .468 }, { sbbg, .168 }, H }; +N l5n198[] = { { sb0Ab2, .393 }, { sb4Abe, .211 }, { sgAb2A, .225 }, H }; +N l5n199[] = { { sb0B82, .660 }, { sgB82A, .243 }, H }; +N l5n200[] = { { sAb8g, 3.569 }, { s82Ab5B, .243 }, H }; +N l5n201[] = { { sAbeB, 2.484 }, { sB8fB, .379 }, H }; +N l5n202[] = { { sB80B, .463 }, { sbdB82A, .299 }, { sb5B81B, .299 }, H }; +N l5n204[] = { { sb5B, .926 }, { sAbdAb5, .786 }, { s84A, .168 }, H }; +N l5n206[] = { { sAbe, 4.941 }, { sB8f, 1.039 }, H }; +N l5n207[] = { { sB80, 2.905 }, { sgAbd, 1.067 }, { sAbfA, 1.221 }, { sB80Ab0, 1.544 }, { sb1Ab0, .182 }, H }; +N l5n208[] = { { sAb0A, 3.537 }, { sB81A, 2.442 }, H }; +N l5n209[] = { { sAbeAb1, .421 }, H }; +N l5n210[] = { { sbeA, 1.226 }, { sb5B82A, .543 }, H }; +N l5n212[] = { { sAbeAb2, .365 }, H }; +N l5n213[] = { { sAbdAb8, 2.077 }, H }; +N l5n214[] = { { sAbcAbe, .421 }, H }; +N l5n215[] = { { sAbeAb3, .533 }, H }; +N l5n218[] = { { sAbfB, 1.053 }, { sb5Abd, .618 }, { sgAbe, .561 }, { sb6A, .197 }, { sAbeAb4, .393 }, H }; +N l5n219[] = { { sAb0B, 2.400 }, { sB81B, 2.169 }, { sbeAbb, .168 }, H }; +N l5n220[] = { { sgAb4A, .618 }, H }; +N l5n221[] = { { sbdAbe, .547 }, { s81AbaA, .449 }, H }; +N l5n222[] = { { s82g, .744 }, { sB80Ab5, 1.179 }, { sbeB81A, .299 }, H }; +N l5n223[] = { { sAbf, 1.558 }, H }; +N l5n224[] = { { sAb0, 6.569 }, { sB81, 3.242 }, { s80Ab0, .772 }, { sbaAbeg, .393 }, { sB81Ab0, .337 }, H }; +N l5n225[] = { { sB82A, 5.285 }, { sAb1A, .926 }, { sb7Ab8, .393 }, { sbeB81B, .412 }, H }; +N l5n227[] = { { sbeB, 1.104 }, { sAb8B80, .421 }, H }; +N l5n229[] = { { sgAbf, .954 }, H }; +N l5n230[] = { { sbaAb0, .449 }, { sAb0Ab2, .786 }, { s82Ab8A, .356 }, { sAb8B81, .477 }, H }; +N l5n231[] = { { sB80Ab8, 1.095 }, { sAbdAbe, 1.095 }, { sb5Ab4A, .356 }, { sgAb5A, .299 }, H }; +N l5n233[] = { { sAb8B82, 1.291 }, { sbeB82A, .618 }, { sb7Ab0g, .393 }, H }; +N l5n234[] = { { sAbag, .537 }, { s80AbeA, .281 }, { sbdAb5A, .225 }, H }; +N l5n236[] = { { sB82B, .590 }, { sAb1B, .253 }, H }; +N l5n237[] = { { s80AbeB, .299 }, H }; +N l5n238[] = { { sb2Ab0, .561 }, H }; +N l5n239[] = { { sB81Ab5, .758 }, H }; +N l5n240[] = { { sbaAbeA, .430 }, H }; +N l5n241[] = { { sB82, 4.660 }, { sbfA, .543 }, { sAb1, .786 }, { sB82Ab0, 1.347 }, { sAb1Ab0, .365 }, H }; +N l5n242[] = { { sAb2A, 2.358 }, { sbfB80A, .749 }, { sB83A, .421 }, { s86Ab8, .182 }, H }; +N l5n243[] = { { sbeAb3A, .243 }, H }; +N l5n245[] = { { sb8Ab7, .337 }, { sAb0Ab7, .421 }, H }; +N l5n246[] = { { sb8B87, .211 }, H }; +N l5n247[] = { { sB82Ab2, .533 }, H }; +N l5n248[] = { { sgAb8g, .412 }, { sB81Ab8, .449 }, { sAb8B87, .421 }, H }; +N l5n249[] = { { sb7A, .823 }, { sB80Abe, .898 }, H }; +N l5n251[] = { { sbdAb8g, .730 }, { sAbeAbf, .337 }, { sAbbg, .379 }, H }; +N l5n253[] = { { sAb2B, .674 }, { sgAb7A, .374 }, { sB83B, .421 }, { sb0Ab7, .211 }, { sbaB82, .168 }, H }; +N l5n254[] = { { sAb0Aba, .730 }, { sB81Aba, .702 }, H }; +N l5n255[] = { { s81Ab0, .168 }, H }; + +D l5_d = { "bulgarian", "utf8", - { - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,0.000,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,0.001,W,W,W,W,W,W,W,W,W,W,W,W,W, - 0.077,0.086,0.124,0.016,0.009,0.005,0.007,0.019,0.005,0.007,0.020,Y,Y,Y,0.001,0.028, - 0.003,0.003,0.002,0.001,0.001,0.001,Y,0.003,0.002,0.001,0.000,0.000,0.001,0.003,0.001,0.006, - 0.004,0.004,0.001,0.001,0.001,Y,0.000,Y,0.003,Y,Y,Y,Y,Y,Y,Y, - 0.175,0.021,0.064,0.022,0.039,0.128,0.008,0.036,0.146,0.006,0.060,0.038,0.026,0.111,0.132,0.042, - Y,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V, - 1.642,0.607,V,V,V,V,V,V,V,V,V,V,V,V,V,V, - V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V, - V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V - }, - { - l5n0,X,l5n2,l5n3,l5n4,l5n5,X,l5n7,l5n8,l5n9,l5n10,l5n11,X,l5n13,l5n14,X, - l5n16,l5n17,X,l5n19,l5n20,X,l5n22,l5n23,l5n24,l5n25,l5n26,l5n27,X,l5n29,l5n30,l5n31, - l5n32,l5n33,l5n34,X,l5n36,l5n37,X,l5n39,X,l5n41,X,X,l5n44,X,l5n46,l5n47, - l5n48,l5n49,l5n50,l5n51,l5n52,l5n53,l5n54,l5n55,l5n56,X,X,l5n59,l5n60,l5n61,l5n62,l5n63, - l5n64,l5n65,X,l5n67,X,X,l5n70,l5n71,X,l5n73,l5n74,l5n75,l5n76,l5n77,l5n78,l5n79, - l5n80,l5n81,X,l5n83,l5n84,l5n85,l5n86,l5n87,l5n88,l5n89,l5n90,l5n91,l5n92,l5n93,l5n94,X, - X,l5n97,l5n98,l5n99,X,l5n101,l5n102,l5n103,l5n104,l5n105,X,X,l5n108,l5n109,l5n110,l5n111, - l5n112,l5n113,X,X,l5n116,l5n117,l5n118,l5n119,l5n120,l5n121,l5n122,X,l5n124,l5n125,l5n126,X, - l5n128,X,l5n130,l5n131,l5n132,l5n133,l5n134,l5n135,l5n136,l5n137,l5n138,l5n139,l5n140,l5n141,l5n142,l5n143, - X,l5n145,X,X,l5n148,l5n149,l5n150,l5n151,l5n152,X,X,l5n155,l5n156,X,X,l5n159, - X,X,l5n162,l5n163,l5n164,X,l5n166,l5n167,l5n168,l5n169,l5n170,X,l5n172,l5n173,l5n174,l5n175, - l5n176,l5n177,X,l5n179,l5n180,l5n181,l5n182,X,l5n184,X,X,l5n187,l5n188,l5n189,l5n190,l5n191, - X,l5n193,l5n194,X,l5n196,l5n197,l5n198,l5n199,l5n200,l5n201,l5n202,X,l5n204,X,l5n206,l5n207, - l5n208,l5n209,l5n210,X,l5n212,l5n213,l5n214,l5n215,X,X,l5n218,l5n219,l5n220,l5n221,l5n222,l5n223, - l5n224,l5n225,X,l5n227,X,l5n229,l5n230,l5n231,X,l5n233,l5n234,X,l5n236,l5n237,l5n238,l5n239, - l5n240,l5n241,l5n242,l5n243,X,l5n245,l5n246,l5n247,l5n248,l5n249,X,l5n251,X,l5n253,l5n254,l5n255 - } + { W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, 0.000, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, 0.001, W, W, W, W, W, W, W, W, W, W, W, W, W, + 0.077, 0.086, 0.124, 0.016, 0.009, 0.005, 0.007, 0.019, 0.005, 0.007, 0.020, Y, Y, Y, 0.001, 0.028, + 0.003, 0.003, 0.002, 0.001, 0.001, 0.001, Y, 0.003, 0.002, 0.001, 0.000, 0.000, 0.001, 0.003, 0.001, 0.006, + 0.004, 0.004, 0.001, 0.001, 0.001, Y, 0.000, Y, 0.003, Y, Y, Y, Y, Y, Y, Y, + 0.175, 0.021, 0.064, 0.022, 0.039, 0.128, 0.008, 0.036, 0.146, 0.006, 0.060, 0.038, 0.026, 0.111, 0.132, 0.042, + Y, V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, + 1.642, 0.607, V, V, V, V, V, V, V, V, V, V, V, V, V, V, + V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, + V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, V }, + { l5n0, X, l5n2, l5n3, l5n4, l5n5, X, l5n7, l5n8, l5n9, l5n10, l5n11, X, l5n13, l5n14, X, + l5n16, l5n17, X, l5n19, l5n20, X, l5n22, l5n23, l5n24, l5n25, l5n26, l5n27, X, l5n29, l5n30, l5n31, + l5n32, l5n33, l5n34, X, l5n36, l5n37, X, l5n39, X, l5n41, X, X, l5n44, X, l5n46, l5n47, + l5n48, l5n49, l5n50, l5n51, l5n52, l5n53, l5n54, l5n55, l5n56, X, X, l5n59, l5n60, l5n61, l5n62, l5n63, + l5n64, l5n65, X, l5n67, X, X, l5n70, l5n71, X, l5n73, l5n74, l5n75, l5n76, l5n77, l5n78, l5n79, + l5n80, l5n81, X, l5n83, l5n84, l5n85, l5n86, l5n87, l5n88, l5n89, l5n90, l5n91, l5n92, l5n93, l5n94, X, + X, l5n97, l5n98, l5n99, X, l5n101, l5n102, l5n103, l5n104, l5n105, X, X, l5n108, l5n109, l5n110, l5n111, + l5n112, l5n113, X, X, l5n116, l5n117, l5n118, l5n119, l5n120, l5n121, l5n122, X, l5n124, l5n125, l5n126, X, + l5n128, X, l5n130, l5n131, l5n132, l5n133, l5n134, l5n135, l5n136, l5n137, l5n138, l5n139, l5n140, l5n141, l5n142, l5n143, + X, l5n145, X, X, l5n148, l5n149, l5n150, l5n151, l5n152, X, X, l5n155, l5n156, X, X, l5n159, + X, X, l5n162, l5n163, l5n164, X, l5n166, l5n167, l5n168, l5n169, l5n170, X, l5n172, l5n173, l5n174, l5n175, + l5n176, l5n177, X, l5n179, l5n180, l5n181, l5n182, X, l5n184, X, X, l5n187, l5n188, l5n189, l5n190, l5n191, + X, l5n193, l5n194, X, l5n196, l5n197, l5n198, l5n199, l5n200, l5n201, l5n202, X, l5n204, X, l5n206, l5n207, + l5n208, l5n209, l5n210, X, l5n212, l5n213, l5n214, l5n215, X, X, l5n218, l5n219, l5n220, l5n221, l5n222, l5n223, + l5n224, l5n225, X, l5n227, X, l5n229, l5n230, l5n231, X, l5n233, l5n234, X, l5n236, l5n237, l5n238, l5n239, + l5n240, l5n241, l5n242, l5n243, X, l5n245, l5n246, l5n247, l5n248, l5n249, X, l5n251, X, l5n253, l5n254, l5n255 } }; - - // // Lng: catalan // Enc: iso-8859-15 // - -S sghig[]={32,d,e,a}; -S sgpX[]={32,l,97,0}; -S sZs[]={99,o,0}; -S suy[]={q,u,0}; -S sgpXg[]={32,l,97,a}; -S suyi[]={q,u,e,0}; -S sgZs[]={32,99,o,0}; -S sgip[]={32,e,l,0}; -S sXZ[]={97,99,0}; -S sZX[]={99,97,0}; -S smZ[]={i,99,0}; -S sguy[]={32,q,u,0}; -S sgipg[]={32,e,l,a}; -S sp27[]={l,39,0}; -S sguyi[]={32,q,u,e,0}; -S sgp27[]={32,l,39,0}; -S syig[]={u,e,a}; -S suyig[]={q,u,e,a}; -S sXZm[]={97,99,i,0}; -S siZ[]={e,99,0}; -S sgiw[]={32,e,s,0}; -S stiv[]={p,e,r,0}; -S spw[]={l,s,0}; -S sf3g[]={243,a}; -S spwg[]={l,s,a}; -S smf3[]={i,243,0}; -S s27X[]={39,97,0}; -S srxg[]={n,t,a}; -S siwxX[]={e,s,t,97,0}; -S smf3g[]={i,243,a}; -S ssrX[]={o,n,97,0}; -S sZmf3[]={99,i,243,0}; -S syiw[]={u,e,s,0}; -S smsr[]={i,o,n,0}; -S ssp[]={o,l,0}; -S sZy[]={99,u,0}; -S sgvi[]={32,r,e,0}; -S sZx[]={99,t,0}; -S sgyr[]={32,u,n,0}; -S sZmf3g[]={99,i,243,a}; -S syvX[]={u,r,97,0}; -S sXZmf3[]={97,99,i,243,0}; -S sgti[]={32,p,e,0}; -S sZsr[]={99,o,n,0}; -S sgZsq[]={32,99,o,m,0}; -S sirxg[]={e,n,t,a}; -S shipg[]={d,e,l,a}; -S sZsq[]={99,o,m,0}; -S spiw[]={l,e,s,0}; -S shiw[]={d,e,s,0}; -S srZ[]={n,99,0}; -S suyiw[]={q,u,e,s,0}; -S spXwg[]={l,97,s,a}; -S sZms[]={99,i,o,0}; -S sxmz[]={t,i,v,0}; -S sipp[]={e,l,l,0}; -S sjm[]={f,i,0}; -S sZv[]={99,r,0}; -S sZmX[]={99,i,97,0}; -S sg79[]={32,y,0}; -S sgp27X[]={32,l,39,97,0}; -S spXw[]={l,97,s,0}; -S syiwx[]={u,e,s,t,0}; -S srXp[]={n,97,l,0}; -S sp27X[]={l,39,97,0}; -S svr[]={r,n,0}; -S smz[]={i,v,0}; -S sqirx[]={m,e,n,t,0}; -S spiwg[]={l,e,s,a}; -S swxXg[]={s,t,97,a}; -S sXuy[]={97,q,u,0}; -S sZsv[]={99,o,r,0}; -S sgZX[]={32,99,97,0}; -S srxX[]={n,t,97,0}; -S sXuyi[]={97,q,u,e,0}; -S sZmsr[]={99,i,o,n,0}; -S sgjm[]={32,f,i,0}; -S sgpXw[]={32,l,97,s,0}; -S stvs[]={p,r,o,0}; -S smsrX[]={i,o,n,97,0}; -S sipwg[]={e,l,s,a}; -S sghiw[]={32,d,e,s,0}; -S sgZsr[]={32,99,o,n,0}; -S sgXpg[]={32,97,l,a}; -S syvXg[]={u,r,97,a}; -S sXrx[]={97,n,t,0}; -S sgtiv[]={32,p,e,r,0}; -S ssZ[]={o,99,0}; -S sXrX[]={97,n,97,0}; -S sipw[]={e,l,s,0}; -S sqt[]={m,p,0}; -S sxyvX[]={t,u,r,97,0}; -S svsr[]={r,o,n,0}; -S sgiwg[]={32,e,s,a}; -S sxXxg[]={t,97,t,a}; -S sZmXg[]={99,i,97,a}; -S sXrXg[]={97,n,97,a}; -S svXZ[]={r,97,99,0}; -S svQ[]={r,224,0}; -S sgyrX[]={32,u,n,97,0}; -S sppg[]={l,l,a}; -S ssrXp[]={o,n,97,l,0}; -S sg79g[]={32,y,a}; -S sviZ[]={r,e,99,0}; -S syrX[]={u,n,97,0}; -S sgxv[]={32,t,r,0}; -S sXxmz[]={97,t,i,v,0}; -S sxXv[]={t,97,r,0}; -S srZmX[]={n,99,i,97,0}; -S svri[]={r,n,e,0}; -S sZXx[]={99,97,t,0}; -S siZx[]={e,99,t,0}; -S sgZy[]={32,99,u,0}; -S smZm[]={i,99,i,0}; -S sgZsv[]={32,99,o,r,0}; -S sxXwg[]={t,97,s,a}; -S srZm[]={n,99,i,0}; -S svQg[]={r,224,a}; -S sqXv[]={m,97,r,0}; -S stXvX[]={p,97,r,97,0}; -S syrXg[]={u,n,97,a}; -S sZsrw[]={99,o,n,s,0}; -S sxXq[]={t,97,m,0}; -S sviX[]={r,e,97,0}; -S sgXu[]={32,97,q,0}; -S svit[]={r,e,p,0}; -S sgXuy[]={32,97,q,u,0}; -S ssvr[]={o,r,n,0}; -S sgi78t[]={32,e,x,p,0}; -S si78[]={e,x,0}; -S s78t[]={x,p,0}; -S sgjX[]={32,f,97,0}; -S siwi[]={e,s,e,0}; -S siwZ[]={e,s,99,0}; -S sviwg[]={r,e,s,a}; -S sXvQ[]={97,r,224,0}; -S sZvi[]={99,r,e,0}; -S siz[]={e,v,0}; -S srhXg[]={n,d,97,a}; -S si78t[]={e,x,p,0}; -S smxXx[]={i,t,97,t,0}; -S sgqXv[]={32,m,97,r,0}; -S sgpiw[]={32,l,e,s,0}; -S spmZ[]={l,i,99,0}; -S sgZv[]={32,99,r,0}; -S syvw[]={u,r,s,0}; -S sXvh[]={97,r,d,0}; -S ssvri[]={o,r,n,e,0}; -S svZ[]={r,99,0}; -S skyX[]={g,u,97,0}; -S swZ[]={s,99,0}; -S se9wg[]={233,s,a}; -S sgi78[]={32,e,x,0}; -S smiw[]={i,e,s,0}; -S sXvQg[]={97,r,224,a}; -S spQ[]={l,224,0}; -S se9w[]={233,s,0}; -S ssY[]={o,98,0}; -S spir[]={l,e,n,0}; -S smir[]={i,e,n,0}; -S sivm[]={e,r,i,0}; -S sxvi[]={t,r,e,0}; -S siky[]={e,g,u,0}; -S sXhs[]={97,d,o,0}; -S sgtvs[]={32,p,r,o,0}; -S sZi[]={99,e,0}; -S spQg[]={l,224,a}; -S sny[]={j,u,0}; -S sYpm[]={98,l,i,0}; -S sxsv[]={t,o,r,0}; -S smZX[]={i,99,97,0}; -S sxvs[]={t,r,o,0}; -S sglXg[]={32,h,97,a}; -S sirZ[]={e,n,99,0}; -S swt[]={s,p,0}; -S sr79g[]={n,y,a}; -S sZsvr[]={99,o,r,n,0}; -S sppir[]={l,l,e,n,0}; -S swxXw[]={s,t,97,s,0}; -S srxXq[]={n,t,97,m,0}; -S sgpp[]={32,l,l,0}; -S sh27X[]={d,39,97,0}; -S srXx[]={n,97,t,0}; -S sqmvX[]={m,i,r,97,0}; -S sji[]={f,e,0}; -S sgh27[]={32,d,39,0}; -S sZg[]={99,a}; -S sjmi[]={f,i,e,0}; -S sp27iw[]={l,39,e,s,0}; -S syrxX[]={u,n,t,97,0}; - -N l6n0[]={{siy,.134},H}; -N l6n1[]={{stX,.284},H}; -N l6n2[]={{swig,.188},H}; -N l6n3[]={{ssv,.434},{si78t,.125},H}; -N l6n4[]={{ssZ,.117},{syrXg,.301},H}; -N l6n5[]={{sxm,.284},{smr,.234},{sZmsr,.234},H}; -N l6n6[]={{srx,.518},H}; -N l6n7[]={{sri,.217},H}; -N l6n9[]={{sXrx,.175},{slX,.117},H}; -N l6n10[]={{stXvX,.201},{sYp,.084},H}; -N l6n11[]={{sZsq,.226},{sipp,.201},H}; -N l6n12[]={{sgp,1.729},H}; -N l6n13[]={{swg,2.632},{sXr,.652},{spm,.267},{sgi78t,.251},H}; -N l6n14[]={{svQg,.226},H}; -N l6n15[]={{sji,.067},H}; -N l6n17[]={{siz,.084},H}; -N l6n18[]={{sik,.134},H}; -N l6n20[]={{ssw,.284},H}; -N l6n21[]={{shm,.184},{sgts,.338},H}; -N l6n22[]={{sms,.217},{sZsr,.251},H}; -N l6n23[]={{spwg,.451},{sxmz,.201},H}; -N l6n25[]={{siky,.125},H}; -N l6n26[]={{spiwg,.401},H}; -N l6n27[]={{szXg,.301},H}; -N l6n28[]={{svr,.134},H}; -N l6n29[]={{sgq,.802},{sZg,.100},H}; -N l6n31[]={{sghip,.652},{siwZ,.125},{ssrg,.150},H}; -N l6n33[]={{sZmX,.201},{srhX,.175},{sxig,.226},H}; -N l6n34[]={{stv,.351},H}; -N l6n35[]={{srXg,.564},H}; -N l6n36[]={{suyiw,.301},{sym,.100},H}; -N l6n37[]={{ssx,.100},{swxXw,.134},H}; -N l6n38[]={{smir,.125},H}; -N l6n40[]={{smX,.251},{sXhs,.125},H}; -N l6n41[]={{sgjm,.263},H}; -N l6n42[]={{s27X,.201},H}; -N l6n43[]={{suyig,.802},{stiv,.301},H}; -N l6n44[]={{sxg,.978},{sqm,.251},{swxXg,.351},{sxXq,.150},{sgXu,.226},H}; -N l6n45[]={{svs,.351},{sivg,.301},{syiwx,.267},H}; -N l6n46[]={{sgr,.251},{ssrXp,.201},{ski,.084},H}; -N l6n47[]={{sXt,.084},H}; -N l6n49[]={{shig,1.880},{srxX,.175},{sgh27,.150},H}; -N l6n51[]={{si78,.084},H}; -N l6n52[]={{spg,1.353},{sghiw,.351},H}; -N l6n53[]={{siwi,.125},{sqmvX,.134},H}; -N l6n54[]={{sgtv,.526},H}; -N l6n55[]={{sgpX,1.391},{s7aX,.084},H}; -N l6n56[]={{sgZs,.940},{sXrX,.175},H}; -N l6n57[]={{sgip,.827},{sgmg,.451},{sgzm,.188},H}; -N l6n58[]={{smf3g,.414},{se9wg,.423},H}; -N l6n59[]={{sghig,2.506},H}; -N l6n62[]={{siwg,1.353},{sky,.301},H}; -N l6n63[]={{svX,.719},H}; -N l6n64[]={{spp,.317},{syig,.602},{sQg,.677},{sXu,.117},H}; -N l6n65[]={{sXY,.084},H}; -N l6n66[]={{sZsv,.175},H}; -N l6n67[]={{szm,.184},H}; -N l6n69[]={{sti,.267},H}; -N l6n71[]={{sXuy,.175},H}; -N l6n72[]={{sgqX,.338},{syvXg,.351},H}; -N l6n73[]={{smv,.201},{sg79g,.226},H}; -N l6n74[]={{smZ,.301},H}; -N l6n75[]={{sXpg,.564},{srm,.201},{syg,.125},H}; -N l6n76[]={{sws,.134},H}; -N l6n78[]={{spmZ,.125},H}; -N l6n79[]={{sgir,.564},{sYX,.117},H}; -N l6n80[]={{sgt,1.178},{sivm,.125},H}; -N l6n81[]={{sgX,1.228},{sXv,.635},{sXvQg,.251},{sxsv,.125},H}; -N l6n82[]={{sXZ,.368},H}; -N l6n83[]={{sjm,.134},{sqg,.150},{svit,.150},{sglXg,.251},H}; -N l6n84[]={{spQg,.188},H}; -N l6n85[]={{sgXpg,.351},{srwg,.188},H}; -N l6n87[]={{syp,.117},H}; -N l6n88[]={{sipw,.175},{sXxmz,.201},H}; -N l6n89[]={{sXrh,.175},{sgZv,.188},{sgxs,.150},H}; -N l6n90[]={{smw,.084},H}; -N l6n91[]={{sig,2.156},{sp27iw,.134},H}; -N l6n92[]={{sZs,.568},H}; -N l6n93[]={{smiw,.125},{swt,.067},H}; -N l6n94[]={{swX,.084},H}; -N l6n95[]={{sgyr,.376},H}; -N l6n96[]={{svv,.084},H}; -N l6n97[]={{sgu,.451},{svZ,.084},H}; -N l6n98[]={{sXw,.351},H}; -N l6n99[]={{sXh,.201},{sgpi,.226},{sxXv,.150},{sxvs,.125},H}; -N l6n101[]={{sgtvi,.301},H}; -N l6n102[]={{srxg,.451},H}; -N l6n103[]={{sip,.769},{sZmf3,.276},{srXp,.201},H}; -N l6n104[]={{sguy,.677},{srZm,.150},{syq,.067},H}; -N l6n105[]={{skyX,.125},{slXg,.188},H}; -N l6n106[]={{sZXx,.150},H}; -N l6n107[]={{smx,.384},{sxs,.201},H}; -N l6n108[]={{smi,.184},H}; -N l6n109[]={{sXrg,.226},H}; -N l6n110[]={{sZX,.334},{sxXw,.175},{sXpm,.125},H}; -N l6n111[]={{sZsrw,.201},H}; -N l6n112[]={{sYv,.084},H}; -N l6n113[]={{svw,.150},H}; -N l6n114[]={{srg,.852},{sgv,.276},{svh,.150},H}; -N l6n115[]={{sgZ,1.303},{sXx,.602},{sps,.100},{svri,.150},H}; -N l6n116[]={{suy,.485},{sswg,.414},{sviw,.226},{sgqi,.188},H}; -N l6n117[]={{ship,.326},{smZX,.125},H}; -N l6n118[]={{spXw,.201},{sXuyi,.234},H}; -N l6n120[]={{siq,.150},{srxXq,.134},H}; -N l6n121[]={{syr,.334},{stvi,.226},{sxXx,.175},H}; -N l6n122[]={{sgxv,.226},{sgZy,.226},H}; -N l6n123[]={{shs,.201},{sgtX,.301},H}; -N l6n124[]={{sXvX,.201},{sXrhX,.167},H}; -N l6n125[]={{sxX,.769},H}; -N l6n127[]={{sgZsq,.451},H}; -N l6n128[]={{svXZ,.150},{swZ,.084},H}; -N l6n129[]={{sZmXg,.301},{srhXg,.251},H}; -N l6n130[]={{svx,.150},{sgZsr,.351},{sgyrX,.301},H}; -N l6n131[]={{svi,.685},{sgw,.777},{spir,.125},{sgtvs,.251},H}; -N l6n132[]={{sgh,2.281},H}; -N l6n133[]={{spX,.735},{sirx,.401},H}; -N l6n134[]={{sgiw,.489},H}; -N l6n136[]={{smXg,.414},H}; -N l6n137[]={{sir,.869},{stm,.084},H}; -N l6n138[]={{sqXv,.150},H}; -N l6n139[]={{srZmX,.201},{sgXuy,.301},H}; -N l6n140[]={{sZsvr,.134},H}; -N l6n141[]={{shX,.234},{sf3g,.677},{smz,.134},{sYpm,.125},H}; -N l6n142[]={{sgZsv,.301},H}; -N l6n143[]={{sZv,.134},H}; -N l6n144[]={{sgpXw,.351},H}; -N l6n145[]={{ssg,.627},H}; -N l6n146[]={{sqs,.084},H}; -N l6n147[]={{sgmr,.226},H}; -N l6n148[]={{sgx,.576},H}; -N l6n149[]={{sgi,1.604},H}; -N l6n150[]={{smxX,.175},H}; -N l6n151[]={{sgpXg,1.404},{sguyi,.802},{sppi,.150},H}; -N l6n152[]={{sXrXg,.301},{syrxX,.134},H}; -N l6n153[]={{sgipg,.852},H}; -N l6n155[]={{sny,.084},H}; -N l6n156[]={{syX,.100},H}; -N l6n157[]={{ssp,.184},{sXvh,.125},H}; -N l6n158[]={{sxv,.284},{sgZX,.263},{sgqXv,.251},H}; -N l6n159[]={{svXg,.526},H}; -N l6n160[]={{sgqm,.263},{sppg,.226},H}; -N l6n161[]={{swx,.434},H}; -N l6n162[]={{swi,.518},{sqir,.276},H}; -N l6n163[]={{sqt,.117},H}; -N l6n164[]={{sqX,.301},{syrX,.150},H}; -N l6n165[]={{sgy,.326},H}; -N l6n166[]={{sgj,.376},H}; -N l6n167[]={{sgti,.376},{sxiv,.150},H}; -N l6n169[]={{smvg,.226},H}; -N l6n170[]={{sjmi,.100},H}; -N l6n171[]={{sp27,.267},{sit,.150},H}; -N l6n172[]={{siX,.134},H}; -N l6n174[]={{ssq,.201},{sXZmf3,.334},{svQ,.100},{sviX,.150},{syvw,.125},{shv,.067},H}; -N l6n175[]={{sgirg,.602},H}; -N l6n176[]={{ssrw,.226},{sgpp,.150},H}; -N l6n177[]={{sgXg,.451},{srs,.167},{sZx,.167},{sXvg,.263},H}; -N l6n178[]={{sZi,.084},{swy,.084},H}; -N l6n182[]={{sgz,.326},H}; -N l6n183[]={{spw,.201},{sgk,.201},{sxyv,.150},H}; -N l6n184[]={{sipwg,.351},H}; -N l6n185[]={{sgp27,.602},H}; -N l6n186[]={{spiw,.226},H}; -N l6n187[]={{szX,.234},{sZms,.201},{sr79g,.150},H}; -N l6n188[]={{sgpiw,.251},H}; -N l6n189[]={{syv,.351},{ssvr,.125},{sgi78,.188},{siY,.067},H}; -N l6n191[]={{ssr,.551},{sgxX,.263},{srXx,.100},H}; -N l6n193[]={{sxi,.368},H}; -N l6n194[]={{sXwg,.564},{sZy,.184},{shiw,.226},{smxi,.150},H}; -N l6n195[]={{srX,.551},H}; -N l6n196[]={{sviZ,.150},H}; -N l6n199[]={{sipg,1.015},{svm,.251},{s79g,.276},{sZmf3g,.501},H}; -N l6n200[]={{sgl,.175},{spx,.100},H}; -N l6n201[]={{spi,.334},{sgvi,.376},{sXn,.067},H}; -N l6n202[]={{siZx,.150},{sirZ,.125},H}; -N l6n203[]={{suyi,.677},{sjX,.100},H}; -N l6n204[]={{swxX,.351},H}; -N l6n205[]={{siv,.635},{smZm,.150},H}; -N l6n206[]={{siZ,.217},{syw,.134},{sxXwg,.301},{sqiv,.125},H}; -N l6n208[]={{smsr,.276},H}; -N l6n209[]={{shi,1.353},{syiw,.276},{sxy,.134},{sgjX,.188},{svwg,.188},H}; -N l6n211[]={{sXxg,.639},H}; -N l6n212[]={{sviwg,.251},H}; -N l6n213[]={{sXZm,.351},{shipg,.451},H}; -N l6n214[]={{spXwg,.401},{sp27X,.201},H}; -N l6n215[]={{smg,.526},H}; -N l6n217[]={{sgm,.526},{sxXxg,.301},H}; -N l6n218[]={{sgwi,.714},{siwx,.476},{smf3,.201},{sxyvX,.201},{se9w,.188},H}; -N l6n219[]={{sghi,2.857},{shsg,.188},H}; -N l6n220[]={{sgp27X,.401},H}; -N l6n221[]={{sxXg,.451},H}; -N l6n222[]={{siw,1.186},{sh27X,.100},H}; -N l6n223[]={{sXg,3.233},{sih,.100},H}; -N l6n224[]={{syi,.535},H}; -N l6n225[]={{sppir,.134},H}; -N l6n227[]={{smp,.134},{svig,.188},H}; -N l6n229[]={{spXg,1.090},{sirxg,.451},{srZ,.150},H}; -N l6n230[]={{swm,.134},{sgiwg,.301},{sZvi,.125},H}; -N l6n231[]={{stXv,.175},{stvs,.175},{svsr,.150},H}; -N l6n232[]={{sqi,.351},{syvX,.251},H}; -N l6n233[]={{sirg,.639},{sg79,.201},H}; -N l6n234[]={{ssrX,.276},{skX,.084},H}; -N l6n235[]={{sXp,.568},H}; -N l6n236[]={{ssvri,.167},H}; -N l6n237[]={{shXg,.338},H}; -N l6n238[]={{svg,.627},H}; -N l6n239[]={{sts,.234},{six,.117},H}; -N l6n241[]={{sXvQ,.125},H}; -N l6n242[]={{smxXx,.167},H}; -N l6n243[]={{smsrX,.234},{sglX,.226},{sgrs,.226},{ssY,.084},H}; -N l6n244[]={{smq,.134},{spQ,.084},H}; -N l6n245[]={{srw,.267},{sgXp,.376},{sxvi,.125},H}; -N l6n246[]={{sZm,.585},{srh,.167},{sXxm,.150},H}; -N l6n248[]={{sivX,.175},{s78t,.084},H}; -N l6n249[]={{svXr,.251},H}; -N l6n252[]={{sXq,.201},H}; -N l6n253[]={{siwxX,.368},{sgtiv,.351},H}; -N l6n254[]={{sqirx,.267},H}; -N l6n255[]={{szi,.100},H}; - -D l6_d = -{ +S sghig[] = { 32, d, e, a }; +S sgpX[] = { 32, l, 97, 0 }; +S sZs[] = { 99, o, 0 }; +S suy[] = { q, u, 0 }; +S sgpXg[] = { 32, l, 97, a }; +S suyi[] = { q, u, e, 0 }; +S sgZs[] = { 32, 99, o, 0 }; +S sgip[] = { 32, e, l, 0 }; +S sXZ[] = { 97, 99, 0 }; +S sZX[] = { 99, 97, 0 }; +S smZ[] = { i, 99, 0 }; +S sguy[] = { 32, q, u, 0 }; +S sgipg[] = { 32, e, l, a }; +S sp27[] = { l, 39, 0 }; +S sguyi[] = { 32, q, u, e, 0 }; +S sgp27[] = { 32, l, 39, 0 }; +S syig[] = { u, e, a }; +S suyig[] = { q, u, e, a }; +S sXZm[] = { 97, 99, i, 0 }; +S siZ[] = { e, 99, 0 }; +S sgiw[] = { 32, e, s, 0 }; +S stiv[] = { p, e, r, 0 }; +S spw[] = { l, s, 0 }; +S sf3g[] = { 243, a }; +S spwg[] = { l, s, a }; +S smf3[] = { i, 243, 0 }; +S s27X[] = { 39, 97, 0 }; +S srxg[] = { n, t, a }; +S siwxX[] = { e, s, t, 97, 0 }; +S smf3g[] = { i, 243, a }; +S ssrX[] = { o, n, 97, 0 }; +S sZmf3[] = { 99, i, 243, 0 }; +S syiw[] = { u, e, s, 0 }; +S smsr[] = { i, o, n, 0 }; +S ssp[] = { o, l, 0 }; +S sZy[] = { 99, u, 0 }; +S sgvi[] = { 32, r, e, 0 }; +S sZx[] = { 99, t, 0 }; +S sgyr[] = { 32, u, n, 0 }; +S sZmf3g[] = { 99, i, 243, a }; +S syvX[] = { u, r, 97, 0 }; +S sXZmf3[] = { 97, 99, i, 243, 0 }; +S sgti[] = { 32, p, e, 0 }; +S sZsr[] = { 99, o, n, 0 }; +S sgZsq[] = { 32, 99, o, m, 0 }; +S sirxg[] = { e, n, t, a }; +S shipg[] = { d, e, l, a }; +S sZsq[] = { 99, o, m, 0 }; +S spiw[] = { l, e, s, 0 }; +S shiw[] = { d, e, s, 0 }; +S srZ[] = { n, 99, 0 }; +S suyiw[] = { q, u, e, s, 0 }; +S spXwg[] = { l, 97, s, a }; +S sZms[] = { 99, i, o, 0 }; +S sxmz[] = { t, i, v, 0 }; +S sipp[] = { e, l, l, 0 }; +S sjm[] = { f, i, 0 }; +S sZv[] = { 99, r, 0 }; +S sZmX[] = { 99, i, 97, 0 }; +S sg79[] = { 32, y, 0 }; +S sgp27X[] = { 32, l, 39, 97, 0 }; +S spXw[] = { l, 97, s, 0 }; +S syiwx[] = { u, e, s, t, 0 }; +S srXp[] = { n, 97, l, 0 }; +S sp27X[] = { l, 39, 97, 0 }; +S svr[] = { r, n, 0 }; +S smz[] = { i, v, 0 }; +S sqirx[] = { m, e, n, t, 0 }; +S spiwg[] = { l, e, s, a }; +S swxXg[] = { s, t, 97, a }; +S sXuy[] = { 97, q, u, 0 }; +S sZsv[] = { 99, o, r, 0 }; +S sgZX[] = { 32, 99, 97, 0 }; +S srxX[] = { n, t, 97, 0 }; +S sXuyi[] = { 97, q, u, e, 0 }; +S sZmsr[] = { 99, i, o, n, 0 }; +S sgjm[] = { 32, f, i, 0 }; +S sgpXw[] = { 32, l, 97, s, 0 }; +S stvs[] = { p, r, o, 0 }; +S smsrX[] = { i, o, n, 97, 0 }; +S sipwg[] = { e, l, s, a }; +S sghiw[] = { 32, d, e, s, 0 }; +S sgZsr[] = { 32, 99, o, n, 0 }; +S sgXpg[] = { 32, 97, l, a }; +S syvXg[] = { u, r, 97, a }; +S sXrx[] = { 97, n, t, 0 }; +S sgtiv[] = { 32, p, e, r, 0 }; +S ssZ[] = { o, 99, 0 }; +S sXrX[] = { 97, n, 97, 0 }; +S sipw[] = { e, l, s, 0 }; +S sqt[] = { m, p, 0 }; +S sxyvX[] = { t, u, r, 97, 0 }; +S svsr[] = { r, o, n, 0 }; +S sgiwg[] = { 32, e, s, a }; +S sxXxg[] = { t, 97, t, a }; +S sZmXg[] = { 99, i, 97, a }; +S sXrXg[] = { 97, n, 97, a }; +S svXZ[] = { r, 97, 99, 0 }; +S svQ[] = { r, 224, 0 }; +S sgyrX[] = { 32, u, n, 97, 0 }; +S sppg[] = { l, l, a }; +S ssrXp[] = { o, n, 97, l, 0 }; +S sg79g[] = { 32, y, a }; +S sviZ[] = { r, e, 99, 0 }; +S syrX[] = { u, n, 97, 0 }; +S sgxv[] = { 32, t, r, 0 }; +S sXxmz[] = { 97, t, i, v, 0 }; +S sxXv[] = { t, 97, r, 0 }; +S srZmX[] = { n, 99, i, 97, 0 }; +S svri[] = { r, n, e, 0 }; +S sZXx[] = { 99, 97, t, 0 }; +S siZx[] = { e, 99, t, 0 }; +S sgZy[] = { 32, 99, u, 0 }; +S smZm[] = { i, 99, i, 0 }; +S sgZsv[] = { 32, 99, o, r, 0 }; +S sxXwg[] = { t, 97, s, a }; +S srZm[] = { n, 99, i, 0 }; +S svQg[] = { r, 224, a }; +S sqXv[] = { m, 97, r, 0 }; +S stXvX[] = { p, 97, r, 97, 0 }; +S syrXg[] = { u, n, 97, a }; +S sZsrw[] = { 99, o, n, s, 0 }; +S sxXq[] = { t, 97, m, 0 }; +S sviX[] = { r, e, 97, 0 }; +S sgXu[] = { 32, 97, q, 0 }; +S svit[] = { r, e, p, 0 }; +S sgXuy[] = { 32, 97, q, u, 0 }; +S ssvr[] = { o, r, n, 0 }; +S sgi78t[] = { 32, e, x, p, 0 }; +S si78[] = { e, x, 0 }; +S s78t[] = { x, p, 0 }; +S sgjX[] = { 32, f, 97, 0 }; +S siwi[] = { e, s, e, 0 }; +S siwZ[] = { e, s, 99, 0 }; +S sviwg[] = { r, e, s, a }; +S sXvQ[] = { 97, r, 224, 0 }; +S sZvi[] = { 99, r, e, 0 }; +S siz[] = { e, v, 0 }; +S srhXg[] = { n, d, 97, a }; +S si78t[] = { e, x, p, 0 }; +S smxXx[] = { i, t, 97, t, 0 }; +S sgqXv[] = { 32, m, 97, r, 0 }; +S sgpiw[] = { 32, l, e, s, 0 }; +S spmZ[] = { l, i, 99, 0 }; +S sgZv[] = { 32, 99, r, 0 }; +S syvw[] = { u, r, s, 0 }; +S sXvh[] = { 97, r, d, 0 }; +S ssvri[] = { o, r, n, e, 0 }; +S svZ[] = { r, 99, 0 }; +S skyX[] = { g, u, 97, 0 }; +S swZ[] = { s, 99, 0 }; +S se9wg[] = { 233, s, a }; +S sgi78[] = { 32, e, x, 0 }; +S smiw[] = { i, e, s, 0 }; +S sXvQg[] = { 97, r, 224, a }; +S spQ[] = { l, 224, 0 }; +S se9w[] = { 233, s, 0 }; +S ssY[] = { o, 98, 0 }; +S spir[] = { l, e, n, 0 }; +S smir[] = { i, e, n, 0 }; +S sivm[] = { e, r, i, 0 }; +S sxvi[] = { t, r, e, 0 }; +S siky[] = { e, g, u, 0 }; +S sXhs[] = { 97, d, o, 0 }; +S sgtvs[] = { 32, p, r, o, 0 }; +S sZi[] = { 99, e, 0 }; +S spQg[] = { l, 224, a }; +S sny[] = { j, u, 0 }; +S sYpm[] = { 98, l, i, 0 }; +S sxsv[] = { t, o, r, 0 }; +S smZX[] = { i, 99, 97, 0 }; +S sxvs[] = { t, r, o, 0 }; +S sglXg[] = { 32, h, 97, a }; +S sirZ[] = { e, n, 99, 0 }; +S swt[] = { s, p, 0 }; +S sr79g[] = { n, y, a }; +S sZsvr[] = { 99, o, r, n, 0 }; +S sppir[] = { l, l, e, n, 0 }; +S swxXw[] = { s, t, 97, s, 0 }; +S srxXq[] = { n, t, 97, m, 0 }; +S sgpp[] = { 32, l, l, 0 }; +S sh27X[] = { d, 39, 97, 0 }; +S srXx[] = { n, 97, t, 0 }; +S sqmvX[] = { m, i, r, 97, 0 }; +S sji[] = { f, e, 0 }; +S sgh27[] = { 32, d, 39, 0 }; +S sZg[] = { 99, a }; +S sjmi[] = { f, i, e, 0 }; +S sp27iw[] = { l, 39, e, s, 0 }; +S syrxX[] = { u, n, t, 97, 0 }; + +N l6n0[] = { { siy, .134 }, H }; +N l6n1[] = { { stX, .284 }, H }; +N l6n2[] = { { swig, .188 }, H }; +N l6n3[] = { { ssv, .434 }, { si78t, .125 }, H }; +N l6n4[] = { { ssZ, .117 }, { syrXg, .301 }, H }; +N l6n5[] = { { sxm, .284 }, { smr, .234 }, { sZmsr, .234 }, H }; +N l6n6[] = { { srx, .518 }, H }; +N l6n7[] = { { sri, .217 }, H }; +N l6n9[] = { { sXrx, .175 }, { slX, .117 }, H }; +N l6n10[] = { { stXvX, .201 }, { sYp, .084 }, H }; +N l6n11[] = { { sZsq, .226 }, { sipp, .201 }, H }; +N l6n12[] = { { sgp, 1.729 }, H }; +N l6n13[] = { { swg, 2.632 }, { sXr, .652 }, { spm, .267 }, { sgi78t, .251 }, H }; +N l6n14[] = { { svQg, .226 }, H }; +N l6n15[] = { { sji, .067 }, H }; +N l6n17[] = { { siz, .084 }, H }; +N l6n18[] = { { sik, .134 }, H }; +N l6n20[] = { { ssw, .284 }, H }; +N l6n21[] = { { shm, .184 }, { sgts, .338 }, H }; +N l6n22[] = { { sms, .217 }, { sZsr, .251 }, H }; +N l6n23[] = { { spwg, .451 }, { sxmz, .201 }, H }; +N l6n25[] = { { siky, .125 }, H }; +N l6n26[] = { { spiwg, .401 }, H }; +N l6n27[] = { { szXg, .301 }, H }; +N l6n28[] = { { svr, .134 }, H }; +N l6n29[] = { { sgq, .802 }, { sZg, .100 }, H }; +N l6n31[] = { { sghip, .652 }, { siwZ, .125 }, { ssrg, .150 }, H }; +N l6n33[] = { { sZmX, .201 }, { srhX, .175 }, { sxig, .226 }, H }; +N l6n34[] = { { stv, .351 }, H }; +N l6n35[] = { { srXg, .564 }, H }; +N l6n36[] = { { suyiw, .301 }, { sym, .100 }, H }; +N l6n37[] = { { ssx, .100 }, { swxXw, .134 }, H }; +N l6n38[] = { { smir, .125 }, H }; +N l6n40[] = { { smX, .251 }, { sXhs, .125 }, H }; +N l6n41[] = { { sgjm, .263 }, H }; +N l6n42[] = { { s27X, .201 }, H }; +N l6n43[] = { { suyig, .802 }, { stiv, .301 }, H }; +N l6n44[] = { { sxg, .978 }, { sqm, .251 }, { swxXg, .351 }, { sxXq, .150 }, { sgXu, .226 }, H }; +N l6n45[] = { { svs, .351 }, { sivg, .301 }, { syiwx, .267 }, H }; +N l6n46[] = { { sgr, .251 }, { ssrXp, .201 }, { ski, .084 }, H }; +N l6n47[] = { { sXt, .084 }, H }; +N l6n49[] = { { shig, 1.880 }, { srxX, .175 }, { sgh27, .150 }, H }; +N l6n51[] = { { si78, .084 }, H }; +N l6n52[] = { { spg, 1.353 }, { sghiw, .351 }, H }; +N l6n53[] = { { siwi, .125 }, { sqmvX, .134 }, H }; +N l6n54[] = { { sgtv, .526 }, H }; +N l6n55[] = { { sgpX, 1.391 }, { s7aX, .084 }, H }; +N l6n56[] = { { sgZs, .940 }, { sXrX, .175 }, H }; +N l6n57[] = { { sgip, .827 }, { sgmg, .451 }, { sgzm, .188 }, H }; +N l6n58[] = { { smf3g, .414 }, { se9wg, .423 }, H }; +N l6n59[] = { { sghig, 2.506 }, H }; +N l6n62[] = { { siwg, 1.353 }, { sky, .301 }, H }; +N l6n63[] = { { svX, .719 }, H }; +N l6n64[] = { { spp, .317 }, { syig, .602 }, { sQg, .677 }, { sXu, .117 }, H }; +N l6n65[] = { { sXY, .084 }, H }; +N l6n66[] = { { sZsv, .175 }, H }; +N l6n67[] = { { szm, .184 }, H }; +N l6n69[] = { { sti, .267 }, H }; +N l6n71[] = { { sXuy, .175 }, H }; +N l6n72[] = { { sgqX, .338 }, { syvXg, .351 }, H }; +N l6n73[] = { { smv, .201 }, { sg79g, .226 }, H }; +N l6n74[] = { { smZ, .301 }, H }; +N l6n75[] = { { sXpg, .564 }, { srm, .201 }, { syg, .125 }, H }; +N l6n76[] = { { sws, .134 }, H }; +N l6n78[] = { { spmZ, .125 }, H }; +N l6n79[] = { { sgir, .564 }, { sYX, .117 }, H }; +N l6n80[] = { { sgt, 1.178 }, { sivm, .125 }, H }; +N l6n81[] = { { sgX, 1.228 }, { sXv, .635 }, { sXvQg, .251 }, { sxsv, .125 }, H }; +N l6n82[] = { { sXZ, .368 }, H }; +N l6n83[] = { { sjm, .134 }, { sqg, .150 }, { svit, .150 }, { sglXg, .251 }, H }; +N l6n84[] = { { spQg, .188 }, H }; +N l6n85[] = { { sgXpg, .351 }, { srwg, .188 }, H }; +N l6n87[] = { { syp, .117 }, H }; +N l6n88[] = { { sipw, .175 }, { sXxmz, .201 }, H }; +N l6n89[] = { { sXrh, .175 }, { sgZv, .188 }, { sgxs, .150 }, H }; +N l6n90[] = { { smw, .084 }, H }; +N l6n91[] = { { sig, 2.156 }, { sp27iw, .134 }, H }; +N l6n92[] = { { sZs, .568 }, H }; +N l6n93[] = { { smiw, .125 }, { swt, .067 }, H }; +N l6n94[] = { { swX, .084 }, H }; +N l6n95[] = { { sgyr, .376 }, H }; +N l6n96[] = { { svv, .084 }, H }; +N l6n97[] = { { sgu, .451 }, { svZ, .084 }, H }; +N l6n98[] = { { sXw, .351 }, H }; +N l6n99[] = { { sXh, .201 }, { sgpi, .226 }, { sxXv, .150 }, { sxvs, .125 }, H }; +N l6n101[] = { { sgtvi, .301 }, H }; +N l6n102[] = { { srxg, .451 }, H }; +N l6n103[] = { { sip, .769 }, { sZmf3, .276 }, { srXp, .201 }, H }; +N l6n104[] = { { sguy, .677 }, { srZm, .150 }, { syq, .067 }, H }; +N l6n105[] = { { skyX, .125 }, { slXg, .188 }, H }; +N l6n106[] = { { sZXx, .150 }, H }; +N l6n107[] = { { smx, .384 }, { sxs, .201 }, H }; +N l6n108[] = { { smi, .184 }, H }; +N l6n109[] = { { sXrg, .226 }, H }; +N l6n110[] = { { sZX, .334 }, { sxXw, .175 }, { sXpm, .125 }, H }; +N l6n111[] = { { sZsrw, .201 }, H }; +N l6n112[] = { { sYv, .084 }, H }; +N l6n113[] = { { svw, .150 }, H }; +N l6n114[] = { { srg, .852 }, { sgv, .276 }, { svh, .150 }, H }; +N l6n115[] = { { sgZ, 1.303 }, { sXx, .602 }, { sps, .100 }, { svri, .150 }, H }; +N l6n116[] = { { suy, .485 }, { sswg, .414 }, { sviw, .226 }, { sgqi, .188 }, H }; +N l6n117[] = { { ship, .326 }, { smZX, .125 }, H }; +N l6n118[] = { { spXw, .201 }, { sXuyi, .234 }, H }; +N l6n120[] = { { siq, .150 }, { srxXq, .134 }, H }; +N l6n121[] = { { syr, .334 }, { stvi, .226 }, { sxXx, .175 }, H }; +N l6n122[] = { { sgxv, .226 }, { sgZy, .226 }, H }; +N l6n123[] = { { shs, .201 }, { sgtX, .301 }, H }; +N l6n124[] = { { sXvX, .201 }, { sXrhX, .167 }, H }; +N l6n125[] = { { sxX, .769 }, H }; +N l6n127[] = { { sgZsq, .451 }, H }; +N l6n128[] = { { svXZ, .150 }, { swZ, .084 }, H }; +N l6n129[] = { { sZmXg, .301 }, { srhXg, .251 }, H }; +N l6n130[] = { { svx, .150 }, { sgZsr, .351 }, { sgyrX, .301 }, H }; +N l6n131[] = { { svi, .685 }, { sgw, .777 }, { spir, .125 }, { sgtvs, .251 }, H }; +N l6n132[] = { { sgh, 2.281 }, H }; +N l6n133[] = { { spX, .735 }, { sirx, .401 }, H }; +N l6n134[] = { { sgiw, .489 }, H }; +N l6n136[] = { { smXg, .414 }, H }; +N l6n137[] = { { sir, .869 }, { stm, .084 }, H }; +N l6n138[] = { { sqXv, .150 }, H }; +N l6n139[] = { { srZmX, .201 }, { sgXuy, .301 }, H }; +N l6n140[] = { { sZsvr, .134 }, H }; +N l6n141[] = { { shX, .234 }, { sf3g, .677 }, { smz, .134 }, { sYpm, .125 }, H }; +N l6n142[] = { { sgZsv, .301 }, H }; +N l6n143[] = { { sZv, .134 }, H }; +N l6n144[] = { { sgpXw, .351 }, H }; +N l6n145[] = { { ssg, .627 }, H }; +N l6n146[] = { { sqs, .084 }, H }; +N l6n147[] = { { sgmr, .226 }, H }; +N l6n148[] = { { sgx, .576 }, H }; +N l6n149[] = { { sgi, 1.604 }, H }; +N l6n150[] = { { smxX, .175 }, H }; +N l6n151[] = { { sgpXg, 1.404 }, { sguyi, .802 }, { sppi, .150 }, H }; +N l6n152[] = { { sXrXg, .301 }, { syrxX, .134 }, H }; +N l6n153[] = { { sgipg, .852 }, H }; +N l6n155[] = { { sny, .084 }, H }; +N l6n156[] = { { syX, .100 }, H }; +N l6n157[] = { { ssp, .184 }, { sXvh, .125 }, H }; +N l6n158[] = { { sxv, .284 }, { sgZX, .263 }, { sgqXv, .251 }, H }; +N l6n159[] = { { svXg, .526 }, H }; +N l6n160[] = { { sgqm, .263 }, { sppg, .226 }, H }; +N l6n161[] = { { swx, .434 }, H }; +N l6n162[] = { { swi, .518 }, { sqir, .276 }, H }; +N l6n163[] = { { sqt, .117 }, H }; +N l6n164[] = { { sqX, .301 }, { syrX, .150 }, H }; +N l6n165[] = { { sgy, .326 }, H }; +N l6n166[] = { { sgj, .376 }, H }; +N l6n167[] = { { sgti, .376 }, { sxiv, .150 }, H }; +N l6n169[] = { { smvg, .226 }, H }; +N l6n170[] = { { sjmi, .100 }, H }; +N l6n171[] = { { sp27, .267 }, { sit, .150 }, H }; +N l6n172[] = { { siX, .134 }, H }; +N l6n174[] = { { ssq, .201 }, { sXZmf3, .334 }, { svQ, .100 }, { sviX, .150 }, { syvw, .125 }, { shv, .067 }, H }; +N l6n175[] = { { sgirg, .602 }, H }; +N l6n176[] = { { ssrw, .226 }, { sgpp, .150 }, H }; +N l6n177[] = { { sgXg, .451 }, { srs, .167 }, { sZx, .167 }, { sXvg, .263 }, H }; +N l6n178[] = { { sZi, .084 }, { swy, .084 }, H }; +N l6n182[] = { { sgz, .326 }, H }; +N l6n183[] = { { spw, .201 }, { sgk, .201 }, { sxyv, .150 }, H }; +N l6n184[] = { { sipwg, .351 }, H }; +N l6n185[] = { { sgp27, .602 }, H }; +N l6n186[] = { { spiw, .226 }, H }; +N l6n187[] = { { szX, .234 }, { sZms, .201 }, { sr79g, .150 }, H }; +N l6n188[] = { { sgpiw, .251 }, H }; +N l6n189[] = { { syv, .351 }, { ssvr, .125 }, { sgi78, .188 }, { siY, .067 }, H }; +N l6n191[] = { { ssr, .551 }, { sgxX, .263 }, { srXx, .100 }, H }; +N l6n193[] = { { sxi, .368 }, H }; +N l6n194[] = { { sXwg, .564 }, { sZy, .184 }, { shiw, .226 }, { smxi, .150 }, H }; +N l6n195[] = { { srX, .551 }, H }; +N l6n196[] = { { sviZ, .150 }, H }; +N l6n199[] = { { sipg, 1.015 }, { svm, .251 }, { s79g, .276 }, { sZmf3g, .501 }, H }; +N l6n200[] = { { sgl, .175 }, { spx, .100 }, H }; +N l6n201[] = { { spi, .334 }, { sgvi, .376 }, { sXn, .067 }, H }; +N l6n202[] = { { siZx, .150 }, { sirZ, .125 }, H }; +N l6n203[] = { { suyi, .677 }, { sjX, .100 }, H }; +N l6n204[] = { { swxX, .351 }, H }; +N l6n205[] = { { siv, .635 }, { smZm, .150 }, H }; +N l6n206[] = { { siZ, .217 }, { syw, .134 }, { sxXwg, .301 }, { sqiv, .125 }, H }; +N l6n208[] = { { smsr, .276 }, H }; +N l6n209[] = { { shi, 1.353 }, { syiw, .276 }, { sxy, .134 }, { sgjX, .188 }, { svwg, .188 }, H }; +N l6n211[] = { { sXxg, .639 }, H }; +N l6n212[] = { { sviwg, .251 }, H }; +N l6n213[] = { { sXZm, .351 }, { shipg, .451 }, H }; +N l6n214[] = { { spXwg, .401 }, { sp27X, .201 }, H }; +N l6n215[] = { { smg, .526 }, H }; +N l6n217[] = { { sgm, .526 }, { sxXxg, .301 }, H }; +N l6n218[] = { { sgwi, .714 }, { siwx, .476 }, { smf3, .201 }, { sxyvX, .201 }, { se9w, .188 }, H }; +N l6n219[] = { { sghi, 2.857 }, { shsg, .188 }, H }; +N l6n220[] = { { sgp27X, .401 }, H }; +N l6n221[] = { { sxXg, .451 }, H }; +N l6n222[] = { { siw, 1.186 }, { sh27X, .100 }, H }; +N l6n223[] = { { sXg, 3.233 }, { sih, .100 }, H }; +N l6n224[] = { { syi, .535 }, H }; +N l6n225[] = { { sppir, .134 }, H }; +N l6n227[] = { { smp, .134 }, { svig, .188 }, H }; +N l6n229[] = { { spXg, 1.090 }, { sirxg, .451 }, { srZ, .150 }, H }; +N l6n230[] = { { swm, .134 }, { sgiwg, .301 }, { sZvi, .125 }, H }; +N l6n231[] = { { stXv, .175 }, { stvs, .175 }, { svsr, .150 }, H }; +N l6n232[] = { { sqi, .351 }, { syvX, .251 }, H }; +N l6n233[] = { { sirg, .639 }, { sg79, .201 }, H }; +N l6n234[] = { { ssrX, .276 }, { skX, .084 }, H }; +N l6n235[] = { { sXp, .568 }, H }; +N l6n236[] = { { ssvri, .167 }, H }; +N l6n237[] = { { shXg, .338 }, H }; +N l6n238[] = { { svg, .627 }, H }; +N l6n239[] = { { sts, .234 }, { six, .117 }, H }; +N l6n241[] = { { sXvQ, .125 }, H }; +N l6n242[] = { { smxXx, .167 }, H }; +N l6n243[] = { { smsrX, .234 }, { sglX, .226 }, { sgrs, .226 }, { ssY, .084 }, H }; +N l6n244[] = { { smq, .134 }, { spQ, .084 }, H }; +N l6n245[] = { { srw, .267 }, { sgXp, .376 }, { sxvi, .125 }, H }; +N l6n246[] = { { sZm, .585 }, { srh, .167 }, { sXxm, .150 }, H }; +N l6n248[] = { { sivX, .175 }, { s78t, .084 }, H }; +N l6n249[] = { { svXr, .251 }, H }; +N l6n252[] = { { sXq, .201 }, H }; +N l6n253[] = { { siwxX, .368 }, { sgtiv, .351 }, H }; +N l6n254[] = { { sqirx, .267 }, H }; +N l6n255[] = { { szi, .100 }, H }; + +D l6_d = { "catalan", "iso-8859-15", - { - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,0.017,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,0.256,0.020,0.094,0.090,0.257,0.016,0.022,0.008,0.129,0.006,W,0.138,0.058,0.122,0.105, - 0.058,0.019,0.142,0.140,0.122,0.084,0.022,0.001,0.007,0.011,0.007,W,W,W,W,W, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - Y,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V, - V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V, - 0.029,0.008,V,V,V,V,V,0.003,0.006,0.011,V,V,V,0.009,V,V, - V,0.005,0.002,0.027,V,V,V,V,V,V,0.005,V,V,V,V,V - }, - { - l6n0,l6n1,l6n2,l6n3,l6n4,l6n5,l6n6,l6n7,X,l6n9,l6n10,l6n11,l6n12,l6n13,l6n14,l6n15, - X,l6n17,l6n18,X,l6n20,l6n21,l6n22,l6n23,X,l6n25,l6n26,l6n27,l6n28,l6n29,X,l6n31, - X,l6n33,l6n34,l6n35,l6n36,l6n37,l6n38,X,l6n40,l6n41,l6n42,l6n43,l6n44,l6n45,l6n46,l6n47, - X,l6n49,X,l6n51,l6n52,l6n53,l6n54,l6n55,l6n56,l6n57,l6n58,l6n59,X,X,l6n62,l6n63, - l6n64,l6n65,l6n66,l6n67,X,l6n69,X,l6n71,l6n72,l6n73,l6n74,l6n75,l6n76,X,l6n78,l6n79, - l6n80,l6n81,l6n82,l6n83,l6n84,l6n85,X,l6n87,l6n88,l6n89,l6n90,l6n91,l6n92,l6n93,l6n94,l6n95, - l6n96,l6n97,l6n98,l6n99,X,l6n101,l6n102,l6n103,l6n104,l6n105,l6n106,l6n107,l6n108,l6n109,l6n110,l6n111, - l6n112,l6n113,l6n114,l6n115,l6n116,l6n117,l6n118,X,l6n120,l6n121,l6n122,l6n123,l6n124,l6n125,X,l6n127, - l6n128,l6n129,l6n130,l6n131,l6n132,l6n133,l6n134,X,l6n136,l6n137,l6n138,l6n139,l6n140,l6n141,l6n142,l6n143, - l6n144,l6n145,l6n146,l6n147,l6n148,l6n149,l6n150,l6n151,l6n152,l6n153,X,l6n155,l6n156,l6n157,l6n158,l6n159, - l6n160,l6n161,l6n162,l6n163,l6n164,l6n165,l6n166,l6n167,X,l6n169,l6n170,l6n171,l6n172,X,l6n174,l6n175, - l6n176,l6n177,l6n178,X,X,X,l6n182,l6n183,l6n184,l6n185,l6n186,l6n187,l6n188,l6n189,X,l6n191, - X,l6n193,l6n194,l6n195,l6n196,X,X,l6n199,l6n200,l6n201,l6n202,l6n203,l6n204,l6n205,l6n206,X, - l6n208,l6n209,X,l6n211,l6n212,l6n213,l6n214,l6n215,X,l6n217,l6n218,l6n219,l6n220,l6n221,l6n222,l6n223, - l6n224,l6n225,X,l6n227,X,l6n229,l6n230,l6n231,l6n232,l6n233,l6n234,l6n235,l6n236,l6n237,l6n238,l6n239, - X,l6n241,l6n242,l6n243,l6n244,l6n245,l6n246,X,l6n248,l6n249,X,X,l6n252,l6n253,l6n254,l6n255 - } + { W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, 0.017, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, 0.256, 0.020, 0.094, 0.090, 0.257, 0.016, 0.022, 0.008, 0.129, 0.006, W, 0.138, 0.058, 0.122, 0.105, + 0.058, 0.019, 0.142, 0.140, 0.122, 0.084, 0.022, 0.001, 0.007, 0.011, 0.007, W, W, W, W, W, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + Y, V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, + V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, + 0.029, 0.008, V, V, V, V, V, 0.003, 0.006, 0.011, V, V, V, 0.009, V, V, + V, 0.005, 0.002, 0.027, V, V, V, V, V, V, 0.005, V, V, V, V, V }, + { l6n0, l6n1, l6n2, l6n3, l6n4, l6n5, l6n6, l6n7, X, l6n9, l6n10, l6n11, l6n12, l6n13, l6n14, l6n15, + X, l6n17, l6n18, X, l6n20, l6n21, l6n22, l6n23, X, l6n25, l6n26, l6n27, l6n28, l6n29, X, l6n31, + X, l6n33, l6n34, l6n35, l6n36, l6n37, l6n38, X, l6n40, l6n41, l6n42, l6n43, l6n44, l6n45, l6n46, l6n47, + X, l6n49, X, l6n51, l6n52, l6n53, l6n54, l6n55, l6n56, l6n57, l6n58, l6n59, X, X, l6n62, l6n63, + l6n64, l6n65, l6n66, l6n67, X, l6n69, X, l6n71, l6n72, l6n73, l6n74, l6n75, l6n76, X, l6n78, l6n79, + l6n80, l6n81, l6n82, l6n83, l6n84, l6n85, X, l6n87, l6n88, l6n89, l6n90, l6n91, l6n92, l6n93, l6n94, l6n95, + l6n96, l6n97, l6n98, l6n99, X, l6n101, l6n102, l6n103, l6n104, l6n105, l6n106, l6n107, l6n108, l6n109, l6n110, l6n111, + l6n112, l6n113, l6n114, l6n115, l6n116, l6n117, l6n118, X, l6n120, l6n121, l6n122, l6n123, l6n124, l6n125, X, l6n127, + l6n128, l6n129, l6n130, l6n131, l6n132, l6n133, l6n134, X, l6n136, l6n137, l6n138, l6n139, l6n140, l6n141, l6n142, l6n143, + l6n144, l6n145, l6n146, l6n147, l6n148, l6n149, l6n150, l6n151, l6n152, l6n153, X, l6n155, l6n156, l6n157, l6n158, l6n159, + l6n160, l6n161, l6n162, l6n163, l6n164, l6n165, l6n166, l6n167, X, l6n169, l6n170, l6n171, l6n172, X, l6n174, l6n175, + l6n176, l6n177, l6n178, X, X, X, l6n182, l6n183, l6n184, l6n185, l6n186, l6n187, l6n188, l6n189, X, l6n191, + X, l6n193, l6n194, l6n195, l6n196, X, X, l6n199, l6n200, l6n201, l6n202, l6n203, l6n204, l6n205, l6n206, X, + l6n208, l6n209, X, l6n211, l6n212, l6n213, l6n214, l6n215, X, l6n217, l6n218, l6n219, l6n220, l6n221, l6n222, l6n223, + l6n224, l6n225, X, l6n227, X, l6n229, l6n230, l6n231, l6n232, l6n233, l6n234, l6n235, l6n236, l6n237, l6n238, l6n239, + X, l6n241, l6n242, l6n243, l6n244, l6n245, l6n246, X, l6n248, l6n249, X, X, l6n252, l6n253, l6n254, l6n255 } }; - - // // Lng: chinese // Enc: big5 // - -S sga4[]={32,164,0}; -S sga5[]={32,165,0}; -S sga1[]={32,161,0}; -S sga6[]={32,166,0}; -S sa1q[]={161,m,0}; -S sga1qg[]={32,161,m,a}; -S sa1qg[]={161,m,a}; -S sga1q[]={32,161,m,0}; -S sgaa[]={32,170,0}; -S sgad[]={32,173,0}; -S sgac[]={32,172,0}; -S sga9[]={32,169,0}; -S sgab[]={32,171,0}; -S sgb3[]={32,179,0}; -S sgb6[]={32,182,0}; -S sga8[]={32,168,0}; -S s7eg[]={126,a}; -S sga7[]={32,167,0}; -S sgae[]={32,174,0}; -S sgb0[]={32,176,0}; -S sgb9[]={32,185,0}; -S sgb4[]={32,180,0}; -S sgb5[]={32,181,0}; -S saaba[]={170,186,0}; -S sfbg[]={251,a}; -S sgb2[]={32,178,0}; -S s_g[]={w,a}; -S s40g[]={64,a}; -S sgbe[]={32,190,0}; -S sDg[]={211,a}; -S sb7g[]={183,a}; -S sgaabag[]={32,170,186,a}; -S sga1Zg[]={32,161,99,a}; -S sa1Zg[]={161,99,a}; -S saabag[]={170,186,a}; -S sgaaba[]={32,170,186,0}; -S sa1Z[]={161,99,0}; -S sga1Z[]={32,161,99,0}; -S sYg[]={98,a}; -S sa4u[]={164,q,0}; -S sa3g[]={163,a}; -S sgbb[]={32,187,0}; -S sa5g[]={165,a}; -S sgc4[]={32,196,0}; -S sgb7g[]={32,183,a}; -S s78g[]={x,a}; -S sf8g[]={248,a}; -S sc6g[]={198,a}; -S sga4u[]={32,164,q,0}; -S sa440[]={164,64,0}; -S sb4U[]={180,228,0}; -S sb3g[]={179,a}; -S sga1Xg[]={32,161,97,a}; -S sgbc[]={32,188,0}; -S sadfbg[]={173,251,a}; -S sf4g[]={244,a}; -S sgba[]={32,186,0}; -S sa1Xg[]={161,97,a}; -S sga1X[]={32,161,97,0}; -S sgaf[]={32,175,0}; -S sgb4U[]={32,180,228,0}; -S sadfb[]={173,251,0}; -S sga440[]={32,164,64,0}; -S sgb4Ug[]={32,180,228,a}; -S sga440g[]={32,164,64,a}; -S sa440g[]={164,64,a}; -S sb9u[]={185,q,0}; -S sb4Ug[]={180,228,a}; -S sa1X[]={161,97,0}; -S sa67eg[]={166,126,a}; -S sgadfbg[]={32,173,251,a}; -S sga67e[]={32,166,126,0}; -S sga4ug[]={32,164,q,a}; -S sa67e[]={166,126,0}; -S sgadfb[]={32,173,251,0}; -S sa4ug[]={164,q,a}; -S sga67eg[]={32,166,126,a}; -S sgbec7[]={32,190,199,0}; -S sc0g[]={192,a}; -S sbec7[]={190,199,0}; -S sbec7g[]={190,199,a}; -S sceg[]={206,a}; -S sgbec7g[]={32,190,199,a}; -S szg[]={v,a}; -S sgb9u[]={32,185,q,0}; -S sadg[]={173,a}; -S sga9f3g[]={32,169,243,a}; -S sb9ug[]={185,q,a}; -S sf7g[]={247,a}; -S sgb9ug[]={32,185,q,a}; -S sa6t[]={166,p,0}; -S sa9f3[]={169,243,0}; -S sa9f3g[]={169,243,a}; -S sc9g[]={201,a}; -S sga9f3[]={32,169,243,0}; -S sa6Y[]={166,98,0}; -S sga4l[]={32,164,h,0}; -S sga6Y[]={32,166,98,0}; -S sa4ng[]={164,j,a}; -S sf6g[]={246,a}; -S sa4l[]={164,h,0}; -S sga4lg[]={32,164,h,a}; -S sa578[]={165,x,0}; -S sga5g[]={32,165,a}; -S sa4g[]={164,a}; -S sa4n[]={164,j,0}; -S sga4n[]={32,164,j,0}; -S sa4lg[]={164,h,a}; -S sga578[]={32,165,x,0}; -S sa578g[]={165,x,a}; -S sa4a3[]={164,163,0}; -S sga4ng[]={32,164,j,a}; -S sa6Yg[]={166,98,a}; -S sga578g[]={32,165,x,a}; -S sga6Yg[]={32,166,98,a}; -S sa4ad[]={164,173,0}; -S sga4a3g[]={32,164,163,a}; -S sb77e[]={183,126,0}; -S sga4a3[]={32,164,163,0}; -S sa6tg[]={166,p,a}; -S sa4i[]={164,e,0}; -S sgb3ug[]={32,179,q,a}; -S sgc2[]={32,194,0}; -S sgacs[]={32,172,o,0}; -S sgb77e[]={32,183,126,0}; -S sacs[]={172,o,0}; -S sa5h[]={165,d,0}; -S sb3ug[]={179,q,a}; -S sgb3u[]={32,179,q,0}; -S sgb77eg[]={32,183,126,a}; -S sgacsg[]={32,172,o,a}; -S sb3u[]={179,q,0}; -S sacsg[]={172,o,a}; -S s60g[]={96,a}; -S sccg[]={204,a}; -S sb77eg[]={183,126,a}; -S sa4a3g[]={164,163,a}; -S sb8M[]={184,220,0}; -S sgb8fbg[]={32,184,251,a}; -S sgaaf8[]={32,170,248,0}; -S sbef7[]={190,247,0}; -S sua4[]={q,164,0}; -S sa6Xg[]={166,97,a}; -S sgb8Mg[]={32,184,220,a}; -S sga5hg[]={32,165,d,a}; -S saey[]={174,u,0}; -S se8g[]={232,a}; -S sa4e9[]={164,233,0}; -S sa4c0[]={164,192,0}; -S sga5h[]={32,165,d,0}; -S saaf8g[]={170,248,a}; -S sf9g[]={249,a}; -S sa5hg[]={165,d,a}; -S sgc5[]={32,197,0}; -S sb8fbg[]={184,251,a}; -S sga8c6[]={32,168,198,0}; -S sb8fb[]={184,251,0}; -S sgaaf8g[]={32,170,248,a}; -S sga6t[]={32,166,p,0}; -S sa8c6g[]={168,198,a}; -S sa6X[]={166,97,0}; -S sa8c6[]={168,198,0}; -S sb8Mg[]={184,220,a}; -S sga8c6g[]={32,168,198,a}; -S sgb8fb[]={32,184,251,0}; -S saaf8[]={170,248,0}; -S sa6b3[]={166,179,0}; -S sfcg[]={252,a}; -S sga6tg[]={32,166,p,a}; -S sa4_[]={164,w,0}; -S sgb8M[]={32,184,220,0}; -S sc1g[]={193,a}; -S sVg[]={229,a}; -S sga6_g[]={32,166,w,a}; -S sga4bdg[]={32,164,189,a}; -S sadD[]={173,211,0}; -S sga4a7[]={32,164,167,0}; -S sga4a7g[]={32,164,167,a}; -S sf5g[]={245,a}; -S sa4bdg[]={164,189,a}; -S sga4i[]={32,164,e,0}; -S sacjg[]={172,f,a}; -S sgaec9g[]={32,174,201,a}; -S sga5ce[]={32,165,206,0}; -S sacb0[]={172,176,0}; -S saec9[]={174,201,0}; -S sacj[]={172,f,0}; -S sga4bd[]={32,164,189,0}; -S sga4bag[]={32,164,186,a}; -S sga5ceg[]={32,165,206,a}; -S sga4_g[]={32,164,w,a}; -S sHg[]={215,a}; -S sgacj[]={32,172,f,0}; -S sb8t[]={184,p,0}; -S sa4a7[]={164,167,0}; -S sga4_[]={32,164,w,0}; -S scag[]={202,a}; -S sb8tg[]={184,p,a}; -S sgaec9[]={32,174,201,0}; -S sgacjg[]={32,172,f,a}; -S sgbef7[]={32,190,247,0}; -S secg[]={236,a}; -S sgbef7g[]={32,190,247,a}; -S saec9g[]={174,201,a}; -S sa4a7g[]={164,167,a}; -S sedg[]={237,a}; -S sgb8tg[]={32,184,p,a}; -S sgb8t[]={32,184,p,0}; -S sa4ig[]={164,e,a}; -S sa4x[]={164,t,0}; -S sga4ig[]={32,164,e,a}; -S sga6_[]={32,166,w,0}; -S sga4ba[]={32,164,186,0}; -S sa5l[]={165,h,0}; -S sa6_[]={166,w,0}; -S sa5ceg[]={165,206,a}; -S sa5ce[]={165,206,0}; -S sbef7g[]={190,247,a}; -S sa4_g[]={164,w,a}; -S sa4ba[]={164,186,0}; -S sa6_g[]={166,w,a}; -S sa4bag[]={164,186,a}; -S sa4bd[]={164,189,0}; -S sa740[]={167,64,0}; -S sb5s[]={181,o,0}; -S sb8ea[]={184,234,0}; -S sb8D[]={184,211,0}; -S sga1Y[]={32,161,98,0}; -S sgb6b1g[]={32,182,177,a}; -S sgb6b1[]={32,182,177,0}; -S sgb8D[]={32,184,211,0}; -S sgc4b5g[]={32,196,181,a}; -S sga4kg[]={32,164,g,a}; -S sga4e9[]={32,164,233,0}; -S sga6b3[]={32,166,179,0}; -S sgb2c4[]={32,178,196,0}; -S sa5bb[]={165,187,0}; -S sa65e[]={166,94,0}; -S s5ea1k[]={94,161,g,0}; -S sgb8Dg[]={32,184,211,a}; -S sga1Yg[]={32,161,98,a}; -S sga4c0g[]={32,164,192,a}; -S sa6ca[]={166,202,0}; -S sga4k[]={32,164,g,0}; -S sgb5s[]={32,181,o,0}; -S sa4adg[]={164,173,a}; -S sgc4b5[]={32,196,181,0}; -S sa1Y[]={161,98,0}; -S sa4ua4[]={164,q,164,0}; -S sga6cag[]={32,166,202,a}; -S sc4b5[]={196,181,0}; -S sa1Yg[]={161,98,a}; -S sga4adg[]={32,164,173,a}; -S sga740[]={32,167,64,0}; -S sga4e9g[]={32,164,233,a}; -S sga57e[]={32,165,126,0}; -S sa57e[]={165,126,0}; -S sgadDg[]={32,173,211,a}; -S sc4b5g[]={196,181,a}; -S sga57eg[]={32,165,126,a}; -S sb5sg[]={181,o,a}; -S s5ea1[]={94,161,0}; -S sebg[]={235,a}; -S sgb8eag[]={32,184,234,a}; -S sga4ad[]={32,164,173,0}; -S sb6b1g[]={182,177,a}; -S sa1k[]={161,g,0}; -S sb8Dg[]={184,211,a}; -S sa6b3g[]={166,179,a}; -S sa57eg[]={165,126,a}; -S sga740g[]={32,167,64,a}; -S sa6cag[]={166,202,a}; -S sa4c0g[]={164,192,a}; -S sb2c4[]={178,196,0}; -S sga6Xg[]={32,166,97,a}; -S sgadD[]={32,173,211,0}; -S sga6b3g[]={32,166,179,a}; -S sa8D[]={168,211,0}; -S sa65ea1[]={166,94,161,0}; -S sa740g[]={167,64,a}; -S sa1g[]={161,a}; -S sb6b1[]={182,177,0}; -S sa4k[]={164,g,0}; -S sgb5sg[]={32,181,o,a}; -S sa4e9g[]={164,233,a}; -S sga4c0[]={32,164,192,0}; -S sgb8ea[]={32,184,234,0}; -S sb8eag[]={184,234,a}; -S sga6ca[]={32,166,202,0}; -S sa4o[]={164,k,0}; -S sadDg[]={173,211,a}; -S sa4kg[]={164,g,a}; -S sga6X[]={32,166,97,0}; -S sa65ea1k[]={166,94,161,g,0}; -S sa6M[]={166,220,0}; -S sga6Mg[]={32,166,220,a}; -S sga4w[]={32,164,s,0}; -S sa5pg[]={165,l,a}; -S sa4a4[]={164,164,0}; -S sga4a4[]={32,164,164,0}; -S sa4a9g[]={164,169,a}; -S sa4Z[]={164,99,0}; -S sga4yg[]={32,164,u,a}; -S sabi[]={171,e,0}; -S sa6Mg[]={166,220,a}; -S sacb0g[]={172,176,a}; -S sbcg[]={188,a}; -S sga4S[]={32,164,226,0}; -S sGg[]={214,a}; -S sachg[]={172,d,a}; -S sga4e8g[]={32,164,232,a}; -S sgabig[]={32,171,e,a}; -S sa5lg[]={165,h,a}; -S sga4a4g[]={32,164,164,a}; -S sga5Bg[]={32,165,209,a}; -S sa5B[]={165,209,0}; -S sgabi[]={32,171,e,0}; -S sb4g[]={180,a}; -S sa4y[]={164,u,0}; -S sa4Sg[]={164,226,a}; -S sa8g[]={168,a}; -S sa5p[]={165,l,0}; -S sgacb0[]={32,172,176,0}; -S sgb0eag[]={32,176,234,a}; -S sgachg[]={32,172,d,a}; -S sb0eag[]={176,234,a}; -S sa4S[]={164,226,0}; -S sga4a9g[]={32,164,169,a}; -S sga4e8[]={32,164,232,0}; -S sga5B[]={32,165,209,0}; -S sgb0aag[]={32,176,170,a}; -S sga4o[]={32,164,k,0}; -S sb0ea[]={176,234,0}; -S sgb0aa[]={32,176,170,0}; -S sb0aag[]={176,170,a}; -S sga4Sg[]={32,164,226,a}; -S sgb0g[]={32,176,a}; -S sadbb[]={173,187,0}; - -N l7n0[]={{sgb4Ug,.654},H}; -N l7n1[]={{sa6_,.163},{sa1Y,.140},H}; -N l7n3[]={{sbdg,.420},{sga6_,.245},H}; -N l7n4[]={{sgb9u,.385},{sga4c0,.210},H}; -N l7n7[]={{sgb7,.980},H}; -N l7n8[]={{sga8,.934},H}; -N l7n9[]={{sf7g,.578},{sa5ceg,.368},H}; -N l7n10[]={{sgb5sg,.280},{sGg,.263},H}; -N l7n11[]={{sb5g,.560},{sgbec7,.420},{sgc4b5g,.280},H}; -N l7n13[]={{swg,.257},H}; -N l7n14[]={{saaf8,.187},{sgacjg,.327},H}; -N l7n15[]={{sa4a3g,.473},{sga5ceg,.327},H}; -N l7n17[]={{sefg,.525},{sgacs,.315},{sgaec9,.245},{sga6X,.210},H}; -N l7n18[]={{sa1Z,.560},{sceg,.630},H}; -N l7n19[]={{sadg,.385},{s5ea1,.093},{sa4kg,.315},H}; -N l7n21[]={{sog,.280},H}; -N l7n22[]={{sga6tg,.373},{sa6Mg,.263},H}; -N l7n23[]={{sga740g,.280},H}; -N l7n24[]={{sgb8,1.190},{sb8tg,.368},H}; -N l7n25[]={{sga9,1.074},{se7g,.263},H}; -N l7n26[]={{sc6g,.840},H}; -N l7n27[]={{sa5g,.665},{sga4i,.245},{sgbef7,.245},H}; -N l7n28[]={{sa1qg,3.151},{sa440,.350},{sga1Xg,.654},{sga6Y,.350},{sga4e8g,.233},H}; -N l7n29[]={{sZg,.724},H}; -N l7n30[]={{sgb2c4,.210},H}; -N l7n33[]={{sga5h,.280},{sc4b5g,.473},H}; -N l7n34[]={{sga4bag,.327},{sbeg,.245},H}; -N l7n35[]={{sa4_g,.368},H}; -N l7n36[]={{sa4lg,.525},H}; -N l7n37[]={{sga4a3g,.420},H}; -N l7n38[]={{sgadfb,.455},{sgb8ea,.210},H}; -N l7n39[]={{sga1Yg,.280},{sga4e9g,.280},{sa5p,.117},H}; -N l7n40[]={{sgaaba,.840},{sf8g,.840},H}; -N l7n41[]={{sgb9,.770},{sHg,.368},{sgb8D,.210},H}; -N l7n42[]={{sgaa,1.354},H}; -N l7n43[]={{sb6b1g,.315},{sga4yg,.233},H}; -N l7n44[]={{sxg,.373},H}; -N l7n46[]={{sb3u,.210},H}; -N l7n48[]={{sga4a4g,.233},{sga5Bg,.233},H}; -N l7n49[]={{scfg,.630},{sga4k,.210},H}; -N l7n50[]={{sga1Zg,1.120},{sgaaf8g,.373},{sb8eag,.315},H}; -N l7n51[]={{sacs,.210},{sga4ad,.210},H}; -N l7n52[]={{spg,.373},H}; -N l7n53[]={{sga5g,.350},H}; -N l7n54[]={{sa4ba,.163},H}; -N l7n56[]={{se8g,.420},H}; -N l7n57[]={{sc7g,.945},{sbec7,.280},H}; -N l7n58[]={{sgba,.327},{sb0eag,.263},H}; -N l7n59[]={{sgab,.980},H}; -N l7n60[]={{shg,.560},{sga4l,.350},H}; -N l7n62[]={{sa4Sg,.263},{sgb0aag,.233},H}; -N l7n63[]={{sga57e,.210},H}; -N l7n64[]={{sga1q,2.101},H}; -N l7n65[]={{sgb8fbg,.373},{sga4_g,.327},H}; -N l7n67[]={{sga4bdg,.327},{sa65ea1,.210},{sa5lg,.263},H}; -N l7n68[]={{sb8Mg,.420},H}; -N l7n70[]={{sa4ng,.525},H}; -N l7n71[]={{sf9g,.420},H}; -N l7n72[]={{sb9ug,.578},{sgb8tg,.327},{sIg,.368},H}; -N l7n73[]={{sb7g,.875},H}; -N l7n74[]={{sb5s,.140},H}; -N l7n75[]={{syg,.560},{sgbb,.443},{sb8D,.140},H}; -N l7n76[]={{sgac,1.144},H}; -N l7n80[]={{saabag,1.260},{sa1Xg,.735},{sb4Ug,.735},{sga67e,.455},{sAg,.473},H}; -N l7n81[]={{sga4a7g,.327},H}; -N l7n82[]={{sga4n,.350},H}; -N l7n83[]={{sqg,1.587},{sa578g,.525},{sb8fbg,.420},{sa4a7g,.368},H}; -N l7n85[]={{sa4e9,.187},H}; -N l7n86[]={{sa1k,.140},{sadDg,.315},H}; -N l7n87[]={{se9g,.315},H}; -N l7n88[]={{sc8g,.473},{sa65e,.140},H}; -N l7n89[]={{sa7g,.455},{sa4ad,.210},{sa57e,.140},H}; -N l7n91[]={{sig,.350},{sa8D,.140},H}; -N l7n92[]={{sgbc,.327},H}; -N l7n93[]={{sgad,1.237},{sa4u,.467},{sga578g,.467},{sa6b3g,.315},{sga4o,.175},H}; -N l7n94[]={{sadbb,.117},H}; -N l7n95[]={{sRg,.420},H}; -N l7n96[]={{sc0g,.630},H}; -N l7n97[]={{sa6_g,.368},{sa1Yg,.315},H}; -N l7n98[]={{s7eg,.934},H}; -N l7n99[]={{sga6_g,.327},H}; -N l7n100[]={{sgb9ug,.513},{sga4c0g,.280},H}; -N l7n102[]={{sa5bb,.140},H}; -N l7n103[]={{sgb7g,.630},{sga4a9g,.233},H}; -N l7n104[]={{sb8g,.280},H}; -N l7n105[]={{sbef7,.187},{sa4bd,.163},{sa4ua4,.210},H}; -N l7n106[]={{szg,.280},{sabi,.117},H}; -N l7n107[]={{sgbec7g,.560},{saec9,.163},H}; -N l7n109[]={{sgbd,.420},H}; -N l7n110[]={{sgae,.817},{sf2g,.630},{saaf8g,.420},{sgadD,.210},H}; -N l7n111[]={{sBg,.578},{sa4Z,.117},H}; -N l7n112[]={{sb0g,.455},H}; -N l7n113[]={{sgb77e,.315},{sgacsg,.420},{sgaec9g,.327},{sga6Xg,.280},H}; -N l7n114[]={{sa1Zg,1.260},{srg,.350},H}; -N l7n117[]={{sa4a9g,.263},H}; -N l7n118[]={{seag,.683},H}; -N l7n119[]={{sc9g,.578},H}; -N l7n120[]={{sa67e,.303},{sa65ea1k,.280},{sa8g,.175},H}; -N l7n121[]={{sa740,.140},H}; -N l7n122[]={{sjg,.467},{sga4S,.175},H}; -N l7n123[]={{sgbef7g,.327},{sga4ig,.327},H}; -N l7n124[]={{sa440g,.735},{sga6Yg,.467},H}; -N l7n126[]={{sgbe,.607},{sSg,.525},{sa8c6,.187},H}; -N l7n127[]={{sgaf,.327},{sc1g,.368},H}; -N l7n128[]={{s5ea1k,.140},H}; -N l7n129[]={{sga5hg,.373},H}; -N l7n132[]={{sga440,.490},{sacb0,.163},{sa6ca,.140},H}; -N l7n133[]={{sfbg,1.470},H}; -N l7n134[]={{sgadfbg,.607},{sKg,.473},{sgb8eag,.280},H}; -N l7n135[]={{sb77e,.210},{sb9g,.280},{sa5pg,.263},H}; -N l7n136[]={{sgaabag,1.120},H}; -N l7n137[]={{s_g,.607},{sgb8Dg,.280},H}; -N l7n138[]={{sa6t,.257},{sga9f3,.385},{sga8c6,.280},H}; -N l7n139[]={{sa6X,.187},H}; -N l7n140[]={{sgb8M,.280},H}; -N l7n141[]={{sf3g,.840},H}; -N l7n142[]={{sCg,.473},{sb3ug,.473},H}; -N l7n143[]={{sb1g,.455},{sgbf,.187},H}; -N l7n144[]={{sgb0,.817},{sa4x,.163},H}; -N l7n145[]={{sga1,2.614},{ssg,.770},{sa4i,.210},{sgb6b1,.210},{sga4kg,.280},H}; -N l7n146[]={{sb2c4,.140},{sgabi,.175},H}; -N l7n147[]={{sacsg,.473},{sua4,.124},{sga4adg,.280},H}; -N l7n148[]={{sga6ca,.210},H}; -N l7n149[]={{sebg,.315},H}; -N l7n150[]={{scag,.368},{sa4bag,.368},H}; -N l7n151[]={{sa9g,.245},{sga6b3,.210},H}; -N l7n153[]={{skg,.327},{sbec7g,.630},H}; -N l7n154[]={{sa9f3,.257},{sacj,.163},H}; -N l7n156[]={{sa6Y,.233},{sga4lg,.467},{sa4c0,.187},H}; -N l7n158[]={{sadfb,.327},{sgb3u,.315},H}; -N l7n159[]={{sga4u,.560},{sa5h,.210},{sga57eg,.280},{sa1g,.210},H}; -N l7n160[]={{sga1qg,2.801},{sgc0,.373},{sgb4U,.490},H}; -N l7n161[]={{sgb1,.864},{sa4y,.117},H}; -N l7n164[]={{sfcg,.420},H}; -N l7n166[]={{sbag,1.190},H}; -N l7n168[]={{s78g,.397},H}; -N l7n169[]={{sa5ce,.163},H}; -N l7n170[]={{sgb5s,.210},{sb5sg,.315},H}; -N l7n171[]={{sgc4b5,.210},{sb8Dg,.315},H}; -N l7n172[]={{sf4g,.735},H}; -N l7n173[]={{sDg,1.313},H}; -N l7n174[]={{sb2g,.385},{sgacj,.245},H}; -N l7n175[]={{sa4a3,.233},{sga5ce,.245},H}; -N l7n176[]={{stg,.747},{sga67eg,.607},H}; -N l7n177[]={{sgc1,.350},H}; -N l7n178[]={{sgb2,.630},{sga4ng,.467},H}; -N l7n179[]={{sa4k,.140},H}; -N l7n180[]={{secg,.368},H}; -N l7n181[]={{sa4e9g,.315},{sga4w,.175},H}; -N l7n182[]={{saag,.315},{sga6t,.280},{sa6M,.117},H}; -N l7n183[]={{sga740,.210},H}; -N l7n184[]={{slg,.560},{sb8t,.163},H}; -N l7n185[]={{sa4adg,.315},{sa57eg,.315},H}; -N l7n186[]={{sga6Mg,.233},H}; -N l7n188[]={{sa1q,1.400},{sUg,.840},{sga1X,.490},{sga4e8,.175},H}; -N l7n189[]={{sa4ug,.683},H}; -N l7n192[]={{s60g,.210},{sa4a4,.117},H}; -N l7n193[]={{sc4b5,.210},H}; -N l7n194[]={{sgc2,.210},{sga4ba,.245},H}; -N l7n195[]={{sgb3,.934},{sa4_,.187},H}; -N l7n196[]={{sga4,4.808},{sMg,.945},{sa4l,.233},H}; -N l7n197[]={{sbbg,.525},{sga4a3,.315},H}; -N l7n199[]={{sga1Y,.210},{sga4e9,.210},H}; -N l7n201[]={{sa4bdg,.368},{sbef7g,.368},H}; -N l7n203[]={{sf5g,.368},{saec9g,.368},{sb6b1,.140},H}; -N l7n204[]={{sEg,.368},H}; -N l7n205[]={{sb3g,.525},H}; -N l7n206[]={{sgadDg,.280},H}; -N l7n207[]={{sug,1.097},H}; -N l7n208[]={{sga4a4,.175},{sga5B,.175},H}; -N l7n209[]={{sgb77eg,.420},H}; -N l7n210[]={{sga1Z,.840},{sgaaf8,.280},{sb8ea,.140},H}; -N l7n211[]={{sgc3,.280},{sedg,.368},H}; -N l7n212[]={{sgb4,.747},{sccg,.473},H}; -N l7n213[]={{sga5,2.708},H}; -N l7n215[]={{smg,.327},{saey,.187},H}; -N l7n216[]={{sa67eg,.683},{sachg,.263},H}; -N l7n217[]={{sa740g,.315},H}; -N l7n218[]={{sb0ea,.117},{sga4Sg,.233},H}; -N l7n219[]={{sVg,.368},H}; -N l7n220[]={{sa5B,.117},{sgacb0,.175},H}; -N l7n221[]={{sa3g,.700},H}; -N l7n222[]={{sa8c6g,.420},{sa4S,.117},{sgb0aa,.175},H}; -N l7n223[]={{sXg,.747},H}; -N l7n224[]={{s40g,.607},H}; -N l7n225[]={{sgb8fb,.280},{sga4_,.245},H}; -N l7n227[]={{sga4bd,.245},{sa5l,.163},H}; -N l7n228[]={{sgc4,.443},{sga440g,.654},{sb8M,.187},{sa6cag,.315},{sacb0g,.263},{sbcg,.175},H}; -N l7n229[]={{sgb5,.724},H}; -N l7n230[]={{sga6,2.521},{sa4n,.233},H}; -N l7n231[]={{sb77eg,.473},H}; -N l7n232[]={{sb9u,.327},{sgb8t,.245},H}; -N l7n234[]={{sga9f3g,.513},{sf6g,.525},{sa6tg,.473},{sga8c6g,.373},H}; -N l7n235[]={{sFg,.578},{sa6Xg,.420},H}; -N l7n236[]={{sgb8Mg,.373},{sb4g,.175},H}; -N l7n240[]={{saaba,.654},{sb4U,.350},{sa1X,.327},{sgb0g,.175},H}; -N l7n241[]={{sga4a7,.245},{sa4ig,.368},{sgb6b1g,.280},H}; -N l7n242[]={{sgabig,.233},H}; -N l7n243[]={{sa578,.233},{sb8fb,.187},{sa4a7,.163},H}; -N l7n244[]={{sacg,.245},{sga6cag,.280},H}; -N l7n245[]={{sgc5,.187},H}; -N l7n246[]={{sgb6,.934},{sng,.397},{sadD,.163},H}; -N l7n247[]={{sga7,.864},{sga6b3g,.280},{sa4o,.140},H}; -N l7n248[]={{sgachg,.233},H}; -N l7n250[]={{sa9f3g,.578},{sacjg,.368},{sWg,.315},{sb0aag,.263},H}; -N l7n252[]={{sa4g,.350},{sa6Yg,.525},{sa4c0g,.315},H}; -N l7n253[]={{sga578,.350},{sa6b3,.187},H}; -N l7n254[]={{sYg,.537},{sadfbg,.735},{sgb3ug,.420},{sgb0eag,.233},H}; -N l7n255[]={{sga4ug,.607},{sa5hg,.420},H}; - -D l7_d = -{ +S sga4[] = { 32, 164, 0 }; +S sga5[] = { 32, 165, 0 }; +S sga1[] = { 32, 161, 0 }; +S sga6[] = { 32, 166, 0 }; +S sa1q[] = { 161, m, 0 }; +S sga1qg[] = { 32, 161, m, a }; +S sa1qg[] = { 161, m, a }; +S sga1q[] = { 32, 161, m, 0 }; +S sgaa[] = { 32, 170, 0 }; +S sgad[] = { 32, 173, 0 }; +S sgac[] = { 32, 172, 0 }; +S sga9[] = { 32, 169, 0 }; +S sgab[] = { 32, 171, 0 }; +S sgb3[] = { 32, 179, 0 }; +S sgb6[] = { 32, 182, 0 }; +S sga8[] = { 32, 168, 0 }; +S s7eg[] = { 126, a }; +S sga7[] = { 32, 167, 0 }; +S sgae[] = { 32, 174, 0 }; +S sgb0[] = { 32, 176, 0 }; +S sgb9[] = { 32, 185, 0 }; +S sgb4[] = { 32, 180, 0 }; +S sgb5[] = { 32, 181, 0 }; +S saaba[] = { 170, 186, 0 }; +S sfbg[] = { 251, a }; +S sgb2[] = { 32, 178, 0 }; +S s_g[] = { w, a }; +S s40g[] = { 64, a }; +S sgbe[] = { 32, 190, 0 }; +S sDg[] = { 211, a }; +S sb7g[] = { 183, a }; +S sgaabag[] = { 32, 170, 186, a }; +S sga1Zg[] = { 32, 161, 99, a }; +S sa1Zg[] = { 161, 99, a }; +S saabag[] = { 170, 186, a }; +S sgaaba[] = { 32, 170, 186, 0 }; +S sa1Z[] = { 161, 99, 0 }; +S sga1Z[] = { 32, 161, 99, 0 }; +S sYg[] = { 98, a }; +S sa4u[] = { 164, q, 0 }; +S sa3g[] = { 163, a }; +S sgbb[] = { 32, 187, 0 }; +S sa5g[] = { 165, a }; +S sgc4[] = { 32, 196, 0 }; +S sgb7g[] = { 32, 183, a }; +S s78g[] = { x, a }; +S sf8g[] = { 248, a }; +S sc6g[] = { 198, a }; +S sga4u[] = { 32, 164, q, 0 }; +S sa440[] = { 164, 64, 0 }; +S sb4U[] = { 180, 228, 0 }; +S sb3g[] = { 179, a }; +S sga1Xg[] = { 32, 161, 97, a }; +S sgbc[] = { 32, 188, 0 }; +S sadfbg[] = { 173, 251, a }; +S sf4g[] = { 244, a }; +S sgba[] = { 32, 186, 0 }; +S sa1Xg[] = { 161, 97, a }; +S sga1X[] = { 32, 161, 97, 0 }; +S sgaf[] = { 32, 175, 0 }; +S sgb4U[] = { 32, 180, 228, 0 }; +S sadfb[] = { 173, 251, 0 }; +S sga440[] = { 32, 164, 64, 0 }; +S sgb4Ug[] = { 32, 180, 228, a }; +S sga440g[] = { 32, 164, 64, a }; +S sa440g[] = { 164, 64, a }; +S sb9u[] = { 185, q, 0 }; +S sb4Ug[] = { 180, 228, a }; +S sa1X[] = { 161, 97, 0 }; +S sa67eg[] = { 166, 126, a }; +S sgadfbg[] = { 32, 173, 251, a }; +S sga67e[] = { 32, 166, 126, 0 }; +S sga4ug[] = { 32, 164, q, a }; +S sa67e[] = { 166, 126, 0 }; +S sgadfb[] = { 32, 173, 251, 0 }; +S sa4ug[] = { 164, q, a }; +S sga67eg[] = { 32, 166, 126, a }; +S sgbec7[] = { 32, 190, 199, 0 }; +S sc0g[] = { 192, a }; +S sbec7[] = { 190, 199, 0 }; +S sbec7g[] = { 190, 199, a }; +S sceg[] = { 206, a }; +S sgbec7g[] = { 32, 190, 199, a }; +S szg[] = { v, a }; +S sgb9u[] = { 32, 185, q, 0 }; +S sadg[] = { 173, a }; +S sga9f3g[] = { 32, 169, 243, a }; +S sb9ug[] = { 185, q, a }; +S sf7g[] = { 247, a }; +S sgb9ug[] = { 32, 185, q, a }; +S sa6t[] = { 166, p, 0 }; +S sa9f3[] = { 169, 243, 0 }; +S sa9f3g[] = { 169, 243, a }; +S sc9g[] = { 201, a }; +S sga9f3[] = { 32, 169, 243, 0 }; +S sa6Y[] = { 166, 98, 0 }; +S sga4l[] = { 32, 164, h, 0 }; +S sga6Y[] = { 32, 166, 98, 0 }; +S sa4ng[] = { 164, j, a }; +S sf6g[] = { 246, a }; +S sa4l[] = { 164, h, 0 }; +S sga4lg[] = { 32, 164, h, a }; +S sa578[] = { 165, x, 0 }; +S sga5g[] = { 32, 165, a }; +S sa4g[] = { 164, a }; +S sa4n[] = { 164, j, 0 }; +S sga4n[] = { 32, 164, j, 0 }; +S sa4lg[] = { 164, h, a }; +S sga578[] = { 32, 165, x, 0 }; +S sa578g[] = { 165, x, a }; +S sa4a3[] = { 164, 163, 0 }; +S sga4ng[] = { 32, 164, j, a }; +S sa6Yg[] = { 166, 98, a }; +S sga578g[] = { 32, 165, x, a }; +S sga6Yg[] = { 32, 166, 98, a }; +S sa4ad[] = { 164, 173, 0 }; +S sga4a3g[] = { 32, 164, 163, a }; +S sb77e[] = { 183, 126, 0 }; +S sga4a3[] = { 32, 164, 163, 0 }; +S sa6tg[] = { 166, p, a }; +S sa4i[] = { 164, e, 0 }; +S sgb3ug[] = { 32, 179, q, a }; +S sgc2[] = { 32, 194, 0 }; +S sgacs[] = { 32, 172, o, 0 }; +S sgb77e[] = { 32, 183, 126, 0 }; +S sacs[] = { 172, o, 0 }; +S sa5h[] = { 165, d, 0 }; +S sb3ug[] = { 179, q, a }; +S sgb3u[] = { 32, 179, q, 0 }; +S sgb77eg[] = { 32, 183, 126, a }; +S sgacsg[] = { 32, 172, o, a }; +S sb3u[] = { 179, q, 0 }; +S sacsg[] = { 172, o, a }; +S s60g[] = { 96, a }; +S sccg[] = { 204, a }; +S sb77eg[] = { 183, 126, a }; +S sa4a3g[] = { 164, 163, a }; +S sb8M[] = { 184, 220, 0 }; +S sgb8fbg[] = { 32, 184, 251, a }; +S sgaaf8[] = { 32, 170, 248, 0 }; +S sbef7[] = { 190, 247, 0 }; +S sua4[] = { q, 164, 0 }; +S sa6Xg[] = { 166, 97, a }; +S sgb8Mg[] = { 32, 184, 220, a }; +S sga5hg[] = { 32, 165, d, a }; +S saey[] = { 174, u, 0 }; +S se8g[] = { 232, a }; +S sa4e9[] = { 164, 233, 0 }; +S sa4c0[] = { 164, 192, 0 }; +S sga5h[] = { 32, 165, d, 0 }; +S saaf8g[] = { 170, 248, a }; +S sf9g[] = { 249, a }; +S sa5hg[] = { 165, d, a }; +S sgc5[] = { 32, 197, 0 }; +S sb8fbg[] = { 184, 251, a }; +S sga8c6[] = { 32, 168, 198, 0 }; +S sb8fb[] = { 184, 251, 0 }; +S sgaaf8g[] = { 32, 170, 248, a }; +S sga6t[] = { 32, 166, p, 0 }; +S sa8c6g[] = { 168, 198, a }; +S sa6X[] = { 166, 97, 0 }; +S sa8c6[] = { 168, 198, 0 }; +S sb8Mg[] = { 184, 220, a }; +S sga8c6g[] = { 32, 168, 198, a }; +S sgb8fb[] = { 32, 184, 251, 0 }; +S saaf8[] = { 170, 248, 0 }; +S sa6b3[] = { 166, 179, 0 }; +S sfcg[] = { 252, a }; +S sga6tg[] = { 32, 166, p, a }; +S sa4_[] = { 164, w, 0 }; +S sgb8M[] = { 32, 184, 220, 0 }; +S sc1g[] = { 193, a }; +S sVg[] = { 229, a }; +S sga6_g[] = { 32, 166, w, a }; +S sga4bdg[] = { 32, 164, 189, a }; +S sadD[] = { 173, 211, 0 }; +S sga4a7[] = { 32, 164, 167, 0 }; +S sga4a7g[] = { 32, 164, 167, a }; +S sf5g[] = { 245, a }; +S sa4bdg[] = { 164, 189, a }; +S sga4i[] = { 32, 164, e, 0 }; +S sacjg[] = { 172, f, a }; +S sgaec9g[] = { 32, 174, 201, a }; +S sga5ce[] = { 32, 165, 206, 0 }; +S sacb0[] = { 172, 176, 0 }; +S saec9[] = { 174, 201, 0 }; +S sacj[] = { 172, f, 0 }; +S sga4bd[] = { 32, 164, 189, 0 }; +S sga4bag[] = { 32, 164, 186, a }; +S sga5ceg[] = { 32, 165, 206, a }; +S sga4_g[] = { 32, 164, w, a }; +S sHg[] = { 215, a }; +S sgacj[] = { 32, 172, f, 0 }; +S sb8t[] = { 184, p, 0 }; +S sa4a7[] = { 164, 167, 0 }; +S sga4_[] = { 32, 164, w, 0 }; +S scag[] = { 202, a }; +S sb8tg[] = { 184, p, a }; +S sgaec9[] = { 32, 174, 201, 0 }; +S sgacjg[] = { 32, 172, f, a }; +S sgbef7[] = { 32, 190, 247, 0 }; +S secg[] = { 236, a }; +S sgbef7g[] = { 32, 190, 247, a }; +S saec9g[] = { 174, 201, a }; +S sa4a7g[] = { 164, 167, a }; +S sedg[] = { 237, a }; +S sgb8tg[] = { 32, 184, p, a }; +S sgb8t[] = { 32, 184, p, 0 }; +S sa4ig[] = { 164, e, a }; +S sa4x[] = { 164, t, 0 }; +S sga4ig[] = { 32, 164, e, a }; +S sga6_[] = { 32, 166, w, 0 }; +S sga4ba[] = { 32, 164, 186, 0 }; +S sa5l[] = { 165, h, 0 }; +S sa6_[] = { 166, w, 0 }; +S sa5ceg[] = { 165, 206, a }; +S sa5ce[] = { 165, 206, 0 }; +S sbef7g[] = { 190, 247, a }; +S sa4_g[] = { 164, w, a }; +S sa4ba[] = { 164, 186, 0 }; +S sa6_g[] = { 166, w, a }; +S sa4bag[] = { 164, 186, a }; +S sa4bd[] = { 164, 189, 0 }; +S sa740[] = { 167, 64, 0 }; +S sb5s[] = { 181, o, 0 }; +S sb8ea[] = { 184, 234, 0 }; +S sb8D[] = { 184, 211, 0 }; +S sga1Y[] = { 32, 161, 98, 0 }; +S sgb6b1g[] = { 32, 182, 177, a }; +S sgb6b1[] = { 32, 182, 177, 0 }; +S sgb8D[] = { 32, 184, 211, 0 }; +S sgc4b5g[] = { 32, 196, 181, a }; +S sga4kg[] = { 32, 164, g, a }; +S sga4e9[] = { 32, 164, 233, 0 }; +S sga6b3[] = { 32, 166, 179, 0 }; +S sgb2c4[] = { 32, 178, 196, 0 }; +S sa5bb[] = { 165, 187, 0 }; +S sa65e[] = { 166, 94, 0 }; +S s5ea1k[] = { 94, 161, g, 0 }; +S sgb8Dg[] = { 32, 184, 211, a }; +S sga1Yg[] = { 32, 161, 98, a }; +S sga4c0g[] = { 32, 164, 192, a }; +S sa6ca[] = { 166, 202, 0 }; +S sga4k[] = { 32, 164, g, 0 }; +S sgb5s[] = { 32, 181, o, 0 }; +S sa4adg[] = { 164, 173, a }; +S sgc4b5[] = { 32, 196, 181, 0 }; +S sa1Y[] = { 161, 98, 0 }; +S sa4ua4[] = { 164, q, 164, 0 }; +S sga6cag[] = { 32, 166, 202, a }; +S sc4b5[] = { 196, 181, 0 }; +S sa1Yg[] = { 161, 98, a }; +S sga4adg[] = { 32, 164, 173, a }; +S sga740[] = { 32, 167, 64, 0 }; +S sga4e9g[] = { 32, 164, 233, a }; +S sga57e[] = { 32, 165, 126, 0 }; +S sa57e[] = { 165, 126, 0 }; +S sgadDg[] = { 32, 173, 211, a }; +S sc4b5g[] = { 196, 181, a }; +S sga57eg[] = { 32, 165, 126, a }; +S sb5sg[] = { 181, o, a }; +S s5ea1[] = { 94, 161, 0 }; +S sebg[] = { 235, a }; +S sgb8eag[] = { 32, 184, 234, a }; +S sga4ad[] = { 32, 164, 173, 0 }; +S sb6b1g[] = { 182, 177, a }; +S sa1k[] = { 161, g, 0 }; +S sb8Dg[] = { 184, 211, a }; +S sa6b3g[] = { 166, 179, a }; +S sa57eg[] = { 165, 126, a }; +S sga740g[] = { 32, 167, 64, a }; +S sa6cag[] = { 166, 202, a }; +S sa4c0g[] = { 164, 192, a }; +S sb2c4[] = { 178, 196, 0 }; +S sga6Xg[] = { 32, 166, 97, a }; +S sgadD[] = { 32, 173, 211, 0 }; +S sga6b3g[] = { 32, 166, 179, a }; +S sa8D[] = { 168, 211, 0 }; +S sa65ea1[] = { 166, 94, 161, 0 }; +S sa740g[] = { 167, 64, a }; +S sa1g[] = { 161, a }; +S sb6b1[] = { 182, 177, 0 }; +S sa4k[] = { 164, g, 0 }; +S sgb5sg[] = { 32, 181, o, a }; +S sa4e9g[] = { 164, 233, a }; +S sga4c0[] = { 32, 164, 192, 0 }; +S sgb8ea[] = { 32, 184, 234, 0 }; +S sb8eag[] = { 184, 234, a }; +S sga6ca[] = { 32, 166, 202, 0 }; +S sa4o[] = { 164, k, 0 }; +S sadDg[] = { 173, 211, a }; +S sa4kg[] = { 164, g, a }; +S sga6X[] = { 32, 166, 97, 0 }; +S sa65ea1k[] = { 166, 94, 161, g, 0 }; +S sa6M[] = { 166, 220, 0 }; +S sga6Mg[] = { 32, 166, 220, a }; +S sga4w[] = { 32, 164, s, 0 }; +S sa5pg[] = { 165, l, a }; +S sa4a4[] = { 164, 164, 0 }; +S sga4a4[] = { 32, 164, 164, 0 }; +S sa4a9g[] = { 164, 169, a }; +S sa4Z[] = { 164, 99, 0 }; +S sga4yg[] = { 32, 164, u, a }; +S sabi[] = { 171, e, 0 }; +S sa6Mg[] = { 166, 220, a }; +S sacb0g[] = { 172, 176, a }; +S sbcg[] = { 188, a }; +S sga4S[] = { 32, 164, 226, 0 }; +S sGg[] = { 214, a }; +S sachg[] = { 172, d, a }; +S sga4e8g[] = { 32, 164, 232, a }; +S sgabig[] = { 32, 171, e, a }; +S sa5lg[] = { 165, h, a }; +S sga4a4g[] = { 32, 164, 164, a }; +S sga5Bg[] = { 32, 165, 209, a }; +S sa5B[] = { 165, 209, 0 }; +S sgabi[] = { 32, 171, e, 0 }; +S sb4g[] = { 180, a }; +S sa4y[] = { 164, u, 0 }; +S sa4Sg[] = { 164, 226, a }; +S sa8g[] = { 168, a }; +S sa5p[] = { 165, l, 0 }; +S sgacb0[] = { 32, 172, 176, 0 }; +S sgb0eag[] = { 32, 176, 234, a }; +S sgachg[] = { 32, 172, d, a }; +S sb0eag[] = { 176, 234, a }; +S sa4S[] = { 164, 226, 0 }; +S sga4a9g[] = { 32, 164, 169, a }; +S sga4e8[] = { 32, 164, 232, 0 }; +S sga5B[] = { 32, 165, 209, 0 }; +S sgb0aag[] = { 32, 176, 170, a }; +S sga4o[] = { 32, 164, k, 0 }; +S sb0ea[] = { 176, 234, 0 }; +S sgb0aa[] = { 32, 176, 170, 0 }; +S sb0aag[] = { 176, 170, a }; +S sga4Sg[] = { 32, 164, 226, a }; +S sgb0g[] = { 32, 176, a }; +S sadbb[] = { 173, 187, 0 }; + +N l7n0[] = { { sgb4Ug, .654 }, H }; +N l7n1[] = { { sa6_, .163 }, { sa1Y, .140 }, H }; +N l7n3[] = { { sbdg, .420 }, { sga6_, .245 }, H }; +N l7n4[] = { { sgb9u, .385 }, { sga4c0, .210 }, H }; +N l7n7[] = { { sgb7, .980 }, H }; +N l7n8[] = { { sga8, .934 }, H }; +N l7n9[] = { { sf7g, .578 }, { sa5ceg, .368 }, H }; +N l7n10[] = { { sgb5sg, .280 }, { sGg, .263 }, H }; +N l7n11[] = { { sb5g, .560 }, { sgbec7, .420 }, { sgc4b5g, .280 }, H }; +N l7n13[] = { { swg, .257 }, H }; +N l7n14[] = { { saaf8, .187 }, { sgacjg, .327 }, H }; +N l7n15[] = { { sa4a3g, .473 }, { sga5ceg, .327 }, H }; +N l7n17[] = { { sefg, .525 }, { sgacs, .315 }, { sgaec9, .245 }, { sga6X, .210 }, H }; +N l7n18[] = { { sa1Z, .560 }, { sceg, .630 }, H }; +N l7n19[] = { { sadg, .385 }, { s5ea1, .093 }, { sa4kg, .315 }, H }; +N l7n21[] = { { sog, .280 }, H }; +N l7n22[] = { { sga6tg, .373 }, { sa6Mg, .263 }, H }; +N l7n23[] = { { sga740g, .280 }, H }; +N l7n24[] = { { sgb8, 1.190 }, { sb8tg, .368 }, H }; +N l7n25[] = { { sga9, 1.074 }, { se7g, .263 }, H }; +N l7n26[] = { { sc6g, .840 }, H }; +N l7n27[] = { { sa5g, .665 }, { sga4i, .245 }, { sgbef7, .245 }, H }; +N l7n28[] = { { sa1qg, 3.151 }, { sa440, .350 }, { sga1Xg, .654 }, { sga6Y, .350 }, { sga4e8g, .233 }, H }; +N l7n29[] = { { sZg, .724 }, H }; +N l7n30[] = { { sgb2c4, .210 }, H }; +N l7n33[] = { { sga5h, .280 }, { sc4b5g, .473 }, H }; +N l7n34[] = { { sga4bag, .327 }, { sbeg, .245 }, H }; +N l7n35[] = { { sa4_g, .368 }, H }; +N l7n36[] = { { sa4lg, .525 }, H }; +N l7n37[] = { { sga4a3g, .420 }, H }; +N l7n38[] = { { sgadfb, .455 }, { sgb8ea, .210 }, H }; +N l7n39[] = { { sga1Yg, .280 }, { sga4e9g, .280 }, { sa5p, .117 }, H }; +N l7n40[] = { { sgaaba, .840 }, { sf8g, .840 }, H }; +N l7n41[] = { { sgb9, .770 }, { sHg, .368 }, { sgb8D, .210 }, H }; +N l7n42[] = { { sgaa, 1.354 }, H }; +N l7n43[] = { { sb6b1g, .315 }, { sga4yg, .233 }, H }; +N l7n44[] = { { sxg, .373 }, H }; +N l7n46[] = { { sb3u, .210 }, H }; +N l7n48[] = { { sga4a4g, .233 }, { sga5Bg, .233 }, H }; +N l7n49[] = { { scfg, .630 }, { sga4k, .210 }, H }; +N l7n50[] = { { sga1Zg, 1.120 }, { sgaaf8g, .373 }, { sb8eag, .315 }, H }; +N l7n51[] = { { sacs, .210 }, { sga4ad, .210 }, H }; +N l7n52[] = { { spg, .373 }, H }; +N l7n53[] = { { sga5g, .350 }, H }; +N l7n54[] = { { sa4ba, .163 }, H }; +N l7n56[] = { { se8g, .420 }, H }; +N l7n57[] = { { sc7g, .945 }, { sbec7, .280 }, H }; +N l7n58[] = { { sgba, .327 }, { sb0eag, .263 }, H }; +N l7n59[] = { { sgab, .980 }, H }; +N l7n60[] = { { shg, .560 }, { sga4l, .350 }, H }; +N l7n62[] = { { sa4Sg, .263 }, { sgb0aag, .233 }, H }; +N l7n63[] = { { sga57e, .210 }, H }; +N l7n64[] = { { sga1q, 2.101 }, H }; +N l7n65[] = { { sgb8fbg, .373 }, { sga4_g, .327 }, H }; +N l7n67[] = { { sga4bdg, .327 }, { sa65ea1, .210 }, { sa5lg, .263 }, H }; +N l7n68[] = { { sb8Mg, .420 }, H }; +N l7n70[] = { { sa4ng, .525 }, H }; +N l7n71[] = { { sf9g, .420 }, H }; +N l7n72[] = { { sb9ug, .578 }, { sgb8tg, .327 }, { sIg, .368 }, H }; +N l7n73[] = { { sb7g, .875 }, H }; +N l7n74[] = { { sb5s, .140 }, H }; +N l7n75[] = { { syg, .560 }, { sgbb, .443 }, { sb8D, .140 }, H }; +N l7n76[] = { { sgac, 1.144 }, H }; +N l7n80[] = { { saabag, 1.260 }, { sa1Xg, .735 }, { sb4Ug, .735 }, { sga67e, .455 }, { sAg, .473 }, H }; +N l7n81[] = { { sga4a7g, .327 }, H }; +N l7n82[] = { { sga4n, .350 }, H }; +N l7n83[] = { { sqg, 1.587 }, { sa578g, .525 }, { sb8fbg, .420 }, { sa4a7g, .368 }, H }; +N l7n85[] = { { sa4e9, .187 }, H }; +N l7n86[] = { { sa1k, .140 }, { sadDg, .315 }, H }; +N l7n87[] = { { se9g, .315 }, H }; +N l7n88[] = { { sc8g, .473 }, { sa65e, .140 }, H }; +N l7n89[] = { { sa7g, .455 }, { sa4ad, .210 }, { sa57e, .140 }, H }; +N l7n91[] = { { sig, .350 }, { sa8D, .140 }, H }; +N l7n92[] = { { sgbc, .327 }, H }; +N l7n93[] = { { sgad, 1.237 }, { sa4u, .467 }, { sga578g, .467 }, { sa6b3g, .315 }, { sga4o, .175 }, H }; +N l7n94[] = { { sadbb, .117 }, H }; +N l7n95[] = { { sRg, .420 }, H }; +N l7n96[] = { { sc0g, .630 }, H }; +N l7n97[] = { { sa6_g, .368 }, { sa1Yg, .315 }, H }; +N l7n98[] = { { s7eg, .934 }, H }; +N l7n99[] = { { sga6_g, .327 }, H }; +N l7n100[] = { { sgb9ug, .513 }, { sga4c0g, .280 }, H }; +N l7n102[] = { { sa5bb, .140 }, H }; +N l7n103[] = { { sgb7g, .630 }, { sga4a9g, .233 }, H }; +N l7n104[] = { { sb8g, .280 }, H }; +N l7n105[] = { { sbef7, .187 }, { sa4bd, .163 }, { sa4ua4, .210 }, H }; +N l7n106[] = { { szg, .280 }, { sabi, .117 }, H }; +N l7n107[] = { { sgbec7g, .560 }, { saec9, .163 }, H }; +N l7n109[] = { { sgbd, .420 }, H }; +N l7n110[] = { { sgae, .817 }, { sf2g, .630 }, { saaf8g, .420 }, { sgadD, .210 }, H }; +N l7n111[] = { { sBg, .578 }, { sa4Z, .117 }, H }; +N l7n112[] = { { sb0g, .455 }, H }; +N l7n113[] = { { sgb77e, .315 }, { sgacsg, .420 }, { sgaec9g, .327 }, { sga6Xg, .280 }, H }; +N l7n114[] = { { sa1Zg, 1.260 }, { srg, .350 }, H }; +N l7n117[] = { { sa4a9g, .263 }, H }; +N l7n118[] = { { seag, .683 }, H }; +N l7n119[] = { { sc9g, .578 }, H }; +N l7n120[] = { { sa67e, .303 }, { sa65ea1k, .280 }, { sa8g, .175 }, H }; +N l7n121[] = { { sa740, .140 }, H }; +N l7n122[] = { { sjg, .467 }, { sga4S, .175 }, H }; +N l7n123[] = { { sgbef7g, .327 }, { sga4ig, .327 }, H }; +N l7n124[] = { { sa440g, .735 }, { sga6Yg, .467 }, H }; +N l7n126[] = { { sgbe, .607 }, { sSg, .525 }, { sa8c6, .187 }, H }; +N l7n127[] = { { sgaf, .327 }, { sc1g, .368 }, H }; +N l7n128[] = { { s5ea1k, .140 }, H }; +N l7n129[] = { { sga5hg, .373 }, H }; +N l7n132[] = { { sga440, .490 }, { sacb0, .163 }, { sa6ca, .140 }, H }; +N l7n133[] = { { sfbg, 1.470 }, H }; +N l7n134[] = { { sgadfbg, .607 }, { sKg, .473 }, { sgb8eag, .280 }, H }; +N l7n135[] = { { sb77e, .210 }, { sb9g, .280 }, { sa5pg, .263 }, H }; +N l7n136[] = { { sgaabag, 1.120 }, H }; +N l7n137[] = { { s_g, .607 }, { sgb8Dg, .280 }, H }; +N l7n138[] = { { sa6t, .257 }, { sga9f3, .385 }, { sga8c6, .280 }, H }; +N l7n139[] = { { sa6X, .187 }, H }; +N l7n140[] = { { sgb8M, .280 }, H }; +N l7n141[] = { { sf3g, .840 }, H }; +N l7n142[] = { { sCg, .473 }, { sb3ug, .473 }, H }; +N l7n143[] = { { sb1g, .455 }, { sgbf, .187 }, H }; +N l7n144[] = { { sgb0, .817 }, { sa4x, .163 }, H }; +N l7n145[] = { { sga1, 2.614 }, { ssg, .770 }, { sa4i, .210 }, { sgb6b1, .210 }, { sga4kg, .280 }, H }; +N l7n146[] = { { sb2c4, .140 }, { sgabi, .175 }, H }; +N l7n147[] = { { sacsg, .473 }, { sua4, .124 }, { sga4adg, .280 }, H }; +N l7n148[] = { { sga6ca, .210 }, H }; +N l7n149[] = { { sebg, .315 }, H }; +N l7n150[] = { { scag, .368 }, { sa4bag, .368 }, H }; +N l7n151[] = { { sa9g, .245 }, { sga6b3, .210 }, H }; +N l7n153[] = { { skg, .327 }, { sbec7g, .630 }, H }; +N l7n154[] = { { sa9f3, .257 }, { sacj, .163 }, H }; +N l7n156[] = { { sa6Y, .233 }, { sga4lg, .467 }, { sa4c0, .187 }, H }; +N l7n158[] = { { sadfb, .327 }, { sgb3u, .315 }, H }; +N l7n159[] = { { sga4u, .560 }, { sa5h, .210 }, { sga57eg, .280 }, { sa1g, .210 }, H }; +N l7n160[] = { { sga1qg, 2.801 }, { sgc0, .373 }, { sgb4U, .490 }, H }; +N l7n161[] = { { sgb1, .864 }, { sa4y, .117 }, H }; +N l7n164[] = { { sfcg, .420 }, H }; +N l7n166[] = { { sbag, 1.190 }, H }; +N l7n168[] = { { s78g, .397 }, H }; +N l7n169[] = { { sa5ce, .163 }, H }; +N l7n170[] = { { sgb5s, .210 }, { sb5sg, .315 }, H }; +N l7n171[] = { { sgc4b5, .210 }, { sb8Dg, .315 }, H }; +N l7n172[] = { { sf4g, .735 }, H }; +N l7n173[] = { { sDg, 1.313 }, H }; +N l7n174[] = { { sb2g, .385 }, { sgacj, .245 }, H }; +N l7n175[] = { { sa4a3, .233 }, { sga5ce, .245 }, H }; +N l7n176[] = { { stg, .747 }, { sga67eg, .607 }, H }; +N l7n177[] = { { sgc1, .350 }, H }; +N l7n178[] = { { sgb2, .630 }, { sga4ng, .467 }, H }; +N l7n179[] = { { sa4k, .140 }, H }; +N l7n180[] = { { secg, .368 }, H }; +N l7n181[] = { { sa4e9g, .315 }, { sga4w, .175 }, H }; +N l7n182[] = { { saag, .315 }, { sga6t, .280 }, { sa6M, .117 }, H }; +N l7n183[] = { { sga740, .210 }, H }; +N l7n184[] = { { slg, .560 }, { sb8t, .163 }, H }; +N l7n185[] = { { sa4adg, .315 }, { sa57eg, .315 }, H }; +N l7n186[] = { { sga6Mg, .233 }, H }; +N l7n188[] = { { sa1q, 1.400 }, { sUg, .840 }, { sga1X, .490 }, { sga4e8, .175 }, H }; +N l7n189[] = { { sa4ug, .683 }, H }; +N l7n192[] = { { s60g, .210 }, { sa4a4, .117 }, H }; +N l7n193[] = { { sc4b5, .210 }, H }; +N l7n194[] = { { sgc2, .210 }, { sga4ba, .245 }, H }; +N l7n195[] = { { sgb3, .934 }, { sa4_, .187 }, H }; +N l7n196[] = { { sga4, 4.808 }, { sMg, .945 }, { sa4l, .233 }, H }; +N l7n197[] = { { sbbg, .525 }, { sga4a3, .315 }, H }; +N l7n199[] = { { sga1Y, .210 }, { sga4e9, .210 }, H }; +N l7n201[] = { { sa4bdg, .368 }, { sbef7g, .368 }, H }; +N l7n203[] = { { sf5g, .368 }, { saec9g, .368 }, { sb6b1, .140 }, H }; +N l7n204[] = { { sEg, .368 }, H }; +N l7n205[] = { { sb3g, .525 }, H }; +N l7n206[] = { { sgadDg, .280 }, H }; +N l7n207[] = { { sug, 1.097 }, H }; +N l7n208[] = { { sga4a4, .175 }, { sga5B, .175 }, H }; +N l7n209[] = { { sgb77eg, .420 }, H }; +N l7n210[] = { { sga1Z, .840 }, { sgaaf8, .280 }, { sb8ea, .140 }, H }; +N l7n211[] = { { sgc3, .280 }, { sedg, .368 }, H }; +N l7n212[] = { { sgb4, .747 }, { sccg, .473 }, H }; +N l7n213[] = { { sga5, 2.708 }, H }; +N l7n215[] = { { smg, .327 }, { saey, .187 }, H }; +N l7n216[] = { { sa67eg, .683 }, { sachg, .263 }, H }; +N l7n217[] = { { sa740g, .315 }, H }; +N l7n218[] = { { sb0ea, .117 }, { sga4Sg, .233 }, H }; +N l7n219[] = { { sVg, .368 }, H }; +N l7n220[] = { { sa5B, .117 }, { sgacb0, .175 }, H }; +N l7n221[] = { { sa3g, .700 }, H }; +N l7n222[] = { { sa8c6g, .420 }, { sa4S, .117 }, { sgb0aa, .175 }, H }; +N l7n223[] = { { sXg, .747 }, H }; +N l7n224[] = { { s40g, .607 }, H }; +N l7n225[] = { { sgb8fb, .280 }, { sga4_, .245 }, H }; +N l7n227[] = { { sga4bd, .245 }, { sa5l, .163 }, H }; +N l7n228[] = { { sgc4, .443 }, { sga440g, .654 }, { sb8M, .187 }, { sa6cag, .315 }, { sacb0g, .263 }, { sbcg, .175 }, H }; +N l7n229[] = { { sgb5, .724 }, H }; +N l7n230[] = { { sga6, 2.521 }, { sa4n, .233 }, H }; +N l7n231[] = { { sb77eg, .473 }, H }; +N l7n232[] = { { sb9u, .327 }, { sgb8t, .245 }, H }; +N l7n234[] = { { sga9f3g, .513 }, { sf6g, .525 }, { sa6tg, .473 }, { sga8c6g, .373 }, H }; +N l7n235[] = { { sFg, .578 }, { sa6Xg, .420 }, H }; +N l7n236[] = { { sgb8Mg, .373 }, { sb4g, .175 }, H }; +N l7n240[] = { { saaba, .654 }, { sb4U, .350 }, { sa1X, .327 }, { sgb0g, .175 }, H }; +N l7n241[] = { { sga4a7, .245 }, { sa4ig, .368 }, { sgb6b1g, .280 }, H }; +N l7n242[] = { { sgabig, .233 }, H }; +N l7n243[] = { { sa578, .233 }, { sb8fb, .187 }, { sa4a7, .163 }, H }; +N l7n244[] = { { sacg, .245 }, { sga6cag, .280 }, H }; +N l7n245[] = { { sgc5, .187 }, H }; +N l7n246[] = { { sgb6, .934 }, { sng, .397 }, { sadD, .163 }, H }; +N l7n247[] = { { sga7, .864 }, { sga6b3g, .280 }, { sa4o, .140 }, H }; +N l7n248[] = { { sgachg, .233 }, H }; +N l7n250[] = { { sa9f3g, .578 }, { sacjg, .368 }, { sWg, .315 }, { sb0aag, .263 }, H }; +N l7n252[] = { { sa4g, .350 }, { sa6Yg, .525 }, { sa4c0g, .315 }, H }; +N l7n253[] = { { sga578, .350 }, { sa6b3, .187 }, H }; +N l7n254[] = { { sYg, .537 }, { sadfbg, .735 }, { sgb3ug, .420 }, { sgb0eag, .233 }, H }; +N l7n255[] = { { sga4ug, .607 }, { sa5hg, .420 }, H }; + +D l7_d = { "chinese", "big5", - { - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - 0.018,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,0.001,W,0.004,W, - 0.006,0.022,0.016,0.021,0.018,0.012,0.012,0.014,0.016,0.009,0.011,0.008,0.012,0.043,0.011,0.022, - 0.023,0.037,0.002,0.009,0.012,0.018,0.008,0.017,0.011,0.003,0.003,W,W,W,0.025,W, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - Y,0.129,Y,0.021,0.224,0.127,0.121,0.050,0.045,0.050,0.071,0.046,0.058,0.064,0.042,0.018, - 0.044,0.048,0.036,0.059,0.038,0.043,0.038,0.049,0.058,0.047,0.051,0.036,0.018,0.033,0.035,0.012, - 0.035,0.031,0.018,0.024,0.042,0.015,0.024,0.025,0.014,0.015,0.011,0.007,0.013,0.008,0.017,0.017, - 0.018,0.015,0.013,0.041,0.010,0.017,0.007,0.010,0.013,V,0.014,0.004,0.027,0.007,V,0.004, - 0.006,0.011,0.017,0.006,0.024,0.010,0.008,0.007,0.011,0.013,0.018,0.010,0.010,0.010,0.004,0.018, - 0.004,0.003,0.017,0.025,0.020,0.011,0.014,0.017,0.025,0.013,0.007,0.041,0.014,0.001,0.004,V - }, - { - l7n0,l7n1,X,l7n3,l7n4,X,X,l7n7,l7n8,l7n9,l7n10,l7n11,X,l7n13,l7n14,l7n15, - X,l7n17,l7n18,l7n19,X,l7n21,l7n22,l7n23,l7n24,l7n25,l7n26,l7n27,l7n28,l7n29,l7n30,X, - X,l7n33,l7n34,l7n35,l7n36,l7n37,l7n38,l7n39,l7n40,l7n41,l7n42,l7n43,l7n44,X,l7n46,X, - l7n48,l7n49,l7n50,l7n51,l7n52,l7n53,l7n54,X,l7n56,l7n57,l7n58,l7n59,l7n60,X,l7n62,l7n63, - l7n64,l7n65,X,l7n67,l7n68,X,l7n70,l7n71,l7n72,l7n73,l7n74,l7n75,l7n76,X,X,X, - l7n80,l7n81,l7n82,l7n83,X,l7n85,l7n86,l7n87,l7n88,l7n89,X,l7n91,l7n92,l7n93,l7n94,l7n95, - l7n96,l7n97,l7n98,l7n99,l7n100,X,l7n102,l7n103,l7n104,l7n105,l7n106,l7n107,X,l7n109,l7n110,l7n111, - l7n112,l7n113,l7n114,X,X,l7n117,l7n118,l7n119,l7n120,l7n121,l7n122,l7n123,l7n124,X,l7n126,l7n127, - l7n128,l7n129,X,X,l7n132,l7n133,l7n134,l7n135,l7n136,l7n137,l7n138,l7n139,l7n140,l7n141,l7n142,l7n143, - l7n144,l7n145,l7n146,l7n147,l7n148,l7n149,l7n150,l7n151,X,l7n153,l7n154,X,l7n156,X,l7n158,l7n159, - l7n160,l7n161,X,X,l7n164,X,l7n166,X,l7n168,l7n169,l7n170,l7n171,l7n172,l7n173,l7n174,l7n175, - l7n176,l7n177,l7n178,l7n179,l7n180,l7n181,l7n182,l7n183,l7n184,l7n185,l7n186,X,l7n188,l7n189,X,X, - l7n192,l7n193,l7n194,l7n195,l7n196,l7n197,X,l7n199,X,l7n201,X,l7n203,l7n204,l7n205,l7n206,l7n207, - l7n208,l7n209,l7n210,l7n211,l7n212,l7n213,X,l7n215,l7n216,l7n217,l7n218,l7n219,l7n220,l7n221,l7n222,l7n223, - l7n224,l7n225,X,l7n227,l7n228,l7n229,l7n230,l7n231,l7n232,X,l7n234,l7n235,l7n236,X,X,X, - l7n240,l7n241,l7n242,l7n243,l7n244,l7n245,l7n246,l7n247,l7n248,X,l7n250,X,l7n252,l7n253,l7n254,l7n255 - } + { W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + 0.018, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, 0.001, W, 0.004, W, + 0.006, 0.022, 0.016, 0.021, 0.018, 0.012, 0.012, 0.014, 0.016, 0.009, 0.011, 0.008, 0.012, 0.043, 0.011, 0.022, + 0.023, 0.037, 0.002, 0.009, 0.012, 0.018, 0.008, 0.017, 0.011, 0.003, 0.003, W, W, W, 0.025, W, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + Y, 0.129, Y, 0.021, 0.224, 0.127, 0.121, 0.050, 0.045, 0.050, 0.071, 0.046, 0.058, 0.064, 0.042, 0.018, + 0.044, 0.048, 0.036, 0.059, 0.038, 0.043, 0.038, 0.049, 0.058, 0.047, 0.051, 0.036, 0.018, 0.033, 0.035, 0.012, + 0.035, 0.031, 0.018, 0.024, 0.042, 0.015, 0.024, 0.025, 0.014, 0.015, 0.011, 0.007, 0.013, 0.008, 0.017, 0.017, + 0.018, 0.015, 0.013, 0.041, 0.010, 0.017, 0.007, 0.010, 0.013, V, 0.014, 0.004, 0.027, 0.007, V, 0.004, + 0.006, 0.011, 0.017, 0.006, 0.024, 0.010, 0.008, 0.007, 0.011, 0.013, 0.018, 0.010, 0.010, 0.010, 0.004, 0.018, + 0.004, 0.003, 0.017, 0.025, 0.020, 0.011, 0.014, 0.017, 0.025, 0.013, 0.007, 0.041, 0.014, 0.001, 0.004, V }, + { l7n0, l7n1, X, l7n3, l7n4, X, X, l7n7, l7n8, l7n9, l7n10, l7n11, X, l7n13, l7n14, l7n15, + X, l7n17, l7n18, l7n19, X, l7n21, l7n22, l7n23, l7n24, l7n25, l7n26, l7n27, l7n28, l7n29, l7n30, X, + X, l7n33, l7n34, l7n35, l7n36, l7n37, l7n38, l7n39, l7n40, l7n41, l7n42, l7n43, l7n44, X, l7n46, X, + l7n48, l7n49, l7n50, l7n51, l7n52, l7n53, l7n54, X, l7n56, l7n57, l7n58, l7n59, l7n60, X, l7n62, l7n63, + l7n64, l7n65, X, l7n67, l7n68, X, l7n70, l7n71, l7n72, l7n73, l7n74, l7n75, l7n76, X, X, X, + l7n80, l7n81, l7n82, l7n83, X, l7n85, l7n86, l7n87, l7n88, l7n89, X, l7n91, l7n92, l7n93, l7n94, l7n95, + l7n96, l7n97, l7n98, l7n99, l7n100, X, l7n102, l7n103, l7n104, l7n105, l7n106, l7n107, X, l7n109, l7n110, l7n111, + l7n112, l7n113, l7n114, X, X, l7n117, l7n118, l7n119, l7n120, l7n121, l7n122, l7n123, l7n124, X, l7n126, l7n127, + l7n128, l7n129, X, X, l7n132, l7n133, l7n134, l7n135, l7n136, l7n137, l7n138, l7n139, l7n140, l7n141, l7n142, l7n143, + l7n144, l7n145, l7n146, l7n147, l7n148, l7n149, l7n150, l7n151, X, l7n153, l7n154, X, l7n156, X, l7n158, l7n159, + l7n160, l7n161, X, X, l7n164, X, l7n166, X, l7n168, l7n169, l7n170, l7n171, l7n172, l7n173, l7n174, l7n175, + l7n176, l7n177, l7n178, l7n179, l7n180, l7n181, l7n182, l7n183, l7n184, l7n185, l7n186, X, l7n188, l7n189, X, X, + l7n192, l7n193, l7n194, l7n195, l7n196, l7n197, X, l7n199, X, l7n201, X, l7n203, l7n204, l7n205, l7n206, l7n207, + l7n208, l7n209, l7n210, l7n211, l7n212, l7n213, X, l7n215, l7n216, l7n217, l7n218, l7n219, l7n220, l7n221, l7n222, l7n223, + l7n224, l7n225, X, l7n227, l7n228, l7n229, l7n230, l7n231, l7n232, X, l7n234, l7n235, l7n236, X, X, X, + l7n240, l7n241, l7n242, l7n243, l7n244, l7n245, l7n246, l7n247, l7n248, X, l7n250, X, l7n252, l7n253, l7n254, l7n255 } }; - - // // Lng: chinese // Enc: gb2313 // - -S sga3[]={32,163,0}; -S sa3ac[]={163,172,0}; -S sga3ac[]={32,163,172,0}; -S sga3acg[]={32,163,172,a}; -S sa3acg[]={163,172,a}; -S sc4g[]={196,a}; -S sb5c4[]={181,196,0}; -S sb5c4g[]={181,196,a}; -S sgb5c4g[]={32,181,196,a}; -S sgb5c4[]={32,181,196,0}; -S sgG[]={32,214,0}; -S sa2g[]={162,a}; -S sgce[]={32,206,0}; -S sga1a3g[]={32,161,163,a}; -S sa1a3[]={161,163,0}; -S sa1a3g[]={161,163,a}; -S sga1a3[]={32,161,163,0}; -S scbg[]={203,a}; -S sgc9[]={32,201,0}; -S sfag[]={250,a}; -S sb9fa[]={185,250,0}; -S sc1cb[]={193,203,0}; -S sc1cbg[]={193,203,a}; -S sgcb[]={32,203,0}; -S sgcd[]={32,205,0}; -S sgc1cb[]={32,193,203,0}; -S sgc1cbg[]={32,193,203,a}; -S saeg[]={174,a}; -S sEK[]={212,218,0}; -S sga1a2g[]={32,161,162,a}; -S sa3b1[]={163,177,0}; -S sga3b1g[]={32,163,177,a}; -S sga3b0[]={32,163,176,0}; -S sa3b1g[]={163,177,a}; -S sga3b1[]={32,163,177,0}; -S sEKg[]={212,218,a}; -S sga3b0g[]={32,163,176,a}; -S sa1a2[]={161,162,0}; -S sb9fag[]={185,250,a}; -S sa1a2g[]={161,162,a}; -S sa3b0[]={163,176,0}; -S sa3b0g[]={163,176,a}; -S sga1a2[]={32,161,162,0}; -S sa3a4[]={163,164,0}; -S sc4ea[]={196,234,0}; -S sga3a4g[]={32,163,164,a}; -S sga3a4[]={32,163,164,0}; -S sa3a4g[]={163,164,a}; -S scdg[]={205,a}; -S sgEK[]={32,212,218,0}; -S sb9a4[]={185,164,0}; -S sAA[]={208,208,0}; -S sgcf[]={32,207,0}; -S sgEKg[]={32,212,218,a}; -S sgcc[]={32,204,0}; -S sHf7[]={215,247,0}; -S sb6g[]={182,a}; -S sfdg[]={253,a}; -S sc4eag[]={196,234,a}; -S sa3b5g[]={163,181,a}; -S sf1g[]={241,a}; -S sga3b5[]={32,163,181,0}; -S sga3b5g[]={32,163,181,a}; -S sa3b5[]={163,181,0}; -S sbacd[]={186,205,0}; -S sgc4ea[]={32,196,234,0}; -S sGA[]={214,208,0}; -S sHf7g[]={215,247,a}; -S sgc6[]={32,198,0}; -S sbfg[]={191,a}; -S sc3g[]={195,a}; -S sc9cf[]={201,207,0}; -S sbacdg[]={186,205,a}; -S sgbacdg[]={32,186,205,a}; -S sc3f1[]={195,241,0}; -S sb2bf[]={178,191,0}; -S sgbacd[]={32,186,205,0}; -S sc2g[]={194,a}; -S sgGA[]={32,214,208,0}; -S sFfe[]={213,254,0}; -S sc8cb[]={200,203,0}; -S sbda8[]={189,168,0}; -S sga3b9[]={32,163,185,0}; -S sa3b9g[]={163,185,a}; -S sb4f3[]={180,243,0}; -S sgc9cf[]={32,201,207,0}; -S sga3b9g[]={32,163,185,a}; -S sa6g[]={166,a}; -S sa3b9[]={163,185,0}; -S sAAg[]={208,208,a}; -S sb5bdg[]={181,189,a}; -S sb3f6g[]={179,246,a}; -S sbdf8[]={189,248,0}; -S sgFS[]={32,213,226,0}; -S sb3f6[]={179,246,0}; -S sb2fa[]={178,250,0}; -S sbbR[]={187,225,0}; -S sgFfe[]={32,213,254,0}; -S sgbda8[]={32,189,168,0}; -S sb5bd[]={181,189,0}; -S sgb9a4[]={32,185,164,0}; -S sbefc[]={190,252,0}; -S sgb9fa[]={32,185,250,0}; -S sc5g[]={197,a}; -S sb7a2[]={183,162,0}; -S sa4Hf7[]={164,215,247,0}; -S sb8f6g[]={184,246,a}; -S sgc8F[]={32,200,213,0}; -S sgb0Jg[]={32,176,217,a}; -S sc8F[]={200,213,0}; -S sgc4eag[]={32,196,234,a}; -S sb8f6[]={184,246,0}; -S sc0b4[]={192,180,0}; -S sb6Q[]={182,224,0}; -S sb7G[]={183,214,0}; -S sb9a4g[]={185,164,a}; -S scab1g[]={202,177,a}; -S sgb0J[]={32,176,217,0}; -S sc3c7[]={195,199,0}; -S sa4Hf7g[]={164,215,247,a}; -S sc0ed[]={192,237,0}; -S sb9a4Hf7[]={185,164,215,247,0}; -S scab1[]={202,177,0}; -S sb9a4H[]={185,164,215,0}; -S sCb5[]={210,181,0}; -S sa4H[]={164,215,0}; -S sc3c7g[]={195,199,a}; -S sgb9a4H[]={32,185,164,215,0}; -S sb0Jg[]={176,217,a}; -S sc9cfg[]={201,207,a}; -S sb0J[]={176,217,0}; -S sgbdf8[]={32,189,248,0}; -S sgb6Q[]={32,182,224,0}; -S sc3f1g[]={195,241,a}; -S sgceC[]={32,206,210,0}; -S sga3b4[]={32,163,180,0}; -S scdf2[]={205,242,0}; -S sa3a3[]={163,163,0}; -S sbeJ[]={190,217,0}; -S sgb7G[]={32,183,214,0}; -S sga3a3g[]={32,163,163,a}; -S sgc8Fg[]={32,200,213,a}; -S sgcbfb[]={32,203,251,0}; -S sgcdf2[]={32,205,242,0}; -S sa3a3g[]={163,163,a}; -S sFb9[]={213,185,0}; -S sga3b6g[]={32,163,182,a}; -S sgb9b2[]={32,185,178,0}; -S sgHf7[]={32,215,247,0}; -S sb6Qg[]={182,224,a}; -S sa3b4g[]={163,180,a}; -S sceC[]={206,210,0}; -S sc8Fg[]={200,213,a}; -S sa3b4[]={163,180,0}; -S sa3b6g[]={163,182,a}; -S sga3a3[]={32,163,163,0}; -S sa3b6[]={163,182,0}; -S sgcdf2g[]={32,205,242,a}; -S sgbeJ[]={32,190,217,0}; -S sb5Ig[]={181,216,a}; -S sgb6Qg[]={32,182,224,a}; -S sfeg[]={254,a}; -S sga3b6[]={32,163,182,0}; -S sgb5bd[]={32,181,189,0}; -S scbfb[]={203,251,0}; -S sb9b2[]={185,178,0}; -S sc0b4g[]={192,180,a}; -S sgb2bf[]={32,178,191,0}; -S sbfaa[]={191,170,0}; -S scdf2g[]={205,242,a}; -S sb2bb[]={178,187,0}; -S sgb5bdg[]={32,181,189,a}; -S sga3b4g[]={32,163,180,a}; -S sPg[]={223,a}; -S sgc9cfg[]={32,201,207,a}; -S sCb5g[]={210,181,a}; -S sbbfa[]={187,250,0}; -S sbcb8[]={188,184,0}; -S sgcab1[]={32,202,177,0}; -S sccR[]={204,225,0}; -S sCbb[]={210,187,0}; -S sDK[]={211,218,0}; -S sc5a9[]={197,169,0}; -S sgbcb8[]={32,188,184,0}; -S sf8AA[]={248,208,208,0}; -S sCe9[]={210,233,0}; -S sb2bfg[]={178,191,a}; -S sgb3f6[]={32,179,246,0}; -S sbcb8g[]={188,184,a}; -S sgb3f6g[]={32,179,246,a}; -S sga3b8[]={32,163,184,0}; -S sa3b8g[]={163,184,a}; -S sDAg[]={211,208,a}; -S sb3c9[]={179,201,0}; -S sFSg[]={213,226,a}; -S sgb9fd[]={32,185,253,0}; -S sbead[]={190,173,0}; -S sGf7[]={214,247,0}; -S sbbb9[]={187,185,0}; -S sgb7a2[]={32,183,162,0}; -S sgFSg[]={32,213,226,a}; -S sga3b8g[]={32,163,184,a}; -S sgc5a9[]={32,197,169,0}; -S sc9fa[]={201,250,0}; -S sAa1[]={208,161,0}; -S sc1a6g[]={193,166,a}; -S sc8eb[]={200,235,0}; -S sceca[]={206,202,0}; -S sf8A[]={248,208,0}; -S sb5c3[]={181,195,0}; -S sc7f8[]={199,248,0}; -S sc1aa[]={193,170,0}; -S sc8ebg[]={200,235,a}; -S sgAc2[]={32,208,194,0}; -S sbacf[]={186,207,0}; -S sGceg[]={214,206,a}; -S sgbefc[]={32,190,252,0}; -S sc8ab[]={200,171,0}; -S sb7Gg[]={183,214,a}; -S sc7f8g[]={199,248,a}; -S sgb2fa[]={32,178,250,0}; -S sbcca[]={188,202,0}; -S sb7bd[]={183,189,0}; -S sccS[]={204,226,0}; -S sCe9g[]={210,233,a}; -S sgb7Gg[]={32,183,214,a}; -S sGce[]={214,206,0}; -S sc1a6[]={193,166,0}; -S sgbfaa[]={32,191,170,0}; -S sb9fd[]={185,253,0}; -S scac2[]={202,194,0}; -S sa3b8[]={163,184,0}; -S sgbcb8g[]={32,188,184,a}; -S sgb2bb[]={32,178,187,0}; -S sgccR[]={32,204,225,0}; -S sccSg[]={204,226,a}; -S sgcab1g[]={32,202,177,a}; -S sAc2[]={208,194,0}; -S sgFfeG[]={32,213,254,214,0}; -S sEaa[]={212,170,0}; -S sb2fag[]={178,250,a}; -S sga1b1[]={32,161,177,0}; -S sgDAg[]={32,211,208,a}; -S sCbbg[]={210,187,a}; -S sa1b1[]={161,177,0}; -S sgGb0b9[]={32,214,176,185,0}; -S sgEaa[]={32,212,170,0}; -S sb0b9a4[]={176,185,164,0}; -S sga1b1g[]={32,161,177,a}; -S sa3b2g[]={163,178,a}; -S sGAg[]={214,208,a}; -S sGb0b9[]={214,176,185,0}; -S sgc1bd[]={32,193,189,0}; -S scfIg[]={207,216,a}; -S sfeG[]={254,214,0}; -S sfeGce[]={254,214,206,0}; -S sb7a8[]={183,168,0}; -S scecacc[]={206,202,204,0}; -S scfI[]={207,216,0}; -S sCBg[]={210,209,a}; -S scab5[]={202,181,0}; -S sgCbb[]={32,210,187,0}; -S sga3b2[]={32,163,178,0}; -S sgGae[]={32,214,174,0}; -S sc8a5[]={200,165,0}; -S sBa7g[]={209,167,a}; -S sgGAA[]={32,214,208,208,0}; -S se7bb[]={231,187,0}; -S sbcC[]={188,210,0}; -S scacc[]={202,204,0}; -S sb9b2g[]={185,178,a}; -S sgc8ab[]={32,200,171,0}; -S sDc3[]={211,195,0}; -S sa3ba[]={163,186,0}; -S sgbbb9g[]={32,187,185,a}; -S sc1bdg[]={193,189,a}; -S sCaa[]={210,170,0}; -S sb0b8[]={176,184,0}; -S sfeGceg[]={254,214,206,a}; -S sc3c5[]={195,197,0}; -S sgb6Eg[]={32,182,212,a}; -S sgCB[]={32,210,209,0}; -S sb3a4[]={179,164,0}; -S sgb8f6g[]={32,184,246,a}; -S sb6Eg[]={182,212,a}; -S sgccf5[]={32,204,245,0}; -S sb6E[]={182,212,0}; -S sgb8f6[]={32,184,246,0}; -S sfab9[]={250,185,0}; -S sgb4f3[]={32,180,243,0}; -S sbef6[]={190,246,0}; -S sa3b2[]={163,178,0}; -S sgHf7g[]={32,215,247,a}; - -N l8n0[]={{sAA,.497},H}; -N l8n1[]={{sb9fa,.538},{sa3a4g,.839},H}; -N l8n2[]={{scacc,.124},H}; -N l8n3[]={{sbdg,.745},{sb3f6,.166},H}; -N l8n4[]={{sgb5bd,.186},H}; -N l8n5[]={{sgF,.621},H}; -N l8n6[]={{sgc6,.228},{sgGA,.311},{sga3b9g,.373},{sa3b9,.186},{sb3c9,.104},{sgAc2,.155},H}; -N l8n7[]={{sgb7,.518},{sDK,.155},H}; -N l8n8[]={{sgb9fd,.155},H}; -N l8n9[]={{sf7g,.699},{sgbacd,.311},H}; -N l8n10[]={{sGg,.885},{sgb8f6g,.166},H}; -N l8n11[]={{sb5g,.870},{sbda8,.186},H}; -N l8n17[]={{sa3b4g,.280},{sefg,.186},H}; -N l8n18[]={{sceg,.652},{sAc2,.155},H}; -N l8n20[]={{sga3a3g,.248},{sFb9,.186},{sc5a9,.155},H}; -N l8n21[]={{sgbdf8,.186},H}; -N l8n22[]={{sgG,.787},{sc9cf,.311},{sccSg,.349},H}; -N l8n23[]={{sga3ac,2.454},{sgc7,.228},{sgccR,.155},{sa3ba,.083},H}; -N l8n24[]={{sgb8,.393},H}; -N l8n25[]={{se7g,.326},{sb0Jg,.326},H}; -N l8n26[]={{sGAg,.280},H}; -N l8n27[]={{sgFSg,.207},{sa5g,.124},H}; -N l8n30[]={{sgc9cf,.280},{sb6E,.083},H}; -N l8n31[]={{sga3a4g,.745},H}; -N l8n32[]={{sa4Hf7g,.435},{scecacc,.186},H}; -N l8n33[]={{sPg,.280},H}; -N l8n34[]={{sa3b5g,.559},H}; -N l8n35[]={{sbacd,.228},{sa4H,.145},H}; -N l8n36[]={{sgcbfb,.186},{sgHf7g,.166},H}; -N l8n38[]={{sEK,.621},H}; -N l8n39[]={{sgH,.600},H}; -N l8n40[]={{sgc8,.704},{sf8g,.466},{sb2fa,.166},H}; -N l8n41[]={{sa3ac,1.636},{sgb9,1.015},{sHg,.233},H}; -N l8n42[]={{sb6g,.404},H}; -N l8n44[]={{sga1b1,.124},H}; -N l8n45[]={{sFSg,.349},{sc8a5,.124},H}; -N l8n46[]={{sbcca,.104},H}; -N l8n48[]={{sf0g,.186},H}; -N l8n49[]={{scfg,.745},H}; -N l8n50[]={{saeg,.621},{sfeGceg,.373},H}; -N l8n51[]={{sa3b6g,.280},{sc8ebg,.349},{sgDAg,.166},H}; -N l8n52[]={{sc0b4,.217},{sc3c7g,.489},{sb9fd,.104},H}; -N l8n53[]={{sgb9a4,.248},H}; -N l8n55[]={{scab1,.217},H}; -N l8n56[]={{se8g,.326},{sgc5a9,.155},H}; -N l8n57[]={{sgc9,.621},{sc7g,.652},{sgb7G,.186},{sb9b2,.124},{sCbbg,.280},H}; -N l8n58[]={{sc1cbg,1.607},{sgba,.373},{sa6g,.280},H}; -N l8n61[]={{sb2bf,.207},H}; -N l8n63[]={{sbbfa,.104},H}; -N l8n64[]={{sQg,.419},{scbfb,.186},{sa1b1,.083},H}; -N l8n65[]={{sa1a2,.393},{sbfg,.342},H}; -N l8n66[]={{sgEaa,.124},H}; -N l8n67[]={{sga3b0,.590},{sb5I,.166},{sgb0Jg,.290},{sgcdf2g,.248},H}; -N l8n68[]={{sgbcb8,.155},{sAE,.155},H}; -N l8n69[]={{scdf2g,.419},{sbacf,.104},{sgcab1g,.207},{sgb4f3,.124},H}; -N l8n70[]={{sc4ea,.559},H}; -N l8n71[]={{sf9g,.233},{sCe9g,.349},H}; -N l8n72[]={{sIg,.839},H}; -N l8n73[]={{sb7g,.311},H}; -N l8n74[]={{sgca,.704},{sb6Qg,.280},H}; -N l8n75[]={{sgbb,.373},{sb9a4,.331},H}; -N l8n76[]={{sc1bdg,.280},H}; -N l8n78[]={{sga3b1,.590},H}; -N l8n79[]={{sb5c4g,2.423},{sf1g,.559},{sgc8F,.217},H}; -N l8n80[]={{sAg,1.072},H}; -N l8n81[]={{sgb5c4,1.584},{safg,.280},{sGf7,.155},{sb7a8,.083},H}; -N l8n82[]={{sa1a3,.642},{sgEK,.528},{sgc4eag,.290},{sgbefc,.155},H}; -N l8n85[]={{sgb3f6,.155},{sa3b8g,.233},H}; -N l8n87[]={{se9g,.652},H}; -N l8n88[]={{scac2,.155},{sbef6,.083},H}; -N l8n89[]={{sa7g,.217},{sga3b2,.124},H}; -N l8n91[]={{sgcb,.476},{sbdf8,.166},H}; -N l8n92[]={{sgbc,.538},{sbcb8g,.233},{sceca,.155},H}; -N l8n93[]={{sc8F,.217},{sDA,.155},H}; -N l8n95[]={{sb7G,.145},{sRg,.233},H}; -N l8n96[]={{sAAg,.559},{sc0g,.373},H}; -N l8n97[]={{sb9fag,.885},H}; -N l8n99[]={{sb3f6g,.373},H}; -N l8n100[]={{sgb5bdg,.248},{se7bb,.124},H}; -N l8n101[]={{sc1a6,.155},H}; -N l8n102[]={{sfag,1.305},{sa3b9g,.419},H}; -N l8n103[]={{sJg,.559},H}; -N l8n104[]={{sb8g,.466},H}; -N l8n105[]={{sgbacdg,.414},{scfI,.124},H}; -N l8n106[]={{sgc1cb,.621},H}; -N l8n107[]={{sbeJ,.124},{sbfaa,.124},H}; -N l8n108[]={{sgcc,.290},H}; -N l8n109[]={{sgbd,.787},{sa3b0,.393},{sb9a4Hf7,.290},H}; -N l8n110[]={{sf2g,.512},H}; -N l8n111[]={{sBg,.373},{sga3b4,.186},H}; -N l8n112[]={{sb0g,.839},{sHf7,.404},{sgb2fa,.155},H}; -N l8n113[]={{sgFfeG,.166},H}; -N l8n114[]={{sgb6Eg,.166},H}; -N l8n115[]={{sCb5,.217},H}; -N l8n118[]={{seag,.745},{sc9cfg,.489},{sgGAA,.166},H}; -N l8n119[]={{sga3acg,3.272},{sc9g,.326},H}; -N l8n120[]={{sa8g,.280},{sb5bd,.166},H}; -N l8n122[]={{sga3b5,.373},H}; -N l8n123[]={{scab5,.124},H}; -N l8n125[]={{sgcd,.456},H}; -N l8n126[]={{sgbe,.538},{sa3b1,.393},{sSg,.559},{sgc9cfg,.248},{sb6Eg,.186},H}; -N l8n127[]={{sbead,.104},H}; -N l8n128[]={{sDc3,.124},H}; -N l8n129[]={{sgc8ab,.124},H}; -N l8n131[]={{sbacdg,.466},H}; -N l8n133[]={{sfbg,.419},{sga3b6,.186},H}; -N l8n134[]={{sKg,1.584},{sEKg,1.328},H}; -N l8n135[]={{sb9g,.745},{sga1a2,.590},H}; -N l8n136[]={{sb9a4H,.217},{sb2fag,.186},{sb0b8,.083},H}; -N l8n137[]={{sa3acg,3.681},H}; -N l8n140[]={{sga1b1g,.166},H}; -N l8n141[]={{sf3g,.466},{sGb0b9,.186},H}; -N l8n142[]={{sgce,.683},{sCg,.280},H}; -N l8n143[]={{sb1g,1.118},{sgbf,.269},{sfab9,.124},{sa3b2,.083},H}; -N l8n144[]={{sgb0,.559},{sa3a3,.124},{sgGae,.124},H}; -N l8n145[]={{sga1,1.222},{sc7f8,.155},{sb3a4,.083},H}; -N l8n146[]={{sga1a3,.963},H}; -N l8n147[]={{sc8ab,.155},H}; -N l8n148[]={{sgceC,.186},{sc0b4g,.419},H}; -N l8n149[]={{sebg,.792},H}; -N l8n150[]={{sbbR,.166},{sgb6Q,.186},{scag,.233},H}; -N l8n151[]={{scab1g,.489},{sa9g,.186},H}; -N l8n152[]={{sGce,.155},H}; -N l8n153[]={{sgb7Gg,.207},{sb9b2g,.186},H}; -N l8n155[]={{sga3b8,.155},H}; -N l8n157[]={{sb2bfg,.233},H}; -N l8n158[]={{sc3f1,.311},{sc2g,.466},{sb8f6,.145},{sgbbb9g,.166},H}; -N l8n159[]={{sgcf,.331},{sa1g,.280},H}; -N l8n160[]={{sgc0,.331},H}; -N l8n161[]={{sa1a2g,.885},{sa3a4,.373},{sgb1,.373},H}; -N l8n163[]={{sga3b0g,.787},{sb5Ig,.280},H}; -N l8n164[]={{sfcg,.326},{sgbcb8g,.207},H}; -N l8n165[]={{sgbda8,.248},{sccR,.155},{sLg,.233},{sb0b9a4,.124},H}; -N l8n166[]={{sc4eag,.909},{sga3b9,.280},{sbag,.217},H}; -N l8n169[]={{sFfe,.311},{sc1aa,.155},H}; -N l8n170[]={{sgb8f6,.124},H}; -N l8n171[]={{sb9a4g,.326},H}; -N l8n172[]={{sf4g,.186},H}; -N l8n173[]={{sDg,.466},H}; -N l8n174[]={{sga3b1g,.787},{sb2g,.342},H}; -N l8n175[]={{sgc8Fg,.248},{sCBg,.280},H}; -N l8n176[]={{sgA,.393},H}; -N l8n177[]={{sgb5c4g,2.112},{sgc1,.745},{sa3b4,.124},H}; -N l8n178[]={{sa1a3g,1.444},{sgb2,.559},{sgEKg,.663},{sc3c5,.124},H}; -N l8n179[]={{sga3,3.976},{sc8cb,.280},H}; -N l8n180[]={{secg,.373},{sga3a3,.186},H}; -N l8n181[]={{scbg,1.398},{sgb3f6g,.207},H}; -N l8n182[]={{saag,.652},{sb7bd,.104},{sccS,.155},{sbcC,.083},H}; -N l8n184[]={{sCaa,.124},H}; -N l8n185[]={{sb0J,.145},H}; -N l8n186[]={{sGA,.342},{sgb9a4H,.290},H}; -N l8n187[]={{sgFS,.248},{sgb2bb,.155},H}; -N l8n188[]={{sUg,.373},H}; -N l8n189[]={{sc3g,.466},{sc8Fg,.419},{sDAg,.349},H}; -N l8n190[]={{sa2g,1.025},{sbefc,.166},H}; -N l8n191[]={{sga3a4,.559},{sb9I,.124},{sb7Gg,.233},H}; -N l8n192[]={{sa4Hf7,.217},H}; -N l8n193[]={{sgB,.186},H}; -N l8n194[]={{sa3b5,.248},{sgc2,.145},H}; -N l8n195[]={{sgb3,.331},{sfdg,.606},H}; -N l8n196[]={{sgHf7,.186},{sMg,.280},H}; -N l8n197[]={{sbbg,.342},{sc1a6g,.349},H}; -N l8n198[]={{sBa7g,.280},H}; -N l8n200[]={{sf8AA,.233},H}; -N l8n201[]={{scfIg,.280},H}; -N l8n202[]={{sgc1cbg,.828},H}; -N l8n203[]={{sf5g,.466},H}; -N l8n204[]={{sEg,.606},H}; -N l8n205[]={{sa3b0g,.885},{sb3g,.280},{sFS,.248},{sgCB,.124},H}; -N l8n207[]={{sgb9b2,.186},{sga3b4g,.248},H}; -N l8n208[]={{sHf7g,.769},{sgc1bd,.124},H}; -N l8n209[]={{sgbeJ,.186},{sgGb0b9,.166},H}; -N l8n210[]={{sgC,.538},{sfeGce,.186},H}; -N l8n211[]={{sgc3,.311},{sa3b6,.124},{sCb5g,.419},{sedg,.233},{sc8eb,.155},H}; -N l8n212[]={{sgb4,.311},{sc3c7,.217},{sccg,.280},H}; -N l8n213[]={{sabg,.373},H}; -N l8n216[]={{sb5bdg,.373},{sf8A,.155},H}; -N l8n217[]={{sCbb,.155},H}; -N l8n218[]={{sc1cb,.714},{sga3b5g,.497},H}; -N l8n219[]={{sVg,.280},{sgCbb,.124},H}; -N l8n220[]={{sc4g,2.562},H}; -N l8n221[]={{sa3g,1.273},{sgbfaa,.155},H}; -N l8n222[]={{sa3b1g,.885},{sb5c3,.104},H}; -N l8n225[]={{sAa1,.155},H}; -N l8n226[]={{sfeg,.280},H}; -N l8n227[]={{sgD,.435},{sgb0J,.217},{sgcdf2,.186},H}; -N l8n228[]={{sgc4,.393},{sbcg,.373},{sceC,.186},H}; -N l8n229[]={{sgb5,1.760},{scdf2,.186},{sga3b6g,.248},{sgcab1,.155},H}; -N l8n231[]={{sga1a2g,.787},{sgb9fa,.248},{sgb2bf,.186},{sCe9,.155},H}; -N l8n234[]={{sf6g,.978},{sb6Q,.145},H}; -N l8n235[]={{sFg,.512},{sb7a2,.145},H}; -N l8n236[]={{sb4g,.404},H}; -N l8n238[]={{sbbb9,.104},H}; -N l8n239[]={{sb5c4,1.077},{sb4f3,.186},{sgFfe,.248},{sa3b2g,.186},H}; -N l8n240[]={{sa3a3g,.280},H}; -N l8n241[]={{sc9fa,.155},{sc7f8g,.349},H}; -N l8n242[]={{sga1a3g,1.284},{sgc4ea,.342},{seeg,.280},H}; -N l8n243[]={{scdg,.839},{sgccf5,.124},H}; -N l8n244[]={{sacg,2.485},{sgE,.642},H}; -N l8n245[]={{sgc5,.228},{sa3b8,.104},H}; -N l8n246[]={{sgb6,.456},{sgb6Qg,.248},{sEaa,.124},H}; -N l8n248[]={{sGceg,.349},{sfeG,.124},H}; -N l8n249[]={{sb2bb,.124},H}; -N l8n251[]={{sc5g,.373},{sga3b8g,.207},H}; -N l8n252[]={{sa4g,.870},{sbcb8,.104},H}; -N l8n253[]={{sc0ed,.217},{sgb7a2,.155},H}; -N l8n254[]={{sb8f6g,.326},{sc3f1g,.419},H}; - -D l8_d = -{ +S sga3[] = { 32, 163, 0 }; +S sa3ac[] = { 163, 172, 0 }; +S sga3ac[] = { 32, 163, 172, 0 }; +S sga3acg[] = { 32, 163, 172, a }; +S sa3acg[] = { 163, 172, a }; +S sc4g[] = { 196, a }; +S sb5c4[] = { 181, 196, 0 }; +S sb5c4g[] = { 181, 196, a }; +S sgb5c4g[] = { 32, 181, 196, a }; +S sgb5c4[] = { 32, 181, 196, 0 }; +S sgG[] = { 32, 214, 0 }; +S sa2g[] = { 162, a }; +S sgce[] = { 32, 206, 0 }; +S sga1a3g[] = { 32, 161, 163, a }; +S sa1a3[] = { 161, 163, 0 }; +S sa1a3g[] = { 161, 163, a }; +S sga1a3[] = { 32, 161, 163, 0 }; +S scbg[] = { 203, a }; +S sgc9[] = { 32, 201, 0 }; +S sfag[] = { 250, a }; +S sb9fa[] = { 185, 250, 0 }; +S sc1cb[] = { 193, 203, 0 }; +S sc1cbg[] = { 193, 203, a }; +S sgcb[] = { 32, 203, 0 }; +S sgcd[] = { 32, 205, 0 }; +S sgc1cb[] = { 32, 193, 203, 0 }; +S sgc1cbg[] = { 32, 193, 203, a }; +S saeg[] = { 174, a }; +S sEK[] = { 212, 218, 0 }; +S sga1a2g[] = { 32, 161, 162, a }; +S sa3b1[] = { 163, 177, 0 }; +S sga3b1g[] = { 32, 163, 177, a }; +S sga3b0[] = { 32, 163, 176, 0 }; +S sa3b1g[] = { 163, 177, a }; +S sga3b1[] = { 32, 163, 177, 0 }; +S sEKg[] = { 212, 218, a }; +S sga3b0g[] = { 32, 163, 176, a }; +S sa1a2[] = { 161, 162, 0 }; +S sb9fag[] = { 185, 250, a }; +S sa1a2g[] = { 161, 162, a }; +S sa3b0[] = { 163, 176, 0 }; +S sa3b0g[] = { 163, 176, a }; +S sga1a2[] = { 32, 161, 162, 0 }; +S sa3a4[] = { 163, 164, 0 }; +S sc4ea[] = { 196, 234, 0 }; +S sga3a4g[] = { 32, 163, 164, a }; +S sga3a4[] = { 32, 163, 164, 0 }; +S sa3a4g[] = { 163, 164, a }; +S scdg[] = { 205, a }; +S sgEK[] = { 32, 212, 218, 0 }; +S sb9a4[] = { 185, 164, 0 }; +S sAA[] = { 208, 208, 0 }; +S sgcf[] = { 32, 207, 0 }; +S sgEKg[] = { 32, 212, 218, a }; +S sgcc[] = { 32, 204, 0 }; +S sHf7[] = { 215, 247, 0 }; +S sb6g[] = { 182, a }; +S sfdg[] = { 253, a }; +S sc4eag[] = { 196, 234, a }; +S sa3b5g[] = { 163, 181, a }; +S sf1g[] = { 241, a }; +S sga3b5[] = { 32, 163, 181, 0 }; +S sga3b5g[] = { 32, 163, 181, a }; +S sa3b5[] = { 163, 181, 0 }; +S sbacd[] = { 186, 205, 0 }; +S sgc4ea[] = { 32, 196, 234, 0 }; +S sGA[] = { 214, 208, 0 }; +S sHf7g[] = { 215, 247, a }; +S sgc6[] = { 32, 198, 0 }; +S sbfg[] = { 191, a }; +S sc3g[] = { 195, a }; +S sc9cf[] = { 201, 207, 0 }; +S sbacdg[] = { 186, 205, a }; +S sgbacdg[] = { 32, 186, 205, a }; +S sc3f1[] = { 195, 241, 0 }; +S sb2bf[] = { 178, 191, 0 }; +S sgbacd[] = { 32, 186, 205, 0 }; +S sc2g[] = { 194, a }; +S sgGA[] = { 32, 214, 208, 0 }; +S sFfe[] = { 213, 254, 0 }; +S sc8cb[] = { 200, 203, 0 }; +S sbda8[] = { 189, 168, 0 }; +S sga3b9[] = { 32, 163, 185, 0 }; +S sa3b9g[] = { 163, 185, a }; +S sb4f3[] = { 180, 243, 0 }; +S sgc9cf[] = { 32, 201, 207, 0 }; +S sga3b9g[] = { 32, 163, 185, a }; +S sa6g[] = { 166, a }; +S sa3b9[] = { 163, 185, 0 }; +S sAAg[] = { 208, 208, a }; +S sb5bdg[] = { 181, 189, a }; +S sb3f6g[] = { 179, 246, a }; +S sbdf8[] = { 189, 248, 0 }; +S sgFS[] = { 32, 213, 226, 0 }; +S sb3f6[] = { 179, 246, 0 }; +S sb2fa[] = { 178, 250, 0 }; +S sbbR[] = { 187, 225, 0 }; +S sgFfe[] = { 32, 213, 254, 0 }; +S sgbda8[] = { 32, 189, 168, 0 }; +S sb5bd[] = { 181, 189, 0 }; +S sgb9a4[] = { 32, 185, 164, 0 }; +S sbefc[] = { 190, 252, 0 }; +S sgb9fa[] = { 32, 185, 250, 0 }; +S sc5g[] = { 197, a }; +S sb7a2[] = { 183, 162, 0 }; +S sa4Hf7[] = { 164, 215, 247, 0 }; +S sb8f6g[] = { 184, 246, a }; +S sgc8F[] = { 32, 200, 213, 0 }; +S sgb0Jg[] = { 32, 176, 217, a }; +S sc8F[] = { 200, 213, 0 }; +S sgc4eag[] = { 32, 196, 234, a }; +S sb8f6[] = { 184, 246, 0 }; +S sc0b4[] = { 192, 180, 0 }; +S sb6Q[] = { 182, 224, 0 }; +S sb7G[] = { 183, 214, 0 }; +S sb9a4g[] = { 185, 164, a }; +S scab1g[] = { 202, 177, a }; +S sgb0J[] = { 32, 176, 217, 0 }; +S sc3c7[] = { 195, 199, 0 }; +S sa4Hf7g[] = { 164, 215, 247, a }; +S sc0ed[] = { 192, 237, 0 }; +S sb9a4Hf7[] = { 185, 164, 215, 247, 0 }; +S scab1[] = { 202, 177, 0 }; +S sb9a4H[] = { 185, 164, 215, 0 }; +S sCb5[] = { 210, 181, 0 }; +S sa4H[] = { 164, 215, 0 }; +S sc3c7g[] = { 195, 199, a }; +S sgb9a4H[] = { 32, 185, 164, 215, 0 }; +S sb0Jg[] = { 176, 217, a }; +S sc9cfg[] = { 201, 207, a }; +S sb0J[] = { 176, 217, 0 }; +S sgbdf8[] = { 32, 189, 248, 0 }; +S sgb6Q[] = { 32, 182, 224, 0 }; +S sc3f1g[] = { 195, 241, a }; +S sgceC[] = { 32, 206, 210, 0 }; +S sga3b4[] = { 32, 163, 180, 0 }; +S scdf2[] = { 205, 242, 0 }; +S sa3a3[] = { 163, 163, 0 }; +S sbeJ[] = { 190, 217, 0 }; +S sgb7G[] = { 32, 183, 214, 0 }; +S sga3a3g[] = { 32, 163, 163, a }; +S sgc8Fg[] = { 32, 200, 213, a }; +S sgcbfb[] = { 32, 203, 251, 0 }; +S sgcdf2[] = { 32, 205, 242, 0 }; +S sa3a3g[] = { 163, 163, a }; +S sFb9[] = { 213, 185, 0 }; +S sga3b6g[] = { 32, 163, 182, a }; +S sgb9b2[] = { 32, 185, 178, 0 }; +S sgHf7[] = { 32, 215, 247, 0 }; +S sb6Qg[] = { 182, 224, a }; +S sa3b4g[] = { 163, 180, a }; +S sceC[] = { 206, 210, 0 }; +S sc8Fg[] = { 200, 213, a }; +S sa3b4[] = { 163, 180, 0 }; +S sa3b6g[] = { 163, 182, a }; +S sga3a3[] = { 32, 163, 163, 0 }; +S sa3b6[] = { 163, 182, 0 }; +S sgcdf2g[] = { 32, 205, 242, a }; +S sgbeJ[] = { 32, 190, 217, 0 }; +S sb5Ig[] = { 181, 216, a }; +S sgb6Qg[] = { 32, 182, 224, a }; +S sfeg[] = { 254, a }; +S sga3b6[] = { 32, 163, 182, 0 }; +S sgb5bd[] = { 32, 181, 189, 0 }; +S scbfb[] = { 203, 251, 0 }; +S sb9b2[] = { 185, 178, 0 }; +S sc0b4g[] = { 192, 180, a }; +S sgb2bf[] = { 32, 178, 191, 0 }; +S sbfaa[] = { 191, 170, 0 }; +S scdf2g[] = { 205, 242, a }; +S sb2bb[] = { 178, 187, 0 }; +S sgb5bdg[] = { 32, 181, 189, a }; +S sga3b4g[] = { 32, 163, 180, a }; +S sPg[] = { 223, a }; +S sgc9cfg[] = { 32, 201, 207, a }; +S sCb5g[] = { 210, 181, a }; +S sbbfa[] = { 187, 250, 0 }; +S sbcb8[] = { 188, 184, 0 }; +S sgcab1[] = { 32, 202, 177, 0 }; +S sccR[] = { 204, 225, 0 }; +S sCbb[] = { 210, 187, 0 }; +S sDK[] = { 211, 218, 0 }; +S sc5a9[] = { 197, 169, 0 }; +S sgbcb8[] = { 32, 188, 184, 0 }; +S sf8AA[] = { 248, 208, 208, 0 }; +S sCe9[] = { 210, 233, 0 }; +S sb2bfg[] = { 178, 191, a }; +S sgb3f6[] = { 32, 179, 246, 0 }; +S sbcb8g[] = { 188, 184, a }; +S sgb3f6g[] = { 32, 179, 246, a }; +S sga3b8[] = { 32, 163, 184, 0 }; +S sa3b8g[] = { 163, 184, a }; +S sDAg[] = { 211, 208, a }; +S sb3c9[] = { 179, 201, 0 }; +S sFSg[] = { 213, 226, a }; +S sgb9fd[] = { 32, 185, 253, 0 }; +S sbead[] = { 190, 173, 0 }; +S sGf7[] = { 214, 247, 0 }; +S sbbb9[] = { 187, 185, 0 }; +S sgb7a2[] = { 32, 183, 162, 0 }; +S sgFSg[] = { 32, 213, 226, a }; +S sga3b8g[] = { 32, 163, 184, a }; +S sgc5a9[] = { 32, 197, 169, 0 }; +S sc9fa[] = { 201, 250, 0 }; +S sAa1[] = { 208, 161, 0 }; +S sc1a6g[] = { 193, 166, a }; +S sc8eb[] = { 200, 235, 0 }; +S sceca[] = { 206, 202, 0 }; +S sf8A[] = { 248, 208, 0 }; +S sb5c3[] = { 181, 195, 0 }; +S sc7f8[] = { 199, 248, 0 }; +S sc1aa[] = { 193, 170, 0 }; +S sc8ebg[] = { 200, 235, a }; +S sgAc2[] = { 32, 208, 194, 0 }; +S sbacf[] = { 186, 207, 0 }; +S sGceg[] = { 214, 206, a }; +S sgbefc[] = { 32, 190, 252, 0 }; +S sc8ab[] = { 200, 171, 0 }; +S sb7Gg[] = { 183, 214, a }; +S sc7f8g[] = { 199, 248, a }; +S sgb2fa[] = { 32, 178, 250, 0 }; +S sbcca[] = { 188, 202, 0 }; +S sb7bd[] = { 183, 189, 0 }; +S sccS[] = { 204, 226, 0 }; +S sCe9g[] = { 210, 233, a }; +S sgb7Gg[] = { 32, 183, 214, a }; +S sGce[] = { 214, 206, 0 }; +S sc1a6[] = { 193, 166, 0 }; +S sgbfaa[] = { 32, 191, 170, 0 }; +S sb9fd[] = { 185, 253, 0 }; +S scac2[] = { 202, 194, 0 }; +S sa3b8[] = { 163, 184, 0 }; +S sgbcb8g[] = { 32, 188, 184, a }; +S sgb2bb[] = { 32, 178, 187, 0 }; +S sgccR[] = { 32, 204, 225, 0 }; +S sccSg[] = { 204, 226, a }; +S sgcab1g[] = { 32, 202, 177, a }; +S sAc2[] = { 208, 194, 0 }; +S sgFfeG[] = { 32, 213, 254, 214, 0 }; +S sEaa[] = { 212, 170, 0 }; +S sb2fag[] = { 178, 250, a }; +S sga1b1[] = { 32, 161, 177, 0 }; +S sgDAg[] = { 32, 211, 208, a }; +S sCbbg[] = { 210, 187, a }; +S sa1b1[] = { 161, 177, 0 }; +S sgGb0b9[] = { 32, 214, 176, 185, 0 }; +S sgEaa[] = { 32, 212, 170, 0 }; +S sb0b9a4[] = { 176, 185, 164, 0 }; +S sga1b1g[] = { 32, 161, 177, a }; +S sa3b2g[] = { 163, 178, a }; +S sGAg[] = { 214, 208, a }; +S sGb0b9[] = { 214, 176, 185, 0 }; +S sgc1bd[] = { 32, 193, 189, 0 }; +S scfIg[] = { 207, 216, a }; +S sfeG[] = { 254, 214, 0 }; +S sfeGce[] = { 254, 214, 206, 0 }; +S sb7a8[] = { 183, 168, 0 }; +S scecacc[] = { 206, 202, 204, 0 }; +S scfI[] = { 207, 216, 0 }; +S sCBg[] = { 210, 209, a }; +S scab5[] = { 202, 181, 0 }; +S sgCbb[] = { 32, 210, 187, 0 }; +S sga3b2[] = { 32, 163, 178, 0 }; +S sgGae[] = { 32, 214, 174, 0 }; +S sc8a5[] = { 200, 165, 0 }; +S sBa7g[] = { 209, 167, a }; +S sgGAA[] = { 32, 214, 208, 208, 0 }; +S se7bb[] = { 231, 187, 0 }; +S sbcC[] = { 188, 210, 0 }; +S scacc[] = { 202, 204, 0 }; +S sb9b2g[] = { 185, 178, a }; +S sgc8ab[] = { 32, 200, 171, 0 }; +S sDc3[] = { 211, 195, 0 }; +S sa3ba[] = { 163, 186, 0 }; +S sgbbb9g[] = { 32, 187, 185, a }; +S sc1bdg[] = { 193, 189, a }; +S sCaa[] = { 210, 170, 0 }; +S sb0b8[] = { 176, 184, 0 }; +S sfeGceg[] = { 254, 214, 206, a }; +S sc3c5[] = { 195, 197, 0 }; +S sgb6Eg[] = { 32, 182, 212, a }; +S sgCB[] = { 32, 210, 209, 0 }; +S sb3a4[] = { 179, 164, 0 }; +S sgb8f6g[] = { 32, 184, 246, a }; +S sb6Eg[] = { 182, 212, a }; +S sgccf5[] = { 32, 204, 245, 0 }; +S sb6E[] = { 182, 212, 0 }; +S sgb8f6[] = { 32, 184, 246, 0 }; +S sfab9[] = { 250, 185, 0 }; +S sgb4f3[] = { 32, 180, 243, 0 }; +S sbef6[] = { 190, 246, 0 }; +S sa3b2[] = { 163, 178, 0 }; +S sgHf7g[] = { 32, 215, 247, a }; + +N l8n0[] = { { sAA, .497 }, H }; +N l8n1[] = { { sb9fa, .538 }, { sa3a4g, .839 }, H }; +N l8n2[] = { { scacc, .124 }, H }; +N l8n3[] = { { sbdg, .745 }, { sb3f6, .166 }, H }; +N l8n4[] = { { sgb5bd, .186 }, H }; +N l8n5[] = { { sgF, .621 }, H }; +N l8n6[] = { { sgc6, .228 }, { sgGA, .311 }, { sga3b9g, .373 }, { sa3b9, .186 }, { sb3c9, .104 }, { sgAc2, .155 }, H }; +N l8n7[] = { { sgb7, .518 }, { sDK, .155 }, H }; +N l8n8[] = { { sgb9fd, .155 }, H }; +N l8n9[] = { { sf7g, .699 }, { sgbacd, .311 }, H }; +N l8n10[] = { { sGg, .885 }, { sgb8f6g, .166 }, H }; +N l8n11[] = { { sb5g, .870 }, { sbda8, .186 }, H }; +N l8n17[] = { { sa3b4g, .280 }, { sefg, .186 }, H }; +N l8n18[] = { { sceg, .652 }, { sAc2, .155 }, H }; +N l8n20[] = { { sga3a3g, .248 }, { sFb9, .186 }, { sc5a9, .155 }, H }; +N l8n21[] = { { sgbdf8, .186 }, H }; +N l8n22[] = { { sgG, .787 }, { sc9cf, .311 }, { sccSg, .349 }, H }; +N l8n23[] = { { sga3ac, 2.454 }, { sgc7, .228 }, { sgccR, .155 }, { sa3ba, .083 }, H }; +N l8n24[] = { { sgb8, .393 }, H }; +N l8n25[] = { { se7g, .326 }, { sb0Jg, .326 }, H }; +N l8n26[] = { { sGAg, .280 }, H }; +N l8n27[] = { { sgFSg, .207 }, { sa5g, .124 }, H }; +N l8n30[] = { { sgc9cf, .280 }, { sb6E, .083 }, H }; +N l8n31[] = { { sga3a4g, .745 }, H }; +N l8n32[] = { { sa4Hf7g, .435 }, { scecacc, .186 }, H }; +N l8n33[] = { { sPg, .280 }, H }; +N l8n34[] = { { sa3b5g, .559 }, H }; +N l8n35[] = { { sbacd, .228 }, { sa4H, .145 }, H }; +N l8n36[] = { { sgcbfb, .186 }, { sgHf7g, .166 }, H }; +N l8n38[] = { { sEK, .621 }, H }; +N l8n39[] = { { sgH, .600 }, H }; +N l8n40[] = { { sgc8, .704 }, { sf8g, .466 }, { sb2fa, .166 }, H }; +N l8n41[] = { { sa3ac, 1.636 }, { sgb9, 1.015 }, { sHg, .233 }, H }; +N l8n42[] = { { sb6g, .404 }, H }; +N l8n44[] = { { sga1b1, .124 }, H }; +N l8n45[] = { { sFSg, .349 }, { sc8a5, .124 }, H }; +N l8n46[] = { { sbcca, .104 }, H }; +N l8n48[] = { { sf0g, .186 }, H }; +N l8n49[] = { { scfg, .745 }, H }; +N l8n50[] = { { saeg, .621 }, { sfeGceg, .373 }, H }; +N l8n51[] = { { sa3b6g, .280 }, { sc8ebg, .349 }, { sgDAg, .166 }, H }; +N l8n52[] = { { sc0b4, .217 }, { sc3c7g, .489 }, { sb9fd, .104 }, H }; +N l8n53[] = { { sgb9a4, .248 }, H }; +N l8n55[] = { { scab1, .217 }, H }; +N l8n56[] = { { se8g, .326 }, { sgc5a9, .155 }, H }; +N l8n57[] = { { sgc9, .621 }, { sc7g, .652 }, { sgb7G, .186 }, { sb9b2, .124 }, { sCbbg, .280 }, H }; +N l8n58[] = { { sc1cbg, 1.607 }, { sgba, .373 }, { sa6g, .280 }, H }; +N l8n61[] = { { sb2bf, .207 }, H }; +N l8n63[] = { { sbbfa, .104 }, H }; +N l8n64[] = { { sQg, .419 }, { scbfb, .186 }, { sa1b1, .083 }, H }; +N l8n65[] = { { sa1a2, .393 }, { sbfg, .342 }, H }; +N l8n66[] = { { sgEaa, .124 }, H }; +N l8n67[] = { { sga3b0, .590 }, { sb5I, .166 }, { sgb0Jg, .290 }, { sgcdf2g, .248 }, H }; +N l8n68[] = { { sgbcb8, .155 }, { sAE, .155 }, H }; +N l8n69[] = { { scdf2g, .419 }, { sbacf, .104 }, { sgcab1g, .207 }, { sgb4f3, .124 }, H }; +N l8n70[] = { { sc4ea, .559 }, H }; +N l8n71[] = { { sf9g, .233 }, { sCe9g, .349 }, H }; +N l8n72[] = { { sIg, .839 }, H }; +N l8n73[] = { { sb7g, .311 }, H }; +N l8n74[] = { { sgca, .704 }, { sb6Qg, .280 }, H }; +N l8n75[] = { { sgbb, .373 }, { sb9a4, .331 }, H }; +N l8n76[] = { { sc1bdg, .280 }, H }; +N l8n78[] = { { sga3b1, .590 }, H }; +N l8n79[] = { { sb5c4g, 2.423 }, { sf1g, .559 }, { sgc8F, .217 }, H }; +N l8n80[] = { { sAg, 1.072 }, H }; +N l8n81[] = { { sgb5c4, 1.584 }, { safg, .280 }, { sGf7, .155 }, { sb7a8, .083 }, H }; +N l8n82[] = { { sa1a3, .642 }, { sgEK, .528 }, { sgc4eag, .290 }, { sgbefc, .155 }, H }; +N l8n85[] = { { sgb3f6, .155 }, { sa3b8g, .233 }, H }; +N l8n87[] = { { se9g, .652 }, H }; +N l8n88[] = { { scac2, .155 }, { sbef6, .083 }, H }; +N l8n89[] = { { sa7g, .217 }, { sga3b2, .124 }, H }; +N l8n91[] = { { sgcb, .476 }, { sbdf8, .166 }, H }; +N l8n92[] = { { sgbc, .538 }, { sbcb8g, .233 }, { sceca, .155 }, H }; +N l8n93[] = { { sc8F, .217 }, { sDA, .155 }, H }; +N l8n95[] = { { sb7G, .145 }, { sRg, .233 }, H }; +N l8n96[] = { { sAAg, .559 }, { sc0g, .373 }, H }; +N l8n97[] = { { sb9fag, .885 }, H }; +N l8n99[] = { { sb3f6g, .373 }, H }; +N l8n100[] = { { sgb5bdg, .248 }, { se7bb, .124 }, H }; +N l8n101[] = { { sc1a6, .155 }, H }; +N l8n102[] = { { sfag, 1.305 }, { sa3b9g, .419 }, H }; +N l8n103[] = { { sJg, .559 }, H }; +N l8n104[] = { { sb8g, .466 }, H }; +N l8n105[] = { { sgbacdg, .414 }, { scfI, .124 }, H }; +N l8n106[] = { { sgc1cb, .621 }, H }; +N l8n107[] = { { sbeJ, .124 }, { sbfaa, .124 }, H }; +N l8n108[] = { { sgcc, .290 }, H }; +N l8n109[] = { { sgbd, .787 }, { sa3b0, .393 }, { sb9a4Hf7, .290 }, H }; +N l8n110[] = { { sf2g, .512 }, H }; +N l8n111[] = { { sBg, .373 }, { sga3b4, .186 }, H }; +N l8n112[] = { { sb0g, .839 }, { sHf7, .404 }, { sgb2fa, .155 }, H }; +N l8n113[] = { { sgFfeG, .166 }, H }; +N l8n114[] = { { sgb6Eg, .166 }, H }; +N l8n115[] = { { sCb5, .217 }, H }; +N l8n118[] = { { seag, .745 }, { sc9cfg, .489 }, { sgGAA, .166 }, H }; +N l8n119[] = { { sga3acg, 3.272 }, { sc9g, .326 }, H }; +N l8n120[] = { { sa8g, .280 }, { sb5bd, .166 }, H }; +N l8n122[] = { { sga3b5, .373 }, H }; +N l8n123[] = { { scab5, .124 }, H }; +N l8n125[] = { { sgcd, .456 }, H }; +N l8n126[] = { { sgbe, .538 }, { sa3b1, .393 }, { sSg, .559 }, { sgc9cfg, .248 }, { sb6Eg, .186 }, H }; +N l8n127[] = { { sbead, .104 }, H }; +N l8n128[] = { { sDc3, .124 }, H }; +N l8n129[] = { { sgc8ab, .124 }, H }; +N l8n131[] = { { sbacdg, .466 }, H }; +N l8n133[] = { { sfbg, .419 }, { sga3b6, .186 }, H }; +N l8n134[] = { { sKg, 1.584 }, { sEKg, 1.328 }, H }; +N l8n135[] = { { sb9g, .745 }, { sga1a2, .590 }, H }; +N l8n136[] = { { sb9a4H, .217 }, { sb2fag, .186 }, { sb0b8, .083 }, H }; +N l8n137[] = { { sa3acg, 3.681 }, H }; +N l8n140[] = { { sga1b1g, .166 }, H }; +N l8n141[] = { { sf3g, .466 }, { sGb0b9, .186 }, H }; +N l8n142[] = { { sgce, .683 }, { sCg, .280 }, H }; +N l8n143[] = { { sb1g, 1.118 }, { sgbf, .269 }, { sfab9, .124 }, { sa3b2, .083 }, H }; +N l8n144[] = { { sgb0, .559 }, { sa3a3, .124 }, { sgGae, .124 }, H }; +N l8n145[] = { { sga1, 1.222 }, { sc7f8, .155 }, { sb3a4, .083 }, H }; +N l8n146[] = { { sga1a3, .963 }, H }; +N l8n147[] = { { sc8ab, .155 }, H }; +N l8n148[] = { { sgceC, .186 }, { sc0b4g, .419 }, H }; +N l8n149[] = { { sebg, .792 }, H }; +N l8n150[] = { { sbbR, .166 }, { sgb6Q, .186 }, { scag, .233 }, H }; +N l8n151[] = { { scab1g, .489 }, { sa9g, .186 }, H }; +N l8n152[] = { { sGce, .155 }, H }; +N l8n153[] = { { sgb7Gg, .207 }, { sb9b2g, .186 }, H }; +N l8n155[] = { { sga3b8, .155 }, H }; +N l8n157[] = { { sb2bfg, .233 }, H }; +N l8n158[] = { { sc3f1, .311 }, { sc2g, .466 }, { sb8f6, .145 }, { sgbbb9g, .166 }, H }; +N l8n159[] = { { sgcf, .331 }, { sa1g, .280 }, H }; +N l8n160[] = { { sgc0, .331 }, H }; +N l8n161[] = { { sa1a2g, .885 }, { sa3a4, .373 }, { sgb1, .373 }, H }; +N l8n163[] = { { sga3b0g, .787 }, { sb5Ig, .280 }, H }; +N l8n164[] = { { sfcg, .326 }, { sgbcb8g, .207 }, H }; +N l8n165[] = { { sgbda8, .248 }, { sccR, .155 }, { sLg, .233 }, { sb0b9a4, .124 }, H }; +N l8n166[] = { { sc4eag, .909 }, { sga3b9, .280 }, { sbag, .217 }, H }; +N l8n169[] = { { sFfe, .311 }, { sc1aa, .155 }, H }; +N l8n170[] = { { sgb8f6, .124 }, H }; +N l8n171[] = { { sb9a4g, .326 }, H }; +N l8n172[] = { { sf4g, .186 }, H }; +N l8n173[] = { { sDg, .466 }, H }; +N l8n174[] = { { sga3b1g, .787 }, { sb2g, .342 }, H }; +N l8n175[] = { { sgc8Fg, .248 }, { sCBg, .280 }, H }; +N l8n176[] = { { sgA, .393 }, H }; +N l8n177[] = { { sgb5c4g, 2.112 }, { sgc1, .745 }, { sa3b4, .124 }, H }; +N l8n178[] = { { sa1a3g, 1.444 }, { sgb2, .559 }, { sgEKg, .663 }, { sc3c5, .124 }, H }; +N l8n179[] = { { sga3, 3.976 }, { sc8cb, .280 }, H }; +N l8n180[] = { { secg, .373 }, { sga3a3, .186 }, H }; +N l8n181[] = { { scbg, 1.398 }, { sgb3f6g, .207 }, H }; +N l8n182[] = { { saag, .652 }, { sb7bd, .104 }, { sccS, .155 }, { sbcC, .083 }, H }; +N l8n184[] = { { sCaa, .124 }, H }; +N l8n185[] = { { sb0J, .145 }, H }; +N l8n186[] = { { sGA, .342 }, { sgb9a4H, .290 }, H }; +N l8n187[] = { { sgFS, .248 }, { sgb2bb, .155 }, H }; +N l8n188[] = { { sUg, .373 }, H }; +N l8n189[] = { { sc3g, .466 }, { sc8Fg, .419 }, { sDAg, .349 }, H }; +N l8n190[] = { { sa2g, 1.025 }, { sbefc, .166 }, H }; +N l8n191[] = { { sga3a4, .559 }, { sb9I, .124 }, { sb7Gg, .233 }, H }; +N l8n192[] = { { sa4Hf7, .217 }, H }; +N l8n193[] = { { sgB, .186 }, H }; +N l8n194[] = { { sa3b5, .248 }, { sgc2, .145 }, H }; +N l8n195[] = { { sgb3, .331 }, { sfdg, .606 }, H }; +N l8n196[] = { { sgHf7, .186 }, { sMg, .280 }, H }; +N l8n197[] = { { sbbg, .342 }, { sc1a6g, .349 }, H }; +N l8n198[] = { { sBa7g, .280 }, H }; +N l8n200[] = { { sf8AA, .233 }, H }; +N l8n201[] = { { scfIg, .280 }, H }; +N l8n202[] = { { sgc1cbg, .828 }, H }; +N l8n203[] = { { sf5g, .466 }, H }; +N l8n204[] = { { sEg, .606 }, H }; +N l8n205[] = { { sa3b0g, .885 }, { sb3g, .280 }, { sFS, .248 }, { sgCB, .124 }, H }; +N l8n207[] = { { sgb9b2, .186 }, { sga3b4g, .248 }, H }; +N l8n208[] = { { sHf7g, .769 }, { sgc1bd, .124 }, H }; +N l8n209[] = { { sgbeJ, .186 }, { sgGb0b9, .166 }, H }; +N l8n210[] = { { sgC, .538 }, { sfeGce, .186 }, H }; +N l8n211[] = { { sgc3, .311 }, { sa3b6, .124 }, { sCb5g, .419 }, { sedg, .233 }, { sc8eb, .155 }, H }; +N l8n212[] = { { sgb4, .311 }, { sc3c7, .217 }, { sccg, .280 }, H }; +N l8n213[] = { { sabg, .373 }, H }; +N l8n216[] = { { sb5bdg, .373 }, { sf8A, .155 }, H }; +N l8n217[] = { { sCbb, .155 }, H }; +N l8n218[] = { { sc1cb, .714 }, { sga3b5g, .497 }, H }; +N l8n219[] = { { sVg, .280 }, { sgCbb, .124 }, H }; +N l8n220[] = { { sc4g, 2.562 }, H }; +N l8n221[] = { { sa3g, 1.273 }, { sgbfaa, .155 }, H }; +N l8n222[] = { { sa3b1g, .885 }, { sb5c3, .104 }, H }; +N l8n225[] = { { sAa1, .155 }, H }; +N l8n226[] = { { sfeg, .280 }, H }; +N l8n227[] = { { sgD, .435 }, { sgb0J, .217 }, { sgcdf2, .186 }, H }; +N l8n228[] = { { sgc4, .393 }, { sbcg, .373 }, { sceC, .186 }, H }; +N l8n229[] = { { sgb5, 1.760 }, { scdf2, .186 }, { sga3b6g, .248 }, { sgcab1, .155 }, H }; +N l8n231[] = { { sga1a2g, .787 }, { sgb9fa, .248 }, { sgb2bf, .186 }, { sCe9, .155 }, H }; +N l8n234[] = { { sf6g, .978 }, { sb6Q, .145 }, H }; +N l8n235[] = { { sFg, .512 }, { sb7a2, .145 }, H }; +N l8n236[] = { { sb4g, .404 }, H }; +N l8n238[] = { { sbbb9, .104 }, H }; +N l8n239[] = { { sb5c4, 1.077 }, { sb4f3, .186 }, { sgFfe, .248 }, { sa3b2g, .186 }, H }; +N l8n240[] = { { sa3a3g, .280 }, H }; +N l8n241[] = { { sc9fa, .155 }, { sc7f8g, .349 }, H }; +N l8n242[] = { { sga1a3g, 1.284 }, { sgc4ea, .342 }, { seeg, .280 }, H }; +N l8n243[] = { { scdg, .839 }, { sgccf5, .124 }, H }; +N l8n244[] = { { sacg, 2.485 }, { sgE, .642 }, H }; +N l8n245[] = { { sgc5, .228 }, { sa3b8, .104 }, H }; +N l8n246[] = { { sgb6, .456 }, { sgb6Qg, .248 }, { sEaa, .124 }, H }; +N l8n248[] = { { sGceg, .349 }, { sfeG, .124 }, H }; +N l8n249[] = { { sb2bb, .124 }, H }; +N l8n251[] = { { sc5g, .373 }, { sga3b8g, .207 }, H }; +N l8n252[] = { { sa4g, .870 }, { sbcb8, .104 }, H }; +N l8n253[] = { { sc0ed, .217 }, { sgb7a2, .155 }, H }; +N l8n254[] = { { sb8f6g, .326 }, { sc3f1g, .419 }, H }; + +D l8_d = { "chinese", "gb2313", - { - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - Y,0.062,0.035,0.196,0.036,0.008,0.008,0.008,0.018,0.015,0.027,0.017,0.071,0.012,0.020,0.012, - 0.055,0.055,0.052,0.041,0.034,0.117,0.041,0.045,0.041,0.093,0.031,0.048,0.053,0.065,0.043,0.037, - 0.042,0.073,0.041,0.062,0.112,0.032,0.036,0.048,0.073,0.065,0.087,0.087,0.040,0.063,0.080,0.072, - 0.096,0.039,0.075,0.062,0.071,0.081,0.102,0.070,0.035,0.025,0.052,0.010,0.015,0.005,0.005,0.011, - 0.020,0.021,0.024,0.007,0.016,0.014,0.006,0.016,0.014,0.021,0.030,0.024,0.016,0.021,0.012,0.011, - 0.005,0.025,0.019,0.024,0.006,0.016,0.030,0.036,0.026,0.012,0.060,0.021,0.020,0.026,0.020,V - }, - { - l8n0,l8n1,l8n2,l8n3,l8n4,l8n5,l8n6,l8n7,l8n8,l8n9,l8n10,l8n11,X,X,X,X, - X,l8n17,l8n18,X,l8n20,l8n21,l8n22,l8n23,l8n24,l8n25,l8n26,l8n27,X,X,l8n30,l8n31, - l8n32,l8n33,l8n34,l8n35,l8n36,X,l8n38,l8n39,l8n40,l8n41,l8n42,X,l8n44,l8n45,l8n46,X, - l8n48,l8n49,l8n50,l8n51,l8n52,l8n53,X,l8n55,l8n56,l8n57,l8n58,X,X,l8n61,X,l8n63, - l8n64,l8n65,l8n66,l8n67,l8n68,l8n69,l8n70,l8n71,l8n72,l8n73,l8n74,l8n75,l8n76,X,l8n78,l8n79, - l8n80,l8n81,l8n82,X,X,l8n85,X,l8n87,l8n88,l8n89,X,l8n91,l8n92,l8n93,X,l8n95, - l8n96,l8n97,X,l8n99,l8n100,l8n101,l8n102,l8n103,l8n104,l8n105,l8n106,l8n107,l8n108,l8n109,l8n110,l8n111, - l8n112,l8n113,l8n114,l8n115,X,X,l8n118,l8n119,l8n120,X,l8n122,l8n123,X,l8n125,l8n126,l8n127, - l8n128,l8n129,X,l8n131,X,l8n133,l8n134,l8n135,l8n136,l8n137,X,X,l8n140,l8n141,l8n142,l8n143, - l8n144,l8n145,l8n146,l8n147,l8n148,l8n149,l8n150,l8n151,l8n152,l8n153,X,l8n155,X,l8n157,l8n158,l8n159, - l8n160,l8n161,X,l8n163,l8n164,l8n165,l8n166,X,X,l8n169,l8n170,l8n171,l8n172,l8n173,l8n174,l8n175, - l8n176,l8n177,l8n178,l8n179,l8n180,l8n181,l8n182,X,l8n184,l8n185,l8n186,l8n187,l8n188,l8n189,l8n190,l8n191, - l8n192,l8n193,l8n194,l8n195,l8n196,l8n197,l8n198,X,l8n200,l8n201,l8n202,l8n203,l8n204,l8n205,X,l8n207, - l8n208,l8n209,l8n210,l8n211,l8n212,l8n213,X,X,l8n216,l8n217,l8n218,l8n219,l8n220,l8n221,l8n222,X, - X,l8n225,l8n226,l8n227,l8n228,l8n229,X,l8n231,X,X,l8n234,l8n235,l8n236,X,l8n238,l8n239, - l8n240,l8n241,l8n242,l8n243,l8n244,l8n245,l8n246,X,l8n248,l8n249,X,l8n251,l8n252,l8n253,l8n254,X - } + { W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + Y, 0.062, 0.035, 0.196, 0.036, 0.008, 0.008, 0.008, 0.018, 0.015, 0.027, 0.017, 0.071, 0.012, 0.020, 0.012, + 0.055, 0.055, 0.052, 0.041, 0.034, 0.117, 0.041, 0.045, 0.041, 0.093, 0.031, 0.048, 0.053, 0.065, 0.043, 0.037, + 0.042, 0.073, 0.041, 0.062, 0.112, 0.032, 0.036, 0.048, 0.073, 0.065, 0.087, 0.087, 0.040, 0.063, 0.080, 0.072, + 0.096, 0.039, 0.075, 0.062, 0.071, 0.081, 0.102, 0.070, 0.035, 0.025, 0.052, 0.010, 0.015, 0.005, 0.005, 0.011, + 0.020, 0.021, 0.024, 0.007, 0.016, 0.014, 0.006, 0.016, 0.014, 0.021, 0.030, 0.024, 0.016, 0.021, 0.012, 0.011, + 0.005, 0.025, 0.019, 0.024, 0.006, 0.016, 0.030, 0.036, 0.026, 0.012, 0.060, 0.021, 0.020, 0.026, 0.020, V }, + { l8n0, l8n1, l8n2, l8n3, l8n4, l8n5, l8n6, l8n7, l8n8, l8n9, l8n10, l8n11, X, X, X, X, + X, l8n17, l8n18, X, l8n20, l8n21, l8n22, l8n23, l8n24, l8n25, l8n26, l8n27, X, X, l8n30, l8n31, + l8n32, l8n33, l8n34, l8n35, l8n36, X, l8n38, l8n39, l8n40, l8n41, l8n42, X, l8n44, l8n45, l8n46, X, + l8n48, l8n49, l8n50, l8n51, l8n52, l8n53, X, l8n55, l8n56, l8n57, l8n58, X, X, l8n61, X, l8n63, + l8n64, l8n65, l8n66, l8n67, l8n68, l8n69, l8n70, l8n71, l8n72, l8n73, l8n74, l8n75, l8n76, X, l8n78, l8n79, + l8n80, l8n81, l8n82, X, X, l8n85, X, l8n87, l8n88, l8n89, X, l8n91, l8n92, l8n93, X, l8n95, + l8n96, l8n97, X, l8n99, l8n100, l8n101, l8n102, l8n103, l8n104, l8n105, l8n106, l8n107, l8n108, l8n109, l8n110, l8n111, + l8n112, l8n113, l8n114, l8n115, X, X, l8n118, l8n119, l8n120, X, l8n122, l8n123, X, l8n125, l8n126, l8n127, + l8n128, l8n129, X, l8n131, X, l8n133, l8n134, l8n135, l8n136, l8n137, X, X, l8n140, l8n141, l8n142, l8n143, + l8n144, l8n145, l8n146, l8n147, l8n148, l8n149, l8n150, l8n151, l8n152, l8n153, X, l8n155, X, l8n157, l8n158, l8n159, + l8n160, l8n161, X, l8n163, l8n164, l8n165, l8n166, X, X, l8n169, l8n170, l8n171, l8n172, l8n173, l8n174, l8n175, + l8n176, l8n177, l8n178, l8n179, l8n180, l8n181, l8n182, X, l8n184, l8n185, l8n186, l8n187, l8n188, l8n189, l8n190, l8n191, + l8n192, l8n193, l8n194, l8n195, l8n196, l8n197, l8n198, X, l8n200, l8n201, l8n202, l8n203, l8n204, l8n205, X, l8n207, + l8n208, l8n209, l8n210, l8n211, l8n212, l8n213, X, X, l8n216, l8n217, l8n218, l8n219, l8n220, l8n221, l8n222, X, + X, l8n225, l8n226, l8n227, l8n228, l8n229, X, l8n231, X, X, l8n234, l8n235, l8n236, X, l8n238, l8n239, + l8n240, l8n241, l8n242, l8n243, l8n244, l8n245, l8n246, X, l8n248, l8n249, X, l8n251, l8n252, l8n253, l8n254, X } }; - - // // Lng: croatian // Enc: ascii // - -S sgni[]={32,j,e,0}; -S sgnig[]={32,j,e,a}; -S smni[]={i,j,e,0}; -S ssz[]={o,v,0}; -S sZ79[]={99,y,0}; -S s7a79[]={z,y,0}; -S sXs[]={97,o,0}; -S spn[]={l,j,0}; -S srig[]={n,e,a}; -S sXsg[]={97,o,a}; -S s79X[]={y,97,0}; -S srsg[]={n,o,a}; -S ssn[]={o,j,0}; -S sXz[]={97,v,0}; -S spsg[]={l,o,a}; -S sgyg[]={32,u,a}; -S swxs[]={s,t,o,0}; -S sgZ79[]={32,99,y,0}; -S sxsg[]={t,o,a}; -S soXo[]={k,97,k,0}; -S spni[]={l,j,e,0}; -S s79m[]={y,i,0}; -S smnig[]={i,j,e,a}; -S sg7aX[]={32,z,97,0}; -S snXg[]={j,97,a}; -S sZn[]={99,j,0}; -S swz[]={s,v,0}; -S smqg[]={i,m,a}; -S sqXg[]={m,97,a}; -S smrw[]={i,n,s,0}; -S sgYmp[]={32,98,i,l,0}; -S skp[]={g,l,0}; -S swyg[]={s,u,a}; -S sgwy[]={32,s,u,0}; -S sosn[]={k,o,j,0}; -S sgwz[]={32,s,v,0}; -S srwx[]={n,s,t,0}; -S sgrXg[]={32,n,97,a}; -S swp[]={s,l,0}; -S sw79x[]={s,y,t,0}; -S smqX[]={i,m,97,0}; -S spmg[]={l,i,a}; -S smrwx[]={i,n,s,t,0}; -S sgosn[]={32,k,o,j,0}; -S s79x[]={y,t,0}; -S sg_mr[]={32,w,i,n,0}; -S s_mr[]={w,i,n,0}; -S shn[]={d,j,0}; -S smps[]={i,l,o,0}; -S sgtvm[]={32,p,r,i,0}; -S sgks[]={32,g,o,0}; -S s7aXg[]={z,97,a}; -S smsg[]={i,o,a}; -S srwxs[]={n,s,t,o,0}; -S sniw[]={j,e,s,0}; -S s_mrw[]={w,i,n,s,0}; -S sxsr[]={t,o,n,0}; -S stvm[]={p,r,i,0}; -S swxsr[]={s,t,o,n,0}; -S sgsw[]={32,o,s,0}; -S sgwyg[]={32,s,u,a}; -S sxr[]={t,n,0}; -S sxz[]={t,v,0}; -S szmn[]={v,i,j,0}; -S sqni[]={m,j,e,0}; -S smpsg[]={i,l,o,a}; -S swxm[]={s,t,i,0}; -S snir[]={j,e,n,0}; -S sg7a79[]={32,z,y,0}; -S soXos[]={k,97,k,o,0}; -S s79i[]={y,e,0}; -S szni[]={v,j,e,0}; -S sxsrg[]={t,o,n,a}; -S sqn[]={m,j,0}; -S szn[]={v,j,0}; -S szsg[]={v,o,a}; -S srni[]={n,j,e,0}; -S sryg[]={n,u,a}; -S sZ79X[]={99,y,97,0}; -S spy[]={l,u,0}; -S sswx[]={o,s,t,0}; -S sqyg[]={m,u,a}; -S sgoXo[]={32,k,97,k,0}; -S smlg[]={i,h,a}; -S siZn[]={e,99,j,0}; -S s7aq[]={z,m,0}; -S sYs[]={98,o,0}; -S sw79xs[]={s,y,t,o,0}; -S s79xs[]={y,t,o,0}; -S srmn[]={n,i,j,0}; -S snyg[]={j,u,a}; -S srsz[]={n,o,v,0}; -S sml[]={i,h,0}; -S s79xsg[]={y,t,o,a}; -S sYmps[]={98,i,l,o,0}; -S snio[]={j,e,k,0}; -S siw79[]={e,s,y,0}; -S svmn[]={r,i,j,0}; -S sniog[]={j,e,k,a}; -S sXpsg[]={97,l,o,a}; -S sXzX[]={97,v,97,0}; -S srmni[]={n,i,j,e,0}; -S srio[]={n,e,k,0}; -S sXhX[]={97,d,97,0}; -S s7a79X[]={z,y,97,0}; -S sspn[]={o,l,j,0}; -S soXsg[]={k,97,o,a}; -S snih[]={j,e,d,0}; -S szmni[]={v,i,j,e,0}; -S sw79X[]={s,y,97,0}; -S spnX[]={l,j,97,0}; -S sXps[]={97,l,o,0}; -S sqmw[]={m,i,s,0}; -S sgriw[]={32,n,e,s,0}; -S sghv[]={32,d,r,0}; -S s79r[]={y,n,0}; -S ss7a[]={o,z,0}; -S srmq[]={n,i,m,0}; -S syt[]={u,p,0}; -S sgxsg[]={32,t,o,a}; -S sgpm[]={32,l,i,0}; -S syZ[]={u,99,0}; -S sg7aXg[]={32,z,97,a}; -S sy7a79[]={u,z,y,0}; -S sgkp[]={32,g,l,0}; -S syh[]={u,d,0}; -S sZnX[]={99,j,97,0}; -S soXs[]={k,97,o,0}; -S szsv[]={v,o,r,0}; -S s7a79m[]={z,y,i,0}; -S sriw[]={n,e,s,0}; -S syk[]={u,g,0}; -S sspni[]={o,l,j,e,0}; -S snXsg[]={j,97,o,a}; -S sgrio[]={32,n,e,k,0}; -S sgwxX[]={32,s,t,97,0}; -S sszs[]={o,v,o,0}; -S snXs[]={j,97,o,0}; -S stp[]={p,l,0}; -S sYy[]={98,u,0}; -S shr[]={d,n,0}; -S szig[]={v,e,a}; -S sniZ[]={j,e,99,0}; -S sgqyg[]={32,m,u,a}; -S svyk[]={r,u,g,0}; -S stmw[]={p,i,s,0}; -S sgov[]={32,k,r,0}; -S smqXg[]={i,m,97,a}; -S smwt[]={i,s,p,0}; -S sxo[]={t,k,0}; -S sksh[]={g,o,d,0}; -S ssvm[]={o,r,i,0}; -S sioX[]={e,k,97,0}; -S srmqg[]={n,i,m,a}; -S sxXp[]={t,97,l,0}; -S svXx[]={r,97,t,0}; -S soXoz[]={k,97,k,v,0}; -S sXoz[]={97,k,v,0}; -S sszm[]={o,v,i,0}; -S sixm[]={e,t,i,0}; -S sZig[]={99,e,a}; -S snmg[]={j,i,a}; -S sgwp[]={32,s,l,0}; -S shvy[]={d,r,u,0}; -S sgwg[]={32,s,a}; -S snix[]={j,e,t,0}; -S sgoXs[]={32,k,97,o,0}; -S sXrs[]={97,n,o,0}; -S sksz[]={g,o,v,0}; -S swxmg[]={s,t,i,a}; -S sgrmn[]={32,n,i,j,0}; -S soz[]={k,v,0}; -S siw79x[]={e,s,y,t,0}; -S sirs[]={e,n,o,0}; -S sgkXg[]={32,g,97,a}; -S sghvy[]={32,d,r,u,0}; -S stvmn[]={p,r,i,j,0}; -S sXhg[]={97,d,a}; -S sgkX[]={32,g,97,0}; -S sqniw[]={m,j,e,s,0}; -S sniZn[]={j,e,99,j,0}; -S sXpmg[]={97,l,i,a}; -S smnX[]={i,j,97,0}; -S ssni[]={o,j,e,0}; -S sxzs[]={t,v,o,0}; -S srsw[]={n,o,s,0}; -S spnig[]={l,j,e,a}; - -N l9n0[]={{szmni,.175},{svyk,.112},H}; -N l9n1[]={{stX,.150},H}; -N l9n2[]={{swig,.477},{syk,.087},H}; -N l9n3[]={{ssv,.262},{s7aq,.100},H}; -N l9n4[]={{sqXg,.365},{ssZ,.087},H}; -N l9n5[]={{sxm,.399},{smr,.362},{sgyg,.533},H}; -N l9n6[]={{sZ79,.362},{srx,.112},H}; -N l9n7[]={{sri,.661},{sZn,.175},H}; -N l9n8[]={{swo,.137},{smpsg,.337},{srmni,.175},H}; -N l9n9[]={{szsg,.252},H}; -N l9n10[]={{sniZn,.150},H}; -N l9n12[]={{sgp,.280},{sszs,.131},{snXs,.131},{sirm,.112},H}; -N l9n13[]={{sXr,.449},{spm,.386},{swg,.150},H}; -N l9n14[]={{ssqg,.421},H}; -N l9n15[]={{sghXg,.860},H}; -N l9n16[]={{sswx,.168},{sXpsg,.262},H}; -N l9n17[]={{srsg,.617},{siz,.137},{siw79,.150},H}; -N l9n18[]={{swyg,.337},{sik,.100},{sZig,.168},H}; -N l9n20[]={{ssw,.349},H}; -N l9n21[]={{sgts,.561},{sog,.374},{ssh,.212},{shm,.175},H}; -N l9n22[]={{sms,.150},H}; -N l9n23[]={{sry,.237},{sgm7a,.280},H}; -N l9n24[]={{smni,.598},{s79X,.287},H}; -N l9n25[]={{swp,.150},H}; -N l9n27[]={{szXg,.224},H}; -N l9n28[]={{s_mr,.187},{svr,.112},H}; -N l9n29[]={{sgq,.636},{sqmw,.131},H}; -N l9n30[]={{sXs,.312},{spn,.312},H}; -N l9n31[]={{smqX,.206},{ssrg,.280},H}; -N l9n32[]={{s79xs,.150},H}; -N l9n33[]={{sw79X,.131},{sxXp,.112},H}; -N l9n34[]={{stv,.374},H}; -N l9n35[]={{srXg,.617},H}; -N l9n36[]={{swxm,.168},{sgqy,.252},{snio,.150},{sksh,.112},H}; -N l9n37[]={{sg7aX,.393},{sxsr,.187},{ssx,.087},H}; -N l9n38[]={{sgoX,.561},{shn,.125},H}; -N l9n39[]={{sxo,.075},{sgwp,.168},H}; -N l9n41[]={{sgYmp,.449},H}; -N l9n42[]={{smwt,.112},H}; -N l9n43[]={{sspn,.131},{soXs,.131},H}; -N l9n44[]={{sqm,.199},{sxg,.131},H}; -N l9n45[]={{svs,.224},{sg7a79,.252},H}; -N l9n46[]={{sgr,1.384},H}; -N l9n47[]={{sXt,.087},{snmg,.168},H}; -N l9n48[]={{sgsw,.280},H}; -N l9n49[]={{sZ79X,.168},H}; -N l9n50[]={{sZnX,.131},H}; -N l9n54[]={{sgtv,.757},H}; -N l9n55[]={{s7aX,.249},H}; -N l9n57[]={{sgmg,.617},H}; -N l9n58[]={{sgwig,.598},{sXog,.224},H}; -N l9n59[]={{svXx,.112},H}; -N l9n60[]={{shg,.187},H}; -N l9n61[]={{sqn,.112},{sYs,.100},H}; -N l9n62[]={{srwxs,.249},H}; -N l9n63[]={{sgs,.879},{svX,.436},{sw79xs,.199},H}; -N l9n65[]={{sgni,1.599},H}; -N l9n66[]={{sgkXg,.224},H}; -N l9n67[]={{szm,.324},H}; -N l9n69[]={{sy7a,.150},{snir,.168},H}; -N l9n71[]={{snX,.486},{ssz,.362},H}; -N l9n72[]={{ssk,.287},H}; -N l9n73[]={{sghs,.309},{smv,.087},{spnX,.131},H}; -N l9n74[]={{smZ,.175},{sg_m,.280},{skXg,.196},H}; -N l9n75[]={{syg,1.477},{srm,.486},H}; -N l9n76[]={{soXos,.224},{sws,.112},H}; -N l9n78[]={{spmZ,.150},{sirs,.112},H}; -N l9n79[]={{sYX,.075},H}; -N l9n80[]={{sgt,1.234},H}; -N l9n81[]={{sXv,.212},{sgX,.299},H}; -N l9n82[]={{smrwx,.274},{s7a79m,.131},H}; -N l9n83[]={{sqg,.617},H}; -N l9n84[]={{sos,.636},{smqg,.365},{szn,.112},H}; -N l9n85[]={{si7a,.100},{svmn,.150},H}; -N l9n86[]={{sio,.312},H}; -N l9n88[]={{sqyg,.224},H}; -N l9n89[]={{sgrX,.449},{sgxs,.224},H}; -N l9n90[]={{smw,.374},{sxr,.125},{sspni,.175},{srmqg,.224},H}; -N l9n91[]={{sig,2.898},{s79x,.137},{smh,.087},{sgkp,.196},H}; -N l9n92[]={{srn,.212},{s79i,.112},{siZn,.150},H}; -N l9n93[]={{swt,.100},H}; -N l9n94[]={{swX,.249},H}; -N l9n95[]={{szig,.196},H}; -N l9n97[]={{soXoz,.150},H}; -N l9n98[]={{sgY,.542},{sXw,.125},{s_m,.125},H}; -N l9n99[]={{sXh,.237},H}; -N l9n101[]={{sxmg,.477},{sgtvi,.299},H}; -N l9n102[]={{soX,.449},{swxs,.355},H}; -N l9n103[]={{srig,.645},{sip,.187},{sgoXo,.299},H}; -N l9n106[]={{sghv,.196},{shr,.087},H}; -N l9n107[]={{sxs,.511},{smx,.150},H}; -N l9n108[]={{snXsg,.262},H}; -N l9n109[]={{spmg,.309},{siw79x,.150},H}; -N l9n110[]={{sXpm,.150},H}; -N l9n113[]={{sgtvm,.374},H}; -N l9n114[]={{srg,.280},{sgv,.224},{sixm,.112},H}; -N l9n115[]={{sps,.436},{sgZ,.430},{sXx,.274},{sgoXs,.224},H}; -N l9n117[]={{spni,.280},{s_mrw,.249},H}; -N l9n118[]={{smsg,.280},H}; -N l9n119[]={{sryg,.252},H}; -N l9n120[]={{smnig,.561},{siq,.162},{sy7a79,.131},H}; -N l9n121[]={{stvi,.168},H}; -N l9n122[]={{stmw,.112},H}; -N l9n123[]={{ssn,.274},{shs,.199},{sYmp,.262},{sgtX,.168},H}; -N l9n124[]={{sgks,.280},{sniw,.187},H}; -N l9n125[]={{sxX,.449},H}; -N l9n126[]={{sXsg,.645},H}; -N l9n127[]={{sgwx,.477},{smqXg,.224},H}; -N l9n128[]={{s79xsg,.299},H}; -N l9n129[]={{sioX,.112},H}; -N l9n131[]={{sgw,1.851},{svi,.287},{sgtvs,.224},H}; -N l9n132[]={{sgh,1.141},{sniog,.299},{sgqyg,.224},{swxmg,.224},H}; -N l9n133[]={{sgri,.898},{spX,.312},{sxsrg,.337},{sg7aXg,.262},H}; -N l9n134[]={{ssvm,.112},H}; -N l9n135[]={{sov,.175},{snix,.112},H}; -N l9n137[]={{sir,.374},{stm,.112},H}; -N l9n138[]={{sgwy,.337},H}; -N l9n139[]={{sni,1.895},{soXsg,.262},{ss7a,.087},H}; -N l9n140[]={{sso,.199},H}; -N l9n141[]={{shX,.586},{smz,.087},H}; -N l9n142[]={{sXhX,.131},H}; -N l9n143[]={{sgpm,.196},{szsv,.131},H}; -N l9n144[]={{sXrm,.131},H}; -N l9n145[]={{ssg,2.786},H}; -N l9n146[]={{sqs,.187},H}; -N l9n147[]={{svy,.224},H}; -N l9n148[]={{sgx,.542},{sg_mr,.374},{sqni,.168},H}; -N l9n149[]={{sXz,.262},{sgwz,.337},H}; -N l9n151[]={{s7aXg,.280},H}; -N l9n153[]={{skg,.318},H}; -N l9n155[]={{sny,.137},{syt,.087},H}; -N l9n157[]={{ssp,.249},H}; -N l9n158[]={{sxv,.137},H}; -N l9n159[]={{sXos,.280},{sml,.100},H}; -N l9n160[]={{s79m,.187},{srio,.131},H}; -N l9n161[]={{swx,.735},{sgnig,1.982},H}; -N l9n162[]={{swi,.262},{sgwxX,.262},{srsw,.112},H}; -N l9n163[]={{sYy,.087},H}; -N l9n164[]={{sqX,.299},H}; -N l9n165[]={{sgy,.654},{skp,.150},{stvm,.187},H}; -N l9n166[]={{sgZ79,.477},H}; -N l9n167[]={{snXg,.393},{sxzs,.112},H}; -N l9n168[]={{sskg,.393},{smps,.187},H}; -N l9n169[]={{szs,.362},H}; -N l9n171[]={{srmg,.280},{szni,.168},H}; -N l9n174[]={{ssq,.324},{sgwX,.309},{shv,.125},H}; -N l9n175[]={{sghX,.813},H}; -N l9n176[]={{swxsr,.249},{sXps,.131},H}; -N l9n177[]={{srs,.573},{sgrm,.421},{sgXg,.196},H}; -N l9n178[]={{swy,.175},{sZi,.112},H}; -N l9n179[]={{srni,.168},H}; -N l9n180[]={{sosg,.673},H}; -N l9n181[]={{shvy,.112},H}; -N l9n182[]={{sgz,.355},{siog,.224},H}; -N l9n183[]={{sgk,.524},H}; -N l9n184[]={{slg,.187},H}; -N l9n185[]={{sgrXg,.449},{sgxsg,.262},H}; -N l9n186[]={{soy,.112},H}; -N l9n187[]={{szX,.324},H}; -N l9n188[]={{stp,.087},H}; -N l9n189[]={{syv,.112},H}; -N l9n190[]={{syZ,.087},H}; -N l9n191[]={{ssr,.312},H}; -N l9n192[]={{sgos,.449},{sXzX,.131},H}; -N l9n193[]={{smn,.486},{sxi,.224},H}; -N l9n195[]={{srX,.461},{swz,.162},{srsz,.150},{sXhg,.168},H}; -N l9n198[]={{sgrio,.262},{soXg,.168},H}; -N l9n199[]={{svm,.312},{sg_,.187},{s79g,.131},H}; -N l9n200[]={{sYmps,.199},H}; -N l9n201[]={{spi,.262},{sXn,.150},{sghvy,.224},H}; -N l9n202[]={{sszm,.112},H}; -N l9n203[]={{sxsg,.449},{soz,.075},H}; -N l9n204[]={{swxX,.262},{sniZ,.112},H}; -N l9n205[]={{siv,.112},H}; -N l9n206[]={{siZ,.112},{sXpmg,.224},H}; -N l9n207[]={{s7a79,.337},{snm,.112},{syh,.087},{shmr,.112},H}; -N l9n209[]={{sm7a,.224},{szmn,.168},{sxy,.112},{shi,.087},H}; -N l9n210[]={{smo,.087},{sXrs,.112},{ssni,.112},H}; -N l9n211[]={{spsg,.561},H}; -N l9n213[]={{spnig,.224},H}; -N l9n215[]={{smg,1.702},{sYm,.324},{snih,.131},H}; -N l9n216[]={{sks,.262},H}; -N l9n217[]={{sgm,.860},{spy,.112},{srmn,.150},{sX7a,.087},H}; -N l9n218[]={{sXo,.436},{sgwi,.505},{siwx,.168},H}; -N l9n220[]={{szv,.075},H}; -N l9n221[]={{sxXg,.252},H}; -N l9n222[]={{siw,.299},{sgriw,.262},H}; -N l9n223[]={{sXg,2.805},{sih,.199},{syx,.100},H}; -N l9n225[]={{shy,.087},{sst,.087},{sgov,.168},H}; -N l9n226[]={{sosn,.224},{sxz,.112},{sgqs,.252},{sgkX,.168},H}; -N l9n227[]={{smp,.262},{sgwg,.168},{stvmn,.150},H}; -N l9n229[]={{sgYm,.505},{spXg,.280},H}; -N l9n230[]={{swm,.100},H}; -N l9n231[]={{stvs,.131},H}; -N l9n232[]={{sqi,.150},H}; -N l9n234[]={{sgn,1.122},{skX,.137},{sgwyg,.374},{sksz,.112},H}; -N l9n235[]={{snig,2.328},{sXp,.349},{sgxi,.252},H}; -N l9n236[]={{sXoz,.112},{smnX,.112},H}; -N l9n237[]={{shXg,.898},{sqniw,.150},H}; -N l9n238[]={{svg,.168},{som,.087},H}; -N l9n239[]={{sts,.362},{six,.249},{sgrmn,.224},H}; -N l9n241[]={{srwx,.224},H}; -N l9n242[]={{sw79x,.206},H}; -N l9n243[]={{ssY,.187},H}; -N l9n244[]={{smq,.337},H}; -N l9n245[]={{srw,.187},{s79r,.087},H}; -N l9n246[]={{sw79,.424},{smrw,.243},{sng,.187},{sZm,.112},H}; -N l9n248[]={{sqy,.137},{sriw,.131},H}; -N l9n249[]={{svXr,.206},H}; -N l9n250[]={{sg7a,.542},{s7a79X,.131},{srmq,.131},H}; -N l9n251[]={{sgo,.823},{snyg,.224},H}; -N l9n252[]={{sXq,.199},H}; -N l9n254[]={{sgosn,.411},H}; -N l9n255[]={{szi,.237},{soXo,.280},{sXosg,.449},{smlg,.224},H}; - -D l9_d = -{ +S sgni[] = { 32, j, e, 0 }; +S sgnig[] = { 32, j, e, a }; +S smni[] = { i, j, e, 0 }; +S ssz[] = { o, v, 0 }; +S sZ79[] = { 99, y, 0 }; +S s7a79[] = { z, y, 0 }; +S sXs[] = { 97, o, 0 }; +S spn[] = { l, j, 0 }; +S srig[] = { n, e, a }; +S sXsg[] = { 97, o, a }; +S s79X[] = { y, 97, 0 }; +S srsg[] = { n, o, a }; +S ssn[] = { o, j, 0 }; +S sXz[] = { 97, v, 0 }; +S spsg[] = { l, o, a }; +S sgyg[] = { 32, u, a }; +S swxs[] = { s, t, o, 0 }; +S sgZ79[] = { 32, 99, y, 0 }; +S sxsg[] = { t, o, a }; +S soXo[] = { k, 97, k, 0 }; +S spni[] = { l, j, e, 0 }; +S s79m[] = { y, i, 0 }; +S smnig[] = { i, j, e, a }; +S sg7aX[] = { 32, z, 97, 0 }; +S snXg[] = { j, 97, a }; +S sZn[] = { 99, j, 0 }; +S swz[] = { s, v, 0 }; +S smqg[] = { i, m, a }; +S sqXg[] = { m, 97, a }; +S smrw[] = { i, n, s, 0 }; +S sgYmp[] = { 32, 98, i, l, 0 }; +S skp[] = { g, l, 0 }; +S swyg[] = { s, u, a }; +S sgwy[] = { 32, s, u, 0 }; +S sosn[] = { k, o, j, 0 }; +S sgwz[] = { 32, s, v, 0 }; +S srwx[] = { n, s, t, 0 }; +S sgrXg[] = { 32, n, 97, a }; +S swp[] = { s, l, 0 }; +S sw79x[] = { s, y, t, 0 }; +S smqX[] = { i, m, 97, 0 }; +S spmg[] = { l, i, a }; +S smrwx[] = { i, n, s, t, 0 }; +S sgosn[] = { 32, k, o, j, 0 }; +S s79x[] = { y, t, 0 }; +S sg_mr[] = { 32, w, i, n, 0 }; +S s_mr[] = { w, i, n, 0 }; +S shn[] = { d, j, 0 }; +S smps[] = { i, l, o, 0 }; +S sgtvm[] = { 32, p, r, i, 0 }; +S sgks[] = { 32, g, o, 0 }; +S s7aXg[] = { z, 97, a }; +S smsg[] = { i, o, a }; +S srwxs[] = { n, s, t, o, 0 }; +S sniw[] = { j, e, s, 0 }; +S s_mrw[] = { w, i, n, s, 0 }; +S sxsr[] = { t, o, n, 0 }; +S stvm[] = { p, r, i, 0 }; +S swxsr[] = { s, t, o, n, 0 }; +S sgsw[] = { 32, o, s, 0 }; +S sgwyg[] = { 32, s, u, a }; +S sxr[] = { t, n, 0 }; +S sxz[] = { t, v, 0 }; +S szmn[] = { v, i, j, 0 }; +S sqni[] = { m, j, e, 0 }; +S smpsg[] = { i, l, o, a }; +S swxm[] = { s, t, i, 0 }; +S snir[] = { j, e, n, 0 }; +S sg7a79[] = { 32, z, y, 0 }; +S soXos[] = { k, 97, k, o, 0 }; +S s79i[] = { y, e, 0 }; +S szni[] = { v, j, e, 0 }; +S sxsrg[] = { t, o, n, a }; +S sqn[] = { m, j, 0 }; +S szn[] = { v, j, 0 }; +S szsg[] = { v, o, a }; +S srni[] = { n, j, e, 0 }; +S sryg[] = { n, u, a }; +S sZ79X[] = { 99, y, 97, 0 }; +S spy[] = { l, u, 0 }; +S sswx[] = { o, s, t, 0 }; +S sqyg[] = { m, u, a }; +S sgoXo[] = { 32, k, 97, k, 0 }; +S smlg[] = { i, h, a }; +S siZn[] = { e, 99, j, 0 }; +S s7aq[] = { z, m, 0 }; +S sYs[] = { 98, o, 0 }; +S sw79xs[] = { s, y, t, o, 0 }; +S s79xs[] = { y, t, o, 0 }; +S srmn[] = { n, i, j, 0 }; +S snyg[] = { j, u, a }; +S srsz[] = { n, o, v, 0 }; +S sml[] = { i, h, 0 }; +S s79xsg[] = { y, t, o, a }; +S sYmps[] = { 98, i, l, o, 0 }; +S snio[] = { j, e, k, 0 }; +S siw79[] = { e, s, y, 0 }; +S svmn[] = { r, i, j, 0 }; +S sniog[] = { j, e, k, a }; +S sXpsg[] = { 97, l, o, a }; +S sXzX[] = { 97, v, 97, 0 }; +S srmni[] = { n, i, j, e, 0 }; +S srio[] = { n, e, k, 0 }; +S sXhX[] = { 97, d, 97, 0 }; +S s7a79X[] = { z, y, 97, 0 }; +S sspn[] = { o, l, j, 0 }; +S soXsg[] = { k, 97, o, a }; +S snih[] = { j, e, d, 0 }; +S szmni[] = { v, i, j, e, 0 }; +S sw79X[] = { s, y, 97, 0 }; +S spnX[] = { l, j, 97, 0 }; +S sXps[] = { 97, l, o, 0 }; +S sqmw[] = { m, i, s, 0 }; +S sgriw[] = { 32, n, e, s, 0 }; +S sghv[] = { 32, d, r, 0 }; +S s79r[] = { y, n, 0 }; +S ss7a[] = { o, z, 0 }; +S srmq[] = { n, i, m, 0 }; +S syt[] = { u, p, 0 }; +S sgxsg[] = { 32, t, o, a }; +S sgpm[] = { 32, l, i, 0 }; +S syZ[] = { u, 99, 0 }; +S sg7aXg[] = { 32, z, 97, a }; +S sy7a79[] = { u, z, y, 0 }; +S sgkp[] = { 32, g, l, 0 }; +S syh[] = { u, d, 0 }; +S sZnX[] = { 99, j, 97, 0 }; +S soXs[] = { k, 97, o, 0 }; +S szsv[] = { v, o, r, 0 }; +S s7a79m[] = { z, y, i, 0 }; +S sriw[] = { n, e, s, 0 }; +S syk[] = { u, g, 0 }; +S sspni[] = { o, l, j, e, 0 }; +S snXsg[] = { j, 97, o, a }; +S sgrio[] = { 32, n, e, k, 0 }; +S sgwxX[] = { 32, s, t, 97, 0 }; +S sszs[] = { o, v, o, 0 }; +S snXs[] = { j, 97, o, 0 }; +S stp[] = { p, l, 0 }; +S sYy[] = { 98, u, 0 }; +S shr[] = { d, n, 0 }; +S szig[] = { v, e, a }; +S sniZ[] = { j, e, 99, 0 }; +S sgqyg[] = { 32, m, u, a }; +S svyk[] = { r, u, g, 0 }; +S stmw[] = { p, i, s, 0 }; +S sgov[] = { 32, k, r, 0 }; +S smqXg[] = { i, m, 97, a }; +S smwt[] = { i, s, p, 0 }; +S sxo[] = { t, k, 0 }; +S sksh[] = { g, o, d, 0 }; +S ssvm[] = { o, r, i, 0 }; +S sioX[] = { e, k, 97, 0 }; +S srmqg[] = { n, i, m, a }; +S sxXp[] = { t, 97, l, 0 }; +S svXx[] = { r, 97, t, 0 }; +S soXoz[] = { k, 97, k, v, 0 }; +S sXoz[] = { 97, k, v, 0 }; +S sszm[] = { o, v, i, 0 }; +S sixm[] = { e, t, i, 0 }; +S sZig[] = { 99, e, a }; +S snmg[] = { j, i, a }; +S sgwp[] = { 32, s, l, 0 }; +S shvy[] = { d, r, u, 0 }; +S sgwg[] = { 32, s, a }; +S snix[] = { j, e, t, 0 }; +S sgoXs[] = { 32, k, 97, o, 0 }; +S sXrs[] = { 97, n, o, 0 }; +S sksz[] = { g, o, v, 0 }; +S swxmg[] = { s, t, i, a }; +S sgrmn[] = { 32, n, i, j, 0 }; +S soz[] = { k, v, 0 }; +S siw79x[] = { e, s, y, t, 0 }; +S sirs[] = { e, n, o, 0 }; +S sgkXg[] = { 32, g, 97, a }; +S sghvy[] = { 32, d, r, u, 0 }; +S stvmn[] = { p, r, i, j, 0 }; +S sXhg[] = { 97, d, a }; +S sgkX[] = { 32, g, 97, 0 }; +S sqniw[] = { m, j, e, s, 0 }; +S sniZn[] = { j, e, 99, j, 0 }; +S sXpmg[] = { 97, l, i, a }; +S smnX[] = { i, j, 97, 0 }; +S ssni[] = { o, j, e, 0 }; +S sxzs[] = { t, v, o, 0 }; +S srsw[] = { n, o, s, 0 }; +S spnig[] = { l, j, e, a }; + +N l9n0[] = { { szmni, .175 }, { svyk, .112 }, H }; +N l9n1[] = { { stX, .150 }, H }; +N l9n2[] = { { swig, .477 }, { syk, .087 }, H }; +N l9n3[] = { { ssv, .262 }, { s7aq, .100 }, H }; +N l9n4[] = { { sqXg, .365 }, { ssZ, .087 }, H }; +N l9n5[] = { { sxm, .399 }, { smr, .362 }, { sgyg, .533 }, H }; +N l9n6[] = { { sZ79, .362 }, { srx, .112 }, H }; +N l9n7[] = { { sri, .661 }, { sZn, .175 }, H }; +N l9n8[] = { { swo, .137 }, { smpsg, .337 }, { srmni, .175 }, H }; +N l9n9[] = { { szsg, .252 }, H }; +N l9n10[] = { { sniZn, .150 }, H }; +N l9n12[] = { { sgp, .280 }, { sszs, .131 }, { snXs, .131 }, { sirm, .112 }, H }; +N l9n13[] = { { sXr, .449 }, { spm, .386 }, { swg, .150 }, H }; +N l9n14[] = { { ssqg, .421 }, H }; +N l9n15[] = { { sghXg, .860 }, H }; +N l9n16[] = { { sswx, .168 }, { sXpsg, .262 }, H }; +N l9n17[] = { { srsg, .617 }, { siz, .137 }, { siw79, .150 }, H }; +N l9n18[] = { { swyg, .337 }, { sik, .100 }, { sZig, .168 }, H }; +N l9n20[] = { { ssw, .349 }, H }; +N l9n21[] = { { sgts, .561 }, { sog, .374 }, { ssh, .212 }, { shm, .175 }, H }; +N l9n22[] = { { sms, .150 }, H }; +N l9n23[] = { { sry, .237 }, { sgm7a, .280 }, H }; +N l9n24[] = { { smni, .598 }, { s79X, .287 }, H }; +N l9n25[] = { { swp, .150 }, H }; +N l9n27[] = { { szXg, .224 }, H }; +N l9n28[] = { { s_mr, .187 }, { svr, .112 }, H }; +N l9n29[] = { { sgq, .636 }, { sqmw, .131 }, H }; +N l9n30[] = { { sXs, .312 }, { spn, .312 }, H }; +N l9n31[] = { { smqX, .206 }, { ssrg, .280 }, H }; +N l9n32[] = { { s79xs, .150 }, H }; +N l9n33[] = { { sw79X, .131 }, { sxXp, .112 }, H }; +N l9n34[] = { { stv, .374 }, H }; +N l9n35[] = { { srXg, .617 }, H }; +N l9n36[] = { { swxm, .168 }, { sgqy, .252 }, { snio, .150 }, { sksh, .112 }, H }; +N l9n37[] = { { sg7aX, .393 }, { sxsr, .187 }, { ssx, .087 }, H }; +N l9n38[] = { { sgoX, .561 }, { shn, .125 }, H }; +N l9n39[] = { { sxo, .075 }, { sgwp, .168 }, H }; +N l9n41[] = { { sgYmp, .449 }, H }; +N l9n42[] = { { smwt, .112 }, H }; +N l9n43[] = { { sspn, .131 }, { soXs, .131 }, H }; +N l9n44[] = { { sqm, .199 }, { sxg, .131 }, H }; +N l9n45[] = { { svs, .224 }, { sg7a79, .252 }, H }; +N l9n46[] = { { sgr, 1.384 }, H }; +N l9n47[] = { { sXt, .087 }, { snmg, .168 }, H }; +N l9n48[] = { { sgsw, .280 }, H }; +N l9n49[] = { { sZ79X, .168 }, H }; +N l9n50[] = { { sZnX, .131 }, H }; +N l9n54[] = { { sgtv, .757 }, H }; +N l9n55[] = { { s7aX, .249 }, H }; +N l9n57[] = { { sgmg, .617 }, H }; +N l9n58[] = { { sgwig, .598 }, { sXog, .224 }, H }; +N l9n59[] = { { svXx, .112 }, H }; +N l9n60[] = { { shg, .187 }, H }; +N l9n61[] = { { sqn, .112 }, { sYs, .100 }, H }; +N l9n62[] = { { srwxs, .249 }, H }; +N l9n63[] = { { sgs, .879 }, { svX, .436 }, { sw79xs, .199 }, H }; +N l9n65[] = { { sgni, 1.599 }, H }; +N l9n66[] = { { sgkXg, .224 }, H }; +N l9n67[] = { { szm, .324 }, H }; +N l9n69[] = { { sy7a, .150 }, { snir, .168 }, H }; +N l9n71[] = { { snX, .486 }, { ssz, .362 }, H }; +N l9n72[] = { { ssk, .287 }, H }; +N l9n73[] = { { sghs, .309 }, { smv, .087 }, { spnX, .131 }, H }; +N l9n74[] = { { smZ, .175 }, { sg_m, .280 }, { skXg, .196 }, H }; +N l9n75[] = { { syg, 1.477 }, { srm, .486 }, H }; +N l9n76[] = { { soXos, .224 }, { sws, .112 }, H }; +N l9n78[] = { { spmZ, .150 }, { sirs, .112 }, H }; +N l9n79[] = { { sYX, .075 }, H }; +N l9n80[] = { { sgt, 1.234 }, H }; +N l9n81[] = { { sXv, .212 }, { sgX, .299 }, H }; +N l9n82[] = { { smrwx, .274 }, { s7a79m, .131 }, H }; +N l9n83[] = { { sqg, .617 }, H }; +N l9n84[] = { { sos, .636 }, { smqg, .365 }, { szn, .112 }, H }; +N l9n85[] = { { si7a, .100 }, { svmn, .150 }, H }; +N l9n86[] = { { sio, .312 }, H }; +N l9n88[] = { { sqyg, .224 }, H }; +N l9n89[] = { { sgrX, .449 }, { sgxs, .224 }, H }; +N l9n90[] = { { smw, .374 }, { sxr, .125 }, { sspni, .175 }, { srmqg, .224 }, H }; +N l9n91[] = { { sig, 2.898 }, { s79x, .137 }, { smh, .087 }, { sgkp, .196 }, H }; +N l9n92[] = { { srn, .212 }, { s79i, .112 }, { siZn, .150 }, H }; +N l9n93[] = { { swt, .100 }, H }; +N l9n94[] = { { swX, .249 }, H }; +N l9n95[] = { { szig, .196 }, H }; +N l9n97[] = { { soXoz, .150 }, H }; +N l9n98[] = { { sgY, .542 }, { sXw, .125 }, { s_m, .125 }, H }; +N l9n99[] = { { sXh, .237 }, H }; +N l9n101[] = { { sxmg, .477 }, { sgtvi, .299 }, H }; +N l9n102[] = { { soX, .449 }, { swxs, .355 }, H }; +N l9n103[] = { { srig, .645 }, { sip, .187 }, { sgoXo, .299 }, H }; +N l9n106[] = { { sghv, .196 }, { shr, .087 }, H }; +N l9n107[] = { { sxs, .511 }, { smx, .150 }, H }; +N l9n108[] = { { snXsg, .262 }, H }; +N l9n109[] = { { spmg, .309 }, { siw79x, .150 }, H }; +N l9n110[] = { { sXpm, .150 }, H }; +N l9n113[] = { { sgtvm, .374 }, H }; +N l9n114[] = { { srg, .280 }, { sgv, .224 }, { sixm, .112 }, H }; +N l9n115[] = { { sps, .436 }, { sgZ, .430 }, { sXx, .274 }, { sgoXs, .224 }, H }; +N l9n117[] = { { spni, .280 }, { s_mrw, .249 }, H }; +N l9n118[] = { { smsg, .280 }, H }; +N l9n119[] = { { sryg, .252 }, H }; +N l9n120[] = { { smnig, .561 }, { siq, .162 }, { sy7a79, .131 }, H }; +N l9n121[] = { { stvi, .168 }, H }; +N l9n122[] = { { stmw, .112 }, H }; +N l9n123[] = { { ssn, .274 }, { shs, .199 }, { sYmp, .262 }, { sgtX, .168 }, H }; +N l9n124[] = { { sgks, .280 }, { sniw, .187 }, H }; +N l9n125[] = { { sxX, .449 }, H }; +N l9n126[] = { { sXsg, .645 }, H }; +N l9n127[] = { { sgwx, .477 }, { smqXg, .224 }, H }; +N l9n128[] = { { s79xsg, .299 }, H }; +N l9n129[] = { { sioX, .112 }, H }; +N l9n131[] = { { sgw, 1.851 }, { svi, .287 }, { sgtvs, .224 }, H }; +N l9n132[] = { { sgh, 1.141 }, { sniog, .299 }, { sgqyg, .224 }, { swxmg, .224 }, H }; +N l9n133[] = { { sgri, .898 }, { spX, .312 }, { sxsrg, .337 }, { sg7aXg, .262 }, H }; +N l9n134[] = { { ssvm, .112 }, H }; +N l9n135[] = { { sov, .175 }, { snix, .112 }, H }; +N l9n137[] = { { sir, .374 }, { stm, .112 }, H }; +N l9n138[] = { { sgwy, .337 }, H }; +N l9n139[] = { { sni, 1.895 }, { soXsg, .262 }, { ss7a, .087 }, H }; +N l9n140[] = { { sso, .199 }, H }; +N l9n141[] = { { shX, .586 }, { smz, .087 }, H }; +N l9n142[] = { { sXhX, .131 }, H }; +N l9n143[] = { { sgpm, .196 }, { szsv, .131 }, H }; +N l9n144[] = { { sXrm, .131 }, H }; +N l9n145[] = { { ssg, 2.786 }, H }; +N l9n146[] = { { sqs, .187 }, H }; +N l9n147[] = { { svy, .224 }, H }; +N l9n148[] = { { sgx, .542 }, { sg_mr, .374 }, { sqni, .168 }, H }; +N l9n149[] = { { sXz, .262 }, { sgwz, .337 }, H }; +N l9n151[] = { { s7aXg, .280 }, H }; +N l9n153[] = { { skg, .318 }, H }; +N l9n155[] = { { sny, .137 }, { syt, .087 }, H }; +N l9n157[] = { { ssp, .249 }, H }; +N l9n158[] = { { sxv, .137 }, H }; +N l9n159[] = { { sXos, .280 }, { sml, .100 }, H }; +N l9n160[] = { { s79m, .187 }, { srio, .131 }, H }; +N l9n161[] = { { swx, .735 }, { sgnig, 1.982 }, H }; +N l9n162[] = { { swi, .262 }, { sgwxX, .262 }, { srsw, .112 }, H }; +N l9n163[] = { { sYy, .087 }, H }; +N l9n164[] = { { sqX, .299 }, H }; +N l9n165[] = { { sgy, .654 }, { skp, .150 }, { stvm, .187 }, H }; +N l9n166[] = { { sgZ79, .477 }, H }; +N l9n167[] = { { snXg, .393 }, { sxzs, .112 }, H }; +N l9n168[] = { { sskg, .393 }, { smps, .187 }, H }; +N l9n169[] = { { szs, .362 }, H }; +N l9n171[] = { { srmg, .280 }, { szni, .168 }, H }; +N l9n174[] = { { ssq, .324 }, { sgwX, .309 }, { shv, .125 }, H }; +N l9n175[] = { { sghX, .813 }, H }; +N l9n176[] = { { swxsr, .249 }, { sXps, .131 }, H }; +N l9n177[] = { { srs, .573 }, { sgrm, .421 }, { sgXg, .196 }, H }; +N l9n178[] = { { swy, .175 }, { sZi, .112 }, H }; +N l9n179[] = { { srni, .168 }, H }; +N l9n180[] = { { sosg, .673 }, H }; +N l9n181[] = { { shvy, .112 }, H }; +N l9n182[] = { { sgz, .355 }, { siog, .224 }, H }; +N l9n183[] = { { sgk, .524 }, H }; +N l9n184[] = { { slg, .187 }, H }; +N l9n185[] = { { sgrXg, .449 }, { sgxsg, .262 }, H }; +N l9n186[] = { { soy, .112 }, H }; +N l9n187[] = { { szX, .324 }, H }; +N l9n188[] = { { stp, .087 }, H }; +N l9n189[] = { { syv, .112 }, H }; +N l9n190[] = { { syZ, .087 }, H }; +N l9n191[] = { { ssr, .312 }, H }; +N l9n192[] = { { sgos, .449 }, { sXzX, .131 }, H }; +N l9n193[] = { { smn, .486 }, { sxi, .224 }, H }; +N l9n195[] = { { srX, .461 }, { swz, .162 }, { srsz, .150 }, { sXhg, .168 }, H }; +N l9n198[] = { { sgrio, .262 }, { soXg, .168 }, H }; +N l9n199[] = { { svm, .312 }, { sg_, .187 }, { s79g, .131 }, H }; +N l9n200[] = { { sYmps, .199 }, H }; +N l9n201[] = { { spi, .262 }, { sXn, .150 }, { sghvy, .224 }, H }; +N l9n202[] = { { sszm, .112 }, H }; +N l9n203[] = { { sxsg, .449 }, { soz, .075 }, H }; +N l9n204[] = { { swxX, .262 }, { sniZ, .112 }, H }; +N l9n205[] = { { siv, .112 }, H }; +N l9n206[] = { { siZ, .112 }, { sXpmg, .224 }, H }; +N l9n207[] = { { s7a79, .337 }, { snm, .112 }, { syh, .087 }, { shmr, .112 }, H }; +N l9n209[] = { { sm7a, .224 }, { szmn, .168 }, { sxy, .112 }, { shi, .087 }, H }; +N l9n210[] = { { smo, .087 }, { sXrs, .112 }, { ssni, .112 }, H }; +N l9n211[] = { { spsg, .561 }, H }; +N l9n213[] = { { spnig, .224 }, H }; +N l9n215[] = { { smg, 1.702 }, { sYm, .324 }, { snih, .131 }, H }; +N l9n216[] = { { sks, .262 }, H }; +N l9n217[] = { { sgm, .860 }, { spy, .112 }, { srmn, .150 }, { sX7a, .087 }, H }; +N l9n218[] = { { sXo, .436 }, { sgwi, .505 }, { siwx, .168 }, H }; +N l9n220[] = { { szv, .075 }, H }; +N l9n221[] = { { sxXg, .252 }, H }; +N l9n222[] = { { siw, .299 }, { sgriw, .262 }, H }; +N l9n223[] = { { sXg, 2.805 }, { sih, .199 }, { syx, .100 }, H }; +N l9n225[] = { { shy, .087 }, { sst, .087 }, { sgov, .168 }, H }; +N l9n226[] = { { sosn, .224 }, { sxz, .112 }, { sgqs, .252 }, { sgkX, .168 }, H }; +N l9n227[] = { { smp, .262 }, { sgwg, .168 }, { stvmn, .150 }, H }; +N l9n229[] = { { sgYm, .505 }, { spXg, .280 }, H }; +N l9n230[] = { { swm, .100 }, H }; +N l9n231[] = { { stvs, .131 }, H }; +N l9n232[] = { { sqi, .150 }, H }; +N l9n234[] = { { sgn, 1.122 }, { skX, .137 }, { sgwyg, .374 }, { sksz, .112 }, H }; +N l9n235[] = { { snig, 2.328 }, { sXp, .349 }, { sgxi, .252 }, H }; +N l9n236[] = { { sXoz, .112 }, { smnX, .112 }, H }; +N l9n237[] = { { shXg, .898 }, { sqniw, .150 }, H }; +N l9n238[] = { { svg, .168 }, { som, .087 }, H }; +N l9n239[] = { { sts, .362 }, { six, .249 }, { sgrmn, .224 }, H }; +N l9n241[] = { { srwx, .224 }, H }; +N l9n242[] = { { sw79x, .206 }, H }; +N l9n243[] = { { ssY, .187 }, H }; +N l9n244[] = { { smq, .337 }, H }; +N l9n245[] = { { srw, .187 }, { s79r, .087 }, H }; +N l9n246[] = { { sw79, .424 }, { smrw, .243 }, { sng, .187 }, { sZm, .112 }, H }; +N l9n248[] = { { sqy, .137 }, { sriw, .131 }, H }; +N l9n249[] = { { svXr, .206 }, H }; +N l9n250[] = { { sg7a, .542 }, { s7a79X, .131 }, { srmq, .131 }, H }; +N l9n251[] = { { sgo, .823 }, { snyg, .224 }, H }; +N l9n252[] = { { sXq, .199 }, H }; +N l9n254[] = { { sgosn, .411 }, H }; +N l9n255[] = { { szi, .237 }, { soXo, .280 }, { sXosg, .449 }, { smlg, .224 }, H }; + +D l9_d = { "croatian", "ascii", - { - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,0.208,0.032,0.033,0.070,0.181,0.002,0.036,0.008,0.167,0.114,0.075,0.078,0.068,0.129,0.212, - 0.052,W,0.080,0.115,0.093,0.087,0.066,0.005,W,0.045,0.042,W,W,W,W,W, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - Y,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V, - V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V, - V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V, - V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V - }, - { - l9n0,l9n1,l9n2,l9n3,l9n4,l9n5,l9n6,l9n7,l9n8,l9n9,l9n10,X,l9n12,l9n13,l9n14,l9n15, - l9n16,l9n17,l9n18,X,l9n20,l9n21,l9n22,l9n23,l9n24,l9n25,X,l9n27,l9n28,l9n29,l9n30,l9n31, - l9n32,l9n33,l9n34,l9n35,l9n36,l9n37,l9n38,l9n39,X,l9n41,l9n42,l9n43,l9n44,l9n45,l9n46,l9n47, - l9n48,l9n49,l9n50,X,X,X,l9n54,l9n55,X,l9n57,l9n58,l9n59,l9n60,l9n61,l9n62,l9n63, - X,l9n65,l9n66,l9n67,X,l9n69,X,l9n71,l9n72,l9n73,l9n74,l9n75,l9n76,X,l9n78,l9n79, - l9n80,l9n81,l9n82,l9n83,l9n84,l9n85,l9n86,X,l9n88,l9n89,l9n90,l9n91,l9n92,l9n93,l9n94,l9n95, - X,l9n97,l9n98,l9n99,X,l9n101,l9n102,l9n103,X,X,l9n106,l9n107,l9n108,l9n109,l9n110,X, - X,l9n113,l9n114,l9n115,X,l9n117,l9n118,l9n119,l9n120,l9n121,l9n122,l9n123,l9n124,l9n125,l9n126,l9n127, - l9n128,l9n129,X,l9n131,l9n132,l9n133,l9n134,l9n135,X,l9n137,l9n138,l9n139,l9n140,l9n141,l9n142,l9n143, - l9n144,l9n145,l9n146,l9n147,l9n148,l9n149,X,l9n151,X,l9n153,X,l9n155,X,l9n157,l9n158,l9n159, - l9n160,l9n161,l9n162,l9n163,l9n164,l9n165,l9n166,l9n167,l9n168,l9n169,X,l9n171,X,X,l9n174,l9n175, - l9n176,l9n177,l9n178,l9n179,l9n180,l9n181,l9n182,l9n183,l9n184,l9n185,l9n186,l9n187,l9n188,l9n189,l9n190,l9n191, - l9n192,l9n193,X,l9n195,X,X,l9n198,l9n199,l9n200,l9n201,l9n202,l9n203,l9n204,l9n205,l9n206,l9n207, - X,l9n209,l9n210,l9n211,X,l9n213,X,l9n215,l9n216,l9n217,l9n218,X,l9n220,l9n221,l9n222,l9n223, - X,l9n225,l9n226,l9n227,X,l9n229,l9n230,l9n231,l9n232,X,l9n234,l9n235,l9n236,l9n237,l9n238,l9n239, - X,l9n241,l9n242,l9n243,l9n244,l9n245,l9n246,X,l9n248,l9n249,l9n250,l9n251,l9n252,X,l9n254,l9n255 - } + { W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, 0.208, 0.032, 0.033, 0.070, 0.181, 0.002, 0.036, 0.008, 0.167, 0.114, 0.075, 0.078, 0.068, 0.129, 0.212, + 0.052, W, 0.080, 0.115, 0.093, 0.087, 0.066, 0.005, W, 0.045, 0.042, W, W, W, W, W, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + Y, V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, + V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, + V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, + V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, V }, + { l9n0, l9n1, l9n2, l9n3, l9n4, l9n5, l9n6, l9n7, l9n8, l9n9, l9n10, X, l9n12, l9n13, l9n14, l9n15, + l9n16, l9n17, l9n18, X, l9n20, l9n21, l9n22, l9n23, l9n24, l9n25, X, l9n27, l9n28, l9n29, l9n30, l9n31, + l9n32, l9n33, l9n34, l9n35, l9n36, l9n37, l9n38, l9n39, X, l9n41, l9n42, l9n43, l9n44, l9n45, l9n46, l9n47, + l9n48, l9n49, l9n50, X, X, X, l9n54, l9n55, X, l9n57, l9n58, l9n59, l9n60, l9n61, l9n62, l9n63, + X, l9n65, l9n66, l9n67, X, l9n69, X, l9n71, l9n72, l9n73, l9n74, l9n75, l9n76, X, l9n78, l9n79, + l9n80, l9n81, l9n82, l9n83, l9n84, l9n85, l9n86, X, l9n88, l9n89, l9n90, l9n91, l9n92, l9n93, l9n94, l9n95, + X, l9n97, l9n98, l9n99, X, l9n101, l9n102, l9n103, X, X, l9n106, l9n107, l9n108, l9n109, l9n110, X, + X, l9n113, l9n114, l9n115, X, l9n117, l9n118, l9n119, l9n120, l9n121, l9n122, l9n123, l9n124, l9n125, l9n126, l9n127, + l9n128, l9n129, X, l9n131, l9n132, l9n133, l9n134, l9n135, X, l9n137, l9n138, l9n139, l9n140, l9n141, l9n142, l9n143, + l9n144, l9n145, l9n146, l9n147, l9n148, l9n149, X, l9n151, X, l9n153, X, l9n155, X, l9n157, l9n158, l9n159, + l9n160, l9n161, l9n162, l9n163, l9n164, l9n165, l9n166, l9n167, l9n168, l9n169, X, l9n171, X, X, l9n174, l9n175, + l9n176, l9n177, l9n178, l9n179, l9n180, l9n181, l9n182, l9n183, l9n184, l9n185, l9n186, l9n187, l9n188, l9n189, l9n190, l9n191, + l9n192, l9n193, X, l9n195, X, X, l9n198, l9n199, l9n200, l9n201, l9n202, l9n203, l9n204, l9n205, l9n206, l9n207, + X, l9n209, l9n210, l9n211, X, l9n213, X, l9n215, l9n216, l9n217, l9n218, X, l9n220, l9n221, l9n222, l9n223, + X, l9n225, l9n226, l9n227, X, l9n229, l9n230, l9n231, l9n232, X, l9n234, l9n235, l9n236, l9n237, l9n238, l9n239, + X, l9n241, l9n242, l9n243, l9n244, l9n245, l9n246, X, l9n248, l9n249, l9n250, l9n251, l9n252, X, l9n254, l9n255 } }; - - // // Lng: czech // Enc: iso-8859-2 // - -S sred[]={n,237,0}; -S sZl[]={99,h,0}; -S sf8i[]={248,e,0}; -S stf8[]={p,248,0}; -S soe9[]={k,233,0}; -S sgtf8[]={32,p,248,0}; -S slsg[]={h,o,a}; -S sredg[]={n,237,a}; -S srec[]={n,236,0}; -S swoe9[]={s,k,233,0}; -S sgzg[]={32,v,a}; -S sbei[]={190,e,0}; -S sY79[]={98,y,0}; -S sZlg[]={99,h,a}; -S soe9g[]={k,233,a}; -S sz79[]={v,y,0}; -S spR[]={l,225,0}; -S szfd[]={v,253,0}; -S se9ls[]={233,h,o,0}; -S se9lsg[]={233,h,o,a}; -S se9l[]={233,h,0}; -S srR[]={n,225,0}; -S sf8m[]={248,i,0}; -S svR[]={r,225,0}; -S sqec[]={m,236,0}; -S stf8i[]={p,248,e,0}; -S stvX[]={p,r,97,0}; -S szec[]={v,236,0}; -S sedq[]={237,m,0}; -S sre9[]={n,233,0}; -S sze9[]={v,233,0}; -S sgtf8i[]={32,p,248,e,0}; -S sRx[]={225,t,0}; -S sbeig[]={190,e,a}; -S secx[]={236,t,0}; -S so79[]={k,y,0}; -S stsh[]={p,o,d,0}; -S sRr[]={225,n,0}; -S sre9g[]={n,233,a}; -S swoe9g[]={s,k,233,a}; -S sgvs[]={32,r,o,0}; -S sgY79[]={32,98,y,0}; -S srecg[]={n,236,a}; -S soyg[]={k,u,a}; -S s7aR[]={z,225,0}; -S stf8m[]={p,248,i,0}; -S sgz79[]={32,v,y,0}; -S svXz[]={r,97,v,0}; -S sedZ[]={237,99,0}; -S slp[]={h,l,0}; -S se8r[]={232,n,0}; -S sgtf8m[]={32,p,248,i,0}; -S shec[]={d,236,0}; -S sh79[]={d,y,0}; -S sf8ih[]={248,e,d,0}; -S srswx[]={n,o,s,t,0}; -S sofd[]={k,253,0}; -S s79p[]={y,l,0}; -S sgbei[]={32,190,e,0}; -S sgbeig[]={32,190,e,a}; -S sRz[]={225,v,0}; -S stvXz[]={p,r,97,v,0}; -S slsh[]={h,o,d,0}; -S smpg[]={i,l,a}; -S sedqg[]={237,m,a}; -S sr79[]={n,y,0}; -S soe9l[]={k,233,h,0}; -S s7ar[]={z,n,0}; -S sned[]={j,237,0}; -S sfdZlg[]={253,99,h,a}; -S so79g[]={k,y,a}; -S sfdZl[]={253,99,h,0}; -S szR[]={v,225,0}; -S soe9ls[]={k,233,h,o,0}; -S sfdZ[]={253,99,0}; -S sze9g[]={v,233,a}; -S swoe9l[]={s,k,233,h,0}; -S szr[]={v,n,0}; -S ssze9[]={o,v,233,0}; -S sb9ed[]={185,237,0}; -S sh79g[]={d,y,a}; -S sgzfd[]={32,v,253,0}; -S s7at[]={z,p,0}; -S szed[]={v,237,0}; -S szXx[]={v,97,t,0}; -S sRp[]={225,l,0}; -S stf8ih[]={p,248,e,d,0}; -S sZls[]={99,h,o,0}; -S sgtsh[]={32,p,o,d,0}; -S soh[]={k,d,0}; -S sgsY[]={32,o,98,0}; -S shp[]={d,l,0}; -S sxR[]={t,225,0}; -S swts[]={s,p,o,0}; -S sR7a[]={225,z,0}; -S stsp[]={p,o,l,0}; -S sY79p[]={98,y,l,0}; -S slv[]={h,r,0}; -S sZo[]={99,k,0}; -S se8i[]={232,e,0}; -S shyg[]={d,u,a}; -S sx79[]={t,y,0}; -S sgsh[]={32,o,d,0}; -S sRw[]={225,s,0}; -S s7aig[]={z,e,a}; -S swsz[]={s,o,v,0}; -S svs7a[]={r,o,z,0}; -S soR[]={k,225,0}; -S secp[]={236,l,0}; -S sg7aR[]={32,z,225,0}; -S swsy[]={s,o,u,0}; -S sgrR[]={32,n,225,0}; -S sszec[]={o,v,236,0}; -S sgoh[]={32,k,d,0}; -S sshy[]={o,d,u,0}; -S swxg[]={s,t,a}; -S sgsg[]={32,o,a}; -S sg7ag[]={32,z,a}; -S ssvy[]={o,r,u,0}; -S s7aXl[]={z,97,h,0}; -S szb9[]={v,185,0}; -S sY79g[]={98,y,a}; -S sszX[]={o,v,97,0}; -S szecx[]={v,236,t,0}; -S snr[]={j,n,0}; -S svXh[]={r,97,d,0}; -S siwo[]={e,s,k,0}; -S sedls[]={237,h,o,0}; -S sgY79p[]={32,98,y,l,0}; -S srfd[]={n,253,0}; -S sgxXo[]={32,t,97,k,0}; -S sgZi[]={32,99,e,0}; -S srwo[]={n,s,k,0}; -S szred[]={v,n,237,0}; -S sRq[]={225,m,0}; -S sinr[]={e,j,n,0}; -S sxip[]={t,e,l,0}; -S sredq[]={n,237,m,0}; -S sfdq[]={253,m,0}; -S se8m[]={232,i,0}; -S sRred[]={225,n,237,0}; -S sgrec[]={32,n,236,0}; -S sZed[]={99,237,0}; -S sgZl[]={32,99,h,0}; -S sedl[]={237,h,0}; -S sswxg[]={o,s,t,a}; -S sx79g[]={t,y,a}; -S syn[]={u,j,0}; -S sg7aXl[]={32,z,97,h,0}; -S shf9[]={d,249,0}; -S swps[]={s,l,o,0}; -S slvX[]={h,r,97,0}; -S sgri7a[]={32,n,e,z,0}; -S swq[]={s,m,0}; -S secw[]={236,s,0}; -S ssbe[]={o,190,0}; -S slR[]={h,225,0}; -S sYyh[]={98,u,d,0}; -S sszfd[]={o,v,253,0}; -S ssze9g[]={o,v,233,a}; -S sxred[]={t,n,237,0}; -S sXe8[]={97,232,0}; -S sgwsy[]={32,s,o,u,0}; -S spsz[]={l,o,v,0}; -S sxsq[]={t,o,m,0}; -S syY[]={u,98,0}; -S sredqg[]={n,237,m,a}; -S sYec[]={98,236,0}; -S shw[]={d,s,0}; -S swxv[]={s,t,r,0}; -S sc8i[]={200,e,0}; -S sswp[]={o,s,l,0}; -S sedlsg[]={237,h,o,a}; - -N l10n0[]={{sgxXo,.220},H}; -N l10n1[]={{sf8m,.385},{stX,.098},{swxg,.165},H}; -N l10n2[]={{swig,.330},H}; -N l10n3[]={{ssv,.220},H}; -N l10n4[]={{ssZ,.061},H}; -N l10n5[]={{sxm,.208},{smr,.171},{spR,.171},H}; -N l10n6[]={{srx,.122},H}; -N l10n7[]={{sri,.392},{szed,.086},H}; -N l10n8[]={{swo,.416},{stf8,.294},H}; -N l10n9[]={{sf8ih,.372},H}; -N l10n10[]={{ssvy,.110},{sgosr,.184},H}; -N l10n11[]={{swoe9,.330},H}; -N l10n12[]={{sgp,.239},H}; -N l10n13[]={{sXr,.245},{spm,.245},{swg,.294},{sgzi,.248},H}; -N l10n14[]={{sfdZlg,.661},{sosr,.128},H}; -N l10n15[]={{sred,.428},{ssbe,.061},H}; -N l10n16[]={{sswx,.220},H}; -N l10n17[]={{siz,.086},{se8m,.165},H}; -N l10n18[]={{sZig,.220},H}; -N l10n20[]={{ssw,.294},{s7ar,.098},H}; -N l10n21[]={{ssh,.441},{sgts,.743},{sog,.294},{shm,.110},{sRz,.220},{sx79,.086},H}; -N l10n22[]={{sgzg,.496},{sxXo,.110},H}; -N l10n23[]={{szfd,.171},{sbeig,.454},H}; -N l10n24[]={{sZo,.086},H}; -N l10n25[]={{swp,.184},H}; -N l10n26[]={{soyg,.275},{sxsq,.092},H}; -N l10n27[]={{szXg,.165},H}; -N l10n28[]={{svr,.110},{sshy,.110},H}; -N l10n29[]={{sgq,.441},{sZg,.092},H}; -N l10n30[]={{sredqg,.184},H}; -N l10n31[]={{se9l,.385},{srfd,.073},H}; -N l10n33[]={{sop,.086},H}; -N l10n34[]={{stv,.502},{sbeg,.275},{swts,.128},H}; -N l10n35[]={{srXg,.688},{sze9g,.220},H}; -N l10n36[]={{sb9ed,.128},{swxm,.110},{snr,.073},H}; -N l10n37[]={{sg7aX,.496},{ssx,.147},{sh79,.110},H}; -N l10n38[]={{sszfd,.092},H}; -N l10n39[]={{sgtf8i,.441},{sxo,.073},{sXe8,.061},{sgwp,.138},H}; -N l10n40[]={{sgc8,.128},H}; -N l10n41[]={{spig,.138},H}; -N l10n42[]={{slv,.086},{swq,.061},H}; -N l10n43[]={{sre9g,.275},H}; -N l10n44[]={{sxg,.477},{sqm,.110},H}; -N l10n45[]={{svs,.477},H}; -N l10n46[]={{sgr,1.230},H}; -N l10n49[]={{sxyg,.193},H}; -N l10n51[]={{sgtf8m,.330},{soe9ls,.196},H}; -N l10n52[]={{spg,.477},H}; -N l10n53[]={{sgbeig,.294},{syn,.073},H}; -N l10n54[]={{ssy,.355},{sgtv,.743},{sfdZ,.220},{s7at,.086},H}; -N l10n55[]={{s7aX,.245},{sgvs,.275},{secw,.138},H}; -N l10n58[]={{sgwig,.441},{sXog,.165},H}; -N l10n59[]={{stsh,.202},{szR,.098},H}; -N l10n60[]={{shg,.165},H}; -N l10n61[]={{sYs,.147},H}; -N l10n63[]={{svX,.489},{sgs,.532},H}; -N l10n65[]={{sgni,.496},{sgtsh,.257},{shyg,.193},H}; -N l10n67[]={{srR,.171},{szm,.098},{slsh,.147},{smpg,.220},{swoe9l,.196},H}; -N l10n68[]={{se9lsg,1.156},H}; -N l10n69[]={{sin,.220},{sZlg,.413},{snir,.092},H}; -N l10n70[]={{sedZ,.248},H}; -N l10n71[]={{ssz,.514},{sf9g,.372},{snX,.098},{sgoh,.165},{sY79g,.165},H}; -N l10n72[]={{sgws,.330},{secx,.303},{sge8,.184},{shp,.086},H}; -N l10n73[]={{sghs,.303},H}; -N l10n74[]={{smZ,.159},{ssze9,.128},H}; -N l10n75[]={{syg,1.138},{srm,.171},{sXpg,.165},H}; -N l10n76[]={{sws,.232},H}; -N l10n77[]={{stvX,.239},H}; -N l10n80[]={{sgt,1.725},{sedqg,.496},H}; -N l10n81[]={{sgX,.679},{sXv,.110},{svXz,.165},{sg7ai,.165},H}; -N l10n82[]={{sXZ,.110},{sgrec,.165},H}; -N l10n83[]={{sqg,.697},{sz79,.184},{swsy,.128},H}; -N l10n84[]={{sos,.281},H}; -N l10n85[]={{si7a,.184},{slvX,.092},H}; -N l10n86[]={{sio,.061},H}; -N l10n87[]={{se9g,1.569},{slsg,.578},H}; -N l10n89[]={{sgrX,.716},{sgxs,.441},{sR7a,.193},H}; -N l10n90[]={{sxr,.159},{smw,.110},{sg7ag,.165},H}; -N l10n91[]={{sig,1.248},{sr79,.098},H}; -N l10n92[]={{sZs,.098},H}; -N l10n93[]={{swt,.086},{sg7aXl,.220},H}; -N l10n94[]={{srecg,.275},{so79g,.220},{swsz,.128},{swX,.073},H}; -N l10n95[]={{stf8i,.239},{sRg,.454},H}; -N l10n96[]={{sedls,.248},H}; -N l10n98[]={{sgY,.532},{sXw,.159},H}; -N l10n99[]={{sXh,.257},H}; -N l10n101[]={{sxip,.110},H}; -N l10n102[]={{soX,.196},{se8r,.248},H}; -N l10n103[]={{sip,.159},H}; -N l10n104[]={{syq,.073},H}; -N l10n106[]={{szg,.367},{shr,.184},H}; -N l10n107[]={{sxs,.379},{smx,.184},{swoe9g,.367},{sRp,.193},{svs7a,.128},{sszec,.110},H}; -N l10n110[]={{soe9,.281},H}; -N l10n111[]={{sredg,.523},H}; -N l10n112[]={{sswxg,.220},H}; -N l10n114[]={{sgv,.404},{srg,.165},{sszX,.110},H}; -N l10n115[]={{sps,.355},{sXx,.294},{sgZ,.312},H}; -N l10n117[]={{sgsY,.193},{sx79g,.165},H}; -N l10n119[]={{siwo,.110},H}; -N l10n120[]={{siq,.147},H}; -N l10n122[]={{sirw,.092},H}; -N l10n123[]={{shs,.269},{s7ai,.232},H}; -N l10n124[]={{sRq,.165},H}; -N l10n125[]={{sxX,.306},H}; -N l10n126[]={{sgbe,.165},H}; -N l10n127[]={{sgwx,.303},H}; -N l10n128[]={{svXZ,.092},H}; -N l10n130[]={{svx,.061},H}; -N l10n131[]={{sgw,1.450},{sgtvs,.514},{svi,.122},H}; -N l10n132[]={{sgh,.661},H}; -N l10n133[]={{spX,.294},{sgri,.633},{sh79g,.193},{sirx,.110},{spsz,.092},H}; -N l10n135[]={{sov,.086},{swxv,.092},H}; -N l10n137[]={{sir,.355},{slR,.061},{sxred,.092},H}; -N l10n138[]={{sYec,.061},H}; -N l10n139[]={{sni,.318},{ss7a,.184},{stf8m,.184},{stf8ih,.171},{sY79p,.128},{s7ay,.086},{sgsh,.193},{svXh,.110},H}; -N l10n140[]={{sso,.098},H}; -N l10n141[]={{shX,.171},{sRr,.275},{sgls,.275},H}; -N l10n142[]={{srwo,.110},H}; -N l10n145[]={{ssg,1.487},H}; -N l10n146[]={{sqs,.110},H}; -N l10n147[]={{svy,.122},{sned,.098},{stsp,.128},{szb9,.073},{sYi,.061},H}; -N l10n148[]={{sgx,.514},H}; -N l10n149[]={{sXz,.281},{sgwz,.358},{sgY79,.275},{sgzfd,.193},H}; -N l10n150[]={{ssyg,.385},H}; -N l10n152[]={{szr,.086},H}; -N l10n153[]={{soh,.086},H}; -N l10n155[]={{sedl,.165},H}; -N l10n157[]={{ssp,.147},H}; -N l10n158[]={{sxv,.135},H}; -N l10n159[]={{sgsg,.165},H}; -N l10n161[]={{swx,.624},{sgnig,.257},H}; -N l10n162[]={{swi,.196},{srsw,.165},H}; -N l10n163[]={{sYy,.098},H}; -N l10n165[]={{sgy,.165},{sg7aR,.193},{shf9,.061},H}; -N l10n167[]={{sXl,.110},{sgwsy,.184},H}; -N l10n169[]={{szs,.232},H}; -N l10n170[]={{sZls,.128},{ssze9g,.184},H}; -N l10n171[]={{sit,.110},H}; -N l10n173[]={{syY,.061},H}; -N l10n174[]={{ssq,.135},{sfdZl,.330},H}; -N l10n175[]={{stvXz,.196},{s7aXl,.110},{sxw,.061},H}; -N l10n177[]={{sgXg,.661},{srs,.220},H}; -N l10n178[]={{sZi,.232},H}; -N l10n180[]={{secg,.867},H}; -N l10n182[]={{sgz,1.230},H}; -N l10n183[]={{sbei,.294},{s7aR,.122},{szXx,.128},H}; -N l10n184[]={{slg,.275},{sswp,.092},H}; -N l10n185[]={{sgrXg,.551},{sgxsg,.330},H}; -N l10n186[]={{soy,.147},{sZed,.073},H}; -N l10n187[]={{szX,.306},{sr79g,.220},H}; -N l10n188[]={{sRred,.248},H}; -N l10n189[]={{sf8i,.661},{siY,.073},H}; -N l10n190[]={{sredq,.110},H}; -N l10n191[]={{svR,.159},{ssr,.122},{s7am,.073},{sgxX,.165},{shw,.061},H}; -N l10n192[]={{sgos,.275},{secp,.193},{sXzX,.110},{sedlsg,.413},H}; -N l10n193[]={{sxi,.306},H}; -N l10n194[]={{sofd,.098},H}; -N l10n195[]={{srX,.563},{swz,.159},{sze9,.147},{sfdg,.496},H}; -N l10n196[]={{slp,.110},H}; -N l10n198[]={{soXg,.165},H}; -N l10n199[]={{s79g,.918},{svm,.073},{szred,.110},H}; -N l10n200[]={{sgl,.257},{shec,.110},H}; -N l10n201[]={{spi,.294},H}; -N l10n202[]={{sXxi,.128},{sgZi,.165},H}; -N l10n203[]={{sxsg,.468},{sre9,.147},{smxg,.165},H}; -N l10n204[]={{swxX,.165},H}; -N l10n205[]={{siv,.147},{se8i,.193},H}; -N l10n206[]={{soe9g,.413},{siZ,.110},H}; -N l10n207[]={{snm,.122},{syh,.086},H}; -N l10n209[]={{sxy,.171},{shi,.110},H}; -N l10n210[]={{smo,.122},H}; -N l10n211[]={{sedg,1.858},{spsg,.385},{s79p,.098},H}; -N l10n213[]={{sgbei,.220},H}; -N l10n215[]={{smg,.624},H}; -N l10n216[]={{siqg,.248},H}; -N l10n217[]={{spy,.122},{sX7a,.098},{sgrR,.193},{sgY79p,.220},H}; -N l10n218[]={{sXo,.257},{sgwi,.385},{siwx,.128},H}; -N l10n219[]={{s7aig,.193},H}; -N l10n220[]={{szv,.073},H}; -N l10n222[]={{siw,.232},{swps,.092},H}; -N l10n223[]={{sXg,1.597},{sih,.257},{sqec,.159},{syx,.110},H}; -N l10n224[]={{sfdq,.165},H}; -N l10n225[]={{shy,.098},{sst,.098},H}; -N l10n226[]={{sxz,.098},{sRw,.193},H}; -N l10n227[]={{smp,.196},{sgwg,.165},H}; -N l10n228[]={{se9ls,.578},H}; -N l10n229[]={{sZl,.416},{spXg,.330},H}; -N l10n230[]={{soe9l,.147},{soR,.086},{swm,.073},{s7ag,.110},H}; -N l10n231[]={{stvs,.294},{sY79,.184},H}; -N l10n232[]={{sqi,.086},H}; -N l10n233[]={{sgz79,.275},H}; -N l10n234[]={{sgn,.606},H}; -N l10n235[]={{sXp,.281},{snig,.303},{sgZl,.165},H}; -N l10n237[]={{sc8i,.138},H}; -N l10n238[]={{svg,.110},H}; -N l10n239[]={{sts,.477},{six,.171},{sYyh,.092},H}; -N l10n240[]={{sedq,.330},H}; -N l10n242[]={{szecx,.110},H}; -N l10n243[]={{ssY,.220},{sRx,.303},{sgri7a,.184},H}; -N l10n245[]={{srw,.086},H}; -N l10n246[]={{szec,.159},{sZm,.073},H}; -N l10n247[]={{sls,.538},H}; -N l10n248[]={{sgtf8,.606},{sqy,.135},H}; -N l10n249[]={{svXr,.092},H}; -N l10n250[]={{sg7a,.918},H}; -N l10n251[]={{sgo,.532},H}; -N l10n252[]={{sXq,.098},H}; -N l10n253[]={{sxR,.086},H}; -N l10n254[]={{srec,.220},{so79,.135},{srswx,.196},H}; -N l10n255[]={{szi,.196},{sinr,.110},H}; - -D l10_d = -{ +S sred[] = { n, 237, 0 }; +S sZl[] = { 99, h, 0 }; +S sf8i[] = { 248, e, 0 }; +S stf8[] = { p, 248, 0 }; +S soe9[] = { k, 233, 0 }; +S sgtf8[] = { 32, p, 248, 0 }; +S slsg[] = { h, o, a }; +S sredg[] = { n, 237, a }; +S srec[] = { n, 236, 0 }; +S swoe9[] = { s, k, 233, 0 }; +S sgzg[] = { 32, v, a }; +S sbei[] = { 190, e, 0 }; +S sY79[] = { 98, y, 0 }; +S sZlg[] = { 99, h, a }; +S soe9g[] = { k, 233, a }; +S sz79[] = { v, y, 0 }; +S spR[] = { l, 225, 0 }; +S szfd[] = { v, 253, 0 }; +S se9ls[] = { 233, h, o, 0 }; +S se9lsg[] = { 233, h, o, a }; +S se9l[] = { 233, h, 0 }; +S srR[] = { n, 225, 0 }; +S sf8m[] = { 248, i, 0 }; +S svR[] = { r, 225, 0 }; +S sqec[] = { m, 236, 0 }; +S stf8i[] = { p, 248, e, 0 }; +S stvX[] = { p, r, 97, 0 }; +S szec[] = { v, 236, 0 }; +S sedq[] = { 237, m, 0 }; +S sre9[] = { n, 233, 0 }; +S sze9[] = { v, 233, 0 }; +S sgtf8i[] = { 32, p, 248, e, 0 }; +S sRx[] = { 225, t, 0 }; +S sbeig[] = { 190, e, a }; +S secx[] = { 236, t, 0 }; +S so79[] = { k, y, 0 }; +S stsh[] = { p, o, d, 0 }; +S sRr[] = { 225, n, 0 }; +S sre9g[] = { n, 233, a }; +S swoe9g[] = { s, k, 233, a }; +S sgvs[] = { 32, r, o, 0 }; +S sgY79[] = { 32, 98, y, 0 }; +S srecg[] = { n, 236, a }; +S soyg[] = { k, u, a }; +S s7aR[] = { z, 225, 0 }; +S stf8m[] = { p, 248, i, 0 }; +S sgz79[] = { 32, v, y, 0 }; +S svXz[] = { r, 97, v, 0 }; +S sedZ[] = { 237, 99, 0 }; +S slp[] = { h, l, 0 }; +S se8r[] = { 232, n, 0 }; +S sgtf8m[] = { 32, p, 248, i, 0 }; +S shec[] = { d, 236, 0 }; +S sh79[] = { d, y, 0 }; +S sf8ih[] = { 248, e, d, 0 }; +S srswx[] = { n, o, s, t, 0 }; +S sofd[] = { k, 253, 0 }; +S s79p[] = { y, l, 0 }; +S sgbei[] = { 32, 190, e, 0 }; +S sgbeig[] = { 32, 190, e, a }; +S sRz[] = { 225, v, 0 }; +S stvXz[] = { p, r, 97, v, 0 }; +S slsh[] = { h, o, d, 0 }; +S smpg[] = { i, l, a }; +S sedqg[] = { 237, m, a }; +S sr79[] = { n, y, 0 }; +S soe9l[] = { k, 233, h, 0 }; +S s7ar[] = { z, n, 0 }; +S sned[] = { j, 237, 0 }; +S sfdZlg[] = { 253, 99, h, a }; +S so79g[] = { k, y, a }; +S sfdZl[] = { 253, 99, h, 0 }; +S szR[] = { v, 225, 0 }; +S soe9ls[] = { k, 233, h, o, 0 }; +S sfdZ[] = { 253, 99, 0 }; +S sze9g[] = { v, 233, a }; +S swoe9l[] = { s, k, 233, h, 0 }; +S szr[] = { v, n, 0 }; +S ssze9[] = { o, v, 233, 0 }; +S sb9ed[] = { 185, 237, 0 }; +S sh79g[] = { d, y, a }; +S sgzfd[] = { 32, v, 253, 0 }; +S s7at[] = { z, p, 0 }; +S szed[] = { v, 237, 0 }; +S szXx[] = { v, 97, t, 0 }; +S sRp[] = { 225, l, 0 }; +S stf8ih[] = { p, 248, e, d, 0 }; +S sZls[] = { 99, h, o, 0 }; +S sgtsh[] = { 32, p, o, d, 0 }; +S soh[] = { k, d, 0 }; +S sgsY[] = { 32, o, 98, 0 }; +S shp[] = { d, l, 0 }; +S sxR[] = { t, 225, 0 }; +S swts[] = { s, p, o, 0 }; +S sR7a[] = { 225, z, 0 }; +S stsp[] = { p, o, l, 0 }; +S sY79p[] = { 98, y, l, 0 }; +S slv[] = { h, r, 0 }; +S sZo[] = { 99, k, 0 }; +S se8i[] = { 232, e, 0 }; +S shyg[] = { d, u, a }; +S sx79[] = { t, y, 0 }; +S sgsh[] = { 32, o, d, 0 }; +S sRw[] = { 225, s, 0 }; +S s7aig[] = { z, e, a }; +S swsz[] = { s, o, v, 0 }; +S svs7a[] = { r, o, z, 0 }; +S soR[] = { k, 225, 0 }; +S secp[] = { 236, l, 0 }; +S sg7aR[] = { 32, z, 225, 0 }; +S swsy[] = { s, o, u, 0 }; +S sgrR[] = { 32, n, 225, 0 }; +S sszec[] = { o, v, 236, 0 }; +S sgoh[] = { 32, k, d, 0 }; +S sshy[] = { o, d, u, 0 }; +S swxg[] = { s, t, a }; +S sgsg[] = { 32, o, a }; +S sg7ag[] = { 32, z, a }; +S ssvy[] = { o, r, u, 0 }; +S s7aXl[] = { z, 97, h, 0 }; +S szb9[] = { v, 185, 0 }; +S sY79g[] = { 98, y, a }; +S sszX[] = { o, v, 97, 0 }; +S szecx[] = { v, 236, t, 0 }; +S snr[] = { j, n, 0 }; +S svXh[] = { r, 97, d, 0 }; +S siwo[] = { e, s, k, 0 }; +S sedls[] = { 237, h, o, 0 }; +S sgY79p[] = { 32, 98, y, l, 0 }; +S srfd[] = { n, 253, 0 }; +S sgxXo[] = { 32, t, 97, k, 0 }; +S sgZi[] = { 32, 99, e, 0 }; +S srwo[] = { n, s, k, 0 }; +S szred[] = { v, n, 237, 0 }; +S sRq[] = { 225, m, 0 }; +S sinr[] = { e, j, n, 0 }; +S sxip[] = { t, e, l, 0 }; +S sredq[] = { n, 237, m, 0 }; +S sfdq[] = { 253, m, 0 }; +S se8m[] = { 232, i, 0 }; +S sRred[] = { 225, n, 237, 0 }; +S sgrec[] = { 32, n, 236, 0 }; +S sZed[] = { 99, 237, 0 }; +S sgZl[] = { 32, 99, h, 0 }; +S sedl[] = { 237, h, 0 }; +S sswxg[] = { o, s, t, a }; +S sx79g[] = { t, y, a }; +S syn[] = { u, j, 0 }; +S sg7aXl[] = { 32, z, 97, h, 0 }; +S shf9[] = { d, 249, 0 }; +S swps[] = { s, l, o, 0 }; +S slvX[] = { h, r, 97, 0 }; +S sgri7a[] = { 32, n, e, z, 0 }; +S swq[] = { s, m, 0 }; +S secw[] = { 236, s, 0 }; +S ssbe[] = { o, 190, 0 }; +S slR[] = { h, 225, 0 }; +S sYyh[] = { 98, u, d, 0 }; +S sszfd[] = { o, v, 253, 0 }; +S ssze9g[] = { o, v, 233, a }; +S sxred[] = { t, n, 237, 0 }; +S sXe8[] = { 97, 232, 0 }; +S sgwsy[] = { 32, s, o, u, 0 }; +S spsz[] = { l, o, v, 0 }; +S sxsq[] = { t, o, m, 0 }; +S syY[] = { u, 98, 0 }; +S sredqg[] = { n, 237, m, a }; +S sYec[] = { 98, 236, 0 }; +S shw[] = { d, s, 0 }; +S swxv[] = { s, t, r, 0 }; +S sc8i[] = { 200, e, 0 }; +S sswp[] = { o, s, l, 0 }; +S sedlsg[] = { 237, h, o, a }; + +N l10n0[] = { { sgxXo, .220 }, H }; +N l10n1[] = { { sf8m, .385 }, { stX, .098 }, { swxg, .165 }, H }; +N l10n2[] = { { swig, .330 }, H }; +N l10n3[] = { { ssv, .220 }, H }; +N l10n4[] = { { ssZ, .061 }, H }; +N l10n5[] = { { sxm, .208 }, { smr, .171 }, { spR, .171 }, H }; +N l10n6[] = { { srx, .122 }, H }; +N l10n7[] = { { sri, .392 }, { szed, .086 }, H }; +N l10n8[] = { { swo, .416 }, { stf8, .294 }, H }; +N l10n9[] = { { sf8ih, .372 }, H }; +N l10n10[] = { { ssvy, .110 }, { sgosr, .184 }, H }; +N l10n11[] = { { swoe9, .330 }, H }; +N l10n12[] = { { sgp, .239 }, H }; +N l10n13[] = { { sXr, .245 }, { spm, .245 }, { swg, .294 }, { sgzi, .248 }, H }; +N l10n14[] = { { sfdZlg, .661 }, { sosr, .128 }, H }; +N l10n15[] = { { sred, .428 }, { ssbe, .061 }, H }; +N l10n16[] = { { sswx, .220 }, H }; +N l10n17[] = { { siz, .086 }, { se8m, .165 }, H }; +N l10n18[] = { { sZig, .220 }, H }; +N l10n20[] = { { ssw, .294 }, { s7ar, .098 }, H }; +N l10n21[] = { { ssh, .441 }, { sgts, .743 }, { sog, .294 }, { shm, .110 }, { sRz, .220 }, { sx79, .086 }, H }; +N l10n22[] = { { sgzg, .496 }, { sxXo, .110 }, H }; +N l10n23[] = { { szfd, .171 }, { sbeig, .454 }, H }; +N l10n24[] = { { sZo, .086 }, H }; +N l10n25[] = { { swp, .184 }, H }; +N l10n26[] = { { soyg, .275 }, { sxsq, .092 }, H }; +N l10n27[] = { { szXg, .165 }, H }; +N l10n28[] = { { svr, .110 }, { sshy, .110 }, H }; +N l10n29[] = { { sgq, .441 }, { sZg, .092 }, H }; +N l10n30[] = { { sredqg, .184 }, H }; +N l10n31[] = { { se9l, .385 }, { srfd, .073 }, H }; +N l10n33[] = { { sop, .086 }, H }; +N l10n34[] = { { stv, .502 }, { sbeg, .275 }, { swts, .128 }, H }; +N l10n35[] = { { srXg, .688 }, { sze9g, .220 }, H }; +N l10n36[] = { { sb9ed, .128 }, { swxm, .110 }, { snr, .073 }, H }; +N l10n37[] = { { sg7aX, .496 }, { ssx, .147 }, { sh79, .110 }, H }; +N l10n38[] = { { sszfd, .092 }, H }; +N l10n39[] = { { sgtf8i, .441 }, { sxo, .073 }, { sXe8, .061 }, { sgwp, .138 }, H }; +N l10n40[] = { { sgc8, .128 }, H }; +N l10n41[] = { { spig, .138 }, H }; +N l10n42[] = { { slv, .086 }, { swq, .061 }, H }; +N l10n43[] = { { sre9g, .275 }, H }; +N l10n44[] = { { sxg, .477 }, { sqm, .110 }, H }; +N l10n45[] = { { svs, .477 }, H }; +N l10n46[] = { { sgr, 1.230 }, H }; +N l10n49[] = { { sxyg, .193 }, H }; +N l10n51[] = { { sgtf8m, .330 }, { soe9ls, .196 }, H }; +N l10n52[] = { { spg, .477 }, H }; +N l10n53[] = { { sgbeig, .294 }, { syn, .073 }, H }; +N l10n54[] = { { ssy, .355 }, { sgtv, .743 }, { sfdZ, .220 }, { s7at, .086 }, H }; +N l10n55[] = { { s7aX, .245 }, { sgvs, .275 }, { secw, .138 }, H }; +N l10n58[] = { { sgwig, .441 }, { sXog, .165 }, H }; +N l10n59[] = { { stsh, .202 }, { szR, .098 }, H }; +N l10n60[] = { { shg, .165 }, H }; +N l10n61[] = { { sYs, .147 }, H }; +N l10n63[] = { { svX, .489 }, { sgs, .532 }, H }; +N l10n65[] = { { sgni, .496 }, { sgtsh, .257 }, { shyg, .193 }, H }; +N l10n67[] = { { srR, .171 }, { szm, .098 }, { slsh, .147 }, { smpg, .220 }, { swoe9l, .196 }, H }; +N l10n68[] = { { se9lsg, 1.156 }, H }; +N l10n69[] = { { sin, .220 }, { sZlg, .413 }, { snir, .092 }, H }; +N l10n70[] = { { sedZ, .248 }, H }; +N l10n71[] = { { ssz, .514 }, { sf9g, .372 }, { snX, .098 }, { sgoh, .165 }, { sY79g, .165 }, H }; +N l10n72[] = { { sgws, .330 }, { secx, .303 }, { sge8, .184 }, { shp, .086 }, H }; +N l10n73[] = { { sghs, .303 }, H }; +N l10n74[] = { { smZ, .159 }, { ssze9, .128 }, H }; +N l10n75[] = { { syg, 1.138 }, { srm, .171 }, { sXpg, .165 }, H }; +N l10n76[] = { { sws, .232 }, H }; +N l10n77[] = { { stvX, .239 }, H }; +N l10n80[] = { { sgt, 1.725 }, { sedqg, .496 }, H }; +N l10n81[] = { { sgX, .679 }, { sXv, .110 }, { svXz, .165 }, { sg7ai, .165 }, H }; +N l10n82[] = { { sXZ, .110 }, { sgrec, .165 }, H }; +N l10n83[] = { { sqg, .697 }, { sz79, .184 }, { swsy, .128 }, H }; +N l10n84[] = { { sos, .281 }, H }; +N l10n85[] = { { si7a, .184 }, { slvX, .092 }, H }; +N l10n86[] = { { sio, .061 }, H }; +N l10n87[] = { { se9g, 1.569 }, { slsg, .578 }, H }; +N l10n89[] = { { sgrX, .716 }, { sgxs, .441 }, { sR7a, .193 }, H }; +N l10n90[] = { { sxr, .159 }, { smw, .110 }, { sg7ag, .165 }, H }; +N l10n91[] = { { sig, 1.248 }, { sr79, .098 }, H }; +N l10n92[] = { { sZs, .098 }, H }; +N l10n93[] = { { swt, .086 }, { sg7aXl, .220 }, H }; +N l10n94[] = { { srecg, .275 }, { so79g, .220 }, { swsz, .128 }, { swX, .073 }, H }; +N l10n95[] = { { stf8i, .239 }, { sRg, .454 }, H }; +N l10n96[] = { { sedls, .248 }, H }; +N l10n98[] = { { sgY, .532 }, { sXw, .159 }, H }; +N l10n99[] = { { sXh, .257 }, H }; +N l10n101[] = { { sxip, .110 }, H }; +N l10n102[] = { { soX, .196 }, { se8r, .248 }, H }; +N l10n103[] = { { sip, .159 }, H }; +N l10n104[] = { { syq, .073 }, H }; +N l10n106[] = { { szg, .367 }, { shr, .184 }, H }; +N l10n107[] = { { sxs, .379 }, { smx, .184 }, { swoe9g, .367 }, { sRp, .193 }, { svs7a, .128 }, { sszec, .110 }, H }; +N l10n110[] = { { soe9, .281 }, H }; +N l10n111[] = { { sredg, .523 }, H }; +N l10n112[] = { { sswxg, .220 }, H }; +N l10n114[] = { { sgv, .404 }, { srg, .165 }, { sszX, .110 }, H }; +N l10n115[] = { { sps, .355 }, { sXx, .294 }, { sgZ, .312 }, H }; +N l10n117[] = { { sgsY, .193 }, { sx79g, .165 }, H }; +N l10n119[] = { { siwo, .110 }, H }; +N l10n120[] = { { siq, .147 }, H }; +N l10n122[] = { { sirw, .092 }, H }; +N l10n123[] = { { shs, .269 }, { s7ai, .232 }, H }; +N l10n124[] = { { sRq, .165 }, H }; +N l10n125[] = { { sxX, .306 }, H }; +N l10n126[] = { { sgbe, .165 }, H }; +N l10n127[] = { { sgwx, .303 }, H }; +N l10n128[] = { { svXZ, .092 }, H }; +N l10n130[] = { { svx, .061 }, H }; +N l10n131[] = { { sgw, 1.450 }, { sgtvs, .514 }, { svi, .122 }, H }; +N l10n132[] = { { sgh, .661 }, H }; +N l10n133[] = { { spX, .294 }, { sgri, .633 }, { sh79g, .193 }, { sirx, .110 }, { spsz, .092 }, H }; +N l10n135[] = { { sov, .086 }, { swxv, .092 }, H }; +N l10n137[] = { { sir, .355 }, { slR, .061 }, { sxred, .092 }, H }; +N l10n138[] = { { sYec, .061 }, H }; +N l10n139[] = { { sni, .318 }, { ss7a, .184 }, { stf8m, .184 }, { stf8ih, .171 }, { sY79p, .128 }, { s7ay, .086 }, { sgsh, .193 }, { svXh, .110 }, H }; +N l10n140[] = { { sso, .098 }, H }; +N l10n141[] = { { shX, .171 }, { sRr, .275 }, { sgls, .275 }, H }; +N l10n142[] = { { srwo, .110 }, H }; +N l10n145[] = { { ssg, 1.487 }, H }; +N l10n146[] = { { sqs, .110 }, H }; +N l10n147[] = { { svy, .122 }, { sned, .098 }, { stsp, .128 }, { szb9, .073 }, { sYi, .061 }, H }; +N l10n148[] = { { sgx, .514 }, H }; +N l10n149[] = { { sXz, .281 }, { sgwz, .358 }, { sgY79, .275 }, { sgzfd, .193 }, H }; +N l10n150[] = { { ssyg, .385 }, H }; +N l10n152[] = { { szr, .086 }, H }; +N l10n153[] = { { soh, .086 }, H }; +N l10n155[] = { { sedl, .165 }, H }; +N l10n157[] = { { ssp, .147 }, H }; +N l10n158[] = { { sxv, .135 }, H }; +N l10n159[] = { { sgsg, .165 }, H }; +N l10n161[] = { { swx, .624 }, { sgnig, .257 }, H }; +N l10n162[] = { { swi, .196 }, { srsw, .165 }, H }; +N l10n163[] = { { sYy, .098 }, H }; +N l10n165[] = { { sgy, .165 }, { sg7aR, .193 }, { shf9, .061 }, H }; +N l10n167[] = { { sXl, .110 }, { sgwsy, .184 }, H }; +N l10n169[] = { { szs, .232 }, H }; +N l10n170[] = { { sZls, .128 }, { ssze9g, .184 }, H }; +N l10n171[] = { { sit, .110 }, H }; +N l10n173[] = { { syY, .061 }, H }; +N l10n174[] = { { ssq, .135 }, { sfdZl, .330 }, H }; +N l10n175[] = { { stvXz, .196 }, { s7aXl, .110 }, { sxw, .061 }, H }; +N l10n177[] = { { sgXg, .661 }, { srs, .220 }, H }; +N l10n178[] = { { sZi, .232 }, H }; +N l10n180[] = { { secg, .867 }, H }; +N l10n182[] = { { sgz, 1.230 }, H }; +N l10n183[] = { { sbei, .294 }, { s7aR, .122 }, { szXx, .128 }, H }; +N l10n184[] = { { slg, .275 }, { sswp, .092 }, H }; +N l10n185[] = { { sgrXg, .551 }, { sgxsg, .330 }, H }; +N l10n186[] = { { soy, .147 }, { sZed, .073 }, H }; +N l10n187[] = { { szX, .306 }, { sr79g, .220 }, H }; +N l10n188[] = { { sRred, .248 }, H }; +N l10n189[] = { { sf8i, .661 }, { siY, .073 }, H }; +N l10n190[] = { { sredq, .110 }, H }; +N l10n191[] = { { svR, .159 }, { ssr, .122 }, { s7am, .073 }, { sgxX, .165 }, { shw, .061 }, H }; +N l10n192[] = { { sgos, .275 }, { secp, .193 }, { sXzX, .110 }, { sedlsg, .413 }, H }; +N l10n193[] = { { sxi, .306 }, H }; +N l10n194[] = { { sofd, .098 }, H }; +N l10n195[] = { { srX, .563 }, { swz, .159 }, { sze9, .147 }, { sfdg, .496 }, H }; +N l10n196[] = { { slp, .110 }, H }; +N l10n198[] = { { soXg, .165 }, H }; +N l10n199[] = { { s79g, .918 }, { svm, .073 }, { szred, .110 }, H }; +N l10n200[] = { { sgl, .257 }, { shec, .110 }, H }; +N l10n201[] = { { spi, .294 }, H }; +N l10n202[] = { { sXxi, .128 }, { sgZi, .165 }, H }; +N l10n203[] = { { sxsg, .468 }, { sre9, .147 }, { smxg, .165 }, H }; +N l10n204[] = { { swxX, .165 }, H }; +N l10n205[] = { { siv, .147 }, { se8i, .193 }, H }; +N l10n206[] = { { soe9g, .413 }, { siZ, .110 }, H }; +N l10n207[] = { { snm, .122 }, { syh, .086 }, H }; +N l10n209[] = { { sxy, .171 }, { shi, .110 }, H }; +N l10n210[] = { { smo, .122 }, H }; +N l10n211[] = { { sedg, 1.858 }, { spsg, .385 }, { s79p, .098 }, H }; +N l10n213[] = { { sgbei, .220 }, H }; +N l10n215[] = { { smg, .624 }, H }; +N l10n216[] = { { siqg, .248 }, H }; +N l10n217[] = { { spy, .122 }, { sX7a, .098 }, { sgrR, .193 }, { sgY79p, .220 }, H }; +N l10n218[] = { { sXo, .257 }, { sgwi, .385 }, { siwx, .128 }, H }; +N l10n219[] = { { s7aig, .193 }, H }; +N l10n220[] = { { szv, .073 }, H }; +N l10n222[] = { { siw, .232 }, { swps, .092 }, H }; +N l10n223[] = { { sXg, 1.597 }, { sih, .257 }, { sqec, .159 }, { syx, .110 }, H }; +N l10n224[] = { { sfdq, .165 }, H }; +N l10n225[] = { { shy, .098 }, { sst, .098 }, H }; +N l10n226[] = { { sxz, .098 }, { sRw, .193 }, H }; +N l10n227[] = { { smp, .196 }, { sgwg, .165 }, H }; +N l10n228[] = { { se9ls, .578 }, H }; +N l10n229[] = { { sZl, .416 }, { spXg, .330 }, H }; +N l10n230[] = { { soe9l, .147 }, { soR, .086 }, { swm, .073 }, { s7ag, .110 }, H }; +N l10n231[] = { { stvs, .294 }, { sY79, .184 }, H }; +N l10n232[] = { { sqi, .086 }, H }; +N l10n233[] = { { sgz79, .275 }, H }; +N l10n234[] = { { sgn, .606 }, H }; +N l10n235[] = { { sXp, .281 }, { snig, .303 }, { sgZl, .165 }, H }; +N l10n237[] = { { sc8i, .138 }, H }; +N l10n238[] = { { svg, .110 }, H }; +N l10n239[] = { { sts, .477 }, { six, .171 }, { sYyh, .092 }, H }; +N l10n240[] = { { sedq, .330 }, H }; +N l10n242[] = { { szecx, .110 }, H }; +N l10n243[] = { { ssY, .220 }, { sRx, .303 }, { sgri7a, .184 }, H }; +N l10n245[] = { { srw, .086 }, H }; +N l10n246[] = { { szec, .159 }, { sZm, .073 }, H }; +N l10n247[] = { { sls, .538 }, H }; +N l10n248[] = { { sgtf8, .606 }, { sqy, .135 }, H }; +N l10n249[] = { { svXr, .092 }, H }; +N l10n250[] = { { sg7a, .918 }, H }; +N l10n251[] = { { sgo, .532 }, H }; +N l10n252[] = { { sXq, .098 }, H }; +N l10n253[] = { { sxR, .086 }, H }; +N l10n254[] = { { srec, .220 }, { so79, .135 }, { srswx, .196 }, H }; +N l10n255[] = { { szi, .196 }, { sinr, .110 }, H }; + +D l10_d = { "czech", "iso-8859-2", - { - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,0.000, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,0.147,0.035,0.047,0.072,0.136,0.005,0.006,0.048,0.073,0.036,0.072,0.088,0.055,0.122,0.172, - 0.071,W,0.080,0.102,0.105,0.067,0.096,0.001,W,0.042,0.053,W,W,W,0.001,W, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - Y,Y,Y,Y,Y,Y,Y,Y,Y,0.001,Y,Y,Y,Y,Y,Y, - Y,Y,Y,0.001,Y,Y,Y,Y,Y,0.019,Y,0.001,Y,Y,0.025,Y, - Y,V,V,V,V,V,V,V,0.008,V,V,V,V,V,V,V, - V,V,V,V,V,V,V,V,V,V,0.001,V,V,0.001,V,V, - V,0.109,V,V,V,V,V,V,0.042,0.062,0.001,V,0.072,0.101,V,V, - V,V,0.006,0.004,V,V,V,V,0.057,0.023,0.002,V,V,0.039,V,V - }, - { - l10n0,l10n1,l10n2,l10n3,l10n4,l10n5,l10n6,l10n7,l10n8,l10n9,l10n10,l10n11,l10n12,l10n13,l10n14,l10n15, - l10n16,l10n17,l10n18,X,l10n20,l10n21,l10n22,l10n23,l10n24,l10n25,l10n26,l10n27,l10n28,l10n29,l10n30,l10n31, - X,l10n33,l10n34,l10n35,l10n36,l10n37,l10n38,l10n39,l10n40,l10n41,l10n42,l10n43,l10n44,l10n45,l10n46,X, - X,l10n49,X,l10n51,l10n52,l10n53,l10n54,l10n55,X,X,l10n58,l10n59,l10n60,l10n61,X,l10n63, - X,l10n65,X,l10n67,l10n68,l10n69,l10n70,l10n71,l10n72,l10n73,l10n74,l10n75,l10n76,l10n77,X,X, - l10n80,l10n81,l10n82,l10n83,l10n84,l10n85,l10n86,l10n87,X,l10n89,l10n90,l10n91,l10n92,l10n93,l10n94,l10n95, - l10n96,X,l10n98,l10n99,X,l10n101,l10n102,l10n103,l10n104,X,l10n106,l10n107,X,X,l10n110,l10n111, - l10n112,X,l10n114,l10n115,X,l10n117,X,l10n119,l10n120,X,l10n122,l10n123,l10n124,l10n125,l10n126,l10n127, - l10n128,X,l10n130,l10n131,l10n132,l10n133,X,l10n135,X,l10n137,l10n138,l10n139,l10n140,l10n141,l10n142,X, - X,l10n145,l10n146,l10n147,l10n148,l10n149,l10n150,X,l10n152,l10n153,X,l10n155,X,l10n157,l10n158,l10n159, - X,l10n161,l10n162,l10n163,X,l10n165,X,l10n167,X,l10n169,l10n170,l10n171,X,l10n173,l10n174,l10n175, - X,l10n177,l10n178,X,l10n180,X,l10n182,l10n183,l10n184,l10n185,l10n186,l10n187,l10n188,l10n189,l10n190,l10n191, - l10n192,l10n193,l10n194,l10n195,l10n196,X,l10n198,l10n199,l10n200,l10n201,l10n202,l10n203,l10n204,l10n205,l10n206,l10n207, - X,l10n209,l10n210,l10n211,X,l10n213,X,l10n215,l10n216,l10n217,l10n218,l10n219,l10n220,X,l10n222,l10n223, - l10n224,l10n225,l10n226,l10n227,l10n228,l10n229,l10n230,l10n231,l10n232,l10n233,l10n234,l10n235,X,l10n237,l10n238,l10n239, - l10n240,X,l10n242,l10n243,X,l10n245,l10n246,l10n247,l10n248,l10n249,l10n250,l10n251,l10n252,l10n253,l10n254,l10n255 - } + { W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, 0.000, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, 0.147, 0.035, 0.047, 0.072, 0.136, 0.005, 0.006, 0.048, 0.073, 0.036, 0.072, 0.088, 0.055, 0.122, 0.172, + 0.071, W, 0.080, 0.102, 0.105, 0.067, 0.096, 0.001, W, 0.042, 0.053, W, W, W, 0.001, W, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + Y, Y, Y, Y, Y, Y, Y, Y, Y, 0.001, Y, Y, Y, Y, Y, Y, + Y, Y, Y, 0.001, Y, Y, Y, Y, Y, 0.019, Y, 0.001, Y, Y, 0.025, Y, + Y, V, V, V, V, V, V, V, 0.008, V, V, V, V, V, V, V, + V, V, V, V, V, V, V, V, V, V, 0.001, V, V, 0.001, V, V, + V, 0.109, V, V, V, V, V, V, 0.042, 0.062, 0.001, V, 0.072, 0.101, V, V, + V, V, 0.006, 0.004, V, V, V, V, 0.057, 0.023, 0.002, V, V, 0.039, V, V }, + { l10n0, l10n1, l10n2, l10n3, l10n4, l10n5, l10n6, l10n7, l10n8, l10n9, l10n10, l10n11, l10n12, l10n13, l10n14, l10n15, + l10n16, l10n17, l10n18, X, l10n20, l10n21, l10n22, l10n23, l10n24, l10n25, l10n26, l10n27, l10n28, l10n29, l10n30, l10n31, + X, l10n33, l10n34, l10n35, l10n36, l10n37, l10n38, l10n39, l10n40, l10n41, l10n42, l10n43, l10n44, l10n45, l10n46, X, + X, l10n49, X, l10n51, l10n52, l10n53, l10n54, l10n55, X, X, l10n58, l10n59, l10n60, l10n61, X, l10n63, + X, l10n65, X, l10n67, l10n68, l10n69, l10n70, l10n71, l10n72, l10n73, l10n74, l10n75, l10n76, l10n77, X, X, + l10n80, l10n81, l10n82, l10n83, l10n84, l10n85, l10n86, l10n87, X, l10n89, l10n90, l10n91, l10n92, l10n93, l10n94, l10n95, + l10n96, X, l10n98, l10n99, X, l10n101, l10n102, l10n103, l10n104, X, l10n106, l10n107, X, X, l10n110, l10n111, + l10n112, X, l10n114, l10n115, X, l10n117, X, l10n119, l10n120, X, l10n122, l10n123, l10n124, l10n125, l10n126, l10n127, + l10n128, X, l10n130, l10n131, l10n132, l10n133, X, l10n135, X, l10n137, l10n138, l10n139, l10n140, l10n141, l10n142, X, + X, l10n145, l10n146, l10n147, l10n148, l10n149, l10n150, X, l10n152, l10n153, X, l10n155, X, l10n157, l10n158, l10n159, + X, l10n161, l10n162, l10n163, X, l10n165, X, l10n167, X, l10n169, l10n170, l10n171, X, l10n173, l10n174, l10n175, + X, l10n177, l10n178, X, l10n180, X, l10n182, l10n183, l10n184, l10n185, l10n186, l10n187, l10n188, l10n189, l10n190, l10n191, + l10n192, l10n193, l10n194, l10n195, l10n196, X, l10n198, l10n199, l10n200, l10n201, l10n202, l10n203, l10n204, l10n205, l10n206, l10n207, + X, l10n209, l10n210, l10n211, X, l10n213, X, l10n215, l10n216, l10n217, l10n218, l10n219, l10n220, X, l10n222, l10n223, + l10n224, l10n225, l10n226, l10n227, l10n228, l10n229, l10n230, l10n231, l10n232, l10n233, l10n234, l10n235, X, l10n237, l10n238, l10n239, + l10n240, X, l10n242, l10n243, X, l10n245, l10n246, l10n247, l10n248, l10n249, l10n250, l10n251, l10n252, l10n253, l10n254, l10n255 } }; - - // // Lng: danish // Enc: iso-8859-15 // - -S sjs[]={f,o,0}; -S sjsv[]={f,o,r,0}; -S sgsk[]={32,o,g,0}; -S sgskg[]={32,o,g,a}; -S sgjs[]={32,f,o,0}; -S sgjsv[]={32,f,o,r,0}; -S sgXjg[]={32,97,f,a}; -S sXjg[]={97,f,a}; -S sgXj[]={32,97,f,0}; -S shix[]={d,e,t,0}; -S shir[]={d,e,n,0}; -S sghix[]={32,d,e,t,0}; -S sipwi[]={e,l,s,e,0}; -S shixg[]={d,e,t,a}; -S spwi[]={l,s,e,0}; -S sgivg[]={32,e,r,a}; -S swiv[]={s,e,r,0}; -S sxmp[]={t,i,l,0}; -S svo[]={r,k,0}; -S swoi[]={s,k,e,0}; -S smrkg[]={i,n,g,a}; -S sgXxg[]={32,97,t,a}; -S sf8v[]={248,r,0}; -S svmr[]={r,i,n,0}; -S sghiv[]={32,d,e,r,0}; -S swivg[]={s,e,r,a}; -S svmwx[]={r,i,s,t,0}; -S sooi[]={k,k,e,0}; -S ssph[]={o,l,d,0}; -S skx[]={g,t,0}; -S soo[]={k,k,0}; -S sgxm[]={32,t,i,0}; -S shirg[]={d,e,n,a}; -S sjv[]={f,r,0}; -S skir[]={g,e,n,0}; -S sghir[]={32,d,e,n,0}; -S sXvo[]={97,r,k,0}; -S sjsvg[]={f,o,r,a}; -S sgxmp[]={32,t,i,l,0}; -S svmrk[]={r,i,n,g,0}; -S swoig[]={s,k,e,a}; -S swir[]={s,e,n,0}; -S sgXv[]={32,97,r,0}; -S spiv[]={l,e,r,0}; -S siri[]={e,n,e,0}; -S spwig[]={l,s,e,a}; -S spmk[]={l,i,g,0}; -S sxmpg[]={t,i,l,a}; -S sWv[]={230,r,0}; -S sxx[]={t,t,0}; -S smooi[]={i,k,k,e,0}; -S sXki[]={97,g,e,0}; -S sgyrh[]={32,u,n,d,0}; -S sgjv[]={32,f,r,0}; -S sZlvm[]={99,h,r,i,0}; -S slvm[]={h,r,i,0}; -S srr[]={n,n,0}; -S sjx[]={f,t,0}; -S sivig[]={e,r,e,a}; -S slsp[]={h,o,l,0}; -S skip[]={g,e,l,0}; -S skw[]={g,s,0}; -S sZlv[]={99,h,r,0}; -S sXpi[]={97,l,e,0}; -S syrhi[]={u,n,d,e,0}; -S smoo[]={i,k,k,0}; -S sirwg[]={e,n,s,a}; -S smwxm[]={i,s,t,i,0}; -S sgixg[]={32,e,t,a}; -S sirhi[]={e,n,d,e,0}; -S ssvw[]={o,r,s,0}; -S skirg[]={g,e,n,a}; -S svY[]={r,98,0}; -S swZl[]={s,99,h,0}; -S shXr[]={d,97,n,0}; -S sihg[]={e,d,a}; -S srZi[]={n,99,e,0}; -S ssxi[]={o,t,e,0}; -S sgmo[]={32,i,k,0}; -S skivg[]={g,e,r,a}; -S swov[]={s,k,r,0}; -S sgmoo[]={32,i,k,k,0}; -S sXpp[]={97,l,l,0}; -S sWp[]={230,l,0}; -S slvmw[]={h,r,i,s,0}; -S sgZlv[]={32,99,h,r,0}; -S slsph[]={h,o,l,d,0}; -S srri[]={n,n,e,0}; -S sooig[]={k,k,e,a}; -S svix[]={r,e,t,0}; -S swirg[]={s,e,n,a}; -S sYir[]={98,e,n,0}; -S sippi[]={e,l,l,e,0}; -S sosrk[]={k,o,n,g,0}; -S sszi[]={o,v,e,0}; -S sriv[]={n,e,r,0}; -S srmrk[]={n,i,n,g,0}; -S sgyh[]={32,u,d,0}; -S smXrg[]={i,97,n,a}; -S siqX[]={e,m,97,0}; -S szW[]={v,230,0}; -S sWr[]={230,n,0}; -S sgszi[]={32,o,v,e,0}; -S spmki[]={l,i,g,e,0}; -S swxmX[]={s,t,i,97,0}; -S spmrk[]={l,i,n,g,0}; -S srhig[]={n,d,e,a}; -S ssziv[]={o,v,e,r,0}; -S ssrki[]={o,n,g,e,0}; -S szXvg[]={v,97,r,a}; -S svwx[]={r,s,t,0}; -S sxxi[]={t,t,e,0}; -S sgzXv[]={32,v,97,r,0}; -S swiw[]={s,e,s,0}; -S sgnX[]={32,j,97,0}; -S szXv[]={v,97,r,0}; -S sqq[]={m,m,0}; -S sxivg[]={t,e,r,a}; -S sjsvw[]={f,o,r,s,0}; -S srkir[]={n,g,e,n,0}; -S smXr[]={i,97,n,0}; -S sghXr[]={32,d,97,n,0}; -S ssphg[]={o,l,d,a}; -S sgsz[]={32,o,v,0}; -S smwo[]={i,s,k,0}; -S soiv[]={k,e,r,0}; -S svog[]={r,k,a}; -S sxmXr[]={t,i,97,n,0}; -S sxmX[]={t,i,97,0}; -S sphg[]={l,d,a}; -S sXppi[]={97,l,l,e,0}; -S ssrk[]={o,n,g,0}; -S sizi[]={e,v,e,0}; -S sqXvo[]={m,97,r,k,0}; -S szip[]={v,e,l,0}; -S skipw[]={g,e,l,s,0}; -S sjf8[]={f,248,0}; -S sviz[]={r,e,v,0}; -S spwiv[]={l,s,e,r,0}; -S swf8[]={s,248,0}; -S sivr[]={e,r,n,0}; -S swsq[]={s,o,m,0}; -S svsk[]={r,o,g,0}; -S svrig[]={r,n,e,a}; -S sgirh[]={32,e,n,d,0}; -S skr[]={g,n,0}; -S smrki[]={i,n,g,e,0}; -S sXkx[]={97,g,t,0}; - -N l11n1[]={{szXvg,.238},{swxg,.149},H}; -N l11n2[]={{swig,.298},H}; -N l11n3[]={{ssv,.543},H}; -N l11n4[]={{sirhi,.185},H}; -N l11n5[]={{smr,.635},{sxm,.463},{srmr,.119},H}; -N l11n6[]={{srx,.159},{sZlvm,.212},{sgwm,.238},{sWp,.208},{slvmw,.185},H}; -N l11n7[]={{sri,.437},{sghm,.208},{sxivg,.238},H}; -N l11n8[]={{swo,.410},H}; -N l11n9[]={{slX,.199},{sxmpg,.357},H}; -N l11n10[]={{soig,.506},{sgosr,.278},{sYp,.093},H}; -N l11n11[]={{skv,.093},{sipp,.119},H}; -N l11n12[]={{sgskg,1.033},{sgp,.238},H}; -N l11n13[]={{sXr,.556},{swg,.675},{spm,.344},H}; -N l11n14[]={{spwi,.338},{sosr,.218},{sjx,.106},{ssqg,.208},H}; -N l11n15[]={{sphi,.159},{sgst,.149},H}; -N l11n16[]={{soo,.146},H}; -N l11n17[]={{siz,.212},H}; -N l11n18[]={{sik,.185},H}; -N l11n19[]={{sgXjg,.834},H}; -N l11n20[]={{svmwx,.318},{skiv,.199},H}; -N l11n21[]={{sog,.318},{shm,.132},{sgnX,.179},H}; -N l11n22[]={{sms,.079},H}; -N l11n23[]={{shivg,.874},{sgxm,.298},{sxxi,.119},H}; -N l11n24[]={{sphg,.179},H}; -N l11n28[]={{sgwo,.238},{skw,.106},{svr,.093},H}; -N l11n29[]={{sgq,.496},H}; -N l11n33[]={{sxig,.298},{sxXp,.119},H}; -N l11n34[]={{stv,.119},H}; -N l11n36[]={{sivi,.357},{swxm,.278},H}; -N l11n37[]={{sghir,.397},{ssx,.106},H}; -N l11n40[]={{smX,.106},{sWr,.179},H}; -N l11n41[]={{srk,.556},{spig,.238},H}; -N l11n42[]={{slv,.132},H}; -N l11n43[]={{skipw,.132},H}; -N l11n44[]={{sxg,1.847},{sqm,.106},{ssrk,.119},H}; -N l11n45[]={{sivg,2.353},{shixg,.675},{svs,.146},{skx,.146},H}; -N l11n46[]={{ski,.675},{sgr,.139},H}; -N l11n48[]={{sxmX,.119},H}; -N l11n49[]={{shig,.923},{sghiv,.477},H}; -N l11n52[]={{spg,.238},H}; -N l11n54[]={{sgtv,.208},{sghmi,.199},H}; -N l11n55[]={{sghix,.675},{sgXv,.298},{sgzXv,.238},H}; -N l11n57[]={{sgmg,.566},{sgzm,.208},H}; -N l11n58[]={{sippi,.159},{srmrk,.159},H}; -N l11n59[]={{sghig,.516},H}; -N l11n60[]={{shg,.496},{srZi,.139},H}; -N l11n61[]={{svir,.218},H}; -N l11n62[]={{siwg,.328},H}; -N l11n63[]={{sgs,.874},{svX,.212},{sihg,.208},H}; -N l11n64[]={{spp,.265},H}; -N l11n65[]={{sgZlv,.278},H}; -N l11n66[]={{sXpi,.159},{smXrg,.238},H}; -N l11n67[]={{szm,.146},{smpg,.298},{sosrk,.159},H}; -N l11n69[]={{smkig,.278},{sti,.079},H}; -N l11n71[]={{shXr,.139},{ssz,.093},{snX,.079},{swxmX,.159},H}; -N l11n72[]={{ssk,.490},{sgqX,.298},{skirg,.278},{sgYv,.208},{sgws,.179},H}; -N l11n73[]={{ssphg,.238},{svog,.179},{smv,.066},H}; -N l11n75[]={{srm,.132},H}; -N l11n76[]={{sws,.119},H}; -N l11n77[]={{srhi,.397},{sgXx,.357},{sli,.106},{sYir,.119},H}; -N l11n79[]={{sixg,1.400},{sgir,.536},H}; -N l11n80[]={{sgt,.397},{sivm,.218},{svY,.093},H}; -N l11n81[]={{sgX,1.251},{sXv,.556},{smrh,.139},{sgsz,.179},H}; -N l11n83[]={{sqg,.298},{sjm,.066},H}; -N l11n84[]={{sos,.278},H}; -N l11n85[]={{srwg,.238},H}; -N l11n86[]={{smwx,.278},{sio,.119},{srhg,.238},H}; -N l11n88[]={{sipw,.377},H}; -N l11n90[]={{smw,.371},H}; -N l11n91[]={{sig,2.800},{smh,.225},{sgxmp,.397},{ssrki,.159},H}; -N l11n92[]={{swir,.199},H}; -N l11n94[]={{swX,.106},H}; -N l11n95[]={{swoi,.258},{sgyr,.268},H}; -N l11n98[]={{sgY,.516},H}; -N l11n99[]={{ssvg,.357},H}; -N l11n100[]={{spwiv,.132},H}; -N l11n101[]={{sxip,.139},{smrg,.208},{swf8,.066},H}; -N l11n102[]={{soX,.106},{swxs,.159},H}; -N l11n103[]={{sip,.622},{sooi,.218},{srig,.328},H}; -N l11n104[]={{sizi,.119},{syq,.066},H}; -N l11n106[]={{szg,.159},H}; -N l11n107[]={{sgjs,.745},{sxs,.159},{smoo,.159},H}; -N l11n108[]={{smi,.159},{sWv,.268},{shmi,.099},H}; -N l11n109[]={{sXrg,.387},{svwx,.119},H}; -N l11n110[]={{spwig,.357},H}; -N l11n112[]={{sYv,.159},{sqq,.079},H}; -N l11n113[]={{svw,.278},H}; -N l11n114[]={{srg,1.469},{smrk,.477},{svh,.119},{sgv,.139},{sgmo,.208},H}; -N l11n115[]={{sXx,.304},{sgZ,.199},H}; -N l11n116[]={{sgqi,.208},{skivg,.278},H}; -N l11n117[]={{ship,.159},H}; -N l11n120[]={{siq,.199},H}; -N l11n121[]={{syr,.304},{sYiv,.119},H}; -N l11n122[]={{sjg,.457},{sirw,.218},{spmk,.179},{sxmXr,.159},H}; -N l11n123[]={{sgiv,.477},{sxir,.119},{sgirh,.199},H}; -N l11n124[]={{ssxi,.139},H}; -N l11n125[]={{sxX,.199},H}; -N l11n127[]={{sgwx,.298},{svix,.139},H}; -N l11n128[]={{srki,.377},{swZ,.106},{sgszi,.238},H}; -N l11n129[]={{svmr,.238},H}; -N l11n130[]={{svx,.212},H}; -N l11n131[]={{svi,.821},{sgw,1.033},H}; -N l11n132[]={{sgh,1.589},{sivig,.318},H}; -N l11n133[]={{sXj,.331},{spX,.159},{sirx,.159},H}; -N l11n135[]={{sipwi,.450},{sov,.146},{sivr,.099},H}; -N l11n136[]={{swiv,.298},H}; -N l11n137[]={{sir,1.390},{srkg,.417},H}; -N l11n138[]={{sqXv,.139},H}; -N l11n139[]={{shir,.357},{sgyrh,.318},H}; -N l11n140[]={{sgjv,.238},H}; -N l11n141[]={{shX,.159},{smz,.079},H}; -N l11n142[]={{smk,.225},{skig,.477},H}; -N l11n143[]={{sXpp,.139},H}; -N l11n144[]={{szW,.079},{soiv,.119},H}; -N l11n145[]={{sgix,.238},{smwxm,.212},H}; -N l11n146[]={{sXkx,.099},H}; -N l11n147[]={{sYi,.357},{sgmr,.208},{swiw,.119},{svy,.079},H}; -N l11n148[]={{sgx,.635},H}; -N l11n149[]={{sgi,1.052},{sXz,.106},{sviz,.099},H}; -N l11n150[]={{sXk,.238},H}; -N l11n151[]={{sppi,.298},H}; -N l11n153[]={{skg,.973},H}; -N l11n154[]={{sf8v,.357},{smooi,.212},{svsk,.099},H}; -N l11n155[]={{slsp,.159},H}; -N l11n157[]={{ssp,.225},H}; -N l11n158[]={{sxv,.146},{sszi,.119},H}; -N l11n159[]={{sjsv,.556},H}; -N l11n160[]={{srr,.106},H}; -N l11n161[]={{swx,.649},{szXv,.119},{smrki,.132},H}; -N l11n162[]={{swi,.635},{sqir,.119},H}; -N l11n163[]={{srhiv,.238},{siqX,.119},{szip,.099},H}; -N l11n164[]={{sqX,.331},H}; -N l11n165[]={{sgy,.318},H}; -N l11n166[]={{sgj,.973},H}; -N l11n167[]={{sxiv,.258},H}; -N l11n168[]={{sskg,.923},H}; -N l11n169[]={{sxmp,.298},{sox,.093},{spmki,.159},{szs,.066},H}; -N l11n170[]={{soi,.410},H}; -N l11n172[]={{sgsk,.804},H}; -N l11n173[]={{sgXxg,.477},{slvm,.159},{srhig,.238},H}; -N l11n174[]={{ssq,.212},H}; -N l11n175[]={{spiv,.199},{sgirg,.318},{sghX,.238},{sxw,.093},H}; -N l11n177[]={{sXvg,.238},{srs,.066},H}; -N l11n178[]={{sZi,.146},{smhi,.179},H}; -N l11n179[]={{sgXj,.625},{sgmoo,.278},H}; -N l11n182[]={{sgz,.496},{svmrk,.265},{sgw79,.149},H}; -N l11n183[]={{shiv,.635},{spw,.278},{sgk,.179},H}; -N l11n184[]={{sph,.291},{svmw,.278},H}; -N l11n185[]={{sjs,.424},{sgYi,.208},H}; -N l11n187[]={{szX,.119},H}; -N l11n188[]={{swirg,.238},H}; -N l11n189[]={{siY,.119},H}; -N l11n190[]={{sivw,.218},{sXppi,.159},H}; -N l11n191[]={{ssr,.238},{swoig,.397},{shw,.093},H}; -N l11n192[]={{sgos,.506},{sxx,.106},H}; -N l11n193[]={{sxi,.715},{sgjsv,.913},H}; -N l11n195[]={{srX,.066},H}; -N l11n197[]={{syrh,.258},H}; -N l11n199[]={{svm,.530},{sg_,.199},{spmr,.159},{slsph,.185},{sooig,.278},{skr,.066},H}; -N l11n200[]={{sgl,.298},H}; -N l11n201[]={{spi,.582},{sgvi,.149},H}; -N l11n202[]={{srkir,.159},H}; -N l11n203[]={{sZlv,.159},{sqXvo,.159},{sjX,.066},H}; -N l11n204[]={{smig,.179},{shmig,.199},H}; -N l11n205[]={{siv,1.827},{shix,.377},H}; -N l11n206[]={{syw,.093},H}; -N l11n207[]={{syh,.093},H}; -N l11n209[]={{shi,1.575},H}; -N l11n210[]={{smo,.212},{smrkg,.516},{skip,.159},{sjf8,.066},H}; -N l11n211[]={{sXxg,.357},{svrig,.199},H}; -N l11n212[]={{sXvm,.099},H}; -N l11n213[]={{sirh,.218},H}; -N l11n215[]={{smg,.457},{sYm,.079},H}; -N l11n217[]={{sgm,.715},H}; -N l11n218[]={{sirwg,.318},{siwx,.119},H}; -N l11n219[]={{sghi,1.817},{sgivg,.596},{sVg,.268},H}; -N l11n222[]={{siw,.357},H}; -N l11n223[]={{sih,.185},H}; -N l11n224[]={{siri,.179},H}; -N l11n225[]={{sst,.172},{sgzX,.208},H}; -N l11n226[]={{smXr,.119},H}; -N l11n227[]={{smp,.291},{svig,.625},H}; -N l11n229[]={{sXjg,.625},{sZl,.252},{smki,.218},{srZ,.106},{sziv,.139},H}; -N l11n230[]={{swm,.146},H}; -N l11n232[]={{sqi,.238},{swivg,.477},{skir,.199},H}; -N l11n233[]={{sirg,1.400},{svo,.172},{ssph,.218},H}; -N l11n234[]={{sgn,.199},{sXvo,.199},{sipm,.099},H}; -N l11n235[]={{sXp,.318},{shirg,.397},{sgZl,.208},{sgxi,.208},H}; -N l11n236[]={{sjv,.132},H}; -N l11n237[]={{sXki,.159},{sriv,.119},H}; -N l11n238[]={{svg,2.125},{som,.119},{swov,.139},H}; -N l11n239[]={{six,.755},H}; -N l11n241[]={{sgixg,.318},{sgyh,.179},H}; -N l11n243[]={{smwo,.119},H}; -N l11n244[]={{syrhi,.212},{ssvw,.139},{ssziv,.159},H}; -N l11n245[]={{srw,.278},H}; -N l11n246[]={{srh,.503},{sw79,.079},H}; -N l11n247[]={{sls,.132},{srri,.139},H}; -N l11n248[]={{swxi,.199},{swZl,.139},{sqy,.079},{sjsvw,.159},H}; -N l11n249[]={{sghXr,.238},H}; -N l11n251[]={{sgo,.755},{swsq,.099},H}; -N l11n252[]={{sXq,.185},{spmrk,.159},H}; -N l11n255[]={{szi,.304},{sjsvg,.397},H}; - -D l11_d = -{ +S sjs[] = { f, o, 0 }; +S sjsv[] = { f, o, r, 0 }; +S sgsk[] = { 32, o, g, 0 }; +S sgskg[] = { 32, o, g, a }; +S sgjs[] = { 32, f, o, 0 }; +S sgjsv[] = { 32, f, o, r, 0 }; +S sgXjg[] = { 32, 97, f, a }; +S sXjg[] = { 97, f, a }; +S sgXj[] = { 32, 97, f, 0 }; +S shix[] = { d, e, t, 0 }; +S shir[] = { d, e, n, 0 }; +S sghix[] = { 32, d, e, t, 0 }; +S sipwi[] = { e, l, s, e, 0 }; +S shixg[] = { d, e, t, a }; +S spwi[] = { l, s, e, 0 }; +S sgivg[] = { 32, e, r, a }; +S swiv[] = { s, e, r, 0 }; +S sxmp[] = { t, i, l, 0 }; +S svo[] = { r, k, 0 }; +S swoi[] = { s, k, e, 0 }; +S smrkg[] = { i, n, g, a }; +S sgXxg[] = { 32, 97, t, a }; +S sf8v[] = { 248, r, 0 }; +S svmr[] = { r, i, n, 0 }; +S sghiv[] = { 32, d, e, r, 0 }; +S swivg[] = { s, e, r, a }; +S svmwx[] = { r, i, s, t, 0 }; +S sooi[] = { k, k, e, 0 }; +S ssph[] = { o, l, d, 0 }; +S skx[] = { g, t, 0 }; +S soo[] = { k, k, 0 }; +S sgxm[] = { 32, t, i, 0 }; +S shirg[] = { d, e, n, a }; +S sjv[] = { f, r, 0 }; +S skir[] = { g, e, n, 0 }; +S sghir[] = { 32, d, e, n, 0 }; +S sXvo[] = { 97, r, k, 0 }; +S sjsvg[] = { f, o, r, a }; +S sgxmp[] = { 32, t, i, l, 0 }; +S svmrk[] = { r, i, n, g, 0 }; +S swoig[] = { s, k, e, a }; +S swir[] = { s, e, n, 0 }; +S sgXv[] = { 32, 97, r, 0 }; +S spiv[] = { l, e, r, 0 }; +S siri[] = { e, n, e, 0 }; +S spwig[] = { l, s, e, a }; +S spmk[] = { l, i, g, 0 }; +S sxmpg[] = { t, i, l, a }; +S sWv[] = { 230, r, 0 }; +S sxx[] = { t, t, 0 }; +S smooi[] = { i, k, k, e, 0 }; +S sXki[] = { 97, g, e, 0 }; +S sgyrh[] = { 32, u, n, d, 0 }; +S sgjv[] = { 32, f, r, 0 }; +S sZlvm[] = { 99, h, r, i, 0 }; +S slvm[] = { h, r, i, 0 }; +S srr[] = { n, n, 0 }; +S sjx[] = { f, t, 0 }; +S sivig[] = { e, r, e, a }; +S slsp[] = { h, o, l, 0 }; +S skip[] = { g, e, l, 0 }; +S skw[] = { g, s, 0 }; +S sZlv[] = { 99, h, r, 0 }; +S sXpi[] = { 97, l, e, 0 }; +S syrhi[] = { u, n, d, e, 0 }; +S smoo[] = { i, k, k, 0 }; +S sirwg[] = { e, n, s, a }; +S smwxm[] = { i, s, t, i, 0 }; +S sgixg[] = { 32, e, t, a }; +S sirhi[] = { e, n, d, e, 0 }; +S ssvw[] = { o, r, s, 0 }; +S skirg[] = { g, e, n, a }; +S svY[] = { r, 98, 0 }; +S swZl[] = { s, 99, h, 0 }; +S shXr[] = { d, 97, n, 0 }; +S sihg[] = { e, d, a }; +S srZi[] = { n, 99, e, 0 }; +S ssxi[] = { o, t, e, 0 }; +S sgmo[] = { 32, i, k, 0 }; +S skivg[] = { g, e, r, a }; +S swov[] = { s, k, r, 0 }; +S sgmoo[] = { 32, i, k, k, 0 }; +S sXpp[] = { 97, l, l, 0 }; +S sWp[] = { 230, l, 0 }; +S slvmw[] = { h, r, i, s, 0 }; +S sgZlv[] = { 32, 99, h, r, 0 }; +S slsph[] = { h, o, l, d, 0 }; +S srri[] = { n, n, e, 0 }; +S sooig[] = { k, k, e, a }; +S svix[] = { r, e, t, 0 }; +S swirg[] = { s, e, n, a }; +S sYir[] = { 98, e, n, 0 }; +S sippi[] = { e, l, l, e, 0 }; +S sosrk[] = { k, o, n, g, 0 }; +S sszi[] = { o, v, e, 0 }; +S sriv[] = { n, e, r, 0 }; +S srmrk[] = { n, i, n, g, 0 }; +S sgyh[] = { 32, u, d, 0 }; +S smXrg[] = { i, 97, n, a }; +S siqX[] = { e, m, 97, 0 }; +S szW[] = { v, 230, 0 }; +S sWr[] = { 230, n, 0 }; +S sgszi[] = { 32, o, v, e, 0 }; +S spmki[] = { l, i, g, e, 0 }; +S swxmX[] = { s, t, i, 97, 0 }; +S spmrk[] = { l, i, n, g, 0 }; +S srhig[] = { n, d, e, a }; +S ssziv[] = { o, v, e, r, 0 }; +S ssrki[] = { o, n, g, e, 0 }; +S szXvg[] = { v, 97, r, a }; +S svwx[] = { r, s, t, 0 }; +S sxxi[] = { t, t, e, 0 }; +S sgzXv[] = { 32, v, 97, r, 0 }; +S swiw[] = { s, e, s, 0 }; +S sgnX[] = { 32, j, 97, 0 }; +S szXv[] = { v, 97, r, 0 }; +S sqq[] = { m, m, 0 }; +S sxivg[] = { t, e, r, a }; +S sjsvw[] = { f, o, r, s, 0 }; +S srkir[] = { n, g, e, n, 0 }; +S smXr[] = { i, 97, n, 0 }; +S sghXr[] = { 32, d, 97, n, 0 }; +S ssphg[] = { o, l, d, a }; +S sgsz[] = { 32, o, v, 0 }; +S smwo[] = { i, s, k, 0 }; +S soiv[] = { k, e, r, 0 }; +S svog[] = { r, k, a }; +S sxmXr[] = { t, i, 97, n, 0 }; +S sxmX[] = { t, i, 97, 0 }; +S sphg[] = { l, d, a }; +S sXppi[] = { 97, l, l, e, 0 }; +S ssrk[] = { o, n, g, 0 }; +S sizi[] = { e, v, e, 0 }; +S sqXvo[] = { m, 97, r, k, 0 }; +S szip[] = { v, e, l, 0 }; +S skipw[] = { g, e, l, s, 0 }; +S sjf8[] = { f, 248, 0 }; +S sviz[] = { r, e, v, 0 }; +S spwiv[] = { l, s, e, r, 0 }; +S swf8[] = { s, 248, 0 }; +S sivr[] = { e, r, n, 0 }; +S swsq[] = { s, o, m, 0 }; +S svsk[] = { r, o, g, 0 }; +S svrig[] = { r, n, e, a }; +S sgirh[] = { 32, e, n, d, 0 }; +S skr[] = { g, n, 0 }; +S smrki[] = { i, n, g, e, 0 }; +S sXkx[] = { 97, g, t, 0 }; + +N l11n1[] = { { szXvg, .238 }, { swxg, .149 }, H }; +N l11n2[] = { { swig, .298 }, H }; +N l11n3[] = { { ssv, .543 }, H }; +N l11n4[] = { { sirhi, .185 }, H }; +N l11n5[] = { { smr, .635 }, { sxm, .463 }, { srmr, .119 }, H }; +N l11n6[] = { { srx, .159 }, { sZlvm, .212 }, { sgwm, .238 }, { sWp, .208 }, { slvmw, .185 }, H }; +N l11n7[] = { { sri, .437 }, { sghm, .208 }, { sxivg, .238 }, H }; +N l11n8[] = { { swo, .410 }, H }; +N l11n9[] = { { slX, .199 }, { sxmpg, .357 }, H }; +N l11n10[] = { { soig, .506 }, { sgosr, .278 }, { sYp, .093 }, H }; +N l11n11[] = { { skv, .093 }, { sipp, .119 }, H }; +N l11n12[] = { { sgskg, 1.033 }, { sgp, .238 }, H }; +N l11n13[] = { { sXr, .556 }, { swg, .675 }, { spm, .344 }, H }; +N l11n14[] = { { spwi, .338 }, { sosr, .218 }, { sjx, .106 }, { ssqg, .208 }, H }; +N l11n15[] = { { sphi, .159 }, { sgst, .149 }, H }; +N l11n16[] = { { soo, .146 }, H }; +N l11n17[] = { { siz, .212 }, H }; +N l11n18[] = { { sik, .185 }, H }; +N l11n19[] = { { sgXjg, .834 }, H }; +N l11n20[] = { { svmwx, .318 }, { skiv, .199 }, H }; +N l11n21[] = { { sog, .318 }, { shm, .132 }, { sgnX, .179 }, H }; +N l11n22[] = { { sms, .079 }, H }; +N l11n23[] = { { shivg, .874 }, { sgxm, .298 }, { sxxi, .119 }, H }; +N l11n24[] = { { sphg, .179 }, H }; +N l11n28[] = { { sgwo, .238 }, { skw, .106 }, { svr, .093 }, H }; +N l11n29[] = { { sgq, .496 }, H }; +N l11n33[] = { { sxig, .298 }, { sxXp, .119 }, H }; +N l11n34[] = { { stv, .119 }, H }; +N l11n36[] = { { sivi, .357 }, { swxm, .278 }, H }; +N l11n37[] = { { sghir, .397 }, { ssx, .106 }, H }; +N l11n40[] = { { smX, .106 }, { sWr, .179 }, H }; +N l11n41[] = { { srk, .556 }, { spig, .238 }, H }; +N l11n42[] = { { slv, .132 }, H }; +N l11n43[] = { { skipw, .132 }, H }; +N l11n44[] = { { sxg, 1.847 }, { sqm, .106 }, { ssrk, .119 }, H }; +N l11n45[] = { { sivg, 2.353 }, { shixg, .675 }, { svs, .146 }, { skx, .146 }, H }; +N l11n46[] = { { ski, .675 }, { sgr, .139 }, H }; +N l11n48[] = { { sxmX, .119 }, H }; +N l11n49[] = { { shig, .923 }, { sghiv, .477 }, H }; +N l11n52[] = { { spg, .238 }, H }; +N l11n54[] = { { sgtv, .208 }, { sghmi, .199 }, H }; +N l11n55[] = { { sghix, .675 }, { sgXv, .298 }, { sgzXv, .238 }, H }; +N l11n57[] = { { sgmg, .566 }, { sgzm, .208 }, H }; +N l11n58[] = { { sippi, .159 }, { srmrk, .159 }, H }; +N l11n59[] = { { sghig, .516 }, H }; +N l11n60[] = { { shg, .496 }, { srZi, .139 }, H }; +N l11n61[] = { { svir, .218 }, H }; +N l11n62[] = { { siwg, .328 }, H }; +N l11n63[] = { { sgs, .874 }, { svX, .212 }, { sihg, .208 }, H }; +N l11n64[] = { { spp, .265 }, H }; +N l11n65[] = { { sgZlv, .278 }, H }; +N l11n66[] = { { sXpi, .159 }, { smXrg, .238 }, H }; +N l11n67[] = { { szm, .146 }, { smpg, .298 }, { sosrk, .159 }, H }; +N l11n69[] = { { smkig, .278 }, { sti, .079 }, H }; +N l11n71[] = { { shXr, .139 }, { ssz, .093 }, { snX, .079 }, { swxmX, .159 }, H }; +N l11n72[] = { { ssk, .490 }, { sgqX, .298 }, { skirg, .278 }, { sgYv, .208 }, { sgws, .179 }, H }; +N l11n73[] = { { ssphg, .238 }, { svog, .179 }, { smv, .066 }, H }; +N l11n75[] = { { srm, .132 }, H }; +N l11n76[] = { { sws, .119 }, H }; +N l11n77[] = { { srhi, .397 }, { sgXx, .357 }, { sli, .106 }, { sYir, .119 }, H }; +N l11n79[] = { { sixg, 1.400 }, { sgir, .536 }, H }; +N l11n80[] = { { sgt, .397 }, { sivm, .218 }, { svY, .093 }, H }; +N l11n81[] = { { sgX, 1.251 }, { sXv, .556 }, { smrh, .139 }, { sgsz, .179 }, H }; +N l11n83[] = { { sqg, .298 }, { sjm, .066 }, H }; +N l11n84[] = { { sos, .278 }, H }; +N l11n85[] = { { srwg, .238 }, H }; +N l11n86[] = { { smwx, .278 }, { sio, .119 }, { srhg, .238 }, H }; +N l11n88[] = { { sipw, .377 }, H }; +N l11n90[] = { { smw, .371 }, H }; +N l11n91[] = { { sig, 2.800 }, { smh, .225 }, { sgxmp, .397 }, { ssrki, .159 }, H }; +N l11n92[] = { { swir, .199 }, H }; +N l11n94[] = { { swX, .106 }, H }; +N l11n95[] = { { swoi, .258 }, { sgyr, .268 }, H }; +N l11n98[] = { { sgY, .516 }, H }; +N l11n99[] = { { ssvg, .357 }, H }; +N l11n100[] = { { spwiv, .132 }, H }; +N l11n101[] = { { sxip, .139 }, { smrg, .208 }, { swf8, .066 }, H }; +N l11n102[] = { { soX, .106 }, { swxs, .159 }, H }; +N l11n103[] = { { sip, .622 }, { sooi, .218 }, { srig, .328 }, H }; +N l11n104[] = { { sizi, .119 }, { syq, .066 }, H }; +N l11n106[] = { { szg, .159 }, H }; +N l11n107[] = { { sgjs, .745 }, { sxs, .159 }, { smoo, .159 }, H }; +N l11n108[] = { { smi, .159 }, { sWv, .268 }, { shmi, .099 }, H }; +N l11n109[] = { { sXrg, .387 }, { svwx, .119 }, H }; +N l11n110[] = { { spwig, .357 }, H }; +N l11n112[] = { { sYv, .159 }, { sqq, .079 }, H }; +N l11n113[] = { { svw, .278 }, H }; +N l11n114[] = { { srg, 1.469 }, { smrk, .477 }, { svh, .119 }, { sgv, .139 }, { sgmo, .208 }, H }; +N l11n115[] = { { sXx, .304 }, { sgZ, .199 }, H }; +N l11n116[] = { { sgqi, .208 }, { skivg, .278 }, H }; +N l11n117[] = { { ship, .159 }, H }; +N l11n120[] = { { siq, .199 }, H }; +N l11n121[] = { { syr, .304 }, { sYiv, .119 }, H }; +N l11n122[] = { { sjg, .457 }, { sirw, .218 }, { spmk, .179 }, { sxmXr, .159 }, H }; +N l11n123[] = { { sgiv, .477 }, { sxir, .119 }, { sgirh, .199 }, H }; +N l11n124[] = { { ssxi, .139 }, H }; +N l11n125[] = { { sxX, .199 }, H }; +N l11n127[] = { { sgwx, .298 }, { svix, .139 }, H }; +N l11n128[] = { { srki, .377 }, { swZ, .106 }, { sgszi, .238 }, H }; +N l11n129[] = { { svmr, .238 }, H }; +N l11n130[] = { { svx, .212 }, H }; +N l11n131[] = { { svi, .821 }, { sgw, 1.033 }, H }; +N l11n132[] = { { sgh, 1.589 }, { sivig, .318 }, H }; +N l11n133[] = { { sXj, .331 }, { spX, .159 }, { sirx, .159 }, H }; +N l11n135[] = { { sipwi, .450 }, { sov, .146 }, { sivr, .099 }, H }; +N l11n136[] = { { swiv, .298 }, H }; +N l11n137[] = { { sir, 1.390 }, { srkg, .417 }, H }; +N l11n138[] = { { sqXv, .139 }, H }; +N l11n139[] = { { shir, .357 }, { sgyrh, .318 }, H }; +N l11n140[] = { { sgjv, .238 }, H }; +N l11n141[] = { { shX, .159 }, { smz, .079 }, H }; +N l11n142[] = { { smk, .225 }, { skig, .477 }, H }; +N l11n143[] = { { sXpp, .139 }, H }; +N l11n144[] = { { szW, .079 }, { soiv, .119 }, H }; +N l11n145[] = { { sgix, .238 }, { smwxm, .212 }, H }; +N l11n146[] = { { sXkx, .099 }, H }; +N l11n147[] = { { sYi, .357 }, { sgmr, .208 }, { swiw, .119 }, { svy, .079 }, H }; +N l11n148[] = { { sgx, .635 }, H }; +N l11n149[] = { { sgi, 1.052 }, { sXz, .106 }, { sviz, .099 }, H }; +N l11n150[] = { { sXk, .238 }, H }; +N l11n151[] = { { sppi, .298 }, H }; +N l11n153[] = { { skg, .973 }, H }; +N l11n154[] = { { sf8v, .357 }, { smooi, .212 }, { svsk, .099 }, H }; +N l11n155[] = { { slsp, .159 }, H }; +N l11n157[] = { { ssp, .225 }, H }; +N l11n158[] = { { sxv, .146 }, { sszi, .119 }, H }; +N l11n159[] = { { sjsv, .556 }, H }; +N l11n160[] = { { srr, .106 }, H }; +N l11n161[] = { { swx, .649 }, { szXv, .119 }, { smrki, .132 }, H }; +N l11n162[] = { { swi, .635 }, { sqir, .119 }, H }; +N l11n163[] = { { srhiv, .238 }, { siqX, .119 }, { szip, .099 }, H }; +N l11n164[] = { { sqX, .331 }, H }; +N l11n165[] = { { sgy, .318 }, H }; +N l11n166[] = { { sgj, .973 }, H }; +N l11n167[] = { { sxiv, .258 }, H }; +N l11n168[] = { { sskg, .923 }, H }; +N l11n169[] = { { sxmp, .298 }, { sox, .093 }, { spmki, .159 }, { szs, .066 }, H }; +N l11n170[] = { { soi, .410 }, H }; +N l11n172[] = { { sgsk, .804 }, H }; +N l11n173[] = { { sgXxg, .477 }, { slvm, .159 }, { srhig, .238 }, H }; +N l11n174[] = { { ssq, .212 }, H }; +N l11n175[] = { { spiv, .199 }, { sgirg, .318 }, { sghX, .238 }, { sxw, .093 }, H }; +N l11n177[] = { { sXvg, .238 }, { srs, .066 }, H }; +N l11n178[] = { { sZi, .146 }, { smhi, .179 }, H }; +N l11n179[] = { { sgXj, .625 }, { sgmoo, .278 }, H }; +N l11n182[] = { { sgz, .496 }, { svmrk, .265 }, { sgw79, .149 }, H }; +N l11n183[] = { { shiv, .635 }, { spw, .278 }, { sgk, .179 }, H }; +N l11n184[] = { { sph, .291 }, { svmw, .278 }, H }; +N l11n185[] = { { sjs, .424 }, { sgYi, .208 }, H }; +N l11n187[] = { { szX, .119 }, H }; +N l11n188[] = { { swirg, .238 }, H }; +N l11n189[] = { { siY, .119 }, H }; +N l11n190[] = { { sivw, .218 }, { sXppi, .159 }, H }; +N l11n191[] = { { ssr, .238 }, { swoig, .397 }, { shw, .093 }, H }; +N l11n192[] = { { sgos, .506 }, { sxx, .106 }, H }; +N l11n193[] = { { sxi, .715 }, { sgjsv, .913 }, H }; +N l11n195[] = { { srX, .066 }, H }; +N l11n197[] = { { syrh, .258 }, H }; +N l11n199[] = { { svm, .530 }, { sg_, .199 }, { spmr, .159 }, { slsph, .185 }, { sooig, .278 }, { skr, .066 }, H }; +N l11n200[] = { { sgl, .298 }, H }; +N l11n201[] = { { spi, .582 }, { sgvi, .149 }, H }; +N l11n202[] = { { srkir, .159 }, H }; +N l11n203[] = { { sZlv, .159 }, { sqXvo, .159 }, { sjX, .066 }, H }; +N l11n204[] = { { smig, .179 }, { shmig, .199 }, H }; +N l11n205[] = { { siv, 1.827 }, { shix, .377 }, H }; +N l11n206[] = { { syw, .093 }, H }; +N l11n207[] = { { syh, .093 }, H }; +N l11n209[] = { { shi, 1.575 }, H }; +N l11n210[] = { { smo, .212 }, { smrkg, .516 }, { skip, .159 }, { sjf8, .066 }, H }; +N l11n211[] = { { sXxg, .357 }, { svrig, .199 }, H }; +N l11n212[] = { { sXvm, .099 }, H }; +N l11n213[] = { { sirh, .218 }, H }; +N l11n215[] = { { smg, .457 }, { sYm, .079 }, H }; +N l11n217[] = { { sgm, .715 }, H }; +N l11n218[] = { { sirwg, .318 }, { siwx, .119 }, H }; +N l11n219[] = { { sghi, 1.817 }, { sgivg, .596 }, { sVg, .268 }, H }; +N l11n222[] = { { siw, .357 }, H }; +N l11n223[] = { { sih, .185 }, H }; +N l11n224[] = { { siri, .179 }, H }; +N l11n225[] = { { sst, .172 }, { sgzX, .208 }, H }; +N l11n226[] = { { smXr, .119 }, H }; +N l11n227[] = { { smp, .291 }, { svig, .625 }, H }; +N l11n229[] = { { sXjg, .625 }, { sZl, .252 }, { smki, .218 }, { srZ, .106 }, { sziv, .139 }, H }; +N l11n230[] = { { swm, .146 }, H }; +N l11n232[] = { { sqi, .238 }, { swivg, .477 }, { skir, .199 }, H }; +N l11n233[] = { { sirg, 1.400 }, { svo, .172 }, { ssph, .218 }, H }; +N l11n234[] = { { sgn, .199 }, { sXvo, .199 }, { sipm, .099 }, H }; +N l11n235[] = { { sXp, .318 }, { shirg, .397 }, { sgZl, .208 }, { sgxi, .208 }, H }; +N l11n236[] = { { sjv, .132 }, H }; +N l11n237[] = { { sXki, .159 }, { sriv, .119 }, H }; +N l11n238[] = { { svg, 2.125 }, { som, .119 }, { swov, .139 }, H }; +N l11n239[] = { { six, .755 }, H }; +N l11n241[] = { { sgixg, .318 }, { sgyh, .179 }, H }; +N l11n243[] = { { smwo, .119 }, H }; +N l11n244[] = { { syrhi, .212 }, { ssvw, .139 }, { ssziv, .159 }, H }; +N l11n245[] = { { srw, .278 }, H }; +N l11n246[] = { { srh, .503 }, { sw79, .079 }, H }; +N l11n247[] = { { sls, .132 }, { srri, .139 }, H }; +N l11n248[] = { { swxi, .199 }, { swZl, .139 }, { sqy, .079 }, { sjsvw, .159 }, H }; +N l11n249[] = { { sghXr, .238 }, H }; +N l11n251[] = { { sgo, .755 }, { swsq, .099 }, H }; +N l11n252[] = { { sXq, .185 }, { spmrk, .159 }, H }; +N l11n255[] = { { szi, .304 }, { sjsvg, .397 }, H }; + +D l11_d = { "danish", "iso-8859-15", - { - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,0.001,W,W,W,W,W,W,W,0.001, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,0.116,0.038,0.019,0.108,0.330,0.055,0.083,0.032,0.120,0.012,0.073,0.102,0.053,0.154,0.097, - 0.023,W,0.181,0.124,0.138,0.033,0.037,0.008,0.003,0.011,0.002,W,W,W,W,W, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - Y,Y,Y,Y,Y,Y,0.002,Y,Y,Y,Y,Y,Y,Y,Y,Y, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,0.002,Y,Y,Y,Y, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,0.002,Y,Y,Y,Y, - Y,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V, - V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V, - V,V,V,V,0.004,0.017,0.042,V,V,V,V,V,V,V,V,V, - V,V,V,V,V,V,0.001,V,0.041,V,V,V,0.001,V,V,V - }, - { - X,l11n1,l11n2,l11n3,l11n4,l11n5,l11n6,l11n7,l11n8,l11n9,l11n10,l11n11,l11n12,l11n13,l11n14,l11n15, - l11n16,l11n17,l11n18,l11n19,l11n20,l11n21,l11n22,l11n23,l11n24,X,X,X,l11n28,l11n29,X,X, - X,l11n33,l11n34,X,l11n36,l11n37,X,X,l11n40,l11n41,l11n42,l11n43,l11n44,l11n45,l11n46,X, - l11n48,l11n49,X,X,l11n52,X,l11n54,l11n55,X,l11n57,l11n58,l11n59,l11n60,l11n61,l11n62,l11n63, - l11n64,l11n65,l11n66,l11n67,X,l11n69,X,l11n71,l11n72,l11n73,X,l11n75,l11n76,l11n77,X,l11n79, - l11n80,l11n81,X,l11n83,l11n84,l11n85,l11n86,X,l11n88,X,l11n90,l11n91,l11n92,X,l11n94,l11n95, - X,X,l11n98,l11n99,l11n100,l11n101,l11n102,l11n103,l11n104,X,l11n106,l11n107,l11n108,l11n109,l11n110,X, - l11n112,l11n113,l11n114,l11n115,l11n116,l11n117,X,X,l11n120,l11n121,l11n122,l11n123,l11n124,l11n125,X,l11n127, - l11n128,l11n129,l11n130,l11n131,l11n132,l11n133,X,l11n135,l11n136,l11n137,l11n138,l11n139,l11n140,l11n141,l11n142,l11n143, - l11n144,l11n145,l11n146,l11n147,l11n148,l11n149,l11n150,l11n151,X,l11n153,l11n154,l11n155,X,l11n157,l11n158,l11n159, - l11n160,l11n161,l11n162,l11n163,l11n164,l11n165,l11n166,l11n167,l11n168,l11n169,l11n170,X,l11n172,l11n173,l11n174,l11n175, - X,l11n177,l11n178,l11n179,X,X,l11n182,l11n183,l11n184,l11n185,X,l11n187,l11n188,l11n189,l11n190,l11n191, - l11n192,l11n193,X,l11n195,X,l11n197,X,l11n199,l11n200,l11n201,l11n202,l11n203,l11n204,l11n205,l11n206,l11n207, - X,l11n209,l11n210,l11n211,l11n212,l11n213,X,l11n215,X,l11n217,l11n218,l11n219,X,X,l11n222,l11n223, - l11n224,l11n225,l11n226,l11n227,X,l11n229,l11n230,X,l11n232,l11n233,l11n234,l11n235,l11n236,l11n237,l11n238,l11n239, - X,l11n241,X,l11n243,l11n244,l11n245,l11n246,l11n247,l11n248,l11n249,X,l11n251,l11n252,X,X,l11n255 - } + { W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, 0.001, W, W, W, W, W, W, W, 0.001, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, 0.116, 0.038, 0.019, 0.108, 0.330, 0.055, 0.083, 0.032, 0.120, 0.012, 0.073, 0.102, 0.053, 0.154, 0.097, + 0.023, W, 0.181, 0.124, 0.138, 0.033, 0.037, 0.008, 0.003, 0.011, 0.002, W, W, W, W, W, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + Y, Y, Y, Y, Y, Y, 0.002, Y, Y, Y, Y, Y, Y, Y, Y, Y, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, 0.002, Y, Y, Y, Y, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, 0.002, Y, Y, Y, Y, + Y, V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, + V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, + V, V, V, V, 0.004, 0.017, 0.042, V, V, V, V, V, V, V, V, V, + V, V, V, V, V, V, 0.001, V, 0.041, V, V, V, 0.001, V, V, V }, + { X, l11n1, l11n2, l11n3, l11n4, l11n5, l11n6, l11n7, l11n8, l11n9, l11n10, l11n11, l11n12, l11n13, l11n14, l11n15, + l11n16, l11n17, l11n18, l11n19, l11n20, l11n21, l11n22, l11n23, l11n24, X, X, X, l11n28, l11n29, X, X, + X, l11n33, l11n34, X, l11n36, l11n37, X, X, l11n40, l11n41, l11n42, l11n43, l11n44, l11n45, l11n46, X, + l11n48, l11n49, X, X, l11n52, X, l11n54, l11n55, X, l11n57, l11n58, l11n59, l11n60, l11n61, l11n62, l11n63, + l11n64, l11n65, l11n66, l11n67, X, l11n69, X, l11n71, l11n72, l11n73, X, l11n75, l11n76, l11n77, X, l11n79, + l11n80, l11n81, X, l11n83, l11n84, l11n85, l11n86, X, l11n88, X, l11n90, l11n91, l11n92, X, l11n94, l11n95, + X, X, l11n98, l11n99, l11n100, l11n101, l11n102, l11n103, l11n104, X, l11n106, l11n107, l11n108, l11n109, l11n110, X, + l11n112, l11n113, l11n114, l11n115, l11n116, l11n117, X, X, l11n120, l11n121, l11n122, l11n123, l11n124, l11n125, X, l11n127, + l11n128, l11n129, l11n130, l11n131, l11n132, l11n133, X, l11n135, l11n136, l11n137, l11n138, l11n139, l11n140, l11n141, l11n142, l11n143, + l11n144, l11n145, l11n146, l11n147, l11n148, l11n149, l11n150, l11n151, X, l11n153, l11n154, l11n155, X, l11n157, l11n158, l11n159, + l11n160, l11n161, l11n162, l11n163, l11n164, l11n165, l11n166, l11n167, l11n168, l11n169, l11n170, X, l11n172, l11n173, l11n174, l11n175, + X, l11n177, l11n178, l11n179, X, X, l11n182, l11n183, l11n184, l11n185, X, l11n187, l11n188, l11n189, l11n190, l11n191, + l11n192, l11n193, X, l11n195, X, l11n197, X, l11n199, l11n200, l11n201, l11n202, l11n203, l11n204, l11n205, l11n206, l11n207, + X, l11n209, l11n210, l11n211, l11n212, l11n213, X, l11n215, X, l11n217, l11n218, l11n219, X, X, l11n222, l11n223, + l11n224, l11n225, l11n226, l11n227, X, l11n229, l11n230, X, l11n232, l11n233, l11n234, l11n235, l11n236, l11n237, l11n238, l11n239, + X, l11n241, X, l11n243, l11n244, l11n245, l11n246, l11n247, l11n248, l11n249, X, l11n251, l11n252, X, X, l11n255 } }; - - // // Lng: dutch // Enc: iso-8859-15 // - -S swxy[]={s,t,u,0}; -S sg7am[]={32,z,i,0}; -S swxyh[]={s,t,u,d,0}; -S sgwxy[]={32,s,t,u,0}; -S sxyh[]={t,u,d,0}; -S syhi[]={u,d,e,0}; -S sgii[]={32,e,e,0}; -S syhir[]={u,d,e,n,0}; -S siirg[]={e,e,n,a}; -S sgiir[]={32,e,e,n,0}; -S s7amn[]={z,i,j,0}; -S smnr[]={i,j,n,0}; -S sg7amn[]={32,z,i,j,0}; -S sxyhi[]={t,u,d,e,0}; -S snrg[]={j,n,a}; -S smnrg[]={i,j,n,a}; -S s7amnr[]={z,i,j,n,0}; -S szss[]={v,o,o,0}; -S sirxi[]={e,n,t,e,0}; -S spmn[]={l,i,j,0}; -S smno[]={i,j,k,0}; -S szssv[]={v,o,o,r,0}; -S sgzss[]={32,v,o,o,0}; -S sno[]={j,k,0}; -S shirx[]={d,e,n,t,0}; -S s7as[]={z,o,0}; -S spmno[]={l,i,j,k,0}; -S svhi[]={r,d,e,0}; -S sssvg[]={o,o,r,a}; -S s2727[]={39,39,0}; -S smix[]={i,e,t,0}; -S smZl[]={i,99,h,0}; -S s27g[]={39,a}; -S sg7as[]={32,z,o,0}; -S srmix[]={n,i,e,t,0}; -S srxir[]={n,t,e,n,0}; -S smixg[]={i,e,t,a}; -S siki[]={e,g,e,0}; -S sipi[]={e,l,e,0}; -S sipmn[]={e,l,i,j,0}; -S sizir[]={e,v,e,n,0}; -S smnh[]={i,j,d,0}; -S ssrh[]={o,n,d,0}; -S skvs[]={g,r,o,0}; -S spirg[]={l,e,n,a}; -S szir[]={v,e,n,0}; -S sg7aig[]={32,z,e,a}; -S siivh[]={e,e,r,d,0}; -S soir[]={k,e,n,0}; -S sg2727[]={32,39,39,0}; -S smng[]={i,j,a}; -S sihi[]={e,d,e,0}; -S sxmn[]={t,i,j,0}; -S snh[]={j,d,0}; -S svhir[]={r,d,e,n,0}; -S shXX[]={d,97,97,0}; -S syhmi[]={u,d,i,e,0}; -S ssyh[]={o,u,d,0}; -S smri[]={i,n,e,0}; -S smzi[]={i,v,e,0}; -S ssyhi[]={o,u,d,e,0}; -S sXrr[]={97,n,n,0}; -S sxmnh[]={t,i,j,d,0}; -S sivhg[]={e,r,d,a}; -S sgly[]={32,h,u,0}; -S sivo[]={e,r,k,0}; -S sxyhm[]={t,u,d,i,0}; -S syhm[]={u,d,i,0}; -S sZlx[]={99,h,t,0}; -S sij[]={e,f,0}; -S sww[]={s,s,0}; -S sgsso[]={32,o,o,k,0}; -S szirg[]={v,e,n,a}; -S sxsx[]={t,o,t,0}; -S szsp[]={v,o,l,0}; -S sxmi[]={t,i,e,0}; -S ssso[]={o,o,k,0}; -S skipm[]={g,e,l,i,0}; -S sgxsx[]={32,t,o,t,0}; -S sg7amZ[]={32,z,i,99,0}; -S sgliY[]={32,h,e,98,0}; -S sqmr[]={m,i,n,0}; -S sjxg[]={f,t,a}; -S szivw[]={v,e,r,s,0}; -S s7amZl[]={z,i,99,h,0}; -S smziv[]={i,v,e,r,0}; -S sgkvs[]={32,g,r,o,0}; -S s7amZ[]={z,i,99,0}; -S sXrxg[]={97,n,t,a}; -S ssxg[]={o,t,a}; -S ssog[]={o,k,a}; -S soxg[]={k,t,a}; -S srmw[]={n,i,s,0}; - -N l12n0[]={{siy,.194},{s7amZ,.109},H}; -N l12n1[]={{stX,.182},{sij,.085},H}; -N l12n2[]={{swig,.218},{siivh,.194},H}; -N l12n3[]={{ssv,.387},H}; -N l12n5[]={{smr,.847},{sxm,.266},{srmr,.145},H}; -N l12n6[]={{srx,.375},H}; -N l12n7[]={{sri,.218},{sghm,.272},H}; -N l12n9[]={{sXrx,.127},{slX,.073},{soxg,.163},H}; -N l12n10[]={{siirg,.617},H}; -N l12n11[]={{sghXx,.545},{skv,.121},{ssrh,.145},H}; -N l12n12[]={{sgp,.290},H}; -N l12n13[]={{sXr,.980},{swg,.781},{spm,.278},{sgzi,.545},{smnh,.145},{skipm,.145},H}; -N l12n14[]={{sgki,.681},{sjx,.085},H}; -N l12n15[]={{sgst,.354},H}; -N l12n17[]={{siz,.109},H}; -N l12n18[]={{sik,.206},H}; -N l12n19[]={{svhir,.169},H}; -N l12n21[]={{shm,.327},{sog,.418},H}; -N l12n22[]={{sXXv,.436},{sssvg,.399},H}; -N l12n23[]={{shivg,.327},H}; -N l12n25[]={{sivh,.236},{szirg,.218},H}; -N l12n29[]={{sgq,.672},{sxyh,.399},H}; -N l12n30[]={{s_i,.242},{sg_i,.245},H}; -N l12n31[]={{sgli,.953},{skiw,.127},H}; -N l12n32[]={{symx,.163},H}; -N l12n33[]={{sxig,.436},{smng,.218},H}; -N l12n34[]={{ssix,.127},H}; -N l12n36[]={{sym,.218},{snr,.194},{sivi,.163},{sg2727,.218},H}; -N l12n37[]={{ssx,.157},{s7as,.133},H}; -N l12n38[]={{syhi,.399},{ssi,.242},H}; -N l12n40[]={{sipmn,.218},H}; -N l12n41[]={{srk,.424},H}; -N l12n43[]={{sgzXr,1.017},H}; -N l12n44[]={{sxg,2.397},{sqm,.109},H}; -N l12n45[]={{sivg,1.008},{svs,.218},H}; -N l12n46[]={{ski,.896},{sgr,.309},H}; -N l12n48[]={{sXX,.617},H}; -N l12n49[]={{shig,1.389},H}; -N l12n52[]={{spg,.309},{sim,.157},H}; -N l12n54[]={{sgiir,.617},{ssy,.121},{sghmi,.290},{sihi,.145},H}; -N l12n56[]={{s7amZl,.145},H}; -N l12n58[]={{srmrk,.194},{smziv,.145},H}; -N l12n59[]={{sghig,1.452},H}; -N l12n60[]={{shg,.545},{srmw,.109},H}; -N l12n61[]={{svir,.145},H}; -N l12n62[]={{szivw,.145},H}; -N l12n63[]={{sgs,.726},{svX,.242},H}; -N l12n64[]={{spp,.145},H}; -N l12n65[]={{sgni,.300},{sstg,.300},H}; -N l12n68[]={{sqixg,.290},H}; -N l12n69[]={{sZlg,.218},{sti,.097},{sgsso,.218},{sqsix,.145},{sgliY,.218},H}; -N l12n71[]={{snX,.073},H}; -N l12n72[]={{skirg,.654},{ssk,.097},{sgqX,.218},H}; -N l12n73[]={{slix,.454},{sghs,.218},H}; -N l12n74[]={{smZ,.145},{sXXrg,.436},H}; -N l12n75[]={{srm,.399},{sgxig,.254},H}; -N l12n76[]={{sxyhi,.363},{slx,.085},H}; -N l12n77[]={{sli,.496},{s7amn,.290},{srhi,.290},{szsp,.109},H}; -N l12n79[]={{sixg,1.362},{sgir,.517},{sYX,.109},{ssvh,.127},H}; -N l12n80[]={{sgt,.236},{s2727,.133},{sivm,.127},H}; -N l12n81[]={{sgX,.672},{sXv,.436},{sg7ai,.381},{smrh,.109},H}; -N l12n82[]={{syhm,.127},H}; -N l12n83[]={{sqg,.182},H}; -N l12n84[]={{sos,.085},H}; -N l12n85[]={{svmn,.145},{si7a,.085},H}; -N l12n86[]={{sio,.182},{srhg,.218},H}; -N l12n88[]={{sxyhm,.169},H}; -N l12n89[]={{sgxs,.218},{sXrh,.127},H}; -N l12n90[]={{smw,.266},{smno,.218},H}; -N l12n91[]={{sig,2.487},{smh,.085},H}; -N l12n92[]={{smri,.127},{sxmi,.109},H}; -N l12n93[]={{srxi,.290},{sly,.109},{swt,.073},H}; -N l12n98[]={{sgY,.726},{sXw,.109},{s_m,.097},H}; -N l12n99[]={{sgziv,.654},{ssvg,.300},{sXh,.133},{sgpi,.245},H}; -N l12n100[]={{soir,.145},H}; -N l12n101[]={{smrg,.381},{sxip,.127},H}; -N l12n102[]={{srxg,.272},{soX,.085},{sivo,.127},H}; -N l12n103[]={{sip,.520},{sxsx,.109},H}; -N l12n104[]={{smix,.182},{sizi,.145},H}; -N l12n105[]={{siki,.163},{ssso,.109},{sXrxg,.218},H}; -N l12n107[]={{smx,.254},{sxs,.133},H}; -N l12n108[]={{smi,.605},{shmi,.272},H}; -N l12n109[]={{sXrg,1.280},H}; -N l12n110[]={{szss,.218},{sjxg,.163},H}; -N l12n111[]={{sgstg,.290},H}; -N l12n112[]={{syhir,.436},H}; -N l12n113[]={{svw,.194},H}; -N l12n114[]={{srg,3.994},{smrk,.490},{svh,.278},{sgv,.145},H}; -N l12n115[]={{sXx,.448},{sps,.073},H}; -N l12n116[]={{sgqi,.300},H}; -N l12n117[]={{szXr,.545},H}; -N l12n118[]={{sXXvg,.508},H}; -N l12n119[]={{sg27,.236},H}; -N l12n120[]={{siq,.121},H}; -N l12n121[]={{syr,.169},{sYiv,.127},{sivhg,.254},H}; -N l12n122[]={{snh,.097},{sjg,.127},{sirw,.109},H}; -N l12n123[]={{s7ai,.327},{sglix,.908},{sgzs,.572},{sxir,.327},{smnr,.290},{shs,.109},{sgiv,.218},{sgtX,.191},H}; -N l12n124[]={{sgXX,.245},H}; -N l12n125[]={{sg7am,.681},{sxX,.145},H}; -N l12n127[]={{sgwx,.708},H}; -N l12n128[]={{srki,.290},{swZ,.157},{simh,.109},H}; -N l12n129[]={{syhmi,.169},{svmr,.127},H}; -N l12n130[]={{svx,.145},{ssyh,.127},H}; -N l12n131[]={{sgw,.672},{svi,.351},{spir,.182},H}; -N l12n132[]={{sgh,1.688},{snrg,.381},{sgymx,.218},H}; -N l12n133[]={{sirx,.290},{spX,.157},{ssxg,.163},H}; -N l12n135[]={{sov,.109},H}; -N l12n137[]={{sir,2.191},{shXx,.327},{srkg,.408},H}; -N l12n139[]={{shir,.635},{sni,.182},H}; -N l12n140[]={{sso,.085},H}; -N l12n141[]={{shX,.363},{smz,.085},{sgYX,.163},H}; -N l12n142[]={{smk,.109},H}; -N l12n144[]={{soiv,.145},{sww,.085},H}; -N l12n146[]={{sqs,.157},H}; -N l12n147[]={{sYi,.436},{sgmr,.681},{sxmn,.145},H}; -N l12n148[]={{sgx,.490},H}; -N l12n149[]={{sgi,.980},H}; -N l12n150[]={{sXk,.133},H}; -N l12n151[]={{s7amnr,.339},{sppi,.145},H}; -N l12n153[]={{skg,.563},H}; -N l12n155[]={{spmn,.218},H}; -N l12n157[]={{ssp,.133},H}; -N l12n158[]={{sxv,.109},H}; -N l12n160[]={{srr,.109},{sgqm,.163},H}; -N l12n161[]={{swx,.654},{smrki,.290},{sgnig,.399},H}; -N l12n162[]={{swi,.218},{srmi,.236},{sqir,.127},H}; -N l12n163[]={{srhiv,.242},H}; -N l12n164[]={{sqX,.169},H}; -N l12n165[]={{sgy,.218},H}; -N l12n166[]={{sg7amZ,.218},H}; -N l12n167[]={{sxiv,.200},{srxir,.218},H}; -N l12n168[]={{swxy,.472},H}; -N l12n169[]={{szs,.315},{slixg,.871},{sox,.085},H}; -N l12n170[]={{soi,.278},{siir,.327},H}; -N l12n171[]={{sit,.121},H}; -N l12n173[]={{sioi,.182},H}; -N l12n174[]={{ssq,.145},H}; -N l12n175[]={{sghX,.654},{sgirg,.690},{sxw,.097},H}; -N l12n176[]={{stg,.272},H}; -N l12n177[]={{sXvg,.381},{sgrm,.272},{srs,.097},{sg7aig,.290},{ssyhi,.169},H}; -N l12n178[]={{sizir,.194},H}; -N l12n180[]={{sirxi,.290},H}; -N l12n181[]={{sgxsx,.218},H}; -N l12n182[]={{sgz,1.398},{sssv,.327},H}; -N l12n183[]={{sgk,.635},{shiv,.309},H}; -N l12n184[]={{slg,.145},{shXX,.127},{sph,.085},H}; -N l12n185[]={{sgYi,.681},{szir,.145},H}; -N l12n186[]={{smwg,.245},H}; -N l12n187[]={{szX,.399},{sg7amn,.581},H}; -N l12n189[]={{siY,.109},{syv,.109},H}; -N l12n190[]={{sivw,.200},{sipi,.163},H}; -N l12n191[]={{s7am,.303},{ssr,.290},{sg7as,.245},{sxmnh,.169},{shw,.073},H}; -N l12n193[]={{sxi,.775},{smn,.678},H}; -N l12n194[]={{smZl,.182},H}; -N l12n195[]={{srX,.109},H}; -N l12n196[]={{szssv,.290},H}; -N l12n198[]={{sgXXr,.254},H}; -N l12n199[]={{svm,.327},{sg_,.472},{sipg,.272},{sXrr,.127},H}; -N l12n200[]={{sgl,.926},{sgzss,.436},{smixg,.327},{s_s,.073},H}; -N l12n201[]={{spi,.436},{svhi,.200},H}; -N l12n202[]={{srkir,.218},{sgmw,.163},H}; -N l12n203[]={{smxg,.218},H}; -N l12n204[]={{smig,.436},{shmig,.363},H}; -N l12n205[]={{siv,1.416},H}; -N l12n206[]={{syw,.097},H}; -N l12n207[]={{syh,.351},{sgly,.191},H}; -N l12n208[]={{sss,.387},{skvs,.145},{sgqix,.290},H}; -N l12n209[]={{shi,1.477},{sxy,.339},H}; -N l12n210[]={{skip,.254},{smrkg,.399},{smo,.097},{svhg,.191},H}; -N l12n211[]={{sXxg,.681},H}; -N l12n212[]={{swxyh,.533},H}; -N l12n213[]={{szXrg,1.053},{sirh,.145},H}; -N l12n214[]={{siiv,.309},H}; -N l12n215[]={{sYm,.097},H}; -N l12n217[]={{sgm,.690},{s27g,.182},H}; -N l12n218[]={{s_X,.145},{siwx,.182},H}; -N l12n219[]={{sghi,1.307},{sxirg,.545},{smnrg,.508},{s7aig,.354},H}; -N l12n220[]={{spmno,.266},H}; -N l12n222[]={{siw,.278},{sgwxy,.799},H}; -N l12n223[]={{sih,.242},H}; -N l12n224[]={{sgrmi,.363},H}; -N l12n225[]={{sgzX,.844},{sst,.254},{sZlx,.127},{sgov,.163},H}; -N l12n226[]={{sgqs,.300},H}; -N l12n227[]={{spirg,.290},H}; -N l12n228[]={{sqix,.145},{smzi,.127},H}; -N l12n229[]={{sziv,.527},{sZl,.290},H}; -N l12n230[]={{swm,.085},{sqmr,.109},H}; -N l12n231[]={{shirx,.266},H}; -N l12n232[]={{skir,.436},{sqi,.242},H}; -N l12n233[]={{sirg,3.704},{shXxg,.654},{svo,.109},H}; -N l12n234[]={{sgn,.309},{sXXr,.254},{sipm,.163},{skX,.085},{sgkvs,.218},H}; -N l12n235[]={{sXp,.303},{shirg,.763},{snig,.354},{sgxi,.327},H}; -N l12n236[]={{sgii,.517},{ssog,.163},H}; -N l12n238[]={{svg,1.216},H}; -N l12n239[]={{six,.811},H}; -N l12n240[]={{sii,.581},H}; -N l12n241[]={{sno,.145},H}; -N l12n242[]={{sg_X,.191},H}; -N l12n243[]={{sgmrg,.472},H}; -N l12n245[]={{srw,.169},{sgXp,.354},{sxvi,.109},H}; -N l12n246[]={{srh,.363},{sng,.145},{smrw,.127},H}; -N l12n247[]={{sls,.157},{srri,.127},H}; -N l12n248[]={{swxi,.254},{swZl,.200},H}; -N l12n249[]={{sgsr,.163},H}; -N l12n250[]={{sg7a,.908},H}; -N l12n251[]={{sgo,.527},H}; -N l12n254[]={{srmix,.218},H}; -N l12n255[]={{szi,.484},H}; - -D l12_d = -{ +S swxy[] = { s, t, u, 0 }; +S sg7am[] = { 32, z, i, 0 }; +S swxyh[] = { s, t, u, d, 0 }; +S sgwxy[] = { 32, s, t, u, 0 }; +S sxyh[] = { t, u, d, 0 }; +S syhi[] = { u, d, e, 0 }; +S sgii[] = { 32, e, e, 0 }; +S syhir[] = { u, d, e, n, 0 }; +S siirg[] = { e, e, n, a }; +S sgiir[] = { 32, e, e, n, 0 }; +S s7amn[] = { z, i, j, 0 }; +S smnr[] = { i, j, n, 0 }; +S sg7amn[] = { 32, z, i, j, 0 }; +S sxyhi[] = { t, u, d, e, 0 }; +S snrg[] = { j, n, a }; +S smnrg[] = { i, j, n, a }; +S s7amnr[] = { z, i, j, n, 0 }; +S szss[] = { v, o, o, 0 }; +S sirxi[] = { e, n, t, e, 0 }; +S spmn[] = { l, i, j, 0 }; +S smno[] = { i, j, k, 0 }; +S szssv[] = { v, o, o, r, 0 }; +S sgzss[] = { 32, v, o, o, 0 }; +S sno[] = { j, k, 0 }; +S shirx[] = { d, e, n, t, 0 }; +S s7as[] = { z, o, 0 }; +S spmno[] = { l, i, j, k, 0 }; +S svhi[] = { r, d, e, 0 }; +S sssvg[] = { o, o, r, a }; +S s2727[] = { 39, 39, 0 }; +S smix[] = { i, e, t, 0 }; +S smZl[] = { i, 99, h, 0 }; +S s27g[] = { 39, a }; +S sg7as[] = { 32, z, o, 0 }; +S srmix[] = { n, i, e, t, 0 }; +S srxir[] = { n, t, e, n, 0 }; +S smixg[] = { i, e, t, a }; +S siki[] = { e, g, e, 0 }; +S sipi[] = { e, l, e, 0 }; +S sipmn[] = { e, l, i, j, 0 }; +S sizir[] = { e, v, e, n, 0 }; +S smnh[] = { i, j, d, 0 }; +S ssrh[] = { o, n, d, 0 }; +S skvs[] = { g, r, o, 0 }; +S spirg[] = { l, e, n, a }; +S szir[] = { v, e, n, 0 }; +S sg7aig[] = { 32, z, e, a }; +S siivh[] = { e, e, r, d, 0 }; +S soir[] = { k, e, n, 0 }; +S sg2727[] = { 32, 39, 39, 0 }; +S smng[] = { i, j, a }; +S sihi[] = { e, d, e, 0 }; +S sxmn[] = { t, i, j, 0 }; +S snh[] = { j, d, 0 }; +S svhir[] = { r, d, e, n, 0 }; +S shXX[] = { d, 97, 97, 0 }; +S syhmi[] = { u, d, i, e, 0 }; +S ssyh[] = { o, u, d, 0 }; +S smri[] = { i, n, e, 0 }; +S smzi[] = { i, v, e, 0 }; +S ssyhi[] = { o, u, d, e, 0 }; +S sXrr[] = { 97, n, n, 0 }; +S sxmnh[] = { t, i, j, d, 0 }; +S sivhg[] = { e, r, d, a }; +S sgly[] = { 32, h, u, 0 }; +S sivo[] = { e, r, k, 0 }; +S sxyhm[] = { t, u, d, i, 0 }; +S syhm[] = { u, d, i, 0 }; +S sZlx[] = { 99, h, t, 0 }; +S sij[] = { e, f, 0 }; +S sww[] = { s, s, 0 }; +S sgsso[] = { 32, o, o, k, 0 }; +S szirg[] = { v, e, n, a }; +S sxsx[] = { t, o, t, 0 }; +S szsp[] = { v, o, l, 0 }; +S sxmi[] = { t, i, e, 0 }; +S ssso[] = { o, o, k, 0 }; +S skipm[] = { g, e, l, i, 0 }; +S sgxsx[] = { 32, t, o, t, 0 }; +S sg7amZ[] = { 32, z, i, 99, 0 }; +S sgliY[] = { 32, h, e, 98, 0 }; +S sqmr[] = { m, i, n, 0 }; +S sjxg[] = { f, t, a }; +S szivw[] = { v, e, r, s, 0 }; +S s7amZl[] = { z, i, 99, h, 0 }; +S smziv[] = { i, v, e, r, 0 }; +S sgkvs[] = { 32, g, r, o, 0 }; +S s7amZ[] = { z, i, 99, 0 }; +S sXrxg[] = { 97, n, t, a }; +S ssxg[] = { o, t, a }; +S ssog[] = { o, k, a }; +S soxg[] = { k, t, a }; +S srmw[] = { n, i, s, 0 }; + +N l12n0[] = { { siy, .194 }, { s7amZ, .109 }, H }; +N l12n1[] = { { stX, .182 }, { sij, .085 }, H }; +N l12n2[] = { { swig, .218 }, { siivh, .194 }, H }; +N l12n3[] = { { ssv, .387 }, H }; +N l12n5[] = { { smr, .847 }, { sxm, .266 }, { srmr, .145 }, H }; +N l12n6[] = { { srx, .375 }, H }; +N l12n7[] = { { sri, .218 }, { sghm, .272 }, H }; +N l12n9[] = { { sXrx, .127 }, { slX, .073 }, { soxg, .163 }, H }; +N l12n10[] = { { siirg, .617 }, H }; +N l12n11[] = { { sghXx, .545 }, { skv, .121 }, { ssrh, .145 }, H }; +N l12n12[] = { { sgp, .290 }, H }; +N l12n13[] = { { sXr, .980 }, { swg, .781 }, { spm, .278 }, { sgzi, .545 }, { smnh, .145 }, { skipm, .145 }, H }; +N l12n14[] = { { sgki, .681 }, { sjx, .085 }, H }; +N l12n15[] = { { sgst, .354 }, H }; +N l12n17[] = { { siz, .109 }, H }; +N l12n18[] = { { sik, .206 }, H }; +N l12n19[] = { { svhir, .169 }, H }; +N l12n21[] = { { shm, .327 }, { sog, .418 }, H }; +N l12n22[] = { { sXXv, .436 }, { sssvg, .399 }, H }; +N l12n23[] = { { shivg, .327 }, H }; +N l12n25[] = { { sivh, .236 }, { szirg, .218 }, H }; +N l12n29[] = { { sgq, .672 }, { sxyh, .399 }, H }; +N l12n30[] = { { s_i, .242 }, { sg_i, .245 }, H }; +N l12n31[] = { { sgli, .953 }, { skiw, .127 }, H }; +N l12n32[] = { { symx, .163 }, H }; +N l12n33[] = { { sxig, .436 }, { smng, .218 }, H }; +N l12n34[] = { { ssix, .127 }, H }; +N l12n36[] = { { sym, .218 }, { snr, .194 }, { sivi, .163 }, { sg2727, .218 }, H }; +N l12n37[] = { { ssx, .157 }, { s7as, .133 }, H }; +N l12n38[] = { { syhi, .399 }, { ssi, .242 }, H }; +N l12n40[] = { { sipmn, .218 }, H }; +N l12n41[] = { { srk, .424 }, H }; +N l12n43[] = { { sgzXr, 1.017 }, H }; +N l12n44[] = { { sxg, 2.397 }, { sqm, .109 }, H }; +N l12n45[] = { { sivg, 1.008 }, { svs, .218 }, H }; +N l12n46[] = { { ski, .896 }, { sgr, .309 }, H }; +N l12n48[] = { { sXX, .617 }, H }; +N l12n49[] = { { shig, 1.389 }, H }; +N l12n52[] = { { spg, .309 }, { sim, .157 }, H }; +N l12n54[] = { { sgiir, .617 }, { ssy, .121 }, { sghmi, .290 }, { sihi, .145 }, H }; +N l12n56[] = { { s7amZl, .145 }, H }; +N l12n58[] = { { srmrk, .194 }, { smziv, .145 }, H }; +N l12n59[] = { { sghig, 1.452 }, H }; +N l12n60[] = { { shg, .545 }, { srmw, .109 }, H }; +N l12n61[] = { { svir, .145 }, H }; +N l12n62[] = { { szivw, .145 }, H }; +N l12n63[] = { { sgs, .726 }, { svX, .242 }, H }; +N l12n64[] = { { spp, .145 }, H }; +N l12n65[] = { { sgni, .300 }, { sstg, .300 }, H }; +N l12n68[] = { { sqixg, .290 }, H }; +N l12n69[] = { { sZlg, .218 }, { sti, .097 }, { sgsso, .218 }, { sqsix, .145 }, { sgliY, .218 }, H }; +N l12n71[] = { { snX, .073 }, H }; +N l12n72[] = { { skirg, .654 }, { ssk, .097 }, { sgqX, .218 }, H }; +N l12n73[] = { { slix, .454 }, { sghs, .218 }, H }; +N l12n74[] = { { smZ, .145 }, { sXXrg, .436 }, H }; +N l12n75[] = { { srm, .399 }, { sgxig, .254 }, H }; +N l12n76[] = { { sxyhi, .363 }, { slx, .085 }, H }; +N l12n77[] = { { sli, .496 }, { s7amn, .290 }, { srhi, .290 }, { szsp, .109 }, H }; +N l12n79[] = { { sixg, 1.362 }, { sgir, .517 }, { sYX, .109 }, { ssvh, .127 }, H }; +N l12n80[] = { { sgt, .236 }, { s2727, .133 }, { sivm, .127 }, H }; +N l12n81[] = { { sgX, .672 }, { sXv, .436 }, { sg7ai, .381 }, { smrh, .109 }, H }; +N l12n82[] = { { syhm, .127 }, H }; +N l12n83[] = { { sqg, .182 }, H }; +N l12n84[] = { { sos, .085 }, H }; +N l12n85[] = { { svmn, .145 }, { si7a, .085 }, H }; +N l12n86[] = { { sio, .182 }, { srhg, .218 }, H }; +N l12n88[] = { { sxyhm, .169 }, H }; +N l12n89[] = { { sgxs, .218 }, { sXrh, .127 }, H }; +N l12n90[] = { { smw, .266 }, { smno, .218 }, H }; +N l12n91[] = { { sig, 2.487 }, { smh, .085 }, H }; +N l12n92[] = { { smri, .127 }, { sxmi, .109 }, H }; +N l12n93[] = { { srxi, .290 }, { sly, .109 }, { swt, .073 }, H }; +N l12n98[] = { { sgY, .726 }, { sXw, .109 }, { s_m, .097 }, H }; +N l12n99[] = { { sgziv, .654 }, { ssvg, .300 }, { sXh, .133 }, { sgpi, .245 }, H }; +N l12n100[] = { { soir, .145 }, H }; +N l12n101[] = { { smrg, .381 }, { sxip, .127 }, H }; +N l12n102[] = { { srxg, .272 }, { soX, .085 }, { sivo, .127 }, H }; +N l12n103[] = { { sip, .520 }, { sxsx, .109 }, H }; +N l12n104[] = { { smix, .182 }, { sizi, .145 }, H }; +N l12n105[] = { { siki, .163 }, { ssso, .109 }, { sXrxg, .218 }, H }; +N l12n107[] = { { smx, .254 }, { sxs, .133 }, H }; +N l12n108[] = { { smi, .605 }, { shmi, .272 }, H }; +N l12n109[] = { { sXrg, 1.280 }, H }; +N l12n110[] = { { szss, .218 }, { sjxg, .163 }, H }; +N l12n111[] = { { sgstg, .290 }, H }; +N l12n112[] = { { syhir, .436 }, H }; +N l12n113[] = { { svw, .194 }, H }; +N l12n114[] = { { srg, 3.994 }, { smrk, .490 }, { svh, .278 }, { sgv, .145 }, H }; +N l12n115[] = { { sXx, .448 }, { sps, .073 }, H }; +N l12n116[] = { { sgqi, .300 }, H }; +N l12n117[] = { { szXr, .545 }, H }; +N l12n118[] = { { sXXvg, .508 }, H }; +N l12n119[] = { { sg27, .236 }, H }; +N l12n120[] = { { siq, .121 }, H }; +N l12n121[] = { { syr, .169 }, { sYiv, .127 }, { sivhg, .254 }, H }; +N l12n122[] = { { snh, .097 }, { sjg, .127 }, { sirw, .109 }, H }; +N l12n123[] = { { s7ai, .327 }, { sglix, .908 }, { sgzs, .572 }, { sxir, .327 }, { smnr, .290 }, { shs, .109 }, { sgiv, .218 }, { sgtX, .191 }, H }; +N l12n124[] = { { sgXX, .245 }, H }; +N l12n125[] = { { sg7am, .681 }, { sxX, .145 }, H }; +N l12n127[] = { { sgwx, .708 }, H }; +N l12n128[] = { { srki, .290 }, { swZ, .157 }, { simh, .109 }, H }; +N l12n129[] = { { syhmi, .169 }, { svmr, .127 }, H }; +N l12n130[] = { { svx, .145 }, { ssyh, .127 }, H }; +N l12n131[] = { { sgw, .672 }, { svi, .351 }, { spir, .182 }, H }; +N l12n132[] = { { sgh, 1.688 }, { snrg, .381 }, { sgymx, .218 }, H }; +N l12n133[] = { { sirx, .290 }, { spX, .157 }, { ssxg, .163 }, H }; +N l12n135[] = { { sov, .109 }, H }; +N l12n137[] = { { sir, 2.191 }, { shXx, .327 }, { srkg, .408 }, H }; +N l12n139[] = { { shir, .635 }, { sni, .182 }, H }; +N l12n140[] = { { sso, .085 }, H }; +N l12n141[] = { { shX, .363 }, { smz, .085 }, { sgYX, .163 }, H }; +N l12n142[] = { { smk, .109 }, H }; +N l12n144[] = { { soiv, .145 }, { sww, .085 }, H }; +N l12n146[] = { { sqs, .157 }, H }; +N l12n147[] = { { sYi, .436 }, { sgmr, .681 }, { sxmn, .145 }, H }; +N l12n148[] = { { sgx, .490 }, H }; +N l12n149[] = { { sgi, .980 }, H }; +N l12n150[] = { { sXk, .133 }, H }; +N l12n151[] = { { s7amnr, .339 }, { sppi, .145 }, H }; +N l12n153[] = { { skg, .563 }, H }; +N l12n155[] = { { spmn, .218 }, H }; +N l12n157[] = { { ssp, .133 }, H }; +N l12n158[] = { { sxv, .109 }, H }; +N l12n160[] = { { srr, .109 }, { sgqm, .163 }, H }; +N l12n161[] = { { swx, .654 }, { smrki, .290 }, { sgnig, .399 }, H }; +N l12n162[] = { { swi, .218 }, { srmi, .236 }, { sqir, .127 }, H }; +N l12n163[] = { { srhiv, .242 }, H }; +N l12n164[] = { { sqX, .169 }, H }; +N l12n165[] = { { sgy, .218 }, H }; +N l12n166[] = { { sg7amZ, .218 }, H }; +N l12n167[] = { { sxiv, .200 }, { srxir, .218 }, H }; +N l12n168[] = { { swxy, .472 }, H }; +N l12n169[] = { { szs, .315 }, { slixg, .871 }, { sox, .085 }, H }; +N l12n170[] = { { soi, .278 }, { siir, .327 }, H }; +N l12n171[] = { { sit, .121 }, H }; +N l12n173[] = { { sioi, .182 }, H }; +N l12n174[] = { { ssq, .145 }, H }; +N l12n175[] = { { sghX, .654 }, { sgirg, .690 }, { sxw, .097 }, H }; +N l12n176[] = { { stg, .272 }, H }; +N l12n177[] = { { sXvg, .381 }, { sgrm, .272 }, { srs, .097 }, { sg7aig, .290 }, { ssyhi, .169 }, H }; +N l12n178[] = { { sizir, .194 }, H }; +N l12n180[] = { { sirxi, .290 }, H }; +N l12n181[] = { { sgxsx, .218 }, H }; +N l12n182[] = { { sgz, 1.398 }, { sssv, .327 }, H }; +N l12n183[] = { { sgk, .635 }, { shiv, .309 }, H }; +N l12n184[] = { { slg, .145 }, { shXX, .127 }, { sph, .085 }, H }; +N l12n185[] = { { sgYi, .681 }, { szir, .145 }, H }; +N l12n186[] = { { smwg, .245 }, H }; +N l12n187[] = { { szX, .399 }, { sg7amn, .581 }, H }; +N l12n189[] = { { siY, .109 }, { syv, .109 }, H }; +N l12n190[] = { { sivw, .200 }, { sipi, .163 }, H }; +N l12n191[] = { { s7am, .303 }, { ssr, .290 }, { sg7as, .245 }, { sxmnh, .169 }, { shw, .073 }, H }; +N l12n193[] = { { sxi, .775 }, { smn, .678 }, H }; +N l12n194[] = { { smZl, .182 }, H }; +N l12n195[] = { { srX, .109 }, H }; +N l12n196[] = { { szssv, .290 }, H }; +N l12n198[] = { { sgXXr, .254 }, H }; +N l12n199[] = { { svm, .327 }, { sg_, .472 }, { sipg, .272 }, { sXrr, .127 }, H }; +N l12n200[] = { { sgl, .926 }, { sgzss, .436 }, { smixg, .327 }, { s_s, .073 }, H }; +N l12n201[] = { { spi, .436 }, { svhi, .200 }, H }; +N l12n202[] = { { srkir, .218 }, { sgmw, .163 }, H }; +N l12n203[] = { { smxg, .218 }, H }; +N l12n204[] = { { smig, .436 }, { shmig, .363 }, H }; +N l12n205[] = { { siv, 1.416 }, H }; +N l12n206[] = { { syw, .097 }, H }; +N l12n207[] = { { syh, .351 }, { sgly, .191 }, H }; +N l12n208[] = { { sss, .387 }, { skvs, .145 }, { sgqix, .290 }, H }; +N l12n209[] = { { shi, 1.477 }, { sxy, .339 }, H }; +N l12n210[] = { { skip, .254 }, { smrkg, .399 }, { smo, .097 }, { svhg, .191 }, H }; +N l12n211[] = { { sXxg, .681 }, H }; +N l12n212[] = { { swxyh, .533 }, H }; +N l12n213[] = { { szXrg, 1.053 }, { sirh, .145 }, H }; +N l12n214[] = { { siiv, .309 }, H }; +N l12n215[] = { { sYm, .097 }, H }; +N l12n217[] = { { sgm, .690 }, { s27g, .182 }, H }; +N l12n218[] = { { s_X, .145 }, { siwx, .182 }, H }; +N l12n219[] = { { sghi, 1.307 }, { sxirg, .545 }, { smnrg, .508 }, { s7aig, .354 }, H }; +N l12n220[] = { { spmno, .266 }, H }; +N l12n222[] = { { siw, .278 }, { sgwxy, .799 }, H }; +N l12n223[] = { { sih, .242 }, H }; +N l12n224[] = { { sgrmi, .363 }, H }; +N l12n225[] = { { sgzX, .844 }, { sst, .254 }, { sZlx, .127 }, { sgov, .163 }, H }; +N l12n226[] = { { sgqs, .300 }, H }; +N l12n227[] = { { spirg, .290 }, H }; +N l12n228[] = { { sqix, .145 }, { smzi, .127 }, H }; +N l12n229[] = { { sziv, .527 }, { sZl, .290 }, H }; +N l12n230[] = { { swm, .085 }, { sqmr, .109 }, H }; +N l12n231[] = { { shirx, .266 }, H }; +N l12n232[] = { { skir, .436 }, { sqi, .242 }, H }; +N l12n233[] = { { sirg, 3.704 }, { shXxg, .654 }, { svo, .109 }, H }; +N l12n234[] = { { sgn, .309 }, { sXXr, .254 }, { sipm, .163 }, { skX, .085 }, { sgkvs, .218 }, H }; +N l12n235[] = { { sXp, .303 }, { shirg, .763 }, { snig, .354 }, { sgxi, .327 }, H }; +N l12n236[] = { { sgii, .517 }, { ssog, .163 }, H }; +N l12n238[] = { { svg, 1.216 }, H }; +N l12n239[] = { { six, .811 }, H }; +N l12n240[] = { { sii, .581 }, H }; +N l12n241[] = { { sno, .145 }, H }; +N l12n242[] = { { sg_X, .191 }, H }; +N l12n243[] = { { sgmrg, .472 }, H }; +N l12n245[] = { { srw, .169 }, { sgXp, .354 }, { sxvi, .109 }, H }; +N l12n246[] = { { srh, .363 }, { sng, .145 }, { smrw, .127 }, H }; +N l12n247[] = { { sls, .157 }, { srri, .127 }, H }; +N l12n248[] = { { swxi, .254 }, { swZl, .200 }, H }; +N l12n249[] = { { sgsr, .163 }, H }; +N l12n250[] = { { sg7a, .908 }, H }; +N l12n251[] = { { sgo, .527 }, H }; +N l12n254[] = { { srmix, .218 }, H }; +N l12n255[] = { { szi, .484 }, H }; + +D l12_d = { "dutch", "iso-8859-15", - { - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,0.015,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,0.142,0.034,0.018,0.117,0.372,0.011,0.067,0.045,0.137,0.038,0.046,0.066,0.037,0.206,0.104, - 0.029,W,0.124,0.081,0.146,0.050,0.053,0.024,0.002,0.000,0.031,W,W,W,W,W, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - Y,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V, - V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V, - 0.001,V,V,V,V,V,V,V,V,0.002,V,0.001,V,V,V,0.002, - V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V - }, - { - l12n0,l12n1,l12n2,l12n3,X,l12n5,l12n6,l12n7,X,l12n9,l12n10,l12n11,l12n12,l12n13,l12n14,l12n15, - X,l12n17,l12n18,l12n19,X,l12n21,l12n22,l12n23,X,l12n25,X,X,X,l12n29,l12n30,l12n31, - l12n32,l12n33,l12n34,X,l12n36,l12n37,l12n38,X,l12n40,l12n41,X,l12n43,l12n44,l12n45,l12n46,X, - l12n48,l12n49,X,X,l12n52,X,l12n54,X,l12n56,X,l12n58,l12n59,l12n60,l12n61,l12n62,l12n63, - l12n64,l12n65,X,X,l12n68,l12n69,X,l12n71,l12n72,l12n73,l12n74,l12n75,l12n76,l12n77,X,l12n79, - l12n80,l12n81,l12n82,l12n83,l12n84,l12n85,l12n86,X,l12n88,l12n89,l12n90,l12n91,l12n92,l12n93,X,X, - X,X,l12n98,l12n99,l12n100,l12n101,l12n102,l12n103,l12n104,l12n105,X,l12n107,l12n108,l12n109,l12n110,l12n111, - l12n112,l12n113,l12n114,l12n115,l12n116,l12n117,l12n118,l12n119,l12n120,l12n121,l12n122,l12n123,l12n124,l12n125,X,l12n127, - l12n128,l12n129,l12n130,l12n131,l12n132,l12n133,X,l12n135,X,l12n137,X,l12n139,l12n140,l12n141,l12n142,X, - l12n144,X,l12n146,l12n147,l12n148,l12n149,l12n150,l12n151,X,l12n153,X,l12n155,X,l12n157,l12n158,X, - l12n160,l12n161,l12n162,l12n163,l12n164,l12n165,l12n166,l12n167,l12n168,l12n169,l12n170,l12n171,X,l12n173,l12n174,l12n175, - l12n176,l12n177,l12n178,X,l12n180,l12n181,l12n182,l12n183,l12n184,l12n185,l12n186,l12n187,X,l12n189,l12n190,l12n191, - X,l12n193,l12n194,l12n195,l12n196,X,l12n198,l12n199,l12n200,l12n201,l12n202,l12n203,l12n204,l12n205,l12n206,l12n207, - l12n208,l12n209,l12n210,l12n211,l12n212,l12n213,l12n214,l12n215,X,l12n217,l12n218,l12n219,l12n220,X,l12n222,l12n223, - l12n224,l12n225,l12n226,l12n227,l12n228,l12n229,l12n230,l12n231,l12n232,l12n233,l12n234,l12n235,l12n236,X,l12n238,l12n239, - l12n240,l12n241,l12n242,l12n243,X,l12n245,l12n246,l12n247,l12n248,l12n249,l12n250,l12n251,X,X,l12n254,l12n255 - } + { W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, 0.015, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, 0.142, 0.034, 0.018, 0.117, 0.372, 0.011, 0.067, 0.045, 0.137, 0.038, 0.046, 0.066, 0.037, 0.206, 0.104, + 0.029, W, 0.124, 0.081, 0.146, 0.050, 0.053, 0.024, 0.002, 0.000, 0.031, W, W, W, W, W, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + Y, V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, + V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, + 0.001, V, V, V, V, V, V, V, V, 0.002, V, 0.001, V, V, V, 0.002, + V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, V }, + { l12n0, l12n1, l12n2, l12n3, X, l12n5, l12n6, l12n7, X, l12n9, l12n10, l12n11, l12n12, l12n13, l12n14, l12n15, + X, l12n17, l12n18, l12n19, X, l12n21, l12n22, l12n23, X, l12n25, X, X, X, l12n29, l12n30, l12n31, + l12n32, l12n33, l12n34, X, l12n36, l12n37, l12n38, X, l12n40, l12n41, X, l12n43, l12n44, l12n45, l12n46, X, + l12n48, l12n49, X, X, l12n52, X, l12n54, X, l12n56, X, l12n58, l12n59, l12n60, l12n61, l12n62, l12n63, + l12n64, l12n65, X, X, l12n68, l12n69, X, l12n71, l12n72, l12n73, l12n74, l12n75, l12n76, l12n77, X, l12n79, + l12n80, l12n81, l12n82, l12n83, l12n84, l12n85, l12n86, X, l12n88, l12n89, l12n90, l12n91, l12n92, l12n93, X, X, + X, X, l12n98, l12n99, l12n100, l12n101, l12n102, l12n103, l12n104, l12n105, X, l12n107, l12n108, l12n109, l12n110, l12n111, + l12n112, l12n113, l12n114, l12n115, l12n116, l12n117, l12n118, l12n119, l12n120, l12n121, l12n122, l12n123, l12n124, l12n125, X, l12n127, + l12n128, l12n129, l12n130, l12n131, l12n132, l12n133, X, l12n135, X, l12n137, X, l12n139, l12n140, l12n141, l12n142, X, + l12n144, X, l12n146, l12n147, l12n148, l12n149, l12n150, l12n151, X, l12n153, X, l12n155, X, l12n157, l12n158, X, + l12n160, l12n161, l12n162, l12n163, l12n164, l12n165, l12n166, l12n167, l12n168, l12n169, l12n170, l12n171, X, l12n173, l12n174, l12n175, + l12n176, l12n177, l12n178, X, l12n180, l12n181, l12n182, l12n183, l12n184, l12n185, l12n186, l12n187, X, l12n189, l12n190, l12n191, + X, l12n193, l12n194, l12n195, l12n196, X, l12n198, l12n199, l12n200, l12n201, l12n202, l12n203, l12n204, l12n205, l12n206, l12n207, + l12n208, l12n209, l12n210, l12n211, l12n212, l12n213, l12n214, l12n215, X, l12n217, l12n218, l12n219, l12n220, X, l12n222, l12n223, + l12n224, l12n225, l12n226, l12n227, l12n228, l12n229, l12n230, l12n231, l12n232, l12n233, l12n234, l12n235, l12n236, X, l12n238, l12n239, + l12n240, l12n241, l12n242, l12n243, X, l12n245, l12n246, l12n247, l12n248, l12n249, l12n250, l12n251, X, X, l12n254, l12n255 } }; - - // // Lng: english // Enc: iso-8859-15 // - -S sxli[]={t,h,e,0}; -S sgxli[]={32,t,h,e,0}; -S sxlig[]={t,h,e,a}; -S ssjg[]={o,f,a}; -S ssj[]={o,f,0}; -S sgsj[]={32,o,f,0}; -S sgsjg[]={32,o,f,a}; -S sgXr[]={32,97,n,0}; -S sgXrh[]={32,97,n,d,0}; -S smsrg[]={i,o,n,a}; -S sxms[]={t,i,o,0}; -S sxmsr[]={t,i,o,n,0}; -S sxwg[]={t,s,a}; -S s_l[]={w,h,0}; -S sg_l[]={32,w,h,0}; -S slXx[]={h,97,t,0}; -S stXvx[]={p,97,r,t,0}; -S srj[]={n,f,0}; -S sgmx[]={32,i,t,0}; -S siww[]={e,s,s,0}; -S sgY79g[]={32,98,y,a}; -S sliv[]={h,e,r,0}; -S sxlm[]={t,h,i,0}; -S smiwg[]={i,e,s,a}; -S sgXwg[]={32,97,s,a}; -S sXxms[]={97,t,i,o,0}; -S sYig[]={98,e,a}; -S sgmxg[]={32,i,t,a}; -S slXxg[]={h,97,t,a}; -S slivg[]={h,e,r,a}; -S swmsr[]={s,i,o,n,0}; -S sjp[]={f,l,0}; -S siXw[]={e,97,s,0}; -S svrq[]={r,n,m,0}; -S sgYig[]={32,98,e,a}; -S srxwg[]={n,t,s,a}; -S srqir[]={n,m,e,n,0}; -S sxlXx[]={t,h,97,t,0}; -S sglXz[]={32,h,97,v,0}; -S srqi[]={n,m,e,0}; -S sivrq[]={e,r,n,m,0}; -S sgksz[]={32,g,o,v,0}; -S szivr[]={v,e,r,n,0}; -S slXz[]={h,97,v,0}; -S svrqi[]={r,n,m,e,0}; -S slmZ[]={h,i,99,0}; -S srq[]={n,m,0}; -S srxw[]={n,t,s,0}; -S swms[]={s,i,o,0}; -S sZxm[]={99,t,i,0}; -S skszi[]={g,o,v,e,0}; -S smx79g[]={i,t,y,a}; -S sgmrx[]={32,i,n,t,0}; -S sxih[]={t,e,d,0}; -S smpp[]={i,l,l,0}; -S sgtXv[]={32,p,97,r,0}; -S sxmiw[]={t,i,e,s,0}; -S syir[]={u,e,n,0}; -S sXzi[]={97,v,e,0}; -S swihg[]={s,e,d,a}; -S srjp[]={n,f,l,0}; -S smx79[]={i,t,y,0}; -S s_lm[]={w,h,i,0}; -S slXzi[]={h,97,v,e,0}; -S sgyrm[]={32,u,n,i,0}; -S sZxms[]={99,t,i,o,0}; -S sp79g[]={l,y,a}; -S sXzig[]={97,v,e,a}; -S swih[]={s,e,d,0}; -S sp79[]={l,y,0}; -S sg_lm[]={32,w,h,i,0}; -S sxihg[]={t,e,d,a}; -S syrm[]={u,n,i,0}; -S smZx[]={i,99,t,0}; -S smsrw[]={i,o,n,s,0}; -S smrj[]={i,n,f,0}; -S sqYi[]={m,98,e,0}; -S sxlmw[]={t,h,i,s,0}; -S s_iv[]={w,e,r,0}; -S slimv[]={h,e,i,r,0}; -S sxlim[]={t,h,e,i,0}; -S syxm[]={u,t,i,0}; -S sxliv[]={t,h,e,r,0}; -S sZmi[]={99,i,e,0}; -S sg_mp[]={32,w,i,l,0}; -S swwi[]={s,s,e,0}; -S slmw[]={h,i,s,0}; -S srZig[]={n,99,e,a}; -S slim[]={h,e,i,0}; -S slmwg[]={h,i,s,a}; -S smrZ[]={i,n,99,0}; -S smZlg[]={i,99,h,a}; -S slmZl[]={h,i,99,h,0}; -S srms[]={n,i,o,0}; -S sgxlm[]={32,t,h,i,0}; -S syrms[]={u,n,i,o,0}; -S sviXw[]={r,e,97,s,0}; -S sgsrg[]={32,o,n,a}; -S simvg[]={e,i,r,a}; -S s_mp[]={w,i,l,0}; -S s_mpp[]={w,i,l,l,0}; -S sqYiv[]={m,98,e,r,0}; -S sgrXx[]={32,n,97,t,0}; -S skvi[]={g,r,e,0}; -S ssyw[]={o,u,s,0}; -S smrjp[]={i,n,f,l,0}; -S srmsr[]={n,i,o,n,0}; -S simv[]={e,i,r,0}; -S sgmrj[]={32,i,n,f,0}; -S sXYp[]={97,98,l,0}; -S svii[]={r,e,e,0}; -S sqiq[]={m,e,m,0}; -S sgsv[]={32,o,r,0}; -S smppg[]={i,l,l,a}; -S s_lmZ[]={w,h,i,99,0}; -S swwm[]={s,s,i,0}; -S syvi[]={u,r,e,0}; - -N l13n1[]={{sgsjg,1.767},{stX,.223},{swxg,.287},{smrx,.143},H}; -N l13n2[]={{swig,.322},H}; -N l13n3[]={{ssv,.366},H}; -N l13n4[]={{s_iv,.119},H}; -N l13n5[]={{smr,.923},{sxm,.653},{slXx,.239},H}; -N l13n6[]={{srx,.541},{s_mp,.119},H}; -N l13n7[]={{sri,.191},{sghm,.179},{sviXw,.159},H}; -N l13n9[]={{slX,.382},H}; -N l13n10[]={{sYp,.127},{slmZl,.159},H}; -N l13n11[]={{sgXr,1.039},{skv,.096},{sZsq,.119},H}; -N l13n12[]={{sgxl,3.152},{sgp,.191},{sqYi,.119},H}; -N l13n13[]={{swg,2.244},{sXr,.716},{spm,.207},{sxih,.143},H}; -N l13n15[]={{sxwg,.501},{sji,.111},H}; -N l13n16[]={{ssrwg,.382},{srms,.119},H}; -N l13n17[]={{siz,.080},H}; -N l13n18[]={{sZig,.287},{sik,.080},H}; -N l13n19[]={{swwm,.119},H}; -N l13n20[]={{sxmsr,.573},{ssw,.111},{syvi,.119},H}; -N l13n21[]={{sx79,.287},{shm,.191},H}; -N l13n22[]={{sms,.557},{sZsr,.191},H}; -N l13n24[]={{srj,.159},H}; -N l13n25[]={{sgYig,.334},{skszi,.223},H}; -N l13n26[]={{simv,.119},H}; -N l13n27[]={{slXz,.167},H}; -N l13n28[]={{svr,.127},H}; -N l13n29[]={{sgq,.573},{sp79,.096},H}; -N l13n30[]={{s_i,.191},{sg_i,.322},{sivwg,.239},H}; -N l13n31[]={{ssrg,1.074},{sxlX,.191},{sgli,.179},H}; -N l13n34[]={{stv,.255},{smZlg,.239},H}; -N l13n36[]={{sivi,.239},{swxm,.119},H}; -N l13n37[]={{ssx,.111},{sgsv,.179},H}; -N l13n38[]={{slimv,.159},H}; -N l13n39[]={{ssyw,.119},H}; -N l13n40[]={{smX,.096},H}; -N l13n41[]={{srk,.271},{spig,.287},{smsrw,.191},H}; -N l13n42[]={{sgmwg,.287},H}; -N l13n43[]={{stiv,.167},H}; -N l13n44[]={{sxg,1.242},{sqm,.080},H}; -N l13n45[]={{sivg,.788},{svs,.239},H}; -N l13n46[]={{sgr,.287},{ski,.080},H}; -N l13n47[]={{sgxlX,.382},{szivr,.223},H}; -N l13n48[]={{smsrg,1.146},{srqir,.223},H}; -N l13n51[]={{sliv,.215},{si78,.096},H}; -N l13n52[]={{spg,.358},{sim,.127},{sZxm,.167},H}; -N l13n53[]={{sgmxg,.382},H}; -N l13n54[]={{ssy,.255},{sgtv,.394},H}; -N l13n55[]={{ssj,.589},{sgXrh,1.289},H}; -N l13n56[]={{sgZs,.537},H}; -N l13n59[]={{sgxli,3.486},H}; -N l13n60[]={{shg,1.504},{srZi,.143},H}; -N l13n62[]={{siwg,.752},H}; -N l13n63[]={{sgs,1.337},{sihg,.931},{svX,.255},{sg_l,.394},H}; -N l13n64[]={{spp,.159},H}; -N l13n65[]={{sXY,.143},H}; -N l13n66[]={{sgXw,.322},H}; -N l13n67[]={{stXvx,.318},{sXxms,.255},{szm,.096},H}; -N l13n69[]={{sti,.255},{sZlg,.251},H}; -N l13n70[]={{smZx,.143},{smrZ,.119},H}; -N l13n71[]={{ssz,.159},{sY79g,.322},{sgxlm,.239},H}; -N l13n72[]={{sgqX,.322},{sqig,.215},H}; -N l13n73[]={{smv,.127},{syrms,.159},H}; -N l13n74[]={{smZ,.350},{sg_m,.322},{slXzi,.191},{s_mpp,.159},H}; -N l13n75[]={{sxli,1.886},{srm,.143},{sXpg,.251},H}; -N l13n76[]={{sws,.111},{sXzig,.287},H}; -N l13n77[]={{sli,1.433},{sXvx,.263},{sgXx,.287},{srhi,.119},{sZmi,.119},H}; -N l13n78[]={{swihg,.287},{spmZ,.119},H}; -N l13n80[]={{sgt,.740},H}; -N l13n81[]={{sgX,2.053},{sXv,.414},{s_l,.175},H}; -N l13n82[]={{sXZ,.207},H}; -N l13n85[]={{srwg,.537},{sglXz,.334},H}; -N l13n86[]={{srhg,1.003},H}; -N l13n87[]={{srxwg,.334},H}; -N l13n89[]={{sXrh,.669},{sgxs,.752},{sgrX,.179},{sgsrg,.239},H}; -N l13n90[]={{smw,.366},{srmsr,.159},H}; -N l13n91[]={{sig,3.438},H}; -N l13n92[]={{sZs,.255},{sxmi,.143},H}; -N l13n93[]={{smiw,.215},{swt,.096},H}; -N l13n94[]={{swX,.080},H}; -N l13n95[]={{szig,.466},{sgyr,.322},H}; -N l13n97[]={{svZ,.080},H}; -N l13n98[]={{sgY,.549},{sXw,.271},{s_m,.143},{syxm,.119},{sqYiv,.159},{skvi,.119},H}; -N l13n99[]={{sXh,.191},{sgpi,.251},{ssvg,.215},H}; -N l13n101[]={{smrg,.645},{slXxg,.382},H}; -N l13n102[]={{srxg,.430},H}; -N l13n103[]={{sip,.080},{smrj,.119},H}; -N l13n104[]={{smix,.119},{sizi,.119},H}; -N l13n107[]={{smx,.446},{sxs,.366},{sgjs,.251},H}; -N l13n108[]={{smi,.318},H}; -N l13n109[]={{sxihg,.287},H}; -N l13n113[]={{svw,.159},H}; -N l13n114[]={{srg,1.385},{sgv,.358},{smrk,.287},{skm,.080},H}; -N l13n115[]={{sXx,.557},{sgZ,.525},H}; -N l13n116[]={{sviw,.263},{sgqi,.251},{suy,.080},H}; -N l13n117[]={{sx79g,.466},H}; -N l13n119[]={{sxlm,.215},H}; -N l13n120[]={{siq,.207},H}; -N l13n121[]={{syr,.207},{sYiv,.143},H}; -N l13n122[]={{sjg,.907},{sirw,.167},{sg_lm,.287},{simvg,.239},H}; -N l13n123[]={{sgtX,.322},{sxlXx,.223},H}; -N l13n124[]={{sgks,.287},H}; -N l13n125[]={{sxX,.191},{sp79g,.215},H}; -N l13n129[]={{sZxms,.191},H}; -N l13n130[]={{svx,.223},{sgZsr,.382},{slmw,.119},H}; -N l13n131[]={{svi,.860},{sgw,.573},{sgtvs,.382},H}; -N l13n132[]={{sgh,.501},H}; -N l13n133[]={{sirx,.549},H}; -N l13n134[]={{sjp,.111},{sxlim,.159},H}; -N l13n135[]={{sivr,.191},{smpp,.143},{swxv,.143},H}; -N l13n137[]={{sir,.875},{srkg,.466},H}; -N l13n138[]={{sgwy,.215},H}; -N l13n141[]={{smz,.127},H}; -N l13n142[]={{sg_mp,.239},{smk,.080},H}; -N l13n143[]={{sZv,.111},{srq,.111},H}; -N l13n144[]={{sww,.239},H}; -N l13n145[]={{ssg,.549},{slm,.271},H}; -N l13n146[]={{sqs,.111},H}; -N l13n147[]={{sgmr,1.253},{sYi,.318},{slivg,.382},H}; -N l13n148[]={{sgx,2.770},H}; -N l13n149[]={{sgi,.406},{sgY79,.322},{sXz,.127},H}; -N l13n150[]={{sXk,.080},H}; -N l13n151[]={{ssjg,1.325},{sqiq,.119},H}; -N l13n153[]={{skg,.310},H}; -N l13n154[]={{syir,.143},{sgyrm,.287},H}; -N l13n156[]={{srZig,.239},H}; -N l13n157[]={{siXw,.167},H}; -N l13n158[]={{sxv,.159},{sszi,.215},{smx79,.143},H}; -N l13n159[]={{sjsv,.167},H}; -N l13n160[]={{sppg,.287},H}; -N l13n161[]={{sgsj,1.325},{swx,.414},{sxliv,.159},H}; -N l13n162[]={{swi,.446},{sqir,.430},{sgXwg,.382},H}; -N l13n163[]={{sqt,.111},H}; -N l13n164[]={{sqX,.191},H}; -N l13n165[]={{sgy,.215},H}; -N l13n166[]={{sgj,.454},H}; -N l13n167[]={{sxiv,.119},H}; -N l13n169[]={{smvg,.179},H}; -N l13n171[]={{sxlig,3.008},{swms,.167},{sit,.096},{smrjp,.159},H}; -N l13n172[]={{siX,.350},H}; -N l13n173[]={{slig,2.328},{syY,.096},H}; -N l13n174[]={{sviX,.167},{ssq,.096},H}; -N l13n175[]={{sxw,.239},H}; -N l13n176[]={{ssrw,.263},H}; -N l13n177[]={{sZx,.271},{sgXg,.501},H}; -N l13n178[]={{sZi,.271},{swy,.143},H}; -N l13n181[]={{sxmiw,.191},{sgrXx,.239},{sqY,.080},H}; -N l13n182[]={{sgz,.191},H}; -N l13n183[]={{sgk,.310},{shiv,.215},{spw,.080},H}; -N l13n184[]={{slg,.191},H}; -N l13n185[]={{sXrhg,1.289},{sgxsg,.955},{sgYi,.394},{sjs,.143},H}; -N l13n186[]={{smwg,.394},H}; -N l13n187[]={{szX,.096},H}; -N l13n188[]={{srjp,.143},H}; -N l13n189[]={{smiwg,.430},{syv,.111},{sgi78,.179},H}; -N l13n190[]={{sivw,.167},{syZ,.080},H}; -N l13n191[]={{ssr,.875},{srXx,.119},H}; -N l13n193[]={{sxi,.318},{sgjsv,.239},H}; -N l13n194[]={{sXwg,.287},{smZl,.119},H}; -N l13n195[]={{srX,.159},H}; -N l13n197[]={{sgmrj,.239},H}; -N l13n199[]={{s79g,1.027},{sg_,.836},{svm,.239},H}; -N l13n200[]={{sgl,.406},H}; -N l13n201[]={{spi,.334},{sgvi,.466},H}; -N l13n202[]={{sxms,.454},{sgmw,.215},{sirZ,.143},{siZx,.143},H}; -N l13n203[]={{sxsg,.752},{smxg,.358},{svrq,.167},H}; -N l13n205[]={{siv,1.035},H}; -N l13n206[]={{siZ,.287},{syw,.175},{sivrq,.223},H}; -N l13n207[]={{siww,.239},H}; -N l13n208[]={{smsr,.740},{sxlmw,.159},{slim,.119},H}; -N l13n209[]={{shi,.493},{svwg,.251},{sgtXv,.287},{sxy,.096},H}; -N l13n210[]={{smrkg,.525},{slmZ,.167},H}; -N l13n211[]={{sXxg,.466},H}; -N l13n212[]={{s_lm,.143},H}; -N l13n213[]={{sgmx,.358},{sirh,.119},H}; -N l13n215[]={{sv79,.080},H}; -N l13n216[]={{sks,.159},H}; -N l13n217[]={{sgm,1.289},{spy,.080},H}; -N l13n218[]={{siwx,.143},{svii,.119},H}; -N l13n219[]={{sghi,.573},H}; -N l13n222[]={{siw,.700},{sgksz,.334},H}; -N l13n223[]={{sih,.509},{sXg,.406},{syx,.096},H}; -N l13n224[]={{syi,.143},H}; -N l13n225[]={{sst,.127},H}; -N l13n226[]={{slmwg,.239},{sgqs,.179},H}; -N l13n227[]={{svig,.501},{smp,.207},H}; -N l13n228[]={{smzi,.167},H}; -N l13n229[]={{srZ,.239},{sziv,.310},{sZl,.191},{sirxg,.573},{sXYp,.119},H}; -N l13n230[]={{swm,.175},{srqi,.167},{sZvi,.143},H}; -N l13n231[]={{stXv,.239},{sY79,.143},{stvs,.191},{swwi,.119},{smppg,.239},H}; -N l13n232[]={{sqi,.525},H}; -N l13n233[]={{sirg,.251},H}; -N l13n234[]={{sksz,.167},H}; -N l13n235[]={{sXp,.302},H}; -N l13n236[]={{sXzi,.143},{sjv,.080},H}; -N l13n238[]={{svg,.883},{swih,.143},H}; -N l13n239[]={{six,.143},{sgmrx,.287},H}; -N l13n240[]={{sii,.127},H}; -N l13n243[]={{sgmrg,.621},{sglX,.358},{sYig,.287},H}; -N l13n244[]={{sxl,1.560},{ssziv,.255},{smq,.080},H}; -N l13n245[]={{srw,.430},{sgY79g,.430},{swmsr,.223},H}; -N l13n246[]={{srh,.637},{sZm,.318},{sXxm,.239},H}; -N l13n247[]={{srxw,.167},{sls,.096},H}; -N l13n248[]={{sivX,.167},H}; -N l13n249[]={{sgsr,.251},H}; -N l13n250[]={{svrqi,.223},H}; -N l13n252[]={{sXq,.127},{syrm,.143},H}; -N l13n253[]={{s_lmZ,.159},H}; -N l13n254[]={{sqirx,.414},{smx79g,.287},H}; -N l13n255[]={{szi,.525},H}; - -D l13_d = -{ +S sxli[] = { t, h, e, 0 }; +S sgxli[] = { 32, t, h, e, 0 }; +S sxlig[] = { t, h, e, a }; +S ssjg[] = { o, f, a }; +S ssj[] = { o, f, 0 }; +S sgsj[] = { 32, o, f, 0 }; +S sgsjg[] = { 32, o, f, a }; +S sgXr[] = { 32, 97, n, 0 }; +S sgXrh[] = { 32, 97, n, d, 0 }; +S smsrg[] = { i, o, n, a }; +S sxms[] = { t, i, o, 0 }; +S sxmsr[] = { t, i, o, n, 0 }; +S sxwg[] = { t, s, a }; +S s_l[] = { w, h, 0 }; +S sg_l[] = { 32, w, h, 0 }; +S slXx[] = { h, 97, t, 0 }; +S stXvx[] = { p, 97, r, t, 0 }; +S srj[] = { n, f, 0 }; +S sgmx[] = { 32, i, t, 0 }; +S siww[] = { e, s, s, 0 }; +S sgY79g[] = { 32, 98, y, a }; +S sliv[] = { h, e, r, 0 }; +S sxlm[] = { t, h, i, 0 }; +S smiwg[] = { i, e, s, a }; +S sgXwg[] = { 32, 97, s, a }; +S sXxms[] = { 97, t, i, o, 0 }; +S sYig[] = { 98, e, a }; +S sgmxg[] = { 32, i, t, a }; +S slXxg[] = { h, 97, t, a }; +S slivg[] = { h, e, r, a }; +S swmsr[] = { s, i, o, n, 0 }; +S sjp[] = { f, l, 0 }; +S siXw[] = { e, 97, s, 0 }; +S svrq[] = { r, n, m, 0 }; +S sgYig[] = { 32, 98, e, a }; +S srxwg[] = { n, t, s, a }; +S srqir[] = { n, m, e, n, 0 }; +S sxlXx[] = { t, h, 97, t, 0 }; +S sglXz[] = { 32, h, 97, v, 0 }; +S srqi[] = { n, m, e, 0 }; +S sivrq[] = { e, r, n, m, 0 }; +S sgksz[] = { 32, g, o, v, 0 }; +S szivr[] = { v, e, r, n, 0 }; +S slXz[] = { h, 97, v, 0 }; +S svrqi[] = { r, n, m, e, 0 }; +S slmZ[] = { h, i, 99, 0 }; +S srq[] = { n, m, 0 }; +S srxw[] = { n, t, s, 0 }; +S swms[] = { s, i, o, 0 }; +S sZxm[] = { 99, t, i, 0 }; +S skszi[] = { g, o, v, e, 0 }; +S smx79g[] = { i, t, y, a }; +S sgmrx[] = { 32, i, n, t, 0 }; +S sxih[] = { t, e, d, 0 }; +S smpp[] = { i, l, l, 0 }; +S sgtXv[] = { 32, p, 97, r, 0 }; +S sxmiw[] = { t, i, e, s, 0 }; +S syir[] = { u, e, n, 0 }; +S sXzi[] = { 97, v, e, 0 }; +S swihg[] = { s, e, d, a }; +S srjp[] = { n, f, l, 0 }; +S smx79[] = { i, t, y, 0 }; +S s_lm[] = { w, h, i, 0 }; +S slXzi[] = { h, 97, v, e, 0 }; +S sgyrm[] = { 32, u, n, i, 0 }; +S sZxms[] = { 99, t, i, o, 0 }; +S sp79g[] = { l, y, a }; +S sXzig[] = { 97, v, e, a }; +S swih[] = { s, e, d, 0 }; +S sp79[] = { l, y, 0 }; +S sg_lm[] = { 32, w, h, i, 0 }; +S sxihg[] = { t, e, d, a }; +S syrm[] = { u, n, i, 0 }; +S smZx[] = { i, 99, t, 0 }; +S smsrw[] = { i, o, n, s, 0 }; +S smrj[] = { i, n, f, 0 }; +S sqYi[] = { m, 98, e, 0 }; +S sxlmw[] = { t, h, i, s, 0 }; +S s_iv[] = { w, e, r, 0 }; +S slimv[] = { h, e, i, r, 0 }; +S sxlim[] = { t, h, e, i, 0 }; +S syxm[] = { u, t, i, 0 }; +S sxliv[] = { t, h, e, r, 0 }; +S sZmi[] = { 99, i, e, 0 }; +S sg_mp[] = { 32, w, i, l, 0 }; +S swwi[] = { s, s, e, 0 }; +S slmw[] = { h, i, s, 0 }; +S srZig[] = { n, 99, e, a }; +S slim[] = { h, e, i, 0 }; +S slmwg[] = { h, i, s, a }; +S smrZ[] = { i, n, 99, 0 }; +S smZlg[] = { i, 99, h, a }; +S slmZl[] = { h, i, 99, h, 0 }; +S srms[] = { n, i, o, 0 }; +S sgxlm[] = { 32, t, h, i, 0 }; +S syrms[] = { u, n, i, o, 0 }; +S sviXw[] = { r, e, 97, s, 0 }; +S sgsrg[] = { 32, o, n, a }; +S simvg[] = { e, i, r, a }; +S s_mp[] = { w, i, l, 0 }; +S s_mpp[] = { w, i, l, l, 0 }; +S sqYiv[] = { m, 98, e, r, 0 }; +S sgrXx[] = { 32, n, 97, t, 0 }; +S skvi[] = { g, r, e, 0 }; +S ssyw[] = { o, u, s, 0 }; +S smrjp[] = { i, n, f, l, 0 }; +S srmsr[] = { n, i, o, n, 0 }; +S simv[] = { e, i, r, 0 }; +S sgmrj[] = { 32, i, n, f, 0 }; +S sXYp[] = { 97, 98, l, 0 }; +S svii[] = { r, e, e, 0 }; +S sqiq[] = { m, e, m, 0 }; +S sgsv[] = { 32, o, r, 0 }; +S smppg[] = { i, l, l, a }; +S s_lmZ[] = { w, h, i, 99, 0 }; +S swwm[] = { s, s, i, 0 }; +S syvi[] = { u, r, e, 0 }; + +N l13n1[] = { { sgsjg, 1.767 }, { stX, .223 }, { swxg, .287 }, { smrx, .143 }, H }; +N l13n2[] = { { swig, .322 }, H }; +N l13n3[] = { { ssv, .366 }, H }; +N l13n4[] = { { s_iv, .119 }, H }; +N l13n5[] = { { smr, .923 }, { sxm, .653 }, { slXx, .239 }, H }; +N l13n6[] = { { srx, .541 }, { s_mp, .119 }, H }; +N l13n7[] = { { sri, .191 }, { sghm, .179 }, { sviXw, .159 }, H }; +N l13n9[] = { { slX, .382 }, H }; +N l13n10[] = { { sYp, .127 }, { slmZl, .159 }, H }; +N l13n11[] = { { sgXr, 1.039 }, { skv, .096 }, { sZsq, .119 }, H }; +N l13n12[] = { { sgxl, 3.152 }, { sgp, .191 }, { sqYi, .119 }, H }; +N l13n13[] = { { swg, 2.244 }, { sXr, .716 }, { spm, .207 }, { sxih, .143 }, H }; +N l13n15[] = { { sxwg, .501 }, { sji, .111 }, H }; +N l13n16[] = { { ssrwg, .382 }, { srms, .119 }, H }; +N l13n17[] = { { siz, .080 }, H }; +N l13n18[] = { { sZig, .287 }, { sik, .080 }, H }; +N l13n19[] = { { swwm, .119 }, H }; +N l13n20[] = { { sxmsr, .573 }, { ssw, .111 }, { syvi, .119 }, H }; +N l13n21[] = { { sx79, .287 }, { shm, .191 }, H }; +N l13n22[] = { { sms, .557 }, { sZsr, .191 }, H }; +N l13n24[] = { { srj, .159 }, H }; +N l13n25[] = { { sgYig, .334 }, { skszi, .223 }, H }; +N l13n26[] = { { simv, .119 }, H }; +N l13n27[] = { { slXz, .167 }, H }; +N l13n28[] = { { svr, .127 }, H }; +N l13n29[] = { { sgq, .573 }, { sp79, .096 }, H }; +N l13n30[] = { { s_i, .191 }, { sg_i, .322 }, { sivwg, .239 }, H }; +N l13n31[] = { { ssrg, 1.074 }, { sxlX, .191 }, { sgli, .179 }, H }; +N l13n34[] = { { stv, .255 }, { smZlg, .239 }, H }; +N l13n36[] = { { sivi, .239 }, { swxm, .119 }, H }; +N l13n37[] = { { ssx, .111 }, { sgsv, .179 }, H }; +N l13n38[] = { { slimv, .159 }, H }; +N l13n39[] = { { ssyw, .119 }, H }; +N l13n40[] = { { smX, .096 }, H }; +N l13n41[] = { { srk, .271 }, { spig, .287 }, { smsrw, .191 }, H }; +N l13n42[] = { { sgmwg, .287 }, H }; +N l13n43[] = { { stiv, .167 }, H }; +N l13n44[] = { { sxg, 1.242 }, { sqm, .080 }, H }; +N l13n45[] = { { sivg, .788 }, { svs, .239 }, H }; +N l13n46[] = { { sgr, .287 }, { ski, .080 }, H }; +N l13n47[] = { { sgxlX, .382 }, { szivr, .223 }, H }; +N l13n48[] = { { smsrg, 1.146 }, { srqir, .223 }, H }; +N l13n51[] = { { sliv, .215 }, { si78, .096 }, H }; +N l13n52[] = { { spg, .358 }, { sim, .127 }, { sZxm, .167 }, H }; +N l13n53[] = { { sgmxg, .382 }, H }; +N l13n54[] = { { ssy, .255 }, { sgtv, .394 }, H }; +N l13n55[] = { { ssj, .589 }, { sgXrh, 1.289 }, H }; +N l13n56[] = { { sgZs, .537 }, H }; +N l13n59[] = { { sgxli, 3.486 }, H }; +N l13n60[] = { { shg, 1.504 }, { srZi, .143 }, H }; +N l13n62[] = { { siwg, .752 }, H }; +N l13n63[] = { { sgs, 1.337 }, { sihg, .931 }, { svX, .255 }, { sg_l, .394 }, H }; +N l13n64[] = { { spp, .159 }, H }; +N l13n65[] = { { sXY, .143 }, H }; +N l13n66[] = { { sgXw, .322 }, H }; +N l13n67[] = { { stXvx, .318 }, { sXxms, .255 }, { szm, .096 }, H }; +N l13n69[] = { { sti, .255 }, { sZlg, .251 }, H }; +N l13n70[] = { { smZx, .143 }, { smrZ, .119 }, H }; +N l13n71[] = { { ssz, .159 }, { sY79g, .322 }, { sgxlm, .239 }, H }; +N l13n72[] = { { sgqX, .322 }, { sqig, .215 }, H }; +N l13n73[] = { { smv, .127 }, { syrms, .159 }, H }; +N l13n74[] = { { smZ, .350 }, { sg_m, .322 }, { slXzi, .191 }, { s_mpp, .159 }, H }; +N l13n75[] = { { sxli, 1.886 }, { srm, .143 }, { sXpg, .251 }, H }; +N l13n76[] = { { sws, .111 }, { sXzig, .287 }, H }; +N l13n77[] = { { sli, 1.433 }, { sXvx, .263 }, { sgXx, .287 }, { srhi, .119 }, { sZmi, .119 }, H }; +N l13n78[] = { { swihg, .287 }, { spmZ, .119 }, H }; +N l13n80[] = { { sgt, .740 }, H }; +N l13n81[] = { { sgX, 2.053 }, { sXv, .414 }, { s_l, .175 }, H }; +N l13n82[] = { { sXZ, .207 }, H }; +N l13n85[] = { { srwg, .537 }, { sglXz, .334 }, H }; +N l13n86[] = { { srhg, 1.003 }, H }; +N l13n87[] = { { srxwg, .334 }, H }; +N l13n89[] = { { sXrh, .669 }, { sgxs, .752 }, { sgrX, .179 }, { sgsrg, .239 }, H }; +N l13n90[] = { { smw, .366 }, { srmsr, .159 }, H }; +N l13n91[] = { { sig, 3.438 }, H }; +N l13n92[] = { { sZs, .255 }, { sxmi, .143 }, H }; +N l13n93[] = { { smiw, .215 }, { swt, .096 }, H }; +N l13n94[] = { { swX, .080 }, H }; +N l13n95[] = { { szig, .466 }, { sgyr, .322 }, H }; +N l13n97[] = { { svZ, .080 }, H }; +N l13n98[] = { { sgY, .549 }, { sXw, .271 }, { s_m, .143 }, { syxm, .119 }, { sqYiv, .159 }, { skvi, .119 }, H }; +N l13n99[] = { { sXh, .191 }, { sgpi, .251 }, { ssvg, .215 }, H }; +N l13n101[] = { { smrg, .645 }, { slXxg, .382 }, H }; +N l13n102[] = { { srxg, .430 }, H }; +N l13n103[] = { { sip, .080 }, { smrj, .119 }, H }; +N l13n104[] = { { smix, .119 }, { sizi, .119 }, H }; +N l13n107[] = { { smx, .446 }, { sxs, .366 }, { sgjs, .251 }, H }; +N l13n108[] = { { smi, .318 }, H }; +N l13n109[] = { { sxihg, .287 }, H }; +N l13n113[] = { { svw, .159 }, H }; +N l13n114[] = { { srg, 1.385 }, { sgv, .358 }, { smrk, .287 }, { skm, .080 }, H }; +N l13n115[] = { { sXx, .557 }, { sgZ, .525 }, H }; +N l13n116[] = { { sviw, .263 }, { sgqi, .251 }, { suy, .080 }, H }; +N l13n117[] = { { sx79g, .466 }, H }; +N l13n119[] = { { sxlm, .215 }, H }; +N l13n120[] = { { siq, .207 }, H }; +N l13n121[] = { { syr, .207 }, { sYiv, .143 }, H }; +N l13n122[] = { { sjg, .907 }, { sirw, .167 }, { sg_lm, .287 }, { simvg, .239 }, H }; +N l13n123[] = { { sgtX, .322 }, { sxlXx, .223 }, H }; +N l13n124[] = { { sgks, .287 }, H }; +N l13n125[] = { { sxX, .191 }, { sp79g, .215 }, H }; +N l13n129[] = { { sZxms, .191 }, H }; +N l13n130[] = { { svx, .223 }, { sgZsr, .382 }, { slmw, .119 }, H }; +N l13n131[] = { { svi, .860 }, { sgw, .573 }, { sgtvs, .382 }, H }; +N l13n132[] = { { sgh, .501 }, H }; +N l13n133[] = { { sirx, .549 }, H }; +N l13n134[] = { { sjp, .111 }, { sxlim, .159 }, H }; +N l13n135[] = { { sivr, .191 }, { smpp, .143 }, { swxv, .143 }, H }; +N l13n137[] = { { sir, .875 }, { srkg, .466 }, H }; +N l13n138[] = { { sgwy, .215 }, H }; +N l13n141[] = { { smz, .127 }, H }; +N l13n142[] = { { sg_mp, .239 }, { smk, .080 }, H }; +N l13n143[] = { { sZv, .111 }, { srq, .111 }, H }; +N l13n144[] = { { sww, .239 }, H }; +N l13n145[] = { { ssg, .549 }, { slm, .271 }, H }; +N l13n146[] = { { sqs, .111 }, H }; +N l13n147[] = { { sgmr, 1.253 }, { sYi, .318 }, { slivg, .382 }, H }; +N l13n148[] = { { sgx, 2.770 }, H }; +N l13n149[] = { { sgi, .406 }, { sgY79, .322 }, { sXz, .127 }, H }; +N l13n150[] = { { sXk, .080 }, H }; +N l13n151[] = { { ssjg, 1.325 }, { sqiq, .119 }, H }; +N l13n153[] = { { skg, .310 }, H }; +N l13n154[] = { { syir, .143 }, { sgyrm, .287 }, H }; +N l13n156[] = { { srZig, .239 }, H }; +N l13n157[] = { { siXw, .167 }, H }; +N l13n158[] = { { sxv, .159 }, { sszi, .215 }, { smx79, .143 }, H }; +N l13n159[] = { { sjsv, .167 }, H }; +N l13n160[] = { { sppg, .287 }, H }; +N l13n161[] = { { sgsj, 1.325 }, { swx, .414 }, { sxliv, .159 }, H }; +N l13n162[] = { { swi, .446 }, { sqir, .430 }, { sgXwg, .382 }, H }; +N l13n163[] = { { sqt, .111 }, H }; +N l13n164[] = { { sqX, .191 }, H }; +N l13n165[] = { { sgy, .215 }, H }; +N l13n166[] = { { sgj, .454 }, H }; +N l13n167[] = { { sxiv, .119 }, H }; +N l13n169[] = { { smvg, .179 }, H }; +N l13n171[] = { { sxlig, 3.008 }, { swms, .167 }, { sit, .096 }, { smrjp, .159 }, H }; +N l13n172[] = { { siX, .350 }, H }; +N l13n173[] = { { slig, 2.328 }, { syY, .096 }, H }; +N l13n174[] = { { sviX, .167 }, { ssq, .096 }, H }; +N l13n175[] = { { sxw, .239 }, H }; +N l13n176[] = { { ssrw, .263 }, H }; +N l13n177[] = { { sZx, .271 }, { sgXg, .501 }, H }; +N l13n178[] = { { sZi, .271 }, { swy, .143 }, H }; +N l13n181[] = { { sxmiw, .191 }, { sgrXx, .239 }, { sqY, .080 }, H }; +N l13n182[] = { { sgz, .191 }, H }; +N l13n183[] = { { sgk, .310 }, { shiv, .215 }, { spw, .080 }, H }; +N l13n184[] = { { slg, .191 }, H }; +N l13n185[] = { { sXrhg, 1.289 }, { sgxsg, .955 }, { sgYi, .394 }, { sjs, .143 }, H }; +N l13n186[] = { { smwg, .394 }, H }; +N l13n187[] = { { szX, .096 }, H }; +N l13n188[] = { { srjp, .143 }, H }; +N l13n189[] = { { smiwg, .430 }, { syv, .111 }, { sgi78, .179 }, H }; +N l13n190[] = { { sivw, .167 }, { syZ, .080 }, H }; +N l13n191[] = { { ssr, .875 }, { srXx, .119 }, H }; +N l13n193[] = { { sxi, .318 }, { sgjsv, .239 }, H }; +N l13n194[] = { { sXwg, .287 }, { smZl, .119 }, H }; +N l13n195[] = { { srX, .159 }, H }; +N l13n197[] = { { sgmrj, .239 }, H }; +N l13n199[] = { { s79g, 1.027 }, { sg_, .836 }, { svm, .239 }, H }; +N l13n200[] = { { sgl, .406 }, H }; +N l13n201[] = { { spi, .334 }, { sgvi, .466 }, H }; +N l13n202[] = { { sxms, .454 }, { sgmw, .215 }, { sirZ, .143 }, { siZx, .143 }, H }; +N l13n203[] = { { sxsg, .752 }, { smxg, .358 }, { svrq, .167 }, H }; +N l13n205[] = { { siv, 1.035 }, H }; +N l13n206[] = { { siZ, .287 }, { syw, .175 }, { sivrq, .223 }, H }; +N l13n207[] = { { siww, .239 }, H }; +N l13n208[] = { { smsr, .740 }, { sxlmw, .159 }, { slim, .119 }, H }; +N l13n209[] = { { shi, .493 }, { svwg, .251 }, { sgtXv, .287 }, { sxy, .096 }, H }; +N l13n210[] = { { smrkg, .525 }, { slmZ, .167 }, H }; +N l13n211[] = { { sXxg, .466 }, H }; +N l13n212[] = { { s_lm, .143 }, H }; +N l13n213[] = { { sgmx, .358 }, { sirh, .119 }, H }; +N l13n215[] = { { sv79, .080 }, H }; +N l13n216[] = { { sks, .159 }, H }; +N l13n217[] = { { sgm, 1.289 }, { spy, .080 }, H }; +N l13n218[] = { { siwx, .143 }, { svii, .119 }, H }; +N l13n219[] = { { sghi, .573 }, H }; +N l13n222[] = { { siw, .700 }, { sgksz, .334 }, H }; +N l13n223[] = { { sih, .509 }, { sXg, .406 }, { syx, .096 }, H }; +N l13n224[] = { { syi, .143 }, H }; +N l13n225[] = { { sst, .127 }, H }; +N l13n226[] = { { slmwg, .239 }, { sgqs, .179 }, H }; +N l13n227[] = { { svig, .501 }, { smp, .207 }, H }; +N l13n228[] = { { smzi, .167 }, H }; +N l13n229[] = { { srZ, .239 }, { sziv, .310 }, { sZl, .191 }, { sirxg, .573 }, { sXYp, .119 }, H }; +N l13n230[] = { { swm, .175 }, { srqi, .167 }, { sZvi, .143 }, H }; +N l13n231[] = { { stXv, .239 }, { sY79, .143 }, { stvs, .191 }, { swwi, .119 }, { smppg, .239 }, H }; +N l13n232[] = { { sqi, .525 }, H }; +N l13n233[] = { { sirg, .251 }, H }; +N l13n234[] = { { sksz, .167 }, H }; +N l13n235[] = { { sXp, .302 }, H }; +N l13n236[] = { { sXzi, .143 }, { sjv, .080 }, H }; +N l13n238[] = { { svg, .883 }, { swih, .143 }, H }; +N l13n239[] = { { six, .143 }, { sgmrx, .287 }, H }; +N l13n240[] = { { sii, .127 }, H }; +N l13n243[] = { { sgmrg, .621 }, { sglX, .358 }, { sYig, .287 }, H }; +N l13n244[] = { { sxl, 1.560 }, { ssziv, .255 }, { smq, .080 }, H }; +N l13n245[] = { { srw, .430 }, { sgY79g, .430 }, { swmsr, .223 }, H }; +N l13n246[] = { { srh, .637 }, { sZm, .318 }, { sXxm, .239 }, H }; +N l13n247[] = { { srxw, .167 }, { sls, .096 }, H }; +N l13n248[] = { { sivX, .167 }, H }; +N l13n249[] = { { sgsr, .251 }, H }; +N l13n250[] = { { svrqi, .223 }, H }; +N l13n252[] = { { sXq, .127 }, { syrm, .143 }, H }; +N l13n253[] = { { s_lmZ, .159 }, H }; +N l13n254[] = { { sqirx, .414 }, { smx79g, .287 }, H }; +N l13n255[] = { { szi, .525 }, H }; + +D l13_d = { "english", "iso-8859-15", - { - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,0.149,0.031,0.067,0.076,0.294,0.052,0.031,0.094,0.152,0.004,0.004,0.057,0.052,0.159,0.137, - 0.043,0.003,0.124,0.133,0.194,0.050,0.029,0.027,0.004,0.034,0.001,W,W,W,W,W, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - Y,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V, - V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V, - V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V, - V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V - }, - { - X,l13n1,l13n2,l13n3,l13n4,l13n5,l13n6,l13n7,X,l13n9,l13n10,l13n11,l13n12,l13n13,X,l13n15, - l13n16,l13n17,l13n18,l13n19,l13n20,l13n21,l13n22,X,l13n24,l13n25,l13n26,l13n27,l13n28,l13n29,l13n30,l13n31, - X,X,l13n34,X,l13n36,l13n37,l13n38,l13n39,l13n40,l13n41,l13n42,l13n43,l13n44,l13n45,l13n46,l13n47, - l13n48,X,X,l13n51,l13n52,l13n53,l13n54,l13n55,l13n56,X,X,l13n59,l13n60,X,l13n62,l13n63, - l13n64,l13n65,l13n66,l13n67,X,l13n69,l13n70,l13n71,l13n72,l13n73,l13n74,l13n75,l13n76,l13n77,l13n78,X, - l13n80,l13n81,l13n82,X,X,l13n85,l13n86,l13n87,X,l13n89,l13n90,l13n91,l13n92,l13n93,l13n94,l13n95, - X,l13n97,l13n98,l13n99,X,l13n101,l13n102,l13n103,l13n104,X,X,l13n107,l13n108,l13n109,X,X, - X,l13n113,l13n114,l13n115,l13n116,l13n117,X,l13n119,l13n120,l13n121,l13n122,l13n123,l13n124,l13n125,X,X, - X,l13n129,l13n130,l13n131,l13n132,l13n133,l13n134,l13n135,X,l13n137,l13n138,X,X,l13n141,l13n142,l13n143, - l13n144,l13n145,l13n146,l13n147,l13n148,l13n149,l13n150,l13n151,X,l13n153,l13n154,X,l13n156,l13n157,l13n158,l13n159, - l13n160,l13n161,l13n162,l13n163,l13n164,l13n165,l13n166,l13n167,X,l13n169,X,l13n171,l13n172,l13n173,l13n174,l13n175, - l13n176,l13n177,l13n178,X,X,l13n181,l13n182,l13n183,l13n184,l13n185,l13n186,l13n187,l13n188,l13n189,l13n190,l13n191, - X,l13n193,l13n194,l13n195,X,l13n197,X,l13n199,l13n200,l13n201,l13n202,l13n203,X,l13n205,l13n206,l13n207, - l13n208,l13n209,l13n210,l13n211,l13n212,l13n213,X,l13n215,l13n216,l13n217,l13n218,l13n219,X,X,l13n222,l13n223, - l13n224,l13n225,l13n226,l13n227,l13n228,l13n229,l13n230,l13n231,l13n232,l13n233,l13n234,l13n235,l13n236,X,l13n238,l13n239, - l13n240,X,X,l13n243,l13n244,l13n245,l13n246,l13n247,l13n248,l13n249,l13n250,X,l13n252,l13n253,l13n254,l13n255 - } + { W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, 0.149, 0.031, 0.067, 0.076, 0.294, 0.052, 0.031, 0.094, 0.152, 0.004, 0.004, 0.057, 0.052, 0.159, 0.137, + 0.043, 0.003, 0.124, 0.133, 0.194, 0.050, 0.029, 0.027, 0.004, 0.034, 0.001, W, W, W, W, W, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + Y, V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, + V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, + V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, + V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, V }, + { X, l13n1, l13n2, l13n3, l13n4, l13n5, l13n6, l13n7, X, l13n9, l13n10, l13n11, l13n12, l13n13, X, l13n15, + l13n16, l13n17, l13n18, l13n19, l13n20, l13n21, l13n22, X, l13n24, l13n25, l13n26, l13n27, l13n28, l13n29, l13n30, l13n31, + X, X, l13n34, X, l13n36, l13n37, l13n38, l13n39, l13n40, l13n41, l13n42, l13n43, l13n44, l13n45, l13n46, l13n47, + l13n48, X, X, l13n51, l13n52, l13n53, l13n54, l13n55, l13n56, X, X, l13n59, l13n60, X, l13n62, l13n63, + l13n64, l13n65, l13n66, l13n67, X, l13n69, l13n70, l13n71, l13n72, l13n73, l13n74, l13n75, l13n76, l13n77, l13n78, X, + l13n80, l13n81, l13n82, X, X, l13n85, l13n86, l13n87, X, l13n89, l13n90, l13n91, l13n92, l13n93, l13n94, l13n95, + X, l13n97, l13n98, l13n99, X, l13n101, l13n102, l13n103, l13n104, X, X, l13n107, l13n108, l13n109, X, X, + X, l13n113, l13n114, l13n115, l13n116, l13n117, X, l13n119, l13n120, l13n121, l13n122, l13n123, l13n124, l13n125, X, X, + X, l13n129, l13n130, l13n131, l13n132, l13n133, l13n134, l13n135, X, l13n137, l13n138, X, X, l13n141, l13n142, l13n143, + l13n144, l13n145, l13n146, l13n147, l13n148, l13n149, l13n150, l13n151, X, l13n153, l13n154, X, l13n156, l13n157, l13n158, l13n159, + l13n160, l13n161, l13n162, l13n163, l13n164, l13n165, l13n166, l13n167, X, l13n169, X, l13n171, l13n172, l13n173, l13n174, l13n175, + l13n176, l13n177, l13n178, X, X, l13n181, l13n182, l13n183, l13n184, l13n185, l13n186, l13n187, l13n188, l13n189, l13n190, l13n191, + X, l13n193, l13n194, l13n195, X, l13n197, X, l13n199, l13n200, l13n201, l13n202, l13n203, X, l13n205, l13n206, l13n207, + l13n208, l13n209, l13n210, l13n211, l13n212, l13n213, X, l13n215, l13n216, l13n217, l13n218, l13n219, X, X, l13n222, l13n223, + l13n224, l13n225, l13n226, l13n227, l13n228, l13n229, l13n230, l13n231, l13n232, l13n233, l13n234, l13n235, l13n236, X, l13n238, l13n239, + l13n240, X, X, l13n243, l13n244, l13n245, l13n246, l13n247, l13n248, l13n249, l13n250, X, l13n252, l13n253, l13n254, l13n255 } }; - - // // Lng: finnish // Enc: iso-8859-15 // - -S sxU[]={t,228,0}; -S ssm[]={o,i,0}; -S sow[]={k,s,0}; -S syy[]={u,u,0}; -S smm[]={i,i,0}; -S sys[]={u,o,0}; -S sxUg[]={t,228,a}; -S swwX[]={s,s,97,0}; -S szU[]={v,228,0}; -S ssmq[]={o,i,m,0}; -S sxsm[]={t,o,i,0}; -S sxxX[]={t,t,97,0}; -S sUU[]={228,228,0}; -S spU[]={l,228,0}; -S swXg[]={s,97,a}; -S sppm[]={l,l,i,0}; -S swwXg[]={s,s,97,a}; -S sowm[]={k,s,i,0}; -S smwi[]={i,s,e,0}; -S sXmw[]={97,i,s,0}; -S sgsp[]={32,o,l,0}; -S ssmqm[]={o,i,m,i,0}; -S sixx[]={e,t,t,0}; -S sxsmq[]={t,o,i,m,0}; -S smxx[]={i,t,t,0}; -S sXXg[]={97,97,a}; -S sppX[]={l,l,97,0}; -S swmg[]={s,i,a}; -S swU[]={s,228,0}; -S sgxsm[]={32,t,o,i,0}; -S stU[]={p,228,0}; -S sowi[]={k,s,e,0}; -S smmr[]={i,i,n,0}; -S sgoi[]={32,k,e,0}; -S sgnXg[]={32,j,97,a}; -S srom[]={n,k,i,0}; -S sxyw[]={t,u,s,0}; -S sgxy[]={32,t,u,0}; -S sppXg[]={l,l,97,a}; -S srrX[]={n,n,97,0}; -S sUm[]={228,i,0}; -S spmw[]={l,i,s,0}; -S sowmg[]={k,s,i,a}; -S sxxU[]={t,t,228,0}; -S sywx[]={u,s,t,0}; -S sUp[]={228,l,0}; -S sspi[]={o,l,e,0}; -S sUr[]={228,n,0}; -S sXwx[]={97,s,t,0}; -S ssmx[]={o,i,t,0}; -S snU[]={j,228,0}; -S s7979[]={y,y,0}; -S s79l[]={y,h,0}; -S slXp[]={h,97,l,0}; -S sUx[]={228,t,0}; -S sgns[]={32,j,o,0}; -S sspm[]={o,l,i,0}; -S sUz[]={228,v,0}; -S swxU[]={s,t,228,0}; -S sXppm[]={97,l,l,i,0}; -S soXy[]={k,97,u,0}; -S syyx[]={u,u,t,0}; -S szsm[]={v,o,i,0}; -S slh[]={h,d,0}; -S smow[]={i,k,s,0}; -S smmrg[]={i,i,n,a}; -S syow[]={u,k,s,0}; -S slip[]={h,e,l,0}; -S syz[]={u,v,0}; -S smpX[]={i,l,97,0}; -S sXro[]={97,n,k,0}; -S szXm[]={v,97,i,0}; -S soXyt[]={k,97,u,p,0}; -S sxUz[]={t,228,v,0}; -S smowm[]={i,k,s,i,0}; -S somr[]={k,i,n,0}; -S sglXp[]={32,h,97,l,0}; -S sUv[]={228,r,0}; -S sypy[]={u,l,u,0}; -S sgtU[]={32,p,228,0}; -S svn[]={r,j,0}; -S sxxXX[]={t,t,97,97,0}; -S soXr[]={k,97,n,0}; -S swwU[]={s,s,228,0}; -S smwm[]={i,s,i,0}; -S spXm[]={l,97,i,0}; -S soU[]={k,228,0}; -S srir[]={n,e,n,0}; -S swUg[]={s,228,a}; -S swwUg[]={s,s,228,a}; -S soiwo[]={k,e,s,k,0}; -S soiw[]={k,e,s,0}; -S srirg[]={n,e,n,a}; -S swmX[]={s,i,97,0}; -S sXyt[]={97,u,p,0}; -S sgoiw[]={32,k,e,s,0}; -S smwxi[]={i,s,t,e,0}; -S sgspi[]={32,o,l,e,0}; -S sgwys[]={32,s,u,o,0}; -S stt[]={p,p,0}; -S smqmr[]={i,m,i,n,0}; -S srU[]={n,228,0}; -S smrr[]={i,n,n,0}; -S sppU[]={l,l,228,0}; -S swys[]={s,u,o,0}; -S swoy[]={s,k,u,0}; -S swyy[]={s,u,u,0}; -S ssqm[]={o,m,i,0}; -S sippX[]={e,l,l,97,0}; -S smww[]={i,s,s,0}; -S sqU[]={m,228,0}; -S sty[]={p,u,0}; -S swmx[]={s,i,t,0}; -S spUg[]={l,228,a}; -S sXoX[]={97,k,97,0}; -S szXp[]={v,97,l,0}; -S smrir[]={i,n,e,n,0}; -S sUw[]={228,s,0}; -S spXmw[]={l,97,i,s,0}; -S somrg[]={k,i,n,a}; -S sUzU[]={228,v,228,0}; -S sxXz[]={t,97,v,0}; -S sg79l[]={32,y,h,0}; -S syowi[]={u,k,s,e,0}; -S sxXXr[]={t,97,97,n,0}; -S swxUg[]={s,t,228,a}; -S sgzXm[]={32,v,97,i,0}; -S szXxg[]={v,97,t,a}; -S sspp[]={o,l,l,0}; -S spq[]={l,m,0}; -S sgoXr[]={32,k,97,n,0}; -S sglip[]={32,h,e,l,0}; -S s79xx[]={y,t,t,0}; -S siwoy[]={e,s,k,u,0}; -S sqXvm[]={m,97,r,i,0}; -S syzX[]={u,v,97,0}; -S smxw[]={i,t,s,0}; -S siwm[]={e,s,i,0}; -S sqqig[]={m,m,e,a}; -S sXnX[]={97,j,97,0}; -S smmx[]={i,i,t,0}; -S sppUg[]={l,l,228,a}; -S sXmwi[]={97,i,s,e,0}; -S sppmw[]={l,l,i,s,0}; -S smxU[]={i,t,228,0}; -S smxwi[]={i,t,s,e,0}; -S soyw[]={k,u,s,0}; -S syrr[]={u,n,n,0}; -S syxxX[]={u,t,t,97,0}; -S srmwx[]={n,i,s,t,0}; -S sowir[]={k,s,e,n,0}; -S sgzXp[]={32,v,97,l,0}; -S syrg[]={u,n,a}; -S sgiwm[]={32,e,s,i,0}; -S srXrg[]={n,97,n,a}; -S smwxX[]={i,s,t,97,0}; -S swoyw[]={s,k,u,s,0}; -S sgixx[]={32,e,t,t,0}; -S swmXg[]={s,i,97,a}; -S sxXXg[]={t,97,97,a}; -S syxx[]={u,t,t,0}; -S sqyy[]={m,u,u,0}; -S somp[]={k,i,l,0}; - -N l14n0[]={{stt,.085},{siy,.085},H}; -N l14n1[]={{stX,.182},{syz,.097},{smrx,.146},H}; -N l14n2[]={{sgoy,.273},{swig,.164},H}; -N l14n5[]={{smr,.923},{sxm,.340},{sXoX,.128},H}; -N l14n6[]={{srx,.206},{sgwm,.219},H}; -N l14n7[]={{sri,.255},H}; -N l14n8[]={{swo,.219},{spXm,.146},{somrg,.255},{sxXXg,.219},H}; -N l14n9[]={{slX,.255},H}; -N l14n10[]={{siirg,.219},H}; -N l14n11[]={{sipp,.273},H}; -N l14n12[]={{sgp,.364},{sppU,.128},H}; -N l14n13[]={{sXr,.947},{spm,.631},{swg,.200},H}; -N l14n14[]={{smpX,.146},{sxxXX,.194},H}; -N l14n15[]={{swoy,.128},H}; -N l14n16[]={{soo,.158},{sswx,.146},H}; -N l14n17[]={{swU,.158},{swmX,.146},{siz,.085},H}; -N l14n18[]={{sgspi,.291},H}; -N l14n20[]={{ssw,.255},H}; -N l14n21[]={{sx79,.219},{sgnX,.410},H}; -N l14n22[]={{sms,.109},H}; -N l14n23[]={{szXxg,.255},{sgxm,.164},{sxxi,.109},H}; -N l14n24[]={{sxii,.109},H}; -N l14n25[]={{ssmq,.328},{soU,.097},H}; -N l14n27[]={{swwXg,.583},{sowm,.291},H}; -N l14n28[]={{sgtU,.219},{sgzXm,.255},{sppmw,.146},H}; -N l14n29[]={{sgq,.528},{sqmw,.200},H}; -N l14n31[]={{ssrg,.519},{sgli,.164},{smqX,.109},H}; -N l14n32[]={{sspm,.182},{soXr,.146},H}; -N l14n33[]={{srirg,.291},H}; -N l14n35[]={{sil,.109},{srXg,.164},H}; -N l14n36[]={{swxm,.164},{sym,.085},{sgqy,.191},H}; -N l14n37[]={{ssx,.146},{sgzXp,.219},H}; -N l14n38[]={{sgoX,.492},{smir,.146},H}; -N l14n39[]={{sXqX,.200},{svmg,.191},{sqqig,.219},H}; -N l14n40[]={{smX,.219},H}; -N l14n41[]={{spig,.328},H}; -N l14n44[]={{sqm,.595},{sxg,.710},{swxXg,.583},{szsm,.164},{syzX,.109},{sxXq,.109},H}; -N l14n46[]={{sgr,.255},{sUv,.219},{sippX,.170},H}; -N l14n48[]={{sXX,.668},{sxU,.534},H}; -N l14n49[]={{srxX,.164},{ssqm,.128},H}; -N l14n51[]={{syrr,.109},H}; -N l14n52[]={{sim,.255},H}; -N l14n53[]={{sxsmq,.364},{sns,.158},H}; -N l14n54[]={{ssy,.097},H}; -N l14n55[]={{syow,.164},{sglXp,.291},{smxU,.109},H}; -N l14n56[]={{spU,.206},H}; -N l14n57[]={{sowir,.146},H}; -N l14n60[]={{slh,.109},{srmw,.109},H}; -N l14n62[]={{szXm,.146},{sUzU,.287},H}; -N l14n63[]={{sgs,.765},{svX,.109},{sUw,.191},H}; -N l14n64[]={{spp,.607},H}; -N l14n65[]={{sspp,.128},H}; -N l14n66[]={{sxUz,.146},H}; -N l14n67[]={{szm,.206},H}; -N l14n69[]={{sti,.097},H}; -N l14n70[]={{swmg,.355},{syo,.158},H}; -N l14n71[]={{snX,.352},H}; -N l14n72[]={{sgqX,.301},{sgws,.164},{sqig,.164},H}; -N l14n73[]={{smv,.073},H}; -N l14n74[]={{sXXrg,.765},H}; -N l14n75[]={{srm,.194},{syg,.182},{smww,.128},H}; -N l14n76[]={{slx,.146},{sws,.097},H}; -N l14n77[]={{sli,.182},H}; -N l14n79[]={{sixg,.246},H}; -N l14n80[]={{sgt,.601},{sivm,.200},{sUx,.273},H}; -N l14n81[]={{sgX,.346},{sXv,.219},{spq,.085},H}; -N l14n82[]={{sgoi,.328},H}; -N l14n84[]={{sos,.328},{ssmqm,.364},{sXyt,.146},H}; -N l14n85[]={{sty,.085},H}; -N l14n86[]={{smwx,.474},H}; -N l14n87[]={{syp,.194},{sqU,.085},{s79xx,.109},H}; -N l14n89[]={{sgxs,.465},{sgsrg,.437},H}; -N l14n90[]={{smw,.826},H}; -N l14n91[]={{sig,.565},{s79x,.194},{sr79,.073},H}; -N l14n92[]={{swir,.219},{smri,.146},{swwU,.146},{smxw,.109},H}; -N l14n93[]={{sly,.109},H}; -N l14n94[]={{swX,.352},{sXwx,.182},{sypy,.146},H}; -N l14n95[]={{szXp,.128},H}; -N l14n97[]={{spXmw,.170},{sg79l,.191},{siwm,.109},H}; -N l14n98[]={{sXw,.279},H}; -N l14n99[]={{sglip,.219},H}; -N l14n101[]={{smrg,.792},{sxmg,.191},{sxip,.128},H}; -N l14n102[]={{soX,.583},{ssmx,.182},{syowi,.170},H}; -N l14n103[]={{sip,.522},{smxx,.255},{sywo,.109},H}; -N l14n104[]={{swoyw,.146},H}; -N l14n106[]={{ssm,.510},{smmr,.219},H}; -N l14n107[]={{smx,.729},{sxs,.449},{sppX,.255},H}; -N l14n108[]={{smi,.206},{sppUg,.219},H}; -N l14n109[]={{sXrg,1.230},{sro,.243},{swxU,.164},{soXy,.164},{spmg,.191},H}; -N l14n110[]={{szU,.219},H}; -N l14n112[]={{sqq,.121},{sgoXr,.255},H}; -N l14n113[]={{swUg,.219},{swmXg,.219},H}; -N l14n114[]={{srg,2.896},{sUz,.273},{sXmr,.128},{sgv,.128},H}; -N l14n115[]={{sXx,.340},{sps,.085},H}; -N l14n117[]={{sgnXg,.437},{szXr,.182},H}; -N l14n118[]={{srU,.085},H}; -N l14n119[]={{smqm,.291},{siwo,.146},{swys,.128},H}; -N l14n120[]={{siq,.158},H}; -N l14n121[]={{syr,.255},{smwxX,.146},H}; -N l14n123[]={{sxir,.200},{sowmg,.401},{ssn,.109},H}; -N l14n125[]={{sxX,.972},H}; -N l14n131[]={{sgw,.656},H}; -N l14n132[]={{sXy,.158},H}; -N l14n133[]={{spX,.376},{smwxi,.194},H}; -N l14n134[]={{sgiw,.164},H}; -N l14n135[]={{smpp,.128},H}; -N l14n136[]={{smXg,.219},H}; -N l14n137[]={{sir,.838},{stm,.146},H}; -N l14n138[]={{sys,.267},{sgwy,.246},H}; -N l14n139[]={{sni,.158},{smxwi,.146},H}; -N l14n140[]={{sso,.158},{sxxU,.200},H}; -N l14n141[]={{smz,.146},H}; -N l14n143[]={{sXpp,.255},{s79l,.121},{sxXz,.128},H}; -N l14n144[]={{sww,.340},{sxUg,.601},{sXXg,.383},H}; -N l14n145[]={{sgix,.246},{ssg,.109},H}; -N l14n146[]={{somp,.109},H}; -N l14n147[]={{swiw,.146},H}; -N l14n148[]={{sgx,.929},{sgxsm,.474},H}; -N l14n149[]={{sgi,.638},{sUm,.301},{sXz,.134},H}; -N l14n150[]={{smxX,.128},H}; -N l14n151[]={{sppi,.200},H}; -N l14n152[]={{sow,.364},{spUg,.191},{srmwx,.146},H}; -N l14n155[]={{sgxy,.301},{syt,.134},{soiw,.146},H}; -N l14n156[]={{syX,.073},H}; -N l14n157[]={{ssp,.389},H}; -N l14n160[]={{srr,.316},{sgqm,.191},H}; -N l14n161[]={{swx,.923},H}; -N l14n162[]={{swi,.571},H}; -N l14n164[]={{sqX,.474},H}; -N l14n165[]={{sgy,.128},H}; -N l14n166[]={{sXro,.146},{smrir,.170},H}; -N l14n167[]={{snXg,.465},{sXl,.121},H}; -N l14n168[]={{sxXX,.273},{somr,.146},{swxy,.146},H}; -N l14n169[]={{sXmw,.273},{szs,.158},{sxmp,.128},H}; -N l14n170[]={{soi,.340},{siir,.128},H}; -N l14n171[]={{sgoiw,.291},{soyw,.109},H}; -N l14n172[]={{smmx,.109},H}; -N l14n173[]={{slXp,.182},H}; -N l14n174[]={{ssq,.194},H}; -N l14n175[]={{sxw,.146},{sgns,.273},H}; -N l14n176[]={{smm,.291},{s7979,.121},H}; -N l14n177[]={{smwi,.273},{srs,.097},H}; -N l14n178[]={{swy,.194},H}; -N l14n180[]={{stU,.158},H}; -N l14n182[]={{sgz,.747},H}; -N l14n183[]={{szXx,.128},H}; -N l14n184[]={{sXm,.510},H}; -N l14n185[]={{swyy,.128},H}; -N l14n186[]={{soy,.364},H}; -N l14n187[]={{szX,.619},{swwX,.364},H}; -N l14n188[]={{sUg,2.090},{swwUg,.291},{swirg,.255},H}; -N l14n189[]={{soXyt,.194},{syv,.097},{sxix,.128},H}; -N l14n190[]={{swXg,.465},H}; -N l14n191[]={{ssr,.389},{sgxX,.246},{smrr,.128},H}; -N l14n192[]={{sxx,.631},{sUU,.465},{sgos,.410},{sXzX,.128},H}; -N l14n193[]={{sxi,.546},{srir,.146},{smqmr,.170},{sgiwm,.219},H}; -N l14n194[]={{sxyw,.200},{smxi,.182},H}; -N l14n195[]={{srX,.304},{sppm,.291},{smow,.164},H}; -N l14n197[]={{sqXvm,.146},H}; -N l14n199[]={{svm,.352},{spmr,.182},{s79g,.146},H}; -N l14n200[]={{sgl,.528},{spx,.158},{sUp,.301},H}; -N l14n201[]={{spi,.352},{sXn,.121},H}; -N l14n202[]={{sywx,.200},{sXppm,.219},{smmrg,.328},H}; -N l14n203[]={{sppXg,.401},{srrX,.200},H}; -N l14n204[]={{swxX,.455},H}; -N l14n205[]={{siv,.231},{swxUg,.255},H}; -N l14n206[]={{syw,.376},H}; -N l14n207[]={{sqXX,.146},{siww,.146},H}; -N l14n208[]={{sss,.073},H}; -N l14n209[]={{sxy,.522},{shi,.194},H}; -N l14n210[]={{smo,.364},H}; -N l14n211[]={{sXxg,.355},H}; -N l14n212[]={{sXvm,.146},H}; -N l14n214[]={{siwoy,.146},H}; -N l14n215[]={{smg,.965},{sgwys,.255},H}; -N l14n216[]={{svn,.097},{sXmwi,.146},H}; -N l14n217[]={{spy,.316},{sgm,.164},{syrg,.164},H}; -N l14n218[]={{sXo,.219},{siwx,.255},{sgwi,.191},H}; -N l14n219[]={{sxirg,.291},{syxx,.109},H}; -N l14n220[]={{soiwo,.194},H}; -N l14n221[]={{sxXg,.792},{smwm,.146},{srXrg,.219},H}; -N l14n222[]={{siw,.474},H}; -N l14n223[]={{sXg,2.113},{syx,.255},H}; -N l14n225[]={{sgzX,.683},{sst,.097},H}; -N l14n226[]={{swmx,.128},H}; -N l14n227[]={{smp,.401},{sgsp,.410},H}; -N l14n229[]={{spXg,.301},H}; -N l14n230[]={{swm,.668},{sqmr,.273},H}; -N l14n232[]={{sqi,.219},H}; -N l14n233[]={{sirg,1.366},{sg79,.255},{svo,.097},H}; -N l14n234[]={{sgn,.546},{sXXr,.474},{sUr,.301},H}; -N l14n235[]={{sXp,.401},{sxxX,.328},{sixx,.273},{shirg,.219},H}; -N l14n236[]={{syyx,.164},H}; -N l14n237[]={{sgixx,.219},H}; -N l14n238[]={{som,.401},{sxsm,.328},H}; -N l14n239[]={{six,.437},{sowi,.237},{sts,.097},H}; -N l14n240[]={{syy,.328},{sii,.182},{srom,.219},H}; -N l14n241[]={{slip,.164},H}; -N l14n242[]={{sxXXr,.170},H}; -N l14n243[]={{sglX,.410},H}; -N l14n244[]={{smq,.364},{sspi,.200},{sXnX,.109},H}; -N l14n245[]={{srw,.085},H}; -N l14n246[]={{sw79,.073},H}; -N l14n247[]={{srri,.182},{sppig,.291},{sls,.085},H}; -N l14n248[]={{swxi,.273},{sqy,.134},H}; -N l14n249[]={{sgsr,.410},H}; -N l14n250[]={{snU,.121},H}; -N l14n251[]={{sgo,1.184},H}; -N l14n252[]={{sXq,.206},H}; -N l14n254[]={{spmw,.200},{smowm,.194},{syxxX,.146},H}; -N l14n255[]={{sqyy,.109},H}; - -D l14_d = -{ +S sxU[] = { t, 228, 0 }; +S ssm[] = { o, i, 0 }; +S sow[] = { k, s, 0 }; +S syy[] = { u, u, 0 }; +S smm[] = { i, i, 0 }; +S sys[] = { u, o, 0 }; +S sxUg[] = { t, 228, a }; +S swwX[] = { s, s, 97, 0 }; +S szU[] = { v, 228, 0 }; +S ssmq[] = { o, i, m, 0 }; +S sxsm[] = { t, o, i, 0 }; +S sxxX[] = { t, t, 97, 0 }; +S sUU[] = { 228, 228, 0 }; +S spU[] = { l, 228, 0 }; +S swXg[] = { s, 97, a }; +S sppm[] = { l, l, i, 0 }; +S swwXg[] = { s, s, 97, a }; +S sowm[] = { k, s, i, 0 }; +S smwi[] = { i, s, e, 0 }; +S sXmw[] = { 97, i, s, 0 }; +S sgsp[] = { 32, o, l, 0 }; +S ssmqm[] = { o, i, m, i, 0 }; +S sixx[] = { e, t, t, 0 }; +S sxsmq[] = { t, o, i, m, 0 }; +S smxx[] = { i, t, t, 0 }; +S sXXg[] = { 97, 97, a }; +S sppX[] = { l, l, 97, 0 }; +S swmg[] = { s, i, a }; +S swU[] = { s, 228, 0 }; +S sgxsm[] = { 32, t, o, i, 0 }; +S stU[] = { p, 228, 0 }; +S sowi[] = { k, s, e, 0 }; +S smmr[] = { i, i, n, 0 }; +S sgoi[] = { 32, k, e, 0 }; +S sgnXg[] = { 32, j, 97, a }; +S srom[] = { n, k, i, 0 }; +S sxyw[] = { t, u, s, 0 }; +S sgxy[] = { 32, t, u, 0 }; +S sppXg[] = { l, l, 97, a }; +S srrX[] = { n, n, 97, 0 }; +S sUm[] = { 228, i, 0 }; +S spmw[] = { l, i, s, 0 }; +S sowmg[] = { k, s, i, a }; +S sxxU[] = { t, t, 228, 0 }; +S sywx[] = { u, s, t, 0 }; +S sUp[] = { 228, l, 0 }; +S sspi[] = { o, l, e, 0 }; +S sUr[] = { 228, n, 0 }; +S sXwx[] = { 97, s, t, 0 }; +S ssmx[] = { o, i, t, 0 }; +S snU[] = { j, 228, 0 }; +S s7979[] = { y, y, 0 }; +S s79l[] = { y, h, 0 }; +S slXp[] = { h, 97, l, 0 }; +S sUx[] = { 228, t, 0 }; +S sgns[] = { 32, j, o, 0 }; +S sspm[] = { o, l, i, 0 }; +S sUz[] = { 228, v, 0 }; +S swxU[] = { s, t, 228, 0 }; +S sXppm[] = { 97, l, l, i, 0 }; +S soXy[] = { k, 97, u, 0 }; +S syyx[] = { u, u, t, 0 }; +S szsm[] = { v, o, i, 0 }; +S slh[] = { h, d, 0 }; +S smow[] = { i, k, s, 0 }; +S smmrg[] = { i, i, n, a }; +S syow[] = { u, k, s, 0 }; +S slip[] = { h, e, l, 0 }; +S syz[] = { u, v, 0 }; +S smpX[] = { i, l, 97, 0 }; +S sXro[] = { 97, n, k, 0 }; +S szXm[] = { v, 97, i, 0 }; +S soXyt[] = { k, 97, u, p, 0 }; +S sxUz[] = { t, 228, v, 0 }; +S smowm[] = { i, k, s, i, 0 }; +S somr[] = { k, i, n, 0 }; +S sglXp[] = { 32, h, 97, l, 0 }; +S sUv[] = { 228, r, 0 }; +S sypy[] = { u, l, u, 0 }; +S sgtU[] = { 32, p, 228, 0 }; +S svn[] = { r, j, 0 }; +S sxxXX[] = { t, t, 97, 97, 0 }; +S soXr[] = { k, 97, n, 0 }; +S swwU[] = { s, s, 228, 0 }; +S smwm[] = { i, s, i, 0 }; +S spXm[] = { l, 97, i, 0 }; +S soU[] = { k, 228, 0 }; +S srir[] = { n, e, n, 0 }; +S swUg[] = { s, 228, a }; +S swwUg[] = { s, s, 228, a }; +S soiwo[] = { k, e, s, k, 0 }; +S soiw[] = { k, e, s, 0 }; +S srirg[] = { n, e, n, a }; +S swmX[] = { s, i, 97, 0 }; +S sXyt[] = { 97, u, p, 0 }; +S sgoiw[] = { 32, k, e, s, 0 }; +S smwxi[] = { i, s, t, e, 0 }; +S sgspi[] = { 32, o, l, e, 0 }; +S sgwys[] = { 32, s, u, o, 0 }; +S stt[] = { p, p, 0 }; +S smqmr[] = { i, m, i, n, 0 }; +S srU[] = { n, 228, 0 }; +S smrr[] = { i, n, n, 0 }; +S sppU[] = { l, l, 228, 0 }; +S swys[] = { s, u, o, 0 }; +S swoy[] = { s, k, u, 0 }; +S swyy[] = { s, u, u, 0 }; +S ssqm[] = { o, m, i, 0 }; +S sippX[] = { e, l, l, 97, 0 }; +S smww[] = { i, s, s, 0 }; +S sqU[] = { m, 228, 0 }; +S sty[] = { p, u, 0 }; +S swmx[] = { s, i, t, 0 }; +S spUg[] = { l, 228, a }; +S sXoX[] = { 97, k, 97, 0 }; +S szXp[] = { v, 97, l, 0 }; +S smrir[] = { i, n, e, n, 0 }; +S sUw[] = { 228, s, 0 }; +S spXmw[] = { l, 97, i, s, 0 }; +S somrg[] = { k, i, n, a }; +S sUzU[] = { 228, v, 228, 0 }; +S sxXz[] = { t, 97, v, 0 }; +S sg79l[] = { 32, y, h, 0 }; +S syowi[] = { u, k, s, e, 0 }; +S sxXXr[] = { t, 97, 97, n, 0 }; +S swxUg[] = { s, t, 228, a }; +S sgzXm[] = { 32, v, 97, i, 0 }; +S szXxg[] = { v, 97, t, a }; +S sspp[] = { o, l, l, 0 }; +S spq[] = { l, m, 0 }; +S sgoXr[] = { 32, k, 97, n, 0 }; +S sglip[] = { 32, h, e, l, 0 }; +S s79xx[] = { y, t, t, 0 }; +S siwoy[] = { e, s, k, u, 0 }; +S sqXvm[] = { m, 97, r, i, 0 }; +S syzX[] = { u, v, 97, 0 }; +S smxw[] = { i, t, s, 0 }; +S siwm[] = { e, s, i, 0 }; +S sqqig[] = { m, m, e, a }; +S sXnX[] = { 97, j, 97, 0 }; +S smmx[] = { i, i, t, 0 }; +S sppUg[] = { l, l, 228, a }; +S sXmwi[] = { 97, i, s, e, 0 }; +S sppmw[] = { l, l, i, s, 0 }; +S smxU[] = { i, t, 228, 0 }; +S smxwi[] = { i, t, s, e, 0 }; +S soyw[] = { k, u, s, 0 }; +S syrr[] = { u, n, n, 0 }; +S syxxX[] = { u, t, t, 97, 0 }; +S srmwx[] = { n, i, s, t, 0 }; +S sowir[] = { k, s, e, n, 0 }; +S sgzXp[] = { 32, v, 97, l, 0 }; +S syrg[] = { u, n, a }; +S sgiwm[] = { 32, e, s, i, 0 }; +S srXrg[] = { n, 97, n, a }; +S smwxX[] = { i, s, t, 97, 0 }; +S swoyw[] = { s, k, u, s, 0 }; +S sgixx[] = { 32, e, t, t, 0 }; +S swmXg[] = { s, i, 97, a }; +S sxXXg[] = { t, 97, 97, a }; +S syxx[] = { u, t, t, 0 }; +S sqyy[] = { m, u, u, 0 }; +S somp[] = { k, i, l, 0 }; + +N l14n0[] = { { stt, .085 }, { siy, .085 }, H }; +N l14n1[] = { { stX, .182 }, { syz, .097 }, { smrx, .146 }, H }; +N l14n2[] = { { sgoy, .273 }, { swig, .164 }, H }; +N l14n5[] = { { smr, .923 }, { sxm, .340 }, { sXoX, .128 }, H }; +N l14n6[] = { { srx, .206 }, { sgwm, .219 }, H }; +N l14n7[] = { { sri, .255 }, H }; +N l14n8[] = { { swo, .219 }, { spXm, .146 }, { somrg, .255 }, { sxXXg, .219 }, H }; +N l14n9[] = { { slX, .255 }, H }; +N l14n10[] = { { siirg, .219 }, H }; +N l14n11[] = { { sipp, .273 }, H }; +N l14n12[] = { { sgp, .364 }, { sppU, .128 }, H }; +N l14n13[] = { { sXr, .947 }, { spm, .631 }, { swg, .200 }, H }; +N l14n14[] = { { smpX, .146 }, { sxxXX, .194 }, H }; +N l14n15[] = { { swoy, .128 }, H }; +N l14n16[] = { { soo, .158 }, { sswx, .146 }, H }; +N l14n17[] = { { swU, .158 }, { swmX, .146 }, { siz, .085 }, H }; +N l14n18[] = { { sgspi, .291 }, H }; +N l14n20[] = { { ssw, .255 }, H }; +N l14n21[] = { { sx79, .219 }, { sgnX, .410 }, H }; +N l14n22[] = { { sms, .109 }, H }; +N l14n23[] = { { szXxg, .255 }, { sgxm, .164 }, { sxxi, .109 }, H }; +N l14n24[] = { { sxii, .109 }, H }; +N l14n25[] = { { ssmq, .328 }, { soU, .097 }, H }; +N l14n27[] = { { swwXg, .583 }, { sowm, .291 }, H }; +N l14n28[] = { { sgtU, .219 }, { sgzXm, .255 }, { sppmw, .146 }, H }; +N l14n29[] = { { sgq, .528 }, { sqmw, .200 }, H }; +N l14n31[] = { { ssrg, .519 }, { sgli, .164 }, { smqX, .109 }, H }; +N l14n32[] = { { sspm, .182 }, { soXr, .146 }, H }; +N l14n33[] = { { srirg, .291 }, H }; +N l14n35[] = { { sil, .109 }, { srXg, .164 }, H }; +N l14n36[] = { { swxm, .164 }, { sym, .085 }, { sgqy, .191 }, H }; +N l14n37[] = { { ssx, .146 }, { sgzXp, .219 }, H }; +N l14n38[] = { { sgoX, .492 }, { smir, .146 }, H }; +N l14n39[] = { { sXqX, .200 }, { svmg, .191 }, { sqqig, .219 }, H }; +N l14n40[] = { { smX, .219 }, H }; +N l14n41[] = { { spig, .328 }, H }; +N l14n44[] = { { sqm, .595 }, { sxg, .710 }, { swxXg, .583 }, { szsm, .164 }, { syzX, .109 }, { sxXq, .109 }, H }; +N l14n46[] = { { sgr, .255 }, { sUv, .219 }, { sippX, .170 }, H }; +N l14n48[] = { { sXX, .668 }, { sxU, .534 }, H }; +N l14n49[] = { { srxX, .164 }, { ssqm, .128 }, H }; +N l14n51[] = { { syrr, .109 }, H }; +N l14n52[] = { { sim, .255 }, H }; +N l14n53[] = { { sxsmq, .364 }, { sns, .158 }, H }; +N l14n54[] = { { ssy, .097 }, H }; +N l14n55[] = { { syow, .164 }, { sglXp, .291 }, { smxU, .109 }, H }; +N l14n56[] = { { spU, .206 }, H }; +N l14n57[] = { { sowir, .146 }, H }; +N l14n60[] = { { slh, .109 }, { srmw, .109 }, H }; +N l14n62[] = { { szXm, .146 }, { sUzU, .287 }, H }; +N l14n63[] = { { sgs, .765 }, { svX, .109 }, { sUw, .191 }, H }; +N l14n64[] = { { spp, .607 }, H }; +N l14n65[] = { { sspp, .128 }, H }; +N l14n66[] = { { sxUz, .146 }, H }; +N l14n67[] = { { szm, .206 }, H }; +N l14n69[] = { { sti, .097 }, H }; +N l14n70[] = { { swmg, .355 }, { syo, .158 }, H }; +N l14n71[] = { { snX, .352 }, H }; +N l14n72[] = { { sgqX, .301 }, { sgws, .164 }, { sqig, .164 }, H }; +N l14n73[] = { { smv, .073 }, H }; +N l14n74[] = { { sXXrg, .765 }, H }; +N l14n75[] = { { srm, .194 }, { syg, .182 }, { smww, .128 }, H }; +N l14n76[] = { { slx, .146 }, { sws, .097 }, H }; +N l14n77[] = { { sli, .182 }, H }; +N l14n79[] = { { sixg, .246 }, H }; +N l14n80[] = { { sgt, .601 }, { sivm, .200 }, { sUx, .273 }, H }; +N l14n81[] = { { sgX, .346 }, { sXv, .219 }, { spq, .085 }, H }; +N l14n82[] = { { sgoi, .328 }, H }; +N l14n84[] = { { sos, .328 }, { ssmqm, .364 }, { sXyt, .146 }, H }; +N l14n85[] = { { sty, .085 }, H }; +N l14n86[] = { { smwx, .474 }, H }; +N l14n87[] = { { syp, .194 }, { sqU, .085 }, { s79xx, .109 }, H }; +N l14n89[] = { { sgxs, .465 }, { sgsrg, .437 }, H }; +N l14n90[] = { { smw, .826 }, H }; +N l14n91[] = { { sig, .565 }, { s79x, .194 }, { sr79, .073 }, H }; +N l14n92[] = { { swir, .219 }, { smri, .146 }, { swwU, .146 }, { smxw, .109 }, H }; +N l14n93[] = { { sly, .109 }, H }; +N l14n94[] = { { swX, .352 }, { sXwx, .182 }, { sypy, .146 }, H }; +N l14n95[] = { { szXp, .128 }, H }; +N l14n97[] = { { spXmw, .170 }, { sg79l, .191 }, { siwm, .109 }, H }; +N l14n98[] = { { sXw, .279 }, H }; +N l14n99[] = { { sglip, .219 }, H }; +N l14n101[] = { { smrg, .792 }, { sxmg, .191 }, { sxip, .128 }, H }; +N l14n102[] = { { soX, .583 }, { ssmx, .182 }, { syowi, .170 }, H }; +N l14n103[] = { { sip, .522 }, { smxx, .255 }, { sywo, .109 }, H }; +N l14n104[] = { { swoyw, .146 }, H }; +N l14n106[] = { { ssm, .510 }, { smmr, .219 }, H }; +N l14n107[] = { { smx, .729 }, { sxs, .449 }, { sppX, .255 }, H }; +N l14n108[] = { { smi, .206 }, { sppUg, .219 }, H }; +N l14n109[] = { { sXrg, 1.230 }, { sro, .243 }, { swxU, .164 }, { soXy, .164 }, { spmg, .191 }, H }; +N l14n110[] = { { szU, .219 }, H }; +N l14n112[] = { { sqq, .121 }, { sgoXr, .255 }, H }; +N l14n113[] = { { swUg, .219 }, { swmXg, .219 }, H }; +N l14n114[] = { { srg, 2.896 }, { sUz, .273 }, { sXmr, .128 }, { sgv, .128 }, H }; +N l14n115[] = { { sXx, .340 }, { sps, .085 }, H }; +N l14n117[] = { { sgnXg, .437 }, { szXr, .182 }, H }; +N l14n118[] = { { srU, .085 }, H }; +N l14n119[] = { { smqm, .291 }, { siwo, .146 }, { swys, .128 }, H }; +N l14n120[] = { { siq, .158 }, H }; +N l14n121[] = { { syr, .255 }, { smwxX, .146 }, H }; +N l14n123[] = { { sxir, .200 }, { sowmg, .401 }, { ssn, .109 }, H }; +N l14n125[] = { { sxX, .972 }, H }; +N l14n131[] = { { sgw, .656 }, H }; +N l14n132[] = { { sXy, .158 }, H }; +N l14n133[] = { { spX, .376 }, { smwxi, .194 }, H }; +N l14n134[] = { { sgiw, .164 }, H }; +N l14n135[] = { { smpp, .128 }, H }; +N l14n136[] = { { smXg, .219 }, H }; +N l14n137[] = { { sir, .838 }, { stm, .146 }, H }; +N l14n138[] = { { sys, .267 }, { sgwy, .246 }, H }; +N l14n139[] = { { sni, .158 }, { smxwi, .146 }, H }; +N l14n140[] = { { sso, .158 }, { sxxU, .200 }, H }; +N l14n141[] = { { smz, .146 }, H }; +N l14n143[] = { { sXpp, .255 }, { s79l, .121 }, { sxXz, .128 }, H }; +N l14n144[] = { { sww, .340 }, { sxUg, .601 }, { sXXg, .383 }, H }; +N l14n145[] = { { sgix, .246 }, { ssg, .109 }, H }; +N l14n146[] = { { somp, .109 }, H }; +N l14n147[] = { { swiw, .146 }, H }; +N l14n148[] = { { sgx, .929 }, { sgxsm, .474 }, H }; +N l14n149[] = { { sgi, .638 }, { sUm, .301 }, { sXz, .134 }, H }; +N l14n150[] = { { smxX, .128 }, H }; +N l14n151[] = { { sppi, .200 }, H }; +N l14n152[] = { { sow, .364 }, { spUg, .191 }, { srmwx, .146 }, H }; +N l14n155[] = { { sgxy, .301 }, { syt, .134 }, { soiw, .146 }, H }; +N l14n156[] = { { syX, .073 }, H }; +N l14n157[] = { { ssp, .389 }, H }; +N l14n160[] = { { srr, .316 }, { sgqm, .191 }, H }; +N l14n161[] = { { swx, .923 }, H }; +N l14n162[] = { { swi, .571 }, H }; +N l14n164[] = { { sqX, .474 }, H }; +N l14n165[] = { { sgy, .128 }, H }; +N l14n166[] = { { sXro, .146 }, { smrir, .170 }, H }; +N l14n167[] = { { snXg, .465 }, { sXl, .121 }, H }; +N l14n168[] = { { sxXX, .273 }, { somr, .146 }, { swxy, .146 }, H }; +N l14n169[] = { { sXmw, .273 }, { szs, .158 }, { sxmp, .128 }, H }; +N l14n170[] = { { soi, .340 }, { siir, .128 }, H }; +N l14n171[] = { { sgoiw, .291 }, { soyw, .109 }, H }; +N l14n172[] = { { smmx, .109 }, H }; +N l14n173[] = { { slXp, .182 }, H }; +N l14n174[] = { { ssq, .194 }, H }; +N l14n175[] = { { sxw, .146 }, { sgns, .273 }, H }; +N l14n176[] = { { smm, .291 }, { s7979, .121 }, H }; +N l14n177[] = { { smwi, .273 }, { srs, .097 }, H }; +N l14n178[] = { { swy, .194 }, H }; +N l14n180[] = { { stU, .158 }, H }; +N l14n182[] = { { sgz, .747 }, H }; +N l14n183[] = { { szXx, .128 }, H }; +N l14n184[] = { { sXm, .510 }, H }; +N l14n185[] = { { swyy, .128 }, H }; +N l14n186[] = { { soy, .364 }, H }; +N l14n187[] = { { szX, .619 }, { swwX, .364 }, H }; +N l14n188[] = { { sUg, 2.090 }, { swwUg, .291 }, { swirg, .255 }, H }; +N l14n189[] = { { soXyt, .194 }, { syv, .097 }, { sxix, .128 }, H }; +N l14n190[] = { { swXg, .465 }, H }; +N l14n191[] = { { ssr, .389 }, { sgxX, .246 }, { smrr, .128 }, H }; +N l14n192[] = { { sxx, .631 }, { sUU, .465 }, { sgos, .410 }, { sXzX, .128 }, H }; +N l14n193[] = { { sxi, .546 }, { srir, .146 }, { smqmr, .170 }, { sgiwm, .219 }, H }; +N l14n194[] = { { sxyw, .200 }, { smxi, .182 }, H }; +N l14n195[] = { { srX, .304 }, { sppm, .291 }, { smow, .164 }, H }; +N l14n197[] = { { sqXvm, .146 }, H }; +N l14n199[] = { { svm, .352 }, { spmr, .182 }, { s79g, .146 }, H }; +N l14n200[] = { { sgl, .528 }, { spx, .158 }, { sUp, .301 }, H }; +N l14n201[] = { { spi, .352 }, { sXn, .121 }, H }; +N l14n202[] = { { sywx, .200 }, { sXppm, .219 }, { smmrg, .328 }, H }; +N l14n203[] = { { sppXg, .401 }, { srrX, .200 }, H }; +N l14n204[] = { { swxX, .455 }, H }; +N l14n205[] = { { siv, .231 }, { swxUg, .255 }, H }; +N l14n206[] = { { syw, .376 }, H }; +N l14n207[] = { { sqXX, .146 }, { siww, .146 }, H }; +N l14n208[] = { { sss, .073 }, H }; +N l14n209[] = { { sxy, .522 }, { shi, .194 }, H }; +N l14n210[] = { { smo, .364 }, H }; +N l14n211[] = { { sXxg, .355 }, H }; +N l14n212[] = { { sXvm, .146 }, H }; +N l14n214[] = { { siwoy, .146 }, H }; +N l14n215[] = { { smg, .965 }, { sgwys, .255 }, H }; +N l14n216[] = { { svn, .097 }, { sXmwi, .146 }, H }; +N l14n217[] = { { spy, .316 }, { sgm, .164 }, { syrg, .164 }, H }; +N l14n218[] = { { sXo, .219 }, { siwx, .255 }, { sgwi, .191 }, H }; +N l14n219[] = { { sxirg, .291 }, { syxx, .109 }, H }; +N l14n220[] = { { soiwo, .194 }, H }; +N l14n221[] = { { sxXg, .792 }, { smwm, .146 }, { srXrg, .219 }, H }; +N l14n222[] = { { siw, .474 }, H }; +N l14n223[] = { { sXg, 2.113 }, { syx, .255 }, H }; +N l14n225[] = { { sgzX, .683 }, { sst, .097 }, H }; +N l14n226[] = { { swmx, .128 }, H }; +N l14n227[] = { { smp, .401 }, { sgsp, .410 }, H }; +N l14n229[] = { { spXg, .301 }, H }; +N l14n230[] = { { swm, .668 }, { sqmr, .273 }, H }; +N l14n232[] = { { sqi, .219 }, H }; +N l14n233[] = { { sirg, 1.366 }, { sg79, .255 }, { svo, .097 }, H }; +N l14n234[] = { { sgn, .546 }, { sXXr, .474 }, { sUr, .301 }, H }; +N l14n235[] = { { sXp, .401 }, { sxxX, .328 }, { sixx, .273 }, { shirg, .219 }, H }; +N l14n236[] = { { syyx, .164 }, H }; +N l14n237[] = { { sgixx, .219 }, H }; +N l14n238[] = { { som, .401 }, { sxsm, .328 }, H }; +N l14n239[] = { { six, .437 }, { sowi, .237 }, { sts, .097 }, H }; +N l14n240[] = { { syy, .328 }, { sii, .182 }, { srom, .219 }, H }; +N l14n241[] = { { slip, .164 }, H }; +N l14n242[] = { { sxXXr, .170 }, H }; +N l14n243[] = { { sglX, .410 }, H }; +N l14n244[] = { { smq, .364 }, { sspi, .200 }, { sXnX, .109 }, H }; +N l14n245[] = { { srw, .085 }, H }; +N l14n246[] = { { sw79, .073 }, H }; +N l14n247[] = { { srri, .182 }, { sppig, .291 }, { sls, .085 }, H }; +N l14n248[] = { { swxi, .273 }, { sqy, .134 }, H }; +N l14n249[] = { { sgsr, .410 }, H }; +N l14n250[] = { { snU, .121 }, H }; +N l14n251[] = { { sgo, 1.184 }, H }; +N l14n252[] = { { sXq, .206 }, H }; +N l14n254[] = { { spmw, .200 }, { smowm, .194 }, { syxxX, .146 }, H }; +N l14n255[] = { { sqyy, .109 }, H }; + +D l14_d = { "finnish", "iso-8859-15", - { - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,0.235,0.000,0.001,0.017,0.157,0.000,0.004,0.041,0.223,0.033,0.109,0.122,0.069,0.163,0.108, - 0.036,0.000,0.039,0.153,0.199,0.105,0.052,0.001,W,0.040,W,W,W,W,W,W, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - Y,Y,Y,Y,0.001,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - Y,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V, - V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V, - V,V,V,V,0.178,V,V,V,V,V,V,V,V,V,V,V, - V,V,V,V,V,V,0.019,V,V,V,V,V,V,V,V,V - }, - { - l14n0,l14n1,l14n2,X,X,l14n5,l14n6,l14n7,l14n8,l14n9,l14n10,l14n11,l14n12,l14n13,l14n14,l14n15, - l14n16,l14n17,l14n18,X,l14n20,l14n21,l14n22,l14n23,l14n24,l14n25,X,l14n27,l14n28,l14n29,X,l14n31, - l14n32,l14n33,X,l14n35,l14n36,l14n37,l14n38,l14n39,l14n40,l14n41,X,X,l14n44,X,l14n46,X, - l14n48,l14n49,X,l14n51,l14n52,l14n53,l14n54,l14n55,l14n56,l14n57,X,X,l14n60,X,l14n62,l14n63, - l14n64,l14n65,l14n66,l14n67,X,l14n69,l14n70,l14n71,l14n72,l14n73,l14n74,l14n75,l14n76,l14n77,X,l14n79, - l14n80,l14n81,l14n82,X,l14n84,l14n85,l14n86,l14n87,X,l14n89,l14n90,l14n91,l14n92,l14n93,l14n94,l14n95, - X,l14n97,l14n98,l14n99,X,l14n101,l14n102,l14n103,l14n104,X,l14n106,l14n107,l14n108,l14n109,l14n110,X, - l14n112,l14n113,l14n114,l14n115,X,l14n117,l14n118,l14n119,l14n120,l14n121,X,l14n123,X,l14n125,X,X, - X,X,X,l14n131,l14n132,l14n133,l14n134,l14n135,l14n136,l14n137,l14n138,l14n139,l14n140,l14n141,X,l14n143, - l14n144,l14n145,l14n146,l14n147,l14n148,l14n149,l14n150,l14n151,l14n152,X,X,l14n155,l14n156,l14n157,X,X, - l14n160,l14n161,l14n162,X,l14n164,l14n165,l14n166,l14n167,l14n168,l14n169,l14n170,l14n171,l14n172,l14n173,l14n174,l14n175, - l14n176,l14n177,l14n178,X,l14n180,X,l14n182,l14n183,l14n184,l14n185,l14n186,l14n187,l14n188,l14n189,l14n190,l14n191, - l14n192,l14n193,l14n194,l14n195,X,l14n197,X,l14n199,l14n200,l14n201,l14n202,l14n203,l14n204,l14n205,l14n206,l14n207, - l14n208,l14n209,l14n210,l14n211,l14n212,X,l14n214,l14n215,l14n216,l14n217,l14n218,l14n219,l14n220,l14n221,l14n222,l14n223, - X,l14n225,l14n226,l14n227,X,l14n229,l14n230,X,l14n232,l14n233,l14n234,l14n235,l14n236,l14n237,l14n238,l14n239, - l14n240,l14n241,l14n242,l14n243,l14n244,l14n245,l14n246,l14n247,l14n248,l14n249,l14n250,l14n251,l14n252,X,l14n254,l14n255 - } + { W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, 0.235, 0.000, 0.001, 0.017, 0.157, 0.000, 0.004, 0.041, 0.223, 0.033, 0.109, 0.122, 0.069, 0.163, 0.108, + 0.036, 0.000, 0.039, 0.153, 0.199, 0.105, 0.052, 0.001, W, 0.040, W, W, W, W, W, W, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + Y, Y, Y, Y, 0.001, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + Y, V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, + V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, + V, V, V, V, 0.178, V, V, V, V, V, V, V, V, V, V, V, + V, V, V, V, V, V, 0.019, V, V, V, V, V, V, V, V, V }, + { l14n0, l14n1, l14n2, X, X, l14n5, l14n6, l14n7, l14n8, l14n9, l14n10, l14n11, l14n12, l14n13, l14n14, l14n15, + l14n16, l14n17, l14n18, X, l14n20, l14n21, l14n22, l14n23, l14n24, l14n25, X, l14n27, l14n28, l14n29, X, l14n31, + l14n32, l14n33, X, l14n35, l14n36, l14n37, l14n38, l14n39, l14n40, l14n41, X, X, l14n44, X, l14n46, X, + l14n48, l14n49, X, l14n51, l14n52, l14n53, l14n54, l14n55, l14n56, l14n57, X, X, l14n60, X, l14n62, l14n63, + l14n64, l14n65, l14n66, l14n67, X, l14n69, l14n70, l14n71, l14n72, l14n73, l14n74, l14n75, l14n76, l14n77, X, l14n79, + l14n80, l14n81, l14n82, X, l14n84, l14n85, l14n86, l14n87, X, l14n89, l14n90, l14n91, l14n92, l14n93, l14n94, l14n95, + X, l14n97, l14n98, l14n99, X, l14n101, l14n102, l14n103, l14n104, X, l14n106, l14n107, l14n108, l14n109, l14n110, X, + l14n112, l14n113, l14n114, l14n115, X, l14n117, l14n118, l14n119, l14n120, l14n121, X, l14n123, X, l14n125, X, X, + X, X, X, l14n131, l14n132, l14n133, l14n134, l14n135, l14n136, l14n137, l14n138, l14n139, l14n140, l14n141, X, l14n143, + l14n144, l14n145, l14n146, l14n147, l14n148, l14n149, l14n150, l14n151, l14n152, X, X, l14n155, l14n156, l14n157, X, X, + l14n160, l14n161, l14n162, X, l14n164, l14n165, l14n166, l14n167, l14n168, l14n169, l14n170, l14n171, l14n172, l14n173, l14n174, l14n175, + l14n176, l14n177, l14n178, X, l14n180, X, l14n182, l14n183, l14n184, l14n185, l14n186, l14n187, l14n188, l14n189, l14n190, l14n191, + l14n192, l14n193, l14n194, l14n195, X, l14n197, X, l14n199, l14n200, l14n201, l14n202, l14n203, l14n204, l14n205, l14n206, l14n207, + l14n208, l14n209, l14n210, l14n211, l14n212, X, l14n214, l14n215, l14n216, l14n217, l14n218, l14n219, l14n220, l14n221, l14n222, l14n223, + X, l14n225, l14n226, l14n227, X, l14n229, l14n230, X, l14n232, l14n233, l14n234, l14n235, l14n236, l14n237, l14n238, l14n239, + l14n240, l14n241, l14n242, l14n243, l14n244, l14n245, l14n246, l14n247, l14n248, l14n249, l14n250, l14n251, l14n252, X, l14n254, l14n255 } }; - - // // Lng: french // Enc: iso-8859-15 // - -S sgpig[]={32,l,e,a}; -S she9[]={d,233,0}; -S sxe9[]={t,233,0}; -S sghe9[]={32,d,233,0}; -S sve9[]={r,233,0}; -S sgQg[]={32,224,a}; -S se9v[]={233,r,0}; -S sxe9g[]={t,233,a}; -S sh27[]={d,39,0}; -S ssyv[]={o,u,r,0}; -S se8wg[]={232,s,a}; -S se8w[]={232,s,0}; -S sZli[]={99,h,e,0}; -S shiwg[]={d,e,s,a}; -S se9x[]={233,t,0}; -S sXmxg[]={97,i,t,a}; -S sgXz[]={32,97,v,0}; -S sXyg[]={97,u,a}; -S sZiw[]={99,e,s,0}; -S sy78[]={u,x,0}; -S se9i[]={233,e,0}; -S smu[]={i,q,0}; -S sXrw[]={97,n,s,0}; -S symg[]={u,i,a}; -S swe9[]={s,233,0}; -S smuy[]={i,q,u,0}; -S se9Z[]={233,99,0}; -S smuyi[]={i,q,u,e,0}; -S sve8w[]={r,232,s,0}; -S sguym[]={32,q,u,i,0}; -S sXrZ[]={97,n,99,0}; -S suym[]={q,u,i,0}; -S sve8[]={r,232,0}; -S sZiwg[]={99,e,s,a}; -S sgmp[]={32,i,l,0}; -S suymg[]={q,u,i,a}; -S sXrwg[]={97,n,s,a}; -S sve8wg[]={r,232,s,a}; -S sgXy[]={32,97,u,0}; -S smj[]={i,f,0}; -S siqir[]={e,m,e,n,0}; -S srhv[]={n,d,r,0}; -S se9k[]={233,g,0}; -S siqi[]={e,m,e,0}; -S sy78g[]={u,x,a}; -S sXtt[]={97,p,p,0}; -S sgXyg[]={32,97,u,a}; -S siwxg[]={e,s,t,a}; -S ssyt[]={o,u,p,0}; -S se9ig[]={233,e,a}; -S sjj[]={f,f,0}; -S spe9[]={l,233,0}; -S smxe9[]={i,t,233,0}; -S sqe9[]={m,233,0}; -S sgmpg[]={32,i,l,a}; -S sqXm[]={m,97,i,0}; -S ssrxg[]={o,n,t,a}; -S sxsy[]={t,o,u,0}; -S smvig[]={i,r,e,a}; -S sgxsy[]={32,t,o,u,0}; -S ssvx[]={o,r,t,0}; -S sZlig[]={99,h,e,a}; -S sve9w[]={r,233,s,0}; -S symw[]={u,i,s,0}; -S svXm[]={r,97,i,0}; -S smxe9g[]={i,t,233,a}; -S sZsy[]={99,o,u,0}; -S sgiwx[]={32,e,s,t,0}; -S sgyrg[]={32,u,n,a}; -S se9p[]={233,l,0}; -S sgqXm[]={32,m,97,i,0}; -S ssqt[]={o,m,p,0}; -S sYpi[]={98,l,e,0}; -S sgXt[]={32,97,p,0}; -S shXrw[]={d,97,n,s,0}; -S svivg[]={r,e,r,a}; -S se8vig[]={232,r,e,a}; -S sXmvi[]={97,i,r,e,0}; -S s27i[]={39,e,0}; -S suy27[]={q,u,39,0}; -S srz[]={n,v,0}; -S se8v[]={232,r,0}; -S sZsqt[]={99,o,m,p,0}; -S sgh27X[]={32,d,39,97,0}; -S sXmwg[]={97,i,s,a}; -S smivg[]={i,e,r,a}; -S sXmv[]={97,i,r,0}; -S sghyg[]={32,d,u,a}; -S sxvig[]={t,r,e,a}; -S sy27[]={u,39,0}; -S sviv[]={r,e,r,0}; -S s27m[]={39,i,0}; -S stsr[]={p,o,n,0}; -S stsw[]={p,o,s,0}; -S srZl[]={n,99,h,0}; -S sXww[]={97,s,s,0}; - -N l15n0[]={{siy,.273},{stt,.124},{smvig,.260},H}; -N l15n1[]={{stX,.285},{swxg,.223},H}; -N l15n2[]={{swig,.446},H}; -N l15n3[]={{ssv,.273},{sZiwg,.334},H}; -N l15n5[]={{sxm,.421},{smr,.372},H}; -N l15n6[]={{srx,.657},{ssyt,.149},H}; -N l15n7[]={{sri,.248},{sghm,.362},H}; -N l15n9[]={{sXrx,.149},{slX,.099},{sXmwg,.223},H}; -N l15n10[]={{sYp,.149},H}; -N l15n11[]={{sZsq,.167},{skv,.099},{sgXr,.195},{sipp,.130},H}; -N l15n12[]={{sgp,1.858},H}; -N l15n13[]={{swg,3.382},{sXr,.595},{spm,.198},H}; -N l15n14[]={{se9k,.223},H}; -N l15n15[]={{sxwg,.502},H}; -N l15n16[]={{ssrwg,.483},H}; -N l15n18[]={{sZig,.251},H}; -N l15n20[]={{sxmsr,.520},{sXmxg,.409},{ssw,.087},H}; -N l15n21[]={{shm,.322},{sgts,.223},{symw,.130},H}; -N l15n22[]={{sms,.434},{sZsr,.260},H}; -N l15n24[]={{srj,.074},H}; -N l15n25[]={{siqir,.198},H}; -N l15n26[]={{spiwg,1.152},H}; -N l15n27[]={{se8wg,.753},{ssrxg,.297},H}; -N l15n28[]={{ssyv,.223},H}; -N l15n29[]={{sgq,.706},{syvg,.334},{sZg,.149},H}; -N l15n31[]={{ssrg,.753},H}; -N l15n32[]={{sgQg,.418},{sjj,.099},H}; -N l15n33[]={{sxig,.362},{sgXt,.167},{suy27,.111},H}; -N l15n34[]={{stv,.334},{shiwg,.409},H}; -N l15n35[]={{sy78,.124},H}; -N l15n36[]={{sym,.297},H}; -N l15n38[]={{smir,.186},H}; -N l15n39[]={{sve8w,.167},{sqXm,.149},H}; -N l15n40[]={{srz,.074},H}; -N l15n41[]={{spig,1.003},{smsrw,.248},{srk,.074},H}; -N l15n42[]={{s27X,.173},H}; -N l15n43[]={{suyig,.409},H}; -N l15n44[]={{sxg,1.580},{sqm,.173},H}; -N l15n45[]={{svs,.273},{sivg,.530},H}; -N l15n46[]={{sgr,.334},{ski,.149},H}; -N l15n47[]={{sXt,.186},H}; -N l15n48[]={{smsrg,.818},H}; -N l15n49[]={{shig,1.505},{sgh27,.362},H}; -N l15n52[]={{spg,.204},{sghiw,.409},H}; -N l15n54[]={{ssy,.471},{sgtv,.418},{sve8,.111},H}; -N l15n55[]={{sgpX,.697},H}; -N l15n56[]={{sgZs,.697},{smu,.124},{sve9w,.130},H}; -N l15n58[]={{siwxg,.297},{se9wg,.439},{sippi,.149},H}; -N l15n59[]={{sghig,1.933},H}; -N l15n60[]={{sZli,.204},{srZi,.111},H}; -N l15n62[]={{siwg,2.174},{sky,.074},H}; -N l15n63[]={{svX,.434},{sgs,.204},{smuy,.186},H}; -N l15n64[]={{sQg,.627},{syig,.362},{spp,.111},H}; -N l15n65[]={{shyg,.195},H}; -N l15n67[]={{szm,.149},{smpg,.279},{sXxms,.223},H}; -N l15n69[]={{sti,.173},H}; -N l15n71[]={{sve9,.211},{snX,.074},{shXr,.111},H}; -N l15n72[]={{sgws,.334},{sqig,.307},{sgqX,.307},H}; -N l15n73[]={{smv,.285},{sghs,.223},H}; -N l15n74[]={{smZ,.124},H}; -N l15n75[]={{syg,.502},{srm,.149},{smww,.111},H}; -N l15n76[]={{sws,.161},{se9ig,.502},H}; -N l15n77[]={{sli,.173},H}; -N l15n78[]={{sXrZ,.167},H}; -N l15n79[]={{sixg,.557},{sgir,.502},{sYX,.074},H}; -N l15n80[]={{sgt,1.115},H}; -N l15n81[]={{sgX,.966},{sXv,.334},H}; -N l15n82[]={{smiv,.149},H}; -N l15n83[]={{sjm,.149},{sXww,.111},H}; -N l15n84[]={{sgh27X,.223},H}; -N l15n85[]={{srwg,.697},{sty,.099},{sxvig,.223},H}; -N l15n86[]={{smwx,.111},H}; -N l15n87[]={{se9g,1.171},{suymg,.334},H}; -N l15n88[]={{sgXy,.251},H}; -N l15n89[]={{sgxs,.223},{sXrh,.111},H}; -N l15n90[]={{smw,.471},H}; -N l15n91[]={{sig,4.200},{smh,.111},{sZsqt,.149},H}; -N l15n92[]={{sZs,.421},H}; -N l15n93[]={{srxi,.167},{sghmv,.223},{srZl,.111},H}; -N l15n94[]={{swX,.211},{sXrwg,.334},H}; -N l15n95[]={{sgyr,.279},H}; -N l15n97[]={{sgu,.465},{svZ,.087},{sYpi,.130},{se8vig,.502},H}; -N l15n98[]={{sXw,.173},{sgY,.186},H}; -N l15n99[]={{sgpi,1.422},{sgXz,.307},{sZsy,.130},{se9p,.195},H}; -N l15n102[]={{srxg,.780},{swe9,.124},H}; -N l15n103[]={{sip,.223},{srig,.334},H}; -N l15n104[]={{sguy,.697},{syq,.087},H}; -N l15n105[]={{sviv,.111},H}; -N l15n106[]={{ssm,.173},H}; -N l15n107[]={{smx,.471},{sxs,.111},{sgjs,.195},H}; -N l15n108[]={{smi,.372},H}; -N l15n110[]={{smuyi,.223},{smxe9,.149},{sZX,.099},{s27i,.074},H}; -N l15n113[]={{svw,.136},H}; -N l15n114[]={{srg,1.059},{sgv,.483},{sxsy,.130},H}; -N l15n115[]={{sgZ,1.041},{sXx,.273},{sps,.074},H}; -N l15n116[]={{suy,.496},{sviw,.204},H}; -N l15n120[]={{siq,.173},H}; -N l15n121[]={{syr,.235},{srhm,.149},H}; -N l15n122[]={{sgxv,.251},{sjg,.111},H}; -N l15n123[]={{sgtX,.557},{shs,.099},H}; -N l15n124[]={{sXvX,.111},H}; -N l15n125[]={{sxX,.149},{sgmp,.251},{smj,.099},H}; -N l15n126[]={{ssqt,.130},H}; -N l15n127[]={{sgZsq,.223},H}; -N l15n130[]={{svx,.173},{sgZsr,.483},H}; -N l15n131[]={{svi,.842},{sgw,.892},{sgtvs,.334},{sy78g,.223},{sgqXm,.260},H}; -N l15n132[]={{sgh,2.583},{sXy,.285},{symg,.279},H}; -N l15n133[]={{spX,.434},{sirx,.483},{sxe9,.223},H}; -N l15n134[]={{sgiw,.223},H}; -N l15n135[]={{sghe9,.474},{sve8wg,.334},H}; -N l15n136[]={{swiv,.149},H}; -N l15n137[]={{sir,.842},{stm,.074},H}; -N l15n138[]={{sgwy,.307},H}; -N l15n139[]={{sghy,.195},H}; -N l15n140[]={{sgjv,.167},H}; -N l15n141[]={{shX,.124},{spe9,.099},H}; -N l15n142[]={{smk,.099},H}; -N l15n144[]={{sww,.235},H}; -N l15n145[]={{sgix,.446},{slm,.074},H}; -N l15n146[]={{sqs,.149},H}; -N l15n147[]={{sgmr,.251},H}; -N l15n148[]={{sgx,.502},H}; -N l15n149[]={{sgi,.929},{she9,.260},{sXz,.149},H}; -N l15n151[]={{sgpXg,.855},{sppi,.130},{sguyi,.223},H}; -N l15n155[]={{syt,.124},H}; -N l15n156[]={{sZlig,.260},H}; -N l15n158[]={{sxv,.310},{sXmv,.111},H}; -N l15n159[]={{sjsv,.130},H}; -N l15n160[]={{smvi,.242},{srr,.099},{sgqm,.195},{shXrw,.149},H}; -N l15n161[]={{swx,.260},H}; -N l15n162[]={{swi,.409},{sqir,.167},H}; -N l15n163[]={{sqt,.161},{sZiw,.186},{sguym,.334},H}; -N l15n164[]={{sqX,.211},H}; -N l15n165[]={{sgy,.186},H}; -N l15n166[]={{sgj,.539},H}; -N l15n167[]={{sxiv,.111},H}; -N l15n168[]={{s78g,.204},H}; -N l15n169[]={{sXmw,.204},{smvg,.195},{szs,.074},{stsr,.111},H}; -N l15n170[]={{se8v,.167},H}; -N l15n171[]={{sp27,.173},{swms,.130},H}; -N l15n172[]={{sqe9,.099},H}; -N l15n173[]={{slig,.223},H}; -N l15n174[]={{ssq,.186},{shv,.111},{syvw,.111},H}; -N l15n175[]={{sxw,.235},{sgirg,.334},{sghX,.195},H}; -N l15n176[]={{ssrw,.372},H}; -N l15n177[]={{srs,.099},{sZx,.099},{sXvg,.195},{sgXg,.195},H}; -N l15n178[]={{sZi,.310},{swy,.149},{smivg,.223},{s27m,.074},H}; -N l15n179[]={{sh27,.161},H}; -N l15n180[]={{sXmx,.260},H}; -N l15n182[]={{sgz,.149},H}; -N l15n183[]={{sgk,.279},H}; -N l15n184[]={{sXm,.496},{sgXyg,.297},{sgxsy,.260},H}; -N l15n185[]={{sgp27,.390},{sjs,.111},{szir,.111},H}; -N l15n186[]={{spiw,.576},{smwg,.362},H}; -N l15n187[]={{ssrx,.260},{se8w,.334},{szX,.087},H}; -N l15n188[]={{sgpiw,.855},{stp,.124},H}; -N l15n189[]={{syv,.359},H}; -N l15n191[]={{ssr,.979},{sgyrg,.260},H}; -N l15n192[]={{sgQ,.279},{sXzX,.111},H}; -N l15n193[]={{sxi,.434},H}; -N l15n194[]={{shiw,.204},{sXwg,.195},{svXm,.130},{sy27,.074},H}; -N l15n195[]={{sgpig,.966},{srX,.099},H}; -N l15n196[]={{sviZ,.149},H}; -N l15n199[]={{svm,.186},H}; -N l15n200[]={{sgl,.223},H}; -N l15n201[]={{spi,.966},{se9v,.390},{sgvi,.362},{svivg,.223},H}; -N l15n202[]={{sxms,.390},{sgZi,.362},{se9Z,.279},{siZx,.130},{sirZ,.111},H}; -N l15n203[]={{suyi,.353},{smxg,.502},{sre9,.136},{sjX,.074},H}; -N l15n205[]={{siv,.545},{sXmvi,.149},H}; -N l15n206[]={{siZ,.173},{syw,.124},{smxe9g,.260},H}; -N l15n207[]={{siqi,.149},H}; -N l15n208[]={{smsr,.595},H}; -N l15n209[]={{shi,.966},{sgtXv,.520},{svwg,.251},{sgjX,.167},H}; -N l15n212[]={{sgtXw,.223},H}; -N l15n213[]={{sirh,.130},H}; -N l15n215[]={{smg,.334},H}; -N l15n217[]={{sgm,.334},{syrg,.307},H}; -N l15n218[]={{sgwi,.418},{se9w,.362},{siwx,.223},H}; -N l15n219[]={{sghi,2.007},H}; -N l15n220[]={{srhv,.149},H}; -N l15n221[]={{sgmpg,.297},H}; -N l15n222[]={{siw,1.239},{sh27X,.111},H}; -N l15n223[]={{sXg,.780},{syx,.186},H}; -N l15n224[]={{syi,.273},{stsw,.111},H}; -N l15n225[]={{shy,.124},H}; -N l15n226[]={{sgqs,.307},{sgiwx,.260},H}; -N l15n227[]={{svig,.780},{smp,.223},H}; -N l15n228[]={{sXyg,.307},H}; -N l15n229[]={{spXg,.641},{sZl,.260},{srZ,.260},{sirxg,.557},{sxe9g,.362},H}; -N l15n230[]={{swm,.248},{siyv,.130},H}; -N l15n231[]={{stXv,.260},{stvs,.186},{swwi,.111},H}; -N l15n232[]={{sqi,.310},H}; -N l15n233[]={{sirg,.390},H}; -N l15n234[]={{sgn,.242},H}; -N l15n235[]={{se9x,.307},{sgZl,.251},{sXp,.111},{sghyg,.223},H}; -N l15n236[]={{se9i,.279},{sjv,.087},H}; -N l15n238[]={{svg,.966},H}; -N l15n239[]={{six,.322},{sts,.285},H}; -N l15n241[]={{sgixg,.595},H}; -N l15n242[]={{stXw,.130},H}; -N l15n244[]={{smq,.087},H}; -N l15n245[]={{srw,.434},{sxvi,.167},{swmsr,.173},H}; -N l15n246[]={{srh,.273},{sZm,.186},{sXxm,.186},H}; -N l15n247[]={{suym,.167},{sls,.074},H}; -N l15n248[]={{sivX,.111},H}; -N l15n249[]={{sghXr,.223},H}; -N l15n251[]={{shmv,.111},H}; -N l15n252[]={{sXq,.074},H}; -N l15n254[]={{sXrw,.186},{sqirx,.198},H}; -N l15n255[]={{szi,.235},{sXtt,.149},{ssvx,.130},H}; - -D l15_d = -{ +S sgpig[] = { 32, l, e, a }; +S she9[] = { d, 233, 0 }; +S sxe9[] = { t, 233, 0 }; +S sghe9[] = { 32, d, 233, 0 }; +S sve9[] = { r, 233, 0 }; +S sgQg[] = { 32, 224, a }; +S se9v[] = { 233, r, 0 }; +S sxe9g[] = { t, 233, a }; +S sh27[] = { d, 39, 0 }; +S ssyv[] = { o, u, r, 0 }; +S se8wg[] = { 232, s, a }; +S se8w[] = { 232, s, 0 }; +S sZli[] = { 99, h, e, 0 }; +S shiwg[] = { d, e, s, a }; +S se9x[] = { 233, t, 0 }; +S sXmxg[] = { 97, i, t, a }; +S sgXz[] = { 32, 97, v, 0 }; +S sXyg[] = { 97, u, a }; +S sZiw[] = { 99, e, s, 0 }; +S sy78[] = { u, x, 0 }; +S se9i[] = { 233, e, 0 }; +S smu[] = { i, q, 0 }; +S sXrw[] = { 97, n, s, 0 }; +S symg[] = { u, i, a }; +S swe9[] = { s, 233, 0 }; +S smuy[] = { i, q, u, 0 }; +S se9Z[] = { 233, 99, 0 }; +S smuyi[] = { i, q, u, e, 0 }; +S sve8w[] = { r, 232, s, 0 }; +S sguym[] = { 32, q, u, i, 0 }; +S sXrZ[] = { 97, n, 99, 0 }; +S suym[] = { q, u, i, 0 }; +S sve8[] = { r, 232, 0 }; +S sZiwg[] = { 99, e, s, a }; +S sgmp[] = { 32, i, l, 0 }; +S suymg[] = { q, u, i, a }; +S sXrwg[] = { 97, n, s, a }; +S sve8wg[] = { r, 232, s, a }; +S sgXy[] = { 32, 97, u, 0 }; +S smj[] = { i, f, 0 }; +S siqir[] = { e, m, e, n, 0 }; +S srhv[] = { n, d, r, 0 }; +S se9k[] = { 233, g, 0 }; +S siqi[] = { e, m, e, 0 }; +S sy78g[] = { u, x, a }; +S sXtt[] = { 97, p, p, 0 }; +S sgXyg[] = { 32, 97, u, a }; +S siwxg[] = { e, s, t, a }; +S ssyt[] = { o, u, p, 0 }; +S se9ig[] = { 233, e, a }; +S sjj[] = { f, f, 0 }; +S spe9[] = { l, 233, 0 }; +S smxe9[] = { i, t, 233, 0 }; +S sqe9[] = { m, 233, 0 }; +S sgmpg[] = { 32, i, l, a }; +S sqXm[] = { m, 97, i, 0 }; +S ssrxg[] = { o, n, t, a }; +S sxsy[] = { t, o, u, 0 }; +S smvig[] = { i, r, e, a }; +S sgxsy[] = { 32, t, o, u, 0 }; +S ssvx[] = { o, r, t, 0 }; +S sZlig[] = { 99, h, e, a }; +S sve9w[] = { r, 233, s, 0 }; +S symw[] = { u, i, s, 0 }; +S svXm[] = { r, 97, i, 0 }; +S smxe9g[] = { i, t, 233, a }; +S sZsy[] = { 99, o, u, 0 }; +S sgiwx[] = { 32, e, s, t, 0 }; +S sgyrg[] = { 32, u, n, a }; +S se9p[] = { 233, l, 0 }; +S sgqXm[] = { 32, m, 97, i, 0 }; +S ssqt[] = { o, m, p, 0 }; +S sYpi[] = { 98, l, e, 0 }; +S sgXt[] = { 32, 97, p, 0 }; +S shXrw[] = { d, 97, n, s, 0 }; +S svivg[] = { r, e, r, a }; +S se8vig[] = { 232, r, e, a }; +S sXmvi[] = { 97, i, r, e, 0 }; +S s27i[] = { 39, e, 0 }; +S suy27[] = { q, u, 39, 0 }; +S srz[] = { n, v, 0 }; +S se8v[] = { 232, r, 0 }; +S sZsqt[] = { 99, o, m, p, 0 }; +S sgh27X[] = { 32, d, 39, 97, 0 }; +S sXmwg[] = { 97, i, s, a }; +S smivg[] = { i, e, r, a }; +S sXmv[] = { 97, i, r, 0 }; +S sghyg[] = { 32, d, u, a }; +S sxvig[] = { t, r, e, a }; +S sy27[] = { u, 39, 0 }; +S sviv[] = { r, e, r, 0 }; +S s27m[] = { 39, i, 0 }; +S stsr[] = { p, o, n, 0 }; +S stsw[] = { p, o, s, 0 }; +S srZl[] = { n, 99, h, 0 }; +S sXww[] = { 97, s, s, 0 }; + +N l15n0[] = { { siy, .273 }, { stt, .124 }, { smvig, .260 }, H }; +N l15n1[] = { { stX, .285 }, { swxg, .223 }, H }; +N l15n2[] = { { swig, .446 }, H }; +N l15n3[] = { { ssv, .273 }, { sZiwg, .334 }, H }; +N l15n5[] = { { sxm, .421 }, { smr, .372 }, H }; +N l15n6[] = { { srx, .657 }, { ssyt, .149 }, H }; +N l15n7[] = { { sri, .248 }, { sghm, .362 }, H }; +N l15n9[] = { { sXrx, .149 }, { slX, .099 }, { sXmwg, .223 }, H }; +N l15n10[] = { { sYp, .149 }, H }; +N l15n11[] = { { sZsq, .167 }, { skv, .099 }, { sgXr, .195 }, { sipp, .130 }, H }; +N l15n12[] = { { sgp, 1.858 }, H }; +N l15n13[] = { { swg, 3.382 }, { sXr, .595 }, { spm, .198 }, H }; +N l15n14[] = { { se9k, .223 }, H }; +N l15n15[] = { { sxwg, .502 }, H }; +N l15n16[] = { { ssrwg, .483 }, H }; +N l15n18[] = { { sZig, .251 }, H }; +N l15n20[] = { { sxmsr, .520 }, { sXmxg, .409 }, { ssw, .087 }, H }; +N l15n21[] = { { shm, .322 }, { sgts, .223 }, { symw, .130 }, H }; +N l15n22[] = { { sms, .434 }, { sZsr, .260 }, H }; +N l15n24[] = { { srj, .074 }, H }; +N l15n25[] = { { siqir, .198 }, H }; +N l15n26[] = { { spiwg, 1.152 }, H }; +N l15n27[] = { { se8wg, .753 }, { ssrxg, .297 }, H }; +N l15n28[] = { { ssyv, .223 }, H }; +N l15n29[] = { { sgq, .706 }, { syvg, .334 }, { sZg, .149 }, H }; +N l15n31[] = { { ssrg, .753 }, H }; +N l15n32[] = { { sgQg, .418 }, { sjj, .099 }, H }; +N l15n33[] = { { sxig, .362 }, { sgXt, .167 }, { suy27, .111 }, H }; +N l15n34[] = { { stv, .334 }, { shiwg, .409 }, H }; +N l15n35[] = { { sy78, .124 }, H }; +N l15n36[] = { { sym, .297 }, H }; +N l15n38[] = { { smir, .186 }, H }; +N l15n39[] = { { sve8w, .167 }, { sqXm, .149 }, H }; +N l15n40[] = { { srz, .074 }, H }; +N l15n41[] = { { spig, 1.003 }, { smsrw, .248 }, { srk, .074 }, H }; +N l15n42[] = { { s27X, .173 }, H }; +N l15n43[] = { { suyig, .409 }, H }; +N l15n44[] = { { sxg, 1.580 }, { sqm, .173 }, H }; +N l15n45[] = { { svs, .273 }, { sivg, .530 }, H }; +N l15n46[] = { { sgr, .334 }, { ski, .149 }, H }; +N l15n47[] = { { sXt, .186 }, H }; +N l15n48[] = { { smsrg, .818 }, H }; +N l15n49[] = { { shig, 1.505 }, { sgh27, .362 }, H }; +N l15n52[] = { { spg, .204 }, { sghiw, .409 }, H }; +N l15n54[] = { { ssy, .471 }, { sgtv, .418 }, { sve8, .111 }, H }; +N l15n55[] = { { sgpX, .697 }, H }; +N l15n56[] = { { sgZs, .697 }, { smu, .124 }, { sve9w, .130 }, H }; +N l15n58[] = { { siwxg, .297 }, { se9wg, .439 }, { sippi, .149 }, H }; +N l15n59[] = { { sghig, 1.933 }, H }; +N l15n60[] = { { sZli, .204 }, { srZi, .111 }, H }; +N l15n62[] = { { siwg, 2.174 }, { sky, .074 }, H }; +N l15n63[] = { { svX, .434 }, { sgs, .204 }, { smuy, .186 }, H }; +N l15n64[] = { { sQg, .627 }, { syig, .362 }, { spp, .111 }, H }; +N l15n65[] = { { shyg, .195 }, H }; +N l15n67[] = { { szm, .149 }, { smpg, .279 }, { sXxms, .223 }, H }; +N l15n69[] = { { sti, .173 }, H }; +N l15n71[] = { { sve9, .211 }, { snX, .074 }, { shXr, .111 }, H }; +N l15n72[] = { { sgws, .334 }, { sqig, .307 }, { sgqX, .307 }, H }; +N l15n73[] = { { smv, .285 }, { sghs, .223 }, H }; +N l15n74[] = { { smZ, .124 }, H }; +N l15n75[] = { { syg, .502 }, { srm, .149 }, { smww, .111 }, H }; +N l15n76[] = { { sws, .161 }, { se9ig, .502 }, H }; +N l15n77[] = { { sli, .173 }, H }; +N l15n78[] = { { sXrZ, .167 }, H }; +N l15n79[] = { { sixg, .557 }, { sgir, .502 }, { sYX, .074 }, H }; +N l15n80[] = { { sgt, 1.115 }, H }; +N l15n81[] = { { sgX, .966 }, { sXv, .334 }, H }; +N l15n82[] = { { smiv, .149 }, H }; +N l15n83[] = { { sjm, .149 }, { sXww, .111 }, H }; +N l15n84[] = { { sgh27X, .223 }, H }; +N l15n85[] = { { srwg, .697 }, { sty, .099 }, { sxvig, .223 }, H }; +N l15n86[] = { { smwx, .111 }, H }; +N l15n87[] = { { se9g, 1.171 }, { suymg, .334 }, H }; +N l15n88[] = { { sgXy, .251 }, H }; +N l15n89[] = { { sgxs, .223 }, { sXrh, .111 }, H }; +N l15n90[] = { { smw, .471 }, H }; +N l15n91[] = { { sig, 4.200 }, { smh, .111 }, { sZsqt, .149 }, H }; +N l15n92[] = { { sZs, .421 }, H }; +N l15n93[] = { { srxi, .167 }, { sghmv, .223 }, { srZl, .111 }, H }; +N l15n94[] = { { swX, .211 }, { sXrwg, .334 }, H }; +N l15n95[] = { { sgyr, .279 }, H }; +N l15n97[] = { { sgu, .465 }, { svZ, .087 }, { sYpi, .130 }, { se8vig, .502 }, H }; +N l15n98[] = { { sXw, .173 }, { sgY, .186 }, H }; +N l15n99[] = { { sgpi, 1.422 }, { sgXz, .307 }, { sZsy, .130 }, { se9p, .195 }, H }; +N l15n102[] = { { srxg, .780 }, { swe9, .124 }, H }; +N l15n103[] = { { sip, .223 }, { srig, .334 }, H }; +N l15n104[] = { { sguy, .697 }, { syq, .087 }, H }; +N l15n105[] = { { sviv, .111 }, H }; +N l15n106[] = { { ssm, .173 }, H }; +N l15n107[] = { { smx, .471 }, { sxs, .111 }, { sgjs, .195 }, H }; +N l15n108[] = { { smi, .372 }, H }; +N l15n110[] = { { smuyi, .223 }, { smxe9, .149 }, { sZX, .099 }, { s27i, .074 }, H }; +N l15n113[] = { { svw, .136 }, H }; +N l15n114[] = { { srg, 1.059 }, { sgv, .483 }, { sxsy, .130 }, H }; +N l15n115[] = { { sgZ, 1.041 }, { sXx, .273 }, { sps, .074 }, H }; +N l15n116[] = { { suy, .496 }, { sviw, .204 }, H }; +N l15n120[] = { { siq, .173 }, H }; +N l15n121[] = { { syr, .235 }, { srhm, .149 }, H }; +N l15n122[] = { { sgxv, .251 }, { sjg, .111 }, H }; +N l15n123[] = { { sgtX, .557 }, { shs, .099 }, H }; +N l15n124[] = { { sXvX, .111 }, H }; +N l15n125[] = { { sxX, .149 }, { sgmp, .251 }, { smj, .099 }, H }; +N l15n126[] = { { ssqt, .130 }, H }; +N l15n127[] = { { sgZsq, .223 }, H }; +N l15n130[] = { { svx, .173 }, { sgZsr, .483 }, H }; +N l15n131[] = { { svi, .842 }, { sgw, .892 }, { sgtvs, .334 }, { sy78g, .223 }, { sgqXm, .260 }, H }; +N l15n132[] = { { sgh, 2.583 }, { sXy, .285 }, { symg, .279 }, H }; +N l15n133[] = { { spX, .434 }, { sirx, .483 }, { sxe9, .223 }, H }; +N l15n134[] = { { sgiw, .223 }, H }; +N l15n135[] = { { sghe9, .474 }, { sve8wg, .334 }, H }; +N l15n136[] = { { swiv, .149 }, H }; +N l15n137[] = { { sir, .842 }, { stm, .074 }, H }; +N l15n138[] = { { sgwy, .307 }, H }; +N l15n139[] = { { sghy, .195 }, H }; +N l15n140[] = { { sgjv, .167 }, H }; +N l15n141[] = { { shX, .124 }, { spe9, .099 }, H }; +N l15n142[] = { { smk, .099 }, H }; +N l15n144[] = { { sww, .235 }, H }; +N l15n145[] = { { sgix, .446 }, { slm, .074 }, H }; +N l15n146[] = { { sqs, .149 }, H }; +N l15n147[] = { { sgmr, .251 }, H }; +N l15n148[] = { { sgx, .502 }, H }; +N l15n149[] = { { sgi, .929 }, { she9, .260 }, { sXz, .149 }, H }; +N l15n151[] = { { sgpXg, .855 }, { sppi, .130 }, { sguyi, .223 }, H }; +N l15n155[] = { { syt, .124 }, H }; +N l15n156[] = { { sZlig, .260 }, H }; +N l15n158[] = { { sxv, .310 }, { sXmv, .111 }, H }; +N l15n159[] = { { sjsv, .130 }, H }; +N l15n160[] = { { smvi, .242 }, { srr, .099 }, { sgqm, .195 }, { shXrw, .149 }, H }; +N l15n161[] = { { swx, .260 }, H }; +N l15n162[] = { { swi, .409 }, { sqir, .167 }, H }; +N l15n163[] = { { sqt, .161 }, { sZiw, .186 }, { sguym, .334 }, H }; +N l15n164[] = { { sqX, .211 }, H }; +N l15n165[] = { { sgy, .186 }, H }; +N l15n166[] = { { sgj, .539 }, H }; +N l15n167[] = { { sxiv, .111 }, H }; +N l15n168[] = { { s78g, .204 }, H }; +N l15n169[] = { { sXmw, .204 }, { smvg, .195 }, { szs, .074 }, { stsr, .111 }, H }; +N l15n170[] = { { se8v, .167 }, H }; +N l15n171[] = { { sp27, .173 }, { swms, .130 }, H }; +N l15n172[] = { { sqe9, .099 }, H }; +N l15n173[] = { { slig, .223 }, H }; +N l15n174[] = { { ssq, .186 }, { shv, .111 }, { syvw, .111 }, H }; +N l15n175[] = { { sxw, .235 }, { sgirg, .334 }, { sghX, .195 }, H }; +N l15n176[] = { { ssrw, .372 }, H }; +N l15n177[] = { { srs, .099 }, { sZx, .099 }, { sXvg, .195 }, { sgXg, .195 }, H }; +N l15n178[] = { { sZi, .310 }, { swy, .149 }, { smivg, .223 }, { s27m, .074 }, H }; +N l15n179[] = { { sh27, .161 }, H }; +N l15n180[] = { { sXmx, .260 }, H }; +N l15n182[] = { { sgz, .149 }, H }; +N l15n183[] = { { sgk, .279 }, H }; +N l15n184[] = { { sXm, .496 }, { sgXyg, .297 }, { sgxsy, .260 }, H }; +N l15n185[] = { { sgp27, .390 }, { sjs, .111 }, { szir, .111 }, H }; +N l15n186[] = { { spiw, .576 }, { smwg, .362 }, H }; +N l15n187[] = { { ssrx, .260 }, { se8w, .334 }, { szX, .087 }, H }; +N l15n188[] = { { sgpiw, .855 }, { stp, .124 }, H }; +N l15n189[] = { { syv, .359 }, H }; +N l15n191[] = { { ssr, .979 }, { sgyrg, .260 }, H }; +N l15n192[] = { { sgQ, .279 }, { sXzX, .111 }, H }; +N l15n193[] = { { sxi, .434 }, H }; +N l15n194[] = { { shiw, .204 }, { sXwg, .195 }, { svXm, .130 }, { sy27, .074 }, H }; +N l15n195[] = { { sgpig, .966 }, { srX, .099 }, H }; +N l15n196[] = { { sviZ, .149 }, H }; +N l15n199[] = { { svm, .186 }, H }; +N l15n200[] = { { sgl, .223 }, H }; +N l15n201[] = { { spi, .966 }, { se9v, .390 }, { sgvi, .362 }, { svivg, .223 }, H }; +N l15n202[] = { { sxms, .390 }, { sgZi, .362 }, { se9Z, .279 }, { siZx, .130 }, { sirZ, .111 }, H }; +N l15n203[] = { { suyi, .353 }, { smxg, .502 }, { sre9, .136 }, { sjX, .074 }, H }; +N l15n205[] = { { siv, .545 }, { sXmvi, .149 }, H }; +N l15n206[] = { { siZ, .173 }, { syw, .124 }, { smxe9g, .260 }, H }; +N l15n207[] = { { siqi, .149 }, H }; +N l15n208[] = { { smsr, .595 }, H }; +N l15n209[] = { { shi, .966 }, { sgtXv, .520 }, { svwg, .251 }, { sgjX, .167 }, H }; +N l15n212[] = { { sgtXw, .223 }, H }; +N l15n213[] = { { sirh, .130 }, H }; +N l15n215[] = { { smg, .334 }, H }; +N l15n217[] = { { sgm, .334 }, { syrg, .307 }, H }; +N l15n218[] = { { sgwi, .418 }, { se9w, .362 }, { siwx, .223 }, H }; +N l15n219[] = { { sghi, 2.007 }, H }; +N l15n220[] = { { srhv, .149 }, H }; +N l15n221[] = { { sgmpg, .297 }, H }; +N l15n222[] = { { siw, 1.239 }, { sh27X, .111 }, H }; +N l15n223[] = { { sXg, .780 }, { syx, .186 }, H }; +N l15n224[] = { { syi, .273 }, { stsw, .111 }, H }; +N l15n225[] = { { shy, .124 }, H }; +N l15n226[] = { { sgqs, .307 }, { sgiwx, .260 }, H }; +N l15n227[] = { { svig, .780 }, { smp, .223 }, H }; +N l15n228[] = { { sXyg, .307 }, H }; +N l15n229[] = { { spXg, .641 }, { sZl, .260 }, { srZ, .260 }, { sirxg, .557 }, { sxe9g, .362 }, H }; +N l15n230[] = { { swm, .248 }, { siyv, .130 }, H }; +N l15n231[] = { { stXv, .260 }, { stvs, .186 }, { swwi, .111 }, H }; +N l15n232[] = { { sqi, .310 }, H }; +N l15n233[] = { { sirg, .390 }, H }; +N l15n234[] = { { sgn, .242 }, H }; +N l15n235[] = { { se9x, .307 }, { sgZl, .251 }, { sXp, .111 }, { sghyg, .223 }, H }; +N l15n236[] = { { se9i, .279 }, { sjv, .087 }, H }; +N l15n238[] = { { svg, .966 }, H }; +N l15n239[] = { { six, .322 }, { sts, .285 }, H }; +N l15n241[] = { { sgixg, .595 }, H }; +N l15n242[] = { { stXw, .130 }, H }; +N l15n244[] = { { smq, .087 }, H }; +N l15n245[] = { { srw, .434 }, { sxvi, .167 }, { swmsr, .173 }, H }; +N l15n246[] = { { srh, .273 }, { sZm, .186 }, { sXxm, .186 }, H }; +N l15n247[] = { { suym, .167 }, { sls, .074 }, H }; +N l15n248[] = { { sivX, .111 }, H }; +N l15n249[] = { { sghXr, .223 }, H }; +N l15n251[] = { { shmv, .111 }, H }; +N l15n252[] = { { sXq, .074 }, H }; +N l15n254[] = { { sXrw, .186 }, { sqirx, .198 }, H }; +N l15n255[] = { { szi, .235 }, { sXtt, .149 }, { ssvx, .130 }, H }; + +D l15_d = { "french", "iso-8859-15", - { - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,0.019,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,0.140,0.014,0.068,0.091,0.277,0.032,0.026,0.021,0.150,0.007,0.003,0.099,0.052,0.140,0.107, - 0.064,0.020,0.141,0.167,0.127,0.103,0.024,0.001,0.008,0.006,0.002,W,W,W,W,W, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - Y,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V, - V,V,V,0.001,V,V,V,V,V,V,V,V,V,V,V,V, - 0.017,V,0.001,V,V,V,V,0.002,0.027,0.142,0.009,V,V,V,V,V, - V,V,V,V,0.002,V,V,V,V,0.003,V,V,V,V,V,V - }, - { - l15n0,l15n1,l15n2,l15n3,X,l15n5,l15n6,l15n7,X,l15n9,l15n10,l15n11,l15n12,l15n13,l15n14,l15n15, - l15n16,X,l15n18,X,l15n20,l15n21,l15n22,X,l15n24,l15n25,l15n26,l15n27,l15n28,l15n29,X,l15n31, - l15n32,l15n33,l15n34,l15n35,l15n36,X,l15n38,l15n39,l15n40,l15n41,l15n42,l15n43,l15n44,l15n45,l15n46,l15n47, - l15n48,l15n49,X,X,l15n52,X,l15n54,l15n55,l15n56,X,l15n58,l15n59,l15n60,X,l15n62,l15n63, - l15n64,l15n65,X,l15n67,X,l15n69,X,l15n71,l15n72,l15n73,l15n74,l15n75,l15n76,l15n77,l15n78,l15n79, - l15n80,l15n81,l15n82,l15n83,l15n84,l15n85,l15n86,l15n87,l15n88,l15n89,l15n90,l15n91,l15n92,l15n93,l15n94,l15n95, - X,l15n97,l15n98,l15n99,X,X,l15n102,l15n103,l15n104,l15n105,l15n106,l15n107,l15n108,X,l15n110,X, - X,l15n113,l15n114,l15n115,l15n116,X,X,X,l15n120,l15n121,l15n122,l15n123,l15n124,l15n125,l15n126,l15n127, - X,X,l15n130,l15n131,l15n132,l15n133,l15n134,l15n135,l15n136,l15n137,l15n138,l15n139,l15n140,l15n141,l15n142,X, - l15n144,l15n145,l15n146,l15n147,l15n148,l15n149,X,l15n151,X,X,X,l15n155,l15n156,X,l15n158,l15n159, - l15n160,l15n161,l15n162,l15n163,l15n164,l15n165,l15n166,l15n167,l15n168,l15n169,l15n170,l15n171,l15n172,l15n173,l15n174,l15n175, - l15n176,l15n177,l15n178,l15n179,l15n180,X,l15n182,l15n183,l15n184,l15n185,l15n186,l15n187,l15n188,l15n189,X,l15n191, - l15n192,l15n193,l15n194,l15n195,l15n196,X,X,l15n199,l15n200,l15n201,l15n202,l15n203,X,l15n205,l15n206,l15n207, - l15n208,l15n209,X,X,l15n212,l15n213,X,l15n215,X,l15n217,l15n218,l15n219,l15n220,l15n221,l15n222,l15n223, - l15n224,l15n225,l15n226,l15n227,l15n228,l15n229,l15n230,l15n231,l15n232,l15n233,l15n234,l15n235,l15n236,X,l15n238,l15n239, - X,l15n241,l15n242,X,l15n244,l15n245,l15n246,l15n247,l15n248,l15n249,X,l15n251,l15n252,X,l15n254,l15n255 - } + { W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, 0.019, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, 0.140, 0.014, 0.068, 0.091, 0.277, 0.032, 0.026, 0.021, 0.150, 0.007, 0.003, 0.099, 0.052, 0.140, 0.107, + 0.064, 0.020, 0.141, 0.167, 0.127, 0.103, 0.024, 0.001, 0.008, 0.006, 0.002, W, W, W, W, W, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + Y, V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, + V, V, V, 0.001, V, V, V, V, V, V, V, V, V, V, V, V, + 0.017, V, 0.001, V, V, V, V, 0.002, 0.027, 0.142, 0.009, V, V, V, V, V, + V, V, V, V, 0.002, V, V, V, V, 0.003, V, V, V, V, V, V }, + { l15n0, l15n1, l15n2, l15n3, X, l15n5, l15n6, l15n7, X, l15n9, l15n10, l15n11, l15n12, l15n13, l15n14, l15n15, + l15n16, X, l15n18, X, l15n20, l15n21, l15n22, X, l15n24, l15n25, l15n26, l15n27, l15n28, l15n29, X, l15n31, + l15n32, l15n33, l15n34, l15n35, l15n36, X, l15n38, l15n39, l15n40, l15n41, l15n42, l15n43, l15n44, l15n45, l15n46, l15n47, + l15n48, l15n49, X, X, l15n52, X, l15n54, l15n55, l15n56, X, l15n58, l15n59, l15n60, X, l15n62, l15n63, + l15n64, l15n65, X, l15n67, X, l15n69, X, l15n71, l15n72, l15n73, l15n74, l15n75, l15n76, l15n77, l15n78, l15n79, + l15n80, l15n81, l15n82, l15n83, l15n84, l15n85, l15n86, l15n87, l15n88, l15n89, l15n90, l15n91, l15n92, l15n93, l15n94, l15n95, + X, l15n97, l15n98, l15n99, X, X, l15n102, l15n103, l15n104, l15n105, l15n106, l15n107, l15n108, X, l15n110, X, + X, l15n113, l15n114, l15n115, l15n116, X, X, X, l15n120, l15n121, l15n122, l15n123, l15n124, l15n125, l15n126, l15n127, + X, X, l15n130, l15n131, l15n132, l15n133, l15n134, l15n135, l15n136, l15n137, l15n138, l15n139, l15n140, l15n141, l15n142, X, + l15n144, l15n145, l15n146, l15n147, l15n148, l15n149, X, l15n151, X, X, X, l15n155, l15n156, X, l15n158, l15n159, + l15n160, l15n161, l15n162, l15n163, l15n164, l15n165, l15n166, l15n167, l15n168, l15n169, l15n170, l15n171, l15n172, l15n173, l15n174, l15n175, + l15n176, l15n177, l15n178, l15n179, l15n180, X, l15n182, l15n183, l15n184, l15n185, l15n186, l15n187, l15n188, l15n189, X, l15n191, + l15n192, l15n193, l15n194, l15n195, l15n196, X, X, l15n199, l15n200, l15n201, l15n202, l15n203, X, l15n205, l15n206, l15n207, + l15n208, l15n209, X, X, l15n212, l15n213, X, l15n215, X, l15n217, l15n218, l15n219, l15n220, l15n221, l15n222, l15n223, + l15n224, l15n225, l15n226, l15n227, l15n228, l15n229, l15n230, l15n231, l15n232, l15n233, l15n234, l15n235, l15n236, X, l15n238, l15n239, + X, l15n241, l15n242, X, l15n244, l15n245, l15n246, l15n247, l15n248, l15n249, X, l15n251, l15n252, X, l15n254, l15n255 } }; - - // // Lng: georgian // Enc: unknown // - -S scac8[]={202,200,0}; -S sc3c0[]={195,192,0}; -S sc8B[]={200,209,0}; -S sc0cc[]={192,204,0}; -S sc4c1[]={196,193,0}; -S sBc0[]={209,192,0}; -S scbc0[]={203,192,0}; -S scac8g[]={202,200,a}; -S sc2c0[]={194,192,0}; -S sAc8[]={208,200,0}; -S sc8Bg[]={200,209,a}; -S sDca[]={211,202,0}; -S sc4ca[]={196,202,0}; -S sc0c5[]={192,197,0}; -S sgc3c0[]={32,195,192,0}; -S sc3c0g[]={195,192,a}; -S sc5c0[]={197,192,0}; -S sc4A[]={196,208,0}; -S sc0cb[]={192,203,0}; -S sc5c4[]={197,196,0}; -S sccc8[]={204,200,0}; -S sAc0[]={208,192,0}; -S sc8ca[]={200,202,0}; -S sc0ca[]={192,202,0}; -S sc5c8[]={197,200,0}; -S sc0c3[]={192,195,0}; -S sc1c0[]={193,192,0}; -S sAcd[]={208,205,0}; -S sgc2c0[]={32,194,192,0}; -S sc4cc[]={196,204,0}; -S sc1c8[]={193,200,0}; -S sc0B[]={192,209,0}; -S sc8c7[]={200,199,0}; -S sc4B[]={196,209,0}; -S scdc1[]={205,193,0}; -S sc7c0[]={199,192,0}; -S sc3c4[]={195,196,0}; -S sIc8[]={216,200,0}; -S sgBc0[]={32,209,192,0}; -S scacd[]={202,205,0}; -S sgcbc0[]={32,203,192,0}; -S scbcd[]={203,205,0}; -S sDcac8[]={211,202,200,0}; -S sc8c0[]={200,192,0}; -S scbc4[]={203,196,0}; -S sc4cac8[]={196,202,200,0}; -S sOc4[]={222,196,0}; -S sc8cc[]={200,204,0}; -S sc4c1c8[]={196,193,200,0}; -S sc8cac8[]={200,202,200,0}; -S scdA[]={205,208,0}; -S sccc4[]={204,196,0}; -S sc8Bc0[]={200,209,192,0}; -S sIc8g[]={216,200,a}; -S sIc4[]={216,196,0}; -S sAc4[]={208,196,0}; -S sc1c0g[]={193,192,a}; -S sc0ccg[]={192,204,a}; -S sDcac8g[]={211,202,200,a}; -S scbc8[]={203,200,0}; -S sAc8g[]={208,200,a}; -S sOc0[]={222,192,0}; -S sc0ccc8[]={192,204,200,0}; -S sgIc4[]={32,216,196,0}; -S sgc3c0g[]={32,195,192,a}; -S sc4Bg[]={196,209,a}; -S sc4c1c0[]={196,193,192,0}; -S sccc3[]={204,195,0}; -S sccc8g[]={204,200,a}; -S sc4cb[]={196,203,0}; -S sc8c0g[]={200,192,a}; -S scac8B[]={202,200,209,0}; -S scac4[]={202,196,0}; -S sc0c2[]={192,194,0}; -S sccc0[]={204,192,0}; -S sc7c8[]={199,200,0}; -S scdB[]={205,209,0}; -S sc7c5[]={199,197,0}; -S sc0c3g[]={192,195,a}; -S sOc5[]={222,197,0}; -S scac0[]={202,192,0}; -S sgcbc4[]={32,203,196,0}; -S sc6c4[]={198,196,0}; -S scbD[]={203,211,0}; -S sc8cac8g[]={200,202,200,a}; -S sgAcd[]={32,208,205,0}; -S sc4Ac7[]={196,208,199,0}; -S sc0cac8[]={192,202,200,0}; -S sc0Ac7[]={192,208,199,0}; -S sc7c8g[]={199,200,a}; -S sc2c8[]={194,200,0}; -S sc5c4ca[]={197,196,202,0}; -S sBc0g[]={209,192,a}; -S scdcb[]={205,203,0}; -S sBc4[]={209,196,0}; -S sc0O[]={192,222,0}; -S sFc0[]={213,192,0}; -S scdc1c0[]={205,193,192,0}; -S sCc0[]={210,192,0}; -S sc5c8B[]={197,200,209,0}; -S sc0Bg[]={192,209,a}; -S sc9c0[]={201,192,0}; -S sc0Ag[]={192,208,a}; -S sc4c1c0g[]={196,193,192,a}; -S sc4c3[]={196,195,0}; -S sEc4[]={212,196,0}; -S sc3c8[]={195,200,0}; -S sBc8[]={209,200,0}; -S sgc4A[]={32,196,208,0}; -S sc2c0cc[]={194,192,204,0}; -S sc4c5[]={196,197,0}; -S sAc4c1[]={208,196,193,0}; -S sc0c0[]={192,192,0}; -S sc0I[]={192,216,0}; -S sc8c3[]={200,195,0}; -S sc4cac8g[]={196,202,200,a}; -S sc8c7g[]={200,199,a}; -S sgc0Ag[]={32,192,208,a}; -S sc4ccg[]={196,204,a}; -S sgc4Ac7[]={32,196,208,199,0}; -S sc0Ac0[]={192,208,192,0}; -S sc7D[]={199,211,0}; -S sc5ca[]={197,202,0}; -S sgcbcd[]={32,203,205,0}; -S sc1c4[]={193,196,0}; -S sc2cd[]={194,205,0}; -S sgc8B[]={32,200,209,0}; -S scbc0A[]={203,192,208,0}; -S sIc0[]={216,192,0}; -S sEc8[]={212,200,0}; -S sc5c0ca[]={197,192,202,0}; -S sc0F[]={192,213,0}; -S sc0c8[]={192,200,0}; -S sc0ccc8g[]={192,204,200,a}; -S sccc4c1[]={204,196,193,0}; -S scaB[]={202,209,0}; -S sgc0cb[]={32,192,203,0}; -S sgc4B[]={32,196,209,0}; -S scdca[]={205,202,0}; -S scaBg[]={202,209,a}; -S sc4ccc8[]={196,204,200,0}; -S sgOc0[]={32,222,192,0}; -S sc8Bc0g[]={200,209,192,a}; -S sc0c6[]={192,198,0}; -S sc4E[]={196,212,0}; -S sc8c2[]={200,194,0}; -S sDAc8[]={211,208,200,0}; -S sc7F[]={199,213,0}; -S sAc0g[]={208,192,a}; -S sgc0Ac0[]={32,192,208,192,0}; -S sgBO[]={32,209,222,0}; -S sc1D[]={193,211,0}; -S sc4c7[]={196,199,0}; -S sc7c0g[]={199,192,a}; -S sc5c3[]={197,195,0}; -S sc9c8[]={201,200,0}; -S sc0Ac8[]={192,208,200,0}; -S sc0c3c0[]={192,195,192,0}; -S sc2c0ccg[]={194,192,204,a}; -S sCc8[]={210,200,0}; -S sc0C[]={192,210,0}; -S sc0K[]={192,218,0}; -S sc0c2c0[]={192,194,192,0}; -S sc4Ec4[]={196,212,196,0}; -S sc2c0cb[]={194,192,203,0}; -S sCc4[]={210,196,0}; -S sgc2c0cb[]={32,194,192,203,0}; -S sc5c0g[]={197,192,a}; -S sAc3[]={208,195,0}; -S sc0cbcd[]={192,203,205,0}; -S sc8K[]={200,218,0}; -S sHc5[]={215,197,0}; -S sc1c8B[]={193,200,209,0}; -S sccc3c0[]={204,195,192,0}; -S sc0G[]={192,214,0}; -S sccc3c0g[]={204,195,192,a}; -S sc0cbc8[]={192,203,200,0}; -S sgIc0[]={32,216,192,0}; -S sc0c5c0[]={192,197,192,0}; -S scbDca[]={203,211,202,0}; -S sc4c1Dca[]={196,193,211,202,0}; -S sOc0ca[]={222,192,202,0}; -S sc0E[]={192,212,0}; -S sc7c0c5[]={199,192,197,0}; -S sFc0A[]={213,192,208,0}; -S sc4c1D[]={196,193,211,0}; -S sc0c5c8[]={192,197,200,0}; -S scbc4Ec4[]={203,196,212,196,0}; -S scac8c0[]={202,200,192,0}; -S sc2A[]={194,208,0}; -S scbc4E[]={203,196,212,0}; -S sBOc5[]={209,222,197,0}; -S sc6c4g[]={198,196,a}; -S sc5B[]={197,209,0}; -S scac8Bg[]={202,200,209,a}; -S scacdg[]={202,205,a}; -S sc3A[]={195,208,0}; -S scccd[]={204,205,0}; -S sCcd[]={210,205,0}; -S sFc0Ac7[]={213,192,208,199,0}; -S sc1Dca[]={193,211,202,0}; -S sBc0O[]={209,192,222,0}; -S sgc7c5[]={32,199,197,0}; -S sc8D[]={200,211,0}; -S sc3c2[]={195,194,0}; -S sc0c1[]={192,193,0}; -S sc8c5[]={200,197,0}; -S sAc7c8[]={208,199,200,0}; -S sc0cbc0[]={192,203,192,0}; -S sc4c1c8B[]={196,193,200,209,0}; -S scdcc[]={205,204,0}; -S sgcbc4E[]={32,203,196,212,0}; -S sBC[]={209,210,0}; -S sc5c8c7[]={197,200,199,0}; -S scbc0cc[]={203,192,204,0}; -S sc0Ic8[]={192,216,200,0}; -S sc5c4cac8[]={197,196,202,200,0}; -S scdBg[]={205,209,a}; -S scbc0g[]={203,192,a}; -S sDcc[]={211,204,0}; -S sc8c9[]={200,201,0}; -S sc5c8Bg[]={197,200,209,a}; -S sHcd[]={215,205,0}; -S sMc4[]={220,196,0}; -S sAc7c8g[]={208,199,200,a}; -S scac8c0g[]={202,200,192,a}; -S sgc4Bg[]={32,196,209,a}; -S sOc4ca[]={222,196,202,0}; -S sgBc0O[]={32,209,192,222,0}; -S scbc8ca[]={203,200,202,0}; -S scdcacd[]={205,202,205,0}; -S sc2c0cbcd[]={194,192,203,205,0}; -S sAc8B[]={208,200,209,0}; -S sc2c8g[]={194,200,a}; -S scdc3[]={205,195,0}; -S scdc1c0g[]={205,193,192,a}; -S sc8ccc3[]={200,204,195,0}; -S scec8[]={206,200,0}; -S sc2c0c3[]={194,192,195,0}; -S sc4Ac7c8[]={196,208,199,200,0}; -S sc4c1c8g[]={196,193,200,a}; -S scdc2[]={205,194,0}; -S sc1c8g[]={193,200,a}; -S sOcd[]={222,205,0}; -S sJc4[]={217,196,0}; -S sc0c5B[]={192,197,209,0}; -S scdc1c8[]={205,193,200,0}; -S sFA[]={213,208,0}; -S sc7c5c0ca[]={199,197,192,202,0}; -S sc0c5c8B[]={192,197,200,209,0}; -S sCc8g[]={210,200,a}; -S scac4c1[]={202,196,193,0}; -S scbc3[]={203,195,0}; -S sc1Dcac8[]={193,211,202,200,0}; -S sc0cac8g[]={192,202,200,a}; -S sc1c8c7[]={193,200,199,0}; -S sgFc0[]={32,213,192,0}; -S sc4ccc8g[]={196,204,200,a}; -S sc0Oc4[]={192,222,196,0}; -S sMc8[]={220,200,0}; -S sc0Bc0[]={192,209,192,0}; -S sKOc4[]={218,222,196,0}; -S sc1c8Bg[]={193,200,209,a}; -S sc7Dca[]={199,211,202,0}; -S sc5c0cc[]={197,192,204,0}; -S sc0caO[]={192,202,222,0}; -S sAc0c5[]={208,192,197,0}; -S sIc0cbc8[]={216,192,203,200,0}; -S sc0cbc8ca[]={192,203,200,202,0}; -S sAc7D[]={208,199,211,0}; -S sc8C[]={200,210,0}; -S sc6c8[]={198,200,0}; -S sDcag[]={211,202,a}; -S scdc4[]={205,196,0}; -S sccc8ca[]={204,200,202,0}; -S sc1A[]={193,208,0}; -S sAcdcb[]={208,205,203,0}; -S sGc5[]={214,197,0}; -S sAcdc1[]={208,205,193,0}; -S sgcbc6[]={32,203,198,0}; -S sOc8[]={222,200,0}; -S scdc5[]={205,197,0}; -S sAc0c3[]={208,192,195,0}; -S sgc9c0[]={32,201,192,0}; -S sFc5[]={213,197,0}; -S sc2c4[]={194,196,0}; -S sEca[]={212,202,0}; -S sc4D[]={196,211,0}; -S sgAcdcb[]={32,208,205,203,0}; -S sgc7c5c0[]={32,199,197,192,0}; -S sBOc5c0[]={209,222,197,192,0}; -S sgc8Bg[]={32,200,209,a}; -S sc0Ac7D[]={192,208,199,211,0}; -S sc0Ic8g[]={192,216,200,a}; -S scdcbg[]={205,203,a}; -S scbc6[]={203,198,0}; -S scbc7[]={203,199,0}; -S sDAc8g[]={211,208,200,a}; -S sIc0cb[]={216,192,203,0}; -S sc5c4c1[]={197,196,193,0}; -S sAcb[]={208,203,0}; -S sc3Acd[]={195,208,205,0}; -S sc2c0c3c0[]={194,192,195,192,0}; -S sc5c0A[]={197,192,208,0}; -S sc5c3c4[]={197,195,196,0}; -S sAc7Dca[]={208,199,211,202,0}; -S scacdc1[]={202,205,193,0}; -S scac8Bc0[]={202,200,209,192,0}; -S sc5c4cc[]={197,196,204,0}; -S sc0c2c0cc[]={192,194,192,204,0}; -S scaO[]={202,222,0}; -S sc5Bg[]={197,209,a}; -S sgIc0cb[]={32,216,192,203,0}; -S sc8c7c0[]={200,199,192,0}; -S sc7c5c0[]={199,197,192,0}; -S sAc3c0[]={208,195,192,0}; -S sgAc8[]={32,208,200,0}; -S sOc5c0[]={222,197,192,0}; -S sc4cac8B[]={196,202,200,209,0}; -S sgBOc5[]={32,209,222,197,0}; -S sc1c0B[]={193,192,209,0}; -S sc4Ac4[]={196,208,196,0}; -S sc3c2c0[]={195,194,192,0}; -S sc7c4[]={199,196,0}; -S sHc5c0[]={215,197,192,0}; -S sc8c2c8[]={200,194,200,0}; -S sCc0cc[]={210,192,204,0}; -S sgCc0[]={32,210,192,0}; -S sCD[]={210,211,0}; -S sc3cd[]={195,205,0}; -S sc0Ac0g[]={192,208,192,a}; -S sAc8ca[]={208,200,202,0}; -S sc0c5Bg[]={192,197,209,a}; -S sc3c0B[]={195,192,209,0}; -S sgOc0ca[]={32,222,192,202,0}; -S sc8FA[]={200,213,208,0}; -S sAcdB[]={208,205,209,0}; -S sOc0caO[]={222,192,202,222,0}; -S sOc5c8[]={222,197,200,0}; -S sccC[]={204,210,0}; -S sOcdcacd[]={222,205,202,205,0}; -S sc8c3c4[]={200,195,196,0}; -S sc4caB[]={196,202,209,0}; -S sccc4c1c8[]={204,196,193,200,0}; -S sgc7Dg[]={32,199,211,a}; -S sccc8cac8[]={204,200,202,200,0}; -S sgc2c0c3[]={32,194,192,195,0}; -S sgcbc0c2[]={32,203,192,194,0}; -S sgAc0[]={32,208,192,0}; -S sc4C[]={196,210,0}; -S sDAc0[]={211,208,192,0}; - -N l16n0[]={{sc0c0,.313},H}; -N l16n1[]={{sgBc0,.683},{scbc4Ec4,.456},H}; -N l16n2[]={{sgc2c0,.854},{sc2c0cc,.512},{sc1c8Bg,.512},{sccc8cac8,.285},H}; -N l16n3[]={{sccc4c1,.427},H}; -N l16n5[]={{sgF,.133},H}; -N l16n6[]={{sgc6,.133},H}; -N l16n7[]={{sc1c8g,.448},H}; -N l16n8[]={{sc8A,.370},H}; -N l16n11[]={{sCcd,.228},H}; -N l16n12[]={{scdcacd,.299},H}; -N l16n13[]={{sBO,.399},H}; -N l16n15[]={{sBc0,1.651},H}; -N l16n16[]={{sc0A,2.022},{sc1Dca,.342},H}; -N l16n17[]={{sc0c1,.199},H}; -N l16n18[]={{sAc2,.199},{sgCc0,.142},H}; -N l16n19[]={{sgc3c0,1.139},{scacd,.683},H}; -N l16n20[]={{scdBg,.448},H}; -N l16n22[]={{sCc8g,.384},{sEca,.171},{sc0Ac7D,.342},H}; -N l16n23[]={{sgc7,.475},{sc9c0,.342},H}; -N l16n24[]={{sAcdc1,.256},H}; -N l16n25[]={{sc8B,2.249},{sc4Ac7,.598},{scac8Bg,.683},{scbc0cc,.299},{sDcc,.199},H}; -N l16n26[]={{sc8c2,.285},{sc1c0B,.214},H}; -N l16n27[]={{sc2cd,.313},H}; -N l16n28[]={{sc7D,.313},{sc5Bg,.384},H}; -N l16n29[]={{sc7c4,.142},H}; -N l16n30[]={{scac8g,3.331},{sc5c8B,.512},{sc4cac8g,.940},{sHc5,.256},H}; -N l16n31[]={{sc1c0,.911},H}; -N l16n33[]={{sc0B,.826},{sc4caB,.214},H}; -N l16n34[]={{sc0c2,.456},H}; -N l16n35[]={{sc5c8,.968},{sgc8B,.313},{sAc3,.256},H}; -N l16n36[]={{sKO,.342},H}; -N l16n37[]={{sc4c1c8,.897},{sc8ccc3,.299},H}; -N l16n38[]={{sc4ca,1.167},{sc2c8g,.448},{sAc8ca,.214},H}; -N l16n40[]={{sgc8,.683},H}; -N l16n41[]={{sgc4Ac7,.418},H}; -N l16n42[]={{sgcbcd,.313},{sc8C,.171},{sOc8,.171},{sc5c4c1,.256},H}; -N l16n43[]={{sc8c3,.313},H}; -N l16n44[]={{sIc4,.541},{sc0ccg,1.217},H}; -N l16n45[]={{sc4c1c0g,1.025},H}; -N l16n46[]={{sc7c5,.427},{sCc0,.342},H}; -N l16n47[]={{sc1A,.171},H}; -N l16n48[]={{sc0Ic8,.299},H}; -N l16n49[]={{sc4cac8B,.342},H}; -N l16n50[]={{scbcd,.683},{sc0C,.256},H}; -N l16n51[]={{sc0c3,.911},H}; -N l16n52[]={{sAc4,.541},{sc1c8c7,.256},{sc0caO,.256},{scaO,.171},H}; -N l16n54[]={{scac0,.427},H}; -N l16n55[]={{sc4cb,.484},{sOc5c0,.256},H}; -N l16n56[]={{sgI,.626},H}; -N l16n57[]={{sc7g,.811},{sgc9,.304},{sc7c0g,.577},H}; -N l16n58[]={{sc8cac8,.897},{scec8,.199},{sc5c3c4,.256},{sc3cd,.142},H}; -N l16n59[]={{sc8D,.199},H}; -N l16n60[]={{sc4Ec4,.384},{scdc1c8,.256},{sc3Acd,.256},{sgOc0ca,.190},H}; -N l16n61[]={{scdca,.285},H}; -N l16n62[]={{sc2c0,1.452},{sc7F,.285},H}; -N l16n63[]={{sgc4Bg,.266},H}; -N l16n64[]={{sc4ccc8g,.512},H}; -N l16n65[]={{sBC,.199},H}; -N l16n66[]={{sc0cac8,.555},{sc6c8,.171},H}; -N l16n67[]={{sgcbc4E,.266},H}; -N l16n68[]={{scdc1c0g,.598},H}; -N l16n69[]={{sc5ca,.313},{scbc0A,.470},{sgFc0,.171},H}; -N l16n70[]={{scbDca,.342},H}; -N l16n71[]={{sccc3c0g,.769},H}; -N l16n72[]={{sc4cc,.826},{sgAc8,.171},H}; -N l16n73[]={{sc5c0ca,.427},{sgJ,.133},H}; -N l16n75[]={{sgBO,.256},{sJc4,.171},{sgc2c0c3,.190},H}; -N l16n77[]={{sc8c5,.199},{sc8FA,.214},H}; -N l16n78[]={{scdcb,.370},{sc2A,.228},H}; -N l16n80[]={{sAg,.726},{sc0Ac0,.470},{sAc0g,.641},{sOc0ca,.342},{sc7c0c5,.342},{sc0c5B,.256},H}; -N l16n81[]={{scccd,.228},{sAc0c3,.256},H}; -N l16n83[]={{sBc4,.370},{sc0cbc8,.342},H}; -N l16n84[]={{sc0E,.228},H}; -N l16n85[]={{scbc0,1.509},{sc0c5,1.139},{sDAc8g,.512},H}; -N l16n87[]={{scaB,.285},{sDcag,.384},H}; -N l16n88[]={{sc8g,6.620},{sc8c0g,1.089},{sc3c0B,.214},H}; -N l16n89[]={{sc8Bc0,.854},{sgc0cb,.285},H}; -N l16n90[]={{sgK,.266},H}; -N l16n91[]={{sgcb,1.519},{sccc4c1c8,.285},H}; -N l16n92[]={{sccc8g,1.089},H}; -N l16n93[]={{sc3c0,2.278},{sDA,.569},{sc8F,.285},H}; -N l16n94[]={{sc6c4g,.512},{scac8c0g,.598},{sc2c0cbcd,.399},{scacdc1,.256},{sHc5c0,.214},H}; -N l16n95[]={{scdcc,.199},{sAc7c8g,.598},{sc5c0cc,.256},H}; -N l16n96[]={{sc0g,6.107},{sc0c5c8B,.342},H}; -N l16n97[]={{sc7c8,.456},{sc0Bc0,.256},H}; -N l16n98[]={{sc1D,.256},{sc2c0ccg,.769},{sc0c2c0,.384},H}; -N l16n99[]={{sc1c4,.313},{sgc2c0cb,.342},{sAc3c0,.256},H}; -N l16n100[]={{sc0ccc8,.769},H}; -N l16n101[]={{sc0F,.285},H}; -N l16n102[]={{sc0c6,.285},H}; -N l16n103[]={{sAc7,.769},{sAc0c5,.256},H}; -N l16n104[]={{sc1Dcac8,.342},H}; -N l16n106[]={{sc0Oc4,.256},H}; -N l16n108[]={{sgcc,.209},H}; -N l16n109[]={{sc3A,.228},H}; -N l16n110[]={{sc7c5c0,.256},H}; -N l16n111[]={{sBg,4.869},{sc8c7,.826},{sBc0g,.833},H}; -N l16n112[]={{sIc8,.712},{sc0Ag,.769},H}; -N l16n113[]={{sc4Ac7c8,.399},{sCD,.142},H}; -N l16n114[]={{sCc4,.256},H}; -N l16n115[]={{sgc3c0g,.683},{sc0c3c0,.384},{scacdg,.512},{sAc8B,.299},H}; -N l16n116[]={{sccc0,.456},H}; -N l16n118[]={{sc0G,.256},H}; -N l16n120[]={{sAc8,1.395},{sgIc0,.228},{sAc7D,.256},H}; -N l16n121[]={{sc8Bg,2.691},{sgc9c0,.171},H}; -N l16n122[]={{scac4,.456},H}; -N l16n123[]={{sFc0A,.342},H}; -N l16n124[]={{sgM,.285},H}; -N l16n126[]={{sc5c8Bg,.598},H}; -N l16n127[]={{sc1c0g,1.217},{sgAcd,.399},{sAc4c1,.470},{sc3c2,.199},{sOcd,.199},H}; -N l16n129[]={{sc0Bg,.769},H}; -N l16n130[]={{sc2c4,.171},H}; -N l16n131[]={{sgc8Bg,.228},H}; -N l16n132[]={{sBOc5,.342},H}; -N l16n133[]={{sc4c1c8g,.598},H}; -N l16n134[]={{sKg,.641},{sAcdcb,.256},H}; -N l16n136[]={{sc0c8,.285},{scbc3,.171},{sgc7Dg,.190},H}; -N l16n138[]={{sc0cbcd,.384},H}; -N l16n139[]={{sFc0,.342},{scbc8ca,.299},{sc5c0A,.256},H}; -N l16n140[]={{sc4A,1.082},H}; -N l16n141[]={{sc4c1,1.680},{sc5c4ca,.555},H}; -N l16n142[]={{sgc7c5,.228},{sgce,.114},H}; -N l16n143[]={{sDcac8,1.025},{sOc5c8,.214},H}; -N l16n144[]={{sgc0A,.655},{sKOc4,.256},{sc0Ic8g,.512},H}; -N l16n145[]={{sc8c9,.199},H}; -N l16n147[]={{sc0c3g,.961},H}; -N l16n148[]={{sOc4ca,.299},{sOcdcacd,.285},H}; -N l16n149[]={{sc0c5c0,.342},H}; -N l16n150[]={{scag,.555},H}; -N l16n151[]={{sBc8,.342},{sc8c3c4,.214},H}; -N l16n152[]={{scbD,.399},{sc0I,.313},{sc4c1c8B,.399},H}; -N l16n153[]={{scbc4,.626},{sBc0O,.342},H}; -N l16n154[]={{sc8cac8g,1.196},{sgBOc5,.228},H}; -N l16n155[]={{sc5c0,1.110},{sgcbc0,.683},{sgBc0O,.266},{sFA,.171},H}; -N l16n157[]={{sc4B,.740},{sc0Ac7,.555},{sDAc0,.214},H}; -N l16n158[]={{sgO,.418},{sc4c1D,.342},H}; -N l16n159[]={{sc9c8,.256},{sc2c0c3,.299},H}; -N l16n160[]={{sgc0,1.063},H}; -N l16n161[]={{sc3c4,.712},{sIc0cb,.256},H}; -N l16n162[]={{sc8ca,.997},{sOc0,.512},{sc1c8B,.384},{sc0cac8g,.512},H}; -N l16n163[]={{scdA,.598},{sc5c4cc,.256},H}; -N l16n164[]={{scdc1,.740},{sgIc4,.512},H}; -N l16n166[]={{sHcd,.199},{sccC,.142},H}; -N l16n167[]={{sc1c8,.826},{sccc3,.484},H}; -N l16n168[]={{sc4ccg,.705},{sc0Ac8,.384},{sMc4,.199},H}; -N l16n170[]={{sc0ca,.997},{sAK,.228},{sccc8ca,.256},H}; -N l16n171[]={{sAcb,.171},H}; -N l16n173[]={{sDg,.427},H}; -N l16n174[]={{scdcbg,.384},{sc4C,.142},H}; -N l16n175[]={{sc4c3,.342},{sc8c7c0,.256},H}; -N l16n176[]={{sgA,.569},{sEc4,.342},{sc5c8c7,.299},{sc0Ac0g,.427},{sc0c5Bg,.427},H}; -N l16n177[]={{sgc1,.361},{sc0cbc8ca,.342},H}; -N l16n178[]={{sc8K,.256},{sc8c2c8,.214},H}; -N l16n179[]={{sc8cb,.142},H}; -N l16n180[]={{scdB,.456},H}; -N l16n181[]={{scbg,.555},{scbc4E,.342},{scbc0g,.448},{scdc2,.199},H}; -N l16n182[]={{sCc8,.256},H}; -N l16n183[]={{scaBg,.641},H}; -N l16n184[]={{sccc4,.598},H}; -N l16n185[]={{scac8B,.726},{sc8Bc0g,.854},H}; -N l16n186[]={{sc0K,.256},H}; -N l16n187[]={{sc0cb,1.082},{scbc6,.171},H}; -N l16n188[]={{sc5B,.228},H}; -N l16n189[]={{sc3c0g,2.498},{sc3g,.897},H}; -N l16n190[]={{scac8,2.676},{sc4cac8,.940},H}; -N l16n191[]={{sc4D,.171},{sc3c2c0,.214},H}; -N l16n193[]={{sgB,.892},{sc7c8g,.833},H}; -N l16n194[]={{sgc2,.911},H}; -N l16n195[]={{sOB,.142},H}; -N l16n196[]={{sc8cc,.598},{sc0ccc8g,.854},{sBOc5c0,.342},H}; -N l16n197[]={{scac4c1,.256},H}; -N l16n198[]={{sc2c8,.370},{scdc3,.199},{sc0c2c0cc,.342},H}; -N l16n199[]={{sgcbc4,.399},H}; -N l16n200[]={{sAcdB,.214},H}; -N l16n202[]={{sc7Dca,.256},H}; -N l16n204[]={{sc0cc,1.708},{sc7c5c0ca,.342},{scbc7,.171},H}; -N l16n205[]={{sAcd,.911},{sc4c1c0,.726},H}; -N l16n206[]={{sc5c3,.256},{sgc7c5c0,.228},H}; -N l16n207[]={{sc8c7g,.705},H}; -N l16n208[]={{sIc8g,1.281},{sc4E,.285},{sgc0Ac0,.342},{sFc0Ac7,.456},H}; -N l16n209[]={{sc4c5,.313},H}; -N l16n210[]={{sgC,.152},H}; -N l16n211[]={{sgc3,.968},H}; -N l16n212[]={{sccg,1.409},{sgc4A,.342},H}; -N l16n214[]={{sAc7Dca,.342},H}; -N l16n215[]={{scdc4,.171},H}; -N l16n216[]={{sAc8g,1.153},H}; -N l16n217[]={{sc7c0,.740},{sgIc0cb,.228},H}; -N l16n220[]={{sc4g,1.068},H}; -N l16n221[]={{scbc8,.541},{sgcbc6,.171},H}; -N l16n222[]={{sgOc0,.285},H}; -N l16n223[]={{sc5c4,1.082},{sgc4B,.285},{sc2c0c3c0,.342},H}; -N l16n224[]={{sc4ccc8,.427},{sFc5,.171},{sgAcdcb,.228},H}; -N l16n225[]={{sgcbc0c2,.190},H}; -N l16n227[]={{sgD,.304},H}; -N l16n228[]={{sgc4,.531},{scdc1c0,.512},H}; -N l16n229[]={{sc3c8,.342},{sc5c4cac8,.399},H}; -N l16n230[]={{sOc4,.626},H}; -N l16n231[]={{sccc3c0,.384},H}; -N l16n232[]={{sIc0,.313},{scdc5,.171},H}; -N l16n234[]={{sOc0caO,.285},H}; -N l16n236[]={{sMc8,.171},H}; -N l16n237[]={{sc0c5c8,.342},H}; -N l16n239[]={{sDcac8g,1.623},H}; -N l16n240[]={{sAc0,1.025},{sgc0Ag,.418},{sgAc0,.142},H}; -N l16n242[]={{sCc0cc,.214},H}; -N l16n243[]={{scdg,1.025},{sc4c7,.256},H}; -N l16n244[]={{sEc8,.285},{sgE,.171},H}; -N l16n245[]={{sDAc8,.427},{sgc5,.133},H}; -N l16n247[]={{sDca,1.167},{sOc5,.427},{sc2c0cb,.384},H}; -N l16n248[]={{sc8c0,.655},{sc4Ac4,.214},H}; -N l16n249[]={{sIc0cbc8,.342},{scac8Bc0,.342},H}; -N l16n251[]={{sc5c0g,.577},{sc0cbc0,.299},H}; -N l16n252[]={{sccc8,1.053},{sc4c1Dca,.456},H}; -N l16n253[]={{sc4Bg,1.153},H}; -N l16n254[]={{sc6c4,.399},{sc0O,.370},{scac8c0,.342},H}; -N l16n255[]={{sAc7c8,.299},{sGc5,.171},H}; - -D l16_d = -{ +S scac8[] = { 202, 200, 0 }; +S sc3c0[] = { 195, 192, 0 }; +S sc8B[] = { 200, 209, 0 }; +S sc0cc[] = { 192, 204, 0 }; +S sc4c1[] = { 196, 193, 0 }; +S sBc0[] = { 209, 192, 0 }; +S scbc0[] = { 203, 192, 0 }; +S scac8g[] = { 202, 200, a }; +S sc2c0[] = { 194, 192, 0 }; +S sAc8[] = { 208, 200, 0 }; +S sc8Bg[] = { 200, 209, a }; +S sDca[] = { 211, 202, 0 }; +S sc4ca[] = { 196, 202, 0 }; +S sc0c5[] = { 192, 197, 0 }; +S sgc3c0[] = { 32, 195, 192, 0 }; +S sc3c0g[] = { 195, 192, a }; +S sc5c0[] = { 197, 192, 0 }; +S sc4A[] = { 196, 208, 0 }; +S sc0cb[] = { 192, 203, 0 }; +S sc5c4[] = { 197, 196, 0 }; +S sccc8[] = { 204, 200, 0 }; +S sAc0[] = { 208, 192, 0 }; +S sc8ca[] = { 200, 202, 0 }; +S sc0ca[] = { 192, 202, 0 }; +S sc5c8[] = { 197, 200, 0 }; +S sc0c3[] = { 192, 195, 0 }; +S sc1c0[] = { 193, 192, 0 }; +S sAcd[] = { 208, 205, 0 }; +S sgc2c0[] = { 32, 194, 192, 0 }; +S sc4cc[] = { 196, 204, 0 }; +S sc1c8[] = { 193, 200, 0 }; +S sc0B[] = { 192, 209, 0 }; +S sc8c7[] = { 200, 199, 0 }; +S sc4B[] = { 196, 209, 0 }; +S scdc1[] = { 205, 193, 0 }; +S sc7c0[] = { 199, 192, 0 }; +S sc3c4[] = { 195, 196, 0 }; +S sIc8[] = { 216, 200, 0 }; +S sgBc0[] = { 32, 209, 192, 0 }; +S scacd[] = { 202, 205, 0 }; +S sgcbc0[] = { 32, 203, 192, 0 }; +S scbcd[] = { 203, 205, 0 }; +S sDcac8[] = { 211, 202, 200, 0 }; +S sc8c0[] = { 200, 192, 0 }; +S scbc4[] = { 203, 196, 0 }; +S sc4cac8[] = { 196, 202, 200, 0 }; +S sOc4[] = { 222, 196, 0 }; +S sc8cc[] = { 200, 204, 0 }; +S sc4c1c8[] = { 196, 193, 200, 0 }; +S sc8cac8[] = { 200, 202, 200, 0 }; +S scdA[] = { 205, 208, 0 }; +S sccc4[] = { 204, 196, 0 }; +S sc8Bc0[] = { 200, 209, 192, 0 }; +S sIc8g[] = { 216, 200, a }; +S sIc4[] = { 216, 196, 0 }; +S sAc4[] = { 208, 196, 0 }; +S sc1c0g[] = { 193, 192, a }; +S sc0ccg[] = { 192, 204, a }; +S sDcac8g[] = { 211, 202, 200, a }; +S scbc8[] = { 203, 200, 0 }; +S sAc8g[] = { 208, 200, a }; +S sOc0[] = { 222, 192, 0 }; +S sc0ccc8[] = { 192, 204, 200, 0 }; +S sgIc4[] = { 32, 216, 196, 0 }; +S sgc3c0g[] = { 32, 195, 192, a }; +S sc4Bg[] = { 196, 209, a }; +S sc4c1c0[] = { 196, 193, 192, 0 }; +S sccc3[] = { 204, 195, 0 }; +S sccc8g[] = { 204, 200, a }; +S sc4cb[] = { 196, 203, 0 }; +S sc8c0g[] = { 200, 192, a }; +S scac8B[] = { 202, 200, 209, 0 }; +S scac4[] = { 202, 196, 0 }; +S sc0c2[] = { 192, 194, 0 }; +S sccc0[] = { 204, 192, 0 }; +S sc7c8[] = { 199, 200, 0 }; +S scdB[] = { 205, 209, 0 }; +S sc7c5[] = { 199, 197, 0 }; +S sc0c3g[] = { 192, 195, a }; +S sOc5[] = { 222, 197, 0 }; +S scac0[] = { 202, 192, 0 }; +S sgcbc4[] = { 32, 203, 196, 0 }; +S sc6c4[] = { 198, 196, 0 }; +S scbD[] = { 203, 211, 0 }; +S sc8cac8g[] = { 200, 202, 200, a }; +S sgAcd[] = { 32, 208, 205, 0 }; +S sc4Ac7[] = { 196, 208, 199, 0 }; +S sc0cac8[] = { 192, 202, 200, 0 }; +S sc0Ac7[] = { 192, 208, 199, 0 }; +S sc7c8g[] = { 199, 200, a }; +S sc2c8[] = { 194, 200, 0 }; +S sc5c4ca[] = { 197, 196, 202, 0 }; +S sBc0g[] = { 209, 192, a }; +S scdcb[] = { 205, 203, 0 }; +S sBc4[] = { 209, 196, 0 }; +S sc0O[] = { 192, 222, 0 }; +S sFc0[] = { 213, 192, 0 }; +S scdc1c0[] = { 205, 193, 192, 0 }; +S sCc0[] = { 210, 192, 0 }; +S sc5c8B[] = { 197, 200, 209, 0 }; +S sc0Bg[] = { 192, 209, a }; +S sc9c0[] = { 201, 192, 0 }; +S sc0Ag[] = { 192, 208, a }; +S sc4c1c0g[] = { 196, 193, 192, a }; +S sc4c3[] = { 196, 195, 0 }; +S sEc4[] = { 212, 196, 0 }; +S sc3c8[] = { 195, 200, 0 }; +S sBc8[] = { 209, 200, 0 }; +S sgc4A[] = { 32, 196, 208, 0 }; +S sc2c0cc[] = { 194, 192, 204, 0 }; +S sc4c5[] = { 196, 197, 0 }; +S sAc4c1[] = { 208, 196, 193, 0 }; +S sc0c0[] = { 192, 192, 0 }; +S sc0I[] = { 192, 216, 0 }; +S sc8c3[] = { 200, 195, 0 }; +S sc4cac8g[] = { 196, 202, 200, a }; +S sc8c7g[] = { 200, 199, a }; +S sgc0Ag[] = { 32, 192, 208, a }; +S sc4ccg[] = { 196, 204, a }; +S sgc4Ac7[] = { 32, 196, 208, 199, 0 }; +S sc0Ac0[] = { 192, 208, 192, 0 }; +S sc7D[] = { 199, 211, 0 }; +S sc5ca[] = { 197, 202, 0 }; +S sgcbcd[] = { 32, 203, 205, 0 }; +S sc1c4[] = { 193, 196, 0 }; +S sc2cd[] = { 194, 205, 0 }; +S sgc8B[] = { 32, 200, 209, 0 }; +S scbc0A[] = { 203, 192, 208, 0 }; +S sIc0[] = { 216, 192, 0 }; +S sEc8[] = { 212, 200, 0 }; +S sc5c0ca[] = { 197, 192, 202, 0 }; +S sc0F[] = { 192, 213, 0 }; +S sc0c8[] = { 192, 200, 0 }; +S sc0ccc8g[] = { 192, 204, 200, a }; +S sccc4c1[] = { 204, 196, 193, 0 }; +S scaB[] = { 202, 209, 0 }; +S sgc0cb[] = { 32, 192, 203, 0 }; +S sgc4B[] = { 32, 196, 209, 0 }; +S scdca[] = { 205, 202, 0 }; +S scaBg[] = { 202, 209, a }; +S sc4ccc8[] = { 196, 204, 200, 0 }; +S sgOc0[] = { 32, 222, 192, 0 }; +S sc8Bc0g[] = { 200, 209, 192, a }; +S sc0c6[] = { 192, 198, 0 }; +S sc4E[] = { 196, 212, 0 }; +S sc8c2[] = { 200, 194, 0 }; +S sDAc8[] = { 211, 208, 200, 0 }; +S sc7F[] = { 199, 213, 0 }; +S sAc0g[] = { 208, 192, a }; +S sgc0Ac0[] = { 32, 192, 208, 192, 0 }; +S sgBO[] = { 32, 209, 222, 0 }; +S sc1D[] = { 193, 211, 0 }; +S sc4c7[] = { 196, 199, 0 }; +S sc7c0g[] = { 199, 192, a }; +S sc5c3[] = { 197, 195, 0 }; +S sc9c8[] = { 201, 200, 0 }; +S sc0Ac8[] = { 192, 208, 200, 0 }; +S sc0c3c0[] = { 192, 195, 192, 0 }; +S sc2c0ccg[] = { 194, 192, 204, a }; +S sCc8[] = { 210, 200, 0 }; +S sc0C[] = { 192, 210, 0 }; +S sc0K[] = { 192, 218, 0 }; +S sc0c2c0[] = { 192, 194, 192, 0 }; +S sc4Ec4[] = { 196, 212, 196, 0 }; +S sc2c0cb[] = { 194, 192, 203, 0 }; +S sCc4[] = { 210, 196, 0 }; +S sgc2c0cb[] = { 32, 194, 192, 203, 0 }; +S sc5c0g[] = { 197, 192, a }; +S sAc3[] = { 208, 195, 0 }; +S sc0cbcd[] = { 192, 203, 205, 0 }; +S sc8K[] = { 200, 218, 0 }; +S sHc5[] = { 215, 197, 0 }; +S sc1c8B[] = { 193, 200, 209, 0 }; +S sccc3c0[] = { 204, 195, 192, 0 }; +S sc0G[] = { 192, 214, 0 }; +S sccc3c0g[] = { 204, 195, 192, a }; +S sc0cbc8[] = { 192, 203, 200, 0 }; +S sgIc0[] = { 32, 216, 192, 0 }; +S sc0c5c0[] = { 192, 197, 192, 0 }; +S scbDca[] = { 203, 211, 202, 0 }; +S sc4c1Dca[] = { 196, 193, 211, 202, 0 }; +S sOc0ca[] = { 222, 192, 202, 0 }; +S sc0E[] = { 192, 212, 0 }; +S sc7c0c5[] = { 199, 192, 197, 0 }; +S sFc0A[] = { 213, 192, 208, 0 }; +S sc4c1D[] = { 196, 193, 211, 0 }; +S sc0c5c8[] = { 192, 197, 200, 0 }; +S scbc4Ec4[] = { 203, 196, 212, 196, 0 }; +S scac8c0[] = { 202, 200, 192, 0 }; +S sc2A[] = { 194, 208, 0 }; +S scbc4E[] = { 203, 196, 212, 0 }; +S sBOc5[] = { 209, 222, 197, 0 }; +S sc6c4g[] = { 198, 196, a }; +S sc5B[] = { 197, 209, 0 }; +S scac8Bg[] = { 202, 200, 209, a }; +S scacdg[] = { 202, 205, a }; +S sc3A[] = { 195, 208, 0 }; +S scccd[] = { 204, 205, 0 }; +S sCcd[] = { 210, 205, 0 }; +S sFc0Ac7[] = { 213, 192, 208, 199, 0 }; +S sc1Dca[] = { 193, 211, 202, 0 }; +S sBc0O[] = { 209, 192, 222, 0 }; +S sgc7c5[] = { 32, 199, 197, 0 }; +S sc8D[] = { 200, 211, 0 }; +S sc3c2[] = { 195, 194, 0 }; +S sc0c1[] = { 192, 193, 0 }; +S sc8c5[] = { 200, 197, 0 }; +S sAc7c8[] = { 208, 199, 200, 0 }; +S sc0cbc0[] = { 192, 203, 192, 0 }; +S sc4c1c8B[] = { 196, 193, 200, 209, 0 }; +S scdcc[] = { 205, 204, 0 }; +S sgcbc4E[] = { 32, 203, 196, 212, 0 }; +S sBC[] = { 209, 210, 0 }; +S sc5c8c7[] = { 197, 200, 199, 0 }; +S scbc0cc[] = { 203, 192, 204, 0 }; +S sc0Ic8[] = { 192, 216, 200, 0 }; +S sc5c4cac8[] = { 197, 196, 202, 200, 0 }; +S scdBg[] = { 205, 209, a }; +S scbc0g[] = { 203, 192, a }; +S sDcc[] = { 211, 204, 0 }; +S sc8c9[] = { 200, 201, 0 }; +S sc5c8Bg[] = { 197, 200, 209, a }; +S sHcd[] = { 215, 205, 0 }; +S sMc4[] = { 220, 196, 0 }; +S sAc7c8g[] = { 208, 199, 200, a }; +S scac8c0g[] = { 202, 200, 192, a }; +S sgc4Bg[] = { 32, 196, 209, a }; +S sOc4ca[] = { 222, 196, 202, 0 }; +S sgBc0O[] = { 32, 209, 192, 222, 0 }; +S scbc8ca[] = { 203, 200, 202, 0 }; +S scdcacd[] = { 205, 202, 205, 0 }; +S sc2c0cbcd[] = { 194, 192, 203, 205, 0 }; +S sAc8B[] = { 208, 200, 209, 0 }; +S sc2c8g[] = { 194, 200, a }; +S scdc3[] = { 205, 195, 0 }; +S scdc1c0g[] = { 205, 193, 192, a }; +S sc8ccc3[] = { 200, 204, 195, 0 }; +S scec8[] = { 206, 200, 0 }; +S sc2c0c3[] = { 194, 192, 195, 0 }; +S sc4Ac7c8[] = { 196, 208, 199, 200, 0 }; +S sc4c1c8g[] = { 196, 193, 200, a }; +S scdc2[] = { 205, 194, 0 }; +S sc1c8g[] = { 193, 200, a }; +S sOcd[] = { 222, 205, 0 }; +S sJc4[] = { 217, 196, 0 }; +S sc0c5B[] = { 192, 197, 209, 0 }; +S scdc1c8[] = { 205, 193, 200, 0 }; +S sFA[] = { 213, 208, 0 }; +S sc7c5c0ca[] = { 199, 197, 192, 202, 0 }; +S sc0c5c8B[] = { 192, 197, 200, 209, 0 }; +S sCc8g[] = { 210, 200, a }; +S scac4c1[] = { 202, 196, 193, 0 }; +S scbc3[] = { 203, 195, 0 }; +S sc1Dcac8[] = { 193, 211, 202, 200, 0 }; +S sc0cac8g[] = { 192, 202, 200, a }; +S sc1c8c7[] = { 193, 200, 199, 0 }; +S sgFc0[] = { 32, 213, 192, 0 }; +S sc4ccc8g[] = { 196, 204, 200, a }; +S sc0Oc4[] = { 192, 222, 196, 0 }; +S sMc8[] = { 220, 200, 0 }; +S sc0Bc0[] = { 192, 209, 192, 0 }; +S sKOc4[] = { 218, 222, 196, 0 }; +S sc1c8Bg[] = { 193, 200, 209, a }; +S sc7Dca[] = { 199, 211, 202, 0 }; +S sc5c0cc[] = { 197, 192, 204, 0 }; +S sc0caO[] = { 192, 202, 222, 0 }; +S sAc0c5[] = { 208, 192, 197, 0 }; +S sIc0cbc8[] = { 216, 192, 203, 200, 0 }; +S sc0cbc8ca[] = { 192, 203, 200, 202, 0 }; +S sAc7D[] = { 208, 199, 211, 0 }; +S sc8C[] = { 200, 210, 0 }; +S sc6c8[] = { 198, 200, 0 }; +S sDcag[] = { 211, 202, a }; +S scdc4[] = { 205, 196, 0 }; +S sccc8ca[] = { 204, 200, 202, 0 }; +S sc1A[] = { 193, 208, 0 }; +S sAcdcb[] = { 208, 205, 203, 0 }; +S sGc5[] = { 214, 197, 0 }; +S sAcdc1[] = { 208, 205, 193, 0 }; +S sgcbc6[] = { 32, 203, 198, 0 }; +S sOc8[] = { 222, 200, 0 }; +S scdc5[] = { 205, 197, 0 }; +S sAc0c3[] = { 208, 192, 195, 0 }; +S sgc9c0[] = { 32, 201, 192, 0 }; +S sFc5[] = { 213, 197, 0 }; +S sc2c4[] = { 194, 196, 0 }; +S sEca[] = { 212, 202, 0 }; +S sc4D[] = { 196, 211, 0 }; +S sgAcdcb[] = { 32, 208, 205, 203, 0 }; +S sgc7c5c0[] = { 32, 199, 197, 192, 0 }; +S sBOc5c0[] = { 209, 222, 197, 192, 0 }; +S sgc8Bg[] = { 32, 200, 209, a }; +S sc0Ac7D[] = { 192, 208, 199, 211, 0 }; +S sc0Ic8g[] = { 192, 216, 200, a }; +S scdcbg[] = { 205, 203, a }; +S scbc6[] = { 203, 198, 0 }; +S scbc7[] = { 203, 199, 0 }; +S sDAc8g[] = { 211, 208, 200, a }; +S sIc0cb[] = { 216, 192, 203, 0 }; +S sc5c4c1[] = { 197, 196, 193, 0 }; +S sAcb[] = { 208, 203, 0 }; +S sc3Acd[] = { 195, 208, 205, 0 }; +S sc2c0c3c0[] = { 194, 192, 195, 192, 0 }; +S sc5c0A[] = { 197, 192, 208, 0 }; +S sc5c3c4[] = { 197, 195, 196, 0 }; +S sAc7Dca[] = { 208, 199, 211, 202, 0 }; +S scacdc1[] = { 202, 205, 193, 0 }; +S scac8Bc0[] = { 202, 200, 209, 192, 0 }; +S sc5c4cc[] = { 197, 196, 204, 0 }; +S sc0c2c0cc[] = { 192, 194, 192, 204, 0 }; +S scaO[] = { 202, 222, 0 }; +S sc5Bg[] = { 197, 209, a }; +S sgIc0cb[] = { 32, 216, 192, 203, 0 }; +S sc8c7c0[] = { 200, 199, 192, 0 }; +S sc7c5c0[] = { 199, 197, 192, 0 }; +S sAc3c0[] = { 208, 195, 192, 0 }; +S sgAc8[] = { 32, 208, 200, 0 }; +S sOc5c0[] = { 222, 197, 192, 0 }; +S sc4cac8B[] = { 196, 202, 200, 209, 0 }; +S sgBOc5[] = { 32, 209, 222, 197, 0 }; +S sc1c0B[] = { 193, 192, 209, 0 }; +S sc4Ac4[] = { 196, 208, 196, 0 }; +S sc3c2c0[] = { 195, 194, 192, 0 }; +S sc7c4[] = { 199, 196, 0 }; +S sHc5c0[] = { 215, 197, 192, 0 }; +S sc8c2c8[] = { 200, 194, 200, 0 }; +S sCc0cc[] = { 210, 192, 204, 0 }; +S sgCc0[] = { 32, 210, 192, 0 }; +S sCD[] = { 210, 211, 0 }; +S sc3cd[] = { 195, 205, 0 }; +S sc0Ac0g[] = { 192, 208, 192, a }; +S sAc8ca[] = { 208, 200, 202, 0 }; +S sc0c5Bg[] = { 192, 197, 209, a }; +S sc3c0B[] = { 195, 192, 209, 0 }; +S sgOc0ca[] = { 32, 222, 192, 202, 0 }; +S sc8FA[] = { 200, 213, 208, 0 }; +S sAcdB[] = { 208, 205, 209, 0 }; +S sOc0caO[] = { 222, 192, 202, 222, 0 }; +S sOc5c8[] = { 222, 197, 200, 0 }; +S sccC[] = { 204, 210, 0 }; +S sOcdcacd[] = { 222, 205, 202, 205, 0 }; +S sc8c3c4[] = { 200, 195, 196, 0 }; +S sc4caB[] = { 196, 202, 209, 0 }; +S sccc4c1c8[] = { 204, 196, 193, 200, 0 }; +S sgc7Dg[] = { 32, 199, 211, a }; +S sccc8cac8[] = { 204, 200, 202, 200, 0 }; +S sgc2c0c3[] = { 32, 194, 192, 195, 0 }; +S sgcbc0c2[] = { 32, 203, 192, 194, 0 }; +S sgAc0[] = { 32, 208, 192, 0 }; +S sc4C[] = { 196, 210, 0 }; +S sDAc0[] = { 211, 208, 192, 0 }; + +N l16n0[] = { { sc0c0, .313 }, H }; +N l16n1[] = { { sgBc0, .683 }, { scbc4Ec4, .456 }, H }; +N l16n2[] = { { sgc2c0, .854 }, { sc2c0cc, .512 }, { sc1c8Bg, .512 }, { sccc8cac8, .285 }, H }; +N l16n3[] = { { sccc4c1, .427 }, H }; +N l16n5[] = { { sgF, .133 }, H }; +N l16n6[] = { { sgc6, .133 }, H }; +N l16n7[] = { { sc1c8g, .448 }, H }; +N l16n8[] = { { sc8A, .370 }, H }; +N l16n11[] = { { sCcd, .228 }, H }; +N l16n12[] = { { scdcacd, .299 }, H }; +N l16n13[] = { { sBO, .399 }, H }; +N l16n15[] = { { sBc0, 1.651 }, H }; +N l16n16[] = { { sc0A, 2.022 }, { sc1Dca, .342 }, H }; +N l16n17[] = { { sc0c1, .199 }, H }; +N l16n18[] = { { sAc2, .199 }, { sgCc0, .142 }, H }; +N l16n19[] = { { sgc3c0, 1.139 }, { scacd, .683 }, H }; +N l16n20[] = { { scdBg, .448 }, H }; +N l16n22[] = { { sCc8g, .384 }, { sEca, .171 }, { sc0Ac7D, .342 }, H }; +N l16n23[] = { { sgc7, .475 }, { sc9c0, .342 }, H }; +N l16n24[] = { { sAcdc1, .256 }, H }; +N l16n25[] = { { sc8B, 2.249 }, { sc4Ac7, .598 }, { scac8Bg, .683 }, { scbc0cc, .299 }, { sDcc, .199 }, H }; +N l16n26[] = { { sc8c2, .285 }, { sc1c0B, .214 }, H }; +N l16n27[] = { { sc2cd, .313 }, H }; +N l16n28[] = { { sc7D, .313 }, { sc5Bg, .384 }, H }; +N l16n29[] = { { sc7c4, .142 }, H }; +N l16n30[] = { { scac8g, 3.331 }, { sc5c8B, .512 }, { sc4cac8g, .940 }, { sHc5, .256 }, H }; +N l16n31[] = { { sc1c0, .911 }, H }; +N l16n33[] = { { sc0B, .826 }, { sc4caB, .214 }, H }; +N l16n34[] = { { sc0c2, .456 }, H }; +N l16n35[] = { { sc5c8, .968 }, { sgc8B, .313 }, { sAc3, .256 }, H }; +N l16n36[] = { { sKO, .342 }, H }; +N l16n37[] = { { sc4c1c8, .897 }, { sc8ccc3, .299 }, H }; +N l16n38[] = { { sc4ca, 1.167 }, { sc2c8g, .448 }, { sAc8ca, .214 }, H }; +N l16n40[] = { { sgc8, .683 }, H }; +N l16n41[] = { { sgc4Ac7, .418 }, H }; +N l16n42[] = { { sgcbcd, .313 }, { sc8C, .171 }, { sOc8, .171 }, { sc5c4c1, .256 }, H }; +N l16n43[] = { { sc8c3, .313 }, H }; +N l16n44[] = { { sIc4, .541 }, { sc0ccg, 1.217 }, H }; +N l16n45[] = { { sc4c1c0g, 1.025 }, H }; +N l16n46[] = { { sc7c5, .427 }, { sCc0, .342 }, H }; +N l16n47[] = { { sc1A, .171 }, H }; +N l16n48[] = { { sc0Ic8, .299 }, H }; +N l16n49[] = { { sc4cac8B, .342 }, H }; +N l16n50[] = { { scbcd, .683 }, { sc0C, .256 }, H }; +N l16n51[] = { { sc0c3, .911 }, H }; +N l16n52[] = { { sAc4, .541 }, { sc1c8c7, .256 }, { sc0caO, .256 }, { scaO, .171 }, H }; +N l16n54[] = { { scac0, .427 }, H }; +N l16n55[] = { { sc4cb, .484 }, { sOc5c0, .256 }, H }; +N l16n56[] = { { sgI, .626 }, H }; +N l16n57[] = { { sc7g, .811 }, { sgc9, .304 }, { sc7c0g, .577 }, H }; +N l16n58[] = { { sc8cac8, .897 }, { scec8, .199 }, { sc5c3c4, .256 }, { sc3cd, .142 }, H }; +N l16n59[] = { { sc8D, .199 }, H }; +N l16n60[] = { { sc4Ec4, .384 }, { scdc1c8, .256 }, { sc3Acd, .256 }, { sgOc0ca, .190 }, H }; +N l16n61[] = { { scdca, .285 }, H }; +N l16n62[] = { { sc2c0, 1.452 }, { sc7F, .285 }, H }; +N l16n63[] = { { sgc4Bg, .266 }, H }; +N l16n64[] = { { sc4ccc8g, .512 }, H }; +N l16n65[] = { { sBC, .199 }, H }; +N l16n66[] = { { sc0cac8, .555 }, { sc6c8, .171 }, H }; +N l16n67[] = { { sgcbc4E, .266 }, H }; +N l16n68[] = { { scdc1c0g, .598 }, H }; +N l16n69[] = { { sc5ca, .313 }, { scbc0A, .470 }, { sgFc0, .171 }, H }; +N l16n70[] = { { scbDca, .342 }, H }; +N l16n71[] = { { sccc3c0g, .769 }, H }; +N l16n72[] = { { sc4cc, .826 }, { sgAc8, .171 }, H }; +N l16n73[] = { { sc5c0ca, .427 }, { sgJ, .133 }, H }; +N l16n75[] = { { sgBO, .256 }, { sJc4, .171 }, { sgc2c0c3, .190 }, H }; +N l16n77[] = { { sc8c5, .199 }, { sc8FA, .214 }, H }; +N l16n78[] = { { scdcb, .370 }, { sc2A, .228 }, H }; +N l16n80[] = { { sAg, .726 }, { sc0Ac0, .470 }, { sAc0g, .641 }, { sOc0ca, .342 }, { sc7c0c5, .342 }, { sc0c5B, .256 }, H }; +N l16n81[] = { { scccd, .228 }, { sAc0c3, .256 }, H }; +N l16n83[] = { { sBc4, .370 }, { sc0cbc8, .342 }, H }; +N l16n84[] = { { sc0E, .228 }, H }; +N l16n85[] = { { scbc0, 1.509 }, { sc0c5, 1.139 }, { sDAc8g, .512 }, H }; +N l16n87[] = { { scaB, .285 }, { sDcag, .384 }, H }; +N l16n88[] = { { sc8g, 6.620 }, { sc8c0g, 1.089 }, { sc3c0B, .214 }, H }; +N l16n89[] = { { sc8Bc0, .854 }, { sgc0cb, .285 }, H }; +N l16n90[] = { { sgK, .266 }, H }; +N l16n91[] = { { sgcb, 1.519 }, { sccc4c1c8, .285 }, H }; +N l16n92[] = { { sccc8g, 1.089 }, H }; +N l16n93[] = { { sc3c0, 2.278 }, { sDA, .569 }, { sc8F, .285 }, H }; +N l16n94[] = { { sc6c4g, .512 }, { scac8c0g, .598 }, { sc2c0cbcd, .399 }, { scacdc1, .256 }, { sHc5c0, .214 }, H }; +N l16n95[] = { { scdcc, .199 }, { sAc7c8g, .598 }, { sc5c0cc, .256 }, H }; +N l16n96[] = { { sc0g, 6.107 }, { sc0c5c8B, .342 }, H }; +N l16n97[] = { { sc7c8, .456 }, { sc0Bc0, .256 }, H }; +N l16n98[] = { { sc1D, .256 }, { sc2c0ccg, .769 }, { sc0c2c0, .384 }, H }; +N l16n99[] = { { sc1c4, .313 }, { sgc2c0cb, .342 }, { sAc3c0, .256 }, H }; +N l16n100[] = { { sc0ccc8, .769 }, H }; +N l16n101[] = { { sc0F, .285 }, H }; +N l16n102[] = { { sc0c6, .285 }, H }; +N l16n103[] = { { sAc7, .769 }, { sAc0c5, .256 }, H }; +N l16n104[] = { { sc1Dcac8, .342 }, H }; +N l16n106[] = { { sc0Oc4, .256 }, H }; +N l16n108[] = { { sgcc, .209 }, H }; +N l16n109[] = { { sc3A, .228 }, H }; +N l16n110[] = { { sc7c5c0, .256 }, H }; +N l16n111[] = { { sBg, 4.869 }, { sc8c7, .826 }, { sBc0g, .833 }, H }; +N l16n112[] = { { sIc8, .712 }, { sc0Ag, .769 }, H }; +N l16n113[] = { { sc4Ac7c8, .399 }, { sCD, .142 }, H }; +N l16n114[] = { { sCc4, .256 }, H }; +N l16n115[] = { { sgc3c0g, .683 }, { sc0c3c0, .384 }, { scacdg, .512 }, { sAc8B, .299 }, H }; +N l16n116[] = { { sccc0, .456 }, H }; +N l16n118[] = { { sc0G, .256 }, H }; +N l16n120[] = { { sAc8, 1.395 }, { sgIc0, .228 }, { sAc7D, .256 }, H }; +N l16n121[] = { { sc8Bg, 2.691 }, { sgc9c0, .171 }, H }; +N l16n122[] = { { scac4, .456 }, H }; +N l16n123[] = { { sFc0A, .342 }, H }; +N l16n124[] = { { sgM, .285 }, H }; +N l16n126[] = { { sc5c8Bg, .598 }, H }; +N l16n127[] = { { sc1c0g, 1.217 }, { sgAcd, .399 }, { sAc4c1, .470 }, { sc3c2, .199 }, { sOcd, .199 }, H }; +N l16n129[] = { { sc0Bg, .769 }, H }; +N l16n130[] = { { sc2c4, .171 }, H }; +N l16n131[] = { { sgc8Bg, .228 }, H }; +N l16n132[] = { { sBOc5, .342 }, H }; +N l16n133[] = { { sc4c1c8g, .598 }, H }; +N l16n134[] = { { sKg, .641 }, { sAcdcb, .256 }, H }; +N l16n136[] = { { sc0c8, .285 }, { scbc3, .171 }, { sgc7Dg, .190 }, H }; +N l16n138[] = { { sc0cbcd, .384 }, H }; +N l16n139[] = { { sFc0, .342 }, { scbc8ca, .299 }, { sc5c0A, .256 }, H }; +N l16n140[] = { { sc4A, 1.082 }, H }; +N l16n141[] = { { sc4c1, 1.680 }, { sc5c4ca, .555 }, H }; +N l16n142[] = { { sgc7c5, .228 }, { sgce, .114 }, H }; +N l16n143[] = { { sDcac8, 1.025 }, { sOc5c8, .214 }, H }; +N l16n144[] = { { sgc0A, .655 }, { sKOc4, .256 }, { sc0Ic8g, .512 }, H }; +N l16n145[] = { { sc8c9, .199 }, H }; +N l16n147[] = { { sc0c3g, .961 }, H }; +N l16n148[] = { { sOc4ca, .299 }, { sOcdcacd, .285 }, H }; +N l16n149[] = { { sc0c5c0, .342 }, H }; +N l16n150[] = { { scag, .555 }, H }; +N l16n151[] = { { sBc8, .342 }, { sc8c3c4, .214 }, H }; +N l16n152[] = { { scbD, .399 }, { sc0I, .313 }, { sc4c1c8B, .399 }, H }; +N l16n153[] = { { scbc4, .626 }, { sBc0O, .342 }, H }; +N l16n154[] = { { sc8cac8g, 1.196 }, { sgBOc5, .228 }, H }; +N l16n155[] = { { sc5c0, 1.110 }, { sgcbc0, .683 }, { sgBc0O, .266 }, { sFA, .171 }, H }; +N l16n157[] = { { sc4B, .740 }, { sc0Ac7, .555 }, { sDAc0, .214 }, H }; +N l16n158[] = { { sgO, .418 }, { sc4c1D, .342 }, H }; +N l16n159[] = { { sc9c8, .256 }, { sc2c0c3, .299 }, H }; +N l16n160[] = { { sgc0, 1.063 }, H }; +N l16n161[] = { { sc3c4, .712 }, { sIc0cb, .256 }, H }; +N l16n162[] = { { sc8ca, .997 }, { sOc0, .512 }, { sc1c8B, .384 }, { sc0cac8g, .512 }, H }; +N l16n163[] = { { scdA, .598 }, { sc5c4cc, .256 }, H }; +N l16n164[] = { { scdc1, .740 }, { sgIc4, .512 }, H }; +N l16n166[] = { { sHcd, .199 }, { sccC, .142 }, H }; +N l16n167[] = { { sc1c8, .826 }, { sccc3, .484 }, H }; +N l16n168[] = { { sc4ccg, .705 }, { sc0Ac8, .384 }, { sMc4, .199 }, H }; +N l16n170[] = { { sc0ca, .997 }, { sAK, .228 }, { sccc8ca, .256 }, H }; +N l16n171[] = { { sAcb, .171 }, H }; +N l16n173[] = { { sDg, .427 }, H }; +N l16n174[] = { { scdcbg, .384 }, { sc4C, .142 }, H }; +N l16n175[] = { { sc4c3, .342 }, { sc8c7c0, .256 }, H }; +N l16n176[] = { { sgA, .569 }, { sEc4, .342 }, { sc5c8c7, .299 }, { sc0Ac0g, .427 }, { sc0c5Bg, .427 }, H }; +N l16n177[] = { { sgc1, .361 }, { sc0cbc8ca, .342 }, H }; +N l16n178[] = { { sc8K, .256 }, { sc8c2c8, .214 }, H }; +N l16n179[] = { { sc8cb, .142 }, H }; +N l16n180[] = { { scdB, .456 }, H }; +N l16n181[] = { { scbg, .555 }, { scbc4E, .342 }, { scbc0g, .448 }, { scdc2, .199 }, H }; +N l16n182[] = { { sCc8, .256 }, H }; +N l16n183[] = { { scaBg, .641 }, H }; +N l16n184[] = { { sccc4, .598 }, H }; +N l16n185[] = { { scac8B, .726 }, { sc8Bc0g, .854 }, H }; +N l16n186[] = { { sc0K, .256 }, H }; +N l16n187[] = { { sc0cb, 1.082 }, { scbc6, .171 }, H }; +N l16n188[] = { { sc5B, .228 }, H }; +N l16n189[] = { { sc3c0g, 2.498 }, { sc3g, .897 }, H }; +N l16n190[] = { { scac8, 2.676 }, { sc4cac8, .940 }, H }; +N l16n191[] = { { sc4D, .171 }, { sc3c2c0, .214 }, H }; +N l16n193[] = { { sgB, .892 }, { sc7c8g, .833 }, H }; +N l16n194[] = { { sgc2, .911 }, H }; +N l16n195[] = { { sOB, .142 }, H }; +N l16n196[] = { { sc8cc, .598 }, { sc0ccc8g, .854 }, { sBOc5c0, .342 }, H }; +N l16n197[] = { { scac4c1, .256 }, H }; +N l16n198[] = { { sc2c8, .370 }, { scdc3, .199 }, { sc0c2c0cc, .342 }, H }; +N l16n199[] = { { sgcbc4, .399 }, H }; +N l16n200[] = { { sAcdB, .214 }, H }; +N l16n202[] = { { sc7Dca, .256 }, H }; +N l16n204[] = { { sc0cc, 1.708 }, { sc7c5c0ca, .342 }, { scbc7, .171 }, H }; +N l16n205[] = { { sAcd, .911 }, { sc4c1c0, .726 }, H }; +N l16n206[] = { { sc5c3, .256 }, { sgc7c5c0, .228 }, H }; +N l16n207[] = { { sc8c7g, .705 }, H }; +N l16n208[] = { { sIc8g, 1.281 }, { sc4E, .285 }, { sgc0Ac0, .342 }, { sFc0Ac7, .456 }, H }; +N l16n209[] = { { sc4c5, .313 }, H }; +N l16n210[] = { { sgC, .152 }, H }; +N l16n211[] = { { sgc3, .968 }, H }; +N l16n212[] = { { sccg, 1.409 }, { sgc4A, .342 }, H }; +N l16n214[] = { { sAc7Dca, .342 }, H }; +N l16n215[] = { { scdc4, .171 }, H }; +N l16n216[] = { { sAc8g, 1.153 }, H }; +N l16n217[] = { { sc7c0, .740 }, { sgIc0cb, .228 }, H }; +N l16n220[] = { { sc4g, 1.068 }, H }; +N l16n221[] = { { scbc8, .541 }, { sgcbc6, .171 }, H }; +N l16n222[] = { { sgOc0, .285 }, H }; +N l16n223[] = { { sc5c4, 1.082 }, { sgc4B, .285 }, { sc2c0c3c0, .342 }, H }; +N l16n224[] = { { sc4ccc8, .427 }, { sFc5, .171 }, { sgAcdcb, .228 }, H }; +N l16n225[] = { { sgcbc0c2, .190 }, H }; +N l16n227[] = { { sgD, .304 }, H }; +N l16n228[] = { { sgc4, .531 }, { scdc1c0, .512 }, H }; +N l16n229[] = { { sc3c8, .342 }, { sc5c4cac8, .399 }, H }; +N l16n230[] = { { sOc4, .626 }, H }; +N l16n231[] = { { sccc3c0, .384 }, H }; +N l16n232[] = { { sIc0, .313 }, { scdc5, .171 }, H }; +N l16n234[] = { { sOc0caO, .285 }, H }; +N l16n236[] = { { sMc8, .171 }, H }; +N l16n237[] = { { sc0c5c8, .342 }, H }; +N l16n239[] = { { sDcac8g, 1.623 }, H }; +N l16n240[] = { { sAc0, 1.025 }, { sgc0Ag, .418 }, { sgAc0, .142 }, H }; +N l16n242[] = { { sCc0cc, .214 }, H }; +N l16n243[] = { { scdg, 1.025 }, { sc4c7, .256 }, H }; +N l16n244[] = { { sEc8, .285 }, { sgE, .171 }, H }; +N l16n245[] = { { sDAc8, .427 }, { sgc5, .133 }, H }; +N l16n247[] = { { sDca, 1.167 }, { sOc5, .427 }, { sc2c0cb, .384 }, H }; +N l16n248[] = { { sc8c0, .655 }, { sc4Ac4, .214 }, H }; +N l16n249[] = { { sIc0cbc8, .342 }, { scac8Bc0, .342 }, H }; +N l16n251[] = { { sc5c0g, .577 }, { sc0cbc0, .299 }, H }; +N l16n252[] = { { sccc8, 1.053 }, { sc4c1Dca, .456 }, H }; +N l16n253[] = { { sc4Bg, 1.153 }, H }; +N l16n254[] = { { sc6c4, .399 }, { sc0O, .370 }, { scac8c0, .342 }, H }; +N l16n255[] = { { sAc7c8, .299 }, { sGc5, .171 }, H }; + +D l16_d = { "georgian", "unknown", - { - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,0.003,W,W,W,W,W,W, - W,W,W,W,W,W,0.001,W,W,W,W,W,W,W,W,W, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - 0.456,0.131,0.123,0.195,0.370,0.179,0.040,0.134,0.523,0.046,0.230,0.221,0.181,0.199,0.015,0.002, - 0.279,0.279,0.060,0.131,0.040,0.051,0.023,0.026,0.080,0.017,0.058,0.021,0.034,0.006,0.103,0.009, - 0.005,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V, - V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V - }, - { - l16n0,l16n1,l16n2,l16n3,X,l16n5,l16n6,l16n7,l16n8,X,X,l16n11,l16n12,l16n13,X,l16n15, - l16n16,l16n17,l16n18,l16n19,l16n20,X,l16n22,l16n23,l16n24,l16n25,l16n26,l16n27,l16n28,l16n29,l16n30,l16n31, - X,l16n33,l16n34,l16n35,l16n36,l16n37,l16n38,X,l16n40,l16n41,l16n42,l16n43,l16n44,l16n45,l16n46,l16n47, - l16n48,l16n49,l16n50,l16n51,l16n52,X,l16n54,l16n55,l16n56,l16n57,l16n58,l16n59,l16n60,l16n61,l16n62,l16n63, - l16n64,l16n65,l16n66,l16n67,l16n68,l16n69,l16n70,l16n71,l16n72,l16n73,X,l16n75,X,l16n77,l16n78,X, - l16n80,l16n81,X,l16n83,l16n84,l16n85,X,l16n87,l16n88,l16n89,l16n90,l16n91,l16n92,l16n93,l16n94,l16n95, - l16n96,l16n97,l16n98,l16n99,l16n100,l16n101,l16n102,l16n103,l16n104,X,l16n106,X,l16n108,l16n109,l16n110,l16n111, - l16n112,l16n113,l16n114,l16n115,l16n116,X,l16n118,X,l16n120,l16n121,l16n122,l16n123,l16n124,X,l16n126,l16n127, - X,l16n129,l16n130,l16n131,l16n132,l16n133,l16n134,X,l16n136,X,l16n138,l16n139,l16n140,l16n141,l16n142,l16n143, - l16n144,l16n145,X,l16n147,l16n148,l16n149,l16n150,l16n151,l16n152,l16n153,l16n154,l16n155,X,l16n157,l16n158,l16n159, - l16n160,l16n161,l16n162,l16n163,l16n164,X,l16n166,l16n167,l16n168,X,l16n170,l16n171,X,l16n173,l16n174,l16n175, - l16n176,l16n177,l16n178,l16n179,l16n180,l16n181,l16n182,l16n183,l16n184,l16n185,l16n186,l16n187,l16n188,l16n189,l16n190,l16n191, - X,l16n193,l16n194,l16n195,l16n196,l16n197,l16n198,l16n199,l16n200,X,l16n202,X,l16n204,l16n205,l16n206,l16n207, - l16n208,l16n209,l16n210,l16n211,l16n212,X,l16n214,l16n215,l16n216,l16n217,X,X,l16n220,l16n221,l16n222,l16n223, - l16n224,l16n225,X,l16n227,l16n228,l16n229,l16n230,l16n231,l16n232,X,l16n234,X,l16n236,l16n237,X,l16n239, - l16n240,X,l16n242,l16n243,l16n244,l16n245,X,l16n247,l16n248,l16n249,X,l16n251,l16n252,l16n253,l16n254,l16n255 - } + { W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, 0.003, W, W, W, W, W, W, + W, W, W, W, W, W, 0.001, W, W, W, W, W, W, W, W, W, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + 0.456, 0.131, 0.123, 0.195, 0.370, 0.179, 0.040, 0.134, 0.523, 0.046, 0.230, 0.221, 0.181, 0.199, 0.015, 0.002, + 0.279, 0.279, 0.060, 0.131, 0.040, 0.051, 0.023, 0.026, 0.080, 0.017, 0.058, 0.021, 0.034, 0.006, 0.103, 0.009, + 0.005, V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, + V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, V }, + { l16n0, l16n1, l16n2, l16n3, X, l16n5, l16n6, l16n7, l16n8, X, X, l16n11, l16n12, l16n13, X, l16n15, + l16n16, l16n17, l16n18, l16n19, l16n20, X, l16n22, l16n23, l16n24, l16n25, l16n26, l16n27, l16n28, l16n29, l16n30, l16n31, + X, l16n33, l16n34, l16n35, l16n36, l16n37, l16n38, X, l16n40, l16n41, l16n42, l16n43, l16n44, l16n45, l16n46, l16n47, + l16n48, l16n49, l16n50, l16n51, l16n52, X, l16n54, l16n55, l16n56, l16n57, l16n58, l16n59, l16n60, l16n61, l16n62, l16n63, + l16n64, l16n65, l16n66, l16n67, l16n68, l16n69, l16n70, l16n71, l16n72, l16n73, X, l16n75, X, l16n77, l16n78, X, + l16n80, l16n81, X, l16n83, l16n84, l16n85, X, l16n87, l16n88, l16n89, l16n90, l16n91, l16n92, l16n93, l16n94, l16n95, + l16n96, l16n97, l16n98, l16n99, l16n100, l16n101, l16n102, l16n103, l16n104, X, l16n106, X, l16n108, l16n109, l16n110, l16n111, + l16n112, l16n113, l16n114, l16n115, l16n116, X, l16n118, X, l16n120, l16n121, l16n122, l16n123, l16n124, X, l16n126, l16n127, + X, l16n129, l16n130, l16n131, l16n132, l16n133, l16n134, X, l16n136, X, l16n138, l16n139, l16n140, l16n141, l16n142, l16n143, + l16n144, l16n145, X, l16n147, l16n148, l16n149, l16n150, l16n151, l16n152, l16n153, l16n154, l16n155, X, l16n157, l16n158, l16n159, + l16n160, l16n161, l16n162, l16n163, l16n164, X, l16n166, l16n167, l16n168, X, l16n170, l16n171, X, l16n173, l16n174, l16n175, + l16n176, l16n177, l16n178, l16n179, l16n180, l16n181, l16n182, l16n183, l16n184, l16n185, l16n186, l16n187, l16n188, l16n189, l16n190, l16n191, + X, l16n193, l16n194, l16n195, l16n196, l16n197, l16n198, l16n199, l16n200, X, l16n202, X, l16n204, l16n205, l16n206, l16n207, + l16n208, l16n209, l16n210, l16n211, l16n212, X, l16n214, l16n215, l16n216, l16n217, X, X, l16n220, l16n221, l16n222, l16n223, + l16n224, l16n225, X, l16n227, l16n228, l16n229, l16n230, l16n231, l16n232, X, l16n234, X, l16n236, l16n237, X, l16n239, + l16n240, X, l16n242, l16n243, l16n244, l16n245, X, l16n247, l16n248, l16n249, X, l16n251, l16n252, l16n253, l16n254, l16n255 } }; - - // // Lng: german // Enc: iso-8859-15 // - -S simr[]={e,i,n,0}; -S syrk[]={u,n,g,0}; -S sgimr[]={32,e,i,n,0}; -S sgim[]={32,e,i,0}; -S simri[]={e,i,n,e,0}; -S syrhg[]={u,n,d,a}; -S simx[]={e,i,t,0}; -S sXZl[]={97,99,h,0}; -S sgwZl[]={32,s,99,h,0}; -S sgwZ[]={32,s,99,0}; -S sfcv[]={252,r,0}; -S sg7ay[]={32,z,u,0}; -S sjfc[]={f,252,0}; -S sfcvg[]={252,r,a}; -S sXyj[]={97,u,f,0}; -S sgjfc[]={32,f,252,0}; -S sjfcv[]={f,252,r,0}; -S spmZl[]={l,i,99,h,0}; -S sjfcvg[]={f,252,r,a}; -S sgjfcv[]={32,f,252,r,0}; -S syj[]={u,f,0}; -S smwZ[]={i,s,99,0}; -S sYim[]={98,e,i,0}; -S syrkg[]={u,n,g,a}; -S smwZl[]={i,s,99,h,0}; -S sXpw[]={97,l,s,0}; -S swmr[]={s,i,n,0}; -S sZlxg[]={99,h,t,a}; -S simrg[]={e,i,n,a}; -S syrkw[]={u,n,g,s,0}; -S syqg[]={u,m,a}; -S sghXw[]={32,d,97,s,0}; -S shXw[]={d,97,s,0}; -S slir[]={h,e,n,0}; -S srkw[]={n,g,s,0}; -S sXpwg[]={97,l,s,a}; -S slvi[]={h,r,e,0}; -S svZl[]={r,99,h,0}; -S syxi[]={u,t,e,0}; -S simxg[]={e,i,t,a}; -S sXyw[]={97,u,s,0}; -S svim[]={r,e,i,0}; -S slirg[]={h,e,n,a}; -S sZlir[]={99,h,e,n,0}; -S soim[]={k,e,i,0}; -S syxig[]={u,t,e,a}; -S sgXyj[]={32,97,u,f,0}; -S shXwg[]={d,97,s,a}; -S swmZl[]={s,i,99,h,0}; -S spiy[]={l,e,u,0}; -S svyr[]={r,u,n,0}; -S swmZ[]={s,i,99,0}; -S syvZ[]={u,r,99,0}; -S sxmk[]={t,i,g,0}; -S sxvX[]={t,r,97,0}; -S sqqi[]={m,m,e,0}; -S syvZl[]={u,r,99,h,0}; -S sgzsr[]={32,v,o,n,0}; -S szsr[]={v,o,n,0}; -S szsrg[]={v,o,n,a}; -S sqirg[]={m,e,n,a}; -S syZl[]={u,99,h,0}; -S smZlx[]={i,99,h,t,0}; -S sglXx[]={32,h,97,t,0}; -S svfc[]={r,252,0}; -S syrki[]={u,n,g,e,0}; -S sghyv[]={32,d,u,r,0}; -S sgmq[]={32,i,m,0}; -S shyv[]={d,u,r,0}; -S sgmqg[]={32,i,m,a}; -S sgml[]={32,i,h,0}; -S s7ayg[]={z,u,a}; -S sgYim[]={32,98,e,i,0}; -S shyvZ[]={d,u,r,99,0}; -S svxg[]={r,t,a}; -S sgXpw[]={32,97,l,s,0}; -S siyxi[]={e,u,t,e,0}; -S sgpiy[]={32,l,e,u,0}; -S siyx[]={e,u,t,0}; -S soimx[]={k,e,i,t,0}; -S sgivw[]={32,e,r,s,0}; -S sywg[]={u,s,a}; -S sipx[]={e,l,t,0}; -S sXyZl[]={97,u,99,h,0}; -S sgwt[]={32,s,p,0}; -S sgwmZ[]={32,s,i,99,0}; -S smrhg[]={i,n,d,a}; -S spxi[]={l,t,e,0}; -S sZl_[]={99,h,w,0}; -S shsv[]={d,o,r,0}; -S swim[]={s,e,i,0}; -S sXyjg[]={97,u,f,a}; -S swmrh[]={s,i,n,d,0}; -S swZl_[]={s,99,h,w,0}; -S sXP[]={97,223,0}; -S sivwx[]={e,r,s,t,0}; -S sXyZ[]={97,u,99,0}; -S srxiv[]={n,t,e,r,0}; -S sgXyw[]={32,97,u,s,0}; -S smZli[]={i,99,h,e,0}; -S sl_[]={h,w,0}; -S smqq[]={i,m,m,0}; -S s_im[]={w,e,i,0}; -S spiyx[]={l,e,u,t,0}; -S srkig[]={n,g,e,a}; -S sqqir[]={m,m,e,n,0}; -S swZli[]={s,99,h,e,0}; -S sg7ayg[]={32,z,u,a}; -S syjg[]={u,f,a}; -S simg[]={e,i,a}; -S srivg[]={n,e,r,a}; - -N l17n0[]={{siy,.181},H}; -N l17n1[]={{sg7ay,.354},H}; -N l17n2[]={{sqirg,.254},{sZl_,.109},H}; -N l17n3[]={{ssv,.314},H}; -N l17n4[]={{s_iv,.109},H}; -N l17n5[]={{smr,.967},{sxm,.363},{slXx,.127},H}; -N l17n6[]={{srx,.314},{sgwm,.408},{svim,.145},H}; -N l17n7[]={{sri,.459},{sghm,.789},{slir,.163},{sxivg,.290},H}; -N l17n8[]={{sghXw,.326},{swo,.073},H}; -N l17n9[]={{slX,.181},H}; -N l17n11[]={{skv,.085},{sgXr,.163},{sipp,.109},H}; -N l17n12[]={{sgp,.272},H}; -N l17n13[]={{swg,.907},{sXr,.326},{spm,.266},{sgzi,.299},H}; -N l17n14[]={{sgki,.408},{sjx,.097},H}; -N l17n15[]={{sji,.181},H}; -N l17n17[]={{sqqir,.145},H}; -N l17n21[]={{shm,.459},{sog,.200},{ssh,.085},{syrki,.169},H}; -N l17n22[]={{sfcv,.354},{sjfc,.145},{sYim,.181},{sms,.085},H}; -N l17n23[]={{shivg,1.233},{spwg,.272},{sxxi,.127},H}; -N l17n24[]={{sgim,.653},{sZo,.133},H}; -N l17n26[]={{srkw,.163},{sivwx,.145},H}; -N l17n28[]={{svr,.145},{skw,.121},H}; -N l17n29[]={{simri,.411},{sgq,.272},H}; -N l17n30[]={{s_i,.218},{sg_i,.245},{smZlx,.169},H}; -N l17n31[]={{ssrg,.408},{skiw,.127},{spxi,.109},H}; -N l17n33[]={{sxig,.735},{srirg,.290},{sPg,.286},H}; -N l17n34[]={{smZlg,.326},{shiwg,.218},H}; -N l17n35[]={{sil,.157},H}; -N l17n36[]={{sivi,.163},{swxm,.145},H}; -N l17n37[]={{syrhg,.617},{swim,.109},H}; -N l17n39[]={{swmZ,.145},{swZli,.145},H}; -N l17n41[]={{srk,.520},{spig,.245},H}; -N l17n42[]={{slv,.242},H}; -N l17n43[]={{siyxi,.169},H}; -N l17n44[]={{sxg,1.161},{sqm,.109},{spiyx,.145},H}; -N l17n45[]={{sivg,1.877},{soim,.145},H}; -N l17n46[]={{ski,.641},{sgr,.345},{sywg,.190},H}; -N l17n47[]={{sgwmZ,.218},H}; -N l17n48[]={{simx,.308},H}; -N l17n49[]={{sghiv,.979},{shig,.190},H}; -N l17n52[]={{sim,.895},{spg,.236},H}; -N l17n54[]={{sghmi,.979},{syxi,.145},{syvZl,.169},{syZl,.127},H}; -N l17n55[]={{ssj,.073},H}; -N l17n56[]={{spU,.073},H}; -N l17n60[]={{shg,.653},{sZli,.417},{sXpwg,.326},H}; -N l17n61[]={{svir,.200},H}; -N l17n62[]={{siwg,.354},H}; -N l17n63[]={{svX,.266},{sgs,.218},{syrkw,.218},H}; -N l17n64[]={{spp,.230},H}; -N l17n65[]={{sXY,.181},{sZlxg,.326},H}; -N l17n69[]={{sZlg,.816},H}; -N l17n70[]={{syrkg,.363},{sXyjg,.218},H}; -N l17n72[]={{skirg,.326},{sgws,.190},H}; -N l17n73[]={{smv,.097},H}; -N l17n74[]={{smZ,.351},{sg_m,.245},H}; -N l17n75[]={{srm,.133},{syg,.163},H}; -N l17n76[]={{slx,.254},{sws,.133},H}; -N l17n77[]={{sli,.447},{srhi,.236},{svyr,.145},{sYir,.109},{srivg,.218},H}; -N l17n78[]={{spmZ,.218},{simrg,.326},{sgXpw,.254},H}; -N l17n79[]={{sYX,.109},{sglXx,.254},{sgir,.190},H}; -N l17n80[]={{sgt,.145},H}; -N l17n81[]={{sgX,.943},{sXv,.218},{smrh,.163},{sgml,.190},{syjg,.163},H}; -N l17n82[]={{sXZ,.169},H}; -N l17n83[]={{sqg,.707},{sgwt,.163},H}; -N l17n84[]={{sos,.145},{smqg,.245},H}; -N l17n85[]={{srwg,.163},H}; -N l17n86[]={{srhg,.735},H}; -N l17n88[]={{sgXy,.544},H}; -N l17n89[]={{sXrh,.127},{sgrX,.163},H}; -N l17n90[]={{smw,.302},H}; -N l17n91[]={{sig,2.394},H}; -N l17n92[]={{smri,.326},{sjfcvg,.399},H}; -N l17n93[]={{srxi,.200},{swt,.121},{sly,.085},{swZl_,.145},H}; -N l17n94[]={{swX,.109},H}; -N l17n95[]={{sgyr,.680},{swmZl,.193},H}; -N l17n97[]={{svZ,.121},{shsv,.109},{sg7ayg,.218},H}; -N l17n98[]={{sgY,.508},{sgimr,.871},{s_m,.157},{sXw,.145},H}; -N l17n99[]={{sgziv,.399},{sgpi,.245},{sXh,.097},{szsr,.127},{sipx,.109},{ssvg,.163},H}; -N l17n101[]={{smrg,.707},H}; -N l17n102[]={{sivo,.145},{soX,.085},H}; -N l17n103[]={{sip,.302},{srig,.245},{slirg,.290},H}; -N l17n104[]={{syq,.133},H}; -N l17n107[]={{smx,.399},{sxs,.085},H}; -N l17n108[]={{smi,.653},{shmi,.490},H}; -N l17n109[]={{svwx,.109},H}; -N l17n112[]={{sqq,.169},{sYv,.085},H}; -N l17n113[]={{svw,.169},H}; -N l17n114[]={{srg,2.648},{sgv,.236},{svh,.121},{sxmk,.145},{smrk,.127},H}; -N l17n115[]={{sXx,.266},H}; -N l17n117[]={{sXyw,.145},H}; -N l17n118[]={{sfcvg,.673},H}; -N l17n120[]={{siq,.254},H}; -N l17n121[]={{syr,.786},{sYiv,.145},H}; -N l17n122[]={{sgjfc,.299},{sjg,.145},{sirw,.127},H}; -N l17n123[]={{sxir,.381},{sgiv,.571},{s7ai,.157},{sgzs,.326},{shs,.097},H}; -N l17n125[]={{sxX,.133},H}; -N l17n126[]={{shXw,.163},H}; -N l17n127[]={{sgwx,.272},{sl_,.073},H}; -N l17n128[]={{swZ,.459},{srki,.290},H}; -N l17n129[]={{slvi,.163},H}; -N l17n130[]={{svx,.266},H}; -N l17n131[]={{sgw,1.288},{svi,.472},{spir,.127},H}; -N l17n132[]={{sgh,1.904},{sXy,.423},H}; -N l17n133[]={{spX,.157},{sirx,.236},H}; -N l17n134[]={{spmZl,.266},{sZlir,.193},H}; -N l17n136[]={{sgmq,.190},H}; -N l17n137[]={{sir,1.693},{srkg,.354},{soimx,.169},H}; -N l17n138[]={{sgXyj,.290},{svfc,.085},H}; -N l17n139[]={{s7ay,.193},{shir,.290},{sgyrh,.544},{sghy,.190},H}; -N l17n140[]={{sgjv,.163},H}; -N l17n141[]={{shX,.230},H}; -N l17n142[]={{smk,.181},{skig,.326},{sXP,.073},H}; -N l17n143[]={{szsv,.127},H}; -N l17n144[]={{simxg,.290},H}; -N l17n145[]={{ssg,.254},{slm,.121},H}; -N l17n147[]={{sYi,.435},{sgmr,.599},{svy,.157},H}; -N l17n148[]={{sgx,.272},{simg,.163},H}; -N l17n149[]={{sgi,1.215},H}; -N l17n150[]={{syxig,.290},{sXk,.085},H}; -N l17n151[]={{sppi,.218},H}; -N l17n153[]={{skg,.326},H}; -N l17n155[]={{smwZ,.181},H}; -N l17n156[]={{sZlig,.399},H}; -N l17n157[]={{svirg,.326},{ssp,.097},H}; -N l17n158[]={{sxv,.145},H}; -N l17n159[]={{sml,.085},H}; -N l17n160[]={{srr,.133},{swmr,.181},{sgqm,.163},H}; -N l17n161[]={{swx,.556},{s_im,.109},H}; -N l17n162[]={{swi,.266},{sqir,.236},H}; -N l17n163[]={{srhiv,.218},{smqq,.109},H}; -N l17n164[]={{sqX,.121},H}; -N l17n165[]={{sgy,.544},H}; -N l17n166[]={{sgj,.508},H}; -N l17n167[]={{sxiv,.308},{sXl,.073},H}; -N l17n169[]={{szs,.181},H}; -N l17n170[]={{soi,.242},H}; -N l17n172[]={{slxg,.408},H}; -N l17n173[]={{slig,.354},H}; -N l17n174[]={{ssq,.109},{shv,.085},H}; -N l17n175[]={{sghX,.463},{sxw,.121},H}; -N l17n177[]={{srs,.133},{smrhg,.218},{sgXyw,.218},H}; -N l17n179[]={{srxiv,.145},H}; -N l17n182[]={{sgz,.472},H}; -N l17n183[]={{shiv,.762},{sgk,.472},{spw,.157},H}; -N l17n184[]={{slg,.599},H}; -N l17n185[]={{sgYi,.463},H}; -N l17n189[]={{syv,.230},{siY,.073},H}; -N l17n190[]={{sivw,.218},{syZ,.097},H}; -N l17n191[]={{ssr,.278},H}; -N l17n192[]={{sxx,.133},{sgos,.245},H}; -N l17n193[]={{sxi,.955},{srir,.163},H}; -N l17n194[]={{smZl,.453},{sXwg,.218},{shiw,.127},{sgpiy,.254},H}; -N l17n195[]={{srX,.145},{szsrg,.254},H}; -N l17n196[]={{sgwZ,.381},{slp,.133},H}; -N l17n197[]={{syrh,.417},{sgzsr,.254},{sXyZ,.109},H}; -N l17n199[]={{sg_,.599},{svm,.206},{sqqi,.145},{shyv,.127},H}; -N l17n200[]={{sgl,.453},{syqg,.245},{spx,.109},{s_s,.097},H}; -N l17n201[]={{spi,.423},{sgvi,.218},{sxvX,.145},{sivx,.127},{svhi,.127},H}; -N l17n202[]={{sXZl,.254},{srkir,.145},H}; -N l17n203[]={{smxg,.326},H}; -N l17n204[]={{smig,.952},{shmig,.907},{swmrh,.145},H}; -N l17n205[]={{siv,1.705},H}; -N l17n206[]={{syw,.181},{siZ,.073},H}; -N l17n208[]={{sgjfcv,.399},{spiy,.145},H}; -N l17n209[]={{shi,.943},H}; -N l17n210[]={{smo,.109},H}; -N l17n211[]={{smwZl,.242},H}; -N l17n212[]={{sgivw,.254},H}; -N l17n213[]={{sirh,.127},H}; -N l17n215[]={{sYm,.085},{smg,.109},H}; -N l17n216[]={{siqg,.354},H}; -N l17n217[]={{sgm,.726},{svxi,.200},{svZl,.163},H}; -N l17n218[]={{sgwi,.272},{s_X,.073},{siwx,.109},H}; -N l17n219[]={{sghi,1.143},{sxirg,.617},{sgivg,.254},H}; -N l17n220[]={{sXpw,.181},H}; -N l17n222[]={{siw,.411},{shXwg,.290},H}; -N l17n223[]={{syx,.121},H}; -N l17n224[]={{srkig,.218},{syi,.073},H}; -N l17n225[]={{sZlx,.272},{shy,.097},{sghyv,.254},H}; -N l17n226[]={{svxg,.190},H}; -N l17n227[]={{smp,.109},H}; -N l17n229[]={{sZl,1.354},{sziv,.236},H}; -N l17n230[]={{syrk,.472},{swm,.314},{sXyj,.200},H}; -N l17n232[]={{sqi,.266},{skir,.308},{sgmqg,.254},H}; -N l17n233[]={{sirg,2.503},{svo,.133},H}; -N l17n234[]={{sgn,.145},H}; -N l17n235[]={{sXp,.302},{shirg,.472},{s7ayg,.190},H}; -N l17n236[]={{sjv,.073},H}; -N l17n237[]={{sriv,.145},H}; -N l17n238[]={{svg,1.741},{simr,.580},H}; -N l17n239[]={{six,.169},H}; -N l17n240[]={{shyvZ,.169},H}; -N l17n241[]={{syj,.133},{smZli,.145},H}; -N l17n243[]={{sgmrg,.544},{sglX,.299},H}; -N l17n244[]={{smq,.218},{sxl,.097},{sgYim,.254},H}; -N l17n245[]={{srw,.206},{sgXp,.245},H}; -N l17n246[]={{srh,.593},H}; -N l17n247[]={{sls,.085},H}; -N l17n248[]={{swZl,.689},{swxi,.218},{sqy,.073},H}; -N l17n250[]={{sg7a,.363},H}; -N l17n251[]={{sgo,.490},H}; -N l17n252[]={{sgwZl,.508},{sXq,.145},{sjfcv,.200},{siyx,.127},H}; -N l17n253[]={{sXyZl,.145},H}; -N l17n254[]={{syvZ,.145},H}; -N l17n255[]={{szi,.181},{ssvx,.109},H}; - -D l17_d = -{ +S simr[] = { e, i, n, 0 }; +S syrk[] = { u, n, g, 0 }; +S sgimr[] = { 32, e, i, n, 0 }; +S sgim[] = { 32, e, i, 0 }; +S simri[] = { e, i, n, e, 0 }; +S syrhg[] = { u, n, d, a }; +S simx[] = { e, i, t, 0 }; +S sXZl[] = { 97, 99, h, 0 }; +S sgwZl[] = { 32, s, 99, h, 0 }; +S sgwZ[] = { 32, s, 99, 0 }; +S sfcv[] = { 252, r, 0 }; +S sg7ay[] = { 32, z, u, 0 }; +S sjfc[] = { f, 252, 0 }; +S sfcvg[] = { 252, r, a }; +S sXyj[] = { 97, u, f, 0 }; +S sgjfc[] = { 32, f, 252, 0 }; +S sjfcv[] = { f, 252, r, 0 }; +S spmZl[] = { l, i, 99, h, 0 }; +S sjfcvg[] = { f, 252, r, a }; +S sgjfcv[] = { 32, f, 252, r, 0 }; +S syj[] = { u, f, 0 }; +S smwZ[] = { i, s, 99, 0 }; +S sYim[] = { 98, e, i, 0 }; +S syrkg[] = { u, n, g, a }; +S smwZl[] = { i, s, 99, h, 0 }; +S sXpw[] = { 97, l, s, 0 }; +S swmr[] = { s, i, n, 0 }; +S sZlxg[] = { 99, h, t, a }; +S simrg[] = { e, i, n, a }; +S syrkw[] = { u, n, g, s, 0 }; +S syqg[] = { u, m, a }; +S sghXw[] = { 32, d, 97, s, 0 }; +S shXw[] = { d, 97, s, 0 }; +S slir[] = { h, e, n, 0 }; +S srkw[] = { n, g, s, 0 }; +S sXpwg[] = { 97, l, s, a }; +S slvi[] = { h, r, e, 0 }; +S svZl[] = { r, 99, h, 0 }; +S syxi[] = { u, t, e, 0 }; +S simxg[] = { e, i, t, a }; +S sXyw[] = { 97, u, s, 0 }; +S svim[] = { r, e, i, 0 }; +S slirg[] = { h, e, n, a }; +S sZlir[] = { 99, h, e, n, 0 }; +S soim[] = { k, e, i, 0 }; +S syxig[] = { u, t, e, a }; +S sgXyj[] = { 32, 97, u, f, 0 }; +S shXwg[] = { d, 97, s, a }; +S swmZl[] = { s, i, 99, h, 0 }; +S spiy[] = { l, e, u, 0 }; +S svyr[] = { r, u, n, 0 }; +S swmZ[] = { s, i, 99, 0 }; +S syvZ[] = { u, r, 99, 0 }; +S sxmk[] = { t, i, g, 0 }; +S sxvX[] = { t, r, 97, 0 }; +S sqqi[] = { m, m, e, 0 }; +S syvZl[] = { u, r, 99, h, 0 }; +S sgzsr[] = { 32, v, o, n, 0 }; +S szsr[] = { v, o, n, 0 }; +S szsrg[] = { v, o, n, a }; +S sqirg[] = { m, e, n, a }; +S syZl[] = { u, 99, h, 0 }; +S smZlx[] = { i, 99, h, t, 0 }; +S sglXx[] = { 32, h, 97, t, 0 }; +S svfc[] = { r, 252, 0 }; +S syrki[] = { u, n, g, e, 0 }; +S sghyv[] = { 32, d, u, r, 0 }; +S sgmq[] = { 32, i, m, 0 }; +S shyv[] = { d, u, r, 0 }; +S sgmqg[] = { 32, i, m, a }; +S sgml[] = { 32, i, h, 0 }; +S s7ayg[] = { z, u, a }; +S sgYim[] = { 32, 98, e, i, 0 }; +S shyvZ[] = { d, u, r, 99, 0 }; +S svxg[] = { r, t, a }; +S sgXpw[] = { 32, 97, l, s, 0 }; +S siyxi[] = { e, u, t, e, 0 }; +S sgpiy[] = { 32, l, e, u, 0 }; +S siyx[] = { e, u, t, 0 }; +S soimx[] = { k, e, i, t, 0 }; +S sgivw[] = { 32, e, r, s, 0 }; +S sywg[] = { u, s, a }; +S sipx[] = { e, l, t, 0 }; +S sXyZl[] = { 97, u, 99, h, 0 }; +S sgwt[] = { 32, s, p, 0 }; +S sgwmZ[] = { 32, s, i, 99, 0 }; +S smrhg[] = { i, n, d, a }; +S spxi[] = { l, t, e, 0 }; +S sZl_[] = { 99, h, w, 0 }; +S shsv[] = { d, o, r, 0 }; +S swim[] = { s, e, i, 0 }; +S sXyjg[] = { 97, u, f, a }; +S swmrh[] = { s, i, n, d, 0 }; +S swZl_[] = { s, 99, h, w, 0 }; +S sXP[] = { 97, 223, 0 }; +S sivwx[] = { e, r, s, t, 0 }; +S sXyZ[] = { 97, u, 99, 0 }; +S srxiv[] = { n, t, e, r, 0 }; +S sgXyw[] = { 32, 97, u, s, 0 }; +S smZli[] = { i, 99, h, e, 0 }; +S sl_[] = { h, w, 0 }; +S smqq[] = { i, m, m, 0 }; +S s_im[] = { w, e, i, 0 }; +S spiyx[] = { l, e, u, t, 0 }; +S srkig[] = { n, g, e, a }; +S sqqir[] = { m, m, e, n, 0 }; +S swZli[] = { s, 99, h, e, 0 }; +S sg7ayg[] = { 32, z, u, a }; +S syjg[] = { u, f, a }; +S simg[] = { e, i, a }; +S srivg[] = { n, e, r, a }; + +N l17n0[] = { { siy, .181 }, H }; +N l17n1[] = { { sg7ay, .354 }, H }; +N l17n2[] = { { sqirg, .254 }, { sZl_, .109 }, H }; +N l17n3[] = { { ssv, .314 }, H }; +N l17n4[] = { { s_iv, .109 }, H }; +N l17n5[] = { { smr, .967 }, { sxm, .363 }, { slXx, .127 }, H }; +N l17n6[] = { { srx, .314 }, { sgwm, .408 }, { svim, .145 }, H }; +N l17n7[] = { { sri, .459 }, { sghm, .789 }, { slir, .163 }, { sxivg, .290 }, H }; +N l17n8[] = { { sghXw, .326 }, { swo, .073 }, H }; +N l17n9[] = { { slX, .181 }, H }; +N l17n11[] = { { skv, .085 }, { sgXr, .163 }, { sipp, .109 }, H }; +N l17n12[] = { { sgp, .272 }, H }; +N l17n13[] = { { swg, .907 }, { sXr, .326 }, { spm, .266 }, { sgzi, .299 }, H }; +N l17n14[] = { { sgki, .408 }, { sjx, .097 }, H }; +N l17n15[] = { { sji, .181 }, H }; +N l17n17[] = { { sqqir, .145 }, H }; +N l17n21[] = { { shm, .459 }, { sog, .200 }, { ssh, .085 }, { syrki, .169 }, H }; +N l17n22[] = { { sfcv, .354 }, { sjfc, .145 }, { sYim, .181 }, { sms, .085 }, H }; +N l17n23[] = { { shivg, 1.233 }, { spwg, .272 }, { sxxi, .127 }, H }; +N l17n24[] = { { sgim, .653 }, { sZo, .133 }, H }; +N l17n26[] = { { srkw, .163 }, { sivwx, .145 }, H }; +N l17n28[] = { { svr, .145 }, { skw, .121 }, H }; +N l17n29[] = { { simri, .411 }, { sgq, .272 }, H }; +N l17n30[] = { { s_i, .218 }, { sg_i, .245 }, { smZlx, .169 }, H }; +N l17n31[] = { { ssrg, .408 }, { skiw, .127 }, { spxi, .109 }, H }; +N l17n33[] = { { sxig, .735 }, { srirg, .290 }, { sPg, .286 }, H }; +N l17n34[] = { { smZlg, .326 }, { shiwg, .218 }, H }; +N l17n35[] = { { sil, .157 }, H }; +N l17n36[] = { { sivi, .163 }, { swxm, .145 }, H }; +N l17n37[] = { { syrhg, .617 }, { swim, .109 }, H }; +N l17n39[] = { { swmZ, .145 }, { swZli, .145 }, H }; +N l17n41[] = { { srk, .520 }, { spig, .245 }, H }; +N l17n42[] = { { slv, .242 }, H }; +N l17n43[] = { { siyxi, .169 }, H }; +N l17n44[] = { { sxg, 1.161 }, { sqm, .109 }, { spiyx, .145 }, H }; +N l17n45[] = { { sivg, 1.877 }, { soim, .145 }, H }; +N l17n46[] = { { ski, .641 }, { sgr, .345 }, { sywg, .190 }, H }; +N l17n47[] = { { sgwmZ, .218 }, H }; +N l17n48[] = { { simx, .308 }, H }; +N l17n49[] = { { sghiv, .979 }, { shig, .190 }, H }; +N l17n52[] = { { sim, .895 }, { spg, .236 }, H }; +N l17n54[] = { { sghmi, .979 }, { syxi, .145 }, { syvZl, .169 }, { syZl, .127 }, H }; +N l17n55[] = { { ssj, .073 }, H }; +N l17n56[] = { { spU, .073 }, H }; +N l17n60[] = { { shg, .653 }, { sZli, .417 }, { sXpwg, .326 }, H }; +N l17n61[] = { { svir, .200 }, H }; +N l17n62[] = { { siwg, .354 }, H }; +N l17n63[] = { { svX, .266 }, { sgs, .218 }, { syrkw, .218 }, H }; +N l17n64[] = { { spp, .230 }, H }; +N l17n65[] = { { sXY, .181 }, { sZlxg, .326 }, H }; +N l17n69[] = { { sZlg, .816 }, H }; +N l17n70[] = { { syrkg, .363 }, { sXyjg, .218 }, H }; +N l17n72[] = { { skirg, .326 }, { sgws, .190 }, H }; +N l17n73[] = { { smv, .097 }, H }; +N l17n74[] = { { smZ, .351 }, { sg_m, .245 }, H }; +N l17n75[] = { { srm, .133 }, { syg, .163 }, H }; +N l17n76[] = { { slx, .254 }, { sws, .133 }, H }; +N l17n77[] = { { sli, .447 }, { srhi, .236 }, { svyr, .145 }, { sYir, .109 }, { srivg, .218 }, H }; +N l17n78[] = { { spmZ, .218 }, { simrg, .326 }, { sgXpw, .254 }, H }; +N l17n79[] = { { sYX, .109 }, { sglXx, .254 }, { sgir, .190 }, H }; +N l17n80[] = { { sgt, .145 }, H }; +N l17n81[] = { { sgX, .943 }, { sXv, .218 }, { smrh, .163 }, { sgml, .190 }, { syjg, .163 }, H }; +N l17n82[] = { { sXZ, .169 }, H }; +N l17n83[] = { { sqg, .707 }, { sgwt, .163 }, H }; +N l17n84[] = { { sos, .145 }, { smqg, .245 }, H }; +N l17n85[] = { { srwg, .163 }, H }; +N l17n86[] = { { srhg, .735 }, H }; +N l17n88[] = { { sgXy, .544 }, H }; +N l17n89[] = { { sXrh, .127 }, { sgrX, .163 }, H }; +N l17n90[] = { { smw, .302 }, H }; +N l17n91[] = { { sig, 2.394 }, H }; +N l17n92[] = { { smri, .326 }, { sjfcvg, .399 }, H }; +N l17n93[] = { { srxi, .200 }, { swt, .121 }, { sly, .085 }, { swZl_, .145 }, H }; +N l17n94[] = { { swX, .109 }, H }; +N l17n95[] = { { sgyr, .680 }, { swmZl, .193 }, H }; +N l17n97[] = { { svZ, .121 }, { shsv, .109 }, { sg7ayg, .218 }, H }; +N l17n98[] = { { sgY, .508 }, { sgimr, .871 }, { s_m, .157 }, { sXw, .145 }, H }; +N l17n99[] = { { sgziv, .399 }, { sgpi, .245 }, { sXh, .097 }, { szsr, .127 }, { sipx, .109 }, { ssvg, .163 }, H }; +N l17n101[] = { { smrg, .707 }, H }; +N l17n102[] = { { sivo, .145 }, { soX, .085 }, H }; +N l17n103[] = { { sip, .302 }, { srig, .245 }, { slirg, .290 }, H }; +N l17n104[] = { { syq, .133 }, H }; +N l17n107[] = { { smx, .399 }, { sxs, .085 }, H }; +N l17n108[] = { { smi, .653 }, { shmi, .490 }, H }; +N l17n109[] = { { svwx, .109 }, H }; +N l17n112[] = { { sqq, .169 }, { sYv, .085 }, H }; +N l17n113[] = { { svw, .169 }, H }; +N l17n114[] = { { srg, 2.648 }, { sgv, .236 }, { svh, .121 }, { sxmk, .145 }, { smrk, .127 }, H }; +N l17n115[] = { { sXx, .266 }, H }; +N l17n117[] = { { sXyw, .145 }, H }; +N l17n118[] = { { sfcvg, .673 }, H }; +N l17n120[] = { { siq, .254 }, H }; +N l17n121[] = { { syr, .786 }, { sYiv, .145 }, H }; +N l17n122[] = { { sgjfc, .299 }, { sjg, .145 }, { sirw, .127 }, H }; +N l17n123[] = { { sxir, .381 }, { sgiv, .571 }, { s7ai, .157 }, { sgzs, .326 }, { shs, .097 }, H }; +N l17n125[] = { { sxX, .133 }, H }; +N l17n126[] = { { shXw, .163 }, H }; +N l17n127[] = { { sgwx, .272 }, { sl_, .073 }, H }; +N l17n128[] = { { swZ, .459 }, { srki, .290 }, H }; +N l17n129[] = { { slvi, .163 }, H }; +N l17n130[] = { { svx, .266 }, H }; +N l17n131[] = { { sgw, 1.288 }, { svi, .472 }, { spir, .127 }, H }; +N l17n132[] = { { sgh, 1.904 }, { sXy, .423 }, H }; +N l17n133[] = { { spX, .157 }, { sirx, .236 }, H }; +N l17n134[] = { { spmZl, .266 }, { sZlir, .193 }, H }; +N l17n136[] = { { sgmq, .190 }, H }; +N l17n137[] = { { sir, 1.693 }, { srkg, .354 }, { soimx, .169 }, H }; +N l17n138[] = { { sgXyj, .290 }, { svfc, .085 }, H }; +N l17n139[] = { { s7ay, .193 }, { shir, .290 }, { sgyrh, .544 }, { sghy, .190 }, H }; +N l17n140[] = { { sgjv, .163 }, H }; +N l17n141[] = { { shX, .230 }, H }; +N l17n142[] = { { smk, .181 }, { skig, .326 }, { sXP, .073 }, H }; +N l17n143[] = { { szsv, .127 }, H }; +N l17n144[] = { { simxg, .290 }, H }; +N l17n145[] = { { ssg, .254 }, { slm, .121 }, H }; +N l17n147[] = { { sYi, .435 }, { sgmr, .599 }, { svy, .157 }, H }; +N l17n148[] = { { sgx, .272 }, { simg, .163 }, H }; +N l17n149[] = { { sgi, 1.215 }, H }; +N l17n150[] = { { syxig, .290 }, { sXk, .085 }, H }; +N l17n151[] = { { sppi, .218 }, H }; +N l17n153[] = { { skg, .326 }, H }; +N l17n155[] = { { smwZ, .181 }, H }; +N l17n156[] = { { sZlig, .399 }, H }; +N l17n157[] = { { svirg, .326 }, { ssp, .097 }, H }; +N l17n158[] = { { sxv, .145 }, H }; +N l17n159[] = { { sml, .085 }, H }; +N l17n160[] = { { srr, .133 }, { swmr, .181 }, { sgqm, .163 }, H }; +N l17n161[] = { { swx, .556 }, { s_im, .109 }, H }; +N l17n162[] = { { swi, .266 }, { sqir, .236 }, H }; +N l17n163[] = { { srhiv, .218 }, { smqq, .109 }, H }; +N l17n164[] = { { sqX, .121 }, H }; +N l17n165[] = { { sgy, .544 }, H }; +N l17n166[] = { { sgj, .508 }, H }; +N l17n167[] = { { sxiv, .308 }, { sXl, .073 }, H }; +N l17n169[] = { { szs, .181 }, H }; +N l17n170[] = { { soi, .242 }, H }; +N l17n172[] = { { slxg, .408 }, H }; +N l17n173[] = { { slig, .354 }, H }; +N l17n174[] = { { ssq, .109 }, { shv, .085 }, H }; +N l17n175[] = { { sghX, .463 }, { sxw, .121 }, H }; +N l17n177[] = { { srs, .133 }, { smrhg, .218 }, { sgXyw, .218 }, H }; +N l17n179[] = { { srxiv, .145 }, H }; +N l17n182[] = { { sgz, .472 }, H }; +N l17n183[] = { { shiv, .762 }, { sgk, .472 }, { spw, .157 }, H }; +N l17n184[] = { { slg, .599 }, H }; +N l17n185[] = { { sgYi, .463 }, H }; +N l17n189[] = { { syv, .230 }, { siY, .073 }, H }; +N l17n190[] = { { sivw, .218 }, { syZ, .097 }, H }; +N l17n191[] = { { ssr, .278 }, H }; +N l17n192[] = { { sxx, .133 }, { sgos, .245 }, H }; +N l17n193[] = { { sxi, .955 }, { srir, .163 }, H }; +N l17n194[] = { { smZl, .453 }, { sXwg, .218 }, { shiw, .127 }, { sgpiy, .254 }, H }; +N l17n195[] = { { srX, .145 }, { szsrg, .254 }, H }; +N l17n196[] = { { sgwZ, .381 }, { slp, .133 }, H }; +N l17n197[] = { { syrh, .417 }, { sgzsr, .254 }, { sXyZ, .109 }, H }; +N l17n199[] = { { sg_, .599 }, { svm, .206 }, { sqqi, .145 }, { shyv, .127 }, H }; +N l17n200[] = { { sgl, .453 }, { syqg, .245 }, { spx, .109 }, { s_s, .097 }, H }; +N l17n201[] = { { spi, .423 }, { sgvi, .218 }, { sxvX, .145 }, { sivx, .127 }, { svhi, .127 }, H }; +N l17n202[] = { { sXZl, .254 }, { srkir, .145 }, H }; +N l17n203[] = { { smxg, .326 }, H }; +N l17n204[] = { { smig, .952 }, { shmig, .907 }, { swmrh, .145 }, H }; +N l17n205[] = { { siv, 1.705 }, H }; +N l17n206[] = { { syw, .181 }, { siZ, .073 }, H }; +N l17n208[] = { { sgjfcv, .399 }, { spiy, .145 }, H }; +N l17n209[] = { { shi, .943 }, H }; +N l17n210[] = { { smo, .109 }, H }; +N l17n211[] = { { smwZl, .242 }, H }; +N l17n212[] = { { sgivw, .254 }, H }; +N l17n213[] = { { sirh, .127 }, H }; +N l17n215[] = { { sYm, .085 }, { smg, .109 }, H }; +N l17n216[] = { { siqg, .354 }, H }; +N l17n217[] = { { sgm, .726 }, { svxi, .200 }, { svZl, .163 }, H }; +N l17n218[] = { { sgwi, .272 }, { s_X, .073 }, { siwx, .109 }, H }; +N l17n219[] = { { sghi, 1.143 }, { sxirg, .617 }, { sgivg, .254 }, H }; +N l17n220[] = { { sXpw, .181 }, H }; +N l17n222[] = { { siw, .411 }, { shXwg, .290 }, H }; +N l17n223[] = { { syx, .121 }, H }; +N l17n224[] = { { srkig, .218 }, { syi, .073 }, H }; +N l17n225[] = { { sZlx, .272 }, { shy, .097 }, { sghyv, .254 }, H }; +N l17n226[] = { { svxg, .190 }, H }; +N l17n227[] = { { smp, .109 }, H }; +N l17n229[] = { { sZl, 1.354 }, { sziv, .236 }, H }; +N l17n230[] = { { syrk, .472 }, { swm, .314 }, { sXyj, .200 }, H }; +N l17n232[] = { { sqi, .266 }, { skir, .308 }, { sgmqg, .254 }, H }; +N l17n233[] = { { sirg, 2.503 }, { svo, .133 }, H }; +N l17n234[] = { { sgn, .145 }, H }; +N l17n235[] = { { sXp, .302 }, { shirg, .472 }, { s7ayg, .190 }, H }; +N l17n236[] = { { sjv, .073 }, H }; +N l17n237[] = { { sriv, .145 }, H }; +N l17n238[] = { { svg, 1.741 }, { simr, .580 }, H }; +N l17n239[] = { { six, .169 }, H }; +N l17n240[] = { { shyvZ, .169 }, H }; +N l17n241[] = { { syj, .133 }, { smZli, .145 }, H }; +N l17n243[] = { { sgmrg, .544 }, { sglX, .299 }, H }; +N l17n244[] = { { smq, .218 }, { sxl, .097 }, { sgYim, .254 }, H }; +N l17n245[] = { { srw, .206 }, { sgXp, .245 }, H }; +N l17n246[] = { { srh, .593 }, H }; +N l17n247[] = { { sls, .085 }, H }; +N l17n248[] = { { swZl, .689 }, { swxi, .218 }, { sqy, .073 }, H }; +N l17n250[] = { { sg7a, .363 }, H }; +N l17n251[] = { { sgo, .490 }, H }; +N l17n252[] = { { sgwZl, .508 }, { sXq, .145 }, { sjfcv, .200 }, { siyx, .127 }, H }; +N l17n253[] = { { sXyZl, .145 }, H }; +N l17n254[] = { { syvZ, .145 }, H }; +N l17n255[] = { { szi, .181 }, { ssvx, .109 }, H }; + +D l17_d = { "german", "iso-8859-15", - { - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,0.000,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,0.000,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,0.104,0.038,0.062,0.098,0.318,0.035,0.056,0.095,0.156,0.004,0.040,0.072,0.053,0.190,0.060, - 0.015,W,0.154,0.120,0.128,0.083,0.020,0.026,0.003,0.003,0.020,W,W,W,W,W, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - Y,V,V,V,0.002,V,V,V,V,V,V,V,V,V,V,V, - V,V,V,V,V,V,0.001,V,V,V,V,V,0.003,V,V,0.014, - V,V,V,V,0.030,V,V,V,V,V,V,V,V,V,V,V, - V,V,V,V,V,V,0.014,V,V,V,V,V,0.032,V,V,V - }, - { - l17n0,l17n1,l17n2,l17n3,l17n4,l17n5,l17n6,l17n7,l17n8,l17n9,X,l17n11,l17n12,l17n13,l17n14,l17n15, - X,l17n17,X,X,X,l17n21,l17n22,l17n23,l17n24,X,l17n26,X,l17n28,l17n29,l17n30,l17n31, - X,l17n33,l17n34,l17n35,l17n36,l17n37,X,l17n39,X,l17n41,l17n42,l17n43,l17n44,l17n45,l17n46,l17n47, - l17n48,l17n49,X,X,l17n52,X,l17n54,l17n55,l17n56,X,X,X,l17n60,l17n61,l17n62,l17n63, - l17n64,l17n65,X,X,X,l17n69,l17n70,X,l17n72,l17n73,l17n74,l17n75,l17n76,l17n77,l17n78,l17n79, - l17n80,l17n81,l17n82,l17n83,l17n84,l17n85,l17n86,X,l17n88,l17n89,l17n90,l17n91,l17n92,l17n93,l17n94,l17n95, - X,l17n97,l17n98,l17n99,X,l17n101,l17n102,l17n103,l17n104,X,X,l17n107,l17n108,l17n109,X,X, - l17n112,l17n113,l17n114,l17n115,X,l17n117,l17n118,X,l17n120,l17n121,l17n122,l17n123,X,l17n125,l17n126,l17n127, - l17n128,l17n129,l17n130,l17n131,l17n132,l17n133,l17n134,X,l17n136,l17n137,l17n138,l17n139,l17n140,l17n141,l17n142,l17n143, - l17n144,l17n145,X,l17n147,l17n148,l17n149,l17n150,l17n151,X,l17n153,X,l17n155,l17n156,l17n157,l17n158,l17n159, - l17n160,l17n161,l17n162,l17n163,l17n164,l17n165,l17n166,l17n167,X,l17n169,l17n170,X,l17n172,l17n173,l17n174,l17n175, - X,l17n177,X,l17n179,X,X,l17n182,l17n183,l17n184,l17n185,X,X,X,l17n189,l17n190,l17n191, - l17n192,l17n193,l17n194,l17n195,l17n196,l17n197,X,l17n199,l17n200,l17n201,l17n202,l17n203,l17n204,l17n205,l17n206,X, - l17n208,l17n209,l17n210,l17n211,l17n212,l17n213,X,l17n215,l17n216,l17n217,l17n218,l17n219,l17n220,X,l17n222,l17n223, - l17n224,l17n225,l17n226,l17n227,X,l17n229,l17n230,X,l17n232,l17n233,l17n234,l17n235,l17n236,l17n237,l17n238,l17n239, - l17n240,l17n241,X,l17n243,l17n244,l17n245,l17n246,l17n247,l17n248,X,l17n250,l17n251,l17n252,l17n253,l17n254,l17n255 - } + { W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, 0.000, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, 0.000, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, 0.104, 0.038, 0.062, 0.098, 0.318, 0.035, 0.056, 0.095, 0.156, 0.004, 0.040, 0.072, 0.053, 0.190, 0.060, + 0.015, W, 0.154, 0.120, 0.128, 0.083, 0.020, 0.026, 0.003, 0.003, 0.020, W, W, W, W, W, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + Y, V, V, V, 0.002, V, V, V, V, V, V, V, V, V, V, V, + V, V, V, V, V, V, 0.001, V, V, V, V, V, 0.003, V, V, 0.014, + V, V, V, V, 0.030, V, V, V, V, V, V, V, V, V, V, V, + V, V, V, V, V, V, 0.014, V, V, V, V, V, 0.032, V, V, V }, + { l17n0, l17n1, l17n2, l17n3, l17n4, l17n5, l17n6, l17n7, l17n8, l17n9, X, l17n11, l17n12, l17n13, l17n14, l17n15, + X, l17n17, X, X, X, l17n21, l17n22, l17n23, l17n24, X, l17n26, X, l17n28, l17n29, l17n30, l17n31, + X, l17n33, l17n34, l17n35, l17n36, l17n37, X, l17n39, X, l17n41, l17n42, l17n43, l17n44, l17n45, l17n46, l17n47, + l17n48, l17n49, X, X, l17n52, X, l17n54, l17n55, l17n56, X, X, X, l17n60, l17n61, l17n62, l17n63, + l17n64, l17n65, X, X, X, l17n69, l17n70, X, l17n72, l17n73, l17n74, l17n75, l17n76, l17n77, l17n78, l17n79, + l17n80, l17n81, l17n82, l17n83, l17n84, l17n85, l17n86, X, l17n88, l17n89, l17n90, l17n91, l17n92, l17n93, l17n94, l17n95, + X, l17n97, l17n98, l17n99, X, l17n101, l17n102, l17n103, l17n104, X, X, l17n107, l17n108, l17n109, X, X, + l17n112, l17n113, l17n114, l17n115, X, l17n117, l17n118, X, l17n120, l17n121, l17n122, l17n123, X, l17n125, l17n126, l17n127, + l17n128, l17n129, l17n130, l17n131, l17n132, l17n133, l17n134, X, l17n136, l17n137, l17n138, l17n139, l17n140, l17n141, l17n142, l17n143, + l17n144, l17n145, X, l17n147, l17n148, l17n149, l17n150, l17n151, X, l17n153, X, l17n155, l17n156, l17n157, l17n158, l17n159, + l17n160, l17n161, l17n162, l17n163, l17n164, l17n165, l17n166, l17n167, X, l17n169, l17n170, X, l17n172, l17n173, l17n174, l17n175, + X, l17n177, X, l17n179, X, X, l17n182, l17n183, l17n184, l17n185, X, X, X, l17n189, l17n190, l17n191, + l17n192, l17n193, l17n194, l17n195, l17n196, l17n197, X, l17n199, l17n200, l17n201, l17n202, l17n203, l17n204, l17n205, l17n206, X, + l17n208, l17n209, l17n210, l17n211, l17n212, l17n213, X, l17n215, l17n216, l17n217, l17n218, l17n219, l17n220, X, l17n222, l17n223, + l17n224, l17n225, l17n226, l17n227, X, l17n229, l17n230, X, l17n232, l17n233, l17n234, l17n235, l17n236, l17n237, l17n238, l17n239, + l17n240, l17n241, X, l17n243, l17n244, l17n245, l17n246, l17n247, l17n248, X, l17n250, l17n251, l17n252, l17n253, l17n254, l17n255 } }; - - // // Lng: greek // Enc: iso-8859-7 // - -S sgf4[]={32,244,0}; -S seff5[]={239,245,0}; -S sf4ef[]={244,239,0}; -S seff5g[]={239,245,a}; -S sgf0[]={32,240,0}; -S sgf3[]={32,243,0}; -S sgf4ef[]={32,244,239,0}; -S sgec[]={32,236,0}; -S seaR[]={234,225,0}; -S sedR[]={237,225,0}; -S sRed[]={225,237,0}; -S sf4e7[]={244,231,0}; -S sgeaR[]={32,234,225,0}; -S sf4eff5[]={244,239,245,0}; -S sf4R[]={244,225,0}; -S sf3f4[]={243,244,0}; -S sf0ef[]={240,239,0}; -S sgf4eff5[]={32,244,239,245,0}; -S sVe9[]={229,233,0}; -S sRe9[]={225,233,0}; -S sRe9g[]={225,233,a}; -S sf4e9[]={244,233,0}; -S secV[]={236,229,0}; -S sVP[]={229,223,0}; -S se9ef[]={233,239,0}; -S sedRg[]={237,225,a}; -S sf4eff5g[]={244,239,245,a}; -S sRf0[]={225,240,0}; -S sRedg[]={225,237,a}; -S sf4efg[]={244,239,a}; -S sNed[]={221,237,0}; -S sgf3f4[]={32,243,244,0}; -S sgf4e7[]={32,244,231,0}; -S sf0V[]={240,229,0}; -S se7ed[]={231,237,0}; -S sefed[]={239,237,0}; -S se7edg[]={231,237,a}; -S sgef[]={32,239,0}; -S sf3V[]={243,229,0}; -S sf1R[]={241,225,0}; -S sedf4[]={237,244,0}; -S se9R[]={233,225,0}; -S sRf2g[]={225,242,a}; -S sgRf0[]={32,225,240,0}; -S secf0[]={236,240,0}; -S sgVP[]={32,229,223,0}; -S sRf2[]={225,242,0}; -S seaM[]={234,220,0}; -S secef[]={236,239,0}; -S seaRe9[]={234,225,233,0}; -S seaRe9g[]={234,225,233,a}; -S sgeaRe9[]={32,234,225,233,0}; -S sReb[]={225,235,0}; -S sf0e9[]={240,233,0}; -S se9ea[]={233,234,0}; -S sf4V[]={244,229,0}; -S sPed[]={223,237,0}; -S sf0fc[]={240,252,0}; -S sged[]={32,237,0}; -S sf4e7ed[]={244,231,237,0}; -S secR[]={236,225,0}; -S sf4e7edg[]={244,231,237,a}; -S sedV[]={237,229,0}; -S sgf4efg[]={32,244,239,a}; -S sVe9g[]={229,233,a}; -S se9Rg[]={233,225,a}; -S sVf1[]={229,241,0}; -S sf4M[]={244,220,0}; -S sf0eff5[]={240,239,245,0}; -S sRf4[]={225,244,0}; -S sebef[]={235,239,0}; -S sgefg[]={32,239,a}; -S sebe9[]={235,233,0}; -S sgf0ef[]={32,240,239,0}; -S sf0eff5g[]={240,239,245,a}; -S sVed[]={229,237,0}; -S secVg[]={236,229,a}; -S sf0P[]={240,223,0}; -S se7f3[]={231,243,0}; -S secN[]={236,221,0}; -S sVf4[]={229,244,0}; -S sMec[]={220,236,0}; -S sf3R[]={243,225,0}; -S sf3Vg[]={243,229,a}; -S sf4Rg[]={244,225,a}; -S sgf0eff5[]={32,240,239,245,0}; -S sf1e9[]={241,233,0}; -S seffd[]={239,253,0}; -S sf0fcg[]={240,252,a}; -S sgRf0fc[]={32,225,240,252,0}; -S sedef[]={237,239,0}; -S sgecV[]={32,236,229,0}; -S sf0M[]={240,220,0}; -S sVedg[]={229,237,a}; -S sRf0fc[]={225,240,252,0}; -S sRf1[]={225,241,0}; -S sNedR[]={221,237,225,0}; -S sRf0fcg[]={225,240,252,a}; -S sefedg[]={239,237,a}; -S seaef[]={234,239,0}; -S sMed[]={220,237,0}; -S sgedRg[]={32,237,225,a}; -S sebR[]={235,225,0}; -S sgedR[]={32,237,225,0}; -S se9efg[]={233,239,a}; -S sf5f4[]={245,244,0}; -S se9M[]={233,220,0}; -S sNf1[]={221,241,0}; -S sf5ed[]={245,237,0}; -S sPf0[]={223,240,0}; -S sRf5[]={225,245,0}; -S sgeb[]={32,235,0}; -S sf5f2g[]={245,242,a}; -S sf5f2[]={245,242,0}; -S seceff5[]={236,239,245,0}; -S sf1Rg[]={241,225,a}; -S seff5f2g[]={239,245,242,a}; -S seff5f2[]={239,245,242,0}; -S sede7[]={237,231,0}; -S sf0e9ef[]={240,233,239,0}; -S sgecef[]={32,236,239,0}; -S sebV[]={235,229,0}; -S sgUV[]={32,228,229,0}; -S sf1fc[]={241,252,0}; -S sgf4e7ed[]={32,244,231,237,0}; -S seff2g[]={239,242,a}; -S sf4fc[]={244,252,0}; -S seff2[]={239,242,0}; -S sefe9[]={239,233,0}; -S seae9[]={234,233,0}; -S sRf5f4[]={225,245,244,0}; -S sgRf5f4[]={32,225,245,244,0}; -S sf0Vg[]={240,229,a}; -S sf3f4ef[]={243,244,239,0}; -S seeV[]={238,229,0}; -S sgRf5[]={32,225,245,0}; -S sRf3[]={225,243,0}; -S sgeaM[]={32,234,220,0}; -S sgece9[]={32,236,233,0}; -S sgf0M[]={32,240,220,0}; -S sVPf0[]={229,223,240,0}; -S sf1V[]={241,229,0}; -S sMecf0[]={220,236,240,0}; -S sgf3f4ef[]={32,243,244,239,0}; -S sUVed[]={228,229,237,0}; -S sMeb[]={220,235,0}; -S sVf2g[]={229,242,a}; -S sgf7[]={32,247,0}; -S sPf0Vg[]={223,240,229,a}; -S sf4f5[]={244,245,0}; -S sgUVed[]={32,228,229,237,0}; -S secNed[]={236,221,237,0}; -S sgVPf0[]={32,229,223,240,0}; -S sPR[]={223,225,0}; -S sVPf0V[]={229,223,240,229,0}; -S sgccf0[]={32,204,240,0}; -S sf4e7g[]={244,231,a}; -S sgcaM[]={32,202,220,0}; -S sPf0V[]={223,240,229,0}; -S sVf2[]={229,242,0}; -S scaM[]={202,220,0}; -S sece9[]={236,233,0}; -S sccf0[]={204,240,0}; -S sUVedg[]={228,229,237,a}; -S sf1ef[]={241,239,0}; -S sgee[]={32,238,0}; -S sf4f1[]={244,241,0}; -S sf4Vg[]={244,229,a}; -S sf0f1[]={240,241,0}; -S scaMecf0[]={202,220,236,240,0}; -S sgfc[]={32,252,0}; -S sgf3f4e7[]={32,243,244,231,0}; -S sgcaMec[]={32,202,220,236,0}; -S se9f2g[]={233,242,a}; -S sMf4[]={220,244,0}; -S sgc7g[]={32,199,a}; -S sedf4f5[]={237,244,245,0}; -S sf3f4efg[]={243,244,239,a}; -S sf3e7[]={243,231,0}; -S sNedRg[]={221,237,225,a}; -S secf0e9[]={236,240,233,0}; -S seaMg[]={234,220,a}; -S se9f2[]={233,242,0}; -S sedf4f5g[]={237,244,245,a}; -S seaRed[]={234,225,237,0}; -S sf4Mg[]={244,220,a}; -S sf4e9g[]={244,233,a}; -S se9f3[]={233,243,0}; -S sf4f5g[]={244,245,a}; -S seaf1[]={234,241,0}; -S sf4Red[]={244,225,237,0}; -S sf4eff5f2[]={244,239,245,242,0}; -S scaMec[]={202,220,236,0}; -S sf4Redg[]={244,225,237,a}; -S sebeb[]={235,235,0}; -S sf3f4e7[]={243,244,231,0}; -S sfcec[]={252,236,0}; -S sefeb[]={239,235,0}; -S seceff5g[]={236,239,245,a}; -S seaRf4[]={234,225,244,0}; -S sgccf0P[]={32,204,240,223,0}; -S sccf0P[]={204,240,223,0}; -S sf0Ped[]={240,223,237,0}; -S sgf4R[]={32,244,225,0}; -S sfcf2g[]={252,242,a}; -S se7f4[]={231,244,0}; -S sf5ec[]={245,236,0}; -S se9Mg[]={233,220,a}; -S sgf6[]={32,246,0}; -S sMecf0e9[]={220,236,240,233,0}; -S sccf0Ped[]={204,240,223,237,0}; -S seeVg[]={238,229,a}; -S sgf1[]={32,241,0}; -S sPedf4f5[]={223,237,244,245,0}; -S sebM[]={235,220,0}; -S sf0Pedf4[]={240,223,237,244,0}; -S sf1M[]={241,220,0}; -S sgeaRf4[]={32,234,225,244,0}; -S sfcf2[]={252,242,0}; -S seaV[]={234,229,0}; -S sf4e9ea[]={244,233,234,0}; -S sPedf4[]={223,237,244,0}; -S sedf9[]={237,249,0}; -S sf3Redg[]={243,225,237,a}; -S sf3Red[]={243,225,237,0}; -S se9eb[]={233,235,0}; -S sgf4Rg[]={32,244,225,a}; -S sgeceff5[]={32,236,239,245,0}; -S sf0e9efed[]={240,233,239,237,0}; -S secRg[]={236,225,a}; -S sVT[]={229,227,0}; -S se9ed[]={233,237,0}; -S se9efed[]={233,239,237,0}; -S sNeb[]={221,235,0}; -S sede7g[]={237,231,a}; -S seff1[]={239,241,0}; -S sf0Med[]={240,220,237,0}; -S sTe9[]={227,233,0}; -S sf3f9[]={243,249,0}; -S se9eaM[]={233,234,220,0}; -S sgRed[]={32,225,237,0}; -S sSR[]={226,225,0}; -S secf0e9ef[]={236,240,233,239,0}; -S sgf4e7g[]={32,244,231,a}; -S sf5f0[]={245,240,0}; -S sgeae9[]={32,234,233,0}; -S sgecR[]={32,236,225,0}; -S se9eaMg[]={233,234,220,a}; -S se9efedg[]={233,239,237,a}; -S sf3e7g[]={243,231,a}; -S sf3ef[]={243,239,0}; -S se7f2[]={231,242,0}; -S sf0Vf1[]={240,229,241,0}; -S sgTe9[]={32,227,233,0}; -S sUef[]={228,239,0}; -S sgNedR[]={32,221,237,225,0}; -S sgf5[]={32,245,0}; -S sf5f4fc[]={245,244,252,0}; -S sVeb[]={229,235,0}; -S sfceb[]={252,235,0}; -S se7f3Vg[]={231,243,229,a}; -S secM[]={236,220,0}; -S sVe9f2[]={229,233,242,0}; -S sedN[]={237,221,0}; -S sf4e7f2g[]={244,231,242,a}; -S sf1f9[]={241,249,0}; -S sOf4[]={222,244,0}; -S sf3f4e7ed[]={243,244,231,237,0}; -S sf3f5[]={243,245,0}; -S sPedR[]={223,237,225,0}; -S sRf6[]={225,246,0}; -S sgecVg[]={32,236,229,a}; -S sPRg[]={223,225,a}; -S sf7V[]={247,229,0}; -S sf3f4V[]={243,244,229,0}; -S sgNed[]={32,221,237,0}; -S sgf3R[]={32,243,225,0}; -S sf9f2[]={249,242,0}; -S sgf4e7f2[]={32,244,231,242,0}; -S se7f3V[]={231,243,229,0}; -S se7f2g[]={231,242,a}; -S sgW[]={32,230,0}; -S sf9f2g[]={249,242,a}; -S sebRg[]={235,225,a}; -S sNf7[]={221,247,0}; -S sgeag[]={32,234,a}; -S sVPed[]={229,223,237,0}; -S sfced[]={252,237,0}; -S sgf0e9[]={32,240,233,0}; -S sTV[]={227,229,0}; -S sTf5[]={227,245,0}; -S sgf0Med[]={32,240,220,237,0}; -S sVe9f2g[]={229,233,242,a}; -S sf4e7f2[]={244,231,242,0}; -S sfdf1[]={253,241,0}; -S seff5ed[]={239,245,237,0}; -S sVPedR[]={229,223,237,225,0}; -S sf7R[]={247,225,0}; -S sMU[]={220,228,0}; -S sgeae9g[]={32,234,233,a}; -S sTe9R[]={227,233,225,0}; -S sVf6[]={229,246,0}; -S sRec[]={225,236,0}; -S sf4efed[]={244,239,237,0}; -S sf3f0[]={243,240,0}; -S sVf0[]={229,240,0}; -S sf4N[]={244,221,0}; -S se9ec[]={233,236,0}; -S sgece9R[]={32,236,233,225,0}; -S sf7e9[]={247,233,0}; -S seae9g[]={234,233,a}; -S sfcecef[]={252,236,239,0}; -S sf4e9eaM[]={244,233,234,220,0}; -S sf9ec[]={249,236,0}; -S seff5ecV[]={239,245,236,229,0}; -S se8R[]={232,225,0}; -S sTef[]={227,239,0}; -S sVf1R[]={229,241,225,0}; -S sebe7[]={235,231,0}; -S sVf3[]={229,243,0}; -S sfdf3[]={253,243,0}; -S sgf3f5[]={32,243,245,0}; -S sedf9g[]={237,249,a}; -S sece9R[]={236,233,225,0}; -S sf4f3[]={244,243,0}; -S sf6f9[]={246,249,0}; -S sf0e9efg[]={240,233,239,a}; -S sVfd[]={229,253,0}; -S sgebef[]={32,235,239,0}; -S sNf3[]={221,243,0}; -S sgf0e9ef[]={32,240,233,239,0}; -S sf1P[]={241,223,0}; -S seeR[]={238,225,0}; -S sMedf9g[]={220,237,249,a}; -S secf0ef[]={236,240,239,0}; -S sebO[]={235,222,0}; -S sgReb[]={32,225,235,0}; -S sf7Ve9g[]={247,229,233,a}; -S se8V[]={232,229,0}; -S sUP[]={228,223,0}; -S sgf4f1[]={32,244,241,0}; -S sefe9g[]={239,233,a}; -S sf6V[]={246,229,0}; -S sRebeb[]={225,235,235,0}; -S sVf4R[]={229,244,225,0}; -S sgf8[]={32,248,0}; -S sedVg[]={237,229,a}; -S sPf4[]={223,244,0}; -S sVf5[]={229,245,0}; -S se7ec[]={231,236,0}; -S sece7[]={236,231,0}; -S sf3ea[]={243,234,0}; -S sRT[]={225,227,0}; -S sgTe9R[]={32,227,233,225,0}; -S secVf4[]={236,229,244,0}; -S sPea[]={223,234,0}; -S sf4fcg[]={244,252,a}; -S sf9ed[]={249,237,0}; - -N l18n0[]={{sRf5f4,.491},{sUVed,.446},{sccf0Ped,.476},{sgRed,.208},{sVf5,.149},H}; -N l18n1[]={{sgf4e7,.743},H}; -N l18n2[]={{sOg,.714},{sf3Vg,1.004},H}; -N l18n3[]={{sgf3,1.130},{sRf0fc,.625},{seff2,.327},H}; -N l18n4[]={{sgU,.595},{sedRg,1.874},H}; -N l18n5[]={{sf4e9,.922},H}; -N l18n6[]={{scaMecf0,.535},H}; -N l18n7[]={{seeV,.327},H}; -N l18n9[]={{seff5ecV,.297},{se8R,.149},H}; -N l18n10[]={{sede7,.357},H}; -N l18n11[]={{se7f2,.178},{sgf0Med,.238},H}; -N l18n12[]={{sf4Redg,.803},H}; -N l18n13[]={{sece9,.297},H}; -N l18n14[]={{sefedg,.937},{sf1ef,.297},{sf0Ped,.357},H}; -N l18n16[]={{sebeb,.268},H}; -N l18n17[]={{sefg,3.479},{sf0f1,.268},{sebM,.238},{sVf6,.149},H}; -N l18n18[]={{sf4e7ed,.803},{scaM,.297},H}; -N l18n19[]={{sf4e9ea,.357},H}; -N l18n20[]={{sgf4,2.220},H}; -N l18n21[]={{sgeaR,1.219},{sgV,.813},{sgf0ef,.476},{sgRf0fc,.555},{sUe9,.268},H}; -N l18n22[]={{se9ef,.833},{se7edg,1.539},{sOf4,.178},H}; -N l18n23[]={{sgc7,.178},H}; -N l18n24[]={{sRe9g,2.208},{sgb8,.099},H}; -N l18n25[]={{se7g,1.829},{sPedf4f5,.476},H}; -N l18n28[]={{se7f3,.446},H}; -N l18n29[]={{sf5f2g,.803},H}; -N l18n30[]={{sf7V,.178},H}; -N l18n31[]={{sgefg,.476},{sgf4Rg,.278},{sfceb,.178},H}; -N l18n32[]={{sf1R,.654},H}; -N l18n33[]={{sgRf0,.625},{sPg,.580},{sf4Vg,.602},H}; -N l18n36[]={{sf3e7g,.468},H}; -N l18n37[]={{sgf5,.119},H}; -N l18n38[]={{sgW,.119},H}; -N l18n40[]={{se9R,.654},{sf4M,.506},{sPf0Vg,.892},H}; -N l18n41[]={{secVg,1.071},H}; -N l18n42[]={{sNf7,.178},H}; -N l18n43[]={{sNedR,.625},H}; -N l18n44[]={{sf0fcg,.937},H}; -N l18n45[]={{sVf2g,.669},{se7f4,.238},H}; -N l18n46[]={{sf0e9efg,.446},H}; -N l18n47[]={{sRf0,.803},{seae9g,.335},H}; -N l18n48[]={{sfcec,.268},{secM,.178},H}; -N l18n49[]={{sf4f5g,.602},H}; -N l18n50[]={{sgece9R,.198},H}; -N l18n51[]={{se9Mg,.535},{sebO,.149},H}; -N l18n52[]={{sVe9,1.041},{sgRf5f4,.436},{sgf3f4e7,.357},H}; -N l18n53[]={{seaef,.387},{se9eaM,.312},{sPf4,.149},H}; -N l18n54[]={{seff5,2.825},{scaMec,.401},{sgf6,.159},H}; -N l18n55[]={{sgecR,.208},{sge7,.119},H}; -N l18n56[]={{sgf4eff5,1.427},H}; -N l18n57[]={{sc7g,.401},{sccf0P,.357},{sf9f2,.178},{sf4N,.149},H}; -N l18n58[]={{sPedf4,.357},H}; -N l18n60[]={{sedf9,.208},H}; -N l18n63[]={{sMeb,.297},H}; -N l18n64[]={{sRf1,.416},H}; -N l18n65[]={{secN,.446},{sfced,.178},H}; -N l18n67[]={{sf4e7g,.669},H}; -N l18n68[]={{sgf0M,.297},H}; -N l18n69[]={{sf0V,.714},{se9efed,.312},{secVf4,.223},H}; -N l18n70[]={{sf3f4efg,.803},H}; -N l18n71[]={{seaR,1.487},{sf9g,.848},{sgf7,.198},H}; -N l18n72[]={{sgedR,.387},{sf4fc,.327},{sedVg,.335},H}; -N l18n73[]={{se9f2,.268},{sf4e7f2,.268},H}; -N l18n74[]={{seaRe9,.892},{sgca,.337},H}; -N l18n76[]={{sgf3f4ef,.397},{sf3ef,.178},H}; -N l18n77[]={{se8V,.149},H}; -N l18n79[]={{sSR,.208},H}; -N l18n80[]={{sMec,.446},H}; -N l18n81[]={{sRf2,.625},H}; -N l18n82[]={{sf4eff5g,2.498},{seaMg,.602},{sPRg,.401},{sRT,.149},H}; -N l18n83[]={{se7f3Vg,.535},{sf6f9,.149},H}; -N l18n84[]={{sebef,.476},{secf0e9ef,.416},H}; -N l18n85[]={{sf3f4e7ed,.357},H}; -N l18n86[]={{sVeb,.178},H}; -N l18n87[]={{se9g,3.747},{seaf1,.268},{sf5ec,.238},H}; -N l18n88[]={{sgRf5,.327},{sgf8,.099},H}; -N l18n89[]={{sgf4ef,1.665},{sgccf0P,.317},H}; -N l18n90[]={{se9f3,.268},{seceff5g,.714},H}; -N l18n91[]={{sMecf0e9,.476},{sgcb,.099},H}; -N l18n92[]={{sRedg,1.807},{sVPedR,.357},{sTef,.149},H}; -N l18n93[]={{sf3f0,.149},H}; -N l18n94[]={{sf3R,.446},{sNeb,.208},H}; -N l18n95[]={{sRg,4.951},{sgNedR,.238},H}; -N l18n96[]={{sUVedg,.892},{sedN,.178},H}; -N l18n97[]={{sMed,.387},{sgf4e7g,.278},H}; -N l18n98[]={{sRf3,.327},{sf7e9,.149},H}; -N l18n99[]={{sgecV,.416},{sRf0fcg,1.249},{seff2g,.736},H}; -N l18n100[]={{sf1V,.297},H}; -N l18n101[]={{sf4e9g,.602},{seff5ed,.268},H}; -N l18n102[]={{sebR,.387},H}; -N l18n103[]={{seeVg,.535},{sVf1R,.223},H}; -N l18n104[]={{sf5ed,.357},H}; -N l18n105[]={{sPedR,.268},H}; -N l18n106[]={{sgea,1.566},{sefe9,.327},{sede7g,.468},H}; -N l18n107[]={{sf4ef,2.201},{se7f2g,.401},{sUP,.149},H}; -N l18n108[]={{sgcc,.377},H}; -N l18n109[]={{sgeae9,.208},H}; -N l18n110[]={{sf2g,4.327},{sedf4f5,.401},{sTR,.208},H}; -N l18n111[]={{sgf4f1,.149},H}; -N l18n112[]={{secNed,.446},H}; -N l18n114[]={{sf4e7edg,1.606},H}; -N l18n115[]={{secef,.595},{sRf4,.476},H}; -N l18n116[]={{sMedf9g,.446},H}; -N l18n117[]={{sfcecef,.223},H}; -N l18n118[]={{sf0eff5,.758},{se9efg,.870},{seaRed,.401},{seag,.312},H}; -N l18n119[]={{sgc7g,.268},H}; -N l18n120[]={{sVed,.476},{sf3f4V,.268},H}; -N l18n122[]={{sgVPf0,.397},H}; -N l18n123[]={{sgeb,.238},{sUef,.178},H}; -N l18n124[]={{sgM,.119},H}; -N l18n125[]={{sf4R,1.130},{sgcd,.099},H}; -N l18n127[]={{sgf3f4,.743},H}; -N l18n128[]={{sNed,.773},{sf1Rg,.803},H}; -N l18n129[]={{sf7Ve9g,.446},H}; -N l18n130[]={{sgcaMec,.357},H}; -N l18n132[]={{secf0,.625},{sRf5,.357},H}; -N l18n133[]={{secR,.535},H}; -N l18n135[]={{secf0e9,.401},H}; -N l18n136[]={{se9Rg,1.137},{sf4Mg,.602},{sVfd,.149},H}; -N l18n137[]={{sf0e9,.565},{sVPf0V,.595},H}; -N l18n138[]={{sVP,.862},{sgf3f5,.149},H}; -N l18n139[]={{sNedRg,.803},{seaV,.238},{sPea,.149},H}; -N l18n140[]={{sgec,1.071},{sefeb,.238},H}; -N l18n141[]={{sgN,.674},{sf4f1,.268},{sf3Red,.312},H}; -N l18n142[]={{sf3f4e7,.401},H}; -N l18n143[]={{sgece9,.297},H}; -N l18n146[]={{sedef,.416},H}; -N l18n148[]={{sVe9g,1.137},H}; -N l18n149[]={{sf0e9efed,.416},{se9eaMg,.625},{sRf6,.178},H}; -N l18n150[]={{seff5g,3.948},{sfcf2,.238},H}; -N l18n153[]={{sf9f2g,.401},{sgTe9R,.198},H}; -N l18n154[]={{sVe9f2,.268},{sf4efed,.223},{sVf4R,.223},H}; -N l18n155[]={{sf5f0,.208},H}; -N l18n156[]={{seff5f2,.535},{sgfc,.178},{sedf9g,.335},H}; -N l18n157[]={{sged,.357},H}; -N l18n158[]={{sgO,.119},H}; -N l18n159[]={{sgcf,.139},H}; -N l18n160[]={{sMecf0,.446},{sf0Vf1,.268},{sgf0e9ef,.198},H}; -N l18n161[]={{sf3f4,1.130},{sTe9R,.223},H}; -N l18n162[]={{sf3V,.654},{sgUVed,.397},H}; -N l18n164[]={{sedR,1.427},{sfcg,1.071},{sccf0,.297},{sfdf1,.178},H}; -N l18n165[]={{sf0Vg,.736},{se9efedg,.625},{se7ec,.149},H}; -N l18n167[]={{sf4e9eaM,.297},H}; -N l18n168[]={{sf1e9,.446},{sgedRg,.515},{sf4fcg,.335},H}; -N l18n169[]={{se9f2g,.602},{sf4e7f2g,.535},H}; -N l18n170[]={{sgVP,.625},{seaRe9g,1.784},{sebV,.327},H}; -N l18n171[]={{sVf0,.149},H}; -N l18n172[]={{sf0M,.416},{sf4Red,.401},H}; -N l18n174[]={{sefed,.714},{sgee,.198},{sgf3R,.178},H}; -N l18n175[]={{sf4f3,.149},H}; -N l18n176[]={{sgeceff5,.278},H}; -N l18n177[]={{sRf2g,1.405},{sgc1,.198},H}; -N l18n178[]={{sf3f5,.178},{sTV,.178},H}; -N l18n179[]={{sf5f4fc,.268},H}; -N l18n182[]={{se7ed,.714},H}; -N l18n184[]={{sRe9,1.041},{sf1f9,.178},{sece9R,.223},H}; -N l18n185[]={{sgf4efg,.674},{sVPed,.268},H}; -N l18n188[]={{sVf1,.506},{sgccf0,.297},{sgNed,.178},H}; -N l18n189[]={{sf5f2,.357},H}; -N l18n190[]={{sPed,.565},{seffd,.446},{sgcaM,.297},H}; -N l18n191[]={{sgef,.456},{sgf4R,.238},H}; -N l18n192[]={{sgebef,.149},H}; -N l18n193[]={{se9ea,.565},{sf4V,.565},H}; -N l18n194[]={{sTf5,.178},H}; -N l18n195[]={{seaRf4,.357},{sfdg,.357},{sgecVg,.238},{seeR,.149},H}; -N l18n196[]={{sMg,1.606},{sNf1,.357},{sf3e7,.268},H}; -N l18n198[]={{sebRg,.401},{sfdf3,.149},H}; -N l18n200[]={{sgf4e7ed,.436},{sPf0V,.446},{sf4eff5f2,.535},{sMU,.149},H}; -N l18n201[]={{secV,.862},{sRea,.238},{secf0ef,.223},H}; -N l18n202[]={{sgeag,.178},{sefe9g,.335},H}; -N l18n203[]={{sf5g,3.256},{sf4efg,1.740},{sf1M,.238},H}; -N l18n204[]={{sf0fc,.535},{sebe7,.149},H}; -N l18n205[]={{sVf2,.297},{sgeae9g,.198},H}; -N l18n206[]={{sf0e9ef,.535},{sedf4f5g,.803},{sVT,.208},H}; -N l18n207[]={{seae9,.327},H}; -N l18n208[]={{sgf0,1.130},{sgeaRe9,.793},H}; -N l18n209[]={{sgR,1.170},{sUV,.416},{sgecef,.357},{sf4f5,.297},H}; -N l18n210[]={{se9eb,.208},H}; -N l18n211[]={{sedg,4.015},{se9M,.387},{sgf0e9,.178},{sf9ec,.149},H}; -N l18n214[]={{sf0eff5g,1.427},H}; -N l18n215[]={{sgf4e7f2,.238},H}; -N l18n216[]={{sVedg,.937},{sMf4,.268},H}; -N l18n218[]={{sReb,.595},{sVPf0,.446},{sf7R,.178},H}; -N l18n219[]={{sVg,3.390},{sgUV,.327},{sf0Med,.312},H}; -N l18n221[]={{sf4Rg,1.004},H}; -N l18n222[]={{sgeaM,.327},{sVf3,.149},H}; -N l18n223[]={{sf0P,.446},{sf5f4,.387},H}; -N l18n225[]={{sgf1,.159},H}; -N l18n226[]={{sgS,.218},{sfeg,.268},H}; -N l18n227[]={{sf4e7,1.279},{sNg,.446},{se9ec,.149},H}; -N l18n228[]={{sf9ed,.149},H}; -N l18n229[]={{secRg,.468},H}; -N l18n230[]={{sf3f4ef,.491},{sNf3,.149},H}; -N l18n231[]={{sedf4,.654},H}; -N l18n232[]={{sedV,.535},H}; -N l18n234[]={{sf0Pedf4,.476},{sgReb,.149},H}; -N l18n235[]={{sf1fc,.327},{sRec,.149},{sece7,.149},H}; -N l18n237[]={{sf3Redg,.625},H}; -N l18n238[]={{sebe9,.476},H}; -N l18n239[]={{sf0ef,1.071},{sVf4,.446},H}; -N l18n241[]={{sPf0,.357},{sgeaRf4,.317},H}; -N l18n242[]={{sf4eff5,1.695},{seaM,.595},{sPR,.297},{seff1,.208},H}; -N l18n243[]={{sgT,.436},{se7f3V,.268},{sRebeb,.223},H}; -N l18n244[]={{sgf0eff5,.595},{sgE,.178},{se9ed,.208},H}; -N l18n245[]={{sgc5,.139},H}; -N l18n246[]={{sfcf2g,.535},{sTe9,.208},{sf3f9,.208},{sgTe9,.178},H}; -N l18n247[]={{sf3ea,.149},H}; -N l18n250[]={{seceff5,.535},{sVe9f2g,.535},H}; -N l18n252[]={{sRed,1.368},{seff5f2g,1.071},H}; -N l18n254[]={{sf1P,.149},H}; -N l18n255[]={{sf6V,.149},H}; - -D l18_d = -{ +S sgf4[] = { 32, 244, 0 }; +S seff5[] = { 239, 245, 0 }; +S sf4ef[] = { 244, 239, 0 }; +S seff5g[] = { 239, 245, a }; +S sgf0[] = { 32, 240, 0 }; +S sgf3[] = { 32, 243, 0 }; +S sgf4ef[] = { 32, 244, 239, 0 }; +S sgec[] = { 32, 236, 0 }; +S seaR[] = { 234, 225, 0 }; +S sedR[] = { 237, 225, 0 }; +S sRed[] = { 225, 237, 0 }; +S sf4e7[] = { 244, 231, 0 }; +S sgeaR[] = { 32, 234, 225, 0 }; +S sf4eff5[] = { 244, 239, 245, 0 }; +S sf4R[] = { 244, 225, 0 }; +S sf3f4[] = { 243, 244, 0 }; +S sf0ef[] = { 240, 239, 0 }; +S sgf4eff5[] = { 32, 244, 239, 245, 0 }; +S sVe9[] = { 229, 233, 0 }; +S sRe9[] = { 225, 233, 0 }; +S sRe9g[] = { 225, 233, a }; +S sf4e9[] = { 244, 233, 0 }; +S secV[] = { 236, 229, 0 }; +S sVP[] = { 229, 223, 0 }; +S se9ef[] = { 233, 239, 0 }; +S sedRg[] = { 237, 225, a }; +S sf4eff5g[] = { 244, 239, 245, a }; +S sRf0[] = { 225, 240, 0 }; +S sRedg[] = { 225, 237, a }; +S sf4efg[] = { 244, 239, a }; +S sNed[] = { 221, 237, 0 }; +S sgf3f4[] = { 32, 243, 244, 0 }; +S sgf4e7[] = { 32, 244, 231, 0 }; +S sf0V[] = { 240, 229, 0 }; +S se7ed[] = { 231, 237, 0 }; +S sefed[] = { 239, 237, 0 }; +S se7edg[] = { 231, 237, a }; +S sgef[] = { 32, 239, 0 }; +S sf3V[] = { 243, 229, 0 }; +S sf1R[] = { 241, 225, 0 }; +S sedf4[] = { 237, 244, 0 }; +S se9R[] = { 233, 225, 0 }; +S sRf2g[] = { 225, 242, a }; +S sgRf0[] = { 32, 225, 240, 0 }; +S secf0[] = { 236, 240, 0 }; +S sgVP[] = { 32, 229, 223, 0 }; +S sRf2[] = { 225, 242, 0 }; +S seaM[] = { 234, 220, 0 }; +S secef[] = { 236, 239, 0 }; +S seaRe9[] = { 234, 225, 233, 0 }; +S seaRe9g[] = { 234, 225, 233, a }; +S sgeaRe9[] = { 32, 234, 225, 233, 0 }; +S sReb[] = { 225, 235, 0 }; +S sf0e9[] = { 240, 233, 0 }; +S se9ea[] = { 233, 234, 0 }; +S sf4V[] = { 244, 229, 0 }; +S sPed[] = { 223, 237, 0 }; +S sf0fc[] = { 240, 252, 0 }; +S sged[] = { 32, 237, 0 }; +S sf4e7ed[] = { 244, 231, 237, 0 }; +S secR[] = { 236, 225, 0 }; +S sf4e7edg[] = { 244, 231, 237, a }; +S sedV[] = { 237, 229, 0 }; +S sgf4efg[] = { 32, 244, 239, a }; +S sVe9g[] = { 229, 233, a }; +S se9Rg[] = { 233, 225, a }; +S sVf1[] = { 229, 241, 0 }; +S sf4M[] = { 244, 220, 0 }; +S sf0eff5[] = { 240, 239, 245, 0 }; +S sRf4[] = { 225, 244, 0 }; +S sebef[] = { 235, 239, 0 }; +S sgefg[] = { 32, 239, a }; +S sebe9[] = { 235, 233, 0 }; +S sgf0ef[] = { 32, 240, 239, 0 }; +S sf0eff5g[] = { 240, 239, 245, a }; +S sVed[] = { 229, 237, 0 }; +S secVg[] = { 236, 229, a }; +S sf0P[] = { 240, 223, 0 }; +S se7f3[] = { 231, 243, 0 }; +S secN[] = { 236, 221, 0 }; +S sVf4[] = { 229, 244, 0 }; +S sMec[] = { 220, 236, 0 }; +S sf3R[] = { 243, 225, 0 }; +S sf3Vg[] = { 243, 229, a }; +S sf4Rg[] = { 244, 225, a }; +S sgf0eff5[] = { 32, 240, 239, 245, 0 }; +S sf1e9[] = { 241, 233, 0 }; +S seffd[] = { 239, 253, 0 }; +S sf0fcg[] = { 240, 252, a }; +S sgRf0fc[] = { 32, 225, 240, 252, 0 }; +S sedef[] = { 237, 239, 0 }; +S sgecV[] = { 32, 236, 229, 0 }; +S sf0M[] = { 240, 220, 0 }; +S sVedg[] = { 229, 237, a }; +S sRf0fc[] = { 225, 240, 252, 0 }; +S sRf1[] = { 225, 241, 0 }; +S sNedR[] = { 221, 237, 225, 0 }; +S sRf0fcg[] = { 225, 240, 252, a }; +S sefedg[] = { 239, 237, a }; +S seaef[] = { 234, 239, 0 }; +S sMed[] = { 220, 237, 0 }; +S sgedRg[] = { 32, 237, 225, a }; +S sebR[] = { 235, 225, 0 }; +S sgedR[] = { 32, 237, 225, 0 }; +S se9efg[] = { 233, 239, a }; +S sf5f4[] = { 245, 244, 0 }; +S se9M[] = { 233, 220, 0 }; +S sNf1[] = { 221, 241, 0 }; +S sf5ed[] = { 245, 237, 0 }; +S sPf0[] = { 223, 240, 0 }; +S sRf5[] = { 225, 245, 0 }; +S sgeb[] = { 32, 235, 0 }; +S sf5f2g[] = { 245, 242, a }; +S sf5f2[] = { 245, 242, 0 }; +S seceff5[] = { 236, 239, 245, 0 }; +S sf1Rg[] = { 241, 225, a }; +S seff5f2g[] = { 239, 245, 242, a }; +S seff5f2[] = { 239, 245, 242, 0 }; +S sede7[] = { 237, 231, 0 }; +S sf0e9ef[] = { 240, 233, 239, 0 }; +S sgecef[] = { 32, 236, 239, 0 }; +S sebV[] = { 235, 229, 0 }; +S sgUV[] = { 32, 228, 229, 0 }; +S sf1fc[] = { 241, 252, 0 }; +S sgf4e7ed[] = { 32, 244, 231, 237, 0 }; +S seff2g[] = { 239, 242, a }; +S sf4fc[] = { 244, 252, 0 }; +S seff2[] = { 239, 242, 0 }; +S sefe9[] = { 239, 233, 0 }; +S seae9[] = { 234, 233, 0 }; +S sRf5f4[] = { 225, 245, 244, 0 }; +S sgRf5f4[] = { 32, 225, 245, 244, 0 }; +S sf0Vg[] = { 240, 229, a }; +S sf3f4ef[] = { 243, 244, 239, 0 }; +S seeV[] = { 238, 229, 0 }; +S sgRf5[] = { 32, 225, 245, 0 }; +S sRf3[] = { 225, 243, 0 }; +S sgeaM[] = { 32, 234, 220, 0 }; +S sgece9[] = { 32, 236, 233, 0 }; +S sgf0M[] = { 32, 240, 220, 0 }; +S sVPf0[] = { 229, 223, 240, 0 }; +S sf1V[] = { 241, 229, 0 }; +S sMecf0[] = { 220, 236, 240, 0 }; +S sgf3f4ef[] = { 32, 243, 244, 239, 0 }; +S sUVed[] = { 228, 229, 237, 0 }; +S sMeb[] = { 220, 235, 0 }; +S sVf2g[] = { 229, 242, a }; +S sgf7[] = { 32, 247, 0 }; +S sPf0Vg[] = { 223, 240, 229, a }; +S sf4f5[] = { 244, 245, 0 }; +S sgUVed[] = { 32, 228, 229, 237, 0 }; +S secNed[] = { 236, 221, 237, 0 }; +S sgVPf0[] = { 32, 229, 223, 240, 0 }; +S sPR[] = { 223, 225, 0 }; +S sVPf0V[] = { 229, 223, 240, 229, 0 }; +S sgccf0[] = { 32, 204, 240, 0 }; +S sf4e7g[] = { 244, 231, a }; +S sgcaM[] = { 32, 202, 220, 0 }; +S sPf0V[] = { 223, 240, 229, 0 }; +S sVf2[] = { 229, 242, 0 }; +S scaM[] = { 202, 220, 0 }; +S sece9[] = { 236, 233, 0 }; +S sccf0[] = { 204, 240, 0 }; +S sUVedg[] = { 228, 229, 237, a }; +S sf1ef[] = { 241, 239, 0 }; +S sgee[] = { 32, 238, 0 }; +S sf4f1[] = { 244, 241, 0 }; +S sf4Vg[] = { 244, 229, a }; +S sf0f1[] = { 240, 241, 0 }; +S scaMecf0[] = { 202, 220, 236, 240, 0 }; +S sgfc[] = { 32, 252, 0 }; +S sgf3f4e7[] = { 32, 243, 244, 231, 0 }; +S sgcaMec[] = { 32, 202, 220, 236, 0 }; +S se9f2g[] = { 233, 242, a }; +S sMf4[] = { 220, 244, 0 }; +S sgc7g[] = { 32, 199, a }; +S sedf4f5[] = { 237, 244, 245, 0 }; +S sf3f4efg[] = { 243, 244, 239, a }; +S sf3e7[] = { 243, 231, 0 }; +S sNedRg[] = { 221, 237, 225, a }; +S secf0e9[] = { 236, 240, 233, 0 }; +S seaMg[] = { 234, 220, a }; +S se9f2[] = { 233, 242, 0 }; +S sedf4f5g[] = { 237, 244, 245, a }; +S seaRed[] = { 234, 225, 237, 0 }; +S sf4Mg[] = { 244, 220, a }; +S sf4e9g[] = { 244, 233, a }; +S se9f3[] = { 233, 243, 0 }; +S sf4f5g[] = { 244, 245, a }; +S seaf1[] = { 234, 241, 0 }; +S sf4Red[] = { 244, 225, 237, 0 }; +S sf4eff5f2[] = { 244, 239, 245, 242, 0 }; +S scaMec[] = { 202, 220, 236, 0 }; +S sf4Redg[] = { 244, 225, 237, a }; +S sebeb[] = { 235, 235, 0 }; +S sf3f4e7[] = { 243, 244, 231, 0 }; +S sfcec[] = { 252, 236, 0 }; +S sefeb[] = { 239, 235, 0 }; +S seceff5g[] = { 236, 239, 245, a }; +S seaRf4[] = { 234, 225, 244, 0 }; +S sgccf0P[] = { 32, 204, 240, 223, 0 }; +S sccf0P[] = { 204, 240, 223, 0 }; +S sf0Ped[] = { 240, 223, 237, 0 }; +S sgf4R[] = { 32, 244, 225, 0 }; +S sfcf2g[] = { 252, 242, a }; +S se7f4[] = { 231, 244, 0 }; +S sf5ec[] = { 245, 236, 0 }; +S se9Mg[] = { 233, 220, a }; +S sgf6[] = { 32, 246, 0 }; +S sMecf0e9[] = { 220, 236, 240, 233, 0 }; +S sccf0Ped[] = { 204, 240, 223, 237, 0 }; +S seeVg[] = { 238, 229, a }; +S sgf1[] = { 32, 241, 0 }; +S sPedf4f5[] = { 223, 237, 244, 245, 0 }; +S sebM[] = { 235, 220, 0 }; +S sf0Pedf4[] = { 240, 223, 237, 244, 0 }; +S sf1M[] = { 241, 220, 0 }; +S sgeaRf4[] = { 32, 234, 225, 244, 0 }; +S sfcf2[] = { 252, 242, 0 }; +S seaV[] = { 234, 229, 0 }; +S sf4e9ea[] = { 244, 233, 234, 0 }; +S sPedf4[] = { 223, 237, 244, 0 }; +S sedf9[] = { 237, 249, 0 }; +S sf3Redg[] = { 243, 225, 237, a }; +S sf3Red[] = { 243, 225, 237, 0 }; +S se9eb[] = { 233, 235, 0 }; +S sgf4Rg[] = { 32, 244, 225, a }; +S sgeceff5[] = { 32, 236, 239, 245, 0 }; +S sf0e9efed[] = { 240, 233, 239, 237, 0 }; +S secRg[] = { 236, 225, a }; +S sVT[] = { 229, 227, 0 }; +S se9ed[] = { 233, 237, 0 }; +S se9efed[] = { 233, 239, 237, 0 }; +S sNeb[] = { 221, 235, 0 }; +S sede7g[] = { 237, 231, a }; +S seff1[] = { 239, 241, 0 }; +S sf0Med[] = { 240, 220, 237, 0 }; +S sTe9[] = { 227, 233, 0 }; +S sf3f9[] = { 243, 249, 0 }; +S se9eaM[] = { 233, 234, 220, 0 }; +S sgRed[] = { 32, 225, 237, 0 }; +S sSR[] = { 226, 225, 0 }; +S secf0e9ef[] = { 236, 240, 233, 239, 0 }; +S sgf4e7g[] = { 32, 244, 231, a }; +S sf5f0[] = { 245, 240, 0 }; +S sgeae9[] = { 32, 234, 233, 0 }; +S sgecR[] = { 32, 236, 225, 0 }; +S se9eaMg[] = { 233, 234, 220, a }; +S se9efedg[] = { 233, 239, 237, a }; +S sf3e7g[] = { 243, 231, a }; +S sf3ef[] = { 243, 239, 0 }; +S se7f2[] = { 231, 242, 0 }; +S sf0Vf1[] = { 240, 229, 241, 0 }; +S sgTe9[] = { 32, 227, 233, 0 }; +S sUef[] = { 228, 239, 0 }; +S sgNedR[] = { 32, 221, 237, 225, 0 }; +S sgf5[] = { 32, 245, 0 }; +S sf5f4fc[] = { 245, 244, 252, 0 }; +S sVeb[] = { 229, 235, 0 }; +S sfceb[] = { 252, 235, 0 }; +S se7f3Vg[] = { 231, 243, 229, a }; +S secM[] = { 236, 220, 0 }; +S sVe9f2[] = { 229, 233, 242, 0 }; +S sedN[] = { 237, 221, 0 }; +S sf4e7f2g[] = { 244, 231, 242, a }; +S sf1f9[] = { 241, 249, 0 }; +S sOf4[] = { 222, 244, 0 }; +S sf3f4e7ed[] = { 243, 244, 231, 237, 0 }; +S sf3f5[] = { 243, 245, 0 }; +S sPedR[] = { 223, 237, 225, 0 }; +S sRf6[] = { 225, 246, 0 }; +S sgecVg[] = { 32, 236, 229, a }; +S sPRg[] = { 223, 225, a }; +S sf7V[] = { 247, 229, 0 }; +S sf3f4V[] = { 243, 244, 229, 0 }; +S sgNed[] = { 32, 221, 237, 0 }; +S sgf3R[] = { 32, 243, 225, 0 }; +S sf9f2[] = { 249, 242, 0 }; +S sgf4e7f2[] = { 32, 244, 231, 242, 0 }; +S se7f3V[] = { 231, 243, 229, 0 }; +S se7f2g[] = { 231, 242, a }; +S sgW[] = { 32, 230, 0 }; +S sf9f2g[] = { 249, 242, a }; +S sebRg[] = { 235, 225, a }; +S sNf7[] = { 221, 247, 0 }; +S sgeag[] = { 32, 234, a }; +S sVPed[] = { 229, 223, 237, 0 }; +S sfced[] = { 252, 237, 0 }; +S sgf0e9[] = { 32, 240, 233, 0 }; +S sTV[] = { 227, 229, 0 }; +S sTf5[] = { 227, 245, 0 }; +S sgf0Med[] = { 32, 240, 220, 237, 0 }; +S sVe9f2g[] = { 229, 233, 242, a }; +S sf4e7f2[] = { 244, 231, 242, 0 }; +S sfdf1[] = { 253, 241, 0 }; +S seff5ed[] = { 239, 245, 237, 0 }; +S sVPedR[] = { 229, 223, 237, 225, 0 }; +S sf7R[] = { 247, 225, 0 }; +S sMU[] = { 220, 228, 0 }; +S sgeae9g[] = { 32, 234, 233, a }; +S sTe9R[] = { 227, 233, 225, 0 }; +S sVf6[] = { 229, 246, 0 }; +S sRec[] = { 225, 236, 0 }; +S sf4efed[] = { 244, 239, 237, 0 }; +S sf3f0[] = { 243, 240, 0 }; +S sVf0[] = { 229, 240, 0 }; +S sf4N[] = { 244, 221, 0 }; +S se9ec[] = { 233, 236, 0 }; +S sgece9R[] = { 32, 236, 233, 225, 0 }; +S sf7e9[] = { 247, 233, 0 }; +S seae9g[] = { 234, 233, a }; +S sfcecef[] = { 252, 236, 239, 0 }; +S sf4e9eaM[] = { 244, 233, 234, 220, 0 }; +S sf9ec[] = { 249, 236, 0 }; +S seff5ecV[] = { 239, 245, 236, 229, 0 }; +S se8R[] = { 232, 225, 0 }; +S sTef[] = { 227, 239, 0 }; +S sVf1R[] = { 229, 241, 225, 0 }; +S sebe7[] = { 235, 231, 0 }; +S sVf3[] = { 229, 243, 0 }; +S sfdf3[] = { 253, 243, 0 }; +S sgf3f5[] = { 32, 243, 245, 0 }; +S sedf9g[] = { 237, 249, a }; +S sece9R[] = { 236, 233, 225, 0 }; +S sf4f3[] = { 244, 243, 0 }; +S sf6f9[] = { 246, 249, 0 }; +S sf0e9efg[] = { 240, 233, 239, a }; +S sVfd[] = { 229, 253, 0 }; +S sgebef[] = { 32, 235, 239, 0 }; +S sNf3[] = { 221, 243, 0 }; +S sgf0e9ef[] = { 32, 240, 233, 239, 0 }; +S sf1P[] = { 241, 223, 0 }; +S seeR[] = { 238, 225, 0 }; +S sMedf9g[] = { 220, 237, 249, a }; +S secf0ef[] = { 236, 240, 239, 0 }; +S sebO[] = { 235, 222, 0 }; +S sgReb[] = { 32, 225, 235, 0 }; +S sf7Ve9g[] = { 247, 229, 233, a }; +S se8V[] = { 232, 229, 0 }; +S sUP[] = { 228, 223, 0 }; +S sgf4f1[] = { 32, 244, 241, 0 }; +S sefe9g[] = { 239, 233, a }; +S sf6V[] = { 246, 229, 0 }; +S sRebeb[] = { 225, 235, 235, 0 }; +S sVf4R[] = { 229, 244, 225, 0 }; +S sgf8[] = { 32, 248, 0 }; +S sedVg[] = { 237, 229, a }; +S sPf4[] = { 223, 244, 0 }; +S sVf5[] = { 229, 245, 0 }; +S se7ec[] = { 231, 236, 0 }; +S sece7[] = { 236, 231, 0 }; +S sf3ea[] = { 243, 234, 0 }; +S sRT[] = { 225, 227, 0 }; +S sgTe9R[] = { 32, 227, 233, 225, 0 }; +S secVf4[] = { 236, 229, 244, 0 }; +S sPea[] = { 223, 234, 0 }; +S sf4fcg[] = { 244, 252, a }; +S sf9ed[] = { 249, 237, 0 }; + +N l18n0[] = { { sRf5f4, .491 }, { sUVed, .446 }, { sccf0Ped, .476 }, { sgRed, .208 }, { sVf5, .149 }, H }; +N l18n1[] = { { sgf4e7, .743 }, H }; +N l18n2[] = { { sOg, .714 }, { sf3Vg, 1.004 }, H }; +N l18n3[] = { { sgf3, 1.130 }, { sRf0fc, .625 }, { seff2, .327 }, H }; +N l18n4[] = { { sgU, .595 }, { sedRg, 1.874 }, H }; +N l18n5[] = { { sf4e9, .922 }, H }; +N l18n6[] = { { scaMecf0, .535 }, H }; +N l18n7[] = { { seeV, .327 }, H }; +N l18n9[] = { { seff5ecV, .297 }, { se8R, .149 }, H }; +N l18n10[] = { { sede7, .357 }, H }; +N l18n11[] = { { se7f2, .178 }, { sgf0Med, .238 }, H }; +N l18n12[] = { { sf4Redg, .803 }, H }; +N l18n13[] = { { sece9, .297 }, H }; +N l18n14[] = { { sefedg, .937 }, { sf1ef, .297 }, { sf0Ped, .357 }, H }; +N l18n16[] = { { sebeb, .268 }, H }; +N l18n17[] = { { sefg, 3.479 }, { sf0f1, .268 }, { sebM, .238 }, { sVf6, .149 }, H }; +N l18n18[] = { { sf4e7ed, .803 }, { scaM, .297 }, H }; +N l18n19[] = { { sf4e9ea, .357 }, H }; +N l18n20[] = { { sgf4, 2.220 }, H }; +N l18n21[] = { { sgeaR, 1.219 }, { sgV, .813 }, { sgf0ef, .476 }, { sgRf0fc, .555 }, { sUe9, .268 }, H }; +N l18n22[] = { { se9ef, .833 }, { se7edg, 1.539 }, { sOf4, .178 }, H }; +N l18n23[] = { { sgc7, .178 }, H }; +N l18n24[] = { { sRe9g, 2.208 }, { sgb8, .099 }, H }; +N l18n25[] = { { se7g, 1.829 }, { sPedf4f5, .476 }, H }; +N l18n28[] = { { se7f3, .446 }, H }; +N l18n29[] = { { sf5f2g, .803 }, H }; +N l18n30[] = { { sf7V, .178 }, H }; +N l18n31[] = { { sgefg, .476 }, { sgf4Rg, .278 }, { sfceb, .178 }, H }; +N l18n32[] = { { sf1R, .654 }, H }; +N l18n33[] = { { sgRf0, .625 }, { sPg, .580 }, { sf4Vg, .602 }, H }; +N l18n36[] = { { sf3e7g, .468 }, H }; +N l18n37[] = { { sgf5, .119 }, H }; +N l18n38[] = { { sgW, .119 }, H }; +N l18n40[] = { { se9R, .654 }, { sf4M, .506 }, { sPf0Vg, .892 }, H }; +N l18n41[] = { { secVg, 1.071 }, H }; +N l18n42[] = { { sNf7, .178 }, H }; +N l18n43[] = { { sNedR, .625 }, H }; +N l18n44[] = { { sf0fcg, .937 }, H }; +N l18n45[] = { { sVf2g, .669 }, { se7f4, .238 }, H }; +N l18n46[] = { { sf0e9efg, .446 }, H }; +N l18n47[] = { { sRf0, .803 }, { seae9g, .335 }, H }; +N l18n48[] = { { sfcec, .268 }, { secM, .178 }, H }; +N l18n49[] = { { sf4f5g, .602 }, H }; +N l18n50[] = { { sgece9R, .198 }, H }; +N l18n51[] = { { se9Mg, .535 }, { sebO, .149 }, H }; +N l18n52[] = { { sVe9, 1.041 }, { sgRf5f4, .436 }, { sgf3f4e7, .357 }, H }; +N l18n53[] = { { seaef, .387 }, { se9eaM, .312 }, { sPf4, .149 }, H }; +N l18n54[] = { { seff5, 2.825 }, { scaMec, .401 }, { sgf6, .159 }, H }; +N l18n55[] = { { sgecR, .208 }, { sge7, .119 }, H }; +N l18n56[] = { { sgf4eff5, 1.427 }, H }; +N l18n57[] = { { sc7g, .401 }, { sccf0P, .357 }, { sf9f2, .178 }, { sf4N, .149 }, H }; +N l18n58[] = { { sPedf4, .357 }, H }; +N l18n60[] = { { sedf9, .208 }, H }; +N l18n63[] = { { sMeb, .297 }, H }; +N l18n64[] = { { sRf1, .416 }, H }; +N l18n65[] = { { secN, .446 }, { sfced, .178 }, H }; +N l18n67[] = { { sf4e7g, .669 }, H }; +N l18n68[] = { { sgf0M, .297 }, H }; +N l18n69[] = { { sf0V, .714 }, { se9efed, .312 }, { secVf4, .223 }, H }; +N l18n70[] = { { sf3f4efg, .803 }, H }; +N l18n71[] = { { seaR, 1.487 }, { sf9g, .848 }, { sgf7, .198 }, H }; +N l18n72[] = { { sgedR, .387 }, { sf4fc, .327 }, { sedVg, .335 }, H }; +N l18n73[] = { { se9f2, .268 }, { sf4e7f2, .268 }, H }; +N l18n74[] = { { seaRe9, .892 }, { sgca, .337 }, H }; +N l18n76[] = { { sgf3f4ef, .397 }, { sf3ef, .178 }, H }; +N l18n77[] = { { se8V, .149 }, H }; +N l18n79[] = { { sSR, .208 }, H }; +N l18n80[] = { { sMec, .446 }, H }; +N l18n81[] = { { sRf2, .625 }, H }; +N l18n82[] = { { sf4eff5g, 2.498 }, { seaMg, .602 }, { sPRg, .401 }, { sRT, .149 }, H }; +N l18n83[] = { { se7f3Vg, .535 }, { sf6f9, .149 }, H }; +N l18n84[] = { { sebef, .476 }, { secf0e9ef, .416 }, H }; +N l18n85[] = { { sf3f4e7ed, .357 }, H }; +N l18n86[] = { { sVeb, .178 }, H }; +N l18n87[] = { { se9g, 3.747 }, { seaf1, .268 }, { sf5ec, .238 }, H }; +N l18n88[] = { { sgRf5, .327 }, { sgf8, .099 }, H }; +N l18n89[] = { { sgf4ef, 1.665 }, { sgccf0P, .317 }, H }; +N l18n90[] = { { se9f3, .268 }, { seceff5g, .714 }, H }; +N l18n91[] = { { sMecf0e9, .476 }, { sgcb, .099 }, H }; +N l18n92[] = { { sRedg, 1.807 }, { sVPedR, .357 }, { sTef, .149 }, H }; +N l18n93[] = { { sf3f0, .149 }, H }; +N l18n94[] = { { sf3R, .446 }, { sNeb, .208 }, H }; +N l18n95[] = { { sRg, 4.951 }, { sgNedR, .238 }, H }; +N l18n96[] = { { sUVedg, .892 }, { sedN, .178 }, H }; +N l18n97[] = { { sMed, .387 }, { sgf4e7g, .278 }, H }; +N l18n98[] = { { sRf3, .327 }, { sf7e9, .149 }, H }; +N l18n99[] = { { sgecV, .416 }, { sRf0fcg, 1.249 }, { seff2g, .736 }, H }; +N l18n100[] = { { sf1V, .297 }, H }; +N l18n101[] = { { sf4e9g, .602 }, { seff5ed, .268 }, H }; +N l18n102[] = { { sebR, .387 }, H }; +N l18n103[] = { { seeVg, .535 }, { sVf1R, .223 }, H }; +N l18n104[] = { { sf5ed, .357 }, H }; +N l18n105[] = { { sPedR, .268 }, H }; +N l18n106[] = { { sgea, 1.566 }, { sefe9, .327 }, { sede7g, .468 }, H }; +N l18n107[] = { { sf4ef, 2.201 }, { se7f2g, .401 }, { sUP, .149 }, H }; +N l18n108[] = { { sgcc, .377 }, H }; +N l18n109[] = { { sgeae9, .208 }, H }; +N l18n110[] = { { sf2g, 4.327 }, { sedf4f5, .401 }, { sTR, .208 }, H }; +N l18n111[] = { { sgf4f1, .149 }, H }; +N l18n112[] = { { secNed, .446 }, H }; +N l18n114[] = { { sf4e7edg, 1.606 }, H }; +N l18n115[] = { { secef, .595 }, { sRf4, .476 }, H }; +N l18n116[] = { { sMedf9g, .446 }, H }; +N l18n117[] = { { sfcecef, .223 }, H }; +N l18n118[] = { { sf0eff5, .758 }, { se9efg, .870 }, { seaRed, .401 }, { seag, .312 }, H }; +N l18n119[] = { { sgc7g, .268 }, H }; +N l18n120[] = { { sVed, .476 }, { sf3f4V, .268 }, H }; +N l18n122[] = { { sgVPf0, .397 }, H }; +N l18n123[] = { { sgeb, .238 }, { sUef, .178 }, H }; +N l18n124[] = { { sgM, .119 }, H }; +N l18n125[] = { { sf4R, 1.130 }, { sgcd, .099 }, H }; +N l18n127[] = { { sgf3f4, .743 }, H }; +N l18n128[] = { { sNed, .773 }, { sf1Rg, .803 }, H }; +N l18n129[] = { { sf7Ve9g, .446 }, H }; +N l18n130[] = { { sgcaMec, .357 }, H }; +N l18n132[] = { { secf0, .625 }, { sRf5, .357 }, H }; +N l18n133[] = { { secR, .535 }, H }; +N l18n135[] = { { secf0e9, .401 }, H }; +N l18n136[] = { { se9Rg, 1.137 }, { sf4Mg, .602 }, { sVfd, .149 }, H }; +N l18n137[] = { { sf0e9, .565 }, { sVPf0V, .595 }, H }; +N l18n138[] = { { sVP, .862 }, { sgf3f5, .149 }, H }; +N l18n139[] = { { sNedRg, .803 }, { seaV, .238 }, { sPea, .149 }, H }; +N l18n140[] = { { sgec, 1.071 }, { sefeb, .238 }, H }; +N l18n141[] = { { sgN, .674 }, { sf4f1, .268 }, { sf3Red, .312 }, H }; +N l18n142[] = { { sf3f4e7, .401 }, H }; +N l18n143[] = { { sgece9, .297 }, H }; +N l18n146[] = { { sedef, .416 }, H }; +N l18n148[] = { { sVe9g, 1.137 }, H }; +N l18n149[] = { { sf0e9efed, .416 }, { se9eaMg, .625 }, { sRf6, .178 }, H }; +N l18n150[] = { { seff5g, 3.948 }, { sfcf2, .238 }, H }; +N l18n153[] = { { sf9f2g, .401 }, { sgTe9R, .198 }, H }; +N l18n154[] = { { sVe9f2, .268 }, { sf4efed, .223 }, { sVf4R, .223 }, H }; +N l18n155[] = { { sf5f0, .208 }, H }; +N l18n156[] = { { seff5f2, .535 }, { sgfc, .178 }, { sedf9g, .335 }, H }; +N l18n157[] = { { sged, .357 }, H }; +N l18n158[] = { { sgO, .119 }, H }; +N l18n159[] = { { sgcf, .139 }, H }; +N l18n160[] = { { sMecf0, .446 }, { sf0Vf1, .268 }, { sgf0e9ef, .198 }, H }; +N l18n161[] = { { sf3f4, 1.130 }, { sTe9R, .223 }, H }; +N l18n162[] = { { sf3V, .654 }, { sgUVed, .397 }, H }; +N l18n164[] = { { sedR, 1.427 }, { sfcg, 1.071 }, { sccf0, .297 }, { sfdf1, .178 }, H }; +N l18n165[] = { { sf0Vg, .736 }, { se9efedg, .625 }, { se7ec, .149 }, H }; +N l18n167[] = { { sf4e9eaM, .297 }, H }; +N l18n168[] = { { sf1e9, .446 }, { sgedRg, .515 }, { sf4fcg, .335 }, H }; +N l18n169[] = { { se9f2g, .602 }, { sf4e7f2g, .535 }, H }; +N l18n170[] = { { sgVP, .625 }, { seaRe9g, 1.784 }, { sebV, .327 }, H }; +N l18n171[] = { { sVf0, .149 }, H }; +N l18n172[] = { { sf0M, .416 }, { sf4Red, .401 }, H }; +N l18n174[] = { { sefed, .714 }, { sgee, .198 }, { sgf3R, .178 }, H }; +N l18n175[] = { { sf4f3, .149 }, H }; +N l18n176[] = { { sgeceff5, .278 }, H }; +N l18n177[] = { { sRf2g, 1.405 }, { sgc1, .198 }, H }; +N l18n178[] = { { sf3f5, .178 }, { sTV, .178 }, H }; +N l18n179[] = { { sf5f4fc, .268 }, H }; +N l18n182[] = { { se7ed, .714 }, H }; +N l18n184[] = { { sRe9, 1.041 }, { sf1f9, .178 }, { sece9R, .223 }, H }; +N l18n185[] = { { sgf4efg, .674 }, { sVPed, .268 }, H }; +N l18n188[] = { { sVf1, .506 }, { sgccf0, .297 }, { sgNed, .178 }, H }; +N l18n189[] = { { sf5f2, .357 }, H }; +N l18n190[] = { { sPed, .565 }, { seffd, .446 }, { sgcaM, .297 }, H }; +N l18n191[] = { { sgef, .456 }, { sgf4R, .238 }, H }; +N l18n192[] = { { sgebef, .149 }, H }; +N l18n193[] = { { se9ea, .565 }, { sf4V, .565 }, H }; +N l18n194[] = { { sTf5, .178 }, H }; +N l18n195[] = { { seaRf4, .357 }, { sfdg, .357 }, { sgecVg, .238 }, { seeR, .149 }, H }; +N l18n196[] = { { sMg, 1.606 }, { sNf1, .357 }, { sf3e7, .268 }, H }; +N l18n198[] = { { sebRg, .401 }, { sfdf3, .149 }, H }; +N l18n200[] = { { sgf4e7ed, .436 }, { sPf0V, .446 }, { sf4eff5f2, .535 }, { sMU, .149 }, H }; +N l18n201[] = { { secV, .862 }, { sRea, .238 }, { secf0ef, .223 }, H }; +N l18n202[] = { { sgeag, .178 }, { sefe9g, .335 }, H }; +N l18n203[] = { { sf5g, 3.256 }, { sf4efg, 1.740 }, { sf1M, .238 }, H }; +N l18n204[] = { { sf0fc, .535 }, { sebe7, .149 }, H }; +N l18n205[] = { { sVf2, .297 }, { sgeae9g, .198 }, H }; +N l18n206[] = { { sf0e9ef, .535 }, { sedf4f5g, .803 }, { sVT, .208 }, H }; +N l18n207[] = { { seae9, .327 }, H }; +N l18n208[] = { { sgf0, 1.130 }, { sgeaRe9, .793 }, H }; +N l18n209[] = { { sgR, 1.170 }, { sUV, .416 }, { sgecef, .357 }, { sf4f5, .297 }, H }; +N l18n210[] = { { se9eb, .208 }, H }; +N l18n211[] = { { sedg, 4.015 }, { se9M, .387 }, { sgf0e9, .178 }, { sf9ec, .149 }, H }; +N l18n214[] = { { sf0eff5g, 1.427 }, H }; +N l18n215[] = { { sgf4e7f2, .238 }, H }; +N l18n216[] = { { sVedg, .937 }, { sMf4, .268 }, H }; +N l18n218[] = { { sReb, .595 }, { sVPf0, .446 }, { sf7R, .178 }, H }; +N l18n219[] = { { sVg, 3.390 }, { sgUV, .327 }, { sf0Med, .312 }, H }; +N l18n221[] = { { sf4Rg, 1.004 }, H }; +N l18n222[] = { { sgeaM, .327 }, { sVf3, .149 }, H }; +N l18n223[] = { { sf0P, .446 }, { sf5f4, .387 }, H }; +N l18n225[] = { { sgf1, .159 }, H }; +N l18n226[] = { { sgS, .218 }, { sfeg, .268 }, H }; +N l18n227[] = { { sf4e7, 1.279 }, { sNg, .446 }, { se9ec, .149 }, H }; +N l18n228[] = { { sf9ed, .149 }, H }; +N l18n229[] = { { secRg, .468 }, H }; +N l18n230[] = { { sf3f4ef, .491 }, { sNf3, .149 }, H }; +N l18n231[] = { { sedf4, .654 }, H }; +N l18n232[] = { { sedV, .535 }, H }; +N l18n234[] = { { sf0Pedf4, .476 }, { sgReb, .149 }, H }; +N l18n235[] = { { sf1fc, .327 }, { sRec, .149 }, { sece7, .149 }, H }; +N l18n237[] = { { sf3Redg, .625 }, H }; +N l18n238[] = { { sebe9, .476 }, H }; +N l18n239[] = { { sf0ef, 1.071 }, { sVf4, .446 }, H }; +N l18n241[] = { { sPf0, .357 }, { sgeaRf4, .317 }, H }; +N l18n242[] = { { sf4eff5, 1.695 }, { seaM, .595 }, { sPR, .297 }, { seff1, .208 }, H }; +N l18n243[] = { { sgT, .436 }, { se7f3V, .268 }, { sRebeb, .223 }, H }; +N l18n244[] = { { sgf0eff5, .595 }, { sgE, .178 }, { se9ed, .208 }, H }; +N l18n245[] = { { sgc5, .139 }, H }; +N l18n246[] = { { sfcf2g, .535 }, { sTe9, .208 }, { sf3f9, .208 }, { sgTe9, .178 }, H }; +N l18n247[] = { { sf3ea, .149 }, H }; +N l18n250[] = { { seceff5, .535 }, { sVe9f2g, .535 }, H }; +N l18n252[] = { { sRed, 1.368 }, { seff5f2g, 1.071 }, H }; +N l18n254[] = { { sf1P, .149 }, H }; +N l18n255[] = { { sf6V, .149 }, H }; + +D l18_d = { "greek", "iso-8859-7", - { - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,0.003,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - Y,Y,Y,Y,Y,Y,0.001,Y,0.004,0.001,0.001,Y,0.001,Y,Y,Y, - Y,0.013,V,0.004,0.005,0.011,0.001,0.011,0.002,0.006,0.021,0.006,0.023,0.006,0.001,0.011, - 0.005,0.005,V,0.006,0.012,V,0.002,0.001,V,0.002,V,V,0.140,0.107,0.049,0.098, - V,0.422,0.037,0.067,0.067,0.296,0.026,0.130,0.036,0.275,0.171,0.132,0.159,0.284,0.026,0.334, - 0.197,0.152,0.115,0.162,0.343,0.187,0.038,0.044,0.006,0.059,0.001,0.001,0.089,0.045,0.033,V - }, - { - l18n0,l18n1,l18n2,l18n3,l18n4,l18n5,l18n6,l18n7,X,l18n9,l18n10,l18n11,l18n12,l18n13,l18n14,X, - l18n16,l18n17,l18n18,l18n19,l18n20,l18n21,l18n22,l18n23,l18n24,l18n25,X,X,l18n28,l18n29,l18n30,l18n31, - l18n32,l18n33,X,X,l18n36,l18n37,l18n38,X,l18n40,l18n41,l18n42,l18n43,l18n44,l18n45,l18n46,l18n47, - l18n48,l18n49,l18n50,l18n51,l18n52,l18n53,l18n54,l18n55,l18n56,l18n57,l18n58,X,l18n60,X,X,l18n63, - l18n64,l18n65,X,l18n67,l18n68,l18n69,l18n70,l18n71,l18n72,l18n73,l18n74,X,l18n76,l18n77,X,l18n79, - l18n80,l18n81,l18n82,l18n83,l18n84,l18n85,l18n86,l18n87,l18n88,l18n89,l18n90,l18n91,l18n92,l18n93,l18n94,l18n95, - l18n96,l18n97,l18n98,l18n99,l18n100,l18n101,l18n102,l18n103,l18n104,l18n105,l18n106,l18n107,l18n108,l18n109,l18n110,l18n111, - l18n112,X,l18n114,l18n115,l18n116,l18n117,l18n118,l18n119,l18n120,X,l18n122,l18n123,l18n124,l18n125,X,l18n127, - l18n128,l18n129,l18n130,X,l18n132,l18n133,X,l18n135,l18n136,l18n137,l18n138,l18n139,l18n140,l18n141,l18n142,l18n143, - X,X,l18n146,X,l18n148,l18n149,l18n150,X,X,l18n153,l18n154,l18n155,l18n156,l18n157,l18n158,l18n159, - l18n160,l18n161,l18n162,X,l18n164,l18n165,X,l18n167,l18n168,l18n169,l18n170,l18n171,l18n172,X,l18n174,l18n175, - l18n176,l18n177,l18n178,l18n179,X,X,l18n182,X,l18n184,l18n185,X,X,l18n188,l18n189,l18n190,l18n191, - l18n192,l18n193,l18n194,l18n195,l18n196,X,l18n198,X,l18n200,l18n201,l18n202,l18n203,l18n204,l18n205,l18n206,l18n207, - l18n208,l18n209,l18n210,l18n211,X,X,l18n214,l18n215,l18n216,X,l18n218,l18n219,X,l18n221,l18n222,l18n223, - X,l18n225,l18n226,l18n227,l18n228,l18n229,l18n230,l18n231,l18n232,X,l18n234,l18n235,X,l18n237,l18n238,l18n239, - X,l18n241,l18n242,l18n243,l18n244,l18n245,l18n246,l18n247,X,X,l18n250,X,l18n252,X,l18n254,l18n255 - } + { W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, 0.003, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + Y, Y, Y, Y, Y, Y, 0.001, Y, 0.004, 0.001, 0.001, Y, 0.001, Y, Y, Y, + Y, 0.013, V, 0.004, 0.005, 0.011, 0.001, 0.011, 0.002, 0.006, 0.021, 0.006, 0.023, 0.006, 0.001, 0.011, + 0.005, 0.005, V, 0.006, 0.012, V, 0.002, 0.001, V, 0.002, V, V, 0.140, 0.107, 0.049, 0.098, + V, 0.422, 0.037, 0.067, 0.067, 0.296, 0.026, 0.130, 0.036, 0.275, 0.171, 0.132, 0.159, 0.284, 0.026, 0.334, + 0.197, 0.152, 0.115, 0.162, 0.343, 0.187, 0.038, 0.044, 0.006, 0.059, 0.001, 0.001, 0.089, 0.045, 0.033, V }, + { l18n0, l18n1, l18n2, l18n3, l18n4, l18n5, l18n6, l18n7, X, l18n9, l18n10, l18n11, l18n12, l18n13, l18n14, X, + l18n16, l18n17, l18n18, l18n19, l18n20, l18n21, l18n22, l18n23, l18n24, l18n25, X, X, l18n28, l18n29, l18n30, l18n31, + l18n32, l18n33, X, X, l18n36, l18n37, l18n38, X, l18n40, l18n41, l18n42, l18n43, l18n44, l18n45, l18n46, l18n47, + l18n48, l18n49, l18n50, l18n51, l18n52, l18n53, l18n54, l18n55, l18n56, l18n57, l18n58, X, l18n60, X, X, l18n63, + l18n64, l18n65, X, l18n67, l18n68, l18n69, l18n70, l18n71, l18n72, l18n73, l18n74, X, l18n76, l18n77, X, l18n79, + l18n80, l18n81, l18n82, l18n83, l18n84, l18n85, l18n86, l18n87, l18n88, l18n89, l18n90, l18n91, l18n92, l18n93, l18n94, l18n95, + l18n96, l18n97, l18n98, l18n99, l18n100, l18n101, l18n102, l18n103, l18n104, l18n105, l18n106, l18n107, l18n108, l18n109, l18n110, l18n111, + l18n112, X, l18n114, l18n115, l18n116, l18n117, l18n118, l18n119, l18n120, X, l18n122, l18n123, l18n124, l18n125, X, l18n127, + l18n128, l18n129, l18n130, X, l18n132, l18n133, X, l18n135, l18n136, l18n137, l18n138, l18n139, l18n140, l18n141, l18n142, l18n143, + X, X, l18n146, X, l18n148, l18n149, l18n150, X, X, l18n153, l18n154, l18n155, l18n156, l18n157, l18n158, l18n159, + l18n160, l18n161, l18n162, X, l18n164, l18n165, X, l18n167, l18n168, l18n169, l18n170, l18n171, l18n172, X, l18n174, l18n175, + l18n176, l18n177, l18n178, l18n179, X, X, l18n182, X, l18n184, l18n185, X, X, l18n188, l18n189, l18n190, l18n191, + l18n192, l18n193, l18n194, l18n195, l18n196, X, l18n198, X, l18n200, l18n201, l18n202, l18n203, l18n204, l18n205, l18n206, l18n207, + l18n208, l18n209, l18n210, l18n211, X, X, l18n214, l18n215, l18n216, X, l18n218, l18n219, X, l18n221, l18n222, l18n223, + X, l18n225, l18n226, l18n227, l18n228, l18n229, l18n230, l18n231, l18n232, X, l18n234, l18n235, X, l18n237, l18n238, l18n239, + X, l18n241, l18n242, l18n243, l18n244, l18n245, l18n246, l18n247, X, X, l18n250, X, l18n252, X, l18n254, l18n255 } }; - - // // Lng: greek // Enc: utf8 // - -S sceb1[]={206,177,0}; -S scf84[]={207,132,0}; -S scebf[]={206,191,0}; -S sceb5[]={206,181,0}; -S scebd[]={206,189,0}; -S scf84ce[]={207,132,206,0}; -S s84ce[]={132,206,0}; -S sceb9[]={206,185,0}; -S scf80[]={207,128,0}; -S scf85[]={207,133,0}; -S sceba[]={206,186,0}; -S sbfcf[]={191,207,0}; -S scebfcf[]={206,191,207,0}; -S scf83[]={207,131,0}; -S sb1ce[]={177,206,0}; -S sceb1ce[]={206,177,206,0}; -S scebc[]={206,188,0}; -S s80ce[]={128,206,0}; -S scf80ce[]={207,128,206,0}; -S scf81[]={207,129,0}; -S sceac[]={206,172,0}; -S sbace[]={186,206,0}; -S scebace[]={206,186,206,0}; -S sb9ce[]={185,206,0}; -S sceb9ce[]={206,185,206,0}; -S sbdce[]={189,206,0}; -S scebdce[]={206,189,206,0}; -S sgcf84[]={32,207,132,0}; -S sceb1g[]={206,177,a}; -S scebb[]={206,187,0}; -S sb1cf[]={177,207,0}; -S sceb1cf[]={206,177,207,0}; -S sceb7[]={206,183,0}; -S scebcce[]={206,188,206,0}; -S sbcce[]={188,206,0}; -S sceb5ce[]={206,181,206,0}; -S sb5ce[]={181,206,0}; -S scf82[]={207,130,0}; -S scf82g[]={207,130,a}; -S sgcf84ce[]={32,207,132,206,0}; -S sbfcf85[]={191,207,133,0}; -S scebfcf85[]={206,191,207,133,0}; -S scf81ce[]={207,129,206,0}; -S s81ce[]={129,206,0}; -S scebdg[]={206,189,a}; -S scead[]={206,173,0}; -S scebbce[]={206,187,206,0}; -S sbbce[]={187,206,0}; -S sceb9g[]={206,185,a}; -S sceaf[]={206,175,0}; -S sgceba[]={32,206,186,0}; -S scebfg[]={206,191,a}; -S sceb5g[]={206,181,a}; -S scf8c[]={207,140,0}; -S scf83ce[]={207,131,206,0}; -S s83ce[]={131,206,0}; -S scf84cebf[]={207,132,206,191,0}; -S s84cebf[]={132,206,191,0}; -S scf85g[]={207,133,a}; -S sb5cf[]={181,207,0}; -S sceb5cf[]={206,181,207,0}; -S sgcebace[]={32,206,186,206,0}; -S scf83cf[]={207,131,207,0}; -S sceacce[]={206,172,206,0}; -S s83cf[]={131,207,0}; -S sbfce[]={191,206,0}; -S scebfce[]={206,191,206,0}; -S sacce[]={172,206,0}; -S sbfcf85g[]={191,207,133,a}; -S sgceb1[]={32,206,177,0}; -S sgcf80[]={32,207,128,0}; -S sgcf83[]={32,207,131,0}; -S sceb4[]={206,180,0}; -S sceb3[]={206,179,0}; -S sgcebc[]={32,206,188,0}; -S scebaceb1[]={206,186,206,177,0}; -S scf89[]={207,137,0}; -S sbaceb1[]={186,206,177,0}; -S sceadce[]={206,173,206,0}; -S sadce[]={173,206,0}; -S sbdceb1[]={189,206,177,0}; -S scebdceb1[]={206,189,206,177,0}; -S scf84cf[]={207,132,207,0}; -S sgcebcce[]={32,206,188,206,0}; -S s84cf[]={132,207,0}; -S sceb1cebd[]={206,177,206,189,0}; -S sgcf80ce[]={32,207,128,206,0}; -S sb1cebd[]={177,206,189,0}; -S safce[]={175,206,0}; -S sceafce[]={206,175,206,0}; -S sceb3ce[]={206,179,206,0}; -S scf84ceb7[]={207,132,206,183,0}; -S s84ceb7[]={132,206,183,0}; -S sb3ce[]={179,206,0}; -S sceb4ce[]={206,180,206,0}; -S s85ce[]={133,206,0}; -S scf85cf[]={207,133,207,0}; -S scf85ce[]={207,133,206,0}; -S sb4ce[]={180,206,0}; -S s85cf[]={133,207,0}; -S sgceb5[]={32,206,181,0}; -S sceb7g[]={206,183,a}; -S sceae[]={206,174,0}; -S s84cebfcf[]={132,206,191,207,0}; -S sgceb1cf[]={32,206,177,207,0}; -S s84ceb1[]={132,206,177,0}; -S scf8d[]={207,141,0}; -S scf83cf84[]={207,131,207,132,0}; -S s83cf84[]={131,207,132,0}; -S sgcf83cf[]={32,207,131,207,0}; -S scf84ceb1[]={207,132,206,177,0}; -S scf87[]={207,135,0}; -S s80cebf[]={128,206,191,0}; -S sceacg[]={206,172,a}; -S scf80cebf[]={207,128,206,191,0}; -S sbaceb1ce[]={186,206,177,206,0}; -S sb7ce[]={183,206,0}; -S sceb7ce[]={206,183,206,0}; -S scebdcf[]={206,189,207,0}; -S s83cf84ce[]={131,207,132,206,0}; -S sceb5ceb9[]={206,181,206,185,0}; -S sb5ceb9[]={181,206,185,0}; -S sbdcf[]={189,207,0}; -S sb1ceb9[]={177,206,185,0}; -S sceb1ceb9[]={206,177,206,185,0}; -S scf80cf[]={207,128,207,0}; -S sgcead[]={32,206,173,0}; -S s80cf[]={128,207,0}; -S sceb7cf[]={206,183,207,0}; -S sb7cf[]={183,207,0}; -S scf81cf[]={207,129,207,0}; -S sb1ceb9g[]={177,206,185,a}; -S s81cf[]={129,207,0}; -S scf86[]={207,134,0}; -S s84ceb9[]={132,206,185,0}; -S sadcf[]={173,207,0}; -S scf84ceb9[]={207,132,206,185,0}; -S sb9cf[]={185,207,0}; -S sceb9cf[]={206,185,207,0}; -S sceb2[]={206,178,0}; -S sgceb5ce[]={32,206,181,206,0}; -S sceadcf[]={206,173,207,0}; -S sgceb4[]={32,206,180,0}; -S sceb8[]={206,184,0}; -S sceb5ceaf[]={206,181,206,175,0}; -S sbcceb5[]={188,206,181,0}; -S sb5ceaf[]={181,206,175,0}; -S scebcceb5[]={206,188,206,181,0}; -S sb9cebf[]={185,206,191,0}; -S sceb9cebf[]={206,185,206,191,0}; -S sbdceb1g[]={189,206,177,a}; -S scf8e[]={207,142,0}; -S s87ce[]={135,206,0}; -S sb1cf80[]={177,207,128,0}; -S s8cce[]={140,206,0}; -S scf87ce[]={207,135,206,0}; -S sceb1cf80[]={206,177,207,128,0}; -S scf8cce[]={207,140,206,0}; -S sb1cebdg[]={177,206,189,a}; -S s80cebfcf[]={128,206,191,207,0}; -S sbccf[]={188,207,0}; -S s84cebfg[]={132,206,191,a}; -S sceadcebd[]={206,173,206,189,0}; -S sadcebd[]={173,206,189,0}; -S scebccf[]={206,188,207,0}; -S safcf[]={175,207,0}; -S s8ccf[]={140,207,0}; -S sb2ce[]={178,206,0}; -S sceafcf[]={206,175,207,0}; -S sceb2ce[]={206,178,206,0}; -S sadcebdce[]={173,206,189,206,0}; -S scf8ccf[]={207,140,207,0}; -S s8cg[]={140,a}; -S scf8cg[]={207,140,a}; -S scebfcebd[]={206,191,206,189,0}; -S s80ceb5[]={128,206,181,0}; -S sceb7cebd[]={206,183,206,189,0}; -S scf80ceb5[]={207,128,206,181,0}; -S sbfcebd[]={191,206,189,0}; -S sb7cebd[]={183,206,189,0}; -S sb7cebdg[]={183,206,189,a}; -S sgcebf[]={32,206,191,0}; -S scf81ceb1[]={207,129,206,177,0}; -S sceb8ce[]={206,184,206,0}; -S sgceb3[]={32,206,179,0}; -S sb8ce[]={184,206,0}; -S sceb9ceb1[]={206,185,206,177,0}; -S scebe[]={206,190,0}; -S scebdcf84[]={206,189,207,132,0}; -S sb9ceb1[]={185,206,177,0}; -S s81ceb1[]={129,206,177,0}; -S sceb6[]={206,182,0}; -S sgceb4ce[]={32,206,180,206,0}; -S sbdcf84[]={189,207,132,0}; -S scf83ceb5[]={207,131,206,181,0}; -S s83ceb5[]={131,206,181,0}; -S saccf[]={172,207,0}; -S sb1cf82[]={177,207,130,0}; -S sceb1cf82[]={206,177,207,130,0}; -S sceaccf[]={206,172,207,0}; -S scebece[]={206,190,206,0}; -S sbccf80[]={188,207,128,0}; -S s89cf[]={137,207,0}; -S sb1cf82g[]={177,207,130,a}; -S scebccf80[]={206,188,207,128,0}; -S sbece[]={190,206,0}; -S scebaceac[]={206,186,206,172,0}; -S sb1cebb[]={177,206,187,0}; -S scebacf[]={206,186,207,0}; -S sceb1cebb[]={206,177,206,187,0}; -S s84ceb7ce[]={132,206,183,206,0}; -S scebccebf[]={206,188,206,191,0}; -S sbccebf[]={188,206,191,0}; -S sbaceac[]={186,206,172,0}; -S scf89cf[]={207,137,207,0}; -S sgceadce[]={32,206,173,206,0}; -S scf86ce[]={207,134,206,0}; -S scf80ceb9[]={207,128,206,185,0}; -S sb9ceba[]={185,206,186,0}; -S s86ce[]={134,206,0}; -S safcebd[]={175,206,189,0}; -S s8dcf[]={141,207,0}; -S scf89g[]={207,137,a}; -S sgce9c[]={32,206,156,0}; -S sbfcf85ce[]={191,207,133,206,0}; -S scf8dcf[]={207,141,207,0}; -S s80ceb9[]={128,206,185,0}; -S sce9c[]={206,156,0}; -S sbccf80ce[]={188,207,128,206,0}; -S sceb9ceba[]={206,185,206,186,0}; -S sgceb1ce[]={32,206,177,206,0}; -S scf84ceb5[]={207,132,206,181,0}; -S sgcf83ce[]={32,207,131,206,0}; -S s84ceb5[]={132,206,181,0}; -S sceafcebd[]={206,175,206,189,0}; -S scebdceb5[]={206,189,206,181,0}; -S s80cf8c[]={128,207,140,0}; -S sceb6ce[]={206,182,206,0}; -S scebcceb1[]={206,188,206,177,0}; -S sce9a[]={206,154,0}; -S sbdceb5[]={189,206,181,0}; -S sgcebd[]={32,206,189,0}; -S scf80cf8c[]={207,128,207,140,0}; -S sbcceb1[]={188,206,177,0}; -S sb6ce[]={182,206,0}; -S sbfcf85cf[]={191,207,133,207,0}; -S sb9ceb1g[]={185,206,177,a}; -S s84ceac[]={132,206,172,0}; -S sceb5cf81[]={206,181,207,129,0}; -S scf84ceac[]={207,132,206,172,0}; -S s9ace[]={154,206,0}; -S sgce9a[]={32,206,154,0}; -S sb5cf81[]={181,207,129,0}; -S sce9ace[]={206,154,206,0}; -S scebbcf[]={206,187,207,0}; -S sb5ceb9g[]={181,206,185,a}; -S sbbcf[]={187,207,0}; -S sb1cebbce[]={177,206,187,206,0}; -S scebbcebf[]={206,187,206,191,0}; -S sceaeg[]={206,174,a}; -S scebbceb9[]={206,187,206,185,0}; -S sgcf84cf[]={32,207,132,207,0}; -S sgcebdce[]={32,206,189,206,0}; -S sbbcebf[]={187,206,191,0}; -S sbbceb9[]={187,206,185,0}; -S sgcebfg[]={32,206,191,a}; -S sb1cf84[]={177,207,132,0}; -S sbcceb5g[]={188,206,181,a}; -S s84ceb9ce[]={132,206,185,206,0}; -S s84ceb1ce[]={132,206,177,206,0}; -S sgce9ace[]={32,206,154,206,0}; -S sb5cebd[]={181,206,189,0}; -S sceb5cebd[]={206,181,206,189,0}; -S sb1cf84ce[]={177,207,132,206,0}; -S sceb1cf84[]={206,177,207,132,0}; -S scf83ceb1[]={207,131,206,177,0}; -S sb5ceafcf[]={181,206,175,207,0}; -S s80ceaf[]={128,206,175,0}; -S s81ceb9[]={129,206,185,0}; -S scf81ceb9[]={207,129,206,185,0}; -S s83ceb1[]={131,206,177,0}; -S sb5cf84[]={181,207,132,0}; -S sbfcf8d[]={191,207,141,0}; -S s83ceb5g[]={131,206,181,a}; -S s84ceb1g[]={132,206,177,a}; -S sbccead[]={188,206,173,0}; -S sceb7cf83[]={206,183,207,131,0}; -S saccebc[]={172,206,188,0}; -S sb7cf83[]={183,207,131,0}; -S scebccead[]={206,188,206,173,0}; -S scf80ceaf[]={207,128,206,175,0}; -S scebfcf8d[]={206,191,207,141,0}; -S sceaccebc[]={206,172,206,188,0}; -S sceb5cf84[]={206,181,207,132,0}; -S sb1cf80cf[]={177,207,128,207,0}; -S sceb4ceb5[]={206,180,206,181,0}; -S saece[]={174,206,0}; -S s86cf[]={134,207,0}; -S scebdcebf[]={206,189,206,191,0}; -S sb1cf81[]={177,207,129,0}; -S sceb1cf81[]={206,177,207,129,0}; -S sbdcebf[]={189,206,191,0}; -S s80ceb9ce[]={128,206,185,206,0}; -S sceb4cf[]={206,180,207,0}; -S scf80ceac[]={207,128,206,172,0}; -S sbfcebdg[]={191,206,189,a}; -S sceaece[]={206,174,206,0}; -S s80cf8cg[]={128,207,140,a}; -S sb1cebdce[]={177,206,189,206,0}; -S s80ceac[]={128,206,172,0}; -S sb4ceb5[]={180,206,181,0}; -S sb4cf[]={180,207,0}; -S sb5cebdg[]={181,206,189,a}; -S sb7cf83ce[]={183,207,131,206,0}; -S scebbceb1[]={206,187,206,177,0}; -S scf86cf[]={207,134,207,0}; -S saccebd[]={172,206,189,0}; -S sbacebf[]={186,206,191,0}; -S s8ecf[]={142,207,0}; -S scebacebf[]={206,186,206,191,0}; -S sbbceb1[]={187,206,177,0}; -S sceb3cf[]={206,179,207,0}; -S s84ceb7cf[]={132,206,183,207,0}; -S s85cf84[]={133,207,132,0}; -S sb9cebfg[]={185,206,191,a}; -S sceaccebd[]={206,172,206,189,0}; -S scf8ecf[]={207,142,207,0}; -S sb3cf[]={179,207,0}; -S sceb9ceac[]={206,185,206,172,0}; -S sb9cebace[]={185,206,186,206,0}; -S sgceb3ce[]={32,206,179,206,0}; -S scf85cf84[]={207,133,207,132,0}; -S sbccebfcf[]={188,206,191,207,0}; -S sb9ceac[]={185,206,172,0}; -S sceafg[]={206,175,a}; -S sceb1cf85[]={206,177,207,133,0}; -S safcf80ce[]={175,207,128,206,0}; -S s85cf82[]={133,207,130,0}; -S s85cf82g[]={133,207,130,a}; -S sceafcf80[]={206,175,207,128,0}; -S sgce9ccf[]={32,206,156,207,0}; -S sbdceb7[]={189,206,183,0}; -S scebdceb7[]={206,189,206,183,0}; -S s85cebd[]={133,206,189,0}; -S sb1cf85[]={177,207,133,0}; -S s9ccf[]={156,207,0}; -S scf85cf82[]={207,133,207,130,0}; -S sb5ceb9ce[]={181,206,185,206,0}; -S scf85cebd[]={207,133,206,189,0}; -S sceadcf81[]={206,173,207,129,0}; -S safcf80[]={175,207,128,0}; -S s81ceb1g[]={129,206,177,a}; -S sb5cf81ce[]={181,207,129,206,0}; -S sce9ccf[]={206,156,207,0}; -S sgcebb[]={32,206,187,0}; -S sb4ceb5ce[]={180,206,181,206,0}; -S sadcf81[]={173,207,129,0}; -S sbdcf84ce[]={189,207,132,206,0}; -S scf81cf8c[]={207,129,207,140,0}; -S sbfceb9[]={191,206,185,0}; -S sb1cf85cf[]={177,207,133,207,0}; -S sceaecf[]={206,174,207,0}; -S sbdcf84cf[]={189,207,132,207,0}; -S sgcebbce[]={32,206,187,206,0}; -S scebaceb9[]={206,186,206,185,0}; -S scebeceb5[]={206,190,206,181,0}; -S sbfcf82g[]={191,207,130,a}; -S safcebdce[]={175,206,189,206,0}; -S s89ce[]={137,206,0}; -S s8dce[]={141,206,0}; -S sbeceb5[]={190,206,181,0}; -S s81cf8c[]={129,207,140,0}; -S sbbceb5[]={187,206,181,0}; -S sceb1cf83[]={206,177,207,131,0}; -S sgceadcf[]={32,206,173,207,0}; -S sgcf80cf[]={32,207,128,207,0}; -S scebfceb9[]={206,191,206,185,0}; -S sbaceb9[]={186,206,185,0}; -S sb1cf83[]={177,207,131,0}; -S sgceb2[]={32,206,178,0}; -S sce91[]={206,145,0}; -S s84cf8c[]={132,207,140,0}; -S scebbceb5[]={206,187,206,181,0}; -S sbfcf82[]={191,207,130,0}; -S sadcf81ce[]={173,207,129,206,0}; - -N l19n1[]={{scebfg,2.611},{sbfcf85ce,.377},{sgcebbce,.218},H}; -N l19n3[]={{sbdg,1.339},{sbccf80,.312},H}; -N l19n4[]={{sceb8ce,.491},{sbfcf85cf,.337},H}; -N l19n6[]={{sce9ace,.379},H}; -N l19n7[]={{s87ce,.268},{s84ceb9ce,.317},H}; -N l19n8[]={{scf87,.551},{sceb6,.327},{sceb5cebd,.476},H}; -N l19n11[]={{sb5g,1.131},H}; -N l19n12[]={{sgcebcce,.932},H}; -N l19n13[]={{sbcceb1,.268},H}; -N l19n14[]={{s84ceac,.253},H}; -N l19n15[]={{scf89cf,.446},H}; -N l19n16[]={{sb1ceb9,.521},{sb9ceb1g,.506},H}; -N l19n19[]={{sceb1g,3.716},{scf82g,3.247},{sb9ceba,.283},H}; -N l19n20[]={{s8cg,.357},{sbccebfcf,.258},H}; -N l19n21[]={{sb9ce,1.141},{sceb9ce,2.567},{scebfcf85,2.827},H}; -N l19n23[]={{sgcebdce,.317},H}; -N l19n24[]={{sceb1cf80,.803},{sb5cebdg,.417},H}; -N l19n25[]={{sceb7,1.622},{sceb9ceac,.387},H}; -N l19n26[]={{scf80cf8c,.536},{sbbceb5,.164},H}; -N l19n27[]={{sb1cf80cf,.298},{sceb1cf81,.417},H}; -N l19n29[]={{sb1ce,1.329},H}; -N l19n30[]={{sb5ceaf,.431},{sceb1cf82,.625},H}; -N l19n31[]={{sgcf80,.848},H}; -N l19n32[]={{sceb9cf,.692},H}; -N l19n33[]={{s80ceb9,.283},{sceb1cf83,.327},H}; -N l19n35[]={{sgcebfg,.317},H}; -N l19n36[]={{sb1cf82g,.625},{sceb1cf84,.476},H}; -N l19n38[]={{scebace,2.611},{sb9cf,.307},{sb1cebb,.298},{s83ceb1,.223},H}; -N l19n39[]={{sceb1cf85,.357},{sbaceb9,.164},H}; -N l19n40[]={{sceb9ceb1,.655},H}; -N l19n41[]={{sgceb1,.878},H}; -N l19n42[]={{scf89,.744},{sceb8,.446},{sadcebdce,.476},{sceb7cebd,.714},{scebaceac,.595},H}; -N l19n43[]={{scf81cf8c,.327},H}; -N l19n44[]={{sbdceb1,.714},{sce9a,.268},{sgce9a,.253},H}; -N l19n45[]={{scebfcf8d,.446},H}; -N l19n46[]={{s80ce,1.280},{sb1cf,1.091},H}; -N l19n49[]={{scebacf,.446},H}; -N l19n50[]={{saeg,.238},H}; -N l19n51[]={{sce9ccf,.268},H}; -N l19n52[]={{sbace,1.161},{sgceb2,.164},H}; -N l19n53[]={{scf83cf84,1.131},{sb5cf81,.253},H}; -N l19n55[]={{scebbce,1.986},{scf8cce,.603},H}; -N l19n56[]={{sceacce,1.361},H}; -N l19n57[]={{scebaceb1,1.488},{sbaceb1ce,.714},{sbcceb5,.431},H}; -N l19n59[]={{sceb9,3.437},{s85g,1.086},H}; -N l19n60[]={{sb1cebd,.684},{sb2ce,.248},H}; -N l19n61[]={{sadcf81,.179},H}; -N l19n63[]={{s80cf,.337},{s84cebfg,.774},{sgceb3,.327},H}; -N l19n64[]={{sgcf83,.848},{s81ceb9,.223},H}; -N l19n65[]={{sbfg,1.161},{sb4ceb5,.208},H}; -N l19n66[]={{scf8ccf,.536},{sgce9c,.283},{scebbcf,.379},H}; -N l19n67[]={{sceaccf,.469},{sceb9ceba,.565},{s80cf8c,.268},H}; -N l19n68[]={{sb1cf84ce,.317},H}; -N l19n69[]={{s84ceb1,.565},{sbacf,.198},{s89ce,.109},H}; -N l19n70[]={{scf85g,2.444},{sbbceb9,.238},H}; -N l19n72[]={{scebcce,2.410},{s83cf84,.565},{s81ceb1g,.357},H}; -N l19n73[]={{sceadce,1.094},{sb7g,.610},H}; -N l19n74[]={{sgceb4,.446},{sb9cebf,.417},{scebbceb1,.387},H}; -N l19n75[]={{sgcf84,1.666},H}; -N l19n76[]={{sceba,2.143},{s84cebfcf,.794},H}; -N l19n77[]={{s81ce,.913},H}; -N l19n78[]={{sbdcf84,.327},{sce9c,.283},{sbfcebdg,.417},H}; -N l19n79[]={{scebccead,.446},H}; -N l19n81[]={{safg,.193},{scf85cf82,.357},{scebaceb9,.327},H}; -N l19n82[]={{sceb9cebf,.833},{s83ceb5,.327},{sb1cf85cf,.218},H}; -N l19n83[]={{sbbce,.883},{scebccf,.580},{scf8dcf,.424},H}; -N l19n84[]={{sceadcf,.692},{s9ace,.169},H}; -N l19n85[]={{sgceb5,.610},H}; -N l19n86[]={{sb7cebdg,.684},{s89cf,.208},{sb5cf84,.223},{scebbceb5,.327},H}; -N l19n87[]={{sceb5g,2.544},{scf85cf84,.387},H}; -N l19n88[]={{sbdceb5,.268},H}; -N l19n89[]={{scebdce,2.522},H}; -N l19n90[]={{sceaece,.312},H}; -N l19n91[]={{sb3ce,.427},{scebcceb1,.536},H}; -N l19n93[]={{scebb,1.652},{scf8c,1.116},H}; -N l19n94[]={{sceac,1.756},{s81cf,.327},H}; -N l19n95[]={{sceb5cf81,.506},H}; -N l19n98[]={{scebbceb9,.476},{s81cf8c,.164},H}; -N l19n99[]={{s80cebf,.536},{scebacebf,.387},H}; -N l19n100[]={{scebdcf,.781},{sbbcf,.169},{scf8ecf,.290},H}; -N l19n101[]={{sceaecf,.246},H}; -N l19n103[]={{scebcceb5,.863},{sgceadce,.397},H}; -N l19n104[]={{sceb5cf84,.446},{safcebdce,.218},H}; -N l19n105[]={{sbacebf,.193},H}; -N l19n106[]={{scebece,.469},{sgceadcf,.218},H}; -N l19n107[]={{scf80ce,2.879},{sceafce,.982},H}; -N l19n108[]={{scebdceb1,1.428},{sceaccebc,.446},{sb3cf,.129},H}; -N l19n109[]={{sbccf80ce,.377},H}; -N l19n110[]={{scebc,1.994},{scf8d,.565},{sbdceb7,.179},H}; -N l19n111[]={{scead,1.339},{scf80ceac,.417},{sceaccebd,.387},H}; -N l19n112[]={{sb1ceb9g,.982},{s85cf82,.179},{safcf80,.179},H}; -N l19n113[]={{s84ceb5,.283},H}; -N l19n114[]={{sbcce,1.071},H}; -N l19n116[]={{scebbcebf,.476},H}; -N l19n118[]={{scf80cf,.759},{sceafcf,.558},{sbfcf82,.164},H}; -N l19n119[]={{sbeceb5,.164},H}; -N l19n120[]={{scebdceb5,.536},{scf80ceaf,.446},H}; -N l19n121[]={{sceb7g,1.373},{sb9ceac,.193},H}; -N l19n122[]={{sb4ce,.417},H}; -N l19n123[]={{scebfce,1.361},H}; -N l19n124[]={{scf81ce,2.053},H}; -N l19n125[]={{sb9cebace,.258},H}; -N l19n126[]={{scebdceb7,.357},H}; -N l19n127[]={{scebd,3.556},{scf8e,.417},H}; -N l19n128[]={{sceae,.610},{sceadcebd,.774},H}; -N l19n130[]={{sacce,.605},H}; -N l19n131[]={{sbccf,.258},H}; -N l19n133[]={{scebccebf,.595},H}; -N l19n134[]={{scebfcf,3.169},{s85cf84,.193},H}; -N l19n135[]={{sb9g,1.250},{s84ceb7,.640},{scf81cf,.737},{sceb7cf83,.446},H}; -N l19n136[]={{sbbcebf,.238},H}; -N l19n137[]={{sgcf80ce,.913},{sb7cf83,.223},{scebeceb5,.327},H}; -N l19n138[]={{scf80ceb5,.714},{scf89g,.636},H}; -N l19n139[]={{s83ce,.744},{sb5ceafcf,.298},{s80ceb9ce,.278},{sb4cf,.139},H}; -N l19n140[]={{sgceba,1.175},{sb5ceb9,.521},{sbdceb1g,.833},{sgcf80cf,.218},H}; -N l19n141[]={{sceb1ce,2.991},H}; -N l19n142[]={{sgce,5.436},H}; -N l19n143[]={{sb1g,1.652},{scf81ceb1,.655},H}; -N l19n144[]={{scebe,.327},{sb1cebbce,.317},H}; -N l19n145[]={{scf80,2.470},{sbdce,1.121},{sceaf,1.220},H}; -N l19n146[]={{s80ceac,.208},H}; -N l19n147[]={{saccf,.208},{sgceb1ce,.377},{sce91,.164},H}; -N l19n150[]={{sgceb1cf,.774},{scf80ceb9,.565},{sgce9ace,.317},{saccebc,.223},{scebdcebf,.417},H}; -N l19n151[]={{sbfcf85,1.414},{sgcebb,.179},H}; -N l19n152[]={{sceb1cf,2.455},{sbaceac,.298},H}; -N l19n153[]={{sb5ce,1.022},{sbcceb5g,.476},H}; -N l19n155[]={{sceb9g,2.812},H}; -N l19n156[]={{s83cf,.605},{sb1cebdg,.803},H}; -N l19n157[]={{s84ceb9,.461},H}; -N l19n158[]={{scf83ce,1.674},{sceb2ce,.558},H}; -N l19n159[]={{sgcf,2.758},{sb5cf81ce,.238},H}; -N l19n161[]={{scebf,4.181},{sadce,.486},{saccebd,.193},H}; -N l19n162[]={{scf81,1.905},{sgcebc,.803},{sbdcf,.347},{s8cce,.268},{sceafcebd,.565},H}; -N l19n163[]={{s80cf8cg,.417},{s9ccf,.119},H}; -N l19n165[]={{s84ceb1g,.446},H}; -N l19n166[]={{sb1cebdce,.278},{scebfceb9,.327},H}; -N l19n167[]={{sbccebf,.298},{scf81ceb9,.446},{sadcf81ce,.218},H}; -N l19n168[]={{scf80cebf,1.071},H}; -N l19n169[]={{scf83cf,1.361},{sgceb3ce,.258},H}; -N l19n170[]={{s84ce,2.361},{sb5cf,.694},{sgcf83ce,.377},{sb9cebfg,.387},H}; -N l19n171[]={{sb4ceb5ce,.238},H}; -N l19n173[]={{sgcf83cf,.754},{sgcebd,.268},H}; -N l19n174[]={{sb1cf80,.402},H}; -N l19n175[]={{scf84ce,5.312},{sceb3ce,.960},{s84ceb1ce,.317},{sgce9ccf,.238},H}; -N l19n176[]={{sb9ceb1,.327},{sbece,.208},H}; -N l19n177[]={{scf83ceb1,.446},H}; -N l19n178[]={{s83cf84ce,.694},{sadcf,.307},{scebfcebd,.714},{s83ceb5g,.446},H}; -N l19n179[]={{sceb1,5.282},{scf82,1.443},{s8ccf,.248},{scf84ceac,.506},{s80ceaf,.223},H}; -N l19n180[]={{sgceb4ce,.436},H}; -N l19n181[]={{sgcf84ce,1.905},H}; -N l19n183[]={{s89g,.283},H}; -N l19n184[]={{sceb1ceb9,1.042},{sb6ce,.179},{sgcf84cf,.317},{sb5cebd,.238},{sbdcf84ce,.218},H}; -N l19n185[]={{sb1cf81,.208},H}; -N l19n186[]={{scf84cf,1.049},{sceb3cf,.290},H}; -N l19n187[]={{s84cf,.466},{sbdcf84cf,.218},H}; -N l19n189[]={{scf8cg,.803},{scf83ceb5,.655},H}; -N l19n190[]={{sceacg,1.205},{sceb1cebb,.595},H}; -N l19n191[]={{sgceb5ce,.615},{s84cf8c,.164},H}; -N l19n192[]={{sceb4ce,.937},{scf85ce,.937},{sadcebd,.387},{saece,.139},H}; -N l19n193[]={{s8dce,.109},H}; -N l19n194[]={{scf84ceb1,1.131},{sbfceb9,.164},H}; -N l19n195[]={{sgcebf,.342},H}; -N l19n196[]={{scf83,2.024},{sceb1cebd,1.369},{sceb2,.461},{sb1cf82,.312},H}; -N l19n198[]={{sbdcebf,.208},H}; -N l19n201[]={{s85ce,.417},H}; -N l19n203[]={{scf85cf,.937},{sceb4cf,.312},H}; -N l19n206[]={{scf84ceb5,.565},H}; -N l19n207[]={{sbfce,.605},{sbaceb1,.744},{sb1cf83,.164},H}; -N l19n208[]={{s80cebfcf,.536},{s85cf82g,.357},H}; -N l19n209[]={{sceb5ce,2.299},{scf86ce,.424},H}; -N l19n210[]={{s8dcf,.188},H}; -N l19n211[]={{scebccf80,.625},H}; -N l19n212[]={{scf84ceb7,1.280},H}; -N l19n213[]={{scf84,4.285},{sceb3,.833},H}; -N l19n214[]={{sbfcf82g,.327},H}; -N l19n215[]={{sb7ce,.347},{sceadcf81,.357},H}; -N l19n218[]={{s85cf,.417},{scf84ceb9,.922},{sb1cf84,.238},{safcf80ce,.238},H}; -N l19n220[]={{sceb5cf,1.562},{scf86cf,.290},H}; -N l19n222[]={{s82g,1.443},{sceb5ceaf,.863},H}; -N l19n223[]={{scebdg,3.013},{s84cebf,1.101},{safce,.436},{sceb4ceb5,.417},H}; -N l19n224[]={{sbfcf,1.409},{sceaeg,.536},H}; -N l19n225[]={{sbccead,.223},H}; -N l19n226[]={{scf87ce,.603},{sceb6ce,.402},H}; -N l19n229[]={{sb1cf85,.179},H}; -N l19n230[]={{scf85,2.336},{sceb4,.833},H}; -N l19n232[]={{sb7cf,.327},{s81ceb1,.327},{s86ce,.188},{s85cebd,.179},H}; -N l19n236[]={{scf84cebf,2.202},{sb5ceb9g,.506},H}; -N l19n238[]={{sbfcebd,.357},{sbbceb1,.193},H}; -N l19n239[]={{sbfcf8d,.223},H}; -N l19n240[]={{safcf,.248},{scebdcf84,.655},H}; -N l19n241[]={{s84ceb7ce,.397},{s8ecf,.129},{sceafg,.435},H}; -N l19n243[]={{sceb7ce,.781},{sb7cf83ce,.278},H}; -N l19n244[]={{sacg,.536},{s84ceb7cf,.258},H}; -N l19n245[]={{s80ceb5,.357},H}; -N l19n246[]={{sgcebace,1.349},{sb7cebd,.357},{sb8ce,.218},{sceafcf80,.357},{sb5ceb9ce,.238},H}; -N l19n247[]={{sceb5,3.705},{sbfcf85g,1.756},{scf86,.476},{scf85cebd,.357},H}; -N l19n249[]={{s86cf,.139},H}; -N l19n252[]={{sceb5ceb9,1.042},H}; -N l19n253[]={{sgcead,.506},H}; -N l19n254[]={{sceb7cf,.737},{safcebd,.283},H}; - -D l19_d = -{ +S sceb1[] = { 206, 177, 0 }; +S scf84[] = { 207, 132, 0 }; +S scebf[] = { 206, 191, 0 }; +S sceb5[] = { 206, 181, 0 }; +S scebd[] = { 206, 189, 0 }; +S scf84ce[] = { 207, 132, 206, 0 }; +S s84ce[] = { 132, 206, 0 }; +S sceb9[] = { 206, 185, 0 }; +S scf80[] = { 207, 128, 0 }; +S scf85[] = { 207, 133, 0 }; +S sceba[] = { 206, 186, 0 }; +S sbfcf[] = { 191, 207, 0 }; +S scebfcf[] = { 206, 191, 207, 0 }; +S scf83[] = { 207, 131, 0 }; +S sb1ce[] = { 177, 206, 0 }; +S sceb1ce[] = { 206, 177, 206, 0 }; +S scebc[] = { 206, 188, 0 }; +S s80ce[] = { 128, 206, 0 }; +S scf80ce[] = { 207, 128, 206, 0 }; +S scf81[] = { 207, 129, 0 }; +S sceac[] = { 206, 172, 0 }; +S sbace[] = { 186, 206, 0 }; +S scebace[] = { 206, 186, 206, 0 }; +S sb9ce[] = { 185, 206, 0 }; +S sceb9ce[] = { 206, 185, 206, 0 }; +S sbdce[] = { 189, 206, 0 }; +S scebdce[] = { 206, 189, 206, 0 }; +S sgcf84[] = { 32, 207, 132, 0 }; +S sceb1g[] = { 206, 177, a }; +S scebb[] = { 206, 187, 0 }; +S sb1cf[] = { 177, 207, 0 }; +S sceb1cf[] = { 206, 177, 207, 0 }; +S sceb7[] = { 206, 183, 0 }; +S scebcce[] = { 206, 188, 206, 0 }; +S sbcce[] = { 188, 206, 0 }; +S sceb5ce[] = { 206, 181, 206, 0 }; +S sb5ce[] = { 181, 206, 0 }; +S scf82[] = { 207, 130, 0 }; +S scf82g[] = { 207, 130, a }; +S sgcf84ce[] = { 32, 207, 132, 206, 0 }; +S sbfcf85[] = { 191, 207, 133, 0 }; +S scebfcf85[] = { 206, 191, 207, 133, 0 }; +S scf81ce[] = { 207, 129, 206, 0 }; +S s81ce[] = { 129, 206, 0 }; +S scebdg[] = { 206, 189, a }; +S scead[] = { 206, 173, 0 }; +S scebbce[] = { 206, 187, 206, 0 }; +S sbbce[] = { 187, 206, 0 }; +S sceb9g[] = { 206, 185, a }; +S sceaf[] = { 206, 175, 0 }; +S sgceba[] = { 32, 206, 186, 0 }; +S scebfg[] = { 206, 191, a }; +S sceb5g[] = { 206, 181, a }; +S scf8c[] = { 207, 140, 0 }; +S scf83ce[] = { 207, 131, 206, 0 }; +S s83ce[] = { 131, 206, 0 }; +S scf84cebf[] = { 207, 132, 206, 191, 0 }; +S s84cebf[] = { 132, 206, 191, 0 }; +S scf85g[] = { 207, 133, a }; +S sb5cf[] = { 181, 207, 0 }; +S sceb5cf[] = { 206, 181, 207, 0 }; +S sgcebace[] = { 32, 206, 186, 206, 0 }; +S scf83cf[] = { 207, 131, 207, 0 }; +S sceacce[] = { 206, 172, 206, 0 }; +S s83cf[] = { 131, 207, 0 }; +S sbfce[] = { 191, 206, 0 }; +S scebfce[] = { 206, 191, 206, 0 }; +S sacce[] = { 172, 206, 0 }; +S sbfcf85g[] = { 191, 207, 133, a }; +S sgceb1[] = { 32, 206, 177, 0 }; +S sgcf80[] = { 32, 207, 128, 0 }; +S sgcf83[] = { 32, 207, 131, 0 }; +S sceb4[] = { 206, 180, 0 }; +S sceb3[] = { 206, 179, 0 }; +S sgcebc[] = { 32, 206, 188, 0 }; +S scebaceb1[] = { 206, 186, 206, 177, 0 }; +S scf89[] = { 207, 137, 0 }; +S sbaceb1[] = { 186, 206, 177, 0 }; +S sceadce[] = { 206, 173, 206, 0 }; +S sadce[] = { 173, 206, 0 }; +S sbdceb1[] = { 189, 206, 177, 0 }; +S scebdceb1[] = { 206, 189, 206, 177, 0 }; +S scf84cf[] = { 207, 132, 207, 0 }; +S sgcebcce[] = { 32, 206, 188, 206, 0 }; +S s84cf[] = { 132, 207, 0 }; +S sceb1cebd[] = { 206, 177, 206, 189, 0 }; +S sgcf80ce[] = { 32, 207, 128, 206, 0 }; +S sb1cebd[] = { 177, 206, 189, 0 }; +S safce[] = { 175, 206, 0 }; +S sceafce[] = { 206, 175, 206, 0 }; +S sceb3ce[] = { 206, 179, 206, 0 }; +S scf84ceb7[] = { 207, 132, 206, 183, 0 }; +S s84ceb7[] = { 132, 206, 183, 0 }; +S sb3ce[] = { 179, 206, 0 }; +S sceb4ce[] = { 206, 180, 206, 0 }; +S s85ce[] = { 133, 206, 0 }; +S scf85cf[] = { 207, 133, 207, 0 }; +S scf85ce[] = { 207, 133, 206, 0 }; +S sb4ce[] = { 180, 206, 0 }; +S s85cf[] = { 133, 207, 0 }; +S sgceb5[] = { 32, 206, 181, 0 }; +S sceb7g[] = { 206, 183, a }; +S sceae[] = { 206, 174, 0 }; +S s84cebfcf[] = { 132, 206, 191, 207, 0 }; +S sgceb1cf[] = { 32, 206, 177, 207, 0 }; +S s84ceb1[] = { 132, 206, 177, 0 }; +S scf8d[] = { 207, 141, 0 }; +S scf83cf84[] = { 207, 131, 207, 132, 0 }; +S s83cf84[] = { 131, 207, 132, 0 }; +S sgcf83cf[] = { 32, 207, 131, 207, 0 }; +S scf84ceb1[] = { 207, 132, 206, 177, 0 }; +S scf87[] = { 207, 135, 0 }; +S s80cebf[] = { 128, 206, 191, 0 }; +S sceacg[] = { 206, 172, a }; +S scf80cebf[] = { 207, 128, 206, 191, 0 }; +S sbaceb1ce[] = { 186, 206, 177, 206, 0 }; +S sb7ce[] = { 183, 206, 0 }; +S sceb7ce[] = { 206, 183, 206, 0 }; +S scebdcf[] = { 206, 189, 207, 0 }; +S s83cf84ce[] = { 131, 207, 132, 206, 0 }; +S sceb5ceb9[] = { 206, 181, 206, 185, 0 }; +S sb5ceb9[] = { 181, 206, 185, 0 }; +S sbdcf[] = { 189, 207, 0 }; +S sb1ceb9[] = { 177, 206, 185, 0 }; +S sceb1ceb9[] = { 206, 177, 206, 185, 0 }; +S scf80cf[] = { 207, 128, 207, 0 }; +S sgcead[] = { 32, 206, 173, 0 }; +S s80cf[] = { 128, 207, 0 }; +S sceb7cf[] = { 206, 183, 207, 0 }; +S sb7cf[] = { 183, 207, 0 }; +S scf81cf[] = { 207, 129, 207, 0 }; +S sb1ceb9g[] = { 177, 206, 185, a }; +S s81cf[] = { 129, 207, 0 }; +S scf86[] = { 207, 134, 0 }; +S s84ceb9[] = { 132, 206, 185, 0 }; +S sadcf[] = { 173, 207, 0 }; +S scf84ceb9[] = { 207, 132, 206, 185, 0 }; +S sb9cf[] = { 185, 207, 0 }; +S sceb9cf[] = { 206, 185, 207, 0 }; +S sceb2[] = { 206, 178, 0 }; +S sgceb5ce[] = { 32, 206, 181, 206, 0 }; +S sceadcf[] = { 206, 173, 207, 0 }; +S sgceb4[] = { 32, 206, 180, 0 }; +S sceb8[] = { 206, 184, 0 }; +S sceb5ceaf[] = { 206, 181, 206, 175, 0 }; +S sbcceb5[] = { 188, 206, 181, 0 }; +S sb5ceaf[] = { 181, 206, 175, 0 }; +S scebcceb5[] = { 206, 188, 206, 181, 0 }; +S sb9cebf[] = { 185, 206, 191, 0 }; +S sceb9cebf[] = { 206, 185, 206, 191, 0 }; +S sbdceb1g[] = { 189, 206, 177, a }; +S scf8e[] = { 207, 142, 0 }; +S s87ce[] = { 135, 206, 0 }; +S sb1cf80[] = { 177, 207, 128, 0 }; +S s8cce[] = { 140, 206, 0 }; +S scf87ce[] = { 207, 135, 206, 0 }; +S sceb1cf80[] = { 206, 177, 207, 128, 0 }; +S scf8cce[] = { 207, 140, 206, 0 }; +S sb1cebdg[] = { 177, 206, 189, a }; +S s80cebfcf[] = { 128, 206, 191, 207, 0 }; +S sbccf[] = { 188, 207, 0 }; +S s84cebfg[] = { 132, 206, 191, a }; +S sceadcebd[] = { 206, 173, 206, 189, 0 }; +S sadcebd[] = { 173, 206, 189, 0 }; +S scebccf[] = { 206, 188, 207, 0 }; +S safcf[] = { 175, 207, 0 }; +S s8ccf[] = { 140, 207, 0 }; +S sb2ce[] = { 178, 206, 0 }; +S sceafcf[] = { 206, 175, 207, 0 }; +S sceb2ce[] = { 206, 178, 206, 0 }; +S sadcebdce[] = { 173, 206, 189, 206, 0 }; +S scf8ccf[] = { 207, 140, 207, 0 }; +S s8cg[] = { 140, a }; +S scf8cg[] = { 207, 140, a }; +S scebfcebd[] = { 206, 191, 206, 189, 0 }; +S s80ceb5[] = { 128, 206, 181, 0 }; +S sceb7cebd[] = { 206, 183, 206, 189, 0 }; +S scf80ceb5[] = { 207, 128, 206, 181, 0 }; +S sbfcebd[] = { 191, 206, 189, 0 }; +S sb7cebd[] = { 183, 206, 189, 0 }; +S sb7cebdg[] = { 183, 206, 189, a }; +S sgcebf[] = { 32, 206, 191, 0 }; +S scf81ceb1[] = { 207, 129, 206, 177, 0 }; +S sceb8ce[] = { 206, 184, 206, 0 }; +S sgceb3[] = { 32, 206, 179, 0 }; +S sb8ce[] = { 184, 206, 0 }; +S sceb9ceb1[] = { 206, 185, 206, 177, 0 }; +S scebe[] = { 206, 190, 0 }; +S scebdcf84[] = { 206, 189, 207, 132, 0 }; +S sb9ceb1[] = { 185, 206, 177, 0 }; +S s81ceb1[] = { 129, 206, 177, 0 }; +S sceb6[] = { 206, 182, 0 }; +S sgceb4ce[] = { 32, 206, 180, 206, 0 }; +S sbdcf84[] = { 189, 207, 132, 0 }; +S scf83ceb5[] = { 207, 131, 206, 181, 0 }; +S s83ceb5[] = { 131, 206, 181, 0 }; +S saccf[] = { 172, 207, 0 }; +S sb1cf82[] = { 177, 207, 130, 0 }; +S sceb1cf82[] = { 206, 177, 207, 130, 0 }; +S sceaccf[] = { 206, 172, 207, 0 }; +S scebece[] = { 206, 190, 206, 0 }; +S sbccf80[] = { 188, 207, 128, 0 }; +S s89cf[] = { 137, 207, 0 }; +S sb1cf82g[] = { 177, 207, 130, a }; +S scebccf80[] = { 206, 188, 207, 128, 0 }; +S sbece[] = { 190, 206, 0 }; +S scebaceac[] = { 206, 186, 206, 172, 0 }; +S sb1cebb[] = { 177, 206, 187, 0 }; +S scebacf[] = { 206, 186, 207, 0 }; +S sceb1cebb[] = { 206, 177, 206, 187, 0 }; +S s84ceb7ce[] = { 132, 206, 183, 206, 0 }; +S scebccebf[] = { 206, 188, 206, 191, 0 }; +S sbccebf[] = { 188, 206, 191, 0 }; +S sbaceac[] = { 186, 206, 172, 0 }; +S scf89cf[] = { 207, 137, 207, 0 }; +S sgceadce[] = { 32, 206, 173, 206, 0 }; +S scf86ce[] = { 207, 134, 206, 0 }; +S scf80ceb9[] = { 207, 128, 206, 185, 0 }; +S sb9ceba[] = { 185, 206, 186, 0 }; +S s86ce[] = { 134, 206, 0 }; +S safcebd[] = { 175, 206, 189, 0 }; +S s8dcf[] = { 141, 207, 0 }; +S scf89g[] = { 207, 137, a }; +S sgce9c[] = { 32, 206, 156, 0 }; +S sbfcf85ce[] = { 191, 207, 133, 206, 0 }; +S scf8dcf[] = { 207, 141, 207, 0 }; +S s80ceb9[] = { 128, 206, 185, 0 }; +S sce9c[] = { 206, 156, 0 }; +S sbccf80ce[] = { 188, 207, 128, 206, 0 }; +S sceb9ceba[] = { 206, 185, 206, 186, 0 }; +S sgceb1ce[] = { 32, 206, 177, 206, 0 }; +S scf84ceb5[] = { 207, 132, 206, 181, 0 }; +S sgcf83ce[] = { 32, 207, 131, 206, 0 }; +S s84ceb5[] = { 132, 206, 181, 0 }; +S sceafcebd[] = { 206, 175, 206, 189, 0 }; +S scebdceb5[] = { 206, 189, 206, 181, 0 }; +S s80cf8c[] = { 128, 207, 140, 0 }; +S sceb6ce[] = { 206, 182, 206, 0 }; +S scebcceb1[] = { 206, 188, 206, 177, 0 }; +S sce9a[] = { 206, 154, 0 }; +S sbdceb5[] = { 189, 206, 181, 0 }; +S sgcebd[] = { 32, 206, 189, 0 }; +S scf80cf8c[] = { 207, 128, 207, 140, 0 }; +S sbcceb1[] = { 188, 206, 177, 0 }; +S sb6ce[] = { 182, 206, 0 }; +S sbfcf85cf[] = { 191, 207, 133, 207, 0 }; +S sb9ceb1g[] = { 185, 206, 177, a }; +S s84ceac[] = { 132, 206, 172, 0 }; +S sceb5cf81[] = { 206, 181, 207, 129, 0 }; +S scf84ceac[] = { 207, 132, 206, 172, 0 }; +S s9ace[] = { 154, 206, 0 }; +S sgce9a[] = { 32, 206, 154, 0 }; +S sb5cf81[] = { 181, 207, 129, 0 }; +S sce9ace[] = { 206, 154, 206, 0 }; +S scebbcf[] = { 206, 187, 207, 0 }; +S sb5ceb9g[] = { 181, 206, 185, a }; +S sbbcf[] = { 187, 207, 0 }; +S sb1cebbce[] = { 177, 206, 187, 206, 0 }; +S scebbcebf[] = { 206, 187, 206, 191, 0 }; +S sceaeg[] = { 206, 174, a }; +S scebbceb9[] = { 206, 187, 206, 185, 0 }; +S sgcf84cf[] = { 32, 207, 132, 207, 0 }; +S sgcebdce[] = { 32, 206, 189, 206, 0 }; +S sbbcebf[] = { 187, 206, 191, 0 }; +S sbbceb9[] = { 187, 206, 185, 0 }; +S sgcebfg[] = { 32, 206, 191, a }; +S sb1cf84[] = { 177, 207, 132, 0 }; +S sbcceb5g[] = { 188, 206, 181, a }; +S s84ceb9ce[] = { 132, 206, 185, 206, 0 }; +S s84ceb1ce[] = { 132, 206, 177, 206, 0 }; +S sgce9ace[] = { 32, 206, 154, 206, 0 }; +S sb5cebd[] = { 181, 206, 189, 0 }; +S sceb5cebd[] = { 206, 181, 206, 189, 0 }; +S sb1cf84ce[] = { 177, 207, 132, 206, 0 }; +S sceb1cf84[] = { 206, 177, 207, 132, 0 }; +S scf83ceb1[] = { 207, 131, 206, 177, 0 }; +S sb5ceafcf[] = { 181, 206, 175, 207, 0 }; +S s80ceaf[] = { 128, 206, 175, 0 }; +S s81ceb9[] = { 129, 206, 185, 0 }; +S scf81ceb9[] = { 207, 129, 206, 185, 0 }; +S s83ceb1[] = { 131, 206, 177, 0 }; +S sb5cf84[] = { 181, 207, 132, 0 }; +S sbfcf8d[] = { 191, 207, 141, 0 }; +S s83ceb5g[] = { 131, 206, 181, a }; +S s84ceb1g[] = { 132, 206, 177, a }; +S sbccead[] = { 188, 206, 173, 0 }; +S sceb7cf83[] = { 206, 183, 207, 131, 0 }; +S saccebc[] = { 172, 206, 188, 0 }; +S sb7cf83[] = { 183, 207, 131, 0 }; +S scebccead[] = { 206, 188, 206, 173, 0 }; +S scf80ceaf[] = { 207, 128, 206, 175, 0 }; +S scebfcf8d[] = { 206, 191, 207, 141, 0 }; +S sceaccebc[] = { 206, 172, 206, 188, 0 }; +S sceb5cf84[] = { 206, 181, 207, 132, 0 }; +S sb1cf80cf[] = { 177, 207, 128, 207, 0 }; +S sceb4ceb5[] = { 206, 180, 206, 181, 0 }; +S saece[] = { 174, 206, 0 }; +S s86cf[] = { 134, 207, 0 }; +S scebdcebf[] = { 206, 189, 206, 191, 0 }; +S sb1cf81[] = { 177, 207, 129, 0 }; +S sceb1cf81[] = { 206, 177, 207, 129, 0 }; +S sbdcebf[] = { 189, 206, 191, 0 }; +S s80ceb9ce[] = { 128, 206, 185, 206, 0 }; +S sceb4cf[] = { 206, 180, 207, 0 }; +S scf80ceac[] = { 207, 128, 206, 172, 0 }; +S sbfcebdg[] = { 191, 206, 189, a }; +S sceaece[] = { 206, 174, 206, 0 }; +S s80cf8cg[] = { 128, 207, 140, a }; +S sb1cebdce[] = { 177, 206, 189, 206, 0 }; +S s80ceac[] = { 128, 206, 172, 0 }; +S sb4ceb5[] = { 180, 206, 181, 0 }; +S sb4cf[] = { 180, 207, 0 }; +S sb5cebdg[] = { 181, 206, 189, a }; +S sb7cf83ce[] = { 183, 207, 131, 206, 0 }; +S scebbceb1[] = { 206, 187, 206, 177, 0 }; +S scf86cf[] = { 207, 134, 207, 0 }; +S saccebd[] = { 172, 206, 189, 0 }; +S sbacebf[] = { 186, 206, 191, 0 }; +S s8ecf[] = { 142, 207, 0 }; +S scebacebf[] = { 206, 186, 206, 191, 0 }; +S sbbceb1[] = { 187, 206, 177, 0 }; +S sceb3cf[] = { 206, 179, 207, 0 }; +S s84ceb7cf[] = { 132, 206, 183, 207, 0 }; +S s85cf84[] = { 133, 207, 132, 0 }; +S sb9cebfg[] = { 185, 206, 191, a }; +S sceaccebd[] = { 206, 172, 206, 189, 0 }; +S scf8ecf[] = { 207, 142, 207, 0 }; +S sb3cf[] = { 179, 207, 0 }; +S sceb9ceac[] = { 206, 185, 206, 172, 0 }; +S sb9cebace[] = { 185, 206, 186, 206, 0 }; +S sgceb3ce[] = { 32, 206, 179, 206, 0 }; +S scf85cf84[] = { 207, 133, 207, 132, 0 }; +S sbccebfcf[] = { 188, 206, 191, 207, 0 }; +S sb9ceac[] = { 185, 206, 172, 0 }; +S sceafg[] = { 206, 175, a }; +S sceb1cf85[] = { 206, 177, 207, 133, 0 }; +S safcf80ce[] = { 175, 207, 128, 206, 0 }; +S s85cf82[] = { 133, 207, 130, 0 }; +S s85cf82g[] = { 133, 207, 130, a }; +S sceafcf80[] = { 206, 175, 207, 128, 0 }; +S sgce9ccf[] = { 32, 206, 156, 207, 0 }; +S sbdceb7[] = { 189, 206, 183, 0 }; +S scebdceb7[] = { 206, 189, 206, 183, 0 }; +S s85cebd[] = { 133, 206, 189, 0 }; +S sb1cf85[] = { 177, 207, 133, 0 }; +S s9ccf[] = { 156, 207, 0 }; +S scf85cf82[] = { 207, 133, 207, 130, 0 }; +S sb5ceb9ce[] = { 181, 206, 185, 206, 0 }; +S scf85cebd[] = { 207, 133, 206, 189, 0 }; +S sceadcf81[] = { 206, 173, 207, 129, 0 }; +S safcf80[] = { 175, 207, 128, 0 }; +S s81ceb1g[] = { 129, 206, 177, a }; +S sb5cf81ce[] = { 181, 207, 129, 206, 0 }; +S sce9ccf[] = { 206, 156, 207, 0 }; +S sgcebb[] = { 32, 206, 187, 0 }; +S sb4ceb5ce[] = { 180, 206, 181, 206, 0 }; +S sadcf81[] = { 173, 207, 129, 0 }; +S sbdcf84ce[] = { 189, 207, 132, 206, 0 }; +S scf81cf8c[] = { 207, 129, 207, 140, 0 }; +S sbfceb9[] = { 191, 206, 185, 0 }; +S sb1cf85cf[] = { 177, 207, 133, 207, 0 }; +S sceaecf[] = { 206, 174, 207, 0 }; +S sbdcf84cf[] = { 189, 207, 132, 207, 0 }; +S sgcebbce[] = { 32, 206, 187, 206, 0 }; +S scebaceb9[] = { 206, 186, 206, 185, 0 }; +S scebeceb5[] = { 206, 190, 206, 181, 0 }; +S sbfcf82g[] = { 191, 207, 130, a }; +S safcebdce[] = { 175, 206, 189, 206, 0 }; +S s89ce[] = { 137, 206, 0 }; +S s8dce[] = { 141, 206, 0 }; +S sbeceb5[] = { 190, 206, 181, 0 }; +S s81cf8c[] = { 129, 207, 140, 0 }; +S sbbceb5[] = { 187, 206, 181, 0 }; +S sceb1cf83[] = { 206, 177, 207, 131, 0 }; +S sgceadcf[] = { 32, 206, 173, 207, 0 }; +S sgcf80cf[] = { 32, 207, 128, 207, 0 }; +S scebfceb9[] = { 206, 191, 206, 185, 0 }; +S sbaceb9[] = { 186, 206, 185, 0 }; +S sb1cf83[] = { 177, 207, 131, 0 }; +S sgceb2[] = { 32, 206, 178, 0 }; +S sce91[] = { 206, 145, 0 }; +S s84cf8c[] = { 132, 207, 140, 0 }; +S scebbceb5[] = { 206, 187, 206, 181, 0 }; +S sbfcf82[] = { 191, 207, 130, 0 }; +S sadcf81ce[] = { 173, 207, 129, 206, 0 }; + +N l19n1[] = { { scebfg, 2.611 }, { sbfcf85ce, .377 }, { sgcebbce, .218 }, H }; +N l19n3[] = { { sbdg, 1.339 }, { sbccf80, .312 }, H }; +N l19n4[] = { { sceb8ce, .491 }, { sbfcf85cf, .337 }, H }; +N l19n6[] = { { sce9ace, .379 }, H }; +N l19n7[] = { { s87ce, .268 }, { s84ceb9ce, .317 }, H }; +N l19n8[] = { { scf87, .551 }, { sceb6, .327 }, { sceb5cebd, .476 }, H }; +N l19n11[] = { { sb5g, 1.131 }, H }; +N l19n12[] = { { sgcebcce, .932 }, H }; +N l19n13[] = { { sbcceb1, .268 }, H }; +N l19n14[] = { { s84ceac, .253 }, H }; +N l19n15[] = { { scf89cf, .446 }, H }; +N l19n16[] = { { sb1ceb9, .521 }, { sb9ceb1g, .506 }, H }; +N l19n19[] = { { sceb1g, 3.716 }, { scf82g, 3.247 }, { sb9ceba, .283 }, H }; +N l19n20[] = { { s8cg, .357 }, { sbccebfcf, .258 }, H }; +N l19n21[] = { { sb9ce, 1.141 }, { sceb9ce, 2.567 }, { scebfcf85, 2.827 }, H }; +N l19n23[] = { { sgcebdce, .317 }, H }; +N l19n24[] = { { sceb1cf80, .803 }, { sb5cebdg, .417 }, H }; +N l19n25[] = { { sceb7, 1.622 }, { sceb9ceac, .387 }, H }; +N l19n26[] = { { scf80cf8c, .536 }, { sbbceb5, .164 }, H }; +N l19n27[] = { { sb1cf80cf, .298 }, { sceb1cf81, .417 }, H }; +N l19n29[] = { { sb1ce, 1.329 }, H }; +N l19n30[] = { { sb5ceaf, .431 }, { sceb1cf82, .625 }, H }; +N l19n31[] = { { sgcf80, .848 }, H }; +N l19n32[] = { { sceb9cf, .692 }, H }; +N l19n33[] = { { s80ceb9, .283 }, { sceb1cf83, .327 }, H }; +N l19n35[] = { { sgcebfg, .317 }, H }; +N l19n36[] = { { sb1cf82g, .625 }, { sceb1cf84, .476 }, H }; +N l19n38[] = { { scebace, 2.611 }, { sb9cf, .307 }, { sb1cebb, .298 }, { s83ceb1, .223 }, H }; +N l19n39[] = { { sceb1cf85, .357 }, { sbaceb9, .164 }, H }; +N l19n40[] = { { sceb9ceb1, .655 }, H }; +N l19n41[] = { { sgceb1, .878 }, H }; +N l19n42[] = { { scf89, .744 }, { sceb8, .446 }, { sadcebdce, .476 }, { sceb7cebd, .714 }, { scebaceac, .595 }, H }; +N l19n43[] = { { scf81cf8c, .327 }, H }; +N l19n44[] = { { sbdceb1, .714 }, { sce9a, .268 }, { sgce9a, .253 }, H }; +N l19n45[] = { { scebfcf8d, .446 }, H }; +N l19n46[] = { { s80ce, 1.280 }, { sb1cf, 1.091 }, H }; +N l19n49[] = { { scebacf, .446 }, H }; +N l19n50[] = { { saeg, .238 }, H }; +N l19n51[] = { { sce9ccf, .268 }, H }; +N l19n52[] = { { sbace, 1.161 }, { sgceb2, .164 }, H }; +N l19n53[] = { { scf83cf84, 1.131 }, { sb5cf81, .253 }, H }; +N l19n55[] = { { scebbce, 1.986 }, { scf8cce, .603 }, H }; +N l19n56[] = { { sceacce, 1.361 }, H }; +N l19n57[] = { { scebaceb1, 1.488 }, { sbaceb1ce, .714 }, { sbcceb5, .431 }, H }; +N l19n59[] = { { sceb9, 3.437 }, { s85g, 1.086 }, H }; +N l19n60[] = { { sb1cebd, .684 }, { sb2ce, .248 }, H }; +N l19n61[] = { { sadcf81, .179 }, H }; +N l19n63[] = { { s80cf, .337 }, { s84cebfg, .774 }, { sgceb3, .327 }, H }; +N l19n64[] = { { sgcf83, .848 }, { s81ceb9, .223 }, H }; +N l19n65[] = { { sbfg, 1.161 }, { sb4ceb5, .208 }, H }; +N l19n66[] = { { scf8ccf, .536 }, { sgce9c, .283 }, { scebbcf, .379 }, H }; +N l19n67[] = { { sceaccf, .469 }, { sceb9ceba, .565 }, { s80cf8c, .268 }, H }; +N l19n68[] = { { sb1cf84ce, .317 }, H }; +N l19n69[] = { { s84ceb1, .565 }, { sbacf, .198 }, { s89ce, .109 }, H }; +N l19n70[] = { { scf85g, 2.444 }, { sbbceb9, .238 }, H }; +N l19n72[] = { { scebcce, 2.410 }, { s83cf84, .565 }, { s81ceb1g, .357 }, H }; +N l19n73[] = { { sceadce, 1.094 }, { sb7g, .610 }, H }; +N l19n74[] = { { sgceb4, .446 }, { sb9cebf, .417 }, { scebbceb1, .387 }, H }; +N l19n75[] = { { sgcf84, 1.666 }, H }; +N l19n76[] = { { sceba, 2.143 }, { s84cebfcf, .794 }, H }; +N l19n77[] = { { s81ce, .913 }, H }; +N l19n78[] = { { sbdcf84, .327 }, { sce9c, .283 }, { sbfcebdg, .417 }, H }; +N l19n79[] = { { scebccead, .446 }, H }; +N l19n81[] = { { safg, .193 }, { scf85cf82, .357 }, { scebaceb9, .327 }, H }; +N l19n82[] = { { sceb9cebf, .833 }, { s83ceb5, .327 }, { sb1cf85cf, .218 }, H }; +N l19n83[] = { { sbbce, .883 }, { scebccf, .580 }, { scf8dcf, .424 }, H }; +N l19n84[] = { { sceadcf, .692 }, { s9ace, .169 }, H }; +N l19n85[] = { { sgceb5, .610 }, H }; +N l19n86[] = { { sb7cebdg, .684 }, { s89cf, .208 }, { sb5cf84, .223 }, { scebbceb5, .327 }, H }; +N l19n87[] = { { sceb5g, 2.544 }, { scf85cf84, .387 }, H }; +N l19n88[] = { { sbdceb5, .268 }, H }; +N l19n89[] = { { scebdce, 2.522 }, H }; +N l19n90[] = { { sceaece, .312 }, H }; +N l19n91[] = { { sb3ce, .427 }, { scebcceb1, .536 }, H }; +N l19n93[] = { { scebb, 1.652 }, { scf8c, 1.116 }, H }; +N l19n94[] = { { sceac, 1.756 }, { s81cf, .327 }, H }; +N l19n95[] = { { sceb5cf81, .506 }, H }; +N l19n98[] = { { scebbceb9, .476 }, { s81cf8c, .164 }, H }; +N l19n99[] = { { s80cebf, .536 }, { scebacebf, .387 }, H }; +N l19n100[] = { { scebdcf, .781 }, { sbbcf, .169 }, { scf8ecf, .290 }, H }; +N l19n101[] = { { sceaecf, .246 }, H }; +N l19n103[] = { { scebcceb5, .863 }, { sgceadce, .397 }, H }; +N l19n104[] = { { sceb5cf84, .446 }, { safcebdce, .218 }, H }; +N l19n105[] = { { sbacebf, .193 }, H }; +N l19n106[] = { { scebece, .469 }, { sgceadcf, .218 }, H }; +N l19n107[] = { { scf80ce, 2.879 }, { sceafce, .982 }, H }; +N l19n108[] = { { scebdceb1, 1.428 }, { sceaccebc, .446 }, { sb3cf, .129 }, H }; +N l19n109[] = { { sbccf80ce, .377 }, H }; +N l19n110[] = { { scebc, 1.994 }, { scf8d, .565 }, { sbdceb7, .179 }, H }; +N l19n111[] = { { scead, 1.339 }, { scf80ceac, .417 }, { sceaccebd, .387 }, H }; +N l19n112[] = { { sb1ceb9g, .982 }, { s85cf82, .179 }, { safcf80, .179 }, H }; +N l19n113[] = { { s84ceb5, .283 }, H }; +N l19n114[] = { { sbcce, 1.071 }, H }; +N l19n116[] = { { scebbcebf, .476 }, H }; +N l19n118[] = { { scf80cf, .759 }, { sceafcf, .558 }, { sbfcf82, .164 }, H }; +N l19n119[] = { { sbeceb5, .164 }, H }; +N l19n120[] = { { scebdceb5, .536 }, { scf80ceaf, .446 }, H }; +N l19n121[] = { { sceb7g, 1.373 }, { sb9ceac, .193 }, H }; +N l19n122[] = { { sb4ce, .417 }, H }; +N l19n123[] = { { scebfce, 1.361 }, H }; +N l19n124[] = { { scf81ce, 2.053 }, H }; +N l19n125[] = { { sb9cebace, .258 }, H }; +N l19n126[] = { { scebdceb7, .357 }, H }; +N l19n127[] = { { scebd, 3.556 }, { scf8e, .417 }, H }; +N l19n128[] = { { sceae, .610 }, { sceadcebd, .774 }, H }; +N l19n130[] = { { sacce, .605 }, H }; +N l19n131[] = { { sbccf, .258 }, H }; +N l19n133[] = { { scebccebf, .595 }, H }; +N l19n134[] = { { scebfcf, 3.169 }, { s85cf84, .193 }, H }; +N l19n135[] = { { sb9g, 1.250 }, { s84ceb7, .640 }, { scf81cf, .737 }, { sceb7cf83, .446 }, H }; +N l19n136[] = { { sbbcebf, .238 }, H }; +N l19n137[] = { { sgcf80ce, .913 }, { sb7cf83, .223 }, { scebeceb5, .327 }, H }; +N l19n138[] = { { scf80ceb5, .714 }, { scf89g, .636 }, H }; +N l19n139[] = { { s83ce, .744 }, { sb5ceafcf, .298 }, { s80ceb9ce, .278 }, { sb4cf, .139 }, H }; +N l19n140[] = { { sgceba, 1.175 }, { sb5ceb9, .521 }, { sbdceb1g, .833 }, { sgcf80cf, .218 }, H }; +N l19n141[] = { { sceb1ce, 2.991 }, H }; +N l19n142[] = { { sgce, 5.436 }, H }; +N l19n143[] = { { sb1g, 1.652 }, { scf81ceb1, .655 }, H }; +N l19n144[] = { { scebe, .327 }, { sb1cebbce, .317 }, H }; +N l19n145[] = { { scf80, 2.470 }, { sbdce, 1.121 }, { sceaf, 1.220 }, H }; +N l19n146[] = { { s80ceac, .208 }, H }; +N l19n147[] = { { saccf, .208 }, { sgceb1ce, .377 }, { sce91, .164 }, H }; +N l19n150[] = { { sgceb1cf, .774 }, { scf80ceb9, .565 }, { sgce9ace, .317 }, { saccebc, .223 }, { scebdcebf, .417 }, H }; +N l19n151[] = { { sbfcf85, 1.414 }, { sgcebb, .179 }, H }; +N l19n152[] = { { sceb1cf, 2.455 }, { sbaceac, .298 }, H }; +N l19n153[] = { { sb5ce, 1.022 }, { sbcceb5g, .476 }, H }; +N l19n155[] = { { sceb9g, 2.812 }, H }; +N l19n156[] = { { s83cf, .605 }, { sb1cebdg, .803 }, H }; +N l19n157[] = { { s84ceb9, .461 }, H }; +N l19n158[] = { { scf83ce, 1.674 }, { sceb2ce, .558 }, H }; +N l19n159[] = { { sgcf, 2.758 }, { sb5cf81ce, .238 }, H }; +N l19n161[] = { { scebf, 4.181 }, { sadce, .486 }, { saccebd, .193 }, H }; +N l19n162[] = { { scf81, 1.905 }, { sgcebc, .803 }, { sbdcf, .347 }, { s8cce, .268 }, { sceafcebd, .565 }, H }; +N l19n163[] = { { s80cf8cg, .417 }, { s9ccf, .119 }, H }; +N l19n165[] = { { s84ceb1g, .446 }, H }; +N l19n166[] = { { sb1cebdce, .278 }, { scebfceb9, .327 }, H }; +N l19n167[] = { { sbccebf, .298 }, { scf81ceb9, .446 }, { sadcf81ce, .218 }, H }; +N l19n168[] = { { scf80cebf, 1.071 }, H }; +N l19n169[] = { { scf83cf, 1.361 }, { sgceb3ce, .258 }, H }; +N l19n170[] = { { s84ce, 2.361 }, { sb5cf, .694 }, { sgcf83ce, .377 }, { sb9cebfg, .387 }, H }; +N l19n171[] = { { sb4ceb5ce, .238 }, H }; +N l19n173[] = { { sgcf83cf, .754 }, { sgcebd, .268 }, H }; +N l19n174[] = { { sb1cf80, .402 }, H }; +N l19n175[] = { { scf84ce, 5.312 }, { sceb3ce, .960 }, { s84ceb1ce, .317 }, { sgce9ccf, .238 }, H }; +N l19n176[] = { { sb9ceb1, .327 }, { sbece, .208 }, H }; +N l19n177[] = { { scf83ceb1, .446 }, H }; +N l19n178[] = { { s83cf84ce, .694 }, { sadcf, .307 }, { scebfcebd, .714 }, { s83ceb5g, .446 }, H }; +N l19n179[] = { { sceb1, 5.282 }, { scf82, 1.443 }, { s8ccf, .248 }, { scf84ceac, .506 }, { s80ceaf, .223 }, H }; +N l19n180[] = { { sgceb4ce, .436 }, H }; +N l19n181[] = { { sgcf84ce, 1.905 }, H }; +N l19n183[] = { { s89g, .283 }, H }; +N l19n184[] = { { sceb1ceb9, 1.042 }, { sb6ce, .179 }, { sgcf84cf, .317 }, { sb5cebd, .238 }, { sbdcf84ce, .218 }, H }; +N l19n185[] = { { sb1cf81, .208 }, H }; +N l19n186[] = { { scf84cf, 1.049 }, { sceb3cf, .290 }, H }; +N l19n187[] = { { s84cf, .466 }, { sbdcf84cf, .218 }, H }; +N l19n189[] = { { scf8cg, .803 }, { scf83ceb5, .655 }, H }; +N l19n190[] = { { sceacg, 1.205 }, { sceb1cebb, .595 }, H }; +N l19n191[] = { { sgceb5ce, .615 }, { s84cf8c, .164 }, H }; +N l19n192[] = { { sceb4ce, .937 }, { scf85ce, .937 }, { sadcebd, .387 }, { saece, .139 }, H }; +N l19n193[] = { { s8dce, .109 }, H }; +N l19n194[] = { { scf84ceb1, 1.131 }, { sbfceb9, .164 }, H }; +N l19n195[] = { { sgcebf, .342 }, H }; +N l19n196[] = { { scf83, 2.024 }, { sceb1cebd, 1.369 }, { sceb2, .461 }, { sb1cf82, .312 }, H }; +N l19n198[] = { { sbdcebf, .208 }, H }; +N l19n201[] = { { s85ce, .417 }, H }; +N l19n203[] = { { scf85cf, .937 }, { sceb4cf, .312 }, H }; +N l19n206[] = { { scf84ceb5, .565 }, H }; +N l19n207[] = { { sbfce, .605 }, { sbaceb1, .744 }, { sb1cf83, .164 }, H }; +N l19n208[] = { { s80cebfcf, .536 }, { s85cf82g, .357 }, H }; +N l19n209[] = { { sceb5ce, 2.299 }, { scf86ce, .424 }, H }; +N l19n210[] = { { s8dcf, .188 }, H }; +N l19n211[] = { { scebccf80, .625 }, H }; +N l19n212[] = { { scf84ceb7, 1.280 }, H }; +N l19n213[] = { { scf84, 4.285 }, { sceb3, .833 }, H }; +N l19n214[] = { { sbfcf82g, .327 }, H }; +N l19n215[] = { { sb7ce, .347 }, { sceadcf81, .357 }, H }; +N l19n218[] = { { s85cf, .417 }, { scf84ceb9, .922 }, { sb1cf84, .238 }, { safcf80ce, .238 }, H }; +N l19n220[] = { { sceb5cf, 1.562 }, { scf86cf, .290 }, H }; +N l19n222[] = { { s82g, 1.443 }, { sceb5ceaf, .863 }, H }; +N l19n223[] = { { scebdg, 3.013 }, { s84cebf, 1.101 }, { safce, .436 }, { sceb4ceb5, .417 }, H }; +N l19n224[] = { { sbfcf, 1.409 }, { sceaeg, .536 }, H }; +N l19n225[] = { { sbccead, .223 }, H }; +N l19n226[] = { { scf87ce, .603 }, { sceb6ce, .402 }, H }; +N l19n229[] = { { sb1cf85, .179 }, H }; +N l19n230[] = { { scf85, 2.336 }, { sceb4, .833 }, H }; +N l19n232[] = { { sb7cf, .327 }, { s81ceb1, .327 }, { s86ce, .188 }, { s85cebd, .179 }, H }; +N l19n236[] = { { scf84cebf, 2.202 }, { sb5ceb9g, .506 }, H }; +N l19n238[] = { { sbfcebd, .357 }, { sbbceb1, .193 }, H }; +N l19n239[] = { { sbfcf8d, .223 }, H }; +N l19n240[] = { { safcf, .248 }, { scebdcf84, .655 }, H }; +N l19n241[] = { { s84ceb7ce, .397 }, { s8ecf, .129 }, { sceafg, .435 }, H }; +N l19n243[] = { { sceb7ce, .781 }, { sb7cf83ce, .278 }, H }; +N l19n244[] = { { sacg, .536 }, { s84ceb7cf, .258 }, H }; +N l19n245[] = { { s80ceb5, .357 }, H }; +N l19n246[] = { { sgcebace, 1.349 }, { sb7cebd, .357 }, { sb8ce, .218 }, { sceafcf80, .357 }, { sb5ceb9ce, .238 }, H }; +N l19n247[] = { { sceb5, 3.705 }, { sbfcf85g, 1.756 }, { scf86, .476 }, { scf85cebd, .357 }, H }; +N l19n249[] = { { s86cf, .139 }, H }; +N l19n252[] = { { sceb5ceb9, 1.042 }, H }; +N l19n253[] = { { sgcead, .506 }, H }; +N l19n254[] = { { sceb7cf, .737 }, { safcebd, .283 }, H }; + +D l19_d = { "greek", "utf8", - { - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,0.001,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - 0.066,0.051,0.038,0.054,0.114,0.062,0.013,0.015,0.004,0.020,0.001,0.000,0.030,0.015,0.011,Y, - Y,0.004,Y,0.001,0.002,0.004,0.000,0.004,0.001,0.002,0.007,0.002,0.008,0.002,0.000,0.004, - 0.002,0.002,Y,0.002,0.004,Y,0.001,0.000,Y,0.001,Y,Y,0.047,0.036,0.016,0.033, - Y,0.141,0.012,0.022,0.022,0.099,0.009,0.043,0.012,0.092,0.057,0.044,0.053,0.095,0.009,0.111, - Y,V,V,V,V,V,V,V,V,V,V,V,V,V,1.511,0.737, - V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V, - V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V, - V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V - }, - { - X,l19n1,X,l19n3,l19n4,X,l19n6,l19n7,l19n8,X,X,l19n11,l19n12,l19n13,l19n14,l19n15, - l19n16,X,X,l19n19,l19n20,l19n21,X,l19n23,l19n24,l19n25,l19n26,l19n27,X,l19n29,l19n30,l19n31, - l19n32,l19n33,X,l19n35,l19n36,X,l19n38,l19n39,l19n40,l19n41,l19n42,l19n43,l19n44,l19n45,l19n46,X, - X,l19n49,l19n50,l19n51,l19n52,l19n53,X,l19n55,l19n56,l19n57,X,l19n59,l19n60,l19n61,X,l19n63, - l19n64,l19n65,l19n66,l19n67,l19n68,l19n69,l19n70,X,l19n72,l19n73,l19n74,l19n75,l19n76,l19n77,l19n78,l19n79, - X,l19n81,l19n82,l19n83,l19n84,l19n85,l19n86,l19n87,l19n88,l19n89,l19n90,l19n91,X,l19n93,l19n94,l19n95, - X,X,l19n98,l19n99,l19n100,l19n101,X,l19n103,l19n104,l19n105,l19n106,l19n107,l19n108,l19n109,l19n110,l19n111, - l19n112,l19n113,l19n114,X,l19n116,X,l19n118,l19n119,l19n120,l19n121,l19n122,l19n123,l19n124,l19n125,l19n126,l19n127, - l19n128,X,l19n130,l19n131,X,l19n133,l19n134,l19n135,l19n136,l19n137,l19n138,l19n139,l19n140,l19n141,l19n142,l19n143, - l19n144,l19n145,l19n146,l19n147,X,X,l19n150,l19n151,l19n152,l19n153,X,l19n155,l19n156,l19n157,l19n158,l19n159, - X,l19n161,l19n162,l19n163,X,l19n165,l19n166,l19n167,l19n168,l19n169,l19n170,l19n171,X,l19n173,l19n174,l19n175, - l19n176,l19n177,l19n178,l19n179,l19n180,l19n181,X,l19n183,l19n184,l19n185,l19n186,l19n187,X,l19n189,l19n190,l19n191, - l19n192,l19n193,l19n194,l19n195,l19n196,X,l19n198,X,X,l19n201,X,l19n203,X,X,l19n206,l19n207, - l19n208,l19n209,l19n210,l19n211,l19n212,l19n213,l19n214,l19n215,X,X,l19n218,X,l19n220,X,l19n222,l19n223, - l19n224,l19n225,l19n226,X,X,l19n229,l19n230,X,l19n232,X,X,X,l19n236,X,l19n238,l19n239, - l19n240,l19n241,X,l19n243,l19n244,l19n245,l19n246,l19n247,X,l19n249,X,X,l19n252,l19n253,l19n254,X - } + { W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, 0.001, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + 0.066, 0.051, 0.038, 0.054, 0.114, 0.062, 0.013, 0.015, 0.004, 0.020, 0.001, 0.000, 0.030, 0.015, 0.011, Y, + Y, 0.004, Y, 0.001, 0.002, 0.004, 0.000, 0.004, 0.001, 0.002, 0.007, 0.002, 0.008, 0.002, 0.000, 0.004, + 0.002, 0.002, Y, 0.002, 0.004, Y, 0.001, 0.000, Y, 0.001, Y, Y, 0.047, 0.036, 0.016, 0.033, + Y, 0.141, 0.012, 0.022, 0.022, 0.099, 0.009, 0.043, 0.012, 0.092, 0.057, 0.044, 0.053, 0.095, 0.009, 0.111, + Y, V, V, V, V, V, V, V, V, V, V, V, V, V, 1.511, 0.737, + V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, + V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, + V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, V }, + { X, l19n1, X, l19n3, l19n4, X, l19n6, l19n7, l19n8, X, X, l19n11, l19n12, l19n13, l19n14, l19n15, + l19n16, X, X, l19n19, l19n20, l19n21, X, l19n23, l19n24, l19n25, l19n26, l19n27, X, l19n29, l19n30, l19n31, + l19n32, l19n33, X, l19n35, l19n36, X, l19n38, l19n39, l19n40, l19n41, l19n42, l19n43, l19n44, l19n45, l19n46, X, + X, l19n49, l19n50, l19n51, l19n52, l19n53, X, l19n55, l19n56, l19n57, X, l19n59, l19n60, l19n61, X, l19n63, + l19n64, l19n65, l19n66, l19n67, l19n68, l19n69, l19n70, X, l19n72, l19n73, l19n74, l19n75, l19n76, l19n77, l19n78, l19n79, + X, l19n81, l19n82, l19n83, l19n84, l19n85, l19n86, l19n87, l19n88, l19n89, l19n90, l19n91, X, l19n93, l19n94, l19n95, + X, X, l19n98, l19n99, l19n100, l19n101, X, l19n103, l19n104, l19n105, l19n106, l19n107, l19n108, l19n109, l19n110, l19n111, + l19n112, l19n113, l19n114, X, l19n116, X, l19n118, l19n119, l19n120, l19n121, l19n122, l19n123, l19n124, l19n125, l19n126, l19n127, + l19n128, X, l19n130, l19n131, X, l19n133, l19n134, l19n135, l19n136, l19n137, l19n138, l19n139, l19n140, l19n141, l19n142, l19n143, + l19n144, l19n145, l19n146, l19n147, X, X, l19n150, l19n151, l19n152, l19n153, X, l19n155, l19n156, l19n157, l19n158, l19n159, + X, l19n161, l19n162, l19n163, X, l19n165, l19n166, l19n167, l19n168, l19n169, l19n170, l19n171, X, l19n173, l19n174, l19n175, + l19n176, l19n177, l19n178, l19n179, l19n180, l19n181, X, l19n183, l19n184, l19n185, l19n186, l19n187, X, l19n189, l19n190, l19n191, + l19n192, l19n193, l19n194, l19n195, l19n196, X, l19n198, X, X, l19n201, X, l19n203, X, X, l19n206, l19n207, + l19n208, l19n209, l19n210, l19n211, l19n212, l19n213, l19n214, l19n215, X, X, l19n218, X, l19n220, X, l19n222, l19n223, + l19n224, l19n225, l19n226, X, X, l19n229, l19n230, X, l19n232, X, X, X, l19n236, X, l19n238, l19n239, + l19n240, l19n241, X, l19n243, l19n244, l19n245, l19n246, l19n247, X, l19n249, X, X, l19n252, l19n253, l19n254, X } }; - - // // Lng: hebrew // Enc: iso-8859-8 // - -S sgfa[]={32,250,0}; -S sfaV[]={250,229,0}; -S sede9[]={237,233,0}; -S sgede9[]={32,237,233,0}; -S sgfaV[]={32,250,229,0}; -S sge9[]={32,233,0}; -S se9f0[]={233,240,0}; -S secf9[]={236,249,0}; -S sVf8[]={229,248,0}; -S se9T[]={233,227,0}; -S sf8V[]={248,229,0}; -S sUec[]={228,236,0}; -S sVf9[]={229,249,0}; -S se9f8[]={233,248,0}; -S sQf8[]={224,248,0}; -S sVR[]={229,225,0}; -S sf8f9[]={248,249,0}; -S sf9e9[]={249,233,0}; -S sfae9[]={250,233,0}; -S sfaQ[]={250,224,0}; -S seeUg[]={238,228,a}; -S seeU[]={238,228,0}; -S secf9g[]={236,249,a}; -S se9e9[]={233,233,0}; -S se9U[]={233,228,0}; -S sf8U[]={248,228,0}; -S sgfae9[]={32,250,233,0}; -S se9ee[]={233,238,0}; -S sgecf9[]={32,236,249,0}; -S sgfaQ[]={32,250,224,0}; -S sVee[]={229,238,0}; -S sgecf9g[]={32,236,249,a}; -S sUf0[]={228,240,0}; -S sgefe9[]={32,239,233,0}; -S secf2[]={236,242,0}; -S sf8e9[]={248,233,0}; -S se9f9[]={233,249,0}; -S sVU[]={229,228,0}; -S sVe7[]={229,231,0}; -S sge9f0[]={32,233,240,0}; -S sfae9f0[]={250,233,240,0}; -S se9e8[]={233,232,0}; -S sfaQg[]={250,224,a}; -S sf8Q[]={248,224,0}; -S sgfae9f0[]={32,250,233,240,0}; -S sf4U[]={244,228,0}; -S sgUf0[]={32,228,240,0}; -S sgecf2[]={32,236,242,0}; -S sf8e7[]={248,231,0}; -S se9f4[]={233,244,0}; -S sfaVf0[]={250,229,240,0}; -S sgecf2g[]={32,236,242,a}; -S sQU[]={224,228,0}; -S secf2g[]={236,242,a}; -S sQUg[]={224,228,a}; -S sf8fa[]={248,250,0}; -S secQ[]={236,224,0}; -S sf8Ug[]={248,228,a}; -S sVfa[]={229,250,0}; -S sgf9[]={32,249,0}; -S sf9Q[]={249,224,0}; -S sgf8V[]={32,248,229,0}; -S se9f1[]={233,241,0}; -S sgUf8[]={32,228,248,0}; -S sf4Ug[]={244,228,a}; -S sf2U[]={242,228,0}; -S sgVf0[]={32,229,240,0}; -S sUecg[]={228,236,a}; -S sgedf2[]={32,237,242,0}; -S sTee[]={227,238,0}; -S sgUe9[]={32,228,233,0}; -S se9f0V[]={233,240,229,0}; -S sVf7[]={229,247,0}; -S sf9f8[]={249,248,0}; -S sedf2[]={237,242,0}; -S se9f6[]={233,246,0}; -S sf9V[]={249,229,0}; -S sf9ee[]={249,238,0}; -S sUf8[]={228,248,0}; -S sgUec[]={32,228,236,0}; -S sfaVf8[]={250,229,248,0}; -S seceb[]={236,235,0}; -S sgefV[]={32,239,229,0}; -S sgfaVf0[]={32,250,229,240,0}; -S sfaU[]={250,228,0}; -S se9S[]={233,226,0}; -S sRV[]={225,229,0}; -S sVQ[]={229,224,0}; -S sgedf2g[]={32,237,242,a}; -S sQR[]={224,225,0}; -S sefV[]={239,229,0}; -S se7Q[]={231,224,0}; -S se9Q[]={233,224,0}; -S sf9e9g[]={249,233,a}; -S sgfaQg[]={32,250,224,a}; -S sQV[]={224,229,0}; -S sfaee[]={250,238,0}; -S sgfaVf8[]={32,250,229,248,0}; -S sedf2g[]={237,242,a}; -S sVV[]={229,229,0}; -S sf2R[]={242,225,0}; -S sgf2[]={32,242,0}; -S sTf2[]={227,242,0}; -S sf9Qf8[]={249,224,248,0}; -S se9ebg[]={233,235,a}; -S sede9f8[]={237,233,248,0}; -S secQf8[]={236,224,248,0}; -S sgede9T[]={32,237,233,227,0}; -S se8f1[]={232,241,0}; -S sfaVf9[]={250,229,249,0}; -S sVS[]={229,226,0}; -S sf2Ug[]={242,228,a}; -S sgede9f8[]={32,237,233,248,0}; -S sf1ec[]={241,236,0}; -S sRf8[]={225,248,0}; -S sfaVe9[]={250,229,233,0}; -S sUR[]={228,225,0}; -S sf2V[]={242,229,0}; -S sf0R[]={240,225,0}; -S sf2f4[]={242,244,0}; -S sf8f7[]={248,247,0}; -S secf4[]={236,244,0}; -S sUf9[]={228,249,0}; -S sf7U[]={247,228,0}; -S sgfaVf9[]={32,250,229,249,0}; -S se9f0e9[]={233,240,233,0}; -S sf8e7Q[]={248,231,224,0}; -S sede9T[]={237,233,227,0}; -S se9e8f1[]={233,232,241,0}; -S sge9eb[]={32,233,235,0}; -S sUee[]={228,238,0}; -S sQf8f9e9[]={224,248,249,233,0}; -S sfaf9[]={250,249,0}; -S sge9ebg[]={32,233,235,a}; -S sgede9ec[]={32,237,233,236,0}; -S se9e8f1ec[]={233,232,241,236,0}; -S seeec[]={238,236,0}; -S sgefe9e9[]={32,239,233,233,0}; -S sQec[]={224,236,0}; -S se8f1ec[]={232,241,236,0}; -S sf8f9e9[]={248,249,233,0}; -S sede9ec[]={237,233,236,0}; -S sf8e8[]={248,232,0}; -S sfaf8[]={250,248,0}; -S sefe9e9[]={239,233,233,0}; -S sf1U[]={241,228,0}; -S secQf8f9[]={236,224,248,249,0}; -S sf8T[]={248,227,0}; -S sf8ec[]={248,236,0}; -S sQf8f9[]={224,248,249,0}; -S sQecg[]={224,236,a}; -S sf6Ug[]={246,228,a}; -S se9e7[]={233,231,0}; -S se7ee[]={231,238,0}; -S sgecQ[]={32,236,224,0}; -S sQRg[]={224,225,a}; -S sgfaf8[]={32,250,248,0}; -S se9f7[]={233,247,0}; -S sfaUg[]={250,228,a}; -S se9V[]={233,229,0}; -S se9Te9[]={233,227,233,0}; -S sf6U[]={246,228,0}; -S sQf9[]={224,249,0}; -S sf0f9[]={240,249,0}; -S sede9f0[]={237,233,240,0}; -S sRU[]={225,228,0}; -S sf7Ug[]={247,228,a}; -S sf2ee[]={242,238,0}; -S se9f1V[]={233,241,229,0}; -S sf0e9Tee[]={240,233,227,238,0}; -S sVf0e9[]={229,240,233,0}; -S sSe9[]={226,233,0}; -S sf1ecf4[]={241,236,244,0}; -S sf2e9[]={242,233,0}; -S sf8f9g[]={248,249,a}; -S sedSg[]={237,226,a}; -S sgRe9[]={32,225,233,0}; -S sf1Q[]={241,224,0}; -S sVf0g[]={229,240,a}; -S sgedSg[]={32,237,226,a}; -S sf1Ug[]={241,228,a}; -S se9Tee[]={233,227,238,0}; -S se9Ug[]={233,228,a}; -S sf8Qg[]={248,224,a}; -S sgecQf8[]={32,236,224,248,0}; -S se9fa[]={233,250,0}; -S sf8faV[]={248,250,229,0}; -S sSU[]={226,228,0}; -S se7eeg[]={231,238,a}; -S sfaVf9f8[]={250,229,249,248,0}; -S se7V[]={231,229,0}; -S sfaf0[]={250,240,0}; -S sf9ecg[]={249,236,a}; -S sQe9[]={224,233,0}; -S sgf9Q[]={32,249,224,0}; -S sgede9f0[]={32,237,233,240,0}; -S seee9[]={238,233,0}; -S sgedS[]={32,237,226,0}; -S sQee[]={224,238,0}; -S sgTV[]={32,227,229,0}; -S sSf4[]={226,244,0}; -S sf0e9T[]={240,233,227,0}; -S sgUR[]={32,228,225,0}; -S sVf9f8[]={229,249,248,0}; -S se7e9[]={231,233,0}; -S sgfaVe9[]={32,250,229,233,0}; -S sRUg[]={225,228,a}; -S sgVfa[]={32,229,250,0}; -S se8f1ecf4[]={232,241,236,244,0}; -S sebU[]={235,228,0}; -S sebUg[]={235,228,a}; -S sTf2g[]={227,242,a}; -S seeee[]={238,238,0}; -S sf6f2[]={246,242,0}; -S sf0ee[]={240,238,0}; -S seeRg[]={238,225,a}; -S sedS[]={237,226,0}; -S sVRg[]={229,225,a}; -S se9e9f6[]={233,233,246,0}; -S seaeb[]={234,235,0}; -S sfaec[]={250,236,0}; -S sQf8g[]={224,248,a}; -S sTg[]={227,a}; -S sVUg[]={229,228,a}; -S se8f9[]={232,249,0}; -S seee7[]={238,231,0}; -S sge9f0V[]={32,233,240,229,0}; -S sefe9R[]={239,233,225,0}; -S sede9ee[]={237,233,238,0}; -S sTf8[]={227,248,0}; -S sfaVR[]={250,229,225,0}; -S se7fa[]={231,250,0}; -S sf9f8Ug[]={249,248,228,a}; -S se9f9g[]={233,249,a}; -S sVeeg[]={229,238,a}; -S sWeeg[]={230,238,a}; -S sVf9f8U[]={229,249,248,228,0}; -S secf4Ug[]={236,244,228,a}; -S sf7ec[]={247,236,0}; -S se9f0e9e8[]={233,240,233,232,0}; -S sgeceb[]={32,236,235,0}; -S sf4Q[]={244,224,0}; -S se8f7[]={232,247,0}; -S sUUg[]={228,228,a}; -S sVfag[]={229,250,a}; -S sf8ee[]={248,238,0}; -S sTeeU[]={227,238,228,0}; -S sf9f4Q[]={249,244,224,0}; -S sf2Rg[]={242,225,a}; -S secec[]={236,236,0}; -S sf9fa[]={249,250,0}; -S sRVf9[]={225,229,249,0}; -S secf9ee[]={236,249,238,0}; -S sUf0e9[]={228,240,233,0}; -S se9f0Ve9[]={233,240,229,233,0}; -S sVf7e9[]={229,247,233,0}; -S se9f0f9[]={233,240,249,0}; -S sf0e9e8f1[]={240,233,232,241,0}; -S seef2[]={238,242,0}; -S sf8f6[]={248,246,0}; -S sgede9e9[]={32,237,233,233,0}; -S sgede9ee[]={32,237,233,238,0}; -S se9f0R[]={233,240,225,0}; -S sVe8[]={229,232,0}; -S sgUf0e9[]={32,228,240,233,0}; -S sgfaVR[]={32,250,229,225,0}; -S sgefe9R[]={32,239,233,225,0}; -S sf0e7[]={240,231,0}; -S sf8f9f4Q[]={248,249,244,224,0}; -S sVf8e9[]={229,248,233,0}; -S seefa[]={238,250,0}; -S sTeeUg[]={227,238,228,a}; -S sgf8e7[]={32,248,231,0}; -S sf0e9e8[]={240,233,232,0}; -S se9f4g[]={233,244,a}; -S sgeaeb[]={32,234,235,0}; -S se9TeeU[]={233,227,238,228,0}; -S sf4ec[]={244,236,0}; -S sgTf2[]={32,227,242,0}; -S sf4f8[]={244,248,0}; -S sf9eeee[]={249,238,238,0}; -S se7Ug[]={231,228,a}; -S sgf8fa[]={32,248,250,0}; -S sgf9Qf8[]={32,249,224,248,0}; -S sf8f9e9g[]={248,249,233,a}; -S sece8[]={236,232,0}; -S sQVg[]={224,229,a}; -S sf4ee[]={244,238,0}; -S sf1ecf4U[]={241,236,244,228,0}; -S sVf9e9[]={229,249,233,0}; -S sf9e9S[]={249,233,226,0}; -S sf0Rg[]={240,225,a}; -S se7U[]={231,228,0}; -S sede9f2[]={237,233,242,0}; -S secf9eeee[]={236,249,238,238,0}; -S sf1ee[]={241,238,0}; -S sf9Qf8g[]={249,224,248,a}; -S sWee[]={230,238,0}; -S sede9e9[]={237,233,233,0}; -S sf0fa[]={240,250,0}; -S sgedV[]={32,237,229,0}; -S sUQ[]={228,224,0}; -S sgf8faV[]={32,248,250,229,0}; -S sge9T[]={32,233,227,0}; -S secf4U[]={236,244,228,0}; -S sfae9f0e9[]={250,233,240,233,0}; -S sVf8g[]={229,248,a}; -S sf0Ve9[]={240,229,233,0}; -S sRecg[]={225,236,a}; -S sf9f4[]={249,244,0}; -S sf8f9f4[]={248,249,244,0}; -S sgede9f2[]={32,237,233,242,0}; -S sgfaf9[]={32,250,249,0}; -S sf8ecg[]={248,236,a}; -S sf9f8U[]={249,248,228,0}; -S sf0faf0g[]={240,250,240,a}; -S sf0faf0[]={240,250,240,0}; -S sRf8g[]={225,248,a}; -S sfaf0g[]={250,240,a}; -S sf0Vf8[]={240,229,248,0}; -S sVf9Qf8[]={229,249,224,248,0}; -S sUe9U[]={228,233,228,0}; -S sVe7U[]={229,231,228,0}; - -N l20n0[]={{sf9e9g,.809},H}; -N l20n1[]={{sf0R,.315},{sVW,.270},H}; -N l20n3[]={{sgedf2,.404},{sgf3,.210},{sf1ecf4U,.360},H}; -N l20n4[]={{sgU,2.037},{sf4f8,.180},H}; -N l20n5[]={{se9ee,.674},H}; -N l20n6[]={{secf2g,1.011},{sQf8f9e9,.539},H}; -N l20n7[]={{sf9Q,.449},{sgUe9,.404},{seeV,.360},{secQf8f9,.539},H}; -N l20n8[]={{sWeeg,.404},H}; -N l20n9[]={{se8R,.225},{sgf9Q,.225},{sf7g,.270},H}; -N l20n11[]={{sVf0g,.506},H}; -N l20n12[]={{sgfaVe9,.300},{sVRg,.404},H}; -N l20n13[]={{sece9,.315},{sf7U,.315},{sf8f9f4,.270},H}; -N l20n15[]={{sfae9f0,.742},{se9f1V,.337},{sf1Q,.225},{sgUf0e9,.240},{sf9Qf8g,.539},H}; -N l20n16[]={{sf4Ug,.910},H}; -N l20n17[]={{sQR,.360},{sVf6,.225},H}; -N l20n18[]={{sVe7,.539},H}; -N l20n20[]={{sUf8,.404},{sfaee,.360},{sf0e9Tee,.449},{sgecQf8,.300},{sf8ecg,.404},H}; -N l20n21[]={{sgV,1.019},{sUe9,.629},{sedSg,.506},{sefe9R,.270},H}; -N l20n22[]={{sfaVf9f8,.449},{sgf8fa,.180},H}; -N l20n23[]={{se9Q,.360},{sTeeU,.270},{sRf8g,.303},H}; -N l20n25[]={{se7g,.607},{se8f1,.315},{se8f1ecf4,.449},H}; -N l20n26[]={{sgfaQ,.629},{sge9T,.180},H}; -N l20n27[]={{sf8T,.270},H}; -N l20n28[]={{secQf8,.472},{sf2ee,.225},H}; -N l20n29[]={{secf9,1.079},{se7U,.180},H}; -N l20n30[]={{sf7V,.270},H}; -N l20n32[]={{se9f9g,.404},{sUUg,.404},H}; -N l20n33[]={{sgfaVf0,.479},{secf9eeee,.360},H}; -N l20n34[]={{sVf7,.404},{sgfaf8,.270},H}; -N l20n35[]={{sfaVf8,.607},{seeRg,.506},{sVe8,.180},H}; -N l20n37[]={{sedf2g,.809},{sUf9,.315},{sgf5,.120},{sVf7e9,.270},H}; -N l20n38[]={{sfaQ,.764},{sefV,.360},{sfaVR,.270},H}; -N l20n39[]={{se9f0,1.528},{se7eeg,.506},{sRVf9,.270},H}; -N l20n40[]={{sf8g,1.416},{se9R,.854},{sgUec,.404},H}; -N l20n41[]={{seee7,.180},H}; -N l20n42[]={{se9f0e9,.472},H}; -N l20n44[]={{sede9,2.292},{sf8U,.674},{sQecg,.607},{sgecQ,.270},H}; -N l20n45[]={{sVf2g,.607},{sgfaf9,.180},H}; -N l20n46[]={{sfaVf9,.472},{se7V,.225},H}; -N l20n47[]={{sgf8V,.449},{seceb,.360},{sf9eeee,.270},{sede9e9,.270},H}; -N l20n48[]={{sf0g,1.146},{se9TeeU,.360},H}; -N l20n50[]={{se9ebg,.708},H}; -N l20n51[]={{sVf8,1.034},{sf9ecg,.506},H}; -N l20n52[]={{sVe9,1.034},H}; -N l20n54[]={{sfaf0,.225},{sVf8e9,.270},H}; -N l20n55[]={{sge7,.210},H}; -N l20n56[]={{se9f1,.449},{sf4ec,.180},H}; -N l20n57[]={{se9S,.360},{sgfaVf8,.479},H}; -N l20n60[]={{sgfaVf9,.419},H}; -N l20n61[]={{sf8V,.854},{se8f1ec,.404},H}; -N l20n63[]={{sgecf9,.674},{sf2R,.360},{sVUg,.404},H}; -N l20n64[]={{sQg,2.427},{secec,.180},H}; -N l20n65[]={{sRS,.180},H}; -N l20n66[]={{se9e9f6,.270},H}; -N l20n68[]={{sVf9,.809},{sQU,.449},H}; -N l20n69[]={{sf0V,.764},{sgf8e7,.180},H}; -N l20n71[]={{sf9g,2.359},{sgf7,.210},{sVf9e9,.270},H}; -N l20n72[]={{sUec,.854},{sf8Qg,.506},{sf0Ve9,.270},H}; -N l20n73[]={{se9f2,.629},{sgede9T,.419},H}; -N l20n74[]={{se9T,.989},{sf0e9T,.337},H}; -N l20n75[]={{sTee,.404},{sQf8f9,.404},{seee9,.225},{sRecg,.404},H}; -N l20n77[]={{sgfae9f0,.659},{se9Te9,.404},H}; -N l20n78[]={{sf6Ug,.607},H}; -N l20n79[]={{sf1g,.270},H}; -N l20n80[]={{sede9ec,.404},H}; -N l20n81[]={{sgfaV,2.022},H}; -N l20n82[]={{sgecf2g,.599},H}; -N l20n83[]={{sf1U,.270},{sgedS,.225},H}; -N l20n84[]={{sgUf0,.494},{sf0e9e8f1,.360},H}; -N l20n85[]={{sVfa,.449},{sQV,.360},H}; -N l20n86[]={{seeUg,1.719},{sVeb,.404},{sf9e9S,.270},H}; -N l20n87[]={{se9g,1.483},{sf1ecf4,.337},{secf9ee,.270},H}; -N l20n88[]={{sgf8,1.348},{sge9f0V,.240},H}; -N l20n89[]={{sge9,1.109},{sgTf2,.180},H}; -N l20n90[]={{sf4ee,.180},{sf0faf0g,.404},H}; -N l20n91[]={{se9U,.719},{sgede9e9,.240},{sf9f4,.180},H}; -N l20n92[]={{sf9V,.404},H}; -N l20n94[]={{sf8f6,.180},H}; -N l20n95[]={{sRg,4.112},{sf8e7,.449},H}; -N l20n97[]={{sf0Rg,.404},H}; -N l20n98[]={{sf7e9,.404},H}; -N l20n99[]={{sgedf2g,.479},{sRU,.225},{sgecV,.225},H}; -N l20n100[]={{sf1V,.360},{sgede9ec,.360},H}; -N l20n101[]={{sgVf0,.404},{sgefe9R,.240},H}; -N l20n102[]={{sfag,1.011},{sede9ee,.270},H}; -N l20n103[]={{sf0e7,.180},H}; -N l20n105[]={{sgf9,.300},H}; -N l20n106[]={{sefe9,.629},{sgea,.270},{sfaU,.360},{sUee,.270},{sgede9ee,.240},H}; -N l20n107[]={{se9f4,.449},{sf9f8U,.270},H}; -N l20n108[]={{se9V,.270},{sf4Q,.180},{seefa,.180},H}; -N l20n109[]={{sefe9e9,.404},{sf7Ug,.506},H}; -N l20n110[]={{sf2g,2.427},{sTR,.404},H}; -N l20n111[]={{sf8f7,.315},H}; -N l20n112[]={{sf8e8,.270},{sgede9f0,.300},H}; -N l20n113[]={{sQRg,.607},H}; -N l20n114[]={{sf2U,.404},{sge9eb,.270},{se7e9,.225},H}; -N l20n116[]={{secQ,.449},{sRV,.360},{sgedV,.180},H}; -N l20n118[]={{sgede9f2,.240},H}; -N l20n119[]={{sTeeUg,.539},H}; -N l20n121[]={{sf8faV,.337},H}; -N l20n122[]={{sgfa,2.846},{sgfaQg,.479},H}; -N l20n123[]={{sfaV,2.472},H}; -N l20n124[]={{sede9f0,.337},{sUQ,.180},H}; -N l20n125[]={{secf9g,1.618},{sgfae9,.674},{sgefe9e9,.360},{se7Ug,.404},H}; -N l20n126[]={{sSg,.539},{sfaVe9,.472},{seeec,.270},H}; -N l20n127[]={{se8f7,.180},H}; -N l20n129[]={{sf8e9,.584},{sf0e9e8,.270},H}; -N l20n130[]={{sf2f4,.315},{sSU,.225},H}; -N l20n131[]={{sf2V,.315},{sgeaeb,.180},H}; -N l20n132[]={{se9Tee,.337},H}; -N l20n134[]={{sfaQg,1.112},H}; -N l20n136[]={{se9Rg,1.011},{sgede9f8,.419},H}; -N l20n137[]={{sf0e9,.809},{sVee,.629},H}; -N l20n140[]={{sgec,1.558},{sUf0,.629},{sf8Ug,1.011},H}; -N l20n141[]={{se9f6,.404},{sUR,.315},H}; -N l20n142[]={{se9e7,.270},H}; -N l20n143[]={{sTf2,.315},{sUf0e9,.270},H}; -N l20n145[]={{sf8f9,.764},H}; -N l20n146[]={{sSf4,.225},{sede9f2,.270},H}; -N l20n147[]={{se7fa,.180},{sVf8g,.404},H}; -N l20n148[]={{sVe9g,.809},{sf8f9e9,.404},{secf4U,.270},H}; -N l20n149[]={{sebg,1.888},{sf7ec,.180},H}; -N l20n150[]={{sgefV,.360},{sfaf0g,.303},H}; -N l20n152[]={{sQf8,.809},{sVf9f8U,.360},H}; -N l20n153[]={{sf0f9,.270},{sQe9,.225},{sebU,.225},H}; -N l20n155[]={{sVQ,.360},H}; -N l20n157[]={{sged,2.337},{sTg,.270},H}; -N l20n158[]={{se9f7,.270},H}; -N l20n159[]={{sgecf9g,.839},{se9e8,.494},{sf9f8,.404},{sf2Rg,.404},H}; -N l20n160[]={{sgede9,2.292},{sf9e9,.764},{seeee,.225},H}; -N l20n161[]={{se8f9,.180},H}; -N l20n162[]={{sf8fa,.449},H}; -N l20n164[]={{sQUg,1.011},H}; -N l20n165[]={{sgeceb,.180},H}; -N l20n166[]={{secf2,.584},H}; -N l20n168[]={{sUecg,.910},{sf1e9,.180},{sWee,.180},H}; -N l20n169[]={{sge9f0,.494},{sQf9,.270},H}; -N l20n170[]={{sebV,.270},{sf0fa,.180},H}; -N l20n171[]={{sVf0,1.168},H}; -N l20n172[]={{sVR,.764},{sf4g,.809},{sgUf8,.404},H}; -N l20n173[]={{sf8f9f4Q,.360},H}; -N l20n174[]={{sVf0e9,.337},H}; -N l20n175[]={{se9f8,.809},{sf9Qf8,.472},{sgUR,.225},H}; -N l20n176[]={{se9e9,.719},{sf4U,.494},H}; -N l20n178[]={{sTV,.449},H}; -N l20n179[]={{sgedSg,.300},{sf1Ug,.506},H}; -N l20n180[]={{secg,3.303},{sf8ec,.270},H}; -N l20n181[]={{sedS,.225},{sVfag,.404},{sQVg,.404},H}; -N l20n183[]={{sRf8,.315},H}; -N l20n184[]={{sRe9,.404},H}; -N l20n185[]={{se9f0Ve9,.360},H}; -N l20n187[]={{se9Ug,.506},H}; -N l20n188[]={{sUg,7.955},{sVf1,.225},H}; -N l20n189[]={{sVS,.315},H}; -N l20n190[]={{se9e8f1ec,.539},{sfaf8,.270},H}; -N l20n191[]={{sgef,.869},{sfae9,.764},H}; -N l20n192[]={{se9f9,.584},{sgQ,.240},{sUU,.180},H}; -N l20n193[]={{sf9fa,.180},H}; -N l20n194[]={{sgefe9,.629},H}; -N l20n195[]={{seeR,.225},{sRUg,.506},H}; -N l20n197[]={{sedf2,.404},{sgf8faV,.240},H}; -N l20n199[]={{se7ee,.270},{sf2e9,.225},H}; -N l20n200[]={{secf4,.315},H}; -N l20n201[]={{secV,.629},H}; -N l20n202[]={{sfaUg,.607},{sgTV,.225},{sfae9f0e9,.360},H}; -N l20n203[]={{sfaVf0,.674},{sf9f8Ug,.539},{se9f4g,.404},H}; -N l20n204[]={{sQec,.270},{sVf9Qf8,.270},H}; -N l20n205[]={{sVf2,.584},H}; -N l20n206[]={{sVT,.315},H}; -N l20n207[]={{sfaf9,.270},H}; -N l20n209[]={{sgR,.389},{se9fa,.225},H}; -N l20n210[]={{se9eb,.539},{sf2Ug,.708},{sge9ebg,.360},{se9f0R,.270},H}; -N l20n211[]={{sf9ec,.225},{sgVfa,.225},H}; -N l20n212[]={{sede9f8,.472},{sgRe9,.225},H}; -N l20n214[]={{sf8ee,.180},H}; -N l20n215[]={{sSe9,.225},H}; -N l20n217[]={{se7Q,.360},H}; -N l20n218[]={{se9f0f9,.270},H}; -N l20n219[]={{sVg,.809},{sf1ec,.315},H}; -N l20n220[]={{sf6f2,.225},H}; -N l20n222[]={{sf0ee,.225},{sVe7U,.202},H}; -N l20n223[]={{sVU,.584},H}; -N l20n225[]={{sgf1,.120},{sUe9U,.202},H}; -N l20n226[]={{se9f0e9e8,.360},H}; -N l20n227[]={{se9ec,.629},H}; -N l20n228[]={{seef2,.180},H}; -N l20n232[]={{sf8Q,.494},{sedV,.180},H}; -N l20n233[]={{sVeeg,.404},H}; -N l20n234[]={{sf6g,.404},H}; -N l20n235[]={{sRec,.180},H}; -N l20n236[]={{sVf9f8,.337},H}; -N l20n237[]={{sede9T,.472},{sf0Vf8,.202},H}; -N l20n238[]={{sf6U,.270},{sQee,.225},H}; -N l20n239[]={{sVf4,.360},{sTf2g,.506},H}; -N l20n240[]={{sVV,.360},H}; -N l20n241[]={{sf8f9g,.506},{seaeb,.180},{sgf9Qf8,.240},H}; -N l20n242[]={{seeg,3.034},{sgecf2,.494},{sgf2,.240},{sfaec,.180},H}; -N l20n243[]={{sgT,.809},H}; -N l20n244[]={{secf4Ug,.539},{sgfaVR,.240},{sf8f9e9g,.539},H}; -N l20n245[]={{sf9ee,.404},{sTf8,.180},H}; -N l20n246[]={{seeU,.764},{sTe9,.494},{sgTe9,.180},H}; -N l20n248[]={{sQf8g,.404},H}; -N l20n249[]={{sebUg,.506},H}; -N l20n250[]={{se9e8f1,.404},{sWg,.404},{sf0faf0,.202},H}; -N l20n251[]={{sf9f4Q,.270},H}; -N l20n252[]={{sece8,.180},H}; -N l20n253[]={{sf1ee,.180},H}; -N l20n254[]={{se9f0V,.607},H}; -N l20n255[]={{sf8e7Q,.472},{sf6V,.225},H}; - -D l20_d = -{ +S sgfa[] = { 32, 250, 0 }; +S sfaV[] = { 250, 229, 0 }; +S sede9[] = { 237, 233, 0 }; +S sgede9[] = { 32, 237, 233, 0 }; +S sgfaV[] = { 32, 250, 229, 0 }; +S sge9[] = { 32, 233, 0 }; +S se9f0[] = { 233, 240, 0 }; +S secf9[] = { 236, 249, 0 }; +S sVf8[] = { 229, 248, 0 }; +S se9T[] = { 233, 227, 0 }; +S sf8V[] = { 248, 229, 0 }; +S sUec[] = { 228, 236, 0 }; +S sVf9[] = { 229, 249, 0 }; +S se9f8[] = { 233, 248, 0 }; +S sQf8[] = { 224, 248, 0 }; +S sVR[] = { 229, 225, 0 }; +S sf8f9[] = { 248, 249, 0 }; +S sf9e9[] = { 249, 233, 0 }; +S sfae9[] = { 250, 233, 0 }; +S sfaQ[] = { 250, 224, 0 }; +S seeUg[] = { 238, 228, a }; +S seeU[] = { 238, 228, 0 }; +S secf9g[] = { 236, 249, a }; +S se9e9[] = { 233, 233, 0 }; +S se9U[] = { 233, 228, 0 }; +S sf8U[] = { 248, 228, 0 }; +S sgfae9[] = { 32, 250, 233, 0 }; +S se9ee[] = { 233, 238, 0 }; +S sgecf9[] = { 32, 236, 249, 0 }; +S sgfaQ[] = { 32, 250, 224, 0 }; +S sVee[] = { 229, 238, 0 }; +S sgecf9g[] = { 32, 236, 249, a }; +S sUf0[] = { 228, 240, 0 }; +S sgefe9[] = { 32, 239, 233, 0 }; +S secf2[] = { 236, 242, 0 }; +S sf8e9[] = { 248, 233, 0 }; +S se9f9[] = { 233, 249, 0 }; +S sVU[] = { 229, 228, 0 }; +S sVe7[] = { 229, 231, 0 }; +S sge9f0[] = { 32, 233, 240, 0 }; +S sfae9f0[] = { 250, 233, 240, 0 }; +S se9e8[] = { 233, 232, 0 }; +S sfaQg[] = { 250, 224, a }; +S sf8Q[] = { 248, 224, 0 }; +S sgfae9f0[] = { 32, 250, 233, 240, 0 }; +S sf4U[] = { 244, 228, 0 }; +S sgUf0[] = { 32, 228, 240, 0 }; +S sgecf2[] = { 32, 236, 242, 0 }; +S sf8e7[] = { 248, 231, 0 }; +S se9f4[] = { 233, 244, 0 }; +S sfaVf0[] = { 250, 229, 240, 0 }; +S sgecf2g[] = { 32, 236, 242, a }; +S sQU[] = { 224, 228, 0 }; +S secf2g[] = { 236, 242, a }; +S sQUg[] = { 224, 228, a }; +S sf8fa[] = { 248, 250, 0 }; +S secQ[] = { 236, 224, 0 }; +S sf8Ug[] = { 248, 228, a }; +S sVfa[] = { 229, 250, 0 }; +S sgf9[] = { 32, 249, 0 }; +S sf9Q[] = { 249, 224, 0 }; +S sgf8V[] = { 32, 248, 229, 0 }; +S se9f1[] = { 233, 241, 0 }; +S sgUf8[] = { 32, 228, 248, 0 }; +S sf4Ug[] = { 244, 228, a }; +S sf2U[] = { 242, 228, 0 }; +S sgVf0[] = { 32, 229, 240, 0 }; +S sUecg[] = { 228, 236, a }; +S sgedf2[] = { 32, 237, 242, 0 }; +S sTee[] = { 227, 238, 0 }; +S sgUe9[] = { 32, 228, 233, 0 }; +S se9f0V[] = { 233, 240, 229, 0 }; +S sVf7[] = { 229, 247, 0 }; +S sf9f8[] = { 249, 248, 0 }; +S sedf2[] = { 237, 242, 0 }; +S se9f6[] = { 233, 246, 0 }; +S sf9V[] = { 249, 229, 0 }; +S sf9ee[] = { 249, 238, 0 }; +S sUf8[] = { 228, 248, 0 }; +S sgUec[] = { 32, 228, 236, 0 }; +S sfaVf8[] = { 250, 229, 248, 0 }; +S seceb[] = { 236, 235, 0 }; +S sgefV[] = { 32, 239, 229, 0 }; +S sgfaVf0[] = { 32, 250, 229, 240, 0 }; +S sfaU[] = { 250, 228, 0 }; +S se9S[] = { 233, 226, 0 }; +S sRV[] = { 225, 229, 0 }; +S sVQ[] = { 229, 224, 0 }; +S sgedf2g[] = { 32, 237, 242, a }; +S sQR[] = { 224, 225, 0 }; +S sefV[] = { 239, 229, 0 }; +S se7Q[] = { 231, 224, 0 }; +S se9Q[] = { 233, 224, 0 }; +S sf9e9g[] = { 249, 233, a }; +S sgfaQg[] = { 32, 250, 224, a }; +S sQV[] = { 224, 229, 0 }; +S sfaee[] = { 250, 238, 0 }; +S sgfaVf8[] = { 32, 250, 229, 248, 0 }; +S sedf2g[] = { 237, 242, a }; +S sVV[] = { 229, 229, 0 }; +S sf2R[] = { 242, 225, 0 }; +S sgf2[] = { 32, 242, 0 }; +S sTf2[] = { 227, 242, 0 }; +S sf9Qf8[] = { 249, 224, 248, 0 }; +S se9ebg[] = { 233, 235, a }; +S sede9f8[] = { 237, 233, 248, 0 }; +S secQf8[] = { 236, 224, 248, 0 }; +S sgede9T[] = { 32, 237, 233, 227, 0 }; +S se8f1[] = { 232, 241, 0 }; +S sfaVf9[] = { 250, 229, 249, 0 }; +S sVS[] = { 229, 226, 0 }; +S sf2Ug[] = { 242, 228, a }; +S sgede9f8[] = { 32, 237, 233, 248, 0 }; +S sf1ec[] = { 241, 236, 0 }; +S sRf8[] = { 225, 248, 0 }; +S sfaVe9[] = { 250, 229, 233, 0 }; +S sUR[] = { 228, 225, 0 }; +S sf2V[] = { 242, 229, 0 }; +S sf0R[] = { 240, 225, 0 }; +S sf2f4[] = { 242, 244, 0 }; +S sf8f7[] = { 248, 247, 0 }; +S secf4[] = { 236, 244, 0 }; +S sUf9[] = { 228, 249, 0 }; +S sf7U[] = { 247, 228, 0 }; +S sgfaVf9[] = { 32, 250, 229, 249, 0 }; +S se9f0e9[] = { 233, 240, 233, 0 }; +S sf8e7Q[] = { 248, 231, 224, 0 }; +S sede9T[] = { 237, 233, 227, 0 }; +S se9e8f1[] = { 233, 232, 241, 0 }; +S sge9eb[] = { 32, 233, 235, 0 }; +S sUee[] = { 228, 238, 0 }; +S sQf8f9e9[] = { 224, 248, 249, 233, 0 }; +S sfaf9[] = { 250, 249, 0 }; +S sge9ebg[] = { 32, 233, 235, a }; +S sgede9ec[] = { 32, 237, 233, 236, 0 }; +S se9e8f1ec[] = { 233, 232, 241, 236, 0 }; +S seeec[] = { 238, 236, 0 }; +S sgefe9e9[] = { 32, 239, 233, 233, 0 }; +S sQec[] = { 224, 236, 0 }; +S se8f1ec[] = { 232, 241, 236, 0 }; +S sf8f9e9[] = { 248, 249, 233, 0 }; +S sede9ec[] = { 237, 233, 236, 0 }; +S sf8e8[] = { 248, 232, 0 }; +S sfaf8[] = { 250, 248, 0 }; +S sefe9e9[] = { 239, 233, 233, 0 }; +S sf1U[] = { 241, 228, 0 }; +S secQf8f9[] = { 236, 224, 248, 249, 0 }; +S sf8T[] = { 248, 227, 0 }; +S sf8ec[] = { 248, 236, 0 }; +S sQf8f9[] = { 224, 248, 249, 0 }; +S sQecg[] = { 224, 236, a }; +S sf6Ug[] = { 246, 228, a }; +S se9e7[] = { 233, 231, 0 }; +S se7ee[] = { 231, 238, 0 }; +S sgecQ[] = { 32, 236, 224, 0 }; +S sQRg[] = { 224, 225, a }; +S sgfaf8[] = { 32, 250, 248, 0 }; +S se9f7[] = { 233, 247, 0 }; +S sfaUg[] = { 250, 228, a }; +S se9V[] = { 233, 229, 0 }; +S se9Te9[] = { 233, 227, 233, 0 }; +S sf6U[] = { 246, 228, 0 }; +S sQf9[] = { 224, 249, 0 }; +S sf0f9[] = { 240, 249, 0 }; +S sede9f0[] = { 237, 233, 240, 0 }; +S sRU[] = { 225, 228, 0 }; +S sf7Ug[] = { 247, 228, a }; +S sf2ee[] = { 242, 238, 0 }; +S se9f1V[] = { 233, 241, 229, 0 }; +S sf0e9Tee[] = { 240, 233, 227, 238, 0 }; +S sVf0e9[] = { 229, 240, 233, 0 }; +S sSe9[] = { 226, 233, 0 }; +S sf1ecf4[] = { 241, 236, 244, 0 }; +S sf2e9[] = { 242, 233, 0 }; +S sf8f9g[] = { 248, 249, a }; +S sedSg[] = { 237, 226, a }; +S sgRe9[] = { 32, 225, 233, 0 }; +S sf1Q[] = { 241, 224, 0 }; +S sVf0g[] = { 229, 240, a }; +S sgedSg[] = { 32, 237, 226, a }; +S sf1Ug[] = { 241, 228, a }; +S se9Tee[] = { 233, 227, 238, 0 }; +S se9Ug[] = { 233, 228, a }; +S sf8Qg[] = { 248, 224, a }; +S sgecQf8[] = { 32, 236, 224, 248, 0 }; +S se9fa[] = { 233, 250, 0 }; +S sf8faV[] = { 248, 250, 229, 0 }; +S sSU[] = { 226, 228, 0 }; +S se7eeg[] = { 231, 238, a }; +S sfaVf9f8[] = { 250, 229, 249, 248, 0 }; +S se7V[] = { 231, 229, 0 }; +S sfaf0[] = { 250, 240, 0 }; +S sf9ecg[] = { 249, 236, a }; +S sQe9[] = { 224, 233, 0 }; +S sgf9Q[] = { 32, 249, 224, 0 }; +S sgede9f0[] = { 32, 237, 233, 240, 0 }; +S seee9[] = { 238, 233, 0 }; +S sgedS[] = { 32, 237, 226, 0 }; +S sQee[] = { 224, 238, 0 }; +S sgTV[] = { 32, 227, 229, 0 }; +S sSf4[] = { 226, 244, 0 }; +S sf0e9T[] = { 240, 233, 227, 0 }; +S sgUR[] = { 32, 228, 225, 0 }; +S sVf9f8[] = { 229, 249, 248, 0 }; +S se7e9[] = { 231, 233, 0 }; +S sgfaVe9[] = { 32, 250, 229, 233, 0 }; +S sRUg[] = { 225, 228, a }; +S sgVfa[] = { 32, 229, 250, 0 }; +S se8f1ecf4[] = { 232, 241, 236, 244, 0 }; +S sebU[] = { 235, 228, 0 }; +S sebUg[] = { 235, 228, a }; +S sTf2g[] = { 227, 242, a }; +S seeee[] = { 238, 238, 0 }; +S sf6f2[] = { 246, 242, 0 }; +S sf0ee[] = { 240, 238, 0 }; +S seeRg[] = { 238, 225, a }; +S sedS[] = { 237, 226, 0 }; +S sVRg[] = { 229, 225, a }; +S se9e9f6[] = { 233, 233, 246, 0 }; +S seaeb[] = { 234, 235, 0 }; +S sfaec[] = { 250, 236, 0 }; +S sQf8g[] = { 224, 248, a }; +S sTg[] = { 227, a }; +S sVUg[] = { 229, 228, a }; +S se8f9[] = { 232, 249, 0 }; +S seee7[] = { 238, 231, 0 }; +S sge9f0V[] = { 32, 233, 240, 229, 0 }; +S sefe9R[] = { 239, 233, 225, 0 }; +S sede9ee[] = { 237, 233, 238, 0 }; +S sTf8[] = { 227, 248, 0 }; +S sfaVR[] = { 250, 229, 225, 0 }; +S se7fa[] = { 231, 250, 0 }; +S sf9f8Ug[] = { 249, 248, 228, a }; +S se9f9g[] = { 233, 249, a }; +S sVeeg[] = { 229, 238, a }; +S sWeeg[] = { 230, 238, a }; +S sVf9f8U[] = { 229, 249, 248, 228, 0 }; +S secf4Ug[] = { 236, 244, 228, a }; +S sf7ec[] = { 247, 236, 0 }; +S se9f0e9e8[] = { 233, 240, 233, 232, 0 }; +S sgeceb[] = { 32, 236, 235, 0 }; +S sf4Q[] = { 244, 224, 0 }; +S se8f7[] = { 232, 247, 0 }; +S sUUg[] = { 228, 228, a }; +S sVfag[] = { 229, 250, a }; +S sf8ee[] = { 248, 238, 0 }; +S sTeeU[] = { 227, 238, 228, 0 }; +S sf9f4Q[] = { 249, 244, 224, 0 }; +S sf2Rg[] = { 242, 225, a }; +S secec[] = { 236, 236, 0 }; +S sf9fa[] = { 249, 250, 0 }; +S sRVf9[] = { 225, 229, 249, 0 }; +S secf9ee[] = { 236, 249, 238, 0 }; +S sUf0e9[] = { 228, 240, 233, 0 }; +S se9f0Ve9[] = { 233, 240, 229, 233, 0 }; +S sVf7e9[] = { 229, 247, 233, 0 }; +S se9f0f9[] = { 233, 240, 249, 0 }; +S sf0e9e8f1[] = { 240, 233, 232, 241, 0 }; +S seef2[] = { 238, 242, 0 }; +S sf8f6[] = { 248, 246, 0 }; +S sgede9e9[] = { 32, 237, 233, 233, 0 }; +S sgede9ee[] = { 32, 237, 233, 238, 0 }; +S se9f0R[] = { 233, 240, 225, 0 }; +S sVe8[] = { 229, 232, 0 }; +S sgUf0e9[] = { 32, 228, 240, 233, 0 }; +S sgfaVR[] = { 32, 250, 229, 225, 0 }; +S sgefe9R[] = { 32, 239, 233, 225, 0 }; +S sf0e7[] = { 240, 231, 0 }; +S sf8f9f4Q[] = { 248, 249, 244, 224, 0 }; +S sVf8e9[] = { 229, 248, 233, 0 }; +S seefa[] = { 238, 250, 0 }; +S sTeeUg[] = { 227, 238, 228, a }; +S sgf8e7[] = { 32, 248, 231, 0 }; +S sf0e9e8[] = { 240, 233, 232, 0 }; +S se9f4g[] = { 233, 244, a }; +S sgeaeb[] = { 32, 234, 235, 0 }; +S se9TeeU[] = { 233, 227, 238, 228, 0 }; +S sf4ec[] = { 244, 236, 0 }; +S sgTf2[] = { 32, 227, 242, 0 }; +S sf4f8[] = { 244, 248, 0 }; +S sf9eeee[] = { 249, 238, 238, 0 }; +S se7Ug[] = { 231, 228, a }; +S sgf8fa[] = { 32, 248, 250, 0 }; +S sgf9Qf8[] = { 32, 249, 224, 248, 0 }; +S sf8f9e9g[] = { 248, 249, 233, a }; +S sece8[] = { 236, 232, 0 }; +S sQVg[] = { 224, 229, a }; +S sf4ee[] = { 244, 238, 0 }; +S sf1ecf4U[] = { 241, 236, 244, 228, 0 }; +S sVf9e9[] = { 229, 249, 233, 0 }; +S sf9e9S[] = { 249, 233, 226, 0 }; +S sf0Rg[] = { 240, 225, a }; +S se7U[] = { 231, 228, 0 }; +S sede9f2[] = { 237, 233, 242, 0 }; +S secf9eeee[] = { 236, 249, 238, 238, 0 }; +S sf1ee[] = { 241, 238, 0 }; +S sf9Qf8g[] = { 249, 224, 248, a }; +S sWee[] = { 230, 238, 0 }; +S sede9e9[] = { 237, 233, 233, 0 }; +S sf0fa[] = { 240, 250, 0 }; +S sgedV[] = { 32, 237, 229, 0 }; +S sUQ[] = { 228, 224, 0 }; +S sgf8faV[] = { 32, 248, 250, 229, 0 }; +S sge9T[] = { 32, 233, 227, 0 }; +S secf4U[] = { 236, 244, 228, 0 }; +S sfae9f0e9[] = { 250, 233, 240, 233, 0 }; +S sVf8g[] = { 229, 248, a }; +S sf0Ve9[] = { 240, 229, 233, 0 }; +S sRecg[] = { 225, 236, a }; +S sf9f4[] = { 249, 244, 0 }; +S sf8f9f4[] = { 248, 249, 244, 0 }; +S sgede9f2[] = { 32, 237, 233, 242, 0 }; +S sgfaf9[] = { 32, 250, 249, 0 }; +S sf8ecg[] = { 248, 236, a }; +S sf9f8U[] = { 249, 248, 228, 0 }; +S sf0faf0g[] = { 240, 250, 240, a }; +S sf0faf0[] = { 240, 250, 240, 0 }; +S sRf8g[] = { 225, 248, a }; +S sfaf0g[] = { 250, 240, a }; +S sf0Vf8[] = { 240, 229, 248, 0 }; +S sVf9Qf8[] = { 229, 249, 224, 248, 0 }; +S sUe9U[] = { 228, 233, 228, 0 }; +S sVe7U[] = { 229, 231, 228, 0 }; + +N l20n0[] = { { sf9e9g, .809 }, H }; +N l20n1[] = { { sf0R, .315 }, { sVW, .270 }, H }; +N l20n3[] = { { sgedf2, .404 }, { sgf3, .210 }, { sf1ecf4U, .360 }, H }; +N l20n4[] = { { sgU, 2.037 }, { sf4f8, .180 }, H }; +N l20n5[] = { { se9ee, .674 }, H }; +N l20n6[] = { { secf2g, 1.011 }, { sQf8f9e9, .539 }, H }; +N l20n7[] = { { sf9Q, .449 }, { sgUe9, .404 }, { seeV, .360 }, { secQf8f9, .539 }, H }; +N l20n8[] = { { sWeeg, .404 }, H }; +N l20n9[] = { { se8R, .225 }, { sgf9Q, .225 }, { sf7g, .270 }, H }; +N l20n11[] = { { sVf0g, .506 }, H }; +N l20n12[] = { { sgfaVe9, .300 }, { sVRg, .404 }, H }; +N l20n13[] = { { sece9, .315 }, { sf7U, .315 }, { sf8f9f4, .270 }, H }; +N l20n15[] = { { sfae9f0, .742 }, { se9f1V, .337 }, { sf1Q, .225 }, { sgUf0e9, .240 }, { sf9Qf8g, .539 }, H }; +N l20n16[] = { { sf4Ug, .910 }, H }; +N l20n17[] = { { sQR, .360 }, { sVf6, .225 }, H }; +N l20n18[] = { { sVe7, .539 }, H }; +N l20n20[] = { { sUf8, .404 }, { sfaee, .360 }, { sf0e9Tee, .449 }, { sgecQf8, .300 }, { sf8ecg, .404 }, H }; +N l20n21[] = { { sgV, 1.019 }, { sUe9, .629 }, { sedSg, .506 }, { sefe9R, .270 }, H }; +N l20n22[] = { { sfaVf9f8, .449 }, { sgf8fa, .180 }, H }; +N l20n23[] = { { se9Q, .360 }, { sTeeU, .270 }, { sRf8g, .303 }, H }; +N l20n25[] = { { se7g, .607 }, { se8f1, .315 }, { se8f1ecf4, .449 }, H }; +N l20n26[] = { { sgfaQ, .629 }, { sge9T, .180 }, H }; +N l20n27[] = { { sf8T, .270 }, H }; +N l20n28[] = { { secQf8, .472 }, { sf2ee, .225 }, H }; +N l20n29[] = { { secf9, 1.079 }, { se7U, .180 }, H }; +N l20n30[] = { { sf7V, .270 }, H }; +N l20n32[] = { { se9f9g, .404 }, { sUUg, .404 }, H }; +N l20n33[] = { { sgfaVf0, .479 }, { secf9eeee, .360 }, H }; +N l20n34[] = { { sVf7, .404 }, { sgfaf8, .270 }, H }; +N l20n35[] = { { sfaVf8, .607 }, { seeRg, .506 }, { sVe8, .180 }, H }; +N l20n37[] = { { sedf2g, .809 }, { sUf9, .315 }, { sgf5, .120 }, { sVf7e9, .270 }, H }; +N l20n38[] = { { sfaQ, .764 }, { sefV, .360 }, { sfaVR, .270 }, H }; +N l20n39[] = { { se9f0, 1.528 }, { se7eeg, .506 }, { sRVf9, .270 }, H }; +N l20n40[] = { { sf8g, 1.416 }, { se9R, .854 }, { sgUec, .404 }, H }; +N l20n41[] = { { seee7, .180 }, H }; +N l20n42[] = { { se9f0e9, .472 }, H }; +N l20n44[] = { { sede9, 2.292 }, { sf8U, .674 }, { sQecg, .607 }, { sgecQ, .270 }, H }; +N l20n45[] = { { sVf2g, .607 }, { sgfaf9, .180 }, H }; +N l20n46[] = { { sfaVf9, .472 }, { se7V, .225 }, H }; +N l20n47[] = { { sgf8V, .449 }, { seceb, .360 }, { sf9eeee, .270 }, { sede9e9, .270 }, H }; +N l20n48[] = { { sf0g, 1.146 }, { se9TeeU, .360 }, H }; +N l20n50[] = { { se9ebg, .708 }, H }; +N l20n51[] = { { sVf8, 1.034 }, { sf9ecg, .506 }, H }; +N l20n52[] = { { sVe9, 1.034 }, H }; +N l20n54[] = { { sfaf0, .225 }, { sVf8e9, .270 }, H }; +N l20n55[] = { { sge7, .210 }, H }; +N l20n56[] = { { se9f1, .449 }, { sf4ec, .180 }, H }; +N l20n57[] = { { se9S, .360 }, { sgfaVf8, .479 }, H }; +N l20n60[] = { { sgfaVf9, .419 }, H }; +N l20n61[] = { { sf8V, .854 }, { se8f1ec, .404 }, H }; +N l20n63[] = { { sgecf9, .674 }, { sf2R, .360 }, { sVUg, .404 }, H }; +N l20n64[] = { { sQg, 2.427 }, { secec, .180 }, H }; +N l20n65[] = { { sRS, .180 }, H }; +N l20n66[] = { { se9e9f6, .270 }, H }; +N l20n68[] = { { sVf9, .809 }, { sQU, .449 }, H }; +N l20n69[] = { { sf0V, .764 }, { sgf8e7, .180 }, H }; +N l20n71[] = { { sf9g, 2.359 }, { sgf7, .210 }, { sVf9e9, .270 }, H }; +N l20n72[] = { { sUec, .854 }, { sf8Qg, .506 }, { sf0Ve9, .270 }, H }; +N l20n73[] = { { se9f2, .629 }, { sgede9T, .419 }, H }; +N l20n74[] = { { se9T, .989 }, { sf0e9T, .337 }, H }; +N l20n75[] = { { sTee, .404 }, { sQf8f9, .404 }, { seee9, .225 }, { sRecg, .404 }, H }; +N l20n77[] = { { sgfae9f0, .659 }, { se9Te9, .404 }, H }; +N l20n78[] = { { sf6Ug, .607 }, H }; +N l20n79[] = { { sf1g, .270 }, H }; +N l20n80[] = { { sede9ec, .404 }, H }; +N l20n81[] = { { sgfaV, 2.022 }, H }; +N l20n82[] = { { sgecf2g, .599 }, H }; +N l20n83[] = { { sf1U, .270 }, { sgedS, .225 }, H }; +N l20n84[] = { { sgUf0, .494 }, { sf0e9e8f1, .360 }, H }; +N l20n85[] = { { sVfa, .449 }, { sQV, .360 }, H }; +N l20n86[] = { { seeUg, 1.719 }, { sVeb, .404 }, { sf9e9S, .270 }, H }; +N l20n87[] = { { se9g, 1.483 }, { sf1ecf4, .337 }, { secf9ee, .270 }, H }; +N l20n88[] = { { sgf8, 1.348 }, { sge9f0V, .240 }, H }; +N l20n89[] = { { sge9, 1.109 }, { sgTf2, .180 }, H }; +N l20n90[] = { { sf4ee, .180 }, { sf0faf0g, .404 }, H }; +N l20n91[] = { { se9U, .719 }, { sgede9e9, .240 }, { sf9f4, .180 }, H }; +N l20n92[] = { { sf9V, .404 }, H }; +N l20n94[] = { { sf8f6, .180 }, H }; +N l20n95[] = { { sRg, 4.112 }, { sf8e7, .449 }, H }; +N l20n97[] = { { sf0Rg, .404 }, H }; +N l20n98[] = { { sf7e9, .404 }, H }; +N l20n99[] = { { sgedf2g, .479 }, { sRU, .225 }, { sgecV, .225 }, H }; +N l20n100[] = { { sf1V, .360 }, { sgede9ec, .360 }, H }; +N l20n101[] = { { sgVf0, .404 }, { sgefe9R, .240 }, H }; +N l20n102[] = { { sfag, 1.011 }, { sede9ee, .270 }, H }; +N l20n103[] = { { sf0e7, .180 }, H }; +N l20n105[] = { { sgf9, .300 }, H }; +N l20n106[] = { { sefe9, .629 }, { sgea, .270 }, { sfaU, .360 }, { sUee, .270 }, { sgede9ee, .240 }, H }; +N l20n107[] = { { se9f4, .449 }, { sf9f8U, .270 }, H }; +N l20n108[] = { { se9V, .270 }, { sf4Q, .180 }, { seefa, .180 }, H }; +N l20n109[] = { { sefe9e9, .404 }, { sf7Ug, .506 }, H }; +N l20n110[] = { { sf2g, 2.427 }, { sTR, .404 }, H }; +N l20n111[] = { { sf8f7, .315 }, H }; +N l20n112[] = { { sf8e8, .270 }, { sgede9f0, .300 }, H }; +N l20n113[] = { { sQRg, .607 }, H }; +N l20n114[] = { { sf2U, .404 }, { sge9eb, .270 }, { se7e9, .225 }, H }; +N l20n116[] = { { secQ, .449 }, { sRV, .360 }, { sgedV, .180 }, H }; +N l20n118[] = { { sgede9f2, .240 }, H }; +N l20n119[] = { { sTeeUg, .539 }, H }; +N l20n121[] = { { sf8faV, .337 }, H }; +N l20n122[] = { { sgfa, 2.846 }, { sgfaQg, .479 }, H }; +N l20n123[] = { { sfaV, 2.472 }, H }; +N l20n124[] = { { sede9f0, .337 }, { sUQ, .180 }, H }; +N l20n125[] = { { secf9g, 1.618 }, { sgfae9, .674 }, { sgefe9e9, .360 }, { se7Ug, .404 }, H }; +N l20n126[] = { { sSg, .539 }, { sfaVe9, .472 }, { seeec, .270 }, H }; +N l20n127[] = { { se8f7, .180 }, H }; +N l20n129[] = { { sf8e9, .584 }, { sf0e9e8, .270 }, H }; +N l20n130[] = { { sf2f4, .315 }, { sSU, .225 }, H }; +N l20n131[] = { { sf2V, .315 }, { sgeaeb, .180 }, H }; +N l20n132[] = { { se9Tee, .337 }, H }; +N l20n134[] = { { sfaQg, 1.112 }, H }; +N l20n136[] = { { se9Rg, 1.011 }, { sgede9f8, .419 }, H }; +N l20n137[] = { { sf0e9, .809 }, { sVee, .629 }, H }; +N l20n140[] = { { sgec, 1.558 }, { sUf0, .629 }, { sf8Ug, 1.011 }, H }; +N l20n141[] = { { se9f6, .404 }, { sUR, .315 }, H }; +N l20n142[] = { { se9e7, .270 }, H }; +N l20n143[] = { { sTf2, .315 }, { sUf0e9, .270 }, H }; +N l20n145[] = { { sf8f9, .764 }, H }; +N l20n146[] = { { sSf4, .225 }, { sede9f2, .270 }, H }; +N l20n147[] = { { se7fa, .180 }, { sVf8g, .404 }, H }; +N l20n148[] = { { sVe9g, .809 }, { sf8f9e9, .404 }, { secf4U, .270 }, H }; +N l20n149[] = { { sebg, 1.888 }, { sf7ec, .180 }, H }; +N l20n150[] = { { sgefV, .360 }, { sfaf0g, .303 }, H }; +N l20n152[] = { { sQf8, .809 }, { sVf9f8U, .360 }, H }; +N l20n153[] = { { sf0f9, .270 }, { sQe9, .225 }, { sebU, .225 }, H }; +N l20n155[] = { { sVQ, .360 }, H }; +N l20n157[] = { { sged, 2.337 }, { sTg, .270 }, H }; +N l20n158[] = { { se9f7, .270 }, H }; +N l20n159[] = { { sgecf9g, .839 }, { se9e8, .494 }, { sf9f8, .404 }, { sf2Rg, .404 }, H }; +N l20n160[] = { { sgede9, 2.292 }, { sf9e9, .764 }, { seeee, .225 }, H }; +N l20n161[] = { { se8f9, .180 }, H }; +N l20n162[] = { { sf8fa, .449 }, H }; +N l20n164[] = { { sQUg, 1.011 }, H }; +N l20n165[] = { { sgeceb, .180 }, H }; +N l20n166[] = { { secf2, .584 }, H }; +N l20n168[] = { { sUecg, .910 }, { sf1e9, .180 }, { sWee, .180 }, H }; +N l20n169[] = { { sge9f0, .494 }, { sQf9, .270 }, H }; +N l20n170[] = { { sebV, .270 }, { sf0fa, .180 }, H }; +N l20n171[] = { { sVf0, 1.168 }, H }; +N l20n172[] = { { sVR, .764 }, { sf4g, .809 }, { sgUf8, .404 }, H }; +N l20n173[] = { { sf8f9f4Q, .360 }, H }; +N l20n174[] = { { sVf0e9, .337 }, H }; +N l20n175[] = { { se9f8, .809 }, { sf9Qf8, .472 }, { sgUR, .225 }, H }; +N l20n176[] = { { se9e9, .719 }, { sf4U, .494 }, H }; +N l20n178[] = { { sTV, .449 }, H }; +N l20n179[] = { { sgedSg, .300 }, { sf1Ug, .506 }, H }; +N l20n180[] = { { secg, 3.303 }, { sf8ec, .270 }, H }; +N l20n181[] = { { sedS, .225 }, { sVfag, .404 }, { sQVg, .404 }, H }; +N l20n183[] = { { sRf8, .315 }, H }; +N l20n184[] = { { sRe9, .404 }, H }; +N l20n185[] = { { se9f0Ve9, .360 }, H }; +N l20n187[] = { { se9Ug, .506 }, H }; +N l20n188[] = { { sUg, 7.955 }, { sVf1, .225 }, H }; +N l20n189[] = { { sVS, .315 }, H }; +N l20n190[] = { { se9e8f1ec, .539 }, { sfaf8, .270 }, H }; +N l20n191[] = { { sgef, .869 }, { sfae9, .764 }, H }; +N l20n192[] = { { se9f9, .584 }, { sgQ, .240 }, { sUU, .180 }, H }; +N l20n193[] = { { sf9fa, .180 }, H }; +N l20n194[] = { { sgefe9, .629 }, H }; +N l20n195[] = { { seeR, .225 }, { sRUg, .506 }, H }; +N l20n197[] = { { sedf2, .404 }, { sgf8faV, .240 }, H }; +N l20n199[] = { { se7ee, .270 }, { sf2e9, .225 }, H }; +N l20n200[] = { { secf4, .315 }, H }; +N l20n201[] = { { secV, .629 }, H }; +N l20n202[] = { { sfaUg, .607 }, { sgTV, .225 }, { sfae9f0e9, .360 }, H }; +N l20n203[] = { { sfaVf0, .674 }, { sf9f8Ug, .539 }, { se9f4g, .404 }, H }; +N l20n204[] = { { sQec, .270 }, { sVf9Qf8, .270 }, H }; +N l20n205[] = { { sVf2, .584 }, H }; +N l20n206[] = { { sVT, .315 }, H }; +N l20n207[] = { { sfaf9, .270 }, H }; +N l20n209[] = { { sgR, .389 }, { se9fa, .225 }, H }; +N l20n210[] = { { se9eb, .539 }, { sf2Ug, .708 }, { sge9ebg, .360 }, { se9f0R, .270 }, H }; +N l20n211[] = { { sf9ec, .225 }, { sgVfa, .225 }, H }; +N l20n212[] = { { sede9f8, .472 }, { sgRe9, .225 }, H }; +N l20n214[] = { { sf8ee, .180 }, H }; +N l20n215[] = { { sSe9, .225 }, H }; +N l20n217[] = { { se7Q, .360 }, H }; +N l20n218[] = { { se9f0f9, .270 }, H }; +N l20n219[] = { { sVg, .809 }, { sf1ec, .315 }, H }; +N l20n220[] = { { sf6f2, .225 }, H }; +N l20n222[] = { { sf0ee, .225 }, { sVe7U, .202 }, H }; +N l20n223[] = { { sVU, .584 }, H }; +N l20n225[] = { { sgf1, .120 }, { sUe9U, .202 }, H }; +N l20n226[] = { { se9f0e9e8, .360 }, H }; +N l20n227[] = { { se9ec, .629 }, H }; +N l20n228[] = { { seef2, .180 }, H }; +N l20n232[] = { { sf8Q, .494 }, { sedV, .180 }, H }; +N l20n233[] = { { sVeeg, .404 }, H }; +N l20n234[] = { { sf6g, .404 }, H }; +N l20n235[] = { { sRec, .180 }, H }; +N l20n236[] = { { sVf9f8, .337 }, H }; +N l20n237[] = { { sede9T, .472 }, { sf0Vf8, .202 }, H }; +N l20n238[] = { { sf6U, .270 }, { sQee, .225 }, H }; +N l20n239[] = { { sVf4, .360 }, { sTf2g, .506 }, H }; +N l20n240[] = { { sVV, .360 }, H }; +N l20n241[] = { { sf8f9g, .506 }, { seaeb, .180 }, { sgf9Qf8, .240 }, H }; +N l20n242[] = { { seeg, 3.034 }, { sgecf2, .494 }, { sgf2, .240 }, { sfaec, .180 }, H }; +N l20n243[] = { { sgT, .809 }, H }; +N l20n244[] = { { secf4Ug, .539 }, { sgfaVR, .240 }, { sf8f9e9g, .539 }, H }; +N l20n245[] = { { sf9ee, .404 }, { sTf8, .180 }, H }; +N l20n246[] = { { seeU, .764 }, { sTe9, .494 }, { sgTe9, .180 }, H }; +N l20n248[] = { { sQf8g, .404 }, H }; +N l20n249[] = { { sebUg, .506 }, H }; +N l20n250[] = { { se9e8f1, .404 }, { sWg, .404 }, { sf0faf0, .202 }, H }; +N l20n251[] = { { sf9f4Q, .270 }, H }; +N l20n252[] = { { sece8, .180 }, H }; +N l20n253[] = { { sf1ee, .180 }, H }; +N l20n254[] = { { se9f0V, .607 }, H }; +N l20n255[] = { { sf8e7Q, .472 }, { sf6V, .225 }, H }; + +D l20_d = { "hebrew", "iso-8859-8", - { - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,0.002,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - Y,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V, - V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V, - 0.201,0.218,0.070,0.142,0.406,0.467,0.034,0.102,0.063,0.532,0.016,0.097,0.279,0.140,0.212,0.052, - 0.174,0.086,0.160,0.013,0.092,0.007,0.054,0.084,0.300,0.216,0.275,V,V,V,V,V - }, - { - l20n0,l20n1,X,l20n3,l20n4,l20n5,l20n6,l20n7,l20n8,l20n9,X,l20n11,l20n12,l20n13,X,l20n15, - l20n16,l20n17,l20n18,X,l20n20,l20n21,l20n22,l20n23,X,l20n25,l20n26,l20n27,l20n28,l20n29,l20n30,X, - l20n32,l20n33,l20n34,l20n35,X,l20n37,l20n38,l20n39,l20n40,l20n41,l20n42,X,l20n44,l20n45,l20n46,l20n47, - l20n48,X,l20n50,l20n51,l20n52,X,l20n54,l20n55,l20n56,l20n57,X,X,l20n60,l20n61,X,l20n63, - l20n64,l20n65,l20n66,X,l20n68,l20n69,X,l20n71,l20n72,l20n73,l20n74,l20n75,X,l20n77,l20n78,l20n79, - l20n80,l20n81,l20n82,l20n83,l20n84,l20n85,l20n86,l20n87,l20n88,l20n89,l20n90,l20n91,l20n92,X,l20n94,l20n95, - X,l20n97,l20n98,l20n99,l20n100,l20n101,l20n102,l20n103,X,l20n105,l20n106,l20n107,l20n108,l20n109,l20n110,l20n111, - l20n112,l20n113,l20n114,X,l20n116,X,l20n118,l20n119,X,l20n121,l20n122,l20n123,l20n124,l20n125,l20n126,l20n127, - X,l20n129,l20n130,l20n131,l20n132,X,l20n134,X,l20n136,l20n137,X,X,l20n140,l20n141,l20n142,l20n143, - X,l20n145,l20n146,l20n147,l20n148,l20n149,l20n150,X,l20n152,l20n153,X,l20n155,X,l20n157,l20n158,l20n159, - l20n160,l20n161,l20n162,X,l20n164,l20n165,l20n166,X,l20n168,l20n169,l20n170,l20n171,l20n172,l20n173,l20n174,l20n175, - l20n176,X,l20n178,l20n179,l20n180,l20n181,X,l20n183,l20n184,l20n185,X,l20n187,l20n188,l20n189,l20n190,l20n191, - l20n192,l20n193,l20n194,l20n195,X,l20n197,X,l20n199,l20n200,l20n201,l20n202,l20n203,l20n204,l20n205,l20n206,l20n207, - X,l20n209,l20n210,l20n211,l20n212,X,l20n214,l20n215,X,l20n217,l20n218,l20n219,l20n220,X,l20n222,l20n223, - X,l20n225,l20n226,l20n227,l20n228,X,X,X,l20n232,l20n233,l20n234,l20n235,l20n236,l20n237,l20n238,l20n239, - l20n240,l20n241,l20n242,l20n243,l20n244,l20n245,l20n246,X,l20n248,l20n249,l20n250,l20n251,l20n252,l20n253,l20n254,l20n255 - } + { W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, 0.002, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + Y, V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, + V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, + 0.201, 0.218, 0.070, 0.142, 0.406, 0.467, 0.034, 0.102, 0.063, 0.532, 0.016, 0.097, 0.279, 0.140, 0.212, 0.052, + 0.174, 0.086, 0.160, 0.013, 0.092, 0.007, 0.054, 0.084, 0.300, 0.216, 0.275, V, V, V, V, V }, + { l20n0, l20n1, X, l20n3, l20n4, l20n5, l20n6, l20n7, l20n8, l20n9, X, l20n11, l20n12, l20n13, X, l20n15, + l20n16, l20n17, l20n18, X, l20n20, l20n21, l20n22, l20n23, X, l20n25, l20n26, l20n27, l20n28, l20n29, l20n30, X, + l20n32, l20n33, l20n34, l20n35, X, l20n37, l20n38, l20n39, l20n40, l20n41, l20n42, X, l20n44, l20n45, l20n46, l20n47, + l20n48, X, l20n50, l20n51, l20n52, X, l20n54, l20n55, l20n56, l20n57, X, X, l20n60, l20n61, X, l20n63, + l20n64, l20n65, l20n66, X, l20n68, l20n69, X, l20n71, l20n72, l20n73, l20n74, l20n75, X, l20n77, l20n78, l20n79, + l20n80, l20n81, l20n82, l20n83, l20n84, l20n85, l20n86, l20n87, l20n88, l20n89, l20n90, l20n91, l20n92, X, l20n94, l20n95, + X, l20n97, l20n98, l20n99, l20n100, l20n101, l20n102, l20n103, X, l20n105, l20n106, l20n107, l20n108, l20n109, l20n110, l20n111, + l20n112, l20n113, l20n114, X, l20n116, X, l20n118, l20n119, X, l20n121, l20n122, l20n123, l20n124, l20n125, l20n126, l20n127, + X, l20n129, l20n130, l20n131, l20n132, X, l20n134, X, l20n136, l20n137, X, X, l20n140, l20n141, l20n142, l20n143, + X, l20n145, l20n146, l20n147, l20n148, l20n149, l20n150, X, l20n152, l20n153, X, l20n155, X, l20n157, l20n158, l20n159, + l20n160, l20n161, l20n162, X, l20n164, l20n165, l20n166, X, l20n168, l20n169, l20n170, l20n171, l20n172, l20n173, l20n174, l20n175, + l20n176, X, l20n178, l20n179, l20n180, l20n181, X, l20n183, l20n184, l20n185, X, l20n187, l20n188, l20n189, l20n190, l20n191, + l20n192, l20n193, l20n194, l20n195, X, l20n197, X, l20n199, l20n200, l20n201, l20n202, l20n203, l20n204, l20n205, l20n206, l20n207, + X, l20n209, l20n210, l20n211, l20n212, X, l20n214, l20n215, X, l20n217, l20n218, l20n219, l20n220, X, l20n222, l20n223, + X, l20n225, l20n226, l20n227, l20n228, X, X, X, l20n232, l20n233, l20n234, l20n235, l20n236, l20n237, l20n238, l20n239, + l20n240, l20n241, l20n242, l20n243, l20n244, l20n245, l20n246, X, l20n248, l20n249, l20n250, l20n251, l20n252, l20n253, l20n254, l20n255 } }; - - // // Lng: hungarian // Enc: iso-8859-2 // - -S sw7a[]={s,z,0}; -S sk79[]={g,y,0}; -S sgw7a[]={32,s,z,0}; -S sRv[]={225,r,0}; -S sk79g[]={g,y,a}; -S sgX7ag[]={32,97,z,a}; -S sik79[]={e,g,y,0}; -S se9r[]={233,n,0}; -S sxxg[]={t,t,a}; -S sedx[]={237,t,0}; -S sXk79[]={97,g,y,0}; -S se9t[]={233,p,0}; -S sgik79[]={32,e,g,y,0}; -S sw7ai[]={s,z,e,0}; -S sof6[]={k,246,0}; -S sge9w[]={32,233,s,0}; -S sge9wg[]={32,233,s,a}; -S sZw[]={99,s,0}; -S sYY[]={98,98,0}; -S s7aiv[]={z,e,r,0}; -S sw7aR[]={s,z,225,0}; -S sRwg[]={225,s,a}; -S sosv[]={k,o,r,0}; -S sqik[]={m,e,g,0}; -S sf3p[]={243,l,0}; -S sqR[]={m,225,0}; -S sgqik[]={32,m,e,g,0}; -S s7ae9[]={z,233,0}; -S sf3pg[]={243,l,a}; -S sik79g[]={e,g,y,a}; -S sRk[]={225,g,0}; -S sw7aiv[]={s,z,e,r,0}; -S swed[]={s,237,0}; -S sYXr[]={98,97,n,0}; -S swe9k[]={s,233,g,0}; -S spf3[]={l,243,0}; -S sxf6[]={t,246,0}; -S sf6z[]={246,v,0}; -S swedx[]={s,237,t,0}; -S spix[]={l,e,t,0}; -S sRvg[]={225,r,a}; -S se9o[]={233,k,0}; -S sYXrg[]={98,97,n,a}; -S se9r79[]={233,n,y,0}; -S sRpp[]={225,l,l,0}; -S szXk79[]={v,97,g,y,0}; -S se9xg[]={233,t,a}; -S sf6p[]={246,l,0}; -S sglsk[]={32,h,o,g,0}; -S sgxf6[]={32,t,246,0}; -S sgof6[]={32,k,246,0}; -S sge9v[]={32,233,r,0}; -S sgqR[]={32,m,225,0}; -S sgre9[]={32,n,233,0}; -S sRo[]={225,k,0}; -S srXo[]={n,97,k,0}; -S soixg[]={k,e,t,a}; -S sze9r[]={v,233,n,0}; -S szXk[]={v,97,g,0}; -S sk79i[]={g,y,e,0}; -S sf6v[]={246,r,0}; -S sgzXk[]={32,v,97,g,0}; -S sxe9w[]={t,233,s,0}; -S sRY[]={225,98,0}; -S soix[]={k,e,t,0}; -S slsk[]={h,o,g,0}; -S sw7aX[]={s,z,97,0}; -S sf6x[]={246,t,0}; -S se9z[]={233,v,0}; -S sf3o[]={243,k,0}; -S soRv[]={k,225,r,0}; -S sixxg[]={e,t,t,a}; -S srXog[]={n,97,k,a}; -S sw7ae9[]={s,z,233,0}; -S sYm7a[]={98,i,z,0}; -S sgk79[]={32,g,y,0}; -S sxswed[]={t,o,s,237,0}; -S soY[]={k,98,0}; -S sf6r[]={246,n,0}; -S sv7a[]={r,z,0}; -S sXk79g[]={97,g,y,a}; -S snR[]={j,225,0}; -S sgw7ai[]={32,s,z,e,0}; -S sgw7ae9[]={32,s,z,233,0}; -S s7aix[]={z,e,t,0}; -S sswedx[]={o,s,237,t,0}; -S sgqmr[]={32,m,i,n,0}; -S sgyx[]={32,u,t,0}; -S sm7ax[]={i,z,t,0}; -S syhX[]={u,d,97,0}; -S stw[]={p,s,0}; -S sm7axs[]={i,z,t,o,0}; -S sgYyh[]={32,98,u,d,0}; -S sxf3[]={t,243,0}; -S somg[]={k,i,a}; -S sswed[]={o,s,237,0}; -S se9kg[]={233,g,a}; -S s7af5[]={z,245,0}; -S s79io[]={y,e,k,0}; -S s7axs[]={z,t,o,0}; -S slsk79[]={h,o,g,y,0}; -S sgqe9[]={32,m,233,0}; -S sr79i[]={n,y,e,0}; -S sYm7ax[]={98,i,z,t,0}; -S ssk79[]={o,g,y,0}; -S sge9z[]={32,233,v,0}; -S sYyhX[]={98,u,d,97,0}; -S ssk79g[]={o,g,y,a}; -S sgYy[]={32,98,u,0}; -S swso[]={s,o,k,0}; -S svz[]={r,v,0}; -S s7axsw[]={z,t,o,s,0}; -S siw7a[]={e,s,z,0}; -S s7aw[]={z,s,0}; -S sxsw[]={t,o,s,0}; -S sgoip[]={32,k,e,l,0}; -S sxRr[]={t,225,n,0}; -S spf5[]={l,245,0}; -S srf6z[]={n,246,v,0}; -S sgqXk[]={32,m,97,g,0}; -S sYirg[]={98,e,n,a}; -S sxe9o[]={t,233,k,0}; -S swedxR[]={s,237,t,225,0}; -S spr[]={l,n,0}; -S s79s[]={y,o,0}; -S sk79X[]={g,y,97,0}; -S sxixx[]={t,e,t,t,0}; -S sYYg[]={98,98,a}; -S sre9t[]={n,233,p,0}; -S sedxRw[]={237,t,225,s,0}; -S se9tw[]={233,p,s,0}; -S srf6ze9[]={n,246,v,233,0}; -S sglR[]={32,h,225,0}; -S shf3[]={d,243,0}; -S sRrg[]={225,n,a}; -S sxRw[]={t,225,s,0}; -S sgji[]={32,f,e,0}; -S sriog[]={n,e,k,a}; -S sedxR[]={237,t,225,0}; -S sw7aXo[]={s,z,97,k,0}; -S sr79io[]={n,y,e,k,0}; -S srf6[]={n,246,0}; -S se9Y[]={233,98,0}; -S sqXk[]={m,97,g,0}; -S sgZw[]={32,99,s,0}; -S sedxe9[]={237,t,233,0}; -S se9w7a[]={233,s,z,0}; -S sRvs[]={225,r,o,0}; -S spik[]={l,e,g,0}; -S sikg[]={e,g,a}; -S sRn[]={225,j,0}; -S sf6ze9r[]={246,v,233,n,0}; -S sze9r79[]={v,233,n,y,0}; -S se9r79i[]={233,n,y,e,0}; -S sRog[]={225,k,a}; -S sk79s[]={g,y,o,0}; -S soip[]={k,e,l,0}; -S srXt[]={n,97,p,0}; -S sf6ze9[]={246,v,233,0}; -S s7aXo[]={z,97,k,0}; - -N l21n0[]={{sriog,.217},H}; -N l21n1[]={{stX,.087},H}; -N l21n2[]={{sgik,.489},H}; -N l21n3[]={{ssv,.333},H}; -N l21n5[]={{smr,.145},{spR,.130},H}; -N l21n6[]={{srx,.130},{soixg,.304},{s79s,.072},H}; -N l21n7[]={{sw7a,.883},{sri,.304},H}; -N l21n8[]={{swo,.072},H}; -N l21n9[]={{slX,.174},{sYXr,.174},H}; -N l21n10[]={{sw7ae9,.152},H}; -N l21n11[]={{s7af5,.087},{sipp,.130},H}; -N l21n12[]={{sgp,.282},H}; -N l21n13[]={{swg,.999},{sXr,.275},{spm,.130},{se9z,.228},H}; -N l21n14[]={{se9k,.521},H}; -N l21n15[]={{sRpp,.391},{sji,.101},H}; -N l21n17[]={{sqXk,.109},H}; -N l21n18[]={{sik,.550},{sYyhX,.174},{sedxR,.244},H}; -N l21n20[]={{ssw,.232},H}; -N l21n21[]={{sog,1.520},{sYm7a,.130},{shm,.087},H}; -N l21n22[]={{sRk,.293},{sgzXk,.304},{sXpX,.109},H}; -N l21n24[]={{s79X,.101},{sf6r,.195},{sXmg,.195},{se9w7a,.244},H}; -N l21n25[]={{sxixx,.145},H}; -N l21n26[]={{sm7axs,.174},H}; -N l21n28[]={{siw7a,.130},H}; -N l21n29[]={{sgq,1.238},{sp79,.087},H}; -N l21n30[]={{sxe9o,.109},{spn,.072},H}; -N l21n31[]={{ssrg,.163},H}; -N l21n32[]={{sxxg,.554},{sgqe9,.195},H}; -N l21n33[]={{sxig,.195},{sxXp,.109},H}; -N l21n35[]={{sxswed,.174},{sil,.087},H}; -N l21n36[]={{sqR,.145},{sivi,.130},H}; -N l21n37[]={{ssx,.101},H}; -N l21n38[]={{sgxf6,.228},H}; -N l21n40[]={{szXk,.152},H}; -N l21n41[]={{sXk79g,.261},H}; -N l21n42[]={{sgmwg,.347},H}; -N l21n44[]={{sxg,1.824},{sqm,.246},H}; -N l21n45[]={{svs,.174},H}; -N l21n46[]={{sgr,.543},{ski,.174},H}; -N l21n47[]={{sXt,.145},{sxf3,.087},H}; -N l21n49[]={{sRvg,.586},{sgre9,.228},H}; -N l21n50[]={{smog,.293},{sw7aX,.152},H}; -N l21n51[]={{stw,.087},H}; -N l21n52[]={{spg,.630},H}; -N l21n54[]={{spik,.109},H}; -N l21n55[]={{s7aX,.188},{spf3,.116},H}; -N l21n57[]={{sX7ag,.651},{sgip,.261},H}; -N l21n58[]={{sXog,.586},{se9wg,.953},{sosv,.217},{sippi,.145},H}; -N l21n59[]={{szR,.101},H}; -N l21n61[]={{sYs,.072},{svir,.109},H}; -N l21n63[]={{svX,.217},{s7ae9,.130},{sge9v,.228},{s7axs,.130},{shf3,.072},H}; -N l21n64[]={{spp,.275},H}; -N l21n66[]={{sRwg,.733},H}; -N l21n67[]={{sswed,.130},{srR,.072},H}; -N l21n69[]={{sik79,.391},{sti,.130},H}; -N l21n71[]={{sk79s,.109},H}; -N l21n72[]={{ssk,.145},{sgqX,.293},H}; -N l21n73[]={{swedxR,.145},{sRn,.163},H}; -N l21n74[]={{sge9w,.391},H}; -N l21n75[]={{sof6,.188},{se9xg,.513},{sixxg,.304},{sXpg,.195},H}; -N l21n76[]={{sws,.130},H}; -N l21n77[]={{sYir,.130},{sli,.087},H}; -N l21n78[]={{somg,.195},{soip,.109},H}; -N l21n79[]={{sixg,.554},{sYX,.159},H}; -N l21n80[]={{sgt,.152},H}; -N l21n81[]={{sgX,2.019},{sXv,.174},H}; -N l21n82[]={{sgoi,.326},{se9o,.261},H}; -N l21n83[]={{sqg,.174},H}; -N l21n84[]={{sos,.289},H}; -N l21n85[]={{si7a,.174},{sqik,.217},H}; -N l21n86[]={{sio,.434},H}; -N l21n87[]={{syp,.130},H}; -N l21n89[]={{sge9,.630},{sgrX,.228},{spf5,.072},H}; -N l21n90[]={{smw,.261},{sRo,.228},H}; -N l21n91[]={{sig,.890},{sr79,.289},{smh,.087},H}; -N l21n92[]={{s79i,.217},{srXo,.152},{sf6v,.228},{sxsw,.130},H}; -N l21n94[]={{sw7ai,.304},{swX,.174},H}; -N l21n95[]={{szXp,.109},H}; -N l21n96[]={{sYY,.159},H}; -N l21n97[]={{s7aiv,.217},H}; -N l21n98[]={{sgY,.478},{sXw,.130},{sxf6,.116},{spr,.072},H}; -N l21n99[]={{sgpi,.261},{sXh,.116},{se9p,.163},H}; -N l21n100[]={{slsk,.152},{sgZw,.163},H}; -N l21n102[]={{swe9,.188},{soX,.130},{srxg,.195},H}; -N l21n103[]={{sip,.492},{sedx,.521},{srig,.195},H}; -N l21n105[]={{sYXrg,.347},{sgYy,.195},{s7aw,.087},H}; -N l21n106[]={{sedxe9,.244},H}; -N l21n107[]={{sRp,.423},{sxs,.188},{smx,.174},{sge9z,.195},{sedxRw,.326},H}; -N l21n109[]={{sro,.232},{sgik79,.608},{sXrg,.326},{spmg,.195},H}; -N l21n110[]={{soe9,.087},{se9kg,.440},H}; -N l21n113[]={{svw,.145},{sYm7ax,.174},H}; -N l21n114[]={{srg,.803},{sgv,.195},{svh,.101},{sikg,.163},H}; -N l21n115[]={{sXx,.275},{sgZ,.109},{sglR,.163},{sw7aXo,.145},H}; -N l21n116[]={{sgqi,.456},H}; -N l21n117[]={{srf6ze9,.145},H}; -N l21n118[]={{sxe9w,.152},H}; -N l21n119[]={{soY,.087},{s7aix,.130},H}; -N l21n120[]={{siq,.203},H}; -N l21n122[]={{s7ax,.289},H}; -N l21n123[]={{s7ai,.333},{shs,.116},{ssk79,.130},H}; -N l21n124[]={{sgw7ae9,.261},H}; -N l21n125[]={{sxX,.376},{sze9r,.152},{sgqXk,.217},H}; -N l21n126[]={{sgom,.489},{sf6x,.228},H}; -N l21n130[]={{sk79,.782},{svx,.203},H}; -N l21n131[]={{sgw,.868},{svi,.362},{spir,.109},H}; -N l21n132[]={{sgh,.217},H}; -N l21n133[]={{sxe9,.333},{se9r,.586},{spX,.217},{sgri,.195},H}; -N l21n134[]={{sgiw,.261},H}; -N l21n135[]={{sov,.116},H}; -N l21n136[]={{sf3o,.228},H}; -N l21n137[]={{sir,.565},{slR,.101},H}; -N l21n139[]={{ss7a,.145},H}; -N l21n140[]={{sso,.188},H}; -N l21n141[]={{sRr,.391},{shX,.159},{sgls,.358},{sgof6,.228},{sf3g,.342},{spe9,.072},H}; -N l21n143[]={{sgX7a,.717},H}; -N l21n144[]={{sww,.116},H}; -N l21n146[]={{sqs,.145},H}; -N l21n147[]={{sYi,.217},{szXk79,.203},{srXt,.109},H}; -N l21n148[]={{sgx,.608},H}; -N l21n149[]={{sgi,.955},{sgYyh,.261},H}; -N l21n150[]={{sXk,.304},{sgoip,.217},{sRvs,.244},H}; -N l21n151[]={{sppi,.174},H}; -N l21n152[]={{s7axsw,.174},{se9tw,.244},H}; -N l21n153[]={{skg,.369},{sf3p,.326},H}; -N l21n155[]={{sre9t,.109},H}; -N l21n157[]={{ssp,.246},H}; -N l21n159[]={{sswedx,.174},H}; -N l21n160[]={{sZw,.159},{sgqm,.358},{srr,.116},{sf6z,.261},{s79m,.087},{srio,.109},H}; -N l21n161[]={{swx,.130},{sgyx,.195},H}; -N l21n162[]={{swi,.203},H}; -N l21n163[]={{sYy,.101},{sf6ze9,.244},H}; -N l21n164[]={{sqX,.203},{svz,.087},H}; -N l21n165[]={{sik79g,.391},{sgy,.152},H}; -N l21n166[]={{sgj,.434},{swedx,.174},{soix,.152},H}; -N l21n167[]={{se9t,.456},H}; -N l21n168[]={{srf6,.072},H}; -N l21n169[]={{sgqik,.434},H}; -N l21n170[]={{soi,.391},{sge9wg,.521},{swed,.116},H}; -N l21n172[]={{sqe9,.145},H}; -N l21n173[]={{sYirg,.217},{sk79X,.109},{sioi,.109},H}; -N l21n174[]={{ssq,.087},H}; -N l21n177[]={{sgXg,1.856},H}; -N l21n178[]={{sw7aR,.217},{sr79i,.130},H}; -N l21n180[]={{sw7aiv,.261},H}; -N l21n182[]={{sgz,.565},{siog,.554},H}; -N l21n183[]={{s7aR,.203},{sgk,.195},{sxRr,.109},H}; -N l21n184[]={{sXm,.130},{se9r79,.391},{sph,.072},H}; -N l21n185[]={{sgYi,.228},{se9Y,.163},H}; -N l21n186[]={{smwg,.293},{srf6z,.109},{sRog,.366},H}; -N l21n187[]={{szX,.275},{sr79g,.163},H}; -N l21n188[]={{srXog,.304},H}; -N l21n189[]={{sxix,.152},H}; -N l21n190[]={{sipi,.174},H}; -N l21n191[]={{ssr,.217},{s7am,.116},{svR,.101},H}; -N l21n192[]={{sxx,.362},{sYYg,.163},H}; -N l21n193[]={{sxi,.434},{sgw7a,.977},{sRY,.228},H}; -N l21n194[]={{sglsk,.304},H}; -N l21n195[]={{srX,.275},{sze9,.130},H}; -N l21n197[]={{spix,.174},H}; -N l21n199[]={{s79g,.608},{svm,.101},{snR,.087},{sipg,.163},H}; -N l21n200[]={{sgl,.717},{spx,.130},{sgqR,.228},H}; -N l21n201[]={{spi,.492},{se9v,.619},{sXk79,.326},{sgvi,.195},H}; -N l21n202[]={{sgmw,.391},H}; -N l21n203[]={{sf5g,.489},{sre9,.130},{smxg,.163},{sjX,.072},H}; -N l21n204[]={{soRv,.152},H}; -N l21n205[]={{siv,.391},{srog,.228},{sm7ax,.130},H}; -N l21n207[]={{syh,.101},{slsk79,.174},H}; -N l21n208[]={{s7aXo,.109},H}; -N l21n209[]={{sRv,.879},{sm7a,.145},{shi,.145},{sgR,.152},H}; -N l21n210[]={{smo,.188},H}; -N l21n211[]={{swe9k,.174},{sXxg,.195},H}; -N l21n215[]={{smg,.847},{sYm,.116},H}; -N l21n216[]={{siqg,.163},H}; -N l21n217[]={{sX7a,.391},{sgm,.565},{sk79i,.152},H}; -N l21n218[]={{sXo,.434},{se9w,.879},{siwx,.109},H}; -N l21n219[]={{ssk79g,.261},H}; -N l21n221[]={{sxXg,.163},H}; -N l21n222[]={{siw,.376},H}; -N l21n223[]={{sXg,1.954},{syx,.130},{sih,.072},H}; -N l21n225[]={{sgzX,.423},H}; -N l21n226[]={{sk79g,.717},{sRw,.554},{sgqs,.228},H}; -N l21n227[]={{svig,.293},{smp,.116},H}; -N l21n229[]={{swso,.130},H}; -N l21n230[]={{s7ag,.586},{soR,.116},{sqmr,.152},H}; -N l21n231[]={{se9r79i,.326},H}; -N l21n232[]={{sqi,.304},{sv7a,.087},{sze9r79,.145},H}; -N l21n233[]={{sirg,.456},H}; -N l21n234[]={{sgn,.195},{sgk79,.195},{sgqmr,.261},{skX,.087},H}; -N l21n235[]={{sXp,.420},{se9x,.358},{sixx,.239},{sgxi,.228},H}; -N l21n236[]={{ssog,.163},H}; -N l21n237[]={{sRrg,.366},{sf6ze9r,.326},H}; -N l21n238[]={{som,.289},{svg,.369},{sxRw,.109},H}; -N l21n239[]={{six,.680},{sgX7ag,.825},{sYyh,.130},{sts,.087},H}; -N l21n240[]={{sgw7ai,.261},H}; -N l21n243[]={{sglX,.326},{sRx,.228},{sr79io,.145},H}; -N l21n244[]={{ssvw,.109},H}; -N l21n245[]={{s79io,.130},{sgXp,.163},H}; -N l21n246[]={{srh,.159},{sf6p,.228},H}; -N l21n247[]={{sls,.217},H}; -N l21n249[]={{sf3pg,.660},H}; -N l21n250[]={{syhX,.130},H}; -N l21n251[]={{sgo,.977},H}; -N l21n252[]={{sXq,.101},H}; -N l21n253[]={{sxR,.261},{sgji,.163},H}; -N l21n254[]={{sYg,.152},H}; -N l21n255[]={{szi,.275},H}; - -D l21_d = -{ +S sw7a[] = { s, z, 0 }; +S sk79[] = { g, y, 0 }; +S sgw7a[] = { 32, s, z, 0 }; +S sRv[] = { 225, r, 0 }; +S sk79g[] = { g, y, a }; +S sgX7ag[] = { 32, 97, z, a }; +S sik79[] = { e, g, y, 0 }; +S se9r[] = { 233, n, 0 }; +S sxxg[] = { t, t, a }; +S sedx[] = { 237, t, 0 }; +S sXk79[] = { 97, g, y, 0 }; +S se9t[] = { 233, p, 0 }; +S sgik79[] = { 32, e, g, y, 0 }; +S sw7ai[] = { s, z, e, 0 }; +S sof6[] = { k, 246, 0 }; +S sge9w[] = { 32, 233, s, 0 }; +S sge9wg[] = { 32, 233, s, a }; +S sZw[] = { 99, s, 0 }; +S sYY[] = { 98, 98, 0 }; +S s7aiv[] = { z, e, r, 0 }; +S sw7aR[] = { s, z, 225, 0 }; +S sRwg[] = { 225, s, a }; +S sosv[] = { k, o, r, 0 }; +S sqik[] = { m, e, g, 0 }; +S sf3p[] = { 243, l, 0 }; +S sqR[] = { m, 225, 0 }; +S sgqik[] = { 32, m, e, g, 0 }; +S s7ae9[] = { z, 233, 0 }; +S sf3pg[] = { 243, l, a }; +S sik79g[] = { e, g, y, a }; +S sRk[] = { 225, g, 0 }; +S sw7aiv[] = { s, z, e, r, 0 }; +S swed[] = { s, 237, 0 }; +S sYXr[] = { 98, 97, n, 0 }; +S swe9k[] = { s, 233, g, 0 }; +S spf3[] = { l, 243, 0 }; +S sxf6[] = { t, 246, 0 }; +S sf6z[] = { 246, v, 0 }; +S swedx[] = { s, 237, t, 0 }; +S spix[] = { l, e, t, 0 }; +S sRvg[] = { 225, r, a }; +S se9o[] = { 233, k, 0 }; +S sYXrg[] = { 98, 97, n, a }; +S se9r79[] = { 233, n, y, 0 }; +S sRpp[] = { 225, l, l, 0 }; +S szXk79[] = { v, 97, g, y, 0 }; +S se9xg[] = { 233, t, a }; +S sf6p[] = { 246, l, 0 }; +S sglsk[] = { 32, h, o, g, 0 }; +S sgxf6[] = { 32, t, 246, 0 }; +S sgof6[] = { 32, k, 246, 0 }; +S sge9v[] = { 32, 233, r, 0 }; +S sgqR[] = { 32, m, 225, 0 }; +S sgre9[] = { 32, n, 233, 0 }; +S sRo[] = { 225, k, 0 }; +S srXo[] = { n, 97, k, 0 }; +S soixg[] = { k, e, t, a }; +S sze9r[] = { v, 233, n, 0 }; +S szXk[] = { v, 97, g, 0 }; +S sk79i[] = { g, y, e, 0 }; +S sf6v[] = { 246, r, 0 }; +S sgzXk[] = { 32, v, 97, g, 0 }; +S sxe9w[] = { t, 233, s, 0 }; +S sRY[] = { 225, 98, 0 }; +S soix[] = { k, e, t, 0 }; +S slsk[] = { h, o, g, 0 }; +S sw7aX[] = { s, z, 97, 0 }; +S sf6x[] = { 246, t, 0 }; +S se9z[] = { 233, v, 0 }; +S sf3o[] = { 243, k, 0 }; +S soRv[] = { k, 225, r, 0 }; +S sixxg[] = { e, t, t, a }; +S srXog[] = { n, 97, k, a }; +S sw7ae9[] = { s, z, 233, 0 }; +S sYm7a[] = { 98, i, z, 0 }; +S sgk79[] = { 32, g, y, 0 }; +S sxswed[] = { t, o, s, 237, 0 }; +S soY[] = { k, 98, 0 }; +S sf6r[] = { 246, n, 0 }; +S sv7a[] = { r, z, 0 }; +S sXk79g[] = { 97, g, y, a }; +S snR[] = { j, 225, 0 }; +S sgw7ai[] = { 32, s, z, e, 0 }; +S sgw7ae9[] = { 32, s, z, 233, 0 }; +S s7aix[] = { z, e, t, 0 }; +S sswedx[] = { o, s, 237, t, 0 }; +S sgqmr[] = { 32, m, i, n, 0 }; +S sgyx[] = { 32, u, t, 0 }; +S sm7ax[] = { i, z, t, 0 }; +S syhX[] = { u, d, 97, 0 }; +S stw[] = { p, s, 0 }; +S sm7axs[] = { i, z, t, o, 0 }; +S sgYyh[] = { 32, 98, u, d, 0 }; +S sxf3[] = { t, 243, 0 }; +S somg[] = { k, i, a }; +S sswed[] = { o, s, 237, 0 }; +S se9kg[] = { 233, g, a }; +S s7af5[] = { z, 245, 0 }; +S s79io[] = { y, e, k, 0 }; +S s7axs[] = { z, t, o, 0 }; +S slsk79[] = { h, o, g, y, 0 }; +S sgqe9[] = { 32, m, 233, 0 }; +S sr79i[] = { n, y, e, 0 }; +S sYm7ax[] = { 98, i, z, t, 0 }; +S ssk79[] = { o, g, y, 0 }; +S sge9z[] = { 32, 233, v, 0 }; +S sYyhX[] = { 98, u, d, 97, 0 }; +S ssk79g[] = { o, g, y, a }; +S sgYy[] = { 32, 98, u, 0 }; +S swso[] = { s, o, k, 0 }; +S svz[] = { r, v, 0 }; +S s7axsw[] = { z, t, o, s, 0 }; +S siw7a[] = { e, s, z, 0 }; +S s7aw[] = { z, s, 0 }; +S sxsw[] = { t, o, s, 0 }; +S sgoip[] = { 32, k, e, l, 0 }; +S sxRr[] = { t, 225, n, 0 }; +S spf5[] = { l, 245, 0 }; +S srf6z[] = { n, 246, v, 0 }; +S sgqXk[] = { 32, m, 97, g, 0 }; +S sYirg[] = { 98, e, n, a }; +S sxe9o[] = { t, 233, k, 0 }; +S swedxR[] = { s, 237, t, 225, 0 }; +S spr[] = { l, n, 0 }; +S s79s[] = { y, o, 0 }; +S sk79X[] = { g, y, 97, 0 }; +S sxixx[] = { t, e, t, t, 0 }; +S sYYg[] = { 98, 98, a }; +S sre9t[] = { n, 233, p, 0 }; +S sedxRw[] = { 237, t, 225, s, 0 }; +S se9tw[] = { 233, p, s, 0 }; +S srf6ze9[] = { n, 246, v, 233, 0 }; +S sglR[] = { 32, h, 225, 0 }; +S shf3[] = { d, 243, 0 }; +S sRrg[] = { 225, n, a }; +S sxRw[] = { t, 225, s, 0 }; +S sgji[] = { 32, f, e, 0 }; +S sriog[] = { n, e, k, a }; +S sedxR[] = { 237, t, 225, 0 }; +S sw7aXo[] = { s, z, 97, k, 0 }; +S sr79io[] = { n, y, e, k, 0 }; +S srf6[] = { n, 246, 0 }; +S se9Y[] = { 233, 98, 0 }; +S sqXk[] = { m, 97, g, 0 }; +S sgZw[] = { 32, 99, s, 0 }; +S sedxe9[] = { 237, t, 233, 0 }; +S se9w7a[] = { 233, s, z, 0 }; +S sRvs[] = { 225, r, o, 0 }; +S spik[] = { l, e, g, 0 }; +S sikg[] = { e, g, a }; +S sRn[] = { 225, j, 0 }; +S sf6ze9r[] = { 246, v, 233, n, 0 }; +S sze9r79[] = { v, 233, n, y, 0 }; +S se9r79i[] = { 233, n, y, e, 0 }; +S sRog[] = { 225, k, a }; +S sk79s[] = { g, y, o, 0 }; +S soip[] = { k, e, l, 0 }; +S srXt[] = { n, 97, p, 0 }; +S sf6ze9[] = { 246, v, 233, 0 }; +S s7aXo[] = { z, 97, k, 0 }; + +N l21n0[] = { { sriog, .217 }, H }; +N l21n1[] = { { stX, .087 }, H }; +N l21n2[] = { { sgik, .489 }, H }; +N l21n3[] = { { ssv, .333 }, H }; +N l21n5[] = { { smr, .145 }, { spR, .130 }, H }; +N l21n6[] = { { srx, .130 }, { soixg, .304 }, { s79s, .072 }, H }; +N l21n7[] = { { sw7a, .883 }, { sri, .304 }, H }; +N l21n8[] = { { swo, .072 }, H }; +N l21n9[] = { { slX, .174 }, { sYXr, .174 }, H }; +N l21n10[] = { { sw7ae9, .152 }, H }; +N l21n11[] = { { s7af5, .087 }, { sipp, .130 }, H }; +N l21n12[] = { { sgp, .282 }, H }; +N l21n13[] = { { swg, .999 }, { sXr, .275 }, { spm, .130 }, { se9z, .228 }, H }; +N l21n14[] = { { se9k, .521 }, H }; +N l21n15[] = { { sRpp, .391 }, { sji, .101 }, H }; +N l21n17[] = { { sqXk, .109 }, H }; +N l21n18[] = { { sik, .550 }, { sYyhX, .174 }, { sedxR, .244 }, H }; +N l21n20[] = { { ssw, .232 }, H }; +N l21n21[] = { { sog, 1.520 }, { sYm7a, .130 }, { shm, .087 }, H }; +N l21n22[] = { { sRk, .293 }, { sgzXk, .304 }, { sXpX, .109 }, H }; +N l21n24[] = { { s79X, .101 }, { sf6r, .195 }, { sXmg, .195 }, { se9w7a, .244 }, H }; +N l21n25[] = { { sxixx, .145 }, H }; +N l21n26[] = { { sm7axs, .174 }, H }; +N l21n28[] = { { siw7a, .130 }, H }; +N l21n29[] = { { sgq, 1.238 }, { sp79, .087 }, H }; +N l21n30[] = { { sxe9o, .109 }, { spn, .072 }, H }; +N l21n31[] = { { ssrg, .163 }, H }; +N l21n32[] = { { sxxg, .554 }, { sgqe9, .195 }, H }; +N l21n33[] = { { sxig, .195 }, { sxXp, .109 }, H }; +N l21n35[] = { { sxswed, .174 }, { sil, .087 }, H }; +N l21n36[] = { { sqR, .145 }, { sivi, .130 }, H }; +N l21n37[] = { { ssx, .101 }, H }; +N l21n38[] = { { sgxf6, .228 }, H }; +N l21n40[] = { { szXk, .152 }, H }; +N l21n41[] = { { sXk79g, .261 }, H }; +N l21n42[] = { { sgmwg, .347 }, H }; +N l21n44[] = { { sxg, 1.824 }, { sqm, .246 }, H }; +N l21n45[] = { { svs, .174 }, H }; +N l21n46[] = { { sgr, .543 }, { ski, .174 }, H }; +N l21n47[] = { { sXt, .145 }, { sxf3, .087 }, H }; +N l21n49[] = { { sRvg, .586 }, { sgre9, .228 }, H }; +N l21n50[] = { { smog, .293 }, { sw7aX, .152 }, H }; +N l21n51[] = { { stw, .087 }, H }; +N l21n52[] = { { spg, .630 }, H }; +N l21n54[] = { { spik, .109 }, H }; +N l21n55[] = { { s7aX, .188 }, { spf3, .116 }, H }; +N l21n57[] = { { sX7ag, .651 }, { sgip, .261 }, H }; +N l21n58[] = { { sXog, .586 }, { se9wg, .953 }, { sosv, .217 }, { sippi, .145 }, H }; +N l21n59[] = { { szR, .101 }, H }; +N l21n61[] = { { sYs, .072 }, { svir, .109 }, H }; +N l21n63[] = { { svX, .217 }, { s7ae9, .130 }, { sge9v, .228 }, { s7axs, .130 }, { shf3, .072 }, H }; +N l21n64[] = { { spp, .275 }, H }; +N l21n66[] = { { sRwg, .733 }, H }; +N l21n67[] = { { sswed, .130 }, { srR, .072 }, H }; +N l21n69[] = { { sik79, .391 }, { sti, .130 }, H }; +N l21n71[] = { { sk79s, .109 }, H }; +N l21n72[] = { { ssk, .145 }, { sgqX, .293 }, H }; +N l21n73[] = { { swedxR, .145 }, { sRn, .163 }, H }; +N l21n74[] = { { sge9w, .391 }, H }; +N l21n75[] = { { sof6, .188 }, { se9xg, .513 }, { sixxg, .304 }, { sXpg, .195 }, H }; +N l21n76[] = { { sws, .130 }, H }; +N l21n77[] = { { sYir, .130 }, { sli, .087 }, H }; +N l21n78[] = { { somg, .195 }, { soip, .109 }, H }; +N l21n79[] = { { sixg, .554 }, { sYX, .159 }, H }; +N l21n80[] = { { sgt, .152 }, H }; +N l21n81[] = { { sgX, 2.019 }, { sXv, .174 }, H }; +N l21n82[] = { { sgoi, .326 }, { se9o, .261 }, H }; +N l21n83[] = { { sqg, .174 }, H }; +N l21n84[] = { { sos, .289 }, H }; +N l21n85[] = { { si7a, .174 }, { sqik, .217 }, H }; +N l21n86[] = { { sio, .434 }, H }; +N l21n87[] = { { syp, .130 }, H }; +N l21n89[] = { { sge9, .630 }, { sgrX, .228 }, { spf5, .072 }, H }; +N l21n90[] = { { smw, .261 }, { sRo, .228 }, H }; +N l21n91[] = { { sig, .890 }, { sr79, .289 }, { smh, .087 }, H }; +N l21n92[] = { { s79i, .217 }, { srXo, .152 }, { sf6v, .228 }, { sxsw, .130 }, H }; +N l21n94[] = { { sw7ai, .304 }, { swX, .174 }, H }; +N l21n95[] = { { szXp, .109 }, H }; +N l21n96[] = { { sYY, .159 }, H }; +N l21n97[] = { { s7aiv, .217 }, H }; +N l21n98[] = { { sgY, .478 }, { sXw, .130 }, { sxf6, .116 }, { spr, .072 }, H }; +N l21n99[] = { { sgpi, .261 }, { sXh, .116 }, { se9p, .163 }, H }; +N l21n100[] = { { slsk, .152 }, { sgZw, .163 }, H }; +N l21n102[] = { { swe9, .188 }, { soX, .130 }, { srxg, .195 }, H }; +N l21n103[] = { { sip, .492 }, { sedx, .521 }, { srig, .195 }, H }; +N l21n105[] = { { sYXrg, .347 }, { sgYy, .195 }, { s7aw, .087 }, H }; +N l21n106[] = { { sedxe9, .244 }, H }; +N l21n107[] = { { sRp, .423 }, { sxs, .188 }, { smx, .174 }, { sge9z, .195 }, { sedxRw, .326 }, H }; +N l21n109[] = { { sro, .232 }, { sgik79, .608 }, { sXrg, .326 }, { spmg, .195 }, H }; +N l21n110[] = { { soe9, .087 }, { se9kg, .440 }, H }; +N l21n113[] = { { svw, .145 }, { sYm7ax, .174 }, H }; +N l21n114[] = { { srg, .803 }, { sgv, .195 }, { svh, .101 }, { sikg, .163 }, H }; +N l21n115[] = { { sXx, .275 }, { sgZ, .109 }, { sglR, .163 }, { sw7aXo, .145 }, H }; +N l21n116[] = { { sgqi, .456 }, H }; +N l21n117[] = { { srf6ze9, .145 }, H }; +N l21n118[] = { { sxe9w, .152 }, H }; +N l21n119[] = { { soY, .087 }, { s7aix, .130 }, H }; +N l21n120[] = { { siq, .203 }, H }; +N l21n122[] = { { s7ax, .289 }, H }; +N l21n123[] = { { s7ai, .333 }, { shs, .116 }, { ssk79, .130 }, H }; +N l21n124[] = { { sgw7ae9, .261 }, H }; +N l21n125[] = { { sxX, .376 }, { sze9r, .152 }, { sgqXk, .217 }, H }; +N l21n126[] = { { sgom, .489 }, { sf6x, .228 }, H }; +N l21n130[] = { { sk79, .782 }, { svx, .203 }, H }; +N l21n131[] = { { sgw, .868 }, { svi, .362 }, { spir, .109 }, H }; +N l21n132[] = { { sgh, .217 }, H }; +N l21n133[] = { { sxe9, .333 }, { se9r, .586 }, { spX, .217 }, { sgri, .195 }, H }; +N l21n134[] = { { sgiw, .261 }, H }; +N l21n135[] = { { sov, .116 }, H }; +N l21n136[] = { { sf3o, .228 }, H }; +N l21n137[] = { { sir, .565 }, { slR, .101 }, H }; +N l21n139[] = { { ss7a, .145 }, H }; +N l21n140[] = { { sso, .188 }, H }; +N l21n141[] = { { sRr, .391 }, { shX, .159 }, { sgls, .358 }, { sgof6, .228 }, { sf3g, .342 }, { spe9, .072 }, H }; +N l21n143[] = { { sgX7a, .717 }, H }; +N l21n144[] = { { sww, .116 }, H }; +N l21n146[] = { { sqs, .145 }, H }; +N l21n147[] = { { sYi, .217 }, { szXk79, .203 }, { srXt, .109 }, H }; +N l21n148[] = { { sgx, .608 }, H }; +N l21n149[] = { { sgi, .955 }, { sgYyh, .261 }, H }; +N l21n150[] = { { sXk, .304 }, { sgoip, .217 }, { sRvs, .244 }, H }; +N l21n151[] = { { sppi, .174 }, H }; +N l21n152[] = { { s7axsw, .174 }, { se9tw, .244 }, H }; +N l21n153[] = { { skg, .369 }, { sf3p, .326 }, H }; +N l21n155[] = { { sre9t, .109 }, H }; +N l21n157[] = { { ssp, .246 }, H }; +N l21n159[] = { { sswedx, .174 }, H }; +N l21n160[] = { { sZw, .159 }, { sgqm, .358 }, { srr, .116 }, { sf6z, .261 }, { s79m, .087 }, { srio, .109 }, H }; +N l21n161[] = { { swx, .130 }, { sgyx, .195 }, H }; +N l21n162[] = { { swi, .203 }, H }; +N l21n163[] = { { sYy, .101 }, { sf6ze9, .244 }, H }; +N l21n164[] = { { sqX, .203 }, { svz, .087 }, H }; +N l21n165[] = { { sik79g, .391 }, { sgy, .152 }, H }; +N l21n166[] = { { sgj, .434 }, { swedx, .174 }, { soix, .152 }, H }; +N l21n167[] = { { se9t, .456 }, H }; +N l21n168[] = { { srf6, .072 }, H }; +N l21n169[] = { { sgqik, .434 }, H }; +N l21n170[] = { { soi, .391 }, { sge9wg, .521 }, { swed, .116 }, H }; +N l21n172[] = { { sqe9, .145 }, H }; +N l21n173[] = { { sYirg, .217 }, { sk79X, .109 }, { sioi, .109 }, H }; +N l21n174[] = { { ssq, .087 }, H }; +N l21n177[] = { { sgXg, 1.856 }, H }; +N l21n178[] = { { sw7aR, .217 }, { sr79i, .130 }, H }; +N l21n180[] = { { sw7aiv, .261 }, H }; +N l21n182[] = { { sgz, .565 }, { siog, .554 }, H }; +N l21n183[] = { { s7aR, .203 }, { sgk, .195 }, { sxRr, .109 }, H }; +N l21n184[] = { { sXm, .130 }, { se9r79, .391 }, { sph, .072 }, H }; +N l21n185[] = { { sgYi, .228 }, { se9Y, .163 }, H }; +N l21n186[] = { { smwg, .293 }, { srf6z, .109 }, { sRog, .366 }, H }; +N l21n187[] = { { szX, .275 }, { sr79g, .163 }, H }; +N l21n188[] = { { srXog, .304 }, H }; +N l21n189[] = { { sxix, .152 }, H }; +N l21n190[] = { { sipi, .174 }, H }; +N l21n191[] = { { ssr, .217 }, { s7am, .116 }, { svR, .101 }, H }; +N l21n192[] = { { sxx, .362 }, { sYYg, .163 }, H }; +N l21n193[] = { { sxi, .434 }, { sgw7a, .977 }, { sRY, .228 }, H }; +N l21n194[] = { { sglsk, .304 }, H }; +N l21n195[] = { { srX, .275 }, { sze9, .130 }, H }; +N l21n197[] = { { spix, .174 }, H }; +N l21n199[] = { { s79g, .608 }, { svm, .101 }, { snR, .087 }, { sipg, .163 }, H }; +N l21n200[] = { { sgl, .717 }, { spx, .130 }, { sgqR, .228 }, H }; +N l21n201[] = { { spi, .492 }, { se9v, .619 }, { sXk79, .326 }, { sgvi, .195 }, H }; +N l21n202[] = { { sgmw, .391 }, H }; +N l21n203[] = { { sf5g, .489 }, { sre9, .130 }, { smxg, .163 }, { sjX, .072 }, H }; +N l21n204[] = { { soRv, .152 }, H }; +N l21n205[] = { { siv, .391 }, { srog, .228 }, { sm7ax, .130 }, H }; +N l21n207[] = { { syh, .101 }, { slsk79, .174 }, H }; +N l21n208[] = { { s7aXo, .109 }, H }; +N l21n209[] = { { sRv, .879 }, { sm7a, .145 }, { shi, .145 }, { sgR, .152 }, H }; +N l21n210[] = { { smo, .188 }, H }; +N l21n211[] = { { swe9k, .174 }, { sXxg, .195 }, H }; +N l21n215[] = { { smg, .847 }, { sYm, .116 }, H }; +N l21n216[] = { { siqg, .163 }, H }; +N l21n217[] = { { sX7a, .391 }, { sgm, .565 }, { sk79i, .152 }, H }; +N l21n218[] = { { sXo, .434 }, { se9w, .879 }, { siwx, .109 }, H }; +N l21n219[] = { { ssk79g, .261 }, H }; +N l21n221[] = { { sxXg, .163 }, H }; +N l21n222[] = { { siw, .376 }, H }; +N l21n223[] = { { sXg, 1.954 }, { syx, .130 }, { sih, .072 }, H }; +N l21n225[] = { { sgzX, .423 }, H }; +N l21n226[] = { { sk79g, .717 }, { sRw, .554 }, { sgqs, .228 }, H }; +N l21n227[] = { { svig, .293 }, { smp, .116 }, H }; +N l21n229[] = { { swso, .130 }, H }; +N l21n230[] = { { s7ag, .586 }, { soR, .116 }, { sqmr, .152 }, H }; +N l21n231[] = { { se9r79i, .326 }, H }; +N l21n232[] = { { sqi, .304 }, { sv7a, .087 }, { sze9r79, .145 }, H }; +N l21n233[] = { { sirg, .456 }, H }; +N l21n234[] = { { sgn, .195 }, { sgk79, .195 }, { sgqmr, .261 }, { skX, .087 }, H }; +N l21n235[] = { { sXp, .420 }, { se9x, .358 }, { sixx, .239 }, { sgxi, .228 }, H }; +N l21n236[] = { { ssog, .163 }, H }; +N l21n237[] = { { sRrg, .366 }, { sf6ze9r, .326 }, H }; +N l21n238[] = { { som, .289 }, { svg, .369 }, { sxRw, .109 }, H }; +N l21n239[] = { { six, .680 }, { sgX7ag, .825 }, { sYyh, .130 }, { sts, .087 }, H }; +N l21n240[] = { { sgw7ai, .261 }, H }; +N l21n243[] = { { sglX, .326 }, { sRx, .228 }, { sr79io, .145 }, H }; +N l21n244[] = { { ssvw, .109 }, H }; +N l21n245[] = { { s79io, .130 }, { sgXp, .163 }, H }; +N l21n246[] = { { srh, .159 }, { sf6p, .228 }, H }; +N l21n247[] = { { sls, .217 }, H }; +N l21n249[] = { { sf3pg, .660 }, H }; +N l21n250[] = { { syhX, .130 }, H }; +N l21n251[] = { { sgo, .977 }, H }; +N l21n252[] = { { sXq, .101 }, H }; +N l21n253[] = { { sxR, .261 }, { sgji, .163 }, H }; +N l21n254[] = { { sYg, .152 }, H }; +N l21n255[] = { { szi, .275 }, H }; + +D l21_d = { "hungarian", "iso-8859-2", - { - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,0.001,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,0.174,0.045,0.009,0.042,0.196,0.017,0.073,0.029,0.084,0.019,0.121,0.111,0.059,0.104,0.074, - 0.025,W,0.091,0.122,0.152,0.024,0.042,W,W,0.046,0.085,W,W,W,W,W, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - Y,0.001,V,V,V,V,V,V,V,V,V,V,V,V,V,V, - V,V,V,0.001,V,0.003,V,V,V,V,0.001,V,V,V,V,V, - V,0.149,V,V,V,V,V,V,V,0.177,V,V,V,0.031,V,V, - V,V,V,0.053,0.013,0.034,0.063,V,V,V,0.017,0.009,0.021,V,V,V - }, - { - l21n0,l21n1,l21n2,l21n3,X,l21n5,l21n6,l21n7,l21n8,l21n9,l21n10,l21n11,l21n12,l21n13,l21n14,l21n15, - X,l21n17,l21n18,X,l21n20,l21n21,l21n22,X,l21n24,l21n25,l21n26,X,l21n28,l21n29,l21n30,l21n31, - l21n32,l21n33,X,l21n35,l21n36,l21n37,l21n38,X,l21n40,l21n41,l21n42,X,l21n44,l21n45,l21n46,l21n47, - X,l21n49,l21n50,l21n51,l21n52,X,l21n54,l21n55,X,l21n57,l21n58,l21n59,X,l21n61,X,l21n63, - l21n64,X,l21n66,l21n67,X,l21n69,X,l21n71,l21n72,l21n73,l21n74,l21n75,l21n76,l21n77,l21n78,l21n79, - l21n80,l21n81,l21n82,l21n83,l21n84,l21n85,l21n86,l21n87,X,l21n89,l21n90,l21n91,l21n92,X,l21n94,l21n95, - l21n96,l21n97,l21n98,l21n99,l21n100,X,l21n102,l21n103,X,l21n105,l21n106,l21n107,X,l21n109,l21n110,X, - X,l21n113,l21n114,l21n115,l21n116,l21n117,l21n118,l21n119,l21n120,X,l21n122,l21n123,l21n124,l21n125,l21n126,X, - X,X,l21n130,l21n131,l21n132,l21n133,l21n134,l21n135,l21n136,l21n137,X,l21n139,l21n140,l21n141,X,l21n143, - l21n144,X,l21n146,l21n147,l21n148,l21n149,l21n150,l21n151,l21n152,l21n153,X,l21n155,X,l21n157,X,l21n159, - l21n160,l21n161,l21n162,l21n163,l21n164,l21n165,l21n166,l21n167,l21n168,l21n169,l21n170,X,l21n172,l21n173,l21n174,X, - X,l21n177,l21n178,X,l21n180,X,l21n182,l21n183,l21n184,l21n185,l21n186,l21n187,l21n188,l21n189,l21n190,l21n191, - l21n192,l21n193,l21n194,l21n195,X,l21n197,X,l21n199,l21n200,l21n201,l21n202,l21n203,l21n204,l21n205,X,l21n207, - l21n208,l21n209,l21n210,l21n211,X,X,X,l21n215,l21n216,l21n217,l21n218,l21n219,X,l21n221,l21n222,l21n223, - X,l21n225,l21n226,l21n227,X,l21n229,l21n230,l21n231,l21n232,l21n233,l21n234,l21n235,l21n236,l21n237,l21n238,l21n239, - l21n240,X,X,l21n243,l21n244,l21n245,l21n246,l21n247,X,l21n249,l21n250,l21n251,l21n252,l21n253,l21n254,l21n255 - } + { W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, 0.001, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, 0.174, 0.045, 0.009, 0.042, 0.196, 0.017, 0.073, 0.029, 0.084, 0.019, 0.121, 0.111, 0.059, 0.104, 0.074, + 0.025, W, 0.091, 0.122, 0.152, 0.024, 0.042, W, W, 0.046, 0.085, W, W, W, W, W, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + Y, 0.001, V, V, V, V, V, V, V, V, V, V, V, V, V, V, + V, V, V, 0.001, V, 0.003, V, V, V, V, 0.001, V, V, V, V, V, + V, 0.149, V, V, V, V, V, V, V, 0.177, V, V, V, 0.031, V, V, + V, V, V, 0.053, 0.013, 0.034, 0.063, V, V, V, 0.017, 0.009, 0.021, V, V, V }, + { l21n0, l21n1, l21n2, l21n3, X, l21n5, l21n6, l21n7, l21n8, l21n9, l21n10, l21n11, l21n12, l21n13, l21n14, l21n15, + X, l21n17, l21n18, X, l21n20, l21n21, l21n22, X, l21n24, l21n25, l21n26, X, l21n28, l21n29, l21n30, l21n31, + l21n32, l21n33, X, l21n35, l21n36, l21n37, l21n38, X, l21n40, l21n41, l21n42, X, l21n44, l21n45, l21n46, l21n47, + X, l21n49, l21n50, l21n51, l21n52, X, l21n54, l21n55, X, l21n57, l21n58, l21n59, X, l21n61, X, l21n63, + l21n64, X, l21n66, l21n67, X, l21n69, X, l21n71, l21n72, l21n73, l21n74, l21n75, l21n76, l21n77, l21n78, l21n79, + l21n80, l21n81, l21n82, l21n83, l21n84, l21n85, l21n86, l21n87, X, l21n89, l21n90, l21n91, l21n92, X, l21n94, l21n95, + l21n96, l21n97, l21n98, l21n99, l21n100, X, l21n102, l21n103, X, l21n105, l21n106, l21n107, X, l21n109, l21n110, X, + X, l21n113, l21n114, l21n115, l21n116, l21n117, l21n118, l21n119, l21n120, X, l21n122, l21n123, l21n124, l21n125, l21n126, X, + X, X, l21n130, l21n131, l21n132, l21n133, l21n134, l21n135, l21n136, l21n137, X, l21n139, l21n140, l21n141, X, l21n143, + l21n144, X, l21n146, l21n147, l21n148, l21n149, l21n150, l21n151, l21n152, l21n153, X, l21n155, X, l21n157, X, l21n159, + l21n160, l21n161, l21n162, l21n163, l21n164, l21n165, l21n166, l21n167, l21n168, l21n169, l21n170, X, l21n172, l21n173, l21n174, X, + X, l21n177, l21n178, X, l21n180, X, l21n182, l21n183, l21n184, l21n185, l21n186, l21n187, l21n188, l21n189, l21n190, l21n191, + l21n192, l21n193, l21n194, l21n195, X, l21n197, X, l21n199, l21n200, l21n201, l21n202, l21n203, l21n204, l21n205, X, l21n207, + l21n208, l21n209, l21n210, l21n211, X, X, X, l21n215, l21n216, l21n217, l21n218, l21n219, X, l21n221, l21n222, l21n223, + X, l21n225, l21n226, l21n227, X, l21n229, l21n230, l21n231, l21n232, l21n233, l21n234, l21n235, l21n236, l21n237, l21n238, l21n239, + l21n240, X, X, l21n243, l21n244, l21n245, l21n246, l21n247, X, l21n249, l21n250, l21n251, l21n252, l21n253, l21n254, l21n255 } }; - - // // Lng: icelandic // Enc: iso-8859-1 // - -S sXf0[]={97,240,0}; -S sXf0g[]={97,240,a}; -S sgedg[]={32,237,a}; -S smf0[]={i,240,0}; -S sgXf0[]={32,97,240,0}; -S sgfe[]={32,254,0}; -S sgXf0g[]={32,97,240,a}; -S sf0y[]={240,u,0}; -S sf0m[]={240,i,0}; -S smf0g[]={i,240,a}; -S svf0[]={r,240,0}; -S sf0X[]={240,97,0}; -S srrg[]={n,n,a}; -S sryq[]={n,u,m,0}; -S sryqg[]={n,u,m,a}; -S swiq[]={s,e,m,0}; -S spf6[]={l,246,0}; -S sgwiq[]={32,s,e,m,0}; -S swiqg[]={s,e,m,a}; -S sf0mg[]={240,i,a}; -S sYW[]={98,230,0}; -S srXv[]={n,97,r,0}; -S sfei[]={254,e,0}; -S svj[]={r,f,0}; -S sf0yv[]={240,u,r,0}; -S sgfei[]={32,254,e,0}; -S snf3[]={j,243,0}; -S sWo[]={230,k,0}; -S sf6k[]={246,g,0}; -S syf0[]={u,240,0}; -S sioo[]={e,k,k,0}; -S srXvg[]={n,97,r,a}; -S si79[]={e,y,0}; -S sedo[]={237,k,0}; -S sj79v[]={f,y,r,0}; -S s79vmv[]={y,r,i,r,0}; -S smry[]={i,n,u,0}; -S swpy[]={s,l,u,0}; -S s79vm[]={y,r,i,0}; -S sj79vm[]={f,y,r,i,0}; -S sj79[]={f,y,0}; -S svmv[]={r,i,r,0}; -S sivf0[]={e,r,240,0}; -S sjn[]={f,j,0}; -S son[]={k,j,0}; -S svf0y[]={r,240,u,0}; -S sgyq[]={32,u,m,0}; -S sgfeX[]={32,254,97,0}; -S sf0w[]={240,s,0}; -S sjy[]={f,u,0}; -S sXvj[]={97,r,f,0}; -S sioom[]={e,k,k,i,0}; -S soom[]={k,k,i,0}; -S sfeX[]={254,97,0}; -S soomg[]={k,k,i,a}; -S sgioo[]={32,e,k,k,0}; -S sgj79v[]={32,f,y,r,0}; -S spf6k[]={l,246,g,0}; -S sgyqg[]={32,u,m,a}; -S sjW[]={f,230,0}; -S srrm[]={n,n,i,0}; -S sf0yvg[]={240,u,r,a}; -S sgj79[]={32,f,y,0}; -S svyg[]={r,u,a}; -S spyg[]={l,u,a}; -S sgYW[]={32,98,230,0}; -S sgyt[]={32,u,p,0}; -S sf0Xg[]={240,97,a}; -S skXv[]={g,97,r,0}; -S sgytt[]={32,u,p,p,0}; -S sfax[]={250,t,0}; -S sgwe9[]={32,s,233,0}; -S syf0y[]={u,240,u,0}; -S sf3r[]={243,n,0}; -S sf0yg[]={240,u,a}; -S sXf0m[]={97,240,i,0}; -S sif0[]={e,240,0}; -S slij[]={h,e,f,0}; -S srkm[]={n,g,i,0}; -S sytt[]={u,p,p,0}; -S sglij[]={32,h,e,f,0}; -S sWf0[]={230,240,0}; -S sivf0y[]={e,r,240,u,0}; -S svmvg[]={r,i,r,a}; -S sivy[]={e,r,u,0}; -S soyr[]={k,u,n,0}; -S sWx[]={230,t,0}; -S sXzedo[]={97,v,237,k,0}; -S sgjWo[]={32,f,230,k,0}; -S sgivy[]={32,e,r,u,0}; -S sgjn[]={32,f,j,0}; -S svi79[]={r,e,y,0}; -S sjWo[]={f,230,k,0}; -S sWoo[]={230,k,k,0}; -S simf0[]={e,i,240,0}; -S sivyg[]={e,r,u,a}; -S snXv[]={j,97,r,0}; -S sjr[]={f,n,0}; -S sfaxg[]={250,t,a}; -S sgjW[]={32,f,230,0}; -S svf0yv[]={r,240,u,r,0}; -S smrrm[]={i,n,n,i,0}; -S svmf0[]={r,i,240,0}; -S sf0Xv[]={240,97,r,0}; -S sXzed[]={97,v,237,0}; -S sjWoo[]={f,230,k,k,0}; -S szedo[]={v,237,k,0}; -S sirk[]={e,n,g,0}; -S sjyvg[]={f,u,r,a}; -S swos[]={s,k,o,0}; -S sgij[]={32,e,f,0}; -S sgfax[]={32,250,t,0}; -S spmf0[]={l,i,240,0}; -S shXk[]={d,97,g,0}; -S sWvg[]={230,r,a}; -S sryf0[]={n,u,240,0}; -S slz[]={h,v,0}; -S smf0w[]={i,240,s,0}; -S spk[]={l,g,0}; -S sonX[]={k,j,97,0}; -S szedoy[]={v,237,k,u,0}; -S shyvg[]={d,u,r,a}; -S sxmv[]={t,i,r,0}; -S sg25[]={32,37,0}; -S sedoyv[]={237,k,u,r,0}; -S swxyg[]={s,t,u,a}; -S sf3x[]={243,t,0}; -S smrrg[]={i,n,n,a}; -S sXf0mg[]={97,240,i,a}; -S soXf0m[]={k,97,240,i,0}; -S sjvX[]={f,r,97,0}; -S soXf0[]={k,97,240,0}; -S sje9[]={f,233,0}; -S s25g[]={37,a}; -S sYWg[]={98,230,a}; -S sXrrg[]={97,n,n,a}; -S sxW[]={t,230,0}; -S sxmvg[]={t,i,r,a}; -S sedoy[]={237,k,u,0}; -S s79w[]={y,s,0}; -S sjvXq[]={f,r,97,m,0}; -S sg25g[]={32,37,a}; -S sxXvj[]={t,97,r,f,0}; -S smryg[]={i,n,u,a}; -S s79o[]={y,k,0}; -S sirr[]={e,n,n,0}; -S sjyv[]={f,u,r,0}; -S snXr[]={j,97,n,0}; -S soyrg[]={k,u,n,a}; -S spXf0[]={l,97,240,0}; -S sgjp[]={32,f,l,0}; -S spyq[]={l,u,m,0}; -S swe9vg[]={s,233,r,a}; -S sgvi79[]={32,r,e,y,0}; -S sgfaxg[]={32,250,t,a}; -S skyqg[]={g,u,m,a}; -S sfeXv[]={254,97,r,0}; -S si79on[]={e,y,k,j,0}; -S sgfeim[]={32,254,e,i,0}; -S sijy[]={e,f,u,0}; -S swpyg[]={s,l,u,a}; - -N l22n0[]={{srrg,.500},{stt,.131},{soyvg,.235},H}; -N l22n1[]={{sgXf0g,1.216},{sij,.274},{swxg,.294},{snXr,.098},H}; -N l22n2[]={{syk,.078},H}; -N l22n3[]={{ssv,.131},H}; -N l22n5[]={{smr,.719},{sxm,.366},{sXzedo,.183},{sjyv,.118},H}; -N l22n6[]={{svim,.098},H}; -N l22n7[]={{smf0g,.676},{sri,.170},{szed,.118},H}; -N l22n8[]={{swo,.248},{swxyg,.235},{sijy,.098},H}; -N l22n9[]={{sf0m,.735},{slX,.183},{srXvg,.471},{sxmpg,.353},H}; -N l22n11[]={{skv,.131},H}; -N l22n12[]={{sgskg,1.294},{sgp,.392},{smry,.216},H}; -N l22n13[]={{sXr,.471},{sgzi,.765},{swg,.353},{spm,.170},{svmvg,.274},H}; -N l22n14[]={{sgki,.294},H}; -N l22n15[]={{sXf0g,1.382},{sji,.105},H}; -N l22n16[]={{soo,.301},H}; -N l22n18[]={{sik,.209},{s79vmv,.288},H}; -N l22n19[]={{sgXjg,.196},H}; -N l22n21[]={{sgfei,.412},{sog,.235},{shm,.144},H}; -N l22n23[]={{sry,.523},{sgxm,.265},{svmf0,.137},{sjvX,.118},H}; -N l22n24[]={{sgim,.265},{sf6r,.176},H}; -N l22n25[]={{swp,.301},{sfeXv,.221},H}; -N l22n26[]={{simv,.118},H}; -N l22n27[]={{syf0,.170},{sf0yvg,.794},{svf0yv,.183},{si79on,.131},H}; -N l22n28[]={{svr,.131},{sgwo,.265},H}; -N l22n29[]={{syvg,1.088},{sgq,.725},{sivf0,.216},H}; -N l22n30[]={{spn,.091},H}; -N l22n31[]={{sgli,.353},{sjy,.131},{smrrg,.235},H}; -N l22n32[]={{swpy,.216},H}; -N l22n33[]={{sgwiq,.588},{srhX,.157},{sf3x,.176},H}; -N l22n34[]={{syf0y,.157},H}; -N l22n35[]={{srXg,.265},{srrm,.176},H}; -N l22n36[]={{sYW,.183},H}; -N l22n38[]={{sryqg,.627},H}; -N l22n39[]={{shyvg,.235},{sXrrg,.235},H}; -N l22n41[]={{srk,.314},H}; -N l22n42[]={{sioom,.261},{sonX,.118},H}; -N l22n43[]={{sif0,.105},{sedoyv,.353},H}; -N l22n44[]={{sxg,.588},{sqm,.209},H}; -N l22n45[]={{sivg,.265},{snXv,.137},H}; -N l22n46[]={{sgr,.392},{ski,.183},{sgio,.294},H}; -N l22n47[]={{sgj79v,.353},H}; -N l22n48[]={{sf0g,3.617},{simx,.118},H}; -N l22n49[]={{sgRg,.765},{sxyg,.235},H}; -N l22n50[]={{sXf0m,.157},H}; -N l22n51[]={{sfeX,.294},{syrr,.118},H}; -N l22n52[]={{sim,.536},{spg,.274},{sgjn,.206},{sivyg,.274},{sgvi79,.196},H}; -N l22n53[]={{sf0yg,.529},H}; -N l22n57[]={{s79v,.183},{spyg,.265},{sgzm,.235},{sjWo,.137},H}; -N l22n62[]={{sky,.196},H}; -N l22n63[]={{sgs,.706},{svX,.301},H}; -N l22n64[]={{spp,.170},H}; -N l22n67[]={{szm,.170},{smpg,.294},{sirr,.118},H}; -N l22n68[]={{si79,.157},{sgYW,.235},H}; -N l22n71[]={{snX,.314},H}; -N l22n72[]={{ssk,.444},{sgYv,.206},{sgqX,.176},H}; -N l22n73[]={{smv,.471},{sj79v,.216},H}; -N l22n74[]={{skXg,.235},{s79w,.078},{sgjp,.147},H}; -N l22n75[]={{syg,1.098},{srm,.222},{sxmvg,.235},H}; -N l22n77[]={{sli,.170},{skyqg,.196},H}; -N l22n78[]={{somg,.382},H}; -N l22n79[]={{sgir,.235},H}; -N l22n80[]={{sgfeim,.196},H}; -N l22n81[]={{sXv,.954},{sgX,1.039},{swiq,.314},{sglij,.314},H}; -N l22n82[]={{sgoi,.235},{sxW,.078},H}; -N l22n83[]={{sqg,1.353},{sjm,.091},H}; -N l22n84[]={{sos,.157},{sgyq,.294},{srkX,.118},H}; -N l22n85[]={{sg25,.118},H}; -N l22n86[]={{sio,.222},H}; -N l22n87[]={{se9g,.265},H}; -N l22n89[]={{sXrh,.118},H}; -N l22n90[]={{smw,.170},{sfaxg,.463},H}; -N l22n91[]={{sgxmp,.353},H}; -N l22n93[]={{spmf0,.118},H}; -N l22n94[]={{swX,.131},{sjvXq,.157},H}; -N l22n95[]={{sRg,1.588},{sgyr,.235},H}; -N l22n98[]={{sgY,.627},{sXw,.091},{skvi,.137},{sgimr,.196},H}; -N l22n99[]={{sgziv,.627},{sj79,.144},{sxXv,.118},H}; -N l22n100[]={{sjn,.131},H}; -N l22n101[]={{sjyvg,.235},{sxmg,.176},H}; -N l22n102[]={{soX,.209},{swe9,.105},H}; -N l22n103[]={{sip,.091},{sf0Xv,.309},{sryf0,.118},H}; -N l22n104[]={{syq,.640},H}; -N l22n105[]={{sf0mg,.993},H}; -N l22n106[]={{spf6,.196},H}; -N l22n107[]={{smx,.105},{sytt,.157},H}; -N l22n108[]={{sWv,.235},{smryg,.235},H}; -N l22n109[]={{sXrg,.265},{svwx,.118},H}; -N l22n110[]={{slz,.078},H}; -N l22n111[]={{sgioo,.392},H}; -N l22n112[]={{sYv,.131},H}; -N l22n113[]={{svw,.118},H}; -N l22n114[]={{srg,1.098},{skm,.196},{sgv,.176},{smrk,.157},H}; -N l22n115[]={{sXx,.078},H}; -N l22n116[]={{sgqi,.265},{soyr,.137},H}; -N l22n117[]={{sgyt,.235},H}; -N l22n118[]={{sgfax,.176},H}; -N l22n119[]={{sfei,.412},{sryg,.265},H}; -N l22n120[]={{siq,.261},H}; -N l22n121[]={{syr,.444},H}; -N l22n122[]={{sjg,.196},{sgfa,.137},{sjWoo,.183},H}; -N l22n123[]={{sgiv,.500},H}; -N l22n124[]={{sivf0y,.183},H}; -N l22n125[]={{sxX,.405},H}; -N l22n127[]={{sgwx,.294},H}; -N l22n128[]={{swpyg,.196},H}; -N l22n129[]={{sf0X,.529},H}; -N l22n130[]={{svx,.091},H}; -N l22n131[]={{sgw,1.588},{svi,.248},H}; -N l22n132[]={{sj79vm,.288},{simf0,.137},{sXy,.078},{sYWg,.176},H}; -N l22n133[]={{spX,.366},{sXj,.222},H}; -N l22n134[]={{sjp,.170},{sgwe9,.235},H}; -N l22n136[]={{sgjW,.206},{spyq,.098},H}; -N l22n137[]={{sir,.379},H}; -N l22n140[]={{sgjv,.265},H}; -N l22n141[]={{shX,.196},H}; -N l22n142[]={{sWx,.206},{sWoo,.309},{smk,.091},H}; -N l22n144[]={{sww,.105},H}; -N l22n146[]={{sXf0mg,.235},H}; -N l22n147[]={{svy,.144},{soom,.196},H}; -N l22n148[]={{sgx,.451},{svj,.183},H}; -N l22n149[]={{sgi,1.059},{sXz,.118},{sxXvj,.157},H}; -N l22n150[]={{sXk,.196},H}; -N l22n152[]={{smf0w,.118},H}; -N l22n153[]={{skg,.941},{sf3p,.206},H}; -N l22n155[]={{sny,.144},{syt,.105},{s25g,.118},H}; -N l22n157[]={{sged,.902},H}; -N l22n158[]={{sxv,.078},{sgO,.098},H}; -N l22n159[]={{svXg,.176},H}; -N l22n160[]={{srr,.549},{sgqm,.324},{soyv,.176},{sjW,.118},{szedo,.137},H}; -N l22n161[]={{swx,.575},{sgXf0,1.088},{sf6k,.382},H}; -N l22n162[]={{swi,.248},H}; -N l22n164[]={{sqX,.157},H}; -N l22n165[]={{sgy,.529},{skp,.091},H}; -N l22n166[]={{sgj,1.118},H}; -N l22n167[]={{smf0,.497},{snXg,.235},H}; -N l22n168[]={{sskg,.971},{swxy,.157},{sjr,.091},H}; -N l22n169[]={{smvg,.647},{srXv,.274},{sxmp,.176},{sox,.105},H}; -N l22n170[]={{soi,.118},{swed,.065},H}; -N l22n171[]={{srmg,.176},H}; -N l22n172[]={{sgsk,.971},{srkm,.157},{swe9vg,.196},H}; -N l22n173[]={{svmv,.216},H}; -N l22n175[]={{sXf0,.837},{slij,.157},{sgirg,.274},H}; -N l22n177[]={{sXvg,1.000},{swiqg,.588},H}; -N l22n178[]={{swy,.118},H}; -N l22n179[]={{sf0w,.294},{sXvj,.196},{sgXj,.235},H}; -N l22n180[]={{sgyqg,.353},H}; -N l22n181[]={{sg25g,.176},H}; -N l22n182[]={{sgz,.823},{svi79,.137},{soXf0,.118},H}; -N l22n183[]={{sgk,.569},H}; -N l22n184[]={{sph,.091},H}; -N l22n186[]={{soy,.261},H}; -N l22n187[]={{sf0yv,.618},{szX,.118},{sf3r,.235},H}; -N l22n188[]={{s79vm,.216},H}; -N l22n189[]={{syv,.627},H}; -N l22n190[]={{sgfe,.706},{svf0,.301},H}; -N l22n191[]={{smrr,.373},H}; -N l22n192[]={{sxx,.170},H}; -N l22n193[]={{sxi,.157},H}; -N l22n194[]={{s79o,.078},H}; -N l22n195[]={{srX,.392},{swz,.065},H}; -N l22n196[]={{sXzed,.137},H}; -N l22n197[]={{svf0y,.196},{sgytt,.314},{syrh,.137},H}; -N l22n198[]={{sryq,.314},H}; -N l22n199[]={{svm,.366},{skr,.118},{sXrr,.176},{snR,.078},{shyv,.118},H}; -N l22n200[]={{sgl,.882},{syqg,1.323},H}; -N l22n201[]={{spi,.131},{sgvi,.206},{sgjWo,.274},H}; -N l22n202[]={{sWf0,.206},{sywx,.137},H}; -N l22n203[]={{sjX,.105},{srrX,.118},H}; -N l22n204[]={{sWvg,.397},H}; -N l22n205[]={{siv,.575},{swos,.118},H}; -N l22n206[]={{sedo,.353},{syw,.144},H}; -N l22n208[]={{skXv,.157},H}; -N l22n209[]={{sgR,.706},{sxy,.261},{sRv,.176},H}; -N l22n210[]={{smo,.105},H}; -N l22n211[]={{sedg,1.853},{sje9,.078},H}; -N l22n212[]={{sivy,.137},{soyrg,.196},H}; -N l22n213[]={{sf0y,.853},{sedoy,.265},{spXf0,.098},{sirh,.098},H}; -N l22n214[]={{sgfaxg,.196},H}; -N l22n215[]={{smg,1.137},{spf6k,.176},H}; -N l22n216[]={{siqg,.441},H}; -N l22n217[]={{spy,.366},{syrg,.265},{sgj79,.265},H}; -N l22n218[]={{sgwi,.471},{sgivy,.274},H}; -N l22n219[]={{sgivg,.353},H}; -N l22n221[]={{sxXg,.265},H}; -N l22n222[]={{siw,.196},H}; -N l22n223[]={{sXg,1.294},{syx,.105},H}; -N l22n225[]={{shy,.118},{sf0Xg,.529},H}; -N l22n227[]={{smp,.248},H}; -N l22n229[]={{sziv,.353},{sXjg,.147},H}; -N l22n230[]={{swm,.131},{sqmr,.098},H}; -N l22n232[]={{sqi,.157},H}; -N l22n233[]={{sgfeX,.294},{svo,.091},{sirg,.206},H}; -N l22n234[]={{skX,.261},H}; -N l22n235[]={{sXp,.170},{spk,.078},{sxmv,.118},H}; -N l22n236[]={{sjv,.170},H}; -N l22n238[]={{svg,2.314},{som,.301},{simr,.157},{svXq,.137},H}; -N l22n239[]={{sioo,.235},{six,.131},H}; -N l22n241[]={{soXf0m,.157},H}; -N l22n243[]={{sglX,.382},{soomg,.392},{svyg,.265},H}; -N l22n245[]={{sWo,.412},{srw,.131},H}; -N l22n246[]={{srh,.314},{sirk,.137},{sf6p,.176},H}; -N l22n247[]={{sgij,.176},H}; -N l22n248[]={{sriw,.157},{sqy,.078},H}; -N l22n249[]={{snf3,.183},H}; -N l22n250[]={{sfax,.235},{svp,.091},{smrrm,.183},{shXk,.118},{sWg,.265},H}; -N l22n251[]={{sgo,.373},H}; -N l22n252[]={{sXq,.183},H}; -N l22n253[]={{sgedg,1.206},H}; -N l22n255[]={{szi,.457},{son,.131},{szedoy,.157},H}; - -D l22_d = -{ +S sXf0[] = { 97, 240, 0 }; +S sXf0g[] = { 97, 240, a }; +S sgedg[] = { 32, 237, a }; +S smf0[] = { i, 240, 0 }; +S sgXf0[] = { 32, 97, 240, 0 }; +S sgfe[] = { 32, 254, 0 }; +S sgXf0g[] = { 32, 97, 240, a }; +S sf0y[] = { 240, u, 0 }; +S sf0m[] = { 240, i, 0 }; +S smf0g[] = { i, 240, a }; +S svf0[] = { r, 240, 0 }; +S sf0X[] = { 240, 97, 0 }; +S srrg[] = { n, n, a }; +S sryq[] = { n, u, m, 0 }; +S sryqg[] = { n, u, m, a }; +S swiq[] = { s, e, m, 0 }; +S spf6[] = { l, 246, 0 }; +S sgwiq[] = { 32, s, e, m, 0 }; +S swiqg[] = { s, e, m, a }; +S sf0mg[] = { 240, i, a }; +S sYW[] = { 98, 230, 0 }; +S srXv[] = { n, 97, r, 0 }; +S sfei[] = { 254, e, 0 }; +S svj[] = { r, f, 0 }; +S sf0yv[] = { 240, u, r, 0 }; +S sgfei[] = { 32, 254, e, 0 }; +S snf3[] = { j, 243, 0 }; +S sWo[] = { 230, k, 0 }; +S sf6k[] = { 246, g, 0 }; +S syf0[] = { u, 240, 0 }; +S sioo[] = { e, k, k, 0 }; +S srXvg[] = { n, 97, r, a }; +S si79[] = { e, y, 0 }; +S sedo[] = { 237, k, 0 }; +S sj79v[] = { f, y, r, 0 }; +S s79vmv[] = { y, r, i, r, 0 }; +S smry[] = { i, n, u, 0 }; +S swpy[] = { s, l, u, 0 }; +S s79vm[] = { y, r, i, 0 }; +S sj79vm[] = { f, y, r, i, 0 }; +S sj79[] = { f, y, 0 }; +S svmv[] = { r, i, r, 0 }; +S sivf0[] = { e, r, 240, 0 }; +S sjn[] = { f, j, 0 }; +S son[] = { k, j, 0 }; +S svf0y[] = { r, 240, u, 0 }; +S sgyq[] = { 32, u, m, 0 }; +S sgfeX[] = { 32, 254, 97, 0 }; +S sf0w[] = { 240, s, 0 }; +S sjy[] = { f, u, 0 }; +S sXvj[] = { 97, r, f, 0 }; +S sioom[] = { e, k, k, i, 0 }; +S soom[] = { k, k, i, 0 }; +S sfeX[] = { 254, 97, 0 }; +S soomg[] = { k, k, i, a }; +S sgioo[] = { 32, e, k, k, 0 }; +S sgj79v[] = { 32, f, y, r, 0 }; +S spf6k[] = { l, 246, g, 0 }; +S sgyqg[] = { 32, u, m, a }; +S sjW[] = { f, 230, 0 }; +S srrm[] = { n, n, i, 0 }; +S sf0yvg[] = { 240, u, r, a }; +S sgj79[] = { 32, f, y, 0 }; +S svyg[] = { r, u, a }; +S spyg[] = { l, u, a }; +S sgYW[] = { 32, 98, 230, 0 }; +S sgyt[] = { 32, u, p, 0 }; +S sf0Xg[] = { 240, 97, a }; +S skXv[] = { g, 97, r, 0 }; +S sgytt[] = { 32, u, p, p, 0 }; +S sfax[] = { 250, t, 0 }; +S sgwe9[] = { 32, s, 233, 0 }; +S syf0y[] = { u, 240, u, 0 }; +S sf3r[] = { 243, n, 0 }; +S sf0yg[] = { 240, u, a }; +S sXf0m[] = { 97, 240, i, 0 }; +S sif0[] = { e, 240, 0 }; +S slij[] = { h, e, f, 0 }; +S srkm[] = { n, g, i, 0 }; +S sytt[] = { u, p, p, 0 }; +S sglij[] = { 32, h, e, f, 0 }; +S sWf0[] = { 230, 240, 0 }; +S sivf0y[] = { e, r, 240, u, 0 }; +S svmvg[] = { r, i, r, a }; +S sivy[] = { e, r, u, 0 }; +S soyr[] = { k, u, n, 0 }; +S sWx[] = { 230, t, 0 }; +S sXzedo[] = { 97, v, 237, k, 0 }; +S sgjWo[] = { 32, f, 230, k, 0 }; +S sgivy[] = { 32, e, r, u, 0 }; +S sgjn[] = { 32, f, j, 0 }; +S svi79[] = { r, e, y, 0 }; +S sjWo[] = { f, 230, k, 0 }; +S sWoo[] = { 230, k, k, 0 }; +S simf0[] = { e, i, 240, 0 }; +S sivyg[] = { e, r, u, a }; +S snXv[] = { j, 97, r, 0 }; +S sjr[] = { f, n, 0 }; +S sfaxg[] = { 250, t, a }; +S sgjW[] = { 32, f, 230, 0 }; +S svf0yv[] = { r, 240, u, r, 0 }; +S smrrm[] = { i, n, n, i, 0 }; +S svmf0[] = { r, i, 240, 0 }; +S sf0Xv[] = { 240, 97, r, 0 }; +S sXzed[] = { 97, v, 237, 0 }; +S sjWoo[] = { f, 230, k, k, 0 }; +S szedo[] = { v, 237, k, 0 }; +S sirk[] = { e, n, g, 0 }; +S sjyvg[] = { f, u, r, a }; +S swos[] = { s, k, o, 0 }; +S sgij[] = { 32, e, f, 0 }; +S sgfax[] = { 32, 250, t, 0 }; +S spmf0[] = { l, i, 240, 0 }; +S shXk[] = { d, 97, g, 0 }; +S sWvg[] = { 230, r, a }; +S sryf0[] = { n, u, 240, 0 }; +S slz[] = { h, v, 0 }; +S smf0w[] = { i, 240, s, 0 }; +S spk[] = { l, g, 0 }; +S sonX[] = { k, j, 97, 0 }; +S szedoy[] = { v, 237, k, u, 0 }; +S shyvg[] = { d, u, r, a }; +S sxmv[] = { t, i, r, 0 }; +S sg25[] = { 32, 37, 0 }; +S sedoyv[] = { 237, k, u, r, 0 }; +S swxyg[] = { s, t, u, a }; +S sf3x[] = { 243, t, 0 }; +S smrrg[] = { i, n, n, a }; +S sXf0mg[] = { 97, 240, i, a }; +S soXf0m[] = { k, 97, 240, i, 0 }; +S sjvX[] = { f, r, 97, 0 }; +S soXf0[] = { k, 97, 240, 0 }; +S sje9[] = { f, 233, 0 }; +S s25g[] = { 37, a }; +S sYWg[] = { 98, 230, a }; +S sXrrg[] = { 97, n, n, a }; +S sxW[] = { t, 230, 0 }; +S sxmvg[] = { t, i, r, a }; +S sedoy[] = { 237, k, u, 0 }; +S s79w[] = { y, s, 0 }; +S sjvXq[] = { f, r, 97, m, 0 }; +S sg25g[] = { 32, 37, a }; +S sxXvj[] = { t, 97, r, f, 0 }; +S smryg[] = { i, n, u, a }; +S s79o[] = { y, k, 0 }; +S sirr[] = { e, n, n, 0 }; +S sjyv[] = { f, u, r, 0 }; +S snXr[] = { j, 97, n, 0 }; +S soyrg[] = { k, u, n, a }; +S spXf0[] = { l, 97, 240, 0 }; +S sgjp[] = { 32, f, l, 0 }; +S spyq[] = { l, u, m, 0 }; +S swe9vg[] = { s, 233, r, a }; +S sgvi79[] = { 32, r, e, y, 0 }; +S sgfaxg[] = { 32, 250, t, a }; +S skyqg[] = { g, u, m, a }; +S sfeXv[] = { 254, 97, r, 0 }; +S si79on[] = { e, y, k, j, 0 }; +S sgfeim[] = { 32, 254, e, i, 0 }; +S sijy[] = { e, f, u, 0 }; +S swpyg[] = { s, l, u, a }; + +N l22n0[] = { { srrg, .500 }, { stt, .131 }, { soyvg, .235 }, H }; +N l22n1[] = { { sgXf0g, 1.216 }, { sij, .274 }, { swxg, .294 }, { snXr, .098 }, H }; +N l22n2[] = { { syk, .078 }, H }; +N l22n3[] = { { ssv, .131 }, H }; +N l22n5[] = { { smr, .719 }, { sxm, .366 }, { sXzedo, .183 }, { sjyv, .118 }, H }; +N l22n6[] = { { svim, .098 }, H }; +N l22n7[] = { { smf0g, .676 }, { sri, .170 }, { szed, .118 }, H }; +N l22n8[] = { { swo, .248 }, { swxyg, .235 }, { sijy, .098 }, H }; +N l22n9[] = { { sf0m, .735 }, { slX, .183 }, { srXvg, .471 }, { sxmpg, .353 }, H }; +N l22n11[] = { { skv, .131 }, H }; +N l22n12[] = { { sgskg, 1.294 }, { sgp, .392 }, { smry, .216 }, H }; +N l22n13[] = { { sXr, .471 }, { sgzi, .765 }, { swg, .353 }, { spm, .170 }, { svmvg, .274 }, H }; +N l22n14[] = { { sgki, .294 }, H }; +N l22n15[] = { { sXf0g, 1.382 }, { sji, .105 }, H }; +N l22n16[] = { { soo, .301 }, H }; +N l22n18[] = { { sik, .209 }, { s79vmv, .288 }, H }; +N l22n19[] = { { sgXjg, .196 }, H }; +N l22n21[] = { { sgfei, .412 }, { sog, .235 }, { shm, .144 }, H }; +N l22n23[] = { { sry, .523 }, { sgxm, .265 }, { svmf0, .137 }, { sjvX, .118 }, H }; +N l22n24[] = { { sgim, .265 }, { sf6r, .176 }, H }; +N l22n25[] = { { swp, .301 }, { sfeXv, .221 }, H }; +N l22n26[] = { { simv, .118 }, H }; +N l22n27[] = { { syf0, .170 }, { sf0yvg, .794 }, { svf0yv, .183 }, { si79on, .131 }, H }; +N l22n28[] = { { svr, .131 }, { sgwo, .265 }, H }; +N l22n29[] = { { syvg, 1.088 }, { sgq, .725 }, { sivf0, .216 }, H }; +N l22n30[] = { { spn, .091 }, H }; +N l22n31[] = { { sgli, .353 }, { sjy, .131 }, { smrrg, .235 }, H }; +N l22n32[] = { { swpy, .216 }, H }; +N l22n33[] = { { sgwiq, .588 }, { srhX, .157 }, { sf3x, .176 }, H }; +N l22n34[] = { { syf0y, .157 }, H }; +N l22n35[] = { { srXg, .265 }, { srrm, .176 }, H }; +N l22n36[] = { { sYW, .183 }, H }; +N l22n38[] = { { sryqg, .627 }, H }; +N l22n39[] = { { shyvg, .235 }, { sXrrg, .235 }, H }; +N l22n41[] = { { srk, .314 }, H }; +N l22n42[] = { { sioom, .261 }, { sonX, .118 }, H }; +N l22n43[] = { { sif0, .105 }, { sedoyv, .353 }, H }; +N l22n44[] = { { sxg, .588 }, { sqm, .209 }, H }; +N l22n45[] = { { sivg, .265 }, { snXv, .137 }, H }; +N l22n46[] = { { sgr, .392 }, { ski, .183 }, { sgio, .294 }, H }; +N l22n47[] = { { sgj79v, .353 }, H }; +N l22n48[] = { { sf0g, 3.617 }, { simx, .118 }, H }; +N l22n49[] = { { sgRg, .765 }, { sxyg, .235 }, H }; +N l22n50[] = { { sXf0m, .157 }, H }; +N l22n51[] = { { sfeX, .294 }, { syrr, .118 }, H }; +N l22n52[] = { { sim, .536 }, { spg, .274 }, { sgjn, .206 }, { sivyg, .274 }, { sgvi79, .196 }, H }; +N l22n53[] = { { sf0yg, .529 }, H }; +N l22n57[] = { { s79v, .183 }, { spyg, .265 }, { sgzm, .235 }, { sjWo, .137 }, H }; +N l22n62[] = { { sky, .196 }, H }; +N l22n63[] = { { sgs, .706 }, { svX, .301 }, H }; +N l22n64[] = { { spp, .170 }, H }; +N l22n67[] = { { szm, .170 }, { smpg, .294 }, { sirr, .118 }, H }; +N l22n68[] = { { si79, .157 }, { sgYW, .235 }, H }; +N l22n71[] = { { snX, .314 }, H }; +N l22n72[] = { { ssk, .444 }, { sgYv, .206 }, { sgqX, .176 }, H }; +N l22n73[] = { { smv, .471 }, { sj79v, .216 }, H }; +N l22n74[] = { { skXg, .235 }, { s79w, .078 }, { sgjp, .147 }, H }; +N l22n75[] = { { syg, 1.098 }, { srm, .222 }, { sxmvg, .235 }, H }; +N l22n77[] = { { sli, .170 }, { skyqg, .196 }, H }; +N l22n78[] = { { somg, .382 }, H }; +N l22n79[] = { { sgir, .235 }, H }; +N l22n80[] = { { sgfeim, .196 }, H }; +N l22n81[] = { { sXv, .954 }, { sgX, 1.039 }, { swiq, .314 }, { sglij, .314 }, H }; +N l22n82[] = { { sgoi, .235 }, { sxW, .078 }, H }; +N l22n83[] = { { sqg, 1.353 }, { sjm, .091 }, H }; +N l22n84[] = { { sos, .157 }, { sgyq, .294 }, { srkX, .118 }, H }; +N l22n85[] = { { sg25, .118 }, H }; +N l22n86[] = { { sio, .222 }, H }; +N l22n87[] = { { se9g, .265 }, H }; +N l22n89[] = { { sXrh, .118 }, H }; +N l22n90[] = { { smw, .170 }, { sfaxg, .463 }, H }; +N l22n91[] = { { sgxmp, .353 }, H }; +N l22n93[] = { { spmf0, .118 }, H }; +N l22n94[] = { { swX, .131 }, { sjvXq, .157 }, H }; +N l22n95[] = { { sRg, 1.588 }, { sgyr, .235 }, H }; +N l22n98[] = { { sgY, .627 }, { sXw, .091 }, { skvi, .137 }, { sgimr, .196 }, H }; +N l22n99[] = { { sgziv, .627 }, { sj79, .144 }, { sxXv, .118 }, H }; +N l22n100[] = { { sjn, .131 }, H }; +N l22n101[] = { { sjyvg, .235 }, { sxmg, .176 }, H }; +N l22n102[] = { { soX, .209 }, { swe9, .105 }, H }; +N l22n103[] = { { sip, .091 }, { sf0Xv, .309 }, { sryf0, .118 }, H }; +N l22n104[] = { { syq, .640 }, H }; +N l22n105[] = { { sf0mg, .993 }, H }; +N l22n106[] = { { spf6, .196 }, H }; +N l22n107[] = { { smx, .105 }, { sytt, .157 }, H }; +N l22n108[] = { { sWv, .235 }, { smryg, .235 }, H }; +N l22n109[] = { { sXrg, .265 }, { svwx, .118 }, H }; +N l22n110[] = { { slz, .078 }, H }; +N l22n111[] = { { sgioo, .392 }, H }; +N l22n112[] = { { sYv, .131 }, H }; +N l22n113[] = { { svw, .118 }, H }; +N l22n114[] = { { srg, 1.098 }, { skm, .196 }, { sgv, .176 }, { smrk, .157 }, H }; +N l22n115[] = { { sXx, .078 }, H }; +N l22n116[] = { { sgqi, .265 }, { soyr, .137 }, H }; +N l22n117[] = { { sgyt, .235 }, H }; +N l22n118[] = { { sgfax, .176 }, H }; +N l22n119[] = { { sfei, .412 }, { sryg, .265 }, H }; +N l22n120[] = { { siq, .261 }, H }; +N l22n121[] = { { syr, .444 }, H }; +N l22n122[] = { { sjg, .196 }, { sgfa, .137 }, { sjWoo, .183 }, H }; +N l22n123[] = { { sgiv, .500 }, H }; +N l22n124[] = { { sivf0y, .183 }, H }; +N l22n125[] = { { sxX, .405 }, H }; +N l22n127[] = { { sgwx, .294 }, H }; +N l22n128[] = { { swpyg, .196 }, H }; +N l22n129[] = { { sf0X, .529 }, H }; +N l22n130[] = { { svx, .091 }, H }; +N l22n131[] = { { sgw, 1.588 }, { svi, .248 }, H }; +N l22n132[] = { { sj79vm, .288 }, { simf0, .137 }, { sXy, .078 }, { sYWg, .176 }, H }; +N l22n133[] = { { spX, .366 }, { sXj, .222 }, H }; +N l22n134[] = { { sjp, .170 }, { sgwe9, .235 }, H }; +N l22n136[] = { { sgjW, .206 }, { spyq, .098 }, H }; +N l22n137[] = { { sir, .379 }, H }; +N l22n140[] = { { sgjv, .265 }, H }; +N l22n141[] = { { shX, .196 }, H }; +N l22n142[] = { { sWx, .206 }, { sWoo, .309 }, { smk, .091 }, H }; +N l22n144[] = { { sww, .105 }, H }; +N l22n146[] = { { sXf0mg, .235 }, H }; +N l22n147[] = { { svy, .144 }, { soom, .196 }, H }; +N l22n148[] = { { sgx, .451 }, { svj, .183 }, H }; +N l22n149[] = { { sgi, 1.059 }, { sXz, .118 }, { sxXvj, .157 }, H }; +N l22n150[] = { { sXk, .196 }, H }; +N l22n152[] = { { smf0w, .118 }, H }; +N l22n153[] = { { skg, .941 }, { sf3p, .206 }, H }; +N l22n155[] = { { sny, .144 }, { syt, .105 }, { s25g, .118 }, H }; +N l22n157[] = { { sged, .902 }, H }; +N l22n158[] = { { sxv, .078 }, { sgO, .098 }, H }; +N l22n159[] = { { svXg, .176 }, H }; +N l22n160[] = { { srr, .549 }, { sgqm, .324 }, { soyv, .176 }, { sjW, .118 }, { szedo, .137 }, H }; +N l22n161[] = { { swx, .575 }, { sgXf0, 1.088 }, { sf6k, .382 }, H }; +N l22n162[] = { { swi, .248 }, H }; +N l22n164[] = { { sqX, .157 }, H }; +N l22n165[] = { { sgy, .529 }, { skp, .091 }, H }; +N l22n166[] = { { sgj, 1.118 }, H }; +N l22n167[] = { { smf0, .497 }, { snXg, .235 }, H }; +N l22n168[] = { { sskg, .971 }, { swxy, .157 }, { sjr, .091 }, H }; +N l22n169[] = { { smvg, .647 }, { srXv, .274 }, { sxmp, .176 }, { sox, .105 }, H }; +N l22n170[] = { { soi, .118 }, { swed, .065 }, H }; +N l22n171[] = { { srmg, .176 }, H }; +N l22n172[] = { { sgsk, .971 }, { srkm, .157 }, { swe9vg, .196 }, H }; +N l22n173[] = { { svmv, .216 }, H }; +N l22n175[] = { { sXf0, .837 }, { slij, .157 }, { sgirg, .274 }, H }; +N l22n177[] = { { sXvg, 1.000 }, { swiqg, .588 }, H }; +N l22n178[] = { { swy, .118 }, H }; +N l22n179[] = { { sf0w, .294 }, { sXvj, .196 }, { sgXj, .235 }, H }; +N l22n180[] = { { sgyqg, .353 }, H }; +N l22n181[] = { { sg25g, .176 }, H }; +N l22n182[] = { { sgz, .823 }, { svi79, .137 }, { soXf0, .118 }, H }; +N l22n183[] = { { sgk, .569 }, H }; +N l22n184[] = { { sph, .091 }, H }; +N l22n186[] = { { soy, .261 }, H }; +N l22n187[] = { { sf0yv, .618 }, { szX, .118 }, { sf3r, .235 }, H }; +N l22n188[] = { { s79vm, .216 }, H }; +N l22n189[] = { { syv, .627 }, H }; +N l22n190[] = { { sgfe, .706 }, { svf0, .301 }, H }; +N l22n191[] = { { smrr, .373 }, H }; +N l22n192[] = { { sxx, .170 }, H }; +N l22n193[] = { { sxi, .157 }, H }; +N l22n194[] = { { s79o, .078 }, H }; +N l22n195[] = { { srX, .392 }, { swz, .065 }, H }; +N l22n196[] = { { sXzed, .137 }, H }; +N l22n197[] = { { svf0y, .196 }, { sgytt, .314 }, { syrh, .137 }, H }; +N l22n198[] = { { sryq, .314 }, H }; +N l22n199[] = { { svm, .366 }, { skr, .118 }, { sXrr, .176 }, { snR, .078 }, { shyv, .118 }, H }; +N l22n200[] = { { sgl, .882 }, { syqg, 1.323 }, H }; +N l22n201[] = { { spi, .131 }, { sgvi, .206 }, { sgjWo, .274 }, H }; +N l22n202[] = { { sWf0, .206 }, { sywx, .137 }, H }; +N l22n203[] = { { sjX, .105 }, { srrX, .118 }, H }; +N l22n204[] = { { sWvg, .397 }, H }; +N l22n205[] = { { siv, .575 }, { swos, .118 }, H }; +N l22n206[] = { { sedo, .353 }, { syw, .144 }, H }; +N l22n208[] = { { skXv, .157 }, H }; +N l22n209[] = { { sgR, .706 }, { sxy, .261 }, { sRv, .176 }, H }; +N l22n210[] = { { smo, .105 }, H }; +N l22n211[] = { { sedg, 1.853 }, { sje9, .078 }, H }; +N l22n212[] = { { sivy, .137 }, { soyrg, .196 }, H }; +N l22n213[] = { { sf0y, .853 }, { sedoy, .265 }, { spXf0, .098 }, { sirh, .098 }, H }; +N l22n214[] = { { sgfaxg, .196 }, H }; +N l22n215[] = { { smg, 1.137 }, { spf6k, .176 }, H }; +N l22n216[] = { { siqg, .441 }, H }; +N l22n217[] = { { spy, .366 }, { syrg, .265 }, { sgj79, .265 }, H }; +N l22n218[] = { { sgwi, .471 }, { sgivy, .274 }, H }; +N l22n219[] = { { sgivg, .353 }, H }; +N l22n221[] = { { sxXg, .265 }, H }; +N l22n222[] = { { siw, .196 }, H }; +N l22n223[] = { { sXg, 1.294 }, { syx, .105 }, H }; +N l22n225[] = { { shy, .118 }, { sf0Xg, .529 }, H }; +N l22n227[] = { { smp, .248 }, H }; +N l22n229[] = { { sziv, .353 }, { sXjg, .147 }, H }; +N l22n230[] = { { swm, .131 }, { sqmr, .098 }, H }; +N l22n232[] = { { sqi, .157 }, H }; +N l22n233[] = { { sgfeX, .294 }, { svo, .091 }, { sirg, .206 }, H }; +N l22n234[] = { { skX, .261 }, H }; +N l22n235[] = { { sXp, .170 }, { spk, .078 }, { sxmv, .118 }, H }; +N l22n236[] = { { sjv, .170 }, H }; +N l22n238[] = { { svg, 2.314 }, { som, .301 }, { simr, .157 }, { svXq, .137 }, H }; +N l22n239[] = { { sioo, .235 }, { six, .131 }, H }; +N l22n241[] = { { soXf0m, .157 }, H }; +N l22n243[] = { { sglX, .382 }, { soomg, .392 }, { svyg, .265 }, H }; +N l22n245[] = { { sWo, .412 }, { srw, .131 }, H }; +N l22n246[] = { { srh, .314 }, { sirk, .137 }, { sf6p, .176 }, H }; +N l22n247[] = { { sgij, .176 }, H }; +N l22n248[] = { { sriw, .157 }, { sqy, .078 }, H }; +N l22n249[] = { { snf3, .183 }, H }; +N l22n250[] = { { sfax, .235 }, { svp, .091 }, { smrrm, .183 }, { shXk, .118 }, { sWg, .265 }, H }; +N l22n251[] = { { sgo, .373 }, H }; +N l22n252[] = { { sXq, .183 }, H }; +N l22n253[] = { { sgedg, 1.206 }, H }; +N l22n255[] = { { szi, .457 }, { son, .131 }, { szedoy, .157 }, H }; + +D l22_d = { "icelandic", "iso-8859-1", - { - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,0.003,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,0.176,0.027,W,0.025,0.127,0.071,0.086,0.029,0.133,0.033,0.079,0.087,0.073,0.149,0.037, - 0.018,W,0.166,0.108,0.094,0.130,0.040,W,W,0.019,W,W,W,W,W,W, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - Y,0.001,V,V,V,V,V,V,V,0.001,V,V,V,0.005,V,V, - V,V,V,V,V,V,V,V,V,V,0.001,V,V,V,0.006,V, - V,0.074,V,V,V,V,0.065,V,V,0.021,V,V,V,0.084,V,V, - 0.206,V,V,0.051,V,V,0.051,V,V,V,0.031,V,V,0.011,0.045,V - }, - { - l22n0,l22n1,l22n2,l22n3,X,l22n5,l22n6,l22n7,l22n8,l22n9,X,l22n11,l22n12,l22n13,l22n14,l22n15, - l22n16,X,l22n18,l22n19,X,l22n21,X,l22n23,l22n24,l22n25,l22n26,l22n27,l22n28,l22n29,l22n30,l22n31, - l22n32,l22n33,l22n34,l22n35,l22n36,X,l22n38,l22n39,X,l22n41,l22n42,l22n43,l22n44,l22n45,l22n46,l22n47, - l22n48,l22n49,l22n50,l22n51,l22n52,l22n53,X,X,X,l22n57,X,X,X,X,l22n62,l22n63, - l22n64,X,X,l22n67,l22n68,X,X,l22n71,l22n72,l22n73,l22n74,l22n75,X,l22n77,l22n78,l22n79, - l22n80,l22n81,l22n82,l22n83,l22n84,l22n85,l22n86,l22n87,X,l22n89,l22n90,l22n91,X,l22n93,l22n94,l22n95, - X,X,l22n98,l22n99,l22n100,l22n101,l22n102,l22n103,l22n104,l22n105,l22n106,l22n107,l22n108,l22n109,l22n110,l22n111, - l22n112,l22n113,l22n114,l22n115,l22n116,l22n117,l22n118,l22n119,l22n120,l22n121,l22n122,l22n123,l22n124,l22n125,X,l22n127, - l22n128,l22n129,l22n130,l22n131,l22n132,l22n133,l22n134,X,l22n136,l22n137,X,X,l22n140,l22n141,l22n142,X, - l22n144,X,l22n146,l22n147,l22n148,l22n149,l22n150,X,l22n152,l22n153,X,l22n155,X,l22n157,l22n158,l22n159, - l22n160,l22n161,l22n162,X,l22n164,l22n165,l22n166,l22n167,l22n168,l22n169,l22n170,l22n171,l22n172,l22n173,X,l22n175, - X,l22n177,l22n178,l22n179,l22n180,l22n181,l22n182,l22n183,l22n184,X,l22n186,l22n187,l22n188,l22n189,l22n190,l22n191, - l22n192,l22n193,l22n194,l22n195,l22n196,l22n197,l22n198,l22n199,l22n200,l22n201,l22n202,l22n203,l22n204,l22n205,l22n206,X, - l22n208,l22n209,l22n210,l22n211,l22n212,l22n213,l22n214,l22n215,l22n216,l22n217,l22n218,l22n219,X,l22n221,l22n222,l22n223, - X,l22n225,X,l22n227,X,l22n229,l22n230,X,l22n232,l22n233,l22n234,l22n235,l22n236,X,l22n238,l22n239, - X,l22n241,X,l22n243,X,l22n245,l22n246,l22n247,l22n248,l22n249,l22n250,l22n251,l22n252,l22n253,X,l22n255 - } + { W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, 0.003, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, 0.176, 0.027, W, 0.025, 0.127, 0.071, 0.086, 0.029, 0.133, 0.033, 0.079, 0.087, 0.073, 0.149, 0.037, + 0.018, W, 0.166, 0.108, 0.094, 0.130, 0.040, W, W, 0.019, W, W, W, W, W, W, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + Y, 0.001, V, V, V, V, V, V, V, 0.001, V, V, V, 0.005, V, V, + V, V, V, V, V, V, V, V, V, V, 0.001, V, V, V, 0.006, V, + V, 0.074, V, V, V, V, 0.065, V, V, 0.021, V, V, V, 0.084, V, V, + 0.206, V, V, 0.051, V, V, 0.051, V, V, V, 0.031, V, V, 0.011, 0.045, V }, + { l22n0, l22n1, l22n2, l22n3, X, l22n5, l22n6, l22n7, l22n8, l22n9, X, l22n11, l22n12, l22n13, l22n14, l22n15, + l22n16, X, l22n18, l22n19, X, l22n21, X, l22n23, l22n24, l22n25, l22n26, l22n27, l22n28, l22n29, l22n30, l22n31, + l22n32, l22n33, l22n34, l22n35, l22n36, X, l22n38, l22n39, X, l22n41, l22n42, l22n43, l22n44, l22n45, l22n46, l22n47, + l22n48, l22n49, l22n50, l22n51, l22n52, l22n53, X, X, X, l22n57, X, X, X, X, l22n62, l22n63, + l22n64, X, X, l22n67, l22n68, X, X, l22n71, l22n72, l22n73, l22n74, l22n75, X, l22n77, l22n78, l22n79, + l22n80, l22n81, l22n82, l22n83, l22n84, l22n85, l22n86, l22n87, X, l22n89, l22n90, l22n91, X, l22n93, l22n94, l22n95, + X, X, l22n98, l22n99, l22n100, l22n101, l22n102, l22n103, l22n104, l22n105, l22n106, l22n107, l22n108, l22n109, l22n110, l22n111, + l22n112, l22n113, l22n114, l22n115, l22n116, l22n117, l22n118, l22n119, l22n120, l22n121, l22n122, l22n123, l22n124, l22n125, X, l22n127, + l22n128, l22n129, l22n130, l22n131, l22n132, l22n133, l22n134, X, l22n136, l22n137, X, X, l22n140, l22n141, l22n142, X, + l22n144, X, l22n146, l22n147, l22n148, l22n149, l22n150, X, l22n152, l22n153, X, l22n155, X, l22n157, l22n158, l22n159, + l22n160, l22n161, l22n162, X, l22n164, l22n165, l22n166, l22n167, l22n168, l22n169, l22n170, l22n171, l22n172, l22n173, X, l22n175, + X, l22n177, l22n178, l22n179, l22n180, l22n181, l22n182, l22n183, l22n184, X, l22n186, l22n187, l22n188, l22n189, l22n190, l22n191, + l22n192, l22n193, l22n194, l22n195, l22n196, l22n197, l22n198, l22n199, l22n200, l22n201, l22n202, l22n203, l22n204, l22n205, l22n206, X, + l22n208, l22n209, l22n210, l22n211, l22n212, l22n213, l22n214, l22n215, l22n216, l22n217, l22n218, l22n219, X, l22n221, l22n222, l22n223, + X, l22n225, X, l22n227, X, l22n229, l22n230, X, l22n232, l22n233, l22n234, l22n235, l22n236, X, l22n238, l22n239, + X, l22n241, X, l22n243, X, l22n245, l22n246, l22n247, l22n248, l22n249, l22n250, l22n251, l22n252, l22n253, X, l22n255 } }; - - // // Lng: irish // Enc: iso-8859-1 // - -S sYl[]={98,h,0}; -S sgYl[]={32,98,h,0}; -S sgXrg[]={32,97,n,a}; -S sgXk[]={32,97,g,0}; -S sql[]={m,h,0}; -S sXZlg[]={97,99,h,a}; -S swe9g[]={s,233,a}; -S sRm[]={225,i,0}; -S sgwe9g[]={32,s,233,a}; -S siXr[]={e,97,n,0}; -S se9X[]={233,97,0}; -S slXm[]={h,97,i,0}; -S sXkyw[]={97,g,u,s,0}; -S sgXvg[]={32,97,r,a}; -S skyw[]={g,u,s,0}; -S sgXky[]={32,97,g,u,0}; -S skywg[]={g,u,s,a}; -S sXky[]={97,g,u,0}; -S sgXZ[]={32,97,99,0}; -S shlg[]={d,h,a}; -S sled[]={h,237,0}; -S se9m[]={233,i,0}; -S sYled[]={98,h,237,0}; -S sgYled[]={32,98,h,237,0}; -S sxRg[]={t,225,a}; -S skl[]={g,h,0}; -S sgred[]={32,n,237,0}; -S siXv[]={e,97,r,0}; -S sXql[]={97,m,h,0}; -S smkl[]={i,g,h,0}; -S siXZ[]={e,97,99,0}; -S sgXkg[]={32,97,g,a}; -S sYledg[]={98,h,237,a}; -S sledg[]={h,237,a}; -S siXZl[]={e,97,99,h,0}; -S sgksg[]={32,g,o,a}; -S sjl[]={f,h,0}; -S sqlg[]={m,h,a}; -S sliX[]={h,e,97,0}; -S sved[]={r,237,0}; -S sis[]={e,o,0}; -S seds[]={237,o,0}; -S sgjl[]={32,f,h,0}; -S slRm[]={h,225,i,0}; -S sgxRg[]={32,t,225,a}; -S sxlg[]={t,h,a}; -S sgxR[]={32,t,225,0}; -S sXmk[]={97,i,g,0}; -S sXmh[]={97,i,d,0}; -S sZlX[]={99,h,97,0}; -S smxlg[]={i,t,h,a}; -S sXmxl[]={97,i,t,h,0}; -S sgXZl[]={32,97,99,h,0}; -S sXqlg[]={97,m,h,a}; -S slj[]={h,f,0}; -S sklg[]={g,h,a}; -S sXZlX[]={97,99,h,97,0}; -S sXmkl[]={97,i,g,h,0}; -S smklg[]={i,g,h,a}; -S sXmvg[]={97,i,r,a}; -S sle9[]={h,233,0}; -S sYiX[]={98,e,97,0}; -S smhlg[]={i,d,h,a}; -S swiX[]={s,e,97,0}; -S siXk[]={e,97,g,0}; -S sgql[]={32,m,h,0}; -S sgYlj[]={32,98,h,f,0}; -S sxiX[]={t,e,97,0}; -S siXrg[]={e,97,n,a}; -S smpi[]={i,l,e,0}; -S sXkX[]={97,g,97,0}; -S smhg[]={i,d,a}; -S sZly[]={99,h,u,0}; -S sYlj[]={98,h,f,0}; -S symp[]={u,i,l,0}; -S smhl[]={i,d,h,0}; -S sgZly[]={32,99,h,u,0}; -S sfam[]={250,i,0}; -S smpig[]={i,l,e,a}; -S sgYiX[]={32,98,e,97,0}; -S se9Xr[]={233,97,n,0}; -S sqlX[]={m,h,97,0}; -S sXmp[]={97,i,l,0}; -S sqe9g[]={m,233,a}; -S sYli[]={98,h,e,0}; -S sliXr[]={h,e,97,n,0}; -S sf3w[]={243,s,0}; -S sgwed[]={32,s,237,0}; -S sgqe9g[]={32,m,233,a}; -S sgredg[]={32,n,237,a}; -S sXhl[]={97,d,h,0}; -S sjXm[]={f,97,i,0}; -S swedg[]={s,237,a}; -S shiX[]={d,e,97,0}; -S sgYli[]={32,98,h,e,0}; -S sgwedg[]={32,s,237,a}; -S sXhlg[]={97,d,h,a}; -S shim[]={d,e,i,0}; -S sghim[]={32,d,e,i,0}; -S spim[]={l,e,i,0}; -S sgpim[]={32,l,e,i,0}; -S shimv[]={d,e,i,r,0}; -S swiXr[]={s,e,97,n,0}; -S slym[]={h,u,i,0}; -S sgXq[]={32,97,m,0}; -S slf3[]={h,243,0}; -S sRmh[]={225,i,d,0}; -S swis[]={s,e,o,0}; -S siXrr[]={e,97,n,n,0}; -S slyX[]={h,u,97,0}; -S sgmrX[]={32,i,n,97,0}; -S sgXkX[]={32,97,g,97,0}; -S symh[]={u,i,d,0}; -S ssmw[]={o,i,s,0}; -S slXmv[]={h,97,i,r,0}; -S sgZls[]={32,99,h,o,0}; -S simw[]={e,i,s,0}; -S srXZ[]={n,97,99,0}; -S sRmp[]={225,i,l,0}; -S sXed[]={97,237,0}; -S sZlXg[]={99,h,97,a}; -S syXm[]={u,97,i,0}; -S syed[]={u,237,0}; -S smZg[]={i,99,a}; -S stl[]={p,h,0}; -S sYliX[]={98,h,e,97,0}; -S sf3wx[]={243,s,t,0}; -S ssZl[]={o,99,h,0}; -S sXmhl[]={97,i,d,h,0}; -S smrX[]={i,n,97,0}; -S se9Xp[]={233,97,l,0}; -S sxlXm[]={t,h,97,i,0}; -S smrXg[]={i,n,97,a}; -S symhg[]={u,i,d,a}; -S siXvg[]={e,97,r,a}; -S sXvvX[]={97,r,r,97,0}; -S sgpR[]={32,l,225,0}; -S sXxl[]={97,t,h,0}; -S sZe9[]={99,233,0}; -S syedg[]={u,237,a}; -S sxiXZ[]={t,e,97,99,0}; -S svvX[]={r,r,97,0}; -S srXZl[]={n,97,99,h,0}; -S sxfa[]={t,250,0}; -S sympg[]={u,i,l,a}; -S sgwiX[]={32,s,e,97,0}; -S spimw[]={l,e,i,s,0}; -S sisg[]={e,o,a}; -S sghfa[]={32,d,250,0}; -S sYlg[]={98,h,a}; -S sgf3w[]={32,243,s,0}; -S sle9X[]={h,233,97,0}; -S sedrg[]={237,n,a}; -S swisg[]={s,e,o,a}; -S skXm[]={g,97,i,0}; -S shed[]={d,237,0}; -S sjym[]={f,u,i,0}; -S sgXZy[]={32,97,99,u,0}; -S sveds[]={r,237,o,0}; -S sgtl[]={32,p,h,0}; -S sZyg[]={99,u,a}; -S sRmr[]={225,i,n,0}; -S sxlXv[]={t,h,97,r,0}; -S sljy[]={h,f,u,0}; -S sYiXk[]={98,e,97,g,0}; -S svxl[]={r,t,h,0}; -S spsm[]={l,o,i,0}; -S sgpRg[]={32,l,225,a}; -S se9Xpg[]={233,97,l,a}; -S sge9g[]={32,233,a}; - -N l23n0[]={{srrg,.626},{sgXq,.231},H}; -N l23n1[]={{stX,.102},H}; -N l23n3[]={{ssv,.161},{sgf3,.241},H}; -N l23n4[]={{shl,.381},{sXmh,.241},{ssZ,.117},{srXZ,.132},H}; -N l23n5[]={{smr,.820},{sxm,.190},{spR,.132},H}; -N l23n6[]={{smkl,.307},{srx,.132},{sgwm,.231},H}; -N l23n7[]={{sri,.132},{sghm,.198},H}; -N l23n9[]={{slX,.644},{sgYli,.307},H}; -N l23n10[]={{swedg,.231},H}; -N l23n11[]={{sgXr,1.482},H}; -N l23n12[]={{sgp,.856},{slRm,.263},{sgYlj,.395},{sgxl,.263},{sqe9g,.263},{sf3wx,.296},H}; -N l23n13[]={{sXr,1.273},{swg,1.317},{spm,.132},H}; -N l23n15[]={{sred,.220},{sji,.088},H}; -N l23n16[]={{sZlX,.241},{sf3w,.263},H}; -N l23n17[]={{sle9,.146},H}; -N l23n18[]={{seds,.428},{sgwedg,.307},H}; -N l23n20[]={{ssw,.088},H}; -N l23n21[]={{shm,.117},{sxiXZ,.176},H}; -N l23n22[]={{sms,.132},{sghim,.307},H}; -N l23n23[]={{sgxm,.263},{swiXr,.205},{sgpRg,.220},H}; -N l23n25[]={{siXk,.198},H}; -N l23n26[]={{simv,.154},H}; -N l23n27[]={{sql,.439},H}; -N l23n29[]={{sgq,1.142},{sgXky,.790},{sZg,.285},{sYli,.176},H}; -N l23n30[]={{sgXkg,.615},{sgjl,.395},{sXs,.073},H}; -N l23n31[]={{sxlX,.351},{syXm,.132},{sjy,.073},H}; -N l23n32[]={{sgqe9,.263},H}; -N l23n33[]={{sxig,.231},H}; -N l23n34[]={{sZyg,.165},H}; -N l23n35[]={{srXg,.494},H}; -N l23n36[]={{sym,.322},{sgqy,.231},H}; -N l23n37[]={{siXZl,.410},{sXmk,.241},{simw,.132},H}; -N l23n38[]={{sYlg,.165},H}; -N l23n39[]={{sXrrg,.571},H}; -N l23n40[]={{smX,.220},{sYlj,.198},{sympg,.263},H}; -N l23n41[]={{spig,.461},{srk,.176},H}; -N l23n42[]={{sXZlg,1.142},{slv,.117},H}; -N l23n44[]={{sxg,.615},H}; -N l23n45[]={{svs,.073},H}; -N l23n46[]={{sgr,.659},{sywg,.593},H}; -N l23n47[]={{skyw,.395},H}; -N l23n48[]={{se9m,.494},{smrX,.132},{simx,.110},H}; -N l23n51[]={{smhlg,.395},H}; -N l23n52[]={{spg,.812},{sim,.351},H}; -N l23n55[]={{sgXv,.823},{sXvv,.132},H}; -N l23n56[]={{sRm,.790},{sksg,.494},{sXrX,.154},{sgZls,.263},H}; -N l23n57[]={{sgmg,.198},H}; -N l23n58[]={{smpi,.198},H}; -N l23n59[]={{sXhlg,.307},H}; -N l23n60[]={{shg,.461},{sXmhl,.176},{srXZl,.176},{sle9X,.110},{sZli,.110},H}; -N l23n61[]={{sYs,.073},H}; -N l23n62[]={{sky,.307},H}; -N l23n63[]={{svX,.337},{sgxR,.395},{sgs,.198},{sfam,.263},H}; -N l23n64[]={{spp,.117},{sYliX,.176},H}; -N l23n65[]={{sZlxg,.263},H}; -N l23n66[]={{sjl,.190},{sghfa,.165},{sgXw,.165},H}; -N l23n67[]={{smpg,.494},{smxlg,.483},H}; -N l23n69[]={{sZlg,.889},H}; -N l23n70[]={{sqlX,.176},H}; -N l23n72[]={{sgqX,.329},{sgYv,.198},{syedg,.198},H}; -N l23n73[]={{smv,.644},H}; -N l23n74[]={{sgZly,.395},{smZ,.117},H}; -N l23n75[]={{sXpg,.329},{syg,.110},H}; -N l23n76[]={{slx,.132},{spim,.154},{se9Xp,.296},H}; -N l23n77[]={{sli,.337},{sXvx,.220},{sgXx,.198},H}; -N l23n78[]={{sjXm,.154},H}; -N l23n79[]={{sYX,.102},H}; -N l23n80[]={{sgt,.461},{sveds,.110},H}; -N l23n81[]={{sgX,4.347},{sXv,.864},H}; -N l23n82[]={{sXZ,.717},H}; -N l23n83[]={{sqg,.285},H}; -N l23n84[]={{sxlg,.395},{shim,.154},{srkX,.110},H}; -N l23n85[]={{sled,.220},{sYledg,.615},H}; -N l23n86[]={{smwx,.176},H}; -N l23n87[]={{se9g,1.877},H}; -N l23n89[]={{sge9,.263},{sgrX,.263},H}; -N l23n90[]={{smw,.483},{sxlXm,.176},{sXvvX,.176},H}; -N l23n91[]={{sig,.812},{smh,.468},{ssmw,.132},H}; -N l23n92[]={{sXmp,.176},H}; -N l23n93[]={{sly,.278},{sxRg,.494},{sgred,.494},{sXmkl,.293},H}; -N l23n94[]={{swX,.263},{slj,.146},H}; -N l23n95[]={{sRg,1.284},H}; -N l23n96[]={{svv,.088},H}; -N l23n97[]={{skl,.220},{sedrg,.370},H}; -N l23n98[]={{sgY,1.427},{sXw,.293},{se9Xr,.395},H}; -N l23n99[]={{sgpi,.790},{sXh,.220},{ssvg,.165},H}; -N l23n100[]={{shlg,.527},H}; -N l23n101[]={{smrg,.593},{sljy,.110},H}; -N l23n102[]={{swe9,.366},{siXr,.483},{smklg,.439},{sfag,.346},H}; -N l23n103[]={{swis,.154},H}; -N l23n105[]={{slXg,.362},H}; -N l23n106[]={{ssm,.278},H}; -N l23n107[]={{sgXrg,1.668},{smx,.381},H}; -N l23n109[]={{sXrg,1.778},{skXm,.110},H}; -N l23n110[]={{sZX,.146},H}; -N l23n111[]={{sredg,.231},H}; -N l23n112[]={{symh,.132},{sYv,.088},{sZlXg,.263},H}; -N l23n114[]={{srg,2.569},{sgv,.241},{sXmr,.220},{smrk,.154},H}; -N l23n115[]={{sgZ,1.251},{sXx,.220},{sps,.073},H}; -N l23n116[]={{sXql,.307},H}; -N l23n117[]={{sxlXv,.146},H}; -N l23n118[]={{sZe9,.088},H}; -N l23n120[]={{sliX,.285},{stl,.088},H}; -N l23n122[]={{simvg,.307},H}; -N l23n123[]={{sqlg,.428},H}; -N l23n124[]={{sgks,.494},{sXed,.088},{ssZl,.132},H}; -N l23n125[]={{sxX,.322},H}; -N l23n127[]={{sxlXg,.220},H}; -N l23n128[]={{swZ,.161},{sgqe9g,.351},H}; -N l23n130[]={{svx,.234},H}; -N l23n131[]={{sgw,1.712},{svi,.205},H}; -N l23n132[]={{sgh,1.120},{sRmh,.346},H}; -N l23n133[]={{spX,.205},{smwxi,.205},H}; -N l23n134[]={{sgwe9,.823},H}; -N l23n136[]={{slyX,.154},H}; -N l23n137[]={{slR,.234},{sir,.102},{srkg,.165},H}; -N l23n139[]={{sved,.190},{svvX,.132},H}; -N l23n140[]={{slXm,.417},H}; -N l23n141[]={{sRr,.362},{shX,.088},H}; -N l23n142[]={{smk,.307},H}; -N l23n143[]={{skywg,.790},H}; -N l23n144[]={{smrXg,.263},H}; -N l23n145[]={{ssg,.571},{slm,.176},H}; -N l23n146[]={{sgXZ,.527},{siXv,.307},{sqs,.088},H}; -N l23n147[]={{sYi,.146},{sgmr,.329},H}; -N l23n148[]={{sgx,1.273},H}; -N l23n149[]={{sgql,.296},{sgi,.110},H}; -N l23n150[]={{sXk,.703},H}; -N l23n151[]={{sgXvg,.790},H}; -N l23n153[]={{skg,.768},H}; -N l23n154[]={{sis,.190},{smpig,.351},H}; -N l23n156[]={{syX,.249},H}; -N l23n157[]={{sXky,.395},{ssp,.102},H}; -N l23n158[]={{sXmv,.263},{sgpim,.307},{sxv,.088},H}; -N l23n159[]={{sgxRg,.527},{svXg,.263},H}; -N l23n160[]={{srr,.410},H}; -N l23n161[]={{swx,.263},{sgYled,.659},H}; -N l23n162[]={{swi,.293},{sjym,.110},H}; -N l23n164[]={{sqX,.220},H}; -N l23n165[]={{spimw,.146},H}; -N l23n166[]={{sgj,.768},{sxfa,.088},H}; -N l23n168[]={{se9X,.692},H}; -N l23n169[]={{smvg,.856},H}; -N l23n170[]={{swed,.117},{shimv,.205},{smZg,.198},{sZls,.132},H}; -N l23n172[]={{siX,1.098},{sqe9,.117},{slxg,.198},{se9Xpg,.494},H}; -N l23n174[]={{ssq,.146},{sviX,.198},{sgwX,.231},{shv,.088},H}; -N l23n176[]={{siXrr,.205},H}; -N l23n177[]={{sgXg,1.581},{sXvg,1.054},H}; -N l23n178[]={{sgwed,.263},{sZi,.088},H}; -N l23n180[]={{sXmx,.307},H}; -N l23n181[]={{sledg,.461},H}; -N l23n182[]={{sgmrX,.263},H}; -N l23n183[]={{sgk,.637},{sgpR,.198},H}; -N l23n184[]={{slg,1.822},{sXm,1.142},H}; -N l23n185[]={{sgYi,.263},{sge9g,.165},H}; -N l23n186[]={{smwg,.560},H}; -N l23n187[]={{smhg,.296},{slf3,.102},H}; -N l23n189[]={{sgredg,.307},H}; -N l23n190[]={{sgXk,1.251},{swXg,.329},{sYiX,.198},H}; -N l23n191[]={{smrr,.263},{sgxX,.329},{ssr,.117},H}; -N l23n193[]={{sxi,.293},{sklg,.329},{sXkX,.198},H}; -N l23n194[]={{sXwg,.395},{svXm,.241},{sZy,.132},{sliXr,.234},H}; -N l23n195[]={{srX,.468},{sgpig,.263},H}; -N l23n196[]={{sgwZ,.231},H}; -N l23n198[]={{sYl,.732},{swe9g,.790},{siXrg,.395},H}; -N l23n199[]={{sXrr,.329},{svm,.117},{swisg,.220},H}; -N l23n200[]={{symp,.198},{spx,.102},{sgtl,.165},H}; -N l23n201[]={{spi,.498},H}; -N l23n202[]={{sXZl,.900},{sgXZl,.483},{sgmw,.296},H}; -N l23n203[]={{sjX,.205},{smxg,.198},H}; -N l23n205[]={{swiX,.198},H}; -N l23n206[]={{syw,.307},H}; -N l23n208[]={{symhg,.263},H}; -N l23n209[]={{shi,.278},{sgjX,.263},{sgR,.132},H}; -N l23n211[]={{sedg,2.519},{smhl,.198},{sXxg,.165},H}; -N l23n212[]={{sXqlg,.439},{sgXm,.231},H}; -N l23n213[]={{swl,.088},H}; -N l23n215[]={{smg,.351},H}; -N l23n216[]={{sks,.234},H}; -N l23n217[]={{sgm,.703},{shed,.073},H}; -N l23n218[]={{sgYl,1.251},{sgwi,.395},H}; -N l23n219[]={{sghi,.395},{sXhl,.154},H}; -N l23n220[]={{sgksg,.615},{sgYiX,.351},{sRmp,.296},H}; -N l23n221[]={{sxXg,.329},H}; -N l23n223[]={{sXg,2.656},H}; -N l23n224[]={{slym,.154},H}; -N l23n225[]={{sZlx,.154},{sgXkX,.263},H}; -N l23n226[]={{svxg,.231},{slXmv,.176},H}; -N l23n227[]={{smp,.483},{smxl,.395},H}; -N l23n229[]={{sZl,1.127},H}; -N l23n230[]={{sgwe9g,1.054},{swm,.117},H}; -N l23n232[]={{syed,.088},H}; -N l23n234[]={{skX,.263},H}; -N l23n235[]={{sgZl,.922},{sXp,.337},{sXxl,.132},H}; -N l23n236[]={{sXmxl,.322},{sxiX,.198},{sZly,.198},H}; -N l23n237[]={{siXZ,.307},{sXZlX,.293},{sRrg,.667},H}; -N l23n238[]={{svg,1.559},{smkg,.198},H}; -N l23n239[]={{slXv,.198},H}; -N l23n241[]={{sgXZy,.220},H}; -N l23n242[]={{siXvg,.263},{sRmr,.247},H}; -N l23n243[]={{ssY,.088},{sYiXk,.146},H}; -N l23n244[]={{sxl,.659},{smq,.132},{sgf3w,.165},H}; -N l23n245[]={{sYled,.329},{srw,.088},H}; -N l23n246[]={{sXkg,.626},{sXkyw,.527},{spsm,.110},H}; -N l23n247[]={{sls,.176},H}; -N l23n248[]={{sqy,.117},{swxi,.154},H}; -N l23n250[]={{sisg,.165},{svxl,.110},H}; -N l23n252[]={{sXq,.351},{sghl,.329},{shiX,.154},H}; -N l23n253[]={{sxR,.220},{sgwiX,.263},H}; -N l23n254[]={{sXmvg,.439},{sXrw,.110},H}; - -D l23_d = -{ +S sYl[] = { 98, h, 0 }; +S sgYl[] = { 32, 98, h, 0 }; +S sgXrg[] = { 32, 97, n, a }; +S sgXk[] = { 32, 97, g, 0 }; +S sql[] = { m, h, 0 }; +S sXZlg[] = { 97, 99, h, a }; +S swe9g[] = { s, 233, a }; +S sRm[] = { 225, i, 0 }; +S sgwe9g[] = { 32, s, 233, a }; +S siXr[] = { e, 97, n, 0 }; +S se9X[] = { 233, 97, 0 }; +S slXm[] = { h, 97, i, 0 }; +S sXkyw[] = { 97, g, u, s, 0 }; +S sgXvg[] = { 32, 97, r, a }; +S skyw[] = { g, u, s, 0 }; +S sgXky[] = { 32, 97, g, u, 0 }; +S skywg[] = { g, u, s, a }; +S sXky[] = { 97, g, u, 0 }; +S sgXZ[] = { 32, 97, 99, 0 }; +S shlg[] = { d, h, a }; +S sled[] = { h, 237, 0 }; +S se9m[] = { 233, i, 0 }; +S sYled[] = { 98, h, 237, 0 }; +S sgYled[] = { 32, 98, h, 237, 0 }; +S sxRg[] = { t, 225, a }; +S skl[] = { g, h, 0 }; +S sgred[] = { 32, n, 237, 0 }; +S siXv[] = { e, 97, r, 0 }; +S sXql[] = { 97, m, h, 0 }; +S smkl[] = { i, g, h, 0 }; +S siXZ[] = { e, 97, 99, 0 }; +S sgXkg[] = { 32, 97, g, a }; +S sYledg[] = { 98, h, 237, a }; +S sledg[] = { h, 237, a }; +S siXZl[] = { e, 97, 99, h, 0 }; +S sgksg[] = { 32, g, o, a }; +S sjl[] = { f, h, 0 }; +S sqlg[] = { m, h, a }; +S sliX[] = { h, e, 97, 0 }; +S sved[] = { r, 237, 0 }; +S sis[] = { e, o, 0 }; +S seds[] = { 237, o, 0 }; +S sgjl[] = { 32, f, h, 0 }; +S slRm[] = { h, 225, i, 0 }; +S sgxRg[] = { 32, t, 225, a }; +S sxlg[] = { t, h, a }; +S sgxR[] = { 32, t, 225, 0 }; +S sXmk[] = { 97, i, g, 0 }; +S sXmh[] = { 97, i, d, 0 }; +S sZlX[] = { 99, h, 97, 0 }; +S smxlg[] = { i, t, h, a }; +S sXmxl[] = { 97, i, t, h, 0 }; +S sgXZl[] = { 32, 97, 99, h, 0 }; +S sXqlg[] = { 97, m, h, a }; +S slj[] = { h, f, 0 }; +S sklg[] = { g, h, a }; +S sXZlX[] = { 97, 99, h, 97, 0 }; +S sXmkl[] = { 97, i, g, h, 0 }; +S smklg[] = { i, g, h, a }; +S sXmvg[] = { 97, i, r, a }; +S sle9[] = { h, 233, 0 }; +S sYiX[] = { 98, e, 97, 0 }; +S smhlg[] = { i, d, h, a }; +S swiX[] = { s, e, 97, 0 }; +S siXk[] = { e, 97, g, 0 }; +S sgql[] = { 32, m, h, 0 }; +S sgYlj[] = { 32, 98, h, f, 0 }; +S sxiX[] = { t, e, 97, 0 }; +S siXrg[] = { e, 97, n, a }; +S smpi[] = { i, l, e, 0 }; +S sXkX[] = { 97, g, 97, 0 }; +S smhg[] = { i, d, a }; +S sZly[] = { 99, h, u, 0 }; +S sYlj[] = { 98, h, f, 0 }; +S symp[] = { u, i, l, 0 }; +S smhl[] = { i, d, h, 0 }; +S sgZly[] = { 32, 99, h, u, 0 }; +S sfam[] = { 250, i, 0 }; +S smpig[] = { i, l, e, a }; +S sgYiX[] = { 32, 98, e, 97, 0 }; +S se9Xr[] = { 233, 97, n, 0 }; +S sqlX[] = { m, h, 97, 0 }; +S sXmp[] = { 97, i, l, 0 }; +S sqe9g[] = { m, 233, a }; +S sYli[] = { 98, h, e, 0 }; +S sliXr[] = { h, e, 97, n, 0 }; +S sf3w[] = { 243, s, 0 }; +S sgwed[] = { 32, s, 237, 0 }; +S sgqe9g[] = { 32, m, 233, a }; +S sgredg[] = { 32, n, 237, a }; +S sXhl[] = { 97, d, h, 0 }; +S sjXm[] = { f, 97, i, 0 }; +S swedg[] = { s, 237, a }; +S shiX[] = { d, e, 97, 0 }; +S sgYli[] = { 32, 98, h, e, 0 }; +S sgwedg[] = { 32, s, 237, a }; +S sXhlg[] = { 97, d, h, a }; +S shim[] = { d, e, i, 0 }; +S sghim[] = { 32, d, e, i, 0 }; +S spim[] = { l, e, i, 0 }; +S sgpim[] = { 32, l, e, i, 0 }; +S shimv[] = { d, e, i, r, 0 }; +S swiXr[] = { s, e, 97, n, 0 }; +S slym[] = { h, u, i, 0 }; +S sgXq[] = { 32, 97, m, 0 }; +S slf3[] = { h, 243, 0 }; +S sRmh[] = { 225, i, d, 0 }; +S swis[] = { s, e, o, 0 }; +S siXrr[] = { e, 97, n, n, 0 }; +S slyX[] = { h, u, 97, 0 }; +S sgmrX[] = { 32, i, n, 97, 0 }; +S sgXkX[] = { 32, 97, g, 97, 0 }; +S symh[] = { u, i, d, 0 }; +S ssmw[] = { o, i, s, 0 }; +S slXmv[] = { h, 97, i, r, 0 }; +S sgZls[] = { 32, 99, h, o, 0 }; +S simw[] = { e, i, s, 0 }; +S srXZ[] = { n, 97, 99, 0 }; +S sRmp[] = { 225, i, l, 0 }; +S sXed[] = { 97, 237, 0 }; +S sZlXg[] = { 99, h, 97, a }; +S syXm[] = { u, 97, i, 0 }; +S syed[] = { u, 237, 0 }; +S smZg[] = { i, 99, a }; +S stl[] = { p, h, 0 }; +S sYliX[] = { 98, h, e, 97, 0 }; +S sf3wx[] = { 243, s, t, 0 }; +S ssZl[] = { o, 99, h, 0 }; +S sXmhl[] = { 97, i, d, h, 0 }; +S smrX[] = { i, n, 97, 0 }; +S se9Xp[] = { 233, 97, l, 0 }; +S sxlXm[] = { t, h, 97, i, 0 }; +S smrXg[] = { i, n, 97, a }; +S symhg[] = { u, i, d, a }; +S siXvg[] = { e, 97, r, a }; +S sXvvX[] = { 97, r, r, 97, 0 }; +S sgpR[] = { 32, l, 225, 0 }; +S sXxl[] = { 97, t, h, 0 }; +S sZe9[] = { 99, 233, 0 }; +S syedg[] = { u, 237, a }; +S sxiXZ[] = { t, e, 97, 99, 0 }; +S svvX[] = { r, r, 97, 0 }; +S srXZl[] = { n, 97, 99, h, 0 }; +S sxfa[] = { t, 250, 0 }; +S sympg[] = { u, i, l, a }; +S sgwiX[] = { 32, s, e, 97, 0 }; +S spimw[] = { l, e, i, s, 0 }; +S sisg[] = { e, o, a }; +S sghfa[] = { 32, d, 250, 0 }; +S sYlg[] = { 98, h, a }; +S sgf3w[] = { 32, 243, s, 0 }; +S sle9X[] = { h, 233, 97, 0 }; +S sedrg[] = { 237, n, a }; +S swisg[] = { s, e, o, a }; +S skXm[] = { g, 97, i, 0 }; +S shed[] = { d, 237, 0 }; +S sjym[] = { f, u, i, 0 }; +S sgXZy[] = { 32, 97, 99, u, 0 }; +S sveds[] = { r, 237, o, 0 }; +S sgtl[] = { 32, p, h, 0 }; +S sZyg[] = { 99, u, a }; +S sRmr[] = { 225, i, n, 0 }; +S sxlXv[] = { t, h, 97, r, 0 }; +S sljy[] = { h, f, u, 0 }; +S sYiXk[] = { 98, e, 97, g, 0 }; +S svxl[] = { r, t, h, 0 }; +S spsm[] = { l, o, i, 0 }; +S sgpRg[] = { 32, l, 225, a }; +S se9Xpg[] = { 233, 97, l, a }; +S sge9g[] = { 32, 233, a }; + +N l23n0[] = { { srrg, .626 }, { sgXq, .231 }, H }; +N l23n1[] = { { stX, .102 }, H }; +N l23n3[] = { { ssv, .161 }, { sgf3, .241 }, H }; +N l23n4[] = { { shl, .381 }, { sXmh, .241 }, { ssZ, .117 }, { srXZ, .132 }, H }; +N l23n5[] = { { smr, .820 }, { sxm, .190 }, { spR, .132 }, H }; +N l23n6[] = { { smkl, .307 }, { srx, .132 }, { sgwm, .231 }, H }; +N l23n7[] = { { sri, .132 }, { sghm, .198 }, H }; +N l23n9[] = { { slX, .644 }, { sgYli, .307 }, H }; +N l23n10[] = { { swedg, .231 }, H }; +N l23n11[] = { { sgXr, 1.482 }, H }; +N l23n12[] = { { sgp, .856 }, { slRm, .263 }, { sgYlj, .395 }, { sgxl, .263 }, { sqe9g, .263 }, { sf3wx, .296 }, H }; +N l23n13[] = { { sXr, 1.273 }, { swg, 1.317 }, { spm, .132 }, H }; +N l23n15[] = { { sred, .220 }, { sji, .088 }, H }; +N l23n16[] = { { sZlX, .241 }, { sf3w, .263 }, H }; +N l23n17[] = { { sle9, .146 }, H }; +N l23n18[] = { { seds, .428 }, { sgwedg, .307 }, H }; +N l23n20[] = { { ssw, .088 }, H }; +N l23n21[] = { { shm, .117 }, { sxiXZ, .176 }, H }; +N l23n22[] = { { sms, .132 }, { sghim, .307 }, H }; +N l23n23[] = { { sgxm, .263 }, { swiXr, .205 }, { sgpRg, .220 }, H }; +N l23n25[] = { { siXk, .198 }, H }; +N l23n26[] = { { simv, .154 }, H }; +N l23n27[] = { { sql, .439 }, H }; +N l23n29[] = { { sgq, 1.142 }, { sgXky, .790 }, { sZg, .285 }, { sYli, .176 }, H }; +N l23n30[] = { { sgXkg, .615 }, { sgjl, .395 }, { sXs, .073 }, H }; +N l23n31[] = { { sxlX, .351 }, { syXm, .132 }, { sjy, .073 }, H }; +N l23n32[] = { { sgqe9, .263 }, H }; +N l23n33[] = { { sxig, .231 }, H }; +N l23n34[] = { { sZyg, .165 }, H }; +N l23n35[] = { { srXg, .494 }, H }; +N l23n36[] = { { sym, .322 }, { sgqy, .231 }, H }; +N l23n37[] = { { siXZl, .410 }, { sXmk, .241 }, { simw, .132 }, H }; +N l23n38[] = { { sYlg, .165 }, H }; +N l23n39[] = { { sXrrg, .571 }, H }; +N l23n40[] = { { smX, .220 }, { sYlj, .198 }, { sympg, .263 }, H }; +N l23n41[] = { { spig, .461 }, { srk, .176 }, H }; +N l23n42[] = { { sXZlg, 1.142 }, { slv, .117 }, H }; +N l23n44[] = { { sxg, .615 }, H }; +N l23n45[] = { { svs, .073 }, H }; +N l23n46[] = { { sgr, .659 }, { sywg, .593 }, H }; +N l23n47[] = { { skyw, .395 }, H }; +N l23n48[] = { { se9m, .494 }, { smrX, .132 }, { simx, .110 }, H }; +N l23n51[] = { { smhlg, .395 }, H }; +N l23n52[] = { { spg, .812 }, { sim, .351 }, H }; +N l23n55[] = { { sgXv, .823 }, { sXvv, .132 }, H }; +N l23n56[] = { { sRm, .790 }, { sksg, .494 }, { sXrX, .154 }, { sgZls, .263 }, H }; +N l23n57[] = { { sgmg, .198 }, H }; +N l23n58[] = { { smpi, .198 }, H }; +N l23n59[] = { { sXhlg, .307 }, H }; +N l23n60[] = { { shg, .461 }, { sXmhl, .176 }, { srXZl, .176 }, { sle9X, .110 }, { sZli, .110 }, H }; +N l23n61[] = { { sYs, .073 }, H }; +N l23n62[] = { { sky, .307 }, H }; +N l23n63[] = { { svX, .337 }, { sgxR, .395 }, { sgs, .198 }, { sfam, .263 }, H }; +N l23n64[] = { { spp, .117 }, { sYliX, .176 }, H }; +N l23n65[] = { { sZlxg, .263 }, H }; +N l23n66[] = { { sjl, .190 }, { sghfa, .165 }, { sgXw, .165 }, H }; +N l23n67[] = { { smpg, .494 }, { smxlg, .483 }, H }; +N l23n69[] = { { sZlg, .889 }, H }; +N l23n70[] = { { sqlX, .176 }, H }; +N l23n72[] = { { sgqX, .329 }, { sgYv, .198 }, { syedg, .198 }, H }; +N l23n73[] = { { smv, .644 }, H }; +N l23n74[] = { { sgZly, .395 }, { smZ, .117 }, H }; +N l23n75[] = { { sXpg, .329 }, { syg, .110 }, H }; +N l23n76[] = { { slx, .132 }, { spim, .154 }, { se9Xp, .296 }, H }; +N l23n77[] = { { sli, .337 }, { sXvx, .220 }, { sgXx, .198 }, H }; +N l23n78[] = { { sjXm, .154 }, H }; +N l23n79[] = { { sYX, .102 }, H }; +N l23n80[] = { { sgt, .461 }, { sveds, .110 }, H }; +N l23n81[] = { { sgX, 4.347 }, { sXv, .864 }, H }; +N l23n82[] = { { sXZ, .717 }, H }; +N l23n83[] = { { sqg, .285 }, H }; +N l23n84[] = { { sxlg, .395 }, { shim, .154 }, { srkX, .110 }, H }; +N l23n85[] = { { sled, .220 }, { sYledg, .615 }, H }; +N l23n86[] = { { smwx, .176 }, H }; +N l23n87[] = { { se9g, 1.877 }, H }; +N l23n89[] = { { sge9, .263 }, { sgrX, .263 }, H }; +N l23n90[] = { { smw, .483 }, { sxlXm, .176 }, { sXvvX, .176 }, H }; +N l23n91[] = { { sig, .812 }, { smh, .468 }, { ssmw, .132 }, H }; +N l23n92[] = { { sXmp, .176 }, H }; +N l23n93[] = { { sly, .278 }, { sxRg, .494 }, { sgred, .494 }, { sXmkl, .293 }, H }; +N l23n94[] = { { swX, .263 }, { slj, .146 }, H }; +N l23n95[] = { { sRg, 1.284 }, H }; +N l23n96[] = { { svv, .088 }, H }; +N l23n97[] = { { skl, .220 }, { sedrg, .370 }, H }; +N l23n98[] = { { sgY, 1.427 }, { sXw, .293 }, { se9Xr, .395 }, H }; +N l23n99[] = { { sgpi, .790 }, { sXh, .220 }, { ssvg, .165 }, H }; +N l23n100[] = { { shlg, .527 }, H }; +N l23n101[] = { { smrg, .593 }, { sljy, .110 }, H }; +N l23n102[] = { { swe9, .366 }, { siXr, .483 }, { smklg, .439 }, { sfag, .346 }, H }; +N l23n103[] = { { swis, .154 }, H }; +N l23n105[] = { { slXg, .362 }, H }; +N l23n106[] = { { ssm, .278 }, H }; +N l23n107[] = { { sgXrg, 1.668 }, { smx, .381 }, H }; +N l23n109[] = { { sXrg, 1.778 }, { skXm, .110 }, H }; +N l23n110[] = { { sZX, .146 }, H }; +N l23n111[] = { { sredg, .231 }, H }; +N l23n112[] = { { symh, .132 }, { sYv, .088 }, { sZlXg, .263 }, H }; +N l23n114[] = { { srg, 2.569 }, { sgv, .241 }, { sXmr, .220 }, { smrk, .154 }, H }; +N l23n115[] = { { sgZ, 1.251 }, { sXx, .220 }, { sps, .073 }, H }; +N l23n116[] = { { sXql, .307 }, H }; +N l23n117[] = { { sxlXv, .146 }, H }; +N l23n118[] = { { sZe9, .088 }, H }; +N l23n120[] = { { sliX, .285 }, { stl, .088 }, H }; +N l23n122[] = { { simvg, .307 }, H }; +N l23n123[] = { { sqlg, .428 }, H }; +N l23n124[] = { { sgks, .494 }, { sXed, .088 }, { ssZl, .132 }, H }; +N l23n125[] = { { sxX, .322 }, H }; +N l23n127[] = { { sxlXg, .220 }, H }; +N l23n128[] = { { swZ, .161 }, { sgqe9g, .351 }, H }; +N l23n130[] = { { svx, .234 }, H }; +N l23n131[] = { { sgw, 1.712 }, { svi, .205 }, H }; +N l23n132[] = { { sgh, 1.120 }, { sRmh, .346 }, H }; +N l23n133[] = { { spX, .205 }, { smwxi, .205 }, H }; +N l23n134[] = { { sgwe9, .823 }, H }; +N l23n136[] = { { slyX, .154 }, H }; +N l23n137[] = { { slR, .234 }, { sir, .102 }, { srkg, .165 }, H }; +N l23n139[] = { { sved, .190 }, { svvX, .132 }, H }; +N l23n140[] = { { slXm, .417 }, H }; +N l23n141[] = { { sRr, .362 }, { shX, .088 }, H }; +N l23n142[] = { { smk, .307 }, H }; +N l23n143[] = { { skywg, .790 }, H }; +N l23n144[] = { { smrXg, .263 }, H }; +N l23n145[] = { { ssg, .571 }, { slm, .176 }, H }; +N l23n146[] = { { sgXZ, .527 }, { siXv, .307 }, { sqs, .088 }, H }; +N l23n147[] = { { sYi, .146 }, { sgmr, .329 }, H }; +N l23n148[] = { { sgx, 1.273 }, H }; +N l23n149[] = { { sgql, .296 }, { sgi, .110 }, H }; +N l23n150[] = { { sXk, .703 }, H }; +N l23n151[] = { { sgXvg, .790 }, H }; +N l23n153[] = { { skg, .768 }, H }; +N l23n154[] = { { sis, .190 }, { smpig, .351 }, H }; +N l23n156[] = { { syX, .249 }, H }; +N l23n157[] = { { sXky, .395 }, { ssp, .102 }, H }; +N l23n158[] = { { sXmv, .263 }, { sgpim, .307 }, { sxv, .088 }, H }; +N l23n159[] = { { sgxRg, .527 }, { svXg, .263 }, H }; +N l23n160[] = { { srr, .410 }, H }; +N l23n161[] = { { swx, .263 }, { sgYled, .659 }, H }; +N l23n162[] = { { swi, .293 }, { sjym, .110 }, H }; +N l23n164[] = { { sqX, .220 }, H }; +N l23n165[] = { { spimw, .146 }, H }; +N l23n166[] = { { sgj, .768 }, { sxfa, .088 }, H }; +N l23n168[] = { { se9X, .692 }, H }; +N l23n169[] = { { smvg, .856 }, H }; +N l23n170[] = { { swed, .117 }, { shimv, .205 }, { smZg, .198 }, { sZls, .132 }, H }; +N l23n172[] = { { siX, 1.098 }, { sqe9, .117 }, { slxg, .198 }, { se9Xpg, .494 }, H }; +N l23n174[] = { { ssq, .146 }, { sviX, .198 }, { sgwX, .231 }, { shv, .088 }, H }; +N l23n176[] = { { siXrr, .205 }, H }; +N l23n177[] = { { sgXg, 1.581 }, { sXvg, 1.054 }, H }; +N l23n178[] = { { sgwed, .263 }, { sZi, .088 }, H }; +N l23n180[] = { { sXmx, .307 }, H }; +N l23n181[] = { { sledg, .461 }, H }; +N l23n182[] = { { sgmrX, .263 }, H }; +N l23n183[] = { { sgk, .637 }, { sgpR, .198 }, H }; +N l23n184[] = { { slg, 1.822 }, { sXm, 1.142 }, H }; +N l23n185[] = { { sgYi, .263 }, { sge9g, .165 }, H }; +N l23n186[] = { { smwg, .560 }, H }; +N l23n187[] = { { smhg, .296 }, { slf3, .102 }, H }; +N l23n189[] = { { sgredg, .307 }, H }; +N l23n190[] = { { sgXk, 1.251 }, { swXg, .329 }, { sYiX, .198 }, H }; +N l23n191[] = { { smrr, .263 }, { sgxX, .329 }, { ssr, .117 }, H }; +N l23n193[] = { { sxi, .293 }, { sklg, .329 }, { sXkX, .198 }, H }; +N l23n194[] = { { sXwg, .395 }, { svXm, .241 }, { sZy, .132 }, { sliXr, .234 }, H }; +N l23n195[] = { { srX, .468 }, { sgpig, .263 }, H }; +N l23n196[] = { { sgwZ, .231 }, H }; +N l23n198[] = { { sYl, .732 }, { swe9g, .790 }, { siXrg, .395 }, H }; +N l23n199[] = { { sXrr, .329 }, { svm, .117 }, { swisg, .220 }, H }; +N l23n200[] = { { symp, .198 }, { spx, .102 }, { sgtl, .165 }, H }; +N l23n201[] = { { spi, .498 }, H }; +N l23n202[] = { { sXZl, .900 }, { sgXZl, .483 }, { sgmw, .296 }, H }; +N l23n203[] = { { sjX, .205 }, { smxg, .198 }, H }; +N l23n205[] = { { swiX, .198 }, H }; +N l23n206[] = { { syw, .307 }, H }; +N l23n208[] = { { symhg, .263 }, H }; +N l23n209[] = { { shi, .278 }, { sgjX, .263 }, { sgR, .132 }, H }; +N l23n211[] = { { sedg, 2.519 }, { smhl, .198 }, { sXxg, .165 }, H }; +N l23n212[] = { { sXqlg, .439 }, { sgXm, .231 }, H }; +N l23n213[] = { { swl, .088 }, H }; +N l23n215[] = { { smg, .351 }, H }; +N l23n216[] = { { sks, .234 }, H }; +N l23n217[] = { { sgm, .703 }, { shed, .073 }, H }; +N l23n218[] = { { sgYl, 1.251 }, { sgwi, .395 }, H }; +N l23n219[] = { { sghi, .395 }, { sXhl, .154 }, H }; +N l23n220[] = { { sgksg, .615 }, { sgYiX, .351 }, { sRmp, .296 }, H }; +N l23n221[] = { { sxXg, .329 }, H }; +N l23n223[] = { { sXg, 2.656 }, H }; +N l23n224[] = { { slym, .154 }, H }; +N l23n225[] = { { sZlx, .154 }, { sgXkX, .263 }, H }; +N l23n226[] = { { svxg, .231 }, { slXmv, .176 }, H }; +N l23n227[] = { { smp, .483 }, { smxl, .395 }, H }; +N l23n229[] = { { sZl, 1.127 }, H }; +N l23n230[] = { { sgwe9g, 1.054 }, { swm, .117 }, H }; +N l23n232[] = { { syed, .088 }, H }; +N l23n234[] = { { skX, .263 }, H }; +N l23n235[] = { { sgZl, .922 }, { sXp, .337 }, { sXxl, .132 }, H }; +N l23n236[] = { { sXmxl, .322 }, { sxiX, .198 }, { sZly, .198 }, H }; +N l23n237[] = { { siXZ, .307 }, { sXZlX, .293 }, { sRrg, .667 }, H }; +N l23n238[] = { { svg, 1.559 }, { smkg, .198 }, H }; +N l23n239[] = { { slXv, .198 }, H }; +N l23n241[] = { { sgXZy, .220 }, H }; +N l23n242[] = { { siXvg, .263 }, { sRmr, .247 }, H }; +N l23n243[] = { { ssY, .088 }, { sYiXk, .146 }, H }; +N l23n244[] = { { sxl, .659 }, { smq, .132 }, { sgf3w, .165 }, H }; +N l23n245[] = { { sYled, .329 }, { srw, .088 }, H }; +N l23n246[] = { { sXkg, .626 }, { sXkyw, .527 }, { spsm, .110 }, H }; +N l23n247[] = { { sls, .176 }, H }; +N l23n248[] = { { sqy, .117 }, { swxi, .154 }, H }; +N l23n250[] = { { sisg, .165 }, { svxl, .110 }, H }; +N l23n252[] = { { sXq, .351 }, { sghl, .329 }, { shiX, .154 }, H }; +N l23n253[] = { { sxR, .220 }, { sgwiX, .263 }, H }; +N l23n254[] = { { sXmvg, .439 }, { sXrw, .110 }, H }; + +D l23_d = { "irish", "iso-8859-1", - { - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,0.004,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,0.001,0.002,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,0.326,0.051,0.085,0.066,0.100,0.034,0.071,0.160,0.181,0.001,W,0.083,0.059,0.145,0.069, - 0.019,W,0.111,0.109,0.100,0.050,W,0.001,W,0.004,W,W,W,W,W,W, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - Y,V,V,V,V,V,V,V,V,0.004,V,V,V,0.003,V,V, - V,V,V,0.001,V,V,V,V,V,V,0.001,V,V,V,V,V, - V,0.096,V,V,V,V,V,V,V,0.100,V,V,V,0.104,V,V, - V,V,V,0.040,V,V,V,V,V,V,0.030,V,V,V,V,V - }, - { - l23n0,l23n1,X,l23n3,l23n4,l23n5,l23n6,l23n7,X,l23n9,l23n10,l23n11,l23n12,l23n13,X,l23n15, - l23n16,l23n17,l23n18,X,l23n20,l23n21,l23n22,l23n23,X,l23n25,l23n26,l23n27,X,l23n29,l23n30,l23n31, - l23n32,l23n33,l23n34,l23n35,l23n36,l23n37,l23n38,l23n39,l23n40,l23n41,l23n42,X,l23n44,l23n45,l23n46,l23n47, - l23n48,X,X,l23n51,l23n52,X,X,l23n55,l23n56,l23n57,l23n58,l23n59,l23n60,l23n61,l23n62,l23n63, - l23n64,l23n65,l23n66,l23n67,X,l23n69,l23n70,X,l23n72,l23n73,l23n74,l23n75,l23n76,l23n77,l23n78,l23n79, - l23n80,l23n81,l23n82,l23n83,l23n84,l23n85,l23n86,l23n87,X,l23n89,l23n90,l23n91,l23n92,l23n93,l23n94,l23n95, - l23n96,l23n97,l23n98,l23n99,l23n100,l23n101,l23n102,l23n103,X,l23n105,l23n106,l23n107,X,l23n109,l23n110,l23n111, - l23n112,X,l23n114,l23n115,l23n116,l23n117,l23n118,X,l23n120,X,l23n122,l23n123,l23n124,l23n125,X,l23n127, - l23n128,X,l23n130,l23n131,l23n132,l23n133,l23n134,X,l23n136,l23n137,X,l23n139,l23n140,l23n141,l23n142,l23n143, - l23n144,l23n145,l23n146,l23n147,l23n148,l23n149,l23n150,l23n151,X,l23n153,l23n154,X,l23n156,l23n157,l23n158,l23n159, - l23n160,l23n161,l23n162,X,l23n164,l23n165,l23n166,X,l23n168,l23n169,l23n170,X,l23n172,X,l23n174,X, - l23n176,l23n177,l23n178,X,l23n180,l23n181,l23n182,l23n183,l23n184,l23n185,l23n186,l23n187,X,l23n189,l23n190,l23n191, - X,l23n193,l23n194,l23n195,l23n196,X,l23n198,l23n199,l23n200,l23n201,l23n202,l23n203,X,l23n205,l23n206,X, - l23n208,l23n209,X,l23n211,l23n212,l23n213,X,l23n215,l23n216,l23n217,l23n218,l23n219,l23n220,l23n221,X,l23n223, - l23n224,l23n225,l23n226,l23n227,X,l23n229,l23n230,X,l23n232,X,l23n234,l23n235,l23n236,l23n237,l23n238,l23n239, - X,l23n241,l23n242,l23n243,l23n244,l23n245,l23n246,l23n247,l23n248,X,l23n250,X,l23n252,l23n253,l23n254,X - } + { W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, 0.004, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, 0.001, 0.002, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, 0.326, 0.051, 0.085, 0.066, 0.100, 0.034, 0.071, 0.160, 0.181, 0.001, W, 0.083, 0.059, 0.145, 0.069, + 0.019, W, 0.111, 0.109, 0.100, 0.050, W, 0.001, W, 0.004, W, W, W, W, W, W, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + Y, V, V, V, V, V, V, V, V, 0.004, V, V, V, 0.003, V, V, + V, V, V, 0.001, V, V, V, V, V, V, 0.001, V, V, V, V, V, + V, 0.096, V, V, V, V, V, V, V, 0.100, V, V, V, 0.104, V, V, + V, V, V, 0.040, V, V, V, V, V, V, 0.030, V, V, V, V, V }, + { l23n0, l23n1, X, l23n3, l23n4, l23n5, l23n6, l23n7, X, l23n9, l23n10, l23n11, l23n12, l23n13, X, l23n15, + l23n16, l23n17, l23n18, X, l23n20, l23n21, l23n22, l23n23, X, l23n25, l23n26, l23n27, X, l23n29, l23n30, l23n31, + l23n32, l23n33, l23n34, l23n35, l23n36, l23n37, l23n38, l23n39, l23n40, l23n41, l23n42, X, l23n44, l23n45, l23n46, l23n47, + l23n48, X, X, l23n51, l23n52, X, X, l23n55, l23n56, l23n57, l23n58, l23n59, l23n60, l23n61, l23n62, l23n63, + l23n64, l23n65, l23n66, l23n67, X, l23n69, l23n70, X, l23n72, l23n73, l23n74, l23n75, l23n76, l23n77, l23n78, l23n79, + l23n80, l23n81, l23n82, l23n83, l23n84, l23n85, l23n86, l23n87, X, l23n89, l23n90, l23n91, l23n92, l23n93, l23n94, l23n95, + l23n96, l23n97, l23n98, l23n99, l23n100, l23n101, l23n102, l23n103, X, l23n105, l23n106, l23n107, X, l23n109, l23n110, l23n111, + l23n112, X, l23n114, l23n115, l23n116, l23n117, l23n118, X, l23n120, X, l23n122, l23n123, l23n124, l23n125, X, l23n127, + l23n128, X, l23n130, l23n131, l23n132, l23n133, l23n134, X, l23n136, l23n137, X, l23n139, l23n140, l23n141, l23n142, l23n143, + l23n144, l23n145, l23n146, l23n147, l23n148, l23n149, l23n150, l23n151, X, l23n153, l23n154, X, l23n156, l23n157, l23n158, l23n159, + l23n160, l23n161, l23n162, X, l23n164, l23n165, l23n166, X, l23n168, l23n169, l23n170, X, l23n172, X, l23n174, X, + l23n176, l23n177, l23n178, X, l23n180, l23n181, l23n182, l23n183, l23n184, l23n185, l23n186, l23n187, X, l23n189, l23n190, l23n191, + X, l23n193, l23n194, l23n195, l23n196, X, l23n198, l23n199, l23n200, l23n201, l23n202, l23n203, X, l23n205, l23n206, X, + l23n208, l23n209, X, l23n211, l23n212, l23n213, X, l23n215, l23n216, l23n217, l23n218, l23n219, l23n220, l23n221, X, l23n223, + l23n224, l23n225, l23n226, l23n227, X, l23n229, l23n230, X, l23n232, X, l23n234, l23n235, l23n236, l23n237, l23n238, l23n239, + X, l23n241, l23n242, l23n243, l23n244, l23n245, l23n246, l23n247, l23n248, X, l23n250, X, l23n252, l23n253, l23n254, X } }; - - // // Lng: italian // Enc: iso-8859-15 // - -S sZZ[]={99,99,0}; -S skpm[]={g,l,i,0}; -S sgZli[]={32,99,h,e,0}; -S sghmg[]={32,d,i,a}; -S shmg[]={d,i,a}; -S sZlm[]={99,h,i,0}; -S sxxs[]={t,t,o,0}; -S sizX[]={e,v,97,0}; -S sXzXg[]={97,v,97,a}; -S sivXg[]={e,r,97,a}; -S stivg[]={p,e,r,a}; -S sXrsg[]={97,n,o,a}; -S sXvig[]={97,r,e,a}; -S skpmg[]={g,l,i,a}; -S sguyX[]={32,q,u,97,0}; -S sgrsr[]={32,n,o,n,0}; -S srsr[]={n,o,n,0}; -S sgwmg[]={32,s,i,a}; -S suyX[]={q,u,97,0}; -S sxxsg[]={t,t,o,a}; -S sizXg[]={e,v,97,a}; -S sZsp[]={99,o,l,0}; -S sgkpm[]={32,g,l,i,0}; -S srsrg[]={n,o,n,a}; -S ssqi[]={o,m,e,0}; -S sgZXw[]={32,99,97,s,0}; -S sZXw[]={99,97,s,0}; -S sgZsp[]={32,99,o,l,0}; -S sZZl[]={99,99,h,0}; -S sXZZ[]={97,99,99,0}; -S shh[]={d,d,0}; -S sgvm[]={32,r,i,0}; -S sgXpp[]={32,97,l,l,0}; -S sXwXg[]={97,s,97,a}; -S sZZlm[]={99,99,h,i,0}; -S sXwX[]={97,s,97,0}; -S sZXwX[]={99,97,s,97,0}; -S sXxs[]={97,t,o,0}; -S shipp[]={d,e,l,l,0}; -S ssqig[]={o,m,e,a}; -S srhsg[]={n,d,o,a}; -S syvm[]={u,r,i,0}; -S sZsqi[]={99,o,m,e,0}; -S sjXv[]={f,97,r,0}; -S sXrhs[]={97,n,d,o,0}; -S svmh[]={r,i,d,0}; -S sXxsg[]={97,t,o,a}; -S sXpig[]={97,l,e,a}; -S swwig[]={s,s,e,a}; -S ssvX[]={o,r,97,0}; -S sgtm[]={32,p,i,0}; -S szXrs[]={v,97,n,o,0}; -S syip[]={u,e,l,0}; -S ssZZ[]={o,99,99,0}; -S smhh[]={i,d,d,0}; -S ssmg[]={o,i,a}; -S svmhh[]={r,i,d,d,0}; -S sZZs[]={99,99,o,0}; -S sr7a[]={n,z,0}; -S sgXzi[]={32,97,v,e,0}; -S sgps[]={32,l,o,0}; -S sZsg[]={99,o,a}; -S sZlmg[]={99,h,i,a}; -S swsg[]={s,o,a}; -S s7amX[]={z,i,97,0}; -S sgjXv[]={32,f,97,r,0}; -S sskp[]={o,g,l,0}; -S spps[]={l,l,o,0}; -S suyip[]={q,u,e,l,0}; -S sspX[]={o,l,97,0}; -S sskpm[]={o,g,l,i,0}; -S shXz[]={d,97,v,0}; -S sZspp[]={99,o,l,l,0}; -S srxs[]={n,t,o,0}; -S sqtX[]={m,p,97,0}; -S shXzX[]={d,97,v,97,0}; -S sgxyv[]={32,t,u,r,0}; -S sxyvm[]={t,u,r,i,0}; -S sXppX[]={97,l,l,97,0}; -S sle9g[]={h,233,a}; -S smhhy[]={i,d,d,u,0}; -S sZle9g[]={99,h,233,a}; -S szizX[]={v,e,v,97,0}; -S syvmh[]={u,r,i,d,0}; -S swXr[]={s,97,n,0}; -S sgtmfa[]={32,p,i,250,0}; -S smrs[]={i,n,o,0}; -S sgwXr[]={32,s,97,n,0}; -S shhy[]={d,d,u,0}; -S stmfa[]={p,i,250,0}; -S sZZm[]={99,99,i,0}; -S sghmw[]={32,d,i,s,0}; -S stmfag[]={p,i,250,a}; -S syXrh[]={u,97,n,d,0}; -S svvi[]={r,r,e,0}; -S sXziz[]={97,v,e,v,0}; -S svmz[]={r,i,v,0}; -S sziz[]={v,e,v,0}; -S sXxx[]={97,t,t,0}; -S shhyg[]={d,d,u,a}; -S syXr[]={u,97,n,0}; -S suyXr[]={q,u,97,n,0}; -S sixxs[]={e,t,t,o,0}; -S smfag[]={i,250,a}; -S sivZ[]={e,r,99,0}; - -N l24n0[]={{sZsp,.224},{stt,.075},H}; -N l24n1[]={{stX,.261},H}; -N l24n2[]={{swig,.644},H}; -N l24n3[]={{ssv,.435},H}; -N l24n4[]={{ssZ,.162},{syrXg,.299},H}; -N l24n5[]={{smr,.498},{sxm,.286},{ssqi,.205},{spps,.131},H}; -N l24n6[]={{srx,.311},{sgwm,.532},{smhhy,.149},{shmw,.112},H}; -N l24n7[]={{sghm,1.175},{sri,.323},H}; -N l24n8[]={{sXvig,.522},{sZZl,.205},H}; -N l24n9[]={{sXrx,.149},H}; -N l24n11[]={{sipp,.448},{sZsq,.280},{sgXr,.252},H}; -N l24n12[]={{sgp,1.026},H}; -N l24n13[]={{sXr,.709},{spm,.423},{sgzi,.336},H}; -N l24n14[]={{sivZ,.112},H}; -N l24n15[]={{suyip,.174},H}; -N l24n17[]={{srsg,.728},{siz,.224},{sziz,.112},H}; -N l24n19[]={{svmh,.168},{sZZm,.112},H}; -N l24n20[]={{ssw,.199},H}; -N l24n21[]={{shm,.572},{sgts,.168},H}; -N l24n22[]={{sms,.348},{sZsr,.149},H}; -N l24n24[]={{swXr,.112},H}; -N l24n26[]={{sgZli,.821},H}; -N l24n27[]={{szXg,.868},{srhsg,.373},H}; -N l24n29[]={{sgq,.933},H}; -N l24n31[]={{sghip,.746},{ssrg,.392},{sjy,.075},H}; -N l24n32[]={{sXzXg,.560},H}; -N l24n33[]={{sxig,.364},{srhX,.168},{sZmX,.131},H}; -N l24n34[]={{stv,.149},H}; -N l24n35[]={{srXg,.672},H}; -N l24n36[]={{sivi,.131},H}; -N l24n37[]={{ssx,.112},H}; -N l24n39[]={{sgjXv,.261},{sskpm,.174},{shhyg,.224},H}; -N l24n40[]={{smX,.522},{skpm,.466},H}; -N l24n41[]={{spig,.644},{sgjm,.168},H}; -N l24n42[]={{s27X,.187},H}; -N l24n43[]={{stiv,.354},H}; -N l24n44[]={{sqm,.162},H}; -N l24n45[]={{svs,.187},{sivg,.392},H}; -N l24n46[]={{sgr,.765},{sippX,.323},{ssvX,.149},H}; -N l24n47[]={{sXt,.100},H}; -N l24n48[]={{smrX,.149},H}; -N l24n50[]={{sXrsg,.522},H}; -N l24n52[]={{spg,.933},{szizX,.149},H}; -N l24n54[]={{sgtv,.224},H}; -N l24n55[]={{sgpX,.588},{s7aX,.087},H}; -N l24n56[]={{sgZs,1.035},{sXxs,.187},{sixxs,.149},H}; -N l24n57[]={{sgzm,.448},{sgXpp,.373},{sgmg,.224},H}; -N l24n58[]={{sZsqi,.224},{sgwig,.299},H}; -N l24n60[]={{sZli,.429},{sizX,.280},H}; -N l24n61[]={{sgrsr,.485},H}; -N l24n63[]={{svX,.572},{sgs,.187},{svmhh,.199},H}; -N l24n64[]={{spp,.634},{syvm,.168},H}; -N l24n65[]={{sspp,.131},{shyg,.168},H}; -N l24n66[]={{sXpi,.187},H}; -N l24n67[]={{smpg,.700},{szm,.274},{sZZlm,.249},H}; -N l24n68[]={{sZspp,.174},H}; -N l24n69[]={{sti,.410},{ssZZ,.149},H}; -N l24n70[]={{swmg,.588},H}; -N l24n71[]={{swwig,.336},{stmfa,.112},H}; -N l24n72[]={{sgqX,.616},{sqig,.336},{ssk,.124},{sZle9g,.224},H}; -N l24n73[]={{sghs,.364},{smv,.100},H}; -N l24n74[]={{smZ,.187},H}; -N l24n75[]={{srm,.149},{syg,.168},H}; -N l24n76[]={{sws,.162},H}; -N l24n77[]={{sli,.286},{szsp,.112},H}; -N l24n78[]={{sXziz,.149},H}; -N l24n79[]={{sYX,.100},H}; -N l24n80[]={{sgt,1.157},H}; -N l24n81[]={{sgX,1.287},{sXv,.734},H}; -N l24n82[]={{sXZ,.174},H}; -N l24n83[]={{sjm,.137},H}; -N l24n85[]={{sZZs,.149},H}; -N l24n86[]={{syXr,.112},H}; -N l24n87[]={{se9g,.504},{syp,.137},H}; -N l24n88[]={{sivXg,.522},H}; -N l24n89[]={{sXrh,.336},{sgrX,.168},H}; -N l24n90[]={{smw,.224},H}; -N l24n91[]={{sig,3.433},{smh,.149},{sgkp,.336},H}; -N l24n92[]={{sZs,.659},H}; -N l24n93[]={{swt,.087},H}; -N l24n94[]={{swX,.373},{sqXr,.187},H}; -N l24n95[]={{sgyr,.588},{sZXw,.205},{sRg,.252},H}; -N l24n96[]={{svv,.124},{sghmw,.224},H}; -N l24n97[]={{sgu,.429},{svZ,.087},H}; -N l24n98[]={{sXw,.373},{sgY,.429},H}; -N l24n99[]={{sXh,.174},{sgXz,.280},{sgpi,.252},H}; -N l24n101[]={{smrg,.392},{sxmg,.336},{ssqig,.373},H}; -N l24n102[]={{sgwmg,.485},H}; -N l24n103[]={{sip,.560},{sghmg,.821},{srig,.420},H}; -N l24n104[]={{sguy,.644},{sZlm,.299},H}; -N l24n106[]={{ssm,.112},H}; -N l24n107[]={{sxs,.547},{sppX,.560},{smx,.187},{srsr,.243},H}; -N l24n108[]={{smi,.199},{sr7a,.100},{syvmh,.149},H}; -N l24n109[]={{spmg,.420},H}; -N l24n110[]={{sZX,.423},{s27i,.087},H}; -N l24n111[]={{sXxx,.112},H}; -N l24n113[]={{sle9g,.168},H}; -N l24n114[]={{srg,.802},{sgv,.336},{skm,.087},H}; -N l24n115[]={{sgZ,1.791},{sXx,.286},{sps,.274},H}; -N l24n116[]={{suy,.286},{sgqi,.252},H}; -N l24n117[]={{shmg,.616},{ship,.373},{szXr,.168},H}; -N l24n118[]={{smsg,.644},H}; -N l24n120[]={{siq,.087},H}; -N l24n121[]={{syr,.274},{stvi,.131},H}; -N l24n123[]={{shs,.460},{sgtX,.280},{sgzs,.280},{sgiv,.224},H}; -N l24n124[]={{sgZsp,.410},{sXrhX,.224},H}; -N l24n125[]={{sxX,.423},{sgmp,.700},H}; -N l24n127[]={{sgZsq,.560},{sgwx,.280},H}; -N l24n128[]={{swZ,.199},H}; -N l24n130[]={{sZXwX,.249},{sgyrX,.261},{svx,.075},{sgZsr,.224},{syXrh,.149},H}; -N l24n131[]={{sgw,1.791},{svi,.634},H}; -N l24n132[]={{sgh,1.735},{syip,.149},H}; -N l24n133[]={{spX,.808},{sxxs,.280},{sgri,.308},{sirx,.187},H}; -N l24n136[]={{smXg,.728},{skpmg,.522},{swiv,.149},H}; -N l24n137[]={{sir,.423},{stm,.137},H}; -N l24n138[]={{sgwy,.420},{sys,.149},H}; -N l24n139[]={{stivg,.522},{sguyX,.485},H}; -N l24n141[]={{shX,.398},{sXwX,.187},{sf3g,.378},{smz,.112},H}; -N l24n142[]={{smk,.137},H}; -N l24n143[]={{sXpp,.280},H}; -N l24n144[]={{sZZ,.361},{sww,.236},{smrXg,.224},H}; -N l24n145[]={{ssg,2.799},{slm,.211},H}; -N l24n146[]={{sqs,.187},{sgXzi,.299},H}; -N l24n147[]={{sgmr,.448},{sYi,.149},{sXZZ,.205},H}; -N l24n148[]={{sgx,.336},H}; -N l24n149[]={{sgi,.709},{sXz,.473},H}; -N l24n150[]={{sgkpm,.448},H}; -N l24n151[]={{sgpXg,.634},{sguyi,.373},H}; -N l24n152[]={{sXxsg,.336},H}; -N l24n155[]={{sgxy,.308},H}; -N l24n156[]={{sZlig,.858},{syX,.199},{sizXg,.448},H}; -N l24n157[]={{ssp,.373},{sgXh,.196},H}; -N l24n158[]={{sgZX,.644},{sxv,.187},{sgivX,.299},H}; -N l24n159[]={{svXg,.672},{suyX,.243},{shXz,.131},H}; -N l24n161[]={{swx,.311},H}; -N l24n162[]={{swi,.535},{sXpig,.336},H}; -N l24n163[]={{sqt,.162},H}; -N l24n164[]={{sqX,.386},{syrX,.149},{svz,.087},H}; -N l24n165[]={{skp,.311},{sgy,.448},H}; -N l24n166[]={{sgj,.522},{sXrhs,.224},H}; -N l24n167[]={{sgti,.728},{smhh,.149},{stmfag,.224},H}; -N l24n168[]={{sXvi,.280},H}; -N l24n169[]={{szs,.249},H}; -N l24n171[]={{sp27,.211},H}; -N l24n172[]={{swsg,.196},H}; -N l24n173[]={{slig,.644},H}; -N l24n174[]={{ssq,.286},{sgwX,.308},H}; -N l24n175[]={{sghX,.308},H}; -N l24n177[]={{srs,.585},{sgXg,.420},{sjXv,.168},{smfag,.168},H}; -N l24n178[]={{swy,.187},{sZi,.149},{sXppX,.174},H}; -N l24n182[]={{sgz,.784},H}; -N l24n183[]={{sgk,.373},{sxyv,.131},{svvi,.112},H}; -N l24n184[]={{sXm,.075},H}; -N l24n185[]={{sgp27,.336},{shipp,.249},{sgYi,.252},{szir,.112},H}; -N l24n187[]={{szX,.535},{srhs,.261},H}; -N l24n188[]={{sZsg,.196},H}; -N l24n189[]={{syv,.162},H}; -N l24n190[]={{swXg,.420},H}; -N l24n191[]={{ssr,.448},{sgyrg,.485},{s7am,.124},H}; -N l24n192[]={{sxx,.323},{sXzX,.373},{shh,.137},H}; -N l24n193[]={{sxi,.261},{sgtmfa,.224},H}; -N l24n194[]={{szXrs,.199},{shXzX,.174},H}; -N l24n195[]={{srX,.435},{sgpig,.299},H}; -N l24n196[]={{sgwZ,.168},H}; -N l24n199[]={{svm,.647},{sipg,.448},{skr,.137},{shhy,.112},H}; -N l24n200[]={{sZlmg,.261},{sspX,.131},{sgl,.112},H}; -N l24n201[]={{spi,.373},{sxvX,.131},H}; -N l24n202[]={{ssmg,.224},{smrs,.112},H}; -N l24n203[]={{sxsg,1.007},{sppXg,1.045},{sjX,.174},{srsrg,.448},{suyi,.187},{srxs,.131},H}; -N l24n204[]={{swxX,.168},H}; -N l24n205[]={{siv,.734},H}; -N l24n206[]={{sqtX,.131},H}; -N l24n207[]={{siww,.168},H}; -N l24n209[]={{shi,.373},{sxy,.162},{sgjX,.308},{sgps,.224},H}; -N l24n210[]={{sXrs,.261},H}; -N l24n211[]={{spsg,.420},{sgtm,.224},H}; -N l24n212[]={{sXvm,.243},H}; -N l24n213[]={{shipg,.336},H}; -N l24n214[]={{sp27X,.205},H}; -N l24n215[]={{smg,2.425},{sYm,.112},H}; -N l24n217[]={{sgm,.933},{syrg,.364},{svmz,.112},H}; -N l24n218[]={{sgwi,.672},H}; -N l24n219[]={{sghi,.672},{shsg,.364},{syxx,.131},H}; -N l24n220[]={{sgp27X,.336},H}; -N l24n221[]={{sgmpg,.933},{sxXg,.392},H}; -N l24n222[]={{siw,.224},H}; -N l24n223[]={{sXg,4.478},{syx,.149},H}; -N l24n224[]={{syi,.149},{siri,.149},H}; -N l24n225[]={{shy,.075},H}; -N l24n226[]={{sgqs,.280},H}; -N l24n227[]={{svig,.979},{smp,.336},H}; -N l24n229[]={{spXg,1.427},{sZl,.572},{sxxsg,.485},H}; -N l24n230[]={{swm,.398},H}; -N l24n231[]={{swwi,.224},{stXv,.168},H}; -N l24n232[]={{sqi,.286},H}; -N l24n233[]={{suyXr,.149},H}; -N l24n234[]={{s7amX,.131},H}; -N l24n235[]={{sXp,.473},{sgZl,.700},{sixx,.131},H}; -N l24n236[]={{sXzi,.205},{sskp,.131},H}; -N l24n237[]={{shXg,.336},{sXwXg,.373},H}; -N l24n238[]={{svg,.354},H}; -N l24n239[]={{six,.224},{sts,.211},H}; -N l24n241[]={{slmg,.224},{sgxyv,.261},H}; -N l24n242[]={{sxyvm,.174},H}; -N l24n243[]={{sgrs,.504},{sgmrg,.522},H}; -N l24n245[]={{sgig,.756},{sgXp,.448},{sgvm,.308},H}; -N l24n246[]={{srh,.323},{sZm,.274},H}; -N l24n247[]={{sgZXw,.410},H}; -N l24n248[]={{sivX,.317},{sgwXr,.224},H}; -N l24n252[]={{sXq,.124},H}; -N l24n253[]={{sgtiv,.709},H}; -N l24n255[]={{szi,.386},H}; - -D l24_d = -{ +S sZZ[] = { 99, 99, 0 }; +S skpm[] = { g, l, i, 0 }; +S sgZli[] = { 32, 99, h, e, 0 }; +S sghmg[] = { 32, d, i, a }; +S shmg[] = { d, i, a }; +S sZlm[] = { 99, h, i, 0 }; +S sxxs[] = { t, t, o, 0 }; +S sizX[] = { e, v, 97, 0 }; +S sXzXg[] = { 97, v, 97, a }; +S sivXg[] = { e, r, 97, a }; +S stivg[] = { p, e, r, a }; +S sXrsg[] = { 97, n, o, a }; +S sXvig[] = { 97, r, e, a }; +S skpmg[] = { g, l, i, a }; +S sguyX[] = { 32, q, u, 97, 0 }; +S sgrsr[] = { 32, n, o, n, 0 }; +S srsr[] = { n, o, n, 0 }; +S sgwmg[] = { 32, s, i, a }; +S suyX[] = { q, u, 97, 0 }; +S sxxsg[] = { t, t, o, a }; +S sizXg[] = { e, v, 97, a }; +S sZsp[] = { 99, o, l, 0 }; +S sgkpm[] = { 32, g, l, i, 0 }; +S srsrg[] = { n, o, n, a }; +S ssqi[] = { o, m, e, 0 }; +S sgZXw[] = { 32, 99, 97, s, 0 }; +S sZXw[] = { 99, 97, s, 0 }; +S sgZsp[] = { 32, 99, o, l, 0 }; +S sZZl[] = { 99, 99, h, 0 }; +S sXZZ[] = { 97, 99, 99, 0 }; +S shh[] = { d, d, 0 }; +S sgvm[] = { 32, r, i, 0 }; +S sgXpp[] = { 32, 97, l, l, 0 }; +S sXwXg[] = { 97, s, 97, a }; +S sZZlm[] = { 99, 99, h, i, 0 }; +S sXwX[] = { 97, s, 97, 0 }; +S sZXwX[] = { 99, 97, s, 97, 0 }; +S sXxs[] = { 97, t, o, 0 }; +S shipp[] = { d, e, l, l, 0 }; +S ssqig[] = { o, m, e, a }; +S srhsg[] = { n, d, o, a }; +S syvm[] = { u, r, i, 0 }; +S sZsqi[] = { 99, o, m, e, 0 }; +S sjXv[] = { f, 97, r, 0 }; +S sXrhs[] = { 97, n, d, o, 0 }; +S svmh[] = { r, i, d, 0 }; +S sXxsg[] = { 97, t, o, a }; +S sXpig[] = { 97, l, e, a }; +S swwig[] = { s, s, e, a }; +S ssvX[] = { o, r, 97, 0 }; +S sgtm[] = { 32, p, i, 0 }; +S szXrs[] = { v, 97, n, o, 0 }; +S syip[] = { u, e, l, 0 }; +S ssZZ[] = { o, 99, 99, 0 }; +S smhh[] = { i, d, d, 0 }; +S ssmg[] = { o, i, a }; +S svmhh[] = { r, i, d, d, 0 }; +S sZZs[] = { 99, 99, o, 0 }; +S sr7a[] = { n, z, 0 }; +S sgXzi[] = { 32, 97, v, e, 0 }; +S sgps[] = { 32, l, o, 0 }; +S sZsg[] = { 99, o, a }; +S sZlmg[] = { 99, h, i, a }; +S swsg[] = { s, o, a }; +S s7amX[] = { z, i, 97, 0 }; +S sgjXv[] = { 32, f, 97, r, 0 }; +S sskp[] = { o, g, l, 0 }; +S spps[] = { l, l, o, 0 }; +S suyip[] = { q, u, e, l, 0 }; +S sspX[] = { o, l, 97, 0 }; +S sskpm[] = { o, g, l, i, 0 }; +S shXz[] = { d, 97, v, 0 }; +S sZspp[] = { 99, o, l, l, 0 }; +S srxs[] = { n, t, o, 0 }; +S sqtX[] = { m, p, 97, 0 }; +S shXzX[] = { d, 97, v, 97, 0 }; +S sgxyv[] = { 32, t, u, r, 0 }; +S sxyvm[] = { t, u, r, i, 0 }; +S sXppX[] = { 97, l, l, 97, 0 }; +S sle9g[] = { h, 233, a }; +S smhhy[] = { i, d, d, u, 0 }; +S sZle9g[] = { 99, h, 233, a }; +S szizX[] = { v, e, v, 97, 0 }; +S syvmh[] = { u, r, i, d, 0 }; +S swXr[] = { s, 97, n, 0 }; +S sgtmfa[] = { 32, p, i, 250, 0 }; +S smrs[] = { i, n, o, 0 }; +S sgwXr[] = { 32, s, 97, n, 0 }; +S shhy[] = { d, d, u, 0 }; +S stmfa[] = { p, i, 250, 0 }; +S sZZm[] = { 99, 99, i, 0 }; +S sghmw[] = { 32, d, i, s, 0 }; +S stmfag[] = { p, i, 250, a }; +S syXrh[] = { u, 97, n, d, 0 }; +S svvi[] = { r, r, e, 0 }; +S sXziz[] = { 97, v, e, v, 0 }; +S svmz[] = { r, i, v, 0 }; +S sziz[] = { v, e, v, 0 }; +S sXxx[] = { 97, t, t, 0 }; +S shhyg[] = { d, d, u, a }; +S syXr[] = { u, 97, n, 0 }; +S suyXr[] = { q, u, 97, n, 0 }; +S sixxs[] = { e, t, t, o, 0 }; +S smfag[] = { i, 250, a }; +S sivZ[] = { e, r, 99, 0 }; + +N l24n0[] = { { sZsp, .224 }, { stt, .075 }, H }; +N l24n1[] = { { stX, .261 }, H }; +N l24n2[] = { { swig, .644 }, H }; +N l24n3[] = { { ssv, .435 }, H }; +N l24n4[] = { { ssZ, .162 }, { syrXg, .299 }, H }; +N l24n5[] = { { smr, .498 }, { sxm, .286 }, { ssqi, .205 }, { spps, .131 }, H }; +N l24n6[] = { { srx, .311 }, { sgwm, .532 }, { smhhy, .149 }, { shmw, .112 }, H }; +N l24n7[] = { { sghm, 1.175 }, { sri, .323 }, H }; +N l24n8[] = { { sXvig, .522 }, { sZZl, .205 }, H }; +N l24n9[] = { { sXrx, .149 }, H }; +N l24n11[] = { { sipp, .448 }, { sZsq, .280 }, { sgXr, .252 }, H }; +N l24n12[] = { { sgp, 1.026 }, H }; +N l24n13[] = { { sXr, .709 }, { spm, .423 }, { sgzi, .336 }, H }; +N l24n14[] = { { sivZ, .112 }, H }; +N l24n15[] = { { suyip, .174 }, H }; +N l24n17[] = { { srsg, .728 }, { siz, .224 }, { sziz, .112 }, H }; +N l24n19[] = { { svmh, .168 }, { sZZm, .112 }, H }; +N l24n20[] = { { ssw, .199 }, H }; +N l24n21[] = { { shm, .572 }, { sgts, .168 }, H }; +N l24n22[] = { { sms, .348 }, { sZsr, .149 }, H }; +N l24n24[] = { { swXr, .112 }, H }; +N l24n26[] = { { sgZli, .821 }, H }; +N l24n27[] = { { szXg, .868 }, { srhsg, .373 }, H }; +N l24n29[] = { { sgq, .933 }, H }; +N l24n31[] = { { sghip, .746 }, { ssrg, .392 }, { sjy, .075 }, H }; +N l24n32[] = { { sXzXg, .560 }, H }; +N l24n33[] = { { sxig, .364 }, { srhX, .168 }, { sZmX, .131 }, H }; +N l24n34[] = { { stv, .149 }, H }; +N l24n35[] = { { srXg, .672 }, H }; +N l24n36[] = { { sivi, .131 }, H }; +N l24n37[] = { { ssx, .112 }, H }; +N l24n39[] = { { sgjXv, .261 }, { sskpm, .174 }, { shhyg, .224 }, H }; +N l24n40[] = { { smX, .522 }, { skpm, .466 }, H }; +N l24n41[] = { { spig, .644 }, { sgjm, .168 }, H }; +N l24n42[] = { { s27X, .187 }, H }; +N l24n43[] = { { stiv, .354 }, H }; +N l24n44[] = { { sqm, .162 }, H }; +N l24n45[] = { { svs, .187 }, { sivg, .392 }, H }; +N l24n46[] = { { sgr, .765 }, { sippX, .323 }, { ssvX, .149 }, H }; +N l24n47[] = { { sXt, .100 }, H }; +N l24n48[] = { { smrX, .149 }, H }; +N l24n50[] = { { sXrsg, .522 }, H }; +N l24n52[] = { { spg, .933 }, { szizX, .149 }, H }; +N l24n54[] = { { sgtv, .224 }, H }; +N l24n55[] = { { sgpX, .588 }, { s7aX, .087 }, H }; +N l24n56[] = { { sgZs, 1.035 }, { sXxs, .187 }, { sixxs, .149 }, H }; +N l24n57[] = { { sgzm, .448 }, { sgXpp, .373 }, { sgmg, .224 }, H }; +N l24n58[] = { { sZsqi, .224 }, { sgwig, .299 }, H }; +N l24n60[] = { { sZli, .429 }, { sizX, .280 }, H }; +N l24n61[] = { { sgrsr, .485 }, H }; +N l24n63[] = { { svX, .572 }, { sgs, .187 }, { svmhh, .199 }, H }; +N l24n64[] = { { spp, .634 }, { syvm, .168 }, H }; +N l24n65[] = { { sspp, .131 }, { shyg, .168 }, H }; +N l24n66[] = { { sXpi, .187 }, H }; +N l24n67[] = { { smpg, .700 }, { szm, .274 }, { sZZlm, .249 }, H }; +N l24n68[] = { { sZspp, .174 }, H }; +N l24n69[] = { { sti, .410 }, { ssZZ, .149 }, H }; +N l24n70[] = { { swmg, .588 }, H }; +N l24n71[] = { { swwig, .336 }, { stmfa, .112 }, H }; +N l24n72[] = { { sgqX, .616 }, { sqig, .336 }, { ssk, .124 }, { sZle9g, .224 }, H }; +N l24n73[] = { { sghs, .364 }, { smv, .100 }, H }; +N l24n74[] = { { smZ, .187 }, H }; +N l24n75[] = { { srm, .149 }, { syg, .168 }, H }; +N l24n76[] = { { sws, .162 }, H }; +N l24n77[] = { { sli, .286 }, { szsp, .112 }, H }; +N l24n78[] = { { sXziz, .149 }, H }; +N l24n79[] = { { sYX, .100 }, H }; +N l24n80[] = { { sgt, 1.157 }, H }; +N l24n81[] = { { sgX, 1.287 }, { sXv, .734 }, H }; +N l24n82[] = { { sXZ, .174 }, H }; +N l24n83[] = { { sjm, .137 }, H }; +N l24n85[] = { { sZZs, .149 }, H }; +N l24n86[] = { { syXr, .112 }, H }; +N l24n87[] = { { se9g, .504 }, { syp, .137 }, H }; +N l24n88[] = { { sivXg, .522 }, H }; +N l24n89[] = { { sXrh, .336 }, { sgrX, .168 }, H }; +N l24n90[] = { { smw, .224 }, H }; +N l24n91[] = { { sig, 3.433 }, { smh, .149 }, { sgkp, .336 }, H }; +N l24n92[] = { { sZs, .659 }, H }; +N l24n93[] = { { swt, .087 }, H }; +N l24n94[] = { { swX, .373 }, { sqXr, .187 }, H }; +N l24n95[] = { { sgyr, .588 }, { sZXw, .205 }, { sRg, .252 }, H }; +N l24n96[] = { { svv, .124 }, { sghmw, .224 }, H }; +N l24n97[] = { { sgu, .429 }, { svZ, .087 }, H }; +N l24n98[] = { { sXw, .373 }, { sgY, .429 }, H }; +N l24n99[] = { { sXh, .174 }, { sgXz, .280 }, { sgpi, .252 }, H }; +N l24n101[] = { { smrg, .392 }, { sxmg, .336 }, { ssqig, .373 }, H }; +N l24n102[] = { { sgwmg, .485 }, H }; +N l24n103[] = { { sip, .560 }, { sghmg, .821 }, { srig, .420 }, H }; +N l24n104[] = { { sguy, .644 }, { sZlm, .299 }, H }; +N l24n106[] = { { ssm, .112 }, H }; +N l24n107[] = { { sxs, .547 }, { sppX, .560 }, { smx, .187 }, { srsr, .243 }, H }; +N l24n108[] = { { smi, .199 }, { sr7a, .100 }, { syvmh, .149 }, H }; +N l24n109[] = { { spmg, .420 }, H }; +N l24n110[] = { { sZX, .423 }, { s27i, .087 }, H }; +N l24n111[] = { { sXxx, .112 }, H }; +N l24n113[] = { { sle9g, .168 }, H }; +N l24n114[] = { { srg, .802 }, { sgv, .336 }, { skm, .087 }, H }; +N l24n115[] = { { sgZ, 1.791 }, { sXx, .286 }, { sps, .274 }, H }; +N l24n116[] = { { suy, .286 }, { sgqi, .252 }, H }; +N l24n117[] = { { shmg, .616 }, { ship, .373 }, { szXr, .168 }, H }; +N l24n118[] = { { smsg, .644 }, H }; +N l24n120[] = { { siq, .087 }, H }; +N l24n121[] = { { syr, .274 }, { stvi, .131 }, H }; +N l24n123[] = { { shs, .460 }, { sgtX, .280 }, { sgzs, .280 }, { sgiv, .224 }, H }; +N l24n124[] = { { sgZsp, .410 }, { sXrhX, .224 }, H }; +N l24n125[] = { { sxX, .423 }, { sgmp, .700 }, H }; +N l24n127[] = { { sgZsq, .560 }, { sgwx, .280 }, H }; +N l24n128[] = { { swZ, .199 }, H }; +N l24n130[] = { { sZXwX, .249 }, { sgyrX, .261 }, { svx, .075 }, { sgZsr, .224 }, { syXrh, .149 }, H }; +N l24n131[] = { { sgw, 1.791 }, { svi, .634 }, H }; +N l24n132[] = { { sgh, 1.735 }, { syip, .149 }, H }; +N l24n133[] = { { spX, .808 }, { sxxs, .280 }, { sgri, .308 }, { sirx, .187 }, H }; +N l24n136[] = { { smXg, .728 }, { skpmg, .522 }, { swiv, .149 }, H }; +N l24n137[] = { { sir, .423 }, { stm, .137 }, H }; +N l24n138[] = { { sgwy, .420 }, { sys, .149 }, H }; +N l24n139[] = { { stivg, .522 }, { sguyX, .485 }, H }; +N l24n141[] = { { shX, .398 }, { sXwX, .187 }, { sf3g, .378 }, { smz, .112 }, H }; +N l24n142[] = { { smk, .137 }, H }; +N l24n143[] = { { sXpp, .280 }, H }; +N l24n144[] = { { sZZ, .361 }, { sww, .236 }, { smrXg, .224 }, H }; +N l24n145[] = { { ssg, 2.799 }, { slm, .211 }, H }; +N l24n146[] = { { sqs, .187 }, { sgXzi, .299 }, H }; +N l24n147[] = { { sgmr, .448 }, { sYi, .149 }, { sXZZ, .205 }, H }; +N l24n148[] = { { sgx, .336 }, H }; +N l24n149[] = { { sgi, .709 }, { sXz, .473 }, H }; +N l24n150[] = { { sgkpm, .448 }, H }; +N l24n151[] = { { sgpXg, .634 }, { sguyi, .373 }, H }; +N l24n152[] = { { sXxsg, .336 }, H }; +N l24n155[] = { { sgxy, .308 }, H }; +N l24n156[] = { { sZlig, .858 }, { syX, .199 }, { sizXg, .448 }, H }; +N l24n157[] = { { ssp, .373 }, { sgXh, .196 }, H }; +N l24n158[] = { { sgZX, .644 }, { sxv, .187 }, { sgivX, .299 }, H }; +N l24n159[] = { { svXg, .672 }, { suyX, .243 }, { shXz, .131 }, H }; +N l24n161[] = { { swx, .311 }, H }; +N l24n162[] = { { swi, .535 }, { sXpig, .336 }, H }; +N l24n163[] = { { sqt, .162 }, H }; +N l24n164[] = { { sqX, .386 }, { syrX, .149 }, { svz, .087 }, H }; +N l24n165[] = { { skp, .311 }, { sgy, .448 }, H }; +N l24n166[] = { { sgj, .522 }, { sXrhs, .224 }, H }; +N l24n167[] = { { sgti, .728 }, { smhh, .149 }, { stmfag, .224 }, H }; +N l24n168[] = { { sXvi, .280 }, H }; +N l24n169[] = { { szs, .249 }, H }; +N l24n171[] = { { sp27, .211 }, H }; +N l24n172[] = { { swsg, .196 }, H }; +N l24n173[] = { { slig, .644 }, H }; +N l24n174[] = { { ssq, .286 }, { sgwX, .308 }, H }; +N l24n175[] = { { sghX, .308 }, H }; +N l24n177[] = { { srs, .585 }, { sgXg, .420 }, { sjXv, .168 }, { smfag, .168 }, H }; +N l24n178[] = { { swy, .187 }, { sZi, .149 }, { sXppX, .174 }, H }; +N l24n182[] = { { sgz, .784 }, H }; +N l24n183[] = { { sgk, .373 }, { sxyv, .131 }, { svvi, .112 }, H }; +N l24n184[] = { { sXm, .075 }, H }; +N l24n185[] = { { sgp27, .336 }, { shipp, .249 }, { sgYi, .252 }, { szir, .112 }, H }; +N l24n187[] = { { szX, .535 }, { srhs, .261 }, H }; +N l24n188[] = { { sZsg, .196 }, H }; +N l24n189[] = { { syv, .162 }, H }; +N l24n190[] = { { swXg, .420 }, H }; +N l24n191[] = { { ssr, .448 }, { sgyrg, .485 }, { s7am, .124 }, H }; +N l24n192[] = { { sxx, .323 }, { sXzX, .373 }, { shh, .137 }, H }; +N l24n193[] = { { sxi, .261 }, { sgtmfa, .224 }, H }; +N l24n194[] = { { szXrs, .199 }, { shXzX, .174 }, H }; +N l24n195[] = { { srX, .435 }, { sgpig, .299 }, H }; +N l24n196[] = { { sgwZ, .168 }, H }; +N l24n199[] = { { svm, .647 }, { sipg, .448 }, { skr, .137 }, { shhy, .112 }, H }; +N l24n200[] = { { sZlmg, .261 }, { sspX, .131 }, { sgl, .112 }, H }; +N l24n201[] = { { spi, .373 }, { sxvX, .131 }, H }; +N l24n202[] = { { ssmg, .224 }, { smrs, .112 }, H }; +N l24n203[] = { { sxsg, 1.007 }, { sppXg, 1.045 }, { sjX, .174 }, { srsrg, .448 }, { suyi, .187 }, { srxs, .131 }, H }; +N l24n204[] = { { swxX, .168 }, H }; +N l24n205[] = { { siv, .734 }, H }; +N l24n206[] = { { sqtX, .131 }, H }; +N l24n207[] = { { siww, .168 }, H }; +N l24n209[] = { { shi, .373 }, { sxy, .162 }, { sgjX, .308 }, { sgps, .224 }, H }; +N l24n210[] = { { sXrs, .261 }, H }; +N l24n211[] = { { spsg, .420 }, { sgtm, .224 }, H }; +N l24n212[] = { { sXvm, .243 }, H }; +N l24n213[] = { { shipg, .336 }, H }; +N l24n214[] = { { sp27X, .205 }, H }; +N l24n215[] = { { smg, 2.425 }, { sYm, .112 }, H }; +N l24n217[] = { { sgm, .933 }, { syrg, .364 }, { svmz, .112 }, H }; +N l24n218[] = { { sgwi, .672 }, H }; +N l24n219[] = { { sghi, .672 }, { shsg, .364 }, { syxx, .131 }, H }; +N l24n220[] = { { sgp27X, .336 }, H }; +N l24n221[] = { { sgmpg, .933 }, { sxXg, .392 }, H }; +N l24n222[] = { { siw, .224 }, H }; +N l24n223[] = { { sXg, 4.478 }, { syx, .149 }, H }; +N l24n224[] = { { syi, .149 }, { siri, .149 }, H }; +N l24n225[] = { { shy, .075 }, H }; +N l24n226[] = { { sgqs, .280 }, H }; +N l24n227[] = { { svig, .979 }, { smp, .336 }, H }; +N l24n229[] = { { spXg, 1.427 }, { sZl, .572 }, { sxxsg, .485 }, H }; +N l24n230[] = { { swm, .398 }, H }; +N l24n231[] = { { swwi, .224 }, { stXv, .168 }, H }; +N l24n232[] = { { sqi, .286 }, H }; +N l24n233[] = { { suyXr, .149 }, H }; +N l24n234[] = { { s7amX, .131 }, H }; +N l24n235[] = { { sXp, .473 }, { sgZl, .700 }, { sixx, .131 }, H }; +N l24n236[] = { { sXzi, .205 }, { sskp, .131 }, H }; +N l24n237[] = { { shXg, .336 }, { sXwXg, .373 }, H }; +N l24n238[] = { { svg, .354 }, H }; +N l24n239[] = { { six, .224 }, { sts, .211 }, H }; +N l24n241[] = { { slmg, .224 }, { sgxyv, .261 }, H }; +N l24n242[] = { { sxyvm, .174 }, H }; +N l24n243[] = { { sgrs, .504 }, { sgmrg, .522 }, H }; +N l24n245[] = { { sgig, .756 }, { sgXp, .448 }, { sgvm, .308 }, H }; +N l24n246[] = { { srh, .323 }, { sZm, .274 }, H }; +N l24n247[] = { { sgZXw, .410 }, H }; +N l24n248[] = { { sivX, .317 }, { sgwXr, .224 }, H }; +N l24n252[] = { { sXq, .124 }, H }; +N l24n253[] = { { sgtiv, .709 }, H }; +N l24n255[] = { { szi, .386 }, H }; + +D l24_d = { "italian", "iso-8859-15", - { - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,0.001,0.017,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,0.273,0.021,0.102,0.086,0.205,0.020,0.030,0.028,0.196,W,W,0.142,0.052,0.123,0.171, - 0.052,0.011,0.122,0.104,0.092,0.062,0.060,W,W,W,0.010,W,W,W,W,W, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - Y,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V, - V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V, - V,0.007,V,V,V,V,V,V,V,0.013,V,V,V,0.002,V,V, - V,V,V,0.010,V,V,V,V,V,V,0.007,V,V,V,V,V - }, - { - l24n0,l24n1,l24n2,l24n3,l24n4,l24n5,l24n6,l24n7,l24n8,l24n9,X,l24n11,l24n12,l24n13,l24n14,l24n15, - X,l24n17,X,l24n19,l24n20,l24n21,l24n22,X,l24n24,X,l24n26,l24n27,X,l24n29,X,l24n31, - l24n32,l24n33,l24n34,l24n35,l24n36,l24n37,X,l24n39,l24n40,l24n41,l24n42,l24n43,l24n44,l24n45,l24n46,l24n47, - l24n48,X,l24n50,X,l24n52,X,l24n54,l24n55,l24n56,l24n57,l24n58,X,l24n60,l24n61,X,l24n63, - l24n64,l24n65,l24n66,l24n67,l24n68,l24n69,l24n70,l24n71,l24n72,l24n73,l24n74,l24n75,l24n76,l24n77,l24n78,l24n79, - l24n80,l24n81,l24n82,l24n83,X,l24n85,l24n86,l24n87,l24n88,l24n89,l24n90,l24n91,l24n92,l24n93,l24n94,l24n95, - l24n96,l24n97,l24n98,l24n99,X,l24n101,l24n102,l24n103,l24n104,X,l24n106,l24n107,l24n108,l24n109,l24n110,l24n111, - X,l24n113,l24n114,l24n115,l24n116,l24n117,l24n118,X,l24n120,l24n121,X,l24n123,l24n124,l24n125,X,l24n127, - l24n128,X,l24n130,l24n131,l24n132,l24n133,X,X,l24n136,l24n137,l24n138,l24n139,X,l24n141,l24n142,l24n143, - l24n144,l24n145,l24n146,l24n147,l24n148,l24n149,l24n150,l24n151,l24n152,X,X,l24n155,l24n156,l24n157,l24n158,l24n159, - X,l24n161,l24n162,l24n163,l24n164,l24n165,l24n166,l24n167,l24n168,l24n169,X,l24n171,l24n172,l24n173,l24n174,l24n175, - X,l24n177,l24n178,X,X,X,l24n182,l24n183,l24n184,l24n185,X,l24n187,l24n188,l24n189,l24n190,l24n191, - l24n192,l24n193,l24n194,l24n195,l24n196,X,X,l24n199,l24n200,l24n201,l24n202,l24n203,l24n204,l24n205,l24n206,l24n207, - X,l24n209,l24n210,l24n211,l24n212,l24n213,l24n214,l24n215,X,l24n217,l24n218,l24n219,l24n220,l24n221,l24n222,l24n223, - l24n224,l24n225,l24n226,l24n227,X,l24n229,l24n230,l24n231,l24n232,l24n233,l24n234,l24n235,l24n236,l24n237,l24n238,l24n239, - X,l24n241,l24n242,l24n243,X,l24n245,l24n246,l24n247,l24n248,X,X,X,l24n252,l24n253,X,l24n255 - } + { W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, 0.001, 0.017, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, 0.273, 0.021, 0.102, 0.086, 0.205, 0.020, 0.030, 0.028, 0.196, W, W, 0.142, 0.052, 0.123, 0.171, + 0.052, 0.011, 0.122, 0.104, 0.092, 0.062, 0.060, W, W, W, 0.010, W, W, W, W, W, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + Y, V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, + V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, + V, 0.007, V, V, V, V, V, V, V, 0.013, V, V, V, 0.002, V, V, + V, V, V, 0.010, V, V, V, V, V, V, 0.007, V, V, V, V, V }, + { l24n0, l24n1, l24n2, l24n3, l24n4, l24n5, l24n6, l24n7, l24n8, l24n9, X, l24n11, l24n12, l24n13, l24n14, l24n15, + X, l24n17, X, l24n19, l24n20, l24n21, l24n22, X, l24n24, X, l24n26, l24n27, X, l24n29, X, l24n31, + l24n32, l24n33, l24n34, l24n35, l24n36, l24n37, X, l24n39, l24n40, l24n41, l24n42, l24n43, l24n44, l24n45, l24n46, l24n47, + l24n48, X, l24n50, X, l24n52, X, l24n54, l24n55, l24n56, l24n57, l24n58, X, l24n60, l24n61, X, l24n63, + l24n64, l24n65, l24n66, l24n67, l24n68, l24n69, l24n70, l24n71, l24n72, l24n73, l24n74, l24n75, l24n76, l24n77, l24n78, l24n79, + l24n80, l24n81, l24n82, l24n83, X, l24n85, l24n86, l24n87, l24n88, l24n89, l24n90, l24n91, l24n92, l24n93, l24n94, l24n95, + l24n96, l24n97, l24n98, l24n99, X, l24n101, l24n102, l24n103, l24n104, X, l24n106, l24n107, l24n108, l24n109, l24n110, l24n111, + X, l24n113, l24n114, l24n115, l24n116, l24n117, l24n118, X, l24n120, l24n121, X, l24n123, l24n124, l24n125, X, l24n127, + l24n128, X, l24n130, l24n131, l24n132, l24n133, X, X, l24n136, l24n137, l24n138, l24n139, X, l24n141, l24n142, l24n143, + l24n144, l24n145, l24n146, l24n147, l24n148, l24n149, l24n150, l24n151, l24n152, X, X, l24n155, l24n156, l24n157, l24n158, l24n159, + X, l24n161, l24n162, l24n163, l24n164, l24n165, l24n166, l24n167, l24n168, l24n169, X, l24n171, l24n172, l24n173, l24n174, l24n175, + X, l24n177, l24n178, X, X, X, l24n182, l24n183, l24n184, l24n185, X, l24n187, l24n188, l24n189, l24n190, l24n191, + l24n192, l24n193, l24n194, l24n195, l24n196, X, X, l24n199, l24n200, l24n201, l24n202, l24n203, l24n204, l24n205, l24n206, l24n207, + X, l24n209, l24n210, l24n211, l24n212, l24n213, l24n214, l24n215, X, l24n217, l24n218, l24n219, l24n220, l24n221, l24n222, l24n223, + l24n224, l24n225, l24n226, l24n227, X, l24n229, l24n230, l24n231, l24n232, l24n233, l24n234, l24n235, l24n236, l24n237, l24n238, l24n239, + X, l24n241, l24n242, l24n243, X, l24n245, l24n246, l24n247, l24n248, X, X, X, l24n252, l24n253, X, l24n255 } }; - - // // Lng: italian // Enc: utf8 // - -S sc3a9[]={195,169,0}; -S sc3a9g[]={195,169,a}; -S sc3b3[]={195,179,0}; -S sc3b3g[]={195,179,a}; -S smc3[]={i,195,0}; -S stmc3[]={p,i,195,0}; -S sc3a1g[]={195,161,a}; -S sc3a1[]={195,161,0}; -S sc3ba[]={195,186,0}; -S smc3ba[]={i,195,186,0}; -S slc3a9g[]={h,195,169,a}; -S smc3bag[]={i,195,186,a}; -S slc3a9[]={h,195,169,0}; -S stmc3ba[]={p,i,195,186,0}; -S sc3bag[]={195,186,a}; - -N l25n0[]={{sZsp,.222},{stt,.074},H}; -N l25n1[]={{stX,.259},H}; -N l25n2[]={{swig,.638},H}; -N l25n3[]={{ssv,.432},H}; -N l25n4[]={{ssZ,.160},{syrXg,.296},H}; -N l25n5[]={{smr,.493},{sxm,.284},{ssqi,.203},{spps,.129},H}; -N l25n6[]={{srx,.308},{sgwm,.527},{smhhy,.148},{shmw,.111},H}; -N l25n7[]={{sghm,1.165},{sri,.321},H}; -N l25n8[]={{sXvig,.518},{sZZl,.203},{smc3bag,.222},H}; -N l25n9[]={{sXrx,.148},H}; -N l25n11[]={{sipp,.444},{sZsq,.277},{sgXr,.250},H}; -N l25n12[]={{sgp,1.017},H}; -N l25n13[]={{sXr,.703},{spm,.419},{sgzi,.333},H}; -N l25n15[]={{suyip,.173},H}; -N l25n17[]={{srsg,.721},{siz,.222},{sziz,.111},H}; -N l25n19[]={{svmh,.166},{sZZm,.111},H}; -N l25n20[]={{ssw,.197},H}; -N l25n21[]={{shm,.567},{sgts,.166},H}; -N l25n22[]={{sms,.345},{sZsr,.148},H}; -N l25n24[]={{swXr,.111},{stmc3ba,.148},H}; -N l25n26[]={{sgZli,.814},H}; -N l25n27[]={{szXg,.860},{srhsg,.370},H}; -N l25n29[]={{sgq,.925},H}; -N l25n31[]={{sghip,.740},{ssrg,.388},{sjy,.074},H}; -N l25n32[]={{sXzXg,.555},H}; -N l25n33[]={{sxig,.361},{srhX,.166},{sZmX,.129},H}; -N l25n34[]={{stv,.148},H}; -N l25n35[]={{srXg,.666},H}; -N l25n36[]={{sivi,.129},H}; -N l25n37[]={{ssx,.111},H}; -N l25n39[]={{sgjXv,.259},{sskpm,.173},H}; -N l25n40[]={{smX,.518},{skpm,.462},H}; -N l25n41[]={{spig,.638},H}; -N l25n42[]={{s27X,.185},H}; -N l25n43[]={{stiv,.351},H}; -N l25n44[]={{sqm,.160},H}; -N l25n45[]={{svs,.185},{sivg,.388},H}; -N l25n46[]={{sgr,.758},{sippX,.321},{ssvX,.148},{slc3a9g,.222},H}; -N l25n47[]={{sXt,.099},H}; -N l25n48[]={{smrX,.148},H}; -N l25n50[]={{sXrsg,.518},H}; -N l25n52[]={{spg,.925},{szizX,.148},H}; -N l25n54[]={{sc3a9g,.749},{sgtv,.222},H}; -N l25n55[]={{sgpX,.583},{s7aX,.086},H}; -N l25n56[]={{sgZs,1.027},{sXxs,.185},H}; -N l25n57[]={{sgzm,.444},{sgXpp,.370},{sgmg,.222},H}; -N l25n58[]={{sZsqi,.222},{sgwig,.296},H}; -N l25n60[]={{sZli,.425},{sizX,.277},H}; -N l25n61[]={{sgrsr,.481},H}; -N l25n63[]={{svX,.567},{sgs,.185},{svmhh,.197},H}; -N l25n64[]={{spp,.629},{syvm,.166},H}; -N l25n65[]={{sspp,.129},H}; -N l25n66[]={{sXpi,.185},H}; -N l25n67[]={{smpg,.694},{szm,.271},{sZZlm,.247},H}; -N l25n68[]={{sZspp,.173},H}; -N l25n69[]={{sti,.407},{ssZZ,.148},H}; -N l25n70[]={{swmg,.583},H}; -N l25n71[]={{swwig,.333},H}; -N l25n72[]={{sgqX,.610},{sqig,.333},{ssk,.123},H}; -N l25n73[]={{sghs,.361},{smv,.099},H}; -N l25n74[]={{smZ,.185},H}; -N l25n75[]={{srm,.148},{syg,.166},H}; -N l25n76[]={{sws,.160},H}; -N l25n77[]={{sli,.284},{szsp,.111},H}; -N l25n78[]={{sc3a1,.166},{sXziz,.148},H}; -N l25n79[]={{sYX,.099},H}; -N l25n80[]={{sgt,1.147},H}; -N l25n81[]={{sgX,1.276},{sXv,.727},H}; -N l25n82[]={{sXZ,.173},H}; -N l25n83[]={{sjm,.136},H}; -N l25n85[]={{sZZs,.148},H}; -N l25n87[]={{syp,.136},{sc3bag,.375},H}; -N l25n88[]={{sivXg,.518},H}; -N l25n89[]={{sXrh,.333},{sgrX,.166},H}; -N l25n90[]={{smw,.222},H}; -N l25n91[]={{sig,3.403},{smh,.148},{sgkp,.333},H}; -N l25n92[]={{sZs,.654},H}; -N l25n93[]={{swt,.086},H}; -N l25n94[]={{swX,.370},{sqXr,.185},H}; -N l25n95[]={{sgyr,.583},{sZXw,.203},H}; -N l25n96[]={{svv,.123},{sghmw,.222},H}; -N l25n97[]={{sgu,.425},{svZ,.086},H}; -N l25n98[]={{sXw,.370},{sgY,.425},H}; -N l25n99[]={{sXh,.173},{sgXz,.277},{sgpi,.250},H}; -N l25n101[]={{smrg,.388},{sxmg,.333},{ssqig,.370},H}; -N l25n102[]={{sgwmg,.481},H}; -N l25n103[]={{sip,.555},{sghmg,.814},{srig,.416},H}; -N l25n104[]={{sguy,.638},{sZlm,.296},H}; -N l25n106[]={{ssm,.111},H}; -N l25n107[]={{sxs,.543},{sppX,.555},{smx,.185},{srsr,.240},H}; -N l25n108[]={{smi,.197},{sr7a,.099},{syvmh,.148},H}; -N l25n109[]={{spmg,.416},H}; -N l25n110[]={{sZX,.419},{s27i,.086},H}; -N l25n114[]={{srg,.795},{sgv,.333},{skm,.086},H}; -N l25n115[]={{sgZ,1.776},{sXx,.284},{sps,.271},H}; -N l25n116[]={{suy,.284},{sgqi,.250},H}; -N l25n117[]={{shmg,.610},{ship,.370},{szXr,.166},H}; -N l25n118[]={{smsg,.638},H}; -N l25n120[]={{siq,.086},H}; -N l25n121[]={{syr,.271},{stvi,.129},H}; -N l25n123[]={{shs,.456},{sgtX,.277},{sgzs,.277},{sgiv,.222},H}; -N l25n124[]={{sgZsp,.407},{sXrhX,.222},H}; -N l25n125[]={{sxX,.419},{sgmp,.694},H}; -N l25n127[]={{sgZsq,.555},{sgwx,.277},H}; -N l25n128[]={{swZ,.197},{sc3b3,.250},H}; -N l25n130[]={{sZXwX,.247},{sgyrX,.259},{svx,.074},{sgZsr,.222},{syXrh,.148},H}; -N l25n131[]={{sgw,1.776},{svi,.629},H}; -N l25n132[]={{sgh,1.720},{syip,.148},H}; -N l25n133[]={{spX,.801},{sxxs,.277},{sgri,.305},{sirx,.185},H}; -N l25n136[]={{smXg,.721},{skpmg,.518},{swiv,.148},H}; -N l25n137[]={{sir,.419},{stm,.136},H}; -N l25n138[]={{sgwy,.416},{sys,.148},H}; -N l25n139[]={{stivg,.518},{sguyX,.481},H}; -N l25n141[]={{shX,.395},{sXwX,.185},{smz,.111},H}; -N l25n142[]={{smk,.136},H}; -N l25n143[]={{sXpp,.277},H}; -N l25n144[]={{sZZ,.358},{sww,.234},H}; -N l25n145[]={{ssg,2.774},{slm,.210},H}; -N l25n146[]={{sqs,.185},{sgXzi,.296},H}; -N l25n147[]={{sgmr,.444},{sYi,.148},{sXZZ,.203},H}; -N l25n148[]={{sgx,.333},H}; -N l25n149[]={{sgi,.703},{sXz,.469},H}; -N l25n150[]={{sgkpm,.444},H}; -N l25n151[]={{sgpXg,.629},{sa9g,.333},{sguyi,.370},H}; -N l25n152[]={{sXxsg,.333},H}; -N l25n155[]={{sgxy,.305},H}; -N l25n156[]={{sZlig,.851},{syX,.197},{sizXg,.444},H}; -N l25n157[]={{ssp,.370},{sgXh,.194},H}; -N l25n158[]={{sgZX,.638},{sxv,.185},{sgivX,.296},H}; -N l25n159[]={{svXg,.666},{suyX,.240},{shXz,.129},{sa1g,.166},H}; -N l25n161[]={{swx,.308},H}; -N l25n162[]={{swi,.530},{sXpig,.333},H}; -N l25n163[]={{sqt,.160},H}; -N l25n164[]={{sqX,.382},{syrX,.148},{svz,.086},H}; -N l25n165[]={{skp,.308},{sgy,.444},H}; -N l25n166[]={{sgj,.518},{sXrhs,.222},{sbag,.166},H}; -N l25n167[]={{sgti,.721},{smhh,.148},H}; -N l25n168[]={{sXvi,.277},{smc3ba,.111},H}; -N l25n169[]={{szs,.247},H}; -N l25n170[]={{smc3,.086},H}; -N l25n171[]={{sp27,.210},H}; -N l25n172[]={{swsg,.194},H}; -N l25n173[]={{slig,.638},H}; -N l25n174[]={{ssq,.284},{sgwX,.305},{sc3a1g,.375},H}; -N l25n175[]={{sghX,.305},H}; -N l25n177[]={{srs,.580},{sgXg,.416},{sjXv,.166},H}; -N l25n178[]={{swy,.185},{sZi,.148},{sXppX,.173},H}; -N l25n182[]={{sgz,.777},H}; -N l25n183[]={{sgk,.370},{sxyv,.129},{svvi,.111},H}; -N l25n184[]={{sXm,.074},H}; -N l25n185[]={{sgp27,.333},{shipp,.247},{sgYi,.250},{szir,.111},H}; -N l25n187[]={{szX,.530},{srhs,.259},H}; -N l25n188[]={{sZsg,.194},H}; -N l25n189[]={{syv,.160},H}; -N l25n190[]={{swXg,.416},H}; -N l25n191[]={{ssr,.444},{sgyrg,.481},{s7am,.123},H}; -N l25n192[]={{sxx,.321},{sXzX,.370},{shh,.136},H}; -N l25n193[]={{sxi,.259},H}; -N l25n194[]={{szXrs,.197},{shXzX,.173},H}; -N l25n195[]={{srX,.432},{sgpig,.296},H}; -N l25n196[]={{sgwZ,.166},H}; -N l25n199[]={{svm,.641},{sipg,.444},{skr,.136},{shhy,.111},H}; -N l25n200[]={{sZlmg,.259},{sspX,.129},{sgl,.111},H}; -N l25n201[]={{spi,.370},{sxvX,.129},H}; -N l25n202[]={{ssmg,.222},{smrs,.111},H}; -N l25n203[]={{sxsg,.999},{sppXg,1.036},{sjX,.173},{srsrg,.444},{suyi,.185},{srxs,.129},H}; -N l25n204[]={{swxX,.166},H}; -N l25n205[]={{siv,.727},{sb3g,.250},H}; -N l25n206[]={{sqtX,.129},{slc3a9,.111},H}; -N l25n207[]={{siww,.166},H}; -N l25n209[]={{shi,.370},{sxy,.160},{sgjX,.305},{sgps,.222},H}; -N l25n210[]={{sXrs,.259},H}; -N l25n211[]={{spsg,.416},{sgtm,.222},H}; -N l25n212[]={{sXvm,.240},H}; -N l25n213[]={{shipg,.333},H}; -N l25n214[]={{sc3a9,.333},{sp27X,.203},H}; -N l25n215[]={{smg,2.404},{sYm,.111},H}; -N l25n217[]={{sgm,.925},{syrg,.361},{svmz,.111},H}; -N l25n218[]={{sgwi,.666},H}; -N l25n219[]={{sghi,.666},{shsg,.361},{syxx,.129},H}; -N l25n220[]={{sgp27X,.333},H}; -N l25n221[]={{sgmpg,.925},{sxXg,.388},H}; -N l25n222[]={{siw,.222},H}; -N l25n223[]={{sXg,4.439},{syx,.148},H}; -N l25n224[]={{syi,.148},{sc3b3g,.562},{siri,.148},H}; -N l25n226[]={{sgqs,.277},H}; -N l25n227[]={{svig,.971},{smp,.333},H}; -N l25n229[]={{spXg,1.415},{sZl,.567},{sxxsg,.481},H}; -N l25n230[]={{swm,.395},H}; -N l25n231[]={{swwi,.222},{stXv,.166},H}; -N l25n232[]={{sqi,.284},H}; -N l25n234[]={{s7amX,.129},{stmc3,.111},H}; -N l25n235[]={{sXp,.469},{sgZl,.694},{sixx,.129},H}; -N l25n236[]={{sXzi,.203},{sskp,.129},H}; -N l25n237[]={{shXg,.333},{sXwXg,.370},H}; -N l25n238[]={{svg,.351},H}; -N l25n239[]={{six,.222},{sts,.210},H}; -N l25n241[]={{slmg,.222},{sgxyv,.259},H}; -N l25n242[]={{sxyvm,.173},H}; -N l25n243[]={{sgrs,.499},{sgmrg,.518},H}; -N l25n245[]={{sgig,.749},{sgXp,.444},{sgvm,.305},H}; -N l25n246[]={{srh,.321},{sZm,.271},H}; -N l25n247[]={{sgZXw,.407},{sc3ba,.166},H}; -N l25n248[]={{sivX,.314},{sgwXr,.222},H}; -N l25n252[]={{sXq,.123},H}; -N l25n253[]={{sgtiv,.703},H}; -N l25n255[]={{szi,.382},H}; - -D l25_d = -{ +S sc3a9[] = { 195, 169, 0 }; +S sc3a9g[] = { 195, 169, a }; +S sc3b3[] = { 195, 179, 0 }; +S sc3b3g[] = { 195, 179, a }; +S smc3[] = { i, 195, 0 }; +S stmc3[] = { p, i, 195, 0 }; +S sc3a1g[] = { 195, 161, a }; +S sc3a1[] = { 195, 161, 0 }; +S sc3ba[] = { 195, 186, 0 }; +S smc3ba[] = { i, 195, 186, 0 }; +S slc3a9g[] = { h, 195, 169, a }; +S smc3bag[] = { i, 195, 186, a }; +S slc3a9[] = { h, 195, 169, 0 }; +S stmc3ba[] = { p, i, 195, 186, 0 }; +S sc3bag[] = { 195, 186, a }; + +N l25n0[] = { { sZsp, .222 }, { stt, .074 }, H }; +N l25n1[] = { { stX, .259 }, H }; +N l25n2[] = { { swig, .638 }, H }; +N l25n3[] = { { ssv, .432 }, H }; +N l25n4[] = { { ssZ, .160 }, { syrXg, .296 }, H }; +N l25n5[] = { { smr, .493 }, { sxm, .284 }, { ssqi, .203 }, { spps, .129 }, H }; +N l25n6[] = { { srx, .308 }, { sgwm, .527 }, { smhhy, .148 }, { shmw, .111 }, H }; +N l25n7[] = { { sghm, 1.165 }, { sri, .321 }, H }; +N l25n8[] = { { sXvig, .518 }, { sZZl, .203 }, { smc3bag, .222 }, H }; +N l25n9[] = { { sXrx, .148 }, H }; +N l25n11[] = { { sipp, .444 }, { sZsq, .277 }, { sgXr, .250 }, H }; +N l25n12[] = { { sgp, 1.017 }, H }; +N l25n13[] = { { sXr, .703 }, { spm, .419 }, { sgzi, .333 }, H }; +N l25n15[] = { { suyip, .173 }, H }; +N l25n17[] = { { srsg, .721 }, { siz, .222 }, { sziz, .111 }, H }; +N l25n19[] = { { svmh, .166 }, { sZZm, .111 }, H }; +N l25n20[] = { { ssw, .197 }, H }; +N l25n21[] = { { shm, .567 }, { sgts, .166 }, H }; +N l25n22[] = { { sms, .345 }, { sZsr, .148 }, H }; +N l25n24[] = { { swXr, .111 }, { stmc3ba, .148 }, H }; +N l25n26[] = { { sgZli, .814 }, H }; +N l25n27[] = { { szXg, .860 }, { srhsg, .370 }, H }; +N l25n29[] = { { sgq, .925 }, H }; +N l25n31[] = { { sghip, .740 }, { ssrg, .388 }, { sjy, .074 }, H }; +N l25n32[] = { { sXzXg, .555 }, H }; +N l25n33[] = { { sxig, .361 }, { srhX, .166 }, { sZmX, .129 }, H }; +N l25n34[] = { { stv, .148 }, H }; +N l25n35[] = { { srXg, .666 }, H }; +N l25n36[] = { { sivi, .129 }, H }; +N l25n37[] = { { ssx, .111 }, H }; +N l25n39[] = { { sgjXv, .259 }, { sskpm, .173 }, H }; +N l25n40[] = { { smX, .518 }, { skpm, .462 }, H }; +N l25n41[] = { { spig, .638 }, H }; +N l25n42[] = { { s27X, .185 }, H }; +N l25n43[] = { { stiv, .351 }, H }; +N l25n44[] = { { sqm, .160 }, H }; +N l25n45[] = { { svs, .185 }, { sivg, .388 }, H }; +N l25n46[] = { { sgr, .758 }, { sippX, .321 }, { ssvX, .148 }, { slc3a9g, .222 }, H }; +N l25n47[] = { { sXt, .099 }, H }; +N l25n48[] = { { smrX, .148 }, H }; +N l25n50[] = { { sXrsg, .518 }, H }; +N l25n52[] = { { spg, .925 }, { szizX, .148 }, H }; +N l25n54[] = { { sc3a9g, .749 }, { sgtv, .222 }, H }; +N l25n55[] = { { sgpX, .583 }, { s7aX, .086 }, H }; +N l25n56[] = { { sgZs, 1.027 }, { sXxs, .185 }, H }; +N l25n57[] = { { sgzm, .444 }, { sgXpp, .370 }, { sgmg, .222 }, H }; +N l25n58[] = { { sZsqi, .222 }, { sgwig, .296 }, H }; +N l25n60[] = { { sZli, .425 }, { sizX, .277 }, H }; +N l25n61[] = { { sgrsr, .481 }, H }; +N l25n63[] = { { svX, .567 }, { sgs, .185 }, { svmhh, .197 }, H }; +N l25n64[] = { { spp, .629 }, { syvm, .166 }, H }; +N l25n65[] = { { sspp, .129 }, H }; +N l25n66[] = { { sXpi, .185 }, H }; +N l25n67[] = { { smpg, .694 }, { szm, .271 }, { sZZlm, .247 }, H }; +N l25n68[] = { { sZspp, .173 }, H }; +N l25n69[] = { { sti, .407 }, { ssZZ, .148 }, H }; +N l25n70[] = { { swmg, .583 }, H }; +N l25n71[] = { { swwig, .333 }, H }; +N l25n72[] = { { sgqX, .610 }, { sqig, .333 }, { ssk, .123 }, H }; +N l25n73[] = { { sghs, .361 }, { smv, .099 }, H }; +N l25n74[] = { { smZ, .185 }, H }; +N l25n75[] = { { srm, .148 }, { syg, .166 }, H }; +N l25n76[] = { { sws, .160 }, H }; +N l25n77[] = { { sli, .284 }, { szsp, .111 }, H }; +N l25n78[] = { { sc3a1, .166 }, { sXziz, .148 }, H }; +N l25n79[] = { { sYX, .099 }, H }; +N l25n80[] = { { sgt, 1.147 }, H }; +N l25n81[] = { { sgX, 1.276 }, { sXv, .727 }, H }; +N l25n82[] = { { sXZ, .173 }, H }; +N l25n83[] = { { sjm, .136 }, H }; +N l25n85[] = { { sZZs, .148 }, H }; +N l25n87[] = { { syp, .136 }, { sc3bag, .375 }, H }; +N l25n88[] = { { sivXg, .518 }, H }; +N l25n89[] = { { sXrh, .333 }, { sgrX, .166 }, H }; +N l25n90[] = { { smw, .222 }, H }; +N l25n91[] = { { sig, 3.403 }, { smh, .148 }, { sgkp, .333 }, H }; +N l25n92[] = { { sZs, .654 }, H }; +N l25n93[] = { { swt, .086 }, H }; +N l25n94[] = { { swX, .370 }, { sqXr, .185 }, H }; +N l25n95[] = { { sgyr, .583 }, { sZXw, .203 }, H }; +N l25n96[] = { { svv, .123 }, { sghmw, .222 }, H }; +N l25n97[] = { { sgu, .425 }, { svZ, .086 }, H }; +N l25n98[] = { { sXw, .370 }, { sgY, .425 }, H }; +N l25n99[] = { { sXh, .173 }, { sgXz, .277 }, { sgpi, .250 }, H }; +N l25n101[] = { { smrg, .388 }, { sxmg, .333 }, { ssqig, .370 }, H }; +N l25n102[] = { { sgwmg, .481 }, H }; +N l25n103[] = { { sip, .555 }, { sghmg, .814 }, { srig, .416 }, H }; +N l25n104[] = { { sguy, .638 }, { sZlm, .296 }, H }; +N l25n106[] = { { ssm, .111 }, H }; +N l25n107[] = { { sxs, .543 }, { sppX, .555 }, { smx, .185 }, { srsr, .240 }, H }; +N l25n108[] = { { smi, .197 }, { sr7a, .099 }, { syvmh, .148 }, H }; +N l25n109[] = { { spmg, .416 }, H }; +N l25n110[] = { { sZX, .419 }, { s27i, .086 }, H }; +N l25n114[] = { { srg, .795 }, { sgv, .333 }, { skm, .086 }, H }; +N l25n115[] = { { sgZ, 1.776 }, { sXx, .284 }, { sps, .271 }, H }; +N l25n116[] = { { suy, .284 }, { sgqi, .250 }, H }; +N l25n117[] = { { shmg, .610 }, { ship, .370 }, { szXr, .166 }, H }; +N l25n118[] = { { smsg, .638 }, H }; +N l25n120[] = { { siq, .086 }, H }; +N l25n121[] = { { syr, .271 }, { stvi, .129 }, H }; +N l25n123[] = { { shs, .456 }, { sgtX, .277 }, { sgzs, .277 }, { sgiv, .222 }, H }; +N l25n124[] = { { sgZsp, .407 }, { sXrhX, .222 }, H }; +N l25n125[] = { { sxX, .419 }, { sgmp, .694 }, H }; +N l25n127[] = { { sgZsq, .555 }, { sgwx, .277 }, H }; +N l25n128[] = { { swZ, .197 }, { sc3b3, .250 }, H }; +N l25n130[] = { { sZXwX, .247 }, { sgyrX, .259 }, { svx, .074 }, { sgZsr, .222 }, { syXrh, .148 }, H }; +N l25n131[] = { { sgw, 1.776 }, { svi, .629 }, H }; +N l25n132[] = { { sgh, 1.720 }, { syip, .148 }, H }; +N l25n133[] = { { spX, .801 }, { sxxs, .277 }, { sgri, .305 }, { sirx, .185 }, H }; +N l25n136[] = { { smXg, .721 }, { skpmg, .518 }, { swiv, .148 }, H }; +N l25n137[] = { { sir, .419 }, { stm, .136 }, H }; +N l25n138[] = { { sgwy, .416 }, { sys, .148 }, H }; +N l25n139[] = { { stivg, .518 }, { sguyX, .481 }, H }; +N l25n141[] = { { shX, .395 }, { sXwX, .185 }, { smz, .111 }, H }; +N l25n142[] = { { smk, .136 }, H }; +N l25n143[] = { { sXpp, .277 }, H }; +N l25n144[] = { { sZZ, .358 }, { sww, .234 }, H }; +N l25n145[] = { { ssg, 2.774 }, { slm, .210 }, H }; +N l25n146[] = { { sqs, .185 }, { sgXzi, .296 }, H }; +N l25n147[] = { { sgmr, .444 }, { sYi, .148 }, { sXZZ, .203 }, H }; +N l25n148[] = { { sgx, .333 }, H }; +N l25n149[] = { { sgi, .703 }, { sXz, .469 }, H }; +N l25n150[] = { { sgkpm, .444 }, H }; +N l25n151[] = { { sgpXg, .629 }, { sa9g, .333 }, { sguyi, .370 }, H }; +N l25n152[] = { { sXxsg, .333 }, H }; +N l25n155[] = { { sgxy, .305 }, H }; +N l25n156[] = { { sZlig, .851 }, { syX, .197 }, { sizXg, .444 }, H }; +N l25n157[] = { { ssp, .370 }, { sgXh, .194 }, H }; +N l25n158[] = { { sgZX, .638 }, { sxv, .185 }, { sgivX, .296 }, H }; +N l25n159[] = { { svXg, .666 }, { suyX, .240 }, { shXz, .129 }, { sa1g, .166 }, H }; +N l25n161[] = { { swx, .308 }, H }; +N l25n162[] = { { swi, .530 }, { sXpig, .333 }, H }; +N l25n163[] = { { sqt, .160 }, H }; +N l25n164[] = { { sqX, .382 }, { syrX, .148 }, { svz, .086 }, H }; +N l25n165[] = { { skp, .308 }, { sgy, .444 }, H }; +N l25n166[] = { { sgj, .518 }, { sXrhs, .222 }, { sbag, .166 }, H }; +N l25n167[] = { { sgti, .721 }, { smhh, .148 }, H }; +N l25n168[] = { { sXvi, .277 }, { smc3ba, .111 }, H }; +N l25n169[] = { { szs, .247 }, H }; +N l25n170[] = { { smc3, .086 }, H }; +N l25n171[] = { { sp27, .210 }, H }; +N l25n172[] = { { swsg, .194 }, H }; +N l25n173[] = { { slig, .638 }, H }; +N l25n174[] = { { ssq, .284 }, { sgwX, .305 }, { sc3a1g, .375 }, H }; +N l25n175[] = { { sghX, .305 }, H }; +N l25n177[] = { { srs, .580 }, { sgXg, .416 }, { sjXv, .166 }, H }; +N l25n178[] = { { swy, .185 }, { sZi, .148 }, { sXppX, .173 }, H }; +N l25n182[] = { { sgz, .777 }, H }; +N l25n183[] = { { sgk, .370 }, { sxyv, .129 }, { svvi, .111 }, H }; +N l25n184[] = { { sXm, .074 }, H }; +N l25n185[] = { { sgp27, .333 }, { shipp, .247 }, { sgYi, .250 }, { szir, .111 }, H }; +N l25n187[] = { { szX, .530 }, { srhs, .259 }, H }; +N l25n188[] = { { sZsg, .194 }, H }; +N l25n189[] = { { syv, .160 }, H }; +N l25n190[] = { { swXg, .416 }, H }; +N l25n191[] = { { ssr, .444 }, { sgyrg, .481 }, { s7am, .123 }, H }; +N l25n192[] = { { sxx, .321 }, { sXzX, .370 }, { shh, .136 }, H }; +N l25n193[] = { { sxi, .259 }, H }; +N l25n194[] = { { szXrs, .197 }, { shXzX, .173 }, H }; +N l25n195[] = { { srX, .432 }, { sgpig, .296 }, H }; +N l25n196[] = { { sgwZ, .166 }, H }; +N l25n199[] = { { svm, .641 }, { sipg, .444 }, { skr, .136 }, { shhy, .111 }, H }; +N l25n200[] = { { sZlmg, .259 }, { sspX, .129 }, { sgl, .111 }, H }; +N l25n201[] = { { spi, .370 }, { sxvX, .129 }, H }; +N l25n202[] = { { ssmg, .222 }, { smrs, .111 }, H }; +N l25n203[] = { { sxsg, .999 }, { sppXg, 1.036 }, { sjX, .173 }, { srsrg, .444 }, { suyi, .185 }, { srxs, .129 }, H }; +N l25n204[] = { { swxX, .166 }, H }; +N l25n205[] = { { siv, .727 }, { sb3g, .250 }, H }; +N l25n206[] = { { sqtX, .129 }, { slc3a9, .111 }, H }; +N l25n207[] = { { siww, .166 }, H }; +N l25n209[] = { { shi, .370 }, { sxy, .160 }, { sgjX, .305 }, { sgps, .222 }, H }; +N l25n210[] = { { sXrs, .259 }, H }; +N l25n211[] = { { spsg, .416 }, { sgtm, .222 }, H }; +N l25n212[] = { { sXvm, .240 }, H }; +N l25n213[] = { { shipg, .333 }, H }; +N l25n214[] = { { sc3a9, .333 }, { sp27X, .203 }, H }; +N l25n215[] = { { smg, 2.404 }, { sYm, .111 }, H }; +N l25n217[] = { { sgm, .925 }, { syrg, .361 }, { svmz, .111 }, H }; +N l25n218[] = { { sgwi, .666 }, H }; +N l25n219[] = { { sghi, .666 }, { shsg, .361 }, { syxx, .129 }, H }; +N l25n220[] = { { sgp27X, .333 }, H }; +N l25n221[] = { { sgmpg, .925 }, { sxXg, .388 }, H }; +N l25n222[] = { { siw, .222 }, H }; +N l25n223[] = { { sXg, 4.439 }, { syx, .148 }, H }; +N l25n224[] = { { syi, .148 }, { sc3b3g, .562 }, { siri, .148 }, H }; +N l25n226[] = { { sgqs, .277 }, H }; +N l25n227[] = { { svig, .971 }, { smp, .333 }, H }; +N l25n229[] = { { spXg, 1.415 }, { sZl, .567 }, { sxxsg, .481 }, H }; +N l25n230[] = { { swm, .395 }, H }; +N l25n231[] = { { swwi, .222 }, { stXv, .166 }, H }; +N l25n232[] = { { sqi, .284 }, H }; +N l25n234[] = { { s7amX, .129 }, { stmc3, .111 }, H }; +N l25n235[] = { { sXp, .469 }, { sgZl, .694 }, { sixx, .129 }, H }; +N l25n236[] = { { sXzi, .203 }, { sskp, .129 }, H }; +N l25n237[] = { { shXg, .333 }, { sXwXg, .370 }, H }; +N l25n238[] = { { svg, .351 }, H }; +N l25n239[] = { { six, .222 }, { sts, .210 }, H }; +N l25n241[] = { { slmg, .222 }, { sgxyv, .259 }, H }; +N l25n242[] = { { sxyvm, .173 }, H }; +N l25n243[] = { { sgrs, .499 }, { sgmrg, .518 }, H }; +N l25n245[] = { { sgig, .749 }, { sgXp, .444 }, { sgvm, .305 }, H }; +N l25n246[] = { { srh, .321 }, { sZm, .271 }, H }; +N l25n247[] = { { sgZXw, .407 }, { sc3ba, .166 }, H }; +N l25n248[] = { { sivX, .314 }, { sgwXr, .222 }, H }; +N l25n252[] = { { sXq, .123 }, H }; +N l25n253[] = { { sgtiv, .703 }, H }; +N l25n255[] = { { szi, .382 }, H }; + +D l25_d = { "italian", "utf8", - { - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,0.001,0.017,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,0.271,0.021,0.102,0.085,0.203,0.020,0.030,0.028,0.194,W,W,0.141,0.052,0.122,0.170, - 0.052,0.011,0.121,0.104,0.091,0.061,0.060,W,W,W,0.010,W,W,W,W,W, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - Y,0.004,Y,Y,Y,Y,Y,Y,Y,0.009,Y,Y,Y,0.001,Y,Y, - Y,Y,Y,0.007,Y,Y,Y,Y,Y,Y,0.004,Y,Y,Y,Y,Y, - Y,V,V,0.039,V,V,V,V,V,V,V,V,V,V,V,V, - V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V, - V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V, - V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V - }, - { - l25n0,l25n1,l25n2,l25n3,l25n4,l25n5,l25n6,l25n7,l25n8,l25n9,X,l25n11,l25n12,l25n13,X,l25n15, - X,l25n17,X,l25n19,l25n20,l25n21,l25n22,X,l25n24,X,l25n26,l25n27,X,l25n29,X,l25n31, - l25n32,l25n33,l25n34,l25n35,l25n36,l25n37,X,l25n39,l25n40,l25n41,l25n42,l25n43,l25n44,l25n45,l25n46,l25n47, - l25n48,X,l25n50,X,l25n52,X,l25n54,l25n55,l25n56,l25n57,l25n58,X,l25n60,l25n61,X,l25n63, - l25n64,l25n65,l25n66,l25n67,l25n68,l25n69,l25n70,l25n71,l25n72,l25n73,l25n74,l25n75,l25n76,l25n77,l25n78,l25n79, - l25n80,l25n81,l25n82,l25n83,X,l25n85,X,l25n87,l25n88,l25n89,l25n90,l25n91,l25n92,l25n93,l25n94,l25n95, - l25n96,l25n97,l25n98,l25n99,X,l25n101,l25n102,l25n103,l25n104,X,l25n106,l25n107,l25n108,l25n109,l25n110,X, - X,X,l25n114,l25n115,l25n116,l25n117,l25n118,X,l25n120,l25n121,X,l25n123,l25n124,l25n125,X,l25n127, - l25n128,X,l25n130,l25n131,l25n132,l25n133,X,X,l25n136,l25n137,l25n138,l25n139,X,l25n141,l25n142,l25n143, - l25n144,l25n145,l25n146,l25n147,l25n148,l25n149,l25n150,l25n151,l25n152,X,X,l25n155,l25n156,l25n157,l25n158,l25n159, - X,l25n161,l25n162,l25n163,l25n164,l25n165,l25n166,l25n167,l25n168,l25n169,l25n170,l25n171,l25n172,l25n173,l25n174,l25n175, - X,l25n177,l25n178,X,X,X,l25n182,l25n183,l25n184,l25n185,X,l25n187,l25n188,l25n189,l25n190,l25n191, - l25n192,l25n193,l25n194,l25n195,l25n196,X,X,l25n199,l25n200,l25n201,l25n202,l25n203,l25n204,l25n205,l25n206,l25n207, - X,l25n209,l25n210,l25n211,l25n212,l25n213,l25n214,l25n215,X,l25n217,l25n218,l25n219,l25n220,l25n221,l25n222,l25n223, - l25n224,X,l25n226,l25n227,X,l25n229,l25n230,l25n231,l25n232,X,l25n234,l25n235,l25n236,l25n237,l25n238,l25n239, - X,l25n241,l25n242,l25n243,X,l25n245,l25n246,l25n247,l25n248,X,X,X,l25n252,l25n253,X,l25n255 - } + { W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, 0.001, 0.017, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, 0.271, 0.021, 0.102, 0.085, 0.203, 0.020, 0.030, 0.028, 0.194, W, W, 0.141, 0.052, 0.122, 0.170, + 0.052, 0.011, 0.121, 0.104, 0.091, 0.061, 0.060, W, W, W, 0.010, W, W, W, W, W, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + Y, 0.004, Y, Y, Y, Y, Y, Y, Y, 0.009, Y, Y, Y, 0.001, Y, Y, + Y, Y, Y, 0.007, Y, Y, Y, Y, Y, Y, 0.004, Y, Y, Y, Y, Y, + Y, V, V, 0.039, V, V, V, V, V, V, V, V, V, V, V, V, + V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, + V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, + V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, V }, + { l25n0, l25n1, l25n2, l25n3, l25n4, l25n5, l25n6, l25n7, l25n8, l25n9, X, l25n11, l25n12, l25n13, X, l25n15, + X, l25n17, X, l25n19, l25n20, l25n21, l25n22, X, l25n24, X, l25n26, l25n27, X, l25n29, X, l25n31, + l25n32, l25n33, l25n34, l25n35, l25n36, l25n37, X, l25n39, l25n40, l25n41, l25n42, l25n43, l25n44, l25n45, l25n46, l25n47, + l25n48, X, l25n50, X, l25n52, X, l25n54, l25n55, l25n56, l25n57, l25n58, X, l25n60, l25n61, X, l25n63, + l25n64, l25n65, l25n66, l25n67, l25n68, l25n69, l25n70, l25n71, l25n72, l25n73, l25n74, l25n75, l25n76, l25n77, l25n78, l25n79, + l25n80, l25n81, l25n82, l25n83, X, l25n85, X, l25n87, l25n88, l25n89, l25n90, l25n91, l25n92, l25n93, l25n94, l25n95, + l25n96, l25n97, l25n98, l25n99, X, l25n101, l25n102, l25n103, l25n104, X, l25n106, l25n107, l25n108, l25n109, l25n110, X, + X, X, l25n114, l25n115, l25n116, l25n117, l25n118, X, l25n120, l25n121, X, l25n123, l25n124, l25n125, X, l25n127, + l25n128, X, l25n130, l25n131, l25n132, l25n133, X, X, l25n136, l25n137, l25n138, l25n139, X, l25n141, l25n142, l25n143, + l25n144, l25n145, l25n146, l25n147, l25n148, l25n149, l25n150, l25n151, l25n152, X, X, l25n155, l25n156, l25n157, l25n158, l25n159, + X, l25n161, l25n162, l25n163, l25n164, l25n165, l25n166, l25n167, l25n168, l25n169, l25n170, l25n171, l25n172, l25n173, l25n174, l25n175, + X, l25n177, l25n178, X, X, X, l25n182, l25n183, l25n184, l25n185, X, l25n187, l25n188, l25n189, l25n190, l25n191, + l25n192, l25n193, l25n194, l25n195, l25n196, X, X, l25n199, l25n200, l25n201, l25n202, l25n203, l25n204, l25n205, l25n206, l25n207, + X, l25n209, l25n210, l25n211, l25n212, l25n213, l25n214, l25n215, X, l25n217, l25n218, l25n219, l25n220, l25n221, l25n222, l25n223, + l25n224, X, l25n226, l25n227, X, l25n229, l25n230, l25n231, l25n232, X, l25n234, l25n235, l25n236, l25n237, l25n238, l25n239, + X, l25n241, l25n242, l25n243, X, l25n245, l25n246, l25n247, l25n248, X, X, X, l25n252, l25n253, X, l25n255 } }; - - // // Lng: japanese // Enc: euc_jp // - -S sa1bc[]={161,188,0}; -S sa4ce[]={164,206,0}; -S sbca5[]={188,165,0}; -S sa1bca5[]={161,188,165,0}; -S sa4eb[]={164,235,0}; -S saca7[]={172,167,0}; -S sa4cb[]={164,203,0}; -S sbfae[]={191,174,0}; -S sa1a4[]={161,164,0}; -S sa5b9[]={165,185,0}; -S sa4cf[]={164,207,0}; -S seca4[]={236,164,0}; -S sa4ec[]={164,236,0}; -S seba1[]={235,161,0}; -S sa4eca4[]={164,236,164,0}; -S sa5c3[]={165,195,0}; -S sc3a5[]={195,165,0}; -S sa5c3a5[]={165,195,165,0}; -S sa1a5[]={161,165,0}; -S sa4c8[]={164,200,0}; -S sa4b7[]={164,183,0}; -S sa5b8[]={165,184,0}; -S sa4f2[]={164,242,0}; -S sa4c6[]={164,198,0}; -S sa4bf[]={164,191,0}; -S sc8a4[]={200,164,0}; -S sa4c7[]={164,199,0}; -S sa4ca[]={164,202,0}; -S sa4eba1[]={164,235,161,0}; -S sc7a4[]={199,164,0}; -S sa4eba1a3[]={164,235,161,163,0}; -S seba1a3[]={235,161,163,0}; -S sb5a1[]={181,161,0}; -S sa5f3[]={165,243,0}; -S seba1a3g[]={235,161,163,a}; -S sa4b9[]={164,185,0}; -S sDa5[]={211,165,0}; -S sa4ac[]={164,172,0}; -S sa4b9a4[]={164,185,164,0}; -S sa4b9a4eb[]={164,185,164,235,0}; -S sb9a4eb[]={185,164,235,0}; -S sa4b5a4[]={164,181,164,0}; -S sa5f3a5[]={165,243,165,0}; -S sbcE[]={188,212,0}; -S sa4b7a4[]={164,183,164,0}; -S sa4b5a4ec[]={164,181,164,236,0}; -S sb7a4[]={183,164,0}; -S sb5a4ec[]={181,164,236,0}; -S sb5a4eca4[]={181,164,236,164,0}; -S sf3a5[]={243,165,0}; -S sa3cd[]={163,205,0}; -S sa4b5[]={164,181,0}; -S sb5a4[]={181,164,0}; -S sbca5b8[]={188,165,184,0}; -S sa5bf[]={165,191,0}; -S sa5D[]={165,211,0}; -S sa1bca5b8[]={161,188,165,184,0}; -S sRa5[]={225,165,0}; -S se8a4[]={232,164,0}; -S saca7a3[]={172,167,163,0}; -S sa5Da5[]={165,211,165,0}; -S sa7a3[]={167,163,0}; -S sa5a3[]={165,163,0}; -S sEa4[]={212,164,0}; -S sa5Ra5[]={165,225,165,0}; -S sa4a5[]={164,165,0}; -S sa5c8[]={165,200,0}; -S sa5R[]={165,225,0}; -S sbfa4[]={191,164,0}; -S scaa4[]={202,164,0}; -S sa5b5[]={165,181,0}; -S sa5bba1[]={165,187,161,0}; -S sa5c3a5bb[]={165,195,165,187,0}; -S sa4c8a4[]={164,200,164,0}; -S sRa5c3[]={225,165,195,0}; -S sc3a5bba1[]={195,165,187,161,0}; -S sc3a5bb[]={195,165,187,0}; -S sbba1bca5[]={187,161,188,165,0}; -S sa5Ra5c3[]={165,225,165,195,0}; -S sa5bba1bc[]={165,187,161,188,0}; -S sbba1[]={187,161,0}; -S sRa5c3a5[]={225,165,195,165,0}; -S sbba1bc[]={187,161,188,0}; -S sb5a1bc[]={181,161,188,0}; -S sbca5D[]={188,165,211,0}; -S scba4[]={203,164,0}; -S sDa5b9[]={211,165,185,0}; -S sb5a1bca5[]={181,161,188,165,0}; -S sa5af[]={165,175,0}; -S sbcEa4[]={188,212,164,0}; -S sa4a4a4[]={164,164,164,0}; -S sa4c7a4[]={164,199,164,0}; -S sa1bca5D[]={161,188,165,211,0}; -S sa5b5a1[]={165,181,161,0}; -S sa5Da5b9[]={165,211,165,185,0}; -S sbca5Da5[]={188,165,211,165,0}; -S sa5b5a1bc[]={165,181,161,188,0}; -S sa4eca4eb[]={164,236,164,235,0}; -S sa5a4a5[]={165,164,165,0}; -S sa1a5g[]={161,165,a}; -S sa5a4[]={165,164,0}; -S sa3c1[]={163,193,0}; -S sa4bfa4[]={164,191,164,0}; -S seca4eb[]={236,164,235,0}; -S sa5eb[]={165,235,0}; -S sa4caa4[]={164,202,164,0}; -S seba5[]={235,165,0}; -S sgaca7[]={32,172,167,0}; -S sa3cda3[]={163,205,163,0}; -S sa4e8a4[]={164,232,164,0}; -S sa4cba4[]={164,203,164,0}; -S scda3[]={205,163,0}; -S sa4e8[]={164,232,0}; -S sa5ea[]={165,234,0}; -S seba4[]={235,164,0}; -S sa4eba4[]={164,235,164,0}; -S sf5bf[]={245,191,0}; -S sbcf5[]={188,245,0}; -S sbcf5bf[]={188,245,191,0}; -S sbcf5bfae[]={188,245,191,174,0}; -S sc6a4[]={198,164,0}; -S sf5bfae[]={245,191,174,0}; -S saca7g[]={172,167,a}; -S scdfd[]={205,253,0}; -S scdH[]={205,215,0}; -S sbfa5[]={191,165,0}; -S safa5[]={175,165,0}; -S scfa1[]={207,161,0}; -S sa5afa5[]={165,175,165,0}; -S sc6a1[]={198,161,0}; -S sa4b3a4[]={164,179,164,0}; -S sb8a4[]={184,164,0}; -S sc9bd[]={201,189,0}; -S sb9e7[]={185,231,0}; -S sa4b3[]={164,179,0}; -S sc6a5[]={198,165,0}; -S sa4c6a4[]={164,198,164,0}; -S saebcE[]={174,188,212,0}; -S sa5c6[]={165,198,0}; -S saea4[]={174,164,0}; -S sa2a4[]={162,164,0}; -S saebc[]={174,188,0}; -S sbfaebc[]={191,174,188,0}; -S scea4[]={206,164,0}; -S sb8a5[]={184,165,0}; -S sa5c6a5[]={165,198,165,0}; -S sbfaebcE[]={191,174,188,212,0}; -S sa1ca[]={161,202,0}; -S saaa4[]={170,164,0}; -S sa5b8a5[]={165,184,165,0}; -S sa5b9a4[]={165,185,164,0}; -S sa5ec[]={165,236,0}; -S sb7a4c6[]={183,164,198,0}; -S sa5c7[]={165,199,0}; -S sa5b7a5[]={165,183,165,0}; -S scfa1a4[]={207,161,164,0}; -S sccbf[]={204,191,0}; -S saca7ac[]={172,167,172,0}; -S sada4[]={173,164,0}; -S sa5b7[]={165,183,0}; -S sa3A[]={163,208,0}; -S sa5bfa5[]={165,191,165,0}; -S sa4cfa1a4[]={164,207,161,164,0}; -S sa7aca7[]={167,172,167,0}; -S sa4b7a4c6[]={164,183,164,198,0}; -S sbda4[]={189,164,0}; -S sb7a5[]={183,165,0}; -S saca7aca7[]={172,167,172,167,0}; -S sa7ac[]={167,172,0}; -S sa4cfa1[]={164,207,161,0}; -S sa4a2[]={164,162,0}; -S sa3c2a1[]={163,194,161,0}; -S sAa3[]={208,163,0}; -S sFa5[]={213,165,0}; -S scdf8cd[]={205,248,205,0}; -S sa4aa[]={164,170,0}; -S sa1cb[]={161,203,0}; -S sa8a4[]={168,164,0}; -S scdf8[]={205,248,0}; -S sa3Aa3[]={163,208,163,0}; -S sb9a5[]={185,165,0}; -S scdf8cdB[]={205,248,205,209,0}; -S sc7L[]={199,219,0}; -S seaa1[]={234,161,0}; -S sbde8[]={189,232,0}; -S saebcEa4[]={174,188,212,164,0}; -S sccbfae[]={204,191,174,0}; -S sf8cdB[]={248,205,209,0}; -S scea5[]={206,165,0}; -S sa5F[]={165,213,0}; -S sc4ccbfae[]={196,204,191,174,0}; -S sc4ccbf[]={196,204,191,0}; -S sa4a5f3[]={164,165,243,0}; -S sa1a5a3[]={161,165,163,0}; -S sa3c2[]={163,194,0}; -S sa5H[]={165,215,0}; -S sa5eca5[]={165,236,165,0}; -S sa5Fa5[]={165,213,165,0}; -S seca5[]={236,165,0}; -S sa4a2a4[]={164,162,164,0}; -S sa5a4a5f3[]={165,164,165,243,0}; -S sGa4[]={214,164,0}; -S sc2a1[]={194,161,0}; -S sbca8[]={188,168,0}; -S seaa5[]={234,165,0}; -S sa4a5f3a5[]={164,165,243,165,0}; -S sa5b9a5[]={165,185,165,0}; -S sf8cd[]={248,205,0}; -S sa3F[]={163,213,0}; -S sa4aaa4[]={164,170,164,0}; -S sb9a4eba1[]={185,164,235,161,0}; -S sbde8cdfd[]={189,232,205,253,0}; -S sf5bfaebc[]={245,191,174,188,0}; -S sb9cd[]={185,205,0}; -S sBbcE[]={209,188,212,0}; -S scdHc1c7[]={205,215,193,199,0}; -S sf8cdBbc[]={248,205,209,188,0}; -S sbca5b8a4[]={188,165,184,164,0}; -S sa3c2a1a5[]={163,194,161,165,0}; -S sa5c9[]={165,201,0}; -S sa4b7a4bf[]={164,183,164,191,0}; -S sc2a1a5[]={194,161,165,0}; -S sc4a4[]={196,164,0}; -S sOa4[]={222,164,0}; -S sa4a6[]={164,166,0}; -S sa4c7a4a2[]={164,199,164,162,0}; -S sabb9[]={171,185,0}; -S sb7a4bf[]={183,164,191,0}; -S sa5N[]={165,221,0}; -S sbde8cd[]={189,232,205,0}; -S sc0ae[]={192,174,0}; -S sc7a4a2a4[]={199,164,162,164,0}; -S sHa5[]={215,165,0}; -S sa4eba5[]={164,235,165,0}; -S sHc1[]={215,193,0}; -S sBbc[]={209,188,0}; -S scdBbcE[]={205,209,188,212,0}; -S se8cd[]={232,205,0}; -S scdBbc[]={205,209,188,0}; -S sa5Ha5[]={165,215,165,0}; -S scdHc1[]={205,215,193,0}; -S sHc1c7[]={215,193,199,0}; -S sc7a4a2[]={199,164,162,0}; -S sc1c7[]={193,199,0}; -S sa5b8a4[]={165,184,164,0}; -S sb9f0[]={185,240,0}; -S sb4abb9[]={180,171,185,0}; -S sa4cea5[]={164,206,165,0}; -S sb4abb9f0[]={180,171,185,240,0}; -S sa5eaa5[]={165,234,165,0}; -S seaa4[]={234,164,0}; -S sc8af[]={200,175,0}; -S sc3a4[]={195,164,0}; -S sAa5[]={208,165,0}; -S sb4ab[]={180,171,0}; -S se8cdfd[]={232,205,253,0}; -S sabb9f0[]={171,185,240,0}; -S sa5c8a4[]={165,200,164,0}; -S sbfa3[]={191,163,0}; -S sa4ea[]={164,234,0}; -S sDa5b9cd[]={211,165,185,205,0}; -S sc1a4[]={193,164,0}; -S sa3c8[]={163,200,0}; -S sa4c6a4a4[]={164,198,164,164,0}; -S sbfaea4[]={191,174,164,0}; -S sa3Fa3[]={163,213,163,0}; -S saca4[]={172,164,0}; -S sf3a5bf[]={243,165,191,0}; -S sa4ada4[]={164,173,164,0}; -S sc6b0[]={198,176,0}; -S sa3c9[]={163,201,0}; -S sa5c7a5[]={165,199,165,0}; -S sa2a4eb[]={162,164,235,0}; -S sJa4[]={217,164,0}; -S sFa3[]={213,163,0}; -S sc6a4a4[]={198,164,164,0}; -S sa3a5[]={163,165,0}; -S sga4b3[]={32,164,179,0}; -S sc1f7[]={193,247,0}; -S sa4caa4a4[]={164,202,164,164,0}; -S sb9a4eba4[]={185,164,235,164,0}; -S sc6a4a4a4[]={198,164,164,164,0}; -S scaa4a4[]={202,164,164,0}; -S sc8a3[]={200,163,0}; -S sa5b9cdH[]={165,185,205,215,0}; -S sb9cdHc1[]={185,205,215,193,0}; -S sc7a5[]={199,165,0}; -S sb9cdH[]={185,205,215,0}; -S sga4b3a4[]={32,164,179,164,0}; -S sc1c7a4[]={193,199,164,0}; -S sHc1c7a4[]={215,193,199,164,0}; -S sa4e9a4[]={164,233,164,0}; -S sa4cea4[]={164,206,164,0}; -S sa5f3a5bf[]={165,243,165,191,0}; -S sa5a3a5[]={165,163,165,0}; -S sa3D[]={163,211,0}; -S sa3c4[]={163,196,0}; -S se9a4[]={233,164,0}; -S sa5b9cd[]={165,185,205,0}; -S scaa5[]={202,165,0}; -S sa4a2a4eb[]={164,162,164,235,0}; -S sa4a4eb[]={164,164,235,0}; -S scba3[]={203,163,0}; -S sa4cba4e8[]={164,203,164,232,0}; -S sc8afbf[]={200,175,191,0}; -S sc9bdbca8[]={201,189,188,168,0}; -S saca7a3c2[]={172,167,163,194,0}; -S sa5a2[]={165,162,0}; -S sa5a2a5[]={165,162,165,0}; -S sb8c4[]={184,196,0}; -S sf3a5c8[]={243,165,200,0}; -S sa4cfg[]={164,207,a}; -S safbf[]={175,191,0}; -S sa4c6a1[]={164,198,161,0}; -S sa5Aa5[]={165,208,165,0}; -S sa5A[]={165,208,0}; -S sa7a3c2a1[]={167,163,194,161,0}; -S seba1bc[]={235,161,188,0}; -S sf5c2[]={245,194,0}; -S sFa3c1[]={213,163,193,0}; -S sNa5[]={221,165,0}; -S sa4c3a4[]={164,195,164,0}; -S sa3c9a3A[]={163,201,163,208,0}; -S sa7aca7ac[]={167,172,167,172,0}; -S sa5c3a5af[]={165,195,165,175,0}; -S sa2a5[]={162,165,0}; -S sa3c6a1[]={163,198,161,0}; -S scca4[]={204,164,0}; -S scba4e8a4[]={203,164,232,164,0}; -S sc9a3[]={201,163,0}; -S sbdbc[]={189,188,0}; -S sa5eba5[]={165,235,165,0}; -S sc1ac[]={193,172,0}; -S sc3a5af[]={195,165,175,0}; -S sc7bd[]={199,189,0}; -S sa5c7a5a3[]={165,199,165,163,0}; -S sa2a4eba1[]={162,164,235,161,0}; -S sc6a1a5g[]={198,161,165,a}; -S scfa4[]={207,164,0}; -S sc8afbfae[]={200,175,191,174,0}; -S sc6a1a5[]={198,161,165,0}; -S sa1bf[]={161,191,0}; -S sa5a7[]={165,167,0}; -S sa4c3[]={164,195,0}; -S seba1bca5[]={235,161,188,165,0}; -S sa3c1ac[]={163,193,172,0}; -S sc1aca7[]={193,172,167,0}; -S safbfae[]={175,191,174,0}; -S sf5c2G[]={245,194,214,0}; -S sbef5c2[]={190,245,194,0}; -S sbef5[]={190,245,0}; -S sbca8a4[]={188,168,164,0}; -S sa3Fa3c1[]={163,213,163,193,0}; -S sa1bca5H[]={161,188,165,215,0}; -S sa3c1aca7[]={163,193,172,167,0}; -S sa7a1[]={167,161,0}; -S sc9bdbc[]={201,189,188,0}; -S scba4e8[]={203,164,232,0}; -S sDa5b9a4[]={211,165,185,164,0}; -S sa5f3a5c8[]={165,243,165,200,0}; -S sbca5H[]={188,165,215,0}; -S sc6a1a4[]={198,161,164,0}; -S sbef5c2G[]={190,245,194,214,0}; -S sa4Oa4[]={164,222,164,0}; -S sa4a4a4eb[]={164,164,164,235,0}; -S sc2G[]={194,214,0}; -S sc9a3A[]={201,163,208,0}; -S sa7a3c2[]={167,163,194,0}; -S sa3E[]={163,212,0}; -S sa1bfa3[]={161,191,163,0}; -S sb7a4bfa4[]={183,164,191,164,0}; -S sBbcEa4[]={209,188,212,164,0}; -S sa5eba1bc[]={165,235,161,188,0}; -S sa4O[]={164,222,0}; -S sa4c6a1a4[]={164,198,161,164,0}; -S sc1aca7a3[]={193,172,167,163,0}; -S sc7a4ce[]={199,164,206,0}; -S sbdbca8[]={189,188,168,0}; - -N l26n0[]={{sa5b5,.292},H}; -N l26n2[]={{sa4c6,.422},{scacc,.146},H}; -N l26n3[]={{sa4b7,.438},{sa5Ra5,.438},{sAa3,.219},H}; -N l26n4[]={{sb9cd,.130},H}; -N l26n5[]={{sa5c3a5,.706},{sbfa4,.292},{sa4c7a4a2,.260},{sa3c8,.114},H}; -N l26n7[]={{seaa1,.219},H}; -N l26n8[]={{sf5bfaebc,.389},H}; -N l26n9[]={{sbcf5,.211},H}; -N l26n11[]={{sc8a3,.170},H}; -N l26n12[]={{sa7a3,.308},{sc8afbf,.219},H}; -N l26n13[]={{sb7a4,.324},H}; -N l26n14[]={{sa4c6a4,.292},{sc7a5,.170},H}; -N l26n15[]={{sa4b7a4,.487},H}; -N l26n17[]={{sbde8cdfd,.260},H}; -N l26n18[]={{sa1bca5,1.630},{sa5c3a5af,.195},{sa5a7,.097},H}; -N l26n19[]={{sa4c7,.406},{sa5b9cd,.170},H}; -N l26n21[]={{sa5Da5,.462},H}; -N l26n22[]={{sbfa5,.211},{sa3c9,.114},{sc8afbfae,.292},H}; -N l26n23[]={{sc3a5af,.219},H}; -N l26n26[]={{scdH,.316},{scdf8cd,.329},{sbde8cd,.195},{sb4abb9,.195},{sc9a3A,.219},H}; -N l26n27[]={{sa5g,.365},{se9a4,.170},{sa4cba4e8,.195},H}; -N l26n28[]={{sc8a4,.608},H}; -N l26n30[]={{sa5f3,.373},{sb7a5,.162},H}; -N l26n31[]={{sa4c7a4,.389},{sa5b5a1bc,.519},{sbef5c2G,.195},H}; -N l26n32[]={{sa5F,.146},H}; -N l26n33[]={{sa5c6,.178},H}; -N l26n34[]={{sa5b7,.162},{sc6a1a5g,.438},H}; -N l26n36[]={{sa4c8,.454},H}; -N l26n37[]={{sa4b9,.357},{sAa5,.195},H}; -N l26n38[]={{seba1,.730},{safa5,.195},{sa4aa,.146},{sa3Fa3c1,.195},H}; -N l26n39[]={{seba1a3,.840},{sb4ab,.130},H}; -N l26n41[]={{seba1bca5,.292},H}; -N l26n42[]={{sc9a3,.146},H}; -N l26n43[]={{sJa4,.170},H}; -N l26n44[]={{sb8a4,.195},{sxg,.114},H}; -N l26n46[]={{sa1bf,.097},{sb7a4bfa4,.195},H}; -N l26n47[]={{sc2a1,.219},{sa1bfa3,.146},H}; -N l26n48[]={{sa4c8a4,.414},H}; -N l26n49[]={{sa4b9a4,.511},{sa4a5f3a5,.292},H}; -N l26n50[]={{sa5c7,.162},{sa4aaa4,.219},{saca7a3c2,.195},{sa5c7a5a3,.195},H}; -N l26n51[]={{sa5b8,.438},H}; -N l26n52[]={{sRa5,.462},H}; -N l26n53[]={{sa5f3a5,.487},H}; -N l26n54[]={{sa5c3a5bb,.552},H}; -N l26n55[]={{sa5Fa5,.219},H}; -N l26n56[]={{sa5c6a5,.268},H}; -N l26n57[]={{sa5b7a5,.243},H}; -N l26n58[]={{sa1bca5b8,.616},{seaa4,.195},{seba1bc,.219},H}; -N l26n60[]={{sa8a4,.146},H}; -N l26n61[]={{sb8a5,.178},H}; -N l26n62[]={{sbcf5bf,.316},{sa4caa4a4,.227},H}; -N l26n63[]={{sbfaebcE,.357},{sa5b8a4,.195},H}; -N l26n64[]={{sa5Da5b9,.519},H}; -N l26n65[]={{sb9cdH,.170},H}; -N l26n66[]={{sa4a5f3,.219},{sa5H,.146},{sb7a4bf,.195},H}; -N l26n67[]={{sa5c8,.292},{sc1a4,.170},H}; -N l26n68[]={{sa5b9,.616},{sa4e8,.227},{saca7aca7,.324},{scdBbcE,.389},H}; -N l26n69[]={{sa7a3c2a1,.195},H}; -N l26n70[]={{sa4ca,.389},{sc4ea,.219},{sc2a1a5,.292},H}; -N l26n71[]={{sb9a4eba1,.260},{sbef5,.097},H}; -N l26n72[]={{sa4ac,.341},{sc4cc,.316},{sbcf5bfae,.422},H}; -N l26n73[]={{sa5c7a5,.170},H}; -N l26n74[]={{sa5b8a5,.268},H}; -N l26n75[]={{sb9a4,.535},{sa4eba1a3,.746},{saca7g,.475},{scdf8,.219},{sbde8,.146},{seaa5,.219},H}; -N l26n76[]={{sa5Ra5c3,.552},{sgac,.227},{sa4b7a4bf,.260},{sb8c4,.097},H}; -N l26n78[]={{sabb9f0,.195},H}; -N l26n79[]={{saca7ac,.243},{sa5c8a4,.195},H}; -N l26n80[]={{sa4e8a4,.341},{sa5b9a4,.268},{sb9a4eba4,.227},H}; -N l26n81[]={{sa5bba1,.414},H}; -N l26n82[]={{sa1a3,.568},{sa4caa4,.365},H}; -N l26n83[]={{sHc1c7a4,.341},H}; -N l26n84[]={{sa5c9,.130},H}; -N l26n85[]={{sa4eca4eb,.487},{sa4e9,.146},H}; -N l26n86[]={{sbba1,.276},H}; -N l26n87[]={{sa4cb,.681},{sb9f0,.130},H}; -N l26n89[]={{sbba1bca5,.552},{seba4,.341},{sa7g,.316},{sa4ad,.146},{sa5Ha5,.195},H}; -N l26n90[]={{sa3cd,.324},{scaa4,.438},{sf5bf,.316},{safbfae,.146},H}; -N l26n91[]={{sa3cda3,.341},{sa5b9a5,.219},H}; -N l26n92[]={{sb9a5,.146},H}; -N l26n93[]={{scba4e8a4,.292},H}; -N l26n95[]={{sbdbc,.097},H}; -N l26n97[]={{sa4b7a4c6,.324},{sga4b3a4,.227},{sa4e9a4,.170},{sDa5b9a4,.292},H}; -N l26n98[]={{sa4eba1,.584},{sf3a5,.487},{sa7a3c2,.146},H}; -N l26n99[]={{sa1a4,.633},{sa4cba4,.341},{sccbf,.243},H}; -N l26n100[]={{sb9a4eb,.511},H}; -N l26n101[]={{scdHc1,.292},{sa4ada4,.170},H}; -N l26n102[]={{sa5bb,.341},{sa4ea,.114},{scaa4a4,.256},H}; -N l26n103[]={{sHc1c7,.292},H}; -N l26n104[]={{scba3,.146},H}; -N l26n106[]={{sbba1bc,.414},{seba5,.341},H}; -N l26n107[]={{scaa5,.170},{sa4a2a4eb,.227},H}; -N l26n113[]={{scba4e8,.219},H}; -N l26n114[]={{sa4cfa1a4,.324},{sa5f3a5bf,.227},H}; -N l26n116[]={{sa1a5,.454},H}; -N l26n117[]={{sDa5b9,.584},{sa1a5a3,.219},{sga4b3,.170},H}; -N l26n119[]={{sa4eb,.957},H}; -N l26n120[]={{seca4,.754},H}; -N l26n121[]={{scba4,.389},{sgaca7,.341},{sa3c2a1a5,.260},H}; -N l26n122[]={{saaa4,.178},H}; -N l26n125[]={{sc4ccbf,.329},H}; -N l26n126[]={{sc3a5bba1,.827},{sa2a4eba1,.195},H}; -N l26n129[]={{sc3a4,.195},H}; -N l26n130[]={{sDa5,.511},{sa2a4,.178},H}; -N l26n131[]={{sa4eba4,.316},H}; -N l26n132[]={{sRa5c3a5,.827},{sb9cdHc1,.227},H}; -N l26n133[]={{sa5bba1bc,.552},{sa5ea,.227},H}; -N l26n134[]={{sa4cfa1,.243},H}; -N l26n135[]={{seba1a3g,1.679},{sc4ccbfae,.438},{sa3c9a3A,.195},H}; -N l26n136[]={{sa4ec,.487},H}; -N l26n137[]={{seca5,.219},H}; -N l26n138[]={{sa4ce,1.103},{sa3c2a1,.219},H}; -N l26n139[]={{sa4bf,.422},{sa1bca5D,.519},H}; -N l26n141[]={{sa3A,.162},{scdf8cdB,.438},{sbca5b8a4,.260},{sf5c2,.146},{sa5f3a5c8,.195},{sa4a4a4eb,.195},H}; -N l26n142[]={{sa3c1,.243},{saebc,.178},{sa3Aa3,.219},{sa4eba5,.195},H}; -N l26n143[]={{sb7a4c6,.243},H}; -N l26n144[]={{sEa4,.438},H}; -N l26n145[]={{seca4eb,.548},{sb3a4,.211},{sga1,.211},H}; -N l26n146[]={{sc3a5,.706},H}; -N l26n147[]={{sa2a5,.097},H}; -N l26n148[]={{sa4eca4,.730},{se8cdfd,.292},H}; -N l26n149[]={{sRa5c3,.621},H}; -N l26n150[]={{sa5eb,.243},{saebcEa4,.292},{sc1c7,.195},{sa4cea4,.170},H}; -N l26n151[]={{sa4bfa4,.365},{sf3a5bf,.256},{sa1bca5H,.195},{sbdbca8,.146},H}; -N l26n152[]={{sa5b9cdH,.227},{scca4,.146},H}; -N l26n154[]={{sa5af,.260},{sa4O,.097},H}; -N l26n155[]={{sa4cf,.568},{sc3a5bb,.621},{sa2a4eb,.170},H}; -N l26n156[]={{sb5a1,.373},{sa5eaa5,.195},H}; -N l26n157[]={{sbef5c2,.146},H}; -N l26n158[]={{sa4a2,.146},{sFa3,.170},H}; -N l26n159[]={{sb5a1bca5,.519},{sa3c2,.146},H}; -N l26n160[]={{scdfd,.316},{sf8cdB,.329},{sc4a4,.195},H}; -N l26n161[]={{sbca5b8,.462},{sa4cea5,.195},{sa3a4,.097},H}; -N l26n162[]={{sc1c7a4,.256},H}; -N l26n164[]={{sc7L,.219},H}; -N l26n165[]={{sa7ac,.162},{sf8cd,.219},H}; -N l26n166[]={{scda3,.341},{sc7bd,.146},{sa4Oa4,.146},H}; -N l26n167[]={{sa5ec,.162},H}; -N l26n168[]={{sa5N,.130},H}; -N l26n170[]={{sa5bf,.308},{saebcE,.268},{sa4a2a4,.219},{sc6b0,.170},H}; -N l26n171[]={{sc6a1,.292},H}; -N l26n173[]={{sa5eba5,.146},H}; -N l26n175[]={{sbfae,.649},H}; -N l26n176[]={{sb5a1bc,.389},H}; -N l26n177[]={{sa4b5a4ec,.649},{sa5afa5,.292},H}; -N l26n178[]={{sa1a3g,1.278},{sa3a5,.114},H}; -N l26n179[]={{sga3,.195},H}; -N l26n180[]={{scdB,.316},{sc2G,.146},H}; -N l26n181[]={{se8cd,.195},{sa5eba1bc,.195},H}; -N l26n183[]={{sc6a1a4,.219},H}; -N l26n184[]={{saca4,.114},{sNa5,.146},H}; -N l26n185[]={{sbca5,1.087},{sbca5Da5,.519},H}; -N l26n186[]={{scdHc1c7,.389},H}; -N l26n187[]={{sbfaea4,.170},H}; -N l26n189[]={{sa5a2,.097},H}; -N l26n190[]={{sb9e7,.195},{sa5eca5,.219},H}; -N l26n191[]={{sa4b3,.195},{sf5c2G,.219},H}; -N l26n192[]={{sa4a4,.730},{sFa5,.219},{sa3D,.114},H}; -N l26n193[]={{sa5bfa5,.243},{sa3c4,.114},H}; -N l26n194[]={{scfa1,.292},{sc6a1a5,.219},H}; -N l26n195[]={{sbfaebc,.268},H}; -N l26n196[]={{sga4,.308},H}; -N l26n198[]={{sOa4,.195},{sc1f7,.170},H}; -N l26n199[]={{sbda4,.162},H}; -N l26n200[]={{scdBbc,.292},H}; -N l26n202[]={{sbca5D,.389},H}; -N l26n203[]={{sa4b3a4,.292},{sBbc,.195},{sa5A,.097},{sc1ac,.146},H}; -N l26n204[]={{sa4a4a4,.389},H}; -N l26n206[]={{sa5a3,.308},{scfa1a4,.365},{sGa4,.219},{sc0ae,.195},{sa3c6a1,.146},H}; -N l26n207[]={{sb5a4,.324},{sa5a4a5f3,.292},{sa4c3,.097},H}; -N l26n209[]={{sa4a5,.292},{sa3E,.097},H}; -N l26n210[]={{sa7aca7,.243},H}; -N l26n211[]={{sBbcEa4,.292},H}; -N l26n212[]={{sa1a5g,.548},{sf5bfae,.475},{sf8cdBbc,.389},{sa5a2a5,.146},H}; -N l26n213[]={{sga5,.341},H}; -N l26n214[]={{scea4,.268},{sc6a4a4a4,.341},{sa7aca7ac,.195},H}; -N l26n215[]={{sada4,.162},{sc8af,.195},{sc7a4ce,.219},H}; -N l26n216[]={{sbcE,.324},H}; -N l26n217[]={{sa4a4eb,.146},{sa4c6a1a4,.195},H}; -N l26n218[]={{sHc1,.195},H}; -N l26n219[]={{sa4c3a4,.146},H}; -N l26n220[]={{sDa5b9cd,.341},H}; -N l26n221[]={{sa3g,.852},{sccbfae,.329},H}; -N l26n222[]={{sc6a4,.316},H}; -N l26n223[]={{sb5a4eca4,.649},{sa5a4,.243},{sc7a4a2a4,.389},H}; -N l26n224[]={{safbf,.097},H}; -N l26n225[]={{sa4b5,.324},{sc1aca7a3,.292},H}; -N l26n226[]={{sa3F,.146},{sa4a6,.130},{sa5Aa5,.146},H}; -N l26n227[]={{sa3Fa3,.170},H}; -N l26n228[]={{sbcEa4,.389},{sc9bd,.292},H}; -N l26n229[]={{sa5a3a5,.170},H}; -N l26n231[]={{scea5,.219},{sBbcE,.292},{sa3c1aca7,.195},H}; -N l26n233[]={{sa1ca,.178},{sFa3c1,.219},H}; -N l26n234[]={{sb4abb9f0,.260},{sc6a4a4,.256},{sa7a1,.097},H}; -N l26n235[]={{saca7,.892},{sa5b5a1,.389},H}; -N l26n236[]={{saca7a3,.462},{sa5R,.292},{sbca8,.146},H}; -N l26n237[]={{sa4b5a4,.487},{sa4c6a1,.146},H}; -N l26n238[]={{sa5c3,.470},{sa4f2,.438},H}; -N l26n239[]={{sc6a5,.292},H}; -N l26n240[]={{sc9bdbca8,.292},H}; -N l26n242[]={{sa4b9a4eb,.681},{sa3c1ac,.146},H}; -N l26n243[]={{sb5a4ec,.487},{sc7a4a2,.292},H}; -N l26n244[]={{sbfa3,.114},H}; -N l26n245[]={{scfa4,.146},H}; -N l26n246[]={{sa5a4a5,.365},{saea4,.178},{sbca5H,.146},H}; -N l26n248[]={{sc1aca7,.219},{sbca8a4,.146},{sc9bdbc,.219},H}; -N l26n250[]={{sa1cb,.146},{sa4c6a4a4,.227},{sf3a5c8,.219},H}; -N l26n251[]={{sa1bc,1.119},{sa4cfg,.219},H}; -N l26n252[]={{se8a4,.462},H}; -N l26n253[]={{sc7a4,.584},H}; -N l26n254[]={{sa5D,.308},{sabb9,.130},{sHa5,.195},H}; - -D l26_d = -{ +S sa1bc[] = { 161, 188, 0 }; +S sa4ce[] = { 164, 206, 0 }; +S sbca5[] = { 188, 165, 0 }; +S sa1bca5[] = { 161, 188, 165, 0 }; +S sa4eb[] = { 164, 235, 0 }; +S saca7[] = { 172, 167, 0 }; +S sa4cb[] = { 164, 203, 0 }; +S sbfae[] = { 191, 174, 0 }; +S sa1a4[] = { 161, 164, 0 }; +S sa5b9[] = { 165, 185, 0 }; +S sa4cf[] = { 164, 207, 0 }; +S seca4[] = { 236, 164, 0 }; +S sa4ec[] = { 164, 236, 0 }; +S seba1[] = { 235, 161, 0 }; +S sa4eca4[] = { 164, 236, 164, 0 }; +S sa5c3[] = { 165, 195, 0 }; +S sc3a5[] = { 195, 165, 0 }; +S sa5c3a5[] = { 165, 195, 165, 0 }; +S sa1a5[] = { 161, 165, 0 }; +S sa4c8[] = { 164, 200, 0 }; +S sa4b7[] = { 164, 183, 0 }; +S sa5b8[] = { 165, 184, 0 }; +S sa4f2[] = { 164, 242, 0 }; +S sa4c6[] = { 164, 198, 0 }; +S sa4bf[] = { 164, 191, 0 }; +S sc8a4[] = { 200, 164, 0 }; +S sa4c7[] = { 164, 199, 0 }; +S sa4ca[] = { 164, 202, 0 }; +S sa4eba1[] = { 164, 235, 161, 0 }; +S sc7a4[] = { 199, 164, 0 }; +S sa4eba1a3[] = { 164, 235, 161, 163, 0 }; +S seba1a3[] = { 235, 161, 163, 0 }; +S sb5a1[] = { 181, 161, 0 }; +S sa5f3[] = { 165, 243, 0 }; +S seba1a3g[] = { 235, 161, 163, a }; +S sa4b9[] = { 164, 185, 0 }; +S sDa5[] = { 211, 165, 0 }; +S sa4ac[] = { 164, 172, 0 }; +S sa4b9a4[] = { 164, 185, 164, 0 }; +S sa4b9a4eb[] = { 164, 185, 164, 235, 0 }; +S sb9a4eb[] = { 185, 164, 235, 0 }; +S sa4b5a4[] = { 164, 181, 164, 0 }; +S sa5f3a5[] = { 165, 243, 165, 0 }; +S sbcE[] = { 188, 212, 0 }; +S sa4b7a4[] = { 164, 183, 164, 0 }; +S sa4b5a4ec[] = { 164, 181, 164, 236, 0 }; +S sb7a4[] = { 183, 164, 0 }; +S sb5a4ec[] = { 181, 164, 236, 0 }; +S sb5a4eca4[] = { 181, 164, 236, 164, 0 }; +S sf3a5[] = { 243, 165, 0 }; +S sa3cd[] = { 163, 205, 0 }; +S sa4b5[] = { 164, 181, 0 }; +S sb5a4[] = { 181, 164, 0 }; +S sbca5b8[] = { 188, 165, 184, 0 }; +S sa5bf[] = { 165, 191, 0 }; +S sa5D[] = { 165, 211, 0 }; +S sa1bca5b8[] = { 161, 188, 165, 184, 0 }; +S sRa5[] = { 225, 165, 0 }; +S se8a4[] = { 232, 164, 0 }; +S saca7a3[] = { 172, 167, 163, 0 }; +S sa5Da5[] = { 165, 211, 165, 0 }; +S sa7a3[] = { 167, 163, 0 }; +S sa5a3[] = { 165, 163, 0 }; +S sEa4[] = { 212, 164, 0 }; +S sa5Ra5[] = { 165, 225, 165, 0 }; +S sa4a5[] = { 164, 165, 0 }; +S sa5c8[] = { 165, 200, 0 }; +S sa5R[] = { 165, 225, 0 }; +S sbfa4[] = { 191, 164, 0 }; +S scaa4[] = { 202, 164, 0 }; +S sa5b5[] = { 165, 181, 0 }; +S sa5bba1[] = { 165, 187, 161, 0 }; +S sa5c3a5bb[] = { 165, 195, 165, 187, 0 }; +S sa4c8a4[] = { 164, 200, 164, 0 }; +S sRa5c3[] = { 225, 165, 195, 0 }; +S sc3a5bba1[] = { 195, 165, 187, 161, 0 }; +S sc3a5bb[] = { 195, 165, 187, 0 }; +S sbba1bca5[] = { 187, 161, 188, 165, 0 }; +S sa5Ra5c3[] = { 165, 225, 165, 195, 0 }; +S sa5bba1bc[] = { 165, 187, 161, 188, 0 }; +S sbba1[] = { 187, 161, 0 }; +S sRa5c3a5[] = { 225, 165, 195, 165, 0 }; +S sbba1bc[] = { 187, 161, 188, 0 }; +S sb5a1bc[] = { 181, 161, 188, 0 }; +S sbca5D[] = { 188, 165, 211, 0 }; +S scba4[] = { 203, 164, 0 }; +S sDa5b9[] = { 211, 165, 185, 0 }; +S sb5a1bca5[] = { 181, 161, 188, 165, 0 }; +S sa5af[] = { 165, 175, 0 }; +S sbcEa4[] = { 188, 212, 164, 0 }; +S sa4a4a4[] = { 164, 164, 164, 0 }; +S sa4c7a4[] = { 164, 199, 164, 0 }; +S sa1bca5D[] = { 161, 188, 165, 211, 0 }; +S sa5b5a1[] = { 165, 181, 161, 0 }; +S sa5Da5b9[] = { 165, 211, 165, 185, 0 }; +S sbca5Da5[] = { 188, 165, 211, 165, 0 }; +S sa5b5a1bc[] = { 165, 181, 161, 188, 0 }; +S sa4eca4eb[] = { 164, 236, 164, 235, 0 }; +S sa5a4a5[] = { 165, 164, 165, 0 }; +S sa1a5g[] = { 161, 165, a }; +S sa5a4[] = { 165, 164, 0 }; +S sa3c1[] = { 163, 193, 0 }; +S sa4bfa4[] = { 164, 191, 164, 0 }; +S seca4eb[] = { 236, 164, 235, 0 }; +S sa5eb[] = { 165, 235, 0 }; +S sa4caa4[] = { 164, 202, 164, 0 }; +S seba5[] = { 235, 165, 0 }; +S sgaca7[] = { 32, 172, 167, 0 }; +S sa3cda3[] = { 163, 205, 163, 0 }; +S sa4e8a4[] = { 164, 232, 164, 0 }; +S sa4cba4[] = { 164, 203, 164, 0 }; +S scda3[] = { 205, 163, 0 }; +S sa4e8[] = { 164, 232, 0 }; +S sa5ea[] = { 165, 234, 0 }; +S seba4[] = { 235, 164, 0 }; +S sa4eba4[] = { 164, 235, 164, 0 }; +S sf5bf[] = { 245, 191, 0 }; +S sbcf5[] = { 188, 245, 0 }; +S sbcf5bf[] = { 188, 245, 191, 0 }; +S sbcf5bfae[] = { 188, 245, 191, 174, 0 }; +S sc6a4[] = { 198, 164, 0 }; +S sf5bfae[] = { 245, 191, 174, 0 }; +S saca7g[] = { 172, 167, a }; +S scdfd[] = { 205, 253, 0 }; +S scdH[] = { 205, 215, 0 }; +S sbfa5[] = { 191, 165, 0 }; +S safa5[] = { 175, 165, 0 }; +S scfa1[] = { 207, 161, 0 }; +S sa5afa5[] = { 165, 175, 165, 0 }; +S sc6a1[] = { 198, 161, 0 }; +S sa4b3a4[] = { 164, 179, 164, 0 }; +S sb8a4[] = { 184, 164, 0 }; +S sc9bd[] = { 201, 189, 0 }; +S sb9e7[] = { 185, 231, 0 }; +S sa4b3[] = { 164, 179, 0 }; +S sc6a5[] = { 198, 165, 0 }; +S sa4c6a4[] = { 164, 198, 164, 0 }; +S saebcE[] = { 174, 188, 212, 0 }; +S sa5c6[] = { 165, 198, 0 }; +S saea4[] = { 174, 164, 0 }; +S sa2a4[] = { 162, 164, 0 }; +S saebc[] = { 174, 188, 0 }; +S sbfaebc[] = { 191, 174, 188, 0 }; +S scea4[] = { 206, 164, 0 }; +S sb8a5[] = { 184, 165, 0 }; +S sa5c6a5[] = { 165, 198, 165, 0 }; +S sbfaebcE[] = { 191, 174, 188, 212, 0 }; +S sa1ca[] = { 161, 202, 0 }; +S saaa4[] = { 170, 164, 0 }; +S sa5b8a5[] = { 165, 184, 165, 0 }; +S sa5b9a4[] = { 165, 185, 164, 0 }; +S sa5ec[] = { 165, 236, 0 }; +S sb7a4c6[] = { 183, 164, 198, 0 }; +S sa5c7[] = { 165, 199, 0 }; +S sa5b7a5[] = { 165, 183, 165, 0 }; +S scfa1a4[] = { 207, 161, 164, 0 }; +S sccbf[] = { 204, 191, 0 }; +S saca7ac[] = { 172, 167, 172, 0 }; +S sada4[] = { 173, 164, 0 }; +S sa5b7[] = { 165, 183, 0 }; +S sa3A[] = { 163, 208, 0 }; +S sa5bfa5[] = { 165, 191, 165, 0 }; +S sa4cfa1a4[] = { 164, 207, 161, 164, 0 }; +S sa7aca7[] = { 167, 172, 167, 0 }; +S sa4b7a4c6[] = { 164, 183, 164, 198, 0 }; +S sbda4[] = { 189, 164, 0 }; +S sb7a5[] = { 183, 165, 0 }; +S saca7aca7[] = { 172, 167, 172, 167, 0 }; +S sa7ac[] = { 167, 172, 0 }; +S sa4cfa1[] = { 164, 207, 161, 0 }; +S sa4a2[] = { 164, 162, 0 }; +S sa3c2a1[] = { 163, 194, 161, 0 }; +S sAa3[] = { 208, 163, 0 }; +S sFa5[] = { 213, 165, 0 }; +S scdf8cd[] = { 205, 248, 205, 0 }; +S sa4aa[] = { 164, 170, 0 }; +S sa1cb[] = { 161, 203, 0 }; +S sa8a4[] = { 168, 164, 0 }; +S scdf8[] = { 205, 248, 0 }; +S sa3Aa3[] = { 163, 208, 163, 0 }; +S sb9a5[] = { 185, 165, 0 }; +S scdf8cdB[] = { 205, 248, 205, 209, 0 }; +S sc7L[] = { 199, 219, 0 }; +S seaa1[] = { 234, 161, 0 }; +S sbde8[] = { 189, 232, 0 }; +S saebcEa4[] = { 174, 188, 212, 164, 0 }; +S sccbfae[] = { 204, 191, 174, 0 }; +S sf8cdB[] = { 248, 205, 209, 0 }; +S scea5[] = { 206, 165, 0 }; +S sa5F[] = { 165, 213, 0 }; +S sc4ccbfae[] = { 196, 204, 191, 174, 0 }; +S sc4ccbf[] = { 196, 204, 191, 0 }; +S sa4a5f3[] = { 164, 165, 243, 0 }; +S sa1a5a3[] = { 161, 165, 163, 0 }; +S sa3c2[] = { 163, 194, 0 }; +S sa5H[] = { 165, 215, 0 }; +S sa5eca5[] = { 165, 236, 165, 0 }; +S sa5Fa5[] = { 165, 213, 165, 0 }; +S seca5[] = { 236, 165, 0 }; +S sa4a2a4[] = { 164, 162, 164, 0 }; +S sa5a4a5f3[] = { 165, 164, 165, 243, 0 }; +S sGa4[] = { 214, 164, 0 }; +S sc2a1[] = { 194, 161, 0 }; +S sbca8[] = { 188, 168, 0 }; +S seaa5[] = { 234, 165, 0 }; +S sa4a5f3a5[] = { 164, 165, 243, 165, 0 }; +S sa5b9a5[] = { 165, 185, 165, 0 }; +S sf8cd[] = { 248, 205, 0 }; +S sa3F[] = { 163, 213, 0 }; +S sa4aaa4[] = { 164, 170, 164, 0 }; +S sb9a4eba1[] = { 185, 164, 235, 161, 0 }; +S sbde8cdfd[] = { 189, 232, 205, 253, 0 }; +S sf5bfaebc[] = { 245, 191, 174, 188, 0 }; +S sb9cd[] = { 185, 205, 0 }; +S sBbcE[] = { 209, 188, 212, 0 }; +S scdHc1c7[] = { 205, 215, 193, 199, 0 }; +S sf8cdBbc[] = { 248, 205, 209, 188, 0 }; +S sbca5b8a4[] = { 188, 165, 184, 164, 0 }; +S sa3c2a1a5[] = { 163, 194, 161, 165, 0 }; +S sa5c9[] = { 165, 201, 0 }; +S sa4b7a4bf[] = { 164, 183, 164, 191, 0 }; +S sc2a1a5[] = { 194, 161, 165, 0 }; +S sc4a4[] = { 196, 164, 0 }; +S sOa4[] = { 222, 164, 0 }; +S sa4a6[] = { 164, 166, 0 }; +S sa4c7a4a2[] = { 164, 199, 164, 162, 0 }; +S sabb9[] = { 171, 185, 0 }; +S sb7a4bf[] = { 183, 164, 191, 0 }; +S sa5N[] = { 165, 221, 0 }; +S sbde8cd[] = { 189, 232, 205, 0 }; +S sc0ae[] = { 192, 174, 0 }; +S sc7a4a2a4[] = { 199, 164, 162, 164, 0 }; +S sHa5[] = { 215, 165, 0 }; +S sa4eba5[] = { 164, 235, 165, 0 }; +S sHc1[] = { 215, 193, 0 }; +S sBbc[] = { 209, 188, 0 }; +S scdBbcE[] = { 205, 209, 188, 212, 0 }; +S se8cd[] = { 232, 205, 0 }; +S scdBbc[] = { 205, 209, 188, 0 }; +S sa5Ha5[] = { 165, 215, 165, 0 }; +S scdHc1[] = { 205, 215, 193, 0 }; +S sHc1c7[] = { 215, 193, 199, 0 }; +S sc7a4a2[] = { 199, 164, 162, 0 }; +S sc1c7[] = { 193, 199, 0 }; +S sa5b8a4[] = { 165, 184, 164, 0 }; +S sb9f0[] = { 185, 240, 0 }; +S sb4abb9[] = { 180, 171, 185, 0 }; +S sa4cea5[] = { 164, 206, 165, 0 }; +S sb4abb9f0[] = { 180, 171, 185, 240, 0 }; +S sa5eaa5[] = { 165, 234, 165, 0 }; +S seaa4[] = { 234, 164, 0 }; +S sc8af[] = { 200, 175, 0 }; +S sc3a4[] = { 195, 164, 0 }; +S sAa5[] = { 208, 165, 0 }; +S sb4ab[] = { 180, 171, 0 }; +S se8cdfd[] = { 232, 205, 253, 0 }; +S sabb9f0[] = { 171, 185, 240, 0 }; +S sa5c8a4[] = { 165, 200, 164, 0 }; +S sbfa3[] = { 191, 163, 0 }; +S sa4ea[] = { 164, 234, 0 }; +S sDa5b9cd[] = { 211, 165, 185, 205, 0 }; +S sc1a4[] = { 193, 164, 0 }; +S sa3c8[] = { 163, 200, 0 }; +S sa4c6a4a4[] = { 164, 198, 164, 164, 0 }; +S sbfaea4[] = { 191, 174, 164, 0 }; +S sa3Fa3[] = { 163, 213, 163, 0 }; +S saca4[] = { 172, 164, 0 }; +S sf3a5bf[] = { 243, 165, 191, 0 }; +S sa4ada4[] = { 164, 173, 164, 0 }; +S sc6b0[] = { 198, 176, 0 }; +S sa3c9[] = { 163, 201, 0 }; +S sa5c7a5[] = { 165, 199, 165, 0 }; +S sa2a4eb[] = { 162, 164, 235, 0 }; +S sJa4[] = { 217, 164, 0 }; +S sFa3[] = { 213, 163, 0 }; +S sc6a4a4[] = { 198, 164, 164, 0 }; +S sa3a5[] = { 163, 165, 0 }; +S sga4b3[] = { 32, 164, 179, 0 }; +S sc1f7[] = { 193, 247, 0 }; +S sa4caa4a4[] = { 164, 202, 164, 164, 0 }; +S sb9a4eba4[] = { 185, 164, 235, 164, 0 }; +S sc6a4a4a4[] = { 198, 164, 164, 164, 0 }; +S scaa4a4[] = { 202, 164, 164, 0 }; +S sc8a3[] = { 200, 163, 0 }; +S sa5b9cdH[] = { 165, 185, 205, 215, 0 }; +S sb9cdHc1[] = { 185, 205, 215, 193, 0 }; +S sc7a5[] = { 199, 165, 0 }; +S sb9cdH[] = { 185, 205, 215, 0 }; +S sga4b3a4[] = { 32, 164, 179, 164, 0 }; +S sc1c7a4[] = { 193, 199, 164, 0 }; +S sHc1c7a4[] = { 215, 193, 199, 164, 0 }; +S sa4e9a4[] = { 164, 233, 164, 0 }; +S sa4cea4[] = { 164, 206, 164, 0 }; +S sa5f3a5bf[] = { 165, 243, 165, 191, 0 }; +S sa5a3a5[] = { 165, 163, 165, 0 }; +S sa3D[] = { 163, 211, 0 }; +S sa3c4[] = { 163, 196, 0 }; +S se9a4[] = { 233, 164, 0 }; +S sa5b9cd[] = { 165, 185, 205, 0 }; +S scaa5[] = { 202, 165, 0 }; +S sa4a2a4eb[] = { 164, 162, 164, 235, 0 }; +S sa4a4eb[] = { 164, 164, 235, 0 }; +S scba3[] = { 203, 163, 0 }; +S sa4cba4e8[] = { 164, 203, 164, 232, 0 }; +S sc8afbf[] = { 200, 175, 191, 0 }; +S sc9bdbca8[] = { 201, 189, 188, 168, 0 }; +S saca7a3c2[] = { 172, 167, 163, 194, 0 }; +S sa5a2[] = { 165, 162, 0 }; +S sa5a2a5[] = { 165, 162, 165, 0 }; +S sb8c4[] = { 184, 196, 0 }; +S sf3a5c8[] = { 243, 165, 200, 0 }; +S sa4cfg[] = { 164, 207, a }; +S safbf[] = { 175, 191, 0 }; +S sa4c6a1[] = { 164, 198, 161, 0 }; +S sa5Aa5[] = { 165, 208, 165, 0 }; +S sa5A[] = { 165, 208, 0 }; +S sa7a3c2a1[] = { 167, 163, 194, 161, 0 }; +S seba1bc[] = { 235, 161, 188, 0 }; +S sf5c2[] = { 245, 194, 0 }; +S sFa3c1[] = { 213, 163, 193, 0 }; +S sNa5[] = { 221, 165, 0 }; +S sa4c3a4[] = { 164, 195, 164, 0 }; +S sa3c9a3A[] = { 163, 201, 163, 208, 0 }; +S sa7aca7ac[] = { 167, 172, 167, 172, 0 }; +S sa5c3a5af[] = { 165, 195, 165, 175, 0 }; +S sa2a5[] = { 162, 165, 0 }; +S sa3c6a1[] = { 163, 198, 161, 0 }; +S scca4[] = { 204, 164, 0 }; +S scba4e8a4[] = { 203, 164, 232, 164, 0 }; +S sc9a3[] = { 201, 163, 0 }; +S sbdbc[] = { 189, 188, 0 }; +S sa5eba5[] = { 165, 235, 165, 0 }; +S sc1ac[] = { 193, 172, 0 }; +S sc3a5af[] = { 195, 165, 175, 0 }; +S sc7bd[] = { 199, 189, 0 }; +S sa5c7a5a3[] = { 165, 199, 165, 163, 0 }; +S sa2a4eba1[] = { 162, 164, 235, 161, 0 }; +S sc6a1a5g[] = { 198, 161, 165, a }; +S scfa4[] = { 207, 164, 0 }; +S sc8afbfae[] = { 200, 175, 191, 174, 0 }; +S sc6a1a5[] = { 198, 161, 165, 0 }; +S sa1bf[] = { 161, 191, 0 }; +S sa5a7[] = { 165, 167, 0 }; +S sa4c3[] = { 164, 195, 0 }; +S seba1bca5[] = { 235, 161, 188, 165, 0 }; +S sa3c1ac[] = { 163, 193, 172, 0 }; +S sc1aca7[] = { 193, 172, 167, 0 }; +S safbfae[] = { 175, 191, 174, 0 }; +S sf5c2G[] = { 245, 194, 214, 0 }; +S sbef5c2[] = { 190, 245, 194, 0 }; +S sbef5[] = { 190, 245, 0 }; +S sbca8a4[] = { 188, 168, 164, 0 }; +S sa3Fa3c1[] = { 163, 213, 163, 193, 0 }; +S sa1bca5H[] = { 161, 188, 165, 215, 0 }; +S sa3c1aca7[] = { 163, 193, 172, 167, 0 }; +S sa7a1[] = { 167, 161, 0 }; +S sc9bdbc[] = { 201, 189, 188, 0 }; +S scba4e8[] = { 203, 164, 232, 0 }; +S sDa5b9a4[] = { 211, 165, 185, 164, 0 }; +S sa5f3a5c8[] = { 165, 243, 165, 200, 0 }; +S sbca5H[] = { 188, 165, 215, 0 }; +S sc6a1a4[] = { 198, 161, 164, 0 }; +S sbef5c2G[] = { 190, 245, 194, 214, 0 }; +S sa4Oa4[] = { 164, 222, 164, 0 }; +S sa4a4a4eb[] = { 164, 164, 164, 235, 0 }; +S sc2G[] = { 194, 214, 0 }; +S sc9a3A[] = { 201, 163, 208, 0 }; +S sa7a3c2[] = { 167, 163, 194, 0 }; +S sa3E[] = { 163, 212, 0 }; +S sa1bfa3[] = { 161, 191, 163, 0 }; +S sb7a4bfa4[] = { 183, 164, 191, 164, 0 }; +S sBbcEa4[] = { 209, 188, 212, 164, 0 }; +S sa5eba1bc[] = { 165, 235, 161, 188, 0 }; +S sa4O[] = { 164, 222, 0 }; +S sa4c6a1a4[] = { 164, 198, 161, 164, 0 }; +S sc1aca7a3[] = { 193, 172, 167, 163, 0 }; +S sc7a4ce[] = { 199, 164, 206, 0 }; +S sbdbca8[] = { 189, 188, 168, 0 }; + +N l26n0[] = { { sa5b5, .292 }, H }; +N l26n2[] = { { sa4c6, .422 }, { scacc, .146 }, H }; +N l26n3[] = { { sa4b7, .438 }, { sa5Ra5, .438 }, { sAa3, .219 }, H }; +N l26n4[] = { { sb9cd, .130 }, H }; +N l26n5[] = { { sa5c3a5, .706 }, { sbfa4, .292 }, { sa4c7a4a2, .260 }, { sa3c8, .114 }, H }; +N l26n7[] = { { seaa1, .219 }, H }; +N l26n8[] = { { sf5bfaebc, .389 }, H }; +N l26n9[] = { { sbcf5, .211 }, H }; +N l26n11[] = { { sc8a3, .170 }, H }; +N l26n12[] = { { sa7a3, .308 }, { sc8afbf, .219 }, H }; +N l26n13[] = { { sb7a4, .324 }, H }; +N l26n14[] = { { sa4c6a4, .292 }, { sc7a5, .170 }, H }; +N l26n15[] = { { sa4b7a4, .487 }, H }; +N l26n17[] = { { sbde8cdfd, .260 }, H }; +N l26n18[] = { { sa1bca5, 1.630 }, { sa5c3a5af, .195 }, { sa5a7, .097 }, H }; +N l26n19[] = { { sa4c7, .406 }, { sa5b9cd, .170 }, H }; +N l26n21[] = { { sa5Da5, .462 }, H }; +N l26n22[] = { { sbfa5, .211 }, { sa3c9, .114 }, { sc8afbfae, .292 }, H }; +N l26n23[] = { { sc3a5af, .219 }, H }; +N l26n26[] = { { scdH, .316 }, { scdf8cd, .329 }, { sbde8cd, .195 }, { sb4abb9, .195 }, { sc9a3A, .219 }, H }; +N l26n27[] = { { sa5g, .365 }, { se9a4, .170 }, { sa4cba4e8, .195 }, H }; +N l26n28[] = { { sc8a4, .608 }, H }; +N l26n30[] = { { sa5f3, .373 }, { sb7a5, .162 }, H }; +N l26n31[] = { { sa4c7a4, .389 }, { sa5b5a1bc, .519 }, { sbef5c2G, .195 }, H }; +N l26n32[] = { { sa5F, .146 }, H }; +N l26n33[] = { { sa5c6, .178 }, H }; +N l26n34[] = { { sa5b7, .162 }, { sc6a1a5g, .438 }, H }; +N l26n36[] = { { sa4c8, .454 }, H }; +N l26n37[] = { { sa4b9, .357 }, { sAa5, .195 }, H }; +N l26n38[] = { { seba1, .730 }, { safa5, .195 }, { sa4aa, .146 }, { sa3Fa3c1, .195 }, H }; +N l26n39[] = { { seba1a3, .840 }, { sb4ab, .130 }, H }; +N l26n41[] = { { seba1bca5, .292 }, H }; +N l26n42[] = { { sc9a3, .146 }, H }; +N l26n43[] = { { sJa4, .170 }, H }; +N l26n44[] = { { sb8a4, .195 }, { sxg, .114 }, H }; +N l26n46[] = { { sa1bf, .097 }, { sb7a4bfa4, .195 }, H }; +N l26n47[] = { { sc2a1, .219 }, { sa1bfa3, .146 }, H }; +N l26n48[] = { { sa4c8a4, .414 }, H }; +N l26n49[] = { { sa4b9a4, .511 }, { sa4a5f3a5, .292 }, H }; +N l26n50[] = { { sa5c7, .162 }, { sa4aaa4, .219 }, { saca7a3c2, .195 }, { sa5c7a5a3, .195 }, H }; +N l26n51[] = { { sa5b8, .438 }, H }; +N l26n52[] = { { sRa5, .462 }, H }; +N l26n53[] = { { sa5f3a5, .487 }, H }; +N l26n54[] = { { sa5c3a5bb, .552 }, H }; +N l26n55[] = { { sa5Fa5, .219 }, H }; +N l26n56[] = { { sa5c6a5, .268 }, H }; +N l26n57[] = { { sa5b7a5, .243 }, H }; +N l26n58[] = { { sa1bca5b8, .616 }, { seaa4, .195 }, { seba1bc, .219 }, H }; +N l26n60[] = { { sa8a4, .146 }, H }; +N l26n61[] = { { sb8a5, .178 }, H }; +N l26n62[] = { { sbcf5bf, .316 }, { sa4caa4a4, .227 }, H }; +N l26n63[] = { { sbfaebcE, .357 }, { sa5b8a4, .195 }, H }; +N l26n64[] = { { sa5Da5b9, .519 }, H }; +N l26n65[] = { { sb9cdH, .170 }, H }; +N l26n66[] = { { sa4a5f3, .219 }, { sa5H, .146 }, { sb7a4bf, .195 }, H }; +N l26n67[] = { { sa5c8, .292 }, { sc1a4, .170 }, H }; +N l26n68[] = { { sa5b9, .616 }, { sa4e8, .227 }, { saca7aca7, .324 }, { scdBbcE, .389 }, H }; +N l26n69[] = { { sa7a3c2a1, .195 }, H }; +N l26n70[] = { { sa4ca, .389 }, { sc4ea, .219 }, { sc2a1a5, .292 }, H }; +N l26n71[] = { { sb9a4eba1, .260 }, { sbef5, .097 }, H }; +N l26n72[] = { { sa4ac, .341 }, { sc4cc, .316 }, { sbcf5bfae, .422 }, H }; +N l26n73[] = { { sa5c7a5, .170 }, H }; +N l26n74[] = { { sa5b8a5, .268 }, H }; +N l26n75[] = { { sb9a4, .535 }, { sa4eba1a3, .746 }, { saca7g, .475 }, { scdf8, .219 }, { sbde8, .146 }, { seaa5, .219 }, H }; +N l26n76[] = { { sa5Ra5c3, .552 }, { sgac, .227 }, { sa4b7a4bf, .260 }, { sb8c4, .097 }, H }; +N l26n78[] = { { sabb9f0, .195 }, H }; +N l26n79[] = { { saca7ac, .243 }, { sa5c8a4, .195 }, H }; +N l26n80[] = { { sa4e8a4, .341 }, { sa5b9a4, .268 }, { sb9a4eba4, .227 }, H }; +N l26n81[] = { { sa5bba1, .414 }, H }; +N l26n82[] = { { sa1a3, .568 }, { sa4caa4, .365 }, H }; +N l26n83[] = { { sHc1c7a4, .341 }, H }; +N l26n84[] = { { sa5c9, .130 }, H }; +N l26n85[] = { { sa4eca4eb, .487 }, { sa4e9, .146 }, H }; +N l26n86[] = { { sbba1, .276 }, H }; +N l26n87[] = { { sa4cb, .681 }, { sb9f0, .130 }, H }; +N l26n89[] = { { sbba1bca5, .552 }, { seba4, .341 }, { sa7g, .316 }, { sa4ad, .146 }, { sa5Ha5, .195 }, H }; +N l26n90[] = { { sa3cd, .324 }, { scaa4, .438 }, { sf5bf, .316 }, { safbfae, .146 }, H }; +N l26n91[] = { { sa3cda3, .341 }, { sa5b9a5, .219 }, H }; +N l26n92[] = { { sb9a5, .146 }, H }; +N l26n93[] = { { scba4e8a4, .292 }, H }; +N l26n95[] = { { sbdbc, .097 }, H }; +N l26n97[] = { { sa4b7a4c6, .324 }, { sga4b3a4, .227 }, { sa4e9a4, .170 }, { sDa5b9a4, .292 }, H }; +N l26n98[] = { { sa4eba1, .584 }, { sf3a5, .487 }, { sa7a3c2, .146 }, H }; +N l26n99[] = { { sa1a4, .633 }, { sa4cba4, .341 }, { sccbf, .243 }, H }; +N l26n100[] = { { sb9a4eb, .511 }, H }; +N l26n101[] = { { scdHc1, .292 }, { sa4ada4, .170 }, H }; +N l26n102[] = { { sa5bb, .341 }, { sa4ea, .114 }, { scaa4a4, .256 }, H }; +N l26n103[] = { { sHc1c7, .292 }, H }; +N l26n104[] = { { scba3, .146 }, H }; +N l26n106[] = { { sbba1bc, .414 }, { seba5, .341 }, H }; +N l26n107[] = { { scaa5, .170 }, { sa4a2a4eb, .227 }, H }; +N l26n113[] = { { scba4e8, .219 }, H }; +N l26n114[] = { { sa4cfa1a4, .324 }, { sa5f3a5bf, .227 }, H }; +N l26n116[] = { { sa1a5, .454 }, H }; +N l26n117[] = { { sDa5b9, .584 }, { sa1a5a3, .219 }, { sga4b3, .170 }, H }; +N l26n119[] = { { sa4eb, .957 }, H }; +N l26n120[] = { { seca4, .754 }, H }; +N l26n121[] = { { scba4, .389 }, { sgaca7, .341 }, { sa3c2a1a5, .260 }, H }; +N l26n122[] = { { saaa4, .178 }, H }; +N l26n125[] = { { sc4ccbf, .329 }, H }; +N l26n126[] = { { sc3a5bba1, .827 }, { sa2a4eba1, .195 }, H }; +N l26n129[] = { { sc3a4, .195 }, H }; +N l26n130[] = { { sDa5, .511 }, { sa2a4, .178 }, H }; +N l26n131[] = { { sa4eba4, .316 }, H }; +N l26n132[] = { { sRa5c3a5, .827 }, { sb9cdHc1, .227 }, H }; +N l26n133[] = { { sa5bba1bc, .552 }, { sa5ea, .227 }, H }; +N l26n134[] = { { sa4cfa1, .243 }, H }; +N l26n135[] = { { seba1a3g, 1.679 }, { sc4ccbfae, .438 }, { sa3c9a3A, .195 }, H }; +N l26n136[] = { { sa4ec, .487 }, H }; +N l26n137[] = { { seca5, .219 }, H }; +N l26n138[] = { { sa4ce, 1.103 }, { sa3c2a1, .219 }, H }; +N l26n139[] = { { sa4bf, .422 }, { sa1bca5D, .519 }, H }; +N l26n141[] = { { sa3A, .162 }, { scdf8cdB, .438 }, { sbca5b8a4, .260 }, { sf5c2, .146 }, { sa5f3a5c8, .195 }, { sa4a4a4eb, .195 }, H }; +N l26n142[] = { { sa3c1, .243 }, { saebc, .178 }, { sa3Aa3, .219 }, { sa4eba5, .195 }, H }; +N l26n143[] = { { sb7a4c6, .243 }, H }; +N l26n144[] = { { sEa4, .438 }, H }; +N l26n145[] = { { seca4eb, .548 }, { sb3a4, .211 }, { sga1, .211 }, H }; +N l26n146[] = { { sc3a5, .706 }, H }; +N l26n147[] = { { sa2a5, .097 }, H }; +N l26n148[] = { { sa4eca4, .730 }, { se8cdfd, .292 }, H }; +N l26n149[] = { { sRa5c3, .621 }, H }; +N l26n150[] = { { sa5eb, .243 }, { saebcEa4, .292 }, { sc1c7, .195 }, { sa4cea4, .170 }, H }; +N l26n151[] = { { sa4bfa4, .365 }, { sf3a5bf, .256 }, { sa1bca5H, .195 }, { sbdbca8, .146 }, H }; +N l26n152[] = { { sa5b9cdH, .227 }, { scca4, .146 }, H }; +N l26n154[] = { { sa5af, .260 }, { sa4O, .097 }, H }; +N l26n155[] = { { sa4cf, .568 }, { sc3a5bb, .621 }, { sa2a4eb, .170 }, H }; +N l26n156[] = { { sb5a1, .373 }, { sa5eaa5, .195 }, H }; +N l26n157[] = { { sbef5c2, .146 }, H }; +N l26n158[] = { { sa4a2, .146 }, { sFa3, .170 }, H }; +N l26n159[] = { { sb5a1bca5, .519 }, { sa3c2, .146 }, H }; +N l26n160[] = { { scdfd, .316 }, { sf8cdB, .329 }, { sc4a4, .195 }, H }; +N l26n161[] = { { sbca5b8, .462 }, { sa4cea5, .195 }, { sa3a4, .097 }, H }; +N l26n162[] = { { sc1c7a4, .256 }, H }; +N l26n164[] = { { sc7L, .219 }, H }; +N l26n165[] = { { sa7ac, .162 }, { sf8cd, .219 }, H }; +N l26n166[] = { { scda3, .341 }, { sc7bd, .146 }, { sa4Oa4, .146 }, H }; +N l26n167[] = { { sa5ec, .162 }, H }; +N l26n168[] = { { sa5N, .130 }, H }; +N l26n170[] = { { sa5bf, .308 }, { saebcE, .268 }, { sa4a2a4, .219 }, { sc6b0, .170 }, H }; +N l26n171[] = { { sc6a1, .292 }, H }; +N l26n173[] = { { sa5eba5, .146 }, H }; +N l26n175[] = { { sbfae, .649 }, H }; +N l26n176[] = { { sb5a1bc, .389 }, H }; +N l26n177[] = { { sa4b5a4ec, .649 }, { sa5afa5, .292 }, H }; +N l26n178[] = { { sa1a3g, 1.278 }, { sa3a5, .114 }, H }; +N l26n179[] = { { sga3, .195 }, H }; +N l26n180[] = { { scdB, .316 }, { sc2G, .146 }, H }; +N l26n181[] = { { se8cd, .195 }, { sa5eba1bc, .195 }, H }; +N l26n183[] = { { sc6a1a4, .219 }, H }; +N l26n184[] = { { saca4, .114 }, { sNa5, .146 }, H }; +N l26n185[] = { { sbca5, 1.087 }, { sbca5Da5, .519 }, H }; +N l26n186[] = { { scdHc1c7, .389 }, H }; +N l26n187[] = { { sbfaea4, .170 }, H }; +N l26n189[] = { { sa5a2, .097 }, H }; +N l26n190[] = { { sb9e7, .195 }, { sa5eca5, .219 }, H }; +N l26n191[] = { { sa4b3, .195 }, { sf5c2G, .219 }, H }; +N l26n192[] = { { sa4a4, .730 }, { sFa5, .219 }, { sa3D, .114 }, H }; +N l26n193[] = { { sa5bfa5, .243 }, { sa3c4, .114 }, H }; +N l26n194[] = { { scfa1, .292 }, { sc6a1a5, .219 }, H }; +N l26n195[] = { { sbfaebc, .268 }, H }; +N l26n196[] = { { sga4, .308 }, H }; +N l26n198[] = { { sOa4, .195 }, { sc1f7, .170 }, H }; +N l26n199[] = { { sbda4, .162 }, H }; +N l26n200[] = { { scdBbc, .292 }, H }; +N l26n202[] = { { sbca5D, .389 }, H }; +N l26n203[] = { { sa4b3a4, .292 }, { sBbc, .195 }, { sa5A, .097 }, { sc1ac, .146 }, H }; +N l26n204[] = { { sa4a4a4, .389 }, H }; +N l26n206[] = { { sa5a3, .308 }, { scfa1a4, .365 }, { sGa4, .219 }, { sc0ae, .195 }, { sa3c6a1, .146 }, H }; +N l26n207[] = { { sb5a4, .324 }, { sa5a4a5f3, .292 }, { sa4c3, .097 }, H }; +N l26n209[] = { { sa4a5, .292 }, { sa3E, .097 }, H }; +N l26n210[] = { { sa7aca7, .243 }, H }; +N l26n211[] = { { sBbcEa4, .292 }, H }; +N l26n212[] = { { sa1a5g, .548 }, { sf5bfae, .475 }, { sf8cdBbc, .389 }, { sa5a2a5, .146 }, H }; +N l26n213[] = { { sga5, .341 }, H }; +N l26n214[] = { { scea4, .268 }, { sc6a4a4a4, .341 }, { sa7aca7ac, .195 }, H }; +N l26n215[] = { { sada4, .162 }, { sc8af, .195 }, { sc7a4ce, .219 }, H }; +N l26n216[] = { { sbcE, .324 }, H }; +N l26n217[] = { { sa4a4eb, .146 }, { sa4c6a1a4, .195 }, H }; +N l26n218[] = { { sHc1, .195 }, H }; +N l26n219[] = { { sa4c3a4, .146 }, H }; +N l26n220[] = { { sDa5b9cd, .341 }, H }; +N l26n221[] = { { sa3g, .852 }, { sccbfae, .329 }, H }; +N l26n222[] = { { sc6a4, .316 }, H }; +N l26n223[] = { { sb5a4eca4, .649 }, { sa5a4, .243 }, { sc7a4a2a4, .389 }, H }; +N l26n224[] = { { safbf, .097 }, H }; +N l26n225[] = { { sa4b5, .324 }, { sc1aca7a3, .292 }, H }; +N l26n226[] = { { sa3F, .146 }, { sa4a6, .130 }, { sa5Aa5, .146 }, H }; +N l26n227[] = { { sa3Fa3, .170 }, H }; +N l26n228[] = { { sbcEa4, .389 }, { sc9bd, .292 }, H }; +N l26n229[] = { { sa5a3a5, .170 }, H }; +N l26n231[] = { { scea5, .219 }, { sBbcE, .292 }, { sa3c1aca7, .195 }, H }; +N l26n233[] = { { sa1ca, .178 }, { sFa3c1, .219 }, H }; +N l26n234[] = { { sb4abb9f0, .260 }, { sc6a4a4, .256 }, { sa7a1, .097 }, H }; +N l26n235[] = { { saca7, .892 }, { sa5b5a1, .389 }, H }; +N l26n236[] = { { saca7a3, .462 }, { sa5R, .292 }, { sbca8, .146 }, H }; +N l26n237[] = { { sa4b5a4, .487 }, { sa4c6a1, .146 }, H }; +N l26n238[] = { { sa5c3, .470 }, { sa4f2, .438 }, H }; +N l26n239[] = { { sc6a5, .292 }, H }; +N l26n240[] = { { sc9bdbca8, .292 }, H }; +N l26n242[] = { { sa4b9a4eb, .681 }, { sa3c1ac, .146 }, H }; +N l26n243[] = { { sb5a4ec, .487 }, { sc7a4a2, .292 }, H }; +N l26n244[] = { { sbfa3, .114 }, H }; +N l26n245[] = { { scfa4, .146 }, H }; +N l26n246[] = { { sa5a4a5, .365 }, { saea4, .178 }, { sbca5H, .146 }, H }; +N l26n248[] = { { sc1aca7, .219 }, { sbca8a4, .146 }, { sc9bdbc, .219 }, H }; +N l26n250[] = { { sa1cb, .146 }, { sa4c6a4a4, .227 }, { sf3a5c8, .219 }, H }; +N l26n251[] = { { sa1bc, 1.119 }, { sa4cfg, .219 }, H }; +N l26n252[] = { { se8a4, .462 }, H }; +N l26n253[] = { { sc7a4, .584 }, H }; +N l26n254[] = { { sa5D, .308 }, { sabb9, .130 }, { sHa5, .195 }, H }; + +D l26_d = { "japanese", "euc_jp", - { - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,0.001,W,W,W,0.002, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,0.005,0.001,0.002,0.006,0.002,0.002,0.003,0.001,0.006,W,W,0.002,0.002,0.007,0.003, - 0.002,0.000,0.003,0.006,0.008,0.003,0.002,W,W,0.001,0.000,W,W,W,W,W, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - Y,0.147,0.014,0.130,0.457,0.316,0.006,0.041,0.012,0.006,0.013,0.010,0.054,0.010,0.033,0.023, - 0.022,0.008,0.014,0.019,0.025,0.039,0.007,0.030,0.038,0.071,0.009,0.032,0.086,0.037,0.019,0.069, - 0.022,0.052,0.041,0.057,0.048,0.028,0.064,0.060,0.068,0.042,0.067,0.060,0.048,0.077,0.089,0.049, - 0.027,0.016,0.004,0.029,0.030,0.019,0.021,0.023,0.018,0.010,0.002,0.015,0.014,0.017,0.014,0.011, - 0.007,0.027,0.010,0.004,0.009,0.008,0.010,0.022,0.030,0.014,0.037,0.075,0.046,0.004,0.004,0.007, - 0.014,0.006,0.031,0.035,0.005,0.022,0.005,0.008,0.011,0.001,0.003,V,0.005,0.019,0.014,V - }, - { - l26n0,X,l26n2,l26n3,l26n4,l26n5,X,l26n7,l26n8,l26n9,X,l26n11,l26n12,l26n13,l26n14,l26n15, - X,l26n17,l26n18,l26n19,X,l26n21,l26n22,l26n23,X,X,l26n26,l26n27,l26n28,X,l26n30,l26n31, - l26n32,l26n33,l26n34,X,l26n36,l26n37,l26n38,l26n39,X,l26n41,l26n42,l26n43,l26n44,X,l26n46,l26n47, - l26n48,l26n49,l26n50,l26n51,l26n52,l26n53,l26n54,l26n55,l26n56,l26n57,l26n58,X,l26n60,l26n61,l26n62,l26n63, - l26n64,l26n65,l26n66,l26n67,l26n68,l26n69,l26n70,l26n71,l26n72,l26n73,l26n74,l26n75,l26n76,X,l26n78,l26n79, - l26n80,l26n81,l26n82,l26n83,l26n84,l26n85,l26n86,l26n87,X,l26n89,l26n90,l26n91,l26n92,l26n93,X,l26n95, - X,l26n97,l26n98,l26n99,l26n100,l26n101,l26n102,l26n103,l26n104,X,l26n106,l26n107,X,X,X,X, - X,l26n113,l26n114,X,l26n116,l26n117,X,l26n119,l26n120,l26n121,l26n122,X,X,l26n125,l26n126,X, - X,l26n129,l26n130,l26n131,l26n132,l26n133,l26n134,l26n135,l26n136,l26n137,l26n138,l26n139,X,l26n141,l26n142,l26n143, - l26n144,l26n145,l26n146,l26n147,l26n148,l26n149,l26n150,l26n151,l26n152,X,l26n154,l26n155,l26n156,l26n157,l26n158,l26n159, - l26n160,l26n161,l26n162,X,l26n164,l26n165,l26n166,l26n167,l26n168,X,l26n170,l26n171,X,l26n173,X,l26n175, - l26n176,l26n177,l26n178,l26n179,l26n180,l26n181,X,l26n183,l26n184,l26n185,l26n186,l26n187,X,l26n189,l26n190,l26n191, - l26n192,l26n193,l26n194,l26n195,l26n196,X,l26n198,l26n199,l26n200,X,l26n202,l26n203,l26n204,X,l26n206,l26n207, - X,l26n209,l26n210,l26n211,l26n212,l26n213,l26n214,l26n215,l26n216,l26n217,l26n218,l26n219,l26n220,l26n221,l26n222,l26n223, - l26n224,l26n225,l26n226,l26n227,l26n228,l26n229,X,l26n231,X,l26n233,l26n234,l26n235,l26n236,l26n237,l26n238,l26n239, - l26n240,X,l26n242,l26n243,l26n244,l26n245,l26n246,X,l26n248,X,l26n250,l26n251,l26n252,l26n253,l26n254,X - } + { W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, 0.001, W, W, W, 0.002, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, 0.005, 0.001, 0.002, 0.006, 0.002, 0.002, 0.003, 0.001, 0.006, W, W, 0.002, 0.002, 0.007, 0.003, + 0.002, 0.000, 0.003, 0.006, 0.008, 0.003, 0.002, W, W, 0.001, 0.000, W, W, W, W, W, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + Y, 0.147, 0.014, 0.130, 0.457, 0.316, 0.006, 0.041, 0.012, 0.006, 0.013, 0.010, 0.054, 0.010, 0.033, 0.023, + 0.022, 0.008, 0.014, 0.019, 0.025, 0.039, 0.007, 0.030, 0.038, 0.071, 0.009, 0.032, 0.086, 0.037, 0.019, 0.069, + 0.022, 0.052, 0.041, 0.057, 0.048, 0.028, 0.064, 0.060, 0.068, 0.042, 0.067, 0.060, 0.048, 0.077, 0.089, 0.049, + 0.027, 0.016, 0.004, 0.029, 0.030, 0.019, 0.021, 0.023, 0.018, 0.010, 0.002, 0.015, 0.014, 0.017, 0.014, 0.011, + 0.007, 0.027, 0.010, 0.004, 0.009, 0.008, 0.010, 0.022, 0.030, 0.014, 0.037, 0.075, 0.046, 0.004, 0.004, 0.007, + 0.014, 0.006, 0.031, 0.035, 0.005, 0.022, 0.005, 0.008, 0.011, 0.001, 0.003, V, 0.005, 0.019, 0.014, V }, + { l26n0, X, l26n2, l26n3, l26n4, l26n5, X, l26n7, l26n8, l26n9, X, l26n11, l26n12, l26n13, l26n14, l26n15, + X, l26n17, l26n18, l26n19, X, l26n21, l26n22, l26n23, X, X, l26n26, l26n27, l26n28, X, l26n30, l26n31, + l26n32, l26n33, l26n34, X, l26n36, l26n37, l26n38, l26n39, X, l26n41, l26n42, l26n43, l26n44, X, l26n46, l26n47, + l26n48, l26n49, l26n50, l26n51, l26n52, l26n53, l26n54, l26n55, l26n56, l26n57, l26n58, X, l26n60, l26n61, l26n62, l26n63, + l26n64, l26n65, l26n66, l26n67, l26n68, l26n69, l26n70, l26n71, l26n72, l26n73, l26n74, l26n75, l26n76, X, l26n78, l26n79, + l26n80, l26n81, l26n82, l26n83, l26n84, l26n85, l26n86, l26n87, X, l26n89, l26n90, l26n91, l26n92, l26n93, X, l26n95, + X, l26n97, l26n98, l26n99, l26n100, l26n101, l26n102, l26n103, l26n104, X, l26n106, l26n107, X, X, X, X, + X, l26n113, l26n114, X, l26n116, l26n117, X, l26n119, l26n120, l26n121, l26n122, X, X, l26n125, l26n126, X, + X, l26n129, l26n130, l26n131, l26n132, l26n133, l26n134, l26n135, l26n136, l26n137, l26n138, l26n139, X, l26n141, l26n142, l26n143, + l26n144, l26n145, l26n146, l26n147, l26n148, l26n149, l26n150, l26n151, l26n152, X, l26n154, l26n155, l26n156, l26n157, l26n158, l26n159, + l26n160, l26n161, l26n162, X, l26n164, l26n165, l26n166, l26n167, l26n168, X, l26n170, l26n171, X, l26n173, X, l26n175, + l26n176, l26n177, l26n178, l26n179, l26n180, l26n181, X, l26n183, l26n184, l26n185, l26n186, l26n187, X, l26n189, l26n190, l26n191, + l26n192, l26n193, l26n194, l26n195, l26n196, X, l26n198, l26n199, l26n200, X, l26n202, l26n203, l26n204, X, l26n206, l26n207, + X, l26n209, l26n210, l26n211, l26n212, l26n213, l26n214, l26n215, l26n216, l26n217, l26n218, l26n219, l26n220, l26n221, l26n222, l26n223, + l26n224, l26n225, l26n226, l26n227, l26n228, l26n229, X, l26n231, X, l26n233, l26n234, l26n235, l26n236, l26n237, l26n238, l26n239, + l26n240, X, l26n242, l26n243, l26n244, l26n245, l26n246, X, l26n248, X, l26n250, l26n251, l26n252, l26n253, l26n254, X } }; - - // // Lng: japanese // Enc: shift_jis // - -S s82cc[]={130,204,0}; -S s81X[]={129,97,0}; -S s82c9[]={130,201,0}; -S s82f0[]={130,240,0}; -S s82c6[]={130,198,0}; -S s82b5[]={130,181,0}; -S s82bd[]={130,189,0}; -S s82c8[]={130,200,0}; -S s82c4[]={130,196,0}; -S s81Y[]={129,98,0}; -S s82c5[]={130,197,0}; -S sb582[]={181,130,0}; -S s82b582[]={130,181,130,0}; -S sg82[]={32,130,0}; -S s82e9[]={130,233,0}; -S sc882[]={200,130,0}; -S s82c882[]={130,200,130,0}; -S s82a9[]={130,169,0}; -S sa982[]={169,130,0}; -S s82cd[]={130,205,0}; -S s82b7[]={130,183,0}; -S sc682[]={198,130,0}; -S s82e8[]={130,232,0}; -S s82a2[]={130,162,0}; -S s82a982[]={130,169,130,0}; -S s82c682[]={130,198,130,0}; -S sbd82[]={189,130,0}; -S s82M[]={130,220,0}; -S sa282[]={162,130,0}; -S s82e7[]={130,231,0}; -S s82a282[]={130,162,130,0}; -S s82M82[]={130,220,130,0}; -S sc582[]={197,130,0}; -S sM82[]={220,130,0}; -S s82aa[]={130,170,0}; -S s82ad[]={130,173,0}; -S sc482[]={196,130,0}; -S s82c582[]={130,197,130,0}; -S s82bd82[]={130,189,130,0}; -S sg81[]={32,129,0}; -S sX82[]={97,130,0}; -S s82c482[]={130,196,130,0}; -S se882[]={232,130,0}; -S sad82[]={173,130,0}; -S sc182[]={193,130,0}; -S s81X82[]={129,97,130,0}; -S s82c1[]={130,193,0}; -S s8140[]={129,64,0}; -S s82c182[]={130,193,130,0}; -S s81Yg[]={129,98,a}; -S sz82[]={v,130,0}; -S s82c982[]={130,201,130,0}; -S sc982[]={201,130,0}; -S s82Q[]={130,224,0}; -S sb781[]={183,129,0}; -S se982[]={233,130,0}; -S sg83[]={32,131,0}; -S s82e982[]={130,233,130,0}; -S s7882[]={x,130,0}; -S sm82[]={i,130,0}; -S s82b582c4[]={130,181,130,196,0}; -S sb781Y[]={183,129,98,0}; -S sg8140[]={32,129,64,0}; -S sb582c4[]={181,130,196,0}; -S s82e882[]={130,232,130,0}; -S s82t[]={130,p,0}; -S sb782[]={183,130,0}; -S sbd81[]={189,129,0}; -S s82b781Y[]={130,183,129,98,0}; -S s82bd81[]={130,189,129,0}; -S sY82[]={98,130,0}; -S s82b781[]={130,183,129,0}; -S s82a982e7[]={130,169,130,231,0}; -S s92r[]={146,n,0}; -S scd82[]={205,130,0}; -S s82a4[]={130,164,0}; -S sb182[]={177,130,0}; -S sa982e7[]={169,130,231,0}; -S se782[]={231,130,0}; -S sea82[]={234,130,0}; -S sW82[]={230,130,0}; -S s81Y82[]={129,98,130,0}; -S s82ab[]={130,171,0}; -S sab82[]={171,130,0}; -S s82be[]={130,190,0}; -S sP82[]={223,130,0}; -S s82b782[]={130,183,130,0}; -S s82M82b7[]={130,220,130,183,0}; -S sbe82[]={190,130,0}; -S saf82[]={175,130,0}; -S sM82b7[]={220,130,183,0}; -S scc82[]={204,130,0}; -S sr82[]={n,130,0}; -S s82P[]={130,223,0}; -S s82ad82[]={130,173,130,0}; -S sa082[]={160,130,0}; -S sf082[]={240,130,0}; -S s8378[]={131,x,0}; -S sf182[]={241,130,0}; -S s9286[]={146,134,0}; -S s81g[]={129,a}; -S saa82[]={170,130,0}; -S s82ea[]={130,234,0}; -S s94r[]={148,n,0}; -S s82ea82[]={130,234,130,0}; -S sbd81Y[]={189,129,98,0}; -S sX90[]={97,144,0}; -S s91V[]={145,229,0}; -S sM82b781[]={220,130,183,129,0}; -S s81z[]={129,v,0}; -S s82e782[]={130,231,130,0}; -S s82be82[]={130,190,130,0}; -S st82[]={p,130,0}; -S s82bd81Y[]={130,189,129,98,0}; -S s82af[]={130,175,0}; -S scc8e[]={204,142,0}; -S sb582bd[]={181,130,189,0}; -S s82b582bd[]={130,181,130,189,0}; -S s82b182[]={130,177,130,0}; -S s82cc8e[]={130,204,142,0}; -S sb982[]={185,130,0}; -S s82cc82[]={130,204,130,0}; -S s95aa[]={149,170,0}; -S sa482[]={164,130,0}; -S s82b1[]={130,177,0}; -S s81y[]={129,u,0}; -S s90p[]={144,l,0}; -S sk82[]={g,130,0}; -S scd81[]={205,129,0}; -S s82ab82[]={130,171,130,0}; -S s82cd81[]={130,205,129,0}; -S s82P82[]={130,223,130,0}; -S sbb82[]={187,130,0}; -S s82f1[]={130,241,0}; -S s82cd82[]={130,205,130,0}; -S sb382[]={179,130,0}; -S s81X90[]={129,97,144,0}; -S s8d91[]={141,145,0}; -S s90ad[]={144,173,0}; -S s82a482[]={130,164,130,0}; -S sp82[]={l,130,0}; -S s82bf[]={130,191,0}; -S s89fc[]={137,252,0}; -S s89fc8a[]={137,252,138,0}; -S s82e882M[]={130,232,130,220,0}; -S se882M[]={232,130,220,0}; -S sw82[]={s,130,0}; -S s82c481[]={130,196,129,0}; -S sc182bd[]={193,130,189,0}; -S s8az[]={138,v,0}; -S s82cd81X[]={130,205,129,97,0}; -S sQ82[]={224,130,0}; -S s93m[]={147,i,0}; -S sfc8a[]={252,138,0}; -S s82c182bd[]={130,193,130,189,0}; -S s82c182c4[]={130,193,130,196,0}; -S sb782e9[]={183,130,233,0}; -S s82f082[]={130,240,130,0}; -S s89fc8az[]={137,252,138,v,0}; -S s95fb[]={149,251,0}; -S se882M82[]={232,130,220,130,0}; -S sfc8az[]={252,138,v,0}; -S scd81X[]={205,129,97,0}; -S s82b782e9[]={130,183,130,233,0}; -S sc182c4[]={193,130,196,0}; -S s93m82[]={147,i,130,0}; -S s8a_[]={138,w,0}; -S sc481[]={196,129,0}; -S sb582c482[]={181,130,196,130,0}; -S s4082[]={64,130,0}; -S s82aa82[]={130,170,130,0}; -S sc482a2[]={196,130,162,0}; -S s81z82[]={129,v,130,0}; -S sf08e[]={240,142,0}; -S s82c481X[]={130,196,129,97,0}; -S s82a082[]={130,160,130,0}; -S s82b382[]={130,179,130,0}; -S s81X92[]={129,97,146,0}; -S s83n[]={131,j,0}; -S sb781Y82[]={183,129,98,130,0}; -S s82t82[]={130,p,130,0}; -S scc8d[]={204,141,0}; -S s82u[]={130,q,0}; -S s9594[]={149,148,0}; -S s82c482a2[]={130,196,130,162,0}; -S sc981[]={201,129,0}; -S s82f182[]={130,241,130,0}; -S s82a0[]={130,160,0}; -S s82f08e[]={130,240,142,0}; -S s94r82[]={148,n,130,0}; -S s90b6[]={144,182,0}; -S s82c7[]={130,199,0}; -S sc481X[]={196,129,97,0}; -S s82cc8d[]={130,204,141,0}; -S sb182c6[]={177,130,198,0}; -S sX92[]={97,146,0}; -S s82b3[]={130,179,0}; -S s82c981X[]={130,201,129,97,0}; -S s82af82[]={130,175,130,0}; -S sX83[]={97,131,0}; -S sc182bd81[]={193,130,189,129,0}; -S s_82[]={w,130,0}; -S s89ef[]={137,239,0}; -S sf08a[]={240,138,0}; -S scc92[]={204,146,0}; -S s82f090[]={130,240,144,0}; -S s82cc91[]={130,204,145,0}; -S sf090[]={240,144,0}; -S s82bf82[]={130,191,130,0}; -S sr95fb[]={n,149,251,0}; -S s82Q82[]={130,224,130,0}; -S sX8e[]={97,142,0}; -S sca82[]={202,130,0}; -S s82b9[]={130,185,0}; -S s82e982c6[]={130,233,130,198,0}; -S sbf82[]={191,130,0}; -S sc98e[]={201,142,0}; -S s8278[]={130,x,0}; -S sc482a282[]={196,130,162,130,0}; -S sc981X[]={201,129,97,0}; -S s8dw[]={141,s,0}; -S sad81[]={173,129,0}; -S sb781Yg[]={183,129,98,a}; -S s82S[]={130,226,0}; -S s82W82[]={130,230,130,0}; -S s92r95fb[]={146,n,149,251,0}; -S s827882[]={130,x,130,0}; -S scc91[]={204,145,0}; -S s92r95[]={146,n,149,0}; -S sr95[]={n,149,0}; -S s835e[]={131,94,0}; -S s82W[]={130,230,0}; -S s9182[]={145,130,0}; -S s97cd[]={151,205,0}; -S s82ed[]={130,237,0}; -S s82c98e[]={130,201,142,0}; -S sed82[]={237,130,0}; -S sc782[]={199,130,0}; -S s8393[]={131,147,0}; -S s82cc92[]={130,204,146,0}; -S sa882[]={168,130,0}; -S se982c6[]={233,130,198,0}; -S s82b982[]={130,185,130,0}; -S s81X8e[]={129,97,142,0}; -S s82c981[]={130,201,129,0}; -S s82v[]={130,r,0}; -S s89ca[]={137,202,0}; -S s8f97[]={143,151,0}; -S s838c[]={131,140,0}; -S sa282bd[]={162,130,189,0}; -S sb182c682[]={177,130,198,130,0}; -S s82f08c[]={130,240,140,0}; -S sc082[]={192,130,0}; -S sz89[]={v,137,0}; -S se981[]={233,129,0}; -S sX8d[]={97,141,0}; -S sb682[]={182,130,0}; -S s8ec0[]={142,192,0}; -S s93af[]={147,175,0}; -S s82ed82[]={130,237,130,0}; -S s82e981[]={130,233,129,0}; -S s90z[]={144,v,0}; -S sx82[]={t,130,0}; -S sf08c[]={240,140,0}; -S s82c682b5[]={130,198,130,181,0}; -S s81m[]={129,i,0}; -S s96f0[]={150,240,0}; -S s8ea9[]={142,169,0}; -S s82b182c6[]={130,177,130,198,0}; -S sc682b582[]={198,130,181,130,0}; -S s9085[]={144,133,0}; -S sX91[]={97,145,0}; -S sb782e982[]={183,130,233,130,0}; -S s837883[]={131,x,131,0}; -S s7883[]={x,131,0}; -S sc582ab82[]={197,130,171,130,0}; -S sfb82[]={251,130,0}; -S sbd81Y82[]={189,129,98,130,0}; -S s89ba[]={137,186,0}; -S s8d9182[]={141,145,130,0}; -S sg8d[]={32,141,0}; -S s90p82[]={144,l,130,0}; -S s8c8e[]={140,142,0}; -S s97a7[]={151,167,0}; -S s8dec[]={141,236,0}; -S sc582ab[]={197,130,171,0}; -S s82c582ab[]={130,197,130,171,0}; -S s82a282bd[]={130,162,130,189,0}; -S sa682[]={166,130,0}; -S s90m[]={144,i,0}; -S sc882e8[]={200,130,232,0}; -S s8582[]={133,130,0}; -S sn83[]={j,131,0}; -S s82c882e8[]={130,200,130,232,0}; -S sc682b5[]={198,130,181,0}; -S s8ca0[]={140,160,0}; -S s83_[]={131,w,0}; -S sa282bd82[]={162,130,189,130,0}; -S s8e9e[]={142,158,0}; -S sV82[]={229,130,0}; -S s82y[]={130,u,0}; -S s93Q[]={147,224,0}; -S s8eu[]={142,q,0}; -S s81z82c6[]={129,v,130,198,0}; -S s82cc8f[]={130,204,143,0}; -S s82ab82e9[]={130,171,130,233,0}; -S sQ90[]={224,144,0}; -S s83l[]={131,h,0}; -S s82f08a[]={130,240,138,0}; -S s839383[]={131,147,131,0}; -S s83r[]={131,n,0}; -S s81X8d[]={129,97,141,0}; -S se981Y[]={233,129,98,0}; -S s9383[]={147,131,0}; -S s8f_[]={143,w,0}; -S sc582Q[]={197,130,224,0}; -S sg8b[]={32,139,0}; -S sbd81Yg[]={189,129,98,a}; -S ss83[]={o,131,0}; -S s82N[]={130,221,0}; -S s82bb[]={130,187,0}; -S sc882e882[]={200,130,232,130,0}; -S s98X[]={152,97,0}; -S sfc8azg[]={252,138,v,a}; -S s93m82c8[]={147,i,130,200,0}; -S se981Yg[]={233,129,98,a}; -S s837882[]={131,x,130,0}; -S se781[]={231,129,0}; -S s90ab[]={144,171,0}; -S s92b2[]={146,178,0}; -S s82bb82[]={130,187,130,0}; -S s8fT[]={143,227,0}; -S s838b[]={131,139,0}; -S sz82c6[]={v,130,198,0}; -S s8azg[]={138,v,a}; -S s83n83[]={131,j,131,0}; -S sY83[]={98,131,0}; -S s82b581[]={130,181,129,0}; -S sL82[]={219,130,0}; -S s82x[]={130,t,0}; -S s8b82[]={139,130,0}; -S s838c83[]={131,140,131,0}; -S s82Q81[]={130,224,129,0}; -S s90ec[]={144,236,0}; -S sv82[]={r,130,0}; -S sn82[]={j,130,0}; -S s8cs[]={140,o,0}; -S s9182cc[]={145,130,204,0}; -S s96b1[]={150,177,0}; -S s88c0[]={136,192,0}; -S s8e9f[]={142,159,0}; -S scc8f[]={204,143,0}; -S sg82c9[]={32,130,201,0}; -S s82c882a2[]={130,200,130,162,0}; -S s8c83[]={140,131,0}; -S s83l83[]={131,h,131,0}; -S sl83[]={h,131,0}; -S s7a82[]={z,130,0}; -S s8e96[]={142,150,0}; -S sba82[]={186,130,0}; -S sa782[]={167,130,0}; -S s8bad[]={139,173,0}; -S s814082[]={129,64,130,0}; -S sQ81[]={224,129,0}; -S s8cbb[]={140,187,0}; -S s82e981Y[]={130,233,129,98,0}; -S s97cd82[]={151,205,130,0}; -S s8bc6[]={139,198,0}; -S s81n[]={129,j,0}; -S sb581[]={181,129,0}; -S s91w[]={145,s,0}; -S s8dQ[]={141,224,0}; -S sf094[]={240,148,0}; -S sc882a2[]={200,130,162,0}; -S s81X83[]={129,97,131,0}; -S s8eg[]={142,a}; -S scc89[]={204,137,0}; -S s89c6[]={137,198,0}; -S s5c91[]={92,145,0}; -S s82c2[]={130,194,0}; -S sQ90ad[]={224,144,173,0}; -S s82cb[]={130,203,0}; -S sc182c482[]={193,130,196,130,0}; -S s82s[]={130,o,0}; -S sab82e9[]={171,130,233,0}; -S sm82c8[]={i,130,200,0}; -S s88ea[]={136,234,0}; -S s8fac[]={143,172,0}; -S ss8d[]={o,141,0}; -S s81X9286[]={129,97,146,134,0}; -S s8d9182cc[]={141,145,130,204,0}; -S s82u94[]={130,q,148,0}; -S sS82[]={226,130,0}; -S s82cc96[]={130,204,150,0}; -S sfa82[]={250,130,0}; -S sN82[]={221,130,0}; -S sc582b7[]={197,130,183,0}; - -N l27n0[]={{sr95fb,.106},{sS82,.091},H}; -N l27n1[]={{sc182,.498},{s89ca,.106},H}; -N l27n2[]={{sa082,.196},{s88ea,.075},H}; -N l27n3[]={{s82bf82,.158},H}; -N l27n4[]={{s82W,.106},H}; -N l27n6[]={{s82c8,.709},{sa982e7,.362},H}; -N l27n7[]={{s82b9,.106},{sfb82,.136},H}; -N l27n8[]={{s82aa,.392},H}; -N l27n9[]={{sb982,.166},{s82cd81X,.272},H}; -N l27n10[]={{sbd81Yg,.226},H}; -N l27n11[]={{s81z82,.181},{s_82,.070},H}; -N l27n16[]={{s81X,1.282},H}; -N l27n17[]={{sb182,.241},{scc8d,.181},{s82ed82,.136},H}; -N l27n19[]={{sc981X,.238},{sadg,.113},H}; -N l27n21[]={{s82e7,.422},{s82M82b7,.392},{s82b182,.249},H}; -N l27n22[]={{s82a282,.634},H}; -N l27n23[]={{s82c9,.935},H}; -N l27n24[]={{sca82,.158},{s838b,.075},H}; -N l27n25[]={{sa982,.513},{s82ab,.226},{sb182c682,.181},H}; -N l27n26[]={{s96f0,.091},H}; -N l27n27[]={{sk82,.101},{s835e,.106},{sg8b,.075},H}; -N l27n28[]={{sX8d,.060},{s90ec,.075},H}; -N l27n29[]={{sc582Q,.170},{s82s,.075},H}; -N l27n31[]={{s82e982c6,.211},{s81X8d,.113},{sQ90ad,.170},H}; -N l27n32[]={{sc182bd,.306},{sfc8azg,.339},H}; -N l27n33[]={{s81Y,.694},H}; -N l27n34[]={{scc8e,.249},H}; -N l27n35[]={{sM82b7,.441},{s82P82,.226},H}; -N l27n36[]={{ss83,.050},H}; -N l27n37[]={{s82c182,.475},{sg82c9,.113},H}; -N l27n38[]={{s82e8,.498},H}; -N l27n39[]={{sL82,.113},H}; -N l27n40[]={{s8e96,.075},{sba82,.075},H}; -N l27n41[]={{s838c,.091},{s82bb,.075},{s82Q81,.113},H}; -N l27n42[]={{s7882,.181},{s81X8e,.158},H}; -N l27n43[]={{s83r,.075},H}; -N l27n45[]={{sX8e,.070},H}; -N l27n46[]={{s82t,.272},{se882M,.306},H}; -N l27n48[]={{sbd81Y82,.181},H}; -N l27n49[]={{sg8140,.407},{s9182,.106},{s82c98e,.158},H}; -N l27n50[]={{st82,.121},{s90p82,.136},{s91w,.075},H}; -N l27n51[]={{scc8f,.113},H}; -N l27n52[]={{s82Q82,.158},H}; -N l27n54[]={{s82b782e9,.272},H}; -N l27n55[]={{s82e9,.588},{s82b382,.181},{sr95,.070},H}; -N l27n56[]={{saa82,.196},{s82a482,.226},{s8f_,.075},{s88c0,.075},H}; -N l27n57[]={{s82cb,.075},H}; -N l27n58[]={{s94r,.196},{sf08a,.158},H}; -N l27n59[]={{s82ad,.392},{s7883,.060},H}; -N l27n61[]={{sg8d,.091},H}; -N l27n62[]={{s82c482a2,.241},H}; -N l27n63[]={{s82u,.121},H}; -N l27n64[]={{sa282,.438},{s81X90,.226},H}; -N l27n65[]={{s89fc8a,.204},{s839383,.113},H}; -N l27n66[]={{s82a982e7,.483},H}; -N l27n68[]={{s82f082,.204},H}; -N l27n69[]={{s9085,.091},H}; -N l27n70[]={{sM82,.611},{s90z,.091},H}; -N l27n71[]={{sbb82,.151},H}; -N l27n72[]={{s82ea,.196},H}; -N l27n74[]={{s82cc,1.358},{s8d9182,.136},H}; -N l27n75[]={{s82bd,.769},{sl83,.050},H}; -N l27n76[]={{s827882,.158},H}; -N l27n77[]={{s82c481,.204},{sc481,.204},{s82a282bd,.181},H}; -N l27n78[]={{s82b581,.113},H}; -N l27n79[]={{sX90,.121},{sb382,.151},H}; -N l27n80[]={{s82e882M,.272},{sb781Yg,.317},{s82v,.106},H}; -N l27n82[]={{s8bad,.075},{s8eg,.113},H}; -N l27n83[]={{s89fc,.136},{s8cs,.075},H}; -N l27n84[]={{sc482a2,.272},{s92r95fb,.211},{sb782e982,.181},{s82c882e8,.181},H}; -N l27n85[]={{s95aa,.166},{s82f182,.181},{scc91,.158},{sed82,.158},H}; -N l27n86[]={{scc82,.294},{s81X92,.181},H}; -N l27n87[]={{sab82,.211},H}; -N l27n88[]={{s82c482,.520},{s8f97,.091},{sc882e882,.226},H}; -N l27n89[]={{s82b582,.973},{sm82,.181},{s82cc8d,.181},H}; -N l27n90[]={{s82M,.438},{sab82e9,.113},{sc582b7,.136},H}; -N l27n91[]={{s82cd,.513},{se982c6,.238},H}; -N l27n92[]={{s82be,.211},{s82c182bd,.272},{s93m82,.204},{sf08c,.136},{sc582ab82,.272},H}; -N l27n93[]={{s82af,.166},{sV82,.113},{s81z82c6,.151},H}; -N l27n94[]={{sc482,.588},{s82a0,.121},{se981Yg,.339},H}; -N l27n95[]={{sa282bd,.136},{s8cbb,.075},H}; -N l27n96[]={{sX91,.060},{s97a7,.091},H}; -N l27n97[]={{sX82,.231},H}; -N l27n98[]={{s4082,.080},{s8c8e,.091},H}; -N l27n99[]={{s92r95,.158},{sz89,.060},{sc682b5,.204},H}; -N l27n100[]={{s82cc8e,.249},{s81y,.166},{scd81,.226},{s8fT,.075},H}; -N l27n101[]={{sN82,.091},H}; -N l27n102[]={{scc92,.158},{s83l83,.113},H}; -N l27n103[]={{s82b182c6,.181},H}; -N l27n104[]={{s7a82,.050},H}; -N l27n105[]={{s82c582,.566},{s90m,.091},H}; -N l27n106[]={{szg,.106},{s82c582ab,.181},{s82ab82e9,.151},H}; -N l27n107[]={{s8ea9,.091},{s82N,.075},{s837882,.113},H}; -N l27n108[]={{s93af,.091},H}; -N l27n109[]={{s82bf,.136},{sc182c4,.306},H}; -N l27n110[]={{sz82c6,.075},H}; -N l27n111[]={{s82cc8f,.113},H}; -N l27n112[]={{s82b781,.385},{s82c481X,.241},{sv82,.050},H}; -N l27n113[]={{sg81,.362},{s82c182c4,.272},{sX92,.080},H}; -N l27n114[]={{sX83,.070},{s82x,.075},H}; -N l27n116[]={{sbd81,.256},H}; -N l27n117[]={{scd82,.362},{s81z,.181},{s814082,.113},H}; -N l27n118[]={{sb781Y82,.241},{s89ef,.106},{s837883,.136},H}; -N l27n119[]={{s8b82,.075},H}; -N l27n120[]={{sc481X,.272},{sn82,.050},H}; -N l27n122[]={{s82c682,.702},H}; -N l27n123[]={{s82b782,.294},{s82ed,.106},H}; -N l27n124[]={{sW82,.339},{s97cd82,.113},{sb581,.075},H}; -N l27n125[]={{sc582,.611},H}; -N l27n126[]={{sa482,.166},{sf08e,.181},H}; -N l27n127[]={{s82b1,.166},{sb582c482,.272},H}; -N l27n128[]={{s82a2,.498},{sY82,.171},{s9383,.075},{s92b2,.075},H}; -N l27n129[]={{s81Yg,.713},H}; -N l27n130[]={{sg82,.634},{s82c882a2,.151},H}; -N l27n131[]={{s82y,.075},H}; -N l27n132[]={{sad81,.106},H}; -N l27n133[]={{sbd82,.468},{s82cc91,.158},H}; -N l27n134[]={{s90b6,.121},H}; -N l27n136[]={{s83n83,.113},H}; -N l27n137[]={{sn83,.060},H}; -N l27n138[]={{se781,.113},H}; -N l27n140[]={{s8az,.136},H}; -N l27n141[]={{sb582,.649},{s82a982,.724},{s82P,.196},H}; -N l27n143[]={{s82c1,.317},{sw82,.091},{scd81X,.306},H}; -N l27n144[]={{s82b582bd,.332},{s82cc92,.158},H}; -N l27n145[]={{sY83,.050},H}; -N l27n147[]={{sg83,.287},{sb182c6,.181},H}; -N l27n148[]={{s9286,.196},{s8ca0,.091},H}; -N l27n149[]={{sad82,.332},H}; -N l27n150[]={{s82b781Y,.513},H}; -N l27n152[]={{s81m,.091},H}; -N l27n153[]={{s82c682b5,.181},H}; -N l27n154[]={{s82W82,.158},H}; -N l27n155[]={{se782,.362},{s82u94,.091},H}; -N l27n156[]={{s82c882,.792},{sc682,.747},{s90p,.151},{s82f08a,.113},H}; -N l27n157[]={{s8a_,.136},{s82b982,.158},H}; -N l27n158[]={{s82Q,.287},{s82aa82,.181},H}; -N l27n160[]={{sf090,.158},{s8393,.106},{s82c2,.075},H}; -N l27n161[]={{s82b3,.121},H}; -N l27n162[]={{s82a4,.241},{s82c981,.158},H}; -N l27n163[]={{sP82,.317},{s89fc8az,.272},{sc182bd81,.317},H}; -N l27n164[]={{sbe82,.196},H}; -N l27n165[]={{s82b582c4,.543},H}; -N l27n166[]={{s81X82,.475},{sM82b781,.543},H}; -N l27n167[]={{s8c83,.075},H}; -N l27n169[]={{s81n,.075},H}; -N l27n170[]={{sbd81Y,.272},H}; -N l27n171[]={{s82e782,.272},H}; -N l27n172[]={{sb582bd,.249},{sb682,.091},H}; -N l27n173[]={{s82c982,.453},{s93Q,.075},H}; -N l27n174[]={{s82f0,.875},{sfc8a,.204},{sx82,.060},{s8d9182cc,.121},H}; -N l27n175[]={{s82ab82,.226},H}; -N l27n176[]={{s8e9e,.075},{sQ90,.113},H}; -N l27n177[]={{sQ81,.113},{s81X83,.113},H}; -N l27n178[]={{sf082,.294},{s82f08c,.136},H}; -N l27n179[]={{s8eu,.075},H}; -N l27n180[]={{s8d91,.151},{se882M82,.407},{s93m82c8,.151},H}; -N l27n182[]={{sp82,.101},{s95fb,.136},{s8278,.106},{s8dw,.106},H}; -N l27n183[]={{s81Y82,.339},H}; -N l27n186[]={{se882,.498},{sb781,.287},H}; -N l27n187[]={{sc782,.158},H}; -N l27n188[]={{s82e882,.407},{sa682,.091},{s82cc96,.091},H}; -N l27n189[]={{s8582,.091},{s89c6,.075},{s8fac,.060},H}; -N l27n191[]={{s81g,.294},{s82f1,.151},{s8dec,.091},{s82bb82,.113},H}; -N l27n192[]={{sfc8az,.306},{s82S,.106},H}; -N l27n193[]={{s8e9f,.075},H}; -N l27n194[]={{s82c4,.709},{sQ82,.204},{s82e981,.136},H}; -N l27n195[]={{s82b5,.785},{sbf82,.106},H}; -N l27n196[]={{s91V,.181},{s82t82,.181},{s83_,.075},H}; -N l27n197[]={{s82c981X,.211},{sc98e,.158},{s83l,.075},{s5c91,.050},H}; -N l27n198[]={{s93m,.136},H}; -N l27n200[]={{s82f08e,.181},{se981,.136},H}; -N l27n202[]={{s838c83,.113},H}; -N l27n203[]={{sb782,.256},{s90ab,.075},H}; -N l27n205[]={{s82e982,.430},{scc89,.113},H}; -N l27n206[]={{sb782e9,.204},{ss8d,.040},H}; -N l27n208[]={{s94r82,.181},{sc882a2,.170},H}; -N l27n209[]={{s82ad82,.294},{sf182,.294},H}; -N l27n210[]={{sc882e8,.204},H}; -N l27n211[]={{s82c5,.664},{saf82,.196},H}; -N l27n213[]={{s8378,.196},H}; -N l27n214[]={{s82bd81,.385},{sc582ab,.204},H}; -N l27n217[]={{se982,.430},{s98X,.075},H}; -N l27n218[]={{sc882,.860},{sc482a282,.317},H}; -N l27n219[]={{sa782,.075},H}; -N l27n222[]={{s82ea82,.272},{s82f090,.158},H}; -N l27n223[]={{s8140,.317},{s9594,.121},H}; -N l27n224[]={{s82cc82,.249},H}; -N l27n225[]={{s82bd82,.566},H}; -N l27n226[]={{sc082,.136},H}; -N l27n228[]={{s82c6,.800},{sf094,.113},H}; -N l27n229[]={{s82b7,.513},{sa282bd82,.151},H}; -N l27n230[]={{s82cd81,.226},{s97cd,.106},H}; -N l27n231[]={{s83n,.121},H}; -N l27n232[]={{sc981,.181},{s82e981Y,.151},{s81X9286,.121},{sfa82,.091},H}; -N l27n233[]={{sc682b582,.272},H}; -N l27n235[]={{s96b1,.075},H}; -N l27n236[]={{sz82,.201},{s8azg,.170},H}; -N l27n237[]={{s90ad,.151},H}; -N l27n240[]={{s82M82,.611},{sb781Y,.407},H}; -N l27n241[]={{s82cd82,.226},{s89ba,.091},{sm82c8,.075},H}; -N l27n242[]={{s82be82,.272},{s8ec0,.091},H}; -N l27n243[]={{s82af82,.158},{s8dQ,.075},{sc182c482,.226},H}; -N l27n244[]={{sr82,.131},{s82a082,.181},H}; -N l27n245[]={{s82c7,.121},{s9182cc,.113},H}; -N l27n247[]={{s82a9,.528},H}; -N l27n248[]={{sea82,.339},H}; -N l27n249[]={{sc982,.453},{sb582c4,.407},H}; -N l27n250[]={{sa882,.106},H}; -N l27n251[]={{s8bc6,.075},H}; -N l27n252[]={{s92r,.241},{s82bd81Y,.362},H}; -N l27n254[]={{sYg,.317},{se981Y,.170},H}; - -D l27_d = -{ +S s82cc[] = { 130, 204, 0 }; +S s81X[] = { 129, 97, 0 }; +S s82c9[] = { 130, 201, 0 }; +S s82f0[] = { 130, 240, 0 }; +S s82c6[] = { 130, 198, 0 }; +S s82b5[] = { 130, 181, 0 }; +S s82bd[] = { 130, 189, 0 }; +S s82c8[] = { 130, 200, 0 }; +S s82c4[] = { 130, 196, 0 }; +S s81Y[] = { 129, 98, 0 }; +S s82c5[] = { 130, 197, 0 }; +S sb582[] = { 181, 130, 0 }; +S s82b582[] = { 130, 181, 130, 0 }; +S sg82[] = { 32, 130, 0 }; +S s82e9[] = { 130, 233, 0 }; +S sc882[] = { 200, 130, 0 }; +S s82c882[] = { 130, 200, 130, 0 }; +S s82a9[] = { 130, 169, 0 }; +S sa982[] = { 169, 130, 0 }; +S s82cd[] = { 130, 205, 0 }; +S s82b7[] = { 130, 183, 0 }; +S sc682[] = { 198, 130, 0 }; +S s82e8[] = { 130, 232, 0 }; +S s82a2[] = { 130, 162, 0 }; +S s82a982[] = { 130, 169, 130, 0 }; +S s82c682[] = { 130, 198, 130, 0 }; +S sbd82[] = { 189, 130, 0 }; +S s82M[] = { 130, 220, 0 }; +S sa282[] = { 162, 130, 0 }; +S s82e7[] = { 130, 231, 0 }; +S s82a282[] = { 130, 162, 130, 0 }; +S s82M82[] = { 130, 220, 130, 0 }; +S sc582[] = { 197, 130, 0 }; +S sM82[] = { 220, 130, 0 }; +S s82aa[] = { 130, 170, 0 }; +S s82ad[] = { 130, 173, 0 }; +S sc482[] = { 196, 130, 0 }; +S s82c582[] = { 130, 197, 130, 0 }; +S s82bd82[] = { 130, 189, 130, 0 }; +S sg81[] = { 32, 129, 0 }; +S sX82[] = { 97, 130, 0 }; +S s82c482[] = { 130, 196, 130, 0 }; +S se882[] = { 232, 130, 0 }; +S sad82[] = { 173, 130, 0 }; +S sc182[] = { 193, 130, 0 }; +S s81X82[] = { 129, 97, 130, 0 }; +S s82c1[] = { 130, 193, 0 }; +S s8140[] = { 129, 64, 0 }; +S s82c182[] = { 130, 193, 130, 0 }; +S s81Yg[] = { 129, 98, a }; +S sz82[] = { v, 130, 0 }; +S s82c982[] = { 130, 201, 130, 0 }; +S sc982[] = { 201, 130, 0 }; +S s82Q[] = { 130, 224, 0 }; +S sb781[] = { 183, 129, 0 }; +S se982[] = { 233, 130, 0 }; +S sg83[] = { 32, 131, 0 }; +S s82e982[] = { 130, 233, 130, 0 }; +S s7882[] = { x, 130, 0 }; +S sm82[] = { i, 130, 0 }; +S s82b582c4[] = { 130, 181, 130, 196, 0 }; +S sb781Y[] = { 183, 129, 98, 0 }; +S sg8140[] = { 32, 129, 64, 0 }; +S sb582c4[] = { 181, 130, 196, 0 }; +S s82e882[] = { 130, 232, 130, 0 }; +S s82t[] = { 130, p, 0 }; +S sb782[] = { 183, 130, 0 }; +S sbd81[] = { 189, 129, 0 }; +S s82b781Y[] = { 130, 183, 129, 98, 0 }; +S s82bd81[] = { 130, 189, 129, 0 }; +S sY82[] = { 98, 130, 0 }; +S s82b781[] = { 130, 183, 129, 0 }; +S s82a982e7[] = { 130, 169, 130, 231, 0 }; +S s92r[] = { 146, n, 0 }; +S scd82[] = { 205, 130, 0 }; +S s82a4[] = { 130, 164, 0 }; +S sb182[] = { 177, 130, 0 }; +S sa982e7[] = { 169, 130, 231, 0 }; +S se782[] = { 231, 130, 0 }; +S sea82[] = { 234, 130, 0 }; +S sW82[] = { 230, 130, 0 }; +S s81Y82[] = { 129, 98, 130, 0 }; +S s82ab[] = { 130, 171, 0 }; +S sab82[] = { 171, 130, 0 }; +S s82be[] = { 130, 190, 0 }; +S sP82[] = { 223, 130, 0 }; +S s82b782[] = { 130, 183, 130, 0 }; +S s82M82b7[] = { 130, 220, 130, 183, 0 }; +S sbe82[] = { 190, 130, 0 }; +S saf82[] = { 175, 130, 0 }; +S sM82b7[] = { 220, 130, 183, 0 }; +S scc82[] = { 204, 130, 0 }; +S sr82[] = { n, 130, 0 }; +S s82P[] = { 130, 223, 0 }; +S s82ad82[] = { 130, 173, 130, 0 }; +S sa082[] = { 160, 130, 0 }; +S sf082[] = { 240, 130, 0 }; +S s8378[] = { 131, x, 0 }; +S sf182[] = { 241, 130, 0 }; +S s9286[] = { 146, 134, 0 }; +S s81g[] = { 129, a }; +S saa82[] = { 170, 130, 0 }; +S s82ea[] = { 130, 234, 0 }; +S s94r[] = { 148, n, 0 }; +S s82ea82[] = { 130, 234, 130, 0 }; +S sbd81Y[] = { 189, 129, 98, 0 }; +S sX90[] = { 97, 144, 0 }; +S s91V[] = { 145, 229, 0 }; +S sM82b781[] = { 220, 130, 183, 129, 0 }; +S s81z[] = { 129, v, 0 }; +S s82e782[] = { 130, 231, 130, 0 }; +S s82be82[] = { 130, 190, 130, 0 }; +S st82[] = { p, 130, 0 }; +S s82bd81Y[] = { 130, 189, 129, 98, 0 }; +S s82af[] = { 130, 175, 0 }; +S scc8e[] = { 204, 142, 0 }; +S sb582bd[] = { 181, 130, 189, 0 }; +S s82b582bd[] = { 130, 181, 130, 189, 0 }; +S s82b182[] = { 130, 177, 130, 0 }; +S s82cc8e[] = { 130, 204, 142, 0 }; +S sb982[] = { 185, 130, 0 }; +S s82cc82[] = { 130, 204, 130, 0 }; +S s95aa[] = { 149, 170, 0 }; +S sa482[] = { 164, 130, 0 }; +S s82b1[] = { 130, 177, 0 }; +S s81y[] = { 129, u, 0 }; +S s90p[] = { 144, l, 0 }; +S sk82[] = { g, 130, 0 }; +S scd81[] = { 205, 129, 0 }; +S s82ab82[] = { 130, 171, 130, 0 }; +S s82cd81[] = { 130, 205, 129, 0 }; +S s82P82[] = { 130, 223, 130, 0 }; +S sbb82[] = { 187, 130, 0 }; +S s82f1[] = { 130, 241, 0 }; +S s82cd82[] = { 130, 205, 130, 0 }; +S sb382[] = { 179, 130, 0 }; +S s81X90[] = { 129, 97, 144, 0 }; +S s8d91[] = { 141, 145, 0 }; +S s90ad[] = { 144, 173, 0 }; +S s82a482[] = { 130, 164, 130, 0 }; +S sp82[] = { l, 130, 0 }; +S s82bf[] = { 130, 191, 0 }; +S s89fc[] = { 137, 252, 0 }; +S s89fc8a[] = { 137, 252, 138, 0 }; +S s82e882M[] = { 130, 232, 130, 220, 0 }; +S se882M[] = { 232, 130, 220, 0 }; +S sw82[] = { s, 130, 0 }; +S s82c481[] = { 130, 196, 129, 0 }; +S sc182bd[] = { 193, 130, 189, 0 }; +S s8az[] = { 138, v, 0 }; +S s82cd81X[] = { 130, 205, 129, 97, 0 }; +S sQ82[] = { 224, 130, 0 }; +S s93m[] = { 147, i, 0 }; +S sfc8a[] = { 252, 138, 0 }; +S s82c182bd[] = { 130, 193, 130, 189, 0 }; +S s82c182c4[] = { 130, 193, 130, 196, 0 }; +S sb782e9[] = { 183, 130, 233, 0 }; +S s82f082[] = { 130, 240, 130, 0 }; +S s89fc8az[] = { 137, 252, 138, v, 0 }; +S s95fb[] = { 149, 251, 0 }; +S se882M82[] = { 232, 130, 220, 130, 0 }; +S sfc8az[] = { 252, 138, v, 0 }; +S scd81X[] = { 205, 129, 97, 0 }; +S s82b782e9[] = { 130, 183, 130, 233, 0 }; +S sc182c4[] = { 193, 130, 196, 0 }; +S s93m82[] = { 147, i, 130, 0 }; +S s8a_[] = { 138, w, 0 }; +S sc481[] = { 196, 129, 0 }; +S sb582c482[] = { 181, 130, 196, 130, 0 }; +S s4082[] = { 64, 130, 0 }; +S s82aa82[] = { 130, 170, 130, 0 }; +S sc482a2[] = { 196, 130, 162, 0 }; +S s81z82[] = { 129, v, 130, 0 }; +S sf08e[] = { 240, 142, 0 }; +S s82c481X[] = { 130, 196, 129, 97, 0 }; +S s82a082[] = { 130, 160, 130, 0 }; +S s82b382[] = { 130, 179, 130, 0 }; +S s81X92[] = { 129, 97, 146, 0 }; +S s83n[] = { 131, j, 0 }; +S sb781Y82[] = { 183, 129, 98, 130, 0 }; +S s82t82[] = { 130, p, 130, 0 }; +S scc8d[] = { 204, 141, 0 }; +S s82u[] = { 130, q, 0 }; +S s9594[] = { 149, 148, 0 }; +S s82c482a2[] = { 130, 196, 130, 162, 0 }; +S sc981[] = { 201, 129, 0 }; +S s82f182[] = { 130, 241, 130, 0 }; +S s82a0[] = { 130, 160, 0 }; +S s82f08e[] = { 130, 240, 142, 0 }; +S s94r82[] = { 148, n, 130, 0 }; +S s90b6[] = { 144, 182, 0 }; +S s82c7[] = { 130, 199, 0 }; +S sc481X[] = { 196, 129, 97, 0 }; +S s82cc8d[] = { 130, 204, 141, 0 }; +S sb182c6[] = { 177, 130, 198, 0 }; +S sX92[] = { 97, 146, 0 }; +S s82b3[] = { 130, 179, 0 }; +S s82c981X[] = { 130, 201, 129, 97, 0 }; +S s82af82[] = { 130, 175, 130, 0 }; +S sX83[] = { 97, 131, 0 }; +S sc182bd81[] = { 193, 130, 189, 129, 0 }; +S s_82[] = { w, 130, 0 }; +S s89ef[] = { 137, 239, 0 }; +S sf08a[] = { 240, 138, 0 }; +S scc92[] = { 204, 146, 0 }; +S s82f090[] = { 130, 240, 144, 0 }; +S s82cc91[] = { 130, 204, 145, 0 }; +S sf090[] = { 240, 144, 0 }; +S s82bf82[] = { 130, 191, 130, 0 }; +S sr95fb[] = { n, 149, 251, 0 }; +S s82Q82[] = { 130, 224, 130, 0 }; +S sX8e[] = { 97, 142, 0 }; +S sca82[] = { 202, 130, 0 }; +S s82b9[] = { 130, 185, 0 }; +S s82e982c6[] = { 130, 233, 130, 198, 0 }; +S sbf82[] = { 191, 130, 0 }; +S sc98e[] = { 201, 142, 0 }; +S s8278[] = { 130, x, 0 }; +S sc482a282[] = { 196, 130, 162, 130, 0 }; +S sc981X[] = { 201, 129, 97, 0 }; +S s8dw[] = { 141, s, 0 }; +S sad81[] = { 173, 129, 0 }; +S sb781Yg[] = { 183, 129, 98, a }; +S s82S[] = { 130, 226, 0 }; +S s82W82[] = { 130, 230, 130, 0 }; +S s92r95fb[] = { 146, n, 149, 251, 0 }; +S s827882[] = { 130, x, 130, 0 }; +S scc91[] = { 204, 145, 0 }; +S s92r95[] = { 146, n, 149, 0 }; +S sr95[] = { n, 149, 0 }; +S s835e[] = { 131, 94, 0 }; +S s82W[] = { 130, 230, 0 }; +S s9182[] = { 145, 130, 0 }; +S s97cd[] = { 151, 205, 0 }; +S s82ed[] = { 130, 237, 0 }; +S s82c98e[] = { 130, 201, 142, 0 }; +S sed82[] = { 237, 130, 0 }; +S sc782[] = { 199, 130, 0 }; +S s8393[] = { 131, 147, 0 }; +S s82cc92[] = { 130, 204, 146, 0 }; +S sa882[] = { 168, 130, 0 }; +S se982c6[] = { 233, 130, 198, 0 }; +S s82b982[] = { 130, 185, 130, 0 }; +S s81X8e[] = { 129, 97, 142, 0 }; +S s82c981[] = { 130, 201, 129, 0 }; +S s82v[] = { 130, r, 0 }; +S s89ca[] = { 137, 202, 0 }; +S s8f97[] = { 143, 151, 0 }; +S s838c[] = { 131, 140, 0 }; +S sa282bd[] = { 162, 130, 189, 0 }; +S sb182c682[] = { 177, 130, 198, 130, 0 }; +S s82f08c[] = { 130, 240, 140, 0 }; +S sc082[] = { 192, 130, 0 }; +S sz89[] = { v, 137, 0 }; +S se981[] = { 233, 129, 0 }; +S sX8d[] = { 97, 141, 0 }; +S sb682[] = { 182, 130, 0 }; +S s8ec0[] = { 142, 192, 0 }; +S s93af[] = { 147, 175, 0 }; +S s82ed82[] = { 130, 237, 130, 0 }; +S s82e981[] = { 130, 233, 129, 0 }; +S s90z[] = { 144, v, 0 }; +S sx82[] = { t, 130, 0 }; +S sf08c[] = { 240, 140, 0 }; +S s82c682b5[] = { 130, 198, 130, 181, 0 }; +S s81m[] = { 129, i, 0 }; +S s96f0[] = { 150, 240, 0 }; +S s8ea9[] = { 142, 169, 0 }; +S s82b182c6[] = { 130, 177, 130, 198, 0 }; +S sc682b582[] = { 198, 130, 181, 130, 0 }; +S s9085[] = { 144, 133, 0 }; +S sX91[] = { 97, 145, 0 }; +S sb782e982[] = { 183, 130, 233, 130, 0 }; +S s837883[] = { 131, x, 131, 0 }; +S s7883[] = { x, 131, 0 }; +S sc582ab82[] = { 197, 130, 171, 130, 0 }; +S sfb82[] = { 251, 130, 0 }; +S sbd81Y82[] = { 189, 129, 98, 130, 0 }; +S s89ba[] = { 137, 186, 0 }; +S s8d9182[] = { 141, 145, 130, 0 }; +S sg8d[] = { 32, 141, 0 }; +S s90p82[] = { 144, l, 130, 0 }; +S s8c8e[] = { 140, 142, 0 }; +S s97a7[] = { 151, 167, 0 }; +S s8dec[] = { 141, 236, 0 }; +S sc582ab[] = { 197, 130, 171, 0 }; +S s82c582ab[] = { 130, 197, 130, 171, 0 }; +S s82a282bd[] = { 130, 162, 130, 189, 0 }; +S sa682[] = { 166, 130, 0 }; +S s90m[] = { 144, i, 0 }; +S sc882e8[] = { 200, 130, 232, 0 }; +S s8582[] = { 133, 130, 0 }; +S sn83[] = { j, 131, 0 }; +S s82c882e8[] = { 130, 200, 130, 232, 0 }; +S sc682b5[] = { 198, 130, 181, 0 }; +S s8ca0[] = { 140, 160, 0 }; +S s83_[] = { 131, w, 0 }; +S sa282bd82[] = { 162, 130, 189, 130, 0 }; +S s8e9e[] = { 142, 158, 0 }; +S sV82[] = { 229, 130, 0 }; +S s82y[] = { 130, u, 0 }; +S s93Q[] = { 147, 224, 0 }; +S s8eu[] = { 142, q, 0 }; +S s81z82c6[] = { 129, v, 130, 198, 0 }; +S s82cc8f[] = { 130, 204, 143, 0 }; +S s82ab82e9[] = { 130, 171, 130, 233, 0 }; +S sQ90[] = { 224, 144, 0 }; +S s83l[] = { 131, h, 0 }; +S s82f08a[] = { 130, 240, 138, 0 }; +S s839383[] = { 131, 147, 131, 0 }; +S s83r[] = { 131, n, 0 }; +S s81X8d[] = { 129, 97, 141, 0 }; +S se981Y[] = { 233, 129, 98, 0 }; +S s9383[] = { 147, 131, 0 }; +S s8f_[] = { 143, w, 0 }; +S sc582Q[] = { 197, 130, 224, 0 }; +S sg8b[] = { 32, 139, 0 }; +S sbd81Yg[] = { 189, 129, 98, a }; +S ss83[] = { o, 131, 0 }; +S s82N[] = { 130, 221, 0 }; +S s82bb[] = { 130, 187, 0 }; +S sc882e882[] = { 200, 130, 232, 130, 0 }; +S s98X[] = { 152, 97, 0 }; +S sfc8azg[] = { 252, 138, v, a }; +S s93m82c8[] = { 147, i, 130, 200, 0 }; +S se981Yg[] = { 233, 129, 98, a }; +S s837882[] = { 131, x, 130, 0 }; +S se781[] = { 231, 129, 0 }; +S s90ab[] = { 144, 171, 0 }; +S s92b2[] = { 146, 178, 0 }; +S s82bb82[] = { 130, 187, 130, 0 }; +S s8fT[] = { 143, 227, 0 }; +S s838b[] = { 131, 139, 0 }; +S sz82c6[] = { v, 130, 198, 0 }; +S s8azg[] = { 138, v, a }; +S s83n83[] = { 131, j, 131, 0 }; +S sY83[] = { 98, 131, 0 }; +S s82b581[] = { 130, 181, 129, 0 }; +S sL82[] = { 219, 130, 0 }; +S s82x[] = { 130, t, 0 }; +S s8b82[] = { 139, 130, 0 }; +S s838c83[] = { 131, 140, 131, 0 }; +S s82Q81[] = { 130, 224, 129, 0 }; +S s90ec[] = { 144, 236, 0 }; +S sv82[] = { r, 130, 0 }; +S sn82[] = { j, 130, 0 }; +S s8cs[] = { 140, o, 0 }; +S s9182cc[] = { 145, 130, 204, 0 }; +S s96b1[] = { 150, 177, 0 }; +S s88c0[] = { 136, 192, 0 }; +S s8e9f[] = { 142, 159, 0 }; +S scc8f[] = { 204, 143, 0 }; +S sg82c9[] = { 32, 130, 201, 0 }; +S s82c882a2[] = { 130, 200, 130, 162, 0 }; +S s8c83[] = { 140, 131, 0 }; +S s83l83[] = { 131, h, 131, 0 }; +S sl83[] = { h, 131, 0 }; +S s7a82[] = { z, 130, 0 }; +S s8e96[] = { 142, 150, 0 }; +S sba82[] = { 186, 130, 0 }; +S sa782[] = { 167, 130, 0 }; +S s8bad[] = { 139, 173, 0 }; +S s814082[] = { 129, 64, 130, 0 }; +S sQ81[] = { 224, 129, 0 }; +S s8cbb[] = { 140, 187, 0 }; +S s82e981Y[] = { 130, 233, 129, 98, 0 }; +S s97cd82[] = { 151, 205, 130, 0 }; +S s8bc6[] = { 139, 198, 0 }; +S s81n[] = { 129, j, 0 }; +S sb581[] = { 181, 129, 0 }; +S s91w[] = { 145, s, 0 }; +S s8dQ[] = { 141, 224, 0 }; +S sf094[] = { 240, 148, 0 }; +S sc882a2[] = { 200, 130, 162, 0 }; +S s81X83[] = { 129, 97, 131, 0 }; +S s8eg[] = { 142, a }; +S scc89[] = { 204, 137, 0 }; +S s89c6[] = { 137, 198, 0 }; +S s5c91[] = { 92, 145, 0 }; +S s82c2[] = { 130, 194, 0 }; +S sQ90ad[] = { 224, 144, 173, 0 }; +S s82cb[] = { 130, 203, 0 }; +S sc182c482[] = { 193, 130, 196, 130, 0 }; +S s82s[] = { 130, o, 0 }; +S sab82e9[] = { 171, 130, 233, 0 }; +S sm82c8[] = { i, 130, 200, 0 }; +S s88ea[] = { 136, 234, 0 }; +S s8fac[] = { 143, 172, 0 }; +S ss8d[] = { o, 141, 0 }; +S s81X9286[] = { 129, 97, 146, 134, 0 }; +S s8d9182cc[] = { 141, 145, 130, 204, 0 }; +S s82u94[] = { 130, q, 148, 0 }; +S sS82[] = { 226, 130, 0 }; +S s82cc96[] = { 130, 204, 150, 0 }; +S sfa82[] = { 250, 130, 0 }; +S sN82[] = { 221, 130, 0 }; +S sc582b7[] = { 197, 130, 183, 0 }; + +N l27n0[] = { { sr95fb, .106 }, { sS82, .091 }, H }; +N l27n1[] = { { sc182, .498 }, { s89ca, .106 }, H }; +N l27n2[] = { { sa082, .196 }, { s88ea, .075 }, H }; +N l27n3[] = { { s82bf82, .158 }, H }; +N l27n4[] = { { s82W, .106 }, H }; +N l27n6[] = { { s82c8, .709 }, { sa982e7, .362 }, H }; +N l27n7[] = { { s82b9, .106 }, { sfb82, .136 }, H }; +N l27n8[] = { { s82aa, .392 }, H }; +N l27n9[] = { { sb982, .166 }, { s82cd81X, .272 }, H }; +N l27n10[] = { { sbd81Yg, .226 }, H }; +N l27n11[] = { { s81z82, .181 }, { s_82, .070 }, H }; +N l27n16[] = { { s81X, 1.282 }, H }; +N l27n17[] = { { sb182, .241 }, { scc8d, .181 }, { s82ed82, .136 }, H }; +N l27n19[] = { { sc981X, .238 }, { sadg, .113 }, H }; +N l27n21[] = { { s82e7, .422 }, { s82M82b7, .392 }, { s82b182, .249 }, H }; +N l27n22[] = { { s82a282, .634 }, H }; +N l27n23[] = { { s82c9, .935 }, H }; +N l27n24[] = { { sca82, .158 }, { s838b, .075 }, H }; +N l27n25[] = { { sa982, .513 }, { s82ab, .226 }, { sb182c682, .181 }, H }; +N l27n26[] = { { s96f0, .091 }, H }; +N l27n27[] = { { sk82, .101 }, { s835e, .106 }, { sg8b, .075 }, H }; +N l27n28[] = { { sX8d, .060 }, { s90ec, .075 }, H }; +N l27n29[] = { { sc582Q, .170 }, { s82s, .075 }, H }; +N l27n31[] = { { s82e982c6, .211 }, { s81X8d, .113 }, { sQ90ad, .170 }, H }; +N l27n32[] = { { sc182bd, .306 }, { sfc8azg, .339 }, H }; +N l27n33[] = { { s81Y, .694 }, H }; +N l27n34[] = { { scc8e, .249 }, H }; +N l27n35[] = { { sM82b7, .441 }, { s82P82, .226 }, H }; +N l27n36[] = { { ss83, .050 }, H }; +N l27n37[] = { { s82c182, .475 }, { sg82c9, .113 }, H }; +N l27n38[] = { { s82e8, .498 }, H }; +N l27n39[] = { { sL82, .113 }, H }; +N l27n40[] = { { s8e96, .075 }, { sba82, .075 }, H }; +N l27n41[] = { { s838c, .091 }, { s82bb, .075 }, { s82Q81, .113 }, H }; +N l27n42[] = { { s7882, .181 }, { s81X8e, .158 }, H }; +N l27n43[] = { { s83r, .075 }, H }; +N l27n45[] = { { sX8e, .070 }, H }; +N l27n46[] = { { s82t, .272 }, { se882M, .306 }, H }; +N l27n48[] = { { sbd81Y82, .181 }, H }; +N l27n49[] = { { sg8140, .407 }, { s9182, .106 }, { s82c98e, .158 }, H }; +N l27n50[] = { { st82, .121 }, { s90p82, .136 }, { s91w, .075 }, H }; +N l27n51[] = { { scc8f, .113 }, H }; +N l27n52[] = { { s82Q82, .158 }, H }; +N l27n54[] = { { s82b782e9, .272 }, H }; +N l27n55[] = { { s82e9, .588 }, { s82b382, .181 }, { sr95, .070 }, H }; +N l27n56[] = { { saa82, .196 }, { s82a482, .226 }, { s8f_, .075 }, { s88c0, .075 }, H }; +N l27n57[] = { { s82cb, .075 }, H }; +N l27n58[] = { { s94r, .196 }, { sf08a, .158 }, H }; +N l27n59[] = { { s82ad, .392 }, { s7883, .060 }, H }; +N l27n61[] = { { sg8d, .091 }, H }; +N l27n62[] = { { s82c482a2, .241 }, H }; +N l27n63[] = { { s82u, .121 }, H }; +N l27n64[] = { { sa282, .438 }, { s81X90, .226 }, H }; +N l27n65[] = { { s89fc8a, .204 }, { s839383, .113 }, H }; +N l27n66[] = { { s82a982e7, .483 }, H }; +N l27n68[] = { { s82f082, .204 }, H }; +N l27n69[] = { { s9085, .091 }, H }; +N l27n70[] = { { sM82, .611 }, { s90z, .091 }, H }; +N l27n71[] = { { sbb82, .151 }, H }; +N l27n72[] = { { s82ea, .196 }, H }; +N l27n74[] = { { s82cc, 1.358 }, { s8d9182, .136 }, H }; +N l27n75[] = { { s82bd, .769 }, { sl83, .050 }, H }; +N l27n76[] = { { s827882, .158 }, H }; +N l27n77[] = { { s82c481, .204 }, { sc481, .204 }, { s82a282bd, .181 }, H }; +N l27n78[] = { { s82b581, .113 }, H }; +N l27n79[] = { { sX90, .121 }, { sb382, .151 }, H }; +N l27n80[] = { { s82e882M, .272 }, { sb781Yg, .317 }, { s82v, .106 }, H }; +N l27n82[] = { { s8bad, .075 }, { s8eg, .113 }, H }; +N l27n83[] = { { s89fc, .136 }, { s8cs, .075 }, H }; +N l27n84[] = { { sc482a2, .272 }, { s92r95fb, .211 }, { sb782e982, .181 }, { s82c882e8, .181 }, H }; +N l27n85[] = { { s95aa, .166 }, { s82f182, .181 }, { scc91, .158 }, { sed82, .158 }, H }; +N l27n86[] = { { scc82, .294 }, { s81X92, .181 }, H }; +N l27n87[] = { { sab82, .211 }, H }; +N l27n88[] = { { s82c482, .520 }, { s8f97, .091 }, { sc882e882, .226 }, H }; +N l27n89[] = { { s82b582, .973 }, { sm82, .181 }, { s82cc8d, .181 }, H }; +N l27n90[] = { { s82M, .438 }, { sab82e9, .113 }, { sc582b7, .136 }, H }; +N l27n91[] = { { s82cd, .513 }, { se982c6, .238 }, H }; +N l27n92[] = { { s82be, .211 }, { s82c182bd, .272 }, { s93m82, .204 }, { sf08c, .136 }, { sc582ab82, .272 }, H }; +N l27n93[] = { { s82af, .166 }, { sV82, .113 }, { s81z82c6, .151 }, H }; +N l27n94[] = { { sc482, .588 }, { s82a0, .121 }, { se981Yg, .339 }, H }; +N l27n95[] = { { sa282bd, .136 }, { s8cbb, .075 }, H }; +N l27n96[] = { { sX91, .060 }, { s97a7, .091 }, H }; +N l27n97[] = { { sX82, .231 }, H }; +N l27n98[] = { { s4082, .080 }, { s8c8e, .091 }, H }; +N l27n99[] = { { s92r95, .158 }, { sz89, .060 }, { sc682b5, .204 }, H }; +N l27n100[] = { { s82cc8e, .249 }, { s81y, .166 }, { scd81, .226 }, { s8fT, .075 }, H }; +N l27n101[] = { { sN82, .091 }, H }; +N l27n102[] = { { scc92, .158 }, { s83l83, .113 }, H }; +N l27n103[] = { { s82b182c6, .181 }, H }; +N l27n104[] = { { s7a82, .050 }, H }; +N l27n105[] = { { s82c582, .566 }, { s90m, .091 }, H }; +N l27n106[] = { { szg, .106 }, { s82c582ab, .181 }, { s82ab82e9, .151 }, H }; +N l27n107[] = { { s8ea9, .091 }, { s82N, .075 }, { s837882, .113 }, H }; +N l27n108[] = { { s93af, .091 }, H }; +N l27n109[] = { { s82bf, .136 }, { sc182c4, .306 }, H }; +N l27n110[] = { { sz82c6, .075 }, H }; +N l27n111[] = { { s82cc8f, .113 }, H }; +N l27n112[] = { { s82b781, .385 }, { s82c481X, .241 }, { sv82, .050 }, H }; +N l27n113[] = { { sg81, .362 }, { s82c182c4, .272 }, { sX92, .080 }, H }; +N l27n114[] = { { sX83, .070 }, { s82x, .075 }, H }; +N l27n116[] = { { sbd81, .256 }, H }; +N l27n117[] = { { scd82, .362 }, { s81z, .181 }, { s814082, .113 }, H }; +N l27n118[] = { { sb781Y82, .241 }, { s89ef, .106 }, { s837883, .136 }, H }; +N l27n119[] = { { s8b82, .075 }, H }; +N l27n120[] = { { sc481X, .272 }, { sn82, .050 }, H }; +N l27n122[] = { { s82c682, .702 }, H }; +N l27n123[] = { { s82b782, .294 }, { s82ed, .106 }, H }; +N l27n124[] = { { sW82, .339 }, { s97cd82, .113 }, { sb581, .075 }, H }; +N l27n125[] = { { sc582, .611 }, H }; +N l27n126[] = { { sa482, .166 }, { sf08e, .181 }, H }; +N l27n127[] = { { s82b1, .166 }, { sb582c482, .272 }, H }; +N l27n128[] = { { s82a2, .498 }, { sY82, .171 }, { s9383, .075 }, { s92b2, .075 }, H }; +N l27n129[] = { { s81Yg, .713 }, H }; +N l27n130[] = { { sg82, .634 }, { s82c882a2, .151 }, H }; +N l27n131[] = { { s82y, .075 }, H }; +N l27n132[] = { { sad81, .106 }, H }; +N l27n133[] = { { sbd82, .468 }, { s82cc91, .158 }, H }; +N l27n134[] = { { s90b6, .121 }, H }; +N l27n136[] = { { s83n83, .113 }, H }; +N l27n137[] = { { sn83, .060 }, H }; +N l27n138[] = { { se781, .113 }, H }; +N l27n140[] = { { s8az, .136 }, H }; +N l27n141[] = { { sb582, .649 }, { s82a982, .724 }, { s82P, .196 }, H }; +N l27n143[] = { { s82c1, .317 }, { sw82, .091 }, { scd81X, .306 }, H }; +N l27n144[] = { { s82b582bd, .332 }, { s82cc92, .158 }, H }; +N l27n145[] = { { sY83, .050 }, H }; +N l27n147[] = { { sg83, .287 }, { sb182c6, .181 }, H }; +N l27n148[] = { { s9286, .196 }, { s8ca0, .091 }, H }; +N l27n149[] = { { sad82, .332 }, H }; +N l27n150[] = { { s82b781Y, .513 }, H }; +N l27n152[] = { { s81m, .091 }, H }; +N l27n153[] = { { s82c682b5, .181 }, H }; +N l27n154[] = { { s82W82, .158 }, H }; +N l27n155[] = { { se782, .362 }, { s82u94, .091 }, H }; +N l27n156[] = { { s82c882, .792 }, { sc682, .747 }, { s90p, .151 }, { s82f08a, .113 }, H }; +N l27n157[] = { { s8a_, .136 }, { s82b982, .158 }, H }; +N l27n158[] = { { s82Q, .287 }, { s82aa82, .181 }, H }; +N l27n160[] = { { sf090, .158 }, { s8393, .106 }, { s82c2, .075 }, H }; +N l27n161[] = { { s82b3, .121 }, H }; +N l27n162[] = { { s82a4, .241 }, { s82c981, .158 }, H }; +N l27n163[] = { { sP82, .317 }, { s89fc8az, .272 }, { sc182bd81, .317 }, H }; +N l27n164[] = { { sbe82, .196 }, H }; +N l27n165[] = { { s82b582c4, .543 }, H }; +N l27n166[] = { { s81X82, .475 }, { sM82b781, .543 }, H }; +N l27n167[] = { { s8c83, .075 }, H }; +N l27n169[] = { { s81n, .075 }, H }; +N l27n170[] = { { sbd81Y, .272 }, H }; +N l27n171[] = { { s82e782, .272 }, H }; +N l27n172[] = { { sb582bd, .249 }, { sb682, .091 }, H }; +N l27n173[] = { { s82c982, .453 }, { s93Q, .075 }, H }; +N l27n174[] = { { s82f0, .875 }, { sfc8a, .204 }, { sx82, .060 }, { s8d9182cc, .121 }, H }; +N l27n175[] = { { s82ab82, .226 }, H }; +N l27n176[] = { { s8e9e, .075 }, { sQ90, .113 }, H }; +N l27n177[] = { { sQ81, .113 }, { s81X83, .113 }, H }; +N l27n178[] = { { sf082, .294 }, { s82f08c, .136 }, H }; +N l27n179[] = { { s8eu, .075 }, H }; +N l27n180[] = { { s8d91, .151 }, { se882M82, .407 }, { s93m82c8, .151 }, H }; +N l27n182[] = { { sp82, .101 }, { s95fb, .136 }, { s8278, .106 }, { s8dw, .106 }, H }; +N l27n183[] = { { s81Y82, .339 }, H }; +N l27n186[] = { { se882, .498 }, { sb781, .287 }, H }; +N l27n187[] = { { sc782, .158 }, H }; +N l27n188[] = { { s82e882, .407 }, { sa682, .091 }, { s82cc96, .091 }, H }; +N l27n189[] = { { s8582, .091 }, { s89c6, .075 }, { s8fac, .060 }, H }; +N l27n191[] = { { s81g, .294 }, { s82f1, .151 }, { s8dec, .091 }, { s82bb82, .113 }, H }; +N l27n192[] = { { sfc8az, .306 }, { s82S, .106 }, H }; +N l27n193[] = { { s8e9f, .075 }, H }; +N l27n194[] = { { s82c4, .709 }, { sQ82, .204 }, { s82e981, .136 }, H }; +N l27n195[] = { { s82b5, .785 }, { sbf82, .106 }, H }; +N l27n196[] = { { s91V, .181 }, { s82t82, .181 }, { s83_, .075 }, H }; +N l27n197[] = { { s82c981X, .211 }, { sc98e, .158 }, { s83l, .075 }, { s5c91, .050 }, H }; +N l27n198[] = { { s93m, .136 }, H }; +N l27n200[] = { { s82f08e, .181 }, { se981, .136 }, H }; +N l27n202[] = { { s838c83, .113 }, H }; +N l27n203[] = { { sb782, .256 }, { s90ab, .075 }, H }; +N l27n205[] = { { s82e982, .430 }, { scc89, .113 }, H }; +N l27n206[] = { { sb782e9, .204 }, { ss8d, .040 }, H }; +N l27n208[] = { { s94r82, .181 }, { sc882a2, .170 }, H }; +N l27n209[] = { { s82ad82, .294 }, { sf182, .294 }, H }; +N l27n210[] = { { sc882e8, .204 }, H }; +N l27n211[] = { { s82c5, .664 }, { saf82, .196 }, H }; +N l27n213[] = { { s8378, .196 }, H }; +N l27n214[] = { { s82bd81, .385 }, { sc582ab, .204 }, H }; +N l27n217[] = { { se982, .430 }, { s98X, .075 }, H }; +N l27n218[] = { { sc882, .860 }, { sc482a282, .317 }, H }; +N l27n219[] = { { sa782, .075 }, H }; +N l27n222[] = { { s82ea82, .272 }, { s82f090, .158 }, H }; +N l27n223[] = { { s8140, .317 }, { s9594, .121 }, H }; +N l27n224[] = { { s82cc82, .249 }, H }; +N l27n225[] = { { s82bd82, .566 }, H }; +N l27n226[] = { { sc082, .136 }, H }; +N l27n228[] = { { s82c6, .800 }, { sf094, .113 }, H }; +N l27n229[] = { { s82b7, .513 }, { sa282bd82, .151 }, H }; +N l27n230[] = { { s82cd81, .226 }, { s97cd, .106 }, H }; +N l27n231[] = { { s83n, .121 }, H }; +N l27n232[] = { { sc981, .181 }, { s82e981Y, .151 }, { s81X9286, .121 }, { sfa82, .091 }, H }; +N l27n233[] = { { sc682b582, .272 }, H }; +N l27n235[] = { { s96b1, .075 }, H }; +N l27n236[] = { { sz82, .201 }, { s8azg, .170 }, H }; +N l27n237[] = { { s90ad, .151 }, H }; +N l27n240[] = { { s82M82, .611 }, { sb781Y, .407 }, H }; +N l27n241[] = { { s82cd82, .226 }, { s89ba, .091 }, { sm82c8, .075 }, H }; +N l27n242[] = { { s82be82, .272 }, { s8ec0, .091 }, H }; +N l27n243[] = { { s82af82, .158 }, { s8dQ, .075 }, { sc182c482, .226 }, H }; +N l27n244[] = { { sr82, .131 }, { s82a082, .181 }, H }; +N l27n245[] = { { s82c7, .121 }, { s9182cc, .113 }, H }; +N l27n247[] = { { s82a9, .528 }, H }; +N l27n248[] = { { sea82, .339 }, H }; +N l27n249[] = { { sc982, .453 }, { sb582c4, .407 }, H }; +N l27n250[] = { { sa882, .106 }, H }; +N l27n251[] = { { s8bc6, .075 }, H }; +N l27n252[] = { { s92r, .241 }, { s82bd81Y, .362 }, H }; +N l27n254[] = { { sYg, .317 }, { se981Y, .170 }, H }; + +D l27_d = { "japanese", "shift_jis", - { - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - 0.010,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,0.004,W,0.004,W, - 0.002,0.039,0.021,0.005,0.004,0.004,0.001,0.006,0.005,0.012,0.007,0.004,0.007,0.001,0.014,0.008, - 0.010,0.006,0.006,0.009,0.005,0.006,0.017,0.010,0.011,0.004,0.007,W,W,W,0.003,W, - 0.002,0.134,0.697,0.077,0.006,0.006,0.008,0.004,0.019,0.040,0.037,0.034,0.045,0.056,0.062,0.034, - 0.060,0.044,0.039,0.048,0.032,0.036,0.039,0.039,0.005,0.002,0.002,0.001,Y,0.005,0.004,0.004, - 0.011,0.004,0.024,0.001,0.011,0.001,0.005,0.005,0.004,0.028,0.025,0.013,0.007,0.030,0.004,0.015, - 0.005,0.011,0.004,0.010,0.003,0.031,0.008,0.025,0.004,0.007,0.005,0.009,0.004,0.036,0.010,0.007, - 0.010,0.022,0.006,0.004,0.048,0.043,0.058,0.012,0.047,0.060,0.011,0.005,0.086,0.040,0.006,0.007, - 0.004,0.002,V,0.001,0.003,0.001,0.005,0.005,0.004,0.005,0.005,0.010,0.027,0.008,0.002,0.015, - 0.028,0.003,0.010,0.006,0.002,0.017,0.019,0.032,0.036,0.036,0.020,0.004,0.015,0.010,0.003,0.006, - 0.062,0.017,V,0.005,0.002,0.004,0.003,0.001,0.004,0.001,0.006,0.014,0.015,V,V,V - }, - { - l27n0,l27n1,l27n2,l27n3,l27n4,X,l27n6,l27n7,l27n8,l27n9,l27n10,l27n11,X,X,X,X, - l27n16,l27n17,X,l27n19,X,l27n21,l27n22,l27n23,l27n24,l27n25,l27n26,l27n27,l27n28,l27n29,X,l27n31, - l27n32,l27n33,l27n34,l27n35,l27n36,l27n37,l27n38,l27n39,l27n40,l27n41,l27n42,l27n43,X,l27n45,l27n46,X, - l27n48,l27n49,l27n50,l27n51,l27n52,X,l27n54,l27n55,l27n56,l27n57,l27n58,l27n59,X,l27n61,l27n62,l27n63, - l27n64,l27n65,l27n66,X,l27n68,l27n69,l27n70,l27n71,l27n72,X,l27n74,l27n75,l27n76,l27n77,l27n78,l27n79, - l27n80,X,l27n82,l27n83,l27n84,l27n85,l27n86,l27n87,l27n88,l27n89,l27n90,l27n91,l27n92,l27n93,l27n94,l27n95, - l27n96,l27n97,l27n98,l27n99,l27n100,l27n101,l27n102,l27n103,l27n104,l27n105,l27n106,l27n107,l27n108,l27n109,l27n110,l27n111, - l27n112,l27n113,l27n114,X,l27n116,l27n117,l27n118,l27n119,l27n120,X,l27n122,l27n123,l27n124,l27n125,l27n126,l27n127, - l27n128,l27n129,l27n130,l27n131,l27n132,l27n133,l27n134,X,l27n136,l27n137,l27n138,X,l27n140,l27n141,X,l27n143, - l27n144,l27n145,X,l27n147,l27n148,l27n149,l27n150,X,l27n152,l27n153,l27n154,l27n155,l27n156,l27n157,l27n158,X, - l27n160,l27n161,l27n162,l27n163,l27n164,l27n165,l27n166,l27n167,X,l27n169,l27n170,l27n171,l27n172,l27n173,l27n174,l27n175, - l27n176,l27n177,l27n178,l27n179,l27n180,X,l27n182,l27n183,X,X,l27n186,l27n187,l27n188,l27n189,X,l27n191, - l27n192,l27n193,l27n194,l27n195,l27n196,l27n197,l27n198,X,l27n200,X,l27n202,l27n203,X,l27n205,l27n206,X, - l27n208,l27n209,l27n210,l27n211,X,l27n213,l27n214,X,X,l27n217,l27n218,l27n219,X,X,l27n222,l27n223, - l27n224,l27n225,l27n226,X,l27n228,l27n229,l27n230,l27n231,l27n232,l27n233,X,l27n235,l27n236,l27n237,X,X, - l27n240,l27n241,l27n242,l27n243,l27n244,l27n245,X,l27n247,l27n248,l27n249,l27n250,l27n251,l27n252,X,l27n254,X - } + { W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + 0.010, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, 0.004, W, 0.004, W, + 0.002, 0.039, 0.021, 0.005, 0.004, 0.004, 0.001, 0.006, 0.005, 0.012, 0.007, 0.004, 0.007, 0.001, 0.014, 0.008, + 0.010, 0.006, 0.006, 0.009, 0.005, 0.006, 0.017, 0.010, 0.011, 0.004, 0.007, W, W, W, 0.003, W, + 0.002, 0.134, 0.697, 0.077, 0.006, 0.006, 0.008, 0.004, 0.019, 0.040, 0.037, 0.034, 0.045, 0.056, 0.062, 0.034, + 0.060, 0.044, 0.039, 0.048, 0.032, 0.036, 0.039, 0.039, 0.005, 0.002, 0.002, 0.001, Y, 0.005, 0.004, 0.004, + 0.011, 0.004, 0.024, 0.001, 0.011, 0.001, 0.005, 0.005, 0.004, 0.028, 0.025, 0.013, 0.007, 0.030, 0.004, 0.015, + 0.005, 0.011, 0.004, 0.010, 0.003, 0.031, 0.008, 0.025, 0.004, 0.007, 0.005, 0.009, 0.004, 0.036, 0.010, 0.007, + 0.010, 0.022, 0.006, 0.004, 0.048, 0.043, 0.058, 0.012, 0.047, 0.060, 0.011, 0.005, 0.086, 0.040, 0.006, 0.007, + 0.004, 0.002, V, 0.001, 0.003, 0.001, 0.005, 0.005, 0.004, 0.005, 0.005, 0.010, 0.027, 0.008, 0.002, 0.015, + 0.028, 0.003, 0.010, 0.006, 0.002, 0.017, 0.019, 0.032, 0.036, 0.036, 0.020, 0.004, 0.015, 0.010, 0.003, 0.006, + 0.062, 0.017, V, 0.005, 0.002, 0.004, 0.003, 0.001, 0.004, 0.001, 0.006, 0.014, 0.015, V, V, V }, + { l27n0, l27n1, l27n2, l27n3, l27n4, X, l27n6, l27n7, l27n8, l27n9, l27n10, l27n11, X, X, X, X, + l27n16, l27n17, X, l27n19, X, l27n21, l27n22, l27n23, l27n24, l27n25, l27n26, l27n27, l27n28, l27n29, X, l27n31, + l27n32, l27n33, l27n34, l27n35, l27n36, l27n37, l27n38, l27n39, l27n40, l27n41, l27n42, l27n43, X, l27n45, l27n46, X, + l27n48, l27n49, l27n50, l27n51, l27n52, X, l27n54, l27n55, l27n56, l27n57, l27n58, l27n59, X, l27n61, l27n62, l27n63, + l27n64, l27n65, l27n66, X, l27n68, l27n69, l27n70, l27n71, l27n72, X, l27n74, l27n75, l27n76, l27n77, l27n78, l27n79, + l27n80, X, l27n82, l27n83, l27n84, l27n85, l27n86, l27n87, l27n88, l27n89, l27n90, l27n91, l27n92, l27n93, l27n94, l27n95, + l27n96, l27n97, l27n98, l27n99, l27n100, l27n101, l27n102, l27n103, l27n104, l27n105, l27n106, l27n107, l27n108, l27n109, l27n110, l27n111, + l27n112, l27n113, l27n114, X, l27n116, l27n117, l27n118, l27n119, l27n120, X, l27n122, l27n123, l27n124, l27n125, l27n126, l27n127, + l27n128, l27n129, l27n130, l27n131, l27n132, l27n133, l27n134, X, l27n136, l27n137, l27n138, X, l27n140, l27n141, X, l27n143, + l27n144, l27n145, X, l27n147, l27n148, l27n149, l27n150, X, l27n152, l27n153, l27n154, l27n155, l27n156, l27n157, l27n158, X, + l27n160, l27n161, l27n162, l27n163, l27n164, l27n165, l27n166, l27n167, X, l27n169, l27n170, l27n171, l27n172, l27n173, l27n174, l27n175, + l27n176, l27n177, l27n178, l27n179, l27n180, X, l27n182, l27n183, X, X, l27n186, l27n187, l27n188, l27n189, X, l27n191, + l27n192, l27n193, l27n194, l27n195, l27n196, l27n197, l27n198, X, l27n200, X, l27n202, l27n203, X, l27n205, l27n206, X, + l27n208, l27n209, l27n210, l27n211, X, l27n213, l27n214, X, X, l27n217, l27n218, l27n219, X, X, l27n222, l27n223, + l27n224, l27n225, l27n226, X, l27n228, l27n229, l27n230, l27n231, l27n232, l27n233, X, l27n235, l27n236, l27n237, X, X, + l27n240, l27n241, l27n242, l27n243, l27n244, l27n245, X, l27n247, l27n248, l27n249, l27n250, l27n251, l27n252, X, l27n254, X } }; - - // // Lng: norwegian // Enc: iso-8859-15 // - -S sglXr[]={32,h,97,n,0}; -S slXrg[]={h,97,n,a}; -S slyr[]={h,u,n,0}; -S slyrg[]={h,u,n,a}; -S sglyr[]={32,h,u,n,0}; -S sglXv[]={32,h,97,r,0}; -S sgwsq[]={32,s,o,m,0}; -S swsqg[]={s,o,m,a}; -S sgtV[]={32,p,229,0}; -S stVg[]={p,229,a}; -S sgtVg[]={32,p,229,a}; -S stV[]={p,229,0}; -S sVv[]={229,r,0}; -S sirri[]={e,n,n,e,0}; -S sVvg[]={229,r,a}; -S srrig[]={n,n,e,a}; -S sglXq[]={32,h,97,m,0}; -S swxig[]={s,t,e,a}; -S slXqg[]={h,97,m,a}; -S stirg[]={p,e,n,a}; -S sXqg[]={97,m,a}; -S slXq[]={h,97,m,0}; -S sglir[]={32,h,e,n,0}; -S sXzg[]={97,v,a}; -S sglz[]={32,h,v,0}; -S swVg[]={s,229,a}; -S swV[]={s,229,0}; -S swik[]={s,e,g,0}; -S sgXzg[]={32,97,v,a}; -S sgVg[]={32,229,a}; -S sgwV[]={32,s,229,0}; -S sgwVg[]={32,s,229,a}; -S sXrk[]={97,n,g,0}; -S sgwik[]={32,s,e,g,0}; -S swikg[]={s,e,g,a}; -S sqih[]={m,e,d,0}; -S sgqih[]={32,m,e,d,0}; -S sirig[]={e,n,e,a}; -S syrrm[]={u,n,n,i,0}; -S slirr[]={h,e,n,n,0}; -S sqihg[]={m,e,d,a}; -S soXrg[]={k,97,n,a}; -S skXr[]={g,97,n,0}; -S sgyrr[]={32,u,n,n,0}; -S soivg[]={k,e,r,a}; -S sgky[]={32,g,u,0}; -S spmkg[]={l,i,g,a}; -S sqivg[]={m,e,r,a}; -S srsi[]={n,o,e,0}; -S sf8vg[]={248,r,a}; -S sgrsi[]={32,n,o,e,0}; -S spXr[]={l,97,n,0}; -S srV[]={n,229,0}; -S sgmrr[]={32,i,n,n,0}; -S sgrV[]={32,n,229,0}; -S sgzmp[]={32,v,i,l,0}; -S ssir[]={o,e,n,0}; -S swzX[]={s,v,97,0}; -S szmp[]={v,i,l,0}; -S sqXrr[]={m,97,n,n,0}; -S sirki[]={e,n,g,e,0}; -S sgwiv[]={32,s,e,r,0}; -S skXrk[]={g,97,n,g,0}; -S szmr[]={v,i,n,0}; -S swti[]={s,p,e,0}; -S sqip[]={m,e,l,0}; -S siwti[]={e,s,p,e,0}; -S sipmk[]={e,l,i,g,0}; -S siwt[]={e,s,p,0}; -S skV[]={g,229,0}; -S snf8[]={j,248,0}; -S sgmrk[]={32,i,n,g,0}; -S sgoz[]={32,k,v,0}; -S sgkXr[]={32,g,97,n,0}; -S sqqiv[]={m,m,e,r,0}; -S sknf8v[]={g,j,248,r,0}; -S snikg[]={j,e,g,a}; -S sgiwt[]={32,e,s,p,0}; -S sipwo[]={e,l,s,k,0}; -S srVg[]={n,229,a}; -S ssvk[]={o,r,g,0}; -S szixg[]={v,e,t,a}; -S soirg[]={k,e,n,a}; -S shx[]={d,t,0}; - -N l28n0[]={{stt,.105},{srrg,.236},H}; -N l28n2[]={{sqirg,.314},H}; -N l28n3[]={{ssv,.707},H}; -N l28n5[]={{smr,.445},{sxm,.327},{sgrV,.177},H}; -N l28n6[]={{srx,.183},{sgwm,.177},{sgYp,.147},H}; -N l28n7[]={{sri,.681},{slir,.236},{sxivg,.314},H}; -N l28n8[]={{swo,.367},{srsi,.138},H}; -N l28n9[]={{slX,1.048},{sxmpg,.550},H}; -N l28n10[]={{soig,.589},{sYp,.092},H}; -N l28n11[]={{sipp,.118},H}; -N l28n12[]={{sgskg,1.454},{sgp,.373},H}; -N l28n13[]={{sXr,1.166},{spm,.301},{swg,.334},{sgzi,.354},{sgoz,.177},H}; -N l28n14[]={{ssqg,.825},H}; -N l28n15[]={{swik,.177},{sgwik,.354},H}; -N l28n16[]={{soo,.327},H}; -N l28n18[]={{sik,.262},H}; -N l28n20[]={{skiv,.138},{ssw,.079},H}; -N l28n21[]={{sgV,.275},{sog,.196},H}; -N l28n23[]={{slyr,.373},{sgxm,.472},{sxxi,.216},{shivg,.275},H}; -N l28n24[]={{slXqg,.432},H}; -N l28n25[]={{sglyr,.747},{swp,.092},H}; -N l28n28[]={{sgwo,.265},H}; -N l28n29[]={{sgq,.786},{sqqiv,.131},H}; -N l28n31[]={{sgli,.383},{sipmk,.157},H}; -N l28n32[]={{soXr,.177},{sxxg,.265},H}; -N l28n33[]={{sxig,.648},{srirg,.236},H}; -N l28n34[]={{swV,.131},{sgrsi,.275},H}; -N l28n35[]={{slXrg,1.611},{srrm,.177},H}; -N l28n36[]={{sivi,.177},H}; -N l28n37[]={{stVg,.413},{sghir,.432},{sirki,.157},{ssx,.065},H}; -N l28n38[]={{sgoX,.383},{ssi,.118},H}; -N l28n39[]={{sgtV,.413},H}; -N l28n41[]={{srk,.419},{spig,.265},H}; -N l28n43[]={{skipw,.131},H}; -N l28n44[]={{sxg,2.220},{sqm,.065},{sgkXr,.196},H}; -N l28n45[]={{sivg,2.771},{shixg,.825},{svs,.105},H}; -N l28n46[]={{ski,.445},{sgr,.531},{sqivg,.275},H}; -N l28n48[]={{sgwiv,.236},H}; -N l28n49[]={{shig,.531},H}; -N l28n51[]={{syrr,.196},H}; -N l28n52[]={{spg,.570},{sim,.144},{sqih,.177},H}; -N l28n55[]={{sghix,.668},H}; -N l28n57[]={{sgmg,.501},{sgzm,.354},H}; -N l28n58[]={{sglXq,.432},H}; -N l28n59[]={{sghig,.314},H}; -N l28n60[]={{shg,.393},H}; -N l28n61[]={{sglXr,1.808},{sYs,.079},{svir,.118},H}; -N l28n62[]={{sky,.092},H}; -N l28n63[]={{sgs,1.179},{sihg,.324},{svX,.118},{spXr,.138},H}; -N l28n64[]={{spp,.223},{sirig,.314},H}; -N l28n65[]={{sgni,.177},H}; -N l28n67[]={{szm,.249},{smpg,.531},{sirr,.275},H}; -N l28n69[]={{sti,.236},H}; -N l28n72[]={{ssk,.511},{sgws,.560},{skirg,.393},H}; -N l28n73[]={{sglXv,.668},H}; -N l28n75[]={{srm,.144},H}; -N l28n76[]={{sws,.262},H}; -N l28n77[]={{sli,.236},{sVv,.383},{sgXx,.324},{srhi,.138},H}; -N l28n78[]={{sgsqg,.354},{snf8,.079},H}; -N l28n79[]={{sixg,1.444},{slXvg,.668},{sgir,.472},{ssvh,.157},H}; -N l28n80[]={{sgt,.452},H}; -N l28n81[]={{sXv,.485},{sgX,.629},{slirr,.210},H}; -N l28n83[]={{sqg,.806},H}; -N l28n84[]={{sos,.157},H}; -N l28n86[]={{sio,.092},H}; -N l28n87[]={{srrig,.432},{syp,.079},H}; -N l28n88[]={{swxig,.432},{sipw,.177},{snikg,.196},H}; -N l28n90[]={{smw,.275},{sgwV,.265},H}; -N l28n91[]={{sig,2.712},{swsqg,.629},{sgxmp,.589},{szixg,.196},H}; -N l28n92[]={{sXqg,.324},{swir,.138},{s79i,.079},H}; -N l28n93[]={{sly,.301},{swt,.118},H}; -N l28n94[]={{swX,.105},{sqXr,.118},H}; -N l28n95[]={{stirg,.432},{sgyr,.295},{swoi,.157},H}; -N l28n98[]={{sgY,.550},{sXw,.079},H}; -N l28n99[]={{ssvg,.648},{sgXz,.354},{sgpi,.177},H}; -N l28n100[]={{soir,.118},H}; -N l28n102[]={{soX,.236},H}; -N l28n103[]={{sip,.445},{srig,.766},{sooi,.432},H}; -N l28n105[]={{sglir,.393},H}; -N l28n106[]={{szg,.275},H}; -N l28n107[]={{sgjs,.884},{smoo,.275},{smx,.131},H}; -N l28n108[]={{sWv,.295},{smi,.105},H}; -N l28n109[]={{sXrg,1.474},{sro,.079},H}; -N l28n110[]={{slz,.157},{syrrm,.210},H}; -N l28n111[]={{swikg,.354},{sXxx,.118},H}; -N l28n112[]={{sqq,.170},{sgoXr,.354},{sYv,.079},{ssvk,.098},H}; -N l28n113[]={{svw,.118},H}; -N l28n114[]={{srg,3.380},{sgv,.373},{sikg,.442},{sgmo,.354},{sirri,.314},{smrk,.236},{svh,.105},H}; -N l28n115[]={{sXx,.275},{sps,.157},H}; -N l28n116[]={{sgqi,.589},{skivg,.275},H}; -N l28n117[]={{sgVg,.265},H}; -N l28n119[]={{slyrg,.747},H}; -N l28n120[]={{siq,.157},H}; -N l28n121[]={{syr,.472},H}; -N l28n122[]={{spmk,.236},{sXrk,.177},{sgxv,.177},H}; -N l28n123[]={{sgiv,.855},{sxir,.275},H}; -N l28n125[]={{sxX,.183},{sgzmp,.236},H}; -N l28n127[]={{sgwx,.324},H}; -N l28n128[]={{srki,.354},{soXrg,.314},H}; -N l28n129[]={{sknf8v,.131},H}; -N l28n130[]={{svx,.275},{swVg,.295},H}; -N l28n131[]={{sgw,1.945},{svi,.511},{skn,.092},H}; -N l28n132[]={{sgh,1.238},H}; -N l28n133[]={{spX,.210},H}; -N l28n135[]={{sgtVg,.550},{srV,.092},H}; -N l28n136[]={{swiv,.177},H}; -N l28n137[]={{sir,1.808},{srkg,.265},H}; -N l28n139[]={{sni,.236},{shir,.236},{sghy,.265},H}; -N l28n140[]={{sqip,.118},{sgjv,.147},H}; -N l28n141[]={{shX,.118},H}; -N l28n142[]={{smk,.210},H}; -N l28n143[]={{sgwsq,.629},H}; -N l28n144[]={{sww,.105},{soiv,.138},H}; -N l28n145[]={{sgix,.265},{ssg,.138},H}; -N l28n146[]={{sqs,.092},H}; -N l28n147[]={{sgmr,.383},{sYi,.131},{svy,.105},H}; -N l28n148[]={{sgx,.688},{sqihg,.314},H}; -N l28n149[]={{sgi,1.297},{sXz,.183},H}; -N l28n150[]={{sXk,.079},H}; -N l28n151[]={{sppi,.157},H}; -N l28n153[]={{skg,1.395},{sipwo,.131},H}; -N l28n154[]={{sf8v,.531},{smooi,.314},H}; -N l28n157[]={{ssp,.105},H}; -N l28n158[]={{sxv,.144},H}; -N l28n159[]={{sjsv,.648},H}; -N l28n160[]={{srr,.576},{sgqih,.314},H}; -N l28n161[]={{swx,.498},{smrki,.210},{szXv,.138},{sgyx,.177},H}; -N l28n162[]={{swi,.524},{sqir,.177},H}; -N l28n164[]={{sqX,.131},{skXr,.157},H}; -N l28n165[]={{sgy,.373},{svk,.079},H}; -N l28n166[]={{sgj,1.081},H}; -N l28n167[]={{sxiv,.314},H}; -N l28n168[]={{sskg,1.091},{sqXrr,.157},H}; -N l28n169[]={{sxmp,.314},{szs,.105},{sox,.105},{sgyrr,.314},H}; -N l28n170[]={{soi,.563},H}; -N l28n172[]={{sgsk,1.120},H}; -N l28n173[]={{sVvg,.796},{sgXxg,.354},H}; -N l28n174[]={{ssq,.498},{sgwX,.177},{siwt,.118},{skV,.079},H}; -N l28n175[]={{sgirg,.354},{spiv,.118},H}; -N l28n176[]={{stg,.118},H}; -N l28n177[]={{sXvg,.707},{srs,.170},H}; -N l28n179[]={{sgmoo,.472},H}; -N l28n180[]={{swti,.118},H}; -N l28n182[]={{sgz,.786},H}; -N l28n183[]={{sgk,.531},{spw,.118},{shiv,.177},H}; -N l28n184[]={{slXq,.216},{sph,.118},H}; -N l28n185[]={{sjs,.445},{sgYi,.236},H}; -N l28n186[]={{sgwVg,.354},H}; -N l28n187[]={{szX,.288},H}; -N l28n190[]={{sgky,.206},{sgqir,.236},H}; -N l28n191[]={{ssr,.170},{smrr,.216},{sgxX,.177},H}; -N l28n192[]={{sxx,.288},{sgos,.206},{shh,.079},H}; -N l28n193[]={{sxi,.773},{sgjsv,1.179},{srir,.118},H}; -N l28n195[]={{slXr,.904},{sgXzg,.354},{swz,.118},{srX,.079},H}; -N l28n196[]={{soirg,.196},H}; -N l28n197[]={{stV,.183},H}; -N l28n199[]={{sooig,.550},{sqqi,.255},{sXrr,.138},{svm,.092},H}; -N l28n200[]={{sgl,2.633},{spx,.118},{sgmrk,.236},H}; -N l28n201[]={{spi,.367},{sgvi,.206},H}; -N l28n202[]={{srkir,.210},H}; -N l28n203[]={{sjX,.079},{soz,.079},H}; -N l28n205[]={{siv,1.520},{shix,.432},H}; -N l28n206[]={{sqiv,.138},H}; -N l28n207[]={{sgly,.619},H}; -N l28n208[]={{shx,.065},H}; -N l28n209[]={{shi,.865},H}; -N l28n210[]={{smo,.196},{skip,.118},H}; -N l28n211[]={{sXxg,.265},H}; -N l28n213[]={{sirh,.138},H}; -N l28n214[]={{sgiwt,.196},H}; -N l28n215[]={{smg,.589},H}; -N l28n217[]={{sgm,.924},{syrg,.560},{svxi,.118},{skXrk,.157},H}; -N l28n218[]={{sgwi,.619},{sglz,.295},{siwx,.177},{sXo,.118},{spmkg,.275},H}; -N l28n219[]={{sghi,1.267},{sVg,1.857},{sgivg,1.140},{sxirg,.432},{syxx,.118},H}; -N l28n221[]={{sgmrr,.236},{siwti,.157},H}; -N l28n222[]={{siw,.301},H}; -N l28n223[]={{sih,.249},{sXg,.275},{syx,.170},H}; -N l28n224[]={{siri,.255},{ssir,.118},H}; -N l28n225[]={{shy,.131},{sgzX,.265},{sst,.079},H}; -N l28n226[]={{svxg,.236},H}; -N l28n227[]={{smp,.380},{svig,.383},H}; -N l28n229[]={{sziv,.118},H}; -N l28n230[]={{swm,.092},H}; -N l28n231[]={{szmp,.118},{srVg,.147},H}; -N l28n232[]={{sqi,.498},{skir,.275},{swivg,.314},H}; -N l28n233[]={{sirg,2.594},{svo,.079},H}; -N l28n234[]={{skX,.105},{sgn,.138},{spz,.092},{sipm,.118},H}; -N l28n235[]={{sXp,.327},{shirg,.472},H}; -N l28n237[]={{sriv,.138},H}; -N l28n238[]={{svg,3.163},{smkg,.265},{sgsq,.265},{swzX,.118},H}; -N l28n239[]={{six,.747},{slXv,.334},H}; -N l28n240[]={{soivg,.275},H}; -N l28n241[]={{sgixg,.275},H}; -N l28n243[]={{sglX,2.328},{sgrs,.324},H}; -N l28n245[]={{srw,.196},{sXzg,.295},{sxvi,.098},H}; -N l28n246[]={{srh,.183},{sirk,.177},H}; -N l28n247[]={{srri,.432},H}; -N l28n248[]={{swxi,.314},H}; -N l28n250[]={{sf8vg,.464},H}; -N l28n251[]={{sgo,.668},{swsq,.334},{szix,.118},H}; -N l28n252[]={{sXq,.196},H}; -N l28n253[]={{szmr,.118},H}; -N l28n254[]={{sXrw,.196},H}; -N l28n255[]={{szi,.341},{sjsvg,.786},{stir,.216},{ssvx,.138},H}; - -D l28_d = -{ +S sglXr[] = { 32, h, 97, n, 0 }; +S slXrg[] = { h, 97, n, a }; +S slyr[] = { h, u, n, 0 }; +S slyrg[] = { h, u, n, a }; +S sglyr[] = { 32, h, u, n, 0 }; +S sglXv[] = { 32, h, 97, r, 0 }; +S sgwsq[] = { 32, s, o, m, 0 }; +S swsqg[] = { s, o, m, a }; +S sgtV[] = { 32, p, 229, 0 }; +S stVg[] = { p, 229, a }; +S sgtVg[] = { 32, p, 229, a }; +S stV[] = { p, 229, 0 }; +S sVv[] = { 229, r, 0 }; +S sirri[] = { e, n, n, e, 0 }; +S sVvg[] = { 229, r, a }; +S srrig[] = { n, n, e, a }; +S sglXq[] = { 32, h, 97, m, 0 }; +S swxig[] = { s, t, e, a }; +S slXqg[] = { h, 97, m, a }; +S stirg[] = { p, e, n, a }; +S sXqg[] = { 97, m, a }; +S slXq[] = { h, 97, m, 0 }; +S sglir[] = { 32, h, e, n, 0 }; +S sXzg[] = { 97, v, a }; +S sglz[] = { 32, h, v, 0 }; +S swVg[] = { s, 229, a }; +S swV[] = { s, 229, 0 }; +S swik[] = { s, e, g, 0 }; +S sgXzg[] = { 32, 97, v, a }; +S sgVg[] = { 32, 229, a }; +S sgwV[] = { 32, s, 229, 0 }; +S sgwVg[] = { 32, s, 229, a }; +S sXrk[] = { 97, n, g, 0 }; +S sgwik[] = { 32, s, e, g, 0 }; +S swikg[] = { s, e, g, a }; +S sqih[] = { m, e, d, 0 }; +S sgqih[] = { 32, m, e, d, 0 }; +S sirig[] = { e, n, e, a }; +S syrrm[] = { u, n, n, i, 0 }; +S slirr[] = { h, e, n, n, 0 }; +S sqihg[] = { m, e, d, a }; +S soXrg[] = { k, 97, n, a }; +S skXr[] = { g, 97, n, 0 }; +S sgyrr[] = { 32, u, n, n, 0 }; +S soivg[] = { k, e, r, a }; +S sgky[] = { 32, g, u, 0 }; +S spmkg[] = { l, i, g, a }; +S sqivg[] = { m, e, r, a }; +S srsi[] = { n, o, e, 0 }; +S sf8vg[] = { 248, r, a }; +S sgrsi[] = { 32, n, o, e, 0 }; +S spXr[] = { l, 97, n, 0 }; +S srV[] = { n, 229, 0 }; +S sgmrr[] = { 32, i, n, n, 0 }; +S sgrV[] = { 32, n, 229, 0 }; +S sgzmp[] = { 32, v, i, l, 0 }; +S ssir[] = { o, e, n, 0 }; +S swzX[] = { s, v, 97, 0 }; +S szmp[] = { v, i, l, 0 }; +S sqXrr[] = { m, 97, n, n, 0 }; +S sirki[] = { e, n, g, e, 0 }; +S sgwiv[] = { 32, s, e, r, 0 }; +S skXrk[] = { g, 97, n, g, 0 }; +S szmr[] = { v, i, n, 0 }; +S swti[] = { s, p, e, 0 }; +S sqip[] = { m, e, l, 0 }; +S siwti[] = { e, s, p, e, 0 }; +S sipmk[] = { e, l, i, g, 0 }; +S siwt[] = { e, s, p, 0 }; +S skV[] = { g, 229, 0 }; +S snf8[] = { j, 248, 0 }; +S sgmrk[] = { 32, i, n, g, 0 }; +S sgoz[] = { 32, k, v, 0 }; +S sgkXr[] = { 32, g, 97, n, 0 }; +S sqqiv[] = { m, m, e, r, 0 }; +S sknf8v[] = { g, j, 248, r, 0 }; +S snikg[] = { j, e, g, a }; +S sgiwt[] = { 32, e, s, p, 0 }; +S sipwo[] = { e, l, s, k, 0 }; +S srVg[] = { n, 229, a }; +S ssvk[] = { o, r, g, 0 }; +S szixg[] = { v, e, t, a }; +S soirg[] = { k, e, n, a }; +S shx[] = { d, t, 0 }; + +N l28n0[] = { { stt, .105 }, { srrg, .236 }, H }; +N l28n2[] = { { sqirg, .314 }, H }; +N l28n3[] = { { ssv, .707 }, H }; +N l28n5[] = { { smr, .445 }, { sxm, .327 }, { sgrV, .177 }, H }; +N l28n6[] = { { srx, .183 }, { sgwm, .177 }, { sgYp, .147 }, H }; +N l28n7[] = { { sri, .681 }, { slir, .236 }, { sxivg, .314 }, H }; +N l28n8[] = { { swo, .367 }, { srsi, .138 }, H }; +N l28n9[] = { { slX, 1.048 }, { sxmpg, .550 }, H }; +N l28n10[] = { { soig, .589 }, { sYp, .092 }, H }; +N l28n11[] = { { sipp, .118 }, H }; +N l28n12[] = { { sgskg, 1.454 }, { sgp, .373 }, H }; +N l28n13[] = { { sXr, 1.166 }, { spm, .301 }, { swg, .334 }, { sgzi, .354 }, { sgoz, .177 }, H }; +N l28n14[] = { { ssqg, .825 }, H }; +N l28n15[] = { { swik, .177 }, { sgwik, .354 }, H }; +N l28n16[] = { { soo, .327 }, H }; +N l28n18[] = { { sik, .262 }, H }; +N l28n20[] = { { skiv, .138 }, { ssw, .079 }, H }; +N l28n21[] = { { sgV, .275 }, { sog, .196 }, H }; +N l28n23[] = { { slyr, .373 }, { sgxm, .472 }, { sxxi, .216 }, { shivg, .275 }, H }; +N l28n24[] = { { slXqg, .432 }, H }; +N l28n25[] = { { sglyr, .747 }, { swp, .092 }, H }; +N l28n28[] = { { sgwo, .265 }, H }; +N l28n29[] = { { sgq, .786 }, { sqqiv, .131 }, H }; +N l28n31[] = { { sgli, .383 }, { sipmk, .157 }, H }; +N l28n32[] = { { soXr, .177 }, { sxxg, .265 }, H }; +N l28n33[] = { { sxig, .648 }, { srirg, .236 }, H }; +N l28n34[] = { { swV, .131 }, { sgrsi, .275 }, H }; +N l28n35[] = { { slXrg, 1.611 }, { srrm, .177 }, H }; +N l28n36[] = { { sivi, .177 }, H }; +N l28n37[] = { { stVg, .413 }, { sghir, .432 }, { sirki, .157 }, { ssx, .065 }, H }; +N l28n38[] = { { sgoX, .383 }, { ssi, .118 }, H }; +N l28n39[] = { { sgtV, .413 }, H }; +N l28n41[] = { { srk, .419 }, { spig, .265 }, H }; +N l28n43[] = { { skipw, .131 }, H }; +N l28n44[] = { { sxg, 2.220 }, { sqm, .065 }, { sgkXr, .196 }, H }; +N l28n45[] = { { sivg, 2.771 }, { shixg, .825 }, { svs, .105 }, H }; +N l28n46[] = { { ski, .445 }, { sgr, .531 }, { sqivg, .275 }, H }; +N l28n48[] = { { sgwiv, .236 }, H }; +N l28n49[] = { { shig, .531 }, H }; +N l28n51[] = { { syrr, .196 }, H }; +N l28n52[] = { { spg, .570 }, { sim, .144 }, { sqih, .177 }, H }; +N l28n55[] = { { sghix, .668 }, H }; +N l28n57[] = { { sgmg, .501 }, { sgzm, .354 }, H }; +N l28n58[] = { { sglXq, .432 }, H }; +N l28n59[] = { { sghig, .314 }, H }; +N l28n60[] = { { shg, .393 }, H }; +N l28n61[] = { { sglXr, 1.808 }, { sYs, .079 }, { svir, .118 }, H }; +N l28n62[] = { { sky, .092 }, H }; +N l28n63[] = { { sgs, 1.179 }, { sihg, .324 }, { svX, .118 }, { spXr, .138 }, H }; +N l28n64[] = { { spp, .223 }, { sirig, .314 }, H }; +N l28n65[] = { { sgni, .177 }, H }; +N l28n67[] = { { szm, .249 }, { smpg, .531 }, { sirr, .275 }, H }; +N l28n69[] = { { sti, .236 }, H }; +N l28n72[] = { { ssk, .511 }, { sgws, .560 }, { skirg, .393 }, H }; +N l28n73[] = { { sglXv, .668 }, H }; +N l28n75[] = { { srm, .144 }, H }; +N l28n76[] = { { sws, .262 }, H }; +N l28n77[] = { { sli, .236 }, { sVv, .383 }, { sgXx, .324 }, { srhi, .138 }, H }; +N l28n78[] = { { sgsqg, .354 }, { snf8, .079 }, H }; +N l28n79[] = { { sixg, 1.444 }, { slXvg, .668 }, { sgir, .472 }, { ssvh, .157 }, H }; +N l28n80[] = { { sgt, .452 }, H }; +N l28n81[] = { { sXv, .485 }, { sgX, .629 }, { slirr, .210 }, H }; +N l28n83[] = { { sqg, .806 }, H }; +N l28n84[] = { { sos, .157 }, H }; +N l28n86[] = { { sio, .092 }, H }; +N l28n87[] = { { srrig, .432 }, { syp, .079 }, H }; +N l28n88[] = { { swxig, .432 }, { sipw, .177 }, { snikg, .196 }, H }; +N l28n90[] = { { smw, .275 }, { sgwV, .265 }, H }; +N l28n91[] = { { sig, 2.712 }, { swsqg, .629 }, { sgxmp, .589 }, { szixg, .196 }, H }; +N l28n92[] = { { sXqg, .324 }, { swir, .138 }, { s79i, .079 }, H }; +N l28n93[] = { { sly, .301 }, { swt, .118 }, H }; +N l28n94[] = { { swX, .105 }, { sqXr, .118 }, H }; +N l28n95[] = { { stirg, .432 }, { sgyr, .295 }, { swoi, .157 }, H }; +N l28n98[] = { { sgY, .550 }, { sXw, .079 }, H }; +N l28n99[] = { { ssvg, .648 }, { sgXz, .354 }, { sgpi, .177 }, H }; +N l28n100[] = { { soir, .118 }, H }; +N l28n102[] = { { soX, .236 }, H }; +N l28n103[] = { { sip, .445 }, { srig, .766 }, { sooi, .432 }, H }; +N l28n105[] = { { sglir, .393 }, H }; +N l28n106[] = { { szg, .275 }, H }; +N l28n107[] = { { sgjs, .884 }, { smoo, .275 }, { smx, .131 }, H }; +N l28n108[] = { { sWv, .295 }, { smi, .105 }, H }; +N l28n109[] = { { sXrg, 1.474 }, { sro, .079 }, H }; +N l28n110[] = { { slz, .157 }, { syrrm, .210 }, H }; +N l28n111[] = { { swikg, .354 }, { sXxx, .118 }, H }; +N l28n112[] = { { sqq, .170 }, { sgoXr, .354 }, { sYv, .079 }, { ssvk, .098 }, H }; +N l28n113[] = { { svw, .118 }, H }; +N l28n114[] = { { srg, 3.380 }, { sgv, .373 }, { sikg, .442 }, { sgmo, .354 }, { sirri, .314 }, { smrk, .236 }, { svh, .105 }, H }; +N l28n115[] = { { sXx, .275 }, { sps, .157 }, H }; +N l28n116[] = { { sgqi, .589 }, { skivg, .275 }, H }; +N l28n117[] = { { sgVg, .265 }, H }; +N l28n119[] = { { slyrg, .747 }, H }; +N l28n120[] = { { siq, .157 }, H }; +N l28n121[] = { { syr, .472 }, H }; +N l28n122[] = { { spmk, .236 }, { sXrk, .177 }, { sgxv, .177 }, H }; +N l28n123[] = { { sgiv, .855 }, { sxir, .275 }, H }; +N l28n125[] = { { sxX, .183 }, { sgzmp, .236 }, H }; +N l28n127[] = { { sgwx, .324 }, H }; +N l28n128[] = { { srki, .354 }, { soXrg, .314 }, H }; +N l28n129[] = { { sknf8v, .131 }, H }; +N l28n130[] = { { svx, .275 }, { swVg, .295 }, H }; +N l28n131[] = { { sgw, 1.945 }, { svi, .511 }, { skn, .092 }, H }; +N l28n132[] = { { sgh, 1.238 }, H }; +N l28n133[] = { { spX, .210 }, H }; +N l28n135[] = { { sgtVg, .550 }, { srV, .092 }, H }; +N l28n136[] = { { swiv, .177 }, H }; +N l28n137[] = { { sir, 1.808 }, { srkg, .265 }, H }; +N l28n139[] = { { sni, .236 }, { shir, .236 }, { sghy, .265 }, H }; +N l28n140[] = { { sqip, .118 }, { sgjv, .147 }, H }; +N l28n141[] = { { shX, .118 }, H }; +N l28n142[] = { { smk, .210 }, H }; +N l28n143[] = { { sgwsq, .629 }, H }; +N l28n144[] = { { sww, .105 }, { soiv, .138 }, H }; +N l28n145[] = { { sgix, .265 }, { ssg, .138 }, H }; +N l28n146[] = { { sqs, .092 }, H }; +N l28n147[] = { { sgmr, .383 }, { sYi, .131 }, { svy, .105 }, H }; +N l28n148[] = { { sgx, .688 }, { sqihg, .314 }, H }; +N l28n149[] = { { sgi, 1.297 }, { sXz, .183 }, H }; +N l28n150[] = { { sXk, .079 }, H }; +N l28n151[] = { { sppi, .157 }, H }; +N l28n153[] = { { skg, 1.395 }, { sipwo, .131 }, H }; +N l28n154[] = { { sf8v, .531 }, { smooi, .314 }, H }; +N l28n157[] = { { ssp, .105 }, H }; +N l28n158[] = { { sxv, .144 }, H }; +N l28n159[] = { { sjsv, .648 }, H }; +N l28n160[] = { { srr, .576 }, { sgqih, .314 }, H }; +N l28n161[] = { { swx, .498 }, { smrki, .210 }, { szXv, .138 }, { sgyx, .177 }, H }; +N l28n162[] = { { swi, .524 }, { sqir, .177 }, H }; +N l28n164[] = { { sqX, .131 }, { skXr, .157 }, H }; +N l28n165[] = { { sgy, .373 }, { svk, .079 }, H }; +N l28n166[] = { { sgj, 1.081 }, H }; +N l28n167[] = { { sxiv, .314 }, H }; +N l28n168[] = { { sskg, 1.091 }, { sqXrr, .157 }, H }; +N l28n169[] = { { sxmp, .314 }, { szs, .105 }, { sox, .105 }, { sgyrr, .314 }, H }; +N l28n170[] = { { soi, .563 }, H }; +N l28n172[] = { { sgsk, 1.120 }, H }; +N l28n173[] = { { sVvg, .796 }, { sgXxg, .354 }, H }; +N l28n174[] = { { ssq, .498 }, { sgwX, .177 }, { siwt, .118 }, { skV, .079 }, H }; +N l28n175[] = { { sgirg, .354 }, { spiv, .118 }, H }; +N l28n176[] = { { stg, .118 }, H }; +N l28n177[] = { { sXvg, .707 }, { srs, .170 }, H }; +N l28n179[] = { { sgmoo, .472 }, H }; +N l28n180[] = { { swti, .118 }, H }; +N l28n182[] = { { sgz, .786 }, H }; +N l28n183[] = { { sgk, .531 }, { spw, .118 }, { shiv, .177 }, H }; +N l28n184[] = { { slXq, .216 }, { sph, .118 }, H }; +N l28n185[] = { { sjs, .445 }, { sgYi, .236 }, H }; +N l28n186[] = { { sgwVg, .354 }, H }; +N l28n187[] = { { szX, .288 }, H }; +N l28n190[] = { { sgky, .206 }, { sgqir, .236 }, H }; +N l28n191[] = { { ssr, .170 }, { smrr, .216 }, { sgxX, .177 }, H }; +N l28n192[] = { { sxx, .288 }, { sgos, .206 }, { shh, .079 }, H }; +N l28n193[] = { { sxi, .773 }, { sgjsv, 1.179 }, { srir, .118 }, H }; +N l28n195[] = { { slXr, .904 }, { sgXzg, .354 }, { swz, .118 }, { srX, .079 }, H }; +N l28n196[] = { { soirg, .196 }, H }; +N l28n197[] = { { stV, .183 }, H }; +N l28n199[] = { { sooig, .550 }, { sqqi, .255 }, { sXrr, .138 }, { svm, .092 }, H }; +N l28n200[] = { { sgl, 2.633 }, { spx, .118 }, { sgmrk, .236 }, H }; +N l28n201[] = { { spi, .367 }, { sgvi, .206 }, H }; +N l28n202[] = { { srkir, .210 }, H }; +N l28n203[] = { { sjX, .079 }, { soz, .079 }, H }; +N l28n205[] = { { siv, 1.520 }, { shix, .432 }, H }; +N l28n206[] = { { sqiv, .138 }, H }; +N l28n207[] = { { sgly, .619 }, H }; +N l28n208[] = { { shx, .065 }, H }; +N l28n209[] = { { shi, .865 }, H }; +N l28n210[] = { { smo, .196 }, { skip, .118 }, H }; +N l28n211[] = { { sXxg, .265 }, H }; +N l28n213[] = { { sirh, .138 }, H }; +N l28n214[] = { { sgiwt, .196 }, H }; +N l28n215[] = { { smg, .589 }, H }; +N l28n217[] = { { sgm, .924 }, { syrg, .560 }, { svxi, .118 }, { skXrk, .157 }, H }; +N l28n218[] = { { sgwi, .619 }, { sglz, .295 }, { siwx, .177 }, { sXo, .118 }, { spmkg, .275 }, H }; +N l28n219[] = { { sghi, 1.267 }, { sVg, 1.857 }, { sgivg, 1.140 }, { sxirg, .432 }, { syxx, .118 }, H }; +N l28n221[] = { { sgmrr, .236 }, { siwti, .157 }, H }; +N l28n222[] = { { siw, .301 }, H }; +N l28n223[] = { { sih, .249 }, { sXg, .275 }, { syx, .170 }, H }; +N l28n224[] = { { siri, .255 }, { ssir, .118 }, H }; +N l28n225[] = { { shy, .131 }, { sgzX, .265 }, { sst, .079 }, H }; +N l28n226[] = { { svxg, .236 }, H }; +N l28n227[] = { { smp, .380 }, { svig, .383 }, H }; +N l28n229[] = { { sziv, .118 }, H }; +N l28n230[] = { { swm, .092 }, H }; +N l28n231[] = { { szmp, .118 }, { srVg, .147 }, H }; +N l28n232[] = { { sqi, .498 }, { skir, .275 }, { swivg, .314 }, H }; +N l28n233[] = { { sirg, 2.594 }, { svo, .079 }, H }; +N l28n234[] = { { skX, .105 }, { sgn, .138 }, { spz, .092 }, { sipm, .118 }, H }; +N l28n235[] = { { sXp, .327 }, { shirg, .472 }, H }; +N l28n237[] = { { sriv, .138 }, H }; +N l28n238[] = { { svg, 3.163 }, { smkg, .265 }, { sgsq, .265 }, { swzX, .118 }, H }; +N l28n239[] = { { six, .747 }, { slXv, .334 }, H }; +N l28n240[] = { { soivg, .275 }, H }; +N l28n241[] = { { sgixg, .275 }, H }; +N l28n243[] = { { sglX, 2.328 }, { sgrs, .324 }, H }; +N l28n245[] = { { srw, .196 }, { sXzg, .295 }, { sxvi, .098 }, H }; +N l28n246[] = { { srh, .183 }, { sirk, .177 }, H }; +N l28n247[] = { { srri, .432 }, H }; +N l28n248[] = { { swxi, .314 }, H }; +N l28n250[] = { { sf8vg, .464 }, H }; +N l28n251[] = { { sgo, .668 }, { swsq, .334 }, { szix, .118 }, H }; +N l28n252[] = { { sXq, .196 }, H }; +N l28n253[] = { { szmr, .118 }, H }; +N l28n254[] = { { sXrw, .196 }, H }; +N l28n255[] = { { szi, .341 }, { sjsvg, .786 }, { stir, .216 }, { ssvx, .138 }, H }; + +D l28_d = { "norwegian", "iso-8859-15", - { - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,0.130,0.020,0.001,0.071,0.307,0.039,0.081,0.076,0.092,0.016,0.079,0.093,0.069,0.207,0.105, - 0.034,W,0.159,0.115,0.142,0.046,0.052,W,W,0.011,W,W,W,W,W,W, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - Y,V,V,V,V,0.001,V,V,V,V,V,V,V,V,V,V, - V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V, - V,V,V,V,V,0.074,0.012,V,V,0.001,V,V,V,V,V,V, - V,V,V,V,V,V,V,V,0.035,V,V,V,V,V,V,V - }, - { - l28n0,X,l28n2,l28n3,X,l28n5,l28n6,l28n7,l28n8,l28n9,l28n10,l28n11,l28n12,l28n13,l28n14,l28n15, - l28n16,X,l28n18,X,l28n20,l28n21,X,l28n23,l28n24,l28n25,X,X,l28n28,l28n29,X,l28n31, - l28n32,l28n33,l28n34,l28n35,l28n36,l28n37,l28n38,l28n39,X,l28n41,X,l28n43,l28n44,l28n45,l28n46,X, - l28n48,l28n49,X,l28n51,l28n52,X,X,l28n55,X,l28n57,l28n58,l28n59,l28n60,l28n61,l28n62,l28n63, - l28n64,l28n65,X,l28n67,X,l28n69,X,X,l28n72,l28n73,X,l28n75,l28n76,l28n77,l28n78,l28n79, - l28n80,l28n81,X,l28n83,l28n84,X,l28n86,l28n87,l28n88,X,l28n90,l28n91,l28n92,l28n93,l28n94,l28n95, - X,X,l28n98,l28n99,l28n100,X,l28n102,l28n103,X,l28n105,l28n106,l28n107,l28n108,l28n109,l28n110,l28n111, - l28n112,l28n113,l28n114,l28n115,l28n116,l28n117,X,l28n119,l28n120,l28n121,l28n122,l28n123,X,l28n125,X,l28n127, - l28n128,l28n129,l28n130,l28n131,l28n132,l28n133,X,l28n135,l28n136,l28n137,X,l28n139,l28n140,l28n141,l28n142,l28n143, - l28n144,l28n145,l28n146,l28n147,l28n148,l28n149,l28n150,l28n151,X,l28n153,l28n154,X,X,l28n157,l28n158,l28n159, - l28n160,l28n161,l28n162,X,l28n164,l28n165,l28n166,l28n167,l28n168,l28n169,l28n170,X,l28n172,l28n173,l28n174,l28n175, - l28n176,l28n177,X,l28n179,l28n180,X,l28n182,l28n183,l28n184,l28n185,l28n186,l28n187,X,X,l28n190,l28n191, - l28n192,l28n193,X,l28n195,l28n196,l28n197,X,l28n199,l28n200,l28n201,l28n202,l28n203,X,l28n205,l28n206,l28n207, - l28n208,l28n209,l28n210,l28n211,X,l28n213,l28n214,l28n215,X,l28n217,l28n218,l28n219,X,l28n221,l28n222,l28n223, - l28n224,l28n225,l28n226,l28n227,X,l28n229,l28n230,l28n231,l28n232,l28n233,l28n234,l28n235,X,l28n237,l28n238,l28n239, - l28n240,l28n241,X,l28n243,X,l28n245,l28n246,l28n247,l28n248,X,l28n250,l28n251,l28n252,l28n253,l28n254,l28n255 - } + { W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, 0.130, 0.020, 0.001, 0.071, 0.307, 0.039, 0.081, 0.076, 0.092, 0.016, 0.079, 0.093, 0.069, 0.207, 0.105, + 0.034, W, 0.159, 0.115, 0.142, 0.046, 0.052, W, W, 0.011, W, W, W, W, W, W, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + Y, V, V, V, V, 0.001, V, V, V, V, V, V, V, V, V, V, + V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, + V, V, V, V, V, 0.074, 0.012, V, V, 0.001, V, V, V, V, V, V, + V, V, V, V, V, V, V, V, 0.035, V, V, V, V, V, V, V }, + { l28n0, X, l28n2, l28n3, X, l28n5, l28n6, l28n7, l28n8, l28n9, l28n10, l28n11, l28n12, l28n13, l28n14, l28n15, + l28n16, X, l28n18, X, l28n20, l28n21, X, l28n23, l28n24, l28n25, X, X, l28n28, l28n29, X, l28n31, + l28n32, l28n33, l28n34, l28n35, l28n36, l28n37, l28n38, l28n39, X, l28n41, X, l28n43, l28n44, l28n45, l28n46, X, + l28n48, l28n49, X, l28n51, l28n52, X, X, l28n55, X, l28n57, l28n58, l28n59, l28n60, l28n61, l28n62, l28n63, + l28n64, l28n65, X, l28n67, X, l28n69, X, X, l28n72, l28n73, X, l28n75, l28n76, l28n77, l28n78, l28n79, + l28n80, l28n81, X, l28n83, l28n84, X, l28n86, l28n87, l28n88, X, l28n90, l28n91, l28n92, l28n93, l28n94, l28n95, + X, X, l28n98, l28n99, l28n100, X, l28n102, l28n103, X, l28n105, l28n106, l28n107, l28n108, l28n109, l28n110, l28n111, + l28n112, l28n113, l28n114, l28n115, l28n116, l28n117, X, l28n119, l28n120, l28n121, l28n122, l28n123, X, l28n125, X, l28n127, + l28n128, l28n129, l28n130, l28n131, l28n132, l28n133, X, l28n135, l28n136, l28n137, X, l28n139, l28n140, l28n141, l28n142, l28n143, + l28n144, l28n145, l28n146, l28n147, l28n148, l28n149, l28n150, l28n151, X, l28n153, l28n154, X, X, l28n157, l28n158, l28n159, + l28n160, l28n161, l28n162, X, l28n164, l28n165, l28n166, l28n167, l28n168, l28n169, l28n170, X, l28n172, l28n173, l28n174, l28n175, + l28n176, l28n177, X, l28n179, l28n180, X, l28n182, l28n183, l28n184, l28n185, l28n186, l28n187, X, X, l28n190, l28n191, + l28n192, l28n193, X, l28n195, l28n196, l28n197, X, l28n199, l28n200, l28n201, l28n202, l28n203, X, l28n205, l28n206, l28n207, + l28n208, l28n209, l28n210, l28n211, X, l28n213, l28n214, l28n215, X, l28n217, l28n218, l28n219, X, l28n221, l28n222, l28n223, + l28n224, l28n225, l28n226, l28n227, X, l28n229, l28n230, l28n231, l28n232, l28n233, l28n234, l28n235, X, l28n237, l28n238, l28n239, + l28n240, l28n241, X, l28n243, X, l28n245, l28n246, l28n247, l28n248, X, l28n250, l28n251, l28n252, l28n253, l28n254, l28n255 } }; - - // // Lng: polish // Enc: iso-8859-15 // - -S sZ7a[]={99,z,0}; -S ss_[]={o,w,0}; -S sh7a[]={d,z,0}; -S sg_g[]={32,w,a}; -S smea[]={i,234,0}; -S s79Z[]={y,99,0}; -S s_79[]={w,y,0}; -S sZ7ai[]={99,z,e,0}; -S siksg[]={e,g,o,a}; -S sX_[]={97,w,0}; -S sXb3[]={97,179,0}; -S siks[]={e,g,o,0}; -S sb3s[]={179,o,0}; -S sh7am[]={d,z,i,0}; -S sv7ai[]={r,z,e,0}; -S somi[]={k,i,e,0}; -S s7ami[]={z,i,e,0}; -S sf3_[]={243,w,0}; -S s_mi[]={w,i,e,0}; -S sgtv7a[]={32,p,r,z,0}; -S sh7ami[]={d,z,i,e,0}; -S sghsg[]={32,d,o,a}; -S stv7a[]={p,r,z,0}; -S sbfi[]={191,e,0}; -S sb3X[]={179,97,0}; -S s79Zl[]={y,99,h,0}; -S s7aZ[]={z,99,0}; -S s79q[]={y,m,0}; -S s_w[]={w,s,0}; -S s79Zlg[]={y,99,h,a}; -S sbfig[]={191,e,a}; -S sring[]={n,e,j,a}; -S ss_X[]={o,w,97,0}; -S srin[]={n,e,j,0}; -S sw7aZ[]={s,z,99,0}; -S sg_79[]={32,w,y,0}; -S sw7aZ7a[]={s,z,99,z,0}; -S s79qg[]={y,m,a}; -S s7aZ7a[]={z,99,z,0}; -S stv7ai[]={p,r,z,e,0}; -S sgbfi[]={32,191,e,0}; -S sgbfig[]={32,191,e,a}; -S swom[]={s,k,i,0}; -S srmX[]={n,i,97,0}; -S smin[]={i,e,j,0}; -S sv7a79[]={r,z,y,0}; -S sXb3g[]={97,179,a}; -S sgx79[]={32,t,y,0}; -S sx_[]={t,w,0}; -S s79b3[]={y,179,0}; -S smeag[]={i,234,a}; -S sY79b3[]={98,y,179,0}; -S sb3sg[]={179,o,a}; -S sming[]={i,e,j,a}; -S stvX_[]={p,r,97,w,0}; -S sgtvX[]={32,p,r,97,0}; -S stXr[]={p,97,n,0}; -S sf3_g[]={243,w,a}; -S srmXg[]={n,i,97,a}; -S svX_[]={r,97,w,0}; -S sXbf[]={97,191,0}; -S sb379[]={179,y,0}; -S sriks[]={n,e,g,o,0}; -S s7a79g[]={z,y,a}; -S sgZ7a[]={32,99,z,0}; -S sf1w[]={241,s,0}; -S srik[]={n,e,g,0}; -S s7aZ7ai[]={z,99,z,e,0}; -S swmeag[]={s,i,234,a}; -S smik[]={i,e,g,0}; -S swmea[]={s,i,234,0}; -S sgwmea[]={32,s,i,234,0}; -S sXf1[]={97,241,0}; -S snXo[]={j,97,k,0}; -S smy[]={i,u,0}; -S sZ7a79[]={99,z,y,0}; -S swomi[]={s,k,i,e,0}; -S sgnXo[]={32,j,97,k,0}; -S sybf[]={u,191,0}; -S sgox[]={32,k,t,0}; -S ssb6[]={o,182,0}; -S smyg[]={i,u,a}; -S smZ7a[]={i,99,z,0}; -S smip[]={i,e,l,0}; -S sqmi[]={m,i,e,0}; -S sb3y[]={179,u,0}; -S sihr[]={e,d,n,0}; -S sgY79b3[]={32,98,y,179,0}; -S shrm[]={d,n,i,0}; -S seah[]={234,d,0}; -S srXn[]={n,97,j,0}; -S s_wo[]={w,s,k,0}; -S smiq[]={i,e,m,0}; -S smiks[]={i,e,g,o,0}; -S srmyg[]={n,i,u,a}; -S sxf3v[]={t,243,r,0}; -S sf3v[]={243,r,0}; -S s_Xr[]={w,97,n,0}; -S sZ7ar[]={99,z,n,0}; -S syw7a[]={u,s,z,0}; -S ss_m[]={o,w,i,0}; -S seah7a[]={234,d,z,0}; -S smeaZ[]={i,234,99,0}; -S s_wom[]={w,s,k,i,0}; -S sZmig[]={99,i,e,a}; -S seaZ[]={234,99,0}; -S smb3[]={i,179,0}; -S ss_w[]={o,w,s,0}; -S sibf[]={e,191,0}; -S spri[]={l,n,e,0}; -S snihr[]={j,e,d,n,0}; -S soxf3[]={k,t,243,0}; -S sgnih[]={32,j,e,d,0}; -S sgoxf3[]={32,k,t,243,0}; -S sgrXn[]={32,n,97,j,0}; -S soxf3v[]={k,t,243,r,0}; -S sgtsq[]={32,p,o,m,0}; -S skb3[]={g,179,0}; -S sbfX[]={191,97,0}; -S swb3[]={s,179,0}; -S sb1h[]={177,d,0}; -S srmZ[]={n,i,99,0}; -S srmy[]={n,i,u,0}; -S sqf3[]={m,243,0}; -S s79Y[]={y,98,0}; -S stsq[]={p,o,m,0}; -S sXpr[]={97,l,n,0}; -S swx_[]={s,t,w,0}; -S ssYm[]={o,98,i,0}; -S sqf3_m[]={m,243,w,i,0}; -S s_w7a[]={w,s,z,0}; -S srmo[]={n,i,k,0}; -S sXom[]={97,k,i,0}; -S somik[]={k,i,e,g,0}; -S sb3Xg[]={179,97,a}; -S s_sg[]={w,o,a}; -S sZnm[]={99,j,i,0}; -S s7airm[]={z,e,n,i,0}; -S sqf3_[]={m,243,w,0}; -S s79wx[]={y,s,t,0}; -S sr79Z[]={n,y,99,0}; -S shpX[]={d,l,97,0}; -S skh[]={g,d,0}; -S sZir[]={99,e,n,0}; -S sXf1w[]={97,241,s,0}; -S sghp[]={32,d,l,0}; -S sg_mi[]={32,w,i,e,0}; -S s_Xg[]={w,97,a}; - -N l29n1[]={{stX,.166},H}; -N l29n2[]={{srmig,.959},{sXb3g,.259},H}; -N l29n3[]={{ssv,.256},H}; -N l29n4[]={{ssZ,.089},H}; -N l29n5[]={{smr,.115},H}; -N l29n6[]={{srx,.128},{sgwm,.230},H}; -N l29n7[]={{sw7a,.537},{sri,.345},{sZn,.128},H}; -N l29n8[]={{swo,.243},H}; -N l29n11[]={{skv,.141},H}; -N l29n12[]={{sb3s,.345},{sirm,.268},{sgp,.268},{s_w,.166},{syw7a,.115},H}; -N l29n13[]={{sXr,.447},{spm,.320},H}; -N l29n16[]={{smip,.134},H}; -N l29n17[]={{srsg,.201},H}; -N l29n18[]={{sik,.358},{s79Zlg,.498},H}; -N l29n19[]={{sb1h,.115},H}; -N l29n20[]={{s7ar,.153},{ssw,.128},H}; -N l29n21[]={{sgts,1.064},{sx79,.217},{ssh,.166},{sog,.249},{sgnX,.288},{sxf3v,.115},H}; -N l29n22[]={{s7ami,.307},{sms,.077},{sxXo,.096},H}; -N l29n23[]={{sZ7a,.524},H}; -N l29n26[]={{soyg,.201},{soxf3,.115},H}; -N l29n27[]={{sv7a79,.192},{smiq,.115},H}; -N l29n28[]={{siw7a,.153},H}; -N l29n29[]={{sgq,.403},{skh,.064},H}; -N l29n30[]={{sb3X,.268},{s_i,.141},H}; -N l29n33[]={{snihr,.153},H}; -N l29n34[]={{stv,.550},H}; -N l29n35[]={{srXg,.431},H}; -N l29n37[]={{sg7aX,.575},{sh79,.141},{ssx,.115},H}; -N l29n38[]={{smiks,.153},{smir,.115},H}; -N l29n39[]={{sg_g,.690},H}; -N l29n40[]={{smX,.332},{s_sg,.144},{sghp,.144},H}; -N l29n41[]={{s79Y,.077},{spig,.144},H}; -N l29n44[]={{sqm,.230},{sxg,.115},H}; -N l29n45[]={{svs,.371},H}; -N l29n46[]={{sgr,1.093},H}; -N l29n47[]={{s7a79g,.230},{sxf3,.102},{snmg,.173},{sXt,.077},H}; -N l29n53[]={{s7air,.115},H}; -N l29n54[]={{sgtv,.978},{sh7a,.320},{sbfig,.518},{skvX,.115},H}; -N l29n55[]={{s7aX,.447},{siksg,.728},{sgvs,.201},H}; -N l29n56[]={{sksg,.546},{seah7a,.259},H}; -N l29n57[]={{sgmg,.546},H}; -N l29n58[]={{s79Z,.243},{sXog,.173},{s_Xg,.144},H}; -N l29n60[]={{sq79,.115},{shg,.096},H}; -N l29n61[]={{sYs,.102},H}; -N l29n63[]={{svX,.435},{sgs,.498},{sv7ai,.326},H}; -N l29n65[]={{smea,.268},{sgni,.403},{sbfg,.230},H}; -N l29n66[]={{sXpi,.115},H}; -N l29n68[]={{s79qg,.316},H}; -N l29n69[]={{sin,.396},{sZlg,.546},{somi,.307},H}; -N l29n70[]={{sgbfig,.383},{syo,.077},{s79wx,.096},H}; -N l29n71[]={{snX,.179},{sY79g,.230},H}; -N l29n72[]={{sw7aZ,.230},{ssk,.128},{sgqX,.173},H}; -N l29n73[]={{sghs,.546},{ss_w,.115},H}; -N l29n74[]={{smZ,.179},{sg_m,.316},{s79w,.141},{sZ7a79,.134},{s_w7a,.096},H}; -N l29n75[]={{srm,1.201},{syg,.594},{s79h,.077},H}; -N l29n77[]={{stvX,.249},{sZmi,.134},H}; -N l29n78[]={{somg,.230},H}; -N l29n79[]={{sYX,.077},H}; -N l29n80[]={{sgt,1.821},H}; -N l29n81[]={{sXv,.217},{sgX,.230},{srXn,.134},H}; -N l29n82[]={{sXZ,.230},{smiv,.115},{srmy,.115},H}; -N l29n83[]={{sqg,.709},{sgwt,.173},H}; -N l29n84[]={{sos,.332},{sf3_,.431},{swmeag,.268},H}; -N l29n85[]={{si7a,.166},H}; -N l29n86[]={{sio,.166},{sgnXo,.268},{sqf3,.077},H}; -N l29n88[]={{ss_,.409},H}; -N l29n89[]={{sgrX,.891},{s7aZ,.166},{sgxs,.288},{sgtvX,.307},H}; -N l29n90[]={{smw,.141},{sg7ag,.288},{sming,.307},H}; -N l29n91[]={{sig,1.553},{sr79,.192},{s79x,.077},H}; -N l29n92[]={{svX_,.153},{sgtsq,.230},{skb3,.077},H}; -N l29n93[]={{swt,.089},{sXom,.096},H}; -N l29n94[]={{sw7ai,.134},{sXwx,.096},H}; -N l29n96[]={{stv7a,.288},H}; -N l29n98[]={{s_m,.473},{sgY,.556},{sXw,.153},{spr,.128},H}; -N l29n99[]={{sXh,.141},H}; -N l29n101[]={{sgtvi,.268},H}; -N l29n102[]={{soX,.243},H}; -N l29n103[]={{sip,.192},H}; -N l29n106[]={{shr,.166},{sghv,.144},H}; -N l29n107[]={{sxs,.307},H}; -N l29n108[]={{smi,1.393},{sb3sg,.388},{sZir,.096},H}; -N l29n109[]={{spmg,.288},{sgnih,.230},H}; -N l29n110[]={{sZ7ai,.364},{sXbf,.102},{sXpm,.115},H}; -N l29n112[]={{sxiq,.134},{soxf3v,.153},{s7airm,.128},H}; -N l29n113[]={{svw,.064},H}; -N l29n114[]={{s_79,.243},{sgv,.307},{sb3y,.134},{skm,.089},H}; -N l29n115[]={{sgZ,.345},{sXx,.128},{sqf3_,.096},{shpX,.096},H}; -N l29n116[]={{srik,.153},H}; -N l29n117[]={{sgsY,.173},H}; -N l29n118[]={{seag,.949},{srmX,.192},{ssYm,.096},H}; -N l29n120[]={{siq,.320},H}; -N l29n121[]={{stvi,.153},{syr,.077},{sg_mi,.192},H}; -N l29n122[]={{somik,.128},H}; -N l29n123[]={{s7ai,.626},{shs,.358},{sgtX,.259},H}; -N l29n124[]={{smy,.089},{sniw,.096},H}; -N l29n125[]={{sxX,.332},H}; -N l29n126[]={{sb3Xg,.216},H}; -N l29n127[]={{sgwx,.230},H}; -N l29n128[]={{svXZ,.134},H}; -N l29n130[]={{smeaZ,.115},H}; -N l29n131[]={{sgw,.959},{svi,.243},{ss_X,.230},{sqmi,.134},H}; -N l29n132[]={{sgh,.786},H}; -N l29n133[]={{sirx,.192},{spX,.102},{sh79g,.144},H}; -N l29n135[]={{ssb6,.089},{swxv,.134},{sov,.077},H}; -N l29n136[]={{smXg,.288},{smZ7a,.134},H}; -N l29n137[]={{s_g,.652},{sir,.409},{stm,.166},H}; -N l29n138[]={{s79b3,.115},{sZnm,.096},H}; -N l29n139[]={{sni,.230},{swom,.192},{shir,.115},{ss7a,.077},{s7ay,.077},H}; -N l29n140[]={{sso,.153},{srmZ,.115},H}; -N l29n141[]={{shX,.115},H}; -N l29n143[]={{sb1g,.345},{stv7ai,.281},{sgbf,.211},H}; -N l29n144[]={{sXrm,.364},H}; -N l29n145[]={{ssg,1.572},H}; -N l29n146[]={{sqs,.077},{sbfX,.115},H}; -N l29n147[]={{svy,.115},{sYi,.089},H}; -N l29n148[]={{sgx,.709},{s_Xr,.115},H}; -N l29n149[]={{srin,.230},{sgY79,.316},H}; -N l29n151[]={{s7aZ7a,.211},{s7aXg,.201},{sgrXn,.230},H}; -N l29n152[]={{sY79b3,.173},H}; -N l29n153[]={{sihr,.134},H}; -N l29n154[]={{smb3,.077},H}; -N l29n155[]={{sny,.077},H}; -N l29n156[]={{sr79Z,.096},H}; -N l29n157[]={{ssp,.166},{sgkv,.201},H}; -N l29n158[]={{sxv,.166},{stsq,.115},H}; -N l29n161[]={{swx,.498},{smeag,.259},H}; -N l29n162[]={{srmi,.728},{sXb3,.243},H}; -N l29n164[]={{sgtv7a,.575},{sqX,.166},H}; -N l29n165[]={{sing,.834},{sgy,.230},{s_wo,.134},{sXpr,.115},H}; -N l29n166[]={{sX_,.243},H}; -N l29n169[]={{sghsg,.575},{sox,.102},H}; -N l29n171[]={{srmg,.259},H}; -N l29n173[]={{sZmig,.230},H}; -N l29n174[]={{ssq,.192},{shv,.102},{sgY79b3,.268},{sqf3_m,.128},H}; -N l29n177[]={{sgrm,.661},{srs,.141},{sgZ7a,.230},{sXf1w,.096},H}; -N l29n178[]={{s79Zl,.268},{sZi,.153},{stvX_,.204},{srmyg,.230},H}; -N l29n180[]={{sf3_g,.518},{sosg,.201},H}; -N l29n182[]={{sw7aZ7a,.281},{sb379,.153},H}; -N l29n183[]={{sgk,.326},H}; -N l29n184[]={{slg,.364},H}; -N l29n185[]={{sh7am,.326},{s_mi,.288},{sgrXg,.422},{sgxsg,.383},{spri,.115},{sgYi,.144},H}; -N l29n186[]={{soy,.141},{swomi,.179},H}; -N l29n187[]={{stXr,.153},{sr79g,.201},H}; -N l29n190[]={{swx_,.115},H}; -N l29n191[]={{s7am,.230},{ssr,.204},{sgxX,.230},H}; -N l29n192[]={{sXf1,.089},{sgos,.201},H}; -N l29n193[]={{sxi,.256},{sgw7a,.288},{sriks,.204},H}; -N l29n195[]={{srX,.562},H}; -N l29n196[]={{sgwmea,.268},H}; -N l29n198[]={{s7aZ7ai,.204},{soXg,.201},H}; -N l29n199[]={{sg_,1.227},{s79g,.978},{sgx79,.259},H}; -N l29n200[]={{s_s,.141},H}; -N l29n201[]={{spi,.256},{sXn,.128},H}; -N l29n203[]={{sxsg,.374},H}; -N l29n204[]={{smig,1.237},{swxX,.134},H}; -N l29n205[]={{sb3g,.518},{siv,.179},H}; -N l29n206[]={{siZ,.179},{syw,.115},H}; -N l29n207[]={{s7a79,.383},{syh,.128},{snm,.077},H}; -N l29n208[]={{sgoxf3,.230},{swb3,.077},H}; -N l29n209[]={{shi,.166},{sxy,.089},{sZ7ar,.115},H}; -N l29n210[]={{sf1w,.230},{smo,.077},H}; -N l29n214[]={{sbfi,.268},{srmXg,.307},H}; -N l29n215[]={{smg,1.246},{siks,.364},{sv79,.089},{sYm,.089},{snih,.115},H}; -N l29n216[]={{sks,.294},{siqg,.489},H}; -N l29n217[]={{sgm,.460},{smik,.134},{spy,.089},H}; -N l29n218[]={{s_X,.358},{sXo,.230},{sybf,.089},{siwx,.115},H}; -N l29n219[]={{shsg,.431},{s7aig,.259},{ss_m,.115},H}; -N l29n220[]={{smyg,.201},H}; -N l29n221[]={{sxXg,.173},H}; -N l29n222[]={{siw,.204},H}; -N l29n223[]={{sXg,1.553},{sih,.166},H}; -N l29n224[]={{sgrmi,.767},{snXo,.134},{s_wom,.153},H}; -N l29n227[]={{smp,.077},H}; -N l29n228[]={{s79q,.166},{srmo,.096},H}; -N l29n229[]={{sZl,.371},H}; -N l29n230[]={{s7ag,.326},{sgbfi,.288},{swm,.115},H}; -N l29n231[]={{sY79,.256},{shirx,.153},H}; -N l29n232[]={{sv7a,.447},{sh7ami,.383},H}; -N l29n233[]={{seaZ,.173},H}; -N l29n234[]={{sgn,.575},{skX,.102},{sibf,.077},H}; -N l29n235[]={{sXp,.256},{sgxi,.201},H}; -N l29n237[]={{shrm,.134},H}; -N l29n238[]={{som,.383},{svg,.096},H}; -N l29n239[]={{sts,.511},{six,.089},H}; -N l29n243[]={{ssY,.153},{sx_,.115},H}; -N l29n244[]={{swmea,.134},H}; -N l29n245[]={{sring,.460},H}; -N l29n246[]={{sng,.594},{sZm,.268},{srh,.077},{sw79,.077},H}; -N l29n247[]={{sgox,.201},H}; -N l29n250[]={{sg7a,.844},{sWg,.647},{sg_79,.345},{smin,.192},{seah,.201},H}; -N l29n251[]={{sgo,.556},H}; -N l29n252[]={{sXq,.179},H}; -N l29n255[]={{sf3v,.173},H}; - -D l29_d = -{ +S sZ7a[] = { 99, z, 0 }; +S ss_[] = { o, w, 0 }; +S sh7a[] = { d, z, 0 }; +S sg_g[] = { 32, w, a }; +S smea[] = { i, 234, 0 }; +S s79Z[] = { y, 99, 0 }; +S s_79[] = { w, y, 0 }; +S sZ7ai[] = { 99, z, e, 0 }; +S siksg[] = { e, g, o, a }; +S sX_[] = { 97, w, 0 }; +S sXb3[] = { 97, 179, 0 }; +S siks[] = { e, g, o, 0 }; +S sb3s[] = { 179, o, 0 }; +S sh7am[] = { d, z, i, 0 }; +S sv7ai[] = { r, z, e, 0 }; +S somi[] = { k, i, e, 0 }; +S s7ami[] = { z, i, e, 0 }; +S sf3_[] = { 243, w, 0 }; +S s_mi[] = { w, i, e, 0 }; +S sgtv7a[] = { 32, p, r, z, 0 }; +S sh7ami[] = { d, z, i, e, 0 }; +S sghsg[] = { 32, d, o, a }; +S stv7a[] = { p, r, z, 0 }; +S sbfi[] = { 191, e, 0 }; +S sb3X[] = { 179, 97, 0 }; +S s79Zl[] = { y, 99, h, 0 }; +S s7aZ[] = { z, 99, 0 }; +S s79q[] = { y, m, 0 }; +S s_w[] = { w, s, 0 }; +S s79Zlg[] = { y, 99, h, a }; +S sbfig[] = { 191, e, a }; +S sring[] = { n, e, j, a }; +S ss_X[] = { o, w, 97, 0 }; +S srin[] = { n, e, j, 0 }; +S sw7aZ[] = { s, z, 99, 0 }; +S sg_79[] = { 32, w, y, 0 }; +S sw7aZ7a[] = { s, z, 99, z, 0 }; +S s79qg[] = { y, m, a }; +S s7aZ7a[] = { z, 99, z, 0 }; +S stv7ai[] = { p, r, z, e, 0 }; +S sgbfi[] = { 32, 191, e, 0 }; +S sgbfig[] = { 32, 191, e, a }; +S swom[] = { s, k, i, 0 }; +S srmX[] = { n, i, 97, 0 }; +S smin[] = { i, e, j, 0 }; +S sv7a79[] = { r, z, y, 0 }; +S sXb3g[] = { 97, 179, a }; +S sgx79[] = { 32, t, y, 0 }; +S sx_[] = { t, w, 0 }; +S s79b3[] = { y, 179, 0 }; +S smeag[] = { i, 234, a }; +S sY79b3[] = { 98, y, 179, 0 }; +S sb3sg[] = { 179, o, a }; +S sming[] = { i, e, j, a }; +S stvX_[] = { p, r, 97, w, 0 }; +S sgtvX[] = { 32, p, r, 97, 0 }; +S stXr[] = { p, 97, n, 0 }; +S sf3_g[] = { 243, w, a }; +S srmXg[] = { n, i, 97, a }; +S svX_[] = { r, 97, w, 0 }; +S sXbf[] = { 97, 191, 0 }; +S sb379[] = { 179, y, 0 }; +S sriks[] = { n, e, g, o, 0 }; +S s7a79g[] = { z, y, a }; +S sgZ7a[] = { 32, 99, z, 0 }; +S sf1w[] = { 241, s, 0 }; +S srik[] = { n, e, g, 0 }; +S s7aZ7ai[] = { z, 99, z, e, 0 }; +S swmeag[] = { s, i, 234, a }; +S smik[] = { i, e, g, 0 }; +S swmea[] = { s, i, 234, 0 }; +S sgwmea[] = { 32, s, i, 234, 0 }; +S sXf1[] = { 97, 241, 0 }; +S snXo[] = { j, 97, k, 0 }; +S smy[] = { i, u, 0 }; +S sZ7a79[] = { 99, z, y, 0 }; +S swomi[] = { s, k, i, e, 0 }; +S sgnXo[] = { 32, j, 97, k, 0 }; +S sybf[] = { u, 191, 0 }; +S sgox[] = { 32, k, t, 0 }; +S ssb6[] = { o, 182, 0 }; +S smyg[] = { i, u, a }; +S smZ7a[] = { i, 99, z, 0 }; +S smip[] = { i, e, l, 0 }; +S sqmi[] = { m, i, e, 0 }; +S sb3y[] = { 179, u, 0 }; +S sihr[] = { e, d, n, 0 }; +S sgY79b3[] = { 32, 98, y, 179, 0 }; +S shrm[] = { d, n, i, 0 }; +S seah[] = { 234, d, 0 }; +S srXn[] = { n, 97, j, 0 }; +S s_wo[] = { w, s, k, 0 }; +S smiq[] = { i, e, m, 0 }; +S smiks[] = { i, e, g, o, 0 }; +S srmyg[] = { n, i, u, a }; +S sxf3v[] = { t, 243, r, 0 }; +S sf3v[] = { 243, r, 0 }; +S s_Xr[] = { w, 97, n, 0 }; +S sZ7ar[] = { 99, z, n, 0 }; +S syw7a[] = { u, s, z, 0 }; +S ss_m[] = { o, w, i, 0 }; +S seah7a[] = { 234, d, z, 0 }; +S smeaZ[] = { i, 234, 99, 0 }; +S s_wom[] = { w, s, k, i, 0 }; +S sZmig[] = { 99, i, e, a }; +S seaZ[] = { 234, 99, 0 }; +S smb3[] = { i, 179, 0 }; +S ss_w[] = { o, w, s, 0 }; +S sibf[] = { e, 191, 0 }; +S spri[] = { l, n, e, 0 }; +S snihr[] = { j, e, d, n, 0 }; +S soxf3[] = { k, t, 243, 0 }; +S sgnih[] = { 32, j, e, d, 0 }; +S sgoxf3[] = { 32, k, t, 243, 0 }; +S sgrXn[] = { 32, n, 97, j, 0 }; +S soxf3v[] = { k, t, 243, r, 0 }; +S sgtsq[] = { 32, p, o, m, 0 }; +S skb3[] = { g, 179, 0 }; +S sbfX[] = { 191, 97, 0 }; +S swb3[] = { s, 179, 0 }; +S sb1h[] = { 177, d, 0 }; +S srmZ[] = { n, i, 99, 0 }; +S srmy[] = { n, i, u, 0 }; +S sqf3[] = { m, 243, 0 }; +S s79Y[] = { y, 98, 0 }; +S stsq[] = { p, o, m, 0 }; +S sXpr[] = { 97, l, n, 0 }; +S swx_[] = { s, t, w, 0 }; +S ssYm[] = { o, 98, i, 0 }; +S sqf3_m[] = { m, 243, w, i, 0 }; +S s_w7a[] = { w, s, z, 0 }; +S srmo[] = { n, i, k, 0 }; +S sXom[] = { 97, k, i, 0 }; +S somik[] = { k, i, e, g, 0 }; +S sb3Xg[] = { 179, 97, a }; +S s_sg[] = { w, o, a }; +S sZnm[] = { 99, j, i, 0 }; +S s7airm[] = { z, e, n, i, 0 }; +S sqf3_[] = { m, 243, w, 0 }; +S s79wx[] = { y, s, t, 0 }; +S sr79Z[] = { n, y, 99, 0 }; +S shpX[] = { d, l, 97, 0 }; +S skh[] = { g, d, 0 }; +S sZir[] = { 99, e, n, 0 }; +S sXf1w[] = { 97, 241, s, 0 }; +S sghp[] = { 32, d, l, 0 }; +S sg_mi[] = { 32, w, i, e, 0 }; +S s_Xg[] = { w, 97, a }; + +N l29n1[] = { { stX, .166 }, H }; +N l29n2[] = { { srmig, .959 }, { sXb3g, .259 }, H }; +N l29n3[] = { { ssv, .256 }, H }; +N l29n4[] = { { ssZ, .089 }, H }; +N l29n5[] = { { smr, .115 }, H }; +N l29n6[] = { { srx, .128 }, { sgwm, .230 }, H }; +N l29n7[] = { { sw7a, .537 }, { sri, .345 }, { sZn, .128 }, H }; +N l29n8[] = { { swo, .243 }, H }; +N l29n11[] = { { skv, .141 }, H }; +N l29n12[] = { { sb3s, .345 }, { sirm, .268 }, { sgp, .268 }, { s_w, .166 }, { syw7a, .115 }, H }; +N l29n13[] = { { sXr, .447 }, { spm, .320 }, H }; +N l29n16[] = { { smip, .134 }, H }; +N l29n17[] = { { srsg, .201 }, H }; +N l29n18[] = { { sik, .358 }, { s79Zlg, .498 }, H }; +N l29n19[] = { { sb1h, .115 }, H }; +N l29n20[] = { { s7ar, .153 }, { ssw, .128 }, H }; +N l29n21[] = { { sgts, 1.064 }, { sx79, .217 }, { ssh, .166 }, { sog, .249 }, { sgnX, .288 }, { sxf3v, .115 }, H }; +N l29n22[] = { { s7ami, .307 }, { sms, .077 }, { sxXo, .096 }, H }; +N l29n23[] = { { sZ7a, .524 }, H }; +N l29n26[] = { { soyg, .201 }, { soxf3, .115 }, H }; +N l29n27[] = { { sv7a79, .192 }, { smiq, .115 }, H }; +N l29n28[] = { { siw7a, .153 }, H }; +N l29n29[] = { { sgq, .403 }, { skh, .064 }, H }; +N l29n30[] = { { sb3X, .268 }, { s_i, .141 }, H }; +N l29n33[] = { { snihr, .153 }, H }; +N l29n34[] = { { stv, .550 }, H }; +N l29n35[] = { { srXg, .431 }, H }; +N l29n37[] = { { sg7aX, .575 }, { sh79, .141 }, { ssx, .115 }, H }; +N l29n38[] = { { smiks, .153 }, { smir, .115 }, H }; +N l29n39[] = { { sg_g, .690 }, H }; +N l29n40[] = { { smX, .332 }, { s_sg, .144 }, { sghp, .144 }, H }; +N l29n41[] = { { s79Y, .077 }, { spig, .144 }, H }; +N l29n44[] = { { sqm, .230 }, { sxg, .115 }, H }; +N l29n45[] = { { svs, .371 }, H }; +N l29n46[] = { { sgr, 1.093 }, H }; +N l29n47[] = { { s7a79g, .230 }, { sxf3, .102 }, { snmg, .173 }, { sXt, .077 }, H }; +N l29n53[] = { { s7air, .115 }, H }; +N l29n54[] = { { sgtv, .978 }, { sh7a, .320 }, { sbfig, .518 }, { skvX, .115 }, H }; +N l29n55[] = { { s7aX, .447 }, { siksg, .728 }, { sgvs, .201 }, H }; +N l29n56[] = { { sksg, .546 }, { seah7a, .259 }, H }; +N l29n57[] = { { sgmg, .546 }, H }; +N l29n58[] = { { s79Z, .243 }, { sXog, .173 }, { s_Xg, .144 }, H }; +N l29n60[] = { { sq79, .115 }, { shg, .096 }, H }; +N l29n61[] = { { sYs, .102 }, H }; +N l29n63[] = { { svX, .435 }, { sgs, .498 }, { sv7ai, .326 }, H }; +N l29n65[] = { { smea, .268 }, { sgni, .403 }, { sbfg, .230 }, H }; +N l29n66[] = { { sXpi, .115 }, H }; +N l29n68[] = { { s79qg, .316 }, H }; +N l29n69[] = { { sin, .396 }, { sZlg, .546 }, { somi, .307 }, H }; +N l29n70[] = { { sgbfig, .383 }, { syo, .077 }, { s79wx, .096 }, H }; +N l29n71[] = { { snX, .179 }, { sY79g, .230 }, H }; +N l29n72[] = { { sw7aZ, .230 }, { ssk, .128 }, { sgqX, .173 }, H }; +N l29n73[] = { { sghs, .546 }, { ss_w, .115 }, H }; +N l29n74[] = { { smZ, .179 }, { sg_m, .316 }, { s79w, .141 }, { sZ7a79, .134 }, { s_w7a, .096 }, H }; +N l29n75[] = { { srm, 1.201 }, { syg, .594 }, { s79h, .077 }, H }; +N l29n77[] = { { stvX, .249 }, { sZmi, .134 }, H }; +N l29n78[] = { { somg, .230 }, H }; +N l29n79[] = { { sYX, .077 }, H }; +N l29n80[] = { { sgt, 1.821 }, H }; +N l29n81[] = { { sXv, .217 }, { sgX, .230 }, { srXn, .134 }, H }; +N l29n82[] = { { sXZ, .230 }, { smiv, .115 }, { srmy, .115 }, H }; +N l29n83[] = { { sqg, .709 }, { sgwt, .173 }, H }; +N l29n84[] = { { sos, .332 }, { sf3_, .431 }, { swmeag, .268 }, H }; +N l29n85[] = { { si7a, .166 }, H }; +N l29n86[] = { { sio, .166 }, { sgnXo, .268 }, { sqf3, .077 }, H }; +N l29n88[] = { { ss_, .409 }, H }; +N l29n89[] = { { sgrX, .891 }, { s7aZ, .166 }, { sgxs, .288 }, { sgtvX, .307 }, H }; +N l29n90[] = { { smw, .141 }, { sg7ag, .288 }, { sming, .307 }, H }; +N l29n91[] = { { sig, 1.553 }, { sr79, .192 }, { s79x, .077 }, H }; +N l29n92[] = { { svX_, .153 }, { sgtsq, .230 }, { skb3, .077 }, H }; +N l29n93[] = { { swt, .089 }, { sXom, .096 }, H }; +N l29n94[] = { { sw7ai, .134 }, { sXwx, .096 }, H }; +N l29n96[] = { { stv7a, .288 }, H }; +N l29n98[] = { { s_m, .473 }, { sgY, .556 }, { sXw, .153 }, { spr, .128 }, H }; +N l29n99[] = { { sXh, .141 }, H }; +N l29n101[] = { { sgtvi, .268 }, H }; +N l29n102[] = { { soX, .243 }, H }; +N l29n103[] = { { sip, .192 }, H }; +N l29n106[] = { { shr, .166 }, { sghv, .144 }, H }; +N l29n107[] = { { sxs, .307 }, H }; +N l29n108[] = { { smi, 1.393 }, { sb3sg, .388 }, { sZir, .096 }, H }; +N l29n109[] = { { spmg, .288 }, { sgnih, .230 }, H }; +N l29n110[] = { { sZ7ai, .364 }, { sXbf, .102 }, { sXpm, .115 }, H }; +N l29n112[] = { { sxiq, .134 }, { soxf3v, .153 }, { s7airm, .128 }, H }; +N l29n113[] = { { svw, .064 }, H }; +N l29n114[] = { { s_79, .243 }, { sgv, .307 }, { sb3y, .134 }, { skm, .089 }, H }; +N l29n115[] = { { sgZ, .345 }, { sXx, .128 }, { sqf3_, .096 }, { shpX, .096 }, H }; +N l29n116[] = { { srik, .153 }, H }; +N l29n117[] = { { sgsY, .173 }, H }; +N l29n118[] = { { seag, .949 }, { srmX, .192 }, { ssYm, .096 }, H }; +N l29n120[] = { { siq, .320 }, H }; +N l29n121[] = { { stvi, .153 }, { syr, .077 }, { sg_mi, .192 }, H }; +N l29n122[] = { { somik, .128 }, H }; +N l29n123[] = { { s7ai, .626 }, { shs, .358 }, { sgtX, .259 }, H }; +N l29n124[] = { { smy, .089 }, { sniw, .096 }, H }; +N l29n125[] = { { sxX, .332 }, H }; +N l29n126[] = { { sb3Xg, .216 }, H }; +N l29n127[] = { { sgwx, .230 }, H }; +N l29n128[] = { { svXZ, .134 }, H }; +N l29n130[] = { { smeaZ, .115 }, H }; +N l29n131[] = { { sgw, .959 }, { svi, .243 }, { ss_X, .230 }, { sqmi, .134 }, H }; +N l29n132[] = { { sgh, .786 }, H }; +N l29n133[] = { { sirx, .192 }, { spX, .102 }, { sh79g, .144 }, H }; +N l29n135[] = { { ssb6, .089 }, { swxv, .134 }, { sov, .077 }, H }; +N l29n136[] = { { smXg, .288 }, { smZ7a, .134 }, H }; +N l29n137[] = { { s_g, .652 }, { sir, .409 }, { stm, .166 }, H }; +N l29n138[] = { { s79b3, .115 }, { sZnm, .096 }, H }; +N l29n139[] = { { sni, .230 }, { swom, .192 }, { shir, .115 }, { ss7a, .077 }, { s7ay, .077 }, H }; +N l29n140[] = { { sso, .153 }, { srmZ, .115 }, H }; +N l29n141[] = { { shX, .115 }, H }; +N l29n143[] = { { sb1g, .345 }, { stv7ai, .281 }, { sgbf, .211 }, H }; +N l29n144[] = { { sXrm, .364 }, H }; +N l29n145[] = { { ssg, 1.572 }, H }; +N l29n146[] = { { sqs, .077 }, { sbfX, .115 }, H }; +N l29n147[] = { { svy, .115 }, { sYi, .089 }, H }; +N l29n148[] = { { sgx, .709 }, { s_Xr, .115 }, H }; +N l29n149[] = { { srin, .230 }, { sgY79, .316 }, H }; +N l29n151[] = { { s7aZ7a, .211 }, { s7aXg, .201 }, { sgrXn, .230 }, H }; +N l29n152[] = { { sY79b3, .173 }, H }; +N l29n153[] = { { sihr, .134 }, H }; +N l29n154[] = { { smb3, .077 }, H }; +N l29n155[] = { { sny, .077 }, H }; +N l29n156[] = { { sr79Z, .096 }, H }; +N l29n157[] = { { ssp, .166 }, { sgkv, .201 }, H }; +N l29n158[] = { { sxv, .166 }, { stsq, .115 }, H }; +N l29n161[] = { { swx, .498 }, { smeag, .259 }, H }; +N l29n162[] = { { srmi, .728 }, { sXb3, .243 }, H }; +N l29n164[] = { { sgtv7a, .575 }, { sqX, .166 }, H }; +N l29n165[] = { { sing, .834 }, { sgy, .230 }, { s_wo, .134 }, { sXpr, .115 }, H }; +N l29n166[] = { { sX_, .243 }, H }; +N l29n169[] = { { sghsg, .575 }, { sox, .102 }, H }; +N l29n171[] = { { srmg, .259 }, H }; +N l29n173[] = { { sZmig, .230 }, H }; +N l29n174[] = { { ssq, .192 }, { shv, .102 }, { sgY79b3, .268 }, { sqf3_m, .128 }, H }; +N l29n177[] = { { sgrm, .661 }, { srs, .141 }, { sgZ7a, .230 }, { sXf1w, .096 }, H }; +N l29n178[] = { { s79Zl, .268 }, { sZi, .153 }, { stvX_, .204 }, { srmyg, .230 }, H }; +N l29n180[] = { { sf3_g, .518 }, { sosg, .201 }, H }; +N l29n182[] = { { sw7aZ7a, .281 }, { sb379, .153 }, H }; +N l29n183[] = { { sgk, .326 }, H }; +N l29n184[] = { { slg, .364 }, H }; +N l29n185[] = { { sh7am, .326 }, { s_mi, .288 }, { sgrXg, .422 }, { sgxsg, .383 }, { spri, .115 }, { sgYi, .144 }, H }; +N l29n186[] = { { soy, .141 }, { swomi, .179 }, H }; +N l29n187[] = { { stXr, .153 }, { sr79g, .201 }, H }; +N l29n190[] = { { swx_, .115 }, H }; +N l29n191[] = { { s7am, .230 }, { ssr, .204 }, { sgxX, .230 }, H }; +N l29n192[] = { { sXf1, .089 }, { sgos, .201 }, H }; +N l29n193[] = { { sxi, .256 }, { sgw7a, .288 }, { sriks, .204 }, H }; +N l29n195[] = { { srX, .562 }, H }; +N l29n196[] = { { sgwmea, .268 }, H }; +N l29n198[] = { { s7aZ7ai, .204 }, { soXg, .201 }, H }; +N l29n199[] = { { sg_, 1.227 }, { s79g, .978 }, { sgx79, .259 }, H }; +N l29n200[] = { { s_s, .141 }, H }; +N l29n201[] = { { spi, .256 }, { sXn, .128 }, H }; +N l29n203[] = { { sxsg, .374 }, H }; +N l29n204[] = { { smig, 1.237 }, { swxX, .134 }, H }; +N l29n205[] = { { sb3g, .518 }, { siv, .179 }, H }; +N l29n206[] = { { siZ, .179 }, { syw, .115 }, H }; +N l29n207[] = { { s7a79, .383 }, { syh, .128 }, { snm, .077 }, H }; +N l29n208[] = { { sgoxf3, .230 }, { swb3, .077 }, H }; +N l29n209[] = { { shi, .166 }, { sxy, .089 }, { sZ7ar, .115 }, H }; +N l29n210[] = { { sf1w, .230 }, { smo, .077 }, H }; +N l29n214[] = { { sbfi, .268 }, { srmXg, .307 }, H }; +N l29n215[] = { { smg, 1.246 }, { siks, .364 }, { sv79, .089 }, { sYm, .089 }, { snih, .115 }, H }; +N l29n216[] = { { sks, .294 }, { siqg, .489 }, H }; +N l29n217[] = { { sgm, .460 }, { smik, .134 }, { spy, .089 }, H }; +N l29n218[] = { { s_X, .358 }, { sXo, .230 }, { sybf, .089 }, { siwx, .115 }, H }; +N l29n219[] = { { shsg, .431 }, { s7aig, .259 }, { ss_m, .115 }, H }; +N l29n220[] = { { smyg, .201 }, H }; +N l29n221[] = { { sxXg, .173 }, H }; +N l29n222[] = { { siw, .204 }, H }; +N l29n223[] = { { sXg, 1.553 }, { sih, .166 }, H }; +N l29n224[] = { { sgrmi, .767 }, { snXo, .134 }, { s_wom, .153 }, H }; +N l29n227[] = { { smp, .077 }, H }; +N l29n228[] = { { s79q, .166 }, { srmo, .096 }, H }; +N l29n229[] = { { sZl, .371 }, H }; +N l29n230[] = { { s7ag, .326 }, { sgbfi, .288 }, { swm, .115 }, H }; +N l29n231[] = { { sY79, .256 }, { shirx, .153 }, H }; +N l29n232[] = { { sv7a, .447 }, { sh7ami, .383 }, H }; +N l29n233[] = { { seaZ, .173 }, H }; +N l29n234[] = { { sgn, .575 }, { skX, .102 }, { sibf, .077 }, H }; +N l29n235[] = { { sXp, .256 }, { sgxi, .201 }, H }; +N l29n237[] = { { shrm, .134 }, H }; +N l29n238[] = { { som, .383 }, { svg, .096 }, H }; +N l29n239[] = { { sts, .511 }, { six, .089 }, H }; +N l29n243[] = { { ssY, .153 }, { sx_, .115 }, H }; +N l29n244[] = { { swmea, .134 }, H }; +N l29n245[] = { { sring, .460 }, H }; +N l29n246[] = { { sng, .594 }, { sZm, .268 }, { srh, .077 }, { sw79, .077 }, H }; +N l29n247[] = { { sgox, .201 }, H }; +N l29n250[] = { { sg7a, .844 }, { sWg, .647 }, { sg_79, .345 }, { smin, .192 }, { seah, .201 }, H }; +N l29n251[] = { { sgo, .556 }, H }; +N l29n252[] = { { sXq, .179 }, H }; +N l29n255[] = { { sf3v, .173 }, H }; + +D l29_d = { "polish", "iso-8859-15", - { - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,0.001, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,0.168,0.033,0.072,0.067,0.174,0.007,0.037,0.016,0.167,0.047,0.067,0.047,0.054,0.120,0.145, - 0.067,W,0.088,0.079,0.075,0.051,W,0.089,W,0.078,0.113,W,W,W,W,W, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - Y,Y,Y,0.001,Y,Y,0.002,Y,Y,Y,Y,Y,Y,Y,Y,0.001, - Y,0.021,Y,0.058,Y,Y,0.016,Y,Y,Y,Y,Y,0.001,Y,Y,0.031, - Y,V,V,V,V,V,0.001,V,V,V,V,V,V,V,V,V, - V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V, - V,V,V,V,V,V,0.017,V,V,V,0.052,V,V,V,V,V, - V,0.015,V,0.032,V,V,V,V,V,V,V,V,V,V,V,V - }, - { - X,l29n1,l29n2,l29n3,l29n4,l29n5,l29n6,l29n7,l29n8,X,X,l29n11,l29n12,l29n13,X,X, - l29n16,l29n17,l29n18,l29n19,l29n20,l29n21,l29n22,l29n23,X,X,l29n26,l29n27,l29n28,l29n29,l29n30,X, - X,l29n33,l29n34,l29n35,X,l29n37,l29n38,l29n39,l29n40,l29n41,X,X,l29n44,l29n45,l29n46,l29n47, - X,X,X,X,X,l29n53,l29n54,l29n55,l29n56,l29n57,l29n58,X,l29n60,l29n61,X,l29n63, - X,l29n65,l29n66,X,l29n68,l29n69,l29n70,l29n71,l29n72,l29n73,l29n74,l29n75,X,l29n77,l29n78,l29n79, - l29n80,l29n81,l29n82,l29n83,l29n84,l29n85,l29n86,X,l29n88,l29n89,l29n90,l29n91,l29n92,l29n93,l29n94,X, - l29n96,X,l29n98,l29n99,X,l29n101,l29n102,l29n103,X,X,l29n106,l29n107,l29n108,l29n109,l29n110,X, - l29n112,l29n113,l29n114,l29n115,l29n116,l29n117,l29n118,X,l29n120,l29n121,l29n122,l29n123,l29n124,l29n125,l29n126,l29n127, - l29n128,X,l29n130,l29n131,l29n132,l29n133,X,l29n135,l29n136,l29n137,l29n138,l29n139,l29n140,l29n141,X,l29n143, - l29n144,l29n145,l29n146,l29n147,l29n148,l29n149,X,l29n151,l29n152,l29n153,l29n154,l29n155,l29n156,l29n157,l29n158,X, - X,l29n161,l29n162,X,l29n164,l29n165,l29n166,X,X,l29n169,X,l29n171,X,l29n173,l29n174,X, - X,l29n177,l29n178,X,l29n180,X,l29n182,l29n183,l29n184,l29n185,l29n186,l29n187,X,X,l29n190,l29n191, - l29n192,l29n193,X,l29n195,l29n196,X,l29n198,l29n199,l29n200,l29n201,X,l29n203,l29n204,l29n205,l29n206,l29n207, - l29n208,l29n209,l29n210,X,X,X,l29n214,l29n215,l29n216,l29n217,l29n218,l29n219,l29n220,l29n221,l29n222,l29n223, - l29n224,X,X,l29n227,l29n228,l29n229,l29n230,l29n231,l29n232,l29n233,l29n234,l29n235,X,l29n237,l29n238,l29n239, - X,X,X,l29n243,l29n244,l29n245,l29n246,l29n247,X,X,l29n250,l29n251,l29n252,X,X,l29n255 - } + { W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, 0.001, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, 0.168, 0.033, 0.072, 0.067, 0.174, 0.007, 0.037, 0.016, 0.167, 0.047, 0.067, 0.047, 0.054, 0.120, 0.145, + 0.067, W, 0.088, 0.079, 0.075, 0.051, W, 0.089, W, 0.078, 0.113, W, W, W, W, W, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + Y, Y, Y, 0.001, Y, Y, 0.002, Y, Y, Y, Y, Y, Y, Y, Y, 0.001, + Y, 0.021, Y, 0.058, Y, Y, 0.016, Y, Y, Y, Y, Y, 0.001, Y, Y, 0.031, + Y, V, V, V, V, V, 0.001, V, V, V, V, V, V, V, V, V, + V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, + V, V, V, V, V, V, 0.017, V, V, V, 0.052, V, V, V, V, V, + V, 0.015, V, 0.032, V, V, V, V, V, V, V, V, V, V, V, V }, + { X, l29n1, l29n2, l29n3, l29n4, l29n5, l29n6, l29n7, l29n8, X, X, l29n11, l29n12, l29n13, X, X, + l29n16, l29n17, l29n18, l29n19, l29n20, l29n21, l29n22, l29n23, X, X, l29n26, l29n27, l29n28, l29n29, l29n30, X, + X, l29n33, l29n34, l29n35, X, l29n37, l29n38, l29n39, l29n40, l29n41, X, X, l29n44, l29n45, l29n46, l29n47, + X, X, X, X, X, l29n53, l29n54, l29n55, l29n56, l29n57, l29n58, X, l29n60, l29n61, X, l29n63, + X, l29n65, l29n66, X, l29n68, l29n69, l29n70, l29n71, l29n72, l29n73, l29n74, l29n75, X, l29n77, l29n78, l29n79, + l29n80, l29n81, l29n82, l29n83, l29n84, l29n85, l29n86, X, l29n88, l29n89, l29n90, l29n91, l29n92, l29n93, l29n94, X, + l29n96, X, l29n98, l29n99, X, l29n101, l29n102, l29n103, X, X, l29n106, l29n107, l29n108, l29n109, l29n110, X, + l29n112, l29n113, l29n114, l29n115, l29n116, l29n117, l29n118, X, l29n120, l29n121, l29n122, l29n123, l29n124, l29n125, l29n126, l29n127, + l29n128, X, l29n130, l29n131, l29n132, l29n133, X, l29n135, l29n136, l29n137, l29n138, l29n139, l29n140, l29n141, X, l29n143, + l29n144, l29n145, l29n146, l29n147, l29n148, l29n149, X, l29n151, l29n152, l29n153, l29n154, l29n155, l29n156, l29n157, l29n158, X, + X, l29n161, l29n162, X, l29n164, l29n165, l29n166, X, X, l29n169, X, l29n171, X, l29n173, l29n174, X, + X, l29n177, l29n178, X, l29n180, X, l29n182, l29n183, l29n184, l29n185, l29n186, l29n187, X, X, l29n190, l29n191, + l29n192, l29n193, X, l29n195, l29n196, X, l29n198, l29n199, l29n200, l29n201, X, l29n203, l29n204, l29n205, l29n206, l29n207, + l29n208, l29n209, l29n210, X, X, X, l29n214, l29n215, l29n216, l29n217, l29n218, l29n219, l29n220, l29n221, l29n222, l29n223, + l29n224, X, X, l29n227, l29n228, l29n229, l29n230, l29n231, l29n232, l29n233, l29n234, l29n235, X, l29n237, l29n238, l29n239, + X, X, X, l29n243, l29n244, l29n245, l29n246, l29n247, X, X, l29n250, l29n251, l29n252, X, X, l29n255 } }; - - // // Lng: polish // Enc: utf8 // - -S sc2b3[]={194,179,0}; -S sc3aa[]={195,170,0}; -S sc2bf[]={194,191,0}; -S sXc2[]={97,194,0}; -S sc2b1[]={194,177,0}; -S sc3aag[]={195,170,a}; -S smc3aa[]={i,195,170,0}; -S sc2b6[]={194,182,0}; -S sXc2b3[]={97,194,179,0}; -S sc2b3s[]={194,179,o,0}; -S sc2b3g[]={194,179,a}; -S smc2[]={i,194,0}; -S sc3a6g[]={195,166,a}; -S sc3b3_[]={195,179,w,0}; -S sc3a6[]={195,166,0}; -S sb3_[]={179,w,0}; -S sc2b3X[]={194,179,97,0}; -S sc2bfi[]={194,191,e,0}; -S s79c2[]={y,194,0}; -S sc3b1[]={195,177,0}; -S ssc2[]={o,194,0}; -S sc2b1g[]={194,177,a}; -S sc2bfig[]={194,191,e,a}; -S sXc3[]={97,195,0}; -S syc2[]={u,194,0}; -S sgc2bf[]={32,194,191,0}; -S sic2[]={e,194,0}; -S s_Xc2[]={w,97,194,0}; -S swc2[]={s,194,0}; -S sgc2bfi[]={32,194,191,e,0}; -S sY79c2[]={98,y,194,0}; -S smc3aag[]={i,195,170,a}; -S sc2b3sg[]={194,179,o,a}; -S sY79c2b3[]={98,y,194,179,0}; -S sXc2b3g[]={97,194,179,a}; -S s79c2b3[]={y,194,179,0}; -S sxc3b3[]={t,195,179,0}; -S sb1w[]={177,s,0}; -S sXc2bf[]={97,194,191,0}; -S sgY79c2[]={32,98,y,194,0}; -S sc3b1w[]={195,177,s,0}; -S sc3b3_g[]={195,179,w,a}; -S sb3_g[]={179,w,a}; -S sc2b379[]={194,179,y,0}; -S sc2bfg[]={194,191,a}; -S swmc3[]={s,i,195,0}; -S sc3aah[]={195,170,d,0}; -S saah[]={170,d,0}; -S s7ac2[]={z,194,0}; -S syc2bf[]={u,194,191,0}; -S sgwmc3[]={32,s,i,195,0}; -S sXc3b1[]={97,195,177,0}; -S ssc2b6[]={o,194,182,0}; -S sc2b3y[]={194,179,u,0}; -S swmc3aa[]={s,i,195,170,0}; -S sc3aah7a[]={195,170,d,z,0}; -S soxc3b3[]={k,t,195,179,0}; -S saaZ[]={170,99,0}; -S sic2bf[]={e,194,191,0}; -S sgoxc3[]={32,k,t,195,0}; -S smc3aaZ[]={i,195,170,99,0}; -S sb3v[]={179,r,0}; -S s_mc2[]={w,i,194,0}; -S saah7a[]={170,d,z,0}; -S sc2b1h[]={194,177,d,0}; -S skc2[]={g,194,0}; -S sc2bfX[]={194,191,97,0}; -S sqc3b3[]={m,195,179,0}; -S smc2b3[]={i,194,179,0}; -S sc3aaZ[]={195,170,99,0}; -S swc2b3[]={s,194,179,0}; -S sic3[]={e,195,0}; -S s_mc3[]={w,i,195,0}; -S sc3b3v[]={195,179,r,0}; -S soxc3[]={k,t,195,0}; - -N l30n1[]={{stX,.155},H}; -N l30n2[]={{srmig,.896},H}; -N l30n3[]={{ssv,.239},{sc3a6g,.908},H}; -N l30n4[]={{ssZ,.084},H}; -N l30n5[]={{smr,.108},H}; -N l30n6[]={{srx,.120},{sgwm,.215},H}; -N l30n7[]={{sw7a,.502},{sri,.323},{sZn,.120},H}; -N l30n8[]={{swo,.227},H}; -N l30n10[]={{soxc3,.108},H}; -N l30n11[]={{skv,.131},H}; -N l30n12[]={{sb3s,.323},{sirm,.251},{sgp,.251},{s_w,.155},{syw7a,.108},H}; -N l30n13[]={{sXr,.418},{spm,.299},{syc2,.131},H}; -N l30n16[]={{smip,.126},H}; -N l30n17[]={{srsg,.188},H}; -N l30n18[]={{sik,.335},{s79Zlg,.466},{sb1w,.143},H}; -N l30n20[]={{s7ar,.143},{ssw,.120},H}; -N l30n21[]={{sgts,.995},{sx79,.203},{ssh,.155},{sog,.233},{sgnX,.269},H}; -N l30n22[]={{s7ami,.287},{sms,.072},H}; -N l30n23[]={{sZ7a,.490},H}; -N l30n26[]={{soyg,.188},H}; -N l30n27[]={{sv7a79,.179},{smiq,.108},H}; -N l30n28[]={{siw7a,.143},H}; -N l30n29[]={{sgq,.377},{sic2,.120},H}; -N l30n30[]={{sb3X,.251},{s_i,.131},H}; -N l30n33[]={{smc3aaZ,.143},{snihr,.143},H}; -N l30n34[]={{stv,.514},H}; -N l30n35[]={{srXg,.403},{soxc3b3,.143},H}; -N l30n37[]={{sg7aX,.538},{sh79,.131},{ssx,.108},{ssc2b6,.126},H}; -N l30n38[]={{sc2b3s,.726},{sgc2bfi,.359},{smiks,.143},{smir,.108},{sqc3,.072},H}; -N l30n39[]={{sg_g,.645},H}; -N l30n40[]={{smX,.311},{sc3aaZ,.242},H}; -N l30n41[]={{saaZ,.108},H}; -N l30n44[]={{sqm,.215},H}; -N l30n45[]={{sc2bf,1.103},{svs,.347},H}; -N l30n46[]={{sgr,1.022},{sic3,.072},H}; -N l30n47[]={{s7a79g,.215},{snmg,.161},H}; -N l30n48[]={{s_Xc2,.179},H}; -N l30n51[]={{sc3aah,.282},H}; -N l30n53[]={{s7air,.108},H}; -N l30n54[]={{sgtv,.914},{sh7a,.299},{sbfig,.484},{skvX,.108},H}; -N l30n55[]={{s7aX,.418},{siksg,.681},{sgvs,.188},H}; -N l30n56[]={{sksg,.511},H}; -N l30n57[]={{sgmg,.511},H}; -N l30n58[]={{s79Z,.227},{sa6g,.403},{s79c2b3,.161},{saah,.126},{sXog,.161},H}; -N l30n60[]={{sq79,.108},H}; -N l30n61[]={{sY79c2,.179},{sYs,.096},H}; -N l30n63[]={{svX,.406},{sc2b1,.726},{sgs,.466},{sv7ai,.305},{sb3v,.108},H}; -N l30n64[]={{sgoxc3,.215},H}; -N l30n65[]={{sgni,.377},{sbfg,.215},H}; -N l30n66[]={{syc2bf,.126},H}; -N l30n68[]={{s79qg,.296},H}; -N l30n69[]={{sin,.371},{sZlg,.511},{somi,.287},{swmc3aa,.167},H}; -N l30n71[]={{sc3aag,1.331},{snX,.167},{sY79g,.215},{swmc3,.126},H}; -N l30n72[]={{sw7aZ,.215},{ssk,.120},H}; -N l30n73[]={{sghs,.511},{ss_w,.108},H}; -N l30n74[]={{smZ,.167},{sg_m,.296},{s79w,.131},{sZ7a79,.126},{smc2b3,.108},H}; -N l30n75[]={{srm,1.124},{syg,.556},{s79h,.072},H}; -N l30n77[]={{stvX,.233},{sXc3b1,.126},{sZmi,.126},H}; -N l30n78[]={{somg,.215},H}; -N l30n79[]={{sc3b1w,.323},{sgwmc3,.251},{sYX,.072},H}; -N l30n80[]={{sgt,1.703},H}; -N l30n81[]={{sXv,.203},{sgX,.215},{srXn,.126},H}; -N l30n82[]={{sXc2b3,.341},{sXZ,.215},{sic2bf,.108},{smiv,.108},H}; -N l30n83[]={{sqg,.663},{ssc2,.155},{sgwt,.161},H}; -N l30n84[]={{sos,.311},H}; -N l30n85[]={{si7a,.155},H}; -N l30n86[]={{sio,.155},{sY79c2b3,.215},{sgnXo,.251},H}; -N l30n88[]={{ss_,.382},{smc3aag,.323},{sc2bfX,.242},H}; -N l30n89[]={{sgrX,.834},{s7aZ,.155},{sgxs,.269},{sgtvX,.287},H}; -N l30n90[]={{smw,.131},{sg7ag,.269},{sming,.287},H}; -N l30n91[]={{sig,1.452},{sr79,.179},{skc2,.072},{s79x,.072},H}; -N l30n92[]={{svX_,.143},{sgtsq,.215},H}; -N l30n93[]={{swt,.084},H}; -N l30n94[]={{sc3b1,.350},{sw7ai,.126},H}; -N l30n96[]={{stv7a,.269},H}; -N l30n97[]={{sc2b3,2.017},H}; -N l30n98[]={{s_m,.442},{sgY,.520},{sXw,.143},{spr,.120},H}; -N l30n99[]={{sXh,.131},H}; -N l30n101[]={{sgtvi,.251},H}; -N l30n102[]={{soX,.227},{sc3b3v,.242},H}; -N l30n103[]={{sip,.179},H}; -N l30n104[]={{sc2b3y,.282},H}; -N l30n106[]={{shr,.155},H}; -N l30n107[]={{sxs,.287},H}; -N l30n108[]={{smi,1.303},{sb3sg,.363},H}; -N l30n109[]={{spmg,.269},{sgnih,.215},H}; -N l30n110[]={{sZ7ai,.341},{sXpm,.108},H}; -N l30n112[]={{sxiq,.126},H}; -N l30n114[]={{s_79,.227},{sgv,.287},{sb3y,.126},{skm,.084},H}; -N l30n115[]={{sgZ,.323},{sXx,.120},H}; -N l30n116[]={{srik,.143},H}; -N l30n117[]={{sgsY,.161},H}; -N l30n118[]={{srmX,.179},H}; -N l30n120[]={{siq,.299},{saah7a,.161},H}; -N l30n121[]={{stvi,.143},{syr,.072},H}; -N l30n123[]={{s7ai,.586},{shs,.335},{sgtX,.242},H}; -N l30n124[]={{smy,.084},H}; -N l30n125[]={{sxX,.311},H}; -N l30n127[]={{sgwx,.215},H}; -N l30n128[]={{sc3b3,.753},{svXZ,.126},{swc2b3,.108},H}; -N l30n131[]={{sgw,.896},{svi,.227},{ss_X,.215},{sqmi,.126},H}; -N l30n132[]={{sgh,.735},{sc2bfi,.565},H}; -N l30n133[]={{sirx,.179},{spX,.096},H}; -N l30n134[]={{sc2b3sg,.726},H}; -N l30n135[]={{swxv,.126},{sov,.072},H}; -N l30n136[]={{smXg,.269},{smZ7a,.126},H}; -N l30n137[]={{s_g,.610},{sir,.382},{s79c2,.167},{stm,.155},H}; -N l30n139[]={{sni,.215},{swom,.179},{sc2b1h,.242},{shir,.108},{ss7a,.072},H}; -N l30n140[]={{sc2b3X,.565},{sso,.143},H}; -N l30n141[]={{shX,.108},{sc2bfg,.484},H}; -N l30n143[]={{sb1g,.430},{stv7ai,.263},H}; -N l30n144[]={{sXrm,.341},H}; -N l30n145[]={{ssg,1.470},H}; -N l30n146[]={{sqs,.072},H}; -N l30n147[]={{svy,.108},{sYi,.084},H}; -N l30n148[]={{sgx,.663},{sc2b6,.565},{sb3_,.269},{sc2b379,.323},{s_Xr,.108},H}; -N l30n149[]={{srin,.215},{sgY79,.296},H}; -N l30n151[]={{s7aZ7a,.197},{s7aXg,.188},{sgrXn,.215},H}; -N l30n153[]={{smc2,.179},{sihr,.126},H}; -N l30n157[]={{sc3b3_,.605},{ssp,.155},{sgkv,.188},H}; -N l30n158[]={{sxv,.155},H}; -N l30n159[]={{sc2b1g,.726},H}; -N l30n161[]={{swx,.466},{sXc2,.359},{sc3aah7a,.323},H}; -N l30n162[]={{srmi,.681},H}; -N l30n163[]={{sc3a6,.403},H}; -N l30n164[]={{sgtv7a,.538},{sqX,.155},H}; -N l30n165[]={{sing,.780},{sgy,.215},{s_wo,.126},H}; -N l30n166[]={{sX_,.227},H}; -N l30n168[]={{s7ac2,.084},H}; -N l30n169[]={{sghsg,.538},{sox,.096},H}; -N l30n170[]={{smc3,.287},H}; -N l30n171[]={{srmg,.242},H}; -N l30n173[]={{sZmig,.215},H}; -N l30n174[]={{ssq,.179},{shv,.096},H}; -N l30n176[]={{sxc3b3,.143},H}; -N l30n177[]={{sgrm,.619},{srs,.131},{sgZ7a,.215},H}; -N l30n178[]={{s79Zl,.251},{sZi,.143},{sXc3,.143},{sXc2b3g,.323},{stvX_,.191},{srmyg,.215},H}; -N l30n180[]={{sosg,.188},H}; -N l30n182[]={{saag,.592},{sw7aZ7a,.263},{sb379,.143},H}; -N l30n183[]={{sgk,.305},H}; -N l30n184[]={{slg,.341},{s_mc2,.108},H}; -N l30n185[]={{sh7am,.305},{s_mi,.269},{sgrXg,.394},{sgxsg,.359},{spri,.108},H}; -N l30n186[]={{soy,.131},{swomi,.167},H}; -N l30n187[]={{stXr,.143},{sr79g,.188},H}; -N l30n191[]={{s7am,.215},{ssr,.191},{sgxX,.215},H}; -N l30n192[]={{sgos,.188},H}; -N l30n193[]={{sxi,.239},{sc2b3g,1.089},{sgw7a,.269},{sriks,.191},H}; -N l30n194[]={{sgc2,.323},H}; -N l30n195[]={{srX,.526},{s_mc3,.108},H}; -N l30n198[]={{s7aZ7ai,.191},{soXg,.188},H}; -N l30n199[]={{sg_,1.147},{s79g,.914},{sgx79,.242},H}; -N l30n200[]={{s_s,.131},H}; -N l30n201[]={{spi,.239},{sXn,.120},H}; -N l30n203[]={{sxsg,.350},H}; -N l30n204[]={{smig,1.156},{swxX,.126},H}; -N l30n205[]={{sb3g,.511},{siv,.167},H}; -N l30n206[]={{siZ,.167},{syw,.108},H}; -N l30n207[]={{s7a79,.359},{syh,.120},{swc2,.120},{snm,.072},H}; -N l30n209[]={{shi,.155},{sxy,.084},{sZ7ar,.108},H}; -N l30n210[]={{smo,.072},H}; -N l30n214[]={{sbfi,.251},{srmXg,.287},{sXc2bf,.143},H}; -N l30n215[]={{smg,1.165},{siks,.341},{sv79,.084},{sYm,.084},{snih,.108},{sqc3b3,.108},H}; -N l30n216[]={{sks,.275},{siqg,.457},H}; -N l30n217[]={{sgm,.430},{smik,.126},{spy,.084},H}; -N l30n218[]={{s_X,.335},{sXo,.215},{siwx,.108},H}; -N l30n219[]={{shsg,.403},{s7aig,.242},{sgY79c2,.287},{ss_m,.108},H}; -N l30n220[]={{smyg,.188},H}; -N l30n221[]={{sxXg,.161},H}; -N l30n222[]={{siw,.191},H}; -N l30n223[]={{sXg,1.452},{sih,.155},H}; -N l30n224[]={{sgrmi,.717},{snXo,.126},{s_wom,.143},H}; -N l30n227[]={{smp,.072},H}; -N l30n228[]={{s79q,.155},{sc2bfig,.968},H}; -N l30n229[]={{sZl,.347},H}; -N l30n230[]={{s7ag,.305},{swm,.108},H}; -N l30n231[]={{sc3aa,1.210},{sY79,.239},{shirx,.143},H}; -N l30n232[]={{sv7a,.418},{sh7ami,.359},H}; -N l30n234[]={{sgn,.538},{skX,.096},H}; -N l30n235[]={{sXp,.239},{sgxi,.188},H}; -N l30n237[]={{shrm,.126},H}; -N l30n238[]={{som,.359},H}; -N l30n239[]={{sts,.478},{six,.084},H}; -N l30n243[]={{ssY,.143},{sx_,.108},H}; -N l30n244[]={{sb3_g,.323},H}; -N l30n245[]={{sring,.430},H}; -N l30n246[]={{sng,.556},{sZm,.251},{srh,.072},{sw79,.072},H}; -N l30n247[]={{sgc2bf,.296},{sgox,.188},H}; -N l30n248[]={{smc3aa,.377},H}; -N l30n250[]={{sg7a,.789},{sg_79,.323},{smin,.179},H}; -N l30n251[]={{sgo,.520},H}; -N l30n252[]={{sXq,.167},H}; -N l30n253[]={{sc3b3_g,.645},H}; -N l30n255[]={{sxc3,.131},H}; - -D l30_d = -{ +S sc2b3[] = { 194, 179, 0 }; +S sc3aa[] = { 195, 170, 0 }; +S sc2bf[] = { 194, 191, 0 }; +S sXc2[] = { 97, 194, 0 }; +S sc2b1[] = { 194, 177, 0 }; +S sc3aag[] = { 195, 170, a }; +S smc3aa[] = { i, 195, 170, 0 }; +S sc2b6[] = { 194, 182, 0 }; +S sXc2b3[] = { 97, 194, 179, 0 }; +S sc2b3s[] = { 194, 179, o, 0 }; +S sc2b3g[] = { 194, 179, a }; +S smc2[] = { i, 194, 0 }; +S sc3a6g[] = { 195, 166, a }; +S sc3b3_[] = { 195, 179, w, 0 }; +S sc3a6[] = { 195, 166, 0 }; +S sb3_[] = { 179, w, 0 }; +S sc2b3X[] = { 194, 179, 97, 0 }; +S sc2bfi[] = { 194, 191, e, 0 }; +S s79c2[] = { y, 194, 0 }; +S sc3b1[] = { 195, 177, 0 }; +S ssc2[] = { o, 194, 0 }; +S sc2b1g[] = { 194, 177, a }; +S sc2bfig[] = { 194, 191, e, a }; +S sXc3[] = { 97, 195, 0 }; +S syc2[] = { u, 194, 0 }; +S sgc2bf[] = { 32, 194, 191, 0 }; +S sic2[] = { e, 194, 0 }; +S s_Xc2[] = { w, 97, 194, 0 }; +S swc2[] = { s, 194, 0 }; +S sgc2bfi[] = { 32, 194, 191, e, 0 }; +S sY79c2[] = { 98, y, 194, 0 }; +S smc3aag[] = { i, 195, 170, a }; +S sc2b3sg[] = { 194, 179, o, a }; +S sY79c2b3[] = { 98, y, 194, 179, 0 }; +S sXc2b3g[] = { 97, 194, 179, a }; +S s79c2b3[] = { y, 194, 179, 0 }; +S sxc3b3[] = { t, 195, 179, 0 }; +S sb1w[] = { 177, s, 0 }; +S sXc2bf[] = { 97, 194, 191, 0 }; +S sgY79c2[] = { 32, 98, y, 194, 0 }; +S sc3b1w[] = { 195, 177, s, 0 }; +S sc3b3_g[] = { 195, 179, w, a }; +S sb3_g[] = { 179, w, a }; +S sc2b379[] = { 194, 179, y, 0 }; +S sc2bfg[] = { 194, 191, a }; +S swmc3[] = { s, i, 195, 0 }; +S sc3aah[] = { 195, 170, d, 0 }; +S saah[] = { 170, d, 0 }; +S s7ac2[] = { z, 194, 0 }; +S syc2bf[] = { u, 194, 191, 0 }; +S sgwmc3[] = { 32, s, i, 195, 0 }; +S sXc3b1[] = { 97, 195, 177, 0 }; +S ssc2b6[] = { o, 194, 182, 0 }; +S sc2b3y[] = { 194, 179, u, 0 }; +S swmc3aa[] = { s, i, 195, 170, 0 }; +S sc3aah7a[] = { 195, 170, d, z, 0 }; +S soxc3b3[] = { k, t, 195, 179, 0 }; +S saaZ[] = { 170, 99, 0 }; +S sic2bf[] = { e, 194, 191, 0 }; +S sgoxc3[] = { 32, k, t, 195, 0 }; +S smc3aaZ[] = { i, 195, 170, 99, 0 }; +S sb3v[] = { 179, r, 0 }; +S s_mc2[] = { w, i, 194, 0 }; +S saah7a[] = { 170, d, z, 0 }; +S sc2b1h[] = { 194, 177, d, 0 }; +S skc2[] = { g, 194, 0 }; +S sc2bfX[] = { 194, 191, 97, 0 }; +S sqc3b3[] = { m, 195, 179, 0 }; +S smc2b3[] = { i, 194, 179, 0 }; +S sc3aaZ[] = { 195, 170, 99, 0 }; +S swc2b3[] = { s, 194, 179, 0 }; +S sic3[] = { e, 195, 0 }; +S s_mc3[] = { w, i, 195, 0 }; +S sc3b3v[] = { 195, 179, r, 0 }; +S soxc3[] = { k, t, 195, 0 }; + +N l30n1[] = { { stX, .155 }, H }; +N l30n2[] = { { srmig, .896 }, H }; +N l30n3[] = { { ssv, .239 }, { sc3a6g, .908 }, H }; +N l30n4[] = { { ssZ, .084 }, H }; +N l30n5[] = { { smr, .108 }, H }; +N l30n6[] = { { srx, .120 }, { sgwm, .215 }, H }; +N l30n7[] = { { sw7a, .502 }, { sri, .323 }, { sZn, .120 }, H }; +N l30n8[] = { { swo, .227 }, H }; +N l30n10[] = { { soxc3, .108 }, H }; +N l30n11[] = { { skv, .131 }, H }; +N l30n12[] = { { sb3s, .323 }, { sirm, .251 }, { sgp, .251 }, { s_w, .155 }, { syw7a, .108 }, H }; +N l30n13[] = { { sXr, .418 }, { spm, .299 }, { syc2, .131 }, H }; +N l30n16[] = { { smip, .126 }, H }; +N l30n17[] = { { srsg, .188 }, H }; +N l30n18[] = { { sik, .335 }, { s79Zlg, .466 }, { sb1w, .143 }, H }; +N l30n20[] = { { s7ar, .143 }, { ssw, .120 }, H }; +N l30n21[] = { { sgts, .995 }, { sx79, .203 }, { ssh, .155 }, { sog, .233 }, { sgnX, .269 }, H }; +N l30n22[] = { { s7ami, .287 }, { sms, .072 }, H }; +N l30n23[] = { { sZ7a, .490 }, H }; +N l30n26[] = { { soyg, .188 }, H }; +N l30n27[] = { { sv7a79, .179 }, { smiq, .108 }, H }; +N l30n28[] = { { siw7a, .143 }, H }; +N l30n29[] = { { sgq, .377 }, { sic2, .120 }, H }; +N l30n30[] = { { sb3X, .251 }, { s_i, .131 }, H }; +N l30n33[] = { { smc3aaZ, .143 }, { snihr, .143 }, H }; +N l30n34[] = { { stv, .514 }, H }; +N l30n35[] = { { srXg, .403 }, { soxc3b3, .143 }, H }; +N l30n37[] = { { sg7aX, .538 }, { sh79, .131 }, { ssx, .108 }, { ssc2b6, .126 }, H }; +N l30n38[] = { { sc2b3s, .726 }, { sgc2bfi, .359 }, { smiks, .143 }, { smir, .108 }, { sqc3, .072 }, H }; +N l30n39[] = { { sg_g, .645 }, H }; +N l30n40[] = { { smX, .311 }, { sc3aaZ, .242 }, H }; +N l30n41[] = { { saaZ, .108 }, H }; +N l30n44[] = { { sqm, .215 }, H }; +N l30n45[] = { { sc2bf, 1.103 }, { svs, .347 }, H }; +N l30n46[] = { { sgr, 1.022 }, { sic3, .072 }, H }; +N l30n47[] = { { s7a79g, .215 }, { snmg, .161 }, H }; +N l30n48[] = { { s_Xc2, .179 }, H }; +N l30n51[] = { { sc3aah, .282 }, H }; +N l30n53[] = { { s7air, .108 }, H }; +N l30n54[] = { { sgtv, .914 }, { sh7a, .299 }, { sbfig, .484 }, { skvX, .108 }, H }; +N l30n55[] = { { s7aX, .418 }, { siksg, .681 }, { sgvs, .188 }, H }; +N l30n56[] = { { sksg, .511 }, H }; +N l30n57[] = { { sgmg, .511 }, H }; +N l30n58[] = { { s79Z, .227 }, { sa6g, .403 }, { s79c2b3, .161 }, { saah, .126 }, { sXog, .161 }, H }; +N l30n60[] = { { sq79, .108 }, H }; +N l30n61[] = { { sY79c2, .179 }, { sYs, .096 }, H }; +N l30n63[] = { { svX, .406 }, { sc2b1, .726 }, { sgs, .466 }, { sv7ai, .305 }, { sb3v, .108 }, H }; +N l30n64[] = { { sgoxc3, .215 }, H }; +N l30n65[] = { { sgni, .377 }, { sbfg, .215 }, H }; +N l30n66[] = { { syc2bf, .126 }, H }; +N l30n68[] = { { s79qg, .296 }, H }; +N l30n69[] = { { sin, .371 }, { sZlg, .511 }, { somi, .287 }, { swmc3aa, .167 }, H }; +N l30n71[] = { { sc3aag, 1.331 }, { snX, .167 }, { sY79g, .215 }, { swmc3, .126 }, H }; +N l30n72[] = { { sw7aZ, .215 }, { ssk, .120 }, H }; +N l30n73[] = { { sghs, .511 }, { ss_w, .108 }, H }; +N l30n74[] = { { smZ, .167 }, { sg_m, .296 }, { s79w, .131 }, { sZ7a79, .126 }, { smc2b3, .108 }, H }; +N l30n75[] = { { srm, 1.124 }, { syg, .556 }, { s79h, .072 }, H }; +N l30n77[] = { { stvX, .233 }, { sXc3b1, .126 }, { sZmi, .126 }, H }; +N l30n78[] = { { somg, .215 }, H }; +N l30n79[] = { { sc3b1w, .323 }, { sgwmc3, .251 }, { sYX, .072 }, H }; +N l30n80[] = { { sgt, 1.703 }, H }; +N l30n81[] = { { sXv, .203 }, { sgX, .215 }, { srXn, .126 }, H }; +N l30n82[] = { { sXc2b3, .341 }, { sXZ, .215 }, { sic2bf, .108 }, { smiv, .108 }, H }; +N l30n83[] = { { sqg, .663 }, { ssc2, .155 }, { sgwt, .161 }, H }; +N l30n84[] = { { sos, .311 }, H }; +N l30n85[] = { { si7a, .155 }, H }; +N l30n86[] = { { sio, .155 }, { sY79c2b3, .215 }, { sgnXo, .251 }, H }; +N l30n88[] = { { ss_, .382 }, { smc3aag, .323 }, { sc2bfX, .242 }, H }; +N l30n89[] = { { sgrX, .834 }, { s7aZ, .155 }, { sgxs, .269 }, { sgtvX, .287 }, H }; +N l30n90[] = { { smw, .131 }, { sg7ag, .269 }, { sming, .287 }, H }; +N l30n91[] = { { sig, 1.452 }, { sr79, .179 }, { skc2, .072 }, { s79x, .072 }, H }; +N l30n92[] = { { svX_, .143 }, { sgtsq, .215 }, H }; +N l30n93[] = { { swt, .084 }, H }; +N l30n94[] = { { sc3b1, .350 }, { sw7ai, .126 }, H }; +N l30n96[] = { { stv7a, .269 }, H }; +N l30n97[] = { { sc2b3, 2.017 }, H }; +N l30n98[] = { { s_m, .442 }, { sgY, .520 }, { sXw, .143 }, { spr, .120 }, H }; +N l30n99[] = { { sXh, .131 }, H }; +N l30n101[] = { { sgtvi, .251 }, H }; +N l30n102[] = { { soX, .227 }, { sc3b3v, .242 }, H }; +N l30n103[] = { { sip, .179 }, H }; +N l30n104[] = { { sc2b3y, .282 }, H }; +N l30n106[] = { { shr, .155 }, H }; +N l30n107[] = { { sxs, .287 }, H }; +N l30n108[] = { { smi, 1.303 }, { sb3sg, .363 }, H }; +N l30n109[] = { { spmg, .269 }, { sgnih, .215 }, H }; +N l30n110[] = { { sZ7ai, .341 }, { sXpm, .108 }, H }; +N l30n112[] = { { sxiq, .126 }, H }; +N l30n114[] = { { s_79, .227 }, { sgv, .287 }, { sb3y, .126 }, { skm, .084 }, H }; +N l30n115[] = { { sgZ, .323 }, { sXx, .120 }, H }; +N l30n116[] = { { srik, .143 }, H }; +N l30n117[] = { { sgsY, .161 }, H }; +N l30n118[] = { { srmX, .179 }, H }; +N l30n120[] = { { siq, .299 }, { saah7a, .161 }, H }; +N l30n121[] = { { stvi, .143 }, { syr, .072 }, H }; +N l30n123[] = { { s7ai, .586 }, { shs, .335 }, { sgtX, .242 }, H }; +N l30n124[] = { { smy, .084 }, H }; +N l30n125[] = { { sxX, .311 }, H }; +N l30n127[] = { { sgwx, .215 }, H }; +N l30n128[] = { { sc3b3, .753 }, { svXZ, .126 }, { swc2b3, .108 }, H }; +N l30n131[] = { { sgw, .896 }, { svi, .227 }, { ss_X, .215 }, { sqmi, .126 }, H }; +N l30n132[] = { { sgh, .735 }, { sc2bfi, .565 }, H }; +N l30n133[] = { { sirx, .179 }, { spX, .096 }, H }; +N l30n134[] = { { sc2b3sg, .726 }, H }; +N l30n135[] = { { swxv, .126 }, { sov, .072 }, H }; +N l30n136[] = { { smXg, .269 }, { smZ7a, .126 }, H }; +N l30n137[] = { { s_g, .610 }, { sir, .382 }, { s79c2, .167 }, { stm, .155 }, H }; +N l30n139[] = { { sni, .215 }, { swom, .179 }, { sc2b1h, .242 }, { shir, .108 }, { ss7a, .072 }, H }; +N l30n140[] = { { sc2b3X, .565 }, { sso, .143 }, H }; +N l30n141[] = { { shX, .108 }, { sc2bfg, .484 }, H }; +N l30n143[] = { { sb1g, .430 }, { stv7ai, .263 }, H }; +N l30n144[] = { { sXrm, .341 }, H }; +N l30n145[] = { { ssg, 1.470 }, H }; +N l30n146[] = { { sqs, .072 }, H }; +N l30n147[] = { { svy, .108 }, { sYi, .084 }, H }; +N l30n148[] = { { sgx, .663 }, { sc2b6, .565 }, { sb3_, .269 }, { sc2b379, .323 }, { s_Xr, .108 }, H }; +N l30n149[] = { { srin, .215 }, { sgY79, .296 }, H }; +N l30n151[] = { { s7aZ7a, .197 }, { s7aXg, .188 }, { sgrXn, .215 }, H }; +N l30n153[] = { { smc2, .179 }, { sihr, .126 }, H }; +N l30n157[] = { { sc3b3_, .605 }, { ssp, .155 }, { sgkv, .188 }, H }; +N l30n158[] = { { sxv, .155 }, H }; +N l30n159[] = { { sc2b1g, .726 }, H }; +N l30n161[] = { { swx, .466 }, { sXc2, .359 }, { sc3aah7a, .323 }, H }; +N l30n162[] = { { srmi, .681 }, H }; +N l30n163[] = { { sc3a6, .403 }, H }; +N l30n164[] = { { sgtv7a, .538 }, { sqX, .155 }, H }; +N l30n165[] = { { sing, .780 }, { sgy, .215 }, { s_wo, .126 }, H }; +N l30n166[] = { { sX_, .227 }, H }; +N l30n168[] = { { s7ac2, .084 }, H }; +N l30n169[] = { { sghsg, .538 }, { sox, .096 }, H }; +N l30n170[] = { { smc3, .287 }, H }; +N l30n171[] = { { srmg, .242 }, H }; +N l30n173[] = { { sZmig, .215 }, H }; +N l30n174[] = { { ssq, .179 }, { shv, .096 }, H }; +N l30n176[] = { { sxc3b3, .143 }, H }; +N l30n177[] = { { sgrm, .619 }, { srs, .131 }, { sgZ7a, .215 }, H }; +N l30n178[] = { { s79Zl, .251 }, { sZi, .143 }, { sXc3, .143 }, { sXc2b3g, .323 }, { stvX_, .191 }, { srmyg, .215 }, H }; +N l30n180[] = { { sosg, .188 }, H }; +N l30n182[] = { { saag, .592 }, { sw7aZ7a, .263 }, { sb379, .143 }, H }; +N l30n183[] = { { sgk, .305 }, H }; +N l30n184[] = { { slg, .341 }, { s_mc2, .108 }, H }; +N l30n185[] = { { sh7am, .305 }, { s_mi, .269 }, { sgrXg, .394 }, { sgxsg, .359 }, { spri, .108 }, H }; +N l30n186[] = { { soy, .131 }, { swomi, .167 }, H }; +N l30n187[] = { { stXr, .143 }, { sr79g, .188 }, H }; +N l30n191[] = { { s7am, .215 }, { ssr, .191 }, { sgxX, .215 }, H }; +N l30n192[] = { { sgos, .188 }, H }; +N l30n193[] = { { sxi, .239 }, { sc2b3g, 1.089 }, { sgw7a, .269 }, { sriks, .191 }, H }; +N l30n194[] = { { sgc2, .323 }, H }; +N l30n195[] = { { srX, .526 }, { s_mc3, .108 }, H }; +N l30n198[] = { { s7aZ7ai, .191 }, { soXg, .188 }, H }; +N l30n199[] = { { sg_, 1.147 }, { s79g, .914 }, { sgx79, .242 }, H }; +N l30n200[] = { { s_s, .131 }, H }; +N l30n201[] = { { spi, .239 }, { sXn, .120 }, H }; +N l30n203[] = { { sxsg, .350 }, H }; +N l30n204[] = { { smig, 1.156 }, { swxX, .126 }, H }; +N l30n205[] = { { sb3g, .511 }, { siv, .167 }, H }; +N l30n206[] = { { siZ, .167 }, { syw, .108 }, H }; +N l30n207[] = { { s7a79, .359 }, { syh, .120 }, { swc2, .120 }, { snm, .072 }, H }; +N l30n209[] = { { shi, .155 }, { sxy, .084 }, { sZ7ar, .108 }, H }; +N l30n210[] = { { smo, .072 }, H }; +N l30n214[] = { { sbfi, .251 }, { srmXg, .287 }, { sXc2bf, .143 }, H }; +N l30n215[] = { { smg, 1.165 }, { siks, .341 }, { sv79, .084 }, { sYm, .084 }, { snih, .108 }, { sqc3b3, .108 }, H }; +N l30n216[] = { { sks, .275 }, { siqg, .457 }, H }; +N l30n217[] = { { sgm, .430 }, { smik, .126 }, { spy, .084 }, H }; +N l30n218[] = { { s_X, .335 }, { sXo, .215 }, { siwx, .108 }, H }; +N l30n219[] = { { shsg, .403 }, { s7aig, .242 }, { sgY79c2, .287 }, { ss_m, .108 }, H }; +N l30n220[] = { { smyg, .188 }, H }; +N l30n221[] = { { sxXg, .161 }, H }; +N l30n222[] = { { siw, .191 }, H }; +N l30n223[] = { { sXg, 1.452 }, { sih, .155 }, H }; +N l30n224[] = { { sgrmi, .717 }, { snXo, .126 }, { s_wom, .143 }, H }; +N l30n227[] = { { smp, .072 }, H }; +N l30n228[] = { { s79q, .155 }, { sc2bfig, .968 }, H }; +N l30n229[] = { { sZl, .347 }, H }; +N l30n230[] = { { s7ag, .305 }, { swm, .108 }, H }; +N l30n231[] = { { sc3aa, 1.210 }, { sY79, .239 }, { shirx, .143 }, H }; +N l30n232[] = { { sv7a, .418 }, { sh7ami, .359 }, H }; +N l30n234[] = { { sgn, .538 }, { skX, .096 }, H }; +N l30n235[] = { { sXp, .239 }, { sgxi, .188 }, H }; +N l30n237[] = { { shrm, .126 }, H }; +N l30n238[] = { { som, .359 }, H }; +N l30n239[] = { { sts, .478 }, { six, .084 }, H }; +N l30n243[] = { { ssY, .143 }, { sx_, .108 }, H }; +N l30n244[] = { { sb3_g, .323 }, H }; +N l30n245[] = { { sring, .430 }, H }; +N l30n246[] = { { sng, .556 }, { sZm, .251 }, { srh, .072 }, { sw79, .072 }, H }; +N l30n247[] = { { sgc2bf, .296 }, { sgox, .188 }, H }; +N l30n248[] = { { smc3aa, .377 }, H }; +N l30n250[] = { { sg7a, .789 }, { sg_79, .323 }, { smin, .179 }, H }; +N l30n251[] = { { sgo, .520 }, H }; +N l30n252[] = { { sXq, .167 }, H }; +N l30n253[] = { { sc3b3_g, .645 }, H }; +N l30n255[] = { { sxc3, .131 }, H }; + +D l30_d = { "polish", "utf8", - { - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,0.001, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,0.157,0.031,0.067,0.063,0.163,0.006,0.034,0.015,0.156,0.044,0.063,0.044,0.051,0.112,0.135, - 0.063,W,0.083,0.074,0.070,0.047,W,0.083,W,0.073,0.106,W,W,W,W,W, - Y,Y,Y,Y,Y,Y,0.001,Y,Y,Y,Y,Y,Y,Y,Y,Y, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - Y,Y,Y,0.001,Y,Y,0.012,Y,Y,Y,0.032,Y,Y,Y,Y,0.001, - Y,0.029,Y,0.074,Y,Y,0.015,Y,Y,Y,Y,Y,0.001,Y,Y,0.029, - Y,V,0.182,0.110,V,V,V,V,V,V,V,V,V,V,V,V, - V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V, - V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V, - V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V - }, - { - X,l30n1,l30n2,l30n3,l30n4,l30n5,l30n6,l30n7,l30n8,X,l30n10,l30n11,l30n12,l30n13,X,X, - l30n16,l30n17,l30n18,X,l30n20,l30n21,l30n22,l30n23,X,X,l30n26,l30n27,l30n28,l30n29,l30n30,X, - X,l30n33,l30n34,l30n35,X,l30n37,l30n38,l30n39,l30n40,l30n41,X,X,l30n44,l30n45,l30n46,l30n47, - l30n48,X,X,l30n51,X,l30n53,l30n54,l30n55,l30n56,l30n57,l30n58,X,l30n60,l30n61,X,l30n63, - l30n64,l30n65,l30n66,X,l30n68,l30n69,X,l30n71,l30n72,l30n73,l30n74,l30n75,X,l30n77,l30n78,l30n79, - l30n80,l30n81,l30n82,l30n83,l30n84,l30n85,l30n86,X,l30n88,l30n89,l30n90,l30n91,l30n92,l30n93,l30n94,X, - l30n96,l30n97,l30n98,l30n99,X,l30n101,l30n102,l30n103,l30n104,X,l30n106,l30n107,l30n108,l30n109,l30n110,X, - l30n112,X,l30n114,l30n115,l30n116,l30n117,l30n118,X,l30n120,l30n121,X,l30n123,l30n124,l30n125,X,l30n127, - l30n128,X,X,l30n131,l30n132,l30n133,l30n134,l30n135,l30n136,l30n137,X,l30n139,l30n140,l30n141,X,l30n143, - l30n144,l30n145,l30n146,l30n147,l30n148,l30n149,X,l30n151,X,l30n153,X,X,X,l30n157,l30n158,l30n159, - X,l30n161,l30n162,l30n163,l30n164,l30n165,l30n166,X,l30n168,l30n169,l30n170,l30n171,X,l30n173,l30n174,X, - l30n176,l30n177,l30n178,X,l30n180,X,l30n182,l30n183,l30n184,l30n185,l30n186,l30n187,X,X,X,l30n191, - l30n192,l30n193,l30n194,l30n195,X,X,l30n198,l30n199,l30n200,l30n201,X,l30n203,l30n204,l30n205,l30n206,l30n207, - X,l30n209,l30n210,X,X,X,l30n214,l30n215,l30n216,l30n217,l30n218,l30n219,l30n220,l30n221,l30n222,l30n223, - l30n224,X,X,l30n227,l30n228,l30n229,l30n230,l30n231,l30n232,X,l30n234,l30n235,X,l30n237,l30n238,l30n239, - X,X,X,l30n243,l30n244,l30n245,l30n246,l30n247,l30n248,X,l30n250,l30n251,l30n252,l30n253,X,l30n255 - } + { W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, 0.001, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, 0.157, 0.031, 0.067, 0.063, 0.163, 0.006, 0.034, 0.015, 0.156, 0.044, 0.063, 0.044, 0.051, 0.112, 0.135, + 0.063, W, 0.083, 0.074, 0.070, 0.047, W, 0.083, W, 0.073, 0.106, W, W, W, W, W, + Y, Y, Y, Y, Y, Y, 0.001, Y, Y, Y, Y, Y, Y, Y, Y, Y, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + Y, Y, Y, 0.001, Y, Y, 0.012, Y, Y, Y, 0.032, Y, Y, Y, Y, 0.001, + Y, 0.029, Y, 0.074, Y, Y, 0.015, Y, Y, Y, Y, Y, 0.001, Y, Y, 0.029, + Y, V, 0.182, 0.110, V, V, V, V, V, V, V, V, V, V, V, V, + V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, + V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, + V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, V }, + { X, l30n1, l30n2, l30n3, l30n4, l30n5, l30n6, l30n7, l30n8, X, l30n10, l30n11, l30n12, l30n13, X, X, + l30n16, l30n17, l30n18, X, l30n20, l30n21, l30n22, l30n23, X, X, l30n26, l30n27, l30n28, l30n29, l30n30, X, + X, l30n33, l30n34, l30n35, X, l30n37, l30n38, l30n39, l30n40, l30n41, X, X, l30n44, l30n45, l30n46, l30n47, + l30n48, X, X, l30n51, X, l30n53, l30n54, l30n55, l30n56, l30n57, l30n58, X, l30n60, l30n61, X, l30n63, + l30n64, l30n65, l30n66, X, l30n68, l30n69, X, l30n71, l30n72, l30n73, l30n74, l30n75, X, l30n77, l30n78, l30n79, + l30n80, l30n81, l30n82, l30n83, l30n84, l30n85, l30n86, X, l30n88, l30n89, l30n90, l30n91, l30n92, l30n93, l30n94, X, + l30n96, l30n97, l30n98, l30n99, X, l30n101, l30n102, l30n103, l30n104, X, l30n106, l30n107, l30n108, l30n109, l30n110, X, + l30n112, X, l30n114, l30n115, l30n116, l30n117, l30n118, X, l30n120, l30n121, X, l30n123, l30n124, l30n125, X, l30n127, + l30n128, X, X, l30n131, l30n132, l30n133, l30n134, l30n135, l30n136, l30n137, X, l30n139, l30n140, l30n141, X, l30n143, + l30n144, l30n145, l30n146, l30n147, l30n148, l30n149, X, l30n151, X, l30n153, X, X, X, l30n157, l30n158, l30n159, + X, l30n161, l30n162, l30n163, l30n164, l30n165, l30n166, X, l30n168, l30n169, l30n170, l30n171, X, l30n173, l30n174, X, + l30n176, l30n177, l30n178, X, l30n180, X, l30n182, l30n183, l30n184, l30n185, l30n186, l30n187, X, X, X, l30n191, + l30n192, l30n193, l30n194, l30n195, X, X, l30n198, l30n199, l30n200, l30n201, X, l30n203, l30n204, l30n205, l30n206, l30n207, + X, l30n209, l30n210, X, X, X, l30n214, l30n215, l30n216, l30n217, l30n218, l30n219, l30n220, l30n221, l30n222, l30n223, + l30n224, X, X, l30n227, l30n228, l30n229, l30n230, l30n231, l30n232, X, l30n234, l30n235, X, l30n237, l30n238, l30n239, + X, X, X, l30n243, l30n244, l30n245, l30n246, l30n247, l30n248, X, l30n250, l30n251, l30n252, l30n253, X, l30n255 } }; - - // // Lng: portuguese // Enc: iso-8859-15 // - -S sTs[]={227,o,0}; -S sTsg[]={227,o,a}; -S sXe7[]={97,231,0}; -S se7Tsg[]={231,227,o,a}; -S se7Ts[]={231,227,o,0}; -S se7T[]={231,227,0}; -S shsw[]={d,o,s,0}; -S shswg[]={d,o,s,a}; -S syqX[]={u,m,97,0}; -S spl[]={l,h,0}; -S syqXg[]={u,m,97,a}; -S srxsg[]={n,t,o,a}; -S svms[]={r,i,o,0}; -S sgrsg[]={32,n,o,a}; -S sxswg[]={t,o,s,a}; -S sXhi[]={97,d,e,0}; -S sXe7Ts[]={97,231,227,o,0}; -S sXe7T[]={97,231,227,0}; -S sXvXg[]={97,r,97,a}; -S shXh[]={d,97,d,0}; -S sgyqX[]={32,u,m,97,0}; -S sXhsg[]={97,d,o,a}; -S sgtsv[]={32,p,o,r,0}; -S sZsrx[]={99,o,n,t,0}; -S stsv[]={p,o,r,0}; -S smhX[]={i,d,97,0}; -S sf5i[]={245,e,0}; -S sf5iwg[]={245,e,s,a}; -S se7X[]={231,97,0}; -S sf5iw[]={245,e,s,0}; -S sxXh[]={t,97,d,0}; -S sgswg[]={32,o,s,a}; -S sgiq[]={32,e,m,0}; -S sxiw[]={t,e,s,0}; -S smqi[]={i,m,e,0}; -S sxXhs[]={t,97,d,o,0}; -S sqsg[]={m,o,a}; -S sirxs[]={e,n,t,o,0}; -S siZi[]={e,99,e,0}; -S se7Xg[]={231,97,a}; -S svmXg[]={r,i,97,a}; -S sgiqg[]={32,e,m,a}; -S shXhi[]={d,97,d,e,0}; -S sZsqs[]={99,o,m,o,0}; -S ssqsg[]={o,m,o,a}; -S ssqs[]={o,m,o,0}; -S smxs[]={i,t,o,0}; -S smhXh[]={i,d,97,d,0}; -S sgrsw[]={32,n,o,s,0}; -S siyg[]={e,u,a}; -S sxXrx[]={t,97,n,t,0}; -S srswg[]={n,o,s,a}; -S srl[]={n,h,0}; -S sqym[]={m,u,i,0}; -S sXrxi[]={97,n,t,e,0}; -S sgXs[]={32,97,o,0}; -S sRvms[]={225,r,i,o,0}; -S srxiw[]={n,t,e,s,0}; -S svsg[]={r,o,a}; -S svmsg[]={r,i,o,a}; -S smsw[]={i,o,s,0}; -S sgqym[]={32,m,u,i,0}; -S spls[]={l,h,o,0}; -S sqymx[]={m,u,i,t,0}; -S smswg[]={i,o,s,a}; -S sXrxs[]={97,n,t,o,0}; -S sRvm[]={225,r,i,0}; -S sxmZ[]={t,i,99,0}; -S smqir[]={i,m,e,n,0}; -S sxiwg[]={t,e,s,a}; -S sgqmp[]={32,m,i,l,0}; -S sYvX[]={98,r,97,0}; -S smZs[]={i,99,o,0}; -S sXwm[]={97,s,i,0}; -S sXhig[]={97,d,e,a}; -S sZXg[]={99,97,a}; -S sgtip[]={32,p,e,l,0}; -S sXvmX[]={97,r,i,97,0}; -S sgviw[]={32,r,e,s,0}; -S sgXsg[]={32,97,o,a}; -S swTs[]={s,227,o,0}; -S sgwir[]={32,s,e,n,0}; -S sgYvX[]={32,98,r,97,0}; - -N l31n0[]={{siy,.091},H}; -N l31n1[]={{stX,.364},{smrx,.097},H}; -N l31n2[]={{swig,.205},{srswg,.234},H}; -N l31n3[]={{ssv,.585},H}; -N l31n4[]={{sqXg,.409},{ssZ,.104},H}; -N l31n5[]={{smr,.390},{sxm,.351},{ssqi,.117},H}; -N l31n6[]={{srx,.767},H}; -N l31n7[]={{sri,.130},{smsw,.117},H}; -N l31n8[]={{sghXw,.273},{shXhi,.182},H}; -N l31n9[]={{sXrx,.292},{sXmwg,.234},H}; -N l31n10[]={{stXvX,.234},H}; -N l31n11[]={{sZsq,.273},{skv,.130},{sgXr,.146},H}; -N l31n12[]={{se7T,.409},{sgp,.253},H}; -N l31n13[]={{swg,2.495},{sXr,.390},{spm,.234},H}; -N l31n15[]={{sghXg,.312},{smZs,.097},{sji,.065},H}; -N l31n17[]={{srsg,.526},{siz,.065},H}; -N l31n18[]={{sik,.117},{sxiwg,.234},H}; -N l31n20[]={{ssw,.871},H}; -N l31n21[]={{sgts,.585},{shm,.156},{ssh,.078},H}; -N l31n22[]={{sms,.351},{sXe7,.234},{sZsr,.273},{sxXhs,.208},{sgXs,.175},H}; -N l31n23[]={{sxmz,.156},H}; -N l31n26[]={{sXhig,.195},H}; -N l31n27[]={{szXg,.205},{srhsg,.273},H}; -N l31n28[]={{svr,.078},H}; -N l31n29[]={{sgq,.936},H}; -N l31n30[]={{sXs,.078},H}; -N l31n32[]={{sgQg,.175},{symx,.117},H}; -N l31n33[]={{sxig,.614},{sgXt,.263},{sZmX,.136},H}; -N l31n34[]={{stv,.208},{sgviw,.195},H}; -N l31n35[]={{srXg,.175},H}; -N l31n36[]={{sXe7Ts,.260},{sym,.117},{sgqy,.234},{swxm,.117},{sgwir,.195},H}; -N l31n37[]={{siZi,.136},H}; -N l31n39[]={{sqXm,.117},H}; -N l31n40[]={{smX,.390},{sXhs,.351},H}; -N l31n43[]={{suyig,.819},{srxsg,.468},H}; -N l31n44[]={{sqm,.221},H}; -N l31n45[]={{svs,.182},{sivg,.409},H}; -N l31n46[]={{sgr,.838},{ski,.078},H}; -N l31n47[]={{sXt,.117},H}; -N l31n48[]={{sgwiv,.312},{sgsw,.234},{smxs,.136},H}; -N l31n49[]={{shig,1.579},{se7Tsg,1.228},{srxX,.156},H}; -N l31n52[]={{sim,.247},{spg,.292},{sghiw,.312},H}; -N l31n54[]={{ssy,.234},{sgtv,.322},{skvX,.156},H}; -N l31n55[]={{sxXr,.136},H}; -N l31n56[]={{sgZs,.965},{sXrxi,.156},H}; -N l31n58[]={{srl,.078},{sgwig,.195},H}; -N l31n59[]={{sghig,1.638},{sgab,.253},H}; -N l31n60[]={{sTsg,2.040},H}; -N l31n61[]={{sYs,.065},H}; -N l31n62[]={{siwg,.760},{sky,.143},H}; -N l31n63[]={{svX,.793},{sgs,.643},H}; -N l31n64[]={{syig,.614},{sQg,.263},H}; -N l31n65[]={{sXY,.104},H}; -N l31n66[]={{sZsv,.117},H}; -N l31n67[]={{szm,.143},{stXvx,.130},H}; -N l31n68[]={{sgiq,.234},H}; -N l31n69[]={{sti,.156},H}; -N l31n70[]={{sxmZ,.117},H}; -N l31n71[]={{ssz,.104},H}; -N l31n72[]={{sgqX,.439},{sgws,.175},{sgYv,.175},H}; -N l31n73[]={{sghs,.731},{smv,.169},H}; -N l31n74[]={{smZ,.247},H}; -N l31n75[]={{syg,.409},{srm,.143},{sXpg,.263},{smqi,.156},H}; -N l31n76[]={{sws,.208},{sgrsw,.234},H}; -N l31n77[]={{sXvx,.097},H}; -N l31n79[]={{sYX,.104},H}; -N l31n80[]={{sgt,1.287},{sivm,.117},H}; -N l31n81[]={{sgX,1.482},{sXv,.598},{sf5iw,.395},{sxsv,.117},{smrh,.097},H}; -N l31n82[]={{sXZ,.169},{svmXg,.273},H}; -N l31n83[]={{sqg,.780},{sgrsg,.429},{sjm,.104},{sXww,.097},H}; -N l31n84[]={{sgyq,.322},{sRvm,.263},H}; -N l31n85[]={{sty,.078},H}; -N l31n86[]={{smwx,.195},{sXrxs,.156},H}; -N l31n87[]={{syp,.117},H}; -N l31n88[]={{sZsqs,.182},H}; -N l31n89[]={{sgrX,.322},{sgxs,.175},{sgZv,.146},H}; -N l31n90[]={{smw,.416},H}; -N l31n91[]={{sig,2.651},{smh,.221},H}; -N l31n92[]={{sZs,.585},{sXqg,.322},{sxsw,.214},{swir,.175},H}; -N l31n93[]={{srxi,.507},H}; -N l31n94[]={{swX,.208},H}; -N l31n95[]={{sgqym,.234},H}; -N l31n96[]={{sf5i,.263},{svv,.104},{siyg,.175},H}; -N l31n97[]={{sgu,.546},H}; -N l31n98[]={{sXw,.507},{sgY,.273},H}; -N l31n99[]={{sXh,.481},{ssvg,.380},{sxXv,.136},H}; -N l31n103[]={{sip,.195},{smswg,.234},H}; -N l31n104[]={{sguy,.819},{syq,.208},H}; -N l31n106[]={{se7X,.263},H}; -N l31n107[]={{sxs,.624},{smx,.195},{sgjs,.351},{sgtsv,.351},{sgYvX,.195},H}; -N l31n108[]={{shsw,.253},H}; -N l31n110[]={{sZX,.325},{sXpm,.117},H}; -N l31n112[]={{sYv,.117},H}; -N l31n114[]={{sgv,.409},{sZsrx,.234},{skm,.104},H}; -N l31n115[]={{sgZ,.994},{sXx,.143},{sps,.130},{ssqs,.136},H}; -N l31n116[]={{sswg,1.784},{suy,.442},{sviw,.312},{sgqi,.263},H}; -N l31n117[]={{smZX,.195},H}; -N l31n118[]={{smsg,.292},{sgXsg,.195},H}; -N l31n119[]={{sgyqX,.390},H}; -N l31n120[]={{siq,.299},H}; -N l31n121[]={{syr,.091},H}; -N l31n122[]={{sgxv,.175},H}; -N l31n123[]={{shs,.793},{sgtX,.614},{sqym,.117},H}; -N l31n124[]={{sXvX,.273},{smy,.065},H}; -N l31n125[]={{sxX,.585},H}; -N l31n126[]={{shXw,.136},H}; -N l31n127[]={{sgZsq,.507},H}; -N l31n128[]={{swZ,.065},H}; -N l31n130[]={{svx,.195},{sgZsr,.390},H}; -N l31n131[]={{sgw,1.131},{svi,.637},{sgqXm,.234},H}; -N l31n132[]={{sgh,2.008},H}; -N l31n133[]={{sirx,.487},{spX,.169},{sgri,.175},{sxe9,.065},H}; -N l31n134[]={{sgiw,.322},{smhX,.175},{ssvm,.117},H}; -N l31n135[]={{swxv,.136},H}; -N l31n136[]={{smXg,.409},{sXhsg,.390},{swiv,.175},H}; -N l31n137[]={{sir,.572},H}; -N l31n140[]={{svms,.214},H}; -N l31n141[]={{shX,.481},{smz,.117},{svsg,.175},H}; -N l31n142[]={{smk,.078},H}; -N l31n143[]={{sZv,.078},{sgpm,.146},H}; -N l31n144[]={{sww,.234},{sgswg,.312},H}; -N l31n145[]={{ssg,3.645},H}; -N l31n146[]={{sqs,.195},{sipX,.097},H}; -N l31n147[]={{syqX,.234},{sgmr,.292},{sxXrx,.156},{sYi,.078},H}; -N l31n148[]={{sgx,.760},H}; -N l31n149[]={{sgi,.897},{sXz,.091},{smqir,.156},H}; -N l31n150[]={{ssyg,.351},{smxX,.097},H}; -N l31n151[]={{sguyi,.936},H}; -N l31n155[]={{sYvX,.097},H}; -N l31n156[]={{syX,.130},H}; -N l31n157[]={{ssp,.130},H}; -N l31n158[]={{sxv,.247},H}; -N l31n159[]={{svXg,.643},{sgsg,.497},H}; -N l31n160[]={{sgqm,.263},H}; -N l31n161[]={{swx,.442},{sRvms,.351},H}; -N l31n162[]={{swi,.559},{sqir,.312},{srsw,.136},H}; -N l31n163[]={{sqt,.117},H}; -N l31n164[]={{sqX,.507},{sgiqg,.273},H}; -N l31n165[]={{sgy,.214},H}; -N l31n166[]={{sgj,.546},H}; -N l31n167[]={{sxiv,.175},{sgti,.234},H}; -N l31n169[]={{sghsg,.663},{szs,.143},{sXmw,.117},H}; -N l31n171[]={{sit,.078},H}; -N l31n174[]={{ssq,.312},H}; -N l31n175[]={{sghX,.497},H}; -N l31n177[]={{srs,.429},{sgXg,.702},{sXvg,.380},{sZx,.117},{sf5iwg,.790},H}; -N l31n178[]={{sZi,.234},{sxiw,.156},{smhXh,.182},{swy,.065},H}; -N l31n180[]={{sirxi,.286},H}; -N l31n182[]={{sgz,.234},{srxiw,.156},H}; -N l31n183[]={{sgk,.136},{sxyv,.097},H}; -N l31n184[]={{sXm,.208},H}; -N l31n185[]={{sjs,.182},{sgrXg,.234},H}; -N l31n186[]={{smwg,.322},{sXhi,.195},H}; -N l31n187[]={{ssrx,.253},{szX,.156},{srhs,.136},H}; -N l31n188[]={{sxswg,.429},H}; -N l31n189[]={{srxig,.507},{syv,.130},H}; -N l31n191[]={{ssr,.351},{sgxX,.263},H}; -N l31n192[]={{sgQ,.136},H}; -N l31n193[]={{sxi,.611},{spls,.117},{sgjsv,.195},H}; -N l31n194[]={{sXwg,.673},{shiw,.195},H}; -N l31n195[]={{srX,.260},H}; -N l31n196[]={{sviZ,.175},H}; -N l31n197[]={{sbbg,.351},{swTs,.097},H}; -N l31n199[]={{svm,.494},H}; -N l31n200[]={{sgl,.097},H}; -N l31n201[]={{sgvi,.526},{sxvX,.214},{spi,.117},{sxXh,.156},H}; -N l31n202[]={{se7Xg,.461},{siZx,.117},H}; -N l31n203[]={{suyi,.507},{sxsg,.673},{srxs,.331},H}; -N l31n204[]={{shswg,.507},{swxX,.234},H}; -N l31n205[]={{siv,.533},H}; -N l31n206[]={{siZ,.260},{syw,.078},{sZXg,.146},H}; -N l31n207[]={{siww,.156},H}; -N l31n209[]={{shi,1.027},{sgtXv,.585},{se7Ts,.614},{sxy,.156},{sRv,.175},H}; -N l31n210[]={{sirxs,.182},H}; -N l31n211[]={{ssqsg,.273},H}; -N l31n212[]={{sviwg,.234},{sXvm,.097},H}; -N l31n213[]={{stsv,.175},H}; -N l31n215[]={{sXe7T,.195},{smg,.136},{sqymx,.156},H}; -N l31n216[]={{siqg,.556},{sks,.091},H}; -N l31n217[]={{sgm,.351},{shXh,.195},{svxi,.117},H}; -N l31n218[]={{sgwi,.936},{siwx,.273},H}; -N l31n219[]={{sghi,1.696},{shsg,1.228},H}; -N l31n220[]={{sTs,.936},{sXvXg,.390},H}; -N l31n221[]={{sxXg,.205},H}; -N l31n222[]={{siw,.884},{shXwg,.273},H}; -N l31n223[]={{sXg,2.671},{sih,.104},{syx,.091},H}; -N l31n224[]={{syi,.364},H}; -N l31n226[]={{sgiwx,.273},H}; -N l31n227[]={{smp,.195},H}; -N l31n228[]={{sgqmp,.195},H}; -N l31n229[]={{srZ,.130},{sXwm,.097},{sziv,.097},H}; -N l31n230[]={{swm,.234},{sqmr,.136},H}; -N l31n231[]={{stXv,.331},{swwi,.097},H}; -N l31n232[]={{sqi,.377},{swivg,.273},H}; -N l31n234[]={{sgn,.117},H}; -N l31n235[]={{sXp,.351},{sgxi,.263},{sgtip,.195},H}; -N l31n236[]={{svmsg,.234},H}; -N l31n237[]={{shXg,.439},H}; -N l31n238[]={{svg,.897},{svXq,.117},H}; -N l31n239[]={{sts,.351},H}; -N l31n242[]={{svmX,.195},{sqsg,.234},H}; -N l31n243[]={{sgrs,.585},{syqXg,.468},H}; -N l31n244[]={{smq,.208},H}; -N l31n245[]={{sgig,.526},{srw,.104},H}; -N l31n246[]={{sZm,.299},{srh,.221},H}; -N l31n247[]={{sls,.156},{sXvmX,.130},H}; -N l31n248[]={{sqy,.130},{swxi,.097},H}; -N l31n249[]={{svXr,.097},H}; -N l31n252[]={{sXq,.338},{spl,.156},H}; -N l31n253[]={{siwxX,.182},H}; -N l31n254[]={{sqirx,.338},H}; -N l31n255[]={{szi,.195},{ssvx,.136},H}; - -D l31_d = -{ +S sTs[] = { 227, o, 0 }; +S sTsg[] = { 227, o, a }; +S sXe7[] = { 97, 231, 0 }; +S se7Tsg[] = { 231, 227, o, a }; +S se7Ts[] = { 231, 227, o, 0 }; +S se7T[] = { 231, 227, 0 }; +S shsw[] = { d, o, s, 0 }; +S shswg[] = { d, o, s, a }; +S syqX[] = { u, m, 97, 0 }; +S spl[] = { l, h, 0 }; +S syqXg[] = { u, m, 97, a }; +S srxsg[] = { n, t, o, a }; +S svms[] = { r, i, o, 0 }; +S sgrsg[] = { 32, n, o, a }; +S sxswg[] = { t, o, s, a }; +S sXhi[] = { 97, d, e, 0 }; +S sXe7Ts[] = { 97, 231, 227, o, 0 }; +S sXe7T[] = { 97, 231, 227, 0 }; +S sXvXg[] = { 97, r, 97, a }; +S shXh[] = { d, 97, d, 0 }; +S sgyqX[] = { 32, u, m, 97, 0 }; +S sXhsg[] = { 97, d, o, a }; +S sgtsv[] = { 32, p, o, r, 0 }; +S sZsrx[] = { 99, o, n, t, 0 }; +S stsv[] = { p, o, r, 0 }; +S smhX[] = { i, d, 97, 0 }; +S sf5i[] = { 245, e, 0 }; +S sf5iwg[] = { 245, e, s, a }; +S se7X[] = { 231, 97, 0 }; +S sf5iw[] = { 245, e, s, 0 }; +S sxXh[] = { t, 97, d, 0 }; +S sgswg[] = { 32, o, s, a }; +S sgiq[] = { 32, e, m, 0 }; +S sxiw[] = { t, e, s, 0 }; +S smqi[] = { i, m, e, 0 }; +S sxXhs[] = { t, 97, d, o, 0 }; +S sqsg[] = { m, o, a }; +S sirxs[] = { e, n, t, o, 0 }; +S siZi[] = { e, 99, e, 0 }; +S se7Xg[] = { 231, 97, a }; +S svmXg[] = { r, i, 97, a }; +S sgiqg[] = { 32, e, m, a }; +S shXhi[] = { d, 97, d, e, 0 }; +S sZsqs[] = { 99, o, m, o, 0 }; +S ssqsg[] = { o, m, o, a }; +S ssqs[] = { o, m, o, 0 }; +S smxs[] = { i, t, o, 0 }; +S smhXh[] = { i, d, 97, d, 0 }; +S sgrsw[] = { 32, n, o, s, 0 }; +S siyg[] = { e, u, a }; +S sxXrx[] = { t, 97, n, t, 0 }; +S srswg[] = { n, o, s, a }; +S srl[] = { n, h, 0 }; +S sqym[] = { m, u, i, 0 }; +S sXrxi[] = { 97, n, t, e, 0 }; +S sgXs[] = { 32, 97, o, 0 }; +S sRvms[] = { 225, r, i, o, 0 }; +S srxiw[] = { n, t, e, s, 0 }; +S svsg[] = { r, o, a }; +S svmsg[] = { r, i, o, a }; +S smsw[] = { i, o, s, 0 }; +S sgqym[] = { 32, m, u, i, 0 }; +S spls[] = { l, h, o, 0 }; +S sqymx[] = { m, u, i, t, 0 }; +S smswg[] = { i, o, s, a }; +S sXrxs[] = { 97, n, t, o, 0 }; +S sRvm[] = { 225, r, i, 0 }; +S sxmZ[] = { t, i, 99, 0 }; +S smqir[] = { i, m, e, n, 0 }; +S sxiwg[] = { t, e, s, a }; +S sgqmp[] = { 32, m, i, l, 0 }; +S sYvX[] = { 98, r, 97, 0 }; +S smZs[] = { i, 99, o, 0 }; +S sXwm[] = { 97, s, i, 0 }; +S sXhig[] = { 97, d, e, a }; +S sZXg[] = { 99, 97, a }; +S sgtip[] = { 32, p, e, l, 0 }; +S sXvmX[] = { 97, r, i, 97, 0 }; +S sgviw[] = { 32, r, e, s, 0 }; +S sgXsg[] = { 32, 97, o, a }; +S swTs[] = { s, 227, o, 0 }; +S sgwir[] = { 32, s, e, n, 0 }; +S sgYvX[] = { 32, 98, r, 97, 0 }; + +N l31n0[] = { { siy, .091 }, H }; +N l31n1[] = { { stX, .364 }, { smrx, .097 }, H }; +N l31n2[] = { { swig, .205 }, { srswg, .234 }, H }; +N l31n3[] = { { ssv, .585 }, H }; +N l31n4[] = { { sqXg, .409 }, { ssZ, .104 }, H }; +N l31n5[] = { { smr, .390 }, { sxm, .351 }, { ssqi, .117 }, H }; +N l31n6[] = { { srx, .767 }, H }; +N l31n7[] = { { sri, .130 }, { smsw, .117 }, H }; +N l31n8[] = { { sghXw, .273 }, { shXhi, .182 }, H }; +N l31n9[] = { { sXrx, .292 }, { sXmwg, .234 }, H }; +N l31n10[] = { { stXvX, .234 }, H }; +N l31n11[] = { { sZsq, .273 }, { skv, .130 }, { sgXr, .146 }, H }; +N l31n12[] = { { se7T, .409 }, { sgp, .253 }, H }; +N l31n13[] = { { swg, 2.495 }, { sXr, .390 }, { spm, .234 }, H }; +N l31n15[] = { { sghXg, .312 }, { smZs, .097 }, { sji, .065 }, H }; +N l31n17[] = { { srsg, .526 }, { siz, .065 }, H }; +N l31n18[] = { { sik, .117 }, { sxiwg, .234 }, H }; +N l31n20[] = { { ssw, .871 }, H }; +N l31n21[] = { { sgts, .585 }, { shm, .156 }, { ssh, .078 }, H }; +N l31n22[] = { { sms, .351 }, { sXe7, .234 }, { sZsr, .273 }, { sxXhs, .208 }, { sgXs, .175 }, H }; +N l31n23[] = { { sxmz, .156 }, H }; +N l31n26[] = { { sXhig, .195 }, H }; +N l31n27[] = { { szXg, .205 }, { srhsg, .273 }, H }; +N l31n28[] = { { svr, .078 }, H }; +N l31n29[] = { { sgq, .936 }, H }; +N l31n30[] = { { sXs, .078 }, H }; +N l31n32[] = { { sgQg, .175 }, { symx, .117 }, H }; +N l31n33[] = { { sxig, .614 }, { sgXt, .263 }, { sZmX, .136 }, H }; +N l31n34[] = { { stv, .208 }, { sgviw, .195 }, H }; +N l31n35[] = { { srXg, .175 }, H }; +N l31n36[] = { { sXe7Ts, .260 }, { sym, .117 }, { sgqy, .234 }, { swxm, .117 }, { sgwir, .195 }, H }; +N l31n37[] = { { siZi, .136 }, H }; +N l31n39[] = { { sqXm, .117 }, H }; +N l31n40[] = { { smX, .390 }, { sXhs, .351 }, H }; +N l31n43[] = { { suyig, .819 }, { srxsg, .468 }, H }; +N l31n44[] = { { sqm, .221 }, H }; +N l31n45[] = { { svs, .182 }, { sivg, .409 }, H }; +N l31n46[] = { { sgr, .838 }, { ski, .078 }, H }; +N l31n47[] = { { sXt, .117 }, H }; +N l31n48[] = { { sgwiv, .312 }, { sgsw, .234 }, { smxs, .136 }, H }; +N l31n49[] = { { shig, 1.579 }, { se7Tsg, 1.228 }, { srxX, .156 }, H }; +N l31n52[] = { { sim, .247 }, { spg, .292 }, { sghiw, .312 }, H }; +N l31n54[] = { { ssy, .234 }, { sgtv, .322 }, { skvX, .156 }, H }; +N l31n55[] = { { sxXr, .136 }, H }; +N l31n56[] = { { sgZs, .965 }, { sXrxi, .156 }, H }; +N l31n58[] = { { srl, .078 }, { sgwig, .195 }, H }; +N l31n59[] = { { sghig, 1.638 }, { sgab, .253 }, H }; +N l31n60[] = { { sTsg, 2.040 }, H }; +N l31n61[] = { { sYs, .065 }, H }; +N l31n62[] = { { siwg, .760 }, { sky, .143 }, H }; +N l31n63[] = { { svX, .793 }, { sgs, .643 }, H }; +N l31n64[] = { { syig, .614 }, { sQg, .263 }, H }; +N l31n65[] = { { sXY, .104 }, H }; +N l31n66[] = { { sZsv, .117 }, H }; +N l31n67[] = { { szm, .143 }, { stXvx, .130 }, H }; +N l31n68[] = { { sgiq, .234 }, H }; +N l31n69[] = { { sti, .156 }, H }; +N l31n70[] = { { sxmZ, .117 }, H }; +N l31n71[] = { { ssz, .104 }, H }; +N l31n72[] = { { sgqX, .439 }, { sgws, .175 }, { sgYv, .175 }, H }; +N l31n73[] = { { sghs, .731 }, { smv, .169 }, H }; +N l31n74[] = { { smZ, .247 }, H }; +N l31n75[] = { { syg, .409 }, { srm, .143 }, { sXpg, .263 }, { smqi, .156 }, H }; +N l31n76[] = { { sws, .208 }, { sgrsw, .234 }, H }; +N l31n77[] = { { sXvx, .097 }, H }; +N l31n79[] = { { sYX, .104 }, H }; +N l31n80[] = { { sgt, 1.287 }, { sivm, .117 }, H }; +N l31n81[] = { { sgX, 1.482 }, { sXv, .598 }, { sf5iw, .395 }, { sxsv, .117 }, { smrh, .097 }, H }; +N l31n82[] = { { sXZ, .169 }, { svmXg, .273 }, H }; +N l31n83[] = { { sqg, .780 }, { sgrsg, .429 }, { sjm, .104 }, { sXww, .097 }, H }; +N l31n84[] = { { sgyq, .322 }, { sRvm, .263 }, H }; +N l31n85[] = { { sty, .078 }, H }; +N l31n86[] = { { smwx, .195 }, { sXrxs, .156 }, H }; +N l31n87[] = { { syp, .117 }, H }; +N l31n88[] = { { sZsqs, .182 }, H }; +N l31n89[] = { { sgrX, .322 }, { sgxs, .175 }, { sgZv, .146 }, H }; +N l31n90[] = { { smw, .416 }, H }; +N l31n91[] = { { sig, 2.651 }, { smh, .221 }, H }; +N l31n92[] = { { sZs, .585 }, { sXqg, .322 }, { sxsw, .214 }, { swir, .175 }, H }; +N l31n93[] = { { srxi, .507 }, H }; +N l31n94[] = { { swX, .208 }, H }; +N l31n95[] = { { sgqym, .234 }, H }; +N l31n96[] = { { sf5i, .263 }, { svv, .104 }, { siyg, .175 }, H }; +N l31n97[] = { { sgu, .546 }, H }; +N l31n98[] = { { sXw, .507 }, { sgY, .273 }, H }; +N l31n99[] = { { sXh, .481 }, { ssvg, .380 }, { sxXv, .136 }, H }; +N l31n103[] = { { sip, .195 }, { smswg, .234 }, H }; +N l31n104[] = { { sguy, .819 }, { syq, .208 }, H }; +N l31n106[] = { { se7X, .263 }, H }; +N l31n107[] = { { sxs, .624 }, { smx, .195 }, { sgjs, .351 }, { sgtsv, .351 }, { sgYvX, .195 }, H }; +N l31n108[] = { { shsw, .253 }, H }; +N l31n110[] = { { sZX, .325 }, { sXpm, .117 }, H }; +N l31n112[] = { { sYv, .117 }, H }; +N l31n114[] = { { sgv, .409 }, { sZsrx, .234 }, { skm, .104 }, H }; +N l31n115[] = { { sgZ, .994 }, { sXx, .143 }, { sps, .130 }, { ssqs, .136 }, H }; +N l31n116[] = { { sswg, 1.784 }, { suy, .442 }, { sviw, .312 }, { sgqi, .263 }, H }; +N l31n117[] = { { smZX, .195 }, H }; +N l31n118[] = { { smsg, .292 }, { sgXsg, .195 }, H }; +N l31n119[] = { { sgyqX, .390 }, H }; +N l31n120[] = { { siq, .299 }, H }; +N l31n121[] = { { syr, .091 }, H }; +N l31n122[] = { { sgxv, .175 }, H }; +N l31n123[] = { { shs, .793 }, { sgtX, .614 }, { sqym, .117 }, H }; +N l31n124[] = { { sXvX, .273 }, { smy, .065 }, H }; +N l31n125[] = { { sxX, .585 }, H }; +N l31n126[] = { { shXw, .136 }, H }; +N l31n127[] = { { sgZsq, .507 }, H }; +N l31n128[] = { { swZ, .065 }, H }; +N l31n130[] = { { svx, .195 }, { sgZsr, .390 }, H }; +N l31n131[] = { { sgw, 1.131 }, { svi, .637 }, { sgqXm, .234 }, H }; +N l31n132[] = { { sgh, 2.008 }, H }; +N l31n133[] = { { sirx, .487 }, { spX, .169 }, { sgri, .175 }, { sxe9, .065 }, H }; +N l31n134[] = { { sgiw, .322 }, { smhX, .175 }, { ssvm, .117 }, H }; +N l31n135[] = { { swxv, .136 }, H }; +N l31n136[] = { { smXg, .409 }, { sXhsg, .390 }, { swiv, .175 }, H }; +N l31n137[] = { { sir, .572 }, H }; +N l31n140[] = { { svms, .214 }, H }; +N l31n141[] = { { shX, .481 }, { smz, .117 }, { svsg, .175 }, H }; +N l31n142[] = { { smk, .078 }, H }; +N l31n143[] = { { sZv, .078 }, { sgpm, .146 }, H }; +N l31n144[] = { { sww, .234 }, { sgswg, .312 }, H }; +N l31n145[] = { { ssg, 3.645 }, H }; +N l31n146[] = { { sqs, .195 }, { sipX, .097 }, H }; +N l31n147[] = { { syqX, .234 }, { sgmr, .292 }, { sxXrx, .156 }, { sYi, .078 }, H }; +N l31n148[] = { { sgx, .760 }, H }; +N l31n149[] = { { sgi, .897 }, { sXz, .091 }, { smqir, .156 }, H }; +N l31n150[] = { { ssyg, .351 }, { smxX, .097 }, H }; +N l31n151[] = { { sguyi, .936 }, H }; +N l31n155[] = { { sYvX, .097 }, H }; +N l31n156[] = { { syX, .130 }, H }; +N l31n157[] = { { ssp, .130 }, H }; +N l31n158[] = { { sxv, .247 }, H }; +N l31n159[] = { { svXg, .643 }, { sgsg, .497 }, H }; +N l31n160[] = { { sgqm, .263 }, H }; +N l31n161[] = { { swx, .442 }, { sRvms, .351 }, H }; +N l31n162[] = { { swi, .559 }, { sqir, .312 }, { srsw, .136 }, H }; +N l31n163[] = { { sqt, .117 }, H }; +N l31n164[] = { { sqX, .507 }, { sgiqg, .273 }, H }; +N l31n165[] = { { sgy, .214 }, H }; +N l31n166[] = { { sgj, .546 }, H }; +N l31n167[] = { { sxiv, .175 }, { sgti, .234 }, H }; +N l31n169[] = { { sghsg, .663 }, { szs, .143 }, { sXmw, .117 }, H }; +N l31n171[] = { { sit, .078 }, H }; +N l31n174[] = { { ssq, .312 }, H }; +N l31n175[] = { { sghX, .497 }, H }; +N l31n177[] = { { srs, .429 }, { sgXg, .702 }, { sXvg, .380 }, { sZx, .117 }, { sf5iwg, .790 }, H }; +N l31n178[] = { { sZi, .234 }, { sxiw, .156 }, { smhXh, .182 }, { swy, .065 }, H }; +N l31n180[] = { { sirxi, .286 }, H }; +N l31n182[] = { { sgz, .234 }, { srxiw, .156 }, H }; +N l31n183[] = { { sgk, .136 }, { sxyv, .097 }, H }; +N l31n184[] = { { sXm, .208 }, H }; +N l31n185[] = { { sjs, .182 }, { sgrXg, .234 }, H }; +N l31n186[] = { { smwg, .322 }, { sXhi, .195 }, H }; +N l31n187[] = { { ssrx, .253 }, { szX, .156 }, { srhs, .136 }, H }; +N l31n188[] = { { sxswg, .429 }, H }; +N l31n189[] = { { srxig, .507 }, { syv, .130 }, H }; +N l31n191[] = { { ssr, .351 }, { sgxX, .263 }, H }; +N l31n192[] = { { sgQ, .136 }, H }; +N l31n193[] = { { sxi, .611 }, { spls, .117 }, { sgjsv, .195 }, H }; +N l31n194[] = { { sXwg, .673 }, { shiw, .195 }, H }; +N l31n195[] = { { srX, .260 }, H }; +N l31n196[] = { { sviZ, .175 }, H }; +N l31n197[] = { { sbbg, .351 }, { swTs, .097 }, H }; +N l31n199[] = { { svm, .494 }, H }; +N l31n200[] = { { sgl, .097 }, H }; +N l31n201[] = { { sgvi, .526 }, { sxvX, .214 }, { spi, .117 }, { sxXh, .156 }, H }; +N l31n202[] = { { se7Xg, .461 }, { siZx, .117 }, H }; +N l31n203[] = { { suyi, .507 }, { sxsg, .673 }, { srxs, .331 }, H }; +N l31n204[] = { { shswg, .507 }, { swxX, .234 }, H }; +N l31n205[] = { { siv, .533 }, H }; +N l31n206[] = { { siZ, .260 }, { syw, .078 }, { sZXg, .146 }, H }; +N l31n207[] = { { siww, .156 }, H }; +N l31n209[] = { { shi, 1.027 }, { sgtXv, .585 }, { se7Ts, .614 }, { sxy, .156 }, { sRv, .175 }, H }; +N l31n210[] = { { sirxs, .182 }, H }; +N l31n211[] = { { ssqsg, .273 }, H }; +N l31n212[] = { { sviwg, .234 }, { sXvm, .097 }, H }; +N l31n213[] = { { stsv, .175 }, H }; +N l31n215[] = { { sXe7T, .195 }, { smg, .136 }, { sqymx, .156 }, H }; +N l31n216[] = { { siqg, .556 }, { sks, .091 }, H }; +N l31n217[] = { { sgm, .351 }, { shXh, .195 }, { svxi, .117 }, H }; +N l31n218[] = { { sgwi, .936 }, { siwx, .273 }, H }; +N l31n219[] = { { sghi, 1.696 }, { shsg, 1.228 }, H }; +N l31n220[] = { { sTs, .936 }, { sXvXg, .390 }, H }; +N l31n221[] = { { sxXg, .205 }, H }; +N l31n222[] = { { siw, .884 }, { shXwg, .273 }, H }; +N l31n223[] = { { sXg, 2.671 }, { sih, .104 }, { syx, .091 }, H }; +N l31n224[] = { { syi, .364 }, H }; +N l31n226[] = { { sgiwx, .273 }, H }; +N l31n227[] = { { smp, .195 }, H }; +N l31n228[] = { { sgqmp, .195 }, H }; +N l31n229[] = { { srZ, .130 }, { sXwm, .097 }, { sziv, .097 }, H }; +N l31n230[] = { { swm, .234 }, { sqmr, .136 }, H }; +N l31n231[] = { { stXv, .331 }, { swwi, .097 }, H }; +N l31n232[] = { { sqi, .377 }, { swivg, .273 }, H }; +N l31n234[] = { { sgn, .117 }, H }; +N l31n235[] = { { sXp, .351 }, { sgxi, .263 }, { sgtip, .195 }, H }; +N l31n236[] = { { svmsg, .234 }, H }; +N l31n237[] = { { shXg, .439 }, H }; +N l31n238[] = { { svg, .897 }, { svXq, .117 }, H }; +N l31n239[] = { { sts, .351 }, H }; +N l31n242[] = { { svmX, .195 }, { sqsg, .234 }, H }; +N l31n243[] = { { sgrs, .585 }, { syqXg, .468 }, H }; +N l31n244[] = { { smq, .208 }, H }; +N l31n245[] = { { sgig, .526 }, { srw, .104 }, H }; +N l31n246[] = { { sZm, .299 }, { srh, .221 }, H }; +N l31n247[] = { { sls, .156 }, { sXvmX, .130 }, H }; +N l31n248[] = { { sqy, .130 }, { swxi, .097 }, H }; +N l31n249[] = { { svXr, .097 }, H }; +N l31n252[] = { { sXq, .338 }, { spl, .156 }, H }; +N l31n253[] = { { siwxX, .182 }, H }; +N l31n254[] = { { sqirx, .338 }, H }; +N l31n255[] = { { szi, .195 }, { ssvx, .136 }, H }; + +D l31_d = { "portuguese", "iso-8859-15", - { - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,0.236,0.020,0.072,0.104,0.218,0.021,0.024,0.014,0.140,0.005,W,0.050,0.088,0.103,0.221, - 0.055,0.018,0.139,0.160,0.109,0.076,0.028,0.001,0.006,0.001,0.004,W,W,W,W,W, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,0.010,Y,Y,Y,Y, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,0.009,Y,Y,Y,Y, - Y,0.002,V,V,V,V,V,V,V,V,V,V,V,V,V,V, - V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V, - 0.008,0.019,0.001,0.037,V,V,V,0.037,V,0.025,0.004,V,V,0.018,V,V, - V,V,V,0.005,V,0.011,V,V,V,V,0.002,V,V,V,V,V - }, - { - l31n0,l31n1,l31n2,l31n3,l31n4,l31n5,l31n6,l31n7,l31n8,l31n9,l31n10,l31n11,l31n12,l31n13,X,l31n15, - X,l31n17,l31n18,X,l31n20,l31n21,l31n22,l31n23,X,X,l31n26,l31n27,l31n28,l31n29,l31n30,X, - l31n32,l31n33,l31n34,l31n35,l31n36,l31n37,X,l31n39,l31n40,X,X,l31n43,l31n44,l31n45,l31n46,l31n47, - l31n48,l31n49,X,X,l31n52,X,l31n54,l31n55,l31n56,X,l31n58,l31n59,l31n60,l31n61,l31n62,l31n63, - l31n64,l31n65,l31n66,l31n67,l31n68,l31n69,l31n70,l31n71,l31n72,l31n73,l31n74,l31n75,l31n76,l31n77,X,l31n79, - l31n80,l31n81,l31n82,l31n83,l31n84,l31n85,l31n86,l31n87,l31n88,l31n89,l31n90,l31n91,l31n92,l31n93,l31n94,l31n95, - l31n96,l31n97,l31n98,l31n99,X,X,X,l31n103,l31n104,X,l31n106,l31n107,l31n108,X,l31n110,X, - l31n112,X,l31n114,l31n115,l31n116,l31n117,l31n118,l31n119,l31n120,l31n121,l31n122,l31n123,l31n124,l31n125,l31n126,l31n127, - l31n128,X,l31n130,l31n131,l31n132,l31n133,l31n134,l31n135,l31n136,l31n137,X,X,l31n140,l31n141,l31n142,l31n143, - l31n144,l31n145,l31n146,l31n147,l31n148,l31n149,l31n150,l31n151,X,X,X,l31n155,l31n156,l31n157,l31n158,l31n159, - l31n160,l31n161,l31n162,l31n163,l31n164,l31n165,l31n166,l31n167,X,l31n169,X,l31n171,X,X,l31n174,l31n175, - X,l31n177,l31n178,X,l31n180,X,l31n182,l31n183,l31n184,l31n185,l31n186,l31n187,l31n188,l31n189,X,l31n191, - l31n192,l31n193,l31n194,l31n195,l31n196,l31n197,X,l31n199,l31n200,l31n201,l31n202,l31n203,l31n204,l31n205,l31n206,l31n207, - X,l31n209,l31n210,l31n211,l31n212,l31n213,X,l31n215,l31n216,l31n217,l31n218,l31n219,l31n220,l31n221,l31n222,l31n223, - l31n224,X,l31n226,l31n227,l31n228,l31n229,l31n230,l31n231,l31n232,X,l31n234,l31n235,l31n236,l31n237,l31n238,l31n239, - X,X,l31n242,l31n243,l31n244,l31n245,l31n246,l31n247,l31n248,l31n249,X,X,l31n252,l31n253,l31n254,l31n255 - } + { W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, 0.236, 0.020, 0.072, 0.104, 0.218, 0.021, 0.024, 0.014, 0.140, 0.005, W, 0.050, 0.088, 0.103, 0.221, + 0.055, 0.018, 0.139, 0.160, 0.109, 0.076, 0.028, 0.001, 0.006, 0.001, 0.004, W, W, W, W, W, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, 0.010, Y, Y, Y, Y, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, 0.009, Y, Y, Y, Y, + Y, 0.002, V, V, V, V, V, V, V, V, V, V, V, V, V, V, + V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, + 0.008, 0.019, 0.001, 0.037, V, V, V, 0.037, V, 0.025, 0.004, V, V, 0.018, V, V, + V, V, V, 0.005, V, 0.011, V, V, V, V, 0.002, V, V, V, V, V }, + { l31n0, l31n1, l31n2, l31n3, l31n4, l31n5, l31n6, l31n7, l31n8, l31n9, l31n10, l31n11, l31n12, l31n13, X, l31n15, + X, l31n17, l31n18, X, l31n20, l31n21, l31n22, l31n23, X, X, l31n26, l31n27, l31n28, l31n29, l31n30, X, + l31n32, l31n33, l31n34, l31n35, l31n36, l31n37, X, l31n39, l31n40, X, X, l31n43, l31n44, l31n45, l31n46, l31n47, + l31n48, l31n49, X, X, l31n52, X, l31n54, l31n55, l31n56, X, l31n58, l31n59, l31n60, l31n61, l31n62, l31n63, + l31n64, l31n65, l31n66, l31n67, l31n68, l31n69, l31n70, l31n71, l31n72, l31n73, l31n74, l31n75, l31n76, l31n77, X, l31n79, + l31n80, l31n81, l31n82, l31n83, l31n84, l31n85, l31n86, l31n87, l31n88, l31n89, l31n90, l31n91, l31n92, l31n93, l31n94, l31n95, + l31n96, l31n97, l31n98, l31n99, X, X, X, l31n103, l31n104, X, l31n106, l31n107, l31n108, X, l31n110, X, + l31n112, X, l31n114, l31n115, l31n116, l31n117, l31n118, l31n119, l31n120, l31n121, l31n122, l31n123, l31n124, l31n125, l31n126, l31n127, + l31n128, X, l31n130, l31n131, l31n132, l31n133, l31n134, l31n135, l31n136, l31n137, X, X, l31n140, l31n141, l31n142, l31n143, + l31n144, l31n145, l31n146, l31n147, l31n148, l31n149, l31n150, l31n151, X, X, X, l31n155, l31n156, l31n157, l31n158, l31n159, + l31n160, l31n161, l31n162, l31n163, l31n164, l31n165, l31n166, l31n167, X, l31n169, X, l31n171, X, X, l31n174, l31n175, + X, l31n177, l31n178, X, l31n180, X, l31n182, l31n183, l31n184, l31n185, l31n186, l31n187, l31n188, l31n189, X, l31n191, + l31n192, l31n193, l31n194, l31n195, l31n196, l31n197, X, l31n199, l31n200, l31n201, l31n202, l31n203, l31n204, l31n205, l31n206, l31n207, + X, l31n209, l31n210, l31n211, l31n212, l31n213, X, l31n215, l31n216, l31n217, l31n218, l31n219, l31n220, l31n221, l31n222, l31n223, + l31n224, X, l31n226, l31n227, l31n228, l31n229, l31n230, l31n231, l31n232, X, l31n234, l31n235, l31n236, l31n237, l31n238, l31n239, + X, X, l31n242, l31n243, l31n244, l31n245, l31n246, l31n247, l31n248, l31n249, X, X, l31n252, l31n253, l31n254, l31n255 } }; - - // // Lng: romanian // Enc: iso-8859-2 // - -S sZXv[]={99,97,r,0}; -S sZXvi[]={99,97,r,e,0}; -S sypg[]={u,l,a}; -S smmg[]={i,i,a}; -S sXxX[]={97,t,97,0}; -S siwxi[]={e,s,t,e,0}; -S sXxXg[]={97,t,97,a}; -S sgZXv[]={32,99,97,r,0}; -S sgZyg[]={32,99,u,a}; -S stig[]={p,e,a}; -S sXZi[]={97,99,e,0}; -S sgtig[]={32,p,e,a}; -S spym[]={l,u,i,0}; -S sgZXg[]={32,99,97,a}; -S spymg[]={l,u,i,a}; -S sZmg[]={99,i,a}; -S ssXv[]={o,97,r,0}; -S sipig[]={e,l,e,a}; -S srxv[]={n,t,r,0}; -S sZip[]={99,e,l,0}; -S sgwXg[]={32,s,97,a}; -S sgryg[]={32,n,u,a}; -S sypym[]={u,l,u,i,0}; -S sghmr[]={32,d,i,n,0}; -S sgpy[]={32,l,u,0}; -S sxvy[]={t,r,u,0}; -S sqyp[]={m,u,l,0}; -S sgXZi[]={32,97,99,e,0}; -S spsvg[]={l,o,r,a}; -S sqXmg[]={m,97,i,a}; -S syri[]={u,n,e,0}; -S smrm[]={i,n,i,0}; -S spsv[]={l,o,r,0}; -S sXxsv[]={97,t,o,r,0}; -S sxmr[]={t,i,n,0}; -S sxyp[]={t,u,l,0}; -S stmr[]={p,i,n,0}; -S sgZip[]={32,99,e,l,0}; -S smpsv[]={i,l,o,r,0}; -S srxXg[]={n,t,97,a}; -S sgty[]={32,p,u,0}; -S swZg[]={s,99,a}; -S ssXw[]={o,97,s,0}; -S siwZg[]={e,s,99,a}; -S ssXvi[]={o,97,r,e,0}; -S smrxv[]={i,n,t,r,0}; -S shmrg[]={d,i,n,a}; -S srxm[]={n,t,i,0}; -S smqt[]={i,m,p,0}; -S smXx[]={i,97,t,0}; -S svyp[]={r,u,l,0}; -S sxmig[]={t,i,e,a}; -S ssqy[]={o,m,u,0}; -S sXxig[]={97,t,e,a}; -S ssvq[]={o,r,m,0}; -S sgvX[]={32,r,97,0}; -S svxm[]={r,t,i,0}; -S sqmrx[]={m,i,n,t,0}; -S sjXvX[]={f,97,r,97,0}; -S stXg[]={p,97,a}; -S srim[]={n,e,i,0}; -S smxm[]={i,t,i,0}; -S stpm[]={p,l,i,0}; -S sxsvm[]={t,o,r,i,0}; -S svxX[]={r,t,97,0}; -S siZm[]={e,99,i,0}; -S svypg[]={r,u,l,a}; -S sgtp[]={32,p,l,0}; -S sxmm[]={t,i,i,0}; -S swxXx[]={s,t,97,t,0}; -S smrig[]={i,n,e,a}; -S spXv[]={l,97,r,0}; -S srimg[]={n,e,i,a}; -S smsX[]={i,o,97,0}; -S syxX[]={u,t,97,0}; - -N l32n0[]={{siy,.078},H}; -N l32n1[]={{smrx,.466},{stX,.311},{swxg,.175},H}; -N l32n2[]={{swig,.524},H}; -N l32n3[]={{ssv,.518},H}; -N l32n4[]={{ssZ,.104},{sqXg,.233},{syrXg,.194},H}; -N l32n5[]={{smr,1.346},{sxm,.660},{svxm,.117},H}; -N l32n6[]={{srx,.544},{sgwm,.990},H}; -N l32n7[]={{sri,.337},{sgtig,.544},{sghm,.320},H}; -N l32n8[]={{sXvig,1.126},H}; -N l32n9[]={{siwxi,.466},H}; -N l32n10[]={{syxX,.097},H}; -N l32n11[]={{svq,.091},{skv,.078},H}; -N l32n12[]={{sgp,.583},{siXg,.350},H}; -N l32n13[]={{sXr,.337},{spm,.311},{swg,.136},{sgzi,.175},H}; -N l32n14[]={{sgwXg,.388},{sgZip,.233},H}; -N l32n15[]={{sji,.155},{sgst,.175},H}; -N l32n16[]={{smmg,.524},{sswx,.155},H}; -N l32n18[]={{sZig,.379},H}; -N l32n19[]={{sgpy,.262},H}; -N l32n20[]={{ssw,.155},H}; -N l32n21[]={{shm,.168},{sgts,.262},H}; -N l32n22[]={{sms,.168},H}; -N l32n23[]={{sry,.194},{sgxm,.175},H}; -N l32n24[]={{sXmg,.350},H}; -N l32n29[]={{sgq,.874},{sZg,.214},H}; -N l32n30[]={{sipig,.427},H}; -N l32n31[]={{siwZ,.136},H}; -N l32n33[]={{sxig,.961},H}; -N l32n34[]={{sZyg,.524},{stv,.207},H}; -N l32n35[]={{srXg,.437},H}; -N l32n36[]={{sym,.233},{smXx,.117},{sgqy,.175},{sivi,.097},{swxm,.097},H}; -N l32n37[]={{ssx,.168},{sgsv,.233},H}; -N l32n39[]={{sqXm,.155},{svmg,.204},{sgjXv,.194},{sXqX,.097},H}; -N l32n40[]={{smX,.388},{swxXx,.129},H}; -N l32n41[]={{spig,.495},{srk,.104},{sgjm,.175},H}; -N l32n42[]={{sXxig,.233},H}; -N l32n44[]={{sxg,.893},{sqm,.168},H}; -N l32n45[]={{svs,.104},H}; -N l32n46[]={{sgr,.427},{ski,.078},{ssvX,.097},H}; -N l32n47[]={{sXt,.194},{shmrg,.233},H}; -N l32n48[]={{smrX,.136},H}; -N l32n49[]={{shig,1.369},{srxX,.136},H}; -N l32n52[]={{spg,.680},{sim,.324},H}; -N l32n53[]={{sgry,.320},H}; -N l32n54[]={{sgtv,.233},H}; -N l32n55[]={{sgpX,.379},{sgXv,.262},{svyp,.117},{s7aX,.065},H}; -N l32n56[]={{sgZs,.350},{sXxs,.136},H}; -N l32n58[]={{sgwig,.466},H}; -N l32n59[]={{sghig,1.515},H}; -N l32n60[]={{shg,.136},H}; -N l32n61[]={{sYs,.078},H}; -N l32n63[]={{svX,.803},{sgs,.854},{stpm,.097},H}; -N l32n65[]={{smsX,.097},H}; -N l32n66[]={{sqmrx,.129},H}; -N l32n67[]={{stmr,.136},{szm,.078},H}; -N l32n68[]={{stx,.078},H}; -N l32n69[]={{sti,.324},H}; -N l32n70[]={{swmg,.874},H}; -N l32n72[]={{sgqX,.757},{ssk,.078},H}; -N l32n73[]={{smv,.142},{sghs,.233},H}; -N l32n74[]={{smZ,.324},H}; -N l32n75[]={{syg,.990},{srm,.375},H}; -N l32n76[]={{sws,.078},H}; -N l32n77[]={{sXvx,.136},{srhi,.136},H}; -N l32n79[]={{sYX,.078},H}; -N l32n80[]={{sgt,1.321},{sivm,.117},H}; -N l32n81[]={{sXv,1.126},{sgX,1.379},{sghmr,.350},{smrh,.155},{sxsv,.136},{siZm,.097},H}; -N l32n82[]={{sXZ,.311},H}; -N l32n83[]={{sqg,.175},{sjm,.104},H}; -N l32n84[]={{sZXv,.408},H}; -N l32n85[]={{sty,.129},{si7a,.078},H}; -N l32n86[]={{sZmg,.350},{sZip,.194},H}; -N l32n87[]={{syp,.531},{sgty,.175},{smrxv,.155},H}; -N l32n88[]={{swxig,.621},H}; -N l32n89[]={{spsv,.155},{sgxs,.204},H}; -N l32n90[]={{smw,.168},H}; -N l32n91[]={{sig,4.195},{smh,.078},H}; -N l32n92[]={{sZs,.220},{spym,.252},{sxmi,.155},{smri,.155},H}; -N l32n94[]={{swX,.272},{sypy,.194},{sXwx,.136},{sqXr,.117},H}; -N l32n95[]={{sgyr,.728},H}; -N l32n97[]={{stXg,.146},{svZ,.065},H}; -N l32n98[]={{sXw,.350},{sgY,.330},H}; -N l32n99[]={{ssvg,.350},{sXh,.104},H}; -N l32n101[]={{smrg,.961},{sxmg,.291},H}; -N l32n102[]={{sgwmg,1.088},{srxg,.175},H}; -N l32n103[]={{sip,.427},{srig,.350},{sxsx,.136},H}; -N l32n104[]={{syq,.142},H}; -N l32n107[]={{sxs,.259},{smx,.259},{sgjs,.291},{spXv,.097},H}; -N l32n108[]={{smi,.259},H}; -N l32n110[]={{sZX,.673},H}; -N l32n114[]={{srg,1.068},{sgv,.311},{skm,.104},H}; -N l32n115[]={{sgZ,2.020},{sXx,.803},{sps,.220},H}; -N l32n116[]={{sviw,.136},H}; -N l32n117[]={{sxyp,.136},H}; -N l32n119[]={{sryg,.291},H}; -N l32n120[]={{siq,.104},H}; -N l32n121[]={{syr,.596},{sxXx,.214},{stvi,.097},H}; -N l32n122[]={{sgZy,.583},{sgxv,.233},H}; -N l32n123[]={{sgtX,.350},{shs,.117},{sYmp,.097},H}; -N l32n124[]={{sXvX,.330},{smy,.129},H}; -N l32n125[]={{sxX,.699},H}; -N l32n127[]={{sgwx,.262},{siwZg,.233},H}; -N l32n128[]={{swZ,.168},H}; -N l32n130[]={{svx,.194},H}; -N l32n131[]={{sgw,1.806},{svi,.932},{sZXvi,.492},{sgqXm,.272},H}; -N l32n132[]={{sgh,1.728},{sXy,.233},{symg,.466},H}; -N l32n133[]={{spX,.479},{sirx,.214},H}; -N l32n134[]={{sgiw,.291},{ssvm,.175},H}; -N l32n135[]={{sqXmg,.311},{swxv,.155},H}; -N l32n136[]={{smXg,.379},{smrm,.155},{sxmm,.097},H}; -N l32n137[]={{sir,.246},{stm,.168},{shXx,.175},{srxm,.117},H}; -N l32n138[]={{sqXv,.194},{srim,.097},H}; -N l32n140[]={{srmZ,.155},{sxsvm,.129},H}; -N l32n141[]={{shX,.337},{smz,.091},H}; -N l32n142[]={{sXxsv,.181},{sXhX,.117},H}; -N l32n143[]={{sZv,.091},H}; -N l32n144[]={{sXrm,.136},{smrXg,.233},H}; -N l32n145[]={{ssg,.388},{slm,.117},{srxXg,.233},H}; -N l32n146[]={{sgXZ,.350},{sqs,.117},{sipX,.097},H}; -N l32n147[]={{sgmr,1.282},{svy,.207},H}; -N l32n148[]={{sgx,.621},{simg,.553},H}; -N l32n149[]={{sgi,.602},{sgryg,.350},H}; -N l32n150[]={{sXk,.078},H}; -N l32n151[]={{sgpXg,.427},{svypg,.194},H}; -N l32n153[]={{sypym,.233},H}; -N l32n155[]={{syt,.078},H}; -N l32n156[]={{sqyp,.155},H}; -N l32n157[]={{ssp,.129},{sgvX,.175},H}; -N l32n158[]={{sgZX,1.194},{sxv,.440},{sXxX,.350},{sgqXv,.311},H}; -N l32n159[]={{svXg,.699},{sgsg,.553},H}; -N l32n160[]={{swmr,.136},H}; -N l32n161[]={{swx,.699},H}; -N l32n162[]={{swi,.414},H}; -N l32n163[]={{sqt,.091},{sYy,.078},H}; -N l32n164[]={{sqX,.505},{syrX,.136},H}; -N l32n165[]={{sgy,.602},{stig,.466},{sxvy,.155},{stvm,.136},H}; -N l32n166[]={{sgj,.738},H}; -N l32n167[]={{sgti,.612},H}; -N l32n168[]={{sXvi,.719},{smps,.136},H}; -N l32n169[]={{sXZi,.272},{szs,.065},H}; -N l32n172[]={{siX,.427},H}; -N l32n173[]={{svxX,.097},H}; -N l32n174[]={{ssq,.207},{sgwX,.437},{sviX,.136},H}; -N l32n175[]={{sghX,.408},H}; -N l32n176[]={{smm,.272},H}; -N l32n177[]={{sgXg,.291},{sXvg,.204},{sjXv,.136},{srs,.078},H}; -N l32n178[]={{sZi,.544},{swy,.117},{ssvq,.117},H}; -N l32n181[]={{sgxsx,.233},{ssqy,.117},H}; -N l32n182[]={{sgz,.330},H}; -N l32n183[]={{sypg,.524},{sgk,.175},H}; -N l32n184[]={{sXm,.246},{sgXyg,.194},H}; -N l32n185[]={{sjs,.155},{spsvg,.311},H}; -N l32n188[]={{spymg,.466},{stp,.091},{sxmig,.233},{smrig,.194},H}; -N l32n189[]={{syv,.181},H}; -N l32n190[]={{swXg,.408},{sipi,.233},H}; -N l32n191[]={{sgyrg,.505},{s7am,.168},{ssr,.117},{sxmr,.136},H}; -N l32n193[]={{sxi,.647},{sgXZi,.311},H}; -N l32n194[]={{sZy,.375},H}; -N l32n195[]={{srX,.259},H}; -N l32n196[]={{smqt,.117},H}; -N l32n199[]={{svm,.531},{sipg,.175},{spmr,.117},H}; -N l32n200[]={{ssXv,.233},{spx,.091},{sgl,.097},H}; -N l32n201[]={{spi,.337},{sxvX,.272},{sgvi,.175},H}; -N l32n202[]={{sgZi,.466},{sXxi,.155},H}; -N l32n203[]={{sjX,.207},{smxg,.262},H}; -N l32n204[]={{smig,.320},{swxX,.194},H}; -N l32n205[]={{siv,.311},{smZm,.194},{swiX,.117},H}; -N l32n206[]={{sZXg,.466},{siZ,.129},H}; -N l32n207[]={{shmr,.175},H}; -N l32n208[]={{syri,.155},H}; -N l32n209[]={{shi,.867},{sxy,.181},{sgjX,.350},{sgtXv,.233},H}; -N l32n211[]={{sXxg,.350},{ssXw,.117},{sgtm,.146},H}; -N l32n212[]={{sXvm,.117},{sjXvX,.129},H}; -N l32n215[]={{smg,2.758},{sYm,.155},H}; -N l32n217[]={{sgm,1.068},{spy,.311},{syrg,.524},{sX7a,.091},H}; -N l32n218[]={{siwx,.447},{sgwi,.583},{sgZyg,.660},H}; -N l32n219[]={{sghi,1.427},H}; -N l32n220[]={{sXvXg,.544},H}; -N l32n221[]={{sxXg,1.049},H}; -N l32n222[]={{siw,.492},H}; -N l32n223[]={{sXg,3.748},{syx,.155},H}; -N l32n224[]={{swZg,.175},H}; -N l32n225[]={{sst,.129},{shy,.078},H}; -N l32n226[]={{ssX,.388},{sgiwx,.388},{sgqs,.175},H}; -N l32n227[]={{svig,.961},{smp,.246},H}; -N l32n228[]={{sXyg,.379},H}; -N l32n229[]={{spXg,.641},{srZ,.104},{sZl,.091},H}; -N l32n230[]={{swm,.608},{sqmr,.136},H}; -N l32n231[]={{stXv,.175},H}; -N l32n232[]={{sqi,.220},H}; -N l32n234[]={{skX,.129},{srimg,.194},H}; -N l32n235[]={{sXp,.259},H}; -N l32n236[]={{srxv,.194},{sjv,.078},H}; -N l32n237[]={{shXg,.204},H}; -N l32n238[]={{svg,.447},{smxm,.097},H}; -N l32n239[]={{sts,.155},{six,.142},{sgmrx,.427},H}; -N l32n243[]={{sgmrg,.777},H}; -N l32n244[]={{sgZXv,.660},{smq,.129},{sgtp,.146},H}; -N l32n245[]={{srw,.117},{sgig,.233},{sxvi,.117},H}; -N l32n246[]={{sZm,.427},{srh,.168},{sXxm,.175},{sgZm,.204},H}; -N l32n247[]={{ssXvi,.155},H}; -N l32n248[]={{swxi,.427},{sqy,.168},H}; -N l32n249[]={{svXr,.136},H}; -N l32n250[]={{sg7a,.117},H}; -N l32n252[]={{sXq,.220},H}; -N l32n254[]={{sXxXg,.660},{sgZXg,.505},{smpsv,.155},H}; -N l32n255[]={{szi,.155},H}; - -D l32_d = -{ +S sZXv[] = { 99, 97, r, 0 }; +S sZXvi[] = { 99, 97, r, e, 0 }; +S sypg[] = { u, l, a }; +S smmg[] = { i, i, a }; +S sXxX[] = { 97, t, 97, 0 }; +S siwxi[] = { e, s, t, e, 0 }; +S sXxXg[] = { 97, t, 97, a }; +S sgZXv[] = { 32, 99, 97, r, 0 }; +S sgZyg[] = { 32, 99, u, a }; +S stig[] = { p, e, a }; +S sXZi[] = { 97, 99, e, 0 }; +S sgtig[] = { 32, p, e, a }; +S spym[] = { l, u, i, 0 }; +S sgZXg[] = { 32, 99, 97, a }; +S spymg[] = { l, u, i, a }; +S sZmg[] = { 99, i, a }; +S ssXv[] = { o, 97, r, 0 }; +S sipig[] = { e, l, e, a }; +S srxv[] = { n, t, r, 0 }; +S sZip[] = { 99, e, l, 0 }; +S sgwXg[] = { 32, s, 97, a }; +S sgryg[] = { 32, n, u, a }; +S sypym[] = { u, l, u, i, 0 }; +S sghmr[] = { 32, d, i, n, 0 }; +S sgpy[] = { 32, l, u, 0 }; +S sxvy[] = { t, r, u, 0 }; +S sqyp[] = { m, u, l, 0 }; +S sgXZi[] = { 32, 97, 99, e, 0 }; +S spsvg[] = { l, o, r, a }; +S sqXmg[] = { m, 97, i, a }; +S syri[] = { u, n, e, 0 }; +S smrm[] = { i, n, i, 0 }; +S spsv[] = { l, o, r, 0 }; +S sXxsv[] = { 97, t, o, r, 0 }; +S sxmr[] = { t, i, n, 0 }; +S sxyp[] = { t, u, l, 0 }; +S stmr[] = { p, i, n, 0 }; +S sgZip[] = { 32, 99, e, l, 0 }; +S smpsv[] = { i, l, o, r, 0 }; +S srxXg[] = { n, t, 97, a }; +S sgty[] = { 32, p, u, 0 }; +S swZg[] = { s, 99, a }; +S ssXw[] = { o, 97, s, 0 }; +S siwZg[] = { e, s, 99, a }; +S ssXvi[] = { o, 97, r, e, 0 }; +S smrxv[] = { i, n, t, r, 0 }; +S shmrg[] = { d, i, n, a }; +S srxm[] = { n, t, i, 0 }; +S smqt[] = { i, m, p, 0 }; +S smXx[] = { i, 97, t, 0 }; +S svyp[] = { r, u, l, 0 }; +S sxmig[] = { t, i, e, a }; +S ssqy[] = { o, m, u, 0 }; +S sXxig[] = { 97, t, e, a }; +S ssvq[] = { o, r, m, 0 }; +S sgvX[] = { 32, r, 97, 0 }; +S svxm[] = { r, t, i, 0 }; +S sqmrx[] = { m, i, n, t, 0 }; +S sjXvX[] = { f, 97, r, 97, 0 }; +S stXg[] = { p, 97, a }; +S srim[] = { n, e, i, 0 }; +S smxm[] = { i, t, i, 0 }; +S stpm[] = { p, l, i, 0 }; +S sxsvm[] = { t, o, r, i, 0 }; +S svxX[] = { r, t, 97, 0 }; +S siZm[] = { e, 99, i, 0 }; +S svypg[] = { r, u, l, a }; +S sgtp[] = { 32, p, l, 0 }; +S sxmm[] = { t, i, i, 0 }; +S swxXx[] = { s, t, 97, t, 0 }; +S smrig[] = { i, n, e, a }; +S spXv[] = { l, 97, r, 0 }; +S srimg[] = { n, e, i, a }; +S smsX[] = { i, o, 97, 0 }; +S syxX[] = { u, t, 97, 0 }; + +N l32n0[] = { { siy, .078 }, H }; +N l32n1[] = { { smrx, .466 }, { stX, .311 }, { swxg, .175 }, H }; +N l32n2[] = { { swig, .524 }, H }; +N l32n3[] = { { ssv, .518 }, H }; +N l32n4[] = { { ssZ, .104 }, { sqXg, .233 }, { syrXg, .194 }, H }; +N l32n5[] = { { smr, 1.346 }, { sxm, .660 }, { svxm, .117 }, H }; +N l32n6[] = { { srx, .544 }, { sgwm, .990 }, H }; +N l32n7[] = { { sri, .337 }, { sgtig, .544 }, { sghm, .320 }, H }; +N l32n8[] = { { sXvig, 1.126 }, H }; +N l32n9[] = { { siwxi, .466 }, H }; +N l32n10[] = { { syxX, .097 }, H }; +N l32n11[] = { { svq, .091 }, { skv, .078 }, H }; +N l32n12[] = { { sgp, .583 }, { siXg, .350 }, H }; +N l32n13[] = { { sXr, .337 }, { spm, .311 }, { swg, .136 }, { sgzi, .175 }, H }; +N l32n14[] = { { sgwXg, .388 }, { sgZip, .233 }, H }; +N l32n15[] = { { sji, .155 }, { sgst, .175 }, H }; +N l32n16[] = { { smmg, .524 }, { sswx, .155 }, H }; +N l32n18[] = { { sZig, .379 }, H }; +N l32n19[] = { { sgpy, .262 }, H }; +N l32n20[] = { { ssw, .155 }, H }; +N l32n21[] = { { shm, .168 }, { sgts, .262 }, H }; +N l32n22[] = { { sms, .168 }, H }; +N l32n23[] = { { sry, .194 }, { sgxm, .175 }, H }; +N l32n24[] = { { sXmg, .350 }, H }; +N l32n29[] = { { sgq, .874 }, { sZg, .214 }, H }; +N l32n30[] = { { sipig, .427 }, H }; +N l32n31[] = { { siwZ, .136 }, H }; +N l32n33[] = { { sxig, .961 }, H }; +N l32n34[] = { { sZyg, .524 }, { stv, .207 }, H }; +N l32n35[] = { { srXg, .437 }, H }; +N l32n36[] = { { sym, .233 }, { smXx, .117 }, { sgqy, .175 }, { sivi, .097 }, { swxm, .097 }, H }; +N l32n37[] = { { ssx, .168 }, { sgsv, .233 }, H }; +N l32n39[] = { { sqXm, .155 }, { svmg, .204 }, { sgjXv, .194 }, { sXqX, .097 }, H }; +N l32n40[] = { { smX, .388 }, { swxXx, .129 }, H }; +N l32n41[] = { { spig, .495 }, { srk, .104 }, { sgjm, .175 }, H }; +N l32n42[] = { { sXxig, .233 }, H }; +N l32n44[] = { { sxg, .893 }, { sqm, .168 }, H }; +N l32n45[] = { { svs, .104 }, H }; +N l32n46[] = { { sgr, .427 }, { ski, .078 }, { ssvX, .097 }, H }; +N l32n47[] = { { sXt, .194 }, { shmrg, .233 }, H }; +N l32n48[] = { { smrX, .136 }, H }; +N l32n49[] = { { shig, 1.369 }, { srxX, .136 }, H }; +N l32n52[] = { { spg, .680 }, { sim, .324 }, H }; +N l32n53[] = { { sgry, .320 }, H }; +N l32n54[] = { { sgtv, .233 }, H }; +N l32n55[] = { { sgpX, .379 }, { sgXv, .262 }, { svyp, .117 }, { s7aX, .065 }, H }; +N l32n56[] = { { sgZs, .350 }, { sXxs, .136 }, H }; +N l32n58[] = { { sgwig, .466 }, H }; +N l32n59[] = { { sghig, 1.515 }, H }; +N l32n60[] = { { shg, .136 }, H }; +N l32n61[] = { { sYs, .078 }, H }; +N l32n63[] = { { svX, .803 }, { sgs, .854 }, { stpm, .097 }, H }; +N l32n65[] = { { smsX, .097 }, H }; +N l32n66[] = { { sqmrx, .129 }, H }; +N l32n67[] = { { stmr, .136 }, { szm, .078 }, H }; +N l32n68[] = { { stx, .078 }, H }; +N l32n69[] = { { sti, .324 }, H }; +N l32n70[] = { { swmg, .874 }, H }; +N l32n72[] = { { sgqX, .757 }, { ssk, .078 }, H }; +N l32n73[] = { { smv, .142 }, { sghs, .233 }, H }; +N l32n74[] = { { smZ, .324 }, H }; +N l32n75[] = { { syg, .990 }, { srm, .375 }, H }; +N l32n76[] = { { sws, .078 }, H }; +N l32n77[] = { { sXvx, .136 }, { srhi, .136 }, H }; +N l32n79[] = { { sYX, .078 }, H }; +N l32n80[] = { { sgt, 1.321 }, { sivm, .117 }, H }; +N l32n81[] = { { sXv, 1.126 }, { sgX, 1.379 }, { sghmr, .350 }, { smrh, .155 }, { sxsv, .136 }, { siZm, .097 }, H }; +N l32n82[] = { { sXZ, .311 }, H }; +N l32n83[] = { { sqg, .175 }, { sjm, .104 }, H }; +N l32n84[] = { { sZXv, .408 }, H }; +N l32n85[] = { { sty, .129 }, { si7a, .078 }, H }; +N l32n86[] = { { sZmg, .350 }, { sZip, .194 }, H }; +N l32n87[] = { { syp, .531 }, { sgty, .175 }, { smrxv, .155 }, H }; +N l32n88[] = { { swxig, .621 }, H }; +N l32n89[] = { { spsv, .155 }, { sgxs, .204 }, H }; +N l32n90[] = { { smw, .168 }, H }; +N l32n91[] = { { sig, 4.195 }, { smh, .078 }, H }; +N l32n92[] = { { sZs, .220 }, { spym, .252 }, { sxmi, .155 }, { smri, .155 }, H }; +N l32n94[] = { { swX, .272 }, { sypy, .194 }, { sXwx, .136 }, { sqXr, .117 }, H }; +N l32n95[] = { { sgyr, .728 }, H }; +N l32n97[] = { { stXg, .146 }, { svZ, .065 }, H }; +N l32n98[] = { { sXw, .350 }, { sgY, .330 }, H }; +N l32n99[] = { { ssvg, .350 }, { sXh, .104 }, H }; +N l32n101[] = { { smrg, .961 }, { sxmg, .291 }, H }; +N l32n102[] = { { sgwmg, 1.088 }, { srxg, .175 }, H }; +N l32n103[] = { { sip, .427 }, { srig, .350 }, { sxsx, .136 }, H }; +N l32n104[] = { { syq, .142 }, H }; +N l32n107[] = { { sxs, .259 }, { smx, .259 }, { sgjs, .291 }, { spXv, .097 }, H }; +N l32n108[] = { { smi, .259 }, H }; +N l32n110[] = { { sZX, .673 }, H }; +N l32n114[] = { { srg, 1.068 }, { sgv, .311 }, { skm, .104 }, H }; +N l32n115[] = { { sgZ, 2.020 }, { sXx, .803 }, { sps, .220 }, H }; +N l32n116[] = { { sviw, .136 }, H }; +N l32n117[] = { { sxyp, .136 }, H }; +N l32n119[] = { { sryg, .291 }, H }; +N l32n120[] = { { siq, .104 }, H }; +N l32n121[] = { { syr, .596 }, { sxXx, .214 }, { stvi, .097 }, H }; +N l32n122[] = { { sgZy, .583 }, { sgxv, .233 }, H }; +N l32n123[] = { { sgtX, .350 }, { shs, .117 }, { sYmp, .097 }, H }; +N l32n124[] = { { sXvX, .330 }, { smy, .129 }, H }; +N l32n125[] = { { sxX, .699 }, H }; +N l32n127[] = { { sgwx, .262 }, { siwZg, .233 }, H }; +N l32n128[] = { { swZ, .168 }, H }; +N l32n130[] = { { svx, .194 }, H }; +N l32n131[] = { { sgw, 1.806 }, { svi, .932 }, { sZXvi, .492 }, { sgqXm, .272 }, H }; +N l32n132[] = { { sgh, 1.728 }, { sXy, .233 }, { symg, .466 }, H }; +N l32n133[] = { { spX, .479 }, { sirx, .214 }, H }; +N l32n134[] = { { sgiw, .291 }, { ssvm, .175 }, H }; +N l32n135[] = { { sqXmg, .311 }, { swxv, .155 }, H }; +N l32n136[] = { { smXg, .379 }, { smrm, .155 }, { sxmm, .097 }, H }; +N l32n137[] = { { sir, .246 }, { stm, .168 }, { shXx, .175 }, { srxm, .117 }, H }; +N l32n138[] = { { sqXv, .194 }, { srim, .097 }, H }; +N l32n140[] = { { srmZ, .155 }, { sxsvm, .129 }, H }; +N l32n141[] = { { shX, .337 }, { smz, .091 }, H }; +N l32n142[] = { { sXxsv, .181 }, { sXhX, .117 }, H }; +N l32n143[] = { { sZv, .091 }, H }; +N l32n144[] = { { sXrm, .136 }, { smrXg, .233 }, H }; +N l32n145[] = { { ssg, .388 }, { slm, .117 }, { srxXg, .233 }, H }; +N l32n146[] = { { sgXZ, .350 }, { sqs, .117 }, { sipX, .097 }, H }; +N l32n147[] = { { sgmr, 1.282 }, { svy, .207 }, H }; +N l32n148[] = { { sgx, .621 }, { simg, .553 }, H }; +N l32n149[] = { { sgi, .602 }, { sgryg, .350 }, H }; +N l32n150[] = { { sXk, .078 }, H }; +N l32n151[] = { { sgpXg, .427 }, { svypg, .194 }, H }; +N l32n153[] = { { sypym, .233 }, H }; +N l32n155[] = { { syt, .078 }, H }; +N l32n156[] = { { sqyp, .155 }, H }; +N l32n157[] = { { ssp, .129 }, { sgvX, .175 }, H }; +N l32n158[] = { { sgZX, 1.194 }, { sxv, .440 }, { sXxX, .350 }, { sgqXv, .311 }, H }; +N l32n159[] = { { svXg, .699 }, { sgsg, .553 }, H }; +N l32n160[] = { { swmr, .136 }, H }; +N l32n161[] = { { swx, .699 }, H }; +N l32n162[] = { { swi, .414 }, H }; +N l32n163[] = { { sqt, .091 }, { sYy, .078 }, H }; +N l32n164[] = { { sqX, .505 }, { syrX, .136 }, H }; +N l32n165[] = { { sgy, .602 }, { stig, .466 }, { sxvy, .155 }, { stvm, .136 }, H }; +N l32n166[] = { { sgj, .738 }, H }; +N l32n167[] = { { sgti, .612 }, H }; +N l32n168[] = { { sXvi, .719 }, { smps, .136 }, H }; +N l32n169[] = { { sXZi, .272 }, { szs, .065 }, H }; +N l32n172[] = { { siX, .427 }, H }; +N l32n173[] = { { svxX, .097 }, H }; +N l32n174[] = { { ssq, .207 }, { sgwX, .437 }, { sviX, .136 }, H }; +N l32n175[] = { { sghX, .408 }, H }; +N l32n176[] = { { smm, .272 }, H }; +N l32n177[] = { { sgXg, .291 }, { sXvg, .204 }, { sjXv, .136 }, { srs, .078 }, H }; +N l32n178[] = { { sZi, .544 }, { swy, .117 }, { ssvq, .117 }, H }; +N l32n181[] = { { sgxsx, .233 }, { ssqy, .117 }, H }; +N l32n182[] = { { sgz, .330 }, H }; +N l32n183[] = { { sypg, .524 }, { sgk, .175 }, H }; +N l32n184[] = { { sXm, .246 }, { sgXyg, .194 }, H }; +N l32n185[] = { { sjs, .155 }, { spsvg, .311 }, H }; +N l32n188[] = { { spymg, .466 }, { stp, .091 }, { sxmig, .233 }, { smrig, .194 }, H }; +N l32n189[] = { { syv, .181 }, H }; +N l32n190[] = { { swXg, .408 }, { sipi, .233 }, H }; +N l32n191[] = { { sgyrg, .505 }, { s7am, .168 }, { ssr, .117 }, { sxmr, .136 }, H }; +N l32n193[] = { { sxi, .647 }, { sgXZi, .311 }, H }; +N l32n194[] = { { sZy, .375 }, H }; +N l32n195[] = { { srX, .259 }, H }; +N l32n196[] = { { smqt, .117 }, H }; +N l32n199[] = { { svm, .531 }, { sipg, .175 }, { spmr, .117 }, H }; +N l32n200[] = { { ssXv, .233 }, { spx, .091 }, { sgl, .097 }, H }; +N l32n201[] = { { spi, .337 }, { sxvX, .272 }, { sgvi, .175 }, H }; +N l32n202[] = { { sgZi, .466 }, { sXxi, .155 }, H }; +N l32n203[] = { { sjX, .207 }, { smxg, .262 }, H }; +N l32n204[] = { { smig, .320 }, { swxX, .194 }, H }; +N l32n205[] = { { siv, .311 }, { smZm, .194 }, { swiX, .117 }, H }; +N l32n206[] = { { sZXg, .466 }, { siZ, .129 }, H }; +N l32n207[] = { { shmr, .175 }, H }; +N l32n208[] = { { syri, .155 }, H }; +N l32n209[] = { { shi, .867 }, { sxy, .181 }, { sgjX, .350 }, { sgtXv, .233 }, H }; +N l32n211[] = { { sXxg, .350 }, { ssXw, .117 }, { sgtm, .146 }, H }; +N l32n212[] = { { sXvm, .117 }, { sjXvX, .129 }, H }; +N l32n215[] = { { smg, 2.758 }, { sYm, .155 }, H }; +N l32n217[] = { { sgm, 1.068 }, { spy, .311 }, { syrg, .524 }, { sX7a, .091 }, H }; +N l32n218[] = { { siwx, .447 }, { sgwi, .583 }, { sgZyg, .660 }, H }; +N l32n219[] = { { sghi, 1.427 }, H }; +N l32n220[] = { { sXvXg, .544 }, H }; +N l32n221[] = { { sxXg, 1.049 }, H }; +N l32n222[] = { { siw, .492 }, H }; +N l32n223[] = { { sXg, 3.748 }, { syx, .155 }, H }; +N l32n224[] = { { swZg, .175 }, H }; +N l32n225[] = { { sst, .129 }, { shy, .078 }, H }; +N l32n226[] = { { ssX, .388 }, { sgiwx, .388 }, { sgqs, .175 }, H }; +N l32n227[] = { { svig, .961 }, { smp, .246 }, H }; +N l32n228[] = { { sXyg, .379 }, H }; +N l32n229[] = { { spXg, .641 }, { srZ, .104 }, { sZl, .091 }, H }; +N l32n230[] = { { swm, .608 }, { sqmr, .136 }, H }; +N l32n231[] = { { stXv, .175 }, H }; +N l32n232[] = { { sqi, .220 }, H }; +N l32n234[] = { { skX, .129 }, { srimg, .194 }, H }; +N l32n235[] = { { sXp, .259 }, H }; +N l32n236[] = { { srxv, .194 }, { sjv, .078 }, H }; +N l32n237[] = { { shXg, .204 }, H }; +N l32n238[] = { { svg, .447 }, { smxm, .097 }, H }; +N l32n239[] = { { sts, .155 }, { six, .142 }, { sgmrx, .427 }, H }; +N l32n243[] = { { sgmrg, .777 }, H }; +N l32n244[] = { { sgZXv, .660 }, { smq, .129 }, { sgtp, .146 }, H }; +N l32n245[] = { { srw, .117 }, { sgig, .233 }, { sxvi, .117 }, H }; +N l32n246[] = { { sZm, .427 }, { srh, .168 }, { sXxm, .175 }, { sgZm, .204 }, H }; +N l32n247[] = { { ssXvi, .155 }, H }; +N l32n248[] = { { swxi, .427 }, { sqy, .168 }, H }; +N l32n249[] = { { svXr, .136 }, H }; +N l32n250[] = { { sg7a, .117 }, H }; +N l32n252[] = { { sXq, .220 }, H }; +N l32n254[] = { { sXxXg, .660 }, { sgZXg, .505 }, { smpsv, .155 }, H }; +N l32n255[] = { { szi, .155 }, H }; + +D l32_d = { "romanian", "iso-8859-2", - { - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,0.004,W,W,W,W,W,W,W,0.001, - W,W,W,W,W,W,W,W,W,W,W,W,0.001,W,0.001,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,0.284,0.021,0.107,0.068,0.235,0.031,0.022,0.008,0.243,0.004,0.001,0.091,0.061,0.123,0.098, - 0.061,W,0.140,0.104,0.143,0.115,0.018,W,0.002,W,0.014,W,W,W,W,W, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - Y,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V, - V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V, - V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V, - V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V - }, - { - l32n0,l32n1,l32n2,l32n3,l32n4,l32n5,l32n6,l32n7,l32n8,l32n9,l32n10,l32n11,l32n12,l32n13,l32n14,l32n15, - l32n16,X,l32n18,l32n19,l32n20,l32n21,l32n22,l32n23,l32n24,X,X,X,X,l32n29,l32n30,l32n31, - X,l32n33,l32n34,l32n35,l32n36,l32n37,X,l32n39,l32n40,l32n41,l32n42,X,l32n44,l32n45,l32n46,l32n47, - l32n48,l32n49,X,X,l32n52,l32n53,l32n54,l32n55,l32n56,X,l32n58,l32n59,l32n60,l32n61,X,l32n63, - X,l32n65,l32n66,l32n67,l32n68,l32n69,l32n70,X,l32n72,l32n73,l32n74,l32n75,l32n76,l32n77,X,l32n79, - l32n80,l32n81,l32n82,l32n83,l32n84,l32n85,l32n86,l32n87,l32n88,l32n89,l32n90,l32n91,l32n92,X,l32n94,l32n95, - X,l32n97,l32n98,l32n99,X,l32n101,l32n102,l32n103,l32n104,X,X,l32n107,l32n108,X,l32n110,X, - X,X,l32n114,l32n115,l32n116,l32n117,X,l32n119,l32n120,l32n121,l32n122,l32n123,l32n124,l32n125,X,l32n127, - l32n128,X,l32n130,l32n131,l32n132,l32n133,l32n134,l32n135,l32n136,l32n137,l32n138,X,l32n140,l32n141,l32n142,l32n143, - l32n144,l32n145,l32n146,l32n147,l32n148,l32n149,l32n150,l32n151,X,l32n153,X,l32n155,l32n156,l32n157,l32n158,l32n159, - l32n160,l32n161,l32n162,l32n163,l32n164,l32n165,l32n166,l32n167,l32n168,l32n169,X,X,l32n172,l32n173,l32n174,l32n175, - l32n176,l32n177,l32n178,X,X,l32n181,l32n182,l32n183,l32n184,l32n185,X,X,l32n188,l32n189,l32n190,l32n191, - X,l32n193,l32n194,l32n195,l32n196,X,X,l32n199,l32n200,l32n201,l32n202,l32n203,l32n204,l32n205,l32n206,l32n207, - l32n208,l32n209,X,l32n211,l32n212,X,X,l32n215,X,l32n217,l32n218,l32n219,l32n220,l32n221,l32n222,l32n223, - l32n224,l32n225,l32n226,l32n227,l32n228,l32n229,l32n230,l32n231,l32n232,X,l32n234,l32n235,l32n236,l32n237,l32n238,l32n239, - X,X,X,l32n243,l32n244,l32n245,l32n246,l32n247,l32n248,l32n249,l32n250,X,l32n252,X,l32n254,l32n255 - } + { W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, 0.004, W, W, W, W, W, W, W, 0.001, + W, W, W, W, W, W, W, W, W, W, W, W, 0.001, W, 0.001, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, 0.284, 0.021, 0.107, 0.068, 0.235, 0.031, 0.022, 0.008, 0.243, 0.004, 0.001, 0.091, 0.061, 0.123, 0.098, + 0.061, W, 0.140, 0.104, 0.143, 0.115, 0.018, W, 0.002, W, 0.014, W, W, W, W, W, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + Y, V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, + V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, + V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, + V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, V }, + { l32n0, l32n1, l32n2, l32n3, l32n4, l32n5, l32n6, l32n7, l32n8, l32n9, l32n10, l32n11, l32n12, l32n13, l32n14, l32n15, + l32n16, X, l32n18, l32n19, l32n20, l32n21, l32n22, l32n23, l32n24, X, X, X, X, l32n29, l32n30, l32n31, + X, l32n33, l32n34, l32n35, l32n36, l32n37, X, l32n39, l32n40, l32n41, l32n42, X, l32n44, l32n45, l32n46, l32n47, + l32n48, l32n49, X, X, l32n52, l32n53, l32n54, l32n55, l32n56, X, l32n58, l32n59, l32n60, l32n61, X, l32n63, + X, l32n65, l32n66, l32n67, l32n68, l32n69, l32n70, X, l32n72, l32n73, l32n74, l32n75, l32n76, l32n77, X, l32n79, + l32n80, l32n81, l32n82, l32n83, l32n84, l32n85, l32n86, l32n87, l32n88, l32n89, l32n90, l32n91, l32n92, X, l32n94, l32n95, + X, l32n97, l32n98, l32n99, X, l32n101, l32n102, l32n103, l32n104, X, X, l32n107, l32n108, X, l32n110, X, + X, X, l32n114, l32n115, l32n116, l32n117, X, l32n119, l32n120, l32n121, l32n122, l32n123, l32n124, l32n125, X, l32n127, + l32n128, X, l32n130, l32n131, l32n132, l32n133, l32n134, l32n135, l32n136, l32n137, l32n138, X, l32n140, l32n141, l32n142, l32n143, + l32n144, l32n145, l32n146, l32n147, l32n148, l32n149, l32n150, l32n151, X, l32n153, X, l32n155, l32n156, l32n157, l32n158, l32n159, + l32n160, l32n161, l32n162, l32n163, l32n164, l32n165, l32n166, l32n167, l32n168, l32n169, X, X, l32n172, l32n173, l32n174, l32n175, + l32n176, l32n177, l32n178, X, X, l32n181, l32n182, l32n183, l32n184, l32n185, X, X, l32n188, l32n189, l32n190, l32n191, + X, l32n193, l32n194, l32n195, l32n196, X, X, l32n199, l32n200, l32n201, l32n202, l32n203, l32n204, l32n205, l32n206, l32n207, + l32n208, l32n209, X, l32n211, l32n212, X, X, l32n215, X, l32n217, l32n218, l32n219, l32n220, l32n221, l32n222, l32n223, + l32n224, l32n225, l32n226, l32n227, l32n228, l32n229, l32n230, l32n231, l32n232, X, l32n234, l32n235, l32n236, l32n237, l32n238, l32n239, + X, X, X, l32n243, l32n244, l32n245, l32n246, l32n247, l32n248, l32n249, l32n250, X, l32n252, X, l32n254, l32n255 } }; - - // // Lng: russian // Enc: koi8-r // - -S sEcf[]={212,207,0}; -S sDE[]={211,212,0}; -S sCc1[]={210,193,0}; -S scfH[]={207,215,0}; -S scecf[]={206,207,0}; -S sAcf[]={208,207,0}; -S scec1[]={206,193,0}; -S sEc1[]={212,193,0}; -S scbcf[]={203,207,0}; -S sCcf[]={210,207,0}; -S sc7cf[]={199,207,0}; -S scec5[]={206,197,0}; -S sgAcf[]={32,208,207,0}; -S sc5ce[]={197,206,0}; -S scfcc[]={207,204,0}; -S sc5E[]={197,212,0}; -S scec9[]={206,201,0}; -S scfD[]={207,211,0}; -S sc1ce[]={193,206,0}; -S scfc7[]={207,199,0}; -S sEc5[]={212,197,0}; -S sc1E[]={193,212,0}; -S sc5D[]={197,211,0}; -S sc5C[]={197,210,0}; -S sccc5[]={204,197,0}; -S scccf[]={204,207,0}; -S sc5cc[]={197,204,0}; -S sCc5[]={210,197,0}; -S scfcd[]={207,205,0}; -S sgAC[]={32,208,210,0}; -S sc9ce[]={201,206,0}; -S sDcb[]={211,203,0}; -S sccI[]={204,216,0}; -S sc7cfg[]={199,207,a}; -S scfc4[]={207,196,0}; -S sc1cc[]={193,204,0}; -S sHcf[]={215,207,0}; -S sCc9[]={210,201,0}; -S scfce[]={207,206,0}; -S sEcfg[]={212,207,a}; -S sEIg[]={212,216,a}; -S scdcf[]={205,207,0}; -S sgHg[]={32,215,a}; -S sHJ[]={215,217,0}; -S scfE[]={207,212,0}; -S sc4cf[]={196,207,0}; -S sccc9[]={204,201,0}; -S scec1g[]={206,193,a}; -S sc5cd[]={197,205,0}; -S sc9c5[]={201,197,0}; -S scfc7cf[]={207,199,207,0}; -S sc5Eg[]={197,212,a}; -S sc1H[]={193,215,0}; -S scfC[]={207,210,0}; -S sDc5[]={211,197,0}; -S scbc1[]={203,193,0}; -S sgcec1[]={32,206,193,0}; -S scfca[]={207,202,0}; -S sOEcf[]={222,212,207,0}; -S sgcec5[]={32,206,197,0}; -S scfc7cfg[]={207,199,207,a}; -S sgOE[]={32,222,212,0}; -S sccc1[]={204,193,0}; -S sceJ[]={206,217,0}; -S sgOEcf[]={32,222,212,207,0}; -S sEc9[]={212,201,0}; -S sc5H[]={197,215,0}; -S sc1cd[]={193,205,0}; -S sAc5[]={208,197,0}; -S sEH[]={212,215,0}; -S sEC[]={212,210,0}; -S sc9E[]={201,212,0}; -S scfcag[]={207,202,a}; -S sACcf[]={208,210,207,0}; -S sOEcfg[]={222,212,207,a}; -S sc1C[]={193,210,0}; -S scdc9[]={205,201,0}; -S scbc9[]={203,201,0}; -S sc9cc[]={201,204,0}; -S sOc1[]={222,193,0}; -S sc5c7[]={197,199,0}; -S sc9c9g[]={201,201,a}; -S sc5DE[]={197,211,212,0}; -S sgDE[]={32,211,212,0}; -S sKc1[]={218,193,0}; -S sc9c9[]={201,201,0}; -S sDEH[]={211,212,215,0}; -S sc9c5g[]={201,197,a}; -S sDcf[]={211,207,0}; -S scecfg[]={206,207,a}; -S sc2J[]={194,217,0}; -S sc9cd[]={201,205,0}; -S sc2cf[]={194,207,0}; -S sgACcf[]={32,208,210,207,0}; -S sDcbcf[]={211,203,207,0}; -S sc7c9[]={199,201,0}; -S sgEcf[]={32,212,207,0}; -S sc9D[]={201,211,0}; -S sc7c1[]={199,193,0}; -S sc1K[]={193,218,0}; -S sgcbcf[]={32,203,207,0}; -S scec5g[]={206,197,a}; -S scfcdg[]={207,205,a}; -S sDB[]={211,209,0}; -S sgc4cf[]={32,196,207,0}; -S sDEc1[]={211,212,193,0}; -S scfG[]={207,214,0}; -S scbE[]={203,212,0}; -S sgcdcf[]={32,205,207,0}; -S scfc2[]={207,194,0}; -S sgCc1[]={32,210,193,0}; -S scfO[]={207,222,0}; -S sDBg[]={211,209,a}; -S sc5cb[]={197,203,0}; -S scfHg[]={207,215,a}; -S sc9c8g[]={201,200,a}; -S sc5K[]={197,218,0}; -S sgEc1[]={32,212,193,0}; -S scfDE[]={207,211,212,0}; -S sgc9g[]={32,201,a}; -S scfcb[]={207,203,0}; -S sc1ccI[]={193,204,216,0}; -S sc5c5[]={197,197,0}; -S sAc5C[]={208,197,210,0}; -S sccB[]={204,209,0}; -S sBE[]={209,212,0}; -S scfccI[]={207,204,216,0}; -S sc4c9[]={196,201,0}; -S sc1B[]={193,209,0}; -S sc1Bg[]={193,209,a}; -S scecfc7[]={206,207,199,0}; -S sc3c9[]={195,201,0}; -S sJc8[]={217,200,0}; -S sc1Cc1[]={193,210,193,0}; -S sJc8g[]={217,200,a}; -S sDEcf[]={211,212,207,0}; -S sc9cb[]={201,203,0}; -S sHc1g[]={215,193,a}; -S sc5cec9[]={197,206,201,0}; -S sceI[]={206,216,0}; -S sgcec1g[]={32,206,193,a}; -S sc5c7cf[]={197,199,207,0}; -S sceIg[]={206,216,a}; -S sgEc1cb[]={32,212,193,203,0}; -S sc4ce[]={196,206,0}; -S sc5cag[]={197,202,a}; -S sIce[]={216,206,0}; -S sgKc1[]={32,218,193,0}; -S scfc9[]={207,201,0}; -S sc1cdg[]={193,205,a}; -S sc5ceIg[]={197,206,216,a}; -S sceE[]={206,212,0}; -S sHD[]={215,211,0}; -S sDce[]={211,206,0}; -S sc5cdg[]={197,205,a}; -S sccIce[]={204,216,206,0}; -S scece[]={206,206,0}; -S sc5c7cfg[]={197,199,207,a}; -S scecfH[]={206,207,215,0}; -S sOc5ce[]={222,197,206,0}; -S scfc5[]={207,197,0}; -S sCcfH[]={210,207,215,0}; -S sEc1cb[]={212,193,203,0}; -S sHce[]={215,206,0}; -S sgAc5[]={32,208,197,0}; -S sc5ceI[]={197,206,216,0}; -S sEc1E[]={212,193,212,0}; -S sgDc5[]={32,211,197,0}; -S scecfc7cf[]={206,207,199,207,0}; -S sDcbc9[]={211,203,201,0}; -S scfGc5[]={207,214,197,0}; -S sME[]={220,212,0}; -S sAcfcc[]={208,207,204,0}; -S scec9c5[]={206,201,197,0}; -S sc5Cc5[]={197,210,197,0}; -S sgACc9[]={32,208,210,201,0}; -S sgHcf[]={32,215,207,0}; -S sAc1[]={208,193,0}; -S sOc5ceI[]={222,197,206,216,0}; -S scfc7c9[]={207,199,201,0}; -S sgc2J[]={32,194,217,0}; -S sEcfC[]={212,207,210,0}; -S sccc9g[]={204,201,a}; -S sf0c1[]={240,193,0}; -S sHc9[]={215,201,0}; -S scfOc5[]={207,222,197,0}; -S sJE[]={217,212,0}; -S sc9H[]={201,215,0}; -S sgc2cf[]={32,194,207,0}; -S sc1Ec5[]={193,212,197,0}; -S sCc1K[]={210,193,218,0}; -S sgME[]={32,220,212,0}; -S sED[]={212,211,0}; -S scfHc1[]={207,215,193,0}; -S sEc5C[]={212,197,210,0}; -S sgHJ[]={32,215,217,0}; -S sLc9[]={219,201,0}; -S sgf0c1[]={32,240,193,0}; -S sACc9[]={208,210,201,0}; -S sNc5[]={221,197,0}; -S sHcc[]={215,204,0}; -S sGc9[]={214,201,0}; -S sEc5cc[]={212,197,204,0}; -S sc9ca[]={201,202,0}; -S scfc6[]={207,198,0}; -S sEB[]={212,209,0}; -S sc4c1g[]={196,193,a}; -S sgDcc[]={32,211,204,0}; -S scec1B[]={206,193,209,0}; -S scfHJ[]={207,215,217,0}; -S sCc1g[]={210,193,a}; -S sc6c7c1ce[]={198,199,193,206,0}; -S sc1EI[]={193,212,216,0}; -S sGc5ce[]={214,197,206,0}; -S scfCcf[]={207,210,207,0}; -S sc1ccIce[]={193,204,216,206,0}; -S sc1DE[]={193,211,212,0}; -S sDc1[]={211,193,0}; -S sgcfOc5[]={32,207,222,197,0}; -S sGc5g[]={214,197,a}; -S sJcd[]={217,205,0}; -S sc2cfcc[]={194,207,204,0}; -S sc1EIg[]={193,212,216,a}; -S sJcdg[]={217,205,a}; -S sc1cec5[]={193,206,197,0}; -S sc9c2[]={201,194,0}; -S sccc1g[]={204,193,a}; -S sEc1cc[]={212,193,204,0}; -S sgDcf[]={32,211,207,0}; -S sc9cag[]={201,202,a}; -S sEDBg[]={212,211,209,a}; -S scbc1g[]={203,193,a}; -S sccc5E[]={204,197,212,0}; -S scec3[]={206,195,0}; -S sNc9[]={221,201,0}; -S sJca[]={217,202,0}; -S sc6c7[]={198,199,0}; -S sFO[]={213,222,0}; -S sDEc5[]={211,212,197,0}; -S sgc4c5[]={32,196,197,0}; -S sJcag[]={217,202,a}; -S scec1Bg[]={206,193,209,a}; -S sc7c1ce[]={199,193,206,0}; -S scfOc5ce[]={207,222,197,206,0}; -S sgcfO[]={32,207,222,0}; -S sceB[]={206,209,0}; -S sc2c5[]={194,197,0}; -S scfccc5[]={207,204,197,0}; -S scccfg[]={204,207,a}; -S sEDB[]={212,211,209,0}; -S sc9B[]={201,209,0}; -S sc6c7c1[]={198,199,193,0}; -S scfcccf[]={207,204,207,0}; -S sACc5[]={208,210,197,0}; -S scfK[]={207,218,0}; -S sc1Hcc[]={193,215,204,0}; -S sc9Bg[]={201,209,a}; -S sEJ[]={212,217,0}; -S sFcb[]={213,203,0}; -S sgAc1[]={32,208,193,0}; -S sgedcf[]={32,237,207,0}; -S sgACc5[]={32,208,210,197,0}; -S sgcec5g[]={32,206,197,a}; -S sc5Cc1[]={197,210,193,0}; -S sc5cccf[]={197,204,207,0}; -S scecb[]={206,203,0}; -S sge7C[]={32,231,210,0}; -S scbH[]={203,215,0}; -S sccBg[]={204,209,a}; -S sKce[]={218,206,0}; -S sgcdc5[]={32,205,197,0}; -S sc9cdc5[]={201,205,197,0}; -S sgcfE[]={32,207,212,0}; -S sc9cec1[]={201,206,193,0}; -S sgAcfcc[]={32,208,207,204,0}; -S se7C[]={231,210,0}; -S sc9O[]={201,222,0}; -S s80g[]={128,a}; -S sOc1D[]={222,193,211,0}; -S sc9C[]={201,210,0}; -S sg80[]={32,128,0}; -S sf0c1H[]={240,193,215,0}; -S scccfH[]={204,207,215,0}; -S sAcfcd[]={208,207,205,0}; -S sKF[]={218,213,0}; -S sgcdc9[]={32,205,201,0}; -S sc5ccc5[]={197,204,197,0}; -S sgf0c1H[]={32,240,193,215,0}; -S sc4c5cc[]={196,197,204,0}; -S sCc5c4[]={210,197,196,0}; -S scfDcb[]={207,211,203,0}; -S sedcf[]={237,207,0}; -S sg80g[]={32,128,a}; -S sc1c2[]={193,194,0}; -S scec9g[]={206,201,a}; -S sgccc5[]={32,204,197,0}; -S sEce[]={212,206,0}; -S scdcfG[]={205,207,214,0}; -S scdce[]={205,206,0}; -S sc1O[]={193,222,0}; -S sJc5g[]={217,197,a}; -S sEc5g[]={212,197,a}; -S sCc1ce[]={210,193,206,0}; -S sDEC[]={211,212,210,0}; -S se7Cc1O[]={231,210,193,222,0}; -S sHDcb[]={215,211,203,0}; -S scfccIcb[]={207,204,216,203,0}; -S sIcbcf[]={216,203,207,0}; -S sgc2JE[]={32,194,217,212,0}; -S sgc2cfcc[]={32,194,207,204,0}; -S sOc9[]={222,201,0}; -S sccF[]={204,213,0}; -S sBEIg[]={209,212,216,a}; -S sc2c9[]={194,201,0}; -S scbc9c5g[]={203,201,197,a}; -S scfHc5[]={207,215,197,0}; -S sJEIg[]={217,212,216,a}; -S sc5cbE[]={197,203,212,0}; -S scbcfcag[]={203,207,202,a}; -S scfcec1[]={207,206,193,0}; -S sc1Oc5[]={193,222,197,0}; -S scbcfH[]={203,207,215,0}; -S sCcfc4[]={210,207,196,0}; - -N l33n1[]={{sAc1,.222},{sc2cfcc,.296},H}; -N l33n3[]={{scfC,.494},{sgf3,.132},{sJEIg,.444},H}; -N l33n4[]={{sEI,.666},H}; -N l33n5[]={{sc9ce,.765},{sgcec5,.469},{sEc9,.469},{sgF,.165},{sgACc5,.230},H}; -N l33n6[]={{sceE,.247},H}; -N l33n7[]={{scec5,1.061},{sACcf,.592},H}; -N l33n8[]={{sDcb,.716},H}; -N l33n10[]={{sEDBg,.592},{scfcec1,.222},H}; -N l33n11[]={{sgc2cfcc,.197},{sBEIg,.444},H}; -N l33n12[]={{sccI,.716},{sHD,.247},{sgHcf,.222},H}; -N l33n13[]={{sc1ce,.963},{sccc9,.543},H}; -N l33n14[]={{scfcdg,.722},H}; -N l33n16[]={{sc9c9g,.833},H}; -N l33n17[]={{scecfg,.833},{sgACc9,.296},{sJcag,.444},H}; -N l33n18[]={{sc5c7,.370},{sceg,.296},H}; -N l33n20[]={{scfD,.963},{scfccc5,.296},{sKce,.173},{sgf4,.115},H}; -N l33n21[]={{scfc4,.716},{sc4c9,.271},{sgc2J,.222},{sEJ,.173},{sc9O,.173},H}; -N l33n22[]={{sgG,.165},H}; -N l33n23[]={{sgc7,.197},H}; -N l33n24[]={{sDEc5,.296},{sc5Cc1,.259},H}; -N l33n25[]={{sDcc,.346},{sCc1ce,.222},H}; -N l33n27[]={{sgf0c1,.222},{sc1EIg,.592},H}; -N l33n28[]={{sNc9,.197},H}; -N l33n29[]={{sgCc1,.296},{sc1O,.173},H}; -N l33n30[]={{sHc5,.518},{scec1Bg,.592},{sf0c1H,.259},H}; -N l33n32[]={{sgcdc9,.173},H}; -N l33n33[]={{sc9cag,.444},{sEc5g,.333},H}; -N l33n34[]={{sAC,.814},{sc5H,.444},H}; -N l33n35[]={{scec1g,1.222},{sgACcf,.461},H}; -N l33n37[]={{scfE,.568},H}; -N l33n38[]={{scfc5,.247},H}; -N l33n39[]={{sgH,.938},{sgOEcf,.625},{sgAc5,.247},H}; -N l33n41[]={{sHg,1.777},{sgcfO,.197},H}; -N l33n44[]={{scdc9,.395},{sc5cec9,.407},H}; -N l33n45[]={{sCcf,1.111},{scfc7cf,.814},H}; -N l33n47[]={{sc1A,.173},H}; -N l33n48[]={{scfDE,.444},H}; -N l33n49[]={{scfg,3.887},{sc5ceIg,.740},{sc6c7,.197},H}; -N l33n51[]={{sc1ccI,.407},H}; -N l33n54[]={{sEc1cb,.370},H}; -N l33n55[]={{sKc1,.370},{sge7,.148},{scfc6,.197},H}; -N l33n56[]={{sc7cfg,1.610},{sc9B,.197},H}; -N l33n57[]={{sgc9,.444},{sgcec1g,.362},{sc9c2,.197},H}; -N l33n58[]={{sHc1g,.611},{sc1cbg,.333},H}; -N l33n59[]={{sOEcfg,1.185},{sDce,.247},{sOc9,.148},H}; -N l33n61[]={{sc2cf,.346},{sge7C,.173},H}; -N l33n62[]={{scecfc7,.407},H}; -N l33n63[]={{sCc1,1.357},{sgEc1,.296},H}; -N l33n64[]={{sgcbcf,.321},{sc1B,.271},H}; -N l33n65[]={{sEc1cc,.296},{sc1c2,.173},H}; -N l33n67[]={{sGc9,.197},H}; -N l33n68[]={{sc5Cc5,.333},{sJcdg,.444},H}; -N l33n69[]={{sAc5,.444},{sc5ca,.296},H}; -N l33n70[]={{scfOc5,.333},{sFcb,.173},{scfccIcb,.296},H}; -N l33n71[]={{scfG,.321},H}; -N l33n72[]={{sIg,1.814},{scfc7,.913},{sc4cc,.173},H}; -N l33n73[]={{sc9C,.173},H}; -N l33n74[]={{sceI,.271},H}; -N l33n75[]={{scec9,.963},{sAc5C,.407},H}; -N l33n76[]={{sDcf,.370},{sc5cccf,.259},H}; -N l33n79[]={{sc5Eg,1.166},H}; -N l33n80[]={{sc9cec1,.259},H}; -N l33n81[]={{sc1C,.395},H}; -N l33n84[]={{scbcf,1.135},H}; -N l33n85[]={{sc5K,.296},H}; -N l33n86[]={{sc5cb,.296},H}; -N l33n87[]={{sc5c7cfg,.740},H}; -N l33n88[]={{scfH,1.333},{sc8g,1.000},H}; -N l33n89[]={{sOc5ceI,.444},{sge9,.132},H}; -N l33n90[]={{sc9D,.346},{sgK,.181},{sgDc5,.222},{sEce,.173},H}; -N l33n91[]={{sgcb,.378},{sceJ,.469},{sJE,.222},{sgc4c5,.197},H}; -N l33n92[]={{sc1cdg,.555},H}; -N l33n94[]={{sDc1,.197},H}; -N l33n95[]={{sGc5g,.444},H}; -N l33n96[]={{sg80,.115},{sc0g,.222},H}; -N l33n98[]={{sc1D,.346},{sgcdcf,.296},{sHc9,.222},{scbcfcag,.444},H}; -N l33n99[]={{sBE,.271},{sc1c4,.173},H}; -N l33n100[]={{sEIg,1.444},H}; -N l33n101[]={{sgcec5g,.230},H}; -N l33n102[]={{scbc1,.494},H}; -N l33n103[]={{sc5cc,.765},{sJg,.555},{scec5g,.722},H}; -N l33n106[]={{sc4ce,.247},{scfc9,.247},{sCcfH,.370},{sc1Hcc,.259},H}; -N l33n107[]={{sEcf,1.777},{sc9E,.420},{sc9cdc5,.259},H}; -N l33n108[]={{sc9c5,.543},{sgcc,.214},H}; -N l33n109[]={{sccc9g,.500},{scecb,.173},H}; -N l33n110[]={{sDB,.321},H}; -N l33n111[]={{sBg,1.703},H}; -N l33n113[]={{sEcfC,.333},H}; -N l33n114[]={{sHJ,.617},{sc7c9,.346},{sedcf,.173},{sc5cbE,.222},H}; -N l33n115[]={{sc1E,.888},{scccf,.790},H}; -N l33n119[]={{sc9g,2.369},H}; -N l33n120[]={{sc5cd,.543},{sgcfOc5,.263},H}; -N l33n122[]={{sgHJ,.222},H}; -N l33n123[]={{sc4cf,.568},{scfca,.494},{sgeb,.099},H}; -N l33n124[]={{sgM,.197},{sc6c7c1,.296},H}; -N l33n125[]={{sEc1,1.160},{sgcd,.559},H}; -N l33n126[]={{sc1DE,.296},H}; -N l33n127[]={{sc1g,3.369},H}; -N l33n129[]={{scdce,.173},H}; -N l33n130[]={{scfcccf,.259},{sgedcf,.173},H}; -N l33n131[]={{sCc5,.765},H}; -N l33n132[]={{sc1cec5,.296},H}; -N l33n133[]={{sccc1,.469},{sEc5cc,.296},H}; -N l33n134[]={{sDEcf,.407},H}; -N l33n135[]={{sgHg,.617},H}; -N l33n136[]={{sIcbcf,.222},H}; -N l33n137[]={{sc5ce,1.012},{sFO,.197},H}; -N l33n139[]={{sFc0,.197},{scfK,.173},{sKF,.173},H}; -N l33n140[]={{scfcb,.271},H}; -N l33n141[]={{scfc7cfg,1.407},{sc4c1,.420},{sEB,.197},H}; -N l33n142[]={{sgce,.773},{sCg,.222},H}; -N l33n143[]={{sJc8,.271},H}; -N l33n145[]={{sgc2JE,.197},{scbcfH,.222},H}; -N l33n146[]={{scdcf,.617},H}; -N l33n147[]={{sCF,.271},{sc2c5,.197},H}; -N l33n148[]={{sc1Oc5,.222},H}; -N l33n149[]={{sgAcf,1.037},{sccB,.271},{sHcc,.222},{sc4c5cc,.259},H}; -N l33n150[]={{scag,1.592},H}; -N l33n152[]={{sgME,.222},{sc9Bg,.389},{scbD,.148},H}; -N l33n153[]={{sgc9g,.296},{sEc1E,.333},{sACc5,.259},{sCcfc4,.222},H}; -N l33n156[]={{sc1Cc1,.407},H}; -N l33n157[]={{scfcc,1.012},{sged,.165},{sCc1K,.333},{sc1ccIce,.395},H}; -N l33n158[]={{sgO,.444},{sEC,.420},{sc9H,.222},H}; -N l33n159[]={{sgcf,.675},{sc9c8,.346},{sCc1g,.444},H}; -N l33n160[]={{sc1Bg,.611},{sgEc1cb,.329},{scece,.247},{s80g,.173},{sgf0c1H,.230},H}; -N l33n161[]={{sDE,1.678},H}; -N l33n162[]={{sDc5,.494},H}; -N l33n163[]={{scfHc1,.333},H}; -N l33n164[]={{scdc1,.296},H}; -N l33n165[]={{sc5cag,.555},{sgKc1,.247},H}; -N l33n166[]={{sc1H,.518},H}; -N l33n167[]={{sgc2cf,.222},{sgDcc,.197},{sDEC,.222},H}; -N l33n169[]={{scbE,.321},H}; -N l33n170[]={{sceIg,.555},{sEDB,.296},H}; -N l33n171[]={{scecfc7cf,.444},{sDcbc9,.333},{scfHJ,.296},{scec9g,.389},H}; -N l33n173[]={{sDg,.481},H}; -N l33n174[]={{scfcd,.765},{sgee,.165},H}; -N l33n175[]={{sED,.222},H}; -N l33n176[]={{sgA,1.612},{sc9c9,.370},{scfOc5ce,.395},{scccfH,.259},H}; -N l33n177[]={{scecf,1.259},{sgc1,.197},{sJca,.197},H}; -N l33n178[]={{sc3c5,.197},H}; -N l33n179[]={{sOc1,.395},{sAcfcc,.333},H}; -N l33n181[]={{scbg,.629},H}; -N l33n182[]={{sgAC,.765},H}; -N l33n183[]={{sHce,.247},H}; -N l33n184[]={{scfHg,.666},{sME,.222},H}; -N l33n186[]={{sgOE,.469},H}; -N l33n187[]={{sc1EI,.296},{sgcfE,.173},H}; -N l33n188[]={{sJc5g,.333},H}; -N l33n189[]={{sFC,.173},H}; -N l33n190[]={{scfGc5,.333},{scec1B,.296},{sAcfcd,.259},H}; -N l33n191[]={{scfce,.642},H}; -N l33n192[]={{sg80g,.173},H}; -N l33n193[]={{sEc5,.888},{sc9ca,.197},H}; -N l33n194[]={{sgc2,.378},{scec9c5,.333},H}; -N l33n195[]={{scec1,1.209},H}; -N l33n196[]={{sc7c1ce,.296},{sOc1D,.259},{scdcfG,.259},H}; -N l33n197[]={{sACc9,.333},{sHDcb,.222},{scbc9c5g,.444},H}; -N l33n198[]={{scbc1g,.444},H}; -N l33n199[]={{sCc9,.642},{sEc5C,.333},H}; -N l33n200[]={{sHcf,.666},{sgDcf,.197},H}; -N l33n201[]={{sccc5,.814},{sgc4cf,.321},H}; -N l33n203[]={{sEcfg,1.444},H}; -N l33n204[]={{sEg,1.259},{sc9c5g,.833},H}; -N l33n205[]={{sc5C,.839},{scfDcb,.259},H}; -N l33n206[]={{sDBg,.666},H}; -N l33n207[]={{scfO,.296},{scfHc5,.222},H}; -N l33n208[]={{sgf0,.296},{se7Cc1O,.296},H}; -N l33n209[]={{sc4c5,.543},{sgR,.230},{sOc5ce,.370},{sc5ceI,.370},{sEF,.197},H}; -N l33n210[]={{sgC,.329},{sc9cb,.271},H}; -N l33n211[]={{sceB,.197},{scccfg,.444},H}; -N l33n212[]={{sccg,.555},H}; -N l33n214[]={{sIce,.247},H}; -N l33n215[]={{sc2c9,.148},H}; -N l33n216[]={{sc7cf,1.061},{sc5cdg,.555},{sNc5,.222},H}; -N l33n217[]={{sgcec1,.494},{sgEcf,.346},{sc1K,.321},{sGc5ce,.296},{sccF,.148},H}; -N l33n218[]={{sHc1,.913},{sc1cb,.444},H}; -N l33n219[]={{sOEcf,.703},{scfcag,.944},H}; -N l33n220[]={{scbH,.173},H}; -N l33n222[]={{sc5D,.864},{sDEH,.555},{sLc9,.222},{sc5ccc5,.259},H}; -N l33n223[]={{sc5c4,.370},{sFE,.197},H}; -N l33n225[]={{sf0c1,.222},H}; -N l33n227[]={{sgD,1.119},{sc9cc,.395},{sgccc5,.173},H}; -N l33n228[]={{sgc4,.592},{sJcd,.197},H}; -N l33n229[]={{scfccI,.407},{sccc1g,.444},{sccc5E,.296},{scec3,.197},H}; -N l33n230[]={{sccIce,.370},{sc6c7c1ce,.395},H}; -N l33n231[]={{sc2J,.370},H}; -N l33n232[]={{scdc5,.543},{scfCcf,.296},H}; -N l33n234[]={{sc7c1,.346},{sc1Ec5,.333},H}; -N l33n235[]={{sc1cc,.716},{sFg,.851},{scfc7c9,.333},{se7C,.173},H}; -N l33n236[]={{sDEc1,.481},H}; -N l33n237[]={{sDcbcf,.518},{sc4c1g,.444},H}; -N l33n238[]={{scbc9,.395},{scecfH,.370},H}; -N l33n239[]={{sAcf,1.234},{sc5E,.963},{sJc8g,.611},{sCc5c4,.259},H}; -N l33n240[]={{sc5c5,.271},H}; -N l33n243[]={{scdg,1.629},{sEH,.420},{scfc2,.296},H}; -N l33n244[]={{sgE,.625},{sc9cd,.346},{sgcdc5,.173},H}; -N l33n245[]={{sgc5,.165},{sccBg,.389},H}; -N l33n246[]={{sOE,.469},{sc3c9,.271},H}; -N l33n247[]={{sOc5,.691},{sc5c7cf,.407},H}; -N l33n249[]={{sgAcfcc,.230},H}; -N l33n250[]={{sc5DE,.555},H}; -N l33n251[]={{sc5g,3.036},{sgAc1,.173},H}; -N l33n252[]={{sc1cd,.444},H}; -N l33n255[]={{sGc5,.568},{sgDE,.370},{sc9c8g,.666},H}; - -D l33_d = -{ +S sEcf[] = { 212, 207, 0 }; +S sDE[] = { 211, 212, 0 }; +S sCc1[] = { 210, 193, 0 }; +S scfH[] = { 207, 215, 0 }; +S scecf[] = { 206, 207, 0 }; +S sAcf[] = { 208, 207, 0 }; +S scec1[] = { 206, 193, 0 }; +S sEc1[] = { 212, 193, 0 }; +S scbcf[] = { 203, 207, 0 }; +S sCcf[] = { 210, 207, 0 }; +S sc7cf[] = { 199, 207, 0 }; +S scec5[] = { 206, 197, 0 }; +S sgAcf[] = { 32, 208, 207, 0 }; +S sc5ce[] = { 197, 206, 0 }; +S scfcc[] = { 207, 204, 0 }; +S sc5E[] = { 197, 212, 0 }; +S scec9[] = { 206, 201, 0 }; +S scfD[] = { 207, 211, 0 }; +S sc1ce[] = { 193, 206, 0 }; +S scfc7[] = { 207, 199, 0 }; +S sEc5[] = { 212, 197, 0 }; +S sc1E[] = { 193, 212, 0 }; +S sc5D[] = { 197, 211, 0 }; +S sc5C[] = { 197, 210, 0 }; +S sccc5[] = { 204, 197, 0 }; +S scccf[] = { 204, 207, 0 }; +S sc5cc[] = { 197, 204, 0 }; +S sCc5[] = { 210, 197, 0 }; +S scfcd[] = { 207, 205, 0 }; +S sgAC[] = { 32, 208, 210, 0 }; +S sc9ce[] = { 201, 206, 0 }; +S sDcb[] = { 211, 203, 0 }; +S sccI[] = { 204, 216, 0 }; +S sc7cfg[] = { 199, 207, a }; +S scfc4[] = { 207, 196, 0 }; +S sc1cc[] = { 193, 204, 0 }; +S sHcf[] = { 215, 207, 0 }; +S sCc9[] = { 210, 201, 0 }; +S scfce[] = { 207, 206, 0 }; +S sEcfg[] = { 212, 207, a }; +S sEIg[] = { 212, 216, a }; +S scdcf[] = { 205, 207, 0 }; +S sgHg[] = { 32, 215, a }; +S sHJ[] = { 215, 217, 0 }; +S scfE[] = { 207, 212, 0 }; +S sc4cf[] = { 196, 207, 0 }; +S sccc9[] = { 204, 201, 0 }; +S scec1g[] = { 206, 193, a }; +S sc5cd[] = { 197, 205, 0 }; +S sc9c5[] = { 201, 197, 0 }; +S scfc7cf[] = { 207, 199, 207, 0 }; +S sc5Eg[] = { 197, 212, a }; +S sc1H[] = { 193, 215, 0 }; +S scfC[] = { 207, 210, 0 }; +S sDc5[] = { 211, 197, 0 }; +S scbc1[] = { 203, 193, 0 }; +S sgcec1[] = { 32, 206, 193, 0 }; +S scfca[] = { 207, 202, 0 }; +S sOEcf[] = { 222, 212, 207, 0 }; +S sgcec5[] = { 32, 206, 197, 0 }; +S scfc7cfg[] = { 207, 199, 207, a }; +S sgOE[] = { 32, 222, 212, 0 }; +S sccc1[] = { 204, 193, 0 }; +S sceJ[] = { 206, 217, 0 }; +S sgOEcf[] = { 32, 222, 212, 207, 0 }; +S sEc9[] = { 212, 201, 0 }; +S sc5H[] = { 197, 215, 0 }; +S sc1cd[] = { 193, 205, 0 }; +S sAc5[] = { 208, 197, 0 }; +S sEH[] = { 212, 215, 0 }; +S sEC[] = { 212, 210, 0 }; +S sc9E[] = { 201, 212, 0 }; +S scfcag[] = { 207, 202, a }; +S sACcf[] = { 208, 210, 207, 0 }; +S sOEcfg[] = { 222, 212, 207, a }; +S sc1C[] = { 193, 210, 0 }; +S scdc9[] = { 205, 201, 0 }; +S scbc9[] = { 203, 201, 0 }; +S sc9cc[] = { 201, 204, 0 }; +S sOc1[] = { 222, 193, 0 }; +S sc5c7[] = { 197, 199, 0 }; +S sc9c9g[] = { 201, 201, a }; +S sc5DE[] = { 197, 211, 212, 0 }; +S sgDE[] = { 32, 211, 212, 0 }; +S sKc1[] = { 218, 193, 0 }; +S sc9c9[] = { 201, 201, 0 }; +S sDEH[] = { 211, 212, 215, 0 }; +S sc9c5g[] = { 201, 197, a }; +S sDcf[] = { 211, 207, 0 }; +S scecfg[] = { 206, 207, a }; +S sc2J[] = { 194, 217, 0 }; +S sc9cd[] = { 201, 205, 0 }; +S sc2cf[] = { 194, 207, 0 }; +S sgACcf[] = { 32, 208, 210, 207, 0 }; +S sDcbcf[] = { 211, 203, 207, 0 }; +S sc7c9[] = { 199, 201, 0 }; +S sgEcf[] = { 32, 212, 207, 0 }; +S sc9D[] = { 201, 211, 0 }; +S sc7c1[] = { 199, 193, 0 }; +S sc1K[] = { 193, 218, 0 }; +S sgcbcf[] = { 32, 203, 207, 0 }; +S scec5g[] = { 206, 197, a }; +S scfcdg[] = { 207, 205, a }; +S sDB[] = { 211, 209, 0 }; +S sgc4cf[] = { 32, 196, 207, 0 }; +S sDEc1[] = { 211, 212, 193, 0 }; +S scfG[] = { 207, 214, 0 }; +S scbE[] = { 203, 212, 0 }; +S sgcdcf[] = { 32, 205, 207, 0 }; +S scfc2[] = { 207, 194, 0 }; +S sgCc1[] = { 32, 210, 193, 0 }; +S scfO[] = { 207, 222, 0 }; +S sDBg[] = { 211, 209, a }; +S sc5cb[] = { 197, 203, 0 }; +S scfHg[] = { 207, 215, a }; +S sc9c8g[] = { 201, 200, a }; +S sc5K[] = { 197, 218, 0 }; +S sgEc1[] = { 32, 212, 193, 0 }; +S scfDE[] = { 207, 211, 212, 0 }; +S sgc9g[] = { 32, 201, a }; +S scfcb[] = { 207, 203, 0 }; +S sc1ccI[] = { 193, 204, 216, 0 }; +S sc5c5[] = { 197, 197, 0 }; +S sAc5C[] = { 208, 197, 210, 0 }; +S sccB[] = { 204, 209, 0 }; +S sBE[] = { 209, 212, 0 }; +S scfccI[] = { 207, 204, 216, 0 }; +S sc4c9[] = { 196, 201, 0 }; +S sc1B[] = { 193, 209, 0 }; +S sc1Bg[] = { 193, 209, a }; +S scecfc7[] = { 206, 207, 199, 0 }; +S sc3c9[] = { 195, 201, 0 }; +S sJc8[] = { 217, 200, 0 }; +S sc1Cc1[] = { 193, 210, 193, 0 }; +S sJc8g[] = { 217, 200, a }; +S sDEcf[] = { 211, 212, 207, 0 }; +S sc9cb[] = { 201, 203, 0 }; +S sHc1g[] = { 215, 193, a }; +S sc5cec9[] = { 197, 206, 201, 0 }; +S sceI[] = { 206, 216, 0 }; +S sgcec1g[] = { 32, 206, 193, a }; +S sc5c7cf[] = { 197, 199, 207, 0 }; +S sceIg[] = { 206, 216, a }; +S sgEc1cb[] = { 32, 212, 193, 203, 0 }; +S sc4ce[] = { 196, 206, 0 }; +S sc5cag[] = { 197, 202, a }; +S sIce[] = { 216, 206, 0 }; +S sgKc1[] = { 32, 218, 193, 0 }; +S scfc9[] = { 207, 201, 0 }; +S sc1cdg[] = { 193, 205, a }; +S sc5ceIg[] = { 197, 206, 216, a }; +S sceE[] = { 206, 212, 0 }; +S sHD[] = { 215, 211, 0 }; +S sDce[] = { 211, 206, 0 }; +S sc5cdg[] = { 197, 205, a }; +S sccIce[] = { 204, 216, 206, 0 }; +S scece[] = { 206, 206, 0 }; +S sc5c7cfg[] = { 197, 199, 207, a }; +S scecfH[] = { 206, 207, 215, 0 }; +S sOc5ce[] = { 222, 197, 206, 0 }; +S scfc5[] = { 207, 197, 0 }; +S sCcfH[] = { 210, 207, 215, 0 }; +S sEc1cb[] = { 212, 193, 203, 0 }; +S sHce[] = { 215, 206, 0 }; +S sgAc5[] = { 32, 208, 197, 0 }; +S sc5ceI[] = { 197, 206, 216, 0 }; +S sEc1E[] = { 212, 193, 212, 0 }; +S sgDc5[] = { 32, 211, 197, 0 }; +S scecfc7cf[] = { 206, 207, 199, 207, 0 }; +S sDcbc9[] = { 211, 203, 201, 0 }; +S scfGc5[] = { 207, 214, 197, 0 }; +S sME[] = { 220, 212, 0 }; +S sAcfcc[] = { 208, 207, 204, 0 }; +S scec9c5[] = { 206, 201, 197, 0 }; +S sc5Cc5[] = { 197, 210, 197, 0 }; +S sgACc9[] = { 32, 208, 210, 201, 0 }; +S sgHcf[] = { 32, 215, 207, 0 }; +S sAc1[] = { 208, 193, 0 }; +S sOc5ceI[] = { 222, 197, 206, 216, 0 }; +S scfc7c9[] = { 207, 199, 201, 0 }; +S sgc2J[] = { 32, 194, 217, 0 }; +S sEcfC[] = { 212, 207, 210, 0 }; +S sccc9g[] = { 204, 201, a }; +S sf0c1[] = { 240, 193, 0 }; +S sHc9[] = { 215, 201, 0 }; +S scfOc5[] = { 207, 222, 197, 0 }; +S sJE[] = { 217, 212, 0 }; +S sc9H[] = { 201, 215, 0 }; +S sgc2cf[] = { 32, 194, 207, 0 }; +S sc1Ec5[] = { 193, 212, 197, 0 }; +S sCc1K[] = { 210, 193, 218, 0 }; +S sgME[] = { 32, 220, 212, 0 }; +S sED[] = { 212, 211, 0 }; +S scfHc1[] = { 207, 215, 193, 0 }; +S sEc5C[] = { 212, 197, 210, 0 }; +S sgHJ[] = { 32, 215, 217, 0 }; +S sLc9[] = { 219, 201, 0 }; +S sgf0c1[] = { 32, 240, 193, 0 }; +S sACc9[] = { 208, 210, 201, 0 }; +S sNc5[] = { 221, 197, 0 }; +S sHcc[] = { 215, 204, 0 }; +S sGc9[] = { 214, 201, 0 }; +S sEc5cc[] = { 212, 197, 204, 0 }; +S sc9ca[] = { 201, 202, 0 }; +S scfc6[] = { 207, 198, 0 }; +S sEB[] = { 212, 209, 0 }; +S sc4c1g[] = { 196, 193, a }; +S sgDcc[] = { 32, 211, 204, 0 }; +S scec1B[] = { 206, 193, 209, 0 }; +S scfHJ[] = { 207, 215, 217, 0 }; +S sCc1g[] = { 210, 193, a }; +S sc6c7c1ce[] = { 198, 199, 193, 206, 0 }; +S sc1EI[] = { 193, 212, 216, 0 }; +S sGc5ce[] = { 214, 197, 206, 0 }; +S scfCcf[] = { 207, 210, 207, 0 }; +S sc1ccIce[] = { 193, 204, 216, 206, 0 }; +S sc1DE[] = { 193, 211, 212, 0 }; +S sDc1[] = { 211, 193, 0 }; +S sgcfOc5[] = { 32, 207, 222, 197, 0 }; +S sGc5g[] = { 214, 197, a }; +S sJcd[] = { 217, 205, 0 }; +S sc2cfcc[] = { 194, 207, 204, 0 }; +S sc1EIg[] = { 193, 212, 216, a }; +S sJcdg[] = { 217, 205, a }; +S sc1cec5[] = { 193, 206, 197, 0 }; +S sc9c2[] = { 201, 194, 0 }; +S sccc1g[] = { 204, 193, a }; +S sEc1cc[] = { 212, 193, 204, 0 }; +S sgDcf[] = { 32, 211, 207, 0 }; +S sc9cag[] = { 201, 202, a }; +S sEDBg[] = { 212, 211, 209, a }; +S scbc1g[] = { 203, 193, a }; +S sccc5E[] = { 204, 197, 212, 0 }; +S scec3[] = { 206, 195, 0 }; +S sNc9[] = { 221, 201, 0 }; +S sJca[] = { 217, 202, 0 }; +S sc6c7[] = { 198, 199, 0 }; +S sFO[] = { 213, 222, 0 }; +S sDEc5[] = { 211, 212, 197, 0 }; +S sgc4c5[] = { 32, 196, 197, 0 }; +S sJcag[] = { 217, 202, a }; +S scec1Bg[] = { 206, 193, 209, a }; +S sc7c1ce[] = { 199, 193, 206, 0 }; +S scfOc5ce[] = { 207, 222, 197, 206, 0 }; +S sgcfO[] = { 32, 207, 222, 0 }; +S sceB[] = { 206, 209, 0 }; +S sc2c5[] = { 194, 197, 0 }; +S scfccc5[] = { 207, 204, 197, 0 }; +S scccfg[] = { 204, 207, a }; +S sEDB[] = { 212, 211, 209, 0 }; +S sc9B[] = { 201, 209, 0 }; +S sc6c7c1[] = { 198, 199, 193, 0 }; +S scfcccf[] = { 207, 204, 207, 0 }; +S sACc5[] = { 208, 210, 197, 0 }; +S scfK[] = { 207, 218, 0 }; +S sc1Hcc[] = { 193, 215, 204, 0 }; +S sc9Bg[] = { 201, 209, a }; +S sEJ[] = { 212, 217, 0 }; +S sFcb[] = { 213, 203, 0 }; +S sgAc1[] = { 32, 208, 193, 0 }; +S sgedcf[] = { 32, 237, 207, 0 }; +S sgACc5[] = { 32, 208, 210, 197, 0 }; +S sgcec5g[] = { 32, 206, 197, a }; +S sc5Cc1[] = { 197, 210, 193, 0 }; +S sc5cccf[] = { 197, 204, 207, 0 }; +S scecb[] = { 206, 203, 0 }; +S sge7C[] = { 32, 231, 210, 0 }; +S scbH[] = { 203, 215, 0 }; +S sccBg[] = { 204, 209, a }; +S sKce[] = { 218, 206, 0 }; +S sgcdc5[] = { 32, 205, 197, 0 }; +S sc9cdc5[] = { 201, 205, 197, 0 }; +S sgcfE[] = { 32, 207, 212, 0 }; +S sc9cec1[] = { 201, 206, 193, 0 }; +S sgAcfcc[] = { 32, 208, 207, 204, 0 }; +S se7C[] = { 231, 210, 0 }; +S sc9O[] = { 201, 222, 0 }; +S s80g[] = { 128, a }; +S sOc1D[] = { 222, 193, 211, 0 }; +S sc9C[] = { 201, 210, 0 }; +S sg80[] = { 32, 128, 0 }; +S sf0c1H[] = { 240, 193, 215, 0 }; +S scccfH[] = { 204, 207, 215, 0 }; +S sAcfcd[] = { 208, 207, 205, 0 }; +S sKF[] = { 218, 213, 0 }; +S sgcdc9[] = { 32, 205, 201, 0 }; +S sc5ccc5[] = { 197, 204, 197, 0 }; +S sgf0c1H[] = { 32, 240, 193, 215, 0 }; +S sc4c5cc[] = { 196, 197, 204, 0 }; +S sCc5c4[] = { 210, 197, 196, 0 }; +S scfDcb[] = { 207, 211, 203, 0 }; +S sedcf[] = { 237, 207, 0 }; +S sg80g[] = { 32, 128, a }; +S sc1c2[] = { 193, 194, 0 }; +S scec9g[] = { 206, 201, a }; +S sgccc5[] = { 32, 204, 197, 0 }; +S sEce[] = { 212, 206, 0 }; +S scdcfG[] = { 205, 207, 214, 0 }; +S scdce[] = { 205, 206, 0 }; +S sc1O[] = { 193, 222, 0 }; +S sJc5g[] = { 217, 197, a }; +S sEc5g[] = { 212, 197, a }; +S sCc1ce[] = { 210, 193, 206, 0 }; +S sDEC[] = { 211, 212, 210, 0 }; +S se7Cc1O[] = { 231, 210, 193, 222, 0 }; +S sHDcb[] = { 215, 211, 203, 0 }; +S scfccIcb[] = { 207, 204, 216, 203, 0 }; +S sIcbcf[] = { 216, 203, 207, 0 }; +S sgc2JE[] = { 32, 194, 217, 212, 0 }; +S sgc2cfcc[] = { 32, 194, 207, 204, 0 }; +S sOc9[] = { 222, 201, 0 }; +S sccF[] = { 204, 213, 0 }; +S sBEIg[] = { 209, 212, 216, a }; +S sc2c9[] = { 194, 201, 0 }; +S scbc9c5g[] = { 203, 201, 197, a }; +S scfHc5[] = { 207, 215, 197, 0 }; +S sJEIg[] = { 217, 212, 216, a }; +S sc5cbE[] = { 197, 203, 212, 0 }; +S scbcfcag[] = { 203, 207, 202, a }; +S scfcec1[] = { 207, 206, 193, 0 }; +S sc1Oc5[] = { 193, 222, 197, 0 }; +S scbcfH[] = { 203, 207, 215, 0 }; +S sCcfc4[] = { 210, 207, 196, 0 }; + +N l33n1[] = { { sAc1, .222 }, { sc2cfcc, .296 }, H }; +N l33n3[] = { { scfC, .494 }, { sgf3, .132 }, { sJEIg, .444 }, H }; +N l33n4[] = { { sEI, .666 }, H }; +N l33n5[] = { { sc9ce, .765 }, { sgcec5, .469 }, { sEc9, .469 }, { sgF, .165 }, { sgACc5, .230 }, H }; +N l33n6[] = { { sceE, .247 }, H }; +N l33n7[] = { { scec5, 1.061 }, { sACcf, .592 }, H }; +N l33n8[] = { { sDcb, .716 }, H }; +N l33n10[] = { { sEDBg, .592 }, { scfcec1, .222 }, H }; +N l33n11[] = { { sgc2cfcc, .197 }, { sBEIg, .444 }, H }; +N l33n12[] = { { sccI, .716 }, { sHD, .247 }, { sgHcf, .222 }, H }; +N l33n13[] = { { sc1ce, .963 }, { sccc9, .543 }, H }; +N l33n14[] = { { scfcdg, .722 }, H }; +N l33n16[] = { { sc9c9g, .833 }, H }; +N l33n17[] = { { scecfg, .833 }, { sgACc9, .296 }, { sJcag, .444 }, H }; +N l33n18[] = { { sc5c7, .370 }, { sceg, .296 }, H }; +N l33n20[] = { { scfD, .963 }, { scfccc5, .296 }, { sKce, .173 }, { sgf4, .115 }, H }; +N l33n21[] = { { scfc4, .716 }, { sc4c9, .271 }, { sgc2J, .222 }, { sEJ, .173 }, { sc9O, .173 }, H }; +N l33n22[] = { { sgG, .165 }, H }; +N l33n23[] = { { sgc7, .197 }, H }; +N l33n24[] = { { sDEc5, .296 }, { sc5Cc1, .259 }, H }; +N l33n25[] = { { sDcc, .346 }, { sCc1ce, .222 }, H }; +N l33n27[] = { { sgf0c1, .222 }, { sc1EIg, .592 }, H }; +N l33n28[] = { { sNc9, .197 }, H }; +N l33n29[] = { { sgCc1, .296 }, { sc1O, .173 }, H }; +N l33n30[] = { { sHc5, .518 }, { scec1Bg, .592 }, { sf0c1H, .259 }, H }; +N l33n32[] = { { sgcdc9, .173 }, H }; +N l33n33[] = { { sc9cag, .444 }, { sEc5g, .333 }, H }; +N l33n34[] = { { sAC, .814 }, { sc5H, .444 }, H }; +N l33n35[] = { { scec1g, 1.222 }, { sgACcf, .461 }, H }; +N l33n37[] = { { scfE, .568 }, H }; +N l33n38[] = { { scfc5, .247 }, H }; +N l33n39[] = { { sgH, .938 }, { sgOEcf, .625 }, { sgAc5, .247 }, H }; +N l33n41[] = { { sHg, 1.777 }, { sgcfO, .197 }, H }; +N l33n44[] = { { scdc9, .395 }, { sc5cec9, .407 }, H }; +N l33n45[] = { { sCcf, 1.111 }, { scfc7cf, .814 }, H }; +N l33n47[] = { { sc1A, .173 }, H }; +N l33n48[] = { { scfDE, .444 }, H }; +N l33n49[] = { { scfg, 3.887 }, { sc5ceIg, .740 }, { sc6c7, .197 }, H }; +N l33n51[] = { { sc1ccI, .407 }, H }; +N l33n54[] = { { sEc1cb, .370 }, H }; +N l33n55[] = { { sKc1, .370 }, { sge7, .148 }, { scfc6, .197 }, H }; +N l33n56[] = { { sc7cfg, 1.610 }, { sc9B, .197 }, H }; +N l33n57[] = { { sgc9, .444 }, { sgcec1g, .362 }, { sc9c2, .197 }, H }; +N l33n58[] = { { sHc1g, .611 }, { sc1cbg, .333 }, H }; +N l33n59[] = { { sOEcfg, 1.185 }, { sDce, .247 }, { sOc9, .148 }, H }; +N l33n61[] = { { sc2cf, .346 }, { sge7C, .173 }, H }; +N l33n62[] = { { scecfc7, .407 }, H }; +N l33n63[] = { { sCc1, 1.357 }, { sgEc1, .296 }, H }; +N l33n64[] = { { sgcbcf, .321 }, { sc1B, .271 }, H }; +N l33n65[] = { { sEc1cc, .296 }, { sc1c2, .173 }, H }; +N l33n67[] = { { sGc9, .197 }, H }; +N l33n68[] = { { sc5Cc5, .333 }, { sJcdg, .444 }, H }; +N l33n69[] = { { sAc5, .444 }, { sc5ca, .296 }, H }; +N l33n70[] = { { scfOc5, .333 }, { sFcb, .173 }, { scfccIcb, .296 }, H }; +N l33n71[] = { { scfG, .321 }, H }; +N l33n72[] = { { sIg, 1.814 }, { scfc7, .913 }, { sc4cc, .173 }, H }; +N l33n73[] = { { sc9C, .173 }, H }; +N l33n74[] = { { sceI, .271 }, H }; +N l33n75[] = { { scec9, .963 }, { sAc5C, .407 }, H }; +N l33n76[] = { { sDcf, .370 }, { sc5cccf, .259 }, H }; +N l33n79[] = { { sc5Eg, 1.166 }, H }; +N l33n80[] = { { sc9cec1, .259 }, H }; +N l33n81[] = { { sc1C, .395 }, H }; +N l33n84[] = { { scbcf, 1.135 }, H }; +N l33n85[] = { { sc5K, .296 }, H }; +N l33n86[] = { { sc5cb, .296 }, H }; +N l33n87[] = { { sc5c7cfg, .740 }, H }; +N l33n88[] = { { scfH, 1.333 }, { sc8g, 1.000 }, H }; +N l33n89[] = { { sOc5ceI, .444 }, { sge9, .132 }, H }; +N l33n90[] = { { sc9D, .346 }, { sgK, .181 }, { sgDc5, .222 }, { sEce, .173 }, H }; +N l33n91[] = { { sgcb, .378 }, { sceJ, .469 }, { sJE, .222 }, { sgc4c5, .197 }, H }; +N l33n92[] = { { sc1cdg, .555 }, H }; +N l33n94[] = { { sDc1, .197 }, H }; +N l33n95[] = { { sGc5g, .444 }, H }; +N l33n96[] = { { sg80, .115 }, { sc0g, .222 }, H }; +N l33n98[] = { { sc1D, .346 }, { sgcdcf, .296 }, { sHc9, .222 }, { scbcfcag, .444 }, H }; +N l33n99[] = { { sBE, .271 }, { sc1c4, .173 }, H }; +N l33n100[] = { { sEIg, 1.444 }, H }; +N l33n101[] = { { sgcec5g, .230 }, H }; +N l33n102[] = { { scbc1, .494 }, H }; +N l33n103[] = { { sc5cc, .765 }, { sJg, .555 }, { scec5g, .722 }, H }; +N l33n106[] = { { sc4ce, .247 }, { scfc9, .247 }, { sCcfH, .370 }, { sc1Hcc, .259 }, H }; +N l33n107[] = { { sEcf, 1.777 }, { sc9E, .420 }, { sc9cdc5, .259 }, H }; +N l33n108[] = { { sc9c5, .543 }, { sgcc, .214 }, H }; +N l33n109[] = { { sccc9g, .500 }, { scecb, .173 }, H }; +N l33n110[] = { { sDB, .321 }, H }; +N l33n111[] = { { sBg, 1.703 }, H }; +N l33n113[] = { { sEcfC, .333 }, H }; +N l33n114[] = { { sHJ, .617 }, { sc7c9, .346 }, { sedcf, .173 }, { sc5cbE, .222 }, H }; +N l33n115[] = { { sc1E, .888 }, { scccf, .790 }, H }; +N l33n119[] = { { sc9g, 2.369 }, H }; +N l33n120[] = { { sc5cd, .543 }, { sgcfOc5, .263 }, H }; +N l33n122[] = { { sgHJ, .222 }, H }; +N l33n123[] = { { sc4cf, .568 }, { scfca, .494 }, { sgeb, .099 }, H }; +N l33n124[] = { { sgM, .197 }, { sc6c7c1, .296 }, H }; +N l33n125[] = { { sEc1, 1.160 }, { sgcd, .559 }, H }; +N l33n126[] = { { sc1DE, .296 }, H }; +N l33n127[] = { { sc1g, 3.369 }, H }; +N l33n129[] = { { scdce, .173 }, H }; +N l33n130[] = { { scfcccf, .259 }, { sgedcf, .173 }, H }; +N l33n131[] = { { sCc5, .765 }, H }; +N l33n132[] = { { sc1cec5, .296 }, H }; +N l33n133[] = { { sccc1, .469 }, { sEc5cc, .296 }, H }; +N l33n134[] = { { sDEcf, .407 }, H }; +N l33n135[] = { { sgHg, .617 }, H }; +N l33n136[] = { { sIcbcf, .222 }, H }; +N l33n137[] = { { sc5ce, 1.012 }, { sFO, .197 }, H }; +N l33n139[] = { { sFc0, .197 }, { scfK, .173 }, { sKF, .173 }, H }; +N l33n140[] = { { scfcb, .271 }, H }; +N l33n141[] = { { scfc7cfg, 1.407 }, { sc4c1, .420 }, { sEB, .197 }, H }; +N l33n142[] = { { sgce, .773 }, { sCg, .222 }, H }; +N l33n143[] = { { sJc8, .271 }, H }; +N l33n145[] = { { sgc2JE, .197 }, { scbcfH, .222 }, H }; +N l33n146[] = { { scdcf, .617 }, H }; +N l33n147[] = { { sCF, .271 }, { sc2c5, .197 }, H }; +N l33n148[] = { { sc1Oc5, .222 }, H }; +N l33n149[] = { { sgAcf, 1.037 }, { sccB, .271 }, { sHcc, .222 }, { sc4c5cc, .259 }, H }; +N l33n150[] = { { scag, 1.592 }, H }; +N l33n152[] = { { sgME, .222 }, { sc9Bg, .389 }, { scbD, .148 }, H }; +N l33n153[] = { { sgc9g, .296 }, { sEc1E, .333 }, { sACc5, .259 }, { sCcfc4, .222 }, H }; +N l33n156[] = { { sc1Cc1, .407 }, H }; +N l33n157[] = { { scfcc, 1.012 }, { sged, .165 }, { sCc1K, .333 }, { sc1ccIce, .395 }, H }; +N l33n158[] = { { sgO, .444 }, { sEC, .420 }, { sc9H, .222 }, H }; +N l33n159[] = { { sgcf, .675 }, { sc9c8, .346 }, { sCc1g, .444 }, H }; +N l33n160[] = { { sc1Bg, .611 }, { sgEc1cb, .329 }, { scece, .247 }, { s80g, .173 }, { sgf0c1H, .230 }, H }; +N l33n161[] = { { sDE, 1.678 }, H }; +N l33n162[] = { { sDc5, .494 }, H }; +N l33n163[] = { { scfHc1, .333 }, H }; +N l33n164[] = { { scdc1, .296 }, H }; +N l33n165[] = { { sc5cag, .555 }, { sgKc1, .247 }, H }; +N l33n166[] = { { sc1H, .518 }, H }; +N l33n167[] = { { sgc2cf, .222 }, { sgDcc, .197 }, { sDEC, .222 }, H }; +N l33n169[] = { { scbE, .321 }, H }; +N l33n170[] = { { sceIg, .555 }, { sEDB, .296 }, H }; +N l33n171[] = { { scecfc7cf, .444 }, { sDcbc9, .333 }, { scfHJ, .296 }, { scec9g, .389 }, H }; +N l33n173[] = { { sDg, .481 }, H }; +N l33n174[] = { { scfcd, .765 }, { sgee, .165 }, H }; +N l33n175[] = { { sED, .222 }, H }; +N l33n176[] = { { sgA, 1.612 }, { sc9c9, .370 }, { scfOc5ce, .395 }, { scccfH, .259 }, H }; +N l33n177[] = { { scecf, 1.259 }, { sgc1, .197 }, { sJca, .197 }, H }; +N l33n178[] = { { sc3c5, .197 }, H }; +N l33n179[] = { { sOc1, .395 }, { sAcfcc, .333 }, H }; +N l33n181[] = { { scbg, .629 }, H }; +N l33n182[] = { { sgAC, .765 }, H }; +N l33n183[] = { { sHce, .247 }, H }; +N l33n184[] = { { scfHg, .666 }, { sME, .222 }, H }; +N l33n186[] = { { sgOE, .469 }, H }; +N l33n187[] = { { sc1EI, .296 }, { sgcfE, .173 }, H }; +N l33n188[] = { { sJc5g, .333 }, H }; +N l33n189[] = { { sFC, .173 }, H }; +N l33n190[] = { { scfGc5, .333 }, { scec1B, .296 }, { sAcfcd, .259 }, H }; +N l33n191[] = { { scfce, .642 }, H }; +N l33n192[] = { { sg80g, .173 }, H }; +N l33n193[] = { { sEc5, .888 }, { sc9ca, .197 }, H }; +N l33n194[] = { { sgc2, .378 }, { scec9c5, .333 }, H }; +N l33n195[] = { { scec1, 1.209 }, H }; +N l33n196[] = { { sc7c1ce, .296 }, { sOc1D, .259 }, { scdcfG, .259 }, H }; +N l33n197[] = { { sACc9, .333 }, { sHDcb, .222 }, { scbc9c5g, .444 }, H }; +N l33n198[] = { { scbc1g, .444 }, H }; +N l33n199[] = { { sCc9, .642 }, { sEc5C, .333 }, H }; +N l33n200[] = { { sHcf, .666 }, { sgDcf, .197 }, H }; +N l33n201[] = { { sccc5, .814 }, { sgc4cf, .321 }, H }; +N l33n203[] = { { sEcfg, 1.444 }, H }; +N l33n204[] = { { sEg, 1.259 }, { sc9c5g, .833 }, H }; +N l33n205[] = { { sc5C, .839 }, { scfDcb, .259 }, H }; +N l33n206[] = { { sDBg, .666 }, H }; +N l33n207[] = { { scfO, .296 }, { scfHc5, .222 }, H }; +N l33n208[] = { { sgf0, .296 }, { se7Cc1O, .296 }, H }; +N l33n209[] = { { sc4c5, .543 }, { sgR, .230 }, { sOc5ce, .370 }, { sc5ceI, .370 }, { sEF, .197 }, H }; +N l33n210[] = { { sgC, .329 }, { sc9cb, .271 }, H }; +N l33n211[] = { { sceB, .197 }, { scccfg, .444 }, H }; +N l33n212[] = { { sccg, .555 }, H }; +N l33n214[] = { { sIce, .247 }, H }; +N l33n215[] = { { sc2c9, .148 }, H }; +N l33n216[] = { { sc7cf, 1.061 }, { sc5cdg, .555 }, { sNc5, .222 }, H }; +N l33n217[] = { { sgcec1, .494 }, { sgEcf, .346 }, { sc1K, .321 }, { sGc5ce, .296 }, { sccF, .148 }, H }; +N l33n218[] = { { sHc1, .913 }, { sc1cb, .444 }, H }; +N l33n219[] = { { sOEcf, .703 }, { scfcag, .944 }, H }; +N l33n220[] = { { scbH, .173 }, H }; +N l33n222[] = { { sc5D, .864 }, { sDEH, .555 }, { sLc9, .222 }, { sc5ccc5, .259 }, H }; +N l33n223[] = { { sc5c4, .370 }, { sFE, .197 }, H }; +N l33n225[] = { { sf0c1, .222 }, H }; +N l33n227[] = { { sgD, 1.119 }, { sc9cc, .395 }, { sgccc5, .173 }, H }; +N l33n228[] = { { sgc4, .592 }, { sJcd, .197 }, H }; +N l33n229[] = { { scfccI, .407 }, { sccc1g, .444 }, { sccc5E, .296 }, { scec3, .197 }, H }; +N l33n230[] = { { sccIce, .370 }, { sc6c7c1ce, .395 }, H }; +N l33n231[] = { { sc2J, .370 }, H }; +N l33n232[] = { { scdc5, .543 }, { scfCcf, .296 }, H }; +N l33n234[] = { { sc7c1, .346 }, { sc1Ec5, .333 }, H }; +N l33n235[] = { { sc1cc, .716 }, { sFg, .851 }, { scfc7c9, .333 }, { se7C, .173 }, H }; +N l33n236[] = { { sDEc1, .481 }, H }; +N l33n237[] = { { sDcbcf, .518 }, { sc4c1g, .444 }, H }; +N l33n238[] = { { scbc9, .395 }, { scecfH, .370 }, H }; +N l33n239[] = { { sAcf, 1.234 }, { sc5E, .963 }, { sJc8g, .611 }, { sCc5c4, .259 }, H }; +N l33n240[] = { { sc5c5, .271 }, H }; +N l33n243[] = { { scdg, 1.629 }, { sEH, .420 }, { scfc2, .296 }, H }; +N l33n244[] = { { sgE, .625 }, { sc9cd, .346 }, { sgcdc5, .173 }, H }; +N l33n245[] = { { sgc5, .165 }, { sccBg, .389 }, H }; +N l33n246[] = { { sOE, .469 }, { sc3c9, .271 }, H }; +N l33n247[] = { { sOc5, .691 }, { sc5c7cf, .407 }, H }; +N l33n249[] = { { sgAcfcc, .230 }, H }; +N l33n250[] = { { sc5DE, .555 }, H }; +N l33n251[] = { { sc5g, 3.036 }, { sgAc1, .173 }, H }; +N l33n252[] = { { sc1cd, .444 }, H }; +N l33n255[] = { { sGc5, .568 }, { sgDE, .370 }, { sc9c8g, .666 }, H }; + +D l33_d = { "russian", "koi8-r", - { - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - 0.005,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - 0.011,0.364,0.059,0.024,0.115,0.402,0.021,0.088,0.038,0.289,0.052,0.139,0.185,0.136,0.281,0.518, - 0.124,0.072,0.201,0.230,0.313,0.092,0.043,0.208,0.078,0.080,0.057,0.017,0.012,0.020,0.074,V, - 0.004,0.016,0.003,V,0.003,0.004,0.001,0.009,0.002,0.009,0.002,0.009,0.001,0.011,0.011,0.008, - 0.018,0.002,0.002,0.010,0.007,0.003,V,0.004,V,V,0.001,V,0.005,V,0.001,V - }, - { - X,l33n1,X,l33n3,l33n4,l33n5,l33n6,l33n7,l33n8,X,l33n10,l33n11,l33n12,l33n13,l33n14,X, - l33n16,l33n17,l33n18,X,l33n20,l33n21,l33n22,l33n23,l33n24,l33n25,X,l33n27,l33n28,l33n29,l33n30,X, - l33n32,l33n33,l33n34,l33n35,X,l33n37,l33n38,l33n39,X,l33n41,X,X,l33n44,l33n45,X,l33n47, - l33n48,l33n49,X,l33n51,X,X,l33n54,l33n55,l33n56,l33n57,l33n58,l33n59,X,l33n61,l33n62,l33n63, - l33n64,l33n65,X,l33n67,l33n68,l33n69,l33n70,l33n71,l33n72,l33n73,l33n74,l33n75,l33n76,X,X,l33n79, - l33n80,l33n81,X,X,l33n84,l33n85,l33n86,l33n87,l33n88,l33n89,l33n90,l33n91,l33n92,X,l33n94,l33n95, - l33n96,X,l33n98,l33n99,l33n100,l33n101,l33n102,l33n103,X,X,l33n106,l33n107,l33n108,l33n109,l33n110,l33n111, - X,l33n113,l33n114,l33n115,X,X,X,l33n119,l33n120,X,l33n122,l33n123,l33n124,l33n125,l33n126,l33n127, - X,l33n129,l33n130,l33n131,l33n132,l33n133,l33n134,l33n135,l33n136,l33n137,X,l33n139,l33n140,l33n141,l33n142,l33n143, - X,l33n145,l33n146,l33n147,l33n148,l33n149,l33n150,X,l33n152,l33n153,X,X,l33n156,l33n157,l33n158,l33n159, - l33n160,l33n161,l33n162,l33n163,l33n164,l33n165,l33n166,l33n167,X,l33n169,l33n170,l33n171,X,l33n173,l33n174,l33n175, - l33n176,l33n177,l33n178,l33n179,X,l33n181,l33n182,l33n183,l33n184,X,l33n186,l33n187,l33n188,l33n189,l33n190,l33n191, - l33n192,l33n193,l33n194,l33n195,l33n196,l33n197,l33n198,l33n199,l33n200,l33n201,X,l33n203,l33n204,l33n205,l33n206,l33n207, - l33n208,l33n209,l33n210,l33n211,l33n212,X,l33n214,l33n215,l33n216,l33n217,l33n218,l33n219,l33n220,X,l33n222,l33n223, - X,l33n225,X,l33n227,l33n228,l33n229,l33n230,l33n231,l33n232,X,l33n234,l33n235,l33n236,l33n237,l33n238,l33n239, - l33n240,X,X,l33n243,l33n244,l33n245,l33n246,l33n247,X,l33n249,l33n250,l33n251,l33n252,X,X,l33n255 - } + { W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + 0.005, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + 0.011, 0.364, 0.059, 0.024, 0.115, 0.402, 0.021, 0.088, 0.038, 0.289, 0.052, 0.139, 0.185, 0.136, 0.281, 0.518, + 0.124, 0.072, 0.201, 0.230, 0.313, 0.092, 0.043, 0.208, 0.078, 0.080, 0.057, 0.017, 0.012, 0.020, 0.074, V, + 0.004, 0.016, 0.003, V, 0.003, 0.004, 0.001, 0.009, 0.002, 0.009, 0.002, 0.009, 0.001, 0.011, 0.011, 0.008, + 0.018, 0.002, 0.002, 0.010, 0.007, 0.003, V, 0.004, V, V, 0.001, V, 0.005, V, 0.001, V }, + { X, l33n1, X, l33n3, l33n4, l33n5, l33n6, l33n7, l33n8, X, l33n10, l33n11, l33n12, l33n13, l33n14, X, + l33n16, l33n17, l33n18, X, l33n20, l33n21, l33n22, l33n23, l33n24, l33n25, X, l33n27, l33n28, l33n29, l33n30, X, + l33n32, l33n33, l33n34, l33n35, X, l33n37, l33n38, l33n39, X, l33n41, X, X, l33n44, l33n45, X, l33n47, + l33n48, l33n49, X, l33n51, X, X, l33n54, l33n55, l33n56, l33n57, l33n58, l33n59, X, l33n61, l33n62, l33n63, + l33n64, l33n65, X, l33n67, l33n68, l33n69, l33n70, l33n71, l33n72, l33n73, l33n74, l33n75, l33n76, X, X, l33n79, + l33n80, l33n81, X, X, l33n84, l33n85, l33n86, l33n87, l33n88, l33n89, l33n90, l33n91, l33n92, X, l33n94, l33n95, + l33n96, X, l33n98, l33n99, l33n100, l33n101, l33n102, l33n103, X, X, l33n106, l33n107, l33n108, l33n109, l33n110, l33n111, + X, l33n113, l33n114, l33n115, X, X, X, l33n119, l33n120, X, l33n122, l33n123, l33n124, l33n125, l33n126, l33n127, + X, l33n129, l33n130, l33n131, l33n132, l33n133, l33n134, l33n135, l33n136, l33n137, X, l33n139, l33n140, l33n141, l33n142, l33n143, + X, l33n145, l33n146, l33n147, l33n148, l33n149, l33n150, X, l33n152, l33n153, X, X, l33n156, l33n157, l33n158, l33n159, + l33n160, l33n161, l33n162, l33n163, l33n164, l33n165, l33n166, l33n167, X, l33n169, l33n170, l33n171, X, l33n173, l33n174, l33n175, + l33n176, l33n177, l33n178, l33n179, X, l33n181, l33n182, l33n183, l33n184, X, l33n186, l33n187, l33n188, l33n189, l33n190, l33n191, + l33n192, l33n193, l33n194, l33n195, l33n196, l33n197, l33n198, l33n199, l33n200, l33n201, X, l33n203, l33n204, l33n205, l33n206, l33n207, + l33n208, l33n209, l33n210, l33n211, l33n212, X, l33n214, l33n215, l33n216, l33n217, l33n218, l33n219, l33n220, X, l33n222, l33n223, + X, l33n225, X, l33n227, l33n228, l33n229, l33n230, l33n231, l33n232, X, l33n234, l33n235, l33n236, l33n237, l33n238, l33n239, + l33n240, X, X, l33n243, l33n244, l33n245, l33n246, l33n247, X, l33n249, l33n250, l33n251, l33n252, X, X, l33n255 } }; - - // // Lng: russian // Enc: windows1251 // - -S sf1f2[]={241,242,0}; -S sedee[]={237,238,0}; -S sffg[]={255,a}; -S seeS[]={238,226,0}; -S sedQ[]={237,224,0}; -S sefee[]={239,238,0}; -S sgefee[]={32,239,238,0}; -S seef1[]={238,241,0}; -S sQeb[]={224,235,0}; -S sede8[]={237,232,0}; -S sf0Q[]={240,224,0}; -S sge8g[]={32,232,a}; -S seaee[]={234,238,0}; -S sf2Q[]={242,224,0}; -S sebe8[]={235,232,0}; -S seaQ[]={234,224,0}; -S sebee[]={235,238,0}; -S sf2eeg[]={242,238,a}; -S seef0[]={238,240,0}; -S sSee[]={226,238,0}; -S sf0e8[]={240,232,0}; -S seff0[]={239,240,0}; -S sf2fc[]={242,252,0}; -S sQea[]={224,234,0}; -S sebQ[]={235,224,0}; -S sQed[]={224,237,0}; -S sgedQ[]={32,237,224,0}; -S sf2fcg[]={242,252,a}; -S se8eb[]={232,235,0}; -S seeeb[]={238,235,0}; -S seeed[]={238,237,0}; -S sQS[]={224,226,0}; -S sgSg[]={32,226,a}; -S se8f2[]={232,242,0}; -S sVec[]={229,236,0}; -S sSV[]={226,229,0}; -S sedQg[]={237,224,a}; -S sedfb[]={237,251,0}; -S sf1ff[]={241,255,0}; -S sWV[]={230,229,0}; -S sgeff0[]={32,239,240,0}; -S sQf0[]={224,240,0}; -S seeT[]={238,227,0}; -S secee[]={236,238,0}; -S sedf3[]={237,243,0}; -S se8ea[]={232,234,0}; -S sSe8[]={226,232,0}; -S sf1ffg[]={241,255,a}; -S sf7f2[]={247,242,0}; -S sRee[]={225,238,0}; -S se8ed[]={232,237,0}; -S se8e7[]={232,231,0}; -S sgedQg[]={32,237,224,a}; -S sf7f2ee[]={247,242,238,0}; -S sgeaee[]={32,234,238,0}; -S seee9g[]={238,233,a}; -S sQf2[]={224,242,0}; -S sf7f2eeg[]={247,242,238,a}; -S sSf1[]={226,241,0}; -S sebfc[]={235,252,0}; -S sf3eb[]={243,235,0}; -S sQebg[]={224,235,a}; -S seae8[]={234,232,0}; -S seef1f2[]={238,241,242,0}; -S sgf7f2[]={32,247,242,0}; -S sf2f0[]={242,240,0}; -S sQeag[]={224,234,a}; -S sgf7f2ee[]={32,247,242,238,0}; -S sf1f2Q[]={241,242,224,0}; -S sVecg[]={229,236,a}; -S sgf1f2[]={32,241,242,0}; -S sf1fcg[]={241,252,a}; -S sQf1[]={224,241,0}; -S sge7Q[]={32,231,224,0}; -S sTeeg[]={227,238,a}; -S sRfb[]={225,251,0}; -S sgSf1[]={32,226,241,0}; -S se8f2fc[]={232,242,252,0}; -S sgRfb[]={32,225,251,0}; -S sf3f2[]={243,242,0}; -S seff0ee[]={239,240,238,0}; -S sebe8g[]={235,232,a}; -S seaf3[]={234,243,0}; -S sUVeb[]={228,229,235,0}; -S sf2S[]={242,226,0}; -S sgeef1[]={32,238,241,0}; -S sSf1V[]={226,241,229,0}; -S sUQg[]={228,224,a}; -S seaQg[]={234,224,a}; -S sgf2V[]={32,242,229,0}; -S sgeaQ[]={32,234,224,0}; -S sgf2Q[]={32,242,224,0}; -S sfbeb[]={251,235,0}; -S se8f2fcg[]={232,242,252,a}; -S sf2e8[]={242,232,0}; -S secf3[]={236,243,0}; -S seeecg[]={238,236,a}; -S sgf1ee[]={32,241,238,0}; -S sfbe9[]={251,233,0}; -S sQff[]={224,255,0}; -S sedeeg[]={237,238,a}; -S sgff[]={32,255,0}; -S se8ebg[]={232,235,a}; -S seded[]={237,237,0}; -S seef7[]={238,247,0}; -S sgedVg[]={32,237,229,a}; -S sgcdf3[]={32,205,243,0}; -S sfbe9g[]={251,233,a}; -S sgTee[]={32,227,238,0}; -S scdf3[]={205,243,0}; -S sWVg[]={230,229,a}; -S sf1f2ee[]={241,242,238,0}; -S sebf1ffg[]={235,241,255,a}; -S sebf1[]={235,241,0}; -S sRfbeb[]={225,251,235,0}; -S scdf3g[]={205,243,a}; -S se8Vg[]={232,229,a}; -S sgeef2[]={32,238,242,0}; -S sQffg[]={224,255,a}; -S seeTee[]={238,227,238,0}; -S sQe7[]={224,231,0}; -S sf3U[]={243,228,0}; -S sVede8[]={229,237,232,0}; -S sgUee[]={32,228,238,0}; -S sebf1ff[]={235,241,255,0}; -S sf0f3[]={240,243,0}; -S sUed[]={228,237,0}; -S sVf1f2[]={229,241,242,0}; -S se8e9[]={232,233,0}; -S sgcdf3g[]={32,205,243,a}; -S sgRfbeb[]={32,225,251,235,0}; -S sgWV[]={32,230,229,0}; -S sf2fb[]={242,251,0}; -S sgSee[]={32,226,238,0}; -S sf1f2f0[]={241,242,240,0}; -S sSeef0[]={226,238,240,0}; -S sf2Qea[]={242,224,234,0}; -S sf1ea[]={241,234,0}; -S sedfc[]={237,252,0}; -S sgeff0ee[]={32,239,240,238,0}; -S se8ec[]={232,236,0}; -S sgRf3[]={32,225,243,0}; -S sgSf1V[]={32,226,241,229,0}; -S seeSee[]={238,226,238,0}; -S sebQg[]={235,224,a}; -S sf2f1[]={242,241,0}; -S sf2f3[]={242,243,0}; -S sf5ee[]={245,238,0}; -S sf0fb[]={240,251,0}; -S sQede8[]={224,237,232,0}; -S sefVf0[]={239,229,240,0}; -S sebeef1[]={235,238,241,0}; -S sf2Veb[]={242,229,235,0}; -S se8S[]={232,226,0}; -S sgf2ee[]={32,242,238,0}; -S sgf2Qea[]={32,242,224,234,0}; -S sedeee9[]={237,238,233,0}; -S sgeaQea[]={32,234,224,234,0}; -S sf2ed[]={242,237,0}; -S sWVed[]={230,229,237,0}; -S sedf3eb[]={237,243,235,0}; -S sf2eef0[]={242,238,240,0}; -S se8e9g[]={232,233,a}; -S sSQeb[]={226,224,235,0}; -S sgUQ[]={32,228,224,0}; -S sgf0Q[]={32,240,224,0}; -S sgefeeeb[]={32,239,238,235,0}; -S sgecee[]={32,236,238,0}; -S sgffg[]={32,255,a}; -S sf7Q[]={247,224,0}; -S sgede8[]={32,237,232,0}; -S sedfbe9g[]={237,251,233,a}; -S sebeeg[]={235,238,a}; -S sgf1f2Q[]={32,241,242,224,0}; -S seaQea[]={234,224,234,0}; -S sWe8[]={230,232,0}; -S seeSeef0[]={238,226,238,240,0}; -S seeW[]={238,230,0}; -S se8e8[]={232,232,0}; -S sf2fbg[]={242,251,a}; -S sVebg[]={229,235,a}; -S sfbVg[]={251,229,a}; -S sedeeS[]={237,238,226,0}; -S sf2edee[]={242,237,238,0}; -S sVeded[]={229,237,237,0}; -S sedfbe9[]={237,251,233,0}; -S sefeeeb[]={239,238,235,0}; -S sf7e8[]={247,232,0}; -S sQSQ[]={224,226,224,0}; -S sedeee9g[]={237,238,233,a}; -S sVf0V[]={229,240,229,0}; -S sf6e8[]={246,232,0}; -S seeSQ[]={238,226,224,0}; -S seeSg[]={238,226,a}; -S sfbV[]={251,229,0}; -S se8e8g[]={232,232,a}; -S sf1Vec[]={241,229,236,0}; -S sUQS[]={228,224,226,0}; -S se8edf3[]={232,237,243,0}; -S sebeef1fc[]={235,238,241,252,0}; -S sedfbV[]={237,251,229,0}; -S sf1e8[]={241,232,0}; -S sefeeg[]={239,238,a}; -S sedeeT[]={237,238,227,0}; -S seaQeag[]={234,224,234,a}; -S sedfbVg[]={237,251,229,a}; -S se8f5[]={232,245,0}; -S seef8[]={238,248,0}; -S sVTee[]={229,227,238,0}; -S sTeeS[]={227,238,226,0}; -S sQf7[]={224,247,0}; -S seef2ee[]={238,242,238,0}; -S seef1fcg[]={238,241,252,a}; -S seff0e8[]={239,240,232,0}; -S seeef[]={238,239,0}; -S seeTeeg[]={238,227,238,a}; -S seef0ee[]={238,240,238,0}; -S sgeef1f2[]={32,238,241,242,0}; -S sf8ea[]={248,234,0}; -S sebff[]={235,255,0}; -S sgeeR[]={32,238,225,0}; -S sgece8[]={32,236,232,0}; -S seeUe8[]={238,228,232,0}; -S sededfb[]={237,237,251,0}; -S sVea[]={229,234,0}; -S sf0e8f2[]={240,232,242,0}; -S sQSe8[]={224,226,232,0}; -S sVebQ[]={229,235,224,0}; -S se8f6[]={232,246,0}; -S sSfb[]={226,251,0}; -S sSe8U[]={226,232,228,0}; -S sf0Qg[]={240,224,a}; -S sSed[]={226,237,0}; -S sSVf0[]={226,229,240,0}; -S seaf2[]={234,242,0}; -S secf3g[]={236,243,a}; -S seff0Q[]={239,240,224,0}; -S sf1f2S[]={241,242,226,0}; -S sQf0Q[]={224,240,224,0}; -S seef1fc[]={238,241,252,0}; -S sSQg[]={226,224,a}; -S sTeb[]={227,235,0}; -S sf3W[]={243,230,0}; -S sUS[]={228,226,0}; -S se7fb[]={231,251,0}; -S sedff[]={237,255,0}; -S sTeeSee[]={227,238,226,238,0}; -S seeUed[]={238,228,237,0}; -S sgefeeg[]={32,239,238,a}; -S sVedf2[]={229,237,242,0}; -S seef0e8f2[]={238,240,232,242,0}; -S sf3ebg[]={243,235,a}; -S sece8eb[]={236,232,235,0}; -S sTf3[]={227,243,0}; -S sgfdf2[]={32,253,242,0}; -S sUedee[]={228,237,238,0}; -S sf8eaQ[]={248,234,224,0}; -S sRfbebee[]={225,251,235,238,0}; -S sf2f1ff[]={242,241,255,0}; -S sQf2fcg[]={224,242,252,a}; -S sgVTee[]={32,229,227,238,0}; -S sf1f2e8[]={241,242,232,0}; -S seeebfc[]={238,235,252,0}; -S sf0Qed[]={240,224,237,0}; -S sgVT[]={32,229,227,0}; -S sf2SV[]={242,226,229,0}; -S sededfbe9[]={237,237,251,233,0}; -S seeebee[]={238,235,238,0}; -S sQef[]={224,239,0}; -S sgUS[]={32,228,226,0}; -S se7Qg[]={231,224,a}; -S se8SQ[]={232,226,224,0}; -S seced[]={236,237,0}; -S sefe8[]={239,232,0}; -S sTQ[]={227,224,0}; -S sedeeTee[]={237,238,227,238,0}; -S seef5[]={238,245,0}; -S se8e7ec[]={232,231,236,0}; -S sfdf2ee[]={253,242,238,0}; -S sede8g[]={237,232,a}; -S se8eaee[]={232,234,238,0}; -S sf0ff[]={240,255,0}; -S sfbebee[]={251,235,238,0}; -S sVedQ[]={229,237,224,0}; -S sefQ[]={239,224,0}; -S sTe8[]={227,232,0}; -S sQf0e8[]={224,240,232,0}; -S seaf3g[]={234,243,a}; - -N l34n0[]={{sfbeb,.291},{sUVed,.262},H}; -N l34n1[]={{sffg,1.836},{sTeeS,.262},H}; -N l34n3[]={{sgf3,.369},{sRfbeb,.393},H}; -N l34n4[]={{sgU,.661},{sUe8,.350},H}; -N l34n7[]={{seeV,.408},{seef1fcg,.525},H}; -N l34n8[]={{sf3eb,.408},{sVTee,.262},{sQf0e8,.219},H}; -N l34n9[]={{sgeef1,.321},{sSfb,.175},H}; -N l34n10[]={{sf2fc,.758},{sQeag,.852},{sgeaQ,.291},H}; -N l34n11[]={{sf2ed,.204},H}; -N l34n12[]={{sedeeTee,.291},H}; -N l34n13[]={{sRee,.437},H}; -N l34n14[]={{seeSee,.350},{sf1ef,.175},H}; -N l34n15[]={{sWV,.525},{sgeff0,.525},{sQff,.291},{sf1Q,.262},H}; -N l34n16[]={{sQf0,.495},H}; -N l34n17[]={{sQR,.146},H}; -N l34n18[]={{sVe7,.233},H}; -N l34n19[]={{se8ebg,.656},{sgfdf2,.146},H}; -N l34n20[]={{sgeef2,.262},H}; -N l34n21[]={{sgV,.233},{sece8eb,.219},H}; -N l34n23[]={{secf3g,.393},{seef5,.146},H}; -N l34n24[]={{seeW,.204},{sTeb,.175},{sVedQ,.219},H}; -N l34n25[]={{se8f1,.291},H}; -N l34n26[]={{se8S,.233},{sQSe8,.262},H}; -N l34n27[]={{sede8,1.020},{sQebg,.852},{seff0ee,.481},{sgf1ee,.291},{sSed,.175},H}; -N l34n28[]={{sf2ee,1.574},{sgSee,.233},{se7f3,.175},H}; -N l34n29[]={{se7U,.175},H}; -N l34n30[]={{sf1ff,.525},{sf7V,.321},{seef2ee,.262},H}; -N l34n31[]={{seeTee,.393},{sefeeg,.393},{sf0Qed,.219},H}; -N l34n33[]={{sQf1,.350},H}; -N l34n34[]={{sQS,.641},{sVf1f2,.393},{sVf7,.204},H}; -N l34n36[]={{seaee,.962},H}; -N l34n37[]={{seeUed,.262},H}; -N l34n38[]={{sgW,.272},{sefV,.379},H}; -N l34n39[]={{sf2SV,.219},H}; -N l34n42[]={{se8f2,.612},H}; -N l34n44[]={{sSee,.758},{sgf2ee,.233},{sf0fcg,.393},H}; -N l34n45[]={{sVf2g,.787},{sgTee,.262},H}; -N l34n46[]={{sf2Q,.903},H}; -N l34n47[]={{sRf0,.204},{sgffg,.204},H}; -N l34n48[]={{sf0g,.219},H}; -N l34n49[]={{sebfc,.408},H}; -N l34n50[]={{sQf2,.408},{sf6e8,.204},{sUQS,.262},{sf8eaQ,.219},H}; -N l34n51[]={{sf0f3,.262},H}; -N l34n52[]={{sVe9,.233},{seeSg,.459},H}; -N l34n53[]={{sf7f2ee,.612},{sedfbV,.262},H}; -N l34n54[]={{seaQ,.874},{sSf1V,.437},H}; -N l34n55[]={{sge7,.408},{sedeeS,.306},H}; -N l34n56[]={{se8g,3.541},H}; -N l34n57[]={{seef1f2,.568},{seef7,.291},{sededfb,.262},{sf1f2e8,.219},{se7Qg,.328},H}; -N l34n58[]={{sfbebee,.219},H}; -N l34n60[]={{sf2Qea,.350},{se8U,.233},H}; -N l34n61[]={{sgedQ,.729},{sgSf1,.321},{sebe8g,.721},{sf8V,.262},H}; -N l34n62[]={{sSQ,.903},{sf2f0,.379},{sfbe9g,.590},{sgUee,.262},{sWVed,.306},H}; -N l34n64[]={{sQg,3.279},H}; -N l34n65[]={{sf1f2,1.515},{seeebfc,.219},H}; -N l34n66[]={{sgSg,.612},{sgRf3,.233},{sWe8,.204},{sedeeT,.262},H}; -N l34n67[]={{sebee,.787},H}; -N l34n68[]={{seaQea,.306},{sQU,.204},{sf2f1ff,.219},H}; -N l34n69[]={{sf0V,.466},{sf2edee,.306},{sVea,.175},H}; -N l34n70[]={{se8edf3,.262},H}; -N l34n71[]={{sgf7,.369},{sgf1f2,.350},H}; -N l34n72[]={{sge8,.894},{sedVg,1.115},H}; -N l34n74[]={{seef8,.175},H}; -N l34n75[]={{sTee,.758},{seee9,.437},{sf1fcg,.787},H}; -N l34n77[]={{se8V,.350},H}; -N l34n78[]={{sgcdf3g,.350},H}; -N l34n79[]={{sf1g,.525},{sf2f1,.233},H}; -N l34n80[]={{sf2S,.321},{sgf2Qea,.311},{sf0Qg,.393},H}; -N l34n81[]={{sf7e8,.204},{seced,.146},H}; -N l34n85[]={{sebQ,.729},H}; -N l34n86[]={{sVeb,.816},{scdf3g,.590},H}; -N l34n87[]={{se9g,1.749},{sSQeb,.306},H}; -N l34n89[]={{sUed,.262},{sf2fbg,.459},{sgeeR,.175},{sgefeeg,.233},{sefe8,.146},H}; -N l34n91[]={{sgRfbeb,.350},H}; -N l34n93[]={{sf3f0,.262},{se8f5,.175},{sTQ,.146},H}; -N l34n94[]={{sedfb,.554},{se8f2fcg,.874},{sf3R,.204},H}; -N l34n95[]={{sSf1,.408},H}; -N l34n97[]={{sedfbe9,.306},H}; -N l34n98[]={{secee,.495},{sRf3,.262},H}; -N l34n99[]={{sgecV,.175},H}; -N l34n100[]={{sf1V,.583},{sebff,.175},H}; -N l34n102[]={{sQf2fcg,.437},H}; -N l34n103[]={{sVec,.583},{seeVg,.525},H}; -N l34n104[]={{seaf2,.175},{sf3ebg,.328},H}; -N l34n106[]={{sgea,.699},{sf2fcg,1.639},{sUee,.321},H}; -N l34n107[]={{sebf1ff,.393},H}; -N l34n108[]={{sgcc,.175},{sf2eef0,.306},H}; -N l34n109[]={{seeeb,.699},H}; -N l34n110[]={{sf2g,1.137},{se8f6,.175},H}; -N l34n111[]={{se8e7,.408},{sWVg,.590},{sQffg,.590},{sedfc,.233},H}; -N l34n112[]={{seded,.291},{sf8e8,.262},{sVede8,.393},{sgf0Q,.204},H}; -N l34n113[]={{sf2f3,.233},H}; -N l34n116[]={{sgedV,.699},{seeSQ,.306},{secQ,.204},H}; -N l34n118[]={{seag,.962},{sebf1,.262},{sefVf0,.350},H}; -N l34n119[]={{sgf7f2ee,.505},{sQe7,.262},H}; -N l34n120[]={{sVed,1.078},{sf0e8,.758},H}; -N l34n121[]={{seaf3,.321},{sf5ee,.233},H}; -N l34n123[]={{sgeb,.194},{sf1f2ee,.393},{sede8g,.328},H}; -N l34n124[]={{sf2eeg,1.770},{sUQ,.758},{sSeef0,.350},H}; -N l34n125[]={{sgcd,.272},H}; -N l34n126[]={{sSg,1.311},{seeec,.466},{sf1ffg,1.049},H}; -N l34n127[]={{sf3f2,.321},{seeTeeg,.525},H}; -N l34n128[]={{se8e8,.204},H}; -N l34n129[]={{sedee,1.282},{seff0Q,.262},H}; -N l34n130[]={{sVf0V,.306},H}; -N l34n131[]={{sf2V,.729},H}; -N l34n132[]={{sedeee9,.306},{sgece8,.175},H}; -N l34n133[]={{sfbg,1.049},H}; -N l34n135[]={{sQf7,.175},H}; -N l34n136[]={{sf1Vec,.262},H}; -N l34n140[]={{sgec,.602},{sefeb,.262},H}; -N l34n141[]={{sf3g,1.530},H}; -N l34n143[]={{seeed,.670},H}; -N l34n144[]={{seef0e8f2,.291},H}; -N l34n145[]={{sf3U,.262},{se8e9,.262},{sf1f2f0,.350},H}; -N l34n146[]={{sgf2Q,.291},{sebeef1fc,.350},{sf8ea,.175},{sSe8U,.262},H}; -N l34n147[]={{sedQ,1.195},{sSV,.554},{sUedee,.219},{se8e7ec,.219},H}; -N l34n148[]={{sVe9g,.459},H}; -N l34n149[]={{sebg,1.749},{sf7f2eeg,1.224},{sgede8,.204},{sedfbVg,.525},H}; -N l34n150[]={{seaQg,.656},H}; -N l34n151[]={{sf1e8,.175},H}; -N l34n152[]={{sQf8,.262},H}; -N l34n154[]={{sgRfb,.321},{sfbV,.204},H}; -N l34n156[]={{sf2Veb,.350},H}; -N l34n157[]={{sged,1.166},{sgedQg,.544},H}; -N l34n158[]={{sebeef1,.350},{sSQg,.393},{sUS,.175},H}; -N l34n159[]={{sgcf,.117},H}; -N l34n160[]={{sTf3,.146},{sgVTee,.194},H}; -N l34n162[]={{se8ea,.466},{sedff,.175},H}; -N l34n163[]={{sebeeg,.459},H}; -N l34n164[]={{sfcg,2.492},{sgeaee,.408},{sgUQ,.204},{seaQeag,.525},{se7fb,.175},H}; -N l34n165[]={{se7ec,.175},H}; -N l34n167[]={{sVeded,.306},{seef1fc,.262},{seeebee,.219},H}; -N l34n168[]={{sge8g,.991},H}; -N l34n170[]={{sQea,.729},{sebV,.379},H}; -N l34n171[]={{sVf0,.903},{seee9g,.918},{sTeeg,.721},H}; -N l34n173[]={{sgf7f2,.379},{se8Vg,.590},H}; -N l34n174[]={{sgee,.758},H}; -N l34n176[]={{sQf0Q,.262},H}; -N l34n177[]={{seeef,.175},H}; -N l34n179[]={{se8eb,.699},{sf3W,.175},H}; -N l34n180[]={{secg,1.443},H}; -N l34n181[]={{sebQg,.525},H}; -N l34n182[]={{se7ed,.291},{sf2e8,.291},{sVebg,.459},H}; -N l34n183[]={{secf3,.291},H}; -N l34n185[]={{sf1ea,.233},H}; -N l34n186[]={{sgefeeeb,.272},{sgUS,.146},{se8SQ,.219},H}; -N l34n187[]={{sQeb,1.049},{sf0fb,.233},H}; -N l34n188[]={{sVf1,.466},{sUg,.262},H}; -N l34n190[]={{seae8,.379},H}; -N l34n191[]={{sgef,1.379},{sefee,1.137},H}; -N l34n193[]={{sgB,.175},{sedfbe9g,.612},H}; -N l34n194[]={{seef0,.787},{sgc2,.233},{sQSQ,.306},H}; -N l34n195[]={{seeR,.525},H}; -N l34n196[]={{se8ec,.233},H}; -N l34n197[]={{sedf2,.233},H}; -N l34n198[]={{sSe8,.466},{sgecee,.204},H}; -N l34n199[]={{sVecg,.787},H}; -N l34n200[]={{sgeaQea,.272},H}; -N l34n201[]={{secV,.437},{sgf2V,.291},{sf7Q,.204},H}; -N l34n203[]={{sf5g,.656},{sebf1ffg,.787},{sTeeSee,.350},H}; -N l34n204[]={{sf0fc,.233},{sQec,.233},H}; -N l34n205[]={{sVf2,.612},{sRfbebee,.291},H}; -N l34n206[]={{sVT,.291},H}; -N l34n207[]={{sgff,.194},H}; -N l34n208[]={{sgf0,.311},H}; -N l34n209[]={{sgR,.622},{sUV,.845},{sefQ,.146},H}; -N l34n211[]={{seef1,1.078},{sedg,.306},H}; -N l34n212[]={{seeS,1.195},{sgedVg,.389},H}; -N l34n213[]={{se8ed,.437},{sQede8,.350},H}; -N l34n214[]={{sedf3,.466},{sgVT,.146},H}; -N l34n215[]={{sge7Q,.350},H}; -N l34n216[]={{sefeeeb,.306},H}; -N l34n217[]={{se7Q,.495},{sgeff0ee,.311},{seff0e8,.262},{seaf3g,.328},H}; -N l34n219[]={{sVg,3.322},{sgUV,.204},H}; -N l34n220[]={{sUQg,.656},{se8eaee,.219},H}; -N l34n221[]={{sebe8,.874},{sQed,.729},H}; -N l34n222[]={{sf0ee,.962},{seeecg,.656},{sfbe9,.291},{seeSeef0,.408},{sf0e8f2,.262},{sVedf2,.219},H}; -N l34n223[]={{sVU,.408},{sgeef1f2,.233},H}; -N l34n224[]={{se8e8g,.459},H}; -N l34n225[]={{sgf1,.971},{seff0,.758},{sf1f2Q,.568},{sedeeg,.656},H}; -N l34n226[]={{sgS,1.030},{sfeg,.525},H}; -N l34n227[]={{sSVf0,.262},H}; -N l34n228[]={{seef2,.699},{sedeee9g,.612},{sgc4,.117},H}; -N l34n229[]={{seeT,.495},{sTe8,.146},H}; -N l34n231[]={{sgf1f2Q,.272},H}; -N l34n232[]={{sedV,1.137},H}; -N l34n234[]={{sRfb,.321},{sUVeb,.481},H}; -N l34n235[]={{sf1fc,.350},H}; -N l34n236[]={{sgSf1V,.311},H}; -N l34n238[]={{sgcdf3,.262},{seeUe8,.262},H}; -N l34n239[]={{sedf3eb,.306},{sfdf2ee,.219},H}; -N l34n240[]={{sf0Q,1.020},H}; -N l34n241[]={{se8e9g,.459},H}; -N l34n242[]={{seeg,3.541},{sgf2,.738},H}; -N l34n243[]={{sedQg,1.246},{sgT,.291},H}; -N l34n244[]={{sededfbe9,.291},H}; -N l34n246[]={{seeU,.641},{scdf3,.262},{sVebQ,.262},H}; -N l34n247[]={{sf1f2S,.262},H}; -N l34n249[]={{sgefee,1.107},{sf2fb,.233},H}; -N l34n250[]={{sfbVg,.459},H}; -N l34n251[]={{sf7f2,.437},H}; -N l34n252[]={{sece8,.321},{seef0ee,.262},H}; -N l34n253[]={{sf1ee,.350},{sgWV,.262},H}; -N l34n254[]={{se8f2fc,.481},H}; -N l34n255[]={{sQef,.146},{sf0ff,.146},H}; - -D l34_d = -{ +S sf1f2[] = { 241, 242, 0 }; +S sedee[] = { 237, 238, 0 }; +S sffg[] = { 255, a }; +S seeS[] = { 238, 226, 0 }; +S sedQ[] = { 237, 224, 0 }; +S sefee[] = { 239, 238, 0 }; +S sgefee[] = { 32, 239, 238, 0 }; +S seef1[] = { 238, 241, 0 }; +S sQeb[] = { 224, 235, 0 }; +S sede8[] = { 237, 232, 0 }; +S sf0Q[] = { 240, 224, 0 }; +S sge8g[] = { 32, 232, a }; +S seaee[] = { 234, 238, 0 }; +S sf2Q[] = { 242, 224, 0 }; +S sebe8[] = { 235, 232, 0 }; +S seaQ[] = { 234, 224, 0 }; +S sebee[] = { 235, 238, 0 }; +S sf2eeg[] = { 242, 238, a }; +S seef0[] = { 238, 240, 0 }; +S sSee[] = { 226, 238, 0 }; +S sf0e8[] = { 240, 232, 0 }; +S seff0[] = { 239, 240, 0 }; +S sf2fc[] = { 242, 252, 0 }; +S sQea[] = { 224, 234, 0 }; +S sebQ[] = { 235, 224, 0 }; +S sQed[] = { 224, 237, 0 }; +S sgedQ[] = { 32, 237, 224, 0 }; +S sf2fcg[] = { 242, 252, a }; +S se8eb[] = { 232, 235, 0 }; +S seeeb[] = { 238, 235, 0 }; +S seeed[] = { 238, 237, 0 }; +S sQS[] = { 224, 226, 0 }; +S sgSg[] = { 32, 226, a }; +S se8f2[] = { 232, 242, 0 }; +S sVec[] = { 229, 236, 0 }; +S sSV[] = { 226, 229, 0 }; +S sedQg[] = { 237, 224, a }; +S sedfb[] = { 237, 251, 0 }; +S sf1ff[] = { 241, 255, 0 }; +S sWV[] = { 230, 229, 0 }; +S sgeff0[] = { 32, 239, 240, 0 }; +S sQf0[] = { 224, 240, 0 }; +S seeT[] = { 238, 227, 0 }; +S secee[] = { 236, 238, 0 }; +S sedf3[] = { 237, 243, 0 }; +S se8ea[] = { 232, 234, 0 }; +S sSe8[] = { 226, 232, 0 }; +S sf1ffg[] = { 241, 255, a }; +S sf7f2[] = { 247, 242, 0 }; +S sRee[] = { 225, 238, 0 }; +S se8ed[] = { 232, 237, 0 }; +S se8e7[] = { 232, 231, 0 }; +S sgedQg[] = { 32, 237, 224, a }; +S sf7f2ee[] = { 247, 242, 238, 0 }; +S sgeaee[] = { 32, 234, 238, 0 }; +S seee9g[] = { 238, 233, a }; +S sQf2[] = { 224, 242, 0 }; +S sf7f2eeg[] = { 247, 242, 238, a }; +S sSf1[] = { 226, 241, 0 }; +S sebfc[] = { 235, 252, 0 }; +S sf3eb[] = { 243, 235, 0 }; +S sQebg[] = { 224, 235, a }; +S seae8[] = { 234, 232, 0 }; +S seef1f2[] = { 238, 241, 242, 0 }; +S sgf7f2[] = { 32, 247, 242, 0 }; +S sf2f0[] = { 242, 240, 0 }; +S sQeag[] = { 224, 234, a }; +S sgf7f2ee[] = { 32, 247, 242, 238, 0 }; +S sf1f2Q[] = { 241, 242, 224, 0 }; +S sVecg[] = { 229, 236, a }; +S sgf1f2[] = { 32, 241, 242, 0 }; +S sf1fcg[] = { 241, 252, a }; +S sQf1[] = { 224, 241, 0 }; +S sge7Q[] = { 32, 231, 224, 0 }; +S sTeeg[] = { 227, 238, a }; +S sRfb[] = { 225, 251, 0 }; +S sgSf1[] = { 32, 226, 241, 0 }; +S se8f2fc[] = { 232, 242, 252, 0 }; +S sgRfb[] = { 32, 225, 251, 0 }; +S sf3f2[] = { 243, 242, 0 }; +S seff0ee[] = { 239, 240, 238, 0 }; +S sebe8g[] = { 235, 232, a }; +S seaf3[] = { 234, 243, 0 }; +S sUVeb[] = { 228, 229, 235, 0 }; +S sf2S[] = { 242, 226, 0 }; +S sgeef1[] = { 32, 238, 241, 0 }; +S sSf1V[] = { 226, 241, 229, 0 }; +S sUQg[] = { 228, 224, a }; +S seaQg[] = { 234, 224, a }; +S sgf2V[] = { 32, 242, 229, 0 }; +S sgeaQ[] = { 32, 234, 224, 0 }; +S sgf2Q[] = { 32, 242, 224, 0 }; +S sfbeb[] = { 251, 235, 0 }; +S se8f2fcg[] = { 232, 242, 252, a }; +S sf2e8[] = { 242, 232, 0 }; +S secf3[] = { 236, 243, 0 }; +S seeecg[] = { 238, 236, a }; +S sgf1ee[] = { 32, 241, 238, 0 }; +S sfbe9[] = { 251, 233, 0 }; +S sQff[] = { 224, 255, 0 }; +S sedeeg[] = { 237, 238, a }; +S sgff[] = { 32, 255, 0 }; +S se8ebg[] = { 232, 235, a }; +S seded[] = { 237, 237, 0 }; +S seef7[] = { 238, 247, 0 }; +S sgedVg[] = { 32, 237, 229, a }; +S sgcdf3[] = { 32, 205, 243, 0 }; +S sfbe9g[] = { 251, 233, a }; +S sgTee[] = { 32, 227, 238, 0 }; +S scdf3[] = { 205, 243, 0 }; +S sWVg[] = { 230, 229, a }; +S sf1f2ee[] = { 241, 242, 238, 0 }; +S sebf1ffg[] = { 235, 241, 255, a }; +S sebf1[] = { 235, 241, 0 }; +S sRfbeb[] = { 225, 251, 235, 0 }; +S scdf3g[] = { 205, 243, a }; +S se8Vg[] = { 232, 229, a }; +S sgeef2[] = { 32, 238, 242, 0 }; +S sQffg[] = { 224, 255, a }; +S seeTee[] = { 238, 227, 238, 0 }; +S sQe7[] = { 224, 231, 0 }; +S sf3U[] = { 243, 228, 0 }; +S sVede8[] = { 229, 237, 232, 0 }; +S sgUee[] = { 32, 228, 238, 0 }; +S sebf1ff[] = { 235, 241, 255, 0 }; +S sf0f3[] = { 240, 243, 0 }; +S sUed[] = { 228, 237, 0 }; +S sVf1f2[] = { 229, 241, 242, 0 }; +S se8e9[] = { 232, 233, 0 }; +S sgcdf3g[] = { 32, 205, 243, a }; +S sgRfbeb[] = { 32, 225, 251, 235, 0 }; +S sgWV[] = { 32, 230, 229, 0 }; +S sf2fb[] = { 242, 251, 0 }; +S sgSee[] = { 32, 226, 238, 0 }; +S sf1f2f0[] = { 241, 242, 240, 0 }; +S sSeef0[] = { 226, 238, 240, 0 }; +S sf2Qea[] = { 242, 224, 234, 0 }; +S sf1ea[] = { 241, 234, 0 }; +S sedfc[] = { 237, 252, 0 }; +S sgeff0ee[] = { 32, 239, 240, 238, 0 }; +S se8ec[] = { 232, 236, 0 }; +S sgRf3[] = { 32, 225, 243, 0 }; +S sgSf1V[] = { 32, 226, 241, 229, 0 }; +S seeSee[] = { 238, 226, 238, 0 }; +S sebQg[] = { 235, 224, a }; +S sf2f1[] = { 242, 241, 0 }; +S sf2f3[] = { 242, 243, 0 }; +S sf5ee[] = { 245, 238, 0 }; +S sf0fb[] = { 240, 251, 0 }; +S sQede8[] = { 224, 237, 232, 0 }; +S sefVf0[] = { 239, 229, 240, 0 }; +S sebeef1[] = { 235, 238, 241, 0 }; +S sf2Veb[] = { 242, 229, 235, 0 }; +S se8S[] = { 232, 226, 0 }; +S sgf2ee[] = { 32, 242, 238, 0 }; +S sgf2Qea[] = { 32, 242, 224, 234, 0 }; +S sedeee9[] = { 237, 238, 233, 0 }; +S sgeaQea[] = { 32, 234, 224, 234, 0 }; +S sf2ed[] = { 242, 237, 0 }; +S sWVed[] = { 230, 229, 237, 0 }; +S sedf3eb[] = { 237, 243, 235, 0 }; +S sf2eef0[] = { 242, 238, 240, 0 }; +S se8e9g[] = { 232, 233, a }; +S sSQeb[] = { 226, 224, 235, 0 }; +S sgUQ[] = { 32, 228, 224, 0 }; +S sgf0Q[] = { 32, 240, 224, 0 }; +S sgefeeeb[] = { 32, 239, 238, 235, 0 }; +S sgecee[] = { 32, 236, 238, 0 }; +S sgffg[] = { 32, 255, a }; +S sf7Q[] = { 247, 224, 0 }; +S sgede8[] = { 32, 237, 232, 0 }; +S sedfbe9g[] = { 237, 251, 233, a }; +S sebeeg[] = { 235, 238, a }; +S sgf1f2Q[] = { 32, 241, 242, 224, 0 }; +S seaQea[] = { 234, 224, 234, 0 }; +S sWe8[] = { 230, 232, 0 }; +S seeSeef0[] = { 238, 226, 238, 240, 0 }; +S seeW[] = { 238, 230, 0 }; +S se8e8[] = { 232, 232, 0 }; +S sf2fbg[] = { 242, 251, a }; +S sVebg[] = { 229, 235, a }; +S sfbVg[] = { 251, 229, a }; +S sedeeS[] = { 237, 238, 226, 0 }; +S sf2edee[] = { 242, 237, 238, 0 }; +S sVeded[] = { 229, 237, 237, 0 }; +S sedfbe9[] = { 237, 251, 233, 0 }; +S sefeeeb[] = { 239, 238, 235, 0 }; +S sf7e8[] = { 247, 232, 0 }; +S sQSQ[] = { 224, 226, 224, 0 }; +S sedeee9g[] = { 237, 238, 233, a }; +S sVf0V[] = { 229, 240, 229, 0 }; +S sf6e8[] = { 246, 232, 0 }; +S seeSQ[] = { 238, 226, 224, 0 }; +S seeSg[] = { 238, 226, a }; +S sfbV[] = { 251, 229, 0 }; +S se8e8g[] = { 232, 232, a }; +S sf1Vec[] = { 241, 229, 236, 0 }; +S sUQS[] = { 228, 224, 226, 0 }; +S se8edf3[] = { 232, 237, 243, 0 }; +S sebeef1fc[] = { 235, 238, 241, 252, 0 }; +S sedfbV[] = { 237, 251, 229, 0 }; +S sf1e8[] = { 241, 232, 0 }; +S sefeeg[] = { 239, 238, a }; +S sedeeT[] = { 237, 238, 227, 0 }; +S seaQeag[] = { 234, 224, 234, a }; +S sedfbVg[] = { 237, 251, 229, a }; +S se8f5[] = { 232, 245, 0 }; +S seef8[] = { 238, 248, 0 }; +S sVTee[] = { 229, 227, 238, 0 }; +S sTeeS[] = { 227, 238, 226, 0 }; +S sQf7[] = { 224, 247, 0 }; +S seef2ee[] = { 238, 242, 238, 0 }; +S seef1fcg[] = { 238, 241, 252, a }; +S seff0e8[] = { 239, 240, 232, 0 }; +S seeef[] = { 238, 239, 0 }; +S seeTeeg[] = { 238, 227, 238, a }; +S seef0ee[] = { 238, 240, 238, 0 }; +S sgeef1f2[] = { 32, 238, 241, 242, 0 }; +S sf8ea[] = { 248, 234, 0 }; +S sebff[] = { 235, 255, 0 }; +S sgeeR[] = { 32, 238, 225, 0 }; +S sgece8[] = { 32, 236, 232, 0 }; +S seeUe8[] = { 238, 228, 232, 0 }; +S sededfb[] = { 237, 237, 251, 0 }; +S sVea[] = { 229, 234, 0 }; +S sf0e8f2[] = { 240, 232, 242, 0 }; +S sQSe8[] = { 224, 226, 232, 0 }; +S sVebQ[] = { 229, 235, 224, 0 }; +S se8f6[] = { 232, 246, 0 }; +S sSfb[] = { 226, 251, 0 }; +S sSe8U[] = { 226, 232, 228, 0 }; +S sf0Qg[] = { 240, 224, a }; +S sSed[] = { 226, 237, 0 }; +S sSVf0[] = { 226, 229, 240, 0 }; +S seaf2[] = { 234, 242, 0 }; +S secf3g[] = { 236, 243, a }; +S seff0Q[] = { 239, 240, 224, 0 }; +S sf1f2S[] = { 241, 242, 226, 0 }; +S sQf0Q[] = { 224, 240, 224, 0 }; +S seef1fc[] = { 238, 241, 252, 0 }; +S sSQg[] = { 226, 224, a }; +S sTeb[] = { 227, 235, 0 }; +S sf3W[] = { 243, 230, 0 }; +S sUS[] = { 228, 226, 0 }; +S se7fb[] = { 231, 251, 0 }; +S sedff[] = { 237, 255, 0 }; +S sTeeSee[] = { 227, 238, 226, 238, 0 }; +S seeUed[] = { 238, 228, 237, 0 }; +S sgefeeg[] = { 32, 239, 238, a }; +S sVedf2[] = { 229, 237, 242, 0 }; +S seef0e8f2[] = { 238, 240, 232, 242, 0 }; +S sf3ebg[] = { 243, 235, a }; +S sece8eb[] = { 236, 232, 235, 0 }; +S sTf3[] = { 227, 243, 0 }; +S sgfdf2[] = { 32, 253, 242, 0 }; +S sUedee[] = { 228, 237, 238, 0 }; +S sf8eaQ[] = { 248, 234, 224, 0 }; +S sRfbebee[] = { 225, 251, 235, 238, 0 }; +S sf2f1ff[] = { 242, 241, 255, 0 }; +S sQf2fcg[] = { 224, 242, 252, a }; +S sgVTee[] = { 32, 229, 227, 238, 0 }; +S sf1f2e8[] = { 241, 242, 232, 0 }; +S seeebfc[] = { 238, 235, 252, 0 }; +S sf0Qed[] = { 240, 224, 237, 0 }; +S sgVT[] = { 32, 229, 227, 0 }; +S sf2SV[] = { 242, 226, 229, 0 }; +S sededfbe9[] = { 237, 237, 251, 233, 0 }; +S seeebee[] = { 238, 235, 238, 0 }; +S sQef[] = { 224, 239, 0 }; +S sgUS[] = { 32, 228, 226, 0 }; +S se7Qg[] = { 231, 224, a }; +S se8SQ[] = { 232, 226, 224, 0 }; +S seced[] = { 236, 237, 0 }; +S sefe8[] = { 239, 232, 0 }; +S sTQ[] = { 227, 224, 0 }; +S sedeeTee[] = { 237, 238, 227, 238, 0 }; +S seef5[] = { 238, 245, 0 }; +S se8e7ec[] = { 232, 231, 236, 0 }; +S sfdf2ee[] = { 253, 242, 238, 0 }; +S sede8g[] = { 237, 232, a }; +S se8eaee[] = { 232, 234, 238, 0 }; +S sf0ff[] = { 240, 255, 0 }; +S sfbebee[] = { 251, 235, 238, 0 }; +S sVedQ[] = { 229, 237, 224, 0 }; +S sefQ[] = { 239, 224, 0 }; +S sTe8[] = { 227, 232, 0 }; +S sQf0e8[] = { 224, 240, 232, 0 }; +S seaf3g[] = { 234, 243, a }; + +N l34n0[] = { { sfbeb, .291 }, { sUVed, .262 }, H }; +N l34n1[] = { { sffg, 1.836 }, { sTeeS, .262 }, H }; +N l34n3[] = { { sgf3, .369 }, { sRfbeb, .393 }, H }; +N l34n4[] = { { sgU, .661 }, { sUe8, .350 }, H }; +N l34n7[] = { { seeV, .408 }, { seef1fcg, .525 }, H }; +N l34n8[] = { { sf3eb, .408 }, { sVTee, .262 }, { sQf0e8, .219 }, H }; +N l34n9[] = { { sgeef1, .321 }, { sSfb, .175 }, H }; +N l34n10[] = { { sf2fc, .758 }, { sQeag, .852 }, { sgeaQ, .291 }, H }; +N l34n11[] = { { sf2ed, .204 }, H }; +N l34n12[] = { { sedeeTee, .291 }, H }; +N l34n13[] = { { sRee, .437 }, H }; +N l34n14[] = { { seeSee, .350 }, { sf1ef, .175 }, H }; +N l34n15[] = { { sWV, .525 }, { sgeff0, .525 }, { sQff, .291 }, { sf1Q, .262 }, H }; +N l34n16[] = { { sQf0, .495 }, H }; +N l34n17[] = { { sQR, .146 }, H }; +N l34n18[] = { { sVe7, .233 }, H }; +N l34n19[] = { { se8ebg, .656 }, { sgfdf2, .146 }, H }; +N l34n20[] = { { sgeef2, .262 }, H }; +N l34n21[] = { { sgV, .233 }, { sece8eb, .219 }, H }; +N l34n23[] = { { secf3g, .393 }, { seef5, .146 }, H }; +N l34n24[] = { { seeW, .204 }, { sTeb, .175 }, { sVedQ, .219 }, H }; +N l34n25[] = { { se8f1, .291 }, H }; +N l34n26[] = { { se8S, .233 }, { sQSe8, .262 }, H }; +N l34n27[] = { { sede8, 1.020 }, { sQebg, .852 }, { seff0ee, .481 }, { sgf1ee, .291 }, { sSed, .175 }, H }; +N l34n28[] = { { sf2ee, 1.574 }, { sgSee, .233 }, { se7f3, .175 }, H }; +N l34n29[] = { { se7U, .175 }, H }; +N l34n30[] = { { sf1ff, .525 }, { sf7V, .321 }, { seef2ee, .262 }, H }; +N l34n31[] = { { seeTee, .393 }, { sefeeg, .393 }, { sf0Qed, .219 }, H }; +N l34n33[] = { { sQf1, .350 }, H }; +N l34n34[] = { { sQS, .641 }, { sVf1f2, .393 }, { sVf7, .204 }, H }; +N l34n36[] = { { seaee, .962 }, H }; +N l34n37[] = { { seeUed, .262 }, H }; +N l34n38[] = { { sgW, .272 }, { sefV, .379 }, H }; +N l34n39[] = { { sf2SV, .219 }, H }; +N l34n42[] = { { se8f2, .612 }, H }; +N l34n44[] = { { sSee, .758 }, { sgf2ee, .233 }, { sf0fcg, .393 }, H }; +N l34n45[] = { { sVf2g, .787 }, { sgTee, .262 }, H }; +N l34n46[] = { { sf2Q, .903 }, H }; +N l34n47[] = { { sRf0, .204 }, { sgffg, .204 }, H }; +N l34n48[] = { { sf0g, .219 }, H }; +N l34n49[] = { { sebfc, .408 }, H }; +N l34n50[] = { { sQf2, .408 }, { sf6e8, .204 }, { sUQS, .262 }, { sf8eaQ, .219 }, H }; +N l34n51[] = { { sf0f3, .262 }, H }; +N l34n52[] = { { sVe9, .233 }, { seeSg, .459 }, H }; +N l34n53[] = { { sf7f2ee, .612 }, { sedfbV, .262 }, H }; +N l34n54[] = { { seaQ, .874 }, { sSf1V, .437 }, H }; +N l34n55[] = { { sge7, .408 }, { sedeeS, .306 }, H }; +N l34n56[] = { { se8g, 3.541 }, H }; +N l34n57[] = { { seef1f2, .568 }, { seef7, .291 }, { sededfb, .262 }, { sf1f2e8, .219 }, { se7Qg, .328 }, H }; +N l34n58[] = { { sfbebee, .219 }, H }; +N l34n60[] = { { sf2Qea, .350 }, { se8U, .233 }, H }; +N l34n61[] = { { sgedQ, .729 }, { sgSf1, .321 }, { sebe8g, .721 }, { sf8V, .262 }, H }; +N l34n62[] = { { sSQ, .903 }, { sf2f0, .379 }, { sfbe9g, .590 }, { sgUee, .262 }, { sWVed, .306 }, H }; +N l34n64[] = { { sQg, 3.279 }, H }; +N l34n65[] = { { sf1f2, 1.515 }, { seeebfc, .219 }, H }; +N l34n66[] = { { sgSg, .612 }, { sgRf3, .233 }, { sWe8, .204 }, { sedeeT, .262 }, H }; +N l34n67[] = { { sebee, .787 }, H }; +N l34n68[] = { { seaQea, .306 }, { sQU, .204 }, { sf2f1ff, .219 }, H }; +N l34n69[] = { { sf0V, .466 }, { sf2edee, .306 }, { sVea, .175 }, H }; +N l34n70[] = { { se8edf3, .262 }, H }; +N l34n71[] = { { sgf7, .369 }, { sgf1f2, .350 }, H }; +N l34n72[] = { { sge8, .894 }, { sedVg, 1.115 }, H }; +N l34n74[] = { { seef8, .175 }, H }; +N l34n75[] = { { sTee, .758 }, { seee9, .437 }, { sf1fcg, .787 }, H }; +N l34n77[] = { { se8V, .350 }, H }; +N l34n78[] = { { sgcdf3g, .350 }, H }; +N l34n79[] = { { sf1g, .525 }, { sf2f1, .233 }, H }; +N l34n80[] = { { sf2S, .321 }, { sgf2Qea, .311 }, { sf0Qg, .393 }, H }; +N l34n81[] = { { sf7e8, .204 }, { seced, .146 }, H }; +N l34n85[] = { { sebQ, .729 }, H }; +N l34n86[] = { { sVeb, .816 }, { scdf3g, .590 }, H }; +N l34n87[] = { { se9g, 1.749 }, { sSQeb, .306 }, H }; +N l34n89[] = { { sUed, .262 }, { sf2fbg, .459 }, { sgeeR, .175 }, { sgefeeg, .233 }, { sefe8, .146 }, H }; +N l34n91[] = { { sgRfbeb, .350 }, H }; +N l34n93[] = { { sf3f0, .262 }, { se8f5, .175 }, { sTQ, .146 }, H }; +N l34n94[] = { { sedfb, .554 }, { se8f2fcg, .874 }, { sf3R, .204 }, H }; +N l34n95[] = { { sSf1, .408 }, H }; +N l34n97[] = { { sedfbe9, .306 }, H }; +N l34n98[] = { { secee, .495 }, { sRf3, .262 }, H }; +N l34n99[] = { { sgecV, .175 }, H }; +N l34n100[] = { { sf1V, .583 }, { sebff, .175 }, H }; +N l34n102[] = { { sQf2fcg, .437 }, H }; +N l34n103[] = { { sVec, .583 }, { seeVg, .525 }, H }; +N l34n104[] = { { seaf2, .175 }, { sf3ebg, .328 }, H }; +N l34n106[] = { { sgea, .699 }, { sf2fcg, 1.639 }, { sUee, .321 }, H }; +N l34n107[] = { { sebf1ff, .393 }, H }; +N l34n108[] = { { sgcc, .175 }, { sf2eef0, .306 }, H }; +N l34n109[] = { { seeeb, .699 }, H }; +N l34n110[] = { { sf2g, 1.137 }, { se8f6, .175 }, H }; +N l34n111[] = { { se8e7, .408 }, { sWVg, .590 }, { sQffg, .590 }, { sedfc, .233 }, H }; +N l34n112[] = { { seded, .291 }, { sf8e8, .262 }, { sVede8, .393 }, { sgf0Q, .204 }, H }; +N l34n113[] = { { sf2f3, .233 }, H }; +N l34n116[] = { { sgedV, .699 }, { seeSQ, .306 }, { secQ, .204 }, H }; +N l34n118[] = { { seag, .962 }, { sebf1, .262 }, { sefVf0, .350 }, H }; +N l34n119[] = { { sgf7f2ee, .505 }, { sQe7, .262 }, H }; +N l34n120[] = { { sVed, 1.078 }, { sf0e8, .758 }, H }; +N l34n121[] = { { seaf3, .321 }, { sf5ee, .233 }, H }; +N l34n123[] = { { sgeb, .194 }, { sf1f2ee, .393 }, { sede8g, .328 }, H }; +N l34n124[] = { { sf2eeg, 1.770 }, { sUQ, .758 }, { sSeef0, .350 }, H }; +N l34n125[] = { { sgcd, .272 }, H }; +N l34n126[] = { { sSg, 1.311 }, { seeec, .466 }, { sf1ffg, 1.049 }, H }; +N l34n127[] = { { sf3f2, .321 }, { seeTeeg, .525 }, H }; +N l34n128[] = { { se8e8, .204 }, H }; +N l34n129[] = { { sedee, 1.282 }, { seff0Q, .262 }, H }; +N l34n130[] = { { sVf0V, .306 }, H }; +N l34n131[] = { { sf2V, .729 }, H }; +N l34n132[] = { { sedeee9, .306 }, { sgece8, .175 }, H }; +N l34n133[] = { { sfbg, 1.049 }, H }; +N l34n135[] = { { sQf7, .175 }, H }; +N l34n136[] = { { sf1Vec, .262 }, H }; +N l34n140[] = { { sgec, .602 }, { sefeb, .262 }, H }; +N l34n141[] = { { sf3g, 1.530 }, H }; +N l34n143[] = { { seeed, .670 }, H }; +N l34n144[] = { { seef0e8f2, .291 }, H }; +N l34n145[] = { { sf3U, .262 }, { se8e9, .262 }, { sf1f2f0, .350 }, H }; +N l34n146[] = { { sgf2Q, .291 }, { sebeef1fc, .350 }, { sf8ea, .175 }, { sSe8U, .262 }, H }; +N l34n147[] = { { sedQ, 1.195 }, { sSV, .554 }, { sUedee, .219 }, { se8e7ec, .219 }, H }; +N l34n148[] = { { sVe9g, .459 }, H }; +N l34n149[] = { { sebg, 1.749 }, { sf7f2eeg, 1.224 }, { sgede8, .204 }, { sedfbVg, .525 }, H }; +N l34n150[] = { { seaQg, .656 }, H }; +N l34n151[] = { { sf1e8, .175 }, H }; +N l34n152[] = { { sQf8, .262 }, H }; +N l34n154[] = { { sgRfb, .321 }, { sfbV, .204 }, H }; +N l34n156[] = { { sf2Veb, .350 }, H }; +N l34n157[] = { { sged, 1.166 }, { sgedQg, .544 }, H }; +N l34n158[] = { { sebeef1, .350 }, { sSQg, .393 }, { sUS, .175 }, H }; +N l34n159[] = { { sgcf, .117 }, H }; +N l34n160[] = { { sTf3, .146 }, { sgVTee, .194 }, H }; +N l34n162[] = { { se8ea, .466 }, { sedff, .175 }, H }; +N l34n163[] = { { sebeeg, .459 }, H }; +N l34n164[] = { { sfcg, 2.492 }, { sgeaee, .408 }, { sgUQ, .204 }, { seaQeag, .525 }, { se7fb, .175 }, H }; +N l34n165[] = { { se7ec, .175 }, H }; +N l34n167[] = { { sVeded, .306 }, { seef1fc, .262 }, { seeebee, .219 }, H }; +N l34n168[] = { { sge8g, .991 }, H }; +N l34n170[] = { { sQea, .729 }, { sebV, .379 }, H }; +N l34n171[] = { { sVf0, .903 }, { seee9g, .918 }, { sTeeg, .721 }, H }; +N l34n173[] = { { sgf7f2, .379 }, { se8Vg, .590 }, H }; +N l34n174[] = { { sgee, .758 }, H }; +N l34n176[] = { { sQf0Q, .262 }, H }; +N l34n177[] = { { seeef, .175 }, H }; +N l34n179[] = { { se8eb, .699 }, { sf3W, .175 }, H }; +N l34n180[] = { { secg, 1.443 }, H }; +N l34n181[] = { { sebQg, .525 }, H }; +N l34n182[] = { { se7ed, .291 }, { sf2e8, .291 }, { sVebg, .459 }, H }; +N l34n183[] = { { secf3, .291 }, H }; +N l34n185[] = { { sf1ea, .233 }, H }; +N l34n186[] = { { sgefeeeb, .272 }, { sgUS, .146 }, { se8SQ, .219 }, H }; +N l34n187[] = { { sQeb, 1.049 }, { sf0fb, .233 }, H }; +N l34n188[] = { { sVf1, .466 }, { sUg, .262 }, H }; +N l34n190[] = { { seae8, .379 }, H }; +N l34n191[] = { { sgef, 1.379 }, { sefee, 1.137 }, H }; +N l34n193[] = { { sgB, .175 }, { sedfbe9g, .612 }, H }; +N l34n194[] = { { seef0, .787 }, { sgc2, .233 }, { sQSQ, .306 }, H }; +N l34n195[] = { { seeR, .525 }, H }; +N l34n196[] = { { se8ec, .233 }, H }; +N l34n197[] = { { sedf2, .233 }, H }; +N l34n198[] = { { sSe8, .466 }, { sgecee, .204 }, H }; +N l34n199[] = { { sVecg, .787 }, H }; +N l34n200[] = { { sgeaQea, .272 }, H }; +N l34n201[] = { { secV, .437 }, { sgf2V, .291 }, { sf7Q, .204 }, H }; +N l34n203[] = { { sf5g, .656 }, { sebf1ffg, .787 }, { sTeeSee, .350 }, H }; +N l34n204[] = { { sf0fc, .233 }, { sQec, .233 }, H }; +N l34n205[] = { { sVf2, .612 }, { sRfbebee, .291 }, H }; +N l34n206[] = { { sVT, .291 }, H }; +N l34n207[] = { { sgff, .194 }, H }; +N l34n208[] = { { sgf0, .311 }, H }; +N l34n209[] = { { sgR, .622 }, { sUV, .845 }, { sefQ, .146 }, H }; +N l34n211[] = { { seef1, 1.078 }, { sedg, .306 }, H }; +N l34n212[] = { { seeS, 1.195 }, { sgedVg, .389 }, H }; +N l34n213[] = { { se8ed, .437 }, { sQede8, .350 }, H }; +N l34n214[] = { { sedf3, .466 }, { sgVT, .146 }, H }; +N l34n215[] = { { sge7Q, .350 }, H }; +N l34n216[] = { { sefeeeb, .306 }, H }; +N l34n217[] = { { se7Q, .495 }, { sgeff0ee, .311 }, { seff0e8, .262 }, { seaf3g, .328 }, H }; +N l34n219[] = { { sVg, 3.322 }, { sgUV, .204 }, H }; +N l34n220[] = { { sUQg, .656 }, { se8eaee, .219 }, H }; +N l34n221[] = { { sebe8, .874 }, { sQed, .729 }, H }; +N l34n222[] = { { sf0ee, .962 }, { seeecg, .656 }, { sfbe9, .291 }, { seeSeef0, .408 }, { sf0e8f2, .262 }, { sVedf2, .219 }, H }; +N l34n223[] = { { sVU, .408 }, { sgeef1f2, .233 }, H }; +N l34n224[] = { { se8e8g, .459 }, H }; +N l34n225[] = { { sgf1, .971 }, { seff0, .758 }, { sf1f2Q, .568 }, { sedeeg, .656 }, H }; +N l34n226[] = { { sgS, 1.030 }, { sfeg, .525 }, H }; +N l34n227[] = { { sSVf0, .262 }, H }; +N l34n228[] = { { seef2, .699 }, { sedeee9g, .612 }, { sgc4, .117 }, H }; +N l34n229[] = { { seeT, .495 }, { sTe8, .146 }, H }; +N l34n231[] = { { sgf1f2Q, .272 }, H }; +N l34n232[] = { { sedV, 1.137 }, H }; +N l34n234[] = { { sRfb, .321 }, { sUVeb, .481 }, H }; +N l34n235[] = { { sf1fc, .350 }, H }; +N l34n236[] = { { sgSf1V, .311 }, H }; +N l34n238[] = { { sgcdf3, .262 }, { seeUe8, .262 }, H }; +N l34n239[] = { { sedf3eb, .306 }, { sfdf2ee, .219 }, H }; +N l34n240[] = { { sf0Q, 1.020 }, H }; +N l34n241[] = { { se8e9g, .459 }, H }; +N l34n242[] = { { seeg, 3.541 }, { sgf2, .738 }, H }; +N l34n243[] = { { sedQg, 1.246 }, { sgT, .291 }, H }; +N l34n244[] = { { sededfbe9, .291 }, H }; +N l34n246[] = { { seeU, .641 }, { scdf3, .262 }, { sVebQ, .262 }, H }; +N l34n247[] = { { sf1f2S, .262 }, H }; +N l34n249[] = { { sgefee, 1.107 }, { sf2fb, .233 }, H }; +N l34n250[] = { { sfbVg, .459 }, H }; +N l34n251[] = { { sf7f2, .437 }, H }; +N l34n252[] = { { sece8, .321 }, { seef0ee, .262 }, H }; +N l34n253[] = { { sf1ee, .350 }, { sgWV, .262 }, H }; +N l34n254[] = { { se8f2fc, .481 }, H }; +N l34n255[] = { { sQef, .146 }, { sf0ff, .146 }, H }; + +D l34_d = { "russian", "windows1251", - { - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - 0.005,0.003,0.014,0.002,0.009,0.002,V,0.001,0.005,V,0.007,0.001,0.010,0.017,0.005,0.007, - 0.002,0.010,0.005,0.001,0.001,0.001,0.001,0.006,0.001,V,V,V,V,0.001,V,0.006, - 0.361,0.083,0.197,0.068,0.142,0.365,0.041,0.073,0.319,0.052,0.150,0.218,0.127,0.286,0.478,0.119, - 0.201,0.205,0.274,0.146,0.003,0.040,0.019,0.057,0.044,0.010,0.003,0.084,0.091,0.006,0.022,0.085 - }, - { - l34n0,l34n1,X,l34n3,l34n4,X,X,l34n7,l34n8,l34n9,l34n10,l34n11,l34n12,l34n13,l34n14,l34n15, - l34n16,l34n17,l34n18,l34n19,l34n20,l34n21,X,l34n23,l34n24,l34n25,l34n26,l34n27,l34n28,l34n29,l34n30,l34n31, - X,l34n33,l34n34,X,l34n36,l34n37,l34n38,l34n39,X,X,l34n42,X,l34n44,l34n45,l34n46,l34n47, - l34n48,l34n49,l34n50,l34n51,l34n52,l34n53,l34n54,l34n55,l34n56,l34n57,l34n58,X,l34n60,l34n61,l34n62,X, - l34n64,l34n65,l34n66,l34n67,l34n68,l34n69,l34n70,l34n71,l34n72,X,l34n74,l34n75,X,l34n77,l34n78,l34n79, - l34n80,l34n81,X,X,X,l34n85,l34n86,l34n87,X,l34n89,X,l34n91,X,l34n93,l34n94,l34n95, - X,l34n97,l34n98,l34n99,l34n100,X,l34n102,l34n103,l34n104,X,l34n106,l34n107,l34n108,l34n109,l34n110,l34n111, - l34n112,l34n113,X,X,l34n116,X,l34n118,l34n119,l34n120,l34n121,X,l34n123,l34n124,l34n125,l34n126,l34n127, - l34n128,l34n129,l34n130,l34n131,l34n132,l34n133,X,l34n135,l34n136,X,X,X,l34n140,l34n141,X,l34n143, - l34n144,l34n145,l34n146,l34n147,l34n148,l34n149,l34n150,l34n151,l34n152,X,l34n154,X,l34n156,l34n157,l34n158,l34n159, - l34n160,X,l34n162,l34n163,l34n164,l34n165,X,l34n167,l34n168,X,l34n170,l34n171,X,l34n173,l34n174,X, - l34n176,l34n177,X,l34n179,l34n180,l34n181,l34n182,l34n183,X,l34n185,l34n186,l34n187,l34n188,X,l34n190,l34n191, - X,l34n193,l34n194,l34n195,l34n196,l34n197,l34n198,l34n199,l34n200,l34n201,X,l34n203,l34n204,l34n205,l34n206,l34n207, - l34n208,l34n209,X,l34n211,l34n212,l34n213,l34n214,l34n215,l34n216,l34n217,X,l34n219,l34n220,l34n221,l34n222,l34n223, - l34n224,l34n225,l34n226,l34n227,l34n228,l34n229,X,l34n231,l34n232,X,l34n234,l34n235,l34n236,X,l34n238,l34n239, - l34n240,l34n241,l34n242,l34n243,l34n244,X,l34n246,l34n247,X,l34n249,l34n250,l34n251,l34n252,l34n253,l34n254,l34n255 - } + { W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + 0.005, 0.003, 0.014, 0.002, 0.009, 0.002, V, 0.001, 0.005, V, 0.007, 0.001, 0.010, 0.017, 0.005, 0.007, + 0.002, 0.010, 0.005, 0.001, 0.001, 0.001, 0.001, 0.006, 0.001, V, V, V, V, 0.001, V, 0.006, + 0.361, 0.083, 0.197, 0.068, 0.142, 0.365, 0.041, 0.073, 0.319, 0.052, 0.150, 0.218, 0.127, 0.286, 0.478, 0.119, + 0.201, 0.205, 0.274, 0.146, 0.003, 0.040, 0.019, 0.057, 0.044, 0.010, 0.003, 0.084, 0.091, 0.006, 0.022, 0.085 }, + { l34n0, l34n1, X, l34n3, l34n4, X, X, l34n7, l34n8, l34n9, l34n10, l34n11, l34n12, l34n13, l34n14, l34n15, + l34n16, l34n17, l34n18, l34n19, l34n20, l34n21, X, l34n23, l34n24, l34n25, l34n26, l34n27, l34n28, l34n29, l34n30, l34n31, + X, l34n33, l34n34, X, l34n36, l34n37, l34n38, l34n39, X, X, l34n42, X, l34n44, l34n45, l34n46, l34n47, + l34n48, l34n49, l34n50, l34n51, l34n52, l34n53, l34n54, l34n55, l34n56, l34n57, l34n58, X, l34n60, l34n61, l34n62, X, + l34n64, l34n65, l34n66, l34n67, l34n68, l34n69, l34n70, l34n71, l34n72, X, l34n74, l34n75, X, l34n77, l34n78, l34n79, + l34n80, l34n81, X, X, X, l34n85, l34n86, l34n87, X, l34n89, X, l34n91, X, l34n93, l34n94, l34n95, + X, l34n97, l34n98, l34n99, l34n100, X, l34n102, l34n103, l34n104, X, l34n106, l34n107, l34n108, l34n109, l34n110, l34n111, + l34n112, l34n113, X, X, l34n116, X, l34n118, l34n119, l34n120, l34n121, X, l34n123, l34n124, l34n125, l34n126, l34n127, + l34n128, l34n129, l34n130, l34n131, l34n132, l34n133, X, l34n135, l34n136, X, X, X, l34n140, l34n141, X, l34n143, + l34n144, l34n145, l34n146, l34n147, l34n148, l34n149, l34n150, l34n151, l34n152, X, l34n154, X, l34n156, l34n157, l34n158, l34n159, + l34n160, X, l34n162, l34n163, l34n164, l34n165, X, l34n167, l34n168, X, l34n170, l34n171, X, l34n173, l34n174, X, + l34n176, l34n177, X, l34n179, l34n180, l34n181, l34n182, l34n183, X, l34n185, l34n186, l34n187, l34n188, X, l34n190, l34n191, + X, l34n193, l34n194, l34n195, l34n196, l34n197, l34n198, l34n199, l34n200, l34n201, X, l34n203, l34n204, l34n205, l34n206, l34n207, + l34n208, l34n209, X, l34n211, l34n212, l34n213, l34n214, l34n215, l34n216, l34n217, X, l34n219, l34n220, l34n221, l34n222, l34n223, + l34n224, l34n225, l34n226, l34n227, l34n228, l34n229, X, l34n231, l34n232, X, l34n234, l34n235, l34n236, X, l34n238, l34n239, + l34n240, l34n241, l34n242, l34n243, l34n244, X, l34n246, l34n247, X, l34n249, l34n250, l34n251, l34n252, l34n253, l34n254, l34n255 } }; - - // // Lng: slovak // Enc: windows1250 // - -S s9dg[]={157,a}; -S sX9d[]={97,157,0}; -S sX9dg[]={97,157,a}; -S szX9d[]={v,97,157,0}; -S szX9dg[]={v,97,157,a}; -S stvih[]={p,r,e,d,0}; -S svih[]={r,e,d,0}; -S soxs[]={k,t,o,0}; -S sszg[]={o,v,a}; -S sszX9d[]={o,v,97,157,0}; -S sgoxs[]={32,k,t,o,0}; -S soxsv[]={k,t,o,r,0}; -S sw9d[]={s,157,0}; -S sgXo[]={32,97,k,0}; -S sgzp[]={32,v,l,0}; -S szp[]={v,l,0}; -S sfdqg[]={253,m,a}; -S swxXz[]={s,t,97,v,0}; -S srfdZ[]={n,253,99,0}; -S shsq[]={d,o,m,0}; -S szih[]={v,e,d,0}; -S srfdZl[]={n,253,99,h,0}; -S sRZ[]={225,99,0}; -S sz9a[]={v,154,0}; -S s9ai[]={154,e,0}; -S srsq[]={n,o,m,0}; -S sihwx[]={e,d,s,t,0}; -S svihw[]={r,e,d,s,0}; -S smpm[]={i,l,i,0}; -S ssw9d[]={o,s,157,0}; -S s9ei[]={158,e,0}; -S sw9dg[]={s,157,a}; -S sgtsw[]={32,p,o,s,0}; -S sihw[]={e,d,s,0}; -S shwxX[]={d,s,t,97,0}; -S sgXos[]={32,97,k,o,0}; -S smR[]={i,225,0}; -S shwx[]={d,s,t,0}; -S sYyhi[]={98,u,d,e,0}; -S svsz[]={r,o,v,0}; -S sils[]={e,h,o,0}; -S se8X[]={232,97,0}; -S sRpr[]={225,l,n,0}; -S sixo[]={e,t,k,0}; -S szpR[]={v,l,225,0}; -S s9aixo[]={154,e,t,k,0}; -S s9eig[]={158,e,a}; -S sgzpR[]={32,v,l,225,0}; -S syhig[]={u,d,e,a}; -S silsg[]={e,h,o,a}; -S szy[]={v,u,0}; -S spRh[]={l,225,d,0}; -S syni[]={u,j,e,0}; -S sgwfa[]={32,s,250,0}; -S sz9ai[]={v,154,e,0}; -S snq[]={j,m,0}; -S sXzm[]={97,v,i,0}; -S sRh[]={225,d,0}; -S sie8[]={e,232,0}; -S sibe[]={e,190,0}; -S s9aix[]={154,e,t,0}; -S szpRh[]={v,l,225,d,0}; -S swfa[]={s,250,0}; -S sz9aix[]={v,154,e,t,0}; -S shsqm[]={d,o,m,i,0}; -S sxibe[]={t,e,190,0}; -S se8ir[]={232,e,n,0}; -S sgz9a[]={32,v,154,0}; -S sg9ei[]={32,158,e,0}; -S sxibes[]={t,e,190,o,0}; -S sswpX[]={o,s,l,97,0}; -S sfaZ[]={250,99,0}; -S ssxmg[]={o,t,i,a}; -S svsxm[]={r,o,t,i,0}; -S stvsx[]={p,r,o,t,0}; -S sibesz[]={e,190,o,v,0}; -S ssw9dg[]={o,s,157,a}; -S sg9e[]={32,158,0}; -S sgwxv[]={32,s,t,r,0}; -S sxed[]={t,237,0}; -S sbeX[]={190,97,0}; -S srsqg[]={n,o,m,a}; -S swpX[]={s,l,97,0}; -S sm9d[]={i,157,0}; -S swpXr[]={s,l,97,n,0}; -S smXv[]={i,97,r,0}; -S sbes[]={190,o,0}; -S svszX[]={r,o,v,97,0}; -S svsx[]={r,o,t,0}; -S smxibe[]={i,t,e,190,0}; -S sm9dg[]={i,157,a}; -S sxfd[]={t,253,0}; -S sedw[]={237,s,0}; -S sts7a[]={p,o,z,0}; -S se9q[]={233,m,0}; -S shsz[]={d,o,v,0}; -S sibes[]={e,190,o,0}; -S smpmg[]={i,l,i,a}; -S srsw9d[]={n,o,s,157,0}; -S ssxm[]={o,t,i,0}; -S stswp[]={p,o,s,l,0}; -S s7ah[]={z,d,0}; -S sbesz[]={190,o,v,0}; - -N l35n0[]={{sibesz,.153},H}; -N l35n2[]={{srmig,.268},H}; -N l35n3[]={{ssv,.447},H}; -N l35n5[]={{sxm,.319},{smr,.192},{spR,.115},H}; -N l35n7[]={{sri,.498},H}; -N l35n8[]={{swo,.153},{ssxmg,.230},H}; -N l35n9[]={{szsg,.172},H}; -N l35n10[]={{sYp,.077},H}; -N l35n12[]={{sirm,.153},H}; -N l35n13[]={{sXr,.549},{spm,.357},{sgzi,.287},{swg,.172},H}; -N l35n14[]={{ssqg,.517},{sfdZlg,1.120},{sosr,.192},{sgwXg,.268},{smXv,.115},H}; -N l35n15[]={{sred,.115},{szy,.089},H}; -N l35n16[]={{sswx,.287},H}; -N l35n17[]={{se8m,.259},{siz,.077},H}; -N l35n19[]={{snq,.089},H}; -N l35n20[]={{ssw,.472},H}; -N l35n21[]={{sgts,.804},{ssh,.319},{shm,.140},{sog,.172},{sRz,.230},H}; -N l35n22[]={{sgzg,.747},H}; -N l35n23[]={{szfd,.089},H}; -N l35n24[]={{sZo,.102},{sXzm,.134},H}; -N l35n25[]={{swp,.192},H}; -N l35n28[]={{svr,.140},H}; -N l35n29[]={{sgq,.632},H}; -N l35n30[]={{sYyhi,.179},H}; -N l35n31[]={{srfd,.140},{se9l,.201},H}; -N l35n32[]={{sspm,.115},H}; -N l35n33[]={{szpR,.134},{sxig,.172},H}; -N l35n34[]={{stv,.804},{smZlg,.345},H}; -N l35n35[]={{s9dg,1.120},{srXg,.460},{sil,.089},H}; -N l35n36[]={{swxm,.134},{sm9d,.077},{stswp,.153},H}; -N l35n37[]={{ssx,.153},{s7as,.153},{sRpr,.302},{sgsv,.201},{sg7aX,.172},H}; -N l35n38[]={{syhi,.134},{sgoX,.201},H}; -N l35n39[]={{sxo,.089},H}; -N l35n40[]={{smX,.345},{svihw,.204},H}; -N l35n41[]={{svsx,.115},H}; -N l35n42[]={{shsq,.172},{slv,.102},H}; -N l35n43[]={{sre9g,.230},H}; -N l35n44[]={{sX9d,.306},{sqm,.243},{sxg,.172},{sihwx,.204},H}; -N l35n45[]={{svs,.421},{sts7a,.115},H}; -N l35n46[]={{sgr,.843},{swxXz,.255},H}; -N l35n49[]={{shig,.345},{sxyg,.230},{ssqm,.153},H}; -N l35n51[]={{ssw9dg,.230},H}; -N l35n52[]={{spg,.249},H}; -N l35n53[]={{syn,.089},H}; -N l35n54[]={{sgtv,1.580},{sfdZ,.373},{ssy,.115},H}; -N l35n55[]={{s7aX,.102},{sgXos,.306},{sgvs,.201},{s9eig,.302},{sz9aix,.179},H}; -N l35n56[]={{sxibes,.153},H}; -N l35n59[]={{stsh,.153},H}; -N l35n60[]={{shg,.115},H}; -N l35n61[]={{sYs,.102},H}; -N l35n63[]={{sgs,.728},{svX,.306},{svsz,.134},{spXr,.115},H}; -N l35n64[]={{sfdqg,.646},H}; -N l35n65[]={{sgni,.230},{sgtsh,.268},{sgwfa,.201},H}; -N l35n67[]={{szm,.268},{srR,.140},{stvsx,.153},H}; -N l35n68[]={{sgoxs,.498},{swpX,.115},{se9lsg,.517},H}; -N l35n69[]={{sZlg,.977},{sin,.268},{sti,.115},H}; -N l35n70[]={{syo,.077},H}; -N l35n71[]={{ssz,.689},H}; -N l35n72[]={{sgqX,.345},{sge8,.172},{silsg,.268},H}; -N l35n73[]={{sszX9d,.357},{sghs,.287},{smv,.077},H}; -N l35n74[]={{smZ,.243},{s79w,.077},H}; -N l35n75[]={{srm,.485},{syg,.670},{szih,.172},H}; -N l35n76[]={{sws,.115},H}; -N l35n77[]={{stvX,.192},{szpRh,.179},H}; -N l35n79[]={{sYX,.077},H}; -N l35n80[]={{sgt,1.724},H}; -N l35n81[]={{sgX,.919},{sXv,.204},{sxsv,.268},{spRh,.134},{svXz,.115},H}; -N l35n83[]={{sqg,.766},{sz79,.230},{sgwt,.172},H}; -N l35n84[]={{sos,.421},{sgz9a,.172},H}; -N l35n86[]={{sio,.077},{sedw,.172},H}; -N l35n87[]={{slsg,.431},{se9g,.560},{s9aix,.201},H}; -N l35n89[]={{sgrX,.575},{sgxs,.172},{ssl,.077},H}; -N l35n90[]={{sw9d,.140},{sgzp,.316},{sxr,.140},{smw,.115},{sg7ag,.230},H}; -N l35n91[]={{sig,1.398},{sr79,.115},{s9ai,.153},H}; -N l35n93[]={{swt,.077},H}; -N l35n94[]={{swX,.153},{so79g,.259},{sg9e,.115},H}; -N l35n95[]={{sRg,.345},H}; -N l35n96[]={{srfdZ,.172},{srsq,.153},H}; -N l35n97[]={{sbes,.115},H}; -N l35n98[]={{sgY,.326},{sXw,.140},{spr,.115},{svszX,.153},H}; -N l35n99[]={{sXh,.153},H}; -N l35n100[]={{svsxm,.153},H}; -N l35n101[]={{sgtvi,1.034},{sxmg,.345},{shsqm,.153},H}; -N l35n102[]={{soX,.153},{smpm,.153},{sfag,.345},{swxs,.134},{se8r,.201},H}; -N l35n103[]={{srig,.402},H}; -N l35n105[]={{sgYy,.287},H}; -N l35n106[]={{szg,.823},{shr,.102},{s7ah,.077},H}; -N l35n107[]={{sxs,.511},{smx,.204},{sRp,.316},H}; -N l35n108[]={{smi,.421},H}; -N l35n109[]={{spmg,.373},H}; -N l35n110[]={{soxs,.287},{sgtsw,.306},{sZX,.077},{sXpm,.115},H}; -N l35n113[]={{sgtvm,.268},H}; -N l35n114[]={{sszX,.402},{sgv,.249},{srg,.172},H}; -N l35n115[]={{sXx,.192},{sgZ,.268},{sps,.166},{sbeX,.115},{sbesz,.172},H}; -N l35n116[]={{sgqi,.230},{se9q,.172},H}; -N l35n117[]={{sgsY,.316},{szXr,.115},{sgyt,.144},H}; -N l35n118[]={{szp,.140},H}; -N l35n120[]={{siq,.115},H}; -N l35n121[]={{stvi,.517},{srsw9d,.153},H}; -N l35n122[]={{szX9d,.345},{sirw,.115},H}; -N l35n123[]={{shs,.409},{ssn,.128},H}; -N l35n125[]={{sxX,.255},H}; -N l35n127[]={{sgwx,.316},H}; -N l35n131[]={{sgw,1.168},{svi,.536},{sgtvs,.345},H}; -N l35n132[]={{sgh,.306},{sz9a,.115},{swxmg,.230},{sm9dg,.172},H}; -N l35n133[]={{spX,.319},{sgri,.460},H}; -N l35n134[]={{syhig,.268},H}; -N l35n135[]={{swxv,.153},{sov,.089},{swfa,.089},{se8ir,.259},H}; -N l35n136[]={{smXg,.373},{sixo,.134},H}; -N l35n137[]={{sir,.345},{se8X,.201},H}; -N l35n139[]={{sni,.230},{ss7a,.204},{sgsh,.287},{sved,.077},H}; -N l35n140[]={{sX9dg,.689},{sso,.140},{syni,.134},H}; -N l35n141[]={{shX,.102},{smz,.089},{shsz,.115},H}; -N l35n142[]={{swpXr,.153},H}; -N l35n143[]={{sxXz,.192},H}; -N l35n144[]={{sXrm,.249},H}; -N l35n145[]={{ssg,1.015},H}; -N l35n146[]={{sqs,.166},H}; -N l35n147[]={{sYi,.089},{svy,.077},{stsp,.115},H}; -N l35n148[]={{sgx,.498},H}; -N l35n149[]={{sXz,.255},{sgYyh,.383},{sgwz,.201},H}; -N l35n150[]={{ssyg,.201},H}; -N l35n152[]={{srfdZl,.230},{s9aixo,.268},{szr,.089},H}; -N l35n155[]={{syt,.077},H}; -N l35n157[]={{ssp,.243},H}; -N l35n158[]={{sxv,.166},{sibes,.115},H}; -N l35n159[]={{sXos,.153},H}; -N l35n160[]={{sqXx,.115},H}; -N l35n161[]={{swx,.804},H}; -N l35n162[]={{srsw,.230},{srmi,.211},H}; -N l35n163[]={{sYy,.128},{sie8,.089},H}; -N l35n164[]={{sqX,.204},{sihs,.249},H}; -N l35n165[]={{stvih,.434},{sing,.460},{sgy,.192},{sg7aR,.259},{stvm,.134},H}; -N l35n166[]={{sgj,.153},H}; -N l35n167[]={{sszg,.431},H}; -N l35n168[]={{smR,.102},{ssxm,.115},H}; -N l35n169[]={{szs,.268},{sox,.243},H}; -N l35n171[]={{sit,.077},H}; -N l35n174[]={{ssq,.421},{sfdZl,.560},{sgwX,.259},H}; -N l35n175[]={{stvXz,.153},H}; -N l35n177[]={{srs,.383},{sgXg,.718},{sgrm,.172},H}; -N l35n180[]={{sosg,.259},H}; -N l35n181[]={{sg9ei,.172},H}; -N l35n182[]={{sgz,1.666},H}; -N l35n183[]={{s7aR,.166},H}; -N l35n184[]={{slg,.651},{sswp,.115},H}; -N l35n185[]={{sgrXg,.383},H}; -N l35n186[]={{sw9dg,.230},{soy,.077},H}; -N l35n187[]={{szX,.434},{shwx,.153},{sr79g,.172},H}; -N l35n189[]={{siY,.102},{ssvr,.134},H}; -N l35n190[]={{swXg,.230},H}; -N l35n191[]={{ssr,.230},{shw,.140},{svR,.102},H}; -N l35n192[]={{srsqg,.230},{sgos,.172},H}; -N l35n193[]={{sxi,.281},H}; -N l35n194[]={{smZl,.172},{smxi,.134},{sofd,.089},H}; -N l35n195[]={{srX,.434},{swz,.102},{srsz,.153},{sfdg,.259},H}; -N l35n196[]={{soxsv,.306},H}; -N l35n198[]={{smpmg,.230},H}; -N l35n199[]={{s79g,.517},{svm,.217},H}; -N l35n200[]={{sgl,.230},H}; -N l35n201[]={{sXn,.294},{spi,.179},{sxed,.077},H}; -N l35n202[]={{sXxi,.134},H}; -N l35n203[]={{sxsg,.345},{sre9,.140},H}; -N l35n204[]={{swxX,.287},{smig,.402},H}; -N l35n205[]={{siv,.204},{se8i,.259},H}; -N l35n207[]={{svih,.326},{syh,.128},H}; -N l35n208[]={{sihw,.153},H}; -N l35n209[]={{shi,.268},{sxy,.153},{sm7a,.102},H}; -N l35n210[]={{sRZ,.259},{smo,.102},H}; -N l35n211[]={{sedg,.689},{ssw9d,.153},H}; -N l35n213[]={{sgwxv,.230},H}; -N l35n215[]={{smg,.881},{s9ei,.153},H}; -N l35n217[]={{sgm,.306},{sibe,.089},{sfaZ,.172},{sxfd,.077},H}; -N l35n218[]={{szX9dg,.689},{sXo,.217},H}; -N l35n219[]={{sz9ai,.134},{sswpX,.153},H}; -N l35n222[]={{siw,.115},{shwxX,.204},H}; -N l35n223[]={{sXg,1.762},{sih,.472},H}; -N l35n224[]={{sfdq,.316},{stsw,.153},H}; -N l35n225[]={{sst,.089},H}; -N l35n227[]={{smp,.153},{sRh,.201},H}; -N l35n228[]={{se9ls,.302},H}; -N l35n229[]={{sZl,.523},H}; -N l35n230[]={{s7ag,.192},H}; -N l35n231[]={{stvs,.192},{sY79,.077},H}; -N l35n232[]={{sqi,.230},{sils,.134},H}; -N l35n233[]={{sgz79,.460},{svo,.077},H}; -N l35n234[]={{sgn,.249},{sgXo,.316},{skX,.089},H}; -N l35n235[]={{sXp,.192},{snig,.259},{sxibe,.115},H}; -N l35n238[]={{svg,.326},H}; -N l35n239[]={{sts,.536},{six,.192},{sYyh,.192},H}; -N l35n243[]={{ssY,.294},{sRx,.201},H}; -N l35n245[]={{srw,.089},H}; -N l35n246[]={{sZm,.306},{sng,.440},H}; -N l35n247[]={{sls,.345},{sgox,.373},H}; -N l35n249[]={{svXr,.172},H}; -N l35n250[]={{sg7a,.709},H}; -N l35n251[]={{sgo,.555},H}; -N l35n252[]={{sXq,.102},{smxibe,.153},H}; -N l35n253[]={{sxR,.102},{sgzpR,.268},H}; -N l35n254[]={{so79,.115},H}; -N l35n255[]={{szi,.268},{sXosg,.306},H}; - -D l35_d = -{ +S s9dg[] = { 157, a }; +S sX9d[] = { 97, 157, 0 }; +S sX9dg[] = { 97, 157, a }; +S szX9d[] = { v, 97, 157, 0 }; +S szX9dg[] = { v, 97, 157, a }; +S stvih[] = { p, r, e, d, 0 }; +S svih[] = { r, e, d, 0 }; +S soxs[] = { k, t, o, 0 }; +S sszg[] = { o, v, a }; +S sszX9d[] = { o, v, 97, 157, 0 }; +S sgoxs[] = { 32, k, t, o, 0 }; +S soxsv[] = { k, t, o, r, 0 }; +S sw9d[] = { s, 157, 0 }; +S sgXo[] = { 32, 97, k, 0 }; +S sgzp[] = { 32, v, l, 0 }; +S szp[] = { v, l, 0 }; +S sfdqg[] = { 253, m, a }; +S swxXz[] = { s, t, 97, v, 0 }; +S srfdZ[] = { n, 253, 99, 0 }; +S shsq[] = { d, o, m, 0 }; +S szih[] = { v, e, d, 0 }; +S srfdZl[] = { n, 253, 99, h, 0 }; +S sRZ[] = { 225, 99, 0 }; +S sz9a[] = { v, 154, 0 }; +S s9ai[] = { 154, e, 0 }; +S srsq[] = { n, o, m, 0 }; +S sihwx[] = { e, d, s, t, 0 }; +S svihw[] = { r, e, d, s, 0 }; +S smpm[] = { i, l, i, 0 }; +S ssw9d[] = { o, s, 157, 0 }; +S s9ei[] = { 158, e, 0 }; +S sw9dg[] = { s, 157, a }; +S sgtsw[] = { 32, p, o, s, 0 }; +S sihw[] = { e, d, s, 0 }; +S shwxX[] = { d, s, t, 97, 0 }; +S sgXos[] = { 32, 97, k, o, 0 }; +S smR[] = { i, 225, 0 }; +S shwx[] = { d, s, t, 0 }; +S sYyhi[] = { 98, u, d, e, 0 }; +S svsz[] = { r, o, v, 0 }; +S sils[] = { e, h, o, 0 }; +S se8X[] = { 232, 97, 0 }; +S sRpr[] = { 225, l, n, 0 }; +S sixo[] = { e, t, k, 0 }; +S szpR[] = { v, l, 225, 0 }; +S s9aixo[] = { 154, e, t, k, 0 }; +S s9eig[] = { 158, e, a }; +S sgzpR[] = { 32, v, l, 225, 0 }; +S syhig[] = { u, d, e, a }; +S silsg[] = { e, h, o, a }; +S szy[] = { v, u, 0 }; +S spRh[] = { l, 225, d, 0 }; +S syni[] = { u, j, e, 0 }; +S sgwfa[] = { 32, s, 250, 0 }; +S sz9ai[] = { v, 154, e, 0 }; +S snq[] = { j, m, 0 }; +S sXzm[] = { 97, v, i, 0 }; +S sRh[] = { 225, d, 0 }; +S sie8[] = { e, 232, 0 }; +S sibe[] = { e, 190, 0 }; +S s9aix[] = { 154, e, t, 0 }; +S szpRh[] = { v, l, 225, d, 0 }; +S swfa[] = { s, 250, 0 }; +S sz9aix[] = { v, 154, e, t, 0 }; +S shsqm[] = { d, o, m, i, 0 }; +S sxibe[] = { t, e, 190, 0 }; +S se8ir[] = { 232, e, n, 0 }; +S sgz9a[] = { 32, v, 154, 0 }; +S sg9ei[] = { 32, 158, e, 0 }; +S sxibes[] = { t, e, 190, o, 0 }; +S sswpX[] = { o, s, l, 97, 0 }; +S sfaZ[] = { 250, 99, 0 }; +S ssxmg[] = { o, t, i, a }; +S svsxm[] = { r, o, t, i, 0 }; +S stvsx[] = { p, r, o, t, 0 }; +S sibesz[] = { e, 190, o, v, 0 }; +S ssw9dg[] = { o, s, 157, a }; +S sg9e[] = { 32, 158, 0 }; +S sgwxv[] = { 32, s, t, r, 0 }; +S sxed[] = { t, 237, 0 }; +S sbeX[] = { 190, 97, 0 }; +S srsqg[] = { n, o, m, a }; +S swpX[] = { s, l, 97, 0 }; +S sm9d[] = { i, 157, 0 }; +S swpXr[] = { s, l, 97, n, 0 }; +S smXv[] = { i, 97, r, 0 }; +S sbes[] = { 190, o, 0 }; +S svszX[] = { r, o, v, 97, 0 }; +S svsx[] = { r, o, t, 0 }; +S smxibe[] = { i, t, e, 190, 0 }; +S sm9dg[] = { i, 157, a }; +S sxfd[] = { t, 253, 0 }; +S sedw[] = { 237, s, 0 }; +S sts7a[] = { p, o, z, 0 }; +S se9q[] = { 233, m, 0 }; +S shsz[] = { d, o, v, 0 }; +S sibes[] = { e, 190, o, 0 }; +S smpmg[] = { i, l, i, a }; +S srsw9d[] = { n, o, s, 157, 0 }; +S ssxm[] = { o, t, i, 0 }; +S stswp[] = { p, o, s, l, 0 }; +S s7ah[] = { z, d, 0 }; +S sbesz[] = { 190, o, v, 0 }; + +N l35n0[] = { { sibesz, .153 }, H }; +N l35n2[] = { { srmig, .268 }, H }; +N l35n3[] = { { ssv, .447 }, H }; +N l35n5[] = { { sxm, .319 }, { smr, .192 }, { spR, .115 }, H }; +N l35n7[] = { { sri, .498 }, H }; +N l35n8[] = { { swo, .153 }, { ssxmg, .230 }, H }; +N l35n9[] = { { szsg, .172 }, H }; +N l35n10[] = { { sYp, .077 }, H }; +N l35n12[] = { { sirm, .153 }, H }; +N l35n13[] = { { sXr, .549 }, { spm, .357 }, { sgzi, .287 }, { swg, .172 }, H }; +N l35n14[] = { { ssqg, .517 }, { sfdZlg, 1.120 }, { sosr, .192 }, { sgwXg, .268 }, { smXv, .115 }, H }; +N l35n15[] = { { sred, .115 }, { szy, .089 }, H }; +N l35n16[] = { { sswx, .287 }, H }; +N l35n17[] = { { se8m, .259 }, { siz, .077 }, H }; +N l35n19[] = { { snq, .089 }, H }; +N l35n20[] = { { ssw, .472 }, H }; +N l35n21[] = { { sgts, .804 }, { ssh, .319 }, { shm, .140 }, { sog, .172 }, { sRz, .230 }, H }; +N l35n22[] = { { sgzg, .747 }, H }; +N l35n23[] = { { szfd, .089 }, H }; +N l35n24[] = { { sZo, .102 }, { sXzm, .134 }, H }; +N l35n25[] = { { swp, .192 }, H }; +N l35n28[] = { { svr, .140 }, H }; +N l35n29[] = { { sgq, .632 }, H }; +N l35n30[] = { { sYyhi, .179 }, H }; +N l35n31[] = { { srfd, .140 }, { se9l, .201 }, H }; +N l35n32[] = { { sspm, .115 }, H }; +N l35n33[] = { { szpR, .134 }, { sxig, .172 }, H }; +N l35n34[] = { { stv, .804 }, { smZlg, .345 }, H }; +N l35n35[] = { { s9dg, 1.120 }, { srXg, .460 }, { sil, .089 }, H }; +N l35n36[] = { { swxm, .134 }, { sm9d, .077 }, { stswp, .153 }, H }; +N l35n37[] = { { ssx, .153 }, { s7as, .153 }, { sRpr, .302 }, { sgsv, .201 }, { sg7aX, .172 }, H }; +N l35n38[] = { { syhi, .134 }, { sgoX, .201 }, H }; +N l35n39[] = { { sxo, .089 }, H }; +N l35n40[] = { { smX, .345 }, { svihw, .204 }, H }; +N l35n41[] = { { svsx, .115 }, H }; +N l35n42[] = { { shsq, .172 }, { slv, .102 }, H }; +N l35n43[] = { { sre9g, .230 }, H }; +N l35n44[] = { { sX9d, .306 }, { sqm, .243 }, { sxg, .172 }, { sihwx, .204 }, H }; +N l35n45[] = { { svs, .421 }, { sts7a, .115 }, H }; +N l35n46[] = { { sgr, .843 }, { swxXz, .255 }, H }; +N l35n49[] = { { shig, .345 }, { sxyg, .230 }, { ssqm, .153 }, H }; +N l35n51[] = { { ssw9dg, .230 }, H }; +N l35n52[] = { { spg, .249 }, H }; +N l35n53[] = { { syn, .089 }, H }; +N l35n54[] = { { sgtv, 1.580 }, { sfdZ, .373 }, { ssy, .115 }, H }; +N l35n55[] = { { s7aX, .102 }, { sgXos, .306 }, { sgvs, .201 }, { s9eig, .302 }, { sz9aix, .179 }, H }; +N l35n56[] = { { sxibes, .153 }, H }; +N l35n59[] = { { stsh, .153 }, H }; +N l35n60[] = { { shg, .115 }, H }; +N l35n61[] = { { sYs, .102 }, H }; +N l35n63[] = { { sgs, .728 }, { svX, .306 }, { svsz, .134 }, { spXr, .115 }, H }; +N l35n64[] = { { sfdqg, .646 }, H }; +N l35n65[] = { { sgni, .230 }, { sgtsh, .268 }, { sgwfa, .201 }, H }; +N l35n67[] = { { szm, .268 }, { srR, .140 }, { stvsx, .153 }, H }; +N l35n68[] = { { sgoxs, .498 }, { swpX, .115 }, { se9lsg, .517 }, H }; +N l35n69[] = { { sZlg, .977 }, { sin, .268 }, { sti, .115 }, H }; +N l35n70[] = { { syo, .077 }, H }; +N l35n71[] = { { ssz, .689 }, H }; +N l35n72[] = { { sgqX, .345 }, { sge8, .172 }, { silsg, .268 }, H }; +N l35n73[] = { { sszX9d, .357 }, { sghs, .287 }, { smv, .077 }, H }; +N l35n74[] = { { smZ, .243 }, { s79w, .077 }, H }; +N l35n75[] = { { srm, .485 }, { syg, .670 }, { szih, .172 }, H }; +N l35n76[] = { { sws, .115 }, H }; +N l35n77[] = { { stvX, .192 }, { szpRh, .179 }, H }; +N l35n79[] = { { sYX, .077 }, H }; +N l35n80[] = { { sgt, 1.724 }, H }; +N l35n81[] = { { sgX, .919 }, { sXv, .204 }, { sxsv, .268 }, { spRh, .134 }, { svXz, .115 }, H }; +N l35n83[] = { { sqg, .766 }, { sz79, .230 }, { sgwt, .172 }, H }; +N l35n84[] = { { sos, .421 }, { sgz9a, .172 }, H }; +N l35n86[] = { { sio, .077 }, { sedw, .172 }, H }; +N l35n87[] = { { slsg, .431 }, { se9g, .560 }, { s9aix, .201 }, H }; +N l35n89[] = { { sgrX, .575 }, { sgxs, .172 }, { ssl, .077 }, H }; +N l35n90[] = { { sw9d, .140 }, { sgzp, .316 }, { sxr, .140 }, { smw, .115 }, { sg7ag, .230 }, H }; +N l35n91[] = { { sig, 1.398 }, { sr79, .115 }, { s9ai, .153 }, H }; +N l35n93[] = { { swt, .077 }, H }; +N l35n94[] = { { swX, .153 }, { so79g, .259 }, { sg9e, .115 }, H }; +N l35n95[] = { { sRg, .345 }, H }; +N l35n96[] = { { srfdZ, .172 }, { srsq, .153 }, H }; +N l35n97[] = { { sbes, .115 }, H }; +N l35n98[] = { { sgY, .326 }, { sXw, .140 }, { spr, .115 }, { svszX, .153 }, H }; +N l35n99[] = { { sXh, .153 }, H }; +N l35n100[] = { { svsxm, .153 }, H }; +N l35n101[] = { { sgtvi, 1.034 }, { sxmg, .345 }, { shsqm, .153 }, H }; +N l35n102[] = { { soX, .153 }, { smpm, .153 }, { sfag, .345 }, { swxs, .134 }, { se8r, .201 }, H }; +N l35n103[] = { { srig, .402 }, H }; +N l35n105[] = { { sgYy, .287 }, H }; +N l35n106[] = { { szg, .823 }, { shr, .102 }, { s7ah, .077 }, H }; +N l35n107[] = { { sxs, .511 }, { smx, .204 }, { sRp, .316 }, H }; +N l35n108[] = { { smi, .421 }, H }; +N l35n109[] = { { spmg, .373 }, H }; +N l35n110[] = { { soxs, .287 }, { sgtsw, .306 }, { sZX, .077 }, { sXpm, .115 }, H }; +N l35n113[] = { { sgtvm, .268 }, H }; +N l35n114[] = { { sszX, .402 }, { sgv, .249 }, { srg, .172 }, H }; +N l35n115[] = { { sXx, .192 }, { sgZ, .268 }, { sps, .166 }, { sbeX, .115 }, { sbesz, .172 }, H }; +N l35n116[] = { { sgqi, .230 }, { se9q, .172 }, H }; +N l35n117[] = { { sgsY, .316 }, { szXr, .115 }, { sgyt, .144 }, H }; +N l35n118[] = { { szp, .140 }, H }; +N l35n120[] = { { siq, .115 }, H }; +N l35n121[] = { { stvi, .517 }, { srsw9d, .153 }, H }; +N l35n122[] = { { szX9d, .345 }, { sirw, .115 }, H }; +N l35n123[] = { { shs, .409 }, { ssn, .128 }, H }; +N l35n125[] = { { sxX, .255 }, H }; +N l35n127[] = { { sgwx, .316 }, H }; +N l35n131[] = { { sgw, 1.168 }, { svi, .536 }, { sgtvs, .345 }, H }; +N l35n132[] = { { sgh, .306 }, { sz9a, .115 }, { swxmg, .230 }, { sm9dg, .172 }, H }; +N l35n133[] = { { spX, .319 }, { sgri, .460 }, H }; +N l35n134[] = { { syhig, .268 }, H }; +N l35n135[] = { { swxv, .153 }, { sov, .089 }, { swfa, .089 }, { se8ir, .259 }, H }; +N l35n136[] = { { smXg, .373 }, { sixo, .134 }, H }; +N l35n137[] = { { sir, .345 }, { se8X, .201 }, H }; +N l35n139[] = { { sni, .230 }, { ss7a, .204 }, { sgsh, .287 }, { sved, .077 }, H }; +N l35n140[] = { { sX9dg, .689 }, { sso, .140 }, { syni, .134 }, H }; +N l35n141[] = { { shX, .102 }, { smz, .089 }, { shsz, .115 }, H }; +N l35n142[] = { { swpXr, .153 }, H }; +N l35n143[] = { { sxXz, .192 }, H }; +N l35n144[] = { { sXrm, .249 }, H }; +N l35n145[] = { { ssg, 1.015 }, H }; +N l35n146[] = { { sqs, .166 }, H }; +N l35n147[] = { { sYi, .089 }, { svy, .077 }, { stsp, .115 }, H }; +N l35n148[] = { { sgx, .498 }, H }; +N l35n149[] = { { sXz, .255 }, { sgYyh, .383 }, { sgwz, .201 }, H }; +N l35n150[] = { { ssyg, .201 }, H }; +N l35n152[] = { { srfdZl, .230 }, { s9aixo, .268 }, { szr, .089 }, H }; +N l35n155[] = { { syt, .077 }, H }; +N l35n157[] = { { ssp, .243 }, H }; +N l35n158[] = { { sxv, .166 }, { sibes, .115 }, H }; +N l35n159[] = { { sXos, .153 }, H }; +N l35n160[] = { { sqXx, .115 }, H }; +N l35n161[] = { { swx, .804 }, H }; +N l35n162[] = { { srsw, .230 }, { srmi, .211 }, H }; +N l35n163[] = { { sYy, .128 }, { sie8, .089 }, H }; +N l35n164[] = { { sqX, .204 }, { sihs, .249 }, H }; +N l35n165[] = { { stvih, .434 }, { sing, .460 }, { sgy, .192 }, { sg7aR, .259 }, { stvm, .134 }, H }; +N l35n166[] = { { sgj, .153 }, H }; +N l35n167[] = { { sszg, .431 }, H }; +N l35n168[] = { { smR, .102 }, { ssxm, .115 }, H }; +N l35n169[] = { { szs, .268 }, { sox, .243 }, H }; +N l35n171[] = { { sit, .077 }, H }; +N l35n174[] = { { ssq, .421 }, { sfdZl, .560 }, { sgwX, .259 }, H }; +N l35n175[] = { { stvXz, .153 }, H }; +N l35n177[] = { { srs, .383 }, { sgXg, .718 }, { sgrm, .172 }, H }; +N l35n180[] = { { sosg, .259 }, H }; +N l35n181[] = { { sg9ei, .172 }, H }; +N l35n182[] = { { sgz, 1.666 }, H }; +N l35n183[] = { { s7aR, .166 }, H }; +N l35n184[] = { { slg, .651 }, { sswp, .115 }, H }; +N l35n185[] = { { sgrXg, .383 }, H }; +N l35n186[] = { { sw9dg, .230 }, { soy, .077 }, H }; +N l35n187[] = { { szX, .434 }, { shwx, .153 }, { sr79g, .172 }, H }; +N l35n189[] = { { siY, .102 }, { ssvr, .134 }, H }; +N l35n190[] = { { swXg, .230 }, H }; +N l35n191[] = { { ssr, .230 }, { shw, .140 }, { svR, .102 }, H }; +N l35n192[] = { { srsqg, .230 }, { sgos, .172 }, H }; +N l35n193[] = { { sxi, .281 }, H }; +N l35n194[] = { { smZl, .172 }, { smxi, .134 }, { sofd, .089 }, H }; +N l35n195[] = { { srX, .434 }, { swz, .102 }, { srsz, .153 }, { sfdg, .259 }, H }; +N l35n196[] = { { soxsv, .306 }, H }; +N l35n198[] = { { smpmg, .230 }, H }; +N l35n199[] = { { s79g, .517 }, { svm, .217 }, H }; +N l35n200[] = { { sgl, .230 }, H }; +N l35n201[] = { { sXn, .294 }, { spi, .179 }, { sxed, .077 }, H }; +N l35n202[] = { { sXxi, .134 }, H }; +N l35n203[] = { { sxsg, .345 }, { sre9, .140 }, H }; +N l35n204[] = { { swxX, .287 }, { smig, .402 }, H }; +N l35n205[] = { { siv, .204 }, { se8i, .259 }, H }; +N l35n207[] = { { svih, .326 }, { syh, .128 }, H }; +N l35n208[] = { { sihw, .153 }, H }; +N l35n209[] = { { shi, .268 }, { sxy, .153 }, { sm7a, .102 }, H }; +N l35n210[] = { { sRZ, .259 }, { smo, .102 }, H }; +N l35n211[] = { { sedg, .689 }, { ssw9d, .153 }, H }; +N l35n213[] = { { sgwxv, .230 }, H }; +N l35n215[] = { { smg, .881 }, { s9ei, .153 }, H }; +N l35n217[] = { { sgm, .306 }, { sibe, .089 }, { sfaZ, .172 }, { sxfd, .077 }, H }; +N l35n218[] = { { szX9dg, .689 }, { sXo, .217 }, H }; +N l35n219[] = { { sz9ai, .134 }, { sswpX, .153 }, H }; +N l35n222[] = { { siw, .115 }, { shwxX, .204 }, H }; +N l35n223[] = { { sXg, 1.762 }, { sih, .472 }, H }; +N l35n224[] = { { sfdq, .316 }, { stsw, .153 }, H }; +N l35n225[] = { { sst, .089 }, H }; +N l35n227[] = { { smp, .153 }, { sRh, .201 }, H }; +N l35n228[] = { { se9ls, .302 }, H }; +N l35n229[] = { { sZl, .523 }, H }; +N l35n230[] = { { s7ag, .192 }, H }; +N l35n231[] = { { stvs, .192 }, { sY79, .077 }, H }; +N l35n232[] = { { sqi, .230 }, { sils, .134 }, H }; +N l35n233[] = { { sgz79, .460 }, { svo, .077 }, H }; +N l35n234[] = { { sgn, .249 }, { sgXo, .316 }, { skX, .089 }, H }; +N l35n235[] = { { sXp, .192 }, { snig, .259 }, { sxibe, .115 }, H }; +N l35n238[] = { { svg, .326 }, H }; +N l35n239[] = { { sts, .536 }, { six, .192 }, { sYyh, .192 }, H }; +N l35n243[] = { { ssY, .294 }, { sRx, .201 }, H }; +N l35n245[] = { { srw, .089 }, H }; +N l35n246[] = { { sZm, .306 }, { sng, .440 }, H }; +N l35n247[] = { { sls, .345 }, { sgox, .373 }, H }; +N l35n249[] = { { svXr, .172 }, H }; +N l35n250[] = { { sg7a, .709 }, H }; +N l35n251[] = { { sgo, .555 }, H }; +N l35n252[] = { { sXq, .102 }, { smxibe, .153 }, H }; +N l35n253[] = { { sxR, .102 }, { sgzpR, .268 }, H }; +N l35n254[] = { { so79, .115 }, H }; +N l35n255[] = { { szi, .268 }, { sXosg, .306 }, H }; + +D l35_d = { "slovak", "windows1250", - { - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,0.171,0.034,0.047,0.071,0.147,0.007,0.009,0.045,0.123,0.039,0.066,0.062,0.067,0.121,0.194, - 0.070,W,0.101,0.090,0.099,0.049,0.111,W,0.001,0.030,0.040,W,W,W,W,W, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,0.001,Y,Y,0.002,0.004,Y, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,0.018,Y,Y,0.033,0.020,Y, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,0.011,Y, - Y,0.001,V,V,V,V,V,V,0.011,V,V,V,V,0.001,V,V, - V,V,V,V,V,V,V,V,V,V,0.002,V,V,0.003,V,V, - V,0.084,V,V,0.008,V,V,V,0.041,0.033,V,V,V,0.047,V,0.003, - V,V,0.009,0.003,0.005,V,V,V,V,V,0.034,V,V,0.046,V,V - }, - { - l35n0,X,l35n2,l35n3,X,l35n5,X,l35n7,l35n8,l35n9,l35n10,X,l35n12,l35n13,l35n14,l35n15, - l35n16,l35n17,X,l35n19,l35n20,l35n21,l35n22,l35n23,l35n24,l35n25,X,X,l35n28,l35n29,l35n30,l35n31, - l35n32,l35n33,l35n34,l35n35,l35n36,l35n37,l35n38,l35n39,l35n40,l35n41,l35n42,l35n43,l35n44,l35n45,l35n46,X, - X,l35n49,X,l35n51,l35n52,l35n53,l35n54,l35n55,l35n56,X,X,l35n59,l35n60,l35n61,X,l35n63, - l35n64,l35n65,X,l35n67,l35n68,l35n69,l35n70,l35n71,l35n72,l35n73,l35n74,l35n75,l35n76,l35n77,X,l35n79, - l35n80,l35n81,X,l35n83,l35n84,X,l35n86,l35n87,X,l35n89,l35n90,l35n91,X,l35n93,l35n94,l35n95, - l35n96,l35n97,l35n98,l35n99,l35n100,l35n101,l35n102,l35n103,X,l35n105,l35n106,l35n107,l35n108,l35n109,l35n110,X, - X,l35n113,l35n114,l35n115,l35n116,l35n117,l35n118,X,l35n120,l35n121,l35n122,l35n123,X,l35n125,X,l35n127, - X,X,X,l35n131,l35n132,l35n133,l35n134,l35n135,l35n136,l35n137,X,l35n139,l35n140,l35n141,l35n142,l35n143, - l35n144,l35n145,l35n146,l35n147,l35n148,l35n149,l35n150,X,l35n152,X,X,l35n155,X,l35n157,l35n158,l35n159, - l35n160,l35n161,l35n162,l35n163,l35n164,l35n165,l35n166,l35n167,l35n168,l35n169,X,l35n171,X,X,l35n174,l35n175, - X,l35n177,X,X,l35n180,l35n181,l35n182,l35n183,l35n184,l35n185,l35n186,l35n187,X,l35n189,l35n190,l35n191, - l35n192,l35n193,l35n194,l35n195,l35n196,X,l35n198,l35n199,l35n200,l35n201,l35n202,l35n203,l35n204,l35n205,X,l35n207, - l35n208,l35n209,l35n210,l35n211,X,l35n213,X,l35n215,X,l35n217,l35n218,l35n219,X,X,l35n222,l35n223, - l35n224,l35n225,X,l35n227,l35n228,l35n229,l35n230,l35n231,l35n232,l35n233,l35n234,l35n235,X,X,l35n238,l35n239, - X,X,X,l35n243,X,l35n245,l35n246,l35n247,X,l35n249,l35n250,l35n251,l35n252,l35n253,l35n254,l35n255 - } + { W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, 0.171, 0.034, 0.047, 0.071, 0.147, 0.007, 0.009, 0.045, 0.123, 0.039, 0.066, 0.062, 0.067, 0.121, 0.194, + 0.070, W, 0.101, 0.090, 0.099, 0.049, 0.111, W, 0.001, 0.030, 0.040, W, W, W, W, W, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, 0.001, Y, Y, 0.002, 0.004, Y, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, 0.018, Y, Y, 0.033, 0.020, Y, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, 0.011, Y, + Y, 0.001, V, V, V, V, V, V, 0.011, V, V, V, V, 0.001, V, V, + V, V, V, V, V, V, V, V, V, V, 0.002, V, V, 0.003, V, V, + V, 0.084, V, V, 0.008, V, V, V, 0.041, 0.033, V, V, V, 0.047, V, 0.003, + V, V, 0.009, 0.003, 0.005, V, V, V, V, V, 0.034, V, V, 0.046, V, V }, + { l35n0, X, l35n2, l35n3, X, l35n5, X, l35n7, l35n8, l35n9, l35n10, X, l35n12, l35n13, l35n14, l35n15, + l35n16, l35n17, X, l35n19, l35n20, l35n21, l35n22, l35n23, l35n24, l35n25, X, X, l35n28, l35n29, l35n30, l35n31, + l35n32, l35n33, l35n34, l35n35, l35n36, l35n37, l35n38, l35n39, l35n40, l35n41, l35n42, l35n43, l35n44, l35n45, l35n46, X, + X, l35n49, X, l35n51, l35n52, l35n53, l35n54, l35n55, l35n56, X, X, l35n59, l35n60, l35n61, X, l35n63, + l35n64, l35n65, X, l35n67, l35n68, l35n69, l35n70, l35n71, l35n72, l35n73, l35n74, l35n75, l35n76, l35n77, X, l35n79, + l35n80, l35n81, X, l35n83, l35n84, X, l35n86, l35n87, X, l35n89, l35n90, l35n91, X, l35n93, l35n94, l35n95, + l35n96, l35n97, l35n98, l35n99, l35n100, l35n101, l35n102, l35n103, X, l35n105, l35n106, l35n107, l35n108, l35n109, l35n110, X, + X, l35n113, l35n114, l35n115, l35n116, l35n117, l35n118, X, l35n120, l35n121, l35n122, l35n123, X, l35n125, X, l35n127, + X, X, X, l35n131, l35n132, l35n133, l35n134, l35n135, l35n136, l35n137, X, l35n139, l35n140, l35n141, l35n142, l35n143, + l35n144, l35n145, l35n146, l35n147, l35n148, l35n149, l35n150, X, l35n152, X, X, l35n155, X, l35n157, l35n158, l35n159, + l35n160, l35n161, l35n162, l35n163, l35n164, l35n165, l35n166, l35n167, l35n168, l35n169, X, l35n171, X, X, l35n174, l35n175, + X, l35n177, X, X, l35n180, l35n181, l35n182, l35n183, l35n184, l35n185, l35n186, l35n187, X, l35n189, l35n190, l35n191, + l35n192, l35n193, l35n194, l35n195, l35n196, X, l35n198, l35n199, l35n200, l35n201, l35n202, l35n203, l35n204, l35n205, X, l35n207, + l35n208, l35n209, l35n210, l35n211, X, l35n213, X, l35n215, X, l35n217, l35n218, l35n219, X, X, l35n222, l35n223, + l35n224, l35n225, X, l35n227, l35n228, l35n229, l35n230, l35n231, l35n232, l35n233, l35n234, l35n235, X, X, l35n238, l35n239, + X, X, X, l35n243, X, l35n245, l35n246, l35n247, X, l35n249, l35n250, l35n251, l35n252, l35n253, l35n254, l35n255 } }; - - // // Lng: slovenian // Enc: iso-8859-2 // - -S sgYs[]={32,98,o,0}; -S sXb9[]={97,185,0}; -S szw[]={v,s,0}; -S sgtXg[]={32,p,97,a}; -S sXrn[]={97,n,j,0}; -S sikX[]={e,g,97,0}; -S sme8[]={i,232,0}; -S sikXg[]={e,g,97,a}; -S spmx[]={l,i,t,0}; -S sqmg[]={m,i,a}; -S svbeX[]={r,190,97,0}; -S svbe[]={r,190,0}; -S sizg[]={e,v,a}; -S smb9[]={i,185,0}; -S shvbe[]={d,r,190,0}; -S sspmx[]={o,l,i,t,0}; -S ssks[]={o,g,o,0}; -S sYmg[]={98,i,a}; -S sb9i[]={185,e,0}; -S shvbeX[]={d,r,190,97,0}; -S smqmg[]={i,m,i,a}; -S sgYmg[]={32,98,i,a}; -S sYsg[]={98,o,a}; -S stsk[]={p,o,g,0}; -S sxiz[]={t,e,v,0}; -S sXzr[]={97,v,n,0}; -S sXng[]={97,j,a}; -S svbeXz[]={r,190,97,v,0}; -S sbeXz[]={190,97,v,0}; -S sme8r[]={i,232,n,0}; -S sghvbe[]={32,d,r,190,0}; -S sb9o[]={185,k,0}; -S spny[]={l,j,u,0}; -S sgtsk[]={32,p,o,g,0}; -S soXxi[]={k,97,t,e,0}; -S sxme8[]={t,i,232,0}; -S sovi[]={k,r,e,0}; -S sXxiv[]={97,t,e,r,0}; -S sgzw[]={32,v,s,0}; -S sxme8r[]={t,i,232,n,0}; -S swpsz[]={s,l,o,v,0}; -S sgwsg[]={32,s,o,a}; -S stsks[]={p,o,g,o,0}; -S ssksz[]={o,g,o,v,0}; -S sgomg[]={32,k,i,a}; -S szrm[]={v,n,i,0}; -S spXh[]={l,97,d,0}; -S syhmg[]={u,d,i,a}; -S sXxmg[]={97,t,i,a}; -S sovit[]={k,r,e,p,0}; -S sgzsp[]={32,v,o,l,0}; -S srmlg[]={n,i,h,a}; -S sXlg[]={97,h,a}; -S srml[]={n,i,h,0}; -S sswxm[]={o,s,t,i,0}; -S se8y[]={232,u,0}; -S sirmg[]={e,n,i,a}; -S snXp[]={j,97,l,0}; -S szspm[]={v,o,l,i,0}; -S sgYsg[]={32,98,o,a}; -S svXe8y[]={r,97,232,u,0}; -S swosg[]={s,k,o,a}; -S sxizg[]={t,e,v,a}; -S sgrmg[]={32,n,i,a}; -S sshm[]={o,d,i,0}; -S sgwps[]={32,s,l,o,0}; -S srmqm[]={n,i,m,i,0}; -S sgb9ig[]={32,185,e,a}; -S sYsp[]={98,o,l,0}; -S smxiz[]={i,t,e,v,0}; -S sXe8y[]={97,232,u,0}; -S sihX[]={e,d,97,0}; -S svnX[]={r,j,97,0}; -S se8yr[]={232,u,n,0}; -S sgb9i[]={32,185,e,0}; -S szwi[]={v,s,e,0}; -S svXe8[]={r,97,232,0}; -S sXe8yr[]={97,232,u,n,0}; -S srikX[]={n,e,g,97,0}; -S sriq[]={n,e,m,0}; -S sgxyh[]={32,t,u,d,0}; -S sgxiq[]={32,t,e,m,0}; - -N l36n0[]={{smb9,.133},H}; -N l36n1[]={{stX,.199},H}; -N l36n2[]={{swig,.477},H}; -N l36n3[]={{ssv,.305},{svnX,.119},H}; -N l36n5[]={{sxm,.491},{smr,.384},{ssqi,.119},H}; -N l36n7[]={{sri,.464},{sXlg,.209},H}; -N l36n8[]={{swo,.305},{sXb9,.172},H}; -N l36n9[]={{spmx,.219},H}; -N l36n10[]={{soig,.209},{sYp,.093},{sihX,.119},H}; -N l36n12[]={{sgp,.358},{sirm,.179},{sszs,.119},H}; -N l36n13[]={{sXr,.517},{spm,.504},{swg,.199},{ssks,.199},H}; -N l36n14[]={{sosr,.119},H}; -N l36n15[]={{sghXg,.597},H}; -N l36n16[]={{sswx,.298},H}; -N l36n17[]={{siz,.345},{srsg,.239},{se8m,.209},{sgrmg,.239},H}; -N l36n18[]={{sik,.199},H}; -N l36n20[]={{ssw,.398},H}; -N l36n21[]={{sgts,1.163},{shm,.292},{ssh,.265},{sog,.159},H}; -N l36n22[]={{sgzg,.507},H}; -N l36n23[]={{sgm7a,.388},H}; -N l36n25[]={{swp,.212},H}; -N l36n27[]={{szrm,.139},H}; -N l36n28[]={{svr,.133},{sb9i,.199},H}; -N l36n29[]={{sgq,.457},{sxyh,.119},H}; -N l36n30[]={{spn,.331},H}; -N l36n31[]={{sme8,.159},H}; -N l36n32[]={{sspm,.278},{sXxiv,.212},H}; -N l36n33[]={{sop,.106},H}; -N l36n34[]={{stv,.544},H}; -N l36n35[]={{srXg,.537},{srmlg,.278},H}; -N l36n36[]={{swxm,.239},{stswp,.186},{smxiz,.159},H}; -N l36n37[]={{sg7aX,.895},{ssx,.133},{spny,.159},H}; -N l36n38[]={{sgoX,.328},H}; -N l36n39[]={{sgYs,.418},{sXe8,.119},{sgwp,.239},H}; -N l36n41[]={{sgb9,.179},{sXng,.268},H}; -N l36n43[]={{sspn,.139},H}; -N l36n44[]={{sqm,.172},{sxg,.219},H}; -N l36n45[]={{svs,.225},{sivg,.209},{swosg,.239},H}; -N l36n46[]={{sgr,.955},{ssvX,.179},{sovit,.186},{sXe8y,.119},H}; -N l36n50[]={{sgxiq,.239},H}; -N l36n51[]={{sxizg,.239},H}; -N l36n52[]={{spg,.517},H}; -N l36n53[]={{srmqm,.159},H}; -N l36n54[]={{sgtv,.925},H}; -N l36n55[]={{s7aX,.451},{sYmg,.298},{svXe8,.119},H}; -N l36n56[]={{se8g,.313},H}; -N l36n58[]={{sgwig,.517},H}; -N l36n60[]={{shg,.119},H}; -N l36n61[]={{sYs,.292},{sikX,.239},H}; -N l36n63[]={{svX,.650},{sgs,.676},{spXr,.139},H}; -N l36n64[]={{swpsz,.212},H}; -N l36n65[]={{sgni,.776},H}; -N l36n67[]={{szm,.252},{smpg,.447},H}; -N l36n68[]={{swpX,.119},{szwi,.119},H}; -N l36n69[]={{sgYmg,.358},{sin,.093},{sti,.080},H}; -N l36n71[]={{ssz,.544},{snX,.371},{sxme8r,.212},H}; -N l36n72[]={{ssk,.186},{sgws,.388},{sgqX,.239},H}; -N l36n73[]={{sghs,.358},H}; -N l36n74[]={{skXg,.388},{sgtsk,.318},H}; -N l36n75[]={{srm,.902},{syg,.298},{sXpg,.239},{szih,.159},{sswxm,.186},H}; -N l36n76[]={{sws,.278},H}; -N l36n77[]={{stvX,.199},{szsp,.159},H}; -N l36n78[]={{somg,.358},H}; -N l36n79[]={{sXzr,.179},{sYX,.080},H}; -N l36n80[]={{sgt,1.671},H}; -N l36n81[]={{sXv,.239},{sgX,.239},{svXz,.199},H}; -N l36n82[]={{syhm,.139},H}; -N l36n83[]={{sqg,.457},{svit,.179},{sgwt,.179},H}; -N l36n84[]={{sos,.517},{smqg,.209},H}; -N l36n86[]={{sio,.199},{smwx,.179},{sXxmg,.278},{sZmg,.209},H}; -N l36n88[]={{sxyhm,.159},H}; -N l36n89[]={{sgrX,.597},{sgxs,.179},H}; -N l36n90[]={{smw,.239},{sg7ag,.328},H}; -N l36n91[]={{sig,2.048},{sgkp,.179},H}; -N l36n92[]={{srn,.239},{stsk,.179},H}; -N l36n93[]={{swt,.106},H}; -N l36n95[]={{swoi,.179},H}; -N l36n97[]={{stXg,.358},H}; -N l36n98[]={{sgY,.716},{spr,.159},{soXx,.179},{sXw,.106},H}; -N l36n99[]={{sXh,.252},H}; -N l36n101[]={{smrg,.716},{sxmg,.477},{sgtvi,.398},H}; -N l36n102[]={{soX,.384},{se8r,.328},H}; -N l36n103[]={{sip,.225},{srig,.388},H}; -N l36n106[]={{szg,.756},{sghv,.477},{shr,.146},H}; -N l36n107[]={{smx,.278},{sxs,.265},H}; -N l36n108[]={{svbe,.146},{sirmg,.278},H}; -N l36n109[]={{spmg,.388},H}; -N l36n110[]={{sgtsw,.438},{sXpm,.119},H}; -N l36n111[]={{ssksz,.186},H}; -N l36n112[]={{sYv,.172},{sxiq,.159},H}; -N l36n113[]={{sgtvm,.438},{sizg,.298},H}; -N l36n114[]={{srg,.617},{sgv,.259},{sszX,.159},H}; -N l36n115[]={{sXx,.331},{sps,.225},{sbeX,.219},H}; -N l36n116[]={{sgwps,.239},{sgqi,.179},{srik,.119},H}; -N l36n117[]={{shmg,.388},{sgsY,.328},{ship,.139},H}; -N l36n118[]={{szp,.106},H}; -N l36n119[]={{smqm,.199},H}; -N l36n120[]={{siq,.305},{sXe8yr,.159},H}; -N l36n121[]={{stvi,.239},{syr,.106},H}; -N l36n123[]={{shs,.278},{sgtX,.418},{sgzs,.328},{sYmp,.139},{ssn,.093},H}; -N l36n124[]={{sspmx,.265},H}; -N l36n125[]={{sxX,.305},H}; -N l36n126[]={{sgom,.209},H}; -N l36n127[]={{sgwx,.179},H}; -N l36n128[]={{sgb9i,.179},H}; -N l36n130[]={{sb9o,.179},H}; -N l36n131[]={{sgw,1.352},{svi,.557},H}; -N l36n132[]={{sgh,1.173},{swxmg,.278},H}; -N l36n133[]={{spX,.438},{sg7aXg,.477},{sgri,.358},{spsz,.179},{sbeXz,.268},H}; -N l36n135[]={{sov,.146},{swxv,.139},{sgYsg,.278},H}; -N l36n136[]={{szspm,.186},H}; -N l36n137[]={{sir,.438},H}; -N l36n139[]={{sni,.623},{sgsh,.239},{svXh,.119},H}; -N l36n140[]={{sqmg,.328},{sso,.133},H}; -N l36n141[]={{shX,.438},{smz,.119},H}; -N l36n142[]={{srwo,.139},H}; -N l36n144[]={{sXrm,.139},H}; -N l36n145[]={{ssg,1.790},{soXxi,.212},H}; -N l36n146[]={{sqs,.172},H}; -N l36n147[]={{sgmr,.626},{sYi,.093},{svy,.080},{stsp,.119},H}; -N l36n148[]={{sgx,.815},H}; -N l36n149[]={{sXz,.424},{sgi,.298},H}; -N l36n150[]={{svXe8y,.159},H}; -N l36n151[]={{s7aXg,.358},{svbeX,.219},{se8yr,.268},{srikX,.159},H}; -N l36n152[]={{szr,.199},{sshm,.119},H}; -N l36n153[]={{sihr,.119},H}; -N l36n155[]={{sny,.186},{sXrn,.239},{sYvX,.179},{sgxy,.179},H}; -N l36n157[]={{ssp,.371},{sikXg,.438},{sYsg,.268},{sgvX,.179},H}; -N l36n158[]={{sxv,.146},{sszi,.179},H}; -N l36n159[]={{sml,.239},{sgsg,.209},H}; -N l36n161[]={{swx,.597},{sgnig,1.034},H}; -N l36n162[]={{swi,.477},{srsw,.179},{sqir,.139},H}; -N l36n164[]={{sqX,.212},{sghvbe,.358},H}; -N l36n165[]={{stvm,.219},{skp,.133},{sgy,.179},{stvih,.186},{sXpr,.119},H}; -N l36n167[]={{sxiv,.259},{sXl,.159},{snXg,.328},{sgzw,.239},{sszg,.179},H}; -N l36n168[]={{sgwsg,.278},H}; -N l36n169[]={{szs,.345},{stsks,.186},H}; -N l36n170[]={{soi,.199},H}; -N l36n171[]={{srmg,.835},{sit,.146},H}; -N l36n172[]={{swsg,.268},H}; -N l36n173[]={{syY,.106},H}; -N l36n174[]={{shv,.265},{ssq,.212},H}; -N l36n175[]={{sghX,.477},{stvXz,.186},H}; -N l36n177[]={{srs,.438},{sgrm,.268},H}; -N l36n178[]={{syhmg,.278},{sZi,.093},H}; -N l36n179[]={{srni,.139},H}; -N l36n180[]={{sosg,.597},H}; -N l36n182[]={{sgz,1.213},{sriq,.119},H}; -N l36n183[]={{sgk,.199},H}; -N l36n184[]={{slg,.517},{sswp,.139},H}; -N l36n185[]={{szir,.119},{sgrXg,.239},H}; -N l36n186[]={{soy,.080},H}; -N l36n187[]={{szX,.345},H}; -N l36n189[]={{siY,.119},H}; -N l36n191[]={{shw,.146},{ssr,.106},{sgzsp,.278},H}; -N l36n193[]={{sxi,.583},{smn,.172},H}; -N l36n194[]={{smxi,.119},H}; -N l36n195[]={{srX,.530},{srml,.139},H}; -N l36n198[]={{soXg,.298},H}; -N l36n199[]={{svm,.384},{sgxyh,.239},H}; -N l36n201[]={{spi,.265},{sXn,.265},H}; -N l36n202[]={{sXxi,.159},H}; -N l36n203[]={{sxsg,.268},H}; -N l36n204[]={{swxX,.199},H}; -N l36n205[]={{siv,.358},{swos,.139},H}; -N l36n206[]={{siZ,.080},H}; -N l36n207[]={{snm,.159},{syh,.146},{svih,.219},H}; -N l36n209[]={{shi,.225},{sm7a,.225},{sxy,.106},{spXh,.139},H}; -N l36n210[]={{smo,.212},H}; -N l36n211[]={{sxiz,.179},H}; -N l36n215[]={{smg,2.486},{sYm,.292},{smqmg,.398},H}; -N l36n216[]={{sks,.186},{siqg,.358},{shvbe,.199},{svn,.093},H}; -N l36n217[]={{sgm,.776},{sme8r,.179},H}; -N l36n218[]={{sgwi,.507},{sXo,.172},H}; -N l36n219[]={{sgtXg,.477},{sghi,.268},{shsg,.179},H}; -N l36n220[]={{szv,.146},H}; -N l36n221[]={{se8y,.209},{sxXg,.179},H}; -N l36n222[]={{swps,.159},{sovi,.159},{siw,.093},{sgomg,.278},H}; -N l36n223[]={{sXg,2.585},{sih,.424},H}; -N l36n224[]={{stsw,.259},{sgb9ig,.239},H}; -N l36n225[]={{sYsp,.119},H}; -N l36n226[]={{sxz,.106},{sgqs,.209},H}; -N l36n227[]={{smp,.331},{sgwg,.179},H}; -N l36n228[]={{srmo,.179},H}; -N l36n229[]={{sgYm,.418},{spXg,.268},{srZ,.080},H}; -N l36n230[]={{s7ag,.358},{sXhm,.119},H}; -N l36n231[]={{szmp,.119},H}; -N l36n232[]={{sqi,.278},H}; -N l36n234[]={{sgn,.537},{skX,.225},{sksz,.139},H}; -N l36n235[]={{sXp,.464},{snig,1.044},{sgxi,.477},{snXp,.139},H}; -N l36n237[]={{shXg,.626},{szw,.172},{shrm,.139},H}; -N l36n238[]={{som,.239},{svg,.278},{smxm,.159},H}; -N l36n239[]={{sts,.623},{six,.172},H}; -N l36n243[]={{sgmrg,.835},{ssY,.225},H}; -N l36n244[]={{smq,.305},{sXnX,.119},H}; -N l36n245[]={{srw,.106},H}; -N l36n246[]={{sng,.318},{sZm,.159},{sXxm,.199},H}; -N l36n249[]={{svbeXz,.239},{svXr,.139},H}; -N l36n250[]={{sg7a,1.074},{srmq,.159},H}; -N l36n251[]={{sgo,.736},{shvbeX,.265},{snyg,.179},H}; -N l36n252[]={{sXq,.106},H}; -N l36n253[]={{sxme8,.159},H}; -N l36n254[]={{srswx,.212},H}; -N l36n255[]={{szi,.411},{smlg,.507},H}; - -D l36_d = -{ +S sgYs[] = { 32, 98, o, 0 }; +S sXb9[] = { 97, 185, 0 }; +S szw[] = { v, s, 0 }; +S sgtXg[] = { 32, p, 97, a }; +S sXrn[] = { 97, n, j, 0 }; +S sikX[] = { e, g, 97, 0 }; +S sme8[] = { i, 232, 0 }; +S sikXg[] = { e, g, 97, a }; +S spmx[] = { l, i, t, 0 }; +S sqmg[] = { m, i, a }; +S svbeX[] = { r, 190, 97, 0 }; +S svbe[] = { r, 190, 0 }; +S sizg[] = { e, v, a }; +S smb9[] = { i, 185, 0 }; +S shvbe[] = { d, r, 190, 0 }; +S sspmx[] = { o, l, i, t, 0 }; +S ssks[] = { o, g, o, 0 }; +S sYmg[] = { 98, i, a }; +S sb9i[] = { 185, e, 0 }; +S shvbeX[] = { d, r, 190, 97, 0 }; +S smqmg[] = { i, m, i, a }; +S sgYmg[] = { 32, 98, i, a }; +S sYsg[] = { 98, o, a }; +S stsk[] = { p, o, g, 0 }; +S sxiz[] = { t, e, v, 0 }; +S sXzr[] = { 97, v, n, 0 }; +S sXng[] = { 97, j, a }; +S svbeXz[] = { r, 190, 97, v, 0 }; +S sbeXz[] = { 190, 97, v, 0 }; +S sme8r[] = { i, 232, n, 0 }; +S sghvbe[] = { 32, d, r, 190, 0 }; +S sb9o[] = { 185, k, 0 }; +S spny[] = { l, j, u, 0 }; +S sgtsk[] = { 32, p, o, g, 0 }; +S soXxi[] = { k, 97, t, e, 0 }; +S sxme8[] = { t, i, 232, 0 }; +S sovi[] = { k, r, e, 0 }; +S sXxiv[] = { 97, t, e, r, 0 }; +S sgzw[] = { 32, v, s, 0 }; +S sxme8r[] = { t, i, 232, n, 0 }; +S swpsz[] = { s, l, o, v, 0 }; +S sgwsg[] = { 32, s, o, a }; +S stsks[] = { p, o, g, o, 0 }; +S ssksz[] = { o, g, o, v, 0 }; +S sgomg[] = { 32, k, i, a }; +S szrm[] = { v, n, i, 0 }; +S spXh[] = { l, 97, d, 0 }; +S syhmg[] = { u, d, i, a }; +S sXxmg[] = { 97, t, i, a }; +S sovit[] = { k, r, e, p, 0 }; +S sgzsp[] = { 32, v, o, l, 0 }; +S srmlg[] = { n, i, h, a }; +S sXlg[] = { 97, h, a }; +S srml[] = { n, i, h, 0 }; +S sswxm[] = { o, s, t, i, 0 }; +S se8y[] = { 232, u, 0 }; +S sirmg[] = { e, n, i, a }; +S snXp[] = { j, 97, l, 0 }; +S szspm[] = { v, o, l, i, 0 }; +S sgYsg[] = { 32, 98, o, a }; +S svXe8y[] = { r, 97, 232, u, 0 }; +S swosg[] = { s, k, o, a }; +S sxizg[] = { t, e, v, a }; +S sgrmg[] = { 32, n, i, a }; +S sshm[] = { o, d, i, 0 }; +S sgwps[] = { 32, s, l, o, 0 }; +S srmqm[] = { n, i, m, i, 0 }; +S sgb9ig[] = { 32, 185, e, a }; +S sYsp[] = { 98, o, l, 0 }; +S smxiz[] = { i, t, e, v, 0 }; +S sXe8y[] = { 97, 232, u, 0 }; +S sihX[] = { e, d, 97, 0 }; +S svnX[] = { r, j, 97, 0 }; +S se8yr[] = { 232, u, n, 0 }; +S sgb9i[] = { 32, 185, e, 0 }; +S szwi[] = { v, s, e, 0 }; +S svXe8[] = { r, 97, 232, 0 }; +S sXe8yr[] = { 97, 232, u, n, 0 }; +S srikX[] = { n, e, g, 97, 0 }; +S sriq[] = { n, e, m, 0 }; +S sgxyh[] = { 32, t, u, d, 0 }; +S sgxiq[] = { 32, t, e, m, 0 }; + +N l36n0[] = { { smb9, .133 }, H }; +N l36n1[] = { { stX, .199 }, H }; +N l36n2[] = { { swig, .477 }, H }; +N l36n3[] = { { ssv, .305 }, { svnX, .119 }, H }; +N l36n5[] = { { sxm, .491 }, { smr, .384 }, { ssqi, .119 }, H }; +N l36n7[] = { { sri, .464 }, { sXlg, .209 }, H }; +N l36n8[] = { { swo, .305 }, { sXb9, .172 }, H }; +N l36n9[] = { { spmx, .219 }, H }; +N l36n10[] = { { soig, .209 }, { sYp, .093 }, { sihX, .119 }, H }; +N l36n12[] = { { sgp, .358 }, { sirm, .179 }, { sszs, .119 }, H }; +N l36n13[] = { { sXr, .517 }, { spm, .504 }, { swg, .199 }, { ssks, .199 }, H }; +N l36n14[] = { { sosr, .119 }, H }; +N l36n15[] = { { sghXg, .597 }, H }; +N l36n16[] = { { sswx, .298 }, H }; +N l36n17[] = { { siz, .345 }, { srsg, .239 }, { se8m, .209 }, { sgrmg, .239 }, H }; +N l36n18[] = { { sik, .199 }, H }; +N l36n20[] = { { ssw, .398 }, H }; +N l36n21[] = { { sgts, 1.163 }, { shm, .292 }, { ssh, .265 }, { sog, .159 }, H }; +N l36n22[] = { { sgzg, .507 }, H }; +N l36n23[] = { { sgm7a, .388 }, H }; +N l36n25[] = { { swp, .212 }, H }; +N l36n27[] = { { szrm, .139 }, H }; +N l36n28[] = { { svr, .133 }, { sb9i, .199 }, H }; +N l36n29[] = { { sgq, .457 }, { sxyh, .119 }, H }; +N l36n30[] = { { spn, .331 }, H }; +N l36n31[] = { { sme8, .159 }, H }; +N l36n32[] = { { sspm, .278 }, { sXxiv, .212 }, H }; +N l36n33[] = { { sop, .106 }, H }; +N l36n34[] = { { stv, .544 }, H }; +N l36n35[] = { { srXg, .537 }, { srmlg, .278 }, H }; +N l36n36[] = { { swxm, .239 }, { stswp, .186 }, { smxiz, .159 }, H }; +N l36n37[] = { { sg7aX, .895 }, { ssx, .133 }, { spny, .159 }, H }; +N l36n38[] = { { sgoX, .328 }, H }; +N l36n39[] = { { sgYs, .418 }, { sXe8, .119 }, { sgwp, .239 }, H }; +N l36n41[] = { { sgb9, .179 }, { sXng, .268 }, H }; +N l36n43[] = { { sspn, .139 }, H }; +N l36n44[] = { { sqm, .172 }, { sxg, .219 }, H }; +N l36n45[] = { { svs, .225 }, { sivg, .209 }, { swosg, .239 }, H }; +N l36n46[] = { { sgr, .955 }, { ssvX, .179 }, { sovit, .186 }, { sXe8y, .119 }, H }; +N l36n50[] = { { sgxiq, .239 }, H }; +N l36n51[] = { { sxizg, .239 }, H }; +N l36n52[] = { { spg, .517 }, H }; +N l36n53[] = { { srmqm, .159 }, H }; +N l36n54[] = { { sgtv, .925 }, H }; +N l36n55[] = { { s7aX, .451 }, { sYmg, .298 }, { svXe8, .119 }, H }; +N l36n56[] = { { se8g, .313 }, H }; +N l36n58[] = { { sgwig, .517 }, H }; +N l36n60[] = { { shg, .119 }, H }; +N l36n61[] = { { sYs, .292 }, { sikX, .239 }, H }; +N l36n63[] = { { svX, .650 }, { sgs, .676 }, { spXr, .139 }, H }; +N l36n64[] = { { swpsz, .212 }, H }; +N l36n65[] = { { sgni, .776 }, H }; +N l36n67[] = { { szm, .252 }, { smpg, .447 }, H }; +N l36n68[] = { { swpX, .119 }, { szwi, .119 }, H }; +N l36n69[] = { { sgYmg, .358 }, { sin, .093 }, { sti, .080 }, H }; +N l36n71[] = { { ssz, .544 }, { snX, .371 }, { sxme8r, .212 }, H }; +N l36n72[] = { { ssk, .186 }, { sgws, .388 }, { sgqX, .239 }, H }; +N l36n73[] = { { sghs, .358 }, H }; +N l36n74[] = { { skXg, .388 }, { sgtsk, .318 }, H }; +N l36n75[] = { { srm, .902 }, { syg, .298 }, { sXpg, .239 }, { szih, .159 }, { sswxm, .186 }, H }; +N l36n76[] = { { sws, .278 }, H }; +N l36n77[] = { { stvX, .199 }, { szsp, .159 }, H }; +N l36n78[] = { { somg, .358 }, H }; +N l36n79[] = { { sXzr, .179 }, { sYX, .080 }, H }; +N l36n80[] = { { sgt, 1.671 }, H }; +N l36n81[] = { { sXv, .239 }, { sgX, .239 }, { svXz, .199 }, H }; +N l36n82[] = { { syhm, .139 }, H }; +N l36n83[] = { { sqg, .457 }, { svit, .179 }, { sgwt, .179 }, H }; +N l36n84[] = { { sos, .517 }, { smqg, .209 }, H }; +N l36n86[] = { { sio, .199 }, { smwx, .179 }, { sXxmg, .278 }, { sZmg, .209 }, H }; +N l36n88[] = { { sxyhm, .159 }, H }; +N l36n89[] = { { sgrX, .597 }, { sgxs, .179 }, H }; +N l36n90[] = { { smw, .239 }, { sg7ag, .328 }, H }; +N l36n91[] = { { sig, 2.048 }, { sgkp, .179 }, H }; +N l36n92[] = { { srn, .239 }, { stsk, .179 }, H }; +N l36n93[] = { { swt, .106 }, H }; +N l36n95[] = { { swoi, .179 }, H }; +N l36n97[] = { { stXg, .358 }, H }; +N l36n98[] = { { sgY, .716 }, { spr, .159 }, { soXx, .179 }, { sXw, .106 }, H }; +N l36n99[] = { { sXh, .252 }, H }; +N l36n101[] = { { smrg, .716 }, { sxmg, .477 }, { sgtvi, .398 }, H }; +N l36n102[] = { { soX, .384 }, { se8r, .328 }, H }; +N l36n103[] = { { sip, .225 }, { srig, .388 }, H }; +N l36n106[] = { { szg, .756 }, { sghv, .477 }, { shr, .146 }, H }; +N l36n107[] = { { smx, .278 }, { sxs, .265 }, H }; +N l36n108[] = { { svbe, .146 }, { sirmg, .278 }, H }; +N l36n109[] = { { spmg, .388 }, H }; +N l36n110[] = { { sgtsw, .438 }, { sXpm, .119 }, H }; +N l36n111[] = { { ssksz, .186 }, H }; +N l36n112[] = { { sYv, .172 }, { sxiq, .159 }, H }; +N l36n113[] = { { sgtvm, .438 }, { sizg, .298 }, H }; +N l36n114[] = { { srg, .617 }, { sgv, .259 }, { sszX, .159 }, H }; +N l36n115[] = { { sXx, .331 }, { sps, .225 }, { sbeX, .219 }, H }; +N l36n116[] = { { sgwps, .239 }, { sgqi, .179 }, { srik, .119 }, H }; +N l36n117[] = { { shmg, .388 }, { sgsY, .328 }, { ship, .139 }, H }; +N l36n118[] = { { szp, .106 }, H }; +N l36n119[] = { { smqm, .199 }, H }; +N l36n120[] = { { siq, .305 }, { sXe8yr, .159 }, H }; +N l36n121[] = { { stvi, .239 }, { syr, .106 }, H }; +N l36n123[] = { { shs, .278 }, { sgtX, .418 }, { sgzs, .328 }, { sYmp, .139 }, { ssn, .093 }, H }; +N l36n124[] = { { sspmx, .265 }, H }; +N l36n125[] = { { sxX, .305 }, H }; +N l36n126[] = { { sgom, .209 }, H }; +N l36n127[] = { { sgwx, .179 }, H }; +N l36n128[] = { { sgb9i, .179 }, H }; +N l36n130[] = { { sb9o, .179 }, H }; +N l36n131[] = { { sgw, 1.352 }, { svi, .557 }, H }; +N l36n132[] = { { sgh, 1.173 }, { swxmg, .278 }, H }; +N l36n133[] = { { spX, .438 }, { sg7aXg, .477 }, { sgri, .358 }, { spsz, .179 }, { sbeXz, .268 }, H }; +N l36n135[] = { { sov, .146 }, { swxv, .139 }, { sgYsg, .278 }, H }; +N l36n136[] = { { szspm, .186 }, H }; +N l36n137[] = { { sir, .438 }, H }; +N l36n139[] = { { sni, .623 }, { sgsh, .239 }, { svXh, .119 }, H }; +N l36n140[] = { { sqmg, .328 }, { sso, .133 }, H }; +N l36n141[] = { { shX, .438 }, { smz, .119 }, H }; +N l36n142[] = { { srwo, .139 }, H }; +N l36n144[] = { { sXrm, .139 }, H }; +N l36n145[] = { { ssg, 1.790 }, { soXxi, .212 }, H }; +N l36n146[] = { { sqs, .172 }, H }; +N l36n147[] = { { sgmr, .626 }, { sYi, .093 }, { svy, .080 }, { stsp, .119 }, H }; +N l36n148[] = { { sgx, .815 }, H }; +N l36n149[] = { { sXz, .424 }, { sgi, .298 }, H }; +N l36n150[] = { { svXe8y, .159 }, H }; +N l36n151[] = { { s7aXg, .358 }, { svbeX, .219 }, { se8yr, .268 }, { srikX, .159 }, H }; +N l36n152[] = { { szr, .199 }, { sshm, .119 }, H }; +N l36n153[] = { { sihr, .119 }, H }; +N l36n155[] = { { sny, .186 }, { sXrn, .239 }, { sYvX, .179 }, { sgxy, .179 }, H }; +N l36n157[] = { { ssp, .371 }, { sikXg, .438 }, { sYsg, .268 }, { sgvX, .179 }, H }; +N l36n158[] = { { sxv, .146 }, { sszi, .179 }, H }; +N l36n159[] = { { sml, .239 }, { sgsg, .209 }, H }; +N l36n161[] = { { swx, .597 }, { sgnig, 1.034 }, H }; +N l36n162[] = { { swi, .477 }, { srsw, .179 }, { sqir, .139 }, H }; +N l36n164[] = { { sqX, .212 }, { sghvbe, .358 }, H }; +N l36n165[] = { { stvm, .219 }, { skp, .133 }, { sgy, .179 }, { stvih, .186 }, { sXpr, .119 }, H }; +N l36n167[] = { { sxiv, .259 }, { sXl, .159 }, { snXg, .328 }, { sgzw, .239 }, { sszg, .179 }, H }; +N l36n168[] = { { sgwsg, .278 }, H }; +N l36n169[] = { { szs, .345 }, { stsks, .186 }, H }; +N l36n170[] = { { soi, .199 }, H }; +N l36n171[] = { { srmg, .835 }, { sit, .146 }, H }; +N l36n172[] = { { swsg, .268 }, H }; +N l36n173[] = { { syY, .106 }, H }; +N l36n174[] = { { shv, .265 }, { ssq, .212 }, H }; +N l36n175[] = { { sghX, .477 }, { stvXz, .186 }, H }; +N l36n177[] = { { srs, .438 }, { sgrm, .268 }, H }; +N l36n178[] = { { syhmg, .278 }, { sZi, .093 }, H }; +N l36n179[] = { { srni, .139 }, H }; +N l36n180[] = { { sosg, .597 }, H }; +N l36n182[] = { { sgz, 1.213 }, { sriq, .119 }, H }; +N l36n183[] = { { sgk, .199 }, H }; +N l36n184[] = { { slg, .517 }, { sswp, .139 }, H }; +N l36n185[] = { { szir, .119 }, { sgrXg, .239 }, H }; +N l36n186[] = { { soy, .080 }, H }; +N l36n187[] = { { szX, .345 }, H }; +N l36n189[] = { { siY, .119 }, H }; +N l36n191[] = { { shw, .146 }, { ssr, .106 }, { sgzsp, .278 }, H }; +N l36n193[] = { { sxi, .583 }, { smn, .172 }, H }; +N l36n194[] = { { smxi, .119 }, H }; +N l36n195[] = { { srX, .530 }, { srml, .139 }, H }; +N l36n198[] = { { soXg, .298 }, H }; +N l36n199[] = { { svm, .384 }, { sgxyh, .239 }, H }; +N l36n201[] = { { spi, .265 }, { sXn, .265 }, H }; +N l36n202[] = { { sXxi, .159 }, H }; +N l36n203[] = { { sxsg, .268 }, H }; +N l36n204[] = { { swxX, .199 }, H }; +N l36n205[] = { { siv, .358 }, { swos, .139 }, H }; +N l36n206[] = { { siZ, .080 }, H }; +N l36n207[] = { { snm, .159 }, { syh, .146 }, { svih, .219 }, H }; +N l36n209[] = { { shi, .225 }, { sm7a, .225 }, { sxy, .106 }, { spXh, .139 }, H }; +N l36n210[] = { { smo, .212 }, H }; +N l36n211[] = { { sxiz, .179 }, H }; +N l36n215[] = { { smg, 2.486 }, { sYm, .292 }, { smqmg, .398 }, H }; +N l36n216[] = { { sks, .186 }, { siqg, .358 }, { shvbe, .199 }, { svn, .093 }, H }; +N l36n217[] = { { sgm, .776 }, { sme8r, .179 }, H }; +N l36n218[] = { { sgwi, .507 }, { sXo, .172 }, H }; +N l36n219[] = { { sgtXg, .477 }, { sghi, .268 }, { shsg, .179 }, H }; +N l36n220[] = { { szv, .146 }, H }; +N l36n221[] = { { se8y, .209 }, { sxXg, .179 }, H }; +N l36n222[] = { { swps, .159 }, { sovi, .159 }, { siw, .093 }, { sgomg, .278 }, H }; +N l36n223[] = { { sXg, 2.585 }, { sih, .424 }, H }; +N l36n224[] = { { stsw, .259 }, { sgb9ig, .239 }, H }; +N l36n225[] = { { sYsp, .119 }, H }; +N l36n226[] = { { sxz, .106 }, { sgqs, .209 }, H }; +N l36n227[] = { { smp, .331 }, { sgwg, .179 }, H }; +N l36n228[] = { { srmo, .179 }, H }; +N l36n229[] = { { sgYm, .418 }, { spXg, .268 }, { srZ, .080 }, H }; +N l36n230[] = { { s7ag, .358 }, { sXhm, .119 }, H }; +N l36n231[] = { { szmp, .119 }, H }; +N l36n232[] = { { sqi, .278 }, H }; +N l36n234[] = { { sgn, .537 }, { skX, .225 }, { sksz, .139 }, H }; +N l36n235[] = { { sXp, .464 }, { snig, 1.044 }, { sgxi, .477 }, { snXp, .139 }, H }; +N l36n237[] = { { shXg, .626 }, { szw, .172 }, { shrm, .139 }, H }; +N l36n238[] = { { som, .239 }, { svg, .278 }, { smxm, .159 }, H }; +N l36n239[] = { { sts, .623 }, { six, .172 }, H }; +N l36n243[] = { { sgmrg, .835 }, { ssY, .225 }, H }; +N l36n244[] = { { smq, .305 }, { sXnX, .119 }, H }; +N l36n245[] = { { srw, .106 }, H }; +N l36n246[] = { { sng, .318 }, { sZm, .159 }, { sXxm, .199 }, H }; +N l36n249[] = { { svbeXz, .239 }, { svXr, .139 }, H }; +N l36n250[] = { { sg7a, 1.074 }, { srmq, .159 }, H }; +N l36n251[] = { { sgo, .736 }, { shvbeX, .265 }, { snyg, .179 }, H }; +N l36n252[] = { { sXq, .106 }, H }; +N l36n253[] = { { sxme8, .159 }, H }; +N l36n254[] = { { srswx, .212 }, H }; +N l36n255[] = { { szi, .411 }, { smlg, .507 }, H }; + +D l36_d = { "slovenian", "iso-8859-2", - { - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,0.210,0.047,0.014,0.082,0.192,0.002,0.027,0.021,0.189,0.071,0.076,0.098,0.055,0.133,0.180, - 0.065,W,0.107,0.097,0.092,0.038,0.104,W,W,W,0.044,W,W,W,W,W, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - Y,Y,Y,Y,Y,Y,Y,Y,Y,0.001,Y,Y,Y,Y,0.002,Y, - Y,Y,Y,Y,Y,Y,Y,Y,Y,0.033,Y,Y,Y,Y,0.019,Y, - Y,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V, - V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V, - V,V,V,V,V,V,V,V,0.047,V,V,V,V,V,V,V, - V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V - }, - { - l36n0,l36n1,l36n2,l36n3,X,l36n5,X,l36n7,l36n8,l36n9,l36n10,X,l36n12,l36n13,l36n14,l36n15, - l36n16,l36n17,l36n18,X,l36n20,l36n21,l36n22,l36n23,X,l36n25,X,l36n27,l36n28,l36n29,l36n30,l36n31, - l36n32,l36n33,l36n34,l36n35,l36n36,l36n37,l36n38,l36n39,X,l36n41,X,l36n43,l36n44,l36n45,l36n46,X, - X,X,l36n50,l36n51,l36n52,l36n53,l36n54,l36n55,l36n56,X,l36n58,X,l36n60,l36n61,X,l36n63, - l36n64,l36n65,X,l36n67,l36n68,l36n69,X,l36n71,l36n72,l36n73,l36n74,l36n75,l36n76,l36n77,l36n78,l36n79, - l36n80,l36n81,l36n82,l36n83,l36n84,X,l36n86,X,l36n88,l36n89,l36n90,l36n91,l36n92,l36n93,X,l36n95, - X,l36n97,l36n98,l36n99,X,l36n101,l36n102,l36n103,X,X,l36n106,l36n107,l36n108,l36n109,l36n110,l36n111, - l36n112,l36n113,l36n114,l36n115,l36n116,l36n117,l36n118,l36n119,l36n120,l36n121,X,l36n123,l36n124,l36n125,l36n126,l36n127, - l36n128,X,l36n130,l36n131,l36n132,l36n133,X,l36n135,l36n136,l36n137,X,l36n139,l36n140,l36n141,l36n142,X, - l36n144,l36n145,l36n146,l36n147,l36n148,l36n149,l36n150,l36n151,l36n152,l36n153,X,l36n155,X,l36n157,l36n158,l36n159, - X,l36n161,l36n162,X,l36n164,l36n165,X,l36n167,l36n168,l36n169,l36n170,l36n171,l36n172,l36n173,l36n174,l36n175, - X,l36n177,l36n178,l36n179,l36n180,X,l36n182,l36n183,l36n184,l36n185,l36n186,l36n187,X,l36n189,X,l36n191, - X,l36n193,l36n194,l36n195,X,X,l36n198,l36n199,X,l36n201,l36n202,l36n203,l36n204,l36n205,l36n206,l36n207, - X,l36n209,l36n210,l36n211,X,X,X,l36n215,l36n216,l36n217,l36n218,l36n219,l36n220,l36n221,l36n222,l36n223, - l36n224,l36n225,l36n226,l36n227,l36n228,l36n229,l36n230,l36n231,l36n232,X,l36n234,l36n235,X,l36n237,l36n238,l36n239, - X,X,X,l36n243,l36n244,l36n245,l36n246,X,X,l36n249,l36n250,l36n251,l36n252,l36n253,l36n254,l36n255 - } + { W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, 0.210, 0.047, 0.014, 0.082, 0.192, 0.002, 0.027, 0.021, 0.189, 0.071, 0.076, 0.098, 0.055, 0.133, 0.180, + 0.065, W, 0.107, 0.097, 0.092, 0.038, 0.104, W, W, W, 0.044, W, W, W, W, W, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + Y, Y, Y, Y, Y, Y, Y, Y, Y, 0.001, Y, Y, Y, Y, 0.002, Y, + Y, Y, Y, Y, Y, Y, Y, Y, Y, 0.033, Y, Y, Y, Y, 0.019, Y, + Y, V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, + V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, + V, V, V, V, V, V, V, V, 0.047, V, V, V, V, V, V, V, + V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, V }, + { l36n0, l36n1, l36n2, l36n3, X, l36n5, X, l36n7, l36n8, l36n9, l36n10, X, l36n12, l36n13, l36n14, l36n15, + l36n16, l36n17, l36n18, X, l36n20, l36n21, l36n22, l36n23, X, l36n25, X, l36n27, l36n28, l36n29, l36n30, l36n31, + l36n32, l36n33, l36n34, l36n35, l36n36, l36n37, l36n38, l36n39, X, l36n41, X, l36n43, l36n44, l36n45, l36n46, X, + X, X, l36n50, l36n51, l36n52, l36n53, l36n54, l36n55, l36n56, X, l36n58, X, l36n60, l36n61, X, l36n63, + l36n64, l36n65, X, l36n67, l36n68, l36n69, X, l36n71, l36n72, l36n73, l36n74, l36n75, l36n76, l36n77, l36n78, l36n79, + l36n80, l36n81, l36n82, l36n83, l36n84, X, l36n86, X, l36n88, l36n89, l36n90, l36n91, l36n92, l36n93, X, l36n95, + X, l36n97, l36n98, l36n99, X, l36n101, l36n102, l36n103, X, X, l36n106, l36n107, l36n108, l36n109, l36n110, l36n111, + l36n112, l36n113, l36n114, l36n115, l36n116, l36n117, l36n118, l36n119, l36n120, l36n121, X, l36n123, l36n124, l36n125, l36n126, l36n127, + l36n128, X, l36n130, l36n131, l36n132, l36n133, X, l36n135, l36n136, l36n137, X, l36n139, l36n140, l36n141, l36n142, X, + l36n144, l36n145, l36n146, l36n147, l36n148, l36n149, l36n150, l36n151, l36n152, l36n153, X, l36n155, X, l36n157, l36n158, l36n159, + X, l36n161, l36n162, X, l36n164, l36n165, X, l36n167, l36n168, l36n169, l36n170, l36n171, l36n172, l36n173, l36n174, l36n175, + X, l36n177, l36n178, l36n179, l36n180, X, l36n182, l36n183, l36n184, l36n185, l36n186, l36n187, X, l36n189, X, l36n191, + X, l36n193, l36n194, l36n195, X, X, l36n198, l36n199, X, l36n201, l36n202, l36n203, l36n204, l36n205, l36n206, l36n207, + X, l36n209, l36n210, l36n211, X, X, X, l36n215, l36n216, l36n217, l36n218, l36n219, l36n220, l36n221, l36n222, l36n223, + l36n224, l36n225, l36n226, l36n227, l36n228, l36n229, l36n230, l36n231, l36n232, X, l36n234, l36n235, X, l36n237, l36n238, l36n239, + X, X, X, l36n243, l36n244, l36n245, l36n246, X, X, l36n249, l36n250, l36n251, l36n252, l36n253, l36n254, l36n255 } }; - - // // Lng: spanish // Enc: iso-8859-15 // - -S sf3rg[]={243,n,a}; -S smf3r[]={i,243,n,0}; -S smf3rg[]={i,243,n,a}; -S sZmf3r[]={99,i,243,n,0}; -S spmry[]={l,i,n,u,0}; -S smry78[]={i,n,u,x,0}; -S sry78[]={n,u,x,0}; -S ssri[]={o,n,e,0}; -S sgpmr[]={32,l,i,n,0}; -S sry78g[]={n,u,x,a}; -S spsw[]={l,o,s,0}; -S spswg[]={l,o,s,a}; -S sriwg[]={n,e,s,a}; -S sgyw[]={32,u,s,0}; -S sZsrg[]={99,o,n,a}; -S ssriw[]={o,n,e,s,0}; -S smsri[]={i,o,n,e,0}; -S sgpsw[]={32,l,o,s,0}; -S sqsw[]={m,o,s,0}; -S sqswg[]={m,o,s,a}; -S syXp[]={u,97,l,0}; -S sivs[]={e,r,o,0}; -S sZp[]={99,l,0}; -S sgmrw[]={32,i,n,s,0}; -S spXZ[]={l,97,99,0}; -S stsvg[]={p,o,r,a}; -S siqs[]={e,m,o,0}; -S sxiqX[]={t,e,m,97,0}; -S sXvxm[]={97,r,t,i,0}; -S srwxX[]={n,s,t,97,0}; -S swmw[]={s,i,s,0}; -S swxXp[]={s,t,97,l,0}; -S sivsg[]={e,r,o,a}; -S swmwx[]={s,i,s,t,0}; -S sxXpX[]={t,97,l,97,0}; -S sgwmw[]={32,s,i,s,0}; -S swxiq[]={s,t,e,m,0}; -S svqX[]={r,m,97,0}; -S sXqi[]={97,m,e,0}; -S siqXg[]={e,m,97,a}; -S smrxi[]={i,n,t,e,0}; -S s_Xvi[]={w,97,r,e,0}; -S s_Xv[]={w,97,r,0}; -S sgpsg[]={32,l,o,a}; -S sXvms[]={97,r,i,o,0}; - -N l37n1[]={{stX,.367},{smrx,.140},H}; -N l37n2[]={{swig,.289},H}; -N l37n3[]={{ssv,.449},{siqXg,.204},H}; -N l37n4[]={{sqXg,.255},{syrXg,.294},{ssZ,.088},H}; -N l37n5[]={{smr,.646},{sxm,.342},{sZmsr,.294},{svxm,.125},H}; -N l37n6[]={{srx,.614},{sgwm,.481},{shmw,.200},H}; -N l37n7[]={{sri,.343},{sghm,.391},H}; -N l37n8[]={{sXvig,.204},H}; -N l37n9[]={{slX,.171},{sXrx,.143},H}; -N l37n10[]={{stXvX,.304},{sYp,.097},H}; -N l37n11[]={{sZsq,.270},{svq,.109},{skv,.067},H}; -N l37n12[]={{sgp,1.228},{smry,.270},H}; -N l37n13[]={{swg,2.609},{sXr,.380},{spm,.372},{sgzi,.212},H}; -N l37n16[]={{swxXp,.151},H}; -N l37n17[]={{srsg,.269},H}; -N l37n20[]={{ssw,.684},{srwxX,.153},H}; -N l37n21[]={{shm,.282},{sgts,.345},{ssh,.145},H}; -N l37n22[]={{sms,.365},{sZsr,.443},{ssri,.247},{sXpX,.117},H}; -N l37n23[]={{sry,.253},H}; -N l37n24[]={{srj,.094},H}; -N l37n26[]={{spiwg,.241},H}; -N l37n27[]={{sf3rg,1.146},{srhsg,.279},H}; -N l37n29[]={{sgq,.574},{sZg,.102},H}; -N l37n31[]={{ssrg,.374},{sghip,.238},H}; -N l37n33[]={{sxig,.674},{sxXp,.141},{sXvms,.133},H}; -N l37n34[]={{stv,.221},H}; -N l37n35[]={{sy78,.170},{srXg,.272},H}; -N l37n36[]={{sym,.132},H}; -N l37n37[]={{ssx,.093},H}; -N l37n38[]={{spmry,.347},{smir,.204},H}; -N l37n40[]={{smX,.157},{sXhs,.196},H}; -N l37n41[]={{sZp,.089},{spig,.158},H}; -N l37n42[]={{sgpsw,.325},H}; -N l37n43[]={{suyig,1.098},{stiv,.196},{srxsg,.208},H}; -N l37n44[]={{sxg,.200},{sqm,.112},H}; -N l37n45[]={{svs,.348},{sivg,.311},H}; -N l37n46[]={{sgr,.391},H}; -N l37n47[]={{sXt,.112},H}; -N l37n48[]={{sgwiv,.272},{smrxi,.136},H}; -N l37n49[]={{shig,1.506},{srxX,.130},{sgpsg,.204},H}; -N l37n51[]={{swmwx,.148},H}; -N l37n52[]={{spg,.755},H}; -N l37n53[]={{stsvg,.249},H}; -N l37n54[]={{sgtv,.402},{svqX,.106},H}; -N l37n55[]={{sgpX,.792},H}; -N l37n56[]={{sgZs,1.118},H}; -N l37n57[]={{sgip,.679},{smY,.107},H}; -N l37n58[]={{sgwig,.264},H}; -N l37n59[]={{sghig,1.736},H}; -N l37n60[]={{shg,.194},H}; -N l37n61[]={{siqs,.121},H}; -N l37n62[]={{siwg,1.214},{sky,.135},H}; -N l37n63[]={{svX,.558},{sgs,.302},{sry78,.255},{swxiq,.146},H}; -N l37n64[]={{syig,.849},{spp,.103},{syXp,.140},H}; -N l37n65[]={{sXY,.125},H}; -N l37n66[]={{sXpi,.102},H}; -N l37n67[]={{szm,.108},{stXvx,.181},H}; -N l37n68[]={{sxXpX,.146},H}; -N l37n69[]={{sti,.187},H}; -N l37n70[]={{sxmZ,.130},H}; -N l37n72[]={{sgws,.215},H}; -N l37n73[]={{sg79g,.427},{smv,.128},{sghs,.181},H}; -N l37n74[]={{smZ,.288},H}; -N l37n75[]={{srm,.119},{sXpg,.266},{syg,.121},H}; -N l37n76[]={{sws,.219},H}; -N l37n77[]={{sXvx,.140},H}; -N l37n79[]={{sgir,.863},{sYX,.086},H}; -N l37n80[]={{sgt,1.223},H}; -N l37n81[]={{sXv,.833},{sgX,1.000},H}; -N l37n82[]={{sXZ,.384},{smrwx,.153},H}; -N l37n83[]={{sjm,.116},{sgrsg,.223},{sXqi,.104},H}; -N l37n85[]={{sty,.099},H}; -N l37n86[]={{smwx,.230},H}; -N l37n87[]={{sgty,.195},H}; -N l37n88[]={{sriwg,.351},{sZsqs,.186},H}; -N l37n89[]={{sgxs,.175},{sXrh,.115},H}; -N l37n90[]={{smw,.291},H}; -N l37n91[]={{sig,2.713},{smh,.187},H}; -N l37n92[]={{sZs,.682},H}; -N l37n93[]={{srxi,.474},{swt,.111},H}; -N l37n94[]={{swX,.148},H}; -N l37n95[]={{sgyr,.504},{sgwmw,.219},H}; -N l37n96[]={{sghmw,.362},{svv,.101},H}; -N l37n97[]={{sgu,.540},{sYpi,.111},{shsv,.109},H}; -N l37n98[]={{sXw,.493},{sgY,.170},H}; -N l37n99[]={{sXh,.341},{ssvg,.382},{sxXv,.117},H}; -N l37n100[]={{spsw,.200},H}; -N l37n103[]={{sip,.452},{sZmf3,.298},H}; -N l37n104[]={{sguy,.809},{srZm,.102},H}; -N l37n107[]={{sxs,.338},{smx,.133},{sgtsv,.253},H}; -N l37n108[]={{smi,.228},{shsw,.168},H}; -N l37n109[]={{sXrg,.187},H}; -N l37n110[]={{sZX,.279},H}; -N l37n111[]={{ssriw,.221},H}; -N l37n112[]={{sxiq,.132},H}; -N l37n113[]={{svw,.074},H}; -N l37n114[]={{srg,1.579},{sgv,.292},H}; -N l37n115[]={{sgZ,1.185},{sps,.307},{sXx,.127},{ssqs,.140},H}; -N l37n116[]={{sswg,1.404},{suy,.480},{smry78,.340},{sviw,.162},{sgqi,.198},H}; -N l37n117[]={{smZX,.149},{ship,.121},H}; -N l37n118[]={{sZsrg,.336},{spXw,.155},{smsg,.209},H}; -N l37n120[]={{siq,.291},H}; -N l37n121[]={{syr,.316},{stvi,.106},H}; -N l37n122[]={{sgZy,.156},H}; -N l37n123[]={{shs,.482},{sgtX,.583},{sxir,.126},H}; -N l37n124[]={{sXvX,.264},H}; -N l37n125[]={{sxX,.484},H}; -N l37n127[]={{sgZsq,.494},H}; -N l37n128[]={{swZ,.073},H}; -N l37n130[]={{sgZsr,.823},{svx,.160},{sgyrX,.279},H}; -N l37n131[]={{sgw,1.130},{svi,.587},{sy78g,.334},{sqsw,.158},{sgtvs,.294},H}; -N l37n132[]={{sgh,1.666},H}; -N l37n133[]={{spX,.618},{sirx,.543},{smwxi,.164},H}; -N l37n134[]={{sgiw,.821},{smhX,.149},H}; -N l37n135[]={{swxv,.121},H}; -N l37n136[]={{swiv,.153},{sXvxm,.156},{sXhsg,.215},{smXg,.150},H}; -N l37n137[]={{sir,1.038},{stm,.070},H}; -N l37n138[]={{sgwy,.252},H}; -N l37n140[]={{svms,.138},H}; -N l37n141[]={{shX,.275},{svsg,.308},{smz,.089},H}; -N l37n142[]={{smk,.092},{sXhX,.102},H}; -N l37n143[]={{sgpm,.439},H}; -N l37n144[]={{sgpXw,.257},H}; -N l37n145[]={{ssg,2.053},H}; -N l37n146[]={{sqs,.292},{sivs,.138},{sgXZ,.167},H}; -N l37n147[]={{sgmr,.645},{sxiqX,.156},H}; -N l37n148[]={{sgx,.562},{smf3r,.338},H}; -N l37n149[]={{sgi,1.809},H}; -N l37n150[]={{sgyw,.258},H}; -N l37n151[]={{sguyi,1.030},{sgpXg,.751},H}; -N l37n153[]={{sgipg,.789},H}; -N l37n156[]={{syX,.181},H}; -N l37n157[]={{ssp,.080},H}; -N l37n158[]={{sxv,.263},{sgZX,.266},H}; -N l37n159[]={{svXg,.467},{sry78g,.445},H}; -N l37n161[]={{swx,.447},H}; -N l37n162[]={{swi,.326},{sqir,.313},H}; -N l37n163[]={{sqt,.119},{siqX,.132},H}; -N l37n164[]={{sqX,.308},{syrX,.170},H}; -N l37n165[]={{sgy,.579},H}; -N l37n166[]={{sgj,.270},{sXrhs,.148},H}; -N l37n167[]={{sgti,.232},{sxiv,.149},H}; -N l37n168[]={{s78g,.266},{sXvi,.155},H}; -N l37n172[]={{swsg,.173},{siX,.074},H}; -N l37n174[]={{ssq,.226},{sXZmf3,.254},{siwt,.113},H}; -N l37n175[]={{sgirg,.913},H}; -N l37n176[]={{stg,.136},H}; -N l37n177[]={{srs,.234},{sZmf3r,.397},{sXvg,.439},{sgXg,.419},{sZx,.161},H}; -N l37n178[]={{swy,.171},{sZi,.156},{ssvq,.108},{smhXh,.138},H}; -N l37n180[]={{sirxi,.370},H}; -N l37n181[]={{sqY,.067},H}; -N l37n182[]={{sgz,.253},H}; -N l37n183[]={{sgk,.162},H}; -N l37n185[]={{sjs,.089},H}; -N l37n186[]={{spiw,.134},H}; -N l37n187[]={{sf3r,.563},{sZms,.266},{srhs,.179},{szX,.097},H}; -N l37n188[]={{sZsg,.204},{stp,.084},H}; -N l37n189[]={{srxig,.551},{syv,.089},H}; -N l37n190[]={{syZ,.091},H}; -N l37n191[]={{ssr,.596},{sgyrg,.309},{svR,.078},{sgxX,.158},H}; -N l37n192[]={{s_Xv,.102},H}; -N l37n193[]={{sxi,.696},H}; -N l37n194[]={{sXwg,.824},{sZy,.145},{shiw,.140},H}; -N l37n195[]={{srX,.267},H}; -N l37n196[]={{spswg,.400},{sviZ,.153},H}; -N l37n198[]={{spXZ,.126},H}; -N l37n199[]={{sipg,.784},{svm,.273},{s79g,.360},{spmr,.272},H}; -N l37n200[]={{sgl,.247},H}; -N l37n201[]={{spi,.287},{sgvi,.359},{sxvX,.189},H}; -N l37n202[]={{siZx,.136},H}; -N l37n203[]={{suyi,.606},{sxsg,.331},{srxs,.168},H}; -N l37n204[]={{swxX,.249},{shswg,.313},H}; -N l37n205[]={{siv,.694},{smZm,.140},H}; -N l37n206[]={{siZ,.298},{syw,.179},H}; -N l37n208[]={{smsr,.291},H}; -N l37n209[]={{shi,1.036},{sgtXv,.687},{sgps,.444},{sxy,.093},H}; -N l37n211[]={{spsg,.308},{ssqsg,.272},H}; -N l37n212[]={{sXvm,.121},H}; -N l37n213[]={{sXZm,.325},{stsv,.166},{shipg,.223},H}; -N l37n214[]={{spXwg,.309},H}; -N l37n215[]={{sYm,.122},{swmw,.113},H}; -N l37n217[]={{sgm,.498},{sgpmr,.483},{syrg,.249},{shXh,.111},H}; -N l37n218[]={{sgwi,.524},{smf3,.226},{siwx,.241},{s_X,.091},H}; -N l37n219[]={{sghi,1.794},{shsg,.495},H}; -N l37n220[]={{sXvXg,.423},H}; -N l37n221[]={{sxXg,.190},H}; -N l37n222[]={{siw,.980},H}; -N l37n223[]={{sXg,2.164},{sih,.177},H}; -N l37n224[]={{syi,.577},{siri,.100},H}; -N l37n225[]={{sst,.092},H}; -N l37n226[]={{sgiwx,.291},{sRw,.158},H}; -N l37n227[]={{svig,.294},{smp,.109},{sqswg,.317},H}; -N l37n229[]={{spXg,.642},{srZ,.161},{sZl,.096},H}; -N l37n230[]={{swm,.350},{sgiwg,.460},H}; -N l37n231[]={{stXv,.383},{stvs,.168},H}; -N l37n232[]={{sqi,.318},H}; -N l37n233[]={{sirg,.840},{sg79,.364},H}; -N l37n235[]={{sXp,.457},{sgxi,.246},H}; -N l37n236[]={{sgmrw,.253},{srxv,.100},H}; -N l37n237[]={{shXg,.235},H}; -N l37n238[]={{svg,.857},H}; -N l37n239[]={{sts,.247},{six,.179},{sgmrx,.234},{s_Xvi,.136},H}; -N l37n241[]={{srwx,.119},H}; -N l37n242[]={{sqsg,.255},{sivsg,.223},H}; -N l37n243[]={{sgrs,.266},{sglX,.246},H}; -N l37n244[]={{smf3rg,.675},{smq,.111},H}; -N l37n245[]={{srw,.148},{sgXp,.207},H}; -N l37n246[]={{sZm,.533},{srh,.202},{smrw,.134},H}; -N l37n247[]={{suym,.102},H}; -N l37n248[]={{swxi,.192},{sriw,.177},{sivX,.108},H}; -N l37n252[]={{sXq,.180},H}; -N l37n253[]={{sgtiv,.279},H}; -N l37n254[]={{sqirx,.325},H}; -N l37n255[]={{szi,.184},{smsri,.221},H}; - -D l37_d = -{ +S sf3rg[] = { 243, n, a }; +S smf3r[] = { i, 243, n, 0 }; +S smf3rg[] = { i, 243, n, a }; +S sZmf3r[] = { 99, i, 243, n, 0 }; +S spmry[] = { l, i, n, u, 0 }; +S smry78[] = { i, n, u, x, 0 }; +S sry78[] = { n, u, x, 0 }; +S ssri[] = { o, n, e, 0 }; +S sgpmr[] = { 32, l, i, n, 0 }; +S sry78g[] = { n, u, x, a }; +S spsw[] = { l, o, s, 0 }; +S spswg[] = { l, o, s, a }; +S sriwg[] = { n, e, s, a }; +S sgyw[] = { 32, u, s, 0 }; +S sZsrg[] = { 99, o, n, a }; +S ssriw[] = { o, n, e, s, 0 }; +S smsri[] = { i, o, n, e, 0 }; +S sgpsw[] = { 32, l, o, s, 0 }; +S sqsw[] = { m, o, s, 0 }; +S sqswg[] = { m, o, s, a }; +S syXp[] = { u, 97, l, 0 }; +S sivs[] = { e, r, o, 0 }; +S sZp[] = { 99, l, 0 }; +S sgmrw[] = { 32, i, n, s, 0 }; +S spXZ[] = { l, 97, 99, 0 }; +S stsvg[] = { p, o, r, a }; +S siqs[] = { e, m, o, 0 }; +S sxiqX[] = { t, e, m, 97, 0 }; +S sXvxm[] = { 97, r, t, i, 0 }; +S srwxX[] = { n, s, t, 97, 0 }; +S swmw[] = { s, i, s, 0 }; +S swxXp[] = { s, t, 97, l, 0 }; +S sivsg[] = { e, r, o, a }; +S swmwx[] = { s, i, s, t, 0 }; +S sxXpX[] = { t, 97, l, 97, 0 }; +S sgwmw[] = { 32, s, i, s, 0 }; +S swxiq[] = { s, t, e, m, 0 }; +S svqX[] = { r, m, 97, 0 }; +S sXqi[] = { 97, m, e, 0 }; +S siqXg[] = { e, m, 97, a }; +S smrxi[] = { i, n, t, e, 0 }; +S s_Xvi[] = { w, 97, r, e, 0 }; +S s_Xv[] = { w, 97, r, 0 }; +S sgpsg[] = { 32, l, o, a }; +S sXvms[] = { 97, r, i, o, 0 }; + +N l37n1[] = { { stX, .367 }, { smrx, .140 }, H }; +N l37n2[] = { { swig, .289 }, H }; +N l37n3[] = { { ssv, .449 }, { siqXg, .204 }, H }; +N l37n4[] = { { sqXg, .255 }, { syrXg, .294 }, { ssZ, .088 }, H }; +N l37n5[] = { { smr, .646 }, { sxm, .342 }, { sZmsr, .294 }, { svxm, .125 }, H }; +N l37n6[] = { { srx, .614 }, { sgwm, .481 }, { shmw, .200 }, H }; +N l37n7[] = { { sri, .343 }, { sghm, .391 }, H }; +N l37n8[] = { { sXvig, .204 }, H }; +N l37n9[] = { { slX, .171 }, { sXrx, .143 }, H }; +N l37n10[] = { { stXvX, .304 }, { sYp, .097 }, H }; +N l37n11[] = { { sZsq, .270 }, { svq, .109 }, { skv, .067 }, H }; +N l37n12[] = { { sgp, 1.228 }, { smry, .270 }, H }; +N l37n13[] = { { swg, 2.609 }, { sXr, .380 }, { spm, .372 }, { sgzi, .212 }, H }; +N l37n16[] = { { swxXp, .151 }, H }; +N l37n17[] = { { srsg, .269 }, H }; +N l37n20[] = { { ssw, .684 }, { srwxX, .153 }, H }; +N l37n21[] = { { shm, .282 }, { sgts, .345 }, { ssh, .145 }, H }; +N l37n22[] = { { sms, .365 }, { sZsr, .443 }, { ssri, .247 }, { sXpX, .117 }, H }; +N l37n23[] = { { sry, .253 }, H }; +N l37n24[] = { { srj, .094 }, H }; +N l37n26[] = { { spiwg, .241 }, H }; +N l37n27[] = { { sf3rg, 1.146 }, { srhsg, .279 }, H }; +N l37n29[] = { { sgq, .574 }, { sZg, .102 }, H }; +N l37n31[] = { { ssrg, .374 }, { sghip, .238 }, H }; +N l37n33[] = { { sxig, .674 }, { sxXp, .141 }, { sXvms, .133 }, H }; +N l37n34[] = { { stv, .221 }, H }; +N l37n35[] = { { sy78, .170 }, { srXg, .272 }, H }; +N l37n36[] = { { sym, .132 }, H }; +N l37n37[] = { { ssx, .093 }, H }; +N l37n38[] = { { spmry, .347 }, { smir, .204 }, H }; +N l37n40[] = { { smX, .157 }, { sXhs, .196 }, H }; +N l37n41[] = { { sZp, .089 }, { spig, .158 }, H }; +N l37n42[] = { { sgpsw, .325 }, H }; +N l37n43[] = { { suyig, 1.098 }, { stiv, .196 }, { srxsg, .208 }, H }; +N l37n44[] = { { sxg, .200 }, { sqm, .112 }, H }; +N l37n45[] = { { svs, .348 }, { sivg, .311 }, H }; +N l37n46[] = { { sgr, .391 }, H }; +N l37n47[] = { { sXt, .112 }, H }; +N l37n48[] = { { sgwiv, .272 }, { smrxi, .136 }, H }; +N l37n49[] = { { shig, 1.506 }, { srxX, .130 }, { sgpsg, .204 }, H }; +N l37n51[] = { { swmwx, .148 }, H }; +N l37n52[] = { { spg, .755 }, H }; +N l37n53[] = { { stsvg, .249 }, H }; +N l37n54[] = { { sgtv, .402 }, { svqX, .106 }, H }; +N l37n55[] = { { sgpX, .792 }, H }; +N l37n56[] = { { sgZs, 1.118 }, H }; +N l37n57[] = { { sgip, .679 }, { smY, .107 }, H }; +N l37n58[] = { { sgwig, .264 }, H }; +N l37n59[] = { { sghig, 1.736 }, H }; +N l37n60[] = { { shg, .194 }, H }; +N l37n61[] = { { siqs, .121 }, H }; +N l37n62[] = { { siwg, 1.214 }, { sky, .135 }, H }; +N l37n63[] = { { svX, .558 }, { sgs, .302 }, { sry78, .255 }, { swxiq, .146 }, H }; +N l37n64[] = { { syig, .849 }, { spp, .103 }, { syXp, .140 }, H }; +N l37n65[] = { { sXY, .125 }, H }; +N l37n66[] = { { sXpi, .102 }, H }; +N l37n67[] = { { szm, .108 }, { stXvx, .181 }, H }; +N l37n68[] = { { sxXpX, .146 }, H }; +N l37n69[] = { { sti, .187 }, H }; +N l37n70[] = { { sxmZ, .130 }, H }; +N l37n72[] = { { sgws, .215 }, H }; +N l37n73[] = { { sg79g, .427 }, { smv, .128 }, { sghs, .181 }, H }; +N l37n74[] = { { smZ, .288 }, H }; +N l37n75[] = { { srm, .119 }, { sXpg, .266 }, { syg, .121 }, H }; +N l37n76[] = { { sws, .219 }, H }; +N l37n77[] = { { sXvx, .140 }, H }; +N l37n79[] = { { sgir, .863 }, { sYX, .086 }, H }; +N l37n80[] = { { sgt, 1.223 }, H }; +N l37n81[] = { { sXv, .833 }, { sgX, 1.000 }, H }; +N l37n82[] = { { sXZ, .384 }, { smrwx, .153 }, H }; +N l37n83[] = { { sjm, .116 }, { sgrsg, .223 }, { sXqi, .104 }, H }; +N l37n85[] = { { sty, .099 }, H }; +N l37n86[] = { { smwx, .230 }, H }; +N l37n87[] = { { sgty, .195 }, H }; +N l37n88[] = { { sriwg, .351 }, { sZsqs, .186 }, H }; +N l37n89[] = { { sgxs, .175 }, { sXrh, .115 }, H }; +N l37n90[] = { { smw, .291 }, H }; +N l37n91[] = { { sig, 2.713 }, { smh, .187 }, H }; +N l37n92[] = { { sZs, .682 }, H }; +N l37n93[] = { { srxi, .474 }, { swt, .111 }, H }; +N l37n94[] = { { swX, .148 }, H }; +N l37n95[] = { { sgyr, .504 }, { sgwmw, .219 }, H }; +N l37n96[] = { { sghmw, .362 }, { svv, .101 }, H }; +N l37n97[] = { { sgu, .540 }, { sYpi, .111 }, { shsv, .109 }, H }; +N l37n98[] = { { sXw, .493 }, { sgY, .170 }, H }; +N l37n99[] = { { sXh, .341 }, { ssvg, .382 }, { sxXv, .117 }, H }; +N l37n100[] = { { spsw, .200 }, H }; +N l37n103[] = { { sip, .452 }, { sZmf3, .298 }, H }; +N l37n104[] = { { sguy, .809 }, { srZm, .102 }, H }; +N l37n107[] = { { sxs, .338 }, { smx, .133 }, { sgtsv, .253 }, H }; +N l37n108[] = { { smi, .228 }, { shsw, .168 }, H }; +N l37n109[] = { { sXrg, .187 }, H }; +N l37n110[] = { { sZX, .279 }, H }; +N l37n111[] = { { ssriw, .221 }, H }; +N l37n112[] = { { sxiq, .132 }, H }; +N l37n113[] = { { svw, .074 }, H }; +N l37n114[] = { { srg, 1.579 }, { sgv, .292 }, H }; +N l37n115[] = { { sgZ, 1.185 }, { sps, .307 }, { sXx, .127 }, { ssqs, .140 }, H }; +N l37n116[] = { { sswg, 1.404 }, { suy, .480 }, { smry78, .340 }, { sviw, .162 }, { sgqi, .198 }, H }; +N l37n117[] = { { smZX, .149 }, { ship, .121 }, H }; +N l37n118[] = { { sZsrg, .336 }, { spXw, .155 }, { smsg, .209 }, H }; +N l37n120[] = { { siq, .291 }, H }; +N l37n121[] = { { syr, .316 }, { stvi, .106 }, H }; +N l37n122[] = { { sgZy, .156 }, H }; +N l37n123[] = { { shs, .482 }, { sgtX, .583 }, { sxir, .126 }, H }; +N l37n124[] = { { sXvX, .264 }, H }; +N l37n125[] = { { sxX, .484 }, H }; +N l37n127[] = { { sgZsq, .494 }, H }; +N l37n128[] = { { swZ, .073 }, H }; +N l37n130[] = { { sgZsr, .823 }, { svx, .160 }, { sgyrX, .279 }, H }; +N l37n131[] = { { sgw, 1.130 }, { svi, .587 }, { sy78g, .334 }, { sqsw, .158 }, { sgtvs, .294 }, H }; +N l37n132[] = { { sgh, 1.666 }, H }; +N l37n133[] = { { spX, .618 }, { sirx, .543 }, { smwxi, .164 }, H }; +N l37n134[] = { { sgiw, .821 }, { smhX, .149 }, H }; +N l37n135[] = { { swxv, .121 }, H }; +N l37n136[] = { { swiv, .153 }, { sXvxm, .156 }, { sXhsg, .215 }, { smXg, .150 }, H }; +N l37n137[] = { { sir, 1.038 }, { stm, .070 }, H }; +N l37n138[] = { { sgwy, .252 }, H }; +N l37n140[] = { { svms, .138 }, H }; +N l37n141[] = { { shX, .275 }, { svsg, .308 }, { smz, .089 }, H }; +N l37n142[] = { { smk, .092 }, { sXhX, .102 }, H }; +N l37n143[] = { { sgpm, .439 }, H }; +N l37n144[] = { { sgpXw, .257 }, H }; +N l37n145[] = { { ssg, 2.053 }, H }; +N l37n146[] = { { sqs, .292 }, { sivs, .138 }, { sgXZ, .167 }, H }; +N l37n147[] = { { sgmr, .645 }, { sxiqX, .156 }, H }; +N l37n148[] = { { sgx, .562 }, { smf3r, .338 }, H }; +N l37n149[] = { { sgi, 1.809 }, H }; +N l37n150[] = { { sgyw, .258 }, H }; +N l37n151[] = { { sguyi, 1.030 }, { sgpXg, .751 }, H }; +N l37n153[] = { { sgipg, .789 }, H }; +N l37n156[] = { { syX, .181 }, H }; +N l37n157[] = { { ssp, .080 }, H }; +N l37n158[] = { { sxv, .263 }, { sgZX, .266 }, H }; +N l37n159[] = { { svXg, .467 }, { sry78g, .445 }, H }; +N l37n161[] = { { swx, .447 }, H }; +N l37n162[] = { { swi, .326 }, { sqir, .313 }, H }; +N l37n163[] = { { sqt, .119 }, { siqX, .132 }, H }; +N l37n164[] = { { sqX, .308 }, { syrX, .170 }, H }; +N l37n165[] = { { sgy, .579 }, H }; +N l37n166[] = { { sgj, .270 }, { sXrhs, .148 }, H }; +N l37n167[] = { { sgti, .232 }, { sxiv, .149 }, H }; +N l37n168[] = { { s78g, .266 }, { sXvi, .155 }, H }; +N l37n172[] = { { swsg, .173 }, { siX, .074 }, H }; +N l37n174[] = { { ssq, .226 }, { sXZmf3, .254 }, { siwt, .113 }, H }; +N l37n175[] = { { sgirg, .913 }, H }; +N l37n176[] = { { stg, .136 }, H }; +N l37n177[] = { { srs, .234 }, { sZmf3r, .397 }, { sXvg, .439 }, { sgXg, .419 }, { sZx, .161 }, H }; +N l37n178[] = { { swy, .171 }, { sZi, .156 }, { ssvq, .108 }, { smhXh, .138 }, H }; +N l37n180[] = { { sirxi, .370 }, H }; +N l37n181[] = { { sqY, .067 }, H }; +N l37n182[] = { { sgz, .253 }, H }; +N l37n183[] = { { sgk, .162 }, H }; +N l37n185[] = { { sjs, .089 }, H }; +N l37n186[] = { { spiw, .134 }, H }; +N l37n187[] = { { sf3r, .563 }, { sZms, .266 }, { srhs, .179 }, { szX, .097 }, H }; +N l37n188[] = { { sZsg, .204 }, { stp, .084 }, H }; +N l37n189[] = { { srxig, .551 }, { syv, .089 }, H }; +N l37n190[] = { { syZ, .091 }, H }; +N l37n191[] = { { ssr, .596 }, { sgyrg, .309 }, { svR, .078 }, { sgxX, .158 }, H }; +N l37n192[] = { { s_Xv, .102 }, H }; +N l37n193[] = { { sxi, .696 }, H }; +N l37n194[] = { { sXwg, .824 }, { sZy, .145 }, { shiw, .140 }, H }; +N l37n195[] = { { srX, .267 }, H }; +N l37n196[] = { { spswg, .400 }, { sviZ, .153 }, H }; +N l37n198[] = { { spXZ, .126 }, H }; +N l37n199[] = { { sipg, .784 }, { svm, .273 }, { s79g, .360 }, { spmr, .272 }, H }; +N l37n200[] = { { sgl, .247 }, H }; +N l37n201[] = { { spi, .287 }, { sgvi, .359 }, { sxvX, .189 }, H }; +N l37n202[] = { { siZx, .136 }, H }; +N l37n203[] = { { suyi, .606 }, { sxsg, .331 }, { srxs, .168 }, H }; +N l37n204[] = { { swxX, .249 }, { shswg, .313 }, H }; +N l37n205[] = { { siv, .694 }, { smZm, .140 }, H }; +N l37n206[] = { { siZ, .298 }, { syw, .179 }, H }; +N l37n208[] = { { smsr, .291 }, H }; +N l37n209[] = { { shi, 1.036 }, { sgtXv, .687 }, { sgps, .444 }, { sxy, .093 }, H }; +N l37n211[] = { { spsg, .308 }, { ssqsg, .272 }, H }; +N l37n212[] = { { sXvm, .121 }, H }; +N l37n213[] = { { sXZm, .325 }, { stsv, .166 }, { shipg, .223 }, H }; +N l37n214[] = { { spXwg, .309 }, H }; +N l37n215[] = { { sYm, .122 }, { swmw, .113 }, H }; +N l37n217[] = { { sgm, .498 }, { sgpmr, .483 }, { syrg, .249 }, { shXh, .111 }, H }; +N l37n218[] = { { sgwi, .524 }, { smf3, .226 }, { siwx, .241 }, { s_X, .091 }, H }; +N l37n219[] = { { sghi, 1.794 }, { shsg, .495 }, H }; +N l37n220[] = { { sXvXg, .423 }, H }; +N l37n221[] = { { sxXg, .190 }, H }; +N l37n222[] = { { siw, .980 }, H }; +N l37n223[] = { { sXg, 2.164 }, { sih, .177 }, H }; +N l37n224[] = { { syi, .577 }, { siri, .100 }, H }; +N l37n225[] = { { sst, .092 }, H }; +N l37n226[] = { { sgiwx, .291 }, { sRw, .158 }, H }; +N l37n227[] = { { svig, .294 }, { smp, .109 }, { sqswg, .317 }, H }; +N l37n229[] = { { spXg, .642 }, { srZ, .161 }, { sZl, .096 }, H }; +N l37n230[] = { { swm, .350 }, { sgiwg, .460 }, H }; +N l37n231[] = { { stXv, .383 }, { stvs, .168 }, H }; +N l37n232[] = { { sqi, .318 }, H }; +N l37n233[] = { { sirg, .840 }, { sg79, .364 }, H }; +N l37n235[] = { { sXp, .457 }, { sgxi, .246 }, H }; +N l37n236[] = { { sgmrw, .253 }, { srxv, .100 }, H }; +N l37n237[] = { { shXg, .235 }, H }; +N l37n238[] = { { svg, .857 }, H }; +N l37n239[] = { { sts, .247 }, { six, .179 }, { sgmrx, .234 }, { s_Xvi, .136 }, H }; +N l37n241[] = { { srwx, .119 }, H }; +N l37n242[] = { { sqsg, .255 }, { sivsg, .223 }, H }; +N l37n243[] = { { sgrs, .266 }, { sglX, .246 }, H }; +N l37n244[] = { { smf3rg, .675 }, { smq, .111 }, H }; +N l37n245[] = { { srw, .148 }, { sgXp, .207 }, H }; +N l37n246[] = { { sZm, .533 }, { srh, .202 }, { smrw, .134 }, H }; +N l37n247[] = { { suym, .102 }, H }; +N l37n248[] = { { swxi, .192 }, { sriw, .177 }, { sivX, .108 }, H }; +N l37n252[] = { { sXq, .180 }, H }; +N l37n253[] = { { sgtiv, .279 }, H }; +N l37n254[] = { { sqirx, .325 }, H }; +N l37n255[] = { { szi, .184 }, { smsri, .221 }, H }; + +D l37_d = { "spanish", "iso-8859-15", - { - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,0.000,0.000,0.000,W,0.002,W,W,W,0.000,W,W,W,0.007, - W,W,W,W,W,W,W,W,W,W,W,W,0.001,0.000,0.001,W, - 0.001,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,0.001,W,0.000,W, - W,0.207,0.021,0.097,0.095,0.257,0.018,0.019,0.014,0.135,0.005,0.003,0.100,0.058,0.147,0.166, - 0.060,0.019,0.130,0.154,0.103,0.085,0.020,0.009,0.011,0.014,0.005,W,W,W,0.000,W, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - Y,0.000,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,0.000,Y,Y, - Y,Y,Y,Y,Y,Y,Y,0.001,Y,Y,Y,Y,Y,Y,Y,0.001, - Y,V,V,V,V,V,V,V,V,V,V,V,V,0.000,V,V, - V,V,V,V,V,V,V,V,V,V,V,V,V,V,V,V, - V,0.016,V,V,V,V,V,V,V,0.007,V,V,V,0.011,V,V, - V,0.004,V,0.026,V,V,V,V,V,V,0.007,V,V,V,V,V - }, - { - X,l37n1,l37n2,l37n3,l37n4,l37n5,l37n6,l37n7,l37n8,l37n9,l37n10,l37n11,l37n12,l37n13,X,X, - l37n16,l37n17,X,X,l37n20,l37n21,l37n22,l37n23,l37n24,X,l37n26,l37n27,X,l37n29,X,l37n31, - X,l37n33,l37n34,l37n35,l37n36,l37n37,l37n38,X,l37n40,l37n41,l37n42,l37n43,l37n44,l37n45,l37n46,l37n47, - l37n48,l37n49,X,l37n51,l37n52,l37n53,l37n54,l37n55,l37n56,l37n57,l37n58,l37n59,l37n60,l37n61,l37n62,l37n63, - l37n64,l37n65,l37n66,l37n67,l37n68,l37n69,l37n70,X,l37n72,l37n73,l37n74,l37n75,l37n76,l37n77,X,l37n79, - l37n80,l37n81,l37n82,l37n83,X,l37n85,l37n86,l37n87,l37n88,l37n89,l37n90,l37n91,l37n92,l37n93,l37n94,l37n95, - l37n96,l37n97,l37n98,l37n99,l37n100,X,X,l37n103,l37n104,X,X,l37n107,l37n108,l37n109,l37n110,l37n111, - l37n112,l37n113,l37n114,l37n115,l37n116,l37n117,l37n118,X,l37n120,l37n121,l37n122,l37n123,l37n124,l37n125,X,l37n127, - l37n128,X,l37n130,l37n131,l37n132,l37n133,l37n134,l37n135,l37n136,l37n137,l37n138,X,l37n140,l37n141,l37n142,l37n143, - l37n144,l37n145,l37n146,l37n147,l37n148,l37n149,l37n150,l37n151,X,l37n153,X,X,l37n156,l37n157,l37n158,l37n159, - X,l37n161,l37n162,l37n163,l37n164,l37n165,l37n166,l37n167,l37n168,X,X,X,l37n172,X,l37n174,l37n175, - l37n176,l37n177,l37n178,X,l37n180,l37n181,l37n182,l37n183,X,l37n185,l37n186,l37n187,l37n188,l37n189,l37n190,l37n191, - l37n192,l37n193,l37n194,l37n195,l37n196,X,l37n198,l37n199,l37n200,l37n201,l37n202,l37n203,l37n204,l37n205,l37n206,X, - l37n208,l37n209,X,l37n211,l37n212,l37n213,l37n214,l37n215,X,l37n217,l37n218,l37n219,l37n220,l37n221,l37n222,l37n223, - l37n224,l37n225,l37n226,l37n227,X,l37n229,l37n230,l37n231,l37n232,l37n233,X,l37n235,l37n236,l37n237,l37n238,l37n239, - X,l37n241,l37n242,l37n243,l37n244,l37n245,l37n246,l37n247,l37n248,X,X,X,l37n252,l37n253,l37n254,l37n255 - } + { W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, 0.000, 0.000, 0.000, W, 0.002, W, W, W, 0.000, W, W, W, 0.007, + W, W, W, W, W, W, W, W, W, W, W, W, 0.001, 0.000, 0.001, W, + 0.001, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, 0.001, W, 0.000, W, + W, 0.207, 0.021, 0.097, 0.095, 0.257, 0.018, 0.019, 0.014, 0.135, 0.005, 0.003, 0.100, 0.058, 0.147, 0.166, + 0.060, 0.019, 0.130, 0.154, 0.103, 0.085, 0.020, 0.009, 0.011, 0.014, 0.005, W, W, W, 0.000, W, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + Y, 0.000, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, 0.000, Y, Y, + Y, Y, Y, Y, Y, Y, Y, 0.001, Y, Y, Y, Y, Y, Y, Y, 0.001, + Y, V, V, V, V, V, V, V, V, V, V, V, V, 0.000, V, V, + V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, V, + V, 0.016, V, V, V, V, V, V, V, 0.007, V, V, V, 0.011, V, V, + V, 0.004, V, 0.026, V, V, V, V, V, V, 0.007, V, V, V, V, V }, + { X, l37n1, l37n2, l37n3, l37n4, l37n5, l37n6, l37n7, l37n8, l37n9, l37n10, l37n11, l37n12, l37n13, X, X, + l37n16, l37n17, X, X, l37n20, l37n21, l37n22, l37n23, l37n24, X, l37n26, l37n27, X, l37n29, X, l37n31, + X, l37n33, l37n34, l37n35, l37n36, l37n37, l37n38, X, l37n40, l37n41, l37n42, l37n43, l37n44, l37n45, l37n46, l37n47, + l37n48, l37n49, X, l37n51, l37n52, l37n53, l37n54, l37n55, l37n56, l37n57, l37n58, l37n59, l37n60, l37n61, l37n62, l37n63, + l37n64, l37n65, l37n66, l37n67, l37n68, l37n69, l37n70, X, l37n72, l37n73, l37n74, l37n75, l37n76, l37n77, X, l37n79, + l37n80, l37n81, l37n82, l37n83, X, l37n85, l37n86, l37n87, l37n88, l37n89, l37n90, l37n91, l37n92, l37n93, l37n94, l37n95, + l37n96, l37n97, l37n98, l37n99, l37n100, X, X, l37n103, l37n104, X, X, l37n107, l37n108, l37n109, l37n110, l37n111, + l37n112, l37n113, l37n114, l37n115, l37n116, l37n117, l37n118, X, l37n120, l37n121, l37n122, l37n123, l37n124, l37n125, X, l37n127, + l37n128, X, l37n130, l37n131, l37n132, l37n133, l37n134, l37n135, l37n136, l37n137, l37n138, X, l37n140, l37n141, l37n142, l37n143, + l37n144, l37n145, l37n146, l37n147, l37n148, l37n149, l37n150, l37n151, X, l37n153, X, X, l37n156, l37n157, l37n158, l37n159, + X, l37n161, l37n162, l37n163, l37n164, l37n165, l37n166, l37n167, l37n168, X, X, X, l37n172, X, l37n174, l37n175, + l37n176, l37n177, l37n178, X, l37n180, l37n181, l37n182, l37n183, X, l37n185, l37n186, l37n187, l37n188, l37n189, l37n190, l37n191, + l37n192, l37n193, l37n194, l37n195, l37n196, X, l37n198, l37n199, l37n200, l37n201, l37n202, l37n203, l37n204, l37n205, l37n206, X, + l37n208, l37n209, X, l37n211, l37n212, l37n213, l37n214, l37n215, X, l37n217, l37n218, l37n219, l37n220, l37n221, l37n222, l37n223, + l37n224, l37n225, l37n226, l37n227, X, l37n229, l37n230, l37n231, l37n232, l37n233, X, l37n235, l37n236, l37n237, l37n238, l37n239, + X, l37n241, l37n242, l37n243, l37n244, l37n245, l37n246, l37n247, l37n248, X, X, X, l37n252, l37n253, l37n254, l37n255 } }; - - // // Lng: swedish // Enc: iso-8859-15 // - -S sXxxg[]={97,t,t,a}; -S sjf6[]={f,246,0}; -S sgXxx[]={32,97,t,t,0}; -S sgjf6[]={32,f,246,0}; -S sjf6v[]={f,246,r,0}; -S sgjf6v[]={32,f,246,r,0}; -S sf6vg[]={246,r,a}; -S shmwo[]={d,i,s,k,0}; -S sppiv[]={l,l,e,r,0}; -S sgsZ[]={32,o,99,0}; -S sUvg[]={228,r,a}; -S sgsZl[]={32,o,99,h,0}; -S ssZlg[]={o,99,h,a}; -S sjf6vg[]={f,246,r,a}; -S sxmx[]={t,i,t,0}; -S smxms[]={i,t,i,o,0}; -S sxmxm[]={t,i,t,i,0}; -S svxmx[]={r,t,i,t,0}; -S sgUvg[]={32,228,r,a}; -S sgUv[]={32,228,r,0}; -S sUrh[]={228,n,d,0}; -S slV[]={h,229,0}; -S spivg[]={l,e,r,a}; -S swog[]={s,k,a}; -S sxmpp[]={t,i,l,l,0}; -S ssriv[]={o,n,e,r,0}; -S sxXpp[]={t,97,l,l,0}; -S sw79w[]={s,y,s,0}; -S sw79wx[]={s,y,s,t,0}; -S s79wxi[]={y,s,t,e,0}; -S smwog[]={i,s,k,a}; -S sgwoX[]={32,s,k,97,0}; -S sg2f[]={32,47,0}; -S swxXv[]={s,t,97,r,0}; -S szUr[]={v,228,n,0}; -S sxXvx[]={t,97,r,t,0}; -S sglV[]={32,h,229,0}; -S szUrh[]={v,228,n,d,0}; -S sglVv[]={32,h,229,r,0}; -S slVv[]={h,229,r,0}; -S sVvh[]={229,r,d,0}; -S slVvh[]={h,229,r,d,0}; -S sXrzU[]={97,n,v,228,0}; -S srzUr[]={n,v,228,n,0}; -S srzU[]={n,v,228,0}; -S sXrz[]={97,n,v,0}; -S sgXrz[]={32,97,n,v,0}; -S smwoi[]={i,s,k,e,0}; -S sgw79w[]={32,s,y,s,0}; -S sxiqg[]={t,e,m,a}; -S sVr[]={229,n,0}; -S ssqq[]={o,m,m,0}; -S sgipp[]={32,e,l,l,0}; -S svrX[]={r,n,97,0}; -S sivmr[]={e,r,i,n,0}; -S sosqq[]={k,o,m,m,0}; -S sgosq[]={32,k,o,m,0}; -S shhm[]={d,d,i,0}; -S svhh[]={r,d,d,0}; -S shhmw[]={d,d,i,s,0}; -S soixx[]={k,e,t,t,0}; -S sVvhh[]={229,r,d,d,0}; -S swoix[]={s,k,e,t,0}; -S svhhm[]={r,d,d,i,0}; -S svV[]={r,229,0}; - -N l38n1[]={{stX,.321},{sxmx,.289},{smrx,.146},H}; -N l38n2[]={{soixx,.166},H}; -N l38n3[]={{ssv,.206},{sosq,.143},{svV,.082},H}; -N l38n4[]={{ssZ,.277},{sgU,.330},H}; -N l38n5[]={{smr,1.061},{sxm,.738},{svxm,.281},H}; -N l38n6[]={{shmw,.402},{srx,.212},H}; -N l38n7[]={{sghm,.714},{sri,.269},{sxivg,.263},{sgosq,.256},H}; -N l38n8[]={{swo,.535},H}; -N l38n9[]={{slX,.117},{sVr,.224},H}; -N l38n11[]={{sgXr,.456},{sipp,.207},{skv,.094},H}; -N l38n12[]={{sgp,.642},{smry,.356},H}; -N l38n13[]={{swg,.864},{sXr,.568},{spm,.440},H}; -N l38n14[]={{ssqg,.778},H}; -N l38n15[]={{spivg,.407},{sgw79w,.312},H}; -N l38n16[]={{swxXp,.260},H}; -N l38n18[]={{sik,.080},H}; -N l38n20[]={{sxmsr,.598},{ssw,.149},{srwxX,.260},H}; -N l38n21[]={{shm,.500},{sog,.287},H}; -N l38n22[]={{sms,.335},{ssri,.254},H}; -N l38n23[]={{sry,.271},{sgxm,.357},{sxxi,.126},H}; -N l38n24[]={{sZo,.106},H}; -N l38n28[]={{sgwo,.399},{svr,.111},H}; -N l38n29[]={{sgq,.783},H}; -N l38n31[]={{ssrg,.337},{sXrz,.171},H}; -N l38n32[]={{sxxg,1.079},{soXr,.177},H}; -N l38n33[]={{sxig,.377},{sxXp,.251},{srhX,.131},H}; -N l38n34[]={{swV,.177},{swxXv,.243},{stv,.118},{smwoi,.219},H}; -N l38n35[]={{sy78,.235},{srXg,.342},H}; -N l38n37[]={{stVg,.394},{ssx,.132},{sghir,.332},H}; -N l38n38[]={{spmry,.475},{sgoX,.315},H}; -N l38n39[]={{sgtV,.392},H}; -N l38n40[]={{szUr,.179},{srz,.117},H}; -N l38n41[]={{srk,.279},{sgjm,.234},H}; -N l38n44[]={{sxg,2.021},{sqm,.085},H}; -N l38n45[]={{sivg,1.423},{svs,.197},{shixg,.542},H}; -N l38n46[]={{sUv,.655},{ski,.187},{sgr,.266},{sqivg,.250},H}; -N l38n47[]={{sXt,.123},{shmrg,.230},H}; -N l38n48[]={{smsrg,.374},{smrxi,.184},H}; -N l38n49[]={{shig,.399},H}; -N l38n51[]={{swoX,.259},H}; -N l38n52[]={{spg,.323},{sqih,.130},H}; -N l38n54[]={{sUrh,.491},{sgtv,.236},H}; -N l38n55[]={{sghix,.713},{sgvs,.175},H}; -N l38n56[]={{sgjf6,.653},H}; -N l38n57[]={{sgzm,.360},{sgip,.209},{sgmg,.207},H}; -N l38n58[]={{sippi,.206},H}; -N l38n59[]={{smxms,.381},H}; -N l38n60[]={{shg,.361},{sxmxm,.374},H}; -N l38n62[]={{srzUr,.228},H}; -N l38n63[]={{svX,.664},{sgs,.826},{sry78,.350},{swxiq,.260},{sgwoX,.384},{sihg,.209},H}; -N l38n64[]={{spp,.616},H}; -N l38n65[]={{shyg,.756},H}; -N l38n67[]={{stXvx,.372},{szm,.177},{sw79wx,.260},{shhm,.125},H}; -N l38n69[]={{sZlg,.502},{sti,.100},H}; -N l38n70[]={{s79wx,.195},H}; -N l38n71[]={{shmwo,.490},{svrX,.138},H}; -N l38n72[]={{sgws,.308},H}; -N l38n73[]={{sghs,.244},H}; -N l38n74[]={{sgUvg,.479},{s79w,.137},{sosqq,.171},{skXg,.190},H}; -N l38n75[]={{syg,.563},{srm,.125},{sixxg,.325},H}; -N l38n76[]={{sws,.153},H}; -N l38n77[]={{sXvx,.468},{sgXx,.680},{sVv,.315},{srhi,.209},{srivg,.338},{sli,.092},H}; -N l38n78[]={{sgsqg,.512},H}; -N l38n79[]={{sixg,.815},{sgir,.640},H}; -N l38n80[]={{sgt,.829},{sivm,.144},H}; -N l38n81[]={{sXv,.847},{sgX,1.090},{sghmr,.282},H}; -N l38n82[]={{smrwx,.293},H}; -N l38n83[]={{sqg,.845},{sjm,.172},{smwog,.387},H}; -N l38n84[]={{sos,.174},{szUrh,.232},H}; -N l38n85[]={{srwg,.177},H}; -N l38n88[]={{sivXg,.407},{ss_,.083},H}; -N l38n89[]={{sXrh,.192},H}; -N l38n90[]={{smw,.381},{sgwV,.347},H}; -N l38n91[]={{sig,.972},{sgxmp,.397},{swsqg,.397},H}; -N l38n92[]={{sf6v,.901},H}; -N l38n93[]={{srxi,.177},{ssqq,.143},H}; -N l38n94[]={{swX,.109},H}; -N l38n95[]={{swoi,.189},H}; -N l38n96[]={{sghmw,.374},H}; -N l38n97[]={{svxmx,.374},H}; -N l38n98[]={{sgY,.389},{sXw,.121},H}; -N l38n99[]={{sxXv,.225},{sXh,.120},{sgXz,.249},H}; -N l38n101[]={{sxXpp,.260},{smrg,.261},H}; -N l38n102[]={{soX,.377},H}; -N l38n103[]={{sip,.236},H}; -N l38n104[]={{swog,.303},H}; -N l38n106[]={{szg,.246},H}; -N l38n107[]={{smx,.317},{sxs,.144},H}; -N l38n108[]={{ssriv,.263},{shsw,.131},H}; -N l38n109[]={{sXrg,.419},{sgXrz,.328},H}; -N l38n110[]={{szU,.158},H}; -N l38n111[]={{sXxx,.471},H}; -N l38n112[]={{sqq,.150},{sxiq,.197},{sgoXr,.348},H}; -N l38n113[]={{svw,.125},H}; -N l38n114[]={{srg,1.839},{smrk,.274},{sgv,.254},{svh,.136},H}; -N l38n115[]={{sXx,.531},{sps,.115},{sgZ,.169},H}; -N l38n116[]={{smry78,.466},{sgqi,.433},{sswg,.224},H}; -N l38n117[]={{s79wxi,.260},H}; -N l38n120[]={{siq,.197},H}; -N l38n121[]={{syr,.164},H}; -N l38n122[]={{spmk,.133},H}; -N l38n123[]={{sgtX,.478},{shs,.151},H}; -N l38n124[]={{ssZl,.332},{sXvX,.161},H}; -N l38n125[]={{sxX,.646},{sgzmp,.279},{sgipp,.279},H}; -N l38n127[]={{sgwx,.507},H}; -N l38n128[]={{sgsZ,.534},{soXrg,.299},H}; -N l38n129[]={{svmr,.156},H}; -N l38n130[]={{svx,.382},{swVg,.369},H}; -N l38n131[]={{sgw,1.737},{svi,.255},{sy78g,.495},H}; -N l38n132[]={{sgh,1.983},H}; -N l38n133[]={{spX,.183},{ssxg,.251},H}; -N l38n135[]={{sgtVg,.522},{smpp,.251},H}; -N l38n136[]={{sXvxm,.374},H}; -N l38n137[]={{sir,.885},{srkg,.185},H}; -N l38n139[]={{sghy,.773},{shir,.205},H}; -N l38n140[]={{sgjv,.192},H}; -N l38n141[]={{shX,.224},{smz,.103},H}; -N l38n142[]={{sgjf6v,.837},{smk,.240},{sUvg,1.186},H}; -N l38n143[]={{sgpm,.623},{sXpp,.294},{sgwsq,.391},H}; -N l38n144[]={{sww,.088},H}; -N l38n145[]={{ssg,.143},{sgix,.187},H}; -N l38n147[]={{sgmr,.746},{sYi,.105},H}; -N l38n148[]={{sgx,.509},{sqihg,.246},H}; -N l38n149[]={{sgi,.905},{sXz,.128},H}; -N l38n150[]={{sjf6v,.435},H}; -N l38n151[]={{sppi,.433},H}; -N l38n153[]={{skg,.378},{sVvh,.388},H}; -N l38n154[]={{sivmr,.182},H}; -N l38n156[]={{shhmw,.166},H}; -N l38n158[]={{sxv,.129},H}; -N l38n159[]={{svXg,.810},{sry78g,.657},{sglV,.266},H}; -N l38n160[]={{srr,.159},{sppg,.323},{sgqih,.259},H}; -N l38n161[]={{swx,.753},{szXv,.154},H}; -N l38n162[]={{swi,.135},{sgwxX,.397},{sqir,.130},H}; -N l38n164[]={{sqX,.160},H}; -N l38n165[]={{sgy,.282},H}; -N l38n166[]={{sgj,1.054},{soix,.199},H}; -N l38n167[]={{sxiv,.243},H}; -N l38n168[]={{s78g,.414},{sXvi,.117},H}; -N l38n169[]={{sgXxx,.896},{sxmp,.204},{sox,.084},H}; -N l38n170[]={{soi,.252},H}; -N l38n174[]={{ssq,.503},{shv,.103},H}; -N l38n175[]={{spiv,.433},{sgirg,.690},H}; -N l38n176[]={{sjf6,.301},{stg,.227},H}; -N l38n177[]={{sXvg,.566},H}; -N l38n179[]={{slVv,.172},H}; -N l38n182[]={{sgz,.468},{sgw79,.246},{svmrk,.197},H}; -N l38n183[]={{sgk,.233},{shiv,.151},H}; -N l38n184[]={{slg,.341},{sgsZl,.663},H}; -N l38n186[]={{sgwVg,.424},H}; -N l38n187[]={{szX,.175},{swoix,.166},H}; -N l38n188[]={{sf6vg,1.274},H}; -N l38n189[]={{srxig,.250},H}; -N l38n190[]={{sXppi,.241},{svhh,.125},H}; -N l38n191[]={{ssr,.425},{sxXvx,.236},{smrr,.149},H}; -N l38n192[]={{sxx,.681},{sgos,.328},{shh,.116},H}; -N l38n193[]={{sxi,.614},H}; -N l38n195[]={{srX,.276},{sgXzg,.289},H}; -N l38n197[]={{stV,.175},{sVvhh,.374},H}; -N l38n198[]={{soXg,.231},H}; -N l38n199[]={{spmr,.391},{svm,.220},{sqqi,.154},H}; -N l38n200[]={{sgl,.678},{sUp,.217},H}; -N l38n201[]={{spi,.426},H}; -N l38n202[]={{sxms,.450},H}; -N l38n203[]={{sXrzU,.228},H}; -N l38n204[]={{swxX,.501},{shswg,.240},H}; -N l38n205[]={{siv,1.197},{shix,.363},{slV,.142},H}; -N l38n206[]={{sqiv,.131},H}; -N l38n207[]={{sXxxg,.910},{shmr,.141},H}; -N l38n208[]={{smsr,.483},{sxiqg,.309},H}; -N l38n209[]={{shi,.801},{sgtXv,.594},H}; -N l38n215[]={{smg,.268},H}; -N l38n216[]={{siqg,.337},H}; -N l38n217[]={{sgm,.755},{sgpmr,.670},H}; -N l38n218[]={{sgwi,.182},H}; -N l38n219[]={{sghi,1.108},{sVg,1.319},H}; -N l38n220[]={{ssZlg,.663},{srhv,.121},H}; -N l38n221[]={{sxXg,.478},H}; -N l38n222[]={{siw,.149},H}; -N l38n223[]={{sXg,2.041},{sih,.179},{slVvh,.230},{syx,.113},H}; -N l38n225[]={{shy,.373},H}; -N l38n226[]={{svxg,.219},H}; -N l38n227[]={{smp,.335},{svig,.224},H}; -N l38n229[]={{sZl,.225},{sziv,.176},H}; -N l38n230[]={{swm,.148},H}; -N l38n231[]={{stXv,.341},{sw79w,.195},{smppg,.335},{szmp,.140},{stvs,.120},H}; -N l38n232[]={{sqi,.403},{skir,.140},H}; -N l38n233[]={{sirg,1.507},H}; -N l38n234[]={{sUr,.510},{sgUv,.360},{skX,.153},H}; -N l38n235[]={{sghyg,1.008},{sXp,.288},{sixx,.322},{shirg,.345},H}; -N l38n236[]={{sgmrw,.414},{sjv,.097},H}; -N l38n237[]={{sppiv,.488},{sriv,.231},{sxmpp,.267},{shXg,.288},{sgixx,.240},H}; -N l38n238[]={{svg,2.233},{smxm,.292},{sgsq,.396},{smkg,.192},H}; -N l38n239[]={{six,.682},{sgmrx,.279},H}; -N l38n241[]={{srwx,.227},H}; -N l38n243[]={{smwo,.430},{sglX,.236},H}; -N l38n244[]={{srzU,.171},H}; -N l38n245[]={{srw,.306},{sglVv,.345},{sXzg,.241},H}; -N l38n246[]={{srh,.425},{sjf6vg,.640},{smrw,.223},{sw79,.136},{sXxm,.177},H}; -N l38n247[]={{sls,.089},H}; -N l38n248[]={{sivX,.389},{swxi,.322},H}; -N l38n249[]={{svhhm,.166},H}; -N l38n251[]={{sgo,.639},{swsq,.199},H}; -N l38n252[]={{sXq,.109},H}; -N l38n255[]={{szi,.173},{smsri,.333},{sg2f,.182},H}; - -D l38_d = -{ +S sXxxg[] = { 97, t, t, a }; +S sjf6[] = { f, 246, 0 }; +S sgXxx[] = { 32, 97, t, t, 0 }; +S sgjf6[] = { 32, f, 246, 0 }; +S sjf6v[] = { f, 246, r, 0 }; +S sgjf6v[] = { 32, f, 246, r, 0 }; +S sf6vg[] = { 246, r, a }; +S shmwo[] = { d, i, s, k, 0 }; +S sppiv[] = { l, l, e, r, 0 }; +S sgsZ[] = { 32, o, 99, 0 }; +S sUvg[] = { 228, r, a }; +S sgsZl[] = { 32, o, 99, h, 0 }; +S ssZlg[] = { o, 99, h, a }; +S sjf6vg[] = { f, 246, r, a }; +S sxmx[] = { t, i, t, 0 }; +S smxms[] = { i, t, i, o, 0 }; +S sxmxm[] = { t, i, t, i, 0 }; +S svxmx[] = { r, t, i, t, 0 }; +S sgUvg[] = { 32, 228, r, a }; +S sgUv[] = { 32, 228, r, 0 }; +S sUrh[] = { 228, n, d, 0 }; +S slV[] = { h, 229, 0 }; +S spivg[] = { l, e, r, a }; +S swog[] = { s, k, a }; +S sxmpp[] = { t, i, l, l, 0 }; +S ssriv[] = { o, n, e, r, 0 }; +S sxXpp[] = { t, 97, l, l, 0 }; +S sw79w[] = { s, y, s, 0 }; +S sw79wx[] = { s, y, s, t, 0 }; +S s79wxi[] = { y, s, t, e, 0 }; +S smwog[] = { i, s, k, a }; +S sgwoX[] = { 32, s, k, 97, 0 }; +S sg2f[] = { 32, 47, 0 }; +S swxXv[] = { s, t, 97, r, 0 }; +S szUr[] = { v, 228, n, 0 }; +S sxXvx[] = { t, 97, r, t, 0 }; +S sglV[] = { 32, h, 229, 0 }; +S szUrh[] = { v, 228, n, d, 0 }; +S sglVv[] = { 32, h, 229, r, 0 }; +S slVv[] = { h, 229, r, 0 }; +S sVvh[] = { 229, r, d, 0 }; +S slVvh[] = { h, 229, r, d, 0 }; +S sXrzU[] = { 97, n, v, 228, 0 }; +S srzUr[] = { n, v, 228, n, 0 }; +S srzU[] = { n, v, 228, 0 }; +S sXrz[] = { 97, n, v, 0 }; +S sgXrz[] = { 32, 97, n, v, 0 }; +S smwoi[] = { i, s, k, e, 0 }; +S sgw79w[] = { 32, s, y, s, 0 }; +S sxiqg[] = { t, e, m, a }; +S sVr[] = { 229, n, 0 }; +S ssqq[] = { o, m, m, 0 }; +S sgipp[] = { 32, e, l, l, 0 }; +S svrX[] = { r, n, 97, 0 }; +S sivmr[] = { e, r, i, n, 0 }; +S sosqq[] = { k, o, m, m, 0 }; +S sgosq[] = { 32, k, o, m, 0 }; +S shhm[] = { d, d, i, 0 }; +S svhh[] = { r, d, d, 0 }; +S shhmw[] = { d, d, i, s, 0 }; +S soixx[] = { k, e, t, t, 0 }; +S sVvhh[] = { 229, r, d, d, 0 }; +S swoix[] = { s, k, e, t, 0 }; +S svhhm[] = { r, d, d, i, 0 }; +S svV[] = { r, 229, 0 }; + +N l38n1[] = { { stX, .321 }, { sxmx, .289 }, { smrx, .146 }, H }; +N l38n2[] = { { soixx, .166 }, H }; +N l38n3[] = { { ssv, .206 }, { sosq, .143 }, { svV, .082 }, H }; +N l38n4[] = { { ssZ, .277 }, { sgU, .330 }, H }; +N l38n5[] = { { smr, 1.061 }, { sxm, .738 }, { svxm, .281 }, H }; +N l38n6[] = { { shmw, .402 }, { srx, .212 }, H }; +N l38n7[] = { { sghm, .714 }, { sri, .269 }, { sxivg, .263 }, { sgosq, .256 }, H }; +N l38n8[] = { { swo, .535 }, H }; +N l38n9[] = { { slX, .117 }, { sVr, .224 }, H }; +N l38n11[] = { { sgXr, .456 }, { sipp, .207 }, { skv, .094 }, H }; +N l38n12[] = { { sgp, .642 }, { smry, .356 }, H }; +N l38n13[] = { { swg, .864 }, { sXr, .568 }, { spm, .440 }, H }; +N l38n14[] = { { ssqg, .778 }, H }; +N l38n15[] = { { spivg, .407 }, { sgw79w, .312 }, H }; +N l38n16[] = { { swxXp, .260 }, H }; +N l38n18[] = { { sik, .080 }, H }; +N l38n20[] = { { sxmsr, .598 }, { ssw, .149 }, { srwxX, .260 }, H }; +N l38n21[] = { { shm, .500 }, { sog, .287 }, H }; +N l38n22[] = { { sms, .335 }, { ssri, .254 }, H }; +N l38n23[] = { { sry, .271 }, { sgxm, .357 }, { sxxi, .126 }, H }; +N l38n24[] = { { sZo, .106 }, H }; +N l38n28[] = { { sgwo, .399 }, { svr, .111 }, H }; +N l38n29[] = { { sgq, .783 }, H }; +N l38n31[] = { { ssrg, .337 }, { sXrz, .171 }, H }; +N l38n32[] = { { sxxg, 1.079 }, { soXr, .177 }, H }; +N l38n33[] = { { sxig, .377 }, { sxXp, .251 }, { srhX, .131 }, H }; +N l38n34[] = { { swV, .177 }, { swxXv, .243 }, { stv, .118 }, { smwoi, .219 }, H }; +N l38n35[] = { { sy78, .235 }, { srXg, .342 }, H }; +N l38n37[] = { { stVg, .394 }, { ssx, .132 }, { sghir, .332 }, H }; +N l38n38[] = { { spmry, .475 }, { sgoX, .315 }, H }; +N l38n39[] = { { sgtV, .392 }, H }; +N l38n40[] = { { szUr, .179 }, { srz, .117 }, H }; +N l38n41[] = { { srk, .279 }, { sgjm, .234 }, H }; +N l38n44[] = { { sxg, 2.021 }, { sqm, .085 }, H }; +N l38n45[] = { { sivg, 1.423 }, { svs, .197 }, { shixg, .542 }, H }; +N l38n46[] = { { sUv, .655 }, { ski, .187 }, { sgr, .266 }, { sqivg, .250 }, H }; +N l38n47[] = { { sXt, .123 }, { shmrg, .230 }, H }; +N l38n48[] = { { smsrg, .374 }, { smrxi, .184 }, H }; +N l38n49[] = { { shig, .399 }, H }; +N l38n51[] = { { swoX, .259 }, H }; +N l38n52[] = { { spg, .323 }, { sqih, .130 }, H }; +N l38n54[] = { { sUrh, .491 }, { sgtv, .236 }, H }; +N l38n55[] = { { sghix, .713 }, { sgvs, .175 }, H }; +N l38n56[] = { { sgjf6, .653 }, H }; +N l38n57[] = { { sgzm, .360 }, { sgip, .209 }, { sgmg, .207 }, H }; +N l38n58[] = { { sippi, .206 }, H }; +N l38n59[] = { { smxms, .381 }, H }; +N l38n60[] = { { shg, .361 }, { sxmxm, .374 }, H }; +N l38n62[] = { { srzUr, .228 }, H }; +N l38n63[] = { { svX, .664 }, { sgs, .826 }, { sry78, .350 }, { swxiq, .260 }, { sgwoX, .384 }, { sihg, .209 }, H }; +N l38n64[] = { { spp, .616 }, H }; +N l38n65[] = { { shyg, .756 }, H }; +N l38n67[] = { { stXvx, .372 }, { szm, .177 }, { sw79wx, .260 }, { shhm, .125 }, H }; +N l38n69[] = { { sZlg, .502 }, { sti, .100 }, H }; +N l38n70[] = { { s79wx, .195 }, H }; +N l38n71[] = { { shmwo, .490 }, { svrX, .138 }, H }; +N l38n72[] = { { sgws, .308 }, H }; +N l38n73[] = { { sghs, .244 }, H }; +N l38n74[] = { { sgUvg, .479 }, { s79w, .137 }, { sosqq, .171 }, { skXg, .190 }, H }; +N l38n75[] = { { syg, .563 }, { srm, .125 }, { sixxg, .325 }, H }; +N l38n76[] = { { sws, .153 }, H }; +N l38n77[] = { { sXvx, .468 }, { sgXx, .680 }, { sVv, .315 }, { srhi, .209 }, { srivg, .338 }, { sli, .092 }, H }; +N l38n78[] = { { sgsqg, .512 }, H }; +N l38n79[] = { { sixg, .815 }, { sgir, .640 }, H }; +N l38n80[] = { { sgt, .829 }, { sivm, .144 }, H }; +N l38n81[] = { { sXv, .847 }, { sgX, 1.090 }, { sghmr, .282 }, H }; +N l38n82[] = { { smrwx, .293 }, H }; +N l38n83[] = { { sqg, .845 }, { sjm, .172 }, { smwog, .387 }, H }; +N l38n84[] = { { sos, .174 }, { szUrh, .232 }, H }; +N l38n85[] = { { srwg, .177 }, H }; +N l38n88[] = { { sivXg, .407 }, { ss_, .083 }, H }; +N l38n89[] = { { sXrh, .192 }, H }; +N l38n90[] = { { smw, .381 }, { sgwV, .347 }, H }; +N l38n91[] = { { sig, .972 }, { sgxmp, .397 }, { swsqg, .397 }, H }; +N l38n92[] = { { sf6v, .901 }, H }; +N l38n93[] = { { srxi, .177 }, { ssqq, .143 }, H }; +N l38n94[] = { { swX, .109 }, H }; +N l38n95[] = { { swoi, .189 }, H }; +N l38n96[] = { { sghmw, .374 }, H }; +N l38n97[] = { { svxmx, .374 }, H }; +N l38n98[] = { { sgY, .389 }, { sXw, .121 }, H }; +N l38n99[] = { { sxXv, .225 }, { sXh, .120 }, { sgXz, .249 }, H }; +N l38n101[] = { { sxXpp, .260 }, { smrg, .261 }, H }; +N l38n102[] = { { soX, .377 }, H }; +N l38n103[] = { { sip, .236 }, H }; +N l38n104[] = { { swog, .303 }, H }; +N l38n106[] = { { szg, .246 }, H }; +N l38n107[] = { { smx, .317 }, { sxs, .144 }, H }; +N l38n108[] = { { ssriv, .263 }, { shsw, .131 }, H }; +N l38n109[] = { { sXrg, .419 }, { sgXrz, .328 }, H }; +N l38n110[] = { { szU, .158 }, H }; +N l38n111[] = { { sXxx, .471 }, H }; +N l38n112[] = { { sqq, .150 }, { sxiq, .197 }, { sgoXr, .348 }, H }; +N l38n113[] = { { svw, .125 }, H }; +N l38n114[] = { { srg, 1.839 }, { smrk, .274 }, { sgv, .254 }, { svh, .136 }, H }; +N l38n115[] = { { sXx, .531 }, { sps, .115 }, { sgZ, .169 }, H }; +N l38n116[] = { { smry78, .466 }, { sgqi, .433 }, { sswg, .224 }, H }; +N l38n117[] = { { s79wxi, .260 }, H }; +N l38n120[] = { { siq, .197 }, H }; +N l38n121[] = { { syr, .164 }, H }; +N l38n122[] = { { spmk, .133 }, H }; +N l38n123[] = { { sgtX, .478 }, { shs, .151 }, H }; +N l38n124[] = { { ssZl, .332 }, { sXvX, .161 }, H }; +N l38n125[] = { { sxX, .646 }, { sgzmp, .279 }, { sgipp, .279 }, H }; +N l38n127[] = { { sgwx, .507 }, H }; +N l38n128[] = { { sgsZ, .534 }, { soXrg, .299 }, H }; +N l38n129[] = { { svmr, .156 }, H }; +N l38n130[] = { { svx, .382 }, { swVg, .369 }, H }; +N l38n131[] = { { sgw, 1.737 }, { svi, .255 }, { sy78g, .495 }, H }; +N l38n132[] = { { sgh, 1.983 }, H }; +N l38n133[] = { { spX, .183 }, { ssxg, .251 }, H }; +N l38n135[] = { { sgtVg, .522 }, { smpp, .251 }, H }; +N l38n136[] = { { sXvxm, .374 }, H }; +N l38n137[] = { { sir, .885 }, { srkg, .185 }, H }; +N l38n139[] = { { sghy, .773 }, { shir, .205 }, H }; +N l38n140[] = { { sgjv, .192 }, H }; +N l38n141[] = { { shX, .224 }, { smz, .103 }, H }; +N l38n142[] = { { sgjf6v, .837 }, { smk, .240 }, { sUvg, 1.186 }, H }; +N l38n143[] = { { sgpm, .623 }, { sXpp, .294 }, { sgwsq, .391 }, H }; +N l38n144[] = { { sww, .088 }, H }; +N l38n145[] = { { ssg, .143 }, { sgix, .187 }, H }; +N l38n147[] = { { sgmr, .746 }, { sYi, .105 }, H }; +N l38n148[] = { { sgx, .509 }, { sqihg, .246 }, H }; +N l38n149[] = { { sgi, .905 }, { sXz, .128 }, H }; +N l38n150[] = { { sjf6v, .435 }, H }; +N l38n151[] = { { sppi, .433 }, H }; +N l38n153[] = { { skg, .378 }, { sVvh, .388 }, H }; +N l38n154[] = { { sivmr, .182 }, H }; +N l38n156[] = { { shhmw, .166 }, H }; +N l38n158[] = { { sxv, .129 }, H }; +N l38n159[] = { { svXg, .810 }, { sry78g, .657 }, { sglV, .266 }, H }; +N l38n160[] = { { srr, .159 }, { sppg, .323 }, { sgqih, .259 }, H }; +N l38n161[] = { { swx, .753 }, { szXv, .154 }, H }; +N l38n162[] = { { swi, .135 }, { sgwxX, .397 }, { sqir, .130 }, H }; +N l38n164[] = { { sqX, .160 }, H }; +N l38n165[] = { { sgy, .282 }, H }; +N l38n166[] = { { sgj, 1.054 }, { soix, .199 }, H }; +N l38n167[] = { { sxiv, .243 }, H }; +N l38n168[] = { { s78g, .414 }, { sXvi, .117 }, H }; +N l38n169[] = { { sgXxx, .896 }, { sxmp, .204 }, { sox, .084 }, H }; +N l38n170[] = { { soi, .252 }, H }; +N l38n174[] = { { ssq, .503 }, { shv, .103 }, H }; +N l38n175[] = { { spiv, .433 }, { sgirg, .690 }, H }; +N l38n176[] = { { sjf6, .301 }, { stg, .227 }, H }; +N l38n177[] = { { sXvg, .566 }, H }; +N l38n179[] = { { slVv, .172 }, H }; +N l38n182[] = { { sgz, .468 }, { sgw79, .246 }, { svmrk, .197 }, H }; +N l38n183[] = { { sgk, .233 }, { shiv, .151 }, H }; +N l38n184[] = { { slg, .341 }, { sgsZl, .663 }, H }; +N l38n186[] = { { sgwVg, .424 }, H }; +N l38n187[] = { { szX, .175 }, { swoix, .166 }, H }; +N l38n188[] = { { sf6vg, 1.274 }, H }; +N l38n189[] = { { srxig, .250 }, H }; +N l38n190[] = { { sXppi, .241 }, { svhh, .125 }, H }; +N l38n191[] = { { ssr, .425 }, { sxXvx, .236 }, { smrr, .149 }, H }; +N l38n192[] = { { sxx, .681 }, { sgos, .328 }, { shh, .116 }, H }; +N l38n193[] = { { sxi, .614 }, H }; +N l38n195[] = { { srX, .276 }, { sgXzg, .289 }, H }; +N l38n197[] = { { stV, .175 }, { sVvhh, .374 }, H }; +N l38n198[] = { { soXg, .231 }, H }; +N l38n199[] = { { spmr, .391 }, { svm, .220 }, { sqqi, .154 }, H }; +N l38n200[] = { { sgl, .678 }, { sUp, .217 }, H }; +N l38n201[] = { { spi, .426 }, H }; +N l38n202[] = { { sxms, .450 }, H }; +N l38n203[] = { { sXrzU, .228 }, H }; +N l38n204[] = { { swxX, .501 }, { shswg, .240 }, H }; +N l38n205[] = { { siv, 1.197 }, { shix, .363 }, { slV, .142 }, H }; +N l38n206[] = { { sqiv, .131 }, H }; +N l38n207[] = { { sXxxg, .910 }, { shmr, .141 }, H }; +N l38n208[] = { { smsr, .483 }, { sxiqg, .309 }, H }; +N l38n209[] = { { shi, .801 }, { sgtXv, .594 }, H }; +N l38n215[] = { { smg, .268 }, H }; +N l38n216[] = { { siqg, .337 }, H }; +N l38n217[] = { { sgm, .755 }, { sgpmr, .670 }, H }; +N l38n218[] = { { sgwi, .182 }, H }; +N l38n219[] = { { sghi, 1.108 }, { sVg, 1.319 }, H }; +N l38n220[] = { { ssZlg, .663 }, { srhv, .121 }, H }; +N l38n221[] = { { sxXg, .478 }, H }; +N l38n222[] = { { siw, .149 }, H }; +N l38n223[] = { { sXg, 2.041 }, { sih, .179 }, { slVvh, .230 }, { syx, .113 }, H }; +N l38n225[] = { { shy, .373 }, H }; +N l38n226[] = { { svxg, .219 }, H }; +N l38n227[] = { { smp, .335 }, { svig, .224 }, H }; +N l38n229[] = { { sZl, .225 }, { sziv, .176 }, H }; +N l38n230[] = { { swm, .148 }, H }; +N l38n231[] = { { stXv, .341 }, { sw79w, .195 }, { smppg, .335 }, { szmp, .140 }, { stvs, .120 }, H }; +N l38n232[] = { { sqi, .403 }, { skir, .140 }, H }; +N l38n233[] = { { sirg, 1.507 }, H }; +N l38n234[] = { { sUr, .510 }, { sgUv, .360 }, { skX, .153 }, H }; +N l38n235[] = { { sghyg, 1.008 }, { sXp, .288 }, { sixx, .322 }, { shirg, .345 }, H }; +N l38n236[] = { { sgmrw, .414 }, { sjv, .097 }, H }; +N l38n237[] = { { sppiv, .488 }, { sriv, .231 }, { sxmpp, .267 }, { shXg, .288 }, { sgixx, .240 }, H }; +N l38n238[] = { { svg, 2.233 }, { smxm, .292 }, { sgsq, .396 }, { smkg, .192 }, H }; +N l38n239[] = { { six, .682 }, { sgmrx, .279 }, H }; +N l38n241[] = { { srwx, .227 }, H }; +N l38n243[] = { { smwo, .430 }, { sglX, .236 }, H }; +N l38n244[] = { { srzU, .171 }, H }; +N l38n245[] = { { srw, .306 }, { sglVv, .345 }, { sXzg, .241 }, H }; +N l38n246[] = { { srh, .425 }, { sjf6vg, .640 }, { smrw, .223 }, { sw79, .136 }, { sXxm, .177 }, H }; +N l38n247[] = { { sls, .089 }, H }; +N l38n248[] = { { sivX, .389 }, { swxi, .322 }, H }; +N l38n249[] = { { svhhm, .166 }, H }; +N l38n251[] = { { sgo, .639 }, { swsq, .199 }, H }; +N l38n252[] = { { sXq, .109 }, H }; +N l38n255[] = { { szi, .173 }, { smsri, .333 }, { sg2f, .182 }, H }; + +D l38_d = { "swedish", "iso-8859-15", - { - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,0.001,0.000,0.000,W,0.001,W,W,W,0.001,W,W,W,0.013, - W,W,W,W,W,W,W,W,W,W,W,W,0.001,0.001,0.001,W, - 0.000,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,0.000,W,W,W, - 0.001,0.176,0.018,0.025,0.108,0.184,0.037,0.043,0.037,0.132,0.007,0.057,0.101,0.069,0.160,0.091, - 0.044,0.001,0.162,0.128,0.187,0.050,0.039,0.007,0.013,0.013,0.000,W,W,W,0.000,W, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,0.000,Y,Y, - Y,Y,Y,Y,Y,Y,Y,0.002,Y,Y,Y,Y,Y,Y,Y,Y, - Y,V,V,V,0.001,0.000,V,V,V,V,V,V,V,V,V,V, - V,V,V,V,V,V,0.000,V,V,V,V,V,V,V,V,V, - V,V,V,V,0.071,0.074,V,V,V,0.000,V,V,V,V,V,V, - V,V,V,V,V,V,0.049,V,V,V,V,V,V,V,V,V - }, - { - X,l38n1,l38n2,l38n3,l38n4,l38n5,l38n6,l38n7,l38n8,l38n9,X,l38n11,l38n12,l38n13,l38n14,l38n15, - l38n16,X,l38n18,X,l38n20,l38n21,l38n22,l38n23,l38n24,X,X,X,l38n28,l38n29,X,l38n31, - l38n32,l38n33,l38n34,l38n35,X,l38n37,l38n38,l38n39,l38n40,l38n41,X,X,l38n44,l38n45,l38n46,l38n47, - l38n48,l38n49,X,l38n51,l38n52,X,l38n54,l38n55,l38n56,l38n57,l38n58,l38n59,l38n60,X,l38n62,l38n63, - l38n64,l38n65,X,l38n67,X,l38n69,l38n70,l38n71,l38n72,l38n73,l38n74,l38n75,l38n76,l38n77,l38n78,l38n79, - l38n80,l38n81,l38n82,l38n83,l38n84,l38n85,X,X,l38n88,l38n89,l38n90,l38n91,l38n92,l38n93,l38n94,l38n95, - l38n96,l38n97,l38n98,l38n99,X,l38n101,l38n102,l38n103,l38n104,X,l38n106,l38n107,l38n108,l38n109,l38n110,l38n111, - l38n112,l38n113,l38n114,l38n115,l38n116,l38n117,X,X,l38n120,l38n121,l38n122,l38n123,l38n124,l38n125,X,l38n127, - l38n128,l38n129,l38n130,l38n131,l38n132,l38n133,X,l38n135,l38n136,l38n137,X,l38n139,l38n140,l38n141,l38n142,l38n143, - l38n144,l38n145,X,l38n147,l38n148,l38n149,l38n150,l38n151,X,l38n153,l38n154,X,l38n156,X,l38n158,l38n159, - l38n160,l38n161,l38n162,X,l38n164,l38n165,l38n166,l38n167,l38n168,l38n169,l38n170,X,X,X,l38n174,l38n175, - l38n176,l38n177,X,l38n179,X,X,l38n182,l38n183,l38n184,X,l38n186,l38n187,l38n188,l38n189,l38n190,l38n191, - l38n192,l38n193,X,l38n195,X,l38n197,l38n198,l38n199,l38n200,l38n201,l38n202,l38n203,l38n204,l38n205,l38n206,l38n207, - l38n208,l38n209,X,X,X,X,X,l38n215,l38n216,l38n217,l38n218,l38n219,l38n220,l38n221,l38n222,l38n223, - X,l38n225,l38n226,l38n227,X,l38n229,l38n230,l38n231,l38n232,l38n233,l38n234,l38n235,l38n236,l38n237,l38n238,l38n239, - X,l38n241,X,l38n243,l38n244,l38n245,l38n246,l38n247,l38n248,l38n249,X,l38n251,l38n252,X,X,l38n255 - } + { W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, 0.001, 0.000, 0.000, W, 0.001, W, W, W, 0.001, W, W, W, 0.013, + W, W, W, W, W, W, W, W, W, W, W, W, 0.001, 0.001, 0.001, W, + 0.000, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, 0.000, W, W, W, + 0.001, 0.176, 0.018, 0.025, 0.108, 0.184, 0.037, 0.043, 0.037, 0.132, 0.007, 0.057, 0.101, 0.069, 0.160, 0.091, + 0.044, 0.001, 0.162, 0.128, 0.187, 0.050, 0.039, 0.007, 0.013, 0.013, 0.000, W, W, W, 0.000, W, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, 0.000, Y, Y, + Y, Y, Y, Y, Y, Y, Y, 0.002, Y, Y, Y, Y, Y, Y, Y, Y, + Y, V, V, V, 0.001, 0.000, V, V, V, V, V, V, V, V, V, V, + V, V, V, V, V, V, 0.000, V, V, V, V, V, V, V, V, V, + V, V, V, V, 0.071, 0.074, V, V, V, 0.000, V, V, V, V, V, V, + V, V, V, V, V, V, 0.049, V, V, V, V, V, V, V, V, V }, + { X, l38n1, l38n2, l38n3, l38n4, l38n5, l38n6, l38n7, l38n8, l38n9, X, l38n11, l38n12, l38n13, l38n14, l38n15, + l38n16, X, l38n18, X, l38n20, l38n21, l38n22, l38n23, l38n24, X, X, X, l38n28, l38n29, X, l38n31, + l38n32, l38n33, l38n34, l38n35, X, l38n37, l38n38, l38n39, l38n40, l38n41, X, X, l38n44, l38n45, l38n46, l38n47, + l38n48, l38n49, X, l38n51, l38n52, X, l38n54, l38n55, l38n56, l38n57, l38n58, l38n59, l38n60, X, l38n62, l38n63, + l38n64, l38n65, X, l38n67, X, l38n69, l38n70, l38n71, l38n72, l38n73, l38n74, l38n75, l38n76, l38n77, l38n78, l38n79, + l38n80, l38n81, l38n82, l38n83, l38n84, l38n85, X, X, l38n88, l38n89, l38n90, l38n91, l38n92, l38n93, l38n94, l38n95, + l38n96, l38n97, l38n98, l38n99, X, l38n101, l38n102, l38n103, l38n104, X, l38n106, l38n107, l38n108, l38n109, l38n110, l38n111, + l38n112, l38n113, l38n114, l38n115, l38n116, l38n117, X, X, l38n120, l38n121, l38n122, l38n123, l38n124, l38n125, X, l38n127, + l38n128, l38n129, l38n130, l38n131, l38n132, l38n133, X, l38n135, l38n136, l38n137, X, l38n139, l38n140, l38n141, l38n142, l38n143, + l38n144, l38n145, X, l38n147, l38n148, l38n149, l38n150, l38n151, X, l38n153, l38n154, X, l38n156, X, l38n158, l38n159, + l38n160, l38n161, l38n162, X, l38n164, l38n165, l38n166, l38n167, l38n168, l38n169, l38n170, X, X, X, l38n174, l38n175, + l38n176, l38n177, X, l38n179, X, X, l38n182, l38n183, l38n184, X, l38n186, l38n187, l38n188, l38n189, l38n190, l38n191, + l38n192, l38n193, X, l38n195, X, l38n197, l38n198, l38n199, l38n200, l38n201, l38n202, l38n203, l38n204, l38n205, l38n206, l38n207, + l38n208, l38n209, X, X, X, X, X, l38n215, l38n216, l38n217, l38n218, l38n219, l38n220, l38n221, l38n222, l38n223, + X, l38n225, l38n226, l38n227, X, l38n229, l38n230, l38n231, l38n232, l38n233, l38n234, l38n235, l38n236, l38n237, l38n238, l38n239, + X, l38n241, X, l38n243, l38n244, l38n245, l38n246, l38n247, l38n248, l38n249, X, l38n251, l38n252, X, X, l38n255 } }; - - // // Lng: ukrainian // Enc: koi8-r // - -S sHa6[]={215,166,0}; -S sa6c4[]={166,196,0}; -S sa6cc[]={166,204,0}; -S scea6[]={206,166,0}; -S sa6H[]={166,215,0}; -S sNcf[]={221,207,0}; -S sa6ce[]={166,206,0}; -S sFc4[]={213,196,0}; -S scbc9g[]={203,201,a}; -S sc4a6[]={196,166,0}; -S sEc9g[]={212,201,a}; -S scfc0g[]={207,192,a}; -S sAa6[]={208,166,0}; -S sc4cfg[]={196,207,a}; -S scfc0[]={207,192,0}; -S sgNcf[]={32,221,207,0}; -S sga6g[]={32,166,a}; -S sCa6[]={210,166,0}; -S scfa7[]={207,167,0}; -S sc2a6[]={194,166,0}; -S scca6[]={204,166,0}; -S sNcfg[]={221,207,a}; -S sgc4cfg[]={32,196,207,a}; -S scea6g[]={206,166,a}; -S scfHa6[]={207,215,166,0}; -S sgHa6[]={32,215,166,0}; -S sHa6c4[]={215,166,196,0}; -S sc8cf[]={200,207,0}; -S scdF[]={205,213,0}; -S sc2F[]={194,213,0}; -S sgNcfg[]={32,221,207,a}; -S sgc2F[]={32,194,213,0}; -S sIcb[]={216,203,0}; -S sc1a4g[]={193,164,a}; -S sceF[]={206,213,0}; -S sgAa6[]={32,208,166,0}; -S sc4F[]={196,213,0}; -S sEa6[]={212,166,0}; -S sc1G[]={193,214,0}; -S scdFg[]={205,213,a}; -S sOcf[]={222,207,0}; -S scfcdF[]={207,205,213,0}; -S scfcdFg[]={207,205,213,a}; -S sa6Hg[]={166,215,a}; -S sDH[]={211,215,0}; -S sBcb[]={209,203,0}; -S sa6E[]={166,212,0}; -S sgBcb[]={32,209,203,0}; -S sgDH[]={32,211,215,0}; -S sCE[]={210,212,0}; -S scba6[]={203,166,0}; -S sgcbc1[]={32,203,193,0}; -S scfa7g[]={207,167,a}; -S sAc9[]={208,201,0}; -S sc1Ec9[]={193,212,201,0}; -S sgKg[]={32,218,a}; -S sc9EIg[]={201,212,216,a}; -S scbF[]={203,213,0}; -S sa6D[]={166,211,0}; -S sAa6c4[]={208,166,196,0}; -S sa6ccI[]={166,204,216,0}; -S sgHc9[]={32,215,201,0}; -S sgOcf[]={32,222,207,0}; -S sgAa6c4[]={32,208,166,196,0}; -S sc9EI[]={201,212,216,0}; -S scfCa6[]={207,210,166,0}; -S scbc1G[]={203,193,214,0}; -S sDI[]={211,216,0}; -S sccc5g[]={204,197,a}; -S sfaR[]={250,225,0}; -S sc1ccc9[]={193,204,201,0}; -S scfc4a6[]={207,196,166,0}; -S sceBg[]={206,209,a}; -S sc1Gc5[]={193,214,197,0}; -S sa6c4A[]={166,196,208,0}; -S sc1Gc5g[]={193,214,197,a}; -S sc2c1[]={194,193,0}; -S sgc2a6[]={32,194,166,0}; -S sgCcf[]={32,210,207,0}; -S scdc9g[]={205,201,a}; -S sAcfH[]={208,207,215,0}; -S sgDEcf[]={32,211,212,207,0}; -S sa6cb[]={166,203,0}; -S sc1ccc5[]={193,204,197,0}; -S scfc4c9[]={207,196,201,0}; -S sgHa6c4[]={32,215,166,196,0}; -S sa6c4c1[]={166,196,193,0}; -S scccfHa6[]={204,207,215,166,0}; -S sc9Ec9[]={201,212,201,0}; -S sa6B[]={166,209,0}; -S sgHc5[]={32,215,197,0}; -S sgOcfcc[]={32,222,207,204,0}; -S sc8cfc4[]={200,207,196,0}; -S sDa6[]={211,166,0}; -S sa4E[]={164,212,0}; -S sc4a6g[]={196,166,a}; -S scfHc9[]={207,215,201,0}; -S sc1Ec9g[]={193,212,201,a}; -S sCce[]={210,206,0}; -S sc9ceg[]={201,206,a}; -S sOcfcc[]={222,207,204,0}; -S sgc2Fc4[]={32,194,213,196,0}; -S sAcfHa6[]={208,207,215,166,0}; -S sa6C[]={166,210,0}; -S sHa6cb[]={215,166,203,0}; -S sKcec1[]={218,206,193,0}; -S sa6cecb[]={166,206,203,0}; -S scfcccfH[]={207,204,207,215,0}; -S sgcdc1[]={32,205,193,0}; -S sc2Fc4[]={194,213,196,0}; -S sgcbc1G[]={32,203,193,214,0}; -S sID[]={216,211,0}; -S sceceB[]={206,206,209,0}; -S sa6ccIcb[]={166,204,216,203,0}; -S sHc9g[]={215,201,a}; -S scfHa6cb[]={207,215,166,203,0}; -S scfHa6c4[]={207,215,166,196,0}; -S sgAc9[]={32,208,201,0}; -S sOcfcccf[]={222,207,204,207,0}; -S sIcbc9[]={216,203,201,0}; -S sDc9[]={211,201,0}; -S sccIcb[]={204,216,203,0}; -S sgEa6[]={32,212,166,0}; -S sc4H[]={196,215,0}; -S sIcbc9g[]={216,203,201,a}; -S scbFg[]={203,213,a}; -S sHcfa7[]={215,207,167,0}; -S sHa6c4c1[]={215,166,196,193,0}; -S sc4c1a4[]={196,193,164,0}; -S sgc2a6cc[]={32,194,166,204,0}; -S seff3[]={239,243,0}; -S sceFg[]={206,213,a}; -S sgDF[]={32,211,213,0}; -S sDcfc2[]={211,207,194,0}; -S sFc4c5[]={213,196,197,0}; -S sc4AcfH[]={196,208,207,215,0}; -S sc9cdg[]={201,205,a}; -S sEIDB[]={212,216,211,209,0}; -S sc2a6cc[]={194,166,204,0}; -S sEa6g[]={212,166,a}; -S sDHa6[]={211,215,166,0}; -S sc4Fg[]={196,213,a}; -S sFcc[]={213,204,0}; -S scccfD[]={204,207,211,0}; -S sHc9ce[]={215,201,206,0}; -S sLc1[]={219,193,0}; -S sgDcfc2[]={32,211,207,194,0}; -S sEID[]={212,216,211,0}; -S sc4cea6[]={196,206,166,0}; -S sAc9E[]={208,201,212,0}; -S scfHcf[]={207,215,207,0}; -S sIDB[]={216,211,209,0}; -S sDEcfC[]={211,212,207,210,0}; -S sBce[]={209,206,0}; -S sgc7cf[]={32,199,207,0}; -S sc9ceF[]={201,206,213,0}; -S sc5cece[]={197,206,206,0}; -S sc5cea6g[]={197,206,166,a}; -S sc5ceceB[]={197,206,206,209,0}; -S scbcfcd[]={203,207,205,0}; -S sAcfc4[]={208,207,196,0}; -S sHa6E[]={215,166,212,0}; -S sIcf[]={216,207,0}; -S sHc5C[]={215,197,210,0}; -S sceceBg[]={206,206,209,a}; -S sc5cea6[]={197,206,166,0}; -S sgKc1g[]={32,218,193,a}; -S sCc9g[]={210,201,a}; -S sgc4ce[]={32,196,206,0}; -S scfc4c1[]={207,196,193,0}; -S sEcfCa6[]={212,207,210,166,0}; -S sgcacf[]={32,202,207,0}; -S sIDBg[]={216,211,209,a}; -S scacf[]={202,207,0}; -S sc4cecf[]={196,206,207,0}; -S scbc1Gc5[]={203,193,214,197,0}; -S sc4Acf[]={196,208,207,0}; -S sc2Fc4c5[]={194,213,196,197,0}; -S sHL[]={215,219,0}; -S sKc1g[]={218,193,a}; - -N l39n1[]={{sAc1,.313},H}; -N l39n3[]={{scfC,.940},{sgf3,.188},{sc3a6g,.423},{sc4H,.188},H}; -N l39n4[]={{sEI,.815},{sgU,.146},H}; -N l39n5[]={{sEc9,.815},{sc9ce,.752},{sgcec5,.407},{sgF,.125},{sgKc1g,.209},H}; -N l39n7[]={{scec5,.533},{sACcf,.470},{scfcccfH,.376},H}; -N l39n10[]={{sGg,.235},{sgDF,.157},H}; -N l39n11[]={{sc5cea6g,.470},H}; -N l39n12[]={{sccI,.313},{sHD,.282},{sc1Gc5,.329},{sa6C,.125},H}; -N l39n13[]={{sccc9,.940},{sc1ce,.313},H}; -N l39n14[]={{scfcdg,.917},{sa6c4A,.219},{sc9Ec9,.282},{sgDcfc2,.209},H}; -N l39n15[]={{sHa6,1.222},{sc2Fc4,.282},H}; -N l39n17[]={{sgACc9,.251},H}; -N l39n18[]={{sceg,.470},{sFH,.251},{sEa6g,.353},H}; -N l39n19[]={{sc9EIg,.752},H}; -N l39n20[]={{scfD,.564},{sgf4,.188},{sKce,.251},{seff3,.157},H}; -N l39n21[]={{scfc4,.815},{sc4c9,.282},{sEID,.235},H}; -N l39n22[]={{sc1Ec9,.423},{sgG,.167},{sgEa6,.188},H}; -N l39n23[]={{sceF,.376},{sgc7,.230},H}; -N l39n25[]={{sDcc,.157},H}; -N l39n26[]={{scbFg,.423},H}; -N l39n28[]={{sCce,.188},H}; -N l39n29[]={{sa6D,.167},H}; -N l39n30[]={{sa6c4,.564},{sHc5,.376},{sgAa6c4,.334},{sAcfHa6,.376},H}; -N l39n31[]={{sc1c0,.157},H}; -N l39n32[]={{sgDH,.282},{sgcdc9,.157},H}; -N l39n33[]={{sc9cag,.705},{sEc5g,.353},H}; -N l39n34[]={{sAC,.658},{sc4a6g,.423},{sc5H,.157},H}; -N l39n35[]={{scec1g,1.692},{sgACcf,.334},{scbcfcd,.235},H}; -N l39n36[]={{sHc5C,.235},H}; -N l39n37[]={{scfCa6,.329},H}; -N l39n38[]={{sIDB,.235},H}; -N l39n39[]={{sgH,1.316},{sCc9g,.353},H}; -N l39n40[]={{scfa7,.407},{sgc8,.230},{sgcbc1G,.251},H}; -N l39n41[]={{sHg,1.880},{sgc4cfg,.543},{sccc5g,.494},H}; -N l39n43[]={{sID,.188},{sHa6E,.235},H}; -N l39n44[]={{scdc9,.251},{sAcfH,.329},{sc9ceF,.235},H}; -N l39n45[]={{sCcf,1.034},{scfc7cf,.658},H}; -N l39n46[]={{sa6E,.209},H}; -N l39n47[]={{sc1A,.188},{sgcacf,.157},H}; -N l39n49[]={{scfg,2.820},{scfc0g,1.058},H}; -N l39n51[]={{sceBg,.494},H}; -N l39n53[]={{scfcdFg,1.034},{sgc2Fc4,.251},{scacf,.157},H}; -N l39n54[]={{sAa6,.470},H}; -N l39n55[]={{sKc1,.595},{sge7,.167},{sfaR,.219},{scfc4a6,.329},H}; -N l39n56[]={{sc7cfg,.776},H}; -N l39n57[]={{sgcec1g,.376},H}; -N l39n58[]={{sa6g,1.974},{sHc1g,.423},H}; -N l39n59[]={{sOc9,.313},H}; -N l39n60[]={{sHc9ce,.235},H}; -N l39n61[]={{scfHcf,.235},H}; -N l39n62[]={{sc7F,.157},H}; -N l39n63[]={{sCc1,.721},{sgEc1,.157},H}; -N l39n64[]={{sgcbcf,.188},H}; -N l39n65[]={{sc4Fg,.353},H}; -N l39n67[]={{sc1a4,.564},H}; -N l39n69[]={{sAc5,.313},{sc5ca,.188},H}; -N l39n70[]={{sga6g,.439},{sIcbc9,.282},{sFc4c5,.235},H}; -N l39n71[]={{sgf7,.167},H}; -N l39n72[]={{sIg,1.175},{scfc7,.627},{sgc2a6cc,.209},{sc2a6cc,.235},H}; -N l39n73[]={{sgHa6,.407},H}; -N l39n74[]={{sgca,.125},H}; -N l39n75[]={{scec9,.752},{sAc5C,.282},H}; -N l39n76[]={{sDcf,.219},H}; -N l39n78[]={{scbc9g,1.128},H}; -N l39n79[]={{sf1g,.329},{sc2c1,.219},{sa6ccIcb,.251},{sc4cecf,.235},H}; -N l39n81[]={{sc1C,.501},H}; -N l39n83[]={{sgAc9,.188},H}; -N l39n84[]={{scbcf,.689},{sc9cdg,.353},H}; -N l39n86[]={{sLc1,.157},H}; -N l39n87[]={{se9g,.282},{sFcc,.157},H}; -N l39n88[]={{scfH,1.128},{sc8g,.658},{scea6g,.917},{scdFg,.776},H}; -N l39n89[]={{sa7g,.345},H}; -N l39n90[]={{sgK,.836},{sc9D,.251},H}; -N l39n91[]={{sgcb,.543},{sAcfc4,.235},H}; -N l39n92[]={{sc1cdg,.353},H}; -N l39n94[]={{sc2Fc4c5,.313},H}; -N l39n95[]={{sGc5g,.917},{sRg,.282},{sKcec1,.282},H}; -N l39n96[]={{sc0g,1.081},{scfc4c1,.235},H}; -N l39n97[]={{sa6H,.355},H}; -N l39n98[]={{sHc9,.721},{sgcdcf,.282},{sc1ccc5,.282},{sc1D,.188},H}; -N l39n99[]={{sc1c4,.282},{sc8cfc4,.282},{sc5cece,.235},{sEcfCa6,.313},H}; -N l39n100[]={{sEIg,1.340},H}; -N l39n101[]={{sEc9g,1.128},{sgcec5g,.334},{sc9ceg,.423},{sOcfcc,.282},H}; -N l39n102[]={{scbc1,.909},H}; -N l39n103[]={{scec5g,.705},{sc5cc,.251},H}; -N l39n105[]={{sa6c4c1,.188},H}; -N l39n106[]={{sc4ce,.407},H}; -N l39n107[]={{sc9E,.752},{sEcf,.721},H}; -N l39n108[]={{sgcc,.188},{sc1Gc5g,.658},{sgDEcf,.292},H}; -N l39n109[]={{sccc9g,.917},{scecb,.219},H}; -N l39n110[]={{sDB,.533},H}; -N l39n111[]={{sBg,1.927},H}; -N l39n113[]={{sEcfC,.423},{sc4Acf,.235},H}; -N l39n114[]={{sgNcf,.470},H}; -N l39n115[]={{scccf,.752},{sc1E,.501},H}; -N l39n116[]={{sCa6,.439},{sccc0,.157},H}; -N l39n118[]={{sc1Ec9g,.564},{seag,.235},H}; -N l39n119[]={{sc9g,3.760},{sceFg,.353},H}; -N l39n120[]={{sc5cd,.282},H}; -N l39n122[]={{scfHa6,.611},{sgfa,.251},{sgBcb,.282},H}; -N l39n123[]={{sc4cf,1.034},{sHa6c4,.611},{sgeb,.167},H}; -N l39n125[]={{sgcd,.543},{sEc1,.721},H}; -N l39n127[]={{sc1g,3.854},H}; -N l39n129[]={{sa6cecb,.188},H}; -N l39n130[]={{sNcf,.533},{scfcccf,.470},{sCE,.282},H}; -N l39n131[]={{sgOcf,.251},{sCc5,.188},H}; -N l39n132[]={{sc2a6,.407},{sa6ca,.146},{scccfD,.235},H}; -N l39n133[]={{sccc1,.439},H}; -N l39n134[]={{sKg,.611},{sDEcf,.376},{sIDBg,.470},H}; -N l39n135[]={{sgHg,.533},H}; -N l39n136[]={{scfa7g,.635},{sEIDB,.313},H}; -N l39n137[]={{sc5ce,.533},{sAc9,.282},H}; -N l39n139[]={{scfK,.219},H}; -N l39n140[]={{scfcb,.251},{sc4A,.219},{scdc9g,.494},{sc4cea6,.235},H}; -N l39n141[]={{sc4c1,.627},{sgN,.376},{scfc7cfg,1.034},H}; -N l39n142[]={{sgce,.710},{sCg,.329},{sc1ccc9,.329},H}; -N l39n146[]={{scdcf,.439},H}; -N l39n147[]={{sCF,.251},{sDa6,.188},H}; -N l39n148[]={{sHL,.157},H}; -N l39n149[]={{sgAcf,.783},{sccB,.407},{sc1G,.345},{sa6cb,.146},{sgHa6c4,.251},H}; -N l39n150[]={{scag,1.128},H}; -N l39n151[]={{sKc1g,.353},H}; -N l39n152[]={{scbc1G,.329},H}; -N l39n153[]={{sc4c1a4,.235},{sCcfc4,.235},H}; -N l39n155[]={{scba6,.282},{sceceB,.282},H}; -N l39n157[]={{scfcc,.627},H}; -N l39n158[]={{sgO,.355},{sc9H,.345},{sgHc5,.188},{sEC,.157},H}; -N l39n159[]={{sgcf,.334},{sc9c8,.219},H}; -N l39n160[]={{scece,.282},H}; -N l39n161[]={{sDE,.815},{sOcf,.345},H}; -N l39n162[]={{sAa6c4,.376},{scccfHa6,.376},{sDcfc2,.235},H}; -N l39n163[]={{sc3a6,.407},{sc2F,.407},{sIcb,.376},{sc1a4g,.846},H}; -N l39n164[]={{scdc1,.313},H}; -N l39n165[]={{sgKc1,.501},{sc5cag,.353},{sAc9E,.235},H}; -N l39n166[]={{sa6cc,.418},{sc1H,.501},{sgcbc1,.282},{sIcbc9g,.564},H}; -N l39n167[]={{sc1c8,.157},H}; -N l39n171[]={{sc5cea6,.235},H}; -N l39n174[]={{scfcd,.846},{sgee,.230},H}; -N l39n176[]={{sgA,1.546},{scccfH,.329},H}; -N l39n177[]={{scecf,.439},{sgc1,.125},H}; -N l39n178[]={{sEa6,.345},{sDF,.219},H}; -N l39n179[]={{sc9EI,.376},{sOc1,.188},H}; -N l39n181[]={{scbg,.517},H}; -N l39n182[]={{sgAC,.564},H}; -N l39n183[]={{sgCcf,.219},H}; -N l39n184[]={{scfc4c9,.282},H}; -N l39n186[]={{scca6,.407},{sgKg,.282},{scbF,.251},H}; -N l39n189[]={{sFC,.188},H}; -N l39n190[]={{sHa6c4c1,.313},{sgc4ce,.157},H}; -N l39n191[]={{scfce,.282},H}; -N l39n193[]={{sgB,.292},{sEc5,.376},{sa6Hg,.517},{sc9ca,.313},H}; -N l39n194[]={{sgc2,.648},{sc4a6,.501},{sHc9g,.423},H}; -N l39n195[]={{scec1,1.253},H}; -N l39n197[]={{sACc9,.329},{sccIcb,.282},H}; -N l39n198[]={{scbc1g,.917},{scfHa6c4,.376},H}; -N l39n199[]={{sCc9,.815},H}; -N l39n200[]={{sHcf,.564},{sa6ce,.355},{sgDcf,.219},{sHa6cb,.282},{sgcdc1,.188},H}; -N l39n201[]={{sgc4cf,.752},{sccc5,.376},H}; -N l39n202[]={{sBcb,.313},{sgHc9,.251},H}; -N l39n204[]={{sEg,.282},H}; -N l39n205[]={{sc5C,.627},H}; -N l39n206[]={{sDBg,1.128},H}; -N l39n207[]={{sFc4,.533},{scfO,.219},H}; -N l39n208[]={{sgf0,.313},H}; -N l39n209[]={{scfc0,.470},{sc4c5,.407},{sOc5ce,.282},H}; -N l39n210[]={{sgC,.334},{sgNcfg,.501},{sc9cb,.376},{sgAa6,.376},{sOcfcccf,.376},H}; -N l39n211[]={{sgc3,.292},{sceB,.282},H}; -N l39n212[]={{sDH,.345},H}; -N l39n213[]={{scfcdF,.517},H}; -N l39n214[]={{sc5ceceB,.313},H}; -N l39n215[]={{sc2c9,.282},{smg,.104},H}; -N l39n216[]={{sc7cf,.658},{sNc5,.188},H}; -N l39n217[]={{sgcec1,.564},{sgEcf,.251},{sc1K,.219},H}; -N l39n218[]={{sHc1,.564},{sc1cb,.282},H}; -N l39n219[]={{sc4cfg,1.058},{scfHa6cb,.376},H}; -N l39n220[]={{sc4g,.376},H}; -N l39n225[]={{sc4F,.376},{sgf1,.167},H}; -N l39n226[]={{sNcfg,.917},{sgS,.125},H}; -N l39n227[]={{sgD,.940},{sc9cc,.407},H}; -N l39n228[]={{sgc4,.982},{sgc2a6,.219},{sa6cag,.235},H}; -N l39n229[]={{sDI,.219},{sccc1g,.494},H}; -N l39n230[]={{sga6,.334},{sDc9,.188},H}; -N l39n231[]={{sgOcfcc,.251},{sIcf,.157},{scbc1Gc5,.313},H}; -N l39n232[]={{scfCcf,.517},H}; -N l39n233[]={{sgc2F,.376},H}; -N l39n234[]={{sc7c1,.345},H}; -N l39n235[]={{sFg,2.115},{sc1cc,.752},H}; -N l39n236[]={{sDEc1,.282},H}; -N l39n238[]={{scbc9,.783},{sa6ccI,.251},H}; -N l39n239[]={{sAcf,1.034},H}; -N l39n240[]={{sa4E,.125},H}; -N l39n243[]={{scdg,1.457},{scfc2,.501},H}; -N l39n244[]={{sgE,.668},{sc9cd,.219},H}; -N l39n245[]={{sccBg,.423},{sHcfa7,.235},H}; -N l39n246[]={{sc4AcfH,.313},{sDHa6,.235},H}; -N l39n247[]={{sc8cf,.407},{sOc5,.313},H}; -N l39n248[]={{scea6,.564},{scdF,.407},H}; -N l39n251[]={{sc5g,2.444},{sgAc1,.188},{sa6B,.125},{scfHc9,.282},{sceceBg,.470},H}; -N l39n252[]={{sa4g,.439},{sc1cd,.219},{sDEcfC,.313},{sgc7cf,.157},H}; -N l39n253[]={{sBce,.157},H}; -N l39n255[]={{sGc5,.439},{sgDE,.376},{sc9c8g,.494},H}; - -D l39_d = -{ +S sHa6[] = { 215, 166, 0 }; +S sa6c4[] = { 166, 196, 0 }; +S sa6cc[] = { 166, 204, 0 }; +S scea6[] = { 206, 166, 0 }; +S sa6H[] = { 166, 215, 0 }; +S sNcf[] = { 221, 207, 0 }; +S sa6ce[] = { 166, 206, 0 }; +S sFc4[] = { 213, 196, 0 }; +S scbc9g[] = { 203, 201, a }; +S sc4a6[] = { 196, 166, 0 }; +S sEc9g[] = { 212, 201, a }; +S scfc0g[] = { 207, 192, a }; +S sAa6[] = { 208, 166, 0 }; +S sc4cfg[] = { 196, 207, a }; +S scfc0[] = { 207, 192, 0 }; +S sgNcf[] = { 32, 221, 207, 0 }; +S sga6g[] = { 32, 166, a }; +S sCa6[] = { 210, 166, 0 }; +S scfa7[] = { 207, 167, 0 }; +S sc2a6[] = { 194, 166, 0 }; +S scca6[] = { 204, 166, 0 }; +S sNcfg[] = { 221, 207, a }; +S sgc4cfg[] = { 32, 196, 207, a }; +S scea6g[] = { 206, 166, a }; +S scfHa6[] = { 207, 215, 166, 0 }; +S sgHa6[] = { 32, 215, 166, 0 }; +S sHa6c4[] = { 215, 166, 196, 0 }; +S sc8cf[] = { 200, 207, 0 }; +S scdF[] = { 205, 213, 0 }; +S sc2F[] = { 194, 213, 0 }; +S sgNcfg[] = { 32, 221, 207, a }; +S sgc2F[] = { 32, 194, 213, 0 }; +S sIcb[] = { 216, 203, 0 }; +S sc1a4g[] = { 193, 164, a }; +S sceF[] = { 206, 213, 0 }; +S sgAa6[] = { 32, 208, 166, 0 }; +S sc4F[] = { 196, 213, 0 }; +S sEa6[] = { 212, 166, 0 }; +S sc1G[] = { 193, 214, 0 }; +S scdFg[] = { 205, 213, a }; +S sOcf[] = { 222, 207, 0 }; +S scfcdF[] = { 207, 205, 213, 0 }; +S scfcdFg[] = { 207, 205, 213, a }; +S sa6Hg[] = { 166, 215, a }; +S sDH[] = { 211, 215, 0 }; +S sBcb[] = { 209, 203, 0 }; +S sa6E[] = { 166, 212, 0 }; +S sgBcb[] = { 32, 209, 203, 0 }; +S sgDH[] = { 32, 211, 215, 0 }; +S sCE[] = { 210, 212, 0 }; +S scba6[] = { 203, 166, 0 }; +S sgcbc1[] = { 32, 203, 193, 0 }; +S scfa7g[] = { 207, 167, a }; +S sAc9[] = { 208, 201, 0 }; +S sc1Ec9[] = { 193, 212, 201, 0 }; +S sgKg[] = { 32, 218, a }; +S sc9EIg[] = { 201, 212, 216, a }; +S scbF[] = { 203, 213, 0 }; +S sa6D[] = { 166, 211, 0 }; +S sAa6c4[] = { 208, 166, 196, 0 }; +S sa6ccI[] = { 166, 204, 216, 0 }; +S sgHc9[] = { 32, 215, 201, 0 }; +S sgOcf[] = { 32, 222, 207, 0 }; +S sgAa6c4[] = { 32, 208, 166, 196, 0 }; +S sc9EI[] = { 201, 212, 216, 0 }; +S scfCa6[] = { 207, 210, 166, 0 }; +S scbc1G[] = { 203, 193, 214, 0 }; +S sDI[] = { 211, 216, 0 }; +S sccc5g[] = { 204, 197, a }; +S sfaR[] = { 250, 225, 0 }; +S sc1ccc9[] = { 193, 204, 201, 0 }; +S scfc4a6[] = { 207, 196, 166, 0 }; +S sceBg[] = { 206, 209, a }; +S sc1Gc5[] = { 193, 214, 197, 0 }; +S sa6c4A[] = { 166, 196, 208, 0 }; +S sc1Gc5g[] = { 193, 214, 197, a }; +S sc2c1[] = { 194, 193, 0 }; +S sgc2a6[] = { 32, 194, 166, 0 }; +S sgCcf[] = { 32, 210, 207, 0 }; +S scdc9g[] = { 205, 201, a }; +S sAcfH[] = { 208, 207, 215, 0 }; +S sgDEcf[] = { 32, 211, 212, 207, 0 }; +S sa6cb[] = { 166, 203, 0 }; +S sc1ccc5[] = { 193, 204, 197, 0 }; +S scfc4c9[] = { 207, 196, 201, 0 }; +S sgHa6c4[] = { 32, 215, 166, 196, 0 }; +S sa6c4c1[] = { 166, 196, 193, 0 }; +S scccfHa6[] = { 204, 207, 215, 166, 0 }; +S sc9Ec9[] = { 201, 212, 201, 0 }; +S sa6B[] = { 166, 209, 0 }; +S sgHc5[] = { 32, 215, 197, 0 }; +S sgOcfcc[] = { 32, 222, 207, 204, 0 }; +S sc8cfc4[] = { 200, 207, 196, 0 }; +S sDa6[] = { 211, 166, 0 }; +S sa4E[] = { 164, 212, 0 }; +S sc4a6g[] = { 196, 166, a }; +S scfHc9[] = { 207, 215, 201, 0 }; +S sc1Ec9g[] = { 193, 212, 201, a }; +S sCce[] = { 210, 206, 0 }; +S sc9ceg[] = { 201, 206, a }; +S sOcfcc[] = { 222, 207, 204, 0 }; +S sgc2Fc4[] = { 32, 194, 213, 196, 0 }; +S sAcfHa6[] = { 208, 207, 215, 166, 0 }; +S sa6C[] = { 166, 210, 0 }; +S sHa6cb[] = { 215, 166, 203, 0 }; +S sKcec1[] = { 218, 206, 193, 0 }; +S sa6cecb[] = { 166, 206, 203, 0 }; +S scfcccfH[] = { 207, 204, 207, 215, 0 }; +S sgcdc1[] = { 32, 205, 193, 0 }; +S sc2Fc4[] = { 194, 213, 196, 0 }; +S sgcbc1G[] = { 32, 203, 193, 214, 0 }; +S sID[] = { 216, 211, 0 }; +S sceceB[] = { 206, 206, 209, 0 }; +S sa6ccIcb[] = { 166, 204, 216, 203, 0 }; +S sHc9g[] = { 215, 201, a }; +S scfHa6cb[] = { 207, 215, 166, 203, 0 }; +S scfHa6c4[] = { 207, 215, 166, 196, 0 }; +S sgAc9[] = { 32, 208, 201, 0 }; +S sOcfcccf[] = { 222, 207, 204, 207, 0 }; +S sIcbc9[] = { 216, 203, 201, 0 }; +S sDc9[] = { 211, 201, 0 }; +S sccIcb[] = { 204, 216, 203, 0 }; +S sgEa6[] = { 32, 212, 166, 0 }; +S sc4H[] = { 196, 215, 0 }; +S sIcbc9g[] = { 216, 203, 201, a }; +S scbFg[] = { 203, 213, a }; +S sHcfa7[] = { 215, 207, 167, 0 }; +S sHa6c4c1[] = { 215, 166, 196, 193, 0 }; +S sc4c1a4[] = { 196, 193, 164, 0 }; +S sgc2a6cc[] = { 32, 194, 166, 204, 0 }; +S seff3[] = { 239, 243, 0 }; +S sceFg[] = { 206, 213, a }; +S sgDF[] = { 32, 211, 213, 0 }; +S sDcfc2[] = { 211, 207, 194, 0 }; +S sFc4c5[] = { 213, 196, 197, 0 }; +S sc4AcfH[] = { 196, 208, 207, 215, 0 }; +S sc9cdg[] = { 201, 205, a }; +S sEIDB[] = { 212, 216, 211, 209, 0 }; +S sc2a6cc[] = { 194, 166, 204, 0 }; +S sEa6g[] = { 212, 166, a }; +S sDHa6[] = { 211, 215, 166, 0 }; +S sc4Fg[] = { 196, 213, a }; +S sFcc[] = { 213, 204, 0 }; +S scccfD[] = { 204, 207, 211, 0 }; +S sHc9ce[] = { 215, 201, 206, 0 }; +S sLc1[] = { 219, 193, 0 }; +S sgDcfc2[] = { 32, 211, 207, 194, 0 }; +S sEID[] = { 212, 216, 211, 0 }; +S sc4cea6[] = { 196, 206, 166, 0 }; +S sAc9E[] = { 208, 201, 212, 0 }; +S scfHcf[] = { 207, 215, 207, 0 }; +S sIDB[] = { 216, 211, 209, 0 }; +S sDEcfC[] = { 211, 212, 207, 210, 0 }; +S sBce[] = { 209, 206, 0 }; +S sgc7cf[] = { 32, 199, 207, 0 }; +S sc9ceF[] = { 201, 206, 213, 0 }; +S sc5cece[] = { 197, 206, 206, 0 }; +S sc5cea6g[] = { 197, 206, 166, a }; +S sc5ceceB[] = { 197, 206, 206, 209, 0 }; +S scbcfcd[] = { 203, 207, 205, 0 }; +S sAcfc4[] = { 208, 207, 196, 0 }; +S sHa6E[] = { 215, 166, 212, 0 }; +S sIcf[] = { 216, 207, 0 }; +S sHc5C[] = { 215, 197, 210, 0 }; +S sceceBg[] = { 206, 206, 209, a }; +S sc5cea6[] = { 197, 206, 166, 0 }; +S sgKc1g[] = { 32, 218, 193, a }; +S sCc9g[] = { 210, 201, a }; +S sgc4ce[] = { 32, 196, 206, 0 }; +S scfc4c1[] = { 207, 196, 193, 0 }; +S sEcfCa6[] = { 212, 207, 210, 166, 0 }; +S sgcacf[] = { 32, 202, 207, 0 }; +S sIDBg[] = { 216, 211, 209, a }; +S scacf[] = { 202, 207, 0 }; +S sc4cecf[] = { 196, 206, 207, 0 }; +S scbc1Gc5[] = { 203, 193, 214, 197, 0 }; +S sc4Acf[] = { 196, 208, 207, 0 }; +S sc2Fc4c5[] = { 194, 213, 196, 197, 0 }; +S sHL[] = { 215, 219, 0 }; +S sKc1g[] = { 218, 193, a }; + +N l39n1[] = { { sAc1, .313 }, H }; +N l39n3[] = { { scfC, .940 }, { sgf3, .188 }, { sc3a6g, .423 }, { sc4H, .188 }, H }; +N l39n4[] = { { sEI, .815 }, { sgU, .146 }, H }; +N l39n5[] = { { sEc9, .815 }, { sc9ce, .752 }, { sgcec5, .407 }, { sgF, .125 }, { sgKc1g, .209 }, H }; +N l39n7[] = { { scec5, .533 }, { sACcf, .470 }, { scfcccfH, .376 }, H }; +N l39n10[] = { { sGg, .235 }, { sgDF, .157 }, H }; +N l39n11[] = { { sc5cea6g, .470 }, H }; +N l39n12[] = { { sccI, .313 }, { sHD, .282 }, { sc1Gc5, .329 }, { sa6C, .125 }, H }; +N l39n13[] = { { sccc9, .940 }, { sc1ce, .313 }, H }; +N l39n14[] = { { scfcdg, .917 }, { sa6c4A, .219 }, { sc9Ec9, .282 }, { sgDcfc2, .209 }, H }; +N l39n15[] = { { sHa6, 1.222 }, { sc2Fc4, .282 }, H }; +N l39n17[] = { { sgACc9, .251 }, H }; +N l39n18[] = { { sceg, .470 }, { sFH, .251 }, { sEa6g, .353 }, H }; +N l39n19[] = { { sc9EIg, .752 }, H }; +N l39n20[] = { { scfD, .564 }, { sgf4, .188 }, { sKce, .251 }, { seff3, .157 }, H }; +N l39n21[] = { { scfc4, .815 }, { sc4c9, .282 }, { sEID, .235 }, H }; +N l39n22[] = { { sc1Ec9, .423 }, { sgG, .167 }, { sgEa6, .188 }, H }; +N l39n23[] = { { sceF, .376 }, { sgc7, .230 }, H }; +N l39n25[] = { { sDcc, .157 }, H }; +N l39n26[] = { { scbFg, .423 }, H }; +N l39n28[] = { { sCce, .188 }, H }; +N l39n29[] = { { sa6D, .167 }, H }; +N l39n30[] = { { sa6c4, .564 }, { sHc5, .376 }, { sgAa6c4, .334 }, { sAcfHa6, .376 }, H }; +N l39n31[] = { { sc1c0, .157 }, H }; +N l39n32[] = { { sgDH, .282 }, { sgcdc9, .157 }, H }; +N l39n33[] = { { sc9cag, .705 }, { sEc5g, .353 }, H }; +N l39n34[] = { { sAC, .658 }, { sc4a6g, .423 }, { sc5H, .157 }, H }; +N l39n35[] = { { scec1g, 1.692 }, { sgACcf, .334 }, { scbcfcd, .235 }, H }; +N l39n36[] = { { sHc5C, .235 }, H }; +N l39n37[] = { { scfCa6, .329 }, H }; +N l39n38[] = { { sIDB, .235 }, H }; +N l39n39[] = { { sgH, 1.316 }, { sCc9g, .353 }, H }; +N l39n40[] = { { scfa7, .407 }, { sgc8, .230 }, { sgcbc1G, .251 }, H }; +N l39n41[] = { { sHg, 1.880 }, { sgc4cfg, .543 }, { sccc5g, .494 }, H }; +N l39n43[] = { { sID, .188 }, { sHa6E, .235 }, H }; +N l39n44[] = { { scdc9, .251 }, { sAcfH, .329 }, { sc9ceF, .235 }, H }; +N l39n45[] = { { sCcf, 1.034 }, { scfc7cf, .658 }, H }; +N l39n46[] = { { sa6E, .209 }, H }; +N l39n47[] = { { sc1A, .188 }, { sgcacf, .157 }, H }; +N l39n49[] = { { scfg, 2.820 }, { scfc0g, 1.058 }, H }; +N l39n51[] = { { sceBg, .494 }, H }; +N l39n53[] = { { scfcdFg, 1.034 }, { sgc2Fc4, .251 }, { scacf, .157 }, H }; +N l39n54[] = { { sAa6, .470 }, H }; +N l39n55[] = { { sKc1, .595 }, { sge7, .167 }, { sfaR, .219 }, { scfc4a6, .329 }, H }; +N l39n56[] = { { sc7cfg, .776 }, H }; +N l39n57[] = { { sgcec1g, .376 }, H }; +N l39n58[] = { { sa6g, 1.974 }, { sHc1g, .423 }, H }; +N l39n59[] = { { sOc9, .313 }, H }; +N l39n60[] = { { sHc9ce, .235 }, H }; +N l39n61[] = { { scfHcf, .235 }, H }; +N l39n62[] = { { sc7F, .157 }, H }; +N l39n63[] = { { sCc1, .721 }, { sgEc1, .157 }, H }; +N l39n64[] = { { sgcbcf, .188 }, H }; +N l39n65[] = { { sc4Fg, .353 }, H }; +N l39n67[] = { { sc1a4, .564 }, H }; +N l39n69[] = { { sAc5, .313 }, { sc5ca, .188 }, H }; +N l39n70[] = { { sga6g, .439 }, { sIcbc9, .282 }, { sFc4c5, .235 }, H }; +N l39n71[] = { { sgf7, .167 }, H }; +N l39n72[] = { { sIg, 1.175 }, { scfc7, .627 }, { sgc2a6cc, .209 }, { sc2a6cc, .235 }, H }; +N l39n73[] = { { sgHa6, .407 }, H }; +N l39n74[] = { { sgca, .125 }, H }; +N l39n75[] = { { scec9, .752 }, { sAc5C, .282 }, H }; +N l39n76[] = { { sDcf, .219 }, H }; +N l39n78[] = { { scbc9g, 1.128 }, H }; +N l39n79[] = { { sf1g, .329 }, { sc2c1, .219 }, { sa6ccIcb, .251 }, { sc4cecf, .235 }, H }; +N l39n81[] = { { sc1C, .501 }, H }; +N l39n83[] = { { sgAc9, .188 }, H }; +N l39n84[] = { { scbcf, .689 }, { sc9cdg, .353 }, H }; +N l39n86[] = { { sLc1, .157 }, H }; +N l39n87[] = { { se9g, .282 }, { sFcc, .157 }, H }; +N l39n88[] = { { scfH, 1.128 }, { sc8g, .658 }, { scea6g, .917 }, { scdFg, .776 }, H }; +N l39n89[] = { { sa7g, .345 }, H }; +N l39n90[] = { { sgK, .836 }, { sc9D, .251 }, H }; +N l39n91[] = { { sgcb, .543 }, { sAcfc4, .235 }, H }; +N l39n92[] = { { sc1cdg, .353 }, H }; +N l39n94[] = { { sc2Fc4c5, .313 }, H }; +N l39n95[] = { { sGc5g, .917 }, { sRg, .282 }, { sKcec1, .282 }, H }; +N l39n96[] = { { sc0g, 1.081 }, { scfc4c1, .235 }, H }; +N l39n97[] = { { sa6H, .355 }, H }; +N l39n98[] = { { sHc9, .721 }, { sgcdcf, .282 }, { sc1ccc5, .282 }, { sc1D, .188 }, H }; +N l39n99[] = { { sc1c4, .282 }, { sc8cfc4, .282 }, { sc5cece, .235 }, { sEcfCa6, .313 }, H }; +N l39n100[] = { { sEIg, 1.340 }, H }; +N l39n101[] = { { sEc9g, 1.128 }, { sgcec5g, .334 }, { sc9ceg, .423 }, { sOcfcc, .282 }, H }; +N l39n102[] = { { scbc1, .909 }, H }; +N l39n103[] = { { scec5g, .705 }, { sc5cc, .251 }, H }; +N l39n105[] = { { sa6c4c1, .188 }, H }; +N l39n106[] = { { sc4ce, .407 }, H }; +N l39n107[] = { { sc9E, .752 }, { sEcf, .721 }, H }; +N l39n108[] = { { sgcc, .188 }, { sc1Gc5g, .658 }, { sgDEcf, .292 }, H }; +N l39n109[] = { { sccc9g, .917 }, { scecb, .219 }, H }; +N l39n110[] = { { sDB, .533 }, H }; +N l39n111[] = { { sBg, 1.927 }, H }; +N l39n113[] = { { sEcfC, .423 }, { sc4Acf, .235 }, H }; +N l39n114[] = { { sgNcf, .470 }, H }; +N l39n115[] = { { scccf, .752 }, { sc1E, .501 }, H }; +N l39n116[] = { { sCa6, .439 }, { sccc0, .157 }, H }; +N l39n118[] = { { sc1Ec9g, .564 }, { seag, .235 }, H }; +N l39n119[] = { { sc9g, 3.760 }, { sceFg, .353 }, H }; +N l39n120[] = { { sc5cd, .282 }, H }; +N l39n122[] = { { scfHa6, .611 }, { sgfa, .251 }, { sgBcb, .282 }, H }; +N l39n123[] = { { sc4cf, 1.034 }, { sHa6c4, .611 }, { sgeb, .167 }, H }; +N l39n125[] = { { sgcd, .543 }, { sEc1, .721 }, H }; +N l39n127[] = { { sc1g, 3.854 }, H }; +N l39n129[] = { { sa6cecb, .188 }, H }; +N l39n130[] = { { sNcf, .533 }, { scfcccf, .470 }, { sCE, .282 }, H }; +N l39n131[] = { { sgOcf, .251 }, { sCc5, .188 }, H }; +N l39n132[] = { { sc2a6, .407 }, { sa6ca, .146 }, { scccfD, .235 }, H }; +N l39n133[] = { { sccc1, .439 }, H }; +N l39n134[] = { { sKg, .611 }, { sDEcf, .376 }, { sIDBg, .470 }, H }; +N l39n135[] = { { sgHg, .533 }, H }; +N l39n136[] = { { scfa7g, .635 }, { sEIDB, .313 }, H }; +N l39n137[] = { { sc5ce, .533 }, { sAc9, .282 }, H }; +N l39n139[] = { { scfK, .219 }, H }; +N l39n140[] = { { scfcb, .251 }, { sc4A, .219 }, { scdc9g, .494 }, { sc4cea6, .235 }, H }; +N l39n141[] = { { sc4c1, .627 }, { sgN, .376 }, { scfc7cfg, 1.034 }, H }; +N l39n142[] = { { sgce, .710 }, { sCg, .329 }, { sc1ccc9, .329 }, H }; +N l39n146[] = { { scdcf, .439 }, H }; +N l39n147[] = { { sCF, .251 }, { sDa6, .188 }, H }; +N l39n148[] = { { sHL, .157 }, H }; +N l39n149[] = { { sgAcf, .783 }, { sccB, .407 }, { sc1G, .345 }, { sa6cb, .146 }, { sgHa6c4, .251 }, H }; +N l39n150[] = { { scag, 1.128 }, H }; +N l39n151[] = { { sKc1g, .353 }, H }; +N l39n152[] = { { scbc1G, .329 }, H }; +N l39n153[] = { { sc4c1a4, .235 }, { sCcfc4, .235 }, H }; +N l39n155[] = { { scba6, .282 }, { sceceB, .282 }, H }; +N l39n157[] = { { scfcc, .627 }, H }; +N l39n158[] = { { sgO, .355 }, { sc9H, .345 }, { sgHc5, .188 }, { sEC, .157 }, H }; +N l39n159[] = { { sgcf, .334 }, { sc9c8, .219 }, H }; +N l39n160[] = { { scece, .282 }, H }; +N l39n161[] = { { sDE, .815 }, { sOcf, .345 }, H }; +N l39n162[] = { { sAa6c4, .376 }, { scccfHa6, .376 }, { sDcfc2, .235 }, H }; +N l39n163[] = { { sc3a6, .407 }, { sc2F, .407 }, { sIcb, .376 }, { sc1a4g, .846 }, H }; +N l39n164[] = { { scdc1, .313 }, H }; +N l39n165[] = { { sgKc1, .501 }, { sc5cag, .353 }, { sAc9E, .235 }, H }; +N l39n166[] = { { sa6cc, .418 }, { sc1H, .501 }, { sgcbc1, .282 }, { sIcbc9g, .564 }, H }; +N l39n167[] = { { sc1c8, .157 }, H }; +N l39n171[] = { { sc5cea6, .235 }, H }; +N l39n174[] = { { scfcd, .846 }, { sgee, .230 }, H }; +N l39n176[] = { { sgA, 1.546 }, { scccfH, .329 }, H }; +N l39n177[] = { { scecf, .439 }, { sgc1, .125 }, H }; +N l39n178[] = { { sEa6, .345 }, { sDF, .219 }, H }; +N l39n179[] = { { sc9EI, .376 }, { sOc1, .188 }, H }; +N l39n181[] = { { scbg, .517 }, H }; +N l39n182[] = { { sgAC, .564 }, H }; +N l39n183[] = { { sgCcf, .219 }, H }; +N l39n184[] = { { scfc4c9, .282 }, H }; +N l39n186[] = { { scca6, .407 }, { sgKg, .282 }, { scbF, .251 }, H }; +N l39n189[] = { { sFC, .188 }, H }; +N l39n190[] = { { sHa6c4c1, .313 }, { sgc4ce, .157 }, H }; +N l39n191[] = { { scfce, .282 }, H }; +N l39n193[] = { { sgB, .292 }, { sEc5, .376 }, { sa6Hg, .517 }, { sc9ca, .313 }, H }; +N l39n194[] = { { sgc2, .648 }, { sc4a6, .501 }, { sHc9g, .423 }, H }; +N l39n195[] = { { scec1, 1.253 }, H }; +N l39n197[] = { { sACc9, .329 }, { sccIcb, .282 }, H }; +N l39n198[] = { { scbc1g, .917 }, { scfHa6c4, .376 }, H }; +N l39n199[] = { { sCc9, .815 }, H }; +N l39n200[] = { { sHcf, .564 }, { sa6ce, .355 }, { sgDcf, .219 }, { sHa6cb, .282 }, { sgcdc1, .188 }, H }; +N l39n201[] = { { sgc4cf, .752 }, { sccc5, .376 }, H }; +N l39n202[] = { { sBcb, .313 }, { sgHc9, .251 }, H }; +N l39n204[] = { { sEg, .282 }, H }; +N l39n205[] = { { sc5C, .627 }, H }; +N l39n206[] = { { sDBg, 1.128 }, H }; +N l39n207[] = { { sFc4, .533 }, { scfO, .219 }, H }; +N l39n208[] = { { sgf0, .313 }, H }; +N l39n209[] = { { scfc0, .470 }, { sc4c5, .407 }, { sOc5ce, .282 }, H }; +N l39n210[] = { { sgC, .334 }, { sgNcfg, .501 }, { sc9cb, .376 }, { sgAa6, .376 }, { sOcfcccf, .376 }, H }; +N l39n211[] = { { sgc3, .292 }, { sceB, .282 }, H }; +N l39n212[] = { { sDH, .345 }, H }; +N l39n213[] = { { scfcdF, .517 }, H }; +N l39n214[] = { { sc5ceceB, .313 }, H }; +N l39n215[] = { { sc2c9, .282 }, { smg, .104 }, H }; +N l39n216[] = { { sc7cf, .658 }, { sNc5, .188 }, H }; +N l39n217[] = { { sgcec1, .564 }, { sgEcf, .251 }, { sc1K, .219 }, H }; +N l39n218[] = { { sHc1, .564 }, { sc1cb, .282 }, H }; +N l39n219[] = { { sc4cfg, 1.058 }, { scfHa6cb, .376 }, H }; +N l39n220[] = { { sc4g, .376 }, H }; +N l39n225[] = { { sc4F, .376 }, { sgf1, .167 }, H }; +N l39n226[] = { { sNcfg, .917 }, { sgS, .125 }, H }; +N l39n227[] = { { sgD, .940 }, { sc9cc, .407 }, H }; +N l39n228[] = { { sgc4, .982 }, { sgc2a6, .219 }, { sa6cag, .235 }, H }; +N l39n229[] = { { sDI, .219 }, { sccc1g, .494 }, H }; +N l39n230[] = { { sga6, .334 }, { sDc9, .188 }, H }; +N l39n231[] = { { sgOcfcc, .251 }, { sIcf, .157 }, { scbc1Gc5, .313 }, H }; +N l39n232[] = { { scfCcf, .517 }, H }; +N l39n233[] = { { sgc2F, .376 }, H }; +N l39n234[] = { { sc7c1, .345 }, H }; +N l39n235[] = { { sFg, 2.115 }, { sc1cc, .752 }, H }; +N l39n236[] = { { sDEc1, .282 }, H }; +N l39n238[] = { { scbc9, .783 }, { sa6ccI, .251 }, H }; +N l39n239[] = { { sAcf, 1.034 }, H }; +N l39n240[] = { { sa4E, .125 }, H }; +N l39n243[] = { { scdg, 1.457 }, { scfc2, .501 }, H }; +N l39n244[] = { { sgE, .668 }, { sc9cd, .219 }, H }; +N l39n245[] = { { sccBg, .423 }, { sHcfa7, .235 }, H }; +N l39n246[] = { { sc4AcfH, .313 }, { sDHa6, .235 }, H }; +N l39n247[] = { { sc8cf, .407 }, { sOc5, .313 }, H }; +N l39n248[] = { { scea6, .564 }, { scdF, .407 }, H }; +N l39n251[] = { { sc5g, 2.444 }, { sgAc1, .188 }, { sa6B, .125 }, { scfHc9, .282 }, { sceceBg, .470 }, H }; +N l39n252[] = { { sa4g, .439 }, { sc1cd, .219 }, { sDEcfC, .313 }, { sgc7cf, .157 }, H }; +N l39n253[] = { { sBce, .157 }, H }; +N l39n255[] = { { sGc5, .439 }, { sgDE, .376 }, { sc9c8g, .494 }, H }; + +D l39_d = { "ukrainian", "koi8-r", - { - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,0.001,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,0.001,W,0.001,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W, - W,W,W,W,W,0.001,W,W,0.001,0.007,W,W,W,W,W,W, - W,W,0.001,0.001,W,W,W,W,W,W,0.001,W,W,W,W,W, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y,Y, - Y,Y,Y,Y,0.023,Y,0.176,0.017,Y,Y,Y,Y,Y,Y,Y,Y, - Y,0.001,Y,Y,0.002,Y,Y,0.001,Y,Y,Y,Y,Y,Y,Y,Y, - 0.025,0.335,0.071,0.034,0.188,0.181,0.006,0.060,0.046,0.278,0.044,0.152,0.157,0.110,0.217,0.421, - 0.133,0.098,0.184,0.137,0.186,0.140,0.043,0.241,0.063,V,0.080,0.036,V,0.033,0.058,V, - V,0.031,0.011,0.003,0.016,0.011,0.001,0.013,0.001,0.026,0.006,0.015,0.014,0.005,0.023,0.030, - 0.021,0.016,0.020,0.028,0.026,0.009,0.001,0.016,V,V,0.019,0.004,V,0.001,0.008,V - }, - { - X,l39n1,X,l39n3,l39n4,l39n5,X,l39n7,X,X,l39n10,l39n11,l39n12,l39n13,l39n14,l39n15, - X,l39n17,l39n18,l39n19,l39n20,l39n21,l39n22,l39n23,X,l39n25,l39n26,X,l39n28,l39n29,l39n30,l39n31, - l39n32,l39n33,l39n34,l39n35,l39n36,l39n37,l39n38,l39n39,l39n40,l39n41,X,l39n43,l39n44,l39n45,l39n46,l39n47, - X,l39n49,X,l39n51,X,l39n53,l39n54,l39n55,l39n56,l39n57,l39n58,l39n59,l39n60,l39n61,l39n62,l39n63, - l39n64,l39n65,X,l39n67,X,l39n69,l39n70,l39n71,l39n72,l39n73,l39n74,l39n75,l39n76,X,l39n78,l39n79, - X,l39n81,X,l39n83,l39n84,X,l39n86,l39n87,l39n88,l39n89,l39n90,l39n91,l39n92,X,l39n94,l39n95, - l39n96,l39n97,l39n98,l39n99,l39n100,l39n101,l39n102,l39n103,X,l39n105,l39n106,l39n107,l39n108,l39n109,l39n110,l39n111, - X,l39n113,l39n114,l39n115,l39n116,X,l39n118,l39n119,l39n120,X,l39n122,l39n123,X,l39n125,X,l39n127, - X,l39n129,l39n130,l39n131,l39n132,l39n133,l39n134,l39n135,l39n136,l39n137,X,l39n139,l39n140,l39n141,l39n142,X, - X,X,l39n146,l39n147,l39n148,l39n149,l39n150,l39n151,l39n152,l39n153,X,l39n155,X,l39n157,l39n158,l39n159, - l39n160,l39n161,l39n162,l39n163,l39n164,l39n165,l39n166,l39n167,X,X,X,l39n171,X,X,l39n174,X, - l39n176,l39n177,l39n178,l39n179,X,l39n181,l39n182,l39n183,l39n184,X,l39n186,X,X,l39n189,l39n190,l39n191, - X,l39n193,l39n194,l39n195,X,l39n197,l39n198,l39n199,l39n200,l39n201,l39n202,X,l39n204,l39n205,l39n206,l39n207, - l39n208,l39n209,l39n210,l39n211,l39n212,l39n213,l39n214,l39n215,l39n216,l39n217,l39n218,l39n219,l39n220,X,X,X, - X,l39n225,l39n226,l39n227,l39n228,l39n229,l39n230,l39n231,l39n232,l39n233,l39n234,l39n235,l39n236,X,l39n238,l39n239, - l39n240,X,X,l39n243,l39n244,l39n245,l39n246,l39n247,l39n248,X,X,l39n251,l39n252,l39n253,X,l39n255 - } + { W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, 0.001, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, 0.001, W, 0.001, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, W, + W, W, W, W, W, 0.001, W, W, 0.001, 0.007, W, W, W, W, W, W, + W, W, 0.001, 0.001, W, W, W, W, W, W, 0.001, W, W, W, W, W, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, Y, + Y, Y, Y, Y, 0.023, Y, 0.176, 0.017, Y, Y, Y, Y, Y, Y, Y, Y, + Y, 0.001, Y, Y, 0.002, Y, Y, 0.001, Y, Y, Y, Y, Y, Y, Y, Y, + 0.025, 0.335, 0.071, 0.034, 0.188, 0.181, 0.006, 0.060, 0.046, 0.278, 0.044, 0.152, 0.157, 0.110, 0.217, 0.421, + 0.133, 0.098, 0.184, 0.137, 0.186, 0.140, 0.043, 0.241, 0.063, V, 0.080, 0.036, V, 0.033, 0.058, V, + V, 0.031, 0.011, 0.003, 0.016, 0.011, 0.001, 0.013, 0.001, 0.026, 0.006, 0.015, 0.014, 0.005, 0.023, 0.030, + 0.021, 0.016, 0.020, 0.028, 0.026, 0.009, 0.001, 0.016, V, V, 0.019, 0.004, V, 0.001, 0.008, V }, + { X, l39n1, X, l39n3, l39n4, l39n5, X, l39n7, X, X, l39n10, l39n11, l39n12, l39n13, l39n14, l39n15, + X, l39n17, l39n18, l39n19, l39n20, l39n21, l39n22, l39n23, X, l39n25, l39n26, X, l39n28, l39n29, l39n30, l39n31, + l39n32, l39n33, l39n34, l39n35, l39n36, l39n37, l39n38, l39n39, l39n40, l39n41, X, l39n43, l39n44, l39n45, l39n46, l39n47, + X, l39n49, X, l39n51, X, l39n53, l39n54, l39n55, l39n56, l39n57, l39n58, l39n59, l39n60, l39n61, l39n62, l39n63, + l39n64, l39n65, X, l39n67, X, l39n69, l39n70, l39n71, l39n72, l39n73, l39n74, l39n75, l39n76, X, l39n78, l39n79, + X, l39n81, X, l39n83, l39n84, X, l39n86, l39n87, l39n88, l39n89, l39n90, l39n91, l39n92, X, l39n94, l39n95, + l39n96, l39n97, l39n98, l39n99, l39n100, l39n101, l39n102, l39n103, X, l39n105, l39n106, l39n107, l39n108, l39n109, l39n110, l39n111, + X, l39n113, l39n114, l39n115, l39n116, X, l39n118, l39n119, l39n120, X, l39n122, l39n123, X, l39n125, X, l39n127, + X, l39n129, l39n130, l39n131, l39n132, l39n133, l39n134, l39n135, l39n136, l39n137, X, l39n139, l39n140, l39n141, l39n142, X, + X, X, l39n146, l39n147, l39n148, l39n149, l39n150, l39n151, l39n152, l39n153, X, l39n155, X, l39n157, l39n158, l39n159, + l39n160, l39n161, l39n162, l39n163, l39n164, l39n165, l39n166, l39n167, X, X, X, l39n171, X, X, l39n174, X, + l39n176, l39n177, l39n178, l39n179, X, l39n181, l39n182, l39n183, l39n184, X, l39n186, X, X, l39n189, l39n190, l39n191, + X, l39n193, l39n194, l39n195, X, l39n197, l39n198, l39n199, l39n200, l39n201, l39n202, X, l39n204, l39n205, l39n206, l39n207, + l39n208, l39n209, l39n210, l39n211, l39n212, l39n213, l39n214, l39n215, l39n216, l39n217, l39n218, l39n219, l39n220, X, X, X, + X, l39n225, l39n226, l39n227, l39n228, l39n229, l39n230, l39n231, l39n232, l39n233, l39n234, l39n235, l39n236, X, l39n238, l39n239, + l39n240, X, X, l39n243, l39n244, l39n245, l39n246, l39n247, l39n248, X, X, l39n251, l39n252, l39n253, X, l39n255 } }; - - - /////////////////////////////////////////////////////////////////////////////// // DETECTING FUNCTIONS /////////////////////////////////////////////////////////////////////////////// - - -static char valid_char_jump_table[256]= -{ - 0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 , - 0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 , - 0 ,0 ,1 ,0 ,0 ,0 ,1 ,1 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 , - 0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,0 ,1 , - 0 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 , - 1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,0 ,0 ,0 ,0 ,0 , - 1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 , - 1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,0 ,0 ,0 ,1 ,1 , - 1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 , - 1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 , - 1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 , - 1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 , - 1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 , - 1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 , - 1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 , - 1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 ,1 +static char valid_char_jump_table[256] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 1, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, + 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 }; #undef p #undef d @@ -18883,33 +18560,35 @@ static char valid_char_jump_table[256]= #undef k #undef f -static double score_for_ngram(DetectorDescriptor * d,const unsigned char * ngram) +static double score_for_ngram(DetectorDescriptor * d, const unsigned char * ngram) { - const unsigned char * p = ngram; - int xhash = *p * 31; - p++; - xhash += *p * 17; + const unsigned char * p = ngram; + int xhash = *p * 31; + p++; + xhash += *p * 17; + p++; + if(*p) + { + xhash += *p * 11; p++; if(*p) { - xhash += *p * 11; - p++; - if(*p) - { - xhash += *p * 3; - } + xhash += *p * 3; } - DetectorNGram * g = d->ngram_hash[xhash % 256]; - while(g->szNGram) - { - if(strcmp((const char *)ngram,(const char *)g->szNGram) == 0){ /*printf("GOT NGRAM %s SCORE %f\n",ngram,g->dScore);*/ return g->dScore; } - g++; + } + DetectorNGram * g = d->ngram_hash[xhash % 256]; + while(g->szNGram) + { + if(strcmp((const char *)ngram, (const char *)g->szNGram) == 0) + { /*printf("GOT NGRAM %s SCORE %f\n",ngram,g->dScore);*/ + return g->dScore; } - return 0.0; + g++; + } + return 0.0; } - -static double compute_descriptor_score(const unsigned char * data,DetectorDescriptor * d) +static double compute_descriptor_score(const unsigned char * data, DetectorDescriptor * d) { double dRet = 0.0; //unsigned char x[256]; @@ -18953,10 +18632,11 @@ static double compute_descriptor_score(const unsigned char * data,DetectorDescri // now by hash...this is hard p = data; unsigned char buffer[1024]; // we handle words up to 1024 chars - buffer[0] = ' '; // we always start with a space + buffer[0] = ' '; // we always start with a space while(*p) { - while(*p && !valid_char_jump_table[*p])p++; + while(*p && !valid_char_jump_table[*p]) + p++; int idx = 1; while(valid_char_jump_table[*p] && (idx < 1022)) { @@ -18974,16 +18654,16 @@ static double compute_descriptor_score(const unsigned char * data,DetectorDescri unsigned char save = *r; *r = 0; // 4 letters ngram - unsigned char * begin = r-4; + unsigned char * begin = r - 4; if(begin >= buffer) - dRet += score_for_ngram(d,begin); + dRet += score_for_ngram(d, begin); // 3 letters ngram begin++; if(begin >= buffer) - dRet += score_for_ngram(d,begin); + dRet += score_for_ngram(d, begin); // 2 letters ngram begin++; - dRet += score_for_ngram(d,begin); + dRet += score_for_ngram(d, begin); *r = save; r++; } @@ -18993,17 +18673,20 @@ static double compute_descriptor_score(const unsigned char * data,DetectorDescri #define NUM_DESCRIPTORS 40 -static DetectorDescriptor * all_descriptors[NUM_DESCRIPTORS]= -{ - &l0_d,&l1_d,&l2_d,&l3_d,&l4_d,&l5_d,&l6_d,&l7_d,&l8_d,&l9_d, - &l10_d,&l11_d,&l12_d,&l13_d,&l14_d,&l15_d,&l16_d,&l17_d,&l18_d,&l19_d, - &l20_d,&l21_d,&l22_d,&l23_d,&l24_d,&l25_d,&l26_d,&l27_d,&l28_d,&l29_d, - &l30_d,&l31_d,&l32_d,&l33_d,&l34_d,&l35_d,&l36_d,&l37_d,&l38_d,&l39_d +static DetectorDescriptor * all_descriptors[NUM_DESCRIPTORS] = { + &l0_d, &l1_d, &l2_d, &l3_d, &l4_d, &l5_d, &l6_d, &l7_d, &l8_d, &l9_d, + &l10_d, &l11_d, &l12_d, &l13_d, &l14_d, &l15_d, &l16_d, &l17_d, &l18_d, &l19_d, + &l20_d, &l21_d, &l22_d, &l23_d, &l24_d, &l25_d, &l26_d, &l27_d, &l28_d, &l29_d, + &l30_d, &l31_d, &l32_d, &l33_d, &l34_d, &l35_d, &l36_d, &l37_d, &l38_d, &l39_d }; - -#define NEED_ONE_CHAR p++; if(*p < 0x80){ score--; return score; /* error */ } - +#define NEED_ONE_CHAR \ + p++; \ + if(*p < 0x80) \ + { \ + score--; \ + return score; /* error */ \ + } static int utf8score(const unsigned char * p) { @@ -19014,20 +18697,23 @@ static int utf8score(const unsigned char * p) if(*p < 0x80) { p++; - } else if((*p & 0xe0) == 0xc0) + } + else if((*p & 0xe0) == 0xc0) { // 2 bytes encoding NEED_ONE_CHAR p++; highchars++; - } else if((*p & 0xf0) == 0xe0) + } + else if((*p & 0xf0) == 0xe0) { // 3 bytes encoding NEED_ONE_CHAR NEED_ONE_CHAR p++; highchars++; - } else if((*p & 0xf8) == 0xf0) + } + else if((*p & 0xf8) == 0xf0) { // 4 bytes encoding NEED_ONE_CHAR @@ -19035,28 +18721,31 @@ static int utf8score(const unsigned char * p) NEED_ONE_CHAR p++; highchars++; - } else { + } + else + { score--; - if(score < -50)return score; + if(score < -50) + return score; p++; } } if(score >= 0) { score = highchars / 10; - if(score > 50)score = 50; + if(score > 50) + score = 50; } return score; } - static const char * unknown_string = "?"; -void detect_language_and_encoding(const char * data,LanguageAndEncodingResult * retBuffer,int iFlags = 0) +void detect_language_and_encoding(const char * data, LanguageAndEncodingResult * retBuffer, int iFlags = 0) { int i; DetectorDescriptor * match[DLE_NUM_BEST_MATCHES]; - for(i=0;imatch[i].szLanguage = 0; retBuffer->match[i].szEncoding = 0; @@ -19066,29 +18755,33 @@ void detect_language_and_encoding(const char * data,LanguageAndEncodingResult * retBuffer->dAccuracy = 0.0; int utf8 = utf8score((const unsigned char *)data); - i=0; - while(iszEncoding,"utf8") == 0) || (strcmp(all_descriptors[i]->szEncoding,"utf-8") == 0)); + bool bIsUtf8 = ((strcmp(all_descriptors[i]->szEncoding, "utf8") == 0) || (strcmp(all_descriptors[i]->szEncoding, "utf-8") == 0)); if((!bIsUtf8) || (!(iFlags & DLE_STRICT_UTF8_CHECKING))) { - double dThis = compute_descriptor_score((const unsigned char *)data,all_descriptors[i]); + double dThis = compute_descriptor_score((const unsigned char *)data, all_descriptors[i]); if(bIsUtf8) { dThis *= 1.0 + (((double)utf8) * 0.01); - } else { - if(utf8 < 0)dThis *= 1.1; // probably it is not utf8... - else if(utf8 > 10)dThis *= 0.95; // might be utf8...privilege it + } + else + { + if(utf8 < 0) + dThis *= 1.1; // probably it is not utf8... + else if(utf8 > 10) + dThis *= 0.95; // might be utf8...privilege it } // update best matches - for(int j=0;j retBuffer->match[j].dScore) { - for(int k=DLE_NUM_BEST_MATCHES-1;k>j;k--) + for(int k = DLE_NUM_BEST_MATCHES - 1; k > j; k--) { - retBuffer->match[k].dScore = retBuffer->match[k-1].dScore; - match[k] = match[k-1]; + retBuffer->match[k].dScore = retBuffer->match[k - 1].dScore; + match[k] = match[k - 1]; } retBuffer->match[j].dScore = dThis; match[j] = all_descriptors[i]; @@ -19101,7 +18794,7 @@ void detect_language_and_encoding(const char * data,LanguageAndEncodingResult * // compute accuracy and adjust language and encoding names double dScoreDiff = 0.0; double dTheoricMax = 0.0; - for(i=0;i 0) { @@ -19111,8 +18804,10 @@ void detect_language_and_encoding(const char * data,LanguageAndEncodingResult * retBuffer->match[i].szLanguage = match[i] ? match[i]->szLanguage : unknown_string; retBuffer->match[i].szEncoding = match[i] ? match[i]->szEncoding : unknown_string; } - if(dTheoricMax > 0.0001)retBuffer->dAccuracy = 100.0 * dScoreDiff / dTheoricMax; - else retBuffer->dAccuracy = 0.0; + if(dTheoricMax > 0.0001) + retBuffer->dAccuracy = 100.0 * dScoreDiff / dTheoricMax; + else + retBuffer->dAccuracy = 0.0; } /* @@ -19133,4 +18828,3 @@ int main(int argc,char ** argv) return 0; } */ - diff --git a/src/modules/language/detector.h b/src/modules/language/detector.h index eedf2303b..7ed71bb6c 100644 --- a/src/modules/language/detector.h +++ b/src/modules/language/detector.h @@ -37,9 +37,9 @@ typedef struct _LanguageAndEncodingMatch typedef struct _LanguageAndEncodingResult { LanguageAndEncodingMatch match[DLE_NUM_BEST_MATCHES]; // the first best matches - double dAccuracy; // accuracy score: from 0 to 100 + double dAccuracy; // accuracy score: from 0 to 100 } LanguageAndEncodingResult; -void detect_language_and_encoding(const char * data,LanguageAndEncodingResult * retBuffer,int iFlags); +void detect_language_and_encoding(const char * data, LanguageAndEncodingResult * retBuffer, int iFlags); #endif //_DETECTOR_H_ diff --git a/src/modules/language/libkvilanguage.cpp b/src/modules/language/libkvilanguage.cpp index cd287ff03..6d5ea426d 100644 --- a/src/modules/language/libkvilanguage.cpp +++ b/src/modules/language/libkvilanguage.cpp @@ -61,43 +61,45 @@ [/example] */ - static bool language_kvs_cmd_detect(KviKvsModuleFunctionCall * c) { QString text, error; - KviKvsArray *matches; + KviKvsArray * matches; KviKvsHash *match, *ret; LanguageAndEncodingResult r; - int matchcount=DLE_NUM_BEST_MATCHES; + int matchcount = DLE_NUM_BEST_MATCHES; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("text",KVS_PT_STRING,KVS_PF_OPTIONAL,text) + KVSM_PARAMETER("text", KVS_PT_STRING, KVS_PF_OPTIONAL, text) KVSM_PARAMETERS_END(c) //on error we return an empty array matches = new KviKvsArray(); - if(text.isEmpty()){ + if(text.isEmpty()) + { error = "err_notext"; matchcount = 0; - } else { - detect_language_and_encoding(text.toUtf8().data(),&r,0); + } + else + { + detect_language_and_encoding(text.toUtf8().data(), &r, 0); - for(int i=0;iset("language",new KviKvsVariant(QString(r.match[i].szLanguage))); - match->set("encoding",new KviKvsVariant(r.match[i].szEncoding)); - match->set("score",new KviKvsVariant((kvs_real_t)r.match[i].dScore)); + match->set("language", new KviKvsVariant(QString(r.match[i].szLanguage))); + match->set("encoding", new KviKvsVariant(r.match[i].szEncoding)); + match->set("score", new KviKvsVariant((kvs_real_t)r.match[i].dScore)); matches->set(i, new KviKvsVariant(match)); } } ret = new KviKvsHash(); - ret->set("matches",new KviKvsVariant(matches)); - ret->set("matchcount",new KviKvsVariant((kvs_int_t)matchcount)); - ret->set("error",new KviKvsVariant(error)); - ret->set("accuracy",new KviKvsVariant((kvs_real_t)r.dAccuracy)); + ret->set("matches", new KviKvsVariant(matches)); + ret->set("matchcount", new KviKvsVariant((kvs_int_t)matchcount)); + ret->set("error", new KviKvsVariant(error)); + ret->set("accuracy", new KviKvsVariant((kvs_real_t)r.dAccuracy)); c->returnValue()->setHash(ret); @@ -106,7 +108,7 @@ static bool language_kvs_cmd_detect(KviKvsModuleFunctionCall * c) static bool language_module_init(KviModule * m) { - KVSM_REGISTER_FUNCTION(m,"detect",language_kvs_cmd_detect); + KVSM_REGISTER_FUNCTION(m, "detect", language_kvs_cmd_detect); return true; } @@ -116,13 +118,12 @@ static bool language_module_cleanup(KviModule *) } KVIRC_MODULE( - "Language", // module name - "4.0.0", // module version - "Copyright (C) 2004 Szymon Stefanek (pragma at kvirc dot net)", // author & (C) - "A simple statistical language/encoding detector", - language_module_init, - 0, - 0, - language_module_cleanup, - 0 -) + "Language", // module name + "4.0.0", // module version + "Copyright (C) 2004 Szymon Stefanek (pragma at kvirc dot net)", // author & (C) + "A simple statistical language/encoding detector", + language_module_init, + 0, + 0, + language_module_cleanup, + 0) diff --git a/src/modules/links/LinksWindow.cpp b/src/modules/links/LinksWindow.cpp index 772406a1f..c29bd1ede 100644 --- a/src/modules/links/LinksWindow.cpp +++ b/src/modules/links/LinksWindow.cpp @@ -45,11 +45,11 @@ extern KviPointerList * g_pLinksWindowList; LinksWindow::LinksWindow(KviConsoleWindow * lpConsole) -: KviWindow(KviWindow::Links,"links",lpConsole), KviExternalServerDataParser() + : KviWindow(KviWindow::Links, "links", lpConsole), KviExternalServerDataParser() { g_pLinksWindowList->append(this); - m_pTopSplitter = new KviTalSplitter(Qt::Horizontal,this); + m_pTopSplitter = new KviTalSplitter(Qt::Horizontal, this); m_pTopSplitter->setObjectName("top_splitter"); m_pTopSplitter->setChildrenCollapsible(false); @@ -58,38 +58,38 @@ LinksWindow::LinksWindow(KviConsoleWindow * lpConsole) m_pRequestButton = new QToolButton(box); m_pRequestButton->setObjectName("request_button"); - m_pRequestButton->setIconSize(QSize(16,16)); + m_pRequestButton->setIconSize(QSize(16, 16)); m_pRequestButton->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Update))); - connect(m_pRequestButton,SIGNAL(clicked()),this,SLOT(requestLinks())); + connect(m_pRequestButton, SIGNAL(clicked()), this, SLOT(requestLinks())); m_pRequestButton->setToolTip(__tr2qs("Request links")); QLabel * l = new QLabel(box); - box->setStretchFactor(l,1); + box->setStretchFactor(l, 1); m_pInfoLabel = new KviThemedLabel(m_pTopSplitter, this, "info_label"); - connect(lpConsole->context(),SIGNAL(stateChanged()), - this,SLOT(connectionStateChange())); + connect(lpConsole->context(), SIGNAL(stateChanged()), + this, SLOT(connectionStateChange())); - m_pSplitter = new KviTalSplitter(Qt::Horizontal,this); + m_pSplitter = new KviTalSplitter(Qt::Horizontal, this); m_pSplitter->setObjectName("splitter"); m_pSplitter->setChildrenCollapsible(false); - m_pVertSplitter = new KviTalSplitter(Qt::Vertical,m_pSplitter); + m_pVertSplitter = new KviTalSplitter(Qt::Vertical, m_pSplitter); m_pVertSplitter->setObjectName("vsplitter"); m_pVertSplitter->setChildrenCollapsible(false); - m_pListView = new LinksListView(m_pVertSplitter, this, "links_treewidget"); + m_pListView = new LinksListView(m_pVertSplitter, this, "links_treewidget"); - connect(m_pListView,SIGNAL(rightButtonPressed(QTreeWidgetItem *,const QPoint &)), - this,SLOT(showHostPopup(QTreeWidgetItem *,const QPoint &))); + connect(m_pListView, SIGNAL(rightButtonPressed(QTreeWidgetItem *, const QPoint &)), + this, SLOT(showHostPopup(QTreeWidgetItem *, const QPoint &))); - m_pIrcView = new KviIrcView(m_pVertSplitter,this); + m_pIrcView = new KviIrcView(m_pVertSplitter, this); m_pLinkList = new KviPointerList; m_pLinkList->setAutoDelete(true); m_pHostPopup = new QMenu(); - connect(m_pHostPopup,SIGNAL(triggered(QAction*)),this,SLOT(hostPopupClicked(QAction *))); + connect(m_pHostPopup, SIGNAL(triggered(QAction *)), this, SLOT(hostPopupClicked(QAction *))); connectionStateChange(); @@ -106,9 +106,9 @@ LinksWindow::~LinksWindow() delete m_pHostPopup; } -void LinksWindow::getBaseLogFileName(QString &buffer) +void LinksWindow::getBaseLogFileName(QString & buffer) { - buffer.sprintf("LINKS_%d",context()->id()); + buffer.sprintf("LINKS_%d", context()->id()); } void LinksWindow::requestLinks() @@ -116,10 +116,12 @@ void LinksWindow::requestLinks() if(m_pConsole->isConnected()) { m_pConsole->connection()->sendFmtData("links"); - outputNoFmt(KVI_OUT_SYSTEMMESSAGE,__tr2qs("Sent links request, waiting for reply...")); + outputNoFmt(KVI_OUT_SYSTEMMESSAGE, __tr2qs("Sent links request, waiting for reply...")); m_pRequestButton->setEnabled(false); - } else { - outputNoFmt(KVI_OUT_SYSTEMERROR,__tr2qs("Can't request links: no active connection")); + } + else + { + outputNoFmt(KVI_OUT_SYSTEMERROR, __tr2qs("Can't request links: no active connection")); } } @@ -129,9 +131,11 @@ void LinksWindow::connectionStateChange() m_pRequestButton->setEnabled(st == KviIrcContext::Connected); if(st == KviIrcContext::Connected) { - QString szTmp = QString(__tr2qs("Connected to %1 (%2)")).arg(m_pConsole->connection()->currentServerName(),m_pConsole->currentNetworkName()); + QString szTmp = QString(__tr2qs("Connected to %1 (%2)")).arg(m_pConsole->connection()->currentServerName(), m_pConsole->currentNetworkName()); m_pInfoLabel->setText(szTmp); - } else { + } + else + { m_pInfoLabel->setText(__tr2qs("Links can't be requested: not connected to a server")); } } @@ -144,14 +148,14 @@ QPixmap * LinksWindow::myIconPtr() void LinksWindow::resizeEvent(QResizeEvent *) { int hght2 = m_pTopSplitter->sizeHint().height(); - m_pTopSplitter->setGeometry(0,0,width(),hght2); - m_pSplitter->setGeometry(0,hght2,width(),height() - hght2); + m_pTopSplitter->setGeometry(0, 0, width(), hght2); + m_pSplitter->setGeometry(0, hght2, width(), height() - hght2); } QSize LinksWindow::sizeHint() const { QSize ret(m_pSplitter->sizeHint().width(), - m_pSplitter->sizeHint().height() + m_pTopSplitter->sizeHint().height()); + m_pSplitter->sizeHint().height() + m_pTopSplitter->sizeHint().height()); return ret; } @@ -169,8 +173,12 @@ void LinksWindow::control(int message) { switch(message) { - case EXTERNAL_SERVER_DATA_PARSER_CONTROL_RESET: reset(); break; - case EXTERNAL_SERVER_DATA_PARSER_CONTROL_ENDOFDATA: endOfLinks(); break; + case EXTERNAL_SERVER_DATA_PARSER_CONTROL_RESET: + reset(); + break; + case EXTERNAL_SERVER_DATA_PARSER_CONTROL_ENDOFDATA: + endOfLinks(); + break; } } @@ -181,74 +189,90 @@ void LinksWindow::endOfLinks() m_pListView->clear(); //m_pListView->setSorting(-1); - outputNoFmt(KVI_OUT_SYSTEMMESSAGE,"======================"); - outputNoFmt(KVI_OUT_SYSTEMMESSAGE,__tr2qs("Received end of links.")); - outputNoFmt(KVI_OUT_SYSTEMMESSAGE,"======================"); + outputNoFmt(KVI_OUT_SYSTEMMESSAGE, "======================"); + outputNoFmt(KVI_OUT_SYSTEMMESSAGE, __tr2qs("Received end of links.")); + outputNoFmt(KVI_OUT_SYSTEMMESSAGE, "======================"); - QTreeWidgetItem * it = 0; + QTreeWidgetItem * it = 0; QTreeWidgetItem * root = 0; - int totalHosts = 0; - int totalHops = 0; - int maxHops = 0; - int avgHops = 0; + int totalHosts = 0; + int totalHops = 0; + int maxHops = 0; + int avgHops = 0; int directLinks = 0; - int nearLinks = 0; + int nearLinks = 0; int brokenLinks = 0; - int maxLinks = 0; - int farLinks = 0; + int maxLinks = 0; + int farLinks = 0; int wildServers = 0; - KviCString szMaxHop,szMaxLinks; + KviCString szMaxHop, szMaxLinks; m_pListView->setUpdatesEnabled(false); - for(KviLink *l=m_pLinkList->first();l;l=m_pLinkList->next()){ + for(KviLink * l = m_pLinkList->first(); l; l = m_pLinkList->next()) + { totalHosts++; if(l->hops == 0) { root = new QTreeWidgetItem(m_pListView); - root->setText(0,QString(l->host.ptr())); - root->setText(1,QString("0")); - root->setText(2,QString(l->description.ptr())); - } else { + root->setText(0, QString(l->host.ptr())); + root->setText(1, QString("0")); + root->setText(2, QString(l->description.ptr())); + } + else + { totalHops += l->hops; - if(l->hops < 4){ + if(l->hops < 4) + { nearLinks++; - if(l->hops == 1)directLinks++; - } else { - if(l->hops >= 7)farLinks++; + if(l->hops == 1) + directLinks++; + } + else + { + if(l->hops >= 7) + farLinks++; } - if(l->hops == maxHops){ + if(l->hops == maxHops) + { szMaxHop.append(','); szMaxHop.append(l->host); - } else if(l->hops > maxHops){ + } + else if(l->hops > maxHops) + { maxHops = l->hops; szMaxHop = l->host; } - if(l->host.contains('*'))wildServers++; + if(l->host.contains('*')) + wildServers++; it = insertLink(l); if(!it) { - output(KVI_OUT_SYSTEMERROR,__tr2qs("Broken link: missing parent (%s) for %s (%d hops): %s (used /LINKS ?)"), - l->parent.ptr(),l->host.ptr(),l->hops,l->description.ptr()); + output(KVI_OUT_SYSTEMERROR, __tr2qs("Broken link: missing parent (%s) for %s (%d hops): %s (used /LINKS ?)"), + l->parent.ptr(), l->host.ptr(), l->hops, l->description.ptr()); brokenLinks++; - QString szTmp = QString(__tr2qs("%1: Parent link %2")).arg(l->description.ptr(),l->parent.ptr()); - KviCString tmp2(KviCString::Format,"%d",l->hops); + QString szTmp = QString(__tr2qs("%1: Parent link %2")).arg(l->description.ptr(), l->parent.ptr()); + KviCString tmp2(KviCString::Format, "%d", l->hops); if(root) { it = new QTreeWidgetItem(root); - it->setText(0,QString(l->host.ptr())); - it->setText(1,QString(tmp2.ptr())); - it->setText(2,szTmp); - } else { - outputNoFmt(KVI_OUT_SYSTEMERROR,__tr2qs("Warning: no root link was sent by the server, the stats may be invalid.")); + it->setText(0, QString(l->host.ptr())); + it->setText(1, QString(tmp2.ptr())); + it->setText(2, szTmp); + } + else + { + outputNoFmt(KVI_OUT_SYSTEMERROR, __tr2qs("Warning: no root link was sent by the server, the stats may be invalid.")); it = new QTreeWidgetItem(m_pListView); - it->setText(0,QString(l->host.ptr())); - it->setText(1,QString(tmp2.ptr())); - it->setText(2,szTmp); + it->setText(0, QString(l->host.ptr())); + it->setText(1, QString(tmp2.ptr())); + it->setText(2, szTmp); } - } else { - it = (QTreeWidgetItem*) it->parent(); + } + else + { + it = (QTreeWidgetItem *)it->parent(); if(it) { int links = it->childCount() + 1; @@ -256,7 +280,8 @@ void LinksWindow::endOfLinks() { szMaxLinks.append(','); szMaxLinks.append(it->text(0)); - } else if(links > maxLinks) + } + else if(links > maxLinks) { maxLinks = links; szMaxLinks = it->text(0); @@ -266,163 +291,179 @@ void LinksWindow::endOfLinks() } } - avgHops = ((totalHosts > 0) ? ((totalHops * 100) / totalHosts) : 0 ); + avgHops = ((totalHosts > 0) ? ((totalHops * 100) / totalHosts) : 0); int nearProcent = ((totalHosts > 0) ? ((nearLinks * 10000) / totalHosts) : 0); int directProcent = ((totalHosts > 0) ? ((directLinks * 10000) / totalHosts) : 0); int midLinks = totalHosts - (farLinks + nearLinks + 1 + brokenLinks); - if(midLinks < 0)midLinks = 0; + if(midLinks < 0) + midLinks = 0; int midProcent = ((totalHosts > 0) ? ((midLinks * 10000) / totalHosts) : 0); int farProcent = ((totalHosts > 0) ? ((farLinks * 10000) / totalHosts) : 0); - outputNoFmt(KVI_OUT_LINKS,"======================"); + outputNoFmt(KVI_OUT_LINKS, "======================"); -// if(!root)root = m_pListView->firstChild(); + // if(!root)root = m_pListView->firstChild(); if(root) { m_szRootServer = root->text(0); - output(KVI_OUT_LINKS,__tr2qs("%c%cLinks for %Q"),KviControlCodes::Bold,KviControlCodes::Underline,&m_szRootServer); - outputNoFmt(KVI_OUT_LINKS,"======================"); + output(KVI_OUT_LINKS, __tr2qs("%c%cLinks for %Q"), KviControlCodes::Bold, KviControlCodes::Underline, &m_szRootServer); + outputNoFmt(KVI_OUT_LINKS, "======================"); QString tmpo = wildServers ? __tr2qs("Total hosts listed") : __tr2qs("Total hosts in the network"); - output(KVI_OUT_LINKS,"%Q: %d",&tmpo,totalHosts); - if(wildServers)output(KVI_OUT_LINKS,__tr2qs("Wildcard servers (hubs?): %d"),wildServers); - output(KVI_OUT_LINKS,__tr2qs("Direct links: %d (~%d.%d %)"),directLinks,directProcent / 100, directProcent % 100); - output(KVI_OUT_LINKS,__tr2qs("Close links (1 <= hops <= 3): %d (~%d.%d %)"),nearLinks,nearProcent / 100,nearProcent % 100); - output(KVI_OUT_LINKS,__tr2qs("Mid-range links (4 <= hops <= 6): %d (~%d.%d %)"),midLinks,midProcent / 100,midProcent % 100); - output(KVI_OUT_LINKS,__tr2qs("Distant links (7 <= hops): %d (~%d.%d %)"),farLinks,farProcent / 100,farProcent % 100); - output(KVI_OUT_LINKS,__tr2qs("Broken (unknown) links: %d"),brokenLinks); - output(KVI_OUT_LINKS,__tr2qs("Maximum links per host: %d [%s]"),maxLinks,szMaxLinks.ptr()); - output(KVI_OUT_LINKS,__tr2qs("Total links: %d"),totalHops); - output(KVI_OUT_LINKS,__tr2qs("Maximum hops: %d [%s]"),maxHops,szMaxHop.ptr()); - output(KVI_OUT_LINKS,__tr2qs("Average hops: ~%d.%d"),avgHops / 100,avgHops % 100); - } else { + output(KVI_OUT_LINKS, "%Q: %d", &tmpo, totalHosts); + if(wildServers) + output(KVI_OUT_LINKS, __tr2qs("Wildcard servers (hubs?): %d"), wildServers); + output(KVI_OUT_LINKS, __tr2qs("Direct links: %d (~%d.%d %)"), directLinks, directProcent / 100, directProcent % 100); + output(KVI_OUT_LINKS, __tr2qs("Close links (1 <= hops <= 3): %d (~%d.%d %)"), nearLinks, nearProcent / 100, nearProcent % 100); + output(KVI_OUT_LINKS, __tr2qs("Mid-range links (4 <= hops <= 6): %d (~%d.%d %)"), midLinks, midProcent / 100, midProcent % 100); + output(KVI_OUT_LINKS, __tr2qs("Distant links (7 <= hops): %d (~%d.%d %)"), farLinks, farProcent / 100, farProcent % 100); + output(KVI_OUT_LINKS, __tr2qs("Broken (unknown) links: %d"), brokenLinks); + output(KVI_OUT_LINKS, __tr2qs("Maximum links per host: %d [%s]"), maxLinks, szMaxLinks.ptr()); + output(KVI_OUT_LINKS, __tr2qs("Total links: %d"), totalHops); + output(KVI_OUT_LINKS, __tr2qs("Maximum hops: %d [%s]"), maxHops, szMaxHop.ptr()); + output(KVI_OUT_LINKS, __tr2qs("Average hops: ~%d.%d"), avgHops / 100, avgHops % 100); + } + else + { m_szRootServer = __tr2qs("(Unknown)"); - outputNoFmt(KVI_OUT_LINKS,__tr2qs("Incomplete links result, no stats available")); + outputNoFmt(KVI_OUT_LINKS, __tr2qs("Incomplete links result, no stats available")); } - outputNoFmt(KVI_OUT_LINKS,"======================"); + outputNoFmt(KVI_OUT_LINKS, "======================"); updateCaption(); - - while(!m_pLinkList->isEmpty())m_pLinkList->removeFirst(); + while(!m_pLinkList->isEmpty()) + m_pLinkList->removeFirst(); m_pListView->resizeColumnToContents(0); m_pListView->setUpdatesEnabled(true); m_pListView->repaint(); } -QTreeWidgetItem * LinksWindow::insertLink(KviLink *l) +QTreeWidgetItem * LinksWindow::insertLink(KviLink * l) { KVI_ASSERT(l->hops > 0); - QTreeWidgetItem * i = getItemByHost(l->parent.ptr(),0); + QTreeWidgetItem * i = getItemByHost(l->parent.ptr(), 0); QTreeWidgetItem * it = 0; if(!i) { return 0; - } else { - KviCString hops(KviCString::Format,"%d",l->hops); + } + else + { + KviCString hops(KviCString::Format, "%d", l->hops); it = new QTreeWidgetItem(i); - it->setText(0,QString(l->host.ptr())); - it->setText(1,QString(hops.ptr())); - it->setText(2,QString(l->description.ptr())); + it->setText(0, QString(l->host.ptr())); + it->setText(1, QString(hops.ptr())); + it->setText(2, QString(l->description.ptr())); i->setExpanded(true); } return it; } -QTreeWidgetItem * LinksWindow::getItemByHost(const char *host,QTreeWidgetItem * par) +QTreeWidgetItem * LinksWindow::getItemByHost(const char * host, QTreeWidgetItem * par) { KviCString tmp; if(par) { - for(int i=0;ichildCount();i++) + for(int i = 0; i < par->childCount(); i++) { tmp = par->child(i)->text(0); - if(kvi_strEqualCI(tmp.ptr(),host))return par->child(i); - QTreeWidgetItem * ch = getItemByHost(host,par->child(i)); - if(ch)return ch; + if(kvi_strEqualCI(tmp.ptr(), host)) + return par->child(i); + QTreeWidgetItem * ch = getItemByHost(host, par->child(i)); + if(ch) + return ch; } - } else { - for(int i=0;itopLevelItemCount();i++) + } + else + { + for(int i = 0; i < m_pListView->topLevelItemCount(); i++) { tmp = m_pListView->topLevelItem(i)->text(0); - if(kvi_strEqualCI(tmp.ptr(),host))return m_pListView->topLevelItem(i); - QTreeWidgetItem * ch = getItemByHost(host,m_pListView->topLevelItem(i)); - if(ch)return ch; + if(kvi_strEqualCI(tmp.ptr(), host)) + return m_pListView->topLevelItem(i); + QTreeWidgetItem * ch = getItemByHost(host, m_pListView->topLevelItem(i)); + if(ch) + return ch; } } return 0; } -void LinksWindow::showHostPopup(QTreeWidgetItem *i,const QPoint &p) +void LinksWindow::showHostPopup(QTreeWidgetItem * i, const QPoint & p) { - if(!i)return; - KviCString host=i->text(0); - if(host.isEmpty())return; + if(!i) + return; + KviCString host = i->text(0); + if(host.isEmpty()) + return; m_pHostPopup->clear(); - KviCString tmp(KviCString::Format,"LINKS %s *",host.ptr()); - m_pHostPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::Links)),tmp.ptr()); + KviCString tmp(KviCString::Format, "LINKS %s *", host.ptr()); + m_pHostPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::Links)), tmp.ptr()); m_pHostPopup->addSeparator(); - tmp.sprintf("TIME %s",host.ptr()); - m_pHostPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::Time)),tmp.ptr()); - tmp.sprintf("ADMIN %s",host.ptr()); - m_pHostPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::ChanUnOwner)),tmp.ptr()); - tmp.sprintf("INFO %s",host.ptr()); - m_pHostPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::ServerInfo)),tmp.ptr()); - tmp.sprintf("MOTD %s",host.ptr()); - m_pHostPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::Motd)),tmp.ptr()); - tmp.sprintf("VERSION %s",host.ptr()); - m_pHostPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::KVIrc)),tmp.ptr()); - tmp.sprintf("TRACE %s",host.ptr()); - m_pHostPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::ServerPing)),tmp.ptr()); - tmp.sprintf("USERS %s",host.ptr()); - m_pHostPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::User)),tmp.ptr()); + tmp.sprintf("TIME %s", host.ptr()); + m_pHostPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::Time)), tmp.ptr()); + tmp.sprintf("ADMIN %s", host.ptr()); + m_pHostPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::ChanUnOwner)), tmp.ptr()); + tmp.sprintf("INFO %s", host.ptr()); + m_pHostPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::ServerInfo)), tmp.ptr()); + tmp.sprintf("MOTD %s", host.ptr()); + m_pHostPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::Motd)), tmp.ptr()); + tmp.sprintf("VERSION %s", host.ptr()); + m_pHostPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::KVIrc)), tmp.ptr()); + tmp.sprintf("TRACE %s", host.ptr()); + m_pHostPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::ServerPing)), tmp.ptr()); + tmp.sprintf("USERS %s", host.ptr()); + m_pHostPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::User)), tmp.ptr()); m_pHostPopup->addSeparator(); - tmp.sprintf("STATS c %s",host.ptr()); - m_pHostPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::Stats)),tmp.ptr()); - tmp.sprintf("STATS d %s",host.ptr()); - m_pHostPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::Stats)),tmp.ptr()); - tmp.sprintf("STATS h %s",host.ptr()); - m_pHostPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::Stats)),tmp.ptr()); - tmp.sprintf("STATS i %s",host.ptr()); - m_pHostPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::Stats)),tmp.ptr()); - tmp.sprintf("STATS k %s",host.ptr()); - m_pHostPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::Stats)),tmp.ptr()); - tmp.sprintf("STATS l %s",host.ptr()); - m_pHostPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::Stats)),tmp.ptr()); - tmp.sprintf("STATS m %s",host.ptr()); - m_pHostPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::Stats)),tmp.ptr()); - tmp.sprintf("STATS o %s",host.ptr()); - m_pHostPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::Stats)),tmp.ptr()); - tmp.sprintf("STATS t %s",host.ptr()); - m_pHostPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::Stats)),tmp.ptr()); - tmp.sprintf("STATS u %s",host.ptr()); - m_pHostPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::Stats)),tmp.ptr()); - tmp.sprintf("STATS y %s",host.ptr()); - m_pHostPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::Stats)),tmp.ptr()); - tmp.sprintf("STATS z %s",host.ptr()); - m_pHostPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::Stats)),tmp.ptr()); + tmp.sprintf("STATS c %s", host.ptr()); + m_pHostPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::Stats)), tmp.ptr()); + tmp.sprintf("STATS d %s", host.ptr()); + m_pHostPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::Stats)), tmp.ptr()); + tmp.sprintf("STATS h %s", host.ptr()); + m_pHostPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::Stats)), tmp.ptr()); + tmp.sprintf("STATS i %s", host.ptr()); + m_pHostPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::Stats)), tmp.ptr()); + tmp.sprintf("STATS k %s", host.ptr()); + m_pHostPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::Stats)), tmp.ptr()); + tmp.sprintf("STATS l %s", host.ptr()); + m_pHostPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::Stats)), tmp.ptr()); + tmp.sprintf("STATS m %s", host.ptr()); + m_pHostPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::Stats)), tmp.ptr()); + tmp.sprintf("STATS o %s", host.ptr()); + m_pHostPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::Stats)), tmp.ptr()); + tmp.sprintf("STATS t %s", host.ptr()); + m_pHostPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::Stats)), tmp.ptr()); + tmp.sprintf("STATS u %s", host.ptr()); + m_pHostPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::Stats)), tmp.ptr()); + tmp.sprintf("STATS y %s", host.ptr()); + m_pHostPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::Stats)), tmp.ptr()); + tmp.sprintf("STATS z %s", host.ptr()); + m_pHostPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::Stats)), tmp.ptr()); m_pHostPopup->popup(p); } -void LinksWindow::hostPopupClicked(QAction *pAction) +void LinksWindow::hostPopupClicked(QAction * pAction) { - KviCString tmp = pAction->text(); + KviCString tmp = pAction->text(); if(tmp.hasData()) { - if(!connection())output(KVI_OUT_SYSTEMERROR,__tr2qs("You're not connected to a server")); + if(!connection()) + output(KVI_OUT_SYSTEMERROR, __tr2qs("You're not connected to a server")); m_pConsole->connection()->sendData(tmp.ptr()); } } void LinksWindow::reset() { - outputNoFmt(KVI_OUT_SYSTEMMESSAGE,__tr2qs("Reset")); - while(!m_pLinkList->isEmpty())m_pLinkList->removeFirst(); + outputNoFmt(KVI_OUT_SYSTEMMESSAGE, __tr2qs("Reset")); + while(!m_pLinkList->isEmpty()) + m_pLinkList->removeFirst(); } -void LinksWindow::processData(KviIrcMessage *msg) +void LinksWindow::processData(KviIrcMessage * msg) { - output(KVI_OUT_SYSTEMMESSAGE,__tr2qs("Processing link: %s"),msg->allParams()); + output(KVI_OUT_SYSTEMMESSAGE, __tr2qs("Processing link: %s"), msg->allParams()); KviLink * l = new KviLink; l->host = msg->safeParam(1); @@ -432,22 +473,26 @@ void LinksWindow::processData(KviIrcMessage *msg) if(isdigit(*tr)) { - const char *aux = tr; - while(*tr && (isdigit(*tr)))tr++; - KviCString tmp(aux,tr - aux); + const char * aux = tr; + while(*tr && (isdigit(*tr))) + tr++; + KviCString tmp(aux, tr - aux); l->hops = tmp.toInt(); - } else { - outputNoFmt(KVI_OUT_SYSTEMERROR,__tr2qs("Broken message syntax, can't extract hops number, assuming 0")); + } + else + { + outputNoFmt(KVI_OUT_SYSTEMERROR, __tr2qs("Broken message syntax, can't extract hops number, assuming 0")); l->hops = 0; } - while(*tr && (*tr == ' '))tr++; + while(*tr && (*tr == ' ')) + tr++; l->description = tr; - uint idx=0; - for(KviLink *m=m_pLinkList->first();m;m=m_pLinkList->next()) + uint idx = 0; + for(KviLink * m = m_pLinkList->first(); m; m = m_pLinkList->next()) { if(m->hops >= l->hops) { - m_pLinkList->insert(idx,l); + m_pLinkList->insert(idx, l); return; } idx++; @@ -464,7 +509,7 @@ void LinksWindow::applyOptions() } LinksListView::LinksListView(QWidget * par, KviWindow * wnd, const char * txt) -: KviThemedTreeWidget(par, wnd, txt) + : KviThemedTreeWidget(par, wnd, txt) { header()->setSortIndicatorShown(true); setColumnCount(3); @@ -475,12 +520,13 @@ LinksListView::LinksListView(QWidget * par, KviWindow * wnd, const char * txt) setAllColumnsShowFocus(true); } -void LinksListView::mousePressEvent (QMouseEvent *e) +void LinksListView::mousePressEvent(QMouseEvent * e) { - if (e->button() == Qt::RightButton) + if(e->button() == Qt::RightButton) { - QTreeWidgetItem *i=itemAt(e->pos()); - if (i) emit rightButtonPressed(i,QCursor::pos()); + QTreeWidgetItem * i = itemAt(e->pos()); + if(i) + emit rightButtonPressed(i, QCursor::pos()); } KviThemedTreeWidget::mousePressEvent(e); } diff --git a/src/modules/links/LinksWindow.h b/src/modules/links/LinksWindow.h index 1a9faddb8..7f991b8bd 100644 --- a/src/modules/links/LinksWindow.h +++ b/src/modules/links/LinksWindow.h @@ -51,10 +51,11 @@ class LinksListView : public KviThemedTreeWidget public: LinksListView(QWidget * par, KviWindow * wnd, const char * txt); ~LinksListView(){}; + protected: - void mousePressEvent (QMouseEvent *e); + void mousePressEvent(QMouseEvent * e); signals: - void rightButtonPressed(QTreeWidgetItem *,QPoint); + void rightButtonPressed(QTreeWidgetItem *, QPoint); }; class LinksWindow : public KviWindow, public KviExternalServerDataParser @@ -63,37 +64,42 @@ class LinksWindow : public KviWindow, public KviExternalServerDataParser public: LinksWindow(KviConsoleWindow * lpConsole); ~LinksWindow(); + protected: - QSplitter * m_pVertSplitter; - QSplitter * m_pTopSplitter; - LinksListView * m_pListView; + QSplitter * m_pVertSplitter; + QSplitter * m_pTopSplitter; + LinksListView * m_pListView; KviPointerList * m_pLinkList; - QMenu * m_pHostPopup; - QString m_szRootServer; - QToolButton * m_pRequestButton; - KviThemedLabel * m_pInfoLabel; + QMenu * m_pHostPopup; + QString m_szRootServer; + QToolButton * m_pRequestButton; + KviThemedLabel * m_pInfoLabel; + public: // Methods virtual void control(int msg); virtual void processData(KviIrcMessage * msg); virtual void die(); + protected: virtual QPixmap * myIconPtr(); virtual void fillCaptionBuffers(); virtual void applyOptions(); - virtual void resizeEvent(QResizeEvent *e); - virtual void getBaseLogFileName(QString &buffer); + virtual void resizeEvent(QResizeEvent * e); + virtual void getBaseLogFileName(QString & buffer); protected slots: - void showHostPopup(QTreeWidgetItem *i,const QPoint &p); - void hostPopupClicked(QAction *pAction); + void showHostPopup(QTreeWidgetItem * i, const QPoint & p); + void hostPopupClicked(QAction * pAction); void requestLinks(); void connectionStateChange(); + public: virtual QSize sizeHint() const; + private: void reset(); void endOfLinks(); QTreeWidgetItem * insertLink(KviLink * l); - QTreeWidgetItem * getItemByHost(const char *host,QTreeWidgetItem * par); + QTreeWidgetItem * getItemByHost(const char * host, QTreeWidgetItem * par); }; #endif //_KVI_LINKSWINDOW_H_ diff --git a/src/modules/links/libkvilinks.cpp b/src/modules/links/libkvilinks.cpp index 523f40470..b35d9a846 100644 --- a/src/modules/links/libkvilinks.cpp +++ b/src/modules/links/libkvilinks.cpp @@ -33,7 +33,6 @@ KviPointerList * g_pLinksWindowList = 0; - /* @doc: links.open @type: @@ -63,13 +62,16 @@ static bool links_kvs_cmd_open(KviKvsModuleCommandCall * c) { // FIND ME - if(!c->window()->context())return c->context()->errorNoIrcContext(); + if(!c->window()->context()) + return c->context()->errorNoIrcContext(); if(!(c->window()->context()->linksWindow())) { - LinksWindow *w = new LinksWindow(c->window()->console()); + LinksWindow * w = new LinksWindow(c->window()->console()); g_pMainWindow->addWindow(w); - } else { + } + else + { c->warning(__tr2qs("Links window already open for this IRC context")); } @@ -81,8 +83,7 @@ static bool links_module_init(KviModule * m) g_pLinksWindowList = new KviPointerList; g_pLinksWindowList->setAutoDelete(false); - - KVSM_REGISTER_SIMPLE_COMMAND(m,"open",links_kvs_cmd_open); + KVSM_REGISTER_SIMPLE_COMMAND(m, "open", links_kvs_cmd_open); return true; } @@ -102,13 +103,12 @@ static bool links_module_can_unload(KviModule *) } KVIRC_MODULE( - "Links", // module name - "4.0.0", // module version - "Copyright (C) 2000-2010 Szymon Stefanek (pragma at kvirc dot net)", // author & (C) - "Links window extension", - links_module_init, - links_module_can_unload, - 0, - links_module_cleanup, - 0 -) + "Links", // module name + "4.0.0", // module version + "Copyright (C) 2000-2010 Szymon Stefanek (pragma at kvirc dot net)", // author & (C) + "Links window extension", + links_module_init, + links_module_can_unload, + 0, + links_module_cleanup, + 0) diff --git a/src/modules/list/ListWindow.cpp b/src/modules/list/ListWindow.cpp index 4ecc0e729..c323d12cd 100644 --- a/src/modules/list/ListWindow.cpp +++ b/src/modules/list/ListWindow.cpp @@ -66,9 +66,8 @@ ChannelTreeWidgetItemData::~ChannelTreeWidgetItemData() { } - ChannelTreeWidgetItem::ChannelTreeWidgetItem(ChannelTreeWidgetItemData * pData) -: QTreeWidgetItem(), m_pData(pData) + : QTreeWidgetItem(), m_pData(pData) { setToolTip(0, KviQString::toHtmlEscaped(m_pData->m_szChan)); setToolTip(1, KviQString::toHtmlEscaped(m_pData->m_szUsers)); @@ -85,22 +84,22 @@ bool ChannelTreeWidgetItem::operator<(const QTreeWidgetItem & other) const { case 0: //channel - return m_pData->m_szChan.toUpper() < ((ChannelTreeWidgetItem*)&other)->itemData()->m_szChan.toUpper(); + return m_pData->m_szChan.toUpper() < ((ChannelTreeWidgetItem *)&other)->itemData()->m_szChan.toUpper(); break; case 1: //users - return m_pData->m_szUsers.toInt() < ((ChannelTreeWidgetItem*)&other)->itemData()->m_szUsers.toInt(); + return m_pData->m_szUsers.toInt() < ((ChannelTreeWidgetItem *)&other)->itemData()->m_szUsers.toInt(); break; case 2: default: //topic - return KviControlCodes::stripControlBytes(m_pData->m_szTopic.toUpper()) < KviControlCodes::stripControlBytes(((ChannelTreeWidgetItem*)&other)->itemData()->m_szTopic.toUpper()); + return KviControlCodes::stripControlBytes(m_pData->m_szTopic.toUpper()) < KviControlCodes::stripControlBytes(((ChannelTreeWidgetItem *)&other)->itemData()->m_szTopic.toUpper()); break; } } ChannelTreeWidgetItemDelegate::ChannelTreeWidgetItemDelegate(QTreeWidget * pWidget) -: QItemDelegate(pWidget) + : QItemDelegate(pWidget) { } @@ -110,16 +109,16 @@ ChannelTreeWidgetItemDelegate::~ChannelTreeWidgetItemDelegate() #define BORDER 2 -QSize ChannelTreeWidgetItemDelegate::sizeHint( const QStyleOptionViewItem &sovItem, const QModelIndex &index) const +QSize ChannelTreeWidgetItemDelegate::sizeHint(const QStyleOptionViewItem & sovItem, const QModelIndex & index) const { - ChannelTreeWidget* treeWidget = (ChannelTreeWidget*)parent(); + ChannelTreeWidget * treeWidget = (ChannelTreeWidget *)parent(); - int iHeight=treeWidget->fontMetrics().lineSpacing() + BORDER + BORDER; + int iHeight = treeWidget->fontMetrics().lineSpacing() + BORDER + BORDER; - ChannelTreeWidgetItem * item = dynamic_cast(treeWidget->itemFromIndex(index)); + ChannelTreeWidgetItem * item = dynamic_cast(treeWidget->itemFromIndex(index)); if(!item) - return QSize(100,iHeight); + return QSize(100, iHeight); QFontMetrics fm(sovItem.font); switch(index.column()) @@ -146,10 +145,10 @@ QSize ChannelTreeWidgetItemDelegate::sizeHint( const QStyleOptionViewItem &sovIt void ChannelTreeWidgetItemDelegate::paint(QPainter * p, const QStyleOptionViewItem & option, const QModelIndex & index) const { - ChannelTreeWidgetItem* obj = static_cast(index.internalPointer()); + ChannelTreeWidgetItem * obj = static_cast(index.internalPointer()); - if (option.state & QStyle::State_Selected) - p->fillRect(option.rect, option.palette.brush( QPalette::Highlight ) ); + if(option.state & QStyle::State_Selected) + p->fillRect(option.rect, option.palette.brush(QPalette::Highlight)); //reset the color p->setPen(option.palette.text().color()); @@ -167,13 +166,13 @@ void ChannelTreeWidgetItemDelegate::paint(QPainter * p, const QStyleOptionViewIt case 2: default: //topic - KviTopicWidget::paintColoredText(p,obj->itemData()->m_szTopic,option.palette,option.rect); + KviTopicWidget::paintColoredText(p, obj->itemData()->m_szTopic, option.palette, option.rect); break; } } ListWindow::ListWindow(KviConsoleWindow * lpConsole) -: KviWindow(KviWindow::List,"list",lpConsole), KviExternalServerDataParser() + : KviWindow(KviWindow::List, "list", lpConsole), KviExternalServerDataParser() { g_pListWindowList->append(this); @@ -182,13 +181,13 @@ ListWindow::ListWindow(KviConsoleWindow * lpConsole) m_pItemList = new KviPointerList; m_pItemList->setAutoDelete(false); - m_pSplitter = new KviTalSplitter(Qt::Horizontal,this); + m_pSplitter = new KviTalSplitter(Qt::Horizontal, this); m_pSplitter->setObjectName("splitter"); m_pSplitter->setChildrenCollapsible(false); - m_pTopSplitter = new KviTalSplitter(Qt::Horizontal,this); + m_pTopSplitter = new KviTalSplitter(Qt::Horizontal, this); m_pTopSplitter->setObjectName("top_splitter"); m_pTopSplitter->setChildrenCollapsible(false); - m_pVertSplitter = new KviTalSplitter(Qt::Vertical,m_pSplitter); + m_pVertSplitter = new KviTalSplitter(Qt::Vertical, m_pSplitter); m_pVertSplitter->setObjectName("vsplitter"); m_pVertSplitter->setChildrenCollapsible(false); @@ -198,44 +197,44 @@ ListWindow::ListWindow(KviConsoleWindow * lpConsole) m_pOpenButton = new QToolButton(pBox); m_pOpenButton->setObjectName("import_list"); - m_pOpenButton->setIconSize(QSize(16,16)); + m_pOpenButton->setIconSize(QSize(16, 16)); m_pOpenButton->setIcon(QIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Folder)))); - KviTalToolTip::add(m_pOpenButton,__tr2qs("Import list")); - connect(m_pOpenButton,SIGNAL(clicked()),this,SLOT(importList())); + KviTalToolTip::add(m_pOpenButton, __tr2qs("Import list")); + connect(m_pOpenButton, SIGNAL(clicked()), this, SLOT(importList())); m_pSaveButton = new QToolButton(pBox); m_pSaveButton->setObjectName("export_list"); - m_pSaveButton->setIconSize(QSize(16,16)); + m_pSaveButton->setIconSize(QSize(16, 16)); m_pSaveButton->setIcon(QIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Save)))); - KviTalToolTip::add(m_pSaveButton,__tr2qs("Export list")); - connect(m_pSaveButton,SIGNAL(clicked()),this,SLOT(exportList())); + KviTalToolTip::add(m_pSaveButton, __tr2qs("Export list")); + connect(m_pSaveButton, SIGNAL(clicked()), this, SLOT(exportList())); m_pRequestButton = new QToolButton(pBox); m_pRequestButton->setObjectName("request_button"); - m_pRequestButton->setIconSize(QSize(16,16)); + m_pRequestButton->setIconSize(QSize(16, 16)); m_pRequestButton->setIcon(QIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Update)))); - KviTalToolTip::add(m_pRequestButton,__tr2qs("Request list")); - connect(m_pRequestButton,SIGNAL(clicked()),this,SLOT(requestList())); + KviTalToolTip::add(m_pRequestButton, __tr2qs("Request list")); + connect(m_pRequestButton, SIGNAL(clicked()), this, SLOT(requestList())); m_pStopListDownloadButton = new QToolButton(pBox); m_pStopListDownloadButton->setObjectName("stoplistdownload_button"); - m_pStopListDownloadButton->setIconSize(QSize(16,16)); + m_pStopListDownloadButton->setIconSize(QSize(16, 16)); m_pStopListDownloadButton->setIcon(QIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Discard)))); - KviTalToolTip::add(m_pStopListDownloadButton,__tr2qs("Stop list download")); - connect(m_pStopListDownloadButton,SIGNAL(clicked()),this,SLOT(stoplistdownload())); + KviTalToolTip::add(m_pStopListDownloadButton, __tr2qs("Stop list download")); + connect(m_pStopListDownloadButton, SIGNAL(clicked()), this, SLOT(stoplistdownload())); m_pParamsEdit = new KviThemedLineEdit(pBox, this, "lineedit"); - pBox->setStretchFactor(m_pParamsEdit,1); - KviTalToolTip::add(m_pParamsEdit,__tr2qs("/LIST command parameters:
Many servers accept special parameters that " \ - "allow you to filter the returned entries.
" \ - "Commonly, masked channel names (*kvirc*) are accepted as parameters, as well as strings " \ - "like c<n or c>n where n is the minimum or maximum of users on the channel.")); + pBox->setStretchFactor(m_pParamsEdit, 1); + KviTalToolTip::add(m_pParamsEdit, __tr2qs("/LIST command parameters:
Many servers accept special parameters that " + "allow you to filter the returned entries.
" + "Commonly, masked channel names (*kvirc*) are accepted as parameters, as well as strings " + "like c<n or c>n where n is the minimum or maximum of users on the channel.")); - connect(m_pParamsEdit,SIGNAL(textEdited(const QString &)),this,SLOT(liveSearch(const QString &))); + connect(m_pParamsEdit, SIGNAL(textEdited(const QString &)), this, SLOT(liveSearch(const QString &))); m_pInfoLabel = new KviThemedLabel(m_pTopSplitter, this, "info_label"); - m_pTreeWidget = new ChannelTreeWidget(m_pVertSplitter, this, "list_treewidget"); + m_pTreeWidget = new ChannelTreeWidget(m_pVertSplitter, this, "list_treewidget"); m_pTreeWidget->setSelectionBehavior(QAbstractItemView::SelectRows); m_pTreeWidget->setSelectionMode(QAbstractItemView::SingleSelection); m_pTreeWidget->setItemDelegate(new ChannelTreeWidgetItemDelegate(m_pTreeWidget)); @@ -247,23 +246,23 @@ ListWindow::ListWindow(KviConsoleWindow * lpConsole) m_pTreeWidget->setHeaderLabels(columnLabels); m_pTreeWidget->setAllColumnsShowFocus(true); m_pTreeWidget->setSortingEnabled(true); - m_pTreeWidget->sortItems(0,Qt::AscendingOrder); + m_pTreeWidget->sortItems(0, Qt::AscendingOrder); m_pTreeWidget->setUniformRowHeights(true); m_pTreeWidget->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded); m_pTreeWidget->setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded); m_pTreeWidget->header()->setStretchLastSection(false); - m_pTreeWidget->header()->resizeSection(0,150); - m_pTreeWidget->header()->resizeSection(1,80); - m_pTreeWidget->header()->resizeSection(2,450); + m_pTreeWidget->header()->resizeSection(0, 150); + m_pTreeWidget->header()->resizeSection(1, 80); + m_pTreeWidget->header()->resizeSection(2, 450); //m_pTreeWidget->header()->setResizeMode(QHeaderView::ResizeToContents); <-- this is too heavy for single-core machines... - connect(m_pTreeWidget,SIGNAL(itemDoubleClicked(QTreeWidgetItem *, int)),this,SLOT(itemDoubleClicked(QTreeWidgetItem *, int))); + connect(m_pTreeWidget, SIGNAL(itemDoubleClicked(QTreeWidgetItem *, int)), this, SLOT(itemDoubleClicked(QTreeWidgetItem *, int))); - m_pIrcView = new KviIrcView(m_pVertSplitter,this); + m_pIrcView = new KviIrcView(m_pVertSplitter, this); m_pConsole->context()->setListWindowPointer(this); - connect(m_pConsole->context(),SIGNAL(stateChanged()),this,SLOT(connectionStateChange())); + connect(m_pConsole->context(), SIGNAL(stateChanged()), this, SLOT(connectionStateChange())); connectionStateChange(); } @@ -281,7 +280,7 @@ ListWindow::~ListWindow() void ListWindow::getBaseLogFileName(QString & szBuffer) { - szBuffer.sprintf("LIST_%d",context()->id()); + szBuffer.sprintf("LIST_%d", context()->id()); } void ListWindow::requestList() @@ -291,15 +290,18 @@ void ListWindow::requestList() KviCString parms = m_pParamsEdit->text(); if(parms.isEmpty()) m_pConsole->connection()->sendFmtData("list"); - else { + else + { m_pParamsEdit->setText(""); - m_pConsole->connection()->sendFmtData("list %s",m_pConsole->connection()->encodeText(parms.ptr()).data()); + m_pConsole->connection()->sendFmtData("list %s", m_pConsole->connection()->encodeText(parms.ptr()).data()); } - outputNoFmt(KVI_OUT_SYSTEMMESSAGE,__tr2qs("Sent list request: waiting for reply...")); + outputNoFmt(KVI_OUT_SYSTEMMESSAGE, __tr2qs("Sent list request: waiting for reply...")); m_pRequestButton->setEnabled(false); - } else { - outputNoFmt(KVI_OUT_SYSTEMERROR,__tr2qs("Can't request list: no active connection")); + } + else + { + outputNoFmt(KVI_OUT_SYSTEMERROR, __tr2qs("Can't request list: no active connection")); } } @@ -308,9 +310,11 @@ void ListWindow::stoplistdownload() if(m_pConsole->isConnected()) { m_pConsole->connection()->sendFmtData("list stoplistdownloadnow"); - outputNoFmt(KVI_OUT_SYSTEMMESSAGE,__tr2qs("Stopping the list download...")); //G&N mar 2005 - } else { - outputNoFmt(KVI_OUT_SYSTEMERROR,__tr2qs("Can't stop list download: no active connection.")); + outputNoFmt(KVI_OUT_SYSTEMMESSAGE, __tr2qs("Stopping the list download...")); //G&N mar 2005 + } + else + { + outputNoFmt(KVI_OUT_SYSTEMERROR, __tr2qs("Can't stop list download: no active connection.")); } } @@ -320,11 +324,11 @@ void ListWindow::connectionStateChange() m_pRequestButton->setEnabled(st == KviIrcContext::Connected); if(st == KviIrcContext::Connected) { - QString szTmp = QString(__tr2qs("Connected to %1 (%2)")).arg( - m_pConsole->connection()->currentServerName(), - m_pConsole->currentNetworkName()); + QString szTmp = QString(__tr2qs("Connected to %1 (%2)")).arg(m_pConsole->connection()->currentServerName(), m_pConsole->currentNetworkName()); m_pInfoLabel->setText(szTmp); - } else { + } + else + { m_pInfoLabel->setText(__tr2qs("List can't be requested: not connected to a server")); } } @@ -337,8 +341,8 @@ QPixmap * ListWindow::myIconPtr() void ListWindow::resizeEvent(QResizeEvent *) { int iHeight = m_pTopSplitter->sizeHint().height(); - m_pTopSplitter->setGeometry(0,0,width(),iHeight); - m_pSplitter->setGeometry(0,iHeight,width(),height() - iHeight); + m_pTopSplitter->setGeometry(0, 0, width(), iHeight); + m_pSplitter->setGeometry(0, iHeight, width(), height() - iHeight); } QSize ListWindow::sizeHint() const @@ -386,27 +390,29 @@ void ListWindow::exportList() szDate = date.toString(Qt::SystemLocaleShortDate); break; } - szFile = QString(__tr2qs("Channel list for %1 - %2")).arg(connection()->currentNetworkName(),szDate); - } else { + szFile = QString(__tr2qs("Channel list for %1 - %2")).arg(connection()->currentNetworkName(), szDate); + } + else + { szFile = __tr2qs("Channel list"); } - if(KviFileDialog::askForSaveFileName(szFile,__tr2qs("Enter a Filename - KVIrc"),szFile,__tr2qs("Configuration files (*.kvc)"),false,false,true,this)) + if(KviFileDialog::askForSaveFileName(szFile, __tr2qs("Enter a Filename - KVIrc"), szFile, __tr2qs("Configuration files (*.kvc)"), false, false, true, this)) { if(QFileInfo(szFile).completeSuffix() != "kvc") szFile.append(".kvc"); - KviConfigurationFile cfg(szFile,KviConfigurationFile::Write); + KviConfigurationFile cfg(szFile, KviConfigurationFile::Write); cfg.clear(); ChannelTreeWidgetItem * it; - for(int i=0; i < m_pTreeWidget->topLevelItemCount(); i++) + for(int i = 0; i < m_pTreeWidget->topLevelItemCount(); i++) { it = (ChannelTreeWidgetItem *)m_pTreeWidget->topLevelItem(i); cfg.setGroup(it->itemData()->m_szChan); // Write properties - cfg.writeEntry("topic",it->itemData()->m_szTopic); - cfg.writeEntry("users",it->itemData()->m_szUsers); + cfg.writeEntry("topic", it->itemData()->m_szTopic); + cfg.writeEntry("users", it->itemData()->m_szUsers); } } } @@ -415,7 +421,7 @@ void ListWindow::importList() { QString szFile; - if(KviFileDialog::askForOpenFileName(szFile,__tr2qs("Select a File - KVIrc"),QString(),KVI_FILTER_CONFIG,false,false,this)) + if(KviFileDialog::askForOpenFileName(szFile, __tr2qs("Select a File - KVIrc"), QString(), KVI_FILTER_CONFIG, false, false, this)) { m_pItemList->setAutoDelete(true); @@ -424,19 +430,16 @@ void ListWindow::importList() m_pTreeWidget->clear(); - - KviConfigurationFile cfg(szFile,KviConfigurationFile::Read); + KviConfigurationFile cfg(szFile, KviConfigurationFile::Read); KviConfigurationFileIterator it(*cfg.dict()); while(it.current()) { cfg.setGroup(it.currentKey()); m_pItemList->append( - new ChannelTreeWidgetItemData( - it.currentKey(), - cfg.readEntry("users","0"), - cfg.readEntry("topic","") - ) - ); + new ChannelTreeWidgetItemData( + it.currentKey(), + cfg.readEntry("users", "0"), + cfg.readEntry("topic", ""))); ++it; } flush(); @@ -449,19 +452,19 @@ void ListWindow::control(int iMsg) { case EXTERNAL_SERVER_DATA_PARSER_CONTROL_RESET: reset(); - break; + break; case EXTERNAL_SERVER_DATA_PARSER_CONTROL_STARTOFDATA: startOfList(); - break; + break; case EXTERNAL_SERVER_DATA_PARSER_CONTROL_ENDOFDATA: endOfList(); - break; + break; } } void ListWindow::reset() { - outputNoFmt(KVI_OUT_SYSTEMMESSAGE,__tr2qs("Reset")); + outputNoFmt(KVI_OUT_SYSTEMMESSAGE, __tr2qs("Reset")); } void ListWindow::endOfList() @@ -472,7 +475,7 @@ void ListWindow::endOfList() m_pFlushTimer = 0; } m_pRequestButton->setEnabled(true); - outputNoFmt(KVI_OUT_SYSTEMMESSAGE,__tr2qs("Channels list download finished")); + outputNoFmt(KVI_OUT_SYSTEMMESSAGE, __tr2qs("Channels list download finished")); flush(); // give it the last kick } @@ -489,17 +492,18 @@ void ListWindow::startOfList() void ListWindow::liveSearch(const QString & szText) { - QRegExp res(szText,Qt::CaseInsensitive,QRegExp::Wildcard); + QRegExp res(szText, Qt::CaseInsensitive, QRegExp::Wildcard); - ChannelTreeWidgetItem * pItem=0; - for(int i=0; itopLevelItemCount(); i++) + ChannelTreeWidgetItem * pItem = 0; + for(int i = 0; i < m_pTreeWidget->topLevelItemCount(); i++) { - pItem = (ChannelTreeWidgetItem*) m_pTreeWidget->topLevelItem(i); - if(pItem->itemData()->m_szChan.contains(res) || - pItem->itemData()->m_szTopic.contains(res)) + pItem = (ChannelTreeWidgetItem *)m_pTreeWidget->topLevelItem(i); + if(pItem->itemData()->m_szChan.contains(res) || pItem->itemData()->m_szTopic.contains(res)) { pItem->setHidden(false); - } else { + } + else + { pItem->setHidden(true); } } @@ -510,7 +514,7 @@ void ListWindow::processData(KviIrcMessage * pMsg) if(!m_pFlushTimer) { m_pFlushTimer = new QTimer(this); - connect(m_pFlushTimer,SIGNAL(timeout()),this,SLOT(flush())); + connect(m_pFlushTimer, SIGNAL(timeout()), this, SLOT(flush())); m_pFlushTimer->start(1000); m_pRequestButton->setEnabled(false); } @@ -518,33 +522,30 @@ void ListWindow::processData(KviIrcMessage * pMsg) if(m_pParamsEdit->text().isEmpty()) { m_pItemList->append( - new ChannelTreeWidgetItemData( - pMsg->connection()->decodeText(pMsg->safeParam(1)), - pMsg->connection()->decodeText(pMsg->safeParam(2)), - pMsg->connection()->decodeText(pMsg->safeTrailing())) - ); - } else { + new ChannelTreeWidgetItemData( + pMsg->connection()->decodeText(pMsg->safeParam(1)), + pMsg->connection()->decodeText(pMsg->safeParam(2)), + pMsg->connection()->decodeText(pMsg->safeTrailing()))); + } + else + { //rfc2812 permits wildcards here (section 3.2.6) - QRegExp res(m_pParamsEdit->text(),Qt::CaseInsensitive,QRegExp::Wildcard); + QRegExp res(m_pParamsEdit->text(), Qt::CaseInsensitive, QRegExp::Wildcard); if( - res.exactMatch(pMsg->connection()->decodeText(pMsg->safeParam(1))) || - res.exactMatch(pMsg->connection()->decodeText(pMsg->safeTrailing())) - ) + res.exactMatch(pMsg->connection()->decodeText(pMsg->safeParam(1))) || res.exactMatch(pMsg->connection()->decodeText(pMsg->safeTrailing()))) { m_pItemList->append( - new ChannelTreeWidgetItemData( - pMsg->connection()->decodeText(pMsg->safeParam(1)), - pMsg->connection()->decodeText(pMsg->safeParam(2)), - pMsg->connection()->decodeText(pMsg->safeTrailing()) - ) - ); + new ChannelTreeWidgetItemData( + pMsg->connection()->decodeText(pMsg->safeParam(1)), + pMsg->connection()->decodeText(pMsg->safeParam(2)), + pMsg->connection()->decodeText(pMsg->safeTrailing()))); } } if(_OUTPUT_VERBOSE) { QString szTmp = pMsg->connection()->decodeText(pMsg->allParams()); - output(KVI_OUT_LIST,__tr2qs("Processing list: %Q"),&szTmp); + output(KVI_OUT_LIST, __tr2qs("Processing list: %Q"), &szTmp); } } @@ -570,18 +571,20 @@ void ListWindow::flush() void ListWindow::itemDoubleClicked(QTreeWidgetItem * it, int) { - QString szText = ((ChannelTreeWidgetItem*)it)->itemData()->m_szChan; + QString szText = ((ChannelTreeWidgetItem *)it)->itemData()->m_szChan; - if(szText.isEmpty()) return; - if(!connection()) return; + if(szText.isEmpty()) + return; + if(!connection()) + return; QByteArray dat = connection()->encodeText(szText); - if(!dat.data()) return; + if(!dat.data()) + return; - m_pConsole->connection()->sendFmtData("join %s",dat.data()); + m_pConsole->connection()->sendFmtData("join %s", dat.data()); } - // //#warning "Load & save properties of this kind of window" diff --git a/src/modules/list/ListWindow.h b/src/modules/list/ListWindow.h index 963adb285..08c8811b0 100644 --- a/src/modules/list/ListWindow.h +++ b/src/modules/list/ListWindow.h @@ -46,8 +46,8 @@ class ChannelTreeWidgetItemDelegate : public QItemDelegate public: ChannelTreeWidgetItemDelegate(QTreeWidget * pWidget = 0); ~ChannelTreeWidgetItemDelegate(); - void paint(QPainter * pPainter, const QStyleOptionViewItem & option, const QModelIndex & index ) const; - QSize sizeHint(const QStyleOptionViewItem &option,const QModelIndex &index) const; + void paint(QPainter * pPainter, const QStyleOptionViewItem & option, const QModelIndex & index) const; + QSize sizeHint(const QStyleOptionViewItem & option, const QModelIndex & index) const; }; class ChannelTreeWidgetItemData @@ -55,9 +55,11 @@ class ChannelTreeWidgetItemData friend class ChannelTreeWidgetItem; friend class ListWindow; friend class ChannelTreeWidgetItemDelegate; + public: ChannelTreeWidgetItemData(const QString & szChan, const QString & szUsers, const QString & szTopic); ~ChannelTreeWidgetItemData(); + protected: QString m_szChan; QString m_szUsers; @@ -68,25 +70,28 @@ protected: class ChannelTreeWidgetItem : public QTreeWidgetItem { friend class ListWindow; + public: ChannelTreeWidgetItem(ChannelTreeWidgetItemData * pData); ~ChannelTreeWidgetItem(); + private: ChannelTreeWidgetItemData * m_pData; + public: bool operator<(const QTreeWidgetItem & other) const; inline ChannelTreeWidgetItemData * itemData() { return m_pData; }; }; -class ChannelTreeWidget: public KviThemedTreeWidget +class ChannelTreeWidget : public KviThemedTreeWidget { friend class ChannelTreeWidgetItem; friend class ChannelTreeWidgetItemData; Q_OBJECT public: - ChannelTreeWidget(QWidget * par, KviWindow * pWindow, const char * name) : KviThemedTreeWidget(par, pWindow, name) {}; - ~ChannelTreeWidget() {}; - ChannelTreeWidgetItem* itemFromIndex(const QModelIndex & index) const { return (ChannelTreeWidgetItem*) KviThemedTreeWidget::itemFromIndex(index); }; + ChannelTreeWidget(QWidget * par, KviWindow * pWindow, const char * name) : KviThemedTreeWidget(par, pWindow, name){}; + ~ChannelTreeWidget(){}; + ChannelTreeWidgetItem * itemFromIndex(const QModelIndex & index) const { return (ChannelTreeWidgetItem *)KviThemedTreeWidget::itemFromIndex(index); }; }; class ListWindow : public KviWindow, public KviExternalServerDataParser @@ -95,23 +100,26 @@ class ListWindow : public KviWindow, public KviExternalServerDataParser public: ListWindow(KviConsoleWindow * lpConsole); ~ListWindow(); + protected: - QSplitter * m_pVertSplitter; - QSplitter * m_pTopSplitter; - ChannelTreeWidget * m_pTreeWidget; - KviThemedLineEdit * m_pParamsEdit; - QToolButton * m_pRequestButton; - QToolButton * m_pStopListDownloadButton; - QToolButton * m_pOpenButton; - QToolButton * m_pSaveButton; - KviThemedLabel * m_pInfoLabel; - QTimer * m_pFlushTimer; + QSplitter * m_pVertSplitter; + QSplitter * m_pTopSplitter; + ChannelTreeWidget * m_pTreeWidget; + KviThemedLineEdit * m_pParamsEdit; + QToolButton * m_pRequestButton; + QToolButton * m_pStopListDownloadButton; + QToolButton * m_pOpenButton; + QToolButton * m_pSaveButton; + KviThemedLabel * m_pInfoLabel; + QTimer * m_pFlushTimer; KviPointerList * m_pItemList; + public: // Methods virtual void control(int iMsg); virtual void processData(KviIrcMessage * pMsg); virtual void die(); virtual QSize sizeHint() const; + protected: virtual QPixmap * myIconPtr(); virtual void fillCaptionBuffers(); @@ -127,6 +135,7 @@ protected slots: void exportList(); void importList(); void liveSearch(const QString & szText); + private: void reset(); void endOfList(); diff --git a/src/modules/list/libkvilist.cpp b/src/modules/list/libkvilist.cpp index 6f84116f1..a20948673 100644 --- a/src/modules/list/libkvilist.cpp +++ b/src/modules/list/libkvilist.cpp @@ -33,7 +33,6 @@ KviPointerList * g_pListWindowList = 0; - /* @doc: list.open @type: @@ -50,17 +49,19 @@ KviPointerList * g_pListWindowList = 0; is requested from the server. */ - static bool list_kvs_cmd_open(KviKvsModuleCommandCall * c) { - if(!c->window()->console()) return c->context()->errorNoIrcContext(); + if(!c->window()->console()) + return c->context()->errorNoIrcContext(); if(!(c->window()->context()->listWindow())) { ListWindow * w = new ListWindow(c->window()->console()); g_pMainWindow->addWindow(w); - } else { + } + else + { c->warning(__tr2qs("List window already open for this IRC context")); } @@ -72,7 +73,7 @@ static bool list_module_init(KviModule * m) g_pListWindowList = new KviPointerList; g_pListWindowList->setAutoDelete(false); - KVSM_REGISTER_SIMPLE_COMMAND(m,"open",list_kvs_cmd_open); + KVSM_REGISTER_SIMPLE_COMMAND(m, "open", list_kvs_cmd_open); return true; } @@ -91,13 +92,12 @@ static bool list_module_can_unload(KviModule *) } KVIRC_MODULE( - "List", // module name - "4.0.0", // module version - "Copyright (C) 2000-2010 Szymon Stefanek (pragma at kvirc dot net)", // author & (C) - "List window extension", - list_module_init, - list_module_can_unload, - 0, - list_module_cleanup, - 0 -) + "List", // module name + "4.0.0", // module version + "Copyright (C) 2000-2010 Szymon Stefanek (pragma at kvirc dot net)", // author & (C) + "List window extension", + list_module_init, + list_module_can_unload, + 0, + list_module_cleanup, + 0) diff --git a/src/modules/log/libkvilog.cpp b/src/modules/log/libkvilog.cpp index 15748b1bd..6b2b9fcfa 100644 --- a/src/modules/log/libkvilog.cpp +++ b/src/modules/log/libkvilog.cpp @@ -88,23 +88,25 @@ static bool log_kvs_cmd_start(KviKvsModuleCommandCall * c) { QString szFile; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("filename",KVS_PT_STRING,KVS_PF_OPTIONAL,szFile) + KVSM_PARAMETER("filename", KVS_PT_STRING, KVS_PF_OPTIONAL, szFile) KVSM_PARAMETERS_END(c) KviWindow * pWnd = c->window(); - if(c->hasSwitch('w',"window")) + if(c->hasSwitch('w', "window")) { QString szWindow; - if(c->switches()->getAsStringIfExisting('w',"window",szWindow)) + if(c->switches()->getAsStringIfExisting('w', "window", szWindow)) { pWnd = g_pApp->findWindow(szWindow); if(!pWnd) { - c->warning(__tr2qs_ctx("Window '%1' not found","log").arg(szWindow)); + c->warning(__tr2qs_ctx("Window '%1' not found", "log").arg(szWindow)); return true; } - } else { - c->warning(__tr2qs_ctx("Missing window ID after the 'w' switch","log")); + } + else + { + c->warning(__tr2qs_ctx("Missing window ID after the 'w' switch", "log")); return true; } } @@ -114,10 +116,12 @@ static bool log_kvs_cmd_start(KviKvsModuleCommandCall * c) if(szFile.isEmpty()) pWnd->getDefaultLogFileName(szFile); - if(!pWnd->view()->startLogging(szFile,c->hasSwitch('p',"log-buffer"))) - c->warning(__tr2qs_ctx("Can't log to file '%1'","log").arg(szFile)); - } else { - c->warning(__tr2qs_ctx("This window has no logging capabilities","log")); + if(!pWnd->view()->startLogging(szFile, c->hasSwitch('p', "log-buffer"))) + c->warning(__tr2qs_ctx("Can't log to file '%1'", "log").arg(szFile)); + } + else + { + c->warning(__tr2qs_ctx("This window has no logging capabilities", "log")); return true; } return true; @@ -146,19 +150,21 @@ static bool log_kvs_cmd_start(KviKvsModuleCommandCall * c) static bool log_kvs_cmd_stop(KviKvsModuleCommandCall * c) { KviWindow * pWnd = c->window(); - if(c->hasSwitch('w',"window")) + if(c->hasSwitch('w', "window")) { QString szWindow; - if(c->switches()->getAsStringIfExisting('w',"window",szWindow)) + if(c->switches()->getAsStringIfExisting('w', "window", szWindow)) { pWnd = g_pApp->findWindow(szWindow); if(!pWnd) { - c->warning(__tr2qs_ctx("Window '%1' not found","log").arg(szWindow)); + c->warning(__tr2qs_ctx("Window '%1' not found", "log").arg(szWindow)); return true; } - } else { - c->warning(__tr2qs_ctx("Missing window ID after the 'w' switch","log")); + } + else + { + c->warning(__tr2qs_ctx("Missing window ID after the 'w' switch", "log")); return true; } } @@ -196,19 +202,21 @@ static bool log_kvs_cmd_stop(KviKvsModuleCommandCall * c) static bool log_kvs_cmd_flush(KviKvsModuleCommandCall * c) { KviWindow * pWnd = c->window(); - if(c->hasSwitch('w',"window")) + if(c->hasSwitch('w', "window")) { QString szWindow; - if(c->switches()->getAsStringIfExisting('w',"window",szWindow)) + if(c->switches()->getAsStringIfExisting('w', "window", szWindow)) { pWnd = g_pApp->findWindow(szWindow); if(!pWnd) { - c->warning(__tr2qs_ctx("Window '%1' not found","log").arg(szWindow)); + c->warning(__tr2qs_ctx("Window '%1' not found", "log").arg(szWindow)); return true; } - } else { - c->warning(__tr2qs_ctx("Missing window ID after the 'w' switch","log")); + } + else + { + c->warning(__tr2qs_ctx("Missing window ID after the 'w' switch", "log")); return true; } } @@ -252,7 +260,7 @@ static bool log_kvs_fnc_file(KviKvsModuleFunctionCall * c) QString szWindow, szBuffer; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("window id",KVS_PT_STRING,KVS_PF_OPTIONAL,szWindow) + KVSM_PARAMETER("window id", KVS_PT_STRING, KVS_PF_OPTIONAL, szWindow) KVSM_PARAMETERS_END(c) KviWindow * pWnd = c->window(); @@ -262,7 +270,7 @@ static bool log_kvs_fnc_file(KviKvsModuleFunctionCall * c) pWnd = g_pApp->findWindow(szWindow); if(!pWnd) { - c->warning(__tr2qs_ctx("Window with ID '%1' not found, returning empty string","log").arg(szWindow)); + c->warning(__tr2qs_ctx("Window with ID '%1' not found, returning empty string", "log").arg(szWindow)); return true; } } @@ -300,8 +308,8 @@ static bool log_kvs_fnc_export(KviKvsModuleFunctionCall * c) QString szFile, szType; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("filename",KVS_PT_NONEMPTYSTRING,0,szFile) - KVSM_PARAMETER("type",KVS_PT_STRING,KVS_PF_OPTIONAL,szType) + KVSM_PARAMETER("filename", KVS_PT_NONEMPTYSTRING, 0, szFile) + KVSM_PARAMETER("type", KVS_PT_STRING, KVS_PF_OPTIONAL, szType) KVSM_PARAMETERS_END(c) if(szType.isEmpty()) @@ -310,7 +318,7 @@ static bool log_kvs_fnc_export(KviKvsModuleFunctionCall * c) KviModule * m = g_pModuleManager->getModule("logview"); if(!m) { - c->error(__tr2qs_ctx("Failed to load logview module, aborting","log")); + c->error(__tr2qs_ctx("Failed to load logview module, aborting", "log")); return false; } @@ -318,9 +326,9 @@ static bool log_kvs_fnc_export(KviKvsModuleFunctionCall * c) log.szName = szFile; log.szType = szType; - if(!m->ctrl("logview::export",(void *)&log)) + if(!m->ctrl("logview::export", (void *)&log)) { - c->error(__tr2qs_ctx("Failed to export the log '%1'","log").arg(szFile)); + c->error(__tr2qs_ctx("Failed to export the log '%1'", "log").arg(szFile)); return false; } @@ -331,12 +339,12 @@ static bool log_kvs_fnc_export(KviKvsModuleFunctionCall * c) static bool log_module_init(KviModule * m) { - KVSM_REGISTER_SIMPLE_COMMAND(m,"start",log_kvs_cmd_start); - KVSM_REGISTER_SIMPLE_COMMAND(m,"stop",log_kvs_cmd_stop); - KVSM_REGISTER_SIMPLE_COMMAND(m,"flush",log_kvs_cmd_flush); + KVSM_REGISTER_SIMPLE_COMMAND(m, "start", log_kvs_cmd_start); + KVSM_REGISTER_SIMPLE_COMMAND(m, "stop", log_kvs_cmd_stop); + KVSM_REGISTER_SIMPLE_COMMAND(m, "flush", log_kvs_cmd_flush); - KVSM_REGISTER_FUNCTION(m,"file",log_kvs_fnc_file); - KVSM_REGISTER_FUNCTION(m,"export",log_kvs_fnc_export); + KVSM_REGISTER_FUNCTION(m, "file", log_kvs_fnc_file); + KVSM_REGISTER_FUNCTION(m, "export", log_kvs_fnc_export); return true; } @@ -346,14 +354,13 @@ static bool log_module_cleanup(KviModule *) } KVIRC_MODULE( - "Log", // module name - "4.0.0", // module version - "Copyright (C) 2001 Szymon Stefanek (pragma at kvirc dot net)\n" \ - " 2011 Elvio Basello (hellvis69 at gmail dot com)", // author & (C) - "User interface to the logging system for KVIrc", - log_module_init, - 0, - 0, - log_module_cleanup, - 0 -) + "Log", // module name + "4.0.0", // module version + "Copyright (C) 2001 Szymon Stefanek (pragma at kvirc dot net)\n" + " 2011 Elvio Basello (hellvis69 at gmail dot com)", // author & (C) + "User interface to the logging system for KVIrc", + log_module_init, + 0, + 0, + log_module_cleanup, + 0) diff --git a/src/modules/logview/LogFile.cpp b/src/modules/logview/LogFile.cpp index 21961b124..43d98f01c 100644 --- a/src/modules/logview/LogFile.cpp +++ b/src/modules/logview/LogFile.cpp @@ -32,7 +32,7 @@ #include #ifdef COMPILE_ZLIB_SUPPORT - #include +#include #endif LogFile::LogFile(const QString & szName) @@ -48,37 +48,42 @@ LogFile::LogFile(const QString & szName) //removes trailing dot and extension szTmpName.chop(3); } - QString szTypeToken = szTmpName.section('_',0,0); + QString szTypeToken = szTmpName.section('_', 0, 0); // Ignore non-logs files, this includes '.' and '..' - if(KviQString::equalCI(szTypeToken,"channel") || KviQString::equalCI(szTypeToken,"deadchannel")) + if(KviQString::equalCI(szTypeToken, "channel") || KviQString::equalCI(szTypeToken, "deadchannel")) { m_szType = "channel"; m_eType = Channel; - } else if(KviQString::equalCI(szTypeToken,"console")) + } + else if(KviQString::equalCI(szTypeToken, "console")) { m_szType = "console"; m_eType = Console; - } else if(KviQString::equalCI(szTypeToken,"query")) + } + else if(KviQString::equalCI(szTypeToken, "query")) { m_szType = "query"; m_eType = Query; - } else if(KviQString::equalCI(szTypeToken,"dccchat")) + } + else if(KviQString::equalCI(szTypeToken, "dccchat")) { m_szType = "dccchat"; m_eType = DccChat; - } else { + } + else + { m_szType = ""; m_eType = Other; } - KviCString szUndecoded = szTmpName.section('.',0,0); + KviCString szUndecoded = szTmpName.section('.', 0, 0); szUndecoded.cutToFirst('_'); m_szName = szUndecoded.hexDecode(szUndecoded.ptr()).ptr(); - szUndecoded = szTmpName.section('.',1).section('_',0,-2); + szUndecoded = szTmpName.section('.', 1).section('_', 0, -2); m_szNetwork = szUndecoded.hexDecode(szUndecoded.ptr()).ptr(); - QString szDate = szTmpName.section('_',-1).section('.',0,-2); + QString szDate = szTmpName.section('_', -1).section('.', 0, -2); switch(KVI_OPTION_UINT(KviOption_uintOutputDatetimeFormat)) { @@ -145,26 +150,30 @@ void LogFile::getText(QString & szText) #ifdef COMPILE_ZLIB_SUPPORT if(m_bCompressed) { - gzFile file = gzopen(szLogName.toLocal8Bit().data(),"rb"); + gzFile file = gzopen(szLogName.toLocal8Bit().data(), "rb"); if(file) { char cBuff[1025]; int iLen; QByteArray data; //QCString data; - iLen = gzread(file,cBuff,1024); + iLen = gzread(file, cBuff, 1024); while(iLen > 0) { cBuff[iLen] = 0; data.append(cBuff); - iLen = gzread(file,cBuff,1024); + iLen = gzread(file, cBuff, 1024); } gzclose(file); szText = QString::fromUtf8(data); - } else { - qDebug("Can't open compressed file %s",szLogName.toLocal8Bit().data()); } - } else { + else + { + qDebug("Can't open compressed file %s", szLogName.toLocal8Bit().data()); + } + } + else + { #endif logFile.setFileName(szLogName); @@ -173,7 +182,7 @@ void LogFile::getText(QString & szText) QByteArray bytes; bytes = logFile.readAll(); - szText = QString::fromUtf8(bytes.data(),bytes.size()); + szText = QString::fromUtf8(bytes.data(), bytes.size()); logFile.close(); #ifdef COMPILE_ZLIB_SUPPORT } diff --git a/src/modules/logview/LogFile.h b/src/modules/logview/LogFile.h index a5091ca84..53281af8a 100644 --- a/src/modules/logview/LogFile.h +++ b/src/modules/logview/LogFile.h @@ -43,9 +43,9 @@ class QString; */ typedef struct _LogFileData { - QString szName; /**< the name of the log */ - QString szType; /**< the type of the log */ - QString szFile; /**< the name of the exported log */ + QString szName; /**< the name of the log */ + QString szType; /**< the type of the log */ + QString szFile; /**< the name of the exported log */ } LogFileData; /** @@ -65,23 +65,25 @@ public: * \enum Type * \brief Holds the type of the log file */ - enum Type { - Channel = 0, /**< the log file of a channel */ - Console = 1, /**< the log file of a console */ - Query = 2, /**< the log file of a query */ - DccChat = 3, /**< the log file of a dcc chat */ - Other = 4 /**< any other log file */ + enum Type + { + Channel = 0, /**< the log file of a channel */ + Console = 1, /**< the log file of a console */ + Query = 2, /**< the log file of a query */ + DccChat = 3, /**< the log file of a dcc chat */ + Other = 4 /**< any other log file */ }; /** * \enum ExportType * \brief Holds the type of the exported log file */ - enum ExportType { - PlainText, /**< export log in plain text file */ - HTML /**< export log in a HTML archive */ - //XML /**< export log in a XML file */ - //DB /**< export log in a database file */ + enum ExportType + { + PlainText, /**< export log in plain text file */ + HTML /**< export log in a HTML archive */ + //XML /**< export log in a XML file */ + //DB /**< export log in a database file */ }; /** @@ -90,14 +92,16 @@ public: * \return LogFile */ LogFile(const QString & szName); + private: - Type m_eType; + Type m_eType; QString m_szType; QString m_szFilename; - bool m_bCompressed; + bool m_bCompressed; QString m_szName; QString m_szNetwork; - QDate m_date; + QDate m_date; + public: /** * \brief Returns the type of the log diff --git a/src/modules/logview/LogViewWidget.cpp b/src/modules/logview/LogViewWidget.cpp index c7e870ef7..5de6f3078 100644 --- a/src/modules/logview/LogViewWidget.cpp +++ b/src/modules/logview/LogViewWidget.cpp @@ -35,29 +35,29 @@ #include #ifdef COMPILE_ZLIB_SUPPORT - #include +#include #endif LogListViewItem::LogListViewItem(QTreeWidgetItem * pPar, LogFile::Type eType, LogFile * pLog) -: QTreeWidgetItem(pPar), m_eType(eType), m_pFileData(pLog) + : QTreeWidgetItem(pPar), m_eType(eType), m_pFileData(pLog) { - setText(0,m_pFileData ? m_pFileData->name() : QString()); + setText(0, m_pFileData ? m_pFileData->name() : QString()); } LogListViewItem::LogListViewItem(QTreeWidget * pPar, LogFile::Type eType, LogFile * pLog) -: QTreeWidgetItem(pPar), m_eType(eType), m_pFileData(pLog) + : QTreeWidgetItem(pPar), m_eType(eType), m_pFileData(pLog) { - setText(0,m_pFileData ? m_pFileData->name() : QString()); + setText(0, m_pFileData ? m_pFileData->name() : QString()); } LogListViewItemFolder::LogListViewItemFolder(QTreeWidgetItem * pPar, const QString & szLabel) -: LogListViewItem(pPar,LogFile::Other,0) + : LogListViewItem(pPar, LogFile::Other, 0) { - setText(0,szLabel); + setText(0, szLabel); } LogListViewItemType::LogListViewItemType(QTreeWidget * pPar, LogFile::Type eType) -: LogListViewItem(pPar,eType,0) + : LogListViewItem(pPar, eType, 0) { QIcon icon; QString szText; @@ -66,31 +66,31 @@ LogListViewItemType::LogListViewItemType(QTreeWidget * pPar, LogFile::Type eType { case LogFile::Channel: icon = QIcon(*g_pIconManager->getSmallIcon(KviIconManager::Channel)); - szText = __tr2qs_ctx("Channel","log"); - break; + szText = __tr2qs_ctx("Channel", "log"); + break; case LogFile::Query: icon = QIcon(*g_pIconManager->getSmallIcon(KviIconManager::Query)); - szText = __tr2qs_ctx("Query","log"); - break; + szText = __tr2qs_ctx("Query", "log"); + break; case LogFile::DccChat: icon = QIcon(*g_pIconManager->getSmallIcon(KviIconManager::DccMsg)); - szText = __tr2qs_ctx("DCC Chat","log"); - break; + szText = __tr2qs_ctx("DCC Chat", "log"); + break; case LogFile::Console: icon = QIcon(*g_pIconManager->getSmallIcon(KviIconManager::Console)); - szText = __tr2qs_ctx("Console","log"); - break; + szText = __tr2qs_ctx("Console", "log"); + break; default: icon = QIcon(*g_pIconManager->getSmallIcon(KviIconManager::Log)); - szText = __tr2qs_ctx("Other","log"); + szText = __tr2qs_ctx("Other", "log"); } - setIcon(0,icon); - setText(0,szText); + setIcon(0, icon); + setText(0, szText); } LogListViewLog::LogListViewLog(QTreeWidgetItem * pPar, LogFile::Type eType, LogFile * pLog) -: LogListViewItem(pPar,eType,pLog) + : LogListViewItem(pPar, eType, pLog) { - setText(0,m_pFileData->date().toString("yyyy-MM-dd")); + setText(0, m_pFileData->date().toString("yyyy-MM-dd")); } diff --git a/src/modules/logview/LogViewWidget.h b/src/modules/logview/LogViewWidget.h index d48604247..9092dae84 100644 --- a/src/modules/logview/LogViewWidget.h +++ b/src/modules/logview/LogViewWidget.h @@ -37,11 +37,13 @@ public: LogListViewItem(QTreeWidgetItem * pPar, LogFile::Type eType, LogFile * pLog); LogListViewItem(QTreeWidget * pPar, LogFile::Type eType, LogFile * pLog); ~LogListViewItem(){}; + public: - LogFile::Type m_eType; - LogFile * m_pFileData; + LogFile::Type m_eType; + LogFile * m_pFileData; + public: - LogFile * log(){ return m_pFileData; }; + LogFile * log() { return m_pFileData; }; virtual QString fileName() const { return QString(); }; }; @@ -50,6 +52,7 @@ class LogListViewItemFolder : public LogListViewItem public: LogListViewItemFolder(QTreeWidgetItem * pPar, const QString & szLabel); ~LogListViewItemFolder(){}; + public: }; diff --git a/src/modules/logview/LogViewWindow.cpp b/src/modules/logview/LogViewWindow.cpp index dc0c188f5..0c5f0b9d6 100644 --- a/src/modules/logview/LogViewWindow.cpp +++ b/src/modules/logview/LogViewWindow.cpp @@ -63,11 +63,11 @@ extern LogViewWindow * g_pLogViewWindow; LogViewListView::LogViewListView(QWidget * pParent) -: QTreeWidget(pParent) + : QTreeWidget(pParent) { header()->setSortIndicatorShown(true); setColumnCount(1); - setHeaderLabel(__tr2qs_ctx("Log File","log")); + setHeaderLabel(__tr2qs_ctx("Log File", "log")); setSelectionMode(QAbstractItemView::SingleSelection); setSortingEnabled(true); setRootIsDecorated(true); @@ -80,19 +80,18 @@ void LogViewListView::mousePressEvent(QMouseEvent * pEvent) { QTreeWidgetItem * pItem = itemAt(pEvent->pos()); if(pItem) - emit rightButtonPressed(pItem,QCursor::pos()); + emit rightButtonPressed(pItem, QCursor::pos()); } QTreeWidget::mousePressEvent(pEvent); } - LogViewWindow::LogViewWindow() -: KviWindow(KviWindow::LogView,"log") + : KviWindow(KviWindow::LogView, "log") { g_pLogViewWindow = this; //m_pLogViewWidget = new KviLogViewWidget(this); - m_pSplitter = new KviTalSplitter(Qt::Horizontal,this); + m_pSplitter = new KviTalSplitter(Qt::Horizontal, this); m_pSplitter->setObjectName("main_splitter"); m_pSplitter->setChildrenCollapsible(false); @@ -102,112 +101,112 @@ LogViewWindow::LogViewWindow() m_pProgressBar = new QProgressBar(m_pBottomLayout); m_pCancelButton = new QPushButton(m_pBottomLayout); - m_pCancelButton->setText(__tr2qs_ctx("Cancel","log")); - connect(m_pCancelButton,SIGNAL(clicked()),this,SLOT(abortFilter())); + m_pCancelButton->setText(__tr2qs_ctx("Cancel", "log")); + connect(m_pCancelButton, SIGNAL(clicked()), this, SLOT(abortFilter())); m_pBottomLayout->setVisible(false); - m_pIndexTab = new KviTalVBox(m_pTabWidget); - m_pTabWidget->addTab(m_pIndexTab,__tr2qs_ctx("Index","log")); + m_pIndexTab = new KviTalVBox(m_pTabWidget); + m_pTabWidget->addTab(m_pIndexTab, __tr2qs_ctx("Index", "log")); m_pListView = new LogViewListView(m_pIndexTab); - connect(m_pListView,SIGNAL(currentItemChanged(QTreeWidgetItem *,QTreeWidgetItem *)),this,SLOT(itemSelected(QTreeWidgetItem *,QTreeWidgetItem *))); - connect(m_pListView,SIGNAL(rightButtonPressed(QTreeWidgetItem *,QPoint)),this,SLOT(rightButtonClicked(QTreeWidgetItem *,QPoint))); + connect(m_pListView, SIGNAL(currentItemChanged(QTreeWidgetItem *, QTreeWidgetItem *)), this, SLOT(itemSelected(QTreeWidgetItem *, QTreeWidgetItem *))); + connect(m_pListView, SIGNAL(rightButtonPressed(QTreeWidgetItem *, QPoint)), this, SLOT(rightButtonClicked(QTreeWidgetItem *, QPoint))); - m_pSearchTab = new QWidget(m_pTabWidget); - m_pTabWidget->addTab(m_pSearchTab,__tr2qs_ctx("Filter","log")); + m_pSearchTab = new QWidget(m_pTabWidget); + m_pTabWidget->addTab(m_pSearchTab, __tr2qs_ctx("Filter", "log")); QGridLayout * pLayout = new QGridLayout(m_pSearchTab); - m_pShowChannelsCheck = new QCheckBox(__tr2qs_ctx("Show channel logs","log"),m_pSearchTab); + m_pShowChannelsCheck = new QCheckBox(__tr2qs_ctx("Show channel logs", "log"), m_pSearchTab); m_pShowChannelsCheck->setChecked(true); - pLayout->addWidget(m_pShowChannelsCheck,0,0,1,2); + pLayout->addWidget(m_pShowChannelsCheck, 0, 0, 1, 2); - m_pShowQueryesCheck = new QCheckBox(__tr2qs_ctx("Show query logs","log"),m_pSearchTab); + m_pShowQueryesCheck = new QCheckBox(__tr2qs_ctx("Show query logs", "log"), m_pSearchTab); m_pShowQueryesCheck->setChecked(true); - pLayout->addWidget(m_pShowQueryesCheck,1,0,1,2); + pLayout->addWidget(m_pShowQueryesCheck, 1, 0, 1, 2); - m_pShowConsolesCheck = new QCheckBox(__tr2qs_ctx("Show console logs","log"),m_pSearchTab); + m_pShowConsolesCheck = new QCheckBox(__tr2qs_ctx("Show console logs", "log"), m_pSearchTab); m_pShowConsolesCheck->setChecked(true); - pLayout->addWidget(m_pShowConsolesCheck,2,0,1,2); + pLayout->addWidget(m_pShowConsolesCheck, 2, 0, 1, 2); - m_pShowDccChatCheck = new QCheckBox(__tr2qs_ctx("Show DCC chat logs","log"),m_pSearchTab); + m_pShowDccChatCheck = new QCheckBox(__tr2qs_ctx("Show DCC chat logs", "log"), m_pSearchTab); m_pShowDccChatCheck->setChecked(true); - pLayout->addWidget(m_pShowDccChatCheck,3,0,1,2); + pLayout->addWidget(m_pShowDccChatCheck, 3, 0, 1, 2); - m_pShowOtherCheck = new QCheckBox(__tr2qs_ctx("Show other logs","log"),m_pSearchTab); + m_pShowOtherCheck = new QCheckBox(__tr2qs_ctx("Show other logs", "log"), m_pSearchTab); m_pShowOtherCheck->setChecked(true); - pLayout->addWidget(m_pShowOtherCheck,4,0,1,2); + pLayout->addWidget(m_pShowOtherCheck, 4, 0, 1, 2); QLabel * pLabel; - pLabel = new QLabel(__tr2qs_ctx("Contents Filter","log"),m_pSearchTab); - pLayout->addWidget(pLabel,5,0,1,2); + pLabel = new QLabel(__tr2qs_ctx("Contents Filter", "log"), m_pSearchTab); + pLayout->addWidget(pLabel, 5, 0, 1, 2); - pLabel = new QLabel(__tr2qs_ctx("Log name mask:","log"),m_pSearchTab); + pLabel = new QLabel(__tr2qs_ctx("Log name mask:", "log"), m_pSearchTab); m_pFileNameMask = new QLineEdit(m_pSearchTab); - pLayout->addWidget(pLabel,6,0); - pLayout->addWidget(m_pFileNameMask,6,1); - connect(m_pFileNameMask,SIGNAL(returnPressed()),this,SLOT(applyFilter())); + pLayout->addWidget(pLabel, 6, 0); + pLayout->addWidget(m_pFileNameMask, 6, 1); + connect(m_pFileNameMask, SIGNAL(returnPressed()), this, SLOT(applyFilter())); - pLabel = new QLabel(__tr2qs_ctx("Log contents mask:","log"),m_pSearchTab); + pLabel = new QLabel(__tr2qs_ctx("Log contents mask:", "log"), m_pSearchTab); m_pContentsMask = new QLineEdit(m_pSearchTab); - pLayout->addWidget(pLabel,7,0); - pLayout->addWidget(m_pContentsMask,7,1); - connect(m_pContentsMask,SIGNAL(returnPressed()),this,SLOT(applyFilter())); + pLayout->addWidget(pLabel, 7, 0); + pLayout->addWidget(m_pContentsMask, 7, 1); + connect(m_pContentsMask, SIGNAL(returnPressed()), this, SLOT(applyFilter())); - m_pEnableFromFilter = new QCheckBox(__tr2qs_ctx("Only older than:","log"),m_pSearchTab); + m_pEnableFromFilter = new QCheckBox(__tr2qs_ctx("Only older than:", "log"), m_pSearchTab); m_pFromDateEdit = new QDateEdit(m_pSearchTab); m_pFromDateEdit->setDate(QDate::currentDate()); m_pFromDateEdit->setEnabled(false); - pLayout->addWidget(m_pEnableFromFilter,8,0); - pLayout->addWidget(m_pFromDateEdit,8,1); - connect(m_pEnableFromFilter,SIGNAL(toggled(bool)),m_pFromDateEdit,SLOT(setEnabled(bool))); + pLayout->addWidget(m_pEnableFromFilter, 8, 0); + pLayout->addWidget(m_pFromDateEdit, 8, 1); + connect(m_pEnableFromFilter, SIGNAL(toggled(bool)), m_pFromDateEdit, SLOT(setEnabled(bool))); - m_pEnableToFilter = new QCheckBox(__tr2qs_ctx("Only newer than:","log"),m_pSearchTab); + m_pEnableToFilter = new QCheckBox(__tr2qs_ctx("Only newer than:", "log"), m_pSearchTab); m_pToDateEdit = new QDateEdit(m_pSearchTab); m_pToDateEdit->setDate(QDate::currentDate()); m_pToDateEdit->setEnabled(false); - pLayout->addWidget(m_pEnableToFilter,9,0); - pLayout->addWidget(m_pToDateEdit,9,1); - connect(m_pEnableToFilter,SIGNAL(toggled(bool)),m_pToDateEdit,SLOT(setEnabled(bool))); + pLayout->addWidget(m_pEnableToFilter, 9, 0); + pLayout->addWidget(m_pToDateEdit, 9, 1); + connect(m_pEnableToFilter, SIGNAL(toggled(bool)), m_pToDateEdit, SLOT(setEnabled(bool))); - m_pFilterButton = new QPushButton(__tr2qs_ctx("Apply Filter","log"),m_pSearchTab); - pLayout->addWidget(m_pFilterButton,10,1); - connect(m_pFilterButton,SIGNAL(clicked()),this,SLOT(applyFilter())); + m_pFilterButton = new QPushButton(__tr2qs_ctx("Apply Filter", "log"), m_pSearchTab); + pLayout->addWidget(m_pFilterButton, 10, 1); + connect(m_pFilterButton, SIGNAL(clicked()), this, SLOT(applyFilter())); QWidget * pWidget = new QWidget(m_pSearchTab); - pWidget->setSizePolicy(QSizePolicy::Ignored,QSizePolicy::Ignored); - pLayout->addWidget(pWidget,11,1); + pWidget->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored); + pLayout->addWidget(pWidget, 11, 1); - m_pIrcView = new KviIrcView(m_pSplitter,this); + m_pIrcView = new KviIrcView(m_pSplitter, this); m_pIrcView->setMaxBufferSize(INT_MAX); m_pIrcView->setFocusPolicy(Qt::ClickFocus); QList li; li.append(110); - li.append(width()-110); + li.append(width() - 110); m_pSplitter->setSizes(li); // Using setData to track the option ordinal that used to be passed as id m_pExportLogPopup = new QMenu("exportlog", this); - QAction* pAction = m_pExportLogPopup->addAction(__tr2qs_ctx("Plain Text File","log")); + QAction * pAction = m_pExportLogPopup->addAction(__tr2qs_ctx("Plain Text File", "log")); pAction->setData(LogFile::PlainText); - pAction = m_pExportLogPopup->addAction(__tr2qs_ctx("HTML Archive","log")); + pAction = m_pExportLogPopup->addAction(__tr2qs_ctx("HTML Archive", "log")); pAction->setData(LogFile::HTML); //m_pExportLogPopup->addAction(__tr2qs_ctx("XML file","log")); //m_pExportLogPopup->addAction(__tr2qs_ctx("database file","log")); // 18.11.14: Originally this hooked activated, but Qt4 kept sending bullshit IDs here // https://github.com/kvirc/KVIrc/issues/934#issuecomment-124933890 - connect(m_pExportLogPopup,SIGNAL(triggered(QAction*)),this,SLOT(exportLog(QAction*))); + connect(m_pExportLogPopup, SIGNAL(triggered(QAction *)), this, SLOT(exportLog(QAction *))); m_pTimer = new QTimer(this); m_pTimer->setSingleShot(true); m_pTimer->setInterval(0); - connect(m_pTimer,SIGNAL(timeout()),this,SLOT(filterNext())); + connect(m_pTimer, SIGNAL(timeout()), this, SLOT(filterNext())); //avoid to execute the long time-consuming procedure of log indexing here: //we could still be inside the context of the "Browse log files" QAction - QTimer::singleShot(0,this,SLOT(cacheFileList())); + QTimer::singleShot(0, this, SLOT(cacheFileList())); } LogViewWindow::~LogViewWindow() @@ -235,12 +234,12 @@ QPixmap * LogViewWindow::myIconPtr() void LogViewWindow::resizeEvent(QResizeEvent *) { - m_pSplitter->setGeometry(0,0,width(),height()); + m_pSplitter->setGeometry(0, 0, width(), height()); } void LogViewWindow::fillCaptionBuffers() { - m_szPlainTextCaption = __tr2qs_ctx("Log Viewer","log"); + m_szPlainTextCaption = __tr2qs_ctx("Log Viewer", "log"); } void LogViewWindow::die() @@ -250,7 +249,7 @@ void LogViewWindow::die() QSize LogViewWindow::sizeHint() const { - QSize ret(m_pSplitter->sizeHint().width(),m_pIrcView->sizeHint().height()); + QSize ret(m_pSplitter->sizeHint().width(), m_pIrcView->sizeHint().height()); return ret; } @@ -258,7 +257,7 @@ void LogViewWindow::recurseDirectory(const QString & szDir) { QDir dir(szDir); QFileInfoList list = dir.entryInfoList(); - for(int i=0; i < list.count(); i++) + for(int i = 0; i < list.count(); i++) { QFileInfo info = list[i]; if(info.isDir()) @@ -266,7 +265,8 @@ void LogViewWindow::recurseDirectory(const QString & szDir) // recursive if((info.fileName() != "..") && (info.fileName() != ".")) recurseDirectory(info.filePath()); - } else if((info.suffix() == "gz") || (info.suffix() == "log")) + } + else if((info.suffix() == "gz") || (info.suffix() == "log")) { m_logList.append(new LogFile(info.filePath())); } @@ -283,7 +283,7 @@ void LogViewWindow::setupItemList() m_bAborted = false; m_pBottomLayout->setVisible(true); - m_pProgressBar->setRange(0,m_logList.count()); + m_pProgressBar->setRange(0, m_logList.count()); m_pProgressBar->setValue(0); m_pLastCategory = 0; @@ -329,14 +329,14 @@ void LogViewWindow::filterNext() goto filter_next; if(!m_pFileNameMask->text().isEmpty()) - if(!KviQString::matchString(m_pFileNameMask->text(),pFile->name())) + if(!KviQString::matchString(m_pFileNameMask->text(), pFile->name())) goto filter_next; if(!m_pContentsMask->text().isEmpty()) { QString szBuffer; pFile->getText(szBuffer); - if(!KviQString::matchString(m_pContentsMask->text(),szBuffer)) + if(!KviQString::matchString(m_pContentsMask->text(), szBuffer)) goto filter_next; } @@ -345,7 +345,7 @@ void LogViewWindow::filterNext() if(m_pLastCategory->m_eType != pFile->type()) { m_pLastCategory = 0; - for(int i=0; i < m_pListView->topLevelItemCount(); ++i) + for(int i = 0; i < m_pListView->topLevelItemCount(); ++i) { LogListViewItemType * pTmp = (LogListViewItemType *)m_pListView->topLevelItem(i); if(pTmp->m_eType == pFile->type()) @@ -355,19 +355,21 @@ void LogViewWindow::filterNext() } } if(!m_pLastCategory) - m_pLastCategory = new LogListViewItemType(m_pListView,pFile->type()); + m_pLastCategory = new LogListViewItemType(m_pListView, pFile->type()); } - } else { - m_pLastCategory = new LogListViewItemType(m_pListView,pFile->type()); + } + else + { + m_pLastCategory = new LogListViewItemType(m_pListView, pFile->type()); } - szCurGroup = __tr2qs_ctx("%1 on %2","log").arg(pFile->name(),pFile->network()); + szCurGroup = __tr2qs_ctx("%1 on %2", "log").arg(pFile->name(), pFile->network()); if(m_szLastGroup != szCurGroup) { m_szLastGroup = szCurGroup; m_pLastGroupItem = 0; - for(int i=0; i < m_pLastCategory->childCount(); ++i) + for(int i = 0; i < m_pLastCategory->childCount(); ++i) { LogListViewItemFolder * pTmp = (LogListViewItemFolder *)m_pLastCategory->child(i); if(pTmp->text(0) == m_szLastGroup) @@ -378,10 +380,10 @@ void LogViewWindow::filterNext() } if(!m_pLastGroupItem) - m_pLastGroupItem = new LogListViewItemFolder(m_pLastCategory,m_szLastGroup); + m_pLastGroupItem = new LogListViewItemFolder(m_pLastCategory, m_szLastGroup); } - new LogListViewLog(m_pLastGroupItem,pFile->type(),pFile); + new LogListViewLog(m_pLastGroupItem, pFile->type(), pFile); filter_next: pFile = m_logList.next(); @@ -391,9 +393,11 @@ filter_last: { m_pProgressBar->setValue(m_pProgressBar->value() + 1); m_pTimer->start(); //singleshot - } else { + } + else + { m_pBottomLayout->setVisible(false); - m_pListView->sortItems(0,Qt::AscendingOrder); + m_pListView->sortItems(0, Qt::AscendingOrder); m_pProgressBar->setValue(0); m_pFilterButton->setEnabled(true); } @@ -402,7 +406,7 @@ filter_last: void LogViewWindow::cacheFileList() { QString szLogPath; - g_pApp->getLocalKvircDirectory(szLogPath,KviApplication::Log); + g_pApp->getLocalKvircDirectory(szLogPath, KviApplication::Log); recurseDirectory(szLogPath); setupItemList(); @@ -423,14 +427,14 @@ void LogViewWindow::itemSelected(QTreeWidgetItem * it, QTreeWidgetItem *) int iMsgType; for(QStringList::Iterator it = lines.begin(); it != lines.end(); ++it) { - QString szNum = (*it).section(' ',0,0); + QString szNum = (*it).section(' ', 0, 0); iMsgType = szNum.toInt(&bOk); - if(iMsgType < 0 || iMsgType > (KVI_NUM_MSGTYPE_OPTIONS-1)) - iMsgType=0; + if(iMsgType < 0 || iMsgType > (KVI_NUM_MSGTYPE_OPTIONS - 1)) + iMsgType = 0; if(bOk) - outputNoFmt(iMsgType,(*it).section(' ',1),KviIrcView::NoRepaint | KviIrcView::NoTimestamp); + outputNoFmt(iMsgType, (*it).section(' ', 1), KviIrcView::NoRepaint | KviIrcView::NoTimestamp); else - outputNoFmt(0,*it,KviIrcView::NoRepaint | KviIrcView::NoTimestamp); + outputNoFmt(0, *it, KviIrcView::NoRepaint | KviIrcView::NoTimestamp); } m_pIrcView->repaint(); } @@ -441,14 +445,16 @@ void LogViewWindow::rightButtonClicked(QTreeWidgetItem * pItem, const QPoint &) return; m_pListView->setCurrentItem(pItem); - QMenu * pPopup = new QMenu(this); + QMenu * pPopup = new QMenu(this); if(((LogListViewItem *)pItem)->childCount()) { //pPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::UserList)),__tr2qs_ctx("Export all log files to","log"),m_pExportLogPopup); - pPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::Discard)),__tr2qs_ctx("Remove All Log Files Within This Folder","log"),this,SLOT(deleteCurrent())); - } else { - pPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::Save)),__tr2qs_ctx("Export Log File to","log"))->setMenu(m_pExportLogPopup); - pPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::Discard)),__tr2qs_ctx("Remove Log File","log"),this,SLOT(deleteCurrent())); + pPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::Discard)), __tr2qs_ctx("Remove All Log Files Within This Folder", "log"), this, SLOT(deleteCurrent())); + } + else + { + pPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::Save)), __tr2qs_ctx("Export Log File to", "log"))->setMenu(m_pExportLogPopup); + pPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::Discard)), __tr2qs_ctx("Remove Log File", "log"), this, SLOT(deleteCurrent())); } pPopup->exec(QCursor::pos()); @@ -465,10 +471,11 @@ void LogViewWindow::deleteCurrent() if(!pItem->fileName().isNull()) { if(QMessageBox::question( - this, - __tr2qs_ctx("Confirm Current User Log Deletion","log"), - __tr2qs_ctx("Do you really wish to delete this log?","log"), - __tr2qs("Yes"),__tr2qs("No"),0,1) != 0) + this, + __tr2qs_ctx("Confirm Current User Log Deletion", "log"), + __tr2qs_ctx("Do you really wish to delete this log?", "log"), + __tr2qs("Yes"), __tr2qs("No"), 0, 1) + != 0) return; KviFileUtils::removeFile(pItem->fileName()); @@ -482,14 +489,15 @@ void LogViewWindow::deleteCurrent() } if(QMessageBox::question( - this, - __tr2qs_ctx("Confirm Current User Logs Deletion","log"), - __tr2qs_ctx("Do you really wish to delete all these logs?","log"), - __tr2qs("Yes"),__tr2qs("No"),0,1) != 0) + this, + __tr2qs_ctx("Confirm Current User Logs Deletion", "log"), + __tr2qs_ctx("Do you really wish to delete all these logs?", "log"), + __tr2qs("Yes"), __tr2qs("No"), 0, 1) + != 0) return; KviPointerList itemsList; itemsList.setAutoDelete(false); - for(int i=0; i < pItem->childCount(); i++) + for(int i = 0; i < pItem->childCount(); i++) { if(!pItem->child(i)->childCount()) { @@ -497,7 +505,7 @@ void LogViewWindow::deleteCurrent() continue; } LogListViewItem * pChild = (LogListViewItem *)pItem->child(i); - for(int j=0; j < pChild->childCount(); j++) + for(int j = 0; j < pChild->childCount(); j++) { if(!(LogListViewItem *)pChild->child(j)) { @@ -507,7 +515,7 @@ void LogViewWindow::deleteCurrent() itemsList.append((LogListViewItem *)pChild->child(j)); } } - for(unsigned int u=0; u < itemsList.count(); u++) + for(unsigned int u = 0; u < itemsList.count(); u++) { LogListViewItem * pCurItem = itemsList.at(u); if(!pCurItem->fileName().isNull()) @@ -516,12 +524,12 @@ void LogViewWindow::deleteCurrent() delete pItem; } -void LogViewWindow::exportLog(QAction* pAction) +void LogViewWindow::exportLog(QAction * pAction) { /* This slot is required as Qt4 has started to screw up the menu ordinal * sent with the old activated signal - the ordinal is now stored as * QAction user data */ - if (pAction) + if(pAction) exportLog(pAction->data().toInt()); else qDebug("LogViewWindow::exportLog called with invalid pAction"); @@ -554,7 +562,7 @@ void LogViewWindow::exportLog(int iId) // The child is a node, scan it LogListViewItem * pChild = (LogListViewItem *)pItem->child(i); - for(int j=0; j < pChild->childCount(); j++) + for(int j = 0; j < pChild->childCount(); j++) { if(!(LogListViewItem *)pChild->child(j)) { @@ -587,21 +595,21 @@ void LogViewWindow::createLog(LogFile * pLog, int iId, QString * pszFile) /* Fetching previous export path and concatenating with generated filename * adjustFilePath is for file paths not directory paths */ szLog = KVI_OPTION_STRING(KviOption_stringLogsExportPath).trimmed(); - if (!szLog.isEmpty()) + if(!szLog.isEmpty()) szLog += KVI_PATH_SEPARATOR_CHAR; - szLog += QString("%1_%2.%3_%4").arg(pLog->typeString(),pLog->name(),pLog->network(),szDate); + szLog += QString("%1_%2.%3_%4").arg(pLog->typeString(), pLog->name(), pLog->network(), szDate); KviFileUtils::adjustFilePath(szLog); // Getting output file path from the user, with overwrite confirmation if(!KviFileDialog::askForSaveFileName( - szLog, - __tr2qs_ctx("Export Log - KVIrc","log"), - szLog, - QString(), - false, - true, - true, - this)) + szLog, + __tr2qs_ctx("Export Log - KVIrc", "log"), + szLog, + QString(), + false, + true, + true, + this)) return; /* Save export directory - this directory path is also used in the HTML export @@ -632,27 +640,27 @@ void LogViewWindow::createLog(LogFile * pLog, int iId, QString * pszFile) // Remove icons' code rx.setPattern("^\\d{1,3}\\s"); - szLine.replace(rx,""); + szLine.replace(rx, ""); // Remove link from a user speaking, deal with (and keep) various ranks // e.g.: --> rx.setPattern("\\s<([+%@&~!]?)!nc"); - szLine.replace(rx," <\\1"); + szLine.replace(rx, " <\\1"); // Remove link from a nick in a mask // e.g.: !nFoo [~bar@!hfoo.bar] --> Foo [~bar@!hfoo.bar] rx.setPattern("\\s!n"); - szLine.replace(rx," "); + szLine.replace(rx, " "); // Remove link from a host in a mask // e.g.: Foo [~bar@!hfoo.bar] --> Foo [~bar@foo.bar] rx.setPattern("@!h"); - szLine.replace(rx,"@"); + szLine.replace(rx, "@"); // Remove link from a channel // e.g.: !c#KVIrc --> #KVIrc rx.setPattern("!c#"); - szLine.replace(rx,"#"); + szLine.replace(rx, "#"); szOutputBuffer += szLine; szOutputBuffer += "\n"; @@ -675,20 +683,20 @@ void LogViewWindow::createLog(LogFile * pLog, int iId, QString * pszFile) switch(pLog->type()) { case LogFile::Channel: - szTitle = __tr2qs_ctx("Channel %1 on %2","log").arg(pLog->name(),pLog->network()); - break; + szTitle = __tr2qs_ctx("Channel %1 on %2", "log").arg(pLog->name(), pLog->network()); + break; case LogFile::Console: - szTitle = __tr2qs_ctx("Console on %1","log").arg(pLog->network()); - break; + szTitle = __tr2qs_ctx("Console on %1", "log").arg(pLog->network()); + break; case LogFile::Query: - szTitle = __tr2qs_ctx("Query with: %1 on %2","log").arg(pLog->name(),pLog->network()); - break; + szTitle = __tr2qs_ctx("Query with: %1 on %2", "log").arg(pLog->name(), pLog->network()); + break; case LogFile::DccChat: - szTitle = __tr2qs_ctx("DCC Chat with: %1","log").arg(pLog->name()); - break; + szTitle = __tr2qs_ctx("DCC Chat with: %1", "log").arg(pLog->name()); + break; case LogFile::Other: - szTitle = __tr2qs_ctx("Something on: %1","log").arg(pLog->network()); - break; + szTitle = __tr2qs_ctx("Something on: %1", "log").arg(pLog->network()); + break; } // Prepare HTML document @@ -707,23 +715,23 @@ void LogViewWindow::createLog(LogFile * pLog, int iId, QString * pszFile) szTmp = (*it); // Find who has talked - QString szTmpNick = szTmp.section(" ",2,2); + QString szTmpNick = szTmp.section(" ", 2, 2); if((szTmpNick.left(1) != "<") && (szTmpNick.right(1) != ">")) szTmpNick = ""; // locate msgtype - QString szNum = szTmp.section(' ',0,0); + QString szNum = szTmp.section(' ', 0, 0); bool bOk; int iMsgType = szNum.toInt(&bOk); // only human text for now... - if(iMsgType != 24 && iMsgType != 25 && iMsgType != 26) + if(iMsgType != 24 && iMsgType != 25 && iMsgType != 26) continue; // remove msgtype tag - szTmp = szTmp.remove(0,szNum.length()+1); + szTmp = szTmp.remove(0, szNum.length() + 1); - szTmp = KviHtmlGenerator::convertToHtml(szTmp,true); + szTmp = KviHtmlGenerator::convertToHtml(szTmp, true); // insert msgtype icon at start of the current text line KviMessageTypeSettings msg(KVI_OPTION_MSGTYPE(iMsgType)); @@ -746,7 +754,9 @@ void LogViewWindow::createLog(LogFile * pLog, int iId, QString * pszFile) szTmp.prepend("

"); szNick = szTmpNick; - } else { + } + else + { // Break the line szTmp.prepend("
\n"); } @@ -764,7 +774,7 @@ void LogViewWindow::createLog(LogFile * pLog, int iId, QString * pszFile) QStringList szImagesList; // search for icons - while (iIndex >= 0) + while(iIndex >= 0) { int iLength = rx.matchedLength(); QString szCap = rx.cap(1); @@ -777,7 +787,7 @@ void LogViewWindow::createLog(LogFile * pLog, int iId, QString * pszFile) // get current theme path QString szCurrentThemePath; - g_pApp->getLocalKvircDirectory(szCurrentThemePath,KviApplication::Themes,KVI_OPTION_STRING(KviOption_stringIconThemeSubdir)); + g_pApp->getLocalKvircDirectory(szCurrentThemePath, KviApplication::Themes, KVI_OPTION_STRING(KviOption_stringIconThemeSubdir)); szCurrentThemePath += KVI_PATH_SEPARATOR_CHAR; // current coresmall path @@ -788,24 +798,24 @@ void LogViewWindow::createLog(LogFile * pLog, int iId, QString * pszFile) if(!KviFileUtils::directoryExists(szCurrentThemePath)) { // get global coresmall path - g_pApp->getGlobalKvircDirectory(szCurrentThemePath,KviApplication::Pics,"coresmall"); - KviQString::ensureLastCharIs(szCurrentThemePath,QChar(KVI_PATH_SEPARATOR_CHAR)); + g_pApp->getGlobalKvircDirectory(szCurrentThemePath, KviApplication::Pics, "coresmall"); + KviQString::ensureLastCharIs(szCurrentThemePath, QChar(KVI_PATH_SEPARATOR_CHAR)); } // copy all icons to the log destination folder - for(int i=0; i < szImagesList.count(); i++) + for(int i = 0; i < szImagesList.count(); i++) { QString szSourceFile = szCurrentThemePath + szImagesList.at(i); QString szDestFile = szLogDir + szImagesList.at(i); - KviFileUtils::copyFile(szSourceFile,szDestFile); + KviFileUtils::copyFile(szSourceFile, szDestFile); } // remove internal tags rx.setPattern("||smallicons:"); - szOutputBuffer.replace(rx,""); - szOutputBuffer.replace(">!nc",">"); - szOutputBuffer.replace("@!nc","@"); - szOutputBuffer.replace("%!nc","%"); + szOutputBuffer.replace(rx, ""); + szOutputBuffer.replace(">!nc", ">"); + szOutputBuffer.replace("@!nc", "@"); + szOutputBuffer.replace("%!nc", "%"); // Close the document szOutputBuffer += "\n\n"; diff --git a/src/modules/logview/LogViewWindow.h b/src/modules/logview/LogViewWindow.h index 72accda18..971166b95 100644 --- a/src/modules/logview/LogViewWindow.h +++ b/src/modules/logview/LogViewWindow.h @@ -53,6 +53,7 @@ class LogViewListView : public QTreeWidget public: LogViewListView(QWidget *); ~LogViewListView(){}; + protected: void mousePressEvent(QMouseEvent * pEvent); signals: @@ -65,43 +66,45 @@ class LogViewWindow : public KviWindow public: LogViewWindow(); ~LogViewWindow(); + protected: KviPointerList m_logList; - LogViewListView * m_pListView; + LogViewListView * m_pListView; // Type filter - QCheckBox * m_pShowChannelsCheck; - QCheckBox * m_pShowQueryesCheck; - QCheckBox * m_pShowConsolesCheck; - QCheckBox * m_pShowOtherCheck; - QCheckBox * m_pShowDccChatCheck; + QCheckBox * m_pShowChannelsCheck; + QCheckBox * m_pShowQueryesCheck; + QCheckBox * m_pShowConsolesCheck; + QCheckBox * m_pShowOtherCheck; + QCheckBox * m_pShowDccChatCheck; // Content filter - QLineEdit * m_pFileNameMask; - QLineEdit * m_pContentsMask; + QLineEdit * m_pFileNameMask; + QLineEdit * m_pContentsMask; // Date/time mask - QCheckBox * m_pEnableFromFilter; - QCheckBox * m_pEnableToFilter; - QDateEdit * m_pFromDateEdit; - QDateEdit * m_pToDateEdit; - - QStringList * m_pFileNames; - QTabWidget * m_pTabWidget; - KviTalVBox * m_pIndexTab; - KviTalVBox * m_pLeftLayout; - QWidget * m_pSearchTab; - QPushButton * m_pFilterButton; - QPushButton * m_pCancelButton; - KviTalHBox * m_pBottomLayout; - QProgressBar * m_pProgressBar; - LogListViewItem * m_pLastCategory; + QCheckBox * m_pEnableFromFilter; + QCheckBox * m_pEnableToFilter; + QDateEdit * m_pFromDateEdit; + QDateEdit * m_pToDateEdit; + + QStringList * m_pFileNames; + QTabWidget * m_pTabWidget; + KviTalVBox * m_pIndexTab; + KviTalVBox * m_pLeftLayout; + QWidget * m_pSearchTab; + QPushButton * m_pFilterButton; + QPushButton * m_pCancelButton; + KviTalHBox * m_pBottomLayout; + QProgressBar * m_pProgressBar; + LogListViewItem * m_pLastCategory; LogListViewItemFolder * m_pLastGroupItem; - QString m_szLastGroup; - bool m_bAborted; - QTimer * m_pTimer; - QMenu * m_pExportLogPopup; + QString m_szLastGroup; + bool m_bAborted; + QTimer * m_pTimer; + QMenu * m_pExportLogPopup; + public: /** * \brief Exports the log and creates the file in the selected format @@ -111,6 +114,7 @@ public: * \return void */ void createLog(LogFile * pLog, int iId, QString * pszFile = 0); + protected: void exportLog(int iId); void recurseDirectory(const QString & szDir); diff --git a/src/modules/logview/libkvilogview.cpp b/src/modules/logview/libkvilogview.cpp index f4742b98d..165973955 100644 --- a/src/modules/logview/libkvilogview.cpp +++ b/src/modules/logview/libkvilogview.cpp @@ -33,7 +33,7 @@ #include "KviLocale.h" #include "KviApplication.h" -static QRect g_rectLogViewGeometry; +static QRect g_rectLogViewGeometry; LogViewWindow * g_pLogViewWindow = 0; #define LOGVIEW_MODULE_EXTENSION_NAME "Log viewer extension" @@ -58,17 +58,16 @@ LogViewWindow * g_pLogViewWindow = 0; stored on disk. */ - static bool logview_kvs_cmd_open(KviKvsModuleCommandCall * c) { QString dummy; - bool bCreateMinimized = c->hasSwitch('m',dummy); - bool bNoRaise = c->hasSwitch('n',dummy); + bool bCreateMinimized = c->hasSwitch('m', dummy); + bool bNoRaise = c->hasSwitch('n', dummy); if(!g_pLogViewWindow) { g_pLogViewWindow = new LogViewWindow(); - g_pMainWindow->addWindow(g_pLogViewWindow,!bCreateMinimized); + g_pMainWindow->addWindow(g_pLogViewWindow, !bCreateMinimized); return true; } @@ -81,7 +80,7 @@ static bool logview_module_init(KviModule * m) { g_pLogViewWindow = 0; - KVSM_REGISTER_SIMPLE_COMMAND(m,"open",logview_kvs_cmd_open); + KVSM_REGISTER_SIMPLE_COMMAND(m, "open", logview_kvs_cmd_open); return true; } @@ -101,7 +100,7 @@ static bool logview_module_can_unload(KviModule *) static bool logview_module_ctrl(KviModule *, const char * pcOperation, void * pParam) { - if(!kvi_strEqualCI("logview::export",pcOperation)) + if(!kvi_strEqualCI("logview::export", pcOperation)) return false; LogFileData * pData = (LogFileData *)pParam; @@ -113,20 +112,19 @@ static bool logview_module_ctrl(KviModule *, const char * pcOperation, void * pP if(pData->szType == "html") iId = LogFile::HTML; - g_pLogViewWindow->createLog(pLog,iId,&(pData->szFile)); + g_pLogViewWindow->createLog(pLog, iId, &(pData->szFile)); return true; } KVIRC_MODULE( - "KVIrc Log Viewer Widget", - "4.0.0", - "Copyright (C) 2000 Juanjo Alvarez \n" \ - " 2011 Elvio Basello (hellvis69 at gmail dot com)", - "A structured log file viewer", - logview_module_init, - logview_module_can_unload, - logview_module_ctrl, - logview_module_cleanup, - "logview" -) + "KVIrc Log Viewer Widget", + "4.0.0", + "Copyright (C) 2000 Juanjo Alvarez \n" + " 2011 Elvio Basello (hellvis69 at gmail dot com)", + "A structured log file viewer", + logview_module_init, + logview_module_can_unload, + logview_module_ctrl, + logview_module_cleanup, + "logview") diff --git a/src/modules/mask/libkvimask.cpp b/src/modules/mask/libkvimask.cpp index 04e9d24b6..2d70011ae 100644 --- a/src/modules/mask/libkvimask.cpp +++ b/src/modules/mask/libkvimask.cpp @@ -49,14 +49,14 @@ static bool mask_kvs_fnc_match(KviKvsModuleFunctionCall * c) { - QString wildmask,fixedmask; + QString wildmask, fixedmask; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("wildcard mask",KVS_PT_STRING,0,wildmask) - KVSM_PARAMETER("fixed mask",KVS_PT_STRING,0,fixedmask) + KVSM_PARAMETER("wildcard mask", KVS_PT_STRING, 0, wildmask) + KVSM_PARAMETER("fixed mask", KVS_PT_STRING, 0, fixedmask) KVSM_PARAMETERS_END(c) KviIrcMask mk1(wildmask); KviIrcMask mk2(fixedmask); - c->returnValue()->setBoolean(mk1.matchesFixed(mk2.nick(),mk2.user(),mk2.host())); + c->returnValue()->setBoolean(mk1.matchesFixed(mk2.nick(), mk2.user(), mk2.host())); return true; } @@ -78,7 +78,7 @@ static bool mask_kvs_fnc_nick(KviKvsModuleFunctionCall * c) { QString mask; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("mask",KVS_PT_STRING,0,mask) + KVSM_PARAMETER("mask", KVS_PT_STRING, 0, mask) KVSM_PARAMETERS_END(c) KviIrcMask mk(mask); c->returnValue()->setString(mk.nick()); @@ -103,14 +103,13 @@ static bool mask_kvs_fnc_user(KviKvsModuleFunctionCall * c) { QString mask; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("mask",KVS_PT_STRING,0,mask) + KVSM_PARAMETER("mask", KVS_PT_STRING, 0, mask) KVSM_PARAMETERS_END(c) KviIrcMask mk(mask); c->returnValue()->setString(mk.user()); return true; } - /* @doc: mask.host @type: @@ -129,14 +128,13 @@ static bool mask_kvs_fnc_host(KviKvsModuleFunctionCall * c) { QString mask; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("mask",KVS_PT_STRING,0,mask) + KVSM_PARAMETER("mask", KVS_PT_STRING, 0, mask) KVSM_PARAMETERS_END(c) KviIrcMask mk(mask); c->returnValue()->setString(mk.host()); return true; } - /* @doc: mask.hasnumerichost @type: @@ -151,32 +149,28 @@ static bool mask_kvs_fnc_host(KviKvsModuleFunctionCall * c) Returns [b]1[/b] if the hostname part of the mask is numeric (e.g. unresolved IPv4 or IPv6 address). */ - static bool mask_kvs_fnc_hasnumerichost(KviKvsModuleFunctionCall * c) { QString mask; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("mask",KVS_PT_STRING,0,mask) + KVSM_PARAMETER("mask", KVS_PT_STRING, 0, mask) KVSM_PARAMETERS_END(c) KviIrcMask mk(mask); c->returnValue()->setBoolean(mk.hasNumericHost()); return true; } - /*********************************************************************/ // Module stuff /********************************************************************/ - - static bool mask_module_init(KviModule * m) { - KVSM_REGISTER_FUNCTION(m,"match",mask_kvs_fnc_match); - KVSM_REGISTER_FUNCTION(m,"nick",mask_kvs_fnc_nick); - KVSM_REGISTER_FUNCTION(m,"user",mask_kvs_fnc_user); - KVSM_REGISTER_FUNCTION(m,"host",mask_kvs_fnc_host); - KVSM_REGISTER_FUNCTION(m,"hasnumerichost",mask_kvs_fnc_hasnumerichost); + KVSM_REGISTER_FUNCTION(m, "match", mask_kvs_fnc_match); + KVSM_REGISTER_FUNCTION(m, "nick", mask_kvs_fnc_nick); + KVSM_REGISTER_FUNCTION(m, "user", mask_kvs_fnc_user); + KVSM_REGISTER_FUNCTION(m, "host", mask_kvs_fnc_host); + KVSM_REGISTER_FUNCTION(m, "hasnumerichost", mask_kvs_fnc_hasnumerichost); return true; } @@ -187,13 +181,12 @@ static bool mask_module_cleanup(KviModule *) } KVIRC_MODULE( - "File", // module name - "4.0.0", // module version - "Copyright (C) 2002 Szymon Stefanek (pragma at kvirc dot net)", - "Mask manipulation functions", - mask_module_init, - 0, - 0, - mask_module_cleanup, - 0 -) + "File", // module name + "4.0.0", // module version + "Copyright (C) 2002 Szymon Stefanek (pragma at kvirc dot net)", + "Mask manipulation functions", + mask_module_init, + 0, + 0, + mask_module_cleanup, + 0) diff --git a/src/modules/math/libkvimath.cpp b/src/modules/math/libkvimath.cpp index a8cffdcf0..e85b9ff16 100644 --- a/src/modules/math/libkvimath.cpp +++ b/src/modules/math/libkvimath.cpp @@ -31,32 +31,32 @@ // Workaround for lost isnan and isinf definitions after // inclusion of iostream.h on some MacOS X systems #ifdef COMPILE_ON_MAC - #ifndef isnan - extern "C" int isnan (double); - #endif - #ifndef isinf - extern "C" int isinf (double); - #endif +#ifndef isnan +extern "C" int isnan(double); +#endif +#ifndef isinf +extern "C" int isinf(double); +#endif #endif /* Solaris doesn't have isinf? */ -#if defined (__SVR4) && defined (__sun) - #ifndef isinf - #include - #define isinf(x) (!finite((x)) && (x)==(x)) - #endif +#if defined(__SVR4) && defined(__sun) +#ifndef isinf +#include +#define isinf(x) (!finite((x)) && (x) == (x)) +#endif #endif -#define MATH_KVS_1PARAM_FUNCTION(__fncname,__paramname,__mathcallname) \ -static bool __fncname(KviKvsModuleFunctionCall * c) \ -{ \ - kvs_real_t dReal; \ - KVSM_PARAMETERS_BEGIN(c) \ - KVSM_PARAMETER(__paramname,KVS_PT_REAL,0,dReal) \ - KVSM_PARAMETERS_END(c) \ - c->returnValue()->setReal(__mathcallname(dReal)); \ - return true; \ -} +#define MATH_KVS_1PARAM_FUNCTION(__fncname, __paramname, __mathcallname) \ + static bool __fncname(KviKvsModuleFunctionCall * c) \ + { \ + kvs_real_t dReal; \ + KVSM_PARAMETERS_BEGIN(c) \ + KVSM_PARAMETER(__paramname, KVS_PT_REAL, 0, dReal) \ + KVSM_PARAMETERS_END(c) \ + c->returnValue()->setReal(__mathcallname(dReal)); \ + return true; \ + } /* @doc: math.sin @@ -72,7 +72,7 @@ static bool __fncname(KviKvsModuleFunctionCall * c) \ Returns the sinus of the specified angle in radiants. */ -MATH_KVS_1PARAM_FUNCTION(math_kvs_fnc_sin,"angle",sin) +MATH_KVS_1PARAM_FUNCTION(math_kvs_fnc_sin, "angle", sin) /* @doc: math.cos @@ -88,7 +88,7 @@ MATH_KVS_1PARAM_FUNCTION(math_kvs_fnc_sin,"angle",sin) Returns the cosinus of the specified angle in radiants. */ -MATH_KVS_1PARAM_FUNCTION(math_kvs_fnc_cos,"angle",cos) +MATH_KVS_1PARAM_FUNCTION(math_kvs_fnc_cos, "angle", cos) /* @doc: math.tan @@ -104,7 +104,7 @@ MATH_KVS_1PARAM_FUNCTION(math_kvs_fnc_cos,"angle",cos) Returns the tangent of the specified angle in radiants. */ -MATH_KVS_1PARAM_FUNCTION(math_kvs_fnc_tan,"angle",tan) +MATH_KVS_1PARAM_FUNCTION(math_kvs_fnc_tan, "angle", tan) /* @doc: math.asin @@ -120,7 +120,7 @@ MATH_KVS_1PARAM_FUNCTION(math_kvs_fnc_tan,"angle",tan) Returns the angle in radiants that has the specified sinus value. */ -MATH_KVS_1PARAM_FUNCTION(math_kvs_fnc_asin,"sinus",asin) +MATH_KVS_1PARAM_FUNCTION(math_kvs_fnc_asin, "sinus", asin) /* @doc: math.acos @@ -136,7 +136,7 @@ MATH_KVS_1PARAM_FUNCTION(math_kvs_fnc_asin,"sinus",asin) Returns the angle in radiants that has the specified cosinus value. */ -MATH_KVS_1PARAM_FUNCTION(math_kvs_fnc_acos,"cosinus",acos) +MATH_KVS_1PARAM_FUNCTION(math_kvs_fnc_acos, "cosinus", acos) /* @doc: math.atan @@ -152,7 +152,7 @@ MATH_KVS_1PARAM_FUNCTION(math_kvs_fnc_acos,"cosinus",acos) Returns the angle in radiants that has the specified tangent value. */ -MATH_KVS_1PARAM_FUNCTION(math_kvs_fnc_atan,"tangent",atan) +MATH_KVS_1PARAM_FUNCTION(math_kvs_fnc_atan, "tangent", atan) /* @doc: math.sqrt @@ -168,7 +168,7 @@ MATH_KVS_1PARAM_FUNCTION(math_kvs_fnc_atan,"tangent",atan) Returns the square root of the specified number. */ -MATH_KVS_1PARAM_FUNCTION(math_kvs_fnc_sqrt,"number",sqrt) +MATH_KVS_1PARAM_FUNCTION(math_kvs_fnc_sqrt, "number", sqrt) /* @doc: math.cbrt @@ -184,7 +184,7 @@ MATH_KVS_1PARAM_FUNCTION(math_kvs_fnc_sqrt,"number",sqrt) Returns the cube root of the specified number. */ -MATH_KVS_1PARAM_FUNCTION(math_kvs_fnc_cbrt,"number",cbrt) +MATH_KVS_1PARAM_FUNCTION(math_kvs_fnc_cbrt, "number", cbrt) /* @doc: math.abs @@ -200,7 +200,7 @@ MATH_KVS_1PARAM_FUNCTION(math_kvs_fnc_cbrt,"number",cbrt) Returns the absolute value of the specified number. */ -MATH_KVS_1PARAM_FUNCTION(math_kvs_fnc_abs,"number",fabs) +MATH_KVS_1PARAM_FUNCTION(math_kvs_fnc_abs, "number", fabs) /* @doc: math.floor @@ -216,7 +216,7 @@ MATH_KVS_1PARAM_FUNCTION(math_kvs_fnc_abs,"number",fabs) Rounds down the number to the nearest integer. */ -MATH_KVS_1PARAM_FUNCTION(math_kvs_fnc_floor,"number",floor) +MATH_KVS_1PARAM_FUNCTION(math_kvs_fnc_floor, "number", floor) /* @doc: math.ceil @@ -232,7 +232,7 @@ MATH_KVS_1PARAM_FUNCTION(math_kvs_fnc_floor,"number",floor) Rounds up the number to the nearest integer. */ -MATH_KVS_1PARAM_FUNCTION(math_kvs_fnc_ceil,"number",ceil) +MATH_KVS_1PARAM_FUNCTION(math_kvs_fnc_ceil, "number", ceil) /* @doc: math.exp @@ -248,7 +248,7 @@ MATH_KVS_1PARAM_FUNCTION(math_kvs_fnc_ceil,"number",ceil) Returns the exponential of the specified number. */ -MATH_KVS_1PARAM_FUNCTION(math_kvs_fnc_exp,"number",exp) +MATH_KVS_1PARAM_FUNCTION(math_kvs_fnc_exp, "number", exp) /* @doc: math.log @@ -264,7 +264,7 @@ MATH_KVS_1PARAM_FUNCTION(math_kvs_fnc_exp,"number",exp) Returns the natural (base e) logarithm of the specified number. */ -MATH_KVS_1PARAM_FUNCTION(math_kvs_fnc_log,"number",log) +MATH_KVS_1PARAM_FUNCTION(math_kvs_fnc_log, "number", log) /* @doc: math.log10 @@ -280,7 +280,7 @@ MATH_KVS_1PARAM_FUNCTION(math_kvs_fnc_log,"number",log) Returns the base 10 logarithm of the specified number. */ -MATH_KVS_1PARAM_FUNCTION(math_kvs_fnc_log10,"number",log10) +MATH_KVS_1PARAM_FUNCTION(math_kvs_fnc_log10, "number", log10) /* @doc: math.isnan @@ -302,7 +302,7 @@ static bool math_kvs_fnc_isnan(KviKvsModuleFunctionCall * c) { kvs_real_t dReal; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("value",KVS_PT_REAL,0,dReal) + KVSM_PARAMETER("value", KVS_PT_REAL, 0, dReal) KVSM_PARAMETERS_END(c) c->returnValue()->setBoolean(std::isnan(dReal)); return true; @@ -326,7 +326,7 @@ static bool math_kvs_fnc_isinf(KviKvsModuleFunctionCall * c) { kvs_real_t dReal; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("value",KVS_PT_REAL,0,dReal) + KVSM_PARAMETER("value", KVS_PT_REAL, 0, dReal) KVSM_PARAMETERS_END(c) c->returnValue()->setBoolean(std::isinf(dReal)); return true; @@ -348,12 +348,12 @@ static bool math_kvs_fnc_isinf(KviKvsModuleFunctionCall * c) static bool math_kvs_fnc_pow(KviKvsModuleFunctionCall * c) { - kvs_real_t dA,dB; + kvs_real_t dA, dB; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("a",KVS_PT_REAL,0,dA) - KVSM_PARAMETER("b",KVS_PT_REAL,0,dB) + KVSM_PARAMETER("a", KVS_PT_REAL, 0, dA) + KVSM_PARAMETER("b", KVS_PT_REAL, 0, dB) KVSM_PARAMETERS_END(c) - c->returnValue()->setReal(pow(dA,dB)); + c->returnValue()->setReal(pow(dA, dB)); return true; } @@ -415,25 +415,25 @@ static bool math_kvs_fnc_e(KviKvsModuleFunctionCall * c) static bool math_module_init(KviModule * m) { - KVSM_REGISTER_FUNCTION(m,"sin",math_kvs_fnc_sin); - KVSM_REGISTER_FUNCTION(m,"cos",math_kvs_fnc_cos); - KVSM_REGISTER_FUNCTION(m,"tan",math_kvs_fnc_tan); - KVSM_REGISTER_FUNCTION(m,"asin",math_kvs_fnc_asin); - KVSM_REGISTER_FUNCTION(m,"acos",math_kvs_fnc_acos); - KVSM_REGISTER_FUNCTION(m,"atan",math_kvs_fnc_atan); - KVSM_REGISTER_FUNCTION(m,"sqrt",math_kvs_fnc_sqrt); - KVSM_REGISTER_FUNCTION(m,"cbrt",math_kvs_fnc_cbrt); - KVSM_REGISTER_FUNCTION(m,"abs",math_kvs_fnc_abs); - KVSM_REGISTER_FUNCTION(m,"floor",math_kvs_fnc_floor); - KVSM_REGISTER_FUNCTION(m,"ceil",math_kvs_fnc_ceil); - KVSM_REGISTER_FUNCTION(m,"pow",math_kvs_fnc_pow); - KVSM_REGISTER_FUNCTION(m,"exp",math_kvs_fnc_exp); - KVSM_REGISTER_FUNCTION(m,"log",math_kvs_fnc_log); - KVSM_REGISTER_FUNCTION(m,"log10",math_kvs_fnc_log10); - KVSM_REGISTER_FUNCTION(m,"pi",math_kvs_fnc_pi); - KVSM_REGISTER_FUNCTION(m,"e",math_kvs_fnc_e); - KVSM_REGISTER_FUNCTION(m,"isnan",math_kvs_fnc_isnan); - KVSM_REGISTER_FUNCTION(m,"isinf",math_kvs_fnc_isinf); + KVSM_REGISTER_FUNCTION(m, "sin", math_kvs_fnc_sin); + KVSM_REGISTER_FUNCTION(m, "cos", math_kvs_fnc_cos); + KVSM_REGISTER_FUNCTION(m, "tan", math_kvs_fnc_tan); + KVSM_REGISTER_FUNCTION(m, "asin", math_kvs_fnc_asin); + KVSM_REGISTER_FUNCTION(m, "acos", math_kvs_fnc_acos); + KVSM_REGISTER_FUNCTION(m, "atan", math_kvs_fnc_atan); + KVSM_REGISTER_FUNCTION(m, "sqrt", math_kvs_fnc_sqrt); + KVSM_REGISTER_FUNCTION(m, "cbrt", math_kvs_fnc_cbrt); + KVSM_REGISTER_FUNCTION(m, "abs", math_kvs_fnc_abs); + KVSM_REGISTER_FUNCTION(m, "floor", math_kvs_fnc_floor); + KVSM_REGISTER_FUNCTION(m, "ceil", math_kvs_fnc_ceil); + KVSM_REGISTER_FUNCTION(m, "pow", math_kvs_fnc_pow); + KVSM_REGISTER_FUNCTION(m, "exp", math_kvs_fnc_exp); + KVSM_REGISTER_FUNCTION(m, "log", math_kvs_fnc_log); + KVSM_REGISTER_FUNCTION(m, "log10", math_kvs_fnc_log10); + KVSM_REGISTER_FUNCTION(m, "pi", math_kvs_fnc_pi); + KVSM_REGISTER_FUNCTION(m, "e", math_kvs_fnc_e); + KVSM_REGISTER_FUNCTION(m, "isnan", math_kvs_fnc_isnan); + KVSM_REGISTER_FUNCTION(m, "isinf", math_kvs_fnc_isinf); return true; } @@ -443,15 +443,14 @@ static bool math_module_cleanup(KviModule *) } KVIRC_MODULE( - "Math", // module name - "4.0.0", // module version - "Copyright (C) 2006 Szymon Stefanek (pragma at kvirc dot net),"\ - "Tonino Imbesi (grifisx at barmes dot org)," \ - "Alessandro Carbone (elfonol at gmail dot com)", - "Mathematical function module", - math_module_init, - 0, - 0, - math_module_cleanup, - 0 -) + "Math", // module name + "4.0.0", // module version + "Copyright (C) 2006 Szymon Stefanek (pragma at kvirc dot net)," + "Tonino Imbesi (grifisx at barmes dot org)," + "Alessandro Carbone (elfonol at gmail dot com)", + "Mathematical function module", + math_module_init, + 0, + 0, + math_module_cleanup, + 0) diff --git a/src/modules/mediaplayer/MpAmipInterface.cpp b/src/modules/mediaplayer/MpAmipInterface.cpp index 1e01aac05..ddea46685 100644 --- a/src/modules/mediaplayer/MpAmipInterface.cpp +++ b/src/modules/mediaplayer/MpAmipInterface.cpp @@ -53,15 +53,16 @@ enum ac_ErrorCode static HINSTANCE amip_dll = NULL; -#define MP_AC_DYNPTR(__rettype,__func,__args) \ - typedef __rettype (CALLBACK* lp_##__func)(__args); \ +#define MP_AC_DYNPTR(__rettype, __func, __args) \ + typedef __rettype(CALLBACK * lp_##__func)(__args); \ lp_##__func __func -#define MP_AC_FUNC(__func) \ - __func = (lp_##__func)GetProcAddress(amip_dll,#__func); \ - if(!__func) { \ - FreeLibrary(amip_dll); \ - return false; \ +#define MP_AC_FUNC(__func) \ + __func = (lp_##__func)GetProcAddress(amip_dll, #__func); \ + if(!__func) \ + { \ + FreeLibrary(amip_dll); \ + return false; \ } #define COMMA() , @@ -72,13 +73,13 @@ MP_AC_DYNPTR(void, ac_getDestHost, char * out); MP_AC_DYNPTR(int, ac_getDestPort, void); MP_AC_DYNPTR(bool, ac_pingServer, const char * host COMMA() int port COMMA() int timeout); MP_AC_DYNPTR(int, ac_exec, const char * cmd); -MP_AC_DYNPTR(int, ac_eval, const char * cmd COMMA() char *result); - +MP_AC_DYNPTR(int, ac_eval, const char * cmd COMMA() char * result); static bool loadAmipDll() { amip_dll = LoadLibrary("ac.dll"); - if (!amip_dll) return false; + if(!amip_dll) + return false; MP_AC_FUNC(ac_init); MP_AC_FUNC(ac_uninit); @@ -102,26 +103,23 @@ static QTextCodec * mediaplayer_get_codec() } MP_IMPLEMENT_DESCRIPTOR( - MpAmipInterface, - "amip", - __tr2qs_ctx( - "An interface for the AMIP plugin.\n" \ - "You can download it from http://amip.tools-for.net\n" \ - "To use this interface you must " \ - "install AMIP plugin for your player." - , - "mediaplayer" - ) -) - - + MpAmipInterface, + "amip", + __tr2qs_ctx( + "An interface for the AMIP plugin.\n" + "You can download it from http://amip.tools-for.net\n" + "To use this interface you must " + "install AMIP plugin for your player.", + "mediaplayer")) MpAmipInterface::MpAmipInterface() -: MpInterface() + : MpInterface() { - if(!amip_dll) { + if(!amip_dll) + { bool res = loadAmipDll(); - if(!res) { + if(!res) + { amip_dll = NULL; return; } @@ -131,52 +129,56 @@ MpAmipInterface::MpAmipInterface() MpAmipInterface::~MpAmipInterface() { - if(!amip_dll) return; + if(!amip_dll) + return; ac_uninit(); FreeLibrary(amip_dll); amip_dll = NULL; } - int MpAmipInterface::detect(bool bStart) { - if(!amip_dll) return 0; + if(!amip_dll) + return 0; char host[AC_BUFFER_SIZE]; ac_getDestHost(host); - if(ac_pingServer(host, ac_getDestPort(), 5000)) return 99; + if(ac_pingServer(host, ac_getDestPort(), 5000)) + return 99; return 1; } -#define MP_AMIP_COMMAND(__cmdname,__acmd) \ - bool MpAmipInterface::__cmdname() \ - { \ +#define MP_AMIP_COMMAND(__cmdname, __acmd) \ + bool MpAmipInterface::__cmdname() \ + { \ return (ac_exec(__acmd) == AC_ERR_NOERROR); \ } -MP_AMIP_COMMAND(play,"control play") -MP_AMIP_COMMAND(stop,"control stop") -MP_AMIP_COMMAND(next,"control >") -MP_AMIP_COMMAND(prev,"control <") -MP_AMIP_COMMAND(pause,"control pause") -MP_AMIP_COMMAND(quit,"control exit") +MP_AMIP_COMMAND(play, "control play") +MP_AMIP_COMMAND(stop, "control stop") +MP_AMIP_COMMAND(next, "control >") +MP_AMIP_COMMAND(prev, "control <") +MP_AMIP_COMMAND(pause, "control pause") +MP_AMIP_COMMAND(quit, "control exit") // helper function for evaluating variables returning integers -int eval_int(const char *var) +int eval_int(const char * var) { - if(!amip_dll) return -1; + if(!amip_dll) + return -1; char buff[AC_BUFFER_SIZE]; int res = -1; - if (AC_ERR_NOERROR == ac_eval(var, buff)) + if(AC_ERR_NOERROR == ac_eval(var, buff)) res = atoi(buff); return res; } -QString eval_str(const char *var) +QString eval_str(const char * var) { QString res; - if(!amip_dll) return res; + if(!amip_dll) + return res; char buff[AC_BUFFER_SIZE]; - if (AC_ERR_NOERROR == ac_eval(var, buff)) + if(AC_ERR_NOERROR == ac_eval(var, buff)) res.append(buff); return res; } @@ -218,16 +220,16 @@ MpInterface::PlayerStatus MpAmipInterface::status() { case 0: return MpInterface::Stopped; - break; + break; case 3: return MpInterface::Paused; - break; + break; case 1: return MpInterface::Playing; - break; + break; default: return MpInterface::Unknown; - break; + break; } return MpInterface::Unknown; } @@ -240,7 +242,9 @@ QString MpAmipInterface::mrl() if(pCodec) { szRet = pCodec->toUnicode(szFn.toUtf8()); - } else { + } + else + { szRet = szFn; } @@ -255,9 +259,12 @@ QString getAmipString(const char * var) QString szRet; QString szString = eval_str(var); QTextCodec * pCodec = mediaplayer_get_codec(); - if(pCodec) { + if(pCodec) + { szRet = pCodec->toUnicode(szString.toUtf8()); - } else { + } + else + { szRet = szString; } return szRet; @@ -298,9 +305,10 @@ QString MpAmipInterface::genre() return getAmipString("var_7"); } -bool MpAmipInterface::setVol(kvs_int_t &iVol) +bool MpAmipInterface::setVol(kvs_int_t & iVol) { - if(!amip_dll) return false; + if(!amip_dll) + return false; char volcmd[AC_BUFFER_SIZE]; sprintf(volcmd, "control vol %d", iVol); return (ac_exec(volcmd) == AC_ERR_NOERROR); @@ -311,11 +319,12 @@ int MpAmipInterface::getVol() return eval_int("var_vol"); } -bool MpAmipInterface::jumpTo(kvs_int_t &iPos) +bool MpAmipInterface::jumpTo(kvs_int_t & iPos) { - if(!amip_dll) return false; + if(!amip_dll) + return false; char jmpcmd[AC_BUFFER_SIZE]; - sprintf(jmpcmd, "jumptotime %d", iPos/1000); + sprintf(jmpcmd, "jumptotime %d", iPos / 1000); return (ac_exec(jmpcmd) == AC_ERR_NOERROR); } bool MpAmipInterface::hide() @@ -342,13 +351,15 @@ bool MpAmipInterface::show() bool MpAmipInterface::minimize() { - if(!amip_dll) return false; + if(!amip_dll) + return false; return (ac_exec("control mimimize") == AC_ERR_NOERROR); } -bool MpAmipInterface::setPlayListPos(kvs_int_t &iPos) +bool MpAmipInterface::setPlayListPos(kvs_int_t & iPos) { - if(!amip_dll) return false; + if(!amip_dll) + return false; char jmpcmd[AC_BUFFER_SIZE]; sprintf(jmpcmd, "setplpos %d", iPos + 1); return (ac_exec(jmpcmd) == AC_ERR_NOERROR); @@ -374,48 +385,55 @@ bool MpAmipInterface::getShuffle() return eval_str("var_shuffle").startsWith("on"); } -bool MpAmipInterface::setShuffle(bool &bVal) +bool MpAmipInterface::setShuffle(bool & bVal) { - if(!amip_dll) return false; + if(!amip_dll) + return false; bool res; - if (bVal) + if(bVal) res = (ac_exec("setshuffle on") == AC_ERR_NOERROR); else res = (ac_exec("setshuffle off") == AC_ERR_NOERROR); return res; } -bool MpAmipInterface::setRepeat(bool &bVal) +bool MpAmipInterface::setRepeat(bool & bVal) { - if(!amip_dll) return false; + if(!amip_dll) + return false; bool res; - if (bVal) + if(bVal) res = (ac_exec("setrepeat on") == AC_ERR_NOERROR); else res = (ac_exec("setrepeat off") == AC_ERR_NOERROR); return res; } -bool MpAmipInterface::amipExec(const QString &cmd) +bool MpAmipInterface::amipExec(const QString & cmd) { - if(!amip_dll) return false; - QTextCodec *c=mediaplayer_get_codec(); + if(!amip_dll) + return false; + QTextCodec * c = mediaplayer_get_codec(); KviCString szCmd = c ? c->fromUnicode(cmd) : cmd.toUtf8(); return (ac_exec(szCmd) == AC_ERR_NOERROR); } -QString MpAmipInterface::amipEval(const QString &cmd) +QString MpAmipInterface::amipEval(const QString & cmd) { QString ret; - if(!amip_dll) return ret; - QTextCodec *c=mediaplayer_get_codec(); + if(!amip_dll) + return ret; + QTextCodec * c = mediaplayer_get_codec(); KviCString szCmd = c ? c->fromUnicode(cmd) : cmd.toUtf8(); char buff[AC_BUFFER_SIZE]; - if((ac_eval(szCmd, buff) == AC_ERR_NOERROR)) { + if((ac_eval(szCmd, buff) == AC_ERR_NOERROR)) + { QString s = buff; - QTextCodec *c=mediaplayer_get_codec(); - if (c) ret = c->toUnicode(s.toLatin1()); - else ret=s; + QTextCodec * c = mediaplayer_get_codec(); + if(c) + ret = c->toUnicode(s.toLatin1()); + else + ret = s; } return ret; } diff --git a/src/modules/mediaplayer/MpAmipInterface.h b/src/modules/mediaplayer/MpAmipInterface.h index 57ec57138..8e39a5057 100644 --- a/src/modules/mediaplayer/MpAmipInterface.h +++ b/src/modules/mediaplayer/MpAmipInterface.h @@ -28,53 +28,54 @@ #if defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW) - #include "MpInterface.h" +#include "MpInterface.h" - class MpAmipInterface : public MpInterface - { - public: - MpAmipInterface(); - ~MpAmipInterface(); - public: - virtual int detect(bool bStart); - virtual bool prev(); - virtual bool next(); - virtual bool play(); - virtual bool stop(); - virtual bool pause(); - virtual bool quit(); - virtual QString nowPlaying(); - virtual QString artist(); - virtual QString title(); - virtual QString genre(); - virtual QString comment(); - virtual QString album(); - virtual QString year(); - virtual QString mrl(); - virtual int position(); - virtual int length(); - virtual bool setVol(kvs_int_t &iVol); - virtual int getVol(); - virtual bool jumpTo(kvs_int_t &iPos); - virtual int sampleRate(); - virtual int bitRate(); - virtual int channels(); - virtual bool hide(); - virtual bool show(); - virtual bool minimize(); - virtual int getPlayListPos(); - virtual bool setPlayListPos(kvs_int_t &iPos); - virtual int getListLength(); - virtual bool getRepeat(); - virtual bool getShuffle(); - virtual bool setRepeat(bool &bVal); - virtual bool setShuffle(bool &bVal); - virtual bool amipExec(const QString &cmd); - virtual QString amipEval(const QString &cmd); - virtual MpInterface::PlayerStatus status(); - }; +class MpAmipInterface : public MpInterface +{ +public: + MpAmipInterface(); + ~MpAmipInterface(); - MP_DECLARE_DESCRIPTOR(MpAmipInterface) +public: + virtual int detect(bool bStart); + virtual bool prev(); + virtual bool next(); + virtual bool play(); + virtual bool stop(); + virtual bool pause(); + virtual bool quit(); + virtual QString nowPlaying(); + virtual QString artist(); + virtual QString title(); + virtual QString genre(); + virtual QString comment(); + virtual QString album(); + virtual QString year(); + virtual QString mrl(); + virtual int position(); + virtual int length(); + virtual bool setVol(kvs_int_t & iVol); + virtual int getVol(); + virtual bool jumpTo(kvs_int_t & iPos); + virtual int sampleRate(); + virtual int bitRate(); + virtual int channels(); + virtual bool hide(); + virtual bool show(); + virtual bool minimize(); + virtual int getPlayListPos(); + virtual bool setPlayListPos(kvs_int_t & iPos); + virtual int getListLength(); + virtual bool getRepeat(); + virtual bool getShuffle(); + virtual bool setRepeat(bool & bVal); + virtual bool setShuffle(bool & bVal); + virtual bool amipExec(const QString & cmd); + virtual QString amipEval(const QString & cmd); + virtual MpInterface::PlayerStatus status(); +}; + +MP_DECLARE_DESCRIPTOR(MpAmipInterface) #endif //COMPILE_ON_WINDOWS diff --git a/src/modules/mediaplayer/MpInterface.cpp b/src/modules/mediaplayer/MpInterface.cpp index d646389a5..f0feb5861 100644 --- a/src/modules/mediaplayer/MpInterface.cpp +++ b/src/modules/mediaplayer/MpInterface.cpp @@ -32,15 +32,15 @@ static QTextCodec * mediaplayer_get_codec() { - QTextCodec * c= QTextCodec::codecForName(KVI_OPTION_STRING(KviOption_stringWinampTextEncoding).toUtf8().data()); - if(!c)c = QTextCodec::codecForLocale(); + QTextCodec * c = QTextCodec::codecForName(KVI_OPTION_STRING(KviOption_stringWinampTextEncoding).toUtf8().data()); + if(!c) + c = QTextCodec::codecForLocale(); return c; - } void MpInterface::notImplemented() { - setLastError(__tr2qs_ctx("Function not implemented","mediaplayer")); + setLastError(__tr2qs_ctx("Function not implemented", "mediaplayer")); } int MpInterface::position() @@ -82,10 +82,11 @@ bool MpInterface::minimize() QString MpInterface::getLocalFile() { QString ret = mrl(); - if(ret.isEmpty())return ret; - if(ret.startsWith("file://",Qt::CaseInsensitive)) + if(ret.isEmpty()) + return ret; + if(ret.startsWith("file://", Qt::CaseInsensitive)) { - ret.remove(0,7); + ret.remove(0, 7); return ret; } return QString(); @@ -96,20 +97,23 @@ QString MpInterface::amipEval(const QString &) return QString(); } -#define SCAN_MP3_FILE \ +#define SCAN_MP3_FILE \ QString f = getLocalFile(); \ - if(f.isEmpty())return QString(); \ - mp3info mp3; \ - if(!scan_mp3_file(f,&mp3))return QString(); \ - QTextCodec *pCodec; \ - pCodec=mediaplayer_get_codec(); - -#define SCAN_MP3_FILE_RET_INT \ + if(f.isEmpty()) \ + return QString(); \ + mp3info mp3; \ + if(!scan_mp3_file(f, &mp3)) \ + return QString(); \ + QTextCodec * pCodec; \ + pCodec = mediaplayer_get_codec(); + +#define SCAN_MP3_FILE_RET_INT \ QString f = getLocalFile(); \ - if(f.isEmpty())return -1; \ - mp3info mp3; \ - if(!scan_mp3_file(f,&mp3))return -1; - + if(f.isEmpty()) \ + return -1; \ + mp3info mp3; \ + if(!scan_mp3_file(f, &mp3)) \ + return -1; QString MpInterface::artist() { @@ -265,12 +269,19 @@ bool MpInterface::setShuffle(bool &) QString MpInterface::mediaType() { QString ret = mrl(); - if(ret.endsWith(".mp3",Qt::CaseInsensitive))ret = "MPEG Layer 3"; - else if(ret.endsWith(".ogg",Qt::CaseInsensitive))ret = "OGG Vorbis"; - else if(ret.endsWith(".avi",Qt::CaseInsensitive))ret = "Audio Video Interleave"; - else if(ret.endsWith(".mpeg",Qt::CaseInsensitive))ret = "MPEG Video"; - else if(ret.endsWith(".mpg",Qt::CaseInsensitive))ret = "MPEG Video"; - else if(ret.startsWith("http://",Qt::CaseInsensitive))ret = "HTTP Audio Stream"; - else ret = QString(); + if(ret.endsWith(".mp3", Qt::CaseInsensitive)) + ret = "MPEG Layer 3"; + else if(ret.endsWith(".ogg", Qt::CaseInsensitive)) + ret = "OGG Vorbis"; + else if(ret.endsWith(".avi", Qt::CaseInsensitive)) + ret = "Audio Video Interleave"; + else if(ret.endsWith(".mpeg", Qt::CaseInsensitive)) + ret = "MPEG Video"; + else if(ret.endsWith(".mpg", Qt::CaseInsensitive)) + ret = "MPEG Video"; + else if(ret.startsWith("http://", Qt::CaseInsensitive)) + ret = "HTTP Audio Stream"; + else + ret = QString(); return ret; } diff --git a/src/modules/mediaplayer/MpInterface.h b/src/modules/mediaplayer/MpInterface.h index 42c1374a4..aae380f5c 100644 --- a/src/modules/mediaplayer/MpInterface.h +++ b/src/modules/mediaplayer/MpInterface.h @@ -35,8 +35,10 @@ public: // implement lazy initialization in each function instead MpInterface(){}; virtual ~MpInterface(){}; + protected: QString m_szLastError; + public: const QString & lastError() const { return m_szLastError; }; @@ -90,16 +92,16 @@ public: // the mrl may be (or may be not) added to the player's playlist // the function should return false if the player doesn't support // this function or there is a communication error - virtual bool playMrl(const QString &mrl); + virtual bool playMrl(const QString & mrl); // what is this ? :D - virtual bool amipExec(const QString &cmd); - virtual QString amipEval(const QString &cmd); + virtual bool amipExec(const QString & cmd); + virtual QString amipEval(const QString & cmd); // this is functions to hide,show and minimize the player interface virtual bool hide(); virtual bool show(); virtual bool minimize(); // set the volume of mediaplayer (0-255) - virtual bool setVol(kvs_int_t &iVol); + virtual bool setVol(kvs_int_t & iVol); // get the pvolume value(0-255) virtual int getVol(); //mute the volume @@ -108,7 +110,13 @@ public: // return false only on communication failure virtual bool quit(); // return the current player status - enum PlayerStatus { Unknown, Stopped, Playing, Paused }; + enum PlayerStatus + { + Unknown, + Stopped, + Playing, + Paused + }; virtual MpInterface::PlayerStatus status(); // current position in the media (msecs) // 0 if the player isn't playing anything and -1 if unknown @@ -117,7 +125,7 @@ public: // 0 if the player isn't playing anyting and -1 if unknown (e.g. a stream) virtual int length(); // jump to position - virtual bool jumpTo(kvs_int_t &iPos); + virtual bool jumpTo(kvs_int_t & iPos); // interface with a default implementation for certain types of media (read for mp3) // reimplement only if the player knows better @@ -156,83 +164,86 @@ public: // get the position in the playlist virtual int getPlayListPos(); // set the position in the playlist - virtual bool setPlayListPos(kvs_int_t &iPos); + virtual bool setPlayListPos(kvs_int_t & iPos); // return the list's length virtual int getListLength(); // return the Eq(number) value - virtual int getEqData(kvs_int_t &i_val); + virtual int getEqData(kvs_int_t & i_val); // set the Eq(iPos) to Eq(iVal) value - virtual bool setEqData(kvs_int_t &iPos, kvs_int_t &iVal); + virtual bool setEqData(kvs_int_t & iPos, kvs_int_t & iVal); // get the Repeat bool value virtual bool getRepeat(); // get the shuffle bool value virtual bool getShuffle(); // set the Repeat bool value - virtual bool setRepeat(bool &bVal); + virtual bool setRepeat(bool & bVal); // set the shuffle bool value - virtual bool setShuffle(bool &bVal); - void setLastError(const QString &szLastError){ m_szLastError = szLastError; }; + virtual bool setShuffle(bool & bVal); + void setLastError(const QString & szLastError) { m_szLastError = szLastError; }; protected: void notImplemented(); QString getLocalFile(); }; - class MpInterfaceDescriptor { public: MpInterfaceDescriptor(){}; virtual ~MpInterfaceDescriptor(){}; + public: virtual const QString & name() = 0; virtual const QString & description() = 0; virtual MpInterface * instance() = 0; }; - -#define MP_DECLARE_DESCRIPTOR(_interfaceclass) \ - class _interfaceclass ## Descriptor : public MpInterfaceDescriptor \ - { \ - public: \ - _interfaceclass ## Descriptor(); \ - virtual ~_interfaceclass ## Descriptor(); \ - protected: \ - _interfaceclass * m_pInstance; \ - QString m_szName; \ - QString m_szDescription; \ - public: \ - virtual const QString & name(); \ - virtual const QString & description(); \ - virtual MpInterface * instance(); \ +#define MP_DECLARE_DESCRIPTOR(_interfaceclass) \ + class _interfaceclass##Descriptor : public MpInterfaceDescriptor \ + { \ + public: \ + _interfaceclass##Descriptor(); \ + virtual ~_interfaceclass##Descriptor(); \ + \ + protected: \ + _interfaceclass * m_pInstance; \ + QString m_szName; \ + QString m_szDescription; \ + \ + public: \ + virtual const QString & name(); \ + virtual const QString & description(); \ + virtual MpInterface * instance(); \ }; -#define MP_IMPLEMENT_DESCRIPTOR(_interfaceclass,_name,_description) \ - _interfaceclass ## Descriptor::_interfaceclass ## Descriptor() \ - : MpInterfaceDescriptor() \ - { \ - m_pInstance = 0; \ - m_szName = _name; \ - m_szDescription = _description; \ - } \ - _interfaceclass ## Descriptor::~_interfaceclass ## Descriptor() \ - { \ - if(m_pInstance)delete m_pInstance; \ - } \ - const QString & _interfaceclass ## Descriptor::name() \ - { \ - return m_szName; \ - } \ - const QString & _interfaceclass ## Descriptor::description() \ - { \ - return m_szDescription; \ - } \ - MpInterface * _interfaceclass ## Descriptor::instance() \ - { \ - if(!m_pInstance)m_pInstance = new _interfaceclass(); \ - return m_pInstance; \ +#define MP_IMPLEMENT_DESCRIPTOR(_interfaceclass, _name, _description) \ + _interfaceclass##Descriptor::_interfaceclass##Descriptor() \ + : MpInterfaceDescriptor() \ + { \ + m_pInstance = 0; \ + m_szName = _name; \ + m_szDescription = _description; \ + } \ + _interfaceclass##Descriptor::~_interfaceclass##Descriptor() \ + { \ + if(m_pInstance) \ + delete m_pInstance; \ + } \ + const QString & _interfaceclass##Descriptor::name() \ + { \ + return m_szName; \ + } \ + const QString & _interfaceclass##Descriptor::description() \ + { \ + return m_szDescription; \ + } \ + MpInterface * _interfaceclass##Descriptor::instance() \ + { \ + if(!m_pInstance) \ + m_pInstance = new _interfaceclass(); \ + return m_pInstance; \ } #define MP_CREATE_DESCRIPTOR(_interfaceclass) \ - new _interfaceclass ## Descriptor() + new _interfaceclass##Descriptor() #endif //!_MP_INTERFACE_H_ diff --git a/src/modules/mediaplayer/MpMp3.cpp b/src/modules/mediaplayer/MpMp3.cpp index 59aae7560..caf35b8e7 100644 --- a/src/modules/mediaplayer/MpMp3.cpp +++ b/src/modules/mediaplayer/MpMp3.cpp @@ -43,8 +43,8 @@ #include #include -#define MAXGENRE 147 -#define GENREROWS 50 +#define MAXGENRE 147 +#define GENREROWS 50 /* The Information is stored in the last 128 bytes of an MP3. The Tag @@ -88,264 +88,263 @@ starting from 0. See A.3. */ - -const char *typegenre [MAXGENRE+2] = -{ - "Blues","Classic Rock","Country","Dance","Disco","Funk","Grunge", - "Hip-Hop","Jazz","Metal","New Age","Oldies","Other","Pop","R&B", - "Rap","Reggae","Rock","Techno","Industrial","Alternative","Ska", - "Death Metal","Pranks","Soundtrack","Euro-Techno","Ambient", - "Trip-Hop","Vocal","Jazz+Funk","Fusion","Trance","Classical", - "Instrumental","Acid","House","Game","Sound Clip","Gospel","Noise", - "Alt. Rock","Bass","Soul","Punk","Space","Meditative", - "Instrumental Pop","Instrumental Rock","Ethnic","Gothic", - "Darkwave","Techno-Industrial","Electronic","Pop-Folk","Eurodance", - "Dream","Southern Rock","Comedy","Cult","Gangsta Rap","Top 40", - "Christian Rap","Pop/Funk","Jungle","Native American","Cabaret", - "New Wave","Psychedelic","Rave","Showtunes","Trailer","Lo-Fi", - "Tribal","Acid Punk","Acid Jazz","Polka","Retro","Musical", - "Rock & Roll","Hard Rock","Folk","Folk/Rock","National Folk", - "Swing","Fast-Fusion","Bebob","Latin","Revival","Celtic", - "Bluegrass","Avantgarde","Gothic Rock","Progressive Rock", - "Psychedelic Rock","Symphonic Rock","Slow Rock","Big Band", - "Chorus","Easy Listening","Acoustic","Humour","Speech","Chanson", - "Opera","Chamber Music","Sonata","Symphony","Booty Bass","Primus", - "Porn Groove","Satire","Slow Jam","Club","Tango","Samba", - "Folklore","Ballad","Power Ballad","Rhythmic Soul","Freestyle", - "Duet","Punk Rock","Drum Solo","A Cappella","Euro-House", - "Dance Hall","Goa","Drum & Bass","Club-House","Hardcore","Terror", - "Indie","BritPop","Negerpunk","Polsk Punk","Beat", - "Christian Gangsta Rap","Heavy Metal","Black Metal","Crossover", - "Contemporary Christian","Christian Rock","Merengue","Salsa", - "Thrash Metal","Anime","JPop","Synthpop","" +const char * typegenre[MAXGENRE + 2] = { + "Blues", "Classic Rock", "Country", "Dance", "Disco", "Funk", "Grunge", + "Hip-Hop", "Jazz", "Metal", "New Age", "Oldies", "Other", "Pop", "R&B", + "Rap", "Reggae", "Rock", "Techno", "Industrial", "Alternative", "Ska", + "Death Metal", "Pranks", "Soundtrack", "Euro-Techno", "Ambient", + "Trip-Hop", "Vocal", "Jazz+Funk", "Fusion", "Trance", "Classical", + "Instrumental", "Acid", "House", "Game", "Sound Clip", "Gospel", "Noise", + "Alt. Rock", "Bass", "Soul", "Punk", "Space", "Meditative", + "Instrumental Pop", "Instrumental Rock", "Ethnic", "Gothic", + "Darkwave", "Techno-Industrial", "Electronic", "Pop-Folk", "Eurodance", + "Dream", "Southern Rock", "Comedy", "Cult", "Gangsta Rap", "Top 40", + "Christian Rap", "Pop/Funk", "Jungle", "Native American", "Cabaret", + "New Wave", "Psychedelic", "Rave", "Showtunes", "Trailer", "Lo-Fi", + "Tribal", "Acid Punk", "Acid Jazz", "Polka", "Retro", "Musical", + "Rock & Roll", "Hard Rock", "Folk", "Folk/Rock", "National Folk", + "Swing", "Fast-Fusion", "Bebob", "Latin", "Revival", "Celtic", + "Bluegrass", "Avantgarde", "Gothic Rock", "Progressive Rock", + "Psychedelic Rock", "Symphonic Rock", "Slow Rock", "Big Band", + "Chorus", "Easy Listening", "Acoustic", "Humour", "Speech", "Chanson", + "Opera", "Chamber Music", "Sonata", "Symphony", "Booty Bass", "Primus", + "Porn Groove", "Satire", "Slow Jam", "Club", "Tango", "Samba", + "Folklore", "Ballad", "Power Ballad", "Rhythmic Soul", "Freestyle", + "Duet", "Punk Rock", "Drum Solo", "A Cappella", "Euro-House", + "Dance Hall", "Goa", "Drum & Bass", "Club-House", "Hardcore", "Terror", + "Indie", "BritPop", "Negerpunk", "Polsk Punk", "Beat", + "Christian Gangsta Rap", "Heavy Metal", "Black Metal", "Crossover", + "Contemporary Christian", "Christian Rock", "Merengue", "Salsa", + "Thrash Metal", "Anime", "JPop", "Synthpop", "" }; const char * get_typegenre(int idx) { - if(idx > MAXGENRE)return typegenre[12]; + if(idx > MAXGENRE) + return typegenre[12]; return typegenre[idx]; } -int galphagenreindex[MAXGENRE+2] = -{ - 148,123,74,73,34,99,40,20,26,145,90, - 116,41,135,85,96,138,89,0,107,132,65,88, - 104,102,97,136,61,141,1,32,128,112,57,140, - 2,139,58,125,3,50,22,4,55,127,122,120, - 98,52,48,124,25,54,84,81,115,80,119,5, - 30,36,59,126,38,91,49,6,79,129,137,7, - 35,100,131,19,46,47,33,146,29,8,63,86, - 71,45,142,9,77,82,64,133,10,66,39,11, - 103,12,75,134,53,62,13,109,117,23,108,92, - 93,67,121,43,14,15,68,16,76,87,118,78, - 17,143,114,110,69,21,111,95,105,42,37,24, - 56,44,101,83,94,106,147,113,51,18,130,144, - 60,70,31,72,27,28 +int galphagenreindex[MAXGENRE + 2] = { + 148, 123, 74, 73, 34, 99, 40, 20, 26, 145, 90, + 116, 41, 135, 85, 96, 138, 89, 0, 107, 132, 65, 88, + 104, 102, 97, 136, 61, 141, 1, 32, 128, 112, 57, 140, + 2, 139, 58, 125, 3, 50, 22, 4, 55, 127, 122, 120, + 98, 52, 48, 124, 25, 54, 84, 81, 115, 80, 119, 5, + 30, 36, 59, 126, 38, 91, 49, 6, 79, 129, 137, 7, + 35, 100, 131, 19, 46, 47, 33, 146, 29, 8, 63, 86, + 71, 45, 142, 9, 77, 82, 64, 133, 10, 66, 39, 11, + 103, 12, 75, 134, 53, 62, 13, 109, 117, 23, 108, 92, + 93, 67, 121, 43, 14, 15, 68, 16, 76, 87, 118, 78, + 17, 143, 114, 110, 69, 21, 111, 95, 105, 42, 37, 24, + 56, 44, 101, 83, 94, 106, 147, 113, 51, 18, 130, 144, + 60, 70, 31, 72, 27, 28 }; -int *alphagenreindex=&(galphagenreindex[1]); - +int * alphagenreindex = &(galphagenreindex[1]); -int layer_tab[4]= {0, 3, 2, 1}; +int layer_tab[4] = { 0, 3, 2, 1 }; -int frequencies[3][4] = -{ - {22050,24000,16000,50000}, /* MPEG 2.0 */ - {44100,48000,32000,50000}, /* MPEG 1.0 */ - {11025,12000,8000,50000} /* MPEG 2.5 */ +int frequencies[3][4] = { + { 22050, 24000, 16000, 50000 }, /* MPEG 2.0 */ + { 44100, 48000, 32000, 50000 }, /* MPEG 1.0 */ + { 11025, 12000, 8000, 50000 } /* MPEG 2.5 */ }; -int bitrate[2][3][14] = -{ - { /* MPEG 2.0 */ - {32,48,56,64,80,96,112,128,144,160,176,192,224,256}, /* layer 1 */ - {8,16,24,32,40,48,56,64,80,96,112,128,144,160}, /* layer 2 */ - {8,16,24,32,40,48,56,64,80,96,112,128,144,160} /* layer 3 */ +int bitrate[2][3][14] = { + { + /* MPEG 2.0 */ + { 32, 48, 56, 64, 80, 96, 112, 128, 144, 160, 176, 192, 224, 256 }, /* layer 1 */ + { 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144, 160 }, /* layer 2 */ + { 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144, 160 } /* layer 3 */ }, - { /* MPEG 1.0 */ - {32,64,96,128,160,192,224,256,288,320,352,384,416,448}, /* layer 1 */ - {32,48,56,64,80,96,112,128,160,192,224,256,320,384}, /* layer 2 */ - {32,40,48,56,64,80,96,112,128,160,192,224,256,320} /* layer 3 */ + { + /* MPEG 1.0 */ + { 32, 64, 96, 128, 160, 192, 224, 256, 288, 320, 352, 384, 416, 448 }, /* layer 1 */ + { 32, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, 384 }, /* layer 2 */ + { 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320 } /* layer 3 */ } }; -int frame_size_index[] = {24000, 72000, 72000}; +int frame_size_index[] = { 24000, 72000, 72000 }; -const char *mode_text[] = -{ +const char * mode_text[] = { "Stereo", "Joint Stereo", "Dual Channel", "Mono" }; -const char *emphasis_text[] = -{ +const char * emphasis_text[] = { "None", "50/15 Microseconds", "Reserved", "CCITT J 17" }; -void resetmp3infoStruct(mp3info *i) +void resetmp3infoStruct(mp3info * i) { - i->file=0; - i->datasize=0; - i->header_isvalid=0; - memset(&i->header,0,sizeof(i->header)); - i->id3_isvalid=0; - memset(&i->id3,0,sizeof(i->id3)); - i->vbr=0; - i->vbr_average=0; - i->seconds=0; - i->frames=0; - i->badframes=0; + i->file = 0; + i->datasize = 0; + i->header_isvalid = 0; + memset(&i->header, 0, sizeof(i->header)); + i->id3_isvalid = 0; + memset(&i->id3, 0, sizeof(i->id3)); + i->vbr = 0; + i->vbr_average = 0; + i->seconds = 0; + i->frames = 0; + i->badframes = 0; } -int get_mp3_info(mp3info *mp3) +int get_mp3_info(mp3info * mp3) { -// mp3header header; + // mp3header header; QFile fi(mp3->filename); - mp3->datasize=fi.size();//filestat.st_size; + mp3->datasize = fi.size(); //filestat.st_size; get_id3(mp3); - if(get_first_header(mp3,0L)) + if(get_first_header(mp3, 0L)) { - int bitrate,counter=0; - int data_start=ftell(mp3->file); - int lastrate=15-mp3->header.bitrate; + int bitrate, counter = 0; + int data_start = ftell(mp3->file); + int lastrate = 15 - mp3->header.bitrate; while((counter < NUM_SAMPLES) && lastrate) { - int sample_pos=(counter*(mp3->datasize/NUM_SAMPLES+1))+data_start; - if(get_first_header(mp3,sample_pos)) + int sample_pos = (counter * (mp3->datasize / NUM_SAMPLES + 1)) + data_start; + if(get_first_header(mp3, sample_pos)) { - bitrate=15-mp3->header.bitrate; - } else { - bitrate=-1; + bitrate = 15 - mp3->header.bitrate; + } + else + { + bitrate = -1; } if(bitrate != lastrate) { - mp3->vbr=1; + mp3->vbr = 1; } - lastrate=bitrate; + lastrate = bitrate; counter++; - } - mp3->frames=(mp3->datasize-data_start)/(frame_length(&mp3->header)); - mp3->seconds = (int)((float)(frame_length(&mp3->header)*mp3->frames)/ - (float)(header_bitrate(&mp3->header)*125)+0.5); + mp3->frames = (mp3->datasize - data_start) / (frame_length(&mp3->header)); + mp3->seconds = (int)((float)(frame_length(&mp3->header) * mp3->frames) / (float)(header_bitrate(&mp3->header) * 125) + 0.5); mp3->vbr_average = (float)header_bitrate(&mp3->header); } return 0; } -int get_first_header(mp3info *mp3, long startpos) +int get_first_header(mp3info * mp3, long startpos) { - int k, l=0,c; + int k, l = 0, c; mp3header h, h2; - long valid_start=0; + long valid_start = 0; - fseek(mp3->file,startpos,SEEK_SET); + fseek(mp3->file, startpos, SEEK_SET); while(1) { - while((c=fgetc(mp3->file)) != 255 && (c != EOF)) {} + while((c = fgetc(mp3->file)) != 255 && (c != EOF)) + { + } if(c == 255) { - ungetc(c,mp3->file); - valid_start=ftell(mp3->file); - if((l=get_header(mp3->file,&h))) + ungetc(c, mp3->file); + valid_start = ftell(mp3->file); + if((l = get_header(mp3->file, &h))) { - fseek(mp3->file,l-FRAME_HEADER_SIZE,SEEK_CUR); - for(k=1; (k < MIN_CONSEC_GOOD_FRAMES) && (mp3->datasize-ftell(mp3->file) >= FRAME_HEADER_SIZE); k++) + fseek(mp3->file, l - FRAME_HEADER_SIZE, SEEK_CUR); + for(k = 1; (k < MIN_CONSEC_GOOD_FRAMES) && (mp3->datasize - ftell(mp3->file) >= FRAME_HEADER_SIZE); k++) { - if(!(l=get_header(mp3->file,&h2))) break; - if(!sameConstant(&h,&h2)) break; - fseek(mp3->file,l-FRAME_HEADER_SIZE,SEEK_CUR); + if(!(l = get_header(mp3->file, &h2))) + break; + if(!sameConstant(&h, &h2)) + break; + fseek(mp3->file, l - FRAME_HEADER_SIZE, SEEK_CUR); } if(k == MIN_CONSEC_GOOD_FRAMES) { - fseek(mp3->file,valid_start,SEEK_SET); + fseek(mp3->file, valid_start, SEEK_SET); memcpy(&(mp3->header), &h2, sizeof(mp3header)); mp3->header_isvalid = 1; return 1; } } - } else { + } + else + { return 0; } } return 0; } - // Get next MP3 frame header. // Return codes: // positive value = Frame Length of this header // 0 = No, we did not retrieve a valid frame header -int get_header(FILE *file,mp3header *header) +int get_header(FILE * file, mp3header * header) { unsigned char buffer[FRAME_HEADER_SIZE]; int fl; - if(fread(&buffer,FRAME_HEADER_SIZE,1,file)<1) + if(fread(&buffer, FRAME_HEADER_SIZE, 1, file) < 1) { - header->sync=0; + header->sync = 0; return 0; } - header->sync=(((int)buffer[0]<<4) | ((int)(buffer[1]&0xE0)>>4)); - if(buffer[1] & 0x10) header->version=(buffer[1] >> 3) & 1; - else header->version=2; - header->layer=(buffer[1] >> 1) & 3; + header->sync = (((int)buffer[0] << 4) | ((int)(buffer[1] & 0xE0) >> 4)); + if(buffer[1] & 0x10) + header->version = (buffer[1] >> 3) & 1; + else + header->version = 2; + header->layer = (buffer[1] >> 1) & 3; if((header->sync != 0xFFE) || (header->layer != 1)) { - header->sync=0; + header->sync = 0; return 0; } - header->crc=buffer[1] & 1; - header->bitrate=(buffer[2] >> 4) & 0x0F; - header->freq=(buffer[2] >> 2) & 0x3; - header->padding=(buffer[2] >>1) & 0x1; - header->extension=(buffer[2]) & 0x1; - header->mode=(buffer[3] >> 6) & 0x3; - header->mode_extension=(buffer[3] >> 4) & 0x3; - header->copyright=(buffer[3] >> 3) & 0x1; - header->original=(buffer[3] >> 2) & 0x1; - header->emphasis=(buffer[3]) & 0x3; - - return ((fl=frame_length(header)) >= MIN_FRAME_SIZE ? fl : 0); + header->crc = buffer[1] & 1; + header->bitrate = (buffer[2] >> 4) & 0x0F; + header->freq = (buffer[2] >> 2) & 0x3; + header->padding = (buffer[2] >> 1) & 0x1; + header->extension = (buffer[2]) & 0x1; + header->mode = (buffer[3] >> 6) & 0x3; + header->mode_extension = (buffer[3] >> 4) & 0x3; + header->copyright = (buffer[3] >> 3) & 0x1; + header->original = (buffer[3] >> 2) & 0x1; + header->emphasis = (buffer[3]) & 0x3; + + return ((fl = frame_length(header)) >= MIN_FRAME_SIZE ? fl : 0); } -int frame_length(mp3header *header) +int frame_length(mp3header * header) { - return header->sync == 0xFFE ? - (frame_size_index[3-header->layer]*((header->version&1)+1)* - header_bitrate(header)/header_frequency(header))+ - header->padding : 1; + return header->sync == 0xFFE ? (frame_size_index[3 - header->layer] * ((header->version & 1) + 1) * header_bitrate(header) / header_frequency(header)) + header->padding : 1; } -int header_layer(mp3header *h) +int header_layer(mp3header * h) { return layer_tab[h->layer]; } -int header_bitrate(mp3header *h) +int header_bitrate(mp3header * h) { if(h->bitrate > 0) - return bitrate[h->version & 1][3-h->layer][h->bitrate-1]; + return bitrate[h->version & 1][3 - h->layer][h->bitrate - 1]; else return -1; // unknown } -int header_frequency(mp3header *h) +int header_frequency(mp3header * h) { return frequencies[h->version][h->freq]; } -const char *header_emphasis(mp3header *h) +const char * header_emphasis(mp3header * h) { return emphasis_text[h->emphasis]; } -const char *header_mode(mp3header *h) +const char * header_mode(mp3header * h) { return mode_text[h->mode]; } @@ -355,58 +354,61 @@ int header_channels(mp3header * h) return h->mode == 3 ? 1 : 2; } -int header_crc(mp3header *h) +int header_crc(mp3header * h) { return (!h->crc); } -int sameConstant(mp3header *h1, mp3header *h2) +int sameConstant(mp3header * h1, mp3header * h2) { - if((*(uint*)h1) == (*(uint*)h2)) return 1; - - if((h1->version == h2->version ) && - (h1->layer == h2->layer ) && - (h1->crc == h2->crc ) && - (h1->freq == h2->freq ) && - (h1->mode == h2->mode ) && - (h1->copyright == h2->copyright ) && - (h1->original == h2->original ) && - (h1->emphasis == h2->emphasis )) + if((*(uint *)h1) == (*(uint *)h2)) return 1; - else return 0; + + if((h1->version == h2->version) && (h1->layer == h2->layer) && (h1->crc == h2->crc) && (h1->freq == h2->freq) && (h1->mode == h2->mode) && (h1->copyright == h2->copyright) && (h1->original == h2->original) && (h1->emphasis == h2->emphasis)) + return 1; + else + return 0; } -int get_id3(mp3info *mp3) +int get_id3(mp3info * mp3) { // this will read ID3v1 tags - int retcode=0; + int retcode = 0; char fbuf[4]; if(mp3->datasize >= 128) { - if(fseek(mp3->file, -128, SEEK_END )) + if(fseek(mp3->file, -128, SEEK_END)) { retcode |= 4; - } else { - size_t dummy = fread(fbuf,1,3,mp3->file); fbuf[3] = '\0'; + } + else + { + size_t dummy = fread(fbuf, 1, 3, mp3->file); + fbuf[3] = '\0'; Q_UNUSED(dummy); - mp3->id3.genre[0]=255; + mp3->id3.genre[0] = 255; - if(!strcmp((const char *)"TAG",(const char *)fbuf)) + if(!strcmp((const char *)"TAG", (const char *)fbuf)) { - mp3->id3_isvalid=1; + mp3->id3_isvalid = 1; mp3->datasize -= 128; fseek(mp3->file, -125, SEEK_END); - dummy = fread(mp3->id3.title,1,30,mp3->file); mp3->id3.title[30] = '\0'; - dummy = fread(mp3->id3.artist,1,30,mp3->file); mp3->id3.artist[30] = '\0'; - dummy = fread(mp3->id3.album,1,30,mp3->file); mp3->id3.album[30] = '\0'; - dummy = fread(mp3->id3.year,1,4,mp3->file); mp3->id3.year[4] = '\0'; - dummy = fread(mp3->id3.comment,1,30,mp3->file); mp3->id3.comment[30] = '\0'; + dummy = fread(mp3->id3.title, 1, 30, mp3->file); + mp3->id3.title[30] = '\0'; + dummy = fread(mp3->id3.artist, 1, 30, mp3->file); + mp3->id3.artist[30] = '\0'; + dummy = fread(mp3->id3.album, 1, 30, mp3->file); + mp3->id3.album[30] = '\0'; + dummy = fread(mp3->id3.year, 1, 4, mp3->file); + mp3->id3.year[4] = '\0'; + dummy = fread(mp3->id3.comment, 1, 30, mp3->file); + mp3->id3.comment[30] = '\0'; if(mp3->id3.comment[28] == '\0') { mp3->id3.track[0] = mp3->id3.comment[29]; } - dummy = fread(mp3->id3.genre,1,1,mp3->file); + dummy = fread(mp3->id3.genre, 1, 1, mp3->file); unpad(mp3->id3.title); unpad(mp3->id3.artist); unpad(mp3->id3.album); @@ -418,38 +420,39 @@ int get_id3(mp3info *mp3) return retcode; } -char *pad(char *string, int length) +char * pad(char * string, int length) { int l; - l=strlen(string); - while(lfilename = "text"; - i->file = fopen(QTextCodec::codecForLocale()->fromUnicode(i->filename).data(),"rb"); - if(!i->file)return false; + i->file = fopen(QTextCodec::codecForLocale()->fromUnicode(i->filename).data(), "rb"); + if(!i->file) + return false; get_mp3_info(i); diff --git a/src/modules/mediaplayer/MpMp3.h b/src/modules/mediaplayer/MpMp3.h index f9b88f0d6..6d534e625 100644 --- a/src/modules/mediaplayer/MpMp3.h +++ b/src/modules/mediaplayer/MpMp3.h @@ -43,9 +43,8 @@ #define FRAME_HEADER_SIZE 4 #define MIN_FRAME_SIZE 21 #define NUM_SAMPLES 4 -#define TEXT_FIELD_LEN 30 -#define INT_FIELD_LEN 4 - +#define TEXT_FIELD_LEN 30 +#define INT_FIELD_LEN 4 #include "kvi_settings.h" @@ -54,16 +53,21 @@ #include #if !defined(COMPILE_ON_WINDOWS) && !defined(COMPILE_ON_MINGW) - #include - #include - #include - #include +#include +#include +#include +#include #endif +enum VBR_REPORT +{ + VBR_VARIABLE, + VBR_AVERAGE, + VBR_MEDIAN +}; -enum VBR_REPORT { VBR_VARIABLE, VBR_AVERAGE, VBR_MEDIAN }; - -typedef struct { +typedef struct +{ unsigned int sync; unsigned int version; unsigned int layer; @@ -79,7 +83,8 @@ typedef struct { unsigned int emphasis; } mp3header; -typedef struct { +typedef struct +{ char title[31]; char artist[31]; char album[31]; @@ -89,9 +94,10 @@ typedef struct { unsigned char genre[1]; } id3tag; -typedef struct { +typedef struct +{ QString filename; - FILE *file; + FILE * file; unsigned int datasize; int header_isvalid; mp3header header; @@ -110,25 +116,25 @@ typedef struct { // 10 - Dual channel (2 mono channels) // 11 - Single channel (Mono) -bool scan_mp3_file(QString& szFileName,mp3info * i); +bool scan_mp3_file(QString & szFileName, mp3info * i); -void resetmp3infoStruct(mp3info *i); +void resetmp3infoStruct(mp3info * i); -int header_channels(mp3header *h); -int header_frequency(mp3header *h); -const char *header_emphasis(mp3header *h); -const char *header_mode(mp3header *h); -int header_layer(mp3header *h); -int header_bitrate(mp3header *h); -double header_version(mp3header *h); -int header_crc(mp3header *h); -int get_header(FILE *file,mp3header *header); -int frame_length(mp3header *header); -int sameConstant(mp3header *h1, mp3header *h2); -int get_mp3_info(mp3info *mp3); -int get_id3(mp3info *mp3); -char *pad(char *string, int length); -char *unpad(char *string); -int get_first_header(mp3info *mp3,long startpos); +int header_channels(mp3header * h); +int header_frequency(mp3header * h); +const char * header_emphasis(mp3header * h); +const char * header_mode(mp3header * h); +int header_layer(mp3header * h); +int header_bitrate(mp3header * h); +double header_version(mp3header * h); +int header_crc(mp3header * h); +int get_header(FILE * file, mp3header * header); +int frame_length(mp3header * header); +int sameConstant(mp3header * h1, mp3header * h2); +int get_mp3_info(mp3info * mp3); +int get_id3(mp3info * mp3); +char * pad(char * string, int length); +char * unpad(char * string); +int get_first_header(mp3info * mp3, long startpos); //void tagedit_curs(char *filename, int filenum, int fileoutof, id3tag *tag); const char * get_typegenre(int idx); diff --git a/src/modules/mediaplayer/MpMprisInterface.cpp b/src/modules/mediaplayer/MpMprisInterface.cpp index 6c40d47ec..30367487f 100644 --- a/src/modules/mediaplayer/MpMprisInterface.cpp +++ b/src/modules/mediaplayer/MpMprisInterface.cpp @@ -23,7 +23,7 @@ //============================================================================= #include "MpMprisInterface.h" -#if (defined(COMPILE_DBUS_SUPPORT) && !defined(COMPILE_ON_WINDOWS) && !defined(COMPILE_ON_MAC) && !defined(COMPILE_ON_MINGW)) +#if(defined(COMPILE_DBUS_SUPPORT) && !defined(COMPILE_ON_WINDOWS) && !defined(COMPILE_ON_MAC) && !defined(COMPILE_ON_MINGW)) #include "KviLocale.h" /* @@ -42,9 +42,9 @@ struct MPRISPlayerStatus int RepeatCurrent; int RepeatPlaylist; }; -Q_DECLARE_METATYPE( MPRISPlayerStatus ) +Q_DECLARE_METATYPE(MPRISPlayerStatus) -QDBusArgument &operator<<(QDBusArgument &argument, const MPRISPlayerStatus &status) +QDBusArgument & operator<<(QDBusArgument & argument, const MPRISPlayerStatus & status) { argument.beginStructure(); argument << status.Play << status.Random << status.RepeatCurrent << status.RepeatPlaylist; @@ -52,7 +52,7 @@ QDBusArgument &operator<<(QDBusArgument &argument, const MPRISPlayerStatus &stat return argument; } -const QDBusArgument &operator>>(const QDBusArgument &argument, MPRISPlayerStatus &status) +const QDBusArgument & operator>>(const QDBusArgument & argument, MPRISPlayerStatus & status) { argument.beginStructure(); argument >> status.Play >> status.Random >> status.RepeatCurrent >> status.RepeatPlaylist; @@ -61,7 +61,7 @@ const QDBusArgument &operator>>(const QDBusArgument &argument, MPRISPlayerStatus } MpMprisInterface::MpMprisInterface() -: MpInterface() + : MpInterface() { qDBusRegisterMetaType(); } @@ -73,25 +73,26 @@ MpMprisInterface::~MpMprisInterface() int MpMprisInterface::detect(bool) { QDBusReply reply = QDBusConnection::sessionBus().interface()->registeredServiceNames(); - if (!reply.isValid()) /* something fishy with dbus, it won't work */ + if(!reply.isValid()) /* something fishy with dbus, it won't work */ return 0; - foreach (QString name, reply.value()) - if (name == m_szServiceName) /* player is running */ + foreach(QString name, reply.value()) + if(name == m_szServiceName) /* player is running */ return 100; - return 1; /* dbus works, player may be closed */ + return 1; /* dbus works, player may be closed */ } -#define MPRIS_SIMPLE_CALL(__path, __action) \ - QDBusInterface dbus_iface(m_szServiceName, __path, \ - "org.freedesktop.MediaPlayer", QDBusConnection::sessionBus()); \ - QDBusMessage reply = dbus_iface.call(QDBus::Block, __action); \ - if (reply.type() == QDBusMessage::ErrorMessage) { \ - QDBusError err = reply; \ +#define MPRIS_SIMPLE_CALL(__path, __action) \ + QDBusInterface dbus_iface(m_szServiceName, __path, \ + "org.freedesktop.MediaPlayer", QDBusConnection::sessionBus()); \ + QDBusMessage reply = dbus_iface.call(QDBus::Block, __action); \ + if(reply.type() == QDBusMessage::ErrorMessage) \ + { \ + QDBusError err = reply; \ qDebug("Error: %s\n%s\n", qPrintable(err.name()), qPrintable(err.message())); \ - return false; \ - } \ + return false; \ + } \ return true; bool MpMprisInterface::prev() @@ -124,42 +125,47 @@ bool MpMprisInterface::quit() MPRIS_SIMPLE_CALL("/", "Quit") } -#define MPRIS_CALL_METHOD(__method, __return_if_fail) \ - QDBusInterface dbus_iface(m_szServiceName, "/Player", \ - "org.freedesktop.MediaPlayer", QDBusConnection::sessionBus()); \ - QDBusMessage reply = dbus_iface.call(QDBus::Block, __method); \ - if (reply.type() == QDBusMessage::ErrorMessage) { \ - QDBusError err = reply; \ +#define MPRIS_CALL_METHOD(__method, __return_if_fail) \ + QDBusInterface dbus_iface(m_szServiceName, "/Player", \ + "org.freedesktop.MediaPlayer", QDBusConnection::sessionBus()); \ + QDBusMessage reply = dbus_iface.call(QDBus::Block, __method); \ + if(reply.type() == QDBusMessage::ErrorMessage) \ + { \ + QDBusError err = reply; \ qDebug("Error: %s\n%s\n", qPrintable(err.name()), qPrintable(err.message())); \ - return __return_if_fail; \ + return __return_if_fail; \ } #define MPRIS_GET_METADATA_FIELD(__field, __return_type, __return_if_fail) \ - if (this->status() != MpInterface::Playing) \ - return __return_if_fail; \ - MPRIS_CALL_METHOD("GetMetadata", __return_if_fail) \ - foreach (QVariant w, reply.arguments()) { \ - QDBusArgument arg = qvariant_cast(w); \ - QVariant v = qdbus_cast(arg); \ - if (v.userType() == QVariant::Map) { \ - const QVariantMap map = v.toMap(); \ - QVariantMap::ConstIterator it = map.find(__field); \ - if (it != map.end() && it.key() == __field) { \ - return it.value().value< __return_type >(); \ - } \ - } \ - } \ + if(this->status() != MpInterface::Playing) \ + return __return_if_fail; \ + MPRIS_CALL_METHOD("GetMetadata", __return_if_fail) \ + foreach(QVariant w, reply.arguments()) \ + { \ + QDBusArgument arg = qvariant_cast(w); \ + QVariant v = qdbus_cast(arg); \ + if(v.userType() == QVariant::Map) \ + { \ + const QVariantMap map = v.toMap(); \ + QVariantMap::ConstIterator it = map.find(__field); \ + if(it != map.end() && it.key() == __field) \ + { \ + return it.value().value<__return_type>(); \ + } \ + } \ + } \ return __return_if_fail; -#define MPRIS_CALL_METHOD_WITH_ARG(__method, __arg, __return_if_fail) \ - QDBusInterface dbus_iface(m_szServiceName, "/Player", \ - "org.freedesktop.MediaPlayer", QDBusConnection::sessionBus()); \ - QDBusMessage reply = dbus_iface.call(QDBus::Block, __method, __arg); \ - if (reply.type() == QDBusMessage::ErrorMessage) { \ - QDBusError err = reply; \ - qDebug("Error: %s\n%s\n", qPrintable(err.name()), qPrintable(err.message())); \ - return __return_if_fail; \ - } +#define MPRIS_CALL_METHOD_WITH_ARG(__method, __arg, __return_if_fail) \ + QDBusInterface dbus_iface(m_szServiceName, "/Player", \ + "org.freedesktop.MediaPlayer", QDBusConnection::sessionBus()); \ + QDBusMessage reply = dbus_iface.call(QDBus::Block, __method, __arg); \ + if(reply.type() == QDBusMessage::ErrorMessage) \ + { \ + QDBusError err = reply; \ + qDebug("Error: %s\n%s\n", qPrintable(err.name()), qPrintable(err.message())); \ + return __return_if_fail; \ + } MpInterface::PlayerStatus MpMprisInterface::status() { @@ -172,38 +178,46 @@ MpInterface::PlayerStatus MpMprisInterface::status() status = qdbus_cast(reply.arguments().first()); - switch (status.Play) { - case 0: return MpInterface::Playing; - case 1: return MpInterface::Paused; - case 2: return MpInterface::Stopped; - default: return MpInterface::Unknown; + switch(status.Play) + { + case 0: + return MpInterface::Playing; + case 1: + return MpInterface::Paused; + case 2: + return MpInterface::Stopped; + default: + return MpInterface::Unknown; } } QString MpMprisInterface::nowPlaying() { - if (this->status() != MpInterface::Playing) + if(this->status() != MpInterface::Playing) return ""; MPRIS_CALL_METHOD("GetMetadata", "") QString artist; QString title; - foreach (QVariant w, reply.arguments()) { + foreach(QVariant w, reply.arguments()) + { QDBusArgument arg = qvariant_cast(w); QVariant v = qdbus_cast(arg); - if (v.userType() == QVariant::Map) { - const QVariantMap map = v.toMap(); - QVariantMap::ConstIterator it = map.constBegin(); - for ( ; it != map.constEnd(); ++it) { /* maybe do some configurable formatting */ - if (it.key() == "artist") + if(v.userType() == QVariant::Map) + { + const QVariantMap map = v.toMap(); + QVariantMap::ConstIterator it = map.constBegin(); + for(; it != map.constEnd(); ++it) + { /* maybe do some configurable formatting */ + if(it.key() == "artist") artist = it.value().toString(); - else if (it.key() == "title") + else if(it.key() == "title") title = it.value().toString(); } } } - if (artist.length() && title.length()) + if(artist.length() && title.length()) return artist + " - " + title; else return ""; @@ -213,13 +227,16 @@ QString MpMprisInterface::mrl() { MPRIS_CALL_METHOD("GetMetadata", "") - foreach (QVariant w, reply.arguments()) { + foreach(QVariant w, reply.arguments()) + { QDBusArgument arg = qvariant_cast(w); QVariant v = qdbus_cast(arg); - if (v.userType() == QVariant::Map) { - const QVariantMap map = v.toMap(); - QVariantMap::ConstIterator it = map.find("location"); - if (it != map.end() && it.key() == "location") { + if(v.userType() == QVariant::Map) + { + const QVariantMap map = v.toMap(); + QVariantMap::ConstIterator it = map.find("location"); + if(it != map.end() && it.key() == "location") + { return it.value().toString(); } } @@ -267,9 +284,9 @@ int MpMprisInterface::sampleRate() MPRIS_GET_METADATA_FIELD("audio-samplerate", int, -1) } -bool MpMprisInterface::setVol(kvs_int_t &iVol) +bool MpMprisInterface::setVol(kvs_int_t & iVol) { - MPRIS_CALL_METHOD_WITH_ARG("VolumeSet", QVariant((int)(100*iVol/255)), false); + MPRIS_CALL_METHOD_WITH_ARG("VolumeSet", QVariant((int)(100 * iVol / 255)), false); return true; } @@ -278,7 +295,7 @@ int MpMprisInterface::getVol() MPRIS_CALL_METHOD("VolumeGet", -1) int iVol = reply.arguments().first().toInt(); - return iVol * 255 /100; + return iVol * 255 / 100; } int MpMprisInterface::position() @@ -291,14 +308,17 @@ int MpMprisInterface::length() { MPRIS_CALL_METHOD("GetMetadata", -1) - foreach (QVariant w, reply.arguments()) { + foreach(QVariant w, reply.arguments()) + { QDBusArgument arg = qvariant_cast(w); QVariant v = qdbus_cast(arg); - if (v.userType() == QVariant::Map) { - const QVariantMap map = v.toMap(); - QVariantMap::ConstIterator it = map.constBegin(); - for ( ; it != map.constEnd(); ++it) { - if (it.key() == "mtime") + if(v.userType() == QVariant::Map) + { + const QVariantMap map = v.toMap(); + QVariantMap::ConstIterator it = map.constBegin(); + for(; it != map.constEnd(); ++it) + { + if(it.key() == "mtime") return it.value().toInt(); } } @@ -306,7 +326,7 @@ int MpMprisInterface::length() return -1; } -bool MpMprisInterface::jumpTo(kvs_int_t &iPos) +bool MpMprisInterface::jumpTo(kvs_int_t & iPos) { MPRIS_CALL_METHOD_WITH_ARG("PositionSet", QVariant((int)iPos), false) return true; @@ -314,18 +334,15 @@ bool MpMprisInterface::jumpTo(kvs_int_t &iPos) /* audacious interface */ MP_IMPLEMENT_DESCRIPTOR( - MpAudaciousInterface, - "audacious", - __tr2qs_ctx( - "An interface for the Audacious media player.\n" \ - "Download it from http://audacious-media-player.org\n" - , - "mediaplayer" - ) -) + MpAudaciousInterface, + "audacious", + __tr2qs_ctx( + "An interface for the Audacious media player.\n" + "Download it from http://audacious-media-player.org\n", + "mediaplayer")) MpAudaciousInterface::MpAudaciousInterface() -: MpMprisInterface() + : MpMprisInterface() { m_szServiceName = "org.mpris.audacious"; } @@ -333,15 +350,14 @@ MpAudaciousInterface::MpAudaciousInterface() int MpAudaciousInterface::getPlayListPos() { QDBusInterface dbus_iface("org.mpris.audacious", "/org/atheme/audacious", - "org.atheme.audacious", QDBusConnection::sessionBus()); + "org.atheme.audacious", QDBusConnection::sessionBus()); QDBusReply pos = dbus_iface.call(QDBus::Block, "Position"); return pos; } - bool MpAudaciousInterface::quit() { - if (MpMprisInterface::quit()) + if(MpMprisInterface::quit()) return true; /* compatibility with older versions */ @@ -352,20 +368,24 @@ QString MpAudaciousInterface::mrl() { MPRIS_CALL_METHOD("GetMetadata", "") - foreach (QVariant w, reply.arguments()) { + foreach(QVariant w, reply.arguments()) + { QDBusArgument arg = qvariant_cast(w); QVariant v = qdbus_cast(arg); - if (v.userType() == QVariant::Map) { - const QVariantMap map = v.toMap(); - QVariantMap::ConstIterator it = map.find("location"); - if (it != map.end() && it.key() == "location") { + if(v.userType() == QVariant::Map) + { + const QVariantMap map = v.toMap(); + QVariantMap::ConstIterator it = map.find("location"); + if(it != map.end() && it.key() == "location") + { return it.value().toString(); } /* Some audacious versions send URI instead of location */ it = map.find("URI"); - if (it != map.end() && it.key() == "URI") { - return it.value().toString(); - } + if(it != map.end() && it.key() == "URI") + { + return it.value().toString(); + } } } return ""; @@ -375,42 +395,50 @@ MpInterface::PlayerStatus MpAudaciousInterface::status() { MpInterface::PlayerStatus status; status = MpMprisInterface::status(); - if (status != MpInterface::Unknown) + if(status != MpInterface::Unknown) return status; /* compatibility with older versions */ QDBusInterface dbus_iface(m_szServiceName, "/Player", - "org.freedesktop.MediaPlayer", QDBusConnection::sessionBus()); - if (!dbus_iface.isValid()) + "org.freedesktop.MediaPlayer", QDBusConnection::sessionBus()); + if(!dbus_iface.isValid()) return MpInterface::Unknown; QDBusMessage reply = dbus_iface.call(QDBus::Block, "GetStatus"); - switch (reply.arguments().first().toInt()) { - case 0: return MpInterface::Playing; - case 1: return MpInterface::Paused; - case 2: return MpInterface::Stopped; - default: return MpInterface::Unknown; + switch(reply.arguments().first().toInt()) + { + case 0: + return MpInterface::Playing; + case 1: + return MpInterface::Paused; + case 2: + return MpInterface::Stopped; + default: + return MpInterface::Unknown; } } int MpAudaciousInterface::length() { int length = MpMprisInterface::length(); - if (length != -1) + if(length != -1) return length; /* compatibility with older versions */ MPRIS_CALL_METHOD("GetMetadata", -1) - foreach (QVariant w, reply.arguments()) { + foreach(QVariant w, reply.arguments()) + { QDBusArgument arg = qvariant_cast(w); QVariant v = qdbus_cast(arg); - if (v.userType() == QVariant::Map) { - const QVariantMap map = v.toMap(); - QVariantMap::ConstIterator it = map.constBegin(); - for ( ; it != map.constEnd(); ++it) { - if (it.key() == "length") + if(v.userType() == QVariant::Map) + { + const QVariantMap map = v.toMap(); + QVariantMap::ConstIterator it = map.constBegin(); + for(; it != map.constEnd(); ++it) + { + if(it.key() == "length") return it.value().toInt(); } } @@ -418,15 +446,15 @@ int MpAudaciousInterface::length() return -1; } -#define AUDACIOUS_GET_TUPLE_FIELD(__field) \ - if (this->status() != MpInterface::Playing) \ - return ""; \ - QDBusInterface dbus_iface("org.mpris.audacious", "/org/atheme/audacious", \ - "org.atheme.audacious", QDBusConnection::sessionBus()); \ - QList args; \ - args << (uint)this->getPlayListPos() << QString(__field); \ +#define AUDACIOUS_GET_TUPLE_FIELD(__field) \ + if(this->status() != MpInterface::Playing) \ + return ""; \ + QDBusInterface dbus_iface("org.mpris.audacious", "/org/atheme/audacious", \ + "org.atheme.audacious", QDBusConnection::sessionBus()); \ + QList args; \ + args << (uint) this->getPlayListPos() << QString(__field); \ QDBusReply reply = dbus_iface.callWithArgumentList(QDBus::Block, "SongTuple", args); \ - return reply.value().variant().toString(); \ + return reply.value().variant().toString(); QString MpAudaciousInterface::year() { @@ -440,18 +468,15 @@ QString MpAudaciousInterface::mediaType() /* BMPx interface */ MP_IMPLEMENT_DESCRIPTOR( - MpBmpxInterface, - "bmpx", - __tr2qs_ctx( - "An interface for BMPx.\n" \ - "Download it from http://sourceforge.net/projects/beepmp\n" - , - "mediaplayer" - ) -) + MpBmpxInterface, + "bmpx", + __tr2qs_ctx( + "An interface for BMPx.\n" + "Download it from http://sourceforge.net/projects/beepmp\n", + "mediaplayer")) MpBmpxInterface::MpBmpxInterface() -: MpMprisInterface() + : MpMprisInterface() { m_szServiceName = "org.mpris.bmp"; } @@ -464,72 +489,62 @@ MpInterface::PlayerStatus MpBmpxInterface::status() /* Amarok2 interface */ MP_IMPLEMENT_DESCRIPTOR( - MpAmarok2Interface, - "amarok2", - __tr2qs_ctx( - "An interface for Amarok2.\n" \ - "Download it from http://amarok.kde.org\n" - , - "mediaplayer" - ) -) + MpAmarok2Interface, + "amarok2", + __tr2qs_ctx( + "An interface for Amarok2.\n" + "Download it from http://amarok.kde.org\n", + "mediaplayer")) MpAmarok2Interface::MpAmarok2Interface() -: MpMprisInterface() + : MpMprisInterface() { m_szServiceName = "org.mpris.amarok"; } /* Qmmp interface */ MP_IMPLEMENT_DESCRIPTOR( - MpQmmpInterface, - "Qmmp", - __tr2qs_ctx( - "An interface for Qmmp.\n" \ - "Download it from http://qmmp.ylsoftware.com\n" - , - "mediaplayer" - ) -) + MpQmmpInterface, + "Qmmp", + __tr2qs_ctx( + "An interface for Qmmp.\n" + "Download it from http://qmmp.ylsoftware.com\n", + "mediaplayer")) MpQmmpInterface::MpQmmpInterface() -: MpMprisInterface() + : MpMprisInterface() { - m_szServiceName = "org.mpris.qmmp"; + m_szServiceName = "org.mpris.qmmp"; } /* xmms2 interface */ MP_IMPLEMENT_DESCRIPTOR( - MpXmms2Interface, - "xmms2", - __tr2qs_ctx( - "An interface for the XMMS2 media player.\n" \ - "Download it from http://xmms2.org\n", - "mediaplayer" - ) -) + MpXmms2Interface, + "xmms2", + __tr2qs_ctx( + "An interface for the XMMS2 media player.\n" + "Download it from http://xmms2.org\n", + "mediaplayer")) MpXmms2Interface::MpXmms2Interface() -: MpMprisInterface() + : MpMprisInterface() { m_szServiceName = "org.mpris.xmms2"; } /* mozilla songbird interface */ MP_IMPLEMENT_DESCRIPTOR( - MpSongbirdInterface, - "songbird", - __tr2qs_ctx( - "An interface for the Mozilla Songbird media player.\n" \ - "Download it from http://www.getsongbird.com.\n" \ - "To use it you have to install also the MPRIS addon " \ - "available at http://addons.songbirdnest.com/addon/1626.\n", - "mediaplayer" - ) -) + MpSongbirdInterface, + "songbird", + __tr2qs_ctx( + "An interface for the Mozilla Songbird media player.\n" + "Download it from http://www.getsongbird.com.\n" + "To use it you have to install also the MPRIS addon " + "available at http://addons.songbirdnest.com/addon/1626.\n", + "mediaplayer")) MpSongbirdInterface::MpSongbirdInterface() -: MpMprisInterface() + : MpMprisInterface() { m_szServiceName = "org.mpris.songbird"; } @@ -541,56 +556,47 @@ MpInterface::PlayerStatus MpSongbirdInterface::status() /* Totem interface */ MP_IMPLEMENT_DESCRIPTOR( - MpTotemInterface, - "totem", - __tr2qs_ctx( - "An interface for Totem.\n" \ - "Download it from http://projects.gnome.org/totem/\n" - , - "mediaplayer" - ) -) + MpTotemInterface, + "totem", + __tr2qs_ctx( + "An interface for Totem.\n" + "Download it from http://projects.gnome.org/totem/\n", + "mediaplayer")) MpTotemInterface::MpTotemInterface() -: MpMprisInterface() + : MpMprisInterface() { m_szServiceName = "org.mpris.Totem"; } /* Vlc interface */ MP_IMPLEMENT_DESCRIPTOR( - MpVlcInterface, - "vlc", - __tr2qs_ctx( - "An interface for VLC.\n" \ - "Download it from http://www.videolan.org/\n" \ - "You need to manually enable the D-Bus control\n" \ - "interface in the VLC preferences\n" \ - , - "mediaplayer" - ) -) + MpVlcInterface, + "vlc", + __tr2qs_ctx( + "An interface for VLC.\n" + "Download it from http://www.videolan.org/\n" + "You need to manually enable the D-Bus control\n" + "interface in the VLC preferences\n", + "mediaplayer")) MpVlcInterface::MpVlcInterface() -: MpMprisInterface() + : MpMprisInterface() { m_szServiceName = "org.mpris.vlc"; } /* Clementine interface */ MP_IMPLEMENT_DESCRIPTOR( - MpClementineInterface, - "clementine", - __tr2qs_ctx( - "An interface for Clementine.\n" \ - "Download it from http://www.clementine-player.org/\n" \ - , - "mediaplayer" - ) -) + MpClementineInterface, + "clementine", + __tr2qs_ctx( + "An interface for Clementine.\n" + "Download it from http://www.clementine-player.org/\n", + "mediaplayer")) MpClementineInterface::MpClementineInterface() -: MpMprisInterface() + : MpMprisInterface() { m_szServiceName = "org.mpris.clementine"; } diff --git a/src/modules/mediaplayer/MpMprisInterface.h b/src/modules/mediaplayer/MpMprisInterface.h index 480fd01e1..b73ccf37d 100644 --- a/src/modules/mediaplayer/MpMprisInterface.h +++ b/src/modules/mediaplayer/MpMprisInterface.h @@ -28,115 +28,117 @@ #include "kvi_settings.h" -#if (defined(COMPILE_DBUS_SUPPORT) && !defined(COMPILE_ON_WINDOWS) && !defined(COMPILE_ON_MAC) && !defined(COMPILE_ON_MINGW)) - #include - - class MpMprisInterface : public MpInterface - { - public: - MpMprisInterface(); - virtual ~MpMprisInterface(); - public: - QString m_szServiceName; - virtual int detect(bool bStart); - virtual bool prev(); - virtual bool next(); - virtual bool play(); - virtual bool stop(); - virtual bool pause(); - virtual bool quit(); - virtual MpInterface::PlayerStatus status(); - virtual QString nowPlaying(); - virtual QString mrl(); - virtual QString title(); - virtual QString artist(); - virtual QString genre(); - virtual QString comment(); - virtual QString year(); - virtual QString album(); - virtual int bitRate(); - virtual int sampleRate(); - virtual bool setVol(kvs_int_t &iVol); - virtual int getVol(); - virtual int position(); - virtual int length(); - virtual bool jumpTo(kvs_int_t &iPos); - }; - - class MpAudaciousInterface : public MpMprisInterface - { - public: - MpAudaciousInterface(); - public: - virtual bool quit(); - virtual MpInterface::PlayerStatus status(); - virtual QString mrl(); - virtual int length(); - - virtual int getPlayListPos(); - virtual QString year(); - virtual QString mediaType(); - }; - - class MpBmpxInterface : public MpMprisInterface - { - public: - MpBmpxInterface(); - virtual MpInterface::PlayerStatus status(); - }; - - class MpAmarok2Interface : public MpMprisInterface - { - public: - MpAmarok2Interface(); - }; - - class MpQmmpInterface : public MpMprisInterface - { - public: - MpQmmpInterface(); - }; - - class MpXmms2Interface : public MpMprisInterface - { - public: - MpXmms2Interface(); - }; - - class MpSongbirdInterface : public MpMprisInterface - { - public: - MpSongbirdInterface(); - virtual MpInterface::PlayerStatus status(); - }; - - class MpTotemInterface : public MpMprisInterface - { - public: - MpTotemInterface(); - }; - - class MpVlcInterface : public MpMprisInterface - { - public: - MpVlcInterface(); - }; - - class MpClementineInterface : public MpMprisInterface - { - public: - MpClementineInterface(); - }; - - MP_DECLARE_DESCRIPTOR(MpAudaciousInterface) - MP_DECLARE_DESCRIPTOR(MpBmpxInterface) - MP_DECLARE_DESCRIPTOR(MpAmarok2Interface) - MP_DECLARE_DESCRIPTOR(MpQmmpInterface) - MP_DECLARE_DESCRIPTOR(MpXmms2Interface) - MP_DECLARE_DESCRIPTOR(MpSongbirdInterface) - MP_DECLARE_DESCRIPTOR(MpTotemInterface) - MP_DECLARE_DESCRIPTOR(MpVlcInterface) - MP_DECLARE_DESCRIPTOR(MpClementineInterface) +#if(defined(COMPILE_DBUS_SUPPORT) && !defined(COMPILE_ON_WINDOWS) && !defined(COMPILE_ON_MAC) && !defined(COMPILE_ON_MINGW)) +#include + +class MpMprisInterface : public MpInterface +{ +public: + MpMprisInterface(); + virtual ~MpMprisInterface(); + +public: + QString m_szServiceName; + virtual int detect(bool bStart); + virtual bool prev(); + virtual bool next(); + virtual bool play(); + virtual bool stop(); + virtual bool pause(); + virtual bool quit(); + virtual MpInterface::PlayerStatus status(); + virtual QString nowPlaying(); + virtual QString mrl(); + virtual QString title(); + virtual QString artist(); + virtual QString genre(); + virtual QString comment(); + virtual QString year(); + virtual QString album(); + virtual int bitRate(); + virtual int sampleRate(); + virtual bool setVol(kvs_int_t & iVol); + virtual int getVol(); + virtual int position(); + virtual int length(); + virtual bool jumpTo(kvs_int_t & iPos); +}; + +class MpAudaciousInterface : public MpMprisInterface +{ +public: + MpAudaciousInterface(); + +public: + virtual bool quit(); + virtual MpInterface::PlayerStatus status(); + virtual QString mrl(); + virtual int length(); + + virtual int getPlayListPos(); + virtual QString year(); + virtual QString mediaType(); +}; + +class MpBmpxInterface : public MpMprisInterface +{ +public: + MpBmpxInterface(); + virtual MpInterface::PlayerStatus status(); +}; + +class MpAmarok2Interface : public MpMprisInterface +{ +public: + MpAmarok2Interface(); +}; + +class MpQmmpInterface : public MpMprisInterface +{ +public: + MpQmmpInterface(); +}; + +class MpXmms2Interface : public MpMprisInterface +{ +public: + MpXmms2Interface(); +}; + +class MpSongbirdInterface : public MpMprisInterface +{ +public: + MpSongbirdInterface(); + virtual MpInterface::PlayerStatus status(); +}; + +class MpTotemInterface : public MpMprisInterface +{ +public: + MpTotemInterface(); +}; + +class MpVlcInterface : public MpMprisInterface +{ +public: + MpVlcInterface(); +}; + +class MpClementineInterface : public MpMprisInterface +{ +public: + MpClementineInterface(); +}; + +MP_DECLARE_DESCRIPTOR(MpAudaciousInterface) +MP_DECLARE_DESCRIPTOR(MpBmpxInterface) +MP_DECLARE_DESCRIPTOR(MpAmarok2Interface) +MP_DECLARE_DESCRIPTOR(MpQmmpInterface) +MP_DECLARE_DESCRIPTOR(MpXmms2Interface) +MP_DECLARE_DESCRIPTOR(MpSongbirdInterface) +MP_DECLARE_DESCRIPTOR(MpTotemInterface) +MP_DECLARE_DESCRIPTOR(MpVlcInterface) +MP_DECLARE_DESCRIPTOR(MpClementineInterface) #endif //COMPILE_ON_WINDOWS #endif //_MP_AUDACIOUSINTERFACE_H_ diff --git a/src/modules/mediaplayer/MpWinampInterface.cpp b/src/modules/mediaplayer/MpWinampInterface.cpp index 08666c864..88846bf01 100644 --- a/src/modules/mediaplayer/MpWinampInterface.cpp +++ b/src/modules/mediaplayer/MpWinampInterface.cpp @@ -163,7 +163,6 @@ #define KVIRC_WM_USER_GETFILE 10000 #define KVIRC_WM_USER_TRANSFER 15000 - static QTextCodec * mediaplayer_get_codec() { QTextCodec * pCodec = 0; @@ -176,34 +175,29 @@ static QTextCodec * mediaplayer_get_codec() static HWND find_winamp(KviWinampInterface * i) { - HWND hWnd = FindWindow("Winamp v1.x",NULL); + HWND hWnd = FindWindow("Winamp v1.x", NULL); if(!hWnd) { // try to start the process ? - i->setLastError(__tr2qs_ctx("Can't find a running Winamp window","mediaplayer")); + i->setLastError(__tr2qs_ctx("Can't find a running Winamp window", "mediaplayer")); } return hWnd; } - MP_IMPLEMENT_DESCRIPTOR( - KviWinampInterface, - "winamp", - __tr2qs_ctx( - "An interface for the Winamp media player.\n" \ - "You can download it from http://www.winamp.com.\n" \ - "To use all the features of this interface you must " \ - "copy the gen_kvirc.dll plugin found in the KVIrc " \ - "distribution directory to the Winamp plugins folder " \ - "and restart winamp." - , - "mediaplayer" - ) -) - + KviWinampInterface, + "winamp", + __tr2qs_ctx( + "An interface for the Winamp media player.\n" + "You can download it from http://www.winamp.com.\n" + "To use all the features of this interface you must " + "copy the gen_kvirc.dll plugin found in the KVIrc " + "distribution directory to the Winamp plugins folder " + "and restart winamp.", + "mediaplayer")) KviWinampInterface::KviWinampInterface() -: MpInterface() + : MpInterface() { } @@ -211,39 +205,40 @@ KviWinampInterface::~KviWinampInterface() { } - int KviWinampInterface::detect(bool bStart) { - if(find_winamp(this))return 80; + if(find_winamp(this)) + return 80; // FIXME : check for Programs Folder\Winamp\Winamp.exe ? // FIXME : if bStart try to start winamp.exe ? return 50; } -#define MP_WINAMP_SENDMESSAGE(__cmdname,__wmmsg,__lparam,__wparam) \ - bool KviWinampInterface::__cmdname() \ - { \ - HWND hWinamp = find_winamp(this); \ - if(hWinamp)SendMessage(hWinamp,__wmmsg,__lparam,__wparam); \ - return hWinamp != 0; \ +#define MP_WINAMP_SENDMESSAGE(__cmdname, __wmmsg, __lparam, __wparam) \ + bool KviWinampInterface::__cmdname() \ + { \ + HWND hWinamp = find_winamp(this); \ + if(hWinamp) \ + SendMessage(hWinamp, __wmmsg, __lparam, __wparam); \ + return hWinamp != 0; \ } -#define MP_WINAMP_WM_USER(__cmdname,_ipcmsg) MP_WINAMP_SENDMESSAGE(__cmdname,WM_USER,0,_ipcmsg) -#define MP_WINAMP_WM_COMMAND(__cmdname,_cmdmsg) MP_WINAMP_SENDMESSAGE(__cmdname,WM_COMMAND,_cmdmsg,0) - -MP_WINAMP_WM_USER(play,IPC_STARTPLAY) -MP_WINAMP_WM_COMMAND(stop,WINAMP_CMD_STOP) -MP_WINAMP_WM_COMMAND(next,WINAMP_CMD_NEXT) -MP_WINAMP_WM_COMMAND(prev,WINAMP_CMD_PREV) -MP_WINAMP_WM_COMMAND(pause,WINAMP_CMD_PAUSE) -MP_WINAMP_WM_COMMAND(quit,WINAMP_CMD_QUIT) +#define MP_WINAMP_WM_USER(__cmdname, _ipcmsg) MP_WINAMP_SENDMESSAGE(__cmdname, WM_USER, 0, _ipcmsg) +#define MP_WINAMP_WM_COMMAND(__cmdname, _cmdmsg) MP_WINAMP_SENDMESSAGE(__cmdname, WM_COMMAND, _cmdmsg, 0) +MP_WINAMP_WM_USER(play, IPC_STARTPLAY) +MP_WINAMP_WM_COMMAND(stop, WINAMP_CMD_STOP) +MP_WINAMP_WM_COMMAND(next, WINAMP_CMD_NEXT) +MP_WINAMP_WM_COMMAND(prev, WINAMP_CMD_PREV) +MP_WINAMP_WM_COMMAND(pause, WINAMP_CMD_PAUSE) +MP_WINAMP_WM_COMMAND(quit, WINAMP_CMD_QUIT) int KviWinampInterface::length() { int leninsecs = -1; HWND hWinamp = find_winamp(this); - if(hWinamp)leninsecs = SendMessage(hWinamp,WM_USER,1,IPC_GETOUTPUTTIME); + if(hWinamp) + leninsecs = SendMessage(hWinamp, WM_USER, 1, IPC_GETOUTPUTTIME); return leninsecs * 1000; } @@ -251,7 +246,8 @@ int KviWinampInterface::position() { int leninmsecs = -1; HWND hWinamp = find_winamp(this); - if(hWinamp)leninmsecs = SendMessage(hWinamp,WM_USER,0,IPC_GETOUTPUTTIME); + if(hWinamp) + leninmsecs = SendMessage(hWinamp, WM_USER, 0, IPC_GETOUTPUTTIME); return leninmsecs; } @@ -259,7 +255,8 @@ int KviWinampInterface::bitRate() { int ret = -1; HWND hWinamp = find_winamp(this); - if(hWinamp)ret = SendMessage(hWinamp,WM_USER,1,IPC_GETINFO); + if(hWinamp) + ret = SendMessage(hWinamp, WM_USER, 1, IPC_GETINFO); return ret; } @@ -267,7 +264,8 @@ int KviWinampInterface::sampleRate() { int ret = -1; HWND hWinamp = find_winamp(this); - if(hWinamp)ret = SendMessage(hWinamp,WM_USER,0,IPC_GETINFO); + if(hWinamp) + ret = SendMessage(hWinamp, WM_USER, 0, IPC_GETINFO); return ret; } @@ -275,7 +273,8 @@ int KviWinampInterface::channels() { int ret = -1; HWND hWinamp = find_winamp(this); - if(hWinamp)ret = SendMessage(hWinamp,WM_USER,2,IPC_GETINFO); + if(hWinamp) + ret = SendMessage(hWinamp, WM_USER, 2, IPC_GETINFO); return ret; } @@ -283,21 +282,22 @@ MpInterface::PlayerStatus KviWinampInterface::status() { HWND hWinamp = find_winamp(this); int ret = 1000; - if(hWinamp)ret = SendMessage(hWinamp,WM_USER,0,IPC_ISPLAYING); + if(hWinamp) + ret = SendMessage(hWinamp, WM_USER, 0, IPC_ISPLAYING); switch(ret) { case 0: return MpInterface::Stopped; - break; + break; case 3: return MpInterface::Paused; - break; + break; case 1: return MpInterface::Playing; - break; + break; default: return MpInterface::Unknown; - break; + break; } return MpInterface::Unknown; } @@ -308,29 +308,31 @@ QString KviWinampInterface::mrl() HWND hWinamp = find_winamp(this); if(hWinamp) { - int ret2 = SendMessage(hWinamp,WM_USER,KVIRC_WM_USER,KVIRC_WM_USER_CHECK); + int ret2 = SendMessage(hWinamp, WM_USER, KVIRC_WM_USER, KVIRC_WM_USER_CHECK); if(ret2 != KVIRC_WM_USER_CHECK_REPLY) { - setLastError(__tr2qs_ctx("The Winamp plugin has not been installed properly. Check /help mediaplayer.nowplaying","mediaplayer")); + setLastError(__tr2qs_ctx("The Winamp plugin has not been installed properly. Check /help mediaplayer.nowplaying", "mediaplayer")); return ret; } - int len = SendMessage(hWinamp,WM_USER,KVIRC_WM_USER,KVIRC_WM_USER_GETFILE); + int len = SendMessage(hWinamp, WM_USER, KVIRC_WM_USER, KVIRC_WM_USER_GETFILE); if(len < 4096) { char szBuffer[4096]; - for(int i = 0;i < len;i++) + for(int i = 0; i < len; i++) { - szBuffer[i] = SendMessage(hWinamp,WM_USER,KVIRC_WM_USER,KVIRC_WM_USER_TRANSFER + i); + szBuffer[i] = SendMessage(hWinamp, WM_USER, KVIRC_WM_USER, KVIRC_WM_USER_TRANSFER + i); } szBuffer[len] = '\0'; - QTextCodec *c=mediaplayer_get_codec(); - if (c) ret = c->toUnicode(szBuffer); - else ret=szBuffer; - if(!ret.startsWith("http://",Qt::CaseInsensitive)) + QTextCodec * c = mediaplayer_get_codec(); + if(c) + ret = c->toUnicode(szBuffer); + else + ret = szBuffer; + if(!ret.startsWith("http://", Qt::CaseInsensitive)) ret.prepend("file://"); } } @@ -343,56 +345,58 @@ QString KviWinampInterface::nowPlaying() HWND hWinamp = find_winamp(this); if(hWinamp) { - int retpippo = SendMessage(hWinamp,WM_USER,KVIRC_WM_USER,KVIRC_WM_USER_CHECK); + int retpippo = SendMessage(hWinamp, WM_USER, KVIRC_WM_USER, KVIRC_WM_USER_CHECK); if(retpippo != KVIRC_WM_USER_CHECK_REPLY) { - setLastError(__tr2qs_ctx("The Winamp plugin has not been installed properly. Check /help mediaplayer.nowplaying","mediaplayer") ); + setLastError(__tr2qs_ctx("The Winamp plugin has not been installed properly. Check /help mediaplayer.nowplaying", "mediaplayer")); return ret; } - int len = SendMessage(hWinamp,WM_USER,KVIRC_WM_USER,KVIRC_WM_USER_GETTITLE); + int len = SendMessage(hWinamp, WM_USER, KVIRC_WM_USER, KVIRC_WM_USER_GETTITLE); if(len < 4096) { char szBuffer[4096]; - for(int i = 0;i < len;i++) + for(int i = 0; i < len; i++) { - szBuffer[i] = SendMessage(hWinamp,WM_USER,KVIRC_WM_USER,KVIRC_WM_USER_TRANSFER + i); + szBuffer[i] = SendMessage(hWinamp, WM_USER, KVIRC_WM_USER, KVIRC_WM_USER_TRANSFER + i); } - szBuffer[ len ] = '\0'; + szBuffer[len] = '\0'; - QTextCodec *c=mediaplayer_get_codec(); - if (c) ret = c->toUnicode(szBuffer); - else ret=szBuffer; + QTextCodec * c = mediaplayer_get_codec(); + if(c) + ret = c->toUnicode(szBuffer); + else + ret = szBuffer; } } return ret; } -bool KviWinampInterface::playMrl(const QString &mrl) +bool KviWinampInterface::playMrl(const QString & mrl) { HWND hWinamp = find_winamp(this); if(hWinamp) { - QTextCodec *c=mediaplayer_get_codec(); + QTextCodec * c = mediaplayer_get_codec(); KviCString szMrl = c ? c->fromUnicode(mrl) : mrl.toUtf8(); COPYDATASTRUCT cds; cds.dwData = IPC_PLAYFILE; cds.lpData = (void *)szMrl.ptr(); cds.cbData = szMrl.len() + 1; // include space for null char - SendMessage(hWinamp,WM_COPYDATA,(WPARAM)NULL,(LPARAM) &cds); + SendMessage(hWinamp, WM_COPYDATA, (WPARAM)NULL, (LPARAM)&cds); return true; } return false; } -bool KviWinampInterface::setVol(kvs_int_t &iVol) +bool KviWinampInterface::setVol(kvs_int_t & iVol) { HWND hWinamp = find_winamp(this); if(hWinamp) { - SendMessage(hWinamp,WM_USER,iVol,IPC_SETVOLUME); + SendMessage(hWinamp, WM_USER, iVol, IPC_SETVOLUME); return true; } return false; @@ -403,19 +407,21 @@ int KviWinampInterface::getVol() int ret = -1; HWND hWinamp = find_winamp(this); #if defined(COMPILE_ON_MINGW) - if(hWinamp)ret = SendMessage(hWinamp,WM_USER,666,IPC_SETVOLUME); + if(hWinamp) + ret = SendMessage(hWinamp, WM_USER, 666, IPC_SETVOLUME); #else - if(hWinamp)ret = SendMessage(hWinamp,WM_USER,-666,IPC_SETVOLUME); + if(hWinamp) + ret = SendMessage(hWinamp, WM_USER, -666, IPC_SETVOLUME); #endif return ret; } -bool KviWinampInterface::jumpTo(kvs_int_t &iPos) +bool KviWinampInterface::jumpTo(kvs_int_t & iPos) { HWND hWinamp = find_winamp(this); if(hWinamp) { - SendMessage(hWinamp,WM_USER,iPos,IPC_JUMPTOTIME); + SendMessage(hWinamp, WM_USER, iPos, IPC_JUMPTOTIME); return true; } return false; @@ -423,15 +429,15 @@ bool KviWinampInterface::jumpTo(kvs_int_t &iPos) bool KviWinampInterface::hide() { HWND hWinamp = find_winamp(this); - HWND hWinampPE = FindWindow("Winamp PE",NULL); /*Playlist*/ - HWND hWinampEQ = FindWindow("Winamp EQ",NULL); /*Equalizer*/ - HWND hWinampMB = FindWindow("Winamp MB",NULL); /*MiniBrowser*/ - HWND hWinampGen = FindWindow("Winamp Gen",NULL); /*Library*/ - HWND hWinampVideo = FindWindow("Winamp Video",NULL); /*Video*/ + HWND hWinampPE = FindWindow("Winamp PE", NULL); /*Playlist*/ + HWND hWinampEQ = FindWindow("Winamp EQ", NULL); /*Equalizer*/ + HWND hWinampMB = FindWindow("Winamp MB", NULL); /*MiniBrowser*/ + HWND hWinampGen = FindWindow("Winamp Gen", NULL); /*Library*/ + HWND hWinampVideo = FindWindow("Winamp Video", NULL); /*Video*/ if(hWinamp) { ShowWindow(hWinamp, SW_HIDE); - if(hWinampPE || hWinampEQ || hWinampMB || hWinampGen || hWinampVideo ) + if(hWinampPE || hWinampEQ || hWinampMB || hWinampGen || hWinampVideo) { if(hWinampPE) ShowWindow(hWinampPE, SW_HIDE); @@ -445,7 +451,7 @@ bool KviWinampInterface::hide() ShowWindow(hWinampVideo, SW_HIDE); return true; } - return true; + return true; } return false; } @@ -472,12 +478,12 @@ bool KviWinampInterface::minimize() return false; } -bool KviWinampInterface::setPlayListPos(kvs_int_t &iPos) +bool KviWinampInterface::setPlayListPos(kvs_int_t & iPos) { HWND hWinamp = find_winamp(this); if(hWinamp) { - SendMessage(hWinamp,WM_USER,iPos,IPC_SETPLAYLISTPOS); + SendMessage(hWinamp, WM_USER, iPos, IPC_SETPLAYLISTPOS); return true; } return false; @@ -487,7 +493,8 @@ int KviWinampInterface::getPlayListPos() { int ret = -1; HWND hWinamp = find_winamp(this); - if(hWinamp)ret = SendMessage(hWinamp,WM_USER,2,IPC_GETLISTPOS); + if(hWinamp) + ret = SendMessage(hWinamp, WM_USER, 2, IPC_GETLISTPOS); return ret; } @@ -495,29 +502,30 @@ int KviWinampInterface::getListLength() { int ret = -1; HWND hWinamp = find_winamp(this); - if(hWinamp)ret = SendMessage(hWinamp,WM_USER,2,IPC_GETLISTLENGTH); + if(hWinamp) + ret = SendMessage(hWinamp, WM_USER, 2, IPC_GETLISTLENGTH); return ret; } -bool KviWinampInterface::setEqData(kvs_int_t &iPos, kvs_int_t &iVal) +bool KviWinampInterface::setEqData(kvs_int_t & iPos, kvs_int_t & iVal) { HWND hWinamp = find_winamp(this); if(hWinamp) { - SendMessage(hWinamp,WM_USER,iPos,IPC_GETEQDATA); - SendMessage(hWinamp,WM_USER,iVal,IPC_SETEQDATA); + SendMessage(hWinamp, WM_USER, iPos, IPC_GETEQDATA); + SendMessage(hWinamp, WM_USER, iVal, IPC_SETEQDATA); return true; } return false; } -int KviWinampInterface::getEqData(kvs_int_t &ival) +int KviWinampInterface::getEqData(kvs_int_t & ival) { HWND hWinamp = find_winamp(this); int ret = -1; if(hWinamp) { - ret = SendMessage(hWinamp,WM_USER,ival,IPC_GETEQDATA); + ret = SendMessage(hWinamp, WM_USER, ival, IPC_GETEQDATA); return ret; } return ret; @@ -528,7 +536,7 @@ bool KviWinampInterface::getRepeat() HWND hWinamp = find_winamp(this); if(hWinamp) { - bool bRepeat = SendMessage(hWinamp,WM_USER,0,IPC_GET_REPEAT); + bool bRepeat = SendMessage(hWinamp, WM_USER, 0, IPC_GET_REPEAT); return bRepeat; } return false; @@ -539,29 +547,29 @@ bool KviWinampInterface::getShuffle() HWND hWinamp = find_winamp(this); if(hWinamp) { - bool bShuffle = SendMessage(hWinamp,WM_USER,0,IPC_GET_SHUFFLE); + bool bShuffle = SendMessage(hWinamp, WM_USER, 0, IPC_GET_SHUFFLE); return bShuffle; } return false; } -bool KviWinampInterface::setShuffle(bool &bVal) +bool KviWinampInterface::setShuffle(bool & bVal) { HWND hWinamp = find_winamp(this); if(hWinamp) { - bool bRepeat = SendMessage(hWinamp,WM_USER,bVal,IPC_SET_SHUFFLE); + bool bRepeat = SendMessage(hWinamp, WM_USER, bVal, IPC_SET_SHUFFLE); return bRepeat; } return false; } -bool KviWinampInterface::setRepeat(bool &bVal) +bool KviWinampInterface::setRepeat(bool & bVal) { HWND hWinamp = find_winamp(this); if(hWinamp) { - bool bShuffle = SendMessage(hWinamp,WM_USER,bVal,IPC_SET_REPEAT); + bool bShuffle = SendMessage(hWinamp, WM_USER, bVal, IPC_SET_REPEAT); return bShuffle; } return false; diff --git a/src/modules/mediaplayer/MpWinampInterface.h b/src/modules/mediaplayer/MpWinampInterface.h index cb853a09a..3c94559c7 100644 --- a/src/modules/mediaplayer/MpWinampInterface.h +++ b/src/modules/mediaplayer/MpWinampInterface.h @@ -28,48 +28,49 @@ #if defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW) - #include "MpInterface.h" +#include "MpInterface.h" - class KviWinampInterface : public MpInterface - { - public: - KviWinampInterface(); - ~KviWinampInterface(); - public: - virtual int detect(bool bStart); - virtual bool prev(); - virtual bool next(); - virtual bool play(); - virtual bool stop(); - virtual bool pause(); - virtual bool quit(); - virtual QString nowPlaying(); - virtual QString mrl(); - virtual int position(); - virtual int length(); - virtual bool playMrl(const QString &mrl); - virtual bool setVol(kvs_int_t &iVol); - virtual int getVol(); - virtual bool jumpTo(kvs_int_t &iPos); - virtual int sampleRate(); - virtual int bitRate(); - virtual int channels(); - virtual bool hide(); - virtual bool show(); - virtual bool minimize(); - virtual int getPlayListPos(); - virtual bool setPlayListPos(kvs_int_t &iPos); - virtual int getListLength(); - virtual int getEqData(kvs_int_t &ival); - virtual bool setEqData(kvs_int_t &iPos, kvs_int_t &iVal); - virtual bool getRepeat(); - virtual bool getShuffle(); - virtual bool setRepeat(bool &bVal); - virtual bool setShuffle(bool &bVal); - virtual MpInterface::PlayerStatus status(); - }; +class KviWinampInterface : public MpInterface +{ +public: + KviWinampInterface(); + ~KviWinampInterface(); - MP_DECLARE_DESCRIPTOR(KviWinampInterface) +public: + virtual int detect(bool bStart); + virtual bool prev(); + virtual bool next(); + virtual bool play(); + virtual bool stop(); + virtual bool pause(); + virtual bool quit(); + virtual QString nowPlaying(); + virtual QString mrl(); + virtual int position(); + virtual int length(); + virtual bool playMrl(const QString & mrl); + virtual bool setVol(kvs_int_t & iVol); + virtual int getVol(); + virtual bool jumpTo(kvs_int_t & iPos); + virtual int sampleRate(); + virtual int bitRate(); + virtual int channels(); + virtual bool hide(); + virtual bool show(); + virtual bool minimize(); + virtual int getPlayListPos(); + virtual bool setPlayListPos(kvs_int_t & iPos); + virtual int getListLength(); + virtual int getEqData(kvs_int_t & ival); + virtual bool setEqData(kvs_int_t & iPos, kvs_int_t & iVal); + virtual bool getRepeat(); + virtual bool getShuffle(); + virtual bool setRepeat(bool & bVal); + virtual bool setShuffle(bool & bVal); + virtual MpInterface::PlayerStatus status(); +}; + +MP_DECLARE_DESCRIPTOR(KviWinampInterface) #endif //COMPILE_ON_WINDOWS diff --git a/src/modules/mediaplayer/MpXmmsInterface.cpp b/src/modules/mediaplayer/MpXmmsInterface.cpp index 6af16b513..ef7c119c2 100644 --- a/src/modules/mediaplayer/MpXmmsInterface.cpp +++ b/src/modules/mediaplayer/MpXmmsInterface.cpp @@ -27,34 +27,27 @@ #include "MpXmmsInterface.h" -#if (!defined(COMPILE_ON_WINDOWS) && !defined(COMPILE_ON_MAC) && !defined(COMPILE_ON_MINGW)) +#if(!defined(COMPILE_ON_WINDOWS) && !defined(COMPILE_ON_MAC) && !defined(COMPILE_ON_MINGW)) #include "KviLocale.h" MP_IMPLEMENT_DESCRIPTOR( - KviXmmsInterface, - "xmms", - __tr2qs_ctx( - "An interface for the UNIX XMMS media player.\n" \ - "Download it from http://legacy.xmms2.org\n" - , - "mediaplayer" - ) -) + KviXmmsInterface, + "xmms", + __tr2qs_ctx( + "An interface for the UNIX XMMS media player.\n" + "Download it from http://legacy.xmms2.org\n", + "mediaplayer")) MP_IMPLEMENT_DESCRIPTOR( - KviAudaciousClassicInterface, - "audacious classic", - __tr2qs_ctx( - "An interface for the UNIX Audacious media player.\n" \ - "Download it from http://audacious-media-player.org\n" - , - "mediaplayer" - ) -) - -static const char *xmms_lib_names[] = -{ + KviAudaciousClassicInterface, + "audacious classic", + __tr2qs_ctx( + "An interface for the UNIX Audacious media player.\n" + "Download it from http://audacious-media-player.org\n", + "mediaplayer")) + +static const char * xmms_lib_names[] = { "libxmms.so", "libxmms.so.1", "/usr/lib/libxmms.so", @@ -64,8 +57,7 @@ static const char *xmms_lib_names[] = 0 }; -static const char *audacious_lib_names[] = -{ +static const char * audacious_lib_names[] = { "libaudacious.so", "libaudacious.so.4", "/usr/lib/libaudacious.so", @@ -75,10 +67,8 @@ static const char *audacious_lib_names[] = 0 }; - - KviXmmsInterface::KviXmmsInterface() -: MpInterface() + : MpInterface() { m_pPlayerLibrary = 0; m_szPlayerLibraryName = "libxmms.so"; @@ -96,7 +86,7 @@ KviXmmsInterface::~KviXmmsInterface() } KviAudaciousClassicInterface::KviAudaciousClassicInterface() -: KviXmmsInterface() + : KviXmmsInterface() { m_szPlayerLibraryName = "libaudacious.so"; m_pLibraryPaths = audacious_lib_names; @@ -108,9 +98,10 @@ KviAudaciousClassicInterface::~KviAudaciousClassicInterface() bool KviXmmsInterface::loadPlayerLibrary() { - if(m_pPlayerLibrary && m_pPlayerLibrary->isLoaded())return true; + if(m_pPlayerLibrary && m_pPlayerLibrary->isLoaded()) + return true; - const char **lib_name = m_pLibraryPaths; + const char ** lib_name = m_pLibraryPaths; while(*lib_name) { m_pPlayerLibrary = new QLibrary(*lib_name); @@ -132,7 +123,7 @@ void * KviXmmsInterface::lookupSymbol(const char * szSymbolName) { if(!loadPlayerLibrary()) { - QString szTmp = QString(__tr2qs_ctx("Can't load the player library (%1)","mediaplayer")).arg(m_szPlayerLibraryName); + QString szTmp = QString(__tr2qs_ctx("Can't load the player library (%1)", "mediaplayer")).arg(m_szPlayerLibraryName); setLastError(szTmp); return 0; } @@ -140,23 +131,23 @@ void * KviXmmsInterface::lookupSymbol(const char * szSymbolName) void * symptr = (void *)m_pPlayerLibrary->resolve(szSymbolName); if(!symptr) { - QString szTmp = QString(__tr2qs_ctx("Can't find symbol %1 in %2","mediaplayer")).arg(szSymbolName,m_szPlayerLibraryName); + QString szTmp = QString(__tr2qs_ctx("Can't find symbol %1 in %2", "mediaplayer")).arg(szSymbolName, m_szPlayerLibraryName); setLastError(szTmp); } return symptr; } - int KviXmmsInterface::detect(bool) { void * sym = lookupSymbol("xmms_remote_play"); return sym ? 80 : 0; } -#define XMMS_SIMPLE_CALL(__symname) \ +#define XMMS_SIMPLE_CALL(__symname) \ void (*sym)(int) = (void (*)(int))lookupSymbol(__symname); \ - if(!sym)return false; \ - sym(0); \ + if(!sym) \ + return false; \ + sym(0); \ return true; bool KviXmmsInterface::prev() @@ -189,47 +180,53 @@ bool KviXmmsInterface::quit() XMMS_SIMPLE_CALL("xmms_remote_quit") } -bool KviXmmsInterface::jumpTo(kvs_int_t &iPos) +bool KviXmmsInterface::jumpTo(kvs_int_t & iPos) { - void (*sym)(int,int) = (void (*)(int,int))lookupSymbol("xmms_remote_jump_to_time"); - if(!sym)return false; - sym(0,iPos); + void (*sym)(int, int) = (void (*)(int, int))lookupSymbol("xmms_remote_jump_to_time"); + if(!sym) + return false; + sym(0, iPos); return true; } -bool KviXmmsInterface::setVol(kvs_int_t &iVol) +bool KviXmmsInterface::setVol(kvs_int_t & iVol) { - void (*sym)(int,int) = (void (*)(int,int))lookupSymbol("xmms_remote_set_main_volume"); - if(!sym)return false; - sym(0,100*iVol/255); + void (*sym)(int, int) = (void (*)(int, int))lookupSymbol("xmms_remote_set_main_volume"); + if(!sym) + return false; + sym(0, 100 * iVol / 255); return true; } int KviXmmsInterface::getVol() { int (*sym)(int) = (int (*)(int))lookupSymbol("xmms_remote_get_main_volume"); - if(!sym)return -1; + if(!sym) + return -1; int iVol = sym(0); - return iVol * 255 /100; + return iVol * 255 / 100; } bool KviXmmsInterface::getRepeat() { bool (*sym)(int) = (bool (*)(int))lookupSymbol("xmms_remote_is_repeat"); - if(!sym)return false; + if(!sym) + return false; bool ret = sym(0); return ret; } -bool KviXmmsInterface::setRepeat(bool &bVal) +bool KviXmmsInterface::setRepeat(bool & bVal) { bool (*sym1)(int) = (bool (*)(int))lookupSymbol("xmms_remote_is_repeat"); - if(!sym1)return false; + if(!sym1) + return false; bool bNow = sym1(0); if(bNow != bVal) { void (*sym2)(int) = (void (*)(int))lookupSymbol("xmms_remote_toggle_repeat"); - if(!sym2)return false; + if(!sym2) + return false; sym2(0); } return true; @@ -238,20 +235,23 @@ bool KviXmmsInterface::setRepeat(bool &bVal) bool KviXmmsInterface::getShuffle() { bool (*sym)(int) = (bool (*)(int))lookupSymbol("xmms_remote_is_shuffle"); - if(!sym)return false; + if(!sym) + return false; bool ret = sym(0); return ret; } -bool KviXmmsInterface::setShuffle(bool &bVal) +bool KviXmmsInterface::setShuffle(bool & bVal) { bool (*sym1)(int) = (bool (*)(int))lookupSymbol("xmms_remote_is_shuffle"); - if(!sym1)return false; + if(!sym1) + return false; bool bNow = sym1(0); if(bNow != bVal) { void (*sym2)(int) = (void (*)(int))lookupSymbol("xmms_remote_toggle_shuffle"); - if(!sym2)return false; + if(!sym2) + return false; sym2(0); } return true; @@ -262,41 +262,52 @@ MpInterface::PlayerStatus KviXmmsInterface::status() bool (*sym1)(int) = (bool (*)(int))lookupSymbol("xmms_remote_is_paused"); if(sym1) { - if(sym1(0))return MpInterface::Paused; + if(sym1(0)) + return MpInterface::Paused; bool (*sym2)(int) = (bool (*)(int))lookupSymbol("xmms_remote_is_playing"); if(sym2) { - if(sym2(0))return MpInterface::Playing; - else return MpInterface::Stopped; + if(sym2(0)) + return MpInterface::Playing; + else + return MpInterface::Stopped; } } return MpInterface::Unknown; } -bool KviXmmsInterface::playMrl(const QString &mrl) +bool KviXmmsInterface::playMrl(const QString & mrl) { - void (*sym)(int,char *) = (void (*)(int,char *))lookupSymbol("xmms_remote_playlist_add_url_string"); + void (*sym)(int, char *) = (void (*)(int, char *))lookupSymbol("xmms_remote_playlist_add_url_string"); QByteArray tmp = mrl.toLocal8Bit(); if(!tmp.isEmpty()) { if(sym) { - sym(0,tmp.data()); + sym(0, tmp.data()); int (*sym1)(int) = (int (*)(int))lookupSymbol("xmms_remote_get_playlist_length"); if(sym1) { int len = sym1(0); if(len > 0) { - void (*sym2)(int,int) = (void (*)(int,int))lookupSymbol("xmms_remote_set_playlist_pos"); + void (*sym2)(int, int) = (void (*)(int, int))lookupSymbol("xmms_remote_set_playlist_pos"); if(sym2) { - sym2(0,len - 1); - } else return false; - } else return false; - } else return false; - } else return false; + sym2(0, len - 1); + } + else + return false; + } + else + return false; + } + else + return false; + } + else + return false; } return true; } @@ -304,53 +315,61 @@ bool KviXmmsInterface::playMrl(const QString &mrl) QString KviXmmsInterface::nowPlaying() { int (*sym)(int) = (int (*)(int))lookupSymbol("xmms_remote_get_playlist_pos"); - if(!sym)return QString(); + if(!sym) + return QString(); int pos = sym(0); - char * (*sym2)(int,int) = (char * (*)(int,int))lookupSymbol("xmms_remote_get_playlist_title"); - if(!sym2)return QString(); - return QString::fromLocal8Bit(sym2(0,pos)); + char * (*sym2)(int, int) = (char * (*)(int, int))lookupSymbol("xmms_remote_get_playlist_title"); + if(!sym2) + return QString(); + return QString::fromLocal8Bit(sym2(0, pos)); } QString KviXmmsInterface::mrl() { int (*sym)(int) = (int (*)(int))lookupSymbol("xmms_remote_get_playlist_pos"); - if(!sym)return QString(); + if(!sym) + return QString(); int pos = sym(0); - char * (*sym2)(int,int) = (char * (*)(int,int))lookupSymbol("xmms_remote_get_playlist_file"); - if(!sym2)return QString(); - QString ret = QString::fromLocal8Bit(sym2(0,pos)); + char * (*sym2)(int, int) = (char * (*)(int, int))lookupSymbol("xmms_remote_get_playlist_file"); + if(!sym2) + return QString(); + QString ret = QString::fromLocal8Bit(sym2(0, pos)); if(ret.length() > 1) - if(ret[0] == '/')ret.prepend("file://"); + if(ret[0] == '/') + ret.prepend("file://"); return ret; } int KviXmmsInterface::position() { int (*sym)(int) = (int (*)(int))lookupSymbol("xmms_remote_get_playlist_pos"); - if(!sym)return -1; + if(!sym) + return -1; int pos = sym(0); - int (*sym2)(int,int) = (int (*)(int,int))lookupSymbol("xmms_remote_get_output_time"); - if(!sym2)return -1; - return sym2(0,pos); + int (*sym2)(int, int) = (int (*)(int, int))lookupSymbol("xmms_remote_get_output_time"); + if(!sym2) + return -1; + return sym2(0, pos); } int KviXmmsInterface::length() { int (*sym)(int) = (int (*)(int))lookupSymbol("xmms_remote_get_playlist_pos"); - if(!sym)return -1; + if(!sym) + return -1; int pos = sym(0); - int (*sym2)(int,int) = (int (*)(int,int))lookupSymbol("xmms_remote_get_playlist_time"); - if(!sym2)return -1; - return sym2(0,pos); + int (*sym2)(int, int) = (int (*)(int, int))lookupSymbol("xmms_remote_get_playlist_time"); + if(!sym2) + return -1; + return sym2(0, pos); } int KviXmmsInterface::getPlayListPos() { int (*sym)(int) = (int (*)(int))lookupSymbol("xmms_remote_get_playlist_pos"); - if(!sym)return -1; + if(!sym) + return -1; return sym(0); } - - #endif //!COMPILE_ON_WINDOWS diff --git a/src/modules/mediaplayer/MpXmmsInterface.h b/src/modules/mediaplayer/MpXmmsInterface.h index 3b89cd8a2..4271799d9 100644 --- a/src/modules/mediaplayer/MpXmmsInterface.h +++ b/src/modules/mediaplayer/MpXmmsInterface.h @@ -34,52 +34,55 @@ #include #if !defined(COMPILE_ON_WINDOWS) && !defined(COMPILE_ON_MINGW) - class KviXmmsInterface : public MpInterface - { - public: - KviXmmsInterface(); - virtual ~KviXmmsInterface(); - protected: - QLibrary* m_pPlayerLibrary; - QString m_szPlayerLibraryName; - const char ** m_pLibraryPaths; - public: - virtual int detect(bool bStart); - virtual bool prev(); - virtual bool next(); - virtual bool play(); - virtual bool stop(); - virtual bool pause(); - virtual bool quit(); - virtual bool jumpTo(kvs_int_t &iPos); - virtual bool setVol(kvs_int_t &iVol); - virtual int getVol(); - virtual MpInterface::PlayerStatus status(); - virtual QString nowPlaying(); - virtual bool playMrl(const QString &mrl); - virtual QString mrl(); - virtual int getPlayListPos(); - virtual int position(); - virtual int length(); - virtual bool getRepeat(); - virtual bool getShuffle(); - virtual bool setRepeat(bool &bVal); - virtual bool setShuffle(bool &bVal); - protected: - bool loadPlayerLibrary(); - void * lookupSymbol(const char * szSymbolName); - }; +class KviXmmsInterface : public MpInterface +{ +public: + KviXmmsInterface(); + virtual ~KviXmmsInterface(); - MP_DECLARE_DESCRIPTOR(KviXmmsInterface) +protected: + QLibrary * m_pPlayerLibrary; + QString m_szPlayerLibraryName; + const char ** m_pLibraryPaths; - class KviAudaciousClassicInterface : public KviXmmsInterface - { - public: - KviAudaciousClassicInterface(); - virtual ~KviAudaciousClassicInterface(); - }; +public: + virtual int detect(bool bStart); + virtual bool prev(); + virtual bool next(); + virtual bool play(); + virtual bool stop(); + virtual bool pause(); + virtual bool quit(); + virtual bool jumpTo(kvs_int_t & iPos); + virtual bool setVol(kvs_int_t & iVol); + virtual int getVol(); + virtual MpInterface::PlayerStatus status(); + virtual QString nowPlaying(); + virtual bool playMrl(const QString & mrl); + virtual QString mrl(); + virtual int getPlayListPos(); + virtual int position(); + virtual int length(); + virtual bool getRepeat(); + virtual bool getShuffle(); + virtual bool setRepeat(bool & bVal); + virtual bool setShuffle(bool & bVal); - MP_DECLARE_DESCRIPTOR(KviAudaciousClassicInterface) +protected: + bool loadPlayerLibrary(); + void * lookupSymbol(const char * szSymbolName); +}; + +MP_DECLARE_DESCRIPTOR(KviXmmsInterface) + +class KviAudaciousClassicInterface : public KviXmmsInterface +{ +public: + KviAudaciousClassicInterface(); + virtual ~KviAudaciousClassicInterface(); +}; + +MP_DECLARE_DESCRIPTOR(KviAudaciousClassicInterface) #endif //COMPILE_ON_WINDOWS diff --git a/src/modules/mediaplayer/libkvimediaplayer.cpp b/src/modules/mediaplayer/libkvimediaplayer.cpp index 53ac614c1..a1a15acea 100644 --- a/src/modules/mediaplayer/libkvimediaplayer.cpp +++ b/src/modules/mediaplayer/libkvimediaplayer.cpp @@ -46,7 +46,7 @@ static MpInterface * auto_detect_player(KviWindow * pOut = 0) MpInterface * pBest = 0; MpInterfaceDescriptor * d; MpInterfaceDescriptor * pDBest = 0; - for(d = g_pDescriptorList->first();d;d = g_pDescriptorList->next()) + for(d = g_pDescriptorList->first(); d; d = g_pDescriptorList->next()) { MpInterface * i = d->instance(); if(i) @@ -62,17 +62,17 @@ static MpInterface * auto_detect_player(KviWindow * pOut = 0) { QString szOut; QString szNam = d->name(); - szOut = QString(__tr2qs_ctx("Trying media player interface \"%1\": score %2","mediaplayer")).arg(szNam).arg(iScore); - pOut->output(KVI_OUT_MULTIMEDIA,szOut); + szOut = QString(__tr2qs_ctx("Trying media player interface \"%1\": score %2", "mediaplayer")).arg(szNam).arg(iScore); + pOut->output(KVI_OUT_MULTIMEDIA, szOut); } } } if(iBest < 90) { if(pOut) - pOut->outputNoFmt(KVI_OUT_MULTIMEDIA,__tr2qs_ctx("Not sure about the results, trying a second, more aggressive detection pass","mediaplayer")); + pOut->outputNoFmt(KVI_OUT_MULTIMEDIA, __tr2qs_ctx("Not sure about the results, trying a second, more aggressive detection pass", "mediaplayer")); // no sure player found... try again with a destructive test - for(d = g_pDescriptorList->first();d;d = g_pDescriptorList->next()) + for(d = g_pDescriptorList->first(); d; d = g_pDescriptorList->next()) { MpInterface * i = d->instance(); if(i) @@ -88,8 +88,8 @@ static MpInterface * auto_detect_player(KviWindow * pOut = 0) { QString szOut; QString szNam = d->name(); - szOut = QString(__tr2qs_ctx("Trying media player interface \"%1\": score %2","mediaplayer")).arg(szNam).arg(iScore); - pOut->output(KVI_OUT_MULTIMEDIA,szOut); + szOut = QString(__tr2qs_ctx("Trying media player interface \"%1\": score %2", "mediaplayer")).arg(szNam).arg(iScore); + pOut->output(KVI_OUT_MULTIMEDIA, szOut); } } } @@ -98,75 +98,74 @@ static MpInterface * auto_detect_player(KviWindow * pOut = 0) { KVI_OPTION_STRING(KviOption_stringPreferredMediaPlayer) = pDBest->name(); if(pOut) - pOut->output(KVI_OUT_MULTIMEDIA,__tr2qs_ctx("Choosing media player interface \"%Q\"","mediaplayer"),&(KVI_OPTION_STRING(KviOption_stringPreferredMediaPlayer))); - } else { + pOut->output(KVI_OUT_MULTIMEDIA, __tr2qs_ctx("Choosing media player interface \"%Q\"", "mediaplayer"), &(KVI_OPTION_STRING(KviOption_stringPreferredMediaPlayer))); + } + else + { if(pOut) - pOut->outputNoFmt(KVI_OUT_MULTIMEDIA,__tr2qs_ctx("Seems that there is no usable media player on this machine","mediaplayer")); + pOut->outputNoFmt(KVI_OUT_MULTIMEDIA, __tr2qs_ctx("Seems that there is no usable media player on this machine", "mediaplayer")); } return pBest; } +#define MP_KVS_FAIL_ON_NO_INTERFACE \ + if(!g_pMPInterface) \ + { \ + c->warning(__tr2qs_ctx("No mediaplayer interface selected. Try /mediaplayer.detect", "mediaplayer")); \ + return true; \ + } +#define MP_KVS_COMMAND(__name) static bool mediaplayer_kvs_cmd_##__name(KviKvsModuleCommandCall * c) +#define MP_KVS_FUNCTION(__name) static bool mediaplayer_kvs_fnc_##__name(KviKvsModuleFunctionCall * c) + +#define MP_KVS_SIMPLE_COMMAND(__name, __ifacecommand) \ + MP_KVS_COMMAND(__name) \ + { \ + KVSM_PARAMETERS_BEGIN(c) \ + KVSM_PARAMETERS_END(c) \ + \ + MP_KVS_FAIL_ON_NO_INTERFACE \ + \ + if(!g_pMPInterface->__ifacecommand()) \ + { \ + if(!c->hasSwitch('q', "quiet")) \ + { \ + c->warning(__tr2qs_ctx("The selected media player interface failed to execute the requested function", "mediaplayer")); \ + QString tmp = __tr2qs_ctx("Last interface error: ", "mediaplayer"); \ + tmp += g_pMPInterface->lastError(); \ + c->warning(tmp); \ + } \ + } \ + return true; \ + } - #define MP_KVS_FAIL_ON_NO_INTERFACE \ - if(!g_pMPInterface) \ - { \ - c->warning(__tr2qs_ctx("No mediaplayer interface selected. Try /mediaplayer.detect","mediaplayer")); \ - return true; \ - } \ - - #define MP_KVS_COMMAND(__name) static bool mediaplayer_kvs_cmd_ ## __name (KviKvsModuleCommandCall * c) - #define MP_KVS_FUNCTION(__name) static bool mediaplayer_kvs_fnc_ ## __name (KviKvsModuleFunctionCall * c) - - #define MP_KVS_SIMPLE_COMMAND(__name,__ifacecommand) \ - MP_KVS_COMMAND(__name) \ - { \ - KVSM_PARAMETERS_BEGIN(c) \ - KVSM_PARAMETERS_END(c) \ - \ - MP_KVS_FAIL_ON_NO_INTERFACE \ - \ - if(!g_pMPInterface->__ifacecommand()) \ - { \ - if(!c->hasSwitch('q',"quiet")) \ - { \ - c->warning(__tr2qs_ctx("The selected media player interface failed to execute the requested function","mediaplayer")); \ - QString tmp = __tr2qs_ctx("Last interface error: ","mediaplayer"); \ - tmp += g_pMPInterface->lastError(); \ - c->warning(tmp); \ - } \ - }\ - return true; \ - } - - #define MP_KVS_SIMPLE_STRING_FUNCTION(__name,__ifacecommand) \ - MP_KVS_FUNCTION(__name) \ - { \ - MP_KVS_FAIL_ON_NO_INTERFACE \ - QString szRet = g_pMPInterface->__ifacecommand(); \ - c->returnValue()->setString(szRet); \ - return true; \ +#define MP_KVS_SIMPLE_STRING_FUNCTION(__name, __ifacecommand) \ + MP_KVS_FUNCTION(__name) \ + { \ + MP_KVS_FAIL_ON_NO_INTERFACE \ + QString szRet = g_pMPInterface->__ifacecommand(); \ + c->returnValue()->setString(szRet); \ + return true; \ } - #define MP_KVS_SIMPLE_INT_FUNCTION(__name,__ifacecommand) \ - MP_KVS_FUNCTION(__name) \ - { \ - MP_KVS_FAIL_ON_NO_INTERFACE \ - int iRet = g_pMPInterface->__ifacecommand(); \ - c->returnValue()->setInteger(iRet); \ - return true; \ +#define MP_KVS_SIMPLE_INT_FUNCTION(__name, __ifacecommand) \ + MP_KVS_FUNCTION(__name) \ + { \ + MP_KVS_FAIL_ON_NO_INTERFACE \ + int iRet = g_pMPInterface->__ifacecommand(); \ + c->returnValue()->setInteger(iRet); \ + return true; \ } - // FINDME! - #define MP_KVS_SIMPLE_BOOL_FUNCTION(__name,__ifacecommand) \ - MP_KVS_FUNCTION(__name) \ - { \ - MP_KVS_FAIL_ON_NO_INTERFACE \ - bool bRet = g_pMPInterface->__ifacecommand(); \ - c->returnValue()->setBoolean(bRet); \ - return true; \ +// FINDME! +#define MP_KVS_SIMPLE_BOOL_FUNCTION(__name, __ifacecommand) \ + MP_KVS_FUNCTION(__name) \ + { \ + MP_KVS_FAIL_ON_NO_INTERFACE \ + bool bRet = g_pMPInterface->__ifacecommand(); \ + c->returnValue()->setBoolean(bRet); \ + return true; \ } - /* @doc: mediaplayer.play @type: @@ -191,7 +190,7 @@ static MpInterface * auto_detect_player(KviWindow * pOut = 0) [fnc]$mediaplayer.status[/fnc] */ -MP_KVS_SIMPLE_COMMAND(play,play) +MP_KVS_SIMPLE_COMMAND(play, play) /* @doc: mediaplayer.hide @@ -214,7 +213,7 @@ MP_KVS_SIMPLE_COMMAND(play,play) [cmd]mediaplayer.minimize[/cmd] */ -MP_KVS_SIMPLE_COMMAND(hide,hide) +MP_KVS_SIMPLE_COMMAND(hide, hide) /* @doc: mediaplayer.show @@ -239,7 +238,7 @@ MP_KVS_SIMPLE_COMMAND(hide,hide) [cmd]mediaplayer.minimize[/cmd] */ -MP_KVS_SIMPLE_COMMAND(show,show) +MP_KVS_SIMPLE_COMMAND(show, show) /* @doc: mediaplayer.minimize @@ -262,7 +261,7 @@ MP_KVS_SIMPLE_COMMAND(show,show) [cmd]mediaplayer.show[/cmd] */ -MP_KVS_SIMPLE_COMMAND(minimize,minimize) +MP_KVS_SIMPLE_COMMAND(minimize, minimize) /* @doc: mediaplayer.stop @@ -288,7 +287,7 @@ MP_KVS_SIMPLE_COMMAND(minimize,minimize) [fnc]$mediaplayer.status[/fnc] */ -MP_KVS_SIMPLE_COMMAND(stop,stop) +MP_KVS_SIMPLE_COMMAND(stop, stop) /* @doc: mediaplayer.next @@ -314,7 +313,7 @@ MP_KVS_SIMPLE_COMMAND(stop,stop) [fnc]$mediaplayer.status[/fnc] */ -MP_KVS_SIMPLE_COMMAND(next,next) +MP_KVS_SIMPLE_COMMAND(next, next) /* @doc: mediaplayer.prev @@ -340,7 +339,7 @@ MP_KVS_SIMPLE_COMMAND(next,next) [fnc]$mediaplayer.status[/fnc] */ -MP_KVS_SIMPLE_COMMAND(prev,prev) +MP_KVS_SIMPLE_COMMAND(prev, prev) /* @doc: mediaplayer.quit @@ -366,7 +365,7 @@ MP_KVS_SIMPLE_COMMAND(prev,prev) [fnc]$mediaplayer.status[/fnc] */ -MP_KVS_SIMPLE_COMMAND(quit,quit) +MP_KVS_SIMPLE_COMMAND(quit, quit) /* @doc: mediaplayer.pause @@ -392,7 +391,7 @@ MP_KVS_SIMPLE_COMMAND(quit,quit) [fnc]$mediaplayer.status[/fnc] */ -MP_KVS_SIMPLE_COMMAND(pause,pause) +MP_KVS_SIMPLE_COMMAND(pause, pause) /* @doc: mediaplayer.detect @@ -427,7 +426,7 @@ MP_KVS_SIMPLE_COMMAND(pause,pause) MP_KVS_COMMAND(detect) { - g_pMPInterface = auto_detect_player(c->hasSwitch('q',"quiet") ? 0 : c->window()); + g_pMPInterface = auto_detect_player(c->hasSwitch('q', "quiet") ? 0 : c->window()); return true; } @@ -457,10 +456,10 @@ MP_KVS_COMMAND(setPlayer) QString szPlayer; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("player",KVS_PT_STRING,0,szPlayer) + KVSM_PARAMETER("player", KVS_PT_STRING, 0, szPlayer) KVSM_PARAMETERS_END(c) - for(MpInterfaceDescriptor * d = g_pDescriptorList->first();d;d = g_pDescriptorList->next()) + for(MpInterfaceDescriptor * d = g_pDescriptorList->first(); d; d = g_pDescriptorList->next()) { if(d->name() == szPlayer) { @@ -520,12 +519,12 @@ MP_KVS_FUNCTION(player) MP_KVS_FUNCTION(playerList) { - KviKvsArray* pArray = new KviKvsArray(); - int id=0; + KviKvsArray * pArray = new KviKvsArray(); + int id = 0; - for(MpInterfaceDescriptor * d = g_pDescriptorList->first();d;d = g_pDescriptorList->next()) + for(MpInterfaceDescriptor * d = g_pDescriptorList->first(); d; d = g_pDescriptorList->next()) { - pArray->set(id++,new KviKvsVariant(d->name())); + pArray->set(id++, new KviKvsVariant(d->name())); } c->returnValue()->setArray(pArray); return true; @@ -564,16 +563,16 @@ MP_KVS_COMMAND(playMrl) QString szMrl; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("player",KVS_PT_STRING,0,szMrl) + KVSM_PARAMETER("player", KVS_PT_STRING, 0, szMrl) KVSM_PARAMETERS_END(c) MP_KVS_FAIL_ON_NO_INTERFACE if(!g_pMPInterface->playMrl(szMrl)) { - if(!c->hasSwitch('q',"quiet")) + if(!c->hasSwitch('q', "quiet")) { - c->warning(__tr2qs_ctx("The selected media player interface failed to execute the requested function","mediaplayer")); - QString tmp = __tr2qs_ctx("Last interface error: ","mediaplayer"); + c->warning(__tr2qs_ctx("The selected media player interface failed to execute the requested function", "mediaplayer")); + QString tmp = __tr2qs_ctx("Last interface error: ", "mediaplayer"); tmp += g_pMPInterface->lastError(); c->warning(tmp); } @@ -587,16 +586,16 @@ MP_KVS_COMMAND(amipExec) QString szMrl; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("player",KVS_PT_STRING,0,szMrl) + KVSM_PARAMETER("player", KVS_PT_STRING, 0, szMrl) KVSM_PARAMETERS_END(c) MP_KVS_FAIL_ON_NO_INTERFACE if(!g_pMPInterface->amipExec(szMrl)) { - if(!c->hasSwitch('q',"quiet")) + if(!c->hasSwitch('q', "quiet")) { - c->warning(__tr2qs_ctx("The selected media player interface failed to execute the requested function","mediaplayer")); - QString tmp = __tr2qs_ctx("Last interface error: ","mediaplayer"); + c->warning(__tr2qs_ctx("The selected media player interface failed to execute the requested function", "mediaplayer")); + QString tmp = __tr2qs_ctx("Last interface error: ", "mediaplayer"); tmp += g_pMPInterface->lastError(); c->warning(tmp); } @@ -628,16 +627,16 @@ MP_KVS_COMMAND(jumpTo) kvs_int_t iPos; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("position",KVS_PT_INT,0,iPos) + KVSM_PARAMETER("position", KVS_PT_INT, 0, iPos) KVSM_PARAMETERS_END(c) MP_KVS_FAIL_ON_NO_INTERFACE if(!g_pMPInterface->jumpTo(iPos)) { - if(!c->hasSwitch('q',"quiet")) + if(!c->hasSwitch('q', "quiet")) { - c->warning(__tr2qs_ctx("The selected media player interface failed to execute the requested function","mediaplayer")); - QString tmp = __tr2qs_ctx("Last interface error: ","mediaplayer"); + c->warning(__tr2qs_ctx("The selected media player interface failed to execute the requested function", "mediaplayer")); + QString tmp = __tr2qs_ctx("Last interface error: ", "mediaplayer"); tmp += g_pMPInterface->lastError(); c->warning(tmp); } @@ -667,16 +666,16 @@ MP_KVS_COMMAND(setVol) kvs_int_t iVol; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("volume",KVS_PT_INT,0,iVol) + KVSM_PARAMETER("volume", KVS_PT_INT, 0, iVol) KVSM_PARAMETERS_END(c) MP_KVS_FAIL_ON_NO_INTERFACE if(!g_pMPInterface->setVol(iVol)) { - if(!c->hasSwitch('q',"quiet")) + if(!c->hasSwitch('q', "quiet")) { - c->warning(__tr2qs_ctx("The selected media player interface failed to execute the requested function","mediaplayer")); - QString tmp = __tr2qs_ctx("Last interface error: ","mediaplayer"); + c->warning(__tr2qs_ctx("The selected media player interface failed to execute the requested function", "mediaplayer")); + QString tmp = __tr2qs_ctx("Last interface error: ", "mediaplayer"); tmp += g_pMPInterface->lastError(); c->warning(tmp); } @@ -703,7 +702,7 @@ MP_KVS_COMMAND(setVol) [cmd]mediaplayer.setVol[/cmd] */ -MP_KVS_SIMPLE_INT_FUNCTION(getVol,getVol) +MP_KVS_SIMPLE_INT_FUNCTION(getVol, getVol) /* @doc: mediaplayer.mute @@ -729,7 +728,7 @@ MP_KVS_SIMPLE_INT_FUNCTION(getVol,getVol) [fnc]$mediaplayer.status[/fnc] */ -MP_KVS_SIMPLE_COMMAND(mute,mute) +MP_KVS_SIMPLE_COMMAND(mute, mute) /* @doc: mediaplayer.mrl @@ -763,7 +762,7 @@ MP_KVS_SIMPLE_COMMAND(mute,mute) [fnc]$mediaplayer.localFile[/fnc] */ -MP_KVS_SIMPLE_STRING_FUNCTION(mrl,mrl) +MP_KVS_SIMPLE_STRING_FUNCTION(mrl, mrl) /* @doc: mediaplayer.nowPlaying @@ -799,7 +798,7 @@ MP_KVS_SIMPLE_STRING_FUNCTION(mrl,mrl) [fnc]$mediaplayer.position[/fnc] */ -MP_KVS_SIMPLE_STRING_FUNCTION(nowPlaying,nowPlaying) +MP_KVS_SIMPLE_STRING_FUNCTION(nowPlaying, nowPlaying) /* @doc: mediaplayer.title @@ -828,7 +827,7 @@ MP_KVS_SIMPLE_STRING_FUNCTION(nowPlaying,nowPlaying) [fnc]$mediaplayer.mediaType[/fnc] */ -MP_KVS_SIMPLE_STRING_FUNCTION(title,title) +MP_KVS_SIMPLE_STRING_FUNCTION(title, title) /* @doc: mediaplayer.artist @@ -860,7 +859,7 @@ MP_KVS_SIMPLE_STRING_FUNCTION(title,title) [fnc]$mediaplayer.position[/fnc] */ -MP_KVS_SIMPLE_STRING_FUNCTION(artist,artist) +MP_KVS_SIMPLE_STRING_FUNCTION(artist, artist) /* @doc: mediaplayer.genre @@ -890,7 +889,7 @@ MP_KVS_SIMPLE_STRING_FUNCTION(artist,artist) [fnc]$mediaplayer.length[/fnc], [fnc]$mediaplayer.position[/fnc] */ -MP_KVS_SIMPLE_STRING_FUNCTION(genre,genre) +MP_KVS_SIMPLE_STRING_FUNCTION(genre, genre) /* @doc: mediaplayer.year @@ -920,7 +919,7 @@ MP_KVS_SIMPLE_STRING_FUNCTION(genre,genre) [fnc]$mediaplayer.length[/fnc], [fnc]$mediaplayer.position[/fnc] */ -MP_KVS_SIMPLE_STRING_FUNCTION(year,year) +MP_KVS_SIMPLE_STRING_FUNCTION(year, year) /* @doc: mediaplayer.comment @@ -950,7 +949,7 @@ MP_KVS_SIMPLE_STRING_FUNCTION(year,year) [fnc]$mediaplayer.length[/fnc], [fnc]$mediaplayer.position[/fnc] */ -MP_KVS_SIMPLE_STRING_FUNCTION(comment,comment) +MP_KVS_SIMPLE_STRING_FUNCTION(comment, comment) /* @doc: mediaplayer.album @@ -983,7 +982,7 @@ MP_KVS_SIMPLE_STRING_FUNCTION(comment,comment) [fnc]$mediaplayer.position[/fnc] */ -MP_KVS_SIMPLE_STRING_FUNCTION(album,album) +MP_KVS_SIMPLE_STRING_FUNCTION(album, album) /* @doc: mediaplayer.mediaType @@ -1010,7 +1009,7 @@ MP_KVS_SIMPLE_STRING_FUNCTION(album,album) [fnc]$mediaplayer.year[/fnc], [fnc]$mediaplayer.comment[/fnc] */ -MP_KVS_SIMPLE_STRING_FUNCTION(mediaType,mediaType) +MP_KVS_SIMPLE_STRING_FUNCTION(mediaType, mediaType) /* @doc: mediaplayer.bitRate @@ -1040,7 +1039,7 @@ MP_KVS_SIMPLE_STRING_FUNCTION(mediaType,mediaType) [fnc]$mediaplayer.position[/fnc] */ -MP_KVS_SIMPLE_INT_FUNCTION(bitRate,bitRate) +MP_KVS_SIMPLE_INT_FUNCTION(bitRate, bitRate) /* @doc: mediaplayer.sampleRate @@ -1069,7 +1068,7 @@ MP_KVS_SIMPLE_INT_FUNCTION(bitRate,bitRate) [fnc]$mediaplayer.position[/fnc], [fnc]$mediaplayer.channels[/fnc] */ -MP_KVS_SIMPLE_INT_FUNCTION(sampleRate,sampleRate) +MP_KVS_SIMPLE_INT_FUNCTION(sampleRate, sampleRate) /* @doc: mediaplayer.length @@ -1098,7 +1097,7 @@ MP_KVS_SIMPLE_INT_FUNCTION(sampleRate,sampleRate) [fnc]$mediaplayer.position[/fnc] */ -MP_KVS_SIMPLE_INT_FUNCTION(length,length) +MP_KVS_SIMPLE_INT_FUNCTION(length, length) /* @doc: mediaplayer.position @@ -1127,7 +1126,7 @@ MP_KVS_SIMPLE_INT_FUNCTION(length,length) [fnc]$mediaplayer.bitRate[/fnc], [fnc]$mediaplayer.channels[/fnc] */ -MP_KVS_SIMPLE_INT_FUNCTION(position,position) +MP_KVS_SIMPLE_INT_FUNCTION(position, position) /* @doc: mediaplayer.channels @@ -1150,7 +1149,7 @@ MP_KVS_SIMPLE_INT_FUNCTION(position,position) [module:mediaplayer]media player module documentation[/module] */ -MP_KVS_SIMPLE_INT_FUNCTION(channels,channels) +MP_KVS_SIMPLE_INT_FUNCTION(channels, channels) /* @doc: mediaplayer.setPlayListPos @@ -1176,16 +1175,16 @@ MP_KVS_COMMAND(setPlayListPos) kvs_int_t iPos; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("position",KVS_PT_INT,0,iPos) + KVSM_PARAMETER("position", KVS_PT_INT, 0, iPos) KVSM_PARAMETERS_END(c) MP_KVS_FAIL_ON_NO_INTERFACE if(!g_pMPInterface->setPlayListPos(iPos)) { - if(!c->hasSwitch('q',"quiet")) + if(!c->hasSwitch('q', "quiet")) { - c->warning(__tr2qs_ctx("The selected media player interface failed to execute the requested function","mediaplayer")); - QString tmp = __tr2qs_ctx("Last interface error: ","mediaplayer"); + c->warning(__tr2qs_ctx("The selected media player interface failed to execute the requested function", "mediaplayer")); + QString tmp = __tr2qs_ctx("Last interface error: ", "mediaplayer"); tmp += g_pMPInterface->lastError(); c->warning(tmp); } @@ -1212,7 +1211,7 @@ MP_KVS_COMMAND(setPlayListPos) [cmd]mediaplayer.getPlayListPos[/cmd] */ -MP_KVS_SIMPLE_INT_FUNCTION(getPlayListPos,getPlayListPos) +MP_KVS_SIMPLE_INT_FUNCTION(getPlayListPos, getPlayListPos) /* @doc: mediaplayer.getListLength @@ -1232,7 +1231,7 @@ MP_KVS_SIMPLE_INT_FUNCTION(getPlayListPos,getPlayListPos) [module:mediaplayer]media player module documentation[/module], */ -MP_KVS_SIMPLE_INT_FUNCTION(getListLength,getListLength) +MP_KVS_SIMPLE_INT_FUNCTION(getListLength, getListLength) /* @doc: mediaplayer.getRepeat @@ -1254,7 +1253,7 @@ MP_KVS_SIMPLE_INT_FUNCTION(getListLength,getListLength) [fnc]$mediaplayer.getShuffle[/fnc] */ -MP_KVS_SIMPLE_INT_FUNCTION(getRepeat,getRepeat) +MP_KVS_SIMPLE_INT_FUNCTION(getRepeat, getRepeat) /* @doc: mediaplayer.getShuffle @@ -1276,7 +1275,7 @@ MP_KVS_SIMPLE_INT_FUNCTION(getRepeat,getRepeat) [fnc]$mediaplayer.getRepeat[/fnc] */ -MP_KVS_SIMPLE_BOOL_FUNCTION(getShuffle,getShuffle) +MP_KVS_SIMPLE_BOOL_FUNCTION(getShuffle, getShuffle) /* @doc: mediaplayer.getEqData @@ -1306,20 +1305,20 @@ MP_KVS_FUNCTION(getEqData) QString szOptions; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("item",KVS_PT_INT,0,iValue) - KVSM_PARAMETER("options",KVS_PT_STRING,KVS_PF_OPTIONAL,szOptions) + KVSM_PARAMETER("item", KVS_PT_INT, 0, iValue) + KVSM_PARAMETER("options", KVS_PT_STRING, KVS_PF_OPTIONAL, szOptions) KVSM_PARAMETERS_END(c) MP_KVS_FAIL_ON_NO_INTERFACE - bool bQuiet = szOptions.indexOf('q',Qt::CaseInsensitive) != -1; + bool bQuiet = szOptions.indexOf('q', Qt::CaseInsensitive) != -1; int ret = g_pMPInterface->getEqData(iValue); if(!ret && !bQuiet) { - c->warning(__tr2qs_ctx("The selected media player interface failed to execute the requested function","mediaplayer")); - QString tmp = __tr2qs_ctx("Last interface error: ","mediaplayer"); + c->warning(__tr2qs_ctx("The selected media player interface failed to execute the requested function", "mediaplayer")); + QString tmp = __tr2qs_ctx("Last interface error: ", "mediaplayer"); tmp += g_pMPInterface->lastError(); c->warning(tmp); } @@ -1353,17 +1352,17 @@ MP_KVS_COMMAND(setEqData) kvs_int_t iValue; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("item",KVS_PT_INT,0,iPos) - KVSM_PARAMETER("value",KVS_PT_INT,0,iValue) + KVSM_PARAMETER("item", KVS_PT_INT, 0, iPos) + KVSM_PARAMETER("value", KVS_PT_INT, 0, iValue) KVSM_PARAMETERS_END(c) MP_KVS_FAIL_ON_NO_INTERFACE - if(!g_pMPInterface->setEqData(iPos,iValue)) + if(!g_pMPInterface->setEqData(iPos, iValue)) { - if(!c->hasSwitch('q',"quiet")) + if(!c->hasSwitch('q', "quiet")) { - c->warning(__tr2qs_ctx("The selected media player interface failed to execute the requested function","mediaplayer")); - QString tmp = __tr2qs_ctx("Last interface error: ","mediaplayer"); + c->warning(__tr2qs_ctx("The selected media player interface failed to execute the requested function", "mediaplayer")); + QString tmp = __tr2qs_ctx("Last interface error: ", "mediaplayer"); tmp += g_pMPInterface->lastError(); c->warning(tmp); } @@ -1402,8 +1401,9 @@ MP_KVS_FUNCTION(localFile) MP_KVS_FAIL_ON_NO_INTERFACE QString szRet = g_pMPInterface->mrl(); - if(szRet.isEmpty())return true; - if(szRet.startsWith("file://",Qt::CaseInsensitive)) + if(szRet.isEmpty()) + return true; + if(szRet.startsWith("file://", Qt::CaseInsensitive)) { #if defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW) c->returnValue()->setString(szRet.mid(7)); @@ -1420,12 +1420,13 @@ MP_KVS_FUNCTION(amipEval) QString szMrl; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("player",KVS_PT_STRING,0,szMrl) + KVSM_PARAMETER("player", KVS_PT_STRING, 0, szMrl) KVSM_PARAMETERS_END(c) MP_KVS_FAIL_ON_NO_INTERFACE QString szRet = g_pMPInterface->amipEval(szMrl); - if(szRet.isEmpty())return true; + if(szRet.isEmpty()) + return true; c->returnValue()->setString(szRet); @@ -1455,8 +1456,8 @@ MP_KVS_FUNCTION(amipEval) MP_KVS_FUNCTION(status) { -// KVSM_PARAMETERS_BEGIN(c) -// KVSM_PARAMETERS_END(c) + // KVSM_PARAMETERS_BEGIN(c) + // KVSM_PARAMETERS_END(c) MP_KVS_FAIL_ON_NO_INTERFACE MpInterface::PlayerStatus eStat = g_pMPInterface->status(); @@ -1464,16 +1465,16 @@ MP_KVS_FUNCTION(status) { case MpInterface::Stopped: c->returnValue()->setString("stopped"); - break; + break; case MpInterface::Playing: c->returnValue()->setString("playing"); - break; + break; case MpInterface::Paused: c->returnValue()->setString("paused"); - break; + break; default: c->returnValue()->setString("unknown"); - break; + break; } return true; } @@ -1546,16 +1547,16 @@ MP_KVS_COMMAND(setRepeat) bool bVal; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("repeat",KVS_PT_BOOL,0,bVal) + KVSM_PARAMETER("repeat", KVS_PT_BOOL, 0, bVal) KVSM_PARAMETERS_END(c) MP_KVS_FAIL_ON_NO_INTERFACE if(!g_pMPInterface->setRepeat(bVal)) { - if(!c->hasSwitch('q',"quiet")) + if(!c->hasSwitch('q', "quiet")) { - c->warning(__tr2qs_ctx("The selected media player interface failed to execute the requested function","mediaplayer")); - QString tmp = __tr2qs_ctx("Last interface error: ","mediaplayer"); + c->warning(__tr2qs_ctx("The selected media player interface failed to execute the requested function", "mediaplayer")); + QString tmp = __tr2qs_ctx("Last interface error: ", "mediaplayer"); tmp += g_pMPInterface->lastError(); c->warning(tmp); } @@ -1588,16 +1589,16 @@ MP_KVS_COMMAND(setShuffle) bool bVal; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("shuffle",KVS_PT_BOOL,0,bVal) + KVSM_PARAMETER("shuffle", KVS_PT_BOOL, 0, bVal) KVSM_PARAMETERS_END(c) MP_KVS_FAIL_ON_NO_INTERFACE if(!g_pMPInterface->setShuffle(bVal)) { - if(!c->hasSwitch('q',"quiet")) + if(!c->hasSwitch('q', "quiet")) { - c->warning(__tr2qs_ctx("The selected media player interface failed to execute the requested function","mediaplayer")); - QString tmp = __tr2qs_ctx("Last interface error: ","mediaplayer"); + c->warning(__tr2qs_ctx("The selected media player interface failed to execute the requested function", "mediaplayer")); + QString tmp = __tr2qs_ctx("Last interface error: ", "mediaplayer"); tmp += g_pMPInterface->lastError(); c->warning(tmp); } @@ -1605,12 +1606,12 @@ MP_KVS_COMMAND(setShuffle) return true; } -static bool mediaplayer_module_init( KviModule * m ) +static bool mediaplayer_module_init(KviModule * m) { g_pDescriptorList = new KviPointerList; g_pDescriptorList->setAutoDelete(true); -#if (defined(COMPILE_DBUS_SUPPORT) && !defined(COMPILE_ON_WINDOWS) && !defined(COMPILE_ON_MAC) && !defined(COMPILE_ON_MINGW)) +#if(defined(COMPILE_DBUS_SUPPORT) && !defined(COMPILE_ON_WINDOWS) && !defined(COMPILE_ON_MAC) && !defined(COMPILE_ON_MINGW)) g_pDescriptorList->append(MP_CREATE_DESCRIPTOR(MpAudaciousInterface)); g_pDescriptorList->append(MP_CREATE_DESCRIPTOR(KviAudaciousClassicInterface)); g_pDescriptorList->append(MP_CREATE_DESCRIPTOR(KviXmmsInterface)); @@ -1633,8 +1634,10 @@ static bool mediaplayer_module_init( KviModule * m ) if(KVI_OPTION_STRING(KviOption_stringPreferredMediaPlayer) == "auto") { g_pMPInterface = auto_detect_player(); - } else { - for(MpInterfaceDescriptor * d = g_pDescriptorList->first();d;d = g_pDescriptorList->next()) + } + else + { + for(MpInterfaceDescriptor * d = g_pDescriptorList->first(); d; d = g_pDescriptorList->next()) { if(d->name() == KVI_OPTION_STRING(KviOption_stringPreferredMediaPlayer)) { @@ -1643,59 +1646,58 @@ static bool mediaplayer_module_init( KviModule * m ) } } - // check for "auto" interface too! - - - #define MP_KVS_REGCMD(__name,__stringname) KVSM_REGISTER_SIMPLE_COMMAND(m,__stringname,mediaplayer_kvs_cmd_ ## __name) - #define MP_KVS_REGFNC(__name,__stringname) KVSM_REGISTER_FUNCTION(m,__stringname,mediaplayer_kvs_fnc_ ## __name) - - MP_KVS_REGCMD(play,"play"); - MP_KVS_REGCMD(stop,"stop"); - MP_KVS_REGCMD(next,"next"); - MP_KVS_REGCMD(prev,"prev"); - MP_KVS_REGCMD(quit,"quit"); - MP_KVS_REGCMD(pause,"pause"); - MP_KVS_REGCMD(detect,"detect"); - MP_KVS_REGCMD(playMrl,"playMrl"); - MP_KVS_REGCMD(amipExec,"amipExec"); - MP_KVS_REGCMD(hide,"hide"); - MP_KVS_REGCMD(show,"show"); - MP_KVS_REGCMD(minimize,"minimize"); - MP_KVS_REGCMD(jumpTo,"jumpTo"); - MP_KVS_REGCMD(setPlayer,"setPlayer"); - MP_KVS_REGCMD(setVol,"setVol"); - MP_KVS_REGCMD(mute,"mute"); - MP_KVS_REGCMD(setRepeat,"setRepeat"); - MP_KVS_REGCMD(setShuffle,"setShuffle"); - MP_KVS_REGCMD(setPlayListPos,"setPlayListPos"); - MP_KVS_REGCMD(setEqData,"setEqData"); - - MP_KVS_REGFNC(nowPlaying,"nowPlaying"); - MP_KVS_REGFNC(mrl,"mrl"); - MP_KVS_REGFNC(title,"title"); - MP_KVS_REGFNC(artist,"artist"); - MP_KVS_REGFNC(genre,"genre"); - MP_KVS_REGFNC(year,"year"); - MP_KVS_REGFNC(comment,"comment"); - MP_KVS_REGFNC(album,"album"); - MP_KVS_REGFNC(mediaType,"mediaType"); - MP_KVS_REGFNC(bitRate,"bitRate"); - MP_KVS_REGFNC(sampleRate,"sampleRate"); - MP_KVS_REGFNC(length,"length"); - MP_KVS_REGFNC(position,"position"); - MP_KVS_REGFNC(status,"status"); - MP_KVS_REGFNC(player,"player"); - MP_KVS_REGFNC(playerList,"playerList"); - MP_KVS_REGFNC(localFile,"localFile"); - MP_KVS_REGFNC(amipEval,"amipEval"); - MP_KVS_REGFNC(channels,"channels"); - MP_KVS_REGFNC(getListLength,"getListLength"); - MP_KVS_REGFNC(getPlayListPos,"getPlayListPos"); - MP_KVS_REGFNC(getEqData,"getEqData"); - MP_KVS_REGFNC(getRepeat,"getRepeat"); - MP_KVS_REGFNC(getShuffle,"getShuffle"); - MP_KVS_REGFNC(getVol,"getVol"); -/* +// check for "auto" interface too! + +#define MP_KVS_REGCMD(__name, __stringname) KVSM_REGISTER_SIMPLE_COMMAND(m, __stringname, mediaplayer_kvs_cmd_##__name) +#define MP_KVS_REGFNC(__name, __stringname) KVSM_REGISTER_FUNCTION(m, __stringname, mediaplayer_kvs_fnc_##__name) + + MP_KVS_REGCMD(play, "play"); + MP_KVS_REGCMD(stop, "stop"); + MP_KVS_REGCMD(next, "next"); + MP_KVS_REGCMD(prev, "prev"); + MP_KVS_REGCMD(quit, "quit"); + MP_KVS_REGCMD(pause, "pause"); + MP_KVS_REGCMD(detect, "detect"); + MP_KVS_REGCMD(playMrl, "playMrl"); + MP_KVS_REGCMD(amipExec, "amipExec"); + MP_KVS_REGCMD(hide, "hide"); + MP_KVS_REGCMD(show, "show"); + MP_KVS_REGCMD(minimize, "minimize"); + MP_KVS_REGCMD(jumpTo, "jumpTo"); + MP_KVS_REGCMD(setPlayer, "setPlayer"); + MP_KVS_REGCMD(setVol, "setVol"); + MP_KVS_REGCMD(mute, "mute"); + MP_KVS_REGCMD(setRepeat, "setRepeat"); + MP_KVS_REGCMD(setShuffle, "setShuffle"); + MP_KVS_REGCMD(setPlayListPos, "setPlayListPos"); + MP_KVS_REGCMD(setEqData, "setEqData"); + + MP_KVS_REGFNC(nowPlaying, "nowPlaying"); + MP_KVS_REGFNC(mrl, "mrl"); + MP_KVS_REGFNC(title, "title"); + MP_KVS_REGFNC(artist, "artist"); + MP_KVS_REGFNC(genre, "genre"); + MP_KVS_REGFNC(year, "year"); + MP_KVS_REGFNC(comment, "comment"); + MP_KVS_REGFNC(album, "album"); + MP_KVS_REGFNC(mediaType, "mediaType"); + MP_KVS_REGFNC(bitRate, "bitRate"); + MP_KVS_REGFNC(sampleRate, "sampleRate"); + MP_KVS_REGFNC(length, "length"); + MP_KVS_REGFNC(position, "position"); + MP_KVS_REGFNC(status, "status"); + MP_KVS_REGFNC(player, "player"); + MP_KVS_REGFNC(playerList, "playerList"); + MP_KVS_REGFNC(localFile, "localFile"); + MP_KVS_REGFNC(amipEval, "amipEval"); + MP_KVS_REGFNC(channels, "channels"); + MP_KVS_REGFNC(getListLength, "getListLength"); + MP_KVS_REGFNC(getPlayListPos, "getPlayListPos"); + MP_KVS_REGFNC(getEqData, "getEqData"); + MP_KVS_REGFNC(getRepeat, "getRepeat"); + MP_KVS_REGFNC(getShuffle, "getShuffle"); + MP_KVS_REGFNC(getVol, "getVol"); + /* // Crissi m->registerFunction( "getmp3tag_date", mediaplayer_fnc_getmp3tag_date ); m->registerFunction( "getmp3tag_version", mediaplayer_fnc_getmp3tag_version ); @@ -1709,30 +1711,30 @@ static bool mediaplayer_module_init( KviModule * m ) return true; } -static bool mediaplayer_module_cleanup( KviModule * ) +static bool mediaplayer_module_cleanup(KviModule *) { delete g_pDescriptorList; return true; } -static bool mediaplayer_module_can_unload( KviModule * ) +static bool mediaplayer_module_can_unload(KviModule *) { return true; } -static bool mediaplayer_module_ctrl(KviModule *,const char * operation,void * param) +static bool mediaplayer_module_ctrl(KviModule *, const char * operation, void * param) { - if(kvi_strEqualCI(operation,"getAvailableMediaPlayers")) + if(kvi_strEqualCI(operation, "getAvailableMediaPlayers")) { // we expect param to be a pointer to QStringList QStringList * l = (QStringList *)param; - for(MpInterfaceDescriptor * d = g_pDescriptorList->first();d;d = g_pDescriptorList->next()) + for(MpInterfaceDescriptor * d = g_pDescriptorList->first(); d; d = g_pDescriptorList->next()) { l->append(d->name()); } return true; } - if(kvi_strEqualCI(operation,"detectMediaPlayer")) + if(kvi_strEqualCI(operation, "detectMediaPlayer")) { auto_detect_player(0); return true; @@ -1741,18 +1743,17 @@ static bool mediaplayer_module_ctrl(KviModule *,const char * operation,void * pa } KVIRC_MODULE( - "mediaplayer", - "4.0.0", - "Copyright (C) 2001-2010 Szymon Stefanek (pragma at kvirc dot net)," \ - "Christoph Thielecke (crissi99 at gmx dot de)," \ - "Tonino Imbesi (grifisx at barmes dot org)," \ - "Alessandro Carbone (elfonol at gmail dot com)," \ - "Alexey Uzhva (wizard at opendoor dot ru)," \ - "Serge Baranov (sbaranov at gmail dot com)", - "Interface to various media players", - mediaplayer_module_init, - mediaplayer_module_can_unload, - mediaplayer_module_ctrl, - mediaplayer_module_cleanup, - "mediaplayer" -) + "mediaplayer", + "4.0.0", + "Copyright (C) 2001-2010 Szymon Stefanek (pragma at kvirc dot net)," + "Christoph Thielecke (crissi99 at gmx dot de)," + "Tonino Imbesi (grifisx at barmes dot org)," + "Alessandro Carbone (elfonol at gmail dot com)," + "Alexey Uzhva (wizard at opendoor dot ru)," + "Serge Baranov (sbaranov at gmail dot com)", + "Interface to various media players", + mediaplayer_module_init, + mediaplayer_module_can_unload, + mediaplayer_module_ctrl, + mediaplayer_module_cleanup, + "mediaplayer") diff --git a/src/modules/mediaplayer/winamp.cpp b/src/modules/mediaplayer/winamp.cpp index a1ee7003d..f43952557 100644 --- a/src/modules/mediaplayer/winamp.cpp +++ b/src/modules/mediaplayer/winamp.cpp @@ -25,18 +25,16 @@ #include #include - // // This is a winamp-kvirc interface plugin // // This stuff is compiled only on windows, as a separate dll module - typedef struct { int version; - char *description; + char * description; int (*init)(); void (*config)(); void (*quit)(); @@ -46,16 +44,14 @@ typedef struct #define GPPHDR_VER 0x10 -extern winampGeneralPurposePlugin *gen_plugins[256]; +extern winampGeneralPurposePlugin * gen_plugins[256]; typedef winampGeneralPurposePlugin * (*winampGeneralPurposePluginGetter)(); int init(); void quit(); void config(); - -winampGeneralPurposePlugin plugin = -{ +winampGeneralPurposePlugin plugin = { GPPHDR_VER, "KVIrc interface plugin 1.0", init, @@ -83,11 +79,11 @@ BOOL WINAPI _DllMainCRTStartup(HANDLE hInst, ULONG ul_reason_for_call, LPVOID lp #define KVIRC_WM_USER_CHECK 13123 #define KVIRC_WM_USER_CHECK_REPLY 13124 -void *lpWndProcOld = 0; +void * lpWndProcOld = 0; char szBuffer[4096]; -LRESULT CALLBACK WndProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam) +LRESULT CALLBACK WndProc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) { if(message == WM_USER) { @@ -99,35 +95,37 @@ LRESULT CALLBACK WndProc(HWND hwnd,UINT message,WPARAM wParam,LPARAM lParam) } if(lParam == KVIRC_WM_USER_GETTITLE) { - int idx = (int)SendMessage(hwnd,WM_USER,0,IPC_GETLISTPOS); + int idx = (int)SendMessage(hwnd, WM_USER, 0, IPC_GETLISTPOS); if(idx != -1) { - char * szTitle = (char *)SendMessage(hwnd,WM_USER,idx,IPC_GETPLAYLISTTITLE); - strcpy(szBuffer,szTitle); + char * szTitle = (char *)SendMessage(hwnd, WM_USER, idx, IPC_GETPLAYLISTTITLE); + strcpy(szBuffer, szTitle); return strlen(szBuffer); } - } else if(lParam == KVIRC_WM_USER_GETFILE) + } + else if(lParam == KVIRC_WM_USER_GETFILE) { - int idx = (int)SendMessage(hwnd,WM_USER,0,IPC_GETLISTPOS); + int idx = (int)SendMessage(hwnd, WM_USER, 0, IPC_GETLISTPOS); if(idx != -1) { - char * szTitle = (char *)SendMessage(hwnd,WM_USER,idx,IPC_GETPLAYLISTFILE); - strcpy(szBuffer,szTitle); + char * szTitle = (char *)SendMessage(hwnd, WM_USER, idx, IPC_GETPLAYLISTFILE); + strcpy(szBuffer, szTitle); return strlen(szBuffer); } - } else if((lParam >= KVIRC_WM_USER_TRANSFER) && (lParam < (KVIRC_WM_USER_TRANSFER + 4096))) + } + else if((lParam >= KVIRC_WM_USER_TRANSFER) && (lParam < (KVIRC_WM_USER_TRANSFER + 4096))) { - return (LRESULT) szBuffer[lParam - KVIRC_WM_USER_TRANSFER]; + return (LRESULT)szBuffer[lParam - KVIRC_WM_USER_TRANSFER]; } } } - return CallWindowProc((WNDPROC)lpWndProcOld,hwnd,message,wParam,lParam); + return CallWindowProc((WNDPROC)lpWndProcOld, hwnd, message, wParam, lParam); } int init() { - lpWndProcOld = (void *) GetWindowLong(plugin.hwndParent,GWLP_WNDPROC); - SetWindowLongPtr(plugin.hwndParent,GWLP_WNDPROC,(intptr_t)WndProc); + lpWndProcOld = (void *)GetWindowLong(plugin.hwndParent, GWLP_WNDPROC); + SetWindowLongPtr(plugin.hwndParent, GWLP_WNDPROC, (intptr_t)WndProc); return 0; } @@ -139,11 +137,7 @@ void config() { } - - - - -extern "C" __declspec( dllexport ) winampGeneralPurposePlugin * winampGetGeneralPurposePlugin() +extern "C" __declspec(dllexport) winampGeneralPurposePlugin * winampGetGeneralPurposePlugin() { return &plugin; } diff --git a/src/modules/mircimport/libkvimircimport.cpp b/src/modules/mircimport/libkvimircimport.cpp index 8ba340fcf..b9ffc8862 100644 --- a/src/modules/mircimport/libkvimircimport.cpp +++ b/src/modules/mircimport/libkvimircimport.cpp @@ -38,13 +38,11 @@ #include #include - KviMircServersIniImport * g_pMircServersIniImport = 0; KviRemoteMircServersIniImport * g_pRemoteMircServersIniImport = 0; - KviMircServersIniImport::KviMircServersIniImport(KviModuleExtensionDescriptor * d) -: KviMexServerImport(d) + : KviMexServerImport(d) { } @@ -53,9 +51,9 @@ KviMircServersIniImport::~KviMircServersIniImport() g_pMircServersIniImport = 0; } -int KviMircServersIniImport::doImport(const QString& filename) +int KviMircServersIniImport::doImport(const QString & filename) { - KviConfigurationFile cfg(filename,KviConfigurationFile::Read,true); + KviConfigurationFile cfg(filename, KviConfigurationFile::Read, true); int iCount = 0; if(cfg.hasGroup("servers")) { @@ -63,9 +61,10 @@ int KviMircServersIniImport::doImport(const QString& filename) int i = 0; QString key; QString entry; - do { + do + { key = QString("n%1").arg(i); - entry = cfg.readEntry(key,""); + entry = cfg.readEntry(key, ""); if(!entry.isEmpty()) { QString description; @@ -73,27 +72,29 @@ int KviMircServersIniImport::doImport(const QString& filename) QString port; kvi_u32_t uPort = 0; // SERVER:GROUP: - int idx = entry.indexOf("SERVER:",0,Qt::CaseSensitive); + int idx = entry.indexOf("SERVER:", 0, Qt::CaseSensitive); if(idx != -1) { description = entry.left(idx); - entry.remove(0,idx + 7); - idx = entry.indexOf("GROUP:",0,Qt::CaseSensitive); + entry.remove(0, idx + 7); + idx = entry.indexOf("GROUP:", 0, Qt::CaseSensitive); if(idx != -1) { port = entry.left(idx); - entry.remove(0,idx + 6); + entry.remove(0, idx + 6); } - idx = port.indexOf(':',0,Qt::CaseSensitive); + idx = port.indexOf(':', 0, Qt::CaseSensitive); if(idx != -1) { serv = port.left(idx); - port.remove(0,idx + 1); + port.remove(0, idx + 1); bool bOk; uPort = port.toUInt(&bOk); if(!bOk) uPort = 6667; - } else { + } + else + { serv = port; uPort = 6667; } @@ -107,14 +108,16 @@ int KviMircServersIniImport::doImport(const QString& filename) s.setDescription(description); s.setPort(uPort); iCount++; - emit server(s,entry); + emit server(s, entry); } ++i; } } while(!entry.isEmpty()); - } else { + } + else + { QString szTmp = QString(__tr2qs("%1 doesn't look like a servers.ini file.\nImport failed.")).arg(filename); - QMessageBox::warning(0,__tr2qs("File Import - KVIrc"),szTmp); + QMessageBox::warning(0, __tr2qs("File Import - KVIrc"), szTmp); } return iCount; } @@ -123,7 +126,8 @@ void KviMircServersIniImport::start() { //KviCString buffer; QString buffer; - if(!KviFileDialog::askForOpenFileName(buffer,__tr("Select a File - KVIrc"),0,KVI_FILTER_INI,false,true,g_pMainWindow))return; + if(!KviFileDialog::askForOpenFileName(buffer, __tr("Select a File - KVIrc"), 0, KVI_FILTER_INI, false, true, g_pMainWindow)) + return; doImport(buffer); delete this; @@ -134,12 +138,10 @@ void KviMircServersIniImport::die() delete this; } - - #define KVI_WWWMIRCCOUK_SERVERSINI "http://www.mirc.co.uk/servers.ini" KviRemoteMircServerImportWizard::KviRemoteMircServerImportWizard(KviRemoteMircServersIniImport * f) -: KviTalWizard(0) + : KviTalWizard(0) { QString capt = __tr2qs("Remote mIRC servers.ini - Import Wizard"); setWindowTitle(capt); @@ -151,46 +153,46 @@ KviRemoteMircServerImportWizard::KviRemoteMircServerImportWizard(KviRemoteMircSe QLabel * l = new QLabel(this); l->setWordWrap(true); - l->setText(__tr2qs("

Welcome!


This wizard will guide you in the process of " \ - "downloading a list of IRC servers. Please click \"Next\" to begin the operation.")); - addPage(l,capt); - + l->setText(__tr2qs("
Welcome!


This wizard will guide you in the process of " + "downloading a list of IRC servers. Please click \"Next\" to begin the operation.")); + addPage(l, capt); KviTalVBox * vb = new KviTalVBox(this); l = new QLabel(vb); l->setWordWrap(true); l->setText(__tr2qs("Here you can modify the URL that the list will be downloaded from. In most cases the default URL is acceptable.")); - vb->setStretchFactor(l,1); + vb->setStretchFactor(l, 1); m_pUrlEdit = new QLineEdit(vb); m_pUrlEdit->setText(KVI_WWWMIRCCOUK_SERVERSINI); - addPage(vb,__tr2qs("URL Selection")); + addPage(vb, __tr2qs("URL Selection")); vb = new KviTalVBox(this); - l = new QLabel(__tr2qs("Please wait while the list is being downloaded"),vb); - vb->setStretchFactor(l,1); + l = new QLabel(__tr2qs("Please wait while the list is being downloaded"), vb); + vb->setStretchFactor(l, 1); m_pOutput = new QLabel(vb); m_pOutput->setFrameStyle(QFrame::WinPanel | QFrame::Sunken); - addPage(vb,__tr2qs("List Download")); + addPage(vb, __tr2qs("List Download")); - setBackEnabled(vb,false); - setNextEnabled(vb,false); - setFinishEnabled(vb,true); + setBackEnabled(vb, false); + setNextEnabled(vb, false); + setFinishEnabled(vb, true); - connect(this,SIGNAL(pageChanged(const QString &)),this,SLOT(pageSelected(const QString &))); + connect(this, SIGNAL(pageChanged(const QString &)), this, SLOT(pageSelected(const QString &))); } KviRemoteMircServerImportWizard::~KviRemoteMircServerImportWizard() { - if(m_pRequest)delete m_pRequest; + if(m_pRequest) + delete m_pRequest; } -void KviRemoteMircServerImportWizard::pageSelected(const QString &title) +void KviRemoteMircServerImportWizard::pageSelected(const QString & title) { if(title == __tr2qs("List Download")) { @@ -211,17 +213,19 @@ void KviRemoteMircServerImportWizard::done(int) void KviRemoteMircServerImportWizard::start() { QString url = m_pUrlEdit->text(); - if(url.isEmpty())url = KVI_WWWMIRCCOUK_SERVERSINI; + if(url.isEmpty()) + url = KVI_WWWMIRCCOUK_SERVERSINI; finishButton()->setEnabled(false); - if(m_pRequest)delete m_pRequest; + if(m_pRequest) + delete m_pRequest; m_pRequest = new KviHttpRequest(); - connect(m_pRequest,SIGNAL(terminated(bool)),this,SLOT(getListTerminated(bool))); - connect(m_pRequest,SIGNAL(status(const QString &)),this,SLOT(getListMessage(const QString &))); + connect(m_pRequest, SIGNAL(terminated(bool)), this, SLOT(getListTerminated(bool))); + connect(m_pRequest, SIGNAL(status(const QString &)), this, SLOT(getListMessage(const QString &))); - g_pApp->getTmpFileName(m_szTmpFileName,"servers.ini"); - if(!m_pRequest->get(KviUrl(url),KviHttpRequest::StoreToFile,m_szTmpFileName)) + g_pApp->getTmpFileName(m_szTmpFileName, "servers.ini"); + if(!m_pRequest->get(KviUrl(url), KviHttpRequest::StoreToFile, m_szTmpFileName)) { delete m_pRequest; m_pRequest = 0; @@ -230,14 +234,16 @@ void KviRemoteMircServerImportWizard::start() } } -void KviRemoteMircServerImportWizard::getListMessage(const QString &message) +void KviRemoteMircServerImportWizard::getListMessage(const QString & message) { - if(!message.isEmpty())m_pOutput->setText(message); + if(!message.isEmpty()) + m_pOutput->setText(message); } void KviRemoteMircServerImportWizard::getListTerminated(bool bSuccess) { - if(!m_pRequest)return; + if(!m_pRequest) + return; if(bSuccess) { m_pOutput->setText(__tr2qs("File downloaded: processing...")); @@ -254,7 +260,9 @@ void KviRemoteMircServerImportWizard::getListTerminated(bool bSuccess) QDir d; d.remove(m_szTmpFileName); - } else m_pOutput->setText(m_pRequest->lastError()); + } + else + m_pOutput->setText(m_pRequest->lastError()); delete m_pRequest; m_pRequest = 0; @@ -262,22 +270,23 @@ void KviRemoteMircServerImportWizard::getListTerminated(bool bSuccess) finishButton()->setEnabled(true); } - KviRemoteMircServersIniImport::KviRemoteMircServersIniImport(KviModuleExtensionDescriptor * d) -: KviMircServersIniImport(d) + : KviMircServersIniImport(d) { m_pWizard = 0; } KviRemoteMircServersIniImport::~KviRemoteMircServersIniImport() { - if(m_pWizard)delete m_pWizard; + if(m_pWizard) + delete m_pWizard; g_pRemoteMircServersIniImport = 0; } void KviRemoteMircServersIniImport::start() { - if(m_pWizard)delete m_pWizard; + if(m_pWizard) + delete m_pWizard; m_pWizard = new KviRemoteMircServerImportWizard(this); m_pWizard->show(); } @@ -289,14 +298,16 @@ void KviRemoteMircServersIniImport::die() static KviModuleExtension * mircimport_local_filter_alloc(KviModuleExtensionAllocStruct * s) { - if(g_pMircServersIniImport)delete g_pMircServersIniImport; + if(g_pMircServersIniImport) + delete g_pMircServersIniImport; g_pMircServersIniImport = new KviMircServersIniImport(s->pDescriptor); return g_pMircServersIniImport; } static KviModuleExtension * mircimport_remote_filter_alloc(KviModuleExtensionAllocStruct * s) { - if(g_pRemoteMircServersIniImport)delete g_pRemoteMircServersIniImport; + if(g_pRemoteMircServersIniImport) + delete g_pRemoteMircServersIniImport; g_pRemoteMircServersIniImport = new KviRemoteMircServersIniImport(s->pDescriptor); return g_pRemoteMircServersIniImport; } @@ -305,7 +316,7 @@ static bool mircimport_module_init(KviModule * m) { QString szPath; QPixmap * pix = 0; - if(g_pApp->findImage(szPath,"kvi_mircimport.png")) + if(g_pApp->findImage(szPath, "kvi_mircimport.png")) { pix = new QPixmap(szPath); if(pix->isNull()) @@ -316,27 +327,32 @@ static bool mircimport_module_init(KviModule * m) } KviModuleExtensionDescriptor * d = m->registerExtension("serverimport", - "mIRC servers.ini import filter", - __tr("Import from servers.ini"), - mircimport_local_filter_alloc); + "mIRC servers.ini import filter", + __tr("Import from servers.ini"), + mircimport_local_filter_alloc); - if(d && pix)d->setIcon(*pix); + if(d && pix) + d->setIcon(*pix); d = m->registerExtension("serverimport", - "Remote mIRC servers.ini import filter", - __tr("Import from http://www.mirc.co.uk/servers.ini"), - mircimport_remote_filter_alloc); + "Remote mIRC servers.ini import filter", + __tr("Import from http://www.mirc.co.uk/servers.ini"), + mircimport_remote_filter_alloc); - if(d && pix)d->setIcon(*pix); + if(d && pix) + d->setIcon(*pix); - if(pix)delete pix; + if(pix) + delete pix; return true; } static bool mircimport_module_cleanup(KviModule *) { - if(g_pMircServersIniImport)delete g_pMircServersIniImport; - if(g_pRemoteMircServersIniImport)delete g_pRemoteMircServersIniImport; + if(g_pMircServersIniImport) + delete g_pMircServersIniImport; + if(g_pRemoteMircServersIniImport) + delete g_pRemoteMircServersIniImport; g_pMircServersIniImport = 0; g_pRemoteMircServersIniImport = 0; @@ -363,16 +379,13 @@ KVIMODULEEXPORTFUNC KviIrcServerImport * mircimport_module_createIrcServerImport } */ - - KVIRC_MODULE( - "mIRCimport", // module name - "4.0.0", // module version - "Copyright (C) 2002 Szymon Stefanek (pragma at kvirc dot net)", // author & (C) - "mIRC servers.ini importer", - mircimport_module_init, - mircimport_module_can_unload, - 0, - mircimport_module_cleanup, - 0 -) + "mIRCimport", // module name + "4.0.0", // module version + "Copyright (C) 2002 Szymon Stefanek (pragma at kvirc dot net)", // author & (C) + "mIRC servers.ini importer", + mircimport_module_init, + mircimport_module_can_unload, + 0, + mircimport_module_cleanup, + 0) diff --git a/src/modules/mircimport/libkvimircimport.h b/src/modules/mircimport/libkvimircimport.h index 076790c8c..9f8629d0a 100644 --- a/src/modules/mircimport/libkvimircimport.h +++ b/src/modules/mircimport/libkvimircimport.h @@ -40,8 +40,9 @@ class KviMircServersIniImport : public KviMexServerImport public: KviMircServersIniImport(KviModuleExtensionDescriptor * d); ~KviMircServersIniImport(); + public: - int doImport(const QString& filename); + int doImport(const QString & filename); virtual void start(); virtual void die(); }; @@ -52,8 +53,10 @@ class KviRemoteMircServersIniImport : public KviMircServersIniImport public: KviRemoteMircServersIniImport(KviModuleExtensionDescriptor * d); ~KviRemoteMircServersIniImport(); + protected: KviRemoteMircServerImportWizard * m_pWizard; + public: virtual void start(); virtual void die(); @@ -65,20 +68,22 @@ class KviRemoteMircServerImportWizard : public KviTalWizard public: KviRemoteMircServerImportWizard(KviRemoteMircServersIniImport * f); ~KviRemoteMircServerImportWizard(); + protected: - QLineEdit * m_pUrlEdit; - QLabel * m_pOutput; + QLineEdit * m_pUrlEdit; + QLabel * m_pOutput; KviRemoteMircServersIniImport * m_pFilter; - KviHttpRequest * m_pRequest; - QString m_szTmpFileName; + KviHttpRequest * m_pRequest; + QString m_szTmpFileName; + protected: - virtual void closeEvent(QCloseEvent *e); + virtual void closeEvent(QCloseEvent * e); virtual void done(int r); void start(); protected slots: - void getListMessage(const QString &message); + void getListMessage(const QString & message); void getListTerminated(bool bSuccess); - void pageSelected(const QString &title); + void pageSelected(const QString & title); }; #endif //_LIBKVIMIRCIMPORT_H_ diff --git a/src/modules/my/Idle.cpp b/src/modules/my/Idle.cpp index 729747d5a..bdb6f8fbb 100644 --- a/src/modules/my/Idle.cpp +++ b/src/modules/my/Idle.cpp @@ -18,16 +18,15 @@ * */ -#include"Idle.h" +#include "Idle.h" #include #include #include -static IdlePlatform *platform = 0; +static IdlePlatform * platform = 0; static int platform_ref = 0; - Idle::Idle() { d = new Private; @@ -35,8 +34,9 @@ Idle::Idle() d->idleTime = 0; // try to use platform idle - if(!platform) { - IdlePlatform *p = new IdlePlatform; + if(!platform) + { + IdlePlatform * p = new IdlePlatform; if(p->init()) platform = p; else @@ -50,9 +50,11 @@ Idle::Idle() Idle::~Idle() { - if(platform) { + if(platform) + { --platform_ref; - if(platform_ref == 0) { + if(platform_ref == 0) + { delete platform; platform = 0; } @@ -67,14 +69,15 @@ bool Idle::isActive() const bool Idle::usingPlatform() const { - return (platform ? true: false); + return (platform ? true : false); } void Idle::start() { d->startTime = QDateTime::currentDateTime(); - if(!platform) { + if(!platform) + { // generic idle d->lastMousePos = QCursor::pos(); d->idleSince = QDateTime::currentDateTime(); @@ -94,10 +97,12 @@ int Idle::secondsIdle() int i; if(platform) i = platform->secondsIdle(); - else { + else + { QPoint curMousePos = QCursor::pos(); QDateTime curDateTime = QDateTime::currentDateTime(); - if(d->lastMousePos != curMousePos) { + if(d->lastMousePos != curMousePos) + { d->lastMousePos = curMousePos; d->idleSince = curDateTime; } @@ -111,12 +116,14 @@ int Idle::secondsIdle() int t = beginIdle.secsTo(d->startTime); // beginIdle later than (or equal to) startTime? - if(t <= 0) { + if(t <= 0) + { // scoot ourselves up to the new idle start d->startTime = beginIdle; } // beginIdle earlier than startTime? - else if(t > 0) { + else if(t > 0) + { // do nothing } diff --git a/src/modules/my/Idle.h b/src/modules/my/Idle.h index 1f434f1b9..47fcd1862 100644 --- a/src/modules/my/Idle.h +++ b/src/modules/my/Idle.h @@ -20,7 +20,6 @@ * */ - #include "kvi_settings.h" #include @@ -51,7 +50,7 @@ private slots: private: class Private; - Private *d; + Private * d; }; class IdlePlatform @@ -65,7 +64,7 @@ public: private: class Private; - Private *d; + Private * d; }; class Idle::Private diff --git a/src/modules/my/Idle_mac.cpp b/src/modules/my/Idle_mac.cpp index 543b1c326..02d7a42f5 100644 --- a/src/modules/my/Idle_mac.cpp +++ b/src/modules/my/Idle_mac.cpp @@ -20,143 +20,160 @@ #ifdef COMPILE_ON_MAC - #include "Idle.h" - #include - - // Why does Apple have to make this so complicated? - static OSStatus LoadFrameworkBundle(CFStringRef framework, CFBundleRef *bundlePtr) { - OSStatus err; - FSRef frameworksFolderRef; - CFURLRef baseURL; - CFURLRef bundleURL; - - if ( bundlePtr == nil ) return( -1 ); - - *bundlePtr = nil; - - baseURL = nil; - bundleURL = nil; - - err = FSFindFolder(kOnAppropriateDisk, kFrameworksFolderType, true, &frameworksFolderRef); - if (err == noErr) { - baseURL = CFURLCreateFromFSRef(kCFAllocatorSystemDefault, &frameworksFolderRef); - if (baseURL == nil) { - err = coreFoundationUnknownErr; - } - } - if (err == noErr) { - bundleURL = CFURLCreateCopyAppendingPathComponent(kCFAllocatorSystemDefault, baseURL, framework, false); - if (bundleURL == nil) { - err = coreFoundationUnknownErr; - } - } - if (err == noErr) { - *bundlePtr = CFBundleCreate(kCFAllocatorSystemDefault, bundleURL); - if (*bundlePtr == nil) { - err = coreFoundationUnknownErr; - } +#include "Idle.h" +#include + +// Why does Apple have to make this so complicated? +static OSStatus LoadFrameworkBundle(CFStringRef framework, CFBundleRef * bundlePtr) +{ + OSStatus err; + FSRef frameworksFolderRef; + CFURLRef baseURL; + CFURLRef bundleURL; + + if(bundlePtr == nil) + return (-1); + + *bundlePtr = nil; + + baseURL = nil; + bundleURL = nil; + + err = FSFindFolder(kOnAppropriateDisk, kFrameworksFolderType, true, &frameworksFolderRef); + if(err == noErr) + { + baseURL = CFURLCreateFromFSRef(kCFAllocatorSystemDefault, &frameworksFolderRef); + if(baseURL == nil) + { + err = coreFoundationUnknownErr; } - if (err == noErr) { - if ( ! CFBundleLoadExecutable( *bundlePtr ) ) { - err = coreFoundationUnknownErr; - } - } - - // Clean up. - if (err != noErr && *bundlePtr != nil) { - CFRelease(*bundlePtr); - *bundlePtr = nil; + } + if(err == noErr) + { + bundleURL = CFURLCreateCopyAppendingPathComponent(kCFAllocatorSystemDefault, baseURL, framework, false); + if(bundleURL == nil) + { + err = coreFoundationUnknownErr; } - if (bundleURL != nil) { - CFRelease(bundleURL); + } + if(err == noErr) + { + *bundlePtr = CFBundleCreate(kCFAllocatorSystemDefault, bundleURL); + if(*bundlePtr == nil) + { + err = coreFoundationUnknownErr; } - if (baseURL != nil) { - CFRelease(baseURL); + } + if(err == noErr) + { + if(!CFBundleLoadExecutable(*bundlePtr)) + { + err = coreFoundationUnknownErr; } - - return err; } + // Clean up. + if(err != noErr && *bundlePtr != nil) + { + CFRelease(*bundlePtr); + *bundlePtr = nil; + } + if(bundleURL != nil) + { + CFRelease(bundleURL); + } + if(baseURL != nil) + { + CFRelease(baseURL); + } - class IdlePlatform::Private { - public: - EventLoopTimerRef mTimerRef; - int mSecondsIdle; - - Private() : mTimerRef(0), mSecondsIdle(0) {} + return err; +} - static pascal void IdleTimerAction(EventLoopTimerRef, EventLoopIdleTimerMessage inState, void* inUserData); +class IdlePlatform::Private +{ +public: + EventLoopTimerRef mTimerRef; + int mSecondsIdle; - }; + Private() : mTimerRef(0), mSecondsIdle(0) {} + static pascal void IdleTimerAction(EventLoopTimerRef, EventLoopIdleTimerMessage inState, void * inUserData); +}; - pascal void IdlePlatform::Private::IdleTimerAction(EventLoopTimerRef, EventLoopIdleTimerMessage inState, void* inUserData) { - switch (inState) { - case kEventLoopIdleTimerStarted: - case kEventLoopIdleTimerStopped: +pascal void IdlePlatform::Private::IdleTimerAction(EventLoopTimerRef, EventLoopIdleTimerMessage inState, void * inUserData) +{ + switch(inState) + { + case kEventLoopIdleTimerStarted: + case kEventLoopIdleTimerStopped: // Get invoked with this constant at the start of the idle period, - // or whenever user activity cancels the idle. - ((IdlePlatform::Private*)inUserData)->mSecondsIdle = 0; - break; - case kEventLoopIdleTimerIdling: - // Called every time the timer fires (i.e. every second). - ((IdlePlatform::Private*)inUserData)->mSecondsIdle++; - break; - } + // or whenever user activity cancels the idle. + ((IdlePlatform::Private *)inUserData)->mSecondsIdle = 0; + break; + case kEventLoopIdleTimerIdling: + // Called every time the timer fires (i.e. every second). + ((IdlePlatform::Private *)inUserData)->mSecondsIdle++; + break; + } +} + +IdlePlatform::IdlePlatform() +{ + d = new Private(); +} + +IdlePlatform::~IdlePlatform() +{ + RemoveEventLoopTimer(d->mTimerRef); + delete d; +} + +// Typedef for the function we're getting back from CFBundleGetFunctionPointerForName. +typedef OSStatus (*InstallEventLoopIdleTimerPtr)(EventLoopRef inEventLoop, + EventTimerInterval inFireDelay, + EventTimerInterval inInterval, + EventLoopIdleTimerUPP inTimerProc, + void * inTimerData, + EventLoopTimerRef * outTimer); + +bool IdlePlatform::init() +{ + // May already be init'ed. + if(d->mTimerRef) + { + return true; } + // According to the docs, InstallEventLoopIdleTimer is new in 10.2. + // According to the headers, it has been around since 10.0. + // One of them is lying. We'll play it safe and weak-link the function. - IdlePlatform::IdlePlatform() { - d = new Private(); + // Load the "Carbon.framework" bundle. + CFBundleRef carbonBundle; + if(LoadFrameworkBundle(CFSTR("Carbon.framework"), &carbonBundle) != noErr) + { + return false; } - IdlePlatform::~IdlePlatform() { - RemoveEventLoopTimer(d->mTimerRef); - delete d; + // Load the Mach-O function pointers for the routine we will be using. + InstallEventLoopIdleTimerPtr myInstallEventLoopIdleTimer = (InstallEventLoopIdleTimerPtr)CFBundleGetFunctionPointerForName(carbonBundle, CFSTR("InstallEventLoopIdleTimer")); + if(myInstallEventLoopIdleTimer == 0) + { + return false; } - - // Typedef for the function we're getting back from CFBundleGetFunctionPointerForName. - typedef OSStatus (*InstallEventLoopIdleTimerPtr)(EventLoopRef inEventLoop, - EventTimerInterval inFireDelay, - EventTimerInterval inInterval, - EventLoopIdleTimerUPP inTimerProc, - void * inTimerData, - EventLoopTimerRef * outTimer); - - - bool IdlePlatform::init() { - // May already be init'ed. - if (d->mTimerRef) { - return true; - } - - // According to the docs, InstallEventLoopIdleTimer is new in 10.2. - // According to the headers, it has been around since 10.0. - // One of them is lying. We'll play it safe and weak-link the function. - - // Load the "Carbon.framework" bundle. - CFBundleRef carbonBundle; - if (LoadFrameworkBundle( CFSTR("Carbon.framework"), &carbonBundle ) != noErr) { - return false; - } - - // Load the Mach-O function pointers for the routine we will be using. - InstallEventLoopIdleTimerPtr myInstallEventLoopIdleTimer = (InstallEventLoopIdleTimerPtr)CFBundleGetFunctionPointerForName(carbonBundle, CFSTR("InstallEventLoopIdleTimer")); - if (myInstallEventLoopIdleTimer == 0) { - return false; - } - - EventLoopIdleTimerUPP timerUPP = NewEventLoopIdleTimerUPP(Private::IdleTimerAction); - if ((*myInstallEventLoopIdleTimer)(GetMainEventLoop(), kEventDurationSecond, kEventDurationSecond, timerUPP, 0, &d->mTimerRef)) { - return true; - } - - return false; + EventLoopIdleTimerUPP timerUPP = NewEventLoopIdleTimerUPP(Private::IdleTimerAction); + if((*myInstallEventLoopIdleTimer)(GetMainEventLoop(), kEventDurationSecond, kEventDurationSecond, timerUPP, 0, &d->mTimerRef)) + { + return true; } + return false; +} - int IdlePlatform::secondsIdle() const { - return d->mSecondsIdle; - } +int IdlePlatform::secondsIdle() const +{ + return d->mSecondsIdle; +} #endif diff --git a/src/modules/my/Idle_win.cpp b/src/modules/my/Idle_win.cpp index e1a84ff82..d79ab379d 100644 --- a/src/modules/my/Idle_win.cpp +++ b/src/modules/my/Idle_win.cpp @@ -19,90 +19,99 @@ */ #if defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW) - #include "Idle.h" +#include "Idle.h" - #include +#include - typedef struct tagLASTINPUTINFO { - UINT cbSize; - DWORD dwTime; - } LASTINPUTINFO, *PLASTINPUTINFO; +typedef struct tagLASTINPUTINFO +{ + UINT cbSize; + DWORD dwTime; +} LASTINPUTINFO, *PLASTINPUTINFO; - class IdlePlatform::Private +class IdlePlatform::Private +{ +public: + Private() { - public: - Private() - { - GetLastInputInfo = 0; - IdleUIGetLastInputTime = 0; - lib = 0; - } + GetLastInputInfo = 0; + IdleUIGetLastInputTime = 0; + lib = 0; + } + + BOOL(__stdcall * GetLastInputInfo) + (PLASTINPUTINFO); + DWORD(__stdcall * IdleUIGetLastInputTime) + (void); + QLibrary * lib; +}; + +IdlePlatform::IdlePlatform() +{ + d = new Private; +} + +IdlePlatform::~IdlePlatform() +{ + delete d->lib; + delete d; +} - BOOL (__stdcall * GetLastInputInfo)(PLASTINPUTINFO); - DWORD (__stdcall * IdleUIGetLastInputTime)(void); - QLibrary *lib; - }; +bool IdlePlatform::init() +{ + if(d->lib) + return true; + void * p; - IdlePlatform::IdlePlatform() + // try to find the built-in Windows 2000 function + d->lib = new QLibrary("user32"); + if(d->lib->load() && (p = d->lib->resolve("GetLastInputInfo"))) { - d = new Private; + d->GetLastInputInfo = (BOOL(__stdcall *)(PLASTINPUTINFO))p; + return true; } - - IdlePlatform::~IdlePlatform() + else { delete d->lib; - delete d; + d->lib = 0; } - bool IdlePlatform::init() + // fall back on idleui + d->lib = new QLibrary("idleui"); + if(d->lib->load() && (p = d->lib->resolve("IdleUIGetLastInputTime"))) { - if(d->lib) - return true; - void *p; - - // try to find the built-in Windows 2000 function - d->lib = new QLibrary("user32"); - if(d->lib->load() && (p = d->lib->resolve("GetLastInputInfo"))) { - d->GetLastInputInfo = (BOOL (__stdcall *)(PLASTINPUTINFO))p; - return true; - } - else { - delete d->lib; - d->lib = 0; - } - - // fall back on idleui - d->lib = new QLibrary("idleui"); - if(d->lib->load() && (p = d->lib->resolve("IdleUIGetLastInputTime"))) { - d->IdleUIGetLastInputTime = (DWORD (__stdcall *)(void))p; - return true; - } - else { - delete d->lib; - d->lib = 0; - } - - return false; + d->IdleUIGetLastInputTime = (DWORD(__stdcall *)(void))p; + return true; } + else + { + delete d->lib; + d->lib = 0; + } + + return false; +} - int IdlePlatform::secondsIdle() +int IdlePlatform::secondsIdle() +{ + int i; + if(d->GetLastInputInfo) { - int i; - if(d->GetLastInputInfo) { - LASTINPUTINFO li; - li.cbSize = sizeof(LASTINPUTINFO); - bool ok = d->GetLastInputInfo(&li); - if(!ok) - return 0; - i = li.dwTime; - } - else if(d->IdleUIGetLastInputTime) { - i = d->IdleUIGetLastInputTime(); - } - else + LASTINPUTINFO li; + li.cbSize = sizeof(LASTINPUTINFO); + bool ok = d->GetLastInputInfo(&li); + if(!ok) return 0; - - return (GetTickCount() - i) / 1000; + i = li.dwTime; + } + else if(d->IdleUIGetLastInputTime) + { + i = d->IdleUIGetLastInputTime(); } + else + return 0; + + return (GetTickCount() - i) / 1000; +} #endif diff --git a/src/modules/my/Idle_x11.cpp b/src/modules/my/Idle_x11.cpp index 3fb162c03..593843362 100644 --- a/src/modules/my/Idle_x11.cpp +++ b/src/modules/my/Idle_x11.cpp @@ -20,85 +20,88 @@ #if !defined(COMPILE_ON_WINDOWS) && !defined(COMPILE_ON_MINGW) && !defined(COMPILE_ON_MAC) -#include"Idle.h" +#include "Idle.h" #ifndef COMPILE_XSS_SUPPORT - IdlePlatform::IdlePlatform() {} - IdlePlatform::~IdlePlatform() {} - bool IdlePlatform::init() const { return false; } - int IdlePlatform::secondsIdle() const { return 0; } +IdlePlatform::IdlePlatform() {} +IdlePlatform::~IdlePlatform() {} +bool IdlePlatform::init() const { return false; } +int IdlePlatform::secondsIdle() const { return 0; } #else - // COMPILE_XSS_SUPPORT implies COMPILE_QX11INFO_SUPPORT - #include - #include - #include - #include - #include - #include - - static XErrorHandler old_handler = 0; - extern "C" int xerrhandler(Display* dpy, XErrorEvent* err) +// COMPILE_XSS_SUPPORT implies COMPILE_QX11INFO_SUPPORT +#include +#include +#include +#include +#include +#include + +static XErrorHandler old_handler = 0; +extern "C" int xerrhandler(Display * dpy, XErrorEvent * err) +{ + if(err->error_code == BadDrawable) + return 0; + + return (*old_handler)(dpy, err); +} + +class IdlePlatform::Private +{ +public: + XScreenSaverInfo * ss_info; + + Private() { - if(err->error_code == BadDrawable) - return 0; - - return (*old_handler)(dpy, err); - } - - class IdlePlatform::Private - { - public: - XScreenSaverInfo *ss_info; - - Private() { - // make coverity happy - ss_info = 0; - } - }; - - IdlePlatform::IdlePlatform() - { - d = new Private; + // make coverity happy + ss_info = 0; } - - IdlePlatform::~IdlePlatform() +}; + +IdlePlatform::IdlePlatform() +{ + d = new Private; +} + +IdlePlatform::~IdlePlatform() +{ + if(d->ss_info) + XFree(d->ss_info); + if(old_handler) { - if(d->ss_info) - XFree(d->ss_info); - if(old_handler) { - XSetErrorHandler(old_handler); - old_handler = 0; - } - delete d; + XSetErrorHandler(old_handler); + old_handler = 0; } + delete d; +} - bool IdlePlatform::init() const - { - if(d->ss_info) - return true; - - old_handler = XSetErrorHandler(xerrhandler); +bool IdlePlatform::init() const +{ + if(d->ss_info) + return true; - int event_base, error_base; + old_handler = XSetErrorHandler(xerrhandler); - if(XScreenSaverQueryExtension(QX11Info::display(), &event_base, &error_base)) { - d->ss_info = XScreenSaverAllocInfo(); - return true; - } + int event_base, error_base; - return false; + if(XScreenSaverQueryExtension(QX11Info::display(), &event_base, &error_base)) + { + d->ss_info = XScreenSaverAllocInfo(); + return true; } - int IdlePlatform::secondsIdle() const - { - if(!d->ss_info) - return 0; + return false; +} - if(!XScreenSaverQueryInfo(QX11Info::display(), QX11Info::appRootWindow(), d->ss_info)) - return 0; +int IdlePlatform::secondsIdle() const +{ + if(!d->ss_info) + return 0; - return d->ss_info->idle / 1000; - } + if(!XScreenSaverQueryInfo(QX11Info::display(), QX11Info::appRootWindow(), d->ss_info)) + return 0; + + return d->ss_info->idle / 1000; +} #endif #endif diff --git a/src/modules/my/libkvimy.cpp b/src/modules/my/libkvimy.cpp index eae752e08..de1aa3e78 100644 --- a/src/modules/my/libkvimy.cpp +++ b/src/modules/my/libkvimy.cpp @@ -33,23 +33,26 @@ #include "KviIrcServer.h" #include "Idle.h" -Idle* g_pIdle; - -#define GET_KVS_CONSOLE \ - kvs_uint_t uiWnd; \ - KviConsoleWindow *wnd =0; \ - KVSM_PARAMETERS_BEGIN(c) \ - KVSM_PARAMETER("context_id",KVS_PT_UINT,KVS_PF_OPTIONAL,uiWnd) \ - KVSM_PARAMETERS_END(c) \ - if(!c->parameterList()->count()) \ - { \ - if(c->window()->console()) wnd = c->window()->console(); \ - else c->warning(__tr2qs("This window has no associated IRC context")); \ - } \ - else \ - { \ - wnd = g_pApp->findConsole(uiWnd); \ - if(!wnd)c->warning(__tr2qs("No such IRC context (%d)"),uiWnd); \ +Idle * g_pIdle; + +#define GET_KVS_CONSOLE \ + kvs_uint_t uiWnd; \ + KviConsoleWindow * wnd = 0; \ + KVSM_PARAMETERS_BEGIN(c) \ + KVSM_PARAMETER("context_id", KVS_PT_UINT, KVS_PF_OPTIONAL, uiWnd) \ + KVSM_PARAMETERS_END(c) \ + if(!c->parameterList()->count()) \ + { \ + if(c->window()->console()) \ + wnd = c->window()->console(); \ + else \ + c->warning(__tr2qs("This window has no associated IRC context")); \ + } \ + else \ + { \ + wnd = g_pApp->findConsole(uiWnd); \ + if(!wnd) \ + c->warning(__tr2qs("No such IRC context (%d)"), uiWnd); \ } /* @@ -119,7 +122,8 @@ static bool my_kvs_cmd_startIdleTimer(KviKvsModuleCommandCall *) static bool my_kvs_cmd_stopIdleTimer(KviKvsModuleCommandCall *) { - if(!g_pIdle) return true; + if(!g_pIdle) + return true; g_pIdle->stop(); //delete g_pIdle; return true; @@ -145,7 +149,9 @@ static bool my_kvs_fnc_globalIdle(KviKvsModuleFunctionCall * c) if(g_pIdle) { c->returnValue()->setInteger(g_pIdle->secondsIdle()); - } else { + } + else + { c->error(__tr2qs("Global idle timer must be started before using $my.globalIdle function")); } return true; @@ -389,19 +395,19 @@ static bool my_kvs_fnc_network(KviKvsModuleFunctionCall * c) static bool my_module_init(KviModule * m) { g_pIdle = 0; - KVSM_REGISTER_FUNCTION(m,"nick",my_kvs_fnc_nick); - KVSM_REGISTER_FUNCTION(m,"user",my_kvs_fnc_user); - KVSM_REGISTER_FUNCTION(m,"host",my_kvs_fnc_host); - KVSM_REGISTER_FUNCTION(m,"ip",my_kvs_fnc_ip); - KVSM_REGISTER_FUNCTION(m,"server",my_kvs_fnc_server); - KVSM_REGISTER_FUNCTION(m,"network",my_kvs_fnc_network); - KVSM_REGISTER_FUNCTION(m,"umode",my_kvs_fnc_umode); - KVSM_REGISTER_FUNCTION(m,"serverIsSSL",my_kvs_fnc_serverIsSSL); - KVSM_REGISTER_FUNCTION(m,"serverIsIPV6",my_kvs_fnc_serverIsIPV6); - KVSM_REGISTER_FUNCTION(m,"globalIdle",my_kvs_fnc_globalIdle); - - KVSM_REGISTER_SIMPLE_COMMAND(m,"stopIdleTimer",my_kvs_cmd_stopIdleTimer); - KVSM_REGISTER_SIMPLE_COMMAND(m,"startIdleTimer",my_kvs_cmd_startIdleTimer); + KVSM_REGISTER_FUNCTION(m, "nick", my_kvs_fnc_nick); + KVSM_REGISTER_FUNCTION(m, "user", my_kvs_fnc_user); + KVSM_REGISTER_FUNCTION(m, "host", my_kvs_fnc_host); + KVSM_REGISTER_FUNCTION(m, "ip", my_kvs_fnc_ip); + KVSM_REGISTER_FUNCTION(m, "server", my_kvs_fnc_server); + KVSM_REGISTER_FUNCTION(m, "network", my_kvs_fnc_network); + KVSM_REGISTER_FUNCTION(m, "umode", my_kvs_fnc_umode); + KVSM_REGISTER_FUNCTION(m, "serverIsSSL", my_kvs_fnc_serverIsSSL); + KVSM_REGISTER_FUNCTION(m, "serverIsIPV6", my_kvs_fnc_serverIsIPV6); + KVSM_REGISTER_FUNCTION(m, "globalIdle", my_kvs_fnc_globalIdle); + + KVSM_REGISTER_SIMPLE_COMMAND(m, "stopIdleTimer", my_kvs_cmd_stopIdleTimer); + KVSM_REGISTER_SIMPLE_COMMAND(m, "startIdleTimer", my_kvs_cmd_startIdleTimer); return true; } @@ -419,15 +425,14 @@ static bool my_module_can_unload(KviModule *) } KVIRC_MODULE( - "My", // module name - "4.0.0", // module version - "Copyright (C) 2002 Szymon Stefanek (pragma at kvirc dot net)" \ - " (C) 2005 Tonino Imbesi (grifisx at barmes dot net)" \ - " (C) 2005 Alessandro Carbone (elfonol at gmail dot com)", // author & (C) - "Scripting irc-context related functions", - my_module_init, - my_module_can_unload, - 0, - my_module_cleanup, - 0 -) + "My", // module name + "4.0.0", // module version + "Copyright (C) 2002 Szymon Stefanek (pragma at kvirc dot net)" + " (C) 2005 Tonino Imbesi (grifisx at barmes dot net)" + " (C) 2005 Alessandro Carbone (elfonol at gmail dot com)", // author & (C) + "Scripting irc-context related functions", + my_module_init, + my_module_can_unload, + 0, + my_module_cleanup, + 0) diff --git a/src/modules/notifier/NotifierMessage.cpp b/src/modules/notifier/NotifierMessage.cpp index 3456a3db6..8154c23ef 100644 --- a/src/modules/notifier/NotifierMessage.cpp +++ b/src/modules/notifier/NotifierMessage.cpp @@ -37,8 +37,8 @@ NotifierMessage::NotifierMessage(QPixmap * pPixmap, const QString & szText) m_pLabel0 = 0; m_pLabel1 = 0; - m_szText=szText; - m_pPixmap=pPixmap; + m_szText = szText; + m_pPixmap = pPixmap; //QByteArray utf8 = szText.toUtf8(); //if(utf8.data()) @@ -74,10 +74,12 @@ void NotifierMessage::updateGui() if(bShowImages) { m_pLabel0 = new QLabel(this); - m_pLabel0->setFixedSize(16,16); + m_pLabel0->setFixedSize(16, 16); if(m_pPixmap) m_pLabel0->setPixmap(*m_pPixmap); - } else { + } + else + { m_pLabel0 = 0; } @@ -92,7 +94,7 @@ void NotifierMessage::updateGui() if(bShowImages) { - m_pHBox->setStretch(1,99); + m_pHBox->setStretch(1, 99); m_pHBox->addWidget(m_pLabel0); } m_pHBox->addWidget(m_pLabel1); diff --git a/src/modules/notifier/NotifierMessage.h b/src/modules/notifier/NotifierMessage.h index 55a12c8f9..c0179f0e1 100644 --- a/src/modules/notifier/NotifierMessage.h +++ b/src/modules/notifier/NotifierMessage.h @@ -43,6 +43,7 @@ class NotifierMessage : public QWidget { friend class NotifierWindow; + public: /** * \brief Constructs the NotifierMessage object @@ -50,22 +51,24 @@ public: * \param szText const reference to message text in irc format * \return NotifierMessage */ - NotifierMessage(QPixmap * pPixmap, const QString &szText); + NotifierMessage(QPixmap * pPixmap, const QString & szText); /** * \brief Destroys the NotifierMessage object */ ~NotifierMessage(); + private: /// The message text - QString m_szText; + QString m_szText; /// The message icon (can be null) - QPixmap * m_pPixmap; + QPixmap * m_pPixmap; /// Layout for the labels QHBoxLayout * m_pHBox; /// Label for the message icon - QLabel * m_pLabel0; + QLabel * m_pLabel0; /// Label for the message text - QLabel * m_pLabel1; + QLabel * m_pLabel1; + public: /** * \brief Returns the original irc message diff --git a/src/modules/notifier/NotifierSettings.h b/src/modules/notifier/NotifierSettings.h index 9bc3f6c94..04aadee8f 100644 --- a/src/modules/notifier/NotifierSettings.h +++ b/src/modules/notifier/NotifierSettings.h @@ -26,20 +26,18 @@ // Global settings for KviNotifier - - -#define WDG_MIN_WIDTH 370 -#define WDG_MIN_HEIGHT 160 +#define WDG_MIN_WIDTH 370 +#define WDG_MIN_HEIGHT 160 #define WDG_BORDER_THICKNESS 5 #define SPACING 2 -#define WDG_ICON_OUT 0 -#define WDG_ICON_OVER 1 -#define WDG_ICON_CLICKED 2 -#define WDG_ICON_ON 3 -#define WDG_ICON_OFF 4 +#define WDG_ICON_OUT 0 +#define WDG_ICON_OVER 1 +#define WDG_ICON_CLICKED 2 +#define WDG_ICON_ON 3 +#define WDG_ICON_OFF 4 -#define NTF_TABS_FONT_BASELINE 8 +#define NTF_TABS_FONT_BASELINE 8 #define MAX_MESSAGES_IN_WINDOW 20 // keep hidden messages for 600 seconds : 10 min @@ -49,18 +47,31 @@ #define NUM_OLD_COLORS 6 -#define WDG_UPSX 1 -#define WDG_UP 2 -#define WDG_UPDX 3 -#define WDG_DWNSX 4 -#define WDG_DWN 5 -#define WDG_DWNDX 6 -#define WDG_SX 7 -#define WDG_DX 8 +#define WDG_UPSX 1 +#define WDG_UP 2 +#define WDG_UPDX 3 +#define WDG_DWNSX 4 +#define WDG_DWN 5 +#define WDG_DWNDX 6 +#define WDG_SX 7 +#define WDG_DX 8 -#define m_mac_bkgColor QColor(236,233,216) // Light-brown color of notifier background widget +#define m_mac_bkgColor QColor(236, 233, 216) // Light-brown color of notifier background widget -enum State { Hidden, Showing, Visible, Hiding, FocusingOff, FocusingOn }; -enum TabState { Normal, Highlighted, Changed }; +enum State +{ + Hidden, + Showing, + Visible, + Hiding, + FocusingOff, + FocusingOn +}; +enum TabState +{ + Normal, + Highlighted, + Changed +}; -#endif //_NOTIFIER_SETTINGS_H_ +#endif //_NOTIFIER_SETTINGS_H_ diff --git a/src/modules/notifier/NotifierWindow.cpp b/src/modules/notifier/NotifierWindow.cpp index ebd9e40e8..b0f4e703d 100644 --- a/src/modules/notifier/NotifierWindow.cpp +++ b/src/modules/notifier/NotifierWindow.cpp @@ -52,18 +52,15 @@ extern NotifierWindow * g_pNotifierWindow; NotifierWindow::NotifierWindow() -: QWidget(0, + : QWidget(0, #if defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW) - Qt::FramelessWindowHint | - Qt::Tool | - Qt::WindowStaysOnTopHint) + Qt::FramelessWindowHint | Qt::Tool | Qt::WindowStaysOnTopHint) #else - Qt::FramelessWindowHint | + Qt::FramelessWindowHint | #ifndef COMPILE_ON_MAC - Qt::Tool | - Qt::X11BypassWindowManagerHint | + Qt::Tool | Qt::X11BypassWindowManagerHint | #endif - Qt::WindowStaysOnTopHint) + Qt::WindowStaysOnTopHint) #endif { setObjectName("kvirc_notifier_window"); @@ -75,7 +72,7 @@ NotifierWindow::NotifierWindow() m_pShowHideTimer = 0; m_pBlinkTimer = 0; m_tAutoHideAt = 0; - m_tStartedAt=0; + m_tStartedAt = 0; m_pAutoHideTimer = 0; m_pWndBorder = new NotifierWindowBorder(); @@ -109,15 +106,15 @@ NotifierWindow::NotifierWindow() QRect r = pDesktop->availableGeometry(pDesktop->primaryScreen()); m_wndRect.setRect( - r.x() + r.width() - (WDG_MIN_WIDTH + SPACING), - r.y() + r.height() - (WDG_MIN_HEIGHT + SPACING), - WDG_MIN_WIDTH, - WDG_MIN_HEIGHT); + r.x() + r.width() - (WDG_MIN_WIDTH + SPACING), + r.y() + r.height() - (WDG_MIN_HEIGHT + SPACING), + WDG_MIN_WIDTH, + WDG_MIN_HEIGHT); m_pWndTabs = new QTabWidget(this); m_pWndTabs->setUsesScrollButtons(true); m_pWndTabs->setTabsClosable(true); - connect(m_pWndTabs,SIGNAL(tabCloseRequested(int)),this,SLOT(slotTabCloseRequested(int))); + connect(m_pWndTabs, SIGNAL(tabCloseRequested(int)), this, SLOT(slotTabCloseRequested(int))); m_pProgressBar = new QProgressBar(this); m_pProgressBar->setOrientation(Qt::Vertical); @@ -127,24 +124,24 @@ NotifierWindow::NotifierWindow() m_pProgressBar->installEventFilter(this); m_pLineEdit = new KviThemedLineEdit(this, 0, "notifier_lineedit"); - QPalette palette=m_pLineEdit->palette(); + QPalette palette = m_pLineEdit->palette(); palette.setColor(m_pLineEdit->backgroundRole(), Qt::transparent); m_pLineEdit->setPalette(palette); m_pLineEdit->installEventFilter(this); - connect(m_pLineEdit,SIGNAL(returnPressed()),this,SLOT(returnPressed())); + connect(m_pLineEdit, SIGNAL(returnPressed()), this, SLOT(returnPressed())); - QGridLayout *layout = new QGridLayout; - layout->addWidget(m_pProgressBar, 0,0,2,1); - layout->addWidget(m_pWndTabs,0,1,1,1); - layout->addWidget(m_pLineEdit,1,1,1,1); + QGridLayout * layout = new QGridLayout; + layout->addWidget(m_pProgressBar, 0, 0, 2, 1); + layout->addWidget(m_pWndTabs, 0, 1, 1, 1); + layout->addWidget(m_pLineEdit, 1, 1, 1, 1); layout->setSpacing(SPACING); layout->setGeometry(m_pWndBorder->bodyRect()); - layout->setContentsMargins(5,25,5,5); + layout->setContentsMargins(5, 25, 5, 5); setLayout(layout); - connect(g_pApp,SIGNAL(updateNotifier()),this,SLOT(updateGui())); - QTimer::singleShot(0,this,SLOT(updateGui())); + connect(g_pApp, SIGNAL(updateNotifier()), this, SLOT(updateGui())); + QTimer::singleShot(0, this, SLOT(updateGui())); } NotifierWindow::~NotifierWindow() @@ -159,35 +156,34 @@ NotifierWindow::~NotifierWindow() void NotifierWindow::updateGui() { setFont(KVI_OPTION_FONT(KviOption_fontNotifier)); - QPalette palette=m_pLineEdit->palette(); + QPalette palette = m_pLineEdit->palette(); palette.setColor(m_pLineEdit->foregroundRole(), KVI_OPTION_COLOR(KviOption_colorNotifierForeground)); m_pLineEdit->setPalette(palette); m_pLineEdit->setFont(KVI_OPTION_FONT(KviOption_fontNotifier)); - for(int i=0; icount();++i) + for(int i = 0; i < m_pWndTabs->count(); ++i) { - ((NotifierWindowTab*)m_pWndTabs->widget(i))->updateGui(); + ((NotifierWindowTab *)m_pWndTabs->widget(i))->updateGui(); } - } void NotifierWindow::addMessage(KviWindow * pWnd, const QString & szImageId, const QString & szText, unsigned int uMessageTime) { QPixmap * pIcon; QString szMessage = szText; - szMessage.replace( QRegExp("\r([^\r])*\r([^\r])+\r"), "\\2" ); + szMessage.replace(QRegExp("\r([^\r])*\r([^\r])+\r"), "\\2"); if(szImageId.isEmpty()) pIcon = 0; else pIcon = g_pIconManager->getImage(szImageId); - NotifierMessage * pMessage = new NotifierMessage(pIcon ? new QPixmap(*pIcon) : 0,szMessage); + NotifierMessage * pMessage = new NotifierMessage(pIcon ? new QPixmap(*pIcon) : 0, szMessage); //search for an existing tab - NotifierWindowTab * pTab = 0, * pTmp = 0; - for(int i=0; i < m_pWndTabs->count();++i) + NotifierWindowTab *pTab = 0, *pTmp = 0; + for(int i = 0; i < m_pWndTabs->count(); ++i) { - pTmp = (NotifierWindowTab*)m_pWndTabs->widget(i); + pTmp = (NotifierWindowTab *)m_pWndTabs->widget(i); if(pTmp->wnd() == pWnd) { pTab = pTmp; @@ -219,7 +215,9 @@ void NotifierWindow::addMessage(KviWindow * pWnd, const QString & szImageId, con if(m_eState == Visible) startAutoHideTimer(); } - } else { + } + else + { // never hide stopAutoHideTimer(); m_tAutoHideAt = 0; @@ -264,44 +262,44 @@ void NotifierWindow::stopAutoHideTimer() // We also lack the code for MacOSX and Qt-only-X11 compilation. #if COMPILE_KDE_SUPPORT - #include +#include - static bool active_window_is_full_screen() - { - WId activeId = KWindowSystem::activeWindow(); - KWindowInfo wi = KWindowSystem::windowInfo(activeId, NET::WMState); - return (wi.valid() && wi.hasState(NET::FullScreen)); - } +static bool active_window_is_full_screen() +{ + WId activeId = KWindowSystem::activeWindow(); + KWindowInfo wi = KWindowSystem::windowInfo(activeId, NET::WMState); + return (wi.valid() && wi.hasState(NET::FullScreen)); +} #else // COMPILE_KDE_SUPPORT - #if defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW) +#if defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW) - static bool active_window_is_full_screen() - { - HWND hForeground = ::GetForegroundWindow(); - if(!hForeground) - return false; +static bool active_window_is_full_screen() +{ + HWND hForeground = ::GetForegroundWindow(); + if(!hForeground) + return false; - HWND hDesktop = ::GetDesktopWindow(); - if(hForeground == hDesktop) - return false; + HWND hDesktop = ::GetDesktopWindow(); + if(hForeground == hDesktop) + return false; - HWND hShell = ::GetShellWindow(); - if(hForeground == hShell) - return false; + HWND hShell = ::GetShellWindow(); + if(hForeground == hShell) + return false; - RECT rct; - ::GetWindowRect(hForeground,&rct); + RECT rct; + ::GetWindowRect(hForeground, &rct); - if((rct.right - rct.left) < GetSystemMetrics(SM_CXSCREEN)) - return false; + if((rct.right - rct.left) < GetSystemMetrics(SM_CXSCREEN)) + return false; - if((rct.bottom - rct.top) < GetSystemMetrics(SM_CYSCREEN)) - return false; + if((rct.bottom - rct.top) < GetSystemMetrics(SM_CYSCREEN)) + return false; - return true; - } + return true; +} - #endif //COMPILE_ON_WINDOWS || COMPILE_ON_MINGW +#endif //COMPILE_ON_WINDOWS || COMPILE_ON_MINGW #endif // COMPILE_KDE_SUPPORT void NotifierWindow::doShow(bool bDoAnimate) @@ -328,15 +326,15 @@ void NotifierWindow::doShow(bool bDoAnimate) case Showing: // already showing up return; - break; + break; case Visible: // already visible return; - break; + break; case Hiding: // ops.. hiding! m_eState = Showing; - break; + break; case Hidden: stopShowHideTimer(); stopBlinkTimer(); @@ -350,7 +348,7 @@ void NotifierWindow::doShow(bool bDoAnimate) if(bDoAnimate) { m_pShowHideTimer = new QTimer(); - connect(m_pShowHideTimer,SIGNAL(timeout()),this,SLOT(heartbeat())); + connect(m_pShowHideTimer, SIGNAL(timeout()), this, SLOT(heartbeat())); m_dOpacity = OPACITY_STEP; m_eState = Showing; m_bCrashShowWorkAround = true; @@ -358,16 +356,18 @@ void NotifierWindow::doShow(bool bDoAnimate) show(); m_pShowHideTimer->start(40); m_bCrashShowWorkAround = false; - } else { + } + else + { m_dOpacity = 1.0; m_eState = Visible; show(); startBlinking(); startAutoHideTimer(); } - break; + break; default: - break; + break; } } @@ -375,7 +375,7 @@ bool NotifierWindow::shouldHideIfMainWindowGotAttention() { if(m_bDisableHideOnMainWindowGotAttention) return false; - NotifierWindowTab * pTab = (NotifierWindowTab *) m_pWndTabs->currentWidget(); + NotifierWindowTab * pTab = (NotifierWindowTab *)m_pWndTabs->currentWidget(); if(!pTab) return false; if(!pTab->wnd()) @@ -391,7 +391,7 @@ void NotifierWindow::heartbeat() { case Hidden: hideNow(); - break; + break; case Visible: stopShowHideTimer(); m_dOpacity = 1.0; @@ -399,18 +399,20 @@ void NotifierWindow::heartbeat() show(); else update(); - break; + break; case Showing: // if the main window got attention while // showing up then just hide now if(shouldHideIfMainWindowGotAttention()) { m_eState = Hiding; - } else { + } + else + { m_dOpacity += OPACITY_STEP; targetOpacity = isActiveWindow() ? KVI_OPTION_UINT(KviOption_uintNotifierActiveTransparency) : KVI_OPTION_UINT(KviOption_uintNotifierInactiveTransparency); - targetOpacity/=100; + targetOpacity /= 100; if(m_dOpacity >= targetOpacity) { m_dOpacity = targetOpacity; @@ -424,18 +426,14 @@ void NotifierWindow::heartbeat() show(); setWindowOpacity(m_dOpacity); update(); - } - break; + break; case FocusingOn: targetOpacity = KVI_OPTION_UINT(KviOption_uintNotifierActiveTransparency); targetOpacity /= 100; bIncreasing = targetOpacity > m_dOpacity; - m_dOpacity += bIncreasing? - OPACITY_STEP : -(OPACITY_STEP); - if((bIncreasing && (m_dOpacity >= targetOpacity)) || - (!bIncreasing && (m_dOpacity <= targetOpacity)) - ) + m_dOpacity += bIncreasing ? OPACITY_STEP : -(OPACITY_STEP); + if((bIncreasing && (m_dOpacity >= targetOpacity)) || (!bIncreasing && (m_dOpacity <= targetOpacity))) { m_dOpacity = targetOpacity; m_eState = Visible; @@ -450,9 +448,7 @@ void NotifierWindow::heartbeat() bIncreasing = targetOpacity > m_dOpacity; m_dOpacity += bIncreasing ? OPACITY_STEP : -(OPACITY_STEP); //qDebug("%f %f %i %i",m_dOpacity,targetOpacity,bIncreasing,(m_dOpacity >= targetOpacity)); - if((bIncreasing && (m_dOpacity >= targetOpacity)) || - (!bIncreasing && (m_dOpacity <= targetOpacity)) - ) + if((bIncreasing && (m_dOpacity >= targetOpacity)) || (!bIncreasing && (m_dOpacity <= targetOpacity))) { m_dOpacity = targetOpacity; m_eState = Visible; @@ -468,7 +464,7 @@ void NotifierWindow::heartbeat() hideNow(); else update(); - break; + break; } } @@ -488,57 +484,60 @@ void NotifierWindow::doHide(bool bDoAnimate) stopAutoHideTimer(); switch(m_eState) { - case Hiding: - // already hiding up - if(!bDoAnimate) - hideNow(); - return; - break; - case Hidden: - // already hidden - if(isVisible()) - hideNow(); - return; - break; - case Showing: - // ops.. hiding! - if(!bDoAnimate) - hideNow(); - else { - // continue animating, but hide - m_eState = Hiding; - } - break; - case Visible: - stopBlinkTimer(); - stopShowHideTimer(); - if((!bDoAnimate) || (x() != m_pWndBorder->x()) || (y() != m_pWndBorder->y())) - { + case Hiding: + // already hiding up + if(!bDoAnimate) + hideNow(); + return; + break; + case Hidden: + // already hidden + if(isVisible()) + hideNow(); + return; + break; + case Showing: + // ops.. hiding! + if(!bDoAnimate) + hideNow(); + else + { + // continue animating, but hide + m_eState = Hiding; + } + break; + case Visible: + stopBlinkTimer(); + stopShowHideTimer(); + if((!bDoAnimate) || (x() != m_pWndBorder->x()) || (y() != m_pWndBorder->y())) + { - //qDebug("just hide quickly with notifier x() %d and notifier y() % - WBorderx() %d and WBordery() %d and bDoanimate %d",x(),y(),m_pWndBorder->x(),m_pWndBorder->y(),bDoAnimate); - // the user asked to not animate or - // the window has been moved and the animation would suck anyway - // just hide quickly - hideNow(); - } else { - //qDebug("starting hide animation notifier x() %d and notifier y() % - WBorderx() %d and WBordery() %d and bDoanimate %d",x(),y(),m_pWndBorder->x(),m_pWndBorder->y(),bDoAnimate); - m_pShowHideTimer = new QTimer(); - connect(m_pShowHideTimer,SIGNAL(timeout()),this,SLOT(heartbeat())); - m_dOpacity = 1.0 - OPACITY_STEP; - m_eState = Hiding; - setWindowOpacity(m_dOpacity); - update(); - m_pShowHideTimer->start(40); - } - break; + //qDebug("just hide quickly with notifier x() %d and notifier y() % - WBorderx() %d and WBordery() %d and bDoanimate %d",x(),y(),m_pWndBorder->x(),m_pWndBorder->y(),bDoAnimate); + // the user asked to not animate or + // the window has been moved and the animation would suck anyway + // just hide quickly + hideNow(); + } + else + { + //qDebug("starting hide animation notifier x() %d and notifier y() % - WBorderx() %d and WBordery() %d and bDoanimate %d",x(),y(),m_pWndBorder->x(),m_pWndBorder->y(),bDoAnimate); + m_pShowHideTimer = new QTimer(); + connect(m_pShowHideTimer, SIGNAL(timeout()), this, SLOT(heartbeat())); + m_dOpacity = 1.0 - OPACITY_STEP; + m_eState = Hiding; + setWindowOpacity(m_dOpacity); + update(); + m_pShowHideTimer->start(40); + } + break; default: - break; + break; } } void NotifierWindow::showEvent(QShowEvent *) { - setGeometry(m_wndRect); + setGeometry(m_wndRect); } void NotifierWindow::hideEvent(QHideEvent *) @@ -561,7 +560,7 @@ void NotifierWindow::startBlinking() if(KVI_OPTION_BOOL(KviOption_boolNotifierFlashing)) { m_pBlinkTimer = new QTimer(); - connect(m_pBlinkTimer,SIGNAL(timeout()),this,SLOT(blink())); + connect(m_pBlinkTimer, SIGNAL(timeout()), this, SLOT(blink())); m_iBlinkCount = 0; m_pBlinkTimer->start(1000); } @@ -579,7 +578,7 @@ void NotifierWindow::startAutoHideTimer() iSecs = 5; m_pAutoHideTimer = new QTimer(); - connect(m_pAutoHideTimer,SIGNAL(timeout()),this,SLOT(progressUpdate())); + connect(m_pAutoHideTimer, SIGNAL(timeout()), this, SLOT(progressUpdate())); m_pAutoHideTimer->start(100); } @@ -593,7 +592,9 @@ void NotifierWindow::blink() // stop blinking at a certain point and remain highlighted m_bBlinkOn = true; stopBlinkTimer(); - } else { + } + else + { // if the main window got attention while // showing up then just hide now if(shouldHideIfMainWindowGotAttention()) @@ -614,8 +615,10 @@ void NotifierWindow::paintEvent(QPaintEvent * e) if(m_bBlinkOn) { - m_pWndBorder->draw(pPaint,true); - } else { + m_pWndBorder->draw(pPaint, true); + } + else + { m_pWndBorder->draw(pPaint); } @@ -629,13 +632,17 @@ void NotifierWindow::paintEvent(QPaintEvent * e) if(pTab->wnd()) { szTitle += pTab->wnd()->plainTextCaption(); - } else { - szTitle += "notifier"; } - } else { + else + { szTitle += "notifier"; + } } - pPaint->drawText(m_pWndBorder->titleRect(),Qt::AlignLeft | Qt::AlignVCenter | Qt::TextSingleLine,szTitle); + else + { + szTitle += "notifier"; + } + pPaint->drawText(m_pWndBorder->titleRect(), Qt::AlignLeft | Qt::AlignVCenter | Qt::TextSingleLine, szTitle); delete pPaint; e->ignore(); @@ -657,7 +664,7 @@ void NotifierWindow::mouseMoveEvent(QMouseEvent * e) goto sartelo; } -sartelo: + sartelo: update(); } @@ -675,7 +682,8 @@ sartelo: m_wndRect.setHeight(iH); setGeometry(m_wndRect); - } else if(m_bResizing) + } + else if(m_bResizing) { resize(e->pos()); } @@ -702,7 +710,8 @@ void NotifierWindow::mousePressEvent(QMouseEvent * e) { contextPopup(mapToGlobal(e->pos())); return; - } else if(e->button() == Qt::LeftButton) + } + else if(e->button() == Qt::LeftButton) { m_bLeftButtonIsPressed = true; } @@ -782,30 +791,34 @@ bool NotifierWindow::checkResizing(QPoint e) { //// UP LEFT CORNER //// setCursor(Qt::SizeFDiagCursor); - if (m_bLeftButtonIsPressed) + if(m_bLeftButtonIsPressed) { m_bResizing = true; m_whereResizing = WDG_UPSX; } - } else if(e.x() > (size().width()-WDG_BORDER_THICKNESS)) + } + else if(e.x() > (size().width() - WDG_BORDER_THICKNESS)) { //// UP RIGHT CORNER //// setCursor(Qt::SizeBDiagCursor); - if (m_bLeftButtonIsPressed) + if(m_bLeftButtonIsPressed) { m_bResizing = true; m_whereResizing = WDG_UPDX; } - } else { + } + else + { //// UP SIDE //// setCursor(Qt::SizeVerCursor); - if (m_bLeftButtonIsPressed) + if(m_bLeftButtonIsPressed) { m_bResizing = true; m_whereResizing = WDG_UP; } } - } else if(e.y() > (size().height()-WDG_BORDER_THICKNESS)) + } + else if(e.y() > (size().height() - WDG_BORDER_THICKNESS)) { if(e.x() < WDG_BORDER_THICKNESS) { @@ -816,7 +829,8 @@ bool NotifierWindow::checkResizing(QPoint e) m_bResizing = true; m_whereResizing = WDG_DWNSX; } - } else if(e.x() > (size().width()-WDG_BORDER_THICKNESS)) + } + else if(e.x() > (size().width() - WDG_BORDER_THICKNESS)) { //// DOWN RIGHT CORNER //// setCursor(Qt::SizeFDiagCursor); @@ -825,7 +839,9 @@ bool NotifierWindow::checkResizing(QPoint e) m_bResizing = true; m_whereResizing = WDG_DWNDX; } - } else { + } + else + { //// DOWN SIDE //// setCursor(Qt::SizeVerCursor); if(m_bLeftButtonIsPressed) @@ -834,7 +850,9 @@ bool NotifierWindow::checkResizing(QPoint e) m_whereResizing = WDG_DWN; } } - } else { + } + else + { if(e.x() < WDG_BORDER_THICKNESS) { //// LEFT SIZE //// @@ -844,7 +862,8 @@ bool NotifierWindow::checkResizing(QPoint e) m_bResizing = true; m_whereResizing = WDG_SX; } - } else if(e.x() > (size().width()-WDG_BORDER_THICKNESS)) + } + else if(e.x() > (size().width() - WDG_BORDER_THICKNESS)) { //// RIGHT SIZE //// setCursor(Qt::SizeHorCursor); @@ -853,7 +872,9 @@ bool NotifierWindow::checkResizing(QPoint e) m_bResizing = true; m_whereResizing = WDG_DX; } - } else { + } + else + { //// ELSEWHERE //// m_whereResizing = 0; m_bResizing = false; @@ -875,7 +896,7 @@ void NotifierWindow::resize(QPoint, bool) if(m_whereResizing == WDG_UPSX || m_whereResizing == WDG_UP || m_whereResizing == WDG_UPDX) { - if(y()+height()-cursor().pos().y() < WDG_MIN_HEIGHT) + if(y() + height() - cursor().pos().y() < WDG_MIN_HEIGHT) m_wndRect.setTop(y() + height() - WDG_MIN_HEIGHT); else m_wndRect.setTop(cursor().pos().y()); @@ -909,7 +930,8 @@ inline void NotifierWindow::setCursor(int iCur) QApplication::restoreOverrideCursor(); m_cursor.setShape((Qt::CursorShape)iCur); QApplication::setOverrideCursor(m_cursor); - } else if(iCur == -1) + } + else if(iCur == -1) { if(QApplication::overrideCursor()) QApplication::restoreOverrideCursor(); @@ -921,7 +943,7 @@ void NotifierWindow::enterEvent(QEvent *) if(!m_pShowHideTimer) { m_pShowHideTimer = new QTimer(); - connect(m_pShowHideTimer,SIGNAL(timeout()),this,SLOT(heartbeat())); + connect(m_pShowHideTimer, SIGNAL(timeout()), this, SLOT(heartbeat())); } m_eState = FocusingOn; m_pShowHideTimer->start(40); @@ -937,10 +959,10 @@ void NotifierWindow::leaveEvent(QEvent *) if(!m_pShowHideTimer) { m_pShowHideTimer = new QTimer(); - connect(m_pShowHideTimer,SIGNAL(timeout()),this,SLOT(heartbeat())); + connect(m_pShowHideTimer, SIGNAL(timeout()), this, SLOT(heartbeat())); } - if(m_eState!=Hidden) + if(m_eState != Hidden) { m_eState = FocusingOff; m_pShowHideTimer->start(40); @@ -951,9 +973,9 @@ void NotifierWindow::contextPopup(const QPoint & pos) { if(!m_pContextPopup) { - m_pContextPopup = new QMenu(this); - connect(m_pContextPopup,SIGNAL(aboutToShow()),this,SLOT(fillContextPopup())); - m_pDisablePopup = new QMenu(this); + m_pContextPopup = new QMenu(this); + connect(m_pContextPopup, SIGNAL(aboutToShow()), this, SLOT(fillContextPopup())); + m_pDisablePopup = new QMenu(this); } m_pContextPopup->popup(pos); @@ -962,20 +984,20 @@ void NotifierWindow::contextPopup(const QPoint & pos) void NotifierWindow::fillContextPopup() { m_pContextPopup->clear(); - m_pContextPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::Editor)),__tr2qs_ctx("Show/Hide input line","notifier"),this,SLOT(toggleLineEdit())); - m_pContextPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::Close)),__tr2qs_ctx("Hide","notifier"),this,SLOT(hideNow())); - m_pContextPopup->addSeparator(); + m_pContextPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::Editor)), __tr2qs_ctx("Show/Hide input line", "notifier"), this, SLOT(toggleLineEdit())); + m_pContextPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::Close)), __tr2qs_ctx("Hide", "notifier"), this, SLOT(hideNow())); + m_pContextPopup->addSeparator(); m_pDisablePopup->clear(); - m_pDisablePopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::Time)),__tr2qs_ctx("1 Minute","notifier"),this,SLOT(disableFor1Minute())); - m_pDisablePopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::Time)),__tr2qs_ctx("5 Minutes","notifier"),this,SLOT(disableFor5Minutes())); - m_pDisablePopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::Time)),__tr2qs_ctx("15 Minutes","notifier"),this,SLOT(disableFor15Minutes())); - m_pDisablePopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::Time)),__tr2qs_ctx("30 Minutes","notifier"),this,SLOT(disableFor30Minutes())); - m_pDisablePopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::Time)),__tr2qs_ctx("1 Hour","notifier"),this,SLOT(disableFor60Minutes())); - m_pDisablePopup->addSeparator(); - m_pDisablePopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::Quit)),__tr2qs_ctx("Until KVIrc is Restarted","notifier"),this,SLOT(disableUntilKVIrcRestarted())); - m_pDisablePopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::Quit)),__tr2qs_ctx("Permanently (Until Explicitly Enabled)","notifier"),this,SLOT(disablePermanently())); - - m_pContextPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::Quit)),__tr2qs_ctx("Disable","notifier"))->setMenu(m_pDisablePopup); + m_pDisablePopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::Time)), __tr2qs_ctx("1 Minute", "notifier"), this, SLOT(disableFor1Minute())); + m_pDisablePopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::Time)), __tr2qs_ctx("5 Minutes", "notifier"), this, SLOT(disableFor5Minutes())); + m_pDisablePopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::Time)), __tr2qs_ctx("15 Minutes", "notifier"), this, SLOT(disableFor15Minutes())); + m_pDisablePopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::Time)), __tr2qs_ctx("30 Minutes", "notifier"), this, SLOT(disableFor30Minutes())); + m_pDisablePopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::Time)), __tr2qs_ctx("1 Hour", "notifier"), this, SLOT(disableFor60Minutes())); + m_pDisablePopup->addSeparator(); + m_pDisablePopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::Quit)), __tr2qs_ctx("Until KVIrc is Restarted", "notifier"), this, SLOT(disableUntilKVIrcRestarted())); + m_pDisablePopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::Quit)), __tr2qs_ctx("Permanently (Until Explicitly Enabled)", "notifier"), this, SLOT(disablePermanently())); + + m_pContextPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::Quit)), __tr2qs_ctx("Disable", "notifier"))->setMenu(m_pDisablePopup); } void NotifierWindow::disableFor15Minutes() @@ -994,7 +1016,6 @@ void NotifierWindow::disableFor5Minutes() hideNow(); } - void NotifierWindow::disableFor1Minute() { kvi_time_t tNow = kvi_unixTime(); @@ -1050,7 +1071,7 @@ void NotifierWindow::showLineEdit(bool bShow) return; m_pLineEdit->setToolTip(""); - QString szTip = __tr2qs_ctx("Write text or commands to window","notifier"); + QString szTip = __tr2qs_ctx("Write text or commands to window", "notifier"); szTip += " \""; szTip += ((NotifierWindowTab *)m_pWndTabs->currentWidget())->wnd()->plainTextCaption(); szTip += "\""; @@ -1058,7 +1079,9 @@ void NotifierWindow::showLineEdit(bool bShow) m_pLineEdit->show(); m_pLineEdit->setFocus(); activateWindow(); - } else { + } + else + { if(!m_pLineEdit->isVisible()) return; m_pLineEdit->hide(); @@ -1102,7 +1125,7 @@ void NotifierWindow::returnPressed() if(!m_pLineEdit->isVisible()) return; - NotifierWindowTab * pTab = (NotifierWindowTab *) m_pWndTabs->currentWidget(); + NotifierWindowTab * pTab = (NotifierWindowTab *)m_pWndTabs->currentWidget(); if(!pTab) return; if(!pTab->wnd()) @@ -1112,19 +1135,19 @@ void NotifierWindow::returnPressed() if(szTxt.isEmpty()) return; QString szHtml = szTxt; - szHtml.replace("<","<"); - szHtml.replace(">",">"); - KviCString szTmp(KviCString::Format,"%d",KviIconManager::OwnPrivMsg); + szHtml.replace("<", "<"); + szHtml.replace(">", ">"); + KviCString szTmp(KviCString::Format, "%d", KviIconManager::OwnPrivMsg); - addMessage(pTab->wnd(),szTmp.ptr(),szHtml,0); + addMessage(pTab->wnd(), szTmp.ptr(), szHtml, 0); m_pLineEdit->setText(""); - KviUserInput::parse(szTxt,pTab->wnd(),QString(),1); + KviUserInput::parse(szTxt, pTab->wnd(), QString(), 1); } void NotifierWindow::progressUpdate() { kvi_time_t now = kvi_unixTime(); - int iProgress = (int)(100/(m_tAutoHideAt - m_tStartedAt)*(now - m_tStartedAt)); + int iProgress = (int)(100 / (m_tAutoHideAt - m_tStartedAt) * (now - m_tStartedAt)); m_pProgressBar->setValue(iProgress); if(now >= m_tAutoHideAt) { @@ -1138,12 +1161,12 @@ void NotifierWindow::slotTabCloseRequested(int iIndex) { if(m_pWndTabs) { - NotifierWindowTab * pTab = (NotifierWindowTab *) m_pWndTabs->widget(iIndex); + NotifierWindowTab * pTab = (NotifierWindowTab *)m_pWndTabs->widget(iIndex); m_pWndTabs->removeTab(iIndex); if(pTab) pTab->deleteLater(); - if(m_pWndTabs->count()==0) + if(m_pWndTabs->count() == 0) hideNow(); } } diff --git a/src/modules/notifier/NotifierWindow.h b/src/modules/notifier/NotifierWindow.h index f48ec1688..c85c1d18e 100644 --- a/src/modules/notifier/NotifierWindow.h +++ b/src/modules/notifier/NotifierWindow.h @@ -60,60 +60,67 @@ class NotifierWindow : public QWidget public: NotifierWindow(); ~NotifierWindow(); + protected: QTimer * m_pShowHideTimer; QTimer * m_pBlinkTimer; QTimer * m_pAutoHideTimer; - State m_eState; - bool m_bBlinkOn; - double m_dOpacity; + State m_eState; + bool m_bBlinkOn; + double m_dOpacity; - bool m_bCloseDown; - bool m_bPrevDown; - bool m_bNextDown; - bool m_bWriteDown; - bool m_bCrashShowWorkAround; + bool m_bCloseDown; + bool m_bPrevDown; + bool m_bNextDown; + bool m_bWriteDown; + bool m_bCrashShowWorkAround; - QRect m_wndRect; + QRect m_wndRect; NotifierMessage * m_pCurrentMessage; KviThemedLineEdit * m_pLineEdit; - bool m_bDragging; - bool m_bLeftButtonIsPressed; - bool m_bDiagonalResizing; - bool m_bResizing; + bool m_bDragging; + bool m_bLeftButtonIsPressed; + bool m_bDiagonalResizing; + bool m_bResizing; - int m_whereResizing; + int m_whereResizing; - QPoint m_pntDrag; - QPoint m_pntPos; - QPoint m_pntClick; - int m_iBlinkCount; - QMenu * m_pContextPopup; - QMenu * m_pDisablePopup; + QPoint m_pntDrag; + QPoint m_pntPos; + QPoint m_pntClick; + int m_iBlinkCount; + QMenu * m_pContextPopup; + QMenu * m_pDisablePopup; KviWindow * m_pWindowToRaise; - kvi_time_t m_tAutoHideAt; - kvi_time_t m_tStartedAt; - QTime m_qtStartedAt; - bool m_bDisableHideOnMainWindowGotAttention; + kvi_time_t m_tAutoHideAt; + kvi_time_t m_tStartedAt; + QTime m_qtStartedAt; + bool m_bDisableHideOnMainWindowGotAttention; QCursor m_cursor; - QTabWidget * m_pWndTabs; - QProgressBar * m_pProgressBar; - NotifierWindowBorder * m_pWndBorder; + QTabWidget * m_pWndTabs; + QProgressBar * m_pProgressBar; + NotifierWindowBorder * m_pWndBorder; + public: void doShow(bool bDoAnimate); void doHide(bool bDoAnimate); int textWidth(); - void addMessage(KviWindow * pWnd,const QString &szImageId,const QString &szText,unsigned int uMessageTime); - void setDisableHideOnMainWindowGotAttention(bool b){ m_bDisableHideOnMainWindowGotAttention = b; }; + void addMessage(KviWindow * pWnd, const QString & szImageId, const QString & szText, unsigned int uMessageTime); + void setDisableHideOnMainWindowGotAttention(bool b) { m_bDisableHideOnMainWindowGotAttention = b; }; void showLineEdit(bool bShow); - inline int countTabs() const { if(m_pWndTabs)return m_pWndTabs->count(); return 0; }; + inline int countTabs() const + { + if(m_pWndTabs) + return m_pWndTabs->count(); + return 0; + }; inline State state() const { return m_eState; }; protected: - virtual void showEvent(QShowEvent *e); + virtual void showEvent(QShowEvent * e); virtual void hideEvent(QHideEvent * e); virtual void paintEvent(QPaintEvent * e); virtual void mousePressEvent(QMouseEvent * e); @@ -121,8 +128,8 @@ protected: virtual void mouseMoveEvent(QMouseEvent * e); virtual void leaveEvent(QEvent * e); virtual void enterEvent(QEvent * e); - virtual bool eventFilter(QObject * pEdit,QEvent * e); - virtual void keyPressEvent ( QKeyEvent * e ); + virtual bool eventFilter(QObject * pEdit, QEvent * e); + virtual void keyPressEvent(QKeyEvent * e); public slots: void hideNow(); void toggleLineEdit(); @@ -141,10 +148,11 @@ protected slots: void disableUntilKVIrcRestarted(); void disablePermanently(); void progressUpdate(); + private: - void contextPopup(const QPoint &pos); + void contextPopup(const QPoint & pos); void startBlinking(); -// void computeRect(); + // void computeRect(); void stopShowHideTimer(); void stopBlinkTimer(); void stopAutoHideTimer(); diff --git a/src/modules/notifier/NotifierWindowBorder.cpp b/src/modules/notifier/NotifierWindowBorder.cpp index 19628acbb..5f566b55d 100644 --- a/src/modules/notifier/NotifierWindowBorder.cpp +++ b/src/modules/notifier/NotifierWindowBorder.cpp @@ -98,14 +98,14 @@ void NotifierWindowBorder::loadImages() setPics(); setCloseIcon(WDG_ICON_OUT); - if ( m_pixCaptionDX->height()==m_pixCaptionSX->height() && m_pixCaptionDX->height()==m_pixCaptionBKG->height()) // just to be sure that the height is fitting + if(m_pixCaptionDX->height() == m_pixCaptionSX->height() && m_pixCaptionDX->height() == m_pixCaptionBKG->height()) // just to be sure that the height is fitting m_captionRect.setHeight(m_pixCaptionDX->height()); - } void NotifierWindowBorder::setPics(bool b) { - if (b) { + if(b) + { m_pixSX = &m_pixSX_HL; m_pixDX = &m_pixDX_HL; m_pixDWN = &m_pixDWN_HL; @@ -117,7 +117,9 @@ void NotifierWindowBorder::setPics(bool b) m_pixIconClose_out = &m_pixIconClose_out_HL; m_pixIconClose_over = &m_pixIconClose_over_HL; m_pixIconClose_clicked = &m_pixIconClose_clicked_HL; - } else { + } + else + { m_pixSX = &m_pixSX_N; m_pixDX = &m_pixDX_N; m_pixDWN = &m_pixDWN_N; @@ -148,31 +150,37 @@ void NotifierWindowBorder::recalculatePositions() { m_rct.setHeight(m_iRctHeight); m_rct.setWidth(m_iRctWidth); - m_rct.setTopLeft(QPoint(0,0)); + m_rct.setTopLeft(QPoint(0, 0)); - m_closeIconRect.setX(m_rct.width()-m_pixCaptionDX->width()-m_pixIconClose->width()); + m_closeIconRect.setX(m_rct.width() - m_pixCaptionDX->width() - m_pixIconClose->width()); m_closeIconRect.setY(2); m_closeIconRect.setWidth(m_pixIconClose->width()); m_closeIconRect.setHeight(m_pixIconClose->height()); - m_captionRect.setTopLeft( m_rct.topLeft() ); - m_captionRect.setSize( QSize(m_rct.width(),m_pixCaptionDX->height()) ); - - m_bodyRect.setTopLeft( QPoint(m_pixCaptionDX->width(),m_captionRect.height()) ); - m_bodyRect.setSize( QSize(m_captionRect.width()-(2*m_pixCaptionDX->width()),m_rct.height()-m_captionRect.height()-m_pixDWN->height()) ); + m_captionRect.setTopLeft(m_rct.topLeft()); + m_captionRect.setSize(QSize(m_rct.width(), m_pixCaptionDX->height())); - m_titleRect.setTopLeft( QPoint(m_pixCaptionSX->width(),0) ); - m_titleRect.setSize( QSize(m_rct.width()-m_pixCaptionSX->width()-m_pixCaptionDX->width()-m_pixIconClose->width(),m_captionRect.height())); + m_bodyRect.setTopLeft(QPoint(m_pixCaptionDX->width(), m_captionRect.height())); + m_bodyRect.setSize(QSize(m_captionRect.width() - (2 * m_pixCaptionDX->width()), m_rct.height() - m_captionRect.height() - m_pixDWN->height())); + m_titleRect.setTopLeft(QPoint(m_pixCaptionSX->width(), 0)); + m_titleRect.setSize(QSize(m_rct.width() - m_pixCaptionSX->width() - m_pixCaptionDX->width() - m_pixIconClose->width(), m_captionRect.height())); } void NotifierWindowBorder::setCloseIcon(int state) { m_eIconState = state; - switch (m_eIconState) { - case WDG_ICON_OUT: m_pixIconClose = m_pixIconClose_out; break; - case WDG_ICON_OVER: m_pixIconClose = m_pixIconClose_over; break; - case WDG_ICON_CLICKED: m_pixIconClose = m_pixIconClose_clicked; break; + switch(m_eIconState) + { + case WDG_ICON_OUT: + m_pixIconClose = m_pixIconClose_out; + break; + case WDG_ICON_OVER: + m_pixIconClose = m_pixIconClose_over; + break; + case WDG_ICON_CLICKED: + m_pixIconClose = m_pixIconClose_clicked; + break; }; } diff --git a/src/modules/notifier/NotifierWindowBorder.h b/src/modules/notifier/NotifierWindowBorder.h index f450f3853..df07079d8 100644 --- a/src/modules/notifier/NotifierWindowBorder.h +++ b/src/modules/notifier/NotifierWindowBorder.h @@ -35,21 +35,21 @@ class QPainter; class NotifierWindowBorder { public: - NotifierWindowBorder(QSize = QSize(WDG_MIN_WIDTH,WDG_MIN_HEIGHT)); + NotifierWindowBorder(QSize = QSize(WDG_MIN_WIDTH, WDG_MIN_HEIGHT)); ~NotifierWindowBorder(); -// ================================ -// Put members declaration below... -// ================================ + // ================================ + // Put members declaration below... + // ================================ private: - QRect m_rct; - QPoint m_pnt; + QRect m_rct; + QPoint m_pnt; - QRect m_closeIconRect; + QRect m_closeIconRect; - QRect m_captionRect; - QRect m_bodyRect; - QRect m_titleRect; + QRect m_captionRect; + QRect m_bodyRect; + QRect m_titleRect; // Pictures QPixmap * m_pixSX; @@ -92,6 +92,7 @@ private: int m_eIconState; int m_iRctWidth; int m_iRctHeight; + private: void loadImages(); void recalculatePositions(); @@ -100,12 +101,35 @@ public: // reading methods... void setWidth(int w); void setHeight(int h); - void resize(int w, int h) { setWidth(w); setHeight(h); }; - void resize(QSize r) { setWidth(r.width()); setHeight(r.height()); }; - void setGeometry(QRect r) { r.topLeft(); r.size(); /*qDebug("x,y: %d,%d", r.x(), r.y()); qDebug("w,h: %d,%d", r.width(), r.height());*/ }; - void setGeometry(QPoint p, QSize s) { setPoint (p.x(), p.y()); setWidth (s.width()); setHeight (s.height()); }; - - void setPoint(int x, int y) { m_pnt.setX(x); m_pnt.setY(y); m_rct.setX(x); m_rct.setY(y); }; + void resize(int w, int h) + { + setWidth(w); + setHeight(h); + }; + void resize(QSize r) + { + setWidth(r.width()); + setHeight(r.height()); + }; + void setGeometry(QRect r) + { + r.topLeft(); + r.size(); /*qDebug("x,y: %d,%d", r.x(), r.y()); qDebug("w,h: %d,%d", r.width(), r.height());*/ + }; + void setGeometry(QPoint p, QSize s) + { + setPoint(p.x(), p.y()); + setWidth(s.width()); + setHeight(s.height()); + }; + + void setPoint(int x, int y) + { + m_pnt.setX(x); + m_pnt.setY(y); + m_rct.setX(x); + m_rct.setY(y); + }; void setCloseIcon(int state); void resetIcons(); @@ -115,7 +139,7 @@ public: inline int y() const { return m_pnt.y(); }; inline int width() const { return m_rct.width(); }; inline int height() const { return m_rct.height(); }; - inline int baseLine() const { return (y()+height()); }; + inline int baseLine() const { return (y() + height()); }; inline QRect bodyRect() const { return m_bodyRect; }; inline QRect captionRect() const { return m_captionRect; }; diff --git a/src/modules/notifier/NotifierWindowTab.cpp b/src/modules/notifier/NotifierWindowTab.cpp index 61c8e9707..d02fd095d 100644 --- a/src/modules/notifier/NotifierWindowTab.cpp +++ b/src/modules/notifier/NotifierWindowTab.cpp @@ -44,22 +44,24 @@ #include #ifdef COMPILE_PSEUDO_TRANSPARENCY - #include - extern KVIRC_API QPixmap * g_pShadedChildGlobalDesktopBackground; +#include +extern KVIRC_API QPixmap * g_pShadedChildGlobalDesktopBackground; #endif extern NotifierWindow * g_pNotifierWindow; NotifierWindowTab::NotifierWindowTab(KviWindow * pWnd, QTabWidget * pParent) -: QScrollArea(pParent) + : QScrollArea(pParent) { m_pWnd = pWnd; if(m_pWnd) { m_szLabel = m_pWnd->windowName(); - connect(pWnd,SIGNAL(windowNameChanged()),this,SLOT(labelChanged())); - connect(pWnd,SIGNAL(destroyed()),this,SLOT(closeMe())); - } else { + connect(pWnd, SIGNAL(windowNameChanged()), this, SLOT(labelChanged())); + connect(pWnd, SIGNAL(destroyed()), this, SLOT(closeMe())); + } + else + { m_szLabel = "----"; } @@ -74,7 +76,7 @@ NotifierWindowTab::NotifierWindowTab(KviWindow * pWnd, QTabWidget * pParent) setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded); if(verticalScrollBar()) - connect(verticalScrollBar(),SIGNAL(rangeChanged(int, int)),this, SLOT(scrollRangeChanged(int, int))); + connect(verticalScrollBar(), SIGNAL(rangeChanged(int, int)), this, SLOT(scrollRangeChanged(int, int))); QPalette pal = palette(); pal.setColor(backgroundRole(), Qt::transparent); @@ -105,7 +107,7 @@ void NotifierWindowTab::appendMessage(NotifierMessage * pMessage) while(m_pVBox->count() > MAX_MESSAGES_IN_WINDOW) { QLayoutItem * pTmp = m_pVBox->takeAt(0); - NotifierMessage * pTmp2 = (NotifierMessage*)pTmp->widget(); + NotifierMessage * pTmp2 = (NotifierMessage *)pTmp->widget(); if(pTmp2) pTmp2->deleteLater(); } @@ -113,10 +115,10 @@ void NotifierWindowTab::appendMessage(NotifierMessage * pMessage) void NotifierWindowTab::updateGui() { - for(int i=0; icount(); ++i) + for(int i = 0; i < m_pVBox->count(); ++i) { QLayoutItem * pTmp = m_pVBox->itemAt(i); - NotifierMessage * pTmp2 = (NotifierMessage*)pTmp->widget(); + NotifierMessage * pTmp2 = (NotifierMessage *)pTmp->widget(); if(pTmp2) pTmp2->updateGui(); } @@ -180,7 +182,7 @@ void NotifierWindowTab::resizeEvent(QResizeEvent *) { int iWidth = viewport()->width(); NotifierMessage * pMessage; - for(int i=0; i < m_pVBox->count(); i++) + for(int i = 0; i < m_pVBox->count(); i++) { pMessage = (NotifierMessage *)m_pVBox->itemAt(i)->widget(); if(pMessage) @@ -193,34 +195,38 @@ void NotifierWindowTab::paintEvent(QPaintEvent * e) { QPainter * pPainter = new QPainter(viewport()); - //make sure you clean your widget with a transparent - // color before doing any rendering - // note the usage of a composition mode Source - // it's important! +//make sure you clean your widget with a transparent +// color before doing any rendering +// note the usage of a composition mode Source +// it's important! - #ifdef COMPILE_PSEUDO_TRANSPARENCY - if(KVI_OPTION_BOOL(KviOption_boolUseCompositingForTransparency) && g_pApp->supportsCompositing()) - { - pPainter->save(); - pPainter->setCompositionMode(QPainter::CompositionMode_Source); - QColor col = KVI_OPTION_COLOR(KviOption_colorGlobalTransparencyFade); - col.setAlphaF((float)((float)KVI_OPTION_UINT(KviOption_uintGlobalTransparencyChildFadeFactor) / (float)100)); - pPainter->fillRect(e->rect(), col); - pPainter->restore(); - } else if(g_pShadedChildGlobalDesktopBackground) // This doesn't work as the text doesn't actually use the right foreground color - { - QPoint pnt = mapToGlobal(e->rect().topLeft()); - pPainter->drawTiledPixmap(e->rect(),*(g_pShadedChildGlobalDesktopBackground), pnt); - } else { - #endif - QPixmap * pPix = KVI_OPTION_PIXMAP(KviOption_pixmapNotifierBackground).pixmap(); - - if(pPix) - KviPixmapUtils::drawPixmapWithPainter(pPainter,pPix,KVI_OPTION_UINT(KviOption_uintNotifierPixmapAlign),e->rect(),e->rect().width(),e->rect().height()); - else pPainter->fillRect(e->rect(),KVI_OPTION_COLOR(KviOption_colorNotifierBackground)); - #ifdef COMPILE_PSEUDO_TRANSPARENCY - } - #endif +#ifdef COMPILE_PSEUDO_TRANSPARENCY + if(KVI_OPTION_BOOL(KviOption_boolUseCompositingForTransparency) && g_pApp->supportsCompositing()) + { + pPainter->save(); + pPainter->setCompositionMode(QPainter::CompositionMode_Source); + QColor col = KVI_OPTION_COLOR(KviOption_colorGlobalTransparencyFade); + col.setAlphaF((float)((float)KVI_OPTION_UINT(KviOption_uintGlobalTransparencyChildFadeFactor) / (float)100)); + pPainter->fillRect(e->rect(), col); + pPainter->restore(); + } + else if(g_pShadedChildGlobalDesktopBackground) // This doesn't work as the text doesn't actually use the right foreground color + { + QPoint pnt = mapToGlobal(e->rect().topLeft()); + pPainter->drawTiledPixmap(e->rect(), *(g_pShadedChildGlobalDesktopBackground), pnt); + } + else + { +#endif + QPixmap * pPix = KVI_OPTION_PIXMAP(KviOption_pixmapNotifierBackground).pixmap(); + + if(pPix) + KviPixmapUtils::drawPixmapWithPainter(pPainter, pPix, KVI_OPTION_UINT(KviOption_uintNotifierPixmapAlign), e->rect(), e->rect().width(), e->rect().height()); + else + pPainter->fillRect(e->rect(), KVI_OPTION_COLOR(KviOption_colorNotifierBackground)); +#ifdef COMPILE_PSEUDO_TRANSPARENCY + } +#endif delete pPainter; e->ignore(); diff --git a/src/modules/notifier/NotifierWindowTab.h b/src/modules/notifier/NotifierWindowTab.h index 7f36a1307..784936aa6 100644 --- a/src/modules/notifier/NotifierWindowTab.h +++ b/src/modules/notifier/NotifierWindowTab.h @@ -62,12 +62,14 @@ public: * \brief Destroys the tab object */ ~NotifierWindowTab(); + private: - QString m_szLabel; - KviWindow * m_pWnd; - QTabWidget * m_pParent; + QString m_szLabel; + KviWindow * m_pWnd; + QTabWidget * m_pParent; QVBoxLayout * m_pVBox; - QWidget * m_pVWidget; + QWidget * m_pVWidget; + public: /** * \brief Appends the given message to the window diff --git a/src/modules/notifier/libkvinotifier.cpp b/src/modules/notifier/libkvinotifier.cpp index 49236b55a..4fb6d0199 100644 --- a/src/modules/notifier/libkvinotifier.cpp +++ b/src/modules/notifier/libkvinotifier.cpp @@ -116,49 +116,51 @@ static bool notifier_kvs_cmd_message(KviKvsModuleCommandCall * c) { QString szMessage; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("message",KVS_PT_STRING,0,szMessage) + KVSM_PARAMETER("message", KVS_PT_STRING, 0, szMessage) KVSM_PARAMETERS_END(c) if(!g_pNotifierWindow) g_pNotifierWindow = new NotifierWindow(); - QString szIco=""; - QString szWnd=""; + QString szIco = ""; + QString szWnd = ""; KviWindow * pWnd = c->window(); - if(c->hasSwitch('w',"window_id")) + if(c->hasSwitch('w', "window_id")) { - c->switches()->getAsStringIfExisting('w',"window_id",szWnd); + c->switches()->getAsStringIfExisting('w', "window_id", szWnd); if(!szWnd.isEmpty()) { - pWnd=g_pApp->findWindow(szWnd); + pWnd = g_pApp->findWindow(szWnd); if(!pWnd) - c->warning(__tr2qs_ctx("The specified window does not exist","notifier")); + c->warning(__tr2qs_ctx("The specified window does not exist", "notifier")); } } - c->switches()->getAsStringIfExisting('i',"icon",szIco); + c->switches()->getAsStringIfExisting('i', "icon", szIco); kvs_int_t uTime = KVI_OPTION_UINT(KviOption_uintNotifierAutoHideTime); - if(c->hasSwitch('t',"timeout")) + if(c->hasSwitch('t', "timeout")) { - KviKvsVariant * pTime = c->getSwitch('t',"timeout"); + KviKvsVariant * pTime = c->getSwitch('t', "timeout"); if(pTime) { bool bOk = pTime->asInteger(uTime); if(!bOk) { uTime = 0; - c->warning(__tr2qs_ctx("The specified timeout is not valid, assuming 0","notifier")); + c->warning(__tr2qs_ctx("The specified timeout is not valid, assuming 0", "notifier")); } - } else { - c->warning(__tr2qs_ctx("The -t switch expects a timeout in seconds","notifier")); + } + else + { + c->warning(__tr2qs_ctx("The -t switch expects a timeout in seconds", "notifier")); } } - g_pNotifierWindow->addMessage(pWnd,szIco,szMessage,uTime); + g_pNotifierWindow->addMessage(pWnd, szIco, szMessage, uTime); - if(!c->hasSwitch('q',"quiet")) - g_pNotifierWindow->doShow(!(c->hasSwitch('n',"new"))); + if(!c->hasSwitch('q', "quiet")) + g_pNotifierWindow->doShow(!(c->hasSwitch('n', "new"))); return true; } @@ -186,7 +188,7 @@ static bool notifier_kvs_cmd_message(KviKvsModuleCommandCall * c) static bool notifier_kvs_cmd_hide(KviKvsModuleCommandCall * c) { if(g_pNotifierWindow) - g_pNotifierWindow->doHide(!(c->hasSwitch('n',"notanimated"))); + g_pNotifierWindow->doHide(!(c->hasSwitch('n', "notanimated"))); return true; } @@ -222,7 +224,7 @@ static bool notifier_kvs_cmd_show(KviKvsModuleCommandCall * c) return true; g_pNotifierWindow->setDisableHideOnMainWindowGotAttention(true); - g_pNotifierWindow->doShow(!(c->hasSwitch('n',"noanim"))); + g_pNotifierWindow->doShow(!(c->hasSwitch('n', "noanim"))); return true; } @@ -264,10 +266,10 @@ static bool notifier_kvs_fnc_isEnabled(KviKvsModuleFunctionCall * c) static bool notifier_module_init(KviModule * m) { - KVSM_REGISTER_SIMPLE_COMMAND(m,"message",notifier_kvs_cmd_message); - KVSM_REGISTER_SIMPLE_COMMAND(m,"show",notifier_kvs_cmd_show); - KVSM_REGISTER_SIMPLE_COMMAND(m,"hide",notifier_kvs_cmd_hide); - KVSM_REGISTER_FUNCTION(m,"isEnabled",notifier_kvs_fnc_isEnabled); + KVSM_REGISTER_SIMPLE_COMMAND(m, "message", notifier_kvs_cmd_message); + KVSM_REGISTER_SIMPLE_COMMAND(m, "show", notifier_kvs_cmd_show); + KVSM_REGISTER_SIMPLE_COMMAND(m, "hide", notifier_kvs_cmd_hide); + KVSM_REGISTER_FUNCTION(m, "isEnabled", notifier_kvs_fnc_isEnabled); return true; } @@ -289,7 +291,7 @@ static bool notifier_module_can_unload(KviModule *) static bool notifier_module_ctrl(KviModule *, const char * pcOperation, void * pParam) { - if(!kvi_strEqualCI("notifier::message",pcOperation)) + if(!kvi_strEqualCI("notifier::message", pcOperation)) return false; KviNotifierMessageParam * p = (KviNotifierMessageParam *)pParam; @@ -299,21 +301,20 @@ static bool notifier_module_ctrl(KviModule *, const char * pcOperation, void * p if(!g_pNotifierWindow) g_pNotifierWindow = new NotifierWindow(); - g_pNotifierWindow->addMessage(p->pWindow,p->szIcon,p->szMessage,p->uMessageLifetime); + g_pNotifierWindow->addMessage(p->pWindow, p->szIcon, p->szMessage, p->uMessageLifetime); g_pNotifierWindow->doShow(KVI_OPTION_BOOL(KviOption_boolNotifierFading) ? true : false); return true; } KVIRC_MODULE( - "Notifier", - "4.0.0", - "Copyright (C) 2005 Iacopo Palazzi (iakko at siena dot linux dot it)\n" \ - " 2010 Elvio Basello (hell at hellvis69 dot netsons dot org)", - "KVIrc Client - Taskbar Notifier", - notifier_module_init, - notifier_module_can_unload, - notifier_module_ctrl, - notifier_module_cleanup, - "notifier" -) + "Notifier", + "4.0.0", + "Copyright (C) 2005 Iacopo Palazzi (iakko at siena dot linux dot it)\n" + " 2010 Elvio Basello (hell at hellvis69 dot netsons dot org)", + "KVIrc Client - Taskbar Notifier", + notifier_module_init, + notifier_module_can_unload, + notifier_module_ctrl, + notifier_module_cleanup, + "notifier") diff --git a/src/modules/objects/KvsObject_button.cpp b/src/modules/objects/KvsObject_button.cpp index 1b70ea902..b3bdfe825 100644 --- a/src/modules/objects/KvsObject_button.cpp +++ b/src/modules/objects/KvsObject_button.cpp @@ -69,93 +69,94 @@ This property holds whether the label will scale its contents to fill all available space. */ -KVSO_BEGIN_REGISTERCLASS(KvsObject_button,"button","widget") +KVSO_BEGIN_REGISTERCLASS(KvsObject_button, "button", "widget") - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_button,setText) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_button,text) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_button,clickEvent) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_button,setImage) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_button, setText) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_button, text) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_button, clickEvent) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_button, setImage) KVSO_END_REGISTERCLASS(KvsObject_button) -KVSO_BEGIN_CONSTRUCTOR(KvsObject_button,KvsObject_widget) +KVSO_BEGIN_CONSTRUCTOR(KvsObject_button, KvsObject_widget) KVSO_END_CONSTRUCTOR(KvsObject_button) - KVSO_BEGIN_DESTRUCTOR(KvsObject_button) KVSO_END_DESTRUCTOR(KvsObject_button) -bool KvsObject_button::init(KviKvsRunTimeContext *,KviKvsVariantList *) +bool KvsObject_button::init(KviKvsRunTimeContext *, KviKvsVariantList *) { SET_OBJECT(QPushButton); - connect(widget(),SIGNAL(clicked()),this,SLOT(slotClicked())); + connect(widget(), SIGNAL(clicked()), this, SLOT(slotClicked())); return true; } -KVSO_CLASS_FUNCTION(button,text) +KVSO_CLASS_FUNCTION(button, text) { CHECK_INTERNAL_POINTER(widget()) c->returnValue()->setString(((QPushButton *)widget())->text()); return true; } -KVSO_CLASS_FUNCTION(button,setText) +KVSO_CLASS_FUNCTION(button, setText) { CHECK_INTERNAL_POINTER(widget()) QString szText; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("text",KVS_PT_STRING,0,szText) + KVSO_PARAMETER("text", KVS_PT_STRING, 0, szText) KVSO_PARAMETERS_END(c) ((QPushButton *)widget())->setText(szText); return true; } -KVSO_CLASS_FUNCTION(button,setImage) +KVSO_CLASS_FUNCTION(button, setImage) { CHECK_INTERNAL_POINTER(widget()) KviKvsVariant * pIcon; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("icon_or_hobject",KVS_PT_VARIANT,0,pIcon) + KVSO_PARAMETER("icon_or_hobject", KVS_PT_VARIANT, 0, pIcon) KVSO_PARAMETERS_END(c) if(!pIcon) { - c->warning(__tr2qs_ctx("Image parameter missing","object")); + c->warning(__tr2qs_ctx("Image parameter missing", "object")); return true; } if(pIcon->isHObject()) { kvs_hobject_t hObj; pIcon->asHObject(hObj); - KviKvsObject *pObject = KviKvsKernel::instance()->objectController()->lookupObject(hObj); - if (!pObject) + KviKvsObject * pObject = KviKvsKernel::instance()->objectController()->lookupObject(hObj); + if(!pObject) { - c->warning(__tr2qs_ctx("Pixmap parameter is not an object!","objects")); + c->warning(__tr2qs_ctx("Pixmap parameter is not an object!", "objects")); return true; } if(pObject->inheritsClass("pixmap")) ((QPushButton *)widget())->setIcon(QIcon(*((KvsObject_pixmap *)pObject)->getPixmap())); else - c->warning(__tr2qs_ctx("Object pixmap required!","object")); + c->warning(__tr2qs_ctx("Object pixmap required!", "object")); return true; } QString szIcon; pIcon->asString(szIcon); QPixmap * pix = g_pIconManager->getImage(szIcon); - if(pix) ((QPushButton *)widget())->setIcon(*pix); - else((QPushButton *)widget())->setIcon(QIcon()); + if(pix) + ((QPushButton *)widget())->setIcon(*pix); + else + ((QPushButton *)widget())->setIcon(QIcon()); return true; } -KVSO_CLASS_FUNCTION(button,clickEvent) +KVSO_CLASS_FUNCTION(button, clickEvent) { - emitSignal("clicked",c); + emitSignal("clicked", c); return true; } // slots void KvsObject_button::slotClicked() { - KviKvsVariantList *params=0; - callFunction(this,"clickEvent",params); + KviKvsVariantList * params = 0; + callFunction(this, "clickEvent", params); } diff --git a/src/modules/objects/KvsObject_button.h b/src/modules/objects/KvsObject_button.h index e61385fc0..45e1e3408 100644 --- a/src/modules/objects/KvsObject_button.h +++ b/src/modules/objects/KvsObject_button.h @@ -25,8 +25,6 @@ // //============================================================================= - - #include "KvsObject_widget.h" #include "object_macros.h" @@ -38,16 +36,16 @@ public: public: QWidget * widget() { return (QWidget *)object(); }; protected: - virtual bool init(KviKvsRunTimeContext * pContext,KviKvsVariantList *pParams); + virtual bool init(KviKvsRunTimeContext * pContext, KviKvsVariantList * pParams); - bool setText(KviKvsObjectFunctionCall *c); - bool text(KviKvsObjectFunctionCall *c); + bool setText(KviKvsObjectFunctionCall * c); + bool text(KviKvsObjectFunctionCall * c); - bool setImage(KviKvsObjectFunctionCall *c); - bool clickEvent(KviKvsObjectFunctionCall *c); + bool setImage(KviKvsObjectFunctionCall * c); + bool clickEvent(KviKvsObjectFunctionCall * c); protected slots: void slotClicked(); }; -#endif // !_CLASS_BUTTON_H_ +#endif // !_CLASS_BUTTON_H_ diff --git a/src/modules/objects/KvsObject_buttonGroup.cpp b/src/modules/objects/KvsObject_buttonGroup.cpp index a7ec6a034..94863fc0b 100644 --- a/src/modules/objects/KvsObject_buttonGroup.cpp +++ b/src/modules/objects/KvsObject_buttonGroup.cpp @@ -23,7 +23,6 @@ // //============================================================================= - #include "KvsObject_buttonGroup.h" #include "KviError.h" #include "kvi_debug.h" @@ -54,53 +53,53 @@ Returns the button group's checked button, or [b]0[/b] if no buttons are checked. */ -KVSO_BEGIN_REGISTERCLASS(KvsObject_buttonGroup,"buttongroup","object") - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_buttonGroup,addButton) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_buttonGroup,checkedButton) +KVSO_BEGIN_REGISTERCLASS(KvsObject_buttonGroup, "buttongroup", "object") +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_buttonGroup, addButton) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_buttonGroup, checkedButton) KVSO_END_REGISTERCLASS(KvsObject_buttonGroup) -KVSO_BEGIN_CONSTRUCTOR(KvsObject_buttonGroup,KviKvsObject) - m_iId=0; - btnDict.setAutoDelete(false); - m_pButtonGroup=new QButtonGroup(); +KVSO_BEGIN_CONSTRUCTOR(KvsObject_buttonGroup, KviKvsObject) +m_iId = 0; +btnDict.setAutoDelete(false); +m_pButtonGroup = new QButtonGroup(); KVSO_END_CONSTRUCTOR(KvsObject_buttonGroup) - KVSO_BEGIN_DESTRUCTOR(KvsObject_buttonGroup) - btnDict.clear(); - delete m_pButtonGroup; +btnDict.clear(); +delete m_pButtonGroup; KVSO_END_CONSTRUCTOR(KvsObject_buttonGroup) - -KVSO_CLASS_FUNCTION(buttonGroup,addButton) +KVSO_CLASS_FUNCTION(buttonGroup, addButton) { CHECK_INTERNAL_POINTER(m_pButtonGroup) KviKvsObject * pObject; kvs_hobject_t hObject; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("button",KVS_PT_HOBJECT,0,hObject) + KVSO_PARAMETER("button", KVS_PT_HOBJECT, 0, hObject) KVSO_PARAMETERS_END(c) - pObject=KviKvsKernel::instance()->objectController()->lookupObject(hObject); + pObject = KviKvsKernel::instance()->objectController()->lookupObject(hObject); CHECK_HOBJECT_IS_WIDGET(pObject) if(pObject->inheritsClass("radiobutton") || pObject->inheritsClass("checkbox")) { - m_pButtonGroup->addButton(((QRadioButton *)(pObject->object())),m_iId); + m_pButtonGroup->addButton(((QRadioButton *)(pObject->object())), m_iId); c->returnValue()->setInteger(m_iId); - btnDict.insert(m_iId,pObject); + btnDict.insert(m_iId, pObject); m_iId++; } else { - c->warning(__tr2qs_ctx("Buttongroup supports only checkbox and radiobox object","objects")); + c->warning(__tr2qs_ctx("Buttongroup supports only checkbox and radiobox object", "objects")); return true; } return true; } -KVSO_CLASS_FUNCTION(buttonGroup,checkedButton) +KVSO_CLASS_FUNCTION(buttonGroup, checkedButton) { CHECK_INTERNAL_POINTER(m_pButtonGroup) - int id=m_pButtonGroup->checkedId(); - if (id!=-1) c->returnValue()->setHObject(btnDict.find(id)->handle()); - else c->returnValue()->setNothing(); + int id = m_pButtonGroup->checkedId(); + if(id != -1) + c->returnValue()->setHObject(btnDict.find(id)->handle()); + else + c->returnValue()->setNothing(); return true; } diff --git a/src/modules/objects/KvsObject_buttonGroup.h b/src/modules/objects/KvsObject_buttonGroup.h index 286c26440..7610695b3 100644 --- a/src/modules/objects/KvsObject_buttonGroup.h +++ b/src/modules/objects/KvsObject_buttonGroup.h @@ -1,5 +1,5 @@ -#ifndef _CLASS_BUTTONGROUP_H_ -#define _CLASS_BUTTONGROUP_H_ +#ifndef _CLASS_BUTTONGROUP_H_ +#define _CLASS_BUTTONGROUP_H_ //============================================================================= // // File : KvsObject_buttonGroup.cpp @@ -25,8 +25,6 @@ // //============================================================================= - - #include #include "object_macros.h" @@ -35,11 +33,10 @@ class KvsObject_buttonGroup : public KviKvsObject public: KVSO_DECLARE_OBJECT(KvsObject_buttonGroup) protected: - QButtonGroup *m_pButtonGroup; + QButtonGroup * m_pButtonGroup; int m_iId; - KviPointerHashTable btnDict; - bool addButton(KviKvsObjectFunctionCall *c); - bool checkedButton(KviKvsObjectFunctionCall *c); - + KviPointerHashTable btnDict; + bool addButton(KviKvsObjectFunctionCall * c); + bool checkedButton(KviKvsObjectFunctionCall * c); }; -#endif //!_CLASS_GROUPBOX_H_ +#endif //!_CLASS_GROUPBOX_H_ diff --git a/src/modules/objects/KvsObject_checkBox.cpp b/src/modules/objects/KvsObject_checkBox.cpp index 25c605b1f..8f7aafb87 100644 --- a/src/modules/objects/KvsObject_checkBox.cpp +++ b/src/modules/objects/KvsObject_checkBox.cpp @@ -23,13 +23,11 @@ // //============================================================================= - #include "KviError.h" #include "kvi_debug.h" #include "KviLocale.h" #include "KvsObject_checkBox.h" - #include /* @@ -63,63 +61,62 @@ //--------------------------------------------------------------------------------- -KVSO_BEGIN_REGISTERCLASS(KvsObject_checkBox,"checkbox","button") - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_checkBox,setChecked) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_checkBox,isChecked) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_checkBox,toggleEvent) +KVSO_BEGIN_REGISTERCLASS(KvsObject_checkBox, "checkbox", "button") +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_checkBox, setChecked) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_checkBox, isChecked) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_checkBox, toggleEvent) KVSO_END_REGISTERCLASS(KvsObject_checkBox) -KVSO_BEGIN_CONSTRUCTOR(KvsObject_checkBox,KvsObject_button) +KVSO_BEGIN_CONSTRUCTOR(KvsObject_checkBox, KvsObject_button) KVSO_END_CONSTRUCTOR(KvsObject_checkBox) - KVSO_BEGIN_DESTRUCTOR(KvsObject_checkBox) KVSO_END_CONSTRUCTOR(KvsObject_checkBox) -bool KvsObject_checkBox::init(KviKvsRunTimeContext *,KviKvsVariantList *) +bool KvsObject_checkBox::init(KviKvsRunTimeContext *, KviKvsVariantList *) { - QCheckBox * cb = new QCheckBox(parentScriptWidget()); + QCheckBox * cb = new QCheckBox(parentScriptWidget()); cb->setObjectName(getName().toUtf8().data()); setObject(cb, true); - connect(cb,SIGNAL(toggled(bool)),this,SLOT(toggled(bool))); - connect(widget(),SIGNAL(clicked()),this,SLOT(slotClicked())); + connect(cb, SIGNAL(toggled(bool)), this, SLOT(toggled(bool))); + connect(widget(), SIGNAL(clicked()), this, SLOT(slotClicked())); return true; } -KVSO_CLASS_FUNCTION(checkBox,isChecked) +KVSO_CLASS_FUNCTION(checkBox, isChecked) { CHECK_INTERNAL_POINTER(widget()) c->returnValue()->setBoolean(((QCheckBox *)widget())->isChecked()); return true; } -KVSO_CLASS_FUNCTION(checkBox,setChecked) +KVSO_CLASS_FUNCTION(checkBox, setChecked) { CHECK_INTERNAL_POINTER(widget()) bool bChecked; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("bChecked",KVS_PT_BOOL,KVS_PF_OPTIONAL,bChecked) + KVSO_PARAMETER("bChecked", KVS_PT_BOOL, KVS_PF_OPTIONAL, bChecked) KVSO_PARAMETERS_END(c) ((QCheckBox *)widget())->setChecked(bChecked); return true; } -KVSO_CLASS_FUNCTION(checkBox,setText) +KVSO_CLASS_FUNCTION(checkBox, setText) { CHECK_INTERNAL_POINTER(widget()) QString szText; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("",KVS_PT_STRING,0,szText) + KVSO_PARAMETER("", KVS_PT_STRING, 0, szText) KVSO_PARAMETERS_END(c) ((QCheckBox *)widget())->setText(szText); return true; } -KVSO_CLASS_FUNCTION(checkBox,toggleEvent) +KVSO_CLASS_FUNCTION(checkBox, toggleEvent) { - emitSignal("toggled",c,c->params()); + emitSignal("toggled", c, c->params()); return true; } @@ -127,5 +124,5 @@ KVSO_CLASS_FUNCTION(checkBox,toggleEvent) void KvsObject_checkBox::toggled(bool b) { KviKvsVariantList params(new KviKvsVariant(b)); - callFunction(this,"toggleEvent",¶ms); + callFunction(this, "toggleEvent", ¶ms); } diff --git a/src/modules/objects/KvsObject_checkBox.h b/src/modules/objects/KvsObject_checkBox.h index e44bf00b9..3b11581d5 100644 --- a/src/modules/objects/KvsObject_checkBox.h +++ b/src/modules/objects/KvsObject_checkBox.h @@ -1,5 +1,5 @@ -#ifndef _CLASS_CHECKBOX_H_ -#define _CLASS_CHECKBOX_H_ +#ifndef _CLASS_CHECKBOX_H_ +#define _CLASS_CHECKBOX_H_ //============================================================================= // @@ -26,8 +26,6 @@ // //============================================================================= - - #include "KvsObject_button.h" #include "object_macros.h" @@ -39,12 +37,12 @@ public: public: QWidget * widget() { return (QWidget *)object(); }; protected: - virtual bool init(KviKvsRunTimeContext * pContext,KviKvsVariantList *pParams); - bool setChecked(KviKvsObjectFunctionCall *c); - bool isChecked(KviKvsObjectFunctionCall *c); - bool toggleEvent(KviKvsObjectFunctionCall *c); - bool setText(KviKvsObjectFunctionCall *c); + virtual bool init(KviKvsRunTimeContext * pContext, KviKvsVariantList * pParams); + bool setChecked(KviKvsObjectFunctionCall * c); + bool isChecked(KviKvsObjectFunctionCall * c); + bool toggleEvent(KviKvsObjectFunctionCall * c); + bool setText(KviKvsObjectFunctionCall * c); protected slots: void toggled(bool b); }; -#endif // !_CLASS_CHECKBOX_H_ +#endif // !_CLASS_CHECKBOX_H_ diff --git a/src/modules/objects/KvsObject_colorDialog.cpp b/src/modules/objects/KvsObject_colorDialog.cpp index 97b4bb1ea..a13f29c20 100644 --- a/src/modules/objects/KvsObject_colorDialog.cpp +++ b/src/modules/objects/KvsObject_colorDialog.cpp @@ -23,13 +23,11 @@ // //============================================================================= - #include "KviError.h" #include "kvi_debug.h" #include "KviLocale.h" #include "KvsObject_colorDialog.h" - #include const char * const option_tbl[] = { @@ -44,7 +42,7 @@ const int option_cod[] = { QColorDialog::DontUseNativeDialog }; -#define option_num (sizeof(option_tbl) / sizeof(option_tbl[0])) +#define option_num (sizeof(option_tbl) / sizeof(option_tbl[0])) /* @doc: colordialog @@ -77,55 +75,55 @@ const int option_cod[] = { //--------------------------------------------------------------------------------- -KVSO_BEGIN_REGISTERCLASS(KvsObject_colorDialog,"colorDialog","dialog") - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_colorDialog,setCurrentColor) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_colorDialog,setOptions) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_colorDialog,colorSelectedEvent) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_colorDialog,currentColorChangedEvent) +KVSO_BEGIN_REGISTERCLASS(KvsObject_colorDialog, "colorDialog", "dialog") +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_colorDialog, setCurrentColor) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_colorDialog, setOptions) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_colorDialog, colorSelectedEvent) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_colorDialog, currentColorChangedEvent) KVSO_END_REGISTERCLASS(KvsObject_colorDialog) -KVSO_BEGIN_CONSTRUCTOR(KvsObject_colorDialog,KvsObject_dialog) +KVSO_BEGIN_CONSTRUCTOR(KvsObject_colorDialog, KvsObject_dialog) KVSO_END_CONSTRUCTOR(KvsObject_colorDialog) - KVSO_BEGIN_DESTRUCTOR(KvsObject_colorDialog) KVSO_END_CONSTRUCTOR(KvsObject_colorDialog) -bool KvsObject_colorDialog::init(KviKvsRunTimeContext *,KviKvsVariantList *) +bool KvsObject_colorDialog::init(KviKvsRunTimeContext *, KviKvsVariantList *) { - QColorDialog * d = new QColorDialog(parentScriptWidget()); + QColorDialog * d = new QColorDialog(parentScriptWidget()); d->setObjectName(getName().toUtf8().data()); setObject(d, true); - connect(d,SIGNAL(colorSelected(const QColor &)),this,SLOT(slotColorSelected(const QColor &))); - connect(d,SIGNAL(currentColorChanged(const QColor &)),this,SLOT(slotCurrentColorChanged(const QColor &))); + connect(d, SIGNAL(colorSelected(const QColor &)), this, SLOT(slotColorSelected(const QColor &))); + connect(d, SIGNAL(currentColorChanged(const QColor &)), this, SLOT(slotCurrentColorChanged(const QColor &))); return true; } -KVSO_CLASS_FUNCTION(colorDialog,setCurrentColor) +KVSO_CLASS_FUNCTION(colorDialog, setCurrentColor) { CHECK_INTERNAL_POINTER(widget()) - kvs_int_t iCol1,iCol2,iCol3,iOpacity; - QString szColorMode,szColor; - KviKvsVariant *var1,*var2,*var3; + kvs_int_t iCol1, iCol2, iCol3, iOpacity; + QString szColorMode, szColor; + KviKvsVariant *var1, *var2, *var3; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("Color_1_Or_Colorname",KVS_PT_VARIANT,0,var1) - KVSO_PARAMETER("Color_2",KVS_PT_VARIANT,KVS_PF_OPTIONAL,var2) - KVSO_PARAMETER("Colo3_3",KVS_PT_VARIANT,KVS_PF_OPTIONAL,var3) - KVSO_PARAMETER("opacity",KVS_PT_INT,KVS_PF_OPTIONAL,iOpacity) - KVSO_PARAMETER("color_mode",KVS_PT_STRING,KVS_PF_OPTIONAL,szColorMode) + KVSO_PARAMETER("Color_1_Or_Colorname", KVS_PT_VARIANT, 0, var1) + KVSO_PARAMETER("Color_2", KVS_PT_VARIANT, KVS_PF_OPTIONAL, var2) + KVSO_PARAMETER("Colo3_3", KVS_PT_VARIANT, KVS_PF_OPTIONAL, var3) + KVSO_PARAMETER("opacity", KVS_PT_INT, KVS_PF_OPTIONAL, iOpacity) + KVSO_PARAMETER("color_mode", KVS_PT_STRING, KVS_PF_OPTIONAL, szColorMode) KVSO_PARAMETERS_END(c) QColor col; - if (!var1->asInteger(iCol1)) + if(!var1->asInteger(iCol1)) { var1->asString(szColor); - if (c->paramCount()<2) iOpacity=255; + if(c->paramCount() < 2) + iOpacity = 255; else { - if (!var2->asInteger(iOpacity)) + if(!var2->asInteger(iOpacity)) { - c->warning(__tr2qs_ctx("The opacity parameter didn't evaluate to integer","objects")); + c->warning(__tr2qs_ctx("The opacity parameter didn't evaluate to integer", "objects")); return true; } } @@ -134,26 +132,26 @@ KVSO_CLASS_FUNCTION(colorDialog,setCurrentColor) } else { - if(c->paramCount()<3) + if(c->paramCount() < 3) { - c->error(__tr2qs_ctx("Color name or triplet RGB/HSV value required","objects")); + c->error(__tr2qs_ctx("Color name or triplet RGB/HSV value required", "objects")); return true; } - if (!var2->asInteger(iCol2)||!var3->asInteger(iCol3)) + if(!var2->asInteger(iCol2) || !var3->asInteger(iCol3)) { - c->error(__tr2qs_ctx("One of the triplet parameters didn't evaluate to an integer","objects"));\ - return true; + c->error(__tr2qs_ctx("One of the triplet parameters didn't evaluate to an integer", "objects")); + return true; } - if (c->paramCount()<4) - iOpacity=255; + if(c->paramCount() < 4) + iOpacity = 255; else { - if (c->paramCount()>4) + if(c->paramCount() > 4) { if(KviQString::equalCI(szColorMode, "HSV")) - col.setHsv(iCol1,iCol2,iCol3,iOpacity); + col.setHsv(iCol1, iCol2, iCol3, iOpacity); else - col.setRgb(iCol1,iCol2,iCol3,iOpacity); + col.setRgb(iCol1, iCol2, iCol3, iOpacity); } } col.setAlpha(iOpacity); @@ -162,70 +160,67 @@ KVSO_CLASS_FUNCTION(colorDialog,setCurrentColor) return true; } -KVSO_CLASS_FUNCTION(colorDialog,setOptions) +KVSO_CLASS_FUNCTION(colorDialog, setOptions) { CHECK_INTERNAL_POINTER(widget()) QStringList szOptions; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("szOptions",KVS_PT_STRINGLIST,KVS_PF_OPTIONAL,szOptions) + KVSO_PARAMETER("szOptions", KVS_PT_STRINGLIST, KVS_PF_OPTIONAL, szOptions) KVSO_PARAMETERS_END(c) - if (!widget()) return true; - int colorDialogOption,sum = 0; - for ( QStringList::Iterator it = szOptions.begin(); it != szOptions.end(); ++it ) + if(!widget()) + return true; + int colorDialogOption, sum = 0; + for(QStringList::Iterator it = szOptions.begin(); it != szOptions.end(); ++it) { colorDialogOption = 0; for(unsigned int j = 0; j < option_num; j++) { if(KviQString::equalCI((*it), option_tbl[j])) { - colorDialogOption=option_cod[j]; + colorDialogOption = option_cod[j]; break; } } if(colorDialogOption) sum = sum | colorDialogOption; else - c->warning(__tr2qs_ctx("Unknown szOptions '%Q'","objects"),&(*it)); - + c->warning(__tr2qs_ctx("Unknown szOptions '%Q'", "objects"), &(*it)); } ((QColorDialog *)widget())->setOptions(QColorDialog::ColorDialogOptions(sum)); return true; } - - -KVSO_CLASS_FUNCTION(colorDialog,currentColorChangedEvent) +KVSO_CLASS_FUNCTION(colorDialog, currentColorChangedEvent) { - emitSignal("currentColorChanged",c,c->params()); + emitSignal("currentColorChanged", c, c->params()); return true; } - -KVSO_CLASS_FUNCTION(colorDialog,colorSelectedEvent) +KVSO_CLASS_FUNCTION(colorDialog, colorSelectedEvent) { - emitSignal("colorSelected",c,c->params()); + emitSignal("colorSelected", c, c->params()); return true; } //slots -void KvsObject_colorDialog::slotCurrentColorChanged(const QColor &col) +void KvsObject_colorDialog::slotCurrentColorChanged(const QColor & col) { - KviKvsHash *pHash = new KviKvsHash(); - KviKvsVariant *pColName = new KviKvsVariant(col.name()); - KviKvsVariant *pColAlpha = new KviKvsVariant((kvs_int_t)col.alpha()); - pHash->set("color",pColName); - pHash->set("opacity",pColAlpha); + KviKvsHash * pHash = new KviKvsHash(); + KviKvsVariant * pColName = new KviKvsVariant(col.name()); + KviKvsVariant * pColAlpha = new KviKvsVariant((kvs_int_t)col.alpha()); + pHash->set("color", pColName); + pHash->set("opacity", pColAlpha); KviKvsVariantList params(new KviKvsVariant(pHash)); - callFunction(this,"currentColorChangedEvent",¶ms); + callFunction(this, "currentColorChangedEvent", ¶ms); } -void KvsObject_colorDialog::slotColorSelected(const QColor &col) +void KvsObject_colorDialog::slotColorSelected(const QColor & col) { - KviKvsHash *pHash = new KviKvsHash(); - KviKvsVariant *pColName = new KviKvsVariant(col.name()); - KviKvsVariant *pColAlpha = new KviKvsVariant((kvs_int_t)col.alpha()); - pHash->set("color",pColName); - pHash->set("alpha",pColAlpha); + KviKvsHash * pHash = new KviKvsHash(); + KviKvsVariant * pColName = new KviKvsVariant(col.name()); + KviKvsVariant * pColAlpha = new KviKvsVariant((kvs_int_t)col.alpha()); + pHash->set("color", pColName); + pHash->set("alpha", pColAlpha); KviKvsVariantList params(new KviKvsVariant(pHash)); - callFunction(this,"colorSelectedEvent",¶ms); + callFunction(this, "colorSelectedEvent", ¶ms); } diff --git a/src/modules/objects/KvsObject_colorDialog.h b/src/modules/objects/KvsObject_colorDialog.h index fbb92bb0d..b7a293c3c 100644 --- a/src/modules/objects/KvsObject_colorDialog.h +++ b/src/modules/objects/KvsObject_colorDialog.h @@ -1,5 +1,5 @@ -#ifndef _CLASS_COLORDIALOG_H_ -#define _CLASS_COLORDIALOG_H_ +#ifndef _CLASS_COLORDIALOG_H_ +#define _CLASS_COLORDIALOG_H_ //============================================================================= // @@ -26,8 +26,6 @@ // //============================================================================= - - #include "KvsObject_dialog.h" #include "object_macros.h" @@ -39,14 +37,13 @@ public: public: QWidget * widget() { return (QWidget *)object(); } protected: - virtual bool init(KviKvsRunTimeContext * pContext,KviKvsVariantList *pParams); - bool setCurrentColor(KviKvsObjectFunctionCall *c); - bool currentColorChangedEvent(KviKvsObjectFunctionCall *c); - bool colorSelectedEvent(KviKvsObjectFunctionCall *c); - bool setOptions(KviKvsObjectFunctionCall *c); + virtual bool init(KviKvsRunTimeContext * pContext, KviKvsVariantList * pParams); + bool setCurrentColor(KviKvsObjectFunctionCall * c); + bool currentColorChangedEvent(KviKvsObjectFunctionCall * c); + bool colorSelectedEvent(KviKvsObjectFunctionCall * c); + bool setOptions(KviKvsObjectFunctionCall * c); protected slots: - void slotCurrentColorChanged(const QColor &col); - void slotColorSelected(const QColor &col); - + void slotCurrentColorChanged(const QColor & col); + void slotColorSelected(const QColor & col); }; -#endif // !_CLASS_COLORDIALOG_H_ +#endif // !_CLASS_COLORDIALOG_H_ diff --git a/src/modules/objects/KvsObject_comboBox.cpp b/src/modules/objects/KvsObject_comboBox.cpp index 454df7e0a..331f3fe5a 100644 --- a/src/modules/objects/KvsObject_comboBox.cpp +++ b/src/modules/objects/KvsObject_comboBox.cpp @@ -23,7 +23,6 @@ // //============================================================================= - #include "KviError.h" #include "KviLocale.h" #include "kvi_debug.h" @@ -99,263 +98,265 @@ */ -KVSO_BEGIN_REGISTERCLASS(KvsObject_comboBox,"combobox","widget") - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_comboBox,insertItem) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_comboBox,changeItem) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_comboBox,removeItem) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_comboBox,clear) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_comboBox,setMaxCount) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_comboBox,maxCount) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_comboBox,count) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_comboBox,current) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_comboBox,currentItem) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_comboBox,setEditable); - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_comboBox,editable) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_comboBox,setEditText) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_comboBox,textAt) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_comboBox,textLineEdit) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_comboBox,setTextLineEdit) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_comboBox,setCurrentItem) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_comboBox,popup) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_comboBox,setInsertionPolicy) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_comboBox,textChangedEvent) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_comboBox,activatedEvent) +KVSO_BEGIN_REGISTERCLASS(KvsObject_comboBox, "combobox", "widget") +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_comboBox, insertItem) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_comboBox, changeItem) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_comboBox, removeItem) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_comboBox, clear) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_comboBox, setMaxCount) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_comboBox, maxCount) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_comboBox, count) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_comboBox, current) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_comboBox, currentItem) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_comboBox, setEditable); +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_comboBox, editable) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_comboBox, setEditText) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_comboBox, textAt) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_comboBox, textLineEdit) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_comboBox, setTextLineEdit) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_comboBox, setCurrentItem) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_comboBox, popup) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_comboBox, setInsertionPolicy) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_comboBox, textChangedEvent) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_comboBox, activatedEvent) KVSO_END_REGISTERCLASS(KvsObject_comboBox) -KVSO_BEGIN_CONSTRUCTOR(KvsObject_comboBox,KvsObject_widget) +KVSO_BEGIN_CONSTRUCTOR(KvsObject_comboBox, KvsObject_widget) KVSO_END_CONSTRUCTOR(KvsObject_comboBox) - KVSO_BEGIN_DESTRUCTOR(KvsObject_comboBox) KVSO_END_CONSTRUCTOR(KvsObject_comboBox) -bool KvsObject_comboBox::init(KviKvsRunTimeContext *,KviKvsVariantList *) +bool KvsObject_comboBox::init(KviKvsRunTimeContext *, KviKvsVariantList *) { SET_OBJECT(QComboBox); - connect (((QComboBox *)widget()),SIGNAL(activated( int )),this,SLOT(slotActivated( int ))); - connect (((QComboBox *)widget()),SIGNAL(editTextChanged(const QString & )),this,SLOT(editTextChanged(const QString & ))); + connect(((QComboBox *)widget()), SIGNAL(activated(int)), this, SLOT(slotActivated(int))); + connect(((QComboBox *)widget()), SIGNAL(editTextChanged(const QString &)), this, SLOT(editTextChanged(const QString &))); return true; } -KVSO_CLASS_FUNCTION(comboBox,insertItem) +KVSO_CLASS_FUNCTION(comboBox, insertItem) { CHECK_INTERNAL_POINTER(widget()) kvs_int_t iIndex; QString szItem; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("item",KVS_PT_STRING,0,szItem) - KVSO_PARAMETER("index",KVS_PT_INT,KVS_PF_OPTIONAL,iIndex) + KVSO_PARAMETER("item", KVS_PT_STRING, 0, szItem) + KVSO_PARAMETER("index", KVS_PT_INT, KVS_PF_OPTIONAL, iIndex) KVSO_PARAMETERS_END(c) - if(c->paramCount()==1) + if(c->paramCount() == 1) ((QComboBox *)widget())->addItem(szItem); else - ((QComboBox *)widget())->insertItem( iIndex,szItem); + ((QComboBox *)widget())->insertItem(iIndex, szItem); return true; } -KVSO_CLASS_FUNCTION(comboBox,clear) +KVSO_CLASS_FUNCTION(comboBox, clear) { CHECK_INTERNAL_POINTER(widget()) ((QComboBox *)widget())->clear(); return true; } -KVSO_CLASS_FUNCTION(comboBox,changeItem) +KVSO_CLASS_FUNCTION(comboBox, changeItem) { CHECK_INTERNAL_POINTER(widget()) - kvs_uint_t uIndex,cnt; + kvs_uint_t uIndex, cnt; QString szText; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("text",KVS_PT_STRING,0,szText) - KVSO_PARAMETER("index",KVS_PT_UNSIGNEDINTEGER,0,uIndex) + KVSO_PARAMETER("text", KVS_PT_STRING, 0, szText) + KVSO_PARAMETER("index", KVS_PT_UNSIGNEDINTEGER, 0, uIndex) KVSO_PARAMETERS_END(c) - if (szText.isEmpty()) c->warning(__tr2qs_ctx("No string parameter given - using empty string","objects")); + if(szText.isEmpty()) + c->warning(__tr2qs_ctx("No string parameter given - using empty string", "objects")); if(uIndex >= (cnt = ((QComboBox *)widget())->count())) { - c->warning(__tr2qs_ctx("Item index [%d] is too big - defaulting to " \ - "$count() - 1 [%d]","objects"), uIndex, cnt); + c->warning(__tr2qs_ctx("Item index [%d] is too big - defaulting to " + "$count() - 1 [%d]", + "objects"), + uIndex, cnt); uIndex = cnt - 1; } - ((QComboBox *)widget())->setItemText( uIndex,szText); + ((QComboBox *)widget())->setItemText(uIndex, szText); return true; - } -KVSO_CLASS_FUNCTION(comboBox,removeItem) +KVSO_CLASS_FUNCTION(comboBox, removeItem) { CHECK_INTERNAL_POINTER(widget()) - kvs_uint_t uIndex,cnt; + kvs_uint_t uIndex, cnt; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("index",KVS_PT_UNSIGNEDINTEGER,0,uIndex) + KVSO_PARAMETER("index", KVS_PT_UNSIGNEDINTEGER, 0, uIndex) KVSO_PARAMETERS_END(c) if(uIndex >= (cnt = ((QComboBox *)widget())->count())) { - c->warning(__tr2qs_ctx("Item index [%d] is too big - defaulting to " \ - "$count() - 1 [%d]","objects"), uIndex, cnt); + c->warning(__tr2qs_ctx("Item index [%d] is too big - defaulting to " + "$count() - 1 [%d]", + "objects"), + uIndex, cnt); uIndex = cnt - 1; } ((QComboBox *)widget())->removeItem(uIndex); return true; - } -KVSO_CLASS_FUNCTION(comboBox,setMaxCount) +KVSO_CLASS_FUNCTION(comboBox, setMaxCount) { CHECK_INTERNAL_POINTER(widget()) kvs_uint_t iMax; QString szText; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("count",KVS_PT_UNSIGNEDINTEGER,0,iMax) + KVSO_PARAMETER("count", KVS_PT_UNSIGNEDINTEGER, 0, iMax) KVSO_PARAMETERS_END(c) ((QComboBox *)widget())->setMaxCount(iMax); return true; } -KVSO_CLASS_FUNCTION(comboBox,maxCount) +KVSO_CLASS_FUNCTION(comboBox, maxCount) { CHECK_INTERNAL_POINTER(widget()) c->returnValue()->setInteger(((QComboBox *)widget())->maxCount()); return true; } -KVSO_CLASS_FUNCTION(comboBox,count) +KVSO_CLASS_FUNCTION(comboBox, count) { CHECK_INTERNAL_POINTER(widget()) c->returnValue()->setInteger(((QComboBox *)widget())->count()); return true; } -KVSO_CLASS_FUNCTION(comboBox,current) +KVSO_CLASS_FUNCTION(comboBox, current) { CHECK_INTERNAL_POINTER(widget()) c->returnValue()->setString(((QComboBox *)widget())->currentText()); return true; } -KVSO_CLASS_FUNCTION(comboBox,currentItem) +KVSO_CLASS_FUNCTION(comboBox, currentItem) { CHECK_INTERNAL_POINTER(widget()) c->returnValue()->setInteger(((QComboBox *)widget())->currentIndex()); return true; } -KVSO_CLASS_FUNCTION(comboBox,textLineEdit) +KVSO_CLASS_FUNCTION(comboBox, textLineEdit) { CHECK_INTERNAL_POINTER(widget()) c->returnValue()->setString(((QComboBox *)widget())->lineEdit()->text()); return true; } -KVSO_CLASS_FUNCTION(comboBox,setEditable) +KVSO_CLASS_FUNCTION(comboBox, setEditable) { CHECK_INTERNAL_POINTER(widget()) bool bFlag; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("bflag",KVS_PT_BOOLEAN,0,bFlag) + KVSO_PARAMETER("bflag", KVS_PT_BOOLEAN, 0, bFlag) KVSO_PARAMETERS_END(c) ((QComboBox *)widget())->setEditable(bFlag); return true; } -KVSO_CLASS_FUNCTION(comboBox,setTextLineEdit) +KVSO_CLASS_FUNCTION(comboBox, setTextLineEdit) { CHECK_INTERNAL_POINTER(widget()) QString szText; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("text",KVS_PT_STRING,0,szText) + KVSO_PARAMETER("text", KVS_PT_STRING, 0, szText) KVSO_PARAMETERS_END(c) ((QComboBox *)widget())->lineEdit()->setText(szText); return true; } -KVSO_CLASS_FUNCTION(comboBox,editable) +KVSO_CLASS_FUNCTION(comboBox, editable) { CHECK_INTERNAL_POINTER(widget()) c->returnValue()->setBoolean(((QComboBox *)widget())->isEditable()); return true; } -KVSO_CLASS_FUNCTION(comboBox,setEditText) +KVSO_CLASS_FUNCTION(comboBox, setEditText) { CHECK_INTERNAL_POINTER(widget()) QString szText; - bool bQuiet=false; + bool bQuiet = false; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("text",KVS_PT_STRING,0,szText) - KVSO_PARAMETER("quiet",KVS_PT_BOOLEAN,KVS_PF_OPTIONAL,bQuiet) + KVSO_PARAMETER("text", KVS_PT_STRING, 0, szText) + KVSO_PARAMETER("quiet", KVS_PT_BOOLEAN, KVS_PF_OPTIONAL, bQuiet) KVSO_PARAMETERS_END(c) - if (szText.isEmpty() && !bQuiet) c->warning(__tr2qs_ctx("No string parameter given - using empty string","objects")); + if(szText.isEmpty() && !bQuiet) + c->warning(__tr2qs_ctx("No string parameter given - using empty string", "objects")); ((QComboBox *)widget())->setEditText(szText); return true; } -KVSO_CLASS_FUNCTION(comboBox,textAt) +KVSO_CLASS_FUNCTION(comboBox, textAt) { CHECK_INTERNAL_POINTER(widget()) kvs_uint_t uIndex; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("index",KVS_PT_UNSIGNEDINTEGER,0,uIndex) + KVSO_PARAMETER("index", KVS_PT_UNSIGNEDINTEGER, 0, uIndex) KVSO_PARAMETERS_END(c) c->returnValue()->setString(((QComboBox *)widget())->itemText(uIndex)); return true; } -KVSO_CLASS_FUNCTION(comboBox,setCurrentItem) +KVSO_CLASS_FUNCTION(comboBox, setCurrentItem) { CHECK_INTERNAL_POINTER(widget()) kvs_uint_t uIndex; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("index",KVS_PT_UNSIGNEDINTEGER,0,uIndex) + KVSO_PARAMETER("index", KVS_PT_UNSIGNEDINTEGER, 0, uIndex) KVSO_PARAMETERS_END(c) ((QComboBox *)widget())->setCurrentIndex(uIndex); return true; } -KVSO_CLASS_FUNCTION(comboBox,popup) +KVSO_CLASS_FUNCTION(comboBox, popup) { Q_UNUSED(c); if(widget()) - ((QComboBox *)widget())->showPopup(); + ((QComboBox *)widget())->showPopup(); return true; } -KVSO_CLASS_FUNCTION(comboBox,setInsertionPolicy) +KVSO_CLASS_FUNCTION(comboBox, setInsertionPolicy) { CHECK_INTERNAL_POINTER(widget()) QString szPolicy; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("policy",KVS_PT_STRING,0,szPolicy) + KVSO_PARAMETER("policy", KVS_PT_STRING, 0, szPolicy) KVSO_PARAMETERS_END(c) - if(KviQString::equalCI(szPolicy,"NoInsertion")) - ((QComboBox *)widget())->setInsertPolicy(QComboBox::NoInsert); - else if(KviQString::equalCI(szPolicy,"AtTop")) - ((QComboBox *)widget())->setInsertPolicy(QComboBox::InsertAtTop); - else if(KviQString::equalCI(szPolicy,"AtBotton")) - ((QComboBox *)widget())->setInsertPolicy(QComboBox::InsertAtBottom); - else if(KviQString::equalCI(szPolicy,"AtCurrent")) - ((QComboBox *)widget())->setInsertPolicy(QComboBox::InsertAtCurrent); - else if(KviQString::equalCI(szPolicy,"AfterCurrent")) - ((QComboBox *)widget())->setInsertPolicy(QComboBox::InsertAfterCurrent); - else if(KviQString::equalCI(szPolicy,"BeforeCurrent")) - ((QComboBox *)widget())->setInsertPolicy(QComboBox::InsertBeforeCurrent); - else c->warning(__tr2qs_ctx("Invalid insertion policy '%Q'","objects"),&szPolicy); + if(KviQString::equalCI(szPolicy, "NoInsertion")) + ((QComboBox *)widget())->setInsertPolicy(QComboBox::NoInsert); + else if(KviQString::equalCI(szPolicy, "AtTop")) + ((QComboBox *)widget())->setInsertPolicy(QComboBox::InsertAtTop); + else if(KviQString::equalCI(szPolicy, "AtBotton")) + ((QComboBox *)widget())->setInsertPolicy(QComboBox::InsertAtBottom); + else if(KviQString::equalCI(szPolicy, "AtCurrent")) + ((QComboBox *)widget())->setInsertPolicy(QComboBox::InsertAtCurrent); + else if(KviQString::equalCI(szPolicy, "AfterCurrent")) + ((QComboBox *)widget())->setInsertPolicy(QComboBox::InsertAfterCurrent); + else if(KviQString::equalCI(szPolicy, "BeforeCurrent")) + ((QComboBox *)widget())->setInsertPolicy(QComboBox::InsertBeforeCurrent); + else + c->warning(__tr2qs_ctx("Invalid insertion policy '%Q'", "objects"), &szPolicy); return true; } -KVSO_CLASS_FUNCTION(comboBox,textChangedEvent) +KVSO_CLASS_FUNCTION(comboBox, textChangedEvent) { - emitSignal("textChanged",c,c->params()); + emitSignal("textChanged", c, c->params()); return true; } - - -KVSO_CLASS_FUNCTION(comboBox,activatedEvent) +KVSO_CLASS_FUNCTION(comboBox, activatedEvent) { - emitSignal("activated",c,c->params()); + emitSignal("activated", c, c->params()); return true; } //slots -void KvsObject_comboBox::editTextChanged(const QString &text) +void KvsObject_comboBox::editTextChanged(const QString & text) { KviKvsVariantList params(new KviKvsVariant(text)); - callFunction(this,"textChangedEvent",¶ms); + callFunction(this, "textChangedEvent", ¶ms); } void KvsObject_comboBox::slotActivated(int i) { KviKvsVariantList params(new KviKvsVariant((kvs_int_t)i)); - callFunction(this,"activatedEvent",¶ms); + callFunction(this, "activatedEvent", ¶ms); } diff --git a/src/modules/objects/KvsObject_comboBox.h b/src/modules/objects/KvsObject_comboBox.h index ed3133232..22af362cd 100644 --- a/src/modules/objects/KvsObject_comboBox.h +++ b/src/modules/objects/KvsObject_comboBox.h @@ -1,5 +1,5 @@ -#ifndef _CLASS_COMBOBOX_H_ -#define _CLASS_COMBOBOX_H_ +#ifndef _CLASS_COMBOBOX_H_ +#define _CLASS_COMBOBOX_H_ //============================================================================= // @@ -26,7 +26,6 @@ // //============================================================================= - #include #include "KvsObject_widget.h" #include "object_macros.h" @@ -39,36 +38,36 @@ public: public: QWidget * widget() { return (QWidget *)object(); }; protected: - virtual bool init(KviKvsRunTimeContext * pContext,KviKvsVariantList *pParams); + virtual bool init(KviKvsRunTimeContext * pContext, KviKvsVariantList * pParams); - bool insertItem(KviKvsObjectFunctionCall *c); - bool changeItem(KviKvsObjectFunctionCall *c); - bool removeItem(KviKvsObjectFunctionCall *c); - bool clear(KviKvsObjectFunctionCall *c); -//#warning "$insertPixItem" -//#warning "$changePixItem" + bool insertItem(KviKvsObjectFunctionCall * c); + bool changeItem(KviKvsObjectFunctionCall * c); + bool removeItem(KviKvsObjectFunctionCall * c); + bool clear(KviKvsObjectFunctionCall * c); + //#warning "$insertPixItem" + //#warning "$changePixItem" - bool count(KviKvsObjectFunctionCall *c); - bool setMaxCount(KviKvsObjectFunctionCall *c); - bool maxCount(KviKvsObjectFunctionCall *c); - bool current(KviKvsObjectFunctionCall *c); - bool currentItem(KviKvsObjectFunctionCall *c); - bool setEditable(KviKvsObjectFunctionCall *c); - bool editable(KviKvsObjectFunctionCall *c); - bool setEditText(KviKvsObjectFunctionCall *c); - bool textAt(KviKvsObjectFunctionCall *c); - bool textLineEdit(KviKvsObjectFunctionCall *c); - bool setTextLineEdit(KviKvsObjectFunctionCall *c); + bool count(KviKvsObjectFunctionCall * c); + bool setMaxCount(KviKvsObjectFunctionCall * c); + bool maxCount(KviKvsObjectFunctionCall * c); + bool current(KviKvsObjectFunctionCall * c); + bool currentItem(KviKvsObjectFunctionCall * c); + bool setEditable(KviKvsObjectFunctionCall * c); + bool editable(KviKvsObjectFunctionCall * c); + bool setEditText(KviKvsObjectFunctionCall * c); + bool textAt(KviKvsObjectFunctionCall * c); + bool textLineEdit(KviKvsObjectFunctionCall * c); + bool setTextLineEdit(KviKvsObjectFunctionCall * c); - bool setInsertionPolicy(KviKvsObjectFunctionCall *c); + bool setInsertionPolicy(KviKvsObjectFunctionCall * c); - bool setCurrentItem(KviKvsObjectFunctionCall *c); - bool popup(KviKvsObjectFunctionCall *c); - bool textChangedEvent(KviKvsObjectFunctionCall *c); - bool activatedEvent(KviKvsObjectFunctionCall *c); + bool setCurrentItem(KviKvsObjectFunctionCall * c); + bool popup(KviKvsObjectFunctionCall * c); + bool textChangedEvent(KviKvsObjectFunctionCall * c); + bool activatedEvent(KviKvsObjectFunctionCall * c); protected slots: void editTextChanged(const QString &); void slotActivated(int); }; -#endif // !_CLASS_COMBOBOX_H_ +#endif // !_CLASS_COMBOBOX_H_ diff --git a/src/modules/objects/KvsObject_dateTimeEdit.cpp b/src/modules/objects/KvsObject_dateTimeEdit.cpp index d81692d2e..f4c7044ea 100644 --- a/src/modules/objects/KvsObject_dateTimeEdit.cpp +++ b/src/modules/objects/KvsObject_dateTimeEdit.cpp @@ -76,91 +76,90 @@ Returns the widget time according to format. */ -KVSO_BEGIN_REGISTERCLASS(KvsObject_dateTimeEdit,"datetimeedit","widget") +KVSO_BEGIN_REGISTERCLASS(KvsObject_dateTimeEdit, "datetimeedit", "widget") - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_dateTimeEdit,date) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_dateTimeEdit,setDate) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_dateTimeEdit,setTime) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_dateTimeEdit,time) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_dateTimeEdit, date) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_dateTimeEdit, setDate) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_dateTimeEdit, setTime) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_dateTimeEdit, time) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_dateTimeEdit,timeChangedEvent) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_dateTimeEdit,dateTimeChangedEvent) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_dateTimeEdit,dateChangedEvent) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_dateTimeEdit, timeChangedEvent) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_dateTimeEdit, dateTimeChangedEvent) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_dateTimeEdit, dateChangedEvent) KVSO_END_REGISTERCLASS(KvsObject_dateTimeEdit) -KVSO_BEGIN_CONSTRUCTOR(KvsObject_dateTimeEdit,KvsObject_widget) +KVSO_BEGIN_CONSTRUCTOR(KvsObject_dateTimeEdit, KvsObject_widget) KVSO_END_CONSTRUCTOR(KvsObject_dateTimeEdit) - KVSO_BEGIN_DESTRUCTOR(KvsObject_dateTimeEdit) KVSO_END_DESTRUCTOR(KvsObject_dateTimeEdit) -bool KvsObject_dateTimeEdit::init(KviKvsRunTimeContext *,KviKvsVariantList *) +bool KvsObject_dateTimeEdit::init(KviKvsRunTimeContext *, KviKvsVariantList *) { - QDateTimeEdit *obj=new QDateTimeEdit(QDate::currentDate(),parentScriptWidget()); + QDateTimeEdit * obj = new QDateTimeEdit(QDate::currentDate(), parentScriptWidget()); obj->setObjectName(getName()); - connect(obj,SIGNAL(dateChanged(const QDate &)),this,SLOT(slotDateChanged(const QDate &))); - connect(obj,SIGNAL(dateTimeChanged(const QDateTime & )),this,SLOT(slotDateTimeChanged(const QDateTime &))); - connect(obj,SIGNAL(timeChanged(const QTime &)),this,SLOT(slotTimeChanged(const QTime &))); + connect(obj, SIGNAL(dateChanged(const QDate &)), this, SLOT(slotDateChanged(const QDate &))); + connect(obj, SIGNAL(dateTimeChanged(const QDateTime &)), this, SLOT(slotDateTimeChanged(const QDateTime &))); + connect(obj, SIGNAL(timeChanged(const QTime &)), this, SLOT(slotTimeChanged(const QTime &))); - setObject(obj,true); + setObject(obj, true); return true; } -KVSO_CLASS_FUNCTION(dateTimeEdit,date) +KVSO_CLASS_FUNCTION(dateTimeEdit, date) { CHECK_INTERNAL_POINTER(widget()) QString szFormat; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("format",KVS_PT_STRING,0,szFormat) + KVSO_PARAMETER("format", KVS_PT_STRING, 0, szFormat) KVSO_PARAMETERS_END(c) c->returnValue()->setString(((QDateTimeEdit *)widget())->date().toString(szFormat)); return true; } -KVSO_CLASS_FUNCTION(dateTimeEdit,setDate) +KVSO_CLASS_FUNCTION(dateTimeEdit, setDate) { CHECK_INTERNAL_POINTER(widget()) - QString szFormat,szDate; + QString szFormat, szDate; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("format",KVS_PT_STRING,0,szFormat) - KVSO_PARAMETER("date",KVS_PT_STRING,0,szDate) + KVSO_PARAMETER("format", KVS_PT_STRING, 0, szFormat) + KVSO_PARAMETER("date", KVS_PT_STRING, 0, szDate) KVSO_PARAMETERS_END(c) QDate date; - date=date.fromString(szDate,szFormat); + date = date.fromString(szDate, szFormat); ((QDateTimeEdit *)widget())->setDate(date); return true; } -KVSO_CLASS_FUNCTION(dateTimeEdit,time) +KVSO_CLASS_FUNCTION(dateTimeEdit, time) { CHECK_INTERNAL_POINTER(widget()) QString szFormat; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("format",KVS_PT_STRING,0,szFormat) + KVSO_PARAMETER("format", KVS_PT_STRING, 0, szFormat) KVSO_PARAMETERS_END(c) c->returnValue()->setString(((QDateTimeEdit *)widget())->time().toString(szFormat)); return true; } -KVSO_CLASS_FUNCTION(dateTimeEdit,setTime) +KVSO_CLASS_FUNCTION(dateTimeEdit, setTime) { CHECK_INTERNAL_POINTER(widget()) - QString szFormat,szTime; + QString szFormat, szTime; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("format",KVS_PT_STRING,0,szFormat) - KVSO_PARAMETER("date",KVS_PT_STRING,0,szTime) + KVSO_PARAMETER("format", KVS_PT_STRING, 0, szFormat) + KVSO_PARAMETER("date", KVS_PT_STRING, 0, szTime) KVSO_PARAMETERS_END(c) QTime time; - time=time.fromString(szTime,szFormat); + time = time.fromString(szTime, szFormat); ((QDateTimeEdit *)widget())->setTime(time); return true; } @@ -168,41 +167,38 @@ KVSO_CLASS_FUNCTION(dateTimeEdit,setTime) // slots void KvsObject_dateTimeEdit::slotDateTimeChanged(const QDateTime &) { - KviKvsVariantList *params=0; - callFunction(this,"dateTimeChangedEvent",params); + KviKvsVariantList * params = 0; + callFunction(this, "dateTimeChangedEvent", params); } - -KVSO_CLASS_FUNCTION(dateTimeEdit,dateTimeChangedEvent) +KVSO_CLASS_FUNCTION(dateTimeEdit, dateTimeChangedEvent) { - emitSignal("dateTimeChanged",c); + emitSignal("dateTimeChanged", c); return true; } - - -KVSO_CLASS_FUNCTION(dateTimeEdit,timeChangedEvent) +KVSO_CLASS_FUNCTION(dateTimeEdit, timeChangedEvent) { - emitSignal("timeChanged",c); + emitSignal("timeChanged", c); return true; } // slots void KvsObject_dateTimeEdit::slotTimeChanged(const QTime &) { - KviKvsVariantList *params=0; - callFunction(this,"timeChangedEvent",params); + KviKvsVariantList * params = 0; + callFunction(this, "timeChangedEvent", params); } -KVSO_CLASS_FUNCTION(dateTimeEdit,dateChangedEvent) +KVSO_CLASS_FUNCTION(dateTimeEdit, dateChangedEvent) { - emitSignal("dateChanged",c); + emitSignal("dateChanged", c); return true; } // slots void KvsObject_dateTimeEdit::slotDateChanged(const QDate &) { - KviKvsVariantList *params=0; - callFunction(this,"dateChangedEvent",params); + KviKvsVariantList * params = 0; + callFunction(this, "dateChangedEvent", params); } diff --git a/src/modules/objects/KvsObject_dateTimeEdit.h b/src/modules/objects/KvsObject_dateTimeEdit.h index 7ea89ef58..f10340900 100644 --- a/src/modules/objects/KvsObject_dateTimeEdit.h +++ b/src/modules/objects/KvsObject_dateTimeEdit.h @@ -24,8 +24,6 @@ // //============================================================================= - - #include "KvsObject_widget.h" #include "object_macros.h" @@ -41,16 +39,16 @@ public: public: QWidget * widget() { return (QWidget *)object(); }; protected: - virtual bool init(KviKvsRunTimeContext * pContext,KviKvsVariantList *pParams); + virtual bool init(KviKvsRunTimeContext * pContext, KviKvsVariantList * pParams); - bool date(KviKvsObjectFunctionCall *c); - bool setDate(KviKvsObjectFunctionCall *c); - bool time(KviKvsObjectFunctionCall *c); - bool setTime(KviKvsObjectFunctionCall *c); + bool date(KviKvsObjectFunctionCall * c); + bool setDate(KviKvsObjectFunctionCall * c); + bool time(KviKvsObjectFunctionCall * c); + bool setTime(KviKvsObjectFunctionCall * c); - bool timeChangedEvent(KviKvsObjectFunctionCall *c); - bool dateTimeChangedEvent(KviKvsObjectFunctionCall *c); - bool dateChangedEvent(KviKvsObjectFunctionCall *c); + bool timeChangedEvent(KviKvsObjectFunctionCall * c); + bool dateTimeChangedEvent(KviKvsObjectFunctionCall * c); + bool dateChangedEvent(KviKvsObjectFunctionCall * c); protected slots: void slotDateTimeChanged(const QDateTime &); @@ -58,4 +56,4 @@ protected slots: void slotTimeChanged(const QTime &); }; -#endif // !_CLASS_datetimeedit_H_ +#endif // !_CLASS_datetimeedit_H_ diff --git a/src/modules/objects/KvsObject_dialog.cpp b/src/modules/objects/KvsObject_dialog.cpp index afda7bb4a..9205eb722 100644 --- a/src/modules/objects/KvsObject_dialog.cpp +++ b/src/modules/objects/KvsObject_dialog.cpp @@ -31,7 +31,6 @@ #include - /* @doc: dialog @title: @@ -54,35 +53,35 @@ @functions: */ -KVSO_BEGIN_REGISTERCLASS(KvsObject_dialog,"dialog","widget") - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_dialog,setModal) +KVSO_BEGIN_REGISTERCLASS(KvsObject_dialog, "dialog", "widget") +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_dialog, setModal) KVSO_END_REGISTERCLASS(KvsObject_dialog) -KVSO_BEGIN_CONSTRUCTOR(KvsObject_dialog,KvsObject_widget) +KVSO_BEGIN_CONSTRUCTOR(KvsObject_dialog, KvsObject_widget) KVSO_END_CONSTRUCTOR(KvsObject_dialog) - KVSO_BEGIN_DESTRUCTOR(KvsObject_dialog) KVSO_END_CONSTRUCTOR(KvsObject_dialog) -bool KvsObject_dialog::init(KviKvsRunTimeContext *,KviKvsVariantList *) +bool KvsObject_dialog::init(KviKvsRunTimeContext *, KviKvsVariantList *) { QWidget * w = g_pApp->activeModalWidget(); - if(!w)w = g_pMainWindow; + if(!w) + w = g_pMainWindow; QDialog * d = new QDialog(parentScriptWidget() ? parentScriptWidget() : w); d->setObjectName(getName()); //d->setModal(true); setObject(d); return true; } -KVSO_CLASS_FUNCTION(dialog,setModal) +KVSO_CLASS_FUNCTION(dialog, setModal) { CHECK_INTERNAL_POINTER(widget()) bool bEnabled; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("bEnabled",KVS_PT_BOOL,0,bEnabled) + KVSO_PARAMETER("bEnabled", KVS_PT_BOOL, 0, bEnabled) KVSO_PARAMETERS_END(c) ((QDialog *)widget())->setModal(bEnabled); return true; diff --git a/src/modules/objects/KvsObject_dialog.h b/src/modules/objects/KvsObject_dialog.h index 6c99d0cd8..14c2b668c 100644 --- a/src/modules/objects/KvsObject_dialog.h +++ b/src/modules/objects/KvsObject_dialog.h @@ -35,8 +35,8 @@ public: public: QWidget * widget() { return (QWidget *)object(); }; protected: - virtual bool init(KviKvsRunTimeContext * pContext,KviKvsVariantList *pParams); - bool setModal(KviKvsObjectFunctionCall *c); + virtual bool init(KviKvsRunTimeContext * pContext, KviKvsVariantList * pParams); + bool setModal(KviKvsObjectFunctionCall * c); }; #endif // !_CLASS_DIALOG_H_ diff --git a/src/modules/objects/KvsObject_dockWindow.cpp b/src/modules/objects/KvsObject_dockWindow.cpp index 02b0545e8..66fe4a5f4 100644 --- a/src/modules/objects/KvsObject_dockWindow.cpp +++ b/src/modules/objects/KvsObject_dockWindow.cpp @@ -59,23 +59,21 @@ Docks this dock window to the specified dockarea of the main KVIrc window which can be one of "l" (left dock area), "t" (top dock area), "r" (right dock area), "b" (bottom dock area), "f" (floating) and "m" (minimized). */ -KVSO_BEGIN_REGISTERCLASS(KvsObject_dockWindow,"dockwindow","widget") - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_dockWindow,addWidget) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_dockWindow,setAllowedDockAreas) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_dockWindow,dock) +KVSO_BEGIN_REGISTERCLASS(KvsObject_dockWindow, "dockwindow", "widget") +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_dockWindow, addWidget) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_dockWindow, setAllowedDockAreas) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_dockWindow, dock) KVSO_END_REGISTERCLASS(KvsObject_dockWindow) - -KVSO_BEGIN_CONSTRUCTOR(KvsObject_dockWindow,KvsObject_widget) +KVSO_BEGIN_CONSTRUCTOR(KvsObject_dockWindow, KvsObject_widget) KVSO_END_CONSTRUCTOR(KvsObject_dockWindow) - KVSO_BEGIN_DESTRUCTOR(KvsObject_dockWindow) KVSO_END_DESTRUCTOR(KvsObject_dockWindow) #define _pDockWindow ((QDockWidget *)widget()) -bool KvsObject_dockWindow::init(KviKvsRunTimeContext *,KviKvsVariantList *) +bool KvsObject_dockWindow::init(KviKvsRunTimeContext *, KviKvsVariantList *) { QDockWidget * pWidget = new QDockWidget(g_pMainWindow); pWidget->setObjectName(getName()); @@ -83,94 +81,99 @@ bool KvsObject_dockWindow::init(KviKvsRunTimeContext *,KviKvsVariantList *) return true; } -KVSO_CLASS_FUNCTION(dockWindow,addWidget) +KVSO_CLASS_FUNCTION(dockWindow, addWidget) { CHECK_INTERNAL_POINTER(widget()) kvs_hobject_t hWidget; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("widget",KVS_PT_HOBJECT,0,hWidget) + KVSO_PARAMETER("widget", KVS_PT_HOBJECT, 0, hWidget) KVSO_PARAMETERS_END(c) if(hWidget == (kvs_hobject_t)0) { // null widget ? - c->warning(__tr2qs_ctx("Can't add a null object","objects")); + c->warning(__tr2qs_ctx("Can't add a null object", "objects")); return true; } KviKvsObject * pWidget = KviKvsKernel::instance()->objectController()->lookupObject(hWidget); if(!pWidget) { - c->warning(__tr2qs_ctx("Invalid object handle passed as parameter (the object no longer exists?)","objects")); + c->warning(__tr2qs_ctx("Invalid object handle passed as parameter (the object no longer exists?)", "objects")); return true; } if(!pWidget->object()) { - c->warning(__tr2qs_ctx("Object in invalid state","objects")); + c->warning(__tr2qs_ctx("Object in invalid state", "objects")); return true; } if(!pWidget->object()->isWidgetType()) { - c->warning(__tr2qs_ctx("Can't set a non-widget object to be the main widget of a dock window","objects")); + c->warning(__tr2qs_ctx("Can't set a non-widget object to be the main widget of a dock window", "objects")); return true; } if(((QWidget *)(pWidget->object()))->parent() != (QObject *)_pDockWindow) { - c->warning(__tr2qs_ctx("The added widget is not a child of this dock window","objects")); + c->warning(__tr2qs_ctx("The added widget is not a child of this dock window", "objects")); } _pDockWindow->setWidget((QWidget *)(pWidget->object())); return true; } - -KVSO_CLASS_FUNCTION(dockWindow,setAllowedDockAreas) +KVSO_CLASS_FUNCTION(dockWindow, setAllowedDockAreas) { CHECK_INTERNAL_POINTER(widget()) QString szFlags; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("docks",KVS_PT_STRING,0,szFlags) + KVSO_PARAMETER("docks", KVS_PT_STRING, 0, szFlags) KVSO_PARAMETERS_END(c) Qt::DockWidgetAreas fAreas = Qt::NoDockWidgetArea; - if(szFlags.indexOf('t',Qt::CaseInsensitive) >= 0) + if(szFlags.indexOf('t', Qt::CaseInsensitive) >= 0) fAreas |= Qt::TopDockWidgetArea; - if(szFlags.indexOf('l',Qt::CaseInsensitive) >= 0) + if(szFlags.indexOf('l', Qt::CaseInsensitive) >= 0) fAreas |= Qt::LeftDockWidgetArea; - if(szFlags.indexOf('r',Qt::CaseInsensitive) >= 0) + if(szFlags.indexOf('r', Qt::CaseInsensitive) >= 0) fAreas |= Qt::RightDockWidgetArea; - if(szFlags.indexOf('b',Qt::CaseInsensitive) >= 0) + if(szFlags.indexOf('b', Qt::CaseInsensitive) >= 0) fAreas |= Qt::BottomDockWidgetArea; _pDockWindow->setAllowedAreas(fAreas); QDockWidget::DockWidgetFeatures fFeatures = _pDockWindow->features(); - if(szFlags.indexOf('f',Qt::CaseInsensitive)) + if(szFlags.indexOf('f', Qt::CaseInsensitive)) fFeatures |= QDockWidget::DockWidgetFloatable; else fFeatures &= ~QDockWidget::DockWidgetFloatable; // no support for minimized dock widgets _pDockWindow->setFeatures(fFeatures); - return true; } - -KVSO_CLASS_FUNCTION(dockWindow,dock) +KVSO_CLASS_FUNCTION(dockWindow, dock) { CHECK_INTERNAL_POINTER(widget()) QString szDock; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("dock",KVS_PT_STRING,0,szDock) + KVSO_PARAMETER("dock", KVS_PT_STRING, 0, szDock) KVSO_PARAMETERS_END(c) g_pMainWindow->removeDockWidget(_pDockWindow); - if(szDock.indexOf('m',Qt::CaseInsensitive) == -1)_pDockWindow->setFloating(false); - if(szDock.indexOf('t',Qt::CaseInsensitive) != -1)g_pMainWindow->addDockWidget(Qt::TopDockWidgetArea,_pDockWindow); - else if(szDock.indexOf('l',Qt::CaseInsensitive) != -1)g_pMainWindow->addDockWidget(Qt::LeftDockWidgetArea,_pDockWindow); - else if(szDock.indexOf('r',Qt::CaseInsensitive) != -1)g_pMainWindow->addDockWidget(Qt::RightDockWidgetArea,_pDockWindow); - else if(szDock.indexOf('b',Qt::CaseInsensitive) != -1)g_pMainWindow->addDockWidget(Qt::BottomDockWidgetArea,_pDockWindow); - else if(szDock.indexOf('f',Qt::CaseInsensitive) != -1)_pDockWindow->setFloating(true); - else if(szDock.indexOf('m',Qt::CaseInsensitive) != -1)qDebug("Sorry: no support for minimized dock widgets in Qt4"); - else c->warning(__tr2qs_ctx("Invalid dock area specified","objects")); + if(szDock.indexOf('m', Qt::CaseInsensitive) == -1) + _pDockWindow->setFloating(false); + if(szDock.indexOf('t', Qt::CaseInsensitive) != -1) + g_pMainWindow->addDockWidget(Qt::TopDockWidgetArea, _pDockWindow); + else if(szDock.indexOf('l', Qt::CaseInsensitive) != -1) + g_pMainWindow->addDockWidget(Qt::LeftDockWidgetArea, _pDockWindow); + else if(szDock.indexOf('r', Qt::CaseInsensitive) != -1) + g_pMainWindow->addDockWidget(Qt::RightDockWidgetArea, _pDockWindow); + else if(szDock.indexOf('b', Qt::CaseInsensitive) != -1) + g_pMainWindow->addDockWidget(Qt::BottomDockWidgetArea, _pDockWindow); + else if(szDock.indexOf('f', Qt::CaseInsensitive) != -1) + _pDockWindow->setFloating(true); + else if(szDock.indexOf('m', Qt::CaseInsensitive) != -1) + qDebug("Sorry: no support for minimized dock widgets in Qt4"); + else + c->warning(__tr2qs_ctx("Invalid dock area specified", "objects")); return true; } diff --git a/src/modules/objects/KvsObject_dockWindow.h b/src/modules/objects/KvsObject_dockWindow.h index c94c36a2a..dab239f54 100644 --- a/src/modules/objects/KvsObject_dockWindow.h +++ b/src/modules/objects/KvsObject_dockWindow.h @@ -34,9 +34,9 @@ class KvsObject_dockWindow : public KvsObject_widget public: KVSO_DECLARE_OBJECT(KvsObject_dockWindow) protected: - virtual bool init(KviKvsRunTimeContext * pContext,KviKvsVariantList *pParams); + virtual bool init(KviKvsRunTimeContext * pContext, KviKvsVariantList * pParams); - bool addWidget(KviKvsObjectFunctionCall *c); + bool addWidget(KviKvsObjectFunctionCall * c); bool setAllowedDockAreas(KviKvsObjectFunctionCall * c); bool dock(KviKvsObjectFunctionCall * c); }; diff --git a/src/modules/objects/KvsObject_file.cpp b/src/modules/objects/KvsObject_file.cpp index e0542287a..098ef7d99 100644 --- a/src/modules/objects/KvsObject_file.cpp +++ b/src/modules/objects/KvsObject_file.cpp @@ -23,7 +23,6 @@ // //============================================================================= - #include "KvsObject_file.h" #include "kvi_debug.h" #include "KviLocale.h" @@ -36,8 +35,12 @@ //#include #include -#define CHECK_FILE_IS_OPEN if (!m_pFile->isOpen())\ - {c->warning(__tr2qs_ctx("File is not open!","objects"));return true;} +#define CHECK_FILE_IS_OPEN \ + if(!m_pFile->isOpen()) \ + { \ + c->warning(__tr2qs_ctx("File is not open!", "objects")); \ + return true; \ + } // needed for $open() @@ -59,7 +62,7 @@ const QIODevice::OpenMode mod_cod[] = { QIODevice::Truncate }; -#define mod_num (sizeof(mod_tbl) / sizeof(mod_tbl[0])) +#define mod_num (sizeof(mod_tbl) / sizeof(mod_tbl[0])) /* @doc: file @@ -149,119 +152,119 @@ const QIODevice::OpenMode mod_cod[] = { $writeBlock() */ -KVSO_BEGIN_REGISTERCLASS(KvsObject_file,"file","object") - KVSO_REGISTER_HANDLER(KvsObject_file,"setName",setName) - KVSO_REGISTER_HANDLER(KvsObject_file,"name",name) +KVSO_BEGIN_REGISTERCLASS(KvsObject_file, "file", "object") +KVSO_REGISTER_HANDLER(KvsObject_file, "setName", setName) +KVSO_REGISTER_HANDLER(KvsObject_file, "name", name) - KVSO_REGISTER_HANDLER(KvsObject_file,"open",open) - KVSO_REGISTER_HANDLER(KvsObject_file,"isOpen",isOpen) - KVSO_REGISTER_HANDLER(KvsObject_file,"close",close) - KVSO_REGISTER_HANDLER(KvsObject_file,"flush",flush) +KVSO_REGISTER_HANDLER(KvsObject_file, "open", open) +KVSO_REGISTER_HANDLER(KvsObject_file, "isOpen", isOpen) +KVSO_REGISTER_HANDLER(KvsObject_file, "close", close) +KVSO_REGISTER_HANDLER(KvsObject_file, "flush", flush) - KVSO_REGISTER_HANDLER(KvsObject_file,"size",size) - KVSO_REGISTER_HANDLER(KvsObject_file,"resize",resize) +KVSO_REGISTER_HANDLER(KvsObject_file, "size", size) +KVSO_REGISTER_HANDLER(KvsObject_file, "resize", resize) - KVSO_REGISTER_HANDLER(KvsObject_file,"atEnd",atEnd) - KVSO_REGISTER_HANDLER(KvsObject_file,"where",where) - KVSO_REGISTER_HANDLER(KvsObject_file,"seek",seek) +KVSO_REGISTER_HANDLER(KvsObject_file, "atEnd", atEnd) +KVSO_REGISTER_HANDLER(KvsObject_file, "where", where) +KVSO_REGISTER_HANDLER(KvsObject_file, "seek", seek) - KVSO_REGISTER_HANDLER(KvsObject_file,"putch",putch) - KVSO_REGISTER_HANDLER(KvsObject_file,"getch",getch) - KVSO_REGISTER_HANDLER(KvsObject_file,"ungetch",unGetch) - KVSO_REGISTER_HANDLER(KvsObject_file,"readByte",readByte) +KVSO_REGISTER_HANDLER(KvsObject_file, "putch", putch) +KVSO_REGISTER_HANDLER(KvsObject_file, "getch", getch) +KVSO_REGISTER_HANDLER(KvsObject_file, "ungetch", unGetch) +KVSO_REGISTER_HANDLER(KvsObject_file, "readByte", readByte) - KVSO_REGISTER_HANDLER(KvsObject_file,"readBlock",readBlock) - KVSO_REGISTER_HANDLER(KvsObject_file,"writeBlock", writeBlock) +KVSO_REGISTER_HANDLER(KvsObject_file, "readBlock", readBlock) +KVSO_REGISTER_HANDLER(KvsObject_file, "writeBlock", writeBlock) - KVSO_REGISTER_HANDLER(KvsObject_file,"readHexBlock",readHexBlock) - KVSO_REGISTER_HANDLER(KvsObject_file,"writeHexBlock",writeHexBlock) +KVSO_REGISTER_HANDLER(KvsObject_file, "readHexBlock", readHexBlock) +KVSO_REGISTER_HANDLER(KvsObject_file, "writeHexBlock", writeHexBlock) - KVSO_REGISTER_HANDLER(KvsObject_file,"readLine",readLine) - KVSO_REGISTER_HANDLER(KvsObject_file,"writeLine",writeLine) - - KVSO_REGISTER_HANDLER(KvsObject_file,"write",write) - KVSO_REGISTER_HANDLER(KvsObject_file,"read",read) +KVSO_REGISTER_HANDLER(KvsObject_file, "readLine", readLine) +KVSO_REGISTER_HANDLER(KvsObject_file, "writeLine", writeLine) +KVSO_REGISTER_HANDLER(KvsObject_file, "write", write) +KVSO_REGISTER_HANDLER(KvsObject_file, "read", read) KVSO_END_REGISTERCLASS(KvsObject_file) - -KVSO_BEGIN_CONSTRUCTOR(KvsObject_file,KvsObject_widget) - m_pFile = new KviFile(); +KVSO_BEGIN_CONSTRUCTOR(KvsObject_file, KvsObject_widget) +m_pFile = new KviFile(); KVSO_END_CONSTRUCTOR(KvsObject_file) KVSO_BEGIN_DESTRUCTOR(KvsObject_file) - if (m_pFile) delete m_pFile; +if(m_pFile) + delete m_pFile; KVSO_END_CONSTRUCTOR(KvsObject_file) -KVSO_CLASS_FUNCTION(file,setName) +KVSO_CLASS_FUNCTION(file, setName) { CHECK_INTERNAL_POINTER(m_pFile) QString szName; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("file_name",KVS_PT_STRING,0,szName) + KVSO_PARAMETER("file_name", KVS_PT_STRING, 0, szName) KVSO_PARAMETERS_END(c) m_pFile->setFileName(szName); return true; } -KVSO_CLASS_FUNCTION(file,name) +KVSO_CLASS_FUNCTION(file, name) { CHECK_INTERNAL_POINTER(m_pFile) c->returnValue()->setString(m_pFile->fileName()); return true; } -KVSO_CLASS_FUNCTION(file,open) +KVSO_CLASS_FUNCTION(file, open) { CHECK_INTERNAL_POINTER(m_pFile) QStringList modes; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("file_mode",KVS_PT_STRINGLIST,KVS_PF_OPTIONAL,modes) + KVSO_PARAMETER("file_mode", KVS_PT_STRINGLIST, KVS_PF_OPTIONAL, modes) KVSO_PARAMETERS_END(c) if(m_pFile->fileName().isEmpty()) { - c->warning(__tr2qs_ctx("Empty filename string","objects")); + c->warning(__tr2qs_ctx("Empty filename string", "objects")); return true; } - QIODevice::OpenMode mod,sum; - if (modes.empty()) sum = QIODevice::ReadWrite|QIODevice::Append; // if no parameters given, default to ReadWrite | Append + QIODevice::OpenMode mod, sum; + if(modes.empty()) + sum = QIODevice::ReadWrite | QIODevice::Append; // if no parameters given, default to ReadWrite | Append else { - for ( int idx=0;idxwarning(__tr2qs_ctx("No such open mode '%Q'","objects"),&modes.at(idx)); + c->warning(__tr2qs_ctx("No such open mode '%Q'", "objects"), &modes.at(idx)); } } c->returnValue()->setBoolean(m_pFile->open(sum)); return true; } -KVSO_CLASS_FUNCTION(file,isOpen) +KVSO_CLASS_FUNCTION(file, isOpen) { CHECK_INTERNAL_POINTER(m_pFile) c->returnValue()->setBoolean(m_pFile->isOpen()); return true; } -KVSO_CLASS_FUNCTION(file,close) +KVSO_CLASS_FUNCTION(file, close) { CHECK_INTERNAL_POINTER(m_pFile) CHECK_FILE_IS_OPEN @@ -269,7 +272,7 @@ KVSO_CLASS_FUNCTION(file,close) return true; } -KVSO_CLASS_FUNCTION(file,flush) +KVSO_CLASS_FUNCTION(file, flush) { CHECK_INTERNAL_POINTER(m_pFile) CHECK_FILE_IS_OPEN @@ -277,21 +280,21 @@ KVSO_CLASS_FUNCTION(file,flush) return true; } -KVSO_CLASS_FUNCTION(file,size) +KVSO_CLASS_FUNCTION(file, size) { CHECK_INTERNAL_POINTER(m_pFile) c->returnValue()->setInteger((kvs_int_t)(m_pFile->size())); return true; } -KVSO_CLASS_FUNCTION(file,atEnd) +KVSO_CLASS_FUNCTION(file, atEnd) { CHECK_INTERNAL_POINTER(m_pFile) c->returnValue()->setInteger((kvs_int_t)(m_pFile->atEnd())); return true; } -KVSO_CLASS_FUNCTION(file,where) +KVSO_CLASS_FUNCTION(file, where) { CHECK_INTERNAL_POINTER(m_pFile) CHECK_FILE_IS_OPEN @@ -299,81 +302,85 @@ KVSO_CLASS_FUNCTION(file,where) return true; } -KVSO_CLASS_FUNCTION(file,seek) +KVSO_CLASS_FUNCTION(file, seek) { CHECK_INTERNAL_POINTER(m_pFile) kvs_uint_t uIndex; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("index",KVS_PT_UNSIGNEDINTEGER,0,uIndex) + KVSO_PARAMETER("index", KVS_PT_UNSIGNEDINTEGER, 0, uIndex) KVSO_PARAMETERS_END(c) CHECK_FILE_IS_OPEN m_pFile->seek(uIndex); return true; } - -KVSO_CLASS_FUNCTION(file,resize) +KVSO_CLASS_FUNCTION(file, resize) { CHECK_INTERNAL_POINTER(m_pFile) kvs_int_t iSize; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("size",KVS_PT_INTEGER,0,iSize) + KVSO_PARAMETER("size", KVS_PT_INTEGER, 0, iSize) KVSO_PARAMETERS_END(c) CHECK_FILE_IS_OPEN m_pFile->resize(iSize); return true; } -KVSO_CLASS_FUNCTION(file,putch) +KVSO_CLASS_FUNCTION(file, putch) { CHECK_INTERNAL_POINTER(m_pFile) QString szChar; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("char",KVS_PT_STRING,0,szChar) + KVSO_PARAMETER("char", KVS_PT_STRING, 0, szChar) KVSO_PARAMETERS_END(c) - if (szChar.length()>1)c->warning(__tr2qs_ctx("Argument too long, using only first char","objects")); - const char *ch=szChar.toUtf8().data(); - if (!m_pFile->putChar(ch[0])) c->warning(__tr2qs_ctx("Write error occurred!","objects")); + if(szChar.length() > 1) + c->warning(__tr2qs_ctx("Argument too long, using only first char", "objects")); + const char * ch = szChar.toUtf8().data(); + if(!m_pFile->putChar(ch[0])) + c->warning(__tr2qs_ctx("Write error occurred!", "objects")); return true; } -KVSO_CLASS_FUNCTION(file,getch) +KVSO_CLASS_FUNCTION(file, getch) { CHECK_INTERNAL_POINTER(m_pFile) CHECK_FILE_IS_OPEN char ch; - if (!m_pFile->getChar(&ch)) c->warning(__tr2qs_ctx("Read error occurred!","objects")); // c->error ? + if(!m_pFile->getChar(&ch)) + c->warning(__tr2qs_ctx("Read error occurred!", "objects")); // c->error ? QString szChar = QChar(ch); c->returnValue()->setString(szChar); return true; } -KVSO_CLASS_FUNCTION(file,readByte) +KVSO_CLASS_FUNCTION(file, readByte) { CHECK_INTERNAL_POINTER(m_pFile) CHECK_FILE_IS_OPEN char ch; - if (!m_pFile->getChar(&ch)) c->warning(__tr2qs_ctx("Read error occurred!","objects")); // c->error ? + if(!m_pFile->getChar(&ch)) + c->warning(__tr2qs_ctx("Read error occurred!", "objects")); // c->error ? //QString szChar = QChar(ch); - c->returnValue()->setInteger((kvs_int_t) ch); + c->returnValue()->setInteger((kvs_int_t)ch); return true; } -KVSO_CLASS_FUNCTION(file,unGetch) +KVSO_CLASS_FUNCTION(file, unGetch) { CHECK_INTERNAL_POINTER(m_pFile) CHECK_FILE_IS_OPEN QString szChar; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("char",KVS_PT_STRING,0,szChar) + KVSO_PARAMETER("char", KVS_PT_STRING, 0, szChar) KVSO_PARAMETERS_END(c) - if (szChar.length()>1) c->warning(__tr2qs_ctx("Argument too long, using only the first char","objects")); - const char *ch=szChar.toUtf8().data(); + if(szChar.length() > 1) + c->warning(__tr2qs_ctx("Argument too long, using only the first char", "objects")); + const char * ch = szChar.toUtf8().data(); m_pFile->ungetChar(ch[0]); return true; } -KVSO_CLASS_FUNCTION(file,readBlock) +KVSO_CLASS_FUNCTION(file, readBlock) { CHECK_INTERNAL_POINTER(m_pFile) CHECK_FILE_IS_OPEN @@ -381,22 +388,22 @@ KVSO_CLASS_FUNCTION(file,readBlock) KviKvsObject * pObject; kvs_hobject_t hObject; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("length",KVS_PT_UNSIGNEDINTEGER,0,uLen) - KVSO_PARAMETER("hobject",KVS_PT_HOBJECT,KVS_PF_OPTIONAL,hObject) + KVSO_PARAMETER("length", KVS_PT_UNSIGNEDINTEGER, 0, uLen) + KVSO_PARAMETER("hobject", KVS_PT_HOBJECT, KVS_PF_OPTIONAL, hObject) KVSO_PARAMETERS_END(c) - if (uLen>(kvs_uint_t)m_pFile->size()) - uLen=m_pFile->size(); - if (hObject) + if(uLen > (kvs_uint_t)m_pFile->size()) + uLen = m_pFile->size(); + if(hObject) { - pObject=KviKvsKernel::instance()->objectController()->lookupObject(hObject); - if (!pObject) + pObject = KviKvsKernel::instance()->objectController()->lookupObject(hObject); + if(!pObject) { - c->warning(__tr2qs_ctx("Buffer parameter is not an object","objects")); + c->warning(__tr2qs_ctx("Buffer parameter is not an object", "objects")); return true; } - if (!pObject->inheritsClass("memorybuffer")) + if(!pObject->inheritsClass("memorybuffer")) { - c->warning(__tr2qs_ctx("Buffer parameter is not a memorybuffer object","objects")); + c->warning(__tr2qs_ctx("Buffer parameter is not a memorybuffer object", "objects")); return true; } //m_pFile->flush(); @@ -416,13 +423,13 @@ KVSO_CLASS_FUNCTION(file,readBlock) return true; } -KVSO_CLASS_FUNCTION(file,read) +KVSO_CLASS_FUNCTION(file, read) { CHECK_INTERNAL_POINTER(m_pFile) CHECK_FILE_IS_OPEN QString szType; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("type",KVS_PT_STRING,0,szType) + KVSO_PARAMETER("type", KVS_PT_STRING, 0, szType) KVSO_PARAMETERS_END(c) if(KviQString::equalCI(szType, "String")) { @@ -440,21 +447,21 @@ KVSO_CLASS_FUNCTION(file,read) { QString szData; m_pFile->load(szData); - KviKvsVariant *pVar = KviKvsVariant::unserialize(szData); - if (pVar->isArray()) + KviKvsVariant * pVar = KviKvsVariant::unserialize(szData); + if(pVar->isArray()) c->returnValue()->setArray(pVar->array()); else - c->warning(__tr2qs_ctx("The incoming data is not an array","objects")); + c->warning(__tr2qs_ctx("The incoming data is not an array", "objects")); } else if(KviQString::equalCI(szType, "Dict")) { QString szData; m_pFile->load(szData); - KviKvsVariant *pVar = KviKvsVariant::unserialize(szData); - if (pVar->isHash()) + KviKvsVariant * pVar = KviKvsVariant::unserialize(szData); + if(pVar->isHash()) c->returnValue()->setHash(pVar->hash()); else - c->warning(__tr2qs_ctx("The incoming data is not a dictionary","objects")); + c->warning(__tr2qs_ctx("The incoming data is not a dictionary", "objects")); } else if(KviQString::equalCI(szType, "String")) { @@ -464,26 +471,26 @@ KVSO_CLASS_FUNCTION(file,read) } else { - c->warning(__tr2qs_ctx("Unsupported datatype '%Q'","objects"),&szType); + c->warning(__tr2qs_ctx("Unsupported datatype '%Q'", "objects"), &szType); } return true; } -KVSO_CLASS_FUNCTION(file,write) +KVSO_CLASS_FUNCTION(file, write) { CHECK_INTERNAL_POINTER(m_pFile) CHECK_FILE_IS_OPEN KviKvsVariant * pVariantData; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("variant_data",KVS_PT_VARIANT,0,pVariantData) + KVSO_PARAMETER("variant_data", KVS_PT_VARIANT, 0, pVariantData) KVSO_PARAMETERS_END(c) - if (pVariantData->isInteger()) + if(pVariantData->isInteger()) { kvs_int_t num; pVariantData->asInteger(num); m_pFile->save(num); } - if (pVariantData->isHash() || pVariantData->isArray() || pVariantData->isString()) + if(pVariantData->isHash() || pVariantData->isArray() || pVariantData->isString()) { QString szTmp; pVariantData->serialize(szTmp); @@ -492,7 +499,7 @@ KVSO_CLASS_FUNCTION(file,write) return true; } -KVSO_CLASS_FUNCTION(file,writeBlock) +KVSO_CLASS_FUNCTION(file, writeBlock) { CHECK_INTERNAL_POINTER(m_pFile) kvs_uint_t uLen; @@ -500,51 +507,54 @@ KVSO_CLASS_FUNCTION(file,writeBlock) KviKvsVariant * pVariantData; kvs_hobject_t hObject; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("string_or_hobject",KVS_PT_VARIANT,0,pVariantData) - KVSO_PARAMETER("length",KVS_PT_UNSIGNEDINTEGER,KVS_PF_OPTIONAL,uLen) + KVSO_PARAMETER("string_or_hobject", KVS_PT_VARIANT, 0, pVariantData) + KVSO_PARAMETER("length", KVS_PT_UNSIGNEDINTEGER, KVS_PF_OPTIONAL, uLen) KVSO_PARAMETERS_END(c) - if(!m_pFile->isOpen())c->warning(__tr2qs_ctx("File is not open!","objects")); + if(!m_pFile->isOpen()) + c->warning(__tr2qs_ctx("File is not open!", "objects")); else { - if (pVariantData->isHObject()) + if(pVariantData->isHObject()) { pVariantData->asHObject(hObject); - pObject=KviKvsKernel::instance()->objectController()->lookupObject(hObject); - if (!pObject) + pObject = KviKvsKernel::instance()->objectController()->lookupObject(hObject); + if(!pObject) { - c->warning(__tr2qs_ctx("Buffer parameter is not an object","objects")); + c->warning(__tr2qs_ctx("Buffer parameter is not an object", "objects")); return true; } - if (pObject->inheritsClass("memorybuffer")) + if(pObject->inheritsClass("memorybuffer")) { - if (!uLen) + if(!uLen) { - if (((KvsObject_memoryBuffer *)pObject)->pBuffer()->size()) - uLen=((KvsObject_memoryBuffer *)pObject)->pBuffer()->size(); + if(((KvsObject_memoryBuffer *)pObject)->pBuffer()->size()) + uLen = ((KvsObject_memoryBuffer *)pObject)->pBuffer()->size(); else { - c->warning(__tr2qs_ctx("The memoryBuffer object is empty: nothing will be saved","objects")); + c->warning(__tr2qs_ctx("The memoryBuffer object is empty: nothing will be saved", "objects")); } } - const char *pData=((KvsObject_memoryBuffer *)pObject)->pBuffer()->data(); - int rlen=m_pFile->write(pData,uLen); + const char * pData = ((KvsObject_memoryBuffer *)pObject)->pBuffer()->data(); + int rlen = m_pFile->write(pData, uLen); c->returnValue()->setInteger(rlen); //m_pFile->flush(); - } else { - c->warning(__tr2qs_ctx("Buffer parameter is not a memorybuffer object","objects")); + } + else + { + c->warning(__tr2qs_ctx("Buffer parameter is not a memorybuffer object", "objects")); return true; } - } else { - if (!pVariantData->isString()){ - c->warning(__tr2qs_ctx("Block parameter must be a string or a memorybuffer object","objects")); + if(!pVariantData->isString()) + { + c->warning(__tr2qs_ctx("Block parameter must be a string or a memorybuffer object", "objects")); return true; } QString szBlock; pVariantData->asString(szBlock); - const char *block=szBlock.toUtf8().data(); + const char * block = szBlock.toUtf8().data(); int rlen = m_pFile->write(block, uLen); c->returnValue()->setInteger(rlen); //m_pFile->flush(); @@ -553,96 +563,101 @@ KVSO_CLASS_FUNCTION(file,writeBlock) return true; } -KVSO_CLASS_FUNCTION(file,readLine) +KVSO_CLASS_FUNCTION(file, readLine) { CHECK_INTERNAL_POINTER(m_pFile) CHECK_FILE_IS_OPEN QString buffer; //bool ok=KviFileUtils::readLine(m_pFile,buffer); - buffer=m_pFile->readLine(); + buffer = m_pFile->readLine(); c->returnValue()->setString(buffer); return true; } -KVSO_CLASS_FUNCTION(file,writeLine) +KVSO_CLASS_FUNCTION(file, writeLine) { CHECK_INTERNAL_POINTER(m_pFile) CHECK_FILE_IS_OPEN QString szLine; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("text_line",KVS_PT_STRING,0,szLine) + KVSO_PARAMETER("text_line", KVS_PT_STRING, 0, szLine) KVSO_PARAMETERS_END(c) QTextStream ts(m_pFile); ts << szLine; return true; } -KVSO_CLASS_FUNCTION(file,readHexBlock) +KVSO_CLASS_FUNCTION(file, readHexBlock) { CHECK_INTERNAL_POINTER(m_pFile) CHECK_FILE_IS_OPEN kvs_uint_t uLen; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("length",KVS_PT_UNSIGNEDINTEGER,0,uLen) + KVSO_PARAMETER("length", KVS_PT_UNSIGNEDINTEGER, 0, uLen) KVSO_PARAMETERS_END(c) - if (uLen>(kvs_uint_t)m_pFile->size()) uLen=m_pFile->size(); + if(uLen > (kvs_uint_t)m_pFile->size()) + uLen = m_pFile->size(); char * buff = new char[uLen]; - char * str = new char [(uLen*2)+1]; + char * str = new char[(uLen * 2) + 1]; m_pFile->flush(); // advice from QFile man page (to avoid trash) int rlen = m_pFile->read(buff, uLen); - int index=0; - unsigned char byte,msb,lsb=0; - for (int i=0;i>4; - msb>9?msb+='7':msb+='0'; - lsb>9?lsb+='7':lsb+='0'; - str[index++]=msb; - str[index++]=lsb; + byte = (unsigned char)buff[i]; + lsb = byte & 0x0f; + msb = byte >> 4; + msb > 9 ? msb += '7' : msb += '0'; + lsb > 9 ? lsb += '7' : lsb += '0'; + str[index++] = msb; + str[index++] = lsb; } - str[index]='\0'; + str[index] = '\0'; c->returnValue()->setString(str); delete[] str; delete[] buff; return true; } -KVSO_CLASS_FUNCTION(file,writeHexBlock) +KVSO_CLASS_FUNCTION(file, writeHexBlock) { CHECK_INTERNAL_POINTER(m_pFile) CHECK_FILE_IS_OPEN QString szBlock; kvs_uint_t uLen; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("text_block",KVS_PT_STRING,0,szBlock) - KVSO_PARAMETER("length",KVS_PT_UNSIGNEDINTEGER,KVS_PF_OPTIONAL,uLen) + KVSO_PARAMETER("text_block", KVS_PT_STRING, 0, szBlock) + KVSO_PARAMETER("length", KVS_PT_UNSIGNEDINTEGER, KVS_PF_OPTIONAL, uLen) KVSO_PARAMETERS_END(c) - if (szBlock.length()%2) + if(szBlock.length() % 2) { - c->warning(__tr2qs_ctx("Length of hex string is not multiple of 2","objects")); + c->warning(__tr2qs_ctx("Length of hex string is not multiple of 2", "objects")); return true; } - if (uLen>((uint)szBlock.length()/2)|| !uLen) uLen=szBlock.length(); - else uLen*=2; - unsigned char byte,lsb,msb; - for(unsigned int i=0;i ((uint)szBlock.length() / 2) || !uLen) + uLen = szBlock.length(); + else + uLen *= 2; + unsigned char byte, lsb, msb; + for(unsigned int i = 0; i < uLen; i += 2) { - msb=szBlock.at(i).toLatin1(); - lsb=szBlock.at(i+1).toLatin1(); + msb = szBlock.at(i).toLatin1(); + lsb = szBlock.at(i + 1).toLatin1(); - if (((msb>='A' && msb<='F')||(msb>='0' && msb<='9')) && ((lsb>='A' && lsb<='F')|| (lsb>='0' && lsb<='9'))) + if(((msb >= 'A' && msb <= 'F') || (msb >= '0' && msb <= '9')) && ((lsb >= 'A' && lsb <= 'F') || (lsb >= '0' && lsb <= '9'))) + { + msb >= 'A' ? msb -= '7' : msb -= '0'; + lsb >= 'A' ? lsb -= '7' : lsb -= '0'; + } + else { - msb>='A'?msb-='7':msb-='0'; - lsb>='A'?lsb-='7':lsb-='0'; - } else{ - c->warning(__tr2qs_ctx("The hex string is not correct!","objects")); + c->warning(__tr2qs_ctx("The hex string is not correct!", "objects")); return true; } - byte=(msb*16)+lsb; + byte = (msb * 16) + lsb; m_pFile->putChar(byte); } - c->returnValue()->setInteger(uLen/2); + c->returnValue()->setInteger(uLen / 2); return true; } diff --git a/src/modules/objects/KvsObject_file.h b/src/modules/objects/KvsObject_file.h index b28d19588..a19a0c220 100644 --- a/src/modules/objects/KvsObject_file.h +++ b/src/modules/objects/KvsObject_file.h @@ -29,46 +29,45 @@ #include "KvsObject_widget.h" #include "KviFile.h" - class KvsObject_file : public KvsObject_widget { public: KVSO_DECLARE_OBJECT(KvsObject_file) protected: KviFile * m_pFile; -public: - KviFile * file(){ return m_pFile; }; - bool setName(KviKvsObjectFunctionCall *c); - bool name(KviKvsObjectFunctionCall *c); - bool open(KviKvsObjectFunctionCall *c); - bool isOpen(KviKvsObjectFunctionCall *c); - bool close(KviKvsObjectFunctionCall *c); - bool flush(KviKvsObjectFunctionCall *c); - bool size(KviKvsObjectFunctionCall *c); - bool resize(KviKvsObjectFunctionCall *c); +public: + KviFile * file() { return m_pFile; }; + bool setName(KviKvsObjectFunctionCall * c); + bool name(KviKvsObjectFunctionCall * c); + bool open(KviKvsObjectFunctionCall * c); + bool isOpen(KviKvsObjectFunctionCall * c); + bool close(KviKvsObjectFunctionCall * c); + bool flush(KviKvsObjectFunctionCall * c); + bool size(KviKvsObjectFunctionCall * c); + bool resize(KviKvsObjectFunctionCall * c); - bool atEnd(KviKvsObjectFunctionCall *c); + bool atEnd(KviKvsObjectFunctionCall * c); // int QFile at() const - bool where(KviKvsObjectFunctionCall *c); + bool where(KviKvsObjectFunctionCall * c); // void QFile at(int) - bool seek(KviKvsObjectFunctionCall *c); - bool putch(KviKvsObjectFunctionCall *c); - bool getch(KviKvsObjectFunctionCall *c); - bool readByte(KviKvsObjectFunctionCall *c); - bool unGetch(KviKvsObjectFunctionCall *c); + bool seek(KviKvsObjectFunctionCall * c); + bool putch(KviKvsObjectFunctionCall * c); + bool getch(KviKvsObjectFunctionCall * c); + bool readByte(KviKvsObjectFunctionCall * c); + bool unGetch(KviKvsObjectFunctionCall * c); - bool readBlock(KviKvsObjectFunctionCall *c); - bool writeBlock(KviKvsObjectFunctionCall *c); + bool readBlock(KviKvsObjectFunctionCall * c); + bool writeBlock(KviKvsObjectFunctionCall * c); - bool readLine(KviKvsObjectFunctionCall *c); - bool writeLine(KviKvsObjectFunctionCall *c); + bool readLine(KviKvsObjectFunctionCall * c); + bool writeLine(KviKvsObjectFunctionCall * c); - bool readHexBlock(KviKvsObjectFunctionCall *c); - bool writeHexBlock(KviKvsObjectFunctionCall *c); + bool readHexBlock(KviKvsObjectFunctionCall * c); + bool writeHexBlock(KviKvsObjectFunctionCall * c); - bool write(KviKvsObjectFunctionCall *c); - bool read(KviKvsObjectFunctionCall *c); + bool write(KviKvsObjectFunctionCall * c); + bool read(KviKvsObjectFunctionCall * c); }; -#endif // !_CLASS_FILE_H_ +#endif // !_CLASS_FILE_H_ diff --git a/src/modules/objects/KvsObject_ftp.cpp b/src/modules/objects/KvsObject_ftp.cpp index 5b25cda6a..183edcdb0 100644 --- a/src/modules/objects/KvsObject_ftp.cpp +++ b/src/modules/objects/KvsObject_ftp.cpp @@ -24,7 +24,6 @@ #include "KvsObject_ftp.h" - #include "kvi_debug.h" #include "KviError.h" @@ -91,131 +90,129 @@ This signal is emitted by the default implementation of [classfnc]$dataTransferProgressEvent[/classfnc]() */ -KVSO_BEGIN_REGISTERCLASS(KvsObject_ftp,"ftp","object") - KVSO_REGISTER_HANDLER(KvsObject_ftp,"connect",functionConnect) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_ftp,abort) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_ftp,close) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_ftp,login) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_ftp,get) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_ftp,put) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_ftp,cd) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_ftp,list) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_ftp,commandFinishedEvent) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_ftp,listInfoEvent) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_ftp,stateChangedEvent) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_ftp,dataTransferProgressEvent) +KVSO_BEGIN_REGISTERCLASS(KvsObject_ftp, "ftp", "object") +KVSO_REGISTER_HANDLER(KvsObject_ftp, "connect", functionConnect) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_ftp, abort) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_ftp, close) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_ftp, login) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_ftp, get) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_ftp, put) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_ftp, cd) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_ftp, list) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_ftp, commandFinishedEvent) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_ftp, listInfoEvent) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_ftp, stateChangedEvent) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_ftp, dataTransferProgressEvent) KVSO_END_REGISTERCLASS(KvsObject_ftp) - -KVSO_BEGIN_CONSTRUCTOR(KvsObject_ftp,KviKvsObject) - m_pFtp = new QFtp(); - connect(m_pFtp,SIGNAL(commandFinished(int,bool)),this,SLOT(slotCommandFinished(int,bool))); - connect(m_pFtp,SIGNAL(commandStarted(int)),this,SLOT(slotCommandStarted(int))); - connect(m_pFtp,SIGNAL(dataTransferProgress(qint64,qint64)),this,SLOT(slotDataTransferProgress(qint64,qint64))); - connect(m_pFtp,SIGNAL(done(bool)),this,SLOT(slotDone(bool))); - connect(m_pFtp,SIGNAL(listInfo(const QUrlInfo)),this,SLOT(slotListInfo(const QUrlInfo))); - connect(m_pFtp,SIGNAL(readyRead()),this,SLOT(slotReadyRead())); - connect(m_pFtp,SIGNAL(stateChanged(int)),this,SLOT(slotStateChanged(int))); +KVSO_BEGIN_CONSTRUCTOR(KvsObject_ftp, KviKvsObject) +m_pFtp = new QFtp(); +connect(m_pFtp, SIGNAL(commandFinished(int, bool)), this, SLOT(slotCommandFinished(int, bool))); +connect(m_pFtp, SIGNAL(commandStarted(int)), this, SLOT(slotCommandStarted(int))); +connect(m_pFtp, SIGNAL(dataTransferProgress(qint64, qint64)), this, SLOT(slotDataTransferProgress(qint64, qint64))); +connect(m_pFtp, SIGNAL(done(bool)), this, SLOT(slotDone(bool))); +connect(m_pFtp, SIGNAL(listInfo(const QUrlInfo)), this, SLOT(slotListInfo(const QUrlInfo))); +connect(m_pFtp, SIGNAL(readyRead()), this, SLOT(slotReadyRead())); +connect(m_pFtp, SIGNAL(stateChanged(int)), this, SLOT(slotStateChanged(int))); KVSO_END_CONSTRUCTOR(KvsObject_ftp) KVSO_BEGIN_DESTRUCTOR(KvsObject_ftp) - delete m_pFtp; +delete m_pFtp; KVSO_END_DESTRUCTOR(KvsObject_ftp) //---------------------- - - -KVSO_CLASS_FUNCTION(ftp,functionConnect) +KVSO_CLASS_FUNCTION(ftp, functionConnect) { CHECK_INTERNAL_POINTER(m_pFtp) QString szHost; kvs_uint_t uRemotePort; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("host",KVS_PT_STRING,0,szHost) - KVSO_PARAMETER("remote_port",KVS_PT_UNSIGNEDINTEGER,KVS_PF_OPTIONAL,uRemotePort) + KVSO_PARAMETER("host", KVS_PT_STRING, 0, szHost) + KVSO_PARAMETER("remote_port", KVS_PT_UNSIGNEDINTEGER, KVS_PF_OPTIONAL, uRemotePort) KVSO_PARAMETERS_END(c) - if (!uRemotePort) uRemotePort=21; - kvs_uint_t id=0; - id=m_pFtp->connectToHost(szHost, uRemotePort); + if(!uRemotePort) + uRemotePort = 21; + kvs_uint_t id = 0; + id = m_pFtp->connectToHost(szHost, uRemotePort); c->returnValue()->setInteger(id); return true; } -KVSO_CLASS_FUNCTION(ftp,login) +KVSO_CLASS_FUNCTION(ftp, login) { CHECK_INTERNAL_POINTER(m_pFtp) - QString szUser,szPass; + QString szUser, szPass; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("user",KVS_PT_STRING,0,szUser) - KVSO_PARAMETER("password",KVS_PT_STRING,0,szPass) + KVSO_PARAMETER("user", KVS_PT_STRING, 0, szUser) + KVSO_PARAMETER("password", KVS_PT_STRING, 0, szPass) KVSO_PARAMETERS_END(c) - int id=m_pFtp->login(szUser, szPass); + int id = m_pFtp->login(szUser, szPass); c->returnValue()->setInteger(id); return true; } -KVSO_CLASS_FUNCTION(ftp,get) +KVSO_CLASS_FUNCTION(ftp, get) { CHECK_INTERNAL_POINTER(m_pFtp) - QString szFile,szDest; + QString szFile, szDest; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("remote_filename",KVS_PT_STRING,0,szFile) - KVSO_PARAMETER("local_filename",KVS_PT_STRING,0,szDest) + KVSO_PARAMETER("remote_filename", KVS_PT_STRING, 0, szFile) + KVSO_PARAMETER("local_filename", KVS_PT_STRING, 0, szDest) KVSO_PARAMETERS_END(c) - QFile *pFile; - pFile=new QFile(szDest); + QFile * pFile; + pFile = new QFile(szDest); pFile->open(QIODevice::WriteOnly); - int id=m_pFtp->get(szFile,pFile); + int id = m_pFtp->get(szFile, pFile); c->returnValue()->setInteger(id); return true; } -KVSO_CLASS_FUNCTION(ftp,put) +KVSO_CLASS_FUNCTION(ftp, put) { CHECK_INTERNAL_POINTER(m_pFtp) - QString szRemoteFile,szLocaleFile; + QString szRemoteFile, szLocaleFile; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("locale_filename",KVS_PT_STRING,0,szLocaleFile) - KVSO_PARAMETER("remote_filename",KVS_PT_STRING,0,szRemoteFile) + KVSO_PARAMETER("locale_filename", KVS_PT_STRING, 0, szLocaleFile) + KVSO_PARAMETER("remote_filename", KVS_PT_STRING, 0, szRemoteFile) KVSO_PARAMETERS_END(c) - QFile *pFile; - pFile=new QFile(szLocaleFile); + QFile * pFile; + pFile = new QFile(szLocaleFile); pFile->open(QIODevice::ReadOnly); - int id=m_pFtp->put(pFile,szRemoteFile); + int id = m_pFtp->put(pFile, szRemoteFile); c->returnValue()->setInteger(id); return true; } -KVSO_CLASS_FUNCTION(ftp,cd) +KVSO_CLASS_FUNCTION(ftp, cd) { CHECK_INTERNAL_POINTER(m_pFtp) QString szPath; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("remote_filename",KVS_PT_STRING,0,szPath) + KVSO_PARAMETER("remote_filename", KVS_PT_STRING, 0, szPath) KVSO_PARAMETERS_END(c) - int id=m_pFtp->cd(szPath); + int id = m_pFtp->cd(szPath); c->returnValue()->setInteger(id); return true; } -KVSO_CLASS_FUNCTION(ftp,list) +KVSO_CLASS_FUNCTION(ftp, list) { CHECK_INTERNAL_POINTER(m_pFtp) QString szPath; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("remote_dir",KVS_PT_STRING,0,szPath) + KVSO_PARAMETER("remote_dir", KVS_PT_STRING, 0, szPath) KVSO_PARAMETERS_END(c) - int id=m_pFtp->list(szPath); + int id = m_pFtp->list(szPath); c->returnValue()->setInteger(id); return true; } -KVSO_CLASS_FUNCTION(ftp,abort) +KVSO_CLASS_FUNCTION(ftp, abort) { CHECK_INTERNAL_POINTER(m_pFtp) m_pFtp->abort(); return true; } -KVSO_CLASS_FUNCTION(ftp,close) +KVSO_CLASS_FUNCTION(ftp, close) { CHECK_INTERNAL_POINTER(m_pFtp) m_pFtp->close(); @@ -223,9 +220,9 @@ KVSO_CLASS_FUNCTION(ftp,close) } //signals & slots -KVSO_CLASS_FUNCTION(ftp,commandFinishedEvent) +KVSO_CLASS_FUNCTION(ftp, commandFinishedEvent) { - emitSignal("commandFinished",c,c->params()); + emitSignal("commandFinished", c, c->params()); return true; } @@ -235,14 +232,30 @@ void KvsObject_ftp::slotCommandFinished(int iId, bool bError) switch(m_pFtp->currentCommand()) { - case QFtp::None: szCommand = "none"; break; - case QFtp::SetTransferMode: szCommand = "setTransferMode"; break; - case QFtp::SetProxy: szCommand = "setProxy"; break; - case QFtp::ConnectToHost: szCommand = "connectToHost"; break; - case QFtp::Login: szCommand = "login"; break; - case QFtp::Close: szCommand = "close"; break; - case QFtp::List: szCommand = "list"; break; - case QFtp::Cd: szCommand = "cd"; break; + case QFtp::None: + szCommand = "none"; + break; + case QFtp::SetTransferMode: + szCommand = "setTransferMode"; + break; + case QFtp::SetProxy: + szCommand = "setProxy"; + break; + case QFtp::ConnectToHost: + szCommand = "connectToHost"; + break; + case QFtp::Login: + szCommand = "login"; + break; + case QFtp::Close: + szCommand = "close"; + break; + case QFtp::List: + szCommand = "list"; + break; + case QFtp::Cd: + szCommand = "cd"; + break; case QFtp::Get: { delete m_pFtp->currentDevice(); @@ -255,80 +268,97 @@ void KvsObject_ftp::slotCommandFinished(int iId, bool bError) szCommand = "put"; break; } - case QFtp::Remove: szCommand = "remove"; break; - case QFtp::Mkdir: szCommand = "mkdir"; break; - case QFtp::Rmdir: szCommand = "rmdir"; break; - case QFtp::Rename: szCommand = "rename"; break; - case QFtp::RawCommand: szCommand = "rawCommand"; break; + case QFtp::Remove: + szCommand = "remove"; + break; + case QFtp::Mkdir: + szCommand = "mkdir"; + break; + case QFtp::Rmdir: + szCommand = "rmdir"; + break; + case QFtp::Rename: + szCommand = "rename"; + break; + case QFtp::RawCommand: + szCommand = "rawCommand"; + break; } KviKvsVariantList lParams; lParams.append(new KviKvsVariant((kvs_int_t)iId)); lParams.append(new KviKvsVariant(szCommand)); lParams.append(new KviKvsVariant(bError)); - if(bError) lParams.append(new KviKvsVariant(m_pFtp->errorString())); - callFunction(this,"commandFinishedEvent",0,&lParams); + if(bError) + lParams.append(new KviKvsVariant(m_pFtp->errorString())); + callFunction(this, "commandFinishedEvent", 0, &lParams); } -void KvsObject_ftp::slotCommandStarted ( int ) +void KvsObject_ftp::slotCommandStarted(int) { } -void KvsObject_ftp::slotDataTransferProgress ( qint64 done, qint64 total ) +void KvsObject_ftp::slotDataTransferProgress(qint64 done, qint64 total) { KviKvsVariantList lParams; - lParams.append(new KviKvsVariant((kvs_int_t) done)); - lParams.append(new KviKvsVariant((kvs_int_t) total)); - callFunction(this,"dataTransferProgressEvent",0,&lParams); + lParams.append(new KviKvsVariant((kvs_int_t)done)); + lParams.append(new KviKvsVariant((kvs_int_t)total)); + callFunction(this, "dataTransferProgressEvent", 0, &lParams); } -KVSO_CLASS_FUNCTION(ftp,dataTransferProgressEvent) +KVSO_CLASS_FUNCTION(ftp, dataTransferProgressEvent) { - emitSignal("dataTransferProgress",c,c->params()); + emitSignal("dataTransferProgress", c, c->params()); return true; } -void KvsObject_ftp::slotDone ( bool ) +void KvsObject_ftp::slotDone(bool) { } -void KvsObject_ftp::slotListInfo ( const QUrlInfo & i ) +void KvsObject_ftp::slotListInfo(const QUrlInfo & i) { KviKvsVariantList lParams; lParams.append(new KviKvsVariant(i.name())); - callFunction(this,"listInfoEvent",0,&lParams); + callFunction(this, "listInfoEvent", 0, &lParams); } -KVSO_CLASS_FUNCTION(ftp,listInfoEvent) +KVSO_CLASS_FUNCTION(ftp, listInfoEvent) { - emitSignal("listInfo",c,c->params()); + emitSignal("listInfo", c, c->params()); return true; } -void KvsObject_ftp::slotReadyRead () +void KvsObject_ftp::slotReadyRead() { } -void KvsObject_ftp::slotRawCommandReply (int, const QString & ) +void KvsObject_ftp::slotRawCommandReply(int, const QString &) { } -void KvsObject_ftp::slotStateChanged (int state) +void KvsObject_ftp::slotStateChanged(int state) { - QString szState=""; - if (state==QFtp::Unconnected) szState="Unconnected"; - else if (state==QFtp::HostLookup) szState="HostLookup"; - else if (state==QFtp::Connecting) szState="Connecting"; - else if (state==QFtp::Connected) szState="Connected"; - else if (state==QFtp::LoggedIn) szState="LoggedIn"; - else if (state==QFtp::Closing) szState="Closing"; + QString szState = ""; + if(state == QFtp::Unconnected) + szState = "Unconnected"; + else if(state == QFtp::HostLookup) + szState = "HostLookup"; + else if(state == QFtp::Connecting) + szState = "Connecting"; + else if(state == QFtp::Connected) + szState = "Connected"; + else if(state == QFtp::LoggedIn) + szState = "LoggedIn"; + else if(state == QFtp::Closing) + szState = "Closing"; KviKvsVariantList lParams; lParams.append(new KviKvsVariant(szState)); - callFunction(this,"stateChangedEvent",0,&lParams); + callFunction(this, "stateChangedEvent", 0, &lParams); } -KVSO_CLASS_FUNCTION(ftp,stateChangedEvent) +KVSO_CLASS_FUNCTION(ftp, stateChangedEvent) { - emitSignal("stateChanged",c,c->params()); + emitSignal("stateChanged", c, c->params()); return true; } diff --git a/src/modules/objects/KvsObject_ftp.h b/src/modules/objects/KvsObject_ftp.h index 653a382fe..cfd28cb5f 100644 --- a/src/modules/objects/KvsObject_ftp.h +++ b/src/modules/objects/KvsObject_ftp.h @@ -26,7 +26,6 @@ #include "object_macros.h" - class QFtp; class QUrlInfo; @@ -39,30 +38,30 @@ class KvsObject_ftp : public KviKvsObject public: KVSO_DECLARE_OBJECT(KvsObject_ftp) protected: - QFtp *m_pFtp; + QFtp * m_pFtp; + protected: - bool functionConnect(KviKvsObjectFunctionCall *c); - bool get(KviKvsObjectFunctionCall *c); - bool put(KviKvsObjectFunctionCall *c); - bool login(KviKvsObjectFunctionCall *c); - bool cd(KviKvsObjectFunctionCall *c); - bool list(KviKvsObjectFunctionCall *c); - bool dataTransferProgressEvent(KviKvsObjectFunctionCall *c); - bool listInfoEvent(KviKvsObjectFunctionCall *c); - bool commandFinishedEvent(KviKvsObjectFunctionCall *c); - bool stateChangedEvent(KviKvsObjectFunctionCall *c); - bool abort(KviKvsObjectFunctionCall *c); - bool close(KviKvsObjectFunctionCall *c); + bool functionConnect(KviKvsObjectFunctionCall * c); + bool get(KviKvsObjectFunctionCall * c); + bool put(KviKvsObjectFunctionCall * c); + bool login(KviKvsObjectFunctionCall * c); + bool cd(KviKvsObjectFunctionCall * c); + bool list(KviKvsObjectFunctionCall * c); + bool dataTransferProgressEvent(KviKvsObjectFunctionCall * c); + bool listInfoEvent(KviKvsObjectFunctionCall * c); + bool commandFinishedEvent(KviKvsObjectFunctionCall * c); + bool stateChangedEvent(KviKvsObjectFunctionCall * c); + bool abort(KviKvsObjectFunctionCall * c); + bool close(KviKvsObjectFunctionCall * c); protected slots: - void slotCommandFinished ( int id, bool error ); - void slotCommandStarted ( int id ); - void slotDataTransferProgress ( qint64 done, qint64 total ); - void slotDone ( bool error ); - void slotListInfo ( const QUrlInfo & i ); - void slotRawCommandReply ( int replyCode, const QString & detail ); - void slotReadyRead (); - void slotStateChanged ( int state); + void slotCommandFinished(int id, bool error); + void slotCommandStarted(int id); + void slotDataTransferProgress(qint64 done, qint64 total); + void slotDone(bool error); + void slotListInfo(const QUrlInfo & i); + void slotRawCommandReply(int replyCode, const QString & detail); + void slotReadyRead(); + void slotStateChanged(int state); }; - #endif //_CLASS_FTP_H_ diff --git a/src/modules/objects/KvsObject_groupBox.cpp b/src/modules/objects/KvsObject_groupBox.cpp index 74d9236fe..7ba81e693 100644 --- a/src/modules/objects/KvsObject_groupBox.cpp +++ b/src/modules/objects/KvsObject_groupBox.cpp @@ -31,7 +31,6 @@ #include "KviLocale.h" #include "KviIconManager.h" - // Tables used in $setAlignment, $alignment and in $setOrientation & $orientation const char * const align_tbl[] = { @@ -46,7 +45,7 @@ const int align_cod[] = { Qt::AlignHCenter }; -#define align_num (sizeof(align_tbl) / sizeof(align_tbl[0])) +#define align_num (sizeof(align_tbl) / sizeof(align_tbl[0])) /* @doc: groupbox @@ -130,159 +129,158 @@ const int align_cod[] = { [/example] */ -KVSO_BEGIN_REGISTERCLASS(KvsObject_groupBox,"groupbox","widget") - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_groupBox,setTitle) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_groupBox,title) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_groupBox,setFlat) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_groupBox,isFlat) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_groupBox,setCheckable) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_groupBox,isCheckable) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_groupBox,setInsideMargin) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_groupBox,insideMargin) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_groupBox,setInsideSpacing) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_groupBox,insideSpacing) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_groupBox,addSpace) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_groupBox,alignment) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_groupBox,setAlignment) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_groupBox,setOrientation) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_groupBox,isChecked) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_groupBox,setChecked) +KVSO_BEGIN_REGISTERCLASS(KvsObject_groupBox, "groupbox", "widget") +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_groupBox, setTitle) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_groupBox, title) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_groupBox, setFlat) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_groupBox, isFlat) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_groupBox, setCheckable) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_groupBox, isCheckable) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_groupBox, setInsideMargin) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_groupBox, insideMargin) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_groupBox, setInsideSpacing) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_groupBox, insideSpacing) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_groupBox, addSpace) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_groupBox, alignment) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_groupBox, setAlignment) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_groupBox, setOrientation) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_groupBox, isChecked) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_groupBox, setChecked) KVSO_END_REGISTERCLASS(KvsObject_groupBox) -KVSO_BEGIN_CONSTRUCTOR(KvsObject_groupBox,KvsObject_widget) +KVSO_BEGIN_CONSTRUCTOR(KvsObject_groupBox, KvsObject_widget) KVSO_END_CONSTRUCTOR(KvsObject_groupBox) - KVSO_BEGIN_DESTRUCTOR(KvsObject_groupBox) KVSO_END_CONSTRUCTOR(KvsObject_groupBox) -bool KvsObject_groupBox::init(KviKvsRunTimeContext *,KviKvsVariantList *) +bool KvsObject_groupBox::init(KviKvsRunTimeContext *, KviKvsVariantList *) { - KviTalGroupBox *groupbox=new KviTalGroupBox(getName(),parentScriptWidget()); + KviTalGroupBox * groupbox = new KviTalGroupBox(getName(), parentScriptWidget()); groupbox->setOrientation(Qt::Horizontal); groupbox->setObjectName(getName()); - setObject(groupbox,true); + setObject(groupbox, true); return true; } -KVSO_CLASS_FUNCTION(groupBox,setTitle) +KVSO_CLASS_FUNCTION(groupBox, setTitle) { CHECK_INTERNAL_POINTER(widget()) QString szTitle; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("title",KVS_PT_STRING,0,szTitle) + KVSO_PARAMETER("title", KVS_PT_STRING, 0, szTitle) KVSO_PARAMETERS_END(c) ((KviTalGroupBox *)widget())->setTitle(szTitle); return true; } -KVSO_CLASS_FUNCTION(groupBox,title) +KVSO_CLASS_FUNCTION(groupBox, title) { CHECK_INTERNAL_POINTER(widget()) c->returnValue()->setString(((KviTalGroupBox *)widget())->title()); return true; } -KVSO_CLASS_FUNCTION(groupBox,setFlat) +KVSO_CLASS_FUNCTION(groupBox, setFlat) { CHECK_INTERNAL_POINTER(widget()) bool bEnabled; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("bFlag",KVS_PT_BOOL,0,bEnabled) + KVSO_PARAMETER("bFlag", KVS_PT_BOOL, 0, bEnabled) KVSO_PARAMETERS_END(c) ((KviTalGroupBox *)widget())->setFlat(bEnabled); return true; } -KVSO_CLASS_FUNCTION(groupBox,isFlat) +KVSO_CLASS_FUNCTION(groupBox, isFlat) { CHECK_INTERNAL_POINTER(widget()) c->returnValue()->setBoolean(((KviTalGroupBox *)widget())->isFlat()); return true; } -KVSO_CLASS_FUNCTION(groupBox,setCheckable) +KVSO_CLASS_FUNCTION(groupBox, setCheckable) { CHECK_INTERNAL_POINTER(widget()) bool bEnabled; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("bFlag",KVS_PT_BOOL,0,bEnabled) + KVSO_PARAMETER("bFlag", KVS_PT_BOOL, 0, bEnabled) KVSO_PARAMETERS_END(c) ((KviTalGroupBox *)widget())->setCheckable(bEnabled); return true; } -KVSO_CLASS_FUNCTION(groupBox,isCheckable) +KVSO_CLASS_FUNCTION(groupBox, isCheckable) { CHECK_INTERNAL_POINTER(widget()) c->returnValue()->setBoolean(((KviTalGroupBox *)widget())->isCheckable()); return true; } -KVSO_CLASS_FUNCTION(groupBox,setChecked) +KVSO_CLASS_FUNCTION(groupBox, setChecked) { CHECK_INTERNAL_POINTER(widget()) bool bEnabled; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("bFlag",KVS_PT_BOOL,0,bEnabled) + KVSO_PARAMETER("bFlag", KVS_PT_BOOL, 0, bEnabled) KVSO_PARAMETERS_END(c) ((KviTalGroupBox *)widget())->setChecked(bEnabled); return true; } -KVSO_CLASS_FUNCTION(groupBox,isChecked) +KVSO_CLASS_FUNCTION(groupBox, isChecked) { CHECK_INTERNAL_POINTER(widget()) c->returnValue()->setBoolean(((KviTalGroupBox *)widget())->isChecked()); return true; } -KVSO_CLASS_FUNCTION(groupBox,setInsideMargin) +KVSO_CLASS_FUNCTION(groupBox, setInsideMargin) { CHECK_INTERNAL_POINTER(widget()) kvs_uint_t uMargin; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("margin",KVS_PT_UNSIGNEDINTEGER,0,uMargin) + KVSO_PARAMETER("margin", KVS_PT_UNSIGNEDINTEGER, 0, uMargin) KVSO_PARAMETERS_END(c) ((KviTalGroupBox *)widget())->setInsideMargin(uMargin); return true; } -KVSO_CLASS_FUNCTION(groupBox,insideMargin) +KVSO_CLASS_FUNCTION(groupBox, insideMargin) { CHECK_INTERNAL_POINTER(widget()) c->returnValue()->setInteger(((KviTalGroupBox *)widget())->insideMargin()); return true; } -KVSO_CLASS_FUNCTION(groupBox,setInsideSpacing) +KVSO_CLASS_FUNCTION(groupBox, setInsideSpacing) { CHECK_INTERNAL_POINTER(widget()) kvs_uint_t uSpacing; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("spacing",KVS_PT_UNSIGNEDINTEGER,0,uSpacing) + KVSO_PARAMETER("spacing", KVS_PT_UNSIGNEDINTEGER, 0, uSpacing) KVSO_PARAMETERS_END(c) ((KviTalGroupBox *)widget())->setInsideSpacing(uSpacing); return true; } -KVSO_CLASS_FUNCTION(groupBox,insideSpacing) +KVSO_CLASS_FUNCTION(groupBox, insideSpacing) { CHECK_INTERNAL_POINTER(widget()) c->returnValue()->setInteger(((KviTalGroupBox *)widget())->insideSpacing()); return true; } -KVSO_CLASS_FUNCTION(groupBox,addSpace) +KVSO_CLASS_FUNCTION(groupBox, addSpace) { CHECK_INTERNAL_POINTER(widget()) kvs_uint_t iSpace; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("columns",KVS_PT_UNSIGNEDINTEGER,0,iSpace) + KVSO_PARAMETER("columns", KVS_PT_UNSIGNEDINTEGER, 0, iSpace) KVSO_PARAMETERS_END(c) (((KviTalGroupBox *)widget())->addSpace(iSpace)); return true; } -KVSO_CLASS_FUNCTION(groupBox,setAlignment) +KVSO_CLASS_FUNCTION(groupBox, setAlignment) { CHECK_INTERNAL_POINTER(widget()) QString szAlign; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("alignment",KVS_PT_STRING,0,szAlign) + KVSO_PARAMETER("alignment", KVS_PT_STRING, 0, szAlign) KVSO_PARAMETERS_END(c) for(unsigned int i = 0; i < align_num; i++) { @@ -292,20 +290,20 @@ KVSO_CLASS_FUNCTION(groupBox,setAlignment) return true; } } - c->warning(__tr2qs_ctx("Unknown alignment '%Q'","objets"),&szAlign); + c->warning(__tr2qs_ctx("Unknown alignment '%Q'", "objets"), &szAlign); return true; } -KVSO_CLASS_FUNCTION(groupBox,alignment) +KVSO_CLASS_FUNCTION(groupBox, alignment) { CHECK_INTERNAL_POINTER(widget()) int mode = ((KviTalGroupBox *)widget())->alignment(); - QString szAlignment=""; + QString szAlignment = ""; for(unsigned int i = 0; i < align_num; i++) { if(mode == align_cod[i]) { - szAlignment=align_tbl[i]; + szAlignment = align_tbl[i]; break; } } @@ -313,19 +311,19 @@ KVSO_CLASS_FUNCTION(groupBox,alignment) return true; } -KVSO_CLASS_FUNCTION(groupBox,setOrientation) +KVSO_CLASS_FUNCTION(groupBox, setOrientation) { CHECK_INTERNAL_POINTER(widget()) QString szMode; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("orientation",KVS_PT_STRING,0,szMode) + KVSO_PARAMETER("orientation", KVS_PT_STRING, 0, szMode) KVSO_PARAMETERS_END(c) if(KviQString::equalCI(szMode, "Horizontal")) ((KviTalGroupBox *)widget())->setOrientation(Qt::Vertical); - else - if(KviQString::equalCI(szMode, "Vertical")) + else if(KviQString::equalCI(szMode, "Vertical")) ((KviTalGroupBox *)widget())->setOrientation(Qt::Horizontal); - else c->warning( __tr2qs_ctx("Unknown orientation '%Q'","objects"),&szMode); + else + c->warning(__tr2qs_ctx("Unknown orientation '%Q'", "objects"), &szMode); return true; } diff --git a/src/modules/objects/KvsObject_groupBox.h b/src/modules/objects/KvsObject_groupBox.h index 610a9c1e9..50cf5a78e 100644 --- a/src/modules/objects/KvsObject_groupBox.h +++ b/src/modules/objects/KvsObject_groupBox.h @@ -25,8 +25,6 @@ // //============================================================================= - - #include #include "KvsObject_widget.h" #include "object_macros.h" @@ -38,25 +36,23 @@ public: public: QWidget * widget() { return (QWidget *)object(); }; protected: - virtual bool init(KviKvsRunTimeContext * pContext,KviKvsVariantList *pParams); - - - bool setTitle(KviKvsObjectFunctionCall *c); - bool title(KviKvsObjectFunctionCall *c); - bool setFlat(KviKvsObjectFunctionCall *c); - bool isFlat(KviKvsObjectFunctionCall *c); - bool setCheckable(KviKvsObjectFunctionCall *c); - bool isCheckable(KviKvsObjectFunctionCall *c); - bool setInsideMargin(KviKvsObjectFunctionCall *c); - bool insideMargin(KviKvsObjectFunctionCall *c); - bool setInsideSpacing(KviKvsObjectFunctionCall *c); - bool insideSpacing(KviKvsObjectFunctionCall *c); - bool addSpace(KviKvsObjectFunctionCall *c); - bool alignment(KviKvsObjectFunctionCall *c); - bool setAlignment(KviKvsObjectFunctionCall *c); - bool setOrientation(KviKvsObjectFunctionCall *c); - bool isChecked(KviKvsObjectFunctionCall *c); - bool setChecked(KviKvsObjectFunctionCall *c); + virtual bool init(KviKvsRunTimeContext * pContext, KviKvsVariantList * pParams); + bool setTitle(KviKvsObjectFunctionCall * c); + bool title(KviKvsObjectFunctionCall * c); + bool setFlat(KviKvsObjectFunctionCall * c); + bool isFlat(KviKvsObjectFunctionCall * c); + bool setCheckable(KviKvsObjectFunctionCall * c); + bool isCheckable(KviKvsObjectFunctionCall * c); + bool setInsideMargin(KviKvsObjectFunctionCall * c); + bool insideMargin(KviKvsObjectFunctionCall * c); + bool setInsideSpacing(KviKvsObjectFunctionCall * c); + bool insideSpacing(KviKvsObjectFunctionCall * c); + bool addSpace(KviKvsObjectFunctionCall * c); + bool alignment(KviKvsObjectFunctionCall * c); + bool setAlignment(KviKvsObjectFunctionCall * c); + bool setOrientation(KviKvsObjectFunctionCall * c); + bool isChecked(KviKvsObjectFunctionCall * c); + bool setChecked(KviKvsObjectFunctionCall * c); }; #endif //!_CLASS_GROUPBOX_H_ diff --git a/src/modules/objects/KvsObject_hBox.cpp b/src/modules/objects/KvsObject_hBox.cpp index 190055c96..7ee0e4f59 100644 --- a/src/modules/objects/KvsObject_hBox.cpp +++ b/src/modules/objects/KvsObject_hBox.cpp @@ -40,8 +40,6 @@ const char * const align_tbl[] = { "Justify" }; - - const int align_cod[] = { Qt::AlignLeft, Qt::AlignRight, @@ -53,7 +51,7 @@ const int align_cod[] = { Qt::AlignJustify, }; -#define align_num (sizeof(align_tbl) / sizeof(align_tbl[0])) +#define align_num (sizeof(align_tbl) / sizeof(align_tbl[0])) /* @doc: hbox @@ -83,120 +81,118 @@ const int align_cod[] = { Valid flags are: Right, Left, Top, Bottom, HCenter, VCenter, Center, Justify */ -KVSO_BEGIN_REGISTERCLASS(KvsObject_hBox,"hbox","widget") - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_hBox,setMargin) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_hBox,setSpacing) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_hBox,setStretchFactor ) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_hBox,addStretch ) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_hBox,setAlignment ) +KVSO_BEGIN_REGISTERCLASS(KvsObject_hBox, "hbox", "widget") +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_hBox, setMargin) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_hBox, setSpacing) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_hBox, setStretchFactor) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_hBox, addStretch) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_hBox, setAlignment) KVSO_END_REGISTERCLASS(KvsObject_hBox) -KVSO_BEGIN_CONSTRUCTOR(KvsObject_hBox,KvsObject_widget) +KVSO_BEGIN_CONSTRUCTOR(KvsObject_hBox, KvsObject_widget) KVSO_END_CONSTRUCTOR(KvsObject_hBox) - KVSO_BEGIN_DESTRUCTOR(KvsObject_hBox) KVSO_END_CONSTRUCTOR(KvsObject_hBox) -bool KvsObject_hBox::init(KviKvsRunTimeContext *,KviKvsVariantList *) +bool KvsObject_hBox::init(KviKvsRunTimeContext *, KviKvsVariantList *) { setObject(new KviTalHBox(parentScriptWidget()), true); return true; } -KVSO_CLASS_FUNCTION(hBox,setMargin) +KVSO_CLASS_FUNCTION(hBox, setMargin) { CHECK_INTERNAL_POINTER(widget()) kvs_uint_t uMargin; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("margin",KVS_PT_UNSIGNEDINTEGER,0,uMargin) + KVSO_PARAMETER("margin", KVS_PT_UNSIGNEDINTEGER, 0, uMargin) KVSO_PARAMETERS_END(c) ((KviTalHBox *)widget())->setMargin(uMargin); return true; } -KVSO_CLASS_FUNCTION(hBox,setSpacing) +KVSO_CLASS_FUNCTION(hBox, setSpacing) { CHECK_INTERNAL_POINTER(widget()) kvs_uint_t uSpacing; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("spacing",KVS_PT_UNSIGNEDINTEGER,0,uSpacing) + KVSO_PARAMETER("spacing", KVS_PT_UNSIGNEDINTEGER, 0, uSpacing) KVSO_PARAMETERS_END(c) ((KviTalHBox *)widget())->setSpacing(uSpacing); return true; } -KVSO_CLASS_FUNCTION(hBox,setStretchFactor) +KVSO_CLASS_FUNCTION(hBox, setStretchFactor) { CHECK_INTERNAL_POINTER(widget()) KviKvsObject * pObject; kvs_hobject_t hObject; kvs_uint_t uStretch; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("widget",KVS_PT_HOBJECT,0,hObject) - KVSO_PARAMETER("stretch",KVS_PT_UNSIGNEDINTEGER,0,uStretch) + KVSO_PARAMETER("widget", KVS_PT_HOBJECT, 0, hObject) + KVSO_PARAMETER("stretch", KVS_PT_UNSIGNEDINTEGER, 0, uStretch) KVSO_PARAMETERS_END(c) - pObject=KviKvsKernel::instance()->objectController()->lookupObject(hObject); + pObject = KviKvsKernel::instance()->objectController()->lookupObject(hObject); CHECK_HOBJECT_IS_WIDGET(pObject) if(((KvsObject_widget *)pObject)->widget()->parentWidget() != widget()) { - c->warning(__tr2qs_ctx("The widget must be a child of this hbox","objects")); + c->warning(__tr2qs_ctx("The widget must be a child of this hbox", "objects")); return true; } - ((KviTalHBox *)widget())->setStretchFactor(((QWidget *)(pObject->object())),uStretch); + ((KviTalHBox *)widget())->setStretchFactor(((QWidget *)(pObject->object())), uStretch); return true; } -KVSO_CLASS_FUNCTION(hBox,addStretch) +KVSO_CLASS_FUNCTION(hBox, addStretch) { CHECK_INTERNAL_POINTER(widget()) kvs_int_t iStretch; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("stretch",KVS_PT_INT,0,iStretch) + KVSO_PARAMETER("stretch", KVS_PT_INT, 0, iStretch) KVSO_PARAMETERS_END(c) ((KviTalHBox *)widget())->addStretch(iStretch); return true; } -KVSO_CLASS_FUNCTION(hBox,setAlignment) +KVSO_CLASS_FUNCTION(hBox, setAlignment) { CHECK_INTERNAL_POINTER(widget()) QStringList alignment; KviKvsObject * pObject; kvs_hobject_t hObject; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("widget",KVS_PT_HOBJECT,0,hObject) - KVSO_PARAMETER("alignment",KVS_PT_STRINGLIST,KVS_PF_OPTIONAL,alignment) + KVSO_PARAMETER("widget", KVS_PT_HOBJECT, 0, hObject) + KVSO_PARAMETER("alignment", KVS_PT_STRINGLIST, KVS_PF_OPTIONAL, alignment) KVSO_PARAMETERS_END(c) - pObject=KviKvsKernel::instance()->objectController()->lookupObject(hObject); + pObject = KviKvsKernel::instance()->objectController()->lookupObject(hObject); CHECK_HOBJECT_IS_WIDGET(pObject) if(((KvsObject_widget *)pObject)->widget()->parentWidget() != widget()) { - c->warning(__tr2qs_ctx("The widget must be a child of this hbox","objects")); + c->warning(__tr2qs_ctx("The widget must be a child of this hbox", "objects")); return true; } - int align,sum=0; - for ( QStringList::Iterator it = alignment.begin(); it != alignment.end(); ++it ) - { + int align, sum = 0; + for(QStringList::Iterator it = alignment.begin(); it != alignment.end(); ++it) + { - align = 0; - for(unsigned int j = 0; j < align_num; j++) + align = 0; + for(unsigned int j = 0; j < align_num; j++) + { + if(KviQString::equalCI((*it), align_tbl[j])) { - if(KviQString::equalCI((*it), align_tbl[j])) - { - align=align_cod[j]; - break; - } + align = align_cod[j]; + break; } - if(align) - sum = sum | align; - else - c->warning(__tr2qs_ctx("Unknown alignment '%Q'","objects"),&(*it)); - } - ((KviTalHBox *)widget())->setAlignment(((QWidget *)(pObject->object())),(Qt::Alignment)sum); + if(align) + sum = sum | align; + else + c->warning(__tr2qs_ctx("Unknown alignment '%Q'", "objects"), &(*it)); + } + ((KviTalHBox *)widget())->setAlignment(((QWidget *)(pObject->object())), (Qt::Alignment)sum); return true; } diff --git a/src/modules/objects/KvsObject_hBox.h b/src/modules/objects/KvsObject_hBox.h index 862aebf3b..ef2ce93ca 100644 --- a/src/modules/objects/KvsObject_hBox.h +++ b/src/modules/objects/KvsObject_hBox.h @@ -34,16 +34,13 @@ public: public: QWidget * widget() { return (QWidget *)object(); }; protected: - virtual bool init(KviKvsRunTimeContext * pContext,KviKvsVariantList *pParams); - - bool setMargin(KviKvsObjectFunctionCall *c); - bool setSpacing(KviKvsObjectFunctionCall *c); - bool setStretchFactor(KviKvsObjectFunctionCall *c); - bool addStretch(KviKvsObjectFunctionCall *c); - bool setAlignment(KviKvsObjectFunctionCall *c); - + virtual bool init(KviKvsRunTimeContext * pContext, KviKvsVariantList * pParams); + bool setMargin(KviKvsObjectFunctionCall * c); + bool setSpacing(KviKvsObjectFunctionCall * c); + bool setStretchFactor(KviKvsObjectFunctionCall * c); + bool addStretch(KviKvsObjectFunctionCall * c); + bool setAlignment(KviKvsObjectFunctionCall * c); }; - #endif //_CLASS_HBOX_H_ diff --git a/src/modules/objects/KvsObject_http.cpp b/src/modules/objects/KvsObject_http.cpp index 7a83bbc10..2840b08d3 100644 --- a/src/modules/objects/KvsObject_http.cpp +++ b/src/modules/objects/KvsObject_http.cpp @@ -35,35 +35,35 @@ #include #ifndef QT_NO_OPENSSL - #include - - const char * const ssl_errors_tbl[] = { - "NoError", - "UnableToGetIssuerCertificate", - "UnableToDecryptCertificateSignature", - "UnableToDecodeIssuerPublicKey", - "CertificateSignatureFailed", - "CertificateNotYetValid", - "CertificateExpired", - "InvalidNotBeforeField", - "InvalidNotAfterField", - "SelfSignedCertificate", - "SelfSignedCertificateInChain", - "UnableToGetLocalIssuerCertificate", - "UnableToVerifyFirstCertificate", - "CertificateRevoked", - "InvalidCaCertificate", - "PathLengthExceeded", - "InvalidPurpose", - "CertificateUntrusted", - "CertificateRejected", - "SubjectIssuerMismatch", - "AuthorityIssuerSerialNumberMismatch", - "NoPeerCertificate", - "HostNameMismatch", - "UnspecifiedError", - "NoSslSupport" - }; +#include + +const char * const ssl_errors_tbl[] = { + "NoError", + "UnableToGetIssuerCertificate", + "UnableToDecryptCertificateSignature", + "UnableToDecodeIssuerPublicKey", + "CertificateSignatureFailed", + "CertificateNotYetValid", + "CertificateExpired", + "InvalidNotBeforeField", + "InvalidNotAfterField", + "SelfSignedCertificate", + "SelfSignedCertificateInChain", + "UnableToGetLocalIssuerCertificate", + "UnableToVerifyFirstCertificate", + "CertificateRevoked", + "InvalidCaCertificate", + "PathLengthExceeded", + "InvalidPurpose", + "CertificateUntrusted", + "CertificateRejected", + "SubjectIssuerMismatch", + "AuthorityIssuerSerialNumberMismatch", + "NoPeerCertificate", + "HostNameMismatch", + "UnspecifiedError", + "NoSslSupport" +}; #endif /* @@ -151,410 +151,451 @@ This signal is emitted by the default implementation of [classfnc]$responseHeaderReceivedEvent[/classfnc]. */ -KVSO_BEGIN_REGISTERCLASS(KvsObject_http,"http","object") - KVSO_REGISTER_HANDLER(KvsObject_http,"get",functionGet) - KVSO_REGISTER_HANDLER(KvsObject_http,"post",functionPost) - KVSO_REGISTER_HANDLER(KvsObject_http,"abort",functionAbort) - KVSO_REGISTER_HANDLER(KvsObject_http,"setHost",functionSetHost) - KVSO_REGISTER_HANDLER(KvsObject_http,"setProxy",functionSetProxy) - KVSO_REGISTER_HANDLER(KvsObject_http,"currentId",functionCurrentId) - KVSO_REGISTER_HANDLER(KvsObject_http,"setUser",functionSetUser) - KVSO_REGISTER_HANDLER(KvsObject_http,"readAll",functionReadAll) - KVSO_REGISTER_HANDLER(KvsObject_http,"errorString",functionErrorString) - KVSO_REGISTER_HANDLER(KvsObject_http,"setFollowRedirect",functionFollowRedirect) - - // events - KVSO_REGISTER_HANDLER(KvsObject_http,"doneEvent",functionDoneEvent) - KVSO_REGISTER_HANDLER(KvsObject_http,"requestFinishedEvent",functionRequestFinishedEvent) - KVSO_REGISTER_HANDLER(KvsObject_http,"requestStartedEvent",functionRequestStartedEvent) - KVSO_REGISTER_HANDLER(KvsObject_http,"responseHeaderReceivedEvent",functionResponseHeaderReceivedEvent) - KVSO_REGISTER_HANDLER(KvsObject_http,"dataReadProgressEvent",functionDataReadProgressEvent) - KVSO_REGISTER_HANDLER(KvsObject_http,"dataSendProgressEvent",functionDataSendProgressEvent) - KVSO_REGISTER_HANDLER(KvsObject_http,"stateChangedEvent",functionStateChangedEvent) - KVSO_REGISTER_HANDLER(KvsObject_http,"readyReadEvent",functionReadyReadEvent) - #ifndef QT_NO_OPENSSL - KVSO_REGISTER_HANDLER(KvsObject_http,"sslErrorsEvent",functionSslErrorsEvent) - KVSO_REGISTER_HANDLER(KvsObject_http,"ignoreSSlErrors",functionIgnoreSslErrors) - #endif +KVSO_BEGIN_REGISTERCLASS(KvsObject_http, "http", "object") +KVSO_REGISTER_HANDLER(KvsObject_http, "get", functionGet) +KVSO_REGISTER_HANDLER(KvsObject_http, "post", functionPost) +KVSO_REGISTER_HANDLER(KvsObject_http, "abort", functionAbort) +KVSO_REGISTER_HANDLER(KvsObject_http, "setHost", functionSetHost) +KVSO_REGISTER_HANDLER(KvsObject_http, "setProxy", functionSetProxy) +KVSO_REGISTER_HANDLER(KvsObject_http, "currentId", functionCurrentId) +KVSO_REGISTER_HANDLER(KvsObject_http, "setUser", functionSetUser) +KVSO_REGISTER_HANDLER(KvsObject_http, "readAll", functionReadAll) +KVSO_REGISTER_HANDLER(KvsObject_http, "errorString", functionErrorString) +KVSO_REGISTER_HANDLER(KvsObject_http, "setFollowRedirect", functionFollowRedirect) + +// events +KVSO_REGISTER_HANDLER(KvsObject_http, "doneEvent", functionDoneEvent) +KVSO_REGISTER_HANDLER(KvsObject_http, "requestFinishedEvent", functionRequestFinishedEvent) +KVSO_REGISTER_HANDLER(KvsObject_http, "requestStartedEvent", functionRequestStartedEvent) +KVSO_REGISTER_HANDLER(KvsObject_http, "responseHeaderReceivedEvent", functionResponseHeaderReceivedEvent) +KVSO_REGISTER_HANDLER(KvsObject_http, "dataReadProgressEvent", functionDataReadProgressEvent) +KVSO_REGISTER_HANDLER(KvsObject_http, "dataSendProgressEvent", functionDataSendProgressEvent) +KVSO_REGISTER_HANDLER(KvsObject_http, "stateChangedEvent", functionStateChangedEvent) +KVSO_REGISTER_HANDLER(KvsObject_http, "readyReadEvent", functionReadyReadEvent) +#ifndef QT_NO_OPENSSL +KVSO_REGISTER_HANDLER(KvsObject_http, "sslErrorsEvent", functionSslErrorsEvent) +KVSO_REGISTER_HANDLER(KvsObject_http, "ignoreSSlErrors", functionIgnoreSslErrors) +#endif KVSO_END_REGISTERCLASS(KvsObject_http) - -KVSO_BEGIN_CONSTRUCTOR(KvsObject_http,KviKvsObject) - m_pHttp = new QHttp(); - m_bAbort=false; - m_bEnableForceRedirect=false; - connect(m_pHttp,SIGNAL(requestFinished(int,bool)),this,SLOT(slotRequestFinished(int,bool))); - connect(m_pHttp,SIGNAL(done(bool)),this,SLOT(slotDone(bool))); - - connect(m_pHttp,SIGNAL(requestStarted(int)),this,SLOT(slotRequestStarted(int))); - connect(m_pHttp,SIGNAL(dataSendProgress(int,int)),this,SLOT(slotDataSendProgress(int,int))); - connect(m_pHttp,SIGNAL(dataReadProgress(int,int)),this,SLOT(slotDataReadProgress(int,int))); - connect(m_pHttp,SIGNAL(responseHeaderReceived ( const QHttpResponseHeader & )),this,SLOT(slotResponseHeaderReceived(const QHttpResponseHeader &))); - connect(m_pHttp,SIGNAL(readyRead ( const QHttpResponseHeader & )),this,SLOT(slotReadyRead(const QHttpResponseHeader &))); - #ifndef QT_NO_OPENSSL - connect(m_pHttp,SIGNAL(sslErrors ( const QList & )),this,SLOT(slotSslErrors(const QList & ))); - #endif - connect(m_pHttp,SIGNAL(stateChanged(int)),this,SLOT(slotStateChanged(int))); +KVSO_BEGIN_CONSTRUCTOR(KvsObject_http, KviKvsObject) +m_pHttp = new QHttp(); +m_bAbort = false; +m_bEnableForceRedirect = false; +connect(m_pHttp, SIGNAL(requestFinished(int, bool)), this, SLOT(slotRequestFinished(int, bool))); +connect(m_pHttp, SIGNAL(done(bool)), this, SLOT(slotDone(bool))); + +connect(m_pHttp, SIGNAL(requestStarted(int)), this, SLOT(slotRequestStarted(int))); +connect(m_pHttp, SIGNAL(dataSendProgress(int, int)), this, SLOT(slotDataSendProgress(int, int))); +connect(m_pHttp, SIGNAL(dataReadProgress(int, int)), this, SLOT(slotDataReadProgress(int, int))); +connect(m_pHttp, SIGNAL(responseHeaderReceived(const QHttpResponseHeader &)), this, SLOT(slotResponseHeaderReceived(const QHttpResponseHeader &))); +connect(m_pHttp, SIGNAL(readyRead(const QHttpResponseHeader &)), this, SLOT(slotReadyRead(const QHttpResponseHeader &))); +#ifndef QT_NO_OPENSSL +connect(m_pHttp, SIGNAL(sslErrors(const QList &)), this, SLOT(slotSslErrors(const QList &))); +#endif +connect(m_pHttp, SIGNAL(stateChanged(int)), this, SLOT(slotStateChanged(int))); KVSO_END_CONSTRUCTOR(KvsObject_http) KVSO_BEGIN_DESTRUCTOR(KvsObject_http) - QHashIterator t(getDict); - while (t.hasNext()) - { - t.next(); - int key=t.key(); - QFile *pFile=getDict.value(key); - pFile->close(); - delete pFile; - } - getDict.clear(); - delete m_pHttp; +QHashIterator t(getDict); +while(t.hasNext()) +{ + t.next(); + int key = t.key(); + QFile * pFile = getDict.value(key); + pFile->close(); + delete pFile; +} +getDict.clear(); +delete m_pHttp; KVSO_END_DESTRUCTOR(KvsObject_http) //---------------------- - -bool KvsObject_http::functionSetHost(KviKvsObjectFunctionCall *c) +bool KvsObject_http::functionSetHost(KviKvsObjectFunctionCall * c) { CHECK_INTERNAL_POINTER(m_pHttp) QString szHost; QString szConnectionType; kvs_uint_t uRemotePort; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("host",KVS_PT_STRING,0,szHost) - KVSO_PARAMETER("remote_port",KVS_PT_UNSIGNEDINTEGER,KVS_PF_OPTIONAL,uRemotePort) + KVSO_PARAMETER("host", KVS_PT_STRING, 0, szHost) + KVSO_PARAMETER("remote_port", KVS_PT_UNSIGNEDINTEGER, KVS_PF_OPTIONAL, uRemotePort) KVSO_PARAMETERS_END(c) QUrl url(szHost); - if (!url.isValid()) + if(!url.isValid()) { - c->warning(__tr2qs_ctx("Host '%Q' is not a valid URL","objects"),&szHost); + c->warning(__tr2qs_ctx("Host '%Q' is not a valid URL", "objects"), &szHost); return true; } - if (!szHost.isEmpty() && url.host().isEmpty()) url.setHost(szHost); - if (!uRemotePort) uRemotePort=80; - kvs_uint_t id=0; + if(!szHost.isEmpty() && url.host().isEmpty()) + url.setHost(szHost); + if(!uRemotePort) + uRemotePort = 80; + kvs_uint_t id = 0; QHttp::ConnectionMode mode; - if(url.scheme().toLower()=="https") mode=QHttp::ConnectionModeHttps; - else {mode=QHttp::ConnectionModeHttp;url.setScheme("http");} - if (mode==QHttp::ConnectionModeHttps) uRemotePort=443; - id=m_pHttp->setHost(url.host(), mode, uRemotePort); + if(url.scheme().toLower() == "https") + mode = QHttp::ConnectionModeHttps; + else + { + mode = QHttp::ConnectionModeHttp; + url.setScheme("http"); + } + if(mode == QHttp::ConnectionModeHttps) + uRemotePort = 443; + id = m_pHttp->setHost(url.host(), mode, uRemotePort); c->returnValue()->setInteger(id); return true; } -bool KvsObject_http::functionCurrentId(KviKvsObjectFunctionCall *c) +bool KvsObject_http::functionCurrentId(KviKvsObjectFunctionCall * c) { CHECK_INTERNAL_POINTER(m_pHttp) c->returnValue()->setInteger(m_pHttp->currentId()); return true; } -bool KvsObject_http::functionSetUser(KviKvsObjectFunctionCall *c) +bool KvsObject_http::functionSetUser(KviKvsObjectFunctionCall * c) { CHECK_INTERNAL_POINTER(m_pHttp) QString szUser; QString szPass; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("user",KVS_PT_STRING,0,szUser) - KVSO_PARAMETER("password",KVS_PT_STRING,0,szPass) + KVSO_PARAMETER("user", KVS_PT_STRING, 0, szUser) + KVSO_PARAMETER("password", KVS_PT_STRING, 0, szPass) KVSO_PARAMETERS_END(c) - m_pHttp->setUser(szUser,szPass); + m_pHttp->setUser(szUser, szPass); return true; } -bool KvsObject_http::functionSetProxy(KviKvsObjectFunctionCall *c) +bool KvsObject_http::functionSetProxy(KviKvsObjectFunctionCall * c) { CHECK_INTERNAL_POINTER(m_pHttp) QString szHost; - QString szUser,szPass; + QString szUser, szPass; kvs_uint_t uRemotePort; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("host",KVS_PT_STRING,0,szHost) - KVSO_PARAMETER("remote_port",KVS_PT_UNSIGNEDINTEGER,KVS_PF_OPTIONAL,uRemotePort) - KVSO_PARAMETER("user",KVS_PT_STRING,KVS_PF_OPTIONAL,szUser) - KVSO_PARAMETER("pass",KVS_PT_STRING,KVS_PF_OPTIONAL,szPass) + KVSO_PARAMETER("host", KVS_PT_STRING, 0, szHost) + KVSO_PARAMETER("remote_port", KVS_PT_UNSIGNEDINTEGER, KVS_PF_OPTIONAL, uRemotePort) + KVSO_PARAMETER("user", KVS_PT_STRING, KVS_PF_OPTIONAL, szUser) + KVSO_PARAMETER("pass", KVS_PT_STRING, KVS_PF_OPTIONAL, szPass) KVSO_PARAMETERS_END(c) - m_pHttp->setProxy(szHost,uRemotePort,szUser,szPass); + m_pHttp->setProxy(szHost, uRemotePort, szUser, szPass); return true; } -bool KvsObject_http::functionGet(KviKvsObjectFunctionCall *c) +bool KvsObject_http::functionGet(KviKvsObjectFunctionCall * c) { CHECK_INTERNAL_POINTER(m_pHttp) - QString szPath,szDest; + QString szPath, szDest; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("remote_path",KVS_PT_STRING,0,szPath) - KVSO_PARAMETER("local_filename",KVS_PT_STRING,KVS_PF_OPTIONAL,szDest) + KVSO_PARAMETER("remote_path", KVS_PT_STRING, 0, szPath) + KVSO_PARAMETER("local_filename", KVS_PT_STRING, KVS_PF_OPTIONAL, szDest) KVSO_PARAMETERS_END(c) - QFile * pFile=0; - if (!szDest.isEmpty()) + QFile * pFile = 0; + if(!szDest.isEmpty()) { - pFile=new QFile(szDest); - if (pFile) + pFile = new QFile(szDest); + if(pFile) { pFile->open(QIODevice::WriteOnly); - } else { - c->warning(__tr2qs_ctx("'%Q' is not a valid file path","objects"),&szDest); + } + else + { + c->warning(__tr2qs_ctx("'%Q' is not a valid file path", "objects"), &szDest); c->returnValue()->setInteger(-1); return true; } } - if (szPath.isEmpty()) szPath="/"; - int id=m_pHttp->get(szPath,pFile); - if (pFile) getDict[id]=pFile; + if(szPath.isEmpty()) + szPath = "/"; + int id = m_pHttp->get(szPath, pFile); + if(pFile) + getDict[id] = pFile; c->returnValue()->setInteger(id); return true; } -bool KvsObject_http::functionPost(KviKvsObjectFunctionCall *c) +bool KvsObject_http::functionPost(KviKvsObjectFunctionCall * c) { CHECK_INTERNAL_POINTER(m_pHttp) - QString szPath,szDest,szData; + QString szPath, szDest, szData; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("remote_path",KVS_PT_STRING,0,szPath) - KVSO_PARAMETER("post_data",KVS_PT_STRING,0,szData) - KVSO_PARAMETER("local_filename",KVS_PT_STRING,0,szDest) + KVSO_PARAMETER("remote_path", KVS_PT_STRING, 0, szPath) + KVSO_PARAMETER("post_data", KVS_PT_STRING, 0, szData) + KVSO_PARAMETER("local_filename", KVS_PT_STRING, 0, szDest) KVSO_PARAMETERS_END(c) - QFile *pFile=0; - if (!szDest.isEmpty()){ - pFile=new QFile(szDest); - if (pFile) + QFile * pFile = 0; + if(!szDest.isEmpty()) + { + pFile = new QFile(szDest); + if(pFile) { pFile->open(QIODevice::WriteOnly); } } - if (szPath.isEmpty()) szPath="/"; - int id=m_pHttp->post(szPath,szDest.toUtf8(),pFile); - if (pFile) getDict[id]=pFile; + if(szPath.isEmpty()) + szPath = "/"; + int id = m_pHttp->post(szPath, szDest.toUtf8(), pFile); + if(pFile) + getDict[id] = pFile; c->returnValue()->setInteger(id); return true; } -bool KvsObject_http::functionAbort(KviKvsObjectFunctionCall *c) +bool KvsObject_http::functionAbort(KviKvsObjectFunctionCall * c) { CHECK_INTERNAL_POINTER(m_pHttp) - m_bAbort=true; + m_bAbort = true; m_pHttp->abort(); return true; } -bool KvsObject_http::functionReadAll(KviKvsObjectFunctionCall *c) +bool KvsObject_http::functionReadAll(KviKvsObjectFunctionCall * c) { CHECK_INTERNAL_POINTER(m_pHttp) c->returnValue()->setString(m_pHttp->readAll()); return true; } -bool KvsObject_http::functionErrorString(KviKvsObjectFunctionCall *c) +bool KvsObject_http::functionErrorString(KviKvsObjectFunctionCall * c) { CHECK_INTERNAL_POINTER(m_pHttp) c->returnValue()->setString(m_pHttp->errorString()); return true; } -bool KvsObject_http::functionFollowRedirect(KviKvsObjectFunctionCall *c) +bool KvsObject_http::functionFollowRedirect(KviKvsObjectFunctionCall * c) { bool bEnabled; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("enable",KVS_PT_BOOLEAN,0,bEnabled) + KVSO_PARAMETER("enable", KVS_PT_BOOLEAN, 0, bEnabled) KVSO_PARAMETERS_END(c) - m_bEnableForceRedirect=bEnabled; + m_bEnableForceRedirect = bEnabled; return true; } //signals & slots -bool KvsObject_http::functionRequestFinishedEvent(KviKvsObjectFunctionCall *c) +bool KvsObject_http::functionRequestFinishedEvent(KviKvsObjectFunctionCall * c) { - emitSignal("requestFinished",c,c->params()); + emitSignal("requestFinished", c, c->params()); return true; } -void KvsObject_http::slotRequestFinished ( int id, bool error ) +void KvsObject_http::slotRequestFinished(int id, bool error) { - if (m_bAbort) + if(m_bAbort) { - m_bAbort=false; - QHashIterator t(getDict); - while (t.hasNext()) + m_bAbort = false; + QHashIterator t(getDict); + while(t.hasNext()) { t.next(); - int key=t.key(); - QFile *pFile=getDict.value(key); + int key = t.key(); + QFile * pFile = getDict.value(key); pFile->close(); delete pFile; } getDict.clear(); return; } - QFile *pFile=getDict.value(id); - if (pFile) + QFile * pFile = getDict.value(id); + if(pFile) { - QString name=pFile->fileName(); + QString name = pFile->fileName(); pFile->close(); getDict.remove(id); - int res=m_pHttp->lastResponse().statusCode(); - if ((res==301 || res==302 || res==307) && m_bEnableForceRedirect) - redirect(name,m_pHttp->lastResponse()); + int res = m_pHttp->lastResponse().statusCode(); + if((res == 301 || res == 302 || res == 307) && m_bEnableForceRedirect) + redirect(name, m_pHttp->lastResponse()); delete pFile; } KviKvsVariantList lParams; - lParams.append(new KviKvsVariant((kvs_int_t) id)); + lParams.append(new KviKvsVariant((kvs_int_t)id)); lParams.append(new KviKvsVariant(error)); - callFunction(this,"requestFinishedEvent",0,&lParams); + callFunction(this, "requestFinishedEvent", 0, &lParams); } -bool KvsObject_http::functionRequestStartedEvent(KviKvsObjectFunctionCall *c) +bool KvsObject_http::functionRequestStartedEvent(KviKvsObjectFunctionCall * c) { - emitSignal("requestStarted",c,c->params()); + emitSignal("requestStarted", c, c->params()); return true; } -void KvsObject_http::slotRequestStarted ( int id ) +void KvsObject_http::slotRequestStarted(int id) { KviKvsVariantList lParams; - lParams.append(new KviKvsVariant((kvs_int_t) id)); - callFunction(this,"requestStartedEvent",0,&lParams); + lParams.append(new KviKvsVariant((kvs_int_t)id)); + callFunction(this, "requestStartedEvent", 0, &lParams); } -void KvsObject_http::slotDataReadProgress ( int done,int total ) +void KvsObject_http::slotDataReadProgress(int done, int total) { KviKvsVariantList lParams; - lParams.append(new KviKvsVariant((kvs_int_t) done)); - lParams.append(new KviKvsVariant((kvs_int_t) total)); - callFunction(this,"dataReadProgressEvent",0,&lParams); + lParams.append(new KviKvsVariant((kvs_int_t)done)); + lParams.append(new KviKvsVariant((kvs_int_t)total)); + callFunction(this, "dataReadProgressEvent", 0, &lParams); } -bool KvsObject_http::functionDataReadProgressEvent(KviKvsObjectFunctionCall *c) +bool KvsObject_http::functionDataReadProgressEvent(KviKvsObjectFunctionCall * c) { - emitSignal("dataReadProgress",c,c->params()); + emitSignal("dataReadProgress", c, c->params()); return true; } -void KvsObject_http::slotDataSendProgress ( int done,int total ) +void KvsObject_http::slotDataSendProgress(int done, int total) { KviKvsVariantList lParams; - lParams.append(new KviKvsVariant((kvs_int_t) done)); - lParams.append(new KviKvsVariant((kvs_int_t) total)); - callFunction(this,"dataSendProgressEvent",0,&lParams); + lParams.append(new KviKvsVariant((kvs_int_t)done)); + lParams.append(new KviKvsVariant((kvs_int_t)total)); + callFunction(this, "dataSendProgressEvent", 0, &lParams); } -bool KvsObject_http::functionDataSendProgressEvent(KviKvsObjectFunctionCall *c) +bool KvsObject_http::functionDataSendProgressEvent(KviKvsObjectFunctionCall * c) { - emitSignal("dataSendProgress",c,c->params()); + emitSignal("dataSendProgress", c, c->params()); return true; } -bool KvsObject_http::functionDoneEvent(KviKvsObjectFunctionCall *c) +bool KvsObject_http::functionDoneEvent(KviKvsObjectFunctionCall * c) { - emitSignal("done",c,c->params()); + emitSignal("done", c, c->params()); return true; } -void KvsObject_http::slotDone ( bool error ) +void KvsObject_http::slotDone(bool error) { KviKvsVariantList lParams; lParams.append(new KviKvsVariant(error)); - callFunction(this,"doneEvent",0,&lParams); + callFunction(this, "doneEvent", 0, &lParams); } -bool KvsObject_http::functionResponseHeaderReceivedEvent(KviKvsObjectFunctionCall *c) +bool KvsObject_http::functionResponseHeaderReceivedEvent(KviKvsObjectFunctionCall * c) { - emitSignal("responseHeaderReceived",c,c->params()); + emitSignal("responseHeaderReceived", c, c->params()); return true; } -bool KvsObject_http::functionReadyReadEvent(KviKvsObjectFunctionCall *c) +bool KvsObject_http::functionReadyReadEvent(KviKvsObjectFunctionCall * c) { - emitSignal("readyRead",c,c->params()); + emitSignal("readyRead", c, c->params()); return true; } -void KvsObject_http::redirect(QString &file,const QHttpResponseHeader &r) +void KvsObject_http::redirect(QString & file, const QHttpResponseHeader & r) { QUrl url(r.value("location")); m_pHttp->setHost(url.host()); - QFile *pFile=0; - pFile=new QFile(file); + QFile * pFile = 0; + pFile = new QFile(file); pFile->open(QIODevice::WriteOnly); - int id=m_pHttp->get(url.path(),pFile); - getDict[id]=pFile; + int id = m_pHttp->get(url.path(), pFile); + getDict[id] = pFile; } -void KvsObject_http::slotResponseHeaderReceived(const QHttpResponseHeader &r) +void KvsObject_http::slotResponseHeaderReceived(const QHttpResponseHeader & r) { QString szResponse; - switch (r.statusCode()) { - case 200: szResponse="OK" ;break; - case 301: szResponse="Moved Permanently" ;break; - case 302: szResponse="Found" ;break; - case 303: szResponse="See Other" ;break; - case 307: szResponse="Temporary Redirect" ;break; - default: szResponse=r.reasonPhrase(); - m_bAbort=true; + switch(r.statusCode()) + { + case 200: + szResponse = "OK"; + break; + case 301: + szResponse = "Moved Permanently"; + break; + case 302: + szResponse = "Found"; + break; + case 303: + szResponse = "See Other"; + break; + case 307: + szResponse = "Temporary Redirect"; + break; + default: + szResponse = r.reasonPhrase(); + m_bAbort = true; } - if (r.statusCode()==400) + if(r.statusCode() == 400) { - m_bAbort=true; + m_bAbort = true; m_pHttp->abort(); } KviKvsVariantList lParams; lParams.append(new KviKvsVariant(szResponse)); - callFunction(this,"responseHeaderReceivedEvent",0,&lParams); - + callFunction(this, "responseHeaderReceivedEvent", 0, &lParams); } -void KvsObject_http::slotReadyRead(const QHttpResponseHeader &r) +void KvsObject_http::slotReadyRead(const QHttpResponseHeader & r) { QString szResponse; - switch (r.statusCode()) { - case 200: szResponse="OK" ;break; - case 301: szResponse="Moved Permanently" ;break; - case 302: szResponse="Found" ;break; - case 303: szResponse="See Other" ;break; - case 307: szResponse="Temporary Redirect" ;break; - default: szResponse=r.reasonPhrase(); - m_bAbort=true; + switch(r.statusCode()) + { + case 200: + szResponse = "OK"; + break; + case 301: + szResponse = "Moved Permanently"; + break; + case 302: + szResponse = "Found"; + break; + case 303: + szResponse = "See Other"; + break; + case 307: + szResponse = "Temporary Redirect"; + break; + default: + szResponse = r.reasonPhrase(); + m_bAbort = true; } KviKvsVariantList lParams; lParams.append(new KviKvsVariant(szResponse)); - callFunction(this,"readyreadEvent",0,&lParams); + callFunction(this, "readyreadEvent", 0, &lParams); } - - - -void KvsObject_http::slotStateChanged ( int state) +void KvsObject_http::slotStateChanged(int state) { - QString szState=""; - if (state==QHttp::Unconnected) szState="Unconnected"; - else if (state==QHttp::HostLookup) szState="HostLookup"; - else if (state==QHttp::Connecting) szState="Connecting"; - else if (state==QHttp::Connected) szState="Connected"; - else if (state==QHttp::Sending) szState="Sending"; - else if (state==QHttp::Reading) szState="Reading"; - - else if (state==QHttp::Closing) szState="Closing"; + QString szState = ""; + if(state == QHttp::Unconnected) + szState = "Unconnected"; + else if(state == QHttp::HostLookup) + szState = "HostLookup"; + else if(state == QHttp::Connecting) + szState = "Connecting"; + else if(state == QHttp::Connected) + szState = "Connected"; + else if(state == QHttp::Sending) + szState = "Sending"; + else if(state == QHttp::Reading) + szState = "Reading"; + + else if(state == QHttp::Closing) + szState = "Closing"; KviKvsVariantList lParams; lParams.append(new KviKvsVariant(szState)); - callFunction(this,"stateChangedEvent",0,&lParams); + callFunction(this, "stateChangedEvent", 0, &lParams); } -bool KvsObject_http::functionStateChangedEvent(KviKvsObjectFunctionCall *c) +bool KvsObject_http::functionStateChangedEvent(KviKvsObjectFunctionCall * c) { - emitSignal("stateChanged",c,c->params()); + emitSignal("stateChanged", c, c->params()); return true; } #ifndef QT_NO_OPENSSL -bool KvsObject_http::functionIgnoreSslErrors(KviKvsObjectFunctionCall *) +bool KvsObject_http::functionIgnoreSslErrors(KviKvsObjectFunctionCall *) { - if (m_pHttp) m_pHttp->ignoreSslErrors(); + if(m_pHttp) + m_pHttp->ignoreSslErrors(); return true; } void KvsObject_http::slotSslErrors(QList sslerrors) { - KviKvsArray *pArray=0; - pArray=new KviKvsArray(); - for(int i=0;iset(i,new KviKvsVariant(ssl_errors_tbl[sslerrors.at(i).error()])); + pArray->set(i, new KviKvsVariant(ssl_errors_tbl[sslerrors.at(i).error()])); } KviKvsVariantList lParams; lParams.append(new KviKvsVariant(pArray)); - callFunction(this,"sslErrorEvent",0,&lParams); - } + callFunction(this, "sslErrorEvent", 0, &lParams); +} -bool KvsObject_http::functionSslErrorsEvent(KviKvsObjectFunctionCall *c) +bool KvsObject_http::functionSslErrorsEvent(KviKvsObjectFunctionCall * c) { - emitSignal("sslErrors",c,c->params()); + emitSignal("sslErrors", c, c->params()); return true; } #endif diff --git a/src/modules/objects/KvsObject_http.h b/src/modules/objects/KvsObject_http.h index 2813bd730..9a1a34ea6 100644 --- a/src/modules/objects/KvsObject_http.h +++ b/src/modules/objects/KvsObject_http.h @@ -24,7 +24,6 @@ // //============================================================================= - //=============================================================== #include "object_macros.h" @@ -41,49 +40,49 @@ class KvsObject_http : public KviKvsObject public: KVSO_DECLARE_OBJECT(KvsObject_http) protected: - QHttp *m_pHttp; - QHash getDict; + QHttp * m_pHttp; + QHash getDict; bool m_bAbort; bool m_bEnableForceRedirect; + protected: - bool functionSetHost(KviKvsObjectFunctionCall *c); - bool functionGet(KviKvsObjectFunctionCall *c); - bool functionSetUser(KviKvsObjectFunctionCall *c); - bool functionSetProxy(KviKvsObjectFunctionCall *c); - bool functionRequestFinishedEvent(KviKvsObjectFunctionCall *c); - bool functionRequestStartedEvent(KviKvsObjectFunctionCall *c); - bool functionDataReadProgressEvent(KviKvsObjectFunctionCall *c); - bool functionDataSendProgressEvent(KviKvsObjectFunctionCall *c); - bool functionResponseHeaderReceivedEvent(KviKvsObjectFunctionCall *c); - bool functionAbort(KviKvsObjectFunctionCall *c); - bool functionDoneEvent(KviKvsObjectFunctionCall *c); - bool functionStateChangedEvent(KviKvsObjectFunctionCall *c); - bool functionReadAll(KviKvsObjectFunctionCall *c); - bool functionReadyReadEvent(KviKvsObjectFunctionCall *c); - bool functionErrorString(KviKvsObjectFunctionCall *c); - bool functionPost(KviKvsObjectFunctionCall *c); - bool functionFollowRedirect(KviKvsObjectFunctionCall *c); - bool functionCurrentId(KviKvsObjectFunctionCall *c); - void redirect(QString &file,const QHttpResponseHeader &r); + bool functionSetHost(KviKvsObjectFunctionCall * c); + bool functionGet(KviKvsObjectFunctionCall * c); + bool functionSetUser(KviKvsObjectFunctionCall * c); + bool functionSetProxy(KviKvsObjectFunctionCall * c); + bool functionRequestFinishedEvent(KviKvsObjectFunctionCall * c); + bool functionRequestStartedEvent(KviKvsObjectFunctionCall * c); + bool functionDataReadProgressEvent(KviKvsObjectFunctionCall * c); + bool functionDataSendProgressEvent(KviKvsObjectFunctionCall * c); + bool functionResponseHeaderReceivedEvent(KviKvsObjectFunctionCall * c); + bool functionAbort(KviKvsObjectFunctionCall * c); + bool functionDoneEvent(KviKvsObjectFunctionCall * c); + bool functionStateChangedEvent(KviKvsObjectFunctionCall * c); + bool functionReadAll(KviKvsObjectFunctionCall * c); + bool functionReadyReadEvent(KviKvsObjectFunctionCall * c); + bool functionErrorString(KviKvsObjectFunctionCall * c); + bool functionPost(KviKvsObjectFunctionCall * c); + bool functionFollowRedirect(KviKvsObjectFunctionCall * c); + bool functionCurrentId(KviKvsObjectFunctionCall * c); + void redirect(QString & file, const QHttpResponseHeader & r); - #ifndef QT_NO_OPENSSL - bool functionIgnoreSslErrors(KviKvsObjectFunctionCall *c); - bool functionSslErrorsEvent(KviKvsObjectFunctionCall *c); - #endif +#ifndef QT_NO_OPENSSL + bool functionIgnoreSslErrors(KviKvsObjectFunctionCall * c); + bool functionSslErrorsEvent(KviKvsObjectFunctionCall * c); +#endif protected slots: - void slotRequestFinished ( int id, bool error ); - void slotDone (bool error ); - void slotRequestStarted ( int id ); - void slotDataSendProgress ( int done, int total ); - void slotDataReadProgress ( int done, int total ); - #ifndef QT_NO_OPENSSL + void slotRequestFinished(int id, bool error); + void slotDone(bool error); + void slotRequestStarted(int id); + void slotDataSendProgress(int done, int total); + void slotDataReadProgress(int done, int total); +#ifndef QT_NO_OPENSSL void slotSslErrors(QList); - #endif - void slotResponseHeaderReceived(const QHttpResponseHeader &r); - void slotReadyRead(const QHttpResponseHeader &r); - void slotStateChanged ( int state); - +#endif + void slotResponseHeaderReceived(const QHttpResponseHeader & r); + void slotReadyRead(const QHttpResponseHeader & r); + void slotStateChanged(int state); }; #endif //_CLASS_HTTP_H_ diff --git a/src/modules/objects/KvsObject_label.cpp b/src/modules/objects/KvsObject_label.cpp index e096604b6..3c3baff78 100644 --- a/src/modules/objects/KvsObject_label.cpp +++ b/src/modules/objects/KvsObject_label.cpp @@ -35,8 +35,6 @@ #include #include - - // Tables used in $setAlignment & $alignment const char * const align_tbl[] = { "Left", @@ -60,7 +58,7 @@ const int align_cod[] = { Qt::AlignJustify, }; -#define align_num (sizeof(align_tbl) / sizeof(align_tbl[0])) +#define align_num (sizeof(align_tbl) / sizeof(align_tbl[0])) // used in $frameStyle & $setFrameStyle const char * const frame_tbl[] = { @@ -86,7 +84,7 @@ const int frame_cod[] = { QFrame::Sunken }; -#define frame_num (sizeof(frame_tbl) / sizeof(frame_tbl[0])) +#define frame_num (sizeof(frame_tbl) / sizeof(frame_tbl[0])) /* @doc: label @@ -175,29 +173,28 @@ const int frame_cod[] = { */ -KVSO_BEGIN_REGISTERCLASS(KvsObject_label,"label","widget") - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_label,setText) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_label,text) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_label,margin) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_label,setMargin) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_label,alignment) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_label,setAlignment) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_label,clear) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_label,frameStyle) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_label,setFrameStyle) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_label,setImage) +KVSO_BEGIN_REGISTERCLASS(KvsObject_label, "label", "widget") +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_label, setText) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_label, text) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_label, margin) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_label, setMargin) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_label, alignment) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_label, setAlignment) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_label, clear) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_label, frameStyle) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_label, setFrameStyle) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_label, setImage) KVSO_END_REGISTERCLASS(KvsObject_label) -KVSO_BEGIN_CONSTRUCTOR(KvsObject_label,KvsObject_widget) +KVSO_BEGIN_CONSTRUCTOR(KvsObject_label, KvsObject_widget) KVSO_END_CONSTRUCTOR(KvsObject_label) - KVSO_BEGIN_DESTRUCTOR(KvsObject_label) KVSO_END_CONSTRUCTOR(KvsObject_label) -bool KvsObject_label::init(KviKvsRunTimeContext *,KviKvsVariantList *) +bool KvsObject_label::init(KviKvsRunTimeContext *, KviKvsVariantList *) { SET_OBJECT(QLabel) ((QLabel *)widget())->setWordWrap(true); @@ -205,50 +202,50 @@ bool KvsObject_label::init(KviKvsRunTimeContext *,KviKvsVariantList *) return true; } -KVSO_CLASS_FUNCTION(label,setText) +KVSO_CLASS_FUNCTION(label, setText) { CHECK_INTERNAL_POINTER(widget()) QString szText; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("text",KVS_PT_STRING,0,szText) + KVSO_PARAMETER("text", KVS_PT_STRING, 0, szText) KVSO_PARAMETERS_END(c) ((QLabel *)widget())->setText(szText); return true; } -KVSO_CLASS_FUNCTION(label,text) +KVSO_CLASS_FUNCTION(label, text) { CHECK_INTERNAL_POINTER(widget()) c->returnValue()->setString(((QLabel *)widget())->text()); return true; } -KVSO_CLASS_FUNCTION(label,setMargin) +KVSO_CLASS_FUNCTION(label, setMargin) { CHECK_INTERNAL_POINTER(widget()) kvs_uint_t iMargin; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("margin",KVS_PT_UNSIGNEDINTEGER,0,iMargin) + KVSO_PARAMETER("margin", KVS_PT_UNSIGNEDINTEGER, 0, iMargin) KVSO_PARAMETERS_END(c) ((QLabel *)widget())->setMargin(iMargin); return true; } -KVSO_CLASS_FUNCTION(label,margin) +KVSO_CLASS_FUNCTION(label, margin) { CHECK_INTERNAL_POINTER(widget()) c->returnValue()->setInteger(((QLabel *)widget())->margin()); return true; } -KVSO_CLASS_FUNCTION(label,setAlignment) +KVSO_CLASS_FUNCTION(label, setAlignment) { CHECK_INTERNAL_POINTER(widget()) QStringList alignment; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("alignment",KVS_PT_STRINGLIST,KVS_PF_OPTIONAL,alignment) + KVSO_PARAMETER("alignment", KVS_PT_STRINGLIST, KVS_PF_OPTIONAL, alignment) KVSO_PARAMETERS_END(c) - int align,sum=0; - for ( QStringList::Iterator it = alignment.begin(); it != alignment.end(); ++it ) + int align, sum = 0; + for(QStringList::Iterator it = alignment.begin(); it != alignment.end(); ++it) { align = 0; @@ -256,30 +253,29 @@ KVSO_CLASS_FUNCTION(label,setAlignment) { if(KviQString::equalCI((*it), align_tbl[j])) { - align=align_cod[j]; + align = align_cod[j]; break; } } if(align) sum = sum | align; else - c->warning(__tr2qs_ctx("Unknown alignment '%Q'","objects"),&(*it)); - + c->warning(__tr2qs_ctx("Unknown alignment '%Q'", "objects"), &(*it)); } ((QLabel *)widget())->setAlignment((Qt::Alignment)sum); return true; } -KVSO_CLASS_FUNCTION(label,alignment) +KVSO_CLASS_FUNCTION(label, alignment) { CHECK_INTERNAL_POINTER(widget()) int mode = ((QLabel *)widget())->alignment(); - QString szAlignment=""; + QString szAlignment = ""; for(unsigned int i = 0; i < align_num; i++) { if(mode == align_cod[i]) { - szAlignment=align_tbl[i]; + szAlignment = align_tbl[i]; break; } } @@ -287,53 +283,53 @@ KVSO_CLASS_FUNCTION(label,alignment) return true; } -KVSO_CLASS_FUNCTION(label,clear) +KVSO_CLASS_FUNCTION(label, clear) { CHECK_INTERNAL_POINTER(widget()) ((QLabel *)widget())->clear(); return true; } -KVSO_CLASS_FUNCTION(label,setFrameStyle) +KVSO_CLASS_FUNCTION(label, setFrameStyle) { CHECK_INTERNAL_POINTER(widget()) QStringList style; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("style",KVS_PT_STRINGLIST,KVS_PF_OPTIONAL,style) + KVSO_PARAMETER("style", KVS_PT_STRINGLIST, KVS_PF_OPTIONAL, style) KVSO_PARAMETERS_END(c) - if (!widget()) return true; - int framestyle,sum=0; - for ( QStringList::Iterator it = style.begin(); it != style.end(); ++it ) + if(!widget()) + return true; + int framestyle, sum = 0; + for(QStringList::Iterator it = style.begin(); it != style.end(); ++it) { framestyle = 0; for(unsigned int j = 0; j < align_num; j++) { if(KviQString::equalCI((*it), frame_tbl[j])) { - framestyle=frame_cod[j]; + framestyle = frame_cod[j]; break; } } if(framestyle) sum = sum | framestyle; else - c->warning(__tr2qs_ctx("Unknown style '%Q'","objects"),&(*it)); - + c->warning(__tr2qs_ctx("Unknown style '%Q'", "objects"), &(*it)); } ((QLabel *)widget())->setFrameStyle(sum); return true; } -KVSO_CLASS_FUNCTION(label,frameStyle) +KVSO_CLASS_FUNCTION(label, frameStyle) { CHECK_INTERNAL_POINTER(widget()) int mode = ((QLabel *)widget())->frameStyle(); - QString szStyle=""; + QString szStyle = ""; for(unsigned int i = 0; i < frame_num; i++) { if(mode == frame_cod[i]) { - szStyle=frame_tbl[i]; + szStyle = frame_tbl[i]; break; } } @@ -341,14 +337,15 @@ KVSO_CLASS_FUNCTION(label,frameStyle) return true; } -KVSO_CLASS_FUNCTION(label,setImage) +KVSO_CLASS_FUNCTION(label, setImage) { CHECK_INTERNAL_POINTER(widget()) QString icon; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("icon",KVS_PT_STRING,0,icon) + KVSO_PARAMETER("icon", KVS_PT_STRING, 0, icon) KVSO_PARAMETERS_END(c) QPixmap * pix = g_pIconManager->getImage(icon); - if(pix) ((QLabel *)widget())->setPixmap(*pix); + if(pix) + ((QLabel *)widget())->setPixmap(*pix); return true; } diff --git a/src/modules/objects/KvsObject_label.h b/src/modules/objects/KvsObject_label.h index 7b626cc46..1382c60f6 100644 --- a/src/modules/objects/KvsObject_label.h +++ b/src/modules/objects/KvsObject_label.h @@ -1,5 +1,5 @@ -#ifndef _CLASS_LABEL_H_ -#define _CLASS_LABEL_H_ +#ifndef _CLASS_LABEL_H_ +#define _CLASS_LABEL_H_ //============================================================================= // // File : KvsObject_label.h @@ -25,7 +25,6 @@ // //============================================================================= - #include "KvsObject_widget.h" #include "object_macros.h" @@ -36,18 +35,18 @@ public: public: QWidget * widget() { return (QWidget *)object(); }; protected: - virtual bool init(KviKvsRunTimeContext * pContext,KviKvsVariantList *pParams); + virtual bool init(KviKvsRunTimeContext * pContext, KviKvsVariantList * pParams); - bool setTitle(KviKvsObjectFunctionCall *c); - bool setText(KviKvsObjectFunctionCall *c); - bool text(KviKvsObjectFunctionCall *c); - bool margin(KviKvsObjectFunctionCall *c); - bool setMargin(KviKvsObjectFunctionCall *c); - bool alignment(KviKvsObjectFunctionCall *c); - bool setAlignment(KviKvsObjectFunctionCall *c); - bool clear(KviKvsObjectFunctionCall *c); - bool frameStyle(KviKvsObjectFunctionCall *c); - bool setFrameStyle(KviKvsObjectFunctionCall *c); - bool setImage(KviKvsObjectFunctionCall *c); + bool setTitle(KviKvsObjectFunctionCall * c); + bool setText(KviKvsObjectFunctionCall * c); + bool text(KviKvsObjectFunctionCall * c); + bool margin(KviKvsObjectFunctionCall * c); + bool setMargin(KviKvsObjectFunctionCall * c); + bool alignment(KviKvsObjectFunctionCall * c); + bool setAlignment(KviKvsObjectFunctionCall * c); + bool clear(KviKvsObjectFunctionCall * c); + bool frameStyle(KviKvsObjectFunctionCall * c); + bool setFrameStyle(KviKvsObjectFunctionCall * c); + bool setImage(KviKvsObjectFunctionCall * c); }; -#endif // !_CLASS_LABEL_H_ +#endif // !_CLASS_LABEL_H_ diff --git a/src/modules/objects/KvsObject_layout.cpp b/src/modules/objects/KvsObject_layout.cpp index f938e94a7..79beb9e79 100644 --- a/src/modules/objects/KvsObject_layout.cpp +++ b/src/modules/objects/KvsObject_layout.cpp @@ -29,29 +29,27 @@ #include - // Tables used in $setAlignment & $alignment const char * const align_tbl[] = { - "Left", - "Right", - "HCenter", - "VCenter", - "Center", - "Top", - "Bottom", - }; - + "Left", + "Right", + "HCenter", + "VCenter", + "Center", + "Top", + "Bottom", +}; const int align_cod[] = { - Qt::AlignLeft, - Qt::AlignRight, - Qt::AlignHCenter, - Qt::AlignVCenter, - Qt::AlignCenter, - Qt::AlignTop, - Qt::AlignBottom, - }; -#define align_num (sizeof(align_tbl) / sizeof(align_tbl[0])) + Qt::AlignLeft, + Qt::AlignRight, + Qt::AlignHCenter, + Qt::AlignVCenter, + Qt::AlignCenter, + Qt::AlignTop, + Qt::AlignBottom, +}; +#define align_num (sizeof(align_tbl) / sizeof(align_tbl[0])) /* @doc: layout @@ -107,196 +105,200 @@ const int align_cod[] = { [/pre] */ -KVSO_BEGIN_REGISTERCLASS(KvsObject_layout,"layout","object") - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_layout,addWidget) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_layout,addMultiCellWidget) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_layout,setRowStretch) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_layout,setColumnStretch) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_layout,addRowSpacing) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_layout,addColSpacing) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_layout,setMargin) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_layout,setSpacing) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_layout,setResizeMode) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_layout,setAlignment ) +KVSO_BEGIN_REGISTERCLASS(KvsObject_layout, "layout", "object") +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_layout, addWidget) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_layout, addMultiCellWidget) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_layout, setRowStretch) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_layout, setColumnStretch) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_layout, addRowSpacing) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_layout, addColSpacing) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_layout, setMargin) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_layout, setSpacing) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_layout, setResizeMode) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_layout, setAlignment) KVSO_END_REGISTERCLASS(KvsObject_layout) -KVSO_BEGIN_CONSTRUCTOR(KvsObject_layout,KviKvsObject) +KVSO_BEGIN_CONSTRUCTOR(KvsObject_layout, KviKvsObject) KVSO_END_CONSTRUCTOR(KvsObject_layout) - KVSO_BEGIN_DESTRUCTOR(KvsObject_layout) KVSO_END_CONSTRUCTOR(KvsObject_layout) -bool KvsObject_layout::init(KviKvsRunTimeContext * pContext,KviKvsVariantList *) +bool KvsObject_layout::init(KviKvsRunTimeContext * pContext, KviKvsVariantList *) { QWidget * w = parentScriptWidget(); if(!w) { - pContext->warning(__tr2qs_ctx("The parent of a layout must be a widget!","objects")); + pContext->warning(__tr2qs_ctx("The parent of a layout must be a widget!", "objects")); return false; } if(w->inherits("QToolBar")) { - pContext->warning(__tr2qs_ctx("Qt does not support setting layouts on toolbar objects","objects")); + pContext->warning(__tr2qs_ctx("Qt does not support setting layouts on toolbar objects", "objects")); return false; } // If there already is a layout manager installed on this widget, QWidget won't let you install another. - if(w->layout()) delete w->layout(); - setObject(new QGridLayout(w)); - ((QGridLayout *)object())->setVerticalSpacing(0); - ((QGridLayout *)object())->setHorizontalSpacing(0); - setObjectName(getName()); - return true; + if(w->layout()) + delete w->layout(); + setObject(new QGridLayout(w)); + ((QGridLayout *)object())->setVerticalSpacing(0); + ((QGridLayout *)object())->setHorizontalSpacing(0); + setObjectName(getName()); + return true; } -KVSO_CLASS_FUNCTION(layout,addWidget) +KVSO_CLASS_FUNCTION(layout, addWidget) { CHECK_INTERNAL_POINTER(widget()) KviKvsObject * pObject; kvs_hobject_t hObject; - kvs_uint_t uCol,uRow; + kvs_uint_t uCol, uRow; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("widget",KVS_PT_HOBJECT,0,hObject) - KVSO_PARAMETER("row",KVS_PT_UNSIGNEDINTEGER,0,uRow) - KVSO_PARAMETER("col",KVS_PT_UNSIGNEDINTEGER,0,uCol) + KVSO_PARAMETER("widget", KVS_PT_HOBJECT, 0, hObject) + KVSO_PARAMETER("row", KVS_PT_UNSIGNEDINTEGER, 0, uRow) + KVSO_PARAMETER("col", KVS_PT_UNSIGNEDINTEGER, 0, uCol) KVSO_PARAMETERS_END(c) - pObject=KviKvsKernel::instance()->objectController()->lookupObject(hObject); + pObject = KviKvsKernel::instance()->objectController()->lookupObject(hObject); CHECK_HOBJECT_IS_WIDGET(pObject) - ((QGridLayout *)object())->addWidget(((QWidget *)(pObject->object())),uRow,uCol); + ((QGridLayout *)object())->addWidget(((QWidget *)(pObject->object())), uRow, uCol); return true; } -KVSO_CLASS_FUNCTION(layout,addMultiCellWidget) +KVSO_CLASS_FUNCTION(layout, addMultiCellWidget) { CHECK_INTERNAL_POINTER(widget()) KviKvsObject * pObject; kvs_hobject_t hObject; - kvs_uint_t uStartCol,uStartRow,uEndCol,uEndRow; + kvs_uint_t uStartCol, uStartRow, uEndCol, uEndRow; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("widget",KVS_PT_HOBJECT,0,hObject) - KVSO_PARAMETER("start_row",KVS_PT_UNSIGNEDINTEGER,0,uStartRow) - KVSO_PARAMETER("end_row",KVS_PT_UNSIGNEDINTEGER,0,uEndRow) - KVSO_PARAMETER("start_column",KVS_PT_UNSIGNEDINTEGER,0,uStartCol) - KVSO_PARAMETER("end_column",KVS_PT_UNSIGNEDINTEGER,0,uEndCol) + KVSO_PARAMETER("widget", KVS_PT_HOBJECT, 0, hObject) + KVSO_PARAMETER("start_row", KVS_PT_UNSIGNEDINTEGER, 0, uStartRow) + KVSO_PARAMETER("end_row", KVS_PT_UNSIGNEDINTEGER, 0, uEndRow) + KVSO_PARAMETER("start_column", KVS_PT_UNSIGNEDINTEGER, 0, uStartCol) + KVSO_PARAMETER("end_column", KVS_PT_UNSIGNEDINTEGER, 0, uEndCol) KVSO_PARAMETERS_END(c) - pObject=KviKvsKernel::instance()->objectController()->lookupObject(hObject); + pObject = KviKvsKernel::instance()->objectController()->lookupObject(hObject); CHECK_HOBJECT_IS_WIDGET(pObject) - ((QGridLayout *)object())->addWidget(((QWidget *)(pObject->object())),uStartRow, uStartCol, uEndRow - uStartRow + 1, uEndCol - uStartCol + 1); + ((QGridLayout *)object())->addWidget(((QWidget *)(pObject->object())), uStartRow, uStartCol, uEndRow - uStartRow + 1, uEndCol - uStartCol + 1); return true; } -KVSO_CLASS_FUNCTION(layout,setRowStretch) +KVSO_CLASS_FUNCTION(layout, setRowStretch) { CHECK_INTERNAL_POINTER(widget()) - kvs_uint_t uRow,uStretch; + kvs_uint_t uRow, uStretch; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("row",KVS_PT_UNSIGNEDINTEGER,0,uRow) - KVSO_PARAMETER("stretch",KVS_PT_UNSIGNEDINTEGER,0,uStretch) + KVSO_PARAMETER("row", KVS_PT_UNSIGNEDINTEGER, 0, uRow) + KVSO_PARAMETER("stretch", KVS_PT_UNSIGNEDINTEGER, 0, uStretch) KVSO_PARAMETERS_END(c) - ((QGridLayout *)object())->setRowStretch(uRow,uStretch); + ((QGridLayout *)object())->setRowStretch(uRow, uStretch); return true; } -KVSO_CLASS_FUNCTION(layout,setColumnStretch) +KVSO_CLASS_FUNCTION(layout, setColumnStretch) { CHECK_INTERNAL_POINTER(widget()) - kvs_uint_t uCol,uStretch; + kvs_uint_t uCol, uStretch; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("column",KVS_PT_UNSIGNEDINTEGER,0,uCol) - KVSO_PARAMETER("stretch",KVS_PT_UNSIGNEDINTEGER,0,uStretch) + KVSO_PARAMETER("column", KVS_PT_UNSIGNEDINTEGER, 0, uCol) + KVSO_PARAMETER("stretch", KVS_PT_UNSIGNEDINTEGER, 0, uStretch) KVSO_PARAMETERS_END(c) - ((QGridLayout *)object())->setColumnStretch(uCol,uStretch); + ((QGridLayout *)object())->setColumnStretch(uCol, uStretch); return true; } -KVSO_CLASS_FUNCTION(layout,setMargin) +KVSO_CLASS_FUNCTION(layout, setMargin) { CHECK_INTERNAL_POINTER(widget()) kvs_uint_t uMargin; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("margin",KVS_PT_UNSIGNEDINTEGER,0,uMargin) + KVSO_PARAMETER("margin", KVS_PT_UNSIGNEDINTEGER, 0, uMargin) KVSO_PARAMETERS_END(c) ((QGridLayout *)object())->setMargin(uMargin); return true; } -KVSO_CLASS_FUNCTION(layout,setSpacing) +KVSO_CLASS_FUNCTION(layout, setSpacing) { CHECK_INTERNAL_POINTER(widget()) kvs_uint_t uSpacing; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("spacing",KVS_PT_UNSIGNEDINTEGER,0,uSpacing) + KVSO_PARAMETER("spacing", KVS_PT_UNSIGNEDINTEGER, 0, uSpacing) KVSO_PARAMETERS_END(c) ((QGridLayout *)object())->setSpacing(uSpacing); return true; } -KVSO_CLASS_FUNCTION(layout,addRowSpacing) +KVSO_CLASS_FUNCTION(layout, addRowSpacing) { CHECK_INTERNAL_POINTER(widget()) - kvs_uint_t uSpacing,uRow; + kvs_uint_t uSpacing, uRow; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("row",KVS_PT_UNSIGNEDINTEGER,0,uRow) - KVSO_PARAMETER("spacing",KVS_PT_UNSIGNEDINTEGER,0,uSpacing) + KVSO_PARAMETER("row", KVS_PT_UNSIGNEDINTEGER, 0, uRow) + KVSO_PARAMETER("spacing", KVS_PT_UNSIGNEDINTEGER, 0, uSpacing) KVSO_PARAMETERS_END(c) ((QGridLayout *)object())->addItem(new QSpacerItem(0, uSpacing), uRow, 0); return true; } -KVSO_CLASS_FUNCTION(layout,addColSpacing) +KVSO_CLASS_FUNCTION(layout, addColSpacing) { CHECK_INTERNAL_POINTER(widget()) - kvs_uint_t uSpacing,uCol; + kvs_uint_t uSpacing, uCol; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("column",KVS_PT_UNSIGNEDINTEGER,0,uCol) - KVSO_PARAMETER("spacing",KVS_PT_UNSIGNEDINTEGER,0,uSpacing) + KVSO_PARAMETER("column", KVS_PT_UNSIGNEDINTEGER, 0, uCol) + KVSO_PARAMETER("spacing", KVS_PT_UNSIGNEDINTEGER, 0, uSpacing) KVSO_PARAMETERS_END(c) - ((QGridLayout *)object())->addItem(new QSpacerItem(uSpacing,0), 0, uCol); + ((QGridLayout *)object())->addItem(new QSpacerItem(uSpacing, 0), 0, uCol); return true; } -KVSO_CLASS_FUNCTION(layout,setResizeMode) +KVSO_CLASS_FUNCTION(layout, setResizeMode) { CHECK_INTERNAL_POINTER(widget()) QString szMode; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("resize_mode",KVS_PT_STRING,0,szMode) + KVSO_PARAMETER("resize_mode", KVS_PT_STRING, 0, szMode) KVSO_PARAMETERS_END(c) QLayout::SizeConstraint r = QLayout::SetDefaultConstraint; - if(KviQString::equalCI(szMode,"FreeResize")) r = QLayout::SetNoConstraint; - else if(KviQString::equalCI(szMode,"Minimum")) r = QLayout::SetMinimumSize; - else if(KviQString::equalCI(szMode,"Fixed"))r = QLayout::SetFixedSize; - else c->warning(__tr2qs_ctx("Invalid resize mode defaulting to Auto","objects")); + if(KviQString::equalCI(szMode, "FreeResize")) + r = QLayout::SetNoConstraint; + else if(KviQString::equalCI(szMode, "Minimum")) + r = QLayout::SetMinimumSize; + else if(KviQString::equalCI(szMode, "Fixed")) + r = QLayout::SetFixedSize; + else + c->warning(__tr2qs_ctx("Invalid resize mode defaulting to Auto", "objects")); ((QGridLayout *)object())->setSizeConstraint(r); return true; } -KVSO_CLASS_FUNCTION(layout,setAlignment) +KVSO_CLASS_FUNCTION(layout, setAlignment) { CHECK_INTERNAL_POINTER(widget()) QStringList alignment; KviKvsObject * pObject; kvs_hobject_t hObject; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("widget",KVS_PT_HOBJECT,0,hObject) - KVSO_PARAMETER("alignment",KVS_PT_STRINGLIST,KVS_PF_OPTIONAL,alignment) + KVSO_PARAMETER("widget", KVS_PT_HOBJECT, 0, hObject) + KVSO_PARAMETER("alignment", KVS_PT_STRINGLIST, KVS_PF_OPTIONAL, alignment) KVSO_PARAMETERS_END(c) - pObject=KviKvsKernel::instance()->objectController()->lookupObject(hObject); + pObject = KviKvsKernel::instance()->objectController()->lookupObject(hObject); CHECK_HOBJECT_IS_WIDGET(pObject) - int index=((QGridLayout *)widget())->indexOf(((QWidget *)(pObject->object()))); + int index = ((QGridLayout *)widget())->indexOf(((QWidget *)(pObject->object()))); if(index == -1) { - c->warning(__tr2qs_ctx("The widget must be a child of this layout","objects")); + c->warning(__tr2qs_ctx("The widget must be a child of this layout", "objects")); return true; } int align, sum = 0; - for(auto& it : alignment) + for(auto & it : alignment) { align = 0; for(size_t j{}; j < align_num; j++) @@ -310,10 +312,10 @@ KVSO_CLASS_FUNCTION(layout,setAlignment) if(align) sum = sum | align; else - c->warning(__tr2qs_ctx("Unknown alignment: '%Q'","objects"),&it); + c->warning(__tr2qs_ctx("Unknown alignment: '%Q'", "objects"), &it); } if(widget()) - ((QGridLayout *)widget())->setAlignment(((QWidget *)(pObject->object())),(Qt::Alignment)sum); - return true; + ((QGridLayout *)widget())->setAlignment(((QWidget *)(pObject->object())), (Qt::Alignment)sum); + return true; } diff --git a/src/modules/objects/KvsObject_layout.h b/src/modules/objects/KvsObject_layout.h index 621ff3605..99b0c1238 100644 --- a/src/modules/objects/KvsObject_layout.h +++ b/src/modules/objects/KvsObject_layout.h @@ -33,18 +33,18 @@ public: public: QWidget * widget() { return (QWidget *)object(); }; protected: - virtual bool init(KviKvsRunTimeContext * pContext,KviKvsVariantList *pParams); + virtual bool init(KviKvsRunTimeContext * pContext, KviKvsVariantList * pParams); - bool addWidget(KviKvsObjectFunctionCall *c); - bool addMultiCellWidget(KviKvsObjectFunctionCall *c); - bool setRowStretch(KviKvsObjectFunctionCall *c); - bool setColumnStretch(KviKvsObjectFunctionCall *c); - bool setMargin(KviKvsObjectFunctionCall *c); - bool setSpacing(KviKvsObjectFunctionCall *c); - bool addRowSpacing(KviKvsObjectFunctionCall *c); - bool addColSpacing(KviKvsObjectFunctionCall *c); - bool setResizeMode(KviKvsObjectFunctionCall *c); - bool setAlignment(KviKvsObjectFunctionCall *c); + bool addWidget(KviKvsObjectFunctionCall * c); + bool addMultiCellWidget(KviKvsObjectFunctionCall * c); + bool setRowStretch(KviKvsObjectFunctionCall * c); + bool setColumnStretch(KviKvsObjectFunctionCall * c); + bool setMargin(KviKvsObjectFunctionCall * c); + bool setSpacing(KviKvsObjectFunctionCall * c); + bool addRowSpacing(KviKvsObjectFunctionCall * c); + bool addColSpacing(KviKvsObjectFunctionCall * c); + bool setResizeMode(KviKvsObjectFunctionCall * c); + bool setAlignment(KviKvsObjectFunctionCall * c); }; #endif //_CLASS_LAYOUT_H_ diff --git a/src/modules/objects/KvsObject_lcd.cpp b/src/modules/objects/KvsObject_lcd.cpp index 39c8f3489..13b466f5e 100644 --- a/src/modules/objects/KvsObject_lcd.cpp +++ b/src/modules/objects/KvsObject_lcd.cpp @@ -68,123 +68,131 @@ Returns 1 (true) if the number is too big to be displayed in its entirety; otherwise returns 0 (false). */ -KVSO_BEGIN_REGISTERCLASS(KvsObject_lcd,"lcdnumber","widget") - - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_lcd,displayStr) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_lcd,displayInt) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_lcd,displayDouble) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_lcd,setMode) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_lcd,setSegmentStyle) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_lcd,setNumDigits) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_lcd,setSmallDecimalPoint) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_lcd,checkOverflow) +KVSO_BEGIN_REGISTERCLASS(KvsObject_lcd, "lcdnumber", "widget") + +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_lcd, displayStr) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_lcd, displayInt) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_lcd, displayDouble) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_lcd, setMode) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_lcd, setSegmentStyle) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_lcd, setNumDigits) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_lcd, setSmallDecimalPoint) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_lcd, checkOverflow) KVSO_END_REGISTERCLASS(KvsObject_lcd) -KVSO_BEGIN_CONSTRUCTOR(KvsObject_lcd,KvsObject_widget) +KVSO_BEGIN_CONSTRUCTOR(KvsObject_lcd, KvsObject_widget) KVSO_END_CONSTRUCTOR(KvsObject_lcd) - KVSO_BEGIN_DESTRUCTOR(KvsObject_lcd) KVSO_END_CONSTRUCTOR(KvsObject_lcd) -bool KvsObject_lcd::init(KviKvsRunTimeContext *,KviKvsVariantList *) +bool KvsObject_lcd::init(KviKvsRunTimeContext *, KviKvsVariantList *) { SET_OBJECT(QLCDNumber) return true; } -KVSO_CLASS_FUNCTION(lcd,displayInt) +KVSO_CLASS_FUNCTION(lcd, displayInt) { CHECK_INTERNAL_POINTER(widget()) kvs_int_t iDigit; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("number",KVS_PT_INT,0,iDigit) + KVSO_PARAMETER("number", KVS_PT_INT, 0, iDigit) KVSO_PARAMETERS_END(c) ((QLCDNumber *)widget())->display((int)iDigit); return true; } -KVSO_CLASS_FUNCTION(lcd,displayStr) +KVSO_CLASS_FUNCTION(lcd, displayStr) { CHECK_INTERNAL_POINTER(widget()) QString szText; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("number",KVS_PT_STRING,0,szText) + KVSO_PARAMETER("number", KVS_PT_STRING, 0, szText) KVSO_PARAMETERS_END(c) ((QLCDNumber *)widget())->display(szText); return true; } -KVSO_CLASS_FUNCTION(lcd,displayDouble) +KVSO_CLASS_FUNCTION(lcd, displayDouble) { CHECK_INTERNAL_POINTER(widget()) kvs_real_t dDigit; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("number",KVS_PT_DOUBLE,0,dDigit) + KVSO_PARAMETER("number", KVS_PT_DOUBLE, 0, dDigit) KVSO_PARAMETERS_END(c) ((QLCDNumber *)widget())->display(dDigit); return true; } -KVSO_CLASS_FUNCTION(lcd,setMode) +KVSO_CLASS_FUNCTION(lcd, setMode) { CHECK_INTERNAL_POINTER(widget()) QString szMode; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("mode",KVS_PT_STRING,0,szMode) + KVSO_PARAMETER("mode", KVS_PT_STRING, 0, szMode) KVSO_PARAMETERS_END(c) - if(KviQString::equalCI(szMode, "HEX")) ((QLCDNumber *)widget())->setHexMode(); - else if(KviQString::equalCI(szMode, "DEC")) ((QLCDNumber *)widget())->setDecMode(); - else if(KviQString::equalCI(szMode, "BIN")) ((QLCDNumber *)widget())->setBinMode(); - else if(KviQString::equalCI(szMode, "OCT")) ((QLCDNumber *)widget())->setOctMode(); - else c->warning( __tr2qs_ctx("Unknown mode '%Q'","objects"),&szMode); + if(KviQString::equalCI(szMode, "HEX")) + ((QLCDNumber *)widget())->setHexMode(); + else if(KviQString::equalCI(szMode, "DEC")) + ((QLCDNumber *)widget())->setDecMode(); + else if(KviQString::equalCI(szMode, "BIN")) + ((QLCDNumber *)widget())->setBinMode(); + else if(KviQString::equalCI(szMode, "OCT")) + ((QLCDNumber *)widget())->setOctMode(); + else + c->warning(__tr2qs_ctx("Unknown mode '%Q'", "objects"), &szMode); return true; } -KVSO_CLASS_FUNCTION(lcd,setSegmentStyle) +KVSO_CLASS_FUNCTION(lcd, setSegmentStyle) { CHECK_INTERNAL_POINTER(widget()) QString szStyle; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("style",KVS_PT_STRING,0,szStyle) + KVSO_PARAMETER("style", KVS_PT_STRING, 0, szStyle) KVSO_PARAMETERS_END(c) - if(KviQString::equalCI(szStyle, "Outline")) ((QLCDNumber *)widget())->setSegmentStyle(QLCDNumber::Outline); - else if(KviQString::equalCI(szStyle, "Filled")) ((QLCDNumber *)widget())->setSegmentStyle(QLCDNumber::Filled); - else if(KviQString::equalCI(szStyle, "Flat")) ((QLCDNumber *)widget())->setSegmentStyle(QLCDNumber::Flat); - else c->warning( __tr2qs_ctx("Unknown segment style '%Q'","objects"),&szStyle); + if(KviQString::equalCI(szStyle, "Outline")) + ((QLCDNumber *)widget())->setSegmentStyle(QLCDNumber::Outline); + else if(KviQString::equalCI(szStyle, "Filled")) + ((QLCDNumber *)widget())->setSegmentStyle(QLCDNumber::Filled); + else if(KviQString::equalCI(szStyle, "Flat")) + ((QLCDNumber *)widget())->setSegmentStyle(QLCDNumber::Flat); + else + c->warning(__tr2qs_ctx("Unknown segment style '%Q'", "objects"), &szStyle); return true; } -KVSO_CLASS_FUNCTION(lcd,setNumDigits) +KVSO_CLASS_FUNCTION(lcd, setNumDigits) { CHECK_INTERNAL_POINTER(widget()) kvs_real_t digit; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("digit",KVS_PT_DOUBLE,0,digit) + KVSO_PARAMETER("digit", KVS_PT_DOUBLE, 0, digit) KVSO_PARAMETERS_END(c) ((QLCDNumber *)widget())->setDigitCount((int)digit); return true; } -KVSO_CLASS_FUNCTION(lcd,setSmallDecimalPoint) +KVSO_CLASS_FUNCTION(lcd, setSmallDecimalPoint) { CHECK_INTERNAL_POINTER(widget()) bool bFlag; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("bFlag",KVS_PT_BOOLEAN,0,bFlag) + KVSO_PARAMETER("bFlag", KVS_PT_BOOLEAN, 0, bFlag) KVSO_PARAMETERS_END(c) ((QLCDNumber *)widget())->setSmallDecimalPoint(bFlag); return true; } -KVSO_CLASS_FUNCTION(lcd,checkOverflow) +KVSO_CLASS_FUNCTION(lcd, checkOverflow) { CHECK_INTERNAL_POINTER(widget()) kvs_real_t iDigit; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("digit",KVS_PT_DOUBLE,0,iDigit) + KVSO_PARAMETER("digit", KVS_PT_DOUBLE, 0, iDigit) KVSO_PARAMETERS_END(c) c->returnValue()->setBoolean(((QLCDNumber *)widget())->checkOverflow(iDigit)); return true; diff --git a/src/modules/objects/KvsObject_lcd.h b/src/modules/objects/KvsObject_lcd.h index 86212e76b..3595aa164 100644 --- a/src/modules/objects/KvsObject_lcd.h +++ b/src/modules/objects/KvsObject_lcd.h @@ -25,11 +25,8 @@ // //============================================================================= - - #include "KvsObject_widget.h" - class KvsObject_lcd : public KvsObject_widget { public: @@ -37,16 +34,16 @@ public: public: QWidget * widget() { return (QWidget *)object(); }; protected: - virtual bool init(KviKvsRunTimeContext * pContext,KviKvsVariantList *pParams); + virtual bool init(KviKvsRunTimeContext * pContext, KviKvsVariantList * pParams); - bool displayStr(KviKvsObjectFunctionCall *c); - bool setMode(KviKvsObjectFunctionCall *c); - bool setSegmentStyle(KviKvsObjectFunctionCall *c); - bool setNumDigits(KviKvsObjectFunctionCall *c); - bool setSmallDecimalPoint(KviKvsObjectFunctionCall *c); - bool checkOverflow(KviKvsObjectFunctionCall *c); - bool displayInt(KviKvsObjectFunctionCall *c); - bool displayDouble(KviKvsObjectFunctionCall *c); + bool displayStr(KviKvsObjectFunctionCall * c); + bool setMode(KviKvsObjectFunctionCall * c); + bool setSegmentStyle(KviKvsObjectFunctionCall * c); + bool setNumDigits(KviKvsObjectFunctionCall * c); + bool setSmallDecimalPoint(KviKvsObjectFunctionCall * c); + bool checkOverflow(KviKvsObjectFunctionCall * c); + bool displayInt(KviKvsObjectFunctionCall * c); + bool displayDouble(KviKvsObjectFunctionCall * c); }; -#endif // !_CLASS_LCD_H_ +#endif // !_CLASS_LCD_H_ diff --git a/src/modules/objects/KvsObject_lineEdit.cpp b/src/modules/objects/KvsObject_lineEdit.cpp index 7ab7aae0f..a843a6928 100644 --- a/src/modules/objects/KvsObject_lineEdit.cpp +++ b/src/modules/objects/KvsObject_lineEdit.cpp @@ -31,18 +31,18 @@ #include #include static const char * mode_tbl[] = { - "Normal", - "NoEcho", - "Password" - }; + "Normal", + "NoEcho", + "Password" +}; -static const int mode_cod[] = { - QLineEdit::Normal, - QLineEdit::NoEcho, - QLineEdit::Password - }; +static const int mode_cod[] = { + QLineEdit::Normal, + QLineEdit::NoEcho, + QLineEdit::Password +}; -#define mode_num (sizeof(mode_tbl) / sizeof(mode_tbl[0])) +#define mode_num (sizeof(mode_tbl) / sizeof(mode_tbl[0])) /* @doc: lineedit @@ -189,197 +189,194 @@ static const int mode_cod[] = { This signal is emitted by the default implementation of [classfnc]$textChangedEvent[/classfnc](). */ -KVSO_BEGIN_REGISTERCLASS(KvsObject_lineEdit,"lineedit","widget") - - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_lineEdit,text) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_lineEdit,setText) - - // completer - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_lineEdit,setCompleter) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_lineEdit,enableCompleter) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_lineEdit,disableCompleter) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_lineEdit,unsetCompleter) - - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_lineEdit,maxLength) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_lineEdit,setMaxLength) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_lineEdit,frame) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_lineEdit,setCursorPosition) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_lineEdit,cursorPosition) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_lineEdit,setFrame) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_lineEdit,selectAll) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_lineEdit,setSelection) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_lineEdit,copy) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_lineEdit,cut) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_lineEdit,paste) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_lineEdit,echoMode) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_lineEdit,setEchoMode) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_lineEdit,clear) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_lineEdit,dragAndDrop) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_lineEdit,setInputMask) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_lineEdit,setReadOnly) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_lineEdit,returnPressedEvent) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_lineEdit,lostFocusEvent) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_lineEdit,textChangedEvent) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_lineEdit,setInputValidator) - +KVSO_BEGIN_REGISTERCLASS(KvsObject_lineEdit, "lineedit", "widget") + +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_lineEdit, text) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_lineEdit, setText) + +// completer +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_lineEdit, setCompleter) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_lineEdit, enableCompleter) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_lineEdit, disableCompleter) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_lineEdit, unsetCompleter) + +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_lineEdit, maxLength) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_lineEdit, setMaxLength) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_lineEdit, frame) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_lineEdit, setCursorPosition) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_lineEdit, cursorPosition) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_lineEdit, setFrame) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_lineEdit, selectAll) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_lineEdit, setSelection) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_lineEdit, copy) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_lineEdit, cut) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_lineEdit, paste) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_lineEdit, echoMode) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_lineEdit, setEchoMode) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_lineEdit, clear) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_lineEdit, dragAndDrop) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_lineEdit, setInputMask) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_lineEdit, setReadOnly) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_lineEdit, returnPressedEvent) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_lineEdit, lostFocusEvent) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_lineEdit, textChangedEvent) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_lineEdit, setInputValidator) KVSO_END_REGISTERCLASS(KvsObject_lineEdit) - -KVSO_BEGIN_CONSTRUCTOR(KvsObject_lineEdit,KvsObject_widget) - m_pCompleter=0; +KVSO_BEGIN_CONSTRUCTOR(KvsObject_lineEdit, KvsObject_widget) +m_pCompleter = 0; KVSO_END_CONSTRUCTOR(KvsObject_lineEdit) KVSO_BEGIN_DESTRUCTOR(KvsObject_lineEdit) - if (m_pCompleter) - { - delete m_pCompleter; - m_pCompleter=0; - } +if(m_pCompleter) +{ + delete m_pCompleter; + m_pCompleter = 0; +} KVSO_END_CONSTRUCTOR(KvsObject_lineEdit) - -bool KvsObject_lineEdit::init(KviKvsRunTimeContext *,KviKvsVariantList *) +bool KvsObject_lineEdit::init(KviKvsRunTimeContext *, KviKvsVariantList *) { SET_OBJECT(QLineEdit) - connect(widget(),SIGNAL(returnPressed()),this,SLOT(slotreturnPressed())); - connect(widget(),SIGNAL(editingFinished()),this,SLOT(slotlostFocus())); - connect(widget(),SIGNAL(textChanged(const QString & )),this,SLOT(slottextChanged(const QString & ))); + connect(widget(), SIGNAL(returnPressed()), this, SLOT(slotreturnPressed())); + connect(widget(), SIGNAL(editingFinished()), this, SLOT(slotlostFocus())); + connect(widget(), SIGNAL(textChanged(const QString &)), this, SLOT(slottextChanged(const QString &))); return true; } -KVSO_CLASS_FUNCTION(lineEdit,text) +KVSO_CLASS_FUNCTION(lineEdit, text) { CHECK_INTERNAL_POINTER(widget()) c->returnValue()->setString(((QLineEdit *)widget())->text()); return true; } -KVSO_CLASS_FUNCTION(lineEdit,setText) +KVSO_CLASS_FUNCTION(lineEdit, setText) { CHECK_INTERNAL_POINTER(widget()) QString szText; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("text",KVS_PT_STRING,0,szText) + KVSO_PARAMETER("text", KVS_PT_STRING, 0, szText) KVSO_PARAMETERS_END(c) ((QLineEdit *)widget())->setText(szText); return true; } -KVSO_CLASS_FUNCTION(lineEdit,setInputValidator) +KVSO_CLASS_FUNCTION(lineEdit, setInputValidator) { CHECK_INTERNAL_POINTER(widget()) QString szReg; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("reg_expression",KVS_PT_STRING,0,szReg) + KVSO_PARAMETER("reg_expression", KVS_PT_STRING, 0, szReg) KVSO_PARAMETERS_END(c) - ((QLineEdit *)widget())->setValidator(new QRegExpValidator(QRegExp(szReg),((QLineEdit *)widget()))); + ((QLineEdit *)widget())->setValidator(new QRegExpValidator(QRegExp(szReg), ((QLineEdit *)widget()))); return true; } -KVSO_CLASS_FUNCTION(lineEdit,maxLength) +KVSO_CLASS_FUNCTION(lineEdit, maxLength) { CHECK_INTERNAL_POINTER(widget()) c->returnValue()->setInteger(((QLineEdit *)widget())->maxLength()); return true; } -KVSO_CLASS_FUNCTION(lineEdit,setMaxLength) +KVSO_CLASS_FUNCTION(lineEdit, setMaxLength) { CHECK_INTERNAL_POINTER(widget()) kvs_uint_t iMaxlen; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("maxlen",KVS_PT_UNSIGNEDINTEGER,0,iMaxlen) + KVSO_PARAMETER("maxlen", KVS_PT_UNSIGNEDINTEGER, 0, iMaxlen) KVSO_PARAMETERS_END(c) ((QLineEdit *)widget())->setMaxLength(iMaxlen); return true; } -KVSO_CLASS_FUNCTION(lineEdit,frame) +KVSO_CLASS_FUNCTION(lineEdit, frame) { CHECK_INTERNAL_POINTER(widget()) c->returnValue()->setBoolean(((QLineEdit *)widget())->hasFrame()); return true; } -KVSO_CLASS_FUNCTION(lineEdit,setFrame) +KVSO_CLASS_FUNCTION(lineEdit, setFrame) { CHECK_INTERNAL_POINTER(widget()) bool bFrame; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("bFrame",KVS_PT_BOOL,0,bFrame) + KVSO_PARAMETER("bFrame", KVS_PT_BOOL, 0, bFrame) KVSO_PARAMETERS_END(c) ((QLineEdit *)widget())->setFrame(bFrame); return true; } -KVSO_CLASS_FUNCTION(lineEdit,cursorPosition) +KVSO_CLASS_FUNCTION(lineEdit, cursorPosition) { CHECK_INTERNAL_POINTER(widget()) c->returnValue()->setInteger(((QLineEdit *)widget())->cursorPosition()); return true; } -KVSO_CLASS_FUNCTION(lineEdit,setCursorPosition) +KVSO_CLASS_FUNCTION(lineEdit, setCursorPosition) { CHECK_INTERNAL_POINTER(widget()) kvs_uint_t iPos; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("position",KVS_PT_UNSIGNEDINTEGER,0,iPos) + KVSO_PARAMETER("position", KVS_PT_UNSIGNEDINTEGER, 0, iPos) KVSO_PARAMETERS_END(c) ((QLineEdit *)widget())->setCursorPosition(iPos); return true; } -KVSO_CLASS_FUNCTION(lineEdit,selectAll) +KVSO_CLASS_FUNCTION(lineEdit, selectAll) { CHECK_INTERNAL_POINTER(widget()) ((QLineEdit *)widget())->selectAll(); return true; } -KVSO_CLASS_FUNCTION(lineEdit,setSelection) +KVSO_CLASS_FUNCTION(lineEdit, setSelection) { CHECK_INTERNAL_POINTER(widget()) - kvs_uint_t uStart,uLen; + kvs_uint_t uStart, uLen; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("start",KVS_PT_UNSIGNEDINTEGER,0,uStart) - KVSO_PARAMETER("len",KVS_PT_UNSIGNEDINTEGER,0,uLen) + KVSO_PARAMETER("start", KVS_PT_UNSIGNEDINTEGER, 0, uStart) + KVSO_PARAMETER("len", KVS_PT_UNSIGNEDINTEGER, 0, uLen) KVSO_PARAMETERS_END(c) ((QLineEdit *)widget())->setSelection(uStart, uLen); return true; } -KVSO_CLASS_FUNCTION(lineEdit,copy) +KVSO_CLASS_FUNCTION(lineEdit, copy) { CHECK_INTERNAL_POINTER(widget()) ((QLineEdit *)widget())->copy(); return true; } -KVSO_CLASS_FUNCTION(lineEdit,cut) +KVSO_CLASS_FUNCTION(lineEdit, cut) { CHECK_INTERNAL_POINTER(widget()) ((QLineEdit *)widget())->cut(); return true; } -KVSO_CLASS_FUNCTION(lineEdit,paste) +KVSO_CLASS_FUNCTION(lineEdit, paste) { CHECK_INTERNAL_POINTER(widget()) ((QLineEdit *)widget())->paste(); return true; } -KVSO_CLASS_FUNCTION(lineEdit,echoMode) +KVSO_CLASS_FUNCTION(lineEdit, echoMode) { CHECK_INTERNAL_POINTER(widget()) int mode = ((QLineEdit *)widget())->echoMode(); - QString szEchomode=""; + QString szEchomode = ""; for(unsigned int i = 0; i < mode_num; i++) { if(mode == mode_cod[i]) { - szEchomode=mode_tbl[i]; + szEchomode = mode_tbl[i]; break; } } @@ -387,27 +384,26 @@ KVSO_CLASS_FUNCTION(lineEdit,echoMode) return true; } -KVSO_CLASS_FUNCTION(lineEdit,setEchoMode) +KVSO_CLASS_FUNCTION(lineEdit, setEchoMode) { CHECK_INTERNAL_POINTER(widget()) QString szMode; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("mode",KVS_PT_STRING,0,szMode) + KVSO_PARAMETER("mode", KVS_PT_STRING, 0, szMode) KVSO_PARAMETERS_END(c) for(unsigned int i = 0; i < mode_num; i++) { if(KviQString::equalCI(szMode, mode_tbl[i])) { - ((QLineEdit *)widget())->setEchoMode( \ - ((QLineEdit::EchoMode)mode_cod[i])); + ((QLineEdit *)widget())->setEchoMode(((QLineEdit::EchoMode)mode_cod[i])); return true; } } - c->warning(__tr2qs_ctx("Unknown echo mode '%Q'","objects"),&szMode); + c->warning(__tr2qs_ctx("Unknown echo mode '%Q'", "objects"), &szMode); return true; } -KVSO_CLASS_FUNCTION(lineEdit,clear) +KVSO_CLASS_FUNCTION(lineEdit, clear) { CHECK_INTERNAL_POINTER(widget()) ((QLineEdit *)widget())->clear(); @@ -415,47 +411,47 @@ KVSO_CLASS_FUNCTION(lineEdit,clear) } //-| Grifisx & Noldor |-Start: -KVSO_CLASS_FUNCTION(lineEdit,dragAndDrop) +KVSO_CLASS_FUNCTION(lineEdit, dragAndDrop) { CHECK_INTERNAL_POINTER(widget()) bool bEnabled; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("bEnabled",KVS_PT_BOOL,0,bEnabled) + KVSO_PARAMETER("bEnabled", KVS_PT_BOOL, 0, bEnabled) KVSO_PARAMETERS_END(c) ((QLineEdit *)widget())->setDragEnabled(bEnabled); return true; } -KVSO_CLASS_FUNCTION(lineEdit,setReadOnly) +KVSO_CLASS_FUNCTION(lineEdit, setReadOnly) { CHECK_INTERNAL_POINTER(widget()) bool bEnabled; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("bReadonly",KVS_PT_BOOL,0,bEnabled) + KVSO_PARAMETER("bReadonly", KVS_PT_BOOL, 0, bEnabled) KVSO_PARAMETERS_END(c) ((QLineEdit *)widget())->setReadOnly(bEnabled); return true; } -KVSO_CLASS_FUNCTION(lineEdit,setInputMask) +KVSO_CLASS_FUNCTION(lineEdit, setInputMask) { CHECK_INTERNAL_POINTER(widget()) QString szMask; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("mask",KVS_PT_STRING,0,szMask) + KVSO_PARAMETER("mask", KVS_PT_STRING, 0, szMask) KVSO_PARAMETERS_END(c) ((QLineEdit *)widget())->setInputMask(szMask); return true; } -KVSO_CLASS_FUNCTION(lineEdit,setCompleter) +KVSO_CLASS_FUNCTION(lineEdit, setCompleter) { CHECK_INTERNAL_POINTER(widget()) - KviKvsArray *a; + KviKvsArray * a; QString szMode; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("mode",KVS_PT_STRING,KVS_PF_OPTIONAL,szMode) - KVSO_PARAMETER("completion_list",KVS_PT_ARRAY,0,a) + KVSO_PARAMETER("mode", KVS_PT_STRING, KVS_PF_OPTIONAL, szMode) + KVSO_PARAMETER("completion_list", KVS_PT_ARRAY, 0, a) KVSO_PARAMETERS_END(c) if(m_pCompleter) delete m_pCompleter; @@ -473,79 +469,80 @@ KVSO_CLASS_FUNCTION(lineEdit,setCompleter) v->asString(tmp); szCompletionList.append(tmp); } - else szCompletionList.append(""); + else + szCompletionList.append(""); uIdx++; } } - m_pCompleter=new QCompleter(szCompletionList); - QCompleter::CompletionMode mode=QCompleter::PopupCompletion; - if(KviQString::equalCI(szMode,"InlineCompletion")) mode=QCompleter::InlineCompletion; - else if(KviQString::equalCI(szMode,"UnfilteredPopupCompletion")) mode=QCompleter::UnfilteredPopupCompletion; - else if(!KviQString::equalCI(szMode,"PopupCompletion")) - c->warning(__tr2qs_ctx("Unknown '%Q' completion mode, switching to default PopupCompletion","objects"),&szMode); + m_pCompleter = new QCompleter(szCompletionList); + QCompleter::CompletionMode mode = QCompleter::PopupCompletion; + if(KviQString::equalCI(szMode, "InlineCompletion")) + mode = QCompleter::InlineCompletion; + else if(KviQString::equalCI(szMode, "UnfilteredPopupCompletion")) + mode = QCompleter::UnfilteredPopupCompletion; + else if(!KviQString::equalCI(szMode, "PopupCompletion")) + c->warning(__tr2qs_ctx("Unknown '%Q' completion mode, switching to default PopupCompletion", "objects"), &szMode); m_pCompleter->setCompletionMode(mode); ((QLineEdit *)widget())->setCompleter(m_pCompleter); return true; } -KVSO_CLASS_FUNCTION(lineEdit,enableCompleter) +KVSO_CLASS_FUNCTION(lineEdit, enableCompleter) { CHECK_INTERNAL_POINTER(widget()) - if (m_pCompleter) ((QLineEdit *)widget())->setCompleter(m_pCompleter); + if(m_pCompleter) + ((QLineEdit *)widget())->setCompleter(m_pCompleter); return true; } -KVSO_CLASS_FUNCTION(lineEdit,disableCompleter) +KVSO_CLASS_FUNCTION(lineEdit, disableCompleter) { CHECK_INTERNAL_POINTER(widget()) ((QLineEdit *)widget())->setCompleter(0); return true; } -KVSO_CLASS_FUNCTION(lineEdit,unsetCompleter) +KVSO_CLASS_FUNCTION(lineEdit, unsetCompleter) { CHECK_INTERNAL_POINTER(widget()) - if (m_pCompleter) + if(m_pCompleter) { ((QLineEdit *)widget())->setCompleter(0); delete m_pCompleter; - m_pCompleter=0; + m_pCompleter = 0; } return true; } - -KVSO_CLASS_FUNCTION(lineEdit,returnPressedEvent) +KVSO_CLASS_FUNCTION(lineEdit, returnPressedEvent) { - emitSignal("returnPressed",c); + emitSignal("returnPressed", c); return true; } void KvsObject_lineEdit::slotreturnPressed() { KviKvsVariantList * params = 0; - callFunction(this,"returnPressedEvent",params); - + callFunction(this, "returnPressedEvent", params); } -KVSO_CLASS_FUNCTION(lineEdit,lostFocusEvent) +KVSO_CLASS_FUNCTION(lineEdit, lostFocusEvent) { - emitSignal("lostFocus",c); + emitSignal("lostFocus", c); return true; } void KvsObject_lineEdit::slotlostFocus() { KviKvsVariantList * params = 0; - callFunction(this,"lostFocusEvent",params); + callFunction(this, "lostFocusEvent", params); } -KVSO_CLASS_FUNCTION(lineEdit,textChangedEvent) +KVSO_CLASS_FUNCTION(lineEdit, textChangedEvent) { - emitSignal("textChanged",c,c->params()); + emitSignal("textChanged", c, c->params()); return true; - } -void KvsObject_lineEdit::slottextChanged(const QString &text) +void KvsObject_lineEdit::slottextChanged(const QString & text) { KviKvsVariantList params(new KviKvsVariant(text)); - callFunction(this,"textChangedEvent",¶ms); + callFunction(this, "textChangedEvent", ¶ms); } diff --git a/src/modules/objects/KvsObject_lineEdit.h b/src/modules/objects/KvsObject_lineEdit.h index d6dbe87bc..a004190a2 100644 --- a/src/modules/objects/KvsObject_lineEdit.h +++ b/src/modules/objects/KvsObject_lineEdit.h @@ -1,5 +1,5 @@ -#ifndef _CLASS_LINEEDIT_H_ -#define _CLASS_LINEEDIT_H_ +#ifndef _CLASS_LINEEDIT_H_ +#define _CLASS_LINEEDIT_H_ //============================================================================= // // File : KvsObject_lineEdit.h @@ -25,8 +25,6 @@ // //============================================================================= - - #include "KvsObject_widget.h" //#warning "Signals!" @@ -42,49 +40,47 @@ public: QWidget * widget() { return (QWidget *)object(); }; protected: QCompleter * m_pCompleter; -protected: - virtual bool init(KviKvsRunTimeContext * pContext,KviKvsVariantList *pParams); - - bool setCompleter(KviKvsObjectFunctionCall *c); - bool enableCompleter(KviKvsObjectFunctionCall *c); - bool disableCompleter(KviKvsObjectFunctionCall *c); - bool unsetCompleter(KviKvsObjectFunctionCall *c); - - bool text(KviKvsObjectFunctionCall *c); - bool setText(KviKvsObjectFunctionCall *c); - bool maxLength(KviKvsObjectFunctionCall *c); - bool setMaxLength(KviKvsObjectFunctionCall *c); - bool frame(KviKvsObjectFunctionCall *c); - bool setCursorPosition(KviKvsObjectFunctionCall *c); - bool cursorPosition(KviKvsObjectFunctionCall *c); - bool setFrame(KviKvsObjectFunctionCall *c); - bool selectAll(KviKvsObjectFunctionCall *c); - bool setSelection(KviKvsObjectFunctionCall *c); - bool copy(KviKvsObjectFunctionCall *c); - bool cut(KviKvsObjectFunctionCall *c); - - bool paste(KviKvsObjectFunctionCall *c); - bool echoMode(KviKvsObjectFunctionCall *c); - bool setEchoMode(KviKvsObjectFunctionCall *c); - bool clear(KviKvsObjectFunctionCall *c); - bool dragAndDrop(KviKvsObjectFunctionCall *c); - bool setInputMask(KviKvsObjectFunctionCall *c); - bool setReadOnly(KviKvsObjectFunctionCall *c); - - bool returnPressedEvent(KviKvsObjectFunctionCall *c); - bool lostFocusEvent(KviKvsObjectFunctionCall *c); - - bool textChangedEvent(KviKvsObjectFunctionCall *c); - - - bool setInputValidator(KviKvsObjectFunctionCall *c); +protected: + virtual bool init(KviKvsRunTimeContext * pContext, KviKvsVariantList * pParams); + + bool setCompleter(KviKvsObjectFunctionCall * c); + bool enableCompleter(KviKvsObjectFunctionCall * c); + bool disableCompleter(KviKvsObjectFunctionCall * c); + bool unsetCompleter(KviKvsObjectFunctionCall * c); + + bool text(KviKvsObjectFunctionCall * c); + bool setText(KviKvsObjectFunctionCall * c); + bool maxLength(KviKvsObjectFunctionCall * c); + bool setMaxLength(KviKvsObjectFunctionCall * c); + bool frame(KviKvsObjectFunctionCall * c); + bool setCursorPosition(KviKvsObjectFunctionCall * c); + bool cursorPosition(KviKvsObjectFunctionCall * c); + bool setFrame(KviKvsObjectFunctionCall * c); + bool selectAll(KviKvsObjectFunctionCall * c); + bool setSelection(KviKvsObjectFunctionCall * c); + bool copy(KviKvsObjectFunctionCall * c); + bool cut(KviKvsObjectFunctionCall * c); + + bool paste(KviKvsObjectFunctionCall * c); + bool echoMode(KviKvsObjectFunctionCall * c); + bool setEchoMode(KviKvsObjectFunctionCall * c); + bool clear(KviKvsObjectFunctionCall * c); + bool dragAndDrop(KviKvsObjectFunctionCall * c); + bool setInputMask(KviKvsObjectFunctionCall * c); + bool setReadOnly(KviKvsObjectFunctionCall * c); + + bool returnPressedEvent(KviKvsObjectFunctionCall * c); + + bool lostFocusEvent(KviKvsObjectFunctionCall * c); + + bool textChangedEvent(KviKvsObjectFunctionCall * c); + + bool setInputValidator(KviKvsObjectFunctionCall * c); protected slots: void slotreturnPressed(); void slotlostFocus(); void slottextChanged(const QString &); - }; - -#endif // ! _CLASS_LINEEDIT_H_ +#endif // ! _CLASS_LINEEDIT_H_ diff --git a/src/modules/objects/KvsObject_list.cpp b/src/modules/objects/KvsObject_list.cpp index a996df2cc..f5996d173 100644 --- a/src/modules/objects/KvsObject_list.cpp +++ b/src/modules/objects/KvsObject_list.cpp @@ -28,7 +28,6 @@ #include "KvsObject_list.h" #include - /* @doc: list @keyterms: @@ -115,45 +114,42 @@ beyond the end of the list). */ - -KVSO_BEGIN_REGISTERCLASS(KvsObject_list,"list","object") - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_list,count) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_list,isEmpty) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_list,clear) - KVSO_REGISTER_HANDLER(KvsObject_list,"removeAll",clear) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_list,append) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_list,prepend) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_list,insert) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_list,insert) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_list,at) - KVSO_REGISTER_HANDLER(KvsObject_list,"item",at) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_list,remove) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_list,removeFirst) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_list,removeLast) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_list,removeCurrent) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_list,moveFirst) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_list,moveNext) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_list,movePrev) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_list,moveLast) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_list,sort) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_list,eof) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_list,current) +KVSO_BEGIN_REGISTERCLASS(KvsObject_list, "list", "object") +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_list, count) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_list, isEmpty) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_list, clear) +KVSO_REGISTER_HANDLER(KvsObject_list, "removeAll", clear) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_list, append) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_list, prepend) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_list, insert) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_list, insert) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_list, at) +KVSO_REGISTER_HANDLER(KvsObject_list, "item", at) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_list, remove) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_list, removeFirst) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_list, removeLast) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_list, removeCurrent) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_list, moveFirst) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_list, moveNext) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_list, movePrev) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_list, moveLast) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_list, sort) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_list, eof) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_list, current) KVSO_END_REGISTERCLASS(KvsObject_list) - -KVSO_BEGIN_CONSTRUCTOR(KvsObject_list,KviKvsObject) - m_pDataList = new KviPointerList; - m_pDataList->setAutoDelete(true); - m_pDataList->first(); +KVSO_BEGIN_CONSTRUCTOR(KvsObject_list, KviKvsObject) +m_pDataList = new KviPointerList; +m_pDataList->setAutoDelete(true); +m_pDataList->first(); KVSO_END_CONSTRUCTOR(KvsObject_list) - KVSO_BEGIN_DESTRUCTOR(KvsObject_list) - delete m_pDataList; - m_pDataList = 0; +delete m_pDataList; +m_pDataList = 0; KVSO_END_CONSTRUCTOR(KvsObject_list) -KVSO_CLASS_FUNCTION(list,current) +KVSO_CLASS_FUNCTION(list, current) { CHECK_INTERNAL_POINTER(m_pDataList) if(!m_pDataList->count()) @@ -162,160 +158,167 @@ KVSO_CLASS_FUNCTION(list,current) return true; } KviKvsVariant * v = m_pDataList->safeCurrent(); - if(v)c->returnValue()->copyFrom(*v); - else c->returnValue()->setNothing(); + if(v) + c->returnValue()->copyFrom(*v); + else + c->returnValue()->setNothing(); return true; } -KVSO_CLASS_FUNCTION(list,eof) +KVSO_CLASS_FUNCTION(list, eof) { CHECK_INTERNAL_POINTER(m_pDataList) c->returnValue()->setBoolean(m_pDataList->current() != 0); return true; } -KVSO_CLASS_FUNCTION(list,moveLast) +KVSO_CLASS_FUNCTION(list, moveLast) { CHECK_INTERNAL_POINTER(m_pDataList) c->returnValue()->setBoolean(m_pDataList->last() != 0); return true; } -KVSO_CLASS_FUNCTION(list,movePrev) +KVSO_CLASS_FUNCTION(list, movePrev) { CHECK_INTERNAL_POINTER(m_pDataList) c->returnValue()->setBoolean(m_pDataList->prev() != 0); return true; } -KVSO_CLASS_FUNCTION(list,moveNext) +KVSO_CLASS_FUNCTION(list, moveNext) { CHECK_INTERNAL_POINTER(m_pDataList) c->returnValue()->setBoolean(m_pDataList->next() != 0); return true; } -KVSO_CLASS_FUNCTION(list,moveFirst) +KVSO_CLASS_FUNCTION(list, moveFirst) { CHECK_INTERNAL_POINTER(m_pDataList) c->returnValue()->setBoolean(m_pDataList->first() != 0); return true; } -KVSO_CLASS_FUNCTION(list,removeLast) +KVSO_CLASS_FUNCTION(list, removeLast) { CHECK_INTERNAL_POINTER(m_pDataList) c->returnValue()->setBoolean(m_pDataList->removeLast()); return true; } -KVSO_CLASS_FUNCTION(list,removeCurrent) +KVSO_CLASS_FUNCTION(list, removeCurrent) { CHECK_INTERNAL_POINTER(m_pDataList) if(m_pDataList->count()) { m_pDataList->removeCurrent(); c->returnValue()->setBoolean(true); - } else { + } + else + { c->returnValue()->setBoolean(false); } return true; } -KVSO_CLASS_FUNCTION(list,removeFirst) +KVSO_CLASS_FUNCTION(list, removeFirst) { CHECK_INTERNAL_POINTER(m_pDataList) c->returnValue()->setBoolean(m_pDataList->removeFirst()); return true; } -KVSO_CLASS_FUNCTION(list,remove) +KVSO_CLASS_FUNCTION(list, remove) { CHECK_INTERNAL_POINTER(m_pDataList) kvs_uint_t uIndex; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("index",KVS_PT_UINT,0,uIndex) + KVSO_PARAMETER("index", KVS_PT_UINT, 0, uIndex) KVSO_PARAMETERS_END(c) c->returnValue()->setBoolean(m_pDataList->remove(uIndex)); return true; } -KVSO_CLASS_FUNCTION(list,at) +KVSO_CLASS_FUNCTION(list, at) { CHECK_INTERNAL_POINTER(m_pDataList) kvs_uint_t uIndex; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("index",KVS_PT_UINT,0,uIndex) + KVSO_PARAMETER("index", KVS_PT_UINT, 0, uIndex) KVSO_PARAMETERS_END(c) KviKvsVariant * v = m_pDataList->at(uIndex); - if(v)c->returnValue()->copyFrom(*v); - else c->returnValue()->setNothing(); + if(v) + c->returnValue()->copyFrom(*v); + else + c->returnValue()->setNothing(); return true; } -KVSO_CLASS_FUNCTION(list,insert) +KVSO_CLASS_FUNCTION(list, insert) { CHECK_INTERNAL_POINTER(m_pDataList) kvs_uint_t uIndex; KviKvsVariant * pVar; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("index",KVS_PT_UINT,0,uIndex) - KVSO_PARAMETER("item",KVS_PT_VARIANT,0,pVar) + KVSO_PARAMETER("index", KVS_PT_UINT, 0, uIndex) + KVSO_PARAMETER("item", KVS_PT_VARIANT, 0, pVar) KVSO_PARAMETERS_END(c) - m_pDataList->insert(uIndex,new KviKvsVariant(*pVar)); + m_pDataList->insert(uIndex, new KviKvsVariant(*pVar)); return true; } -KVSO_CLASS_FUNCTION(list,prepend) +KVSO_CLASS_FUNCTION(list, prepend) { CHECK_INTERNAL_POINTER(m_pDataList) KviKvsVariant * pVar; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("item",KVS_PT_VARIANT,0,pVar) + KVSO_PARAMETER("item", KVS_PT_VARIANT, 0, pVar) KVSO_PARAMETERS_END(c) m_pDataList->prepend(new KviKvsVariant(*pVar)); return true; } -KVSO_CLASS_FUNCTION(list,append) +KVSO_CLASS_FUNCTION(list, append) { CHECK_INTERNAL_POINTER(m_pDataList) KviKvsVariant * pVar; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("item",KVS_PT_VARIANT,0,pVar) + KVSO_PARAMETER("item", KVS_PT_VARIANT, 0, pVar) KVSO_PARAMETERS_END(c) m_pDataList->append(new KviKvsVariant(*pVar)); - if (m_pDataList->count()==1) m_pDataList->first(); + if(m_pDataList->count() == 1) + m_pDataList->first(); return true; } -KVSO_CLASS_FUNCTION(list,clear) +KVSO_CLASS_FUNCTION(list, clear) { CHECK_INTERNAL_POINTER(m_pDataList) m_pDataList->clear(); return true; } -inline int kvi_compare(const KviKvsVariant * p1,const KviKvsVariant * p2) +inline int kvi_compare(const KviKvsVariant * p1, const KviKvsVariant * p2) { return p1->compare(p2); } -KVSO_CLASS_FUNCTION(list,sort) +KVSO_CLASS_FUNCTION(list, sort) { CHECK_INTERNAL_POINTER(m_pDataList) m_pDataList->sort(); return true; } -KVSO_CLASS_FUNCTION(list,isEmpty) +KVSO_CLASS_FUNCTION(list, isEmpty) { CHECK_INTERNAL_POINTER(m_pDataList) c->returnValue()->setBoolean(m_pDataList->isEmpty()); return true; } -KVSO_CLASS_FUNCTION(list,count) +KVSO_CLASS_FUNCTION(list, count) { CHECK_INTERNAL_POINTER(m_pDataList) c->returnValue()->setInteger(m_pDataList->count()); diff --git a/src/modules/objects/KvsObject_list.h b/src/modules/objects/KvsObject_list.h index 0403b0418..3edff1ec0 100644 --- a/src/modules/objects/KvsObject_list.h +++ b/src/modules/objects/KvsObject_list.h @@ -30,35 +30,34 @@ #include "KviKvsVariant.h" #include "object_macros.h" - class KvsObject_list : public KviKvsObject { public: KVSO_DECLARE_OBJECT(KvsObject_list) protected: KviPointerList * m_pDataList; + protected: KviPointerList * dataList() const { return m_pDataList; }; public: - bool count(KviKvsObjectFunctionCall *c); - bool isEmpty(KviKvsObjectFunctionCall *c); - bool clear(KviKvsObjectFunctionCall *c); - bool append(KviKvsObjectFunctionCall *c); - bool prepend(KviKvsObjectFunctionCall *c); - bool insert(KviKvsObjectFunctionCall *c); - bool at(KviKvsObjectFunctionCall *c); - bool remove(KviKvsObjectFunctionCall *c); - bool removeFirst(KviKvsObjectFunctionCall *c); - bool removeLast(KviKvsObjectFunctionCall *c); - bool removeCurrent(KviKvsObjectFunctionCall *c); - bool moveFirst(KviKvsObjectFunctionCall *c); - bool moveNext(KviKvsObjectFunctionCall *c); - bool movePrev(KviKvsObjectFunctionCall *c); - bool moveLast(KviKvsObjectFunctionCall *c); - bool eof(KviKvsObjectFunctionCall *c); - bool current(KviKvsObjectFunctionCall *c); - bool sort(KviKvsObjectFunctionCall *c); + bool count(KviKvsObjectFunctionCall * c); + bool isEmpty(KviKvsObjectFunctionCall * c); + bool clear(KviKvsObjectFunctionCall * c); + bool append(KviKvsObjectFunctionCall * c); + bool prepend(KviKvsObjectFunctionCall * c); + bool insert(KviKvsObjectFunctionCall * c); + bool at(KviKvsObjectFunctionCall * c); + bool remove(KviKvsObjectFunctionCall * c); + bool removeFirst(KviKvsObjectFunctionCall * c); + bool removeLast(KviKvsObjectFunctionCall * c); + bool removeCurrent(KviKvsObjectFunctionCall * c); + bool moveFirst(KviKvsObjectFunctionCall * c); + bool moveNext(KviKvsObjectFunctionCall * c); + bool movePrev(KviKvsObjectFunctionCall * c); + bool moveLast(KviKvsObjectFunctionCall * c); + bool eof(KviKvsObjectFunctionCall * c); + bool current(KviKvsObjectFunctionCall * c); + bool sort(KviKvsObjectFunctionCall * c); }; - #endif //_CLASS_LIST_H_ diff --git a/src/modules/objects/KvsObject_listWidget.cpp b/src/modules/objects/KvsObject_listWidget.cpp index 59c860509..80115a989 100644 --- a/src/modules/objects/KvsObject_listWidget.cpp +++ b/src/modules/objects/KvsObject_listWidget.cpp @@ -53,7 +53,7 @@ const char * const itemflags_tbl[] = { "tristate" }; -#define itemflags_num (sizeof(itemflags_tbl) / sizeof(itemflags_tbl[0])) +#define itemflags_num (sizeof(itemflags_tbl) / sizeof(itemflags_tbl[0])) /* @doc:listbox @@ -155,241 +155,266 @@ const char * const itemflags_tbl[] = { This signal is emitted by the default implementation of [classfnc]$selectionChangedEvent[/classfnc]().[br] */ -KVSO_BEGIN_REGISTERCLASS(KvsObject_listWidget,"listbox","widget") - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_listWidget,insertItem) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_listWidget,insertWidgetItem) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_listWidget,changeItem) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_listWidget,removeItem) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_listWidget,clear) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_listWidget,count) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_listWidget,currentText) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_listWidget,currentItem) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_listWidget,textAt); - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_listWidget,itemAt); - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_listWidget,itemRect); - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_listWidget,setCurrentItem); - - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_listWidget,selectedItems); - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_listWidget,setSelected); - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_listWidget,isSelected); - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_listWidget,setFont); - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_listWidget,setIcon); - - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_listWidget,setFlags) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_listWidget,setChecked); - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_listWidget,isChecked); - - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_listWidget,setSelectionMode); - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_listWidget,selectionMode); - - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_listWidget,setForeground); - - // events - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_listWidget,currentItemChangedEvent); - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_listWidget,itemChangedEvent); - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_listWidget,itemEnteredEvent); - KVSO_REGISTER_STANDARD_NOTHINGRETURN_HANDLER(KvsObject_listWidget,"selectionChangedEvent") - +KVSO_BEGIN_REGISTERCLASS(KvsObject_listWidget, "listbox", "widget") +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_listWidget, insertItem) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_listWidget, insertWidgetItem) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_listWidget, changeItem) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_listWidget, removeItem) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_listWidget, clear) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_listWidget, count) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_listWidget, currentText) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_listWidget, currentItem) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_listWidget, textAt); +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_listWidget, itemAt); +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_listWidget, itemRect); +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_listWidget, setCurrentItem); + +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_listWidget, selectedItems); +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_listWidget, setSelected); +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_listWidget, isSelected); +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_listWidget, setFont); +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_listWidget, setIcon); + +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_listWidget, setFlags) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_listWidget, setChecked); +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_listWidget, isChecked); + +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_listWidget, setSelectionMode); +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_listWidget, selectionMode); + +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_listWidget, setForeground); + +// events +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_listWidget, currentItemChangedEvent); +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_listWidget, itemChangedEvent); +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_listWidget, itemEnteredEvent); +KVSO_REGISTER_STANDARD_NOTHINGRETURN_HANDLER(KvsObject_listWidget, "selectionChangedEvent") KVSO_END_REGISTERCLASS(KvsObject_listWidget) -KVSO_BEGIN_CONSTRUCTOR(KvsObject_listWidget,KvsObject_widget) +KVSO_BEGIN_CONSTRUCTOR(KvsObject_listWidget, KvsObject_widget) KVSO_END_CONSTRUCTOR(KvsObject_listWidget) - KVSO_BEGIN_DESTRUCTOR(KvsObject_listWidget) KVSO_END_CONSTRUCTOR(KvsObject_listWidget) -bool KvsObject_listWidget::init(KviKvsRunTimeContext *,KviKvsVariantList *) +bool KvsObject_listWidget::init(KviKvsRunTimeContext *, KviKvsVariantList *) { SET_OBJECT(QListWidget) obj->setSelectionMode(QAbstractItemView::SingleSelection); - connect(obj,SIGNAL(itemSelectionChanged()),this,SLOT(selectionChanged())); - connect(obj,SIGNAL(currentItemChanged(QListWidgetItem *,QListWidgetItem *)),this,SLOT(currentItemChanged(QListWidgetItem *,QListWidgetItem *))); - connect(obj,SIGNAL(itemEntered(QListWidgetItem *)),this,SLOT(slotItemEntered(QListWidgetItem *))); - connect(obj,SIGNAL(itemChanged(QListWidgetItem *)),this,SLOT(slotItemChanged(QListWidgetItem *))); + connect(obj, SIGNAL(itemSelectionChanged()), this, SLOT(selectionChanged())); + connect(obj, SIGNAL(currentItemChanged(QListWidgetItem *, QListWidgetItem *)), this, SLOT(currentItemChanged(QListWidgetItem *, QListWidgetItem *))); + connect(obj, SIGNAL(itemEntered(QListWidgetItem *)), this, SLOT(slotItemEntered(QListWidgetItem *))); + connect(obj, SIGNAL(itemChanged(QListWidgetItem *)), this, SLOT(slotItemChanged(QListWidgetItem *))); return true; } -KVSO_CLASS_FUNCTION(listWidget,insertItem) +KVSO_CLASS_FUNCTION(listWidget, insertItem) { CHECK_INTERNAL_POINTER(widget()) kvs_int_t iRow; QString szText; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("text",KVS_PT_STRING,0,szText) - KVSO_PARAMETER("index",KVS_PT_INT,KVS_PF_OPTIONAL,iRow) + KVSO_PARAMETER("text", KVS_PT_STRING, 0, szText) + KVSO_PARAMETER("index", KVS_PT_INT, KVS_PF_OPTIONAL, iRow) KVSO_PARAMETERS_END(c) - if (c->parameterCount()==2) ((QListWidget *)widget())->insertItem(iRow, szText); - else ((QListWidget *)widget())->addItem(szText); + if(c->parameterCount() == 2) + ((QListWidget *)widget())->insertItem(iRow, szText); + else + ((QListWidget *)widget())->addItem(szText); return true; } -KVSO_CLASS_FUNCTION(listWidget,setFlags) +KVSO_CLASS_FUNCTION(listWidget, setFlags) { CHECK_INTERNAL_POINTER(widget()) QStringList itemflags; kvs_uint_t iIdx; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("index",KVS_PT_UNSIGNEDINTEGER,0,iIdx) - KVSO_PARAMETER("flags",KVS_PT_STRINGLIST,KVS_PF_OPTIONAL,itemflags) + KVSO_PARAMETER("index", KVS_PT_UNSIGNEDINTEGER, 0, iIdx) + KVSO_PARAMETER("flags", KVS_PT_STRINGLIST, KVS_PF_OPTIONAL, itemflags) KVSO_PARAMETERS_END(c) - int flag,sum=0; - QListWidgetItem *pItem=((QListWidget *)widget())->item(iIdx); - if(!pItem) return true; - for ( int i=0;iitem(iIdx); + if(!pItem) + return true; + for(int i = 0; i < itemflags.count(); i++) { flag = 0; for(unsigned int j = 0; j < itemflags_num; j++) { if(KviQString::equalCI(itemflags.at(i), itemflags_tbl[j])) { - flag=item_flags[j]; + flag = item_flags[j]; break; } } - if(flag){ - if (flag==Qt::ItemIsUserCheckable) - pItem->setCheckState(Qt::Unchecked); + if(flag) + { + if(flag == Qt::ItemIsUserCheckable) + pItem->setCheckState(Qt::Unchecked); sum = sum | flag; } else - c->warning(__tr2qs_ctx("Unknown item flag '%Q'","objects"),&itemflags.at(i)); + c->warning(__tr2qs_ctx("Unknown item flag '%Q'", "objects"), &itemflags.at(i)); } pItem->setFlags((Qt::ItemFlags)sum); return true; } -KVSO_CLASS_FUNCTION(listWidget,setChecked) +KVSO_CLASS_FUNCTION(listWidget, setChecked) { bool bChecked; kvs_uint_t iIdx; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("index",KVS_PT_UNSIGNEDINTEGER,0,iIdx) - KVSO_PARAMETER("bChecked",KVS_PT_BOOL,0,bChecked) + KVSO_PARAMETER("index", KVS_PT_UNSIGNEDINTEGER, 0, iIdx) + KVSO_PARAMETER("bChecked", KVS_PT_BOOL, 0, bChecked) KVSO_PARAMETERS_END(c) - QListWidgetItem *pItem=((QListWidget *)widget())->item(iIdx); - if(!pItem) return true; - pItem->setCheckState(bChecked?Qt::Checked:Qt::Unchecked); + QListWidgetItem * pItem = ((QListWidget *)widget())->item(iIdx); + if(!pItem) + return true; + pItem->setCheckState(bChecked ? Qt::Checked : Qt::Unchecked); return true; } -KVSO_CLASS_FUNCTION(listWidget,isChecked) +KVSO_CLASS_FUNCTION(listWidget, isChecked) { kvs_uint_t iIdx; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("index",KVS_PT_UNSIGNEDINTEGER,0,iIdx) + KVSO_PARAMETER("index", KVS_PT_UNSIGNEDINTEGER, 0, iIdx) KVSO_PARAMETERS_END(c) - QListWidgetItem *pItem=((QListWidget *)widget())->item(iIdx); - if(!pItem) return true; - c->returnValue()->setBoolean(pItem->checkState()==Qt::Checked?1:0); + QListWidgetItem * pItem = ((QListWidget *)widget())->item(iIdx); + if(!pItem) + return true; + c->returnValue()->setBoolean(pItem->checkState() == Qt::Checked ? 1 : 0); return true; } -KVSO_CLASS_FUNCTION(listWidget,setFont) +KVSO_CLASS_FUNCTION(listWidget, setFont) { CHECK_INTERNAL_POINTER(widget()) QString szFamily; QStringList szListStyle; - kvs_int_t iSize,iIdx; + kvs_int_t iSize, iIdx; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("index",KVS_PT_INTEGER,0,iIdx) - KVSO_PARAMETER("size",KVS_PT_INTEGER,0,iSize) - KVSO_PARAMETER("family",KVS_PT_STRING,0,szFamily) - KVSO_PARAMETER("style",KVS_PT_STRINGLIST,KVS_PF_OPTIONAL,szListStyle) + KVSO_PARAMETER("index", KVS_PT_INTEGER, 0, iIdx) + KVSO_PARAMETER("size", KVS_PT_INTEGER, 0, iSize) + KVSO_PARAMETER("family", KVS_PT_STRING, 0, szFamily) + KVSO_PARAMETER("style", KVS_PT_STRINGLIST, KVS_PF_OPTIONAL, szListStyle) KVSO_PARAMETERS_END(c) - QListWidgetItem *pItem=((QListWidget *)widget())->item(iIdx); - if(!pItem) return true; - QFont font=widget()->font(); - if(!szFamily.isEmpty()) font.setFamily(szFamily); - if(iSize) font.setPointSize(iSize); + QListWidgetItem * pItem = ((QListWidget *)widget())->item(iIdx); + if(!pItem) + return true; + QFont font = widget()->font(); + if(!szFamily.isEmpty()) + font.setFamily(szFamily); + if(iSize) + font.setPointSize(iSize); QString szStyle; - for(int i=0;iwarning(__tr2qs_ctx("Unknown style '%Q'","objects"),&szStyle); + szStyle = szListStyle.at(i); + if(KviQString::equalCI(szStyle, "italic")) + font.setItalic(true); + else if(KviQString::equalCI(szStyle, "bold")) + font.setBold(true); + else if(KviQString::equalCI(szStyle, "underline")) + font.setUnderline(true); + else if(KviQString::equalCI(szStyle, "overline")) + font.setOverline(true); + else if(KviQString::equalCI(szStyle, "strikeout")) + font.setStrikeOut(true); + else if(KviQString::equalCI(szStyle, "fixedpitch")) + font.setFixedPitch(true); + else + c->warning(__tr2qs_ctx("Unknown style '%Q'", "objects"), &szStyle); } pItem->setFont(font); return true; } -KVSO_CLASS_FUNCTION(listWidget,setIcon) +KVSO_CLASS_FUNCTION(listWidget, setIcon) { CHECK_INTERNAL_POINTER(widget()) kvs_uint_t uIdx; - KviKvsObject *obPixmap; + KviKvsObject * obPixmap; kvs_hobject_t obHpixmap; KviKvsVariant * vPixmap; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("column",KVS_PT_UNSIGNEDINTEGER,0,uIdx) - KVSO_PARAMETER("pixmap",KVS_PT_VARIANT,0,vPixmap) + KVSO_PARAMETER("column", KVS_PT_UNSIGNEDINTEGER, 0, uIdx) + KVSO_PARAMETER("pixmap", KVS_PT_VARIANT, 0, vPixmap) KVSO_PARAMETERS_END(c) - QListWidgetItem *pItem=((QListWidget *)widget())->item(uIdx); - if(!pItem) return true; + QListWidgetItem * pItem = ((QListWidget *)widget())->item(uIdx); + if(!pItem) + return true; - QPixmap *pix = 0; - if (vPixmap->isEmpty()) {pItem->setIcon(QIcon());return true;} + QPixmap * pix = 0; + if(vPixmap->isEmpty()) + { + pItem->setIcon(QIcon()); + return true; + } if(vPixmap->isHObject()) { vPixmap->asHObject(obHpixmap); - obPixmap=KviKvsKernel::instance()->objectController()->lookupObject(obHpixmap); - if (!obPixmap->inheritsClass("pixmap")) + obPixmap = KviKvsKernel::instance()->objectController()->lookupObject(obHpixmap); + if(!obPixmap->inheritsClass("pixmap")) { - c->warning(__tr2qs_ctx("Pixmap object or image ID required","objects")); + c->warning(__tr2qs_ctx("Pixmap object or image ID required", "objects")); return true; } - pix=((KvsObject_pixmap *)obPixmap)->getPixmap(); - } else { + pix = ((KvsObject_pixmap *)obPixmap)->getPixmap(); + } + else + { QString szPix; vPixmap->asString(szPix); - pix=g_pIconManager->getImage(szPix); + pix = g_pIconManager->getImage(szPix); if(!pix) { - c->warning(__tr2qs_ctx("Error occurred: the suitable file '%Q' is not of the correct format or it is not a valid icon number.","objects"),&szPix); + c->warning(__tr2qs_ctx("Error occurred: the suitable file '%Q' is not of the correct format or it is not a valid icon number.", "objects"), &szPix); return true; } } - if(pix){ + if(pix) + { pItem->setIcon(*pix); } - else{ + else + { pItem->setIcon(QIcon()); } return true; } -KVSO_CLASS_FUNCTION(listWidget,setForeground) +KVSO_CLASS_FUNCTION(listWidget, setForeground) { CHECK_INTERNAL_POINTER(widget()) - kvs_int_t iCol1,iCol2,iCol3,iOpacity,iIdx; - QString szColorMode,szColor; - KviKvsVariant *var1,*var2,*var3; + kvs_int_t iCol1, iCol2, iCol3, iOpacity, iIdx; + QString szColorMode, szColor; + KviKvsVariant *var1, *var2, *var3; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("index",KVS_PT_INTEGER,0,iIdx) - KVSO_PARAMETER("Color_1_Or_Colorname",KVS_PT_VARIANT,0,var1) - KVSO_PARAMETER("Color_2",KVS_PT_VARIANT,KVS_PF_OPTIONAL,var2) - KVSO_PARAMETER("Colo3_3",KVS_PT_VARIANT,KVS_PF_OPTIONAL,var3) - KVSO_PARAMETER("color_mode",KVS_PT_STRING,KVS_PF_OPTIONAL,szColorMode) - KVSO_PARAMETER("opacity",KVS_PT_INT,KVS_PF_OPTIONAL,iOpacity) + KVSO_PARAMETER("index", KVS_PT_INTEGER, 0, iIdx) + KVSO_PARAMETER("Color_1_Or_Colorname", KVS_PT_VARIANT, 0, var1) + KVSO_PARAMETER("Color_2", KVS_PT_VARIANT, KVS_PF_OPTIONAL, var2) + KVSO_PARAMETER("Colo3_3", KVS_PT_VARIANT, KVS_PF_OPTIONAL, var3) + KVSO_PARAMETER("color_mode", KVS_PT_STRING, KVS_PF_OPTIONAL, szColorMode) + KVSO_PARAMETER("opacity", KVS_PT_INT, KVS_PF_OPTIONAL, iOpacity) KVSO_PARAMETERS_END(c) - QListWidgetItem *pItem=((QListWidget *)widget())->item(iIdx); - if(!pItem) return true; + QListWidgetItem * pItem = ((QListWidget *)widget())->item(iIdx); + if(!pItem) + return true; QColor col; - if (!var1->asInteger(iCol1)) + if(!var1->asInteger(iCol1)) { var1->asString(szColor); - if (c->paramCount()<3) iOpacity=255; + if(c->paramCount() < 3) + iOpacity = 255; else { - if (!var2->asInteger(iOpacity)) + if(!var2->asInteger(iOpacity)) { - c->warning(__tr2qs_ctx("The opacity parameter didn't evaluate to integer","objects")); + c->warning(__tr2qs_ctx("The opacity parameter didn't evaluate to integer", "objects")); return true; } } @@ -398,278 +423,299 @@ KVSO_CLASS_FUNCTION(listWidget,setForeground) } else { - if(c->paramCount()<4) + if(c->paramCount() < 4) { - c->error(__tr2qs_ctx("Color name or triplet RGB/HSV value required","objects")); + c->error(__tr2qs_ctx("Color name or triplet RGB/HSV value required", "objects")); return true; } - if (!var2->asInteger(iCol2)||!var3->asInteger(iCol3)) + if(!var2->asInteger(iCol2) || !var3->asInteger(iCol3)) { - c->error(__tr2qs_ctx("One of the triplet parameters didn't evaluate to an integer","objects"));\ + c->error(__tr2qs_ctx("One of the triplet parameters didn't evaluate to an integer", "objects")); return true; } - if (c->paramCount()<5) iOpacity=255; + if(c->paramCount() < 5) + iOpacity = 255; if(KviQString::equalCI(szColorMode, "HSV")) - col.setHsv(iCol1,iCol2,iCol3,iOpacity); + col.setHsv(iCol1, iCol2, iCol3, iOpacity); else - col.setRgb(iCol1,iCol2,iCol3,iOpacity); + col.setRgb(iCol1, iCol2, iCol3, iOpacity); } - QBrush brush=pItem->foreground(); + QBrush brush = pItem->foreground(); brush.setColor(col); pItem->setForeground(brush); return true; } -KVSO_CLASS_FUNCTION(listWidget,clear) +KVSO_CLASS_FUNCTION(listWidget, clear) { CHECK_INTERNAL_POINTER(widget()) ((QListWidget *)widget())->clear(); return true; } -KVSO_CLASS_FUNCTION(listWidget,changeItem) +KVSO_CLASS_FUNCTION(listWidget, changeItem) { CHECK_INTERNAL_POINTER(widget()) - kvs_uint_t iIndex,cnt; + kvs_uint_t iIndex, cnt; QString szText; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("text",KVS_PT_STRING,0,szText) - KVSO_PARAMETER("index",KVS_PT_UNSIGNEDINTEGER,0,iIndex) + KVSO_PARAMETER("text", KVS_PT_STRING, 0, szText) + KVSO_PARAMETER("index", KVS_PT_UNSIGNEDINTEGER, 0, iIndex) KVSO_PARAMETERS_END(c) - if (szText.isEmpty()) c->warning(__tr2qs_ctx("No string parameter given - using empty string","objects")); + if(szText.isEmpty()) + c->warning(__tr2qs_ctx("No string parameter given - using empty string", "objects")); if(iIndex >= (cnt = ((QListWidget *)widget())->count())) { c->warning(__tr2qs_ctx("Item index [%d] is too big - defaulting to " - "$count() - 1 [%d]","objects"), iIndex, cnt); + "$count() - 1 [%d]", + "objects"), + iIndex, cnt); iIndex = cnt - 1; } ((QListWidget *)widget())->item(iIndex)->setText(szText); return true; } - -KVSO_CLASS_FUNCTION(listWidget,removeItem) +KVSO_CLASS_FUNCTION(listWidget, removeItem) { CHECK_INTERNAL_POINTER(widget()) - kvs_uint_t iIndex,cnt; + kvs_uint_t iIndex, cnt; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("index",KVS_PT_UNSIGNEDINTEGER,0,iIndex) + KVSO_PARAMETER("index", KVS_PT_UNSIGNEDINTEGER, 0, iIndex) KVSO_PARAMETERS_END(c) if(iIndex >= (cnt = ((QListWidget *)widget())->count())) { - c->warning(__tr2qs_ctx("Item index [%d] is too big - defaulting to " \ - "$count() - 1 [%d]","objects"), iIndex, cnt); + c->warning(__tr2qs_ctx("Item index [%d] is too big - defaulting to " + "$count() - 1 [%d]", + "objects"), + iIndex, cnt); iIndex = cnt - 1; } - delete ((QListWidget *)widget())->takeItem(iIndex); + delete((QListWidget *)widget())->takeItem(iIndex); return true; } -KVSO_CLASS_FUNCTION(listWidget,count) +KVSO_CLASS_FUNCTION(listWidget, count) { CHECK_INTERNAL_POINTER(widget()) c->returnValue()->setInteger(((QListWidget *)widget())->count()); return true; } -KVSO_CLASS_FUNCTION(listWidget,currentText) +KVSO_CLASS_FUNCTION(listWidget, currentText) { CHECK_INTERNAL_POINTER(widget()) QString text; - QListWidgetItem *item=((QListWidget *)widget())->currentItem(); - if (item) text=item->text(); - else text=""; + QListWidgetItem * item = ((QListWidget *)widget())->currentItem(); + if(item) + text = item->text(); + else + text = ""; c->returnValue()->setString(text); return true; } -KVSO_CLASS_FUNCTION(listWidget,currentItem) +KVSO_CLASS_FUNCTION(listWidget, currentItem) { CHECK_INTERNAL_POINTER(widget()) c->returnValue()->setInteger(((QListWidget *)widget())->currentRow()); return true; } -KVSO_CLASS_FUNCTION(listWidget,textAt) +KVSO_CLASS_FUNCTION(listWidget, textAt) { CHECK_INTERNAL_POINTER(widget()) kvs_uint_t iIndex; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("index",KVS_PT_UNSIGNEDINTEGER,0,iIndex) + KVSO_PARAMETER("index", KVS_PT_UNSIGNEDINTEGER, 0, iIndex) KVSO_PARAMETERS_END(c) c->returnValue()->setString(((QListWidget *)widget())->item(iIndex)->text()); return true; } -KVSO_CLASS_FUNCTION(listWidget,setCurrentItem) +KVSO_CLASS_FUNCTION(listWidget, setCurrentItem) { CHECK_INTERNAL_POINTER(widget()) kvs_uint_t iIndex; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("index",KVS_PT_UNSIGNEDINTEGER,0,iIndex) + KVSO_PARAMETER("index", KVS_PT_UNSIGNEDINTEGER, 0, iIndex) KVSO_PARAMETERS_END(c) ((QListWidget *)widget())->setCurrentRow(iIndex); return true; } -KVSO_CLASS_FUNCTION(listWidget,setSelectionMode) +KVSO_CLASS_FUNCTION(listWidget, setSelectionMode) { CHECK_INTERNAL_POINTER(widget()) QString szMode; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("selection_mode",KVS_PT_STRING,0,szMode) + KVSO_PARAMETER("selection_mode", KVS_PT_STRING, 0, szMode) KVSO_PARAMETERS_END(c) QAbstractItemView::SelectionMode iMode = QAbstractItemView::SingleSelection; - if(KviQString::equalCI(szMode,"single")) iMode = QAbstractItemView::SingleSelection; - else if(KviQString::equalCI(szMode,"multi")) iMode = QAbstractItemView::MultiSelection; - else if(KviQString::equalCI(szMode,"extended")) iMode = QAbstractItemView::ExtendedSelection; - else if(KviQString::equalCI(szMode,"none")) iMode = QAbstractItemView::NoSelection; - else c->warning(__tr2qs_ctx("Invalid selection mode '%Q' assuming single","objects"),&szMode); + if(KviQString::equalCI(szMode, "single")) + iMode = QAbstractItemView::SingleSelection; + else if(KviQString::equalCI(szMode, "multi")) + iMode = QAbstractItemView::MultiSelection; + else if(KviQString::equalCI(szMode, "extended")) + iMode = QAbstractItemView::ExtendedSelection; + else if(KviQString::equalCI(szMode, "none")) + iMode = QAbstractItemView::NoSelection; + else + c->warning(__tr2qs_ctx("Invalid selection mode '%Q' assuming single", "objects"), &szMode); ((QListWidget *)widget())->setSelectionMode(iMode); return true; } -KVSO_CLASS_FUNCTION(listWidget,selectionMode) +KVSO_CLASS_FUNCTION(listWidget, selectionMode) { CHECK_INTERNAL_POINTER(widget()) switch(((QListWidget *)widget())->selectionMode()) { - case QAbstractItemView::SingleSelection: c->returnValue()->setString("single"); break; - case QAbstractItemView::MultiSelection: c->returnValue()->setString("multi"); break; - case QAbstractItemView::ExtendedSelection: c->returnValue()->setString("extended"); break; - case QAbstractItemView::NoSelection: c->returnValue()->setString("none"); break; - default: c->returnValue()->setString("single"); break; + case QAbstractItemView::SingleSelection: + c->returnValue()->setString("single"); + break; + case QAbstractItemView::MultiSelection: + c->returnValue()->setString("multi"); + break; + case QAbstractItemView::ExtendedSelection: + c->returnValue()->setString("extended"); + break; + case QAbstractItemView::NoSelection: + c->returnValue()->setString("none"); + break; + default: + c->returnValue()->setString("single"); + break; } return true; } -KVSO_CLASS_FUNCTION(listWidget,insertWidgetItem) +KVSO_CLASS_FUNCTION(listWidget, insertWidgetItem) { CHECK_INTERNAL_POINTER(widget()) - KviKvsObject *pObject; + KviKvsObject * pObject; kvs_int_t iIndex; kvs_hobject_t hWid; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("widget",KVS_PT_HOBJECT,0,hWid) - KVSO_PARAMETER("index",KVS_PT_INT,0,iIndex) + KVSO_PARAMETER("widget", KVS_PT_HOBJECT, 0, hWid) + KVSO_PARAMETER("index", KVS_PT_INT, 0, iIndex) KVSO_PARAMETERS_END(c) - pObject=KviKvsKernel::instance()->objectController()->lookupObject(hWid); - if(pObject==this) + pObject = KviKvsKernel::instance()->objectController()->lookupObject(hWid); + if(pObject == this) { - c->warning(__tr2qs_ctx("Can't insert the listwidget itself!","objects")); + c->warning(__tr2qs_ctx("Can't insert the listwidget itself!", "objects")); return true; } if(!pObject->object()->isWidgetType()) { - c->warning(__tr2qs_ctx("Can't insert a non-widget object","objects")); + c->warning(__tr2qs_ctx("Can't insert a non-widget object", "objects")); return true; } - QWidget *wi=((QWidget *)(pObject->object())); - QListWidgetItem *item=((QListWidget *)widget())->item(iIndex); - ((QListWidget *)widget())->setItemWidget(item,wi); + QWidget * wi = ((QWidget *)(pObject->object())); + QListWidgetItem * item = ((QListWidget *)widget())->item(iIndex); + ((QListWidget *)widget())->setItemWidget(item, wi); return true; } -KVSO_CLASS_FUNCTION(listWidget,selectedItems) +KVSO_CLASS_FUNCTION(listWidget, selectedItems) { CHECK_INTERNAL_POINTER(widget()) - QList list=((QListWidget *)widget())->selectedItems(); + QList list = ((QListWidget *)widget())->selectedItems(); KviKvsArray * pArray = new KviKvsArray(); c->returnValue()->setArray(pArray); - for (int i=0;irow(list.at(i)); - pArray->set(i,new KviKvsVariant(index)); + kvs_int_t index = ((QListWidget *)widget())->row(list.at(i)); + pArray->set(i, new KviKvsVariant(index)); } return true; } -KVSO_CLASS_FUNCTION(listWidget,setSelected) +KVSO_CLASS_FUNCTION(listWidget, setSelected) { CHECK_INTERNAL_POINTER(widget()) bool bSel; kvs_uint_t uIndex; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("index",KVS_PT_UNSIGNEDINTEGER,0,uIndex) - KVSO_PARAMETER("bEnabled",KVS_PT_BOOLEAN,0,bSel) + KVSO_PARAMETER("index", KVS_PT_UNSIGNEDINTEGER, 0, uIndex) + KVSO_PARAMETER("bEnabled", KVS_PT_BOOLEAN, 0, bSel) KVSO_PARAMETERS_END(c) ((QListWidget *)widget())->item(uIndex)->setSelected(bSel); return true; } -KVSO_CLASS_FUNCTION(listWidget,isSelected) +KVSO_CLASS_FUNCTION(listWidget, isSelected) { CHECK_INTERNAL_POINTER(widget()) kvs_uint_t uIndex; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("index",KVS_PT_UNSIGNEDINTEGER,0,uIndex) + KVSO_PARAMETER("index", KVS_PT_UNSIGNEDINTEGER, 0, uIndex) KVSO_PARAMETERS_END(c) c->returnValue()->setBoolean(((QListWidget *)widget())->item(uIndex)->isSelected()); return true; } -KVSO_CLASS_FUNCTION(listWidget,itemAt) +KVSO_CLASS_FUNCTION(listWidget, itemAt) { CHECK_INTERNAL_POINTER(widget()) - kvs_uint_t uX,uY; + kvs_uint_t uX, uY; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("uX",KVS_PT_UNSIGNEDINTEGER,0,uX) - KVSO_PARAMETER("uY",KVS_PT_UNSIGNEDINTEGER,0,uY) + KVSO_PARAMETER("uX", KVS_PT_UNSIGNEDINTEGER, 0, uX) + KVSO_PARAMETER("uY", KVS_PT_UNSIGNEDINTEGER, 0, uY) KVSO_PARAMETERS_END(c) - c->returnValue()->setInteger(((QListWidget *)widget())->row(((QListWidget *)widget())->itemAt(QPoint(uX,uY)))); + c->returnValue()->setInteger(((QListWidget *)widget())->row(((QListWidget *)widget())->itemAt(QPoint(uX, uY)))); return true; } -KVSO_CLASS_FUNCTION(listWidget,itemRect) +KVSO_CLASS_FUNCTION(listWidget, itemRect) { CHECK_INTERNAL_POINTER(widget()) kvs_uint_t uIndex; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("iIndex",KVS_PT_UNSIGNEDINTEGER,0,uIndex) + KVSO_PARAMETER("iIndex", KVS_PT_UNSIGNEDINTEGER, 0, uIndex) KVSO_PARAMETERS_END(c) - QRect rect=((QListWidget *)widget())->visualItemRect(((QListWidget *)widget())->item(uIndex)); + QRect rect = ((QListWidget *)widget())->visualItemRect(((QListWidget *)widget())->item(uIndex)); KviKvsArray * a = new KviKvsArray(); - a->set(0,new KviKvsVariant((kvs_int_t)rect.left())); - a->set(1,new KviKvsVariant((kvs_int_t)rect.top())); - a->set(2,new KviKvsVariant((kvs_int_t)rect.width())); - a->set(3,new KviKvsVariant((kvs_int_t)rect.height())); + a->set(0, new KviKvsVariant((kvs_int_t)rect.left())); + a->set(1, new KviKvsVariant((kvs_int_t)rect.top())); + a->set(2, new KviKvsVariant((kvs_int_t)rect.width())); + a->set(3, new KviKvsVariant((kvs_int_t)rect.height())); c->returnValue()->setArray(a); return true; } -KVSO_CLASS_FUNCTION(listWidget,currentItemChangedEvent) +KVSO_CLASS_FUNCTION(listWidget, currentItemChangedEvent) { - emitSignal("currentItemChanged",c,c->params()); + emitSignal("currentItemChanged", c, c->params()); return true; } -KVSO_CLASS_FUNCTION(listWidget,itemChangedEvent) +KVSO_CLASS_FUNCTION(listWidget, itemChangedEvent) { - emitSignal("itemChanged",c,c->params()); + emitSignal("itemChanged", c, c->params()); return true; } -KVSO_CLASS_FUNCTION(listWidget,itemEnteredEvent) +KVSO_CLASS_FUNCTION(listWidget, itemEnteredEvent) { - emitSignal("itemEntered",c,c->params()); + emitSignal("itemEntered", c, c->params()); return true; } //slots -void KvsObject_listWidget::currentItemChanged(QListWidgetItem *currentItem,QListWidgetItem *) +void KvsObject_listWidget::currentItemChanged(QListWidgetItem * currentItem, QListWidgetItem *) { - if (!currentItem) callFunction(this,"currentItemChangedEvent",0,0); + if(!currentItem) + callFunction(this, "currentItemChangedEvent", 0, 0); else { KviKvsVariantList params(new KviKvsVariant(currentItem->text())); - callFunction(this,"currentItemChangedEvent",0,¶ms); + callFunction(this, "currentItemChangedEvent", 0, ¶ms); } - } void KvsObject_listWidget::selectionChanged() { - callFunction(this,"selectionChangedEvent",0,0); + callFunction(this, "selectionChangedEvent", 0, 0); } - -void KvsObject_listWidget::slotItemEntered(QListWidgetItem *item) +void KvsObject_listWidget::slotItemEntered(QListWidgetItem * item) { KviKvsVariantList params(new KviKvsVariant((kvs_int_t)((QListWidget *)widget())->row(item))); - callFunction(this,"itemEnteredEvent",0,¶ms); + callFunction(this, "itemEnteredEvent", 0, ¶ms); } -void KvsObject_listWidget::slotItemChanged(QListWidgetItem *item) +void KvsObject_listWidget::slotItemChanged(QListWidgetItem * item) { KviKvsVariantList params(new KviKvsVariant((kvs_int_t)((QListWidget *)widget())->row(item))); - callFunction(this,"itemChangedEvent",0,¶ms); + callFunction(this, "itemChangedEvent", 0, ¶ms); } diff --git a/src/modules/objects/KvsObject_listWidget.h b/src/modules/objects/KvsObject_listWidget.h index 70427b21f..c1eb80fcb 100644 --- a/src/modules/objects/KvsObject_listWidget.h +++ b/src/modules/objects/KvsObject_listWidget.h @@ -24,12 +24,11 @@ // //============================================================================= - #include "KvsObject_widget.h" #include #include "object_macros.h" -class KvsObject_listWidget: public KvsObject_widget +class KvsObject_listWidget : public KvsObject_widget { Q_OBJECT public: @@ -37,45 +36,42 @@ public: public: QWidget * widget() { return (QWidget *)object(); }; protected: - virtual bool init(KviKvsRunTimeContext * pContext,KviKvsVariantList *pParams); - + virtual bool init(KviKvsRunTimeContext * pContext, KviKvsVariantList * pParams); - bool insertItem(KviKvsObjectFunctionCall *c); - bool changeItem(KviKvsObjectFunctionCall *c); - bool removeItem(KviKvsObjectFunctionCall *c); - bool count(KviKvsObjectFunctionCall *c); - bool currentText(KviKvsObjectFunctionCall *c); - bool currentItem(KviKvsObjectFunctionCall *c); - bool textAt(KviKvsObjectFunctionCall *c); - bool setCurrentItem(KviKvsObjectFunctionCall *c); - bool clear(KviKvsObjectFunctionCall *c); - bool setSelectionMode(KviKvsObjectFunctionCall *c); - bool selectionMode(KviKvsObjectFunctionCall *c); - bool insertWidgetItem(KviKvsObjectFunctionCall *c); - bool isSelected(KviKvsObjectFunctionCall *c); - bool setSelected(KviKvsObjectFunctionCall *c); - bool setFlags(KviKvsObjectFunctionCall *c); - bool selectedItems(KviKvsObjectFunctionCall *c); - bool setForeground(KviKvsObjectFunctionCall *c); - bool setIcon(KviKvsObjectFunctionCall *c); - bool setChecked(KviKvsObjectFunctionCall *c); - bool setFont(KviKvsObjectFunctionCall *c); - bool isChecked(KviKvsObjectFunctionCall *c); - bool itemAt(KviKvsObjectFunctionCall *c); - bool itemRect(KviKvsObjectFunctionCall *c); + bool insertItem(KviKvsObjectFunctionCall * c); + bool changeItem(KviKvsObjectFunctionCall * c); + bool removeItem(KviKvsObjectFunctionCall * c); + bool count(KviKvsObjectFunctionCall * c); + bool currentText(KviKvsObjectFunctionCall * c); + bool currentItem(KviKvsObjectFunctionCall * c); + bool textAt(KviKvsObjectFunctionCall * c); + bool setCurrentItem(KviKvsObjectFunctionCall * c); + bool clear(KviKvsObjectFunctionCall * c); + bool setSelectionMode(KviKvsObjectFunctionCall * c); + bool selectionMode(KviKvsObjectFunctionCall * c); + bool insertWidgetItem(KviKvsObjectFunctionCall * c); + bool isSelected(KviKvsObjectFunctionCall * c); + bool setSelected(KviKvsObjectFunctionCall * c); + bool setFlags(KviKvsObjectFunctionCall * c); + bool selectedItems(KviKvsObjectFunctionCall * c); + bool setForeground(KviKvsObjectFunctionCall * c); + bool setIcon(KviKvsObjectFunctionCall * c); + bool setChecked(KviKvsObjectFunctionCall * c); + bool setFont(KviKvsObjectFunctionCall * c); + bool isChecked(KviKvsObjectFunctionCall * c); + bool itemAt(KviKvsObjectFunctionCall * c); + bool itemRect(KviKvsObjectFunctionCall * c); // events - bool currentItemChangedEvent(KviKvsObjectFunctionCall *c); - bool itemChangedEvent(KviKvsObjectFunctionCall *c); - bool itemEnteredEvent(KviKvsObjectFunctionCall *c); + bool currentItemChangedEvent(KviKvsObjectFunctionCall * c); + bool itemChangedEvent(KviKvsObjectFunctionCall * c); + bool itemEnteredEvent(KviKvsObjectFunctionCall * c); protected slots: void selectionChanged(); - void currentItemChanged(QListWidgetItem *,QListWidgetItem *); - void slotItemEntered(QListWidgetItem *item); - void slotItemChanged(QListWidgetItem *item); - + void currentItemChanged(QListWidgetItem *, QListWidgetItem *); + void slotItemEntered(QListWidgetItem * item); + void slotItemChanged(QListWidgetItem * item); }; - -#endif // !_CLASS_COMBOBOX_H_ +#endif // !_CLASS_COMBOBOX_H_ diff --git a/src/modules/objects/KvsObject_mainWindow.cpp b/src/modules/objects/KvsObject_mainWindow.cpp index f5c35eaa2..d368af58b 100644 --- a/src/modules/objects/KvsObject_mainWindow.cpp +++ b/src/modules/objects/KvsObject_mainWindow.cpp @@ -50,50 +50,49 @@ Sets the central widget for the main window to . */ -KVSO_BEGIN_REGISTERCLASS(KvsObject_mainWindow,"mainwindow","widget") - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_mainWindow,setCentralWidget) +KVSO_BEGIN_REGISTERCLASS(KvsObject_mainWindow, "mainwindow", "widget") +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_mainWindow, setCentralWidget) KVSO_END_REGISTERCLASS(KvsObject_mainWindow) -KVSO_BEGIN_CONSTRUCTOR(KvsObject_mainWindow,KvsObject_widget) +KVSO_BEGIN_CONSTRUCTOR(KvsObject_mainWindow, KvsObject_widget) KVSO_END_CONSTRUCTOR(KvsObject_mainWindow) - KVSO_BEGIN_DESTRUCTOR(KvsObject_mainWindow) KVSO_END_CONSTRUCTOR(KvsObject_mainWindow) -bool KvsObject_mainWindow::init(KviKvsRunTimeContext *,KviKvsVariantList *) +bool KvsObject_mainWindow::init(KviKvsRunTimeContext *, KviKvsVariantList *) { setObject(new KviTalMainWindow(parentScriptWidget(), getName().toUtf8().data()), true); return true; } -KVSO_CLASS_FUNCTION(mainWindow,setCentralWidget) +KVSO_CLASS_FUNCTION(mainWindow, setCentralWidget) { CHECK_INTERNAL_POINTER(widget()) KviKvsObject * pObject; kvs_hobject_t hObject; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("widget",KVS_PT_HOBJECT,0,hObject) + KVSO_PARAMETER("widget", KVS_PT_HOBJECT, 0, hObject) KVSO_PARAMETERS_END(c) - pObject=KviKvsKernel::instance()->objectController()->lookupObject(hObject); - if (!pObject) + pObject = KviKvsKernel::instance()->objectController()->lookupObject(hObject); + if(!pObject) { - c->warning(__tr2qs_ctx("Widget parameter is not an object","objects")); + c->warning(__tr2qs_ctx("Widget parameter is not an object", "objects")); return true; } - if (!pObject->object()) + if(!pObject->object()) { - c->warning(__tr2qs_ctx("Widget parameter is not a valid object","objects")); + c->warning(__tr2qs_ctx("Widget parameter is not a valid object", "objects")); return true; } if(!pObject->inheritsClass("widget")) { - c->warning(__tr2qs_ctx("Widget object required","objects")); + c->warning(__tr2qs_ctx("Widget object required", "objects")); return true; } - ((KviTalMainWindow *)widget())->setCentralWidget(((QWidget *)(pObject->object()))); + ((KviTalMainWindow *)widget())->setCentralWidget(((QWidget *)(pObject->object()))); return true; } diff --git a/src/modules/objects/KvsObject_mainWindow.h b/src/modules/objects/KvsObject_mainWindow.h index 9c227630e..88eb727bd 100644 --- a/src/modules/objects/KvsObject_mainWindow.h +++ b/src/modules/objects/KvsObject_mainWindow.h @@ -25,7 +25,6 @@ // //============================================================================= - #include "KvsObject_widget.h" #include "object_macros.h" @@ -36,10 +35,9 @@ public: public: QWidget * widget() { return (QWidget *)object(); }; protected: - virtual bool init(KviKvsRunTimeContext * pContext,KviKvsVariantList *pParams); + virtual bool init(KviKvsRunTimeContext * pContext, KviKvsVariantList * pParams); - bool setCentralWidget(KviKvsObjectFunctionCall *c); + bool setCentralWidget(KviKvsObjectFunctionCall * c); }; - -#endif //!_CLASS_MAINWINDOW_H_ +#endif //!_CLASS_MAINWINDOW_H_ diff --git a/src/modules/objects/KvsObject_memoryBuffer.cpp b/src/modules/objects/KvsObject_memoryBuffer.cpp index 8d6bf7ff9..85becc88c 100644 --- a/src/modules/objects/KvsObject_memoryBuffer.cpp +++ b/src/modules/objects/KvsObject_memoryBuffer.cpp @@ -59,98 +59,98 @@ */ -KVSO_BEGIN_REGISTERCLASS(KvsObject_memoryBuffer,"memorybuffer","object") - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_memoryBuffer,loadFromFile); - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_memoryBuffer,clear); - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_memoryBuffer,saveToFile); - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_memoryBuffer,size); - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_memoryBuffer,readByteAt); +KVSO_BEGIN_REGISTERCLASS(KvsObject_memoryBuffer, "memorybuffer", "object") +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_memoryBuffer, loadFromFile); +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_memoryBuffer, clear); +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_memoryBuffer, saveToFile); +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_memoryBuffer, size); +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_memoryBuffer, readByteAt); KVSO_END_REGISTERCLASS(KvsObject_memoryBuffer) +KVSO_BEGIN_CONSTRUCTOR(KvsObject_memoryBuffer, KviKvsObject) -KVSO_BEGIN_CONSTRUCTOR(KvsObject_memoryBuffer,KviKvsObject) - - mIdx=0; - m_pBuffer = new QByteArray(); +mIdx = 0; +m_pBuffer = new QByteArray(); KVSO_END_CONSTRUCTOR(KvsObject_memoryBuffer) KVSO_BEGIN_DESTRUCTOR(KvsObject_memoryBuffer) - delete m_pBuffer; +delete m_pBuffer; KVSO_END_CONSTRUCTOR(KvsObject_memoryBuffer) - -KVSO_CLASS_FUNCTION(memoryBuffer,clear) +KVSO_CLASS_FUNCTION(memoryBuffer, clear) { CHECK_INTERNAL_POINTER(m_pBuffer) m_pBuffer->clear(); return true; } -KVSO_CLASS_FUNCTION(memoryBuffer,loadFromFile) +KVSO_CLASS_FUNCTION(memoryBuffer, loadFromFile) { CHECK_INTERNAL_POINTER(m_pBuffer) QString szFileName; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("filename",KVS_PT_NONEMPTYSTRING,0,szFileName) + KVSO_PARAMETER("filename", KVS_PT_NONEMPTYSTRING, 0, szFileName) KVSO_PARAMETERS_END(c) if(KviFileUtils::fileExists(szFileName)) { KviFile f(szFileName); - qDebug("loading file %s",szFileName.toUtf8().data()); - if (f.open(QIODevice::ReadOnly)) + qDebug("loading file %s", szFileName.toUtf8().data()); + if(f.open(QIODevice::ReadOnly)) { m_pBuffer->resize(f.size()); - f.read(m_pBuffer->data(),f.size()); + f.read(m_pBuffer->data(), f.size()); f.close(); } - else qDebug("Error in loaded file!"); + else + qDebug("Error in loaded file!"); } - else c->warning(__tr2qs_ctx("The file '%Q' doesn't exist","objects"),&szFileName); + else + c->warning(__tr2qs_ctx("The file '%Q' doesn't exist", "objects"), &szFileName); return true; } -KVSO_CLASS_FUNCTION(memoryBuffer,size) +KVSO_CLASS_FUNCTION(memoryBuffer, size) { CHECK_INTERNAL_POINTER(m_pBuffer) c->returnValue()->setInteger((kvs_int_t)m_pBuffer->size()); return true; } -KVSO_CLASS_FUNCTION(memoryBuffer,readByteAt) +KVSO_CLASS_FUNCTION(memoryBuffer, readByteAt) { CHECK_INTERNAL_POINTER(m_pBuffer) kvs_int_t iIdx; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("index",KVS_PT_INT,0,iIdx) + KVSO_PARAMETER("index", KVS_PT_INT, 0, iIdx) KVSO_PARAMETERS_END(c) - if(iIdx>m_pBuffer->size()) + if(iIdx > m_pBuffer->size()) { - c->warning(__tr2qs_ctx("Index '%I' out of the buffer size","objects"),&iIdx); + c->warning(__tr2qs_ctx("Index '%I' out of the buffer size", "objects"), &iIdx); return true; } unsigned char ch = m_pBuffer->at(iIdx); - c->returnValue()->setInteger( ch); + c->returnValue()->setInteger(ch); return true; } -KVSO_CLASS_FUNCTION(memoryBuffer,saveToFile) +KVSO_CLASS_FUNCTION(memoryBuffer, saveToFile) { CHECK_INTERNAL_POINTER(m_pBuffer) QString szFileName; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("filename",KVS_PT_NONEMPTYSTRING,0,szFileName) + KVSO_PARAMETER("filename", KVS_PT_NONEMPTYSTRING, 0, szFileName) KVSO_PARAMETERS_END(c) KviFile f(szFileName); - if (f.open(QIODevice::WriteOnly)) + if(f.open(QIODevice::WriteOnly)) { - f.write(m_pBuffer->data(),m_pBuffer->size()); + f.write(m_pBuffer->data(), m_pBuffer->size()); f.close(); } else { - c->warning(__tr2qs_ctx("Can't open file '%Q' for writing","objects"),&szFileName); + c->warning(__tr2qs_ctx("Can't open file '%Q' for writing", "objects"), &szFileName); } return true; } diff --git a/src/modules/objects/KvsObject_memoryBuffer.h b/src/modules/objects/KvsObject_memoryBuffer.h index 18522e469..835097a88 100644 --- a/src/modules/objects/KvsObject_memoryBuffer.h +++ b/src/modules/objects/KvsObject_memoryBuffer.h @@ -29,8 +29,6 @@ #include "object_macros.h" - - class KvsObject_memoryBuffer : public KviKvsObject { public: @@ -38,20 +36,21 @@ public: protected: QByteArray * m_pBuffer; int mIdx; + public: QByteArray dataBuffer() { return *m_pBuffer; }; - QByteArray *pBuffer() + QByteArray * pBuffer() { return m_pBuffer; }; - bool loadFromFile(KviKvsObjectFunctionCall *c); - bool clear(KviKvsObjectFunctionCall *c); - bool size(KviKvsObjectFunctionCall *c); - bool readByteAt(KviKvsObjectFunctionCall *c); - bool saveToFile(KviKvsObjectFunctionCall *c); + bool loadFromFile(KviKvsObjectFunctionCall * c); + bool clear(KviKvsObjectFunctionCall * c); + bool size(KviKvsObjectFunctionCall * c); + bool readByteAt(KviKvsObjectFunctionCall * c); + bool saveToFile(KviKvsObjectFunctionCall * c); }; -#endif // !_CLASS_MEMORYBUFFER_H_ +#endif // !_CLASS_MEMORYBUFFER_H_ diff --git a/src/modules/objects/KvsObject_menuBar.cpp b/src/modules/objects/KvsObject_menuBar.cpp index c47da7cb6..068cea37d 100644 --- a/src/modules/objects/KvsObject_menuBar.cpp +++ b/src/modules/objects/KvsObject_menuBar.cpp @@ -22,7 +22,6 @@ // //============================================================================= - #include "KvsObject_menuBar.h" #include "KviError.h" #include "kvi_debug.h" @@ -46,31 +45,30 @@ Returns an integer that identifies the inserted item. */ -KVSO_BEGIN_REGISTERCLASS(KvsObject_menuBar,"menubar","widget") - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_menuBar,insertItem) +KVSO_BEGIN_REGISTERCLASS(KvsObject_menuBar, "menubar", "widget") +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_menuBar, insertItem) KVSO_END_REGISTERCLASS(KvsObject_menuBar) -KVSO_BEGIN_CONSTRUCTOR(KvsObject_menuBar,KvsObject_widget) +KVSO_BEGIN_CONSTRUCTOR(KvsObject_menuBar, KvsObject_widget) KVSO_END_CONSTRUCTOR(KvsObject_menuBar) - KVSO_BEGIN_DESTRUCTOR(KvsObject_menuBar) KVSO_END_CONSTRUCTOR(KvsObject_menuBar) -bool KvsObject_menuBar::init(KviKvsRunTimeContext *,KviKvsVariantList *) +bool KvsObject_menuBar::init(KviKvsRunTimeContext *, KviKvsVariantList *) { SET_OBJECT(QMenuBar) return true; } -KVSO_CLASS_FUNCTION(menuBar,insertItem) +KVSO_CLASS_FUNCTION(menuBar, insertItem) { CHECK_INTERNAL_POINTER(widget()) QString szItem; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("item",KVS_PT_STRING,0,szItem) + KVSO_PARAMETER("item", KVS_PT_STRING, 0, szItem) KVSO_PARAMETERS_END(c) ((QMenuBar *)widget())->addAction(szItem); return true; diff --git a/src/modules/objects/KvsObject_menuBar.h b/src/modules/objects/KvsObject_menuBar.h index 8a04d742c..f0bcd5c14 100644 --- a/src/modules/objects/KvsObject_menuBar.h +++ b/src/modules/objects/KvsObject_menuBar.h @@ -35,8 +35,8 @@ public: public: QWidget * widget() { return (QWidget *)object(); }; protected: - virtual bool init(KviKvsRunTimeContext * pContext,KviKvsVariantList *pParams); + virtual bool init(KviKvsRunTimeContext * pContext, KviKvsVariantList * pParams); - bool insertItem(KviKvsObjectFunctionCall *c); + bool insertItem(KviKvsObjectFunctionCall * c); }; -#endif // !_CLASS_MENUBAR_H_ +#endif // !_CLASS_MENUBAR_H_ diff --git a/src/modules/objects/KvsObject_multiLineEdit.cpp b/src/modules/objects/KvsObject_multiLineEdit.cpp index 9bef80f03..6d51dedb5 100644 --- a/src/modules/objects/KvsObject_multiLineEdit.cpp +++ b/src/modules/objects/KvsObject_multiLineEdit.cpp @@ -172,89 +172,82 @@ [/example] */ - -KVSO_BEGIN_REGISTERCLASS(KvsObject_textedit,"multilineedit","widget") - - KVSO_REGISTER_HANDLER(KvsObject_textedit,"textLine", functionTextLine) - KVSO_REGISTER_HANDLER(KvsObject_textedit,"setWordWrap", functionSetWordWrap) - KVSO_REGISTER_HANDLER(KvsObject_textedit,"wordWrap", functionWordWrap) - - KVSO_REGISTER_HANDLER(KvsObject_textedit,"atEnd", functionAtEnd) - KVSO_REGISTER_HANDLER(KvsObject_textedit,"numLines", functionNumLines) - KVSO_REGISTER_HANDLER(KvsObject_textedit,"atBeginning", functionAtBeginning) - KVSO_REGISTER_HANDLER(KvsObject_textedit,"cursorPosition", functionCursorPosition) - KVSO_REGISTER_HANDLER(KvsObject_textedit,"text", functionText) - KVSO_REGISTER_HANDLER(KvsObject_textedit,"insert", functionInsert) - KVSO_REGISTER_HANDLER(KvsObject_textedit,"maxLines", functionMaxLines) - KVSO_REGISTER_HANDLER(KvsObject_textedit,"setMaxLines", functionSetMaxLines) - KVSO_REGISTER_HANDLER(KvsObject_textedit,"append", functionAppend) - KVSO_REGISTER_HANDLER(KvsObject_textedit,"copy", functionCopy) - KVSO_REGISTER_HANDLER(KvsObject_textedit,"cut", functionCut) - KVSO_REGISTER_HANDLER(KvsObject_textedit,"paste", functionPaste) - - //->Set Style - KVSO_REGISTER_HANDLER(KvsObject_textedit,"setFamily", functionsetFamily) - KVSO_REGISTER_HANDLER(KvsObject_textedit,"setItalic", functionsetItalic) - KVSO_REGISTER_HANDLER(KvsObject_textedit,"setBold", functionsetBold) - KVSO_REGISTER_HANDLER(KvsObject_textedit,"setUnderline", functionsetUnderline) - KVSO_REGISTER_HANDLER(KvsObject_textedit,"italic", functionitalic) - KVSO_REGISTER_HANDLER(KvsObject_textedit,"bold", functionbold) - KVSO_REGISTER_HANDLER(KvsObject_textedit,"underline", functionunderline) - - //->Zoom In, Out, To - KVSO_REGISTER_HANDLER(KvsObject_textedit,"zoomIn", functionzoomIn) - KVSO_REGISTER_HANDLER(KvsObject_textedit,"zoomOut", functionzoomOut) - - //->Undo & Redo - KVSO_REGISTER_HANDLER(KvsObject_textedit,"undo", functionundo) - KVSO_REGISTER_HANDLER(KvsObject_textedit,"redo", functionredo) - KVSO_REGISTER_HANDLER(KvsObject_textedit,"clear", functionclear) - KVSO_REGISTER_HANDLER(KvsObject_textedit,"setUndoRedoEnabled", functionsetUndoRedoEnabled) - - - KVSO_REGISTER_HANDLER(KvsObject_textedit,"isUndoRedoEnabled", functionisUndoRedoEnabled) - - //->Text color & others - KVSO_REGISTER_HANDLER(KvsObject_textedit,"setText", functionsetText) - KVSO_REGISTER_HANDLER(KvsObject_textedit,"setColor", functionsetColor) - KVSO_REGISTER_HANDLER(KvsObject_textedit,"setModified", functionsetModified) - - KVSO_REGISTER_HANDLER(KvsObject_textedit,"setPointSize", functionsetPointSize) - KVSO_REGISTER_HANDLER(KvsObject_textedit,"setReadOnly",functionSetReadOnly) - - KVSO_REGISTER_HANDLER(KvsObject_textedit,"setTextFormat", functionsetTextFormat) - KVSO_REGISTER_HANDLER(KvsObject_textedit,"textFormat", functiontextFormat) - KVSO_REGISTER_HANDLER(KvsObject_textedit,"loadFile", functionloadFile); - KVSO_REGISTER_HANDLER(KvsObject_textedit,"setAlignment", functionsetAlignment) - - KVSO_REGISTER_HANDLER(KvsObject_textedit,"lines", functionlines) - KVSO_REGISTER_HANDLER(KvsObject_textedit,"selectAll", functionselectAll) +KVSO_BEGIN_REGISTERCLASS(KvsObject_textedit, "multilineedit", "widget") + +KVSO_REGISTER_HANDLER(KvsObject_textedit, "textLine", functionTextLine) +KVSO_REGISTER_HANDLER(KvsObject_textedit, "setWordWrap", functionSetWordWrap) +KVSO_REGISTER_HANDLER(KvsObject_textedit, "wordWrap", functionWordWrap) + +KVSO_REGISTER_HANDLER(KvsObject_textedit, "atEnd", functionAtEnd) +KVSO_REGISTER_HANDLER(KvsObject_textedit, "numLines", functionNumLines) +KVSO_REGISTER_HANDLER(KvsObject_textedit, "atBeginning", functionAtBeginning) +KVSO_REGISTER_HANDLER(KvsObject_textedit, "cursorPosition", functionCursorPosition) +KVSO_REGISTER_HANDLER(KvsObject_textedit, "text", functionText) +KVSO_REGISTER_HANDLER(KvsObject_textedit, "insert", functionInsert) +KVSO_REGISTER_HANDLER(KvsObject_textedit, "maxLines", functionMaxLines) +KVSO_REGISTER_HANDLER(KvsObject_textedit, "setMaxLines", functionSetMaxLines) +KVSO_REGISTER_HANDLER(KvsObject_textedit, "append", functionAppend) +KVSO_REGISTER_HANDLER(KvsObject_textedit, "copy", functionCopy) +KVSO_REGISTER_HANDLER(KvsObject_textedit, "cut", functionCut) +KVSO_REGISTER_HANDLER(KvsObject_textedit, "paste", functionPaste) + +//->Set Style +KVSO_REGISTER_HANDLER(KvsObject_textedit, "setFamily", functionsetFamily) +KVSO_REGISTER_HANDLER(KvsObject_textedit, "setItalic", functionsetItalic) +KVSO_REGISTER_HANDLER(KvsObject_textedit, "setBold", functionsetBold) +KVSO_REGISTER_HANDLER(KvsObject_textedit, "setUnderline", functionsetUnderline) +KVSO_REGISTER_HANDLER(KvsObject_textedit, "italic", functionitalic) +KVSO_REGISTER_HANDLER(KvsObject_textedit, "bold", functionbold) +KVSO_REGISTER_HANDLER(KvsObject_textedit, "underline", functionunderline) + +//->Zoom In, Out, To +KVSO_REGISTER_HANDLER(KvsObject_textedit, "zoomIn", functionzoomIn) +KVSO_REGISTER_HANDLER(KvsObject_textedit, "zoomOut", functionzoomOut) + +//->Undo & Redo +KVSO_REGISTER_HANDLER(KvsObject_textedit, "undo", functionundo) +KVSO_REGISTER_HANDLER(KvsObject_textedit, "redo", functionredo) +KVSO_REGISTER_HANDLER(KvsObject_textedit, "clear", functionclear) +KVSO_REGISTER_HANDLER(KvsObject_textedit, "setUndoRedoEnabled", functionsetUndoRedoEnabled) + +KVSO_REGISTER_HANDLER(KvsObject_textedit, "isUndoRedoEnabled", functionisUndoRedoEnabled) + +//->Text color & others +KVSO_REGISTER_HANDLER(KvsObject_textedit, "setText", functionsetText) +KVSO_REGISTER_HANDLER(KvsObject_textedit, "setColor", functionsetColor) +KVSO_REGISTER_HANDLER(KvsObject_textedit, "setModified", functionsetModified) + +KVSO_REGISTER_HANDLER(KvsObject_textedit, "setPointSize", functionsetPointSize) +KVSO_REGISTER_HANDLER(KvsObject_textedit, "setReadOnly", functionSetReadOnly) + +KVSO_REGISTER_HANDLER(KvsObject_textedit, "setTextFormat", functionsetTextFormat) +KVSO_REGISTER_HANDLER(KvsObject_textedit, "textFormat", functiontextFormat) +KVSO_REGISTER_HANDLER(KvsObject_textedit, "loadFile", functionloadFile); +KVSO_REGISTER_HANDLER(KvsObject_textedit, "setAlignment", functionsetAlignment) + +KVSO_REGISTER_HANDLER(KvsObject_textedit, "lines", functionlines) +KVSO_REGISTER_HANDLER(KvsObject_textedit, "selectAll", functionselectAll) KVSO_END_REGISTERCLASS(KvsObject_textedit) - -KVSO_BEGIN_CONSTRUCTOR(KvsObject_textedit,KvsObject_widget) - +KVSO_BEGIN_CONSTRUCTOR(KvsObject_textedit, KvsObject_widget) KVSO_END_CONSTRUCTOR(KvsObject_textedit) - KVSO_BEGIN_DESTRUCTOR(KvsObject_textedit) KVSO_END_CONSTRUCTOR(KvsObject_textedit) -bool KvsObject_textedit::init(KviKvsRunTimeContext *,KviKvsVariantList *) +bool KvsObject_textedit::init(KviKvsRunTimeContext *, KviKvsVariantList *) { SET_OBJECT(QTextEdit); return true; } - - bool KvsObject_textedit::functionSetReadOnly(KviKvsObjectFunctionCall * c) { bool bEnabled; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("bEnabled",KVS_PT_BOOL,0,bEnabled) + KVSO_PARAMETER("bEnabled", KVS_PT_BOOL, 0, bEnabled) KVSO_PARAMETERS_END(c) if(widget()) ((QTextEdit *)widget())->setReadOnly(bEnabled); @@ -265,12 +258,12 @@ bool KvsObject_textedit::functionTextLine(KviKvsObjectFunctionCall * c) { kvs_int_t iBlock; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("line",KVS_PT_INT,0,iBlock) + KVSO_PARAMETER("line", KVS_PT_INT, 0, iBlock) KVSO_PARAMETERS_END(c) if(!widget()) return true; if(iBlock > ((QTextEdit *)widget())->document()->blockCount() || iBlock < 0) - c->warning(__tr2qs_ctx("No such line '%d'","objects"),&iBlock); + c->warning(__tr2qs_ctx("No such line '%d'", "objects"), &iBlock); else c->returnValue()->setString(((QTextEdit *)widget())->document()->findBlockByNumber(iBlock).text()); @@ -284,63 +277,71 @@ bool KvsObject_textedit::functionNumLines(KviKvsObjectFunctionCall * c) } bool KvsObject_textedit::functionCursorPosition(KviKvsObjectFunctionCall * c) { - if(!widget()) return true; - int iRow=((QTextEdit *)widget())->textCursor().blockNumber(); - int iCol=((QTextEdit *)widget())->textCursor().columnNumber(); + if(!widget()) + return true; + int iRow = ((QTextEdit *)widget())->textCursor().blockNumber(); + int iCol = ((QTextEdit *)widget())->textCursor().columnNumber(); KviKvsArray * a = new KviKvsArray(); - a->set(0,new KviKvsVariant((kvs_int_t)iRow)); - a->set(1,new KviKvsVariant((kvs_int_t)iCol)); + a->set(0, new KviKvsVariant((kvs_int_t)iRow)); + a->set(1, new KviKvsVariant((kvs_int_t)iCol)); c->returnValue()->setArray(a); return true; } bool KvsObject_textedit::functionAtBeginning(KviKvsObjectFunctionCall * c) { - if(!widget()) return true; + if(!widget()) + return true; c->returnValue()->setBoolean(((QTextEdit *)widget())->textCursor().atStart()); return true; } bool KvsObject_textedit::functionAtEnd(KviKvsObjectFunctionCall * c) { - if(!widget()) return true; + if(!widget()) + return true; c->returnValue()->setBoolean(((QTextEdit *)widget())->textCursor().atEnd()); return true; } bool KvsObject_textedit::functionSetWordWrap(KviKvsObjectFunctionCall * c) { - if(!widget())return true; + if(!widget()) + return true; QString szWrap; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("word_wrap",KVS_PT_STRING,0,szWrap) + KVSO_PARAMETER("word_wrap", KVS_PT_STRING, 0, szWrap) KVSO_PARAMETERS_END(c) - if(KviQString::equalCI(szWrap,"NoWrap")) + if(KviQString::equalCI(szWrap, "NoWrap")) ((QTextEdit *)widget())->setLineWrapMode(QTextEdit::NoWrap); - else if(KviQString::equalCI(szWrap,"WidgetWidth")) + else if(KviQString::equalCI(szWrap, "WidgetWidth")) ((QTextEdit *)widget())->setLineWrapMode(QTextEdit::WidgetWidth); - else if(KviQString::equalCI(szWrap,"FixedPixelWidth")) + else if(KviQString::equalCI(szWrap, "FixedPixelWidth")) ((QTextEdit *)widget())->setLineWrapMode(QTextEdit::FixedPixelWidth); - else if(KviQString::equalCI(szWrap,"FixedColumnWidth")) + else if(KviQString::equalCI(szWrap, "FixedColumnWidth")) ((QTextEdit *)widget())->setLineWrapMode(QTextEdit::FixedColumnWidth); - else - c->warning(__tr2qs_ctx("Unknown word wrap '%Q'","objects"),&szWrap); + else + c->warning(__tr2qs_ctx("Unknown word wrap '%Q'", "objects"), &szWrap); return true; } - -bool KvsObject_textedit::functionWordWrap(KviKvsObjectFunctionCall *c) +bool KvsObject_textedit::functionWordWrap(KviKvsObjectFunctionCall * c) { - if(!widget()) return true; - QTextEdit::LineWrapMode mode=((QTextEdit *)widget())->lineWrapMode(); + if(!widget()) + return true; + QTextEdit::LineWrapMode mode = ((QTextEdit *)widget())->lineWrapMode(); QString szWrapMode; - if (mode==QTextEdit::NoWrap) szWrapMode="NoWrap"; - else if (mode==QTextEdit::WidgetWidth) szWrapMode="WidgetWidth"; - else if (mode==QTextEdit::FixedPixelWidth) szWrapMode="FixedPixelWidth"; - else szWrapMode="FixedColumnWidth"; + if(mode == QTextEdit::NoWrap) + szWrapMode = "NoWrap"; + else if(mode == QTextEdit::WidgetWidth) + szWrapMode = "WidgetWidth"; + else if(mode == QTextEdit::FixedPixelWidth) + szWrapMode = "FixedPixelWidth"; + else + szWrapMode = "FixedColumnWidth"; c->returnValue()->setString(szWrapMode); return true; @@ -357,7 +358,7 @@ bool KvsObject_textedit::functionSetMaxLines(KviKvsObjectFunctionCall * c) { kvs_uint_t imaxLines; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("max_lines",KVS_PT_UNSIGNEDINTEGER,0,imaxLines) + KVSO_PARAMETER("max_lines", KVS_PT_UNSIGNEDINTEGER, 0, imaxLines) KVSO_PARAMETERS_END(c) if(widget()) ((QTextEdit *)widget())->document()->setMaximumBlockCount(imaxLines); @@ -375,11 +376,11 @@ bool KvsObject_textedit::functionInsert(KviKvsObjectFunctionCall * c) { QString szInsert; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("text",KVS_PT_STRING,0,szInsert) + KVSO_PARAMETER("text", KVS_PT_STRING, 0, szInsert) KVSO_PARAMETERS_END(c) - if (widget()) + if(widget()) { - QTextCursor cursor=((QTextEdit *)widget())->textCursor(); + QTextCursor cursor = ((QTextEdit *)widget())->textCursor(); cursor.insertText(szInsert); ((QTextEdit *)widget())->setTextCursor(cursor); } @@ -390,9 +391,9 @@ bool KvsObject_textedit::functionAppend(KviKvsObjectFunctionCall * c) { QString szAppend; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("text",KVS_PT_STRING,0,szAppend) + KVSO_PARAMETER("text", KVS_PT_STRING, 0, szAppend) KVSO_PARAMETERS_END(c) - if (widget()) + if(widget()) ((QTextEdit *)widget())->append(szAppend); return true; } @@ -423,10 +424,10 @@ bool KvsObject_textedit::functionsetBold(KviKvsObjectFunctionCall * c) { bool bFlag; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("bBold",KVS_PT_BOOL,0,bFlag) + KVSO_PARAMETER("bBold", KVS_PT_BOOL, 0, bFlag) KVSO_PARAMETERS_END(c) - if (widget()) - ((QTextEdit *)widget())->setFontWeight(bFlag?QFont::Bold:QFont::Normal); + if(widget()) + ((QTextEdit *)widget())->setFontWeight(bFlag ? QFont::Bold : QFont::Normal); return true; } @@ -434,9 +435,9 @@ bool KvsObject_textedit::functionsetUnderline(KviKvsObjectFunctionCall * c) { bool bFlag; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("bUnderline",KVS_PT_BOOL,0,bFlag) + KVSO_PARAMETER("bUnderline", KVS_PT_BOOL, 0, bFlag) KVSO_PARAMETERS_END(c) - if (widget()) + if(widget()) ((QTextEdit *)widget())->setFontUnderline(bFlag); return true; } @@ -445,9 +446,9 @@ bool KvsObject_textedit::functionsetItalic(KviKvsObjectFunctionCall * c) { bool bFlag; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("bItalic",KVS_PT_BOOL,0,bFlag) + KVSO_PARAMETER("bItalic", KVS_PT_BOOL, 0, bFlag) KVSO_PARAMETERS_END(c) - if (widget()) + if(widget()) ((QTextEdit *)widget())->setFontItalic(bFlag); return true; } @@ -456,7 +457,7 @@ bool KvsObject_textedit::functionsetItalic(KviKvsObjectFunctionCall * c) bool KvsObject_textedit::functionbold(KviKvsObjectFunctionCall * c) { if(widget()) - c->returnValue()->setBoolean(((QTextEdit *)widget())->fontWeight() >= QFont::Bold ); + c->returnValue()->setBoolean(((QTextEdit *)widget())->fontWeight() >= QFont::Bold); return true; } @@ -479,10 +480,11 @@ bool KvsObject_textedit::functionzoomIn(KviKvsObjectFunctionCall * c) { kvs_int_t iZoom; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("zoom_value",KVS_PT_INT,KVS_PF_OPTIONAL,iZoom) + KVSO_PARAMETER("zoom_value", KVS_PT_INT, KVS_PF_OPTIONAL, iZoom) KVSO_PARAMETERS_END(c) - if (!widget()) return true; - if (!iZoom) + if(!widget()) + return true; + if(!iZoom) ((QTextEdit *)object())->zoomIn(); else ((QTextEdit *)object())->zoomIn(iZoom); @@ -493,18 +495,17 @@ bool KvsObject_textedit::functionzoomOut(KviKvsObjectFunctionCall * c) { kvs_int_t iZoom; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("zoom_value",KVS_PT_INT,KVS_PF_OPTIONAL,iZoom) + KVSO_PARAMETER("zoom_value", KVS_PT_INT, KVS_PF_OPTIONAL, iZoom) KVSO_PARAMETERS_END(c) - if (!widget()) return true; - if (!iZoom) + if(!widget()) + return true; + if(!iZoom) ((QTextEdit *)object())->zoomOut(); else ((QTextEdit *)object())->zoomOut(iZoom); return true; } - - //-> Undo & Redo functions bool KvsObject_textedit::functionundo(KviKvsObjectFunctionCall *) { @@ -527,15 +528,13 @@ bool KvsObject_textedit::functionclear(KviKvsObjectFunctionCall *) return true; } - - bool KvsObject_textedit::functionsetUndoRedoEnabled(KviKvsObjectFunctionCall * c) { bool bFlag; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("bUndoredo",KVS_PT_BOOL,0,bFlag) + KVSO_PARAMETER("bUndoredo", KVS_PT_BOOL, 0, bFlag) KVSO_PARAMETERS_END(c) - if (widget()) + if(widget()) ((QTextEdit *)widget())->setUndoRedoEnabled(bFlag); return true; } @@ -547,15 +546,14 @@ bool KvsObject_textedit::functionisUndoRedoEnabled(KviKvsObjectFunctionCall * c) return true; } - //-->Text & Color & Family bool KvsObject_textedit::functionsetText(KviKvsObjectFunctionCall * c) { QString szText; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("text",KVS_PT_STRING,0,szText) + KVSO_PARAMETER("text", KVS_PT_STRING, 0, szText) KVSO_PARAMETERS_END(c) - if (widget()) + if(widget()) ((QTextEdit *)widget())->setText(szText); return true; } @@ -564,9 +562,9 @@ bool KvsObject_textedit::functionsetPlainText(KviKvsObjectFunctionCall * c) { QString szText; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("text",KVS_PT_STRING,0,szText) + KVSO_PARAMETER("text", KVS_PT_STRING, 0, szText) KVSO_PARAMETERS_END(c) - if (widget()) + if(widget()) ((QTextEdit *)widget())->setPlainText(szText); return true; } @@ -575,9 +573,9 @@ bool KvsObject_textedit::functionsetHtmlText(KviKvsObjectFunctionCall * c) { QString szText; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("text",KVS_PT_STRING,0,szText) + KVSO_PARAMETER("text", KVS_PT_STRING, 0, szText) KVSO_PARAMETERS_END(c) - if (widget()) + if(widget()) ((QTextEdit *)widget())->setHtml(szText); return true; } @@ -585,17 +583,17 @@ bool KvsObject_textedit::functionsetHtmlText(KviKvsObjectFunctionCall * c) bool KvsObject_textedit::functionsetColor(KviKvsObjectFunctionCall * c) { KviKvsVariant * pColArray; - kvs_int_t iColR,iColG,iColB; + kvs_int_t iColR, iColG, iColB; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("red_or_array",KVS_PT_VARIANT,0,pColArray) - KVSO_PARAMETER("green",KVS_PT_INT,KVS_PF_OPTIONAL,iColG) - KVSO_PARAMETER("blue",KVS_PT_INT,KVS_PF_OPTIONAL,iColB) + KVSO_PARAMETER("red_or_array", KVS_PT_VARIANT, 0, pColArray) + KVSO_PARAMETER("green", KVS_PT_INT, KVS_PF_OPTIONAL, iColG) + KVSO_PARAMETER("blue", KVS_PT_INT, KVS_PF_OPTIONAL, iColB) KVSO_PARAMETERS_END(c) if(pColArray->isArray()) { if(pColArray->array()->size() < 3) { - c->error(__tr2qs_ctx("The array passed as parameter must contain at least 3 elements","objects")); + c->error(__tr2qs_ctx("The array passed as parameter must contain at least 3 elements", "objects")); return false; } KviKvsVariant * pColR = pColArray->array()->at(0); @@ -604,52 +602,55 @@ bool KvsObject_textedit::functionsetColor(KviKvsObjectFunctionCall * c) if(!(pColR && pColG && pColB)) { - c->error(__tr2qs_ctx("One of the colors array parameters is empty","objects")); + c->error(__tr2qs_ctx("One of the colors array parameters is empty", "objects")); return false; } if(!(pColR->asInteger(iColR) && pColG->asInteger(iColG) && pColB->asInteger(iColB))) { - c->error(__tr2qs_ctx("One of the colors array parameters didn't evaluate to an integer","objects")); + c->error(__tr2qs_ctx("One of the colors array parameters didn't evaluate to an integer", "objects")); return false; } - - } else { - if (c->params()->count()==1) + } + else + { + if(c->params()->count() == 1) { - bool bOk,bOk1,bOk2; + bool bOk, bOk1, bOk2; QString value; pColArray->asString(value); - if (value.length()!=6) + if(value.length() != 6) { - c->warning(__tr2qs_ctx("A string of 6 hex digits is required","objects")); + c->warning(__tr2qs_ctx("A string of 6 hex digits is required", "objects")); return true; } - QString buffer(value.mid(0,2)); - iColR=buffer.toInt(&bOk,16); - buffer=value.mid(2,2); - iColG=buffer.toInt(&bOk1,16); - buffer=value.mid(4,2); - iColB=buffer.toInt(&bOk2,16); - if (!bOk || !bOk1 || !bOk2) + QString buffer(value.mid(0, 2)); + iColR = buffer.toInt(&bOk, 16); + buffer = value.mid(2, 2); + iColG = buffer.toInt(&bOk1, 16); + buffer = value.mid(4, 2); + iColB = buffer.toInt(&bOk2, 16); + if(!bOk || !bOk1 || !bOk2) { - c->warning(__tr2qs_ctx("Not an hex digit","objects")); + c->warning(__tr2qs_ctx("Not an hex digit", "objects")); return true; } - if (widget()) ((QTextEdit *)widget())->setTextColor(QColor(iColR,iColG,iColB)); + if(widget()) + ((QTextEdit *)widget())->setTextColor(QColor(iColR, iColG, iColB)); return true; } if(c->params()->count() < 3) { - c->error(__tr2qs_ctx("$setColor requires either an array as first parameter or three integers","objects")); + c->error(__tr2qs_ctx("$setColor requires either an array as first parameter or three integers", "objects")); return false; } if(!pColArray->asInteger(iColR)) { - c->error(__tr2qs_ctx("The first parameter didn't evaluate to an array nor an integer","objects")); + c->error(__tr2qs_ctx("The first parameter didn't evaluate to an array nor an integer", "objects")); return false; } } - if (widget()) ((QTextEdit *)widget())->setTextColor(QColor(iColR,iColG,iColB)); + if(widget()) + ((QTextEdit *)widget())->setTextColor(QColor(iColR, iColG, iColB)); return true; } @@ -657,22 +658,20 @@ bool KvsObject_textedit::functionsetPointSize(KviKvsObjectFunctionCall * c) { kvs_real_t dPointSize; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("point_size",KVS_PT_REAL,0,dPointSize) + KVSO_PARAMETER("point_size", KVS_PT_REAL, 0, dPointSize) KVSO_PARAMETERS_END(c) - if (widget()) + if(widget()) ((QTextEdit *)widget())->setFontPointSize(dPointSize); return true; } - - bool KvsObject_textedit::functionsetFamily(KviKvsObjectFunctionCall * c) { QString szFamily; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("family",KVS_PT_STRING,0,szFamily) + KVSO_PARAMETER("family", KVS_PT_STRING, 0, szFamily) KVSO_PARAMETERS_END(c) - if (widget()) + if(widget()) ((QTextEdit *)widget())->setFontFamily(szFamily); return true; } @@ -681,9 +680,9 @@ bool KvsObject_textedit::functionsetModified(KviKvsObjectFunctionCall * c) { bool bFlag; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("bModified",KVS_PT_BOOL,0,bFlag) + KVSO_PARAMETER("bModified", KVS_PT_BOOL, 0, bFlag) KVSO_PARAMETERS_END(c) - if (widget()) + if(widget()) ((QTextEdit *)widget())->document()->setModified(bFlag); return true; } @@ -695,10 +694,10 @@ bool KvsObject_textedit::functionModified(KviKvsObjectFunctionCall * c) return true; } - -bool KvsObject_textedit::functiontextFormat(KviKvsObjectFunctionCall *c) +bool KvsObject_textedit::functiontextFormat(KviKvsObjectFunctionCall * c) { - if(!widget())return true; + if(!widget()) + return true; if(((QTextEdit *)widget())->acceptRichText()) c->returnValue()->setString(QString("RichText")); else @@ -710,44 +709,42 @@ bool KvsObject_textedit::functionsetTextFormat(KviKvsObjectFunctionCall * c) { QString szFormat; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("textformat",KVS_PT_STRING,0,szFormat) + KVSO_PARAMETER("textformat", KVS_PT_STRING, 0, szFormat) KVSO_PARAMETERS_END(c) - if(!widget()) return true; - if(KviQString::equalCI(szFormat,"PlainText")) + if(!widget()) + return true; + if(KviQString::equalCI(szFormat, "PlainText")) ((QTextEdit *)widget())->setAcceptRichText(false); - else if(KviQString::equalCI(szFormat,"RichText")) + else if(KviQString::equalCI(szFormat, "RichText")) ((QTextEdit *)widget())->setAcceptRichText(true); - else - c->warning(__tr2qs_ctx("Unknown text format '%Q'","objects"),&szFormat); + else + c->warning(__tr2qs_ctx("Unknown text format '%Q'", "objects"), &szFormat); return true; } - - - bool KvsObject_textedit::functionloadFile(KviKvsObjectFunctionCall * c) { QString szFile; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("file_name",KVS_PT_STRING,0,szFile) + KVSO_PARAMETER("file_name", KVS_PT_STRING, 0, szFile) KVSO_PARAMETERS_END(c) - if ( !QFile::exists(szFile)) + if(!QFile::exists(szFile)) { - c->warning(__tr2qs_ctx("I can't find the specified file '%Q'.","objects"),&szFile); + c->warning(__tr2qs_ctx("I can't find the specified file '%Q'.", "objects"), &szFile); return true; } - QFile file( szFile ); - if ( !file.open( QIODevice::ReadOnly ) ) + QFile file(szFile); + if(!file.open(QIODevice::ReadOnly)) { - c->warning(__tr2qs_ctx("I can't read the file '%Q'.","objects"),&szFile); + c->warning(__tr2qs_ctx("I can't read the file '%Q'.", "objects"), &szFile); return true; } - QTextStream ts( &file ); + QTextStream ts(&file); QString txt = ts.readAll(); //settext tries to understand if the text is html or plain - ((QTextEdit *)widget())->setText( txt ); + ((QTextEdit *)widget())->setText(txt); file.close(); return true; @@ -757,25 +754,23 @@ bool KvsObject_textedit::functionsetAlignment(KviKvsObjectFunctionCall * c) { QString szAlignment; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("alignment",KVS_PT_STRING,0,szAlignment) + KVSO_PARAMETER("alignment", KVS_PT_STRING, 0, szAlignment) KVSO_PARAMETERS_END(c) - if(!widget()) return true; - if(KviQString::equalCI(szAlignment,"Left")) + if(!widget()) + return true; + if(KviQString::equalCI(szAlignment, "Left")) ((QTextEdit *)widget())->setAlignment(Qt::AlignLeft); - else if(KviQString::equalCI(szAlignment,"Right")) + else if(KviQString::equalCI(szAlignment, "Right")) ((QTextEdit *)widget())->setAlignment(Qt::AlignRight); - else if(KviQString::equalCI(szAlignment,"Center")) + else if(KviQString::equalCI(szAlignment, "Center")) ((QTextEdit *)widget())->setAlignment(Qt::AlignCenter); - else if(KviQString::equalCI(szAlignment,"Justify")) + else if(KviQString::equalCI(szAlignment, "Justify")) ((QTextEdit *)widget())->setAlignment(Qt::AlignJustify); - else - c->warning(__tr2qs_ctx("Unknown alignment '%Q'","objects"),&szAlignment); + else + c->warning(__tr2qs_ctx("Unknown alignment '%Q'", "objects"), &szAlignment); return true; } - - - bool KvsObject_textedit::functionlines(KviKvsObjectFunctionCall * c) { if(widget()) @@ -783,12 +778,9 @@ bool KvsObject_textedit::functionlines(KviKvsObjectFunctionCall * c) return true; } - - - bool KvsObject_textedit::functionselectAll(KviKvsObjectFunctionCall *) { - if (widget()) + if(widget()) ((QTextEdit *)widget())->selectAll(); return true; } diff --git a/src/modules/objects/KvsObject_multiLineEdit.h b/src/modules/objects/KvsObject_multiLineEdit.h index 9f8123655..d0a8e2b83 100644 --- a/src/modules/objects/KvsObject_multiLineEdit.h +++ b/src/modules/objects/KvsObject_multiLineEdit.h @@ -25,7 +25,6 @@ // //============================================================================= - #include "KvsObject_widget.h" #include "object_macros.h" @@ -37,57 +36,56 @@ public: public: QWidget * widget() { return (QWidget *)object(); }; protected: - virtual bool init(KviKvsRunTimeContext * pContext,KviKvsVariantList *pParams); - bool functionTextLine(KviKvsObjectFunctionCall *c); - bool functionInsertLine(KviKvsObjectFunctionCall *c); - bool functionRemoveLine(KviKvsObjectFunctionCall *c); - bool functionNumLines(KviKvsObjectFunctionCall *c); - bool functionAtBeginning(KviKvsObjectFunctionCall *c); - bool functionAtEnd(KviKvsObjectFunctionCall *c); - bool functionSetWordWrap(KviKvsObjectFunctionCall *c); - bool functionWordWrap(KviKvsObjectFunctionCall *c); - bool functionCursorPosition(KviKvsObjectFunctionCall *c); - bool functionText(KviKvsObjectFunctionCall *c); - bool functionLength(KviKvsObjectFunctionCall *c); - bool functionSetMaxLines(KviKvsObjectFunctionCall *c); - bool functionMaxLines(KviKvsObjectFunctionCall *c); - bool functionSetReadOnly(KviKvsObjectFunctionCall *c); - bool functionInsert(KviKvsObjectFunctionCall *c); - bool functionAppend(KviKvsObjectFunctionCall *c); - bool functionCopy(KviKvsObjectFunctionCall *c); - bool functionPaste(KviKvsObjectFunctionCall *c); - bool functionCut(KviKvsObjectFunctionCall *c); - bool functionsetItalic(KviKvsObjectFunctionCall *c); - bool functionitalic(KviKvsObjectFunctionCall *c); - bool functionsetBold(KviKvsObjectFunctionCall *c); - bool functionbold(KviKvsObjectFunctionCall *c); - bool functionsetUnderline(KviKvsObjectFunctionCall *c); - bool functionunderline(KviKvsObjectFunctionCall *c); - bool functionzoomIn(KviKvsObjectFunctionCall *c); - bool functionzoomOut(KviKvsObjectFunctionCall *c); - bool functionundo(KviKvsObjectFunctionCall *c); - bool functionredo(KviKvsObjectFunctionCall *c); - bool functiondel(KviKvsObjectFunctionCall *c); - bool functionclear(KviKvsObjectFunctionCall *c); - bool functionsetUndoRedoEnabled(KviKvsObjectFunctionCall *c); - bool functionisUndoRedoEnabled(KviKvsObjectFunctionCall *c); - bool functionsetText(KviKvsObjectFunctionCall *c); - bool functionsetHtmlText(KviKvsObjectFunctionCall *c); - bool functionsetPlainText(KviKvsObjectFunctionCall *c); - bool functionsetPointSize(KviKvsObjectFunctionCall *c); - bool functionsetColor(KviKvsObjectFunctionCall *c); - bool functionisUndoAvailable(KviKvsObjectFunctionCall *c); - bool functionisRedoAvailable(KviKvsObjectFunctionCall *c); - bool functionsetFamily(KviKvsObjectFunctionCall *c); - bool functionsetTextFormat(KviKvsObjectFunctionCall *c); - bool functiontextFormat(KviKvsObjectFunctionCall *c); - bool functionloadFile(KviKvsObjectFunctionCall *c); - bool functionlines(KviKvsObjectFunctionCall *c); - bool functionselectAll(KviKvsObjectFunctionCall *c); - bool functionsetModified(KviKvsObjectFunctionCall *c); - bool functionModified(KviKvsObjectFunctionCall *c); - bool functionsetAlignment(KviKvsObjectFunctionCall *c); - + virtual bool init(KviKvsRunTimeContext * pContext, KviKvsVariantList * pParams); + bool functionTextLine(KviKvsObjectFunctionCall * c); + bool functionInsertLine(KviKvsObjectFunctionCall * c); + bool functionRemoveLine(KviKvsObjectFunctionCall * c); + bool functionNumLines(KviKvsObjectFunctionCall * c); + bool functionAtBeginning(KviKvsObjectFunctionCall * c); + bool functionAtEnd(KviKvsObjectFunctionCall * c); + bool functionSetWordWrap(KviKvsObjectFunctionCall * c); + bool functionWordWrap(KviKvsObjectFunctionCall * c); + bool functionCursorPosition(KviKvsObjectFunctionCall * c); + bool functionText(KviKvsObjectFunctionCall * c); + bool functionLength(KviKvsObjectFunctionCall * c); + bool functionSetMaxLines(KviKvsObjectFunctionCall * c); + bool functionMaxLines(KviKvsObjectFunctionCall * c); + bool functionSetReadOnly(KviKvsObjectFunctionCall * c); + bool functionInsert(KviKvsObjectFunctionCall * c); + bool functionAppend(KviKvsObjectFunctionCall * c); + bool functionCopy(KviKvsObjectFunctionCall * c); + bool functionPaste(KviKvsObjectFunctionCall * c); + bool functionCut(KviKvsObjectFunctionCall * c); + bool functionsetItalic(KviKvsObjectFunctionCall * c); + bool functionitalic(KviKvsObjectFunctionCall * c); + bool functionsetBold(KviKvsObjectFunctionCall * c); + bool functionbold(KviKvsObjectFunctionCall * c); + bool functionsetUnderline(KviKvsObjectFunctionCall * c); + bool functionunderline(KviKvsObjectFunctionCall * c); + bool functionzoomIn(KviKvsObjectFunctionCall * c); + bool functionzoomOut(KviKvsObjectFunctionCall * c); + bool functionundo(KviKvsObjectFunctionCall * c); + bool functionredo(KviKvsObjectFunctionCall * c); + bool functiondel(KviKvsObjectFunctionCall * c); + bool functionclear(KviKvsObjectFunctionCall * c); + bool functionsetUndoRedoEnabled(KviKvsObjectFunctionCall * c); + bool functionisUndoRedoEnabled(KviKvsObjectFunctionCall * c); + bool functionsetText(KviKvsObjectFunctionCall * c); + bool functionsetHtmlText(KviKvsObjectFunctionCall * c); + bool functionsetPlainText(KviKvsObjectFunctionCall * c); + bool functionsetPointSize(KviKvsObjectFunctionCall * c); + bool functionsetColor(KviKvsObjectFunctionCall * c); + bool functionisUndoAvailable(KviKvsObjectFunctionCall * c); + bool functionisRedoAvailable(KviKvsObjectFunctionCall * c); + bool functionsetFamily(KviKvsObjectFunctionCall * c); + bool functionsetTextFormat(KviKvsObjectFunctionCall * c); + bool functiontextFormat(KviKvsObjectFunctionCall * c); + bool functionloadFile(KviKvsObjectFunctionCall * c); + bool functionlines(KviKvsObjectFunctionCall * c); + bool functionselectAll(KviKvsObjectFunctionCall * c); + bool functionsetModified(KviKvsObjectFunctionCall * c); + bool functionModified(KviKvsObjectFunctionCall * c); + bool functionsetAlignment(KviKvsObjectFunctionCall * c); }; -#endif //!_CLASS_MULTILINEEDIT_H_ +#endif //!_CLASS_MULTILINEEDIT_H_ diff --git a/src/modules/objects/KvsObject_painter.cpp b/src/modules/objects/KvsObject_painter.cpp index 2d64ea223..1ab46746c 100644 --- a/src/modules/objects/KvsObject_painter.cpp +++ b/src/modules/objects/KvsObject_painter.cpp @@ -37,26 +37,25 @@ #include #include -#define PAINTER_ROTATE(__angle,__axis)\ - QTransform transform;\ - transform.rotate(__angle,__axis);\ - m_pPainter->setTransform(transform,true); - -#define PAINTER_TRANSLATE(__x,__y)\ - QTransform transform;\ - transform.translate(__x,__y);\ - m_pPainter->setTransform(transform,true); - -#define PAINTER_SHEAR(__sH,__sV)\ - QTransform transform;\ - transform.shear(__sH,__sV);\ - m_pPainter->setTransform(transform,true); - -#define PAINTER_SCALE(__sX,__sY)\ - QTransform transform;\ - transform.scale(__sX,__sY);\ - m_pPainter->setTransform(transform,true); - +#define PAINTER_ROTATE(__angle, __axis) \ + QTransform transform; \ + transform.rotate(__angle, __axis); \ + m_pPainter->setTransform(transform, true); + +#define PAINTER_TRANSLATE(__x, __y) \ + QTransform transform; \ + transform.translate(__x, __y); \ + m_pPainter->setTransform(transform, true); + +#define PAINTER_SHEAR(__sH, __sV) \ + QTransform transform; \ + transform.shear(__sH, __sV); \ + m_pPainter->setTransform(transform, true); + +#define PAINTER_SCALE(__sX, __sY) \ + QTransform transform; \ + transform.scale(__sX, __sY); \ + m_pPainter->setTransform(transform, true); const Qt::PenStyle penstyles_cod[] = { Qt::NoPen, @@ -103,8 +102,7 @@ const char * const align_tbl[] = { "TextWordWrap", "TextIncludeTrailingSpaces" }; -#define align_num (sizeof(align_tbl) / sizeof(align_tbl[0])) - +#define align_num (sizeof(align_tbl) / sizeof(align_tbl[0])) const QPainter::CompositionMode composition_cod[] = { QPainter::CompositionMode_SourceOver, @@ -159,9 +157,9 @@ const char * const composition_tbl[] = { "Exclusion" }; -#define penstyles_num (sizeof(penstyles_tbl) / sizeof(penstyles_tbl[0])) +#define penstyles_num (sizeof(penstyles_tbl) / sizeof(penstyles_tbl[0])) -#define composition_num (sizeof(composition_tbl) / sizeof(composition_tbl[0])) +#define composition_num (sizeof(composition_tbl) / sizeof(composition_tbl[0])) const Qt::BrushStyle brushstyles_cod[] = { Qt::NoBrush, @@ -199,7 +197,7 @@ const char * const brushstyles_tbl[] = { "DiagCrossPattern" }; -#define brushstyles_num (sizeof(brushstyles_tbl) / sizeof(brushstyles_tbl[0])) +#define brushstyles_num (sizeof(brushstyles_tbl) / sizeof(brushstyles_tbl[0])) /* @doc: painter @@ -522,442 +520,455 @@ const char * const brushstyles_tbl[] = { */ // ======================================================================== -KVSO_BEGIN_REGISTERCLASS(KvsObject_painter,"painter","object") - - // Fonts - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter,setFont) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter,setFontSize) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter,fontAscent) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter,fontDescent) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter,fontMetricsHeight) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter,fontMetricsWidth) - - // Draws - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter,drawRect) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter,drawLine) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter,drawRoundRect) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter,drawPoint) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter,drawArc) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter,drawEllipse) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter,drawPie) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter,drawChord) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter,fillRect) - - // Text & Pixmap & Icons - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter,drawText) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter,drawPixmap) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter,drawPixmapMirrored) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter,drawPixmapWithColorEffect) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter,drawIcon) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter,drawHtmlText) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter,htmlTextSize) - - - // Transform Operation - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter,rotate) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter,shear) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter,scale) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter,translate) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter,reset) - - - - // ?? - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter,setOpacity) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter,setTextAntialiasing) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter,setAntialiasing) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter,setSmoothPixmapTransform) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter,setBackGroundMode) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter,setCompositionMode) - - - // QPainterPath stuff - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter,drawPath) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter,resetPath) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter,pathAddText) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter,pathMoveTo) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter,pathLineTo) - - // Pen - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter,setPenJoinStyle) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter,setPenCapStyle) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter,setPenWidth) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter,setPenStyle) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter,setPen) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter,pen) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter,colorNames) - - - // Brush - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter,setBrush) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter,setBrushStyle) - - - // Gradients - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter,setGradientStart) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter,setGradientStop) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter,setGradientColor) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter,setGradientAsBrush) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter,clearGradient) - - // painter state - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter,save) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter,restore) - - // painter device - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter,painterDeviceWidth) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter,painterDeviceHeight) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter,begin) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter,end) - - // extra - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter,beginPdf) - - +KVSO_BEGIN_REGISTERCLASS(KvsObject_painter, "painter", "object") + +// Fonts +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter, setFont) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter, setFontSize) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter, fontAscent) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter, fontDescent) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter, fontMetricsHeight) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter, fontMetricsWidth) + +// Draws +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter, drawRect) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter, drawLine) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter, drawRoundRect) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter, drawPoint) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter, drawArc) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter, drawEllipse) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter, drawPie) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter, drawChord) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter, fillRect) + +// Text & Pixmap & Icons +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter, drawText) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter, drawPixmap) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter, drawPixmapMirrored) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter, drawPixmapWithColorEffect) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter, drawIcon) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter, drawHtmlText) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter, htmlTextSize) + +// Transform Operation +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter, rotate) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter, shear) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter, scale) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter, translate) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter, reset) + +// ?? +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter, setOpacity) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter, setTextAntialiasing) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter, setAntialiasing) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter, setSmoothPixmapTransform) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter, setBackGroundMode) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter, setCompositionMode) + +// QPainterPath stuff +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter, drawPath) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter, resetPath) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter, pathAddText) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter, pathMoveTo) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter, pathLineTo) + +// Pen +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter, setPenJoinStyle) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter, setPenCapStyle) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter, setPenWidth) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter, setPenStyle) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter, setPen) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter, pen) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter, colorNames) + +// Brush +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter, setBrush) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter, setBrushStyle) + +// Gradients +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter, setGradientStart) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter, setGradientStop) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter, setGradientColor) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter, setGradientAsBrush) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter, clearGradient) + +// painter state +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter, save) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter, restore) + +// painter device +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter, painterDeviceWidth) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter, painterDeviceHeight) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter, begin) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter, end) + +// extra +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_painter, beginPdf) KVSO_END_REGISTERCLASS(KvsObject_painter) +KVSO_BEGIN_CONSTRUCTOR(KvsObject_painter, KviKvsObject) -KVSO_BEGIN_CONSTRUCTOR(KvsObject_painter,KviKvsObject) - - m_pPainter = new QPainter(); - bDonotdeleteinternalqpainter=false; - m_pPrinter = 0 ; - m_pDeviceObject=0; - m_pPainterPath=0; - m_pGradient=0; +m_pPainter = new QPainter(); +bDonotdeleteinternalqpainter = false; +m_pPrinter = 0; +m_pDeviceObject = 0; +m_pPainterPath = 0; +m_pGradient = 0; KVSO_END_CONSTRUCTOR(KvsObject_painter) KVSO_BEGIN_DESTRUCTOR(KvsObject_painter) - if (m_pPainterPath) delete m_pPainterPath; - m_pPainterPath=0; - if (m_pGradient) delete m_pGradient; - m_pGradient=0; - if (m_pPainter && !bDonotdeleteinternalqpainter) delete m_pPainter; - m_pPainter = 0; - if (m_pPrinter) delete m_pPrinter; - m_pPrinter = 0; +if(m_pPainterPath) + delete m_pPainterPath; +m_pPainterPath = 0; +if(m_pGradient) + delete m_pGradient; +m_pGradient = 0; +if(m_pPainter && !bDonotdeleteinternalqpainter) + delete m_pPainter; +m_pPainter = 0; +if(m_pPrinter) + delete m_pPrinter; +m_pPrinter = 0; KVSO_END_CONSTRUCTOR(KvsObject_painter) -#define KVSO_PARAMETERS_PAINTER(__pXOrArray,__iY,__iW,__iH)\ -if(__pXOrArray->isArray())\ - {\ - if(__pXOrArray->array()->size() < 4)\ - {\ - c->error(__tr2qs_ctx("The array passed as parameter must contain at least 4 elements","objects"));\ - return false;\ - }\ - KviKvsVariant * pX = __pXOrArray->array()->at(0);\ - KviKvsVariant * pY = __pXOrArray->array()->at(1);\ - KviKvsVariant * pW = __pXOrArray->array()->at(2);\ - KviKvsVariant * pH = __pXOrArray->array()->at(3);\ - if(!(pX && pY && pW && pH))\ - {\ - c->error(__tr2qs_ctx("One of the geometry array parameters is empty","objects"));\ - return false;\ - }\ - if(!(pX->asInteger(iX) && pY->asInteger(__iY) && pW->asInteger(__iW) && pH->asInteger(__iH)))\ - {\ - c->error(__tr2qs_ctx("One of the geometry array parameters didn't evaluate to an integer","objects"));\ - return false;\ - }\ - } else {\ - if(c->params()->count() < 4)\ - {\ - QString error=function+__tr2qs_ctx(" requires either an array as first parameter or four integers","objects");\ - c->error(error);\ - return false;\ - }\ - if(!__pXOrArray->asInteger(iX))\ - {\ - c->error(__tr2qs_ctx("The first parameter didn't evaluate to an array nor an integer","objects"));\ - return false;\ - }\ - }\ - -#define KVSO_2ARRAYPARAMETERS(__pXOrArray,__iY)\ -if(__pXOrArray->isArray())\ - {\ - if(__pXOrArray->array()->size() < 2)\ - {\ - c->error(__tr2qs_ctx("The array passed as parameter must contain at least 2 elements","objects"));\ - return false;\ - }\ - KviKvsVariant * pX = __pXOrArray->array()->at(0);\ - KviKvsVariant * pY = __pXOrArray->array()->at(1);\ - if(!(pX && pY ))\ - {\ - c->error(__tr2qs_ctx("One of the array parameters is empty","objects"));\ - return false;\ - }\ - if(!(pX->asInteger(iX) && pY->asInteger(__iY)))\ - {\ - c->error(__tr2qs_ctx("One of the array parameters didn't evaluate to an integer","objects"));\ - return false;\ - }\ - } else {\ - if(c->params()->count() < 2)\ - {\ - QString error=function+__tr2qs_ctx(" requires either an array as first parameter or two integers","objects");\ - c->error(error);\ - return false;\ - }\ - if(!__pXOrArray->asInteger(iX))\ - {\ - c->error(__tr2qs_ctx("The first parameter didn't evaluate to an array nor an integer","objects"));\ - return false;\ - }\ - }\ - -#define KVSO_3OR4ARRAYPARAMETERS(__pCol1OrArray,__iCol2,__iCol3,__iOpacity)\ -if(__pCol1OrArray->isArray())\ - {\ - if(__pCol1OrArray->array()->size() < 3)\ - {\ - c->error(__tr2qs_ctx("The array passed as parameter must contain at least 3 elements","objects"));\ - return false;\ - }\ - KviKvsVariant * c1 = __pCol1OrArray->array()->at(0);\ - KviKvsVariant * c2 = __pCol1OrArray->array()->at(1);\ - KviKvsVariant * c3 = __pCol1OrArray->array()->at(2);\ - if(!(c1 && c2 && c3))\ - {\ - c->error(__tr2qs_ctx("One of the array parameters is empty","objects"));\ - return false;\ - }\ - if(!(c1->asInteger(iCol1) && c2->asInteger(__iCol2) && c3->asInteger(__iCol3)))\ - {\ - c->error(__tr2qs_ctx("One of the array parameters didn't evaluate to an integer","objects"));\ - return false;\ - }\ - if(__pCol1OrArray->array()->size() > 3)\ - {\ - KviKvsVariant * c4 = __pCol1OrArray->array()->at(3);\ - if(!(c4->asInteger(__iOpacity)))\ - {\ - c->error(__tr2qs_ctx("The opacity value didn't evaluate to an integer","objects"));\ - return false;\ - }\ - }\ - } else {\ - if(c->params()->count() < 3)\ - {\ - QString error=function+__tr2qs_ctx(" requires either an array as first parameter or 3 integers","objects");\ - c->error(error);\ - return false;\ - }\ - if(!__pCol1OrArray->asInteger(iCol1))\ - {\ - c->error(__tr2qs_ctx("The first parameter didn't evaluate to an array nor an integer","objects"));\ - return false;\ - }\ - }\ - -KVSO_CLASS_FUNCTION(painter,setFont) +#define KVSO_PARAMETERS_PAINTER(__pXOrArray, __iY, __iW, __iH) \ + if(__pXOrArray->isArray()) \ + { \ + if(__pXOrArray->array()->size() < 4) \ + { \ + c->error(__tr2qs_ctx("The array passed as parameter must contain at least 4 elements", "objects")); \ + return false; \ + } \ + KviKvsVariant * pX = __pXOrArray->array()->at(0); \ + KviKvsVariant * pY = __pXOrArray->array()->at(1); \ + KviKvsVariant * pW = __pXOrArray->array()->at(2); \ + KviKvsVariant * pH = __pXOrArray->array()->at(3); \ + if(!(pX && pY && pW && pH)) \ + { \ + c->error(__tr2qs_ctx("One of the geometry array parameters is empty", "objects")); \ + return false; \ + } \ + if(!(pX->asInteger(iX) && pY->asInteger(__iY) && pW->asInteger(__iW) && pH->asInteger(__iH))) \ + { \ + c->error(__tr2qs_ctx("One of the geometry array parameters didn't evaluate to an integer", "objects")); \ + return false; \ + } \ + } \ + else \ + { \ + if(c->params()->count() < 4) \ + { \ + QString error = function + __tr2qs_ctx(" requires either an array as first parameter or four integers", "objects"); \ + c->error(error); \ + return false; \ + } \ + if(!__pXOrArray->asInteger(iX)) \ + { \ + c->error(__tr2qs_ctx("The first parameter didn't evaluate to an array nor an integer", "objects")); \ + return false; \ + } \ + } + +#define KVSO_2ARRAYPARAMETERS(__pXOrArray, __iY) \ + if(__pXOrArray->isArray()) \ + { \ + if(__pXOrArray->array()->size() < 2) \ + { \ + c->error(__tr2qs_ctx("The array passed as parameter must contain at least 2 elements", "objects")); \ + return false; \ + } \ + KviKvsVariant * pX = __pXOrArray->array()->at(0); \ + KviKvsVariant * pY = __pXOrArray->array()->at(1); \ + if(!(pX && pY)) \ + { \ + c->error(__tr2qs_ctx("One of the array parameters is empty", "objects")); \ + return false; \ + } \ + if(!(pX->asInteger(iX) && pY->asInteger(__iY))) \ + { \ + c->error(__tr2qs_ctx("One of the array parameters didn't evaluate to an integer", "objects")); \ + return false; \ + } \ + } \ + else \ + { \ + if(c->params()->count() < 2) \ + { \ + QString error = function + __tr2qs_ctx(" requires either an array as first parameter or two integers", "objects"); \ + c->error(error); \ + return false; \ + } \ + if(!__pXOrArray->asInteger(iX)) \ + { \ + c->error(__tr2qs_ctx("The first parameter didn't evaluate to an array nor an integer", "objects")); \ + return false; \ + } \ + } + +#define KVSO_3OR4ARRAYPARAMETERS(__pCol1OrArray, __iCol2, __iCol3, __iOpacity) \ + if(__pCol1OrArray->isArray()) \ + { \ + if(__pCol1OrArray->array()->size() < 3) \ + { \ + c->error(__tr2qs_ctx("The array passed as parameter must contain at least 3 elements", "objects")); \ + return false; \ + } \ + KviKvsVariant * c1 = __pCol1OrArray->array()->at(0); \ + KviKvsVariant * c2 = __pCol1OrArray->array()->at(1); \ + KviKvsVariant * c3 = __pCol1OrArray->array()->at(2); \ + if(!(c1 && c2 && c3)) \ + { \ + c->error(__tr2qs_ctx("One of the array parameters is empty", "objects")); \ + return false; \ + } \ + if(!(c1->asInteger(iCol1) && c2->asInteger(__iCol2) && c3->asInteger(__iCol3))) \ + { \ + c->error(__tr2qs_ctx("One of the array parameters didn't evaluate to an integer", "objects")); \ + return false; \ + } \ + if(__pCol1OrArray->array()->size() > 3) \ + { \ + KviKvsVariant * c4 = __pCol1OrArray->array()->at(3); \ + if(!(c4->asInteger(__iOpacity))) \ + { \ + c->error(__tr2qs_ctx("The opacity value didn't evaluate to an integer", "objects")); \ + return false; \ + } \ + } \ + } \ + else \ + { \ + if(c->params()->count() < 3) \ + { \ + QString error = function + __tr2qs_ctx(" requires either an array as first parameter or 3 integers", "objects"); \ + c->error(error); \ + return false; \ + } \ + if(!__pCol1OrArray->asInteger(iCol1)) \ + { \ + c->error(__tr2qs_ctx("The first parameter didn't evaluate to an array nor an integer", "objects")); \ + return false; \ + } \ + } + +KVSO_CLASS_FUNCTION(painter, setFont) { CHECK_INTERNAL_POINTER(m_pPainter) QString szFamily; QStringList szListStyle; kvs_int_t iSize; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("size",KVS_PT_INTEGER,0,iSize) - KVSO_PARAMETER("family",KVS_PT_STRING,0,szFamily) - KVSO_PARAMETER("style",KVS_PT_STRINGLIST,KVS_PF_OPTIONAL,szListStyle) + KVSO_PARAMETER("size", KVS_PT_INTEGER, 0, iSize) + KVSO_PARAMETER("family", KVS_PT_STRING, 0, szFamily) + KVSO_PARAMETER("style", KVS_PT_STRINGLIST, KVS_PF_OPTIONAL, szListStyle) KVSO_PARAMETERS_END(c) - QFont font=m_pPainter->font(); + QFont font = m_pPainter->font(); font.setFamily(szFamily); font.setPointSize(iSize); QString szStyle; - for(int i=0;iwarning(__tr2qs_ctx("Unknown style '%Q'","objects"),&szStyle); + szStyle = szListStyle.at(i); + if(KviQString::equalCI(szStyle, "italic")) + font.setItalic(true); + else if(KviQString::equalCI(szStyle, "bold")) + font.setBold(true); + else if(KviQString::equalCI(szStyle, "underline")) + font.setUnderline(true); + else if(KviQString::equalCI(szStyle, "overline")) + font.setOverline(true); + else if(KviQString::equalCI(szStyle, "strikeout")) + font.setStrikeOut(true); + else if(KviQString::equalCI(szStyle, "fixedpitch")) + font.setFixedPitch(true); + else + c->warning(__tr2qs_ctx("Unknown style '%Q'", "objects"), &szStyle); } m_pPainter->setFont(font); return true; } -KVSO_CLASS_FUNCTION(painter,setFontSize) +KVSO_CLASS_FUNCTION(painter, setFontSize) { CHECK_INTERNAL_POINTER(m_pPainter) kvs_uint_t uSize; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("size",KVS_PT_UNSIGNEDINTEGER,0,uSize) + KVSO_PARAMETER("size", KVS_PT_UNSIGNEDINTEGER, 0, uSize) KVSO_PARAMETERS_END(c) - QFont font=m_pPainter->font(); + QFont font = m_pPainter->font(); font.setPointSize(uSize); m_pPainter->setFont(font); return true; } -KVSO_CLASS_FUNCTION(painter,setBackGroundMode) +KVSO_CLASS_FUNCTION(painter, setBackGroundMode) { CHECK_INTERNAL_POINTER(m_pPainter) QString szMode; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("background mode",KVS_PT_STRING,0,szMode) + KVSO_PARAMETER("background mode", KVS_PT_STRING, 0, szMode) KVSO_PARAMETERS_END(c) - if(KviQString::equalCI(szMode,"Transparent")) m_pPainter->setBackgroundMode(Qt::TransparentMode); - else if(KviQString::equalCI(szMode,"Opaque")) m_pPainter->setBackgroundMode(Qt::OpaqueMode); - else c->warning( __tr2qs_ctx("Unknown '%Q' background mode","objects"),&szMode); + if(KviQString::equalCI(szMode, "Transparent")) + m_pPainter->setBackgroundMode(Qt::TransparentMode); + else if(KviQString::equalCI(szMode, "Opaque")) + m_pPainter->setBackgroundMode(Qt::OpaqueMode); + else + c->warning(__tr2qs_ctx("Unknown '%Q' background mode", "objects"), &szMode); return true; } -KVSO_CLASS_FUNCTION(painter,drawLine) +KVSO_CLASS_FUNCTION(painter, drawLine) { CHECK_INTERNAL_POINTER(m_pPainter) KviKvsVariant * pXOrArray; - kvs_int_t iX,iY,iX1,iY1; + kvs_int_t iX, iY, iX1, iY1; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("x_or_array",KVS_PT_VARIANT,0,pXOrArray) - KVSO_PARAMETER("y",KVS_PT_INT,KVS_PF_OPTIONAL,iY) - KVSO_PARAMETER("x1",KVS_PT_INT,KVS_PF_OPTIONAL,iX1) - KVSO_PARAMETER("y1",KVS_PT_INT,KVS_PF_OPTIONAL,iY1) + KVSO_PARAMETER("x_or_array", KVS_PT_VARIANT, 0, pXOrArray) + KVSO_PARAMETER("y", KVS_PT_INT, KVS_PF_OPTIONAL, iY) + KVSO_PARAMETER("x1", KVS_PT_INT, KVS_PF_OPTIONAL, iX1) + KVSO_PARAMETER("y1", KVS_PT_INT, KVS_PF_OPTIONAL, iY1) KVSO_PARAMETERS_END(c) - QString function="$drawLine"; - KVSO_PARAMETERS_PAINTER(pXOrArray,iY,iX1,iY1) - if(m_pPainter) m_pPainter->drawLine(iX,iY,iX1,iY1); + QString function = "$drawLine"; + KVSO_PARAMETERS_PAINTER(pXOrArray, iY, iX1, iY1) + if(m_pPainter) + m_pPainter->drawLine(iX, iY, iX1, iY1); return true; } -KVSO_CLASS_FUNCTION(painter,drawRect) +KVSO_CLASS_FUNCTION(painter, drawRect) { CHECK_INTERNAL_POINTER(m_pPainter) KviKvsVariant * pXOrArray; - kvs_int_t iX,iY,iW,iH; + kvs_int_t iX, iY, iW, iH; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("x_or_array",KVS_PT_VARIANT,0,pXOrArray) - KVSO_PARAMETER("y",KVS_PT_INT,KVS_PF_OPTIONAL,iY) - KVSO_PARAMETER("w",KVS_PT_INT,KVS_PF_OPTIONAL,iW) - KVSO_PARAMETER("h",KVS_PT_INT,KVS_PF_OPTIONAL,iH) + KVSO_PARAMETER("x_or_array", KVS_PT_VARIANT, 0, pXOrArray) + KVSO_PARAMETER("y", KVS_PT_INT, KVS_PF_OPTIONAL, iY) + KVSO_PARAMETER("w", KVS_PT_INT, KVS_PF_OPTIONAL, iW) + KVSO_PARAMETER("h", KVS_PT_INT, KVS_PF_OPTIONAL, iH) KVSO_PARAMETERS_END(c) - QString function="$drawRect"; - KVSO_PARAMETERS_PAINTER(pXOrArray,iY,iW,iH) - m_pPainter->drawRect(iX,iY,iW,iH); + QString function = "$drawRect"; + KVSO_PARAMETERS_PAINTER(pXOrArray, iY, iW, iH) + m_pPainter->drawRect(iX, iY, iW, iH); return true; } - -KVSO_CLASS_FUNCTION(painter,drawEllipse) +KVSO_CLASS_FUNCTION(painter, drawEllipse) { CHECK_INTERNAL_POINTER(m_pPainter) KviKvsVariant * pXOrArray; - kvs_int_t iX,iY,iW,iH; + kvs_int_t iX, iY, iW, iH; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("x_or_array",KVS_PT_VARIANT,0,pXOrArray) - KVSO_PARAMETER("y",KVS_PT_INT,KVS_PF_OPTIONAL,iY) - KVSO_PARAMETER("w",KVS_PT_INT,KVS_PF_OPTIONAL,iW) - KVSO_PARAMETER("h",KVS_PT_INT,KVS_PF_OPTIONAL,iH) + KVSO_PARAMETER("x_or_array", KVS_PT_VARIANT, 0, pXOrArray) + KVSO_PARAMETER("y", KVS_PT_INT, KVS_PF_OPTIONAL, iY) + KVSO_PARAMETER("w", KVS_PT_INT, KVS_PF_OPTIONAL, iW) + KVSO_PARAMETER("h", KVS_PT_INT, KVS_PF_OPTIONAL, iH) KVSO_PARAMETERS_END(c) - QString function="$drawEllipse"; - KVSO_PARAMETERS_PAINTER(pXOrArray,iY,iW,iH) - m_pPainter->drawEllipse(iX,iY,iW,iH); + QString function = "$drawEllipse"; + KVSO_PARAMETERS_PAINTER(pXOrArray, iY, iW, iH) + m_pPainter->drawEllipse(iX, iY, iW, iH); return true; } -KVSO_CLASS_FUNCTION(painter,drawRoundRect) +KVSO_CLASS_FUNCTION(painter, drawRoundRect) { CHECK_INTERNAL_POINTER(m_pPainter) KviKvsVariant * pXOrArray; - kvs_int_t iXrnd,iYrnd,iX,iY,iW,iH; + kvs_int_t iXrnd, iYrnd, iX, iY, iW, iH; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("x_round",KVS_PT_INT,0,iXrnd) - KVSO_PARAMETER("y_round",KVS_PT_INT,0,iYrnd) - KVSO_PARAMETER("x_or_array",KVS_PT_VARIANT,0,pXOrArray) - KVSO_PARAMETER("y",KVS_PT_INT,KVS_PF_OPTIONAL,iY) - KVSO_PARAMETER("w",KVS_PT_INT,KVS_PF_OPTIONAL,iW) - KVSO_PARAMETER("h",KVS_PT_INT,KVS_PF_OPTIONAL,iH) + KVSO_PARAMETER("x_round", KVS_PT_INT, 0, iXrnd) + KVSO_PARAMETER("y_round", KVS_PT_INT, 0, iYrnd) + KVSO_PARAMETER("x_or_array", KVS_PT_VARIANT, 0, pXOrArray) + KVSO_PARAMETER("y", KVS_PT_INT, KVS_PF_OPTIONAL, iY) + KVSO_PARAMETER("w", KVS_PT_INT, KVS_PF_OPTIONAL, iW) + KVSO_PARAMETER("h", KVS_PT_INT, KVS_PF_OPTIONAL, iH) KVSO_PARAMETERS_END(c) - QString function="$drawRoundRect"; - KVSO_PARAMETERS_PAINTER(pXOrArray,iY,iW,iH) - m_pPainter->drawRoundRect(iX,iY,iW,iH,iXrnd,iYrnd); + QString function = "$drawRoundRect"; + KVSO_PARAMETERS_PAINTER(pXOrArray, iY, iW, iH) + m_pPainter->drawRoundRect(iX, iY, iW, iH, iXrnd, iYrnd); return true; } -KVSO_CLASS_FUNCTION(painter,drawArc) +KVSO_CLASS_FUNCTION(painter, drawArc) { CHECK_INTERNAL_POINTER(m_pPainter) KviKvsVariant * pXOrArray; - kvs_int_t iSangle,iLena,iX,iY,iW,iH; + kvs_int_t iSangle, iLena, iX, iY, iW, iH; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("start_angle",KVS_PT_INT,0,iSangle) - KVSO_PARAMETER("a_lenght",KVS_PT_INT,0,iLena) - KVSO_PARAMETER("x_or_array",KVS_PT_VARIANT,0,pXOrArray) - KVSO_PARAMETER("y",KVS_PT_INT,KVS_PF_OPTIONAL,iY) - KVSO_PARAMETER("w",KVS_PT_INT,KVS_PF_OPTIONAL,iW) - KVSO_PARAMETER("h",KVS_PT_INT,KVS_PF_OPTIONAL,iH) + KVSO_PARAMETER("start_angle", KVS_PT_INT, 0, iSangle) + KVSO_PARAMETER("a_lenght", KVS_PT_INT, 0, iLena) + KVSO_PARAMETER("x_or_array", KVS_PT_VARIANT, 0, pXOrArray) + KVSO_PARAMETER("y", KVS_PT_INT, KVS_PF_OPTIONAL, iY) + KVSO_PARAMETER("w", KVS_PT_INT, KVS_PF_OPTIONAL, iW) + KVSO_PARAMETER("h", KVS_PT_INT, KVS_PF_OPTIONAL, iH) KVSO_PARAMETERS_END(c) - QString function="$drawArc"; - KVSO_PARAMETERS_PAINTER(pXOrArray,iY,iW,iH) - m_pPainter->drawArc(iX,iY,iW,iH,iSangle,iLena); + QString function = "$drawArc"; + KVSO_PARAMETERS_PAINTER(pXOrArray, iY, iW, iH) + m_pPainter->drawArc(iX, iY, iW, iH, iSangle, iLena); return true; } -KVSO_CLASS_FUNCTION(painter,drawChord) +KVSO_CLASS_FUNCTION(painter, drawChord) { CHECK_INTERNAL_POINTER(m_pPainter) KviKvsVariant * pXOrArray; - kvs_int_t iSangle,iLena,iX,iY,iW,iH; + kvs_int_t iSangle, iLena, iX, iY, iW, iH; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("start_angle",KVS_PT_INT,0,iSangle) - KVSO_PARAMETER("a_lenght",KVS_PT_INT,0,iLena) - KVSO_PARAMETER("x_or_array",KVS_PT_VARIANT,0,pXOrArray) - KVSO_PARAMETER("y",KVS_PT_INT,KVS_PF_OPTIONAL,iY) - KVSO_PARAMETER("w",KVS_PT_INT,KVS_PF_OPTIONAL,iW) - KVSO_PARAMETER("h",KVS_PT_INT,KVS_PF_OPTIONAL,iH) + KVSO_PARAMETER("start_angle", KVS_PT_INT, 0, iSangle) + KVSO_PARAMETER("a_lenght", KVS_PT_INT, 0, iLena) + KVSO_PARAMETER("x_or_array", KVS_PT_VARIANT, 0, pXOrArray) + KVSO_PARAMETER("y", KVS_PT_INT, KVS_PF_OPTIONAL, iY) + KVSO_PARAMETER("w", KVS_PT_INT, KVS_PF_OPTIONAL, iW) + KVSO_PARAMETER("h", KVS_PT_INT, KVS_PF_OPTIONAL, iH) KVSO_PARAMETERS_END(c) - QString function="$drawChord"; - KVSO_PARAMETERS_PAINTER(pXOrArray,iY,iW,iH) - m_pPainter->drawChord(iX,iY,iW,iH,iSangle,iLena); + QString function = "$drawChord"; + KVSO_PARAMETERS_PAINTER(pXOrArray, iY, iW, iH) + m_pPainter->drawChord(iX, iY, iW, iH, iSangle, iLena); return true; } -KVSO_CLASS_FUNCTION(painter,setBrush) +KVSO_CLASS_FUNCTION(painter, setBrush) { CHECK_INTERNAL_POINTER(m_pPainter) - kvs_int_t iCol1,iCol2,iCol3,iOpacity; - KviKvsVariant *var1,*var2,*var3; - QString szColorMode,szColor; + kvs_int_t iCol1, iCol2, iCol3, iOpacity; + KviKvsVariant *var1, *var2, *var3; + QString szColorMode, szColor; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("Color_1_Or_Colorname_Or_Pixmap",KVS_PT_VARIANT,0,var1) - KVSO_PARAMETER("Color_2",KVS_PT_VARIANT,KVS_PF_OPTIONAL,var2) - KVSO_PARAMETER("Colo3_3",KVS_PT_VARIANT,KVS_PF_OPTIONAL,var3) - KVSO_PARAMETER("color_mode",KVS_PT_STRING,KVS_PF_OPTIONAL,szColorMode) - KVSO_PARAMETER("opacity",KVS_PT_INT,KVS_PF_OPTIONAL,iOpacity) + KVSO_PARAMETER("Color_1_Or_Colorname_Or_Pixmap", KVS_PT_VARIANT, 0, var1) + KVSO_PARAMETER("Color_2", KVS_PT_VARIANT, KVS_PF_OPTIONAL, var2) + KVSO_PARAMETER("Colo3_3", KVS_PT_VARIANT, KVS_PF_OPTIONAL, var3) + KVSO_PARAMETER("color_mode", KVS_PT_STRING, KVS_PF_OPTIONAL, szColorMode) + KVSO_PARAMETER("opacity", KVS_PT_INT, KVS_PF_OPTIONAL, iOpacity) KVSO_PARAMETERS_END(c) if(var1->isHObject()) { kvs_hobject_t hObj; var1->asHObject(hObj); - KviKvsObject *pObject=KviKvsKernel::instance()->objectController()->lookupObject(hObj); - if (!pObject) + KviKvsObject * pObject = KviKvsKernel::instance()->objectController()->lookupObject(hObj); + if(!pObject) { - c->warning(__tr2qs_ctx("Pixmap parameter is not an object!","objects")); + c->warning(__tr2qs_ctx("Pixmap parameter is not an object!", "objects")); return true; } if(pObject->inheritsClass("pixmap")) m_pPainter->setBrush(*((KvsObject_pixmap *)pObject)->getImage()); - else c->warning(__tr2qs_ctx("Object Pixmap required!","objects")); + else + c->warning(__tr2qs_ctx("Object Pixmap required!", "objects")); return true; } - if (!var1->asInteger(iCol1)) + if(!var1->asInteger(iCol1)) { var1->asString(szColor); - if (c->paramCount()<2) iOpacity=255; + if(c->paramCount() < 2) + iOpacity = 255; else { - if (!var2->asInteger(iOpacity)) + if(!var2->asInteger(iOpacity)) { - c->warning(__tr2qs_ctx("The opacity parameter didn't evaluate to integer","objects")); + c->warning(__tr2qs_ctx("The opacity parameter didn't evaluate to integer", "objects")); return true; } } @@ -967,78 +978,83 @@ KVSO_CLASS_FUNCTION(painter,setBrush) } else { - if(c->paramCount()<3) + if(c->paramCount() < 3) { - c->error(__tr2qs_ctx("Color name or triplet RGB/HSV value required","objects")); + c->error(__tr2qs_ctx("Color name or triplet RGB/HSV value required", "objects")); return true; } - if (!var2->asInteger(iCol2)||!var3->asInteger(iCol3)) + if(!var2->asInteger(iCol2) || !var3->asInteger(iCol3)) { - c->error(__tr2qs_ctx("One of the triplet parameters didn't evaluate to an integer","objects"));\ - return true; + c->error(__tr2qs_ctx("One of the triplet parameters didn't evaluate to an integer", "objects")); + return true; } - if (c->paramCount()<5) iOpacity=255; + if(c->paramCount() < 5) + iOpacity = 255; QColor col; if(KviQString::equalCI(szColorMode, "HSV")) - col.setHsv(iCol1,iCol2,iCol3,iOpacity); + col.setHsv(iCol1, iCol2, iCol3, iOpacity); else - col.setRgb(iCol1,iCol2,iCol3,iOpacity); + col.setRgb(iCol1, iCol2, iCol3, iOpacity); m_pPainter->setBrush(col); - } return true; } -KVSO_CLASS_FUNCTION(painter,pen) +KVSO_CLASS_FUNCTION(painter, pen) { CHECK_INTERNAL_POINTER(m_pPainter) QString szFlags; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("flags",KVS_PT_STRING,KVS_PF_OPTIONAL,szFlags) + KVSO_PARAMETER("flags", KVS_PT_STRING, KVS_PF_OPTIONAL, szFlags) KVSO_PARAMETERS_END(c) - if(szFlags.isEmpty()){ + if(szFlags.isEmpty()) + { c->returnValue()->setString(m_pPainter->pen().color().name()); return true; } - QColor col=m_pPainter->pen().color(); - KviKvsVariant *pRed = new KviKvsVariant((kvs_int_t)col.red()); - KviKvsVariant *pGreen = new KviKvsVariant((kvs_int_t)col.green()); - KviKvsVariant *pBlue = new KviKvsVariant((kvs_int_t)col.blue()); - if (szFlags.indexOf('a',0,Qt::CaseInsensitive) != -1){ - KviKvsArray *pArray = new KviKvsArray(); - pArray->set(0,pRed); - pArray->set(1,pGreen); - pArray->set(2,pBlue); + QColor col = m_pPainter->pen().color(); + KviKvsVariant * pRed = new KviKvsVariant((kvs_int_t)col.red()); + KviKvsVariant * pGreen = new KviKvsVariant((kvs_int_t)col.green()); + KviKvsVariant * pBlue = new KviKvsVariant((kvs_int_t)col.blue()); + if(szFlags.indexOf('a', 0, Qt::CaseInsensitive) != -1) + { + KviKvsArray * pArray = new KviKvsArray(); + pArray->set(0, pRed); + pArray->set(1, pGreen); + pArray->set(2, pBlue); c->returnValue()->setArray(pArray); - } else if (szFlags.indexOf('h',0,Qt::CaseInsensitive) != -1){ - KviKvsHash *pHash = new KviKvsHash(); - pHash->set("red",pRed); - pHash->set("green",pGreen); - pHash->set("blue",pBlue); + } + else if(szFlags.indexOf('h', 0, Qt::CaseInsensitive) != -1) + { + KviKvsHash * pHash = new KviKvsHash(); + pHash->set("red", pRed); + pHash->set("green", pGreen); + pHash->set("blue", pBlue); } return true; } -KVSO_CLASS_FUNCTION(painter,setPen) +KVSO_CLASS_FUNCTION(painter, setPen) { CHECK_INTERNAL_POINTER(m_pPainter) - kvs_int_t iCol1,iCol2,iCol3,iOpacity; - QString szColorMode,szColor; - KviKvsVariant *var1,*var2,*var3; + kvs_int_t iCol1, iCol2, iCol3, iOpacity; + QString szColorMode, szColor; + KviKvsVariant *var1, *var2, *var3; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("Color_1_Or_Colorname",KVS_PT_VARIANT,0,var1) - KVSO_PARAMETER("Color_2",KVS_PT_VARIANT,KVS_PF_OPTIONAL,var2) - KVSO_PARAMETER("Colo3_3",KVS_PT_VARIANT,KVS_PF_OPTIONAL,var3) - KVSO_PARAMETER("color_mode",KVS_PT_STRING,KVS_PF_OPTIONAL,szColorMode) - KVSO_PARAMETER("opacity",KVS_PT_INT,KVS_PF_OPTIONAL,iOpacity) + KVSO_PARAMETER("Color_1_Or_Colorname", KVS_PT_VARIANT, 0, var1) + KVSO_PARAMETER("Color_2", KVS_PT_VARIANT, KVS_PF_OPTIONAL, var2) + KVSO_PARAMETER("Colo3_3", KVS_PT_VARIANT, KVS_PF_OPTIONAL, var3) + KVSO_PARAMETER("color_mode", KVS_PT_STRING, KVS_PF_OPTIONAL, szColorMode) + KVSO_PARAMETER("opacity", KVS_PT_INT, KVS_PF_OPTIONAL, iOpacity) KVSO_PARAMETERS_END(c) - if (!var1->asInteger(iCol1)) + if(!var1->asInteger(iCol1)) { var1->asString(szColor); - if (c->paramCount()<2) iOpacity=255; + if(c->paramCount() < 2) + iOpacity = 255; else { - if (!var2->asInteger(iOpacity)) + if(!var2->asInteger(iOpacity)) { - c->warning(__tr2qs_ctx("The opacity parameter didn't evaluate to integer","objects")); + c->warning(__tr2qs_ctx("The opacity parameter didn't evaluate to integer", "objects")); return true; } } @@ -1048,266 +1064,280 @@ KVSO_CLASS_FUNCTION(painter,setPen) } else { - if(c->paramCount()<3) + if(c->paramCount() < 3) { - c->error(__tr2qs_ctx("Color name or triplet RGB/HSV value required","objects")); + c->error(__tr2qs_ctx("Color name or triplet RGB/HSV value required", "objects")); return true; } - if (!var2->asInteger(iCol2)||!var3->asInteger(iCol3)) + if(!var2->asInteger(iCol2) || !var3->asInteger(iCol3)) { - c->error(__tr2qs_ctx("One of the triplet parameters didn't evaluate to an integer","objects"));\ - return true; + c->error(__tr2qs_ctx("One of the triplet parameters didn't evaluate to an integer", "objects")); + return true; } - if (c->paramCount()<5) iOpacity=255; + if(c->paramCount() < 5) + iOpacity = 255; QColor col; if(KviQString::equalCI(szColorMode, "HSV")) - col.setHsv(iCol1,iCol2,iCol3,iOpacity); + col.setHsv(iCol1, iCol2, iCol3, iOpacity); else - col.setRgb(iCol1,iCol2,iCol3,iOpacity); + col.setRgb(iCol1, iCol2, iCol3, iOpacity); m_pPainter->setPen(col); - } return true; } -KVSO_CLASS_FUNCTION(painter,drawPie) +KVSO_CLASS_FUNCTION(painter, drawPie) { CHECK_INTERNAL_POINTER(m_pPainter) KviKvsVariant * pXOrArray; - kvs_int_t iSangle,iLena,iX,iY,iW,iH; + kvs_int_t iSangle, iLena, iX, iY, iW, iH; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("start_angle",KVS_PT_INT,0,iSangle) - KVSO_PARAMETER("a_lenght",KVS_PT_INT,0,iLena) - KVSO_PARAMETER("x_or_array",KVS_PT_VARIANT,0,pXOrArray) - KVSO_PARAMETER("y",KVS_PT_INT,KVS_PF_OPTIONAL,iY) - KVSO_PARAMETER("w",KVS_PT_INT,KVS_PF_OPTIONAL,iW) - KVSO_PARAMETER("h",KVS_PT_INT,KVS_PF_OPTIONAL,iH) + KVSO_PARAMETER("start_angle", KVS_PT_INT, 0, iSangle) + KVSO_PARAMETER("a_lenght", KVS_PT_INT, 0, iLena) + KVSO_PARAMETER("x_or_array", KVS_PT_VARIANT, 0, pXOrArray) + KVSO_PARAMETER("y", KVS_PT_INT, KVS_PF_OPTIONAL, iY) + KVSO_PARAMETER("w", KVS_PT_INT, KVS_PF_OPTIONAL, iW) + KVSO_PARAMETER("h", KVS_PT_INT, KVS_PF_OPTIONAL, iH) KVSO_PARAMETERS_END(c) - QString function="$drawPie"; - KVSO_PARAMETERS_PAINTER(pXOrArray,iY,iW,iH) - m_pPainter->drawPie(iX,iY,iW,iH,iSangle,iLena); + QString function = "$drawPie"; + KVSO_PARAMETERS_PAINTER(pXOrArray, iY, iW, iH) + m_pPainter->drawPie(iX, iY, iW, iH, iSangle, iLena); return true; } -KVSO_CLASS_FUNCTION(painter,drawPoint) +KVSO_CLASS_FUNCTION(painter, drawPoint) { CHECK_INTERNAL_POINTER(m_pPainter) KviKvsVariant * pXOrArray; - kvs_int_t iX,iY; + kvs_int_t iX, iY; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("x_or_array",KVS_PT_VARIANT,0,pXOrArray) - KVSO_PARAMETER("y",KVS_PT_INT,KVS_PF_OPTIONAL,iY) + KVSO_PARAMETER("x_or_array", KVS_PT_VARIANT, 0, pXOrArray) + KVSO_PARAMETER("y", KVS_PT_INT, KVS_PF_OPTIONAL, iY) KVSO_PARAMETERS_END(c) - QString function="$drawPoint"; - KVSO_2ARRAYPARAMETERS(pXOrArray,iY) - m_pPainter->drawPoint(iX,iY); + QString function = "$drawPoint"; + KVSO_2ARRAYPARAMETERS(pXOrArray, iY) + m_pPainter->drawPoint(iX, iY); return true; } -KVSO_CLASS_FUNCTION(painter,fontDescent) +KVSO_CLASS_FUNCTION(painter, fontDescent) { CHECK_INTERNAL_POINTER(m_pPainter) c->returnValue()->setInteger(m_pPainter->fontMetrics().descent()); return true; } -KVSO_CLASS_FUNCTION(painter,fontAscent) +KVSO_CLASS_FUNCTION(painter, fontAscent) { CHECK_INTERNAL_POINTER(m_pPainter) c->returnValue()->setInteger(m_pPainter->fontMetrics().ascent()); return true; - } -KVSO_CLASS_FUNCTION(painter,fontMetricsWidth) +KVSO_CLASS_FUNCTION(painter, fontMetricsWidth) { CHECK_INTERNAL_POINTER(m_pPainter) QString szText; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("text",KVS_PT_STRING,0,szText) + KVSO_PARAMETER("text", KVS_PT_STRING, 0, szText) KVSO_PARAMETERS_END(c) - if (m_pPainter->isActive()) + if(m_pPainter->isActive()) c->returnValue()->setInteger(m_pPainter->fontMetrics().width(szText)); else - c->warning(__tr2qs_ctx("$fontMetricsWidth: the painter is not active!","objects")); + c->warning(__tr2qs_ctx("$fontMetricsWidth: the painter is not active!", "objects")); return true; } -KVSO_CLASS_FUNCTION(painter,fontMetricsHeight) +KVSO_CLASS_FUNCTION(painter, fontMetricsHeight) { CHECK_INTERNAL_POINTER(m_pPainter) - if (m_pPainter->isActive()) + if(m_pPainter->isActive()) c->returnValue()->setInteger(m_pPainter->fontMetrics().height()); else - c->warning(__tr2qs_ctx("$fontMetricsHeight: the painter is not active!","objects")); + c->warning(__tr2qs_ctx("$fontMetricsHeight: the painter is not active!", "objects")); return true; } -KVSO_CLASS_FUNCTION(painter,begin) +KVSO_CLASS_FUNCTION(painter, begin) { CHECK_INTERNAL_POINTER(m_pPainter) KviKvsObject * pObject; kvs_hobject_t hObject; - KviKvsVariant *v; + KviKvsVariant * v; QString szFileName; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("paint_device",KVS_PT_VARIANT,0,v) - KVSO_PARAMETER("file_name",KVS_PT_STRING,KVS_PF_OPTIONAL,szFileName) + KVSO_PARAMETER("paint_device", KVS_PT_VARIANT, 0, v) + KVSO_PARAMETER("file_name", KVS_PT_STRING, KVS_PF_OPTIONAL, szFileName) KVSO_PARAMETERS_END(c) QPaintDevice * pd; if(v->isString()) { QString szDev; v->asString(szDev); - if(KviQString::equalCI(szDev,"printer") || KviQString::equalCI(szDev,"pdf")) + if(KviQString::equalCI(szDev, "printer") || KviQString::equalCI(szDev, "pdf")) { - if (m_pPrinter) delete m_pPrinter; - m_pPrinter=new QPrinter(); - if ( KviQString::equalCI(szDev,"pdf")) + if(m_pPrinter) + delete m_pPrinter; + m_pPrinter = new QPrinter(); + if(KviQString::equalCI(szDev, "pdf")) { //m_pPrinter=new QPrinter(); if(szFileName.isEmpty()) { - c->warning(__tr2qs_ctx("Missing filename","objects")); + c->warning(__tr2qs_ctx("Missing filename", "objects")); return true; } m_pPrinter->setOutputFormat(QPrinter::PdfFormat); m_pPrinter->setOutputFileName(szFileName); - } else { + } + else + { QPrintDialog printDialog(m_pPrinter, 0); - if (printDialog.exec() == QDialog::Accepted) + if(printDialog.exec() == QDialog::Accepted) { - qDebug("papersize %d",m_pPrinter->paperSize()); + qDebug("papersize %d", m_pPrinter->paperSize()); m_pPainter->begin(m_pPrinter); return true; - } else { - m_pPrinter=0; + } + else + { + m_pPrinter = 0; return true; } } //if (i==3) m_pPrinter->setPaperSize(QPrinter::A3); //if (i==4) m_pPrinter->setPaperSize(QPrinter::A4); - } else { - c->warning(__tr2qs_ctx("No valid paint device","objects")); - return true; + } + else + { + c->warning(__tr2qs_ctx("No valid paint device", "objects")); + return true; } m_pPainter->begin(m_pPrinter); return true; - } else if (v->isHObject()) { + } + else if(v->isHObject()) + { v->asHObject(hObject); - pObject=KviKvsKernel::instance()->objectController()->lookupObject(hObject); - if (!pObject) + pObject = KviKvsKernel::instance()->objectController()->lookupObject(hObject); + if(!pObject) { - c->warning(__tr2qs_ctx("Pixmap or Widget parameter is not an object","objects")); + c->warning(__tr2qs_ctx("Pixmap or Widget parameter is not an object", "objects")); return true; } if(pObject->inheritsClass("pixmap")) - pd=((KvsObject_pixmap *)pObject)->getImage(); - else if (pObject->inheritsClass("widget")) - pd=((KvsObject_widget *)pObject)->widget(); + pd = ((KvsObject_pixmap *)pObject)->getImage(); + else if(pObject->inheritsClass("widget")) + pd = ((KvsObject_widget *)pObject)->widget(); else { - c->warning(__tr2qs_ctx("Widget or pixmap required ","objects")); + c->warning(__tr2qs_ctx("Widget or pixmap required ", "objects")); return true; } - } else { - c->warning(__tr2qs_ctx("No valid paint device","objects")); + } + else + { + c->warning(__tr2qs_ctx("No valid paint device", "objects")); return true; } - attachDevice(pObject,pd); + attachDevice(pObject, pd); //if (pObject->inheritsClass("pixmap")) ((KvsObject_pixmap *)pObject)->pixmapChanged(); return true; } -void KvsObject_painter::attachDevice(KviKvsObject * o,QPaintDevice * p) +void KvsObject_painter::attachDevice(KviKvsObject * o, QPaintDevice * p) { - if(m_pDeviceObject)detachDevice(); + if(m_pDeviceObject) + detachDevice(); m_pDeviceObject = o; // KvsObject_pixmap and KvsObject_widget object have this signal // it is emitted BEFORE the real QPaintDevice is deleted, so we can eventually // call m_pPainter->end() in time - QObject::connect(m_pDeviceObject,SIGNAL(aboutToDie()),this,SLOT(detachDevice())); + QObject::connect(m_pDeviceObject, SIGNAL(aboutToDie()), this, SLOT(detachDevice())); m_pPainter->begin(p); } void KvsObject_painter::detachDevice() { - if(!m_pDeviceObject)return; - disconnect(m_pDeviceObject,SIGNAL(aboutToDie()),this,SLOT(detachDevice())); + if(!m_pDeviceObject) + return; + disconnect(m_pDeviceObject, SIGNAL(aboutToDie()), this, SLOT(detachDevice())); m_pPainter->end(); - if (m_pPrinter) + if(m_pPrinter) { delete m_pPrinter; - m_pPrinter=0; + m_pPrinter = 0; } m_pDeviceObject = 0; } -KVSO_CLASS_FUNCTION(painter,end) +KVSO_CLASS_FUNCTION(painter, end) { Q_UNUSED(c); if(!m_pDeviceObject) { m_pPainter->end(); - if (m_pPrinter) + if(m_pPrinter) { delete m_pPrinter; - m_pPrinter=0; + m_pPrinter = 0; } } - else detachDevice(); + else + detachDevice(); return true; } -KVSO_CLASS_FUNCTION(painter,beginPdf) +KVSO_CLASS_FUNCTION(painter, beginPdf) { CHECK_INTERNAL_POINTER(m_pPainter) QString szFileName; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("file_name",KVS_PT_STRING,0,szFileName) + KVSO_PARAMETER("file_name", KVS_PT_STRING, 0, szFileName) KVSO_PARAMETERS_END(c) - if (m_pPrinter) delete m_pPrinter; - m_pPrinter=new QPrinter();//QPrinter::HighResolution); + if(m_pPrinter) + delete m_pPrinter; + m_pPrinter = new QPrinter(); //QPrinter::HighResolution); m_pPrinter->setOutputFormat(QPrinter::PdfFormat); m_pPrinter->setOutputFileName(szFileName); m_pPainter->begin(m_pPrinter); return true; } -KVSO_CLASS_FUNCTION(painter,drawText) +KVSO_CLASS_FUNCTION(painter, drawText) { CHECK_INTERNAL_POINTER(m_pPainter) QString szText; QStringList szAlignList; - kvs_int_t iX,iY,iW,iH; //,iN=-1; + kvs_int_t iX, iY, iW, iH; //,iN=-1; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("x",KVS_PT_INT,0,iX) - KVSO_PARAMETER("y",KVS_PT_INT,0,iY) - KVSO_PARAMETER("w",KVS_PT_INT,0,iW) - KVSO_PARAMETER("h",KVS_PT_INT,0,iH) - KVSO_PARAMETER("text",KVS_PT_STRING,0,szText) - KVSO_PARAMETER("align",KVS_PT_STRINGLIST,KVS_PF_OPTIONAL,szAlignList) + KVSO_PARAMETER("x", KVS_PT_INT, 0, iX) + KVSO_PARAMETER("y", KVS_PT_INT, 0, iY) + KVSO_PARAMETER("w", KVS_PT_INT, 0, iW) + KVSO_PARAMETER("h", KVS_PT_INT, 0, iH) + KVSO_PARAMETER("text", KVS_PT_STRING, 0, szText) + KVSO_PARAMETER("align", KVS_PT_STRINGLIST, KVS_PF_OPTIONAL, szAlignList) KVSO_PARAMETERS_END(c) - int align,sum=0; + int align, sum = 0; if(szAlignList.count()) { - for ( QStringList::Iterator it = szAlignList.begin(); it != szAlignList.end(); ++it ) + for(QStringList::Iterator it = szAlignList.begin(); it != szAlignList.end(); ++it) { align = 0; for(unsigned int j = 0; j < align_num; j++) { if(KviQString::equalCI((*it), align_tbl[j])) { - align=align_cod[j]; + align = align_cod[j]; break; } } if(align) sum = sum | align; else - c->warning(__tr2qs_ctx("Unknown alignment '%Q'","objects"),&(*it)); + c->warning(__tr2qs_ctx("Unknown alignment '%Q'", "objects"), &(*it)); } } QRect rect; @@ -1315,742 +1345,773 @@ KVSO_CLASS_FUNCTION(painter,drawText) rect.setY(iY); rect.setWidth(iW); rect.setHeight(iH); - if(szAlignList.count()){ - m_pPainter->drawText(rect,sum,szText); + if(szAlignList.count()) + { + m_pPainter->drawText(rect, sum, szText); } - else m_pPainter->drawText(rect,szText); + else + m_pPainter->drawText(rect, szText); return true; } -KVSO_CLASS_FUNCTION(painter,drawPixmap) +KVSO_CLASS_FUNCTION(painter, drawPixmap) { CHECK_INTERNAL_POINTER(m_pPainter) - kvs_real_t iX,iY,iWidth,iHeight,iStartx,iStarty; + kvs_real_t iX, iY, iWidth, iHeight, iStartx, iStarty; bool bTiled; - KviKvsObject *obj; + KviKvsObject * obj; kvs_hobject_t hObject; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("x",KVS_PT_REAL,0,iX) - KVSO_PARAMETER("y",KVS_PT_REAL,0,iY) - KVSO_PARAMETER("pixmap",KVS_PT_HOBJECT,0,hObject) - KVSO_PARAMETER("start_x",KVS_PT_REAL,0,iStartx) - KVSO_PARAMETER("start_y",KVS_PT_REAL,0,iStarty) - KVSO_PARAMETER("end_x",KVS_PT_REAL,0,iWidth) - KVSO_PARAMETER("end_y",KVS_PT_REAL,0,iHeight) - KVSO_PARAMETER("b_Tiled",KVS_PT_BOOLEAN,KVS_PF_OPTIONAL,bTiled) + KVSO_PARAMETER("x", KVS_PT_REAL, 0, iX) + KVSO_PARAMETER("y", KVS_PT_REAL, 0, iY) + KVSO_PARAMETER("pixmap", KVS_PT_HOBJECT, 0, hObject) + KVSO_PARAMETER("start_x", KVS_PT_REAL, 0, iStartx) + KVSO_PARAMETER("start_y", KVS_PT_REAL, 0, iStarty) + KVSO_PARAMETER("end_x", KVS_PT_REAL, 0, iWidth) + KVSO_PARAMETER("end_y", KVS_PT_REAL, 0, iHeight) + KVSO_PARAMETER("b_Tiled", KVS_PT_BOOLEAN, KVS_PF_OPTIONAL, bTiled) KVSO_PARAMETERS_END(c) - obj=KviKvsKernel::instance()->objectController()->lookupObject(hObject); - if (!obj) + obj = KviKvsKernel::instance()->objectController()->lookupObject(hObject); + if(!obj) { - c->warning(__tr2qs_ctx("Pixmap parameter is not an object","objects")); + c->warning(__tr2qs_ctx("Pixmap parameter is not an object", "objects")); return true; } - if (!obj->inheritsClass("pixmap")) + if(!obj->inheritsClass("pixmap")) { - c->warning(__tr2qs_ctx("Pixmap object required","objects")); + c->warning(__tr2qs_ctx("Pixmap object required", "objects")); return true; } - if(bTiled){ - QPixmap *pPixmap=((KvsObject_pixmap *)obj)->getPixmap(); + if(bTiled) + { + QPixmap * pPixmap = ((KvsObject_pixmap *)obj)->getPixmap(); //QPoint point(iX,iY); //QRectF rectf(QPointF(iStartx,iStarty),QSizeF(iWidth,iHeight)); //m_pPainter->drawTiledPixmap(rectf,*pPixmap,pointf); //m_pPainter->drawTiledPixmap((int)iX,(int)iY,(int)iWidth,(int)iHeight,*pPixmap,(int)iStartx,(int)iStarty); - qDebug("drawing at x %i - y %i - w %i - h %i - startpx %i - startpy %i casted",(int)iX,(int)iY,(int)iWidth,(int)iHeight,(int)iStartx,(int)iStarty); - m_pPainter->drawTiledPixmap(iX,iY,iWidth,iHeight,*pPixmap,iStartx,iStarty); + qDebug("drawing at x %i - y %i - w %i - h %i - startpx %i - startpy %i casted", (int)iX, (int)iY, (int)iWidth, (int)iHeight, (int)iStartx, (int)iStarty); + m_pPainter->drawTiledPixmap(iX, iY, iWidth, iHeight, *pPixmap, iStartx, iStarty); } - else{ - QImage *pImage=((KvsObject_pixmap *)obj)->getImage(); - QPoint pointf(iX,iY); - QRectF rectf(QPointF(iStartx,iStarty),QSizeF(iWidth,iHeight)); - m_pPainter->drawImage(pointf,*pImage,rectf); + else + { + QImage * pImage = ((KvsObject_pixmap *)obj)->getImage(); + QPoint pointf(iX, iY); + QRectF rectf(QPointF(iStartx, iStarty), QSizeF(iWidth, iHeight)); + m_pPainter->drawImage(pointf, *pImage, rectf); } return true; } -KVSO_CLASS_FUNCTION(painter,drawPixmapWithColorEffect) +KVSO_CLASS_FUNCTION(painter, drawPixmapWithColorEffect) { CHECK_INTERNAL_POINTER(m_pPainter) QString szEffect; - kvs_real_t rX,rY; - kvs_int_t r,g,b,iX,iY,iW,iH; - KviKvsObject *obj; + kvs_real_t rX, rY; + kvs_int_t r, g, b, iX, iY, iW, iH; + KviKvsObject * obj; kvs_hobject_t hObject; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("string_effect",KVS_PT_STRING,0,szEffect) - KVSO_PARAMETER("x",KVS_PT_REAL,0,rX) - KVSO_PARAMETER("y",KVS_PT_REAL,0,rY) - KVSO_PARAMETER("pixmap",KVS_PT_HOBJECT,0,hObject) - KVSO_PARAMETER("red",KVS_PT_INT,KVS_PF_OPTIONAL,r) - KVSO_PARAMETER("green",KVS_PT_INT,KVS_PF_OPTIONAL,g) - KVSO_PARAMETER("blue",KVS_PT_INT,KVS_PF_OPTIONAL,b) - KVSO_PARAMETER("start_x",KVS_PT_INT,KVS_PF_OPTIONAL,iX) - KVSO_PARAMETER("start_y",KVS_PT_INT,KVS_PF_OPTIONAL,iY) - KVSO_PARAMETER("width",KVS_PT_INT,KVS_PF_OPTIONAL,iW) - KVSO_PARAMETER("height",KVS_PT_INT,KVS_PF_OPTIONAL,iH) + KVSO_PARAMETER("string_effect", KVS_PT_STRING, 0, szEffect) + KVSO_PARAMETER("x", KVS_PT_REAL, 0, rX) + KVSO_PARAMETER("y", KVS_PT_REAL, 0, rY) + KVSO_PARAMETER("pixmap", KVS_PT_HOBJECT, 0, hObject) + KVSO_PARAMETER("red", KVS_PT_INT, KVS_PF_OPTIONAL, r) + KVSO_PARAMETER("green", KVS_PT_INT, KVS_PF_OPTIONAL, g) + KVSO_PARAMETER("blue", KVS_PT_INT, KVS_PF_OPTIONAL, b) + KVSO_PARAMETER("start_x", KVS_PT_INT, KVS_PF_OPTIONAL, iX) + KVSO_PARAMETER("start_y", KVS_PT_INT, KVS_PF_OPTIONAL, iY) + KVSO_PARAMETER("width", KVS_PT_INT, KVS_PF_OPTIONAL, iW) + KVSO_PARAMETER("height", KVS_PT_INT, KVS_PF_OPTIONAL, iH) KVSO_PARAMETERS_END(c) - obj=KviKvsKernel::instance()->objectController()->lookupObject(hObject); - if (!obj) + obj = KviKvsKernel::instance()->objectController()->lookupObject(hObject); + if(!obj) { - c->warning(__tr2qs_ctx("Pixmap parameter is not an object","objects")); + c->warning(__tr2qs_ctx("Pixmap parameter is not an object", "objects")); return true; } - if (!obj->inheritsClass("pixmap")) + if(!obj->inheritsClass("pixmap")) { - c->warning(__tr2qs_ctx("Pixmap object required","objects")); + c->warning(__tr2qs_ctx("Pixmap object required", "objects")); return true; } - QImage *pImage=((KvsObject_pixmap *)obj)->getImage(); + QImage * pImage = ((KvsObject_pixmap *)obj)->getImage(); //QImage pDest(pImage->width(),pImage->height(),QImage::Format_ARGB32); - QRgb col ; - QRgb *dataSource; - QRgb *dataDest; - int w=pImage->width(); - int h=pImage->height(); - if(!iW) iW=w; - if(!iH) iH=h; - QImage pDest(iW,iH,QImage::Format_ARGB32); - - int iXend=iX+iW; - int iYend=iY+iH; - - if(KviQString::equalCI(szEffect,"addrgb")) + QRgb col; + QRgb * dataSource; + QRgb * dataDest; + int w = pImage->width(); + int h = pImage->height(); + if(!iW) + iW = w; + if(!iH) + iH = h; + QImage pDest(iW, iH, QImage::Format_ARGB32); + + int iXend = iX + iW; + int iYend = iY + iH; + + if(KviQString::equalCI(szEffect, "addrgb")) { - int sumR, sumG, sumB,idx=0; - for(int y=iY; yscanLine(y)+iX; - dataDest = (QRgb *) pDest.scanLine(idx); - idx++; - for (int x=iX; xscanLine(y) + iX; + dataDest = (QRgb *)pDest.scanLine(idx); + idx++; + for(int x = iX; x < iXend; x++) + { + col = *dataSource; + sumR = qRed(col) + r; + sumG = qGreen(col) + g; + sumB = qBlue(col) + b; + *dataDest++ = qRgba(sumR < 255 ? sumR : 255, + sumG < 255 ? sumG : 255, + sumB < 255 ? sumB : 255, + qAlpha(col)); + dataSource++; + } + } } - else if(KviQString::equalCI(szEffect,"subrgb")) + else if(KviQString::equalCI(szEffect, "subrgb")) { - int subR, subG, subB,idx=0; - for(int y=iY; yscanLine(y)+iX; - dataDest = (QRgb *) pDest.scanLine(idx); - idx++; - for (int x=iX; x0 ? subR : 0, - subG>0 ? subG : 0, - subB>0 ? subB : 0, - qAlpha(col)); - dataSource++; - } - } + int subR, subG, subB, idx = 0; + for(int y = iY; y < iYend; y++) + { + dataSource = (QRgb *)pImage->scanLine(y) + iX; + dataDest = (QRgb *)pDest.scanLine(idx); + idx++; + for(int x = iX; x < iXend; x++) + { + col = *dataSource; + subR = qRed(col) - r; + subG = qGreen(col) - g; + subB = qBlue(col) - b; + *dataDest++ = qRgba(subR > 0 ? subR : 0, + subG > 0 ? subG : 0, + subB > 0 ? subB : 0, + qAlpha(col)); + dataSource++; + } + } } - else if(KviQString::equalCI(szEffect,"grayscale")) + else if(KviQString::equalCI(szEffect, "grayscale")) { QRgb col; - int res,idx=0; - for(int y=iY; yscanLine(y)+iX; - dataDest = (QRgb *) pDest.scanLine(idx); - for (int x=iX; xscanLine(y) + iX; + dataDest = (QRgb *)pDest.scanLine(idx); + for(int x = iX; x < iXend; x++) { col = *dataSource; - res = (qRed(col)+qGreen(col)+qBlue(col))/3; - *dataDest++ = qRgba(res, res, res,qAlpha(col)); + res = (qRed(col) + qGreen(col) + qBlue(col)) / 3; + *dataDest++ = qRgba(res, res, res, qAlpha(col)); dataSource++; } idx++; } } - m_pPainter->drawImage(QPointF(rX,rY),pDest); + m_pPainter->drawImage(QPointF(rX, rY), pDest); return true; } -KVSO_CLASS_FUNCTION(painter,drawPixmapMirrored) +KVSO_CLASS_FUNCTION(painter, drawPixmapMirrored) { CHECK_INTERNAL_POINTER(m_pPainter) - bool bHorizontal,bVertical; - kvs_int_t iX,iY,iW,iH; - KviKvsObject *obj; + bool bHorizontal, bVertical; + kvs_int_t iX, iY, iW, iH; + KviKvsObject * obj; kvs_hobject_t hObject; - kvs_real_t rX,rY; + kvs_real_t rX, rY; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("x",KVS_PT_REAL,0,rX) - KVSO_PARAMETER("y",KVS_PT_REAL,0,rY) - KVSO_PARAMETER("pixmap",KVS_PT_HOBJECT,0,hObject) - KVSO_PARAMETER("bHorizontal",KVS_PT_BOOLEAN,0,bHorizontal) - KVSO_PARAMETER("bVertical",KVS_PT_BOOLEAN,0,bVertical) - KVSO_PARAMETER("start_x",KVS_PT_INT,KVS_PF_OPTIONAL,iX) - KVSO_PARAMETER("start_y",KVS_PT_INT,KVS_PF_OPTIONAL,iY) - KVSO_PARAMETER("width",KVS_PT_INT,KVS_PF_OPTIONAL,iW) - KVSO_PARAMETER("height",KVS_PT_INT,KVS_PF_OPTIONAL,iH) + KVSO_PARAMETER("x", KVS_PT_REAL, 0, rX) + KVSO_PARAMETER("y", KVS_PT_REAL, 0, rY) + KVSO_PARAMETER("pixmap", KVS_PT_HOBJECT, 0, hObject) + KVSO_PARAMETER("bHorizontal", KVS_PT_BOOLEAN, 0, bHorizontal) + KVSO_PARAMETER("bVertical", KVS_PT_BOOLEAN, 0, bVertical) + KVSO_PARAMETER("start_x", KVS_PT_INT, KVS_PF_OPTIONAL, iX) + KVSO_PARAMETER("start_y", KVS_PT_INT, KVS_PF_OPTIONAL, iY) + KVSO_PARAMETER("width", KVS_PT_INT, KVS_PF_OPTIONAL, iW) + KVSO_PARAMETER("height", KVS_PT_INT, KVS_PF_OPTIONAL, iH) KVSO_PARAMETERS_END(c) - obj=KviKvsKernel::instance()->objectController()->lookupObject(hObject); - if (!obj) + obj = KviKvsKernel::instance()->objectController()->lookupObject(hObject); + if(!obj) { - c->warning(__tr2qs_ctx("Pixmap parameter is not an object","objects")); + c->warning(__tr2qs_ctx("Pixmap parameter is not an object", "objects")); return true; } - if (!obj->inheritsClass("pixmap")) + if(!obj->inheritsClass("pixmap")) { - c->warning(__tr2qs_ctx("Pixmap object required","objects")); + c->warning(__tr2qs_ctx("Pixmap object required", "objects")); return true; } - QImage *pImage=((KvsObject_pixmap *)obj)->getImage(); - QPoint sourceXY(0,0); - if(c->parameterCount()>=5) + QImage * pImage = ((KvsObject_pixmap *)obj)->getImage(); + QPoint sourceXY(0, 0); + if(c->parameterCount() >= 5) { - sourceXY.setX(iX); - sourceXY.setY(iY); + sourceXY.setX(iX); + sourceXY.setY(iY); } - QSize sourceWH(pImage->width(),pImage->height()); - if(c->parameterCount()>=5) + QSize sourceWH(pImage->width(), pImage->height()); + if(c->parameterCount() >= 5) { - sourceWH.setWidth(iW); - sourceWH.setHeight(iH); + sourceWH.setWidth(iW); + sourceWH.setHeight(iH); } - QImage mirrored = pImage->mirrored(bHorizontal,bVertical); - m_pPainter->drawImage(rX,rY,mirrored, sourceXY.x(), sourceXY.y(),sourceWH.width(),sourceWH.height()); + QImage mirrored = pImage->mirrored(bHorizontal, bVertical); + m_pPainter->drawImage(rX, rY, mirrored, sourceXY.x(), sourceXY.y(), sourceWH.width(), sourceWH.height()); return true; } -KVSO_CLASS_FUNCTION(painter,rotate) +KVSO_CLASS_FUNCTION(painter, rotate) { CHECK_INTERNAL_POINTER(m_pPainter) kvs_real_t dAngle; QString szAxis; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("angle",KVS_PT_DOUBLE,0,dAngle) - KVSO_PARAMETER("axis",KVS_PT_STRING,KVS_PF_OPTIONAL,szAxis) + KVSO_PARAMETER("angle", KVS_PT_DOUBLE, 0, dAngle) + KVSO_PARAMETER("axis", KVS_PT_STRING, KVS_PF_OPTIONAL, szAxis) KVSO_PARAMETERS_END(c) Qt::Axis axis = Qt::ZAxis; if(!szAxis.isEmpty()) { - if (KviQString::equalCI(szAxis,"XAxis"))axis=Qt::XAxis; - else if (KviQString::equalCI(szAxis,"YAxis")) axis=Qt::YAxis; - else if (KviQString::equalCI(szAxis,"ZAxis")) axis=Qt::ZAxis; - else c->warning(__tr2qs_ctx("Unknown axis '%Q' switching to default ZAxis","objects"),&szAxis); + if(KviQString::equalCI(szAxis, "XAxis")) + axis = Qt::XAxis; + else if(KviQString::equalCI(szAxis, "YAxis")) + axis = Qt::YAxis; + else if(KviQString::equalCI(szAxis, "ZAxis")) + axis = Qt::ZAxis; + else + c->warning(__tr2qs_ctx("Unknown axis '%Q' switching to default ZAxis", "objects"), &szAxis); } - PAINTER_ROTATE(dAngle,axis) + PAINTER_ROTATE(dAngle, axis) return true; } -KVSO_CLASS_FUNCTION(painter,translate) +KVSO_CLASS_FUNCTION(painter, translate) { CHECK_INTERNAL_POINTER(m_pPainter) - kvs_real_t dXtrasl,dYtrasl; + kvs_real_t dXtrasl, dYtrasl; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("trasl_x",KVS_PT_DOUBLE,0,dXtrasl) - KVSO_PARAMETER("trasl_y",KVS_PT_DOUBLE,0,dYtrasl) + KVSO_PARAMETER("trasl_x", KVS_PT_DOUBLE, 0, dXtrasl) + KVSO_PARAMETER("trasl_y", KVS_PT_DOUBLE, 0, dYtrasl) KVSO_PARAMETERS_END(c) - PAINTER_TRANSLATE(dXtrasl,dYtrasl) + PAINTER_TRANSLATE(dXtrasl, dYtrasl) return true; } -KVSO_CLASS_FUNCTION(painter,shear) +KVSO_CLASS_FUNCTION(painter, shear) { CHECK_INTERNAL_POINTER(m_pPainter) - kvs_real_t dShearh,dShearv; + kvs_real_t dShearh, dShearv; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("shear_h",KVS_PT_DOUBLE,0,dShearh) - KVSO_PARAMETER("shear_v",KVS_PT_DOUBLE,0,dShearv) + KVSO_PARAMETER("shear_h", KVS_PT_DOUBLE, 0, dShearh) + KVSO_PARAMETER("shear_v", KVS_PT_DOUBLE, 0, dShearv) KVSO_PARAMETERS_END(c) - PAINTER_SHEAR(dShearh,dShearv); + PAINTER_SHEAR(dShearh, dShearv); return true; } -KVSO_CLASS_FUNCTION(painter,scale) +KVSO_CLASS_FUNCTION(painter, scale) { CHECK_INTERNAL_POINTER(m_pPainter) - kvs_real_t dScalex,dScaley; + kvs_real_t dScalex, dScaley; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("scale_x",KVS_PT_DOUBLE,0,dScalex) - KVSO_PARAMETER("scale_y",KVS_PT_DOUBLE,0,dScaley) + KVSO_PARAMETER("scale_x", KVS_PT_DOUBLE, 0, dScalex) + KVSO_PARAMETER("scale_y", KVS_PT_DOUBLE, 0, dScaley) KVSO_PARAMETERS_END(c) - PAINTER_SCALE(dScalex,dScaley); + PAINTER_SCALE(dScalex, dScaley); return true; } -KVSO_CLASS_FUNCTION(painter,reset) +KVSO_CLASS_FUNCTION(painter, reset) { CHECK_INTERNAL_POINTER(m_pPainter) m_pPainter->resetTransform(); return true; } -KVSO_CLASS_FUNCTION(painter,drawHtmlText) +KVSO_CLASS_FUNCTION(painter, drawHtmlText) { CHECK_INTERNAL_POINTER(m_pPainter) QString szText; - kvs_int_t iX,iY,iW,iH; + kvs_int_t iX, iY, iW, iH; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("x",KVS_PT_INT,0,iX) - KVSO_PARAMETER("y",KVS_PT_INT,0,iY) - KVSO_PARAMETER("text",KVS_PT_STRING,0,szText) - KVSO_PARAMETER("w",KVS_PT_INT,0,iW) - KVSO_PARAMETER("h",KVS_PT_INT,0,iH) + KVSO_PARAMETER("x", KVS_PT_INT, 0, iX) + KVSO_PARAMETER("y", KVS_PT_INT, 0, iY) + KVSO_PARAMETER("text", KVS_PT_STRING, 0, szText) + KVSO_PARAMETER("w", KVS_PT_INT, 0, iW) + KVSO_PARAMETER("h", KVS_PT_INT, 0, iH) KVSO_PARAMETERS_END(c) QTextDocument doc; doc.setHtml(szText); doc.setDefaultFont(m_pPainter->font()); m_pPainter->save(); - m_pPainter->translate(iX,iY); - doc.setPageSize(QSize(iW,iH)); + m_pPainter->translate(iX, iY); + doc.setPageSize(QSize(iW, iH)); doc.drawContents(m_pPainter); m_pPainter->restore(); return true; } -KVSO_CLASS_FUNCTION(painter,htmlTextSize) +KVSO_CLASS_FUNCTION(painter, htmlTextSize) { CHECK_INTERNAL_POINTER(m_pPainter) QString szText; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("text",KVS_PT_STRING,0,szText) + KVSO_PARAMETER("text", KVS_PT_STRING, 0, szText) KVSO_PARAMETERS_END(c) QTextDocument doc; doc.setHtml(szText); doc.setDefaultFont(m_pPainter->font()); - QSizeF size=doc.size(); + QSizeF size = doc.size(); KviKvsArray * a = new KviKvsArray(); - a->set(0,new KviKvsVariant((kvs_real_t)size.width())); - a->set(1,new KviKvsVariant((kvs_real_t)size.height())); + a->set(0, new KviKvsVariant((kvs_real_t)size.width())); + a->set(1, new KviKvsVariant((kvs_real_t)size.height())); c->returnValue()->setArray(a); return true; } -KVSO_CLASS_FUNCTION(painter,drawIcon) +KVSO_CLASS_FUNCTION(painter, drawIcon) { CHECK_INTERNAL_POINTER(m_pPainter) - QString szIcon,szState; - kvs_int_t iX,iY,iW,iH; + QString szIcon, szState; + kvs_int_t iX, iY, iW, iH; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("x",KVS_PT_INT,0,iX) - KVSO_PARAMETER("y",KVS_PT_INT,0,iY) - KVSO_PARAMETER("icon",KVS_PT_STRING,0,szIcon) - KVSO_PARAMETER("state",KVS_PT_STRING,KVS_PF_OPTIONAL,szState) - KVSO_PARAMETER("w",KVS_PT_INT,KVS_PF_OPTIONAL,iW) - KVSO_PARAMETER("h",KVS_PT_INT,KVS_PF_OPTIONAL,iH) + KVSO_PARAMETER("x", KVS_PT_INT, 0, iX) + KVSO_PARAMETER("y", KVS_PT_INT, 0, iY) + KVSO_PARAMETER("icon", KVS_PT_STRING, 0, szIcon) + KVSO_PARAMETER("state", KVS_PT_STRING, KVS_PF_OPTIONAL, szState) + KVSO_PARAMETER("w", KVS_PT_INT, KVS_PF_OPTIONAL, iW) + KVSO_PARAMETER("h", KVS_PT_INT, KVS_PF_OPTIONAL, iH) KVSO_PARAMETERS_END(c) - QPixmap *pix=g_pIconManager->getImage(szIcon); - if (!pix) + QPixmap * pix = g_pIconManager->getImage(szIcon); + if(!pix) { - c->warning("The icon '%Q' does not exist",&szIcon); + c->warning("The icon '%Q' does not exist", &szIcon); return true; } - QSize pixsize(pix->width(),pix->height()); + QSize pixsize(pix->width(), pix->height()); QIcon ico(*pix); - QIcon::Mode mode=QIcon::Normal; + QIcon::Mode mode = QIcon::Normal; if(!ico.isNull()) { - if (KviQString::equalCI(szState,"Disabled")) - mode=QIcon::Disabled; - else if (KviQString::equalCI(szState,"Active"))mode=QIcon::Active; - else if (KviQString::equalCI(szState,"Selected"))mode=QIcon::Selected; - if (c->parameterCount()<5) - m_pPainter->drawPixmap(iX,iY,ico.pixmap(pixsize,mode)); + if(KviQString::equalCI(szState, "Disabled")) + mode = QIcon::Disabled; + else if(KviQString::equalCI(szState, "Active")) + mode = QIcon::Active; + else if(KviQString::equalCI(szState, "Selected")) + mode = QIcon::Selected; + if(c->parameterCount() < 5) + m_pPainter->drawPixmap(iX, iY, ico.pixmap(pixsize, mode)); else - m_pPainter->drawPixmap(iX,iY,ico.pixmap(QSize(iW,iH),mode)); + m_pPainter->drawPixmap(iX, iY, ico.pixmap(QSize(iW, iH), mode)); } return true; } -KVSO_CLASS_FUNCTION(painter,setOpacity) +KVSO_CLASS_FUNCTION(painter, setOpacity) { CHECK_INTERNAL_POINTER(m_pPainter) kvs_real_t dOpacity; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("opacity_factor",KVS_PT_DOUBLE,0,dOpacity) + KVSO_PARAMETER("opacity_factor", KVS_PT_DOUBLE, 0, dOpacity) KVSO_PARAMETERS_END(c) m_pPainter->setOpacity(dOpacity); return true; } -KVSO_CLASS_FUNCTION(painter,setTextAntialiasing) +KVSO_CLASS_FUNCTION(painter, setTextAntialiasing) { CHECK_INTERNAL_POINTER(m_pPainter) bool bEnabled; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("bEnabled",KVS_PT_BOOL,0,bEnabled) + KVSO_PARAMETER("bEnabled", KVS_PT_BOOL, 0, bEnabled) KVSO_PARAMETERS_END(c) - m_pPainter->setRenderHint(QPainter::TextAntialiasing,bEnabled); + m_pPainter->setRenderHint(QPainter::TextAntialiasing, bEnabled); return true; } -KVSO_CLASS_FUNCTION(painter,setAntialiasing) +KVSO_CLASS_FUNCTION(painter, setAntialiasing) { CHECK_INTERNAL_POINTER(m_pPainter) bool bEnabled; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("bEnabled",KVS_PT_BOOL,0,bEnabled) + KVSO_PARAMETER("bEnabled", KVS_PT_BOOL, 0, bEnabled) KVSO_PARAMETERS_END(c) - m_pPainter->setRenderHint(QPainter::Antialiasing,bEnabled); + m_pPainter->setRenderHint(QPainter::Antialiasing, bEnabled); return true; } -KVSO_CLASS_FUNCTION(painter,setSmoothPixmapTransform) +KVSO_CLASS_FUNCTION(painter, setSmoothPixmapTransform) { CHECK_INTERNAL_POINTER(m_pPainter) bool bEnabled; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("bEnabled",KVS_PT_BOOL,0,bEnabled) + KVSO_PARAMETER("bEnabled", KVS_PT_BOOL, 0, bEnabled) KVSO_PARAMETERS_END(c) - m_pPainter->setRenderHint(QPainter::SmoothPixmapTransform,bEnabled); + m_pPainter->setRenderHint(QPainter::SmoothPixmapTransform, bEnabled); return true; } -KVSO_CLASS_FUNCTION(painter,setPenJoinStyle) +KVSO_CLASS_FUNCTION(painter, setPenJoinStyle) { CHECK_INTERNAL_POINTER(m_pPainter) QString szStyle; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("style",KVS_PT_STRING,0,szStyle) + KVSO_PARAMETER("style", KVS_PT_STRING, 0, szStyle) KVSO_PARAMETERS_END(c) - Qt::PenJoinStyle style=Qt::BevelJoin; - if(KviQString::equalCI(szStyle,"Milter"))style=Qt::MiterJoin; - else if (KviQString::equalCI(szStyle,"Round"))style=Qt::RoundJoin; - QPen pen=m_pPainter->pen(); + Qt::PenJoinStyle style = Qt::BevelJoin; + if(KviQString::equalCI(szStyle, "Milter")) + style = Qt::MiterJoin; + else if(KviQString::equalCI(szStyle, "Round")) + style = Qt::RoundJoin; + QPen pen = m_pPainter->pen(); pen.setJoinStyle(style); m_pPainter->setPen(pen); return true; } -KVSO_CLASS_FUNCTION(painter,setPenCapStyle) +KVSO_CLASS_FUNCTION(painter, setPenCapStyle) { CHECK_INTERNAL_POINTER(m_pPainter) QString szStyle; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("style",KVS_PT_STRING,0,szStyle) + KVSO_PARAMETER("style", KVS_PT_STRING, 0, szStyle) KVSO_PARAMETERS_END(c) - Qt::PenCapStyle style=Qt::SquareCap; - if(KviQString::equalCI(szStyle,"Flat")) style=Qt::FlatCap; - else if (KviQString::equalCI(szStyle,"Round"))style=Qt::RoundCap; - QPen pen=m_pPainter->pen(); + Qt::PenCapStyle style = Qt::SquareCap; + if(KviQString::equalCI(szStyle, "Flat")) + style = Qt::FlatCap; + else if(KviQString::equalCI(szStyle, "Round")) + style = Qt::RoundCap; + QPen pen = m_pPainter->pen(); pen.setCapStyle(style); m_pPainter->setPen(pen); return true; } -KVSO_CLASS_FUNCTION(painter,save) +KVSO_CLASS_FUNCTION(painter, save) { CHECK_INTERNAL_POINTER(m_pPainter) m_pPainter->save(); return true; } -KVSO_CLASS_FUNCTION(painter,restore) +KVSO_CLASS_FUNCTION(painter, restore) { CHECK_INTERNAL_POINTER(m_pPainter) m_pPainter->restore(); return true; } -KVSO_CLASS_FUNCTION(painter,setPenStyle) +KVSO_CLASS_FUNCTION(painter, setPenStyle) { CHECK_INTERNAL_POINTER(m_pPainter) QString szStyle; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("style",KVS_PT_STRING,0,szStyle) + KVSO_PARAMETER("style", KVS_PT_STRING, 0, szStyle) KVSO_PARAMETERS_END(c) - bool found=false; + bool found = false; unsigned int j = 0; for(; j < penstyles_num; j++) { - if(KviQString::equalCI(szStyle,penstyles_tbl[j])) + if(KviQString::equalCI(szStyle, penstyles_tbl[j])) { - found=true; + found = true; break; } } - QPen pen=m_pPainter->pen(); - if (found) + QPen pen = m_pPainter->pen(); + if(found) { pen.setStyle(penstyles_cod[j]); m_pPainter->setPen(pen); } - else c->warning(__tr2qs_ctx("Unknown pen style '%Q'","objects"),&szStyle); + else + c->warning(__tr2qs_ctx("Unknown pen style '%Q'", "objects"), &szStyle); return true; } -KVSO_CLASS_FUNCTION(painter,setBrushStyle) +KVSO_CLASS_FUNCTION(painter, setBrushStyle) { CHECK_INTERNAL_POINTER(m_pPainter) QString szStyle; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("style",KVS_PT_STRING,0,szStyle) + KVSO_PARAMETER("style", KVS_PT_STRING, 0, szStyle) KVSO_PARAMETERS_END(c) - bool found=false; + bool found = false; unsigned int j = 0; for(; j < brushstyles_num; j++) { - if(KviQString::equalCI(szStyle,brushstyles_tbl[j])) + if(KviQString::equalCI(szStyle, brushstyles_tbl[j])) { - found=true; + found = true; break; } } - QBrush brush=m_pPainter->brush(); - if (found) + QBrush brush = m_pPainter->brush(); + if(found) { brush.setStyle(brushstyles_cod[j]); m_pPainter->setBrush(brush); } - else c->warning(__tr2qs_ctx("Unknown brush style '%Q'","objects"),&szStyle); + else + c->warning(__tr2qs_ctx("Unknown brush style '%Q'", "objects"), &szStyle); return true; } -KVSO_CLASS_FUNCTION(painter,setGradientStart) +KVSO_CLASS_FUNCTION(painter, setGradientStart) { CHECK_INTERNAL_POINTER(m_pPainter) - kvs_real_t dX,dY; + kvs_real_t dX, dY; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("x_Point",KVS_PT_DOUBLE,0,dX) - KVSO_PARAMETER("y_Point",KVS_PT_DOUBLE,0,dY) + KVSO_PARAMETER("x_Point", KVS_PT_DOUBLE, 0, dX) + KVSO_PARAMETER("y_Point", KVS_PT_DOUBLE, 0, dY) KVSO_PARAMETERS_END(c) - if (!m_pGradient) m_pGradient=new(QLinearGradient); - m_pGradient->setStart(dX,dY); + if(!m_pGradient) + m_pGradient = new(QLinearGradient); + m_pGradient->setStart(dX, dY); return true; } -KVSO_CLASS_FUNCTION(painter,setGradientStop) +KVSO_CLASS_FUNCTION(painter, setGradientStop) { CHECK_INTERNAL_POINTER(m_pPainter) - kvs_real_t dX,dY; + kvs_real_t dX, dY; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("x_Point",KVS_PT_DOUBLE,0,dX) - KVSO_PARAMETER("y_Point",KVS_PT_DOUBLE,0,dY) + KVSO_PARAMETER("x_Point", KVS_PT_DOUBLE, 0, dX) + KVSO_PARAMETER("y_Point", KVS_PT_DOUBLE, 0, dY) KVSO_PARAMETERS_END(c) - if (!m_pGradient) m_pGradient=new(QLinearGradient); - m_pGradient->setFinalStop(dX,dY); + if(!m_pGradient) + m_pGradient = new(QLinearGradient); + m_pGradient->setFinalStop(dX, dY); return true; } -KVSO_CLASS_FUNCTION(painter,setGradientColor) +KVSO_CLASS_FUNCTION(painter, setGradientColor) { CHECK_INTERNAL_POINTER(m_pPainter) kvs_real_t dAt; - kvs_int_t iCol1,iCol2,iCol3,iOpacity; - KviKvsVariant *var1,*var2,*var3; - QString szColorMode,szColor; + kvs_int_t iCol1, iCol2, iCol3, iOpacity; + KviKvsVariant *var1, *var2, *var3; + QString szColorMode, szColor; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("at",KVS_PT_DOUBLE,0,dAt) - KVSO_PARAMETER("Color_1_Or_Colorname",KVS_PT_VARIANT,0,var1) - KVSO_PARAMETER("Color_2",KVS_PT_VARIANT,KVS_PF_OPTIONAL,var2) - KVSO_PARAMETER("Colo3_3",KVS_PT_VARIANT,KVS_PF_OPTIONAL,var3) - KVSO_PARAMETER("color_mode",KVS_PT_STRING,KVS_PF_OPTIONAL,szColorMode) - KVSO_PARAMETER("opacity",KVS_PT_INT,KVS_PF_OPTIONAL,iOpacity) + KVSO_PARAMETER("at", KVS_PT_DOUBLE, 0, dAt) + KVSO_PARAMETER("Color_1_Or_Colorname", KVS_PT_VARIANT, 0, var1) + KVSO_PARAMETER("Color_2", KVS_PT_VARIANT, KVS_PF_OPTIONAL, var2) + KVSO_PARAMETER("Colo3_3", KVS_PT_VARIANT, KVS_PF_OPTIONAL, var3) + KVSO_PARAMETER("color_mode", KVS_PT_STRING, KVS_PF_OPTIONAL, szColorMode) + KVSO_PARAMETER("opacity", KVS_PT_INT, KVS_PF_OPTIONAL, iOpacity) KVSO_PARAMETERS_END(c) - if (!var1->asInteger(iCol1)) + if(!var1->asInteger(iCol1)) { var1->asString(szColor); - if (c->paramCount()<3) iOpacity=255; + if(c->paramCount() < 3) + iOpacity = 255; else { - if (!var2->asInteger(iOpacity)) + if(!var2->asInteger(iOpacity)) { - c->warning(__tr2qs_ctx("The opacity parameter didn't evaluate to integer","objects")); + c->warning(__tr2qs_ctx("The opacity parameter didn't evaluate to integer", "objects")); return true; } } - if (!m_pGradient) m_pGradient=new(QLinearGradient); + if(!m_pGradient) + m_pGradient = new(QLinearGradient); QColor col(szColor); col.setAlpha(iOpacity); - m_pGradient->setColorAt(dAt,col); - } else { - if(c->paramCount()<4) + m_pGradient->setColorAt(dAt, col); + } + else + { + if(c->paramCount() < 4) { - c->error(__tr2qs_ctx("Color name or triplet RGB/HSV values required","objects")); + c->error(__tr2qs_ctx("Color name or triplet RGB/HSV values required", "objects")); return true; } - if ( !var2->asInteger(iCol2)||!var3->asInteger(iCol3)) + if(!var2->asInteger(iCol2) || !var3->asInteger(iCol3)) { - c->error(__tr2qs_ctx("One of the triplet parameters didn't evaluate to an integer","objects"));\ - return true; + c->error(__tr2qs_ctx("One of the triplet parameters didn't evaluate to an integer", "objects")); + return true; } - if (c->paramCount()<5) - iOpacity=255; + if(c->paramCount() < 5) + iOpacity = 255; QColor col; if(KviQString::equalCI(szColorMode, "HSV")) - col.setHsv(iCol1,iCol2,iCol3,iOpacity); + col.setHsv(iCol1, iCol2, iCol3, iOpacity); else - col.setRgb(iCol1,iCol2,iCol3,iOpacity); - if (!m_pGradient) - m_pGradient=new(QLinearGradient); - m_pGradient->setColorAt(dAt,col); - + col.setRgb(iCol1, iCol2, iCol3, iOpacity); + if(!m_pGradient) + m_pGradient = new(QLinearGradient); + m_pGradient->setColorAt(dAt, col); } return true; } -KVSO_CLASS_FUNCTION(painter,setGradientAsBrush) +KVSO_CLASS_FUNCTION(painter, setGradientAsBrush) { CHECK_INTERNAL_POINTER(m_pPainter) - if (!m_pGradient) m_pGradient=new(QLinearGradient); + if(!m_pGradient) + m_pGradient = new(QLinearGradient); m_pPainter->setBrush(*m_pGradient); return true; } -KVSO_CLASS_FUNCTION(painter,clearGradient) +KVSO_CLASS_FUNCTION(painter, clearGradient) { Q_UNUSED(c); - if (!m_pGradient) delete m_pGradient; - m_pGradient=0; + if(!m_pGradient) + delete m_pGradient; + m_pGradient = 0; return true; } -KVSO_CLASS_FUNCTION(painter,setPenWidth) +KVSO_CLASS_FUNCTION(painter, setPenWidth) { CHECK_INTERNAL_POINTER(m_pPainter) kvs_real_t iWidth; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("width",KVS_PT_REAL,0,iWidth) + KVSO_PARAMETER("width", KVS_PT_REAL, 0, iWidth) KVSO_PARAMETERS_END(c) - QPen pen=m_pPainter->pen(); + QPen pen = m_pPainter->pen(); pen.setWidthF(iWidth); m_pPainter->setPen(pen); return true; } -KVSO_CLASS_FUNCTION(painter,fillRect) +KVSO_CLASS_FUNCTION(painter, fillRect) { CHECK_INTERNAL_POINTER(m_pPainter) - kvs_int_t iX,iY,iW,iH; - kvs_int_t iCol1,iCol2,iCol3,iOpacity; - QString szColorMode,szColor; - KviKvsVariant *var1,*var2,*var3; + kvs_int_t iX, iY, iW, iH; + kvs_int_t iCol1, iCol2, iCol3, iOpacity; + QString szColorMode, szColor; + KviKvsVariant *var1, *var2, *var3; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("x",KVS_PT_INT,0,iX) - KVSO_PARAMETER("y",KVS_PT_INT,0,iY) - KVSO_PARAMETER("w",KVS_PT_INT,0,iW) - KVSO_PARAMETER("h",KVS_PT_INT,0,iH) - KVSO_PARAMETER("Color_1_Or_Colorname",KVS_PT_VARIANT,0,var1) - KVSO_PARAMETER("Color_2",KVS_PT_VARIANT,KVS_PF_OPTIONAL,var2) - KVSO_PARAMETER("Colo3_3",KVS_PT_VARIANT,KVS_PF_OPTIONAL,var3) - KVSO_PARAMETER("opacity",KVS_PT_INT,KVS_PF_OPTIONAL,iOpacity) - KVSO_PARAMETER("color_mode",KVS_PT_STRING,KVS_PF_OPTIONAL,szColorMode) + KVSO_PARAMETER("x", KVS_PT_INT, 0, iX) + KVSO_PARAMETER("y", KVS_PT_INT, 0, iY) + KVSO_PARAMETER("w", KVS_PT_INT, 0, iW) + KVSO_PARAMETER("h", KVS_PT_INT, 0, iH) + KVSO_PARAMETER("Color_1_Or_Colorname", KVS_PT_VARIANT, 0, var1) + KVSO_PARAMETER("Color_2", KVS_PT_VARIANT, KVS_PF_OPTIONAL, var2) + KVSO_PARAMETER("Colo3_3", KVS_PT_VARIANT, KVS_PF_OPTIONAL, var3) + KVSO_PARAMETER("opacity", KVS_PT_INT, KVS_PF_OPTIONAL, iOpacity) + KVSO_PARAMETER("color_mode", KVS_PT_STRING, KVS_PF_OPTIONAL, szColorMode) KVSO_PARAMETERS_END(c) QColor col; - if (!var1->asInteger(iCol1)) + if(!var1->asInteger(iCol1)) { var1->asString(szColor); - if (c->paramCount()<6) iOpacity=255; + if(c->paramCount() < 6) + iOpacity = 255; else { - if (!var2->asInteger(iOpacity)) + if(!var2->asInteger(iOpacity)) { - c->warning(__tr2qs_ctx("The opacity parameter didn't evaluate to integer","objects")); + c->warning(__tr2qs_ctx("The opacity parameter didn't evaluate to integer", "objects")); return true; } } col.setNamedColor(szColor); col.setAlpha(iOpacity); - } else { - if(c->paramCount()<7) + } + else + { + if(c->paramCount() < 7) { - c->error(__tr2qs_ctx("Color name or triplet RGB/HSV value required","objects")); + c->error(__tr2qs_ctx("Color name or triplet RGB/HSV value required", "objects")); return true; } - if (!var2->asInteger(iCol2)||!var3->asInteger(iCol3)) + if(!var2->asInteger(iCol2) || !var3->asInteger(iCol3)) { - c->error(__tr2qs_ctx("One of the triplet parameters didn't evaluate to an integer","objects"));\ - return true; + c->error(__tr2qs_ctx("One of the triplet parameters didn't evaluate to an integer", "objects")); + return true; } - if (c->paramCount()<5) - iOpacity=255; + if(c->paramCount() < 5) + iOpacity = 255; QColor col; if(KviQString::equalCI(szColorMode, "HSV")) - col.setHsv(iCol1,iCol2,iCol3,iOpacity); + col.setHsv(iCol1, iCol2, iCol3, iOpacity); else - col.setRgb(iCol1,iCol2,iCol3,iOpacity); + col.setRgb(iCol1, iCol2, iCol3, iOpacity); } - m_pPainter->fillRect(iX,iY,iW,iH,QBrush(col)); + m_pPainter->fillRect(iX, iY, iW, iH, QBrush(col)); return true; } -KVSO_CLASS_FUNCTION(painter,colorNames) +KVSO_CLASS_FUNCTION(painter, colorNames) { CHECK_INTERNAL_POINTER(m_pPainter) - QStringList color=QColor::colorNames(); + QStringList color = QColor::colorNames(); KviKvsArray * a = new KviKvsArray(); //a->set(0,new KviKvsVariant((kvs_int_t)col.red())); - for(int i=0;iset(i,new KviKvsVariant(color.at(i))); + a->set(i, new KviKvsVariant(color.at(i))); } c->returnValue()->setArray(a); return true; } -KVSO_CLASS_FUNCTION(painter,painterDeviceWidth) +KVSO_CLASS_FUNCTION(painter, painterDeviceWidth) { CHECK_INTERNAL_POINTER(m_pPainter) - kvs_int_t width=m_pPainter->device()->width(); + kvs_int_t width = m_pPainter->device()->width(); c->returnValue()->setInteger(width); return true; } -KVSO_CLASS_FUNCTION(painter,painterDeviceHeight) +KVSO_CLASS_FUNCTION(painter, painterDeviceHeight) { CHECK_INTERNAL_POINTER(m_pPainter) - kvs_int_t height=m_pPainter->device()->height(); + kvs_int_t height = m_pPainter->device()->height(); c->returnValue()->setInteger(height); return true; } -KVSO_CLASS_FUNCTION(painter,pathMoveTo) +KVSO_CLASS_FUNCTION(painter, pathMoveTo) { CHECK_INTERNAL_POINTER(m_pPainter) - kvs_real_t dX,dY; + kvs_real_t dX, dY; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("x",KVS_PT_REAL,0,dX) - KVSO_PARAMETER("y",KVS_PT_REAL,0,dY) + KVSO_PARAMETER("x", KVS_PT_REAL, 0, dX) + KVSO_PARAMETER("y", KVS_PT_REAL, 0, dY) KVSO_PARAMETERS_END(c) - if (!m_pPainterPath) m_pPainterPath=new QPainterPath(QPointF(0,0)); - m_pPainterPath->moveTo(dX,dY); + if(!m_pPainterPath) + m_pPainterPath = new QPainterPath(QPointF(0, 0)); + m_pPainterPath->moveTo(dX, dY); return true; } -KVSO_CLASS_FUNCTION(painter,pathLineTo) +KVSO_CLASS_FUNCTION(painter, pathLineTo) { CHECK_INTERNAL_POINTER(m_pPainter) - kvs_real_t dX,dY; + kvs_real_t dX, dY; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("x",KVS_PT_REAL,0,dX) - KVSO_PARAMETER("y",KVS_PT_REAL,0,dY) + KVSO_PARAMETER("x", KVS_PT_REAL, 0, dX) + KVSO_PARAMETER("y", KVS_PT_REAL, 0, dY) KVSO_PARAMETERS_END(c) - if (!m_pPainterPath) m_pPainterPath=new QPainterPath(QPointF(0,0)); - m_pPainterPath->lineTo(dX,dY); + if(!m_pPainterPath) + m_pPainterPath = new QPainterPath(QPointF(0, 0)); + m_pPainterPath->lineTo(dX, dY); return true; } -KVSO_CLASS_FUNCTION(painter,pathAddText) +KVSO_CLASS_FUNCTION(painter, pathAddText) { CHECK_INTERNAL_POINTER(m_pPainter) - kvs_real_t dX,dY; + kvs_real_t dX, dY; QString szText; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("x",KVS_PT_REAL,0,dX) - KVSO_PARAMETER("y",KVS_PT_REAL,0,dY) - KVSO_PARAMETER("text",KVS_PT_STRING,0,szText) + KVSO_PARAMETER("x", KVS_PT_REAL, 0, dX) + KVSO_PARAMETER("y", KVS_PT_REAL, 0, dY) + KVSO_PARAMETER("text", KVS_PT_STRING, 0, szText) KVSO_PARAMETERS_END(c) - if (!m_pPainterPath) m_pPainterPath=new QPainterPath(QPointF(0,0)); - m_pPainterPath->addText(dX,dY,m_pPainter->font(),szText); + if(!m_pPainterPath) + m_pPainterPath = new QPainterPath(QPointF(0, 0)); + m_pPainterPath->addText(dX, dY, m_pPainter->font(), szText); return true; } -KVSO_CLASS_FUNCTION(painter,drawPath) +KVSO_CLASS_FUNCTION(painter, drawPath) { CHECK_INTERNAL_POINTER(m_pPainter) m_pPainter->drawPath(*m_pPainterPath); @@ -2059,43 +2120,44 @@ KVSO_CLASS_FUNCTION(painter,drawPath) return true; } -KVSO_CLASS_FUNCTION(painter,setCompositionMode) +KVSO_CLASS_FUNCTION(painter, setCompositionMode) { CHECK_INTERNAL_POINTER(m_pPainter) QString szComposition; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("style",KVS_PT_STRING,0,szComposition) + KVSO_PARAMETER("style", KVS_PT_STRING, 0, szComposition) KVSO_PARAMETERS_END(c) - bool found=false; + bool found = false; unsigned int j = 0; for(; j < composition_num; j++) { - if(KviQString::equalCI(szComposition,composition_tbl[j])) + if(KviQString::equalCI(szComposition, composition_tbl[j])) { - found=true; + found = true; break; } } - if (found) + if(found) { m_pPainter->setCompositionMode(composition_cod[j]); } - else c->warning(__tr2qs_ctx("Unknown composition mode '%Q'","objects"),&szComposition); + else + c->warning(__tr2qs_ctx("Unknown composition mode '%Q'", "objects"), &szComposition); return true; } -KVSO_CLASS_FUNCTION(painter,resetPath) +KVSO_CLASS_FUNCTION(painter, resetPath) { Q_UNUSED(c); - if (m_pPainterPath) + if(m_pPainterPath) { delete m_pPainterPath; - m_pPainterPath=0; + m_pPainterPath = 0; } return true; } -void KvsObject_painter::setInternalPainter(QPainter *p) +void KvsObject_painter::setInternalPainter(QPainter * p) { delete m_pPainter; - m_pPainter=p; - bDonotdeleteinternalqpainter=true; + m_pPainter = p; + bDonotdeleteinternalqpainter = true; } diff --git a/src/modules/objects/KvsObject_painter.h b/src/modules/objects/KvsObject_painter.h index afd41e976..dff1dc755 100644 --- a/src/modules/objects/KvsObject_painter.h +++ b/src/modules/objects/KvsObject_painter.h @@ -33,7 +33,6 @@ #include "KviCString.h" #include - class KvsObject_painter : public KviKvsObject { Q_OBJECT @@ -43,88 +42,87 @@ protected: QPrinter * m_pPrinter; bool bDonotdeleteinternalqpainter; QPainter * m_pPainter; - QLinearGradient *m_pGradient; - QPainterPath *m_pPainterPath; -public: - void setInternalPainter(QPainter *p); - bool setFont(KviKvsObjectFunctionCall *c); - bool setFontSize(KviKvsObjectFunctionCall *c); - - bool fontAscent(KviKvsObjectFunctionCall *c); - bool fontDescent(KviKvsObjectFunctionCall *c); - bool fontMetricsWidth(KviKvsObjectFunctionCall *c); - bool fontMetricsHeight(KviKvsObjectFunctionCall *c); - bool setBrush(KviKvsObjectFunctionCall *c); - bool setPen(KviKvsObjectFunctionCall *c); - bool pen(KviKvsObjectFunctionCall *c); - bool setBackGroundMode(KviKvsObjectFunctionCall *c); - - bool drawRect(KviKvsObjectFunctionCall *c); - bool drawWinFocusRect(KviKvsObjectFunctionCall *c); - bool drawLine(KviKvsObjectFunctionCall *c); - bool drawRoundRect(KviKvsObjectFunctionCall *c); - bool drawPoint(KviKvsObjectFunctionCall *c); - bool drawArc(KviKvsObjectFunctionCall *c); - bool drawChord(KviKvsObjectFunctionCall *c); - bool drawPie(KviKvsObjectFunctionCall *c); - bool drawEllipse(KviKvsObjectFunctionCall *c); - - bool drawText(KviKvsObjectFunctionCall *c); - bool drawPixmap(KviKvsObjectFunctionCall *c); - - - bool begin(KviKvsObjectFunctionCall *c); - bool end(KviKvsObjectFunctionCall *c); - bool save(KviKvsObjectFunctionCall *c); - bool restore(KviKvsObjectFunctionCall *c); - - - bool scale(KviKvsObjectFunctionCall *c); - bool shear(KviKvsObjectFunctionCall *c); - bool rotate(KviKvsObjectFunctionCall *c); - bool reset(KviKvsObjectFunctionCall *c); - bool translate(KviKvsObjectFunctionCall *c); - bool setPenStyle(KviKvsObjectFunctionCall *c); - bool setBrushStyle(KviKvsObjectFunctionCall *c); - bool setCompositionMode(KviKvsObjectFunctionCall *c); - -// QT4 - bool setOpacity(KviKvsObjectFunctionCall *c); - bool setSmoothPixmapTransform(KviKvsObjectFunctionCall *c); - bool setTextAntialiasing(KviKvsObjectFunctionCall *c); - bool setAntialiasing(KviKvsObjectFunctionCall *c); - bool setGradientStart(KviKvsObjectFunctionCall *c); - bool setGradientStop(KviKvsObjectFunctionCall *c); - bool setGradientColor(KviKvsObjectFunctionCall *c); - bool setGradientAsBrush(KviKvsObjectFunctionCall *c); - bool clearGradient(KviKvsObjectFunctionCall *c); - - bool drawIcon(KviKvsObjectFunctionCall *c); - bool drawHtmlText(KviKvsObjectFunctionCall *c); - bool htmlTextSize(KviKvsObjectFunctionCall *c); - bool fillRect(KviKvsObjectFunctionCall *c); - bool setPenWidth(KviKvsObjectFunctionCall *c); - bool colorNames(KviKvsObjectFunctionCall *c); - bool pathMoveTo(KviKvsObjectFunctionCall *c); - bool pathLineTo(KviKvsObjectFunctionCall *c); - bool drawPath(KviKvsObjectFunctionCall *c); - bool setPenJoinStyle(KviKvsObjectFunctionCall *c); - bool setPenCapStyle(KviKvsObjectFunctionCall *c); - bool pathAddText(KviKvsObjectFunctionCall *c); - bool resetPath(KviKvsObjectFunctionCall *c); - - bool beginPdf(KviKvsObjectFunctionCall *c); - bool drawPixmapWithColorEffect(KviKvsObjectFunctionCall *c); - bool drawPixmapMirrored(KviKvsObjectFunctionCall *c); - bool painterDeviceWidth(KviKvsObjectFunctionCall *c); - bool painterDeviceHeight(KviKvsObjectFunctionCall *c); + QLinearGradient * m_pGradient; + QPainterPath * m_pPainterPath; +public: + void setInternalPainter(QPainter * p); + bool setFont(KviKvsObjectFunctionCall * c); + bool setFontSize(KviKvsObjectFunctionCall * c); + + bool fontAscent(KviKvsObjectFunctionCall * c); + bool fontDescent(KviKvsObjectFunctionCall * c); + bool fontMetricsWidth(KviKvsObjectFunctionCall * c); + bool fontMetricsHeight(KviKvsObjectFunctionCall * c); + bool setBrush(KviKvsObjectFunctionCall * c); + bool setPen(KviKvsObjectFunctionCall * c); + bool pen(KviKvsObjectFunctionCall * c); + bool setBackGroundMode(KviKvsObjectFunctionCall * c); + + bool drawRect(KviKvsObjectFunctionCall * c); + bool drawWinFocusRect(KviKvsObjectFunctionCall * c); + bool drawLine(KviKvsObjectFunctionCall * c); + bool drawRoundRect(KviKvsObjectFunctionCall * c); + bool drawPoint(KviKvsObjectFunctionCall * c); + bool drawArc(KviKvsObjectFunctionCall * c); + bool drawChord(KviKvsObjectFunctionCall * c); + bool drawPie(KviKvsObjectFunctionCall * c); + bool drawEllipse(KviKvsObjectFunctionCall * c); + + bool drawText(KviKvsObjectFunctionCall * c); + bool drawPixmap(KviKvsObjectFunctionCall * c); + + bool begin(KviKvsObjectFunctionCall * c); + bool end(KviKvsObjectFunctionCall * c); + bool save(KviKvsObjectFunctionCall * c); + bool restore(KviKvsObjectFunctionCall * c); + + bool scale(KviKvsObjectFunctionCall * c); + bool shear(KviKvsObjectFunctionCall * c); + bool rotate(KviKvsObjectFunctionCall * c); + bool reset(KviKvsObjectFunctionCall * c); + bool translate(KviKvsObjectFunctionCall * c); + bool setPenStyle(KviKvsObjectFunctionCall * c); + bool setBrushStyle(KviKvsObjectFunctionCall * c); + bool setCompositionMode(KviKvsObjectFunctionCall * c); + + // QT4 + bool setOpacity(KviKvsObjectFunctionCall * c); + bool setSmoothPixmapTransform(KviKvsObjectFunctionCall * c); + bool setTextAntialiasing(KviKvsObjectFunctionCall * c); + bool setAntialiasing(KviKvsObjectFunctionCall * c); + bool setGradientStart(KviKvsObjectFunctionCall * c); + bool setGradientStop(KviKvsObjectFunctionCall * c); + bool setGradientColor(KviKvsObjectFunctionCall * c); + bool setGradientAsBrush(KviKvsObjectFunctionCall * c); + bool clearGradient(KviKvsObjectFunctionCall * c); + + bool drawIcon(KviKvsObjectFunctionCall * c); + bool drawHtmlText(KviKvsObjectFunctionCall * c); + bool htmlTextSize(KviKvsObjectFunctionCall * c); + bool fillRect(KviKvsObjectFunctionCall * c); + bool setPenWidth(KviKvsObjectFunctionCall * c); + bool colorNames(KviKvsObjectFunctionCall * c); + bool pathMoveTo(KviKvsObjectFunctionCall * c); + bool pathLineTo(KviKvsObjectFunctionCall * c); + bool drawPath(KviKvsObjectFunctionCall * c); + bool setPenJoinStyle(KviKvsObjectFunctionCall * c); + bool setPenCapStyle(KviKvsObjectFunctionCall * c); + bool pathAddText(KviKvsObjectFunctionCall * c); + bool resetPath(KviKvsObjectFunctionCall * c); + + bool beginPdf(KviKvsObjectFunctionCall * c); + bool drawPixmapWithColorEffect(KviKvsObjectFunctionCall * c); + bool drawPixmapMirrored(KviKvsObjectFunctionCall * c); + bool painterDeviceWidth(KviKvsObjectFunctionCall * c); + bool painterDeviceHeight(KviKvsObjectFunctionCall * c); protected: - void attachDevice(KviKvsObject * o,QPaintDevice * p); + void attachDevice(KviKvsObject * o, QPaintDevice * p); protected slots: void detachDevice(); + private: KviKvsObject * m_pDeviceObject; }; -#endif // !_CLASS_PAINTER_H_ +#endif // !_CLASS_PAINTER_H_ diff --git a/src/modules/objects/KvsObject_pixmap.cpp b/src/modules/objects/KvsObject_pixmap.cpp index 52eeda284..8505b606f 100644 --- a/src/modules/objects/KvsObject_pixmap.cpp +++ b/src/modules/objects/KvsObject_pixmap.cpp @@ -84,97 +84,96 @@ This signal is emitted by the default implementation of [classfnc]$frameChangedEvent[/classfnc]().[br] */ -KVSO_BEGIN_REGISTERCLASS(KvsObject_pixmap,"pixmap","object") - - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_pixmap,fill) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_pixmap,resize) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_pixmap,scale) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_pixmap,load) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_pixmap,loadAnimation) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_pixmap,save) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_pixmap,startAnimation) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_pixmap,stopAnimation) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_pixmap,loadFromMemoryBuffer) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_pixmap,height) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_pixmap,width) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_pixmap,rotate) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_pixmap,mirrored) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_pixmap,setPixel) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_pixmap,pixel) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_pixmap,grabWidget) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_pixmap,frameChangedEvent) - +KVSO_BEGIN_REGISTERCLASS(KvsObject_pixmap, "pixmap", "object") + +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_pixmap, fill) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_pixmap, resize) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_pixmap, scale) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_pixmap, load) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_pixmap, loadAnimation) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_pixmap, save) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_pixmap, startAnimation) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_pixmap, stopAnimation) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_pixmap, loadFromMemoryBuffer) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_pixmap, height) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_pixmap, width) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_pixmap, rotate) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_pixmap, mirrored) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_pixmap, setPixel) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_pixmap, pixel) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_pixmap, grabWidget) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_pixmap, frameChangedEvent) KVSO_END_REGISTERCLASS(KvsObject_pixmap) - -KVSO_BEGIN_CONSTRUCTOR(KvsObject_pixmap,KviKvsObject) - m_pAnimatedPixmap = 0; - m_currentType = Image; - m_pPixmap = 0; - m_pImage = 0; +KVSO_BEGIN_CONSTRUCTOR(KvsObject_pixmap, KviKvsObject) +m_pAnimatedPixmap = 0; +m_currentType = Image; +m_pPixmap = 0; +m_pImage = 0; KVSO_END_CONSTRUCTOR(KvsObject_pixmap) - KVSO_BEGIN_DESTRUCTOR(KvsObject_pixmap) - emit aboutToDie(); - if (m_pPixmap) - delete m_pPixmap; - if (m_pAnimatedPixmap) - delete m_pAnimatedPixmap; - if (m_pImage) - delete m_pImage; +emit aboutToDie(); +if(m_pPixmap) + delete m_pPixmap; +if(m_pAnimatedPixmap) + delete m_pAnimatedPixmap; +if(m_pImage) + delete m_pImage; KVSO_END_CONSTRUCTOR(KvsObject_pixmap) - -KVSO_CLASS_FUNCTION(pixmap,fill) +KVSO_CLASS_FUNCTION(pixmap, fill) { - kvs_int_t iCol1,iCol2,iCol3,iOpacity; - QString szColorMode,szColor; - KviKvsVariant *var1,*var2,*var3; + kvs_int_t iCol1, iCol2, iCol3, iOpacity; + QString szColorMode, szColor; + KviKvsVariant *var1, *var2, *var3; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("Color_1_Or_Colorname",KVS_PT_VARIANT,0,var1) - KVSO_PARAMETER("Color_2",KVS_PT_VARIANT,KVS_PF_OPTIONAL,var2) - KVSO_PARAMETER("Colo3_3",KVS_PT_VARIANT,KVS_PF_OPTIONAL,var3) - KVSO_PARAMETER("color_mode",KVS_PT_STRING,KVS_PF_OPTIONAL,szColorMode) - KVSO_PARAMETER("opacity",KVS_PT_INT,KVS_PF_OPTIONAL,iOpacity) + KVSO_PARAMETER("Color_1_Or_Colorname", KVS_PT_VARIANT, 0, var1) + KVSO_PARAMETER("Color_2", KVS_PT_VARIANT, KVS_PF_OPTIONAL, var2) + KVSO_PARAMETER("Colo3_3", KVS_PT_VARIANT, KVS_PF_OPTIONAL, var3) + KVSO_PARAMETER("color_mode", KVS_PT_STRING, KVS_PF_OPTIONAL, szColorMode) + KVSO_PARAMETER("opacity", KVS_PT_INT, KVS_PF_OPTIONAL, iOpacity) KVSO_PARAMETERS_END(c) QColor col; - if (!var1->asInteger(iCol1)) + if(!var1->asInteger(iCol1)) { var1->asString(szColor); - if (c->paramCount()<2) - iOpacity=255; - else { - if (!var2->asInteger(iOpacity)) + if(c->paramCount() < 2) + iOpacity = 255; + else + { + if(!var2->asInteger(iOpacity)) { - c->warning(__tr2qs_ctx("The opacity parameter didn't evaluate to integer","objects")); + c->warning(__tr2qs_ctx("The opacity parameter didn't evaluate to integer", "objects")); return true; } } col.setNamedColor(szColor); col.setAlpha(iOpacity); - } else { - if(c->paramCount()<3) + } + else + { + if(c->paramCount() < 3) { - c->error(__tr2qs_ctx("Color name or triplet RGB/HSV value required","objects")); + c->error(__tr2qs_ctx("Color name or triplet RGB/HSV value required", "objects")); return true; } - if (!var2->asInteger(iCol2)||!var3->asInteger(iCol3)) + if(!var2->asInteger(iCol2) || !var3->asInteger(iCol3)) { - c->error(__tr2qs_ctx("One of the triplet parameters didn't evaluate to an integer","objects"));\ + c->error(__tr2qs_ctx("One of the triplet parameters didn't evaluate to an integer", "objects")); return true; } - if (c->paramCount()<5) - iOpacity=255; + if(c->paramCount() < 5) + iOpacity = 255; if(KviQString::equalCI(szColorMode, "HSV")) - col.setHsv(iCol1,iCol2,iCol3,iOpacity); + col.setHsv(iCol1, iCol2, iCol3, iOpacity); else - col.setRgb(iCol1,iCol2,iCol3,iOpacity); + col.setRgb(iCol1, iCol2, iCol3, iOpacity); } - if(m_currentType==Image) + if(m_currentType == Image) { if(m_pImage) { @@ -183,29 +182,33 @@ KVSO_CLASS_FUNCTION(pixmap,fill) *m_pPixmap = QPixmap::fromImage(*m_pImage); delete m_pImage; m_pImage = 0; - } else { + } + else + { m_pPixmap = 0; } - } else if(m_currentType==AnimatedPixmap) { - delete m_pAnimatedPixmap; - m_pAnimatedPixmap=0; + } + else if(m_currentType == AnimatedPixmap) + { + delete m_pAnimatedPixmap; + m_pAnimatedPixmap = 0; } m_currentType = Pixmap; if(!m_pPixmap) - m_pPixmap=new QPixmap(); + m_pPixmap = new QPixmap(); m_pPixmap->fill(col); return true; } -KVSO_CLASS_FUNCTION(pixmap,resize) +KVSO_CLASS_FUNCTION(pixmap, resize) { - kvs_int_t iWidth,iHeight; + kvs_int_t iWidth, iHeight; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("width",KVS_PT_INTEGER,0,iWidth) - KVSO_PARAMETER("height",KVS_PT_INTEGER,0,iHeight) + KVSO_PARAMETER("width", KVS_PT_INTEGER, 0, iWidth) + KVSO_PARAMETER("height", KVS_PT_INTEGER, 0, iHeight) KVSO_PARAMETERS_END(c) - if(m_currentType==Image) + if(m_currentType == Image) { if(m_pImage) { @@ -213,110 +216,125 @@ KVSO_CLASS_FUNCTION(pixmap,resize) m_pImage = 0; } } - else if(m_currentType==AnimatedPixmap) { + else if(m_currentType == AnimatedPixmap) + { if(m_pAnimatedPixmap) { delete m_pAnimatedPixmap; - m_pAnimatedPixmap=0; + m_pAnimatedPixmap = 0; } - } else if(m_pPixmap) { + } + else if(m_pPixmap) + { delete m_pPixmap; } m_currentType = Image; - m_pImage=new QImage(iWidth,iHeight,QImage::Format_ARGB32_Premultiplied); + m_pImage = new QImage(iWidth, iHeight, QImage::Format_ARGB32_Premultiplied); m_pImage->fill(Qt::transparent); return true; } -KVSO_CLASS_FUNCTION(pixmap,setPixel) +KVSO_CLASS_FUNCTION(pixmap, setPixel) { - kvs_int_t iCol1,iCol2,iCol3,iOpacity,iX,iY; - QString szColorMode,szColor; - KviKvsVariant *var1,*var2,*var3; + kvs_int_t iCol1, iCol2, iCol3, iOpacity, iX, iY; + QString szColorMode, szColor; + KviKvsVariant *var1, *var2, *var3; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("x",KVS_PT_INTEGER,0,iX) - KVSO_PARAMETER("y",KVS_PT_INTEGER,0,iY) - KVSO_PARAMETER("Color_1_Or_Colorname",KVS_PT_VARIANT,0,var1) - KVSO_PARAMETER("Color_2",KVS_PT_VARIANT,KVS_PF_OPTIONAL,var2) - KVSO_PARAMETER("Colo3_3",KVS_PT_VARIANT,KVS_PF_OPTIONAL,var3) - KVSO_PARAMETER("color_mode",KVS_PT_STRING,KVS_PF_OPTIONAL,szColorMode) - KVSO_PARAMETER("opacity",KVS_PT_INT,KVS_PF_OPTIONAL,iOpacity) + KVSO_PARAMETER("x", KVS_PT_INTEGER, 0, iX) + KVSO_PARAMETER("y", KVS_PT_INTEGER, 0, iY) + KVSO_PARAMETER("Color_1_Or_Colorname", KVS_PT_VARIANT, 0, var1) + KVSO_PARAMETER("Color_2", KVS_PT_VARIANT, KVS_PF_OPTIONAL, var2) + KVSO_PARAMETER("Colo3_3", KVS_PT_VARIANT, KVS_PF_OPTIONAL, var3) + KVSO_PARAMETER("color_mode", KVS_PT_STRING, KVS_PF_OPTIONAL, szColorMode) + KVSO_PARAMETER("opacity", KVS_PT_INT, KVS_PF_OPTIONAL, iOpacity) KVSO_PARAMETERS_END(c) QColor col; - if (!var1->asInteger(iCol1)) + if(!var1->asInteger(iCol1)) { var1->asString(szColor); - if (c->paramCount()<4) + if(c->paramCount() < 4) + { + iOpacity = 255; + } + else { - iOpacity=255; - } else { - if (!var2->asInteger(iOpacity)) + if(!var2->asInteger(iOpacity)) { - c->warning(__tr2qs_ctx("The opacity parameter didn't evaluate to integer","objects")); + c->warning(__tr2qs_ctx("The opacity parameter didn't evaluate to integer", "objects")); return true; } } col.setNamedColor(szColor); col.setAlpha(iOpacity); - } else { - if(c->paramCount()<5) + } + else + { + if(c->paramCount() < 5) { - c->error(__tr2qs_ctx("Color name or triplet RGB/HSV value required","objects")); + c->error(__tr2qs_ctx("Color name or triplet RGB/HSV value required", "objects")); return true; } - if (!var2->asInteger(iCol2)||!var3->asInteger(iCol3)) + if(!var2->asInteger(iCol2) || !var3->asInteger(iCol3)) { - c->error(__tr2qs_ctx("One of the triplet parameters didn't evaluate to an integer","objects"));\ + c->error(__tr2qs_ctx("One of the triplet parameters didn't evaluate to an integer", "objects")); return true; } - if (c->paramCount()<7) - iOpacity=255; + if(c->paramCount() < 7) + iOpacity = 255; if(KviQString::equalCI(szColorMode, "HSV")) - col.setHsv(iCol1,iCol2,iCol3,iOpacity); + col.setHsv(iCol1, iCol2, iCol3, iOpacity); else - col.setRgb(iCol1,iCol2,iCol3,iOpacity); + col.setRgb(iCol1, iCol2, iCol3, iOpacity); } - if(m_currentType==AnimatedPixmap) + if(m_currentType == AnimatedPixmap) { - c->warning(__tr2qs_ctx("AnimatedPixmap not supported","objects")); + c->warning(__tr2qs_ctx("AnimatedPixmap not supported", "objects")); return true; - } else if((m_currentType==Image && !m_pImage) || (m_currentType==Pixmap && !m_pPixmap)) { - c->error(__tr2qs_ctx("The pixmap is null","objects")); + } + else if((m_currentType == Image && !m_pImage) || (m_currentType == Pixmap && !m_pPixmap)) + { + c->error(__tr2qs_ctx("The pixmap is null", "objects")); return false; - } else if(m_currentType==Pixmap) { + } + else if(m_currentType == Pixmap) + { delete m_pImage; m_pImage = new QImage(); *m_pImage = m_pPixmap->toImage(); delete m_pPixmap; } m_currentType = Image; - m_pImage->setPixel(iX,iY,col.rgba()); + m_pImage->setPixel(iX, iY, col.rgba()); return true; } -KVSO_CLASS_FUNCTION(pixmap,pixel) +KVSO_CLASS_FUNCTION(pixmap, pixel) { - kvs_int_t iX,iY; + kvs_int_t iX, iY; QString szFlags; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("x",KVS_PT_INTEGER,0,iX) - KVSO_PARAMETER("y",KVS_PT_INTEGER,0,iY) - KVSO_PARAMETER("b",KVS_PT_STRING,KVS_PF_OPTIONAL,szFlags) + KVSO_PARAMETER("x", KVS_PT_INTEGER, 0, iX) + KVSO_PARAMETER("y", KVS_PT_INTEGER, 0, iY) + KVSO_PARAMETER("b", KVS_PT_STRING, KVS_PF_OPTIONAL, szFlags) KVSO_PARAMETERS_END(c) - if(m_currentType==AnimatedPixmap) + if(m_currentType == AnimatedPixmap) { - c->warning(__tr2qs_ctx("AnimatedPixmap not supported","objects")); + c->warning(__tr2qs_ctx("AnimatedPixmap not supported", "objects")); return true; - } else if((m_currentType==Image && !m_pImage) || (m_currentType==Pixmap && !m_pPixmap)) { - c->error(__tr2qs_ctx("The pixmap is null","objects")); + } + else if((m_currentType == Image && !m_pImage) || (m_currentType == Pixmap && !m_pPixmap)) + { + c->error(__tr2qs_ctx("The pixmap is null", "objects")); return false; - } else if(m_currentType==Pixmap) { -// qDebug("mpimage %i",m_pImage); -// qDebug("pixmap %i %i",m_pPixmap->width(),m_pPixmap->height()); + } + else if(m_currentType == Pixmap) + { + // qDebug("mpimage %i",m_pImage); + // qDebug("pixmap %i %i",m_pPixmap->width(),m_pPixmap->height()); delete m_pImage; m_pImage = new QImage(); *m_pImage = m_pPixmap->toImage(); @@ -324,215 +342,231 @@ KVSO_CLASS_FUNCTION(pixmap,pixel) m_pPixmap = 0; } m_currentType = Image; - QRgb rgb= m_pImage->pixel(iX,iY); + QRgb rgb = m_pImage->pixel(iX, iY); QColor col(rgb); - if(szFlags.isEmpty()){ + if(szFlags.isEmpty()) + { c->returnValue()->setString(col.name()); return true; } - KviKvsVariant *pRed = new KviKvsVariant((kvs_int_t)col.red()); - KviKvsVariant *pGreen = new KviKvsVariant((kvs_int_t)col.green()); - KviKvsVariant *pBlue = new KviKvsVariant((kvs_int_t)col.blue()); - if (szFlags.indexOf('a',0,Qt::CaseInsensitive) != -1){ - KviKvsArray *pArray = new KviKvsArray(); - pArray->set(0,pRed); - pArray->set(1,pGreen); - pArray->set(2,pBlue); + KviKvsVariant * pRed = new KviKvsVariant((kvs_int_t)col.red()); + KviKvsVariant * pGreen = new KviKvsVariant((kvs_int_t)col.green()); + KviKvsVariant * pBlue = new KviKvsVariant((kvs_int_t)col.blue()); + if(szFlags.indexOf('a', 0, Qt::CaseInsensitive) != -1) + { + KviKvsArray * pArray = new KviKvsArray(); + pArray->set(0, pRed); + pArray->set(1, pGreen); + pArray->set(2, pBlue); c->returnValue()->setArray(pArray); - } else if (szFlags.indexOf('h',0,Qt::CaseInsensitive) != -1){ - KviKvsHash *pHash = new KviKvsHash(); - pHash->set("red",pRed); - pHash->set("green",pGreen); - pHash->set("blue",pBlue); + } + else if(szFlags.indexOf('h', 0, Qt::CaseInsensitive) != -1) + { + KviKvsHash * pHash = new KviKvsHash(); + pHash->set("red", pRed); + pHash->set("green", pGreen); + pHash->set("blue", pBlue); } return true; } -KVSO_CLASS_FUNCTION(pixmap,rotate) +KVSO_CLASS_FUNCTION(pixmap, rotate) { kvs_real_t dAngle; QString szAxis; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("angle",KVS_PT_DOUBLE,0,dAngle) - KVSO_PARAMETER("axis",KVS_PT_STRING,KVS_PF_OPTIONAL,szAxis) + KVSO_PARAMETER("angle", KVS_PT_DOUBLE, 0, dAngle) + KVSO_PARAMETER("axis", KVS_PT_STRING, KVS_PF_OPTIONAL, szAxis) KVSO_PARAMETERS_END(c) Qt::Axis axis = Qt::ZAxis; if(!szAxis.isEmpty()) { - if (KviQString::equalCI(szAxis,"XAxis")) - axis=Qt::XAxis; - else if (KviQString::equalCI(szAxis,"YAxis")) - axis=Qt::YAxis; - else if (KviQString::equalCI(szAxis,"ZAxis")) - axis=Qt::ZAxis; + if(KviQString::equalCI(szAxis, "XAxis")) + axis = Qt::XAxis; + else if(KviQString::equalCI(szAxis, "YAxis")) + axis = Qt::YAxis; + else if(KviQString::equalCI(szAxis, "ZAxis")) + axis = Qt::ZAxis; else - c->warning(__tr2qs_ctx("Unknown axis '%Q' switching to default ZAxis","objects"),&szAxis); + c->warning(__tr2qs_ctx("Unknown axis '%Q' switching to default ZAxis", "objects"), &szAxis); } - if(m_currentType==Pixmap) + if(m_currentType == Pixmap) { if(m_pPixmap) { if(!m_pImage) m_pImage = new QImage(); *m_pImage = m_pPixmap->toImage(); - } else { - c->error(__tr2qs_ctx("The pixmap is null","objects")); + } + else + { + c->error(__tr2qs_ctx("The pixmap is null", "objects")); return false; } - } else if(m_currentType==AnimatedPixmap) { - c->warning(__tr2qs_ctx("AnimatedPixmap not supported","objects")); + } + else if(m_currentType == AnimatedPixmap) + { + c->warning(__tr2qs_ctx("AnimatedPixmap not supported", "objects")); return true; } if(!m_pImage) { - c->error(__tr2qs_ctx("The pixmap is null","objects")); + c->error(__tr2qs_ctx("The pixmap is null", "objects")); return false; } m_currentType = Image; QTransform transform; - transform.rotate(dAngle,axis); - *m_pImage=m_pImage->transformed(transform); + transform.rotate(dAngle, axis); + *m_pImage = m_pImage->transformed(transform); return true; } - -KVSO_CLASS_FUNCTION(pixmap,mirrored) +KVSO_CLASS_FUNCTION(pixmap, mirrored) { - bool bHorizontal,bVertical; + bool bHorizontal, bVertical; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("bHorizontal",KVS_PT_BOOLEAN,0,bHorizontal) - KVSO_PARAMETER("bVertical",KVS_PT_BOOLEAN,0,bVertical) + KVSO_PARAMETER("bHorizontal", KVS_PT_BOOLEAN, 0, bHorizontal) + KVSO_PARAMETER("bVertical", KVS_PT_BOOLEAN, 0, bVertical) KVSO_PARAMETERS_END(c) - if(m_currentType==Pixmap) + if(m_currentType == Pixmap) { if(m_pPixmap) { - if(!m_pImage) m_pImage = new QImage(); + if(!m_pImage) + m_pImage = new QImage(); *m_pImage = m_pPixmap->toImage(); - } else { - c->error(__tr2qs_ctx("The pixmap is null","objects")); + } + else + { + c->error(__tr2qs_ctx("The pixmap is null", "objects")); return false; } - } else if(m_currentType==AnimatedPixmap) { - c->warning(__tr2qs_ctx("AnimatedPixmap not supported","objects")); + } + else if(m_currentType == AnimatedPixmap) + { + c->warning(__tr2qs_ctx("AnimatedPixmap not supported", "objects")); return true; } if(!m_pImage) { - c->error(__tr2qs_ctx("The pixmap is null","objects")); + c->error(__tr2qs_ctx("The pixmap is null", "objects")); return false; } m_currentType = Image; - *m_pImage=m_pImage->mirrored(bHorizontal,bVertical); + *m_pImage = m_pImage->mirrored(bHorizontal, bVertical); return true; } - - -KVSO_CLASS_FUNCTION(pixmap,scale) +KVSO_CLASS_FUNCTION(pixmap, scale) { - kvs_int_t iWidth,iHeight; - QString szAspectRatio; - KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("width",KVS_PT_INTEGER,0,iWidth) - KVSO_PARAMETER("height",KVS_PT_INTEGER,0,iHeight) - KVSO_PARAMETER("aspect_ratio",KVS_PT_STRING,KVS_PF_OPTIONAL,szAspectRatio) - KVSO_PARAMETERS_END(c) - Qt::AspectRatioMode ratio=Qt::KeepAspectRatio; - if(!szAspectRatio.isEmpty()) - { - if(KviQString::equalCI(szAspectRatio,"IgnoreAspectRatio")) ratio=Qt::IgnoreAspectRatio; - else if (KviQString::equalCI(szAspectRatio,"KeepAspectRatio")) ratio=Qt::KeepAspectRatio; - else if (KviQString::equalCI(szAspectRatio,"KeepAspectRatioByExpanding")) ratio=Qt::KeepAspectRatioByExpanding; - else c->warning(__tr2qs_ctx("Unknown aspect ratio %Q - Switching to KeepAspectRatio ratio","objects"),&szAspectRatio); - } - if(m_currentType==Pixmap) - { - if(m_pPixmap) - *m_pPixmap=m_pPixmap->scaled(iWidth,iHeight,ratio,Qt::SmoothTransformation); - else{ - c->error(__tr2qs_ctx("The pixmap is null","objects")); - return false; - } - } - else if (m_currentType==AnimatedPixmap) - m_pAnimatedPixmap->resize(QSize(iWidth,iHeight),ratio); - else if(m_currentType==Image) - { + kvs_int_t iWidth, iHeight; + QString szAspectRatio; + KVSO_PARAMETERS_BEGIN(c) + KVSO_PARAMETER("width", KVS_PT_INTEGER, 0, iWidth) + KVSO_PARAMETER("height", KVS_PT_INTEGER, 0, iHeight) + KVSO_PARAMETER("aspect_ratio", KVS_PT_STRING, KVS_PF_OPTIONAL, szAspectRatio) + KVSO_PARAMETERS_END(c) + Qt::AspectRatioMode ratio = Qt::KeepAspectRatio; + if(!szAspectRatio.isEmpty()) + { + if(KviQString::equalCI(szAspectRatio, "IgnoreAspectRatio")) + ratio = Qt::IgnoreAspectRatio; + else if(KviQString::equalCI(szAspectRatio, "KeepAspectRatio")) + ratio = Qt::KeepAspectRatio; + else if(KviQString::equalCI(szAspectRatio, "KeepAspectRatioByExpanding")) + ratio = Qt::KeepAspectRatioByExpanding; + else + c->warning(__tr2qs_ctx("Unknown aspect ratio %Q - Switching to KeepAspectRatio ratio", "objects"), &szAspectRatio); + } + if(m_currentType == Pixmap) + { + if(m_pPixmap) + *m_pPixmap = m_pPixmap->scaled(iWidth, iHeight, ratio, Qt::SmoothTransformation); + else + { + c->error(__tr2qs_ctx("The pixmap is null", "objects")); + return false; + } + } + else if(m_currentType == AnimatedPixmap) + m_pAnimatedPixmap->resize(QSize(iWidth, iHeight), ratio); + else if(m_currentType == Image) + { if(!m_pImage) { - c->error(__tr2qs_ctx("The pixmap is null","objects")); + c->error(__tr2qs_ctx("The pixmap is null", "objects")); return false; } - *m_pImage=m_pImage->scaled(iWidth,iHeight,ratio,Qt::SmoothTransformation); - } - return true; + *m_pImage = m_pImage->scaled(iWidth, iHeight, ratio, Qt::SmoothTransformation); + } + return true; } -KVSO_CLASS_FUNCTION(pixmap,loadAnimation) +KVSO_CLASS_FUNCTION(pixmap, loadAnimation) { QString szFile; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("file",KVS_PT_STRING,0,szFile) + KVSO_PARAMETER("file", KVS_PT_STRING, 0, szFile) KVSO_PARAMETERS_END(c) if(!QFile::exists(szFile)) { - c->warning(__tr2qs_ctx("I can't find the specified file '%Q'.","objects"),&szFile); + c->warning(__tr2qs_ctx("I can't find the specified file '%Q'.", "objects"), &szFile); return true; } - if (m_pAnimatedPixmap) { + if(m_pAnimatedPixmap) + { delete m_pAnimatedPixmap; m_pAnimatedPixmap = 0; } - if (m_pPixmap) + if(m_pPixmap) { delete m_pPixmap; - m_pPixmap=0; + m_pPixmap = 0; } - m_pAnimatedPixmap= new KviAnimatedPixmap(szFile); - connect(m_pAnimatedPixmap,SIGNAL(frameChanged()),this,SLOT(frameChanged())); + m_pAnimatedPixmap = new KviAnimatedPixmap(szFile); + connect(m_pAnimatedPixmap, SIGNAL(frameChanged()), this, SLOT(frameChanged())); return true; } -KVSO_CLASS_FUNCTION(pixmap,startAnimation) +KVSO_CLASS_FUNCTION(pixmap, startAnimation) { Q_UNUSED(c); - if (m_pAnimatedPixmap) + if(m_pAnimatedPixmap) m_pAnimatedPixmap->start(); return true; } -KVSO_CLASS_FUNCTION(pixmap,stopAnimation) +KVSO_CLASS_FUNCTION(pixmap, stopAnimation) { Q_UNUSED(c); - if (m_pAnimatedPixmap) + if(m_pAnimatedPixmap) m_pAnimatedPixmap->stop(); return true; } -KVSO_CLASS_FUNCTION(pixmap,load) +KVSO_CLASS_FUNCTION(pixmap, load) { QString szFile; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("file",KVS_PT_STRING,0,szFile) + KVSO_PARAMETER("file", KVS_PT_STRING, 0, szFile) KVSO_PARAMETERS_END(c) if(!QFile::exists(szFile)) { - c->warning(__tr2qs_ctx("I can't find the specified file '%Q'.","objects"),&szFile); + c->warning(__tr2qs_ctx("I can't find the specified file '%Q'.", "objects"), &szFile); return true; } if(!m_pImage) - m_pImage=new QImage(); + m_pImage = new QImage(); m_currentType = Image; m_pImage->load(szFile); return true; -/* + /* * FIXME UNUSED CODE if (m_currentType==Image && m_pImage) delete m_pImage; @@ -546,106 +580,114 @@ KVSO_CLASS_FUNCTION(pixmap,load) */ } -KVSO_CLASS_FUNCTION(pixmap,save) +KVSO_CLASS_FUNCTION(pixmap, save) { QString szFile; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("file",KVS_PT_STRING,0,szFile) + KVSO_PARAMETER("file", KVS_PT_STRING, 0, szFile) KVSO_PARAMETERS_END(c) - if(m_currentType==Pixmap) + if(m_currentType == Pixmap) { if(m_pPixmap) { m_pPixmap->save(szFile); - } else { - c->error(__tr2qs_ctx("The pixmap is null","objects")); + } + else + { + c->error(__tr2qs_ctx("The pixmap is null", "objects")); return false; } - } else if(m_currentType==Image) { + } + else if(m_currentType == Image) + { if(m_pImage) { m_pImage->save(szFile); - } else { - c->error(__tr2qs_ctx("The pixmap is null","objects")); + } + else + { + c->error(__tr2qs_ctx("The pixmap is null", "objects")); return false; } - } else { + } + else + { m_pAnimatedPixmap->pixmap()->save(szFile); } return true; } -void KvsObject_pixmap::setInternalPixmap(QPixmap *pPixmap) +void KvsObject_pixmap::setInternalPixmap(QPixmap * pPixmap) { - if(m_currentType==Image && m_pImage) + if(m_currentType == Image && m_pImage) delete m_pImage; - else if(m_currentType==Pixmap && m_pPixmap) + else if(m_currentType == Pixmap && m_pPixmap) delete m_pPixmap; - m_currentType=Pixmap; - m_pPixmap=pPixmap; + m_currentType = Pixmap; + m_pPixmap = pPixmap; } -void KvsObject_pixmap::setInternalImage(QImage *pImage) +void KvsObject_pixmap::setInternalImage(QImage * pImage) { - if(m_currentType==Image && m_pImage) + if(m_currentType == Image && m_pImage) delete m_pImage; - else if(m_currentType==Pixmap && m_pPixmap) + else if(m_currentType == Pixmap && m_pPixmap) delete m_pPixmap; - m_currentType=Image; - m_pImage=pImage; + m_currentType = Image; + m_pImage = pImage; } -KVSO_CLASS_FUNCTION(pixmap,loadFromMemoryBuffer) +KVSO_CLASS_FUNCTION(pixmap, loadFromMemoryBuffer) { KviKvsObject * pObject; kvs_hobject_t hObject; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("hobject",KVS_PT_HOBJECT,0,hObject) + KVSO_PARAMETER("hobject", KVS_PT_HOBJECT, 0, hObject) KVSO_PARAMETERS_END(c) - pObject=KviKvsKernel::instance()->objectController()->lookupObject(hObject); - if (!pObject) + pObject = KviKvsKernel::instance()->objectController()->lookupObject(hObject); + if(!pObject) { - c->warning(__tr2qs_ctx("Buffer parameter is not an object","objects")); + c->warning(__tr2qs_ctx("Buffer parameter is not an object", "objects")); return true; } - if (!pObject->inheritsClass("memorybuffer")) + if(!pObject->inheritsClass("memorybuffer")) { - c->warning(__tr2qs_ctx("Buffer parameter is not a memorybuffer object","objects")); + c->warning(__tr2qs_ctx("Buffer parameter is not a memorybuffer object", "objects")); return true; } - if (m_pAnimatedPixmap) + if(m_pAnimatedPixmap) { delete m_pAnimatedPixmap; - m_pAnimatedPixmap=0; + m_pAnimatedPixmap = 0; } - if (!m_pPixmap) - m_pPixmap=new QPixmap(); + if(!m_pPixmap) + m_pPixmap = new QPixmap(); m_pPixmap->loadFromData(((KvsObject_memoryBuffer *)pObject)->dataBuffer()); return true; } -KVSO_CLASS_FUNCTION(pixmap,grabWidget) +KVSO_CLASS_FUNCTION(pixmap, grabWidget) { CHECK_INTERNAL_POINTER(m_pPixmap) KviKvsObject * pObject; kvs_hobject_t hObject; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("widget",KVS_PT_HOBJECT,0,hObject) + KVSO_PARAMETER("widget", KVS_PT_HOBJECT, 0, hObject) KVSO_PARAMETERS_END(c) - pObject=KviKvsKernel::instance()->objectController()->lookupObject(hObject); + pObject = KviKvsKernel::instance()->objectController()->lookupObject(hObject); CHECK_HOBJECT_IS_WIDGET(pObject) - if (m_pAnimatedPixmap) + if(m_pAnimatedPixmap) { delete m_pAnimatedPixmap; - m_pAnimatedPixmap=0; + m_pAnimatedPixmap = 0; } - if (!m_pPixmap) - m_pPixmap=new QPixmap(); - *m_pPixmap=QPixmap::grabWidget(((KvsObject_widget *)pObject)->widget()); + if(!m_pPixmap) + m_pPixmap = new QPixmap(); + *m_pPixmap = QPixmap::grabWidget(((KvsObject_widget *)pObject)->widget()); return true; -/* FIXME UNUSED CODE + /* FIXME UNUSED CODE QString szFileName; KVSO_PARAMETERS_BEGIN(c) KVSO_PARAMETER("file_name",KVS_PT_STRING,0,szFileName) @@ -661,11 +703,11 @@ KVSO_CLASS_FUNCTION(pixmap,grabWidget) */ } -KVSO_CLASS_FUNCTION(pixmap,height) +KVSO_CLASS_FUNCTION(pixmap, height) { - if (m_currentType==Image && m_pImage) - c->returnValue()->setInteger(m_pImage->height()); - else if(m_currentType==Pixmap && m_pPixmap) + if(m_currentType == Image && m_pImage) + c->returnValue()->setInteger(m_pImage->height()); + else if(m_currentType == Pixmap && m_pPixmap) c->returnValue()->setInteger(m_pPixmap->height()); else c->returnValue()->setInteger(0); @@ -674,17 +716,17 @@ KVSO_CLASS_FUNCTION(pixmap,height) return true; } -KVSO_CLASS_FUNCTION(pixmap,width) +KVSO_CLASS_FUNCTION(pixmap, width) { - if (m_currentType==Image && m_pImage) + if(m_currentType == Image && m_pImage) c->returnValue()->setInteger(m_pImage->width()); - else if(m_currentType==Pixmap && m_pPixmap) + else if(m_currentType == Pixmap && m_pPixmap) c->returnValue()->setInteger(m_pPixmap->width()); else c->returnValue()->setInteger(0); //else if(m_pAnimatedPixmap) c->returnValue()->setInteger(m_pAnimatedPixmap->size().height()); //else c->returnValue()->setInteger(m_pPixmap->height()); - return true; + return true; } /*QPixmap * KvsObject_pixmap::getPixmap() @@ -693,15 +735,15 @@ KVSO_CLASS_FUNCTION(pixmap,width) else if(m_pAnimatedPixmap) return m_pAnimatedPixmap->pixmap(); else return m_pPixmap; }*/ -KVSO_CLASS_FUNCTION(pixmap,frameChangedEvent) +KVSO_CLASS_FUNCTION(pixmap, frameChangedEvent) { - emitSignal("frameChanged",c); + emitSignal("frameChanged", c); return true; } // slots void KvsObject_pixmap::frameChanged() { - KviKvsVariantList *params=0; - callFunction(this,"frameChangedEvent",params); + KviKvsVariantList * params = 0; + callFunction(this, "frameChangedEvent", params); } diff --git a/src/modules/objects/KvsObject_pixmap.h b/src/modules/objects/KvsObject_pixmap.h index 11c529d0b..35874f1f6 100644 --- a/src/modules/objects/KvsObject_pixmap.h +++ b/src/modules/objects/KvsObject_pixmap.h @@ -1,5 +1,5 @@ -#ifndef _CLASS_PIXMAP_H_ -#define _CLASS_PIXMAP_H_ +#ifndef _CLASS_PIXMAP_H_ +#define _CLASS_PIXMAP_H_ //============================================================================= // // File : KvsObject_pixmap.h @@ -25,33 +25,34 @@ // //============================================================================= - - #include #include #include #include "KviCString.h" - #include "object_macros.h" - class KvsObject_pixmap : public KviKvsObject { Q_OBJECT -// Q_PROPERTY(QPixmap pixmap READ getPixmap) + // Q_PROPERTY(QPixmap pixmap READ getPixmap) public: KVSO_DECLARE_OBJECT(KvsObject_pixmap) - enum Type { Pixmap, AnimatedPixmap, Image }; + enum Type + { + Pixmap, + AnimatedPixmap, + Image + }; Type m_currentType; - void setInternalPixmap(QPixmap *pPixmap); - void setInternalImage(QImage *pImage); + void setInternalPixmap(QPixmap * pPixmap); + void setInternalImage(QImage * pImage); QImage * getImage() { if(!m_pImage) m_pImage = new QImage(); - if(m_currentType==Pixmap) + if(m_currentType == Pixmap) { if(m_pPixmap) { @@ -68,7 +69,7 @@ public: { if(!m_pPixmap) m_pPixmap = new QPixmap(); - if(m_currentType==Image) + if(m_currentType == Image) { if(m_pImage) { @@ -87,28 +88,29 @@ protected: QImage * m_pImage; signals: void aboutToDie(); + protected: - bool fill(KviKvsObjectFunctionCall *c); - bool resize(KviKvsObjectFunctionCall *c); - bool scale(KviKvsObjectFunctionCall *c); + bool fill(KviKvsObjectFunctionCall * c); + bool resize(KviKvsObjectFunctionCall * c); + bool scale(KviKvsObjectFunctionCall * c); //bool rotate(KviKvsObjectFunctionCall *c); - bool save(KviKvsObjectFunctionCall *c); - bool startAnimation(KviKvsObjectFunctionCall *c); - bool stopAnimation(KviKvsObjectFunctionCall *c); - bool loadAnimation(KviKvsObjectFunctionCall *c); - bool load(KviKvsObjectFunctionCall *c); - bool height(KviKvsObjectFunctionCall *c); - bool width(KviKvsObjectFunctionCall *c); - bool mirrored(KviKvsObjectFunctionCall *c); - bool grabWidget(KviKvsObjectFunctionCall *c); - bool loadFromMemoryBuffer(KviKvsObjectFunctionCall *c); - bool rotate(KviKvsObjectFunctionCall *c); - bool toGrayScale(KviKvsObjectFunctionCall *c); - bool setPixel(KviKvsObjectFunctionCall *c); - bool pixel(KviKvsObjectFunctionCall *c); - bool frameChangedEvent(KviKvsObjectFunctionCall *c); + bool save(KviKvsObjectFunctionCall * c); + bool startAnimation(KviKvsObjectFunctionCall * c); + bool stopAnimation(KviKvsObjectFunctionCall * c); + bool loadAnimation(KviKvsObjectFunctionCall * c); + bool load(KviKvsObjectFunctionCall * c); + bool height(KviKvsObjectFunctionCall * c); + bool width(KviKvsObjectFunctionCall * c); + bool mirrored(KviKvsObjectFunctionCall * c); + bool grabWidget(KviKvsObjectFunctionCall * c); + bool loadFromMemoryBuffer(KviKvsObjectFunctionCall * c); + bool rotate(KviKvsObjectFunctionCall * c); + bool toGrayScale(KviKvsObjectFunctionCall * c); + bool setPixel(KviKvsObjectFunctionCall * c); + bool pixel(KviKvsObjectFunctionCall * c); + bool frameChangedEvent(KviKvsObjectFunctionCall * c); protected slots: void frameChanged(); }; -#endif // !_CLASS_PIXMAP_H_ +#endif // !_CLASS_PIXMAP_H_ diff --git a/src/modules/objects/KvsObject_popupMenu.cpp b/src/modules/objects/KvsObject_popupMenu.cpp index 8524c171c..9a5531835 100644 --- a/src/modules/objects/KvsObject_popupMenu.cpp +++ b/src/modules/objects/KvsObject_popupMenu.cpp @@ -23,7 +23,6 @@ // //============================================================================= - #include "KvsObject_popupMenu.h" #include "KviError.h" @@ -35,8 +34,6 @@ #include #include - - /* @doc: popupmenu @keyterms: @@ -165,28 +162,28 @@ [/example] */ -static QHash actionsDict; -static int iIdentifier=0; +static QHash actionsDict; +static int iIdentifier = 0; - -static int addActionToDict(QAction *pAction) +static int addActionToDict(QAction * pAction) { - actionsDict.insert(iIdentifier,pAction); + actionsDict.insert(iIdentifier, pAction); iIdentifier++; - return (iIdentifier-1); + return (iIdentifier - 1); } -static void removeMenuAllActions(QMenu *pMenu) +static void removeMenuAllActions(QMenu * pMenu) { - QList pActionsList=pMenu->actions(); - QList pActionsListDictValues=actionsDict.values(); - for(int i=0;i pActionsList = pMenu->actions(); + QList pActionsListDictValues = actionsDict.values(); + for(int i = 0; i < pActionsList.count(); i++) { - int iIdx=pActionsListDictValues.indexOf(pActionsList.at(i)); - if (iIdx>=0) actionsDict.remove(actionsDict.key(pActionsList.at(i))); + int iIdx = pActionsListDictValues.indexOf(pActionsList.at(i)); + if(iIdx >= 0) + actionsDict.remove(actionsDict.key(pActionsList.at(i))); } } -static QAction* getAction(int idx) +static QAction * getAction(int idx) { return actionsDict.value(idx); } @@ -195,76 +192,77 @@ static void removeAction(int idx) actionsDict.remove(idx); } +KVSO_BEGIN_REGISTERCLASS(KvsObject_popupMenu, "popupmenu", "widget") +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_popupMenu, insertItem) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_popupMenu, setTitle) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_popupMenu, exec) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_popupMenu, insertSeparator) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_popupMenu, removeItem) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_popupMenu, addMenu) -KVSO_BEGIN_REGISTERCLASS(KvsObject_popupMenu,"popupmenu","widget") - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_popupMenu,insertItem) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_popupMenu,setTitle) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_popupMenu,exec) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_popupMenu,insertSeparator) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_popupMenu,removeItem) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_popupMenu,addMenu) - - // events - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_popupMenu,highlightedEvent) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_popupMenu,activatedEvent) +// events +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_popupMenu, highlightedEvent) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_popupMenu, activatedEvent) KVSO_END_REGISTERCLASS(KvsObject_popupMenu) -KVSO_BEGIN_CONSTRUCTOR(KvsObject_popupMenu,KvsObject_widget) +KVSO_BEGIN_CONSTRUCTOR(KvsObject_popupMenu, KvsObject_widget) KVSO_END_CONSTRUCTOR(KvsObject_popupMenu) - KVSO_BEGIN_DESTRUCTOR(KvsObject_popupMenu) KVSO_END_DESTRUCTOR(KvsObject_popupMenu) -bool KvsObject_popupMenu::init(KviKvsRunTimeContext *,KviKvsVariantList *) +bool KvsObject_popupMenu::init(KviKvsRunTimeContext *, KviKvsVariantList *) { SET_OBJECT(QMenu) - connect(widget(),SIGNAL(triggered(QAction *)),this,SLOT(slottriggered(QAction *))); - connect(widget(),SIGNAL(destroyed(QObject *)),this,SLOT(aboutToDie(QObject *))); - connect(widget(),SIGNAL(hovered(QAction *)),this,SLOT(slothovered(QAction *))); + connect(widget(), SIGNAL(triggered(QAction *)), this, SLOT(slottriggered(QAction *))); + connect(widget(), SIGNAL(destroyed(QObject *)), this, SLOT(aboutToDie(QObject *))); + connect(widget(), SIGNAL(hovered(QAction *)), this, SLOT(slothovered(QAction *))); return true; } -KVSO_CLASS_FUNCTION(popupMenu,insertItem) +KVSO_CLASS_FUNCTION(popupMenu, insertItem) { CHECK_INTERNAL_POINTER(widget()) - QString szItem,szIcon; + QString szItem, szIcon; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("text",KVS_PT_STRING,0,szItem) - KVSO_PARAMETER("icon_id",KVS_PT_STRING,KVS_PF_OPTIONAL,szIcon) + KVSO_PARAMETER("text", KVS_PT_STRING, 0, szItem) + KVSO_PARAMETER("icon_id", KVS_PT_STRING, KVS_PF_OPTIONAL, szIcon) KVSO_PARAMETERS_END(c) - QPixmap *pix = 0; + QPixmap * pix = 0; QAction * pAction = 0; if(!szIcon.isEmpty()) { pix = g_pIconManager->getImage(szIcon); - if (pix) pAction=((QMenu *)widget())->addAction(*pix,szItem); - else c->warning(__tr2qs_ctx("Icon '%Q' doesn't exist","objects"),&szIcon); + if(pix) + pAction = ((QMenu *)widget())->addAction(*pix, szItem); + else + c->warning(__tr2qs_ctx("Icon '%Q' doesn't exist", "objects"), &szIcon); } else - pAction=((QMenu *)widget())->addAction(szItem); - int identifier=addActionToDict(pAction); + pAction = ((QMenu *)widget())->addAction(szItem); + int identifier = addActionToDict(pAction); c->returnValue()->setInteger((kvs_int_t)identifier); return true; } -KVSO_CLASS_FUNCTION(popupMenu,setTitle) +KVSO_CLASS_FUNCTION(popupMenu, setTitle) { QString szTitle; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("title",KVS_PT_STRING,0,szTitle) + KVSO_PARAMETER("title", KVS_PT_STRING, 0, szTitle) KVSO_PARAMETERS_END(c) - if(!widget())return true; + if(!widget()) + return true; ((QMenu *)widget())->setTitle(szTitle); return true; } -KVSO_CLASS_FUNCTION(popupMenu,exec) +KVSO_CLASS_FUNCTION(popupMenu, exec) { CHECK_INTERNAL_POINTER(widget()) if(!c->params()->count()) @@ -273,73 +271,73 @@ KVSO_CLASS_FUNCTION(popupMenu,exec) return true; } - KviKvsObject *pObject; - kvs_uint_t iX,iY; - QString szLabel,szIcon; + KviKvsObject * pObject; + kvs_uint_t iX, iY; + QString szLabel, szIcon; kvs_hobject_t hObject; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("widget",KVS_PT_HOBJECT,0,hObject) - KVSO_PARAMETER("x",KVS_PT_UNSIGNEDINTEGER,0,iX) - KVSO_PARAMETER("y",KVS_PT_UNSIGNEDINTEGER,0,iY) + KVSO_PARAMETER("widget", KVS_PT_HOBJECT, 0, hObject) + KVSO_PARAMETER("x", KVS_PT_UNSIGNEDINTEGER, 0, iX) + KVSO_PARAMETER("y", KVS_PT_UNSIGNEDINTEGER, 0, iY) KVSO_PARAMETERS_END(c) - pObject=KviKvsKernel::instance()->objectController()->lookupObject(hObject); + pObject = KviKvsKernel::instance()->objectController()->lookupObject(hObject); CHECK_HOBJECT_IS_WIDGET(pObject) - ((QMenu *)widget())->exec(((QWidget *)(pObject->object()))->mapToGlobal(QPoint(iX,iY)) ); + ((QMenu *)widget())->exec(((QWidget *)(pObject->object()))->mapToGlobal(QPoint(iX, iY))); return true; } - - -KVSO_CLASS_FUNCTION(popupMenu,addMenu) +KVSO_CLASS_FUNCTION(popupMenu, addMenu) { CHECK_INTERNAL_POINTER(widget()) - KviKvsObject *pObject; + KviKvsObject * pObject; kvs_uint_t iIdx; kvs_hobject_t hObject; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("popupmenu",KVS_PT_HOBJECT,0,hObject) - KVSO_PARAMETER("index",KVS_PT_UNSIGNEDINTEGER,KVS_PF_OPTIONAL,iIdx) + KVSO_PARAMETER("popupmenu", KVS_PT_HOBJECT, 0, hObject) + KVSO_PARAMETER("index", KVS_PT_UNSIGNEDINTEGER, KVS_PF_OPTIONAL, iIdx) KVSO_PARAMETERS_END(c) - pObject=KviKvsKernel::instance()->objectController()->lookupObject(hObject); - if (!pObject) + pObject = KviKvsKernel::instance()->objectController()->lookupObject(hObject); + if(!pObject) { - c->warning(__tr2qs_ctx("Popup menu parameter is not an object","objects")); + c->warning(__tr2qs_ctx("Popup menu parameter is not an object", "objects")); return true; } - if (!pObject->object()) + if(!pObject->object()) { - c->warning(__tr2qs_ctx("Popup menu parameter is not a valid object","objects")); + c->warning(__tr2qs_ctx("Popup menu parameter is not a valid object", "objects")); return true; } if(!pObject->inheritsClass("popupmenu")) { - c->warning(__tr2qs_ctx("Popupmenu object required","objects")); + c->warning(__tr2qs_ctx("Popupmenu object required", "objects")); return true; } - QAction *pAction; + QAction * pAction; if(iIdx) { - QAction *pActionBefore=actionsDict[iIdx]; - pAction=((QMenu *)widget())->insertMenu(pActionBefore,(QMenu*)pObject->object()); - } else { - pAction=((QMenu *)widget())->addMenu((QMenu*)pObject->object()); + QAction * pActionBefore = actionsDict[iIdx]; + pAction = ((QMenu *)widget())->insertMenu(pActionBefore, (QMenu *)pObject->object()); + } + else + { + pAction = ((QMenu *)widget())->addMenu((QMenu *)pObject->object()); } - int identifier=addActionToDict(pAction); + int identifier = addActionToDict(pAction); c->returnValue()->setInteger((kvs_int_t)identifier); identifier++; return true; } -KVSO_CLASS_FUNCTION(popupMenu,removeItem) +KVSO_CLASS_FUNCTION(popupMenu, removeItem) { CHECK_INTERNAL_POINTER(widget()) kvs_int_t iIdx; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("item_id",KVS_PT_INTEGER,0,iIdx) + KVSO_PARAMETER("item_id", KVS_PT_INTEGER, 0, iIdx) KVSO_PARAMETERS_END(c) - QAction * pAction=getAction(iIdx); + QAction * pAction = getAction(iIdx); if(pAction) { ((QMenu *)widget())->removeAction(pAction); @@ -348,29 +346,29 @@ KVSO_CLASS_FUNCTION(popupMenu,removeItem) return true; } -KVSO_CLASS_FUNCTION(popupMenu,insertSeparator) +KVSO_CLASS_FUNCTION(popupMenu, insertSeparator) { CHECK_INTERNAL_POINTER(widget()) kvs_uint_t iIndex; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("index",KVS_PT_UNSIGNEDINTEGER,0,iIndex) + KVSO_PARAMETER("index", KVS_PT_UNSIGNEDINTEGER, 0, iIndex) KVSO_PARAMETERS_END(c) - QAction * pAction=getAction(iIndex); + QAction * pAction = getAction(iIndex); if(pAction) - ((QMenu *)widget())->insertSeparator(pAction); + ((QMenu *)widget())->insertSeparator(pAction); return true; } -void KvsObject_popupMenu::slothovered(QAction *a) +void KvsObject_popupMenu::slothovered(QAction * a) { QHashIterator i(actionsDict); - bool bFound=false; - while (i.hasNext()) + bool bFound = false; + while(i.hasNext()) { i.next(); - if (i.value()== a) + if(i.value() == a) { - bFound=true; + bFound = true; break; } } @@ -379,30 +377,30 @@ void KvsObject_popupMenu::slothovered(QAction *a) if(bFound) { KviKvsVariantList params(new KviKvsVariant((kvs_int_t)i.key())); - callFunction(this,"highlightedEvent",¶ms); + callFunction(this, "highlightedEvent", ¶ms); } } -void KvsObject_popupMenu::aboutToDie(QObject *pObject) +void KvsObject_popupMenu::aboutToDie(QObject * pObject) { qDebug("Removing popup from kvs dict"); removeMenuAllActions((QMenu *)pObject); } -KVSO_CLASS_FUNCTION(popupMenu,highlightedEvent) +KVSO_CLASS_FUNCTION(popupMenu, highlightedEvent) { - emitSignal("highlighted",c,c->params()); + emitSignal("highlighted", c, c->params()); return true; } -void KvsObject_popupMenu::slottriggered(QAction *a) +void KvsObject_popupMenu::slottriggered(QAction * a) { QHashIterator i(actionsDict); - bool bFound=false; - while (i.hasNext()) + bool bFound = false; + while(i.hasNext()) { i.next(); - if (i.value()== a) + if(i.value() == a) { - bFound=true; + bFound = true; break; } } @@ -411,12 +409,12 @@ void KvsObject_popupMenu::slottriggered(QAction *a) if(bFound) { KviKvsVariantList params(new KviKvsVariant((kvs_int_t)i.key())); - callFunction(this,"activatedEvent",¶ms); + callFunction(this, "activatedEvent", ¶ms); } } -KVSO_CLASS_FUNCTION(popupMenu,activatedEvent) +KVSO_CLASS_FUNCTION(popupMenu, activatedEvent) { - emitSignal("activated",c,c->params()); + emitSignal("activated", c, c->params()); return true; } diff --git a/src/modules/objects/KvsObject_popupMenu.h b/src/modules/objects/KvsObject_popupMenu.h index 799f8f9ce..67624bf72 100644 --- a/src/modules/objects/KvsObject_popupMenu.h +++ b/src/modules/objects/KvsObject_popupMenu.h @@ -25,15 +25,11 @@ // //============================================================================= - #include "KvsObject_widget.h" #include "object_macros.h" #include #include - - - class KvsObject_popupMenu : public KvsObject_widget { Q_OBJECT @@ -42,17 +38,17 @@ public: public: QWidget * widget() { return (QWidget *)object(); }; protected: - virtual bool init(KviKvsRunTimeContext * pContext,KviKvsVariantList *pParams); - - bool insertItem(KviKvsObjectFunctionCall *c); - bool setTitle(KviKvsObjectFunctionCall *c); - bool addMenu(KviKvsObjectFunctionCall *c); - bool exec(KviKvsObjectFunctionCall *c); - bool removeItem(KviKvsObjectFunctionCall *c); - bool removeItemAt(KviKvsObjectFunctionCall *c); - bool insertSeparator(KviKvsObjectFunctionCall *c); - bool activatedEvent(KviKvsObjectFunctionCall *c); - bool highlightedEvent(KviKvsObjectFunctionCall *c); + virtual bool init(KviKvsRunTimeContext * pContext, KviKvsVariantList * pParams); + + bool insertItem(KviKvsObjectFunctionCall * c); + bool setTitle(KviKvsObjectFunctionCall * c); + bool addMenu(KviKvsObjectFunctionCall * c); + bool exec(KviKvsObjectFunctionCall * c); + bool removeItem(KviKvsObjectFunctionCall * c); + bool removeItemAt(KviKvsObjectFunctionCall * c); + bool insertSeparator(KviKvsObjectFunctionCall * c); + bool activatedEvent(KviKvsObjectFunctionCall * c); + bool highlightedEvent(KviKvsObjectFunctionCall * c); protected slots: void slottriggered(QAction *); @@ -60,4 +56,4 @@ protected slots: void aboutToDie(QObject *); }; -#endif // !_CLASS_POPUPMENU_H_ +#endif // !_CLASS_POPUPMENU_H_ diff --git a/src/modules/objects/KvsObject_process.cpp b/src/modules/objects/KvsObject_process.cpp index d58ec3f64..73a8ed92a 100644 --- a/src/modules/objects/KvsObject_process.cpp +++ b/src/modules/objects/KvsObject_process.cpp @@ -162,56 +162,53 @@ This signal is emitted by the default implementation of [classfnc]$readyReadStderrEvent[/classfnc](). */ -KVSO_BEGIN_REGISTERCLASS(KvsObject_process,"process","object") +KVSO_BEGIN_REGISTERCLASS(KvsObject_process, "process", "object") - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_process,addArgument); - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_process,startProcess); - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_process,readStdout); - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_process,readStderr); - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_process,writeToStdin); - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_process,closekill); - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_process,kill); - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_process,tryTerminate); - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_process,closeStdin); - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_process,isRunning); - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_process,normalExit); +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_process, addArgument); +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_process, startProcess); +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_process, readStdout); +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_process, readStderr); +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_process, writeToStdin); +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_process, closekill); +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_process, kill); +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_process, tryTerminate); +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_process, closeStdin); +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_process, isRunning); +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_process, normalExit); - // Events - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_process,readyReadStdoutEvent); - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_process,readyReadStderrEvent); +// Events +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_process, readyReadStdoutEvent); +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_process, readyReadStderrEvent); - KVSO_END_REGISTERCLASS(KvsObject_process) +KVSO_END_REGISTERCLASS(KvsObject_process) +KVSO_BEGIN_CONSTRUCTOR(KvsObject_process, KviKvsObject) -KVSO_BEGIN_CONSTRUCTOR(KvsObject_process,KviKvsObject) - - m_pProcess = new QProcess(); - connect(m_pProcess,SIGNAL(readyReadStandardOutput()),this,SLOT(slotReadStdout())); - connect(m_pProcess,SIGNAL(readyReadStandardError()),this,SLOT(slotReadStderr())); +m_pProcess = new QProcess(); +connect(m_pProcess, SIGNAL(readyReadStandardOutput()), this, SLOT(slotReadStdout())); +connect(m_pProcess, SIGNAL(readyReadStandardError()), this, SLOT(slotReadStderr())); KVSO_END_CONSTRUCTOR(KvsObject_process) KVSO_BEGIN_DESTRUCTOR(KvsObject_process) - delete m_pProcess; +delete m_pProcess; KVSO_END_CONSTRUCTOR(KvsObject_process) - - -KVSO_CLASS_FUNCTION(process,addArgument) +KVSO_CLASS_FUNCTION(process, addArgument) { QString szArgument; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("argument",KVS_PT_NONEMPTYSTRING,0,szArgument) + KVSO_PARAMETER("argument", KVS_PT_NONEMPTYSTRING, 0, szArgument) KVSO_PARAMETERS_END(c) m_szArgs.append(szArgument); return true; } //->Start the process. -KVSO_CLASS_FUNCTION(process,startProcess) +KVSO_CLASS_FUNCTION(process, startProcess) { CHECK_INTERNAL_POINTER(m_pProcess) QString szcmd; @@ -219,14 +216,14 @@ KVSO_CLASS_FUNCTION(process,startProcess) szcmd = m_szArgs.takeFirst(); m_pProcess->start(szcmd, m_szArgs); - if(m_pProcess->state()==QProcess::NotRunning) + if(m_pProcess->state() == QProcess::NotRunning) { - c->warning( __tr2qs_ctx("Process could not be started.","objects")); + c->warning(__tr2qs_ctx("Process could not be started.", "objects")); } return true; } //-->Read the standard output. -KVSO_CLASS_FUNCTION(process,readStderr) +KVSO_CLASS_FUNCTION(process, readStderr) { CHECK_INTERNAL_POINTER(m_pProcess) QString ng_Process = m_pProcess->readAllStandardError(); @@ -235,87 +232,88 @@ KVSO_CLASS_FUNCTION(process,readStderr) } //-->Read the standard error. -KVSO_CLASS_FUNCTION(process,readStdout) +KVSO_CLASS_FUNCTION(process, readStdout) { CHECK_INTERNAL_POINTER(m_pProcess) - QString ng_Process =m_pProcess->readAllStandardOutput(); + QString ng_Process = m_pProcess->readAllStandardOutput(); c->returnValue()->setString(ng_Process); return true; } //-->Signals and slot to manage reading output and error from the process. -KVSO_CLASS_FUNCTION(process,readyReadStdoutEvent) +KVSO_CLASS_FUNCTION(process, readyReadStdoutEvent) { - emitSignal("readyReadStdout",c); + emitSignal("readyReadStdout", c); return true; } -KVSO_CLASS_FUNCTION(process,readyReadStderrEvent) +KVSO_CLASS_FUNCTION(process, readyReadStderrEvent) { - emitSignal("readyReadStderr",c); + emitSignal("readyReadStderr", c); return true; } -KVSO_CLASS_FUNCTION(process,writeToStdin) +KVSO_CLASS_FUNCTION(process, writeToStdin) { CHECK_INTERNAL_POINTER(m_pProcess) QString szCommand; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("command",KVS_PT_STRING,0,szCommand) + KVSO_PARAMETER("command", KVS_PT_STRING, 0, szCommand) KVSO_PARAMETERS_END(c) - if (m_pProcess) m_pProcess->write(szCommand.toUtf8().data()); + if(m_pProcess) + m_pProcess->write(szCommand.toUtf8().data()); return true; } //-->The 3 Closing process functions -KVSO_CLASS_FUNCTION(process,closekill) +KVSO_CLASS_FUNCTION(process, closekill) { CHECK_INTERNAL_POINTER(m_pProcess) //I try to to terminate the process the nice way.... m_pProcess->terminate(); //If the process is still running after 5 seconds, I'll terminate the process in the hard way. - QTimer::singleShot( 5000, m_pProcess, SLOT( kill() ) ); + QTimer::singleShot(5000, m_pProcess, SLOT(kill())); return true; } -KVSO_CLASS_FUNCTION(process,kill) +KVSO_CLASS_FUNCTION(process, kill) { CHECK_INTERNAL_POINTER(m_pProcess) m_pProcess->kill(); return true; } -KVSO_CLASS_FUNCTION(process,tryTerminate) +KVSO_CLASS_FUNCTION(process, tryTerminate) { CHECK_INTERNAL_POINTER(m_pProcess) m_pProcess->terminate(); return true; } //-->Close the standard input. -KVSO_CLASS_FUNCTION(process,closeStdin) +KVSO_CLASS_FUNCTION(process, closeStdin) { CHECK_INTERNAL_POINTER(m_pProcess) m_pProcess->closeReadChannel(QProcess::StandardOutput); return true; } //->Returns if the process still runnig -KVSO_CLASS_FUNCTION(process,isRunning) +KVSO_CLASS_FUNCTION(process, isRunning) { CHECK_INTERNAL_POINTER(m_pProcess) - c->returnValue()->setBoolean(m_pProcess->state()==QProcess::Running); + c->returnValue()->setBoolean(m_pProcess->state() == QProcess::Running); return true; } //->Returns if the process exited. -KVSO_CLASS_FUNCTION(process,normalExit) +KVSO_CLASS_FUNCTION(process, normalExit) { CHECK_INTERNAL_POINTER(m_pProcess) - c->returnValue()->setBoolean(m_pProcess->state()==QProcess::NotRunning && m_pProcess->exitStatus()==QProcess::NormalExit); + c->returnValue()->setBoolean(m_pProcess->state() == QProcess::NotRunning && m_pProcess->exitStatus() == QProcess::NormalExit); return true; } void KvsObject_process::slotReadStdout() { - KviKvsVariantList *params=0; - callFunction(this,"readyReadStdoutEvent",params); + KviKvsVariantList * params = 0; + callFunction(this, "readyReadStdoutEvent", params); } void KvsObject_process::slotReadStderr() { - KviKvsVariantList *params=0; - callFunction(this,"readyReadStderrEvent",params); + KviKvsVariantList * params = 0; + callFunction(this, "readyReadStderrEvent", params); } diff --git a/src/modules/objects/KvsObject_process.h b/src/modules/objects/KvsObject_process.h index 0124c6e4c..86451c2a8 100644 --- a/src/modules/objects/KvsObject_process.h +++ b/src/modules/objects/KvsObject_process.h @@ -25,15 +25,12 @@ // //============================================================================= - #include #include "KvsObject_widget.h" - #include "object_macros.h" #include "QProcess" - class KvsObject_process : public KviKvsObject { Q_OBJECT @@ -41,29 +38,29 @@ public: KVSO_DECLARE_OBJECT(KvsObject_process) protected: QProcess * m_pProcess; + private: - QStringList m_szArgs; -public: + QStringList m_szArgs; - bool addArgument(KviKvsObjectFunctionCall *c); - bool startProcess(KviKvsObjectFunctionCall *c); - bool readStdout(KviKvsObjectFunctionCall *c); - bool readStderr(KviKvsObjectFunctionCall *c); - bool writeToStdin(KviKvsObjectFunctionCall *c); - bool closekill(KviKvsObjectFunctionCall *c); - bool closeStdin(KviKvsObjectFunctionCall *c); - bool kill(KviKvsObjectFunctionCall *c); - bool tryTerminate(KviKvsObjectFunctionCall *c); - bool normalExit(KviKvsObjectFunctionCall *c); - bool isRunning(KviKvsObjectFunctionCall *c); +public: + bool addArgument(KviKvsObjectFunctionCall * c); + bool startProcess(KviKvsObjectFunctionCall * c); + bool readStdout(KviKvsObjectFunctionCall * c); + bool readStderr(KviKvsObjectFunctionCall * c); + bool writeToStdin(KviKvsObjectFunctionCall * c); + bool closekill(KviKvsObjectFunctionCall * c); + bool closeStdin(KviKvsObjectFunctionCall * c); + bool kill(KviKvsObjectFunctionCall * c); + bool tryTerminate(KviKvsObjectFunctionCall * c); + bool normalExit(KviKvsObjectFunctionCall * c); + bool isRunning(KviKvsObjectFunctionCall * c); - bool readyReadStdoutEvent(KviKvsObjectFunctionCall *c); - bool readyReadStderrEvent(KviKvsObjectFunctionCall *c); + bool readyReadStdoutEvent(KviKvsObjectFunctionCall * c); + bool readyReadStderrEvent(KviKvsObjectFunctionCall * c); protected slots: void slotReadStdout(); void slotReadStderr(); }; - -#endif // !_CLASS_PROCESS_H_ +#endif // !_CLASS_PROCESS_H_ diff --git a/src/modules/objects/KvsObject_progressBar.cpp b/src/modules/objects/KvsObject_progressBar.cpp index 43335eef3..5acf3a5a4 100644 --- a/src/modules/objects/KvsObject_progressBar.cpp +++ b/src/modules/objects/KvsObject_progressBar.cpp @@ -64,80 +64,78 @@ See also [classfnc]$setPercentageVisible[/classfnc]() */ -KVSO_BEGIN_REGISTERCLASS(KvsObject_progressBar,"progressbar","widget") - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_progressBar,setProgress) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_progressBar,setFormat) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_progressBar,setTotalSteps) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_progressBar,reset) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_progressBar,setPercentageVisible) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_progressBar,percentageVisible) +KVSO_BEGIN_REGISTERCLASS(KvsObject_progressBar, "progressbar", "widget") +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_progressBar, setProgress) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_progressBar, setFormat) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_progressBar, setTotalSteps) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_progressBar, reset) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_progressBar, setPercentageVisible) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_progressBar, percentageVisible) KVSO_END_REGISTERCLASS(KvsObject_progressBar) -KVSO_BEGIN_CONSTRUCTOR(KvsObject_progressBar,KvsObject_widget) +KVSO_BEGIN_CONSTRUCTOR(KvsObject_progressBar, KvsObject_widget) KVSO_END_CONSTRUCTOR(KvsObject_progressBar) - KVSO_BEGIN_DESTRUCTOR(KvsObject_progressBar) KVSO_END_CONSTRUCTOR(KvsObject_progressBar) -bool KvsObject_progressBar::init(KviKvsRunTimeContext *,KviKvsVariantList *) +bool KvsObject_progressBar::init(KviKvsRunTimeContext *, KviKvsVariantList *) { - SET_OBJECT (QProgressBar) + SET_OBJECT(QProgressBar) return true; } -KVSO_CLASS_FUNCTION(progressBar,setProgress) +KVSO_CLASS_FUNCTION(progressBar, setProgress) { CHECK_INTERNAL_POINTER(widget()) kvs_uint_t iValue; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("step_value",KVS_PT_UNSIGNEDINTEGER,0,iValue) + KVSO_PARAMETER("step_value", KVS_PT_UNSIGNEDINTEGER, 0, iValue) KVSO_PARAMETERS_END(c) ((QProgressBar *)widget())->setValue(iValue); return true; } -KVSO_CLASS_FUNCTION(progressBar,setTotalSteps) +KVSO_CLASS_FUNCTION(progressBar, setTotalSteps) { CHECK_INTERNAL_POINTER(widget()) kvs_uint_t iMax; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("total_steps",KVS_PT_UNSIGNEDINTEGER,0,iMax) + KVSO_PARAMETER("total_steps", KVS_PT_UNSIGNEDINTEGER, 0, iMax) KVSO_PARAMETERS_END(c) ((QProgressBar *)widget())->setMaximum(iMax); return true; } -KVSO_CLASS_FUNCTION(progressBar,reset) +KVSO_CLASS_FUNCTION(progressBar, reset) { CHECK_INTERNAL_POINTER(widget()) ((QProgressBar *)widget())->reset(); return true; } - -KVSO_CLASS_FUNCTION(progressBar,setPercentageVisible) +KVSO_CLASS_FUNCTION(progressBar, setPercentageVisible) { CHECK_INTERNAL_POINTER(widget()) bool bEnabled; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("bEnabled",KVS_PT_BOOL,0,bEnabled) + KVSO_PARAMETER("bEnabled", KVS_PT_BOOL, 0, bEnabled) KVSO_PARAMETERS_END(c) ((QProgressBar *)widget())->setTextVisible(bEnabled); return true; } -KVSO_CLASS_FUNCTION(progressBar,setFormat) +KVSO_CLASS_FUNCTION(progressBar, setFormat) { CHECK_INTERNAL_POINTER(widget()) QString szFormat; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("bEnabled",KVS_PT_STRING,0,szFormat) + KVSO_PARAMETER("bEnabled", KVS_PT_STRING, 0, szFormat) KVSO_PARAMETERS_END(c) ((QProgressBar *)widget())->setFormat(szFormat); return true; } -KVSO_CLASS_FUNCTION(progressBar,percentageVisible) +KVSO_CLASS_FUNCTION(progressBar, percentageVisible) { CHECK_INTERNAL_POINTER(widget()) c->returnValue()->setBoolean(((QProgressBar *)widget())->isTextVisible()); diff --git a/src/modules/objects/KvsObject_progressBar.h b/src/modules/objects/KvsObject_progressBar.h index c22fa1116..4a957ae20 100644 --- a/src/modules/objects/KvsObject_progressBar.h +++ b/src/modules/objects/KvsObject_progressBar.h @@ -25,7 +25,6 @@ // //============================================================================= - #include "KvsObject_widget.h" #include "object_macros.h" @@ -36,15 +35,14 @@ public: public: QWidget * widget() { return (QWidget *)object(); }; protected: - virtual bool init(KviKvsRunTimeContext * pContext,KviKvsVariantList *pParams); + virtual bool init(KviKvsRunTimeContext * pContext, KviKvsVariantList * pParams); - bool setProgress(KviKvsObjectFunctionCall *c); - bool setTotalSteps(KviKvsObjectFunctionCall *c); - bool reset(KviKvsObjectFunctionCall *c); - bool setPercentageVisible(KviKvsObjectFunctionCall *c); - bool percentageVisible(KviKvsObjectFunctionCall *c); - bool setFormat(KviKvsObjectFunctionCall *c); + bool setProgress(KviKvsObjectFunctionCall * c); + bool setTotalSteps(KviKvsObjectFunctionCall * c); + bool reset(KviKvsObjectFunctionCall * c); + bool setPercentageVisible(KviKvsObjectFunctionCall * c); + bool percentageVisible(KviKvsObjectFunctionCall * c); + bool setFormat(KviKvsObjectFunctionCall * c); }; - -#endif //!_CLASS_PROGRESSBAR_H_ +#endif //!_CLASS_PROGRESSBAR_H_ diff --git a/src/modules/objects/KvsObject_radioButton.cpp b/src/modules/objects/KvsObject_radioButton.cpp index 05d732224..123b734f0 100644 --- a/src/modules/objects/KvsObject_radioButton.cpp +++ b/src/modules/objects/KvsObject_radioButton.cpp @@ -62,77 +62,77 @@ This signal is emitted by the default implementation of [classfnc]$toggleEvent[/classfnc]().[br] */ -KVSO_BEGIN_REGISTERCLASS(KvsObject_radioButton,"radiobutton","widget") +KVSO_BEGIN_REGISTERCLASS(KvsObject_radioButton, "radiobutton", "widget") - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_radioButton,setText) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_radioButton,setChecked) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_radioButton,isChecked) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_radioButton,setImage) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_radioButton,toggleEvent) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_radioButton, setText) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_radioButton, setChecked) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_radioButton, isChecked) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_radioButton, setImage) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_radioButton, toggleEvent) KVSO_END_REGISTERCLASS(KvsObject_radioButton) -KVSO_BEGIN_CONSTRUCTOR(KvsObject_radioButton,KvsObject_widget) +KVSO_BEGIN_CONSTRUCTOR(KvsObject_radioButton, KvsObject_widget) KVSO_END_CONSTRUCTOR(KvsObject_radioButton) - KVSO_BEGIN_DESTRUCTOR(KvsObject_radioButton) KVSO_END_CONSTRUCTOR(KvsObject_radioButton) -bool KvsObject_radioButton::init(KviKvsRunTimeContext *,KviKvsVariantList *) +bool KvsObject_radioButton::init(KviKvsRunTimeContext *, KviKvsVariantList *) { SET_OBJECT(QRadioButton) - connect(widget(),SIGNAL(toggled(bool)),this,SLOT(toggled(bool))); + connect(widget(), SIGNAL(toggled(bool)), this, SLOT(toggled(bool))); return true; } -KVSO_CLASS_FUNCTION(radioButton,setText) +KVSO_CLASS_FUNCTION(radioButton, setText) { CHECK_INTERNAL_POINTER(widget()) QString szText; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("text",KVS_PT_STRING,0,szText) + KVSO_PARAMETER("text", KVS_PT_STRING, 0, szText) KVSO_PARAMETERS_END(c) ((QRadioButton *)widget())->setText(szText); return true; } -KVSO_CLASS_FUNCTION(radioButton,isChecked) +KVSO_CLASS_FUNCTION(radioButton, isChecked) { CHECK_INTERNAL_POINTER(widget()) c->returnValue()->setBoolean(((QRadioButton *)widget())->isChecked()); return true; } -KVSO_CLASS_FUNCTION(radioButton,setChecked) +KVSO_CLASS_FUNCTION(radioButton, setChecked) { CHECK_INTERNAL_POINTER(widget()) bool bChecked; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("bChecked",KVS_PT_BOOL,0,bChecked) + KVSO_PARAMETER("bChecked", KVS_PT_BOOL, 0, bChecked) KVSO_PARAMETERS_END(c) ((QRadioButton *)widget())->setChecked(bChecked); return true; } -KVSO_CLASS_FUNCTION(radioButton,setImage) +KVSO_CLASS_FUNCTION(radioButton, setImage) { CHECK_INTERNAL_POINTER(widget()) QString icon; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("icon_id",KVS_PT_STRING,0,icon) + KVSO_PARAMETER("icon_id", KVS_PT_STRING, 0, icon) KVSO_PARAMETERS_END(c) QPixmap * pix = g_pIconManager->getImage(icon); - if(pix)((QRadioButton *)widget())->setIcon(*pix); + if(pix) + ((QRadioButton *)widget())->setIcon(*pix); return true; } -KVSO_CLASS_FUNCTION(radioButton,toggleEvent) +KVSO_CLASS_FUNCTION(radioButton, toggleEvent) { - emitSignal("toggled",c,c->params()); + emitSignal("toggled", c, c->params()); return true; } void KvsObject_radioButton::toggled(bool b) { KviKvsVariantList params(new KviKvsVariant(b)); - callFunction(this,"toggleEvent",¶ms); + callFunction(this, "toggleEvent", ¶ms); } diff --git a/src/modules/objects/KvsObject_radioButton.h b/src/modules/objects/KvsObject_radioButton.h index 96c65d8b3..b57cd3801 100644 --- a/src/modules/objects/KvsObject_radioButton.h +++ b/src/modules/objects/KvsObject_radioButton.h @@ -36,16 +36,15 @@ public: public: QWidget * widget() { return (QWidget *)object(); }; protected: - virtual bool init(KviKvsRunTimeContext * pContext,KviKvsVariantList *pParams); + virtual bool init(KviKvsRunTimeContext * pContext, KviKvsVariantList * pParams); - bool setText(KviKvsObjectFunctionCall *c); - bool isChecked(KviKvsObjectFunctionCall *c); - bool setChecked(KviKvsObjectFunctionCall *c); - bool setImage(KviKvsObjectFunctionCall *c); - bool toggleEvent(KviKvsObjectFunctionCall *c); + bool setText(KviKvsObjectFunctionCall * c); + bool isChecked(KviKvsObjectFunctionCall * c); + bool setChecked(KviKvsObjectFunctionCall * c); + bool setImage(KviKvsObjectFunctionCall * c); + bool toggleEvent(KviKvsObjectFunctionCall * c); protected slots: void toggled(bool b); - }; -#endif //!_CLASS_RADIOBUTTON_H_ +#endif //!_CLASS_RADIOBUTTON_H_ diff --git a/src/modules/objects/KvsObject_slider.cpp b/src/modules/objects/KvsObject_slider.cpp index 3eac95140..73b71937e 100644 --- a/src/modules/objects/KvsObject_slider.cpp +++ b/src/modules/objects/KvsObject_slider.cpp @@ -98,196 +98,194 @@ If you reimplement that function you will have to emit the signal manually (if you still need it). */ -KVSO_BEGIN_REGISTERCLASS(KvsObject_slider,"slider","widget") +KVSO_BEGIN_REGISTERCLASS(KvsObject_slider, "slider", "widget") +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_slider, setTracking); +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_slider, setValue); +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_slider, setMinValue); +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_slider, setMaxValue); +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_slider, setLineStep); +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_slider, setPageStep); +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_slider, setTickInterval); +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_slider, value); +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_slider, minValue); +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_slider, maxValue); +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_slider, lineStep); +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_slider, pageStep); +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_slider, setTickmarks); +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_slider, setOrientation); - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_slider,setTracking); - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_slider,setValue); - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_slider,setMinValue); - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_slider,setMaxValue); - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_slider,setLineStep); - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_slider,setPageStep); - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_slider,setTickInterval); - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_slider,value); - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_slider,minValue); - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_slider,maxValue); - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_slider,lineStep); - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_slider,pageStep); - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_slider,setTickmarks); - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_slider,setOrientation); - - - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_slider,valueChangedEvent); +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_slider, valueChangedEvent); KVSO_END_REGISTERCLASS(KvsObject_slider) -KVSO_BEGIN_CONSTRUCTOR(KvsObject_slider,KvsObject_widget) +KVSO_BEGIN_CONSTRUCTOR(KvsObject_slider, KvsObject_widget) KVSO_END_CONSTRUCTOR(KvsObject_slider) - KVSO_BEGIN_DESTRUCTOR(KvsObject_slider) KVSO_END_CONSTRUCTOR(KvsObject_slider) -bool KvsObject_slider::init(KviKvsRunTimeContext *,KviKvsVariantList *) +bool KvsObject_slider::init(KviKvsRunTimeContext *, KviKvsVariantList *) { SET_OBJECT(QSlider) - connect(widget(),SIGNAL(valueChanged(int)),this,SLOT(valueChanged(int))); + connect(widget(), SIGNAL(valueChanged(int)), this, SLOT(valueChanged(int))); return true; } -KVSO_CLASS_FUNCTION(slider,setTracking) +KVSO_CLASS_FUNCTION(slider, setTracking) { CHECK_INTERNAL_POINTER(widget()) bool bEnabled; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("bEnabled",KVS_PT_BOOL,0,bEnabled) + KVSO_PARAMETER("bEnabled", KVS_PT_BOOL, 0, bEnabled) KVSO_PARAMETERS_END(c) ((QSlider *)widget())->setTracking(bEnabled); return true; } - -KVSO_CLASS_FUNCTION(slider,setValue) +KVSO_CLASS_FUNCTION(slider, setValue) { CHECK_INTERNAL_POINTER(widget()) kvs_int_t iValue; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("value",KVS_PT_INT,0,iValue) + KVSO_PARAMETER("value", KVS_PT_INT, 0, iValue) KVSO_PARAMETERS_END(c) ((QSlider *)widget())->setValue(iValue); return true; } -KVSO_CLASS_FUNCTION(slider,setMinValue) +KVSO_CLASS_FUNCTION(slider, setMinValue) { CHECK_INTERNAL_POINTER(widget()) kvs_int_t iMinvalue; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("minimum_value",KVS_PT_INT,0,iMinvalue) + KVSO_PARAMETER("minimum_value", KVS_PT_INT, 0, iMinvalue) KVSO_PARAMETERS_END(c) ((QSlider *)widget())->setMinimum(iMinvalue); return true; } -KVSO_CLASS_FUNCTION(slider,setMaxValue) +KVSO_CLASS_FUNCTION(slider, setMaxValue) { CHECK_INTERNAL_POINTER(widget()) kvs_int_t iMaxvalue; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("max_value",KVS_PT_INT,0,iMaxvalue) + KVSO_PARAMETER("max_value", KVS_PT_INT, 0, iMaxvalue) KVSO_PARAMETERS_END(c) ((QSlider *)widget())->setMaximum(iMaxvalue); return true; } -KVSO_CLASS_FUNCTION(slider,setLineStep) +KVSO_CLASS_FUNCTION(slider, setLineStep) { CHECK_INTERNAL_POINTER(widget()) kvs_int_t iLinestep; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("line_step",KVS_PT_INT,0,iLinestep) + KVSO_PARAMETER("line_step", KVS_PT_INT, 0, iLinestep) KVSO_PARAMETERS_END(c) ((QSlider *)widget())->setSingleStep(iLinestep); return true; } -KVSO_CLASS_FUNCTION(slider,setPageStep) +KVSO_CLASS_FUNCTION(slider, setPageStep) { CHECK_INTERNAL_POINTER(widget()) kvs_int_t iPagestep; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("page_step",KVS_PT_INT,0,iPagestep) + KVSO_PARAMETER("page_step", KVS_PT_INT, 0, iPagestep) KVSO_PARAMETERS_END(c) - if (widget()) ((QSlider *)widget())->setPageStep(iPagestep); + if(widget()) + ((QSlider *)widget())->setPageStep(iPagestep); return true; } -KVSO_CLASS_FUNCTION(slider,setTickInterval) +KVSO_CLASS_FUNCTION(slider, setTickInterval) { kvs_int_t iInterval; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("tick_interval",KVS_PT_INT,0,iInterval) + KVSO_PARAMETER("tick_interval", KVS_PT_INT, 0, iInterval) KVSO_PARAMETERS_END(c) ((QSlider *)widget())->setTickInterval(iInterval); return true; } -KVSO_CLASS_FUNCTION(slider,value) +KVSO_CLASS_FUNCTION(slider, value) { CHECK_INTERNAL_POINTER(widget()) c->returnValue()->setInteger(((QSlider *)widget())->value()); return true; } -KVSO_CLASS_FUNCTION(slider,minValue) +KVSO_CLASS_FUNCTION(slider, minValue) { CHECK_INTERNAL_POINTER(widget()) c->returnValue()->setInteger(((QSlider *)widget())->minimum()); return true; } -KVSO_CLASS_FUNCTION(slider,maxValue) +KVSO_CLASS_FUNCTION(slider, maxValue) { CHECK_INTERNAL_POINTER(widget()) c->returnValue()->setInteger(((QSlider *)widget())->maximum()); return true; } -KVSO_CLASS_FUNCTION(slider,lineStep) +KVSO_CLASS_FUNCTION(slider, lineStep) { CHECK_INTERNAL_POINTER(widget()) c->returnValue()->setInteger(((QSlider *)widget())->singleStep()); return true; } -KVSO_CLASS_FUNCTION(slider,pageStep) +KVSO_CLASS_FUNCTION(slider, pageStep) { CHECK_INTERNAL_POINTER(widget()) c->returnValue()->setInteger(((QSlider *)widget())->pageStep()); return true; } - -KVSO_CLASS_FUNCTION(slider,setTickmarks) +KVSO_CLASS_FUNCTION(slider, setTickmarks) { CHECK_INTERNAL_POINTER(widget()) QString szTick; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("tick_marks",KVS_PT_STRING,0,szTick) + KVSO_PARAMETER("tick_marks", KVS_PT_STRING, 0, szTick) KVSO_PARAMETERS_END(c) - if(KviQString::equalCI(szTick,"NoMarks")) + if(KviQString::equalCI(szTick, "NoMarks")) ((QSlider *)widget())->setTickPosition(QSlider::NoTicks); - else if(KviQString::equalCI(szTick,"Both")) + else if(KviQString::equalCI(szTick, "Both")) ((QSlider *)widget())->setTickPosition(QSlider::TicksBothSides); - else if(KviQString::equalCI(szTick,"Above")) + else if(KviQString::equalCI(szTick, "Above")) ((QSlider *)widget())->setTickPosition(QSlider::TicksAbove); - else if(KviQString::equalCI(szTick,"Below")) + else if(KviQString::equalCI(szTick, "Below")) ((QSlider *)widget())->setTickPosition(QSlider::TicksBelow); - else if(KviQString::equalCI(szTick,"Left")) + else if(KviQString::equalCI(szTick, "Left")) ((QSlider *)widget())->setTickPosition(QSlider::TicksLeft); - else if(KviQString::equalCI(szTick,"Right")) - ((QSlider *)widget())->setTickPosition(QSlider::TicksRight); - else c->warning( __tr2qs_ctx("Unknown tickmark '%Q'","objects"),&szTick); + else if(KviQString::equalCI(szTick, "Right")) + ((QSlider *)widget())->setTickPosition(QSlider::TicksRight); + else + c->warning(__tr2qs_ctx("Unknown tickmark '%Q'", "objects"), &szTick); return true; } -KVSO_CLASS_FUNCTION(slider,setOrientation) +KVSO_CLASS_FUNCTION(slider, setOrientation) { CHECK_INTERNAL_POINTER(widget()) QString szOrientation; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("orientation",KVS_PT_STRING,0,szOrientation) + KVSO_PARAMETER("orientation", KVS_PT_STRING, 0, szOrientation) KVSO_PARAMETERS_END(c) - if(KviQString::equalCI(szOrientation,"Horizontal")) + if(KviQString::equalCI(szOrientation, "Horizontal")) ((QSlider *)widget())->setOrientation(Qt::Horizontal); - else if(KviQString::equalCI(szOrientation,"Vertical")) + else if(KviQString::equalCI(szOrientation, "Vertical")) ((QSlider *)widget())->setOrientation(Qt::Vertical); - else c->warning( __tr2qs_ctx("Unknown orientation '%Q'","objects"),&szOrientation); + else + c->warning(__tr2qs_ctx("Unknown orientation '%Q'", "objects"), &szOrientation); return true; } -KVSO_CLASS_FUNCTION(slider,valueChangedEvent) +KVSO_CLASS_FUNCTION(slider, valueChangedEvent) { - emitSignal("valueChanged",c,c->params()); + emitSignal("valueChanged", c, c->params()); return true; } void KvsObject_slider::valueChanged(int value) { KviKvsVariantList params(new KviKvsVariant((kvs_int_t)value)); - callFunction(this,"valueChangedEvent",¶ms); + callFunction(this, "valueChangedEvent", ¶ms); } diff --git a/src/modules/objects/KvsObject_slider.h b/src/modules/objects/KvsObject_slider.h index 5b91589b3..953add8a9 100644 --- a/src/modules/objects/KvsObject_slider.h +++ b/src/modules/objects/KvsObject_slider.h @@ -36,28 +36,26 @@ public: public: QWidget * widget() { return (QWidget *)object(); }; protected: - virtual bool init(KviKvsRunTimeContext * pContext,KviKvsVariantList *pParams); + virtual bool init(KviKvsRunTimeContext * pContext, KviKvsVariantList * pParams); - bool setTracking(KviKvsObjectFunctionCall *c); - bool setValue(KviKvsObjectFunctionCall *c); - bool setMinValue(KviKvsObjectFunctionCall *c); - bool setMaxValue(KviKvsObjectFunctionCall *c); - bool setLineStep(KviKvsObjectFunctionCall *c); - bool setPageStep(KviKvsObjectFunctionCall *c); - bool setTickInterval(KviKvsObjectFunctionCall *c); - bool value(KviKvsObjectFunctionCall *c); - bool minValue(KviKvsObjectFunctionCall *c); - bool maxValue(KviKvsObjectFunctionCall *c); - bool lineStep(KviKvsObjectFunctionCall *c); - bool pageStep(KviKvsObjectFunctionCall *c); - bool setTickmarks(KviKvsObjectFunctionCall *c); - bool setOrientation(KviKvsObjectFunctionCall *c); - bool valueChangedEvent(KviKvsObjectFunctionCall *c); + bool setTracking(KviKvsObjectFunctionCall * c); + bool setValue(KviKvsObjectFunctionCall * c); + bool setMinValue(KviKvsObjectFunctionCall * c); + bool setMaxValue(KviKvsObjectFunctionCall * c); + bool setLineStep(KviKvsObjectFunctionCall * c); + bool setPageStep(KviKvsObjectFunctionCall * c); + bool setTickInterval(KviKvsObjectFunctionCall * c); + bool value(KviKvsObjectFunctionCall * c); + bool minValue(KviKvsObjectFunctionCall * c); + bool maxValue(KviKvsObjectFunctionCall * c); + bool lineStep(KviKvsObjectFunctionCall * c); + bool pageStep(KviKvsObjectFunctionCall * c); + bool setTickmarks(KviKvsObjectFunctionCall * c); + bool setOrientation(KviKvsObjectFunctionCall * c); + bool valueChangedEvent(KviKvsObjectFunctionCall * c); protected slots: void valueChanged(int); }; - - -#endif // !_CLASS_SLIDER_H_ +#endif // !_CLASS_SLIDER_H_ diff --git a/src/modules/objects/KvsObject_socket.cpp b/src/modules/objects/KvsObject_socket.cpp index d1d2f5fc5..0d386d3cb 100644 --- a/src/modules/objects/KvsObject_socket.cpp +++ b/src/modules/objects/KvsObject_socket.cpp @@ -26,8 +26,6 @@ #include "KvsObject_memoryBuffer.h" #include "KvsObject_file.h" - - #include "kvi_settings.h" #include "KviQString.h" @@ -268,33 +266,33 @@ const char * const sockerrors_tbl[] = { [/example] */ -KVSO_BEGIN_REGISTERCLASS(KvsObject_socket,"socket","object") - - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_socket,status) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_socket,remotePort) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_socket,remoteIp) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_socket,localIp) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_socket,localPort) - KVSO_REGISTER_HANDLER(KvsObject_socket,"connect",functionConnect) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_socket,close) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_socket,read) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_socket,write) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_socket,bytesAvailable) - - //KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_socket,setReadBufferSize) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_socket,setProtocol) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_socket,listen) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_socket,dataAvailableEvent) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_socket,incomingConnectionEvent) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_socket,connectedEvent) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_socket,disconnectedEvent) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_socket,errorEvent) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_socket,hostFoundEvent) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_socket,stateChangedEvent) +KVSO_BEGIN_REGISTERCLASS(KvsObject_socket, "socket", "object") + +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_socket, status) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_socket, remotePort) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_socket, remoteIp) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_socket, localIp) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_socket, localPort) +KVSO_REGISTER_HANDLER(KvsObject_socket, "connect", functionConnect) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_socket, close) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_socket, read) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_socket, write) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_socket, bytesAvailable) + +//KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_socket,setReadBufferSize) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_socket, setProtocol) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_socket, listen) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_socket, dataAvailableEvent) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_socket, incomingConnectionEvent) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_socket, connectedEvent) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_socket, disconnectedEvent) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_socket, errorEvent) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_socket, hostFoundEvent) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_socket, stateChangedEvent) KVSO_END_REGISTERCLASS(KvsObject_socket) -bool KvsObject_socket::init(KviKvsRunTimeContext *c,KviKvsVariantList *) +bool KvsObject_socket::init(KviKvsRunTimeContext * c, KviKvsVariantList *) { m_pSocket = new QTcpSocket(); m_pServer = nullptr; @@ -304,101 +302,104 @@ bool KvsObject_socket::init(KviKvsRunTimeContext *c,KviKvsVariantList *) return true; } - -KVSO_BEGIN_CONSTRUCTOR(KvsObject_socket,KviKvsObject) +KVSO_BEGIN_CONSTRUCTOR(KvsObject_socket, KviKvsObject) KVSO_END_CONSTRUCTOR(KvsObject_socket) KVSO_BEGIN_DESTRUCTOR(KvsObject_socket) - if (m_pSocket && !bIsSetFromExternal) - { - m_pSocket->close(); - delete m_pSocket; - } - m_pSocket = nullptr; - if(m_pServer) - delete m_pServer; - m_pServer = nullptr; +if(m_pSocket && !bIsSetFromExternal) +{ + m_pSocket->close(); + delete m_pSocket; +} +m_pSocket = nullptr; +if(m_pServer) + delete m_pServer; +m_pServer = nullptr; KVSO_END_DESTRUCTOR(KvsObject_socket) //---------------------- - -KVSO_CLASS_FUNCTION(socket,status) +KVSO_CLASS_FUNCTION(socket, status) { c->returnValue()->setString(getStateString(m_pSocket->state())); return true; } -KVSO_CLASS_FUNCTION(socket,close) +KVSO_CLASS_FUNCTION(socket, close) { Q_UNUSED(c); m_pSocket->disconnectFromHost(); return true; } -KVSO_CLASS_FUNCTION(socket,remotePort) +KVSO_CLASS_FUNCTION(socket, remotePort) { c->returnValue()->setInteger(m_pSocket->peerPort()); return true; } -KVSO_CLASS_FUNCTION(socket,remoteIp) +KVSO_CLASS_FUNCTION(socket, remoteIp) { c->returnValue()->setString(m_pSocket->peerAddress().toString()); return true; } -KVSO_CLASS_FUNCTION(socket,localPort) +KVSO_CLASS_FUNCTION(socket, localPort) { c->returnValue()->setInteger(m_pSocket->localPort()); return true; } -KVSO_CLASS_FUNCTION(socket,bytesAvailable) +KVSO_CLASS_FUNCTION(socket, bytesAvailable) { c->returnValue()->setInteger(m_pSocket->bytesAvailable()); return true; } -KVSO_CLASS_FUNCTION(socket,localIp) +KVSO_CLASS_FUNCTION(socket, localIp) { c->returnValue()->setString(m_pSocket->localAddress().toString()); return true; } -KVSO_CLASS_FUNCTION(socket,read) +KVSO_CLASS_FUNCTION(socket, read) { kvs_int_t iLen; KviKvsObject * pObject; kvs_hobject_t hObject; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("length",KVS_PT_INTEGER,KVS_PF_OPTIONAL,iLen) - KVSO_PARAMETER("hobject",KVS_PT_HOBJECT,KVS_PF_OPTIONAL,hObject) + KVSO_PARAMETER("length", KVS_PT_INTEGER, KVS_PF_OPTIONAL, iLen) + KVSO_PARAMETER("hobject", KVS_PT_HOBJECT, KVS_PF_OPTIONAL, hObject) KVSO_PARAMETERS_END(c) - if (iLen>m_pSocket->bytesAvailable() || !iLen) iLen=m_pSocket->bytesAvailable(); - if (hObject) + if(iLen > m_pSocket->bytesAvailable() || !iLen) + iLen = m_pSocket->bytesAvailable(); + if(hObject) { - pObject=KviKvsKernel::instance()->objectController()->lookupObject(hObject); + pObject = KviKvsKernel::instance()->objectController()->lookupObject(hObject); if(!pObject) { - c->warning(__tr2qs_ctx("Buffer parameter is not an object","objects")); + c->warning(__tr2qs_ctx("Buffer parameter is not an object", "objects")); return true; } if(pObject->inheritsClass("memorybuffer")) { - QByteArray *pBuffer=((KvsObject_memoryBuffer *)pObject)->pBuffer(); - int oldsize=pBuffer->size(); - pBuffer->resize(oldsize+iLen); - m_pSocket->read(pBuffer->data()+oldsize,iLen); - } else if(pObject->inheritsClass("file")) { - KviFile *pFile=((KvsObject_file *)pObject)->file(); - if (!pFile->isOpen()) + QByteArray * pBuffer = ((KvsObject_memoryBuffer *)pObject)->pBuffer(); + int oldsize = pBuffer->size(); + pBuffer->resize(oldsize + iLen); + m_pSocket->read(pBuffer->data() + oldsize, iLen); + } + else if(pObject->inheritsClass("file")) + { + KviFile * pFile = ((KvsObject_file *)pObject)->file(); + if(!pFile->isOpen()) { - c->warning(__tr2qs_ctx("File is not open!","objects")); + c->warning(__tr2qs_ctx("File is not open!", "objects")); return true; } pFile->write(m_pSocket->read(iLen)); - } else { - c->warning(__tr2qs_ctx("Buffer parameter is not a memorybuffer object","objects")); + } + else + { + c->warning(__tr2qs_ctx("Buffer parameter is not a memorybuffer object", "objects")); return true; } return true; @@ -406,63 +407,71 @@ KVSO_CLASS_FUNCTION(socket,read) if(iLen > 0) { // convert NULLS to char 255 - char * buffer = (char*) KviMemory::allocate(iLen); - m_pSocket->read(buffer,iLen); - for(size_t i{};i < iLen;i++) + char * buffer = (char *)KviMemory::allocate(iLen); + m_pSocket->read(buffer, iLen); + for(size_t i{}; i < iLen; i++) { - if(!buffer[i]) buffer[i] = (char)(255); + if(!buffer[i]) + buffer[i] = (char)(255); } - QString tmpBuffer = QString::fromUtf8(buffer,iLen); + QString tmpBuffer = QString::fromUtf8(buffer, iLen); c->returnValue()->setString(tmpBuffer); KviMemory::free(buffer); } return true; } -KVSO_CLASS_FUNCTION(socket,write) +KVSO_CLASS_FUNCTION(socket, write) { kvs_uint_t uLen; KviKvsObject * pObject; KviKvsVariant * pVariantData; kvs_hobject_t hObject; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("data_or_file_or_memorybuffer",KVS_PT_VARIANT,0,pVariantData) - KVSO_PARAMETER("length",KVS_PT_UNSIGNEDINTEGER,KVS_PF_OPTIONAL,uLen) + KVSO_PARAMETER("data_or_file_or_memorybuffer", KVS_PT_VARIANT, 0, pVariantData) + KVSO_PARAMETER("length", KVS_PT_UNSIGNEDINTEGER, KVS_PF_OPTIONAL, uLen) KVSO_PARAMETERS_END(c) - if (pVariantData->isHObject()) + if(pVariantData->isHObject()) { pVariantData->asHObject(hObject); pObject = KviKvsKernel::instance()->objectController()->lookupObject(hObject); if(!pObject) { - c->warning(__tr2qs_ctx("Buffer parameter is not an object","objects")); + c->warning(__tr2qs_ctx("Buffer parameter is not an object", "objects")); return true; } if(pObject->inheritsClass("memorybuffer")) { - QByteArray *p=((KvsObject_memoryBuffer *)pObject)->pBuffer(); + QByteArray * p = ((KvsObject_memoryBuffer *)pObject)->pBuffer(); m_pSocket->write(*p); - } else if(pObject->inheritsClass("file")) { + } + else if(pObject->inheritsClass("file")) + { KviFile * pFile = ((KvsObject_file *)pObject)->file(); if(!pFile->isOpen()) { - c->warning(__tr2qs_ctx("File is not open!","objects")); + c->warning(__tr2qs_ctx("File is not open!", "objects")); return true; } - if(!uLen) uLen = pFile->size(); + if(!uLen) + uLen = pFile->size(); kvs_int_t size = pFile->size(); pFile->flush(); - m_pSocket->write((const char*)pFile->read(uLen).data(),uLen); - c->returnValue()->setBoolean((size-pFile->pos()==0)); - } else { - c->warning(__tr2qs_ctx("Buffer parameter is not a memorybuffer or file object","objects")); + m_pSocket->write((const char *)pFile->read(uLen).data(), uLen); + c->returnValue()->setBoolean((size - pFile->pos() == 0)); + } + else + { + c->warning(__tr2qs_ctx("Buffer parameter is not a memorybuffer or file object", "objects")); return true; } - } else { + } + else + { if(pVariantData->isArray()) { KviKvsArray * pArray = pVariantData->array(); - for(unsigned int i=0; i < pArray->size(); i++) + for(unsigned int i = 0; i < pArray->size(); i++) { KviKvsVariant * pVar = pArray->at(i); kvs_int_t iValue; @@ -472,19 +481,25 @@ KVSO_CLASS_FUNCTION(socket,write) { m_pSocket->putChar(iValue); continue; - } else { - c->warning(__tr2qs_ctx("Only values in the range of 0-255 are allowed: integer %d is out of range","objects"),iValue); + } + else + { + c->warning(__tr2qs_ctx("Only values in the range of 0-255 are allowed: integer %d is out of range", "objects"), iValue); return true; } - } else { + } + else + { if(pVar->isString()) { QString szData; pVar->asString(szData); QByteArray szData8 = szData.toUtf8(); - m_pSocket->write((const char*)szData8.data(),szData8.length()); - } else { - c->warning(__tr2qs_ctx("Datatype not supported","objects")); + m_pSocket->write((const char *)szData8.data(), szData8.length()); + } + else + { + c->warning(__tr2qs_ctx("Datatype not supported", "objects")); return true; } } @@ -498,46 +513,51 @@ KVSO_CLASS_FUNCTION(socket,write) QByteArray szData8 = szData.toUtf8(); if(szData8.length() > 0) { - qDebug("write on socket %s",szData8.data()); - kvs_int_t bytes=m_pSocket->write((const char*)szData8.data(),szData8.length()); + qDebug("write on socket %s", szData8.data()); + kvs_int_t bytes = m_pSocket->write((const char *)szData8.data(), szData8.length()); c->returnValue()->setInteger(bytes); } - } else { + } + else + { KviFile f(szData); f.open(QIODevice::ReadOnly); QByteArray ar = f.readAll(); - m_pSocket->write((const char*)ar.data(),ar.size()); + m_pSocket->write((const char *)ar.data(), ar.size()); f.close(); } } return true; } -KVSO_CLASS_FUNCTION(socket,setProtocol) +KVSO_CLASS_FUNCTION(socket, setProtocol) { QString szProto; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("protocol",KVS_PT_STRING,0,szProto) + KVSO_PARAMETER("protocol", KVS_PT_STRING, 0, szProto) KVSO_PARAMETERS_END(c) - if (m_pSocket) delete m_pSocket; - if(KviQString::equalCI(szProto,"udp")) m_pSocket = new QUdpSocket(); - else m_pSocket = new QTcpSocket(); + if(m_pSocket) + delete m_pSocket; + if(KviQString::equalCI(szProto, "udp")) + m_pSocket = new QUdpSocket(); + else + m_pSocket = new QTcpSocket(); makeConnections(); return true; } -KVSO_CLASS_FUNCTION(socket,functionConnect) +KVSO_CLASS_FUNCTION(socket, functionConnect) { kvs_uint_t uRemotePort; QString szRemoteIp; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("remote_ip",KVS_PT_STRING,0,szRemoteIp) - KVSO_PARAMETER("remote_port",KVS_PT_UNSIGNEDINTEGER,0,uRemotePort) + KVSO_PARAMETER("remote_ip", KVS_PT_STRING, 0, szRemoteIp) + KVSO_PARAMETER("remote_port", KVS_PT_UNSIGNEDINTEGER, 0, uRemotePort) KVSO_PARAMETERS_END(c) - if (uRemotePort>65535) + if(uRemotePort > 65535) { - c->warning(__tr2qs_ctx("Value %d for port is out of range (values allowed are from 0 to 65535)","objects"),uRemotePort); + c->warning(__tr2qs_ctx("Value %d for port is out of range (values allowed are from 0 to 65535)", "objects"), uRemotePort); return true; } - m_pSocket->connectToHost(szRemoteIp,uRemotePort); + m_pSocket->connectToHost(szRemoteIp, uRemotePort); c->returnValue()->setBoolean(true); return true; } @@ -554,75 +574,76 @@ KVSO_CLASS_FUNCTION(socket,functionsetReadBufferSize) } */ -KVSO_CLASS_FUNCTION(socket,listen) +KVSO_CLASS_FUNCTION(socket, listen) { kvs_uint_t uLocalPort; QString m_szLocalIp; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("local_port",KVS_PT_UNSIGNEDINTEGER,0,uLocalPort) - KVSO_PARAMETER("interface",KVS_PT_STRING,KVS_PF_OPTIONAL,m_szLocalIp) + KVSO_PARAMETER("local_port", KVS_PT_UNSIGNEDINTEGER, 0, uLocalPort) + KVSO_PARAMETER("interface", KVS_PT_STRING, KVS_PF_OPTIONAL, m_szLocalIp) KVSO_PARAMETERS_END(c) - if (uLocalPort>65535) + if(uLocalPort > 65535) { - c->warning(__tr2qs_ctx("Value %d for port is out of range (values allowed are from 0 to 65535): switch to random value","objects"),uLocalPort); - uLocalPort=0; + c->warning(__tr2qs_ctx("Value %d for port is out of range (values allowed are from 0 to 65535): switch to random value", "objects"), uLocalPort); + uLocalPort = 0; } - if(m_pServer) delete m_pServer; + if(m_pServer) + delete m_pServer; m_pServer = new QTcpServer(); QHostAddress address(m_szLocalIp); - bool bOk=m_pServer->listen(address,uLocalPort); - connect(m_pServer,SIGNAL(newConnection()),this,SLOT(slotNewConnection())); + bool bOk = m_pServer->listen(address, uLocalPort); + connect(m_pServer, SIGNAL(newConnection()), this, SLOT(slotNewConnection())); c->returnValue()->setBoolean(bOk); return true; } void KvsObject_socket::makeConnections() { - connect(m_pSocket,SIGNAL(connected()),this,SLOT(slotConnected())); - connect(m_pSocket,SIGNAL(readyRead()),this,SLOT(slotReadyRead())); - connect(m_pSocket,SIGNAL(disconnected()),this,SLOT(slotDisconnected())); - connect(m_pSocket,SIGNAL(error( QAbstractSocket::SocketError)),this,SLOT(slotError(QAbstractSocket::SocketError))); - connect(m_pSocket,SIGNAL(hostFound()),this,SLOT(slotHostFound())); - connect(m_pSocket,SIGNAL(stateChanged(QAbstractSocket::SocketState)),this,SLOT(slotStateChanged(QAbstractSocket::SocketState))); + connect(m_pSocket, SIGNAL(connected()), this, SLOT(slotConnected())); + connect(m_pSocket, SIGNAL(readyRead()), this, SLOT(slotReadyRead())); + connect(m_pSocket, SIGNAL(disconnected()), this, SLOT(slotDisconnected())); + connect(m_pSocket, SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(slotError(QAbstractSocket::SocketError))); + connect(m_pSocket, SIGNAL(hostFound()), this, SLOT(slotHostFound())); + connect(m_pSocket, SIGNAL(stateChanged(QAbstractSocket::SocketState)), this, SLOT(slotStateChanged(QAbstractSocket::SocketState))); //proxyAuthenticationRequired ( const QNetworkProxy & proxy, QAuthenticator * authenticator ) } const char * KvsObject_socket::getStateString(QAbstractSocket::SocketState state) { - int idx=0; + int idx = 0; switch(state) { case QAbstractSocket::UnconnectedState: { - idx=0; + idx = 0; break; } case QAbstractSocket::HostLookupState: { - idx=1; + idx = 1; break; } case QAbstractSocket::ConnectingState: { - idx=2; + idx = 2; break; } case QAbstractSocket::ConnectedState: { - idx=3; + idx = 3; break; } case QAbstractSocket::BoundState: { - idx=4; + idx = 4; break; } case QAbstractSocket::ListeningState: { - idx=5; + idx = 5; break; } case QAbstractSocket::ClosingState: { - idx=6; + idx = 6; break; } default: @@ -638,99 +659,100 @@ void KvsObject_socket::slotReadyRead() { KviKvsVariantList lParams; lParams.append(new KviKvsVariant((kvs_int_t)m_pSocket->bytesAvailable())); - callFunction(this,"dataAvailableEvent",&lParams); + callFunction(this, "dataAvailableEvent", &lParams); } void KvsObject_socket::slotConnected() { - KviKvsVariantList *lParams=0; - callFunction(this,"connectedEvent",lParams); + KviKvsVariantList * lParams = 0; + callFunction(this, "connectedEvent", lParams); } void KvsObject_socket::slotDisconnected() { - KviKvsVariantList *lParams=0; - callFunction(this,"disconnectedEvent",lParams); + KviKvsVariantList * lParams = 0; + callFunction(this, "disconnectedEvent", lParams); } -void KvsObject_socket::slotError( QAbstractSocket::SocketError socketError ) +void KvsObject_socket::slotError(QAbstractSocket::SocketError socketError) { KviKvsVariantList lParams; QString szError = sockerrors_tbl[socketError]; lParams.append(new KviKvsVariant(szError)); - callFunction(this,"errorEvent",&lParams); + callFunction(this, "errorEvent", &lParams); } void KvsObject_socket::slotHostFound() { - KviKvsVariantList *lParams=0; - callFunction(this,"hostFoundEvent",lParams); + KviKvsVariantList * lParams = 0; + callFunction(this, "hostFoundEvent", lParams); } -void KvsObject_socket::slotStateChanged( QAbstractSocket::SocketState socketState ) +void KvsObject_socket::slotStateChanged(QAbstractSocket::SocketState socketState) { KviKvsVariantList lParams; QString szState = getStateString(socketState); lParams.append(new KviKvsVariant(szState)); - callFunction(this,"stateChangedEvent",&lParams); + callFunction(this, "stateChangedEvent", &lParams); } void KvsObject_socket::slotNewConnection() { - QTcpSocket *pSocket = m_pServer->nextPendingConnection(); + QTcpSocket * pSocket = m_pServer->nextPendingConnection(); KviKvsObjectClass * pClass = KviKvsKernel::instance()->objectController()->lookupClass("socket"); KviKvsVariantList lParams; - KviKvsObject * pObject = pClass->allocateInstance(this,"internalsocket",m_pContext,&lParams); + KviKvsObject * pObject = pClass->allocateInstance(this, "internalsocket", m_pContext, &lParams); ((KvsObject_socket *)pObject)->setInternalSocket(pSocket); - kvs_hobject_t hobj=pObject->handle(); + kvs_hobject_t hobj = pObject->handle(); KviKvsVariantList params(new KviKvsVariant(hobj)); - bool ret=false; + bool ret = false; KviKvsVariant retv(ret); - callFunction(this,"incomingConnectionEvent",&retv,¶ms); - ret=retv.asBoolean(); - if (ret) + callFunction(this, "incomingConnectionEvent", &retv, ¶ms); + ret = retv.asBoolean(); + if(ret) { - pObject=KviKvsKernel::instance()->objectController()->lookupObject(hobj); - if (pObject) pObject->dieNow(); + pObject = KviKvsKernel::instance()->objectController()->lookupObject(hobj); + if(pObject) + pObject->dieNow(); } } -KVSO_CLASS_FUNCTION(socket,incomingConnectionEvent) +KVSO_CLASS_FUNCTION(socket, incomingConnectionEvent) { - emitSignal("incomingConnection",c,c->params()); + emitSignal("incomingConnection", c, c->params()); return true; } -KVSO_CLASS_FUNCTION(socket,dataAvailableEvent) +KVSO_CLASS_FUNCTION(socket, dataAvailableEvent) { - emitSignal("dataAvailable",c,c->params()); + emitSignal("dataAvailable", c, c->params()); return true; } -KVSO_CLASS_FUNCTION(socket,connectedEvent) +KVSO_CLASS_FUNCTION(socket, connectedEvent) { - emitSignal("connected",c,c->params()); + emitSignal("connected", c, c->params()); return true; } -KVSO_CLASS_FUNCTION(socket,disconnectedEvent) +KVSO_CLASS_FUNCTION(socket, disconnectedEvent) { - emitSignal("disconnected",c,c->params()); + emitSignal("disconnected", c, c->params()); return true; } -KVSO_CLASS_FUNCTION(socket,errorEvent) +KVSO_CLASS_FUNCTION(socket, errorEvent) { - emitSignal("error",c,c->params()); + emitSignal("error", c, c->params()); return true; } -KVSO_CLASS_FUNCTION(socket,hostFoundEvent) +KVSO_CLASS_FUNCTION(socket, hostFoundEvent) { - emitSignal("hostFound",c,c->params()); + emitSignal("hostFound", c, c->params()); return true; } -KVSO_CLASS_FUNCTION(socket,stateChangedEvent) +KVSO_CLASS_FUNCTION(socket, stateChangedEvent) { - emitSignal("stateChanged",c,c->params()); + emitSignal("stateChanged", c, c->params()); return true; } diff --git a/src/modules/objects/KvsObject_socket.h b/src/modules/objects/KvsObject_socket.h index bec11b60f..2bb623be9 100644 --- a/src/modules/objects/KvsObject_socket.h +++ b/src/modules/objects/KvsObject_socket.h @@ -29,49 +29,49 @@ #include "object_macros.h" - class KvsObject_socket : public KviKvsObject { Q_OBJECT public: KVSO_DECLARE_OBJECT(KvsObject_socket) protected: - QAbstractSocket *m_pSocket; - QTcpServer *m_pServer; - KviKvsRunTimeContext *m_pContext; + QAbstractSocket * m_pSocket; + QTcpServer * m_pServer; + KviKvsRunTimeContext * m_pContext; bool bIsSetFromExternal; + protected: - virtual bool init(KviKvsRunTimeContext * pContext,KviKvsVariantList *pParams); + virtual bool init(KviKvsRunTimeContext * pContext, KviKvsVariantList * pParams); const char * getStateString(QAbstractSocket::SocketState); - void setInternalSocket(QAbstractSocket *pSocket) + void setInternalSocket(QAbstractSocket * pSocket) { delete m_pSocket; - m_pSocket=pSocket; + m_pSocket = pSocket; bIsSetFromExternal = true; makeConnections(); } - bool status(KviKvsObjectFunctionCall *c); - bool remotePort(KviKvsObjectFunctionCall *c); - bool remoteIp(KviKvsObjectFunctionCall *c); - bool localPort(KviKvsObjectFunctionCall *c); - bool localIp(KviKvsObjectFunctionCall *c); - bool functionConnect(KviKvsObjectFunctionCall *c); - bool close(KviKvsObjectFunctionCall *c); - bool read(KviKvsObjectFunctionCall *c); - bool write(KviKvsObjectFunctionCall *c); - bool bytesAvailable(KviKvsObjectFunctionCall *c); - bool setProtocol(KviKvsObjectFunctionCall *c); + bool status(KviKvsObjectFunctionCall * c); + bool remotePort(KviKvsObjectFunctionCall * c); + bool remoteIp(KviKvsObjectFunctionCall * c); + bool localPort(KviKvsObjectFunctionCall * c); + bool localIp(KviKvsObjectFunctionCall * c); + bool functionConnect(KviKvsObjectFunctionCall * c); + bool close(KviKvsObjectFunctionCall * c); + bool read(KviKvsObjectFunctionCall * c); + bool write(KviKvsObjectFunctionCall * c); + bool bytesAvailable(KviKvsObjectFunctionCall * c); + bool setProtocol(KviKvsObjectFunctionCall * c); //bool setReadBufferSize(KviKvsObjectFunctionCall *c); - bool listen(KviKvsObjectFunctionCall *c); - bool dataAvailableEvent(KviKvsObjectFunctionCall *c); - bool incomingConnectionEvent(KviKvsObjectFunctionCall *c); - bool connectedEvent(KviKvsObjectFunctionCall *c); - bool disconnectedEvent(KviKvsObjectFunctionCall *c); - bool errorEvent(KviKvsObjectFunctionCall *c); - bool hostFoundEvent(KviKvsObjectFunctionCall *c); - bool stateChangedEvent(KviKvsObjectFunctionCall *c); + bool listen(KviKvsObjectFunctionCall * c); + bool dataAvailableEvent(KviKvsObjectFunctionCall * c); + bool incomingConnectionEvent(KviKvsObjectFunctionCall * c); + bool connectedEvent(KviKvsObjectFunctionCall * c); + bool disconnectedEvent(KviKvsObjectFunctionCall * c); + bool errorEvent(KviKvsObjectFunctionCall * c); + bool hostFoundEvent(KviKvsObjectFunctionCall * c); + bool stateChangedEvent(KviKvsObjectFunctionCall * c); void makeConnections(); protected slots: @@ -79,8 +79,8 @@ protected slots: void slotNewConnection(); void slotConnected(); void slotDisconnected(); - void slotError( QAbstractSocket::SocketError socketError ); + void slotError(QAbstractSocket::SocketError socketError); void slotHostFound(); - void slotStateChanged( QAbstractSocket::SocketState socketState ); + void slotStateChanged(QAbstractSocket::SocketState socketState); }; #endif //_CLASS_SOCKET_H_ diff --git a/src/modules/objects/KvsObject_spinBox.cpp b/src/modules/objects/KvsObject_spinBox.cpp index 991c82211..393f8bf97 100644 --- a/src/modules/objects/KvsObject_spinBox.cpp +++ b/src/modules/objects/KvsObject_spinBox.cpp @@ -99,164 +99,154 @@ If you reimplement that function you will have to emit the signal manually (if you still need it). */ - -KVSO_BEGIN_REGISTERCLASS(KvsObject_spinBox,"spinbox","widget") - - - - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_spinBox,setValue); - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_spinBox,setMinValue); - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_spinBox,setMaxValue); - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_spinBox,setLineStep); - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_spinBox,setSpecialValueText); - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_spinBox,value); - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_spinBox,minValue); - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_spinBox,maxValue); - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_spinBox,lineStep); - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_spinBox,specialValueText); - - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_spinBox,setPrefix); - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_spinBox,setSuffix); - - - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_spinBox,valueChangedEvent); +KVSO_BEGIN_REGISTERCLASS(KvsObject_spinBox, "spinbox", "widget") + +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_spinBox, setValue); +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_spinBox, setMinValue); +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_spinBox, setMaxValue); +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_spinBox, setLineStep); +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_spinBox, setSpecialValueText); +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_spinBox, value); +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_spinBox, minValue); +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_spinBox, maxValue); +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_spinBox, lineStep); +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_spinBox, specialValueText); + +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_spinBox, setPrefix); +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_spinBox, setSuffix); + +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_spinBox, valueChangedEvent); KVSO_END_REGISTERCLASS(KvsObject_spinBox) -KVSO_BEGIN_CONSTRUCTOR(KvsObject_spinBox,KvsObject_widget) +KVSO_BEGIN_CONSTRUCTOR(KvsObject_spinBox, KvsObject_widget) KVSO_END_CONSTRUCTOR(KvsObject_spinBox) - KVSO_BEGIN_DESTRUCTOR(KvsObject_spinBox) KVSO_END_CONSTRUCTOR(KvsObject_spinBox) -bool KvsObject_spinBox::init(KviKvsRunTimeContext *,KviKvsVariantList *) +bool KvsObject_spinBox::init(KviKvsRunTimeContext *, KviKvsVariantList *) { SET_OBJECT(QSpinBox) - connect(widget(),SIGNAL(valueChanged(int)),this,SLOT(valueChanged(int))); + connect(widget(), SIGNAL(valueChanged(int)), this, SLOT(valueChanged(int))); return true; } - - -KVSO_CLASS_FUNCTION(spinBox,setValue) +KVSO_CLASS_FUNCTION(spinBox, setValue) { CHECK_INTERNAL_POINTER(widget()) kvs_int_t iValue; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("value",KVS_PT_INT,0,iValue) + KVSO_PARAMETER("value", KVS_PT_INT, 0, iValue) KVSO_PARAMETERS_END(c) ((QSpinBox *)widget())->setValue(iValue); return true; } -KVSO_CLASS_FUNCTION(spinBox,setMinValue) +KVSO_CLASS_FUNCTION(spinBox, setMinValue) { CHECK_INTERNAL_POINTER(widget()) kvs_int_t iMinvalue; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("min_value",KVS_PT_INT,0,iMinvalue) + KVSO_PARAMETER("min_value", KVS_PT_INT, 0, iMinvalue) KVSO_PARAMETERS_END(c) ((QSpinBox *)widget())->setMinimum(iMinvalue); return true; } -KVSO_CLASS_FUNCTION(spinBox,setMaxValue) +KVSO_CLASS_FUNCTION(spinBox, setMaxValue) { CHECK_INTERNAL_POINTER(widget()) kvs_int_t iMaxvalue; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("max_value",KVS_PT_INT,0,iMaxvalue) + KVSO_PARAMETER("max_value", KVS_PT_INT, 0, iMaxvalue) KVSO_PARAMETERS_END(c) ((QSpinBox *)widget())->setMaximum(iMaxvalue); return true; } -KVSO_CLASS_FUNCTION(spinBox,setLineStep) +KVSO_CLASS_FUNCTION(spinBox, setLineStep) { CHECK_INTERNAL_POINTER(widget()) kvs_int_t iLinestep; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("line_step",KVS_PT_INT,0,iLinestep) + KVSO_PARAMETER("line_step", KVS_PT_INT, 0, iLinestep) KVSO_PARAMETERS_END(c) ((QSpinBox *)widget())->setSingleStep(iLinestep); return true; } - -KVSO_CLASS_FUNCTION(spinBox,value) +KVSO_CLASS_FUNCTION(spinBox, value) { CHECK_INTERNAL_POINTER(widget()) c->returnValue()->setInteger(((QSpinBox *)widget())->value()); return true; } -KVSO_CLASS_FUNCTION(spinBox,minValue) +KVSO_CLASS_FUNCTION(spinBox, minValue) { CHECK_INTERNAL_POINTER(widget()) c->returnValue()->setInteger(((QSpinBox *)widget())->minimum()); return true; } -KVSO_CLASS_FUNCTION(spinBox,maxValue) +KVSO_CLASS_FUNCTION(spinBox, maxValue) { CHECK_INTERNAL_POINTER(widget()) c->returnValue()->setInteger(((QSpinBox *)widget())->maximum()); return true; } -KVSO_CLASS_FUNCTION(spinBox,lineStep) +KVSO_CLASS_FUNCTION(spinBox, lineStep) { CHECK_INTERNAL_POINTER(widget()) c->returnValue()->setInteger(((QSpinBox *)widget())->singleStep()); return true; } - -KVSO_CLASS_FUNCTION(spinBox,specialValueText) +KVSO_CLASS_FUNCTION(spinBox, specialValueText) { CHECK_INTERNAL_POINTER(widget()) c->returnValue()->setString(((QSpinBox *)widget())->specialValueText()); return true; } - -KVSO_CLASS_FUNCTION(spinBox,setSpecialValueText) +KVSO_CLASS_FUNCTION(spinBox, setSpecialValueText) { CHECK_INTERNAL_POINTER(widget()) QString szText; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("text",KVS_PT_STRING,0,szText) + KVSO_PARAMETER("text", KVS_PT_STRING, 0, szText) KVSO_PARAMETERS_END(c) ((QSpinBox *)widget())->setSpecialValueText(szText); return true; } -KVSO_CLASS_FUNCTION(spinBox,setPrefix) +KVSO_CLASS_FUNCTION(spinBox, setPrefix) { CHECK_INTERNAL_POINTER(widget()) QString szPrefix; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("text",KVS_PT_STRING,0,szPrefix) + KVSO_PARAMETER("text", KVS_PT_STRING, 0, szPrefix) KVSO_PARAMETERS_END(c) ((QSpinBox *)widget())->setPrefix(szPrefix); return true; } -KVSO_CLASS_FUNCTION(spinBox,setSuffix) +KVSO_CLASS_FUNCTION(spinBox, setSuffix) { CHECK_INTERNAL_POINTER(widget()) QString szSuffix; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("text",KVS_PT_STRING,0,szSuffix) + KVSO_PARAMETER("text", KVS_PT_STRING, 0, szSuffix) KVSO_PARAMETERS_END(c) ((QSpinBox *)widget())->setSuffix(szSuffix); return true; } -KVSO_CLASS_FUNCTION(spinBox,valueChangedEvent) +KVSO_CLASS_FUNCTION(spinBox, valueChangedEvent) { - emitSignal("valueChanged",c,c->params()); + emitSignal("valueChanged", c, c->params()); return true; } void KvsObject_spinBox::valueChanged(int value) { KviKvsVariantList params(new KviKvsVariant((kvs_int_t)value)); - callFunction(this,"valueChangedEvent",¶ms); + callFunction(this, "valueChangedEvent", ¶ms); } diff --git a/src/modules/objects/KvsObject_spinBox.h b/src/modules/objects/KvsObject_spinBox.h index 20069d06c..f0eb2313d 100644 --- a/src/modules/objects/KvsObject_spinBox.h +++ b/src/modules/objects/KvsObject_spinBox.h @@ -25,8 +25,6 @@ // //============================================================================= - - #include "KvsObject_widget.h" #include "object_macros.h" @@ -38,27 +36,27 @@ public: public: QWidget * widget() { return (QWidget *)object(); }; protected: - virtual bool init(KviKvsRunTimeContext * pContext,KviKvsVariantList *pParams); + virtual bool init(KviKvsRunTimeContext * pContext, KviKvsVariantList * pParams); - bool setTracking(KviKvsObjectFunctionCall *c); + bool setTracking(KviKvsObjectFunctionCall * c); - bool setValue(KviKvsObjectFunctionCall *c); - bool setMinValue(KviKvsObjectFunctionCall *c); - bool setMaxValue(KviKvsObjectFunctionCall *c); - bool setLineStep(KviKvsObjectFunctionCall *c); - bool setPrefix(KviKvsObjectFunctionCall *c); - bool setSuffix(KviKvsObjectFunctionCall *c); - bool value(KviKvsObjectFunctionCall *c); - bool minValue(KviKvsObjectFunctionCall *c); - bool maxValue(KviKvsObjectFunctionCall *c); - bool lineStep(KviKvsObjectFunctionCall *c); - bool setSpecialValueText(KviKvsObjectFunctionCall *c); - bool specialValueText(KviKvsObjectFunctionCall *c); + bool setValue(KviKvsObjectFunctionCall * c); + bool setMinValue(KviKvsObjectFunctionCall * c); + bool setMaxValue(KviKvsObjectFunctionCall * c); + bool setLineStep(KviKvsObjectFunctionCall * c); + bool setPrefix(KviKvsObjectFunctionCall * c); + bool setSuffix(KviKvsObjectFunctionCall * c); + bool value(KviKvsObjectFunctionCall * c); + bool minValue(KviKvsObjectFunctionCall * c); + bool maxValue(KviKvsObjectFunctionCall * c); + bool lineStep(KviKvsObjectFunctionCall * c); + bool setSpecialValueText(KviKvsObjectFunctionCall * c); + bool specialValueText(KviKvsObjectFunctionCall * c); - bool valueChangedEvent(KviKvsObjectFunctionCall *c); + bool valueChangedEvent(KviKvsObjectFunctionCall * c); protected slots: void valueChanged(int); }; -#endif //!_CLASS_SPINBOX_H_ +#endif //!_CLASS_SPINBOX_H_ diff --git a/src/modules/objects/KvsObject_sql.cpp b/src/modules/objects/KvsObject_sql.cpp index 9e212c8b8..e4de050f1 100644 --- a/src/modules/objects/KvsObject_sql.cpp +++ b/src/modules/objects/KvsObject_sql.cpp @@ -33,10 +33,12 @@ #include #include -#define CHECK_QUERY_IS_INIT if (!m_pCurrentSQlQuery)\ - {\ - c->error("No connection has been initialized!");\ - return false;} +#define CHECK_QUERY_IS_INIT \ + if(!m_pCurrentSQlQuery) \ + { \ + c->error("No connection has been initialized!"); \ + return false; \ + } /* @doc: sql @@ -107,63 +109,63 @@ Sets the current query to inactive. */ -KVSO_BEGIN_REGISTERCLASS(KvsObject_sql,"sql","object") - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_sql,queryLastInsertId) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_sql,commit) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_sql,beginTransaction) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_sql,setConnection) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_sql,connectionNames) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_sql,tablesList) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_sql,closeConnection) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_sql,queryFinish) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_sql,queryResultsSize) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_sql,queryExec) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_sql,queryPrepare) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_sql,queryBindValue) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_sql,queryPrevious) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_sql,queryNext) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_sql,queryLast) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_sql,queryFirst) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_sql,queryRecord) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_sql,lastError) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_sql,features) +KVSO_BEGIN_REGISTERCLASS(KvsObject_sql, "sql", "object") +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_sql, queryLastInsertId) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_sql, commit) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_sql, beginTransaction) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_sql, setConnection) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_sql, connectionNames) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_sql, tablesList) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_sql, closeConnection) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_sql, queryFinish) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_sql, queryResultsSize) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_sql, queryExec) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_sql, queryPrepare) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_sql, queryBindValue) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_sql, queryPrevious) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_sql, queryNext) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_sql, queryLast) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_sql, queryFirst) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_sql, queryRecord) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_sql, lastError) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_sql, features) KVSO_END_REGISTERCLASS(KvsObject_sql) +KVSO_BEGIN_CONSTRUCTOR(KvsObject_sql, KviKvsObject) -KVSO_BEGIN_CONSTRUCTOR(KvsObject_sql,KviKvsObject) - - m_pCurrentSQlQuery=0; +m_pCurrentSQlQuery = 0; KVSO_END_CONSTRUCTOR(KvsObject_sql) - KVSO_BEGIN_DESTRUCTOR(KvsObject_sql) - if(m_pCurrentSQlQuery) delete m_pCurrentSQlQuery; - m_pCurrentSQlQuery=0; +if(m_pCurrentSQlQuery) + delete m_pCurrentSQlQuery; +m_pCurrentSQlQuery = 0; KVSO_END_DESTRUCTOR(KvsObject_sql) -KVSO_CLASS_FUNCTION(sql,setConnection) +KVSO_CLASS_FUNCTION(sql, setConnection) { - QString szConnectionName,szDbName,szDbDriver,szUserName,szHostName,szPassword; + QString szConnectionName, szDbName, szDbDriver, szUserName, szHostName, szPassword; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("database_name",KVS_PT_STRING,0,szDbName) - KVSO_PARAMETER("connection_name",KVS_PT_STRING,KVS_PF_OPTIONAL,szConnectionName) - KVSO_PARAMETER("user_name",KVS_PT_STRING,KVS_PF_OPTIONAL,szUserName) - KVSO_PARAMETER("host_name",KVS_PT_STRING,KVS_PF_OPTIONAL,szHostName) - KVSO_PARAMETER("password",KVS_PT_STRING,KVS_PF_OPTIONAL,szPassword) - KVSO_PARAMETER("database_type",KVS_PT_STRING,KVS_PF_OPTIONAL,szDbDriver) + KVSO_PARAMETER("database_name", KVS_PT_STRING, 0, szDbName) + KVSO_PARAMETER("connection_name", KVS_PT_STRING, KVS_PF_OPTIONAL, szConnectionName) + KVSO_PARAMETER("user_name", KVS_PT_STRING, KVS_PF_OPTIONAL, szUserName) + KVSO_PARAMETER("host_name", KVS_PT_STRING, KVS_PF_OPTIONAL, szHostName) + KVSO_PARAMETER("password", KVS_PT_STRING, KVS_PF_OPTIONAL, szPassword) + KVSO_PARAMETER("database_type", KVS_PT_STRING, KVS_PF_OPTIONAL, szDbDriver) KVSO_PARAMETERS_END(c) if(!szDbDriver.isEmpty()) { QStringList drivers = QSqlDatabase::drivers(); - if (!drivers.contains(szDbDriver)) + if(!drivers.contains(szDbDriver)) { - c->error(__tr2qs_ctx("Missing Qt plugin for database %Q","objects"),&szDbDriver); + c->error(__tr2qs_ctx("Missing Qt plugin for database %Q", "objects"), &szDbDriver); return false; } } - else szDbDriver="QSQLITE"; + else + szDbDriver = "QSQLITE"; QSqlDatabase db; - db=QSqlDatabase::addDatabase(szDbDriver,szConnectionName); + db = QSqlDatabase::addDatabase(szDbDriver, szConnectionName); mSzConnectionName = szConnectionName; db.setDatabaseName(szDbName); db.setHostName(szHostName); @@ -172,308 +174,342 @@ KVSO_CLASS_FUNCTION(sql,setConnection) bool bOk = db.open(); if(bOk) { - if(m_pCurrentSQlQuery) delete m_pCurrentSQlQuery; - m_pCurrentSQlQuery = new QSqlQuery(db); + if(m_pCurrentSQlQuery) + delete m_pCurrentSQlQuery; + m_pCurrentSQlQuery = new QSqlQuery(db); } - else m_pCurrentSQlQuery = 0; + else + m_pCurrentSQlQuery = 0; c->returnValue()->setBoolean(bOk); return true; } -KVSO_CLASS_FUNCTION(sql,connectionNames) +KVSO_CLASS_FUNCTION(sql, connectionNames) { QString szFlag; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("stringreturnflag",KVS_PT_STRING,KVS_PF_OPTIONAL,szFlag) + KVSO_PARAMETER("stringreturnflag", KVS_PT_STRING, KVS_PF_OPTIONAL, szFlag) KVSO_PARAMETERS_END(c) - QStringList szConnectionsList=QSqlDatabase::connectionNames(); - if(szFlag.indexOf('s',0,Qt::CaseInsensitive) != -1) + QStringList szConnectionsList = QSqlDatabase::connectionNames(); + if(szFlag.indexOf('s', 0, Qt::CaseInsensitive) != -1) { - QString szConnections=szConnectionsList.join(","); + QString szConnections = szConnectionsList.join(","); c->returnValue()->setString(szConnections); - } else { - KviKvsArray *pArray=new KviKvsArray(); - for(int i=0;iset(i,new KviKvsVariant(szConnectionsList.at(i))); + pArray->set(i, new KviKvsVariant(szConnectionsList.at(i))); } c->returnValue()->setArray(pArray); } return true; } -KVSO_CLASS_FUNCTION(sql,queryLastInsertId) +KVSO_CLASS_FUNCTION(sql, queryLastInsertId) { CHECK_QUERY_IS_INIT - QVariant value=m_pCurrentSQlQuery->lastInsertId(); - if (value.type()==QVariant::LongLong) - c->returnValue()->setInteger((kvs_int_t) value.toLongLong()); - qDebug("type %i",value.type()); + QVariant value = m_pCurrentSQlQuery->lastInsertId(); + if(value.type() == QVariant::LongLong) + c->returnValue()->setInteger((kvs_int_t)value.toLongLong()); + qDebug("type %i", value.type()); return true; } -KVSO_CLASS_FUNCTION(sql,features) +KVSO_CLASS_FUNCTION(sql, features) { QString szConnectionName; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("connectionName",KVS_PT_STRING,0,szConnectionName) + KVSO_PARAMETER("connectionName", KVS_PT_STRING, 0, szConnectionName) KVSO_PARAMETERS_END(c) QStringList connections = QSqlDatabase::connectionNames(); - if (!connections.contains(szConnectionName)) + if(!connections.contains(szConnectionName)) { - c->warning(__tr2qs_ctx("Connection %Q doesn't exist","objects"),&szConnectionName); + c->warning(__tr2qs_ctx("Connection %Q doesn't exist", "objects"), &szConnectionName); return true; } - QSqlDatabase db=QSqlDatabase::database(szConnectionName); - QSqlDriver *sqlDriver=db.driver(); + QSqlDatabase db = QSqlDatabase::database(szConnectionName); + QSqlDriver * sqlDriver = db.driver(); QStringList features; - if (sqlDriver->hasFeature(QSqlDriver::Transactions)) features.append("transactions"); - if (sqlDriver->hasFeature(QSqlDriver::QuerySize)) features.append("querysize"); - if (sqlDriver->hasFeature(QSqlDriver::BLOB)) features.append("blob"); - if (sqlDriver->hasFeature(QSqlDriver::PreparedQueries)) features.append("preparedqueries"); - if (sqlDriver->hasFeature(QSqlDriver::NamedPlaceholders)) features.append("namedplaceholders"); - if (sqlDriver->hasFeature(QSqlDriver::PositionalPlaceholders)) features.append("positionaplaceholders"); - if (sqlDriver->hasFeature(QSqlDriver::LastInsertId)) features.append("lastinsertid"); - if (sqlDriver->hasFeature(QSqlDriver::BatchOperations)) features.append("batchoperations"); - if (sqlDriver->hasFeature(QSqlDriver::SimpleLocking)) features.append("simplelocking"); - if (sqlDriver->hasFeature(QSqlDriver::LowPrecisionNumbers)) features.append("lowprecisionnumbers"); - if (sqlDriver->hasFeature(QSqlDriver::EventNotifications)) features.append("eventnotifications"); - if (sqlDriver->hasFeature(QSqlDriver::FinishQuery)) features.append("finishquery"); - if (sqlDriver->hasFeature(QSqlDriver::MultipleResultSets)) features.append("multipleresults"); + if(sqlDriver->hasFeature(QSqlDriver::Transactions)) + features.append("transactions"); + if(sqlDriver->hasFeature(QSqlDriver::QuerySize)) + features.append("querysize"); + if(sqlDriver->hasFeature(QSqlDriver::BLOB)) + features.append("blob"); + if(sqlDriver->hasFeature(QSqlDriver::PreparedQueries)) + features.append("preparedqueries"); + if(sqlDriver->hasFeature(QSqlDriver::NamedPlaceholders)) + features.append("namedplaceholders"); + if(sqlDriver->hasFeature(QSqlDriver::PositionalPlaceholders)) + features.append("positionaplaceholders"); + if(sqlDriver->hasFeature(QSqlDriver::LastInsertId)) + features.append("lastinsertid"); + if(sqlDriver->hasFeature(QSqlDriver::BatchOperations)) + features.append("batchoperations"); + if(sqlDriver->hasFeature(QSqlDriver::SimpleLocking)) + features.append("simplelocking"); + if(sqlDriver->hasFeature(QSqlDriver::LowPrecisionNumbers)) + features.append("lowprecisionnumbers"); + if(sqlDriver->hasFeature(QSqlDriver::EventNotifications)) + features.append("eventnotifications"); + if(sqlDriver->hasFeature(QSqlDriver::FinishQuery)) + features.append("finishquery"); + if(sqlDriver->hasFeature(QSqlDriver::MultipleResultSets)) + features.append("multipleresults"); c->returnValue()->setString(features.join(",")); return true; } -KVSO_CLASS_FUNCTION(sql,beginTransaction) +KVSO_CLASS_FUNCTION(sql, beginTransaction) { QSqlDatabase db = QSqlDatabase::database(mSzConnectionName); if(!db.isValid()) { - c->error("No connection has been initialized!"); - return false; + c->error("No connection has been initialized!"); + return false; } db.transaction(); return true; } -KVSO_CLASS_FUNCTION(sql,commit) +KVSO_CLASS_FUNCTION(sql, commit) { QSqlDatabase db = QSqlDatabase::database(mSzConnectionName); if(!db.isValid()) { - c->error("No connection has been initialized!"); - return false; + c->error("No connection has been initialized!"); + return false; } - db.commit(); + db.commit(); return true; } -KVSO_CLASS_FUNCTION(sql,closeConnection) +KVSO_CLASS_FUNCTION(sql, closeConnection) { QString szConnectionName; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("connection_name",KVS_PT_STRING,KVS_PF_OPTIONAL,szConnectionName) + KVSO_PARAMETER("connection_name", KVS_PT_STRING, KVS_PF_OPTIONAL, szConnectionName) KVSO_PARAMETERS_END(c) if(!szConnectionName.isEmpty()) { - QStringList connections = QSqlDatabase::connectionNames(); - if (!connections.contains(szConnectionName)) - { - c->warning(__tr2qs_ctx("Connection %Q doesn't exist","objects"),&szConnectionName); + QStringList connections = QSqlDatabase::connectionNames(); + if(!connections.contains(szConnectionName)) + { + c->warning(__tr2qs_ctx("Connection %Q doesn't exist", "objects"), &szConnectionName); + return true; + } + if(m_pCurrentSQlQuery) + { + delete m_pCurrentSQlQuery; + m_pCurrentSQlQuery = 0; + } + QSqlDatabase::removeDatabase(szConnectionName); return true; - } - if(m_pCurrentSQlQuery) - { - delete m_pCurrentSQlQuery; - m_pCurrentSQlQuery = 0; - } - QSqlDatabase::removeDatabase(szConnectionName); - return true; } if(m_pCurrentSQlQuery) { - delete m_pCurrentSQlQuery; - m_pCurrentSQlQuery = 0; + delete m_pCurrentSQlQuery; + m_pCurrentSQlQuery = 0; } QSqlDatabase::removeDatabase(mSzConnectionName); return true; } -KVSO_CLASS_FUNCTION(sql,tablesList) +KVSO_CLASS_FUNCTION(sql, tablesList) { - QSqlDatabase db = QSqlDatabase::database(mSzConnectionName); + QSqlDatabase db = QSqlDatabase::database(mSzConnectionName); if(!db.isValid()) { - c->error("No connection has been initialized!"); - return false; + c->error("No connection has been initialized!"); + return false; } - QStringList tables=db.tables(); - KviKvsArray *pArray=new KviKvsArray(); - for(int i=0;iset(i,new KviKvsVariant(tables.at(i))); + pArray->set(i, new KviKvsVariant(tables.at(i))); } c->returnValue()->setArray(pArray); return true; } -KVSO_CLASS_FUNCTION(sql,queryFinish) +KVSO_CLASS_FUNCTION(sql, queryFinish) { CHECK_QUERY_IS_INIT m_pCurrentSQlQuery->finish(); return true; } -KVSO_CLASS_FUNCTION(sql,queryPrepare) +KVSO_CLASS_FUNCTION(sql, queryPrepare) { CHECK_QUERY_IS_INIT QString szQuery; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("query",KVS_PT_STRING,0,szQuery) + KVSO_PARAMETER("query", KVS_PT_STRING, 0, szQuery) KVSO_PARAMETERS_END(c) c->returnValue()->setBoolean(m_pCurrentSQlQuery->prepare(szQuery)); return true; } -KVSO_CLASS_FUNCTION(sql,queryBindValue) +KVSO_CLASS_FUNCTION(sql, queryBindValue) { CHECK_QUERY_IS_INIT QString szFieldName; - KviKvsVariant *v; + KviKvsVariant * v; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("bindName",KVS_PT_STRING,0,szFieldName) - KVSO_PARAMETER("value",KVS_PT_VARIANT,0,v) + KVSO_PARAMETER("bindName", KVS_PT_STRING, 0, szFieldName) + KVSO_PARAMETER("value", KVS_PT_VARIANT, 0, v) KVSO_PARAMETERS_END(c) QString szType; v->getTypeName(szType); - if (v->isString()|| v->isNothing()) + if(v->isString() || v->isNothing()) { QString szText; v->asString(szText); - m_pCurrentSQlQuery->bindValue(szFieldName,QVariant(szText)); + m_pCurrentSQlQuery->bindValue(szFieldName, QVariant(szText)); } - else if (v->isReal()) + else if(v->isReal()) { kvs_real_t i; v->asReal(i); - m_pCurrentSQlQuery->bindValue(szFieldName,QVariant((double)i)); + m_pCurrentSQlQuery->bindValue(szFieldName, QVariant((double)i)); } - else if (v->isInteger()) + else if(v->isInteger()) { kvs_int_t i; v->asInteger(i); - m_pCurrentSQlQuery->bindValue(szFieldName,QVariant((int)i)); + m_pCurrentSQlQuery->bindValue(szFieldName, QVariant((int)i)); } - else if (v->isBoolean()) + else if(v->isBoolean()) { - bool b=v->asBoolean(); - m_pCurrentSQlQuery->bindValue(szFieldName,QVariant(b)); + bool b = v->asBoolean(); + m_pCurrentSQlQuery->bindValue(szFieldName, QVariant(b)); } - else if (v->isHObject()) + else if(v->isHObject()) { kvs_hobject_t hOb; v->asHObject(hOb); - KviKvsObject *pObject; - pObject=KviKvsKernel::instance()->objectController()->lookupObject(hOb); - if (pObject->inheritsClass("memorybuffer")) - m_pCurrentSQlQuery->bindValue(szFieldName,QVariant(*((KvsObject_memoryBuffer *)pObject)->pBuffer())); - else c->warning(__tr2qs_ctx("Only memorybuffer class object is supported","objects")); + KviKvsObject * pObject; + pObject = KviKvsKernel::instance()->objectController()->lookupObject(hOb); + if(pObject->inheritsClass("memorybuffer")) + m_pCurrentSQlQuery->bindValue(szFieldName, QVariant(*((KvsObject_memoryBuffer *)pObject)->pBuffer())); + else + c->warning(__tr2qs_ctx("Only memorybuffer class object is supported", "objects")); } else { QString szTypeName; v->getTypeName(szTypeName); - c->warning(__tr2qs_ctx("Type value %Q not supported","objects"),&szTypeName); + c->warning(__tr2qs_ctx("Type value %Q not supported", "objects"), &szTypeName); } return true; } -KVSO_CLASS_FUNCTION(sql,queryExec) +KVSO_CLASS_FUNCTION(sql, queryExec) { CHECK_QUERY_IS_INIT QString szQuery; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("query",KVS_PT_STRING,KVS_PF_OPTIONAL,szQuery) + KVSO_PARAMETER("query", KVS_PT_STRING, KVS_PF_OPTIONAL, szQuery) KVSO_PARAMETERS_END(c) bool bOk; - if (szQuery.isEmpty()) bOk=m_pCurrentSQlQuery->exec(); - else bOk=m_pCurrentSQlQuery->exec(szQuery.toLatin1()); + if(szQuery.isEmpty()) + bOk = m_pCurrentSQlQuery->exec(); + else + bOk = m_pCurrentSQlQuery->exec(szQuery.toLatin1()); c->returnValue()->setBoolean(bOk); return true; } -KVSO_CLASS_FUNCTION(sql,queryNext) +KVSO_CLASS_FUNCTION(sql, queryNext) { CHECK_QUERY_IS_INIT - if (m_pCurrentSQlQuery->isActive() && m_pCurrentSQlQuery->isSelect()) c->returnValue()->setBoolean(m_pCurrentSQlQuery->next()); - else c->returnValue()->setNothing(); + if(m_pCurrentSQlQuery->isActive() && m_pCurrentSQlQuery->isSelect()) + c->returnValue()->setBoolean(m_pCurrentSQlQuery->next()); + else + c->returnValue()->setNothing(); return true; } -KVSO_CLASS_FUNCTION(sql,queryPrevious) +KVSO_CLASS_FUNCTION(sql, queryPrevious) { CHECK_QUERY_IS_INIT - if (m_pCurrentSQlQuery->isActive() && m_pCurrentSQlQuery->isSelect()) c->returnValue()->setBoolean(m_pCurrentSQlQuery->previous()); - else c->returnValue()->setNothing(); + if(m_pCurrentSQlQuery->isActive() && m_pCurrentSQlQuery->isSelect()) + c->returnValue()->setBoolean(m_pCurrentSQlQuery->previous()); + else + c->returnValue()->setNothing(); return true; } -KVSO_CLASS_FUNCTION(sql,queryResultsSize) +KVSO_CLASS_FUNCTION(sql, queryResultsSize) { CHECK_QUERY_IS_INIT c->returnValue()->setInteger(m_pCurrentSQlQuery->size()); return true; } -KVSO_CLASS_FUNCTION(sql,queryFirst) +KVSO_CLASS_FUNCTION(sql, queryFirst) { CHECK_QUERY_IS_INIT - if (m_pCurrentSQlQuery->isActive() && m_pCurrentSQlQuery->isSelect()) c->returnValue()->setBoolean(m_pCurrentSQlQuery->first()); + if(m_pCurrentSQlQuery->isActive() && m_pCurrentSQlQuery->isSelect()) + c->returnValue()->setBoolean(m_pCurrentSQlQuery->first()); return true; } -KVSO_CLASS_FUNCTION(sql,queryLast) +KVSO_CLASS_FUNCTION(sql, queryLast) { CHECK_QUERY_IS_INIT - if (m_pCurrentSQlQuery->isActive() && m_pCurrentSQlQuery->isSelect()) c->returnValue()->setBoolean(m_pCurrentSQlQuery->last()); + if(m_pCurrentSQlQuery->isActive() && m_pCurrentSQlQuery->isSelect()) + c->returnValue()->setBoolean(m_pCurrentSQlQuery->last()); return true; } -KVSO_CLASS_FUNCTION(sql,queryRecord) +KVSO_CLASS_FUNCTION(sql, queryRecord) { CHECK_QUERY_IS_INIT - KviKvsHash *pHash=new KviKvsHash(); - QSqlRecord record=m_pCurrentSQlQuery->record(); - for(int i=0;irecord(); + for(int i = 0; i < record.count(); i++) { - KviKvsVariant *pValue=0; - QVariant value=record.value(i); - if (value.type()==QVariant::LongLong) pValue=new KviKvsVariant((kvs_int_t) value.toLongLong()); - else if (value.type()==QVariant::String) pValue=new KviKvsVariant(value.toString()); - else if (value.type()==QVariant::ByteArray) + KviKvsVariant * pValue = 0; + QVariant value = record.value(i); + if(value.type() == QVariant::LongLong) + pValue = new KviKvsVariant((kvs_int_t)value.toLongLong()); + else if(value.type() == QVariant::String) + pValue = new KviKvsVariant(value.toString()); + else if(value.type() == QVariant::ByteArray) { KviKvsObjectClass * pClass = KviKvsKernel::instance()->objectController()->lookupClass("memoryBuffer"); KviKvsVariantList params(new KviKvsVariant(QString())); - KviKvsObject * pObject = pClass->allocateInstance(0,"",c->context(),¶ms); - *((KvsObject_memoryBuffer *)pObject)->pBuffer()=value.toByteArray(); - pValue=new KviKvsVariant(pObject->handle()); + KviKvsObject * pObject = pClass->allocateInstance(0, "", c->context(), ¶ms); + *((KvsObject_memoryBuffer *)pObject)->pBuffer() = value.toByteArray(); + pValue = new KviKvsVariant(pObject->handle()); } - else pValue=new KviKvsVariant(QString()); - pHash->set(record.fieldName(i),pValue); - KviKvsVariant *value2=pHash->get(record.fieldName(i)); + else + pValue = new KviKvsVariant(QString()); + pHash->set(record.fieldName(i), pValue); + KviKvsVariant * value2 = pHash->get(record.fieldName(i)); value2->type(); } c->returnValue()->setHash(pHash); return true; } -KVSO_CLASS_FUNCTION(sql,lastError) +KVSO_CLASS_FUNCTION(sql, lastError) { CHECK_QUERY_IS_INIT bool bMoreErrorDetails; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("more",KVS_PT_BOOLEAN,KVS_PF_OPTIONAL,bMoreErrorDetails) + KVSO_PARAMETER("more", KVS_PT_BOOLEAN, KVS_PF_OPTIONAL, bMoreErrorDetails) KVSO_PARAMETERS_END(c) QString szError; - QSqlError error=m_pCurrentSQlQuery->lastError(); - if (bMoreErrorDetails) szError=error.text(); + QSqlError error = m_pCurrentSQlQuery->lastError(); + if(bMoreErrorDetails) + szError = error.text(); else { - if (error.type()==QSqlError::StatementError) szError="SyntaxError"; - else if (error.type()==QSqlError::ConnectionError) szError="ConnectionError"; - else if (error.type()==QSqlError::TransactionError) szError="TransactionError"; - else szError="UnkonwnError"; + if(error.type() == QSqlError::StatementError) + szError = "SyntaxError"; + else if(error.type() == QSqlError::ConnectionError) + szError = "ConnectionError"; + else if(error.type() == QSqlError::TransactionError) + szError = "TransactionError"; + else + szError = "UnkonwnError"; } c->returnValue()->setString(szError); return true; diff --git a/src/modules/objects/KvsObject_sql.h b/src/modules/objects/KvsObject_sql.h index dff227903..71451610e 100644 --- a/src/modules/objects/KvsObject_sql.h +++ b/src/modules/objects/KvsObject_sql.h @@ -37,33 +37,31 @@ class KvsObject_sql : public KviKvsObject public: KVSO_DECLARE_OBJECT(KvsObject_sql) protected: - QSqlQuery *m_pCurrentSQlQuery; + QSqlQuery * m_pCurrentSQlQuery; QString mSzConnectionName; public: - bool setConnection(KviKvsObjectFunctionCall *c); - bool connectionNames(KviKvsObjectFunctionCall *c); - bool features(KviKvsObjectFunctionCall *c); - bool queryLastInsertId(KviKvsObjectFunctionCall *c); + bool setConnection(KviKvsObjectFunctionCall * c); + bool connectionNames(KviKvsObjectFunctionCall * c); + bool features(KviKvsObjectFunctionCall * c); + bool queryLastInsertId(KviKvsObjectFunctionCall * c); - bool tablesList(KviKvsObjectFunctionCall *c); - bool beginTransaction(KviKvsObjectFunctionCall *c); - bool commit(KviKvsObjectFunctionCall *c); - - bool queryResultsSize(KviKvsObjectFunctionCall *c); - bool queryNext(KviKvsObjectFunctionCall *c); - bool queryPrevious(KviKvsObjectFunctionCall *c); - bool queryFirst(KviKvsObjectFunctionCall *c); - bool queryLast(KviKvsObjectFunctionCall *c); - bool queryExec(KviKvsObjectFunctionCall *c); - bool queryRecord(KviKvsObjectFunctionCall *c); - bool queryPrepare(KviKvsObjectFunctionCall *c); - bool queryBindValue(KviKvsObjectFunctionCall *c); - bool queryFinish(KviKvsObjectFunctionCall *c); - bool closeConnection(KviKvsObjectFunctionCall *c); - bool lastError(KviKvsObjectFunctionCall *c); + bool tablesList(KviKvsObjectFunctionCall * c); + bool beginTransaction(KviKvsObjectFunctionCall * c); + bool commit(KviKvsObjectFunctionCall * c); + bool queryResultsSize(KviKvsObjectFunctionCall * c); + bool queryNext(KviKvsObjectFunctionCall * c); + bool queryPrevious(KviKvsObjectFunctionCall * c); + bool queryFirst(KviKvsObjectFunctionCall * c); + bool queryLast(KviKvsObjectFunctionCall * c); + bool queryExec(KviKvsObjectFunctionCall * c); + bool queryRecord(KviKvsObjectFunctionCall * c); + bool queryPrepare(KviKvsObjectFunctionCall * c); + bool queryBindValue(KviKvsObjectFunctionCall * c); + bool queryFinish(KviKvsObjectFunctionCall * c); + bool closeConnection(KviKvsObjectFunctionCall * c); + bool lastError(KviKvsObjectFunctionCall * c); }; - #endif //_CLASS_SQLITE_H_ diff --git a/src/modules/objects/KvsObject_tabWidget.cpp b/src/modules/objects/KvsObject_tabWidget.cpp index 69a9ea652..018ed70b1 100644 --- a/src/modules/objects/KvsObject_tabWidget.cpp +++ b/src/modules/objects/KvsObject_tabWidget.cpp @@ -148,233 +148,230 @@ This signal is emitted by the default implementation of [classfnc]tabCloseRequestEvent[/classfnc]().[br] */ -KVSO_BEGIN_REGISTERCLASS(KvsObject_tabWidget,"tabWidget","widget") - - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_tabWidget,addTab) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_tabWidget,insertTab) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_tabWidget,setTabToolTip) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_tabWidget,removeTabToolTip) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_tabWidget,setTabLabel) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_tabWidget,changeTab) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_tabWidget,setCurrentPage) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_tabWidget,currentPageIndex) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_tabWidget,tabLabel) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_tabWidget,currentTabLabel) - - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_tabWidget,count) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_tabWidget,removePage) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_tabWidget,widgetAt) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_tabWidget,indexOf) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_tabWidget,setTabPosition) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_tabWidget,setTabsClosable) - - // events - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_tabWidget,currentChangedEvent) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_tabWidget,tabCloseRequestEvent) - - +KVSO_BEGIN_REGISTERCLASS(KvsObject_tabWidget, "tabWidget", "widget") + +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_tabWidget, addTab) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_tabWidget, insertTab) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_tabWidget, setTabToolTip) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_tabWidget, removeTabToolTip) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_tabWidget, setTabLabel) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_tabWidget, changeTab) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_tabWidget, setCurrentPage) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_tabWidget, currentPageIndex) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_tabWidget, tabLabel) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_tabWidget, currentTabLabel) + +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_tabWidget, count) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_tabWidget, removePage) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_tabWidget, widgetAt) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_tabWidget, indexOf) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_tabWidget, setTabPosition) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_tabWidget, setTabsClosable) + +// events +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_tabWidget, currentChangedEvent) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_tabWidget, tabCloseRequestEvent) KVSO_END_REGISTERCLASS(KvsObject_tabWidget) -KVSO_BEGIN_CONSTRUCTOR(KvsObject_tabWidget,KvsObject_widget) +KVSO_BEGIN_CONSTRUCTOR(KvsObject_tabWidget, KvsObject_widget) KVSO_END_CONSTRUCTOR(KvsObject_tabWidget) - KVSO_BEGIN_DESTRUCTOR(KvsObject_tabWidget) tabsList.clear(); KVSO_END_DESTRUCTOR(KvsObject_tabWidget) -bool KvsObject_tabWidget::init(KviKvsRunTimeContext *,KviKvsVariantList *) +bool KvsObject_tabWidget::init(KviKvsRunTimeContext *, KviKvsVariantList *) { SET_OBJECT(QTabWidget) - connect(widget(),SIGNAL(currentChanged(int)),this,SLOT(slotCurrentChanged(int))); - connect(widget(),SIGNAL(tabCloseRequested(int)),this,SLOT(slotTabCloseRequest(int))); + connect(widget(), SIGNAL(currentChanged(int)), this, SLOT(slotCurrentChanged(int))); + connect(widget(), SIGNAL(tabCloseRequested(int)), this, SLOT(slotTabCloseRequest(int))); return true; } -KVSO_CLASS_FUNCTION(tabWidget,setTabsClosable) +KVSO_CLASS_FUNCTION(tabWidget, setTabsClosable) { CHECK_INTERNAL_POINTER(widget()) bool bClosable; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("bool_flag",KVS_PT_BOOLEAN,0,bClosable) + KVSO_PARAMETER("bool_flag", KVS_PT_BOOLEAN, 0, bClosable) KVSO_PARAMETERS_END(c) ((QTabWidget *)widget())->setTabsClosable(bClosable); return true; } -KVSO_CLASS_FUNCTION(tabWidget,addTab) +KVSO_CLASS_FUNCTION(tabWidget, addTab) { CHECK_INTERNAL_POINTER(widget()) - KviKvsObject *pObject; - QString szLabel,szIcon; + KviKvsObject * pObject; + QString szLabel, szIcon; kvs_hobject_t hObject; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("widget",KVS_PT_HOBJECT,0,hObject) - KVSO_PARAMETER("label",KVS_PT_STRING,0,szLabel) - KVSO_PARAMETER("icon_id",KVS_PT_STRING,KVS_PF_OPTIONAL,szIcon) + KVSO_PARAMETER("widget", KVS_PT_HOBJECT, 0, hObject) + KVSO_PARAMETER("label", KVS_PT_STRING, 0, szLabel) + KVSO_PARAMETER("icon_id", KVS_PT_STRING, KVS_PF_OPTIONAL, szIcon) KVSO_PARAMETERS_END(c) - pObject=KviKvsKernel::instance()->objectController()->lookupObject(hObject); + pObject = KviKvsKernel::instance()->objectController()->lookupObject(hObject); CHECK_HOBJECT_IS_WIDGET(pObject) QPixmap * pix = g_pIconManager->getImage(szIcon); - if(pix){ - ((QTabWidget *)widget())->addTab(((QWidget *)(pObject->object())),QIcon(*pix),szLabel); + if(pix) + { + ((QTabWidget *)widget())->addTab(((QWidget *)(pObject->object())), QIcon(*pix), szLabel); } - else((QTabWidget *)widget())->addTab(((QWidget *)(pObject->object())),szLabel); + else + ((QTabWidget *)widget())->addTab(((QWidget *)(pObject->object())), szLabel); this->children(); tabsList.append(hObject); return true; } -KVSO_CLASS_FUNCTION(tabWidget,indexOf) +KVSO_CLASS_FUNCTION(tabWidget, indexOf) { CHECK_INTERNAL_POINTER(widget()) - KviKvsObject *pObject; - QString szLabel,szIcon; + KviKvsObject * pObject; + QString szLabel, szIcon; kvs_hobject_t hObject; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("widget",KVS_PT_HOBJECT,0,hObject) + KVSO_PARAMETER("widget", KVS_PT_HOBJECT, 0, hObject) KVSO_PARAMETERS_END(c) - pObject=KviKvsKernel::instance()->objectController()->lookupObject(hObject); + pObject = KviKvsKernel::instance()->objectController()->lookupObject(hObject); CHECK_HOBJECT_IS_WIDGET(pObject) - int iIdx=((QTabWidget *)widget())->indexOf(((KvsObject_widget*)pObject)->widget()); + int iIdx = ((QTabWidget *)widget())->indexOf(((KvsObject_widget *)pObject)->widget()); c->returnValue()->setInteger((kvs_int_t)iIdx); return true; } - -KVSO_CLASS_FUNCTION(tabWidget,widgetAt) +KVSO_CLASS_FUNCTION(tabWidget, widgetAt) { CHECK_INTERNAL_POINTER(widget()) kvs_int_t iIndex; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("index",KVS_PT_INTEGER,0,iIndex) + KVSO_PARAMETER("index", KVS_PT_INTEGER, 0, iIndex) KVSO_PARAMETERS_END(c) - if (iIndex>=tabsList.count()||iIndex<0) + if(iIndex >= tabsList.count() || iIndex < 0) c->returnValue()->setHObject((kvs_hobject_t)0); else c->returnValue()->setHObject(tabsList.at(iIndex)); return true; } -KVSO_CLASS_FUNCTION(tabWidget,insertTab) +KVSO_CLASS_FUNCTION(tabWidget, insertTab) { CHECK_INTERNAL_POINTER(widget()) - KviKvsObject *pObject; - QString szLabel,szIcon; + KviKvsObject * pObject; + QString szLabel, szIcon; kvs_uint_t uIndex; kvs_hobject_t hObject; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("tab_widget",KVS_PT_HOBJECT,0,hObject) - KVSO_PARAMETER("label",KVS_PT_STRING,0,szLabel) - KVSO_PARAMETER("index",KVS_PT_UNSIGNEDINTEGER,0,uIndex) - KVSO_PARAMETER("icon_id",KVS_PT_STRING,KVS_PF_OPTIONAL,szIcon) + KVSO_PARAMETER("tab_widget", KVS_PT_HOBJECT, 0, hObject) + KVSO_PARAMETER("label", KVS_PT_STRING, 0, szLabel) + KVSO_PARAMETER("index", KVS_PT_UNSIGNEDINTEGER, 0, uIndex) + KVSO_PARAMETER("icon_id", KVS_PT_STRING, KVS_PF_OPTIONAL, szIcon) KVSO_PARAMETERS_END(c) - pObject=KviKvsKernel::instance()->objectController()->lookupObject(hObject); + pObject = KviKvsKernel::instance()->objectController()->lookupObject(hObject); CHECK_HOBJECT_IS_WIDGET(pObject) QPixmap * pix = g_pIconManager->getImage(szIcon); if(pix) - ((QTabWidget *)widget())->insertTab(uIndex,(QWidget *)(pObject->object()),QIcon(*pix),szLabel); + ((QTabWidget *)widget())->insertTab(uIndex, (QWidget *)(pObject->object()), QIcon(*pix), szLabel); else - ((QTabWidget *)widget())->insertTab(uIndex,((QWidget *)(pObject->object())),szLabel); - tabsList.insert(uIndex,hObject); + ((QTabWidget *)widget())->insertTab(uIndex, ((QWidget *)(pObject->object())), szLabel); + tabsList.insert(uIndex, hObject); return true; } -KVSO_CLASS_FUNCTION(tabWidget,setCurrentPage) +KVSO_CLASS_FUNCTION(tabWidget, setCurrentPage) { CHECK_INTERNAL_POINTER(widget()) kvs_uint_t iIndex; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("index",KVS_PT_UNSIGNEDINTEGER,0,iIndex) + KVSO_PARAMETER("index", KVS_PT_UNSIGNEDINTEGER, 0, iIndex) KVSO_PARAMETERS_END(c) ((QTabWidget *)widget())->setCurrentIndex(iIndex); return true; } -KVSO_CLASS_FUNCTION(tabWidget,setTabToolTip) +KVSO_CLASS_FUNCTION(tabWidget, setTabToolTip) { CHECK_INTERNAL_POINTER(widget()) - KviKvsObject *pObject; + KviKvsObject * pObject; QString szTooltip; kvs_hobject_t hObject; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("tab_widget",KVS_PT_HOBJECT,0,hObject) - KVSO_PARAMETER("tooltip",KVS_PT_STRING,0,szTooltip) + KVSO_PARAMETER("tab_widget", KVS_PT_HOBJECT, 0, hObject) + KVSO_PARAMETER("tooltip", KVS_PT_STRING, 0, szTooltip) KVSO_PARAMETERS_END(c) - pObject=KviKvsKernel::instance()->objectController()->lookupObject(hObject); + pObject = KviKvsKernel::instance()->objectController()->lookupObject(hObject); CHECK_HOBJECT_IS_WIDGET(pObject) - int iIdx = ((QTabWidget *)widget())->indexOf (((QWidget *)(pObject->object()))); - if (iIdx == -1) + int iIdx = ((QTabWidget *)widget())->indexOf(((QWidget *)(pObject->object()))); + if(iIdx == -1) { - c->warning(__tr2qs_ctx("Can't find the tab ","objects")); + c->warning(__tr2qs_ctx("Can't find the tab ", "objects")); return true; } - ((QTabWidget *)widget())->setTabToolTip(iIdx,szTooltip); + ((QTabWidget *)widget())->setTabToolTip(iIdx, szTooltip); return true; } -KVSO_CLASS_FUNCTION(tabWidget,removeTabToolTip) +KVSO_CLASS_FUNCTION(tabWidget, removeTabToolTip) { CHECK_INTERNAL_POINTER(widget()) - KviKvsObject *pObject; + KviKvsObject * pObject; kvs_hobject_t hObject; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("tab_widget",KVS_PT_HOBJECT,0,hObject) + KVSO_PARAMETER("tab_widget", KVS_PT_HOBJECT, 0, hObject) KVSO_PARAMETERS_END(c) - pObject=KviKvsKernel::instance()->objectController()->lookupObject(hObject); + pObject = KviKvsKernel::instance()->objectController()->lookupObject(hObject); CHECK_HOBJECT_IS_WIDGET(pObject) - int iIdx = ((QTabWidget *)widget())->indexOf (((QWidget *)(pObject->object()))) ; - if (iIdx==-1) + int iIdx = ((QTabWidget *)widget())->indexOf(((QWidget *)(pObject->object()))); + if(iIdx == -1) { - c->warning(__tr2qs_ctx("Can't find the tab ","objects")); + c->warning(__tr2qs_ctx("Can't find the tab ", "objects")); return true; } - ((QTabWidget *)widget())->setTabToolTip(iIdx,QString()); + ((QTabWidget *)widget())->setTabToolTip(iIdx, QString()); return true; } -KVSO_CLASS_FUNCTION(tabWidget,setTabLabel) +KVSO_CLASS_FUNCTION(tabWidget, setTabLabel) { CHECK_INTERNAL_POINTER(widget()) - KviKvsObject *pObject; + KviKvsObject * pObject; QString szLabel; kvs_hobject_t hObject; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("tab_widget",KVS_PT_HOBJECT,0, hObject) - KVSO_PARAMETER("tooltip",KVS_PT_STRING,0,szLabel) + KVSO_PARAMETER("tab_widget", KVS_PT_HOBJECT, 0, hObject) + KVSO_PARAMETER("tooltip", KVS_PT_STRING, 0, szLabel) KVSO_PARAMETERS_END(c) - pObject=KviKvsKernel::instance()->objectController()->lookupObject(hObject); + pObject = KviKvsKernel::instance()->objectController()->lookupObject(hObject); CHECK_HOBJECT_IS_WIDGET(pObject) - int iIdx = ((QTabWidget *)widget())->indexOf (((QWidget *)(pObject->object()))); - if (iIdx == -1) + int iIdx = ((QTabWidget *)widget())->indexOf(((QWidget *)(pObject->object()))); + if(iIdx == -1) { - c->warning(__tr2qs_ctx("Can't find the tab ","objects")); + c->warning(__tr2qs_ctx("Can't find the tab ", "objects")); return true; } - ((QTabWidget *)widget())->setTabText(iIdx,szLabel); + ((QTabWidget *)widget())->setTabText(iIdx, szLabel); return true; } -KVSO_CLASS_FUNCTION(tabWidget,currentPageIndex) +KVSO_CLASS_FUNCTION(tabWidget, currentPageIndex) { CHECK_INTERNAL_POINTER(widget()) - int index=((QTabWidget *)widget())->currentIndex(); + int index = ((QTabWidget *)widget())->currentIndex(); c->returnValue()->setInteger(index); return true; } -KVSO_CLASS_FUNCTION(tabWidget,tabLabel) +KVSO_CLASS_FUNCTION(tabWidget, tabLabel) { CHECK_INTERNAL_POINTER(widget()) kvs_int_t uIndex; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("index",KVS_PT_INT,0,uIndex) + KVSO_PARAMETER("index", KVS_PT_INT, 0, uIndex) KVSO_PARAMETERS_END(c) - QString label=((QTabWidget *)widget())->tabText(uIndex); + QString label = ((QTabWidget *)widget())->tabText(uIndex); c->returnValue()->setString(label); return true; } - -KVSO_CLASS_FUNCTION(tabWidget,count) +KVSO_CLASS_FUNCTION(tabWidget, count) { CHECK_INTERNAL_POINTER(widget()) int count = ((QTabWidget *)widget())->count(); @@ -382,28 +379,28 @@ KVSO_CLASS_FUNCTION(tabWidget,count) return true; } -KVSO_CLASS_FUNCTION(tabWidget,currentTabLabel) +KVSO_CLASS_FUNCTION(tabWidget, currentTabLabel) { CHECK_INTERNAL_POINTER(widget()) - int i= ((QTabWidget *)widget())->currentIndex(); - QString label=((QTabWidget *)widget())->tabText(i); + int i = ((QTabWidget *)widget())->currentIndex(); + QString label = ((QTabWidget *)widget())->tabText(i); c->returnValue()->setString(label); - return true; + return true; } -KVSO_CLASS_FUNCTION(tabWidget,removePage) +KVSO_CLASS_FUNCTION(tabWidget, removePage) { CHECK_INTERNAL_POINTER(widget()) - KviKvsObject *pObject; + KviKvsObject * pObject; kvs_hobject_t hObject; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("tab_widget",KVS_PT_HOBJECT,0,hObject) + KVSO_PARAMETER("tab_widget", KVS_PT_HOBJECT, 0, hObject) KVSO_PARAMETERS_END(c) - pObject=KviKvsKernel::instance()->objectController()->lookupObject(hObject); + pObject = KviKvsKernel::instance()->objectController()->lookupObject(hObject); CHECK_HOBJECT_IS_WIDGET(pObject) - int iIdx = ((QTabWidget *)widget())->indexOf (((QWidget *)(pObject->object()))); - if (iIdx == -1) + int iIdx = ((QTabWidget *)widget())->indexOf(((QWidget *)(pObject->object()))); + if(iIdx == -1) { - c->warning(__tr2qs_ctx("Can't find the tab ","objects")); + c->warning(__tr2qs_ctx("Can't find the tab ", "objects")); return true; } ((QTabWidget *)widget())->removeTab(iIdx); @@ -411,67 +408,68 @@ KVSO_CLASS_FUNCTION(tabWidget,removePage) return true; } -KVSO_CLASS_FUNCTION(tabWidget,changeTab) +KVSO_CLASS_FUNCTION(tabWidget, changeTab) { CHECK_INTERNAL_POINTER(widget()) - KviKvsObject *pObject; - QString szLabel,szIcon; + KviKvsObject * pObject; + QString szLabel, szIcon; kvs_hobject_t hObject; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("tab_widget",KVS_PT_HOBJECT,0,hObject) - KVSO_PARAMETER("label",KVS_PT_STRING,0,szLabel) - KVSO_PARAMETER("icon_id",KVS_PT_STRING,KVS_PF_OPTIONAL,szIcon) + KVSO_PARAMETER("tab_widget", KVS_PT_HOBJECT, 0, hObject) + KVSO_PARAMETER("label", KVS_PT_STRING, 0, szLabel) + KVSO_PARAMETER("icon_id", KVS_PT_STRING, KVS_PF_OPTIONAL, szIcon) KVSO_PARAMETERS_END(c) - pObject=KviKvsKernel::instance()->objectController()->lookupObject(hObject); + pObject = KviKvsKernel::instance()->objectController()->lookupObject(hObject); CHECK_HOBJECT_IS_WIDGET(pObject) - int iIdx = ((QTabWidget *)widget())->indexOf (((QWidget *)(pObject->object()))); - if (iIdx == -1) + int iIdx = ((QTabWidget *)widget())->indexOf(((QWidget *)(pObject->object()))); + if(iIdx == -1) { - c->warning(__tr2qs_ctx("Can't find the tab","objects")); + c->warning(__tr2qs_ctx("Can't find the tab", "objects")); return true; } QPixmap * pix = g_pIconManager->getImage(szIcon); - if(pix)((QTabWidget *)widget())->setTabIcon(iIdx,QIcon(*pix)); - ((QTabWidget *)widget())->setTabText(iIdx,szLabel); + if(pix) + ((QTabWidget *)widget())->setTabIcon(iIdx, QIcon(*pix)); + ((QTabWidget *)widget())->setTabText(iIdx, szLabel); return true; } -KVSO_CLASS_FUNCTION(tabWidget,setTabPosition) +KVSO_CLASS_FUNCTION(tabWidget, setTabPosition) { CHECK_INTERNAL_POINTER(widget()) QString szPos; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("tab_position",KVS_PT_STRING,0,szPos) + KVSO_PARAMETER("tab_position", KVS_PT_STRING, 0, szPos) KVSO_PARAMETERS_END(c) - if(KviQString::equalCI(szPos,"Top")) + if(KviQString::equalCI(szPos, "Top")) ((QTabWidget *)widget())->setTabPosition(QTabWidget::North); - else if(KviQString::equalCI(szPos,"Bottom")) + else if(KviQString::equalCI(szPos, "Bottom")) ((QTabWidget *)widget())->setTabPosition(QTabWidget::South); else - c->warning( __tr2qs_ctx("Unknown position '%Q'","objects"),&szPos); + c->warning(__tr2qs_ctx("Unknown position '%Q'", "objects"), &szPos); return true; } -KVSO_CLASS_FUNCTION(tabWidget,currentChangedEvent) +KVSO_CLASS_FUNCTION(tabWidget, currentChangedEvent) { - emitSignal("currentChanged",c,c->params()); + emitSignal("currentChanged", c, c->params()); return true; } void KvsObject_tabWidget::slotCurrentChanged(int value) { KviKvsVariantList params(new KviKvsVariant((kvs_int_t)value)); - callFunction(this,"currentChangedEvent",¶ms); + callFunction(this, "currentChangedEvent", ¶ms); } -KVSO_CLASS_FUNCTION(tabWidget,tabCloseRequestEvent) +KVSO_CLASS_FUNCTION(tabWidget, tabCloseRequestEvent) { - emitSignal("tabCloseRequested",c,c->params()); + emitSignal("tabCloseRequested", c, c->params()); return true; } void KvsObject_tabWidget::slotTabCloseRequest(int iIndex) { KviKvsVariantList params(new KviKvsVariant((kvs_int_t)iIndex)); - callFunction(this,"tabCloseRequestEvent",¶ms); + callFunction(this, "tabCloseRequestEvent", ¶ms); } diff --git a/src/modules/objects/KvsObject_tabWidget.h b/src/modules/objects/KvsObject_tabWidget.h index 68f83a76f..9b0b14d1c 100644 --- a/src/modules/objects/KvsObject_tabWidget.h +++ b/src/modules/objects/KvsObject_tabWidget.h @@ -36,33 +36,33 @@ public: public: QWidget * widget() { return (QWidget *)object(); }; protected: - virtual bool init(KviKvsRunTimeContext * pContext,KviKvsVariantList *pParams); + virtual bool init(KviKvsRunTimeContext * pContext, KviKvsVariantList * pParams); QList tabsList; - bool addTab(KviKvsObjectFunctionCall *c); - bool indexOf(KviKvsObjectFunctionCall *c); - bool insertTab(KviKvsObjectFunctionCall *c); - bool setTabToolTip(KviKvsObjectFunctionCall *c); - bool removeTabToolTip(KviKvsObjectFunctionCall *c); - bool setTabLabel(KviKvsObjectFunctionCall *c); - bool setCurrentPage(KviKvsObjectFunctionCall *c); - bool currentPageIndex(KviKvsObjectFunctionCall *c); - bool tabLabel(KviKvsObjectFunctionCall *c); - bool currentTabLabel(KviKvsObjectFunctionCall *c); - bool count(KviKvsObjectFunctionCall *c); - bool changeTab(KviKvsObjectFunctionCall *c); - bool removePage(KviKvsObjectFunctionCall *c); - bool setTabPosition(KviKvsObjectFunctionCall *c); - bool setTabsClosable(KviKvsObjectFunctionCall *c); - bool widgetAt(KviKvsObjectFunctionCall *c); + bool addTab(KviKvsObjectFunctionCall * c); + bool indexOf(KviKvsObjectFunctionCall * c); + bool insertTab(KviKvsObjectFunctionCall * c); + bool setTabToolTip(KviKvsObjectFunctionCall * c); + bool removeTabToolTip(KviKvsObjectFunctionCall * c); + bool setTabLabel(KviKvsObjectFunctionCall * c); + bool setCurrentPage(KviKvsObjectFunctionCall * c); + bool currentPageIndex(KviKvsObjectFunctionCall * c); + bool tabLabel(KviKvsObjectFunctionCall * c); + bool currentTabLabel(KviKvsObjectFunctionCall * c); + bool count(KviKvsObjectFunctionCall * c); + bool changeTab(KviKvsObjectFunctionCall * c); + bool removePage(KviKvsObjectFunctionCall * c); + bool setTabPosition(KviKvsObjectFunctionCall * c); + bool setTabsClosable(KviKvsObjectFunctionCall * c); + bool widgetAt(KviKvsObjectFunctionCall * c); // events - bool currentChangedEvent(KviKvsObjectFunctionCall *c); - bool tabCloseRequestEvent(KviKvsObjectFunctionCall *c); + bool currentChangedEvent(KviKvsObjectFunctionCall * c); + bool tabCloseRequestEvent(KviKvsObjectFunctionCall * c); protected slots: void slotCurrentChanged(int); void slotTabCloseRequest(int); }; -#endif //!_CLASS_TABWIDGET_H_ +#endif //!_CLASS_TABWIDGET_H_ diff --git a/src/modules/objects/KvsObject_tableWidget.cpp b/src/modules/objects/KvsObject_tableWidget.cpp index 7cf4b869e..63e9cd49e 100644 --- a/src/modules/objects/KvsObject_tableWidget.cpp +++ b/src/modules/objects/KvsObject_tableWidget.cpp @@ -65,7 +65,7 @@ const char * const itemflags_tbl[] = { "tristate" }; -#define itemflags_num (sizeof(itemflags_tbl) / sizeof(itemflags_tbl[0])) +#define itemflags_num (sizeof(itemflags_tbl) / sizeof(itemflags_tbl[0])) /* @doc:tablewidget @@ -181,67 +181,64 @@ const char * const itemflags_tbl[] = { This signal is emitted by the default implementation of [classfnc]$clickEvent[/classfnc](). */ -KVSO_BEGIN_REGISTERCLASS(KvsObject_tableWidget,"tablewidget","widget") - - // Horizontal Header - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_tableWidget,setHorizontalHeaderLabels) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_tableWidget,hideHorizontalHeader) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_tableWidget,hideVerticalHeader) - - // Vertical Header - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_tableWidget,setVerticalHeaderLabels) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_tableWidget,showHorizontalHeader) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_tableWidget,showVerticalHeader) - - // Rows-Columns - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_tableWidget,setRowCount) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_tableWidget,insertRow) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_tableWidget,insertColumn) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_tableWidget,removeRow) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_tableWidget,removeColumn) - - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_tableWidget,rowCount) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_tableWidget,currentRow) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_tableWidget,setColumnCount) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_tableWidget,columnCount) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_tableWidget,currentColumn) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_tableWidget,itemRowColAt) - - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_tableWidget,hideRow) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_tableWidget,showRow) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_tableWidget,hideColumn) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_tableWidget,showColumn) - - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_tableWidget,resizeRowsToContents) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_tableWidget,resizeColumnsToContents) - - // Item (text. icon, widget) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_tableWidget,setText) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_tableWidget,setNumber) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_tableWidget,setToolTip) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_tableWidget,setForeground) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_tableWidget,text) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_tableWidget,setCellWidget) - - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_tableWidget,setIcon) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_tableWidget,clear) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_tableWidget,setItemFlags); - - KVSO_REGISTER_HANDLER(KvsObject_tableWidget,"itemEnteredEvent",itemEnteredEvent); - KVSO_REGISTER_HANDLER(KvsObject_tableWidget,"cellActivatedEvent",cellActivatedEvent); - KVSO_REGISTER_HANDLER(KvsObject_tableWidget,"cellDoubleClickedEvent",cellDoubleClickedEvent); - KVSO_REGISTER_STANDARD_TRUERETURN_HANDLER(KvsObject_tableWidget,"paintCellEvent") - KVSO_REGISTER_STANDARD_NOTHINGRETURN_HANDLER(KvsObject_tableWidget,"sizeHintCellRequestEvent") - - +KVSO_BEGIN_REGISTERCLASS(KvsObject_tableWidget, "tablewidget", "widget") + +// Horizontal Header +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_tableWidget, setHorizontalHeaderLabels) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_tableWidget, hideHorizontalHeader) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_tableWidget, hideVerticalHeader) + +// Vertical Header +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_tableWidget, setVerticalHeaderLabels) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_tableWidget, showHorizontalHeader) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_tableWidget, showVerticalHeader) + +// Rows-Columns +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_tableWidget, setRowCount) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_tableWidget, insertRow) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_tableWidget, insertColumn) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_tableWidget, removeRow) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_tableWidget, removeColumn) + +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_tableWidget, rowCount) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_tableWidget, currentRow) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_tableWidget, setColumnCount) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_tableWidget, columnCount) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_tableWidget, currentColumn) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_tableWidget, itemRowColAt) + +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_tableWidget, hideRow) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_tableWidget, showRow) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_tableWidget, hideColumn) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_tableWidget, showColumn) + +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_tableWidget, resizeRowsToContents) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_tableWidget, resizeColumnsToContents) + +// Item (text. icon, widget) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_tableWidget, setText) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_tableWidget, setNumber) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_tableWidget, setToolTip) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_tableWidget, setForeground) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_tableWidget, text) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_tableWidget, setCellWidget) + +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_tableWidget, setIcon) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_tableWidget, clear) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_tableWidget, setItemFlags); + +KVSO_REGISTER_HANDLER(KvsObject_tableWidget, "itemEnteredEvent", itemEnteredEvent); +KVSO_REGISTER_HANDLER(KvsObject_tableWidget, "cellActivatedEvent", cellActivatedEvent); +KVSO_REGISTER_HANDLER(KvsObject_tableWidget, "cellDoubleClickedEvent", cellDoubleClickedEvent); +KVSO_REGISTER_STANDARD_TRUERETURN_HANDLER(KvsObject_tableWidget, "paintCellEvent") +KVSO_REGISTER_STANDARD_NOTHINGRETURN_HANDLER(KvsObject_tableWidget, "sizeHintCellRequestEvent") KVSO_END_REGISTERCLASS(KvsObject_tableWidget) -KVSO_BEGIN_CONSTRUCTOR(KvsObject_tableWidget,KvsObject_widget) +KVSO_BEGIN_CONSTRUCTOR(KvsObject_tableWidget, KvsObject_widget) KVSO_END_CONSTRUCTOR(KvsObject_tableWidget) - KVSO_BEGIN_DESTRUCTOR(KvsObject_tableWidget) /*if (m_pCellItemDelegate) { @@ -250,31 +247,31 @@ KVSO_BEGIN_DESTRUCTOR(KvsObject_tableWidget) }*/ KVSO_END_DESTRUCTOR(KvsObject_tableWidget) -bool KvsObject_tableWidget::init(KviKvsRunTimeContext *c,KviKvsVariantList *) +bool KvsObject_tableWidget::init(KviKvsRunTimeContext * c, KviKvsVariantList *) { SET_OBJECT(QTableWidget) - m_pCellItemDelegate=new KviCellItemDelegate(((QTableWidget *)widget()),this); + m_pCellItemDelegate = new KviCellItemDelegate(((QTableWidget *)widget()), this); - m_pContext=c; + m_pContext = c; ((QTableWidget *)widget())->setItemDelegate(m_pCellItemDelegate); - ((QTableWidget *)widget())->verticalHeader()->resizeSections(QHeaderView::Custom ); - ((QTableWidget *)widget())->horizontalHeader()->resizeSections(QHeaderView::Custom ); + ((QTableWidget *)widget())->verticalHeader()->resizeSections(QHeaderView::Custom); + ((QTableWidget *)widget())->horizontalHeader()->resizeSections(QHeaderView::Custom); - connect(widget(),SIGNAL(itemEntered(QTableWidgetItem *)),this,SLOT(slotItemEntered(QTableWidgetItem *))); - connect(widget(),SIGNAL(cellActivated(int,int)),this,SLOT(cellActivated(int,int))); - connect(widget(),SIGNAL(cellDoubleClicked(int,int)),this,SLOT(cellDoubleClicked(int,int))); + connect(widget(), SIGNAL(itemEntered(QTableWidgetItem *)), this, SLOT(slotItemEntered(QTableWidgetItem *))); + connect(widget(), SIGNAL(cellActivated(int, int)), this, SLOT(cellActivated(int, int))); + connect(widget(), SIGNAL(cellDoubleClicked(int, int)), this, SLOT(cellDoubleClicked(int, int))); return true; } -KVSO_CLASS_FUNCTION(tableWidget,clear) +KVSO_CLASS_FUNCTION(tableWidget, clear) { CHECK_INTERNAL_POINTER(widget()) ((QTableWidget *)widget())->clear(); return true; } -KVSO_CLASS_FUNCTION(tableWidget,resizeRowsToContents) +KVSO_CLASS_FUNCTION(tableWidget, resizeRowsToContents) { CHECK_INTERNAL_POINTER(widget()) //qDebug("resize row to contents"); @@ -283,7 +280,7 @@ KVSO_CLASS_FUNCTION(tableWidget,resizeRowsToContents) return true; } -KVSO_CLASS_FUNCTION(tableWidget,resizeColumnsToContents) +KVSO_CLASS_FUNCTION(tableWidget, resizeColumnsToContents) { CHECK_INTERNAL_POINTER(widget()) //qDebug("resize coluns to contents"); @@ -291,31 +288,30 @@ KVSO_CLASS_FUNCTION(tableWidget,resizeColumnsToContents) return true; } - -KVSO_CLASS_FUNCTION(tableWidget,setForeground) +KVSO_CLASS_FUNCTION(tableWidget, setForeground) { CHECK_INTERNAL_POINTER(widget()) KviKvsVariant * pColArray; - kvs_uint_t uCol,uRow; - kvs_int_t iColR,iColG,iColB; + kvs_uint_t uCol, uRow; + kvs_int_t iColR, iColG, iColB; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("row",KVS_PT_UNSIGNEDINTEGER,0,uRow) - KVSO_PARAMETER("col",KVS_PT_UNSIGNEDINTEGER,0,uCol) - KVSO_PARAMETER("hex_rgb_array_or_red_colorname",KVS_PT_VARIANT,0,pColArray) - KVSO_PARAMETER("green",KVS_PT_INT,KVS_PF_OPTIONAL,iColG) - KVSO_PARAMETER("blue",KVS_PT_INT,KVS_PF_OPTIONAL,iColB) + KVSO_PARAMETER("row", KVS_PT_UNSIGNEDINTEGER, 0, uRow) + KVSO_PARAMETER("col", KVS_PT_UNSIGNEDINTEGER, 0, uCol) + KVSO_PARAMETER("hex_rgb_array_or_red_colorname", KVS_PT_VARIANT, 0, pColArray) + KVSO_PARAMETER("green", KVS_PT_INT, KVS_PF_OPTIONAL, iColG) + KVSO_PARAMETER("blue", KVS_PT_INT, KVS_PF_OPTIONAL, iColB) KVSO_PARAMETERS_END(c) - QTableWidgetItem * pItem = ((QTableWidget *)widget())->item(uRow,uCol); + QTableWidgetItem * pItem = ((QTableWidget *)widget())->item(uRow, uCol); if(!pItem) { - pItem = new QTableWidgetItem(); - ((QTableWidget *)widget())->setItem(uRow,uCol,pItem); + pItem = new QTableWidgetItem(); + ((QTableWidget *)widget())->setItem(uRow, uCol, pItem); } if(pColArray->isArray()) { if(pColArray->array()->size() < 3) { - c->error(__tr2qs_ctx("The array passed as parameter must contain at least 3 elements","objects")); + c->error(__tr2qs_ctx("The array passed as parameter must contain at least 3 elements", "objects")); return false; } KviKvsVariant * pColR = pColArray->array()->at(0); @@ -324,348 +320,354 @@ KVSO_CLASS_FUNCTION(tableWidget,setForeground) if(!(pColR && pColG && pColB)) { - c->error(__tr2qs_ctx("One of the colors array parameters is empty","objects")); + c->error(__tr2qs_ctx("One of the colors array parameters is empty", "objects")); return false; } if(!(pColR->asInteger(iColR) && pColG->asInteger(iColG) && pColB->asInteger(iColB))) { - c->error(__tr2qs_ctx("One of the colors array parameters didn't evaluate to an integer","objects")); + c->error(__tr2qs_ctx("One of the colors array parameters didn't evaluate to an integer", "objects")); return false; } } else { QColor color; - if (c->params()->count()==3) + if(c->params()->count() == 3) { - if(pColArray->isString()) + if(pColArray->isString()) + { + QString szColor; + pColArray->asString(szColor); + // maybe a color name? + color.setNamedColor(szColor); + if(!color.isValid()) { - QString szColor; - pColArray->asString(szColor); - // maybe a color name? - color.setNamedColor(szColor); - if (!color.isValid()) + // isn't a color name: lets try with an hex triplet + color.setNamedColor("#" + szColor); + if(!color.isValid()) { - // isn't a color name: lets try with an hex triplet - color.setNamedColor("#"+szColor); - if (!color.isValid()) - { - c->warning(__tr2qs_ctx("Not a valid color!","objects")); - return true; - } + c->warning(__tr2qs_ctx("Not a valid color!", "objects")); + return true; } } - else { - c->warning(__tr2qs_ctx("Not a valid color!","objects")); - return true; - } - QBrush brush(color); - pItem->setForeground(brush); + } + else + { + c->warning(__tr2qs_ctx("Not a valid color!", "objects")); return true; + } + QBrush brush(color); + pItem->setForeground(brush); + return true; } if(c->params()->count() < 5) { - c->error(__tr2qs_ctx("$setForegroundColor requires either an array as first parameter, one hex string or color name, or three integers","objects")); + c->error(__tr2qs_ctx("$setForegroundColor requires either an array as first parameter, one hex string or color name, or three integers", "objects")); return false; } if(!pColArray->asInteger(iColR)) { - c->error(__tr2qs_ctx("The first parameter didn't evaluate to an array nor an integer","objects")); + c->error(__tr2qs_ctx("The first parameter didn't evaluate to an array nor an integer", "objects")); return false; } } - QBrush brush(QColor(iColR,iColG,iColB)); + QBrush brush(QColor(iColR, iColG, iColB)); pItem->setForeground(brush); return true; } - -KVSO_CLASS_FUNCTION(tableWidget,setText) +KVSO_CLASS_FUNCTION(tableWidget, setText) { CHECK_INTERNAL_POINTER(widget()) - kvs_uint_t uCol,uRow; + kvs_uint_t uCol, uRow; QString szText; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("row",KVS_PT_UNSIGNEDINTEGER,0,uRow) - KVSO_PARAMETER("col",KVS_PT_UNSIGNEDINTEGER,0,uCol) - KVSO_PARAMETER("text",KVS_PT_STRING,0,szText) + KVSO_PARAMETER("row", KVS_PT_UNSIGNEDINTEGER, 0, uRow) + KVSO_PARAMETER("col", KVS_PT_UNSIGNEDINTEGER, 0, uCol) + KVSO_PARAMETER("text", KVS_PT_STRING, 0, szText) KVSO_PARAMETERS_END(c) if(uRow >= (uint)((QTableWidget *)widget())->rowCount() || uRow >= (uint)((QTableWidget *)widget())->rowCount()) - c->warning(__tr2qs_ctx("Item out of the tablewidget size","objects")); - QTableWidgetItem * pItem = ((QTableWidget *)widget())->item(uRow,uCol); + c->warning(__tr2qs_ctx("Item out of the tablewidget size", "objects")); + QTableWidgetItem * pItem = ((QTableWidget *)widget())->item(uRow, uCol); if(!pItem) { pItem = new QTableWidgetItem(); - ((QTableWidget *)widget())->setItem(uRow,uCol,pItem); + ((QTableWidget *)widget())->setItem(uRow, uCol, pItem); } pItem->setText(szText); return true; } -KVSO_CLASS_FUNCTION(tableWidget,setNumber) +KVSO_CLASS_FUNCTION(tableWidget, setNumber) { CHECK_INTERNAL_POINTER(widget()) - kvs_uint_t uCol,uRow; + kvs_uint_t uCol, uRow; kvs_int_t iNumber; QString szText; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("row",KVS_PT_UNSIGNEDINTEGER,0,uRow) - KVSO_PARAMETER("col",KVS_PT_UNSIGNEDINTEGER,0,uCol) - KVSO_PARAMETER("number",KVS_PT_INT,0,iNumber) + KVSO_PARAMETER("row", KVS_PT_UNSIGNEDINTEGER, 0, uRow) + KVSO_PARAMETER("col", KVS_PT_UNSIGNEDINTEGER, 0, uCol) + KVSO_PARAMETER("number", KVS_PT_INT, 0, iNumber) KVSO_PARAMETERS_END(c) if(uRow >= (uint)((QTableWidget *)widget())->rowCount() || uRow >= (uint)((QTableWidget *)widget())->rowCount()) - c->warning(__tr2qs_ctx("Item out of the tablewidget size","objects")); - QTableWidgetItem * pItem = ((QTableWidget *)widget())->item(uRow,uCol); + c->warning(__tr2qs_ctx("Item out of the tablewidget size", "objects")); + QTableWidgetItem * pItem = ((QTableWidget *)widget())->item(uRow, uCol); if(!pItem) { pItem = new QTableWidgetItem(); - ((QTableWidget *)widget())->setItem(uRow,uCol,pItem); + ((QTableWidget *)widget())->setItem(uRow, uCol, pItem); } - pItem->setData(0,(int)iNumber); + pItem->setData(0, (int)iNumber); return true; } -KVSO_CLASS_FUNCTION(tableWidget,insertRow) +KVSO_CLASS_FUNCTION(tableWidget, insertRow) { CHECK_INTERNAL_POINTER(widget()) kvs_uint_t uRow; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("row",KVS_PT_UNSIGNEDINTEGER,0,uRow) + KVSO_PARAMETER("row", KVS_PT_UNSIGNEDINTEGER, 0, uRow) KVSO_PARAMETERS_END(c) ((QTableWidget *)widget())->insertRow(uRow); return true; } -KVSO_CLASS_FUNCTION(tableWidget,insertColumn) +KVSO_CLASS_FUNCTION(tableWidget, insertColumn) { CHECK_INTERNAL_POINTER(widget()) kvs_uint_t uCol; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("row",KVS_PT_UNSIGNEDINTEGER,0,uCol) + KVSO_PARAMETER("row", KVS_PT_UNSIGNEDINTEGER, 0, uCol) KVSO_PARAMETERS_END(c) ((QTableWidget *)widget())->insertColumn(uCol); return true; } -KVSO_CLASS_FUNCTION(tableWidget,removeRow) +KVSO_CLASS_FUNCTION(tableWidget, removeRow) { CHECK_INTERNAL_POINTER(widget()) kvs_uint_t uRow; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("row",KVS_PT_UNSIGNEDINTEGER,0,uRow) + KVSO_PARAMETER("row", KVS_PT_UNSIGNEDINTEGER, 0, uRow) KVSO_PARAMETERS_END(c) ((QTableWidget *)widget())->removeRow(uRow); return true; } -KVSO_CLASS_FUNCTION(tableWidget,removeColumn) +KVSO_CLASS_FUNCTION(tableWidget, removeColumn) { CHECK_INTERNAL_POINTER(widget()) kvs_uint_t uCol; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("row",KVS_PT_UNSIGNEDINTEGER,0,uCol) + KVSO_PARAMETER("row", KVS_PT_UNSIGNEDINTEGER, 0, uCol) KVSO_PARAMETERS_END(c) ((QTableWidget *)widget())->removeColumn(uCol); return true; } - -KVSO_CLASS_FUNCTION(tableWidget,setIcon) +KVSO_CLASS_FUNCTION(tableWidget, setIcon) { - kvs_uint_t uCol,uRow; - KviKvsObject *obPixmap; + kvs_uint_t uCol, uRow; + KviKvsObject * obPixmap; kvs_hobject_t obHpixmap; KviKvsVariant * vPixmap; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("row",KVS_PT_UNSIGNEDINTEGER,0,uRow) - KVSO_PARAMETER("col",KVS_PT_UNSIGNEDINTEGER,0,uCol) - KVSO_PARAMETER("icon",KVS_PT_VARIANT,0,vPixmap) + KVSO_PARAMETER("row", KVS_PT_UNSIGNEDINTEGER, 0, uRow) + KVSO_PARAMETER("col", KVS_PT_UNSIGNEDINTEGER, 0, uCol) + KVSO_PARAMETER("icon", KVS_PT_VARIANT, 0, vPixmap) KVSO_PARAMETERS_END(c) QPixmap * pix = 0; if(vPixmap->isHObject()) { vPixmap->asHObject(obHpixmap); - obPixmap=KviKvsKernel::instance()->objectController()->lookupObject(obHpixmap); + obPixmap = KviKvsKernel::instance()->objectController()->lookupObject(obHpixmap); if(!obPixmap->inheritsClass("pixmap")) { - c->warning(__tr2qs_ctx("Pixmap object or image Id required","objects")); + c->warning(__tr2qs_ctx("Pixmap object or image Id required", "objects")); + return true; + } + pix = ((KvsObject_pixmap *)obPixmap)->getPixmap(); + } + else + { + QString szPix; + vPixmap->asString(szPix); + pix = g_pIconManager->getImage(szPix); + if(!pix) + { + c->warning(__tr2qs_ctx("Error occurred: the suitable file '%Q' is not of the correct format or it is not a valid icon number.", "objects"), &szPix); return true; } - pix=((KvsObject_pixmap *)obPixmap)->getPixmap(); - } else { - QString szPix; - vPixmap->asString(szPix); - pix=g_pIconManager->getImage(szPix); - if(!pix) - { - c->warning(__tr2qs_ctx("Error occurred: the suitable file '%Q' is not of the correct format or it is not a valid icon number.","objects"),&szPix); - return true; - } } - QTableWidgetItem * pItem = ((QTableWidget *)widget())->item(uRow,uCol); + QTableWidgetItem * pItem = ((QTableWidget *)widget())->item(uRow, uCol); if(!pItem) { pItem = new QTableWidgetItem(); - ((QTableWidget *)widget())->setItem(uRow,uCol,pItem); + ((QTableWidget *)widget())->setItem(uRow, uCol, pItem); } pItem->setIcon(QIcon(*pix)); return true; } -KVSO_CLASS_FUNCTION(tableWidget,text) +KVSO_CLASS_FUNCTION(tableWidget, text) { CHECK_INTERNAL_POINTER(widget()) - kvs_uint_t uCol,uRow; + kvs_uint_t uCol, uRow; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("row",KVS_PT_UNSIGNEDINTEGER,0,uRow) - KVSO_PARAMETER("col",KVS_PT_UNSIGNEDINTEGER,0,uCol) + KVSO_PARAMETER("row", KVS_PT_UNSIGNEDINTEGER, 0, uRow) + KVSO_PARAMETER("col", KVS_PT_UNSIGNEDINTEGER, 0, uCol) KVSO_PARAMETERS_END(c) - QTableWidgetItem * pItem = ((QTableWidget *)widget())->item(uRow,uCol); - if(!pItem) c->returnValue()->setNothing(); - else c->returnValue()->setString(((QTableWidget *)widget())->item(uRow,uCol)->text()); + QTableWidgetItem * pItem = ((QTableWidget *)widget())->item(uRow, uCol); + if(!pItem) + c->returnValue()->setNothing(); + else + c->returnValue()->setString(((QTableWidget *)widget())->item(uRow, uCol)->text()); return true; } -KVSO_CLASS_FUNCTION(tableWidget,setRowCount) +KVSO_CLASS_FUNCTION(tableWidget, setRowCount) { CHECK_INTERNAL_POINTER(widget()) kvs_uint_t uRow; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("row",KVS_PT_UNSIGNEDINTEGER,0,uRow) + KVSO_PARAMETER("row", KVS_PT_UNSIGNEDINTEGER, 0, uRow) KVSO_PARAMETERS_END(c) ((QTableWidget *)widget())->setRowCount(uRow); return true; } -KVSO_CLASS_FUNCTION(tableWidget,rowCount) +KVSO_CLASS_FUNCTION(tableWidget, rowCount) { CHECK_INTERNAL_POINTER(widget()) c->returnValue()->setInteger(((QTableWidget *)widget())->rowCount()); return true; } -KVSO_CLASS_FUNCTION(tableWidget,currentRow) +KVSO_CLASS_FUNCTION(tableWidget, currentRow) { CHECK_INTERNAL_POINTER(widget()) c->returnValue()->setInteger(((QTableWidget *)widget())->currentRow()); return true; } -KVSO_CLASS_FUNCTION(tableWidget,currentColumn) +KVSO_CLASS_FUNCTION(tableWidget, currentColumn) { CHECK_INTERNAL_POINTER(widget()) c->returnValue()->setInteger(((QTableWidget *)widget())->currentColumn()); return true; } -KVSO_CLASS_FUNCTION(tableWidget,columnCount) +KVSO_CLASS_FUNCTION(tableWidget, columnCount) { CHECK_INTERNAL_POINTER(widget()) c->returnValue()->setInteger(((QTableWidget *)widget())->columnCount()); return true; } -KVSO_CLASS_FUNCTION(tableWidget,itemRowColAt) +KVSO_CLASS_FUNCTION(tableWidget, itemRowColAt) { CHECK_INTERNAL_POINTER(widget()) - kvs_int_t iXpos,iYpos; + kvs_int_t iXpos, iYpos; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("x_pos",KVS_PT_INT,0,iXpos) - KVSO_PARAMETER("y_pos",KVS_PT_INT,0,iYpos) + KVSO_PARAMETER("x_pos", KVS_PT_INT, 0, iXpos) + KVSO_PARAMETER("y_pos", KVS_PT_INT, 0, iYpos) KVSO_PARAMETERS_END(c) - KviKvsArray *pArray; - QPoint pPoint=((QTableWidget *)widget())->viewport()->mapFromGlobal(QPoint(iXpos,iYpos)); - QTableWidgetItem *pItem=((QTableWidget *)widget())->itemAt(pPoint.x(),pPoint.y()); - pArray=new KviKvsArray(); - if (!pItem) { - pArray->set(0,new KviKvsVariant((kvs_int_t)-1)); - pArray->set(1,new KviKvsVariant((kvs_int_t)-1)); + KviKvsArray * pArray; + QPoint pPoint = ((QTableWidget *)widget())->viewport()->mapFromGlobal(QPoint(iXpos, iYpos)); + QTableWidgetItem * pItem = ((QTableWidget *)widget())->itemAt(pPoint.x(), pPoint.y()); + pArray = new KviKvsArray(); + if(!pItem) + { + pArray->set(0, new KviKvsVariant((kvs_int_t)-1)); + pArray->set(1, new KviKvsVariant((kvs_int_t)-1)); } - else { - pArray->set(0,new KviKvsVariant((kvs_int_t)pItem->row())); - pArray->set(1,new KviKvsVariant((kvs_int_t)pItem->column())); + else + { + pArray->set(0, new KviKvsVariant((kvs_int_t)pItem->row())); + pArray->set(1, new KviKvsVariant((kvs_int_t)pItem->column())); } c->returnValue()->setArray(pArray); return true; } -KVSO_CLASS_FUNCTION(tableWidget,setToolTip) +KVSO_CLASS_FUNCTION(tableWidget, setToolTip) { CHECK_INTERNAL_POINTER(widget()) QString szTooltip; - kvs_uint_t uRow,uCol; + kvs_uint_t uRow, uCol; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("row",KVS_PT_UNSIGNEDINTEGER,0,uRow) - KVSO_PARAMETER("col",KVS_PT_UNSIGNEDINTEGER,0,uCol) - KVSO_PARAMETER("tooltip",KVS_PT_STRING,0,szTooltip) + KVSO_PARAMETER("row", KVS_PT_UNSIGNEDINTEGER, 0, uRow) + KVSO_PARAMETER("col", KVS_PT_UNSIGNEDINTEGER, 0, uCol) + KVSO_PARAMETER("tooltip", KVS_PT_STRING, 0, szTooltip) KVSO_PARAMETERS_END(c) - QTableWidgetItem *pItem=((QTableWidget *)widget())->item(uRow,uCol); - if (pItem) pItem->setToolTip(szTooltip); + QTableWidgetItem * pItem = ((QTableWidget *)widget())->item(uRow, uCol); + if(pItem) + pItem->setToolTip(szTooltip); return true; } -KVSO_CLASS_FUNCTION(tableWidget,setColumnCount) +KVSO_CLASS_FUNCTION(tableWidget, setColumnCount) { CHECK_INTERNAL_POINTER(widget()) kvs_uint_t uCol; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("col",KVS_PT_UNSIGNEDINTEGER,0,uCol) + KVSO_PARAMETER("col", KVS_PT_UNSIGNEDINTEGER, 0, uCol) KVSO_PARAMETERS_END(c) ((QTableWidget *)widget())->setColumnCount(uCol); return true; } -KVSO_CLASS_FUNCTION(tableWidget,hideColumn) +KVSO_CLASS_FUNCTION(tableWidget, hideColumn) { CHECK_INTERNAL_POINTER(widget()) kvs_uint_t uCol; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("col",KVS_PT_UNSIGNEDINTEGER,0,uCol) + KVSO_PARAMETER("col", KVS_PT_UNSIGNEDINTEGER, 0, uCol) KVSO_PARAMETERS_END(c) ((QTableWidget *)widget())->hideColumn(uCol); return true; } -KVSO_CLASS_FUNCTION(tableWidget,showColumn) +KVSO_CLASS_FUNCTION(tableWidget, showColumn) { CHECK_INTERNAL_POINTER(widget()) kvs_uint_t uCol; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("col",KVS_PT_UNSIGNEDINTEGER,0,uCol) + KVSO_PARAMETER("col", KVS_PT_UNSIGNEDINTEGER, 0, uCol) KVSO_PARAMETERS_END(c) ((QTableWidget *)widget())->showColumn(uCol); return true; } -KVSO_CLASS_FUNCTION(tableWidget,hideRow) +KVSO_CLASS_FUNCTION(tableWidget, hideRow) { CHECK_INTERNAL_POINTER(widget()) kvs_uint_t uRow; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("col",KVS_PT_UNSIGNEDINTEGER,0,uRow) + KVSO_PARAMETER("col", KVS_PT_UNSIGNEDINTEGER, 0, uRow) KVSO_PARAMETERS_END(c) ((QTableWidget *)widget())->hideRow(uRow); return true; } -KVSO_CLASS_FUNCTION(tableWidget,showRow) +KVSO_CLASS_FUNCTION(tableWidget, showRow) { CHECK_INTERNAL_POINTER(widget()) kvs_uint_t uRow; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("col",KVS_PT_UNSIGNEDINTEGER,0,uRow) + KVSO_PARAMETER("col", KVS_PT_UNSIGNEDINTEGER, 0, uRow) KVSO_PARAMETERS_END(c) ((QTableWidget *)widget())->showRow(uRow); return true; } -KVSO_CLASS_FUNCTION(tableWidget,setHorizontalHeaderLabels) +KVSO_CLASS_FUNCTION(tableWidget, setHorizontalHeaderLabels) { CHECK_INTERNAL_POINTER(widget()) KviKvsArrayCast ac; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("labels",KVS_PT_ARRAYCAST,0,ac) + KVSO_PARAMETER("labels", KVS_PT_ARRAYCAST, 0, ac) KVSO_PARAMETERS_END(c) QStringList szColumns; if(KviKvsArray * a = ac.array()) @@ -681,7 +683,8 @@ KVSO_CLASS_FUNCTION(tableWidget,setHorizontalHeaderLabels) v->asString(tmp); szColumns.append(tmp); } - else szColumns.append(""); + else + szColumns.append(""); uIdx++; } } @@ -689,12 +692,12 @@ KVSO_CLASS_FUNCTION(tableWidget,setHorizontalHeaderLabels) return true; } -KVSO_CLASS_FUNCTION(tableWidget,setVerticalHeaderLabels) +KVSO_CLASS_FUNCTION(tableWidget, setVerticalHeaderLabels) { CHECK_INTERNAL_POINTER(widget()) KviKvsArrayCast ac; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("labels",KVS_PT_ARRAYCAST,0,ac) + KVSO_PARAMETER("labels", KVS_PT_ARRAYCAST, 0, ac) KVSO_PARAMETERS_END(c) QStringList szColumns; if(KviKvsArray * a = ac.array()) @@ -710,7 +713,8 @@ KVSO_CLASS_FUNCTION(tableWidget,setVerticalHeaderLabels) v->asString(tmp); szColumns.append(tmp); } - else szColumns.append(""); + else + szColumns.append(""); uIdx++; } } @@ -718,70 +722,70 @@ KVSO_CLASS_FUNCTION(tableWidget,setVerticalHeaderLabels) return true; } -KVSO_CLASS_FUNCTION(tableWidget,setCellWidget) +KVSO_CLASS_FUNCTION(tableWidget, setCellWidget) { CHECK_INTERNAL_POINTER(widget()) KviKvsObject * pObject; kvs_hobject_t hObject; - kvs_uint_t uRow,uCol; + kvs_uint_t uRow, uCol; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("row",KVS_PT_UNSIGNEDINTEGER,0,uRow) - KVSO_PARAMETER("column",KVS_PT_UNSIGNEDINTEGER,0,uCol) - KVSO_PARAMETER("widget",KVS_PT_HOBJECT,0,hObject) - KVSO_PARAMETERS_END(c) - pObject=KviKvsKernel::instance()->objectController()->lookupObject(hObject); + KVSO_PARAMETER("row", KVS_PT_UNSIGNEDINTEGER, 0, uRow) + KVSO_PARAMETER("column", KVS_PT_UNSIGNEDINTEGER, 0, uCol) + KVSO_PARAMETER("widget", KVS_PT_HOBJECT, 0, hObject) + KVSO_PARAMETERS_END(c) + pObject = KviKvsKernel::instance()->objectController()->lookupObject(hObject); CHECK_HOBJECT_IS_WIDGET(pObject) - ((QTableWidget *)object())->setCellWidget(uRow,uCol,((QWidget *)(pObject->object()))); + ((QTableWidget *)object())->setCellWidget(uRow, uCol, ((QWidget *)(pObject->object()))); return true; } -KVSO_CLASS_FUNCTION(tableWidget,hideHorizontalHeader) +KVSO_CLASS_FUNCTION(tableWidget, hideHorizontalHeader) { Q_UNUSED(c); ((QTableWidget *)widget())->horizontalHeader()->hide(); return true; } -KVSO_CLASS_FUNCTION(tableWidget,hideVerticalHeader) +KVSO_CLASS_FUNCTION(tableWidget, hideVerticalHeader) { Q_UNUSED(c); ((QTableWidget *)widget())->verticalHeader()->hide(); return true; } -KVSO_CLASS_FUNCTION(tableWidget,showHorizontalHeader) +KVSO_CLASS_FUNCTION(tableWidget, showHorizontalHeader) { Q_UNUSED(c); ((QTableWidget *)widget())->horizontalHeader()->show(); return true; } -KVSO_CLASS_FUNCTION(tableWidget,showVerticalHeader) +KVSO_CLASS_FUNCTION(tableWidget, showVerticalHeader) { Q_UNUSED(c); ((QTableWidget *)widget())->verticalHeader()->show(); return true; } -KVSO_CLASS_FUNCTION(tableWidget,setItemFlags) +KVSO_CLASS_FUNCTION(tableWidget, setItemFlags) { CHECK_INTERNAL_POINTER(widget()) QStringList itemflags; - kvs_uint_t iRow,iCol; + kvs_uint_t iRow, iCol; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("row",KVS_PT_UNSIGNEDINTEGER,0,iRow) - KVSO_PARAMETER("column",KVS_PT_UNSIGNEDINTEGER,0,iCol) - KVSO_PARAMETER("flags",KVS_PT_STRINGLIST,KVS_PF_OPTIONAL,itemflags) - KVSO_PARAMETERS_END(c) - int flag,sum=0; - for ( int i=0;isetCheckState(0,Qt::Unchecked); sum = sum | flag; - } else { - c->warning(__tr2qs_ctx("Unknown item flag '%Q'","objects"),&itemflags.at(i)); + } + else + { + c->warning(__tr2qs_ctx("Unknown item flag '%Q'", "objects"), &itemflags.at(i)); } } - QTableWidgetItem *pItem=((QTableWidget *)widget())->item(iRow,iCol); - if(pItem) pItem->setFlags((Qt::ItemFlags)sum); + QTableWidgetItem * pItem = ((QTableWidget *)widget())->item(iRow, iCol); + if(pItem) + pItem->setFlags((Qt::ItemFlags)sum); return true; } void KvsObject_tableWidget::slotItemEntered(QTableWidgetItem * i) { - KviKvsVariantList params(new KviKvsVariant((kvs_int_t)i->row()),new KviKvsVariant((kvs_int_t)i->column())); - callFunction(this,"itemEnteredEvent",0,¶ms); + KviKvsVariantList params(new KviKvsVariant((kvs_int_t)i->row()), new KviKvsVariant((kvs_int_t)i->column())); + callFunction(this, "itemEnteredEvent", 0, ¶ms); } -KVSO_CLASS_FUNCTION(tableWidget,itemEnteredEvent) +KVSO_CLASS_FUNCTION(tableWidget, itemEnteredEvent) { - emitSignal("itemEntered",c,c->params()); + emitSignal("itemEntered", c, c->params()); return true; } -void KvsObject_tableWidget::cellActivated(int iRow,int iCol) +void KvsObject_tableWidget::cellActivated(int iRow, int iCol) { - KviKvsVariantList params(new KviKvsVariant((kvs_int_t)iRow),new KviKvsVariant((kvs_int_t)iCol)); - callFunction(this,"cellActivatedEvent",0,¶ms); + KviKvsVariantList params(new KviKvsVariant((kvs_int_t)iRow), new KviKvsVariant((kvs_int_t)iCol)); + callFunction(this, "cellActivatedEvent", 0, ¶ms); } -KVSO_CLASS_FUNCTION(tableWidget,cellActivatedEvent) +KVSO_CLASS_FUNCTION(tableWidget, cellActivatedEvent) { - emitSignal("cellActivated",c,c->params()); + emitSignal("cellActivated", c, c->params()); return true; } -void KvsObject_tableWidget::cellDoubleClicked(int iRow,int iCol) +void KvsObject_tableWidget::cellDoubleClicked(int iRow, int iCol) { - KviKvsVariantList params(new KviKvsVariant((kvs_int_t)iRow),new KviKvsVariant((kvs_int_t)iCol)); - callFunction(this,"cellDoubleClickedEvent",0,¶ms); + KviKvsVariantList params(new KviKvsVariant((kvs_int_t)iRow), new KviKvsVariant((kvs_int_t)iCol)); + callFunction(this, "cellDoubleClickedEvent", 0, ¶ms); } -KVSO_CLASS_FUNCTION(tableWidget,cellDoubleClickedEvent) +KVSO_CLASS_FUNCTION(tableWidget, cellDoubleClickedEvent) { - emitSignal("cellDoubleClicked",c,c->params()); + emitSignal("cellDoubleClicked", c, c->params()); return true; } bool KvsObject_tableWidget::paint(QPainter * p, const QStyleOptionViewItem & option, const QModelIndex & index) @@ -839,28 +846,28 @@ bool KvsObject_tableWidget::paint(QPainter * p, const QStyleOptionViewItem & opt p->save(); KviKvsObjectClass * pClass = KviKvsKernel::instance()->objectController()->lookupClass("painter"); KviKvsVariantList params; - KviKvsObject * pObject = pClass->allocateInstance(0,"internalpainter",m_pContext,¶ms); + KviKvsObject * pObject = pClass->allocateInstance(0, "internalpainter", m_pContext, ¶ms); ((KvsObject_painter *)pObject)->setInternalPainter(p); p->setClipRect(option.rect); - p->translate(option.rect.x(),option.rect.y()); - int col=index.column(); - int row=index.row(); - kvs_hobject_t handle=pObject->handle(); - kvs_int_t cell_height=(kvs_int_t)option.rect.height(); - kvs_int_t cell_width=(kvs_int_t)option.rect.width(); - KviKvsVariantList parameters(new KviKvsVariant(handle),new KviKvsVariant((kvs_int_t) row),new KviKvsVariant((kvs_int_t) col),new KviKvsVariant(cell_width),new KviKvsVariant(cell_height)); - bool ret=false; + p->translate(option.rect.x(), option.rect.y()); + int col = index.column(); + int row = index.row(); + kvs_hobject_t handle = pObject->handle(); + kvs_int_t cell_height = (kvs_int_t)option.rect.height(); + kvs_int_t cell_width = (kvs_int_t)option.rect.width(); + KviKvsVariantList parameters(new KviKvsVariant(handle), new KviKvsVariant((kvs_int_t)row), new KviKvsVariant((kvs_int_t)col), new KviKvsVariant(cell_width), new KviKvsVariant(cell_height)); + bool ret = false; KviKvsVariant oReturnBuffer(ret); - callFunction(this,"paintCellEvent",&oReturnBuffer,¶meters); - pObject=KviKvsKernel::instance()->objectController()->lookupObject(handle); - if (pObject) + callFunction(this, "paintCellEvent", &oReturnBuffer, ¶meters); + pObject = KviKvsKernel::instance()->objectController()->lookupObject(handle); + if(pObject) pObject->dieNow(); p->restore(); return oReturnBuffer.asBoolean(); } -KviCellItemDelegate::KviCellItemDelegate(QAbstractItemView * pWidget,KvsObject_tableWidget * parent) -: QItemDelegate(pWidget), m_pParentScript(parent) +KviCellItemDelegate::KviCellItemDelegate(QAbstractItemView * pWidget, KvsObject_tableWidget * parent) + : QItemDelegate(pWidget), m_pParentScript(parent) { } @@ -870,24 +877,24 @@ KviCellItemDelegate::~KviCellItemDelegate() void KviCellItemDelegate::paint(QPainter * pPainter, const QStyleOptionViewItem & option, const QModelIndex & index) const { - if (m_pParentScript->paint(pPainter,option,index)) - QItemDelegate::paint(pPainter,option,index); + if(m_pParentScript->paint(pPainter, option, index)) + QItemDelegate::paint(pPainter, option, index); } -QSize KviCellItemDelegate::sizeHint(const QStyleOptionViewItem &option, const QModelIndex & index) const +QSize KviCellItemDelegate::sizeHint(const QStyleOptionViewItem & option, const QModelIndex & index) const { KviKvsVariant vSizeBuffer; - KviKvsVariantList parameters(new KviKvsVariant((kvs_int_t) index.row()),new KviKvsVariant((kvs_int_t) index.column())); - m_pParentScript->callFunction(m_pParentScript,"sizeHintCellRequestEvent",&vSizeBuffer,¶meters); + KviKvsVariantList parameters(new KviKvsVariant((kvs_int_t)index.row()), new KviKvsVariant((kvs_int_t)index.column())); + m_pParentScript->callFunction(m_pParentScript, "sizeHintCellRequestEvent", &vSizeBuffer, ¶meters); if(vSizeBuffer.isArray()) { - if(vSizeBuffer.array()->size()==2) + if(vSizeBuffer.array()->size() == 2) { - kvs_int_t w,h; + kvs_int_t w, h; if(vSizeBuffer.array()->at(0)->asInteger(w) && vSizeBuffer.array()->at(1)->asInteger(h)) - return QSize(w,h); + return QSize(w, h); } } - return QItemDelegate::sizeHint(option,index); + return QItemDelegate::sizeHint(option, index); } diff --git a/src/modules/objects/KvsObject_tableWidget.h b/src/modules/objects/KvsObject_tableWidget.h index 4b7455d42..b25613c36 100644 --- a/src/modules/objects/KvsObject_tableWidget.h +++ b/src/modules/objects/KvsObject_tableWidget.h @@ -39,10 +39,12 @@ class KvsObject_tableWidget; class KviCellItemDelegate : public QItemDelegate { public: - KviCellItemDelegate(QAbstractItemView * pWidget = 0,KvsObject_tableWidget *pParent=0); + KviCellItemDelegate(QAbstractItemView * pWidget = 0, KvsObject_tableWidget * pParent = 0); ~KviCellItemDelegate(); + protected: - KvsObject_tableWidget *m_pParentScript; + KvsObject_tableWidget * m_pParentScript; + public: QSize sizeHint(const QStyleOptionViewItem & option, const QModelIndex & index) const; void paint(QPainter * pPainter, const QStyleOptionViewItem & option, const QModelIndex & index) const; @@ -59,56 +61,56 @@ public: protected: KviKvsRunTimeContext * m_pContext; - KviCellItemDelegate * m_pCellItemDelegate; + KviCellItemDelegate * m_pCellItemDelegate; + protected: - virtual bool init(KviKvsRunTimeContext * pContext,KviKvsVariantList *pParams); - - bool setText(KviKvsObjectFunctionCall *c); - bool setForeground(KviKvsObjectFunctionCall *c); - bool setNumber(KviKvsObjectFunctionCall *c); - bool setToolTip(KviKvsObjectFunctionCall *c); - bool text(KviKvsObjectFunctionCall *c); - bool setIcon(KviKvsObjectFunctionCall *c); - bool setItemFlags(KviKvsObjectFunctionCall *c); - - bool setColumnCount(KviKvsObjectFunctionCall *c); - bool columnCount(KviKvsObjectFunctionCall *c); - bool setRowCount(KviKvsObjectFunctionCall *c); - bool currentRow(KviKvsObjectFunctionCall *c); - bool currentColumn(KviKvsObjectFunctionCall *c); - bool itemRowColAt(KviKvsObjectFunctionCall *c); - - bool rowCount(KviKvsObjectFunctionCall *c); - - bool insertRow(KviKvsObjectFunctionCall *c); - bool insertColumn(KviKvsObjectFunctionCall *c); - bool removeRow(KviKvsObjectFunctionCall *c); - bool removeColumn(KviKvsObjectFunctionCall *c); - - - bool setHorizontalHeaderLabels(KviKvsObjectFunctionCall *c); - bool setVerticalHeaderLabels(KviKvsObjectFunctionCall *c); - bool setCellWidget(KviKvsObjectFunctionCall *c); - - bool hideHorizontalHeader(KviKvsObjectFunctionCall *c); - bool showHorizontalHeader(KviKvsObjectFunctionCall *c); - bool hideVerticalHeader(KviKvsObjectFunctionCall *c); - bool showVerticalHeader(KviKvsObjectFunctionCall *c); - bool clear(KviKvsObjectFunctionCall *c); - bool itemEnteredEvent(KviKvsObjectFunctionCall *c); - bool cellActivatedEvent(KviKvsObjectFunctionCall *c); - bool cellDoubleClickedEvent(KviKvsObjectFunctionCall *c); - - bool hideColumn(KviKvsObjectFunctionCall *c); - bool showColumn(KviKvsObjectFunctionCall *c); - bool hideRow(KviKvsObjectFunctionCall *c); - bool showRow(KviKvsObjectFunctionCall *c); - bool resizeRowsToContents(KviKvsObjectFunctionCall *c); - bool resizeColumnsToContents(KviKvsObjectFunctionCall *c); + virtual bool init(KviKvsRunTimeContext * pContext, KviKvsVariantList * pParams); + + bool setText(KviKvsObjectFunctionCall * c); + bool setForeground(KviKvsObjectFunctionCall * c); + bool setNumber(KviKvsObjectFunctionCall * c); + bool setToolTip(KviKvsObjectFunctionCall * c); + bool text(KviKvsObjectFunctionCall * c); + bool setIcon(KviKvsObjectFunctionCall * c); + bool setItemFlags(KviKvsObjectFunctionCall * c); + + bool setColumnCount(KviKvsObjectFunctionCall * c); + bool columnCount(KviKvsObjectFunctionCall * c); + bool setRowCount(KviKvsObjectFunctionCall * c); + bool currentRow(KviKvsObjectFunctionCall * c); + bool currentColumn(KviKvsObjectFunctionCall * c); + bool itemRowColAt(KviKvsObjectFunctionCall * c); + + bool rowCount(KviKvsObjectFunctionCall * c); + + bool insertRow(KviKvsObjectFunctionCall * c); + bool insertColumn(KviKvsObjectFunctionCall * c); + bool removeRow(KviKvsObjectFunctionCall * c); + bool removeColumn(KviKvsObjectFunctionCall * c); + + bool setHorizontalHeaderLabels(KviKvsObjectFunctionCall * c); + bool setVerticalHeaderLabels(KviKvsObjectFunctionCall * c); + bool setCellWidget(KviKvsObjectFunctionCall * c); + + bool hideHorizontalHeader(KviKvsObjectFunctionCall * c); + bool showHorizontalHeader(KviKvsObjectFunctionCall * c); + bool hideVerticalHeader(KviKvsObjectFunctionCall * c); + bool showVerticalHeader(KviKvsObjectFunctionCall * c); + bool clear(KviKvsObjectFunctionCall * c); + bool itemEnteredEvent(KviKvsObjectFunctionCall * c); + bool cellActivatedEvent(KviKvsObjectFunctionCall * c); + bool cellDoubleClickedEvent(KviKvsObjectFunctionCall * c); + + bool hideColumn(KviKvsObjectFunctionCall * c); + bool showColumn(KviKvsObjectFunctionCall * c); + bool hideRow(KviKvsObjectFunctionCall * c); + bool showRow(KviKvsObjectFunctionCall * c); + bool resizeRowsToContents(KviKvsObjectFunctionCall * c); + bool resizeColumnsToContents(KviKvsObjectFunctionCall * c); protected slots: void slotItemEntered(QTableWidgetItem *); - void cellActivated(int iRow,int iCol); - void cellDoubleClicked(int iRow,int iCol); + void cellActivated(int iRow, int iCol); + void cellDoubleClicked(int iRow, int iCol); }; -#endif // !_CLASS_TABLEWIDGET_H_ +#endif // !_CLASS_TABLEWIDGET_H_ diff --git a/src/modules/objects/KvsObject_textBrowser.cpp b/src/modules/objects/KvsObject_textBrowser.cpp index 428fa9644..be89766f2 100644 --- a/src/modules/objects/KvsObject_textBrowser.cpp +++ b/src/modules/objects/KvsObject_textBrowser.cpp @@ -23,7 +23,6 @@ // //============================================================================= - #include "KvsObject_textBrowser.h" #include "KviError.h" #include "kvi_debug.h" @@ -66,41 +65,40 @@ This signal is emitted by the default implementation of the [classfnc]$linkClickedEvent[/classfnc]() function. */ -KVSO_BEGIN_REGISTERCLASS(KvsObject_textBrowser,"textBrowser","multilineedit") - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_textBrowser,setSource) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_textBrowser,forward) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_textBrowser,backward) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_textBrowser,home) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_textBrowser,reload) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_textBrowser,linkClickedEvent) +KVSO_BEGIN_REGISTERCLASS(KvsObject_textBrowser, "textBrowser", "multilineedit") +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_textBrowser, setSource) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_textBrowser, forward) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_textBrowser, backward) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_textBrowser, home) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_textBrowser, reload) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_textBrowser, linkClickedEvent) KVSO_END_REGISTERCLASS(KvsObject_textBrowser) -KVSO_BEGIN_CONSTRUCTOR(KvsObject_textBrowser,KvsObject_textedit) +KVSO_BEGIN_CONSTRUCTOR(KvsObject_textBrowser, KvsObject_textedit) KVSO_END_CONSTRUCTOR(KvsObject_textBrowser) - KVSO_BEGIN_DESTRUCTOR(KvsObject_textBrowser) KVSO_END_CONSTRUCTOR(KvsObject_textBrowser) -bool KvsObject_textBrowser::init(KviKvsRunTimeContext *,KviKvsVariantList *) +bool KvsObject_textBrowser::init(KviKvsRunTimeContext *, KviKvsVariantList *) { SET_OBJECT(QTextBrowser); - connect(obj,SIGNAL(anchorClicked(const QUrl &)),this,SLOT(anchorClicked(const QUrl &))); + connect(obj, SIGNAL(anchorClicked(const QUrl &)), this, SLOT(anchorClicked(const QUrl &))); return true; } -KVSO_CLASS_FUNCTION(textBrowser,setSource) +KVSO_CLASS_FUNCTION(textBrowser, setSource) { CHECK_INTERNAL_POINTER(widget()) QString szFile; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("file_name",KVS_PT_STRING,0,szFile) + KVSO_PARAMETER("file_name", KVS_PT_STRING, 0, szFile) KVSO_PARAMETERS_END(c) if(!QFile::exists(szFile)) { - c->warning(__tr2qs_ctx("I can't find the specified file '%Q'.","objects"),&szFile); + c->warning(__tr2qs_ctx("I can't find the specified file '%Q'.", "objects"), &szFile); return true; } QUrl url; @@ -109,42 +107,42 @@ KVSO_CLASS_FUNCTION(textBrowser,setSource) return true; } -KVSO_CLASS_FUNCTION(textBrowser,forward) +KVSO_CLASS_FUNCTION(textBrowser, forward) { CHECK_INTERNAL_POINTER(widget()) ((QTextBrowser *)widget())->forward(); return true; } -KVSO_CLASS_FUNCTION(textBrowser,backward) +KVSO_CLASS_FUNCTION(textBrowser, backward) { CHECK_INTERNAL_POINTER(widget()) ((QTextBrowser *)widget())->backward(); return true; } -KVSO_CLASS_FUNCTION(textBrowser,home) +KVSO_CLASS_FUNCTION(textBrowser, home) { CHECK_INTERNAL_POINTER(widget()) ((QTextBrowser *)widget())->home(); return true; } -KVSO_CLASS_FUNCTION(textBrowser,reload) +KVSO_CLASS_FUNCTION(textBrowser, reload) { CHECK_INTERNAL_POINTER(widget()) ((QTextBrowser *)widget())->reload(); return true; } -void KvsObject_textBrowser::anchorClicked(const QUrl &url) +void KvsObject_textBrowser::anchorClicked(const QUrl & url) { KviKvsVariantList parms(new KviKvsVariant(url.path())); - callFunction(this,"linkClickedEvent",0,&parms); + callFunction(this, "linkClickedEvent", 0, &parms); } -KVSO_CLASS_FUNCTION(textBrowser,linkClickedEvent) +KVSO_CLASS_FUNCTION(textBrowser, linkClickedEvent) { - emitSignal("linkClicked",c,c->params()); + emitSignal("linkClicked", c, c->params()); return true; } diff --git a/src/modules/objects/KvsObject_textBrowser.h b/src/modules/objects/KvsObject_textBrowser.h index 2adcc36f3..a4fc36041 100644 --- a/src/modules/objects/KvsObject_textBrowser.h +++ b/src/modules/objects/KvsObject_textBrowser.h @@ -1,5 +1,5 @@ -#ifndef _CLASS_TBROWSER_H_ -#define _CLASS_TBROWSER_H_ +#ifndef _CLASS_TBROWSER_H_ +#define _CLASS_TBROWSER_H_ //============================================================================= // // File : KvsObject_textBrowser.h @@ -38,16 +38,16 @@ public: public: QWidget * widget() { return (QWidget *)object(); }; protected: - virtual bool init(KviKvsRunTimeContext * pContext,KviKvsVariantList *pParams); + virtual bool init(KviKvsRunTimeContext * pContext, KviKvsVariantList * pParams); - bool setSource(KviKvsObjectFunctionCall *c); - bool forward(KviKvsObjectFunctionCall *c); - bool backward(KviKvsObjectFunctionCall *c); - bool home(KviKvsObjectFunctionCall *c); - bool reload(KviKvsObjectFunctionCall *c); - bool linkClickedEvent(KviKvsObjectFunctionCall *c); + bool setSource(KviKvsObjectFunctionCall * c); + bool forward(KviKvsObjectFunctionCall * c); + bool backward(KviKvsObjectFunctionCall * c); + bool home(KviKvsObjectFunctionCall * c); + bool reload(KviKvsObjectFunctionCall * c); + bool linkClickedEvent(KviKvsObjectFunctionCall * c); protected slots: void anchorClicked(const QUrl &); }; -#endif //!_CLASS_TBROWSER_H_ +#endif //!_CLASS_TBROWSER_H_ diff --git a/src/modules/objects/KvsObject_toolBar.cpp b/src/modules/objects/KvsObject_toolBar.cpp index 861b51c79..dd16f73e7 100644 --- a/src/modules/objects/KvsObject_toolBar.cpp +++ b/src/modules/objects/KvsObject_toolBar.cpp @@ -59,51 +59,50 @@ Deletes all the toolbars child widgets. */ -KVSO_BEGIN_REGISTERCLASS(KvsObject_toolBar,"toolbar","widget") - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_toolBar,addSeparator) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_toolBar,setLabel) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_toolBar,label) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_toolBar,clear) +KVSO_BEGIN_REGISTERCLASS(KvsObject_toolBar, "toolbar", "widget") +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_toolBar, addSeparator) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_toolBar, setLabel) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_toolBar, label) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_toolBar, clear) KVSO_END_REGISTERCLASS(KvsObject_toolBar) -KVSO_BEGIN_CONSTRUCTOR(KvsObject_toolBar,KvsObject_widget) +KVSO_BEGIN_CONSTRUCTOR(KvsObject_toolBar, KvsObject_widget) KVSO_END_CONSTRUCTOR(KvsObject_toolBar) - KVSO_BEGIN_DESTRUCTOR(KvsObject_toolBar) KVSO_END_CONSTRUCTOR(KvsObject_toolBar) -bool KvsObject_toolBar::init(KviKvsRunTimeContext * ,KviKvsVariantList *) +bool KvsObject_toolBar::init(KviKvsRunTimeContext *, KviKvsVariantList *) { SET_OBJECT(QToolBar) return true; } -KVSO_CLASS_FUNCTION(toolBar,addSeparator) +KVSO_CLASS_FUNCTION(toolBar, addSeparator) { CHECK_INTERNAL_POINTER(widget()) ((QToolBar *)widget())->addSeparator(); return true; } -KVSO_CLASS_FUNCTION(toolBar,setLabel) +KVSO_CLASS_FUNCTION(toolBar, setLabel) { CHECK_INTERNAL_POINTER(widget()) QString szLabel; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("label",KVS_PT_STRING,0,szLabel) + KVSO_PARAMETER("label", KVS_PT_STRING, 0, szLabel) KVSO_PARAMETERS_END(c) ((QToolBar *)widget())->setWindowTitle(szLabel); return true; } -KVSO_CLASS_FUNCTION(toolBar,label) +KVSO_CLASS_FUNCTION(toolBar, label) { CHECK_INTERNAL_POINTER(widget()) c->returnValue()->setString(((QToolBar *)widget())->windowTitle()); return true; } -KVSO_CLASS_FUNCTION(toolBar,clear) +KVSO_CLASS_FUNCTION(toolBar, clear) { CHECK_INTERNAL_POINTER(widget()) ((QToolBar *)object())->clear(); diff --git a/src/modules/objects/KvsObject_toolBar.h b/src/modules/objects/KvsObject_toolBar.h index 21f733519..ce6fa0620 100644 --- a/src/modules/objects/KvsObject_toolBar.h +++ b/src/modules/objects/KvsObject_toolBar.h @@ -35,13 +35,13 @@ public: public: QWidget * widget() { return (QWidget *)object(); }; protected: - virtual bool init(KviKvsRunTimeContext * pContext,KviKvsVariantList *pParams); + virtual bool init(KviKvsRunTimeContext * pContext, KviKvsVariantList * pParams); - bool addSeparator(KviKvsObjectFunctionCall *c); - bool setLabel(KviKvsObjectFunctionCall *c); - bool label(KviKvsObjectFunctionCall *c); - bool setStretchableWidget(KviKvsObjectFunctionCall *c); - bool clear(KviKvsObjectFunctionCall *c); + bool addSeparator(KviKvsObjectFunctionCall * c); + bool setLabel(KviKvsObjectFunctionCall * c); + bool label(KviKvsObjectFunctionCall * c); + bool setStretchableWidget(KviKvsObjectFunctionCall * c); + bool clear(KviKvsObjectFunctionCall * c); }; -#endif //!_CLASS_TOOLBAR_H_ +#endif //!_CLASS_TOOLBAR_H_ diff --git a/src/modules/objects/KvsObject_toolButton.cpp b/src/modules/objects/KvsObject_toolButton.cpp index d768ff30a..6ada08c2d 100644 --- a/src/modules/objects/KvsObject_toolButton.cpp +++ b/src/modules/objects/KvsObject_toolButton.cpp @@ -91,53 +91,50 @@ This signal is emitted by the default implementation of [classfnc]$clickEvent[/classfnc]().[br] */ - -KVSO_BEGIN_REGISTERCLASS(KvsObject_toolButton,"toolbutton","widget") - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_toolButton,setImage) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_toolButton,setUsesBigPixmap) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_toolButton,usesBigPixmap) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_toolButton,setUsesTextLabel) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_toolButton,usesTextLabel) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_toolButton,setAutoRaise) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_toolButton,autoRaise) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_toolButton,setTextLabel) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_toolButton,textLabel) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_toolButton,setPopup) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_toolButton,openPopup) - - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_toolButton,setToggleButton) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_toolButton,toggle) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_toolButton,setOn) - - - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_toolButton,setTextPosition) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_toolButton,textPosition) - - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_toolButton,clickEvent) +KVSO_BEGIN_REGISTERCLASS(KvsObject_toolButton, "toolbutton", "widget") +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_toolButton, setImage) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_toolButton, setUsesBigPixmap) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_toolButton, usesBigPixmap) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_toolButton, setUsesTextLabel) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_toolButton, usesTextLabel) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_toolButton, setAutoRaise) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_toolButton, autoRaise) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_toolButton, setTextLabel) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_toolButton, textLabel) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_toolButton, setPopup) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_toolButton, openPopup) + +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_toolButton, setToggleButton) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_toolButton, toggle) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_toolButton, setOn) + +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_toolButton, setTextPosition) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_toolButton, textPosition) + +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_toolButton, clickEvent) KVSO_END_REGISTERCLASS(KvsObject_toolButton) -KVSO_BEGIN_CONSTRUCTOR(KvsObject_toolButton,KvsObject_widget) +KVSO_BEGIN_CONSTRUCTOR(KvsObject_toolButton, KvsObject_widget) KVSO_END_CONSTRUCTOR(KvsObject_toolButton) - KVSO_BEGIN_DESTRUCTOR(KvsObject_toolButton) KVSO_END_CONSTRUCTOR(KvsObject_toolButton) -bool KvsObject_toolButton::init(KviKvsRunTimeContext *,KviKvsVariantList *) +bool KvsObject_toolButton::init(KviKvsRunTimeContext *, KviKvsVariantList *) { SET_OBJECT(QToolButton); - connect(widget(),SIGNAL(clicked()),this,SLOT(slotClicked())); + connect(widget(), SIGNAL(clicked()), this, SLOT(slotClicked())); return true; } -KVSO_CLASS_FUNCTION(toolButton,setImage) +KVSO_CLASS_FUNCTION(toolButton, setImage) { CHECK_INTERNAL_POINTER(widget()) QString icon; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("icon_id",KVS_PT_STRING,0,icon) + KVSO_PARAMETER("icon_id", KVS_PT_STRING, 0, icon) KVSO_PARAMETERS_END(c) QPixmap * pix = g_pIconManager->getImage(icon); if(pix) @@ -147,138 +144,139 @@ KVSO_CLASS_FUNCTION(toolButton,setImage) return true; } -KVSO_CLASS_FUNCTION(toolButton,setUsesBigPixmap) +KVSO_CLASS_FUNCTION(toolButton, setUsesBigPixmap) { CHECK_INTERNAL_POINTER(widget()) bool bEnabled; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("bEnabled",KVS_PT_BOOL,0,bEnabled) + KVSO_PARAMETER("bEnabled", KVS_PT_BOOL, 0, bEnabled) KVSO_PARAMETERS_END(c) - ((QToolButton *)widget())->setIconSize(bEnabled ? QSize(32,32) : QSize(22,22)); + ((QToolButton *)widget())->setIconSize(bEnabled ? QSize(32, 32) : QSize(22, 22)); return true; } -KVSO_CLASS_FUNCTION(toolButton,usesBigPixmap) +KVSO_CLASS_FUNCTION(toolButton, usesBigPixmap) { CHECK_INTERNAL_POINTER(widget()) c->returnValue()->setBoolean(((QToolButton *)widget())->iconSize().height() > 22); return true; } -KVSO_CLASS_FUNCTION(toolButton,setUsesTextLabel) +KVSO_CLASS_FUNCTION(toolButton, setUsesTextLabel) { CHECK_INTERNAL_POINTER(widget()) bool bEnabled; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("bEnabled",KVS_PT_BOOL,0,bEnabled) + KVSO_PARAMETER("bEnabled", KVS_PT_BOOL, 0, bEnabled) KVSO_PARAMETERS_END(c) - ((QToolButton *)widget())->setToolButtonStyle(bEnabled?Qt::ToolButtonTextUnderIcon : Qt::ToolButtonIconOnly); + ((QToolButton *)widget())->setToolButtonStyle(bEnabled ? Qt::ToolButtonTextUnderIcon : Qt::ToolButtonIconOnly); return true; } -KVSO_CLASS_FUNCTION(toolButton,usesTextLabel) +KVSO_CLASS_FUNCTION(toolButton, usesTextLabel) { CHECK_INTERNAL_POINTER(widget()) c->returnValue()->setBoolean(((QToolButton *)widget())->toolButtonStyle() != Qt::ToolButtonIconOnly); return true; } -KVSO_CLASS_FUNCTION(toolButton,setAutoRaise) +KVSO_CLASS_FUNCTION(toolButton, setAutoRaise) { CHECK_INTERNAL_POINTER(widget()) bool bEnabled; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("bEnabled",KVS_PT_BOOL,0,bEnabled) + KVSO_PARAMETER("bEnabled", KVS_PT_BOOL, 0, bEnabled) KVSO_PARAMETERS_END(c) ((QToolButton *)widget())->setAutoRaise(bEnabled); return true; } -KVSO_CLASS_FUNCTION(toolButton,autoRaise) +KVSO_CLASS_FUNCTION(toolButton, autoRaise) { CHECK_INTERNAL_POINTER(widget()) c->returnValue()->setBoolean(((QToolButton *)widget())->autoRaise()); return true; } -KVSO_CLASS_FUNCTION(toolButton,setOn) +KVSO_CLASS_FUNCTION(toolButton, setOn) { CHECK_INTERNAL_POINTER(widget()) bool bEnabled; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("bEnabled",KVS_PT_BOOL,0,bEnabled) + KVSO_PARAMETER("bEnabled", KVS_PT_BOOL, 0, bEnabled) KVSO_PARAMETERS_END(c) ((QToolButton *)widget())->setChecked(bEnabled); return true; } -KVSO_CLASS_FUNCTION(toolButton,setToggleButton) +KVSO_CLASS_FUNCTION(toolButton, setToggleButton) { CHECK_INTERNAL_POINTER(widget()) bool bEnabled; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("bEnabled",KVS_PT_BOOL,0,bEnabled) + KVSO_PARAMETER("bEnabled", KVS_PT_BOOL, 0, bEnabled) KVSO_PARAMETERS_END(c) ((QToolButton *)widget())->setCheckable(bEnabled); return true; } -KVSO_CLASS_FUNCTION(toolButton,toggle) +KVSO_CLASS_FUNCTION(toolButton, toggle) { CHECK_INTERNAL_POINTER(widget()) ((QToolButton *)widget())->toggle(); return true; } -KVSO_CLASS_FUNCTION(toolButton,setTextLabel) +KVSO_CLASS_FUNCTION(toolButton, setTextLabel) { CHECK_INTERNAL_POINTER(widget()) - QString szLabel,szTip; + QString szLabel, szTip; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("label",KVS_PT_STRING,0,szLabel) - KVSO_PARAMETER("tooltip",KVS_PT_STRING,KVS_PF_OPTIONAL,szTip) + KVSO_PARAMETER("label", KVS_PT_STRING, 0, szLabel) + KVSO_PARAMETER("tooltip", KVS_PT_STRING, KVS_PF_OPTIONAL, szTip) KVSO_PARAMETERS_END(c) ((QToolButton *)widget())->setText(szLabel); - if (!szTip.isEmpty()) ((QToolButton *)widget())->setToolTip(szTip); + if(!szTip.isEmpty()) + ((QToolButton *)widget())->setToolTip(szTip); return true; } -KVSO_CLASS_FUNCTION(toolButton,textLabel) +KVSO_CLASS_FUNCTION(toolButton, textLabel) { CHECK_INTERNAL_POINTER(widget()) c->returnValue()->setString(((QToolButton *)widget())->text()); return true; } -KVSO_CLASS_FUNCTION(toolButton,setPopup) +KVSO_CLASS_FUNCTION(toolButton, setPopup) { CHECK_INTERNAL_POINTER(widget()) - KviKvsObject *ob; + KviKvsObject * ob; kvs_hobject_t hObject; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("widget",KVS_PT_HOBJECT,0,hObject) + KVSO_PARAMETER("widget", KVS_PT_HOBJECT, 0, hObject) KVSO_PARAMETERS_END(c) - ob=KviKvsKernel::instance()->objectController()->lookupObject(hObject); - if (!ob) + ob = KviKvsKernel::instance()->objectController()->lookupObject(hObject); + if(!ob) { - c->warning(__tr2qs_ctx("Widget parameter is not an object","objects")); + c->warning(__tr2qs_ctx("Widget parameter is not an object", "objects")); return true; } - if (!ob->object()) + if(!ob->object()) { - c->warning(__tr2qs_ctx("Widget parameter is not a valid object","objects")); + c->warning(__tr2qs_ctx("Widget parameter is not a valid object", "objects")); return true; } if(!ob->inheritsClass("popupmenu")) { - c->warning(__tr2qs_ctx("Can't add a non-popupmenu object","objects")); + c->warning(__tr2qs_ctx("Can't add a non-popupmenu object", "objects")); return true; } - ((QToolButton *)widget())->setMenu(((QMenu *)(ob->object()))); + ((QToolButton *)widget())->setMenu(((QMenu *)(ob->object()))); return true; } -KVSO_CLASS_FUNCTION(toolButton,openPopup) +KVSO_CLASS_FUNCTION(toolButton, openPopup) { CHECK_INTERNAL_POINTER(widget()) ((QToolButton *)widget())->showMenu(); @@ -302,40 +300,40 @@ KVSO_CLASS_FUNCTION(toolButton,popupDelay) return true; } */ -KVSO_CLASS_FUNCTION(toolButton,setTextPosition) +KVSO_CLASS_FUNCTION(toolButton, setTextPosition) { CHECK_INTERNAL_POINTER(widget()) QString szPos; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("position",KVS_PT_STRING,0,szPos) + KVSO_PARAMETER("position", KVS_PT_STRING, 0, szPos) KVSO_PARAMETERS_END(c) - if(KviQString::equalCI(szPos,"BesideIcon")) + if(KviQString::equalCI(szPos, "BesideIcon")) ((QToolButton *)widget())->setToolButtonStyle(Qt::ToolButtonTextBesideIcon); - else if(KviQString::equalCI(szPos,"BelowIcon")) + else if(KviQString::equalCI(szPos, "BelowIcon")) ((QToolButton *)widget())->setToolButtonStyle(Qt::ToolButtonTextUnderIcon); else - c->warning(__tr2qs_ctx("Unknown text position '%Q'","objects"),&szPos); + c->warning(__tr2qs_ctx("Unknown text position '%Q'", "objects"), &szPos); return true; } -KVSO_CLASS_FUNCTION(toolButton,textPosition) +KVSO_CLASS_FUNCTION(toolButton, textPosition) { CHECK_INTERNAL_POINTER(widget()) - QString szPos="BelowIcon"; - if ((((QToolButton *)widget())->toolButtonStyle())==(Qt::ToolButtonTextBesideIcon)) - szPos="BesideIcon"; + QString szPos = "BelowIcon"; + if((((QToolButton *)widget())->toolButtonStyle()) == (Qt::ToolButtonTextBesideIcon)) + szPos = "BesideIcon"; c->returnValue()->setString(szPos); return true; } -KVSO_CLASS_FUNCTION(toolButton,clickEvent) +KVSO_CLASS_FUNCTION(toolButton, clickEvent) { - emitSignal("clicked",c); + emitSignal("clicked", c); return true; } void KvsObject_toolButton::slotClicked() { - KviKvsVariantList *params=0; - callFunction(this,"clickEvent",params); + KviKvsVariantList * params = 0; + callFunction(this, "clickEvent", params); } diff --git a/src/modules/objects/KvsObject_toolButton.h b/src/modules/objects/KvsObject_toolButton.h index d4b35b2a1..f9dcbb7d7 100644 --- a/src/modules/objects/KvsObject_toolButton.h +++ b/src/modules/objects/KvsObject_toolButton.h @@ -25,8 +25,6 @@ // //============================================================================= - - #include "KvsObject_widget.h" #include "object_macros.h" @@ -38,33 +36,32 @@ public: public: QWidget * widget() { return (QWidget *)object(); }; protected: - virtual bool init(KviKvsRunTimeContext * pContext,KviKvsVariantList *pParams); + virtual bool init(KviKvsRunTimeContext * pContext, KviKvsVariantList * pParams); - bool setImage(KviKvsObjectFunctionCall *c); - bool setUsesBigPixmap(KviKvsObjectFunctionCall *c); - bool usesBigPixmap(KviKvsObjectFunctionCall *c); - bool setUsesTextLabel(KviKvsObjectFunctionCall *c); - bool usesTextLabel(KviKvsObjectFunctionCall *c); - bool setTextLabel(KviKvsObjectFunctionCall *c); - bool textLabel(KviKvsObjectFunctionCall *c); - bool setPopup(KviKvsObjectFunctionCall *c); - bool openPopup(KviKvsObjectFunctionCall *c); - bool setOn(KviKvsObjectFunctionCall *c); - bool setToggleButton(KviKvsObjectFunctionCall *c); - bool toggle(KviKvsObjectFunctionCall *c); -// bool setPopupDelay(KviKvsObjectFunctionCall *c); -// bool popupDelay(KviKvsObjectFunctionCall *c); - bool setTextPosition(KviKvsObjectFunctionCall *c); - bool textPosition(KviKvsObjectFunctionCall *c); + bool setImage(KviKvsObjectFunctionCall * c); + bool setUsesBigPixmap(KviKvsObjectFunctionCall * c); + bool usesBigPixmap(KviKvsObjectFunctionCall * c); + bool setUsesTextLabel(KviKvsObjectFunctionCall * c); + bool usesTextLabel(KviKvsObjectFunctionCall * c); + bool setTextLabel(KviKvsObjectFunctionCall * c); + bool textLabel(KviKvsObjectFunctionCall * c); + bool setPopup(KviKvsObjectFunctionCall * c); + bool openPopup(KviKvsObjectFunctionCall * c); + bool setOn(KviKvsObjectFunctionCall * c); + bool setToggleButton(KviKvsObjectFunctionCall * c); + bool toggle(KviKvsObjectFunctionCall * c); + // bool setPopupDelay(KviKvsObjectFunctionCall *c); + // bool popupDelay(KviKvsObjectFunctionCall *c); + bool setTextPosition(KviKvsObjectFunctionCall * c); + bool textPosition(KviKvsObjectFunctionCall * c); - bool setAutoRaise(KviKvsObjectFunctionCall *c); - bool autoRaise(KviKvsObjectFunctionCall *c); - bool clickEvent(KviKvsObjectFunctionCall *c); + bool setAutoRaise(KviKvsObjectFunctionCall * c); + bool autoRaise(KviKvsObjectFunctionCall * c); + bool clickEvent(KviKvsObjectFunctionCall * c); signals: void clicked(); protected slots: void slotClicked(); }; - -#endif //!_CLASS_TOOLBUTTON_H_ +#endif //!_CLASS_TOOLBUTTON_H_ diff --git a/src/modules/objects/KvsObject_trayIcon.cpp b/src/modules/objects/KvsObject_trayIcon.cpp index e2591be50..2b0211c76 100644 --- a/src/modules/objects/KvsObject_trayIcon.cpp +++ b/src/modules/objects/KvsObject_trayIcon.cpp @@ -31,9 +31,6 @@ #include - - - /* @doc: trayicon @keyterms: @@ -94,149 +91,154 @@ This signal is emitted by the default implementation of [classfnc]$messageClickedEvent[/classfnc]. */ -KVSO_BEGIN_REGISTERCLASS(KvsObject_trayIcon,"trayicon","object") - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_trayIcon,show) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_trayIcon,hide) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_trayIcon,isVisible) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_trayIcon,setIcon) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_trayIcon,setTooltip) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_trayIcon,showMessage) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_trayIcon,setContextMenu) - // events - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_trayIcon,activatedEvent) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_trayIcon,messageClickedEvent) +KVSO_BEGIN_REGISTERCLASS(KvsObject_trayIcon, "trayicon", "object") +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_trayIcon, show) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_trayIcon, hide) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_trayIcon, isVisible) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_trayIcon, setIcon) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_trayIcon, setTooltip) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_trayIcon, showMessage) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_trayIcon, setContextMenu) +// events +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_trayIcon, activatedEvent) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_trayIcon, messageClickedEvent) KVSO_END_REGISTERCLASS(KvsObject_trayIcon) - -KVSO_BEGIN_CONSTRUCTOR(KvsObject_trayIcon,KviKvsObject) - m_pTrayIcon = new QSystemTrayIcon(0); - connect(m_pTrayIcon,SIGNAL(activated(QSystemTrayIcon::ActivationReason)),this,SLOT(slotActivated(QSystemTrayIcon::ActivationReason))); - connect(m_pTrayIcon,SIGNAL(messageClicked()),this,SLOT(slotMessageClicked())); +KVSO_BEGIN_CONSTRUCTOR(KvsObject_trayIcon, KviKvsObject) +m_pTrayIcon = new QSystemTrayIcon(0); +connect(m_pTrayIcon, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(slotActivated(QSystemTrayIcon::ActivationReason))); +connect(m_pTrayIcon, SIGNAL(messageClicked()), this, SLOT(slotMessageClicked())); KVSO_END_CONSTRUCTOR(KvsObject_trayIcon) KVSO_BEGIN_DESTRUCTOR(KvsObject_trayIcon) - delete m_pTrayIcon; +delete m_pTrayIcon; KVSO_END_DESTRUCTOR(KvsObject_trayIcon) - -KVSO_CLASS_FUNCTION(trayIcon,setIcon) +KVSO_CLASS_FUNCTION(trayIcon, setIcon) { CHECK_INTERNAL_POINTER(m_pTrayIcon) QString szIcon; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("icon",KVS_PT_STRING,0,szIcon) + KVSO_PARAMETER("icon", KVS_PT_STRING, 0, szIcon) KVSO_PARAMETERS_END(c) QPixmap * pix = g_pIconManager->getImage(szIcon); - if(pix) m_pTrayIcon->setIcon(*pix); + if(pix) + m_pTrayIcon->setIcon(*pix); return true; } -KVSO_CLASS_FUNCTION(trayIcon,setTooltip) +KVSO_CLASS_FUNCTION(trayIcon, setTooltip) { CHECK_INTERNAL_POINTER(m_pTrayIcon) QString szTooltip; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("icon",KVS_PT_STRING,0,szTooltip) + KVSO_PARAMETER("icon", KVS_PT_STRING, 0, szTooltip) KVSO_PARAMETERS_END(c) m_pTrayIcon->setToolTip(szTooltip); return true; } -KVSO_CLASS_FUNCTION(trayIcon,show) +KVSO_CLASS_FUNCTION(trayIcon, show) { CHECK_INTERNAL_POINTER(m_pTrayIcon) m_pTrayIcon->show(); return true; } -KVSO_CLASS_FUNCTION(trayIcon,hide) +KVSO_CLASS_FUNCTION(trayIcon, hide) { CHECK_INTERNAL_POINTER(m_pTrayIcon) m_pTrayIcon->show(); return true; } -KVSO_CLASS_FUNCTION(trayIcon,isVisible) +KVSO_CLASS_FUNCTION(trayIcon, isVisible) { CHECK_INTERNAL_POINTER(m_pTrayIcon) c->returnValue()->setBoolean(m_pTrayIcon->isVisible()); return true; } -KVSO_CLASS_FUNCTION(trayIcon,showMessage) +KVSO_CLASS_FUNCTION(trayIcon, showMessage) { CHECK_INTERNAL_POINTER(m_pTrayIcon) - QString szMessage,szTitle,szMessageIcon; + QString szMessage, szTitle, szMessageIcon; kvs_uint_t uTimeout; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("title",KVS_PT_STRING,0,szTitle) - KVSO_PARAMETER("message",KVS_PT_STRING,0,szMessage) - KVSO_PARAMETER("icon",KVS_PT_STRING,0,szMessageIcon) - KVSO_PARAMETER("timeout",KVS_PT_UINT,0,uTimeout) + KVSO_PARAMETER("title", KVS_PT_STRING, 0, szTitle) + KVSO_PARAMETER("message", KVS_PT_STRING, 0, szMessage) + KVSO_PARAMETER("icon", KVS_PT_STRING, 0, szMessageIcon) + KVSO_PARAMETER("timeout", KVS_PT_UINT, 0, uTimeout) KVSO_PARAMETERS_END(c) - QSystemTrayIcon::MessageIcon message=QSystemTrayIcon::NoIcon; - if(KviQString::equalCI(szMessageIcon,"NoIcon")) message= QSystemTrayIcon::NoIcon; - else if(KviQString::equalCI(szMessageIcon,"Information"))message= QSystemTrayIcon::Information; - else if(KviQString::equalCI(szMessageIcon,"Warning")) message= QSystemTrayIcon::Warning; - else if(KviQString::equalCI(szMessageIcon,"Critical")) message= QSystemTrayIcon::Critical; - else c->warning(__tr2qs_ctx("Invalid message Icon: switch to default NoIcon '%Q'","objects"),&szMessageIcon); - m_pTrayIcon->showMessage(szTitle,szMessage,message,uTimeout); + QSystemTrayIcon::MessageIcon message = QSystemTrayIcon::NoIcon; + if(KviQString::equalCI(szMessageIcon, "NoIcon")) + message = QSystemTrayIcon::NoIcon; + else if(KviQString::equalCI(szMessageIcon, "Information")) + message = QSystemTrayIcon::Information; + else if(KviQString::equalCI(szMessageIcon, "Warning")) + message = QSystemTrayIcon::Warning; + else if(KviQString::equalCI(szMessageIcon, "Critical")) + message = QSystemTrayIcon::Critical; + else + c->warning(__tr2qs_ctx("Invalid message Icon: switch to default NoIcon '%Q'", "objects"), &szMessageIcon); + m_pTrayIcon->showMessage(szTitle, szMessage, message, uTimeout); return true; } -KVSO_CLASS_FUNCTION(trayIcon,setContextMenu) +KVSO_CLASS_FUNCTION(trayIcon, setContextMenu) { CHECK_INTERNAL_POINTER(m_pTrayIcon) - KviKvsObject *ob; + KviKvsObject * ob; kvs_hobject_t hObject; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("widget",KVS_PT_HOBJECT,0,hObject) + KVSO_PARAMETER("widget", KVS_PT_HOBJECT, 0, hObject) KVSO_PARAMETERS_END(c) - ob=KviKvsKernel::instance()->objectController()->lookupObject(hObject); - if (!ob) + ob = KviKvsKernel::instance()->objectController()->lookupObject(hObject); + if(!ob) { - c->warning(__tr2qs_ctx("Widget parameter is not an object","objects")); + c->warning(__tr2qs_ctx("Widget parameter is not an object", "objects")); return true; } - if (!ob->object()) + if(!ob->object()) { - c->warning(__tr2qs_ctx("Widget parameter is not a valid object","objects")); + c->warning(__tr2qs_ctx("Widget parameter is not a valid object", "objects")); return true; } if(!ob->inheritsClass("popupmenu")) { - c->warning(__tr2qs_ctx("Can't add a non-popupmenu object","objects")); + c->warning(__tr2qs_ctx("Can't add a non-popupmenu object", "objects")); return true; } - m_pTrayIcon->setContextMenu(((QMenu *)(ob->object()))); + m_pTrayIcon->setContextMenu(((QMenu *)(ob->object()))); return true; } -KVSO_CLASS_FUNCTION(trayIcon,activatedEvent) +KVSO_CLASS_FUNCTION(trayIcon, activatedEvent) { - emitSignal("activated",c,c->params()); + emitSignal("activated", c, c->params()); return true; } -KVSO_CLASS_FUNCTION(trayIcon,messageClickedEvent) +KVSO_CLASS_FUNCTION(trayIcon, messageClickedEvent) { - emitSignal("messageClicked",c,c->params()); + emitSignal("messageClicked", c, c->params()); return true; } void KvsObject_trayIcon::slotMessageClicked() { - KviKvsVariantList *lParams=0; - callFunction(this,"messageClickedEvent",0,lParams); + KviKvsVariantList * lParams = 0; + callFunction(this, "messageClickedEvent", 0, lParams); } void KvsObject_trayIcon::slotActivated(QSystemTrayIcon::ActivationReason reason) { QString szReason; - if (reason==QSystemTrayIcon::Unknown) - szReason="Unknown"; - else if(reason==QSystemTrayIcon::Context) - szReason="Context"; - else if(reason==QSystemTrayIcon::DoubleClick) - szReason="DoubleClick"; - else if(reason==QSystemTrayIcon::Trigger) - szReason="Trigger"; - else szReason="MiddleClick"; + if(reason == QSystemTrayIcon::Unknown) + szReason = "Unknown"; + else if(reason == QSystemTrayIcon::Context) + szReason = "Context"; + else if(reason == QSystemTrayIcon::DoubleClick) + szReason = "DoubleClick"; + else if(reason == QSystemTrayIcon::Trigger) + szReason = "Trigger"; + else + szReason = "MiddleClick"; KviKvsVariantList lParams; lParams.append(new KviKvsVariant(szReason)); - callFunction(this,"activatedEvent",0,&lParams); + callFunction(this, "activatedEvent", 0, &lParams); } diff --git a/src/modules/objects/KvsObject_trayIcon.h b/src/modules/objects/KvsObject_trayIcon.h index fa9019750..9e4c9a740 100644 --- a/src/modules/objects/KvsObject_trayIcon.h +++ b/src/modules/objects/KvsObject_trayIcon.h @@ -24,8 +24,6 @@ // //============================================================================= - - #include "object_macros.h" #include #include @@ -36,17 +34,18 @@ class KvsObject_trayIcon : public KviKvsObject public: KVSO_DECLARE_OBJECT(KvsObject_trayIcon) protected: - QSystemTrayIcon *m_pTrayIcon; + QSystemTrayIcon * m_pTrayIcon; + protected: - bool setIcon(KviKvsObjectFunctionCall *c); - bool show(KviKvsObjectFunctionCall *c); - bool hide(KviKvsObjectFunctionCall *c); - bool isVisible(KviKvsObjectFunctionCall *c); - bool setTooltip(KviKvsObjectFunctionCall *c); - bool showMessage(KviKvsObjectFunctionCall *c); - bool setContextMenu(KviKvsObjectFunctionCall *c); - bool activatedEvent(KviKvsObjectFunctionCall *c); - bool messageClickedEvent(KviKvsObjectFunctionCall *c); + bool setIcon(KviKvsObjectFunctionCall * c); + bool show(KviKvsObjectFunctionCall * c); + bool hide(KviKvsObjectFunctionCall * c); + bool isVisible(KviKvsObjectFunctionCall * c); + bool setTooltip(KviKvsObjectFunctionCall * c); + bool showMessage(KviKvsObjectFunctionCall * c); + bool setContextMenu(KviKvsObjectFunctionCall * c); + bool activatedEvent(KviKvsObjectFunctionCall * c); + bool messageClickedEvent(KviKvsObjectFunctionCall * c); protected slots: void slotActivated(QSystemTrayIcon::ActivationReason); diff --git a/src/modules/objects/KvsObject_treeWidget.cpp b/src/modules/objects/KvsObject_treeWidget.cpp index cd62e31fc..d8be9006e 100644 --- a/src/modules/objects/KvsObject_treeWidget.cpp +++ b/src/modules/objects/KvsObject_treeWidget.cpp @@ -154,198 +154,204 @@ This signal is emitted by the default implementation of [classfnc]$rightButtonClickedEvent[/classfnc](). */ -KVSO_BEGIN_REGISTERCLASS(KvsObject_treeWidget,"listview","widget") - - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidget,setHeaderLabels) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidget,addColumn) - - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidget,setColumnText) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidget,setColumnCount) - - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidget,setSorting) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidget,setSortingEnabled) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidget,setRootIsDecorated) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidget,setAllColumnsShowFocus) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidget,clear) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidget,selectedItems) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidget,currentItem) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidget,setSelectionMode) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidget,listViewHeaderIsVisible) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidget,itemAt) - - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidget,hideListViewHeader) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidget,showListViewHeader) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidget,firstChild) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidget,topLevelItem) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidget,topLevelItemCount) - - - - - //events - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidget,selectionChangedEvent); - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidget,currentChangedEvent); - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidget,itemActivatedEvent); - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidget,onItemEvent); - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidget,itemClickedEvent); - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidget,itemExpandedEvent); - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidget,itemCollapsedEvent); - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidget,itemChangedEvent); - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidget,setAcceptDrops); - KVSO_REGISTER_STANDARD_NOTHINGRETURN_HANDLER(KvsObject_treeWidget,"fileDroppedEvent") +KVSO_BEGIN_REGISTERCLASS(KvsObject_treeWidget, "listview", "widget") + +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidget, setHeaderLabels) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidget, addColumn) + +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidget, setColumnText) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidget, setColumnCount) + +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidget, setSorting) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidget, setSortingEnabled) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidget, setRootIsDecorated) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidget, setAllColumnsShowFocus) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidget, clear) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidget, selectedItems) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidget, currentItem) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidget, setSelectionMode) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidget, listViewHeaderIsVisible) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidget, itemAt) + +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidget, hideListViewHeader) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidget, showListViewHeader) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidget, firstChild) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidget, topLevelItem) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidget, topLevelItemCount) + +//events +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidget, selectionChangedEvent); +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidget, currentChangedEvent); +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidget, itemActivatedEvent); +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidget, onItemEvent); +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidget, itemClickedEvent); +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidget, itemExpandedEvent); +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidget, itemCollapsedEvent); +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidget, itemChangedEvent); +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidget, setAcceptDrops); +KVSO_REGISTER_STANDARD_NOTHINGRETURN_HANDLER(KvsObject_treeWidget, "fileDroppedEvent") KVSO_END_REGISTERCLASS(KvsObject_treeWidget) -KVSO_BEGIN_CONSTRUCTOR(KvsObject_treeWidget,KvsObject_widget) +KVSO_BEGIN_CONSTRUCTOR(KvsObject_treeWidget, KvsObject_widget) KVSO_END_CONSTRUCTOR(KvsObject_treeWidget) - KVSO_BEGIN_DESTRUCTOR(KvsObject_treeWidget) KVSO_END_CONSTRUCTOR(KvsObject_treeWidget) -bool KvsObject_treeWidget::init(KviKvsRunTimeContext *,KviKvsVariantList *) +bool KvsObject_treeWidget::init(KviKvsRunTimeContext *, KviKvsVariantList *) { - setObject(new KviKvsTreeWidget(parentScriptWidget(),getName().toUtf8().data(),this),true); + setObject(new KviKvsTreeWidget(parentScriptWidget(), getName().toUtf8().data(), this), true); // hack for compatibility with "old" addColumn method; - ((QTreeWidget*) widget())->setColumnCount(0); - - connect(widget(),SIGNAL(itemClicked(QTreeWidgetItem *,int)),this,SLOT(slotClicked(QTreeWidgetItem *,int))); - connect(widget(),SIGNAL(itemSelectionChanged()),this,SLOT(slotSelectionChanged())); - connect(widget(),SIGNAL(currentItemChanged(QTreeWidgetItem *,QTreeWidgetItem *)),this,SLOT(slotCurrentChanged(QTreeWidgetItem *,QTreeWidgetItem *))); - connect(widget(),SIGNAL(itemActivated(QTreeWidgetItem *,int)),this,SLOT(slotItemActivated(QTreeWidgetItem *,int))); - connect(widget(),SIGNAL(itemEntered(QTreeWidgetItem *,int)),this,SLOT(slotOnItemEntered(QTreeWidgetItem *,int))); - connect(widget(),SIGNAL(itemExpanded(QTreeWidgetItem *)),this,SLOT(slotItemExpanded(QTreeWidgetItem *))); - connect(widget(),SIGNAL(itemCollapsed(QTreeWidgetItem *)),this,SLOT(slotItemCollapsed(QTreeWidgetItem *))); - connect(widget(),SIGNAL(itemChanged(QTreeWidgetItem *,int)),this,SLOT(slotItemChanged(QTreeWidgetItem *,int))); + ((QTreeWidget *)widget())->setColumnCount(0); + + connect(widget(), SIGNAL(itemClicked(QTreeWidgetItem *, int)), this, SLOT(slotClicked(QTreeWidgetItem *, int))); + connect(widget(), SIGNAL(itemSelectionChanged()), this, SLOT(slotSelectionChanged())); + connect(widget(), SIGNAL(currentItemChanged(QTreeWidgetItem *, QTreeWidgetItem *)), this, SLOT(slotCurrentChanged(QTreeWidgetItem *, QTreeWidgetItem *))); + connect(widget(), SIGNAL(itemActivated(QTreeWidgetItem *, int)), this, SLOT(slotItemActivated(QTreeWidgetItem *, int))); + connect(widget(), SIGNAL(itemEntered(QTreeWidgetItem *, int)), this, SLOT(slotOnItemEntered(QTreeWidgetItem *, int))); + connect(widget(), SIGNAL(itemExpanded(QTreeWidgetItem *)), this, SLOT(slotItemExpanded(QTreeWidgetItem *))); + connect(widget(), SIGNAL(itemCollapsed(QTreeWidgetItem *)), this, SLOT(slotItemCollapsed(QTreeWidgetItem *))); + connect(widget(), SIGNAL(itemChanged(QTreeWidgetItem *, int)), this, SLOT(slotItemChanged(QTreeWidgetItem *, int))); return true; } -KVSO_CLASS_FUNCTION(treeWidget,setHeaderLabels) +KVSO_CLASS_FUNCTION(treeWidget, setHeaderLabels) { QStringList columns; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("labels",KVS_PT_STRINGLIST,KVS_PF_OPTIONAL,columns) + KVSO_PARAMETER("labels", KVS_PT_STRINGLIST, KVS_PF_OPTIONAL, columns) KVSO_PARAMETERS_END(c) - if (widget()) + if(widget()) ((QTreeWidget *)object())->setHeaderLabels(columns); return true; } -KVSO_CLASS_FUNCTION(treeWidget,setColumnText) +KVSO_CLASS_FUNCTION(treeWidget, setColumnText) { - if (!widget()) return true; + if(!widget()) + return true; QString szLabel; kvs_int_t iCol; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("column",KVS_PT_INT,0,iCol) - KVSO_PARAMETER("label",KVS_PT_STRING,0,szLabel) + KVSO_PARAMETER("column", KVS_PT_INT, 0, iCol) + KVSO_PARAMETER("label", KVS_PT_STRING, 0, szLabel) KVSO_PARAMETERS_END(c) - QTreeWidgetItem *header=((QTreeWidget *)widget())->headerItem(); - header->setText(iCol,szLabel); + QTreeWidgetItem * header = ((QTreeWidget *)widget())->headerItem(); + header->setText(iCol, szLabel); return true; } -KVSO_CLASS_FUNCTION(treeWidget,topLevelItem) +KVSO_CLASS_FUNCTION(treeWidget, topLevelItem) { - if (!widget()) return true; + if(!widget()) + return true; kvs_int_t iIdx; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("index",KVS_PT_INT,0,iIdx) + KVSO_PARAMETER("index", KVS_PT_INT, 0, iIdx) KVSO_PARAMETERS_END(c) - QTreeWidgetItem *pItem=((QTreeWidget *)widget())->topLevelItem(iIdx); - if (!pItem) c->returnValue()->setHObject((kvs_hobject_t)0); - else c->returnValue()->setHObject(KvsObject_treeWidgetItem::itemToHandle(pItem)); + QTreeWidgetItem * pItem = ((QTreeWidget *)widget())->topLevelItem(iIdx); + if(!pItem) + c->returnValue()->setHObject((kvs_hobject_t)0); + else + c->returnValue()->setHObject(KvsObject_treeWidgetItem::itemToHandle(pItem)); return true; } -KVSO_CLASS_FUNCTION(treeWidget,itemAt) +KVSO_CLASS_FUNCTION(treeWidget, itemAt) { - if (!widget()) return true; - kvs_int_t iXpos,iYpos; + if(!widget()) + return true; + kvs_int_t iXpos, iYpos; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("x_pos",KVS_PT_INT,0,iXpos) - KVSO_PARAMETER("y_pos",KVS_PT_INT,0,iYpos) + KVSO_PARAMETER("x_pos", KVS_PT_INT, 0, iXpos) + KVSO_PARAMETER("y_pos", KVS_PT_INT, 0, iYpos) KVSO_PARAMETERS_END(c) - QPoint pPoint=((QTreeWidget *)widget())->viewport()->mapFromGlobal(QPoint(iXpos,iYpos)); - QTreeWidgetItem *pItem=((QTreeWidget *)widget())->itemAt(pPoint); - if (!pItem) c->returnValue()->setHObject((kvs_hobject_t)0); - else c->returnValue()->setHObject(KvsObject_treeWidgetItem::itemToHandle(pItem)); + QPoint pPoint = ((QTreeWidget *)widget())->viewport()->mapFromGlobal(QPoint(iXpos, iYpos)); + QTreeWidgetItem * pItem = ((QTreeWidget *)widget())->itemAt(pPoint); + if(!pItem) + c->returnValue()->setHObject((kvs_hobject_t)0); + else + c->returnValue()->setHObject(KvsObject_treeWidgetItem::itemToHandle(pItem)); return true; } -KVSO_CLASS_FUNCTION(treeWidget,topLevelItemCount) +KVSO_CLASS_FUNCTION(treeWidget, topLevelItemCount) { - if (!widget()) return true; + if(!widget()) + return true; c->returnValue()->setInteger(((QTreeWidget *)widget())->topLevelItemCount()); return true; } -KVSO_CLASS_FUNCTION(treeWidget,addColumn) +KVSO_CLASS_FUNCTION(treeWidget, addColumn) { - if (!widget()) return true; + if(!widget()) + return true; QString szLabel; kvs_int_t iW; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("label",KVS_PT_STRING,0,szLabel) - KVSO_PARAMETER("width",KVS_PT_INT,KVS_PF_OPTIONAL,iW) + KVSO_PARAMETER("label", KVS_PT_STRING, 0, szLabel) + KVSO_PARAMETER("width", KVS_PT_INT, KVS_PF_OPTIONAL, iW) KVSO_PARAMETERS_END(c) - int col=((QTreeWidget *)widget())->columnCount(); - QTreeWidgetItem *header=((QTreeWidget *)widget())->headerItem(); - header->setText(col,szLabel); - if(iW) ((QTreeWidget *)widget())->setColumnWidth(col,iW); + int col = ((QTreeWidget *)widget())->columnCount(); + QTreeWidgetItem * header = ((QTreeWidget *)widget())->headerItem(); + header->setText(col, szLabel); + if(iW) + ((QTreeWidget *)widget())->setColumnWidth(col, iW); col++; ((QTreeWidget *)widget())->setColumnCount(col); //col++; return true; } -KVSO_CLASS_FUNCTION(treeWidget,setAcceptDrops) +KVSO_CLASS_FUNCTION(treeWidget, setAcceptDrops) { bool bEnable; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("bEnable",KVS_PT_BOOLEAN,0,bEnable) + KVSO_PARAMETER("bEnable", KVS_PT_BOOLEAN, 0, bEnable) KVSO_PARAMETERS_END(c) - if (widget()) + if(widget()) ((QTreeWidget *)object())->setAcceptDrops(bEnable); return true; } -KVSO_CLASS_FUNCTION(treeWidget,clear) +KVSO_CLASS_FUNCTION(treeWidget, clear) { Q_UNUSED(c); - if (widget()) + if(widget()) ((QTreeWidget *)object())->clear(); return true; } -KVSO_CLASS_FUNCTION(treeWidget,selectedItems) +KVSO_CLASS_FUNCTION(treeWidget, selectedItems) { if(widget()) { - QList list=((QTreeWidget *)widget())->selectedItems(); + QList list = ((QTreeWidget *)widget())->selectedItems(); KviKvsArray * pArray = new KviKvsArray(); c->returnValue()->setArray(pArray); - for (int i=0;iset(i,new KviKvsVariant(KvsObject_treeWidgetItem::itemToHandle((QTreeWidgetItem*)list.at(i)))); + for(int i = 0; i < list.count(); i++) + pArray->set(i, new KviKvsVariant(KvsObject_treeWidgetItem::itemToHandle((QTreeWidgetItem *)list.at(i)))); } else c->returnValue()->setHObject((kvs_hobject_t)0); return true; } -KVSO_CLASS_FUNCTION(treeWidget,firstChild) +KVSO_CLASS_FUNCTION(treeWidget, firstChild) { if(widget()) - c->returnValue()->setHObject(KvsObject_treeWidgetItem::itemToHandle((QTreeWidgetItem*)((QTreeWidget *)widget())->topLevelItem(0))); + c->returnValue()->setHObject(KvsObject_treeWidgetItem::itemToHandle((QTreeWidgetItem *)((QTreeWidget *)widget())->topLevelItem(0))); else c->returnValue()->setHObject((kvs_hobject_t)0); return true; } -KVSO_CLASS_FUNCTION(treeWidget,currentItem) +KVSO_CLASS_FUNCTION(treeWidget, currentItem) { if(widget()) - c->returnValue()->setHObject(KvsObject_treeWidgetItem::itemToHandle((QTreeWidgetItem*)((QTreeWidget *)widget())->currentItem())); + c->returnValue()->setHObject(KvsObject_treeWidgetItem::itemToHandle((QTreeWidgetItem *)((QTreeWidget *)widget())->currentItem())); else c->returnValue()->setHObject((kvs_hobject_t)0); return true; @@ -363,220 +369,232 @@ KVSO_CLASS_FUNCTION(treeWidget,setColumnText) return true; } */ -KVSO_CLASS_FUNCTION(treeWidget,setColumnCount) +KVSO_CLASS_FUNCTION(treeWidget, setColumnCount) { kvs_uint_t uCol; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("column",KVS_PT_UNSIGNEDINTEGER,0,uCol) + KVSO_PARAMETER("column", KVS_PT_UNSIGNEDINTEGER, 0, uCol) KVSO_PARAMETERS_END(c) - if (widget())((QTreeWidget *)widget())->setColumnCount(uCol); + if(widget()) + ((QTreeWidget *)widget())->setColumnCount(uCol); return true; } -KVSO_CLASS_FUNCTION(treeWidget,setSelectionMode) +KVSO_CLASS_FUNCTION(treeWidget, setSelectionMode) { QString szMode; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("mode",KVS_PT_NONEMPTYSTRING,0,szMode) - KVSO_PARAMETERS_END(c) - if(!widget())return true; - if(KviQString::equalCI(szMode,"NoSelection")) + KVSO_PARAMETER("mode", KVS_PT_NONEMPTYSTRING, 0, szMode) + KVSO_PARAMETERS_END(c) + if(!widget()) + return true; + if(KviQString::equalCI(szMode, "NoSelection")) ((QTreeWidget *)widget())->setSelectionMode(QAbstractItemView::NoSelection); - else if(KviQString::equalCI(szMode,"Multi")) + else if(KviQString::equalCI(szMode, "Multi")) ((QTreeWidget *)widget())->setSelectionMode(QTreeWidget::MultiSelection); - else if(KviQString::equalCI(szMode,"Extended")) + else if(KviQString::equalCI(szMode, "Extended")) ((QTreeWidget *)widget())->setSelectionMode(QTreeWidget::ExtendedSelection); - else if(KviQString::equalCI(szMode,"Single")) + else if(KviQString::equalCI(szMode, "Single")) ((QTreeWidget *)widget())->setSelectionMode(QTreeWidget::SingleSelection); - else c->warning(__tr2qs_ctx("Invalid selection mode '%Q'","objects"),&szMode); + else + c->warning(__tr2qs_ctx("Invalid selection mode '%Q'", "objects"), &szMode); return true; } -KVSO_CLASS_FUNCTION(treeWidget,setSorting) +KVSO_CLASS_FUNCTION(treeWidget, setSorting) { kvs_int_t iCol; QString szOrder; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("column",KVS_PT_INT,0,iCol) - KVSO_PARAMETER("sort_order",KVS_PT_STRING,0,szOrder) + KVSO_PARAMETER("column", KVS_PT_INT, 0, iCol) + KVSO_PARAMETER("sort_order", KVS_PT_STRING, 0, szOrder) KVSO_PARAMETERS_END(c) - if (!widget())return true; - if (KviQString::equalCI(szOrder,"ascending")) ((QTreeWidget *)widget())->sortItems(iCol,Qt::AscendingOrder); - else if (KviQString::equalCI(szOrder,"descending")) ((QTreeWidget *)widget())->sortItems(iCol,Qt::DescendingOrder); - else c->warning(__tr2qs_ctx("Unknown '%Q' sort order: switching to ascending order","objects"),&szOrder); + if(!widget()) + return true; + if(KviQString::equalCI(szOrder, "ascending")) + ((QTreeWidget *)widget())->sortItems(iCol, Qt::AscendingOrder); + else if(KviQString::equalCI(szOrder, "descending")) + ((QTreeWidget *)widget())->sortItems(iCol, Qt::DescendingOrder); + else + c->warning(__tr2qs_ctx("Unknown '%Q' sort order: switching to ascending order", "objects"), &szOrder); return true; } -KVSO_CLASS_FUNCTION(treeWidget,setSortingEnabled) +KVSO_CLASS_FUNCTION(treeWidget, setSortingEnabled) { bool bEnables; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("bEnables",KVS_PT_BOOLEAN,0,bEnables) + KVSO_PARAMETER("bEnables", KVS_PT_BOOLEAN, 0, bEnables) KVSO_PARAMETERS_END(c) - if (!widget())return true; + if(!widget()) + return true; ((QTreeWidget *)widget())->setSortingEnabled(bEnables); return true; } -KVSO_CLASS_FUNCTION(treeWidget,setRootIsDecorated) +KVSO_CLASS_FUNCTION(treeWidget, setRootIsDecorated) { bool bEnabled; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("bEnabled",KVS_PT_BOOL,0,bEnabled) + KVSO_PARAMETER("bEnabled", KVS_PT_BOOL, 0, bEnabled) KVSO_PARAMETERS_END(c) - if (widget()) ((QTreeWidget *)widget())->setRootIsDecorated(bEnabled); + if(widget()) + ((QTreeWidget *)widget())->setRootIsDecorated(bEnabled); return true; } -KVSO_CLASS_FUNCTION(treeWidget,setAllColumnsShowFocus) +KVSO_CLASS_FUNCTION(treeWidget, setAllColumnsShowFocus) { bool bEnabled; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("bAllColumnsShowFocus",KVS_PT_BOOL,0,bEnabled) + KVSO_PARAMETER("bAllColumnsShowFocus", KVS_PT_BOOL, 0, bEnabled) KVSO_PARAMETERS_END(c) - if (widget())((QTreeWidget *)widget())->setAllColumnsShowFocus(bEnabled); + if(widget()) + ((QTreeWidget *)widget())->setAllColumnsShowFocus(bEnabled); return true; } -KVSO_CLASS_FUNCTION(treeWidget,hideListViewHeader) +KVSO_CLASS_FUNCTION(treeWidget, hideListViewHeader) { Q_UNUSED(c); ((QTreeWidget *)widget())->header()->hide(); return true; } -KVSO_CLASS_FUNCTION(treeWidget,showListViewHeader) +KVSO_CLASS_FUNCTION(treeWidget, showListViewHeader) { Q_UNUSED(c); ((QTreeWidget *)widget())->header()->show(); return true; } -KVSO_CLASS_FUNCTION(treeWidget,listViewHeaderIsVisible) +KVSO_CLASS_FUNCTION(treeWidget, listViewHeaderIsVisible) { c->returnValue()->setBoolean(((QTreeWidget *)widget())->header()->isVisible()); return true; } -KVSO_CLASS_FUNCTION(treeWidget,itemClickedEvent) +KVSO_CLASS_FUNCTION(treeWidget, itemClickedEvent) { - emitSignal("itemClicked",c,c->params()); + emitSignal("itemClicked", c, c->params()); return true; } -void KvsObject_treeWidget::slotClicked(QTreeWidgetItem * i,int col) +void KvsObject_treeWidget::slotClicked(QTreeWidgetItem * i, int col) { - KviKvsVariant *column=new KviKvsVariant((kvs_int_t)col); + KviKvsVariant * column = new KviKvsVariant((kvs_int_t)col); - KviKvsVariantList params(new KviKvsVariant(KvsObject_treeWidgetItem::itemToHandle(i)),column); - callFunction(this,"itemClickedEvent",0,¶ms); + KviKvsVariantList params(new KviKvsVariant(KvsObject_treeWidgetItem::itemToHandle(i)), column); + callFunction(this, "itemClickedEvent", 0, ¶ms); } -KVSO_CLASS_FUNCTION(treeWidget,selectionChangedEvent) +KVSO_CLASS_FUNCTION(treeWidget, selectionChangedEvent) { - emitSignal("selectionChanged",c,c->params()); + emitSignal("selectionChanged", c, c->params()); return true; } void KvsObject_treeWidget::slotSelectionChanged() { - if (((QTreeWidget *)widget())->selectionMode()==QTreeWidget::SingleSelection) + if(((QTreeWidget *)widget())->selectionMode() == QTreeWidget::SingleSelection) { - QTreeWidgetItem *it=(QTreeWidgetItem *) ((QTreeWidget *)widget())->currentItem(); + QTreeWidgetItem * it = (QTreeWidgetItem *)((QTreeWidget *)widget())->currentItem(); KviKvsVariantList params(new KviKvsVariant(KvsObject_treeWidgetItem::itemToHandle(it))); - callFunction(this,"selectionChangedEvent",0,¶ms); - } else { + callFunction(this, "selectionChangedEvent", 0, ¶ms); + } + else + { KviKvsVariantList params(new KviKvsVariant((kvs_hobject_t)0)); - callFunction(this,"selectionChangedEvent",0,¶ms); + callFunction(this, "selectionChangedEvent", 0, ¶ms); } } -KVSO_CLASS_FUNCTION(treeWidget,currentChangedEvent) +KVSO_CLASS_FUNCTION(treeWidget, currentChangedEvent) { - emitSignal("currentChanged",c,c->params()); + emitSignal("currentChanged", c, c->params()); return true; } -void KvsObject_treeWidget::slotCurrentChanged(QTreeWidgetItem * i,QTreeWidgetItem *prev) +void KvsObject_treeWidget::slotCurrentChanged(QTreeWidgetItem * i, QTreeWidgetItem * prev) { - KviKvsVariantList params(new KviKvsVariant(KvsObject_treeWidgetItem::itemToHandle(i)),new KviKvsVariant(KvsObject_treeWidgetItem::itemToHandle(prev))); - callFunction(this,"currentChangedEvent",0,¶ms); + KviKvsVariantList params(new KviKvsVariant(KvsObject_treeWidgetItem::itemToHandle(i)), new KviKvsVariant(KvsObject_treeWidgetItem::itemToHandle(prev))); + callFunction(this, "currentChangedEvent", 0, ¶ms); } -KVSO_CLASS_FUNCTION(treeWidget,itemActivatedEvent) +KVSO_CLASS_FUNCTION(treeWidget, itemActivatedEvent) { - emitSignal("itemActivated",c,c->params()); + emitSignal("itemActivated", c, c->params()); return true; } -void KvsObject_treeWidget::slotItemActivated(QTreeWidgetItem * i,int col) +void KvsObject_treeWidget::slotItemActivated(QTreeWidgetItem * i, int col) { - KviKvsVariant *column=new KviKvsVariant((kvs_int_t)col); - KviKvsVariantList params(new KviKvsVariant(KvsObject_treeWidgetItem::itemToHandle(i)),column); - callFunction(this,"itemActivatedEvent",0,¶ms); + KviKvsVariant * column = new KviKvsVariant((kvs_int_t)col); + KviKvsVariantList params(new KviKvsVariant(KvsObject_treeWidgetItem::itemToHandle(i)), column); + callFunction(this, "itemActivatedEvent", 0, ¶ms); } -KVSO_CLASS_FUNCTION(treeWidget,onItemEvent) +KVSO_CLASS_FUNCTION(treeWidget, onItemEvent) { - emitSignal("onItem",c,c->params()); + emitSignal("onItem", c, c->params()); return true; } -void KvsObject_treeWidget::slotOnItemEntered(QTreeWidgetItem * i,int col) +void KvsObject_treeWidget::slotOnItemEntered(QTreeWidgetItem * i, int col) { - KviKvsVariant *column=new KviKvsVariant((kvs_int_t)col); + KviKvsVariant * column = new KviKvsVariant((kvs_int_t)col); - KviKvsVariantList params(new KviKvsVariant(KvsObject_treeWidgetItem::itemToHandle(i)),column); - callFunction(this,"onItemEvent",0,¶ms); + KviKvsVariantList params(new KviKvsVariant(KvsObject_treeWidgetItem::itemToHandle(i)), column); + callFunction(this, "onItemEvent", 0, ¶ms); } -KVSO_CLASS_FUNCTION(treeWidget,itemExpandedEvent) +KVSO_CLASS_FUNCTION(treeWidget, itemExpandedEvent) { - emitSignal("itemExpanded",c,c->params()); + emitSignal("itemExpanded", c, c->params()); return true; } void KvsObject_treeWidget::slotItemExpanded(QTreeWidgetItem * i) { KviKvsVariantList params(new KviKvsVariant(KvsObject_treeWidgetItem::itemToHandle(i))); - callFunction(this,"itemExpandedEvent",0,¶ms); + callFunction(this, "itemExpandedEvent", 0, ¶ms); } -KVSO_CLASS_FUNCTION(treeWidget,itemCollapsedEvent) +KVSO_CLASS_FUNCTION(treeWidget, itemCollapsedEvent) { - emitSignal("itemCollapsed",c,c->params()); + emitSignal("itemCollapsed", c, c->params()); return true; } void KvsObject_treeWidget::slotItemCollapsed(QTreeWidgetItem * i) { KviKvsVariantList params(new KviKvsVariant(KvsObject_treeWidgetItem::itemToHandle(i))); - callFunction(this,"itemCollapsedEvent",0,¶ms); + callFunction(this, "itemCollapsedEvent", 0, ¶ms); } -KVSO_CLASS_FUNCTION(treeWidget,itemChangedEvent) +KVSO_CLASS_FUNCTION(treeWidget, itemChangedEvent) { - emitSignal("itemChanged",c,c->params()); + emitSignal("itemChanged", c, c->params()); return true; } -void KvsObject_treeWidget::slotItemChanged(QTreeWidgetItem *item,int col) +void KvsObject_treeWidget::slotItemChanged(QTreeWidgetItem * item, int col) { - KviKvsVariant *column=new KviKvsVariant((kvs_int_t)col); - KviKvsVariantList params(new KviKvsVariant(KvsObject_treeWidgetItem::itemToHandle(item)),column); - callFunction(this,"itemChangedEvent",0,¶ms); + KviKvsVariant * column = new KviKvsVariant((kvs_int_t)col); + KviKvsVariantList params(new KviKvsVariant(KvsObject_treeWidgetItem::itemToHandle(item)), column); + callFunction(this, "itemChangedEvent", 0, ¶ms); } -void KvsObject_treeWidget::fileDropped(QString &szFile,QTreeWidgetItem *item) +void KvsObject_treeWidget::fileDropped(QString & szFile, QTreeWidgetItem * item) { - KviKvsVariant *file=new KviKvsVariant(szFile); - KviKvsVariantList params(new KviKvsVariant(KvsObject_treeWidgetItem::itemToHandle(item)),file); - callFunction(this,"fileDroppedEvent",0,¶ms); + KviKvsVariant * file = new KviKvsVariant(szFile); + KviKvsVariantList params(new KviKvsVariant(KvsObject_treeWidgetItem::itemToHandle(item)), file); + callFunction(this, "fileDroppedEvent", 0, ¶ms); } -KviKvsTreeWidget::KviKvsTreeWidget(QWidget * par,const char *,KvsObject_treeWidget *parent) -:QTreeWidget(par) +KviKvsTreeWidget::KviKvsTreeWidget(QWidget * par, const char *, KvsObject_treeWidget * parent) + : QTreeWidget(par) { - m_pParentScript=parent; + m_pParentScript = parent; setAcceptDrops(true); setDragEnabled(true); setDropIndicatorShown(true); @@ -588,9 +606,9 @@ KviKvsTreeWidget::~KviKvsTreeWidget() { } -void KviKvsTreeWidget::dragEnterEvent( QDragEnterEvent * e ) +void KviKvsTreeWidget::dragEnterEvent(QDragEnterEvent * e) { - if(!e->mimeData()->hasUrls()) + if(!e->mimeData()->hasUrls()) { e->ignore(); return; @@ -598,9 +616,9 @@ void KviKvsTreeWidget::dragEnterEvent( QDragEnterEvent * e ) e->acceptProposedAction(); } -void KviKvsTreeWidget::dragMoveEvent( QDragMoveEvent * ) +void KviKvsTreeWidget::dragMoveEvent(QDragMoveEvent *) { - // ?#! + // ?#! } void KviKvsTreeWidget::dropEvent(QDropEvent * e) @@ -614,13 +632,13 @@ void KviKvsTreeWidget::dropEvent(QDropEvent * e) if(!list.isEmpty()) { QList::Iterator it = list.begin(); - for( ; it != list.end(); ++it ) + for(; it != list.end(); ++it) { QUrl url = *it; QString path = url.toLocalFile(); - qDebug("path %s",path.toUtf8().data()); - QTreeWidgetItem *i = itemAt( e->pos() ); - m_pParentScript->fileDropped(path,i); + qDebug("path %s", path.toUtf8().data()); + QTreeWidgetItem * i = itemAt(e->pos()); + m_pParentScript->fileDropped(path, i); } } } diff --git a/src/modules/objects/KvsObject_treeWidget.h b/src/modules/objects/KvsObject_treeWidget.h index cdd5a75bd..db277c107 100644 --- a/src/modules/objects/KvsObject_treeWidget.h +++ b/src/modules/objects/KvsObject_treeWidget.h @@ -39,50 +39,50 @@ public: public: QWidget * widget() { return (QWidget *)object(); }; - void fileDropped(QString &,QTreeWidgetItem *); -protected: - virtual bool init(KviKvsRunTimeContext * pContext,KviKvsVariantList *pParams); + void fileDropped(QString &, QTreeWidgetItem *); +protected: + virtual bool init(KviKvsRunTimeContext * pContext, KviKvsVariantList * pParams); - bool setBackgroundImage(KviKvsObjectFunctionCall *c); - bool addColumn(KviKvsObjectFunctionCall *c); - bool setColumnText(KviKvsObjectFunctionCall *c); - bool takeItem(KviKvsObjectFunctionCall *c); - bool setSorting(KviKvsObjectFunctionCall *c); - bool setSortingEnabled(KviKvsObjectFunctionCall *c); - bool setRootIsDecorated(KviKvsObjectFunctionCall *c); - bool clear(KviKvsObjectFunctionCall *c); - bool setAllColumnsShowFocus(KviKvsObjectFunctionCall *c); - bool itemClickedEvent(KviKvsObjectFunctionCall *c); - bool selectionChangedEvent(KviKvsObjectFunctionCall *c); - bool currentChangedEvent(KviKvsObjectFunctionCall *c); - bool itemActivatedEvent(KviKvsObjectFunctionCall *c); - bool onItemEvent(KviKvsObjectFunctionCall *c); - bool itemExpandedEvent(KviKvsObjectFunctionCall *c); - bool itemCollapsedEvent(KviKvsObjectFunctionCall *c); - bool itemChangedEvent(KviKvsObjectFunctionCall *c); - bool selectedItems(KviKvsObjectFunctionCall *c); - bool currentItem(KviKvsObjectFunctionCall *c); - bool setSelectionMode(KviKvsObjectFunctionCall *c); - bool firstChild(KviKvsObjectFunctionCall *c); - bool listViewHeaderIsVisible(KviKvsObjectFunctionCall *c); - bool showListViewHeader(KviKvsObjectFunctionCall *c); - bool hideListViewHeader(KviKvsObjectFunctionCall *c); - bool setAcceptDrops(KviKvsObjectFunctionCall *c); - bool setHeaderLabels(KviKvsObjectFunctionCall *c); - bool setColumnCount(KviKvsObjectFunctionCall *c); - bool topLevelItem(KviKvsObjectFunctionCall *c); - bool topLevelItemCount(KviKvsObjectFunctionCall *c); - bool itemAt(KviKvsObjectFunctionCall *c); + bool setBackgroundImage(KviKvsObjectFunctionCall * c); + bool addColumn(KviKvsObjectFunctionCall * c); + bool setColumnText(KviKvsObjectFunctionCall * c); + bool takeItem(KviKvsObjectFunctionCall * c); + bool setSorting(KviKvsObjectFunctionCall * c); + bool setSortingEnabled(KviKvsObjectFunctionCall * c); + bool setRootIsDecorated(KviKvsObjectFunctionCall * c); + bool clear(KviKvsObjectFunctionCall * c); + bool setAllColumnsShowFocus(KviKvsObjectFunctionCall * c); + bool itemClickedEvent(KviKvsObjectFunctionCall * c); + bool selectionChangedEvent(KviKvsObjectFunctionCall * c); + bool currentChangedEvent(KviKvsObjectFunctionCall * c); + bool itemActivatedEvent(KviKvsObjectFunctionCall * c); + bool onItemEvent(KviKvsObjectFunctionCall * c); + bool itemExpandedEvent(KviKvsObjectFunctionCall * c); + bool itemCollapsedEvent(KviKvsObjectFunctionCall * c); + bool itemChangedEvent(KviKvsObjectFunctionCall * c); + bool selectedItems(KviKvsObjectFunctionCall * c); + bool currentItem(KviKvsObjectFunctionCall * c); + bool setSelectionMode(KviKvsObjectFunctionCall * c); + bool firstChild(KviKvsObjectFunctionCall * c); + bool listViewHeaderIsVisible(KviKvsObjectFunctionCall * c); + bool showListViewHeader(KviKvsObjectFunctionCall * c); + bool hideListViewHeader(KviKvsObjectFunctionCall * c); + bool setAcceptDrops(KviKvsObjectFunctionCall * c); + bool setHeaderLabels(KviKvsObjectFunctionCall * c); + bool setColumnCount(KviKvsObjectFunctionCall * c); + bool topLevelItem(KviKvsObjectFunctionCall * c); + bool topLevelItemCount(KviKvsObjectFunctionCall * c); + bool itemAt(KviKvsObjectFunctionCall * c); protected slots: - void slotClicked(QTreeWidgetItem *,int); + void slotClicked(QTreeWidgetItem *, int); void slotSelectionChanged(); - void slotCurrentChanged(QTreeWidgetItem *,QTreeWidgetItem *); - void slotItemActivated(QTreeWidgetItem *,int col); - void slotOnItemEntered(QTreeWidgetItem *,int col); + void slotCurrentChanged(QTreeWidgetItem *, QTreeWidgetItem *); + void slotItemActivated(QTreeWidgetItem *, int col); + void slotOnItemEntered(QTreeWidgetItem *, int col); void slotItemExpanded(QTreeWidgetItem *); void slotItemCollapsed(QTreeWidgetItem *); - void slotItemChanged(QTreeWidgetItem *,int); + void slotItemChanged(QTreeWidgetItem *, int); }; class KviKvsTreeWidget : public QTreeWidget @@ -91,12 +91,14 @@ class KviKvsTreeWidget : public QTreeWidget public: KviKvsTreeWidget(QWidget * par, const char * name, KvsObject_treeWidget *); virtual ~KviKvsTreeWidget(); + protected: KvsObject_treeWidget * m_pParentScript; + protected: void dropEvent(QDropEvent * e); void dragEnterEvent(QDragEnterEvent * e); - void dragMoveEvent( QDragMoveEvent * e ); + void dragMoveEvent(QDragMoveEvent * e); }; #endif // _CLASS_TREEWIDGET_H_ diff --git a/src/modules/objects/KvsObject_treeWidgeteItem.cpp b/src/modules/objects/KvsObject_treeWidgeteItem.cpp index fb584a9e4..ad4a37e26 100644 --- a/src/modules/objects/KvsObject_treeWidgeteItem.cpp +++ b/src/modules/objects/KvsObject_treeWidgeteItem.cpp @@ -54,7 +54,7 @@ const char * const itemflags_tbl[] = { "tristate" }; -#define itemflags_num (sizeof(itemflags_tbl) / sizeof(itemflags_tbl[0])) +#define itemflags_num (sizeof(itemflags_tbl) / sizeof(itemflags_tbl[0])) /* @doc: listviewitem @@ -125,53 +125,55 @@ const char * const itemflags_tbl[] = { [/pre] */ -KVSO_BEGIN_REGISTERCLASS(KvsObject_treeWidgetItem,"listviewitem","object") - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidgetItem,setText) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidgetItem,text) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidgetItem,setPixmap); - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidgetItem,setItemEditable); - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidgetItem,isItemEditable); - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidgetItem,setEnabled); - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidgetItem,isEnabled); - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidgetItem,setOpen); - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidgetItem,isOpen); - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidgetItem,setCheckable); - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidgetItem,isCheckable); - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidgetItem,setChecked); - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidgetItem,isChecked); - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidgetItem,setFlags); +KVSO_BEGIN_REGISTERCLASS(KvsObject_treeWidgetItem, "listviewitem", "object") +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidgetItem, setText) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidgetItem, text) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidgetItem, setPixmap); +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidgetItem, setItemEditable); +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidgetItem, isItemEditable); +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidgetItem, setEnabled); +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidgetItem, isEnabled); +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidgetItem, setOpen); +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidgetItem, isOpen); +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidgetItem, setCheckable); +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidgetItem, isCheckable); +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidgetItem, setChecked); +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidgetItem, isChecked); +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_treeWidgetItem, setFlags); KVSO_END_REGISTERCLASS(KvsObject_treeWidgetItem) +KVSO_BEGIN_CONSTRUCTOR(KvsObject_treeWidgetItem, KviKvsObject) -KVSO_BEGIN_CONSTRUCTOR(KvsObject_treeWidgetItem,KviKvsObject) - - m_pTreeWidgetItem = 0; +m_pTreeWidgetItem = 0; KVSO_END_CONSTRUCTOR(KvsObject_treeWidgetItem) - KVSO_BEGIN_DESTRUCTOR(KvsObject_treeWidgetItem) - if(m_pTreeWidgetItem)delete m_pTreeWidgetItem; +if(m_pTreeWidgetItem) + delete m_pTreeWidgetItem; KVSO_END_CONSTRUCTOR(KvsObject_treeWidgetItem) -bool KvsObject_treeWidgetItem::init(KviKvsRunTimeContext * pContext,KviKvsVariantList *) +bool KvsObject_treeWidgetItem::init(KviKvsRunTimeContext * pContext, KviKvsVariantList *) { - if (!parentObject()) + if(!parentObject()) { - pContext->error(__tr2qs_ctx("The listviewitem can't be parentless","objects")); + pContext->error(__tr2qs_ctx("The listviewitem can't be parentless", "objects")); return false; } if(parentObject()->inheritsClass("listviewitem")) { - m_pTreeWidgetItem = new KviKvsStandardTreeWidgetItem(this,((KvsObject_treeWidgetItem *)parentObject())->m_pTreeWidgetItem); - } else { + m_pTreeWidgetItem = new KviKvsStandardTreeWidgetItem(this, ((KvsObject_treeWidgetItem *)parentObject())->m_pTreeWidgetItem); + } + else + { if(parentObject()->inheritsClass("listview")) - m_pTreeWidgetItem = new KviKvsStandardTreeWidgetItem(this,((QTreeWidget *)parentScriptWidget())); - else { - pContext->error(__tr2qs_ctx("The parent of the listviewitem must be either another listviewitem or a listview","objects")); + m_pTreeWidgetItem = new KviKvsStandardTreeWidgetItem(this, ((QTreeWidget *)parentScriptWidget())); + else + { + pContext->error(__tr2qs_ctx("The parent of the listviewitem must be either another listviewitem or a listview", "objects")); return false; } } @@ -181,94 +183,98 @@ bool KvsObject_treeWidgetItem::init(KviKvsRunTimeContext * pContext,KviKvsVarian void KvsObject_treeWidgetItem::childDestroyed() { - if(m_pTreeWidgetItem == 0)return; + if(m_pTreeWidgetItem == 0) + return; m_pTreeWidgetItem = 0; die(); } -KviKvsStandardTreeWidgetItem::KviKvsStandardTreeWidgetItem(KvsObject_treeWidgetItem * ob,QTreeWidget * par) -:QTreeWidgetItem(par), m_pMasterObject(ob) +KviKvsStandardTreeWidgetItem::KviKvsStandardTreeWidgetItem(KvsObject_treeWidgetItem * ob, QTreeWidget * par) + : QTreeWidgetItem(par), m_pMasterObject(ob) { } -KviKvsStandardTreeWidgetItem::KviKvsStandardTreeWidgetItem(KvsObject_treeWidgetItem * ob,QTreeWidgetItem * par) -:QTreeWidgetItem(par), m_pMasterObject(ob) +KviKvsStandardTreeWidgetItem::KviKvsStandardTreeWidgetItem(KvsObject_treeWidgetItem * ob, QTreeWidgetItem * par) + : QTreeWidgetItem(par), m_pMasterObject(ob) { } KviKvsStandardTreeWidgetItem::~KviKvsStandardTreeWidgetItem() { - if(m_pMasterObject)m_pMasterObject->childDestroyed(); + if(m_pMasterObject) + m_pMasterObject->childDestroyed(); } kvs_hobject_t KvsObject_treeWidgetItem::itemToHandle(QTreeWidgetItem * it) { - if(!it)return (kvs_hobject_t)0; + if(!it) + return (kvs_hobject_t)0; KvsObject_treeWidgetItem * pObject; pObject = ((KviKvsStandardTreeWidgetItem *)it)->masterObject(); - if(!pObject)return (kvs_hobject_t)0; + if(!pObject) + return (kvs_hobject_t)0; return pObject->handle(); } -KVSO_CLASS_FUNCTION(treeWidgetItem,setText) +KVSO_CLASS_FUNCTION(treeWidgetItem, setText) { kvs_uint_t uCol; QString szText; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("column",KVS_PT_UNSIGNEDINTEGER,0,uCol) - KVSO_PARAMETER("text",KVS_PT_STRING,0,szText) - KVSO_PARAMETERS_END(c) + KVSO_PARAMETER("column", KVS_PT_UNSIGNEDINTEGER, 0, uCol) + KVSO_PARAMETER("text", KVS_PT_STRING, 0, szText) + KVSO_PARAMETERS_END(c) if(m_pTreeWidgetItem) - m_pTreeWidgetItem->setText(uCol,szText); + m_pTreeWidgetItem->setText(uCol, szText); return true; } - -KVSO_CLASS_FUNCTION(treeWidgetItem,setItemEditable) +KVSO_CLASS_FUNCTION(treeWidgetItem, setItemEditable) { bool bEnabled; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("bEnabled",KVS_PT_BOOL,0,bEnabled) + KVSO_PARAMETER("bEnabled", KVS_PT_BOOL, 0, bEnabled) KVSO_PARAMETERS_END(c) if(m_pTreeWidgetItem) - m_pTreeWidgetItem->setFlags(bEnabled?m_pTreeWidgetItem->flags()|Qt::ItemIsEditable:m_pTreeWidgetItem->flags()&~Qt::ItemIsEditable); + m_pTreeWidgetItem->setFlags(bEnabled ? m_pTreeWidgetItem->flags() | Qt::ItemIsEditable : m_pTreeWidgetItem->flags() & ~Qt::ItemIsEditable); return true; } -KVSO_CLASS_FUNCTION(treeWidgetItem,isItemEditable) +KVSO_CLASS_FUNCTION(treeWidgetItem, isItemEditable) { if(!m_pTreeWidgetItem) { c->returnValue()->setBoolean(false); return true; } - c->returnValue()->setBoolean(m_pTreeWidgetItem->flags()&Qt::ItemIsEditable); + c->returnValue()->setBoolean(m_pTreeWidgetItem->flags() & Qt::ItemIsEditable); return true; } -KVSO_CLASS_FUNCTION(treeWidgetItem,setFlags) +KVSO_CLASS_FUNCTION(treeWidgetItem, setFlags) { QStringList itemflags; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("flags",KVS_PT_STRINGLIST,KVS_PF_OPTIONAL,itemflags) + KVSO_PARAMETER("flags", KVS_PT_STRINGLIST, KVS_PF_OPTIONAL, itemflags) KVSO_PARAMETERS_END(c) - int flag,sum=0; - for ( int i=0;isetCheckState(0,Qt::Unchecked); + if(flag) + { + if(flag == Qt::ItemIsUserCheckable) + m_pTreeWidgetItem->setCheckState(0, Qt::Unchecked); sum = sum | flag; } else - c->warning(__tr2qs_ctx("Unknown item flag '%Q'","objects"),&itemflags.at(i)); + c->warning(__tr2qs_ctx("Unknown item flag '%Q'", "objects"), &itemflags.at(i)); } if(m_pTreeWidgetItem) m_pTreeWidgetItem->setFlags((Qt::ItemFlags)sum); @@ -276,40 +282,40 @@ KVSO_CLASS_FUNCTION(treeWidgetItem,setFlags) return true; } -KVSO_CLASS_FUNCTION(treeWidgetItem,setEnabled) +KVSO_CLASS_FUNCTION(treeWidgetItem, setEnabled) { bool bEnabled; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("bEnabled",KVS_PT_BOOL,0,bEnabled) - KVSO_PARAMETERS_END(c) + KVSO_PARAMETER("bEnabled", KVS_PT_BOOL, 0, bEnabled) + KVSO_PARAMETERS_END(c) if(m_pTreeWidgetItem) - m_pTreeWidgetItem->setFlags(bEnabled?m_pTreeWidgetItem->flags()|Qt::ItemIsEnabled:m_pTreeWidgetItem->flags()&~Qt::ItemIsEnabled); + m_pTreeWidgetItem->setFlags(bEnabled ? m_pTreeWidgetItem->flags() | Qt::ItemIsEnabled : m_pTreeWidgetItem->flags() & ~Qt::ItemIsEnabled); return true; } -KVSO_CLASS_FUNCTION(treeWidgetItem,isEnabled) +KVSO_CLASS_FUNCTION(treeWidgetItem, isEnabled) { if(!m_pTreeWidgetItem) { c->returnValue()->setBoolean(false); return true; } - c->returnValue()->setBoolean(m_pTreeWidgetItem->flags()&Qt::ItemIsEnabled); + c->returnValue()->setBoolean(m_pTreeWidgetItem->flags() & Qt::ItemIsEnabled); return true; } -KVSO_CLASS_FUNCTION(treeWidgetItem,setOpen) +KVSO_CLASS_FUNCTION(treeWidgetItem, setOpen) { bool bEnabled; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("bEnabled",KVS_PT_BOOL,0,bEnabled) + KVSO_PARAMETER("bEnabled", KVS_PT_BOOL, 0, bEnabled) KVSO_PARAMETERS_END(c) if(m_pTreeWidgetItem) m_pTreeWidgetItem->setExpanded(bEnabled); return true; } -KVSO_CLASS_FUNCTION(treeWidgetItem,isOpen) +KVSO_CLASS_FUNCTION(treeWidgetItem, isOpen) { if(!m_pTreeWidgetItem) { @@ -320,93 +326,101 @@ KVSO_CLASS_FUNCTION(treeWidgetItem,isOpen) return true; } -KVSO_CLASS_FUNCTION(treeWidgetItem,setChecked) +KVSO_CLASS_FUNCTION(treeWidgetItem, setChecked) { bool bChecked; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("bChecked",KVS_PT_BOOL,0,bChecked) + KVSO_PARAMETER("bChecked", KVS_PT_BOOL, 0, bChecked) KVSO_PARAMETERS_END(c) - if(!m_pTreeWidgetItem)return true; - ((QTreeWidgetItem *)m_pTreeWidgetItem)->setCheckState(0,bChecked?Qt::Checked:Qt::Unchecked); + if(!m_pTreeWidgetItem) + return true; + ((QTreeWidgetItem *)m_pTreeWidgetItem)->setCheckState(0, bChecked ? Qt::Checked : Qt::Unchecked); return true; } -KVSO_CLASS_FUNCTION(treeWidgetItem,isChecked) +KVSO_CLASS_FUNCTION(treeWidgetItem, isChecked) { if(!m_pTreeWidgetItem) { c->returnValue()->setBoolean(false); return true; } - c->returnValue()->setBoolean(((QTreeWidgetItem *)m_pTreeWidgetItem)->checkState(0)==Qt::Checked?1:0); + c->returnValue()->setBoolean(((QTreeWidgetItem *)m_pTreeWidgetItem)->checkState(0) == Qt::Checked ? 1 : 0); return true; } -KVSO_CLASS_FUNCTION(treeWidgetItem,setCheckable) +KVSO_CLASS_FUNCTION(treeWidgetItem, setCheckable) { bool bEnabled; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("bCheckable",KVS_PT_BOOL,0,bEnabled) + KVSO_PARAMETER("bCheckable", KVS_PT_BOOL, 0, bEnabled) KVSO_PARAMETERS_END(c) - if(!m_pTreeWidgetItem)return true; - m_pTreeWidgetItem->setFlags(bEnabled?m_pTreeWidgetItem->flags()|Qt::ItemIsUserCheckable:m_pTreeWidgetItem->flags()&~Qt::ItemIsUserCheckable); + if(!m_pTreeWidgetItem) + return true; + m_pTreeWidgetItem->setFlags(bEnabled ? m_pTreeWidgetItem->flags() | Qt::ItemIsUserCheckable : m_pTreeWidgetItem->flags() & ~Qt::ItemIsUserCheckable); return true; } -KVSO_CLASS_FUNCTION(treeWidgetItem,isCheckable) +KVSO_CLASS_FUNCTION(treeWidgetItem, isCheckable) { if(!m_pTreeWidgetItem) { c->returnValue()->setBoolean(false); return true; } - c->returnValue()->setBoolean(m_pTreeWidgetItem->flags()&Qt::ItemIsUserCheckable); + c->returnValue()->setBoolean(m_pTreeWidgetItem->flags() & Qt::ItemIsUserCheckable); return true; } -KVSO_CLASS_FUNCTION(treeWidgetItem,text) +KVSO_CLASS_FUNCTION(treeWidgetItem, text) { kvs_uint_t uCol; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("column",KVS_PT_UNSIGNEDINTEGER,0,uCol) + KVSO_PARAMETER("column", KVS_PT_UNSIGNEDINTEGER, 0, uCol) KVSO_PARAMETERS_END(c) if(m_pTreeWidgetItem) c->returnValue()->setString(m_pTreeWidgetItem->text(uCol)); return true; } -KVSO_CLASS_FUNCTION(treeWidgetItem,setPixmap) +KVSO_CLASS_FUNCTION(treeWidgetItem, setPixmap) { kvs_uint_t uCol; - KviKvsObject *obPixmap; + KviKvsObject * obPixmap; kvs_hobject_t obHpixmap; KviKvsVariant * vPixmap; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("column",KVS_PT_UNSIGNEDINTEGER,0,uCol) - KVSO_PARAMETER("pixmap",KVS_PT_VARIANT,0,vPixmap) + KVSO_PARAMETER("column", KVS_PT_UNSIGNEDINTEGER, 0, uCol) + KVSO_PARAMETER("pixmap", KVS_PT_VARIANT, 0, vPixmap) KVSO_PARAMETERS_END(c) - QPixmap *pix = 0; - if (vPixmap->isEmpty()) {m_pTreeWidgetItem->setIcon(uCol,QIcon());return true;} + QPixmap * pix = 0; + if(vPixmap->isEmpty()) + { + m_pTreeWidgetItem->setIcon(uCol, QIcon()); + return true; + } if(vPixmap->isHObject()) { vPixmap->asHObject(obHpixmap); - obPixmap=KviKvsKernel::instance()->objectController()->lookupObject(obHpixmap); - if (!obPixmap->inheritsClass("pixmap")) + obPixmap = KviKvsKernel::instance()->objectController()->lookupObject(obHpixmap); + if(!obPixmap->inheritsClass("pixmap")) { - c->warning(__tr2qs_ctx("Pixmap object or image Id required","objects")); + c->warning(__tr2qs_ctx("Pixmap object or image Id required", "objects")); return true; } - pix=((KvsObject_pixmap *)obPixmap)->getPixmap(); - } else { + pix = ((KvsObject_pixmap *)obPixmap)->getPixmap(); + } + else + { QString szPix; vPixmap->asString(szPix); - pix=g_pIconManager->getImage(szPix); + pix = g_pIconManager->getImage(szPix); if(!pix) { - c->warning(__tr2qs_ctx("Error occurred: the suitable file '%Q' is not of the correct format or it is not a valid icon number.","objects"),&szPix); + c->warning(__tr2qs_ctx("Error occurred: the suitable file '%Q' is not of the correct format or it is not a valid icon number.", "objects"), &szPix); return true; } } - m_pTreeWidgetItem->setIcon(uCol,QIcon(*pix)); + m_pTreeWidgetItem->setIcon(uCol, QIcon(*pix)); return true; } diff --git a/src/modules/objects/KvsObject_treeWidgeteItem.h b/src/modules/objects/KvsObject_treeWidgeteItem.h index 821b8579a..8d3aa01f6 100644 --- a/src/modules/objects/KvsObject_treeWidgeteItem.h +++ b/src/modules/objects/KvsObject_treeWidgeteItem.h @@ -25,7 +25,6 @@ // //============================================================================= - #include "KvsObject_widget.h" #include "object_macros.h" @@ -36,43 +35,46 @@ class KvsObject_treeWidgetItem : public KviKvsObject public: KVSO_DECLARE_OBJECT(KvsObject_treeWidgetItem) void childDestroyed(); + protected: QTreeWidgetItem * m_pTreeWidgetItem; + protected: - virtual bool init(KviKvsRunTimeContext * pContext,KviKvsVariantList *pParams); + virtual bool init(KviKvsRunTimeContext * pContext, KviKvsVariantList * pParams); + protected: - bool setText(KviKvsObjectFunctionCall *c); - bool insertItem(KviKvsObjectFunctionCall *c); - bool setPixmap(KviKvsObjectFunctionCall *c); - bool setItemEditable(KviKvsObjectFunctionCall *c); - bool isItemEditable(KviKvsObjectFunctionCall *c); - bool setEnabled(KviKvsObjectFunctionCall *c); - bool isEnabled(KviKvsObjectFunctionCall *c); - bool setOpen(KviKvsObjectFunctionCall *c); - bool isOpen(KviKvsObjectFunctionCall *c); - bool text(KviKvsObjectFunctionCall *c); - bool setCheckable(KviKvsObjectFunctionCall *c); - bool isCheckable(KviKvsObjectFunctionCall *c); - bool setChecked(KviKvsObjectFunctionCall *c); - bool isChecked(KviKvsObjectFunctionCall *c); - bool setFlags(KviKvsObjectFunctionCall *c); + bool setText(KviKvsObjectFunctionCall * c); + bool insertItem(KviKvsObjectFunctionCall * c); + bool setPixmap(KviKvsObjectFunctionCall * c); + bool setItemEditable(KviKvsObjectFunctionCall * c); + bool isItemEditable(KviKvsObjectFunctionCall * c); + bool setEnabled(KviKvsObjectFunctionCall * c); + bool isEnabled(KviKvsObjectFunctionCall * c); + bool setOpen(KviKvsObjectFunctionCall * c); + bool isOpen(KviKvsObjectFunctionCall * c); + bool text(KviKvsObjectFunctionCall * c); + bool setCheckable(KviKvsObjectFunctionCall * c); + bool isCheckable(KviKvsObjectFunctionCall * c); + bool setChecked(KviKvsObjectFunctionCall * c); + bool isChecked(KviKvsObjectFunctionCall * c); + bool setFlags(KviKvsObjectFunctionCall * c); public: static kvs_hobject_t itemToHandle(QTreeWidgetItem * it); }; - class KviKvsStandardTreeWidgetItem : public QTreeWidgetItem { public: - KviKvsStandardTreeWidgetItem(KvsObject_treeWidgetItem * ob,QTreeWidget * par); - KviKvsStandardTreeWidgetItem(KvsObject_treeWidgetItem * ob,QTreeWidgetItem * par); + KviKvsStandardTreeWidgetItem(KvsObject_treeWidgetItem * ob, QTreeWidget * par); + KviKvsStandardTreeWidgetItem(KvsObject_treeWidgetItem * ob, QTreeWidgetItem * par); virtual ~KviKvsStandardTreeWidgetItem(); + protected: KvsObject_treeWidgetItem * m_pMasterObject; + public: - KvsObject_treeWidgetItem * masterObject(){ return m_pMasterObject; } + KvsObject_treeWidgetItem * masterObject() { return m_pMasterObject; } }; - #endif // _CLASS_TREEWIDGETITEM_H_ diff --git a/src/modules/objects/KvsObject_vBox.cpp b/src/modules/objects/KvsObject_vBox.cpp index 1f8067d44..a8a17d282 100644 --- a/src/modules/objects/KvsObject_vBox.cpp +++ b/src/modules/objects/KvsObject_vBox.cpp @@ -32,33 +32,30 @@ #include "KviTalVBox.h" - // Tables used in $setAlignment & $alignment const char * const align_tbl[] = { - "Left", - "Right", - "HCenter", - "VCenter", - "Center", - "Top", - "Bottom", - "Justify" - }; - - + "Left", + "Right", + "HCenter", + "VCenter", + "Center", + "Top", + "Bottom", + "Justify" +}; const int align_cod[] = { - Qt::AlignLeft, - Qt::AlignRight, - Qt::AlignHCenter, - Qt::AlignVCenter, - Qt::AlignCenter, - Qt::AlignTop, - Qt::AlignBottom, - Qt::AlignJustify, - }; - -#define align_num (sizeof(align_tbl) / sizeof(align_tbl[0])) + Qt::AlignLeft, + Qt::AlignRight, + Qt::AlignHCenter, + Qt::AlignVCenter, + Qt::AlignCenter, + Qt::AlignTop, + Qt::AlignBottom, + Qt::AlignJustify, +}; + +#define align_num (sizeof(align_tbl) / sizeof(align_tbl[0])) /* @doc: vbox @@ -98,24 +95,23 @@ const int align_cod[] = { [/pre] */ -KVSO_BEGIN_REGISTERCLASS(KvsObject_vBox,"vbox","widget") - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_vBox,setMargin) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_vBox,setSpacing) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_vBox,setStretchFactor) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_vBox,addStretch) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_vBox,setAlignment) +KVSO_BEGIN_REGISTERCLASS(KvsObject_vBox, "vbox", "widget") +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_vBox, setMargin) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_vBox, setSpacing) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_vBox, setStretchFactor) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_vBox, addStretch) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_vBox, setAlignment) KVSO_END_REGISTERCLASS(KvsObject_vBox) -KVSO_BEGIN_CONSTRUCTOR(KvsObject_vBox,KvsObject_widget) +KVSO_BEGIN_CONSTRUCTOR(KvsObject_vBox, KvsObject_widget) KVSO_END_CONSTRUCTOR(KvsObject_vBox) - KVSO_BEGIN_DESTRUCTOR(KvsObject_vBox) KVSO_END_CONSTRUCTOR(KvsObject_vBox) -bool KvsObject_vBox::init(KviKvsRunTimeContext * pContext,KviKvsVariantList *pParams) +bool KvsObject_vBox::init(KviKvsRunTimeContext * pContext, KviKvsVariantList * pParams) { Q_UNUSED(pContext); Q_UNUSED(pParams); @@ -124,96 +120,96 @@ bool KvsObject_vBox::init(KviKvsRunTimeContext * pContext,KviKvsVariantList *pPa return true; } -KVSO_CLASS_FUNCTION(vBox,setMargin) +KVSO_CLASS_FUNCTION(vBox, setMargin) { CHECK_INTERNAL_POINTER(widget()) kvs_int_t iMargin; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("margin",KVS_PT_INT,0,iMargin) + KVSO_PARAMETER("margin", KVS_PT_INT, 0, iMargin) KVSO_PARAMETERS_END(c) ((KviTalVBox *)widget())->setMargin(iMargin); return true; } -KVSO_CLASS_FUNCTION(vBox,setSpacing) +KVSO_CLASS_FUNCTION(vBox, setSpacing) { CHECK_INTERNAL_POINTER(widget()) kvs_int_t iSpacing; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("spacing",KVS_PT_INT,0,iSpacing) + KVSO_PARAMETER("spacing", KVS_PT_INT, 0, iSpacing) KVSO_PARAMETERS_END(c) ((KviTalVBox *)widget())->setSpacing(iSpacing); return true; } -KVSO_CLASS_FUNCTION(vBox,setStretchFactor) +KVSO_CLASS_FUNCTION(vBox, setStretchFactor) { CHECK_INTERNAL_POINTER(widget()) KviKvsObject * pObject; kvs_hobject_t hObject; kvs_uint_t uStretch; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("widget",KVS_PT_HOBJECT,0,hObject) - KVSO_PARAMETER("stretch",KVS_PT_UNSIGNEDINTEGER,0,uStretch) + KVSO_PARAMETER("widget", KVS_PT_HOBJECT, 0, hObject) + KVSO_PARAMETER("stretch", KVS_PT_UNSIGNEDINTEGER, 0, uStretch) KVSO_PARAMETERS_END(c) - pObject=KviKvsKernel::instance()->objectController()->lookupObject(hObject); + pObject = KviKvsKernel::instance()->objectController()->lookupObject(hObject); return true; CHECK_HOBJECT_IS_WIDGET(pObject) if(((KvsObject_widget *)pObject)->widget()->parentWidget() != widget()) { - c->warning(__tr2qs_ctx("The widget must be a child of this vbox","objects")); + c->warning(__tr2qs_ctx("The widget must be a child of this vbox", "objects")); return true; } - ((KviTalVBox *)widget())->setStretchFactor(((QWidget *)(pObject->object())),uStretch); + ((KviTalVBox *)widget())->setStretchFactor(((QWidget *)(pObject->object())), uStretch); return true; } -KVSO_CLASS_FUNCTION(vBox,addStretch) +KVSO_CLASS_FUNCTION(vBox, addStretch) { CHECK_INTERNAL_POINTER(widget()) kvs_int_t iStretch; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("stretch",KVS_PT_INT,0,iStretch) + KVSO_PARAMETER("stretch", KVS_PT_INT, 0, iStretch) KVSO_PARAMETERS_END(c) ((KviTalVBox *)widget())->addStretch(iStretch); return true; } -KVSO_CLASS_FUNCTION(vBox,setAlignment) +KVSO_CLASS_FUNCTION(vBox, setAlignment) { CHECK_INTERNAL_POINTER(widget()) QStringList alignment; KviKvsObject * pObject; kvs_hobject_t hObject; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("widget",KVS_PT_HOBJECT,0,hObject) - KVSO_PARAMETER("alignment",KVS_PT_STRINGLIST,KVS_PF_OPTIONAL,alignment) + KVSO_PARAMETER("widget", KVS_PT_HOBJECT, 0, hObject) + KVSO_PARAMETER("alignment", KVS_PT_STRINGLIST, KVS_PF_OPTIONAL, alignment) KVSO_PARAMETERS_END(c) - pObject=KviKvsKernel::instance()->objectController()->lookupObject(hObject); + pObject = KviKvsKernel::instance()->objectController()->lookupObject(hObject); CHECK_HOBJECT_IS_WIDGET(pObject) if(((KvsObject_widget *)pObject)->widget()->parentWidget() != widget()) { - c->warning(__tr2qs_ctx("The widget must be a child of this hbox","objects")); + c->warning(__tr2qs_ctx("The widget must be a child of this hbox", "objects")); return true; } - int align,sum=0; - for ( QStringList::Iterator it = alignment.begin(); it != alignment.end(); ++it ) - { + int align, sum = 0; + for(QStringList::Iterator it = alignment.begin(); it != alignment.end(); ++it) + { - align = 0; - for(unsigned int j = 0; j < align_num; j++) + align = 0; + for(unsigned int j = 0; j < align_num; j++) + { + if(KviQString::equalCI((*it), align_tbl[j])) { - if(KviQString::equalCI((*it), align_tbl[j])) - { - align=align_cod[j]; - break; - } + align = align_cod[j]; + break; } - if(align) - sum = sum | align; - else - c->warning(__tr2qs_ctx("Unknown alignment: '%Q'","objects"),&(*it)); - } - if (widget()) ((KviTalHBox *)widget())->setAlignment(((QWidget *)(pObject->object())),(Qt::Alignment)sum); + if(align) + sum = sum | align; + else + c->warning(__tr2qs_ctx("Unknown alignment: '%Q'", "objects"), &(*it)); + } + if(widget()) + ((KviTalHBox *)widget())->setAlignment(((QWidget *)(pObject->object())), (Qt::Alignment)sum); return true; } diff --git a/src/modules/objects/KvsObject_vBox.h b/src/modules/objects/KvsObject_vBox.h index 8c1ed4a48..24b7ae590 100644 --- a/src/modules/objects/KvsObject_vBox.h +++ b/src/modules/objects/KvsObject_vBox.h @@ -36,14 +36,12 @@ public: public: QWidget * widget() { return (QWidget *)object(); }; protected: - virtual bool init(KviKvsRunTimeContext * pContext,KviKvsVariantList *pParams); - bool setMargin(KviKvsObjectFunctionCall *c); - bool setSpacing(KviKvsObjectFunctionCall *c); - bool setStretchFactor(KviKvsObjectFunctionCall *c); - bool addStretch(KviKvsObjectFunctionCall *c); - bool setAlignment(KviKvsObjectFunctionCall *c); - + virtual bool init(KviKvsRunTimeContext * pContext, KviKvsVariantList * pParams); + bool setMargin(KviKvsObjectFunctionCall * c); + bool setSpacing(KviKvsObjectFunctionCall * c); + bool setStretchFactor(KviKvsObjectFunctionCall * c); + bool addStretch(KviKvsObjectFunctionCall * c); + bool setAlignment(KviKvsObjectFunctionCall * c); }; - #endif //_CLASS_HBOX_H_ diff --git a/src/modules/objects/KvsObject_webView.cpp b/src/modules/objects/KvsObject_webView.cpp index da6f4b8fc..41a774b80 100644 --- a/src/modules/objects/KvsObject_webView.cpp +++ b/src/modules/objects/KvsObject_webView.cpp @@ -47,22 +47,22 @@ #include static int g_iDownloadId = 1; -KviKvsDownloadHandler::KviKvsDownloadHandler(KvsObject_webView * pParent,QFile *pFile,QNetworkReply *pNetReply,int iId) -:QObject(pParent) +KviKvsDownloadHandler::KviKvsDownloadHandler(KvsObject_webView * pParent, QFile * pFile, QNetworkReply * pNetReply, int iId) + : QObject(pParent) { m_Id = iId; m_pParentScript = pParent; m_pReply = pNetReply; m_pFile = pFile; - connect(m_pReply,SIGNAL(finished()),this,SLOT(slotReplyFinished())); - connect(m_pReply,SIGNAL(readyRead()),this,SLOT(slotReadyRead())); + connect(m_pReply, SIGNAL(finished()), this, SLOT(slotReplyFinished())); + connect(m_pReply, SIGNAL(readyRead()), this, SLOT(slotReadyRead())); } void KviKvsDownloadHandler::slotReplyFinished() { KviKvsVariantList params(new KviKvsVariant((kvs_int_t)m_Id)); - m_pParentScript->callFunction(m_pParentScript,"downloadCompletedEvent",¶ms); + m_pParentScript->callFunction(m_pParentScript, "downloadCompletedEvent", ¶ms); m_pFile->close(); delete m_pFile; m_pFile = 0; @@ -96,9 +96,9 @@ void KviKvsDownloadHandler::slotReadyRead() } QByteArray bytes = m_pReply->readAll(); - KviKvsVariantList params(new KviKvsVariant((kvs_int_t)bytes.count()),\ - new KviKvsVariant((kvs_int_t)m_Id),new KviKvsVariant((kvs_int_t)iSize)); - m_pParentScript->callFunction(m_pParentScript,"downloadProgressEvent",¶ms); + KviKvsVariantList params(new KviKvsVariant((kvs_int_t)bytes.count()), + new KviKvsVariant((kvs_int_t)m_Id), new KviKvsVariant((kvs_int_t)iSize)); + m_pParentScript->callFunction(m_pParentScript, "downloadProgressEvent", ¶ms); m_pFile->write(bytes); } @@ -116,8 +116,7 @@ const QWebSettings::WebAttribute webattributes_cod[] = { QWebSettings::PluginsEnabled, QWebSettings::JavascriptCanOpenWindows, QWebSettings::JavascriptCanAccessClipboard, - QWebSettings::ZoomTextOnly - , + QWebSettings::ZoomTextOnly, QWebSettings::LocalContentCanAccessFileUrls }; @@ -125,13 +124,15 @@ const char * const findflag_tbl[] = { "FindBackward", "FindCaseSensitively", "FindWrapsAroundDocument", - "HighlightAllOccurrences"}; + "HighlightAllOccurrences" +}; const QWebPage::FindFlag findflag_cod[] = { QWebPage::FindBackward, QWebPage::FindCaseSensitively, QWebPage::FindWrapsAroundDocument, - QWebPage::HighlightAllOccurrences}; + QWebPage::HighlightAllOccurrences +}; const QWebPage::WebAction actions_cod[] = { QWebPage::OpenLink, @@ -148,7 +149,8 @@ const QWebPage::WebAction actions_cod[] = { QWebPage::Copy, QWebPage::Paste, QWebPage::InspectElement, - QWebPage::SelectAll}; + QWebPage::SelectAll +}; const char * const actions_tbl[] = { "OpenLink", @@ -165,7 +167,8 @@ const char * const actions_tbl[] = { "Copy", "Paste", "InspectElement", - "SelectAll"}; + "SelectAll" +}; #define webattributes_num (sizeof(webattributes_tbl) / sizeof(webattributes_tbl[0])) #define findflag_num (sizeof(findflag_tbl) / sizeof(findflag_tbl[0])) @@ -305,114 +308,113 @@ const char * const actions_tbl[] = { This signal is emitted by the default implementation of [classfnc:webview]downloadCompletedEvent[/classfnc](). */ -KVSO_BEGIN_REGISTERCLASS(KvsObject_webView,"webview","widget") - - // page related - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_webView,load) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_webView,setHtml) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_webView,frames) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_webView,makePreview) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_webView,appendWebViewActionToMenu) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_webView,setLinkDelegationPolicy) - - // navigationn through the dom's tree - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_webView,firstChild) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_webView,lastChild) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_webView,appendInside) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_webView,appendOutside) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_webView,parentElement) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_webView,nextSibling) - - // find dom's elements - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_webView,findAll) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_webView,findFirst) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_webView,findText) - - // element info - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_webView,elementTagName) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_webView,getDocumentElement) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_webView,elementAttributeNames) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_webView,setElementAttribute) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_webView,elementAttribute) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_webView,hitTestContent) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_webView,toPlainText) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_webView,setPlainText) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_webView,removeFromDocument) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_webView,removeClass) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_webView,addClass) - - // css - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_webView,setStyleProperty) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_webView,styleProperty) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_webView,setWebSetting) - - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_webView,classes) - - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_webView,setEventFilter) - - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_webView,addToJavaScriptWindowObject) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_webView,evaluateJavaScript) - - // events - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_webView,jsChangeEvent) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_webView,jsSubmitEvent) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_webView,jsClickEvent) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_webView,jsMouseOverEvent) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_webView,jsMouseOutEvent) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_webView,linkClickedEvent) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_webView,loadFinishedEvent) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_webView,loadProgressEvent) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_webView,loadStartedEvent) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_webView,downloadCompletedEvent) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_webView,downloadRequestEvent) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_webView,downloadProgressEvent) +KVSO_BEGIN_REGISTERCLASS(KvsObject_webView, "webview", "widget") + +// page related +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_webView, load) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_webView, setHtml) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_webView, frames) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_webView, makePreview) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_webView, appendWebViewActionToMenu) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_webView, setLinkDelegationPolicy) + +// navigationn through the dom's tree +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_webView, firstChild) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_webView, lastChild) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_webView, appendInside) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_webView, appendOutside) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_webView, parentElement) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_webView, nextSibling) + +// find dom's elements +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_webView, findAll) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_webView, findFirst) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_webView, findText) + +// element info +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_webView, elementTagName) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_webView, getDocumentElement) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_webView, elementAttributeNames) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_webView, setElementAttribute) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_webView, elementAttribute) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_webView, hitTestContent) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_webView, toPlainText) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_webView, setPlainText) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_webView, removeFromDocument) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_webView, removeClass) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_webView, addClass) + +// css +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_webView, setStyleProperty) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_webView, styleProperty) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_webView, setWebSetting) + +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_webView, classes) + +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_webView, setEventFilter) + +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_webView, addToJavaScriptWindowObject) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_webView, evaluateJavaScript) + +// events +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_webView, jsChangeEvent) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_webView, jsSubmitEvent) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_webView, jsClickEvent) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_webView, jsMouseOverEvent) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_webView, jsMouseOutEvent) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_webView, linkClickedEvent) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_webView, loadFinishedEvent) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_webView, loadProgressEvent) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_webView, loadStartedEvent) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_webView, downloadCompletedEvent) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_webView, downloadRequestEvent) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_webView, downloadProgressEvent) KVSO_END_REGISTERCLASS(KvsObject_webView) -KVSO_BEGIN_CONSTRUCTOR(KvsObject_webView,KviKvsObject) +KVSO_BEGIN_CONSTRUCTOR(KvsObject_webView, KviKvsObject) KVSO_END_CONSTRUCTOR(KvsObject_webView) - KVSO_BEGIN_DESTRUCTOR(KvsObject_webView) - m_elementMapper.clear(); KVSO_END_CONSTRUCTOR(KvsObject_webView) -bool KvsObject_webView::init(KviKvsRunTimeContext *c ,KviKvsVariantList *) +bool KvsObject_webView::init(KviKvsRunTimeContext * c, KviKvsVariantList *) { //SET_OBJECT(KviKvsWebview); - setObject(new KviKvsWebView(parentScriptWidget(), getName().toUtf8().data(),this), true); - elementMapId=1; + setObject(new KviKvsWebView(parentScriptWidget(), getName().toUtf8().data(), this), true); + elementMapId = 1; m_pContext = c; m_pNetworkManager = new QNetworkAccessManager(this); - QWebPage *pPage = ((QWebView *)widget())->page(); - connect(((QWebView *)widget()),SIGNAL(loadStarted()),this,SLOT(slotLoadStarted())); - connect(((QWebView *)widget()),SIGNAL(loadFinished(bool)),this,SLOT(slotLoadFinished(bool))); - connect(((QWebView *)widget()),SIGNAL(loadProgress(int)),this,SLOT(slotLoadProgress(int))); - connect(pPage,SIGNAL(linkClicked(const QUrl &)),this,SLOT(slotLinkClicked(const QUrl &))); - connect(pPage,SIGNAL(downloadRequested(const QNetworkRequest &)),this,SLOT(slotDownloadRequest(const QNetworkRequest &))); + QWebPage * pPage = ((QWebView *)widget())->page(); + connect(((QWebView *)widget()), SIGNAL(loadStarted()), this, SLOT(slotLoadStarted())); + connect(((QWebView *)widget()), SIGNAL(loadFinished(bool)), this, SLOT(slotLoadFinished(bool))); + connect(((QWebView *)widget()), SIGNAL(loadProgress(int)), this, SLOT(slotLoadProgress(int))); + connect(pPage, SIGNAL(linkClicked(const QUrl &)), this, SLOT(slotLinkClicked(const QUrl &))); + connect(pPage, SIGNAL(downloadRequested(const QNetworkRequest &)), this, SLOT(slotDownloadRequest(const QNetworkRequest &))); return true; } -int KvsObject_webView::insertElement(const QWebElement &ele) +int KvsObject_webView::insertElement(const QWebElement & ele) { - int eleid=getElementId(ele); - if (!eleid) + int eleid = getElementId(ele); + if(!eleid) { - m_elementMapper[elementMapId]=ele; + m_elementMapper[elementMapId] = ele; return elementMapId++; } - else return eleid; + else + return eleid; } -int KvsObject_webView::getElementId(const QWebElement &ele) +int KvsObject_webView::getElementId(const QWebElement & ele) { - QHashIterator it(m_elementMapper); - while (it.hasNext()) + QHashIterator it(m_elementMapper); + while(it.hasNext()) { - it.next(); - if(it.value()==ele) - return it.key(); + it.next(); + if(it.value() == ele) + return it.key(); } return 0; } @@ -421,80 +423,82 @@ QWebElement KvsObject_webView::getElement(int iIdx) { return m_elementMapper.value(iIdx); } -void KvsObject_webView::getFrames(QWebFrame *pCurFrame, QStringList &szFramesNames) +void KvsObject_webView::getFrames(QWebFrame * pCurFrame, QStringList & szFramesNames) { szFramesNames.append(pCurFrame->title()); QList lFrames = pCurFrame->childFrames(); - for(int i=0; i < lFrames.count(); i++) + for(int i = 0; i < lFrames.count(); i++) { - QWebFrame *pChildFrame = lFrames.at(i); + QWebFrame * pChildFrame = lFrames.at(i); if(pChildFrame->childFrames().count()) - getFrames(pChildFrame,szFramesNames); + getFrames(pChildFrame, szFramesNames); } } -QWebFrame * KvsObject_webView::findFrame(QWebFrame *pCurFrame, QString &szFrameName) +QWebFrame * KvsObject_webView::findFrame(QWebFrame * pCurFrame, QString & szFrameName) { - if(pCurFrame->title()==szFrameName) return pCurFrame; + if(pCurFrame->title() == szFrameName) + return pCurFrame; QList lFrames = pCurFrame->childFrames(); - for(int i=0; i < lFrames.count(); i++) + for(int i = 0; i < lFrames.count(); i++) { - QWebFrame *pChildFrame = lFrames.at(i); + QWebFrame * pChildFrame = lFrames.at(i); if(pChildFrame->childFrames().count()) { - pCurFrame=findFrame(pChildFrame,szFrameName); - if(pCurFrame) return pCurFrame; + pCurFrame = findFrame(pChildFrame, szFrameName); + if(pCurFrame) + return pCurFrame; } } return 0; } -KVSO_CLASS_FUNCTION(webView,setLinkDelegationPolicy) +KVSO_CLASS_FUNCTION(webView, setLinkDelegationPolicy) { CHECK_INTERNAL_POINTER(widget()) QString szPolicy; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("policy",KVS_PT_STRING,0,szPolicy) + KVSO_PARAMETER("policy", KVS_PT_STRING, 0, szPolicy) KVSO_PARAMETERS_END(c) QWebPage::LinkDelegationPolicy policy = QWebPage::DontDelegateLinks; - if(KviQString::equalCI(szPolicy,"DontDelegateLinks")) - policy=QWebPage::DontDelegateLinks; - else if(KviQString::equalCI(szPolicy,"DelegateExternalLinks")) - policy=QWebPage::DelegateExternalLinks; - else if(KviQString::equalCI(szPolicy,"DelegateAllLinks")) - policy=QWebPage::DelegateAllLinks; + if(KviQString::equalCI(szPolicy, "DontDelegateLinks")) + policy = QWebPage::DontDelegateLinks; + else if(KviQString::equalCI(szPolicy, "DelegateExternalLinks")) + policy = QWebPage::DelegateExternalLinks; + else if(KviQString::equalCI(szPolicy, "DelegateAllLinks")) + policy = QWebPage::DelegateAllLinks; else - c->warning(__tr2qs_ctx("Unknown delegation policy '%Q'- Switch do default dontDelegateLinks","objects"),&szPolicy); + c->warning(__tr2qs_ctx("Unknown delegation policy '%Q'- Switch do default dontDelegateLinks", "objects"), &szPolicy); ((QWebView *)widget())->page()->setLinkDelegationPolicy(policy); return true; } -KVSO_CLASS_FUNCTION(webView,load) +KVSO_CLASS_FUNCTION(webView, load) { CHECK_INTERNAL_POINTER(widget()) QString szUrl; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("url",KVS_PT_STRING,0,szUrl) + KVSO_PARAMETER("url", KVS_PT_STRING, 0, szUrl) KVSO_PARAMETERS_END(c) ((QWebView *)widget())->load(QUrl(szUrl)); return true; } -KVSO_CLASS_FUNCTION(webView,setHtml) +KVSO_CLASS_FUNCTION(webView, setHtml) { CHECK_INTERNAL_POINTER(widget()) QString szHtml, szUrlBase; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("szHtml",KVS_PT_STRING,0,szHtml) - KVSO_PARAMETER("urlbase",KVS_PT_STRING,KVS_PF_OPTIONAL,szUrlBase) + KVSO_PARAMETER("szHtml", KVS_PT_STRING, 0, szHtml) + KVSO_PARAMETER("urlbase", KVS_PT_STRING, KVS_PF_OPTIONAL, szUrlBase) KVSO_PARAMETERS_END(c) - ((QWebView *)widget())->setHtml(szHtml,QUrl(szUrlBase)); + ((QWebView *)widget())->setHtml(szHtml, QUrl(szUrlBase)); return true; } -KVSO_CLASS_FUNCTION(webView,makePreview) +KVSO_CLASS_FUNCTION(webView, makePreview) { CHECK_INTERNAL_POINTER(widget()) - QSize size=((QWebView *)widget())->page()->mainFrame()->contentsSize(); - QImage *pImage=new QImage(212,142, QImage::Format_RGB32); - QWebFrame *pFrame=((QWebView *)widget())->page()->mainFrame(); + QSize size = ((QWebView *)widget())->page()->mainFrame()->contentsSize(); + QImage * pImage = new QImage(212, 142, QImage::Format_RGB32); + QWebFrame * pFrame = ((QWebView *)widget())->page()->mainFrame(); QPainter painter(pImage); painter.setRenderHint(QPainter::Antialiasing, true); painter.setRenderHint(QPainter::TextAntialiasing, true); @@ -504,114 +508,116 @@ KVSO_CLASS_FUNCTION(webView,makePreview) if((size.height() * dWScale) < 142) { // solution 1 is to fill the missing bacgkround - painter.fillRect(0,0,212,142,QColor(255,255,255)); + painter.fillRect(0, 0, 212, 142, QColor(255, 255, 255)); // solution 2 is to stretch the contents, but this doesn't work well because // the frame reports a size that doesn't exactly match the document //dHScale = 142.0 / (double)(size.height()); } - painter.scale(dWScale,dHScale); + painter.scale(dWScale, dHScale); pFrame->documentElement().render(&painter); painter.end(); KviKvsObjectClass * pClass = KviKvsKernel::instance()->objectController()->lookupClass("pixmap"); KviKvsVariantList params; - KviKvsObject * pObject = pClass->allocateInstance(0,"internalpixmap",c->context(),¶ms); + KviKvsObject * pObject = pClass->allocateInstance(0, "internalpixmap", c->context(), ¶ms); ((KvsObject_pixmap *)pObject)->setInternalImage(pImage); c->returnValue()->setHObject(pObject->handle()); return true; } -KVSO_CLASS_FUNCTION(webView,findAll) +KVSO_CLASS_FUNCTION(webView, findAll) { CHECK_INTERNAL_POINTER(widget()) QString szQuery; - KviKvsArray *pArray; + KviKvsArray * pArray; kvs_int_t iEleId; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("element_identifier",KVS_PT_INTEGER,0,iEleId) - KVSO_PARAMETER("query",KVS_PT_STRING,0,szQuery) + KVSO_PARAMETER("element_identifier", KVS_PT_INTEGER, 0, iEleId) + KVSO_PARAMETER("query", KVS_PT_STRING, 0, szQuery) KVSO_PARAMETERS_END(c) - QWebElement element=getElement(iEleId); - if (element.isNull()) + QWebElement element = getElement(iEleId); + if(element.isNull()) { - c->warning(__tr2qs_ctx("Document element with ID %d doesn't exist","objects"),iEleId); + c->warning(__tr2qs_ctx("Document element with ID %d doesn't exist", "objects"), iEleId); return true; } - QWebElementCollection elementCollection=element.findAll(szQuery); - if(!elementCollection.count()) return true; + QWebElementCollection elementCollection = element.findAll(szQuery); + if(!elementCollection.count()) + return true; //qDebug("collection %i",elementCollection.count()); - int idx=0; - pArray=new KviKvsArray(); - for(int i=0;iset(idx,new KviKvsVariant((kvs_int_t)id)); + QWebElement element = elementCollection.at(i); + int id = insertElement(element); + pArray->set(idx, new KviKvsVariant((kvs_int_t)id)); idx++; } c->returnValue()->setArray(pArray); return true; } -KVSO_CLASS_FUNCTION(webView,evaluateJavaScript) +KVSO_CLASS_FUNCTION(webView, evaluateJavaScript) { CHECK_INTERNAL_POINTER(widget()) QString szScript; kvs_int_t iEleId; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("element_identifier",KVS_PT_INTEGER,0,iEleId) - KVSO_PARAMETER("script_code",KVS_PT_STRING,0,szScript) + KVSO_PARAMETER("element_identifier", KVS_PT_INTEGER, 0, iEleId) + KVSO_PARAMETER("script_code", KVS_PT_STRING, 0, szScript) KVSO_PARAMETERS_END(c) - QWebElement element=getElement(iEleId); - if (element.isNull()) + QWebElement element = getElement(iEleId); + if(element.isNull()) { - c->warning(__tr2qs_ctx("Document element is null: you must call getDocumentElement first","objects")); + c->warning(__tr2qs_ctx("Document element is null: you must call getDocumentElement first", "objects")); return true; } - QVariant vRes=element.evaluateJavaScript(szScript); - if(vRes.type()==QVariant::String) + QVariant vRes = element.evaluateJavaScript(szScript); + if(vRes.type() == QVariant::String) { - QString szVal=vRes.toString(); + QString szVal = vRes.toString(); c->returnValue()->setString(szVal); } - else c->warning(__tr2qs_ctx("Unsupported datatype","objects")); + else + c->warning(__tr2qs_ctx("Unsupported datatype", "objects")); return true; } -KVSO_CLASS_FUNCTION(webView,findFirst) +KVSO_CLASS_FUNCTION(webView, findFirst) { QString szQuery; kvs_int_t iEleId; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("element_identifier",KVS_PT_INTEGER,0,iEleId) - KVSO_PARAMETER("query",KVS_PT_STRING,0,szQuery) + KVSO_PARAMETER("element_identifier", KVS_PT_INTEGER, 0, iEleId) + KVSO_PARAMETER("query", KVS_PT_STRING, 0, szQuery) KVSO_PARAMETERS_END(c) - QWebElement element=getElement(iEleId); - if (element.isNull()) + QWebElement element = getElement(iEleId); + if(element.isNull()) { - c->warning(__tr2qs_ctx("Document element with ID %d doesn't exist","objects"),iEleId); + c->warning(__tr2qs_ctx("Document element with ID %d doesn't exist", "objects"), iEleId); return true; } - QWebElement tempElement=element.findFirst(szQuery); - if (tempElement.isNull()) + QWebElement tempElement = element.findFirst(szQuery); + if(tempElement.isNull()) { c->returnValue()->setInteger(-1); return true; } - int id=insertElement(tempElement); - c->returnValue()->setInteger((kvs_int_t) id); + int id = insertElement(tempElement); + c->returnValue()->setInteger((kvs_int_t)id); return true; } -KVSO_CLASS_FUNCTION(webView,removeFromDocument) +KVSO_CLASS_FUNCTION(webView, removeFromDocument) { kvs_int_t iEleId; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("element_identifier",KVS_PT_INTEGER,0,iEleId) + KVSO_PARAMETER("element_identifier", KVS_PT_INTEGER, 0, iEleId) KVSO_PARAMETERS_END(c) - QWebElement element=getElement(iEleId); - if (element.isNull()) + QWebElement element = getElement(iEleId); + if(element.isNull()) { - c->warning(__tr2qs_ctx("Document element with ID %d doesn't exist","objects"),iEleId); + c->warning(__tr2qs_ctx("Document element with ID %d doesn't exist", "objects"), iEleId); return true; } element.removeFromDocument(); @@ -635,227 +641,225 @@ KVSO_CLASS_FUNCTION(webView,removeFromDocument) return true; } */ -KVSO_CLASS_FUNCTION(webView,appendInside) +KVSO_CLASS_FUNCTION(webView, appendInside) { kvs_int_t iEleId; QString szCode; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("element_identifier",KVS_PT_INTEGER,0,iEleId) - KVSO_PARAMETER("name",KVS_PT_NONEMPTYSTRING,0,szCode) + KVSO_PARAMETER("element_identifier", KVS_PT_INTEGER, 0, iEleId) + KVSO_PARAMETER("name", KVS_PT_NONEMPTYSTRING, 0, szCode) KVSO_PARAMETERS_END(c) - QWebElement element=getElement(iEleId); - if (element.isNull()) + QWebElement element = getElement(iEleId); + if(element.isNull()) { - c->warning(__tr2qs_ctx("Document element with ID %d doesn't exist","objects"),iEleId); + c->warning(__tr2qs_ctx("Document element with ID %d doesn't exist", "objects"), iEleId); return true; } element.appendInside(szCode); return true; } -KVSO_CLASS_FUNCTION(webView,appendOutside) +KVSO_CLASS_FUNCTION(webView, appendOutside) { kvs_int_t iEleId; QString szCode; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("element_identifier",KVS_PT_INTEGER,0,iEleId) - KVSO_PARAMETER("name",KVS_PT_NONEMPTYSTRING,0,szCode) + KVSO_PARAMETER("element_identifier", KVS_PT_INTEGER, 0, iEleId) + KVSO_PARAMETER("name", KVS_PT_NONEMPTYSTRING, 0, szCode) KVSO_PARAMETERS_END(c) - QWebElement element=getElement(iEleId); - if (element.isNull()) + QWebElement element = getElement(iEleId); + if(element.isNull()) { - c->warning(__tr2qs_ctx("Document element with ID %d doesn't exist","objects"),iEleId); + c->warning(__tr2qs_ctx("Document element with ID %d doesn't exist", "objects"), iEleId); return true; } element.appendOutside(szCode); return true; } -KVSO_CLASS_FUNCTION(webView,nextSibling) +KVSO_CLASS_FUNCTION(webView, nextSibling) { CHECK_INTERNAL_POINTER(widget()) kvs_int_t iEleId; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("element_identifier",KVS_PT_INTEGER,0,iEleId) + KVSO_PARAMETER("element_identifier", KVS_PT_INTEGER, 0, iEleId) KVSO_PARAMETERS_END(c) - QWebElement element=getElement(iEleId); - if (element.isNull()) + QWebElement element = getElement(iEleId); + if(element.isNull()) { - c->warning(__tr2qs_ctx("Document element with ID %d doesn't exist","objects"),iEleId); + c->warning(__tr2qs_ctx("Document element with ID %d doesn't exist", "objects"), iEleId); return true; } - QWebElement tempElement=element.nextSibling(); - if (tempElement.isNull()) + QWebElement tempElement = element.nextSibling(); + if(tempElement.isNull()) { c->returnValue()->setInteger(-1); return true; } - int id=insertElement(tempElement); - c->returnValue()->setInteger((kvs_int_t) id); + int id = insertElement(tempElement); + c->returnValue()->setInteger((kvs_int_t)id); return true; } - -KVSO_CLASS_FUNCTION(webView,frames) +KVSO_CLASS_FUNCTION(webView, frames) { CHECK_INTERNAL_POINTER(widget()) - QWebFrame *pFrame=((QWebView *)widget())->page()->mainFrame(); + QWebFrame * pFrame = ((QWebView *)widget())->page()->mainFrame(); QStringList szFramesNames; - getFrames(pFrame,szFramesNames); - KviKvsArray *pArray=new KviKvsArray(); + getFrames(pFrame, szFramesNames); + KviKvsArray * pArray = new KviKvsArray(); c->returnValue()->setArray(pArray); return true; } -KVSO_CLASS_FUNCTION(webView,elementTagName) +KVSO_CLASS_FUNCTION(webView, elementTagName) { CHECK_INTERNAL_POINTER(widget()) kvs_int_t iEleId; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("element_identifier",KVS_PT_INTEGER,0,iEleId) + KVSO_PARAMETER("element_identifier", KVS_PT_INTEGER, 0, iEleId) KVSO_PARAMETERS_END(c) - QWebElement element=getElement(iEleId); - if (element.isNull()) + QWebElement element = getElement(iEleId); + if(element.isNull()) { - // qDebug("isnull ad index %i",iEleId); - c->warning(__tr2qs_ctx("Document element with ID %d doesn't exist","objects"),iEleId); + // qDebug("isnull ad index %i",iEleId); + c->warning(__tr2qs_ctx("Document element with ID %d doesn't exist", "objects"), iEleId); return true; } c->returnValue()->setString(element.tagName()); return true; } -KVSO_CLASS_FUNCTION(webView,setElementAttribute) +KVSO_CLASS_FUNCTION(webView, setElementAttribute) { CHECK_INTERNAL_POINTER(widget()) - QString szName,szValue; + QString szName, szValue; kvs_int_t iEleId; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("element_identifier",KVS_PT_INTEGER,0,iEleId) - KVSO_PARAMETER("name",KVS_PT_NONEMPTYSTRING,0,szName) - KVSO_PARAMETER("value",KVS_PT_STRING,0,szValue) + KVSO_PARAMETER("element_identifier", KVS_PT_INTEGER, 0, iEleId) + KVSO_PARAMETER("name", KVS_PT_NONEMPTYSTRING, 0, szName) + KVSO_PARAMETER("value", KVS_PT_STRING, 0, szValue) KVSO_PARAMETERS_END(c) - QWebElement element=getElement(iEleId); - if (element.isNull()) + QWebElement element = getElement(iEleId); + if(element.isNull()) { - c->warning(__tr2qs_ctx("Document element with ID %d doesn't exist","objects"),iEleId); + c->warning(__tr2qs_ctx("Document element with ID %d doesn't exist", "objects"), iEleId); return true; } - element.setAttribute(szName,szValue); + element.setAttribute(szName, szValue); return true; } -KVSO_CLASS_FUNCTION(webView,removeClass) +KVSO_CLASS_FUNCTION(webView, removeClass) { CHECK_INTERNAL_POINTER(widget()) QString szClassName; kvs_int_t iEleId; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("element_identifier",KVS_PT_INTEGER,0,iEleId) - KVSO_PARAMETER("class_name",KVS_PT_NONEMPTYSTRING,0,szClassName) + KVSO_PARAMETER("element_identifier", KVS_PT_INTEGER, 0, iEleId) + KVSO_PARAMETER("class_name", KVS_PT_NONEMPTYSTRING, 0, szClassName) KVSO_PARAMETERS_END(c) - QWebElement element=getElement(iEleId); - if (element.isNull()) + QWebElement element = getElement(iEleId); + if(element.isNull()) { - c->warning(__tr2qs_ctx("Document element with ID %d doesn't exist","objects"),iEleId); + c->warning(__tr2qs_ctx("Document element with ID %d doesn't exist", "objects"), iEleId); return true; } element.removeClass(szClassName); return true; } -KVSO_CLASS_FUNCTION(webView,addClass) +KVSO_CLASS_FUNCTION(webView, addClass) { CHECK_INTERNAL_POINTER(widget()) QString szClassName; kvs_int_t iEleId; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("element_identifier",KVS_PT_INTEGER,0,iEleId) - KVSO_PARAMETER("class_name",KVS_PT_NONEMPTYSTRING,0,szClassName) + KVSO_PARAMETER("element_identifier", KVS_PT_INTEGER, 0, iEleId) + KVSO_PARAMETER("class_name", KVS_PT_NONEMPTYSTRING, 0, szClassName) KVSO_PARAMETERS_END(c) - QWebElement element=getElement(iEleId); - if (element.isNull()) + QWebElement element = getElement(iEleId); + if(element.isNull()) { - c->warning(__tr2qs_ctx("Document element with ID %d doesn't exist","objects"),iEleId); + c->warning(__tr2qs_ctx("Document element with ID %d doesn't exist", "objects"), iEleId); return true; } element.addClass(szClassName); return true; } -KVSO_CLASS_FUNCTION(webView,setWebSetting) +KVSO_CLASS_FUNCTION(webView, setWebSetting) { CHECK_INTERNAL_POINTER(widget()) QString szName; bool bEnabled; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("name",KVS_PT_NONEMPTYSTRING,0,szName) - KVSO_PARAMETER("value",KVS_PT_BOOLEAN,0,bEnabled) + KVSO_PARAMETER("name", KVS_PT_NONEMPTYSTRING, 0, szName) + KVSO_PARAMETER("value", KVS_PT_BOOLEAN, 0, bEnabled) KVSO_PARAMETERS_END(c) - bool found=false; + bool found = false; unsigned int j = 0; for(; j < webattributes_num; j++) { - if(KviQString::equalCI(szName,webattributes_tbl[j])) + if(KviQString::equalCI(szName, webattributes_tbl[j])) { - found=true; + found = true; break; } } - if (found) - ((QWebView *)widget())->settings()->setAttribute(webattributes_cod[j],bEnabled); + if(found) + ((QWebView *)widget())->settings()->setAttribute(webattributes_cod[j], bEnabled); else - c->warning(__tr2qs_ctx("Unknown web setting '%Q'","objects"),&szName); + c->warning(__tr2qs_ctx("Unknown web setting '%Q'", "objects"), &szName); return true; } -KVSO_CLASS_FUNCTION(webView,findText) +KVSO_CLASS_FUNCTION(webView, findText) { CHECK_INTERNAL_POINTER(widget()) QString szName; QStringList szFindFlag; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("find_text",KVS_PT_NONEMPTYSTRING,0,szName) - KVSO_PARAMETER("find_flag",KVS_PT_STRINGLIST,KVS_PF_OPTIONAL,szFindFlag) + KVSO_PARAMETER("find_text", KVS_PT_NONEMPTYSTRING, 0, szName) + KVSO_PARAMETER("find_flag", KVS_PT_STRINGLIST, KVS_PF_OPTIONAL, szFindFlag) KVSO_PARAMETERS_END(c) - int findflag=0; - int sum=0; - for ( QStringList::Iterator it = szFindFlag.begin(); it != szFindFlag.end(); ++it ) + int findflag = 0; + int sum = 0; + for(QStringList::Iterator it = szFindFlag.begin(); it != szFindFlag.end(); ++it) { findflag = 0; for(unsigned int j = 0; j < findflag_num; j++) { if(KviQString::equalCI((*it), findflag_tbl[j])) { - findflag=findflag_cod[j]; + findflag = findflag_cod[j]; break; } } if(findflag) sum = sum | findflag; else - c->warning(__tr2qs_ctx("Unknown findflag '%Q'","objects"),&(*it)); - + c->warning(__tr2qs_ctx("Unknown findflag '%Q'", "objects"), &(*it)); } - ((QWebView *)widget())->findText(szName,(QWebPage::FindFlags)findflag); + ((QWebView *)widget())->findText(szName, (QWebPage::FindFlags)findflag); return true; } -KVSO_CLASS_FUNCTION(webView,elementAttribute) +KVSO_CLASS_FUNCTION(webView, elementAttribute) { CHECK_INTERNAL_POINTER(widget()) QString szName; kvs_int_t iEleId; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("element_identifier",KVS_PT_INTEGER,0,iEleId) - KVSO_PARAMETER("name",KVS_PT_NONEMPTYSTRING,0,szName) + KVSO_PARAMETER("element_identifier", KVS_PT_INTEGER, 0, iEleId) + KVSO_PARAMETER("name", KVS_PT_NONEMPTYSTRING, 0, szName) KVSO_PARAMETERS_END(c) - QWebElement element=getElement(iEleId); - if (element.isNull()) + QWebElement element = getElement(iEleId); + if(element.isNull()) { - c->warning(__tr2qs_ctx("Document element with ID %d doesn't exist","objects"),iEleId); + c->warning(__tr2qs_ctx("Document element with ID %d doesn't exist", "objects"), iEleId); return true; } // workaround for this issue: https://bugreports.qt.nokia.com//browse/QTWEBKIT-88 - if(KviQString::equalCI(element.tagName(),"input")) + if(KviQString::equalCI(element.tagName(), "input")) { - QVariant value=element.evaluateJavaScript("this."+szName); + QVariant value = element.evaluateJavaScript("this." + szName); c->returnValue()->setString(value.toString()); return true; } @@ -863,405 +867,407 @@ KVSO_CLASS_FUNCTION(webView,elementAttribute) return true; } -KVSO_CLASS_FUNCTION(webView,elementAttributeNames) +KVSO_CLASS_FUNCTION(webView, elementAttributeNames) { CHECK_INTERNAL_POINTER(widget()) kvs_int_t iEleId; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("identifier",KVS_PT_INTEGER,0,iEleId) + KVSO_PARAMETER("identifier", KVS_PT_INTEGER, 0, iEleId) KVSO_PARAMETERS_END(c) QString szAttributeNames; - QWebElement element=getElement(iEleId); - if (element.isNull()) + QWebElement element = getElement(iEleId); + if(element.isNull()) { - c->warning(__tr2qs_ctx("Document element with ID %d doesn't exist","objects"),iEleId); + c->warning(__tr2qs_ctx("Document element with ID %d doesn't exist", "objects"), iEleId); return true; } - szAttributeNames=element.attributeNames().join(","); + szAttributeNames = element.attributeNames().join(","); c->returnValue()->setString(szAttributeNames); return true; } -KVSO_CLASS_FUNCTION(webView,classes) +KVSO_CLASS_FUNCTION(webView, classes) { CHECK_INTERNAL_POINTER(widget()) kvs_int_t iEleId; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("identifier",KVS_PT_INTEGER,0,iEleId) + KVSO_PARAMETER("identifier", KVS_PT_INTEGER, 0, iEleId) KVSO_PARAMETERS_END(c) - QWebElement element=getElement(iEleId); - if (element.isNull()) + QWebElement element = getElement(iEleId); + if(element.isNull()) { - c->warning(__tr2qs_ctx("Document element with ID %d doesn't exist","objects"),iEleId); + c->warning(__tr2qs_ctx("Document element with ID %d doesn't exist", "objects"), iEleId); return true; } QString szClasses; - szClasses=element.classes().join(","); + szClasses = element.classes().join(","); c->returnValue()->setString(szClasses); return true; } -KVSO_CLASS_FUNCTION(webView,toPlainText) +KVSO_CLASS_FUNCTION(webView, toPlainText) { CHECK_INTERNAL_POINTER(widget()) kvs_int_t iEleId; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("identifier",KVS_PT_INTEGER,0,iEleId) + KVSO_PARAMETER("identifier", KVS_PT_INTEGER, 0, iEleId) KVSO_PARAMETERS_END(c) - QWebElement element=getElement(iEleId); - if (element.isNull()) + QWebElement element = getElement(iEleId); + if(element.isNull()) { - c->warning(__tr2qs_ctx("Document element with ID %d doesn't exist","objects"),iEleId); + c->warning(__tr2qs_ctx("Document element with ID %d doesn't exist", "objects"), iEleId); return true; } c->returnValue()->setString(element.toPlainText()); return true; } -KVSO_CLASS_FUNCTION(webView,setPlainText) +KVSO_CLASS_FUNCTION(webView, setPlainText) { CHECK_INTERNAL_POINTER(widget()) QString szText; kvs_int_t iEleId; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("identifier",KVS_PT_INTEGER,0,iEleId) - KVSO_PARAMETER("plaintext",KVS_PT_STRING,0,szText) + KVSO_PARAMETER("identifier", KVS_PT_INTEGER, 0, iEleId) + KVSO_PARAMETER("plaintext", KVS_PT_STRING, 0, szText) KVSO_PARAMETERS_END(c) - QWebElement element=getElement(iEleId); - if (element.isNull()) + QWebElement element = getElement(iEleId); + if(element.isNull()) { - c->warning(__tr2qs_ctx("Document element with ID %d doesn't exist","objects"),iEleId); + c->warning(__tr2qs_ctx("Document element with ID %d doesn't exist", "objects"), iEleId); return true; } element.setPlainText(szText); return true; } - -KVSO_CLASS_FUNCTION(webView,firstChild) +KVSO_CLASS_FUNCTION(webView, firstChild) { CHECK_INTERNAL_POINTER(widget()) kvs_int_t iEleId; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("identifier",KVS_PT_INTEGER,0,iEleId) + KVSO_PARAMETER("identifier", KVS_PT_INTEGER, 0, iEleId) KVSO_PARAMETERS_END(c) - QWebElement element=getElement(iEleId); - if (element.isNull()) + QWebElement element = getElement(iEleId); + if(element.isNull()) { - c->warning(__tr2qs_ctx("Document element with ID %d doesn't exist","objects"),iEleId); + c->warning(__tr2qs_ctx("Document element with ID %d doesn't exist", "objects"), iEleId); return true; } - QWebElement tempElement=element.firstChild(); - if (tempElement.isNull()) + QWebElement tempElement = element.firstChild(); + if(tempElement.isNull()) { c->returnValue()->setInteger(-1); return true; } - int id=insertElement(tempElement); - c->returnValue()->setInteger((kvs_int_t) id); + int id = insertElement(tempElement); + c->returnValue()->setInteger((kvs_int_t)id); return true; } -KVSO_CLASS_FUNCTION(webView,lastChild) +KVSO_CLASS_FUNCTION(webView, lastChild) { CHECK_INTERNAL_POINTER(widget()) kvs_int_t iEleId; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("identifier",KVS_PT_INTEGER,0,iEleId) + KVSO_PARAMETER("identifier", KVS_PT_INTEGER, 0, iEleId) KVSO_PARAMETERS_END(c) - QWebElement element=getElement(iEleId); - if (element.isNull()) + QWebElement element = getElement(iEleId); + if(element.isNull()) { - c->warning(__tr2qs_ctx("Document element with ID %d doesn't exist","objects"),iEleId); + c->warning(__tr2qs_ctx("Document element with ID %d doesn't exist", "objects"), iEleId); return true; } - QWebElement tempElement=element.lastChild(); - if (tempElement.isNull()) + QWebElement tempElement = element.lastChild(); + if(tempElement.isNull()) { c->returnValue()->setInteger(-1); return true; } - int id=insertElement(tempElement); - c->returnValue()->setInteger((kvs_int_t) id); + int id = insertElement(tempElement); + c->returnValue()->setInteger((kvs_int_t)id); return true; } -KVSO_CLASS_FUNCTION(webView,parentElement) +KVSO_CLASS_FUNCTION(webView, parentElement) { CHECK_INTERNAL_POINTER(widget()) kvs_int_t iEleId; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("identifier",KVS_PT_INTEGER,0,iEleId) + KVSO_PARAMETER("identifier", KVS_PT_INTEGER, 0, iEleId) KVSO_PARAMETERS_END(c) - QWebElement element=getElement(iEleId); - if (element.isNull()) + QWebElement element = getElement(iEleId); + if(element.isNull()) { - c->warning(__tr2qs_ctx("Document element with ID %d doesn't exist","objects"),iEleId); + c->warning(__tr2qs_ctx("Document element with ID %d doesn't exist", "objects"), iEleId); return true; } - QWebElement tempElement=element.parent(); - if (tempElement.isNull()) + QWebElement tempElement = element.parent(); + if(tempElement.isNull()) { c->returnValue()->setInteger(-1); return true; } - int id=insertElement(tempElement); - c->returnValue()->setInteger((kvs_int_t) id); + int id = insertElement(tempElement); + c->returnValue()->setInteger((kvs_int_t)id); return true; } - -KVSO_CLASS_FUNCTION(webView,styleProperty) +KVSO_CLASS_FUNCTION(webView, styleProperty) { CHECK_INTERNAL_POINTER(widget()) - QString szName,szStyleResolveStrategy; + QString szName, szStyleResolveStrategy; kvs_int_t iEleId; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("identifier",KVS_PT_INTEGER,0,iEleId) - KVSO_PARAMETER("name",KVS_PT_NONEMPTYSTRING,0,szName) - KVSO_PARAMETER("style_resolve_strategy",KVS_PT_STRING,KVS_PF_OPTIONAL,szStyleResolveStrategy) + KVSO_PARAMETER("identifier", KVS_PT_INTEGER, 0, iEleId) + KVSO_PARAMETER("name", KVS_PT_NONEMPTYSTRING, 0, szName) + KVSO_PARAMETER("style_resolve_strategy", KVS_PT_STRING, KVS_PF_OPTIONAL, szStyleResolveStrategy) KVSO_PARAMETERS_END(c) - QWebElement element=getElement(iEleId); - if (element.isNull()) + QWebElement element = getElement(iEleId); + if(element.isNull()) { - c->warning(__tr2qs_ctx("Document element with ID %d doesn't exist","objects"),iEleId); + c->warning(__tr2qs_ctx("Document element with ID %d doesn't exist", "objects"), iEleId); return true; } - QWebElement::StyleResolveStrategy styleStrategy=QWebElement::CascadedStyle; + QWebElement::StyleResolveStrategy styleStrategy = QWebElement::CascadedStyle; if(!szStyleResolveStrategy.isEmpty()) { - if(KviQString::equalCI(szStyleResolveStrategy, "InlineStyle")) styleStrategy=QWebElement::InlineStyle; - else if(KviQString::equalCI(szStyleResolveStrategy, "CascadedStyle")) styleStrategy=QWebElement::CascadedStyle; - else if(KviQString::equalCI(szStyleResolveStrategy, "ComputedStyle")) styleStrategy=QWebElement::ComputedStyle; + if(KviQString::equalCI(szStyleResolveStrategy, "InlineStyle")) + styleStrategy = QWebElement::InlineStyle; + else if(KviQString::equalCI(szStyleResolveStrategy, "CascadedStyle")) + styleStrategy = QWebElement::CascadedStyle; + else if(KviQString::equalCI(szStyleResolveStrategy, "ComputedStyle")) + styleStrategy = QWebElement::ComputedStyle; else { - c->warning(__tr2qs_ctx("Unknown styleResolveStrategy: '%Q' - Switching to default CascadedStyle strategy","objects"),&szStyleResolveStrategy); + c->warning(__tr2qs_ctx("Unknown styleResolveStrategy: '%Q' - Switching to default CascadedStyle strategy", "objects"), &szStyleResolveStrategy); } } c->returnValue()->setString(element.styleProperty(szName, styleStrategy)); return true; } -KVSO_CLASS_FUNCTION(webView,setStyleProperty) +KVSO_CLASS_FUNCTION(webView, setStyleProperty) { CHECK_INTERNAL_POINTER(widget()) - QString szProperty,szValue; + QString szProperty, szValue; kvs_int_t iEleId; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("identifier",KVS_PT_INTEGER,0,iEleId) - KVSO_PARAMETER("property",KVS_PT_STRING,0,szProperty) - KVSO_PARAMETER("value",KVS_PT_STRING,0,szValue) + KVSO_PARAMETER("identifier", KVS_PT_INTEGER, 0, iEleId) + KVSO_PARAMETER("property", KVS_PT_STRING, 0, szProperty) + KVSO_PARAMETER("value", KVS_PT_STRING, 0, szValue) KVSO_PARAMETERS_END(c) - QWebElement element=getElement(iEleId); - if (element.isNull()) + QWebElement element = getElement(iEleId); + if(element.isNull()) { - c->warning(__tr2qs_ctx("Document element with ID %d doesn't exist","objects"),iEleId); + c->warning(__tr2qs_ctx("Document element with ID %d doesn't exist", "objects"), iEleId); return true; } - element.setStyleProperty(szProperty,szValue); + element.setStyleProperty(szProperty, szValue); return true; } -KVSO_CLASS_FUNCTION(webView,getDocumentElement) +KVSO_CLASS_FUNCTION(webView, getDocumentElement) { CHECK_INTERNAL_POINTER(widget()) QString szFrameName; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("frame_name",KVS_PT_STRING,KVS_PF_OPTIONAL,szFrameName) + KVSO_PARAMETER("frame_name", KVS_PT_STRING, KVS_PF_OPTIONAL, szFrameName) KVSO_PARAMETERS_END(c) - QWebFrame *pFrame; - pFrame=((QWebView *)widget())->page()->mainFrame(); + QWebFrame * pFrame; + pFrame = ((QWebView *)widget())->page()->mainFrame(); if(!szFrameName.isEmpty()) { - pFrame=findFrame(pFrame,szFrameName); + pFrame = findFrame(pFrame, szFrameName); if(!pFrame) { - c->warning(__tr2qs_ctx("Unknown frame '%Q'","objects"),&szFrameName); + c->warning(__tr2qs_ctx("Unknown frame '%Q'", "objects"), &szFrameName); return true; } } - int id=insertElement(pFrame->documentElement()); - c->returnValue()->setInteger((kvs_int_t) id); + int id = insertElement(pFrame->documentElement()); + c->returnValue()->setInteger((kvs_int_t)id); return true; } -KVSO_CLASS_FUNCTION(webView,addToJavaScriptWindowObject) +KVSO_CLASS_FUNCTION(webView, addToJavaScriptWindowObject) { CHECK_INTERNAL_POINTER(widget()) QString szFrameName, szObjectName; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("object_name",KVS_PT_NONEMPTYSTRING,0,szObjectName) - KVSO_PARAMETER("frame_name",KVS_PT_STRING,KVS_PF_OPTIONAL,szFrameName) + KVSO_PARAMETER("object_name", KVS_PT_NONEMPTYSTRING, 0, szObjectName) + KVSO_PARAMETER("frame_name", KVS_PT_STRING, KVS_PF_OPTIONAL, szFrameName) KVSO_PARAMETERS_END(c) - QWebFrame *pFrame; - pFrame=((QWebView *)widget())->page()->mainFrame(); + QWebFrame * pFrame; + pFrame = ((QWebView *)widget())->page()->mainFrame(); if(!szFrameName.isEmpty()) { - pFrame=findFrame(pFrame,szFrameName); + pFrame = findFrame(pFrame, szFrameName); if(!pFrame) { - c->warning(__tr2qs_ctx("Unknown frame '%Q'","objects"),&szFrameName); + c->warning(__tr2qs_ctx("Unknown frame '%Q'", "objects"), &szFrameName); return true; } } - pFrame->addToJavaScriptWindowObject(szObjectName,this); + pFrame->addToJavaScriptWindowObject(szObjectName, this); return true; } -KVSO_CLASS_FUNCTION(webView,setEventFilter) +KVSO_CLASS_FUNCTION(webView, setEventFilter) { Q_UNUSED(c); - QWebFrame *pFrame; - pFrame=((QWebView *)widget())->page()->mainFrame(); - pFrame->addToJavaScriptWindowObject("kvs",this); + QWebFrame * pFrame; + pFrame = ((QWebView *)widget())->page()->mainFrame(); + pFrame->addToJavaScriptWindowObject("kvs", this); return true; } -KVSO_CLASS_FUNCTION(webView,hitTestContent) +KVSO_CLASS_FUNCTION(webView, hitTestContent) { CHECK_INTERNAL_POINTER(widget()) - kvs_int_t iYPos,iXPos; + kvs_int_t iYPos, iXPos; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("x_pos",KVS_PT_INT,0,iXPos) - KVSO_PARAMETER("y_pos",KVS_PT_INT,0,iYPos) + KVSO_PARAMETER("x_pos", KVS_PT_INT, 0, iXPos) + KVSO_PARAMETER("y_pos", KVS_PT_INT, 0, iYPos) KVSO_PARAMETERS_END(c) - QWebFrame *pFrame; - pFrame=((QWebView *)widget())->page()->mainFrame(); - QWebHitTestResult res=pFrame->hitTestContent(QPoint(iXPos,iYPos)); - if(res.isNull()) return true; - KviKvsHash *pHash=new KviKvsHash(); - pHash->set("imageurl",new KviKvsVariant(res.imageUrl().toString())); - pHash->set("linktitle",new KviKvsVariant(res.linkTitle().toString())); - pHash->set("linktext",new KviKvsVariant(res.linkText())); - pHash->set("linkelement",new KviKvsVariant((kvs_int_t)insertElement(res.linkElement()))); - pHash->set("enclosingelement",new KviKvsVariant((kvs_int_t)insertElement(res.enclosingBlockElement()))); - pHash->set("element",new KviKvsVariant((kvs_int_t)insertElement(res.element()))); + QWebFrame * pFrame; + pFrame = ((QWebView *)widget())->page()->mainFrame(); + QWebHitTestResult res = pFrame->hitTestContent(QPoint(iXPos, iYPos)); + if(res.isNull()) + return true; + KviKvsHash * pHash = new KviKvsHash(); + pHash->set("imageurl", new KviKvsVariant(res.imageUrl().toString())); + pHash->set("linktitle", new KviKvsVariant(res.linkTitle().toString())); + pHash->set("linktext", new KviKvsVariant(res.linkText())); + pHash->set("linkelement", new KviKvsVariant((kvs_int_t)insertElement(res.linkElement()))); + pHash->set("enclosingelement", new KviKvsVariant((kvs_int_t)insertElement(res.enclosingBlockElement()))); + pHash->set("element", new KviKvsVariant((kvs_int_t)insertElement(res.element()))); c->returnValue()->setHash(pHash); return true; } -KVSO_CLASS_FUNCTION(webView,appendWebViewActionToMenu) +KVSO_CLASS_FUNCTION(webView, appendWebViewActionToMenu) { CHECK_INTERNAL_POINTER(widget()) - KviKvsObject *ob; + KviKvsObject * ob; kvs_hobject_t hObject; - QString szActionName,szIcon; + QString szActionName, szIcon; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("popup",KVS_PT_HOBJECT,0,hObject) - KVSO_PARAMETER("action_name",KVS_PT_NONEMPTYSTRING,0,szActionName) - KVSO_PARAMETER("icon",KVS_PT_STRING,KVS_PF_OPTIONAL,szIcon) + KVSO_PARAMETER("popup", KVS_PT_HOBJECT, 0, hObject) + KVSO_PARAMETER("action_name", KVS_PT_NONEMPTYSTRING, 0, szActionName) + KVSO_PARAMETER("icon", KVS_PT_STRING, KVS_PF_OPTIONAL, szIcon) KVSO_PARAMETERS_END(c) - ob=KviKvsKernel::instance()->objectController()->lookupObject(hObject); - if (!ob) + ob = KviKvsKernel::instance()->objectController()->lookupObject(hObject); + if(!ob) { - c->warning(__tr2qs_ctx("Widget parameter is not an object","objects")); + c->warning(__tr2qs_ctx("Widget parameter is not an object", "objects")); return true; } - if (!ob->object()) + if(!ob->object()) { - c->warning(__tr2qs_ctx("Widget parameter is not a valid object","objects")); + c->warning(__tr2qs_ctx("Widget parameter is not a valid object", "objects")); return true; } if(!ob->inheritsClass("popupmenu")) { - c->warning(__tr2qs_ctx("Can't add a non-popupmenu object","objects")); + c->warning(__tr2qs_ctx("Can't add a non-popupmenu object", "objects")); return true; } - QAction *pAction=0; + QAction * pAction = 0; for(unsigned int i = 0; i < actions_num; i++) { if(KviQString::equalCI(szActionName, actions_tbl[i])) { - pAction=((QWebView *)widget())->pageAction(actions_cod[i]); + pAction = ((QWebView *)widget())->pageAction(actions_cod[i]); break; } } if(!pAction) { - c->warning(__tr2qs_ctx("Unknown action '%Q':","objects"),&szActionName); + c->warning(__tr2qs_ctx("Unknown action '%Q':", "objects"), &szActionName); return true; } if(!szIcon.isEmpty()) { - QPixmap *pix; + QPixmap * pix; pix = g_pIconManager->getImage(szIcon); - if (pix) pAction->setIcon(*pix); - else c->warning(__tr2qs_ctx("Icon '%Q' doesn't exist","objects"),&szIcon); + if(pix) + pAction->setIcon(*pix); + else + c->warning(__tr2qs_ctx("Icon '%Q' doesn't exist", "objects"), &szIcon); } - ((QMenu *)(ob->object()))->addAction(pAction); + ((QMenu *)(ob->object()))->addAction(pAction); return true; } - -KVSO_CLASS_FUNCTION(webView,loadFinishedEvent) +KVSO_CLASS_FUNCTION(webView, loadFinishedEvent) { - emitSignal("loadFinished",c,c->params()); + emitSignal("loadFinished", c, c->params()); return true; } -KVSO_CLASS_FUNCTION(webView,loadProgressEvent) +KVSO_CLASS_FUNCTION(webView, loadProgressEvent) { - emitSignal("loadProgress",c,c->params()); + emitSignal("loadProgress", c, c->params()); return true; } -KVSO_CLASS_FUNCTION(webView,loadStartedEvent) +KVSO_CLASS_FUNCTION(webView, loadStartedEvent) { - emitSignal("loadStarted",c); + emitSignal("loadStarted", c); return true; } -KVSO_CLASS_FUNCTION(webView,downloadCompletedEvent) +KVSO_CLASS_FUNCTION(webView, downloadCompletedEvent) { - emitSignal("downloadCompleted",c,c->params()); + emitSignal("downloadCompleted", c, c->params()); return true; } -KVSO_CLASS_FUNCTION(webView,downloadProgressEvent) +KVSO_CLASS_FUNCTION(webView, downloadProgressEvent) { - emitSignal("downloadProgress",c,c->params()); + emitSignal("downloadProgress", c, c->params()); return true; } -KVSO_CLASS_FUNCTION(webView,linkClickedEvent) +KVSO_CLASS_FUNCTION(webView, linkClickedEvent) { - emitSignal("linkClicked",c,c->params()); + emitSignal("linkClicked", c, c->params()); return true; } -KVSO_CLASS_FUNCTION(webView,downloadRequestEvent) +KVSO_CLASS_FUNCTION(webView, downloadRequestEvent) { - emitSignal("downloadRequest",c,c->params()); + emitSignal("downloadRequest", c, c->params()); return true; } - -KVSO_CLASS_FUNCTION(webView,jsSubmitEvent) +KVSO_CLASS_FUNCTION(webView, jsSubmitEvent) { - emitSignal("jssubmit",c,c->params()); + emitSignal("jssubmit", c, c->params()); return true; } -KVSO_CLASS_FUNCTION(webView,jsChangeEvent) +KVSO_CLASS_FUNCTION(webView, jsChangeEvent) { - emitSignal("jschange",c,c->params()); + emitSignal("jschange", c, c->params()); return true; } -KVSO_CLASS_FUNCTION(webView,jsClickEvent) +KVSO_CLASS_FUNCTION(webView, jsClickEvent) { - emitSignal("jsclick",c,c->params()); + emitSignal("jsclick", c, c->params()); return true; } -KVSO_CLASS_FUNCTION(webView,jsMouseOverEvent) +KVSO_CLASS_FUNCTION(webView, jsMouseOverEvent) { - emitSignal("jsmouseover",c,c->params()); + emitSignal("jsmouseover", c, c->params()); return true; } -KVSO_CLASS_FUNCTION(webView,jsMouseOutEvent) +KVSO_CLASS_FUNCTION(webView, jsMouseOutEvent) { - emitSignal("jsmouseout",c,c->params()); + emitSignal("jsmouseout", c, c->params()); return true; } void KvsObject_webView::slotOnChange(QString szParam) { //qDebug("change"); KviKvsVariantList params(new KviKvsVariant(szParam)); - callFunction(this,"jsChangeEvent",¶ms); + callFunction(this, "jsChangeEvent", ¶ms); } void KvsObject_webView::slotOnSubmit(QString szParam) @@ -1269,26 +1275,25 @@ void KvsObject_webView::slotOnSubmit(QString szParam) // ,QString szParam2,QString szParam3 //qDebug("slotonsubmit"); KviKvsVariantList params(new KviKvsVariant(szParam)); - callFunction(this,"jsSubmitEvent",¶ms); + callFunction(this, "jsSubmitEvent", ¶ms); } void KvsObject_webView::slotOnClick(QString szParam) { KviKvsVariantList params(new KviKvsVariant(szParam)); - callFunction(this,"jsClickEvent",¶ms); + callFunction(this, "jsClickEvent", ¶ms); } void KvsObject_webView::slotOnMouseOver(QString szParam) { - KviKvsVariantList params(new KviKvsVariant(szParam)); - callFunction(this,"jsMouseOverEvent",¶ms); + KviKvsVariantList params(new KviKvsVariant(szParam)); + callFunction(this, "jsMouseOverEvent", ¶ms); } void KvsObject_webView::slotOnMouseOut(QString szParam) { KviKvsVariantList params(new KviKvsVariant(szParam)); - callFunction(this,"jsMouseOutEvent",¶ms); + callFunction(this, "jsMouseOutEvent", ¶ms); } - /*KVSO_CLASS_FUNCTION(webView,jsWindowObjectClearedEvent) { emitSignal("jsWindowObjectCleared",c,c->params()); @@ -1298,29 +1303,29 @@ void KvsObject_webView::slotOnMouseOut(QString szParam) void KvsObject_webView::slotLoadFinished(bool bOk) { - if (bOk) - m_currentElement=((QWebView *)widget())->page()->mainFrame()->documentElement(); + if(bOk) + m_currentElement = ((QWebView *)widget())->page()->mainFrame()->documentElement(); KviKvsVariantList params(new KviKvsVariant(bOk)); - callFunction(this,"loadFinishedEvent",¶ms); + callFunction(this, "loadFinishedEvent", ¶ms); } void KvsObject_webView::slotLoadStarted() { - KviKvsVariantList *lParams=0; - callFunction(this,"loadStartedEvent",lParams); + KviKvsVariantList * lParams = 0; + callFunction(this, "loadStartedEvent", lParams); } void KvsObject_webView::slotLoadProgress(int iProgress) { - KviKvsVariantList params(new KviKvsVariant((kvs_int_t) iProgress)); - callFunction(this,"loadProgressEvent" ,¶ms); + KviKvsVariantList params(new KviKvsVariant((kvs_int_t)iProgress)); + callFunction(this, "loadProgressEvent", ¶ms); } -void KvsObject_webView::slotLinkClicked(const QUrl &url) +void KvsObject_webView::slotLinkClicked(const QUrl & url) { - QString szUrl=url.toString(); + QString szUrl = url.toString(); KviKvsVariantList params(new KviKvsVariant(szUrl)); - callFunction(this,"linkClickedEvent" ,¶ms); + callFunction(this, "linkClickedEvent", ¶ms); } /*void KvsObject_webView::javaScriptWindowObjectCleared(const QUrl &url) { @@ -1329,58 +1334,59 @@ void KvsObject_webView::slotLinkClicked(const QUrl &url) addToJavaScriptWindowObject }*/ -void KvsObject_webView::slotDownloadRequest(const QNetworkRequest &r) +void KvsObject_webView::slotDownloadRequest(const QNetworkRequest & r) { - QNetworkReply *pReply=m_pNetworkManager->get(r); - QString szFilePath=""; - KviKvsVariant *filepathret=new KviKvsVariant(szFilePath); + QNetworkReply * pReply = m_pNetworkManager->get(r); + QString szFilePath = ""; + KviKvsVariant * filepathret = new KviKvsVariant(szFilePath); KviKvsVariantList params(new KviKvsVariant(r.url().toString())); - callFunction(this,"downloadRequestEvent",filepathret,¶ms); + callFunction(this, "downloadRequestEvent", filepathret, ¶ms); filepathret->asString(szFilePath); - if (!szFilePath.isEmpty()) + if(!szFilePath.isEmpty()) { - QFile *pFile=new QFile(szFilePath); + QFile * pFile = new QFile(szFilePath); if(!pFile->open(QIODevice::WriteOnly)) { - m_pContext->warning(__tr2qs_ctx("Invalid file path '%Q'","objects"),&szFilePath); + m_pContext->warning(__tr2qs_ctx("Invalid file path '%Q'", "objects"), &szFilePath); pReply->abort(); pReply->deleteLater(); return; } - KviKvsDownloadHandler *pHandler = new KviKvsDownloadHandler(this,pFile,pReply,g_iDownloadId); + KviKvsDownloadHandler * pHandler = new KviKvsDownloadHandler(this, pFile, pReply, g_iDownloadId); Q_UNUSED(pHandler); g_iDownloadId++; } } -KviKvsWebView::KviKvsWebView(QWidget * par,const char * name,KvsObject_webView * parent) -:QWebView(par) +KviKvsWebView::KviKvsWebView(QWidget * par, const char * name, KvsObject_webView * parent) + : QWebView(par) { - m_pParentScript=parent; + m_pParentScript = parent; setObjectName(name); } - -void KviKvsWebView::mouseMoveEvent( QMouseEvent * ev ) +void KviKvsWebView::mouseMoveEvent(QMouseEvent * ev) { KviKvsVariant vRetValue; KviKvsVariantList lParams; lParams.append(new KviKvsVariant((kvs_int_t)ev->x())); lParams.append(new KviKvsVariant((kvs_int_t)ev->y())); - if (!m_pParentScript->callFunction(m_pParentScript,"mouseMoveEvent",&vRetValue,&lParams)) QWebView::mouseMoveEvent(ev); // ignore results of a broken event handler + if(!m_pParentScript->callFunction(m_pParentScript, "mouseMoveEvent", &vRetValue, &lParams)) + QWebView::mouseMoveEvent(ev); // ignore results of a broken event handler else { if(!vRetValue.asBoolean()) QWebView::mouseMoveEvent(ev); } } -void KviKvsWebView::contextMenuEvent( QContextMenuEvent * ev ) +void KviKvsWebView::contextMenuEvent(QContextMenuEvent * ev) { KviKvsVariant vRetValue; KviKvsVariantList lParams; lParams.append(new KviKvsVariant((kvs_int_t)ev->x())); lParams.append(new KviKvsVariant((kvs_int_t)ev->y())); - if (!m_pParentScript->callFunction(m_pParentScript,"customContextMenuRequestedEvent",&vRetValue,&lParams)) QWebView::contextMenuEvent(ev); // ignore results of a broken event handler + if(!m_pParentScript->callFunction(m_pParentScript, "customContextMenuRequestedEvent", &vRetValue, &lParams)) + QWebView::contextMenuEvent(ev); // ignore results of a broken event handler else { if(!vRetValue.asBoolean()) @@ -1390,17 +1396,17 @@ void KviKvsWebView::contextMenuEvent( QContextMenuEvent * ev ) bool KviKvsWebView::event(QEvent * e) { - if(e->type()==QEvent::ToolTip) + if(e->type() == QEvent::ToolTip) { - QHelpEvent *helpEvent = static_cast(e); - QString szTooltip=""; - KviKvsVariant *tipret=new KviKvsVariant(szTooltip); - KviKvsVariantList params(new KviKvsVariant((kvs_int_t)helpEvent->x()),new KviKvsVariant((kvs_int_t)helpEvent->y())); - m_pParentScript->callFunction(m_pParentScript,"maybeTipEvent",tipret,¶ms); + QHelpEvent * helpEvent = static_cast(e); + QString szTooltip = ""; + KviKvsVariant * tipret = new KviKvsVariant(szTooltip); + KviKvsVariantList params(new KviKvsVariant((kvs_int_t)helpEvent->x()), new KviKvsVariant((kvs_int_t)helpEvent->y())); + m_pParentScript->callFunction(m_pParentScript, "maybeTipEvent", tipret, ¶ms); tipret->asString(szTooltip); - if (!szTooltip.isEmpty()) + if(!szTooltip.isEmpty()) { - QToolTip::showText(helpEvent->globalPos(),szTooltip); + QToolTip::showText(helpEvent->globalPos(), szTooltip); return false; } } diff --git a/src/modules/objects/KvsObject_webView.h b/src/modules/objects/KvsObject_webView.h index 107d8d8c8..45de20ceb 100644 --- a/src/modules/objects/KvsObject_webView.h +++ b/src/modules/objects/KvsObject_webView.h @@ -37,51 +37,52 @@ #include class KvsObject_webView; -class KviKvsWebView : public QWebView +class KviKvsWebView : public QWebView { Q_OBJECT public: - KviKvsWebView(QWidget * par,const char * name,KvsObject_webView *); + KviKvsWebView(QWidget * par, const char * name, KvsObject_webView *); //void accept(); //void reject(); virtual ~KviKvsWebView(); + protected: - KvsObject_webView *m_pParentScript; + KvsObject_webView * m_pParentScript; + protected: - virtual void mouseMoveEvent( QMouseEvent * ev ); - virtual void contextMenuEvent(QContextMenuEvent *); - virtual bool event(QEvent * e); -/*protected slots: + virtual void mouseMoveEvent(QMouseEvent * ev); + virtual void contextMenuEvent(QContextMenuEvent *); + virtual bool event(QEvent * e); + /*protected slots: void slotNextClicked(); void slotBackClicked(); */ }; - class KvsObject_webView : public KviKvsObject { Q_OBJECT public: KVSO_DECLARE_OBJECT(KvsObject_webView) protected: - KviKvsRunTimeContext * m_pContext; + KviKvsRunTimeContext * m_pContext; int elementMapId; - int insertElement(const QWebElement &ele); + int insertElement(const QWebElement & ele); QWebElement getElement(int iIdx); int getElementId(const QWebElement &); - QHash m_elementMapper; - KviPointerList * lWebelement; - QHash m_dictCache; + QHash m_elementMapper; + KviPointerList * lWebelement; + QHash m_dictCache; KviPointerList * m_pReplyList; - QNetworkAccessManager * m_pNetworkManager; - QWebElementCollection m_webElementCollection; - QWebElement m_currentElement; -public: + QNetworkAccessManager * m_pNetworkManager; + QWebElementCollection m_webElementCollection; + QWebElement m_currentElement; - QWidget * widget(){ return (QWidget *)object(); } +public: + QWidget * widget() { return (QWidget *)object(); } protected: - void getFrames(QWebFrame *pCurFrame, QStringList &szFramesNames); - QWebFrame * findFrame(QWebFrame *pCurFrame, QString &szFrameName); + void getFrames(QWebFrame * pCurFrame, QStringList & szFramesNames); + QWebFrame * findFrame(QWebFrame * pCurFrame, QString & szFrameName); virtual bool init(KviKvsRunTimeContext * pContext, KviKvsVariantList * pParams); bool removeFromDocument(KviKvsObjectFunctionCall * c); bool makePreview(KviKvsObjectFunctionCall * c); @@ -91,7 +92,6 @@ protected: bool classes(KviKvsObjectFunctionCall * c); - bool firstChild(KviKvsObjectFunctionCall * c); bool lastChild(KviKvsObjectFunctionCall * c); bool parentElement(KviKvsObjectFunctionCall * c); @@ -147,10 +147,10 @@ protected slots: void slotDownloadRequest(const QNetworkRequest &); void slotLinkClicked(const QUrl &); - void slotOnChange(QString ); - void slotOnSubmit(QString ); - void slotOnClick(QString ); - void slotOnMouseOver(QString); + void slotOnChange(QString); + void slotOnSubmit(QString); + void slotOnClick(QString); + void slotOnMouseOver(QString); void slotOnMouseOut(QString); }; @@ -161,15 +161,15 @@ public: KviKvsDownloadHandler(KvsObject_webView * pParent, QFile * pFile, QNetworkReply * pNetReply, int iId); virtual ~KviKvsDownloadHandler(); + protected: KvsObject_webView * m_pParentScript; - QFile * m_pFile; - QNetworkReply * m_pReply; - int m_Id; + QFile * m_pFile; + QNetworkReply * m_pReply; + int m_Id; protected slots: void slotReadyRead(); void slotReplyFinished(); - }; #endif // COMPILE_WEBKIT_SUPPORT diff --git a/src/modules/objects/KvsObject_widget.cpp b/src/modules/objects/KvsObject_widget.cpp index 6da81a999..c6fcfaca8 100644 --- a/src/modules/objects/KvsObject_widget.cpp +++ b/src/modules/objects/KvsObject_widget.cpp @@ -37,7 +37,6 @@ #include "KviStatusBar.h" #include "KvsObject_painter.h" - #include #include #include @@ -58,11 +57,11 @@ #include #ifdef COMPILE_KDE4_SUPPORT - #include +#include #endif -KviKvsWidget::KviKvsWidget(KvsObject_widget * object,QWidget * par) -:QWidget(par), m_pObject(object) +KviKvsWidget::KviKvsWidget(KvsObject_widget * object, QWidget * par) + : QWidget(par), m_pObject(object) { } @@ -72,17 +71,17 @@ KviKvsWidget::~KviKvsWidget() QSize KviKvsWidget::sizeHint() const { - QSize size=QWidget::sizeHint(); + QSize size = QWidget::sizeHint(); KviKvsVariant oReturnBuffer; - KviKvsVariantList params(new KviKvsVariant((kvs_int_t)size.width()),new KviKvsVariant((kvs_int_t)size.height())); - m_pObject->callFunction(m_pObject,"sizeHintRequestEvent",&oReturnBuffer,¶ms); - if (oReturnBuffer.isArray()) + KviKvsVariantList params(new KviKvsVariant((kvs_int_t)size.width()), new KviKvsVariant((kvs_int_t)size.height())); + m_pObject->callFunction(m_pObject, "sizeHintRequestEvent", &oReturnBuffer, ¶ms); + if(oReturnBuffer.isArray()) { - if (oReturnBuffer.array()->size()==2) + if(oReturnBuffer.array()->size() == 2) { - kvs_int_t w,h; - if (oReturnBuffer.array()->at(0)->asInteger(w) && oReturnBuffer.array()->at(1)->asInteger(h)) - return QSize(w,h); + kvs_int_t w, h; + if(oReturnBuffer.array()->at(0)->asInteger(w) && oReturnBuffer.array()->at(1)->asInteger(h)) + return QSize(w, h); } } return QWidget::sizeHint(); @@ -102,7 +101,7 @@ const char * const widgetattributes_tbl[] = { "noMousePropagation" }; -#define widgetattributes_num (sizeof(widgetattributes_tbl) / sizeof(widgetattributes_tbl[0])) +#define widgetattributes_num (sizeof(widgetattributes_tbl) / sizeof(widgetattributes_tbl[0])) const QPalette::ColorRole colorrole_cod[] = { QPalette::Window, @@ -134,8 +133,7 @@ const char * const colorrole_tbl[] = { "HighlightedText" }; -#define colorrole_num (sizeof(colorrole_tbl) / sizeof(colorrole_tbl[0])) - +#define colorrole_num (sizeof(colorrole_tbl) / sizeof(colorrole_tbl[0])) const Qt::WindowType widgettypes_cod[] = { Qt::Window, @@ -151,7 +149,6 @@ const Qt::WindowType widgettypes_cod[] = { Qt::FramelessWindowHint }; - const char * const widgettypes_tbl[] = { "Window", "Dialog", @@ -166,9 +163,7 @@ const char * const widgettypes_tbl[] = { "FramelessWindow" }; - -#define widgettypes_num (sizeof(widgettypes_tbl) / sizeof(widgettypes_tbl[0])) - +#define widgettypes_num (sizeof(widgettypes_tbl) / sizeof(widgettypes_tbl[0])) #define QT_WIDGET_TABFOCUS Qt::TabFocus #define QT_WIDGET_CLICKFOCUS Qt::ClickFocus @@ -603,373 +598,400 @@ const char * const widgettypes_tbl[] = { // return no errors and results that have to be assumed // as invalid (this allows the minimum overhead: if widget() -KVSO_BEGIN_REGISTERCLASS(KvsObject_widget,"widget","object") - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget,setParent) - // apparence - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget,show) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget,hide) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget,update) - - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget,repaint) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget,isTopLevel) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget,isVisible) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget,raise) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget,lower) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget,setEnabled) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget,isEnabled) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget,setMouseTracking) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget,setWindowTitle) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget,setWindowTitle) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget,windowTitle) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget,windowTitle) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget,hasFocus) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget,setFocus) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget,setToolTip) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget,setWFlags) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget,setWindowIcon) - // fonts - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget,fontDescent) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget,fontAscent) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget,fontMetricsLineSpacing) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget,fontMetricsWidth) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget,fontMetricsHeight) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget,setFont) - // geometry - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget,screenResolution) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget,centerToScreen) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget,geometry) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget,setGeometry) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget,mapToGlobal) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget,mapFromGlobal) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget,y) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget,x) - - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget,globalCursorX) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget,globalCursorY) - - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget,width) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget,height) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget,setMinimumWidth) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget,setMinimumHeight) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget,setMaximumWidth) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget,setMaximumHeight) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget,move) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget,sizeHint) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget,resize) - - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget,setFocusPolicy) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget,addWidgetToWrappedLayout) - - // colors and image - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget,setForegroundColor) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget,setBackgroundColor) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget,setBackgroundImage) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget,backgroundColor) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget,foregroundColor) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget,setMask) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget,setAttribute) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget,colorPalette) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget,setStyleSheet) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget,setKeyShortcut) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget,grab) - // statusbar - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget,insertIntoStatusBar) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget,removeFromStatusBar) - // events - KVSO_REGISTER_STANDARD_NOTHINGRETURN_HANDLER(KvsObject_widget,"mousePressEvent") - KVSO_REGISTER_STANDARD_NOTHINGRETURN_HANDLER(KvsObject_widget,"mouseReleaseEvent") - KVSO_REGISTER_STANDARD_NOTHINGRETURN_HANDLER(KvsObject_widget,"mouseDoubleClickEvent") - KVSO_REGISTER_STANDARD_NOTHINGRETURN_HANDLER(KvsObject_widget,"mouseMoveEvent") - KVSO_REGISTER_STANDARD_NOTHINGRETURN_HANDLER(KvsObject_widget,"focusInEvent") - KVSO_REGISTER_STANDARD_NOTHINGRETURN_HANDLER(KvsObject_widget,"focusOutEvent") - KVSO_REGISTER_STANDARD_NOTHINGRETURN_HANDLER(KvsObject_widget,"mouseLeaveEvent") - KVSO_REGISTER_STANDARD_NOTHINGRETURN_HANDLER(KvsObject_widget,"mouseEnterEvent") - KVSO_REGISTER_STANDARD_NOTHINGRETURN_HANDLER(KvsObject_widget,"showEvent") - KVSO_REGISTER_STANDARD_NOTHINGRETURN_HANDLER(KvsObject_widget,"hideEvent") - KVSO_REGISTER_STANDARD_NOTHINGRETURN_HANDLER(KvsObject_widget,"closeEvent") - KVSO_REGISTER_STANDARD_NOTHINGRETURN_HANDLER(KvsObject_widget,"resizeEvent") - KVSO_REGISTER_STANDARD_NOTHINGRETURN_HANDLER(KvsObject_widget,"moveEvent") - KVSO_REGISTER_STANDARD_NOTHINGRETURN_HANDLER(KvsObject_widget,"paintEvent") - KVSO_REGISTER_STANDARD_NOTHINGRETURN_HANDLER(KvsObject_widget,"keyPressEvent") - KVSO_REGISTER_STANDARD_NOTHINGRETURN_HANDLER(KvsObject_widget,"sizeHintRequestEvent") - KVSO_REGISTER_STANDARD_NOTHINGRETURN_HANDLER(KvsObject_widget,"maybeTipEvent") - KVSO_REGISTER_STANDARD_NOTHINGRETURN_HANDLER(KvsObject_widget,"shortCutEvent") - KVSO_REGISTER_STANDARD_NOTHINGRETURN_HANDLER(KvsObject_widget,"customContextMenuRequestedEvent") +KVSO_BEGIN_REGISTERCLASS(KvsObject_widget, "widget", "object") +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget, setParent) +// apparence +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget, show) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget, hide) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget, update) + +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget, repaint) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget, isTopLevel) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget, isVisible) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget, raise) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget, lower) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget, setEnabled) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget, isEnabled) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget, setMouseTracking) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget, setWindowTitle) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget, setWindowTitle) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget, windowTitle) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget, windowTitle) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget, hasFocus) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget, setFocus) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget, setToolTip) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget, setWFlags) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget, setWindowIcon) +// fonts +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget, fontDescent) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget, fontAscent) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget, fontMetricsLineSpacing) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget, fontMetricsWidth) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget, fontMetricsHeight) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget, setFont) +// geometry +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget, screenResolution) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget, centerToScreen) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget, geometry) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget, setGeometry) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget, mapToGlobal) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget, mapFromGlobal) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget, y) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget, x) + +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget, globalCursorX) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget, globalCursorY) + +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget, width) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget, height) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget, setMinimumWidth) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget, setMinimumHeight) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget, setMaximumWidth) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget, setMaximumHeight) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget, move) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget, sizeHint) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget, resize) + +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget, setFocusPolicy) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget, addWidgetToWrappedLayout) + +// colors and image +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget, setForegroundColor) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget, setBackgroundColor) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget, setBackgroundImage) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget, backgroundColor) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget, foregroundColor) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget, setMask) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget, setAttribute) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget, colorPalette) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget, setStyleSheet) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget, setKeyShortcut) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget, grab) +// statusbar +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget, insertIntoStatusBar) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_widget, removeFromStatusBar) +// events +KVSO_REGISTER_STANDARD_NOTHINGRETURN_HANDLER(KvsObject_widget, "mousePressEvent") +KVSO_REGISTER_STANDARD_NOTHINGRETURN_HANDLER(KvsObject_widget, "mouseReleaseEvent") +KVSO_REGISTER_STANDARD_NOTHINGRETURN_HANDLER(KvsObject_widget, "mouseDoubleClickEvent") +KVSO_REGISTER_STANDARD_NOTHINGRETURN_HANDLER(KvsObject_widget, "mouseMoveEvent") +KVSO_REGISTER_STANDARD_NOTHINGRETURN_HANDLER(KvsObject_widget, "focusInEvent") +KVSO_REGISTER_STANDARD_NOTHINGRETURN_HANDLER(KvsObject_widget, "focusOutEvent") +KVSO_REGISTER_STANDARD_NOTHINGRETURN_HANDLER(KvsObject_widget, "mouseLeaveEvent") +KVSO_REGISTER_STANDARD_NOTHINGRETURN_HANDLER(KvsObject_widget, "mouseEnterEvent") +KVSO_REGISTER_STANDARD_NOTHINGRETURN_HANDLER(KvsObject_widget, "showEvent") +KVSO_REGISTER_STANDARD_NOTHINGRETURN_HANDLER(KvsObject_widget, "hideEvent") +KVSO_REGISTER_STANDARD_NOTHINGRETURN_HANDLER(KvsObject_widget, "closeEvent") +KVSO_REGISTER_STANDARD_NOTHINGRETURN_HANDLER(KvsObject_widget, "resizeEvent") +KVSO_REGISTER_STANDARD_NOTHINGRETURN_HANDLER(KvsObject_widget, "moveEvent") +KVSO_REGISTER_STANDARD_NOTHINGRETURN_HANDLER(KvsObject_widget, "paintEvent") +KVSO_REGISTER_STANDARD_NOTHINGRETURN_HANDLER(KvsObject_widget, "keyPressEvent") +KVSO_REGISTER_STANDARD_NOTHINGRETURN_HANDLER(KvsObject_widget, "sizeHintRequestEvent") +KVSO_REGISTER_STANDARD_NOTHINGRETURN_HANDLER(KvsObject_widget, "maybeTipEvent") +KVSO_REGISTER_STANDARD_NOTHINGRETURN_HANDLER(KvsObject_widget, "shortCutEvent") +KVSO_REGISTER_STANDARD_NOTHINGRETURN_HANDLER(KvsObject_widget, "customContextMenuRequestedEvent") KVSO_END_REGISTERCLASS(KvsObject_widget) - -KVSO_BEGIN_CONSTRUCTOR(KvsObject_widget,KviKvsObject) +KVSO_BEGIN_CONSTRUCTOR(KvsObject_widget, KviKvsObject) KVSO_END_CONSTRUCTOR(KvsObject_widget) KVSO_BEGIN_DESTRUCTOR(KvsObject_widget) - emit aboutToDie(); +emit aboutToDie(); KVSO_END_CONSTRUCTOR(KvsObject_widget) -bool KvsObject_widget::init(KviKvsRunTimeContext *c,KviKvsVariantList *) +bool KvsObject_widget::init(KviKvsRunTimeContext * c, KviKvsVariantList *) { - setObject(new KviKvsWidget(this,parentScriptWidget())); - m_pContext=c; + setObject(new KviKvsWidget(this, parentScriptWidget())); + m_pContext = c; widget()->setObjectName(getName()); return true; } -bool KvsObject_widget::eventFilter(QObject *o,QEvent *e) +bool KvsObject_widget::eventFilter(QObject * o, QEvent * e) { if(o == object()) { - bool ret=false; + bool ret = false; int aparam; - bool brokenhandler=false; + bool brokenhandler = false; KviKvsVariant oReturnBuffer(ret); switch(e->type()) { case QEvent::ContextMenu: { - QPoint iPoint=widget()->mapFromGlobal(((QContextMenuEvent *)e)->globalPos()); - KviKvsVariantList params(new KviKvsVariant((kvs_int_t)iPoint.x()),new KviKvsVariant((kvs_int_t)iPoint.y())); - callFunction(this,"customContextMenuRequestedEvent",&oReturnBuffer,¶ms); + QPoint iPoint = widget()->mapFromGlobal(((QContextMenuEvent *)e)->globalPos()); + KviKvsVariantList params(new KviKvsVariant((kvs_int_t)iPoint.x()), new KviKvsVariant((kvs_int_t)iPoint.y())); + callFunction(this, "customContextMenuRequestedEvent", &oReturnBuffer, ¶ms); break; } case QEvent::Shortcut: { KviKvsVariantList params(new KviKvsVariant((kvs_int_t)((QShortcutEvent *)e)->shortcutId())); - callFunction(this,"shortCutEvent",&oReturnBuffer,¶ms); + callFunction(this, "shortCutEvent", &oReturnBuffer, ¶ms); break; } case QEvent::ToolTip: { - QHelpEvent *helpEvent = static_cast(e); - QPoint point=helpEvent->pos(); - QString szTooltip=""; - KviKvsVariant *tipret=new KviKvsVariant(szTooltip); - KviKvsVariantList params(new KviKvsVariant((kvs_int_t)point.x()),new KviKvsVariant((kvs_int_t)point.y())); - callFunction(this,"maybeTipEvent",tipret,¶ms); + QHelpEvent * helpEvent = static_cast(e); + QPoint point = helpEvent->pos(); + QString szTooltip = ""; + KviKvsVariant * tipret = new KviKvsVariant(szTooltip); + KviKvsVariantList params(new KviKvsVariant((kvs_int_t)point.x()), new KviKvsVariant((kvs_int_t)point.y())); + callFunction(this, "maybeTipEvent", tipret, ¶ms); tipret->asString(szTooltip); - if (!szTooltip.isEmpty()) QToolTip::showText(helpEvent->globalPos(),szTooltip); + if(!szTooltip.isEmpty()) + QToolTip::showText(helpEvent->globalPos(), szTooltip); break; } case QEvent::Paint: { - QRect rect=((QPaintEvent *)e)->rect(); + QRect rect = ((QPaintEvent *)e)->rect(); KviKvsObjectClass * pClass = KviKvsKernel::instance()->objectController()->lookupClass("painter"); KviKvsVariantList params; - KviKvsObject * pObject = pClass->allocateInstance(0,"internalpainter",m_pContext,¶ms); + KviKvsObject * pObject = pClass->allocateInstance(0, "internalpainter", m_pContext, ¶ms); QPainter p(widget()); ((KvsObject_painter *)pObject)->setInternalPainter(&p); p.setClipRect(rect); - kvs_hobject_t hobj=pObject->handle(); - KviKvsVariantList params2(new KviKvsVariant(hobj),new KviKvsVariant((kvs_int_t)rect.x()),new KviKvsVariant((kvs_int_t)rect.y()),new KviKvsVariant((kvs_int_t)rect.width()),new KviKvsVariant((kvs_int_t)rect.height())); - callFunction(this,"paintEvent",&oReturnBuffer,¶ms2); - pObject=KviKvsKernel::instance()->objectController()->lookupObject(hobj); - if (pObject) pObject->dieNow(); + kvs_hobject_t hobj = pObject->handle(); + KviKvsVariantList params2(new KviKvsVariant(hobj), new KviKvsVariant((kvs_int_t)rect.x()), new KviKvsVariant((kvs_int_t)rect.y()), new KviKvsVariant((kvs_int_t)rect.width()), new KviKvsVariant((kvs_int_t)rect.height())); + callFunction(this, "paintEvent", &oReturnBuffer, ¶ms2); + pObject = KviKvsKernel::instance()->objectController()->lookupObject(hobj); + if(pObject) + pObject->dieNow(); break; } - case QEvent::KeyPress: + case QEvent::KeyPress: { - QString tmp=""; + QString tmp = ""; switch(((QKeyEvent *)e)->key()) { - case Qt::Key_Return: - tmp="Return"; - break; - case Qt::Key_Down: - tmp="Down"; - break; - case Qt::Key_Up: - tmp="Up"; - break; - case Qt::Key_Left: - tmp="Left"; - break; - case Qt::Key_Right: - tmp="Right"; - break; - case Qt::Key_Shift: - tmp="Shift"; - break; - case Qt::Key_Control: - tmp="Ctrl"; - break; - case Qt::Key_Alt: - tmp="Alt"; - break; - case Qt::Key_CapsLock: - tmp="CapsLock"; - break; - case Qt::Key_Backspace: - tmp="Backspace"; - break; - case Qt::Key_Delete: - tmp="Del"; - break; - case Qt::Key_Enter: - tmp="Enter"; - break; - case Qt::Key_Escape: - tmp="Esc"; - break; - case Qt::Key_0: - tmp="0"; - break; - case Qt::Key_1: - tmp="1"; - break; - case Qt::Key_2: - tmp="2"; - break; - case Qt::Key_3: - tmp="3"; - break; - case Qt::Key_4: - tmp="4"; - break; - case Qt::Key_5: - tmp="5"; - break; - case Qt::Key_6: - tmp="6"; - break; - case Qt::Key_7: - tmp="7"; - break; - case Qt::Key_8: - tmp="8"; - break; - case Qt::Key_9: - tmp="9"; - break; - case Qt::Key_Plus: - tmp="+"; - break; - case Qt::Key_Minus: - tmp="-"; - break; - case Qt::Key_Slash: - tmp="/"; - break; - case Qt::Key_Asterisk: - tmp="*"; - break; - case Qt::Key_Period: - tmp="."; - break; - case Qt::Key_ParenLeft: - tmp="("; - break; - case Qt::Key_ParenRight: - tmp=")"; - break; - case Qt::Key_Equal: - tmp="="; - break; - case Qt::Key_AsciiCircum: - tmp="^"; - break; - default: - if (!((QKeyEvent *)e)->text().isEmpty()) tmp = ((QKeyEvent *)e)->text(); + case Qt::Key_Return: + tmp = "Return"; + break; + case Qt::Key_Down: + tmp = "Down"; + break; + case Qt::Key_Up: + tmp = "Up"; + break; + case Qt::Key_Left: + tmp = "Left"; + break; + case Qt::Key_Right: + tmp = "Right"; + break; + case Qt::Key_Shift: + tmp = "Shift"; + break; + case Qt::Key_Control: + tmp = "Ctrl"; + break; + case Qt::Key_Alt: + tmp = "Alt"; + break; + case Qt::Key_CapsLock: + tmp = "CapsLock"; + break; + case Qt::Key_Backspace: + tmp = "Backspace"; + break; + case Qt::Key_Delete: + tmp = "Del"; + break; + case Qt::Key_Enter: + tmp = "Enter"; + break; + case Qt::Key_Escape: + tmp = "Esc"; + break; + case Qt::Key_0: + tmp = "0"; + break; + case Qt::Key_1: + tmp = "1"; + break; + case Qt::Key_2: + tmp = "2"; + break; + case Qt::Key_3: + tmp = "3"; + break; + case Qt::Key_4: + tmp = "4"; + break; + case Qt::Key_5: + tmp = "5"; + break; + case Qt::Key_6: + tmp = "6"; + break; + case Qt::Key_7: + tmp = "7"; + break; + case Qt::Key_8: + tmp = "8"; + break; + case Qt::Key_9: + tmp = "9"; + break; + case Qt::Key_Plus: + tmp = "+"; + break; + case Qt::Key_Minus: + tmp = "-"; + break; + case Qt::Key_Slash: + tmp = "/"; + break; + case Qt::Key_Asterisk: + tmp = "*"; + break; + case Qt::Key_Period: + tmp = "."; + break; + case Qt::Key_ParenLeft: + tmp = "("; + break; + case Qt::Key_ParenRight: + tmp = ")"; + break; + case Qt::Key_Equal: + tmp = "="; + break; + case Qt::Key_AsciiCircum: + tmp = "^"; + break; + default: + if(!((QKeyEvent *)e)->text().isEmpty()) + tmp = ((QKeyEvent *)e)->text(); } KviKvsVariantList params(new KviKvsVariant(tmp)); - callFunction(this,"keyPressEvent",0,¶ms); + callFunction(this, "keyPressEvent", 0, ¶ms); } break; case QEvent::MouseButtonPress: { - if(((QMouseEvent *)e)->button() & Qt::LeftButton)aparam = 0; - else { - if(((QMouseEvent *)e)->button() & Qt::RightButton)aparam = 1; - else aparam = 2; + if(((QMouseEvent *)e)->button() & Qt::LeftButton) + aparam = 0; + else + { + if(((QMouseEvent *)e)->button() & Qt::RightButton) + aparam = 1; + else + aparam = 2; } KviKvsVariantList lParams; lParams.append(new KviKvsVariant((kvs_int_t)aparam)); lParams.append(new KviKvsVariant((kvs_int_t)((QMouseEvent *)e)->pos().x())); lParams.append(new KviKvsVariant((kvs_int_t)((QMouseEvent *)e)->pos().y())); - if (!callFunction(this,"mousePressEvent",&oReturnBuffer,&lParams)) brokenhandler = true; // ignore results of a broken event handler + if(!callFunction(this, "mousePressEvent", &oReturnBuffer, &lParams)) + brokenhandler = true; // ignore results of a broken event handler } break; case QEvent::MouseButtonRelease: { - if(((QMouseEvent *)e)->button() & Qt::LeftButton)aparam = 0; - else { - if(((QMouseEvent *)e)->button() & Qt::RightButton)aparam = 1; - else aparam = 2; + if(((QMouseEvent *)e)->button() & Qt::LeftButton) + aparam = 0; + else + { + if(((QMouseEvent *)e)->button() & Qt::RightButton) + aparam = 1; + else + aparam = 2; } KviKvsVariantList lParams; lParams.append(new KviKvsVariant((kvs_int_t)aparam)); lParams.append(new KviKvsVariant((kvs_int_t)((QMouseEvent *)e)->pos().x())); lParams.append(new KviKvsVariant((kvs_int_t)((QMouseEvent *)e)->pos().y())); - if (!callFunction(this,"mouseReleaseEvent",&oReturnBuffer,&lParams)) brokenhandler = true; // ignore results of a broken event handler + if(!callFunction(this, "mouseReleaseEvent", &oReturnBuffer, &lParams)) + brokenhandler = true; // ignore results of a broken event handler } break; case QEvent::MouseButtonDblClick: { - if(( (QMouseEvent *)e)->button() & Qt::LeftButton)aparam = 0; - else { - if(((QMouseEvent *)e)->button() & Qt::RightButton)aparam = 1; - else aparam = 2; + if(((QMouseEvent *)e)->button() & Qt::LeftButton) + aparam = 0; + else + { + if(((QMouseEvent *)e)->button() & Qt::RightButton) + aparam = 1; + else + aparam = 2; } KviKvsVariantList lParams; lParams.append(new KviKvsVariant((kvs_int_t)aparam)); lParams.append(new KviKvsVariant((kvs_int_t)((QMouseEvent *)e)->pos().x())); lParams.append(new KviKvsVariant((kvs_int_t)((QMouseEvent *)e)->pos().y())); - if (!callFunction(this,"mouseDoubleClickEvent",0,&lParams)) brokenhandler = true; // ignore results of a broken event handler + if(!callFunction(this, "mouseDoubleClickEvent", 0, &lParams)) + brokenhandler = true; // ignore results of a broken event handler } break; - case QEvent::MouseMove: + case QEvent::MouseMove: { KviKvsVariantList lParams; lParams.append(new KviKvsVariant((kvs_int_t)((QMouseEvent *)e)->pos().x())); lParams.append(new KviKvsVariant((kvs_int_t)((QMouseEvent *)e)->pos().y())); - if (!callFunction(this,"mouseMoveEvent",0,&lParams)) brokenhandler = true; // ignore results of a broken event handler + if(!callFunction(this, "mouseMoveEvent", 0, &lParams)) + brokenhandler = true; // ignore results of a broken event handler } break; case QEvent::FocusIn: - if(!callFunction(this,"focusInEvent",&oReturnBuffer,0))brokenhandler = true; - break; + if(!callFunction(this, "focusInEvent", &oReturnBuffer, 0)) + brokenhandler = true; + break; case QEvent::FocusOut: - if(!callFunction(this,"focusOutEvent",&oReturnBuffer,0))brokenhandler = true; - break; + if(!callFunction(this, "focusOutEvent", &oReturnBuffer, 0)) + brokenhandler = true; + break; case QEvent::Resize: { KviKvsVariantList lParams; lParams.append(new KviKvsVariant((kvs_int_t)((QResizeEvent *)e)->size().width())); lParams.append(new KviKvsVariant((kvs_int_t)((QResizeEvent *)e)->size().height())); - if(!callFunction(this,"resizeEvent",&oReturnBuffer,&lParams))brokenhandler = true; + if(!callFunction(this, "resizeEvent", &oReturnBuffer, &lParams)) + brokenhandler = true; break; } case QEvent::Move: - if(!callFunction(this,"moveEvent",&oReturnBuffer,0))brokenhandler = true; - break; + if(!callFunction(this, "moveEvent", &oReturnBuffer, 0)) + brokenhandler = true; + break; case QEvent::Close: - if(!callFunction(this,"closeEvent",&oReturnBuffer,0))brokenhandler = true; - break; + if(!callFunction(this, "closeEvent", &oReturnBuffer, 0)) + brokenhandler = true; + break; case QEvent::Enter: - if(!callFunction(this,"mouseEnterEvent",&oReturnBuffer,0))brokenhandler = true; - break; + if(!callFunction(this, "mouseEnterEvent", &oReturnBuffer, 0)) + brokenhandler = true; + break; case QEvent::Leave: - if(!callFunction(this,"mouseLeaveEvent",&oReturnBuffer,0))brokenhandler = true; - break; + if(!callFunction(this, "mouseLeaveEvent", &oReturnBuffer, 0)) + brokenhandler = true; + break; case QEvent::Show: - if(!callFunction(this,"showEvent",&oReturnBuffer,0))brokenhandler = true; - break; + if(!callFunction(this, "showEvent", &oReturnBuffer, 0)) + brokenhandler = true; + break; case QEvent::Hide: - if(!callFunction(this,"hideEvent",&oReturnBuffer,0))ret =false; - break; + if(!callFunction(this, "hideEvent", &oReturnBuffer, 0)) + ret = false; + break; default: - return KviKvsObject::eventFilter(o,e); - break; - + return KviKvsObject::eventFilter(o, e); + break; } - if (!brokenhandler){ + if(!brokenhandler) + { ret = oReturnBuffer.asBoolean(); //qDebug ("Propagation %i",ret); - return ret; - } + return ret; + } } /* if(o->parent()) @@ -979,55 +1001,54 @@ bool KvsObject_widget::eventFilter(QObject *o,QEvent *e) } else { qDebug("Propagation to object"); */ - return KviKvsObject::eventFilter(o,e); + return KviKvsObject::eventFilter(o, e); //} } - -KVSO_CLASS_FUNCTION(widget,show) +KVSO_CLASS_FUNCTION(widget, show) { CHECK_INTERNAL_POINTER(widget()) - QWidget *wid=widget(); + QWidget * wid = widget(); wid->show(); return true; } -KVSO_CLASS_FUNCTION(widget,update) +KVSO_CLASS_FUNCTION(widget, update) { CHECK_INTERNAL_POINTER(widget()) - kvs_int_t iX,iY,iW,iH; + kvs_int_t iX, iY, iW, iH; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("x",KVS_PT_INT,KVS_PF_OPTIONAL,iX) - KVSO_PARAMETER("y",KVS_PT_INT,KVS_PF_OPTIONAL,iY) - KVSO_PARAMETER("w",KVS_PT_INT,KVS_PF_OPTIONAL,iW) - KVSO_PARAMETER("h",KVS_PT_INT,KVS_PF_OPTIONAL,iH) + KVSO_PARAMETER("x", KVS_PT_INT, KVS_PF_OPTIONAL, iX) + KVSO_PARAMETER("y", KVS_PT_INT, KVS_PF_OPTIONAL, iY) + KVSO_PARAMETER("w", KVS_PT_INT, KVS_PF_OPTIONAL, iW) + KVSO_PARAMETER("h", KVS_PT_INT, KVS_PF_OPTIONAL, iH) KVSO_PARAMETERS_END(c) - if (iW || iH) - widget()->update(QRect(iX,iY,iW,iH)); + if(iW || iH) + widget()->update(QRect(iX, iY, iW, iH)); else widget()->update(); return true; } -KVSO_CLASS_FUNCTION(widget,setEnabled) +KVSO_CLASS_FUNCTION(widget, setEnabled) { CHECK_INTERNAL_POINTER(widget()) bool bEnabled; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("bEnabled",KVS_PT_BOOL,0,bEnabled) + KVSO_PARAMETER("bEnabled", KVS_PT_BOOL, 0, bEnabled) KVSO_PARAMETERS_END(c) widget()->setEnabled(bEnabled); return true; } -KVSO_CLASS_FUNCTION(widget,isEnabled) +KVSO_CLASS_FUNCTION(widget, isEnabled) { CHECK_INTERNAL_POINTER(widget()) c->returnValue()->setBoolean(widget()->isEnabled()); return true; } -KVSO_CLASS_FUNCTION(widget,fontDescent) +KVSO_CLASS_FUNCTION(widget, fontDescent) { CHECK_INTERNAL_POINTER(widget()) QFontMetrics fm = widget()->fontMetrics(); @@ -1036,82 +1057,81 @@ KVSO_CLASS_FUNCTION(widget,fontDescent) return true; } -KVSO_CLASS_FUNCTION(widget,fontAscent) +KVSO_CLASS_FUNCTION(widget, fontAscent) { CHECK_INTERNAL_POINTER(widget()) QFontMetrics fm = widget()->fontMetrics(); int d = fm.ascent(); c->returnValue()->setInteger(d); return true; - } -KVSO_CLASS_FUNCTION(widget,repaint) +KVSO_CLASS_FUNCTION(widget, repaint) { CHECK_INTERNAL_POINTER(widget()) widget()->repaint(); return true; } -KVSO_CLASS_FUNCTION(widget,fontMetricsWidth) +KVSO_CLASS_FUNCTION(widget, fontMetricsWidth) { CHECK_INTERNAL_POINTER(widget()) QString m_szStr; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("string",KVS_PT_STRING,0,m_szStr) + KVSO_PARAMETER("string", KVS_PT_STRING, 0, m_szStr) KVSO_PARAMETERS_END(c) c->returnValue()->setInteger(widget()->fontMetrics().width(m_szStr)); return true; } -KVSO_CLASS_FUNCTION(widget,fontMetricsHeight) +KVSO_CLASS_FUNCTION(widget, fontMetricsHeight) { CHECK_INTERNAL_POINTER(widget()) int fm = widget()->fontMetrics().height(); c->returnValue()->setInteger(fm); return true; } -KVSO_CLASS_FUNCTION(widget,fontMetricsLineSpacing) +KVSO_CLASS_FUNCTION(widget, fontMetricsLineSpacing) { CHECK_INTERNAL_POINTER(widget()) int fm = widget()->fontMetrics().lineSpacing(); c->returnValue()->setInteger(fm); return true; } -KVSO_CLASS_FUNCTION(widget,screenResolution) +KVSO_CLASS_FUNCTION(widget, screenResolution) { CHECK_INTERNAL_POINTER(widget()) KviKvsArray * a = new KviKvsArray(); QRect rect = g_pApp->desktop()->screenGeometry(g_pApp->desktop()->primaryScreen()); - a->set(0,new KviKvsVariant((kvs_int_t)rect.width())); - a->set(1,new KviKvsVariant((kvs_int_t)rect.height())); + a->set(0, new KviKvsVariant((kvs_int_t)rect.width())); + a->set(1, new KviKvsVariant((kvs_int_t)rect.height())); c->returnValue()->setArray(a); return true; } -KVSO_CLASS_FUNCTION(widget,geometry) +KVSO_CLASS_FUNCTION(widget, geometry) { CHECK_INTERNAL_POINTER(widget()) - QRect r = widget() ? widget()->geometry() : QRect(0,0,0,0); + QRect r = widget() ? widget()->geometry() : QRect(0, 0, 0, 0); KviKvsArray * a = new KviKvsArray(); - a->set(0,new KviKvsVariant((kvs_int_t)r.x())); - a->set(1,new KviKvsVariant((kvs_int_t)r.y())); - a->set(2,new KviKvsVariant((kvs_int_t)r.width())); - a->set(3,new KviKvsVariant((kvs_int_t)r.height())); + a->set(0, new KviKvsVariant((kvs_int_t)r.x())); + a->set(1, new KviKvsVariant((kvs_int_t)r.y())); + a->set(2, new KviKvsVariant((kvs_int_t)r.width())); + a->set(3, new KviKvsVariant((kvs_int_t)r.height())); c->returnValue()->setArray(a); return true; } -KVSO_CLASS_FUNCTION(widget,setGeometry) +KVSO_CLASS_FUNCTION(widget, setGeometry) { CHECK_INTERNAL_POINTER(widget()) KviKvsVariant * pXOrArray; - kvs_int_t iX,iY,iW,iH; + kvs_int_t iX, iY, iW, iH; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("x_or_array",KVS_PT_VARIANT,0,pXOrArray) - KVSO_PARAMETER("y",KVS_PT_INT,KVS_PF_OPTIONAL,iY) - KVSO_PARAMETER("w",KVS_PT_INT,KVS_PF_OPTIONAL,iW) - KVSO_PARAMETER("h",KVS_PT_INT,KVS_PF_OPTIONAL,iH) + KVSO_PARAMETER("x_or_array", KVS_PT_VARIANT, 0, pXOrArray) + KVSO_PARAMETER("y", KVS_PT_INT, KVS_PF_OPTIONAL, iY) + KVSO_PARAMETER("w", KVS_PT_INT, KVS_PF_OPTIONAL, iW) + KVSO_PARAMETER("h", KVS_PT_INT, KVS_PF_OPTIONAL, iH) KVSO_PARAMETERS_END(c) // this is a little bit tricky: we accept two syntax versions @@ -1132,7 +1152,7 @@ KVSO_CLASS_FUNCTION(widget,setGeometry) // make sure it has at least 4 elements if(pXOrArray->array()->size() < 4) { - c->error(__tr2qs_ctx("The array passed as parameter must contain at least 4 elements","objects")); + c->error(__tr2qs_ctx("The array passed as parameter must contain at least 4 elements", "objects")); return false; } // we must also manually extract the data from the array @@ -1145,92 +1165,94 @@ KVSO_CLASS_FUNCTION(widget,setGeometry) // no parameter was set in that place if(!(pX && pY && pW && pH)) { - c->error(__tr2qs_ctx("One of the geometry array parameters is empty","objects")); + c->error(__tr2qs_ctx("One of the geometry array parameters is empty", "objects")); return false; } if(!(pX->asInteger(iX) && pY->asInteger(iY) && pW->asInteger(iW) && pH->asInteger(iH))) { - c->error(__tr2qs_ctx("One of the geometry array parameters didn't evaluate to an integer","objects")); + c->error(__tr2qs_ctx("One of the geometry array parameters didn't evaluate to an integer", "objects")); return false; } // ok: the params are correct - } else { + } + else + { // The user passed something else as first parameter // make sure that it is an integer. // Also make sure that we really have 4 parameters if(c->params()->count() < 4) { - c->error(__tr2qs_ctx("$setGeometry() requires either an array as first parameter or four integers","objects")); + c->error(__tr2qs_ctx("$setGeometry() requires either an array as first parameter or four integers", "objects")); return false; } if(!pXOrArray->asInteger(iX)) { - c->error(__tr2qs_ctx("The first parameter didn't evaluate to an array nor an integer","objects")); + c->error(__tr2qs_ctx("The first parameter didn't evaluate to an array nor an integer", "objects")); return false; } // ok: the params are correct } - widget()->setGeometry(iX,iY,iW,iH); + widget()->setGeometry(iX, iY, iW, iH); return true; } -KVSO_CLASS_FUNCTION(widget,mapToGlobal) +KVSO_CLASS_FUNCTION(widget, mapToGlobal) { CHECK_INTERNAL_POINTER(widget()) - kvs_int_t iX,iY; + kvs_int_t iX, iY; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("x",KVS_PT_INT,0,iX) - KVSO_PARAMETER("y",KVS_PT_INT,0,iY) + KVSO_PARAMETER("x", KVS_PT_INT, 0, iX) + KVSO_PARAMETER("y", KVS_PT_INT, 0, iY) KVSO_PARAMETERS_END(c) - QPoint point=widget()->mapToGlobal(QPoint(iX,iY)); + QPoint point = widget()->mapToGlobal(QPoint(iX, iY)); KviKvsArray * a = new KviKvsArray(); - a->set(0,new KviKvsVariant((kvs_int_t)point.x())); - a->set(1,new KviKvsVariant((kvs_int_t)point.y())); + a->set(0, new KviKvsVariant((kvs_int_t)point.x())); + a->set(1, new KviKvsVariant((kvs_int_t)point.y())); c->returnValue()->setArray(a); return true; } -KVSO_CLASS_FUNCTION(widget,mapFromGlobal) +KVSO_CLASS_FUNCTION(widget, mapFromGlobal) { CHECK_INTERNAL_POINTER(widget()) - kvs_int_t iX,iY; + kvs_int_t iX, iY; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("x",KVS_PT_INT,0,iX) - KVSO_PARAMETER("y",KVS_PT_INT,0,iY) + KVSO_PARAMETER("x", KVS_PT_INT, 0, iX) + KVSO_PARAMETER("y", KVS_PT_INT, 0, iY) KVSO_PARAMETERS_END(c) - QPoint point=widget()->mapFromGlobal(QPoint(iX,iY)); + QPoint point = widget()->mapFromGlobal(QPoint(iX, iY)); KviKvsArray * a = new KviKvsArray(); - a->set(0,new KviKvsVariant((kvs_int_t)point.x())); - a->set(1,new KviKvsVariant((kvs_int_t)point.y())); + a->set(0, new KviKvsVariant((kvs_int_t)point.x())); + a->set(1, new KviKvsVariant((kvs_int_t)point.y())); c->returnValue()->setArray(a); return true; } -KVSO_CLASS_FUNCTION(widget,centerToScreen) +KVSO_CLASS_FUNCTION(widget, centerToScreen) { CHECK_INTERNAL_POINTER(widget()) QRect rect = g_pApp->desktop()->screenGeometry(g_pApp->desktop()->primaryScreen()); - widget()->move((rect.width() - widget()->width())/2,(rect.height() - widget()->height())/2); + widget()->move((rect.width() - widget()->width()) / 2, (rect.height() - widget()->height()) / 2); return true; } -KVSO_CLASS_FUNCTION(widget,setForegroundColor) +KVSO_CLASS_FUNCTION(widget, setForegroundColor) { CHECK_INTERNAL_POINTER(widget()) KviKvsVariant * pColArray; - kvs_int_t iColR,iColG,iColB; + kvs_int_t iColR, iColG, iColB; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("hex_rgb_array_or_red",KVS_PT_VARIANT,0,pColArray) - KVSO_PARAMETER("green",KVS_PT_INT,KVS_PF_OPTIONAL,iColG) - KVSO_PARAMETER("blue",KVS_PT_INT,KVS_PF_OPTIONAL,iColB) + KVSO_PARAMETER("hex_rgb_array_or_red", KVS_PT_VARIANT, 0, pColArray) + KVSO_PARAMETER("green", KVS_PT_INT, KVS_PF_OPTIONAL, iColG) + KVSO_PARAMETER("blue", KVS_PT_INT, KVS_PF_OPTIONAL, iColB) KVSO_PARAMETERS_END(c) if(pColArray->isArray()) { if(pColArray->array()->size() < 3) { - c->error(__tr2qs_ctx("The array passed as parameter must contain at least 3 elements","objects")); + c->error(__tr2qs_ctx("The array passed as parameter must contain at least 3 elements", "objects")); return false; } KviKvsVariant * pColR = pColArray->array()->at(0); @@ -1239,20 +1261,20 @@ KVSO_CLASS_FUNCTION(widget,setForegroundColor) if(!(pColR && pColG && pColB)) { - c->error(__tr2qs_ctx("One of the colors array parameters is empty","objects")); + c->error(__tr2qs_ctx("One of the colors array parameters is empty", "objects")); return false; } if(!(pColR->asInteger(iColR) && pColG->asInteger(iColG) && pColB->asInteger(iColB))) { - c->error(__tr2qs_ctx("One of the colors array parameters didn't evaluate to an integer","objects")); + c->error(__tr2qs_ctx("One of the colors array parameters didn't evaluate to an integer", "objects")); return false; } } else { QColor color; - if (c->params()->count()==1) + if(c->params()->count() == 1) { if(pColArray->isString()) { @@ -1260,18 +1282,20 @@ KVSO_CLASS_FUNCTION(widget,setForegroundColor) pColArray->asString(szColor); // maybe a color name? color.setNamedColor(szColor); - if (!color.isValid()) + if(!color.isValid()) { // itsn't a color name: let try with an hex triplette - color.setNamedColor("#"+szColor); - if (!color.isValid()) + color.setNamedColor("#" + szColor); + if(!color.isValid()) { - c->warning(__tr2qs_ctx("Not a valid color!","objects")); + c->warning(__tr2qs_ctx("Not a valid color!", "objects")); return true; } } - } else { - c->warning(__tr2qs_ctx("Not a valid color!","objects")); + } + else + { + c->warning(__tr2qs_ctx("Not a valid color!", "objects")); return true; } QPalette p = widget()->palette(); @@ -1281,37 +1305,37 @@ KVSO_CLASS_FUNCTION(widget,setForegroundColor) } if(c->params()->count() < 3) { - c->error(__tr2qs_ctx("$setForegroundColor requires either an array as first parameter, one hex string or color name, or three integers","objects")); + c->error(__tr2qs_ctx("$setForegroundColor requires either an array as first parameter, one hex string or color name, or three integers", "objects")); return false; } if(!pColArray->asInteger(iColR)) { - c->error(__tr2qs_ctx("The first parameter didn't evaluate to an array nor an integer","objects")); + c->error(__tr2qs_ctx("The first parameter didn't evaluate to an array nor an integer", "objects")); return false; } } QPalette p = widget()->palette(); - p.setColor(widget()->foregroundRole(), QColor(iColR,iColG,iColB)); + p.setColor(widget()->foregroundRole(), QColor(iColR, iColG, iColB)); widget()->setPalette(p); return true; } -KVSO_CLASS_FUNCTION(widget,setBackgroundColor) +KVSO_CLASS_FUNCTION(widget, setBackgroundColor) { CHECK_INTERNAL_POINTER(widget()) KviKvsVariant * pColArray; - kvs_int_t iColR,iColG,iColB; + kvs_int_t iColR, iColG, iColB; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("name_hex_rgb_array_or_red",KVS_PT_VARIANT,0,pColArray) - KVSO_PARAMETER("green",KVS_PT_INT,KVS_PF_OPTIONAL,iColG) - KVSO_PARAMETER("blue",KVS_PT_INT,KVS_PF_OPTIONAL,iColB) + KVSO_PARAMETER("name_hex_rgb_array_or_red", KVS_PT_VARIANT, 0, pColArray) + KVSO_PARAMETER("green", KVS_PT_INT, KVS_PF_OPTIONAL, iColG) + KVSO_PARAMETER("blue", KVS_PT_INT, KVS_PF_OPTIONAL, iColB) KVSO_PARAMETERS_END(c) if(pColArray->isArray()) { if(pColArray->array()->size() < 3) { - c->error(__tr2qs_ctx("The array passed as parameter must contain at least 3 elements","objects")); + c->error(__tr2qs_ctx("The array passed as parameter must contain at least 3 elements", "objects")); return false; } KviKvsVariant * pColR = pColArray->array()->at(0); @@ -1320,20 +1344,20 @@ KVSO_CLASS_FUNCTION(widget,setBackgroundColor) if(!(pColR && pColG && pColB)) { - c->error(__tr2qs_ctx("One of the colors array parameters is empty","objects")); + c->error(__tr2qs_ctx("One of the colors array parameters is empty", "objects")); return false; } if(!(pColR->asInteger(iColR) && pColG->asInteger(iColG) && pColB->asInteger(iColB))) { - c->error(__tr2qs_ctx("One of the colors array parameters didn't evaluate to an integer","objects")); + c->error(__tr2qs_ctx("One of the colors array parameters didn't evaluate to an integer", "objects")); return false; } } else { QColor color; - if (c->params()->count()==1) + if(c->params()->count() == 1) { if(pColArray->isString()) { @@ -1341,18 +1365,20 @@ KVSO_CLASS_FUNCTION(widget,setBackgroundColor) pColArray->asString(szColor); // maybe a color name? color.setNamedColor(szColor); - if (!color.isValid()) + if(!color.isValid()) { // itsn't a color name: let try with an hex triplette - color.setNamedColor("#"+szColor); - if (!color.isValid()) + color.setNamedColor("#" + szColor); + if(!color.isValid()) { - c->warning(__tr2qs_ctx("Not a valid color!","objects")); + c->warning(__tr2qs_ctx("Not a valid color!", "objects")); return true; } } - } else { - c->warning(__tr2qs_ctx("Not a valid color!","objects")); + } + else + { + c->warning(__tr2qs_ctx("Not a valid color!", "objects")); return true; } QPalette p = widget()->palette(); @@ -1362,442 +1388,453 @@ KVSO_CLASS_FUNCTION(widget,setBackgroundColor) } if(c->params()->count() < 3) { - c->error(__tr2qs_ctx("$setBackgroundColor requires either an array as first parameter, one hex string or color name, or three integers","objects")); + c->error(__tr2qs_ctx("$setBackgroundColor requires either an array as first parameter, one hex string or color name, or three integers", "objects")); return false; } if(!pColArray->asInteger(iColR)) { - c->error(__tr2qs_ctx("The first parameter didn't evaluate to an array nor an integer","objects")); + c->error(__tr2qs_ctx("The first parameter didn't evaluate to an array nor an integer", "objects")); return false; } } QPalette p = widget()->palette(); - p.setColor(widget()->backgroundRole(), QColor(iColR,iColG,iColB)); + p.setColor(widget()->backgroundRole(), QColor(iColR, iColG, iColB)); widget()->setPalette(p); return true; } -KVSO_CLASS_FUNCTION(widget,backgroundColor) +KVSO_CLASS_FUNCTION(widget, backgroundColor) { CHECK_INTERNAL_POINTER(widget()) QColor col = widget()->palette().color(widget()->backgroundRole()); KviKvsArray * a = new KviKvsArray(); - a->set(0,new KviKvsVariant((kvs_int_t)col.red())); - a->set(1,new KviKvsVariant((kvs_int_t)col.green())); - a->set(2,new KviKvsVariant((kvs_int_t)col.blue())); + a->set(0, new KviKvsVariant((kvs_int_t)col.red())); + a->set(1, new KviKvsVariant((kvs_int_t)col.green())); + a->set(2, new KviKvsVariant((kvs_int_t)col.blue())); c->returnValue()->setArray(a); return true; } -KVSO_CLASS_FUNCTION(widget,foregroundColor) +KVSO_CLASS_FUNCTION(widget, foregroundColor) { CHECK_INTERNAL_POINTER(widget()) QColor col = widget()->palette().color(widget()->foregroundRole()); KviKvsArray * a = new KviKvsArray(); - a->set(0,new KviKvsVariant((kvs_int_t)col.red())); - a->set(1,new KviKvsVariant((kvs_int_t)col.green())); - a->set(2,new KviKvsVariant((kvs_int_t)col.blue())); + a->set(0, new KviKvsVariant((kvs_int_t)col.red())); + a->set(1, new KviKvsVariant((kvs_int_t)col.green())); + a->set(2, new KviKvsVariant((kvs_int_t)col.blue())); c->returnValue()->setArray(a); return true; } -KVSO_CLASS_FUNCTION(widget,parentWidget) +KVSO_CLASS_FUNCTION(widget, parentWidget) { CHECK_INTERNAL_POINTER(widget()) - if(parentScriptWidget()) c->returnValue()->setHObject(parentObject()->handle()); + if(parentScriptWidget()) + c->returnValue()->setHObject(parentObject()->handle()); else c->returnValue()->setHObject((kvs_hobject_t)0); return true; - } -KVSO_CLASS_FUNCTION(widget,setMouseTracking) +KVSO_CLASS_FUNCTION(widget, setMouseTracking) { CHECK_INTERNAL_POINTER(widget()) bool bEnabled; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("bEnabled",KVS_PT_BOOL,0,bEnabled) + KVSO_PARAMETER("bEnabled", KVS_PT_BOOL, 0, bEnabled) KVSO_PARAMETERS_END(c) widget()->setMouseTracking(bEnabled); return true; } -KVSO_CLASS_FUNCTION(widget,setWindowTitle) +KVSO_CLASS_FUNCTION(widget, setWindowTitle) { CHECK_INTERNAL_POINTER(widget()) QString szWindowTitle; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("title",KVS_PT_STRING,0,szWindowTitle) + KVSO_PARAMETER("title", KVS_PT_STRING, 0, szWindowTitle) KVSO_PARAMETERS_END(c) widget()->setWindowTitle(szWindowTitle); return true; } -KVSO_CLASS_FUNCTION(widget,windowTitle) +KVSO_CLASS_FUNCTION(widget, windowTitle) { CHECK_INTERNAL_POINTER(widget()) c->returnValue()->setString(widget()->windowTitle().toUtf8().data()); return true; } -KVSO_CLASS_FUNCTION(widget,isTopLevel) +KVSO_CLASS_FUNCTION(widget, isTopLevel) { CHECK_INTERNAL_POINTER(widget()) c->returnValue()->setBoolean(widget()->isTopLevel()); return true; } -KVSO_CLASS_FUNCTION(widget,isVisible) +KVSO_CLASS_FUNCTION(widget, isVisible) { CHECK_INTERNAL_POINTER(widget()) c->returnValue()->setBoolean(widget()->isVisible()); return true; } -KVSO_CLASS_FUNCTION(widget,raise) +KVSO_CLASS_FUNCTION(widget, raise) { CHECK_INTERNAL_POINTER(widget()) widget()->raise(); return true; } -KVSO_CLASS_FUNCTION(widget,lower) +KVSO_CLASS_FUNCTION(widget, lower) { CHECK_INTERNAL_POINTER(widget()) widget()->lower(); return true; } -KVSO_CLASS_FUNCTION(widget,hasFocus) +KVSO_CLASS_FUNCTION(widget, hasFocus) { CHECK_INTERNAL_POINTER(widget()) c->returnValue()->setBoolean(widget()->hasFocus()); return true; } -KVSO_CLASS_FUNCTION(widget,setFocus) +KVSO_CLASS_FUNCTION(widget, setFocus) { CHECK_INTERNAL_POINTER(widget()) widget()->setFocus(); return true; } -KVSO_CLASS_FUNCTION(widget,hide) +KVSO_CLASS_FUNCTION(widget, hide) { CHECK_INTERNAL_POINTER(widget()) widget()->hide(); return true; } -KVSO_CLASS_FUNCTION(widget,setToolTip) +KVSO_CLASS_FUNCTION(widget, setToolTip) { CHECK_INTERNAL_POINTER(widget()) QString szTooltip; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("tooltip",KVS_PT_STRING,0,szTooltip) + KVSO_PARAMETER("tooltip", KVS_PT_STRING, 0, szTooltip) KVSO_PARAMETERS_END(c) widget()->setToolTip(szTooltip); return true; } -KVSO_CLASS_FUNCTION(widget,x) +KVSO_CLASS_FUNCTION(widget, x) { CHECK_INTERNAL_POINTER(widget()) c->returnValue()->setInteger(widget()->x()); return true; } -KVSO_CLASS_FUNCTION(widget,y) +KVSO_CLASS_FUNCTION(widget, y) { CHECK_INTERNAL_POINTER(widget()) c->returnValue()->setInteger(widget()->y()); return true; } -KVSO_CLASS_FUNCTION(widget,width) +KVSO_CLASS_FUNCTION(widget, width) { CHECK_INTERNAL_POINTER(widget()) c->returnValue()->setInteger(widget()->width()); return true; } -KVSO_CLASS_FUNCTION(widget,height) +KVSO_CLASS_FUNCTION(widget, height) { CHECK_INTERNAL_POINTER(widget()) c->returnValue()->setInteger(widget()->height()); return true; } -KVSO_CLASS_FUNCTION(widget,setMinimumWidth) +KVSO_CLASS_FUNCTION(widget, setMinimumWidth) { CHECK_INTERNAL_POINTER(widget()) kvs_int_t iW; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("w",KVS_PT_INT,0,iW) + KVSO_PARAMETER("w", KVS_PT_INT, 0, iW) KVSO_PARAMETERS_END(c) widget()->setMinimumWidth(iW); return true; } -KVSO_CLASS_FUNCTION(widget,setMinimumHeight) +KVSO_CLASS_FUNCTION(widget, setMinimumHeight) { CHECK_INTERNAL_POINTER(widget()) kvs_int_t iH; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("h",KVS_PT_INT,0,iH) + KVSO_PARAMETER("h", KVS_PT_INT, 0, iH) KVSO_PARAMETERS_END(c) widget()->setMinimumHeight(iH); return true; } -KVSO_CLASS_FUNCTION(widget,setMaximumWidth) +KVSO_CLASS_FUNCTION(widget, setMaximumWidth) { CHECK_INTERNAL_POINTER(widget()) kvs_int_t iW; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("w",KVS_PT_INT,0,iW) + KVSO_PARAMETER("w", KVS_PT_INT, 0, iW) KVSO_PARAMETERS_END(c) widget()->setMaximumWidth(iW); return true; } -KVSO_CLASS_FUNCTION(widget,setMaximumHeight) +KVSO_CLASS_FUNCTION(widget, setMaximumHeight) { CHECK_INTERNAL_POINTER(widget()) kvs_int_t iH; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("h",KVS_PT_INT,0,iH) + KVSO_PARAMETER("h", KVS_PT_INT, 0, iH) KVSO_PARAMETERS_END(c) widget()->setMaximumHeight(iH); return true; } -KVSO_CLASS_FUNCTION(widget,move) +KVSO_CLASS_FUNCTION(widget, move) { CHECK_INTERNAL_POINTER(widget()) - kvs_int_t iX,iY; + kvs_int_t iX, iY; KviKvsVariant * pXOrArray; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("x_or_array",KVS_PT_VARIANT,0,pXOrArray) - KVSO_PARAMETER("y",KVS_PT_INT,KVS_PF_OPTIONAL,iY) + KVSO_PARAMETER("x_or_array", KVS_PT_VARIANT, 0, pXOrArray) + KVSO_PARAMETER("y", KVS_PT_INT, KVS_PF_OPTIONAL, iY) KVSO_PARAMETERS_END(c) if(pXOrArray->isArray()) { if(pXOrArray->array()->size() < 2) { - c->error(__tr2qs_ctx("The array passed as parameter must contain at least 2 elements","objects")); + c->error(__tr2qs_ctx("The array passed as parameter must contain at least 2 elements", "objects")); return false; } KviKvsVariant * pX = pXOrArray->array()->at(0); KviKvsVariant * pY = pXOrArray->array()->at(1); if(!(pX && pY)) { - c->error(__tr2qs_ctx("One of the move array parameters is empty","objects")); + c->error(__tr2qs_ctx("One of the move array parameters is empty", "objects")); return false; } if(!(pX->asInteger(iX) && pY->asInteger(iY))) { - c->error(__tr2qs_ctx("One of the move array parameters didn't evaluate to an integer","objects")); + c->error(__tr2qs_ctx("One of the move array parameters didn't evaluate to an integer", "objects")); return false; } // ok: the params are correct - } else { + } + else + { if(c->params()->count() < 2) { - c->error(__tr2qs_ctx("$move() requires either an array as first parameter or two integers","objects")); + c->error(__tr2qs_ctx("$move() requires either an array as first parameter or two integers", "objects")); return false; } if(!pXOrArray->asInteger(iX)) { - c->error(__tr2qs_ctx("The first parameter didn't evaluate to an array nor an integer","objects")); + c->error(__tr2qs_ctx("The first parameter didn't evaluate to an array nor an integer", "objects")); return false; } // ok: the params are correct } - widget()->move(QPoint(iX,iY)); + widget()->move(QPoint(iX, iY)); return true; } -KVSO_CLASS_FUNCTION(widget,sizeHint) +KVSO_CLASS_FUNCTION(widget, sizeHint) { CHECK_INTERNAL_POINTER(widget()) - QSize sizehint =widget()->sizeHint(); + QSize sizehint = widget()->sizeHint(); KviKvsArray * a = new KviKvsArray(); - a->set(0,new KviKvsVariant((kvs_int_t)sizehint.width())); - a->set(1,new KviKvsVariant((kvs_int_t)sizehint.height())); + a->set(0, new KviKvsVariant((kvs_int_t)sizehint.width())); + a->set(1, new KviKvsVariant((kvs_int_t)sizehint.height())); c->returnValue()->setArray(a); return true; } -KVSO_CLASS_FUNCTION(widget,resize) +KVSO_CLASS_FUNCTION(widget, resize) { CHECK_INTERNAL_POINTER(widget()) KviKvsVariant * pWOrArray; - kvs_int_t iW,iH; + kvs_int_t iW, iH; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("width_or_array",KVS_PT_VARIANT,0,pWOrArray) - KVSO_PARAMETER("height",KVS_PT_INT,KVS_PF_OPTIONAL,iH) + KVSO_PARAMETER("width_or_array", KVS_PT_VARIANT, 0, pWOrArray) + KVSO_PARAMETER("height", KVS_PT_INT, KVS_PF_OPTIONAL, iH) KVSO_PARAMETERS_END(c) if(pWOrArray->isArray()) { if(pWOrArray->array()->size() < 2) { - c->error(__tr2qs_ctx("The array passed as parameter must contain at least 2 elements","objects")); + c->error(__tr2qs_ctx("The array passed as parameter must contain at least 2 elements", "objects")); return false; } KviKvsVariant * pW = pWOrArray->array()->at(0); KviKvsVariant * pH = pWOrArray->array()->at(1); if(!(pW && pH)) { - c->error(__tr2qs_ctx("One of the resize array parameters is empty","objects")); + c->error(__tr2qs_ctx("One of the resize array parameters is empty", "objects")); return false; } if(!(pW->asInteger(iW) && pH->asInteger(iH))) { - c->error(__tr2qs_ctx("One of the resize array parameters didn't evaluate to an integer","objects")); + c->error(__tr2qs_ctx("One of the resize array parameters didn't evaluate to an integer", "objects")); return false; } // ok: the params are correct - } else { + } + else + { if(c->params()->count() < 2) { - c->error(__tr2qs_ctx("$resize() requires either an array as first parameter or two integers","objects")); + c->error(__tr2qs_ctx("$resize() requires either an array as first parameter or two integers", "objects")); return false; } if(!pWOrArray->asInteger(iW)) { - c->error(__tr2qs_ctx("The first parameter didn't evaluate to an array nor an integer","objects")); + c->error(__tr2qs_ctx("The first parameter didn't evaluate to an array nor an integer", "objects")); return false; } // ok: the params are correct } - widget()->resize(QSize(iW,iH)); + widget()->resize(QSize(iW, iH)); return true; } -KVSO_CLASS_FUNCTION(widget,setFocusPolicy) +KVSO_CLASS_FUNCTION(widget, setFocusPolicy) { CHECK_INTERNAL_POINTER(widget()) QString szMode; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("focus",KVS_PT_STRING,0,szMode) + KVSO_PARAMETER("focus", KVS_PT_STRING, 0, szMode) KVSO_PARAMETERS_END(c) - if(KviQString::equalCI(szMode,"TabFocus")) + if(KviQString::equalCI(szMode, "TabFocus")) widget()->setFocusPolicy(QT_WIDGET_TABFOCUS); - else - if(KviQString::equalCI(szMode,"ClickFocus")) + else if(KviQString::equalCI(szMode, "ClickFocus")) widget()->setFocusPolicy(QT_WIDGET_CLICKFOCUS); - else - if(KviQString::equalCI(szMode,"StrongFocus")) + else if(KviQString::equalCI(szMode, "StrongFocus")) widget()->setFocusPolicy(QT_WIDGET_STRONGFOCUS); - else - if(KviQString::equalCI(szMode,"NoFocus")) + else if(KviQString::equalCI(szMode, "NoFocus")) widget()->setFocusPolicy(QT_WIDGET_NOFOCUS); - else c->warning(__tr2qs_ctx("Invalid parameters","objects")); + else + c->warning(__tr2qs_ctx("Invalid parameters", "objects")); return true; } -KVSO_CLASS_FUNCTION(widget,setWFlags) +KVSO_CLASS_FUNCTION(widget, setWFlags) { CHECK_INTERNAL_POINTER(widget()) QStringList wflags; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("widget_flags",KVS_PT_STRINGLIST,KVS_PF_OPTIONAL,wflags) + KVSO_PARAMETER("widget_flags", KVS_PT_STRINGLIST, KVS_PF_OPTIONAL, wflags) KVSO_PARAMETERS_END(c) Qt::WindowFlags flag, sum = 0; - for(auto& it : wflags) + for(auto & it : wflags) { flag = 0; for(size_t j{}; j < widgettypes_num; j++) { if(KviQString::equalCI(it, widgettypes_tbl[j])) { - flag=widgettypes_cod[j]; + flag = widgettypes_cod[j]; break; } } if(flag) sum = sum | flag; else - c->warning(__tr2qs_ctx("Unknown widget flag '%Q'","objects"),&it); + c->warning(__tr2qs_ctx("Unknown widget flag '%Q'", "objects"), &it); } widget()->setWindowFlags(sum); return true; } -KVSO_CLASS_FUNCTION(widget,setFont) +KVSO_CLASS_FUNCTION(widget, setFont) { CHECK_INTERNAL_POINTER(widget()) QString szFamily; QStringList szListStyle; kvs_int_t iSize; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("family",KVS_PT_STRING,0,szFamily) - KVSO_PARAMETER("size",KVS_PT_INTEGER,0,iSize) - KVSO_PARAMETER("style",KVS_PT_STRINGLIST,KVS_PF_OPTIONAL,szListStyle) + KVSO_PARAMETER("family", KVS_PT_STRING, 0, szFamily) + KVSO_PARAMETER("size", KVS_PT_INTEGER, 0, iSize) + KVSO_PARAMETER("style", KVS_PT_STRINGLIST, KVS_PF_OPTIONAL, szListStyle) KVSO_PARAMETERS_END(c) - QFont font=widget()->font(); - if(!szFamily.isEmpty()) font.setFamily(szFamily); - if(iSize) font.setPointSize(iSize); + QFont font = widget()->font(); + if(!szFamily.isEmpty()) + font.setFamily(szFamily); + if(iSize) + font.setPointSize(iSize); QString szStyle; - for(int i=0;iwarning(__tr2qs_ctx("Unknown style '%Q'","objects"),&szStyle); + szStyle = szListStyle.at(i); + if(KviQString::equalCI(szStyle, "italic")) + font.setItalic(true); + else if(KviQString::equalCI(szStyle, "bold")) + font.setBold(true); + else if(KviQString::equalCI(szStyle, "underline")) + font.setUnderline(true); + else if(KviQString::equalCI(szStyle, "overline")) + font.setOverline(true); + else if(KviQString::equalCI(szStyle, "strikeout")) + font.setStrikeOut(true); + else if(KviQString::equalCI(szStyle, "fixedpitch")) + font.setFixedPitch(true); + else + c->warning(__tr2qs_ctx("Unknown style '%Q'", "objects"), &szStyle); } widget()->setFont(font); return true; } -KVSO_CLASS_FUNCTION(widget,addWidgetToWrappedLayout) +KVSO_CLASS_FUNCTION(widget, addWidgetToWrappedLayout) { CHECK_INTERNAL_POINTER(widget()) - KviKvsObject *ob; - kvs_uint_t uCol,uRow; + KviKvsObject * ob; + kvs_uint_t uCol, uRow; kvs_hobject_t hObject; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("widget",KVS_PT_HOBJECT,0,hObject) - KVSO_PARAMETER("col",KVS_PT_UNSIGNEDINTEGER,0,uCol) - KVSO_PARAMETER("row",KVS_PT_UNSIGNEDINTEGER,0,uRow) + KVSO_PARAMETER("widget", KVS_PT_HOBJECT, 0, hObject) + KVSO_PARAMETER("col", KVS_PT_UNSIGNEDINTEGER, 0, uCol) + KVSO_PARAMETER("row", KVS_PT_UNSIGNEDINTEGER, 0, uRow) KVSO_PARAMETERS_END(c) - ob=KviKvsKernel::instance()->objectController()->lookupObject(hObject); - if (!ob) + ob = KviKvsKernel::instance()->objectController()->lookupObject(hObject); + if(!ob) { - c->warning(__tr2qs_ctx("Widget parameter is not an object","objects")); + c->warning(__tr2qs_ctx("Widget parameter is not an object", "objects")); return true; } - if (!ob->object()) + if(!ob->object()) { - c->warning(__tr2qs_ctx("Widget parameter is not a valid object","objects")); + c->warning(__tr2qs_ctx("Widget parameter is not a valid object", "objects")); return true; } - QLayout *lay=widget()->layout(); - if (!lay) + QLayout * lay = widget()->layout(); + if(!lay) { - c->warning(__tr2qs_ctx("No Layout associated to the widget ","objects")); + c->warning(__tr2qs_ctx("No Layout associated to the widget ", "objects")); return true; } if(!ob->object()->isWidgetType()) { - c->warning(__tr2qs_ctx("Can't add a non-widget object","objects")); + c->warning(__tr2qs_ctx("Can't add a non-widget object", "objects")); return true; } lay->addWidget(((QWidget *)(ob->object()))); return true; } -KVSO_CLASS_FUNCTION(widget,setParent) +KVSO_CLASS_FUNCTION(widget, setParent) { CHECK_INTERNAL_POINTER(widget()) - KviKvsObject *ob; + KviKvsObject * ob; kvs_hobject_t hObject; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("widget",KVS_PT_HOBJECT,KVS_PF_OPTIONAL,hObject) + KVSO_PARAMETER("widget", KVS_PT_HOBJECT, KVS_PF_OPTIONAL, hObject) KVSO_PARAMETERS_END(c) ob = KviKvsKernel::instance()->objectController()->lookupObject(hObject); @@ -1809,220 +1846,227 @@ KVSO_CLASS_FUNCTION(widget,setParent) widget()->setParent(0); return true; } - else - if(!ob->object()->isWidgetType()) + else if(!ob->object()->isWidgetType()) { - c->warning(__tr2qs_ctx("Parent must be a widget object","objects")); + c->warning(__tr2qs_ctx("Parent must be a widget object", "objects")); return true; } widget()->setParent(((QWidget *)(ob->object()))); return true; } -KVSO_CLASS_FUNCTION(widget,setWindowIcon) +KVSO_CLASS_FUNCTION(widget, setWindowIcon) { CHECK_INTERNAL_POINTER(widget()) QString icon; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("icon",KVS_PT_STRING,0,icon) + KVSO_PARAMETER("icon", KVS_PT_STRING, 0, icon) KVSO_PARAMETERS_END(c) QPixmap * pix = g_pIconManager->getImage(icon); - if(pix)widget()->setWindowIcon(QIcon(*pix)); + if(pix) + widget()->setWindowIcon(QIcon(*pix)); return true; } -KVSO_CLASS_FUNCTION(widget,setBackgroundImage) +KVSO_CLASS_FUNCTION(widget, setBackgroundImage) { CHECK_INTERNAL_POINTER(widget()) QString image; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("image",KVS_PT_STRING,0,image) + KVSO_PARAMETER("image", KVS_PT_STRING, 0, image) KVSO_PARAMETERS_END(c) QPixmap * pix = g_pIconManager->getImage(image); - if(pix){ - QPalette palette=widget()->palette(); + if(pix) + { + QPalette palette = widget()->palette(); palette.setBrush(widget()->backgroundRole(), QBrush(*pix)); widget()->setPalette(palette); } else { - c->warning(__tr2qs_ctx("The pixmap is not valid","objects")); + c->warning(__tr2qs_ctx("The pixmap is not valid", "objects")); return true; } return true; } -KVSO_CLASS_FUNCTION(widget,globalCursorX) +KVSO_CLASS_FUNCTION(widget, globalCursorX) { CHECK_INTERNAL_POINTER(widget()) c->returnValue()->setInteger(QCursor::pos().x()); return true; } -KVSO_CLASS_FUNCTION(widget,globalCursorY) +KVSO_CLASS_FUNCTION(widget, globalCursorY) { CHECK_INTERNAL_POINTER(widget()) c->returnValue()->setInteger(QCursor::pos().y()); return true; } -KVSO_CLASS_FUNCTION(widget,setMask) +KVSO_CLASS_FUNCTION(widget, setMask) { CHECK_INTERNAL_POINTER(widget()) - KviKvsObject *obj; + KviKvsObject * obj; kvs_hobject_t hObject; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("pixmap",KVS_PT_HOBJECT,0,hObject) + KVSO_PARAMETER("pixmap", KVS_PT_HOBJECT, 0, hObject) KVSO_PARAMETERS_END(c) - obj=KviKvsKernel::instance()->objectController()->lookupObject(hObject); - if (!obj) + obj = KviKvsKernel::instance()->objectController()->lookupObject(hObject); + if(!obj) { - c->warning(__tr2qs_ctx("Pixmap parameter is not an object","objects")); + c->warning(__tr2qs_ctx("Pixmap parameter is not an object", "objects")); return true; } - if (!obj->inheritsClass("pixmap")) + if(!obj->inheritsClass("pixmap")) { - c->warning(__tr2qs_ctx("Pixmap object required","objects")); + c->warning(__tr2qs_ctx("Pixmap object required", "objects")); return true; } - QPixmap * pm=((KvsObject_pixmap *)obj)->getPixmap(); + QPixmap * pm = ((KvsObject_pixmap *)obj)->getPixmap(); QBitmap mask(pm->mask()); - if (mask.isNull()) c->warning(__tr2qs_ctx("Null mask","objects")); + if(mask.isNull()) + c->warning(__tr2qs_ctx("Null mask", "objects")); widget()->setMask(mask); return true; } -KVSO_CLASS_FUNCTION(widget,setAttribute) +KVSO_CLASS_FUNCTION(widget, setAttribute) { CHECK_INTERNAL_POINTER(widget()) QString attribute; bool bFlag; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("widget_atribute",KVS_PT_STRING,0,attribute) - KVSO_PARAMETER("bool_flag",KVS_PT_BOOLEAN,0,bFlag) + KVSO_PARAMETER("widget_atribute", KVS_PT_STRING, 0, attribute) + KVSO_PARAMETER("bool_flag", KVS_PT_BOOLEAN, 0, bFlag) KVSO_PARAMETERS_END(c) - bool found=false; + bool found = false; unsigned int j = 0; for(; j < widgetattributes_num; j++) { if(KviQString::equalCI(attribute, widgetattributes_tbl[j])) { - found=true; + found = true; break; } } - if(found)widget()->setAttribute(widgetattributes_cod[j],bFlag); - else c->warning(__tr2qs_ctx("Unknown widget attribute '%Q'","objects"),&attribute); + if(found) + widget()->setAttribute(widgetattributes_cod[j], bFlag); + else + c->warning(__tr2qs_ctx("Unknown widget attribute '%Q'", "objects"), &attribute); return true; } -KVSO_CLASS_FUNCTION(widget,colorPalette) +KVSO_CLASS_FUNCTION(widget, colorPalette) { CHECK_INTERNAL_POINTER(widget()) - QString szColorRole,szColorGroup; + QString szColorRole, szColorGroup; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("color_role",KVS_PT_STRING,0,szColorRole) - KVSO_PARAMETER("color_group",KVS_PT_STRING,0,szColorGroup) + KVSO_PARAMETER("color_role", KVS_PT_STRING, 0, szColorRole) + KVSO_PARAMETER("color_group", KVS_PT_STRING, 0, szColorGroup) KVSO_PARAMETERS_END(c) - bool found=false; + bool found = false; unsigned int j = 0; for(; j < colorrole_num; j++) { if(KviQString::equalCI(szColorRole, colorrole_tbl[j])) { - found=true; + found = true; break; } } if(!found) { - c->warning(__tr2qs_ctx("Unknown Color Role '%Q'","objects"),&szColorRole); + c->warning(__tr2qs_ctx("Unknown Color Role '%Q'", "objects"), &szColorRole); return true; } QPalette::ColorGroup cg; - if (KviQString::equalCI(szColorGroup,"Disabled")) cg=QPalette::Disabled; - else if (KviQString::equalCI(szColorGroup,"Active")) cg=QPalette::Active; - else if (KviQString::equalCI(szColorGroup,"Inactive")) cg=QPalette::Inactive; + if(KviQString::equalCI(szColorGroup, "Disabled")) + cg = QPalette::Disabled; + else if(KviQString::equalCI(szColorGroup, "Active")) + cg = QPalette::Active; + else if(KviQString::equalCI(szColorGroup, "Inactive")) + cg = QPalette::Inactive; else { - c->warning(__tr2qs_ctx("Unknown Color Group '%Q'","objects"),&szColorGroup); + c->warning(__tr2qs_ctx("Unknown Color Group '%Q'", "objects"), &szColorGroup); return true; } - QColor col=widget()->palette().color(cg,colorrole_cod[j]); + QColor col = widget()->palette().color(cg, colorrole_cod[j]); KviKvsArray * a = new KviKvsArray(); - a->set(0,new KviKvsVariant((kvs_int_t)col.red())); - a->set(1,new KviKvsVariant((kvs_int_t)col.green())); - a->set(2,new KviKvsVariant((kvs_int_t)col.blue())); + a->set(0, new KviKvsVariant((kvs_int_t)col.red())); + a->set(1, new KviKvsVariant((kvs_int_t)col.green())); + a->set(2, new KviKvsVariant((kvs_int_t)col.blue())); c->returnValue()->setArray(a); return true; } -KVSO_CLASS_FUNCTION(widget,setStyleSheet) +KVSO_CLASS_FUNCTION(widget, setStyleSheet) { CHECK_INTERNAL_POINTER(widget()) QString szStyleSheet; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("style_sheet",KVS_PT_STRING,0,szStyleSheet) + KVSO_PARAMETER("style_sheet", KVS_PT_STRING, 0, szStyleSheet) KVSO_PARAMETERS_END(c) widget()->setStyleSheet(szStyleSheet); return true; } -KVSO_CLASS_FUNCTION(widget,setKeyShortcut) +KVSO_CLASS_FUNCTION(widget, setKeyShortcut) { CHECK_INTERNAL_POINTER(widget()) QString szKey; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("key",KVS_PT_STRING,0,szKey) + KVSO_PARAMETER("key", KVS_PT_STRING, 0, szKey) KVSO_PARAMETERS_END(c) szKey.prepend("&"); c->returnValue()->setInteger((kvs_int_t)widget()->grabShortcut(QKeySequence::mnemonic(szKey))); return true; } -KVSO_CLASS_FUNCTION(widget,insertIntoStatusBar) +KVSO_CLASS_FUNCTION(widget, insertIntoStatusBar) { CHECK_INTERNAL_POINTER(widget()) - if (g_pMainWindow->mainStatusBar()) - g_pMainWindow->mainStatusBar()->insertPermanentWidgetAtTheEnd(widget(),0); + if(g_pMainWindow->mainStatusBar()) + g_pMainWindow->mainStatusBar()->insertPermanentWidgetAtTheEnd(widget(), 0); return true; } -KVSO_CLASS_FUNCTION(widget,removeFromStatusBar) +KVSO_CLASS_FUNCTION(widget, removeFromStatusBar) { CHECK_INTERNAL_POINTER(widget()) g_pMainWindow->statusBar()->removeWidget(widget()); return true; } -KVSO_CLASS_FUNCTION(widget,grab) +KVSO_CLASS_FUNCTION(widget, grab) { qDebug("Grab"); CHECK_INTERNAL_POINTER(widget()) - KviKvsObject *ob; + KviKvsObject * ob; kvs_hobject_t hObject; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("widget",KVS_PT_HOBJECT,0,hObject) + KVSO_PARAMETER("widget", KVS_PT_HOBJECT, 0, hObject) KVSO_PARAMETERS_END(c) qDebug("Get widget"); - ob=KviKvsKernel::instance()->objectController()->lookupObject(hObject); - if (!ob) + ob = KviKvsKernel::instance()->objectController()->lookupObject(hObject); + if(!ob) { - c->warning(__tr2qs_ctx("Widget parameter is not an object","objects")); + c->warning(__tr2qs_ctx("Widget parameter is not an object", "objects")); return true; } qDebug("check widgetype"); if(!ob->object()->isWidgetType()) { - c->warning(__tr2qs_ctx("Widget object required","objects")); + c->warning(__tr2qs_ctx("Widget object required", "objects")); return true; } - QPixmap *pPixmap=new QPixmap(); + QPixmap * pPixmap = new QPixmap(); qDebug("grabbing"); - *pPixmap=QPixmap::grabWidget(((QWidget *)(ob->object()))); + *pPixmap = QPixmap::grabWidget(((QWidget *)(ob->object()))); KviKvsObjectClass * pClass = KviKvsKernel::instance()->objectController()->lookupClass("pixmap"); KviKvsVariantList params; - KviKvsObject * pObject = pClass->allocateInstance(0,"internalpixmap",c->context(),¶ms); + KviKvsObject * pObject = pClass->allocateInstance(0, "internalpixmap", c->context(), ¶ms); ((KvsObject_pixmap *)pObject)->setInternalPixmap(pPixmap); c->returnValue()->setHObject(pObject->handle()); return true; diff --git a/src/modules/objects/KvsObject_widget.h b/src/modules/objects/KvsObject_widget.h index 0f49ce25d..888aae80a 100644 --- a/src/modules/objects/KvsObject_widget.h +++ b/src/modules/objects/KvsObject_widget.h @@ -33,7 +33,7 @@ #include #ifdef COMPILE_WEBKIT_SUPPORT - #include +#include #endif class KvsObject_widget : public KviKvsObject @@ -46,14 +46,14 @@ public: QWidget * widget() { return (QWidget *)object(); }; protected: - virtual bool init(KviKvsRunTimeContext * pContext,KviKvsVariantList *pParams); + virtual bool init(KviKvsRunTimeContext * pContext, KviKvsVariantList * pParams); #ifdef COMPILE_WEBKIT_SUPPORT QWebView * m_pWebview; #endif - virtual bool eventFilter(QObject *o,QEvent *e); - KviKvsRunTimeContext *m_pContext; - QGraphicsDropShadowEffect *pGraphicsEffect; + virtual bool eventFilter(QObject * o, QEvent * e); + KviKvsRunTimeContext * m_pContext; + QGraphicsDropShadowEffect * pGraphicsEffect; // ok, it is clear that we're messing with the naming conventions for the // object classes :D // let's try to use this one: @@ -64,70 +64,70 @@ protected: // let's also try to keep alphabetic order for the functions here.. so one can find them quickly - bool addWidgetToWrappedLayout(KviKvsObjectFunctionCall *c); - bool backgroundColor(KviKvsObjectFunctionCall *c); - bool centerToScreen(KviKvsObjectFunctionCall *c); - bool colorPalette(KviKvsObjectFunctionCall *c); + bool addWidgetToWrappedLayout(KviKvsObjectFunctionCall * c); + bool backgroundColor(KviKvsObjectFunctionCall * c); + bool centerToScreen(KviKvsObjectFunctionCall * c); + bool colorPalette(KviKvsObjectFunctionCall * c); bool fontAscent(KviKvsObjectFunctionCall * c); bool fontDescent(KviKvsObjectFunctionCall * c); bool fontMetricsHeight(KviKvsObjectFunctionCall * c); bool fontMetricsWidth(KviKvsObjectFunctionCall * c); bool fontMetricsLineSpacing(KviKvsObjectFunctionCall * c); - bool foregroundColor(KviKvsObjectFunctionCall *c); - bool geometry(KviKvsObjectFunctionCall *c); - bool globalCursorX(KviKvsObjectFunctionCall *c); - bool globalCursorY(KviKvsObjectFunctionCall *c); - bool hasFocus(KviKvsObjectFunctionCall *c); + bool foregroundColor(KviKvsObjectFunctionCall * c); + bool geometry(KviKvsObjectFunctionCall * c); + bool globalCursorX(KviKvsObjectFunctionCall * c); + bool globalCursorY(KviKvsObjectFunctionCall * c); + bool hasFocus(KviKvsObjectFunctionCall * c); bool height(KviKvsObjectFunctionCall *); bool hide(KviKvsObjectFunctionCall *); - bool isEnabled(KviKvsObjectFunctionCall *c); - bool isTopLevel(KviKvsObjectFunctionCall *c); - bool isVisible(KviKvsObjectFunctionCall *c); - bool loadInterface(KviKvsObjectFunctionCall *c); + bool isEnabled(KviKvsObjectFunctionCall * c); + bool isTopLevel(KviKvsObjectFunctionCall * c); + bool isVisible(KviKvsObjectFunctionCall * c); + bool loadInterface(KviKvsObjectFunctionCall * c); bool lower(KviKvsObjectFunctionCall *); - bool mapFromGlobal(KviKvsObjectFunctionCall *c); - bool mapToGlobal(KviKvsObjectFunctionCall *c); - bool move(KviKvsObjectFunctionCall *c); - bool parentWidget(KviKvsObjectFunctionCall *c); + bool mapFromGlobal(KviKvsObjectFunctionCall * c); + bool mapToGlobal(KviKvsObjectFunctionCall * c); + bool move(KviKvsObjectFunctionCall * c); + bool parentWidget(KviKvsObjectFunctionCall * c); bool raise(KviKvsObjectFunctionCall *); - bool repaint(KviKvsObjectFunctionCall *c); - bool insertIntoStatusBar(KviKvsObjectFunctionCall *c); - bool removeFromStatusBar(KviKvsObjectFunctionCall *c); - bool setParent(KviKvsObjectFunctionCall *c); - bool resize(KviKvsObjectFunctionCall *c); + bool repaint(KviKvsObjectFunctionCall * c); + bool insertIntoStatusBar(KviKvsObjectFunctionCall * c); + bool removeFromStatusBar(KviKvsObjectFunctionCall * c); + bool setParent(KviKvsObjectFunctionCall * c); + bool resize(KviKvsObjectFunctionCall * c); bool screenResolution(KviKvsObjectFunctionCall * c); - bool setAttribute(KviKvsObjectFunctionCall *c); - bool setBackgroundColor(KviKvsObjectFunctionCall *c); - bool setBackgroundImage(KviKvsObjectFunctionCall *c); - bool setEnabled(KviKvsObjectFunctionCall *c); - bool setFocus(KviKvsObjectFunctionCall *c); - bool setFocusPolicy(KviKvsObjectFunctionCall *c); - bool setFont(KviKvsObjectFunctionCall *c); - bool setGeometry(KviKvsObjectFunctionCall *c); - bool setKeyShortcut(KviKvsObjectFunctionCall *c); - bool setMask(KviKvsObjectFunctionCall *c); - bool setMaximumHeight(KviKvsObjectFunctionCall *c); - bool setMaximumWidth(KviKvsObjectFunctionCall *c); - bool setMinimumHeight(KviKvsObjectFunctionCall *c); - bool setMinimumWidth(KviKvsObjectFunctionCall *c); - bool setMouseTracking(KviKvsObjectFunctionCall *c); - bool setForegroundColor(KviKvsObjectFunctionCall *c); - bool setStyleSheet(KviKvsObjectFunctionCall *c); + bool setAttribute(KviKvsObjectFunctionCall * c); + bool setBackgroundColor(KviKvsObjectFunctionCall * c); + bool setBackgroundImage(KviKvsObjectFunctionCall * c); + bool setEnabled(KviKvsObjectFunctionCall * c); + bool setFocus(KviKvsObjectFunctionCall * c); + bool setFocusPolicy(KviKvsObjectFunctionCall * c); + bool setFont(KviKvsObjectFunctionCall * c); + bool setGeometry(KviKvsObjectFunctionCall * c); + bool setKeyShortcut(KviKvsObjectFunctionCall * c); + bool setMask(KviKvsObjectFunctionCall * c); + bool setMaximumHeight(KviKvsObjectFunctionCall * c); + bool setMaximumWidth(KviKvsObjectFunctionCall * c); + bool setMinimumHeight(KviKvsObjectFunctionCall * c); + bool setMinimumWidth(KviKvsObjectFunctionCall * c); + bool setMouseTracking(KviKvsObjectFunctionCall * c); + bool setForegroundColor(KviKvsObjectFunctionCall * c); + bool setStyleSheet(KviKvsObjectFunctionCall * c); bool setToolTip(KviKvsObjectFunctionCall *); - bool setWindowIcon(KviKvsObjectFunctionCall *c); - bool setWindowTitle(KviKvsObjectFunctionCall *c); - bool setWFlags(KviKvsObjectFunctionCall *c); - bool show(KviKvsObjectFunctionCall *c); - bool sizeHint(KviKvsObjectFunctionCall *c); - bool update(KviKvsObjectFunctionCall *c); + bool setWindowIcon(KviKvsObjectFunctionCall * c); + bool setWindowTitle(KviKvsObjectFunctionCall * c); + bool setWFlags(KviKvsObjectFunctionCall * c); + bool show(KviKvsObjectFunctionCall * c); + bool sizeHint(KviKvsObjectFunctionCall * c); + bool update(KviKvsObjectFunctionCall * c); bool width(KviKvsObjectFunctionCall *); - bool windowTitle(KviKvsObjectFunctionCall *c); + bool windowTitle(KviKvsObjectFunctionCall * c); bool x(KviKvsObjectFunctionCall *); bool y(KviKvsObjectFunctionCall *); bool grab(KviKvsObjectFunctionCall *); #ifdef COMPILE_WEBKIT_SUPPORT - bool setWebView(KviKvsObjectFunctionCall *c); + bool setWebView(KviKvsObjectFunctionCall * c); #endif signals: @@ -139,10 +139,12 @@ class KviKvsWidget : public QWidget Q_OBJECT Q_PROPERTY(QSize sizeHint READ sizeHint) public: - KviKvsWidget(KvsObject_widget * ob,QWidget * par); + KviKvsWidget(KvsObject_widget * ob, QWidget * par); virtual ~KviKvsWidget(); + protected: KvsObject_widget * m_pObject; + public: QSize sizeHint() const; }; diff --git a/src/modules/objects/KvsObject_window.cpp b/src/modules/objects/KvsObject_window.cpp index 2f45829b7..34ede2ed8 100644 --- a/src/modules/objects/KvsObject_window.cpp +++ b/src/modules/objects/KvsObject_window.cpp @@ -22,7 +22,6 @@ // //============================================================================= - #include "KvsObject_window.h" #include "KviError.h" @@ -32,10 +31,8 @@ #include "KviLocale.h" #include "KviMainWindow.h" - - -KviKvsScriptWindowWindow::KviKvsScriptWindowWindow(const QString &szName) -: KviWindow(KviWindow::ScriptObject,szName) +KviKvsScriptWindowWindow::KviKvsScriptWindowWindow(const QString & szName) + : KviWindow(KviWindow::ScriptObject, szName) { m_pCentralWidget = 0; m_pIcon = 0; @@ -45,7 +42,7 @@ KviKvsScriptWindowWindow::~KviKvsScriptWindowWindow() { } -void KviKvsScriptWindowWindow::setCentralWidget(KvsObject_widget *o,QWidget * w) +void KviKvsScriptWindowWindow::setCentralWidget(KvsObject_widget * o, QWidget * w) { m_pCentralWidgetObject = o; m_pCentralWidget = w; @@ -54,7 +51,7 @@ void KviKvsScriptWindowWindow::setCentralWidget(KvsObject_widget *o,QWidget * w) void KviKvsScriptWindowWindow::resizeEvent(QResizeEvent *) { if(m_pCentralWidget) - m_pCentralWidget->setGeometry(0,0,width(),height()); + m_pCentralWidget->setGeometry(0, 0, width(), height()); } void KviKvsScriptWindowWindow::centralWidgetObjectDestroyed() @@ -69,11 +66,12 @@ void KviKvsScriptWindowWindow::centralWidgetDestroyed() m_pCentralWidgetObject = 0; } - QPixmap * KviKvsScriptWindowWindow::myIconPtr() { - if (m_pIcon) return m_pIcon; - else return g_pIconManager->getSmallIcon(KviIconManager::DefaultIcon); + if(m_pIcon) + return m_pIcon; + else + return g_pIconManager->getSmallIcon(KviIconManager::DefaultIcon); } /* @@ -99,74 +97,74 @@ QPixmap * KviKvsScriptWindowWindow::myIconPtr() @functions: */ -KVSO_BEGIN_REGISTERCLASS(KvsObject_window,"window","widget") - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_window,setWindowTitle) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_window,setIcon) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_window,setCentralWidget) +KVSO_BEGIN_REGISTERCLASS(KvsObject_window, "window", "widget") +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_window, setWindowTitle) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_window, setIcon) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_window, setCentralWidget) KVSO_END_REGISTERCLASS(KvsObject_window) -KVSO_BEGIN_CONSTRUCTOR(KvsObject_window,KvsObject_widget) +KVSO_BEGIN_CONSTRUCTOR(KvsObject_window, KvsObject_widget) KVSO_END_CONSTRUCTOR(KvsObject_window) - KVSO_BEGIN_DESTRUCTOR(KvsObject_window) - if(widget()) - g_pMainWindow->closeWindow(((KviKvsScriptWindowWindow *)widget())); +if(widget()) + g_pMainWindow->closeWindow(((KviKvsScriptWindowWindow *)widget())); KVSO_END_CONSTRUCTOR(KvsObject_window) -bool KvsObject_window::init(KviKvsRunTimeContext *,KviKvsVariantList *) +bool KvsObject_window::init(KviKvsRunTimeContext *, KviKvsVariantList *) { KviKvsScriptWindowWindow * w = new KviKvsScriptWindowWindow(getName()); setObject(w); - g_pMainWindow->addWindow(w,false); + g_pMainWindow->addWindow(w, false); //w->minimize(); // must be minimized before children are added, otherwise the focus handling goes nuts... return true; } -KVSO_CLASS_FUNCTION(window,setWindowTitle) +KVSO_CLASS_FUNCTION(window, setWindowTitle) { CHECK_INTERNAL_POINTER(widget()) QString szCaption; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("caption",KVS_PT_STRING,0,szCaption) + KVSO_PARAMETER("caption", KVS_PT_STRING, 0, szCaption) KVSO_PARAMETERS_END(c) ((KviKvsScriptWindowWindow *)widget())->setWindowTitleString(szCaption); return true; } -KVSO_CLASS_FUNCTION(window,setIcon) +KVSO_CLASS_FUNCTION(window, setIcon) { CHECK_INTERNAL_POINTER(widget()) QString szIcon; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("icon",KVS_PT_STRING,0,szIcon) + KVSO_PARAMETER("icon", KVS_PT_STRING, 0, szIcon) KVSO_PARAMETERS_END(c) QPixmap * pix = g_pIconManager->getImage(szIcon); - if(pix) ((KviKvsScriptWindowWindow *)widget())->setIcon(pix); + if(pix) + ((KviKvsScriptWindowWindow *)widget())->setIcon(pix); return true; } -KVSO_CLASS_FUNCTION(window,setCentralWidget) +KVSO_CLASS_FUNCTION(window, setCentralWidget) { CHECK_INTERNAL_POINTER(widget()) - KviKvsObject *ob; + KviKvsObject * ob; kvs_hobject_t hObject; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("widget",KVS_PT_HOBJECT,0,hObject) + KVSO_PARAMETER("widget", KVS_PT_HOBJECT, 0, hObject) KVSO_PARAMETERS_END(c) - ob=KviKvsKernel::instance()->objectController()->lookupObject(hObject); + ob = KviKvsKernel::instance()->objectController()->lookupObject(hObject); if(!ob->object()->isWidgetType()) { - c->warning(__tr2qs_ctx("Can't add a non-widget object","objects")); + c->warning(__tr2qs_ctx("Can't add a non-widget object", "objects")); return true; } if(!ob->inheritsClass("widget")) { - c->warning(__tr2qs_ctx("Can't add a non-widget object","objects")); + c->warning(__tr2qs_ctx("Can't add a non-widget object", "objects")); return true; } - ((KviKvsScriptWindowWindow *)widget())->setCentralWidget((KvsObject_widget *)ob,((KvsObject_widget *)ob)->widget()); + ((KviKvsScriptWindowWindow *)widget())->setCentralWidget((KvsObject_widget *)ob, ((KvsObject_widget *)ob)->widget()); return true; } diff --git a/src/modules/objects/KvsObject_window.h b/src/modules/objects/KvsObject_window.h index f05e29b97..172db20de 100644 --- a/src/modules/objects/KvsObject_window.h +++ b/src/modules/objects/KvsObject_window.h @@ -28,34 +28,33 @@ #include "KviWindow.h" #include "object_macros.h" - - class KviKvsScriptWindowWindow : public KviWindow { Q_OBJECT public: - KviKvsScriptWindowWindow(const QString &szName); + KviKvsScriptWindowWindow(const QString & szName); ~KviKvsScriptWindowWindow(); + protected: KvsObject_widget * m_pCentralWidgetObject; QWidget * m_pCentralWidget; QPixmap * m_pIcon; + public: virtual QPixmap * myIconPtr(); - void setIcon(QPixmap *pPixmap){m_pIcon = pPixmap;}; - void setCentralWidget(KvsObject_widget *o,QWidget * w); - void setWindowTitleString(const QString &s) + void setIcon(QPixmap * pPixmap) { m_pIcon = pPixmap; }; + void setCentralWidget(KvsObject_widget * o, QWidget * w); + void setWindowTitleString(const QString & s) { setFixedCaption(s); fillCaptionBuffers(); }; - virtual void resizeEvent(QResizeEvent *e); + virtual void resizeEvent(QResizeEvent * e); protected slots: void centralWidgetObjectDestroyed(); void centralWidgetDestroyed(); }; - class KvsObject_window : public KvsObject_widget { public: @@ -64,13 +63,11 @@ public: QWidget * widget() { return (QWidget *)object(); }; protected: - virtual bool init(KviKvsRunTimeContext * pContext,KviKvsVariantList *pParams); - - bool setWindowTitle(KviKvsObjectFunctionCall *c); - bool setIcon(KviKvsObjectFunctionCall *c); - bool setCentralWidget(KviKvsObjectFunctionCall *c); + virtual bool init(KviKvsRunTimeContext * pContext, KviKvsVariantList * pParams); + bool setWindowTitle(KviKvsObjectFunctionCall * c); + bool setIcon(KviKvsObjectFunctionCall * c); + bool setCentralWidget(KviKvsObjectFunctionCall * c); }; - -#endif // !_CLASS_WINDOW_H_ +#endif // !_CLASS_WINDOW_H_ diff --git a/src/modules/objects/KvsObject_wizard.cpp b/src/modules/objects/KvsObject_wizard.cpp index a4db80553..509ae7ecd 100644 --- a/src/modules/objects/KvsObject_wizard.cpp +++ b/src/modules/objects/KvsObject_wizard.cpp @@ -91,227 +91,224 @@ */ -KVSO_BEGIN_REGISTERCLASS(KvsObject_wizard,"wizard","widget") +KVSO_BEGIN_REGISTERCLASS(KvsObject_wizard, "wizard", "widget") - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_wizard,addPage) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_wizard,insertPage) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_wizard,setTitle) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_wizard, addPage) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_wizard, insertPage) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_wizard, setTitle) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_wizard,setBackEnabled); - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_wizard,setNextEnabled); - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_wizard,setFinishEnabled); - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_wizard,setHelpEnabled); +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_wizard, setBackEnabled); +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_wizard, setNextEnabled); +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_wizard, setFinishEnabled); +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_wizard, setHelpEnabled); - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_wizard,setBackBtnText); - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_wizard,setNextBtnText); - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_wizard,setFinishBtnText); - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_wizard,setHelpBtnText); - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_wizard,nextClickedEvent); - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_wizard,backClickedEvent); +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_wizard, setBackBtnText); +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_wizard, setNextBtnText); +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_wizard, setFinishBtnText); +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_wizard, setHelpBtnText); +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_wizard, nextClickedEvent); +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_wizard, backClickedEvent); - - KVSO_REGISTER_STANDARD_NOTHINGRETURN_HANDLER(KvsObject_wizard,"acceptEvent") - KVSO_REGISTER_STANDARD_NOTHINGRETURN_HANDLER(KvsObject_wizard,"rejectEvent") +KVSO_REGISTER_STANDARD_NOTHINGRETURN_HANDLER(KvsObject_wizard, "acceptEvent") +KVSO_REGISTER_STANDARD_NOTHINGRETURN_HANDLER(KvsObject_wizard, "rejectEvent") KVSO_END_REGISTERCLASS(KvsObject_wizard) -KVSO_BEGIN_CONSTRUCTOR(KvsObject_wizard,KvsObject_widget) +KVSO_BEGIN_CONSTRUCTOR(KvsObject_wizard, KvsObject_widget) KVSO_END_CONSTRUCTOR(KvsObject_wizard) - KVSO_BEGIN_DESTRUCTOR(KvsObject_wizard) KVSO_END_CONSTRUCTOR(KvsObject_wizard) -bool KvsObject_wizard::init(KviKvsRunTimeContext *,KviKvsVariantList *) +bool KvsObject_wizard::init(KviKvsRunTimeContext *, KviKvsVariantList *) { - setObject(new KviKvsMdmWizard(parentScriptWidget(), getName().toUtf8().data(),this), true); + setObject(new KviKvsMdmWizard(parentScriptWidget(), getName().toUtf8().data(), this), true); return true; } -KVSO_CLASS_FUNCTION(wizard,addPage) +KVSO_CLASS_FUNCTION(wizard, addPage) { CHECK_INTERNAL_POINTER(widget()) - KviKvsObject *ob; + KviKvsObject * ob; QString szLabel; kvs_hobject_t hObject; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("page_widget",KVS_PT_HOBJECT,0,hObject) - KVSO_PARAMETER("label",KVS_PT_STRING,0,szLabel) + KVSO_PARAMETER("page_widget", KVS_PT_HOBJECT, 0, hObject) + KVSO_PARAMETER("label", KVS_PT_STRING, 0, szLabel) KVSO_PARAMETERS_END(c) - ob=KviKvsKernel::instance()->objectController()->lookupObject(hObject); + ob = KviKvsKernel::instance()->objectController()->lookupObject(hObject); if(!ob->object()->isWidgetType()) { - c->warning(__tr2qs_ctx("Can't add a non-widget object","objects")); + c->warning(__tr2qs_ctx("Can't add a non-widget object", "objects")); return true; } - ((KviTalWizard *)widget())->addPage(((QWidget *)(ob->object())),szLabel); + ((KviTalWizard *)widget())->addPage(((QWidget *)(ob->object())), szLabel); return true; } -KVSO_CLASS_FUNCTION(wizard,insertPage) +KVSO_CLASS_FUNCTION(wizard, insertPage) { CHECK_INTERNAL_POINTER(widget()) - KviKvsObject *ob; + KviKvsObject * ob; QString szLabel; kvs_uint_t uIndex; kvs_hobject_t hObject; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("page_widget",KVS_PT_HOBJECT,0,hObject) - KVSO_PARAMETER("label",KVS_PT_STRING,0,szLabel) - KVSO_PARAMETER("index",KVS_PT_UNSIGNEDINTEGER,0,uIndex) + KVSO_PARAMETER("page_widget", KVS_PT_HOBJECT, 0, hObject) + KVSO_PARAMETER("label", KVS_PT_STRING, 0, szLabel) + KVSO_PARAMETER("index", KVS_PT_UNSIGNEDINTEGER, 0, uIndex) KVSO_PARAMETERS_END(c) - ob=KviKvsKernel::instance()->objectController()->lookupObject(hObject); + ob = KviKvsKernel::instance()->objectController()->lookupObject(hObject); if(!ob->object()->isWidgetType()) { - c->warning(__tr2qs_ctx("Can't add a non-widget object","objects")); + c->warning(__tr2qs_ctx("Can't add a non-widget object", "objects")); return true; } - ((KviTalWizard *)widget())->insertPage(((QWidget *)(ob->object())),szLabel,uIndex); + ((KviTalWizard *)widget())->insertPage(((QWidget *)(ob->object())), szLabel, uIndex); return true; } - -KVSO_CLASS_FUNCTION(wizard,setTitle) +KVSO_CLASS_FUNCTION(wizard, setTitle) { CHECK_INTERNAL_POINTER(widget()) - KviKvsObject *ob; + KviKvsObject * ob; QString szTitle; kvs_hobject_t hObject; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("page_widget",KVS_PT_HOBJECT,0,hObject) - KVSO_PARAMETER("title",KVS_PT_STRING,0,szTitle) + KVSO_PARAMETER("page_widget", KVS_PT_HOBJECT, 0, hObject) + KVSO_PARAMETER("title", KVS_PT_STRING, 0, szTitle) KVSO_PARAMETERS_END(c) - ob=KviKvsKernel::instance()->objectController()->lookupObject(hObject); + ob = KviKvsKernel::instance()->objectController()->lookupObject(hObject); if(!ob->object()->isWidgetType()) { - c->warning(__tr2qs_ctx("Widget object required","objects")); + c->warning(__tr2qs_ctx("Widget object required", "objects")); return true; } - ((KviTalWizard *)widget())->setPageTitle(((QWidget *)(ob->object())),szTitle); + ((KviTalWizard *)widget())->setPageTitle(((QWidget *)(ob->object())), szTitle); return true; } -KVSO_CLASS_FUNCTION(wizard,setBackEnabled) +KVSO_CLASS_FUNCTION(wizard, setBackEnabled) { CHECK_INTERNAL_POINTER(widget()) bool bEnabled; - KviKvsObject *ob; + KviKvsObject * ob; kvs_hobject_t hObject; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("page_widget",KVS_PT_HOBJECT,0,hObject) - KVSO_PARAMETER("bEnabled",KVS_PT_BOOL,0,bEnabled) + KVSO_PARAMETER("page_widget", KVS_PT_HOBJECT, 0, hObject) + KVSO_PARAMETER("bEnabled", KVS_PT_BOOL, 0, bEnabled) KVSO_PARAMETERS_END(c) - ob=KviKvsKernel::instance()->objectController()->lookupObject(hObject); + ob = KviKvsKernel::instance()->objectController()->lookupObject(hObject); if(!ob->object()->isWidgetType()) { - c->warning(__tr2qs_ctx("Widget object required","objects")); + c->warning(__tr2qs_ctx("Widget object required", "objects")); return true; } - ((KviTalWizard *)widget())->setBackEnabled(((QWidget *)(ob->object())),bEnabled); + ((KviTalWizard *)widget())->setBackEnabled(((QWidget *)(ob->object())), bEnabled); return true; } -KVSO_CLASS_FUNCTION(wizard,setNextEnabled) +KVSO_CLASS_FUNCTION(wizard, setNextEnabled) { CHECK_INTERNAL_POINTER(widget()) bool bEnabled; - KviKvsObject *ob; + KviKvsObject * ob; kvs_hobject_t hObject; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("page_widget",KVS_PT_HOBJECT,0,hObject) - KVSO_PARAMETER("bEnabled",KVS_PT_BOOL,0,bEnabled) + KVSO_PARAMETER("page_widget", KVS_PT_HOBJECT, 0, hObject) + KVSO_PARAMETER("bEnabled", KVS_PT_BOOL, 0, bEnabled) KVSO_PARAMETERS_END(c) - ob=KviKvsKernel::instance()->objectController()->lookupObject(hObject); + ob = KviKvsKernel::instance()->objectController()->lookupObject(hObject); if(!ob->object()->isWidgetType()) { - c->warning(__tr2qs_ctx("Widget object required","objects")); + c->warning(__tr2qs_ctx("Widget object required", "objects")); return true; } - ((KviTalWizard *)widget())->setNextEnabled(((QWidget *)(ob->object())),bEnabled); + ((KviTalWizard *)widget())->setNextEnabled(((QWidget *)(ob->object())), bEnabled); return true; } -KVSO_CLASS_FUNCTION(wizard,setFinishEnabled) +KVSO_CLASS_FUNCTION(wizard, setFinishEnabled) { CHECK_INTERNAL_POINTER(widget()) bool bEnabled; - KviKvsObject *ob; + KviKvsObject * ob; kvs_hobject_t hObject; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("page_widget",KVS_PT_HOBJECT,0,hObject) - KVSO_PARAMETER("bEnabled",KVS_PT_BOOL,0,bEnabled) + KVSO_PARAMETER("page_widget", KVS_PT_HOBJECT, 0, hObject) + KVSO_PARAMETER("bEnabled", KVS_PT_BOOL, 0, bEnabled) KVSO_PARAMETERS_END(c) - ob=KviKvsKernel::instance()->objectController()->lookupObject(hObject); + ob = KviKvsKernel::instance()->objectController()->lookupObject(hObject); if(!ob->object()->isWidgetType()) { - c->warning(__tr2qs_ctx("Widget object required","objects")); + c->warning(__tr2qs_ctx("Widget object required", "objects")); return true; } - ((KviTalWizard *)widget())->setFinishEnabled(((QWidget *)(ob->object())),bEnabled); + ((KviTalWizard *)widget())->setFinishEnabled(((QWidget *)(ob->object())), bEnabled); return true; } -KVSO_CLASS_FUNCTION(wizard,setHelpEnabled) +KVSO_CLASS_FUNCTION(wizard, setHelpEnabled) { CHECK_INTERNAL_POINTER(widget()) bool bEnabled; - KviKvsObject *ob; + KviKvsObject * ob; kvs_hobject_t hObject; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("page_widget",KVS_PT_HOBJECT,0,hObject) - KVSO_PARAMETER("bEnabled",KVS_PT_BOOL,0,bEnabled) + KVSO_PARAMETER("page_widget", KVS_PT_HOBJECT, 0, hObject) + KVSO_PARAMETER("bEnabled", KVS_PT_BOOL, 0, bEnabled) KVSO_PARAMETERS_END(c) - ob=KviKvsKernel::instance()->objectController()->lookupObject(hObject); + ob = KviKvsKernel::instance()->objectController()->lookupObject(hObject); if(!ob->object()->isWidgetType()) { - c->warning(__tr2qs_ctx("Widget object required","objects")); + c->warning(__tr2qs_ctx("Widget object required", "objects")); return true; } - ((KviTalWizard *)widget())->setHelpEnabled(((QWidget *)(ob->object())),bEnabled); + ((KviTalWizard *)widget())->setHelpEnabled(((QWidget *)(ob->object())), bEnabled); return true; } -KVSO_CLASS_FUNCTION(wizard,setBackBtnText) +KVSO_CLASS_FUNCTION(wizard, setBackBtnText) { CHECK_INTERNAL_POINTER(widget()) QString szText; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("text",KVS_PT_STRING,0,szText) + KVSO_PARAMETER("text", KVS_PT_STRING, 0, szText) KVSO_PARAMETERS_END(c) ((KviTalWizard *)widget())->KviTalWizard::backButton()->setText(szText); return true; } -KVSO_CLASS_FUNCTION(wizard,setNextBtnText) +KVSO_CLASS_FUNCTION(wizard, setNextBtnText) { CHECK_INTERNAL_POINTER(widget()) QString szText; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("text",KVS_PT_STRING,0,szText) + KVSO_PARAMETER("text", KVS_PT_STRING, 0, szText) KVSO_PARAMETERS_END(c) ((KviTalWizard *)widget())->KviTalWizard::nextButton()->setText(szText); return true; } -KVSO_CLASS_FUNCTION(wizard,setHelpBtnText) +KVSO_CLASS_FUNCTION(wizard, setHelpBtnText) { CHECK_INTERNAL_POINTER(widget()) QString szText; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("text",KVS_PT_STRING,0,szText) + KVSO_PARAMETER("text", KVS_PT_STRING, 0, szText) KVSO_PARAMETERS_END(c) ((KviTalWizard *)widget())->KviTalWizard::helpButton()->setText(szText); return true; } -KVSO_CLASS_FUNCTION(wizard,setFinishBtnText) +KVSO_CLASS_FUNCTION(wizard, setFinishBtnText) { CHECK_INTERNAL_POINTER(widget()) QString szText; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("text",KVS_PT_STRING,0,szText) + KVSO_PARAMETER("text", KVS_PT_STRING, 0, szText) KVSO_PARAMETERS_END(c) ((KviTalWizard *)widget())->KviTalWizard::finishButton()->setText(szText); return true; @@ -319,54 +316,54 @@ KVSO_CLASS_FUNCTION(wizard,setFinishBtnText) bool KvsObject_wizard::accept() { KviKvsVariantList * pParams = 0; - callFunction(this,"acceptEvent",0,pParams); + callFunction(this, "acceptEvent", 0, pParams); return true; } bool KvsObject_wizard::reject() { KviKvsVariantList * pParams = 0; - callFunction(this,"rejectEvent",0,pParams); + callFunction(this, "rejectEvent", 0, pParams); return true; } -KVSO_CLASS_FUNCTION(wizard,nextClickedEvent) +KVSO_CLASS_FUNCTION(wizard, nextClickedEvent) { - emitSignal("nextClicked",c); + emitSignal("nextClicked", c); return true; } void KvsObject_wizard::nextClicked() { - KviKvsVariantList *params=0; - callFunction(this,"nextClickedEvent",params); + KviKvsVariantList * params = 0; + callFunction(this, "nextClickedEvent", params); } -KVSO_CLASS_FUNCTION(wizard,backClickedEvent) +KVSO_CLASS_FUNCTION(wizard, backClickedEvent) { - emitSignal("backClicked",c); + emitSignal("backClicked", c); return true; } void KvsObject_wizard::backClicked() { - KviKvsVariantList *params=0; - callFunction(this,"backClickedEvent",params); + KviKvsVariantList * params = 0; + callFunction(this, "backClickedEvent", params); } -KviKvsMdmWizard::KviKvsMdmWizard(QWidget * par,const char * name,KvsObject_wizard * parent) -:KviTalWizard(par) +KviKvsMdmWizard::KviKvsMdmWizard(QWidget * par, const char * name, KvsObject_wizard * parent) + : KviTalWizard(par) { - m_pParentScript=parent; + m_pParentScript = parent; setObjectName(name); - connect (this->backButton(),SIGNAL(clicked()),this,SLOT(slotBackClicked())); - connect (this->nextButton(),SIGNAL(clicked()),this,SLOT(slotNextClicked())); + connect(this->backButton(), SIGNAL(clicked()), this, SLOT(slotBackClicked())); + connect(this->nextButton(), SIGNAL(clicked()), this, SLOT(slotNextClicked())); } void KviKvsMdmWizard::accept() { - if(m_pParentScript->accept())KviTalWizard::accept(); - + if(m_pParentScript->accept()) + KviTalWizard::accept(); } void KviKvsMdmWizard::reject() { - if(m_pParentScript->reject())KviTalWizard::reject(); - + if(m_pParentScript->reject()) + KviTalWizard::reject(); } void KviKvsMdmWizard::slotNextClicked() { diff --git a/src/modules/objects/KvsObject_wizard.h b/src/modules/objects/KvsObject_wizard.h index ec5ab8e06..976e25f93 100644 --- a/src/modules/objects/KvsObject_wizard.h +++ b/src/modules/objects/KvsObject_wizard.h @@ -40,41 +40,40 @@ public: void nextClicked(); void backClicked(); - protected: - virtual bool init(KviKvsRunTimeContext * pContext,KviKvsVariantList *pParams); - - bool addPage(KviKvsObjectFunctionCall *c); - bool insertPage(KviKvsObjectFunctionCall *c); - bool removePage(KviKvsObjectFunctionCall *c); - bool setTitle(KviKvsObjectFunctionCall *c); - bool setBackEnabled(KviKvsObjectFunctionCall *c); - bool setNextEnabled(KviKvsObjectFunctionCall *c); - bool setFinishEnabled(KviKvsObjectFunctionCall *c); - bool setHelpEnabled(KviKvsObjectFunctionCall *c); + virtual bool init(KviKvsRunTimeContext * pContext, KviKvsVariantList * pParams); - bool setBackBtnText(KviKvsObjectFunctionCall *c); - bool setNextBtnText(KviKvsObjectFunctionCall *c); - bool setFinishBtnText(KviKvsObjectFunctionCall *c); - bool setHelpBtnText(KviKvsObjectFunctionCall *c); + bool addPage(KviKvsObjectFunctionCall * c); + bool insertPage(KviKvsObjectFunctionCall * c); + bool removePage(KviKvsObjectFunctionCall * c); + bool setTitle(KviKvsObjectFunctionCall * c); + bool setBackEnabled(KviKvsObjectFunctionCall * c); + bool setNextEnabled(KviKvsObjectFunctionCall * c); + bool setFinishEnabled(KviKvsObjectFunctionCall * c); + bool setHelpEnabled(KviKvsObjectFunctionCall * c); - bool nextClickedEvent(KviKvsObjectFunctionCall *c); - bool backClickedEvent(KviKvsObjectFunctionCall *c); + bool setBackBtnText(KviKvsObjectFunctionCall * c); + bool setNextBtnText(KviKvsObjectFunctionCall * c); + bool setFinishBtnText(KviKvsObjectFunctionCall * c); + bool setHelpBtnText(KviKvsObjectFunctionCall * c); + bool nextClickedEvent(KviKvsObjectFunctionCall * c); + bool backClickedEvent(KviKvsObjectFunctionCall * c); }; -class KviKvsMdmWizard : public KviTalWizard +class KviKvsMdmWizard : public KviTalWizard { Q_OBJECT public: - KviKvsMdmWizard(QWidget * par,const char * name,KvsObject_wizard *); + KviKvsMdmWizard(QWidget * par, const char * name, KvsObject_wizard *); void accept(); void reject(); virtual ~KviKvsMdmWizard(); + protected: - KvsObject_wizard *m_pParentScript; + KvsObject_wizard * m_pParentScript; protected slots: void slotNextClicked(); void slotBackClicked(); }; -#endif //!_CLASS_WIZARD_H_ +#endif //!_CLASS_WIZARD_H_ diff --git a/src/modules/objects/KvsObject_workspace.cpp b/src/modules/objects/KvsObject_workspace.cpp index 3ec7346fa..c0413f703 100644 --- a/src/modules/objects/KvsObject_workspace.cpp +++ b/src/modules/objects/KvsObject_workspace.cpp @@ -23,7 +23,6 @@ // //============================================================================= - #include "KvsObject_workspace.h" #include "KviError.h" #include "kvi_debug.h" @@ -168,31 +167,31 @@ [/example] */ -KVSO_BEGIN_REGISTERCLASS(KvsObject_workspace,"workspace","widget") - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_workspace,addSubWindow); - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_workspace,removeSubWindow); - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_workspace,activeWindow); - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_workspace,scrollBarsEnabled); - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_workspace,setscrollBarsEnabled); - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_workspace,cascade); - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_workspace,tile); - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_workspace,closeActiveWindow); - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_workspace,closeAllWindows); - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_workspace,activateNextWindow); - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_workspace,activatePrevWindow); +KVSO_BEGIN_REGISTERCLASS(KvsObject_workspace, "workspace", "widget") +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_workspace, addSubWindow); +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_workspace, removeSubWindow); +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_workspace, activeWindow); +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_workspace, scrollBarsEnabled); +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_workspace, setscrollBarsEnabled); +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_workspace, cascade); +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_workspace, tile); +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_workspace, closeActiveWindow); +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_workspace, closeAllWindows); +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_workspace, activateNextWindow); +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_workspace, activatePrevWindow); KVSO_END_REGISTERCLASS(KvsObject_workspace) -KVSO_BEGIN_CONSTRUCTOR(KvsObject_workspace,KvsObject_widget) - pWidgetDict=new QHash; +KVSO_BEGIN_CONSTRUCTOR(KvsObject_workspace, KvsObject_widget) +pWidgetDict = new QHash; KVSO_END_CONSTRUCTOR(KvsObject_workspace) KVSO_BEGIN_DESTRUCTOR(KvsObject_workspace) - if (pWidgetDict) - { - pWidgetDict->clear(); - delete pWidgetDict; - pWidgetDict=0; - } +if(pWidgetDict) +{ + pWidgetDict->clear(); + delete pWidgetDict; + pWidgetDict = 0; +} KVSO_END_CONSTRUCTOR(KvsObject_workspace) bool KvsObject_workspace::init(KviKvsRunTimeContext *, KviKvsVariantList *) @@ -201,125 +200,128 @@ bool KvsObject_workspace::init(KviKvsRunTimeContext *, KviKvsVariantList *) return true; } -KVSO_CLASS_FUNCTION(workspace,addSubWindow) +KVSO_CLASS_FUNCTION(workspace, addSubWindow) { CHECK_INTERNAL_POINTER(widget()) KviKvsObject * pObject; kvs_hobject_t hObject; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("widget",KVS_PT_HOBJECT,0,hObject) + KVSO_PARAMETER("widget", KVS_PT_HOBJECT, 0, hObject) KVSO_PARAMETERS_END(c) - pObject=KviKvsKernel::instance()->objectController()->lookupObject(hObject); + pObject = KviKvsKernel::instance()->objectController()->lookupObject(hObject); CHECK_HOBJECT_IS_WIDGET(pObject) - QMdiSubWindow *pMdi=((QMdiArea *)object())->addSubWindow(((QWidget *)(pObject->object()))); - pWidgetDict->insert(hObject,pMdi); + QMdiSubWindow * pMdi = ((QMdiArea *)object())->addSubWindow(((QWidget *)(pObject->object()))); + pWidgetDict->insert(hObject, pMdi); ((QMdiArea *)object())->setActiveSubWindow(pMdi); return true; } -KVSO_CLASS_FUNCTION(workspace,removeSubWindow) +KVSO_CLASS_FUNCTION(workspace, removeSubWindow) { CHECK_INTERNAL_POINTER(widget()) KviKvsObject * pObject; kvs_hobject_t hObject; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("widget",KVS_PT_HOBJECT,0,hObject) + KVSO_PARAMETER("widget", KVS_PT_HOBJECT, 0, hObject) KVSO_PARAMETERS_END(c) - pObject=KviKvsKernel::instance()->objectController()->lookupObject(hObject); + pObject = KviKvsKernel::instance()->objectController()->lookupObject(hObject); CHECK_HOBJECT_IS_WIDGET(pObject) - QMdiSubWindow *pMdiSubWindow=pWidgetDict->value(hObject); + QMdiSubWindow * pMdiSubWindow = pWidgetDict->value(hObject); if(pMdiSubWindow) { ((QMdiArea *)object())->removeSubWindow(pMdiSubWindow); pWidgetDict->remove(hObject); - } else { - c->warning(__tr2qs_ctx("The widget must be a subwindow of this workspace","objects")); + } + else + { + c->warning(__tr2qs_ctx("The widget must be a subwindow of this workspace", "objects")); } return true; } -KVSO_CLASS_FUNCTION(workspace,cascade) +KVSO_CLASS_FUNCTION(workspace, cascade) { CHECK_INTERNAL_POINTER(widget()) ((QMdiArea *)widget())->cascadeSubWindows(); return true; } -KVSO_CLASS_FUNCTION(workspace,tile) +KVSO_CLASS_FUNCTION(workspace, tile) { CHECK_INTERNAL_POINTER(widget()) ((QMdiArea *)widget())->tileSubWindows(); return true; } -KVSO_CLASS_FUNCTION(workspace,closeActiveWindow) +KVSO_CLASS_FUNCTION(workspace, closeActiveWindow) { CHECK_INTERNAL_POINTER(widget()) ((QMdiArea *)widget())->closeActiveSubWindow(); return true; } -KVSO_CLASS_FUNCTION(workspace,closeAllWindows) +KVSO_CLASS_FUNCTION(workspace, closeAllWindows) { CHECK_INTERNAL_POINTER(widget()) ((QMdiArea *)widget())->closeAllSubWindows(); return true; } -KVSO_CLASS_FUNCTION(workspace,activateNextWindow) +KVSO_CLASS_FUNCTION(workspace, activateNextWindow) { CHECK_INTERNAL_POINTER(widget()) ((QMdiArea *)widget())->activateNextSubWindow(); return true; } -KVSO_CLASS_FUNCTION(workspace,activatePrevWindow) +KVSO_CLASS_FUNCTION(workspace, activatePrevWindow) { CHECK_INTERNAL_POINTER(widget()) ((QMdiArea *)widget())->activatePreviousSubWindow(); return true; } -KVSO_CLASS_FUNCTION(workspace,activeWindow) +KVSO_CLASS_FUNCTION(workspace, activeWindow) { CHECK_INTERNAL_POINTER(widget()) - QMdiSubWindow *pActiveMdi=((QMdiArea *)widget())->activeSubWindow(); - if (pActiveMdi) + QMdiSubWindow * pActiveMdi = ((QMdiArea *)widget())->activeSubWindow(); + if(pActiveMdi) { - QHashIterator t(*pWidgetDict); - while (t.hasNext()) + QHashIterator t(*pWidgetDict); + while(t.hasNext()) { t.next(); - kvs_hobject_t hObject=t.key(); - QMdiSubWindow *pMdi=t.value(); - if (pMdi==pActiveMdi) + kvs_hobject_t hObject = t.key(); + QMdiSubWindow * pMdi = t.value(); + if(pMdi == pActiveMdi) { c->returnValue()->setHObject(hObject); break; } } } - else c->returnValue()->setHObject((kvs_hobject_t)0); + else + c->returnValue()->setHObject((kvs_hobject_t)0); return true; } -KVSO_CLASS_FUNCTION(workspace,scrollBarsEnabled) +KVSO_CLASS_FUNCTION(workspace, scrollBarsEnabled) { CHECK_INTERNAL_POINTER(widget()) bool bEnabled; - if(((QMdiArea *)widget())->verticalScrollBarPolicy()!=Qt::ScrollBarAlwaysOff) - bEnabled=true; + if(((QMdiArea *)widget())->verticalScrollBarPolicy() != Qt::ScrollBarAlwaysOff) + bEnabled = true; else - bEnabled=false; + bEnabled = false; c->returnValue()->setBoolean(bEnabled); return true; } -KVSO_CLASS_FUNCTION(workspace,setscrollBarsEnabled) +KVSO_CLASS_FUNCTION(workspace, setscrollBarsEnabled) { CHECK_INTERNAL_POINTER(widget()) bool bEnabled; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("bEnabled",KVS_PT_BOOL,0,bEnabled) + KVSO_PARAMETER("bEnabled", KVS_PT_BOOL, 0, bEnabled) KVSO_PARAMETERS_END(c) if(bEnabled) { diff --git a/src/modules/objects/KvsObject_workspace.h b/src/modules/objects/KvsObject_workspace.h index 3657f3b56..3a8aa1c0a 100644 --- a/src/modules/objects/KvsObject_workspace.h +++ b/src/modules/objects/KvsObject_workspace.h @@ -35,21 +35,21 @@ public: public: QWidget * widget() { return (QWidget *)object(); }; protected: - QHash *pWidgetDict; - virtual bool init(KviKvsRunTimeContext * pContext,KviKvsVariantList *pParams); + QHash * pWidgetDict; + virtual bool init(KviKvsRunTimeContext * pContext, KviKvsVariantList * pParams); - bool addSubWindow(KviKvsObjectFunctionCall *c); - bool removeSubWindow(KviKvsObjectFunctionCall *c); - bool cascade(KviKvsObjectFunctionCall *c); - bool tile(KviKvsObjectFunctionCall *c); - bool closeActiveWindow(KviKvsObjectFunctionCall *c); - bool closeAllWindows(KviKvsObjectFunctionCall *c); - bool activateNextWindow(KviKvsObjectFunctionCall *c); - bool activatePrevWindow(KviKvsObjectFunctionCall *c); - bool scrollBarsEnabled(KviKvsObjectFunctionCall *c); - bool setscrollBarsEnabled(KviKvsObjectFunctionCall *c); + bool addSubWindow(KviKvsObjectFunctionCall * c); + bool removeSubWindow(KviKvsObjectFunctionCall * c); + bool cascade(KviKvsObjectFunctionCall * c); + bool tile(KviKvsObjectFunctionCall * c); + bool closeActiveWindow(KviKvsObjectFunctionCall * c); + bool closeAllWindows(KviKvsObjectFunctionCall * c); + bool activateNextWindow(KviKvsObjectFunctionCall * c); + bool activatePrevWindow(KviKvsObjectFunctionCall * c); + bool scrollBarsEnabled(KviKvsObjectFunctionCall * c); + bool setscrollBarsEnabled(KviKvsObjectFunctionCall * c); - bool activeWindow(KviKvsObjectFunctionCall *c); + bool activeWindow(KviKvsObjectFunctionCall * c); }; -#endif //!_CLASS_WORKSPACE_H_ +#endif //!_CLASS_WORKSPACE_H_ diff --git a/src/modules/objects/KvsObject_wrapper.cpp b/src/modules/objects/KvsObject_wrapper.cpp index 2e73a61a1..585014d5e 100644 --- a/src/modules/objects/KvsObject_wrapper.cpp +++ b/src/modules/objects/KvsObject_wrapper.cpp @@ -155,32 +155,31 @@ Experiment with it :) */ -KVSO_BEGIN_REGISTERCLASS(KvsObject_wrapper,"wrapper","widget") +KVSO_BEGIN_REGISTERCLASS(KvsObject_wrapper, "wrapper", "widget") KVSO_END_REGISTERCLASS(KvsObject_wrapper) -KVSO_BEGIN_CONSTRUCTOR(KvsObject_wrapper,KvsObject_widget) +KVSO_BEGIN_CONSTRUCTOR(KvsObject_wrapper, KvsObject_widget) KVSO_END_CONSTRUCTOR(KvsObject_wrapper) - KVSO_BEGIN_DESTRUCTOR(KvsObject_wrapper) KVSO_END_CONSTRUCTOR(KvsObject_wrapper) -bool KvsObject_wrapper::init(KviKvsRunTimeContext * pContext,KviKvsVariantList *pParams) +bool KvsObject_wrapper::init(KviKvsRunTimeContext * pContext, KviKvsVariantList * pParams) { if(!pParams) return false; - QWidget *pWidget = NULL; + QWidget * pWidget = NULL; unsigned int i = 0; while(i < pParams->count()) { QString szClass; QString szName; - QString s=0; + QString s = 0; pParams->at(i)->asString(s); i++; @@ -192,11 +191,11 @@ bool KvsObject_wrapper::init(KviKvsRunTimeContext * pContext,KviKvsVariantList * if(s.startsWith("*")) { - s.remove(0,1); + s.remove(0, 1); bRecursive = true; if(s.isEmpty()) { - pContext->error(__tr2qs_ctx("The search specifier can't be empty","objects")); + pContext->error(__tr2qs_ctx("The search specifier can't be empty", "objects")); return false; } } @@ -205,27 +204,28 @@ bool KvsObject_wrapper::init(KviKvsRunTimeContext * pContext,KviKvsVariantList * if(idx != -1) { szClass = s.left(idx); - szName = s.right(s.length() - idx - 2); - } else { + szName = s.right(s.length() - idx - 2); + } + else + { szClass = s; - szName = ""; + szName = ""; } if( - KviQString::equalCI(szClass,"!Window") || - KviQString::equalCI(szClass,"WinId") // compat - ) + KviQString::equalCI(szClass, "!Window") || KviQString::equalCI(szClass, "WinId") // compat + ) { if(pWidget) - pContext->warning(__tr2qs_ctx("The window identifier preceded by '!Window' should be the first in the search path","objects")); + pContext->warning(__tr2qs_ctx("The window identifier preceded by '!Window' should be the first in the search path", "objects")); pWidget = g_pApp->findWindow(szName); - - } else if(KviQString::equalCI(szClass,"!Parent")) + } + else if(KviQString::equalCI(szClass, "!Parent")) { if(!pWidget) { - pContext->warning(__tr2qs_ctx("The '!Parent' specifier can't be used as first in the search path","objects")); + pContext->warning(__tr2qs_ctx("The '!Parent' specifier can't be used as first in the search path", "objects")); return false; } @@ -236,7 +236,7 @@ bool KvsObject_wrapper::init(KviKvsRunTimeContext * pContext,KviKvsVariantList * int iLevels = szName.toInt(&ok); if(!ok) { - pContext->warning(__tr2qs_ctx("Bad number of levels for the '!Parent' specifier","objects")); + pContext->warning(__tr2qs_ctx("Bad number of levels for the '!Parent' specifier", "objects")); return false; } } @@ -247,62 +247,59 @@ bool KvsObject_wrapper::init(KviKvsRunTimeContext * pContext,KviKvsVariantList * if(!pWidget) { - pContext->warning(__tr2qs_ctx("The '!Parent' specifier was applied to a widget that has no parent","objects")); + pContext->warning(__tr2qs_ctx("The '!Parent' specifier was applied to a widget that has no parent", "objects")); return false; } iLevels--; } - } else { + } + else + { if(pWidget) - pWidget = findWidgetToWrap(szClass,szName,pWidget,bRecursive); + pWidget = findWidgetToWrap(szClass, szName, pWidget, bRecursive); else - pWidget = findTopLevelWidgetToWrap(szClass,szName,bRecursive); + pWidget = findTopLevelWidgetToWrap(szClass, szName, bRecursive); } if(!pWidget) { - pContext->error(__tr2qs_ctx("Failed to find one of the wrap path widgets ('%Q::%Q')","objects"),&szClass,&szName); + pContext->error(__tr2qs_ctx("Failed to find one of the wrap path widgets ('%Q::%Q')", "objects"), &szClass, &szName); return false; } } if(!pWidget) { - pContext->error(__tr2qs_ctx("Failed to find the widget to wrap","objects")); + pContext->error(__tr2qs_ctx("Failed to find the widget to wrap", "objects")); return false; } - setObject(pWidget,false); + setObject(pWidget, false); return true; } -QWidget * KvsObject_wrapper::findTopLevelWidgetToWrap(const QString &szClass,const QString &szName,bool bRecursive) +QWidget * KvsObject_wrapper::findTopLevelWidgetToWrap(const QString & szClass, const QString & szName, bool bRecursive) { QWidgetList list = g_pApp->topLevelWidgets(); if(list.isEmpty()) return NULL; - Q_FOREACH(QWidget * w,list) + Q_FOREACH(QWidget * w, list) { //qDebug("TLW: %s::%s (look for %s::%s)",w->metaObject()->className(),w->objectName().toUtf8().data(),szClass.toUtf8().data(),szName.toUtf8().data()); if( - ( - szClass.isEmpty() || - KviQString::equalCI(w->metaObject()->className(),szClass) - ) && ( - szName.isEmpty() || - KviQString::equalCI(w->objectName(),szName) - ) - ) + ( + szClass.isEmpty() || KviQString::equalCI(w->metaObject()->className(), szClass)) + && (szName.isEmpty() || KviQString::equalCI(w->objectName(), szName))) return w; } if(bRecursive) { - Q_FOREACH(QWidget * w,list) + Q_FOREACH(QWidget * w, list) { - w = findWidgetToWrap(szClass,szName,w,bRecursive); + w = findWidgetToWrap(szClass, szName, w, bRecursive); if(w) return w; } @@ -311,38 +308,33 @@ QWidget * KvsObject_wrapper::findTopLevelWidgetToWrap(const QString &szClass,con return NULL; } -QWidget * KvsObject_wrapper::findWidgetToWrap(const QString &szClass, const QString &szName, QWidget *pParent,bool bRecursive) +QWidget * KvsObject_wrapper::findWidgetToWrap(const QString & szClass, const QString & szName, QWidget * pParent, bool bRecursive) { QList list = pParent->children(); if(list.isEmpty()) return NULL; - Q_FOREACH(QObject * obj,list) + Q_FOREACH(QObject * obj, list) { if(!obj->isWidgetType()) continue; - QWidget *w = (QWidget *)obj; + QWidget * w = (QWidget *)obj; if( - ( - szClass.isEmpty() || - KviQString::equalCI(w->metaObject()->className(),szClass) - ) && ( - szName.isEmpty() || - KviQString::equalCI(w->objectName(),szName) - ) - ) + ( + szClass.isEmpty() || KviQString::equalCI(w->metaObject()->className(), szClass)) + && (szName.isEmpty() || KviQString::equalCI(w->objectName(), szName))) return w; } if(bRecursive) { - Q_FOREACH(QObject * obj,list) + Q_FOREACH(QObject * obj, list) { if(!obj->isWidgetType()) continue; - QWidget * w = findWidgetToWrap(szClass,szName,(QWidget *)obj,bRecursive); + QWidget * w = findWidgetToWrap(szClass, szName, (QWidget *)obj, bRecursive); if(w) return w; } diff --git a/src/modules/objects/KvsObject_wrapper.h b/src/modules/objects/KvsObject_wrapper.h index 813373401..523ffe6c6 100644 --- a/src/modules/objects/KvsObject_wrapper.h +++ b/src/modules/objects/KvsObject_wrapper.h @@ -28,9 +28,6 @@ #include "KvsObject_widget.h" #include "qlistview.h" - - - #include "object_macros.h" class KvsObject_wrapper : public KvsObject_widget @@ -40,12 +37,9 @@ public: public: QWidget * widget() { return (QWidget *)object(); }; protected: - virtual bool init(KviKvsRunTimeContext * pContext,KviKvsVariantList *pParams); - QWidget * findTopLevelWidgetToWrap(const QString &szClass, const QString &szName,bool bRecursive); - QWidget * findWidgetToWrap(const QString &szClass, const QString &szName, QWidget *pParent,bool bRecursive); - + virtual bool init(KviKvsRunTimeContext * pContext, KviKvsVariantList * pParams); + QWidget * findTopLevelWidgetToWrap(const QString & szClass, const QString & szName, bool bRecursive); + QWidget * findWidgetToWrap(const QString & szClass, const QString & szName, QWidget * pParent, bool bRecursive); }; - - -#endif //!_CLASS_WRAPPER_H_ +#endif //!_CLASS_WRAPPER_H_ diff --git a/src/modules/objects/KvsObject_xmlreader.cpp b/src/modules/objects/KvsObject_xmlreader.cpp index bda202b57..6cdd96b54 100644 --- a/src/modules/objects/KvsObject_xmlreader.cpp +++ b/src/modules/objects/KvsObject_xmlreader.cpp @@ -124,6 +124,7 @@ class KviXmlHandler : public QXmlDefaultHandler protected: KvsObject_xmlReader * m_pReader; QString m_szErrorString; + public: KviXmlHandler(KvsObject_xmlReader * pReader) { @@ -132,23 +133,24 @@ public: ~KviXmlHandler() { } + private: bool kvsCodeFailure() { - m_szErrorString = __tr2qs_ctx("Error in KVS class implementation: processing aborted","objects"); + m_szErrorString = __tr2qs_ctx("Error in KVS class implementation: processing aborted", "objects"); return false; } bool kvsCodeAbort() { - m_szErrorString = __tr2qs_ctx("Processing aborted","objects"); + m_szErrorString = __tr2qs_ctx("Processing aborted", "objects"); return false; } - void decodeException(QString &szMsg,bool bError,const QXmlParseException &exception) + void decodeException(QString & szMsg, bool bError, const QXmlParseException & exception) { if(bError) - szMsg = QString(__tr2qs_ctx("Error near line %1, column %2","objects")).arg(exception.lineNumber()).arg(exception.columnNumber()); + szMsg = QString(__tr2qs_ctx("Error near line %1, column %2", "objects")).arg(exception.lineNumber()).arg(exception.columnNumber()); else - szMsg = QString(__tr2qs_ctx("Warning near line %1, column %2","objects")).arg(exception.lineNumber()).arg(exception.columnNumber()); + szMsg = QString(__tr2qs_ctx("Warning near line %1, column %2", "objects")).arg(exception.lineNumber()).arg(exception.columnNumber()); szMsg += ": "; szMsg += exception.message(); } @@ -158,11 +160,12 @@ private: return kvsCodeAbort(); return true; } + public: virtual bool startDocument() { KviKvsVariant ret; - if(!m_pReader->callFunction(m_pReader,"onDocumentStart",&ret)) + if(!m_pReader->callFunction(m_pReader, "onDocumentStart", &ret)) return kvsCodeFailure(); return handleKvsCallReturnValue(&ret); } @@ -170,12 +173,12 @@ public: virtual bool endDocument() { KviKvsVariant ret; - if(!m_pReader->callFunction(m_pReader,"onDocumentEnd",&ret)) + if(!m_pReader->callFunction(m_pReader, "onDocumentEnd", &ret)) return kvsCodeFailure(); return handleKvsCallReturnValue(&ret); } - virtual bool startElement(const QString &szNamespaceUri,const QString &szLocalName,const QString &szQualifiedName,const QXmlAttributes &attrs) + virtual bool startElement(const QString & szNamespaceUri, const QString & szLocalName, const QString & szQualifiedName, const QXmlAttributes & attrs) { KviKvsVariant ret; KviKvsVariantList par; @@ -186,14 +189,14 @@ public: par.append(new KviKvsVariant(szNamespaceUri)); par.append(new KviKvsVariant(szLocalName)); int c = attrs.count(); - for(int i=0;iset(attrs.qName(i),new KviKvsVariant(attrs.value(i))); - if(!m_pReader->callFunction(m_pReader,"onElementStart",&ret,&par)) + for(int i = 0; i < c; i++) + pHash->set(attrs.qName(i), new KviKvsVariant(attrs.value(i))); + if(!m_pReader->callFunction(m_pReader, "onElementStart", &ret, &par)) return kvsCodeFailure(); return handleKvsCallReturnValue(&ret); } - virtual bool endElement(const QString &szNamespaceUri,const QString &szLocalName,const QString &szQualifiedName) + virtual bool endElement(const QString & szNamespaceUri, const QString & szLocalName, const QString & szQualifiedName) { KviKvsVariant ret; KviKvsVariantList par; @@ -201,56 +204,56 @@ public: par.append(new KviKvsVariant(szQualifiedName)); par.append(new KviKvsVariant(szNamespaceUri)); par.append(new KviKvsVariant(szLocalName)); - if(!m_pReader->callFunction(m_pReader,"onElementEnd",&ret,&par)) + if(!m_pReader->callFunction(m_pReader, "onElementEnd", &ret, &par)) return kvsCodeFailure(); return handleKvsCallReturnValue(&ret); } - virtual bool characters(const QString &szChars) + virtual bool characters(const QString & szChars) { KviKvsVariant ret; KviKvsVariantList par; par.setAutoDelete(true); par.append(new KviKvsVariant(szChars)); - if(!m_pReader->callFunction(m_pReader,"onText",&ret,&par)) + if(!m_pReader->callFunction(m_pReader, "onText", &ret, &par)) return kvsCodeFailure(); return handleKvsCallReturnValue(&ret); } - virtual bool warning(const QXmlParseException &exception) + virtual bool warning(const QXmlParseException & exception) { // recoverable QString szMsg; - decodeException(szMsg,false,exception); + decodeException(szMsg, false, exception); KviKvsVariant ret; KviKvsVariantList par; par.setAutoDelete(true); par.append(new KviKvsVariant(szMsg)); - if(!m_pReader->callFunction(m_pReader,"onWarning",&ret,&par)) + if(!m_pReader->callFunction(m_pReader, "onWarning", &ret, &par)) return kvsCodeFailure(); return handleKvsCallReturnValue(&ret); } - virtual bool error(const QXmlParseException &exception) + virtual bool error(const QXmlParseException & exception) { // recoverable QString szMsg; - decodeException(szMsg,false,exception); + decodeException(szMsg, false, exception); KviKvsVariant ret; KviKvsVariantList par; par.setAutoDelete(true); par.append(new KviKvsVariant(szMsg)); - if(!m_pReader->callFunction(m_pReader,"onWarning",&ret,&par)) + if(!m_pReader->callFunction(m_pReader, "onWarning", &ret, &par)) return kvsCodeFailure(); return handleKvsCallReturnValue(&ret); } - virtual bool fatalError(const QXmlParseException &exception) + virtual bool fatalError(const QXmlParseException & exception) { QString szMsg; - decodeException(szMsg,true,exception); + decodeException(szMsg, true, exception); m_pReader->fatalError(szMsg); return true; } @@ -263,68 +266,67 @@ public: #endif // !QT_NO_XML +KVSO_BEGIN_REGISTERCLASS(KvsObject_xmlReader, "xmlreader", "object") +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_xmlReader, lastError) +KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_xmlReader, parse) -KVSO_BEGIN_REGISTERCLASS(KvsObject_xmlReader,"xmlreader","object") - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_xmlReader,lastError) - KVSO_REGISTER_HANDLER_BY_NAME(KvsObject_xmlReader,parse) - - KVSO_REGISTER_STANDARD_TRUERETURN_HANDLER(KvsObject_xmlReader,"onDocumentStart") - KVSO_REGISTER_STANDARD_TRUERETURN_HANDLER(KvsObject_xmlReader,"onDocumentEnd") - KVSO_REGISTER_STANDARD_TRUERETURN_HANDLER(KvsObject_xmlReader,"onElementStart") - KVSO_REGISTER_STANDARD_TRUERETURN_HANDLER(KvsObject_xmlReader,"onElementEnd") - KVSO_REGISTER_STANDARD_TRUERETURN_HANDLER(KvsObject_xmlReader,"onText") - KVSO_REGISTER_STANDARD_TRUERETURN_HANDLER(KvsObject_xmlReader,"onWarning") - KVSO_REGISTER_STANDARD_TRUERETURN_HANDLER(KvsObject_xmlReader,"onError") +KVSO_REGISTER_STANDARD_TRUERETURN_HANDLER(KvsObject_xmlReader, "onDocumentStart") +KVSO_REGISTER_STANDARD_TRUERETURN_HANDLER(KvsObject_xmlReader, "onDocumentEnd") +KVSO_REGISTER_STANDARD_TRUERETURN_HANDLER(KvsObject_xmlReader, "onElementStart") +KVSO_REGISTER_STANDARD_TRUERETURN_HANDLER(KvsObject_xmlReader, "onElementEnd") +KVSO_REGISTER_STANDARD_TRUERETURN_HANDLER(KvsObject_xmlReader, "onText") +KVSO_REGISTER_STANDARD_TRUERETURN_HANDLER(KvsObject_xmlReader, "onWarning") +KVSO_REGISTER_STANDARD_TRUERETURN_HANDLER(KvsObject_xmlReader, "onError") KVSO_END_REGISTERCLASS(KvsObject_xmlReader) -KVSO_BEGIN_CONSTRUCTOR(KvsObject_xmlReader,KviKvsObject) +KVSO_BEGIN_CONSTRUCTOR(KvsObject_xmlReader, KviKvsObject) KVSO_END_CONSTRUCTOR(KvsObject_xmlReader) KVSO_BEGIN_DESTRUCTOR(KvsObject_xmlReader) KVSO_END_DESTRUCTOR(KvsObject_xmlReader) -void KvsObject_xmlReader::fatalError(const QString &szError) +void KvsObject_xmlReader::fatalError(const QString & szError) { m_szLastError = szError; KviKvsVariantList vArgs; vArgs.append(new KviKvsVariant(m_szLastError)); - callFunction(this,"onError",&vArgs); + callFunction(this, "onError", &vArgs); } -KVSO_CLASS_FUNCTION(xmlReader,parse) +KVSO_CLASS_FUNCTION(xmlReader, parse) { KviKvsVariant * pVariantData; KVSO_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("string_or_memorybuffer_object",KVS_PT_VARIANT,0,pVariantData) + KVSO_PARAMETER("string_or_memorybuffer_object", KVS_PT_VARIANT, 0, pVariantData) KVSO_PARAMETERS_END(c) - #ifdef QT_NO_XML +#ifdef QT_NO_XML fatalError(__tr2qs_ctx("XML support not available in the Qt library")); c->returnValue()->setBoolean(false); - #else +#else m_szLastError = ""; KviXmlHandler handler(this); QXmlInputSource source; - if (pVariantData->isHObject()) + if(pVariantData->isHObject()) { KviKvsObject * pObject; kvs_hobject_t hObject; pVariantData->asHObject(hObject); - pObject=KviKvsKernel::instance()->objectController()->lookupObject(hObject); - if (!pObject) + pObject = KviKvsKernel::instance()->objectController()->lookupObject(hObject); + if(!pObject) { - c->warning(__tr2qs_ctx("Data parameter is not an object","objects")); + c->warning(__tr2qs_ctx("Data parameter is not an object", "objects")); return true; } - if (pObject->inheritsClass("memorybuffer")) + if(pObject->inheritsClass("memorybuffer")) { source.setData(*((KvsObject_memoryBuffer *)pObject)->pBuffer()); } else { - c->warning(__tr2qs_ctx("Data parameter is not a memorybuffer object","objects")); + c->warning(__tr2qs_ctx("Data parameter is not a memorybuffer object", "objects")); return true; } } @@ -343,7 +345,7 @@ KVSO_CLASS_FUNCTION(xmlReader,parse) } else { - c->warning(__tr2qs_ctx("Data is not a memorybuffer object or string","objects")); + c->warning(__tr2qs_ctx("Data is not a memorybuffer object or string", "objects")); return true; } QXmlSimpleReader reader; @@ -354,7 +356,7 @@ KVSO_CLASS_FUNCTION(xmlReader,parse) return true; } -KVSO_CLASS_FUNCTION(xmlReader,lastError) +KVSO_CLASS_FUNCTION(xmlReader, lastError) { c->returnValue()->setString(m_szLastError); return true; diff --git a/src/modules/objects/KvsObject_xmlreader.h b/src/modules/objects/KvsObject_xmlreader.h index ea9b38ff1..4f23ab12a 100644 --- a/src/modules/objects/KvsObject_xmlreader.h +++ b/src/modules/objects/KvsObject_xmlreader.h @@ -34,10 +34,11 @@ class KvsObject_xmlReader : public KviKvsObject public: KVSO_DECLARE_OBJECT(KvsObject_xmlReader) public: - bool parse(KviKvsObjectFunctionCall *c); - bool lastError(KviKvsObjectFunctionCall *c); + bool parse(KviKvsObjectFunctionCall * c); + bool lastError(KviKvsObjectFunctionCall * c); + + void fatalError(const QString & szError); - void fatalError(const QString &szError); protected: QString m_szLastError; }; diff --git a/src/modules/objects/libkviobjects.cpp b/src/modules/objects/libkviobjects.cpp index caf3f8a04..99c348974 100644 --- a/src/modules/objects/libkviobjects.cpp +++ b/src/modules/objects/libkviobjects.cpp @@ -77,7 +77,6 @@ #include "KvsObject_sql.h" #include "KvsObject_dateTimeEdit.h" - #include "KviIconManager.h" #include "KviWindow.h" #include "kvi_out.h" @@ -94,16 +93,15 @@ #include #include - -static void dumpChildObjects(KviWindow *pWnd, QObject *parent, const char *spacing, bool bWidgetsOnly, KviKvsArray *n, int &idx); +static void dumpChildObjects(KviWindow * pWnd, QObject * parent, const char * spacing, bool bWidgetsOnly, KviKvsArray * n, int & idx); static bool objects_module_cleanup(KviModule *) { - // Don't attempt to change the order of these calls. - // Derived classes must be unregistered before the base ones. - #if defined(COMPILE_WEBKIT_SUPPORT) +// Don't attempt to change the order of these calls. +// Derived classes must be unregistered before the base ones. +#if defined(COMPILE_WEBKIT_SUPPORT) KvsObject_webView::unregisterSelf(); - #endif +#endif KvsObject_memoryBuffer::unregisterSelf(); KvsObject_process::unregisterSelf(); KvsObject_trayIcon::unregisterSelf(); @@ -182,22 +180,24 @@ static bool objects_kvs_cmd_killClass(KviKvsModuleCommandCall * c) [doc:objects]Objects documentation[/doc] */ - QString szClass; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("class",KVS_PT_NONEMPTYSTRING,0,szClass) + KVSM_PARAMETER("class", KVS_PT_NONEMPTYSTRING, 0, szClass) KVSM_PARAMETERS_END(c) - KviKvsObjectClass * pClass=KviKvsKernel::instance()->objectController()->lookupClass(szClass); + KviKvsObjectClass * pClass = KviKvsKernel::instance()->objectController()->lookupClass(szClass); if(pClass) { if(pClass->isBuiltin()) { KviKvsKernel::instance()->objectController()->killAllObjectsWithClass(pClass); - } else { + } + else + { KviKvsKernel::instance()->objectController()->deleteClass(pClass); //Yahoo!! } } - else if(!c->hasSwitch('q',"quiet"))c->warning(__tr2qs_ctx("Class '%Q' is not defined","objects"),&szClass); + else if(!c->hasSwitch('q', "quiet")) + c->warning(__tr2qs_ctx("Class '%Q' is not defined", "objects"), &szClass); return true; } @@ -227,7 +227,8 @@ static bool objects_kvs_cmd_clearObjects(KviKvsModuleCommandCall * c) */ KviKvsKernel::instance()->objectController()->clearInstances(); - if(!c->switches()->find('i',"ii")) KviKvsKernel::instance()->objectController()->clearUserClasses(); + if(!c->switches()->find('i', "ii")) + KviKvsKernel::instance()->objectController()->clearUserClasses(); return true; } @@ -256,32 +257,31 @@ static bool objects_kvs_cmd_connect(KviKvsModuleCommandCall * c) [cmd]class[/cmd], [cmd]object.disconnect[/cmd], [doc:objects]objects documentation[/doc] */ - - KviKvsObject *obSrc; - KviKvsObject *obTrg; - QString szSignal,szSlot; - kvs_hobject_t hSrc,hTrg; + KviKvsObject * obSrc; + KviKvsObject * obTrg; + QString szSignal, szSlot; + kvs_hobject_t hSrc, hTrg; KVSM_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("object source",KVS_PT_HOBJECT,0,hSrc) - KVSM_PARAMETER("signal name",KVS_PT_NONEMPTYSTRING,0,szSignal) - KVSO_PARAMETER("object target",KVS_PT_HOBJECT,0,hTrg) - KVSM_PARAMETER("slot",KVS_PT_NONEMPTYSTRING,0,szSlot) + KVSO_PARAMETER("object source", KVS_PT_HOBJECT, 0, hSrc) + KVSM_PARAMETER("signal name", KVS_PT_NONEMPTYSTRING, 0, szSignal) + KVSO_PARAMETER("object target", KVS_PT_HOBJECT, 0, hTrg) + KVSM_PARAMETER("slot", KVS_PT_NONEMPTYSTRING, 0, szSlot) KVSM_PARAMETERS_END(c) - obTrg=KviKvsKernel::instance()->objectController()->lookupObject(hTrg); - obSrc=KviKvsKernel::instance()->objectController()->lookupObject(hSrc); + obTrg = KviKvsKernel::instance()->objectController()->lookupObject(hTrg); + obSrc = KviKvsKernel::instance()->objectController()->lookupObject(hSrc); if(!obTrg) { - c->warning(__tr2qs_ctx("non-existent target object for objects.connect","objects")); + c->warning(__tr2qs_ctx("non-existent target object for objects.connect", "objects")); return true; } if(!obSrc) { - c->warning(__tr2qs_ctx("non-existent source object for objects.connect","objects")); + c->warning(__tr2qs_ctx("non-existent source object for objects.connect", "objects")); return true; } - if(!obSrc->connectSignal(szSignal,obTrg,szSlot)) + if(!obSrc->connectSignal(szSignal, obTrg, szSlot)) { - c->warning(__tr2qs_ctx("non-existent target slot '%Q' for objects.connect","objects"),&szSlot); + c->warning(__tr2qs_ctx("non-existent target slot '%Q' for objects.connect", "objects"), &szSlot); return true; } return true; @@ -305,12 +305,11 @@ static bool objects_kvs_fnc_exists(KviKvsModuleFunctionCall * c) [doc:objects]objects documentation[/doc] */ - kvs_hobject_t hObj; KVSM_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("object",KVS_PT_HOBJECT,0,hObj) + KVSO_PARAMETER("object", KVS_PT_HOBJECT, 0, hObj) KVSM_PARAMETERS_END(c) - KviKvsObject *ob=KviKvsKernel::instance()->objectController()->lookupObject(hObj); + KviKvsObject * ob = KviKvsKernel::instance()->objectController()->lookupObject(hObj); c->returnValue()->setBoolean(ob ? true : false); return true; } @@ -355,8 +354,8 @@ static bool objects_kvs_fnc_instances(KviKvsModuleFunctionCall * c) QString szClassName; QString szFlags; KVSM_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("class name",KVS_PT_NONEMPTYSTRING,0,szClassName) - KVSO_PARAMETER("flags",KVS_PT_STRING,KVS_PF_OPTIONAL,szFlags) + KVSO_PARAMETER("class name", KVS_PT_NONEMPTYSTRING, 0, szClassName) + KVSO_PARAMETER("flags", KVS_PT_STRING, KVS_PF_OPTIONAL, szFlags) KVSM_PARAMETERS_END(c) KviKvsArray * pArry = new KviKvsArray(); @@ -366,12 +365,12 @@ static bool objects_kvs_fnc_instances(KviKvsModuleFunctionCall * c) if(!pClass) { if(!szFlags.contains(QChar('q'))) - c->warning(__tr2qs_ctx("The class '%Q' doesn't exist","objects"),&szClassName); + c->warning(__tr2qs_ctx("The class '%Q' doesn't exist", "objects"), &szClassName); return true; } - KviPointerHashTable * od = KviKvsKernel::instance()->objectController()->objectDict(); + KviPointerHashTable * od = KviKvsKernel::instance()->objectController()->objectDict(); - KviPointerHashTableIterator it(*od); + KviPointerHashTableIterator it(*od); kvs_uint_t uIdx = 0; if(szFlags.contains(QChar('s'))) { @@ -379,17 +378,19 @@ static bool objects_kvs_fnc_instances(KviKvsModuleFunctionCall * c) { if(ob->getExactClass() == pClass) { - pArry->set(uIdx,new KviKvsVariant(ob->handle())); + pArry->set(uIdx, new KviKvsVariant(ob->handle())); uIdx++; } ++it; } - } else { + } + else + { while(KviKvsObject * ob = it.current()) { if(ob->inheritsClass(pClass)) { - pArry->set(uIdx,new KviKvsVariant(ob->handle())); + pArry->set(uIdx, new KviKvsVariant(ob->handle())); uIdx++; } ++it; @@ -418,26 +419,23 @@ static bool objects_kvs_fnc_variables(KviKvsModuleFunctionCall * c) kvs_hobject_t hObj; KVSM_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("object",KVS_PT_HOBJECT,0,hObj) + KVSO_PARAMETER("object", KVS_PT_HOBJECT, 0, hObj) KVSM_PARAMETERS_END(c) - KviKvsObject *ob=KviKvsKernel::instance()->objectController()->lookupObject(hObj); - if (!ob) + KviKvsObject * ob = KviKvsKernel::instance()->objectController()->lookupObject(hObj); + if(!ob) { - c->warning(__tr2qs_ctx("Object doesn't exist","objects")); + c->warning(__tr2qs_ctx("Object doesn't exist", "objects")); return true; } - KviPointerHashTableIterator it(* ob->dataContainer()->dict()); - KviKvsHash* pHash = new KviKvsHash(); + KviPointerHashTableIterator it(*ob->dataContainer()->dict()); + KviKvsHash * pHash = new KviKvsHash(); c->returnValue()->setHash(pHash); while(KviKvsVariant * t = it.current()) { - pHash->set(it.currentKey(),new KviKvsVariant(*t)); + pHash->set(it.currentKey(), new KviKvsVariant(*t)); ++it; } return true; - - - } static bool objects_kvs_fnc_classAllHandlers(KviKvsModuleFunctionCall * c) @@ -460,24 +458,24 @@ static bool objects_kvs_fnc_classAllHandlers(KviKvsModuleFunctionCall * c) QString szClassName; KVSM_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("class name",KVS_PT_NONEMPTYSTRING,0,szClassName) + KVSO_PARAMETER("class name", KVS_PT_NONEMPTYSTRING, 0, szClassName) KVSM_PARAMETERS_END(c) KviKvsObjectClass * pClass = KviKvsKernel::instance()->objectController()->lookupClass(szClassName); if(!pClass) { - c->warning(__tr2qs_ctx("The class '%Q' doesn't exist","objects"),&szClassName); + c->warning(__tr2qs_ctx("The class '%Q' doesn't exist", "objects"), &szClassName); return true; } - KviPointerHashTableIterator it(* pClass->getHandlers()); - KviKvsHash* pHash = new KviKvsHash(); + KviPointerHashTableIterator it(*pClass->getHandlers()); + KviKvsHash * pHash = new KviKvsHash(); c->returnValue()->setHash(pHash); while(it.current()) { QString szCode; - KviKvsObjectFunctionHandler *handler=pClass->lookupFunctionHandler(it.currentKey()); - pClass->getFunctionCode(szCode,*handler); - pHash->set(it.currentKey(),new KviKvsVariant(szCode)); + KviKvsObjectFunctionHandler * handler = pClass->lookupFunctionHandler(it.currentKey()); + pClass->getFunctionCode(szCode, *handler); + pHash->set(it.currentKey(), new KviKvsVariant(szCode)); ++it; } @@ -505,39 +503,40 @@ static bool objects_kvs_fnc_classes(KviKvsModuleFunctionCall * c) KviKvsArray * pArry = new KviKvsArray(); c->returnValue()->setArray(pArry); - KviPointerHashTableIterator it(*KviKvsKernel::instance()->objectController()->classDict()); - KviPointerHashTable *classdict=new KviPointerHashTable; + KviPointerHashTableIterator it(*KviKvsKernel::instance()->objectController()->classDict()); + KviPointerHashTable * classdict = new KviPointerHashTable; classdict->setAutoDelete(false); - bool bFake=true; - while(KviKvsObjectClass * pClass=it.current()) + bool bFake = true; + while(KviKvsObjectClass * pClass = it.current()) { - if (!pClass->isBuiltin())classdict->insert(it.currentKey(),&bFake); + if(!pClass->isBuiltin()) + classdict->insert(it.currentKey(), &bFake); ++it; } QString szPath; - g_pApp->getLocalKvircDirectory(szPath,KviApplication::Classes); + g_pApp->getLocalKvircDirectory(szPath, KviApplication::Classes); QDir d(szPath); QStringList sl; sl = d.entryList(QDir::Files); - for(QStringList::Iterator it2 = sl.begin();it2 != sl.end();++it2) + for(QStringList::Iterator it2 = sl.begin(); it2 != sl.end(); ++it2) { - QString szName=*it2; - szName.replace("--","::"); - if (szName!=".." && szName!=".") classdict->insert(szName.left(szName.length()-4),&bFake); + QString szName = *it2; + szName.replace("--", "::"); + if(szName != ".." && szName != ".") + classdict->insert(szName.left(szName.length() - 4), &bFake); } - KviKvsArray* pArray = new KviKvsArray(); + KviKvsArray * pArray = new KviKvsArray(); c->returnValue()->setArray(pArray); - int idx=0; - KviPointerHashTableIterator strIt(*classdict); + int idx = 0; + KviPointerHashTableIterator strIt(*classdict); while(strIt.current()) { - pArray->set(idx,new KviKvsVariant(strIt.currentKey())); + pArray->set(idx, new KviKvsVariant(strIt.currentKey())); idx++; ++strIt; } delete classdict; return true; - } static bool objects_kvs_fnc_name(KviKvsModuleFunctionCall * c) @@ -561,13 +560,13 @@ static bool objects_kvs_fnc_name(KviKvsModuleFunctionCall * c) KviKvsObject * obSrcClass; kvs_hobject_t hClass; KVSM_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("object class",KVS_PT_HOBJECT,0,hClass) + KVSO_PARAMETER("object class", KVS_PT_HOBJECT, 0, hClass) KVSM_PARAMETERS_END(c) obSrcClass = KviKvsKernel::instance()->objectController()->lookupObject(hClass); if(!obSrcClass) { - c->warning(__tr2qs_ctx("non-existent class object for objects.name","objects")); + c->warning(__tr2qs_ctx("non-existent class object for objects.name", "objects")); return true; } @@ -596,29 +595,29 @@ static bool objects_kvs_cmd_disconnect(KviKvsModuleCommandCall * c) [cmd]class[/cmd], [cmd]objects.connect[/cmd], [doc:objects]objects documentation[/doc] */ - KviKvsObject *obSrc; - KviKvsObject *obTrg; - QString szSignal,szSlot; - kvs_hobject_t hSrc,hTrg; + KviKvsObject * obSrc; + KviKvsObject * obTrg; + QString szSignal, szSlot; + kvs_hobject_t hSrc, hTrg; KVSM_PARAMETERS_BEGIN(c) - KVSO_PARAMETER("object source",KVS_PT_HOBJECT,0,hSrc) - KVSM_PARAMETER("signal name",KVS_PT_NONEMPTYSTRING,0,szSignal) - KVSO_PARAMETER("object target",KVS_PT_HOBJECT,0,hTrg) - KVSM_PARAMETER("slot",KVS_PT_NONEMPTYSTRING,0,szSlot) + KVSO_PARAMETER("object source", KVS_PT_HOBJECT, 0, hSrc) + KVSM_PARAMETER("signal name", KVS_PT_NONEMPTYSTRING, 0, szSignal) + KVSO_PARAMETER("object target", KVS_PT_HOBJECT, 0, hTrg) + KVSM_PARAMETER("slot", KVS_PT_NONEMPTYSTRING, 0, szSlot) KVSM_PARAMETERS_END(c) - obTrg=KviKvsKernel::instance()->objectController()->lookupObject(hTrg); - obSrc=KviKvsKernel::instance()->objectController()->lookupObject(hSrc); + obTrg = KviKvsKernel::instance()->objectController()->lookupObject(hTrg); + obSrc = KviKvsKernel::instance()->objectController()->lookupObject(hSrc); if(!obTrg) { - c->warning(__tr2qs_ctx("non-existent target object for objects.disconnect","objects")); + c->warning(__tr2qs_ctx("non-existent target object for objects.disconnect", "objects")); return true; } if(!obSrc) { - c->warning(__tr2qs_ctx("non-existent source object for objects.disconnect","objects")); + c->warning(__tr2qs_ctx("non-existent source object for objects.disconnect", "objects")); return true; } - obSrc->disconnectSignal(szSignal,obTrg,szSlot); + obSrc->disconnectSignal(szSignal, obTrg, szSlot); return true; } @@ -651,45 +650,44 @@ static bool objects_kvs_fnc_listObjects(KviKvsModuleFunctionCall * cmd) [/example] */ - bool bFlag; KVSO_PARAMETERS_BEGIN(cmd) - KVSO_PARAMETER("print on current window",KVS_PT_BOOL,0,bFlag) + KVSO_PARAMETER("print on current window", KVS_PT_BOOL, 0, bFlag) KVSO_PARAMETERS_END(cmd) - if (bFlag) + if(bFlag) cmd->window()->output(80, "Objects dump:"); QWidgetList list = g_pApp->topLevelWidgets(); KviCString spacing = ">"; - QString szTemp; + QString szTemp; KviKvsArray * n = new KviKvsArray(); - int idx=0; - for(int i=0;iisWidgetType()) + if(list.at(i)->isWidgetType()) { - if (bFlag) + if(bFlag) { cmd->window()->output(80, "Ptr %u: top level object: %c%s%c, class %s, %s, rect = %d, %d, %d, %d", - list.at(i), - KviControlCodes::Bold, list.at(i)->objectName().toUtf8().data(), KviControlCodes::Bold, - list.at(i)->metaObject()->className(), - list.at(i)->isVisible() ? "visible" : "hidden", - list.at(i)->x(), list.at(i)->y(), list.at(i)->width(), list.at(i)->height()); + list.at(i), + KviControlCodes::Bold, list.at(i)->objectName().toUtf8().data(), KviControlCodes::Bold, + list.at(i)->metaObject()->className(), + list.at(i)->isVisible() ? "visible" : "hidden", + list.at(i)->x(), list.at(i)->y(), list.at(i)->width(), list.at(i)->height()); } - QString szClass=list.at(i)->metaObject()->className(); - QString szObj=list.at(i)->objectName(); + QString szClass = list.at(i)->metaObject()->className(); + QString szObj = list.at(i)->objectName(); QString szTemp; szTemp = szClass + "::" + szObj; KviKvsVariant v; v.setString(szTemp); - n->set(idx,new KviKvsVariant(v)); + n->set(idx, new KviKvsVariant(v)); /*qDebug("string %s",szTemp.toUtf8().data()); qDebug("class %s",szClass.toUtf8().data()); qDebug("Obj %s",szObj.toUtf8().data());*/ idx++; - dumpChildObjects(cmd->window(), list.at(i), spacing.ptr(), bFlag,n,idx); + dumpChildObjects(cmd->window(), list.at(i), spacing.ptr(), bFlag, n, idx); } } @@ -697,36 +695,35 @@ static bool objects_kvs_fnc_listObjects(KviKvsModuleFunctionCall * cmd) return true; } -static void dumpChildObjects(KviWindow *pWnd, QObject *parent, const char *spacing, bool bFlag, KviKvsArray *n, int &idx) +static void dumpChildObjects(KviWindow * pWnd, QObject * parent, const char * spacing, bool bFlag, KviKvsArray * n, int & idx) { const QObjectList list = parent->children(); - if( !list.count() ) return; + if(!list.count()) + return; QString sp(spacing); sp.append(">"); - for(int i=0;iisWidgetType() ) + if(list.at(i)->isWidgetType()) { - if (bFlag) + if(bFlag) { pWnd->output(80, "%sPtr %u: object: %c%s%c, class %s", - spacing, list.at(i), KviControlCodes::Bold, - list.at(i)->objectName().toUtf8().data(), KviControlCodes::Bold, list.at(i)->metaObject()->className() - ); + spacing, list.at(i), KviControlCodes::Bold, + list.at(i)->objectName().toUtf8().data(), KviControlCodes::Bold, list.at(i)->metaObject()->className()); } - QString szClass=list.at(i)->metaObject()->className(); - QString szObj=list.at(i)->objectName(); + QString szClass = list.at(i)->metaObject()->className(); + QString szObj = list.at(i)->objectName(); QString szTemp; - szTemp=spacing+szClass+"::"+szObj; + szTemp = spacing + szClass + "::" + szObj; KviKvsVariant v; v.setString(szTemp); - n->set(idx,new KviKvsVariant(v)); - //qDebug("string %s",szTemp.toUtf8().data()); + n->set(idx, new KviKvsVariant(v)); + //qDebug("string %s",szTemp.toUtf8().data()); idx++; - dumpChildObjects(pWnd, list.at(i), sp.toUtf8().data(), bFlag, n, idx ); + dumpChildObjects(pWnd, list.at(i), sp.toUtf8().data(), bFlag, n, idx); } } - } static bool objects_module_can_unload(KviModule *) @@ -739,19 +736,19 @@ static bool objects_module_can_unload(KviModule *) static bool objects_module_init(KviModule * m) { // functions - KVSM_REGISTER_FUNCTION(m,"classAllHandlers",objects_kvs_fnc_classAllHandlers); - KVSM_REGISTER_FUNCTION(m,"classes",objects_kvs_fnc_classes); - KVSM_REGISTER_FUNCTION(m,"dump",objects_kvs_fnc_listObjects); - KVSM_REGISTER_FUNCTION(m,"exists",objects_kvs_fnc_exists); - KVSM_REGISTER_FUNCTION(m,"instances",objects_kvs_fnc_instances); - KVSM_REGISTER_FUNCTION(m,"name",objects_kvs_fnc_name); - KVSM_REGISTER_FUNCTION(m,"variables",objects_kvs_fnc_variables); + KVSM_REGISTER_FUNCTION(m, "classAllHandlers", objects_kvs_fnc_classAllHandlers); + KVSM_REGISTER_FUNCTION(m, "classes", objects_kvs_fnc_classes); + KVSM_REGISTER_FUNCTION(m, "dump", objects_kvs_fnc_listObjects); + KVSM_REGISTER_FUNCTION(m, "exists", objects_kvs_fnc_exists); + KVSM_REGISTER_FUNCTION(m, "instances", objects_kvs_fnc_instances); + KVSM_REGISTER_FUNCTION(m, "name", objects_kvs_fnc_name); + KVSM_REGISTER_FUNCTION(m, "variables", objects_kvs_fnc_variables); // commands - KVSM_REGISTER_SIMPLE_COMMAND(m,"clearObjects",objects_kvs_cmd_clearObjects); - KVSM_REGISTER_SIMPLE_COMMAND(m,"connect",objects_kvs_cmd_connect); - KVSM_REGISTER_SIMPLE_COMMAND(m,"disconnect",objects_kvs_cmd_disconnect); - KVSM_REGISTER_SIMPLE_COMMAND(m,"killClass",objects_kvs_cmd_killClass); + KVSM_REGISTER_SIMPLE_COMMAND(m, "clearObjects", objects_kvs_cmd_clearObjects); + KVSM_REGISTER_SIMPLE_COMMAND(m, "connect", objects_kvs_cmd_connect); + KVSM_REGISTER_SIMPLE_COMMAND(m, "disconnect", objects_kvs_cmd_disconnect); + KVSM_REGISTER_SIMPLE_COMMAND(m, "killClass", objects_kvs_cmd_killClass); // Don't attempt to change the order of these calls. // Derived classes must be registered after the base ones. @@ -811,17 +808,16 @@ static bool objects_module_init(KviModule * m) } KVIRC_MODULE( - "Objects", - "4.0.0", - "Copyright (C) 2000-2006:\n" \ - " Szymon Stefanek (pragma at kvirc dot net)\n" \ - " Krzysztof Godlewski (kristoff at poczta dot wprost dot pl)\n" \ - " Tonino Imbesi (grifisx at barmes dot org)\n" \ - " Alessandro Carbone (elfonol at gmail dot com)", - "Object classes for KVIrc scripting language\n", - objects_module_init, - objects_module_can_unload, - 0, - objects_module_cleanup, - "objects" -) + "Objects", + "4.0.0", + "Copyright (C) 2000-2006:\n" + " Szymon Stefanek (pragma at kvirc dot net)\n" + " Krzysztof Godlewski (kristoff at poczta dot wprost dot pl)\n" + " Tonino Imbesi (grifisx at barmes dot org)\n" + " Alessandro Carbone (elfonol at gmail dot com)", + "Object classes for KVIrc scripting language\n", + objects_module_init, + objects_module_can_unload, + 0, + objects_module_cleanup, + "objects") diff --git a/src/modules/objects/object_macros.h b/src/modules/objects/object_macros.h index d6225dfb1..f89318575 100644 --- a/src/modules/objects/object_macros.h +++ b/src/modules/objects/object_macros.h @@ -30,94 +30,90 @@ #include "KviKvsObjectController.h" #include "KviKvsObjectFunctionCall.h" -#define KVSO_DECLARE_OBJECT(__className) \ - __className(KviKvsObjectClass * pClass,KviKvsObject * pParent,const QString &szName); \ - ~__className(); \ - static void registerSelf(); \ +#define KVSO_DECLARE_OBJECT(__className) \ + __className(KviKvsObjectClass * pClass, KviKvsObject * pParent, const QString & szName); \ + ~__className(); \ + static void registerSelf(); \ static void unregisterSelf(); -#define SET_OBJECT(__className) \ - __className *obj=new __className(parentScriptWidget()); \ - obj->setObjectName(getName()); \ - setObject(obj,true); +#define SET_OBJECT(__className) \ + __className * obj = new __className(parentScriptWidget()); \ + obj->setObjectName(getName()); \ + setObject(obj, true); -#define KVSO_REGISTER_HANDLER(__className,__szName,__proc) \ - g_pKvs##__className##Class->registerFunctionHandler(__szName,(KviKvsObjectFunctionHandlerProc)(KVI_PTR2MEMBER(__className::__proc))); +#define KVSO_REGISTER_HANDLER(__className, __szName, __proc) \ + g_pKvs##__className##Class->registerFunctionHandler(__szName, (KviKvsObjectFunctionHandlerProc)(KVI_PTR2MEMBER(__className::__proc))); // TEST -#define KVSO_REGISTER_HANDLER_BY_NAME(__className,__szName) \ -g_pKvs##__className##Class->registerFunctionHandler(#__szName,(KviKvsObjectFunctionHandlerProc)(KVI_PTR2MEMBER(__className::__szName))); +#define KVSO_REGISTER_HANDLER_BY_NAME(__className, __szName) \ + g_pKvs##__className##Class->registerFunctionHandler(#__szName, (KviKvsObjectFunctionHandlerProc)(KVI_PTR2MEMBER(__className::__szName))); -#define KVSO_REGISTER_STANDARD_NOTHINGRETURN_HANDLER(__className,__szName) \ +#define KVSO_REGISTER_STANDARD_NOTHINGRETURN_HANDLER(__className, __szName) \ g_pKvs##__className##Class->registerStandardNothingReturnFunctionHandler(__szName); -#define KVSO_REGISTER_STANDARD_TRUERETURN_HANDLER(__className,__szName) \ +#define KVSO_REGISTER_STANDARD_TRUERETURN_HANDLER(__className, __szName) \ g_pKvs##__className##Class->registerStandardTrueReturnFunctionHandler(__szName); -#define KVSO_REGISTER_STANDARD_FALSERETURN_HANDLER(__className,__szName) \ +#define KVSO_REGISTER_STANDARD_FALSERETURN_HANDLER(__className, __szName) \ g_pKvs##__className##Class->registerStandardFalseReturnFunctionHandler(__szName); -#define KVSO_BEGIN_REGISTERCLASS(__className,__stringName,__baseClass) \ - static KviKvsObjectClass * g_pKvs##__className##Class = 0; \ - static KviKvsObject * kvs_##__className##_createInstance(KviKvsObjectClass * pClass,KviKvsObject * pParent,const QString &szName) \ - { \ - return new __className(pClass,pParent,szName); \ - } \ - void __className::unregisterSelf() \ - { \ - delete g_pKvs##__className##Class; \ - g_pKvs##__className##Class = 0; \ - } \ - void __className::registerSelf() \ - { \ - KviKvsObjectClass * base = KviKvsKernel::instance()->objectController()->lookupClass(__baseClass); \ - g_pKvs##__className##Class = new KviKvsObjectClass(base,__stringName,kvs_##__className##_createInstance,true); - - +#define KVSO_BEGIN_REGISTERCLASS(__className, __stringName, __baseClass) \ + static KviKvsObjectClass * g_pKvs##__className##Class = 0; \ + static KviKvsObject * kvs_##__className##_createInstance(KviKvsObjectClass * pClass, KviKvsObject * pParent, const QString & szName) \ + { \ + return new __className(pClass, pParent, szName); \ + } \ + void __className::unregisterSelf() \ + { \ + delete g_pKvs##__className##Class; \ + g_pKvs##__className##Class = 0; \ + } \ + void __className::registerSelf() \ + { \ + KviKvsObjectClass * base = KviKvsKernel::instance()->objectController()->lookupClass(__baseClass); \ + g_pKvs##__className##Class = new KviKvsObjectClass(base, __stringName, kvs_##__className##_createInstance, true); #define KVSO_END_REGISTERCLASS(__className) \ } - -#define KVSO_BEGIN_CONSTRUCTOR(__className,__baseClass) \ - __className::__className(KviKvsObjectClass * pClass,KviKvsObject * pParent,const QString &szName) \ - : __baseClass(pClass,pParent,szName) \ +#define KVSO_BEGIN_CONSTRUCTOR(__className, __baseClass) \ + __className::__className(KviKvsObjectClass * pClass, KviKvsObject * pParent, const QString & szName) \ + : __baseClass(pClass, pParent, szName) \ { #define KVSO_END_CONSTRUCTOR(__className) \ } #define KVSO_BEGIN_DESTRUCTOR(__className) \ - __className::~__className() \ + __className::~__className() \ { - #define KVSO_END_DESTRUCTOR(__className) \ } -#define KVSO_CLASS_FUNCTION(__className,__functionName)\ +#define KVSO_CLASS_FUNCTION(__className, __functionName) \ bool KvsObject_##__className::__functionName(KviKvsObjectFunctionCall * c) -#define CHECK_INTERNAL_POINTER(__pointer)\ - if(!__pointer) \ - { \ - c->error(__tr2qs_ctx("Internal error: no valid pointer for this object","objects")); \ - return false; \ +#define CHECK_INTERNAL_POINTER(__pointer) \ + if(!__pointer) \ + { \ + c->error(__tr2qs_ctx("Internal error: no valid pointer for this object", "objects")); \ + return false; \ } -#define CHECK_HOBJECT_IS_WIDGET(__pObject)\ -if (!__pObject)\ - {\ - c->warning(__tr2qs_ctx("Widget parameter is not an object","objects"));\ - return true;\ - }\ - if (!__pObject->object())\ - {\ - c->warning(__tr2qs_ctx("Widget parameter is not a valid object","objects"));\ - return true;\ - }\ - if(!__pObject->object()->isWidgetType())\ - {\ - c->warning(__tr2qs_ctx("Widget object required","objects"));\ - return true;\ +#define CHECK_HOBJECT_IS_WIDGET(__pObject) \ + if(!__pObject) \ + { \ + c->warning(__tr2qs_ctx("Widget parameter is not an object", "objects")); \ + return true; \ + } \ + if(!__pObject->object()) \ + { \ + c->warning(__tr2qs_ctx("Widget parameter is not a valid object", "objects")); \ + return true; \ + } \ + if(!__pObject->object()->isWidgetType()) \ + { \ + c->warning(__tr2qs_ctx("Widget object required", "objects")); \ + return true; \ } #endif diff --git a/src/modules/objects/qtftp/qftp.cpp b/src/modules/objects/qtftp/qftp.cpp index f0fcecb57..626aaae70 100644 --- a/src/modules/objects/qtftp/qftp.cpp +++ b/src/modules/objects/qtftp/qftp.cpp @@ -60,7 +60,6 @@ QT_BEGIN_NAMESPACE - /********************************************************************** * * QFtpCommand implemenatation @@ -69,45 +68,46 @@ QT_BEGIN_NAMESPACE class QFtpCommand { public: - QFtpCommand(QFtp::Command cmd, QStringList raw, const QByteArray &ba); - QFtpCommand(QFtp::Command cmd, QStringList raw, QIODevice *dev = 0); - ~QFtpCommand(); - - int id; - QFtp::Command command; - QStringList rawCmds; - - // If is_ba is true, ba is used; ba is never 0. - // Otherwise dev is used; dev can be 0 or not. - union { - QByteArray *ba; - QIODevice *dev; - } data; - bool is_ba; - - static QBasicAtomicInt idCounter; + QFtpCommand(QFtp::Command cmd, QStringList raw, const QByteArray & ba); + QFtpCommand(QFtp::Command cmd, QStringList raw, QIODevice * dev = 0); + ~QFtpCommand(); + + int id; + QFtp::Command command; + QStringList rawCmds; + + // If is_ba is true, ba is used; ba is never 0. + // Otherwise dev is used; dev can be 0 or not. + union + { + QByteArray * ba; + QIODevice * dev; + } data; + bool is_ba; + + static QBasicAtomicInt idCounter; }; QBasicAtomicInt QFtpCommand::idCounter = Q_BASIC_ATOMIC_INITIALIZER(1); -QFtpCommand::QFtpCommand(QFtp::Command cmd, QStringList raw, const QByteArray &ba) +QFtpCommand::QFtpCommand(QFtp::Command cmd, QStringList raw, const QByteArray & ba) : command(cmd), rawCmds(raw), is_ba(true) { - id = idCounter.fetchAndAddRelaxed(1); - data.ba = new QByteArray(ba); + id = idCounter.fetchAndAddRelaxed(1); + data.ba = new QByteArray(ba); } -QFtpCommand::QFtpCommand(QFtp::Command cmd, QStringList raw, QIODevice *dev) +QFtpCommand::QFtpCommand(QFtp::Command cmd, QStringList raw, QIODevice * dev) : command(cmd), rawCmds(raw), is_ba(false) { - id = idCounter.fetchAndAddRelaxed(1); - data.dev = dev; + id = idCounter.fetchAndAddRelaxed(1); + data.dev = dev; } QFtpCommand::~QFtpCommand() { - if (is_ba) - delete data.ba; + if(is_ba) + delete data.ba; } /********************************************************************** @@ -115,506 +115,550 @@ QFtpCommand::~QFtpCommand() * QFtpDTP implemenatation * *********************************************************************/ -QFtpDTP::QFtpDTP(QFtpPI *p, QObject *parent) : - QObject(parent), - socket(0), - listener(this), - pi(p), - callWriteData(false) +QFtpDTP::QFtpDTP(QFtpPI * p, QObject * parent) : QObject(parent), + socket(0), + listener(this), + pi(p), + callWriteData(false) { - clearData(); - listener.setObjectName(QLatin1String("QFtpDTP active state server")); - connect(&listener, SIGNAL(newConnection()), SLOT(setupSocket())); + clearData(); + listener.setObjectName(QLatin1String("QFtpDTP active state server")); + connect(&listener, SIGNAL(newConnection()), SLOT(setupSocket())); } -void QFtpDTP::setData(QByteArray *ba) +void QFtpDTP::setData(QByteArray * ba) { - is_ba = true; - data.ba = ba; + is_ba = true; + data.ba = ba; } -void QFtpDTP::setDevice(QIODevice *dev) +void QFtpDTP::setDevice(QIODevice * dev) { - is_ba = false; - data.dev = dev; + is_ba = false; + data.dev = dev; } void QFtpDTP::setBytesTotal(qint64 bytes) { - bytesTotal = bytes; - bytesDone = 0; - emit dataTransferProgress(bytesDone, bytesTotal); + bytesTotal = bytes; + bytesDone = 0; + emit dataTransferProgress(bytesDone, bytesTotal); } void QFtpDTP::connectToHost(const QString & host, quint16 port) { - bytesFromSocket.clear(); + bytesFromSocket.clear(); - if (socket) { - delete socket; - socket = 0; - } - socket = new QTcpSocket(this); + if(socket) + { + delete socket; + socket = 0; + } + socket = new QTcpSocket(this); #ifndef QT_NO_BEARERMANAGEMENT - //copy network session down to the socket - socket->setProperty("_q_networksession", property("_q_networksession")); + //copy network session down to the socket + socket->setProperty("_q_networksession", property("_q_networksession")); #endif - socket->setObjectName(QLatin1String("QFtpDTP Passive state socket")); - connect(socket, SIGNAL(connected()), SLOT(socketConnected())); - connect(socket, SIGNAL(readyRead()), SLOT(socketReadyRead())); - connect(socket, SIGNAL(error(QAbstractSocket::SocketError)), SLOT(socketError(QAbstractSocket::SocketError))); - connect(socket, SIGNAL(disconnected()), SLOT(socketConnectionClosed())); - connect(socket, SIGNAL(bytesWritten(qint64)), SLOT(socketBytesWritten(qint64))); + socket->setObjectName(QLatin1String("QFtpDTP Passive state socket")); + connect(socket, SIGNAL(connected()), SLOT(socketConnected())); + connect(socket, SIGNAL(readyRead()), SLOT(socketReadyRead())); + connect(socket, SIGNAL(error(QAbstractSocket::SocketError)), SLOT(socketError(QAbstractSocket::SocketError))); + connect(socket, SIGNAL(disconnected()), SLOT(socketConnectionClosed())); + connect(socket, SIGNAL(bytesWritten(qint64)), SLOT(socketBytesWritten(qint64))); - socket->connectToHost(host, port); + socket->connectToHost(host, port); } -int QFtpDTP::setupListener(const QHostAddress &address) +int QFtpDTP::setupListener(const QHostAddress & address) { #ifndef QT_NO_BEARERMANAGEMENT - //copy network session down to the socket - listener.setProperty("_q_networksession", property("_q_networksession")); + //copy network session down to the socket + listener.setProperty("_q_networksession", property("_q_networksession")); #endif - if (!listener.isListening() && !listener.listen(address, 0)) - return -1; - return listener.serverPort(); + if(!listener.isListening() && !listener.listen(address, 0)) + return -1; + return listener.serverPort(); } void QFtpDTP::waitForConnection() { - // This function is only interesting in Active transfer mode; it works - // around a limitation in QFtp's design by blocking, waiting for an - // incoming connection. For the default Passive mode, it does nothing. - if (listener.isListening()) - listener.waitForNewConnection(); + // This function is only interesting in Active transfer mode; it works + // around a limitation in QFtp's design by blocking, waiting for an + // incoming connection. For the default Passive mode, it does nothing. + if(listener.isListening()) + listener.waitForNewConnection(); } QTcpSocket::SocketState QFtpDTP::state() const { - return socket ? socket->state() : QTcpSocket::UnconnectedState; + return socket ? socket->state() : QTcpSocket::UnconnectedState; } qint64 QFtpDTP::bytesAvailable() const { - if (!socket || socket->state() != QTcpSocket::ConnectedState) - return (qint64) bytesFromSocket.size(); - return socket->bytesAvailable(); + if(!socket || socket->state() != QTcpSocket::ConnectedState) + return (qint64)bytesFromSocket.size(); + return socket->bytesAvailable(); } -qint64 QFtpDTP::read(char *data, qint64 maxlen) +qint64 QFtpDTP::read(char * data, qint64 maxlen) { - qint64 read; - if (socket && socket->state() == QTcpSocket::ConnectedState) { - read = socket->read(data, maxlen); - } else { - read = qMin(maxlen, qint64(bytesFromSocket.size())); - memcpy(data, bytesFromSocket.data(), read); - bytesFromSocket.remove(0, read); - } + qint64 read; + if(socket && socket->state() == QTcpSocket::ConnectedState) + { + read = socket->read(data, maxlen); + } + else + { + read = qMin(maxlen, qint64(bytesFromSocket.size())); + memcpy(data, bytesFromSocket.data(), read); + bytesFromSocket.remove(0, read); + } - bytesDone += read; - return read; + bytesDone += read; + return read; } QByteArray QFtpDTP::readAll() { - QByteArray tmp; - if (socket && socket->state() == QTcpSocket::ConnectedState) { - tmp = socket->readAll(); - bytesDone += tmp.size(); - } else { - tmp = bytesFromSocket; - bytesFromSocket.clear(); - } - return tmp; + QByteArray tmp; + if(socket && socket->state() == QTcpSocket::ConnectedState) + { + tmp = socket->readAll(); + bytesDone += tmp.size(); + } + else + { + tmp = bytesFromSocket; + bytesFromSocket.clear(); + } + return tmp; } void QFtpDTP::writeData() { - if (!socket) - return; + if(!socket) + return; - if (is_ba) { + if(is_ba) + { #if defined(QFTPDTP_DEBUG) - qDebug("QFtpDTP::writeData: write %d bytes", data.ba->size()); + qDebug("QFtpDTP::writeData: write %d bytes", data.ba->size()); #endif - if (data.ba->size() == 0) - emit dataTransferProgress(0, bytesTotal); - else - socket->write(data.ba->data(), data.ba->size()); - - socket->close(); - - clearData(); - } else if (data.dev) { - callWriteData = false; - const qint64 blockSize = 16*1024; - char buf[16*1024]; - qint64 read = data.dev->read(buf, blockSize); + if(data.ba->size() == 0) + emit dataTransferProgress(0, bytesTotal); + else + socket->write(data.ba->data(), data.ba->size()); + + socket->close(); + + clearData(); + } + else if(data.dev) + { + callWriteData = false; + const qint64 blockSize = 16 * 1024; + char buf[16 * 1024]; + qint64 read = data.dev->read(buf, blockSize); #if defined(QFTPDTP_DEBUG) - qDebug("QFtpDTP::writeData: write() of size %lli bytes", read); + qDebug("QFtpDTP::writeData: write() of size %lli bytes", read); #endif - if (read > 0) { - socket->write(buf, read); - } else if (read == -1 || (!data.dev->isSequential() && data.dev->atEnd())) { - // error or EOF - if (bytesDone == 0 && socket->bytesToWrite() == 0) - emit dataTransferProgress(0, bytesTotal); - socket->close(); - clearData(); - } - - // do we continue uploading? - callWriteData = data.dev != 0; - } + if(read > 0) + { + socket->write(buf, read); + } + else if(read == -1 || (!data.dev->isSequential() && data.dev->atEnd())) + { + // error or EOF + if(bytesDone == 0 && socket->bytesToWrite() == 0) + emit dataTransferProgress(0, bytesTotal); + socket->close(); + clearData(); + } + + // do we continue uploading? + callWriteData = data.dev != 0; + } } void QFtpDTP::dataReadyRead() { - writeData(); + writeData(); } inline bool QFtpDTP::hasError() const { - return !err.isNull(); + return !err.isNull(); } inline QString QFtpDTP::errorMessage() const { - return err; + return err; } inline void QFtpDTP::clearError() { - err.clear(); + err.clear(); } void QFtpDTP::abortConnection() { #if defined(QFTPDTP_DEBUG) - qDebug("QFtpDTP::abortConnection, bytesAvailable == %lli", - socket ? socket->bytesAvailable() : (qint64) 0); + qDebug("QFtpDTP::abortConnection, bytesAvailable == %lli", + socket ? socket->bytesAvailable() : (qint64)0); #endif - callWriteData = false; - clearData(); - - if (socket) - socket->abort(); -} - -static void _q_fixupDateTime(QDateTime *dateTime) -{ - // Adjust for future tolerance. - const int futureTolerance = 86400; - if (dateTime->secsTo(QDateTime::currentDateTime()) < -futureTolerance) { - QDate d = dateTime->date(); - d.setDate(d.year() - 1, d.month(), d.day()); - dateTime->setDate(d); - } -} - -static void _q_parseUnixDir(const QStringList &tokens, const QString &userName, QUrlInfo *info) -{ - // Unix style, 7 + 1 entries - // -rw-r--r-- 1 ftp ftp 17358091 Aug 10 2004 qt-x11-free-3.3.3.tar.gz - // drwxr-xr-x 3 ftp ftp 4096 Apr 14 2000 compiled-examples - // lrwxrwxrwx 1 ftp ftp 9 Oct 29 2005 qtscape -> qtmozilla - if (tokens.size() != 8) - return; - - char first = tokens.at(1).at(0).toLatin1(); - if (first == 'd') { - info->setDir(true); - info->setFile(false); - info->setSymLink(false); - } else if (first == '-') { - info->setDir(false); - info->setFile(true); - info->setSymLink(false); - } else if (first == 'l') { - info->setDir(true); - info->setFile(false); - info->setSymLink(true); - } - - // Resolve filename - QString name = tokens.at(7); - if (info->isSymLink()) { - int linkPos = name.indexOf(QLatin1String(" ->")); - if (linkPos != -1) - name.resize(linkPos); - } - info->setName(name); - - // Resolve owner & group - info->setOwner(tokens.at(3)); - info->setGroup(tokens.at(4)); - - // Resolve size - info->setSize(tokens.at(5).toLongLong()); - - QStringList formats; - formats << QLatin1String("MMM dd yyyy") << QLatin1String("MMM dd hh:mm") << QLatin1String("MMM d yyyy") - << QLatin1String("MMM d hh:mm") << QLatin1String("MMM d yyyy") << QLatin1String("MMM dd yyyy"); - - QString dateString = tokens.at(6); - dateString[0] = dateString[0].toUpper(); - - // Resolve the modification date by parsing all possible formats - QDateTime dateTime; - int n = 0; + callWriteData = false; + clearData(); + + if(socket) + socket->abort(); +} + +static void _q_fixupDateTime(QDateTime * dateTime) +{ + // Adjust for future tolerance. + const int futureTolerance = 86400; + if(dateTime->secsTo(QDateTime::currentDateTime()) < -futureTolerance) + { + QDate d = dateTime->date(); + d.setDate(d.year() - 1, d.month(), d.day()); + dateTime->setDate(d); + } +} + +static void _q_parseUnixDir(const QStringList & tokens, const QString & userName, QUrlInfo * info) +{ + // Unix style, 7 + 1 entries + // -rw-r--r-- 1 ftp ftp 17358091 Aug 10 2004 qt-x11-free-3.3.3.tar.gz + // drwxr-xr-x 3 ftp ftp 4096 Apr 14 2000 compiled-examples + // lrwxrwxrwx 1 ftp ftp 9 Oct 29 2005 qtscape -> qtmozilla + if(tokens.size() != 8) + return; + + char first = tokens.at(1).at(0).toLatin1(); + if(first == 'd') + { + info->setDir(true); + info->setFile(false); + info->setSymLink(false); + } + else if(first == '-') + { + info->setDir(false); + info->setFile(true); + info->setSymLink(false); + } + else if(first == 'l') + { + info->setDir(true); + info->setFile(false); + info->setSymLink(true); + } + + // Resolve filename + QString name = tokens.at(7); + if(info->isSymLink()) + { + int linkPos = name.indexOf(QLatin1String(" ->")); + if(linkPos != -1) + name.resize(linkPos); + } + info->setName(name); + + // Resolve owner & group + info->setOwner(tokens.at(3)); + info->setGroup(tokens.at(4)); + + // Resolve size + info->setSize(tokens.at(5).toLongLong()); + + QStringList formats; + formats << QLatin1String("MMM dd yyyy") << QLatin1String("MMM dd hh:mm") << QLatin1String("MMM d yyyy") + << QLatin1String("MMM d hh:mm") << QLatin1String("MMM d yyyy") << QLatin1String("MMM dd yyyy"); + + QString dateString = tokens.at(6); + dateString[0] = dateString[0].toUpper(); + + // Resolve the modification date by parsing all possible formats + QDateTime dateTime; + int n = 0; #ifndef QT_NO_DATESTRING - do { - dateTime = QLocale::c().toDateTime(dateString, formats.at(n++)); - } while (n < formats.size() && (!dateTime.isValid())); + do + { + dateTime = QLocale::c().toDateTime(dateString, formats.at(n++)); + } while(n < formats.size() && (!dateTime.isValid())); #endif - if (n == 2 || n == 4) { - // Guess the year. - dateTime.setDate(QDate(QDate::currentDate().year(), - dateTime.date().month(), - dateTime.date().day())); - _q_fixupDateTime(&dateTime); - } - if (dateTime.isValid()) - info->setLastModified(dateTime); - - // Resolve permissions - int permissions = 0; - QString p = tokens.at(2); - permissions |= (p[0] == QLatin1Char('r') ? QUrlInfo::ReadOwner : 0); - permissions |= (p[1] == QLatin1Char('w') ? QUrlInfo::WriteOwner : 0); - permissions |= (p[2] == QLatin1Char('x') ? QUrlInfo::ExeOwner : 0); - permissions |= (p[3] == QLatin1Char('r') ? QUrlInfo::ReadGroup : 0); - permissions |= (p[4] == QLatin1Char('w') ? QUrlInfo::WriteGroup : 0); - permissions |= (p[5] == QLatin1Char('x') ? QUrlInfo::ExeGroup : 0); - permissions |= (p[6] == QLatin1Char('r') ? QUrlInfo::ReadOther : 0); - permissions |= (p[7] == QLatin1Char('w') ? QUrlInfo::WriteOther : 0); - permissions |= (p[8] == QLatin1Char('x') ? QUrlInfo::ExeOther : 0); - info->setPermissions(permissions); - - bool isOwner = info->owner() == userName; - info->setReadable((permissions & QUrlInfo::ReadOther) || ((permissions & QUrlInfo::ReadOwner) && isOwner)); - info->setWritable((permissions & QUrlInfo::WriteOther) || ((permissions & QUrlInfo::WriteOwner) && isOwner)); -} - -static void _q_parseDosDir(const QStringList &tokens, const QString &userName, QUrlInfo *info) -{ - // DOS style, 3 + 1 entries - // 01-16-02 11:14AM epsgroup - // 06-05-03 03:19PM 1973 readme.txt - if (tokens.size() != 4) - return; - - Q_UNUSED(userName); - - QString name = tokens.at(3); - info->setName(name); - info->setSymLink(name.toLower().endsWith(QLatin1String(".lnk"))); - - if (tokens.at(2) == QLatin1String("")) { - info->setFile(false); - info->setDir(true); - } else { - info->setFile(true); - info->setDir(false); - info->setSize(tokens.at(2).toLongLong()); - } - - // Note: We cannot use QFileInfo; permissions are for the server-side - // machine, and QFileInfo's behavior depends on the local platform. - int permissions = QUrlInfo::ReadOwner | QUrlInfo::WriteOwner - | QUrlInfo::ReadGroup | QUrlInfo::WriteGroup - | QUrlInfo::ReadOther | QUrlInfo::WriteOther; - QString ext; - int extIndex = name.lastIndexOf(QLatin1Char('.')); - if (extIndex != -1) - ext = name.mid(extIndex + 1); - if (ext == QLatin1String("exe") || ext == QLatin1String("bat") || ext == QLatin1String("com")) - permissions |= QUrlInfo::ExeOwner | QUrlInfo::ExeGroup | QUrlInfo::ExeOther; - info->setPermissions(permissions); - - info->setReadable(true); - info->setWritable(info->isFile()); - - QDateTime dateTime; + if(n == 2 || n == 4) + { + // Guess the year. + dateTime.setDate(QDate(QDate::currentDate().year(), + dateTime.date().month(), + dateTime.date().day())); + _q_fixupDateTime(&dateTime); + } + if(dateTime.isValid()) + info->setLastModified(dateTime); + + // Resolve permissions + int permissions = 0; + QString p = tokens.at(2); + permissions |= (p[0] == QLatin1Char('r') ? QUrlInfo::ReadOwner : 0); + permissions |= (p[1] == QLatin1Char('w') ? QUrlInfo::WriteOwner : 0); + permissions |= (p[2] == QLatin1Char('x') ? QUrlInfo::ExeOwner : 0); + permissions |= (p[3] == QLatin1Char('r') ? QUrlInfo::ReadGroup : 0); + permissions |= (p[4] == QLatin1Char('w') ? QUrlInfo::WriteGroup : 0); + permissions |= (p[5] == QLatin1Char('x') ? QUrlInfo::ExeGroup : 0); + permissions |= (p[6] == QLatin1Char('r') ? QUrlInfo::ReadOther : 0); + permissions |= (p[7] == QLatin1Char('w') ? QUrlInfo::WriteOther : 0); + permissions |= (p[8] == QLatin1Char('x') ? QUrlInfo::ExeOther : 0); + info->setPermissions(permissions); + + bool isOwner = info->owner() == userName; + info->setReadable((permissions & QUrlInfo::ReadOther) || ((permissions & QUrlInfo::ReadOwner) && isOwner)); + info->setWritable((permissions & QUrlInfo::WriteOther) || ((permissions & QUrlInfo::WriteOwner) && isOwner)); +} + +static void _q_parseDosDir(const QStringList & tokens, const QString & userName, QUrlInfo * info) +{ + // DOS style, 3 + 1 entries + // 01-16-02 11:14AM epsgroup + // 06-05-03 03:19PM 1973 readme.txt + if(tokens.size() != 4) + return; + + Q_UNUSED(userName); + + QString name = tokens.at(3); + info->setName(name); + info->setSymLink(name.toLower().endsWith(QLatin1String(".lnk"))); + + if(tokens.at(2) == QLatin1String("")) + { + info->setFile(false); + info->setDir(true); + } + else + { + info->setFile(true); + info->setDir(false); + info->setSize(tokens.at(2).toLongLong()); + } + + // Note: We cannot use QFileInfo; permissions are for the server-side + // machine, and QFileInfo's behavior depends on the local platform. + int permissions = QUrlInfo::ReadOwner | QUrlInfo::WriteOwner + | QUrlInfo::ReadGroup | QUrlInfo::WriteGroup + | QUrlInfo::ReadOther | QUrlInfo::WriteOther; + QString ext; + int extIndex = name.lastIndexOf(QLatin1Char('.')); + if(extIndex != -1) + ext = name.mid(extIndex + 1); + if(ext == QLatin1String("exe") || ext == QLatin1String("bat") || ext == QLatin1String("com")) + permissions |= QUrlInfo::ExeOwner | QUrlInfo::ExeGroup | QUrlInfo::ExeOther; + info->setPermissions(permissions); + + info->setReadable(true); + info->setWritable(info->isFile()); + + QDateTime dateTime; #ifndef QT_NO_DATESTRING - dateTime = QLocale::c().toDateTime(tokens.at(1), QLatin1String("MM-dd-yy hh:mmAP")); - if (dateTime.date().year() < 1971) { - dateTime.setDate(QDate(dateTime.date().year() + 100, - dateTime.date().month(), - dateTime.date().day())); - } + dateTime = QLocale::c().toDateTime(tokens.at(1), QLatin1String("MM-dd-yy hh:mmAP")); + if(dateTime.date().year() < 1971) + { + dateTime.setDate(QDate(dateTime.date().year() + 100, + dateTime.date().month(), + dateTime.date().day())); + } #endif - info->setLastModified(dateTime); - + info->setLastModified(dateTime); } -bool QFtpDTP::parseDir(const QByteArray &buffer, const QString &userName, QUrlInfo *info) +bool QFtpDTP::parseDir(const QByteArray & buffer, const QString & userName, QUrlInfo * info) { - if (buffer.isEmpty()) - return false; + if(buffer.isEmpty()) + return false; - QString bufferStr = QString::fromLatin1(buffer).trimmed(); + QString bufferStr = QString::fromLatin1(buffer).trimmed(); - // Unix style FTP servers - QRegExp unixPattern(QLatin1String("^([\\-dl])([a-zA-Z\\-]{9,9})\\s+\\d+\\s+(\\S*)\\s+" - "(\\S*)\\s+(\\d+)\\s+(\\S+\\s+\\S+\\s+\\S+)\\s+(\\S.*)")); - if (unixPattern.indexIn(bufferStr) == 0) { - _q_parseUnixDir(unixPattern.capturedTexts(), userName, info); - return true; - } + // Unix style FTP servers + QRegExp unixPattern(QLatin1String("^([\\-dl])([a-zA-Z\\-]{9,9})\\s+\\d+\\s+(\\S*)\\s+" + "(\\S*)\\s+(\\d+)\\s+(\\S+\\s+\\S+\\s+\\S+)\\s+(\\S.*)")); + if(unixPattern.indexIn(bufferStr) == 0) + { + _q_parseUnixDir(unixPattern.capturedTexts(), userName, info); + return true; + } - // DOS style FTP servers - QRegExp dosPattern(QLatin1String("^(\\d\\d-\\d\\d-\\d\\d\\d?\\d?\\ \\ \\d\\d:\\d\\d[AP]M)\\s+" - "(|\\d+)\\s+(\\S.*)$")); - if (dosPattern.indexIn(bufferStr) == 0) { - _q_parseDosDir(dosPattern.capturedTexts(), userName, info); - return true; - } + // DOS style FTP servers + QRegExp dosPattern(QLatin1String("^(\\d\\d-\\d\\d-\\d\\d\\d?\\d?\\ \\ \\d\\d:\\d\\d[AP]M)\\s+" + "(|\\d+)\\s+(\\S.*)$")); + if(dosPattern.indexIn(bufferStr) == 0) + { + _q_parseDosDir(dosPattern.capturedTexts(), userName, info); + return true; + } - // Unsupported - return false; + // Unsupported + return false; } void QFtpDTP::socketConnected() { - bytesDone = 0; + bytesDone = 0; #if defined(QFTPDTP_DEBUG) - qDebug("QFtpDTP::connectState(CsConnected)"); + qDebug("QFtpDTP::connectState(CsConnected)"); #endif - emit connectState(QFtpDTP::CsConnected); + emit connectState(QFtpDTP::CsConnected); } void QFtpDTP::socketReadyRead() { - if (!socket) - return; + if(!socket) + return; - if (pi->currentCommand().isEmpty()) { - socket->close(); + if(pi->currentCommand().isEmpty()) + { + socket->close(); #if defined(QFTPDTP_DEBUG) - qDebug("QFtpDTP::connectState(CsClosed)"); + qDebug("QFtpDTP::connectState(CsClosed)"); #endif - emit connectState(QFtpDTP::CsClosed); - return; - } - - if (pi->abortState == QFtpPI::AbortStarted) { - // discard data - socket->readAll(); - return; - } - - if (pi->currentCommand().startsWith(QLatin1String("LIST"))) { - while (socket->canReadLine()) { - QUrlInfo i; - QByteArray line = socket->readLine(); + emit connectState(QFtpDTP::CsClosed); + return; + } + + if(pi->abortState == QFtpPI::AbortStarted) + { + // discard data + socket->readAll(); + return; + } + + if(pi->currentCommand().startsWith(QLatin1String("LIST"))) + { + while(socket->canReadLine()) + { + QUrlInfo i; + QByteArray line = socket->readLine(); #if defined(QFTPDTP_DEBUG) - qDebug("QFtpDTP read (list): '%s'", line.constData()); + qDebug("QFtpDTP read (list): '%s'", line.constData()); #endif - if (parseDir(line, QLatin1String(""), &i)) { - emit listInfo(i); - } else { - // some FTP servers don't return a 550 if the file or directory - // does not exist, but rather write a text to the data socket - // -- try to catch these cases - if (line.endsWith("No such file or directory\r\n")) - err = QString::fromLatin1(line); - } - } - } else { - if (!is_ba && data.dev) { - do { - QByteArray ba; - ba.resize(socket->bytesAvailable()); - qint64 bytesRead = socket->read(ba.data(), ba.size()); - if (bytesRead < 0) { - // a read following a readyRead() signal will - // never fail. - return; - } - ba.resize(bytesRead); - bytesDone += bytesRead; + if(parseDir(line, QLatin1String(""), &i)) + { + emit listInfo(i); + } + else + { + // some FTP servers don't return a 550 if the file or directory + // does not exist, but rather write a text to the data socket + // -- try to catch these cases + if(line.endsWith("No such file or directory\r\n")) + err = QString::fromLatin1(line); + } + } + } + else + { + if(!is_ba && data.dev) + { + do + { + QByteArray ba; + ba.resize(socket->bytesAvailable()); + qint64 bytesRead = socket->read(ba.data(), ba.size()); + if(bytesRead < 0) + { + // a read following a readyRead() signal will + // never fail. + return; + } + ba.resize(bytesRead); + bytesDone += bytesRead; #if defined(QFTPDTP_DEBUG) - qDebug("QFtpDTP read: %lli bytes (total %lli bytes)", bytesRead, bytesDone); + qDebug("QFtpDTP read: %lli bytes (total %lli bytes)", bytesRead, bytesDone); #endif - if (data.dev) // make sure it wasn't deleted in the slot - data.dev->write(ba); - emit dataTransferProgress(bytesDone, bytesTotal); - - // Need to loop; dataTransferProgress is often connected to - // slots that update the GUI (e.g., progress bar values), and - // if events are processed, more data may have arrived. - } while (socket->bytesAvailable()); - } else { + if(data.dev) // make sure it wasn't deleted in the slot + data.dev->write(ba); + emit dataTransferProgress(bytesDone, bytesTotal); + + // Need to loop; dataTransferProgress is often connected to + // slots that update the GUI (e.g., progress bar values), and + // if events are processed, more data may have arrived. + } while(socket->bytesAvailable()); + } + else + { #if defined(QFTPDTP_DEBUG) - qDebug("QFtpDTP readyRead: %lli bytes available (total %lli bytes read)", - bytesAvailable(), bytesDone); + qDebug("QFtpDTP readyRead: %lli bytes available (total %lli bytes read)", + bytesAvailable(), bytesDone); #endif - emit dataTransferProgress(bytesDone+socket->bytesAvailable(), bytesTotal); - emit readyRead(); - } - } + emit dataTransferProgress(bytesDone + socket->bytesAvailable(), bytesTotal); + emit readyRead(); + } + } } void QFtpDTP::socketError(QAbstractSocket::SocketError e) { - if (e == QTcpSocket::HostNotFoundError) { + if(e == QTcpSocket::HostNotFoundError) + { #if defined(QFTPDTP_DEBUG) - qDebug("QFtpDTP::connectState(CsHostNotFound)"); + qDebug("QFtpDTP::connectState(CsHostNotFound)"); #endif - emit connectState(QFtpDTP::CsHostNotFound); - } else if (e == QTcpSocket::ConnectionRefusedError) { + emit connectState(QFtpDTP::CsHostNotFound); + } + else if(e == QTcpSocket::ConnectionRefusedError) + { #if defined(QFTPDTP_DEBUG) - qDebug("QFtpDTP::connectState(CsConnectionRefused)"); + qDebug("QFtpDTP::connectState(CsConnectionRefused)"); #endif - emit connectState(QFtpDTP::CsConnectionRefused); - } + emit connectState(QFtpDTP::CsConnectionRefused); + } } void QFtpDTP::socketConnectionClosed() { - if (!is_ba && data.dev) { - clearData(); - } + if(!is_ba && data.dev) + { + clearData(); + } - bytesFromSocket = socket->readAll(); + bytesFromSocket = socket->readAll(); #if defined(QFTPDTP_DEBUG) - qDebug("QFtpDTP::connectState(CsClosed)"); + qDebug("QFtpDTP::connectState(CsClosed)"); #endif - emit connectState(QFtpDTP::CsClosed); + emit connectState(QFtpDTP::CsClosed); } void QFtpDTP::socketBytesWritten(qint64 bytes) { - bytesDone += bytes; + bytesDone += bytes; #if defined(QFTPDTP_DEBUG) - qDebug("QFtpDTP::bytesWritten(%lli)", bytesDone); + qDebug("QFtpDTP::bytesWritten(%lli)", bytesDone); #endif - emit dataTransferProgress(bytesDone, bytesTotal); - if (callWriteData) - writeData(); + emit dataTransferProgress(bytesDone, bytesTotal); + if(callWriteData) + writeData(); } void QFtpDTP::setupSocket() { - socket = listener.nextPendingConnection(); - socket->setObjectName(QLatin1String("QFtpDTP Active state socket")); - connect(socket, SIGNAL(connected()), SLOT(socketConnected())); - connect(socket, SIGNAL(readyRead()), SLOT(socketReadyRead())); - connect(socket, SIGNAL(error(QAbstractSocket::SocketError)), SLOT(socketError(QAbstractSocket::SocketError))); - connect(socket, SIGNAL(disconnected()), SLOT(socketConnectionClosed())); - connect(socket, SIGNAL(bytesWritten(qint64)), SLOT(socketBytesWritten(qint64))); + socket = listener.nextPendingConnection(); + socket->setObjectName(QLatin1String("QFtpDTP Active state socket")); + connect(socket, SIGNAL(connected()), SLOT(socketConnected())); + connect(socket, SIGNAL(readyRead()), SLOT(socketReadyRead())); + connect(socket, SIGNAL(error(QAbstractSocket::SocketError)), SLOT(socketError(QAbstractSocket::SocketError))); + connect(socket, SIGNAL(disconnected()), SLOT(socketConnectionClosed())); + connect(socket, SIGNAL(bytesWritten(qint64)), SLOT(socketBytesWritten(qint64))); - listener.close(); + listener.close(); } void QFtpDTP::clearData() { - is_ba = false; - data.dev = 0; + is_ba = false; + data.dev = 0; } /********************************************************************** @@ -622,42 +666,41 @@ void QFtpDTP::clearData() * QFtpPI implemenatation * *********************************************************************/ -QFtpPI::QFtpPI(QObject *parent) : - QObject(parent), - rawCommand(false), - transferConnectionExtended(true), - dtp(this), - commandSocket(0), - state(Begin), abortState(None), - currentCmd(QString()), - waitForDtpToConnect(false), - waitForDtpToClose(false) -{ - commandSocket.setObjectName(QLatin1String("QFtpPI_socket")); - connect(&commandSocket, SIGNAL(hostFound()), - SLOT(hostFound())); - connect(&commandSocket, SIGNAL(connected()), - SLOT(connected())); - connect(&commandSocket, SIGNAL(disconnected()), - SLOT(connectionClosed())); - connect(&commandSocket, SIGNAL(readyRead()), - SLOT(readyRead())); - connect(&commandSocket, SIGNAL(error(QAbstractSocket::SocketError)), - SLOT(error(QAbstractSocket::SocketError))); - - connect(&dtp, SIGNAL(connectState(int)), - SLOT(dtpConnectState(int))); -} - -void QFtpPI::connectToHost(const QString &host, quint16 port) -{ - emit connectState(QFtp::HostLookup); +QFtpPI::QFtpPI(QObject * parent) : QObject(parent), + rawCommand(false), + transferConnectionExtended(true), + dtp(this), + commandSocket(0), + state(Begin), abortState(None), + currentCmd(QString()), + waitForDtpToConnect(false), + waitForDtpToClose(false) +{ + commandSocket.setObjectName(QLatin1String("QFtpPI_socket")); + connect(&commandSocket, SIGNAL(hostFound()), + SLOT(hostFound())); + connect(&commandSocket, SIGNAL(connected()), + SLOT(connected())); + connect(&commandSocket, SIGNAL(disconnected()), + SLOT(connectionClosed())); + connect(&commandSocket, SIGNAL(readyRead()), + SLOT(readyRead())); + connect(&commandSocket, SIGNAL(error(QAbstractSocket::SocketError)), + SLOT(error(QAbstractSocket::SocketError))); + + connect(&dtp, SIGNAL(connectState(int)), + SLOT(dtpConnectState(int))); +} + +void QFtpPI::connectToHost(const QString & host, quint16 port) +{ + emit connectState(QFtp::HostLookup); #ifndef QT_NO_BEARERMANAGEMENT - //copy network session down to the socket & DTP - commandSocket.setProperty("_q_networksession", property("_q_networksession")); - dtp.setProperty("_q_networksession", property("_q_networksession")); + //copy network session down to the socket & DTP + commandSocket.setProperty("_q_networksession", property("_q_networksession")); + dtp.setProperty("_q_networksession", property("_q_networksession")); #endif - commandSocket.connectToHost(host, port); + commandSocket.connectToHost(host, port); } /* @@ -668,141 +711,153 @@ void QFtpPI::connectToHost(const QString &host, quint16 port) If there are pending commands in the queue this functions returns false and the \a cmds are not added to the queue; otherwise it returns true. */ -bool QFtpPI::sendCommands(const QStringList &cmds) +bool QFtpPI::sendCommands(const QStringList & cmds) { - if (!pendingCommands.isEmpty()) - return false; + if(!pendingCommands.isEmpty()) + return false; - if (commandSocket.state() != QTcpSocket::ConnectedState || state!=Idle) { - emit error(QFtp::NotConnected, QFtp::tr("Not connected")); - return true; // there are no pending commands - } + if(commandSocket.state() != QTcpSocket::ConnectedState || state != Idle) + { + emit error(QFtp::NotConnected, QFtp::tr("Not connected")); + return true; // there are no pending commands + } - pendingCommands = cmds; - startNextCmd(); - return true; + pendingCommands = cmds; + startNextCmd(); + return true; } void QFtpPI::clearPendingCommands() { - pendingCommands.clear(); - dtp.abortConnection(); - currentCmd.clear(); - state = Idle; + pendingCommands.clear(); + dtp.abortConnection(); + currentCmd.clear(); + state = Idle; } void QFtpPI::abort() { - pendingCommands.clear(); + pendingCommands.clear(); - if (abortState != None) - // ABOR already sent - return; + if(abortState != None) + // ABOR already sent + return; - abortState = AbortStarted; + abortState = AbortStarted; #if defined(QFTPPI_DEBUG) - qDebug("QFtpPI send: ABOR"); + qDebug("QFtpPI send: ABOR"); #endif - commandSocket.write("ABOR\r\n", 6); + commandSocket.write("ABOR\r\n", 6); - if (currentCmd.startsWith(QLatin1String("STOR "))) - dtp.abortConnection(); + if(currentCmd.startsWith(QLatin1String("STOR "))) + dtp.abortConnection(); } void QFtpPI::hostFound() { - emit connectState(QFtp::Connecting); + emit connectState(QFtp::Connecting); } void QFtpPI::connected() { - state = Begin; + state = Begin; #if defined(QFTPPI_DEBUG) // qDebug("QFtpPI state: %d [connected()]", state); #endif - // try to improve performance by setting TCP_NODELAY - commandSocket.setSocketOption(QAbstractSocket::LowDelayOption, 1); + // try to improve performance by setting TCP_NODELAY + commandSocket.setSocketOption(QAbstractSocket::LowDelayOption, 1); - emit connectState(QFtp::Connected); + emit connectState(QFtp::Connected); } void QFtpPI::connectionClosed() { - commandSocket.close(); - emit connectState(QFtp::Unconnected); + commandSocket.close(); + emit connectState(QFtp::Unconnected); } void QFtpPI::delayedCloseFinished() { - emit connectState(QFtp::Unconnected); + emit connectState(QFtp::Unconnected); } void QFtpPI::error(QAbstractSocket::SocketError e) { - if (e == QTcpSocket::HostNotFoundError) { - emit connectState(QFtp::Unconnected); - emit error(QFtp::HostNotFound, - QFtp::tr("Host %1 not found").arg(commandSocket.peerName())); - } else if (e == QTcpSocket::ConnectionRefusedError) { - emit connectState(QFtp::Unconnected); - emit error(QFtp::ConnectionRefused, - QFtp::tr("Connection refused to host %1").arg(commandSocket.peerName())); - } else if (e == QTcpSocket::SocketTimeoutError) { - emit connectState(QFtp::Unconnected); - emit error(QFtp::ConnectionRefused, - QFtp::tr("Connection timed out to host %1").arg(commandSocket.peerName())); - } + if(e == QTcpSocket::HostNotFoundError) + { + emit connectState(QFtp::Unconnected); + emit error(QFtp::HostNotFound, + QFtp::tr("Host %1 not found").arg(commandSocket.peerName())); + } + else if(e == QTcpSocket::ConnectionRefusedError) + { + emit connectState(QFtp::Unconnected); + emit error(QFtp::ConnectionRefused, + QFtp::tr("Connection refused to host %1").arg(commandSocket.peerName())); + } + else if(e == QTcpSocket::SocketTimeoutError) + { + emit connectState(QFtp::Unconnected); + emit error(QFtp::ConnectionRefused, + QFtp::tr("Connection timed out to host %1").arg(commandSocket.peerName())); + } } void QFtpPI::readyRead() { - if (waitForDtpToClose) - return; - - while (commandSocket.canReadLine()) { - // read line with respect to line continuation - QString line = QString::fromLatin1(commandSocket.readLine()); - if (replyText.isEmpty()) { - if (line.length() < 3) { - // protocol error - return; - } - const int lowerLimit[3] = {1,0,0}; - const int upperLimit[3] = {5,5,9}; - for (int i=0; i<3; i++) { - replyCode[i] = line[i].digitValue(); - if (replyCode[i]upperLimit[i]) { - // protocol error - return; - } - } - } - QString endOfMultiLine; - endOfMultiLine[0] = '0' + replyCode[0]; - endOfMultiLine[1] = '0' + replyCode[1]; - endOfMultiLine[2] = '0' + replyCode[2]; - endOfMultiLine[3] = QLatin1Char(' '); - QString lineCont(endOfMultiLine); - lineCont[3] = QLatin1Char('-'); - QString lineLeft4 = line.left(4); - - while (lineLeft4 != endOfMultiLine) { - if (lineLeft4 == lineCont) - replyText += line.mid(4); // strip 'xyz-' - else - replyText += line; - if (!commandSocket.canReadLine()) - return; - line = QString::fromLatin1(commandSocket.readLine()); - lineLeft4 = line.left(4); - } - replyText += line.mid(4); // strip reply code 'xyz ' - if (replyText.endsWith(QLatin1String("\r\n"))) - replyText.chop(2); - - if (processReply()) - replyText = QLatin1String(""); - } + if(waitForDtpToClose) + return; + + while(commandSocket.canReadLine()) + { + // read line with respect to line continuation + QString line = QString::fromLatin1(commandSocket.readLine()); + if(replyText.isEmpty()) + { + if(line.length() < 3) + { + // protocol error + return; + } + const int lowerLimit[3] = { 1, 0, 0 }; + const int upperLimit[3] = { 5, 5, 9 }; + for(int i = 0; i < 3; i++) + { + replyCode[i] = line[i].digitValue(); + if(replyCode[i] < lowerLimit[i] || replyCode[i] > upperLimit[i]) + { + // protocol error + return; + } + } + } + QString endOfMultiLine; + endOfMultiLine[0] = '0' + replyCode[0]; + endOfMultiLine[1] = '0' + replyCode[1]; + endOfMultiLine[2] = '0' + replyCode[2]; + endOfMultiLine[3] = QLatin1Char(' '); + QString lineCont(endOfMultiLine); + lineCont[3] = QLatin1Char('-'); + QString lineLeft4 = line.left(4); + + while(lineLeft4 != endOfMultiLine) + { + if(lineLeft4 == lineCont) + replyText += line.mid(4); // strip 'xyz-' + else + replyText += line; + if(!commandSocket.canReadLine()) + return; + line = QString::fromLatin1(commandSocket.readLine()); + lineLeft4 = line.left(4); + } + replyText += line.mid(4); // strip reply code 'xyz ' + if(replyText.endsWith(QLatin1String("\r\n"))) + replyText.chop(2); + + if(processReply()) + replyText = QLatin1String(""); + } } /* @@ -814,175 +869,206 @@ void QFtpPI::readyRead() bool QFtpPI::processReply() { #if defined(QFTPPI_DEBUG) -// qDebug("QFtpPI state: %d [processReply() begin]", state); - if (replyText.length() < 400) - qDebug("QFtpPI recv: %d %s", 100*replyCode[0]+10*replyCode[1]+replyCode[2], replyText.toLatin1().constData()); - else - qDebug("QFtpPI recv: %d (text skipped)", 100*replyCode[0]+10*replyCode[1]+replyCode[2]); + // qDebug("QFtpPI state: %d [processReply() begin]", state); + if(replyText.length() < 400) + qDebug("QFtpPI recv: %d %s", 100 * replyCode[0] + 10 * replyCode[1] + replyCode[2], replyText.toLatin1().constData()); + else + qDebug("QFtpPI recv: %d (text skipped)", 100 * replyCode[0] + 10 * replyCode[1] + replyCode[2]); #endif - int replyCodeInt = 100*replyCode[0] + 10*replyCode[1] + replyCode[2]; - - // process 226 replies ("Closing Data Connection") only when the data - // connection is really closed to avoid short reads of the DTP - if (replyCodeInt == 226 || (replyCodeInt == 250 && currentCmd.startsWith(QLatin1String("RETR")))) { - if (dtp.state() != QTcpSocket::UnconnectedState) { - waitForDtpToClose = true; - return false; - } - } - - switch (abortState) { - case AbortStarted: - abortState = WaitForAbortToFinish; - break; - case WaitForAbortToFinish: - abortState = None; - return true; - default: - break; - } - - // get new state - static const State table[5] = { - /* 1yz 2yz 3yz 4yz 5yz */ - Waiting, Success, Idle, Failure, Failure - }; - switch (state) { - case Begin: - if (replyCode[0] == 1) { - return true; - } else if (replyCode[0] == 2) { - state = Idle; - emit finished(QFtp::tr("Connected to host %1").arg(commandSocket.peerName())); - break; - } - // reply codes not starting with 1 or 2 are not handled. - return true; - case Waiting: - if (static_cast(replyCode[0]) < 0 || replyCode[0] > 5) - state = Failure; - else + int replyCodeInt = 100 * replyCode[0] + 10 * replyCode[1] + replyCode[2]; + + // process 226 replies ("Closing Data Connection") only when the data + // connection is really closed to avoid short reads of the DTP + if(replyCodeInt == 226 || (replyCodeInt == 250 && currentCmd.startsWith(QLatin1String("RETR")))) + { + if(dtp.state() != QTcpSocket::UnconnectedState) + { + waitForDtpToClose = true; + return false; + } + } + + switch(abortState) + { + case AbortStarted: + abortState = WaitForAbortToFinish; + break; + case WaitForAbortToFinish: + abortState = None; + return true; + default: + break; + } + + // get new state + static const State table[5] = { + /* 1yz 2yz 3yz 4yz 5yz */ + Waiting, Success, Idle, Failure, Failure + }; + switch(state) + { + case Begin: + if(replyCode[0] == 1) + { + return true; + } + else if(replyCode[0] == 2) + { + state = Idle; + emit finished(QFtp::tr("Connected to host %1").arg(commandSocket.peerName())); + break; + } + // reply codes not starting with 1 or 2 are not handled. + return true; + case Waiting: + if(static_cast(replyCode[0]) < 0 || replyCode[0] > 5) + state = Failure; + else #if defined(Q_OS_IRIX) && defined(Q_CC_GNU) - { - // work around a crash on 64 bit gcc IRIX - State *t = (State *) table; - state = t[replyCode[0] - 1]; - } + { + // work around a crash on 64 bit gcc IRIX + State * t = (State *)table; + state = t[replyCode[0] - 1]; + } #else - if (replyCodeInt == 202) - state = Failure; - else - state = table[replyCode[0] - 1]; + if(replyCodeInt == 202) + state = Failure; + else + state = table[replyCode[0] - 1]; #endif - break; - default: - // ignore unrequested message - return true; - } + break; + default: + // ignore unrequested message + return true; + } #if defined(QFTPPI_DEBUG) // qDebug("QFtpPI state: %d [processReply() intermediate]", state); #endif - // special actions on certain replies - emit rawFtpReply(replyCodeInt, replyText); - if (rawCommand) { - rawCommand = false; - } else if (replyCodeInt == 227) { - // 227 Entering Passive Mode (h1,h2,h3,h4,p1,p2) - // rfc959 does not define this response precisely, and gives - // both examples where the parenthesis are used, and where - // they are missing. We need to scan for the address and host - // info. - QRegExp addrPortPattern(QLatin1String("(\\d+),(\\d+),(\\d+),(\\d+),(\\d+),(\\d+)")); - if (addrPortPattern.indexIn(replyText) == -1) { + // special actions on certain replies + emit rawFtpReply(replyCodeInt, replyText); + if(rawCommand) + { + rawCommand = false; + } + else if(replyCodeInt == 227) + { + // 227 Entering Passive Mode (h1,h2,h3,h4,p1,p2) + // rfc959 does not define this response precisely, and gives + // both examples where the parenthesis are used, and where + // they are missing. We need to scan for the address and host + // info. + QRegExp addrPortPattern(QLatin1String("(\\d+),(\\d+),(\\d+),(\\d+),(\\d+),(\\d+)")); + if(addrPortPattern.indexIn(replyText) == -1) + { #if defined(QFTPPI_DEBUG) - qDebug("QFtp: bad 227 response -- address and port information missing"); + qDebug("QFtp: bad 227 response -- address and port information missing"); #endif - // this error should be reported - } else { - QStringList lst = addrPortPattern.capturedTexts(); - QString host = lst[1] + QLatin1Char('.') + lst[2] + QLatin1Char('.') + lst[3] + QLatin1Char('.') + lst[4]; - quint16 port = (lst[5].toUInt() << 8) + lst[6].toUInt(); - waitForDtpToConnect = true; - dtp.connectToHost(host, port); - } - } else if (replyCodeInt == 229) { - // 229 Extended Passive mode OK (|||10982|) - int portPos = replyText.indexOf(QLatin1Char('(')); - if (portPos == -1) { + // this error should be reported + } + else + { + QStringList lst = addrPortPattern.capturedTexts(); + QString host = lst[1] + QLatin1Char('.') + lst[2] + QLatin1Char('.') + lst[3] + QLatin1Char('.') + lst[4]; + quint16 port = (lst[5].toUInt() << 8) + lst[6].toUInt(); + waitForDtpToConnect = true; + dtp.connectToHost(host, port); + } + } + else if(replyCodeInt == 229) + { + // 229 Extended Passive mode OK (|||10982|) + int portPos = replyText.indexOf(QLatin1Char('(')); + if(portPos == -1) + { #if defined(QFTPPI_DEBUG) - qDebug("QFtp: bad 229 response -- port information missing"); + qDebug("QFtp: bad 229 response -- port information missing"); #endif - // this error should be reported - } else { - ++portPos; - QChar delimiter = replyText.at(portPos); - QStringList epsvParameters = replyText.mid(portPos).split(delimiter); - - waitForDtpToConnect = true; - dtp.connectToHost(commandSocket.peerAddress().toString(), - epsvParameters.at(3).toInt()); - } - - } else if (replyCodeInt == 230) { - if (currentCmd.startsWith(QLatin1String("USER ")) && pendingCommands.count()>0 && - pendingCommands.first().startsWith(QLatin1String("PASS "))) { - // no need to send the PASS -- we are already logged in - pendingCommands.pop_front(); - } - // 230 User logged in, proceed. - emit connectState(QFtp::LoggedIn); - } else if (replyCodeInt == 213) { - // 213 File status. - if (currentCmd.startsWith(QLatin1String("SIZE "))) - dtp.setBytesTotal(replyText.simplified().toLongLong()); - } else if (replyCode[0]==1 && currentCmd.startsWith(QLatin1String("STOR "))) { - dtp.waitForConnection(); - dtp.writeData(); - } - - // react on new state - switch (state) { - case Begin: - // should never happen - break; - case Success: - // success handling - state = Idle; - // no break! - case Idle: - if (dtp.hasError()) { - emit error(QFtp::UnknownError, dtp.errorMessage()); - dtp.clearError(); - } - startNextCmd(); - break; - case Waiting: - // do nothing - break; - case Failure: - // If the EPSV or EPRT commands fail, replace them with - // the old PASV and PORT instead and try again. - if (currentCmd.startsWith(QLatin1String("EPSV"))) { - transferConnectionExtended = false; - pendingCommands.prepend(QLatin1String("PASV\r\n")); - } else if (currentCmd.startsWith(QLatin1String("EPRT"))) { - transferConnectionExtended = false; - pendingCommands.prepend(QLatin1String("PORT\r\n")); - } else { - emit error(QFtp::UnknownError, replyText); - } - if (state != Waiting) { - state = Idle; - startNextCmd(); - } - break; - } + // this error should be reported + } + else + { + ++portPos; + QChar delimiter = replyText.at(portPos); + QStringList epsvParameters = replyText.mid(portPos).split(delimiter); + + waitForDtpToConnect = true; + dtp.connectToHost(commandSocket.peerAddress().toString(), + epsvParameters.at(3).toInt()); + } + } + else if(replyCodeInt == 230) + { + if(currentCmd.startsWith(QLatin1String("USER ")) && pendingCommands.count() > 0 && pendingCommands.first().startsWith(QLatin1String("PASS "))) + { + // no need to send the PASS -- we are already logged in + pendingCommands.pop_front(); + } + // 230 User logged in, proceed. + emit connectState(QFtp::LoggedIn); + } + else if(replyCodeInt == 213) + { + // 213 File status. + if(currentCmd.startsWith(QLatin1String("SIZE "))) + dtp.setBytesTotal(replyText.simplified().toLongLong()); + } + else if(replyCode[0] == 1 && currentCmd.startsWith(QLatin1String("STOR "))) + { + dtp.waitForConnection(); + dtp.writeData(); + } + + // react on new state + switch(state) + { + case Begin: + // should never happen + break; + case Success: + // success handling + state = Idle; + // no break! + case Idle: + if(dtp.hasError()) + { + emit error(QFtp::UnknownError, dtp.errorMessage()); + dtp.clearError(); + } + startNextCmd(); + break; + case Waiting: + // do nothing + break; + case Failure: + // If the EPSV or EPRT commands fail, replace them with + // the old PASV and PORT instead and try again. + if(currentCmd.startsWith(QLatin1String("EPSV"))) + { + transferConnectionExtended = false; + pendingCommands.prepend(QLatin1String("PASV\r\n")); + } + else if(currentCmd.startsWith(QLatin1String("EPRT"))) + { + transferConnectionExtended = false; + pendingCommands.prepend(QLatin1String("PORT\r\n")); + } + else + { + emit error(QFtp::UnknownError, replyText); + } + if(state != Waiting) + { + state = Idle; + startNextCmd(); + } + break; + } #if defined(QFTPPI_DEBUG) // qDebug("QFtpPI state: %d [processReply() end]", state); #endif - return true; + return true; } /* @@ -991,94 +1077,105 @@ bool QFtpPI::processReply() */ bool QFtpPI::startNextCmd() { - if (waitForDtpToConnect) - // don't process any new commands until we are connected - return true; + if(waitForDtpToConnect) + // don't process any new commands until we are connected + return true; #if defined(QFTPPI_DEBUG) - if (state != Idle) - qDebug("QFtpPI startNextCmd: internal error! QFtpPI called in non-idle state %d", state); + if(state != Idle) + qDebug("QFtpPI startNextCmd: internal error! QFtpPI called in non-idle state %d", state); #endif - if (pendingCommands.isEmpty()) { - currentCmd.clear(); - emit finished(replyText); - return false; - } - currentCmd = pendingCommands.first(); - - // PORT and PASV are edited in-place, depending on whether we - // should try the extended transfer connection commands EPRT and - // EPSV. The PORT command also triggers setting up a listener, and - // the address/port arguments are edited in. - QHostAddress address = commandSocket.localAddress(); - if (currentCmd.startsWith(QLatin1String("PORT"))) { - if ((address.protocol() == QTcpSocket::IPv6Protocol) && transferConnectionExtended) { - int port = dtp.setupListener(address); - currentCmd = QLatin1String("EPRT |"); - currentCmd += (address.protocol() == QTcpSocket::IPv4Protocol) ? QLatin1Char('1') : QLatin1Char('2'); - currentCmd += QLatin1Char('|') + address.toString() + QLatin1Char('|') + QString::number(port); - currentCmd += QLatin1Char('|'); - } else if (address.protocol() == QTcpSocket::IPv4Protocol) { - int port = dtp.setupListener(address); - QString portArg; - quint32 ip = address.toIPv4Address(); - portArg += QString::number((ip & 0xff000000) >> 24); - portArg += QLatin1Char(',') + QString::number((ip & 0xff0000) >> 16); - portArg += QLatin1Char(',') + QString::number((ip & 0xff00) >> 8); - portArg += QLatin1Char(',') + QString::number(ip & 0xff); - portArg += QLatin1Char(',') + QString::number((port & 0xff00) >> 8); - portArg += QLatin1Char(',') + QString::number(port & 0xff); - - currentCmd = QLatin1String("PORT "); - currentCmd += portArg; - } else { - // No IPv6 connection can be set up with the PORT - // command. - return false; - } - - currentCmd += QLatin1String("\r\n"); - } else if (currentCmd.startsWith(QLatin1String("PASV"))) { - if ((address.protocol() == QTcpSocket::IPv6Protocol) && transferConnectionExtended) - currentCmd = QLatin1String("EPSV\r\n"); - } - - pendingCommands.pop_front(); + if(pendingCommands.isEmpty()) + { + currentCmd.clear(); + emit finished(replyText); + return false; + } + currentCmd = pendingCommands.first(); + + // PORT and PASV are edited in-place, depending on whether we + // should try the extended transfer connection commands EPRT and + // EPSV. The PORT command also triggers setting up a listener, and + // the address/port arguments are edited in. + QHostAddress address = commandSocket.localAddress(); + if(currentCmd.startsWith(QLatin1String("PORT"))) + { + if((address.protocol() == QTcpSocket::IPv6Protocol) && transferConnectionExtended) + { + int port = dtp.setupListener(address); + currentCmd = QLatin1String("EPRT |"); + currentCmd += (address.protocol() == QTcpSocket::IPv4Protocol) ? QLatin1Char('1') : QLatin1Char('2'); + currentCmd += QLatin1Char('|') + address.toString() + QLatin1Char('|') + QString::number(port); + currentCmd += QLatin1Char('|'); + } + else if(address.protocol() == QTcpSocket::IPv4Protocol) + { + int port = dtp.setupListener(address); + QString portArg; + quint32 ip = address.toIPv4Address(); + portArg += QString::number((ip & 0xff000000) >> 24); + portArg += QLatin1Char(',') + QString::number((ip & 0xff0000) >> 16); + portArg += QLatin1Char(',') + QString::number((ip & 0xff00) >> 8); + portArg += QLatin1Char(',') + QString::number(ip & 0xff); + portArg += QLatin1Char(',') + QString::number((port & 0xff00) >> 8); + portArg += QLatin1Char(',') + QString::number(port & 0xff); + + currentCmd = QLatin1String("PORT "); + currentCmd += portArg; + } + else + { + // No IPv6 connection can be set up with the PORT + // command. + return false; + } + + currentCmd += QLatin1String("\r\n"); + } + else if(currentCmd.startsWith(QLatin1String("PASV"))) + { + if((address.protocol() == QTcpSocket::IPv6Protocol) && transferConnectionExtended) + currentCmd = QLatin1String("EPSV\r\n"); + } + + pendingCommands.pop_front(); #if defined(QFTPPI_DEBUG) - qDebug("QFtpPI send: %s", currentCmd.left(currentCmd.length()-2).toLatin1().constData()); + qDebug("QFtpPI send: %s", currentCmd.left(currentCmd.length() - 2).toLatin1().constData()); #endif - state = Waiting; - commandSocket.write(currentCmd.toLatin1()); - return true; + state = Waiting; + commandSocket.write(currentCmd.toLatin1()); + return true; } void QFtpPI::dtpConnectState(int s) { - switch (s) { - case QFtpDTP::CsClosed: - if (waitForDtpToClose) { - // there is an unprocessed reply - if (processReply()) - replyText = QLatin1String(""); - else - return; - } - waitForDtpToClose = false; - readyRead(); - return; - case QFtpDTP::CsConnected: - waitForDtpToConnect = false; - startNextCmd(); - return; - case QFtpDTP::CsHostNotFound: - case QFtpDTP::CsConnectionRefused: - emit error(QFtp::ConnectionRefused, - QFtp::tr("Connection refused for data connection")); - startNextCmd(); - return; - default: - return; - } + switch(s) + { + case QFtpDTP::CsClosed: + if(waitForDtpToClose) + { + // there is an unprocessed reply + if(processReply()) + replyText = QLatin1String(""); + else + return; + } + waitForDtpToClose = false; + readyRead(); + return; + case QFtpDTP::CsConnected: + waitForDtpToConnect = false; + startNextCmd(); + return; + case QFtpDTP::CsHostNotFound: + case QFtpDTP::CsConnectionRefused: + emit error(QFtp::ConnectionRefused, + QFtp::tr("Connection refused for data connection")); + startNextCmd(); + return; + default: + return; + } } /********************************************************************** @@ -1089,48 +1186,53 @@ void QFtpPI::dtpConnectState(int s) class QFtpPrivate { - Q_DECLARE_PUBLIC(QFtp) + Q_DECLARE_PUBLIC(QFtp) public: - - inline QFtpPrivate(QFtp *owner) : close_waitForStateChange(false), state(QFtp::Unconnected), - transferMode(QFtp::Passive), error(QFtp::NoError), q_ptr(owner) - { } - - ~QFtpPrivate() { while (!pending.isEmpty()) delete pending.takeFirst(); } - - // private slots - void _q_startNextCommand(); - void _q_piFinished(const QString&); - void _q_piError(int, const QString&); - void _q_piConnectState(int); - void _q_piFtpReply(int, const QString&); - - int addCommand(QFtpCommand *cmd); - - QFtpPI pi; - QList pending; - bool close_waitForStateChange; - QFtp::State state; - QFtp::TransferMode transferMode; - QFtp::Error error; - QString errorString; - - QString host; - quint16 port; - QString proxyHost; - quint16 proxyPort; - QFtp *q_ptr; + inline QFtpPrivate(QFtp * owner) : close_waitForStateChange(false), state(QFtp::Unconnected), + transferMode(QFtp::Passive), error(QFtp::NoError), q_ptr(owner) + { + } + + ~QFtpPrivate() + { + while(!pending.isEmpty()) + delete pending.takeFirst(); + } + + // private slots + void _q_startNextCommand(); + void _q_piFinished(const QString &); + void _q_piError(int, const QString &); + void _q_piConnectState(int); + void _q_piFtpReply(int, const QString &); + + int addCommand(QFtpCommand * cmd); + + QFtpPI pi; + QList pending; + bool close_waitForStateChange; + QFtp::State state; + QFtp::TransferMode transferMode; + QFtp::Error error; + QString errorString; + + QString host; + quint16 port; + QString proxyHost; + quint16 proxyPort; + QFtp * q_ptr; }; -int QFtpPrivate::addCommand(QFtpCommand *cmd) +int QFtpPrivate::addCommand(QFtpCommand * cmd) { - pending.append(cmd); + pending.append(cmd); - if (pending.count() == 1) { - // don't emit the commandStarted() signal before the ID is returned - QTimer::singleShot(0, q_func(), SLOT(_q_startNextCommand())); - } - return cmd->id; + if(pending.count() == 1) + { + // don't emit the commandStarted() signal before the ID is returned + QTimer::singleShot(0, q_func(), SLOT(_q_startNextCommand())); + } + return cmd->id; } /********************************************************************** @@ -1240,54 +1342,52 @@ int QFtpPrivate::addCommand(QFtpCommand *cmd) {FTP Example} */ - /*! Constructs a QFtp object with the given \a parent. */ -QFtp::QFtp(QObject *parent) +QFtp::QFtp(QObject * parent) : QObject(parent), d(new QFtpPrivate(this)) { - d->errorString = tr("Unknown error"); + d->errorString = tr("Unknown error"); - connect(&d->pi, SIGNAL(connectState(int)), - SLOT(_q_piConnectState(int))); - connect(&d->pi, SIGNAL(finished(QString)), - SLOT(_q_piFinished(QString))); - connect(&d->pi, SIGNAL(error(int,QString)), - SLOT(_q_piError(int,QString))); - connect(&d->pi, SIGNAL(rawFtpReply(int,QString)), - SLOT(_q_piFtpReply(int,QString))); + connect(&d->pi, SIGNAL(connectState(int)), + SLOT(_q_piConnectState(int))); + connect(&d->pi, SIGNAL(finished(QString)), + SLOT(_q_piFinished(QString))); + connect(&d->pi, SIGNAL(error(int, QString)), + SLOT(_q_piError(int, QString))); + connect(&d->pi, SIGNAL(rawFtpReply(int, QString)), + SLOT(_q_piFtpReply(int, QString))); - connect(&d->pi.dtp, SIGNAL(readyRead()), - SIGNAL(readyRead())); - connect(&d->pi.dtp, SIGNAL(dataTransferProgress(qint64,qint64)), - SIGNAL(dataTransferProgress(qint64,qint64))); - connect(&d->pi.dtp, SIGNAL(listInfo(QUrlInfo)), - SIGNAL(listInfo(QUrlInfo))); + connect(&d->pi.dtp, SIGNAL(readyRead()), + SIGNAL(readyRead())); + connect(&d->pi.dtp, SIGNAL(dataTransferProgress(qint64, qint64)), + SIGNAL(dataTransferProgress(qint64, qint64))); + connect(&d->pi.dtp, SIGNAL(listInfo(QUrlInfo)), + SIGNAL(listInfo(QUrlInfo))); } void QFtp::_q_startNextCommand() { d->_q_startNextCommand(); } -void QFtp::_q_piFinished(const QString&a) +void QFtp::_q_piFinished(const QString & a) { d->_q_piFinished(a); } -void QFtp::_q_piError(int a, const QString&b) +void QFtp::_q_piError(int a, const QString & b) { - d->_q_piError(a,b); + d->_q_piError(a, b); } void QFtp::_q_piConnectState(int a) { d->_q_piConnectState(a); } -void QFtp::_q_piFtpReply(int a, const QString&b) +void QFtp::_q_piFtpReply(int a, const QString & b) { - d->_q_piFtpReply(a,b); + d->_q_piFtpReply(a, b); } - /*! \enum QFtp::State @@ -1498,14 +1598,14 @@ void QFtp::_q_piFtpReply(int a, const QString&b) \sa stateChanged() commandStarted() commandFinished() */ -int QFtp::connectToHost(const QString &host, quint16 port) +int QFtp::connectToHost(const QString & host, quint16 port) { - QStringList cmds; - cmds << host; - cmds << QString::number((uint)port); - int id = d->addCommand(new QFtpCommand(ConnectToHost, cmds)); - d->pi.transferConnectionExtended = true; - return id; + QStringList cmds; + cmds << host; + cmds << QString::number((uint)port); + int id = d->addCommand(new QFtpCommand(ConnectToHost, cmds)); + d->pi.transferConnectionExtended = true; + return id; } /*! @@ -1526,12 +1626,12 @@ int QFtp::connectToHost(const QString &host, quint16 port) \sa commandStarted() commandFinished() */ -int QFtp::login(const QString &user, const QString &password) +int QFtp::login(const QString & user, const QString & password) { - QStringList cmds; - cmds << (QLatin1String("USER ") + (user.isNull() ? QLatin1String("anonymous") : user) + QLatin1String("\r\n")); - cmds << (QLatin1String("PASS ") + (password.isNull() ? QLatin1String("anonymous@") : password) + QLatin1String("\r\n")); - return d->addCommand(new QFtpCommand(Login, cmds)); + QStringList cmds; + cmds << (QLatin1String("USER ") + (user.isNull() ? QLatin1String("anonymous") : user) + QLatin1String("\r\n")); + cmds << (QLatin1String("PASS ") + (password.isNull() ? QLatin1String("anonymous@") : password) + QLatin1String("\r\n")); + return d->addCommand(new QFtpCommand(Login, cmds)); } /*! @@ -1554,7 +1654,7 @@ int QFtp::login(const QString &user, const QString &password) */ int QFtp::close() { - return d->addCommand(new QFtpCommand(Close, QStringList(QLatin1String("QUIT\r\n")))); + return d->addCommand(new QFtpCommand(Close, QStringList(QLatin1String("QUIT\r\n")))); } /*! @@ -1564,10 +1664,10 @@ int QFtp::close() */ int QFtp::setTransferMode(TransferMode mode) { - int id = d->addCommand(new QFtpCommand(SetTransferMode, QStringList())); - d->pi.transferConnectionExtended = true; - d->transferMode = mode; - return id; + int id = d->addCommand(new QFtpCommand(SetTransferMode, QStringList())); + d->pi.transferConnectionExtended = true; + d->transferMode = mode; + return id; } /*! @@ -1577,11 +1677,11 @@ int QFtp::setTransferMode(TransferMode mode) QFtp does not support FTP-over-HTTP proxy servers. Use QNetworkAccessManager for this. */ -int QFtp::setProxy(const QString &host, quint16 port) +int QFtp::setProxy(const QString & host, quint16 port) { - QStringList args; - args << host << QString::number(port); - return d->addCommand(new QFtpCommand(SetProxy, args)); + QStringList args; + args << host << QString::number(port); + return d->addCommand(new QFtpCommand(SetProxy, args)); } /*! @@ -1601,16 +1701,16 @@ int QFtp::setProxy(const QString &host, quint16 port) \sa listInfo() commandStarted() commandFinished() */ -int QFtp::list(const QString &dir) +int QFtp::list(const QString & dir) { - QStringList cmds; - cmds << QLatin1String("TYPE A\r\n"); - cmds << QLatin1String(d->transferMode == Passive ? "PASV\r\n" : "PORT\r\n"); - if (dir.isEmpty()) - cmds << QLatin1String("LIST\r\n"); - else - cmds << (QLatin1String("LIST ") + dir + QLatin1String("\r\n")); - return d->addCommand(new QFtpCommand(List, cmds)); + QStringList cmds; + cmds << QLatin1String("TYPE A\r\n"); + cmds << QLatin1String(d->transferMode == Passive ? "PASV\r\n" : "PORT\r\n"); + if(dir.isEmpty()) + cmds << QLatin1String("LIST\r\n"); + else + cmds << (QLatin1String("LIST ") + dir + QLatin1String("\r\n")); + return d->addCommand(new QFtpCommand(List, cmds)); } /*! @@ -1627,9 +1727,9 @@ int QFtp::list(const QString &dir) \sa commandStarted() commandFinished() */ -int QFtp::cd(const QString &dir) +int QFtp::cd(const QString & dir) { - return d->addCommand(new QFtpCommand(Cd, QStringList(QLatin1String("CWD ") + dir + QLatin1String("\r\n")))); + return d->addCommand(new QFtpCommand(Cd, QStringList(QLatin1String("CWD ") + dir + QLatin1String("\r\n")))); } /*! @@ -1672,17 +1772,17 @@ int QFtp::cd(const QString &dir) \sa readyRead() dataTransferProgress() commandStarted() commandFinished() */ -int QFtp::get(const QString &file, QIODevice *dev, TransferType type) +int QFtp::get(const QString & file, QIODevice * dev, TransferType type) { - QStringList cmds; - if (type == Binary) - cmds << QLatin1String("TYPE I\r\n"); - else - cmds << QLatin1String("TYPE A\r\n"); - cmds << QLatin1String("SIZE ") + file + QLatin1String("\r\n"); - cmds << QLatin1String(d->transferMode == Passive ? "PASV\r\n" : "PORT\r\n"); - cmds << QLatin1String("RETR ") + file + QLatin1String("\r\n"); - return d->addCommand(new QFtpCommand(Get, cmds, dev)); + QStringList cmds; + if(type == Binary) + cmds << QLatin1String("TYPE I\r\n"); + else + cmds << QLatin1String("TYPE A\r\n"); + cmds << QLatin1String("SIZE ") + file + QLatin1String("\r\n"); + cmds << QLatin1String(d->transferMode == Passive ? "PASV\r\n" : "PORT\r\n"); + cmds << QLatin1String("RETR ") + file + QLatin1String("\r\n"); + return d->addCommand(new QFtpCommand(Get, cmds, dev)); } /*! @@ -1709,17 +1809,17 @@ int QFtp::get(const QString &file, QIODevice *dev, TransferType type) \sa dataTransferProgress() commandStarted() commandFinished() */ -int QFtp::put(const QByteArray &data, const QString &file, TransferType type) +int QFtp::put(const QByteArray & data, const QString & file, TransferType type) { - QStringList cmds; - if (type == Binary) - cmds << QLatin1String("TYPE I\r\n"); - else - cmds << QLatin1String("TYPE A\r\n"); - cmds << QLatin1String(d->transferMode == Passive ? "PASV\r\n" : "PORT\r\n"); - cmds << QLatin1String("ALLO ") + QString::number(data.size()) + QLatin1String("\r\n"); - cmds << QLatin1String("STOR ") + file + QLatin1String("\r\n"); - return d->addCommand(new QFtpCommand(Put, cmds, data)); + QStringList cmds; + if(type == Binary) + cmds << QLatin1String("TYPE I\r\n"); + else + cmds << QLatin1String("TYPE A\r\n"); + cmds << QLatin1String(d->transferMode == Passive ? "PASV\r\n" : "PORT\r\n"); + cmds << QLatin1String("ALLO ") + QString::number(data.size()) + QLatin1String("\r\n"); + cmds << QLatin1String("STOR ") + file + QLatin1String("\r\n"); + return d->addCommand(new QFtpCommand(Put, cmds, data)); } /*! @@ -1736,18 +1836,18 @@ int QFtp::put(const QByteArray &data, const QString &file, TransferType type) operation (it is safe to delete it when the commandFinished() is emitted). */ -int QFtp::put(QIODevice *dev, const QString &file, TransferType type) +int QFtp::put(QIODevice * dev, const QString & file, TransferType type) { - QStringList cmds; - if (type == Binary) - cmds << QLatin1String("TYPE I\r\n"); - else - cmds << QLatin1String("TYPE A\r\n"); - cmds << QLatin1String(d->transferMode == Passive ? "PASV\r\n" : "PORT\r\n"); - if (!dev->isSequential()) - cmds << QLatin1String("ALLO ") + QString::number(dev->size()) + QLatin1String("\r\n"); - cmds << QLatin1String("STOR ") + file + QLatin1String("\r\n"); - return d->addCommand(new QFtpCommand(Put, cmds, dev)); + QStringList cmds; + if(type == Binary) + cmds << QLatin1String("TYPE I\r\n"); + else + cmds << QLatin1String("TYPE A\r\n"); + cmds << QLatin1String(d->transferMode == Passive ? "PASV\r\n" : "PORT\r\n"); + if(!dev->isSequential()) + cmds << QLatin1String("ALLO ") + QString::number(dev->size()) + QLatin1String("\r\n"); + cmds << QLatin1String("STOR ") + file + QLatin1String("\r\n"); + return d->addCommand(new QFtpCommand(Put, cmds, dev)); } /*! @@ -1764,9 +1864,9 @@ int QFtp::put(QIODevice *dev, const QString &file, TransferType type) \sa commandStarted() commandFinished() */ -int QFtp::remove(const QString &file) +int QFtp::remove(const QString & file) { - return d->addCommand(new QFtpCommand(Remove, QStringList(QLatin1String("DELE ") + file + QLatin1String("\r\n")))); + return d->addCommand(new QFtpCommand(Remove, QStringList(QLatin1String("DELE ") + file + QLatin1String("\r\n")))); } /*! @@ -1783,9 +1883,9 @@ int QFtp::remove(const QString &file) \sa commandStarted() commandFinished() */ -int QFtp::mkdir(const QString &dir) +int QFtp::mkdir(const QString & dir) { - return d->addCommand(new QFtpCommand(Mkdir, QStringList(QLatin1String("MKD ") + dir + QLatin1String("\r\n")))); + return d->addCommand(new QFtpCommand(Mkdir, QStringList(QLatin1String("MKD ") + dir + QLatin1String("\r\n")))); } /*! @@ -1802,9 +1902,9 @@ int QFtp::mkdir(const QString &dir) \sa commandStarted() commandFinished() */ -int QFtp::rmdir(const QString &dir) +int QFtp::rmdir(const QString & dir) { - return d->addCommand(new QFtpCommand(Rmdir, QStringList(QLatin1String("RMD ") + dir + QLatin1String("\r\n")))); + return d->addCommand(new QFtpCommand(Rmdir, QStringList(QLatin1String("RMD ") + dir + QLatin1String("\r\n")))); } /*! @@ -1821,12 +1921,12 @@ int QFtp::rmdir(const QString &dir) \sa commandStarted() commandFinished() */ -int QFtp::rename(const QString &oldname, const QString &newname) +int QFtp::rename(const QString & oldname, const QString & newname) { - QStringList cmds; - cmds << QLatin1String("RNFR ") + oldname + QLatin1String("\r\n"); - cmds << QLatin1String("RNTO ") + newname + QLatin1String("\r\n"); - return d->addCommand(new QFtpCommand(Rename, cmds)); + QStringList cmds; + cmds << QLatin1String("RNFR ") + oldname + QLatin1String("\r\n"); + cmds << QLatin1String("RNTO ") + newname + QLatin1String("\r\n"); + return d->addCommand(new QFtpCommand(Rename, cmds)); } /*! @@ -1847,10 +1947,10 @@ int QFtp::rename(const QString &oldname, const QString &newname) \sa rawCommandReply() commandStarted() commandFinished() */ -int QFtp::rawCommand(const QString &command) +int QFtp::rawCommand(const QString & command) { - QString cmd = command.trimmed() + QLatin1String("\r\n"); - return d->addCommand(new QFtpCommand(RawCommand, QStringList(cmd))); + QString cmd = command.trimmed() + QLatin1String("\r\n"); + return d->addCommand(new QFtpCommand(RawCommand, QStringList(cmd))); } /*! @@ -1861,7 +1961,7 @@ int QFtp::rawCommand(const QString &command) */ qint64 QFtp::bytesAvailable() const { - return d->pi.dtp.bytesAvailable(); + return d->pi.dtp.bytesAvailable(); } /*! \fn qint64 QFtp::readBlock(char *data, quint64 maxlen) @@ -1875,9 +1975,9 @@ qint64 QFtp::bytesAvailable() const \sa get() readyRead() bytesAvailable() readAll() */ -qint64 QFtp::read(char *data, qint64 maxlen) +qint64 QFtp::read(char * data, qint64 maxlen) { - return d->pi.dtp.read(data, maxlen); + return d->pi.dtp.read(data, maxlen); } /*! @@ -1888,7 +1988,7 @@ qint64 QFtp::read(char *data, qint64 maxlen) */ QByteArray QFtp::readAll() { - return d->pi.dtp.readAll(); + return d->pi.dtp.readAll(); } /*! @@ -1922,11 +2022,11 @@ QByteArray QFtp::readAll() */ void QFtp::abort() { - if (d->pending.isEmpty()) - return; + if(d->pending.isEmpty()) + return; - clearPendingCommands(); - d->pi.abort(); + clearPendingCommands(); + d->pi.abort(); } /*! @@ -1937,9 +2037,9 @@ void QFtp::abort() */ int QFtp::currentId() const { - if (d->pending.isEmpty()) - return 0; - return d->pending.first()->id; + if(d->pending.isEmpty()) + return 0; + return d->pending.first()->id; } /*! @@ -1950,9 +2050,9 @@ int QFtp::currentId() const */ QFtp::Command QFtp::currentCommand() const { - if (d->pending.isEmpty()) - return None; - return d->pending.first()->command; + if(d->pending.isEmpty()) + return None; + return d->pending.first()->command; } /*! @@ -1965,14 +2065,14 @@ QFtp::Command QFtp::currentCommand() const \sa get() put() */ -QIODevice* QFtp::currentDevice() const +QIODevice * QFtp::currentDevice() const { - if (d->pending.isEmpty()) - return 0; - QFtpCommand *c = d->pending.first(); - if (c->is_ba) - return 0; - return c->data.dev; + if(d->pending.isEmpty()) + return 0; + QFtpCommand * c = d->pending.first(); + if(c->is_ba) + return 0; + return c->data.dev; } /*! @@ -1986,7 +2086,7 @@ QIODevice* QFtp::currentDevice() const */ bool QFtp::hasPendingCommands() const { - return d->pending.count() > 1; + return d->pending.count() > 1; } /*! @@ -1998,9 +2098,9 @@ bool QFtp::hasPendingCommands() const */ void QFtp::clearPendingCommands() { - // delete all entires except the first one - while (d->pending.count() > 1) - delete d->pending.takeLast(); + // delete all entires except the first one + while(d->pending.count() > 1) + delete d->pending.takeLast(); } /*! @@ -2011,7 +2111,7 @@ void QFtp::clearPendingCommands() */ QFtp::State QFtp::state() const { - return d->state; + return d->state; } /*! @@ -2023,7 +2123,7 @@ QFtp::State QFtp::state() const */ QFtp::Error QFtp::error() const { - return d->error; + return d->error; } /*! @@ -2039,208 +2139,243 @@ QFtp::Error QFtp::error() const */ QString QFtp::errorString() const { - return d->errorString; + return d->errorString; } /*! \internal */ void QFtpPrivate::_q_startNextCommand() { - Q_Q(QFtp); - if (pending.isEmpty()) - return; - QFtpCommand *c = pending.first(); - - error = QFtp::NoError; - errorString = QT_TRANSLATE_NOOP(QFtp, QLatin1String("Unknown error")); - - if (q->bytesAvailable()) - q->readAll(); // clear the data - emit q->commandStarted(c->id); - - // Proxy support, replace the Login argument in place, then fall - // through. - if (c->command == QFtp::Login && !proxyHost.isEmpty()) { - QString loginString = c->rawCmds.first().trimmed(); - loginString += QLatin1Char('@') + host; - if (port && port != 21) - loginString += QLatin1Char(':') + QString::number(port); - loginString += QLatin1String("\r\n"); - c->rawCmds[0] = loginString; - } - - if (c->command == QFtp::SetTransferMode) { - _q_piFinished(QLatin1String("Transfer mode set")); - } else if (c->command == QFtp::SetProxy) { - proxyHost = c->rawCmds[0]; - proxyPort = c->rawCmds[1].toUInt(); - c->rawCmds.clear(); - _q_piFinished(QLatin1String("Proxy set to ") + proxyHost + QLatin1Char(':') + QString::number(proxyPort)); - } else if (c->command == QFtp::ConnectToHost) { + Q_Q(QFtp); + if(pending.isEmpty()) + return; + QFtpCommand * c = pending.first(); + + error = QFtp::NoError; + errorString = QT_TRANSLATE_NOOP(QFtp, QLatin1String("Unknown error")); + + if(q->bytesAvailable()) + q->readAll(); // clear the data + emit q->commandStarted(c->id); + + // Proxy support, replace the Login argument in place, then fall + // through. + if(c->command == QFtp::Login && !proxyHost.isEmpty()) + { + QString loginString = c->rawCmds.first().trimmed(); + loginString += QLatin1Char('@') + host; + if(port && port != 21) + loginString += QLatin1Char(':') + QString::number(port); + loginString += QLatin1String("\r\n"); + c->rawCmds[0] = loginString; + } + + if(c->command == QFtp::SetTransferMode) + { + _q_piFinished(QLatin1String("Transfer mode set")); + } + else if(c->command == QFtp::SetProxy) + { + proxyHost = c->rawCmds[0]; + proxyPort = c->rawCmds[1].toUInt(); + c->rawCmds.clear(); + _q_piFinished(QLatin1String("Proxy set to ") + proxyHost + QLatin1Char(':') + QString::number(proxyPort)); + } + else if(c->command == QFtp::ConnectToHost) + { #ifndef QT_NO_BEARERMANAGEMENT - //copy network session down to the PI - pi.setProperty("_q_networksession", q->property("_q_networksession")); + //copy network session down to the PI + pi.setProperty("_q_networksession", q->property("_q_networksession")); #endif - if (!proxyHost.isEmpty()) { - host = c->rawCmds[0]; - port = c->rawCmds[1].toUInt(); - pi.connectToHost(proxyHost, proxyPort); - } else { - pi.connectToHost(c->rawCmds[0], c->rawCmds[1].toUInt()); - } - } else { - if (c->command == QFtp::Put) { - if (c->is_ba) { - pi.dtp.setData(c->data.ba); - pi.dtp.setBytesTotal(c->data.ba->size()); - } else if (c->data.dev && (c->data.dev->isOpen() || c->data.dev->open(QIODevice::ReadOnly))) { - pi.dtp.setDevice(c->data.dev); - if (c->data.dev->isSequential()) { - pi.dtp.setBytesTotal(0); - pi.dtp.connect(c->data.dev, SIGNAL(readyRead()), SLOT(dataReadyRead())); - pi.dtp.connect(c->data.dev, SIGNAL(readChannelFinished()), SLOT(dataReadyRead())); - } else { - pi.dtp.setBytesTotal(c->data.dev->size()); - } - } - } else if (c->command == QFtp::Get) { - if (!c->is_ba && c->data.dev) { - pi.dtp.setDevice(c->data.dev); - } - } else if (c->command == QFtp::Close) { - state = QFtp::Closing; - emit q->stateChanged(state); - } - pi.sendCommands(c->rawCmds); - } + if(!proxyHost.isEmpty()) + { + host = c->rawCmds[0]; + port = c->rawCmds[1].toUInt(); + pi.connectToHost(proxyHost, proxyPort); + } + else + { + pi.connectToHost(c->rawCmds[0], c->rawCmds[1].toUInt()); + } + } + else + { + if(c->command == QFtp::Put) + { + if(c->is_ba) + { + pi.dtp.setData(c->data.ba); + pi.dtp.setBytesTotal(c->data.ba->size()); + } + else if(c->data.dev && (c->data.dev->isOpen() || c->data.dev->open(QIODevice::ReadOnly))) + { + pi.dtp.setDevice(c->data.dev); + if(c->data.dev->isSequential()) + { + pi.dtp.setBytesTotal(0); + pi.dtp.connect(c->data.dev, SIGNAL(readyRead()), SLOT(dataReadyRead())); + pi.dtp.connect(c->data.dev, SIGNAL(readChannelFinished()), SLOT(dataReadyRead())); + } + else + { + pi.dtp.setBytesTotal(c->data.dev->size()); + } + } + } + else if(c->command == QFtp::Get) + { + if(!c->is_ba && c->data.dev) + { + pi.dtp.setDevice(c->data.dev); + } + } + else if(c->command == QFtp::Close) + { + state = QFtp::Closing; + emit q->stateChanged(state); + } + pi.sendCommands(c->rawCmds); + } } /*! \internal */ -void QFtpPrivate::_q_piFinished(const QString&) -{ - if (pending.isEmpty()) - return; - QFtpCommand *c = pending.first(); - - if (c->command == QFtp::Close) { - // The order of in which the slots are called is arbitrary, so - // disconnect the SIGNAL-SIGNAL temporary to make sure that we - // don't get the commandFinished() signal before the stateChanged() - // signal. - if (state != QFtp::Unconnected) { - close_waitForStateChange = true; - return; - } - } - emit q_func()->commandFinished(c->id, false); - pending.removeFirst(); - - delete c; - - if (pending.isEmpty()) { - emit q_func()->done(false); - } else { - _q_startNextCommand(); - } +void QFtpPrivate::_q_piFinished(const QString &) +{ + if(pending.isEmpty()) + return; + QFtpCommand * c = pending.first(); + + if(c->command == QFtp::Close) + { + // The order of in which the slots are called is arbitrary, so + // disconnect the SIGNAL-SIGNAL temporary to make sure that we + // don't get the commandFinished() signal before the stateChanged() + // signal. + if(state != QFtp::Unconnected) + { + close_waitForStateChange = true; + return; + } + } + emit q_func()->commandFinished(c->id, false); + pending.removeFirst(); + + delete c; + + if(pending.isEmpty()) + { + emit q_func()->done(false); + } + else + { + _q_startNextCommand(); + } } /*! \internal */ -void QFtpPrivate::_q_piError(int errorCode, const QString &text) -{ - Q_Q(QFtp); - - if (pending.isEmpty()) { - qWarning("QFtpPrivate::_q_piError was called without pending command!"); - return; - } - - QFtpCommand *c = pending.first(); - - // non-fatal errors - if (c->command == QFtp::Get && pi.currentCommand().startsWith(QLatin1String("SIZE "))) { - pi.dtp.setBytesTotal(0); - return; - } else if (c->command==QFtp::Put && pi.currentCommand().startsWith(QLatin1String("ALLO "))) { - return; - } - - error = QFtp::Error(errorCode); - switch (q->currentCommand()) { - case QFtp::ConnectToHost: - errorString = QString::fromLatin1(QT_TRANSLATE_NOOP("QFtp", "Connecting to host failed:\n%1")) - .arg(text); - break; - case QFtp::Login: - errorString = QString::fromLatin1(QT_TRANSLATE_NOOP("QFtp", "Login failed:\n%1")) - .arg(text); - break; - case QFtp::List: - errorString = QString::fromLatin1(QT_TRANSLATE_NOOP("QFtp", "Listing directory failed:\n%1")) - .arg(text); - break; - case QFtp::Cd: - errorString = QString::fromLatin1(QT_TRANSLATE_NOOP("QFtp", "Changing directory failed:\n%1")) - .arg(text); - break; - case QFtp::Get: - errorString = QString::fromLatin1(QT_TRANSLATE_NOOP("QFtp", "Downloading file failed:\n%1")) - .arg(text); - break; - case QFtp::Put: - errorString = QString::fromLatin1(QT_TRANSLATE_NOOP("QFtp", "Uploading file failed:\n%1")) - .arg(text); - break; - case QFtp::Remove: - errorString = QString::fromLatin1(QT_TRANSLATE_NOOP("QFtp", "Removing file failed:\n%1")) - .arg(text); - break; - case QFtp::Mkdir: - errorString = QString::fromLatin1(QT_TRANSLATE_NOOP("QFtp", "Creating directory failed:\n%1")) - .arg(text); - break; - case QFtp::Rmdir: - errorString = QString::fromLatin1(QT_TRANSLATE_NOOP("QFtp", "Removing directory failed:\n%1")) - .arg(text); - break; - default: - errorString = text; - break; - } - - pi.clearPendingCommands(); - q->clearPendingCommands(); - emit q->commandFinished(c->id, true); - - pending.removeFirst(); - delete c; - if (pending.isEmpty()) - emit q->done(true); - else - _q_startNextCommand(); +void QFtpPrivate::_q_piError(int errorCode, const QString & text) +{ + Q_Q(QFtp); + + if(pending.isEmpty()) + { + qWarning("QFtpPrivate::_q_piError was called without pending command!"); + return; + } + + QFtpCommand * c = pending.first(); + + // non-fatal errors + if(c->command == QFtp::Get && pi.currentCommand().startsWith(QLatin1String("SIZE "))) + { + pi.dtp.setBytesTotal(0); + return; + } + else if(c->command == QFtp::Put && pi.currentCommand().startsWith(QLatin1String("ALLO "))) + { + return; + } + + error = QFtp::Error(errorCode); + switch(q->currentCommand()) + { + case QFtp::ConnectToHost: + errorString = QString::fromLatin1(QT_TRANSLATE_NOOP("QFtp", "Connecting to host failed:\n%1")) + .arg(text); + break; + case QFtp::Login: + errorString = QString::fromLatin1(QT_TRANSLATE_NOOP("QFtp", "Login failed:\n%1")) + .arg(text); + break; + case QFtp::List: + errorString = QString::fromLatin1(QT_TRANSLATE_NOOP("QFtp", "Listing directory failed:\n%1")) + .arg(text); + break; + case QFtp::Cd: + errorString = QString::fromLatin1(QT_TRANSLATE_NOOP("QFtp", "Changing directory failed:\n%1")) + .arg(text); + break; + case QFtp::Get: + errorString = QString::fromLatin1(QT_TRANSLATE_NOOP("QFtp", "Downloading file failed:\n%1")) + .arg(text); + break; + case QFtp::Put: + errorString = QString::fromLatin1(QT_TRANSLATE_NOOP("QFtp", "Uploading file failed:\n%1")) + .arg(text); + break; + case QFtp::Remove: + errorString = QString::fromLatin1(QT_TRANSLATE_NOOP("QFtp", "Removing file failed:\n%1")) + .arg(text); + break; + case QFtp::Mkdir: + errorString = QString::fromLatin1(QT_TRANSLATE_NOOP("QFtp", "Creating directory failed:\n%1")) + .arg(text); + break; + case QFtp::Rmdir: + errorString = QString::fromLatin1(QT_TRANSLATE_NOOP("QFtp", "Removing directory failed:\n%1")) + .arg(text); + break; + default: + errorString = text; + break; + } + + pi.clearPendingCommands(); + q->clearPendingCommands(); + emit q->commandFinished(c->id, true); + + pending.removeFirst(); + delete c; + if(pending.isEmpty()) + emit q->done(true); + else + _q_startNextCommand(); } /*! \internal */ void QFtpPrivate::_q_piConnectState(int connectState) { - state = QFtp::State(connectState); - emit q_func()->stateChanged(state); - if (close_waitForStateChange) { - close_waitForStateChange = false; - _q_piFinished(QLatin1String(QT_TRANSLATE_NOOP("QFtp", "Connection closed"))); - } + state = QFtp::State(connectState); + emit q_func()->stateChanged(state); + if(close_waitForStateChange) + { + close_waitForStateChange = false; + _q_piFinished(QLatin1String(QT_TRANSLATE_NOOP("QFtp", "Connection closed"))); + } } /*! \internal */ -void QFtpPrivate::_q_piFtpReply(int code, const QString &text) +void QFtpPrivate::_q_piFtpReply(int code, const QString & text) { - if (q_func()->currentCommand() == QFtp::RawCommand) { - pi.rawCommand = true; - emit q_func()->rawCommandReply(code, text); - } + if(q_func()->currentCommand() == QFtp::RawCommand) + { + pi.rawCommand = true; + emit q_func()->rawCommandReply(code, text); + } } /*! @@ -2248,8 +2383,8 @@ void QFtpPrivate::_q_piFtpReply(int code, const QString &text) */ QFtp::~QFtp() { - abort(); - close(); + abort(); + close(); } QT_END_NAMESPACE diff --git a/src/modules/objects/qtftp/qftp.h b/src/modules/objects/qtftp/qftp.h index 7035b4d5a..68c14e46d 100644 --- a/src/modules/objects/qtftp/qftp.h +++ b/src/modules/objects/qtftp/qftp.h @@ -56,113 +56,114 @@ class QFtpPrivate; class QFtp : public QObject { - Q_OBJECT + Q_OBJECT public: - explicit QFtp(QObject *parent = 0); - virtual ~QFtp(); - - enum State { - Unconnected, - HostLookup, - Connecting, - Connected, - LoggedIn, - Closing - }; - enum Error { - NoError, - UnknownError, - HostNotFound, - ConnectionRefused, - NotConnected - }; - enum Command { - None, - SetTransferMode, - SetProxy, - ConnectToHost, - Login, - Close, - List, - Cd, - Get, - Put, - Remove, - Mkdir, - Rmdir, - Rename, - RawCommand - }; - enum TransferMode { - Active, - Passive - }; - enum TransferType { - Binary, - Ascii - }; - - int setProxy(const QString &host, quint16 port); - int connectToHost(const QString &host, quint16 port=21); - int login(const QString &user = QString(), const QString &password = QString()); - int close(); - int setTransferMode(TransferMode mode); - int list(const QString &dir = QString()); - int cd(const QString &dir); - int get(const QString &file, QIODevice *dev=0, TransferType type = Binary); - int put(const QByteArray &data, const QString &file, TransferType type = Binary); - int put(QIODevice *dev, const QString &file, TransferType type = Binary); - int remove(const QString &file); - int mkdir(const QString &dir); - int rmdir(const QString &dir); - int rename(const QString &oldname, const QString &newname); - - int rawCommand(const QString &command); - - qint64 bytesAvailable() const; - qint64 read(char *data, qint64 maxlen); - QByteArray readAll(); - - int currentId() const; - QIODevice* currentDevice() const; - Command currentCommand() const; - bool hasPendingCommands() const; - void clearPendingCommands(); - - State state() const; - - Error error() const; - QString errorString() const; + explicit QFtp(QObject * parent = 0); + virtual ~QFtp(); + + enum State + { + Unconnected, + HostLookup, + Connecting, + Connected, + LoggedIn, + Closing + }; + enum Error + { + NoError, + UnknownError, + HostNotFound, + ConnectionRefused, + NotConnected + }; + enum Command + { + None, + SetTransferMode, + SetProxy, + ConnectToHost, + Login, + Close, + List, + Cd, + Get, + Put, + Remove, + Mkdir, + Rmdir, + Rename, + RawCommand + }; + enum TransferMode + { + Active, + Passive + }; + enum TransferType + { + Binary, + Ascii + }; + + int setProxy(const QString & host, quint16 port); + int connectToHost(const QString & host, quint16 port = 21); + int login(const QString & user = QString(), const QString & password = QString()); + int close(); + int setTransferMode(TransferMode mode); + int list(const QString & dir = QString()); + int cd(const QString & dir); + int get(const QString & file, QIODevice * dev = 0, TransferType type = Binary); + int put(const QByteArray & data, const QString & file, TransferType type = Binary); + int put(QIODevice * dev, const QString & file, TransferType type = Binary); + int remove(const QString & file); + int mkdir(const QString & dir); + int rmdir(const QString & dir); + int rename(const QString & oldname, const QString & newname); + + int rawCommand(const QString & command); + + qint64 bytesAvailable() const; + qint64 read(char * data, qint64 maxlen); + QByteArray readAll(); + + int currentId() const; + QIODevice * currentDevice() const; + Command currentCommand() const; + bool hasPendingCommands() const; + void clearPendingCommands(); + + State state() const; + + Error error() const; + QString errorString() const; public Q_SLOTS: - void abort(); + void abort(); -Q_SIGNALS: - void stateChanged(int); - void listInfo(const QUrlInfo&); - void readyRead(); - void dataTransferProgress(qint64, qint64); - void rawCommandReply(int, const QString&); + Q_SIGNALS : void stateChanged(int); + void listInfo(const QUrlInfo &); + void readyRead(); + void dataTransferProgress(qint64, qint64); + void rawCommandReply(int, const QString &); - void commandStarted(int); - void commandFinished(int, bool); - void done(bool); + void commandStarted(int); + void commandFinished(int, bool); + void done(bool); private: - Q_DISABLE_COPY(QFtp) - QScopedPointer d; - - void _q_startNextCommand(); - void _q_piFinished(const QString&); - void _q_piError(int, const QString&); - void _q_piConnectState(int); - void _q_piFtpReply(int, const QString&); + Q_DISABLE_COPY(QFtp) + QScopedPointer d; + + void _q_startNextCommand(); + void _q_piFinished(const QString &); + void _q_piError(int, const QString &); + void _q_piConnectState(int); + void _q_piFtpReply(int, const QString &); }; - - - class QFtpPI; /* @@ -171,79 +172,81 @@ class QFtpPI; */ class QFtpDTP : public QObject { - Q_OBJECT + Q_OBJECT public: - enum ConnectState { - CsHostFound, - CsConnected, - CsClosed, - CsHostNotFound, - CsConnectionRefused - }; + enum ConnectState + { + CsHostFound, + CsConnected, + CsClosed, + CsHostNotFound, + CsConnectionRefused + }; - QFtpDTP(QFtpPI *p, QObject *parent = 0); + QFtpDTP(QFtpPI * p, QObject * parent = 0); - void setData(QByteArray *); - void setDevice(QIODevice *); - void writeData(); - void setBytesTotal(qint64 bytes); + void setData(QByteArray *); + void setDevice(QIODevice *); + void writeData(); + void setBytesTotal(qint64 bytes); - bool hasError() const; - QString errorMessage() const; - void clearError(); + bool hasError() const; + QString errorMessage() const; + void clearError(); - void connectToHost(const QString & host, quint16 port); - int setupListener(const QHostAddress &address); - void waitForConnection(); + void connectToHost(const QString & host, quint16 port); + int setupListener(const QHostAddress & address); + void waitForConnection(); - QTcpSocket::SocketState state() const; - qint64 bytesAvailable() const; - qint64 read(char *data, qint64 maxlen); - QByteArray readAll(); + QTcpSocket::SocketState state() const; + qint64 bytesAvailable() const; + qint64 read(char * data, qint64 maxlen); + QByteArray readAll(); - void abortConnection(); + void abortConnection(); - static bool parseDir(const QByteArray &buffer, const QString &userName, QUrlInfo *info); + static bool parseDir(const QByteArray & buffer, const QString & userName, QUrlInfo * info); signals: - void listInfo(const QUrlInfo&); - void readyRead(); - void dataTransferProgress(qint64, qint64); + void listInfo(const QUrlInfo &); + void readyRead(); + void dataTransferProgress(qint64, qint64); - void connectState(int); + void connectState(int); private slots: - void socketConnected(); - void socketReadyRead(); - void socketError(QAbstractSocket::SocketError); - void socketConnectionClosed(); - void socketBytesWritten(qint64); - void setupSocket(); + void socketConnected(); + void socketReadyRead(); + void socketError(QAbstractSocket::SocketError); + void socketConnectionClosed(); + void socketBytesWritten(qint64); + void setupSocket(); - void dataReadyRead(); + void dataReadyRead(); private: - void clearData(); - - QTcpSocket *socket; - QTcpServer listener; - - QFtpPI *pi; - QString err; - qint64 bytesDone; - qint64 bytesTotal; - bool callWriteData; - - // If is_ba is true, ba is used; ba is never 0. - // Otherwise dev is used; dev can be 0 or not. - union { - QByteArray *ba; - QIODevice *dev; - } data; - bool is_ba; - - QByteArray bytesFromSocket; + void clearData(); + + QTcpSocket * socket; + QTcpServer listener; + + QFtpPI * pi; + QString err; + qint64 bytesDone; + qint64 bytesTotal; + bool callWriteData; + + // If is_ba is true, ba is used; ba is never 0. + // Otherwise dev is used; dev can be 0 or not. + union + { + QByteArray * ba; + QIODevice * dev; + } data; + bool is_ba; + + QByteArray bytesFromSocket; }; /********************************************************************** @@ -254,86 +257,86 @@ private: class QFtpPI : public QObject { - Q_OBJECT + Q_OBJECT public: - QFtpPI(QObject *parent = 0); + QFtpPI(QObject * parent = 0); - void connectToHost(const QString &host, quint16 port); + void connectToHost(const QString & host, quint16 port); - bool sendCommands(const QStringList &cmds); - bool sendCommand(const QString &cmd) - { return sendCommands(QStringList(cmd)); } + bool sendCommands(const QStringList & cmds); + bool sendCommand(const QString & cmd) + { + return sendCommands(QStringList(cmd)); + } - void clearPendingCommands(); - void abort(); + void clearPendingCommands(); + void abort(); - QString currentCommand() const - { return currentCmd; } + QString currentCommand() const + { + return currentCmd; + } - bool rawCommand; - bool transferConnectionExtended; + bool rawCommand; + bool transferConnectionExtended; - QFtpDTP dtp; // the PI has a DTP which is not the design of RFC 959, but it - // makes the design simpler this way + QFtpDTP dtp; // the PI has a DTP which is not the design of RFC 959, but it + // makes the design simpler this way signals: - void connectState(int); - void finished(const QString&); - void error(int, const QString&); - void rawFtpReply(int, const QString&); + void connectState(int); + void finished(const QString &); + void error(int, const QString &); + void rawFtpReply(int, const QString &); private slots: - void hostFound(); - void connected(); - void connectionClosed(); - void delayedCloseFinished(); - void readyRead(); - void error(QAbstractSocket::SocketError); + void hostFound(); + void connected(); + void connectionClosed(); + void delayedCloseFinished(); + void readyRead(); + void error(QAbstractSocket::SocketError); - void dtpConnectState(int); + void dtpConnectState(int); private: - // the states are modelled after the generalized state diagram of RFC 959, - // page 58 - enum State { - Begin, - Idle, - Waiting, - Success, - Failure - }; - - enum AbortState { - None, - AbortStarted, - WaitForAbortToFinish - }; - - bool processReply(); - bool startNextCmd(); - - QTcpSocket commandSocket; - QString replyText; - char replyCode[3]; - State state; - AbortState abortState; - QStringList pendingCommands; - QString currentCmd; - - bool waitForDtpToConnect; - bool waitForDtpToClose; - - QByteArray bytesFromSocket; - - friend class QFtpDTP; + // the states are modelled after the generalized state diagram of RFC 959, + // page 58 + enum State + { + Begin, + Idle, + Waiting, + Success, + Failure + }; + + enum AbortState + { + None, + AbortStarted, + WaitForAbortToFinish + }; + + bool processReply(); + bool startNextCmd(); + + QTcpSocket commandSocket; + QString replyText; + char replyCode[3]; + State state; + AbortState abortState; + QStringList pendingCommands; + QString currentCmd; + + bool waitForDtpToConnect; + bool waitForDtpToClose; + + QByteArray bytesFromSocket; + + friend class QFtpDTP; }; - - - - - - QT_END_NAMESPACE #endif // QFTP_H diff --git a/src/modules/objects/qtftp/qurlinfo.cpp b/src/modules/objects/qtftp/qurlinfo.cpp index 3429542bc..9e7849354 100644 --- a/src/modules/objects/qtftp/qurlinfo.cpp +++ b/src/modules/objects/qtftp/qurlinfo.cpp @@ -50,34 +50,33 @@ QT_BEGIN_NAMESPACE class QUrlInfoPrivate { public: - QUrlInfoPrivate() : - permissions(0), - size(0), - isDir(false), - isFile(true), - isSymLink(false), - isWritable(true), - isReadable(true), - isExecutable(false) - {} - - QString name; - int permissions; - QString owner; - QString group; - qint64 size; - - QDateTime lastModified; - QDateTime lastRead; - bool isDir; - bool isFile; - bool isSymLink; - bool isWritable; - bool isReadable; - bool isExecutable; + QUrlInfoPrivate() : permissions(0), + size(0), + isDir(false), + isFile(true), + isSymLink(false), + isWritable(true), + isReadable(true), + isExecutable(false) + { + } + + QString name; + int permissions; + QString owner; + QString group; + qint64 size; + + QDateTime lastModified; + QDateTime lastRead; + bool isDir; + bool isFile; + bool isSymLink; + bool isWritable; + bool isReadable; + bool isExecutable; }; - /*! \class QUrlInfo \brief The QUrlInfo class stores information about URLs. @@ -127,21 +126,24 @@ public: QUrlInfo::QUrlInfo() { - d = 0; + d = 0; } /*! Copy constructor, copies \a ui to this URL info object. */ -QUrlInfo::QUrlInfo(const QUrlInfo &ui) +QUrlInfo::QUrlInfo(const QUrlInfo & ui) { - if (ui.d) { - d = new QUrlInfoPrivate; - *d = *ui.d; - } else { - d = 0; - } + if(ui.d) + { + d = new QUrlInfoPrivate; + *d = *ui.d; + } + else + { + d = 0; + } } /*! @@ -156,28 +158,27 @@ QUrlInfo::QUrlInfo(const QUrlInfo &ui) isExecutable. */ -QUrlInfo::QUrlInfo(const QString &name, int permissions, const QString &owner, - const QString &group, qint64 size, const QDateTime &lastModified, - const QDateTime &lastRead, bool isDir, bool isFile, bool isSymLink, - bool isWritable, bool isReadable, bool isExecutable) +QUrlInfo::QUrlInfo(const QString & name, int permissions, const QString & owner, + const QString & group, qint64 size, const QDateTime & lastModified, + const QDateTime & lastRead, bool isDir, bool isFile, bool isSymLink, + bool isWritable, bool isReadable, bool isExecutable) { - d = new QUrlInfoPrivate; - d->name = name; - d->permissions = permissions; - d->owner = owner; - d->group = group; - d->size = size; - d->lastModified = lastModified; - d->lastRead = lastRead; - d->isDir = isDir; - d->isFile = isFile; - d->isSymLink = isSymLink; - d->isWritable = isWritable; - d->isReadable = isReadable; - d->isExecutable = isExecutable; + d = new QUrlInfoPrivate; + d->name = name; + d->permissions = permissions; + d->owner = owner; + d->group = group; + d->size = size; + d->lastModified = lastModified; + d->lastRead = lastRead; + d->isDir = isDir; + d->isFile = isFile; + d->isSymLink = isSymLink; + d->isWritable = isWritable; + d->isReadable = isReadable; + d->isExecutable = isExecutable; } - /*! Constructs a QUrlInfo object by specifying all the URL's information. @@ -190,28 +191,27 @@ QUrlInfo::QUrlInfo(const QString &name, int permissions, const QString &owner, isExecutable. */ -QUrlInfo::QUrlInfo(const QUrl &url, int permissions, const QString &owner, - const QString &group, qint64 size, const QDateTime &lastModified, - const QDateTime &lastRead, bool isDir, bool isFile, bool isSymLink, - bool isWritable, bool isReadable, bool isExecutable) +QUrlInfo::QUrlInfo(const QUrl & url, int permissions, const QString & owner, + const QString & group, qint64 size, const QDateTime & lastModified, + const QDateTime & lastRead, bool isDir, bool isFile, bool isSymLink, + bool isWritable, bool isReadable, bool isExecutable) { - d = new QUrlInfoPrivate; - d->name = QFileInfo(url.path()).fileName(); - d->permissions = permissions; - d->owner = owner; - d->group = group; - d->size = size; - d->lastModified = lastModified; - d->lastRead = lastRead; - d->isDir = isDir; - d->isFile = isFile; - d->isSymLink = isSymLink; - d->isWritable = isWritable; - d->isReadable = isReadable; - d->isExecutable = isExecutable; + d = new QUrlInfoPrivate; + d->name = QFileInfo(url.path()).fileName(); + d->permissions = permissions; + d->owner = owner; + d->group = group; + d->size = size; + d->lastModified = lastModified; + d->lastRead = lastRead; + d->isDir = isDir; + d->isFile = isFile; + d->isSymLink = isSymLink; + d->isWritable = isWritable; + d->isReadable = isReadable; + d->isExecutable = isExecutable; } - /*! Sets the name of the URL to \a name. The name is the full text, for example, "http://qt.nokia.com/doc/qurlinfo.html". @@ -222,14 +222,13 @@ QUrlInfo::QUrlInfo(const QUrl &url, int permissions, const QString &owner, \sa isValid() */ -void QUrlInfo::setName(const QString &name) +void QUrlInfo::setName(const QString & name) { - if (!d) - d = new QUrlInfoPrivate; - d->name = name; + if(!d) + d = new QUrlInfoPrivate; + d->name = name; } - /*! If \a b is true then the URL is set to be a directory; if \a b is false then the URL is set not to be a directory (which normally @@ -244,12 +243,11 @@ void QUrlInfo::setName(const QString &name) void QUrlInfo::setDir(bool b) { - if (!d) - d = new QUrlInfoPrivate; - d->isDir = b; + if(!d) + d = new QUrlInfoPrivate; + d->isDir = b; } - /*! If \a b is true then the URL is set to be a file; if \b is false then the URL is set not to be a file (which normally means it is a @@ -264,12 +262,11 @@ void QUrlInfo::setDir(bool b) void QUrlInfo::setFile(bool b) { - if (!d) - d = new QUrlInfoPrivate; - d->isFile = b; + if(!d) + d = new QUrlInfoPrivate; + d->isFile = b; } - /*! Specifies that the URL refers to a symbolic link if \a b is true and that it does not if \a b is false. @@ -282,12 +279,11 @@ void QUrlInfo::setFile(bool b) void QUrlInfo::setSymLink(bool b) { - if (!d) - d = new QUrlInfoPrivate; - d->isSymLink = b; + if(!d) + d = new QUrlInfoPrivate; + d->isSymLink = b; } - /*! Specifies that the URL is writable if \a b is true and not writable if \a b is false. @@ -300,12 +296,11 @@ void QUrlInfo::setSymLink(bool b) void QUrlInfo::setWritable(bool b) { - if (!d) - d = new QUrlInfoPrivate; - d->isWritable = b; + if(!d) + d = new QUrlInfoPrivate; + d->isWritable = b; } - /*! Specifies that the URL is readable if \a b is true and not readable if \a b is false. @@ -318,9 +313,9 @@ void QUrlInfo::setWritable(bool b) void QUrlInfo::setReadable(bool b) { - if (!d) - d = new QUrlInfoPrivate; - d->isReadable = b; + if(!d) + d = new QUrlInfoPrivate; + d->isReadable = b; } /*! @@ -332,11 +327,11 @@ void QUrlInfo::setReadable(bool b) \sa isValid() */ -void QUrlInfo::setOwner(const QString &s) +void QUrlInfo::setOwner(const QString & s) { - if (!d) - d = new QUrlInfoPrivate; - d->owner = s; + if(!d) + d = new QUrlInfoPrivate; + d->owner = s; } /*! @@ -348,11 +343,11 @@ void QUrlInfo::setOwner(const QString &s) \sa isValid() */ -void QUrlInfo::setGroup(const QString &s) +void QUrlInfo::setGroup(const QString & s) { - if (!d) - d = new QUrlInfoPrivate; - d->group = s; + if(!d) + d = new QUrlInfoPrivate; + d->group = s; } /*! @@ -366,9 +361,9 @@ void QUrlInfo::setGroup(const QString &s) void QUrlInfo::setSize(qint64 size) { - if (!d) - d = new QUrlInfoPrivate; - d->size = size; + if(!d) + d = new QUrlInfoPrivate; + d->size = size; } /*! @@ -382,9 +377,9 @@ void QUrlInfo::setSize(qint64 size) void QUrlInfo::setPermissions(int p) { - if (!d) - d = new QUrlInfoPrivate; - d->permissions = p; + if(!d) + d = new QUrlInfoPrivate; + d->permissions = p; } /*! @@ -397,11 +392,11 @@ void QUrlInfo::setPermissions(int p) \sa isValid() */ -void QUrlInfo::setLastModified(const QDateTime &dt) +void QUrlInfo::setLastModified(const QDateTime & dt) { - if (!d) - d = new QUrlInfoPrivate; - d->lastModified = dt; + if(!d) + d = new QUrlInfoPrivate; + d->lastModified = dt; } /*! @@ -416,11 +411,11 @@ void QUrlInfo::setLastModified(const QDateTime &dt) \sa isValid() */ -void QUrlInfo::setLastRead(const QDateTime &dt) +void QUrlInfo::setLastRead(const QDateTime & dt) { - if (!d) - d = new QUrlInfoPrivate; - d->lastRead = dt; + if(!d) + d = new QUrlInfoPrivate; + d->lastRead = dt; } /*! @@ -429,24 +424,27 @@ void QUrlInfo::setLastRead(const QDateTime &dt) QUrlInfo::~QUrlInfo() { - delete d; + delete d; } /*! Assigns the values of \a ui to this QUrlInfo object. */ -QUrlInfo &QUrlInfo::operator=(const QUrlInfo &ui) +QUrlInfo & QUrlInfo::operator=(const QUrlInfo & ui) { - if (ui.d) { - if (!d) - d= new QUrlInfoPrivate; - *d = *ui.d; - } else { - delete d; - d = 0; - } - return *this; + if(ui.d) + { + if(!d) + d = new QUrlInfoPrivate; + *d = *ui.d; + } + else + { + delete d; + d = 0; + } + return *this; } /*! @@ -457,9 +455,9 @@ QUrlInfo &QUrlInfo::operator=(const QUrlInfo &ui) QString QUrlInfo::name() const { - if (!d) - return QString(); - return d->name; + if(!d) + return QString(); + return d->name; } /*! @@ -471,9 +469,9 @@ QString QUrlInfo::name() const int QUrlInfo::permissions() const { - if (!d) - return 0; - return d->permissions; + if(!d) + return 0; + return d->permissions; } /*! @@ -484,9 +482,9 @@ int QUrlInfo::permissions() const QString QUrlInfo::owner() const { - if (!d) - return QString(); - return d->owner; + if(!d) + return QString(); + return d->owner; } /*! @@ -497,9 +495,9 @@ QString QUrlInfo::owner() const QString QUrlInfo::group() const { - if (!d) - return QString(); - return d->group; + if(!d) + return QString(); + return d->group; } /*! @@ -510,9 +508,9 @@ QString QUrlInfo::group() const qint64 QUrlInfo::size() const { - if (!d) - return 0; - return d->size; + if(!d) + return 0; + return d->size; } /*! @@ -523,9 +521,9 @@ qint64 QUrlInfo::size() const QDateTime QUrlInfo::lastModified() const { - if (!d) - return QDateTime(); - return d->lastModified; + if(!d) + return QDateTime(); + return d->lastModified; } /*! @@ -536,9 +534,9 @@ QDateTime QUrlInfo::lastModified() const QDateTime QUrlInfo::lastRead() const { - if (!d) - return QDateTime(); - return d->lastRead; + if(!d) + return QDateTime(); + return d->lastRead; } /*! @@ -549,9 +547,9 @@ QDateTime QUrlInfo::lastRead() const bool QUrlInfo::isDir() const { - if (!d) - return false; - return d->isDir; + if(!d) + return false; + return d->isDir; } /*! @@ -562,9 +560,9 @@ bool QUrlInfo::isDir() const bool QUrlInfo::isFile() const { - if (!d) - return false; - return d->isFile; + if(!d) + return false; + return d->isFile; } /*! @@ -575,9 +573,9 @@ bool QUrlInfo::isFile() const bool QUrlInfo::isSymLink() const { - if (!d) - return false; - return d->isSymLink; + if(!d) + return false; + return d->isSymLink; } /*! @@ -588,9 +586,9 @@ bool QUrlInfo::isSymLink() const bool QUrlInfo::isWritable() const { - if (!d) - return false; - return d->isWritable; + if(!d) + return false; + return d->isWritable; } /*! @@ -601,9 +599,9 @@ bool QUrlInfo::isWritable() const bool QUrlInfo::isReadable() const { - if (!d) - return false; - return d->isReadable; + if(!d) + return false; + return d->isReadable; } /*! @@ -614,9 +612,9 @@ bool QUrlInfo::isReadable() const bool QUrlInfo::isExecutable() const { - if (!d) - return false; - return d->isExecutable; + if(!d) + return false; + return d->isExecutable; } /*! @@ -626,19 +624,20 @@ bool QUrlInfo::isExecutable() const QDir::Size. */ -bool QUrlInfo::greaterThan(const QUrlInfo &i1, const QUrlInfo &i2, - int sortBy) +bool QUrlInfo::greaterThan(const QUrlInfo & i1, const QUrlInfo & i2, + int sortBy) { - switch (sortBy) { - case QDir::Name: - return i1.name() > i2.name(); - case QDir::Time: - return i1.lastModified() > i2.lastModified(); - case QDir::Size: - return i1.size() > i2.size(); - default: - return false; - } + switch(sortBy) + { + case QDir::Name: + return i1.name() > i2.name(); + case QDir::Time: + return i1.lastModified() > i2.lastModified(); + case QDir::Size: + return i1.size() > i2.size(); + default: + return false; + } } /*! @@ -647,10 +646,10 @@ bool QUrlInfo::greaterThan(const QUrlInfo &i1, const QUrlInfo &i2, sortBy. This must be one of QDir::Name, QDir::Time or QDir::Size. */ -bool QUrlInfo::lessThan(const QUrlInfo &i1, const QUrlInfo &i2, - int sortBy) +bool QUrlInfo::lessThan(const QUrlInfo & i1, const QUrlInfo & i2, + int sortBy) { - return !greaterThan(i1, i2, sortBy); + return !greaterThan(i1, i2, sortBy); } /*! @@ -659,19 +658,20 @@ bool QUrlInfo::lessThan(const QUrlInfo &i1, const QUrlInfo &i2, sortBy. This must be one of QDir::Name, QDir::Time or QDir::Size. */ -bool QUrlInfo::equal(const QUrlInfo &i1, const QUrlInfo &i2, - int sortBy) +bool QUrlInfo::equal(const QUrlInfo & i1, const QUrlInfo & i2, + int sortBy) { - switch (sortBy) { - case QDir::Name: - return i1.name() == i2.name(); - case QDir::Time: - return i1.lastModified() == i2.lastModified(); - case QDir::Size: - return i1.size() == i2.size(); - default: - return false; - } + switch(sortBy) + { + case QDir::Name: + return i1.name() == i2.name(); + case QDir::Time: + return i1.lastModified() == i2.lastModified(); + case QDir::Size: + return i1.size() == i2.size(); + default: + return false; + } } /*! @@ -681,26 +681,14 @@ bool QUrlInfo::equal(const QUrlInfo &i1, const QUrlInfo &i2, \sa lessThan(), equal() */ -bool QUrlInfo::operator==(const QUrlInfo &other) const +bool QUrlInfo::operator==(const QUrlInfo & other) const { - if (!d) - return other.d == 0; - if (!other.d) - return false; + if(!d) + return other.d == 0; + if(!other.d) + return false; - return (d->name == other.d->name && - d->permissions == other.d->permissions && - d->owner == other.d->owner && - d->group == other.d->group && - d->size == other.d->size && - d->lastModified == other.d->lastModified && - d->lastRead == other.d->lastRead && - d->isDir == other.d->isDir && - d->isFile == other.d->isFile && - d->isSymLink == other.d->isSymLink && - d->isWritable == other.d->isWritable && - d->isReadable == other.d->isReadable && - d->isExecutable == other.d->isExecutable); + return (d->name == other.d->name && d->permissions == other.d->permissions && d->owner == other.d->owner && d->group == other.d->group && d->size == other.d->size && d->lastModified == other.d->lastModified && d->lastRead == other.d->lastRead && d->isDir == other.d->isDir && d->isFile == other.d->isFile && d->isSymLink == other.d->isSymLink && d->isWritable == other.d->isWritable && d->isReadable == other.d->isReadable && d->isExecutable == other.d->isExecutable); } /*! @@ -722,7 +710,7 @@ bool QUrlInfo::operator==(const QUrlInfo &other) const */ bool QUrlInfo::isValid() const { - return d != 0; + return d != 0; } QT_END_NAMESPACE diff --git a/src/modules/objects/qtftp/qurlinfo.h b/src/modules/objects/qtftp/qurlinfo.h index 8bd15d6a4..c9630d61c 100644 --- a/src/modules/objects/qtftp/qurlinfo.h +++ b/src/modules/objects/qtftp/qurlinfo.h @@ -54,66 +54,76 @@ class QUrlInfoPrivate; class QUrlInfo { public: - enum PermissionSpec { - ReadOwner = 00400, WriteOwner = 00200, ExeOwner = 00100, - ReadGroup = 00040, WriteGroup = 00020, ExeGroup = 00010, - ReadOther = 00004, WriteOther = 00002, ExeOther = 00001 }; + enum PermissionSpec + { + ReadOwner = 00400, + WriteOwner = 00200, + ExeOwner = 00100, + ReadGroup = 00040, + WriteGroup = 00020, + ExeGroup = 00010, + ReadOther = 00004, + WriteOther = 00002, + ExeOther = 00001 + }; - QUrlInfo(); - QUrlInfo(const QUrlInfo &ui); - QUrlInfo(const QString &name, int permissions, const QString &owner, - const QString &group, qint64 size, const QDateTime &lastModified, - const QDateTime &lastRead, bool isDir, bool isFile, bool isSymLink, - bool isWritable, bool isReadable, bool isExecutable); - QUrlInfo(const QUrl &url, int permissions, const QString &owner, - const QString &group, qint64 size, const QDateTime &lastModified, - const QDateTime &lastRead, bool isDir, bool isFile, bool isSymLink, - bool isWritable, bool isReadable, bool isExecutable); - QUrlInfo &operator=(const QUrlInfo &ui); - virtual ~QUrlInfo(); + QUrlInfo(); + QUrlInfo(const QUrlInfo & ui); + QUrlInfo(const QString & name, int permissions, const QString & owner, + const QString & group, qint64 size, const QDateTime & lastModified, + const QDateTime & lastRead, bool isDir, bool isFile, bool isSymLink, + bool isWritable, bool isReadable, bool isExecutable); + QUrlInfo(const QUrl & url, int permissions, const QString & owner, + const QString & group, qint64 size, const QDateTime & lastModified, + const QDateTime & lastRead, bool isDir, bool isFile, bool isSymLink, + bool isWritable, bool isReadable, bool isExecutable); + QUrlInfo & operator=(const QUrlInfo & ui); + virtual ~QUrlInfo(); - virtual void setName(const QString &name); - virtual void setDir(bool b); - virtual void setFile(bool b); - virtual void setSymLink(bool b); - virtual void setOwner(const QString &s); - virtual void setGroup(const QString &s); - virtual void setSize(qint64 size); - virtual void setWritable(bool b); - virtual void setReadable(bool b); - virtual void setPermissions(int p); - virtual void setLastModified(const QDateTime &dt); - void setLastRead(const QDateTime &dt); + virtual void setName(const QString & name); + virtual void setDir(bool b); + virtual void setFile(bool b); + virtual void setSymLink(bool b); + virtual void setOwner(const QString & s); + virtual void setGroup(const QString & s); + virtual void setSize(qint64 size); + virtual void setWritable(bool b); + virtual void setReadable(bool b); + virtual void setPermissions(int p); + virtual void setLastModified(const QDateTime & dt); + void setLastRead(const QDateTime & dt); - bool isValid() const; + bool isValid() const; - QString name() const; - int permissions() const; - QString owner() const; - QString group() const; - qint64 size() const; - QDateTime lastModified() const; - QDateTime lastRead() const; - bool isDir() const; - bool isFile() const; - bool isSymLink() const; - bool isWritable() const; - bool isReadable() const; - bool isExecutable() const; + QString name() const; + int permissions() const; + QString owner() const; + QString group() const; + qint64 size() const; + QDateTime lastModified() const; + QDateTime lastRead() const; + bool isDir() const; + bool isFile() const; + bool isSymLink() const; + bool isWritable() const; + bool isReadable() const; + bool isExecutable() const; - static bool greaterThan(const QUrlInfo &i1, const QUrlInfo &i2, - int sortBy); - static bool lessThan(const QUrlInfo &i1, const QUrlInfo &i2, - int sortBy); - static bool equal(const QUrlInfo &i1, const QUrlInfo &i2, - int sortBy); + static bool greaterThan(const QUrlInfo & i1, const QUrlInfo & i2, + int sortBy); + static bool lessThan(const QUrlInfo & i1, const QUrlInfo & i2, + int sortBy); + static bool equal(const QUrlInfo & i1, const QUrlInfo & i2, + int sortBy); - bool operator==(const QUrlInfo &i) const; - inline bool operator!=(const QUrlInfo &i) const - { return !operator==(i); } + bool operator==(const QUrlInfo & i) const; + inline bool operator!=(const QUrlInfo & i) const + { + return !operator==(i); + } private: - QUrlInfoPrivate *d; + QUrlInfoPrivate * d; }; QT_END_NAMESPACE diff --git a/src/modules/objects/qthttp/qhttp.cpp b/src/modules/objects/qthttp/qhttp.cpp index 33b885580..8dd437451 100644 --- a/src/modules/objects/qthttp/qhttp.cpp +++ b/src/modules/objects/qthttp/qhttp.cpp @@ -45,22 +45,22 @@ #include "qhttp.h" #ifndef QT_NO_HTTP -# include "qtcpsocket.h" -# include "qsslsocket.h" -# include "qtextstream.h" -# include "qmap.h" -# include "qlist.h" -# include "qstring.h" -# include "qstringlist.h" -# include "qbuffer.h" -# include "qringbuffer_p.h" -# include "qcoreevent.h" -# include "qurl.h" -# include "qnetworkproxy.h" -# include "qauthenticator.h" -# include "qhttpauthenticator_p.h" -# include "qdebug.h" -# include "qtimer.h" +#include "qtcpsocket.h" +#include "qsslsocket.h" +#include "qtextstream.h" +#include "qmap.h" +#include "qlist.h" +#include "qstring.h" +#include "qstringlist.h" +#include "qbuffer.h" +#include "qringbuffer_p.h" +#include "qcoreevent.h" +#include "qurl.h" +#include "qnetworkproxy.h" +#include "qauthenticator.h" +#include "qhttpauthenticator_p.h" +#include "qdebug.h" +#include "qtimer.h" #endif #ifndef QT_NO_HTTP @@ -71,125 +71,128 @@ class QHttpNormalRequest; class QHttpRequest { public: - QHttpRequest() : finished(false) - { id = idCounter.fetchAndAddRelaxed(1); } - virtual ~QHttpRequest() - { } + QHttpRequest() : finished(false) + { + id = idCounter.fetchAndAddRelaxed(1); + } + virtual ~QHttpRequest() + { + } - virtual void start(QHttp *) = 0; - virtual bool hasRequestHeader(); - virtual QHttpRequestHeader requestHeader(); + virtual void start(QHttp *) = 0; + virtual bool hasRequestHeader(); + virtual QHttpRequestHeader requestHeader(); - virtual QIODevice *sourceDevice() = 0; - virtual QIODevice *destinationDevice() = 0; + virtual QIODevice * sourceDevice() = 0; + virtual QIODevice * destinationDevice() = 0; - int id; - bool finished; + int id; + bool finished; private: - static QBasicAtomicInt idCounter; + static QBasicAtomicInt idCounter; }; class QHttpPrivate { public: - Q_DECLARE_PUBLIC(QHttp) - - inline QHttpPrivate(QHttp* parent) - : socket(0), reconnectAttempts(2), - deleteSocket(0), state(QHttp::Unconnected), - error(QHttp::NoError), port(0), mode(QHttp::ConnectionModeHttp), - toDevice(0), postDevice(0), bytesDone(0), chunkedSize(-1), - repost(false), pendingPost(false), q_ptr(parent) - { - } - - inline ~QHttpPrivate() - { - while (!pending.isEmpty()) - delete pending.takeFirst(); - - if (deleteSocket) - delete socket; - } - - // private slots - void _q_startNextRequest(); - void _q_slotReadyRead(); - void _q_slotConnected(); - void _q_slotError(QAbstractSocket::SocketError); - void _q_slotClosed(); - void _q_slotBytesWritten(qint64 numBytes); + Q_DECLARE_PUBLIC(QHttp) + + inline QHttpPrivate(QHttp * parent) + : socket(0), reconnectAttempts(2), + deleteSocket(0), state(QHttp::Unconnected), + error(QHttp::NoError), port(0), mode(QHttp::ConnectionModeHttp), + toDevice(0), postDevice(0), bytesDone(0), chunkedSize(-1), + repost(false), pendingPost(false), q_ptr(parent) + { + } + + inline ~QHttpPrivate() + { + while(!pending.isEmpty()) + delete pending.takeFirst(); + + if(deleteSocket) + delete socket; + } + + // private slots + void _q_startNextRequest(); + void _q_slotReadyRead(); + void _q_slotConnected(); + void _q_slotError(QAbstractSocket::SocketError); + void _q_slotClosed(); + void _q_slotBytesWritten(qint64 numBytes); #ifndef QT_NO_OPENSSL - void _q_slotEncryptedBytesWritten(qint64 numBytes); + void _q_slotEncryptedBytesWritten(qint64 numBytes); #endif - void _q_slotDoFinished(); - void _q_slotSendRequest(); - void _q_continuePost(); + void _q_slotDoFinished(); + void _q_slotSendRequest(); + void _q_continuePost(); - int addRequest(QHttpNormalRequest *); - int addRequest(QHttpRequest *); - void finishedWithSuccess(); - void finishedWithError(const QString &detail, int errorCode); + int addRequest(QHttpNormalRequest *); + int addRequest(QHttpRequest *); + void finishedWithSuccess(); + void finishedWithError(const QString & detail, int errorCode); - void init(); - void setState(int); - void closeConn(); - void setSock(QTcpSocket *sock); + void init(); + void setState(int); + void closeConn(); + void setSock(QTcpSocket * sock); - void postMoreData(); + void postMoreData(); - QTcpSocket *socket; - int reconnectAttempts; - bool deleteSocket; - QList pending; + QTcpSocket * socket; + int reconnectAttempts; + bool deleteSocket; + QList pending; - QHttp::State state; - QHttp::Error error; - QString errorString; + QHttp::State state; + QHttp::Error error; + QString errorString; - QString hostName; - quint16 port; - QHttp::ConnectionMode mode; + QString hostName; + quint16 port; + QHttp::ConnectionMode mode; - QByteArray buffer; - QIODevice *toDevice; - QIODevice *postDevice; + QByteArray buffer; + QIODevice * toDevice; + QIODevice * postDevice; - qint64 bytesDone; - qint64 bytesTotal; - qint64 chunkedSize; + qint64 bytesDone; + qint64 bytesTotal; + qint64 chunkedSize; - QHttpRequestHeader header; + QHttpRequestHeader header; - bool readHeader; - QString headerStr; - QHttpResponseHeader response; + bool readHeader; + QString headerStr; + QHttpResponseHeader response; - QRingBuffer rba; + QRingBuffer rba; #ifndef QT_NO_NETWORKPROXY - QNetworkProxy proxy; - QHttpAuthenticator proxyAuthenticator; + QNetworkProxy proxy; + QHttpAuthenticator proxyAuthenticator; #endif - QHttpAuthenticator authenticator; - bool repost; - bool hasFinishedWithError; - bool pendingPost; - QTimer post100ContinueTimer; - QHttp *q_ptr; + QHttpAuthenticator authenticator; + bool repost; + bool hasFinishedWithError; + bool pendingPost; + QTimer post100ContinueTimer; + QHttp * q_ptr; }; QBasicAtomicInt QHttpRequest::idCounter = Q_BASIC_ATOMIC_INITIALIZER(1); bool QHttpRequest::hasRequestHeader() { - return false; + return false; } QHttpRequestHeader QHttpRequest::requestHeader() { - return QHttpRequestHeader(); + return QHttpRequestHeader(); } /**************************************************** @@ -201,99 +204,104 @@ QHttpRequestHeader QHttpRequest::requestHeader() class QHttpNormalRequest : public QHttpRequest { public: - QHttpNormalRequest(const QHttpRequestHeader &h, QIODevice *d, QIODevice *t) : - header(h), to(t) - { - is_ba = false; - data.dev = d; - } - - QHttpNormalRequest(const QHttpRequestHeader &h, QByteArray *d, QIODevice *t) : - header(h), to(t) - { - is_ba = true; - data.ba = d; - } - - ~QHttpNormalRequest() - { - if (is_ba) - delete data.ba; - } - - void start(QHttp *); - bool hasRequestHeader(); - QHttpRequestHeader requestHeader(); - inline void setRequestHeader(const QHttpRequestHeader &h) { header = h; } - - QIODevice *sourceDevice(); - QIODevice *destinationDevice(); + QHttpNormalRequest(const QHttpRequestHeader & h, QIODevice * d, QIODevice * t) : header(h), to(t) + { + is_ba = false; + data.dev = d; + } + + QHttpNormalRequest(const QHttpRequestHeader & h, QByteArray * d, QIODevice * t) : header(h), to(t) + { + is_ba = true; + data.ba = d; + } + + ~QHttpNormalRequest() + { + if(is_ba) + delete data.ba; + } + + void start(QHttp *); + bool hasRequestHeader(); + QHttpRequestHeader requestHeader(); + inline void setRequestHeader(const QHttpRequestHeader & h) { header = h; } + + QIODevice * sourceDevice(); + QIODevice * destinationDevice(); protected: - QHttpRequestHeader header; + QHttpRequestHeader header; private: - union { - QByteArray *ba; - QIODevice *dev; - } data; - bool is_ba; - QIODevice *to; + union + { + QByteArray * ba; + QIODevice * dev; + } data; + bool is_ba; + QIODevice * to; }; -void QHttpNormalRequest::start(QHttp *http) -{ - if (!http->d->socket) - http->d->setSock(0); - http->d->header = header; - - if (is_ba) { - http->d->buffer = *data.ba; - if (http->d->buffer.size() >= 0) - http->d->header.setContentLength(http->d->buffer.size()); - - http->d->postDevice = 0; - } else { - http->d->buffer = QByteArray(); - - if (data.dev && (data.dev->isOpen() || data.dev->open(QIODevice::ReadOnly))) { - http->d->postDevice = data.dev; - if (http->d->postDevice->size() >= 0) - http->d->header.setContentLength(http->d->postDevice->size()); - } else { - http->d->postDevice = 0; - } - } - - if (to && (to->isOpen() || to->open(QIODevice::WriteOnly))) - http->d->toDevice = to; - else - http->d->toDevice = 0; - - http->d->reconnectAttempts = 2; - http->d->_q_slotSendRequest(); +void QHttpNormalRequest::start(QHttp * http) +{ + if(!http->d->socket) + http->d->setSock(0); + http->d->header = header; + + if(is_ba) + { + http->d->buffer = *data.ba; + if(http->d->buffer.size() >= 0) + http->d->header.setContentLength(http->d->buffer.size()); + + http->d->postDevice = 0; + } + else + { + http->d->buffer = QByteArray(); + + if(data.dev && (data.dev->isOpen() || data.dev->open(QIODevice::ReadOnly))) + { + http->d->postDevice = data.dev; + if(http->d->postDevice->size() >= 0) + http->d->header.setContentLength(http->d->postDevice->size()); + } + else + { + http->d->postDevice = 0; + } + } + + if(to && (to->isOpen() || to->open(QIODevice::WriteOnly))) + http->d->toDevice = to; + else + http->d->toDevice = 0; + + http->d->reconnectAttempts = 2; + http->d->_q_slotSendRequest(); } bool QHttpNormalRequest::hasRequestHeader() { - return true; + return true; } QHttpRequestHeader QHttpNormalRequest::requestHeader() { - return header; + return header; } -QIODevice *QHttpNormalRequest::sourceDevice() +QIODevice * QHttpNormalRequest::sourceDevice() { - if (is_ba) - return 0; - return data.dev; + if(is_ba) + return 0; + return data.dev; } -QIODevice *QHttpNormalRequest::destinationDevice() +QIODevice * QHttpNormalRequest::destinationDevice() { - return to; + return to; } /**************************************************** @@ -309,27 +317,28 @@ QIODevice *QHttpNormalRequest::destinationDevice() class QHttpPGHRequest : public QHttpNormalRequest { public: - QHttpPGHRequest(const QHttpRequestHeader &h, QIODevice *d, QIODevice *t) : - QHttpNormalRequest(h, d, t) - { } + QHttpPGHRequest(const QHttpRequestHeader & h, QIODevice * d, QIODevice * t) : QHttpNormalRequest(h, d, t) + { + } - QHttpPGHRequest(const QHttpRequestHeader &h, QByteArray *d, QIODevice *t) : - QHttpNormalRequest(h, d, t) - { } + QHttpPGHRequest(const QHttpRequestHeader & h, QByteArray * d, QIODevice * t) : QHttpNormalRequest(h, d, t) + { + } - ~QHttpPGHRequest() - { } + ~QHttpPGHRequest() + { + } - void start(QHttp *); + void start(QHttp *); }; -void QHttpPGHRequest::start(QHttp *http) +void QHttpPGHRequest::start(QHttp * http) { - if (http->d->port && http->d->port != 80) - header.setValue(QLatin1String("Host"), http->d->hostName + QLatin1Char(':') + QString::number(http->d->port)); - else - header.setValue(QLatin1String("Host"), http->d->hostName); - QHttpNormalRequest::start(http); + if(http->d->port && http->d->port != 80) + header.setValue(QLatin1String("Host"), http->d->hostName + QLatin1Char(':') + QString::number(http->d->port)); + else + header.setValue(QLatin1String("Host"), http->d->hostName); + QHttpNormalRequest::start(http); } /**************************************************** @@ -341,39 +350,45 @@ void QHttpPGHRequest::start(QHttp *http) class QHttpSetHostRequest : public QHttpRequest { public: - QHttpSetHostRequest(const QString &h, quint16 p, QHttp::ConnectionMode m) - : hostName(h), port(p), mode(m) - { } - - void start(QHttp *); - - QIODevice *sourceDevice() - { return 0; } - QIODevice *destinationDevice() - { return 0; } + QHttpSetHostRequest(const QString & h, quint16 p, QHttp::ConnectionMode m) + : hostName(h), port(p), mode(m) + { + } + + void start(QHttp *); + + QIODevice * sourceDevice() + { + return 0; + } + QIODevice * destinationDevice() + { + return 0; + } private: - QString hostName; - quint16 port; - QHttp::ConnectionMode mode; + QString hostName; + quint16 port; + QHttp::ConnectionMode mode; }; -void QHttpSetHostRequest::start(QHttp *http) +void QHttpSetHostRequest::start(QHttp * http) { - http->d->hostName = hostName; - http->d->port = port; - http->d->mode = mode; + http->d->hostName = hostName; + http->d->port = port; + http->d->mode = mode; #ifdef QT_NO_OPENSSL - if (mode == QHttp::ConnectionModeHttps) { - // SSL requested but no SSL support compiled in - http->d->finishedWithError(QLatin1String(QT_TRANSLATE_NOOP("QHttp", "HTTPS connection requested but SSL support not compiled in")), - QHttp::UnknownError); - return; - } + if(mode == QHttp::ConnectionModeHttps) + { + // SSL requested but no SSL support compiled in + http->d->finishedWithError(QLatin1String(QT_TRANSLATE_NOOP("QHttp", "HTTPS connection requested but SSL support not compiled in")), + QHttp::UnknownError); + return; + } #endif - http->d->finishedWithSuccess(); + http->d->finishedWithSuccess(); } /**************************************************** @@ -385,27 +400,31 @@ void QHttpSetHostRequest::start(QHttp *http) class QHttpSetUserRequest : public QHttpRequest { public: - QHttpSetUserRequest(const QString &userName, const QString &password) : - user(userName), pass(password) - { } + QHttpSetUserRequest(const QString & userName, const QString & password) : user(userName), pass(password) + { + } - void start(QHttp *); + void start(QHttp *); - QIODevice *sourceDevice() - { return 0; } - QIODevice *destinationDevice() - { return 0; } + QIODevice * sourceDevice() + { + return 0; + } + QIODevice * destinationDevice() + { + return 0; + } private: - QString user; - QString pass; + QString user; + QString pass; }; -void QHttpSetUserRequest::start(QHttp *http) +void QHttpSetUserRequest::start(QHttp * http) { - http->d->authenticator.setUser(user); - http->d->authenticator.setPassword(pass); - http->d->finishedWithSuccess(); + http->d->authenticator.setUser(user); + http->d->authenticator.setPassword(pass); + http->d->finishedWithSuccess(); } #ifndef QT_NO_NETWORKPROXY @@ -419,29 +438,34 @@ void QHttpSetUserRequest::start(QHttp *http) class QHttpSetProxyRequest : public QHttpRequest { public: - inline QHttpSetProxyRequest(const QNetworkProxy &proxy) - { - this->proxy = proxy; - } - - inline void start(QHttp *http) - { - http->d->proxy = proxy; - QString user = proxy.user(); - if (!user.isEmpty()) - http->d->proxyAuthenticator.setUser(user); - QString password = proxy.password(); - if (!password.isEmpty()) - http->d->proxyAuthenticator.setPassword(password); - http->d->finishedWithSuccess(); - } - - inline QIODevice *sourceDevice() - { return 0; } - inline QIODevice *destinationDevice() - { return 0; } + inline QHttpSetProxyRequest(const QNetworkProxy & proxy) + { + this->proxy = proxy; + } + + inline void start(QHttp * http) + { + http->d->proxy = proxy; + QString user = proxy.user(); + if(!user.isEmpty()) + http->d->proxyAuthenticator.setUser(user); + QString password = proxy.password(); + if(!password.isEmpty()) + http->d->proxyAuthenticator.setPassword(password); + http->d->finishedWithSuccess(); + } + + inline QIODevice * sourceDevice() + { + return 0; + } + inline QIODevice * destinationDevice() + { + return 0; + } + private: - QNetworkProxy proxy; + QNetworkProxy proxy; }; #endif // QT_NO_NETWORKPROXY @@ -455,24 +479,29 @@ private: class QHttpSetSocketRequest : public QHttpRequest { public: - QHttpSetSocketRequest(QTcpSocket *s) : socket(s) - { } + QHttpSetSocketRequest(QTcpSocket * s) : socket(s) + { + } - void start(QHttp *); + void start(QHttp *); - QIODevice *sourceDevice() - { return 0; } - QIODevice *destinationDevice() - { return 0; } + QIODevice * sourceDevice() + { + return 0; + } + QIODevice * destinationDevice() + { + return 0; + } private: - QTcpSocket *socket; + QTcpSocket * socket; }; -void QHttpSetSocketRequest::start(QHttp *http) +void QHttpSetSocketRequest::start(QHttp * http) { - http->d->setSock(socket); - http->d->finishedWithSuccess(); + http->d->setSock(socket); + http->d->finishedWithSuccess(); } /**************************************************** @@ -484,30 +513,35 @@ void QHttpSetSocketRequest::start(QHttp *http) class QHttpCloseRequest : public QHttpRequest { public: - QHttpCloseRequest() - { } - void start(QHttp *); - - QIODevice *sourceDevice() - { return 0; } - QIODevice *destinationDevice() - { return 0; } + QHttpCloseRequest() + { + } + void start(QHttp *); + + QIODevice * sourceDevice() + { + return 0; + } + QIODevice * destinationDevice() + { + return 0; + } }; -void QHttpCloseRequest::start(QHttp *http) +void QHttpCloseRequest::start(QHttp * http) { - http->d->closeConn(); + http->d->closeConn(); } class QHttpHeaderPrivate { - Q_DECLARE_PUBLIC(QHttpHeader) + Q_DECLARE_PUBLIC(QHttpHeader) public: - inline virtual ~QHttpHeaderPrivate() {} + inline virtual ~QHttpHeaderPrivate() {} - QList > values; - bool valid; - QHttpHeader *q_ptr; + QList> values; + bool valid; + QHttpHeader * q_ptr; }; /**************************************************** @@ -569,21 +603,21 @@ public: QHttpHeader::QHttpHeader() : d_ptr(new QHttpHeaderPrivate) { - Q_D(QHttpHeader); - d->q_ptr = this; - d->valid = true; + Q_D(QHttpHeader); + d->q_ptr = this; + d->valid = true; } /*! Constructs a copy of \a header. */ -QHttpHeader::QHttpHeader(const QHttpHeader &header) +QHttpHeader::QHttpHeader(const QHttpHeader & header) : d_ptr(new QHttpHeaderPrivate) { - Q_D(QHttpHeader); - d->q_ptr = this; - d->valid = header.d_func()->valid; - d->values = header.d_func()->values; + Q_D(QHttpHeader); + d->q_ptr = this; + d->valid = header.d_func()->valid; + d->values = header.d_func()->values; } /*! @@ -594,36 +628,36 @@ QHttpHeader::QHttpHeader(const QHttpHeader &header) "\r\n" delimited lines; each of these lines should have the format key, colon, space, value. */ -QHttpHeader::QHttpHeader(const QString &str) +QHttpHeader::QHttpHeader(const QString & str) : d_ptr(new QHttpHeaderPrivate) { - Q_D(QHttpHeader); - d->q_ptr = this; - d->valid = true; - parse(str); + Q_D(QHttpHeader); + d->q_ptr = this; + d->valid = true; + parse(str); } /*! \internal */ -QHttpHeader::QHttpHeader(QHttpHeaderPrivate &dd, const QString &str) +QHttpHeader::QHttpHeader(QHttpHeaderPrivate & dd, const QString & str) : d_ptr(&dd) { - Q_D(QHttpHeader); - d->q_ptr = this; - d->valid = true; - if (!str.isEmpty()) - parse(str); + Q_D(QHttpHeader); + d->q_ptr = this; + d->valid = true; + if(!str.isEmpty()) + parse(str); } /*! \internal */ -QHttpHeader::QHttpHeader(QHttpHeaderPrivate &dd, const QHttpHeader &header) +QHttpHeader::QHttpHeader(QHttpHeaderPrivate & dd, const QHttpHeader & header) : d_ptr(&dd) { - Q_D(QHttpHeader); - d->q_ptr = this; - d->valid = header.d_func()->valid; - d->values = header.d_func()->values; + Q_D(QHttpHeader); + d->q_ptr = this; + d->valid = header.d_func()->valid; + d->values = header.d_func()->values; } /*! Destructor. @@ -635,12 +669,12 @@ QHttpHeader::~QHttpHeader() /*! Assigns \a h and returns a reference to this http header. */ -QHttpHeader &QHttpHeader::operator=(const QHttpHeader &h) +QHttpHeader & QHttpHeader::operator=(const QHttpHeader & h) { - Q_D(QHttpHeader); - d->values = h.d_func()->values; - d->valid = h.d_func()->valid; - return *this; + Q_D(QHttpHeader); + d->values = h.d_func()->values; + d->valid = h.d_func()->valid; + return *this; } /*! @@ -650,8 +684,8 @@ QHttpHeader &QHttpHeader::operator=(const QHttpHeader &h) */ bool QHttpHeader::isValid() const { - Q_D(const QHttpHeader); - return d->valid; + Q_D(const QHttpHeader); + return d->valid; } /*! \internal @@ -663,52 +697,60 @@ bool QHttpHeader::isValid() const \sa toString() */ -bool QHttpHeader::parse(const QString &str) -{ - Q_D(QHttpHeader); - QStringList lst; - int pos = str.indexOf(QLatin1Char('\n')); - if (pos > 0 && str.at(pos - 1) == QLatin1Char('\r')) - lst = str.trimmed().split(QLatin1String("\r\n")); - else - lst = str.trimmed().split(QLatin1String("\n")); - lst.removeAll(QString()); // No empties - - if (lst.isEmpty()) - return true; - - QStringList lines; - QStringList::Iterator it = lst.begin(); - for (; it != lst.end(); ++it) { - if (!(*it).isEmpty()) { - if ((*it)[0].isSpace()) { - if (!lines.isEmpty()) { - lines.last() += QLatin1Char(' '); - lines.last() += (*it).trimmed(); - } - } else { - lines.append((*it)); - } - } - } - - int number = 0; - it = lines.begin(); - for (; it != lines.end(); ++it) { - if (!parseLine(*it, number++)) { - d->valid = false; - return false; - } - } - return true; +bool QHttpHeader::parse(const QString & str) +{ + Q_D(QHttpHeader); + QStringList lst; + int pos = str.indexOf(QLatin1Char('\n')); + if(pos > 0 && str.at(pos - 1) == QLatin1Char('\r')) + lst = str.trimmed().split(QLatin1String("\r\n")); + else + lst = str.trimmed().split(QLatin1String("\n")); + lst.removeAll(QString()); // No empties + + if(lst.isEmpty()) + return true; + + QStringList lines; + QStringList::Iterator it = lst.begin(); + for(; it != lst.end(); ++it) + { + if(!(*it).isEmpty()) + { + if((*it)[0].isSpace()) + { + if(!lines.isEmpty()) + { + lines.last() += QLatin1Char(' '); + lines.last() += (*it).trimmed(); + } + } + else + { + lines.append((*it)); + } + } + } + + int number = 0; + it = lines.begin(); + for(; it != lines.end(); ++it) + { + if(!parseLine(*it, number++)) + { + d->valid = false; + return false; + } + } + return true; } /*! \internal */ void QHttpHeader::setValid(bool v) { - Q_D(QHttpHeader); - d->valid = v; + Q_D(QHttpHeader); + d->valid = v; } /*! @@ -717,35 +759,37 @@ void QHttpHeader::setValid(bool v) \sa setValue() removeValue() hasKey() keys() */ -QString QHttpHeader::value(const QString &key) const +QString QHttpHeader::value(const QString & key) const { - Q_D(const QHttpHeader); - QString lowercaseKey = key.toLower(); - QList >::ConstIterator it = d->values.constBegin(); - while (it != d->values.constEnd()) { - if ((*it).first.toLower() == lowercaseKey) - return (*it).second; - ++it; - } - return QString(); + Q_D(const QHttpHeader); + QString lowercaseKey = key.toLower(); + QList>::ConstIterator it = d->values.constBegin(); + while(it != d->values.constEnd()) + { + if((*it).first.toLower() == lowercaseKey) + return (*it).second; + ++it; + } + return QString(); } /*! Returns all the entries with the given \a key. If no entry has this \a key, an empty string list is returned. */ -QStringList QHttpHeader::allValues(const QString &key) const +QStringList QHttpHeader::allValues(const QString & key) const { - Q_D(const QHttpHeader); - QString lowercaseKey = key.toLower(); - QStringList valueList; - QList >::ConstIterator it = d->values.constBegin(); - while (it != d->values.constEnd()) { - if ((*it).first.toLower() == lowercaseKey) - valueList.append((*it).second); - ++it; - } - return valueList; + Q_D(const QHttpHeader); + QString lowercaseKey = key.toLower(); + QStringList valueList; + QList>::ConstIterator it = d->values.constBegin(); + while(it != d->values.constEnd()) + { + if((*it).first.toLower() == lowercaseKey) + valueList.append((*it).second); + ++it; + } + return valueList; } /*! @@ -755,20 +799,22 @@ QStringList QHttpHeader::allValues(const QString &key) const */ QStringList QHttpHeader::keys() const { - Q_D(const QHttpHeader); - QStringList keyList; - QSet seenKeys; - QList >::ConstIterator it = d->values.constBegin(); - while (it != d->values.constEnd()) { - const QString &key = (*it).first; - QString lowercaseKey = key.toLower(); - if (!seenKeys.contains(lowercaseKey)) { - keyList.append(key); - seenKeys.insert(lowercaseKey); - } - ++it; - } - return keyList; + Q_D(const QHttpHeader); + QStringList keyList; + QSet seenKeys; + QList>::ConstIterator it = d->values.constBegin(); + while(it != d->values.constEnd()) + { + const QString & key = (*it).first; + QString lowercaseKey = key.toLower(); + if(!seenKeys.contains(lowercaseKey)) + { + keyList.append(key); + seenKeys.insert(lowercaseKey); + } + ++it; + } + return keyList; } /*! @@ -777,17 +823,18 @@ QStringList QHttpHeader::keys() const \sa value() setValue() keys() */ -bool QHttpHeader::hasKey(const QString &key) const +bool QHttpHeader::hasKey(const QString & key) const { - Q_D(const QHttpHeader); - QString lowercaseKey = key.toLower(); - QList >::ConstIterator it = d->values.constBegin(); - while (it != d->values.constEnd()) { - if ((*it).first.toLower() == lowercaseKey) - return true; - ++it; - } - return false; + Q_D(const QHttpHeader); + QString lowercaseKey = key.toLower(); + QList>::ConstIterator it = d->values.constBegin(); + while(it != d->values.constEnd()) + { + if((*it).first.toLower() == lowercaseKey) + return true; + ++it; + } + return false; } /*! @@ -800,47 +847,49 @@ bool QHttpHeader::hasKey(const QString &key) const \sa value() hasKey() removeValue() */ -void QHttpHeader::setValue(const QString &key, const QString &value) +void QHttpHeader::setValue(const QString & key, const QString & value) { - Q_D(QHttpHeader); - QString lowercaseKey = key.toLower(); - QList >::Iterator it = d->values.begin(); - while (it != d->values.end()) { - if ((*it).first.toLower() == lowercaseKey) { - (*it).second = value; - return; - } - ++it; - } - // not found so add - addValue(key, value); + Q_D(QHttpHeader); + QString lowercaseKey = key.toLower(); + QList>::Iterator it = d->values.begin(); + while(it != d->values.end()) + { + if((*it).first.toLower() == lowercaseKey) + { + (*it).second = value; + return; + } + ++it; + } + // not found so add + addValue(key, value); } /*! Sets the header entries to be the list of key value pairs in \a values. */ -void QHttpHeader::setValues(const QList > &values) +void QHttpHeader::setValues(const QList> & values) { - Q_D(QHttpHeader); - d->values = values; + Q_D(QHttpHeader); + d->values = values; } /*! Adds a new entry with the \a key and \a value. */ -void QHttpHeader::addValue(const QString &key, const QString &value) +void QHttpHeader::addValue(const QString & key, const QString & value) { - Q_D(QHttpHeader); - d->values.append(qMakePair(key, value)); + Q_D(QHttpHeader); + d->values.append(qMakePair(key, value)); } /*! Returns all the entries in the header. */ -QList > QHttpHeader::values() const +QList> QHttpHeader::values() const { - Q_D(const QHttpHeader); - return d->values; + Q_D(const QHttpHeader); + return d->values; } /*! @@ -848,35 +897,39 @@ QList > QHttpHeader::values() const \sa value() setValue() */ -void QHttpHeader::removeValue(const QString &key) +void QHttpHeader::removeValue(const QString & key) { - Q_D(QHttpHeader); - QString lowercaseKey = key.toLower(); - QList >::Iterator it = d->values.begin(); - while (it != d->values.end()) { - if ((*it).first.toLower() == lowercaseKey) { - d->values.erase(it); - return; - } - ++it; - } + Q_D(QHttpHeader); + QString lowercaseKey = key.toLower(); + QList>::Iterator it = d->values.begin(); + while(it != d->values.end()) + { + if((*it).first.toLower() == lowercaseKey) + { + d->values.erase(it); + return; + } + ++it; + } } /*! Removes all the entries with the key \a key from the HTTP header. */ -void QHttpHeader::removeAllValues(const QString &key) +void QHttpHeader::removeAllValues(const QString & key) { - Q_D(QHttpHeader); - QString lowercaseKey = key.toLower(); - QList >::Iterator it = d->values.begin(); - while (it != d->values.end()) { - if ((*it).first.toLower() == lowercaseKey) { - it = d->values.erase(it); - continue; - } - ++it; - } + Q_D(QHttpHeader); + QString lowercaseKey = key.toLower(); + QList>::Iterator it = d->values.begin(); + while(it != d->values.end()) + { + if((*it).first.toLower() == lowercaseKey) + { + it = d->values.erase(it); + continue; + } + ++it; + } } /*! \internal @@ -887,15 +940,15 @@ void QHttpHeader::removeAllValues(const QString &key) \sa parse() */ -bool QHttpHeader::parseLine(const QString &line, int) +bool QHttpHeader::parseLine(const QString & line, int) { - int i = line.indexOf(QLatin1Char(':')); - if (i == -1) - return false; + int i = line.indexOf(QLatin1Char(':')); + if(i == -1) + return false; - addValue(line.left(i).trimmed(), line.mid(i + 1).trimmed()); + addValue(line.left(i).trimmed(), line.mid(i + 1).trimmed()); - return true; + return true; } /*! @@ -907,18 +960,19 @@ bool QHttpHeader::parseLine(const QString &line, int) */ QString QHttpHeader::toString() const { - Q_D(const QHttpHeader); - if (!isValid()) - return QLatin1String(""); + Q_D(const QHttpHeader); + if(!isValid()) + return QLatin1String(""); - QString ret = QLatin1String(""); + QString ret = QLatin1String(""); - QList >::ConstIterator it = d->values.constBegin(); - while (it != d->values.constEnd()) { - ret += (*it).first + QLatin1String(": ") + (*it).second + QLatin1String("\r\n"); - ++it; - } - return ret; + QList>::ConstIterator it = d->values.constBegin(); + while(it != d->values.constEnd()) + { + ret += (*it).first + QLatin1String(": ") + (*it).second + QLatin1String("\r\n"); + ++it; + } + return ret; } /*! @@ -929,7 +983,7 @@ QString QHttpHeader::toString() const */ bool QHttpHeader::hasContentLength() const { - return hasKey(QLatin1String("content-length")); + return hasKey(QLatin1String("content-length")); } /*! @@ -940,7 +994,7 @@ bool QHttpHeader::hasContentLength() const */ uint QHttpHeader::contentLength() const { - return value(QLatin1String("content-length")).toUInt(); + return value(QLatin1String("content-length")).toUInt(); } /*! @@ -951,7 +1005,7 @@ uint QHttpHeader::contentLength() const */ void QHttpHeader::setContentLength(int len) { - setValue(QLatin1String("content-length"), QString::number(len)); + setValue(QLatin1String("content-length"), QString::number(len)); } /*! @@ -962,7 +1016,7 @@ void QHttpHeader::setContentLength(int len) */ bool QHttpHeader::hasContentType() const { - return hasKey(QLatin1String("content-type")); + return hasKey(QLatin1String("content-type")); } /*! @@ -972,15 +1026,15 @@ bool QHttpHeader::hasContentType() const */ QString QHttpHeader::contentType() const { - QString type = value(QLatin1String("content-type")); - if (type.isEmpty()) - return QString(); + QString type = value(QLatin1String("content-type")); + if(type.isEmpty()) + return QString(); - int pos = type.indexOf(QLatin1Char(';')); - if (pos == -1) - return type; + int pos = type.indexOf(QLatin1Char(';')); + if(pos == -1) + return type; - return type.left(pos).trimmed(); + return type.left(pos).trimmed(); } /*! @@ -989,19 +1043,19 @@ QString QHttpHeader::contentType() const \sa contentType() hasContentType() */ -void QHttpHeader::setContentType(const QString &type) +void QHttpHeader::setContentType(const QString & type) { - setValue(QLatin1String("content-type"), type); + setValue(QLatin1String("content-type"), type); } class QHttpResponseHeaderPrivate : public QHttpHeaderPrivate { - Q_DECLARE_PUBLIC(QHttpResponseHeader) + Q_DECLARE_PUBLIC(QHttpResponseHeader) public: - int statCode; - QString reasonPhr; - int majVer; - int minVer; + int statCode; + QString reasonPhr; + int majVer; + int minVer; }; /**************************************************** @@ -1037,34 +1091,34 @@ public: QHttpResponseHeader::QHttpResponseHeader() : QHttpHeader(*new QHttpResponseHeaderPrivate) { - setValid(false); + setValid(false); } /*! Constructs a copy of \a header. */ -QHttpResponseHeader::QHttpResponseHeader(const QHttpResponseHeader &header) +QHttpResponseHeader::QHttpResponseHeader(const QHttpResponseHeader & header) : QHttpHeader(*new QHttpResponseHeaderPrivate, header) { - Q_D(QHttpResponseHeader); - d->statCode = header.d_func()->statCode; - d->reasonPhr = header.d_func()->reasonPhr; - d->majVer = header.d_func()->majVer; - d->minVer = header.d_func()->minVer; + Q_D(QHttpResponseHeader); + d->statCode = header.d_func()->statCode; + d->reasonPhr = header.d_func()->reasonPhr; + d->majVer = header.d_func()->majVer; + d->minVer = header.d_func()->minVer; } /*! Copies the contents of \a header into this QHttpResponseHeader. */ -QHttpResponseHeader &QHttpResponseHeader::operator=(const QHttpResponseHeader &header) +QHttpResponseHeader & QHttpResponseHeader::operator=(const QHttpResponseHeader & header) { - Q_D(QHttpResponseHeader); - QHttpHeader::operator=(header); - d->statCode = header.d_func()->statCode; - d->reasonPhr = header.d_func()->reasonPhr; - d->majVer = header.d_func()->majVer; - d->minVer = header.d_func()->minVer; - return *this; + Q_D(QHttpResponseHeader); + QHttpHeader::operator=(header); + d->statCode = header.d_func()->statCode; + d->reasonPhr = header.d_func()->reasonPhr; + d->majVer = header.d_func()->majVer; + d->minVer = header.d_func()->minVer; + return *this; } /*! @@ -1075,10 +1129,10 @@ QHttpResponseHeader &QHttpResponseHeader::operator=(const QHttpResponseHeader &h reason-phrase); each of remaining lines should have the format key, colon, space, value. */ -QHttpResponseHeader::QHttpResponseHeader(const QString &str) +QHttpResponseHeader::QHttpResponseHeader(const QString & str) : QHttpHeader(*new QHttpResponseHeaderPrivate) { - parse(str); + parse(str); } /*! @@ -1090,10 +1144,10 @@ QHttpResponseHeader::QHttpResponseHeader(const QString &str) \sa statusCode() reasonPhrase() majorVersion() minorVersion() */ -QHttpResponseHeader::QHttpResponseHeader(int code, const QString &text, int majorVer, int minorVer) +QHttpResponseHeader::QHttpResponseHeader(int code, const QString & text, int majorVer, int minorVer) : QHttpHeader(*new QHttpResponseHeaderPrivate) { - setStatusLine(code, text, majorVer, minorVer); + setStatusLine(code, text, majorVer, minorVer); } /*! @@ -1104,14 +1158,14 @@ QHttpResponseHeader::QHttpResponseHeader(int code, const QString &text, int majo \sa statusCode() reasonPhrase() majorVersion() minorVersion() */ -void QHttpResponseHeader::setStatusLine(int code, const QString &text, int majorVer, int minorVer) +void QHttpResponseHeader::setStatusLine(int code, const QString & text, int majorVer, int minorVer) { - Q_D(QHttpResponseHeader); - setValid(true); - d->statCode = code; - d->reasonPhr = text; - d->majVer = majorVer; - d->minVer = minorVer; + Q_D(QHttpResponseHeader); + setValid(true); + d->statCode = code; + d->reasonPhr = text; + d->majVer = majorVer; + d->minVer = minorVer; } /*! @@ -1121,8 +1175,8 @@ void QHttpResponseHeader::setStatusLine(int code, const QString &text, int major */ int QHttpResponseHeader::statusCode() const { - Q_D(const QHttpResponseHeader); - return d->statCode; + Q_D(const QHttpResponseHeader); + return d->statCode; } /*! @@ -1132,8 +1186,8 @@ int QHttpResponseHeader::statusCode() const */ QString QHttpResponseHeader::reasonPhrase() const { - Q_D(const QHttpResponseHeader); - return d->reasonPhr; + Q_D(const QHttpResponseHeader); + return d->reasonPhr; } /*! @@ -1143,8 +1197,8 @@ QString QHttpResponseHeader::reasonPhrase() const */ int QHttpResponseHeader::majorVersion() const { - Q_D(const QHttpResponseHeader); - return d->majVer; + Q_D(const QHttpResponseHeader); + return d->majVer; } /*! @@ -1154,59 +1208,64 @@ int QHttpResponseHeader::majorVersion() const */ int QHttpResponseHeader::minorVersion() const { - Q_D(const QHttpResponseHeader); - return d->minVer; + Q_D(const QHttpResponseHeader); + return d->minVer; } /*! \internal */ -bool QHttpResponseHeader::parseLine(const QString &line, int number) -{ - Q_D(QHttpResponseHeader); - if (number != 0) - return QHttpHeader::parseLine(line, number); - - QString l = line.simplified(); - if (l.length() < 10) - return false; - - if (l.left(5) == QLatin1String("HTTP/") && l[5].isDigit() && l[6] == QLatin1Char('.') && - l[7].isDigit() && l[8] == QLatin1Char(' ') && l[9].isDigit()) { - d->majVer = l[5].toLatin1() - '0'; - d->minVer = l[7].toLatin1() - '0'; - - int pos = l.indexOf(QLatin1Char(' '), 9); - if (pos != -1) { - d->reasonPhr = l.mid(pos + 1); - d->statCode = l.mid(9, pos - 9).toInt(); - } else { - d->statCode = l.mid(9).toInt(); - d->reasonPhr.clear(); - } - } else { - return false; - } - - return true; +bool QHttpResponseHeader::parseLine(const QString & line, int number) +{ + Q_D(QHttpResponseHeader); + if(number != 0) + return QHttpHeader::parseLine(line, number); + + QString l = line.simplified(); + if(l.length() < 10) + return false; + + if(l.left(5) == QLatin1String("HTTP/") && l[5].isDigit() && l[6] == QLatin1Char('.') && l[7].isDigit() && l[8] == QLatin1Char(' ') && l[9].isDigit()) + { + d->majVer = l[5].toLatin1() - '0'; + d->minVer = l[7].toLatin1() - '0'; + + int pos = l.indexOf(QLatin1Char(' '), 9); + if(pos != -1) + { + d->reasonPhr = l.mid(pos + 1); + d->statCode = l.mid(9, pos - 9).toInt(); + } + else + { + d->statCode = l.mid(9).toInt(); + d->reasonPhr.clear(); + } + } + else + { + return false; + } + + return true; } /*! \reimp */ QString QHttpResponseHeader::toString() const { - Q_D(const QHttpResponseHeader); - QString ret(QLatin1String("HTTP/%1.%2 %3 %4\r\n%5\r\n")); - return ret.arg(d->majVer).arg(d->minVer).arg(d->statCode).arg(d->reasonPhr).arg(QHttpHeader::toString()); + Q_D(const QHttpResponseHeader); + QString ret(QLatin1String("HTTP/%1.%2 %3 %4\r\n%5\r\n")); + return ret.arg(d->majVer).arg(d->minVer).arg(d->statCode).arg(d->reasonPhr).arg(QHttpHeader::toString()); } class QHttpRequestHeaderPrivate : public QHttpHeaderPrivate { - Q_DECLARE_PUBLIC(QHttpRequestHeader) + Q_DECLARE_PUBLIC(QHttpRequestHeader) public: - QString m; - QString p; - int majVer; - int minVer; + QString m; + QString p; + int majVer; + int minVer; }; /**************************************************** @@ -1252,7 +1311,7 @@ public: QHttpRequestHeader::QHttpRequestHeader() : QHttpHeader(*new QHttpRequestHeaderPrivate) { - setValid(false); + setValid(false); } /*! @@ -1261,41 +1320,41 @@ QHttpRequestHeader::QHttpRequestHeader() minorVer. The \a path argument must be properly encoded for an HTTP request. */ -QHttpRequestHeader::QHttpRequestHeader(const QString &method, const QString &path, int majorVer, int minorVer) +QHttpRequestHeader::QHttpRequestHeader(const QString & method, const QString & path, int majorVer, int minorVer) : QHttpHeader(*new QHttpRequestHeaderPrivate) { - Q_D(QHttpRequestHeader); - d->m = method; - d->p = path; - d->majVer = majorVer; - d->minVer = minorVer; + Q_D(QHttpRequestHeader); + d->m = method; + d->p = path; + d->majVer = majorVer; + d->minVer = minorVer; } /*! Constructs a copy of \a header. */ -QHttpRequestHeader::QHttpRequestHeader(const QHttpRequestHeader &header) +QHttpRequestHeader::QHttpRequestHeader(const QHttpRequestHeader & header) : QHttpHeader(*new QHttpRequestHeaderPrivate, header) { - Q_D(QHttpRequestHeader); - d->m = header.d_func()->m; - d->p = header.d_func()->p; - d->majVer = header.d_func()->majVer; - d->minVer = header.d_func()->minVer; + Q_D(QHttpRequestHeader); + d->m = header.d_func()->m; + d->p = header.d_func()->p; + d->majVer = header.d_func()->majVer; + d->minVer = header.d_func()->minVer; } /*! Copies the content of \a header into this QHttpRequestHeader */ -QHttpRequestHeader &QHttpRequestHeader::operator=(const QHttpRequestHeader &header) +QHttpRequestHeader & QHttpRequestHeader::operator=(const QHttpRequestHeader & header) { - Q_D(QHttpRequestHeader); - QHttpHeader::operator=(header); - d->m = header.d_func()->m; - d->p = header.d_func()->p; - d->majVer = header.d_func()->majVer; - d->minVer = header.d_func()->minVer; - return *this; + Q_D(QHttpRequestHeader); + QHttpHeader::operator=(header); + d->m = header.d_func()->m; + d->p = header.d_func()->p; + d->majVer = header.d_func()->majVer; + d->minVer = header.d_func()->minVer; + return *this; } /*! @@ -1305,10 +1364,10 @@ QHttpRequestHeader &QHttpRequestHeader::operator=(const QHttpRequestHeader &head HTTP-version); each of the remaining lines should have the format key, colon, space, value. */ -QHttpRequestHeader::QHttpRequestHeader(const QString &str) +QHttpRequestHeader::QHttpRequestHeader(const QString & str) : QHttpHeader(*new QHttpRequestHeaderPrivate) { - parse(str); + parse(str); } /*! @@ -1319,14 +1378,14 @@ QHttpRequestHeader::QHttpRequestHeader(const QString &str) \sa method() path() majorVersion() minorVersion() */ -void QHttpRequestHeader::setRequest(const QString &method, const QString &path, int majorVer, int minorVer) +void QHttpRequestHeader::setRequest(const QString & method, const QString & path, int majorVer, int minorVer) { - Q_D(QHttpRequestHeader); - setValid(true); - d->m = method; - d->p = path; - d->majVer = majorVer; - d->minVer = minorVer; + Q_D(QHttpRequestHeader); + setValid(true); + d->m = method; + d->p = path; + d->majVer = majorVer; + d->minVer = minorVer; } /*! @@ -1336,8 +1395,8 @@ void QHttpRequestHeader::setRequest(const QString &method, const QString &path, */ QString QHttpRequestHeader::method() const { - Q_D(const QHttpRequestHeader); - return d->m; + Q_D(const QHttpRequestHeader); + return d->m; } /*! @@ -1347,8 +1406,8 @@ QString QHttpRequestHeader::method() const */ QString QHttpRequestHeader::path() const { - Q_D(const QHttpRequestHeader); - return d->p; + Q_D(const QHttpRequestHeader); + return d->p; } /*! @@ -1358,8 +1417,8 @@ QString QHttpRequestHeader::path() const */ int QHttpRequestHeader::majorVersion() const { - Q_D(const QHttpRequestHeader); - return d->majVer; + Q_D(const QHttpRequestHeader); + return d->majVer; } /*! @@ -1369,50 +1428,51 @@ int QHttpRequestHeader::majorVersion() const */ int QHttpRequestHeader::minorVersion() const { - Q_D(const QHttpRequestHeader); - return d->minVer; + Q_D(const QHttpRequestHeader); + return d->minVer; } /*! \internal */ -bool QHttpRequestHeader::parseLine(const QString &line, int number) -{ - Q_D(QHttpRequestHeader); - if (number != 0) - return QHttpHeader::parseLine(line, number); - - QStringList lst = line.simplified().split(QLatin1String(" ")); - if (lst.count() > 0) { - d->m = lst[0]; - if (lst.count() > 1) { - d->p = lst[1]; - if (lst.count() > 2) { - QString v = lst[2]; - if (v.length() >= 8 && v.left(5) == QLatin1String("HTTP/") && - v[5].isDigit() && v[6] == QLatin1Char('.') && v[7].isDigit()) { - d->majVer = v[5].toLatin1() - '0'; - d->minVer = v[7].toLatin1() - '0'; - return true; - } - } - } - } - - return false; +bool QHttpRequestHeader::parseLine(const QString & line, int number) +{ + Q_D(QHttpRequestHeader); + if(number != 0) + return QHttpHeader::parseLine(line, number); + + QStringList lst = line.simplified().split(QLatin1String(" ")); + if(lst.count() > 0) + { + d->m = lst[0]; + if(lst.count() > 1) + { + d->p = lst[1]; + if(lst.count() > 2) + { + QString v = lst[2]; + if(v.length() >= 8 && v.left(5) == QLatin1String("HTTP/") && v[5].isDigit() && v[6] == QLatin1Char('.') && v[7].isDigit()) + { + d->majVer = v[5].toLatin1() - '0'; + d->minVer = v[7].toLatin1() - '0'; + return true; + } + } + } + } + + return false; } /*! \reimp */ QString QHttpRequestHeader::toString() const { - Q_D(const QHttpRequestHeader); - QString first(QLatin1String("%1 %2")); - QString last(QLatin1String(" HTTP/%3.%4\r\n%5\r\n")); - return first.arg(d->m).arg(d->p) + - last.arg(d->majVer).arg(d->minVer).arg(QHttpHeader::toString()); + Q_D(const QHttpRequestHeader); + QString first(QLatin1String("%1 %2")); + QString last(QLatin1String(" HTTP/%3.%4\r\n%5\r\n")); + return first.arg(d->m).arg(d->p) + last.arg(d->majVer).arg(d->minVer).arg(QHttpHeader::toString()); } - /**************************************************** * * QHttp @@ -1526,10 +1586,10 @@ QString QHttpRequestHeader::toString() const Constructs a QHttp object. The \a parent parameter is passed on to the QObject constructor. */ -QHttp::QHttp(QObject *parent) +QHttp::QHttp(QObject * parent) : QObject(parent), d(new QHttpPrivate(this)) { - d->init(); + d->init(); } /*! @@ -1540,13 +1600,13 @@ QHttp::QHttp(QObject *parent) \sa setHost() */ -QHttp::QHttp(const QString &hostName, quint16 port, QObject *parent) +QHttp::QHttp(const QString & hostName, quint16 port, QObject * parent) : QObject(parent), d(new QHttpPrivate(this)) { - d->init(); + d->init(); - d->hostName = hostName; - d->port = port; + d->hostName = hostName; + d->port = port; } /*! @@ -1561,25 +1621,25 @@ QHttp::QHttp(const QString &hostName, quint16 port, QObject *parent) \sa setHost() */ -QHttp::QHttp(const QString &hostName, ConnectionMode mode, quint16 port, QObject *parent) +QHttp::QHttp(const QString & hostName, ConnectionMode mode, quint16 port, QObject * parent) : QObject(parent), d(new QHttpPrivate(this)) { - d->init(); + d->init(); - d->hostName = hostName; - if (port == 0) - port = (mode == ConnectionModeHttp) ? 80 : 443; - d->port = port; - d->mode = mode; + d->hostName = hostName; + if(port == 0) + port = (mode == ConnectionModeHttp) ? 80 : 443; + d->port = port; + d->mode = mode; } void QHttpPrivate::init() { - Q_Q(QHttp); - errorString = QLatin1String(QT_TRANSLATE_NOOP("QHttp", "Unknown error")); - QMetaObject::invokeMethod(q, "_q_slotDoFinished", Qt::QueuedConnection); - post100ContinueTimer.setSingleShot(true); - QObject::connect(&post100ContinueTimer, SIGNAL(timeout()), q, SLOT(_q_continuePost())); + Q_Q(QHttp); + errorString = QLatin1String(QT_TRANSLATE_NOOP("QHttp", "Unknown error")); + QMetaObject::invokeMethod(q, "_q_slotDoFinished", Qt::QueuedConnection); + post100ContinueTimer.setSingleShot(true); + QObject::connect(&post100ContinueTimer, SIGNAL(timeout()), q, SLOT(_q_continuePost())); } /*! @@ -1588,7 +1648,7 @@ void QHttpPrivate::init() */ QHttp::~QHttp() { - abort(); + abort(); } void QHttp::_q_startNextRequest() @@ -1867,14 +1927,14 @@ void QHttp::_q_continuePost() */ void QHttp::abort() { - if (d->pending.isEmpty()) - return; + if(d->pending.isEmpty()) + return; - d->finishedWithError(tr("Request aborted"), Aborted); - clearPendingRequests(); - if (d->socket) - d->socket->abort(); - d->closeConn(); + d->finishedWithError(tr("Request aborted"), Aborted); + clearPendingRequests(); + if(d->socket) + d->socket->abort(); + d->closeConn(); } /*! @@ -1886,9 +1946,9 @@ void QHttp::abort() qint64 QHttp::bytesAvailable() const { #if defined(QHTTP_DEBUG) - qDebug("QHttp::bytesAvailable(): %d bytes", (int)d->rba.size()); + qDebug("QHttp::bytesAvailable(): %d bytes", (int)d->rba.size()); #endif - return qint64(d->rba.size()); + return qint64(d->rba.size()); } /*! \fn qint64 QHttp::readBlock(char *data, quint64 maxlen) @@ -1902,28 +1962,30 @@ qint64 QHttp::bytesAvailable() const \sa get() post() request() readyRead() bytesAvailable() readAll() */ -qint64 QHttp::read(char *data, qint64 maxlen) -{ - if (data == 0 && maxlen != 0) { - qWarning("QHttp::read: Null pointer error"); - return -1; - } - if (maxlen >= d->rba.size()) - maxlen = d->rba.size(); - int readSoFar = 0; - while (!d->rba.isEmpty() && readSoFar < maxlen) { - int nextBlockSize = d->rba.nextDataBlockSize(); - int bytesToRead = qMin(maxlen - readSoFar, nextBlockSize); - memcpy(data + readSoFar, d->rba.readPointer(), bytesToRead); - d->rba.free(bytesToRead); - readSoFar += bytesToRead; - } - - d->bytesDone += maxlen; +qint64 QHttp::read(char * data, qint64 maxlen) +{ + if(data == 0 && maxlen != 0) + { + qWarning("QHttp::read: Null pointer error"); + return -1; + } + if(maxlen >= d->rba.size()) + maxlen = d->rba.size(); + int readSoFar = 0; + while(!d->rba.isEmpty() && readSoFar < maxlen) + { + int nextBlockSize = d->rba.nextDataBlockSize(); + int bytesToRead = qMin(maxlen - readSoFar, nextBlockSize); + memcpy(data + readSoFar, d->rba.readPointer(), bytesToRead); + d->rba.free(bytesToRead); + readSoFar += bytesToRead; + } + + d->bytesDone += maxlen; #if defined(QHTTP_DEBUG) - qDebug("QHttp::read(): read %lld bytes (%lld bytes done)", maxlen, d->bytesDone); + qDebug("QHttp::read(): read %lld bytes (%lld bytes done)", maxlen, d->bytesDone); #endif - return maxlen; + return maxlen; } /*! @@ -1933,12 +1995,12 @@ qint64 QHttp::read(char *data, qint64 maxlen) */ QByteArray QHttp::readAll() { - qint64 avail = bytesAvailable(); - QByteArray tmp; - tmp.resize(int(avail)); - qint64 got = read(tmp.data(), int(avail)); - tmp.resize(got); - return tmp; + qint64 avail = bytesAvailable(); + QByteArray tmp; + tmp.resize(int(avail)); + qint64 got = read(tmp.data(), int(avail)); + tmp.resize(got); + return tmp; } /*! @@ -1949,9 +2011,9 @@ QByteArray QHttp::readAll() */ int QHttp::currentId() const { - if (d->pending.isEmpty()) - return 0; - return d->pending.first()->id; + if(d->pending.isEmpty()) + return 0; + return d->pending.first()->id; } /*! @@ -1964,12 +2026,13 @@ int QHttp::currentId() const */ QHttpRequestHeader QHttp::currentRequest() const { - if (!d->pending.isEmpty()) { - QHttpRequest *r = d->pending.first(); - if (r->hasRequestHeader()) - return r->requestHeader(); - } - return QHttpRequestHeader(); + if(!d->pending.isEmpty()) + { + QHttpRequest * r = d->pending.first(); + if(r->hasRequestHeader()) + return r->requestHeader(); + } + return QHttpRequestHeader(); } /*! @@ -1981,7 +2044,7 @@ QHttpRequestHeader QHttp::currentRequest() const */ QHttpResponseHeader QHttp::lastResponse() const { - return d->response; + return d->response; } /*! @@ -1994,11 +2057,11 @@ QHttpResponseHeader QHttp::lastResponse() const \sa currentDestinationDevice() post() request() */ -QIODevice *QHttp::currentSourceDevice() const +QIODevice * QHttp::currentSourceDevice() const { - if (d->pending.isEmpty()) - return 0; - return d->pending.first()->sourceDevice(); + if(d->pending.isEmpty()) + return 0; + return d->pending.first()->sourceDevice(); } /*! @@ -2011,11 +2074,11 @@ QIODevice *QHttp::currentSourceDevice() const \sa currentSourceDevice() get() post() request() */ -QIODevice *QHttp::currentDestinationDevice() const +QIODevice * QHttp::currentDestinationDevice() const { - if (d->pending.isEmpty()) - return 0; - return d->pending.first()->destinationDevice(); + if(d->pending.isEmpty()) + return 0; + return d->pending.first()->destinationDevice(); } /*! @@ -2029,7 +2092,7 @@ QIODevice *QHttp::currentDestinationDevice() const */ bool QHttp::hasPendingRequests() const { - return d->pending.count() > 1; + return d->pending.count() > 1; } /*! @@ -2041,9 +2104,9 @@ bool QHttp::hasPendingRequests() const */ void QHttp::clearPendingRequests() { - // delete all entires except the first one - while (d->pending.count() > 1) - delete d->pending.takeLast(); + // delete all entires except the first one + while(d->pending.count() > 1) + delete d->pending.takeLast(); } /*! @@ -2061,9 +2124,9 @@ void QHttp::clearPendingRequests() \sa get() post() head() request() requestStarted() requestFinished() done() */ -int QHttp::setHost(const QString &hostName, quint16 port) +int QHttp::setHost(const QString & hostName, quint16 port) { - return d->addRequest(new QHttpSetHostRequest(hostName, port, ConnectionModeHttp)); + return d->addRequest(new QHttpSetHostRequest(hostName, port, ConnectionModeHttp)); } /*! @@ -2084,15 +2147,15 @@ int QHttp::setHost(const QString &hostName, quint16 port) \sa get() post() head() request() requestStarted() requestFinished() done() */ -int QHttp::setHost(const QString &hostName, ConnectionMode mode, quint16 port) +int QHttp::setHost(const QString & hostName, ConnectionMode mode, quint16 port) { #ifdef QT_NO_OPENSSL - if (mode == ConnectionModeHttps) - qWarning("QHttp::setHost: HTTPS connection requested but SSL support not compiled in"); + if(mode == ConnectionModeHttps) + qWarning("QHttp::setHost: HTTPS connection requested but SSL support not compiled in"); #endif - if (port == 0) - port = (mode == ConnectionModeHttp) ? 80 : 443; - return d->addRequest(new QHttpSetHostRequest(hostName, port, mode)); + if(port == 0) + port = (mode == ConnectionModeHttp) ? 80 : 443; + return d->addRequest(new QHttpSetHostRequest(hostName, port, mode)); } /*! @@ -2116,9 +2179,9 @@ int QHttp::setHost(const QString &hostName, ConnectionMode mode, quint16 port) \sa QObject::moveToThread(), {Thread Support in Qt} */ -int QHttp::setSocket(QTcpSocket *socket) +int QHttp::setSocket(QTcpSocket * socket) { - return d->addRequest(new QHttpSetSocketRequest(socket)); + return d->addRequest(new QHttpSetSocketRequest(socket)); } /*! @@ -2134,9 +2197,9 @@ int QHttp::setSocket(QTcpSocket *socket) emitted. When it is finished the requestFinished() signal is emitted. */ -int QHttp::setUser(const QString &userName, const QString &password) +int QHttp::setUser(const QString & userName, const QString & password) { - return d->addRequest(new QHttpSetUserRequest(userName, password)); + return d->addRequest(new QHttpSetUserRequest(userName, password)); } #ifndef QT_NO_NETWORKPROXY @@ -2160,11 +2223,11 @@ int QHttp::setUser(const QString &userName, const QString &password) \sa QFtp::setProxy() */ -int QHttp::setProxy(const QString &host, int port, - const QString &username, const QString &password) +int QHttp::setProxy(const QString & host, int port, + const QString & username, const QString & password) { - QNetworkProxy proxy(QNetworkProxy::HttpProxy, host, port, username, password); - return d->addRequest(new QHttpSetProxyRequest(proxy)); + QNetworkProxy proxy(QNetworkProxy::HttpProxy, host, port, username, password); + return d->addRequest(new QHttpSetProxyRequest(proxy)); } /*! @@ -2181,9 +2244,9 @@ int QHttp::setProxy(const QString &host, int port, is, ConnectionModeHttp), QHttp will treat the proxy as a caching proxy. */ -int QHttp::setProxy(const QNetworkProxy &proxy) +int QHttp::setProxy(const QNetworkProxy & proxy) { - return d->addRequest(new QHttpSetProxyRequest(proxy)); + return d->addRequest(new QHttpSetProxyRequest(proxy)); } #endif @@ -2219,11 +2282,11 @@ int QHttp::setProxy(const QNetworkProxy &proxy) \sa setHost(), post(), head(), request(), requestStarted(), requestFinished(), done() */ -int QHttp::get(const QString &path, QIODevice *to) +int QHttp::get(const QString & path, QIODevice * to) { - QHttpRequestHeader header(QLatin1String("GET"), path); - header.setValue(QLatin1String("Connection"), QLatin1String("Keep-Alive")); - return d->addRequest(new QHttpPGHRequest(header, (QIODevice *) 0, to)); + QHttpRequestHeader header(QLatin1String("GET"), path); + header.setValue(QLatin1String("Connection"), QLatin1String("Keep-Alive")); + return d->addRequest(new QHttpPGHRequest(header, (QIODevice *)0, to)); } /*! @@ -2256,11 +2319,11 @@ int QHttp::get(const QString &path, QIODevice *to) \sa setHost() get() head() request() requestStarted() requestFinished() done() */ -int QHttp::post(const QString &path, QIODevice *data, QIODevice *to ) +int QHttp::post(const QString & path, QIODevice * data, QIODevice * to) { - QHttpRequestHeader header(QLatin1String("POST"), path); - header.setValue(QLatin1String("Connection"), QLatin1String("Keep-Alive")); - return d->addRequest(new QHttpPGHRequest(header, data, to)); + QHttpRequestHeader header(QLatin1String("POST"), path); + header.setValue(QLatin1String("Connection"), QLatin1String("Keep-Alive")); + return d->addRequest(new QHttpPGHRequest(header, data, to)); } /*! @@ -2268,11 +2331,11 @@ int QHttp::post(const QString &path, QIODevice *data, QIODevice *to ) \a data is used as the content data of the HTTP request. */ -int QHttp::post(const QString &path, const QByteArray &data, QIODevice *to) +int QHttp::post(const QString & path, const QByteArray & data, QIODevice * to) { - QHttpRequestHeader header(QLatin1String("POST"), path); - header.setValue(QLatin1String("Connection"), QLatin1String("Keep-Alive")); - return d->addRequest(new QHttpPGHRequest(header, new QByteArray(data), to)); + QHttpRequestHeader header(QLatin1String("POST"), path); + header.setValue(QLatin1String("Connection"), QLatin1String("Keep-Alive")); + return d->addRequest(new QHttpPGHRequest(header, new QByteArray(data), to)); } /*! @@ -2293,11 +2356,11 @@ int QHttp::post(const QString &path, const QByteArray &data, QIODevice *to) \sa setHost() get() post() request() requestStarted() requestFinished() done() */ -int QHttp::head(const QString &path) +int QHttp::head(const QString & path) { - QHttpRequestHeader header(QLatin1String("HEAD"), path); - header.setValue(QLatin1String("Connection"), QLatin1String("Keep-Alive")); - return d->addRequest(new QHttpPGHRequest(header, (QIODevice*)0, 0)); + QHttpRequestHeader header(QLatin1String("HEAD"), path); + header.setValue(QLatin1String("Connection"), QLatin1String("Keep-Alive")); + return d->addRequest(new QHttpPGHRequest(header, (QIODevice *)0, 0)); } /*! @@ -2327,9 +2390,9 @@ int QHttp::head(const QString &path) \sa setHost() get() post() head() requestStarted() requestFinished() done() */ -int QHttp::request(const QHttpRequestHeader &header, QIODevice *data, QIODevice *to) +int QHttp::request(const QHttpRequestHeader & header, QIODevice * data, QIODevice * to) { - return d->addRequest(new QHttpNormalRequest(header, data, to)); + return d->addRequest(new QHttpNormalRequest(header, data, to)); } /*! @@ -2337,9 +2400,9 @@ int QHttp::request(const QHttpRequestHeader &header, QIODevice *data, QIODevice \a data is used as the content data of the HTTP request. */ -int QHttp::request(const QHttpRequestHeader &header, const QByteArray &data, QIODevice *to ) +int QHttp::request(const QHttpRequestHeader & header, const QByteArray & data, QIODevice * to) { - return d->addRequest(new QHttpNormalRequest(header, new QByteArray(data), to)); + return d->addRequest(new QHttpNormalRequest(header, new QByteArray(data), to)); } /*! @@ -2368,7 +2431,7 @@ int QHttp::request(const QHttpRequestHeader &header, const QByteArray &data, QIO */ int QHttp::close() { - return d->addRequest(new QHttpCloseRequest()); + return d->addRequest(new QHttpCloseRequest()); } /*! @@ -2378,679 +2441,777 @@ int QHttp::close() */ int QHttp::closeConnection() { - return d->addRequest(new QHttpCloseRequest()); + return d->addRequest(new QHttpCloseRequest()); } -int QHttpPrivate::addRequest(QHttpNormalRequest *req) +int QHttpPrivate::addRequest(QHttpNormalRequest * req) { - QHttpRequestHeader h = req->requestHeader(); - if (h.path().isEmpty()) { - // note: the following qWarning is autotested. If you change it, change the test too. - qWarning("QHttp: empty path requested is invalid -- using '/'"); - h.setRequest(h.method(), QLatin1String("/"), h.majorVersion(), h.minorVersion()); - req->setRequestHeader(h); - } + QHttpRequestHeader h = req->requestHeader(); + if(h.path().isEmpty()) + { + // note: the following qWarning is autotested. If you change it, change the test too. + qWarning("QHttp: empty path requested is invalid -- using '/'"); + h.setRequest(h.method(), QLatin1String("/"), h.majorVersion(), h.minorVersion()); + req->setRequestHeader(h); + } - // contine below - return addRequest(static_cast(req)); + // contine below + return addRequest(static_cast(req)); } -int QHttpPrivate::addRequest(QHttpRequest *req) +int QHttpPrivate::addRequest(QHttpRequest * req) { - Q_Q(QHttp); - pending.append(req); + Q_Q(QHttp); + pending.append(req); - if (pending.count() == 1) { - // don't emit the requestStarted() signal before the id is returned - QMetaObject::invokeMethod(q, "_q_startNextRequest", Qt::QueuedConnection); - } - return req->id; + if(pending.count() == 1) + { + // don't emit the requestStarted() signal before the id is returned + QMetaObject::invokeMethod(q, "_q_startNextRequest", Qt::QueuedConnection); + } + return req->id; } void QHttpPrivate::_q_startNextRequest() { - Q_Q(QHttp); - if (pending.isEmpty()) - return; - QHttpRequest *r = pending.first(); + Q_Q(QHttp); + if(pending.isEmpty()) + return; + QHttpRequest * r = pending.first(); - error = QHttp::NoError; - errorString = QLatin1String(QT_TRANSLATE_NOOP("QHttp", "Unknown error")); + error = QHttp::NoError; + errorString = QLatin1String(QT_TRANSLATE_NOOP("QHttp", "Unknown error")); - if (q->bytesAvailable() != 0) - q->readAll(); // clear the data - emit q->requestStarted(r->id); - r->start(q); + if(q->bytesAvailable() != 0) + q->readAll(); // clear the data + emit q->requestStarted(r->id); + r->start(q); } void QHttpPrivate::_q_slotSendRequest() { - if (hostName.isNull()) { - finishedWithError(QLatin1String(QT_TRANSLATE_NOOP("QHttp", "No server set to connect to")), - QHttp::UnknownError); - return; - } + if(hostName.isNull()) + { + finishedWithError(QLatin1String(QT_TRANSLATE_NOOP("QHttp", "No server set to connect to")), + QHttp::UnknownError); + return; + } - QString connectionHost = hostName; - int connectionPort = port; - bool sslInUse = false; + QString connectionHost = hostName; + int connectionPort = port; + bool sslInUse = false; #ifndef QT_NO_OPENSSL - QSslSocket *sslSocket = qobject_cast(socket); - if (mode == QHttp::ConnectionModeHttps || (sslSocket && sslSocket->isEncrypted())) - sslInUse = true; + QSslSocket * sslSocket = qobject_cast(socket); + if(mode == QHttp::ConnectionModeHttps || (sslSocket && sslSocket->isEncrypted())) + sslInUse = true; #endif #ifndef QT_NO_NETWORKPROXY - bool cachingProxyInUse = false; - bool transparentProxyInUse = false; - if (proxy.type() == QNetworkProxy::DefaultProxy) - proxy = QNetworkProxy::applicationProxy(); - - if (proxy.type() == QNetworkProxy::HttpCachingProxy) { - if (proxy.hostName().isEmpty()) - proxy.setType(QNetworkProxy::NoProxy); - else - cachingProxyInUse = true; - } else if (proxy.type() == QNetworkProxy::HttpProxy) { - // Compatibility behaviour: HttpProxy can be used to mean both - // transparent and caching proxy - if (proxy.hostName().isEmpty()) { - proxy.setType(QNetworkProxy::NoProxy); - } else if (sslInUse) { - // Disallow use of caching proxy with HTTPS; instead fall back to - // transparent HTTP CONNECT proxying. - transparentProxyInUse = true; - } else { - proxy.setType(QNetworkProxy::HttpCachingProxy); - cachingProxyInUse = true; - } - } - - // Proxy support. Insert the Proxy-Authorization item into the - // header before it's sent off to the proxy. - if (cachingProxyInUse) { - QUrl proxyUrl; - proxyUrl.setScheme(QLatin1String("http")); - proxyUrl.setHost(hostName); - if (port && port != 80) - proxyUrl.setPort(port); - QString request = QString::fromLatin1(proxyUrl.resolved(QUrl::fromEncoded(header.path().toLatin1())).toEncoded()); - - header.setRequest(header.method(), request, header.majorVersion(), header.minorVersion()); - header.setValue(QLatin1String("Proxy-Connection"), QLatin1String("keep-alive")); - - QHttpAuthenticatorPrivate *auth = QHttpAuthenticatorPrivate::getPrivate(proxyAuthenticator); - if (auth && auth->method != QHttpAuthenticatorPrivate::None) { - QByteArray response = auth->calculateResponse(header.method().toLatin1(), header.path().toLatin1()); - header.setValue(QLatin1String("Proxy-Authorization"), QString::fromLatin1(response)); - } - - connectionHost = proxy.hostName(); - connectionPort = proxy.port(); - } - - if (transparentProxyInUse || sslInUse) { - socket->setProxy(proxy); - } + bool cachingProxyInUse = false; + bool transparentProxyInUse = false; + if(proxy.type() == QNetworkProxy::DefaultProxy) + proxy = QNetworkProxy::applicationProxy(); + + if(proxy.type() == QNetworkProxy::HttpCachingProxy) + { + if(proxy.hostName().isEmpty()) + proxy.setType(QNetworkProxy::NoProxy); + else + cachingProxyInUse = true; + } + else if(proxy.type() == QNetworkProxy::HttpProxy) + { + // Compatibility behaviour: HttpProxy can be used to mean both + // transparent and caching proxy + if(proxy.hostName().isEmpty()) + { + proxy.setType(QNetworkProxy::NoProxy); + } + else if(sslInUse) + { + // Disallow use of caching proxy with HTTPS; instead fall back to + // transparent HTTP CONNECT proxying. + transparentProxyInUse = true; + } + else + { + proxy.setType(QNetworkProxy::HttpCachingProxy); + cachingProxyInUse = true; + } + } + + // Proxy support. Insert the Proxy-Authorization item into the + // header before it's sent off to the proxy. + if(cachingProxyInUse) + { + QUrl proxyUrl; + proxyUrl.setScheme(QLatin1String("http")); + proxyUrl.setHost(hostName); + if(port && port != 80) + proxyUrl.setPort(port); + QString request = QString::fromLatin1(proxyUrl.resolved(QUrl::fromEncoded(header.path().toLatin1())).toEncoded()); + + header.setRequest(header.method(), request, header.majorVersion(), header.minorVersion()); + header.setValue(QLatin1String("Proxy-Connection"), QLatin1String("keep-alive")); + + QHttpAuthenticatorPrivate * auth = QHttpAuthenticatorPrivate::getPrivate(proxyAuthenticator); + if(auth && auth->method != QHttpAuthenticatorPrivate::None) + { + QByteArray response = auth->calculateResponse(header.method().toLatin1(), header.path().toLatin1()); + header.setValue(QLatin1String("Proxy-Authorization"), QString::fromLatin1(response)); + } + + connectionHost = proxy.hostName(); + connectionPort = proxy.port(); + } + + if(transparentProxyInUse || sslInUse) + { + socket->setProxy(proxy); + } #endif - // Username support. Insert the user and password into the query - // string. - QHttpAuthenticatorPrivate *auth = QHttpAuthenticatorPrivate::getPrivate(authenticator); - if (auth && auth->method != QHttpAuthenticatorPrivate::None) { - QByteArray response = auth->calculateResponse(header.method().toLatin1(), header.path().toLatin1()); - header.setValue(QLatin1String("Authorization"), QString::fromLatin1(response)); - } - - // Do we need to setup a new connection or can we reuse an - // existing one? - if (socket->peerName() != connectionHost || socket->peerPort() != connectionPort - || socket->state() != QTcpSocket::ConnectedState + // Username support. Insert the user and password into the query + // string. + QHttpAuthenticatorPrivate * auth = QHttpAuthenticatorPrivate::getPrivate(authenticator); + if(auth && auth->method != QHttpAuthenticatorPrivate::None) + { + QByteArray response = auth->calculateResponse(header.method().toLatin1(), header.path().toLatin1()); + header.setValue(QLatin1String("Authorization"), QString::fromLatin1(response)); + } + + // Do we need to setup a new connection or can we reuse an + // existing one? + if(socket->peerName() != connectionHost || socket->peerPort() != connectionPort + || socket->state() != QTcpSocket::ConnectedState #ifndef QT_NO_OPENSSL - || (sslSocket && sslSocket->isEncrypted() != (mode == QHttp::ConnectionModeHttps)) + || (sslSocket && sslSocket->isEncrypted() != (mode == QHttp::ConnectionModeHttps)) #endif - ) { - socket->blockSignals(true); - socket->abort(); - socket->blockSignals(false); + ) + { + socket->blockSignals(true); + socket->abort(); + socket->blockSignals(false); - setState(QHttp::Connecting); + setState(QHttp::Connecting); #ifndef QT_NO_OPENSSL - if (sslSocket && mode == QHttp::ConnectionModeHttps) { - sslSocket->connectToHostEncrypted(hostName, port); - } else + if(sslSocket && mode == QHttp::ConnectionModeHttps) + { + sslSocket->connectToHostEncrypted(hostName, port); + } + else #endif - { - socket->connectToHost(connectionHost, connectionPort); - } - } else { - _q_slotConnected(); - } - + { + socket->connectToHost(connectionHost, connectionPort); + } + } + else + { + _q_slotConnected(); + } } void QHttpPrivate::finishedWithSuccess() { - Q_Q(QHttp); - if (pending.isEmpty()) - return; - QHttpRequest *r = pending.first(); - - // did we recurse? - if (r->finished) - return; - r->finished = true; - hasFinishedWithError = false; - - emit q->requestFinished(r->id, false); - if (hasFinishedWithError) { - // we recursed and changed into an error. The finishedWithError function - // below has emitted the done(bool) signal and cleared the queue by now. - return; - } - - pending.removeFirst(); - delete r; - - if (pending.isEmpty()) { - emit q->done(false); - } else { - _q_startNextRequest(); - } -} - -void QHttpPrivate::finishedWithError(const QString &detail, int errorCode) -{ - Q_Q(QHttp); - if (pending.isEmpty()) - return; - QHttpRequest *r = pending.first(); - hasFinishedWithError = true; - - error = QHttp::Error(errorCode); - errorString = detail; - - // did we recurse? - if (!r->finished) { - r->finished = true; - emit q->requestFinished(r->id, true); - } - - while (!pending.isEmpty()) - delete pending.takeFirst(); - emit q->done(hasFinishedWithError); + Q_Q(QHttp); + if(pending.isEmpty()) + return; + QHttpRequest * r = pending.first(); + + // did we recurse? + if(r->finished) + return; + r->finished = true; + hasFinishedWithError = false; + + emit q->requestFinished(r->id, false); + if(hasFinishedWithError) + { + // we recursed and changed into an error. The finishedWithError function + // below has emitted the done(bool) signal and cleared the queue by now. + return; + } + + pending.removeFirst(); + delete r; + + if(pending.isEmpty()) + { + emit q->done(false); + } + else + { + _q_startNextRequest(); + } +} + +void QHttpPrivate::finishedWithError(const QString & detail, int errorCode) +{ + Q_Q(QHttp); + if(pending.isEmpty()) + return; + QHttpRequest * r = pending.first(); + hasFinishedWithError = true; + + error = QHttp::Error(errorCode); + errorString = detail; + + // did we recurse? + if(!r->finished) + { + r->finished = true; + emit q->requestFinished(r->id, true); + } + + while(!pending.isEmpty()) + delete pending.takeFirst(); + emit q->done(hasFinishedWithError); } void QHttpPrivate::_q_slotClosed() { - Q_Q(QHttp); - - if (state == QHttp::Reading) { - if (response.hasKey(QLatin1String("content-length"))) { - // We got Content-Length, so did we get all bytes? - if (bytesDone + q->bytesAvailable() != response.contentLength()) { - finishedWithError(QLatin1String(QT_TRANSLATE_NOOP("QHttp", "Wrong content length")), QHttp::WrongContentLength); - } - } - } else if (state == QHttp::Connecting || state == QHttp::Sending) { - finishedWithError(QLatin1String(QT_TRANSLATE_NOOP("QHttp", "Server closed connection unexpectedly")), QHttp::UnexpectedClose); - } - - postDevice = 0; - if (state != QHttp::Closing) - setState(QHttp::Closing); - QMetaObject::invokeMethod(q, "_q_slotDoFinished", Qt::QueuedConnection); + Q_Q(QHttp); + + if(state == QHttp::Reading) + { + if(response.hasKey(QLatin1String("content-length"))) + { + // We got Content-Length, so did we get all bytes? + if(bytesDone + q->bytesAvailable() != response.contentLength()) + { + finishedWithError(QLatin1String(QT_TRANSLATE_NOOP("QHttp", "Wrong content length")), QHttp::WrongContentLength); + } + } + } + else if(state == QHttp::Connecting || state == QHttp::Sending) + { + finishedWithError(QLatin1String(QT_TRANSLATE_NOOP("QHttp", "Server closed connection unexpectedly")), QHttp::UnexpectedClose); + } + + postDevice = 0; + if(state != QHttp::Closing) + setState(QHttp::Closing); + QMetaObject::invokeMethod(q, "_q_slotDoFinished", Qt::QueuedConnection); } void QHttpPrivate::_q_continuePost() { - if (pendingPost) { - pendingPost = false; - setState(QHttp::Sending); - _q_slotBytesWritten(0); - } + if(pendingPost) + { + pendingPost = false; + setState(QHttp::Sending); + _q_slotBytesWritten(0); + } } void QHttpPrivate::_q_slotConnected() { - if (state != QHttp::Sending) { - bytesDone = 0; - setState(QHttp::Sending); - } + if(state != QHttp::Sending) + { + bytesDone = 0; + setState(QHttp::Sending); + } - QString str = header.toString(); - bytesTotal = str.length(); - socket->write(str.toLatin1(), bytesTotal); + QString str = header.toString(); + bytesTotal = str.length(); + socket->write(str.toLatin1(), bytesTotal); #if defined(QHTTP_DEBUG) - qDebug("QHttp: write request header %p:\n---{\n%s}---", &header, str.toLatin1().constData()); + qDebug("QHttp: write request header %p:\n---{\n%s}---", &header, str.toLatin1().constData()); #endif - if (postDevice) { - postDevice->seek(0); // reposition the device - bytesTotal += postDevice->size(); - //check for 100-continue - if (header.value(QLatin1String("expect")).contains(QLatin1String("100-continue"), Qt::CaseInsensitive)) { - //create a time out for 2 secs. - pendingPost = true; - post100ContinueTimer.start(2000); - } - } else { - bytesTotal += buffer.size(); - socket->write(buffer, buffer.size()); - } + if(postDevice) + { + postDevice->seek(0); // reposition the device + bytesTotal += postDevice->size(); + //check for 100-continue + if(header.value(QLatin1String("expect")).contains(QLatin1String("100-continue"), Qt::CaseInsensitive)) + { + //create a time out for 2 secs. + pendingPost = true; + post100ContinueTimer.start(2000); + } + } + else + { + bytesTotal += buffer.size(); + socket->write(buffer, buffer.size()); + } } void QHttpPrivate::_q_slotError(QAbstractSocket::SocketError err) { - Q_Q(QHttp); - postDevice = 0; - - if (state == QHttp::Connecting || state == QHttp::Reading || state == QHttp::Sending) { - switch (err) { - case QTcpSocket::ConnectionRefusedError: - finishedWithError(QLatin1String(QT_TRANSLATE_NOOP("QHttp", "Connection refused (or timed out)")), QHttp::ConnectionRefused); - break; - case QTcpSocket::HostNotFoundError: - finishedWithError(QString::fromLatin1(QT_TRANSLATE_NOOP("QHttp", "Host %1 not found")) - .arg(socket->peerName()), QHttp::HostNotFound); - break; - case QTcpSocket::RemoteHostClosedError: - if (state == QHttp::Sending && reconnectAttempts--) { - setState(QHttp::Closing); - setState(QHttp::Unconnected); - socket->blockSignals(true); - socket->abort(); - socket->blockSignals(false); - QMetaObject::invokeMethod(q, "_q_slotSendRequest", Qt::QueuedConnection); - return; - } - break; + Q_Q(QHttp); + postDevice = 0; + + if(state == QHttp::Connecting || state == QHttp::Reading || state == QHttp::Sending) + { + switch(err) + { + case QTcpSocket::ConnectionRefusedError: + finishedWithError(QLatin1String(QT_TRANSLATE_NOOP("QHttp", "Connection refused (or timed out)")), QHttp::ConnectionRefused); + break; + case QTcpSocket::HostNotFoundError: + finishedWithError(QString::fromLatin1(QT_TRANSLATE_NOOP("QHttp", "Host %1 not found")) + .arg(socket->peerName()), + QHttp::HostNotFound); + break; + case QTcpSocket::RemoteHostClosedError: + if(state == QHttp::Sending && reconnectAttempts--) + { + setState(QHttp::Closing); + setState(QHttp::Unconnected); + socket->blockSignals(true); + socket->abort(); + socket->blockSignals(false); + QMetaObject::invokeMethod(q, "_q_slotSendRequest", Qt::QueuedConnection); + return; + } + break; #ifndef QT_NO_NETWORKPROXY - case QTcpSocket::ProxyAuthenticationRequiredError: - finishedWithError(socket->errorString(), QHttp::ProxyAuthenticationRequiredError); - break; + case QTcpSocket::ProxyAuthenticationRequiredError: + finishedWithError(socket->errorString(), QHttp::ProxyAuthenticationRequiredError); + break; #endif - default: - finishedWithError(QLatin1String(QT_TRANSLATE_NOOP("QHttp", "HTTP request failed")), QHttp::UnknownError); - break; - } - } + default: + finishedWithError(QLatin1String(QT_TRANSLATE_NOOP("QHttp", "HTTP request failed")), QHttp::UnknownError); + break; + } + } - closeConn(); + closeConn(); } #ifndef QT_NO_OPENSSL void QHttpPrivate::_q_slotEncryptedBytesWritten(qint64 written) { - Q_UNUSED(written); - postMoreData(); + Q_UNUSED(written); + postMoreData(); } #endif void QHttpPrivate::_q_slotBytesWritten(qint64 written) { - Q_Q(QHttp); - bytesDone += written; - emit q->dataSendProgress(bytesDone, bytesTotal); - postMoreData(); + Q_Q(QHttp); + bytesDone += written; + emit q->dataSendProgress(bytesDone, bytesTotal); + postMoreData(); } // Send the POST data void QHttpPrivate::postMoreData() { - if (pendingPost) - return; + if(pendingPost) + return; - if (!postDevice) - return; + if(!postDevice) + return; - // the following is backported code from Qt 4.6 QNetworkAccessManager. - // We also have to check the encryptedBytesToWrite() if it is an SSL socket. +// the following is backported code from Qt 4.6 QNetworkAccessManager. +// We also have to check the encryptedBytesToWrite() if it is an SSL socket. #ifndef QT_NO_OPENSSL - QSslSocket *sslSocket = qobject_cast(socket); - // if it is really an ssl socket, check more than just bytesToWrite() - if ((socket->bytesToWrite() + (sslSocket ? sslSocket->encryptedBytesToWrite() : 0)) == 0) { + QSslSocket * sslSocket = qobject_cast(socket); + // if it is really an ssl socket, check more than just bytesToWrite() + if((socket->bytesToWrite() + (sslSocket ? sslSocket->encryptedBytesToWrite() : 0)) == 0) + { #else - if (socket->bytesToWrite() == 0) { + if(socket->bytesToWrite() == 0) + { #endif - int max = qMin(4096, postDevice->size() - postDevice->pos()); - QByteArray arr; - arr.resize(max); - - int n = postDevice->read(arr.data(), max); - if (n < 0) { - qWarning("Could not read enough bytes from the device"); - closeConn(); - return; - } - if (postDevice->atEnd()) { - postDevice = 0; - } - - socket->write(arr, n); - } + int max = qMin(4096, postDevice->size() - postDevice->pos()); + QByteArray arr; + arr.resize(max); + + int n = postDevice->read(arr.data(), max); + if(n < 0) + { + qWarning("Could not read enough bytes from the device"); + closeConn(); + return; + } + if(postDevice->atEnd()) + { + postDevice = 0; + } + + socket->write(arr, n); + } } void QHttpPrivate::_q_slotReadyRead() { - Q_Q(QHttp); - QHttp::State oldState = state; - if (state != QHttp::Reading) { - setState(QHttp::Reading); - readHeader = true; - headerStr = QLatin1String(""); - bytesDone = 0; - chunkedSize = -1; - repost = false; - } - - while (readHeader) { - bool end = false; - QString tmp; - while (!end && socket->canReadLine()) { - tmp = QString::fromLatin1(socket->readLine()); - if (tmp == QLatin1String("\r\n") || tmp == QLatin1String("\n") || tmp.isEmpty()) - end = true; - else - headerStr += tmp; - } - - if (!end) - return; - - response = QHttpResponseHeader(headerStr); - headerStr = QLatin1String(""); + Q_Q(QHttp); + QHttp::State oldState = state; + if(state != QHttp::Reading) + { + setState(QHttp::Reading); + readHeader = true; + headerStr = QLatin1String(""); + bytesDone = 0; + chunkedSize = -1; + repost = false; + } + + while(readHeader) + { + bool end = false; + QString tmp; + while(!end && socket->canReadLine()) + { + tmp = QString::fromLatin1(socket->readLine()); + if(tmp == QLatin1String("\r\n") || tmp == QLatin1String("\n") || tmp.isEmpty()) + end = true; + else + headerStr += tmp; + } + + if(!end) + return; + + response = QHttpResponseHeader(headerStr); + headerStr = QLatin1String(""); #if defined(QHTTP_DEBUG) - qDebug("QHttp: read response header:\n---{\n%s}---", response.toString().toLatin1().constData()); + qDebug("QHttp: read response header:\n---{\n%s}---", response.toString().toLatin1().constData()); #endif - // Check header - if (!response.isValid()) { - finishedWithError(QLatin1String(QT_TRANSLATE_NOOP("QHttp", "Invalid HTTP response header")), - QHttp::InvalidResponseHeader); - closeConn(); - return; - } - - int statusCode = response.statusCode(); - if (statusCode == 401 || statusCode == 407) { // (Proxy) Authentication required - QHttpAuthenticator *auth = + // Check header + if(!response.isValid()) + { + finishedWithError(QLatin1String(QT_TRANSLATE_NOOP("QHttp", "Invalid HTTP response header")), + QHttp::InvalidResponseHeader); + closeConn(); + return; + } + + int statusCode = response.statusCode(); + if(statusCode == 401 || statusCode == 407) + { // (Proxy) Authentication required + QHttpAuthenticator * auth = #ifndef QT_NO_NETWORKPROXY - statusCode == 407 - ? &proxyAuthenticator : + statusCode == 407 + ? &proxyAuthenticator + : #endif - &authenticator; - if (auth->isNull()) - auth->detach(); - QHttpAuthenticatorPrivate *priv = QHttpAuthenticatorPrivate::getPrivate(*auth); - priv->parseHttpResponse(response, (statusCode == 407)); - if (priv->phase == QHttpAuthenticatorPrivate::Done) { - socket->blockSignals(true); + &authenticator; + if(auth->isNull()) + auth->detach(); + QHttpAuthenticatorPrivate * priv = QHttpAuthenticatorPrivate::getPrivate(*auth); + priv->parseHttpResponse(response, (statusCode == 407)); + if(priv->phase == QHttpAuthenticatorPrivate::Done) + { + socket->blockSignals(true); #ifndef QT_NO_NETWORKPROXY - if (statusCode == 407) { - //need to emit a QAuthenticator to maintain source compatibility - QAuthenticator qauthClean = auth->toQAuthenticator(); - QAuthenticator qauthToEmit = qauthClean; - emit q->proxyAuthenticationRequired(proxy, &qauthToEmit); - if (qauthClean != qauthToEmit) { - //user changed something, copy back (which will reset our state) - *auth = qauthToEmit; - } - } else + if(statusCode == 407) + { + //need to emit a QAuthenticator to maintain source compatibility + QAuthenticator qauthClean = auth->toQAuthenticator(); + QAuthenticator qauthToEmit = qauthClean; + emit q->proxyAuthenticationRequired(proxy, &qauthToEmit); + if(qauthClean != qauthToEmit) + { + //user changed something, copy back (which will reset our state) + *auth = qauthToEmit; + } + } + else #endif - { - //need to emit a QAuthenticator to maintain source compatibility - QAuthenticator qauthClean = auth->toQAuthenticator(); - QAuthenticator qauthToEmit = qauthClean; - emit q->authenticationRequired(hostName, port, &qauthToEmit); - if (qauthClean != qauthToEmit) { - //user changed something, copy back (which will reset our state) - *auth = qauthToEmit; - } - } - socket->blockSignals(false); - } else if (priv->phase == QHttpAuthenticatorPrivate::Invalid) { - finishedWithError(QLatin1String(QT_TRANSLATE_NOOP("QHttp", "Unknown authentication method")), - QHttp::AuthenticationRequiredError); - closeConn(); - return; - } - - // priv->phase will get reset to QHttpAuthenticatorPrivate::Start if the authenticator got modified in the signal above. - if (priv->phase == QHttpAuthenticatorPrivate::Done) { + { + //need to emit a QAuthenticator to maintain source compatibility + QAuthenticator qauthClean = auth->toQAuthenticator(); + QAuthenticator qauthToEmit = qauthClean; + emit q->authenticationRequired(hostName, port, &qauthToEmit); + if(qauthClean != qauthToEmit) + { + //user changed something, copy back (which will reset our state) + *auth = qauthToEmit; + } + } + socket->blockSignals(false); + } + else if(priv->phase == QHttpAuthenticatorPrivate::Invalid) + { + finishedWithError(QLatin1String(QT_TRANSLATE_NOOP("QHttp", "Unknown authentication method")), + QHttp::AuthenticationRequiredError); + closeConn(); + return; + } + + // priv->phase will get reset to QHttpAuthenticatorPrivate::Start if the authenticator got modified in the signal above. + if(priv->phase == QHttpAuthenticatorPrivate::Done) + { #ifndef QT_NO_NETWORKPROXY - if (statusCode == 407) - finishedWithError(QLatin1String(QT_TRANSLATE_NOOP("QHttp", "Proxy authentication required")), - QHttp::ProxyAuthenticationRequiredError); - else + if(statusCode == 407) + finishedWithError(QLatin1String(QT_TRANSLATE_NOOP("QHttp", "Proxy authentication required")), + QHttp::ProxyAuthenticationRequiredError); + else #endif - finishedWithError(QLatin1String(QT_TRANSLATE_NOOP("QHttp", "Authentication required")), - QHttp::AuthenticationRequiredError); - closeConn(); - return; - } else { - // close the connection if it isn't already and reconnect using the chosen authentication method - bool willClose = (response.value(QLatin1String("proxy-connection")).toLower() == QLatin1String("close")) - || (response.value(QLatin1String("connection")).toLower() == QLatin1String("close")); - if (willClose) { - if (socket) { - setState(QHttp::Closing); - socket->blockSignals(true); - socket->close(); - socket->blockSignals(false); - socket->readAll(); - } - _q_slotSendRequest(); - return; - } else { - repost = true; - } - } - } else { - buffer.clear(); - } - - if (response.statusCode() == 100 && pendingPost) { - // if we have pending POST, start sending data otherwise ignore - post100ContinueTimer.stop(); - QMetaObject::invokeMethod(q, "_q_continuePost", Qt::QueuedConnection); - return; - } - - // The 100-continue header is ignored (in case of no 'expect:100-continue' header), - // because when using the POST method, we send both the request header and data in - // one chunk. - if (response.statusCode() != 100) { - post100ContinueTimer.stop(); - pendingPost = false; - readHeader = false; - if (response.hasKey(QLatin1String("transfer-encoding")) && - response.value(QLatin1String("transfer-encoding")).toLower().contains(QLatin1String("chunked"))) - chunkedSize = 0; - - if (!repost) - emit q->responseHeaderReceived(response); - if (state == QHttp::Unconnected || state == QHttp::Closing) - return; - } else { - // Restore the state, the next incoming data will be treated as if - // we never say the 100 response. - state = oldState; - } - } - - bool everythingRead = false; - - if (q->currentRequest().method() == QLatin1String("HEAD") || - response.statusCode() == 304 || response.statusCode() == 204 || - response.statusCode() == 205) { - // HEAD requests have only headers as replies - // These status codes never have a body: - // 304 Not Modified - // 204 No Content - // 205 Reset Content - everythingRead = true; - } else { - qint64 n = socket->bytesAvailable(); - QByteArray *arr = 0; - if (chunkedSize != -1) { - // transfer-encoding is chunked - for (;;) { - // get chunk size - if (chunkedSize == 0) { - if (!socket->canReadLine()) - break; - QString sizeString = QString::fromLatin1(socket->readLine()); - int tPos = sizeString.indexOf(QLatin1Char(';')); - if (tPos != -1) - sizeString.truncate(tPos); - bool ok; - chunkedSize = sizeString.toInt(&ok, 16); - if (!ok) { - finishedWithError(QLatin1String(QT_TRANSLATE_NOOP("QHttp", "Invalid HTTP chunked body")), - QHttp::WrongContentLength); - closeConn(); - delete arr; - return; - } - if (chunkedSize == 0) // last-chunk - chunkedSize = -2; - } - - // read trailer - while (chunkedSize == -2 && socket->canReadLine()) { - QString read = QString::fromLatin1(socket->readLine()); - if (read == QLatin1String("\r\n") || read == QLatin1String("\n")) - chunkedSize = -1; - } - if (chunkedSize == -1) { - everythingRead = true; - break; - } - - // make sure that you can read the terminating CRLF, - // otherwise wait until next time... - n = socket->bytesAvailable(); - if (n == 0) - break; - if (n == chunkedSize || n == chunkedSize+1) { - n = chunkedSize - 1; - if (n == 0) - break; - } - - // read data - qint64 toRead = chunkedSize < 0 ? n : qMin(n, chunkedSize); - if (!arr) - arr = new QByteArray; - uint oldArrSize = arr->size(); - arr->resize(oldArrSize + toRead); - qint64 read = socket->read(arr->data()+oldArrSize, toRead); - arr->resize(oldArrSize + read); - - chunkedSize -= read; - - if (chunkedSize == 0 && n - read >= 2) { - // read terminating CRLF - char tmp[2]; - socket->read(tmp, 2); - if (tmp[0] != '\r' || tmp[1] != '\n') { - finishedWithError(QLatin1String(QT_TRANSLATE_NOOP("QHttp", "Invalid HTTP chunked body")), - QHttp::WrongContentLength); - closeConn(); - delete arr; - return; - } - } - } - } else if (response.hasContentLength()) { - if (repost && (n < response.contentLength())) { - // wait for the content to be available fully - // if repost is required, the content is ignored - return; - } - n = qMin(qint64(response.contentLength() - bytesDone), n); - if (n > 0) { - arr = new QByteArray; - arr->resize(n); - qint64 read = socket->read(arr->data(), n); - arr->resize(read); - } - if (bytesDone + q->bytesAvailable() + n == response.contentLength()) - everythingRead = true; - } else if (n > 0) { - // workaround for VC++ bug - QByteArray temp = socket->readAll(); - arr = new QByteArray(temp); - } - - if (arr && !repost) { - n = arr->size(); - if (toDevice) { - qint64 bytesWritten; - bytesWritten = toDevice->write(*arr, n); - delete arr; - arr = 0; - // if writing to the device does not succeed, quit with error - if (bytesWritten == -1 || bytesWritten < n) { - finishedWithError(QLatin1String(QT_TRANSLATE_NOOP("QHttp", "Error writing response to device")), QHttp::UnknownError); - } else { - bytesDone += bytesWritten; + finishedWithError(QLatin1String(QT_TRANSLATE_NOOP("QHttp", "Authentication required")), + QHttp::AuthenticationRequiredError); + closeConn(); + return; + } + else + { + // close the connection if it isn't already and reconnect using the chosen authentication method + bool willClose = (response.value(QLatin1String("proxy-connection")).toLower() == QLatin1String("close")) + || (response.value(QLatin1String("connection")).toLower() == QLatin1String("close")); + if(willClose) + { + if(socket) + { + setState(QHttp::Closing); + socket->blockSignals(true); + socket->close(); + socket->blockSignals(false); + socket->readAll(); + } + _q_slotSendRequest(); + return; + } + else + { + repost = true; + } + } + } + else + { + buffer.clear(); + } + + if(response.statusCode() == 100 && pendingPost) + { + // if we have pending POST, start sending data otherwise ignore + post100ContinueTimer.stop(); + QMetaObject::invokeMethod(q, "_q_continuePost", Qt::QueuedConnection); + return; + } + + // The 100-continue header is ignored (in case of no 'expect:100-continue' header), + // because when using the POST method, we send both the request header and data in + // one chunk. + if(response.statusCode() != 100) + { + post100ContinueTimer.stop(); + pendingPost = false; + readHeader = false; + if(response.hasKey(QLatin1String("transfer-encoding")) && response.value(QLatin1String("transfer-encoding")).toLower().contains(QLatin1String("chunked"))) + chunkedSize = 0; + + if(!repost) + emit q->responseHeaderReceived(response); + if(state == QHttp::Unconnected || state == QHttp::Closing) + return; + } + else + { + // Restore the state, the next incoming data will be treated as if + // we never say the 100 response. + state = oldState; + } + } + + bool everythingRead = false; + + if(q->currentRequest().method() == QLatin1String("HEAD") || response.statusCode() == 304 || response.statusCode() == 204 || response.statusCode() == 205) + { + // HEAD requests have only headers as replies + // These status codes never have a body: + // 304 Not Modified + // 204 No Content + // 205 Reset Content + everythingRead = true; + } + else + { + qint64 n = socket->bytesAvailable(); + QByteArray * arr = 0; + if(chunkedSize != -1) + { + // transfer-encoding is chunked + for(;;) + { + // get chunk size + if(chunkedSize == 0) + { + if(!socket->canReadLine()) + break; + QString sizeString = QString::fromLatin1(socket->readLine()); + int tPos = sizeString.indexOf(QLatin1Char(';')); + if(tPos != -1) + sizeString.truncate(tPos); + bool ok; + chunkedSize = sizeString.toInt(&ok, 16); + if(!ok) + { + finishedWithError(QLatin1String(QT_TRANSLATE_NOOP("QHttp", "Invalid HTTP chunked body")), + QHttp::WrongContentLength); + closeConn(); + delete arr; + return; + } + if(chunkedSize == 0) // last-chunk + chunkedSize = -2; + } + + // read trailer + while(chunkedSize == -2 && socket->canReadLine()) + { + QString read = QString::fromLatin1(socket->readLine()); + if(read == QLatin1String("\r\n") || read == QLatin1String("\n")) + chunkedSize = -1; + } + if(chunkedSize == -1) + { + everythingRead = true; + break; + } + + // make sure that you can read the terminating CRLF, + // otherwise wait until next time... + n = socket->bytesAvailable(); + if(n == 0) + break; + if(n == chunkedSize || n == chunkedSize + 1) + { + n = chunkedSize - 1; + if(n == 0) + break; + } + + // read data + qint64 toRead = chunkedSize < 0 ? n : qMin(n, chunkedSize); + if(!arr) + arr = new QByteArray; + uint oldArrSize = arr->size(); + arr->resize(oldArrSize + toRead); + qint64 read = socket->read(arr->data() + oldArrSize, toRead); + arr->resize(oldArrSize + read); + + chunkedSize -= read; + + if(chunkedSize == 0 && n - read >= 2) + { + // read terminating CRLF + char tmp[2]; + socket->read(tmp, 2); + if(tmp[0] != '\r' || tmp[1] != '\n') + { + finishedWithError(QLatin1String(QT_TRANSLATE_NOOP("QHttp", "Invalid HTTP chunked body")), + QHttp::WrongContentLength); + closeConn(); + delete arr; + return; + } + } + } + } + else if(response.hasContentLength()) + { + if(repost && (n < response.contentLength())) + { + // wait for the content to be available fully + // if repost is required, the content is ignored + return; + } + n = qMin(qint64(response.contentLength() - bytesDone), n); + if(n > 0) + { + arr = new QByteArray; + arr->resize(n); + qint64 read = socket->read(arr->data(), n); + arr->resize(read); + } + if(bytesDone + q->bytesAvailable() + n == response.contentLength()) + everythingRead = true; + } + else if(n > 0) + { + // workaround for VC++ bug + QByteArray temp = socket->readAll(); + arr = new QByteArray(temp); + } + + if(arr && !repost) + { + n = arr->size(); + if(toDevice) + { + qint64 bytesWritten; + bytesWritten = toDevice->write(*arr, n); + delete arr; + arr = 0; + // if writing to the device does not succeed, quit with error + if(bytesWritten == -1 || bytesWritten < n) + { + finishedWithError(QLatin1String(QT_TRANSLATE_NOOP("QHttp", "Error writing response to device")), QHttp::UnknownError); + } + else + { + bytesDone += bytesWritten; #if defined(QHTTP_DEBUG) - qDebug("QHttp::_q_slotReadyRead(): read %lld bytes (%lld bytes done)", n, bytesDone); + qDebug("QHttp::_q_slotReadyRead(): read %lld bytes (%lld bytes done)", n, bytesDone); #endif - } - if (response.hasContentLength()) - emit q->dataReadProgress(bytesDone, response.contentLength()); - else - emit q->dataReadProgress(bytesDone, 0); - } else { - char *ptr = rba.reserve(arr->size()); - memcpy(ptr, arr->data(), arr->size()); - delete arr; - arr = 0; + } + if(response.hasContentLength()) + emit q->dataReadProgress(bytesDone, response.contentLength()); + else + emit q->dataReadProgress(bytesDone, 0); + } + else + { + char * ptr = rba.reserve(arr->size()); + memcpy(ptr, arr->data(), arr->size()); + delete arr; + arr = 0; #if defined(QHTTP_DEBUG) - qDebug("QHttp::_q_slotReadyRead(): read %lld bytes (%lld bytes done)", n, bytesDone + q->bytesAvailable()); + qDebug("QHttp::_q_slotReadyRead(): read %lld bytes (%lld bytes done)", n, bytesDone + q->bytesAvailable()); #endif - if (response.hasContentLength()) - emit q->dataReadProgress(bytesDone + q->bytesAvailable(), response.contentLength()); - else - emit q->dataReadProgress(bytesDone + q->bytesAvailable(), 0); - emit q->readyRead(response); - } - } - - delete arr; - } - - if (everythingRead) { - if (repost) { - _q_slotSendRequest(); - return; - } - // Handle "Connection: close" - if (response.value(QLatin1String("connection")).toLower() == QLatin1String("close")) { - closeConn(); - } else { - setState(QHttp::Connected); - // Start a timer, so that we emit the keep alive signal - // "after" this method returned. - QMetaObject::invokeMethod(q, "_q_slotDoFinished", Qt::QueuedConnection); - } - } + if(response.hasContentLength()) + emit q->dataReadProgress(bytesDone + q->bytesAvailable(), response.contentLength()); + else + emit q->dataReadProgress(bytesDone + q->bytesAvailable(), 0); + emit q->readyRead(response); + } + } + + delete arr; + } + + if(everythingRead) + { + if(repost) + { + _q_slotSendRequest(); + return; + } + // Handle "Connection: close" + if(response.value(QLatin1String("connection")).toLower() == QLatin1String("close")) + { + closeConn(); + } + else + { + setState(QHttp::Connected); + // Start a timer, so that we emit the keep alive signal + // "after" this method returned. + QMetaObject::invokeMethod(q, "_q_slotDoFinished", Qt::QueuedConnection); + } + } } void QHttpPrivate::_q_slotDoFinished() { - if (state == QHttp::Connected) { - finishedWithSuccess(); - } else if (state != QHttp::Unconnected) { - setState(QHttp::Unconnected); - finishedWithSuccess(); - } + if(state == QHttp::Connected) + { + finishedWithSuccess(); + } + else if(state != QHttp::Unconnected) + { + setState(QHttp::Unconnected); + finishedWithSuccess(); + } } - /*! Returns the current state of the object. When the state changes, the stateChanged() signal is emitted. @@ -3059,7 +3220,7 @@ void QHttpPrivate::_q_slotDoFinished() */ QHttp::State QHttp::state() const { - return d->state; + return d->state; } /*! @@ -3071,7 +3232,7 @@ QHttp::State QHttp::state() const */ QHttp::Error QHttp::error() const { - return d->error; + return d->error; } /*! @@ -3082,79 +3243,84 @@ QHttp::Error QHttp::error() const */ QString QHttp::errorString() const { - return d->errorString; + return d->errorString; } void QHttpPrivate::setState(int s) { - Q_Q(QHttp); + Q_Q(QHttp); #if defined(QHTTP_DEBUG) - qDebug("QHttp state changed %d -> %d", state, s); + qDebug("QHttp state changed %d -> %d", state, s); #endif - state = QHttp::State(s); - emit q->stateChanged(s); + state = QHttp::State(s); + emit q->stateChanged(s); } void QHttpPrivate::closeConn() { - Q_Q(QHttp); - // If no connection is open -> ignore - if (state == QHttp::Closing || state == QHttp::Unconnected) - return; - - postDevice = 0; - setState(QHttp::Closing); - - // Already closed ? - if (!socket || !socket->isOpen()) { - QMetaObject::invokeMethod(q, "_q_slotDoFinished", Qt::QueuedConnection); - } else { - // Close now. - socket->close(); - } -} - -void QHttpPrivate::setSock(QTcpSocket *sock) -{ - Q_Q(const QHttp); - - // disconnect all existing signals - if (socket) - socket->disconnect(); - if (deleteSocket) - delete socket; - - // use the new QTcpSocket socket, or create one if socket is 0. - deleteSocket = (sock == 0); - socket = sock; - if (!socket) { + Q_Q(QHttp); + // If no connection is open -> ignore + if(state == QHttp::Closing || state == QHttp::Unconnected) + return; + + postDevice = 0; + setState(QHttp::Closing); + + // Already closed ? + if(!socket || !socket->isOpen()) + { + QMetaObject::invokeMethod(q, "_q_slotDoFinished", Qt::QueuedConnection); + } + else + { + // Close now. + socket->close(); + } +} + +void QHttpPrivate::setSock(QTcpSocket * sock) +{ + Q_Q(const QHttp); + + // disconnect all existing signals + if(socket) + socket->disconnect(); + if(deleteSocket) + delete socket; + + // use the new QTcpSocket socket, or create one if socket is 0. + deleteSocket = (sock == 0); + socket = sock; + if(!socket) + { #ifndef QT_NO_OPENSSL - if (QSslSocket::supportsSsl()) - socket = new QSslSocket(); - else + if(QSslSocket::supportsSsl()) + socket = new QSslSocket(); + else #endif - socket = new QTcpSocket(); - } - - // connect all signals - QObject::connect(socket, SIGNAL(connected()), q, SLOT(_q_slotConnected())); - QObject::connect(socket, SIGNAL(disconnected()), q, SLOT(_q_slotClosed())); - QObject::connect(socket, SIGNAL(readyRead()), q, SLOT(_q_slotReadyRead())); - QObject::connect(socket, SIGNAL(error(QAbstractSocket::SocketError)), q, SLOT(_q_slotError(QAbstractSocket::SocketError))); - QObject::connect(socket, SIGNAL(bytesWritten(qint64)), - q, SLOT(_q_slotBytesWritten(qint64))); + socket = new QTcpSocket(); + } + + // connect all signals + QObject::connect(socket, SIGNAL(connected()), q, SLOT(_q_slotConnected())); + QObject::connect(socket, SIGNAL(disconnected()), q, SLOT(_q_slotClosed())); + QObject::connect(socket, SIGNAL(readyRead()), q, SLOT(_q_slotReadyRead())); + QObject::connect(socket, SIGNAL(error(QAbstractSocket::SocketError)), q, SLOT(_q_slotError(QAbstractSocket::SocketError))); + QObject::connect(socket, SIGNAL(bytesWritten(qint64)), + q, SLOT(_q_slotBytesWritten(qint64))); #ifndef QT_NO_NETWORKPROXY - QObject::connect(socket, SIGNAL(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)), - q, SIGNAL(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*))); + QObject::connect(socket, SIGNAL(proxyAuthenticationRequired(QNetworkProxy, QAuthenticator *)), + q, SIGNAL(proxyAuthenticationRequired(QNetworkProxy, QAuthenticator *))); #endif #ifndef QT_NO_OPENSSL - if (qobject_cast(socket)) { - QObject::connect(socket, SIGNAL(sslErrors(QList)), - q, SIGNAL(sslErrors(QList))); - QObject::connect(socket, SIGNAL(encryptedBytesWritten(qint64)), - q, SLOT(_q_slotEncryptedBytesWritten(qint64))); - } + if(qobject_cast(socket)) + { + QObject::connect(socket, SIGNAL(sslErrors(QList)), + q, SIGNAL(sslErrors(QList))); + QObject::connect(socket, SIGNAL(encryptedBytesWritten(qint64)), + q, SLOT(_q_slotEncryptedBytesWritten(qint64))); + } #endif } @@ -3170,9 +3336,9 @@ void QHttpPrivate::setSock(QTcpSocket *sock) #ifndef QT_NO_OPENSSL void QHttp::ignoreSslErrors() { - QSslSocket *sslSocket = qobject_cast(d->socket); - if (sslSocket) - sslSocket->ignoreSslErrors(); + QSslSocket * sslSocket = qobject_cast(d->socket); + if(sslSocket) + sslSocket->ignoreSslErrors(); } #endif diff --git a/src/modules/objects/qthttp/qhttp.h b/src/modules/objects/qthttp/qhttp.h index f8fe7614c..f40361656 100644 --- a/src/modules/objects/qthttp/qhttp.h +++ b/src/modules/objects/qthttp/qhttp.h @@ -64,237 +64,239 @@ class QHttpHeaderPrivate; class QHttpHeader { public: - QHttpHeader(); - QHttpHeader(const QHttpHeader &header); - QHttpHeader(const QString &str); - virtual ~QHttpHeader(); - - QHttpHeader &operator=(const QHttpHeader &h); - - void setValue(const QString &key, const QString &value); - void setValues(const QList > &values); - void addValue(const QString &key, const QString &value); - QList > values() const; - bool hasKey(const QString &key) const; - QStringList keys() const; - QString value(const QString &key) const; - QStringList allValues(const QString &key) const; - void removeValue(const QString &key); - void removeAllValues(const QString &key); - - // ### Qt 5: change to qint64 - bool hasContentLength() const; - uint contentLength() const; - void setContentLength(int len); - - bool hasContentType() const; - QString contentType() const; - void setContentType(const QString &type); - - virtual QString toString() const; - bool isValid() const; - - virtual int majorVersion() const = 0; - virtual int minorVersion() const = 0; + QHttpHeader(); + QHttpHeader(const QHttpHeader & header); + QHttpHeader(const QString & str); + virtual ~QHttpHeader(); + + QHttpHeader & operator=(const QHttpHeader & h); + + void setValue(const QString & key, const QString & value); + void setValues(const QList> & values); + void addValue(const QString & key, const QString & value); + QList> values() const; + bool hasKey(const QString & key) const; + QStringList keys() const; + QString value(const QString & key) const; + QStringList allValues(const QString & key) const; + void removeValue(const QString & key); + void removeAllValues(const QString & key); + + // ### Qt 5: change to qint64 + bool hasContentLength() const; + uint contentLength() const; + void setContentLength(int len); + + bool hasContentType() const; + QString contentType() const; + void setContentType(const QString & type); + + virtual QString toString() const; + bool isValid() const; + + virtual int majorVersion() const = 0; + virtual int minorVersion() const = 0; protected: - virtual bool parseLine(const QString &line, int number); - bool parse(const QString &str); - void setValid(bool); + virtual bool parseLine(const QString & line, int number); + bool parse(const QString & str); + void setValid(bool); - QHttpHeader(QHttpHeaderPrivate &dd, const QString &str = QString()); - QHttpHeader(QHttpHeaderPrivate &dd, const QHttpHeader &header); - QScopedPointer d_ptr; + QHttpHeader(QHttpHeaderPrivate & dd, const QString & str = QString()); + QHttpHeader(QHttpHeaderPrivate & dd, const QHttpHeader & header); + QScopedPointer d_ptr; private: - Q_DECLARE_PRIVATE(QHttpHeader) + Q_DECLARE_PRIVATE(QHttpHeader) }; class QHttpResponseHeaderPrivate; class QHttpResponseHeader : public QHttpHeader { public: - QHttpResponseHeader(); - QHttpResponseHeader(const QHttpResponseHeader &header); - QHttpResponseHeader(const QString &str); - QHttpResponseHeader(int code, const QString &text = QString(), int majorVer = 1, int minorVer = 1); - QHttpResponseHeader &operator=(const QHttpResponseHeader &header); + QHttpResponseHeader(); + QHttpResponseHeader(const QHttpResponseHeader & header); + QHttpResponseHeader(const QString & str); + QHttpResponseHeader(int code, const QString & text = QString(), int majorVer = 1, int minorVer = 1); + QHttpResponseHeader & operator=(const QHttpResponseHeader & header); - void setStatusLine(int code, const QString &text = QString(), int majorVer = 1, int minorVer = 1); + void setStatusLine(int code, const QString & text = QString(), int majorVer = 1, int minorVer = 1); - int statusCode() const; - QString reasonPhrase() const; + int statusCode() const; + QString reasonPhrase() const; - int majorVersion() const; - int minorVersion() const; + int majorVersion() const; + int minorVersion() const; - QString toString() const; + QString toString() const; protected: - bool parseLine(const QString &line, int number); + bool parseLine(const QString & line, int number); private: - Q_DECLARE_PRIVATE(QHttpResponseHeader) - friend class QHttpPrivate; + Q_DECLARE_PRIVATE(QHttpResponseHeader) + friend class QHttpPrivate; }; class QHttpRequestHeaderPrivate; class QHttpRequestHeader : public QHttpHeader { public: - QHttpRequestHeader(); - QHttpRequestHeader(const QString &method, const QString &path, int majorVer = 1, int minorVer = 1); - QHttpRequestHeader(const QHttpRequestHeader &header); - QHttpRequestHeader(const QString &str); - QHttpRequestHeader &operator=(const QHttpRequestHeader &header); + QHttpRequestHeader(); + QHttpRequestHeader(const QString & method, const QString & path, int majorVer = 1, int minorVer = 1); + QHttpRequestHeader(const QHttpRequestHeader & header); + QHttpRequestHeader(const QString & str); + QHttpRequestHeader & operator=(const QHttpRequestHeader & header); - void setRequest(const QString &method, const QString &path, int majorVer = 1, int minorVer = 1); + void setRequest(const QString & method, const QString & path, int majorVer = 1, int minorVer = 1); - QString method() const; - QString path() const; + QString method() const; + QString path() const; - int majorVersion() const; - int minorVersion() const; + int majorVersion() const; + int minorVersion() const; - QString toString() const; + QString toString() const; protected: - bool parseLine(const QString &line, int number); + bool parseLine(const QString & line, int number); private: - Q_DECLARE_PRIVATE(QHttpRequestHeader) + Q_DECLARE_PRIVATE(QHttpRequestHeader) }; class QHttp : public QObject { - Q_OBJECT + Q_OBJECT public: - enum ConnectionMode { - ConnectionModeHttp, - ConnectionModeHttps - }; - - explicit QHttp(QObject *parent = 0); - QHttp(const QString &hostname, quint16 port = 80, QObject *parent = 0); - QHttp(const QString &hostname, ConnectionMode mode, quint16 port = 0, QObject *parent = 0); - virtual ~QHttp(); - - enum State { - Unconnected, - HostLookup, - Connecting, - Sending, - Reading, - Connected, - Closing - }; - enum Error { - NoError, - UnknownError, - HostNotFound, - ConnectionRefused, - UnexpectedClose, - InvalidResponseHeader, - WrongContentLength, - Aborted, - AuthenticationRequiredError, - ProxyAuthenticationRequiredError - }; - - int setHost(const QString &hostname, quint16 port = 80); - int setHost(const QString &hostname, ConnectionMode mode, quint16 port = 0); - - int setSocket(QTcpSocket *socket); - int setUser(const QString &username, const QString &password = QString()); + enum ConnectionMode + { + ConnectionModeHttp, + ConnectionModeHttps + }; + + explicit QHttp(QObject * parent = 0); + QHttp(const QString & hostname, quint16 port = 80, QObject * parent = 0); + QHttp(const QString & hostname, ConnectionMode mode, quint16 port = 0, QObject * parent = 0); + virtual ~QHttp(); + + enum State + { + Unconnected, + HostLookup, + Connecting, + Sending, + Reading, + Connected, + Closing + }; + enum Error + { + NoError, + UnknownError, + HostNotFound, + ConnectionRefused, + UnexpectedClose, + InvalidResponseHeader, + WrongContentLength, + Aborted, + AuthenticationRequiredError, + ProxyAuthenticationRequiredError + }; + + int setHost(const QString & hostname, quint16 port = 80); + int setHost(const QString & hostname, ConnectionMode mode, quint16 port = 0); + + int setSocket(QTcpSocket * socket); + int setUser(const QString & username, const QString & password = QString()); #ifndef QT_NO_NETWORKPROXY - int setProxy(const QString &host, int port, - const QString &username = QString(), - const QString &password = QString()); - int setProxy(const QNetworkProxy &proxy); + int setProxy(const QString & host, int port, + const QString & username = QString(), + const QString & password = QString()); + int setProxy(const QNetworkProxy & proxy); #endif - int get(const QString &path, QIODevice *to=0); - int post(const QString &path, QIODevice *data, QIODevice *to=0 ); - int post(const QString &path, const QByteArray &data, QIODevice *to=0); - int head(const QString &path); - int request(const QHttpRequestHeader &header, QIODevice *device=0, QIODevice *to=0); - int request(const QHttpRequestHeader &header, const QByteArray &data, QIODevice *to=0); + int get(const QString & path, QIODevice * to = 0); + int post(const QString & path, QIODevice * data, QIODevice * to = 0); + int post(const QString & path, const QByteArray & data, QIODevice * to = 0); + int head(const QString & path); + int request(const QHttpRequestHeader & header, QIODevice * device = 0, QIODevice * to = 0); + int request(const QHttpRequestHeader & header, const QByteArray & data, QIODevice * to = 0); - int closeConnection(); - int close(); + int closeConnection(); + int close(); - qint64 bytesAvailable() const; - qint64 read(char *data, qint64 maxlen); - QByteArray readAll(); + qint64 bytesAvailable() const; + qint64 read(char * data, qint64 maxlen); + QByteArray readAll(); - int currentId() const; - QIODevice *currentSourceDevice() const; - QIODevice *currentDestinationDevice() const; - QHttpRequestHeader currentRequest() const; - QHttpResponseHeader lastResponse() const; - bool hasPendingRequests() const; - void clearPendingRequests(); + int currentId() const; + QIODevice * currentSourceDevice() const; + QIODevice * currentDestinationDevice() const; + QHttpRequestHeader currentRequest() const; + QHttpResponseHeader lastResponse() const; + bool hasPendingRequests() const; + void clearPendingRequests(); - State state() const; + State state() const; - Error error() const; - QString errorString() const; + Error error() const; + QString errorString() const; public Q_SLOTS: - void abort(); + void abort(); #ifndef QT_NO_OPENSSL - void ignoreSslErrors(); + void ignoreSslErrors(); #endif -Q_SIGNALS: - void stateChanged(int); - void responseHeaderReceived(const QHttpResponseHeader &resp); - void readyRead(const QHttpResponseHeader &resp); + Q_SIGNALS : void stateChanged(int); + void responseHeaderReceived(const QHttpResponseHeader & resp); + void readyRead(const QHttpResponseHeader & resp); - // ### Qt 5: change to qint64 - void dataSendProgress(int, int); - void dataReadProgress(int, int); + // ### Qt 5: change to qint64 + void dataSendProgress(int, int); + void dataReadProgress(int, int); - void requestStarted(int); - void requestFinished(int, bool); - void done(bool); + void requestStarted(int); + void requestFinished(int, bool); + void done(bool); #ifndef QT_NO_NETWORKPROXY - void proxyAuthenticationRequired(const QNetworkProxy &proxy, QAuthenticator *); + void proxyAuthenticationRequired(const QNetworkProxy & proxy, QAuthenticator *); #endif - void authenticationRequired(const QString &hostname, quint16 port, QAuthenticator *); + void authenticationRequired(const QString & hostname, quint16 port, QAuthenticator *); #ifndef QT_NO_OPENSSL - void sslErrors(const QList &errors); + void sslErrors(const QList & errors); #endif private: - Q_DISABLE_COPY(QHttp) - QScopedPointer d; - - void _q_startNextRequest(); - void _q_slotReadyRead(); - void _q_slotConnected(); - void _q_slotError(QAbstractSocket::SocketError e); - void _q_slotClosed(); - void _q_slotBytesWritten(qint64 numBytes); + Q_DISABLE_COPY(QHttp) + QScopedPointer d; + + void _q_startNextRequest(); + void _q_slotReadyRead(); + void _q_slotConnected(); + void _q_slotError(QAbstractSocket::SocketError e); + void _q_slotClosed(); + void _q_slotBytesWritten(qint64 numBytes); #ifndef QT_NO_OPENSSL - void _q_slotEncryptedBytesWritten(qint64 numBytes); + void _q_slotEncryptedBytesWritten(qint64 numBytes); #endif - void _q_slotDoFinished(); - void _q_slotSendRequest(); - void _q_continuePost(); - - friend class QHttpNormalRequest; - friend class QHttpSetHostRequest; - friend class QHttpSetSocketRequest; - friend class QHttpSetUserRequest; - friend class QHttpSetProxyRequest; - friend class QHttpCloseRequest; - friend class QHttpPGHRequest; + void _q_slotDoFinished(); + void _q_slotSendRequest(); + void _q_continuePost(); + + friend class QHttpNormalRequest; + friend class QHttpSetHostRequest; + friend class QHttpSetSocketRequest; + friend class QHttpSetUserRequest; + friend class QHttpSetProxyRequest; + friend class QHttpCloseRequest; + friend class QHttpPGHRequest; }; QT_END_HEADER diff --git a/src/modules/objects/qthttp/qhttpauthenticator.cpp b/src/modules/objects/qthttp/qhttpauthenticator.cpp index ad622a2a7..afe462a98 100644 --- a/src/modules/objects/qthttp/qhttpauthenticator.cpp +++ b/src/modules/objects/qthttp/qhttpauthenticator.cpp @@ -60,7 +60,7 @@ QT_BEGIN_NAMESPACE #endif static QByteArray qNtlmPhase1(); -static QByteArray qNtlmPhase3(QHttpAuthenticatorPrivate *ctx, const QByteArray& phase2data); +static QByteArray qNtlmPhase3(QHttpAuthenticatorPrivate * ctx, const QByteArray & phase2data); /*! \class QHttpAuthenticator @@ -128,7 +128,6 @@ static QByteArray qNtlmPhase3(QHttpAuthenticatorPrivate *ctx, const QByteArray& \sa QSslSocket */ - /*! Constructs an empty authentication object */ @@ -142,72 +141,71 @@ QHttpAuthenticator::QHttpAuthenticator() */ QHttpAuthenticator::~QHttpAuthenticator() { - if (d && !d->ref.deref()) - delete d; + if(d && !d->ref.deref()) + delete d; } /*! Constructs a copy of \a other. */ -QHttpAuthenticator::QHttpAuthenticator(const QHttpAuthenticator &other) +QHttpAuthenticator::QHttpAuthenticator(const QHttpAuthenticator & other) : d(other.d) { - if (d) - d->ref.ref(); + if(d) + d->ref.ref(); } /*! Assigns the contents of \a other to this authenticator. */ -QHttpAuthenticator &QHttpAuthenticator::operator=(const QHttpAuthenticator &other) +QHttpAuthenticator & QHttpAuthenticator::operator=(const QHttpAuthenticator & other) { - if (d == other.d) - return *this; + if(d == other.d) + return *this; - if (d && !d->ref.deref()) - delete d; + if(d && !d->ref.deref()) + delete d; - d = other.d; - if (d) - d->ref.ref(); - return *this; + d = other.d; + if(d) + d->ref.ref(); + return *this; } /*! Returns true if this authenticator is identical to \a other; otherwise returns false. */ -bool QHttpAuthenticator::operator==(const QHttpAuthenticator &other) const +bool QHttpAuthenticator::operator==(const QHttpAuthenticator & other) const { - if (d == other.d) - return true; - return d->user == other.d->user - && d->password == other.d->password - && d->realm == other.d->realm - && d->method == other.d->method - && d->options == other.d->options; + if(d == other.d) + return true; + return d->user == other.d->user + && d->password == other.d->password + && d->realm == other.d->realm + && d->method == other.d->method + && d->options == other.d->options; } -QHttpAuthenticator &QHttpAuthenticator::operator=(const QAuthenticator& auth) +QHttpAuthenticator & QHttpAuthenticator::operator=(const QAuthenticator & auth) { - detach(); - d->user = auth.user(); - d->password = auth.password(); - d->options = auth.options(); - return *this; + detach(); + d->user = auth.user(); + d->password = auth.password(); + d->options = auth.options(); + return *this; } QAuthenticator QHttpAuthenticator::toQAuthenticator() { - QAuthenticator rv; - rv.setUser(d->user); - rv.setPassword(d->password); - foreach (const QString& option, d->options.keys()) - rv.setOption(option, d->options.value(option)); - return rv; + QAuthenticator rv; + rv.setUser(d->user); + rv.setPassword(d->password); + foreach(const QString & option, d->options.keys()) + rv.setOption(option, d->options.value(option)); + return rv; } - /*! \fn bool QHttpAuthenticator::operator!=(const QHttpAuthenticator &other) const @@ -220,7 +218,7 @@ QAuthenticator QHttpAuthenticator::toQAuthenticator() */ QString QHttpAuthenticator::user() const { - return d ? d->user : QString(); + return d ? d->user : QString(); } /*! @@ -228,31 +226,35 @@ QString QHttpAuthenticator::user() const \sa QNetworkAccessManager::authenticationRequired() */ -void QHttpAuthenticator::setUser(const QString &user) +void QHttpAuthenticator::setUser(const QString & user) { - detach(); - int separatorPosn = 0; - - switch(d->method) { - case QHttpAuthenticatorPrivate::Ntlm: - if((separatorPosn = user.indexOf(QLatin1String("\\"))) != -1) { - //domain name is present - d->realm.clear(); - d->userDomain = user.left(separatorPosn); - d->extractedUser = user.mid(separatorPosn + 1); - d->user = user; - } else { - d->extractedUser = user; - d->user = user; - d->realm.clear(); - d->userDomain.clear(); - } - break; - default: - d->user = user; - d->userDomain.clear(); - break; - } + detach(); + int separatorPosn = 0; + + switch(d->method) + { + case QHttpAuthenticatorPrivate::Ntlm: + if((separatorPosn = user.indexOf(QLatin1String("\\"))) != -1) + { + //domain name is present + d->realm.clear(); + d->userDomain = user.left(separatorPosn); + d->extractedUser = user.mid(separatorPosn + 1); + d->user = user; + } + else + { + d->extractedUser = user; + d->user = user; + d->realm.clear(); + d->userDomain.clear(); + } + break; + default: + d->user = user; + d->userDomain.clear(); + break; + } } /*! @@ -260,7 +262,7 @@ void QHttpAuthenticator::setUser(const QString &user) */ QString QHttpAuthenticator::password() const { - return d ? d->password : QString(); + return d ? d->password : QString(); } /*! @@ -268,10 +270,10 @@ QString QHttpAuthenticator::password() const \sa QNetworkAccessManager::authenticationRequired() */ -void QHttpAuthenticator::setPassword(const QString &password) +void QHttpAuthenticator::setPassword(const QString & password) { - detach(); - d->password = password; + detach(); + d->password = password; } /*! @@ -279,14 +281,15 @@ void QHttpAuthenticator::setPassword(const QString &password) */ void QHttpAuthenticator::detach() { - if (!d) { - d = new QHttpAuthenticatorPrivate; - d->ref.store(1); - return; - } - - qAtomicDetach(d); - d->phase = QHttpAuthenticatorPrivate::Start; + if(!d) + { + d = new QHttpAuthenticatorPrivate; + d->ref.store(1); + return; + } + + qAtomicDetach(d); + d->phase = QHttpAuthenticatorPrivate::Start; } /*! @@ -294,7 +297,7 @@ void QHttpAuthenticator::detach() */ QString QHttpAuthenticator::realm() const { - return d ? d->realm : QString(); + return d ? d->realm : QString(); } /*! @@ -305,9 +308,9 @@ QString QHttpAuthenticator::realm() const \sa options(), QHttpAuthenticator#Options */ -QVariant QHttpAuthenticator::option(const QString &opt) const +QVariant QHttpAuthenticator::option(const QString & opt) const { - return d ? d->options.value(opt) : QVariant(); + return d ? d->options.value(opt) : QVariant(); } /*! @@ -320,7 +323,7 @@ QVariant QHttpAuthenticator::option(const QString &opt) const */ QVariantHash QHttpAuthenticator::options() const { - return d ? d->options : QVariantHash(); + return d ? d->options : QVariantHash(); } /*! @@ -331,54 +334,50 @@ QVariantHash QHttpAuthenticator::options() const \sa options(), option(), QHttpAuthenticator#Options */ -void QHttpAuthenticator::setOption(const QString &opt, const QVariant &value) +void QHttpAuthenticator::setOption(const QString & opt, const QVariant & value) { - detach(); - d->options.insert(opt, value); + detach(); + d->options.insert(opt, value); } - /*! Returns true if the authenticator is null. */ bool QHttpAuthenticator::isNull() const { - return !d; + return !d; } QHttpAuthenticatorPrivate::QHttpAuthenticatorPrivate() - : ref(0) - , method(None) - , hasFailed(false) - , phase(Start) - , nonceCount(0) + : ref(0), method(None), hasFailed(false), phase(Start), nonceCount(0) { - cnonce = QCryptographicHash::hash(QByteArray::number(qrand(), 16) + QByteArray::number(qrand(), 16), - QCryptographicHash::Md5).toHex(); - nonceCount = 0; + cnonce = QCryptographicHash::hash(QByteArray::number(qrand(), 16) + QByteArray::number(qrand(), 16), + QCryptographicHash::Md5) + .toHex(); + nonceCount = 0; } #ifndef QT_NO_HTTP -void QHttpAuthenticatorPrivate::parseHttpResponse(const QHttpResponseHeader &header, bool isProxy) +void QHttpAuthenticatorPrivate::parseHttpResponse(const QHttpResponseHeader & header, bool isProxy) { - const QList > values = header.values(); - QList > rawValues; + const QList> values = header.values(); + QList> rawValues; - QList >::const_iterator it, end; - for (it = values.constBegin(), end = values.constEnd(); it != end; ++it) - rawValues.append(qMakePair(it->first.toLatin1(), it->second.toUtf8())); + QList>::const_iterator it, end; + for(it = values.constBegin(), end = values.constEnd(); it != end; ++it) + rawValues.append(qMakePair(it->first.toLatin1(), it->second.toUtf8())); - // continue in byte array form - parseHttpResponse(rawValues, isProxy); + // continue in byte array form + parseHttpResponse(rawValues, isProxy); } #endif -void QHttpAuthenticatorPrivate::parseHttpResponse(const QList > &values, bool isProxy) +void QHttpAuthenticatorPrivate::parseHttpResponse(const QList> & values, bool isProxy) { - const char *search = isProxy ? "proxy-authenticate" : "www-authenticate"; + const char * search = isProxy ? "proxy-authenticate" : "www-authenticate"; - method = None; - /* + method = None; + /* Fun from the HTTP 1.1 specs, that we currently ignore: User agents are advised to take special care in parsing the WWW- @@ -388,170 +387,192 @@ void QHttpAuthenticatorPrivate::parseHttpResponse(const QList ¤t = values.at(i); - if (current.first.toLower() != search) - continue; - QByteArray str = current.second.toLower(); - if (method < Basic && str.startsWith("basic")) { - method = Basic; - headerVal = current.second.mid(6); - } else if (method < Ntlm && str.startsWith("ntlm")) { - method = Ntlm; - headerVal = current.second.mid(5); - } else if (method < DigestMd5 && str.startsWith("digest")) { - method = DigestMd5; - headerVal = current.second.mid(7); - } - } - - challenge = headerVal.trimmed(); - QHash options = parseDigestAuthenticationChallenge(challenge); - - switch(method) { - case Basic: - this->options[QLatin1String("realm")] = realm = QString::fromLatin1(options.value("realm")); - if (user.isEmpty() && password.isEmpty()) - phase = Done; - break; - case Ntlm: - // #### extract from header - break; - case DigestMd5: { - this->options[QLatin1String("realm")] = realm = QString::fromLatin1(options.value("realm")); - if (options.value("stale").toLower() == "true") - phase = Start; - if (user.isEmpty() && password.isEmpty()) - phase = Done; - break; - } - default: - realm.clear(); - challenge = QByteArray(); - phase = Invalid; - } + QByteArray headerVal; + for(int i = 0; i < values.size(); ++i) + { + const QPair & current = values.at(i); + if(current.first.toLower() != search) + continue; + QByteArray str = current.second.toLower(); + if(method < Basic && str.startsWith("basic")) + { + method = Basic; + headerVal = current.second.mid(6); + } + else if(method < Ntlm && str.startsWith("ntlm")) + { + method = Ntlm; + headerVal = current.second.mid(5); + } + else if(method < DigestMd5 && str.startsWith("digest")) + { + method = DigestMd5; + headerVal = current.second.mid(7); + } + } + + challenge = headerVal.trimmed(); + QHash options = parseDigestAuthenticationChallenge(challenge); + + switch(method) + { + case Basic: + this->options[QLatin1String("realm")] = realm = QString::fromLatin1(options.value("realm")); + if(user.isEmpty() && password.isEmpty()) + phase = Done; + break; + case Ntlm: + // #### extract from header + break; + case DigestMd5: + { + this->options[QLatin1String("realm")] = realm = QString::fromLatin1(options.value("realm")); + if(options.value("stale").toLower() == "true") + phase = Start; + if(user.isEmpty() && password.isEmpty()) + phase = Done; + break; + } + default: + realm.clear(); + challenge = QByteArray(); + phase = Invalid; + } } -QByteArray QHttpAuthenticatorPrivate::calculateResponse(const QByteArray &requestMethod, const QByteArray &path) +QByteArray QHttpAuthenticatorPrivate::calculateResponse(const QByteArray & requestMethod, const QByteArray & path) { - QByteArray response; - const char *methodString = 0; - switch(method) { - case QHttpAuthenticatorPrivate::None: - methodString = ""; - phase = Done; - break; - case QHttpAuthenticatorPrivate::Plain: - response = '\0' + user.toUtf8() + '\0' + password.toUtf8(); - phase = Done; - break; - case QHttpAuthenticatorPrivate::Basic: - methodString = "Basic "; - response = user.toLatin1() + ':' + password.toLatin1(); - response = response.toBase64(); - phase = Done; - break; - case QHttpAuthenticatorPrivate::Login: - if (challenge.contains("VXNlciBOYW1lAA==")) { - response = user.toUtf8().toBase64(); - phase = Phase2; - } else if (challenge.contains("UGFzc3dvcmQA")) { - response = password.toUtf8().toBase64(); - phase = Done; - } - break; - case QHttpAuthenticatorPrivate::CramMd5: - break; - case QHttpAuthenticatorPrivate::DigestMd5: - methodString = "Digest "; - response = digestMd5Response(challenge, requestMethod, path); - phase = Done; - break; - case QHttpAuthenticatorPrivate::Ntlm: - methodString = "NTLM "; - if (challenge.isEmpty()) { - response = qNtlmPhase1().toBase64(); - if (user.isEmpty()) - phase = Done; - else - phase = Phase2; - } else { - response = qNtlmPhase3(this, QByteArray::fromBase64(challenge)).toBase64(); - phase = Done; - } - - break; - } - return QByteArray(methodString) + response; + QByteArray response; + const char * methodString = 0; + switch(method) + { + case QHttpAuthenticatorPrivate::None: + methodString = ""; + phase = Done; + break; + case QHttpAuthenticatorPrivate::Plain: + response = '\0' + user.toUtf8() + '\0' + password.toUtf8(); + phase = Done; + break; + case QHttpAuthenticatorPrivate::Basic: + methodString = "Basic "; + response = user.toLatin1() + ':' + password.toLatin1(); + response = response.toBase64(); + phase = Done; + break; + case QHttpAuthenticatorPrivate::Login: + if(challenge.contains("VXNlciBOYW1lAA==")) + { + response = user.toUtf8().toBase64(); + phase = Phase2; + } + else if(challenge.contains("UGFzc3dvcmQA")) + { + response = password.toUtf8().toBase64(); + phase = Done; + } + break; + case QHttpAuthenticatorPrivate::CramMd5: + break; + case QHttpAuthenticatorPrivate::DigestMd5: + methodString = "Digest "; + response = digestMd5Response(challenge, requestMethod, path); + phase = Done; + break; + case QHttpAuthenticatorPrivate::Ntlm: + methodString = "NTLM "; + if(challenge.isEmpty()) + { + response = qNtlmPhase1().toBase64(); + if(user.isEmpty()) + phase = Done; + else + phase = Phase2; + } + else + { + response = qNtlmPhase3(this, QByteArray::fromBase64(challenge)).toBase64(); + phase = Done; + } + + break; + } + return QByteArray(methodString) + response; } - // ---------------------------- Digest Md5 code ---------------------------------------- -QHash QHttpAuthenticatorPrivate::parseDigestAuthenticationChallenge(const QByteArray &challenge) +QHash QHttpAuthenticatorPrivate::parseDigestAuthenticationChallenge(const QByteArray & challenge) { - QHash options; - // parse the challenge - const char *d = challenge.constData(); - const char *end = d + challenge.length(); - while (d < end) { - while (d < end && (*d == ' ' || *d == '\n' || *d == '\r')) - ++d; - const char *start = d; - while (d < end && *d != '=') - ++d; - QByteArray key = QByteArray(start, d - start); - ++d; - if (d >= end) - break; - bool quote = (*d == '"'); - if (quote) - ++d; - if (d >= end) - break; - start = d; - QByteArray value; - while (d < end) { - bool backslash = false; - if (*d == '\\' && d < end - 1) { - ++d; - backslash = true; - } - if (!backslash) { - if (quote) { - if (*d == '"') - break; - } else { - if (*d == ',') - break; - } - } - value += *d; - ++d; - } - while (d < end && *d != ',') - ++d; - ++d; - options[key] = value; - } - - QByteArray qop = options.value("qop"); - if (!qop.isEmpty()) { - QList qopoptions = qop.split(','); - if (!qopoptions.contains("auth")) - return QHash(); - // #### can't do auth-int currently -// if (qop.contains("auth-int")) -// qop = "auth-int"; -// else if (qop.contains("auth")) -// qop = "auth"; -// else -// qop = QByteArray(); - options["qop"] = "auth"; - } - - return options; + QHash options; + // parse the challenge + const char * d = challenge.constData(); + const char * end = d + challenge.length(); + while(d < end) + { + while(d < end && (*d == ' ' || *d == '\n' || *d == '\r')) + ++d; + const char * start = d; + while(d < end && *d != '=') + ++d; + QByteArray key = QByteArray(start, d - start); + ++d; + if(d >= end) + break; + bool quote = (*d == '"'); + if(quote) + ++d; + if(d >= end) + break; + start = d; + QByteArray value; + while(d < end) + { + bool backslash = false; + if(*d == '\\' && d < end - 1) + { + ++d; + backslash = true; + } + if(!backslash) + { + if(quote) + { + if(*d == '"') + break; + } + else + { + if(*d == ',') + break; + } + } + value += *d; + ++d; + } + while(d < end && *d != ',') + ++d; + ++d; + options[key] = value; + } + + QByteArray qop = options.value("qop"); + if(!qop.isEmpty()) + { + QList qopoptions = qop.split(','); + if(!qopoptions.contains("auth")) + return QHash(); + // #### can't do auth-int currently + // if (qop.contains("auth-int")) + // qop = "auth-int"; + // else if (qop.contains("auth")) + // qop = "auth"; + // else + // qop = QByteArray(); + options["qop"] = "auth"; + } + + return options; } /* @@ -562,117 +583,117 @@ QHash QHttpAuthenticatorPrivate::parseDigestAuthenticati Currently we don't support the full SASL authentication mechanism (which includes cyphers) */ - /* calculate request-digest/response-digest as per HTTP Digest spec */ static QByteArray digestMd5ResponseHelper( - const QByteArray &alg, - const QByteArray &userName, - const QByteArray &realm, - const QByteArray &password, - const QByteArray &nonce, /* nonce from server */ - const QByteArray &nonceCount, /* 8 hex digits */ - const QByteArray &cNonce, /* client nonce */ - const QByteArray &qop, /* qop-value: "", "auth", "auth-int" */ - const QByteArray &method, /* method from the request */ - const QByteArray &digestUri, /* requested URL */ - const QByteArray &hEntity /* H(entity body) if qop="auth-int" */ + const QByteArray & alg, + const QByteArray & userName, + const QByteArray & realm, + const QByteArray & password, + const QByteArray & nonce, /* nonce from server */ + const QByteArray & nonceCount, /* 8 hex digits */ + const QByteArray & cNonce, /* client nonce */ + const QByteArray & qop, /* qop-value: "", "auth", "auth-int" */ + const QByteArray & method, /* method from the request */ + const QByteArray & digestUri, /* requested URL */ + const QByteArray & hEntity /* H(entity body) if qop="auth-int" */ ) { - QCryptographicHash hash(QCryptographicHash::Md5); - hash.addData(userName); - hash.addData(":", 1); - hash.addData(realm); - hash.addData(":", 1); - hash.addData(password); - QByteArray ha1 = hash.result(); - if (alg.toLower() == "md5-sess") { - hash.reset(); - // RFC 2617 contains an error, it was: - // hash.addData(ha1); - // but according to the errata page at http://www.rfc-editor.org/errata_list.php, ID 1649, it - // must be the following line: - hash.addData(ha1.toHex()); - hash.addData(":", 1); - hash.addData(nonce); - hash.addData(":", 1); - hash.addData(cNonce); - ha1 = hash.result(); - }; - ha1 = ha1.toHex(); - - // calculate H(A2) - hash.reset(); - hash.addData(method); - hash.addData(":", 1); - hash.addData(digestUri); - if (qop.toLower() == "auth-int") { - hash.addData(":", 1); - hash.addData(hEntity); - } - QByteArray ha2hex = hash.result().toHex(); - - // calculate response - hash.reset(); - hash.addData(ha1); - hash.addData(":", 1); - hash.addData(nonce); - hash.addData(":", 1); - if (!qop.isNull()) { - hash.addData(nonceCount); - hash.addData(":", 1); - hash.addData(cNonce); - hash.addData(":", 1); - hash.addData(qop); - hash.addData(":", 1); - } - hash.addData(ha2hex); - return hash.result().toHex(); + QCryptographicHash hash(QCryptographicHash::Md5); + hash.addData(userName); + hash.addData(":", 1); + hash.addData(realm); + hash.addData(":", 1); + hash.addData(password); + QByteArray ha1 = hash.result(); + if(alg.toLower() == "md5-sess") + { + hash.reset(); + // RFC 2617 contains an error, it was: + // hash.addData(ha1); + // but according to the errata page at http://www.rfc-editor.org/errata_list.php, ID 1649, it + // must be the following line: + hash.addData(ha1.toHex()); + hash.addData(":", 1); + hash.addData(nonce); + hash.addData(":", 1); + hash.addData(cNonce); + ha1 = hash.result(); + }; + ha1 = ha1.toHex(); + + // calculate H(A2) + hash.reset(); + hash.addData(method); + hash.addData(":", 1); + hash.addData(digestUri); + if(qop.toLower() == "auth-int") + { + hash.addData(":", 1); + hash.addData(hEntity); + } + QByteArray ha2hex = hash.result().toHex(); + + // calculate response + hash.reset(); + hash.addData(ha1); + hash.addData(":", 1); + hash.addData(nonce); + hash.addData(":", 1); + if(!qop.isNull()) + { + hash.addData(nonceCount); + hash.addData(":", 1); + hash.addData(cNonce); + hash.addData(":", 1); + hash.addData(qop); + hash.addData(":", 1); + } + hash.addData(ha2hex); + return hash.result().toHex(); } -QByteArray QHttpAuthenticatorPrivate::digestMd5Response(const QByteArray &challenge, const QByteArray &method, const QByteArray &path) +QByteArray QHttpAuthenticatorPrivate::digestMd5Response(const QByteArray & challenge, const QByteArray & method, const QByteArray & path) { - QHash options = parseDigestAuthenticationChallenge(challenge); - - ++nonceCount; - QByteArray nonceCountString = QByteArray::number(nonceCount, 16); - while (nonceCountString.length() < 8) - nonceCountString.prepend('0'); - - QByteArray nonce = options.value("nonce"); - QByteArray opaque = options.value("opaque"); - QByteArray qop = options.value("qop"); - -// qDebug() << "calculating digest: method=" << method << "path=" << path; - QByteArray response = digestMd5ResponseHelper(options.value("algorithm"), user.toLatin1(), - realm.toLatin1(), password.toLatin1(), - nonce, nonceCountString, - cnonce, qop, method, - path, QByteArray()); - - - QByteArray credentials; - credentials += "username=\"" + user.toLatin1() + "\", "; - credentials += "realm=\"" + realm.toLatin1() + "\", "; - credentials += "nonce=\"" + nonce + "\", "; - credentials += "uri=\"" + path + "\", "; - if (!opaque.isEmpty()) - credentials += "opaque=\"" + opaque + "\", "; - credentials += "response=\"" + response + '\"'; - if (!options.value("algorithm").isEmpty()) - credentials += ", algorithm=" + options.value("algorithm"); - if (!options.value("qop").isEmpty()) { - credentials += ", qop=" + qop + ", "; - credentials += "nc=" + nonceCountString + ", "; - credentials += "cnonce=\"" + cnonce + '\"'; - } - - return credentials; + QHash options = parseDigestAuthenticationChallenge(challenge); + + ++nonceCount; + QByteArray nonceCountString = QByteArray::number(nonceCount, 16); + while(nonceCountString.length() < 8) + nonceCountString.prepend('0'); + + QByteArray nonce = options.value("nonce"); + QByteArray opaque = options.value("opaque"); + QByteArray qop = options.value("qop"); + + // qDebug() << "calculating digest: method=" << method << "path=" << path; + QByteArray response = digestMd5ResponseHelper(options.value("algorithm"), user.toLatin1(), + realm.toLatin1(), password.toLatin1(), + nonce, nonceCountString, + cnonce, qop, method, + path, QByteArray()); + + QByteArray credentials; + credentials += "username=\"" + user.toLatin1() + "\", "; + credentials += "realm=\"" + realm.toLatin1() + "\", "; + credentials += "nonce=\"" + nonce + "\", "; + credentials += "uri=\"" + path + "\", "; + if(!opaque.isEmpty()) + credentials += "opaque=\"" + opaque + "\", "; + credentials += "response=\"" + response + '\"'; + if(!options.value("algorithm").isEmpty()) + credentials += ", algorithm=" + options.value("algorithm"); + if(!options.value("qop").isEmpty()) + { + credentials += ", qop=" + qop + ", "; + credentials += "nc=" + nonceCountString + ", "; + credentials += "cnonce=\"" + cnonce + '\"'; + } + + return credentials; } // ---------------------------- Digest Md5 code ---------------------------------------- - - /* * NTLM message flags. * @@ -813,10 +834,9 @@ QByteArray QHttpAuthenticatorPrivate::digestMd5Response(const QByteArray &challe //#define NTLMV1_CLIENT - //************************Global variables*************************** -const int blockSize = 64; //As per RFC2104 Block-size is 512 bits +const int blockSize = 64; //As per RFC2104 Block-size is 512 bits const int nDigestLen = 16; //Trunctaion Length of the Hmac-Md5 digest const quint8 respversion = 1; const quint8 hirespversion = 1; @@ -838,269 +858,276 @@ const quint8 hirespversion = 1; - add v2 handling */ -class QNtlmBuffer { +class QNtlmBuffer +{ public: - QNtlmBuffer() : len(0), maxLen(0), offset(0) {} - quint16 len; - quint16 maxLen; - quint32 offset; - enum { Size = 8 }; + QNtlmBuffer() : len(0), maxLen(0), offset(0) {} + quint16 len; + quint16 maxLen; + quint32 offset; + enum + { + Size = 8 + }; }; class QNtlmPhase1BlockBase { public: - char magic[8]; - quint32 type; - quint32 flags; - QNtlmBuffer domain; - QNtlmBuffer workstation; - enum { Size = 32 }; + char magic[8]; + quint32 type; + quint32 flags; + QNtlmBuffer domain; + QNtlmBuffer workstation; + enum + { + Size = 32 + }; }; // ################# check paddings class QNtlmPhase2BlockBase { public: - char magic[8]; - quint32 type; - QNtlmBuffer targetName; - quint32 flags; - unsigned char challenge[8]; - quint32 context[2]; - QNtlmBuffer targetInfo; - enum { Size = 48 }; + char magic[8]; + quint32 type; + QNtlmBuffer targetName; + quint32 flags; + unsigned char challenge[8]; + quint32 context[2]; + QNtlmBuffer targetInfo; + enum + { + Size = 48 + }; }; -class QNtlmPhase3BlockBase { +class QNtlmPhase3BlockBase +{ public: - char magic[8]; - quint32 type; - QNtlmBuffer lmResponse; - QNtlmBuffer ntlmResponse; - QNtlmBuffer domain; - QNtlmBuffer user; - QNtlmBuffer workstation; - QNtlmBuffer sessionKey; - quint32 flags; - enum { Size = 64 }; + char magic[8]; + quint32 type; + QNtlmBuffer lmResponse; + QNtlmBuffer ntlmResponse; + QNtlmBuffer domain; + QNtlmBuffer user; + QNtlmBuffer workstation; + QNtlmBuffer sessionKey; + quint32 flags; + enum + { + Size = 64 + }; }; -static void qStreamNtlmBuffer(QDataStream& ds, const QByteArray& s) +static void qStreamNtlmBuffer(QDataStream & ds, const QByteArray & s) { - ds.writeRawData(s.constData(), s.size()); + ds.writeRawData(s.constData(), s.size()); } - -static void qStreamNtlmString(QDataStream& ds, const QString& s, bool unicode) +static void qStreamNtlmString(QDataStream & ds, const QString & s, bool unicode) { - if (!unicode) { - qStreamNtlmBuffer(ds, s.toLatin1()); - return; - } - const ushort *d = s.utf16(); - for (int i = 0; i < s.length(); ++i) - ds << d[i]; + if(!unicode) + { + qStreamNtlmBuffer(ds, s.toLatin1()); + return; + } + const ushort * d = s.utf16(); + for(int i = 0; i < s.length(); ++i) + ds << d[i]; } - - -static int qEncodeNtlmBuffer(QNtlmBuffer& buf, int offset, const QByteArray& s) +static int qEncodeNtlmBuffer(QNtlmBuffer & buf, int offset, const QByteArray & s) { - buf.len = s.size(); - buf.maxLen = buf.len; - buf.offset = (offset + 1) & ~1; - return buf.offset + buf.len; + buf.len = s.size(); + buf.maxLen = buf.len; + buf.offset = (offset + 1) & ~1; + return buf.offset + buf.len; } - -static int qEncodeNtlmString(QNtlmBuffer& buf, int offset, const QString& s, bool unicode) +static int qEncodeNtlmString(QNtlmBuffer & buf, int offset, const QString & s, bool unicode) { - if (!unicode) - return qEncodeNtlmBuffer(buf, offset, s.toLatin1()); - buf.len = 2 * s.length(); - buf.maxLen = buf.len; - buf.offset = (offset + 1) & ~1; - return buf.offset + buf.len; + if(!unicode) + return qEncodeNtlmBuffer(buf, offset, s.toLatin1()); + buf.len = 2 * s.length(); + buf.maxLen = buf.len; + buf.offset = (offset + 1) & ~1; + return buf.offset + buf.len; } - -static QDataStream& operator<<(QDataStream& s, const QNtlmBuffer& b) +static QDataStream & operator<<(QDataStream & s, const QNtlmBuffer & b) { - s << b.len << b.maxLen << b.offset; - return s; + s << b.len << b.maxLen << b.offset; + return s; } -static QDataStream& operator>>(QDataStream& s, QNtlmBuffer& b) +static QDataStream & operator>>(QDataStream & s, QNtlmBuffer & b) { - s >> b.len >> b.maxLen >> b.offset; - return s; + s >> b.len >> b.maxLen >> b.offset; + return s; } - class QNtlmPhase1Block : public QNtlmPhase1BlockBase -{ // request +{ // request public: - QNtlmPhase1Block() { - qstrncpy(magic, "NTLMSSP", 8); - type = 1; - flags = NTLMSSP_NEGOTIATE_UNICODE | NTLMSSP_NEGOTIATE_NTLM | NTLMSSP_REQUEST_TARGET; - } - - // extracted - QString domainStr, workstationStr; + QNtlmPhase1Block() + { + qstrncpy(magic, "NTLMSSP", 8); + type = 1; + flags = NTLMSSP_NEGOTIATE_UNICODE | NTLMSSP_NEGOTIATE_NTLM | NTLMSSP_REQUEST_TARGET; + } + + // extracted + QString domainStr, workstationStr; }; - class QNtlmPhase2Block : public QNtlmPhase2BlockBase -{ // challenge +{ // challenge public: - QNtlmPhase2Block() { - magic[0] = 0; - type = 0xffffffff; - } - - // extracted - QString targetNameStr, targetInfoStr; - QByteArray targetInfoBuff; + QNtlmPhase2Block() + { + magic[0] = 0; + type = 0xffffffff; + } + + // extracted + QString targetNameStr, targetInfoStr; + QByteArray targetInfoBuff; }; - - -class QNtlmPhase3Block : public QNtlmPhase3BlockBase { // response +class QNtlmPhase3Block : public QNtlmPhase3BlockBase +{ // response public: - QNtlmPhase3Block() { - qstrncpy(magic, "NTLMSSP", 8); - type = 3; - flags = NTLMSSP_NEGOTIATE_UNICODE | NTLMSSP_NEGOTIATE_NTLM | NTLMSSP_NEGOTIATE_TARGET_INFO; - } - - // extracted - QByteArray lmResponseBuf, ntlmResponseBuf; - QString domainStr, userStr, workstationStr, sessionKeyStr; - QByteArray v2Hash; + QNtlmPhase3Block() + { + qstrncpy(magic, "NTLMSSP", 8); + type = 3; + flags = NTLMSSP_NEGOTIATE_UNICODE | NTLMSSP_NEGOTIATE_NTLM | NTLMSSP_NEGOTIATE_TARGET_INFO; + } + + // extracted + QByteArray lmResponseBuf, ntlmResponseBuf; + QString domainStr, userStr, workstationStr, sessionKeyStr; + QByteArray v2Hash; }; - -static QDataStream& operator<<(QDataStream& s, const QNtlmPhase1Block& b) { - bool unicode = (b.flags & NTLMSSP_NEGOTIATE_UNICODE); - - s.writeRawData(b.magic, sizeof(b.magic)); - s << b.type; - s << b.flags; - s << b.domain; - s << b.workstation; - if (!b.domainStr.isEmpty()) - qStreamNtlmString(s, b.domainStr, unicode); - if (!b.workstationStr.isEmpty()) - qStreamNtlmString(s, b.workstationStr, unicode); - return s; +static QDataStream & operator<<(QDataStream & s, const QNtlmPhase1Block & b) +{ + bool unicode = (b.flags & NTLMSSP_NEGOTIATE_UNICODE); + + s.writeRawData(b.magic, sizeof(b.magic)); + s << b.type; + s << b.flags; + s << b.domain; + s << b.workstation; + if(!b.domainStr.isEmpty()) + qStreamNtlmString(s, b.domainStr, unicode); + if(!b.workstationStr.isEmpty()) + qStreamNtlmString(s, b.workstationStr, unicode); + return s; } - -static QDataStream& operator<<(QDataStream& s, const QNtlmPhase3Block& b) { - bool unicode = (b.flags & NTLMSSP_NEGOTIATE_UNICODE); - s.writeRawData(b.magic, sizeof(b.magic)); - s << b.type; - s << b.lmResponse; - s << b.ntlmResponse; - s << b.domain; - s << b.user; - s << b.workstation; - s << b.sessionKey; - s << b.flags; - - if (!b.domainStr.isEmpty()) - qStreamNtlmString(s, b.domainStr, unicode); - - qStreamNtlmString(s, b.userStr, unicode); - - if (!b.workstationStr.isEmpty()) - qStreamNtlmString(s, b.workstationStr, unicode); - - // Send auth info - qStreamNtlmBuffer(s, b.lmResponseBuf); - qStreamNtlmBuffer(s, b.ntlmResponseBuf); - - - return s; +static QDataStream & operator<<(QDataStream & s, const QNtlmPhase3Block & b) +{ + bool unicode = (b.flags & NTLMSSP_NEGOTIATE_UNICODE); + s.writeRawData(b.magic, sizeof(b.magic)); + s << b.type; + s << b.lmResponse; + s << b.ntlmResponse; + s << b.domain; + s << b.user; + s << b.workstation; + s << b.sessionKey; + s << b.flags; + + if(!b.domainStr.isEmpty()) + qStreamNtlmString(s, b.domainStr, unicode); + + qStreamNtlmString(s, b.userStr, unicode); + + if(!b.workstationStr.isEmpty()) + qStreamNtlmString(s, b.workstationStr, unicode); + + // Send auth info + qStreamNtlmBuffer(s, b.lmResponseBuf); + qStreamNtlmBuffer(s, b.ntlmResponseBuf); + + return s; } - static QByteArray qNtlmPhase1() { - QByteArray rc; - QDataStream ds(&rc, QIODevice::WriteOnly); - ds.setByteOrder(QDataStream::LittleEndian); - QNtlmPhase1Block pb; - ds << pb; - return rc; + QByteArray rc; + QDataStream ds(&rc, QIODevice::WriteOnly); + ds.setByteOrder(QDataStream::LittleEndian); + QNtlmPhase1Block pb; + ds << pb; + return rc; } - -static QByteArray qStringAsUcs2Le(const QString& src) +static QByteArray qStringAsUcs2Le(const QString & src) { - QByteArray rc(2*src.length(), 0); - const unsigned short *s = src.utf16(); - unsigned short *d = (unsigned short*)rc.data(); - for (int i = 0; i < src.length(); ++i) { - d[i] = qToLittleEndian(s[i]); - } - return rc; + QByteArray rc(2 * src.length(), 0); + const unsigned short * s = src.utf16(); + unsigned short * d = (unsigned short *)rc.data(); + for(int i = 0; i < src.length(); ++i) + { + d[i] = qToLittleEndian(s[i]); + } + return rc; } - -static QString qStringFromUcs2Le(const QByteArray& src) +static QString qStringFromUcs2Le(const QByteArray & src) { - Q_ASSERT(src.size() % 2 == 0); - unsigned short *d = (unsigned short*)src.data(); - for (int i = 0; i < src.length() / 2; ++i) { - d[i] = qFromLittleEndian(d[i]); - } - return QString((const QChar *)src.data(), src.size()/2); + Q_ASSERT(src.size() % 2 == 0); + unsigned short * d = (unsigned short *)src.data(); + for(int i = 0; i < src.length() / 2; ++i) + { + d[i] = qFromLittleEndian(d[i]); + } + return QString((const QChar *)src.data(), src.size() / 2); } #ifdef NTLMV1_CLIENT -static QByteArray qEncodeNtlmResponse(const QHttpAuthenticatorPrivate *ctx, const QNtlmPhase2Block& ch) +static QByteArray qEncodeNtlmResponse(const QHttpAuthenticatorPrivate * ctx, const QNtlmPhase2Block & ch) { - QCryptographicHash md4(QCryptographicHash::Md4); - QByteArray asUcs2Le = qStringAsUcs2Le(ctx->password); - md4.addData(asUcs2Le.data(), asUcs2Le.size()); - - unsigned char md4hash[22]; - memset(md4hash, 0, sizeof(md4hash)); - QByteArray hash = md4.result(); - Q_ASSERT(hash.size() == 16); - memcpy(md4hash, hash.constData(), 16); - - QByteArray rc(24, 0); - deshash((unsigned char *)rc.data(), md4hash, (unsigned char *)ch.challenge); - deshash((unsigned char *)rc.data() + 8, md4hash + 7, (unsigned char *)ch.challenge); - deshash((unsigned char *)rc.data() + 16, md4hash + 14, (unsigned char *)ch.challenge); - - hash.fill(0); - return rc; + QCryptographicHash md4(QCryptographicHash::Md4); + QByteArray asUcs2Le = qStringAsUcs2Le(ctx->password); + md4.addData(asUcs2Le.data(), asUcs2Le.size()); + + unsigned char md4hash[22]; + memset(md4hash, 0, sizeof(md4hash)); + QByteArray hash = md4.result(); + Q_ASSERT(hash.size() == 16); + memcpy(md4hash, hash.constData(), 16); + + QByteArray rc(24, 0); + deshash((unsigned char *)rc.data(), md4hash, (unsigned char *)ch.challenge); + deshash((unsigned char *)rc.data() + 8, md4hash + 7, (unsigned char *)ch.challenge); + deshash((unsigned char *)rc.data() + 16, md4hash + 14, (unsigned char *)ch.challenge); + + hash.fill(0); + return rc; } - -static QByteArray qEncodeLmResponse(const QHttpAuthenticatorPrivate *ctx, const QNtlmPhase2Block& ch) +static QByteArray qEncodeLmResponse(const QHttpAuthenticatorPrivate * ctx, const QNtlmPhase2Block & ch) { - QByteArray hash(21, 0); - QByteArray key(14, 0); - qstrncpy(key.data(), ctx->password.toUpper().toLatin1(), 14); - const char *block = "KGS!@#$%"; - - deshash((unsigned char *)hash.data(), (unsigned char *)key.data(), (unsigned char *)block); - deshash((unsigned char *)hash.data() + 8, (unsigned char *)key.data() + 7, (unsigned char *)block); - key.fill(0); - - QByteArray rc(24, 0); - deshash((unsigned char *)rc.data(), (unsigned char *)hash.data(), ch.challenge); - deshash((unsigned char *)rc.data() + 8, (unsigned char *)hash.data() + 7, ch.challenge); - deshash((unsigned char *)rc.data() + 16, (unsigned char *)hash.data() + 14, ch.challenge); - - hash.fill(0); - return rc; + QByteArray hash(21, 0); + QByteArray key(14, 0); + qstrncpy(key.data(), ctx->password.toUpper().toLatin1(), 14); + const char * block = "KGS!@#$%"; + + deshash((unsigned char *)hash.data(), (unsigned char *)key.data(), (unsigned char *)block); + deshash((unsigned char *)hash.data() + 8, (unsigned char *)key.data() + 7, (unsigned char *)block); + key.fill(0); + + QByteArray rc(24, 0); + deshash((unsigned char *)rc.data(), (unsigned char *)hash.data(), ch.challenge); + deshash((unsigned char *)rc.data() + 8, (unsigned char *)hash.data() + 7, ch.challenge); + deshash((unsigned char *)rc.data() + 16, (unsigned char *)hash.data() + 14, ch.challenge); + + hash.fill(0); + return rc; } #endif @@ -1126,320 +1153,330 @@ static QByteArray qEncodeLmResponse(const QHttpAuthenticatorPrivate *ctx, const * --------------------------------------- * *********************************************************************/ -QByteArray qEncodeHmacMd5(QByteArray &key, const QByteArray &message) +QByteArray qEncodeHmacMd5(QByteArray & key, const QByteArray & message) { - Q_ASSERT_X(!(message.isEmpty()),"qEncodeHmacMd5", "Empty message check"); - Q_ASSERT_X(!(key.isEmpty()),"qEncodeHmacMd5", "Empty key check"); + Q_ASSERT_X(!(message.isEmpty()), "qEncodeHmacMd5", "Empty message check"); + Q_ASSERT_X(!(key.isEmpty()), "qEncodeHmacMd5", "Empty key check"); - QCryptographicHash hash(QCryptographicHash::Md5); - QByteArray hMsg; + QCryptographicHash hash(QCryptographicHash::Md5); + QByteArray hMsg; - QByteArray iKeyPad(blockSize, 0x36); - QByteArray oKeyPad(blockSize, 0x5c); + QByteArray iKeyPad(blockSize, 0x36); + QByteArray oKeyPad(blockSize, 0x5c); - hash.reset(); - // Adjust the key length to blockSize + hash.reset(); + // Adjust the key length to blockSize - if(blockSize < key.length()) { - hash.addData(key); - key = hash.result(); //MD5 will always return 16 bytes length output - } + if(blockSize < key.length()) + { + hash.addData(key); + key = hash.result(); //MD5 will always return 16 bytes length output + } - //Key will be <= 16 or 20 bytes as hash function (MD5 or SHA hash algorithms) - //key size can be max of Block size only - key = key.leftJustified(blockSize,0,true); + //Key will be <= 16 or 20 bytes as hash function (MD5 or SHA hash algorithms) + //key size can be max of Block size only + key = key.leftJustified(blockSize, 0, true); - //iKeyPad, oKeyPad and key are all of same size "blockSize" + //iKeyPad, oKeyPad and key are all of same size "blockSize" - //xor of iKeyPad with Key and store the result into iKeyPad - for(int i = 0; iv2Hash.size() == 0) { - QCryptographicHash md4(QCryptographicHash::Md4); - QByteArray passUnicode = qStringAsUcs2Le(ctx->password); - md4.addData(passUnicode.data(), passUnicode.size()); - - QByteArray hashKey = md4.result(); - Q_ASSERT(hashKey.size() == 16); - // Assuming the user and domain is always unicode in challenge - QByteArray message = - qStringAsUcs2Le(ctx->extractedUser.toUpper()) + - qStringAsUcs2Le(phase3->domainStr); - - phase3->v2Hash = qEncodeHmacMd5(hashKey, message); - } - return phase3->v2Hash; + Q_ASSERT(phase3 != 0); + // since v2 Hash is need for both NTLMv2 and LMv2 it is calculated + // only once and stored and reused + if(phase3->v2Hash.size() == 0) + { + QCryptographicHash md4(QCryptographicHash::Md4); + QByteArray passUnicode = qStringAsUcs2Le(ctx->password); + md4.addData(passUnicode.data(), passUnicode.size()); + + QByteArray hashKey = md4.result(); + Q_ASSERT(hashKey.size() == 16); + // Assuming the user and domain is always unicode in challenge + QByteArray message = qStringAsUcs2Le(ctx->extractedUser.toUpper()) + qStringAsUcs2Le(phase3->domainStr); + + phase3->v2Hash = qEncodeHmacMd5(hashKey, message); + } + return phase3->v2Hash; } -static QByteArray clientChallenge(const QHttpAuthenticatorPrivate *ctx) +static QByteArray clientChallenge(const QHttpAuthenticatorPrivate * ctx) { - Q_ASSERT(ctx->cnonce.size() >= 8); - QByteArray clientCh = ctx->cnonce.right(8); - return clientCh; + Q_ASSERT(ctx->cnonce.size() >= 8); + QByteArray clientCh = ctx->cnonce.right(8); + return clientCh; } // caller has to ensure a valid targetInfoBuff -static QByteArray qExtractServerTime(const QByteArray& targetInfoBuff) +static QByteArray qExtractServerTime(const QByteArray & targetInfoBuff) { - QByteArray timeArray; - QDataStream ds(targetInfoBuff); - ds.setByteOrder(QDataStream::LittleEndian); - - quint16 avId; - quint16 avLen; - - ds >> avId; - ds >> avLen; - while(avId != 0) { - if(avId == AVTIMESTAMP) { - timeArray.resize(avLen); - //avLen size of QByteArray is allocated - ds.readRawData(timeArray.data(), avLen); - break; - } - ds.skipRawData(avLen); - ds >> avId; - ds >> avLen; - } - return timeArray; + QByteArray timeArray; + QDataStream ds(targetInfoBuff); + ds.setByteOrder(QDataStream::LittleEndian); + + quint16 avId; + quint16 avLen; + + ds >> avId; + ds >> avLen; + while(avId != 0) + { + if(avId == AVTIMESTAMP) + { + timeArray.resize(avLen); + //avLen size of QByteArray is allocated + ds.readRawData(timeArray.data(), avLen); + break; + } + ds.skipRawData(avLen); + ds >> avId; + ds >> avLen; + } + return timeArray; } -static QByteArray qEncodeNtlmv2Response(const QHttpAuthenticatorPrivate *ctx, - const QNtlmPhase2Block& ch, - QNtlmPhase3Block *phase3) +static QByteArray qEncodeNtlmv2Response(const QHttpAuthenticatorPrivate * ctx, + const QNtlmPhase2Block & ch, + QNtlmPhase3Block * phase3) { - Q_ASSERT(phase3 != 0); - // return value stored in phase3 - qCreatev2Hash(ctx, phase3); - - QByteArray temp; - QDataStream ds(&temp, QIODevice::WriteOnly); - ds.setByteOrder(QDataStream::LittleEndian); - - ds << respversion; - ds << hirespversion; - - //Reserved - QByteArray reserved1(6, 0); - ds.writeRawData(reserved1.constData(), reserved1.size()); - - quint64 time = 0; - QByteArray timeArray; - - if(ch.targetInfo.len) - { - timeArray = qExtractServerTime(ch.targetInfoBuff); - } - - //if server sends time, use it instead of current time - if(timeArray.size()) { - ds.writeRawData(timeArray.constData(), timeArray.size()); - } else { - QDateTime currentTime(QDate::currentDate(), - QTime::currentTime(), Qt::UTC); - - // number of seconds between 1601 and epoc(1970) - // 369 years, 89 leap years - // ((369 * 365) + 89) * 24 * 3600 = 11644473600 - - time = Q_UINT64_C(currentTime.toTime_t() + 11644473600); - - // represented as 100 nano seconds - time = Q_UINT64_C(time * 10000000); - ds << time; - } - - //8 byte client challenge - QByteArray clientCh = clientChallenge(ctx); - ds.writeRawData(clientCh.constData(), clientCh.size()); - - //Reserved - QByteArray reserved2(4, 0); - ds.writeRawData(reserved2.constData(), reserved2.size()); - - if (ch.targetInfo.len > 0) { - ds.writeRawData(ch.targetInfoBuff.constData(), - ch.targetInfoBuff.size()); - } - - //Reserved - QByteArray reserved3(4, 0); - ds.writeRawData(reserved3.constData(), reserved3.size()); - - QByteArray message((const char*)ch.challenge, sizeof(ch.challenge)); - message.append(temp); - - QByteArray ntChallengeResp = qEncodeHmacMd5(phase3->v2Hash, message); - ntChallengeResp.append(temp); - - return ntChallengeResp; + Q_ASSERT(phase3 != 0); + // return value stored in phase3 + qCreatev2Hash(ctx, phase3); + + QByteArray temp; + QDataStream ds(&temp, QIODevice::WriteOnly); + ds.setByteOrder(QDataStream::LittleEndian); + + ds << respversion; + ds << hirespversion; + + //Reserved + QByteArray reserved1(6, 0); + ds.writeRawData(reserved1.constData(), reserved1.size()); + + quint64 time = 0; + QByteArray timeArray; + + if(ch.targetInfo.len) + { + timeArray = qExtractServerTime(ch.targetInfoBuff); + } + + //if server sends time, use it instead of current time + if(timeArray.size()) + { + ds.writeRawData(timeArray.constData(), timeArray.size()); + } + else + { + QDateTime currentTime(QDate::currentDate(), + QTime::currentTime(), Qt::UTC); + + // number of seconds between 1601 and epoc(1970) + // 369 years, 89 leap years + // ((369 * 365) + 89) * 24 * 3600 = 11644473600 + + time = Q_UINT64_C(currentTime.toTime_t() + 11644473600); + + // represented as 100 nano seconds + time = Q_UINT64_C(time * 10000000); + ds << time; + } + + //8 byte client challenge + QByteArray clientCh = clientChallenge(ctx); + ds.writeRawData(clientCh.constData(), clientCh.size()); + + //Reserved + QByteArray reserved2(4, 0); + ds.writeRawData(reserved2.constData(), reserved2.size()); + + if(ch.targetInfo.len > 0) + { + ds.writeRawData(ch.targetInfoBuff.constData(), + ch.targetInfoBuff.size()); + } + + //Reserved + QByteArray reserved3(4, 0); + ds.writeRawData(reserved3.constData(), reserved3.size()); + + QByteArray message((const char *)ch.challenge, sizeof(ch.challenge)); + message.append(temp); + + QByteArray ntChallengeResp = qEncodeHmacMd5(phase3->v2Hash, message); + ntChallengeResp.append(temp); + + return ntChallengeResp; } -static QByteArray qEncodeLmv2Response(const QHttpAuthenticatorPrivate *ctx, - const QNtlmPhase2Block& ch, - QNtlmPhase3Block *phase3) +static QByteArray qEncodeLmv2Response(const QHttpAuthenticatorPrivate * ctx, + const QNtlmPhase2Block & ch, + QNtlmPhase3Block * phase3) { - Q_ASSERT(phase3 != 0); - // return value stored in phase3 - qCreatev2Hash(ctx, phase3); + Q_ASSERT(phase3 != 0); + // return value stored in phase3 + qCreatev2Hash(ctx, phase3); - QByteArray message((const char*)ch.challenge, sizeof(ch.challenge)); - QByteArray clientCh = clientChallenge(ctx); + QByteArray message((const char *)ch.challenge, sizeof(ch.challenge)); + QByteArray clientCh = clientChallenge(ctx); - message.append(clientCh); + message.append(clientCh); - QByteArray lmChallengeResp = qEncodeHmacMd5(phase3->v2Hash, message); - lmChallengeResp.append(clientCh); + QByteArray lmChallengeResp = qEncodeHmacMd5(phase3->v2Hash, message); + lmChallengeResp.append(clientCh); - return lmChallengeResp; + return lmChallengeResp; } -static bool qNtlmDecodePhase2(const QByteArray& data, QNtlmPhase2Block& ch) +static bool qNtlmDecodePhase2(const QByteArray & data, QNtlmPhase2Block & ch) { - Q_ASSERT(QNtlmPhase2BlockBase::Size == sizeof(QNtlmPhase2BlockBase)); - if (data.size() < QNtlmPhase2BlockBase::Size) - return false; - - - QDataStream ds(data); - ds.setByteOrder(QDataStream::LittleEndian); - if (ds.readRawData(ch.magic, 8) < 8) - return false; - if (strncmp(ch.magic, "NTLMSSP", 8) != 0) - return false; - - ds >> ch.type; - if (ch.type != 2) - return false; - - ds >> ch.targetName; - ds >> ch.flags; - if (ds.readRawData((char *)ch.challenge, 8) < 8) - return false; - ds >> ch.context[0] >> ch.context[1]; - ds >> ch.targetInfo; - - if (ch.targetName.len > 0) { - if (ch.targetName.len + ch.targetName.offset >= (unsigned)data.size()) - return false; - - ch.targetNameStr = qStringFromUcs2Le(data.mid(ch.targetName.offset, ch.targetName.len)); - } - - if (ch.targetInfo.len > 0) { - if (ch.targetInfo.len + ch.targetInfo.offset > (unsigned)data.size()) - return false; - - ch.targetInfoBuff = data.mid(ch.targetInfo.offset, ch.targetInfo.len); - } - - return true; + Q_ASSERT(QNtlmPhase2BlockBase::Size == sizeof(QNtlmPhase2BlockBase)); + if(data.size() < QNtlmPhase2BlockBase::Size) + return false; + + QDataStream ds(data); + ds.setByteOrder(QDataStream::LittleEndian); + if(ds.readRawData(ch.magic, 8) < 8) + return false; + if(strncmp(ch.magic, "NTLMSSP", 8) != 0) + return false; + + ds >> ch.type; + if(ch.type != 2) + return false; + + ds >> ch.targetName; + ds >> ch.flags; + if(ds.readRawData((char *)ch.challenge, 8) < 8) + return false; + ds >> ch.context[0] >> ch.context[1]; + ds >> ch.targetInfo; + + if(ch.targetName.len > 0) + { + if(ch.targetName.len + ch.targetName.offset >= (unsigned)data.size()) + return false; + + ch.targetNameStr = qStringFromUcs2Le(data.mid(ch.targetName.offset, ch.targetName.len)); + } + + if(ch.targetInfo.len > 0) + { + if(ch.targetInfo.len + ch.targetInfo.offset > (unsigned)data.size()) + return false; + + ch.targetInfoBuff = data.mid(ch.targetInfo.offset, ch.targetInfo.len); + } + + return true; } - -static QByteArray qNtlmPhase3(QHttpAuthenticatorPrivate *ctx, const QByteArray& phase2data) +static QByteArray qNtlmPhase3(QHttpAuthenticatorPrivate * ctx, const QByteArray & phase2data) { - QNtlmPhase2Block ch; - if (!qNtlmDecodePhase2(phase2data, ch)) - return QByteArray(); - - QByteArray rc; - QDataStream ds(&rc, QIODevice::WriteOnly); - ds.setByteOrder(QDataStream::LittleEndian); - QNtlmPhase3Block pb; - - bool unicode = ch.flags & NTLMSSP_NEGOTIATE_UNICODE; - - pb.flags = NTLMSSP_NEGOTIATE_NTLM; - if (unicode) - pb.flags |= NTLMSSP_NEGOTIATE_UNICODE; - else - pb.flags |= NTLMSSP_NEGOTIATE_OEM; - - - int offset = QNtlmPhase3BlockBase::Size; - Q_ASSERT(QNtlmPhase3BlockBase::Size == sizeof(QNtlmPhase3BlockBase)); - - // for kerberos style user@domain logins, NTLM domain string should be left empty - if (ctx->userDomain.isEmpty() && !ctx->extractedUser.contains(QLatin1Char('@'))) { - offset = qEncodeNtlmString(pb.domain, offset, ch.targetNameStr, unicode); - pb.domainStr = ch.targetNameStr; - } else { - offset = qEncodeNtlmString(pb.domain, offset, ctx->userDomain, unicode); - pb.domainStr = ctx->userDomain; - } - - offset = qEncodeNtlmString(pb.user, offset, ctx->extractedUser, unicode); - pb.userStr = ctx->extractedUser; - - offset = qEncodeNtlmString(pb.workstation, offset, ctx->workstation, unicode); - pb.workstationStr = ctx->workstation; - - // Get LM response + QNtlmPhase2Block ch; + if(!qNtlmDecodePhase2(phase2data, ch)) + return QByteArray(); + + QByteArray rc; + QDataStream ds(&rc, QIODevice::WriteOnly); + ds.setByteOrder(QDataStream::LittleEndian); + QNtlmPhase3Block pb; + + bool unicode = ch.flags & NTLMSSP_NEGOTIATE_UNICODE; + + pb.flags = NTLMSSP_NEGOTIATE_NTLM; + if(unicode) + pb.flags |= NTLMSSP_NEGOTIATE_UNICODE; + else + pb.flags |= NTLMSSP_NEGOTIATE_OEM; + + int offset = QNtlmPhase3BlockBase::Size; + Q_ASSERT(QNtlmPhase3BlockBase::Size == sizeof(QNtlmPhase3BlockBase)); + + // for kerberos style user@domain logins, NTLM domain string should be left empty + if(ctx->userDomain.isEmpty() && !ctx->extractedUser.contains(QLatin1Char('@'))) + { + offset = qEncodeNtlmString(pb.domain, offset, ch.targetNameStr, unicode); + pb.domainStr = ch.targetNameStr; + } + else + { + offset = qEncodeNtlmString(pb.domain, offset, ctx->userDomain, unicode); + pb.domainStr = ctx->userDomain; + } + + offset = qEncodeNtlmString(pb.user, offset, ctx->extractedUser, unicode); + pb.userStr = ctx->extractedUser; + + offset = qEncodeNtlmString(pb.workstation, offset, ctx->workstation, unicode); + pb.workstationStr = ctx->workstation; + +// Get LM response #ifdef NTLMV1_CLIENT - pb.lmResponseBuf = qEncodeLmResponse(ctx, ch); + pb.lmResponseBuf = qEncodeLmResponse(ctx, ch); #else - if (ch.targetInfo.len > 0) { - pb.lmResponseBuf = QByteArray(); - } else { - pb.lmResponseBuf = qEncodeLmv2Response(ctx, ch, &pb); - } + if(ch.targetInfo.len > 0) + { + pb.lmResponseBuf = QByteArray(); + } + else + { + pb.lmResponseBuf = qEncodeLmv2Response(ctx, ch, &pb); + } #endif - offset = qEncodeNtlmBuffer(pb.lmResponse, offset, pb.lmResponseBuf); + offset = qEncodeNtlmBuffer(pb.lmResponse, offset, pb.lmResponseBuf); - // Get NTLM response +// Get NTLM response #ifdef NTLMV1_CLIENT - pb.ntlmResponseBuf = qEncodeNtlmResponse(ctx, ch); + pb.ntlmResponseBuf = qEncodeNtlmResponse(ctx, ch); #else - pb.ntlmResponseBuf = qEncodeNtlmv2Response(ctx, ch, &pb); + pb.ntlmResponseBuf = qEncodeNtlmv2Response(ctx, ch, &pb); #endif - offset = qEncodeNtlmBuffer(pb.ntlmResponse, offset, pb.ntlmResponseBuf); - + offset = qEncodeNtlmBuffer(pb.ntlmResponse, offset, pb.ntlmResponseBuf); - // Encode and send - ds << pb; + // Encode and send + ds << pb; - return rc; + return rc; } - - QT_END_NAMESPACE diff --git a/src/modules/objects/qthttp/qhttpauthenticator_p.h b/src/modules/objects/qthttp/qhttpauthenticator_p.h index 54b4c3536..1c9a26b76 100644 --- a/src/modules/objects/qthttp/qhttpauthenticator_p.h +++ b/src/modules/objects/qthttp/qhttpauthenticator_p.h @@ -67,82 +67,92 @@ class QUrl; class QHttpAuthenticator { public: - QHttpAuthenticator(); - ~QHttpAuthenticator(); + QHttpAuthenticator(); + ~QHttpAuthenticator(); - QHttpAuthenticator(const QHttpAuthenticator &other); - QHttpAuthenticator &operator=(const QHttpAuthenticator &other); + QHttpAuthenticator(const QHttpAuthenticator & other); + QHttpAuthenticator & operator=(const QHttpAuthenticator & other); - bool operator==(const QHttpAuthenticator &other) const; - inline bool operator!=(const QHttpAuthenticator &other) const { return !operator==(other); } + bool operator==(const QHttpAuthenticator & other) const; + inline bool operator!=(const QHttpAuthenticator & other) const { return !operator==(other); } - QString user() const; - void setUser(const QString &user); + QString user() const; + void setUser(const QString & user); - QString password() const; - void setPassword(const QString &password); + QString password() const; + void setPassword(const QString & password); - QString realm() const; + QString realm() const; - QVariant option(const QString &opt) const; - QVariantHash options() const; - void setOption(const QString &opt, const QVariant &value); + QVariant option(const QString & opt) const; + QVariantHash options() const; + void setOption(const QString & opt, const QVariant & value); - bool isNull() const; - void detach(); + bool isNull() const; + void detach(); + + QHttpAuthenticator & operator=(const QAuthenticator & auth); + QAuthenticator toQAuthenticator(); - QHttpAuthenticator &operator=(const QAuthenticator& auth); - QAuthenticator toQAuthenticator(); private: - friend class QHttpAuthenticatorPrivate; - QHttpAuthenticatorPrivate *d; + friend class QHttpAuthenticatorPrivate; + QHttpAuthenticatorPrivate * d; }; class QHttpAuthenticatorPrivate { public: - enum Method { None, Basic, Plain, Login, Ntlm, CramMd5, DigestMd5 }; - QHttpAuthenticatorPrivate(); - - QAtomicInt ref; - QString user; - QString extractedUser; - QString password; - QVariantHash options; - Method method; - QString realm; - QByteArray challenge; - bool hasFailed; //credentials have been tried but rejected by server. - - enum Phase { - Start, - Phase2, - Done, - Invalid - }; - Phase phase; - - // digest specific - QByteArray cnonce; - int nonceCount; - - // ntlm specific - QString workstation; - QString userDomain; - - QByteArray calculateResponse(const QByteArray &method, const QByteArray &path); - - inline static QHttpAuthenticatorPrivate *getPrivate(QHttpAuthenticator &auth) { return auth.d; } - inline static const QHttpAuthenticatorPrivate *getPrivate(const QHttpAuthenticator &auth) { return auth.d; } - - QByteArray digestMd5Response(const QByteArray &challenge, const QByteArray &method, const QByteArray &path); - static QHash parseDigestAuthenticationChallenge(const QByteArray &challenge); + enum Method + { + None, + Basic, + Plain, + Login, + Ntlm, + CramMd5, + DigestMd5 + }; + QHttpAuthenticatorPrivate(); + + QAtomicInt ref; + QString user; + QString extractedUser; + QString password; + QVariantHash options; + Method method; + QString realm; + QByteArray challenge; + bool hasFailed; //credentials have been tried but rejected by server. + + enum Phase + { + Start, + Phase2, + Done, + Invalid + }; + Phase phase; + + // digest specific + QByteArray cnonce; + int nonceCount; + + // ntlm specific + QString workstation; + QString userDomain; + + QByteArray calculateResponse(const QByteArray & method, const QByteArray & path); + + inline static QHttpAuthenticatorPrivate * getPrivate(QHttpAuthenticator & auth) { return auth.d; } + inline static const QHttpAuthenticatorPrivate * getPrivate(const QHttpAuthenticator & auth) { return auth.d; } + + QByteArray digestMd5Response(const QByteArray & challenge, const QByteArray & method, const QByteArray & path); + static QHash parseDigestAuthenticationChallenge(const QByteArray & challenge); #ifndef QT_NO_HTTP - void parseHttpResponse(const QHttpResponseHeader &, bool isProxy); + void parseHttpResponse(const QHttpResponseHeader &, bool isProxy); #endif - void parseHttpResponse(const QList >&, bool isProxy); - + void parseHttpResponse(const QList> &, bool isProxy); }; #endif diff --git a/src/modules/objects/qthttp/qringbuffer_p.h b/src/modules/objects/qthttp/qringbuffer_p.h index ff762fab2..b1690af52 100644 --- a/src/modules/objects/qthttp/qringbuffer_p.h +++ b/src/modules/objects/qthttp/qringbuffer_p.h @@ -59,389 +59,445 @@ class QRingBuffer { public: - inline QRingBuffer(int growth = 4096) : basicBlockSize(growth) { - buffers << QByteArray(); - clear(); - } - - inline int nextDataBlockSize() const { - return (tailBuffer == 0 ? tail : buffers.first().size()) - head; - } - - inline const char *readPointer() const { - return buffers.isEmpty() ? 0 : (buffers.first().constData() + head); - } - - // access the bytes at a specified position - // the out-variable length will contain the amount of bytes readable - // from there, e.g. the amount still the same QByteArray - inline const char *readPointerAtPosition(qint64 pos, qint64 &length) const { - if (buffers.isEmpty()) { - length = 0; - return 0; - } - - if (pos >= bufferSize) { - length = 0; - return 0; - } - - // special case: it is in the first buffer - int nextDataBlockSizeValue = nextDataBlockSize(); - if (pos - head < nextDataBlockSizeValue) { - length = nextDataBlockSizeValue - pos; - return buffers.at(0).constData() + head + pos; - } - - // special case: we only had one buffer and tried to read over it - if (buffers.length() == 1) { - length = 0; - return 0; - } - - // skip the first - pos -= nextDataBlockSizeValue; - - // normal case: it is somewhere in the second to the-one-before-the-tailBuffer - for (int i = 1; i < tailBuffer; i++) { - if (pos >= buffers[i].size()) { - pos -= buffers[i].size(); - continue; - } - - length = buffers[i].length() - pos; - return buffers[i].constData() + pos; - } - - // it is in the tail buffer - length = tail - pos; - return buffers[tailBuffer].constData() + pos; - } - - inline void free(int bytes) { - bufferSize -= bytes; - if (bufferSize < 0) - bufferSize = 0; - - for (;;) { - int nextBlockSize = nextDataBlockSize(); - if (bytes < nextBlockSize) { - head += bytes; - if (head == tail && tailBuffer == 0) - head = tail = 0; - break; - } - - bytes -= nextBlockSize; - if (buffers.count() == 1) { - if (buffers.at(0).size() != basicBlockSize) - buffers[0].resize(basicBlockSize); - head = tail = 0; - tailBuffer = 0; - break; - } - - buffers.removeAt(0); - --tailBuffer; - head = 0; - } - - if (isEmpty()) - clear(); // try to minify/squeeze us - } - - inline char *reserve(int bytes) { - // if this is a fresh empty QRingBuffer - if (bufferSize == 0) { - buffers[0].resize(qMax(basicBlockSize, bytes)); - bufferSize += bytes; - tail = bytes; - return buffers[tailBuffer].data(); - } - - bufferSize += bytes; - - // if there is already enough space, simply return. - if (tail + bytes <= buffers.at(tailBuffer).size()) { - char *writePtr = buffers[tailBuffer].data() + tail; - tail += bytes; - return writePtr; - } - - // if our buffer isn't half full yet, simply resize it. - if (tail < buffers.at(tailBuffer).size() / 2) { - buffers[tailBuffer].resize(tail + bytes); - char *writePtr = buffers[tailBuffer].data() + tail; - tail += bytes; - return writePtr; - } - - // shrink this buffer to its current size - buffers[tailBuffer].resize(tail); - - // create a new QByteArray with the right size - buffers << QByteArray(); - ++tailBuffer; - buffers[tailBuffer].resize(qMax(basicBlockSize, bytes)); - tail = bytes; - return buffers[tailBuffer].data(); - } - - inline void truncate(int pos) { - if (pos < size()) - chop(size() - pos); - } - - inline void chop(int bytes) { - bufferSize -= bytes; - if (bufferSize < 0) - bufferSize = 0; - - for (;;) { - // special case: head and tail are in the same buffer - if (tailBuffer == 0) { - tail -= bytes; - if (tail <= head) - tail = head = 0; - return; - } - - if (bytes <= tail) { - tail -= bytes; - return; - } - - bytes -= tail; - buffers.removeAt(tailBuffer); - - --tailBuffer; - tail = buffers.at(tailBuffer).size(); - } - - if (isEmpty()) - clear(); // try to minify/squeeze us - } - - inline bool isEmpty() const { - return tailBuffer == 0 && tail == 0; - } - - inline int getChar() { - if (isEmpty()) - return -1; - char c = *readPointer(); - free(1); - return int(uchar(c)); - } - - inline void putChar(char c) { - char *ptr = reserve(1); - *ptr = c; - } - - inline void ungetChar(char c) { - --head; - if (head < 0) { - buffers.prepend(QByteArray()); - buffers[0].resize(basicBlockSize); - head = basicBlockSize - 1; - ++tailBuffer; - } - buffers[0][head] = c; - ++bufferSize; - } - - inline int size() const { - return bufferSize; - } - - inline void clear() { - buffers.erase(buffers.begin() + 1, buffers.end()); - buffers[0].resize(0); - buffers[0].squeeze(); - - head = tail = 0; - tailBuffer = 0; - bufferSize = 0; - } - - inline int indexOf(char c) const { - int index = 0; - for (int i = 0; i < buffers.size(); ++i) { - int start = 0; - int end = buffers.at(i).size(); - - if (i == 0) - start = head; - if (i == tailBuffer) - end = tail; - const char *ptr = buffers.at(i).data() + start; - for (int j = start; j < end; ++j) { - if (*ptr++ == c) - return index; - ++index; - } - } - return -1; - } - - inline int indexOf(char c, int maxLength) const { - int index = 0; - int remain = qMin(size(), maxLength); - for (int i = 0; remain && i < buffers.size(); ++i) { - int start = 0; - int end = buffers.at(i).size(); - - if (i == 0) - start = head; - if (i == tailBuffer) - end = tail; - if (remain < end - start) { - end = start + remain; - remain = 0; - } else { - remain -= end - start; - } - const char *ptr = buffers.at(i).data() + start; - for (int j = start; j < end; ++j) { - if (*ptr++ == c) - return index; - ++index; - } - } - return -1; - } - - inline int read(char *data, int maxLength) { - int bytesToRead = qMin(size(), maxLength); - int readSoFar = 0; - while (readSoFar < bytesToRead) { - const char *ptr = readPointer(); - int bytesToReadFromThisBlock = qMin(bytesToRead - readSoFar, nextDataBlockSize()); - if (data) - memcpy(data + readSoFar, ptr, bytesToReadFromThisBlock); - readSoFar += bytesToReadFromThisBlock; - free(bytesToReadFromThisBlock); - } - return readSoFar; - } - - inline QByteArray read(int maxLength) { - QByteArray tmp; - tmp.resize(qMin(maxLength, size())); - read(tmp.data(), tmp.size()); - return tmp; - } - - inline QByteArray readAll() { - return read(size()); - } - - // read an unspecified amount (will read the first buffer) - inline QByteArray read() { - if (bufferSize == 0) - return QByteArray(); - - // multiple buffers, just take the first one - if (head == 0 && tailBuffer != 0) { - QByteArray qba = buffers.takeFirst(); - --tailBuffer; - bufferSize -= qba.length(); - return qba; - } - - // one buffer with good value for head. Just take it. - if (head == 0 && tailBuffer == 0) { - QByteArray qba = buffers.takeFirst(); - qba.resize(tail); - buffers << QByteArray(); - bufferSize = 0; - tail = 0; - return qba; - } - - // Bad case: We have to memcpy. - // We can avoid by initializing the QRingBuffer with basicBlockSize of 0 - // and only using this read() function. - QByteArray qba(readPointer(), nextDataBlockSize()); - buffers.removeFirst(); - head = 0; - if (tailBuffer == 0) { - buffers << QByteArray(); - tail = 0; - } else { - --tailBuffer; - } - bufferSize -= qba.length(); - return qba; - } - - // append a new buffer to the end - inline void append(const QByteArray &qba) { - buffers[tailBuffer].resize(tail); - buffers << qba; - ++tailBuffer; - tail = qba.length(); - bufferSize += qba.length(); - } - - inline QByteArray peek(int maxLength) const { - int bytesToRead = qMin(size(), maxLength); - if(maxLength <= 0) - return QByteArray(); - QByteArray ret; - ret.resize(bytesToRead); - int readSoFar = 0; - for (int i = 0; readSoFar < bytesToRead && i < buffers.size(); ++i) { - int start = 0; - int end = buffers.at(i).size(); - if (i == 0) - start = head; - if (i == tailBuffer) - end = tail; - const int len = qMin(ret.size()-readSoFar, end-start); - memcpy(ret.data()+readSoFar, buffers.at(i).constData()+start, len); - readSoFar += len; - } - Q_ASSERT(readSoFar == ret.size()); - return ret; - } - - inline int skip(int length) { - return read(0, length); - } - - inline int readLine(char *data, int maxLength) { - int index = indexOf('\n'); - if (index == -1) - return read(data, maxLength); - if (maxLength <= 0) - return -1; - - int readSoFar = 0; - while (readSoFar < index + 1 && readSoFar < maxLength - 1) { - int bytesToRead = qMin((index + 1) - readSoFar, nextDataBlockSize()); - bytesToRead = qMin(bytesToRead, (maxLength - 1) - readSoFar); - memcpy(data + readSoFar, readPointer(), bytesToRead); - readSoFar += bytesToRead; - free(bytesToRead); - } - - // Terminate it. - data[readSoFar] = '\0'; - return readSoFar; - } - - inline bool canReadLine() const { - return indexOf('\n') != -1; - } + inline QRingBuffer(int growth = 4096) : basicBlockSize(growth) + { + buffers << QByteArray(); + clear(); + } + + inline int nextDataBlockSize() const + { + return (tailBuffer == 0 ? tail : buffers.first().size()) - head; + } + + inline const char * readPointer() const + { + return buffers.isEmpty() ? 0 : (buffers.first().constData() + head); + } + + // access the bytes at a specified position + // the out-variable length will contain the amount of bytes readable + // from there, e.g. the amount still the same QByteArray + inline const char * readPointerAtPosition(qint64 pos, qint64 & length) const + { + if(buffers.isEmpty()) + { + length = 0; + return 0; + } + + if(pos >= bufferSize) + { + length = 0; + return 0; + } + + // special case: it is in the first buffer + int nextDataBlockSizeValue = nextDataBlockSize(); + if(pos - head < nextDataBlockSizeValue) + { + length = nextDataBlockSizeValue - pos; + return buffers.at(0).constData() + head + pos; + } + + // special case: we only had one buffer and tried to read over it + if(buffers.length() == 1) + { + length = 0; + return 0; + } + + // skip the first + pos -= nextDataBlockSizeValue; + + // normal case: it is somewhere in the second to the-one-before-the-tailBuffer + for(int i = 1; i < tailBuffer; i++) + { + if(pos >= buffers[i].size()) + { + pos -= buffers[i].size(); + continue; + } + + length = buffers[i].length() - pos; + return buffers[i].constData() + pos; + } + + // it is in the tail buffer + length = tail - pos; + return buffers[tailBuffer].constData() + pos; + } + + inline void free(int bytes) + { + bufferSize -= bytes; + if(bufferSize < 0) + bufferSize = 0; + + for(;;) + { + int nextBlockSize = nextDataBlockSize(); + if(bytes < nextBlockSize) + { + head += bytes; + if(head == tail && tailBuffer == 0) + head = tail = 0; + break; + } + + bytes -= nextBlockSize; + if(buffers.count() == 1) + { + if(buffers.at(0).size() != basicBlockSize) + buffers[0].resize(basicBlockSize); + head = tail = 0; + tailBuffer = 0; + break; + } + + buffers.removeAt(0); + --tailBuffer; + head = 0; + } + + if(isEmpty()) + clear(); // try to minify/squeeze us + } + + inline char * reserve(int bytes) + { + // if this is a fresh empty QRingBuffer + if(bufferSize == 0) + { + buffers[0].resize(qMax(basicBlockSize, bytes)); + bufferSize += bytes; + tail = bytes; + return buffers[tailBuffer].data(); + } + + bufferSize += bytes; + + // if there is already enough space, simply return. + if(tail + bytes <= buffers.at(tailBuffer).size()) + { + char * writePtr = buffers[tailBuffer].data() + tail; + tail += bytes; + return writePtr; + } + + // if our buffer isn't half full yet, simply resize it. + if(tail < buffers.at(tailBuffer).size() / 2) + { + buffers[tailBuffer].resize(tail + bytes); + char * writePtr = buffers[tailBuffer].data() + tail; + tail += bytes; + return writePtr; + } + + // shrink this buffer to its current size + buffers[tailBuffer].resize(tail); + + // create a new QByteArray with the right size + buffers << QByteArray(); + ++tailBuffer; + buffers[tailBuffer].resize(qMax(basicBlockSize, bytes)); + tail = bytes; + return buffers[tailBuffer].data(); + } + + inline void truncate(int pos) + { + if(pos < size()) + chop(size() - pos); + } + + inline void chop(int bytes) + { + bufferSize -= bytes; + if(bufferSize < 0) + bufferSize = 0; + + for(;;) + { + // special case: head and tail are in the same buffer + if(tailBuffer == 0) + { + tail -= bytes; + if(tail <= head) + tail = head = 0; + return; + } + + if(bytes <= tail) + { + tail -= bytes; + return; + } + + bytes -= tail; + buffers.removeAt(tailBuffer); + + --tailBuffer; + tail = buffers.at(tailBuffer).size(); + } + + if(isEmpty()) + clear(); // try to minify/squeeze us + } + + inline bool isEmpty() const + { + return tailBuffer == 0 && tail == 0; + } + + inline int getChar() + { + if(isEmpty()) + return -1; + char c = *readPointer(); + free(1); + return int(uchar(c)); + } + + inline void putChar(char c) + { + char * ptr = reserve(1); + *ptr = c; + } + + inline void ungetChar(char c) + { + --head; + if(head < 0) + { + buffers.prepend(QByteArray()); + buffers[0].resize(basicBlockSize); + head = basicBlockSize - 1; + ++tailBuffer; + } + buffers[0][head] = c; + ++bufferSize; + } + + inline int size() const + { + return bufferSize; + } + + inline void clear() + { + buffers.erase(buffers.begin() + 1, buffers.end()); + buffers[0].resize(0); + buffers[0].squeeze(); + + head = tail = 0; + tailBuffer = 0; + bufferSize = 0; + } + + inline int indexOf(char c) const + { + int index = 0; + for(int i = 0; i < buffers.size(); ++i) + { + int start = 0; + int end = buffers.at(i).size(); + + if(i == 0) + start = head; + if(i == tailBuffer) + end = tail; + const char * ptr = buffers.at(i).data() + start; + for(int j = start; j < end; ++j) + { + if(*ptr++ == c) + return index; + ++index; + } + } + return -1; + } + + inline int indexOf(char c, int maxLength) const + { + int index = 0; + int remain = qMin(size(), maxLength); + for(int i = 0; remain && i < buffers.size(); ++i) + { + int start = 0; + int end = buffers.at(i).size(); + + if(i == 0) + start = head; + if(i == tailBuffer) + end = tail; + if(remain < end - start) + { + end = start + remain; + remain = 0; + } + else + { + remain -= end - start; + } + const char * ptr = buffers.at(i).data() + start; + for(int j = start; j < end; ++j) + { + if(*ptr++ == c) + return index; + ++index; + } + } + return -1; + } + + inline int read(char * data, int maxLength) + { + int bytesToRead = qMin(size(), maxLength); + int readSoFar = 0; + while(readSoFar < bytesToRead) + { + const char * ptr = readPointer(); + int bytesToReadFromThisBlock = qMin(bytesToRead - readSoFar, nextDataBlockSize()); + if(data) + memcpy(data + readSoFar, ptr, bytesToReadFromThisBlock); + readSoFar += bytesToReadFromThisBlock; + free(bytesToReadFromThisBlock); + } + return readSoFar; + } + + inline QByteArray read(int maxLength) + { + QByteArray tmp; + tmp.resize(qMin(maxLength, size())); + read(tmp.data(), tmp.size()); + return tmp; + } + + inline QByteArray readAll() + { + return read(size()); + } + + // read an unspecified amount (will read the first buffer) + inline QByteArray read() + { + if(bufferSize == 0) + return QByteArray(); + + // multiple buffers, just take the first one + if(head == 0 && tailBuffer != 0) + { + QByteArray qba = buffers.takeFirst(); + --tailBuffer; + bufferSize -= qba.length(); + return qba; + } + + // one buffer with good value for head. Just take it. + if(head == 0 && tailBuffer == 0) + { + QByteArray qba = buffers.takeFirst(); + qba.resize(tail); + buffers << QByteArray(); + bufferSize = 0; + tail = 0; + return qba; + } + + // Bad case: We have to memcpy. + // We can avoid by initializing the QRingBuffer with basicBlockSize of 0 + // and only using this read() function. + QByteArray qba(readPointer(), nextDataBlockSize()); + buffers.removeFirst(); + head = 0; + if(tailBuffer == 0) + { + buffers << QByteArray(); + tail = 0; + } + else + { + --tailBuffer; + } + bufferSize -= qba.length(); + return qba; + } + + // append a new buffer to the end + inline void append(const QByteArray & qba) + { + buffers[tailBuffer].resize(tail); + buffers << qba; + ++tailBuffer; + tail = qba.length(); + bufferSize += qba.length(); + } + + inline QByteArray peek(int maxLength) const + { + int bytesToRead = qMin(size(), maxLength); + if(maxLength <= 0) + return QByteArray(); + QByteArray ret; + ret.resize(bytesToRead); + int readSoFar = 0; + for(int i = 0; readSoFar < bytesToRead && i < buffers.size(); ++i) + { + int start = 0; + int end = buffers.at(i).size(); + if(i == 0) + start = head; + if(i == tailBuffer) + end = tail; + const int len = qMin(ret.size() - readSoFar, end - start); + memcpy(ret.data() + readSoFar, buffers.at(i).constData() + start, len); + readSoFar += len; + } + Q_ASSERT(readSoFar == ret.size()); + return ret; + } + + inline int skip(int length) + { + return read(0, length); + } + + inline int readLine(char * data, int maxLength) + { + int index = indexOf('\n'); + if(index == -1) + return read(data, maxLength); + if(maxLength <= 0) + return -1; + + int readSoFar = 0; + while(readSoFar < index + 1 && readSoFar < maxLength - 1) + { + int bytesToRead = qMin((index + 1) - readSoFar, nextDataBlockSize()); + bytesToRead = qMin(bytesToRead, (maxLength - 1) - readSoFar); + memcpy(data + readSoFar, readPointer(), bytesToRead); + readSoFar += bytesToRead; + free(bytesToRead); + } + + // Terminate it. + data[readSoFar] = '\0'; + return readSoFar; + } + + inline bool canReadLine() const + { + return indexOf('\n') != -1; + } private: - QList buffers; - int head, tail; - int tailBuffer; // always buffers.size() - 1 - int basicBlockSize; - int bufferSize; + QList buffers; + int head, tail; + int tailBuffer; // always buffers.size() - 1 + int basicBlockSize; + int bufferSize; }; #endif // QRINGBUFFER_P_H diff --git a/src/modules/options/OptionsDialog.cpp b/src/modules/options/OptionsDialog.cpp index e924bfa93..e8e349c36 100644 --- a/src/modules/options/OptionsDialog.cpp +++ b/src/modules/options/OptionsDialog.cpp @@ -52,46 +52,44 @@ //FIXME: some headers must be hidden - //extern KviModule * g_pOptionsModule; -extern KviPointerHashTable * g_pOptionsDialogDict; +extern KviPointerHashTable * g_pOptionsDialogDict; extern KVIRC_API KviApplication * g_pApp; extern OptionsInstanceManager * g_pOptionsInstanceManager; -OptionsDialogFrontWidget::OptionsDialogFrontWidget(QWidget *parent,const QString &szText) - :KviOptionsWidget(parent) +OptionsDialogFrontWidget::OptionsDialogFrontWidget(QWidget * parent, const QString & szText) + : KviOptionsWidget(parent) { setObjectName("general_options_front_widget"); createLayout(); - QLabel * l = new QLabel(szText,this); + QLabel * l = new QLabel(szText, this); l->setWordWrap(true); l->setAlignment(Qt::AlignTop); - layout()->addWidget(l,0,0); + layout()->addWidget(l, 0, 0); } OptionsDialogFrontWidget::~OptionsDialogFrontWidget() { } - -OptionsDialogTreeWidgetItem::OptionsDialogTreeWidgetItem(QTreeWidget *parent,OptionsWidgetInstanceEntry * e) -:QTreeWidgetItem() +OptionsDialogTreeWidgetItem::OptionsDialogTreeWidgetItem(QTreeWidget * parent, OptionsWidgetInstanceEntry * e) + : QTreeWidgetItem() { m_pInstanceEntry = e; m_pOptionsWidget = 0; - setText(0,e->szName); - setIcon(0,*(g_pIconManager->getSmallIcon(e->eIcon))); + setText(0, e->szName); + setIcon(0, *(g_pIconManager->getSmallIcon(e->eIcon))); parent->insertTopLevelItem(0, this); } -OptionsDialogTreeWidgetItem::OptionsDialogTreeWidgetItem(QTreeWidgetItem *parent,OptionsWidgetInstanceEntry * e) -:QTreeWidgetItem() +OptionsDialogTreeWidgetItem::OptionsDialogTreeWidgetItem(QTreeWidgetItem * parent, OptionsWidgetInstanceEntry * e) + : QTreeWidgetItem() { m_pInstanceEntry = e; m_pOptionsWidget = 0; - setText(0,e->szName); - setIcon(0,*(g_pIconManager->getSmallIcon(e->eIcon))); + setText(0, e->szName); + setIcon(0, *(g_pIconManager->getSmallIcon(e->eIcon))); parent->insertChild(0, this); } @@ -99,8 +97,8 @@ OptionsDialogTreeWidgetItem::~OptionsDialogTreeWidgetItem() { } -OptionsDialog::OptionsDialog(QWidget * par,const QString &szGroup,bool bModal) -: QDialog(par) +OptionsDialog::OptionsDialog(QWidget * par, const QString & szGroup, bool bModal) + : QDialog(par) { setObjectName("general_options_dialog"); @@ -110,29 +108,34 @@ OptionsDialog::OptionsDialog(QWidget * par,const QString &szGroup,bool bModal) QString szDialogTitle; - if(szGroup.isEmpty() || KviQString::equalCI(szGroup,"general")) + if(szGroup.isEmpty() || KviQString::equalCI(szGroup, "general")) { - szDialogTitle = __tr2qs_ctx("General Preferences","options"); - } else if(KviQString::equalCI(szGroup,"theme")) + szDialogTitle = __tr2qs_ctx("General Preferences", "options"); + } + else if(KviQString::equalCI(szGroup, "theme")) { - szDialogTitle = __tr2qs_ctx("Theme Preferences","options"); - } else { - szDialogTitle = __tr2qs_ctx("KVIrc Preferences","options"); + szDialogTitle = __tr2qs_ctx("Theme Preferences", "options"); + } + else + { + szDialogTitle = __tr2qs_ctx("KVIrc Preferences", "options"); } - QString szDialog = __tr2qs_ctx("This dialog contains a set of KVIrc settings.
Use the icons " \ - "on the left to navigate through the option pages. The text box in the " \ - "bottom left corner is a small search engine. It will highlight the " \ - "pages that contain options related to the search term you have entered.","options"); - + QString szDialog = __tr2qs_ctx("This dialog contains a set of KVIrc settings.
Use the icons " + "on the left to navigate through the option pages. The text box in the " + "bottom left corner is a small search engine. It will highlight the " + "pages that contain options related to the search term you have entered.", + "options"); QString szInfoTips; - szInfoTips = __tr2qs_ctx("Many settings have tooltips that can be shown by holding " \ - "the cursor over their label for a few seconds.","options"); + szInfoTips = __tr2qs_ctx("Many settings have tooltips that can be shown by holding " + "the cursor over their label for a few seconds.", + "options"); - QString szOkCancelButtons = __tr2qs_ctx("When you have finished, click \"OK\" to accept your changes " \ - "or \"Cancel\" to discard them. Clicking \"Apply\" will commit your " \ - "changes without closing the window.","options"); + QString szOkCancelButtons = __tr2qs_ctx("When you have finished, click \"OK\" to accept your changes " + "or \"Cancel\" to discard them. Clicking \"Apply\" will commit your " + "changes without closing the window.", + "options"); // clang-format off QString szFrontText = QString( @@ -165,10 +168,10 @@ OptionsDialog::OptionsDialog(QWidget * par,const QString &szGroup,bool bModal) setWindowTitle(szCaption); QGridLayout * g1 = new QGridLayout(this); - QSplitter * spl = new QSplitter(Qt::Horizontal,this); + QSplitter * spl = new QSplitter(Qt::Horizontal, this); spl->setChildrenCollapsible(false); - g1->addWidget(spl,0,0,1,5); + g1->addWidget(spl, 0, 0, 1, 5); KviTalVBox * vbox = new KviTalVBox(spl); vbox->setSpacing(2); @@ -180,37 +183,38 @@ OptionsDialog::OptionsDialog(QWidget * par,const QString &szGroup,bool bModal) m_pTreeWidget->header()->hide(); m_pTreeWidget->setRootIsDecorated(true); m_pTreeWidget->setSortingEnabled(false); - m_pTreeWidget->setSizePolicy(QSizePolicy::MinimumExpanding,QSizePolicy::MinimumExpanding); + m_pTreeWidget->setSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); m_pTreeWidget->setCurrentItem(NULL); - connect(m_pTreeWidget,SIGNAL(currentItemChanged(QTreeWidgetItem*, QTreeWidgetItem *)),this,SLOT(treeWidgetItemSelectionChanged(QTreeWidgetItem *, QTreeWidgetItem *))); + connect(m_pTreeWidget, SIGNAL(currentItemChanged(QTreeWidgetItem *, QTreeWidgetItem *)), this, SLOT(treeWidgetItemSelectionChanged(QTreeWidgetItem *, QTreeWidgetItem *))); KviTalHBox * hbox = new KviTalHBox(vbox); hbox->setSpacing(2); hbox->setMargin(3); m_pSearchLineEdit = new QLineEdit(hbox); - connect(m_pSearchLineEdit,SIGNAL(returnPressed()),this,SLOT(searchClicked())); + connect(m_pSearchLineEdit, SIGNAL(returnPressed()), this, SLOT(searchClicked())); m_pSearchButton = new QToolButton(hbox); - m_pSearchButton->setIconSize(QSize(16,16)); + m_pSearchButton->setIconSize(QSize(16, 16)); m_pSearchButton->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Search))); - connect(m_pSearchButton,SIGNAL(clicked()),this,SLOT(searchClicked())); - connect(m_pSearchLineEdit,SIGNAL(textChanged(const QString &)),this,SLOT(searchLineEditTextChanged(const QString &))); - - QString szTip = __tr2qs_ctx("

This is the search tool for this options dialog.

" \ - "

You can enter a search term either in your native " \ - "language or in English and press the button on the right. " \ - "The pages that contain some options related to the " \ - "search term will be highlighted and you will be able " \ - "to quickly find them.

Try \"nickname\" for example.

","options"); - KviTalToolTip::add(m_pSearchLineEdit,szTip); - KviTalToolTip::add(m_pSearchButton,szTip); + connect(m_pSearchButton, SIGNAL(clicked()), this, SLOT(searchClicked())); + connect(m_pSearchLineEdit, SIGNAL(textChanged(const QString &)), this, SLOT(searchLineEditTextChanged(const QString &))); + + QString szTip = __tr2qs_ctx("

This is the search tool for this options dialog.

" + "

You can enter a search term either in your native " + "language or in English and press the button on the right. " + "The pages that contain some options related to the " + "search term will be highlighted and you will be able " + "to quickly find them.

Try \"nickname\" for example.

", + "options"); + KviTalToolTip::add(m_pSearchLineEdit, szTip); + KviTalToolTip::add(m_pSearchButton, szTip); vbox = new KviTalVBox(spl); vbox->setSpacing(2); vbox->setMargin(3); - m_pCategoryLabel = new QLabel(" ",vbox); + m_pCategoryLabel = new QLabel(" ", vbox); m_pCategoryLabel->setObjectName("labgeneraloptions"); QFrame * f = new QFrame(vbox); @@ -218,59 +222,59 @@ OptionsDialog::OptionsDialog(QWidget * par,const QString &szGroup,bool bModal) // Widget stack m_pWidgetStack = new QStackedWidget(vbox); - vbox->setStretchFactor(m_pWidgetStack,1); + vbox->setStretchFactor(m_pWidgetStack, 1); // First widget visible - m_pFrontWidget = new OptionsDialogFrontWidget(m_pWidgetStack,szFrontText); + m_pFrontWidget = new OptionsDialogFrontWidget(m_pWidgetStack, szFrontText); m_pWidgetStack->addWidget(m_pFrontWidget); int idx = m_pWidgetStack->indexOf(m_pFrontWidget); m_pWidgetStack->widget(idx)->raise(); // Ok,Cancel,Help - QPushButton * b = new QPushButton(__tr2qs_ctx("&OK","options"),this); + QPushButton * b = new QPushButton(__tr2qs_ctx("&OK", "options"), this); b->setObjectName("btnok"); - KviTalToolTip::add(b,__tr2qs_ctx("Close this dialog, accepting all changes.","options")); - connect(b,SIGNAL(clicked()),this,SLOT(okClicked())); + KviTalToolTip::add(b, __tr2qs_ctx("Close this dialog, accepting all changes.", "options")); + connect(b, SIGNAL(clicked()), this, SLOT(okClicked())); //b->setMinimumWidth(whatIsThisWidth); b->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Accept))); - g1->addWidget(b,1,2); + g1->addWidget(b, 1, 2); - b = new QPushButton(__tr2qs_ctx("&Apply","options"),this); + b = new QPushButton(__tr2qs_ctx("&Apply", "options"), this); b->setObjectName("btnapply"); - KviTalToolTip::add(b,__tr2qs_ctx("Commit all changes immediately.","options")); - connect(b,SIGNAL(clicked()),this,SLOT(applyClicked())); + KviTalToolTip::add(b, __tr2qs_ctx("Commit all changes immediately.", "options")); + connect(b, SIGNAL(clicked()), this, SLOT(applyClicked())); b->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Accept))); - g1->addWidget(b,1,3); + g1->addWidget(b, 1, 3); - b = new QPushButton(__tr2qs_ctx("Cancel","options"),this); + b = new QPushButton(__tr2qs_ctx("Cancel", "options"), this); b->setObjectName("btncancel"); - KviTalToolTip::add(b,__tr2qs_ctx("Close this dialog, discarding all changes.","options")); + KviTalToolTip::add(b, __tr2qs_ctx("Close this dialog, discarding all changes.", "options")); b->setDefault(true); //b->setMinimumWidth(whatIsThisWidth); - connect(b,SIGNAL(clicked()),this,SLOT(cancelClicked())); + connect(b, SIGNAL(clicked()), this, SLOT(cancelClicked())); b->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Discard))); - g1->addWidget(b,1,4); - - g1->setRowStretch(0,1); - g1->setColumnStretch(1,1); + g1->addWidget(b, 1, 4); + g1->setRowStretch(0, 1); + g1->setColumnStretch(1, 1); - fillTreeWidget(0,g_pOptionsInstanceManager->instanceEntryTree(),szGroup); + fillTreeWidget(0, g_pOptionsInstanceManager->instanceEntryTree(), szGroup); if(!parent()) { if(KVI_OPTION_RECT(KviOption_rectGeneralOptionsDialogGeometry).y() < 5) - KVI_OPTION_RECT(KviOption_rectGeneralOptionsDialogGeometry).setY(5); + KVI_OPTION_RECT(KviOption_rectGeneralOptionsDialogGeometry) + .setY(5); //setGeometry(KVI_OPTION_RECT(KviOption_rectGeneralOptionsDialogGeometry)); resize(KVI_OPTION_RECT(KviOption_rectGeneralOptionsDialogGeometry).width(), - KVI_OPTION_RECT(KviOption_rectGeneralOptionsDialogGeometry).height()); + KVI_OPTION_RECT(KviOption_rectGeneralOptionsDialogGeometry).height()); move(KVI_OPTION_RECT(KviOption_rectGeneralOptionsDialogGeometry).x(), - KVI_OPTION_RECT(KviOption_rectGeneralOptionsDialogGeometry).y()); + KVI_OPTION_RECT(KviOption_rectGeneralOptionsDialogGeometry).y()); } - new QShortcut(Qt::Key_Escape,this,SLOT(close())); + new QShortcut(Qt::Key_Escape, this, SLOT(close())); if(bModal) setWindowModality(par ? Qt::WindowModal : Qt::ApplicationModal); @@ -279,12 +283,12 @@ OptionsDialog::OptionsDialog(QWidget * par,const QString &szGroup,bool bModal) OptionsDialog::~OptionsDialog() { if(!parent()) - KVI_OPTION_RECT(KviOption_rectGeneralOptionsDialogGeometry) = QRect(pos().x(),pos().y(),size().width(),size().height()); + KVI_OPTION_RECT(KviOption_rectGeneralOptionsDialogGeometry) = QRect(pos().x(), pos().y(), size().width(), size().height()); if(g_pOptionsDialogDict) g_pOptionsDialogDict->remove(m_szGroup); } -void OptionsDialog::showEvent(QShowEvent *e) +void OptionsDialog::showEvent(QShowEvent * e) { // setup a minimum size and move to the screen the main kvirc window is QRect r = g_pApp->desktop()->screenGeometry(g_pMainWindow); @@ -298,12 +302,16 @@ void OptionsDialog::showEvent(QShowEvent *e) if(w < 800) { // 640x480 - if(ww < 630)ww = 630; - } else { - if(ww < 770)ww = 770; + if(ww < 630) + ww = 630; + } + else + { + if(ww < 770) + ww = 770; } - setGeometry(r.x() + ((w - ww) / 2),r.y() + ((h - wh) / 2),ww,wh); + setGeometry(r.x() + ((w - ww) / 2), r.y() + ((h - wh) / 2), ww, wh); QWidget::showEvent(e); } @@ -313,26 +321,27 @@ void OptionsDialog::searchLineEditTextChanged(const QString &) QString txt = m_pSearchLineEdit->text().trimmed(); m_pSearchButton->setEnabled(txt.length() > 0); } -bool OptionsDialog::searchInSelectors(KviOptionsWidget *pOptionsWidget,const QStringList &lKeywords) +bool OptionsDialog::searchInSelectors(KviOptionsWidget * pOptionsWidget, const QStringList & lKeywords) { - KviPointerList *selectors=pOptionsWidget->selectors(); - bool bFoundSomethingHere=false; - if(selectors->count()>0) + KviPointerList * selectors = pOptionsWidget->selectors(); + bool bFoundSomethingHere = false; + if(selectors->count() > 0) { - for(unsigned int i=0;icount();i++) + for(unsigned int i = 0; i < selectors->count(); i++) { - QString szText=selectors->at(i)->textForSearch(); - QWidget* pWidget=selectors->at(i)->widgetToHighlight(); - if (!pWidget) continue; - QString szTmp=pWidget->toolTip(); - szTmp=szTmp.replace(QRegExp("<[^<>]+>"),""); + QString szText = selectors->at(i)->textForSearch(); + QWidget * pWidget = selectors->at(i)->widgetToHighlight(); + if(!pWidget) + continue; + QString szTmp = pWidget->toolTip(); + szTmp = szTmp.replace(QRegExp("<[^<>]+>"), ""); szText.append(szTmp); if(!szText.isEmpty()) { bool bOk = true; - for(int j=0;jm_pOptionsWidget) { - pItem->m_pOptionsWidget = g_pOptionsInstanceManager->getInstance(pItem->m_pInstanceEntry,m_pWidgetStack); + pItem->m_pOptionsWidget = g_pOptionsInstanceManager->getInstance(pItem->m_pInstanceEntry, m_pWidgetStack); m_pWidgetStack->addWidget(pItem->m_pOptionsWidget); } bool bFoundSomethingHere = false; - KviOptionsWidget *pOptionsWidget=pItem->m_pOptionsWidget; - QTabWidget *pTab= pOptionsWidget->tabWidget(); - if (pTab) + KviOptionsWidget * pOptionsWidget = pItem->m_pOptionsWidget; + QTabWidget * pTab = pOptionsWidget->tabWidget(); + if(pTab) { - for(int i=0;icount();i++) + for(int i = 0; i < pTab->count(); i++) { QString szTxt = pTab->tabText(i); - if(KviQString::equalCIN(szTxt,">>> ",4)) + if(KviQString::equalCIN(szTxt, ">>> ", 4)) { - szTxt.replace(">>> ",""); - szTxt.replace(" <<<",""); + szTxt.replace(">>> ", ""); + szTxt.replace(" <<<", ""); } - if (searchInSelectors((KviOptionsWidget*)pTab->widget(i),lKeywords)) + if(searchInSelectors((KviOptionsWidget *)pTab->widget(i), lKeywords)) { bFoundSomethingHere = true; - szTxt.insert(0,">>> "); + szTxt.insert(0, ">>> "); szTxt += QString(" <<<"); } - pTab->setTabText(i,szTxt); + pTab->setTabText(i, szTxt); } } else { - if (searchInSelectors(pOptionsWidget,lKeywords)) + if(searchInSelectors(pOptionsWidget, lKeywords)) bFoundSomethingHere = true; } @@ -393,16 +403,18 @@ bool OptionsDialog::recursiveSearch(OptionsDialogTreeWidgetItem * pItem,const QS // debug all the "search keywords" for each entry in the options tree // qDebug("OPT %s",pItem->m_pInstanceEntry->szKeywords.toUtf8().data()); - for(int i=0;isetForeground(0, Qt::yellow); pItem->setBackground(0, Qt::red); - } else { + } + else + { pItem->setForeground(0, Qt::black); pItem->setBackground(0, Qt::transparent); } @@ -411,11 +423,12 @@ bool OptionsDialog::recursiveSearch(OptionsDialogTreeWidgetItem * pItem,const QS int ccount = pItem->childCount(); if(ccount > 0) { - for(int j=0;jchild(j); - bool bRet = recursiveSearch(pChild,lKeywords); - if(bRet)bFoundSomethingInside = true; + bool bRet = recursiveSearch(pChild, lKeywords); + if(bRet) + bFoundSomethingInside = true; } } @@ -424,23 +437,23 @@ bool OptionsDialog::recursiveSearch(OptionsDialogTreeWidgetItem * pItem,const QS return (bFoundSomethingInside || bFoundSomethingHere); } -void OptionsDialog::search(const QStringList &lKeywords) +void OptionsDialog::search(const QStringList & lKeywords) { m_pTreeWidget->setUpdatesEnabled(false); - int count=m_pTreeWidget->topLevelItemCount(); - for (int i=0;itopLevelItemCount(); + for(int i = 0; i < count; i++) { OptionsDialogTreeWidgetItem * pChild = (OptionsDialogTreeWidgetItem *)m_pTreeWidget->topLevelItem(i); - recursiveSearch(pChild,lKeywords); + recursiveSearch(pChild, lKeywords); } m_pTreeWidget->setUpdatesEnabled(true); m_pTreeWidget->update(); } -void OptionsDialog::search(const QString &szKeywords) +void OptionsDialog::search(const QString & szKeywords) { - QStringList lKeywords = szKeywords.split(" ",QString::SkipEmptyParts); + QStringList lKeywords = szKeywords.split(" ", QString::SkipEmptyParts); search(lKeywords); } @@ -451,9 +464,10 @@ void OptionsDialog::searchClicked() search(szTxt); } -void OptionsDialog::fillTreeWidget(QTreeWidgetItem * p,KviPointerList * l,const QString &szGroup,bool bNotContainedOnly) +void OptionsDialog::fillTreeWidget(QTreeWidgetItem * p, KviPointerList * l, const QString & szGroup, bool bNotContainedOnly) { - if(!l)return; + if(!l) + return; OptionsDialogTreeWidgetItem * it; OptionsWidgetInstanceEntry * e; @@ -461,37 +475,41 @@ void OptionsDialog::fillTreeWidget(QTreeWidgetItem * p,KviPointerList tmp; tmp.setAutoDelete(false); - - for(e = l->first();e;e = l->next()) + for(e = l->first(); e; e = l->next()) { // must be in the correct group // if we want only containers then well.. must be one - e->bDoInsert = KviQString::equalCI(szGroup,e->szGroup) && ((!bNotContainedOnly) || e->bIsContainer || e->bIsNotContained); + e->bDoInsert = KviQString::equalCI(szGroup, e->szGroup) && ((!bNotContainedOnly) || e->bIsContainer || e->bIsNotContained); OptionsWidgetInstanceEntry * ee = tmp.first(); int idx = 0; while(ee) { - if(ee->iPriority >= e->iPriority)break; + if(ee->iPriority >= e->iPriority) + break; idx++; ee = tmp.next(); } - tmp.insert(idx,e); + tmp.insert(idx, e); } - for(e = tmp.first();e;e = tmp.next()) + for(e = tmp.first(); e; e = tmp.next()) { if(e->bDoInsert) { - if(p)it = new OptionsDialogTreeWidgetItem(p,e); - else it = new OptionsDialogTreeWidgetItem(m_pTreeWidget,e); + if(p) + it = new OptionsDialogTreeWidgetItem(p, e); + else + it = new OptionsDialogTreeWidgetItem(m_pTreeWidget, e); if(!it->m_pOptionsWidget) { - it->m_pOptionsWidget = g_pOptionsInstanceManager->getInstance(it->m_pInstanceEntry,m_pWidgetStack); + it->m_pOptionsWidget = g_pOptionsInstanceManager->getInstance(it->m_pInstanceEntry, m_pWidgetStack); if(it->m_pOptionsWidget) m_pWidgetStack->addWidget(it->m_pOptionsWidget); } - } else { + } + else + { it = (OptionsDialogTreeWidgetItem *)p; } @@ -500,16 +518,18 @@ void OptionsDialog::fillTreeWidget(QTreeWidgetItem * p,KviPointerListbIsContainer) { // it's a container: add only eventual not contained children (containers or explicitly marked as not contained) - fillTreeWidget(it,e->pChildList,szGroup,true); - } else { + fillTreeWidget(it, e->pChildList, szGroup, true); + } + else + { // it's not a container, add any children - fillTreeWidget(it,e->pChildList,szGroup,false); + fillTreeWidget(it, e->pChildList, szGroup, false); } } } } -void OptionsDialog::treeWidgetItemSelectionChanged(QTreeWidgetItem* it, QTreeWidgetItem *) +void OptionsDialog::treeWidgetItemSelectionChanged(QTreeWidgetItem * it, QTreeWidgetItem *) { if(it) { @@ -525,10 +545,10 @@ void OptionsDialog::treeWidgetItemSelectionChanged(QTreeWidgetItem* it, QTreeWid str.prepend(""); str += ""; - OptionsDialogTreeWidgetItem *i = (OptionsDialogTreeWidgetItem *)it; + OptionsDialogTreeWidgetItem * i = (OptionsDialogTreeWidgetItem *)it; if(!i->m_pOptionsWidget) { - i->m_pOptionsWidget = g_pOptionsInstanceManager->getInstance(i->m_pInstanceEntry,m_pWidgetStack); + i->m_pOptionsWidget = g_pOptionsInstanceManager->getInstance(i->m_pInstanceEntry, m_pWidgetStack); m_pWidgetStack->addWidget(i->m_pOptionsWidget); } @@ -586,8 +606,8 @@ void OptionsDialog::applyClicked() void OptionsDialog::apply(bool bDialogAboutToClose) { - int count=m_pTreeWidget->topLevelItemCount(); - int curTab=-1; + int count = m_pTreeWidget->topLevelItemCount(); + int curTab = -1; OptionsDialogTreeWidgetItem * it; if(!bDialogAboutToClose) @@ -601,7 +621,7 @@ void OptionsDialog::apply(bool bDialogAboutToClose) curTab = it->m_pOptionsWidget->tabWidget()->currentIndex(); } - for (int i=0;itopLevelItem(i); recursiveCommit(it); @@ -621,7 +641,6 @@ void OptionsDialog::apply(bool bDialogAboutToClose) } g_pApp->saveConfiguration(); - } void OptionsDialog::okClicked() @@ -635,18 +654,19 @@ void OptionsDialog::cancelClicked() deleteLater(); } -void OptionsDialog::closeEvent(QCloseEvent *e) +void OptionsDialog::closeEvent(QCloseEvent * e) { e->ignore(); deleteLater(); } -void OptionsDialog::recursiveCommit(OptionsDialogTreeWidgetItem *it) +void OptionsDialog::recursiveCommit(OptionsDialogTreeWidgetItem * it) { // First commit the children - if(!it) return; - int count=it->childCount(); - for (int i=0;ichildCount(); + for(int i = 0; i < count; i++) { OptionsDialogTreeWidgetItem * pChild = (OptionsDialogTreeWidgetItem *)it->child(i); recursiveCommit(pChild); @@ -662,9 +682,9 @@ void OptionsDialog::recursiveCommit(OptionsDialogTreeWidgetItem *it) //refreshTreeWidget(); // <-- this tends to jump into infinite recursion } -void OptionsDialog::keyPressEvent( QKeyEvent * e ) +void OptionsDialog::keyPressEvent(QKeyEvent * e) { - if(e->key()==Qt::Key_Return) + if(e->key() == Qt::Key_Return) e->accept(); else e->ignore(); diff --git a/src/modules/options/OptionsDialog.h b/src/modules/options/OptionsDialog.h index db30dbee9..1d2cc912b 100644 --- a/src/modules/options/OptionsDialog.h +++ b/src/modules/options/OptionsDialog.h @@ -45,60 +45,63 @@ class OptionsDialogFrontWidget : public KviOptionsWidget { Q_OBJECT public: - OptionsDialogFrontWidget(QWidget *parent,const QString &szText); + OptionsDialogFrontWidget(QWidget * parent, const QString & szText); ~OptionsDialogFrontWidget(); }; class OptionsDialogTreeWidgetItem : public QTreeWidgetItem { public: - OptionsDialogTreeWidgetItem(QTreeWidget *parent,OptionsWidgetInstanceEntry * e); - OptionsDialogTreeWidgetItem(QTreeWidgetItem *parent,OptionsWidgetInstanceEntry * e); + OptionsDialogTreeWidgetItem(QTreeWidget * parent, OptionsWidgetInstanceEntry * e); + OptionsDialogTreeWidgetItem(QTreeWidgetItem * parent, OptionsWidgetInstanceEntry * e); ~OptionsDialogTreeWidgetItem(); + public: OptionsWidgetInstanceEntry * m_pInstanceEntry; - KviOptionsWidget * m_pOptionsWidget; + KviOptionsWidget * m_pOptionsWidget; }; class OptionsDialog : public QDialog { Q_OBJECT public: - OptionsDialog(QWidget * par,const QString &szGroup,bool bModal); + OptionsDialog(QWidget * par, const QString & szGroup, bool bModal); ~OptionsDialog(); + private: - QTreeWidget * m_pTreeWidget; - QLabel * m_pCategoryLabel; - QStackedWidget * m_pWidgetStack; - OptionsDialogFrontWidget * m_pFrontWidget; - QString m_szGroup; - QLineEdit * m_pSearchLineEdit; - QToolButton * m_pSearchButton; + QTreeWidget * m_pTreeWidget; + QLabel * m_pCategoryLabel; + QStackedWidget * m_pWidgetStack; + OptionsDialogFrontWidget * m_pFrontWidget; + QString m_szGroup; + QLineEdit * m_pSearchLineEdit; + QToolButton * m_pSearchButton; + private: - void recursiveCommit(OptionsDialogTreeWidgetItem *it); - void fillTreeWidget(QTreeWidgetItem * p,KviPointerList * l,const QString &szGroup,bool bNotContainedOnly = false); + void recursiveCommit(OptionsDialogTreeWidgetItem * it); + void fillTreeWidget(QTreeWidgetItem * p, KviPointerList * l, const QString & szGroup, bool bNotContainedOnly = false); //OptionsDialogTreeWidgetItem * showHiddenChildren(QTreeWidgetItem * p,KviPointerList * l); //OptionsDialogTreeWidgetItem * findItemByPage(OptionsDialogTreeWidgetItem *it,KviOptionsWidget * pPage); private slots: - void treeWidgetItemSelectionChanged(QTreeWidgetItem* it, QTreeWidgetItem *prev); + void treeWidgetItemSelectionChanged(QTreeWidgetItem * it, QTreeWidgetItem * prev); void applyClicked(); void okClicked(); void cancelClicked(); void pageWantsToSwitchToAdvancedPage(KviOptionsWidget * pPage); void searchClicked(); void searchLineEditTextChanged(const QString &); + protected: void apply(bool bDialogAboutToClose); - virtual void closeEvent(QCloseEvent *e); - virtual void keyPressEvent( QKeyEvent * e ); - virtual void showEvent(QShowEvent *e); - bool recursiveSearch(OptionsDialogTreeWidgetItem * pItem,const QStringList &lKeywords); - bool searchInSelectors(KviOptionsWidget *pWidget,const QStringList &lKeywords); + virtual void closeEvent(QCloseEvent * e); + virtual void keyPressEvent(QKeyEvent * e); + virtual void showEvent(QShowEvent * e); + bool recursiveSearch(OptionsDialogTreeWidgetItem * pItem, const QStringList & lKeywords); + bool searchInSelectors(KviOptionsWidget * pWidget, const QStringList & lKeywords); public: - void search(const QString &szKeywords); - void search(const QStringList &lKeywords); + void search(const QString & szKeywords); + void search(const QStringList & lKeywords); }; - #endif //_DIALOG_H_ diff --git a/src/modules/options/OptionsInstanceManager.cpp b/src/modules/options/OptionsInstanceManager.cpp index 25720fe84..2ed928724 100644 --- a/src/modules/options/OptionsInstanceManager.cpp +++ b/src/modules/options/OptionsInstanceManager.cpp @@ -485,8 +485,6 @@ KviOptionsWidget * classOptionsWidget_windowListClassic_createInstanceProc(QWidg return new OptionsWidget_windowListClassic(parent); } - - static const char * g_szName_OptionsWidget_alertsAndHighlighting = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_alertsAndHighlighting; static const char * g_szClassName_OptionsWidget_alertsAndHighlighting = "OptionsWidget_alertsAndHighlighting"; static const char * g_szName_OptionsWidget_highlighting = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_highlighting; @@ -653,7 +651,7 @@ static const char * g_szName_OptionsWidget_windowListClassic = KVI_OPTIONS_WIDGE static const char * g_szClassName_OptionsWidget_windowListClassic = "OptionsWidget_windowListClassic"; OptionsInstanceManager::OptionsInstanceManager() -: QObject(0) + : QObject(0) { //qDebug("Instantiating"); @@ -661,1029 +659,1028 @@ OptionsInstanceManager::OptionsInstanceManager() m_pInstanceTree = new KviPointerList; m_pInstanceTree->setAutoDelete(true); - OptionsWidgetInstanceEntry * e0; e0 = new OptionsWidgetInstanceEntry; e0->createProc = &classOptionsWidget_connection_createInstanceProc; e0->pWidget = 0; e0->szClassName = g_szClassName_OptionsWidget_connection; e0->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_connection; - #ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_connection +#ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_connection e0->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_connection; - #else +#else e0->iPriority = 0; - #endif - #ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_connection +#endif +#ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_connection e0->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_connection "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_connection; - #else +#else e0->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_connection; - #endif - e0->szKeywords = __tr2qs_ctx_no_xgettext(e0->szKeywordsNoLocale.toUtf8().data(),"options"); - #ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_connection +#endif + e0->szKeywords = __tr2qs_ctx_no_xgettext(e0->szKeywordsNoLocale.toUtf8().data(), "options"); +#ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_connection e0->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_connection; - #else +#else e0->szGroup = "general"; - #endif - #ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_connection +#endif +#ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_connection e0->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_connection; - #else +#else e0->bIsContainer = false; - #endif - #ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_connection +#endif +#ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_connection e0->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_connection; - #else +#else e0->bIsNotContained = false; - #endif +#endif e0->szNameNoLocale = g_szName_OptionsWidget_connection; - e0->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_connection,"options"); + e0->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_connection, "options"); m_pInstanceTree->append(e0); e0->pChildList = new KviPointerList; e0->pChildList->setAutoDelete(true); - OptionsWidgetInstanceEntry * e1; - e1 = new OptionsWidgetInstanceEntry; - e1->createProc = &classOptionsWidget_connectionAdvanced_createInstanceProc; - e1->pWidget = 0; - e1->szClassName = g_szClassName_OptionsWidget_connectionAdvanced; - e1->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_connectionAdvanced; - #ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_connectionAdvanced - e1->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_connectionAdvanced; - #else - e1->iPriority = 0; - #endif - #ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_connectionAdvanced - e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_connectionAdvanced "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_connectionAdvanced; - #else - e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_connectionAdvanced; - #endif - e1->szKeywords = __tr2qs_ctx_no_xgettext(e1->szKeywordsNoLocale.toUtf8().data(),"options"); - #ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_connectionAdvanced - e1->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_connectionAdvanced; - #else - e1->szGroup = "general"; - #endif - #ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_connectionAdvanced - e1->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_connectionAdvanced; - #else - e1->bIsContainer = false; - #endif - #ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_connectionAdvanced - e1->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_connectionAdvanced; - #else - e1->bIsNotContained = false; - #endif - e1->szNameNoLocale = g_szName_OptionsWidget_connectionAdvanced; - e1->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_connectionAdvanced,"options"); - e0->pChildList->append(e1); - - e1->pChildList = new KviPointerList; - e1->pChildList->setAutoDelete(true); - - OptionsWidgetInstanceEntry * e2; - e2 = new OptionsWidgetInstanceEntry; - e2->createProc = &classOptionsWidget_connectionSsl_createInstanceProc; - e2->pWidget = 0; - e2->szClassName = g_szClassName_OptionsWidget_connectionSsl; - e2->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_connectionSsl; - #ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_connectionSsl - e2->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_connectionSsl; - #else - e2->iPriority = 0; - #endif - #ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_connectionSsl - e2->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_connectionSsl "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_connectionSsl; - #else - e2->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_connectionSsl; - #endif - e2->szKeywords = __tr2qs_ctx_no_xgettext(e2->szKeywordsNoLocale.toUtf8().data(),"options"); - #ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_connectionSsl - e2->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_connectionSsl; - #else - e2->szGroup = "general"; - #endif - #ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_connectionSsl - e2->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_connectionSsl; - #else - e2->bIsContainer = false; - #endif - #ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_connectionSsl - e2->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_connectionSsl; - #else - e2->bIsNotContained = false; - #endif - e2->szNameNoLocale = g_szName_OptionsWidget_connectionSsl; - e2->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_connectionSsl,"options"); - e1->pChildList->append(e2); - e2->pChildList = 0; - - e2 = new OptionsWidgetInstanceEntry; - e2->createProc = &classOptionsWidget_connectionSocket_createInstanceProc; - e2->pWidget = 0; - e2->szClassName = g_szClassName_OptionsWidget_connectionSocket; - e2->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_connectionSocket; - #ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_connectionSocket - e2->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_connectionSocket; - #else - e2->iPriority = 0; - #endif - #ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_connectionSocket - e2->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_connectionSocket "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_connectionSocket; - #else - e2->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_connectionSocket; - #endif - e2->szKeywords = __tr2qs_ctx_no_xgettext(e2->szKeywordsNoLocale.toUtf8().data(),"options"); - #ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_connectionSocket - e2->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_connectionSocket; - #else - e2->szGroup = "general"; - #endif - #ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_connectionSocket - e2->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_connectionSocket; - #else - e2->bIsContainer = false; - #endif - #ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_connectionSocket - e2->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_connectionSocket; - #else - e2->bIsNotContained = false; - #endif - e2->szNameNoLocale = g_szName_OptionsWidget_connectionSocket; - e2->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_connectionSocket,"options"); - e1->pChildList->append(e2); - e2->pChildList = 0; - - e2 = new OptionsWidgetInstanceEntry; - e2->createProc = &classOptionsWidget_identService_createInstanceProc; - e2->pWidget = 0; - e2->szClassName = g_szClassName_OptionsWidget_identService; - e2->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_identService; - #ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_identService - e2->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_identService; - #else - e2->iPriority = 0; - #endif - #ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_identService - e2->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_identService "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_identService; - #else - e2->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_identService; - #endif - e2->szKeywords = __tr2qs_ctx_no_xgettext(e2->szKeywordsNoLocale.toUtf8().data(),"options"); - #ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_identService - e2->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_identService; - #else - e2->szGroup = "general"; - #endif - #ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_identService - e2->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_identService; - #else - e2->bIsContainer = false; - #endif - #ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_identService - e2->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_identService; - #else - e2->bIsNotContained = false; - #endif - e2->szNameNoLocale = g_szName_OptionsWidget_identService; - e2->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_identService,"options"); - e1->pChildList->append(e2); - e2->pChildList = 0; - - e1 = new OptionsWidgetInstanceEntry; - e1->createProc = &classOptionsWidget_proxy_createInstanceProc; - e1->pWidget = 0; - e1->szClassName = g_szClassName_OptionsWidget_proxy; - e1->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_proxy; - #ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_proxy - e1->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_proxy; - #else - e1->iPriority = 0; - #endif - #ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_proxy - e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_proxy "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_proxy; - #else - e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_proxy; - #endif - e1->szKeywords = __tr2qs_ctx_no_xgettext(e1->szKeywordsNoLocale.toUtf8().data(),"options"); - #ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_proxy - e1->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_proxy; - #else - e1->szGroup = "general"; - #endif - #ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_proxy - e1->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_proxy; - #else - e1->bIsContainer = false; - #endif - #ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_proxy - e1->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_proxy; - #else - e1->bIsNotContained = false; - #endif - e1->szNameNoLocale = g_szName_OptionsWidget_proxy; - e1->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_proxy,"options"); - e0->pChildList->append(e1); - e1->pChildList = 0; + OptionsWidgetInstanceEntry * e1; + e1 = new OptionsWidgetInstanceEntry; + e1->createProc = &classOptionsWidget_connectionAdvanced_createInstanceProc; + e1->pWidget = 0; + e1->szClassName = g_szClassName_OptionsWidget_connectionAdvanced; + e1->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_connectionAdvanced; +#ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_connectionAdvanced + e1->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_connectionAdvanced; +#else + e1->iPriority = 0; +#endif +#ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_connectionAdvanced + e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_connectionAdvanced "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_connectionAdvanced; +#else + e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_connectionAdvanced; +#endif + e1->szKeywords = __tr2qs_ctx_no_xgettext(e1->szKeywordsNoLocale.toUtf8().data(), "options"); +#ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_connectionAdvanced + e1->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_connectionAdvanced; +#else + e1->szGroup = "general"; +#endif +#ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_connectionAdvanced + e1->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_connectionAdvanced; +#else + e1->bIsContainer = false; +#endif +#ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_connectionAdvanced + e1->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_connectionAdvanced; +#else + e1->bIsNotContained = false; +#endif + e1->szNameNoLocale = g_szName_OptionsWidget_connectionAdvanced; + e1->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_connectionAdvanced, "options"); + e0->pChildList->append(e1); + + e1->pChildList = new KviPointerList; + e1->pChildList->setAutoDelete(true); + + OptionsWidgetInstanceEntry * e2; + e2 = new OptionsWidgetInstanceEntry; + e2->createProc = &classOptionsWidget_connectionSsl_createInstanceProc; + e2->pWidget = 0; + e2->szClassName = g_szClassName_OptionsWidget_connectionSsl; + e2->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_connectionSsl; +#ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_connectionSsl + e2->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_connectionSsl; +#else + e2->iPriority = 0; +#endif +#ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_connectionSsl + e2->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_connectionSsl "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_connectionSsl; +#else + e2->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_connectionSsl; +#endif + e2->szKeywords = __tr2qs_ctx_no_xgettext(e2->szKeywordsNoLocale.toUtf8().data(), "options"); +#ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_connectionSsl + e2->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_connectionSsl; +#else + e2->szGroup = "general"; +#endif +#ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_connectionSsl + e2->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_connectionSsl; +#else + e2->bIsContainer = false; +#endif +#ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_connectionSsl + e2->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_connectionSsl; +#else + e2->bIsNotContained = false; +#endif + e2->szNameNoLocale = g_szName_OptionsWidget_connectionSsl; + e2->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_connectionSsl, "options"); + e1->pChildList->append(e2); + e2->pChildList = 0; + + e2 = new OptionsWidgetInstanceEntry; + e2->createProc = &classOptionsWidget_connectionSocket_createInstanceProc; + e2->pWidget = 0; + e2->szClassName = g_szClassName_OptionsWidget_connectionSocket; + e2->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_connectionSocket; +#ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_connectionSocket + e2->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_connectionSocket; +#else + e2->iPriority = 0; +#endif +#ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_connectionSocket + e2->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_connectionSocket "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_connectionSocket; +#else + e2->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_connectionSocket; +#endif + e2->szKeywords = __tr2qs_ctx_no_xgettext(e2->szKeywordsNoLocale.toUtf8().data(), "options"); +#ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_connectionSocket + e2->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_connectionSocket; +#else + e2->szGroup = "general"; +#endif +#ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_connectionSocket + e2->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_connectionSocket; +#else + e2->bIsContainer = false; +#endif +#ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_connectionSocket + e2->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_connectionSocket; +#else + e2->bIsNotContained = false; +#endif + e2->szNameNoLocale = g_szName_OptionsWidget_connectionSocket; + e2->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_connectionSocket, "options"); + e1->pChildList->append(e2); + e2->pChildList = 0; + + e2 = new OptionsWidgetInstanceEntry; + e2->createProc = &classOptionsWidget_identService_createInstanceProc; + e2->pWidget = 0; + e2->szClassName = g_szClassName_OptionsWidget_identService; + e2->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_identService; +#ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_identService + e2->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_identService; +#else + e2->iPriority = 0; +#endif +#ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_identService + e2->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_identService "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_identService; +#else + e2->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_identService; +#endif + e2->szKeywords = __tr2qs_ctx_no_xgettext(e2->szKeywordsNoLocale.toUtf8().data(), "options"); +#ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_identService + e2->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_identService; +#else + e2->szGroup = "general"; +#endif +#ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_identService + e2->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_identService; +#else + e2->bIsContainer = false; +#endif +#ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_identService + e2->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_identService; +#else + e2->bIsNotContained = false; +#endif + e2->szNameNoLocale = g_szName_OptionsWidget_identService; + e2->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_identService, "options"); + e1->pChildList->append(e2); + e2->pChildList = 0; + + e1 = new OptionsWidgetInstanceEntry; + e1->createProc = &classOptionsWidget_proxy_createInstanceProc; + e1->pWidget = 0; + e1->szClassName = g_szClassName_OptionsWidget_proxy; + e1->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_proxy; +#ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_proxy + e1->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_proxy; +#else + e1->iPriority = 0; +#endif +#ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_proxy + e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_proxy "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_proxy; +#else + e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_proxy; +#endif + e1->szKeywords = __tr2qs_ctx_no_xgettext(e1->szKeywordsNoLocale.toUtf8().data(), "options"); +#ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_proxy + e1->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_proxy; +#else + e1->szGroup = "general"; +#endif +#ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_proxy + e1->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_proxy; +#else + e1->bIsContainer = false; +#endif +#ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_proxy + e1->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_proxy; +#else + e1->bIsNotContained = false; +#endif + e1->szNameNoLocale = g_szName_OptionsWidget_proxy; + e1->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_proxy, "options"); + e0->pChildList->append(e1); + e1->pChildList = 0; e0 = new OptionsWidgetInstanceEntry; e0->createProc = &classOptionsWidget_dcc_createInstanceProc; e0->pWidget = 0; e0->szClassName = g_szClassName_OptionsWidget_dcc; e0->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_dcc; - #ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_dcc +#ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_dcc e0->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_dcc; - #else +#else e0->iPriority = 0; - #endif - #ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_dcc +#endif +#ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_dcc e0->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_dcc "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_dcc; - #else +#else e0->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_dcc; - #endif - e0->szKeywords = __tr2qs_ctx_no_xgettext(e0->szKeywordsNoLocale.toUtf8().data(),"options"); - #ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_dcc +#endif + e0->szKeywords = __tr2qs_ctx_no_xgettext(e0->szKeywordsNoLocale.toUtf8().data(), "options"); +#ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_dcc e0->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_dcc; - #else +#else e0->szGroup = "general"; - #endif - #ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_dcc +#endif +#ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_dcc e0->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_dcc; - #else +#else e0->bIsContainer = false; - #endif - #ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_dcc +#endif +#ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_dcc e0->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_dcc; - #else +#else e0->bIsNotContained = false; - #endif +#endif e0->szNameNoLocale = g_szName_OptionsWidget_dcc; - e0->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_dcc,"options"); + e0->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_dcc, "options"); m_pInstanceTree->append(e0); e0->pChildList = new KviPointerList; e0->pChildList->setAutoDelete(true); - e1 = new OptionsWidgetInstanceEntry; - e1->createProc = &classOptionsWidget_dccGeneral_createInstanceProc; - e1->pWidget = 0; - e1->szClassName = g_szClassName_OptionsWidget_dccGeneral; - e1->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_dccGeneral; - #ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_dccGeneral - e1->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_dccGeneral; - #else - e1->iPriority = 0; - #endif - #ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_dccGeneral - e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_dccGeneral "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_dccGeneral; - #else - e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_dccGeneral; - #endif - e1->szKeywords = __tr2qs_ctx_no_xgettext(e1->szKeywordsNoLocale.toUtf8().data(),"options"); - #ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_dccGeneral - e1->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_dccGeneral; - #else - e1->szGroup = "general"; - #endif - #ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_dccGeneral - e1->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_dccGeneral; - #else - e1->bIsContainer = false; - #endif - #ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_dccGeneral - e1->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_dccGeneral; - #else - e1->bIsNotContained = false; - #endif - e1->szNameNoLocale = g_szName_OptionsWidget_dccGeneral; - e1->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_dccGeneral,"options"); - e0->pChildList->append(e1); - e1->pChildList = 0; - - e1 = new OptionsWidgetInstanceEntry; - e1->createProc = &classOptionsWidget_dccAdvanced_createInstanceProc; - e1->pWidget = 0; - e1->szClassName = g_szClassName_OptionsWidget_dccAdvanced; - e1->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_dccAdvanced; - #ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_dccAdvanced - e1->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_dccAdvanced; - #else - e1->iPriority = 0; - #endif - #ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_dccAdvanced - e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_dccAdvanced "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_dccAdvanced; - #else - e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_dccAdvanced; - #endif - e1->szKeywords = __tr2qs_ctx_no_xgettext(e1->szKeywordsNoLocale.toUtf8().data(),"options"); - #ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_dccAdvanced - e1->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_dccAdvanced; - #else - e1->szGroup = "general"; - #endif - #ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_dccAdvanced - e1->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_dccAdvanced; - #else - e1->bIsContainer = false; - #endif - #ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_dccAdvanced - e1->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_dccAdvanced; - #else - e1->bIsNotContained = false; - #endif - e1->szNameNoLocale = g_szName_OptionsWidget_dccAdvanced; - e1->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_dccAdvanced,"options"); - e0->pChildList->append(e1); - e1->pChildList = 0; - - e1 = new OptionsWidgetInstanceEntry; - e1->createProc = &classOptionsWidget_dccSend_createInstanceProc; - e1->pWidget = 0; - e1->szClassName = g_szClassName_OptionsWidget_dccSend; - e1->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_dccSend; - #ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_dccSend - e1->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_dccSend; - #else - e1->iPriority = 0; - #endif - #ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_dccSend - e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_dccSend "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_dccSend; - #else - e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_dccSend; - #endif - e1->szKeywords = __tr2qs_ctx_no_xgettext(e1->szKeywordsNoLocale.toUtf8().data(),"options"); - #ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_dccSend - e1->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_dccSend; - #else - e1->szGroup = "general"; - #endif - #ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_dccSend - e1->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_dccSend; - #else - e1->bIsContainer = false; - #endif - #ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_dccSend - e1->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_dccSend; - #else - e1->bIsNotContained = false; - #endif - e1->szNameNoLocale = g_szName_OptionsWidget_dccSend; - e1->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_dccSend,"options"); - e0->pChildList->append(e1); - - e1->pChildList = new KviPointerList; - e1->pChildList->setAutoDelete(true); - - e2 = new OptionsWidgetInstanceEntry; - e2->createProc = &classOptionsWidget_dccSendGeneral_createInstanceProc; - e2->pWidget = 0; - e2->szClassName = g_szClassName_OptionsWidget_dccSendGeneral; - e2->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_dccSendGeneral; - #ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_dccSendGeneral - e2->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_dccSendGeneral; - #else - e2->iPriority = 0; - #endif - #ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_dccSendGeneral - e2->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_dccSendGeneral "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_dccSendGeneral; - #else - e2->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_dccSendGeneral; - #endif - e2->szKeywords = __tr2qs_ctx_no_xgettext(e2->szKeywordsNoLocale.toUtf8().data(),"options"); - #ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_dccSendGeneral - e2->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_dccSendGeneral; - #else - e2->szGroup = "general"; - #endif - #ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_dccSendGeneral - e2->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_dccSendGeneral; - #else - e2->bIsContainer = false; - #endif - #ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_dccSendGeneral - e2->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_dccSendGeneral; - #else - e2->bIsNotContained = false; - #endif - e2->szNameNoLocale = g_szName_OptionsWidget_dccSendGeneral; - e2->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_dccSendGeneral,"options"); - e1->pChildList->append(e2); - e2->pChildList = 0; - - e2 = new OptionsWidgetInstanceEntry; - e2->createProc = &classOptionsWidget_dccSendAdvanced_createInstanceProc; - e2->pWidget = 0; - e2->szClassName = g_szClassName_OptionsWidget_dccSendAdvanced; - e2->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_dccSendAdvanced; - #ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_dccSendAdvanced - e2->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_dccSendAdvanced; - #else - e2->iPriority = 0; - #endif - #ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_dccSendAdvanced - e2->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_dccSendAdvanced "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_dccSendAdvanced; - #else - e2->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_dccSendAdvanced; - #endif - e2->szKeywords = __tr2qs_ctx_no_xgettext(e2->szKeywordsNoLocale.toUtf8().data(),"options"); - #ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_dccSendAdvanced - e2->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_dccSendAdvanced; - #else - e2->szGroup = "general"; - #endif - #ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_dccSendAdvanced - e2->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_dccSendAdvanced; - #else - e2->bIsContainer = false; - #endif - #ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_dccSendAdvanced - e2->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_dccSendAdvanced; - #else - e2->bIsNotContained = false; - #endif - e2->szNameNoLocale = g_szName_OptionsWidget_dccSendAdvanced; - e2->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_dccSendAdvanced,"options"); - e1->pChildList->append(e2); - e2->pChildList = 0; - - e1 = new OptionsWidgetInstanceEntry; - e1->createProc = &classOptionsWidget_dccChat_createInstanceProc; - e1->pWidget = 0; - e1->szClassName = g_szClassName_OptionsWidget_dccChat; - e1->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_dccChat; - #ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_dccChat - e1->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_dccChat; - #else - e1->iPriority = 0; - #endif - #ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_dccChat - e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_dccChat "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_dccChat; - #else - e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_dccChat; - #endif - e1->szKeywords = __tr2qs_ctx_no_xgettext(e1->szKeywordsNoLocale.toUtf8().data(),"options"); - #ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_dccChat - e1->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_dccChat; - #else - e1->szGroup = "general"; - #endif - #ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_dccChat - e1->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_dccChat; - #else - e1->bIsContainer = false; - #endif - #ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_dccChat - e1->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_dccChat; - #else - e1->bIsNotContained = false; - #endif - e1->szNameNoLocale = g_szName_OptionsWidget_dccChat; - e1->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_dccChat,"options"); - e0->pChildList->append(e1); - e1->pChildList = 0; - - e1 = new OptionsWidgetInstanceEntry; - e1->createProc = &classOptionsWidget_dccVoice_createInstanceProc; - e1->pWidget = 0; - e1->szClassName = g_szClassName_OptionsWidget_dccVoice; - e1->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_dccVoice; - #ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_dccVoice - e1->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_dccVoice; - #else - e1->iPriority = 0; - #endif - #ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_dccVoice - e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_dccVoice "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_dccVoice; - #else - e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_dccVoice; - #endif - e1->szKeywords = __tr2qs_ctx_no_xgettext(e1->szKeywordsNoLocale.toUtf8().data(),"options"); - #ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_dccVoice - e1->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_dccVoice; - #else - e1->szGroup = "general"; - #endif - #ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_dccVoice - e1->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_dccVoice; - #else - e1->bIsContainer = false; - #endif - #ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_dccVoice - e1->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_dccVoice; - #else - e1->bIsNotContained = false; - #endif - e1->szNameNoLocale = g_szName_OptionsWidget_dccVoice; - e1->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_dccVoice,"options"); - e0->pChildList->append(e1); - e1->pChildList = 0; + e1 = new OptionsWidgetInstanceEntry; + e1->createProc = &classOptionsWidget_dccGeneral_createInstanceProc; + e1->pWidget = 0; + e1->szClassName = g_szClassName_OptionsWidget_dccGeneral; + e1->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_dccGeneral; +#ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_dccGeneral + e1->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_dccGeneral; +#else + e1->iPriority = 0; +#endif +#ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_dccGeneral + e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_dccGeneral "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_dccGeneral; +#else + e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_dccGeneral; +#endif + e1->szKeywords = __tr2qs_ctx_no_xgettext(e1->szKeywordsNoLocale.toUtf8().data(), "options"); +#ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_dccGeneral + e1->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_dccGeneral; +#else + e1->szGroup = "general"; +#endif +#ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_dccGeneral + e1->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_dccGeneral; +#else + e1->bIsContainer = false; +#endif +#ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_dccGeneral + e1->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_dccGeneral; +#else + e1->bIsNotContained = false; +#endif + e1->szNameNoLocale = g_szName_OptionsWidget_dccGeneral; + e1->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_dccGeneral, "options"); + e0->pChildList->append(e1); + e1->pChildList = 0; + + e1 = new OptionsWidgetInstanceEntry; + e1->createProc = &classOptionsWidget_dccAdvanced_createInstanceProc; + e1->pWidget = 0; + e1->szClassName = g_szClassName_OptionsWidget_dccAdvanced; + e1->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_dccAdvanced; +#ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_dccAdvanced + e1->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_dccAdvanced; +#else + e1->iPriority = 0; +#endif +#ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_dccAdvanced + e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_dccAdvanced "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_dccAdvanced; +#else + e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_dccAdvanced; +#endif + e1->szKeywords = __tr2qs_ctx_no_xgettext(e1->szKeywordsNoLocale.toUtf8().data(), "options"); +#ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_dccAdvanced + e1->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_dccAdvanced; +#else + e1->szGroup = "general"; +#endif +#ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_dccAdvanced + e1->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_dccAdvanced; +#else + e1->bIsContainer = false; +#endif +#ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_dccAdvanced + e1->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_dccAdvanced; +#else + e1->bIsNotContained = false; +#endif + e1->szNameNoLocale = g_szName_OptionsWidget_dccAdvanced; + e1->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_dccAdvanced, "options"); + e0->pChildList->append(e1); + e1->pChildList = 0; + + e1 = new OptionsWidgetInstanceEntry; + e1->createProc = &classOptionsWidget_dccSend_createInstanceProc; + e1->pWidget = 0; + e1->szClassName = g_szClassName_OptionsWidget_dccSend; + e1->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_dccSend; +#ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_dccSend + e1->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_dccSend; +#else + e1->iPriority = 0; +#endif +#ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_dccSend + e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_dccSend "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_dccSend; +#else + e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_dccSend; +#endif + e1->szKeywords = __tr2qs_ctx_no_xgettext(e1->szKeywordsNoLocale.toUtf8().data(), "options"); +#ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_dccSend + e1->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_dccSend; +#else + e1->szGroup = "general"; +#endif +#ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_dccSend + e1->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_dccSend; +#else + e1->bIsContainer = false; +#endif +#ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_dccSend + e1->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_dccSend; +#else + e1->bIsNotContained = false; +#endif + e1->szNameNoLocale = g_szName_OptionsWidget_dccSend; + e1->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_dccSend, "options"); + e0->pChildList->append(e1); + + e1->pChildList = new KviPointerList; + e1->pChildList->setAutoDelete(true); + + e2 = new OptionsWidgetInstanceEntry; + e2->createProc = &classOptionsWidget_dccSendGeneral_createInstanceProc; + e2->pWidget = 0; + e2->szClassName = g_szClassName_OptionsWidget_dccSendGeneral; + e2->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_dccSendGeneral; +#ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_dccSendGeneral + e2->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_dccSendGeneral; +#else + e2->iPriority = 0; +#endif +#ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_dccSendGeneral + e2->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_dccSendGeneral "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_dccSendGeneral; +#else + e2->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_dccSendGeneral; +#endif + e2->szKeywords = __tr2qs_ctx_no_xgettext(e2->szKeywordsNoLocale.toUtf8().data(), "options"); +#ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_dccSendGeneral + e2->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_dccSendGeneral; +#else + e2->szGroup = "general"; +#endif +#ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_dccSendGeneral + e2->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_dccSendGeneral; +#else + e2->bIsContainer = false; +#endif +#ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_dccSendGeneral + e2->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_dccSendGeneral; +#else + e2->bIsNotContained = false; +#endif + e2->szNameNoLocale = g_szName_OptionsWidget_dccSendGeneral; + e2->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_dccSendGeneral, "options"); + e1->pChildList->append(e2); + e2->pChildList = 0; + + e2 = new OptionsWidgetInstanceEntry; + e2->createProc = &classOptionsWidget_dccSendAdvanced_createInstanceProc; + e2->pWidget = 0; + e2->szClassName = g_szClassName_OptionsWidget_dccSendAdvanced; + e2->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_dccSendAdvanced; +#ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_dccSendAdvanced + e2->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_dccSendAdvanced; +#else + e2->iPriority = 0; +#endif +#ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_dccSendAdvanced + e2->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_dccSendAdvanced "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_dccSendAdvanced; +#else + e2->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_dccSendAdvanced; +#endif + e2->szKeywords = __tr2qs_ctx_no_xgettext(e2->szKeywordsNoLocale.toUtf8().data(), "options"); +#ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_dccSendAdvanced + e2->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_dccSendAdvanced; +#else + e2->szGroup = "general"; +#endif +#ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_dccSendAdvanced + e2->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_dccSendAdvanced; +#else + e2->bIsContainer = false; +#endif +#ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_dccSendAdvanced + e2->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_dccSendAdvanced; +#else + e2->bIsNotContained = false; +#endif + e2->szNameNoLocale = g_szName_OptionsWidget_dccSendAdvanced; + e2->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_dccSendAdvanced, "options"); + e1->pChildList->append(e2); + e2->pChildList = 0; + + e1 = new OptionsWidgetInstanceEntry; + e1->createProc = &classOptionsWidget_dccChat_createInstanceProc; + e1->pWidget = 0; + e1->szClassName = g_szClassName_OptionsWidget_dccChat; + e1->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_dccChat; +#ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_dccChat + e1->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_dccChat; +#else + e1->iPriority = 0; +#endif +#ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_dccChat + e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_dccChat "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_dccChat; +#else + e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_dccChat; +#endif + e1->szKeywords = __tr2qs_ctx_no_xgettext(e1->szKeywordsNoLocale.toUtf8().data(), "options"); +#ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_dccChat + e1->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_dccChat; +#else + e1->szGroup = "general"; +#endif +#ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_dccChat + e1->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_dccChat; +#else + e1->bIsContainer = false; +#endif +#ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_dccChat + e1->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_dccChat; +#else + e1->bIsNotContained = false; +#endif + e1->szNameNoLocale = g_szName_OptionsWidget_dccChat; + e1->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_dccChat, "options"); + e0->pChildList->append(e1); + e1->pChildList = 0; + + e1 = new OptionsWidgetInstanceEntry; + e1->createProc = &classOptionsWidget_dccVoice_createInstanceProc; + e1->pWidget = 0; + e1->szClassName = g_szClassName_OptionsWidget_dccVoice; + e1->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_dccVoice; +#ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_dccVoice + e1->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_dccVoice; +#else + e1->iPriority = 0; +#endif +#ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_dccVoice + e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_dccVoice "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_dccVoice; +#else + e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_dccVoice; +#endif + e1->szKeywords = __tr2qs_ctx_no_xgettext(e1->szKeywordsNoLocale.toUtf8().data(), "options"); +#ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_dccVoice + e1->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_dccVoice; +#else + e1->szGroup = "general"; +#endif +#ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_dccVoice + e1->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_dccVoice; +#else + e1->bIsContainer = false; +#endif +#ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_dccVoice + e1->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_dccVoice; +#else + e1->bIsNotContained = false; +#endif + e1->szNameNoLocale = g_szName_OptionsWidget_dccVoice; + e1->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_dccVoice, "options"); + e0->pChildList->append(e1); + e1->pChildList = 0; e0 = new OptionsWidgetInstanceEntry; e0->createProc = &classOptionsWidget_general_createInstanceProc; e0->pWidget = 0; e0->szClassName = g_szClassName_OptionsWidget_general; e0->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_general; - #ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_general +#ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_general e0->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_general; - #else +#else e0->iPriority = 0; - #endif - #ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_general +#endif +#ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_general e0->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_general "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_general; - #else +#else e0->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_general; - #endif - e0->szKeywords = __tr2qs_ctx_no_xgettext(e0->szKeywordsNoLocale.toUtf8().data(),"options"); - #ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_general +#endif + e0->szKeywords = __tr2qs_ctx_no_xgettext(e0->szKeywordsNoLocale.toUtf8().data(), "options"); +#ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_general e0->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_general; - #else +#else e0->szGroup = "general"; - #endif - #ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_general +#endif +#ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_general e0->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_general; - #else +#else e0->bIsContainer = false; - #endif - #ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_general +#endif +#ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_general e0->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_general; - #else +#else e0->bIsNotContained = false; - #endif +#endif e0->szNameNoLocale = g_szName_OptionsWidget_general; - e0->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_general,"options"); + e0->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_general, "options"); m_pInstanceTree->append(e0); e0->pChildList = new KviPointerList; e0->pChildList->setAutoDelete(true); - e1 = new OptionsWidgetInstanceEntry; - e1->createProc = &classOptionsWidget_mediaTypes_createInstanceProc; - e1->pWidget = 0; - e1->szClassName = g_szClassName_OptionsWidget_mediaTypes; - e1->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_mediaTypes; - #ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_mediaTypes - e1->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_mediaTypes; - #else - e1->iPriority = 0; - #endif - #ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_mediaTypes - e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_mediaTypes "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_mediaTypes; - #else - e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_mediaTypes; - #endif - e1->szKeywords = __tr2qs_ctx_no_xgettext(e1->szKeywordsNoLocale.toUtf8().data(),"options"); - #ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_mediaTypes - e1->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_mediaTypes; - #else - e1->szGroup = "general"; - #endif - #ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_mediaTypes - e1->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_mediaTypes; - #else - e1->bIsContainer = false; - #endif - #ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_mediaTypes - e1->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_mediaTypes; - #else - e1->bIsNotContained = false; - #endif - e1->szNameNoLocale = g_szName_OptionsWidget_mediaTypes; - e1->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_mediaTypes,"options"); - e0->pChildList->append(e1); - e1->pChildList = 0; - - e1 = new OptionsWidgetInstanceEntry; - e1->createProc = &classOptionsWidget_sound_createInstanceProc; - e1->pWidget = 0; - e1->szClassName = g_szClassName_OptionsWidget_sound; - e1->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_sound; - #ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_sound - e1->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_sound; - #else - e1->iPriority = 0; - #endif - #ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_sound - e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_sound "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_sound; - #else - e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_sound; - #endif - e1->szKeywords = __tr2qs_ctx_no_xgettext(e1->szKeywordsNoLocale.toUtf8().data(),"options"); - #ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_sound - e1->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_sound; - #else - e1->szGroup = "general"; - #endif - #ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_sound - e1->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_sound; - #else - e1->bIsContainer = false; - #endif - #ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_sound - e1->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_sound; - #else - e1->bIsNotContained = false; - #endif - e1->szNameNoLocale = g_szName_OptionsWidget_sound; - e1->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_sound,"options"); - e0->pChildList->append(e1); - - e1->pChildList = new KviPointerList; - e1->pChildList->setAutoDelete(true); - - e2 = new OptionsWidgetInstanceEntry; - e2->createProc = &classOptionsWidget_soundGeneral_createInstanceProc; - e2->pWidget = 0; - e2->szClassName = g_szClassName_OptionsWidget_soundGeneral; - e2->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_soundGeneral; - #ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_soundGeneral - e2->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_soundGeneral; - #else - e2->iPriority = 0; - #endif - #ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_soundGeneral - e2->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_soundGeneral "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_soundGeneral; - #else - e2->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_soundGeneral; - #endif - e2->szKeywords = __tr2qs_ctx_no_xgettext(e2->szKeywordsNoLocale.toUtf8().data(),"options"); - #ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_soundGeneral - e2->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_soundGeneral; - #else - e2->szGroup = "general"; - #endif - #ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_soundGeneral - e2->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_soundGeneral; - #else - e2->bIsContainer = false; - #endif - #ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_soundGeneral - e2->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_soundGeneral; - #else - e2->bIsNotContained = false; - #endif - e2->szNameNoLocale = g_szName_OptionsWidget_soundGeneral; - e2->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_soundGeneral,"options"); - e1->pChildList->append(e2); - e2->pChildList = 0; - - e2 = new OptionsWidgetInstanceEntry; - e2->createProc = &classOptionsWidget_sounds_createInstanceProc; - e2->pWidget = 0; - e2->szClassName = g_szClassName_OptionsWidget_sounds; - e2->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_sounds; - #ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_sounds - e2->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_sounds; - #else - e2->iPriority = 0; - #endif - #ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_sounds - e2->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_sounds "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_sounds; - #else - e2->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_sounds; - #endif - e2->szKeywords = __tr2qs_ctx_no_xgettext(e2->szKeywordsNoLocale.toUtf8().data(),"options"); - #ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_sounds - e2->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_sounds; - #else - e2->szGroup = "general"; - #endif - #ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_sounds - e2->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_sounds; - #else - e2->bIsContainer = false; - #endif - #ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_sounds - e2->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_sounds; - #else - e2->bIsNotContained = false; - #endif - e2->szNameNoLocale = g_szName_OptionsWidget_sounds; - e2->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_sounds,"options"); - e1->pChildList->append(e2); - e2->pChildList = 0; - - e1 = new OptionsWidgetInstanceEntry; - e1->createProc = &classOptionsWidget_textEncoding_createInstanceProc; - e1->pWidget = 0; - e1->szClassName = g_szClassName_OptionsWidget_textEncoding; - e1->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_textEncoding; - #ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_textEncoding - e1->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_textEncoding; - #else - e1->iPriority = 0; - #endif - #ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_textEncoding - e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_textEncoding "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_textEncoding; - #else - e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_textEncoding; - #endif - e1->szKeywords = __tr2qs_ctx_no_xgettext(e1->szKeywordsNoLocale.toUtf8().data(),"options"); - #ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_textEncoding - e1->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_textEncoding; - #else - e1->szGroup = "general"; - #endif - #ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_textEncoding - e1->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_textEncoding; - #else - e1->bIsContainer = false; - #endif - #ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_textEncoding - e1->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_textEncoding; - #else - e1->bIsNotContained = false; - #endif - e1->szNameNoLocale = g_szName_OptionsWidget_textEncoding; - e1->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_textEncoding,"options"); - e0->pChildList->append(e1); - e1->pChildList = 0; - - e1 = new OptionsWidgetInstanceEntry; - e1->createProc = &classOptionsWidget_uparser_createInstanceProc; - e1->pWidget = 0; - e1->szClassName = g_szClassName_OptionsWidget_uparser; - e1->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_uparser; - #ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_uparser - e1->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_uparser; - #else - e1->iPriority = 0; - #endif - #ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_uparser - e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_uparser "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_uparser; - #else - e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_uparser; - #endif - e1->szKeywords = __tr2qs_ctx_no_xgettext(e1->szKeywordsNoLocale.toUtf8().data(),"options"); - #ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_uparser - e1->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_uparser; - #else - e1->szGroup = "general"; - #endif - #ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_uparser - e1->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_uparser; - #else - e1->bIsContainer = false; - #endif - #ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_uparser - e1->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_uparser; - #else - e1->bIsNotContained = false; - #endif - e1->szNameNoLocale = g_szName_OptionsWidget_uparser; - e1->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_uparser,"options"); - e0->pChildList->append(e1); - e1->pChildList = 0; - - e1 = new OptionsWidgetInstanceEntry; - e1->createProc = &classOptionsWidget_urlHandlers_createInstanceProc; - e1->pWidget = 0; - e1->szClassName = g_szClassName_OptionsWidget_urlHandlers; - e1->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_urlHandlers; - #ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_urlHandlers - e1->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_urlHandlers; - #else - e1->iPriority = 0; - #endif - #ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_urlHandlers - e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_urlHandlers "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_urlHandlers; - #else - e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_urlHandlers; - #endif - e1->szKeywords = __tr2qs_ctx_no_xgettext(e1->szKeywordsNoLocale.toUtf8().data(),"options"); - #ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_urlHandlers - e1->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_urlHandlers; - #else - e1->szGroup = "general"; - #endif - #ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_urlHandlers - e1->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_urlHandlers; - #else - e1->bIsContainer = false; - #endif - #ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_urlHandlers - e1->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_urlHandlers; - #else - e1->bIsNotContained = false; - #endif - e1->szNameNoLocale = g_szName_OptionsWidget_urlHandlers; - e1->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_urlHandlers,"options"); - e0->pChildList->append(e1); - e1->pChildList = 0; + e1 = new OptionsWidgetInstanceEntry; + e1->createProc = &classOptionsWidget_mediaTypes_createInstanceProc; + e1->pWidget = 0; + e1->szClassName = g_szClassName_OptionsWidget_mediaTypes; + e1->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_mediaTypes; +#ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_mediaTypes + e1->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_mediaTypes; +#else + e1->iPriority = 0; +#endif +#ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_mediaTypes + e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_mediaTypes "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_mediaTypes; +#else + e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_mediaTypes; +#endif + e1->szKeywords = __tr2qs_ctx_no_xgettext(e1->szKeywordsNoLocale.toUtf8().data(), "options"); +#ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_mediaTypes + e1->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_mediaTypes; +#else + e1->szGroup = "general"; +#endif +#ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_mediaTypes + e1->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_mediaTypes; +#else + e1->bIsContainer = false; +#endif +#ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_mediaTypes + e1->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_mediaTypes; +#else + e1->bIsNotContained = false; +#endif + e1->szNameNoLocale = g_szName_OptionsWidget_mediaTypes; + e1->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_mediaTypes, "options"); + e0->pChildList->append(e1); + e1->pChildList = 0; + + e1 = new OptionsWidgetInstanceEntry; + e1->createProc = &classOptionsWidget_sound_createInstanceProc; + e1->pWidget = 0; + e1->szClassName = g_szClassName_OptionsWidget_sound; + e1->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_sound; +#ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_sound + e1->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_sound; +#else + e1->iPriority = 0; +#endif +#ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_sound + e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_sound "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_sound; +#else + e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_sound; +#endif + e1->szKeywords = __tr2qs_ctx_no_xgettext(e1->szKeywordsNoLocale.toUtf8().data(), "options"); +#ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_sound + e1->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_sound; +#else + e1->szGroup = "general"; +#endif +#ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_sound + e1->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_sound; +#else + e1->bIsContainer = false; +#endif +#ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_sound + e1->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_sound; +#else + e1->bIsNotContained = false; +#endif + e1->szNameNoLocale = g_szName_OptionsWidget_sound; + e1->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_sound, "options"); + e0->pChildList->append(e1); + + e1->pChildList = new KviPointerList; + e1->pChildList->setAutoDelete(true); + + e2 = new OptionsWidgetInstanceEntry; + e2->createProc = &classOptionsWidget_soundGeneral_createInstanceProc; + e2->pWidget = 0; + e2->szClassName = g_szClassName_OptionsWidget_soundGeneral; + e2->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_soundGeneral; +#ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_soundGeneral + e2->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_soundGeneral; +#else + e2->iPriority = 0; +#endif +#ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_soundGeneral + e2->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_soundGeneral "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_soundGeneral; +#else + e2->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_soundGeneral; +#endif + e2->szKeywords = __tr2qs_ctx_no_xgettext(e2->szKeywordsNoLocale.toUtf8().data(), "options"); +#ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_soundGeneral + e2->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_soundGeneral; +#else + e2->szGroup = "general"; +#endif +#ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_soundGeneral + e2->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_soundGeneral; +#else + e2->bIsContainer = false; +#endif +#ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_soundGeneral + e2->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_soundGeneral; +#else + e2->bIsNotContained = false; +#endif + e2->szNameNoLocale = g_szName_OptionsWidget_soundGeneral; + e2->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_soundGeneral, "options"); + e1->pChildList->append(e2); + e2->pChildList = 0; + + e2 = new OptionsWidgetInstanceEntry; + e2->createProc = &classOptionsWidget_sounds_createInstanceProc; + e2->pWidget = 0; + e2->szClassName = g_szClassName_OptionsWidget_sounds; + e2->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_sounds; +#ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_sounds + e2->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_sounds; +#else + e2->iPriority = 0; +#endif +#ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_sounds + e2->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_sounds "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_sounds; +#else + e2->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_sounds; +#endif + e2->szKeywords = __tr2qs_ctx_no_xgettext(e2->szKeywordsNoLocale.toUtf8().data(), "options"); +#ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_sounds + e2->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_sounds; +#else + e2->szGroup = "general"; +#endif +#ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_sounds + e2->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_sounds; +#else + e2->bIsContainer = false; +#endif +#ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_sounds + e2->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_sounds; +#else + e2->bIsNotContained = false; +#endif + e2->szNameNoLocale = g_szName_OptionsWidget_sounds; + e2->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_sounds, "options"); + e1->pChildList->append(e2); + e2->pChildList = 0; + + e1 = new OptionsWidgetInstanceEntry; + e1->createProc = &classOptionsWidget_textEncoding_createInstanceProc; + e1->pWidget = 0; + e1->szClassName = g_szClassName_OptionsWidget_textEncoding; + e1->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_textEncoding; +#ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_textEncoding + e1->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_textEncoding; +#else + e1->iPriority = 0; +#endif +#ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_textEncoding + e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_textEncoding "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_textEncoding; +#else + e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_textEncoding; +#endif + e1->szKeywords = __tr2qs_ctx_no_xgettext(e1->szKeywordsNoLocale.toUtf8().data(), "options"); +#ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_textEncoding + e1->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_textEncoding; +#else + e1->szGroup = "general"; +#endif +#ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_textEncoding + e1->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_textEncoding; +#else + e1->bIsContainer = false; +#endif +#ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_textEncoding + e1->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_textEncoding; +#else + e1->bIsNotContained = false; +#endif + e1->szNameNoLocale = g_szName_OptionsWidget_textEncoding; + e1->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_textEncoding, "options"); + e0->pChildList->append(e1); + e1->pChildList = 0; + + e1 = new OptionsWidgetInstanceEntry; + e1->createProc = &classOptionsWidget_uparser_createInstanceProc; + e1->pWidget = 0; + e1->szClassName = g_szClassName_OptionsWidget_uparser; + e1->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_uparser; +#ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_uparser + e1->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_uparser; +#else + e1->iPriority = 0; +#endif +#ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_uparser + e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_uparser "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_uparser; +#else + e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_uparser; +#endif + e1->szKeywords = __tr2qs_ctx_no_xgettext(e1->szKeywordsNoLocale.toUtf8().data(), "options"); +#ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_uparser + e1->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_uparser; +#else + e1->szGroup = "general"; +#endif +#ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_uparser + e1->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_uparser; +#else + e1->bIsContainer = false; +#endif +#ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_uparser + e1->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_uparser; +#else + e1->bIsNotContained = false; +#endif + e1->szNameNoLocale = g_szName_OptionsWidget_uparser; + e1->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_uparser, "options"); + e0->pChildList->append(e1); + e1->pChildList = 0; + + e1 = new OptionsWidgetInstanceEntry; + e1->createProc = &classOptionsWidget_urlHandlers_createInstanceProc; + e1->pWidget = 0; + e1->szClassName = g_szClassName_OptionsWidget_urlHandlers; + e1->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_urlHandlers; +#ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_urlHandlers + e1->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_urlHandlers; +#else + e1->iPriority = 0; +#endif +#ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_urlHandlers + e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_urlHandlers "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_urlHandlers; +#else + e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_urlHandlers; +#endif + e1->szKeywords = __tr2qs_ctx_no_xgettext(e1->szKeywordsNoLocale.toUtf8().data(), "options"); +#ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_urlHandlers + e1->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_urlHandlers; +#else + e1->szGroup = "general"; +#endif +#ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_urlHandlers + e1->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_urlHandlers; +#else + e1->bIsContainer = false; +#endif +#ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_urlHandlers + e1->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_urlHandlers; +#else + e1->bIsNotContained = false; +#endif + e1->szNameNoLocale = g_szName_OptionsWidget_urlHandlers; + e1->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_urlHandlers, "options"); + e0->pChildList->append(e1); + e1->pChildList = 0; e0 = new OptionsWidgetInstanceEntry; e0->createProc = &classOptionsWidget_identity_createInstanceProc; e0->pWidget = 0; e0->szClassName = g_szClassName_OptionsWidget_identity; e0->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_identity; - #ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_identity +#ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_identity e0->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_identity; - #else +#else e0->iPriority = 0; - #endif - #ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_identity +#endif +#ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_identity e0->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_identity "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_identity; - #else +#else e0->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_identity; - #endif - e0->szKeywords = __tr2qs_ctx_no_xgettext(e0->szKeywordsNoLocale.toUtf8().data(),"options"); - #ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_identity +#endif + e0->szKeywords = __tr2qs_ctx_no_xgettext(e0->szKeywordsNoLocale.toUtf8().data(), "options"); +#ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_identity e0->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_identity; - #else +#else e0->szGroup = "general"; - #endif - #ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_identity +#endif +#ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_identity e0->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_identity; - #else +#else e0->bIsContainer = false; - #endif - #ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_identity +#endif +#ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_identity e0->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_identity; - #else +#else e0->bIsNotContained = false; - #endif +#endif e0->szNameNoLocale = g_szName_OptionsWidget_identity; - e0->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_identity,"options"); + e0->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_identity, "options"); m_pInstanceTree->append(e0); e0->pChildList = new KviPointerList; e0->pChildList->setAutoDelete(true); - e1 = new OptionsWidgetInstanceEntry; - e1->createProc = &classKviIdentityGeneralOptionsWidget_createInstanceProc; - e1->pWidget = 0; - e1->szClassName = g_szClassName_KviIdentityGeneralOptionsWidget; - e1->eIcon = KVI_OPTIONS_WIDGET_ICON_KviIdentityGeneralOptionsWidget; - #ifdef KVI_OPTIONS_WIDGET_PRIORITY_KviIdentityGeneralOptionsWidget - e1->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_KviIdentityGeneralOptionsWidget; - #else - e1->iPriority = 0; - #endif - #ifdef KVI_OPTIONS_WIDGET_KEYWORDS_KviIdentityGeneralOptionsWidget - e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_KviIdentityGeneralOptionsWidget "," KVI_OPTIONS_WIDGET_KEYWORDS_KviIdentityGeneralOptionsWidget; - #else - e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_KviIdentityGeneralOptionsWidget; - #endif - e1->szKeywords = __tr2qs_ctx_no_xgettext(e1->szKeywordsNoLocale.toUtf8().data(),"options"); - #ifdef KVI_OPTIONS_WIDGET_GROUP_KviIdentityGeneralOptionsWidget - e1->szGroup = KVI_OPTIONS_WIDGET_GROUP_KviIdentityGeneralOptionsWidget; - #else - e1->szGroup = "general"; - #endif - #ifdef KVI_OPTIONS_WIDGET_CONTAINER_KviIdentityGeneralOptionsWidget - e1->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_KviIdentityGeneralOptionsWidget; - #else - e1->bIsContainer = false; - #endif - #ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_KviIdentityGeneralOptionsWidget - e1->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_KviIdentityGeneralOptionsWidget; - #else - e1->bIsNotContained = false; - #endif - e1->szNameNoLocale = g_szName_KviIdentityGeneralOptionsWidget; - e1->szName = __tr2qs_ctx_no_xgettext(g_szName_KviIdentityGeneralOptionsWidget,"options"); - e0->pChildList->append(e1); - e1->pChildList = 0; - - e1 = new OptionsWidgetInstanceEntry; - e1->createProc = &classOptionsWidget_identityAvatar_createInstanceProc; - e1->pWidget = 0; - e1->szClassName = g_szClassName_OptionsWidget_identityAvatar; - e1->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_identityAvatar; - #ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_identityAvatar - e1->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_identityAvatar; - #else - e1->iPriority = 0; - #endif - #ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_identityAvatar - e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_identityAvatar "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_identityAvatar; - #else - e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_identityAvatar; - #endif - e1->szKeywords = __tr2qs_ctx_no_xgettext(e1->szKeywordsNoLocale.toUtf8().data(),"options"); - #ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_identityAvatar - e1->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_identityAvatar; - #else - e1->szGroup = "general"; - #endif - #ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_identityAvatar - e1->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_identityAvatar; - #else - e1->bIsContainer = false; - #endif - #ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_identityAvatar - e1->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_identityAvatar; - #else - e1->bIsNotContained = false; - #endif - e1->szNameNoLocale = g_szName_OptionsWidget_identityAvatar; - e1->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_identityAvatar,"options"); - e0->pChildList->append(e1); - e1->pChildList = 0; - - e1 = new OptionsWidgetInstanceEntry; - e1->createProc = &classOptionsWidget_identityAdvanced_createInstanceProc; - e1->pWidget = 0; - e1->szClassName = g_szClassName_OptionsWidget_identityAdvanced; - e1->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_identityAdvanced; - #ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_identityAdvanced - e1->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_identityAdvanced; - #else - e1->iPriority = 0; - #endif - #ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_identityAdvanced - e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_identityAdvanced "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_identityAdvanced; - #else - e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_identityAdvanced; - #endif - e1->szKeywords = __tr2qs_ctx_no_xgettext(e1->szKeywordsNoLocale.toUtf8().data(),"options"); - #ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_identityAdvanced - e1->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_identityAdvanced; - #else - e1->szGroup = "general"; - #endif - #ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_identityAdvanced - e1->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_identityAdvanced; - #else - e1->bIsContainer = false; - #endif - #ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_identityAdvanced - e1->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_identityAdvanced; - #else - e1->bIsNotContained = false; - #endif - e1->szNameNoLocale = g_szName_OptionsWidget_identityAdvanced; - e1->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_identityAdvanced,"options"); - e0->pChildList->append(e1); - e1->pChildList = 0; - - e1 = new OptionsWidgetInstanceEntry; - e1->createProc = &classOptionsWidget_identityProfile_createInstanceProc; - e1->pWidget = 0; - e1->szClassName = g_szClassName_OptionsWidget_identityProfile; - e1->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_identityProfile; - #ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_identityProfile - e1->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_identityProfile; - #else - e1->iPriority = 0; - #endif - #ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_identityProfile - e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_identityProfile "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_identityProfile; - #else - e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_identityProfile; - #endif - e1->szKeywords = __tr2qs_ctx_no_xgettext(e1->szKeywordsNoLocale.toUtf8().data(),"options"); - #ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_identityProfile - e1->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_identityProfile; - #else - e1->szGroup = "general"; - #endif - #ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_identityProfile - e1->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_identityProfile; - #else - e1->bIsContainer = false; - #endif - #ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_identityProfile - e1->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_identityProfile; - #else - e1->bIsNotContained = false; - #endif - e1->szNameNoLocale = g_szName_OptionsWidget_identityProfile; - e1->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_identityProfile,"options"); - e0->pChildList->append(e1); - e1->pChildList = 0; + e1 = new OptionsWidgetInstanceEntry; + e1->createProc = &classKviIdentityGeneralOptionsWidget_createInstanceProc; + e1->pWidget = 0; + e1->szClassName = g_szClassName_KviIdentityGeneralOptionsWidget; + e1->eIcon = KVI_OPTIONS_WIDGET_ICON_KviIdentityGeneralOptionsWidget; +#ifdef KVI_OPTIONS_WIDGET_PRIORITY_KviIdentityGeneralOptionsWidget + e1->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_KviIdentityGeneralOptionsWidget; +#else + e1->iPriority = 0; +#endif +#ifdef KVI_OPTIONS_WIDGET_KEYWORDS_KviIdentityGeneralOptionsWidget + e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_KviIdentityGeneralOptionsWidget "," KVI_OPTIONS_WIDGET_KEYWORDS_KviIdentityGeneralOptionsWidget; +#else + e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_KviIdentityGeneralOptionsWidget; +#endif + e1->szKeywords = __tr2qs_ctx_no_xgettext(e1->szKeywordsNoLocale.toUtf8().data(), "options"); +#ifdef KVI_OPTIONS_WIDGET_GROUP_KviIdentityGeneralOptionsWidget + e1->szGroup = KVI_OPTIONS_WIDGET_GROUP_KviIdentityGeneralOptionsWidget; +#else + e1->szGroup = "general"; +#endif +#ifdef KVI_OPTIONS_WIDGET_CONTAINER_KviIdentityGeneralOptionsWidget + e1->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_KviIdentityGeneralOptionsWidget; +#else + e1->bIsContainer = false; +#endif +#ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_KviIdentityGeneralOptionsWidget + e1->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_KviIdentityGeneralOptionsWidget; +#else + e1->bIsNotContained = false; +#endif + e1->szNameNoLocale = g_szName_KviIdentityGeneralOptionsWidget; + e1->szName = __tr2qs_ctx_no_xgettext(g_szName_KviIdentityGeneralOptionsWidget, "options"); + e0->pChildList->append(e1); + e1->pChildList = 0; + + e1 = new OptionsWidgetInstanceEntry; + e1->createProc = &classOptionsWidget_identityAvatar_createInstanceProc; + e1->pWidget = 0; + e1->szClassName = g_szClassName_OptionsWidget_identityAvatar; + e1->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_identityAvatar; +#ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_identityAvatar + e1->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_identityAvatar; +#else + e1->iPriority = 0; +#endif +#ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_identityAvatar + e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_identityAvatar "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_identityAvatar; +#else + e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_identityAvatar; +#endif + e1->szKeywords = __tr2qs_ctx_no_xgettext(e1->szKeywordsNoLocale.toUtf8().data(), "options"); +#ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_identityAvatar + e1->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_identityAvatar; +#else + e1->szGroup = "general"; +#endif +#ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_identityAvatar + e1->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_identityAvatar; +#else + e1->bIsContainer = false; +#endif +#ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_identityAvatar + e1->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_identityAvatar; +#else + e1->bIsNotContained = false; +#endif + e1->szNameNoLocale = g_szName_OptionsWidget_identityAvatar; + e1->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_identityAvatar, "options"); + e0->pChildList->append(e1); + e1->pChildList = 0; + + e1 = new OptionsWidgetInstanceEntry; + e1->createProc = &classOptionsWidget_identityAdvanced_createInstanceProc; + e1->pWidget = 0; + e1->szClassName = g_szClassName_OptionsWidget_identityAdvanced; + e1->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_identityAdvanced; +#ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_identityAdvanced + e1->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_identityAdvanced; +#else + e1->iPriority = 0; +#endif +#ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_identityAdvanced + e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_identityAdvanced "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_identityAdvanced; +#else + e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_identityAdvanced; +#endif + e1->szKeywords = __tr2qs_ctx_no_xgettext(e1->szKeywordsNoLocale.toUtf8().data(), "options"); +#ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_identityAdvanced + e1->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_identityAdvanced; +#else + e1->szGroup = "general"; +#endif +#ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_identityAdvanced + e1->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_identityAdvanced; +#else + e1->bIsContainer = false; +#endif +#ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_identityAdvanced + e1->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_identityAdvanced; +#else + e1->bIsNotContained = false; +#endif + e1->szNameNoLocale = g_szName_OptionsWidget_identityAdvanced; + e1->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_identityAdvanced, "options"); + e0->pChildList->append(e1); + e1->pChildList = 0; + + e1 = new OptionsWidgetInstanceEntry; + e1->createProc = &classOptionsWidget_identityProfile_createInstanceProc; + e1->pWidget = 0; + e1->szClassName = g_szClassName_OptionsWidget_identityProfile; + e1->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_identityProfile; +#ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_identityProfile + e1->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_identityProfile; +#else + e1->iPriority = 0; +#endif +#ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_identityProfile + e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_identityProfile "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_identityProfile; +#else + e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_identityProfile; +#endif + e1->szKeywords = __tr2qs_ctx_no_xgettext(e1->szKeywordsNoLocale.toUtf8().data(), "options"); +#ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_identityProfile + e1->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_identityProfile; +#else + e1->szGroup = "general"; +#endif +#ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_identityProfile + e1->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_identityProfile; +#else + e1->bIsContainer = false; +#endif +#ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_identityProfile + e1->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_identityProfile; +#else + e1->bIsNotContained = false; +#endif + e1->szNameNoLocale = g_szName_OptionsWidget_identityProfile; + e1->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_identityProfile, "options"); + e0->pChildList->append(e1); + e1->pChildList = 0; e0 = new OptionsWidgetInstanceEntry; e0->createProc = &classOptionsWidget_inputLook_createInstanceProc; e0->pWidget = 0; e0->szClassName = g_szClassName_OptionsWidget_inputLook; e0->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_inputLook; - #ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_inputLook +#ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_inputLook e0->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_inputLook; - #else +#else e0->iPriority = 0; - #endif - #ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_inputLook +#endif +#ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_inputLook e0->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_inputLook "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_inputLook; - #else +#else e0->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_inputLook; - #endif - e0->szKeywords = __tr2qs_ctx_no_xgettext(e0->szKeywordsNoLocale.toUtf8().data(),"options"); - #ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_inputLook +#endif + e0->szKeywords = __tr2qs_ctx_no_xgettext(e0->szKeywordsNoLocale.toUtf8().data(), "options"); +#ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_inputLook e0->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_inputLook; - #else +#else e0->szGroup = "general"; - #endif - #ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_inputLook +#endif +#ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_inputLook e0->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_inputLook; - #else +#else e0->bIsContainer = false; - #endif - #ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_inputLook +#endif +#ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_inputLook e0->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_inputLook; - #else +#else e0->bIsNotContained = false; - #endif +#endif e0->szNameNoLocale = g_szName_OptionsWidget_inputLook; - e0->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_inputLook,"options"); + e0->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_inputLook, "options"); m_pInstanceTree->append(e0); e0->pChildList = 0; @@ -1692,1383 +1689,1383 @@ OptionsInstanceManager::OptionsInstanceManager() e0->pWidget = 0; e0->szClassName = g_szClassName_OptionsWidget_interfaceFeatures; e0->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_interfaceFeatures; - #ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_interfaceFeatures +#ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_interfaceFeatures e0->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_interfaceFeatures; - #else +#else e0->iPriority = 0; - #endif - #ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_interfaceFeatures +#endif +#ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_interfaceFeatures e0->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_interfaceFeatures "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_interfaceFeatures; - #else +#else e0->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_interfaceFeatures; - #endif - e0->szKeywords = __tr2qs_ctx_no_xgettext(e0->szKeywordsNoLocale.toUtf8().data(),"options"); - #ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_interfaceFeatures +#endif + e0->szKeywords = __tr2qs_ctx_no_xgettext(e0->szKeywordsNoLocale.toUtf8().data(), "options"); +#ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_interfaceFeatures e0->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_interfaceFeatures; - #else +#else e0->szGroup = "general"; - #endif - #ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_interfaceFeatures +#endif +#ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_interfaceFeatures e0->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_interfaceFeatures; - #else +#else e0->bIsContainer = false; - #endif - #ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_interfaceFeatures +#endif +#ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_interfaceFeatures e0->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_interfaceFeatures; - #else +#else e0->bIsNotContained = false; - #endif +#endif e0->szNameNoLocale = g_szName_OptionsWidget_interfaceFeatures; - e0->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_interfaceFeatures,"options"); + e0->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_interfaceFeatures, "options"); m_pInstanceTree->append(e0); e0->pChildList = new KviPointerList; e0->pChildList->setAutoDelete(true); - e1 = new OptionsWidgetInstanceEntry; - e1->createProc = &classOptionsWidget_inputFeatures_createInstanceProc; - e1->pWidget = 0; - e1->szClassName = g_szClassName_OptionsWidget_inputFeatures; - e1->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_inputFeatures; - #ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_inputFeatures - e1->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_inputFeatures; - #else - e1->iPriority = 0; - #endif - #ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_inputFeatures - e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_inputFeatures "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_inputFeatures; - #else - e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_inputFeatures; - #endif - e1->szKeywords = __tr2qs_ctx_no_xgettext(e1->szKeywordsNoLocale.toUtf8().data(),"options"); - #ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_inputFeatures - e1->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_inputFeatures; - #else - e1->szGroup = "general"; - #endif - #ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_inputFeatures - e1->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_inputFeatures; - #else - e1->bIsContainer = false; - #endif - #ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_inputFeatures - e1->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_inputFeatures; - #else - e1->bIsNotContained = false; - #endif - e1->szNameNoLocale = g_szName_OptionsWidget_inputFeatures; - e1->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_inputFeatures,"options"); - e0->pChildList->append(e1); - e1->pChildList = 0; - - e1 = new OptionsWidgetInstanceEntry; - e1->createProc = &classOptionsWidget_notifier_createInstanceProc; - e1->pWidget = 0; - e1->szClassName = g_szClassName_OptionsWidget_notifier; - e1->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_notifier; - #ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_notifier - e1->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_notifier; - #else - e1->iPriority = 0; - #endif - #ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_notifier - e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_notifier "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_notifier; - #else - e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_notifier; - #endif - e1->szKeywords = __tr2qs_ctx_no_xgettext(e1->szKeywordsNoLocale.toUtf8().data(),"options"); - #ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_notifier - e1->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_notifier; - #else - e1->szGroup = "general"; - #endif - #ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_notifier - e1->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_notifier; - #else - e1->bIsContainer = false; - #endif - #ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_notifier - e1->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_notifier; - #else - e1->bIsNotContained = false; - #endif - e1->szNameNoLocale = g_szName_OptionsWidget_notifier; - e1->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_notifier,"options"); - e0->pChildList->append(e1); - e1->pChildList = 0; - - e1 = new OptionsWidgetInstanceEntry; - e1->createProc = &classOptionsWidget_tray_createInstanceProc; - e1->pWidget = 0; - e1->szClassName = g_szClassName_OptionsWidget_tray; - e1->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_tray; - #ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_tray - e1->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_tray; - #else - e1->iPriority = 0; - #endif - #ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_tray - e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_tray "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_tray; - #else - e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_tray; - #endif - e1->szKeywords = __tr2qs_ctx_no_xgettext(e1->szKeywordsNoLocale.toUtf8().data(),"options"); - #ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_tray - e1->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_tray; - #else - e1->szGroup = "general"; - #endif - #ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_tray - e1->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_tray; - #else - e1->bIsContainer = false; - #endif - #ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_tray - e1->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_tray; - #else - e1->bIsNotContained = false; - #endif - e1->szNameNoLocale = g_szName_OptionsWidget_tray; - e1->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_tray,"options"); - e0->pChildList->append(e1); - e1->pChildList = 0; + e1 = new OptionsWidgetInstanceEntry; + e1->createProc = &classOptionsWidget_inputFeatures_createInstanceProc; + e1->pWidget = 0; + e1->szClassName = g_szClassName_OptionsWidget_inputFeatures; + e1->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_inputFeatures; +#ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_inputFeatures + e1->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_inputFeatures; +#else + e1->iPriority = 0; +#endif +#ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_inputFeatures + e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_inputFeatures "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_inputFeatures; +#else + e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_inputFeatures; +#endif + e1->szKeywords = __tr2qs_ctx_no_xgettext(e1->szKeywordsNoLocale.toUtf8().data(), "options"); +#ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_inputFeatures + e1->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_inputFeatures; +#else + e1->szGroup = "general"; +#endif +#ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_inputFeatures + e1->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_inputFeatures; +#else + e1->bIsContainer = false; +#endif +#ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_inputFeatures + e1->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_inputFeatures; +#else + e1->bIsNotContained = false; +#endif + e1->szNameNoLocale = g_szName_OptionsWidget_inputFeatures; + e1->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_inputFeatures, "options"); + e0->pChildList->append(e1); + e1->pChildList = 0; + + e1 = new OptionsWidgetInstanceEntry; + e1->createProc = &classOptionsWidget_notifier_createInstanceProc; + e1->pWidget = 0; + e1->szClassName = g_szClassName_OptionsWidget_notifier; + e1->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_notifier; +#ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_notifier + e1->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_notifier; +#else + e1->iPriority = 0; +#endif +#ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_notifier + e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_notifier "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_notifier; +#else + e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_notifier; +#endif + e1->szKeywords = __tr2qs_ctx_no_xgettext(e1->szKeywordsNoLocale.toUtf8().data(), "options"); +#ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_notifier + e1->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_notifier; +#else + e1->szGroup = "general"; +#endif +#ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_notifier + e1->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_notifier; +#else + e1->bIsContainer = false; +#endif +#ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_notifier + e1->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_notifier; +#else + e1->bIsNotContained = false; +#endif + e1->szNameNoLocale = g_szName_OptionsWidget_notifier; + e1->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_notifier, "options"); + e0->pChildList->append(e1); + e1->pChildList = 0; + + e1 = new OptionsWidgetInstanceEntry; + e1->createProc = &classOptionsWidget_tray_createInstanceProc; + e1->pWidget = 0; + e1->szClassName = g_szClassName_OptionsWidget_tray; + e1->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_tray; +#ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_tray + e1->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_tray; +#else + e1->iPriority = 0; +#endif +#ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_tray + e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_tray "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_tray; +#else + e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_tray; +#endif + e1->szKeywords = __tr2qs_ctx_no_xgettext(e1->szKeywordsNoLocale.toUtf8().data(), "options"); +#ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_tray + e1->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_tray; +#else + e1->szGroup = "general"; +#endif +#ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_tray + e1->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_tray; +#else + e1->bIsContainer = false; +#endif +#ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_tray + e1->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_tray; +#else + e1->bIsNotContained = false; +#endif + e1->szNameNoLocale = g_szName_OptionsWidget_tray; + e1->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_tray, "options"); + e0->pChildList->append(e1); + e1->pChildList = 0; e0 = new OptionsWidgetInstanceEntry; e0->createProc = &classOptionsWidget_irc_createInstanceProc; e0->pWidget = 0; e0->szClassName = g_szClassName_OptionsWidget_irc; e0->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_irc; - #ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_irc +#ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_irc e0->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_irc; - #else +#else e0->iPriority = 0; - #endif - #ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_irc +#endif +#ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_irc e0->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_irc "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_irc; - #else +#else e0->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_irc; - #endif - e0->szKeywords = __tr2qs_ctx_no_xgettext(e0->szKeywordsNoLocale.toUtf8().data(),"options"); - #ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_irc +#endif + e0->szKeywords = __tr2qs_ctx_no_xgettext(e0->szKeywordsNoLocale.toUtf8().data(), "options"); +#ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_irc e0->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_irc; - #else +#else e0->szGroup = "general"; - #endif - #ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_irc +#endif +#ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_irc e0->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_irc; - #else +#else e0->bIsContainer = false; - #endif - #ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_irc +#endif +#ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_irc e0->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_irc; - #else +#else e0->bIsNotContained = false; - #endif +#endif e0->szNameNoLocale = g_szName_OptionsWidget_irc; - e0->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_irc,"options"); + e0->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_irc, "options"); m_pInstanceTree->append(e0); e0->pChildList = new KviPointerList; e0->pChildList->setAutoDelete(true); - e1 = new OptionsWidgetInstanceEntry; - e1->createProc = &classOptionsWidget_channel_createInstanceProc; - e1->pWidget = 0; - e1->szClassName = g_szClassName_OptionsWidget_channel; - e1->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_channel; - #ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_channel - e1->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_channel; - #else - e1->iPriority = 0; - #endif - #ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_channel - e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_channel "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_channel; - #else - e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_channel; - #endif - e1->szKeywords = __tr2qs_ctx_no_xgettext(e1->szKeywordsNoLocale.toUtf8().data(),"options"); - #ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_channel - e1->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_channel; - #else - e1->szGroup = "general"; - #endif - #ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_channel - e1->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_channel; - #else - e1->bIsContainer = false; - #endif - #ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_channel - e1->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_channel; - #else - e1->bIsNotContained = false; - #endif - e1->szNameNoLocale = g_szName_OptionsWidget_channel; - e1->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_channel,"options"); - e0->pChildList->append(e1); - - e1->pChildList = new KviPointerList; - e1->pChildList->setAutoDelete(true); - - e2 = new OptionsWidgetInstanceEntry; - e2->createProc = &classOptionsWidget_channelGeneral_createInstanceProc; - e2->pWidget = 0; - e2->szClassName = g_szClassName_OptionsWidget_channelGeneral; - e2->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_channelGeneral; - #ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_channelGeneral - e2->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_channelGeneral; - #else - e2->iPriority = 0; - #endif - #ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_channelGeneral - e2->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_channelGeneral "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_channelGeneral; - #else - e2->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_channelGeneral; - #endif - e2->szKeywords = __tr2qs_ctx_no_xgettext(e2->szKeywordsNoLocale.toUtf8().data(),"options"); - #ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_channelGeneral - e2->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_channelGeneral; - #else - e2->szGroup = "general"; - #endif - #ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_channelGeneral - e2->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_channelGeneral; - #else - e2->bIsContainer = false; - #endif - #ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_channelGeneral - e2->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_channelGeneral; - #else - e2->bIsNotContained = false; - #endif - e2->szNameNoLocale = g_szName_OptionsWidget_channelGeneral; - e2->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_channelGeneral,"options"); - e1->pChildList->append(e2); - e2->pChildList = 0; - - e2 = new OptionsWidgetInstanceEntry; - e2->createProc = &classOptionsWidget_channelAdvanced_createInstanceProc; - e2->pWidget = 0; - e2->szClassName = g_szClassName_OptionsWidget_channelAdvanced; - e2->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_channelAdvanced; - #ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_channelAdvanced - e2->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_channelAdvanced; - #else - e2->iPriority = 0; - #endif - #ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_channelAdvanced - e2->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_channelAdvanced "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_channelAdvanced; - #else - e2->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_channelAdvanced; - #endif - e2->szKeywords = __tr2qs_ctx_no_xgettext(e2->szKeywordsNoLocale.toUtf8().data(),"options"); - #ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_channelAdvanced - e2->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_channelAdvanced; - #else - e2->szGroup = "general"; - #endif - #ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_channelAdvanced - e2->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_channelAdvanced; - #else - e2->bIsContainer = false; - #endif - #ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_channelAdvanced - e2->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_channelAdvanced; - #else - e2->bIsNotContained = false; - #endif - e2->szNameNoLocale = g_szName_OptionsWidget_channelAdvanced; - e2->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_channelAdvanced,"options"); - e1->pChildList->append(e2); - e2->pChildList = 0; - - e1 = new OptionsWidgetInstanceEntry; - e1->createProc = &classOptionsWidget_ircGeneral_createInstanceProc; - e1->pWidget = 0; - e1->szClassName = g_szClassName_OptionsWidget_ircGeneral; - e1->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_ircGeneral; - #ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_ircGeneral - e1->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_ircGeneral; - #else - e1->iPriority = 0; - #endif - #ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_ircGeneral - e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_ircGeneral "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_ircGeneral; - #else - e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_ircGeneral; - #endif - e1->szKeywords = __tr2qs_ctx_no_xgettext(e1->szKeywordsNoLocale.toUtf8().data(),"options"); - #ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_ircGeneral - e1->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_ircGeneral; - #else - e1->szGroup = "general"; - #endif - #ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_ircGeneral - e1->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_ircGeneral; - #else - e1->bIsContainer = false; - #endif - #ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_ircGeneral - e1->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_ircGeneral; - #else - e1->bIsNotContained = false; - #endif - e1->szNameNoLocale = g_szName_OptionsWidget_ircGeneral; - e1->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_ircGeneral,"options"); - e0->pChildList->append(e1); - e1->pChildList = 0; - - e1 = new OptionsWidgetInstanceEntry; - e1->createProc = &classOptionsWidget_ircAdvanced_createInstanceProc; - e1->pWidget = 0; - e1->szClassName = g_szClassName_OptionsWidget_ircAdvanced; - e1->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_ircAdvanced; - #ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_ircAdvanced - e1->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_ircAdvanced; - #else - e1->iPriority = 0; - #endif - #ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_ircAdvanced - e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_ircAdvanced "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_ircAdvanced; - #else - e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_ircAdvanced; - #endif - e1->szKeywords = __tr2qs_ctx_no_xgettext(e1->szKeywordsNoLocale.toUtf8().data(),"options"); - #ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_ircAdvanced - e1->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_ircAdvanced; - #else - e1->szGroup = "general"; - #endif - #ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_ircAdvanced - e1->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_ircAdvanced; - #else - e1->bIsContainer = false; - #endif - #ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_ircAdvanced - e1->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_ircAdvanced; - #else - e1->bIsNotContained = false; - #endif - e1->szNameNoLocale = g_szName_OptionsWidget_ircAdvanced; - e1->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_ircAdvanced,"options"); - e0->pChildList->append(e1); - e1->pChildList = 0; - - e1 = new OptionsWidgetInstanceEntry; - e1->createProc = &classOptionsWidget_ircOutput_createInstanceProc; - e1->pWidget = 0; - e1->szClassName = g_szClassName_OptionsWidget_ircOutput; - e1->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_ircOutput; - #ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_ircOutput - e1->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_ircOutput; - #else - e1->iPriority = 0; - #endif - #ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_ircOutput - e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_ircOutput "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_ircOutput; - #else - e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_ircOutput; - #endif - e1->szKeywords = __tr2qs_ctx_no_xgettext(e1->szKeywordsNoLocale.toUtf8().data(),"options"); - #ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_ircOutput - e1->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_ircOutput; - #else - e1->szGroup = "general"; - #endif - #ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_ircOutput - e1->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_ircOutput; - #else - e1->bIsContainer = false; - #endif - #ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_ircOutput - e1->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_ircOutput; - #else - e1->bIsNotContained = false; - #endif - e1->szNameNoLocale = g_szName_OptionsWidget_ircOutput; - e1->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_ircOutput,"options"); - e0->pChildList->append(e1); - e1->pChildList = 0; - - e1 = new OptionsWidgetInstanceEntry; - e1->createProc = &classOptionsWidget_protection_createInstanceProc; - e1->pWidget = 0; - e1->szClassName = g_szClassName_OptionsWidget_protection; - e1->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_protection; - #ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_protection - e1->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_protection; - #else - e1->iPriority = 0; - #endif - #ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_protection - e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_protection "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_protection; - #else - e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_protection; - #endif - e1->szKeywords = __tr2qs_ctx_no_xgettext(e1->szKeywordsNoLocale.toUtf8().data(),"options"); - #ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_protection - e1->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_protection; - #else - e1->szGroup = "general"; - #endif - #ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_protection - e1->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_protection; - #else - e1->bIsContainer = false; - #endif - #ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_protection - e1->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_protection; - #else - e1->bIsNotContained = false; - #endif - e1->szNameNoLocale = g_szName_OptionsWidget_protection; - e1->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_protection,"options"); - e0->pChildList->append(e1); - - e1->pChildList = new KviPointerList; - e1->pChildList->setAutoDelete(true); - - e2 = new OptionsWidgetInstanceEntry; - e2->createProc = &classOptionsWidget_antispam_createInstanceProc; - e2->pWidget = 0; - e2->szClassName = g_szClassName_OptionsWidget_antispam; - e2->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_antispam; - #ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_antispam - e2->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_antispam; - #else - e2->iPriority = 0; - #endif - #ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_antispam - e2->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_antispam "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_antispam; - #else - e2->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_antispam; - #endif - e2->szKeywords = __tr2qs_ctx_no_xgettext(e2->szKeywordsNoLocale.toUtf8().data(),"options"); - #ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_antispam - e2->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_antispam; - #else - e2->szGroup = "general"; - #endif - #ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_antispam - e2->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_antispam; - #else - e2->bIsContainer = false; - #endif - #ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_antispam - e2->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_antispam; - #else - e2->bIsNotContained = false; - #endif - e2->szNameNoLocale = g_szName_OptionsWidget_antispam; - e2->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_antispam,"options"); - e1->pChildList->append(e2); - e2->pChildList = 0; - - e2 = new OptionsWidgetInstanceEntry; - e2->createProc = &classOptionsWidget_ctcpFloodProtection_createInstanceProc; - e2->pWidget = 0; - e2->szClassName = g_szClassName_OptionsWidget_ctcpFloodProtection; - e2->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_ctcpFloodProtection; - #ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_ctcpFloodProtection - e2->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_ctcpFloodProtection; - #else - e2->iPriority = 0; - #endif - #ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_ctcpFloodProtection - e2->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_ctcpFloodProtection "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_ctcpFloodProtection; - #else - e2->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_ctcpFloodProtection; - #endif - e2->szKeywords = __tr2qs_ctx_no_xgettext(e2->szKeywordsNoLocale.toUtf8().data(),"options"); - #ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_ctcpFloodProtection - e2->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_ctcpFloodProtection; - #else - e2->szGroup = "general"; - #endif - #ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_ctcpFloodProtection - e2->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_ctcpFloodProtection; - #else - e2->bIsContainer = false; - #endif - #ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_ctcpFloodProtection - e2->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_ctcpFloodProtection; - #else - e2->bIsNotContained = false; - #endif - e2->szNameNoLocale = g_szName_OptionsWidget_ctcpFloodProtection; - e2->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_ctcpFloodProtection,"options"); - e1->pChildList->append(e2); - e2->pChildList = 0; - - e2 = new OptionsWidgetInstanceEntry; - e2->createProc = &classOptionsWidget_ignore_createInstanceProc; - e2->pWidget = 0; - e2->szClassName = g_szClassName_OptionsWidget_ignore; - e2->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_ignore; - #ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_ignore - e2->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_ignore; - #else - e2->iPriority = 0; - #endif - #ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_ignore - e2->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_ignore "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_ignore; - #else - e2->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_ignore; - #endif - e2->szKeywords = __tr2qs_ctx_no_xgettext(e2->szKeywordsNoLocale.toUtf8().data(),"options"); - #ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_ignore - e2->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_ignore; - #else - e2->szGroup = "general"; - #endif - #ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_ignore - e2->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_ignore; - #else - e2->bIsContainer = false; - #endif - #ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_ignore - e2->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_ignore; - #else - e2->bIsNotContained = false; - #endif - e2->szNameNoLocale = g_szName_OptionsWidget_ignore; - e2->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_ignore,"options"); - e1->pChildList->append(e2); - e2->pChildList = 0; - - e1 = new OptionsWidgetInstanceEntry; - e1->createProc = &classOptionsWidget_query_createInstanceProc; - e1->pWidget = 0; - e1->szClassName = g_szClassName_OptionsWidget_query; - e1->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_query; - #ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_query - e1->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_query; - #else - e1->iPriority = 0; - #endif - #ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_query - e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_query "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_query; - #else - e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_query; - #endif - e1->szKeywords = __tr2qs_ctx_no_xgettext(e1->szKeywordsNoLocale.toUtf8().data(),"options"); - #ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_query - e1->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_query; - #else - e1->szGroup = "general"; - #endif - #ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_query - e1->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_query; - #else - e1->bIsContainer = false; - #endif - #ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_query - e1->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_query; - #else - e1->bIsNotContained = false; - #endif - e1->szNameNoLocale = g_szName_OptionsWidget_query; - e1->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_query,"options"); - e0->pChildList->append(e1); - e1->pChildList = 0; - - e1 = new OptionsWidgetInstanceEntry; - e1->createProc = &classOptionsWidget_tools_createInstanceProc; - e1->pWidget = 0; - e1->szClassName = g_szClassName_OptionsWidget_tools; - e1->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_tools; - #ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_tools - e1->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_tools; - #else - e1->iPriority = 0; - #endif - #ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_tools - e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_tools "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_tools; - #else - e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_tools; - #endif - e1->szKeywords = __tr2qs_ctx_no_xgettext(e1->szKeywordsNoLocale.toUtf8().data(),"options"); - #ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_tools - e1->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_tools; - #else - e1->szGroup = "general"; - #endif - #ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_tools - e1->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_tools; - #else - e1->bIsContainer = false; - #endif - #ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_tools - e1->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_tools; - #else - e1->bIsNotContained = false; - #endif - e1->szNameNoLocale = g_szName_OptionsWidget_tools; - e1->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_tools,"options"); - e0->pChildList->append(e1); - - e1->pChildList = new KviPointerList; - e1->pChildList->setAutoDelete(true); - - e2 = new OptionsWidgetInstanceEntry; - e2->createProc = &classOptionsWidget_alertsAndHighlighting_createInstanceProc; - e2->pWidget = 0; - e2->szClassName = g_szClassName_OptionsWidget_alertsAndHighlighting; - e2->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_alertsAndHighlighting; - #ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_alertsAndHighlighting - e2->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_alertsAndHighlighting; - #else - e2->iPriority = 0; - #endif - #ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_alertsAndHighlighting - e2->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_alertsAndHighlighting "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_alertsAndHighlighting; - #else - e2->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_alertsAndHighlighting; - #endif - e2->szKeywords = __tr2qs_ctx_no_xgettext(e2->szKeywordsNoLocale.toUtf8().data(),"options"); - #ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_alertsAndHighlighting - e2->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_alertsAndHighlighting; - #else - e2->szGroup = "general"; - #endif - #ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_alertsAndHighlighting - e2->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_alertsAndHighlighting; - #else - e2->bIsContainer = false; - #endif - #ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_alertsAndHighlighting - e2->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_alertsAndHighlighting; - #else - e2->bIsNotContained = false; - #endif - e2->szNameNoLocale = g_szName_OptionsWidget_alertsAndHighlighting; - e2->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_alertsAndHighlighting,"options"); - e1->pChildList->append(e2); - - e2->pChildList = new KviPointerList; - e2->pChildList->setAutoDelete(true); - - OptionsWidgetInstanceEntry * e3; - e3 = new OptionsWidgetInstanceEntry; - e3->createProc = &classOptionsWidget_highlighting_createInstanceProc; - e3->pWidget = 0; - e3->szClassName = g_szClassName_OptionsWidget_highlighting; - e3->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_highlighting; - #ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_highlighting - e3->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_highlighting; - #else - e3->iPriority = 0; - #endif - #ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_highlighting - e3->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_highlighting "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_highlighting; - #else - e3->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_highlighting; - #endif - e3->szKeywords = __tr2qs_ctx_no_xgettext(e3->szKeywordsNoLocale.toUtf8().data(),"options"); - #ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_highlighting - e3->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_highlighting; - #else - e3->szGroup = "general"; - #endif - #ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_highlighting - e3->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_highlighting; - #else - e3->bIsContainer = false; - #endif - #ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_highlighting - e3->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_highlighting; - #else - e3->bIsNotContained = false; - #endif - e3->szNameNoLocale = g_szName_OptionsWidget_highlighting; - e3->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_highlighting,"options"); - e2->pChildList->append(e3); - e3->pChildList = 0; - - e3 = new OptionsWidgetInstanceEntry; - e3->createProc = &classOptionsWidget_alerts_createInstanceProc; - e3->pWidget = 0; - e3->szClassName = g_szClassName_OptionsWidget_alerts; - e3->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_alerts; - #ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_alerts - e3->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_alerts; - #else - e3->iPriority = 0; - #endif - #ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_alerts - e3->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_alerts "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_alerts; - #else - e3->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_alerts; - #endif - e3->szKeywords = __tr2qs_ctx_no_xgettext(e3->szKeywordsNoLocale.toUtf8().data(),"options"); - #ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_alerts - e3->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_alerts; - #else - e3->szGroup = "general"; - #endif - #ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_alerts - e3->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_alerts; - #else - e3->bIsContainer = false; - #endif - #ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_alerts - e3->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_alerts; - #else - e3->bIsNotContained = false; - #endif - e3->szNameNoLocale = g_szName_OptionsWidget_alerts; - e3->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_alerts,"options"); - e2->pChildList->append(e3); - e3->pChildList = 0; - - e2 = new OptionsWidgetInstanceEntry; - e2->createProc = &classOptionsWidget_avatar_createInstanceProc; - e2->pWidget = 0; - e2->szClassName = g_szClassName_OptionsWidget_avatar; - e2->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_avatar; - #ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_avatar - e2->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_avatar; - #else - e2->iPriority = 0; - #endif - #ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_avatar - e2->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_avatar "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_avatar; - #else - e2->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_avatar; - #endif - e2->szKeywords = __tr2qs_ctx_no_xgettext(e2->szKeywordsNoLocale.toUtf8().data(),"options"); - #ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_avatar - e2->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_avatar; - #else - e2->szGroup = "general"; - #endif - #ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_avatar - e2->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_avatar; - #else - e2->bIsContainer = false; - #endif - #ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_avatar - e2->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_avatar; - #else - e2->bIsNotContained = false; - #endif - e2->szNameNoLocale = g_szName_OptionsWidget_avatar; - e2->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_avatar,"options"); - e1->pChildList->append(e2); - e2->pChildList = 0; - - e2 = new OptionsWidgetInstanceEntry; - e2->createProc = &classOptionsWidget_away_createInstanceProc; - e2->pWidget = 0; - e2->szClassName = g_szClassName_OptionsWidget_away; - e2->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_away; - #ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_away - e2->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_away; - #else - e2->iPriority = 0; - #endif - #ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_away - e2->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_away "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_away; - #else - e2->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_away; - #endif - e2->szKeywords = __tr2qs_ctx_no_xgettext(e2->szKeywordsNoLocale.toUtf8().data(),"options"); - #ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_away - e2->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_away; - #else - e2->szGroup = "general"; - #endif - #ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_away - e2->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_away; - #else - e2->bIsContainer = false; - #endif - #ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_away - e2->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_away; - #else - e2->bIsNotContained = false; - #endif - e2->szNameNoLocale = g_szName_OptionsWidget_away; - e2->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_away,"options"); - e1->pChildList->append(e2); - e2->pChildList = 0; - - e2 = new OptionsWidgetInstanceEntry; - e2->createProc = &classOptionsWidget_ctcp_createInstanceProc; - e2->pWidget = 0; - e2->szClassName = g_szClassName_OptionsWidget_ctcp; - e2->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_ctcp; - #ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_ctcp - e2->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_ctcp; - #else - e2->iPriority = 0; - #endif - #ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_ctcp - e2->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_ctcp "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_ctcp; - #else - e2->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_ctcp; - #endif - e2->szKeywords = __tr2qs_ctx_no_xgettext(e2->szKeywordsNoLocale.toUtf8().data(),"options"); - #ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_ctcp - e2->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_ctcp; - #else - e2->szGroup = "general"; - #endif - #ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_ctcp - e2->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_ctcp; - #else - e2->bIsContainer = false; - #endif - #ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_ctcp - e2->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_ctcp; - #else - e2->bIsNotContained = false; - #endif - e2->szNameNoLocale = g_szName_OptionsWidget_ctcp; - e2->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_ctcp,"options"); - e1->pChildList->append(e2); - e2->pChildList = 0; - - e2 = new OptionsWidgetInstanceEntry; - e2->createProc = &classOptionsWidget_lag_createInstanceProc; - e2->pWidget = 0; - e2->szClassName = g_szClassName_OptionsWidget_lag; - e2->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_lag; - #ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_lag - e2->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_lag; - #else - e2->iPriority = 0; - #endif - #ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_lag - e2->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_lag "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_lag; - #else - e2->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_lag; - #endif - e2->szKeywords = __tr2qs_ctx_no_xgettext(e2->szKeywordsNoLocale.toUtf8().data(),"options"); - #ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_lag - e2->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_lag; - #else - e2->szGroup = "general"; - #endif - #ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_lag - e2->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_lag; - #else - e2->bIsContainer = false; - #endif - #ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_lag - e2->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_lag; - #else - e2->bIsNotContained = false; - #endif - e2->szNameNoLocale = g_szName_OptionsWidget_lag; - e2->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_lag,"options"); - e1->pChildList->append(e2); - e2->pChildList = 0; - - e2 = new OptionsWidgetInstanceEntry; - e2->createProc = &classOptionsWidget_logging_createInstanceProc; - e2->pWidget = 0; - e2->szClassName = g_szClassName_OptionsWidget_logging; - e2->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_logging; - #ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_logging - e2->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_logging; - #else - e2->iPriority = 0; - #endif - #ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_logging - e2->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_logging "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_logging; - #else - e2->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_logging; - #endif - e2->szKeywords = __tr2qs_ctx_no_xgettext(e2->szKeywordsNoLocale.toUtf8().data(),"options"); - #ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_logging - e2->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_logging; - #else - e2->szGroup = "general"; - #endif - #ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_logging - e2->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_logging; - #else - e2->bIsContainer = false; - #endif - #ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_logging - e2->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_logging; - #else - e2->bIsNotContained = false; - #endif - e2->szNameNoLocale = g_szName_OptionsWidget_logging; - e2->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_logging,"options"); - e1->pChildList->append(e2); - e2->pChildList = 0; - - e2 = new OptionsWidgetInstanceEntry; - e2->createProc = &classOptionsWidget_nickServ_createInstanceProc; - e2->pWidget = 0; - e2->szClassName = g_szClassName_OptionsWidget_nickServ; - e2->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_nickServ; - #ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_nickServ - e2->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_nickServ; - #else - e2->iPriority = 0; - #endif - #ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_nickServ - e2->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_nickServ "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_nickServ; - #else - e2->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_nickServ; - #endif - e2->szKeywords = __tr2qs_ctx_no_xgettext(e2->szKeywordsNoLocale.toUtf8().data(),"options"); - #ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_nickServ - e2->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_nickServ; - #else - e2->szGroup = "general"; - #endif - #ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_nickServ - e2->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_nickServ; - #else - e2->bIsContainer = false; - #endif - #ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_nickServ - e2->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_nickServ; - #else - e2->bIsNotContained = false; - #endif - e2->szNameNoLocale = g_szName_OptionsWidget_nickServ; - e2->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_nickServ,"options"); - e1->pChildList->append(e2); - e2->pChildList = 0; - - e2 = new OptionsWidgetInstanceEntry; - e2->createProc = &classOptionsWidget_notify_createInstanceProc; - e2->pWidget = 0; - e2->szClassName = g_szClassName_OptionsWidget_notify; - e2->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_notify; - #ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_notify - e2->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_notify; - #else - e2->iPriority = 0; - #endif - #ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_notify - e2->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_notify "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_notify; - #else - e2->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_notify; - #endif - e2->szKeywords = __tr2qs_ctx_no_xgettext(e2->szKeywordsNoLocale.toUtf8().data(),"options"); - #ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_notify - e2->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_notify; - #else - e2->szGroup = "general"; - #endif - #ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_notify - e2->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_notify; - #else - e2->bIsContainer = false; - #endif - #ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_notify - e2->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_notify; - #else - e2->bIsNotContained = false; - #endif - e2->szNameNoLocale = g_szName_OptionsWidget_notify; - e2->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_notify,"options"); - e1->pChildList->append(e2); - e2->pChildList = 0; - - e2 = new OptionsWidgetInstanceEntry; - e2->createProc = &classOptionsWidget_textIcons_createInstanceProc; - e2->pWidget = 0; - e2->szClassName = g_szClassName_OptionsWidget_textIcons; - e2->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_textIcons; - #ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_textIcons - e2->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_textIcons; - #else - e2->iPriority = 0; - #endif - #ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_textIcons - e2->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_textIcons "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_textIcons; - #else - e2->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_textIcons; - #endif - e2->szKeywords = __tr2qs_ctx_no_xgettext(e2->szKeywordsNoLocale.toUtf8().data(),"options"); - #ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_textIcons - e2->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_textIcons; - #else - e2->szGroup = "general"; - #endif - #ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_textIcons - e2->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_textIcons; - #else - e2->bIsContainer = false; - #endif - #ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_textIcons - e2->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_textIcons; - #else - e2->bIsNotContained = false; - #endif - e2->szNameNoLocale = g_szName_OptionsWidget_textIcons; - e2->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_textIcons,"options"); - e1->pChildList->append(e2); - e2->pChildList = 0; + e1 = new OptionsWidgetInstanceEntry; + e1->createProc = &classOptionsWidget_channel_createInstanceProc; + e1->pWidget = 0; + e1->szClassName = g_szClassName_OptionsWidget_channel; + e1->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_channel; +#ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_channel + e1->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_channel; +#else + e1->iPriority = 0; +#endif +#ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_channel + e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_channel "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_channel; +#else + e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_channel; +#endif + e1->szKeywords = __tr2qs_ctx_no_xgettext(e1->szKeywordsNoLocale.toUtf8().data(), "options"); +#ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_channel + e1->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_channel; +#else + e1->szGroup = "general"; +#endif +#ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_channel + e1->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_channel; +#else + e1->bIsContainer = false; +#endif +#ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_channel + e1->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_channel; +#else + e1->bIsNotContained = false; +#endif + e1->szNameNoLocale = g_szName_OptionsWidget_channel; + e1->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_channel, "options"); + e0->pChildList->append(e1); + + e1->pChildList = new KviPointerList; + e1->pChildList->setAutoDelete(true); + + e2 = new OptionsWidgetInstanceEntry; + e2->createProc = &classOptionsWidget_channelGeneral_createInstanceProc; + e2->pWidget = 0; + e2->szClassName = g_szClassName_OptionsWidget_channelGeneral; + e2->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_channelGeneral; +#ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_channelGeneral + e2->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_channelGeneral; +#else + e2->iPriority = 0; +#endif +#ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_channelGeneral + e2->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_channelGeneral "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_channelGeneral; +#else + e2->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_channelGeneral; +#endif + e2->szKeywords = __tr2qs_ctx_no_xgettext(e2->szKeywordsNoLocale.toUtf8().data(), "options"); +#ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_channelGeneral + e2->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_channelGeneral; +#else + e2->szGroup = "general"; +#endif +#ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_channelGeneral + e2->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_channelGeneral; +#else + e2->bIsContainer = false; +#endif +#ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_channelGeneral + e2->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_channelGeneral; +#else + e2->bIsNotContained = false; +#endif + e2->szNameNoLocale = g_szName_OptionsWidget_channelGeneral; + e2->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_channelGeneral, "options"); + e1->pChildList->append(e2); + e2->pChildList = 0; + + e2 = new OptionsWidgetInstanceEntry; + e2->createProc = &classOptionsWidget_channelAdvanced_createInstanceProc; + e2->pWidget = 0; + e2->szClassName = g_szClassName_OptionsWidget_channelAdvanced; + e2->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_channelAdvanced; +#ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_channelAdvanced + e2->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_channelAdvanced; +#else + e2->iPriority = 0; +#endif +#ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_channelAdvanced + e2->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_channelAdvanced "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_channelAdvanced; +#else + e2->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_channelAdvanced; +#endif + e2->szKeywords = __tr2qs_ctx_no_xgettext(e2->szKeywordsNoLocale.toUtf8().data(), "options"); +#ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_channelAdvanced + e2->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_channelAdvanced; +#else + e2->szGroup = "general"; +#endif +#ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_channelAdvanced + e2->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_channelAdvanced; +#else + e2->bIsContainer = false; +#endif +#ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_channelAdvanced + e2->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_channelAdvanced; +#else + e2->bIsNotContained = false; +#endif + e2->szNameNoLocale = g_szName_OptionsWidget_channelAdvanced; + e2->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_channelAdvanced, "options"); + e1->pChildList->append(e2); + e2->pChildList = 0; + + e1 = new OptionsWidgetInstanceEntry; + e1->createProc = &classOptionsWidget_ircGeneral_createInstanceProc; + e1->pWidget = 0; + e1->szClassName = g_szClassName_OptionsWidget_ircGeneral; + e1->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_ircGeneral; +#ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_ircGeneral + e1->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_ircGeneral; +#else + e1->iPriority = 0; +#endif +#ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_ircGeneral + e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_ircGeneral "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_ircGeneral; +#else + e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_ircGeneral; +#endif + e1->szKeywords = __tr2qs_ctx_no_xgettext(e1->szKeywordsNoLocale.toUtf8().data(), "options"); +#ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_ircGeneral + e1->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_ircGeneral; +#else + e1->szGroup = "general"; +#endif +#ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_ircGeneral + e1->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_ircGeneral; +#else + e1->bIsContainer = false; +#endif +#ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_ircGeneral + e1->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_ircGeneral; +#else + e1->bIsNotContained = false; +#endif + e1->szNameNoLocale = g_szName_OptionsWidget_ircGeneral; + e1->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_ircGeneral, "options"); + e0->pChildList->append(e1); + e1->pChildList = 0; + + e1 = new OptionsWidgetInstanceEntry; + e1->createProc = &classOptionsWidget_ircAdvanced_createInstanceProc; + e1->pWidget = 0; + e1->szClassName = g_szClassName_OptionsWidget_ircAdvanced; + e1->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_ircAdvanced; +#ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_ircAdvanced + e1->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_ircAdvanced; +#else + e1->iPriority = 0; +#endif +#ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_ircAdvanced + e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_ircAdvanced "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_ircAdvanced; +#else + e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_ircAdvanced; +#endif + e1->szKeywords = __tr2qs_ctx_no_xgettext(e1->szKeywordsNoLocale.toUtf8().data(), "options"); +#ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_ircAdvanced + e1->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_ircAdvanced; +#else + e1->szGroup = "general"; +#endif +#ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_ircAdvanced + e1->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_ircAdvanced; +#else + e1->bIsContainer = false; +#endif +#ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_ircAdvanced + e1->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_ircAdvanced; +#else + e1->bIsNotContained = false; +#endif + e1->szNameNoLocale = g_szName_OptionsWidget_ircAdvanced; + e1->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_ircAdvanced, "options"); + e0->pChildList->append(e1); + e1->pChildList = 0; + + e1 = new OptionsWidgetInstanceEntry; + e1->createProc = &classOptionsWidget_ircOutput_createInstanceProc; + e1->pWidget = 0; + e1->szClassName = g_szClassName_OptionsWidget_ircOutput; + e1->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_ircOutput; +#ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_ircOutput + e1->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_ircOutput; +#else + e1->iPriority = 0; +#endif +#ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_ircOutput + e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_ircOutput "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_ircOutput; +#else + e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_ircOutput; +#endif + e1->szKeywords = __tr2qs_ctx_no_xgettext(e1->szKeywordsNoLocale.toUtf8().data(), "options"); +#ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_ircOutput + e1->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_ircOutput; +#else + e1->szGroup = "general"; +#endif +#ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_ircOutput + e1->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_ircOutput; +#else + e1->bIsContainer = false; +#endif +#ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_ircOutput + e1->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_ircOutput; +#else + e1->bIsNotContained = false; +#endif + e1->szNameNoLocale = g_szName_OptionsWidget_ircOutput; + e1->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_ircOutput, "options"); + e0->pChildList->append(e1); + e1->pChildList = 0; + + e1 = new OptionsWidgetInstanceEntry; + e1->createProc = &classOptionsWidget_protection_createInstanceProc; + e1->pWidget = 0; + e1->szClassName = g_szClassName_OptionsWidget_protection; + e1->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_protection; +#ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_protection + e1->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_protection; +#else + e1->iPriority = 0; +#endif +#ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_protection + e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_protection "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_protection; +#else + e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_protection; +#endif + e1->szKeywords = __tr2qs_ctx_no_xgettext(e1->szKeywordsNoLocale.toUtf8().data(), "options"); +#ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_protection + e1->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_protection; +#else + e1->szGroup = "general"; +#endif +#ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_protection + e1->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_protection; +#else + e1->bIsContainer = false; +#endif +#ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_protection + e1->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_protection; +#else + e1->bIsNotContained = false; +#endif + e1->szNameNoLocale = g_szName_OptionsWidget_protection; + e1->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_protection, "options"); + e0->pChildList->append(e1); + + e1->pChildList = new KviPointerList; + e1->pChildList->setAutoDelete(true); + + e2 = new OptionsWidgetInstanceEntry; + e2->createProc = &classOptionsWidget_antispam_createInstanceProc; + e2->pWidget = 0; + e2->szClassName = g_szClassName_OptionsWidget_antispam; + e2->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_antispam; +#ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_antispam + e2->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_antispam; +#else + e2->iPriority = 0; +#endif +#ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_antispam + e2->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_antispam "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_antispam; +#else + e2->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_antispam; +#endif + e2->szKeywords = __tr2qs_ctx_no_xgettext(e2->szKeywordsNoLocale.toUtf8().data(), "options"); +#ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_antispam + e2->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_antispam; +#else + e2->szGroup = "general"; +#endif +#ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_antispam + e2->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_antispam; +#else + e2->bIsContainer = false; +#endif +#ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_antispam + e2->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_antispam; +#else + e2->bIsNotContained = false; +#endif + e2->szNameNoLocale = g_szName_OptionsWidget_antispam; + e2->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_antispam, "options"); + e1->pChildList->append(e2); + e2->pChildList = 0; + + e2 = new OptionsWidgetInstanceEntry; + e2->createProc = &classOptionsWidget_ctcpFloodProtection_createInstanceProc; + e2->pWidget = 0; + e2->szClassName = g_szClassName_OptionsWidget_ctcpFloodProtection; + e2->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_ctcpFloodProtection; +#ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_ctcpFloodProtection + e2->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_ctcpFloodProtection; +#else + e2->iPriority = 0; +#endif +#ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_ctcpFloodProtection + e2->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_ctcpFloodProtection "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_ctcpFloodProtection; +#else + e2->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_ctcpFloodProtection; +#endif + e2->szKeywords = __tr2qs_ctx_no_xgettext(e2->szKeywordsNoLocale.toUtf8().data(), "options"); +#ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_ctcpFloodProtection + e2->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_ctcpFloodProtection; +#else + e2->szGroup = "general"; +#endif +#ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_ctcpFloodProtection + e2->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_ctcpFloodProtection; +#else + e2->bIsContainer = false; +#endif +#ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_ctcpFloodProtection + e2->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_ctcpFloodProtection; +#else + e2->bIsNotContained = false; +#endif + e2->szNameNoLocale = g_szName_OptionsWidget_ctcpFloodProtection; + e2->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_ctcpFloodProtection, "options"); + e1->pChildList->append(e2); + e2->pChildList = 0; + + e2 = new OptionsWidgetInstanceEntry; + e2->createProc = &classOptionsWidget_ignore_createInstanceProc; + e2->pWidget = 0; + e2->szClassName = g_szClassName_OptionsWidget_ignore; + e2->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_ignore; +#ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_ignore + e2->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_ignore; +#else + e2->iPriority = 0; +#endif +#ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_ignore + e2->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_ignore "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_ignore; +#else + e2->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_ignore; +#endif + e2->szKeywords = __tr2qs_ctx_no_xgettext(e2->szKeywordsNoLocale.toUtf8().data(), "options"); +#ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_ignore + e2->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_ignore; +#else + e2->szGroup = "general"; +#endif +#ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_ignore + e2->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_ignore; +#else + e2->bIsContainer = false; +#endif +#ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_ignore + e2->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_ignore; +#else + e2->bIsNotContained = false; +#endif + e2->szNameNoLocale = g_szName_OptionsWidget_ignore; + e2->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_ignore, "options"); + e1->pChildList->append(e2); + e2->pChildList = 0; + + e1 = new OptionsWidgetInstanceEntry; + e1->createProc = &classOptionsWidget_query_createInstanceProc; + e1->pWidget = 0; + e1->szClassName = g_szClassName_OptionsWidget_query; + e1->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_query; +#ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_query + e1->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_query; +#else + e1->iPriority = 0; +#endif +#ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_query + e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_query "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_query; +#else + e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_query; +#endif + e1->szKeywords = __tr2qs_ctx_no_xgettext(e1->szKeywordsNoLocale.toUtf8().data(), "options"); +#ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_query + e1->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_query; +#else + e1->szGroup = "general"; +#endif +#ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_query + e1->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_query; +#else + e1->bIsContainer = false; +#endif +#ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_query + e1->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_query; +#else + e1->bIsNotContained = false; +#endif + e1->szNameNoLocale = g_szName_OptionsWidget_query; + e1->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_query, "options"); + e0->pChildList->append(e1); + e1->pChildList = 0; + + e1 = new OptionsWidgetInstanceEntry; + e1->createProc = &classOptionsWidget_tools_createInstanceProc; + e1->pWidget = 0; + e1->szClassName = g_szClassName_OptionsWidget_tools; + e1->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_tools; +#ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_tools + e1->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_tools; +#else + e1->iPriority = 0; +#endif +#ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_tools + e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_tools "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_tools; +#else + e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_tools; +#endif + e1->szKeywords = __tr2qs_ctx_no_xgettext(e1->szKeywordsNoLocale.toUtf8().data(), "options"); +#ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_tools + e1->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_tools; +#else + e1->szGroup = "general"; +#endif +#ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_tools + e1->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_tools; +#else + e1->bIsContainer = false; +#endif +#ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_tools + e1->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_tools; +#else + e1->bIsNotContained = false; +#endif + e1->szNameNoLocale = g_szName_OptionsWidget_tools; + e1->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_tools, "options"); + e0->pChildList->append(e1); + + e1->pChildList = new KviPointerList; + e1->pChildList->setAutoDelete(true); + + e2 = new OptionsWidgetInstanceEntry; + e2->createProc = &classOptionsWidget_alertsAndHighlighting_createInstanceProc; + e2->pWidget = 0; + e2->szClassName = g_szClassName_OptionsWidget_alertsAndHighlighting; + e2->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_alertsAndHighlighting; +#ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_alertsAndHighlighting + e2->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_alertsAndHighlighting; +#else + e2->iPriority = 0; +#endif +#ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_alertsAndHighlighting + e2->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_alertsAndHighlighting "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_alertsAndHighlighting; +#else + e2->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_alertsAndHighlighting; +#endif + e2->szKeywords = __tr2qs_ctx_no_xgettext(e2->szKeywordsNoLocale.toUtf8().data(), "options"); +#ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_alertsAndHighlighting + e2->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_alertsAndHighlighting; +#else + e2->szGroup = "general"; +#endif +#ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_alertsAndHighlighting + e2->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_alertsAndHighlighting; +#else + e2->bIsContainer = false; +#endif +#ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_alertsAndHighlighting + e2->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_alertsAndHighlighting; +#else + e2->bIsNotContained = false; +#endif + e2->szNameNoLocale = g_szName_OptionsWidget_alertsAndHighlighting; + e2->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_alertsAndHighlighting, "options"); + e1->pChildList->append(e2); + + e2->pChildList = new KviPointerList; + e2->pChildList->setAutoDelete(true); + + OptionsWidgetInstanceEntry * e3; + e3 = new OptionsWidgetInstanceEntry; + e3->createProc = &classOptionsWidget_highlighting_createInstanceProc; + e3->pWidget = 0; + e3->szClassName = g_szClassName_OptionsWidget_highlighting; + e3->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_highlighting; +#ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_highlighting + e3->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_highlighting; +#else + e3->iPriority = 0; +#endif +#ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_highlighting + e3->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_highlighting "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_highlighting; +#else + e3->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_highlighting; +#endif + e3->szKeywords = __tr2qs_ctx_no_xgettext(e3->szKeywordsNoLocale.toUtf8().data(), "options"); +#ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_highlighting + e3->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_highlighting; +#else + e3->szGroup = "general"; +#endif +#ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_highlighting + e3->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_highlighting; +#else + e3->bIsContainer = false; +#endif +#ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_highlighting + e3->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_highlighting; +#else + e3->bIsNotContained = false; +#endif + e3->szNameNoLocale = g_szName_OptionsWidget_highlighting; + e3->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_highlighting, "options"); + e2->pChildList->append(e3); + e3->pChildList = 0; + + e3 = new OptionsWidgetInstanceEntry; + e3->createProc = &classOptionsWidget_alerts_createInstanceProc; + e3->pWidget = 0; + e3->szClassName = g_szClassName_OptionsWidget_alerts; + e3->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_alerts; +#ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_alerts + e3->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_alerts; +#else + e3->iPriority = 0; +#endif +#ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_alerts + e3->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_alerts "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_alerts; +#else + e3->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_alerts; +#endif + e3->szKeywords = __tr2qs_ctx_no_xgettext(e3->szKeywordsNoLocale.toUtf8().data(), "options"); +#ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_alerts + e3->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_alerts; +#else + e3->szGroup = "general"; +#endif +#ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_alerts + e3->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_alerts; +#else + e3->bIsContainer = false; +#endif +#ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_alerts + e3->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_alerts; +#else + e3->bIsNotContained = false; +#endif + e3->szNameNoLocale = g_szName_OptionsWidget_alerts; + e3->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_alerts, "options"); + e2->pChildList->append(e3); + e3->pChildList = 0; + + e2 = new OptionsWidgetInstanceEntry; + e2->createProc = &classOptionsWidget_avatar_createInstanceProc; + e2->pWidget = 0; + e2->szClassName = g_szClassName_OptionsWidget_avatar; + e2->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_avatar; +#ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_avatar + e2->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_avatar; +#else + e2->iPriority = 0; +#endif +#ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_avatar + e2->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_avatar "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_avatar; +#else + e2->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_avatar; +#endif + e2->szKeywords = __tr2qs_ctx_no_xgettext(e2->szKeywordsNoLocale.toUtf8().data(), "options"); +#ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_avatar + e2->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_avatar; +#else + e2->szGroup = "general"; +#endif +#ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_avatar + e2->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_avatar; +#else + e2->bIsContainer = false; +#endif +#ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_avatar + e2->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_avatar; +#else + e2->bIsNotContained = false; +#endif + e2->szNameNoLocale = g_szName_OptionsWidget_avatar; + e2->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_avatar, "options"); + e1->pChildList->append(e2); + e2->pChildList = 0; + + e2 = new OptionsWidgetInstanceEntry; + e2->createProc = &classOptionsWidget_away_createInstanceProc; + e2->pWidget = 0; + e2->szClassName = g_szClassName_OptionsWidget_away; + e2->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_away; +#ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_away + e2->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_away; +#else + e2->iPriority = 0; +#endif +#ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_away + e2->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_away "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_away; +#else + e2->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_away; +#endif + e2->szKeywords = __tr2qs_ctx_no_xgettext(e2->szKeywordsNoLocale.toUtf8().data(), "options"); +#ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_away + e2->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_away; +#else + e2->szGroup = "general"; +#endif +#ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_away + e2->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_away; +#else + e2->bIsContainer = false; +#endif +#ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_away + e2->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_away; +#else + e2->bIsNotContained = false; +#endif + e2->szNameNoLocale = g_szName_OptionsWidget_away; + e2->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_away, "options"); + e1->pChildList->append(e2); + e2->pChildList = 0; + + e2 = new OptionsWidgetInstanceEntry; + e2->createProc = &classOptionsWidget_ctcp_createInstanceProc; + e2->pWidget = 0; + e2->szClassName = g_szClassName_OptionsWidget_ctcp; + e2->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_ctcp; +#ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_ctcp + e2->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_ctcp; +#else + e2->iPriority = 0; +#endif +#ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_ctcp + e2->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_ctcp "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_ctcp; +#else + e2->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_ctcp; +#endif + e2->szKeywords = __tr2qs_ctx_no_xgettext(e2->szKeywordsNoLocale.toUtf8().data(), "options"); +#ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_ctcp + e2->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_ctcp; +#else + e2->szGroup = "general"; +#endif +#ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_ctcp + e2->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_ctcp; +#else + e2->bIsContainer = false; +#endif +#ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_ctcp + e2->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_ctcp; +#else + e2->bIsNotContained = false; +#endif + e2->szNameNoLocale = g_szName_OptionsWidget_ctcp; + e2->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_ctcp, "options"); + e1->pChildList->append(e2); + e2->pChildList = 0; + + e2 = new OptionsWidgetInstanceEntry; + e2->createProc = &classOptionsWidget_lag_createInstanceProc; + e2->pWidget = 0; + e2->szClassName = g_szClassName_OptionsWidget_lag; + e2->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_lag; +#ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_lag + e2->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_lag; +#else + e2->iPriority = 0; +#endif +#ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_lag + e2->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_lag "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_lag; +#else + e2->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_lag; +#endif + e2->szKeywords = __tr2qs_ctx_no_xgettext(e2->szKeywordsNoLocale.toUtf8().data(), "options"); +#ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_lag + e2->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_lag; +#else + e2->szGroup = "general"; +#endif +#ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_lag + e2->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_lag; +#else + e2->bIsContainer = false; +#endif +#ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_lag + e2->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_lag; +#else + e2->bIsNotContained = false; +#endif + e2->szNameNoLocale = g_szName_OptionsWidget_lag; + e2->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_lag, "options"); + e1->pChildList->append(e2); + e2->pChildList = 0; + + e2 = new OptionsWidgetInstanceEntry; + e2->createProc = &classOptionsWidget_logging_createInstanceProc; + e2->pWidget = 0; + e2->szClassName = g_szClassName_OptionsWidget_logging; + e2->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_logging; +#ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_logging + e2->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_logging; +#else + e2->iPriority = 0; +#endif +#ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_logging + e2->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_logging "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_logging; +#else + e2->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_logging; +#endif + e2->szKeywords = __tr2qs_ctx_no_xgettext(e2->szKeywordsNoLocale.toUtf8().data(), "options"); +#ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_logging + e2->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_logging; +#else + e2->szGroup = "general"; +#endif +#ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_logging + e2->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_logging; +#else + e2->bIsContainer = false; +#endif +#ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_logging + e2->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_logging; +#else + e2->bIsNotContained = false; +#endif + e2->szNameNoLocale = g_szName_OptionsWidget_logging; + e2->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_logging, "options"); + e1->pChildList->append(e2); + e2->pChildList = 0; + + e2 = new OptionsWidgetInstanceEntry; + e2->createProc = &classOptionsWidget_nickServ_createInstanceProc; + e2->pWidget = 0; + e2->szClassName = g_szClassName_OptionsWidget_nickServ; + e2->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_nickServ; +#ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_nickServ + e2->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_nickServ; +#else + e2->iPriority = 0; +#endif +#ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_nickServ + e2->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_nickServ "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_nickServ; +#else + e2->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_nickServ; +#endif + e2->szKeywords = __tr2qs_ctx_no_xgettext(e2->szKeywordsNoLocale.toUtf8().data(), "options"); +#ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_nickServ + e2->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_nickServ; +#else + e2->szGroup = "general"; +#endif +#ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_nickServ + e2->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_nickServ; +#else + e2->bIsContainer = false; +#endif +#ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_nickServ + e2->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_nickServ; +#else + e2->bIsNotContained = false; +#endif + e2->szNameNoLocale = g_szName_OptionsWidget_nickServ; + e2->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_nickServ, "options"); + e1->pChildList->append(e2); + e2->pChildList = 0; + + e2 = new OptionsWidgetInstanceEntry; + e2->createProc = &classOptionsWidget_notify_createInstanceProc; + e2->pWidget = 0; + e2->szClassName = g_szClassName_OptionsWidget_notify; + e2->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_notify; +#ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_notify + e2->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_notify; +#else + e2->iPriority = 0; +#endif +#ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_notify + e2->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_notify "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_notify; +#else + e2->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_notify; +#endif + e2->szKeywords = __tr2qs_ctx_no_xgettext(e2->szKeywordsNoLocale.toUtf8().data(), "options"); +#ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_notify + e2->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_notify; +#else + e2->szGroup = "general"; +#endif +#ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_notify + e2->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_notify; +#else + e2->bIsContainer = false; +#endif +#ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_notify + e2->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_notify; +#else + e2->bIsNotContained = false; +#endif + e2->szNameNoLocale = g_szName_OptionsWidget_notify; + e2->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_notify, "options"); + e1->pChildList->append(e2); + e2->pChildList = 0; + + e2 = new OptionsWidgetInstanceEntry; + e2->createProc = &classOptionsWidget_textIcons_createInstanceProc; + e2->pWidget = 0; + e2->szClassName = g_szClassName_OptionsWidget_textIcons; + e2->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_textIcons; +#ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_textIcons + e2->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_textIcons; +#else + e2->iPriority = 0; +#endif +#ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_textIcons + e2->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_textIcons "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_textIcons; +#else + e2->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_textIcons; +#endif + e2->szKeywords = __tr2qs_ctx_no_xgettext(e2->szKeywordsNoLocale.toUtf8().data(), "options"); +#ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_textIcons + e2->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_textIcons; +#else + e2->szGroup = "general"; +#endif +#ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_textIcons + e2->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_textIcons; +#else + e2->bIsContainer = false; +#endif +#ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_textIcons + e2->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_textIcons; +#else + e2->bIsNotContained = false; +#endif + e2->szNameNoLocale = g_szName_OptionsWidget_textIcons; + e2->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_textIcons, "options"); + e1->pChildList->append(e2); + e2->pChildList = 0; e0 = new OptionsWidgetInstanceEntry; e0->createProc = &classOptionsWidget_ircViewTheme_createInstanceProc; e0->pWidget = 0; e0->szClassName = g_szClassName_OptionsWidget_ircViewTheme; e0->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_ircViewTheme; - #ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_ircViewTheme +#ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_ircViewTheme e0->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_ircViewTheme; - #else +#else e0->iPriority = 0; - #endif - #ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_ircViewTheme +#endif +#ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_ircViewTheme e0->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_ircViewTheme "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_ircViewTheme; - #else +#else e0->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_ircViewTheme; - #endif - e0->szKeywords = __tr2qs_ctx_no_xgettext(e0->szKeywordsNoLocale.toUtf8().data(),"options"); - #ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_ircViewTheme +#endif + e0->szKeywords = __tr2qs_ctx_no_xgettext(e0->szKeywordsNoLocale.toUtf8().data(), "options"); +#ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_ircViewTheme e0->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_ircViewTheme; - #else +#else e0->szGroup = "general"; - #endif - #ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_ircViewTheme +#endif +#ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_ircViewTheme e0->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_ircViewTheme; - #else +#else e0->bIsContainer = false; - #endif - #ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_ircViewTheme +#endif +#ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_ircViewTheme e0->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_ircViewTheme; - #else +#else e0->bIsNotContained = false; - #endif +#endif e0->szNameNoLocale = g_szName_OptionsWidget_ircViewTheme; - e0->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_ircViewTheme,"options"); + e0->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_ircViewTheme, "options"); m_pInstanceTree->append(e0); e0->pChildList = new KviPointerList; e0->pChildList->setAutoDelete(true); - e1 = new OptionsWidgetInstanceEntry; - e1->createProc = &classOptionsWidget_ircViewLook_createInstanceProc; - e1->pWidget = 0; - e1->szClassName = g_szClassName_OptionsWidget_ircViewLook; - e1->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_ircViewLook; - #ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_ircViewLook - e1->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_ircViewLook; - #else - e1->iPriority = 0; - #endif - #ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_ircViewLook - e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_ircViewLook "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_ircViewLook; - #else - e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_ircViewLook; - #endif - e1->szKeywords = __tr2qs_ctx_no_xgettext(e1->szKeywordsNoLocale.toUtf8().data(),"options"); - #ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_ircViewLook - e1->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_ircViewLook; - #else - e1->szGroup = "general"; - #endif - #ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_ircViewLook - e1->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_ircViewLook; - #else - e1->bIsContainer = false; - #endif - #ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_ircViewLook - e1->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_ircViewLook; - #else - e1->bIsNotContained = false; - #endif - e1->szNameNoLocale = g_szName_OptionsWidget_ircViewLook; - e1->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_ircViewLook,"options"); - e0->pChildList->append(e1); - e1->pChildList = 0; - - e1 = new OptionsWidgetInstanceEntry; - e1->createProc = &classOptionsWidget_ircViewFeatures_createInstanceProc; - e1->pWidget = 0; - e1->szClassName = g_szClassName_OptionsWidget_ircViewFeatures; - e1->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_ircViewFeatures; - #ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_ircViewFeatures - e1->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_ircViewFeatures; - #else - e1->iPriority = 0; - #endif - #ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_ircViewFeatures - e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_ircViewFeatures "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_ircViewFeatures; - #else - e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_ircViewFeatures; - #endif - e1->szKeywords = __tr2qs_ctx_no_xgettext(e1->szKeywordsNoLocale.toUtf8().data(),"options"); - #ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_ircViewFeatures - e1->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_ircViewFeatures; - #else - e1->szGroup = "general"; - #endif - #ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_ircViewFeatures - e1->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_ircViewFeatures; - #else - e1->bIsContainer = false; - #endif - #ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_ircViewFeatures - e1->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_ircViewFeatures; - #else - e1->bIsNotContained = false; - #endif - e1->szNameNoLocale = g_szName_OptionsWidget_ircViewFeatures; - e1->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_ircViewFeatures,"options"); - e0->pChildList->append(e1); - e1->pChildList = 0; - - e1 = new OptionsWidgetInstanceEntry; - e1->createProc = &classOptionsWidget_ircViewMarker_createInstanceProc; - e1->pWidget = 0; - e1->szClassName = g_szClassName_OptionsWidget_ircViewMarker; - e1->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_ircViewMarker; - #ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_ircViewMarker - e1->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_ircViewMarker; - #else - e1->iPriority = 0; - #endif - #ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_ircViewMarker - e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_ircViewMarker "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_ircViewMarker; - #else - e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_ircViewMarker; - #endif - e1->szKeywords = __tr2qs_ctx_no_xgettext(e1->szKeywordsNoLocale.toUtf8().data(),"options"); - #ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_ircViewMarker - e1->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_ircViewMarker; - #else - e1->szGroup = "general"; - #endif - #ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_ircViewMarker - e1->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_ircViewMarker; - #else - e1->bIsContainer = false; - #endif - #ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_ircViewMarker - e1->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_ircViewMarker; - #else - e1->bIsNotContained = false; - #endif - e1->szNameNoLocale = g_szName_OptionsWidget_ircViewMarker; - e1->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_ircViewMarker,"options"); - e0->pChildList->append(e1); - e1->pChildList = 0; + e1 = new OptionsWidgetInstanceEntry; + e1->createProc = &classOptionsWidget_ircViewLook_createInstanceProc; + e1->pWidget = 0; + e1->szClassName = g_szClassName_OptionsWidget_ircViewLook; + e1->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_ircViewLook; +#ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_ircViewLook + e1->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_ircViewLook; +#else + e1->iPriority = 0; +#endif +#ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_ircViewLook + e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_ircViewLook "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_ircViewLook; +#else + e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_ircViewLook; +#endif + e1->szKeywords = __tr2qs_ctx_no_xgettext(e1->szKeywordsNoLocale.toUtf8().data(), "options"); +#ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_ircViewLook + e1->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_ircViewLook; +#else + e1->szGroup = "general"; +#endif +#ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_ircViewLook + e1->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_ircViewLook; +#else + e1->bIsContainer = false; +#endif +#ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_ircViewLook + e1->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_ircViewLook; +#else + e1->bIsNotContained = false; +#endif + e1->szNameNoLocale = g_szName_OptionsWidget_ircViewLook; + e1->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_ircViewLook, "options"); + e0->pChildList->append(e1); + e1->pChildList = 0; + + e1 = new OptionsWidgetInstanceEntry; + e1->createProc = &classOptionsWidget_ircViewFeatures_createInstanceProc; + e1->pWidget = 0; + e1->szClassName = g_szClassName_OptionsWidget_ircViewFeatures; + e1->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_ircViewFeatures; +#ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_ircViewFeatures + e1->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_ircViewFeatures; +#else + e1->iPriority = 0; +#endif +#ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_ircViewFeatures + e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_ircViewFeatures "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_ircViewFeatures; +#else + e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_ircViewFeatures; +#endif + e1->szKeywords = __tr2qs_ctx_no_xgettext(e1->szKeywordsNoLocale.toUtf8().data(), "options"); +#ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_ircViewFeatures + e1->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_ircViewFeatures; +#else + e1->szGroup = "general"; +#endif +#ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_ircViewFeatures + e1->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_ircViewFeatures; +#else + e1->bIsContainer = false; +#endif +#ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_ircViewFeatures + e1->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_ircViewFeatures; +#else + e1->bIsNotContained = false; +#endif + e1->szNameNoLocale = g_szName_OptionsWidget_ircViewFeatures; + e1->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_ircViewFeatures, "options"); + e0->pChildList->append(e1); + e1->pChildList = 0; + + e1 = new OptionsWidgetInstanceEntry; + e1->createProc = &classOptionsWidget_ircViewMarker_createInstanceProc; + e1->pWidget = 0; + e1->szClassName = g_szClassName_OptionsWidget_ircViewMarker; + e1->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_ircViewMarker; +#ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_ircViewMarker + e1->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_ircViewMarker; +#else + e1->iPriority = 0; +#endif +#ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_ircViewMarker + e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_ircViewMarker "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_ircViewMarker; +#else + e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_ircViewMarker; +#endif + e1->szKeywords = __tr2qs_ctx_no_xgettext(e1->szKeywordsNoLocale.toUtf8().data(), "options"); +#ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_ircViewMarker + e1->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_ircViewMarker; +#else + e1->szGroup = "general"; +#endif +#ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_ircViewMarker + e1->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_ircViewMarker; +#else + e1->bIsContainer = false; +#endif +#ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_ircViewMarker + e1->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_ircViewMarker; +#else + e1->bIsNotContained = false; +#endif + e1->szNameNoLocale = g_szName_OptionsWidget_ircViewMarker; + e1->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_ircViewMarker, "options"); + e0->pChildList->append(e1); + e1->pChildList = 0; e0 = new OptionsWidgetInstanceEntry; e0->createProc = &classOptionsWidget_message_createInstanceProc; e0->pWidget = 0; e0->szClassName = g_szClassName_OptionsWidget_message; e0->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_message; - #ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_message +#ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_message e0->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_message; - #else +#else e0->iPriority = 0; - #endif - #ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_message +#endif +#ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_message e0->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_message "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_message; - #else +#else e0->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_message; - #endif - e0->szKeywords = __tr2qs_ctx_no_xgettext(e0->szKeywordsNoLocale.toUtf8().data(),"options"); - #ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_message +#endif + e0->szKeywords = __tr2qs_ctx_no_xgettext(e0->szKeywordsNoLocale.toUtf8().data(), "options"); +#ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_message e0->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_message; - #else +#else e0->szGroup = "general"; - #endif - #ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_message +#endif +#ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_message e0->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_message; - #else +#else e0->bIsContainer = false; - #endif - #ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_message +#endif +#ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_message e0->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_message; - #else +#else e0->bIsNotContained = false; - #endif +#endif e0->szNameNoLocale = g_szName_OptionsWidget_message; - e0->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_message,"options"); + e0->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_message, "options"); m_pInstanceTree->append(e0); e0->pChildList = new KviPointerList; e0->pChildList->setAutoDelete(true); - e1 = new OptionsWidgetInstanceEntry; - e1->createProc = &classOptionsWidget_privmsg_createInstanceProc; - e1->pWidget = 0; - e1->szClassName = g_szClassName_OptionsWidget_privmsg; - e1->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_privmsg; - #ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_privmsg - e1->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_privmsg; - #else - e1->iPriority = 0; - #endif - #ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_privmsg - e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_privmsg "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_privmsg; - #else - e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_privmsg; - #endif - e1->szKeywords = __tr2qs_ctx_no_xgettext(e1->szKeywordsNoLocale.toUtf8().data(),"options"); - #ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_privmsg - e1->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_privmsg; - #else - e1->szGroup = "general"; - #endif - #ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_privmsg - e1->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_privmsg; - #else - e1->bIsContainer = false; - #endif - #ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_privmsg - e1->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_privmsg; - #else - e1->bIsNotContained = false; - #endif - e1->szNameNoLocale = g_szName_OptionsWidget_privmsg; - e1->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_privmsg,"options"); - e0->pChildList->append(e1); - e1->pChildList = 0; - - e1 = new OptionsWidgetInstanceEntry; - e1->createProc = &classOptionsWidget_timestamp_createInstanceProc; - e1->pWidget = 0; - e1->szClassName = g_szClassName_OptionsWidget_timestamp; - e1->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_timestamp; - #ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_timestamp - e1->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_timestamp; - #else - e1->iPriority = 0; - #endif - #ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_timestamp - e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_timestamp "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_timestamp; - #else - e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_timestamp; - #endif - e1->szKeywords = __tr2qs_ctx_no_xgettext(e1->szKeywordsNoLocale.toUtf8().data(),"options"); - #ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_timestamp - e1->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_timestamp; - #else - e1->szGroup = "general"; - #endif - #ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_timestamp - e1->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_timestamp; - #else - e1->bIsContainer = false; - #endif - #ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_timestamp - e1->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_timestamp; - #else - e1->bIsNotContained = false; - #endif - e1->szNameNoLocale = g_szName_OptionsWidget_timestamp; - e1->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_timestamp,"options"); - e0->pChildList->append(e1); - e1->pChildList = 0; - - e1 = new OptionsWidgetInstanceEntry; - e1->createProc = &classOptionsWidget_messageColors_createInstanceProc; - e1->pWidget = 0; - e1->szClassName = g_szClassName_OptionsWidget_messageColors; - e1->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_messageColors; - #ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_messageColors - e1->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_messageColors; - #else - e1->iPriority = 0; - #endif - #ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_messageColors - e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_messageColors "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_messageColors; - #else - e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_messageColors; - #endif - e1->szKeywords = __tr2qs_ctx_no_xgettext(e1->szKeywordsNoLocale.toUtf8().data(),"options"); - #ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_messageColors - e1->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_messageColors; - #else - e1->szGroup = "general"; - #endif - #ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_messageColors - e1->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_messageColors; - #else - e1->bIsContainer = false; - #endif - #ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_messageColors - e1->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_messageColors; - #else - e1->bIsNotContained = false; - #endif - e1->szNameNoLocale = g_szName_OptionsWidget_messageColors; - e1->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_messageColors,"options"); - e0->pChildList->append(e1); - e1->pChildList = 0; - - e1 = new OptionsWidgetInstanceEntry; - e1->createProc = &classOptionsWidget_standardColors_createInstanceProc; - e1->pWidget = 0; - e1->szClassName = g_szClassName_OptionsWidget_standardColors; - e1->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_standardColors; - #ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_standardColors - e1->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_standardColors; - #else - e1->iPriority = 0; - #endif - #ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_standardColors - e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_standardColors "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_standardColors; - #else - e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_standardColors; - #endif - e1->szKeywords = __tr2qs_ctx_no_xgettext(e1->szKeywordsNoLocale.toUtf8().data(),"options"); - #ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_standardColors - e1->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_standardColors; - #else - e1->szGroup = "general"; - #endif - #ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_standardColors - e1->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_standardColors; - #else - e1->bIsContainer = false; - #endif - #ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_standardColors - e1->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_standardColors; - #else - e1->bIsNotContained = false; - #endif - e1->szNameNoLocale = g_szName_OptionsWidget_standardColors; - e1->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_standardColors,"options"); - e0->pChildList->append(e1); - e1->pChildList = 0; + e1 = new OptionsWidgetInstanceEntry; + e1->createProc = &classOptionsWidget_privmsg_createInstanceProc; + e1->pWidget = 0; + e1->szClassName = g_szClassName_OptionsWidget_privmsg; + e1->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_privmsg; +#ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_privmsg + e1->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_privmsg; +#else + e1->iPriority = 0; +#endif +#ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_privmsg + e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_privmsg "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_privmsg; +#else + e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_privmsg; +#endif + e1->szKeywords = __tr2qs_ctx_no_xgettext(e1->szKeywordsNoLocale.toUtf8().data(), "options"); +#ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_privmsg + e1->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_privmsg; +#else + e1->szGroup = "general"; +#endif +#ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_privmsg + e1->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_privmsg; +#else + e1->bIsContainer = false; +#endif +#ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_privmsg + e1->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_privmsg; +#else + e1->bIsNotContained = false; +#endif + e1->szNameNoLocale = g_szName_OptionsWidget_privmsg; + e1->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_privmsg, "options"); + e0->pChildList->append(e1); + e1->pChildList = 0; + + e1 = new OptionsWidgetInstanceEntry; + e1->createProc = &classOptionsWidget_timestamp_createInstanceProc; + e1->pWidget = 0; + e1->szClassName = g_szClassName_OptionsWidget_timestamp; + e1->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_timestamp; +#ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_timestamp + e1->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_timestamp; +#else + e1->iPriority = 0; +#endif +#ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_timestamp + e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_timestamp "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_timestamp; +#else + e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_timestamp; +#endif + e1->szKeywords = __tr2qs_ctx_no_xgettext(e1->szKeywordsNoLocale.toUtf8().data(), "options"); +#ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_timestamp + e1->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_timestamp; +#else + e1->szGroup = "general"; +#endif +#ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_timestamp + e1->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_timestamp; +#else + e1->bIsContainer = false; +#endif +#ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_timestamp + e1->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_timestamp; +#else + e1->bIsNotContained = false; +#endif + e1->szNameNoLocale = g_szName_OptionsWidget_timestamp; + e1->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_timestamp, "options"); + e0->pChildList->append(e1); + e1->pChildList = 0; + + e1 = new OptionsWidgetInstanceEntry; + e1->createProc = &classOptionsWidget_messageColors_createInstanceProc; + e1->pWidget = 0; + e1->szClassName = g_szClassName_OptionsWidget_messageColors; + e1->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_messageColors; +#ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_messageColors + e1->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_messageColors; +#else + e1->iPriority = 0; +#endif +#ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_messageColors + e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_messageColors "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_messageColors; +#else + e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_messageColors; +#endif + e1->szKeywords = __tr2qs_ctx_no_xgettext(e1->szKeywordsNoLocale.toUtf8().data(), "options"); +#ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_messageColors + e1->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_messageColors; +#else + e1->szGroup = "general"; +#endif +#ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_messageColors + e1->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_messageColors; +#else + e1->bIsContainer = false; +#endif +#ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_messageColors + e1->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_messageColors; +#else + e1->bIsNotContained = false; +#endif + e1->szNameNoLocale = g_szName_OptionsWidget_messageColors; + e1->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_messageColors, "options"); + e0->pChildList->append(e1); + e1->pChildList = 0; + + e1 = new OptionsWidgetInstanceEntry; + e1->createProc = &classOptionsWidget_standardColors_createInstanceProc; + e1->pWidget = 0; + e1->szClassName = g_szClassName_OptionsWidget_standardColors; + e1->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_standardColors; +#ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_standardColors + e1->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_standardColors; +#else + e1->iPriority = 0; +#endif +#ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_standardColors + e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_standardColors "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_standardColors; +#else + e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_standardColors; +#endif + e1->szKeywords = __tr2qs_ctx_no_xgettext(e1->szKeywordsNoLocale.toUtf8().data(), "options"); +#ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_standardColors + e1->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_standardColors; +#else + e1->szGroup = "general"; +#endif +#ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_standardColors + e1->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_standardColors; +#else + e1->bIsContainer = false; +#endif +#ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_standardColors + e1->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_standardColors; +#else + e1->bIsNotContained = false; +#endif + e1->szNameNoLocale = g_szName_OptionsWidget_standardColors; + e1->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_standardColors, "options"); + e0->pChildList->append(e1); + e1->pChildList = 0; e0 = new OptionsWidgetInstanceEntry; e0->createProc = &classOptionsWidget_notifierLook_createInstanceProc; e0->pWidget = 0; e0->szClassName = g_szClassName_OptionsWidget_notifierLook; e0->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_notifierLook; - #ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_notifierLook +#ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_notifierLook e0->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_notifierLook; - #else +#else e0->iPriority = 0; - #endif - #ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_notifierLook +#endif +#ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_notifierLook e0->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_notifierLook "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_notifierLook; - #else +#else e0->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_notifierLook; - #endif - e0->szKeywords = __tr2qs_ctx_no_xgettext(e0->szKeywordsNoLocale.toUtf8().data(),"options"); - #ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_notifierLook +#endif + e0->szKeywords = __tr2qs_ctx_no_xgettext(e0->szKeywordsNoLocale.toUtf8().data(), "options"); +#ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_notifierLook e0->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_notifierLook; - #else +#else e0->szGroup = "general"; - #endif - #ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_notifierLook +#endif +#ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_notifierLook e0->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_notifierLook; - #else +#else e0->bIsContainer = false; - #endif - #ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_notifierLook +#endif +#ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_notifierLook e0->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_notifierLook; - #else +#else e0->bIsNotContained = false; - #endif +#endif e0->szNameNoLocale = g_szName_OptionsWidget_notifierLook; - e0->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_notifierLook,"options"); + e0->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_notifierLook, "options"); m_pInstanceTree->append(e0); e0->pChildList = 0; @@ -3077,34 +3074,34 @@ OptionsInstanceManager::OptionsInstanceManager() e0->pWidget = 0; e0->szClassName = g_szClassName_OptionsWidget_servers; e0->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_servers; - #ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_servers +#ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_servers e0->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_servers; - #else +#else e0->iPriority = 0; - #endif - #ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_servers +#endif +#ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_servers e0->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_servers "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_servers; - #else +#else e0->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_servers; - #endif - e0->szKeywords = __tr2qs_ctx_no_xgettext(e0->szKeywordsNoLocale.toUtf8().data(),"options"); - #ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_servers +#endif + e0->szKeywords = __tr2qs_ctx_no_xgettext(e0->szKeywordsNoLocale.toUtf8().data(), "options"); +#ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_servers e0->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_servers; - #else +#else e0->szGroup = "general"; - #endif - #ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_servers +#endif +#ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_servers e0->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_servers; - #else +#else e0->bIsContainer = false; - #endif - #ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_servers +#endif +#ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_servers e0->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_servers; - #else +#else e0->bIsNotContained = false; - #endif +#endif e0->szNameNoLocale = g_szName_OptionsWidget_servers; - e0->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_servers,"options"); + e0->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_servers, "options"); m_pInstanceTree->append(e0); e0->pChildList = 0; @@ -3113,34 +3110,34 @@ OptionsInstanceManager::OptionsInstanceManager() e0->pWidget = 0; e0->szClassName = g_szClassName_OptionsWidget_theme; e0->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_theme; - #ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_theme +#ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_theme e0->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_theme; - #else +#else e0->iPriority = 0; - #endif - #ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_theme +#endif +#ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_theme e0->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_theme "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_theme; - #else +#else e0->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_theme; - #endif - e0->szKeywords = __tr2qs_ctx_no_xgettext(e0->szKeywordsNoLocale.toUtf8().data(),"options"); - #ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_theme +#endif + e0->szKeywords = __tr2qs_ctx_no_xgettext(e0->szKeywordsNoLocale.toUtf8().data(), "options"); +#ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_theme e0->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_theme; - #else +#else e0->szGroup = "general"; - #endif - #ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_theme +#endif +#ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_theme e0->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_theme; - #else +#else e0->bIsContainer = false; - #endif - #ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_theme +#endif +#ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_theme e0->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_theme; - #else +#else e0->bIsNotContained = false; - #endif +#endif e0->szNameNoLocale = g_szName_OptionsWidget_theme; - e0->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_theme,"options"); + e0->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_theme, "options"); m_pInstanceTree->append(e0); e0->pChildList = 0; @@ -3149,34 +3146,34 @@ OptionsInstanceManager::OptionsInstanceManager() e0->pWidget = 0; e0->szClassName = g_szClassName_OptionsWidget_themeTransparency; e0->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_themeTransparency; - #ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_themeTransparency +#ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_themeTransparency e0->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_themeTransparency; - #else +#else e0->iPriority = 0; - #endif - #ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_themeTransparency +#endif +#ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_themeTransparency e0->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_themeTransparency "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_themeTransparency; - #else +#else e0->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_themeTransparency; - #endif - e0->szKeywords = __tr2qs_ctx_no_xgettext(e0->szKeywordsNoLocale.toUtf8().data(),"options"); - #ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_themeTransparency +#endif + e0->szKeywords = __tr2qs_ctx_no_xgettext(e0->szKeywordsNoLocale.toUtf8().data(), "options"); +#ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_themeTransparency e0->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_themeTransparency; - #else +#else e0->szGroup = "general"; - #endif - #ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_themeTransparency +#endif +#ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_themeTransparency e0->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_themeTransparency; - #else +#else e0->bIsContainer = false; - #endif - #ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_themeTransparency +#endif +#ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_themeTransparency e0->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_themeTransparency; - #else +#else e0->bIsNotContained = false; - #endif +#endif e0->szNameNoLocale = g_szName_OptionsWidget_themeTransparency; - e0->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_themeTransparency,"options"); + e0->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_themeTransparency, "options"); m_pInstanceTree->append(e0); e0->pChildList = 0; @@ -3185,34 +3182,34 @@ OptionsInstanceManager::OptionsInstanceManager() e0->pWidget = 0; e0->szClassName = g_szClassName_OptionsWidget_themeToolBarApplets; e0->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_themeToolBarApplets; - #ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_themeToolBarApplets +#ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_themeToolBarApplets e0->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_themeToolBarApplets; - #else +#else e0->iPriority = 0; - #endif - #ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_themeToolBarApplets +#endif +#ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_themeToolBarApplets e0->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_themeToolBarApplets "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_themeToolBarApplets; - #else +#else e0->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_themeToolBarApplets; - #endif - e0->szKeywords = __tr2qs_ctx_no_xgettext(e0->szKeywordsNoLocale.toUtf8().data(),"options"); - #ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_themeToolBarApplets +#endif + e0->szKeywords = __tr2qs_ctx_no_xgettext(e0->szKeywordsNoLocale.toUtf8().data(), "options"); +#ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_themeToolBarApplets e0->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_themeToolBarApplets; - #else +#else e0->szGroup = "general"; - #endif - #ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_themeToolBarApplets +#endif +#ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_themeToolBarApplets e0->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_themeToolBarApplets; - #else +#else e0->bIsContainer = false; - #endif - #ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_themeToolBarApplets +#endif +#ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_themeToolBarApplets e0->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_themeToolBarApplets; - #else +#else e0->bIsNotContained = false; - #endif +#endif e0->szNameNoLocale = g_szName_OptionsWidget_themeToolBarApplets; - e0->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_themeToolBarApplets,"options"); + e0->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_themeToolBarApplets, "options"); m_pInstanceTree->append(e0); e0->pChildList = 0; @@ -3221,34 +3218,34 @@ OptionsInstanceManager::OptionsInstanceManager() e0->pWidget = 0; e0->szClassName = g_szClassName_OptionsWidget_topicLabel; e0->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_topicLabel; - #ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_topicLabel +#ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_topicLabel e0->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_topicLabel; - #else +#else e0->iPriority = 0; - #endif - #ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_topicLabel +#endif +#ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_topicLabel e0->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_topicLabel "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_topicLabel; - #else +#else e0->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_topicLabel; - #endif - e0->szKeywords = __tr2qs_ctx_no_xgettext(e0->szKeywordsNoLocale.toUtf8().data(),"options"); - #ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_topicLabel +#endif + e0->szKeywords = __tr2qs_ctx_no_xgettext(e0->szKeywordsNoLocale.toUtf8().data(), "options"); +#ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_topicLabel e0->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_topicLabel; - #else +#else e0->szGroup = "general"; - #endif - #ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_topicLabel +#endif +#ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_topicLabel e0->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_topicLabel; - #else +#else e0->bIsContainer = false; - #endif - #ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_topicLabel +#endif +#ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_topicLabel e0->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_topicLabel; - #else +#else e0->bIsNotContained = false; - #endif +#endif e0->szNameNoLocale = g_szName_OptionsWidget_topicLabel; - e0->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_topicLabel,"options"); + e0->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_topicLabel, "options"); m_pInstanceTree->append(e0); e0->pChildList = 0; @@ -3257,403 +3254,402 @@ OptionsInstanceManager::OptionsInstanceManager() e0->pWidget = 0; e0->szClassName = g_szClassName_OptionsWidget_userList; e0->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_userList; - #ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_userList +#ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_userList e0->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_userList; - #else +#else e0->iPriority = 0; - #endif - #ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_userList +#endif +#ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_userList e0->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_userList "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_userList; - #else +#else e0->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_userList; - #endif - e0->szKeywords = __tr2qs_ctx_no_xgettext(e0->szKeywordsNoLocale.toUtf8().data(),"options"); - #ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_userList +#endif + e0->szKeywords = __tr2qs_ctx_no_xgettext(e0->szKeywordsNoLocale.toUtf8().data(), "options"); +#ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_userList e0->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_userList; - #else +#else e0->szGroup = "general"; - #endif - #ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_userList +#endif +#ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_userList e0->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_userList; - #else +#else e0->bIsContainer = false; - #endif - #ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_userList +#endif +#ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_userList e0->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_userList; - #else +#else e0->bIsNotContained = false; - #endif +#endif e0->szNameNoLocale = g_szName_OptionsWidget_userList; - e0->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_userList,"options"); + e0->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_userList, "options"); m_pInstanceTree->append(e0); e0->pChildList = new KviPointerList; e0->pChildList->setAutoDelete(true); - e1 = new OptionsWidgetInstanceEntry; - e1->createProc = &classOptionsWidget_userListBackground_createInstanceProc; - e1->pWidget = 0; - e1->szClassName = g_szClassName_OptionsWidget_userListBackground; - e1->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_userListBackground; - #ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_userListBackground - e1->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_userListBackground; - #else - e1->iPriority = 0; - #endif - #ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_userListBackground - e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_userListBackground "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_userListBackground; - #else - e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_userListBackground; - #endif - e1->szKeywords = __tr2qs_ctx_no_xgettext(e1->szKeywordsNoLocale.toUtf8().data(),"options"); - #ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_userListBackground - e1->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_userListBackground; - #else - e1->szGroup = "general"; - #endif - #ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_userListBackground - e1->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_userListBackground; - #else - e1->bIsContainer = false; - #endif - #ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_userListBackground - e1->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_userListBackground; - #else - e1->bIsNotContained = false; - #endif - e1->szNameNoLocale = g_szName_OptionsWidget_userListBackground; - e1->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_userListBackground,"options"); - e0->pChildList->append(e1); - e1->pChildList = 0; - - e1 = new OptionsWidgetInstanceEntry; - e1->createProc = &classOptionsWidget_userListForeground_createInstanceProc; - e1->pWidget = 0; - e1->szClassName = g_szClassName_OptionsWidget_userListForeground; - e1->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_userListForeground; - #ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_userListForeground - e1->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_userListForeground; - #else - e1->iPriority = 0; - #endif - #ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_userListForeground - e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_userListForeground "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_userListForeground; - #else - e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_userListForeground; - #endif - e1->szKeywords = __tr2qs_ctx_no_xgettext(e1->szKeywordsNoLocale.toUtf8().data(),"options"); - #ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_userListForeground - e1->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_userListForeground; - #else - e1->szGroup = "general"; - #endif - #ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_userListForeground - e1->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_userListForeground; - #else - e1->bIsContainer = false; - #endif - #ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_userListForeground - e1->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_userListForeground; - #else - e1->bIsNotContained = false; - #endif - e1->szNameNoLocale = g_szName_OptionsWidget_userListForeground; - e1->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_userListForeground,"options"); - e0->pChildList->append(e1); - e1->pChildList = 0; - - e1 = new OptionsWidgetInstanceEntry; - e1->createProc = &classOptionsWidget_userListGrid_createInstanceProc; - e1->pWidget = 0; - e1->szClassName = g_szClassName_OptionsWidget_userListGrid; - e1->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_userListGrid; - #ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_userListGrid - e1->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_userListGrid; - #else - e1->iPriority = 0; - #endif - #ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_userListGrid - e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_userListGrid "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_userListGrid; - #else - e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_userListGrid; - #endif - e1->szKeywords = __tr2qs_ctx_no_xgettext(e1->szKeywordsNoLocale.toUtf8().data(),"options"); - #ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_userListGrid - e1->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_userListGrid; - #else - e1->szGroup = "general"; - #endif - #ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_userListGrid - e1->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_userListGrid; - #else - e1->bIsContainer = false; - #endif - #ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_userListGrid - e1->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_userListGrid; - #else - e1->bIsNotContained = false; - #endif - e1->szNameNoLocale = g_szName_OptionsWidget_userListGrid; - e1->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_userListGrid,"options"); - e0->pChildList->append(e1); - e1->pChildList = 0; - - e1 = new OptionsWidgetInstanceEntry; - e1->createProc = &classOptionsWidget_userListFeatures_createInstanceProc; - e1->pWidget = 0; - e1->szClassName = g_szClassName_OptionsWidget_userListFeatures; - e1->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_userListFeatures; - #ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_userListFeatures - e1->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_userListFeatures; - #else - e1->iPriority = 0; - #endif - #ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_userListFeatures - e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_userListFeatures "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_userListFeatures; - #else - e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_userListFeatures; - #endif - e1->szKeywords = __tr2qs_ctx_no_xgettext(e1->szKeywordsNoLocale.toUtf8().data(),"options"); - #ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_userListFeatures - e1->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_userListFeatures; - #else - e1->szGroup = "general"; - #endif - #ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_userListFeatures - e1->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_userListFeatures; - #else - e1->bIsContainer = false; - #endif - #ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_userListFeatures - e1->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_userListFeatures; - #else - e1->bIsNotContained = false; - #endif - e1->szNameNoLocale = g_szName_OptionsWidget_userListFeatures; - e1->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_userListFeatures,"options"); - e0->pChildList->append(e1); - e1->pChildList = 0; + e1 = new OptionsWidgetInstanceEntry; + e1->createProc = &classOptionsWidget_userListBackground_createInstanceProc; + e1->pWidget = 0; + e1->szClassName = g_szClassName_OptionsWidget_userListBackground; + e1->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_userListBackground; +#ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_userListBackground + e1->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_userListBackground; +#else + e1->iPriority = 0; +#endif +#ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_userListBackground + e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_userListBackground "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_userListBackground; +#else + e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_userListBackground; +#endif + e1->szKeywords = __tr2qs_ctx_no_xgettext(e1->szKeywordsNoLocale.toUtf8().data(), "options"); +#ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_userListBackground + e1->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_userListBackground; +#else + e1->szGroup = "general"; +#endif +#ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_userListBackground + e1->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_userListBackground; +#else + e1->bIsContainer = false; +#endif +#ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_userListBackground + e1->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_userListBackground; +#else + e1->bIsNotContained = false; +#endif + e1->szNameNoLocale = g_szName_OptionsWidget_userListBackground; + e1->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_userListBackground, "options"); + e0->pChildList->append(e1); + e1->pChildList = 0; + + e1 = new OptionsWidgetInstanceEntry; + e1->createProc = &classOptionsWidget_userListForeground_createInstanceProc; + e1->pWidget = 0; + e1->szClassName = g_szClassName_OptionsWidget_userListForeground; + e1->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_userListForeground; +#ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_userListForeground + e1->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_userListForeground; +#else + e1->iPriority = 0; +#endif +#ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_userListForeground + e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_userListForeground "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_userListForeground; +#else + e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_userListForeground; +#endif + e1->szKeywords = __tr2qs_ctx_no_xgettext(e1->szKeywordsNoLocale.toUtf8().data(), "options"); +#ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_userListForeground + e1->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_userListForeground; +#else + e1->szGroup = "general"; +#endif +#ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_userListForeground + e1->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_userListForeground; +#else + e1->bIsContainer = false; +#endif +#ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_userListForeground + e1->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_userListForeground; +#else + e1->bIsNotContained = false; +#endif + e1->szNameNoLocale = g_szName_OptionsWidget_userListForeground; + e1->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_userListForeground, "options"); + e0->pChildList->append(e1); + e1->pChildList = 0; + + e1 = new OptionsWidgetInstanceEntry; + e1->createProc = &classOptionsWidget_userListGrid_createInstanceProc; + e1->pWidget = 0; + e1->szClassName = g_szClassName_OptionsWidget_userListGrid; + e1->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_userListGrid; +#ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_userListGrid + e1->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_userListGrid; +#else + e1->iPriority = 0; +#endif +#ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_userListGrid + e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_userListGrid "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_userListGrid; +#else + e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_userListGrid; +#endif + e1->szKeywords = __tr2qs_ctx_no_xgettext(e1->szKeywordsNoLocale.toUtf8().data(), "options"); +#ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_userListGrid + e1->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_userListGrid; +#else + e1->szGroup = "general"; +#endif +#ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_userListGrid + e1->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_userListGrid; +#else + e1->bIsContainer = false; +#endif +#ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_userListGrid + e1->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_userListGrid; +#else + e1->bIsNotContained = false; +#endif + e1->szNameNoLocale = g_szName_OptionsWidget_userListGrid; + e1->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_userListGrid, "options"); + e0->pChildList->append(e1); + e1->pChildList = 0; + + e1 = new OptionsWidgetInstanceEntry; + e1->createProc = &classOptionsWidget_userListFeatures_createInstanceProc; + e1->pWidget = 0; + e1->szClassName = g_szClassName_OptionsWidget_userListFeatures; + e1->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_userListFeatures; +#ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_userListFeatures + e1->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_userListFeatures; +#else + e1->iPriority = 0; +#endif +#ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_userListFeatures + e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_userListFeatures "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_userListFeatures; +#else + e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_userListFeatures; +#endif + e1->szKeywords = __tr2qs_ctx_no_xgettext(e1->szKeywordsNoLocale.toUtf8().data(), "options"); +#ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_userListFeatures + e1->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_userListFeatures; +#else + e1->szGroup = "general"; +#endif +#ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_userListFeatures + e1->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_userListFeatures; +#else + e1->bIsContainer = false; +#endif +#ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_userListFeatures + e1->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_userListFeatures; +#else + e1->bIsNotContained = false; +#endif + e1->szNameNoLocale = g_szName_OptionsWidget_userListFeatures; + e1->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_userListFeatures, "options"); + e0->pChildList->append(e1); + e1->pChildList = 0; e0 = new OptionsWidgetInstanceEntry; e0->createProc = &classOptionsWidget_windowList_createInstanceProc; e0->pWidget = 0; e0->szClassName = g_szClassName_OptionsWidget_windowList; e0->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_windowList; - #ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_windowList +#ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_windowList e0->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_windowList; - #else +#else e0->iPriority = 0; - #endif - #ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_windowList +#endif +#ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_windowList e0->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_windowList "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_windowList; - #else +#else e0->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_windowList; - #endif - e0->szKeywords = __tr2qs_ctx_no_xgettext(e0->szKeywordsNoLocale.toUtf8().data(),"options"); - #ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_windowList +#endif + e0->szKeywords = __tr2qs_ctx_no_xgettext(e0->szKeywordsNoLocale.toUtf8().data(), "options"); +#ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_windowList e0->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_windowList; - #else +#else e0->szGroup = "general"; - #endif - #ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_windowList +#endif +#ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_windowList e0->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_windowList; - #else +#else e0->bIsContainer = false; - #endif - #ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_windowList +#endif +#ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_windowList e0->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_windowList; - #else +#else e0->bIsNotContained = false; - #endif +#endif e0->szNameNoLocale = g_szName_OptionsWidget_windowList; - e0->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_windowList,"options"); + e0->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_windowList, "options"); m_pInstanceTree->append(e0); e0->pChildList = new KviPointerList; e0->pChildList->setAutoDelete(true); - e1 = new OptionsWidgetInstanceEntry; - e1->createProc = &classOptionsWidget_windowListTree_createInstanceProc; - e1->pWidget = 0; - e1->szClassName = g_szClassName_OptionsWidget_windowListTree; - e1->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_windowListTree; - #ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_windowListTree - e1->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_windowListTree; - #else - e1->iPriority = 0; - #endif - #ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_windowListTree - e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_windowListTree "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_windowListTree; - #else - e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_windowListTree; - #endif - e1->szKeywords = __tr2qs_ctx_no_xgettext(e1->szKeywordsNoLocale.toUtf8().data(),"options"); - #ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_windowListTree - e1->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_windowListTree; - #else - e1->szGroup = "general"; - #endif - #ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_windowListTree - e1->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_windowListTree; - #else - e1->bIsContainer = false; - #endif - #ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_windowListTree - e1->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_windowListTree; - #else - e1->bIsNotContained = false; - #endif - e1->szNameNoLocale = g_szName_OptionsWidget_windowListTree; - e1->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_windowListTree,"options"); - e0->pChildList->append(e1); - - e1->pChildList = new KviPointerList; - e1->pChildList->setAutoDelete(true); - - e2 = new OptionsWidgetInstanceEntry; - e2->createProc = &classOptionsWidget_windowListTreeForeground_createInstanceProc; - e2->pWidget = 0; - e2->szClassName = g_szClassName_OptionsWidget_windowListTreeForeground; - e2->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_windowListTreeForeground; - #ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_windowListTreeForeground - e2->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_windowListTreeForeground; - #else - e2->iPriority = 0; - #endif - #ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_windowListTreeForeground - e2->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_windowListTreeForeground "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_windowListTreeForeground; - #else - e2->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_windowListTreeForeground; - #endif - e2->szKeywords = __tr2qs_ctx_no_xgettext(e2->szKeywordsNoLocale.toUtf8().data(),"options"); - #ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_windowListTreeForeground - e2->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_windowListTreeForeground; - #else - e2->szGroup = "general"; - #endif - #ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_windowListTreeForeground - e2->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_windowListTreeForeground; - #else - e2->bIsContainer = false; - #endif - #ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_windowListTreeForeground - e2->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_windowListTreeForeground; - #else - e2->bIsNotContained = false; - #endif - e2->szNameNoLocale = g_szName_OptionsWidget_windowListTreeForeground; - e2->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_windowListTreeForeground,"options"); - e1->pChildList->append(e2); - e2->pChildList = 0; - - e2 = new OptionsWidgetInstanceEntry; - e2->createProc = &classOptionsWidget_windowListTreeBackground_createInstanceProc; - e2->pWidget = 0; - e2->szClassName = g_szClassName_OptionsWidget_windowListTreeBackground; - e2->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_windowListTreeBackground; - #ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_windowListTreeBackground - e2->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_windowListTreeBackground; - #else - e2->iPriority = 0; - #endif - #ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_windowListTreeBackground - e2->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_windowListTreeBackground "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_windowListTreeBackground; - #else - e2->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_windowListTreeBackground; - #endif - e2->szKeywords = __tr2qs_ctx_no_xgettext(e2->szKeywordsNoLocale.toUtf8().data(),"options"); - #ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_windowListTreeBackground - e2->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_windowListTreeBackground; - #else - e2->szGroup = "general"; - #endif - #ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_windowListTreeBackground - e2->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_windowListTreeBackground; - #else - e2->bIsContainer = false; - #endif - #ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_windowListTreeBackground - e2->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_windowListTreeBackground; - #else - e2->bIsNotContained = false; - #endif - e2->szNameNoLocale = g_szName_OptionsWidget_windowListTreeBackground; - e2->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_windowListTreeBackground,"options"); - e1->pChildList->append(e2); - e2->pChildList = 0; - - e2 = new OptionsWidgetInstanceEntry; - e2->createProc = &classOptionsWidget_windowListTreeFeatures_createInstanceProc; - e2->pWidget = 0; - e2->szClassName = g_szClassName_OptionsWidget_windowListTreeFeatures; - e2->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_windowListTreeFeatures; - #ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_windowListTreeFeatures - e2->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_windowListTreeFeatures; - #else - e2->iPriority = 0; - #endif - #ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_windowListTreeFeatures - e2->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_windowListTreeFeatures "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_windowListTreeFeatures; - #else - e2->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_windowListTreeFeatures; - #endif - e2->szKeywords = __tr2qs_ctx_no_xgettext(e2->szKeywordsNoLocale.toUtf8().data(),"options"); - #ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_windowListTreeFeatures - e2->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_windowListTreeFeatures; - #else - e2->szGroup = "general"; - #endif - #ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_windowListTreeFeatures - e2->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_windowListTreeFeatures; - #else - e2->bIsContainer = false; - #endif - #ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_windowListTreeFeatures - e2->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_windowListTreeFeatures; - #else - e2->bIsNotContained = false; - #endif - e2->szNameNoLocale = g_szName_OptionsWidget_windowListTreeFeatures; - e2->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_windowListTreeFeatures,"options"); - e1->pChildList->append(e2); - e2->pChildList = 0; - - e1 = new OptionsWidgetInstanceEntry; - e1->createProc = &classOptionsWidget_windowListClassic_createInstanceProc; - e1->pWidget = 0; - e1->szClassName = g_szClassName_OptionsWidget_windowListClassic; - e1->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_windowListClassic; - #ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_windowListClassic - e1->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_windowListClassic; - #else - e1->iPriority = 0; - #endif - #ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_windowListClassic - e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_windowListClassic "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_windowListClassic; - #else - e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_windowListClassic; - #endif - e1->szKeywords = __tr2qs_ctx_no_xgettext(e1->szKeywordsNoLocale.toUtf8().data(),"options"); - #ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_windowListClassic - e1->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_windowListClassic; - #else - e1->szGroup = "general"; - #endif - #ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_windowListClassic - e1->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_windowListClassic; - #else - e1->bIsContainer = false; - #endif - #ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_windowListClassic - e1->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_windowListClassic; - #else - e1->bIsNotContained = false; - #endif - e1->szNameNoLocale = g_szName_OptionsWidget_windowListClassic; - e1->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_windowListClassic,"options"); - e0->pChildList->append(e1); - e1->pChildList = 0; - + e1 = new OptionsWidgetInstanceEntry; + e1->createProc = &classOptionsWidget_windowListTree_createInstanceProc; + e1->pWidget = 0; + e1->szClassName = g_szClassName_OptionsWidget_windowListTree; + e1->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_windowListTree; +#ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_windowListTree + e1->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_windowListTree; +#else + e1->iPriority = 0; +#endif +#ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_windowListTree + e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_windowListTree "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_windowListTree; +#else + e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_windowListTree; +#endif + e1->szKeywords = __tr2qs_ctx_no_xgettext(e1->szKeywordsNoLocale.toUtf8().data(), "options"); +#ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_windowListTree + e1->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_windowListTree; +#else + e1->szGroup = "general"; +#endif +#ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_windowListTree + e1->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_windowListTree; +#else + e1->bIsContainer = false; +#endif +#ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_windowListTree + e1->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_windowListTree; +#else + e1->bIsNotContained = false; +#endif + e1->szNameNoLocale = g_szName_OptionsWidget_windowListTree; + e1->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_windowListTree, "options"); + e0->pChildList->append(e1); + + e1->pChildList = new KviPointerList; + e1->pChildList->setAutoDelete(true); + + e2 = new OptionsWidgetInstanceEntry; + e2->createProc = &classOptionsWidget_windowListTreeForeground_createInstanceProc; + e2->pWidget = 0; + e2->szClassName = g_szClassName_OptionsWidget_windowListTreeForeground; + e2->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_windowListTreeForeground; +#ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_windowListTreeForeground + e2->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_windowListTreeForeground; +#else + e2->iPriority = 0; +#endif +#ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_windowListTreeForeground + e2->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_windowListTreeForeground "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_windowListTreeForeground; +#else + e2->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_windowListTreeForeground; +#endif + e2->szKeywords = __tr2qs_ctx_no_xgettext(e2->szKeywordsNoLocale.toUtf8().data(), "options"); +#ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_windowListTreeForeground + e2->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_windowListTreeForeground; +#else + e2->szGroup = "general"; +#endif +#ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_windowListTreeForeground + e2->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_windowListTreeForeground; +#else + e2->bIsContainer = false; +#endif +#ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_windowListTreeForeground + e2->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_windowListTreeForeground; +#else + e2->bIsNotContained = false; +#endif + e2->szNameNoLocale = g_szName_OptionsWidget_windowListTreeForeground; + e2->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_windowListTreeForeground, "options"); + e1->pChildList->append(e2); + e2->pChildList = 0; + + e2 = new OptionsWidgetInstanceEntry; + e2->createProc = &classOptionsWidget_windowListTreeBackground_createInstanceProc; + e2->pWidget = 0; + e2->szClassName = g_szClassName_OptionsWidget_windowListTreeBackground; + e2->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_windowListTreeBackground; +#ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_windowListTreeBackground + e2->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_windowListTreeBackground; +#else + e2->iPriority = 0; +#endif +#ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_windowListTreeBackground + e2->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_windowListTreeBackground "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_windowListTreeBackground; +#else + e2->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_windowListTreeBackground; +#endif + e2->szKeywords = __tr2qs_ctx_no_xgettext(e2->szKeywordsNoLocale.toUtf8().data(), "options"); +#ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_windowListTreeBackground + e2->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_windowListTreeBackground; +#else + e2->szGroup = "general"; +#endif +#ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_windowListTreeBackground + e2->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_windowListTreeBackground; +#else + e2->bIsContainer = false; +#endif +#ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_windowListTreeBackground + e2->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_windowListTreeBackground; +#else + e2->bIsNotContained = false; +#endif + e2->szNameNoLocale = g_szName_OptionsWidget_windowListTreeBackground; + e2->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_windowListTreeBackground, "options"); + e1->pChildList->append(e2); + e2->pChildList = 0; + + e2 = new OptionsWidgetInstanceEntry; + e2->createProc = &classOptionsWidget_windowListTreeFeatures_createInstanceProc; + e2->pWidget = 0; + e2->szClassName = g_szClassName_OptionsWidget_windowListTreeFeatures; + e2->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_windowListTreeFeatures; +#ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_windowListTreeFeatures + e2->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_windowListTreeFeatures; +#else + e2->iPriority = 0; +#endif +#ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_windowListTreeFeatures + e2->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_windowListTreeFeatures "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_windowListTreeFeatures; +#else + e2->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_windowListTreeFeatures; +#endif + e2->szKeywords = __tr2qs_ctx_no_xgettext(e2->szKeywordsNoLocale.toUtf8().data(), "options"); +#ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_windowListTreeFeatures + e2->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_windowListTreeFeatures; +#else + e2->szGroup = "general"; +#endif +#ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_windowListTreeFeatures + e2->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_windowListTreeFeatures; +#else + e2->bIsContainer = false; +#endif +#ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_windowListTreeFeatures + e2->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_windowListTreeFeatures; +#else + e2->bIsNotContained = false; +#endif + e2->szNameNoLocale = g_szName_OptionsWidget_windowListTreeFeatures; + e2->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_windowListTreeFeatures, "options"); + e1->pChildList->append(e2); + e2->pChildList = 0; + + e1 = new OptionsWidgetInstanceEntry; + e1->createProc = &classOptionsWidget_windowListClassic_createInstanceProc; + e1->pWidget = 0; + e1->szClassName = g_szClassName_OptionsWidget_windowListClassic; + e1->eIcon = KVI_OPTIONS_WIDGET_ICON_OptionsWidget_windowListClassic; +#ifdef KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_windowListClassic + e1->iPriority = KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_windowListClassic; +#else + e1->iPriority = 0; +#endif +#ifdef KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_windowListClassic + e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_windowListClassic "," KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_windowListClassic; +#else + e1->szKeywordsNoLocale = KVI_OPTIONS_WIDGET_NAME_OptionsWidget_windowListClassic; +#endif + e1->szKeywords = __tr2qs_ctx_no_xgettext(e1->szKeywordsNoLocale.toUtf8().data(), "options"); +#ifdef KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_windowListClassic + e1->szGroup = KVI_OPTIONS_WIDGET_GROUP_OptionsWidget_windowListClassic; +#else + e1->szGroup = "general"; +#endif +#ifdef KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_windowListClassic + e1->bIsContainer = KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_windowListClassic; +#else + e1->bIsContainer = false; +#endif +#ifdef KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_windowListClassic + e1->bIsNotContained = KVI_OPTIONS_WIDGET_NOTCONTAINED_OptionsWidget_windowListClassic; +#else + e1->bIsNotContained = false; +#endif + e1->szNameNoLocale = g_szName_OptionsWidget_windowListClassic; + e1->szName = __tr2qs_ctx_no_xgettext(g_szName_OptionsWidget_windowListClassic, "options"); + e0->pChildList->append(e1); + e1->pChildList = 0; } void OptionsInstanceManager::deleteInstanceTree(KviPointerList * pList) @@ -3666,10 +3662,12 @@ void OptionsInstanceManager::deleteInstanceTree(KviPointerListpWidget->parent()->inherits("OptionsWidgetContainer")) { - disconnect(pEntry->pWidget,SIGNAL(destroyed()),this,SLOT(widgetDestroyed())); + disconnect(pEntry->pWidget, SIGNAL(destroyed()), this, SLOT(widgetDestroyed())); delete pEntry->pWidget->parent(); - pEntry->pWidget = 0; - } else { + pEntry->pWidget = 0; + } + else + { qDebug("Ops...i have deleted the options dialog ?"); } } //else qDebug("Class %s has no widget",e->szName); @@ -3694,12 +3692,11 @@ void OptionsInstanceManager::cleanup(KviModule *) void OptionsInstanceManager::widgetDestroyed() { - OptionsWidgetInstanceEntry * pEntry = findInstanceEntry(sender(),m_pInstanceTree); + OptionsWidgetInstanceEntry * pEntry = findInstanceEntry(sender(), m_pInstanceTree); if(pEntry) pEntry->pWidget = 0; if(g_iOptionWidgetInstances > 0) g_iOptionWidgetInstances--; - } KviOptionsWidget * OptionsInstanceManager::getInstance(OptionsWidgetInstanceEntry * pEntry, QWidget * pPar) @@ -3724,7 +3721,7 @@ KviOptionsWidget * OptionsInstanceManager::getInstance(OptionsWidgetInstanceEntr { pEntry->pWidget = pEntry->createProc(pPar); g_iOptionWidgetInstances++; - connect(pEntry->pWidget,SIGNAL(destroyed()),this,SLOT(widgetDestroyed())); + connect(pEntry->pWidget, SIGNAL(destroyed()), this, SLOT(widgetDestroyed())); } if(pEntry->pWidget->parent() != pPar) @@ -3759,14 +3756,14 @@ KviOptionsWidget * OptionsInstanceManager::getInstance(OptionsWidgetInstanceEntr iIdx++; pEntry3 = tmpList.next(); } - tmpList.insert(iIdx,pEntry2); + tmpList.insert(iIdx, pEntry2); } } for(OptionsWidgetInstanceEntry * pEntry4 = tmpList.last(); pEntry4; pEntry4 = tmpList.prev()) { - KviOptionsWidget * pOpt = getInstance(pEntry4,pEntry->pWidget->tabWidget()); - pEntry->pWidget->addOptionsWidget(pEntry4->szName,*(g_pIconManager->getSmallIcon(pEntry4->eIcon)),pOpt); + KviOptionsWidget * pOpt = getInstance(pEntry4, pEntry->pWidget->tabWidget()); + pEntry->pWidget->addOptionsWidget(pEntry4->szName, *(g_pIconManager->getSmallIcon(pEntry4->eIcon)), pOpt); } } } @@ -3783,7 +3780,7 @@ OptionsWidgetInstanceEntry * OptionsInstanceManager::findInstanceEntry(const QOb return pEntry; if(pEntry->pChildList) { - OptionsWidgetInstanceEntry * pEntry2 = findInstanceEntry(pObj,pEntry->pChildList); + OptionsWidgetInstanceEntry * pEntry2 = findInstanceEntry(pObj, pEntry->pChildList); if(pEntry2) return pEntry2; } @@ -3798,11 +3795,11 @@ OptionsWidgetInstanceEntry * OptionsInstanceManager::findInstanceEntry(const cha { for(OptionsWidgetInstanceEntry * pEntry = pList->first(); pEntry; pEntry = pList->next()) { - if(kvi_strEqualCI(pEntry->szClassName,pcName)) + if(kvi_strEqualCI(pEntry->szClassName, pcName)) return pEntry; if(pEntry->pChildList) { - OptionsWidgetInstanceEntry * pEntry2 = findInstanceEntry(pcName,pEntry->pChildList); + OptionsWidgetInstanceEntry * pEntry2 = findInstanceEntry(pcName, pEntry->pChildList); if(pEntry2) return pEntry2; } @@ -3813,5 +3810,5 @@ OptionsWidgetInstanceEntry * OptionsInstanceManager::findInstanceEntry(const cha OptionsWidgetInstanceEntry * OptionsInstanceManager::findInstanceEntry(const char * pcName) { - return findInstanceEntry(pcName,m_pInstanceTree); + return findInstanceEntry(pcName, m_pInstanceTree); } diff --git a/src/modules/options/OptionsInstanceManager.h b/src/modules/options/OptionsInstanceManager.h index 7b68c333b..6f52d928d 100644 --- a/src/modules/options/OptionsInstanceManager.h +++ b/src/modules/options/OptionsInstanceManager.h @@ -41,39 +41,40 @@ typedef struct _OptionsWidgetInstanceEntry OptionsWidgetInstanceEntry; - typedef struct _OptionsWidgetInstanceEntry { - KviOptionsWidget * (*createProc)(QWidget *); - KviOptionsWidget * pWidget; // singleton - KviIconManager::SmallIcon eIcon; - QString szName; - QString szNameNoLocale; - const char * szClassName; - int iPriority; - QString szKeywords; - QString szKeywordsNoLocale; - QString szGroup; - bool bIsContainer; - bool bIsNotContained; + KviOptionsWidget * (*createProc)(QWidget *); + KviOptionsWidget * pWidget; // singleton + KviIconManager::SmallIcon eIcon; + QString szName; + QString szNameNoLocale; + const char * szClassName; + int iPriority; + QString szKeywords; + QString szKeywordsNoLocale; + QString szGroup; + bool bIsContainer; + bool bIsNotContained; KviPointerList * pChildList; - bool bDoInsert; // a helper for OptionsDialog::fillListView() + bool bDoInsert; // a helper for OptionsDialog::fillListView() } OptionsWidgetInstanceEntry; - class OptionsInstanceManager : public QObject { Q_OBJECT public: OptionsInstanceManager(); virtual ~OptionsInstanceManager(); + protected: KviPointerList * m_pInstanceTree; + public: - KviPointerList * instanceEntryTree(){ return m_pInstanceTree; }; + KviPointerList * instanceEntryTree() { return m_pInstanceTree; }; KviOptionsWidget * getInstance(OptionsWidgetInstanceEntry * pEntry, QWidget * pPar); OptionsWidgetInstanceEntry * findInstanceEntry(const char * pcName); void cleanup(KviModule *); + protected: OptionsWidgetInstanceEntry * findInstanceEntry(const char * pcName, KviPointerList * pList); OptionsWidgetInstanceEntry * findInstanceEntry(const QObject * pObj, KviPointerList * pList); diff --git a/src/modules/options/OptionsWidgetContainer.cpp b/src/modules/options/OptionsWidgetContainer.cpp index 68cdd96bf..5b891fb8e 100644 --- a/src/modules/options/OptionsWidgetContainer.cpp +++ b/src/modules/options/OptionsWidgetContainer.cpp @@ -39,11 +39,10 @@ #include #include - extern OptionsInstanceManager * g_pOptionsInstanceManager; -OptionsWidgetContainer::OptionsWidgetContainer(QWidget * par,bool bModal) -: QDialog(par) +OptionsWidgetContainer::OptionsWidgetContainer(QWidget * par, bool bModal) + : QDialog(par) { m_pLayout = new QGridLayout(this); @@ -65,14 +64,14 @@ void OptionsWidgetContainer::setLeftCornerWidget(QWidget * pWidget) { if(!pWidget) return; - m_pLayout->addWidget(pWidget,1,0); + m_pLayout->addWidget(pWidget, 1, 0); } void OptionsWidgetContainer::setNextToLeft(QWidget * pWidget) { if(!pWidget) return; - m_pLayout->addWidget(pWidget,2,0); + m_pLayout->addWidget(pWidget, 2, 0); } void OptionsWidgetContainer::optionsWidgetDestroyed() @@ -89,7 +88,7 @@ void OptionsWidgetContainer::childEvent(QChildEvent * e) { if(e->child() == static_cast(m_pOptionsWidget)) { - QObject::disconnect(m_pOptionsWidget,SIGNAL(destroyed()),this,SLOT(optionsWidgetDestroyed())); + QObject::disconnect(m_pOptionsWidget, SIGNAL(destroyed()), this, SLOT(optionsWidgetDestroyed())); m_pOptionsWidget = NULL; } } @@ -100,28 +99,27 @@ void OptionsWidgetContainer::childEvent(QChildEvent * e) void OptionsWidgetContainer::setup(KviOptionsWidget * w) { if(m_pOptionsWidget) - QObject::disconnect(m_pOptionsWidget,SIGNAL(destroyed()),this,SLOT(optionsWidgetDestroyed())); + QObject::disconnect(m_pOptionsWidget, SIGNAL(destroyed()), this, SLOT(optionsWidgetDestroyed())); - m_pLayout->addWidget(w,0,0,1,3); + m_pLayout->addWidget(w, 0, 0, 1, 3); //g->addMultiCellWidget(w,0,0,0,2); - QPushButton * b = new QPushButton(__tr2qs_ctx("&OK","options"),this); - KviTalToolTip::add(b,__tr2qs_ctx("Close this dialog, accepting all changes.","options")); + QPushButton * b = new QPushButton(__tr2qs_ctx("&OK", "options"), this); + KviTalToolTip::add(b, __tr2qs_ctx("Close this dialog, accepting all changes.", "options")); //b->setMinimumWidth(m_pCancel->sizeHint().width()); - m_pLayout->addWidget(b,1,1); + m_pLayout->addWidget(b, 1, 1); b->setDefault(true); - connect(b,SIGNAL(clicked()),this,SLOT(okClicked())); + connect(b, SIGNAL(clicked()), this, SLOT(okClicked())); b->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Accept))); - m_pCancel = new QPushButton(__tr2qs_ctx("Cancel","options"),this); - KviTalToolTip::add(m_pCancel,__tr2qs_ctx("Close this dialog, discarding all changes.","options")); - m_pLayout->addWidget(m_pCancel,1,2); - connect(m_pCancel,SIGNAL(clicked()),this,SLOT(cancelClicked())); + m_pCancel = new QPushButton(__tr2qs_ctx("Cancel", "options"), this); + KviTalToolTip::add(m_pCancel, __tr2qs_ctx("Close this dialog, discarding all changes.", "options")); + m_pLayout->addWidget(m_pCancel, 1, 2); + connect(m_pCancel, SIGNAL(clicked()), this, SLOT(cancelClicked())); m_pCancel->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Discard))); - - m_pLayout->setRowStretch(0,1); - m_pLayout->setColumnStretch(0,1); + m_pLayout->setRowStretch(0, 1); + m_pLayout->setColumnStretch(0, 1); OptionsWidgetInstanceEntry * e = g_pOptionsInstanceManager->findInstanceEntry(w->metaObject()->className()); if(e) @@ -133,21 +131,21 @@ void OptionsWidgetContainer::setup(KviOptionsWidget * w) m_pOptionsWidget = w; if(m_pOptionsWidget) - QObject::connect(m_pOptionsWidget,SIGNAL(destroyed()),this,SLOT(optionsWidgetDestroyed())); + QObject::connect(m_pOptionsWidget, SIGNAL(destroyed()), this, SLOT(optionsWidgetDestroyed())); } -void OptionsWidgetContainer::closeEvent(QCloseEvent *e) +void OptionsWidgetContainer::closeEvent(QCloseEvent * e) { e->ignore(); cancelClicked(); } -void OptionsWidgetContainer::showEvent(QShowEvent *e) +void OptionsWidgetContainer::showEvent(QShowEvent * e) { if(!parent()) { QRect rect = g_pApp->desktop()->screenGeometry(g_pMainWindow); - move(rect.x() + ((rect.width() - width())/2),rect.y() + ((rect.height() - height())/2)); + move(rect.x() + ((rect.width() - width()) / 2), rect.y() + ((rect.height() - height()) / 2)); } QWidget::showEvent(e); diff --git a/src/modules/options/OptionsWidgetContainer.h b/src/modules/options/OptionsWidgetContainer.h index d733a9b23..5f26c2f5d 100644 --- a/src/modules/options/OptionsWidgetContainer.h +++ b/src/modules/options/OptionsWidgetContainer.h @@ -35,19 +35,22 @@ class OptionsWidgetContainer : public QDialog { Q_OBJECT public: - OptionsWidgetContainer(QWidget * par,bool bModal = false); + OptionsWidgetContainer(QWidget * par, bool bModal = false); ~OptionsWidgetContainer(); + protected: KviOptionsWidget * m_pOptionsWidget; - QPushButton * m_pCancel; - QGridLayout * m_pLayout; + QPushButton * m_pCancel; + QGridLayout * m_pLayout; + public: void setup(KviOptionsWidget * w); void setLeftCornerWidget(QWidget * pWidget); void setNextToLeft(QWidget * pWidget); + protected: - virtual void closeEvent(QCloseEvent *e); - virtual void showEvent(QShowEvent *e); + virtual void closeEvent(QCloseEvent * e); + virtual void showEvent(QShowEvent * e); virtual void childEvent(QChildEvent * e); virtual void reject(); protected slots: diff --git a/src/modules/options/OptionsWidget_alertsAndHighlighting.cpp b/src/modules/options/OptionsWidget_alertsAndHighlighting.cpp index 0c03bf209..2d69b9c71 100644 --- a/src/modules/options/OptionsWidget_alertsAndHighlighting.cpp +++ b/src/modules/options/OptionsWidget_alertsAndHighlighting.cpp @@ -35,7 +35,7 @@ #include "KviTalToolTip.h" OptionsWidget_alertsAndHighlighting::OptionsWidget_alertsAndHighlighting(QWidget * parent) -: KviOptionsWidget(parent) + : KviOptionsWidget(parent) { setObjectName("highlighting_options_widget"); } @@ -44,58 +44,57 @@ OptionsWidget_alertsAndHighlighting::~OptionsWidget_alertsAndHighlighting() { } - OptionsWidget_highlighting::OptionsWidget_highlighting(QWidget * parent) -: KviOptionsWidget(parent) + : KviOptionsWidget(parent) { setObjectName("highlighting_options_widget"); createLayout(); - KviBoolSelector * b = addBoolSelector(0,0,0,0,__tr2qs_ctx("Enable word highlighting","options"),KviOption_boolUseWordHighlighting); - KviStringListSelector * sl = addStringListSelector(0,1,0,1,__tr2qs_ctx("Words to Highlight","options"),KviOption_stringlistHighlightWords,KVI_OPTION_BOOL(KviOption_boolUseWordHighlighting)); + KviBoolSelector * b = addBoolSelector(0, 0, 0, 0, __tr2qs_ctx("Enable word highlighting", "options"), KviOption_boolUseWordHighlighting); + KviStringListSelector * sl = addStringListSelector(0, 1, 0, 1, __tr2qs_ctx("Words to Highlight", "options"), KviOption_stringlistHighlightWords, KVI_OPTION_BOOL(KviOption_boolUseWordHighlighting)); - connect(b,SIGNAL(toggled(bool)),sl,SLOT(setEnabled(bool))); + connect(b, SIGNAL(toggled(bool)), sl, SLOT(setEnabled(bool))); // This can be used even without Word highlighting - b = addBoolSelector(0,2,0,2,__tr2qs_ctx("Highlight messages containing my nickname","options"),KviOption_boolAlwaysHighlightNick); - mergeTip(b,__tr2qs_ctx("If this option is enabled, KVIrc will highlight any user message containing your current nickname","options")); + b = addBoolSelector(0, 2, 0, 2, __tr2qs_ctx("Highlight messages containing my nickname", "options"), KviOption_boolAlwaysHighlightNick); + mergeTip(b, __tr2qs_ctx("If this option is enabled, KVIrc will highlight any user message containing your current nickname", "options")); - b = addBoolSelector(0,3,0,3,__tr2qs_ctx("Words/Nick matching is case sensitive ","options"),KviOption_boolCaseSensitiveHighlighting); - mergeTip(b,__tr2qs_ctx("If this option is enabled, KVIrc will match your nick and/or the words you specified in a case sensitive manner","options")); + b = addBoolSelector(0, 3, 0, 3, __tr2qs_ctx("Words/Nick matching is case sensitive ", "options"), KviOption_boolCaseSensitiveHighlighting); + mergeTip(b, __tr2qs_ctx("If this option is enabled, KVIrc will match your nick and/or the words you specified in a case sensitive manner", "options")); - KviTalGroupBox * gbox = addGroupBox(0,4,0,4,Qt::Horizontal,__tr2qs_ctx("Highlighting Method","options")); + KviTalGroupBox * gbox = addGroupBox(0, 4, 0, 4, Qt::Horizontal, __tr2qs_ctx("Highlighting Method", "options")); // note: KviTalGroupBox automatically deletes its previous layout on setLayout() // note2: every QWidget will take ownership of its layout. QGridLayout * g = new QGridLayout(); gbox->setLayout(g); - m_pHighlightAllOccurencesRadioButton = new QRadioButton(__tr2qs_ctx("Highlight every occurrence of a word inside text","options"),gbox); - g->addWidget(m_pHighlightAllOccurencesRadioButton,0,0,1,2); + m_pHighlightAllOccurencesRadioButton = new QRadioButton(__tr2qs_ctx("Highlight every occurrence of a word inside text", "options"), gbox); + g->addWidget(m_pHighlightAllOccurencesRadioButton, 0, 0, 1, 2); m_pHighlightAllOccurencesRadioButton->setChecked(KVI_OPTION_BOOL(KviOption_boolUseFullWordHighlighting)); - KviTalToolTip::add(m_pHighlightAllOccurencesRadioButton,__tr2qs_ctx("This selection will cause KVIrc to search for the highlighted words or nicknames inside the whole text. This will also highlight parts of words (e.g. if your nickname is Mark then Markus will be highlighted too).","options")); + KviTalToolTip::add(m_pHighlightAllOccurencesRadioButton, __tr2qs_ctx("This selection will cause KVIrc to search for the highlighted words or nicknames inside the whole text. This will also highlight parts of words (e.g. if your nickname is Mark then Markus will be highlighted too).", "options")); - m_pHighlightWholeWordsOnlyRadioButton = new QRadioButton(__tr2qs_ctx("Highlight only whole words splitting on space and on:","options"),gbox); - g->addWidget(m_pHighlightWholeWordsOnlyRadioButton,1,0,1,1); + m_pHighlightWholeWordsOnlyRadioButton = new QRadioButton(__tr2qs_ctx("Highlight only whole words splitting on space and on:", "options"), gbox); + g->addWidget(m_pHighlightWholeWordsOnlyRadioButton, 1, 0, 1, 1); m_pHighlightWholeWordsOnlyRadioButton->setChecked(!KVI_OPTION_BOOL(KviOption_boolUseFullWordHighlighting)); - KviTalToolTip::add(m_pHighlightWholeWordsOnlyRadioButton,__tr2qs_ctx("This selection will first split the string on the specified boundaries (including space) and then will compare all the parts with the highlighted words.","options")); + KviTalToolTip::add(m_pHighlightWholeWordsOnlyRadioButton, __tr2qs_ctx("This selection will first split the string on the specified boundaries (including space) and then will compare all the parts with the highlighted words.", "options")); m_pWordSplitterCharactersEdit = new QLineEdit(gbox); m_pWordSplitterCharactersEdit->setText(KVI_OPTION_STRING(KviOption_stringWordSplitters)); m_pWordSplitterCharactersEdit->setEnabled(!KVI_OPTION_BOOL(KviOption_boolUseFullWordHighlighting)); - g->addWidget(m_pWordSplitterCharactersEdit,1,1,1,1); + g->addWidget(m_pWordSplitterCharactersEdit, 1, 1, 1, 1); - connect(m_pHighlightWholeWordsOnlyRadioButton,SIGNAL(toggled(bool)),m_pWordSplitterCharactersEdit,SLOT(setEnabled(bool))); + connect(m_pHighlightWholeWordsOnlyRadioButton, SIGNAL(toggled(bool)), m_pWordSplitterCharactersEdit, SLOT(setEnabled(bool))); - gbox = addGroupBox(0,5,0,5,Qt::Horizontal,__tr2qs_ctx("Alert Options","options")); + gbox = addGroupBox(0, 5, 0, 5, Qt::Horizontal, __tr2qs_ctx("Alert Options", "options")); - b = addBoolSelector(gbox,__tr2qs_ctx("Flash the system taskbar entry on highlighted messages","options"),KviOption_boolFlashWindowOnHighlightedMessages); - mergeTip(b,__tr2qs_ctx("If this option is enabled, KVIrc will (attempt to) flash the system taskbar entry when a highlighted message is printed and KVIrc is not the active window","options")); - b = addBoolSelector(gbox,__tr2qs_ctx("Popup the notifier window on highlighted messages","options"),KviOption_boolPopupNotifierOnHighlightedMessages); - mergeTip(b,__tr2qs_ctx("If this option is enabled, KVIrc will popup a little notifier window in the low right corner of your desktop when a highlighted message is printed and KVIrc is not the active window","options")); + b = addBoolSelector(gbox, __tr2qs_ctx("Flash the system taskbar entry on highlighted messages", "options"), KviOption_boolFlashWindowOnHighlightedMessages); + mergeTip(b, __tr2qs_ctx("If this option is enabled, KVIrc will (attempt to) flash the system taskbar entry when a highlighted message is printed and KVIrc is not the active window", "options")); + b = addBoolSelector(gbox, __tr2qs_ctx("Popup the notifier window on highlighted messages", "options"), KviOption_boolPopupNotifierOnHighlightedMessages); + mergeTip(b, __tr2qs_ctx("If this option is enabled, KVIrc will popup a little notifier window in the low right corner of your desktop when a highlighted message is printed and KVIrc is not the active window", "options")); - addRowSpacer(0,6,0,6); + addRowSpacer(0, 6, 0, 6); } OptionsWidget_highlighting::~OptionsWidget_highlighting() @@ -110,42 +109,38 @@ void OptionsWidget_highlighting::commit() KviOptionsWidget::commit(); } - - OptionsWidget_alerts::OptionsWidget_alerts(QWidget * parent) -: KviOptionsWidget(parent) + : KviOptionsWidget(parent) { setObjectName("highlighting_options_widget"); createLayout(); - KviTalGroupBox * g = addGroupBox(0,0,0,0,Qt::Horizontal,__tr2qs_ctx("Alert Restrictions","options")); - KviBoolSelector * b3 = addBoolSelector(g,__tr2qs_ctx("Restrict alert","options"),KviOption_boolHighlightOnlyNormalMsg); - mergeTip(b3, __tr2qs_ctx("If this option is enabled, KVIrc will alert in the window list only if a normal message is received in a channel.
Actions like joins, parts and mode changes will be ignored.
This is useful if you are in channels with a high rate of traffic and only want to be alerted for messages that are interesting to you.","options")); + KviTalGroupBox * g = addGroupBox(0, 0, 0, 0, Qt::Horizontal, __tr2qs_ctx("Alert Restrictions", "options")); + KviBoolSelector * b3 = addBoolSelector(g, __tr2qs_ctx("Restrict alert", "options"), KviOption_boolHighlightOnlyNormalMsg); + mergeTip(b3, __tr2qs_ctx("If this option is enabled, KVIrc will alert in the window list only if a normal message is received in a channel.
Actions like joins, parts and mode changes will be ignored.
This is useful if you are in channels with a high rate of traffic and only want to be alerted for messages that are interesting to you.", "options")); - KviBoolSelector * b4 = addBoolSelector(g,__tr2qs_ctx("Alert for highlighted words","options"),KviOption_boolHighlightOnlyNormalMsgHighlightInChanToo,KVI_OPTION_BOOL(KviOption_boolHighlightOnlyNormalMsg)); - mergeTip(b4, __tr2qs_ctx("If this option is enabled, the window list will also alert for messages which contain a word from the highlighted words list above.","options")); + KviBoolSelector * b4 = addBoolSelector(g, __tr2qs_ctx("Alert for highlighted words", "options"), KviOption_boolHighlightOnlyNormalMsgHighlightInChanToo, KVI_OPTION_BOOL(KviOption_boolHighlightOnlyNormalMsg)); + mergeTip(b4, __tr2qs_ctx("If this option is enabled, the window list will also alert for messages which contain a word from the highlighted words list above.", "options")); - KviBoolSelector * b5 = addBoolSelector(g,__tr2qs_ctx("Alert for query messages","options"),KviOption_boolHighlightOnlyNormalMsgQueryToo,KVI_OPTION_BOOL(KviOption_boolHighlightOnlyNormalMsg)); - mergeTip(b5, __tr2qs_ctx("If this option is enabled, the window list will also alert for messages which are shown in queries.","options")); - connect(b3,SIGNAL(toggled(bool)),b4,SLOT(setEnabled(bool))); - connect(b3,SIGNAL(toggled(bool)),b5,SLOT(setEnabled(bool))); + KviBoolSelector * b5 = addBoolSelector(g, __tr2qs_ctx("Alert for query messages", "options"), KviOption_boolHighlightOnlyNormalMsgQueryToo, KVI_OPTION_BOOL(KviOption_boolHighlightOnlyNormalMsg)); + mergeTip(b5, __tr2qs_ctx("If this option is enabled, the window list will also alert for messages which are shown in queries.", "options")); + connect(b3, SIGNAL(toggled(bool)), b4, SLOT(setEnabled(bool))); + connect(b3, SIGNAL(toggled(bool)), b5, SLOT(setEnabled(bool))); - KviBoolSelector * b6 = addBoolSelector(g,__tr2qs_ctx("Use custom alert level","options"),KviOption_boolHighlightOnlyAtCostumHighlightLevel); - mergeTip(b6, __tr2qs_ctx("If this option is enabled, KVIrc will alert in the window list only if the specified alert level is reached.","options")); + KviBoolSelector * b6 = addBoolSelector(g, __tr2qs_ctx("Use custom alert level", "options"), KviOption_boolHighlightOnlyAtCostumHighlightLevel); + mergeTip(b6, __tr2qs_ctx("If this option is enabled, KVIrc will alert in the window list only if the specified alert level is reached.", "options")); - KviUIntSelector * b7 = addUIntSelector(g,__tr2qs_ctx("Minimum alert level:","options"),KviOption_uintMinHighlightLevel,1,KVI_MSGTYPE_MAXLEVEL,KVI_MSGTYPE_MAXLEVEL,KVI_OPTION_BOOL(KviOption_boolHighlightOnlyAtCostumHighlightLevel)); + KviUIntSelector * b7 = addUIntSelector(g, __tr2qs_ctx("Minimum alert level:", "options"), KviOption_uintMinHighlightLevel, 1, KVI_MSGTYPE_MAXLEVEL, KVI_MSGTYPE_MAXLEVEL, KVI_OPTION_BOOL(KviOption_boolHighlightOnlyAtCostumHighlightLevel)); b7->setEnabled(KVI_OPTION_BOOL(KviOption_boolHighlightOnlyAtCostumHighlightLevel)); - mergeTip(b7, __tr2qs_ctx("This option sets the minimum alert level for the window list.","options")); - connect(b6,SIGNAL(toggled(bool)),b7,SLOT(setEnabled(bool))); + mergeTip(b7, __tr2qs_ctx("This option sets the minimum alert level for the window list.", "options")); + connect(b6, SIGNAL(toggled(bool)), b7, SLOT(setEnabled(bool))); - addRowSpacer(0,1,0,1); + addRowSpacer(0, 1, 0, 1); } OptionsWidget_alerts::~OptionsWidget_alerts() { } - - #endif //_OPTW_HIGHLIGHTING_CPP_ diff --git a/src/modules/options/OptionsWidget_alertsAndHighlighting.h b/src/modules/options/OptionsWidget_alertsAndHighlighting.h index c7e45a724..12b581acc 100644 --- a/src/modules/options/OptionsWidget_alertsAndHighlighting.h +++ b/src/modules/options/OptionsWidget_alertsAndHighlighting.h @@ -42,7 +42,6 @@ public: ~OptionsWidget_alertsAndHighlighting(); }; - #define KVI_OPTIONS_WIDGET_ICON_OptionsWidget_highlighting KviIconManager::QueryTrace #define KVI_OPTIONS_WIDGET_NAME_OptionsWidget_highlighting __tr2qs_no_lookup("Highlight") #define KVI_OPTIONS_WIDGET_PARENT_OptionsWidget_highlighting OptionsWidget_alertsAndHighlighting @@ -53,6 +52,7 @@ class OptionsWidget_highlighting : public KviOptionsWidget public: OptionsWidget_highlighting(QWidget * parent); ~OptionsWidget_highlighting(); + private: QRadioButton * m_pHighlightAllOccurencesRadioButton; QRadioButton * m_pHighlightWholeWordsOnlyRadioButton; @@ -60,10 +60,8 @@ private: protected: virtual void commit(); - }; - #define KVI_OPTIONS_WIDGET_ICON_OptionsWidget_alerts KviIconManager::Warning #define KVI_OPTIONS_WIDGET_NAME_OptionsWidget_alerts __tr2qs_no_lookup("Window List Alert") #define KVI_OPTIONS_WIDGET_PARENT_OptionsWidget_alerts OptionsWidget_alertsAndHighlighting @@ -76,5 +74,4 @@ public: ~OptionsWidget_alerts(); }; - #endif //_OPTW_HIGHLIGHTING_H_ diff --git a/src/modules/options/OptionsWidget_antiSpam.cpp b/src/modules/options/OptionsWidget_antiSpam.cpp index 57decd756..8ce261fe4 100644 --- a/src/modules/options/OptionsWidget_antiSpam.cpp +++ b/src/modules/options/OptionsWidget_antiSpam.cpp @@ -31,23 +31,23 @@ #include OptionsWidget_antispam::OptionsWidget_antispam(QWidget * parent) -: KviOptionsWidget(parent) + : KviOptionsWidget(parent) { setObjectName("antispam_options_widget"); createLayout(); - KviTalGroupBox *g = addGroupBox(0,0,0,0,Qt::Horizontal,__tr2qs_ctx("Enable Anti-spam for","options")); - m_b1 = addBoolSelector(g,__tr2qs_ctx("Private messages","options"),KviOption_boolUseAntiSpamOnPrivmsg); - connect(m_b1,SIGNAL(toggled(bool)),this,SLOT(reenableStuff(bool))); - m_b2 = addBoolSelector(g,__tr2qs_ctx("Private notices","options"),KviOption_boolUseAntiSpamOnNotice); - connect(m_b2,SIGNAL(toggled(bool)),this,SLOT(reenableStuff(bool))); + KviTalGroupBox * g = addGroupBox(0, 0, 0, 0, Qt::Horizontal, __tr2qs_ctx("Enable Anti-spam for", "options")); + m_b1 = addBoolSelector(g, __tr2qs_ctx("Private messages", "options"), KviOption_boolUseAntiSpamOnPrivmsg); + connect(m_b1, SIGNAL(toggled(bool)), this, SLOT(reenableStuff(bool))); + m_b2 = addBoolSelector(g, __tr2qs_ctx("Private notices", "options"), KviOption_boolUseAntiSpamOnNotice); + connect(m_b2, SIGNAL(toggled(bool)), this, SLOT(reenableStuff(bool))); - m_b3 = addBoolSelector(0,1,0,1,__tr2qs_ctx("Silent anti-spam (no warnings)","options"),KviOption_boolSilentAntiSpam); - m_sl = addStringListSelector(0,2,0,2,__tr2qs_ctx("Words considered spam:","options"),KviOption_stringlistSpamWords); + m_b3 = addBoolSelector(0, 1, 0, 1, __tr2qs_ctx("Silent anti-spam (no warnings)", "options"), KviOption_boolSilentAntiSpam); + m_sl = addStringListSelector(0, 2, 0, 2, __tr2qs_ctx("Words considered spam:", "options"), KviOption_stringlistSpamWords); reenableStuff(true); - layout()->setRowStretch(2,1); + layout()->setRowStretch(2, 1); } OptionsWidget_antispam::~OptionsWidget_antispam() diff --git a/src/modules/options/OptionsWidget_antiSpam.h b/src/modules/options/OptionsWidget_antiSpam.h index 51a65c695..04817690a 100644 --- a/src/modules/options/OptionsWidget_antiSpam.h +++ b/src/modules/options/OptionsWidget_antiSpam.h @@ -36,6 +36,7 @@ class OptionsWidget_antispam : public KviOptionsWidget public: OptionsWidget_antispam(QWidget * parent); ~OptionsWidget_antispam(); + protected: KviBoolSelector * m_b1; KviBoolSelector * m_b2; @@ -45,5 +46,4 @@ protected slots: void reenableStuff(bool); }; - #endif //_OPTW_ANTISPAM_H_ diff --git a/src/modules/options/OptionsWidget_avatar.cpp b/src/modules/options/OptionsWidget_avatar.cpp index c3865c72a..3766e6498 100644 --- a/src/modules/options/OptionsWidget_avatar.cpp +++ b/src/modules/options/OptionsWidget_avatar.cpp @@ -29,9 +29,8 @@ #include "KviOptions.h" #include "KviTalToolTip.h" - OptionsWidget_avatar::OptionsWidget_avatar(QWidget * parent) -: KviOptionsWidget(parent) + : KviOptionsWidget(parent) { setObjectName("avatar_advanced_options_widget"); createLayout(); @@ -39,72 +38,79 @@ OptionsWidget_avatar::OptionsWidget_avatar(QWidget * parent) KviTalGroupBox * g; KviBoolSelector * b; - g = addGroupBox(0,0,0,0,Qt::Horizontal,__tr2qs_ctx("Scaling in Userlist","options")); - b = addBoolSelector(g,__tr2qs_ctx("Scale avatar images in userlist (recommended)","options"),KviOption_boolScaleAvatars); - mergeTip(b,__tr2qs_ctx("This option will force KVIrc to scale avatars" \ - " shown in the userlist.
" \ - "Avatars will be scaled to fit the " \ - "constraints set below. Better keep this option on.","options")); - - addBoolSelector(g,__tr2qs_ctx("Do not scale avatar if it is less than required size","options"),KviOption_boolDoNotUpscaleAvatars); - - KviUIntSelector *u = addUIntSelector(g,__tr2qs_ctx("Image width:","options"),KviOption_uintAvatarScaleWidth,0,512,80,KVI_OPTION_BOOL(KviOption_boolScaleAvatars)); - u->setSuffix(__tr2qs_ctx(" pixels","options")); - connect(b,SIGNAL(toggled(bool)),u,SLOT(setEnabled(bool))); - u = addUIntSelector(g,__tr2qs_ctx("Image height:","options"),KviOption_uintAvatarScaleHeight,0,512,80,KVI_OPTION_BOOL(KviOption_boolScaleAvatars)); - u->setSuffix(__tr2qs_ctx(" pixels","options")); - connect(b,SIGNAL(toggled(bool)),u,SLOT(setEnabled(bool))); - - g = addGroupBox(0,1,0,1,Qt::Horizontal,__tr2qs_ctx("Scaling on Load and in User Tooltips","options")); - b = addBoolSelector(g,__tr2qs_ctx("Scale avatar images on image load","options"),KviOption_boolScaleAvatarsOnLoad); - - u = addUIntSelector(g,__tr2qs_ctx("Image width:","options"),KviOption_uintScaleAvatarsOnLoadWidth,0,1280,80,KVI_OPTION_BOOL(KviOption_boolScaleAvatarsOnLoad)); - u->setSuffix(__tr2qs_ctx(" pixels","options")); - connect(b,SIGNAL(toggled(bool)),u,SLOT(setEnabled(bool))); - u = addUIntSelector(g,__tr2qs_ctx("Image height:","options"),KviOption_uintScaleAvatarsOnLoadHeight,0,1280,80,KVI_OPTION_BOOL(KviOption_boolScaleAvatarsOnLoad)); - u->setSuffix(__tr2qs_ctx(" pixels","options")); - connect(b,SIGNAL(toggled(bool)),u,SLOT(setEnabled(bool))); - - KviTalGroupBox *gs = addGroupBox(0,2,0,2,Qt::Horizontal,__tr2qs_ctx("Request CTCP","options")); - KviBoolSelector * bs = addBoolSelector(g,__tr2qs_ctx("Request missing avatars","options"),KviOption_boolRequestMissingAvatars); - mergeTip(bs,__tr2qs_ctx("This option will cause KVIrc to send a DCC GET request " \ - "when someone sets an avatar and there is no cached copy available.","options")); - - KviUIntSelector * us = addUIntSelector(g,__tr2qs_ctx("Maximum requested file size:","options"),KviOption_uintMaximumRequestedAvatarSize,0,1048576,102400, - KVI_OPTION_BOOL(KviOption_boolRequestMissingAvatars)); - us->setSuffix(__tr2qs_ctx(" bytes","options")); - mergeTip(us,__tr2qs_ctx("This is the maximum size for avatar images that " \ - "will be automatically requested.
" \ - "A reasonable value might be 102400 bytes (100 K).","options")); - - connect(bs,SIGNAL(toggled(bool)),us,SLOT(setEnabled(bool))); - - bs = addBoolSelector(gs,__tr2qs_ctx("Automatically accept incoming avatars","options"),KviOption_boolAutoAcceptIncomingAvatars); - mergeTip(bs,__tr2qs_ctx("This option will cause KVIrc to auto-accept " \ - "DCC SEND requests for incoming avatars.
" \ - "If you're using the \"Request missing avatars\" option " \ - "above, enabling this may by useful.
" \ - "Avatars will be saved in the local KVIrc directory.","options")); - - bs = addBoolSelector(gs,__tr2qs_ctx("Remember avatars for registered users","options"),KviOption_boolSetLastAvatarAsDefaultForRegisteredUsers); - mergeTip(bs,__tr2qs_ctx("Use a user's last known avatar by default " \ - "(only for users that are registered).","options")); - - us = addUIntSelector(gs,__tr2qs_ctx("Avatar offer timeout:","options"),KviOption_uintAvatarOfferTimeoutInSecs,1,99999,60); - us->setSuffix(__tr2qs_ctx(" sec","options")); - mergeTip(us,__tr2qs_ctx("This is the amount of time to make an avatar available for transfer when requested.
" \ - "When someone sends a CTCP AVATAR request, " \ - "KVIrc will reply with a CTCP AVATAR message containing the name and size " \ - "of your avatar image.
" \ - "A time-limited file offer is added for the image file " \ - "to the requesting user.","options")); - - bs = addBoolSelector(gs,__tr2qs_ctx("Ignore requests if no avatar is set","options"),KviOption_boolIgnoreChannelAvatarRequestsWhenNoAvatarSet); - mergeTip(bs,__tr2qs_ctx("This option will cause KVIrc to ignore channel CTCP AVATAR requests " \ - "when you have no avatar set. This is usually a good practice since " \ - "it helps in reducing traffic by not sending a reply that would be empty.","options")); - - addRowSpacer(0,3,0,3); + g = addGroupBox(0, 0, 0, 0, Qt::Horizontal, __tr2qs_ctx("Scaling in Userlist", "options")); + b = addBoolSelector(g, __tr2qs_ctx("Scale avatar images in userlist (recommended)", "options"), KviOption_boolScaleAvatars); + mergeTip(b, __tr2qs_ctx("This option will force KVIrc to scale avatars" + " shown in the userlist.
" + "Avatars will be scaled to fit the " + "constraints set below. Better keep this option on.", + "options")); + + addBoolSelector(g, __tr2qs_ctx("Do not scale avatar if it is less than required size", "options"), KviOption_boolDoNotUpscaleAvatars); + + KviUIntSelector * u = addUIntSelector(g, __tr2qs_ctx("Image width:", "options"), KviOption_uintAvatarScaleWidth, 0, 512, 80, KVI_OPTION_BOOL(KviOption_boolScaleAvatars)); + u->setSuffix(__tr2qs_ctx(" pixels", "options")); + connect(b, SIGNAL(toggled(bool)), u, SLOT(setEnabled(bool))); + u = addUIntSelector(g, __tr2qs_ctx("Image height:", "options"), KviOption_uintAvatarScaleHeight, 0, 512, 80, KVI_OPTION_BOOL(KviOption_boolScaleAvatars)); + u->setSuffix(__tr2qs_ctx(" pixels", "options")); + connect(b, SIGNAL(toggled(bool)), u, SLOT(setEnabled(bool))); + + g = addGroupBox(0, 1, 0, 1, Qt::Horizontal, __tr2qs_ctx("Scaling on Load and in User Tooltips", "options")); + b = addBoolSelector(g, __tr2qs_ctx("Scale avatar images on image load", "options"), KviOption_boolScaleAvatarsOnLoad); + + u = addUIntSelector(g, __tr2qs_ctx("Image width:", "options"), KviOption_uintScaleAvatarsOnLoadWidth, 0, 1280, 80, KVI_OPTION_BOOL(KviOption_boolScaleAvatarsOnLoad)); + u->setSuffix(__tr2qs_ctx(" pixels", "options")); + connect(b, SIGNAL(toggled(bool)), u, SLOT(setEnabled(bool))); + u = addUIntSelector(g, __tr2qs_ctx("Image height:", "options"), KviOption_uintScaleAvatarsOnLoadHeight, 0, 1280, 80, KVI_OPTION_BOOL(KviOption_boolScaleAvatarsOnLoad)); + u->setSuffix(__tr2qs_ctx(" pixels", "options")); + connect(b, SIGNAL(toggled(bool)), u, SLOT(setEnabled(bool))); + + KviTalGroupBox * gs = addGroupBox(0, 2, 0, 2, Qt::Horizontal, __tr2qs_ctx("Request CTCP", "options")); + KviBoolSelector * bs = addBoolSelector(g, __tr2qs_ctx("Request missing avatars", "options"), KviOption_boolRequestMissingAvatars); + mergeTip(bs, __tr2qs_ctx("This option will cause KVIrc to send a DCC GET request " + "when someone sets an avatar and there is no cached copy available.", + "options")); + + KviUIntSelector * us = addUIntSelector(g, __tr2qs_ctx("Maximum requested file size:", "options"), KviOption_uintMaximumRequestedAvatarSize, 0, 1048576, 102400, + KVI_OPTION_BOOL(KviOption_boolRequestMissingAvatars)); + us->setSuffix(__tr2qs_ctx(" bytes", "options")); + mergeTip(us, __tr2qs_ctx("This is the maximum size for avatar images that " + "will be automatically requested.
" + "A reasonable value might be 102400 bytes (100 K).", + "options")); + + connect(bs, SIGNAL(toggled(bool)), us, SLOT(setEnabled(bool))); + + bs = addBoolSelector(gs, __tr2qs_ctx("Automatically accept incoming avatars", "options"), KviOption_boolAutoAcceptIncomingAvatars); + mergeTip(bs, __tr2qs_ctx("This option will cause KVIrc to auto-accept " + "DCC SEND requests for incoming avatars.
" + "If you're using the \"Request missing avatars\" option " + "above, enabling this may by useful.
" + "Avatars will be saved in the local KVIrc directory.", + "options")); + + bs = addBoolSelector(gs, __tr2qs_ctx("Remember avatars for registered users", "options"), KviOption_boolSetLastAvatarAsDefaultForRegisteredUsers); + mergeTip(bs, __tr2qs_ctx("Use a user's last known avatar by default " + "(only for users that are registered).", + "options")); + + us = addUIntSelector(gs, __tr2qs_ctx("Avatar offer timeout:", "options"), KviOption_uintAvatarOfferTimeoutInSecs, 1, 99999, 60); + us->setSuffix(__tr2qs_ctx(" sec", "options")); + mergeTip(us, __tr2qs_ctx("This is the amount of time to make an avatar available for transfer when requested.
" + "When someone sends a CTCP AVATAR request, " + "KVIrc will reply with a CTCP AVATAR message containing the name and size " + "of your avatar image.
" + "A time-limited file offer is added for the image file " + "to the requesting user.", + "options")); + + bs = addBoolSelector(gs, __tr2qs_ctx("Ignore requests if no avatar is set", "options"), KviOption_boolIgnoreChannelAvatarRequestsWhenNoAvatarSet); + mergeTip(bs, __tr2qs_ctx("This option will cause KVIrc to ignore channel CTCP AVATAR requests " + "when you have no avatar set. This is usually a good practice since " + "it helps in reducing traffic by not sending a reply that would be empty.", + "options")); + + addRowSpacer(0, 3, 0, 3); } OptionsWidget_avatar::~OptionsWidget_avatar() diff --git a/src/modules/options/OptionsWidget_avatar.h b/src/modules/options/OptionsWidget_avatar.h index a5360a366..e0fabffca 100644 --- a/src/modules/options/OptionsWidget_avatar.h +++ b/src/modules/options/OptionsWidget_avatar.h @@ -27,7 +27,6 @@ #include "KviOptionsWidget.h" - #define KVI_OPTIONS_WIDGET_ICON_OptionsWidget_avatar KviIconManager::Avatar #define KVI_OPTIONS_WIDGET_NAME_OptionsWidget_avatar __tr2qs_no_lookup("Avatars") #define KVI_OPTIONS_WIDGET_PARENT_OptionsWidget_avatar OptionsWidget_tools diff --git a/src/modules/options/OptionsWidget_away.cpp b/src/modules/options/OptionsWidget_away.cpp index 3f9cc9b67..8f1879d12 100644 --- a/src/modules/options/OptionsWidget_away.cpp +++ b/src/modules/options/OptionsWidget_away.cpp @@ -30,29 +30,29 @@ #include OptionsWidget_away::OptionsWidget_away(QWidget * parent) -: KviOptionsWidget(parent) + : KviOptionsWidget(parent) { setObjectName("away_options_widget"); createLayout(); - m_pEnableAwayMessage = addBoolSelector(0,0,0,0, __tr2qs_ctx("Enable default away message","options"), KviOption_boolUseAwayMessage); - connect(m_pEnableAwayMessage,SIGNAL(toggled(bool)),this,SLOT(enableAwayMessage(bool))); - m_pAwayMessage = addStringSelector(0,1,0,1, __tr2qs_ctx("Default away message:","options"), KviOption_stringAwayMessage, KVI_OPTION_BOOL(KviOption_boolUseAwayMessage)); + m_pEnableAwayMessage = addBoolSelector(0, 0, 0, 0, __tr2qs_ctx("Enable default away message", "options"), KviOption_boolUseAwayMessage); + connect(m_pEnableAwayMessage, SIGNAL(toggled(bool)), this, SLOT(enableAwayMessage(bool))); + m_pAwayMessage = addStringSelector(0, 1, 0, 1, __tr2qs_ctx("Default away message:", "options"), KviOption_stringAwayMessage, KVI_OPTION_BOOL(KviOption_boolUseAwayMessage)); - addBoolSelector(0,2,0,2, __tr2qs_ctx("User input exits away mode","options"), KviOption_boolExitAwayOnInput); + addBoolSelector(0, 2, 0, 2, __tr2qs_ctx("User input exits away mode", "options"), KviOption_boolExitAwayOnInput); - KviTalGroupBox *g = addGroupBox(0,3,0,3,Qt::Horizontal,__tr2qs_ctx("Away Nickname","options")); - m_pEnableAwayNick = addBoolSelector(g,__tr2qs_ctx("Change nickname on away","options"),KviOption_boolChangeNickAway); - connect(m_pEnableAwayNick,SIGNAL(toggled(bool)),this,SLOT(enableCustomAwayText(bool))); + KviTalGroupBox * g = addGroupBox(0, 3, 0, 3, Qt::Horizontal, __tr2qs_ctx("Away Nickname", "options")); + m_pEnableAwayNick = addBoolSelector(g, __tr2qs_ctx("Change nickname on away", "options"), KviOption_boolChangeNickAway); + connect(m_pEnableAwayNick, SIGNAL(toggled(bool)), this, SLOT(enableCustomAwayText(bool))); - m_pEnableCustomAwayNick = addBoolSelector(g,__tr2qs_ctx("Use automatic nickname ([5 letters]AWAY)","options"),KviOption_boolAutoGeneratedAwayNick,KVI_OPTION_BOOL(KviOption_boolChangeNickAway)); - connect(m_pEnableAwayNick,SIGNAL(toggled(bool)),m_pEnableCustomAwayNick,SLOT(setEnabled(bool))); - connect(m_pEnableCustomAwayNick,SIGNAL(toggled(bool)),this,SLOT(enableCustomAwayText(bool))); + m_pEnableCustomAwayNick = addBoolSelector(g, __tr2qs_ctx("Use automatic nickname ([5 letters]AWAY)", "options"), KviOption_boolAutoGeneratedAwayNick, KVI_OPTION_BOOL(KviOption_boolChangeNickAway)); + connect(m_pEnableAwayNick, SIGNAL(toggled(bool)), m_pEnableCustomAwayNick, SLOT(setEnabled(bool))); + connect(m_pEnableCustomAwayNick, SIGNAL(toggled(bool)), this, SLOT(enableCustomAwayText(bool))); - m_pCustomAwayNick = addStringSelector(g,__tr2qs_ctx("Custom nickname (%%nick%% means a current nick):","options"),KviOption_stringCustomAwayNick,KVI_OPTION_BOOL(KviOption_boolChangeNickAway) && !(KVI_OPTION_BOOL(KviOption_boolAutoGeneratedAwayNick))); + m_pCustomAwayNick = addStringSelector(g, __tr2qs_ctx("Custom nickname (%%nick%% means a current nick):", "options"), KviOption_stringCustomAwayNick, KVI_OPTION_BOOL(KviOption_boolChangeNickAway) && !(KVI_OPTION_BOOL(KviOption_boolAutoGeneratedAwayNick))); - addRowSpacer(0,4,0,4); + addRowSpacer(0, 4, 0, 4); } OptionsWidget_away::~OptionsWidget_away() diff --git a/src/modules/options/OptionsWidget_away.h b/src/modules/options/OptionsWidget_away.h index 966165771..47de1d098 100644 --- a/src/modules/options/OptionsWidget_away.h +++ b/src/modules/options/OptionsWidget_away.h @@ -36,12 +36,13 @@ class OptionsWidget_away : public KviOptionsWidget public: OptionsWidget_away(QWidget * parent); ~OptionsWidget_away(); + protected: - KviBoolSelector * m_pEnableAwayMessage; - KviStringSelector * m_pAwayMessage; - KviBoolSelector * m_pEnableAwayNick; - KviStringSelector * m_pCustomAwayNick; - KviBoolSelector * m_pEnableCustomAwayNick; + KviBoolSelector * m_pEnableAwayMessage; + KviStringSelector * m_pAwayMessage; + KviBoolSelector * m_pEnableAwayNick; + KviStringSelector * m_pCustomAwayNick; + KviBoolSelector * m_pEnableCustomAwayNick; public slots: void enableCustomAwayText(bool); void enableAwayMessage(bool); diff --git a/src/modules/options/OptionsWidget_channel.cpp b/src/modules/options/OptionsWidget_channel.cpp index a521cb221..22da578b1 100644 --- a/src/modules/options/OptionsWidget_channel.cpp +++ b/src/modules/options/OptionsWidget_channel.cpp @@ -26,7 +26,6 @@ // //============================================================================= - #include "OptionsWidget_channel.h" #include "KviOptions.h" @@ -36,9 +35,8 @@ #include - OptionsWidget_channel::OptionsWidget_channel(QWidget * pParent) -: KviOptionsWidget(pParent) + : KviOptionsWidget(pParent) { } @@ -47,52 +45,56 @@ OptionsWidget_channel::~OptionsWidget_channel() } OptionsWidget_channelGeneral::OptionsWidget_channelGeneral(QWidget * pParent) -: KviOptionsWidget(pParent) + : KviOptionsWidget(pParent) { createLayout(); KviTalGroupBox * g; KviBoolSelector * b; - g = addGroupBox(0,0,0,0,Qt::Horizontal,__tr2qs_ctx("On Channel Kick","options")); - - b = addBoolSelector(g,__tr2qs_ctx("Rejoin channel","options"),KviOption_boolRejoinChannelOnKick); - mergeTip(b,__tr2qs_ctx("This option will cause KVIrc to attempt " \ - "to rejoin a channel after being kicked.","options")); - - b = addBoolSelector(g,__tr2qs_ctx("Keep channel open","options"),KviOption_boolKeepChannelOpenOnKick); - mergeTip(b,__tr2qs_ctx("This option will cause KVIrc to keep " \ - "the channel window open after being kicked.
" \ - "It might be a good idea to also enable the " \ - "\"Rejoin channel\" option.","options")); - - g = addGroupBox(0,1,0,1,Qt::Horizontal,__tr2qs_ctx("On Channel Part","options")); - - b = addBoolSelector(g,__tr2qs_ctx("Keep channel open","options"),KviOption_boolKeepChannelOpenOnPart); - mergeTip(b,__tr2qs_ctx("This option will cause KVIrc to keep " \ - "the channel window open after leaving it.","options")); - - b = addBoolSelector(0,2,0,2,__tr2qs_ctx("Automatically join channel on invite","options"),KviOption_boolAutoJoinOnInvite); - mergeTip(b,__tr2qs_ctx("This option will cause KVIrc to automatically " \ - "join a channel when an INVITE message for that channel is received.
" \ - "Warning: this may help spammers harass you.","options")); - - b = addBoolSelector(0,3,0,3, __tr2qs_ctx("Open channel windows without focus","options"),KviOption_boolCreateMinimizedChannels); - mergeTip(b,__tr2qs_ctx("This option prevents newly created " \ - "channel windows from diverting application focus.
" \ - "Enable this if you don't like channels " \ - "popping up while you're typing something in a channel.","options")); - - addRowSpacer(0,4,0,4); + g = addGroupBox(0, 0, 0, 0, Qt::Horizontal, __tr2qs_ctx("On Channel Kick", "options")); + + b = addBoolSelector(g, __tr2qs_ctx("Rejoin channel", "options"), KviOption_boolRejoinChannelOnKick); + mergeTip(b, __tr2qs_ctx("This option will cause KVIrc to attempt " + "to rejoin a channel after being kicked.", + "options")); + + b = addBoolSelector(g, __tr2qs_ctx("Keep channel open", "options"), KviOption_boolKeepChannelOpenOnKick); + mergeTip(b, __tr2qs_ctx("This option will cause KVIrc to keep " + "the channel window open after being kicked.
" + "It might be a good idea to also enable the " + "\"Rejoin channel\" option.", + "options")); + + g = addGroupBox(0, 1, 0, 1, Qt::Horizontal, __tr2qs_ctx("On Channel Part", "options")); + + b = addBoolSelector(g, __tr2qs_ctx("Keep channel open", "options"), KviOption_boolKeepChannelOpenOnPart); + mergeTip(b, __tr2qs_ctx("This option will cause KVIrc to keep " + "the channel window open after leaving it.", + "options")); + + b = addBoolSelector(0, 2, 0, 2, __tr2qs_ctx("Automatically join channel on invite", "options"), KviOption_boolAutoJoinOnInvite); + mergeTip(b, __tr2qs_ctx("This option will cause KVIrc to automatically " + "join a channel when an INVITE message for that channel is received.
" + "Warning: this may help spammers harass you.", + "options")); + + b = addBoolSelector(0, 3, 0, 3, __tr2qs_ctx("Open channel windows without focus", "options"), KviOption_boolCreateMinimizedChannels); + mergeTip(b, __tr2qs_ctx("This option prevents newly created " + "channel windows from diverting application focus.
" + "Enable this if you don't like channels " + "popping up while you're typing something in a channel.", + "options")); + + addRowSpacer(0, 4, 0, 4); } OptionsWidget_channelGeneral::~OptionsWidget_channelGeneral() { } - OptionsWidget_channelAdvanced::OptionsWidget_channelAdvanced(QWidget * pParent) -: KviOptionsWidget(pParent) + : KviOptionsWidget(pParent) { createLayout(); @@ -100,64 +102,66 @@ OptionsWidget_channelAdvanced::OptionsWidget_channelAdvanced(QWidget * pParent) KviTalGroupBox * g; KviUIntSelector * u; - b = addBoolSelector(0,0,4,0,__tr2qs_ctx("Log joined channels history","options"),KviOption_boolLogChannelHistory); + b = addBoolSelector(0, 0, 4, 0, __tr2qs_ctx("Log joined channels history", "options"), KviOption_boolLogChannelHistory); - addLabel(0,1,0,1,__tr2qs_ctx("Default ban mask:","options")); + addLabel(0, 1, 0, 1, __tr2qs_ctx("Default ban mask:", "options")); m_pBanTypeCombo = new QComboBox(this); - addWidgetToLayout(m_pBanTypeCombo,1,1,4,1); + addWidgetToLayout(m_pBanTypeCombo, 1, 1, 4, 1); KviIrcMask hostmask("nick!user@machine.host.top"); KviIrcMask ipmask("nick!user@192.168.1.2"); QString tmp1; QString tmp2; - for(int i=0;i<=26;i++) + for(int i = 0; i <= 26; i++) { - hostmask.mask(tmp1,(KviIrcMask::MaskType)i); - ipmask.mask(tmp2,(KviIrcMask::MaskType)i); - m_pBanTypeCombo->insertItem(m_pBanTypeCombo->count(),QString("%1 (%2)").arg(tmp1, tmp2)); + hostmask.mask(tmp1, (KviIrcMask::MaskType)i); + ipmask.mask(tmp2, (KviIrcMask::MaskType)i); + m_pBanTypeCombo->insertItem(m_pBanTypeCombo->count(), QString("%1 (%2)").arg(tmp1, tmp2)); } m_pBanTypeCombo->setCurrentIndex(KVI_OPTION_UINT(KviOption_uintDefaultBanType)); - g = addGroupBox(0,2,4,2,Qt::Horizontal,__tr2qs_ctx("On Channel Join","options")); - u = addUIntSelector(g,__tr2qs_ctx("Minimum delay between two channel requests:","options"),KviOption_uintOnJoinRequestsDelay,0,10,1); - u->setSuffix(__tr2qs_ctx(" sec","options")); - mergeTip(u,__tr2qs_ctx("This is an artificial delay for the channel requests made on join.
" \ - "You may increase it if your server complains about flooding when joining " \ - "many channels at once.
Minimum value: 0 secs
Maximum value: 10 secs","options")); + g = addGroupBox(0, 2, 4, 2, Qt::Horizontal, __tr2qs_ctx("On Channel Join", "options")); + u = addUIntSelector(g, __tr2qs_ctx("Minimum delay between two channel requests:", "options"), KviOption_uintOnJoinRequestsDelay, 0, 10, 1); + u->setSuffix(__tr2qs_ctx(" sec", "options")); + mergeTip(u, __tr2qs_ctx("This is an artificial delay for the channel requests made on join.
" + "You may increase it if your server complains about flooding when joining " + "many channels at once.
Minimum value: 0 secs
Maximum value: 10 secs", + "options")); - addBoolSelector(g,__tr2qs_ctx("Do not send /WHO request","options"),KviOption_boolDisableWhoRequestOnJoin); - addBoolSelector(g,__tr2qs_ctx("Do not request ban list","options"),KviOption_boolDisableBanListRequestOnJoin); - addBoolSelector(g,__tr2qs_ctx("Do not request ban exception list","options"),KviOption_boolDisableBanExceptionListRequestOnJoin); - addBoolSelector(g,__tr2qs_ctx("Do not request invite list","options"),KviOption_boolDisableInviteListRequestOnJoin); - addBoolSelector(g,__tr2qs_ctx("Do not request quiet ban list","options"),KviOption_boolDisableQuietBanListRequestOnJoin); - addBoolSelector(g,__tr2qs_ctx("Echo channel topic","options"),KviOption_boolEchoNumericTopic); - addBoolSelector(g,__tr2qs_ctx("Show channel sync time","options"),KviOption_boolShowChannelSyncTime); + addBoolSelector(g, __tr2qs_ctx("Do not send /WHO request", "options"), KviOption_boolDisableWhoRequestOnJoin); + addBoolSelector(g, __tr2qs_ctx("Do not request ban list", "options"), KviOption_boolDisableBanListRequestOnJoin); + addBoolSelector(g, __tr2qs_ctx("Do not request ban exception list", "options"), KviOption_boolDisableBanExceptionListRequestOnJoin); + addBoolSelector(g, __tr2qs_ctx("Do not request invite list", "options"), KviOption_boolDisableInviteListRequestOnJoin); + addBoolSelector(g, __tr2qs_ctx("Do not request quiet ban list", "options"), KviOption_boolDisableQuietBanListRequestOnJoin); + addBoolSelector(g, __tr2qs_ctx("Echo channel topic", "options"), KviOption_boolEchoNumericTopic); + addBoolSelector(g, __tr2qs_ctx("Show channel sync time", "options"), KviOption_boolShowChannelSyncTime); - b = addBoolSelector(g,__tr2qs_ctx("Paste last channel log","options"),KviOption_boolPasteLastLogOnChannelJoin); + b = addBoolSelector(g, __tr2qs_ctx("Paste last channel log", "options"), KviOption_boolPasteLastLogOnChannelJoin); KviTalHBox * box = new KviTalHBox(g); - u = addUIntSelector(box,__tr2qs_ctx("Paste up to:","options"),KviOption_uintLinesToPasteOnChannelJoin,0,50,10,KVI_OPTION_BOOL(KviOption_boolPasteLastLogOnChannelJoin)); - u->setSuffix(__tr2qs_ctx(" lines","options")); - mergeTip(u,__tr2qs_ctx("Minimum value: 0 lines
Maximum value: 50 lines","options")); - - connect(b,SIGNAL(toggled(bool)),u,SLOT(setEnabled(bool))); - - u = addUIntSelector(box,__tr2qs_ctx("Interval:","options"),KviOption_uintDaysIntervalToPasteOnChannelJoin,1,10,10,KVI_OPTION_BOOL(KviOption_boolPasteLastLogOnChannelJoin)); - u->setSuffix(__tr2qs_ctx(" days","options")); - mergeTip(u,__tr2qs_ctx("Minimum value: 0 days
Maximum value: 10 days","options")); + u = addUIntSelector(box, __tr2qs_ctx("Paste up to:", "options"), KviOption_uintLinesToPasteOnChannelJoin, 0, 50, 10, KVI_OPTION_BOOL(KviOption_boolPasteLastLogOnChannelJoin)); + u->setSuffix(__tr2qs_ctx(" lines", "options")); + mergeTip(u, __tr2qs_ctx("Minimum value: 0 lines
Maximum value: 50 lines", "options")); + + connect(b, SIGNAL(toggled(bool)), u, SLOT(setEnabled(bool))); + + u = addUIntSelector(box, __tr2qs_ctx("Interval:", "options"), KviOption_uintDaysIntervalToPasteOnChannelJoin, 1, 10, 10, KVI_OPTION_BOOL(KviOption_boolPasteLastLogOnChannelJoin)); + u->setSuffix(__tr2qs_ctx(" days", "options")); + mergeTip(u, __tr2qs_ctx("Minimum value: 0 days
Maximum value: 10 days", "options")); - connect(b,SIGNAL(toggled(bool)),u,SLOT(setEnabled(bool))); + connect(b, SIGNAL(toggled(bool)), u, SLOT(setEnabled(bool))); - b = addBoolSelector(0,3,4,3,__tr2qs_ctx("Keep away list updated","options"),KviOption_boolEnableAwayListUpdates); - mergeTip(b,__tr2qs_ctx("KVIrc sends out a channel /WHO message every now and then to keep the channel away list in sync. " \ - "Use this option to disable this feature (and to save your IRC bandwidth).
" \ - "If the server supports IRCv3.1's away-notify extension, it will be used instead of WHO requests.","options")); + b = addBoolSelector(0, 3, 4, 3, __tr2qs_ctx("Keep away list updated", "options"), KviOption_boolEnableAwayListUpdates); + mergeTip(b, __tr2qs_ctx("KVIrc sends out a channel /WHO message every now and then to keep the channel away list in sync. " + "Use this option to disable this feature (and to save your IRC bandwidth).
" + "If the server supports IRCv3.1's away-notify extension, it will be used instead of WHO requests.", + "options")); - addRowSpacer(0,5,4,5); + addRowSpacer(0, 5, 4, 5); } OptionsWidget_channelAdvanced::~OptionsWidget_channelAdvanced() @@ -166,7 +170,8 @@ OptionsWidget_channelAdvanced::~OptionsWidget_channelAdvanced() void OptionsWidget_channelAdvanced::commit() { - KVI_OPTION_UINT(KviOption_uintDefaultBanType)=m_pBanTypeCombo->currentIndex(); - if((KVI_OPTION_UINT(KviOption_uintDefaultBanType)>26)) KVI_OPTION_UINT(KviOption_uintDefaultBanType)=7; + KVI_OPTION_UINT(KviOption_uintDefaultBanType) = m_pBanTypeCombo->currentIndex(); + if((KVI_OPTION_UINT(KviOption_uintDefaultBanType) > 26)) + KVI_OPTION_UINT(KviOption_uintDefaultBanType) = 7; KviOptionsWidget::commit(); } diff --git a/src/modules/options/OptionsWidget_channel.h b/src/modules/options/OptionsWidget_channel.h index 54d5532ab..09d2c61e2 100644 --- a/src/modules/options/OptionsWidget_channel.h +++ b/src/modules/options/OptionsWidget_channel.h @@ -69,8 +69,10 @@ class OptionsWidget_channelAdvanced : public KviOptionsWidget public: OptionsWidget_channelAdvanced(QWidget * parent); ~OptionsWidget_channelAdvanced(); + public: virtual void commit(); + protected: QComboBox * m_pBanTypeCombo; }; diff --git a/src/modules/options/OptionsWidget_connection.cpp b/src/modules/options/OptionsWidget_connection.cpp index 80377a618..8f3335d76 100644 --- a/src/modules/options/OptionsWidget_connection.cpp +++ b/src/modules/options/OptionsWidget_connection.cpp @@ -32,9 +32,8 @@ #include - OptionsWidget_connection::OptionsWidget_connection(QWidget * parent) -: KviOptionsWidget(parent) + : KviOptionsWidget(parent) { setObjectName("connection_options_widget"); createLayout(); @@ -42,62 +41,62 @@ OptionsWidget_connection::OptionsWidget_connection(QWidget * parent) KviBoolSelector * b1; KviBoolSelector * b; - KviTalGroupBox * gbox = addGroupBox(0,0,0,0,Qt::Horizontal,__tr2qs_ctx("On Disconnect","options")); + KviTalGroupBox * gbox = addGroupBox(0, 0, 0, 0, Qt::Horizontal, __tr2qs_ctx("On Disconnect", "options")); - b1 = addBoolSelector(gbox,__tr2qs_ctx("Keep channels open","options"),KviOption_boolKeepChannelsOpenOnDisconnect,true); - mergeTip(b1,__tr2qs_ctx("This option will cause KVIrc to keep channels open after disconnect.","options")); + b1 = addBoolSelector(gbox, __tr2qs_ctx("Keep channels open", "options"), KviOption_boolKeepChannelsOpenOnDisconnect, true); + mergeTip(b1, __tr2qs_ctx("This option will cause KVIrc to keep channels open after disconnect.", "options")); - b1 = addBoolSelector(gbox,__tr2qs_ctx("Keep queries open","options"),KviOption_boolKeepQueriesOpenOnDisconnect,true); - mergeTip(b1,__tr2qs_ctx("This option will cause KVIrc to keep queries open after disconnect.","options")); + b1 = addBoolSelector(gbox, __tr2qs_ctx("Keep queries open", "options"), KviOption_boolKeepQueriesOpenOnDisconnect, true); + mergeTip(b1, __tr2qs_ctx("This option will cause KVIrc to keep queries open after disconnect.", "options")); - gbox = addGroupBox(0,1,0,1,Qt::Horizontal,__tr2qs_ctx("On Unexpected Disconnect","options")); + gbox = addGroupBox(0, 1, 0, 1, Qt::Horizontal, __tr2qs_ctx("On Unexpected Disconnect", "options")); - b1 = addBoolSelector(gbox,__tr2qs_ctx("Keep channels open","options"),KviOption_boolKeepChannelsOpenOnUnexpectedDisconnect,true); - mergeTip(b1,__tr2qs_ctx("This option will cause KVIrc to keep channels open after an unexpected disconnect.","options")); + b1 = addBoolSelector(gbox, __tr2qs_ctx("Keep channels open", "options"), KviOption_boolKeepChannelsOpenOnUnexpectedDisconnect, true); + mergeTip(b1, __tr2qs_ctx("This option will cause KVIrc to keep channels open after an unexpected disconnect.", "options")); - b1 = addBoolSelector(gbox,__tr2qs_ctx("Keep queries open","options"),KviOption_boolKeepQueriesOpenOnUnexpectedDisconnect,true); - mergeTip(b1,__tr2qs_ctx("This option will cause KVIrc to keep queries open after an unexpected disconnect.","options")); + b1 = addBoolSelector(gbox, __tr2qs_ctx("Keep queries open", "options"), KviOption_boolKeepQueriesOpenOnUnexpectedDisconnect, true); + mergeTip(b1, __tr2qs_ctx("This option will cause KVIrc to keep queries open after an unexpected disconnect.", "options")); - b1 = addBoolSelector(gbox,__tr2qs_ctx("Rejoin channels after reconnect","options"),KviOption_boolRejoinChannelsAfterReconnect,true); - mergeTip(b1,__tr2qs_ctx("This option will cause KVIrc to rejoin channels after a successful reconnect attempt.","options")); + b1 = addBoolSelector(gbox, __tr2qs_ctx("Rejoin channels after reconnect", "options"), KviOption_boolRejoinChannelsAfterReconnect, true); + mergeTip(b1, __tr2qs_ctx("This option will cause KVIrc to rejoin channels after a successful reconnect attempt.", "options")); - b1 = addBoolSelector(gbox,__tr2qs_ctx("Reopen queries after reconnect","options"),KviOption_boolReopenQueriesAfterReconnect,true); - mergeTip(b1,__tr2qs_ctx("This option will cause KVIrc to reopen query windows after a successful reconnect attempt.","options")); + b1 = addBoolSelector(gbox, __tr2qs_ctx("Reopen queries after reconnect", "options"), KviOption_boolReopenQueriesAfterReconnect, true); + mergeTip(b1, __tr2qs_ctx("This option will cause KVIrc to reopen query windows after a successful reconnect attempt.", "options")); - b = addBoolSelector(gbox,__tr2qs_ctx("Automatically reconnect","options"),KviOption_boolAutoReconnectOnUnexpectedDisconnect); - mergeTip(b,__tr2qs_ctx("This option will enable auto-reconnecting after an unexpected disconnect. " \ - "An unexpected disconnect is the termination of a fully connected IRC session " \ - "that was not requested by the user by the means of the QUIT message." \ - "

Warning: If you use /RAW to send a QUIT message to the server, " \ - "this option will not behave correctly, since does not detect the outgoing " \ - "QUIT message and will attempt to reconnect after the server has closed the connection. " \ - "For this reason, always use the /QUIT command to close your connections. " \ - "This option may also behave incorrectly with bouncers that support " \ - "detaching, in this case a solution could be to prepare an alias that sends the " \ - "bouncer \"detach\" command immediately before the \"quit\" command.
" \ - "alias(bncdetach){ raw bouncer detach; quit; }

","options")); + b = addBoolSelector(gbox, __tr2qs_ctx("Automatically reconnect", "options"), KviOption_boolAutoReconnectOnUnexpectedDisconnect); + mergeTip(b, __tr2qs_ctx("This option will enable auto-reconnecting after an unexpected disconnect. " + "An unexpected disconnect is the termination of a fully connected IRC session " + "that was not requested by the user by the means of the QUIT message." + "

Warning: If you use /RAW to send a QUIT message to the server, " + "this option will not behave correctly, since does not detect the outgoing " + "QUIT message and will attempt to reconnect after the server has closed the connection. " + "For this reason, always use the /QUIT command to close your connections. " + "This option may also behave incorrectly with bouncers that support " + "detaching, in this case a solution could be to prepare an alias that sends the " + "bouncer \"detach\" command immediately before the \"quit\" command.
" + "alias(bncdetach){ raw bouncer detach; quit; }

", + "options")); - KviUIntSelector * u = addUIntSelector(gbox,__tr2qs_ctx("Maximum attempts (0: unlimited):","options"), - KviOption_uintMaxAutoReconnectAttempts,0,100,5,KVI_OPTION_BOOL(KviOption_boolAutoReconnectOnUnexpectedDisconnect)); - connect(b,SIGNAL(toggled(bool)),u,SLOT(setEnabled(bool))); + KviUIntSelector * u = addUIntSelector(gbox, __tr2qs_ctx("Maximum attempts (0: unlimited):", "options"), + KviOption_uintMaxAutoReconnectAttempts, 0, 100, 5, KVI_OPTION_BOOL(KviOption_boolAutoReconnectOnUnexpectedDisconnect)); + connect(b, SIGNAL(toggled(bool)), u, SLOT(setEnabled(bool))); - u = addUIntSelector(gbox,__tr2qs_ctx("Delay between attempts:","options"),KviOption_uintAutoReconnectDelay,0,86400,5, - KVI_OPTION_BOOL(KviOption_boolAutoReconnectOnUnexpectedDisconnect)); - u->setSuffix(__tr2qs_ctx(" sec","options")); - connect(b,SIGNAL(toggled(bool)),u,SLOT(setEnabled(bool))); + u = addUIntSelector(gbox, __tr2qs_ctx("Delay between attempts:", "options"), KviOption_uintAutoReconnectDelay, 0, 86400, 5, + KVI_OPTION_BOOL(KviOption_boolAutoReconnectOnUnexpectedDisconnect)); + u->setSuffix(__tr2qs_ctx(" sec", "options")); + connect(b, SIGNAL(toggled(bool)), u, SLOT(setEnabled(bool))); - mergeTip(u,__tr2qs_ctx("Minimum value: 0 sec
Maximum value: 86400 sec","options")); + mergeTip(u, __tr2qs_ctx("Minimum value: 0 sec
Maximum value: 86400 sec", "options")); - addRowSpacer(0,3,4,3); + addRowSpacer(0, 3, 4, 3); } OptionsWidget_connection::~OptionsWidget_connection() { } - OptionsWidget_connectionSsl::OptionsWidget_connectionSsl(QWidget * parent) -: KviOptionsWidget(parent) + : KviOptionsWidget(parent) { setObjectName("ssl_options_widget"); createLayout(); @@ -108,33 +107,33 @@ OptionsWidget_connectionSsl::OptionsWidget_connectionSsl(QWidget * parent) KviFileSelector * f; KviPasswordSelector * p; - KviTalGroupBox * gbox = addGroupBox(0,0,0,0,Qt::Horizontal,__tr2qs_ctx("Certificate","options")); + KviTalGroupBox * gbox = addGroupBox(0, 0, 0, 0, Qt::Horizontal, __tr2qs_ctx("Certificate", "options")); - b = addBoolSelector(gbox,__tr2qs_ctx("Use SSL certificate (PEM format only)","options"), - &(KVI_OPTION_BOOL(KviOption_boolUseSSLCertificate)),true); + b = addBoolSelector(gbox, __tr2qs_ctx("Use SSL certificate (PEM format only)", "options"), + &(KVI_OPTION_BOOL(KviOption_boolUseSSLCertificate)), true); - f = addFileSelector(gbox,__tr2qs_ctx("Certificate location:","options"),&(KVI_OPTION_STRING(KviOption_stringSSLCertificatePath)), - KVI_OPTION_BOOL(KviOption_boolUseSSLCertificate)); - connect(b,SIGNAL(toggled(bool)),f,SLOT(setEnabled(bool))); + f = addFileSelector(gbox, __tr2qs_ctx("Certificate location:", "options"), &(KVI_OPTION_STRING(KviOption_stringSSLCertificatePath)), + KVI_OPTION_BOOL(KviOption_boolUseSSLCertificate)); + connect(b, SIGNAL(toggled(bool)), f, SLOT(setEnabled(bool))); - p = new KviPasswordSelector(gbox,__tr2qs_ctx("Certificate password:","options"),&(KVI_OPTION_STRING(KviOption_stringSSLCertificatePass)), - KVI_OPTION_BOOL(KviOption_boolUseSSLCertificate)); - connect(b,SIGNAL(toggled(bool)),p,SLOT(setEnabled(bool))); + p = new KviPasswordSelector(gbox, __tr2qs_ctx("Certificate password:", "options"), &(KVI_OPTION_STRING(KviOption_stringSSLCertificatePass)), + KVI_OPTION_BOOL(KviOption_boolUseSSLCertificate)); + connect(b, SIGNAL(toggled(bool)), p, SLOT(setEnabled(bool))); - gbox = addGroupBox(0,1,0,1,Qt::Horizontal,__tr2qs_ctx("Private Key","options")); + gbox = addGroupBox(0, 1, 0, 1, Qt::Horizontal, __tr2qs_ctx("Private Key", "options")); - b = addBoolSelector(gbox,__tr2qs_ctx("Use SSL private key","options"),&(KVI_OPTION_BOOL(KviOption_boolUseSSLPrivateKey)),true); - f = addFileSelector(gbox,__tr2qs_ctx("Private key location:","options"),&(KVI_OPTION_STRING(KviOption_stringSSLPrivateKeyPath)), - KVI_OPTION_BOOL(KviOption_boolUseSSLPrivateKey)); - connect(b,SIGNAL(toggled(bool)),f,SLOT(setEnabled(bool))); + b = addBoolSelector(gbox, __tr2qs_ctx("Use SSL private key", "options"), &(KVI_OPTION_BOOL(KviOption_boolUseSSLPrivateKey)), true); + f = addFileSelector(gbox, __tr2qs_ctx("Private key location:", "options"), &(KVI_OPTION_STRING(KviOption_stringSSLPrivateKeyPath)), + KVI_OPTION_BOOL(KviOption_boolUseSSLPrivateKey)); + connect(b, SIGNAL(toggled(bool)), f, SLOT(setEnabled(bool))); - p = addPasswordSelector(gbox,__tr2qs_ctx("Private key password:","options"),&(KVI_OPTION_STRING(KviOption_stringSSLPrivateKeyPass)), - KVI_OPTION_BOOL(KviOption_boolUseSSLPrivateKey)); - connect(b,SIGNAL(toggled(bool)),p,SLOT(setEnabled(bool))); + p = addPasswordSelector(gbox, __tr2qs_ctx("Private key password:", "options"), &(KVI_OPTION_STRING(KviOption_stringSSLPrivateKeyPass)), + KVI_OPTION_BOOL(KviOption_boolUseSSLPrivateKey)); + connect(b, SIGNAL(toggled(bool)), p, SLOT(setEnabled(bool))); - addRowSpacer(0,3,0,3); + addRowSpacer(0, 3, 0, 3); #else - addLabel(0,0,0,0,__tr2qs_ctx("This executable has no SSL support.","options")); + addLabel(0, 0, 0, 0, __tr2qs_ctx("This executable has no SSL support.", "options")); #endif } @@ -142,9 +141,8 @@ OptionsWidget_connectionSsl::~OptionsWidget_connectionSsl() { } - OptionsWidget_connectionSocket::OptionsWidget_connectionSocket(QWidget * parent) -: KviOptionsWidget(parent) + : KviOptionsWidget(parent) { setObjectName("transport_options_widget"); createLayout(); @@ -154,76 +152,76 @@ OptionsWidget_connectionSocket::OptionsWidget_connectionSocket(QWidget * parent) KviBoolSelector * b; KviStringSelector * s; - g = addGroupBox(0,0,0,0,Qt::Horizontal,__tr2qs_ctx("Timeout Values","options")); - u = addUIntSelector(g,__tr2qs_ctx("Connect timeout:","options"),KviOption_uintIrcSocketTimeout,5,6000,60); - u->setSuffix(__tr2qs_ctx(" sec","options")); - u = addUIntSelector(g,__tr2qs_ctx("Outgoing data queue flush timeout:","options"),KviOption_uintSocketQueueFlushTimeout,100,2000,500); - u->setSuffix(__tr2qs_ctx(" msec","options")); - b = addBoolSelector(0,1,0,1,__tr2qs_ctx("Limit outgoing traffic per connection","options"),KviOption_boolLimitOutgoingTraffic); - u = addUIntSelector(0,2,0,2,__tr2qs_ctx("Limit to 1 message every:","options"), - KviOption_uintOutgoingTrafficLimitUSeconds,10000,2000000,10000001,KVI_OPTION_BOOL(KviOption_boolLimitOutgoingTraffic)); - u->setSuffix(__tr2qs_ctx(" usec","options")); - mergeTip(u,__tr2qs_ctx("Minimum value: 10000 usec
Maximum value: 10000000 usec","options")); - connect(b,SIGNAL(toggled(bool)),u,SLOT(setEnabled(bool))); - - g = addGroupBox(0,3,0,3,Qt::Horizontal,__tr2qs_ctx("Network Interfaces","options")); - - b = addBoolSelector(g,__tr2qs_ctx("Bind IPv4 connections to:","options"),KviOption_boolBindIrcIPv4ConnectionsToSpecifiedAddress); - s = addStringSelector(g,"",KviOption_stringIPv4ConnectionBindAddress,KVI_OPTION_BOOL(KviOption_boolBindIrcIPv4ConnectionsToSpecifiedAddress)); - connect(b,SIGNAL(toggled(bool)),s,SLOT(setEnabled(bool))); + g = addGroupBox(0, 0, 0, 0, Qt::Horizontal, __tr2qs_ctx("Timeout Values", "options")); + u = addUIntSelector(g, __tr2qs_ctx("Connect timeout:", "options"), KviOption_uintIrcSocketTimeout, 5, 6000, 60); + u->setSuffix(__tr2qs_ctx(" sec", "options")); + u = addUIntSelector(g, __tr2qs_ctx("Outgoing data queue flush timeout:", "options"), KviOption_uintSocketQueueFlushTimeout, 100, 2000, 500); + u->setSuffix(__tr2qs_ctx(" msec", "options")); + b = addBoolSelector(0, 1, 0, 1, __tr2qs_ctx("Limit outgoing traffic per connection", "options"), KviOption_boolLimitOutgoingTraffic); + u = addUIntSelector(0, 2, 0, 2, __tr2qs_ctx("Limit to 1 message every:", "options"), + KviOption_uintOutgoingTrafficLimitUSeconds, 10000, 2000000, 10000001, KVI_OPTION_BOOL(KviOption_boolLimitOutgoingTraffic)); + u->setSuffix(__tr2qs_ctx(" usec", "options")); + mergeTip(u, __tr2qs_ctx("Minimum value: 10000 usec
Maximum value: 10000000 usec", "options")); + connect(b, SIGNAL(toggled(bool)), u, SLOT(setEnabled(bool))); + + g = addGroupBox(0, 3, 0, 3, Qt::Horizontal, __tr2qs_ctx("Network Interfaces", "options")); + + b = addBoolSelector(g, __tr2qs_ctx("Bind IPv4 connections to:", "options"), KviOption_boolBindIrcIPv4ConnectionsToSpecifiedAddress); + s = addStringSelector(g, "", KviOption_stringIPv4ConnectionBindAddress, KVI_OPTION_BOOL(KviOption_boolBindIrcIPv4ConnectionsToSpecifiedAddress)); + connect(b, SIGNAL(toggled(bool)), s, SLOT(setEnabled(bool))); #ifdef COMPILE_IPV6_SUPPORT - b = addBoolSelector(g,__tr2qs_ctx("Bind IPv6 connections to:","options"),KviOption_boolBindIrcIPv6ConnectionsToSpecifiedAddress); - s = addStringSelector(g,"",KviOption_stringIPv6ConnectionBindAddress,KVI_OPTION_BOOL(KviOption_boolBindIrcIPv6ConnectionsToSpecifiedAddress)); - connect(b,SIGNAL(toggled(bool)),s,SLOT(setEnabled(bool))); + b = addBoolSelector(g, __tr2qs_ctx("Bind IPv6 connections to:", "options"), KviOption_boolBindIrcIPv6ConnectionsToSpecifiedAddress); + s = addStringSelector(g, "", KviOption_stringIPv6ConnectionBindAddress, KVI_OPTION_BOOL(KviOption_boolBindIrcIPv6ConnectionsToSpecifiedAddress)); + connect(b, SIGNAL(toggled(bool)), s, SLOT(setEnabled(bool))); #endif //!COMPILE_IPV6_SUPPORT - b = addBoolSelector(0,4,0,4,__tr2qs_ctx("Pick random IP address for round-robin servers","options"),KviOption_boolPickRandomIpAddressForRoundRobinServers); - mergeTip(b,__tr2qs_ctx("This option will cause the KVIrc networking stack to pick up " \ - "a random entry when multiple IP address are retrieved for a server " \ - "DNS lookup. This is harmless and can fix some problems with caching " \ - "DNS servers that do not properly rotate the records as the authoritative " \ - "ones would do. On the other hand, you might want to disable it if " \ - "you want to rely on the DNS server to provide the best choice.","options")); + b = addBoolSelector(0, 4, 0, 4, __tr2qs_ctx("Pick random IP address for round-robin servers", "options"), KviOption_boolPickRandomIpAddressForRoundRobinServers); + mergeTip(b, __tr2qs_ctx("This option will cause the KVIrc networking stack to pick up " + "a random entry when multiple IP address are retrieved for a server " + "DNS lookup. This is harmless and can fix some problems with caching " + "DNS servers that do not properly rotate the records as the authoritative " + "ones would do. On the other hand, you might want to disable it if " + "you want to rely on the DNS server to provide the best choice.", + "options")); - addRowSpacer(0,5,0,5); + addRowSpacer(0, 5, 0, 5); } OptionsWidget_connectionSocket::~OptionsWidget_connectionSocket() { } - OptionsWidget_identService::OptionsWidget_identService(QWidget * parent) -: KviOptionsWidget(parent) + : KviOptionsWidget(parent) { setObjectName("ident_options_widget"); createLayout(); #if defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW) - m_pEnableIdent = addBoolSelector(0,0,0,0,__tr2qs_ctx("Enable Ident service","options"),KviOption_boolUseIdentService); + m_pEnableIdent = addBoolSelector(0, 0, 0, 0, __tr2qs_ctx("Enable Ident service", "options"), KviOption_boolUseIdentService); #else - m_pEnableIdent = addBoolSelector(0,0,0,0,__tr2qs_ctx("Enable Ident service (bad practice on UNIX!)","options"),KviOption_boolUseIdentService); + m_pEnableIdent = addBoolSelector(0, 0, 0, 0, __tr2qs_ctx("Enable Ident service (bad practice on UNIX!)", "options"), KviOption_boolUseIdentService); #endif - connect(m_pEnableIdent,SIGNAL(toggled(bool)),this,SLOT(enableIpv4InIpv6(bool))); + connect(m_pEnableIdent, SIGNAL(toggled(bool)), this, SLOT(enableIpv4InIpv6(bool))); - KviTalGroupBox * gbox = addGroupBox(0,1,0,1,Qt::Horizontal,__tr2qs_ctx("Output Verbosity","options"),KVI_OPTION_BOOL(KviOption_boolUseIdentService)); - connect(m_pEnableIdent,SIGNAL(toggled(bool)),gbox,SLOT(setEnabled(bool))); + KviTalGroupBox * gbox = addGroupBox(0, 1, 0, 1, Qt::Horizontal, __tr2qs_ctx("Output Verbosity", "options"), KVI_OPTION_BOOL(KviOption_boolUseIdentService)); + connect(m_pEnableIdent, SIGNAL(toggled(bool)), gbox, SLOT(setEnabled(bool))); - addLabel(gbox,__tr2qs_ctx("Output Ident service messages to:","options")); + addLabel(gbox, __tr2qs_ctx("Output Ident service messages to:", "options")); - m_pActiveRadio = new QRadioButton(__tr2qs_ctx("Active window","options"),gbox); - m_pConsoleRadio = new QRadioButton(__tr2qs_ctx("Console","options"),gbox); - m_pQuietRadio = new QRadioButton(__tr2qs_ctx("Do not show any Ident service messages","options"),gbox); + m_pActiveRadio = new QRadioButton(__tr2qs_ctx("Active window", "options"), gbox); + m_pConsoleRadio = new QRadioButton(__tr2qs_ctx("Console", "options"), gbox); + m_pQuietRadio = new QRadioButton(__tr2qs_ctx("Do not show any Ident service messages", "options"), gbox); switch(KVI_OPTION_UINT(KviOption_uintIdentdOutputMode)) { - case KviIdentdOutputMode::Quiet : + case KviIdentdOutputMode::Quiet: m_pQuietRadio->setChecked(true); break; - case KviIdentdOutputMode::ToConsole : + case KviIdentdOutputMode::ToConsole: m_pConsoleRadio->setChecked(true); break; - case KviIdentdOutputMode::ToActiveWindow : + case KviIdentdOutputMode::ToActiveWindow: m_pActiveRadio->setChecked(true); break; } @@ -232,49 +230,51 @@ OptionsWidget_identService::OptionsWidget_identService(QWidget * parent) KviStringSelector * s; KviUIntSelector * u; - gbox = addGroupBox(0,2,0,2,Qt::Horizontal,__tr2qs_ctx("Configuration","options"),KVI_OPTION_BOOL(KviOption_boolUseIdentService)); + gbox = addGroupBox(0, 2, 0, 2, Qt::Horizontal, __tr2qs_ctx("Configuration", "options"), KVI_OPTION_BOOL(KviOption_boolUseIdentService)); - b = addBoolSelector(gbox,__tr2qs_ctx("Enable Ident service only while connecting to server","options"),KviOption_boolUseIdentServiceOnlyOnConnect); - connect(m_pEnableIdent,SIGNAL(toggled(bool)),b,SLOT(setEnabled(bool))); + b = addBoolSelector(gbox, __tr2qs_ctx("Enable Ident service only while connecting to server", "options"), KviOption_boolUseIdentServiceOnlyOnConnect); + connect(m_pEnableIdent, SIGNAL(toggled(bool)), b, SLOT(setEnabled(bool))); - s = addStringSelector(gbox,__tr2qs_ctx("Ident username:","options"),KviOption_stringIdentdUser,KVI_OPTION_BOOL(KviOption_boolUseIdentService)); - connect(m_pEnableIdent,SIGNAL(toggled(bool)),s,SLOT(setEnabled(bool))); + s = addStringSelector(gbox, __tr2qs_ctx("Ident username:", "options"), KviOption_stringIdentdUser, KVI_OPTION_BOOL(KviOption_boolUseIdentService)); + connect(m_pEnableIdent, SIGNAL(toggled(bool)), s, SLOT(setEnabled(bool))); - u = addUIntSelector(gbox,__tr2qs_ctx("Service port:","options"),KviOption_uintIdentdPort,0,65535,113,KVI_OPTION_BOOL(KviOption_boolUseIdentService)); - connect(m_pEnableIdent,SIGNAL(toggled(bool)),u,SLOT(setEnabled(bool))); - connect(m_pEnableIdent,SIGNAL(toggled(bool)),gbox,SLOT(setEnabled(bool))); + u = addUIntSelector(gbox, __tr2qs_ctx("Service port:", "options"), KviOption_uintIdentdPort, 0, 65535, 113, KVI_OPTION_BOOL(KviOption_boolUseIdentService)); + connect(m_pEnableIdent, SIGNAL(toggled(bool)), u, SLOT(setEnabled(bool))); + connect(m_pEnableIdent, SIGNAL(toggled(bool)), gbox, SLOT(setEnabled(bool))); - gbox = addGroupBox(0,3,0,3,Qt::Horizontal,__tr2qs_ctx("IPv6 Settings","options"),KVI_OPTION_BOOL(KviOption_boolUseIdentService)); + gbox = addGroupBox(0, 3, 0, 3, Qt::Horizontal, __tr2qs_ctx("IPv6 Settings", "options"), KVI_OPTION_BOOL(KviOption_boolUseIdentService)); - m_pEnableIpv6 = addBoolSelector(gbox,__tr2qs_ctx("Enable service for IPv6","options"),KviOption_boolIdentdEnableIPv6, - KVI_OPTION_BOOL(KviOption_boolUseIdentService)); + m_pEnableIpv6 = addBoolSelector(gbox, __tr2qs_ctx("Enable service for IPv6", "options"), KviOption_boolIdentdEnableIPv6, + KVI_OPTION_BOOL(KviOption_boolUseIdentService)); #ifdef COMPILE_IPV6_SUPPORT - connect(m_pEnableIdent,SIGNAL(toggled(bool)),m_pEnableIpv6,SLOT(setEnabled(bool))); - connect(m_pEnableIpv6,SIGNAL(toggled(bool)),this,SLOT(enableIpv4InIpv6(bool))); + connect(m_pEnableIdent, SIGNAL(toggled(bool)), m_pEnableIpv6, SLOT(setEnabled(bool))); + connect(m_pEnableIpv6, SIGNAL(toggled(bool)), this, SLOT(enableIpv4InIpv6(bool))); #else m_pEnableIpv6->setEnabled(false); #endif - m_pIpv4InIpv6 = addBoolSelector(gbox,__tr2qs_ctx("IP stack treats IPv4 as part of IPv6 namespace","options"),KviOption_boolIdentdIPv6ContainsIPv4, - KVI_OPTION_BOOL(KviOption_boolUseIdentService) && KVI_OPTION_BOOL(KviOption_boolIdentdEnableIPv6)); - connect(m_pEnableIdent,SIGNAL(toggled(bool)),gbox,SLOT(setEnabled(bool))); + m_pIpv4InIpv6 = addBoolSelector(gbox, __tr2qs_ctx("IP stack treats IPv4 as part of IPv6 namespace", "options"), KviOption_boolIdentdIPv6ContainsIPv4, + KVI_OPTION_BOOL(KviOption_boolUseIdentService) && KVI_OPTION_BOOL(KviOption_boolIdentdEnableIPv6)); + connect(m_pEnableIdent, SIGNAL(toggled(bool)), gbox, SLOT(setEnabled(bool))); - addLabel(0,4,0,4, + addLabel(0, 4, 0, 4, #if defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW) - __tr2qs_ctx("

Warning:
" \ - "This is a non RFC 1413 compliant Ident daemon that implements " \ - "only a limited subset of the Identification Protocol specifications. If it is possible, install a " \ - "real Ident daemon.

","options") + __tr2qs_ctx("

Warning:
" + "This is a non RFC 1413 compliant Ident daemon that implements " + "only a limited subset of the Identification Protocol specifications. If it is possible, install a " + "real Ident daemon.

", + "options") #else - __tr2qs_ctx("

Warning:
" \ - "This is a non RFC 1413 compliant Ident daemon that implements " \ - "only a limited subset of the Identification Protocol specifications.
" \ - "On UNIX, you may also need root privileges to bind to the auth port (113).
" \ - "It is highly recommended that a real system-wide Ident daemon be used instead, "\ - "or none at all if Ident is not required.

","options") + __tr2qs_ctx("

Warning:
" + "This is a non RFC 1413 compliant Ident daemon that implements " + "only a limited subset of the Identification Protocol specifications.
" + "On UNIX, you may also need root privileges to bind to the auth port (113).
" + "It is highly recommended that a real system-wide Ident daemon be used instead, " + "or none at all if Ident is not required.

", + "options") #endif - ); + ); - addRowSpacer(0,5,0,5); + addRowSpacer(0, 5, 0, 5); } OptionsWidget_identService::~OptionsWidget_identService() @@ -285,11 +285,11 @@ void OptionsWidget_identService::commit() { KviOptionsWidget::commit(); if(m_pConsoleRadio->isChecked()) - KVI_OPTION_UINT(KviOption_uintIdentdOutputMode)=KviIdentdOutputMode::ToConsole; + KVI_OPTION_UINT(KviOption_uintIdentdOutputMode) = KviIdentdOutputMode::ToConsole; if(m_pActiveRadio->isChecked()) - KVI_OPTION_UINT(KviOption_uintIdentdOutputMode)=KviIdentdOutputMode::ToActiveWindow; + KVI_OPTION_UINT(KviOption_uintIdentdOutputMode) = KviIdentdOutputMode::ToActiveWindow; if(m_pQuietRadio->isChecked()) - KVI_OPTION_UINT(KviOption_uintIdentdOutputMode)=KviIdentdOutputMode::Quiet; + KVI_OPTION_UINT(KviOption_uintIdentdOutputMode) = KviIdentdOutputMode::Quiet; } void OptionsWidget_identService::enableIpv4InIpv6(bool) @@ -299,9 +299,8 @@ void OptionsWidget_identService::enableIpv4InIpv6(bool) #endif } - OptionsWidget_connectionAdvanced::OptionsWidget_connectionAdvanced(QWidget * parent) -: KviOptionsWidget(parent) + : KviOptionsWidget(parent) { setObjectName("connection_advanced_options_widget"); } diff --git a/src/modules/options/OptionsWidget_connection.h b/src/modules/options/OptionsWidget_connection.h index 60d29c810..96908ead0 100644 --- a/src/modules/options/OptionsWidget_connection.h +++ b/src/modules/options/OptionsWidget_connection.h @@ -93,6 +93,7 @@ public: ~OptionsWidget_identService(); virtual void commit(); + protected: KviBoolSelector * m_pEnableIdent; KviBoolSelector * m_pEnableIpv6; @@ -105,5 +106,4 @@ public slots: void enableIpv4InIpv6(bool); }; - #endif //_OPTW_CONNECTION_H_ diff --git a/src/modules/options/OptionsWidget_ctcp.cpp b/src/modules/options/OptionsWidget_ctcp.cpp index 2363be882..634551ad8 100644 --- a/src/modules/options/OptionsWidget_ctcp.cpp +++ b/src/modules/options/OptionsWidget_ctcp.cpp @@ -28,54 +28,51 @@ #include "KviLocale.h" #include "KviOptions.h" - OptionsWidget_ctcp::OptionsWidget_ctcp(QWidget * parent) -: KviOptionsWidget(parent) + : KviOptionsWidget(parent) { setObjectName("ctcp_options_widget"); createLayout(); - addLabel(0,0,0,0,__tr2qs_ctx("

The Client-to-client protocol (CTCP) " \ - "is used to transmit special control messages over an IRC connection. " \ - "These messages can request information from clients or negotiate file transfers." \ - "

","options")); - + addLabel(0, 0, 0, 0, __tr2qs_ctx("

The Client-to-client protocol (CTCP) " + "is used to transmit special control messages over an IRC connection. " + "These messages can request information from clients or negotiate file transfers." + "

", + "options")); - KviTalGroupBox *gs = addGroupBox(0,1,0,1,Qt::Horizontal,__tr2qs_ctx("CTCP Replies","options")); - KviStringSelector * s = addStringSelector(gs, __tr2qs_ctx("Append to VERSION reply:","options"),KviOption_stringCtcpVersionPostfix); + KviTalGroupBox * gs = addGroupBox(0, 1, 0, 1, Qt::Horizontal, __tr2qs_ctx("CTCP Replies", "options")); + KviStringSelector * s = addStringSelector(gs, __tr2qs_ctx("Append to VERSION reply:", "options"), KviOption_stringCtcpVersionPostfix); s->setMinimumLabelWidth(200); mergeTip(s, - __tr2qs_ctx("This text will be appended to the CTCP VERSION reply.
For example, you can place a script name here.","options")); + __tr2qs_ctx("This text will be appended to the CTCP VERSION reply.
For example, you can place a script name here.", "options")); - s = addStringSelector(gs, __tr2qs_ctx("Append to SOURCE reply:","options"),KviOption_stringCtcpSourcePostfix); + s = addStringSelector(gs, __tr2qs_ctx("Append to SOURCE reply:", "options"), KviOption_stringCtcpSourcePostfix); s->setMinimumLabelWidth(200); mergeTip(s, - __tr2qs_ctx("This text will be appended to the CTCP SOURCE reply.
For example, you can place the source URL for a script here.","options")); + __tr2qs_ctx("This text will be appended to the CTCP SOURCE reply.
For example, you can place the source URL for a script here.", "options")); -// s = addStringSelector(gs, __tr2qs_ctx("USERINFO reply:","options"),KviOption_stringCtcpUserinfoReply); + // s = addStringSelector(gs, __tr2qs_ctx("USERINFO reply:","options"),KviOption_stringCtcpUserinfoReply); -// mergeTip(s, -// __tr2qs_ctx("This is the CTCP USERINFO reply.
It can contain some information about yourself.","options")); + // mergeTip(s, + // __tr2qs_ctx("This is the CTCP USERINFO reply.
It can contain some information about yourself.","options")); - s = addStringSelector(gs, __tr2qs_ctx("PAGE reply:","options"),KviOption_stringCtcpPageReply); + s = addStringSelector(gs, __tr2qs_ctx("PAGE reply:", "options"), KviOption_stringCtcpPageReply); s->setMinimumLabelWidth(200); mergeTip(s, - __tr2qs_ctx("This is the CTCP PAGE reply.
It should contain some sort of acknowledgment for CTCP PAGE messages.","options")); + __tr2qs_ctx("This is the CTCP PAGE reply.
It should contain some sort of acknowledgment for CTCP PAGE messages.", "options")); - addBoolSelector(gs,__tr2qs_ctx("Show the CTCP replies in the active window","options"),KviOption_boolCtcpRepliesToActiveWindow); + addBoolSelector(gs, __tr2qs_ctx("Show the CTCP replies in the active window", "options"), KviOption_boolCtcpRepliesToActiveWindow); - addBoolSelector(gs,__tr2qs_ctx("Show dialog for CTCP page requests","options"),KviOption_boolShowDialogOnCtcpPage); - addBoolSelector(gs,__tr2qs_ctx("Show dialog for channel CTCP page requests","options"),KviOption_boolShowDialogOnChannelCtcpPage); - - addRowSpacer(0,3,0,3); + addBoolSelector(gs, __tr2qs_ctx("Show dialog for CTCP page requests", "options"), KviOption_boolShowDialogOnCtcpPage); + addBoolSelector(gs, __tr2qs_ctx("Show dialog for channel CTCP page requests", "options"), KviOption_boolShowDialogOnChannelCtcpPage); + addRowSpacer(0, 3, 0, 3); } - OptionsWidget_ctcp::~OptionsWidget_ctcp() { } diff --git a/src/modules/options/OptionsWidget_ctcp.h b/src/modules/options/OptionsWidget_ctcp.h index 82c483921..4d1d377da 100644 --- a/src/modules/options/OptionsWidget_ctcp.h +++ b/src/modules/options/OptionsWidget_ctcp.h @@ -39,5 +39,4 @@ public: ~OptionsWidget_ctcp(); }; - #endif //_OPTW_CTCP_H_ diff --git a/src/modules/options/OptionsWidget_ctcpFloodProtection.cpp b/src/modules/options/OptionsWidget_ctcpFloodProtection.cpp index 0de4254cd..d4972b4ca 100644 --- a/src/modules/options/OptionsWidget_ctcpFloodProtection.cpp +++ b/src/modules/options/OptionsWidget_ctcpFloodProtection.cpp @@ -30,7 +30,6 @@ #include #include - /* @doc: ctcpfloodprotectionoptions @type: @@ -72,40 +71,39 @@ see the [widget:ctcpavatarprotooptions]CTCP AVATAR protocol options[/widget] and [widget:ctcpdccprotooptions]CTCP DCC protocol options[/widget].[br] */ - OptionsWidget_ctcpFloodProtection::OptionsWidget_ctcpFloodProtection(QWidget * parent) -: KviOptionsWidget(parent) + : KviOptionsWidget(parent) { setObjectName("ctcpfloodprotection_options_widget"); createLayout(); - KviBoolSelector * b = addBoolSelector(0,0,1,0,__tr2qs_ctx("Use flood protection for CTCP requests (recommended)","options"),KviOption_boolUseCtcpFloodProtection); - mergeTip(b,__tr2qs_ctx("This option makes KVIrc only respond to a limited number of CTCP requests within a specified time interval, to prevent \"flooding\" CTCP messages.","options")); + KviBoolSelector * b = addBoolSelector(0, 0, 1, 0, __tr2qs_ctx("Use flood protection for CTCP requests (recommended)", "options"), KviOption_boolUseCtcpFloodProtection); + mergeTip(b, __tr2qs_ctx("This option makes KVIrc only respond to a limited number of CTCP requests within a specified time interval, to prevent \"flooding\" CTCP messages.", "options")); - KviUIntSelector * u = addUIntSelector(0,1,0,1,__tr2qs_ctx("Allow up to:","options"),KviOption_uintMaxCtcpRequests,0,10000,3,KVI_OPTION_BOOL(KviOption_boolUseCtcpFloodProtection)); - u->setSuffix(__tr2qs_ctx(" requests","options")); - mergeTip(u,__tr2qs_ctx("Minimum value: 0 requests
Maximum value: 10000 requests","options")); - connect(b,SIGNAL(toggled(bool)),u,SLOT(setEnabled(bool))); + KviUIntSelector * u = addUIntSelector(0, 1, 0, 1, __tr2qs_ctx("Allow up to:", "options"), KviOption_uintMaxCtcpRequests, 0, 10000, 3, KVI_OPTION_BOOL(KviOption_boolUseCtcpFloodProtection)); + u->setSuffix(__tr2qs_ctx(" requests", "options")); + mergeTip(u, __tr2qs_ctx("Minimum value: 0 requests
Maximum value: 10000 requests", "options")); + connect(b, SIGNAL(toggled(bool)), u, SLOT(setEnabled(bool))); - u = addUIntSelector(1,1,1,1,__tr2qs_ctx("within:","options"),KviOption_uintCtcpFloodCheckInterval,1,3600,6,KVI_OPTION_BOOL(KviOption_boolUseCtcpFloodProtection)); - u->setSuffix(__tr2qs_ctx(" sec","options")); - mergeTip(u,__tr2qs_ctx("Minimum value: 1 sec
Maximum value: 3600 sec","options")); - connect(b,SIGNAL(toggled(bool)),u,SLOT(setEnabled(bool))); + u = addUIntSelector(1, 1, 1, 1, __tr2qs_ctx("within:", "options"), KviOption_uintCtcpFloodCheckInterval, 1, 3600, 6, KVI_OPTION_BOOL(KviOption_boolUseCtcpFloodProtection)); + u->setSuffix(__tr2qs_ctx(" sec", "options")); + mergeTip(u, __tr2qs_ctx("Minimum value: 1 sec
Maximum value: 3600 sec", "options")); + connect(b, SIGNAL(toggled(bool)), u, SLOT(setEnabled(bool))); - KviTalGroupBox * g = addGroupBox(0,2,1,2,Qt::Horizontal,__tr2qs_ctx("Ignored CTCP Requests","options")); - addBoolSelector(g,__tr2qs_ctx("PING","options"),KviOption_boolIgnoreCtcpPing); - addBoolSelector(g,__tr2qs_ctx("FINGER","options"),KviOption_boolIgnoreCtcpFinger); - addBoolSelector(g,__tr2qs_ctx("CLIENTINFO","options"),KviOption_boolIgnoreCtcpClientinfo); - addBoolSelector(g,__tr2qs_ctx("USERINFO","options"),KviOption_boolIgnoreCtcpUserinfo); - addBoolSelector(g,__tr2qs_ctx("VERSION","options"),KviOption_boolIgnoreCtcpVersion); - addBoolSelector(g,__tr2qs_ctx("SOURCE","options"),KviOption_boolIgnoreCtcpSource); - addBoolSelector(g,__tr2qs_ctx("TIME","options"),KviOption_boolIgnoreCtcpTime); - addBoolSelector(g,__tr2qs_ctx("PAGE","options"),KviOption_boolIgnoreCtcpPage); - addBoolSelector(g,__tr2qs_ctx("AVATAR","options"),KviOption_boolIgnoreCtcpAvatar); - addBoolSelector(g,__tr2qs_ctx("DCC/TDCC","options"),KviOption_boolIgnoreCtcpDcc); + KviTalGroupBox * g = addGroupBox(0, 2, 1, 2, Qt::Horizontal, __tr2qs_ctx("Ignored CTCP Requests", "options")); + addBoolSelector(g, __tr2qs_ctx("PING", "options"), KviOption_boolIgnoreCtcpPing); + addBoolSelector(g, __tr2qs_ctx("FINGER", "options"), KviOption_boolIgnoreCtcpFinger); + addBoolSelector(g, __tr2qs_ctx("CLIENTINFO", "options"), KviOption_boolIgnoreCtcpClientinfo); + addBoolSelector(g, __tr2qs_ctx("USERINFO", "options"), KviOption_boolIgnoreCtcpUserinfo); + addBoolSelector(g, __tr2qs_ctx("VERSION", "options"), KviOption_boolIgnoreCtcpVersion); + addBoolSelector(g, __tr2qs_ctx("SOURCE", "options"), KviOption_boolIgnoreCtcpSource); + addBoolSelector(g, __tr2qs_ctx("TIME", "options"), KviOption_boolIgnoreCtcpTime); + addBoolSelector(g, __tr2qs_ctx("PAGE", "options"), KviOption_boolIgnoreCtcpPage); + addBoolSelector(g, __tr2qs_ctx("AVATAR", "options"), KviOption_boolIgnoreCtcpAvatar); + addBoolSelector(g, __tr2qs_ctx("DCC/TDCC", "options"), KviOption_boolIgnoreCtcpDcc); - addRowSpacer(0,3,1,3); + addRowSpacer(0, 3, 1, 3); } OptionsWidget_ctcpFloodProtection::~OptionsWidget_ctcpFloodProtection() diff --git a/src/modules/options/OptionsWidget_ctcpFloodProtection.h b/src/modules/options/OptionsWidget_ctcpFloodProtection.h index 751746de6..174361ac8 100644 --- a/src/modules/options/OptionsWidget_ctcpFloodProtection.h +++ b/src/modules/options/OptionsWidget_ctcpFloodProtection.h @@ -33,7 +33,7 @@ class OptionsWidget_ctcpFloodProtection : public KviOptionsWidget { Q_OBJECT -// Q_CLASSINFO("help","ctcpfloodprotectionoptions") + // Q_CLASSINFO("help","ctcpfloodprotectionoptions") public: OptionsWidget_ctcpFloodProtection(QWidget * parent); ~OptionsWidget_ctcpFloodProtection(); diff --git a/src/modules/options/OptionsWidget_dcc.cpp b/src/modules/options/OptionsWidget_dcc.cpp index 4c2d863a0..0f4773476 100644 --- a/src/modules/options/OptionsWidget_dcc.cpp +++ b/src/modules/options/OptionsWidget_dcc.cpp @@ -29,9 +29,8 @@ #include - OptionsWidget_dcc::OptionsWidget_dcc(QWidget * pParent) -: KviOptionsWidget(pParent) + : KviOptionsWidget(pParent) { } @@ -39,28 +38,27 @@ OptionsWidget_dcc::~OptionsWidget_dcc() { } - OptionsWidget_dccGeneral::OptionsWidget_dccGeneral(QWidget * parent) -: KviOptionsWidget(parent) + : KviOptionsWidget(parent) { setObjectName("dccgeneral_options_widget"); createLayout(); - KviBoolSelector * b = addBoolSelector(0,0,0,0,__tr2qs_ctx("Use workaround for firewall","options"),KviOption_boolCantAcceptIncomingDccConnections); - mergeTip(b,__tr2qs_ctx("Enable this option if you can't accept incoming connections.
" \ - "KVIrc will try to use different methods to send and receive files.
" \ - "Please note that these methods may NOT work when communicating with a non-KVIrc client.","options")); + KviBoolSelector * b = addBoolSelector(0, 0, 0, 0, __tr2qs_ctx("Use workaround for firewall", "options"), KviOption_boolCantAcceptIncomingDccConnections); + mergeTip(b, __tr2qs_ctx("Enable this option if you can't accept incoming connections.
" + "KVIrc will try to use different methods to send and receive files.
" + "Please note that these methods may NOT work when communicating with a non-KVIrc client.", + "options")); - addRowSpacer(0,1,0,1); + addRowSpacer(0, 1, 0, 1); } OptionsWidget_dccGeneral::~OptionsWidget_dccGeneral() { } - OptionsWidget_dccAdvanced::OptionsWidget_dccAdvanced(QWidget * parent) -: KviOptionsWidget(parent) + : KviOptionsWidget(parent) { setObjectName("dccgeneral_options_widget"); createLayout(); @@ -71,90 +69,97 @@ OptionsWidget_dccAdvanced::OptionsWidget_dccAdvanced(QWidget * parent) KviStringSelector * s; KviUIntSelector * u; - g = addGroupBox(0,0,0,0,Qt::Horizontal,__tr2qs_ctx("Network Properties","options")); + g = addGroupBox(0, 0, 0, 0, Qt::Horizontal, __tr2qs_ctx("Network Properties", "options")); - b = addBoolSelector(g,__tr2qs_ctx("Use user-defined address or network interface","options"),KviOption_boolDccListenOnSpecifiedInterfaceByDefault); - mergeTip(b,__tr2qs_ctx("Enable this option if you are on a multihost machine and want " \ - "to force one of the available IP addresses to be used for outgoing DCCs.
This is especially useful " \ - "when you use IPv6 and IPv4 addresses.
You can force KVIrc to always choose the IPv4 interface.","options")); + b = addBoolSelector(g, __tr2qs_ctx("Use user-defined address or network interface", "options"), KviOption_boolDccListenOnSpecifiedInterfaceByDefault); + mergeTip(b, __tr2qs_ctx("Enable this option if you are on a multihost machine and want " + "to force one of the available IP addresses to be used for outgoing DCCs.
This is especially useful " + "when you use IPv6 and IPv4 addresses.
You can force KVIrc to always choose the IPv4 interface.", + "options")); - s = addStringSelector(g,__tr2qs_ctx("Listen on address/interface:","options"),KviOption_stringDccListenDefaultInterface, - KVI_OPTION_BOOL(KviOption_boolDccListenOnSpecifiedInterfaceByDefault)); - mergeTip(s,__tr2qs_ctx("This is the IP address or name of the interface to use by default for outgoing DCC transfers.
" \ - "On UNIX systems that support it, you can also specify IPv4 interface names (such as ppp0).
" \ - "If you set it to 0.0.0.0, KVIrc will try to use the first available IPv4 interface","options")); + s = addStringSelector(g, __tr2qs_ctx("Listen on address/interface:", "options"), KviOption_stringDccListenDefaultInterface, + KVI_OPTION_BOOL(KviOption_boolDccListenOnSpecifiedInterfaceByDefault)); + mergeTip(s, __tr2qs_ctx("This is the IP address or name of the interface to use by default for outgoing DCC transfers.
" + "On UNIX systems that support it, you can also specify IPv4 interface names (such as ppp0).
" + "If you set it to 0.0.0.0, KVIrc will try to use the first available IPv4 interface", + "options")); - connect(b,SIGNAL(toggled(bool)),s,SLOT(setEnabled(bool))); + connect(b, SIGNAL(toggled(bool)), s, SLOT(setEnabled(bool))); - b = addBoolSelector(g,__tr2qs_ctx("Use user-defined port range","options"),KviOption_boolUserDefinedPortRange); - mergeTip(b,__tr2qs_ctx("Enable this option if you want specify a local port range for DCC.","options")); + b = addBoolSelector(g, __tr2qs_ctx("Use user-defined port range", "options"), KviOption_boolUserDefinedPortRange); + mergeTip(b, __tr2qs_ctx("Enable this option if you want specify a local port range for DCC.", "options")); KviTalHBox * hb = new KviTalHBox(g); hb->setSpacing(4); - u = addUIntSelector(hb,__tr2qs_ctx("Lowest port:","options"),KviOption_uintDccMinPort,1,65535,5000, - KVI_OPTION_BOOL(KviOption_boolUserDefinedPortRange)); - connect(b,SIGNAL(toggled(bool)),u,SLOT(setEnabled(bool))); - - u = addUIntSelector(hb,__tr2qs_ctx("Highest port:","options"),KviOption_uintDccMaxPort,1,65535,30000, - KVI_OPTION_BOOL(KviOption_boolUserDefinedPortRange)); - connect(b,SIGNAL(toggled(bool)),u,SLOT(setEnabled(bool))); - - b = addBoolSelector(g,__tr2qs_ctx("Send a fixed address in requests","options"),KviOption_boolDccSendFakeAddressByDefault); - mergeTip(b,__tr2qs_ctx("Enable this option if you want to always send a fake IP address in your DCC requests.
" \ - "This might be useful if you're behind a router with a static address that does network address " \ - "translation (NAT) and forwards all or a range of ports.","options")); - - s = addStringSelector(g,__tr2qs_ctx("Send address/interface:","options"),KviOption_stringDefaultDccFakeAddress, - KVI_OPTION_BOOL(KviOption_boolDccSendFakeAddressByDefault)); - connect(b,SIGNAL(toggled(bool)),s,SLOT(setEnabled(bool))); - mergeTip(s,__tr2qs_ctx("This is the fixed address that will be sent with all DCC requests if you enable the option above.","options")); - - b2 = addBoolSelector(g,__tr2qs_ctx("Guess address from IRC server if unroutable","options"),KviOption_boolDccGuessIpFromServerWhenLocalIsUnroutable, - !KVI_OPTION_BOOL(KviOption_boolDccSendFakeAddressByDefault)); - - connect(b,SIGNAL(toggled(bool)),b2,SLOT(setNotEnabled(bool))); - - mergeTip(b2,__tr2qs_ctx("You can enable this option if you are behind a router that forwards all or a range of ports.
" \ - "KVIrc will try to guess the IP address to use for DCC by looking up the local hostname as seen " \ - "by the IRC server you're connected to.
This method is an exclusive alternative to the \"fixed address\" above.
" \ - "It might guess the correct address automatically if certain conditions are met (e.g. the IRC server doesn't mask hostnames).","options")); - - b = addBoolSelector(g,__tr2qs_ctx("Use \"broken bouncer hack\" to detect address","options"),KviOption_boolDccBrokenBouncerHack, - KVI_OPTION_BOOL(KviOption_boolDccGuessIpFromServerWhenLocalIsUnroutable)); - mergeTip(b,__tr2qs_ctx("When you're behind a dialup router and also tunneling through a psyBNC bouncer, " \ - "you can use a bug in the bouncer to force KVIrc to bind the DCC connections to the dialup router's address.
" \ - "It's an ugly hack - use it only if nothing else works.","options")); - - connect(b2,SIGNAL(toggled(bool)),b,SLOT(setEnabled(bool))); - - b = addBoolSelector(0,1,1,1,__tr2qs_ctx("Notify failed DCC handshakes to the remote end","options"),KviOption_boolNotifyFailedDccHandshakes); - mergeTip(b,__tr2qs_ctx("If you enable this option, when a DCC request from a remote " \ - "user can't be satisfied KVIrc will notify him by a CTCP ERRMSG. This is " \ - "a nice feature so it is a good idea to leave it on unless for some reason " \ - "you have deactivated the anti-flood system: in this case turning off this option " \ - "might help if you often get attacked by CTCP floods.","options")); - - u = addUIntSelector(0,2,1,2,__tr2qs_ctx("Maximum number of DCC sessions:","options"),KviOption_uintMaxDccSlots,0,1000,64); - mergeTip(u,__tr2qs_ctx("This is the maximum number of concurrent DCC sessions " \ - "and it includes all the DCC types (send, chat, recv...). " \ - "KVIrc will refuse the requests when this limit is reached.","options")); - - u = addUIntSelector(0,3,1,3,__tr2qs_ctx("DCC socket timeout:","options"),KviOption_uintDccSocketTimeout,10,65536,180); - u->setSuffix(__tr2qs_ctx(" sec","options")); - mergeTip(u,__tr2qs_ctx("This is the amount of time that KVIrc will wait for a response before assuming that a DCC has failed " \ - "because the remote client was unable to connect to our listening socket.","options")); - - addRowSpacer(0,4,1,4); + u = addUIntSelector(hb, __tr2qs_ctx("Lowest port:", "options"), KviOption_uintDccMinPort, 1, 65535, 5000, + KVI_OPTION_BOOL(KviOption_boolUserDefinedPortRange)); + connect(b, SIGNAL(toggled(bool)), u, SLOT(setEnabled(bool))); + + u = addUIntSelector(hb, __tr2qs_ctx("Highest port:", "options"), KviOption_uintDccMaxPort, 1, 65535, 30000, + KVI_OPTION_BOOL(KviOption_boolUserDefinedPortRange)); + connect(b, SIGNAL(toggled(bool)), u, SLOT(setEnabled(bool))); + + b = addBoolSelector(g, __tr2qs_ctx("Send a fixed address in requests", "options"), KviOption_boolDccSendFakeAddressByDefault); + mergeTip(b, __tr2qs_ctx("Enable this option if you want to always send a fake IP address in your DCC requests.
" + "This might be useful if you're behind a router with a static address that does network address " + "translation (NAT) and forwards all or a range of ports.", + "options")); + + s = addStringSelector(g, __tr2qs_ctx("Send address/interface:", "options"), KviOption_stringDefaultDccFakeAddress, + KVI_OPTION_BOOL(KviOption_boolDccSendFakeAddressByDefault)); + connect(b, SIGNAL(toggled(bool)), s, SLOT(setEnabled(bool))); + mergeTip(s, __tr2qs_ctx("This is the fixed address that will be sent with all DCC requests if you enable the option above.", "options")); + + b2 = addBoolSelector(g, __tr2qs_ctx("Guess address from IRC server if unroutable", "options"), KviOption_boolDccGuessIpFromServerWhenLocalIsUnroutable, + !KVI_OPTION_BOOL(KviOption_boolDccSendFakeAddressByDefault)); + + connect(b, SIGNAL(toggled(bool)), b2, SLOT(setNotEnabled(bool))); + + mergeTip(b2, __tr2qs_ctx("You can enable this option if you are behind a router that forwards all or a range of ports.
" + "KVIrc will try to guess the IP address to use for DCC by looking up the local hostname as seen " + "by the IRC server you're connected to.
This method is an exclusive alternative to the \"fixed address\" above.
" + "It might guess the correct address automatically if certain conditions are met (e.g. the IRC server doesn't mask hostnames).", + "options")); + + b = addBoolSelector(g, __tr2qs_ctx("Use \"broken bouncer hack\" to detect address", "options"), KviOption_boolDccBrokenBouncerHack, + KVI_OPTION_BOOL(KviOption_boolDccGuessIpFromServerWhenLocalIsUnroutable)); + mergeTip(b, __tr2qs_ctx("When you're behind a dialup router and also tunneling through a psyBNC bouncer, " + "you can use a bug in the bouncer to force KVIrc to bind the DCC connections to the dialup router's address.
" + "It's an ugly hack - use it only if nothing else works.", + "options")); + + connect(b2, SIGNAL(toggled(bool)), b, SLOT(setEnabled(bool))); + + b = addBoolSelector(0, 1, 1, 1, __tr2qs_ctx("Notify failed DCC handshakes to the remote end", "options"), KviOption_boolNotifyFailedDccHandshakes); + mergeTip(b, __tr2qs_ctx("If you enable this option, when a DCC request from a remote " + "user can't be satisfied KVIrc will notify him by a CTCP ERRMSG. This is " + "a nice feature so it is a good idea to leave it on unless for some reason " + "you have deactivated the anti-flood system: in this case turning off this option " + "might help if you often get attacked by CTCP floods.", + "options")); + + u = addUIntSelector(0, 2, 1, 2, __tr2qs_ctx("Maximum number of DCC sessions:", "options"), KviOption_uintMaxDccSlots, 0, 1000, 64); + mergeTip(u, __tr2qs_ctx("This is the maximum number of concurrent DCC sessions " + "and it includes all the DCC types (send, chat, recv...). " + "KVIrc will refuse the requests when this limit is reached.", + "options")); + + u = addUIntSelector(0, 3, 1, 3, __tr2qs_ctx("DCC socket timeout:", "options"), KviOption_uintDccSocketTimeout, 10, 65536, 180); + u->setSuffix(__tr2qs_ctx(" sec", "options")); + mergeTip(u, __tr2qs_ctx("This is the amount of time that KVIrc will wait for a response before assuming that a DCC has failed " + "because the remote client was unable to connect to our listening socket.", + "options")); + + addRowSpacer(0, 4, 1, 4); } OptionsWidget_dccAdvanced::~OptionsWidget_dccAdvanced() { } - OptionsWidget_dccSend::OptionsWidget_dccSend(QWidget * parent) -: KviOptionsWidget(parent) + : KviOptionsWidget(parent) { setObjectName("dccsend_options_widget"); } @@ -163,9 +168,8 @@ OptionsWidget_dccSend::~OptionsWidget_dccSend() { } - OptionsWidget_dccSendGeneral::OptionsWidget_dccSendGeneral(QWidget * parent) -: KviOptionsWidget(parent) + : KviOptionsWidget(parent) { setObjectName("dccsend_options_widget"); createLayout(); @@ -177,51 +181,53 @@ OptionsWidget_dccSendGeneral::OptionsWidget_dccSendGeneral(QWidget * parent) KviBoolSelector * b1; KviTalGroupBox * g; - g = addGroupBox(0,0,0,0,Qt::Horizontal,__tr2qs_ctx("On Incoming File","options")); - b2 = addBoolSelector(g,__tr2qs_ctx("Automatically accept","options"),KviOption_boolAutoAcceptDccSend); - b3 = addBoolSelector(g, __tr2qs_ctx("Open auto-accepted transfer window without focus","options"),KviOption_boolCreateMinimizedDccSendWhenAutoAccepted, - !KVI_OPTION_BOOL(KviOption_boolCreateMinimizedDccSend)); - mergeTip(b3,__tr2qs_ctx("This option prevents the transfer window " \ - "from opening and diverting application focus.
" \ - "Enable this if you don't like the transfer window " \ - "popping up while you're typing something in a channel.","options")); - - b4 = addBoolSelector(g,__tr2qs_ctx("Automatically resume when auto-accepted","options"),KviOption_boolAutoResumeDccSendWhenAutoAccepted, - KVI_OPTION_BOOL(KviOption_boolAutoAcceptDccSend)); - - g = addGroupBox(0,1,0,1,Qt::Horizontal,__tr2qs_ctx("Save Location","options")); - - addDirectorySelector(g,__tr2qs_ctx("Download folder:","options"),KviOption_stringIncomingPath); - addBoolSelector(g,__tr2qs_ctx("Sort saved files by nicknames (create subfolders)","options"),KviOption_boolSortReceivedByDccFilesByNicks); - addBoolSelector(g,__tr2qs_ctx("Guess save path from media type","options"),KviOption_boolUseIncomingDccMediaTypeSavePath); - - g = addGroupBox(0,2,0,2,Qt::Horizontal,__tr2qs_ctx("On Download Completion","options")); - - addBoolSelector(g,__tr2qs_ctx("Notify completion in console","options"),KviOption_boolNotifyDccSendSuccessInConsole); - addBoolSelector(g,__tr2qs_ctx("Notify completion in notifier","options"),KviOption_boolNotifyDccSendSuccessInNotifier); - b = addBoolSelector(g,__tr2qs_ctx("Automatically clear transfer","options"),KviOption_boolAutoCloseDccSendOnSuccess); - mergeTip(b,__tr2qs_ctx("This option will cause successfully terminated transfers " \ - "to be automatically removed from the transfer window.","options")); - - b1 = addBoolSelector(0,3,0,3, __tr2qs_ctx("Open transfer window without focus","options"), KviOption_boolCreateMinimizedDccSend); - mergeTip(b1,__tr2qs_ctx("This option prevents the transfer window " \ - "from opening and diverting application focus.
" \ - "Enable this if you don't like the transfer window " \ - "popping up while you're typing something in a channel.","options")); - - connect(b1,SIGNAL(toggled(bool)),b3,SLOT(setNotEnabled(bool))); - connect(b2,SIGNAL(toggled(bool)),b4,SLOT(setEnabled(bool))); - - addRowSpacer(0,4,0,4); + g = addGroupBox(0, 0, 0, 0, Qt::Horizontal, __tr2qs_ctx("On Incoming File", "options")); + b2 = addBoolSelector(g, __tr2qs_ctx("Automatically accept", "options"), KviOption_boolAutoAcceptDccSend); + b3 = addBoolSelector(g, __tr2qs_ctx("Open auto-accepted transfer window without focus", "options"), KviOption_boolCreateMinimizedDccSendWhenAutoAccepted, + !KVI_OPTION_BOOL(KviOption_boolCreateMinimizedDccSend)); + mergeTip(b3, __tr2qs_ctx("This option prevents the transfer window " + "from opening and diverting application focus.
" + "Enable this if you don't like the transfer window " + "popping up while you're typing something in a channel.", + "options")); + + b4 = addBoolSelector(g, __tr2qs_ctx("Automatically resume when auto-accepted", "options"), KviOption_boolAutoResumeDccSendWhenAutoAccepted, + KVI_OPTION_BOOL(KviOption_boolAutoAcceptDccSend)); + + g = addGroupBox(0, 1, 0, 1, Qt::Horizontal, __tr2qs_ctx("Save Location", "options")); + + addDirectorySelector(g, __tr2qs_ctx("Download folder:", "options"), KviOption_stringIncomingPath); + addBoolSelector(g, __tr2qs_ctx("Sort saved files by nicknames (create subfolders)", "options"), KviOption_boolSortReceivedByDccFilesByNicks); + addBoolSelector(g, __tr2qs_ctx("Guess save path from media type", "options"), KviOption_boolUseIncomingDccMediaTypeSavePath); + + g = addGroupBox(0, 2, 0, 2, Qt::Horizontal, __tr2qs_ctx("On Download Completion", "options")); + + addBoolSelector(g, __tr2qs_ctx("Notify completion in console", "options"), KviOption_boolNotifyDccSendSuccessInConsole); + addBoolSelector(g, __tr2qs_ctx("Notify completion in notifier", "options"), KviOption_boolNotifyDccSendSuccessInNotifier); + b = addBoolSelector(g, __tr2qs_ctx("Automatically clear transfer", "options"), KviOption_boolAutoCloseDccSendOnSuccess); + mergeTip(b, __tr2qs_ctx("This option will cause successfully terminated transfers " + "to be automatically removed from the transfer window.", + "options")); + + b1 = addBoolSelector(0, 3, 0, 3, __tr2qs_ctx("Open transfer window without focus", "options"), KviOption_boolCreateMinimizedDccSend); + mergeTip(b1, __tr2qs_ctx("This option prevents the transfer window " + "from opening and diverting application focus.
" + "Enable this if you don't like the transfer window " + "popping up while you're typing something in a channel.", + "options")); + + connect(b1, SIGNAL(toggled(bool)), b3, SLOT(setNotEnabled(bool))); + connect(b2, SIGNAL(toggled(bool)), b4, SLOT(setEnabled(bool))); + + addRowSpacer(0, 4, 0, 4); } OptionsWidget_dccSendGeneral::~OptionsWidget_dccSendGeneral() { } - OptionsWidget_dccSendAdvanced::OptionsWidget_dccSendAdvanced(QWidget * parent) -: KviOptionsWidget(parent) + : KviOptionsWidget(parent) { setObjectName("dccsend_advanced_options_widget"); createLayout(); @@ -229,93 +235,102 @@ OptionsWidget_dccSendAdvanced::OptionsWidget_dccSendAdvanced(QWidget * parent) KviBoolSelector * b; KviTalGroupBox * g; KviUIntSelector * u; - - g = addGroupBox(0,0,0,0,Qt::Horizontal,__tr2qs_ctx("Bug Compatibility","options")); - b = addBoolSelector(g,__tr2qs_ctx("Send ACK for byte 0","options"),KviOption_boolSendZeroAckInDccRecv); - mergeTip(b,__tr2qs_ctx("This option causes KVIrc to send a zero-byte acknowledge to kick-start " \ - "the DCC transfer with some buggy IRC clients.
" \ - "Use it only if your DCC transfers stall just after establishing a connection without sending any data.","options")); + g = addGroupBox(0, 0, 0, 0, Qt::Horizontal, __tr2qs_ctx("Bug Compatibility", "options")); - b = addBoolSelector(g,__tr2qs_ctx("Accept RESUME requests with broken filename (mIRC file.ext)","options"),KviOption_boolAcceptBrokenFileNameDccResumeRequests); - mergeTip(b,__tr2qs_ctx("This option causes KVIrc to accept RESUME requests with invalid filenames.
" \ - "Use it if KVIrc fails to accept RESUME requests from other clients (e.g. some versions of mIRC).","options")); + b = addBoolSelector(g, __tr2qs_ctx("Send ACK for byte 0", "options"), KviOption_boolSendZeroAckInDccRecv); + mergeTip(b, __tr2qs_ctx("This option causes KVIrc to send a zero-byte acknowledge to kick-start " + "the DCC transfer with some buggy IRC clients.
" + "Use it only if your DCC transfers stall just after establishing a connection without sending any data.", + "options")); - b = addBoolSelector(g,__tr2qs_ctx("Accept RESUME requests with mismatched ports","options"),KviOption_boolAcceptMismatchedPortDccResumeRequests); - mergeTip(b,__tr2qs_ctx("This option causes KVIrc to accept RESUME requests with mismatched ports.
" \ - "Use it if some router on the path between you and the receiver remaps the ports in DCC SEND " \ - "but not in DCC RESUME requests.
Please note that this option may misbehave in certain usage " \ - "patterns since KVIrc must differentiate between transfers only by looking at the filename. Be careful.","options")); + b = addBoolSelector(g, __tr2qs_ctx("Accept RESUME requests with broken filename (mIRC file.ext)", "options"), KviOption_boolAcceptBrokenFileNameDccResumeRequests); + mergeTip(b, __tr2qs_ctx("This option causes KVIrc to accept RESUME requests with invalid filenames.
" + "Use it if KVIrc fails to accept RESUME requests from other clients (e.g. some versions of mIRC).", + "options")); - b = addBoolSelector(g,__tr2qs_ctx("Replace spaces with underscores in outgoing filenames","options"),KviOption_boolDCCFileTransferReplaceOutgoingSpacesWithUnderscores); - mergeTip(b,__tr2qs_ctx("This option causes KVIrc to replace spaces with underscores in filenames " \ - "for all the outgoing file transfers. This will fix filename handling with some buggy clients (e.g. some versions of mIRC).","options")); + b = addBoolSelector(g, __tr2qs_ctx("Accept RESUME requests with mismatched ports", "options"), KviOption_boolAcceptMismatchedPortDccResumeRequests); + mergeTip(b, __tr2qs_ctx("This option causes KVIrc to accept RESUME requests with mismatched ports.
" + "Use it if some router on the path between you and the receiver remaps the ports in DCC SEND " + "but not in DCC RESUME requests.
Please note that this option may misbehave in certain usage " + "patterns since KVIrc must differentiate between transfers only by looking at the filename. Be careful.", + "options")); - b = addBoolSelector(g,__tr2qs_ctx("Send 64-bit ACKs for files larger than 4GiB","options"),KviOption_boolSend64BitAckInDccRecv); - mergeTip(b,__tr2qs_ctx("This option causes KVIrc to send ACKs as 64-bit integers instead of 32-bit integers
" \ - "Use this to fix DCC RECEIVE transfers where the other client is using the mIRC ACK standard.","options")); + b = addBoolSelector(g, __tr2qs_ctx("Replace spaces with underscores in outgoing filenames", "options"), KviOption_boolDCCFileTransferReplaceOutgoingSpacesWithUnderscores); + mergeTip(b, __tr2qs_ctx("This option causes KVIrc to replace spaces with underscores in filenames " + "for all the outgoing file transfers. This will fix filename handling with some buggy clients (e.g. some versions of mIRC).", + "options")); - g = addGroupBox(0,1,0,1,Qt::Horizontal,__tr2qs_ctx("Limits","options")); + b = addBoolSelector(g, __tr2qs_ctx("Send 64-bit ACKs for files larger than 4GiB", "options"), KviOption_boolSend64BitAckInDccRecv); + mergeTip(b, __tr2qs_ctx("This option causes KVIrc to send ACKs as 64-bit integers instead of 32-bit integers
" + "Use this to fix DCC RECEIVE transfers where the other client is using the mIRC ACK standard.", + "options")); + + g = addGroupBox(0, 1, 0, 1, Qt::Horizontal, __tr2qs_ctx("Limits", "options")); KviTalHBox * hb = new KviTalHBox(g); - b = addBoolSelector(hb,__tr2qs_ctx("Limit upload bandwidth to:","options"),KviOption_boolLimitDccSendSpeed); - u = addUIntSelector(hb,"",KviOption_uintMaxDccSendSpeed,0,0xffffff1,1024,KVI_OPTION_BOOL(KviOption_boolLimitDccSendSpeed)); - u->setSuffix(" " + __tr2qs_ctx("bytes/sec","options")); - connect(b,SIGNAL(toggled(bool)),u,SLOT(setEnabled(bool))); + b = addBoolSelector(hb, __tr2qs_ctx("Limit upload bandwidth to:", "options"), KviOption_boolLimitDccSendSpeed); + u = addUIntSelector(hb, "", KviOption_uintMaxDccSendSpeed, 0, 0xffffff1, 1024, KVI_OPTION_BOOL(KviOption_boolLimitDccSendSpeed)); + u->setSuffix(" " + __tr2qs_ctx("bytes/sec", "options")); + connect(b, SIGNAL(toggled(bool)), u, SLOT(setEnabled(bool))); hb = new KviTalHBox(g); - b = addBoolSelector(hb,__tr2qs_ctx("Limit download bandwidth to:","options"),KviOption_boolLimitDccRecvSpeed); - u = addUIntSelector(hb,"",KviOption_uintMaxDccRecvSpeed,0,0xffffff1,1024,KVI_OPTION_BOOL(KviOption_boolLimitDccRecvSpeed)); - u->setSuffix(" " + __tr2qs_ctx("bytes/sec","options")); - connect(b,SIGNAL(toggled(bool)),u,SLOT(setEnabled(bool))); + b = addBoolSelector(hb, __tr2qs_ctx("Limit download bandwidth to:", "options"), KviOption_boolLimitDccRecvSpeed); + u = addUIntSelector(hb, "", KviOption_uintMaxDccRecvSpeed, 0, 0xffffff1, 1024, KVI_OPTION_BOOL(KviOption_boolLimitDccRecvSpeed)); + u->setSuffix(" " + __tr2qs_ctx("bytes/sec", "options")); + connect(b, SIGNAL(toggled(bool)), u, SLOT(setEnabled(bool))); - u = addUIntSelector(g,__tr2qs_ctx("Maximum number of DCC transfers:","options"),KviOption_uintMaxDccSendTransfers,0,1000,10); - mergeTip(u,__tr2qs_ctx("This is the maximum number of concurrent DCC transfers. " \ - "KVIrc will refuse the requests when this limit is reached.","options")); + u = addUIntSelector(g, __tr2qs_ctx("Maximum number of DCC transfers:", "options"), KviOption_uintMaxDccSendTransfers, 0, 1000, 10); + mergeTip(u, __tr2qs_ctx("This is the maximum number of concurrent DCC transfers. " + "KVIrc will refuse the requests when this limit is reached.", + "options")); - g = addGroupBox(0,2,0,2,Qt::Horizontal,__tr2qs_ctx("Tweaks","options")); + g = addGroupBox(0, 2, 0, 2, Qt::Horizontal, __tr2qs_ctx("Tweaks", "options")); - b = addBoolSelector(g,__tr2qs_ctx("Use fast send (send ahead)","options"),KviOption_boolUseFastDccSend); - mergeTip(b,__tr2qs_ctx("The \"send ahead\" DCC method allows data to be sent faster by breaking " \ - "some of the rules of the original DCC SEND protocol specification.
" \ - "Most clients can handle this kind of optimisation so disable it only if you have problems.","options")); + b = addBoolSelector(g, __tr2qs_ctx("Use fast send (send ahead)", "options"), KviOption_boolUseFastDccSend); + mergeTip(b, __tr2qs_ctx("The \"send ahead\" DCC method allows data to be sent faster by breaking " + "some of the rules of the original DCC SEND protocol specification.
" + "Most clients can handle this kind of optimisation so disable it only if you have problems.", + "options")); hb = new KviTalHBox(g); - b = addBoolSelector(hb,__tr2qs_ctx("Force idle step:","options"),KviOption_boolDccSendForceIdleStep); - mergeTip(b,__tr2qs_ctx("Enable this option when the DCC file transfers " \ - "tend to block your computer by consuming too much CPU time. " \ - "When this option is enabled the idle interval below will be " \ - "forcibly inserted between each sent/received data packet.","options")); - - u = addUIntSelector(hb,"",KviOption_uintDccSendIdleStepInMSec,1,65536,30,KVI_OPTION_BOOL(KviOption_boolDccSendForceIdleStep)); - connect(b,SIGNAL(toggled(bool)),u,SLOT(setEnabled(bool))); - u->setSuffix(__tr2qs_ctx(" msec","options")); - - mergeTip(u,__tr2qs_ctx("This parameter controls the average delay between two packets sent or received.
" \ - "A smaller interval will cause you to send data faster but will also " \ - "add load to your CPU, disk and network interface.
" \ - "Reasonable values are from 5 to 50 milliseconds.","options")); - - u = addUIntSelector(g,__tr2qs_ctx("Packet size:","options"),KviOption_uintDccSendPacketSize,16,65536,1024); - u->setSuffix(__tr2qs_ctx(" bytes","options")); - mergeTip(u,__tr2qs_ctx("This parameter controls the packet size used for DCC SEND.
" \ - "With bigger packets you will be probably send data faster, but " \ - "you will also saturate your bandwidth and in some cases " \ - "cause more disk activity.
" \ - "Reasonable values are from 512 to 4096 bytes.","options")); - - addRowSpacer(0,3,0,4); + b = addBoolSelector(hb, __tr2qs_ctx("Force idle step:", "options"), KviOption_boolDccSendForceIdleStep); + mergeTip(b, __tr2qs_ctx("Enable this option when the DCC file transfers " + "tend to block your computer by consuming too much CPU time. " + "When this option is enabled the idle interval below will be " + "forcibly inserted between each sent/received data packet.", + "options")); + + u = addUIntSelector(hb, "", KviOption_uintDccSendIdleStepInMSec, 1, 65536, 30, KVI_OPTION_BOOL(KviOption_boolDccSendForceIdleStep)); + connect(b, SIGNAL(toggled(bool)), u, SLOT(setEnabled(bool))); + u->setSuffix(__tr2qs_ctx(" msec", "options")); + + mergeTip(u, __tr2qs_ctx("This parameter controls the average delay between two packets sent or received.
" + "A smaller interval will cause you to send data faster but will also " + "add load to your CPU, disk and network interface.
" + "Reasonable values are from 5 to 50 milliseconds.", + "options")); + + u = addUIntSelector(g, __tr2qs_ctx("Packet size:", "options"), KviOption_uintDccSendPacketSize, 16, 65536, 1024); + u->setSuffix(__tr2qs_ctx(" bytes", "options")); + mergeTip(u, __tr2qs_ctx("This parameter controls the packet size used for DCC SEND.
" + "With bigger packets you will be probably send data faster, but " + "you will also saturate your bandwidth and in some cases " + "cause more disk activity.
" + "Reasonable values are from 512 to 4096 bytes.", + "options")); + + addRowSpacer(0, 3, 0, 4); } OptionsWidget_dccSendAdvanced::~OptionsWidget_dccSendAdvanced() { } - OptionsWidget_dccChat::OptionsWidget_dccChat(QWidget * parent) -: KviOptionsWidget(parent) + : KviOptionsWidget(parent) { setObjectName("dccchat_options_widget"); createLayout(); @@ -324,78 +339,83 @@ OptionsWidget_dccChat::OptionsWidget_dccChat(QWidget * parent) KviBoolSelector * b2; KviTalGroupBox * g; - g = addGroupBox(0,0,0,0,Qt::Horizontal,__tr2qs_ctx("On Chat Request","options")); - addBoolSelector(g,__tr2qs_ctx("Automatically accept","options"),KviOption_boolAutoAcceptDccChat); - - b1 = addBoolSelector(g, __tr2qs_ctx("Open auto-accepted DCC chat windows without focus","options"),KviOption_boolCreateMinimizedDccChatWhenAutoAccepted, - !KVI_OPTION_BOOL(KviOption_boolCreateMinimizedDccChat)); - mergeTip(b1,__tr2qs_ctx("This option prevents incoming " \ - "auto-accepted DCC chat windows from diverting application focus.
" \ - "Enable this if you don't like DCC chat windows " \ - "popping up while you're typing something in a channel.","options")); - - b2 = addBoolSelector(0,1,0,1, __tr2qs_ctx("Open DCC chat windows without focus","options"),KviOption_boolCreateMinimizedDccChat); - mergeTip(b2,__tr2qs_ctx("This option prevents incoming " \ - "DCC chat windows from diverting application focus.
" \ - "Enable this if you don't like DCC chat windows " \ - "popping up while you're typing something in a channel.","options")); - - connect(b2,SIGNAL(toggled(bool)),b1,SLOT(setNotEnabled(bool))); - -#if (defined(COMPILE_ON_WINDOWS) || defined(COMPILE_KDE_SUPPORT) || defined(COMPILE_ON_MINGW)) - b2 = addBoolSelector(0,2,0,2,__tr2qs_ctx("Flash system taskbar on new DCC chat message","options"),KviOption_boolFlashDccChatWindowOnNewMessages); - mergeTip(b2,__tr2qs_ctx("This option causes the system taskbar entry for KVIrc to flash when a new DCC chat message " \ - "is received and the KVIrc window is not the active.","options")); + g = addGroupBox(0, 0, 0, 0, Qt::Horizontal, __tr2qs_ctx("On Chat Request", "options")); + addBoolSelector(g, __tr2qs_ctx("Automatically accept", "options"), KviOption_boolAutoAcceptDccChat); + + b1 = addBoolSelector(g, __tr2qs_ctx("Open auto-accepted DCC chat windows without focus", "options"), KviOption_boolCreateMinimizedDccChatWhenAutoAccepted, + !KVI_OPTION_BOOL(KviOption_boolCreateMinimizedDccChat)); + mergeTip(b1, __tr2qs_ctx("This option prevents incoming " + "auto-accepted DCC chat windows from diverting application focus.
" + "Enable this if you don't like DCC chat windows " + "popping up while you're typing something in a channel.", + "options")); + + b2 = addBoolSelector(0, 1, 0, 1, __tr2qs_ctx("Open DCC chat windows without focus", "options"), KviOption_boolCreateMinimizedDccChat); + mergeTip(b2, __tr2qs_ctx("This option prevents incoming " + "DCC chat windows from diverting application focus.
" + "Enable this if you don't like DCC chat windows " + "popping up while you're typing something in a channel.", + "options")); + + connect(b2, SIGNAL(toggled(bool)), b1, SLOT(setNotEnabled(bool))); + +#if(defined(COMPILE_ON_WINDOWS) || defined(COMPILE_KDE_SUPPORT) || defined(COMPILE_ON_MINGW)) + b2 = addBoolSelector(0, 2, 0, 2, __tr2qs_ctx("Flash system taskbar on new DCC chat message", "options"), KviOption_boolFlashDccChatWindowOnNewMessages); + mergeTip(b2, __tr2qs_ctx("This option causes the system taskbar entry for KVIrc to flash when a new DCC chat message " + "is received and the KVIrc window is not the active.", + "options")); #endif - b2 = addBoolSelector(0,3,0,3, __tr2qs_ctx("Popup notifier on new DCC chat message","options"),KviOption_boolPopupNotifierOnNewDccChatMessages); - mergeTip(b2,__tr2qs_ctx("This option causes a small notifier window to pop up " \ - "in the low right corner of the screen when a new message is received " \ - "and the KVIrc window is not active.","options")); + b2 = addBoolSelector(0, 3, 0, 3, __tr2qs_ctx("Popup notifier on new DCC chat message", "options"), KviOption_boolPopupNotifierOnNewDccChatMessages); + mergeTip(b2, __tr2qs_ctx("This option causes a small notifier window to pop up " + "in the low right corner of the screen when a new message is received " + "and the KVIrc window is not active.", + "options")); - addRowSpacer(0,4,0,4); + addRowSpacer(0, 4, 0, 4); } OptionsWidget_dccChat::~OptionsWidget_dccChat() { } - -OptionsWidget_dccVoice::OptionsWidget_dccVoice(QWidget *p):KviOptionsWidget(p) +OptionsWidget_dccVoice::OptionsWidget_dccVoice(QWidget * p) : KviOptionsWidget(p) { createLayout(); - + KviBoolSelector * b1; KviBoolSelector * b; KviTalGroupBox * g; KviUIntSelector * u; - b1 = addBoolSelector(0,0,0,0, __tr2qs_ctx("Open all DCC voice windows without focus","options"),KviOption_boolCreateMinimizedDccVoice); - mergeTip(b1,__tr2qs_ctx("This option prevents all incoming " \ - "DCC voice windows from diverting application focus.
" \ - "Enable this if you don't like DCC voice windows " \ - "popping up while you're typing something in a channel.","options")); + b1 = addBoolSelector(0, 0, 0, 0, __tr2qs_ctx("Open all DCC voice windows without focus", "options"), KviOption_boolCreateMinimizedDccVoice); + mergeTip(b1, __tr2qs_ctx("This option prevents all incoming " + "DCC voice windows from diverting application focus.
" + "Enable this if you don't like DCC voice windows " + "popping up while you're typing something in a channel.", + "options")); - g = addGroupBox(0,1,0,1,Qt::Horizontal,__tr2qs_ctx("On Voice Request","options")); - b = addBoolSelector(g,__tr2qs_ctx("Automatically accept","options"),KviOption_boolAutoAcceptDccVoice); - b = addBoolSelector(g, __tr2qs_ctx("Open auto-accepted DCC voice windows without focus","options"),KviOption_boolCreateMinimizedDccVoiceWhenAutoAccepted, - !KVI_OPTION_BOOL(KviOption_boolCreateMinimizedDccVoice)); - mergeTip(b,__tr2qs_ctx("This option prevents incoming " \ - "auto-accepted DCC voice windows from diverting application focus.
" \ - "Enable this if you don't like DCC voice windows " \ - "popping up while you're typing something in a channel.","options")); + g = addGroupBox(0, 1, 0, 1, Qt::Horizontal, __tr2qs_ctx("On Voice Request", "options")); + b = addBoolSelector(g, __tr2qs_ctx("Automatically accept", "options"), KviOption_boolAutoAcceptDccVoice); + b = addBoolSelector(g, __tr2qs_ctx("Open auto-accepted DCC voice windows without focus", "options"), KviOption_boolCreateMinimizedDccVoiceWhenAutoAccepted, + !KVI_OPTION_BOOL(KviOption_boolCreateMinimizedDccVoice)); + mergeTip(b, __tr2qs_ctx("This option prevents incoming " + "auto-accepted DCC voice windows from diverting application focus.
" + "Enable this if you don't like DCC voice windows " + "popping up while you're typing something in a channel.", + "options")); - connect(b1,SIGNAL(toggled(bool)),b,SLOT(setNotEnabled(bool))); + connect(b1, SIGNAL(toggled(bool)), b, SLOT(setNotEnabled(bool))); - addBoolSelector(0,2,0,2,__tr2qs_ctx("Force half-duplex mode on sound device","options"), KviOption_boolDccVoiceForceHalfDuplex); - addBoolSelector(0,3,0,3,__tr2qs_ctx("Volume slider controls PCM, not Master","options"), KviOption_boolDccVoiceVolumeSliderControlsPCM); + addBoolSelector(0, 2, 0, 2, __tr2qs_ctx("Force half-duplex mode on sound device", "options"), KviOption_boolDccVoiceForceHalfDuplex); + addBoolSelector(0, 3, 0, 3, __tr2qs_ctx("Volume slider controls PCM, not Master", "options"), KviOption_boolDccVoiceVolumeSliderControlsPCM); - addStringSelector(0,4,0,4,__tr2qs_ctx("Sound device:","options"), KviOption_stringDccVoiceSoundDevice)->setMinimumLabelWidth(150); - addStringSelector(0,5,0,5,__tr2qs_ctx("Mixer device:","options"), KviOption_stringDccVoiceMixerDevice)->setMinimumLabelWidth(150); + addStringSelector(0, 4, 0, 4, __tr2qs_ctx("Sound device:", "options"), KviOption_stringDccVoiceSoundDevice)->setMinimumLabelWidth(150); + addStringSelector(0, 5, 0, 5, __tr2qs_ctx("Mixer device:", "options"), KviOption_stringDccVoiceMixerDevice)->setMinimumLabelWidth(150); - u = addUIntSelector(0,6,0,6,__tr2qs_ctx("Pre-buffer size:","options"), KviOption_uintDccVoicePreBufferSize, 2048, 65536, 32000); + u = addUIntSelector(0, 6, 0, 6, __tr2qs_ctx("Pre-buffer size:", "options"), KviOption_uintDccVoicePreBufferSize, 2048, 65536, 32000); u->setSuffix(" bytes"); - addRowSpacer(0,7,0,7); + addRowSpacer(0, 7, 0, 7); } OptionsWidget_dccVoice::~OptionsWidget_dccVoice() diff --git a/src/modules/options/OptionsWidget_general.cpp b/src/modules/options/OptionsWidget_general.cpp index afa7dffb9..1ead7ce6d 100644 --- a/src/modules/options/OptionsWidget_general.cpp +++ b/src/modules/options/OptionsWidget_general.cpp @@ -28,18 +28,18 @@ #include "KviLocale.h" #include "KviOptions.h" - OptionsWidget_general::OptionsWidget_general(QWidget * parent) -: KviOptionsWidget(parent) + : KviOptionsWidget(parent) { setObjectName("generalopt_options_widget"); createLayout(); - addLabel(0,0,4,0,__tr2qs_ctx("This section contains the general client options "\ - "like sound, mediafiles, URL handlers etc... " \ - "","options")); + addLabel(0, 0, 4, 0, __tr2qs_ctx("This section contains the general client options " + "like sound, mediafiles, URL handlers etc... " + "", + "options")); - addRowSpacer(0,1,0,1); + addRowSpacer(0, 1, 0, 1); //addAdvancedButton(4,1,4,1); } diff --git a/src/modules/options/OptionsWidget_identity.cpp b/src/modules/options/OptionsWidget_identity.cpp index 0eff678ea..62159e7fb 100644 --- a/src/modules/options/OptionsWidget_identity.cpp +++ b/src/modules/options/OptionsWidget_identity.cpp @@ -53,92 +53,92 @@ #include #include -NickAlternativesDialog::NickAlternativesDialog(QWidget * par,const QString &n1,const QString &n2,const QString &n3) -: QDialog(par) +NickAlternativesDialog::NickAlternativesDialog(QWidget * par, const QString & n1, const QString & n2, const QString & n3) + : QDialog(par) { QGridLayout * g = new QGridLayout(this); - setWindowTitle(__tr2qs_ctx("Nickname Alternatives - KVIrc","options")); + setWindowTitle(__tr2qs_ctx("Nickname Alternatives - KVIrc", "options")); QLabel * l = new QLabel(this); - l->setText(__tr2qs_ctx("Here you can choose up to three nickname " \ - "alternatives to the primary one. KVIrc will use the alternatives " \ - "if the primary nick is already used by someone else on a particular " \ - "IRC network.","options")); + l->setText(__tr2qs_ctx("Here you can choose up to three nickname " + "alternatives to the primary one. KVIrc will use the alternatives " + "if the primary nick is already used by someone else on a particular " + "IRC network.", + "options")); l->setWordWrap(true); - g->addWidget(l,0,0,1,3); + g->addWidget(l, 0, 0, 1, 3); l = new QLabel(this); - l->setText(__tr2qs_ctx("Alt. nickname 1:","options")); - g->addWidget(l,1,0); + l->setText(__tr2qs_ctx("Alt. nickname 1:", "options")); + g->addWidget(l, 1, 0); m_pNickEdit1 = new QLineEdit(this); - g->addWidget(m_pNickEdit1,1,1,1,2); + g->addWidget(m_pNickEdit1, 1, 1, 1, 2); m_pNickEdit1->setText(n1); l = new QLabel(this); - l->setText(__tr2qs_ctx("Alt. nickname 2:","options")); - g->addWidget(l,2,0); + l->setText(__tr2qs_ctx("Alt. nickname 2:", "options")); + g->addWidget(l, 2, 0); m_pNickEdit2 = new QLineEdit(this); - g->addWidget(m_pNickEdit2,2,1,1,2); + g->addWidget(m_pNickEdit2, 2, 1, 1, 2); m_pNickEdit2->setText(n2); l = new QLabel(this); - l->setText(__tr2qs_ctx("Alt. nickname 3:","options")); - g->addWidget(l,3,0); + l->setText(__tr2qs_ctx("Alt. nickname 3:", "options")); + g->addWidget(l, 3, 0); m_pNickEdit3 = new QLineEdit(this); - g->addWidget(m_pNickEdit3,3,1,1,2); + g->addWidget(m_pNickEdit3, 3, 1, 1, 2); m_pNickEdit3->setText(n3); KviTalHBox * h = new KviTalHBox(this); h->setSpacing(8); - g->addWidget(h,4,2); + g->addWidget(h, 4, 2); - QPushButton * pb = new QPushButton(__tr2qs_ctx("Cancel","options"),h); - connect(pb,SIGNAL(clicked()),this,SLOT(reject())); + QPushButton * pb = new QPushButton(__tr2qs_ctx("Cancel", "options"), h); + connect(pb, SIGNAL(clicked()), this, SLOT(reject())); - pb = new QPushButton(__tr2qs_ctx("OK","options"),h); + pb = new QPushButton(__tr2qs_ctx("OK", "options"), h); pb->setDefault(true); - connect(pb,SIGNAL(clicked()),this,SLOT(accept())); + connect(pb, SIGNAL(clicked()), this, SLOT(accept())); - g->setColumnStretch(0,1); + g->setColumnStretch(0, 1); } NickAlternativesDialog::~NickAlternativesDialog() { } -void NickAlternativesDialog::fill(QString &n1,QString &n2,QString &n3) +void NickAlternativesDialog::fill(QString & n1, QString & n2, QString & n3) { n1 = m_pNickEdit1->text(); n2 = m_pNickEdit2->text(); n3 = m_pNickEdit3->text(); } - -AvatarDownloadDialog::AvatarDownloadDialog(QWidget * par,const QString &szUrl) -: QDialog(par) +AvatarDownloadDialog::AvatarDownloadDialog(QWidget * par, const QString & szUrl) + : QDialog(par) { - setWindowTitle(__tr2qs_ctx("Avatar Download - KVIrc","options")); + setWindowTitle(__tr2qs_ctx("Avatar Download - KVIrc", "options")); m_szUrl = szUrl; QGridLayout * g = new QGridLayout(this); - m_pOutput = new QLabel(__tr2qs_ctx("Please wait while the avatar is being downloaded","options"),this); - g->addWidget(m_pOutput,0,0,1,2); + m_pOutput = new QLabel(__tr2qs_ctx("Please wait while the avatar is being downloaded", "options"), this); + g->addWidget(m_pOutput, 0, 0, 1, 2); - QPushButton * b = new QPushButton(__tr2qs_ctx("Abort","options"),this); - g->addWidget(b,1,1); - connect(b,SIGNAL(clicked()),this,SLOT(cancelClicked())); + QPushButton * b = new QPushButton(__tr2qs_ctx("Abort", "options"), this); + g->addWidget(b, 1, 1); + connect(b, SIGNAL(clicked()), this, SLOT(cancelClicked())); m_pRequest = new KviHttpRequest(); - QTimer::singleShot(0,this,SLOT(startDownload())); + QTimer::singleShot(0, this, SLOT(startDownload())); - g->setRowStretch(0,1); - g->setColumnStretch(0,1); + g->setRowStretch(0, 1); + g->setColumnStretch(0, 1); - setMinimumSize(250,120); + setMinimumSize(250, 120); } AvatarDownloadDialog::~AvatarDownloadDialog() @@ -148,35 +148,35 @@ AvatarDownloadDialog::~AvatarDownloadDialog() void AvatarDownloadDialog::startDownload() { - connect(m_pRequest,SIGNAL(terminated(bool)),this,SLOT(downloadTerminated(bool))); - connect(m_pRequest,SIGNAL(status(const QString &)),this,SLOT(downloadMessage(const QString &))); + connect(m_pRequest, SIGNAL(terminated(bool)), this, SLOT(downloadTerminated(bool))); + connect(m_pRequest, SIGNAL(status(const QString &)), this, SLOT(downloadMessage(const QString &))); QString tmp = m_szUrl; g_pIconManager->urlToCachedFileName(tmp); - g_pApp->getLocalKvircDirectory(m_szLocalFileName,KviApplication::Avatars,tmp); + g_pApp->getLocalKvircDirectory(m_szLocalFileName, KviApplication::Avatars, tmp); m_pRequest->setExistingFileAction(KviHttpRequest::RenameExisting); - if(!m_pRequest->get(KviUrl(m_szUrl),KviHttpRequest::StoreToFile,m_szLocalFileName.toUtf8().data())) + if(!m_pRequest->get(KviUrl(m_szUrl), KviHttpRequest::StoreToFile, m_szLocalFileName.toUtf8().data())) { - m_szErrorMessage = __tr2qs_ctx("Failed to start the download","options"); + m_szErrorMessage = __tr2qs_ctx("Failed to start the download", "options"); reject(); } } void AvatarDownloadDialog::closeEvent(QCloseEvent * e) { - m_szErrorMessage = __tr2qs_ctx("Download aborted by user","options"); + m_szErrorMessage = __tr2qs_ctx("Download aborted by user", "options"); e->ignore(); reject(); } void AvatarDownloadDialog::cancelClicked() { - m_szErrorMessage = __tr2qs_ctx("Download aborted by user","options"); + m_szErrorMessage = __tr2qs_ctx("Download aborted by user", "options"); reject(); } -void AvatarDownloadDialog::downloadMessage(const QString &szMsg) +void AvatarDownloadDialog::downloadMessage(const QString & szMsg) { if(!szMsg.isEmpty()) { @@ -190,23 +190,26 @@ void AvatarDownloadDialog::downloadTerminated(bool bSuccess) if(bSuccess) { accept(); - } else { + } + else + { m_szErrorMessage = m_pRequest->lastError(); reject(); } } -AvatarSelectionDialog::AvatarSelectionDialog(QWidget * par,const QString &szInitialPath) -: QDialog(par) +AvatarSelectionDialog::AvatarSelectionDialog(QWidget * par, const QString & szInitialPath) + : QDialog(par) { - setWindowTitle(__tr2qs_ctx("Choose Avatar - KVIrc","options")); + setWindowTitle(__tr2qs_ctx("Choose Avatar - KVIrc", "options")); QVBoxLayout * layout = new QVBoxLayout(this); - QString msg = __tr2qs_ctx("Please select an avatar image.\n\n" \ - "The full path to a local file or an image on the Web can be used.\n" \ - "If you wish to use a local image file, click the \"Browse\" button to select the desired file.\n\n" \ - "The full URL for an image (including http:// or https://) can also be entered manually.","options"); + QString msg = __tr2qs_ctx("Please select an avatar image.\n\n" + "The full path to a local file or an image on the Web can be used.\n" + "If you wish to use a local image file, click the \"Browse\" button to select the desired file.\n\n" + "The full URL for an image (including http:// or https://) can also be entered manually.", + "options"); QLabel * l = new QLabel(msg); l->setMinimumWidth(250); @@ -221,12 +224,12 @@ AvatarSelectionDialog::AvatarSelectionDialog(QWidget * par,const QString &szInit QHBoxLayout * pLineEditLayout = new QHBoxLayout; - pLineEditLayout->addWidget(m_pLineEdit,1); + pLineEditLayout->addWidget(m_pLineEdit, 1); - QPushButton * b = new QPushButton(__tr2qs_ctx("&Browse...","options")); + QPushButton * b = new QPushButton(__tr2qs_ctx("&Browse...", "options")); b->setFixedWidth(80); - connect(b,SIGNAL(clicked()),this,SLOT(chooseFileClicked())); - pLineEditLayout->addWidget(b,1); + connect(b, SIGNAL(clicked()), this, SLOT(chooseFileClicked())); + pLineEditLayout->addWidget(b, 1); layout->addLayout(pLineEditLayout); @@ -234,15 +237,15 @@ AvatarSelectionDialog::AvatarSelectionDialog(QWidget * par,const QString &szInit h->setAlignment(Qt::AlignRight); layout->addLayout(h); - b = new QPushButton(__tr2qs_ctx("&OK","options")); + b = new QPushButton(__tr2qs_ctx("&OK", "options")); b->setFixedWidth(80); b->setDefault(true); - connect(b,SIGNAL(clicked()),this,SLOT(okClicked())); + connect(b, SIGNAL(clicked()), this, SLOT(okClicked())); h->addWidget(b); - b = new QPushButton(__tr2qs_ctx("Cancel","options")); + b = new QPushButton(__tr2qs_ctx("Cancel", "options")); b->setFixedWidth(80); - connect(b,SIGNAL(clicked()),this,SLOT(cancelClicked())); + connect(b, SIGNAL(clicked()), this, SLOT(cancelClicked())); h->addWidget(b); } @@ -264,7 +267,7 @@ void AvatarSelectionDialog::cancelClicked() void AvatarSelectionDialog::chooseFileClicked() { QString tmp; - if(KviFileDialog::askForOpenFileName(tmp,__tr2qs_ctx("Select a File - KVIrc","options"),QString(),KVI_FILTER_IMAGE,false,true,this)) + if(KviFileDialog::askForOpenFileName(tmp, __tr2qs_ctx("Select a File - KVIrc", "options"), QString(), KVI_FILTER_IMAGE, false, true, this)) { m_pLineEdit->setText(tmp); } @@ -276,9 +279,8 @@ void AvatarSelectionDialog::closeEvent(QCloseEvent * e) reject(); } - OptionsWidget_identity::OptionsWidget_identity(QWidget * parent) -: KviOptionsWidget(parent) + : KviOptionsWidget(parent) { } @@ -286,121 +288,128 @@ OptionsWidget_identity::~OptionsWidget_identity() { } - KviIdentityGeneralOptionsWidget::KviIdentityGeneralOptionsWidget(QWidget * parent) -: KviOptionsWidget(parent) + : KviOptionsWidget(parent) { m_szAltNicknames[0] = KVI_OPTION_STRING(KviOption_stringNickname2); m_szAltNicknames[1] = KVI_OPTION_STRING(KviOption_stringNickname3); m_szAltNicknames[2] = KVI_OPTION_STRING(KviOption_stringNickname4); - createLayout(); layout()->setMargin(10); - KviTalGroupBox * gbox = addGroupBox(0,0,0,0,Qt::Horizontal,__tr2qs_ctx("Basic Properties","options")); + KviTalGroupBox * gbox = addGroupBox(0, 0, 0, 0, Qt::Horizontal, __tr2qs_ctx("Basic Properties", "options")); KviTalHBox * hb = new KviTalHBox(gbox); - KviStringSelector * sel = addStringSelector(hb,__tr2qs_ctx("Nickname:","options"),KviOption_stringNickname1); + KviStringSelector * sel = addStringSelector(hb, __tr2qs_ctx("Nickname:", "options"), KviOption_stringNickname1); sel->setMinimumLabelWidth(120); - mergeTip(sel,__tr2qs_ctx("Your nickname is your primary form of identification on IRC.
" \ - "Since servers cannot accept multiple users sharing the same nickname " \ - "(case insensitive), you can provide alternative nicknames to be used in case "\ - "the server refuses to accept the default one.","options")); + mergeTip(sel, __tr2qs_ctx("Your nickname is your primary form of identification on IRC.
" + "Since servers cannot accept multiple users sharing the same nickname " + "(case insensitive), you can provide alternative nicknames to be used in case " + "the server refuses to accept the default one.", + "options")); - QValidator * v = new QRegExpValidator(QRegExp("[^-0-9 ][^ ]*"),hb); + QValidator * v = new QRegExpValidator(QRegExp("[^-0-9 ][^ ]*"), hb); sel->setValidator(v); - QPushButton * pb = new QPushButton(__tr2qs_ctx("Alternatives...","options"),hb); - connect(pb,SIGNAL(clicked()),this,SLOT(setNickAlternatives())); + QPushButton * pb = new QPushButton(__tr2qs_ctx("Alternatives...", "options"), hb); + connect(pb, SIGNAL(clicked()), this, SLOT(setNickAlternatives())); - sel = addStringSelector(gbox,__tr2qs_ctx("Username:","options"),KviOption_stringUsername); + sel = addStringSelector(gbox, __tr2qs_ctx("Username:", "options"), KviOption_stringUsername); sel->setMinimumLabelWidth(120); - mergeTip(sel,__tr2qs_ctx("This is the username that you will use to connect to the server.
" \ - "In the past, it was used as a form of authentication, but it normally has no special use now.
" \ - "In addition to your nickname, you are identified on IRC by your username@hostname.
" \ - "Basically, you can enter any word you like here.","options")); + mergeTip(sel, __tr2qs_ctx("This is the username that you will use to connect to the server.
" + "In the past, it was used as a form of authentication, but it normally has no special use now.
" + "In addition to your nickname, you are identified on IRC by your username@hostname.
" + "Basically, you can enter any word you like here.", + "options")); - sel = addStringSelector(gbox,__tr2qs_ctx("Real name:","options"),KviOption_stringRealname); + sel = addStringSelector(gbox, __tr2qs_ctx("Real name:", "options"), KviOption_stringRealname); sel->setMinimumLabelWidth(120); - mergeTip(sel,__tr2qs_ctx("This text will appear when someone does a /WHOIS on you.
" \ - "It is intended to be your real name, but people tend to put random quotes and phrases here too.","options")); - + mergeTip(sel, __tr2qs_ctx("This text will appear when someone does a /WHOIS on you.
" + "It is intended to be your real name, but people tend to put random quotes and phrases here too.", + "options")); - QString szOptionalCtcpUserInfo = __tr2qs_ctx("This field is optional and will appear as part of the CTCP USERINFO reply.","options"); + QString szOptionalCtcpUserInfo = __tr2qs_ctx("This field is optional and will appear as part of the CTCP USERINFO reply.", "options"); QString szTrailing = "

" + szOptionalCtcpUserInfo; - gbox = addGroupBox(0,1,0,1,Qt::Horizontal,__tr2qs_ctx("Profile","options")); + gbox = addGroupBox(0, 1, 0, 1, Qt::Horizontal, __tr2qs_ctx("Profile", "options")); hb = new KviTalHBox(gbox); - QLabel * l = new QLabel(__tr2qs_ctx("Age:","options"),hb); + QLabel * l = new QLabel(__tr2qs_ctx("Age:", "options"), hb); l->setMinimumWidth(120); m_pAgeCombo = new QComboBox(hb); - QString szTip1 = __tr2qs_ctx("Here you can specify your age.","options") + szTrailing; - KviTalToolTip::add(l,szTip1); - KviTalToolTip::add(m_pAgeCombo,szTip1); - m_pAgeCombo->addItem(__tr2qs_ctx("Unspecified","options")); + QString szTip1 = __tr2qs_ctx("Here you can specify your age.", "options") + szTrailing; + KviTalToolTip::add(l, szTip1); + KviTalToolTip::add(m_pAgeCombo, szTip1); + m_pAgeCombo->addItem(__tr2qs_ctx("Unspecified", "options")); unsigned int i; - for(i=1;i<120;i++) + for(i = 1; i < 120; i++) { QString tmp; tmp.setNum(i); - m_pAgeCombo->insertItem(m_pAgeCombo->count(),tmp); + m_pAgeCombo->insertItem(m_pAgeCombo->count(), tmp); } bool bOk; i = KVI_OPTION_STRING(KviOption_stringCtcpUserInfoAge).toUInt(&bOk); - if(!bOk)i = 0; - if(i > 120)i = 120; + if(!bOk) + i = 0; + if(i > 120) + i = 120; m_pAgeCombo->setCurrentIndex(i); - hb->setStretchFactor(m_pAgeCombo,1); - + hb->setStretchFactor(m_pAgeCombo, 1); hb = new KviTalHBox(gbox); - l = new QLabel(__tr2qs_ctx("Gender:","options"),hb); + l = new QLabel(__tr2qs_ctx("Gender:", "options"), hb); l->setMinimumWidth(120); m_pGenderCombo = new QComboBox(hb); - QString szTip2 = __tr2qs_ctx("Here you can specify your gender.","options") + szTrailing; - KviTalToolTip::add(l,szTip2); - KviTalToolTip::add(m_pGenderCombo,szTip2); - m_pGenderCombo->addItem(__tr2qs_ctx("Unspecified","options")); - m_pGenderCombo->addItem(__tr2qs_ctx("Female","options")); - m_pGenderCombo->addItem(__tr2qs_ctx("Male","options")); - - if(KviQString::equalCI(KVI_OPTION_STRING(KviOption_stringCtcpUserInfoGender),"Male")) + QString szTip2 = __tr2qs_ctx("Here you can specify your gender.", "options") + szTrailing; + KviTalToolTip::add(l, szTip2); + KviTalToolTip::add(m_pGenderCombo, szTip2); + m_pGenderCombo->addItem(__tr2qs_ctx("Unspecified", "options")); + m_pGenderCombo->addItem(__tr2qs_ctx("Female", "options")); + m_pGenderCombo->addItem(__tr2qs_ctx("Male", "options")); + + if(KviQString::equalCI(KVI_OPTION_STRING(KviOption_stringCtcpUserInfoGender), "Male")) m_pGenderCombo->setCurrentIndex(2); - else if(KviQString::equalCI(KVI_OPTION_STRING(KviOption_stringCtcpUserInfoGender),"Female")) + else if(KviQString::equalCI(KVI_OPTION_STRING(KviOption_stringCtcpUserInfoGender), "Female")) m_pGenderCombo->setCurrentIndex(1); else m_pGenderCombo->setCurrentIndex(0); - hb->setStretchFactor(m_pGenderCombo,1); + hb->setStretchFactor(m_pGenderCombo, 1); - sel = addStringSelector(gbox,__tr2qs_ctx("Location:","options"),KviOption_stringCtcpUserInfoLocation); + sel = addStringSelector(gbox, __tr2qs_ctx("Location:", "options"), KviOption_stringCtcpUserInfoLocation); sel->setMinimumLabelWidth(120); - mergeTip(sel, __tr2qs_ctx("You can describe here your approximate physical location. " \ - "Something like \"Region, Country\" will be OK. Please note that this information will be viewable " \ - "by anyone so putting more data (like the exact address), generally, is not a good idea.","options") + szTrailing); + mergeTip(sel, __tr2qs_ctx("You can describe here your approximate physical location. " + "Something like \"Region, Country\" will be OK. Please note that this information will be viewable " + "by anyone so putting more data (like the exact address), generally, is not a good idea.", + "options") + + szTrailing); - sel = addStringSelector(gbox,__tr2qs_ctx("Languages:","options"),KviOption_stringCtcpUserInfoLanguages); + sel = addStringSelector(gbox, __tr2qs_ctx("Languages:", "options"), KviOption_stringCtcpUserInfoLanguages); sel->setMinimumLabelWidth(120); - mergeTip(sel, __tr2qs_ctx("You can put here the short names of the languages you can speak. " \ - "An example might be \"EN, IT\" that would mean that you speak both Italian and English.","options") + szTrailing); + mergeTip(sel, __tr2qs_ctx("You can put here the short names of the languages you can speak. " + "An example might be \"EN, IT\" that would mean that you speak both Italian and English.", + "options") + + szTrailing); - sel = addStringSelector(gbox,__tr2qs_ctx("Other:","options"),KviOption_stringCtcpUserInfoOther); + sel = addStringSelector(gbox, __tr2qs_ctx("Other:", "options"), KviOption_stringCtcpUserInfoOther); sel->setMinimumLabelWidth(120); - mergeTip(sel, __tr2qs_ctx("You can put here some additional personal data. " \ - "It might be a funny quote or your homepage URL... " \ - "Please note that this information will be viewable " \ - "by anyone so don't put any sensible data (passwords, telephone or credit card numbers).","options") + szTrailing); + mergeTip(sel, __tr2qs_ctx("You can put here some additional personal data. " + "It might be a funny quote or your homepage URL... " + "Please note that this information will be viewable " + "by anyone so don't put any sensible data (passwords, telephone or credit card numbers).", + "options") + + szTrailing); - addRowSpacer(0,2,0,2); + addRowSpacer(0, 2, 0, 2); } KviIdentityGeneralOptionsWidget::~KviIdentityGeneralOptionsWidget() @@ -409,9 +418,10 @@ KviIdentityGeneralOptionsWidget::~KviIdentityGeneralOptionsWidget() void KviIdentityGeneralOptionsWidget::setNickAlternatives() { - NickAlternativesDialog * dlg = new NickAlternativesDialog(this,m_szAltNicknames[0],m_szAltNicknames[1],m_szAltNicknames[2]); - if(dlg->exec() != QDialog::Accepted)return; - dlg->fill(m_szAltNicknames[0],m_szAltNicknames[1],m_szAltNicknames[2]); + NickAlternativesDialog * dlg = new NickAlternativesDialog(this, m_szAltNicknames[0], m_szAltNicknames[1], m_szAltNicknames[2]); + if(dlg->exec() != QDialog::Accepted) + return; + dlg->fill(m_szAltNicknames[0], m_szAltNicknames[1], m_szAltNicknames[2]); delete dlg; } @@ -419,39 +429,44 @@ void KviIdentityGeneralOptionsWidget::commit() { KviOptionsWidget::commit(); - if(KVI_OPTION_STRING(KviOption_stringRealname).isEmpty()) KVI_OPTION_STRING(KviOption_stringRealname)=KVI_DEFAULT_REALNAME; - if(KVI_OPTION_STRING(KviOption_stringUsername).isEmpty()) KVI_OPTION_STRING(KviOption_stringUsername)=KVI_DEFAULT_USERNAME; + if(KVI_OPTION_STRING(KviOption_stringRealname).isEmpty()) + KVI_OPTION_STRING(KviOption_stringRealname) = KVI_DEFAULT_REALNAME; + if(KVI_OPTION_STRING(KviOption_stringUsername).isEmpty()) + KVI_OPTION_STRING(KviOption_stringUsername) = KVI_DEFAULT_USERNAME; KVI_OPTION_STRING(KviOption_stringNickname2) = m_szAltNicknames[0]; KVI_OPTION_STRING(KviOption_stringNickname3) = m_szAltNicknames[1]; KVI_OPTION_STRING(KviOption_stringNickname4) = m_szAltNicknames[2]; - int i = m_pAgeCombo->currentIndex(); - if(i < 0)i = 0; - if(i > 120)i = 120; - if(i <= 0)KVI_OPTION_STRING(KviOption_stringCtcpUserInfoAge) = ""; - else KVI_OPTION_STRING(KviOption_stringCtcpUserInfoAge).setNum(i); + if(i < 0) + i = 0; + if(i > 120) + i = 120; + if(i <= 0) + KVI_OPTION_STRING(KviOption_stringCtcpUserInfoAge) = ""; + else + KVI_OPTION_STRING(KviOption_stringCtcpUserInfoAge) + .setNum(i); switch(m_pGenderCombo->currentIndex()) { case 1: // this should be in English KVI_OPTION_STRING(KviOption_stringCtcpUserInfoGender) = "Female"; - break; + break; case 2: // this should be in English KVI_OPTION_STRING(KviOption_stringCtcpUserInfoGender) = "Male"; - break; + break; default: KVI_OPTION_STRING(KviOption_stringCtcpUserInfoGender) = ""; - break; + break; } } - OptionsWidget_identityAvatar::OptionsWidget_identityAvatar(QWidget * parent) -: KviOptionsWidget(parent) + : KviOptionsWidget(parent) { createLayout(); layout()->setMargin(10); @@ -460,42 +475,43 @@ OptionsWidget_identityAvatar::OptionsWidget_identityAvatar(QWidget * parent) bool bHaveAvatar = (!KVI_OPTION_STRING(KviOption_stringMyAvatar).isEmpty()) && m_pLocalAvatar->pixmap(); - QString szTip = __tr2qs_ctx("Here you can choose your avatar image.
" \ - "It will be visible by other people that request it.
" \ - "Choose a nice image of yourself, possibly avoiding obscenity and offending images.
" \ - "A good idea is to choose a relatively small file of around 150 Kb max, because " \ - "most clients have a limit on the size of avatars being downloaded.
" \ - "The image also should be smaller than 800x600 pixels since it will have to be viewable in everyone's monitor.","options"); + QString szTip = __tr2qs_ctx("Here you can choose your avatar image.
" + "It will be visible by other people that request it.
" + "Choose a nice image of yourself, possibly avoiding obscenity and offending images.
" + "A good idea is to choose a relatively small file of around 150 Kb max, because " + "most clients have a limit on the size of avatars being downloaded.
" + "The image also should be smaller than 800x600 pixels since it will have to be viewable in everyone's monitor.", + "options"); - m_pUseAvatarCheck = new QCheckBox(__tr2qs_ctx("Use avatar:","options"),this); - addWidgetToLayout(m_pUseAvatarCheck,0,0,0,0); + m_pUseAvatarCheck = new QCheckBox(__tr2qs_ctx("Use avatar:", "options"), this); + addWidgetToLayout(m_pUseAvatarCheck, 0, 0, 0, 0); m_pUseAvatarCheck->setChecked(bHaveAvatar); - mergeTip(m_pUseAvatarCheck,szTip); + mergeTip(m_pUseAvatarCheck, szTip); m_pAvatarPreview = new KviPixmapPreview(this); - addWidgetToLayout(m_pAvatarPreview,0,1,0,1); + addWidgetToLayout(m_pAvatarPreview, 0, 1, 0, 1); m_pAvatarPreview->setPixmap(m_pLocalAvatar); m_pAvatarPreview->setEnabled(bHaveAvatar); - connect(m_pUseAvatarCheck,SIGNAL(toggled(bool)),m_pAvatarPreview,SLOT(setEnabled(bool))); - mergeTip(m_pAvatarPreview,szTip); + connect(m_pUseAvatarCheck, SIGNAL(toggled(bool)), m_pAvatarPreview, SLOT(setEnabled(bool))); + mergeTip(m_pAvatarPreview, szTip); KviTalHBox * hb = new KviTalHBox(this); hb->setSpacing(4); - addWidgetToLayout(hb,0,2,0,2); + addWidgetToLayout(hb, 0, 2, 0, 2); m_pAvatarNameEdit = new QLineEdit(hb); m_pAvatarNameEdit->setReadOnly(true); m_pAvatarNameEdit->setEnabled(bHaveAvatar); m_pAvatarNameEdit->setText(KVI_OPTION_STRING(KviOption_stringMyAvatar)); - connect(m_pUseAvatarCheck,SIGNAL(toggled(bool)),m_pAvatarNameEdit,SLOT(setEnabled(bool))); + connect(m_pUseAvatarCheck, SIGNAL(toggled(bool)), m_pAvatarNameEdit, SLOT(setEnabled(bool))); - m_pChooseAvatarButton = new QPushButton(__tr2qs_ctx("Choose...","options"),hb); + m_pChooseAvatarButton = new QPushButton(__tr2qs_ctx("Choose...", "options"), hb); m_pChooseAvatarButton->setEnabled(bHaveAvatar); - connect(m_pUseAvatarCheck,SIGNAL(toggled(bool)),m_pChooseAvatarButton,SLOT(setEnabled(bool))); + connect(m_pUseAvatarCheck, SIGNAL(toggled(bool)), m_pChooseAvatarButton, SLOT(setEnabled(bool))); - connect(m_pChooseAvatarButton,SIGNAL(clicked()),this,SLOT(chooseAvatar())); + connect(m_pChooseAvatarButton, SIGNAL(clicked()), this, SLOT(chooseAvatar())); - layout()->setRowStretch(1,2); + layout()->setRowStretch(1, 2); } OptionsWidget_identityAvatar::~OptionsWidget_identityAvatar() @@ -513,7 +529,9 @@ void OptionsWidget_identityAvatar::commit(void) { KVI_OPTION_STRING(KviOption_stringMyAvatar) = szAvatarName; KVI_OPTION_PIXMAP(KviOption_pixmapMyAvatar) = *m_pLocalAvatar; - } else { + } + else + { KVI_OPTION_STRING(KviOption_stringMyAvatar) = ""; KVI_OPTION_PIXMAP(KviOption_pixmapMyAvatar) = KviPixmap(); } @@ -524,20 +542,21 @@ void OptionsWidget_identityAvatar::chooseAvatar() { QString szCurrent = m_pAvatarNameEdit->text(); - AvatarSelectionDialog dlg(this,szCurrent); - if(dlg.exec() != QDialog::Accepted)return; + AvatarSelectionDialog dlg(this, szCurrent); + if(dlg.exec() != QDialog::Accepted) + return; szCurrent = dlg.avatarName().trimmed(); - if(KviQString::equalCIN(szCurrent,"http://",7) || KviQString::equalCIN(szCurrent,"https://",8)) + if(KviQString::equalCIN(szCurrent, "http://", 7) || KviQString::equalCIN(szCurrent, "https://", 8)) { // this is a url // first check if we have it in the cache - KviAvatar * a = g_pIconManager->getAvatar(QString(),szCurrent); + KviAvatar * a = g_pIconManager->getAvatar(QString(), szCurrent); if(!a) { // no cache... try downloading - AvatarDownloadDialog dlg(this,szCurrent); + AvatarDownloadDialog dlg(this, szCurrent); if(dlg.exec() == QDialog::Accepted) { // downloaded! @@ -546,25 +565,35 @@ void OptionsWidget_identityAvatar::chooseAvatar() { // unloadable szCurrent = ""; - QMessageBox::warning(this,__tr2qs_ctx("Failed to Load Avatar - KVIrc","options"), - __tr2qs_ctx("Failed to load the avatar image.
" \ - "It may be an inaccessible file or an " \ - "unsupported image format.","options"),QMessageBox::Ok,QMessageBox::NoButton); + QMessageBox::warning(this, __tr2qs_ctx("Failed to Load Avatar - KVIrc", "options"), + __tr2qs_ctx("Failed to load the avatar image.
" + "It may be an inaccessible file or an " + "unsupported image format.", + "options"), + QMessageBox::Ok, QMessageBox::NoButton); } // else loaded! - } else { + } + else + { // unloadable - QString szTmp = QString(__tr2qs_ctx("Failed to download the avatar image.
" \ - "%1","options")).arg(dlg.errorMessage()); - QMessageBox::warning(this,__tr2qs_ctx("Avatar Download Failed - KVIrc","options"),szTmp,QMessageBox::Ok,QMessageBox::NoButton); + QString szTmp = QString(__tr2qs_ctx("Failed to download the avatar image.
" + "%1", + "options")) + .arg(dlg.errorMessage()); + QMessageBox::warning(this, __tr2qs_ctx("Avatar Download Failed - KVIrc", "options"), szTmp, QMessageBox::Ok, QMessageBox::NoButton); szCurrent = ""; m_pLocalAvatar->setNull(); } - } else { + } + else + { // else OK.. got it in the cache - m_pLocalAvatar->set(*(a->pixmap()),a->localPath()); + m_pLocalAvatar->set(*(a->pixmap()), a->localPath()); delete a; } - } else { + } + else + { // this is a local path if(m_pLocalAvatar->load(szCurrent)) { @@ -582,12 +611,16 @@ void OptionsWidget_identityAvatar::chooseAvatar() szCurrent = tmp.right(tmp.length() - (idx + 1)); tmp = szCurrent; } - } else { + } + else + { // unloadable - QMessageBox::warning(this,__tr2qs_ctx("Failed to Load Avatar - KVIrc","options"), - __tr2qs_ctx("Failed to load the avatar image.
" \ - "It may be an inaccessible file or an " \ - "unsupported image format.","options"),QMessageBox::Ok,QMessageBox::NoButton); + QMessageBox::warning(this, __tr2qs_ctx("Failed to Load Avatar - KVIrc", "options"), + __tr2qs_ctx("Failed to load the avatar image.
" + "It may be an inaccessible file or an " + "unsupported image format.", + "options"), + QMessageBox::Ok, QMessageBox::NoButton); szCurrent = ""; } } @@ -597,32 +630,30 @@ void OptionsWidget_identityAvatar::chooseAvatar() if((m_pLocalAvatar->pixmap()->width() > 1024) || (m_pLocalAvatar->pixmap()->height() > 768)) { QMessageBox::warning( - this, - __tr2qs_ctx("File Dimensions - KVIrc","options"), - __tr2qs_ctx( - "The avatar you have chosen is bigger than 1024x768 pixels.
" \ - "Such a big image will not be seen on all the user monitors
" \ - "and will probably be scaled by the remote clients with poor quality
" \ - "algorithms to improve performance. You *should* scale it manually
" \ - "to a sane size (like 800x600) or choose a different image.", - "options" - ) - ); - } else { + this, + __tr2qs_ctx("File Dimensions - KVIrc", "options"), + __tr2qs_ctx( + "The avatar you have chosen is bigger than 1024x768 pixels.
" + "Such a big image will not be seen on all the user monitors
" + "and will probably be scaled by the remote clients with poor quality
" + "algorithms to improve performance. You *should* scale it manually
" + "to a sane size (like 800x600) or choose a different image.", + "options")); + } + else + { QFileInfo inf(m_pLocalAvatar->path()); if(inf.size() > 524288) { QMessageBox::warning( - this, - __tr2qs_ctx("File Size - KVIrc","options"), - __tr2qs_ctx( - "The avatar you have chosen is bigger than 500 KiB
" \ - "and most clients will refuse to download it.
" \ - "You *should* either scale it, use a different storage
" \ - "format or choose a different image.", - "options" - ) - ); + this, + __tr2qs_ctx("File Size - KVIrc", "options"), + __tr2qs_ctx( + "The avatar you have chosen is bigger than 500 KiB
" + "and most clients will refuse to download it.
" + "You *should* either scale it, use a different storage
" + "format or choose a different image.", + "options")); } } } @@ -631,13 +662,12 @@ void OptionsWidget_identityAvatar::chooseAvatar() m_pAvatarPreview->setPixmap(m_pLocalAvatar); } - OptionsWidget_identityAdvanced::OptionsWidget_identityAdvanced(QWidget * parent) -: KviOptionsWidget(parent) + : KviOptionsWidget(parent) { - m_pISelector=0; - m_pWSelector=0; - m_pSSelector=0; + m_pISelector = 0; + m_pWSelector = 0; + m_pSSelector = 0; m_sModeStr = KVI_OPTION_STRING(KviOption_stringDefaultUserMode); m_bI = m_sModeStr.contains('i'); @@ -647,25 +677,27 @@ OptionsWidget_identityAdvanced::OptionsWidget_identityAdvanced(QWidget * parent) createLayout(); layout()->setMargin(10); - KviTalGroupBox * gbox = addGroupBox(0,0,0,0,Qt::Horizontal,__tr2qs_ctx("User Mode","options")); - m_pISelector = addBoolSelector(gbox,__tr2qs_ctx("Invisible (+i)","options"),&m_bI); - m_pSSelector = addBoolSelector(gbox,__tr2qs_ctx("Server notices (+s)","options"),&m_bS); - m_pWSelector = addBoolSelector(gbox,__tr2qs_ctx("WALLOPS (+w)","options"),&m_bW); + KviTalGroupBox * gbox = addGroupBox(0, 0, 0, 0, Qt::Horizontal, __tr2qs_ctx("User Mode", "options")); + m_pISelector = addBoolSelector(gbox, __tr2qs_ctx("Invisible (+i)", "options"), &m_bI); + m_pSSelector = addBoolSelector(gbox, __tr2qs_ctx("Server notices (+s)", "options"), &m_bS); + m_pWSelector = addBoolSelector(gbox, __tr2qs_ctx("WALLOPS (+w)", "options"), &m_bW); - gbox = addGroupBox(0,1,0,1,Qt::Horizontal,__tr2qs_ctx("Default Messages","options")); + gbox = addGroupBox(0, 1, 0, 1, Qt::Horizontal, __tr2qs_ctx("Default Messages", "options")); - KviStringSelector * sel = addStringSelector(gbox, __tr2qs_ctx("Part message:","options"),KviOption_stringPartMessage); + KviStringSelector * sel = addStringSelector(gbox, __tr2qs_ctx("Part message:", "options"), KviOption_stringPartMessage); sel->setMinimumLabelWidth(120); - mergeTip(sel,__tr2qs_ctx("This is the default part message that will be used when you " \ - "leave a channel by closing a channel window.","options")); + mergeTip(sel, __tr2qs_ctx("This is the default part message that will be used when you " + "leave a channel by closing a channel window.", + "options")); - sel = addStringSelector(gbox, __tr2qs_ctx("Quit message:","options"),KviOption_stringQuitMessage); + sel = addStringSelector(gbox, __tr2qs_ctx("Quit message:", "options"), KviOption_stringQuitMessage); sel->setMinimumLabelWidth(120); - mergeTip(sel,__tr2qs_ctx("This is the default quit message that will be used when you " \ - "quit your IRC session by closing the console window or disconnecting by pressing the disconnect button.","options")); + mergeTip(sel, __tr2qs_ctx("This is the default quit message that will be used when you " + "quit your IRC session by closing the console window or disconnecting by pressing the disconnect button.", + "options")); - addRowSpacer(0,2,0,2); + addRowSpacer(0, 2, 0, 2); } OptionsWidget_identityAdvanced::~OptionsWidget_identityAdvanced() @@ -677,14 +709,16 @@ void OptionsWidget_identityAdvanced::commit() KviOptionsWidget::commit(); m_sModeStr = m_bI ? "i" : ""; - if(m_bS)m_sModeStr += "s"; - if(m_bW)m_sModeStr += "w"; + if(m_bS) + m_sModeStr += "s"; + if(m_bW) + m_sModeStr += "w"; KVI_OPTION_STRING(KviOption_stringDefaultUserMode) = m_sModeStr.ptr(); } OptionsWidget_identityProfile::OptionsWidget_identityProfile(QWidget * pParent) -: KviOptionsWidget(pParent) + : KviOptionsWidget(pParent) { setObjectName("identity_profiles_option_widget"); m_pEditor = 0; @@ -696,11 +730,11 @@ OptionsWidget_identityProfile::OptionsWidget_identityProfile(QWidget * pParent) KviIdentityProfileSet * pSet = KviIdentityProfileSet::instance(); bool bEnabled = pSet ? (pSet->isEnabled() && !pSet->isEmpty()) : false; - m_pProfilesCheck = new QCheckBox(__tr2qs_ctx("Enable network profiles","options"),this); - KviTalToolTip::add(m_pProfilesCheck,__tr2qs_ctx("This check enables the use of network profiles","options")); + m_pProfilesCheck = new QCheckBox(__tr2qs_ctx("Enable network profiles", "options"), this); + KviTalToolTip::add(m_pProfilesCheck, __tr2qs_ctx("This check enables the use of network profiles", "options")); m_pProfilesCheck->setChecked(bEnabled); - pLayout->addWidget(m_pProfilesCheck,0,0,1,3); - connect(m_pProfilesCheck,SIGNAL(toggled(bool)),this,SLOT(toggleControls())); + pLayout->addWidget(m_pProfilesCheck, 0, 0, 1, 3); + connect(m_pProfilesCheck, SIGNAL(toggled(bool)), this, SLOT(toggleControls())); // Profiles list m_pTreeWidget = new QTreeWidget(this); @@ -708,36 +742,37 @@ OptionsWidget_identityProfile::OptionsWidget_identityProfile(QWidget * pParent) m_pTreeWidget->setAllColumnsShowFocus(true); QStringList labels; - labels.append(__tr2qs_ctx("Name","options")); - labels.append(__tr2qs_ctx("Network","options")); - labels.append(__tr2qs_ctx("Nickname","options")); - labels.append(__tr2qs_ctx("Alt. nickname","options")); - labels.append(__tr2qs_ctx("Username","options")); - labels.append(__tr2qs_ctx("Real name","options")); + labels.append(__tr2qs_ctx("Name", "options")); + labels.append(__tr2qs_ctx("Network", "options")); + labels.append(__tr2qs_ctx("Nickname", "options")); + labels.append(__tr2qs_ctx("Alt. nickname", "options")); + labels.append(__tr2qs_ctx("Username", "options")); + labels.append(__tr2qs_ctx("Real name", "options")); m_pTreeWidget->setHeaderLabels(labels); - KviTalToolTip::add(m_pTreeWidget, \ - __tr2qs_ctx("This is a set of rules to use profiles.
" \ - "KVIrc will use them to handle the user connection " \ - "data before the data is sent to the IRC server.
" \ - "This is useful if a user wants to use different data " \ - "on different networks without changing them at every " \ - "connection attempt.","options")); - pLayout->addWidget(m_pTreeWidget,1,0,1,3); - connect(m_pTreeWidget,SIGNAL(itemSelectionChanged()),this,SLOT(toggleControls())); + KviTalToolTip::add(m_pTreeWidget, + __tr2qs_ctx("This is a set of rules to use profiles.
" + "KVIrc will use them to handle the user connection " + "data before the data is sent to the IRC server.
" + "This is useful if a user wants to use different data " + "on different networks without changing them at every " + "connection attempt.", + "options")); + pLayout->addWidget(m_pTreeWidget, 1, 0, 1, 3); + connect(m_pTreeWidget, SIGNAL(itemSelectionChanged()), this, SLOT(toggleControls())); // Buttons box KviTalHBox * pBtnBox = new KviTalHBox(this); - pLayout->addWidget(pBtnBox,2,0,1,3); + pLayout->addWidget(pBtnBox, 2, 0, 1, 3); - m_pBtnAddProfile = new QPushButton(__tr2qs_ctx("Add Profile","options"),pBtnBox); - connect(m_pBtnAddProfile,SIGNAL(clicked()),this,SLOT(addProfileEntry())); + m_pBtnAddProfile = new QPushButton(__tr2qs_ctx("Add Profile", "options"), pBtnBox); + connect(m_pBtnAddProfile, SIGNAL(clicked()), this, SLOT(addProfileEntry())); - m_pBtnEditProfile = new QPushButton(__tr2qs_ctx("Edit Profile","options"),pBtnBox); - connect(m_pBtnEditProfile,SIGNAL(clicked()),this,SLOT(editProfileEntry())); + m_pBtnEditProfile = new QPushButton(__tr2qs_ctx("Edit Profile", "options"), pBtnBox); + connect(m_pBtnEditProfile, SIGNAL(clicked()), this, SLOT(editProfileEntry())); - m_pBtnDelProfile = new QPushButton(__tr2qs_ctx("Delete Profile","options"),pBtnBox); - connect(m_pBtnDelProfile,SIGNAL(clicked()),this,SLOT(delProfileEntry())); + m_pBtnDelProfile = new QPushButton(__tr2qs_ctx("Delete Profile", "options"), pBtnBox); + connect(m_pBtnDelProfile, SIGNAL(clicked()), this, SLOT(delProfileEntry())); // Fill in the treewidget if(pSet && pSet->profiles()) @@ -747,12 +782,12 @@ OptionsWidget_identityProfile::OptionsWidget_identityProfile(QWidget * pParent) for(KviIdentityProfile * pProfile = pList->first(); pProfile; pProfile = pList->next()) { pItem = new QTreeWidgetItem(m_pTreeWidget); - pItem->setText(0,pProfile->name()); - pItem->setText(1,pProfile->network()); - pItem->setText(2,pProfile->nick()); - pItem->setText(3,pProfile->altNick()); - pItem->setText(4,pProfile->userName()); - pItem->setText(5,pProfile->realName()); + pItem->setText(0, pProfile->name()); + pItem->setText(1, pProfile->network()); + pItem->setText(2, pProfile->nick()); + pItem->setText(3, pProfile->altNick()); + pItem->setText(4, pProfile->userName()); + pItem->setText(5, pProfile->realName()); } } @@ -786,12 +821,12 @@ void OptionsWidget_identityProfile::addProfileEntry() if(m_pEditor->editProfile(&profile)) { QTreeWidgetItem * pItem = new QTreeWidgetItem(m_pTreeWidget); - pItem->setText(0,profile.name()); - pItem->setText(1,profile.network()); - pItem->setText(2,profile.nick()); - pItem->setText(3,profile.altNick()); - pItem->setText(4,profile.userName()); - pItem->setText(5,profile.realName()); + pItem->setText(0, profile.name()); + pItem->setText(1, profile.network()); + pItem->setText(2, profile.nick()); + pItem->setText(3, profile.altNick()); + pItem->setText(4, profile.userName()); + pItem->setText(5, profile.realName()); } } @@ -810,29 +845,29 @@ void OptionsWidget_identityProfile::editProfileEntry() profile.setUserName(pItem->text(4)); profile.setRealName(pItem->text(5)); - m_iCurrentEditedProfile=m_pTreeWidget->indexOfTopLevelItem(pItem); + m_iCurrentEditedProfile = m_pTreeWidget->indexOfTopLevelItem(pItem); if(m_pEditor) delete m_pEditor; m_pEditor = new IdentityProfileEditor(this); if(m_pEditor->editProfile(&profile)) { - pItem->setText(0,profile.name()); - pItem->setText(1,profile.network()); - pItem->setText(2,profile.nick()); - pItem->setText(3,profile.altNick()); - pItem->setText(4,profile.userName()); - pItem->setText(5,profile.realName()); + pItem->setText(0, profile.name()); + pItem->setText(1, profile.network()); + pItem->setText(2, profile.nick()); + pItem->setText(3, profile.altNick()); + pItem->setText(4, profile.userName()); + pItem->setText(5, profile.realName()); } } void OptionsWidget_identityProfile::editProfileOkPressed() { - for(int i=0; i < m_pTreeWidget->topLevelItemCount(); i++) + for(int i = 0; i < m_pTreeWidget->topLevelItemCount(); i++) { - if(m_pEditor->m_pNameEdit->text() == m_pTreeWidget->topLevelItem(i)->text(0) && i!=m_iCurrentEditedProfile) + if(m_pEditor->m_pNameEdit->text() == m_pTreeWidget->topLevelItem(i)->text(0) && i != m_iCurrentEditedProfile) { - QMessageBox::warning(this,__tr2qs_ctx("Invalid Profile Rule - KVIrc","options"),__tr2qs_ctx("There is already a profile with that name","options"),__tr2qs_ctx("OK","options")); + QMessageBox::warning(this, __tr2qs_ctx("Invalid Profile Rule - KVIrc", "options"), __tr2qs_ctx("There is already a profile with that name", "options"), __tr2qs_ctx("OK", "options")); return; } } @@ -857,7 +892,7 @@ void OptionsWidget_identityProfile::commit() { KviIdentityProfileSet::instance()->setEnabled(m_pProfilesCheck->isChecked()); QTreeWidgetItem * pItem; - for(int i=0; i < m_pTreeWidget->topLevelItemCount(); i++) + for(int i = 0; i < m_pTreeWidget->topLevelItemCount(); i++) { pItem = (QTreeWidgetItem *)m_pTreeWidget->topLevelItem(i); @@ -877,69 +912,69 @@ void OptionsWidget_identityProfile::commit() } IdentityProfileEditor::IdentityProfileEditor(QWidget * pParent) -: QDialog(pParent) + : QDialog(pParent) { setObjectName("identity_profile_editor"); - setWindowTitle(__tr2qs_ctx("Profile Editor - KVIrc","options")); + setWindowTitle(__tr2qs_ctx("Profile Editor - KVIrc", "options")); QGridLayout * pLayout = new QGridLayout(this); - QLabel * pLabel = new QLabel(__tr2qs_ctx("Profile name:","options"),this); - pLayout->addWidget(pLabel,0,0); + QLabel * pLabel = new QLabel(__tr2qs_ctx("Profile name:", "options"), this); + pLayout->addWidget(pLabel, 0, 0); m_pNameEdit = new QLineEdit(this); - KviTalToolTip::add(m_pNameEdit,__tr2qs_ctx("Put here the name of the profile","options")); - pLayout->addWidget(m_pNameEdit,0,1,1,2); - connect(m_pNameEdit,SIGNAL(textChanged(const QString &)),this,SLOT(toggleButton())); + KviTalToolTip::add(m_pNameEdit, __tr2qs_ctx("Put here the name of the profile", "options")); + pLayout->addWidget(m_pNameEdit, 0, 1, 1, 2); + connect(m_pNameEdit, SIGNAL(textChanged(const QString &)), this, SLOT(toggleButton())); - pLabel = new QLabel(__tr2qs_ctx("Network name:","options"),this); - pLayout->addWidget(pLabel,1,0); + pLabel = new QLabel(__tr2qs_ctx("Network name:", "options"), this); + pLayout->addWidget(pLabel, 1, 0); m_pNetworkEdit = new QLineEdit(this); - KviTalToolTip::add(m_pNetworkEdit,__tr2qs_ctx("Put here the name of the network","options")); - pLayout->addWidget(m_pNetworkEdit,1,1,1,2); + KviTalToolTip::add(m_pNetworkEdit, __tr2qs_ctx("Put here the name of the network", "options")); + pLayout->addWidget(m_pNetworkEdit, 1, 1, 1, 2); - pLabel = new QLabel(__tr2qs_ctx("Nickname:","options"),this); - pLayout->addWidget(pLabel,2,0); + pLabel = new QLabel(__tr2qs_ctx("Nickname:", "options"), this); + pLayout->addWidget(pLabel, 2, 0); m_pNickEdit = new QLineEdit(this); - KviTalToolTip::add(m_pNickEdit,__tr2qs_ctx("Put here the nickname you want to use","options")); - pLayout->addWidget(m_pNickEdit,2,1,1,2); + KviTalToolTip::add(m_pNickEdit, __tr2qs_ctx("Put here the nickname you want to use", "options")); + pLayout->addWidget(m_pNickEdit, 2, 1, 1, 2); - pLabel = new QLabel(__tr2qs_ctx("Alt. nickname:","options"),this); - pLayout->addWidget(pLabel,3,0); + pLabel = new QLabel(__tr2qs_ctx("Alt. nickname:", "options"), this); + pLayout->addWidget(pLabel, 3, 0); m_pAltNickEdit = new QLineEdit(this); - KviTalToolTip::add(m_pAltNickEdit,__tr2qs_ctx("Put here the alternative nickname you want to use","options")); - pLayout->addWidget(m_pAltNickEdit,3,1,1,2); + KviTalToolTip::add(m_pAltNickEdit, __tr2qs_ctx("Put here the alternative nickname you want to use", "options")); + pLayout->addWidget(m_pAltNickEdit, 3, 1, 1, 2); - pLabel = new QLabel(__tr2qs_ctx("Username:","options"),this); - pLayout->addWidget(pLabel,4,0); + pLabel = new QLabel(__tr2qs_ctx("Username:", "options"), this); + pLayout->addWidget(pLabel, 4, 0); m_pUserNameEdit = new QLineEdit(this); - KviTalToolTip::add(m_pUserNameEdit,__tr2qs_ctx("Put here the username you want to use","options")); - pLayout->addWidget(m_pUserNameEdit,4,1,1,2); + KviTalToolTip::add(m_pUserNameEdit, __tr2qs_ctx("Put here the username you want to use", "options")); + pLayout->addWidget(m_pUserNameEdit, 4, 1, 1, 2); - pLabel = new QLabel(__tr2qs_ctx("Real name:","options"),this); - pLayout->addWidget(pLabel,5,0); + pLabel = new QLabel(__tr2qs_ctx("Real name:", "options"), this); + pLayout->addWidget(pLabel, 5, 0); m_pRealNameEdit = new QLineEdit(this); - KviTalToolTip::add(m_pRealNameEdit,__tr2qs_ctx("Put here the real name you want to use","options")); - pLayout->addWidget(m_pRealNameEdit,5,1,1,2); + KviTalToolTip::add(m_pRealNameEdit, __tr2qs_ctx("Put here the real name you want to use", "options")); + pLayout->addWidget(m_pRealNameEdit, 5, 1, 1, 2); KviTalHBox * pBox = new KviTalHBox(this); pBox->setAlignment(Qt::AlignRight); - pLayout->addWidget(pBox,6,1,1,2); + pLayout->addWidget(pBox, 6, 1, 1, 2); - QPushButton * p = new QPushButton(__tr2qs_ctx("Cancel","options"),pBox); + QPushButton * p = new QPushButton(__tr2qs_ctx("Cancel", "options"), pBox); //p->setMinimumWidth(100); - connect(p,SIGNAL(clicked()),this,SLOT(reject())); + connect(p, SIGNAL(clicked()), this, SLOT(reject())); - m_pBtnOk = new QPushButton(__tr2qs_ctx("OK","options"),pBox); + m_pBtnOk = new QPushButton(__tr2qs_ctx("OK", "options"), pBox); m_pBtnOk->setEnabled(false); - connect(m_pBtnOk,SIGNAL(clicked()),pParent,SLOT(editProfileOkPressed())); + connect(m_pBtnOk, SIGNAL(clicked()), pParent, SLOT(editProfileOkPressed())); - pLayout->setColumnStretch(1,1); + pLayout->setColumnStretch(1, 1); setMinimumWidth(250); @@ -964,7 +999,8 @@ bool IdentityProfileEditor::editProfile(KviIdentityProfile * pProfile) m_pNameEdit->selectAll(); // Show the dialog - if(exec() != QDialog::Accepted) return false; + if(exec() != QDialog::Accepted) + return false; // Store data in the object pProfile->setName(m_pNameEdit->text()); diff --git a/src/modules/options/OptionsWidget_identity.h b/src/modules/options/OptionsWidget_identity.h index 86820871d..9e63450f1 100644 --- a/src/modules/options/OptionsWidget_identity.h +++ b/src/modules/options/OptionsWidget_identity.h @@ -26,7 +26,6 @@ // //============================================================================= - #include "KviOptionsWidget.h" #include "kvi_settings.h" #include "KviSelectors.h" @@ -47,14 +46,16 @@ class NickAlternativesDialog : public QDialog friend class KviIdentityGeneralOptionsWidget; Q_OBJECT protected: - NickAlternativesDialog(QWidget * par,const QString &n1,const QString &n2,const QString &n3); + NickAlternativesDialog(QWidget * par, const QString & n1, const QString & n2, const QString & n3); ~NickAlternativesDialog(); + protected: QLineEdit * m_pNickEdit1; QLineEdit * m_pNickEdit2; QLineEdit * m_pNickEdit3; + protected: - void fill(QString &n1,QString &n2,QString &n3); + void fill(QString & n1, QString & n2, QString & n3); }; class AvatarSelectionDialog : public QDialog @@ -62,48 +63,48 @@ class AvatarSelectionDialog : public QDialog friend class OptionsWidget_identityAvatar; Q_OBJECT public: - AvatarSelectionDialog(QWidget * par,const QString &szInitialPath); + AvatarSelectionDialog(QWidget * par, const QString & szInitialPath); ~AvatarSelectionDialog(); + protected: - QLineEdit * m_pLineEdit; - QString m_szAvatarName; + QLineEdit * m_pLineEdit; + QString m_szAvatarName; + protected: virtual void closeEvent(QCloseEvent * e); - const QString &avatarName(){ return m_szAvatarName; }; + const QString & avatarName() { return m_szAvatarName; }; protected slots: void okClicked(); void cancelClicked(); void chooseFileClicked(); }; - class AvatarDownloadDialog : public QDialog { friend class OptionsWidget_identityAvatar; Q_OBJECT public: - AvatarDownloadDialog(QWidget * par,const QString &szUrl); + AvatarDownloadDialog(QWidget * par, const QString & szUrl); ~AvatarDownloadDialog(); + protected: KviHttpRequest * m_pRequest; - QLabel * m_pOutput; - QString m_szErrorMessage; - QString m_szLocalFileName; - QString m_szUrl; + QLabel * m_pOutput; + QString m_szErrorMessage; + QString m_szLocalFileName; + QString m_szUrl; + protected: virtual void closeEvent(QCloseEvent * e); - const QString & localFileName(){ return m_szLocalFileName; }; - const QString & errorMessage(){ return m_szErrorMessage; }; + const QString & localFileName() { return m_szLocalFileName; }; + const QString & errorMessage() { return m_szErrorMessage; }; protected slots: void startDownload(); void cancelClicked(); void downloadTerminated(bool bSuccess); - void downloadMessage(const QString &szMsg); + void downloadMessage(const QString & szMsg); }; - - - class IdentityProfileEditor : public QDialog { friend class OptionsWidget_identityProfile; @@ -111,28 +112,27 @@ class IdentityProfileEditor : public QDialog public: IdentityProfileEditor(QWidget * pParent); ~IdentityProfileEditor(); + protected: - QLineEdit * m_pNameEdit; - QLineEdit * m_pNetworkEdit; - QLineEdit * m_pNickEdit; - QLineEdit * m_pAltNickEdit; - QLineEdit * m_pUserNameEdit; - QLineEdit * m_pRealNameEdit; + QLineEdit * m_pNameEdit; + QLineEdit * m_pNetworkEdit; + QLineEdit * m_pNickEdit; + QLineEdit * m_pAltNickEdit; + QLineEdit * m_pUserNameEdit; + QLineEdit * m_pRealNameEdit; QPushButton * m_pBtnOk; + public: bool editProfile(KviIdentityProfile * pProfile); protected slots: void toggleButton(); }; - - #define KVI_OPTIONS_WIDGET_ICON_OptionsWidget_identity KviIconManager::Ident #define KVI_OPTIONS_WIDGET_NAME_OptionsWidget_identity __tr2qs_no_lookup("Identity") #define KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_identity 99998 #define KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_identity true - class OptionsWidget_identity : public KviOptionsWidget { Q_OBJECT @@ -141,82 +141,80 @@ public: ~OptionsWidget_identity(); }; - - #define KVI_OPTIONS_WIDGET_ICON_KviIdentityGeneralOptionsWidget KviIconManager::Ident #define KVI_OPTIONS_WIDGET_NAME_KviIdentityGeneralOptionsWidget __tr2qs_no_lookup("General") #define KVI_OPTIONS_WIDGET_PRIORITY_KviIdentityGeneralOptionsWidget 90000 #define KVI_OPTIONS_WIDGET_PARENT_KviIdentityGeneralOptionsWidget OptionsWidget_identity - class KviIdentityGeneralOptionsWidget : public KviOptionsWidget { Q_OBJECT public: KviIdentityGeneralOptionsWidget(QWidget * pParent); ~KviIdentityGeneralOptionsWidget(); + protected: - QString m_szAltNicknames[3]; + QString m_szAltNicknames[3]; - QComboBox * m_pAgeCombo; - QComboBox * m_pGenderCombo; + QComboBox * m_pAgeCombo; + QComboBox * m_pGenderCombo; protected slots: void setNickAlternatives(); + protected: virtual void commit(); }; - #define KVI_OPTIONS_WIDGET_ICON_OptionsWidget_identityAvatar KviIconManager::Avatar #define KVI_OPTIONS_WIDGET_NAME_OptionsWidget_identityAvatar __tr2qs_no_lookup("Avatar") #define KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_identityAvatar 80000 #define KVI_OPTIONS_WIDGET_PARENT_OptionsWidget_identityAvatar OptionsWidget_identity - class OptionsWidget_identityAvatar : public KviOptionsWidget { Q_OBJECT public: OptionsWidget_identityAvatar(QWidget * pParent); ~OptionsWidget_identityAvatar(); + protected: - QCheckBox * m_pUseAvatarCheck; - QLineEdit * m_pAvatarNameEdit; - QPushButton * m_pChooseAvatarButton; - KviPixmap * m_pLocalAvatar; + QCheckBox * m_pUseAvatarCheck; + QLineEdit * m_pAvatarNameEdit; + QPushButton * m_pChooseAvatarButton; + KviPixmap * m_pLocalAvatar; KviPixmapPreview * m_pAvatarPreview; protected slots: void chooseAvatar(); + protected: virtual void commit(); }; - #define KVI_OPTIONS_WIDGET_ICON_OptionsWidget_identityAdvanced KviIconManager::Gui #define KVI_OPTIONS_WIDGET_NAME_OptionsWidget_identityAdvanced __tr2qs_no_lookup("Advanced") #define KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_identityAdvanced 70000 #define KVI_OPTIONS_WIDGET_PARENT_OptionsWidget_identityAdvanced OptionsWidget_identity - class OptionsWidget_identityAdvanced : public KviOptionsWidget { Q_OBJECT public: OptionsWidget_identityAdvanced(QWidget * pParent); ~OptionsWidget_identityAdvanced(); + protected: - bool m_bI; - bool m_bW; - bool m_bS; - KviCString m_sModeStr; - KviBoolSelector * m_pISelector; - KviBoolSelector * m_pWSelector; - KviBoolSelector * m_pSSelector; + bool m_bI; + bool m_bW; + bool m_bS; + KviCString m_sModeStr; + KviBoolSelector * m_pISelector; + KviBoolSelector * m_pWSelector; + KviBoolSelector * m_pSSelector; + protected: virtual void commit(); }; - #define KVI_OPTIONS_WIDGET_ICON_OptionsWidget_identityProfile KviIconManager::UserWindow #define KVI_OPTIONS_WIDGET_NAME_OptionsWidget_identityProfile __tr2qs_no_lookup("Profiles") #define KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_identityProfile 60000 @@ -228,14 +226,16 @@ class OptionsWidget_identityProfile : public KviOptionsWidget public: OptionsWidget_identityProfile(QWidget * pParent); ~OptionsWidget_identityProfile(); + protected: - QTreeWidget * m_pTreeWidget; - QCheckBox * m_pProfilesCheck; - QPushButton * m_pBtnAddProfile; - QPushButton * m_pBtnEditProfile; - QPushButton * m_pBtnDelProfile; + QTreeWidget * m_pTreeWidget; + QCheckBox * m_pProfilesCheck; + QPushButton * m_pBtnAddProfile; + QPushButton * m_pBtnEditProfile; + QPushButton * m_pBtnDelProfile; IdentityProfileEditor * m_pEditor; - int m_iCurrentEditedProfile; + int m_iCurrentEditedProfile; + public: virtual void commit(); protected slots: diff --git a/src/modules/options/OptionsWidget_ignore.cpp b/src/modules/options/OptionsWidget_ignore.cpp index 85bd4a068..4715426a1 100644 --- a/src/modules/options/OptionsWidget_ignore.cpp +++ b/src/modules/options/OptionsWidget_ignore.cpp @@ -30,24 +30,23 @@ #include - OptionsWidget_ignore::OptionsWidget_ignore(QWidget * parent) -: KviOptionsWidget(parent) + : KviOptionsWidget(parent) { setObjectName("ignore_options_widget"); createLayout(); - KviTalGroupBox *g = addGroupBox(0,0,0,0,Qt::Horizontal,__tr2qs_ctx("Enable Ignore for","options")); - m_pIgnorePrivmsg = addBoolSelector(g,__tr2qs_ctx("Private/Channel messages","options"),KviOption_boolEnableIgnoreOnPrivMsg); - m_pIgnoreNotice = addBoolSelector(g,__tr2qs_ctx("Private/Channel notices","options"),KviOption_boolEnableIgnoreOnNotice); + KviTalGroupBox * g = addGroupBox(0, 0, 0, 0, Qt::Horizontal, __tr2qs_ctx("Enable Ignore for", "options")); + m_pIgnorePrivmsg = addBoolSelector(g, __tr2qs_ctx("Private/Channel messages", "options"), KviOption_boolEnableIgnoreOnPrivMsg); + m_pIgnoreNotice = addBoolSelector(g, __tr2qs_ctx("Private/Channel notices", "options"), KviOption_boolEnableIgnoreOnNotice); - connect(m_pIgnorePrivmsg,SIGNAL(toggled(bool)),this,SLOT(enableVerbose(bool))); + connect(m_pIgnorePrivmsg, SIGNAL(toggled(bool)), this, SLOT(enableVerbose(bool))); - m_pVerboseIgnore = addBoolSelector(0,1,0,1,__tr2qs_ctx("Use verbose ignore (show messages in console)","options"), - KviOption_boolVerboseIgnore, - KVI_OPTION_BOOL(KviOption_boolEnableIgnoreOnPrivMsg) || KVI_OPTION_BOOL(KviOption_boolEnableIgnoreOnNotice)); + m_pVerboseIgnore = addBoolSelector(0, 1, 0, 1, __tr2qs_ctx("Use verbose ignore (show messages in console)", "options"), + KviOption_boolVerboseIgnore, + KVI_OPTION_BOOL(KviOption_boolEnableIgnoreOnPrivMsg) || KVI_OPTION_BOOL(KviOption_boolEnableIgnoreOnNotice)); - addRowSpacer(0,2,0,2); + addRowSpacer(0, 2, 0, 2); } OptionsWidget_ignore::~OptionsWidget_ignore() diff --git a/src/modules/options/OptionsWidget_ignore.h b/src/modules/options/OptionsWidget_ignore.h index 55669aa10..ff4083909 100644 --- a/src/modules/options/OptionsWidget_ignore.h +++ b/src/modules/options/OptionsWidget_ignore.h @@ -39,6 +39,7 @@ class OptionsWidget_ignore : public KviOptionsWidget public: OptionsWidget_ignore(QWidget * parent); ~OptionsWidget_ignore(); + public: KviBoolSelector * m_pIgnorePrivmsg; KviBoolSelector * m_pIgnoreNotice; diff --git a/src/modules/options/OptionsWidget_input.cpp b/src/modules/options/OptionsWidget_input.cpp index 2b1c57bf4..c4431b68a 100644 --- a/src/modules/options/OptionsWidget_input.cpp +++ b/src/modules/options/OptionsWidget_input.cpp @@ -30,40 +30,40 @@ #include OptionsWidget_inputLook::OptionsWidget_inputLook(QWidget * parent) -: KviOptionsWidget(parent) + : KviOptionsWidget(parent) { setObjectName("inputlook_options_widget"); createLayout(); - addFontSelector(0,0,1,0,__tr2qs_ctx("Font:","options"),KviOption_fontInput); - addColorSelector(0,1,1,1,__tr2qs_ctx("Background color:","options"),KviOption_colorInputBackground); - addColorSelector(0,2,1,2,__tr2qs_ctx("Foreground color:","options"),KviOption_colorInputForeground); - addColorSelector(0,3,1,3,__tr2qs_ctx("Selection background color:","options"),KviOption_colorInputSelectionBackground); - addColorSelector(0,4,1,4,__tr2qs_ctx("Selection foreground color:","options"),KviOption_colorInputSelectionForeground); - addColorSelector(0,5,1,5,__tr2qs_ctx("Control char color:","options"),KviOption_colorInputControl); - addColorSelector(0,6,1,6,__tr2qs_ctx("Cursor color:","options"),KviOption_colorInputCursor); + addFontSelector(0, 0, 1, 0, __tr2qs_ctx("Font:", "options"), KviOption_fontInput); + addColorSelector(0, 1, 1, 1, __tr2qs_ctx("Background color:", "options"), KviOption_colorInputBackground); + addColorSelector(0, 2, 1, 2, __tr2qs_ctx("Foreground color:", "options"), KviOption_colorInputForeground); + addColorSelector(0, 3, 1, 3, __tr2qs_ctx("Selection background color:", "options"), KviOption_colorInputSelectionBackground); + addColorSelector(0, 4, 1, 4, __tr2qs_ctx("Selection foreground color:", "options"), KviOption_colorInputSelectionForeground); + addColorSelector(0, 5, 1, 5, __tr2qs_ctx("Control char color:", "options"), KviOption_colorInputControl); + addColorSelector(0, 6, 1, 6, __tr2qs_ctx("Cursor color:", "options"), KviOption_colorInputCursor); - addPixmapSelector(0,7,1,7,__tr2qs_ctx("Background image:","options"),KviOption_pixmapInputBackground); + addPixmapSelector(0, 7, 1, 7, __tr2qs_ctx("Background image:", "options"), KviOption_pixmapInputBackground); - addLabel(0,8,0,8,__tr2qs_ctx("Horizontal align:","options")); - m_pHorizontalAlign=new QComboBox(this); - addWidgetToLayout(m_pHorizontalAlign,1,8,1,8); + addLabel(0, 8, 0, 8, __tr2qs_ctx("Horizontal align:", "options")); + m_pHorizontalAlign = new QComboBox(this); + addWidgetToLayout(m_pHorizontalAlign, 1, 8, 1, 8); - addLabel(0,9,0,9,__tr2qs_ctx("Vertical align:","options")); - m_pVerticalAlign=new QComboBox(this); - addWidgetToLayout(m_pVerticalAlign,1,9,1,9); + addLabel(0, 9, 0, 9, __tr2qs_ctx("Vertical align:", "options")); + m_pVerticalAlign = new QComboBox(this); + addWidgetToLayout(m_pVerticalAlign, 1, 9, 1, 9); - m_pHorizontalAlign->addItem(__tr2qs_ctx("Tile","options")); - m_pHorizontalAlign->addItem(__tr2qs_ctx("Left","options")); - m_pHorizontalAlign->addItem(__tr2qs_ctx("Right","options")); - m_pHorizontalAlign->addItem(__tr2qs_ctx("Center","options")); + m_pHorizontalAlign->addItem(__tr2qs_ctx("Tile", "options")); + m_pHorizontalAlign->addItem(__tr2qs_ctx("Left", "options")); + m_pHorizontalAlign->addItem(__tr2qs_ctx("Right", "options")); + m_pHorizontalAlign->addItem(__tr2qs_ctx("Center", "options")); - m_pVerticalAlign->addItem(__tr2qs_ctx("Tile","options")); - m_pVerticalAlign->addItem(__tr2qs_ctx("Top","options")); - m_pVerticalAlign->addItem(__tr2qs_ctx("Bottom","options")); - m_pVerticalAlign->addItem(__tr2qs_ctx("Center","options")); + m_pVerticalAlign->addItem(__tr2qs_ctx("Tile", "options")); + m_pVerticalAlign->addItem(__tr2qs_ctx("Top", "options")); + m_pVerticalAlign->addItem(__tr2qs_ctx("Bottom", "options")); + m_pVerticalAlign->addItem(__tr2qs_ctx("Center", "options")); - switch( KVI_OPTION_UINT(KviOption_uintInputPixmapAlign) & Qt::AlignHorizontal_Mask) + switch(KVI_OPTION_UINT(KviOption_uintInputPixmapAlign) & Qt::AlignHorizontal_Mask) { case Qt::AlignLeft: m_pHorizontalAlign->setCurrentIndex(1); @@ -78,7 +78,7 @@ OptionsWidget_inputLook::OptionsWidget_inputLook(QWidget * parent) m_pHorizontalAlign->setCurrentIndex(0); } - switch( KVI_OPTION_UINT(KviOption_uintInputPixmapAlign) & Qt::AlignVertical_Mask) + switch(KVI_OPTION_UINT(KviOption_uintInputPixmapAlign) & Qt::AlignVertical_Mask) { case Qt::AlignTop: m_pVerticalAlign->setCurrentIndex(1); @@ -93,8 +93,7 @@ OptionsWidget_inputLook::OptionsWidget_inputLook(QWidget * parent) m_pVerticalAlign->setCurrentIndex(0); } - - layout()->setRowStretch(7,1); + layout()->setRowStretch(7, 1); } OptionsWidget_inputLook::~OptionsWidget_inputLook() @@ -103,68 +102,67 @@ OptionsWidget_inputLook::~OptionsWidget_inputLook() void OptionsWidget_inputLook::commit() { - int iFlags=0; + int iFlags = 0; switch(m_pHorizontalAlign->currentIndex()) { case 1: - iFlags|=Qt::AlignLeft; + iFlags |= Qt::AlignLeft; break; case 2: - iFlags|=Qt::AlignRight; + iFlags |= Qt::AlignRight; break; case 3: - iFlags|=Qt::AlignHCenter; + iFlags |= Qt::AlignHCenter; break; } switch(m_pVerticalAlign->currentIndex()) { case 1: - iFlags|=Qt::AlignTop; + iFlags |= Qt::AlignTop; break; case 2: - iFlags|=Qt::AlignBottom; + iFlags |= Qt::AlignBottom; break; case 3: - iFlags|=Qt::AlignVCenter; + iFlags |= Qt::AlignVCenter; break; } - KVI_OPTION_UINT(KviOption_uintInputPixmapAlign)=iFlags; + KVI_OPTION_UINT(KviOption_uintInputPixmapAlign) = iFlags; KviOptionsWidget::commit(); } - OptionsWidget_inputFeatures::OptionsWidget_inputFeatures(QWidget * parent) -: KviOptionsWidget(parent) + : KviOptionsWidget(parent) { setObjectName("ircviewfeatures_options_widget"); createLayout(); KviUIntSelector * u; - - addBoolSelector(0,0,0,0,__tr2qs_ctx("Warp cursor at the end of line when browsing history","options"),KviOption_boolInputHistoryCursorAtEnd); - addBoolSelector(0,1,0,1,__tr2qs_ctx("Enable the input history logging","options"),KviOption_boolEnableInputHistory); //G&N 2005 - addBoolSelector(0,2,0,2,__tr2qs_ctx("Hide input tool buttons by default","options"),KviOption_boolHideInputToolButtons); - addBoolSelector(0,3,0,3,__tr2qs_ctx("Show warning about pasting multiple lines","options"),KviOption_boolWarnAboutPastingMultipleLines); - addBoolSelector(0,4,0,4,__tr2qs_ctx("Commandline in user-friendly mode by default","options"),KviOption_boolCommandlineInUserFriendlyModeByDefault); - u = addUIntSelector(0,5,0,5,__tr2qs_ctx("Expand tabulations in input using:","options"),KviOption_uintSpacesToExpandTabulationInput,1,24,8,true); - u->setSuffix(__tr2qs_ctx(" spaces","options")); - - KviTalGroupBox * g = addGroupBox(0,6,0,6,Qt::Horizontal,__tr2qs_ctx("Nick Completion","options")); - KviBoolSelector * b, *c; - b = addBoolSelector(g,__tr2qs_ctx("Use bash-like nick completion","options"),KviOption_boolBashLikeNickCompletion,!KVI_OPTION_BOOL(KviOption_boolZshLikeNickCompletion)); - c = addBoolSelector(g,__tr2qs_ctx("Use zsh-like nick completion","options"),KviOption_boolZshLikeNickCompletion,!KVI_OPTION_BOOL(KviOption_boolBashLikeNickCompletion)); - connect(b,SIGNAL(toggled(bool)),c,SLOT(setDisabled(bool))); - connect(c,SIGNAL(toggled(bool)),b,SLOT(setDisabled(bool))); - - addStringSelector(g,__tr2qs_ctx("Nick completion postfix string:","options"),KviOption_stringNickCompletionPostfix); - addBoolSelector(g,__tr2qs_ctx("Use the completion postfix string for the first word only","options"),KviOption_boolUseNickCompletionPostfixForFirstWordOnly); - - KviBoolSelector *d = addBoolSelector(0,7,0,7,__tr2qs_ctx("Use a custom cursor width","options"),KviOption_boolEnableCustomCursorWidth); - KviUIntSelector *f = addUIntSelector(0,8,0,8,__tr2qs_ctx("Custom cursor width:","options"),KviOption_uintCustomCursorWidth,1,24,8,KVI_OPTION_BOOL(KviOption_boolEnableCustomCursorWidth)); - f->setSuffix(__tr2qs_ctx(" pixels","options")); - connect(d,SIGNAL(toggled(bool)),f,SLOT(setEnabled(bool))); - addRowSpacer(0,9,0,9); + + addBoolSelector(0, 0, 0, 0, __tr2qs_ctx("Warp cursor at the end of line when browsing history", "options"), KviOption_boolInputHistoryCursorAtEnd); + addBoolSelector(0, 1, 0, 1, __tr2qs_ctx("Enable the input history logging", "options"), KviOption_boolEnableInputHistory); //G&N 2005 + addBoolSelector(0, 2, 0, 2, __tr2qs_ctx("Hide input tool buttons by default", "options"), KviOption_boolHideInputToolButtons); + addBoolSelector(0, 3, 0, 3, __tr2qs_ctx("Show warning about pasting multiple lines", "options"), KviOption_boolWarnAboutPastingMultipleLines); + addBoolSelector(0, 4, 0, 4, __tr2qs_ctx("Commandline in user-friendly mode by default", "options"), KviOption_boolCommandlineInUserFriendlyModeByDefault); + u = addUIntSelector(0, 5, 0, 5, __tr2qs_ctx("Expand tabulations in input using:", "options"), KviOption_uintSpacesToExpandTabulationInput, 1, 24, 8, true); + u->setSuffix(__tr2qs_ctx(" spaces", "options")); + + KviTalGroupBox * g = addGroupBox(0, 6, 0, 6, Qt::Horizontal, __tr2qs_ctx("Nick Completion", "options")); + KviBoolSelector *b, *c; + b = addBoolSelector(g, __tr2qs_ctx("Use bash-like nick completion", "options"), KviOption_boolBashLikeNickCompletion, !KVI_OPTION_BOOL(KviOption_boolZshLikeNickCompletion)); + c = addBoolSelector(g, __tr2qs_ctx("Use zsh-like nick completion", "options"), KviOption_boolZshLikeNickCompletion, !KVI_OPTION_BOOL(KviOption_boolBashLikeNickCompletion)); + connect(b, SIGNAL(toggled(bool)), c, SLOT(setDisabled(bool))); + connect(c, SIGNAL(toggled(bool)), b, SLOT(setDisabled(bool))); + + addStringSelector(g, __tr2qs_ctx("Nick completion postfix string:", "options"), KviOption_stringNickCompletionPostfix); + addBoolSelector(g, __tr2qs_ctx("Use the completion postfix string for the first word only", "options"), KviOption_boolUseNickCompletionPostfixForFirstWordOnly); + + KviBoolSelector * d = addBoolSelector(0, 7, 0, 7, __tr2qs_ctx("Use a custom cursor width", "options"), KviOption_boolEnableCustomCursorWidth); + KviUIntSelector * f = addUIntSelector(0, 8, 0, 8, __tr2qs_ctx("Custom cursor width:", "options"), KviOption_uintCustomCursorWidth, 1, 24, 8, KVI_OPTION_BOOL(KviOption_boolEnableCustomCursorWidth)); + f->setSuffix(__tr2qs_ctx(" pixels", "options")); + connect(d, SIGNAL(toggled(bool)), f, SLOT(setEnabled(bool))); + addRowSpacer(0, 9, 0, 9); } OptionsWidget_inputFeatures::~OptionsWidget_inputFeatures() diff --git a/src/modules/options/OptionsWidget_input.h b/src/modules/options/OptionsWidget_input.h index e8224216b..19b3fb6ad 100644 --- a/src/modules/options/OptionsWidget_input.h +++ b/src/modules/options/OptionsWidget_input.h @@ -29,7 +29,6 @@ #include - #define KVI_OPTIONS_WIDGET_ICON_OptionsWidget_inputLook KviIconManager::Input #define KVI_OPTIONS_WIDGET_NAME_OptionsWidget_inputLook __tr2qs_no_lookup("Input") #define KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_inputLook __tr2qs_no_lookup("theme,colors,text") @@ -39,8 +38,9 @@ class OptionsWidget_inputLook : public KviOptionsWidget { Q_OBJECT private: - QComboBox* m_pHorizontalAlign; - QComboBox* m_pVerticalAlign; + QComboBox * m_pHorizontalAlign; + QComboBox * m_pVerticalAlign; + public: OptionsWidget_inputLook(QWidget * parent); ~OptionsWidget_inputLook(); diff --git a/src/modules/options/OptionsWidget_interfaceFeatures.cpp b/src/modules/options/OptionsWidget_interfaceFeatures.cpp index 1e6b6f223..e486ed284 100644 --- a/src/modules/options/OptionsWidget_interfaceFeatures.cpp +++ b/src/modules/options/OptionsWidget_interfaceFeatures.cpp @@ -34,41 +34,40 @@ #include - OptionsWidget_interfaceFeatures::OptionsWidget_interfaceFeatures(QWidget * parent) -: KviOptionsWidget(parent) + : KviOptionsWidget(parent) { setObjectName("interfacefeatures_options_widget"); createLayout(); KviTalGroupBox * g; - addBoolSelector(0,0,0,0,__tr2qs_ctx("Minimize application on startup","options"),KviOption_boolStartupMinimized); - addBoolSelector(0,1,0,1,__tr2qs_ctx("Confirm quit with active connections","options"),KviOption_boolConfirmCloseWhenThereAreConnections); - addBoolSelector(0,2,0,2,__tr2qs_ctx("Remember window properties","options"),KviOption_boolWindowsRememberProperties); - addBoolSelector(0,3,0,3,__tr2qs_ctx("Enable visual effects","options"),KviOption_boolEnableVisualEffects); - addBoolSelector(0,4,0,4,__tr2qs_ctx("Hide channel window tool buttons by default","options"),KviOption_boolHideWindowToolButtons); + addBoolSelector(0, 0, 0, 0, __tr2qs_ctx("Minimize application on startup", "options"), KviOption_boolStartupMinimized); + addBoolSelector(0, 1, 0, 1, __tr2qs_ctx("Confirm quit with active connections", "options"), KviOption_boolConfirmCloseWhenThereAreConnections); + addBoolSelector(0, 2, 0, 2, __tr2qs_ctx("Remember window properties", "options"), KviOption_boolWindowsRememberProperties); + addBoolSelector(0, 3, 0, 3, __tr2qs_ctx("Enable visual effects", "options"), KviOption_boolEnableVisualEffects); + addBoolSelector(0, 4, 0, 4, __tr2qs_ctx("Hide channel window tool buttons by default", "options"), KviOption_boolHideWindowToolButtons); #ifdef COMPILE_ON_MAC - addBoolSelector(0,5,0,5,__tr2qs_ctx("Require ⌘ to be held down to copy text","options"),KviOption_boolRequireControlToCopy); + addBoolSelector(0, 5, 0, 5, __tr2qs_ctx("Require ⌘ to be held down to copy text", "options"), KviOption_boolRequireControlToCopy); #else - addBoolSelector(0,5,0,5,__tr2qs_ctx("Require Ctrl to be held down to copy text","options"),KviOption_boolRequireControlToCopy); + addBoolSelector(0, 5, 0, 5, __tr2qs_ctx("Require Ctrl to be held down to copy text", "options"), KviOption_boolRequireControlToCopy); #endif #if defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW) - addBoolSelector(0,6,0,6,__tr2qs_ctx("Show taskbar button (change requires restart)","options"),KviOption_boolShowTaskBarButton); - g = addGroupBox(0,7,0,7,Qt::Horizontal,__tr2qs_ctx("Open Dialog Window for","options")); + addBoolSelector(0, 6, 0, 6, __tr2qs_ctx("Show taskbar button (change requires restart)", "options"), KviOption_boolShowTaskBarButton); + g = addGroupBox(0, 7, 0, 7, Qt::Horizontal, __tr2qs_ctx("Open Dialog Window for", "options")); #else - g = addGroupBox(0,6,0,6,Qt::Horizontal,__tr2qs_ctx("Open Dialog Window for","options")); + g = addGroupBox(0, 6, 0, 6, Qt::Horizontal, __tr2qs_ctx("Open Dialog Window for", "options")); #endif - addBoolSelector(g,__tr2qs_ctx("Preferences","options"),KviOption_boolShowGeneralOptionsDialogAsToplevel); - addBoolSelector(g,__tr2qs_ctx("Registered users","options"),KviOption_boolShowRegisteredUsersDialogAsToplevel); - addBoolSelector(g,__tr2qs_ctx("Identity","options"),KviOption_boolShowIdentityDialogAsToplevel); - addBoolSelector(g,__tr2qs_ctx("Servers","options"),KviOption_boolShowServersConnectDialogAsToplevel); - addBoolSelector(g,__tr2qs_ctx("Join channels","options"),KviOption_boolShowChannelsJoinDialogAsToplevel); + addBoolSelector(g, __tr2qs_ctx("Preferences", "options"), KviOption_boolShowGeneralOptionsDialogAsToplevel); + addBoolSelector(g, __tr2qs_ctx("Registered users", "options"), KviOption_boolShowRegisteredUsersDialogAsToplevel); + addBoolSelector(g, __tr2qs_ctx("Identity", "options"), KviOption_boolShowIdentityDialogAsToplevel); + addBoolSelector(g, __tr2qs_ctx("Servers", "options"), KviOption_boolShowServersConnectDialogAsToplevel); + addBoolSelector(g, __tr2qs_ctx("Join channels", "options"), KviOption_boolShowChannelsJoinDialogAsToplevel); #if defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW) - addRowSpacer(0,8,0,8); + addRowSpacer(0, 8, 0, 8); #else - addRowSpacer(0,7,0,7); + addRowSpacer(0, 7, 0, 7); #endif } diff --git a/src/modules/options/OptionsWidget_irc.cpp b/src/modules/options/OptionsWidget_irc.cpp index 07e7a0976..7f68bb442 100644 --- a/src/modules/options/OptionsWidget_irc.cpp +++ b/src/modules/options/OptionsWidget_irc.cpp @@ -29,9 +29,8 @@ #include "KviOptions.h" #include "KviIrcMask.h" - OptionsWidget_irc::OptionsWidget_irc(QWidget * parent) -: KviOptionsWidget(parent) + : KviOptionsWidget(parent) { setObjectName("irc_options_widget"); } @@ -40,41 +39,41 @@ OptionsWidget_irc::~OptionsWidget_irc() { } - OptionsWidget_ircGeneral::OptionsWidget_ircGeneral(QWidget * parent) -: KviOptionsWidget(parent) + : KviOptionsWidget(parent) { setObjectName("irc_options_widget"); createLayout(); - KviBoolSelector * b = addBoolSelector(0,1,0,1,__tr2qs_ctx("Show network name in console window list entry","options"),KviOption_boolShowNetworkNameForConsoleWindowListEntry); - mergeTip(b,__tr2qs_ctx("This option will cause KVIrc to show the network name as the console window list entry instead of the server name. This is nice to keep on unless your servers are not organized in networks or you often connect to two servers of the same network.","options")); - addRowSpacer(0,2,0,2); + KviBoolSelector * b = addBoolSelector(0, 1, 0, 1, __tr2qs_ctx("Show network name in console window list entry", "options"), KviOption_boolShowNetworkNameForConsoleWindowListEntry); + mergeTip(b, __tr2qs_ctx("This option will cause KVIrc to show the network name as the console window list entry instead of the server name. This is nice to keep on unless your servers are not organized in networks or you often connect to two servers of the same network.", "options")); + addRowSpacer(0, 2, 0, 2); } OptionsWidget_ircGeneral::~OptionsWidget_ircGeneral() { } - OptionsWidget_ircAdvanced::OptionsWidget_ircAdvanced(QWidget * parent) -: KviOptionsWidget(parent) + : KviOptionsWidget(parent) { setObjectName("irc_advanced_options_widget"); createLayout(); - KviBoolSelector *b = addBoolSelector(0,0,0,0,__tr2qs_ctx("Force immediate quit","options"),KviOption_boolForceBrutalQuit); + KviBoolSelector * b = addBoolSelector(0, 0, 0, 0, __tr2qs_ctx("Force immediate quit", "options"), KviOption_boolForceBrutalQuit); mergeTip(b, - __tr2qs_ctx("This option causes KVIrc to close " \ - "the connection immediately after sending the QUIT message.
" \ - "When this option is disabled, KVIrc will wait for the server " \ - "to close the connection.
" \ - "Note that if you use this, your QUIT message may be not displayed.","options")); - addBoolSelector(0,1,0,1,__tr2qs_ctx("Prepend gender info to real name","options"),KviOption_boolPrependGenderInfoToRealname); - addBoolSelector(0,2,0,2,__tr2qs_ctx("Prepend avatar info to real name","options"),KviOption_boolPrependAvatarInfoToRealname); - b = addBoolSelector(0,3,0,3,__tr2qs_ctx("Prepend smart nick color info to real name","options"),KviOption_boolPrependNickColorInfoToRealname); + __tr2qs_ctx("This option causes KVIrc to close " + "the connection immediately after sending the QUIT message.
" + "When this option is disabled, KVIrc will wait for the server " + "to close the connection.
" + "Note that if you use this, your QUIT message may be not displayed.", + "options")); + addBoolSelector(0, 1, 0, 1, __tr2qs_ctx("Prepend gender info to real name", "options"), KviOption_boolPrependGenderInfoToRealname); + addBoolSelector(0, 2, 0, 2, __tr2qs_ctx("Prepend avatar info to real name", "options"), KviOption_boolPrependAvatarInfoToRealname); + b = addBoolSelector(0, 3, 0, 3, __tr2qs_ctx("Prepend smart nick color info to real name", "options"), KviOption_boolPrependNickColorInfoToRealname); mergeTip(b, - __tr2qs_ctx("This feature will not work if you have chosen your " \ - "nick background color to be transparent.","options")); - addRowSpacer(0,4,0,4); + __tr2qs_ctx("This feature will not work if you have chosen your " + "nick background color to be transparent.", + "options")); + addRowSpacer(0, 4, 0, 4); } OptionsWidget_ircAdvanced::~OptionsWidget_ircAdvanced() diff --git a/src/modules/options/OptionsWidget_irc.h b/src/modules/options/OptionsWidget_irc.h index 9ec41d709..eeb710a0b 100644 --- a/src/modules/options/OptionsWidget_irc.h +++ b/src/modules/options/OptionsWidget_irc.h @@ -52,7 +52,6 @@ public: ~OptionsWidget_ircGeneral(); }; - #define KVI_OPTIONS_WIDGET_ICON_OptionsWidget_ircAdvanced KviIconManager::Gui #define KVI_OPTIONS_WIDGET_NAME_OptionsWidget_ircAdvanced __tr2qs_no_lookup("Advanced") #define KVI_OPTIONS_WIDGET_PARENT_OptionsWidget_ircAdvanced OptionsWidget_irc diff --git a/src/modules/options/OptionsWidget_ircOutput.cpp b/src/modules/options/OptionsWidget_ircOutput.cpp index 577f749b5..9cff3d256 100644 --- a/src/modules/options/OptionsWidget_ircOutput.cpp +++ b/src/modules/options/OptionsWidget_ircOutput.cpp @@ -33,60 +33,59 @@ #include #include - OptionsWidget_ircOutput::OptionsWidget_ircOutput(QWidget * pParent) -: KviOptionsWidget(pParent) + : KviOptionsWidget(pParent) { setObjectName("ircoutput_options_widget"); createLayout(); - QLabel * pLabel = new QLabel(__tr2qs_ctx("Output verbosity:","options"),this); - addWidgetToLayout(pLabel,0,0,0,0); + QLabel * pLabel = new QLabel(__tr2qs_ctx("Output verbosity:", "options"), this); + addWidgetToLayout(pLabel, 0, 0, 0, 0); m_pVerbosityCombo = new QComboBox(this); - m_pVerbosityCombo->addItem(__tr2qs_ctx("Mute","options")); - m_pVerbosityCombo->addItem(__tr2qs_ctx("Quiet","options")); - m_pVerbosityCombo->addItem(__tr2qs_ctx("Normal","options")); - m_pVerbosityCombo->addItem(__tr2qs_ctx("Verbose","options")); - m_pVerbosityCombo->addItem(__tr2qs_ctx("Paranoic","options")); - addWidgetToLayout(m_pVerbosityCombo,1,0,1,0); + m_pVerbosityCombo->addItem(__tr2qs_ctx("Mute", "options")); + m_pVerbosityCombo->addItem(__tr2qs_ctx("Quiet", "options")); + m_pVerbosityCombo->addItem(__tr2qs_ctx("Normal", "options")); + m_pVerbosityCombo->addItem(__tr2qs_ctx("Verbose", "options")); + m_pVerbosityCombo->addItem(__tr2qs_ctx("Paranoic", "options")); + addWidgetToLayout(m_pVerbosityCombo, 1, 0, 1, 0); if(KVI_OPTION_UINT(KviOption_uintOutputVerbosityLevel) > KVI_VERBOSITY_LEVEL_PARANOIC) KVI_OPTION_UINT(KviOption_uintOutputVerbosityLevel) = KVI_VERBOSITY_LEVEL_NORMAL; m_pVerbosityCombo->setCurrentIndex(KVI_OPTION_UINT(KviOption_uintOutputVerbosityLevel)); - pLabel = new QLabel(__tr2qs_ctx("DateTime format:","options"),this); - addWidgetToLayout(pLabel,0,1,0,1); + pLabel = new QLabel(__tr2qs_ctx("DateTime format:", "options"), this); + addWidgetToLayout(pLabel, 0, 1, 0, 1); m_pDatetimeCombo = new QComboBox(this); - m_pDatetimeCombo->addItem(__tr2qs_ctx("Classic format","options")); - m_pDatetimeCombo->addItem(__tr2qs_ctx("ISO 8601 format","options")); - m_pDatetimeCombo->addItem(__tr2qs_ctx("System locale format","options")); - addWidgetToLayout(m_pDatetimeCombo,1,1,1,1); + m_pDatetimeCombo->addItem(__tr2qs_ctx("Classic format", "options")); + m_pDatetimeCombo->addItem(__tr2qs_ctx("ISO 8601 format", "options")); + m_pDatetimeCombo->addItem(__tr2qs_ctx("System locale format", "options")); + addWidgetToLayout(m_pDatetimeCombo, 1, 1, 1, 1); m_pDatetimeCombo->setCurrentIndex(KVI_OPTION_UINT(KviOption_uintOutputDatetimeFormat)); - KviTalGroupBox * pGroup = addGroupBox(0,2,1,2,Qt::Horizontal,__tr2qs_ctx("Show in Active Window","options")); - addBoolSelector(pGroup,__tr2qs_ctx("External messages","options"),KviOption_boolExternalMessagesToActiveWindow); - addBoolSelector(pGroup,__tr2qs_ctx("External CTCP replies","options"),KviOption_boolCtcpRepliesToActiveWindow); - addBoolSelector(pGroup,__tr2qs_ctx("WHOIS replies","options"),KviOption_boolWhoisRepliesToActiveWindow); - addBoolSelector(pGroup,__tr2qs_ctx("WHO replies","options"),KviOption_boolWhoRepliesToActiveWindow); - addBoolSelector(pGroup,__tr2qs_ctx("ChanServ and NickServ notices","options"),KviOption_boolServicesNoticesToActiveWindow); - addBoolSelector(pGroup,__tr2qs_ctx("Invite messages","options"),KviOption_boolInvitesToActiveWindow); - addBoolSelector(pGroup,__tr2qs_ctx("Server replies","options"),KviOption_boolServerRepliesToActiveWindow); - addBoolSelector(pGroup,__tr2qs_ctx("Server notices","options"),KviOption_boolServerNoticesToActiveWindow); - addBoolSelector(pGroup,__tr2qs_ctx("Broadcast and WALLOPS messages","options"),KviOption_boolOperatorMessagesToActiveWindow); -// if(KVI_OPTION_UINT(KviOption_uintUserExperienceLevel)>=2) -// { - addBoolSelector(0,3,1,3,__tr2qs_ctx("Show extended server information","options"),KviOption_boolShowExtendedServerInfo); - addBoolSelector(0,4,1,4,__tr2qs_ctx("Show server pings","options"),KviOption_boolShowPingPong); - addBoolSelector(0,5,1,5,__tr2qs_ctx("Show own parts in the console","options"),KviOption_boolShowOwnParts); - addBoolSelector(0,6,1,6,__tr2qs_ctx("Show compact mode changes","options"),KviOption_boolShowCompactModeChanges); - - addRowSpacer(0,7,1,7); -// } else { -// addRowSpacer(0,2,1,2); -// } + KviTalGroupBox * pGroup = addGroupBox(0, 2, 1, 2, Qt::Horizontal, __tr2qs_ctx("Show in Active Window", "options")); + addBoolSelector(pGroup, __tr2qs_ctx("External messages", "options"), KviOption_boolExternalMessagesToActiveWindow); + addBoolSelector(pGroup, __tr2qs_ctx("External CTCP replies", "options"), KviOption_boolCtcpRepliesToActiveWindow); + addBoolSelector(pGroup, __tr2qs_ctx("WHOIS replies", "options"), KviOption_boolWhoisRepliesToActiveWindow); + addBoolSelector(pGroup, __tr2qs_ctx("WHO replies", "options"), KviOption_boolWhoRepliesToActiveWindow); + addBoolSelector(pGroup, __tr2qs_ctx("ChanServ and NickServ notices", "options"), KviOption_boolServicesNoticesToActiveWindow); + addBoolSelector(pGroup, __tr2qs_ctx("Invite messages", "options"), KviOption_boolInvitesToActiveWindow); + addBoolSelector(pGroup, __tr2qs_ctx("Server replies", "options"), KviOption_boolServerRepliesToActiveWindow); + addBoolSelector(pGroup, __tr2qs_ctx("Server notices", "options"), KviOption_boolServerNoticesToActiveWindow); + addBoolSelector(pGroup, __tr2qs_ctx("Broadcast and WALLOPS messages", "options"), KviOption_boolOperatorMessagesToActiveWindow); + // if(KVI_OPTION_UINT(KviOption_uintUserExperienceLevel)>=2) + // { + addBoolSelector(0, 3, 1, 3, __tr2qs_ctx("Show extended server information", "options"), KviOption_boolShowExtendedServerInfo); + addBoolSelector(0, 4, 1, 4, __tr2qs_ctx("Show server pings", "options"), KviOption_boolShowPingPong); + addBoolSelector(0, 5, 1, 5, __tr2qs_ctx("Show own parts in the console", "options"), KviOption_boolShowOwnParts); + addBoolSelector(0, 6, 1, 6, __tr2qs_ctx("Show compact mode changes", "options"), KviOption_boolShowCompactModeChanges); + + addRowSpacer(0, 7, 1, 7); + // } else { + // addRowSpacer(0,2,1,2); + // } } OptionsWidget_ircOutput::~OptionsWidget_ircOutput() diff --git a/src/modules/options/OptionsWidget_ircOutput.h b/src/modules/options/OptionsWidget_ircOutput.h index 3cd0d5134..ea42b35df 100644 --- a/src/modules/options/OptionsWidget_ircOutput.h +++ b/src/modules/options/OptionsWidget_ircOutput.h @@ -26,7 +26,6 @@ #include "KviOptionsWidget.h" - class QComboBox; #define KVI_OPTIONS_WIDGET_ICON_OptionsWidget_ircOutput KviIconManager::Raw @@ -41,9 +40,11 @@ class OptionsWidget_ircOutput : public KviOptionsWidget public: OptionsWidget_ircOutput(QWidget * parent); ~OptionsWidget_ircOutput(); + protected: QComboBox * m_pVerbosityCombo; QComboBox * m_pDatetimeCombo; + protected: virtual void commit(); }; diff --git a/src/modules/options/OptionsWidget_ircView.cpp b/src/modules/options/OptionsWidget_ircView.cpp index c9f1d3f43..deb2461a1 100644 --- a/src/modules/options/OptionsWidget_ircView.cpp +++ b/src/modules/options/OptionsWidget_ircView.cpp @@ -30,9 +30,8 @@ #include - OptionsWidget_ircViewTheme::OptionsWidget_ircViewTheme(QWidget * pParent) -: KviOptionsWidget(pParent) + : KviOptionsWidget(pParent) { } @@ -40,37 +39,36 @@ OptionsWidget_ircViewTheme::~OptionsWidget_ircViewTheme() { } - OptionsWidget_ircViewLook::OptionsWidget_ircViewLook(QWidget * parent) -: KviOptionsWidget(parent) + : KviOptionsWidget(parent) { setObjectName("ircviewlook_options_widget"); createLayout(); - - addFontSelector(0,0,1,0,__tr2qs_ctx("Font:","options"),KviOption_fontIrcView); - addColorSelector(0,1,1,1,__tr2qs_ctx("Background color:","options"),KviOption_colorIrcViewBackground); - addPixmapSelector(0,2,1,2,__tr2qs_ctx("Background image:","options"),KviOption_pixmapIrcViewBackground); + addFontSelector(0, 0, 1, 0, __tr2qs_ctx("Font:", "options"), KviOption_fontIrcView); + addColorSelector(0, 1, 1, 1, __tr2qs_ctx("Background color:", "options"), KviOption_colorIrcViewBackground); + + addPixmapSelector(0, 2, 1, 2, __tr2qs_ctx("Background image:", "options"), KviOption_pixmapIrcViewBackground); - addLabel(0,3,0,3,__tr2qs_ctx("Horizontal align:","options")); - m_pHorizontalAlign=new QComboBox(this); - addWidgetToLayout(m_pHorizontalAlign,1,3,1,3); + addLabel(0, 3, 0, 3, __tr2qs_ctx("Horizontal align:", "options")); + m_pHorizontalAlign = new QComboBox(this); + addWidgetToLayout(m_pHorizontalAlign, 1, 3, 1, 3); - addLabel(0,4,0,4,__tr2qs_ctx("Vertical align:","options")); - m_pVerticalAlign=new QComboBox(this); - addWidgetToLayout(m_pVerticalAlign,1,4,1,4); + addLabel(0, 4, 0, 4, __tr2qs_ctx("Vertical align:", "options")); + m_pVerticalAlign = new QComboBox(this); + addWidgetToLayout(m_pVerticalAlign, 1, 4, 1, 4); - m_pHorizontalAlign->addItem(__tr2qs_ctx("Tile","options")); - m_pHorizontalAlign->addItem(__tr2qs_ctx("Left","options")); - m_pHorizontalAlign->addItem(__tr2qs_ctx("Right","options")); - m_pHorizontalAlign->addItem(__tr2qs_ctx("Center","options")); + m_pHorizontalAlign->addItem(__tr2qs_ctx("Tile", "options")); + m_pHorizontalAlign->addItem(__tr2qs_ctx("Left", "options")); + m_pHorizontalAlign->addItem(__tr2qs_ctx("Right", "options")); + m_pHorizontalAlign->addItem(__tr2qs_ctx("Center", "options")); - m_pVerticalAlign->addItem(__tr2qs_ctx("Tile","options")); - m_pVerticalAlign->addItem(__tr2qs_ctx("Top","options")); - m_pVerticalAlign->addItem(__tr2qs_ctx("Bottom","options")); - m_pVerticalAlign->addItem(__tr2qs_ctx("Center","options")); + m_pVerticalAlign->addItem(__tr2qs_ctx("Tile", "options")); + m_pVerticalAlign->addItem(__tr2qs_ctx("Top", "options")); + m_pVerticalAlign->addItem(__tr2qs_ctx("Bottom", "options")); + m_pVerticalAlign->addItem(__tr2qs_ctx("Center", "options")); - switch( KVI_OPTION_UINT(KviOption_uintIrcViewPixmapAlign) & Qt::AlignHorizontal_Mask) + switch(KVI_OPTION_UINT(KviOption_uintIrcViewPixmapAlign) & Qt::AlignHorizontal_Mask) { case Qt::AlignLeft: m_pHorizontalAlign->setCurrentIndex(1); @@ -85,7 +83,7 @@ OptionsWidget_ircViewLook::OptionsWidget_ircViewLook(QWidget * parent) m_pHorizontalAlign->setCurrentIndex(0); } - switch( KVI_OPTION_UINT(KviOption_uintIrcViewPixmapAlign) & Qt::AlignVertical_Mask) + switch(KVI_OPTION_UINT(KviOption_uintIrcViewPixmapAlign) & Qt::AlignVertical_Mask) { case Qt::AlignTop: m_pVerticalAlign->setCurrentIndex(1); @@ -100,117 +98,111 @@ OptionsWidget_ircViewLook::OptionsWidget_ircViewLook(QWidget * parent) m_pVerticalAlign->setCurrentIndex(0); } - layout()->setRowStretch(2,1); + layout()->setRowStretch(2, 1); } - OptionsWidget_ircViewLook::~OptionsWidget_ircViewLook() { } - void OptionsWidget_ircViewLook::commit() { - int iFlags=0; + int iFlags = 0; switch(m_pHorizontalAlign->currentIndex()) { case 1: - iFlags|=Qt::AlignLeft; + iFlags |= Qt::AlignLeft; break; case 2: - iFlags|=Qt::AlignRight; + iFlags |= Qt::AlignRight; break; case 3: - iFlags|=Qt::AlignHCenter; + iFlags |= Qt::AlignHCenter; break; } switch(m_pVerticalAlign->currentIndex()) { case 1: - iFlags|=Qt::AlignTop; + iFlags |= Qt::AlignTop; break; case 2: - iFlags|=Qt::AlignBottom; + iFlags |= Qt::AlignBottom; break; case 3: - iFlags|=Qt::AlignVCenter; + iFlags |= Qt::AlignVCenter; break; } - KVI_OPTION_UINT(KviOption_uintIrcViewPixmapAlign)=iFlags; + KVI_OPTION_UINT(KviOption_uintIrcViewPixmapAlign) = iFlags; KviOptionsWidget::commit(); } - OptionsWidget_ircViewFeatures::OptionsWidget_ircViewFeatures(QWidget * parent) -: KviOptionsWidget(parent) + : KviOptionsWidget(parent) { setObjectName("ircviewfeatures_options_widget"); createLayout(); - addBoolSelector(0,7,0,7,__tr2qs_ctx("Enable URL highlighting","options"),KviOption_boolIrcViewUrlHighlighting); - addBoolSelector(0,8,0,8,__tr2qs_ctx("Use line wrap margin","options"),KviOption_boolIrcViewWrapMargin); - KviUIntSelector * s = addUIntSelector(0,9,0,9,__tr2qs_ctx("Maximum buffer size:","options"),KviOption_uintIrcViewMaxBufferSize,32,32767,2048); - s->setSuffix(__tr2qs_ctx(" lines","options")); - s = addUIntSelector(0,10,0,10,__tr2qs_ctx("Link tooltip show delay:","options"),KviOption_uintIrcViewToolTipTimeoutInMsec,256,10000,1800); - s->setSuffix(__tr2qs_ctx(" msec","options")); - s = addUIntSelector(0,11,0,11,__tr2qs_ctx("Link tooltip hide delay:","options"),KviOption_uintIrcViewToolTipHideTimeoutInMsec,256,10000,12000); - s->setSuffix(__tr2qs_ctx(" msec","options")); - addBoolSelector(0,12,0,12,__tr2qs_ctx("Enable animated smiles","options"),KviOption_boolEnableAnimatedSmiles); - - KviTalGroupBox * pGroup = addGroupBox(0,13,0,13,Qt::Horizontal,__tr2qs_ctx("Enable Tooltips for","options")); - addBoolSelector(pGroup,__tr2qs_ctx("URL links","options"),KviOption_boolEnableUrlLinkToolTip); - addBoolSelector(pGroup,__tr2qs_ctx("Host links","options"),KviOption_boolEnableHostLinkToolTip); - addBoolSelector(pGroup,__tr2qs_ctx("Server links","options"),KviOption_boolEnableServerLinkToolTip); - addBoolSelector(pGroup,__tr2qs_ctx("Mode links","options"),KviOption_boolEnableModeLinkToolTip); - addBoolSelector(pGroup,__tr2qs_ctx("Nick links","options"),KviOption_boolEnableNickLinkToolTip); - addBoolSelector(pGroup,__tr2qs_ctx("Channel links","options"),KviOption_boolEnableChannelLinkToolTip); - addBoolSelector(pGroup,__tr2qs_ctx("Escape sequences","options"),KviOption_boolEnableEscapeLinkToolTip); - - addRowSpacer(0,14,0,14); + addBoolSelector(0, 7, 0, 7, __tr2qs_ctx("Enable URL highlighting", "options"), KviOption_boolIrcViewUrlHighlighting); + addBoolSelector(0, 8, 0, 8, __tr2qs_ctx("Use line wrap margin", "options"), KviOption_boolIrcViewWrapMargin); + KviUIntSelector * s = addUIntSelector(0, 9, 0, 9, __tr2qs_ctx("Maximum buffer size:", "options"), KviOption_uintIrcViewMaxBufferSize, 32, 32767, 2048); + s->setSuffix(__tr2qs_ctx(" lines", "options")); + s = addUIntSelector(0, 10, 0, 10, __tr2qs_ctx("Link tooltip show delay:", "options"), KviOption_uintIrcViewToolTipTimeoutInMsec, 256, 10000, 1800); + s->setSuffix(__tr2qs_ctx(" msec", "options")); + s = addUIntSelector(0, 11, 0, 11, __tr2qs_ctx("Link tooltip hide delay:", "options"), KviOption_uintIrcViewToolTipHideTimeoutInMsec, 256, 10000, 12000); + s->setSuffix(__tr2qs_ctx(" msec", "options")); + addBoolSelector(0, 12, 0, 12, __tr2qs_ctx("Enable animated smiles", "options"), KviOption_boolEnableAnimatedSmiles); + + KviTalGroupBox * pGroup = addGroupBox(0, 13, 0, 13, Qt::Horizontal, __tr2qs_ctx("Enable Tooltips for", "options")); + addBoolSelector(pGroup, __tr2qs_ctx("URL links", "options"), KviOption_boolEnableUrlLinkToolTip); + addBoolSelector(pGroup, __tr2qs_ctx("Host links", "options"), KviOption_boolEnableHostLinkToolTip); + addBoolSelector(pGroup, __tr2qs_ctx("Server links", "options"), KviOption_boolEnableServerLinkToolTip); + addBoolSelector(pGroup, __tr2qs_ctx("Mode links", "options"), KviOption_boolEnableModeLinkToolTip); + addBoolSelector(pGroup, __tr2qs_ctx("Nick links", "options"), KviOption_boolEnableNickLinkToolTip); + addBoolSelector(pGroup, __tr2qs_ctx("Channel links", "options"), KviOption_boolEnableChannelLinkToolTip); + addBoolSelector(pGroup, __tr2qs_ctx("Escape sequences", "options"), KviOption_boolEnableEscapeLinkToolTip); + + addRowSpacer(0, 14, 0, 14); } OptionsWidget_ircViewFeatures::~OptionsWidget_ircViewFeatures() { } - OptionsWidget_ircViewMarker::OptionsWidget_ircViewMarker(QWidget * parent) -: KviOptionsWidget(parent) + : KviOptionsWidget(parent) { setObjectName("ircviewmarker_options_widget"); createLayout(); - addBoolSelector(0,0,1,0,__tr2qs_ctx("Track last read text line","options"),KviOption_boolTrackLastReadTextViewLine); - addColorSelector(0,1,1,1,__tr2qs_ctx("Marker color:","options"),KviOption_colorIrcViewMarkLine); + addBoolSelector(0, 0, 1, 0, __tr2qs_ctx("Track last read text line", "options"), KviOption_boolTrackLastReadTextViewLine); + addColorSelector(0, 1, 1, 1, __tr2qs_ctx("Marker color:", "options"), KviOption_colorIrcViewMarkLine); - KviUIntSelector * s = addUIntSelector(0,2,1,2,__tr2qs_ctx("Marker size:","options"),KviOption_uintIrcViewMarkerSize,1,5,1); - s->setSuffix(__tr2qs_ctx(" pixels","options")); + KviUIntSelector * s = addUIntSelector(0, 2, 1, 2, __tr2qs_ctx("Marker size:", "options"), KviOption_uintIrcViewMarkerSize, 1, 5, 1); + s->setSuffix(__tr2qs_ctx(" pixels", "options")); - addLabel(0,3,0,3,__tr2qs_ctx("Marker style:","options")); - m_pMarkerStyle=new QComboBox(this); - addWidgetToLayout(m_pMarkerStyle,1,3,1,3); + addLabel(0, 3, 0, 3, __tr2qs_ctx("Marker style:", "options")); + m_pMarkerStyle = new QComboBox(this); + addWidgetToLayout(m_pMarkerStyle, 1, 3, 1, 3); - addRowSpacer(0,4,0,4); + addRowSpacer(0, 4, 0, 4); - m_pMarkerStyle->addItem(__tr2qs_ctx("DotLine","options")); - m_pMarkerStyle->addItem(__tr2qs_ctx("DashLine","options")); - m_pMarkerStyle->addItem(__tr2qs_ctx("SolidLine","options")); - m_pMarkerStyle->addItem(__tr2qs_ctx("DashDotLine","options")); - m_pMarkerStyle->addItem(__tr2qs_ctx("DashDotDotLine","options")); + m_pMarkerStyle->addItem(__tr2qs_ctx("DotLine", "options")); + m_pMarkerStyle->addItem(__tr2qs_ctx("DashLine", "options")); + m_pMarkerStyle->addItem(__tr2qs_ctx("SolidLine", "options")); + m_pMarkerStyle->addItem(__tr2qs_ctx("DashDotLine", "options")); + m_pMarkerStyle->addItem(__tr2qs_ctx("DashDotDotLine", "options")); - unsigned int uStyle=KVI_OPTION_UINT(KviOption_uintIrcViewMarkerStyle); + unsigned int uStyle = KVI_OPTION_UINT(KviOption_uintIrcViewMarkerStyle); m_pMarkerStyle->setCurrentIndex(uStyle < 5 ? uStyle : 0); } - OptionsWidget_ircViewMarker::~OptionsWidget_ircViewMarker() { } - void OptionsWidget_ircViewMarker::commit() { - KVI_OPTION_UINT(KviOption_uintIrcViewMarkerStyle)=m_pMarkerStyle->currentIndex(); + KVI_OPTION_UINT(KviOption_uintIrcViewMarkerStyle) = m_pMarkerStyle->currentIndex(); KviOptionsWidget::commit(); } diff --git a/src/modules/options/OptionsWidget_ircView.h b/src/modules/options/OptionsWidget_ircView.h index 1ca1796aa..ccbd67aca 100644 --- a/src/modules/options/OptionsWidget_ircView.h +++ b/src/modules/options/OptionsWidget_ircView.h @@ -26,7 +26,6 @@ // //============================================================================= - #include "KviOptionsWidget.h" #include @@ -58,9 +57,11 @@ class OptionsWidget_ircViewLook : public KviOptionsWidget private: QComboBox * m_pHorizontalAlign; QComboBox * m_pVerticalAlign; + public: OptionsWidget_ircViewLook(QWidget * parent); ~OptionsWidget_ircViewLook(); + public: virtual void commit(); }; @@ -92,6 +93,7 @@ public: OptionsWidget_ircViewMarker(QWidget * pParent); ~OptionsWidget_ircViewMarker(); virtual void commit(); + private: QComboBox * m_pMarkerStyle; }; diff --git a/src/modules/options/OptionsWidget_lag.cpp b/src/modules/options/OptionsWidget_lag.cpp index 567c5f3e3..6bb33548c 100644 --- a/src/modules/options/OptionsWidget_lag.cpp +++ b/src/modules/options/OptionsWidget_lag.cpp @@ -31,43 +31,43 @@ #include - OptionsWidget_lag::OptionsWidget_lag(QWidget * parent) -: KviOptionsWidget(parent) + : KviOptionsWidget(parent) { setObjectName("lag_options_widget"); createLayout(); - KviBoolSelector * pUse = addBoolSelector(0,0,0,0, __tr2qs_ctx("Enable lag meter","options"), KviOption_boolUseLagMeterEngine); - mergeTip(pUse,__tr2qs_ctx("This enables the lag meter engine, which checks at regular intervals how much latency the server has.","options")); - KviTalGroupBox *g = addGroupBox(0,1,0,1,Qt::Horizontal,__tr2qs_ctx("Configuration","options"),KVI_OPTION_BOOL(KviOption_boolUseLagMeterEngine)); - KviUIntSelector * pInterval = addUIntSelector(g, __tr2qs_ctx("Lag meter heartbeat:","options"),KviOption_uintLagMeterHeartbeat,2000,10000,5000,KVI_OPTION_BOOL(KviOption_boolUseLagMeterEngine)); - pInterval->setSuffix(__tr2qs_ctx(" msec","options")); + KviBoolSelector * pUse = addBoolSelector(0, 0, 0, 0, __tr2qs_ctx("Enable lag meter", "options"), KviOption_boolUseLagMeterEngine); + mergeTip(pUse, __tr2qs_ctx("This enables the lag meter engine, which checks at regular intervals how much latency the server has.", "options")); + KviTalGroupBox * g = addGroupBox(0, 1, 0, 1, Qt::Horizontal, __tr2qs_ctx("Configuration", "options"), KVI_OPTION_BOOL(KviOption_boolUseLagMeterEngine)); + KviUIntSelector * pInterval = addUIntSelector(g, __tr2qs_ctx("Lag meter heartbeat:", "options"), KviOption_uintLagMeterHeartbeat, 2000, 10000, 5000, KVI_OPTION_BOOL(KviOption_boolUseLagMeterEngine)); + pInterval->setSuffix(__tr2qs_ctx(" msec", "options")); mergeTip(pInterval, - __tr2qs_ctx("This option allows you to set the lag meter heartbeat interval.
" \ - "The lower the heartbeat interval the higher will be the accuracy of the lag check " \ - "but also higher CPU usage and data traffic to the server.
" \ - "Please note that this is NOT the interval between pings sent to the server: " \ - "the pings (if any) will be sent really less often. " \ - "5000 is a reasonable value.","options")); - connect(pUse,SIGNAL(toggled(bool)),pInterval,SLOT(setEnabled(bool))); - - KviUIntSelector * pAlarm = addUIntSelector(g, __tr2qs_ctx("Trigger event if lag exceeds:","options"), KviOption_uintLagAlarmTime,5000,1000000,30000, KVI_OPTION_BOOL(KviOption_boolUseLagMeterEngine)); - pAlarm->setSuffix(__tr2qs_ctx(" msec","options")); - mergeTip(pAlarm,__tr2qs_ctx("This option controls the threshold for the " \ - "OnLagAlarmTimeUp and OnLagAlarmTimeDown events. When the lag goes above " \ - "the threshold OnLagAlarmTimeUp will be triggered and when the lag falls " \ - "back below the threshold then OnLagAlarmTimeDown will be triggered","options")); - connect(pUse,SIGNAL(toggled(bool)),pAlarm,SLOT(setEnabled(bool))); + __tr2qs_ctx("This option allows you to set the lag meter heartbeat interval.
" + "The lower the heartbeat interval the higher will be the accuracy of the lag check " + "but also higher CPU usage and data traffic to the server.
" + "Please note that this is NOT the interval between pings sent to the server: " + "the pings (if any) will be sent really less often. " + "5000 is a reasonable value.", + "options")); + connect(pUse, SIGNAL(toggled(bool)), pInterval, SLOT(setEnabled(bool))); - KviBoolSelector * pShow = addBoolSelector(g, __tr2qs_ctx("Show lag in IRC context display","options"), KviOption_boolShowLagOnContextDisplay, KVI_OPTION_BOOL(KviOption_boolUseLagMeterEngine)); - mergeTip(pShow,__tr2qs_ctx("This makes the IRC context display applet show the current lag after the user's nickname (in seconds)","options")); + KviUIntSelector * pAlarm = addUIntSelector(g, __tr2qs_ctx("Trigger event if lag exceeds:", "options"), KviOption_uintLagAlarmTime, 5000, 1000000, 30000, KVI_OPTION_BOOL(KviOption_boolUseLagMeterEngine)); + pAlarm->setSuffix(__tr2qs_ctx(" msec", "options")); + mergeTip(pAlarm, __tr2qs_ctx("This option controls the threshold for the " + "OnLagAlarmTimeUp and OnLagAlarmTimeDown events. When the lag goes above " + "the threshold OnLagAlarmTimeUp will be triggered and when the lag falls " + "back below the threshold then OnLagAlarmTimeDown will be triggered", + "options")); + connect(pUse, SIGNAL(toggled(bool)), pAlarm, SLOT(setEnabled(bool))); - connect(pUse,SIGNAL(toggled(bool)),pShow,SLOT(setEnabled(bool))); - connect(pUse,SIGNAL(toggled(bool)),g,SLOT(setEnabled(bool))); + KviBoolSelector * pShow = addBoolSelector(g, __tr2qs_ctx("Show lag in IRC context display", "options"), KviOption_boolShowLagOnContextDisplay, KVI_OPTION_BOOL(KviOption_boolUseLagMeterEngine)); + mergeTip(pShow, __tr2qs_ctx("This makes the IRC context display applet show the current lag after the user's nickname (in seconds)", "options")); - addRowSpacer(0,2,0,2); + connect(pUse, SIGNAL(toggled(bool)), pShow, SLOT(setEnabled(bool))); + connect(pUse, SIGNAL(toggled(bool)), g, SLOT(setEnabled(bool))); + addRowSpacer(0, 2, 0, 2); } OptionsWidget_lag::~OptionsWidget_lag() diff --git a/src/modules/options/OptionsWidget_logging.cpp b/src/modules/options/OptionsWidget_logging.cpp index 49f2a9fff..ab372b4ee 100644 --- a/src/modules/options/OptionsWidget_logging.cpp +++ b/src/modules/options/OptionsWidget_logging.cpp @@ -29,41 +29,43 @@ #include - OptionsWidget_logging::OptionsWidget_logging(QWidget * parent) -: KviOptionsWidget(parent) + : KviOptionsWidget(parent) { setObjectName("logging_options_widget"); createLayout(); - KviTalGroupBox * g = addGroupBox(0,0,0,0,Qt::Horizontal,__tr2qs_ctx("Automatically Log","options")); - addBoolSelector(g,__tr2qs_ctx("Query windows","options"),KviOption_boolAutoLogQueries); - addBoolSelector(g,__tr2qs_ctx("Channel windows","options"),KviOption_boolAutoLogChannels); - addBoolSelector(g,__tr2qs_ctx("DCC chat windows","options"),KviOption_boolAutoLogDccChat); - addBoolSelector(g,__tr2qs_ctx("Console windows","options"),KviOption_boolAutoLogConsole); + KviTalGroupBox * g = addGroupBox(0, 0, 0, 0, Qt::Horizontal, __tr2qs_ctx("Automatically Log", "options")); + addBoolSelector(g, __tr2qs_ctx("Query windows", "options"), KviOption_boolAutoLogQueries); + addBoolSelector(g, __tr2qs_ctx("Channel windows", "options"), KviOption_boolAutoLogChannels); + addBoolSelector(g, __tr2qs_ctx("DCC chat windows", "options"), KviOption_boolAutoLogDccChat); + addBoolSelector(g, __tr2qs_ctx("Console windows", "options"), KviOption_boolAutoLogConsole); - QWidget * w = addDirectorySelector(0,1,0,1,__tr2qs_ctx("Save logs to folder:","options"),KviOption_stringLogsPath); - mergeTip(w, __tr2qs_ctx("This is the base log directory:
" \ - "all the log files will be saved inside this directory","options")); + QWidget * w = addDirectorySelector(0, 1, 0, 1, __tr2qs_ctx("Save logs to folder:", "options"), KviOption_stringLogsPath); + mergeTip(w, __tr2qs_ctx("This is the base log directory:
" + "all the log files will be saved inside this directory", + "options")); - w = addStringSelector(0,2,0,2,__tr2qs_ctx("Dynamic subfolder:","options"),KviOption_stringLogsDynamicPath); - mergeTip(w, __tr2qs_ctx("You can specify a subdirectory where log files will be saved: " \ - "use kvs code to create dynamic subfolders.","options")); + w = addStringSelector(0, 2, 0, 2, __tr2qs_ctx("Dynamic subfolder:", "options"), KviOption_stringLogsDynamicPath); + mergeTip(w, __tr2qs_ctx("You can specify a subdirectory where log files will be saved: " + "use kvs code to create dynamic subfolders.", + "options")); - addBoolSelector(0,3,0,3,__tr2qs_ctx("Strip message type numbers in logs","options"),KviOption_boolStripMsgTypeInLogs); - addBoolSelector(0,4,0,4,__tr2qs_ctx("Strip colors in logs","options"),KviOption_boolStripControlCodesInLogs); - KviUIntSelector* us = addUIntSelector(0,5,0,5,__tr2qs_ctx("Auto flush logs every:","options"),KviOption_uintAutoFlushLogs,0,99999,0); - us->setSuffix(__tr2qs_ctx(" min","options")); + addBoolSelector(0, 3, 0, 3, __tr2qs_ctx("Strip message type numbers in logs", "options"), KviOption_boolStripMsgTypeInLogs); + addBoolSelector(0, 4, 0, 4, __tr2qs_ctx("Strip colors in logs", "options"), KviOption_boolStripControlCodesInLogs); + KviUIntSelector * us = addUIntSelector(0, 5, 0, 5, __tr2qs_ctx("Auto flush logs every:", "options"), KviOption_uintAutoFlushLogs, 0, 99999, 0); + us->setSuffix(__tr2qs_ctx(" min", "options")); mergeTip(us, - __tr2qs_ctx("Save logs with the current interval.
" \ - "Set to 0 to disable this feature","options")); + __tr2qs_ctx("Save logs with the current interval.
" + "Set to 0 to disable this feature", + "options")); #ifdef COMPILE_ZLIB_SUPPORT - addBoolSelector(0,6,0,6,__tr2qs_ctx("Compress logs","options"),KviOption_boolGzipLogs); + addBoolSelector(0, 6, 0, 6, __tr2qs_ctx("Compress logs", "options"), KviOption_boolGzipLogs); #endif - addRowSpacer(0,7,0,7); + addRowSpacer(0, 7, 0, 7); } OptionsWidget_logging::~OptionsWidget_logging() diff --git a/src/modules/options/OptionsWidget_mediaTypes.cpp b/src/modules/options/OptionsWidget_mediaTypes.cpp index 42141ae5c..19fe5dd5c 100644 --- a/src/modules/options/OptionsWidget_mediaTypes.cpp +++ b/src/modules/options/OptionsWidget_mediaTypes.cpp @@ -34,20 +34,20 @@ // KviApplication.cpp extern KVIRC_API KviMediaManager * g_pMediaManager; -static void copyMediaType(KviMediaType * dst,const KviMediaType * src) +static void copyMediaType(KviMediaType * dst, const KviMediaType * src) { - dst->szFileMask = src->szFileMask; - dst->szIanaType = src->szIanaType; - dst->szDescription = src->szDescription; - dst->szMagicBytes = src->szMagicBytes; - dst->szSavePath = src->szSavePath; - dst->szCommandline = src->szCommandline; + dst->szFileMask = src->szFileMask; + dst->szIanaType = src->szIanaType; + dst->szDescription = src->szDescription; + dst->szMagicBytes = src->szMagicBytes; + dst->szSavePath = src->szSavePath; + dst->szCommandline = src->szCommandline; dst->szRemoteExecCommandline = src->szRemoteExecCommandline; - dst->szIcon = src->szIcon; + dst->szIcon = src->szIcon; } -MediaTypeTreeWidgetItem::MediaTypeTreeWidgetItem(QTreeWidget * w,KviMediaType * t) -: QTreeWidgetItem(w) +MediaTypeTreeWidgetItem::MediaTypeTreeWidgetItem(QTreeWidget * w, KviMediaType * t) + : QTreeWidgetItem(w) { copyData(t); } @@ -58,14 +58,14 @@ MediaTypeTreeWidgetItem::~MediaTypeTreeWidgetItem() void MediaTypeTreeWidgetItem::copyData(KviMediaType * t) { - copyMediaType(&m_data,t); - setText(0,m_data.szFileMask.ptr()); - setText(1,m_data.szIanaType.ptr()); - setText(2,m_data.szDescription.ptr()); + copyMediaType(&m_data, t); + setText(0, m_data.szFileMask.ptr()); + setText(1, m_data.szIanaType.ptr()); + setText(2, m_data.szDescription.ptr()); } OptionsWidget_mediaTypes::OptionsWidget_mediaTypes(QWidget * parent) -: KviOptionsWidget(parent) + : KviOptionsWidget(parent) { setObjectName("mediatypes_options_widget"); @@ -74,75 +74,77 @@ OptionsWidget_mediaTypes::OptionsWidget_mediaTypes(QWidget * parent) m_pTreeWidget = new QTreeWidget(this); m_pTreeWidget->setColumnCount(3); QStringList columnLabels; - columnLabels.append(__tr2qs_ctx("Pattern","options")); - columnLabels.append(__tr2qs_ctx("MIME Type","options")); - columnLabels.append(__tr2qs_ctx("Description","options")); + columnLabels.append(__tr2qs_ctx("Pattern", "options")); + columnLabels.append(__tr2qs_ctx("MIME Type", "options")); + columnLabels.append(__tr2qs_ctx("Description", "options")); m_pTreeWidget->setHeaderLabels(columnLabels); m_pTreeWidget->setAllColumnsShowFocus(true); m_pTreeWidget->setRootIsDecorated(false); - connect(m_pTreeWidget,SIGNAL(currentItemChanged(QTreeWidgetItem *,QTreeWidgetItem *)),this,SLOT(currentItemChanged(QTreeWidgetItem *,QTreeWidgetItem *))); + connect(m_pTreeWidget, SIGNAL(currentItemChanged(QTreeWidgetItem *, QTreeWidgetItem *)), this, SLOT(currentItemChanged(QTreeWidgetItem *, QTreeWidgetItem *))); - layout()->addWidget(m_pTreeWidget,0,0,1,3); + layout()->addWidget(m_pTreeWidget, 0, 0, 1, 3); - QLabel * l = new QLabel(__tr2qs_ctx("Description:","options"),this); - layout()->addWidget(l,1,0); + QLabel * l = new QLabel(__tr2qs_ctx("Description:", "options"), this); + layout()->addWidget(l, 1, 0); m_pDescription = new QLineEdit(this); - layout()->addWidget(m_pDescription,1,1,1,2); + layout()->addWidget(m_pDescription, 1, 1, 1, 2); - l = new QLabel(__tr2qs_ctx("MIME type:","options"),this); - layout()->addWidget(l,2,0); + l = new QLabel(__tr2qs_ctx("MIME type:", "options"), this); + layout()->addWidget(l, 2, 0); m_pIanaType = new QLineEdit(this); - layout()->addWidget(m_pIanaType,2,1,1,2); + layout()->addWidget(m_pIanaType, 2, 1, 1, 2); - l = new QLabel(__tr2qs_ctx("File pattern:","options"),this); - layout()->addWidget(l,3,0); + l = new QLabel(__tr2qs_ctx("File pattern:", "options"), this); + layout()->addWidget(l, 3, 0); m_pFileMask = new QLineEdit(this); - layout()->addWidget(m_pFileMask,3,1,1,2); + layout()->addWidget(m_pFileMask, 3, 1, 1, 2); - l = new QLabel(__tr2qs_ctx("Magic bytes:","options"),this); - layout()->addWidget(l,4,0); + l = new QLabel(__tr2qs_ctx("Magic bytes:", "options"), this); + layout()->addWidget(l, 4, 0); m_pMagicBytes = new QLineEdit(this); - layout()->addWidget(m_pMagicBytes,4,1,1,2); + layout()->addWidget(m_pMagicBytes, 4, 1, 1, 2); - l = new QLabel(__tr2qs_ctx("Save path:","options"),this); - layout()->addWidget(l,5,0); + l = new QLabel(__tr2qs_ctx("Save path:", "options"), this); + layout()->addWidget(l, 5, 0); m_pSavePath = new QLineEdit(this); - layout()->addWidget(m_pSavePath,5,1,1,2); + layout()->addWidget(m_pSavePath, 5, 1, 1, 2); - l = new QLabel(__tr2qs_ctx("Local open command:","options"),this); - layout()->addWidget(l,6,0); + l = new QLabel(__tr2qs_ctx("Local open command:", "options"), this); + layout()->addWidget(l, 6, 0); m_pCommandline = new QLineEdit(this); - layout()->addWidget(m_pCommandline,6,1,1,2); - mergeTip(m_pCommandline,__tr2qs_ctx("This field contains the command to execute to open a local file.
" \ - "$0 is used in place of the filename","options")); + layout()->addWidget(m_pCommandline, 6, 1, 1, 2); + mergeTip(m_pCommandline, __tr2qs_ctx("This field contains the command to execute to open a local file.
" + "$0 is used in place of the filename", + "options")); - l = new QLabel(__tr2qs_ctx("Remote open command:","options"),this); - layout()->addWidget(l,7,0); + l = new QLabel(__tr2qs_ctx("Remote open command:", "options"), this); + layout()->addWidget(l, 7, 0); m_pRemoteExecCommandline = new QLineEdit(this); - layout()->addWidget(m_pRemoteExecCommandline,7,1,1,2); - mergeTip(m_pRemoteExecCommandline,__tr2qs_ctx("This field contains the command to execute when automatically opening a received file.
" \ - "$0 is used in place of the filename","options")); + layout()->addWidget(m_pRemoteExecCommandline, 7, 1, 1, 2); + mergeTip(m_pRemoteExecCommandline, __tr2qs_ctx("This field contains the command to execute when automatically opening a received file.
" + "$0 is used in place of the filename", + "options")); - l = new QLabel(__tr2qs_ctx("Icon:","options"),this); - layout()->addWidget(l,8,0); + l = new QLabel(__tr2qs_ctx("Icon:", "options"), this); + layout()->addWidget(l, 8, 0); m_pIcon = new QLineEdit(this); - layout()->addWidget(m_pIcon,8,1,1,2); + layout()->addWidget(m_pIcon, 8, 1, 1, 2); QFrame * f = new QFrame(this); f->setFrameStyle(QFrame::Sunken | QFrame::HLine); - layout()->addWidget(f,9,0,1,3); + layout()->addWidget(f, 9, 0, 1, 3); - QPushButton * b = new QPushButton(__tr2qs_ctx("&New","options"),this); - connect(b,SIGNAL(clicked()),this,SLOT(newMediaType())); - layout()->addWidget(b,10,1); + QPushButton * b = new QPushButton(__tr2qs_ctx("&New", "options"), this); + connect(b, SIGNAL(clicked()), this, SLOT(newMediaType())); + layout()->addWidget(b, 10, 1); - m_pDelete = new QPushButton(__tr2qs_ctx("Re&move","options"),this); - connect(m_pDelete,SIGNAL(clicked()),this,SLOT(delMediaType())); - layout()->addWidget(m_pDelete,10,2); + m_pDelete = new QPushButton(__tr2qs_ctx("Re&move", "options"), this); + connect(m_pDelete, SIGNAL(clicked()), this, SLOT(delMediaType())); + layout()->addWidget(m_pDelete, 10, 2); - layout()->setColumnStretch(1,1); - layout()->setColumnStretch(2,1); - layout()->setRowStretch(0,1); + layout()->setColumnStretch(1, 1); + layout()->setColumnStretch(2, 1); + layout()->setRowStretch(0, 1); m_pLastItem = 0; @@ -159,8 +161,8 @@ void OptionsWidget_mediaTypes::fillTreeWidget() g_pMediaManager->lock(); KviPointerList * l = g_pMediaManager->mediaTypeList(); - for(KviMediaType * t = l->first();t;t = l->next()) - new MediaTypeTreeWidgetItem(m_pTreeWidget,t); + for(KviMediaType * t = l->first(); t; t = l->next()) + new MediaTypeTreeWidgetItem(m_pTreeWidget, t); g_pMediaManager->unlock(); enableOrDisable(); @@ -171,16 +173,17 @@ void OptionsWidget_mediaTypes::saveLastItem() if(m_pLastItem) { KviMediaType t; - t.szDescription = m_pDescription->text(); - t.szIanaType = m_pIanaType->text(); - t.szFileMask = m_pFileMask->text(); - t.szSavePath = m_pSavePath->text(); - t.szCommandline = m_pCommandline->text(); - t.szMagicBytes = m_pMagicBytes->text(); + t.szDescription = m_pDescription->text(); + t.szIanaType = m_pIanaType->text(); + t.szFileMask = m_pFileMask->text(); + t.szSavePath = m_pSavePath->text(); + t.szCommandline = m_pCommandline->text(); + t.szMagicBytes = m_pMagicBytes->text(); t.szRemoteExecCommandline = m_pRemoteExecCommandline->text(); - t.szIcon = m_pIcon->text(); + t.szIcon = m_pIcon->text(); - if(t.szDescription.isEmpty())t.szDescription = __tr2qs_ctx("[Unknown Media Type]","options"); + if(t.szDescription.isEmpty()) + t.szDescription = __tr2qs_ctx("[Unknown Media Type]", "options"); m_pLastItem->copyData(&t); } @@ -211,13 +214,14 @@ void OptionsWidget_mediaTypes::setLineEdits() m_pIcon->setText(m_pLastItem ? m_pLastItem->mydata()->szIcon.ptr() : ""); } -void OptionsWidget_mediaTypes::currentItemChanged(QTreeWidgetItem *it,QTreeWidgetItem *) +void OptionsWidget_mediaTypes::currentItemChanged(QTreeWidgetItem * it, QTreeWidgetItem *) { saveLastItem(); m_pLastItem = (MediaTypeTreeWidgetItem *)it; if(it) { - if(!it->isSelected())it->setSelected(true); + if(!it->isSelected()) + it->setSelected(true); } setLineEdits(); enableOrDisable(); @@ -226,8 +230,8 @@ void OptionsWidget_mediaTypes::currentItemChanged(QTreeWidgetItem *it,QTreeWidge void OptionsWidget_mediaTypes::newMediaType() { KviMediaType empty; - empty.szDescription = __tr2qs_ctx("New media type","options"); - MediaTypeTreeWidgetItem * it = new MediaTypeTreeWidgetItem(m_pTreeWidget,&empty); + empty.szDescription = __tr2qs_ctx("New media type", "options"); + MediaTypeTreeWidgetItem * it = new MediaTypeTreeWidgetItem(m_pTreeWidget, &empty); m_pTreeWidget->setCurrentItem(it); it->setSelected(true); } @@ -245,17 +249,17 @@ void OptionsWidget_mediaTypes::delMediaType() void OptionsWidget_mediaTypes::commit() { saveLastItem(); - MediaTypeTreeWidgetItem * it;// = (MediaTypeTreeWidgetItem *)m_pTreeWidget->firstChild(); + MediaTypeTreeWidgetItem * it; // = (MediaTypeTreeWidgetItem *)m_pTreeWidget->firstChild(); g_pMediaManager->lock(); g_pMediaManager->clear(); //while(it) - for(int i=0;itopLevelItemCount();i++) + for(int i = 0; i < m_pTreeWidget->topLevelItemCount(); i++) { - it=(MediaTypeTreeWidgetItem *)m_pTreeWidget->topLevelItem(i); + it = (MediaTypeTreeWidgetItem *)m_pTreeWidget->topLevelItem(i); KviMediaType * t = new KviMediaType; - copyMediaType(t,it->mydata()); + copyMediaType(t, it->mydata()); g_pMediaManager->insertMediaType(t); - // it = (MediaTypeTreeWidgetItem *)it->nextSibling(); + // it = (MediaTypeTreeWidgetItem *)it->nextSibling(); } g_pMediaManager->unlock(); } diff --git a/src/modules/options/OptionsWidget_mediaTypes.h b/src/modules/options/OptionsWidget_mediaTypes.h index 785922df4..5f9af85b6 100644 --- a/src/modules/options/OptionsWidget_mediaTypes.h +++ b/src/modules/options/OptionsWidget_mediaTypes.h @@ -31,17 +31,18 @@ #include #include - class MediaTypeTreeWidgetItem : public QTreeWidgetItem { public: - MediaTypeTreeWidgetItem(QTreeWidget * w,KviMediaType * t); + MediaTypeTreeWidgetItem(QTreeWidget * w, KviMediaType * t); ~MediaTypeTreeWidgetItem(); + private: KviMediaType m_data; + public: void copyData(KviMediaType * t); - const KviMediaType * mydata(){ return &m_data; }; + const KviMediaType * mydata() { return &m_data; }; }; #define KVI_OPTIONS_WIDGET_ICON_OptionsWidget_mediaTypes KviIconManager::File @@ -57,27 +58,30 @@ class OptionsWidget_mediaTypes : public KviOptionsWidget public: OptionsWidget_mediaTypes(QWidget * parent); ~OptionsWidget_mediaTypes(); + private: - QTreeWidget * m_pTreeWidget; - QLineEdit * m_pDescription; - QLineEdit * m_pIanaType; - QLineEdit * m_pFileMask; - QLineEdit * m_pSavePath; - QLineEdit * m_pCommandline; - QLineEdit * m_pMagicBytes; - QLineEdit * m_pRemoteExecCommandline; - QLineEdit * m_pIcon; + QTreeWidget * m_pTreeWidget; + QLineEdit * m_pDescription; + QLineEdit * m_pIanaType; + QLineEdit * m_pFileMask; + QLineEdit * m_pSavePath; + QLineEdit * m_pCommandline; + QLineEdit * m_pMagicBytes; + QLineEdit * m_pRemoteExecCommandline; + QLineEdit * m_pIcon; QPushButton * m_pDelete; MediaTypeTreeWidgetItem * m_pLastItem; + private: void fillTreeWidget(); void saveLastItem(); void enableOrDisable(); void setLineEdits(); private slots: - void currentItemChanged(QTreeWidgetItem *it,QTreeWidgetItem *prev); + void currentItemChanged(QTreeWidgetItem * it, QTreeWidgetItem * prev); void newMediaType(); void delMediaType(); + public: virtual void commit(); }; diff --git a/src/modules/options/OptionsWidget_message.cpp b/src/modules/options/OptionsWidget_message.cpp index a54ab0bf8..881700613 100644 --- a/src/modules/options/OptionsWidget_message.cpp +++ b/src/modules/options/OptionsWidget_message.cpp @@ -42,17 +42,15 @@ #include #if !defined(COMPILE_ON_WINDOWS) && !defined(COMPILE_ON_MINGW) - #include // symlink() +#include // symlink() #endif - #ifdef COMPILE_PSEUDO_TRANSPARENCY - extern KVIRC_API QPixmap * g_pShadedChildGlobalDesktopBackground; +extern KVIRC_API QPixmap * g_pShadedChildGlobalDesktopBackground; #endif - OptionsWidget_message::OptionsWidget_message(QWidget * pParent) -: KviOptionsWidget(pParent) + : KviOptionsWidget(pParent) { } @@ -63,60 +61,60 @@ OptionsWidget_message::~OptionsWidget_message() //////////////////////////////////////////////////////////////////////////////////////////////////////////////////// OptionsWidget_privmsg::OptionsWidget_privmsg(QWidget * parent) -: KviOptionsWidget(parent) + : KviOptionsWidget(parent) { setObjectName("privmsg_options_widget"); createLayout(); - KviTalGroupBox * g = addGroupBox(0,0,0,0,Qt::Horizontal,__tr2qs_ctx("General","options")); + KviTalGroupBox * g = addGroupBox(0, 0, 0, 0, Qt::Horizontal, __tr2qs_ctx("General", "options")); - addBoolSelector(g,__tr2qs_ctx("Show message icons","options"),KviOption_boolIrcViewShowImages); - addBoolSelector(g,__tr2qs_ctx("Draw some emoticons (smileys) as pictures","options"),KviOption_boolDrawEmoticons); - addBoolSelector(g,__tr2qs_ctx("Don't show colors in user messages","options"),KviOption_boolStripMircColorsInUserMessages); + addBoolSelector(g, __tr2qs_ctx("Show message icons", "options"), KviOption_boolIrcViewShowImages); + addBoolSelector(g, __tr2qs_ctx("Draw some emoticons (smileys) as pictures", "options"), KviOption_boolDrawEmoticons); + addBoolSelector(g, __tr2qs_ctx("Don't show colors in user messages", "options"), KviOption_boolStripMircColorsInUserMessages); - g = addGroupBox(0,1,0,1,Qt::Horizontal,__tr2qs_ctx("Nicknames","options")); + g = addGroupBox(0, 1, 0, 1, Qt::Horizontal, __tr2qs_ctx("Nicknames", "options")); - m_pUseSmartColorSelector = addBoolSelector(g,__tr2qs_ctx("\"Smart\" nickname colors","options"),KviOption_boolColorNicks); + m_pUseSmartColorSelector = addBoolSelector(g, __tr2qs_ctx("\"Smart\" nickname colors", "options"), KviOption_boolColorNicks); KviTalHBox * hb = new KviTalHBox(g); hb->setSpacing(4); - m_pSpecialSmartColorSelector = addBoolSelector(hb,__tr2qs_ctx("Use specified colors for own nick:","options"),KviOption_boolUseSpecifiedSmartColorForOwnNick,KVI_OPTION_BOOL(KviOption_boolColorNicks)); + m_pSpecialSmartColorSelector = addBoolSelector(hb, __tr2qs_ctx("Use specified colors for own nick:", "options"), KviOption_boolUseSpecifiedSmartColorForOwnNick, KVI_OPTION_BOOL(KviOption_boolColorNicks)); - m_pSmartColorSelector = addMircTextColorSelector(hb,"",KviOption_uintUserIrcViewOwnForeground,KviOption_uintUserIrcViewOwnBackground,KVI_OPTION_BOOL(KviOption_boolColorNicks) && KVI_OPTION_BOOL(KviOption_boolUseSpecifiedSmartColorForOwnNick)); + m_pSmartColorSelector = addMircTextColorSelector(hb, "", KviOption_uintUserIrcViewOwnForeground, KviOption_uintUserIrcViewOwnBackground, KVI_OPTION_BOOL(KviOption_boolColorNicks) && KVI_OPTION_BOOL(KviOption_boolUseSpecifiedSmartColorForOwnNick)); - connect(m_pSpecialSmartColorSelector,SIGNAL(toggled(bool)),this,SLOT(enableDisableSmartColorSelector(bool))); - connect(m_pUseSmartColorSelector,SIGNAL(toggled(bool)),m_pSpecialSmartColorSelector,SLOT(setEnabled(bool))); + connect(m_pSpecialSmartColorSelector, SIGNAL(toggled(bool)), this, SLOT(enableDisableSmartColorSelector(bool))); + connect(m_pUseSmartColorSelector, SIGNAL(toggled(bool)), m_pSpecialSmartColorSelector, SLOT(setEnabled(bool))); - KviBoolSelector * b2 = addBoolSelector(g,__tr2qs_ctx("Use same colors as in the userlist","options"),KviOption_boolUseUserListColorsAsNickColors,!KVI_OPTION_BOOL(KviOption_boolColorNicks)); - connect(m_pUseSmartColorSelector,SIGNAL(toggled(bool)),b2,SLOT(setNotEnabled(bool))); + KviBoolSelector * b2 = addBoolSelector(g, __tr2qs_ctx("Use same colors as in the userlist", "options"), KviOption_boolUseUserListColorsAsNickColors, !KVI_OPTION_BOOL(KviOption_boolColorNicks)); + connect(m_pUseSmartColorSelector, SIGNAL(toggled(bool)), b2, SLOT(setNotEnabled(bool))); - addBoolSelector(g,__tr2qs_ctx("Show nicknames in bold","options"),KviOption_boolBoldedNicks); - addBoolSelector(g,__tr2qs_ctx("Show user and host","options"),KviOption_boolShowUserAndHostInPrivmsgView); - addBoolSelector(g,__tr2qs_ctx("Show channel mode prefix","options"),KviOption_boolShowChannelUserFlagInPrivmsgView); - KviBoolSelector * b = addBoolSelector(g,__tr2qs_ctx("User-defined prefix and postfix","options"),KviOption_boolUseExtendedPrivmsgView); + addBoolSelector(g, __tr2qs_ctx("Show nicknames in bold", "options"), KviOption_boolBoldedNicks); + addBoolSelector(g, __tr2qs_ctx("Show user and host", "options"), KviOption_boolShowUserAndHostInPrivmsgView); + addBoolSelector(g, __tr2qs_ctx("Show channel mode prefix", "options"), KviOption_boolShowChannelUserFlagInPrivmsgView); + KviBoolSelector * b = addBoolSelector(g, __tr2qs_ctx("User-defined prefix and postfix", "options"), KviOption_boolUseExtendedPrivmsgView); - QLabel * l = addLabel(g,__tr2qs_ctx("[PREFIX]nickname[!user@host][POSTFIX] message","options")); + QLabel * l = addLabel(g, __tr2qs_ctx("[PREFIX]nickname[!user@host][POSTFIX] message", "options")); l->setEnabled(KVI_OPTION_BOOL(KviOption_boolUseExtendedPrivmsgView)); connect(b, - SIGNAL(toggled(bool)), - l, - SLOT(setEnabled(bool))); + SIGNAL(toggled(bool)), + l, + SLOT(setEnabled(bool))); KviTalVBox * vb = new KviTalVBox(g); vb->setSpacing(5); connect( - b, - SIGNAL(toggled(bool)), - addStringSelector(vb,__tr2qs_ctx("Prefix:","options"),KviOption_stringExtendedPrivmsgPrefix,KVI_OPTION_BOOL(KviOption_boolUseExtendedPrivmsgView)), - SLOT(setEnabled(bool))); + b, + SIGNAL(toggled(bool)), + addStringSelector(vb, __tr2qs_ctx("Prefix:", "options"), KviOption_stringExtendedPrivmsgPrefix, KVI_OPTION_BOOL(KviOption_boolUseExtendedPrivmsgView)), + SLOT(setEnabled(bool))); connect( - b, - SIGNAL(toggled(bool)), - addStringSelector(vb,__tr2qs_ctx("Postfix:","options"),KviOption_stringExtendedPrivmsgPostfix,KVI_OPTION_BOOL(KviOption_boolUseExtendedPrivmsgView)), - SLOT(setEnabled(bool))); - addRowSpacer(0,3,0,3); + b, + SIGNAL(toggled(bool)), + addStringSelector(vb, __tr2qs_ctx("Postfix:", "options"), KviOption_stringExtendedPrivmsgPostfix, KVI_OPTION_BOOL(KviOption_boolUseExtendedPrivmsgView)), + SLOT(setEnabled(bool))); + addRowSpacer(0, 3, 0, 3); } void OptionsWidget_privmsg::enableDisableSmartColorSelector(bool) @@ -129,30 +127,30 @@ OptionsWidget_privmsg::~OptionsWidget_privmsg() } OptionsWidget_timestamp::OptionsWidget_timestamp(QWidget * pParent) -: KviOptionsWidget(pParent) + : KviOptionsWidget(pParent) { createLayout(); - m_pUseTimestampSelector = addBoolSelector(0,0,0,0,__tr2qs_ctx("Show timestamp","options"),KviOption_boolIrcViewTimestamp); + m_pUseTimestampSelector = addBoolSelector(0, 0, 0, 0, __tr2qs_ctx("Show timestamp", "options"), KviOption_boolIrcViewTimestamp); - connect(m_pUseTimestampSelector,SIGNAL(toggled(bool)),this,SLOT(enableDisableTimestampSelector(bool))); - KviBoolSelector* b = addBoolSelector(0,1,0,1,__tr2qs_ctx("Use UTC time for timestamp","options"),KviOption_boolIrcViewTimestampUTC,KVI_OPTION_BOOL(KviOption_boolIrcViewTimestamp)); + connect(m_pUseTimestampSelector, SIGNAL(toggled(bool)), this, SLOT(enableDisableTimestampSelector(bool))); + KviBoolSelector * b = addBoolSelector(0, 1, 0, 1, __tr2qs_ctx("Use UTC time for timestamp", "options"), KviOption_boolIrcViewTimestampUTC, KVI_OPTION_BOOL(KviOption_boolIrcViewTimestamp)); - connect(m_pUseTimestampSelector,SIGNAL(toggled(bool)),b,SLOT(setEnabled(bool))); + connect(m_pUseTimestampSelector, SIGNAL(toggled(bool)), b, SLOT(setEnabled(bool))); - KviTalHBox *hb = new KviTalHBox(this); - addWidgetToLayout(hb,0,2,0,2); + KviTalHBox * hb = new KviTalHBox(this); + addWidgetToLayout(hb, 0, 2, 0, 2); - m_pSpecialTimestampColorSelector = addBoolSelector(hb,__tr2qs_ctx("Use special color for timestamps:","options"),KviOption_boolUseSpecialColorForTimestamp,KVI_OPTION_BOOL(KviOption_boolIrcViewTimestamp)); - connect(m_pSpecialTimestampColorSelector,SIGNAL(toggled(bool)),this,SLOT(enableDisableTimestampSelector(bool))); - connect(m_pUseTimestampSelector,SIGNAL(toggled(bool)),m_pSpecialTimestampColorSelector,SLOT(setEnabled(bool))); + m_pSpecialTimestampColorSelector = addBoolSelector(hb, __tr2qs_ctx("Use special color for timestamps:", "options"), KviOption_boolUseSpecialColorForTimestamp, KVI_OPTION_BOOL(KviOption_boolIrcViewTimestamp)); + connect(m_pSpecialTimestampColorSelector, SIGNAL(toggled(bool)), this, SLOT(enableDisableTimestampSelector(bool))); + connect(m_pUseTimestampSelector, SIGNAL(toggled(bool)), m_pSpecialTimestampColorSelector, SLOT(setEnabled(bool))); - m_pTimestampColorSelector = addMircTextColorSelector(hb,"",KviOption_uintTimeStampForeground,KviOption_uintTimeStampBackground,KVI_OPTION_BOOL(KviOption_boolIrcViewTimestamp) && KVI_OPTION_BOOL(KviOption_boolUseSpecialColorForTimestamp)); + m_pTimestampColorSelector = addMircTextColorSelector(hb, "", KviOption_uintTimeStampForeground, KviOption_uintTimeStampBackground, KVI_OPTION_BOOL(KviOption_boolIrcViewTimestamp) && KVI_OPTION_BOOL(KviOption_boolUseSpecialColorForTimestamp)); - KviStringSelector * st=addStringSelector(0,3,0,3,__tr2qs_ctx("Timestamp format:","options"),KviOption_stringIrcViewTimestampFormat); - connect(m_pUseTimestampSelector,SIGNAL(toggled(bool)),st,SLOT(setEnabled(bool))); + KviStringSelector * st = addStringSelector(0, 3, 0, 3, __tr2qs_ctx("Timestamp format:", "options"), KviOption_stringIrcViewTimestampFormat); + connect(m_pUseTimestampSelector, SIGNAL(toggled(bool)), st, SLOT(setEnabled(bool))); - connect(m_pUseTimestampSelector,SIGNAL(toggled(bool)),m_pSpecialTimestampColorSelector,SLOT(setEnabled(bool))); - addRowSpacer(0,4,0,4); + connect(m_pUseTimestampSelector, SIGNAL(toggled(bool)), m_pSpecialTimestampColorSelector, SLOT(setEnabled(bool))); + addRowSpacer(0, 4, 0, 4); } OptionsWidget_timestamp::~OptionsWidget_timestamp() @@ -167,31 +165,29 @@ void OptionsWidget_timestamp::enableDisableTimestampSelector(bool) ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// OptionsWidget_standardColors::OptionsWidget_standardColors(QWidget * parent) -: KviOptionsWidget(parent) + : KviOptionsWidget(parent) { setObjectName("stdcolors"); createLayout(); - for(int i=0;i<16;i++) - m_pColorSelector[i] = addColorSelector(i%4,i/4,i%4,i/4,QString("%1:").arg(i),&(KVI_OPTION_MIRCCOLOR(i))); - - QLabel * l = addLabel(0,4,3,4,__tr2qs_ctx( - "Please note that this is a set of standard IRC colors. " \ - "You can adjust them a bit, make them darker or lighter but you " \ - "shouldn't change their fundamental tint. " \ - "Black should stay black, dark green should still remain a green darker than the light one.", - "options" - ) - ); + for(int i = 0; i < 16; i++) + m_pColorSelector[i] = addColorSelector(i % 4, i / 4, i % 4, i / 4, QString("%1:").arg(i), &(KVI_OPTION_MIRCCOLOR(i))); + + QLabel * l = addLabel(0, 4, 3, 4, __tr2qs_ctx( + "Please note that this is a set of standard IRC colors. " + "You can adjust them a bit, make them darker or lighter but you " + "shouldn't change their fundamental tint. " + "Black should stay black, dark green should still remain a green darker than the light one.", + "options")); l->setAlignment(Qt::AlignLeft); - addRowSpacer(0,5,3,5); + addRowSpacer(0, 5, 3, 5); - layout()->setRowStretch(5,1); + layout()->setRowStretch(5, 1); - QPushButton * pReset = addPushButton(3,6,3,6,__tr2qs_ctx("Reset to Default","options")); + QPushButton * pReset = addPushButton(3, 6, 3, 6, __tr2qs_ctx("Reset to Default", "options")); - QObject::connect(pReset,SIGNAL(clicked()),this,SLOT(resetToDefaults())); + QObject::connect(pReset, SIGNAL(clicked()), this, SLOT(resetToDefaults())); } OptionsWidget_standardColors::~OptionsWidget_standardColors() @@ -200,33 +196,33 @@ OptionsWidget_standardColors::~OptionsWidget_standardColors() void OptionsWidget_standardColors::resetToDefaults() { - m_pColorSelector[0]->forceColor(QColor(255,255,255)); - m_pColorSelector[1]->forceColor(QColor(0,0,0)); - m_pColorSelector[2]->forceColor(QColor(0,0,140)); - m_pColorSelector[3]->forceColor(QColor(0,100,0)); - m_pColorSelector[4]->forceColor(QColor(230,0,0)); - m_pColorSelector[5]->forceColor(QColor(150,0,0)); - m_pColorSelector[6]->forceColor(QColor(80,0,80)); - m_pColorSelector[7]->forceColor(QColor(255,90,0)); - m_pColorSelector[8]->forceColor(QColor(255,255,0)); - m_pColorSelector[9]->forceColor(QColor(0,255,0)); - m_pColorSelector[10]->forceColor(QColor(0,150,180)); - m_pColorSelector[11]->forceColor(QColor(170,170,255)); - m_pColorSelector[12]->forceColor(QColor(15,15,255)); - m_pColorSelector[13]->forceColor(QColor(200,0,200)); - m_pColorSelector[14]->forceColor(QColor(80,80,80)); - m_pColorSelector[15]->forceColor(QColor(170,170,170)); + m_pColorSelector[0]->forceColor(QColor(255, 255, 255)); + m_pColorSelector[1]->forceColor(QColor(0, 0, 0)); + m_pColorSelector[2]->forceColor(QColor(0, 0, 140)); + m_pColorSelector[3]->forceColor(QColor(0, 100, 0)); + m_pColorSelector[4]->forceColor(QColor(230, 0, 0)); + m_pColorSelector[5]->forceColor(QColor(150, 0, 0)); + m_pColorSelector[6]->forceColor(QColor(80, 0, 80)); + m_pColorSelector[7]->forceColor(QColor(255, 90, 0)); + m_pColorSelector[8]->forceColor(QColor(255, 255, 0)); + m_pColorSelector[9]->forceColor(QColor(0, 255, 0)); + m_pColorSelector[10]->forceColor(QColor(0, 150, 180)); + m_pColorSelector[11]->forceColor(QColor(170, 170, 255)); + m_pColorSelector[12]->forceColor(QColor(15, 15, 255)); + m_pColorSelector[13]->forceColor(QColor(200, 0, 200)); + m_pColorSelector[14]->forceColor(QColor(80, 80, 80)); + m_pColorSelector[15]->forceColor(QColor(170, 170, 170)); } -MessageListWidgetItem::MessageListWidgetItem(MessageListWidget* l,int optId) -: KviTalListWidgetItem(l) +MessageListWidgetItem::MessageListWidgetItem(MessageListWidget * l, int optId) + : KviTalListWidgetItem(l) { m_iOptId = optId; m_pMsgType = new KviMessageTypeSettings(KVI_OPTION_MSGTYPE(optId)); QString txt = g_msgtypeOptionsTable[m_iOptId].name; // skip the msgtype prefix - txt.remove(0,KVI_MSGTYPE_OPTIONS_PREFIX_LEN); + txt.remove(0, KVI_MSGTYPE_OPTIONS_PREFIX_LEN); txt += " ("; txt += __tr2qs_no_xgettext(m_pMsgType->type()); txt += ")"; @@ -243,40 +239,45 @@ MessageListWidgetItem::~MessageListWidgetItem() void MessageListWidgetItemDelegate::paint(QPainter * p, const QStyleOptionViewItem & opt, const QModelIndex & index) const { - const KviTalListWidget *tb = (const KviTalListWidget *)parent(); - MessageListWidgetItem *it = static_cast(index.internalPointer()); + const KviTalListWidget * tb = (const KviTalListWidget *)parent(); + MessageListWidgetItem * it = static_cast(index.internalPointer()); #ifdef COMPILE_PSEUDO_TRANSPARENCY if(KVI_OPTION_BOOL(KviOption_boolUseCompositingForTransparency) && g_pApp->supportsCompositing()) { p->save(); p->setCompositionMode(QPainter::CompositionMode_Source); - QColor col=KVI_OPTION_COLOR(KviOption_colorGlobalTransparencyFade); + QColor col = KVI_OPTION_COLOR(KviOption_colorGlobalTransparencyFade); col.setAlphaF((float)((float)KVI_OPTION_UINT(KviOption_uintGlobalTransparencyChildFadeFactor) / (float)100)); p->fillRect(opt.rect, col); p->restore(); - } else if(g_pShadedChildGlobalDesktopBackground) + } + else if(g_pShadedChildGlobalDesktopBackground) { QPoint pnt = tb->viewport()->mapToGlobal(opt.rect.topLeft()); - p->drawTiledPixmap(opt.rect,*g_pShadedChildGlobalDesktopBackground, pnt); - } else { + p->drawTiledPixmap(opt.rect, *g_pShadedChildGlobalDesktopBackground, pnt); + } + else + { #endif QPixmap * pix = KVI_OPTION_PIXMAP(KviOption_pixmapIrcViewBackground).pixmap(); if(pix) { QPoint pnt = tb->viewport()->mapToGlobal(opt.rect.topLeft()); - p->drawTiledPixmap(opt.rect,*pix,pnt); - } else { - p->fillRect(opt.rect,KVI_OPTION_COLOR(KviOption_colorIrcViewBackground)); + p->drawTiledPixmap(opt.rect, *pix, pnt); + } + else + { + p->fillRect(opt.rect, KVI_OPTION_COLOR(KviOption_colorIrcViewBackground)); } #ifdef COMPILE_PSEUDO_TRANSPARENCY } #endif - QString szText=index.data(Qt::DisplayRole).toString(); + QString szText = index.data(Qt::DisplayRole).toString(); QPoint pt = opt.rect.topLeft(); pt.setX(pt.x() + 4); - p->drawPixmap(pt,*(g_pIconManager->getSmallIcon(it->msgType()->pixId()))); + p->drawPixmap(pt, *(g_pIconManager->getSmallIcon(it->msgType()->pixId()))); pt.setX(pt.x() + 18); // draw the background if(it->msgType()->back() < 16) @@ -285,38 +286,40 @@ void MessageListWidgetItemDelegate::paint(QPainter * p, const QStyleOptionViewIt p->fillRect(pt.x(), pt.y(), opt.rect.width() - pt.x(), opt.rect.height(), bColor); } unsigned char ucFore = it->msgType()->fore(); - if(ucFore > 15)ucFore = 0; + if(ucFore > 15) + ucFore = 0; p->setPen(QPen(KVI_OPTION_MIRCCOLOR(ucFore))); pt.setX(pt.x() + 2); - p->drawText(pt.x(), pt.y(), opt.rect.width() - pt.x(), opt.rect.height(),Qt::AlignLeft | Qt::AlignVCenter,szText); + p->drawText(pt.x(), pt.y(), opt.rect.width() - pt.x(), opt.rect.height(), Qt::AlignLeft | Qt::AlignVCenter, szText); if(opt.state & QStyle::State_Selected) { QPen pen(Qt::white); p->setPen(pen); - p->drawRect(opt.rect.adjusted(0,0,-1,-1)); - p->drawRect(opt.rect.adjusted (1,1,-2,-2)); + p->drawRect(opt.rect.adjusted(0, 0, -1, -1)); + p->drawRect(opt.rect.adjusted(1, 1, -2, -2)); pen.setColor(Qt::black); pen.setStyle(Qt::DashLine); p->setPen(pen); - p->drawRect(opt.rect.adjusted(0,0,-1,-1)); - p->drawRect(opt.rect.adjusted (1,1,-2,-2)); + p->drawRect(opt.rect.adjusted(0, 0, -1, -1)); + p->drawRect(opt.rect.adjusted(1, 1, -2, -2)); } } - -MessageColorListWidgetItem::MessageColorListWidgetItem(KviTalListWidget * b,int idx) -: KviTalListWidgetText(b,QString()) +MessageColorListWidgetItem::MessageColorListWidgetItem(KviTalListWidget * b, int idx) + : KviTalListWidgetText(b, QString()) { m_iClrIdx = idx; if((idx < 0) || (idx > 15)) { - setText(__tr2qs_ctx("Transparent","options")); + setText(__tr2qs_ctx("Transparent", "options")); setBackground(listWidget()->isEnabled() ? Qt::transparent : Qt::gray); - } else { + } + else + { setBackground(QColor(KVI_OPTION_MIRCCOLOR(m_iClrIdx))); setText(" "); } @@ -332,33 +335,37 @@ void MessageColorListWidgetItemDelegate::paint(QPainter * p, const QStyleOptionV if(opt.state & QStyle::State_Selected) { QColor clr; - const KviTalListWidget *lb = (const KviTalListWidget *)parent(); - MessageColorListWidgetItem *it = static_cast(index.internalPointer()); + const KviTalListWidget * lb = (const KviTalListWidget *)parent(); + MessageColorListWidgetItem * it = static_cast(index.internalPointer()); if((it->clrIdx() >= 0) && (it->clrIdx() <= 15)) { clr = KVI_OPTION_MIRCCOLOR(it->clrIdx()); - } else { - clr =lb->palette().color(QPalette::Window); + } + else + { + clr = lb->palette().color(QPalette::Window); } QStyleOptionViewItem optz(opt); optz.state = opt.state ^ QStyle::State_Selected; QItemDelegate::paint(p, optz, index); - QPen pen(QColor(255-clr.red(), 255-clr.green(), 255-clr.blue())); + QPen pen(QColor(255 - clr.red(), 255 - clr.green(), 255 - clr.blue())); pen.setStyle(Qt::DashLine); p->setPen(pen); - p->drawRect(opt.rect.adjusted(0,0,-1,-1)); - p->drawRect(opt.rect.adjusted (1,1,-2,-2)); - p->drawRect(opt.rect.adjusted (2,2,-3,-3)); - } else { + p->drawRect(opt.rect.adjusted(0, 0, -1, -1)); + p->drawRect(opt.rect.adjusted(1, 1, -2, -2)); + p->drawRect(opt.rect.adjusted(2, 2, -3, -3)); + } + else + { QItemDelegate::paint(p, opt, index); } } OptionsWidget_messageColors::OptionsWidget_messageColors(QWidget * parent) -: KviOptionsWidget(parent) + : KviOptionsWidget(parent) { setObjectName("messages"); @@ -374,78 +381,77 @@ OptionsWidget_messageColors::OptionsWidget_messageColors(QWidget * parent) m_pListView->setFont(KVI_OPTION_FONT(KviOption_fontIrcView)); m_pListView->viewport()->setAutoFillBackground(false); - addWidgetToLayout(m_pListView,0,0,2,0); + addWidgetToLayout(m_pListView, 0, 0, 2, 0); KviTalVBox * box = new KviTalVBox(this); - addWidgetToLayout(box,3,0,3,0); + addWidgetToLayout(box, 3, 0, 3, 0); - new QLabel(__tr2qs_ctx("Background:","options"),box); + new QLabel(__tr2qs_ctx("Background:", "options"), box); m_pBackListWidget = new KviTalListWidget(box); m_pBackListWidget->setMaximumWidth(150); m_pBackListWidgetDelegate = new MessageColorListWidgetItemDelegate(m_pBackListWidget); m_pBackListWidget->setItemDelegate(m_pBackListWidgetDelegate); - m_pBackItems[16] = new MessageColorListWidgetItem(m_pBackListWidget,KviControlCodes::Transparent); - for(i=0;i<16;i++) + m_pBackItems[16] = new MessageColorListWidgetItem(m_pBackListWidget, KviControlCodes::Transparent); + for(i = 0; i < 16; i++) { - m_pBackItems[i] = new MessageColorListWidgetItem(m_pBackListWidget,i); + m_pBackItems[i] = new MessageColorListWidgetItem(m_pBackListWidget, i); } - new QLabel(__tr2qs_ctx("Foreground:","options"),box); + new QLabel(__tr2qs_ctx("Foreground:", "options"), box); m_pForeListWidget = new KviTalListWidget(box); m_pForeListWidget->setMaximumWidth(150); m_pForeListWidgetDelegate = new MessageColorListWidgetItemDelegate(m_pForeListWidget); m_pForeListWidget->setItemDelegate(m_pForeListWidgetDelegate); - for(i=0;i<16;i++) + for(i = 0; i < 16; i++) { - m_pForeItems[i] = new MessageColorListWidgetItem(m_pForeListWidget,i); + m_pForeItems[i] = new MessageColorListWidgetItem(m_pForeListWidget, i); } - new QLabel(__tr2qs_ctx("Alert level:","options"),box); + new QLabel(__tr2qs_ctx("Alert level:", "options"), box); m_pLevelListWidget = new KviTalListWidget(box); m_pLevelListWidget->setMaximumWidth(150); - for(i=0;i<6;i++) + for(i = 0; i < 6; i++) { QString tmpn; tmpn.setNum(i); - new KviTalListWidgetText(m_pLevelListWidget,tmpn); + new KviTalListWidgetText(m_pLevelListWidget, tmpn); } m_pIconButton = new QToolButton(box); - connect(m_pIconButton,SIGNAL(clicked()),this,SLOT(iconButtonClicked())); + connect(m_pIconButton, SIGNAL(clicked()), this, SLOT(iconButtonClicked())); - m_pIconPopup = new QMenu(this); + m_pIconPopup = new QMenu(this); KviIconWidget * iw = new KviIconWidget(m_pIconPopup); - connect(iw,SIGNAL(selected(KviIconManager::SmallIcon)),this,SLOT(newIconSelected(KviIconManager::SmallIcon))); + connect(iw, SIGNAL(selected(KviIconManager::SmallIcon)), this, SLOT(newIconSelected(KviIconManager::SmallIcon))); QWidgetAction * pWaction = new QWidgetAction(m_pIconPopup); pWaction->setDefaultWidget(iw); m_pIconPopup->addAction(pWaction); - m_pEnableLogging = new QCheckBox(__tr2qs_ctx("Log this","options"),box); + m_pEnableLogging = new QCheckBox(__tr2qs_ctx("Log this", "options"), box); KviTalHBox * h = new KviTalHBox(this); - addWidgetToLayout(h,0,1,3,1); - QPushButton * b = new QPushButton(__tr2qs_ctx("Load from...","options"),h); - connect(b,SIGNAL(clicked()),this,SLOT(load())); - b = new QPushButton(__tr2qs_ctx("Save As...","options"),h); - connect(b,SIGNAL(clicked()),this,SLOT(save())); - + addWidgetToLayout(h, 0, 1, 3, 1); + QPushButton * b = new QPushButton(__tr2qs_ctx("Load from...", "options"), h); + connect(b, SIGNAL(clicked()), this, SLOT(load())); + b = new QPushButton(__tr2qs_ctx("Save As...", "options"), h); + connect(b, SIGNAL(clicked()), this, SLOT(save())); - for(i=0;isetRowStretch(0,1); - layout()->setColumnStretch(0,1); + layout()->setRowStretch(0, 1); + layout()->setColumnStretch(0, 1); - connect(m_pListView,SIGNAL(itemSelectionChanged ()),this,SLOT(itemChanged())); - connect(m_pForeListWidget,SIGNAL(itemSelectionChanged ()),this,SLOT(colorChanged())); - connect(m_pBackListWidget,SIGNAL(itemSelectionChanged ()),this,SLOT(colorChanged())); + connect(m_pListView, SIGNAL(itemSelectionChanged()), this, SLOT(itemChanged())); + connect(m_pForeListWidget, SIGNAL(itemSelectionChanged()), this, SLOT(colorChanged())); + connect(m_pBackListWidget, SIGNAL(itemSelectionChanged()), this, SLOT(colorChanged())); itemChanged(); } @@ -453,11 +459,11 @@ OptionsWidget_messageColors::OptionsWidget_messageColors(QWidget * parent) OptionsWidget_messageColors::~OptionsWidget_messageColors() { int i; - for(i=15;i>=0;i--) + for(i = 15; i >= 0; i--) { delete m_pForeItems[i]; } - for(i=16;i>=0;i--) + for(i = 16; i >= 0; i--) { delete m_pBackItems[i]; } @@ -473,7 +479,8 @@ OptionsWidget_messageColors::~OptionsWidget_messageColors() void OptionsWidget_messageColors::newIconSelected(KviIconManager::SmallIcon eIcon) { - if(!m_pLastItem)return; + if(!m_pLastItem) + return; if(eIcon >= KviIconManager::IconCount) return; m_pLastItem->msgType()->setPixId(eIcon); @@ -492,27 +499,31 @@ void OptionsWidget_messageColors::saveLastItem() //qDebug("Setting fore %d",curIt); MessageColorListWidgetItem * fore = (MessageColorListWidgetItem *)m_pForeListWidget->item(curIt); //qDebug("And is %d",fore); - if(fore)m_pLastItem->msgType()->setFore(fore->m_iClrIdx); + if(fore) + m_pLastItem->msgType()->setFore(fore->m_iClrIdx); } curIt = m_pBackListWidget->currentRow(); if(curIt >= 0) //quite useless { MessageColorListWidgetItem * back = (MessageColorListWidgetItem *)m_pBackListWidget->item(curIt); - if(back)m_pLastItem->msgType()->setBack(back->m_iClrIdx); + if(back) + m_pLastItem->msgType()->setBack(back->m_iClrIdx); } m_pLastItem->msgType()->enableLogging(m_pEnableLogging->isChecked()); //qDebug("Updating","options"); curIt = m_pLevelListWidget->currentRow(); - if(curIt < 0 || curIt > 5)curIt = 1; + if(curIt < 0 || curIt > 5) + curIt = 1; m_pLastItem->msgType()->setLevel(curIt); m_pListView->repaint(m_pListView->visualItemRect(m_pLastItem)); } void OptionsWidget_messageColors::itemChanged() { - KviTalListWidgetItem * it = (KviTalListWidgetItem*)m_pListView->currentItem(); + KviTalListWidgetItem * it = (KviTalListWidgetItem *)m_pListView->currentItem(); //qDebug("Item changed","options"); - if(m_pLastItem)saveLastItem(); + if(m_pLastItem) + saveLastItem(); m_pLastItem = 0; // do NOT save in this routine @@ -533,7 +544,9 @@ void OptionsWidget_messageColors::itemChanged() if(back >= 0 && back <= 15) { m_pBackListWidget->setCurrentItem(m_pBackItems[back]); - } else { + } + else + { m_pBackListWidget->setCurrentItem(m_pBackItems[16]); } m_pLevelListWidget->setCurrentRow(((MessageListWidgetItem *)it)->msgType()->level()); @@ -547,7 +560,8 @@ void OptionsWidget_messageColors::itemChanged() void OptionsWidget_messageColors::colorChanged() { - if(m_pLastItem)saveLastItem(); + if(m_pLastItem) + saveLastItem(); } void OptionsWidget_messageColors::iconButtonClicked() @@ -562,9 +576,9 @@ void OptionsWidget_messageColors::commit() mergeResetFlag(KviOption_resetUpdateGui); int count = m_pListView->count(); - for(int i=0; iitem(i); + MessageListWidgetItem * it = (MessageListWidgetItem *)m_pListView->item(i); KVI_OPTION_MSGTYPE(it->optionId()) = *(it->msgType()); } @@ -575,36 +589,35 @@ void OptionsWidget_messageColors::save() { QString szName; QString szInit; - g_pApp->getLocalKvircDirectory(szInit,KviApplication::MsgColors); + g_pApp->getLocalKvircDirectory(szInit, KviApplication::MsgColors); - if(KviFileDialog::askForSaveFileName(szName,__tr2qs_ctx("Enter a Filename - KVIrc","options"),szInit,QString(),false,false,true,this)) + if(KviFileDialog::askForSaveFileName(szName, __tr2qs_ctx("Enter a Filename - KVIrc", "options"), szInit, QString(), false, false, true, this)) { - if(m_pLastItem)saveLastItem(); + if(m_pLastItem) + saveLastItem(); - KviConfigurationFile cfg(szName,KviConfigurationFile::Write); + KviConfigurationFile cfg(szName, KviConfigurationFile::Write); cfg.setGroup("Messages"); KviCString tmp; - int count = m_pListView->count(); - for(int i=0; iitem(i); - - tmp.sprintf("Fore%d",it->optionId()); - cfg.writeEntry(tmp.ptr(),it->msgType()->fore()); - tmp.sprintf("Back%d",it->optionId()); - cfg.writeEntry(tmp.ptr(),it->msgType()->back()); - tmp.sprintf("Icon%d",it->optionId()); - cfg.writeEntry(tmp.ptr(),it->msgType()->pixId()); - tmp.sprintf("Log%d",it->optionId()); - cfg.writeEntry(tmp.ptr(),it->msgType()->logEnabled()); - tmp.sprintf("Level%d",it->optionId()); - cfg.writeEntry(tmp.ptr(),it->msgType()->level()); + MessageListWidgetItem * it = (MessageListWidgetItem *)m_pListView->item(i); + + tmp.sprintf("Fore%d", it->optionId()); + cfg.writeEntry(tmp.ptr(), it->msgType()->fore()); + tmp.sprintf("Back%d", it->optionId()); + cfg.writeEntry(tmp.ptr(), it->msgType()->back()); + tmp.sprintf("Icon%d", it->optionId()); + cfg.writeEntry(tmp.ptr(), it->msgType()->pixId()); + tmp.sprintf("Log%d", it->optionId()); + cfg.writeEntry(tmp.ptr(), it->msgType()->logEnabled()); + tmp.sprintf("Level%d", it->optionId()); + cfg.writeEntry(tmp.ptr(), it->msgType()->level()); } - } } @@ -615,28 +628,28 @@ void OptionsWidget_messageColors::load() QString szName; QString szInit; - g_pApp->getLocalKvircDirectory(szInit,KviApplication::MsgColors); + g_pApp->getLocalKvircDirectory(szInit, KviApplication::MsgColors); #if !defined(COMPILE_ON_WINDOWS) && !defined(COMPILE_ON_MINGW) // symlink local to global QString szGlobal; - g_pApp->getGlobalKvircDirectory(szGlobal,KviApplication::MsgColors); + g_pApp->getGlobalKvircDirectory(szGlobal, KviApplication::MsgColors); QString szLocal; - g_pApp->getLocalKvircDirectory(szLocal,KviApplication::MsgColors,"presets"); + g_pApp->getLocalKvircDirectory(szLocal, KviApplication::MsgColors, "presets"); //qDebug("SYMLINKING %s to %s",szGlobal.ptr(),szLocal.ptr()); //qDebug("SYMLINK RETURNS %d (%d)",::symlink(szGlobal.ptr(),szLocal.ptr())); //qDebug("ERRNO (%d)",errno); int dummy; // make gcc happy - dummy = symlink(szGlobal.toLocal8Bit().data(),szLocal.toLocal8Bit().data()); + dummy = symlink(szGlobal.toLocal8Bit().data(), szLocal.toLocal8Bit().data()); Q_UNUSED(dummy); - // FIXME: Do it also on windows... +// FIXME: Do it also on windows... #endif - if(KviFileDialog::askForOpenFileName(szName,__tr2qs_ctx("Select a File - KVIrc","options"),szInit,QString(),false,true,this)) + if(KviFileDialog::askForOpenFileName(szName, __tr2qs_ctx("Select a File - KVIrc", "options"), szInit, QString(), false, true, this)) { itemChanged(); - KviConfigurationFile cfg(szName,KviConfigurationFile::Read); + KviConfigurationFile cfg(szName, KviConfigurationFile::Read); cfg.setGroup("Messages"); @@ -644,34 +657,34 @@ void OptionsWidget_messageColors::load() QString tmp; int count = m_pListView->count(); - for(int i=0; iitem(i); + MessageListWidgetItem * it = (MessageListWidgetItem *)m_pListView->item(i); - tmp.sprintf("Fore%d",it->optionId()); - int fore = cfg.readIntEntry(tmp,it->msgType()->fore()); + tmp.sprintf("Fore%d", it->optionId()); + int fore = cfg.readIntEntry(tmp, it->msgType()->fore()); if(fore < 0 || fore > 15) fore = 0; it->msgType()->setFore(fore); - tmp.sprintf("Back%d",it->optionId()); - int back = cfg.readIntEntry(tmp,it->msgType()->back()); + tmp.sprintf("Back%d", it->optionId()); + int back = cfg.readIntEntry(tmp, it->msgType()->back()); if(back < 0 || back > 15) back = KviControlCodes::Transparent; it->msgType()->setBack(back); - tmp.sprintf("Icon%d",it->optionId()); - int ico = cfg.readIntEntry(tmp,it->msgType()->pixId()); + tmp.sprintf("Icon%d", it->optionId()); + int ico = cfg.readIntEntry(tmp, it->msgType()->pixId()); if(ico < 0 || ico >= KviIconManager::IconCount) ico = 0; it->msgType()->setPixId(ico); - tmp.sprintf("Log%d",it->optionId()); - bool bLog = cfg.readBoolEntry(tmp,it->msgType()->logEnabled()); + tmp.sprintf("Log%d", it->optionId()); + bool bLog = cfg.readBoolEntry(tmp, it->msgType()->logEnabled()); it->msgType()->enableLogging(bLog); - tmp.sprintf("Level%d",it->optionId()); - int iLevel = cfg.readIntEntry(tmp,it->msgType()->level()); + tmp.sprintf("Level%d", it->optionId()); + int iLevel = cfg.readIntEntry(tmp, it->msgType()->level()); it->msgType()->setLevel(iLevel); m_pListView->repaint(m_pListView->visualItemRect(it)); diff --git a/src/modules/options/OptionsWidget_message.h b/src/modules/options/OptionsWidget_message.h index d2385c8c1..dbd02a42d 100644 --- a/src/modules/options/OptionsWidget_message.h +++ b/src/modules/options/OptionsWidget_message.h @@ -49,7 +49,6 @@ public: ~OptionsWidget_message(); }; - #define KVI_OPTIONS_WIDGET_ICON_OptionsWidget_privmsg KviIconManager::Raw #define KVI_OPTIONS_WIDGET_NAME_OptionsWidget_privmsg __tr2qs_no_lookup("Message Style") #define KVI_OPTIONS_WIDGET_PARENT_OptionsWidget_privmsg OptionsWidget_message @@ -63,6 +62,7 @@ class OptionsWidget_privmsg : public KviOptionsWidget public: OptionsWidget_privmsg(QWidget * parent); ~OptionsWidget_privmsg(); + public: KviBoolSelector * m_pUseSmartColorSelector; KviBoolSelector * m_pSpecialSmartColorSelector; @@ -84,6 +84,7 @@ class OptionsWidget_timestamp : public KviOptionsWidget public: OptionsWidget_timestamp(QWidget * parent); ~OptionsWidget_timestamp(); + public: KviBoolSelector * m_pUseTimestampSelector; KviBoolSelector * m_pSpecialTimestampColorSelector; @@ -103,16 +104,16 @@ class MessageListWidget : public KviTalListWidget { Q_OBJECT public: - MessageListWidget(QWidget * par): KviTalListWidget(par) {}; - ~MessageListWidget() {}; + MessageListWidget(QWidget * par) : KviTalListWidget(par){}; + ~MessageListWidget(){}; }; -class MessageListWidgetItemDelegate : public QItemDelegate +class MessageListWidgetItemDelegate : public QItemDelegate { Q_OBJECT public: - MessageListWidgetItemDelegate(QAbstractItemView * pWidget=0) - : QItemDelegate(pWidget) {}; + MessageListWidgetItemDelegate(QAbstractItemView * pWidget = 0) + : QItemDelegate(pWidget){}; ~MessageListWidgetItemDelegate(){}; void paint(QPainter * p, const QStyleOptionViewItem & opt, const QModelIndex & index) const; }; @@ -120,34 +121,37 @@ public: class MessageListWidgetItem : public KviTalListWidgetItem { public: - MessageListWidgetItem(MessageListWidget* l,int optId); + MessageListWidgetItem(MessageListWidget * l, int optId); ~MessageListWidgetItem(); + private: - int m_iOptId; + int m_iOptId; KviMessageTypeSettings * m_pMsgType; + public: - inline int optionId(){ return m_iOptId; }; - inline KviMessageTypeSettings * msgType(){ return m_pMsgType; }; + inline int optionId() { return m_iOptId; }; + inline KviMessageTypeSettings * msgType() { return m_pMsgType; }; }; - class MessageColorListWidgetItem : public KviTalListWidgetText { public: MessageColorListWidgetItem(KviTalListWidget * b, int idx); ~MessageColorListWidgetItem(); + public: int m_iClrIdx; + public: inline int clrIdx() { return m_iClrIdx; }; }; -class MessageColorListWidgetItemDelegate : public QItemDelegate +class MessageColorListWidgetItemDelegate : public QItemDelegate { Q_OBJECT public: - MessageColorListWidgetItemDelegate(QAbstractItemView * pWidget=0) - : QItemDelegate(pWidget) {}; + MessageColorListWidgetItemDelegate(QAbstractItemView * pWidget = 0) + : QItemDelegate(pWidget){}; ~MessageColorListWidgetItemDelegate(){}; void paint(QPainter * p, const QStyleOptionViewItem & opt, const QModelIndex & index) const; }; @@ -156,23 +160,26 @@ class OptionsWidget_messageColors : public KviOptionsWidget { Q_OBJECT friend class KviTalListWidget; + public: OptionsWidget_messageColors(QWidget * parent); ~OptionsWidget_messageColors(); + public: - MessageListWidget * m_pListView; + MessageListWidget * m_pListView; MessageListWidgetItemDelegate * m_pListViewItemDelegate; - KviTalListWidget * m_pForeListWidget; + KviTalListWidget * m_pForeListWidget; MessageColorListWidgetItemDelegate * m_pForeListWidgetDelegate; - KviTalListWidget * m_pBackListWidget; + KviTalListWidget * m_pBackListWidget; MessageColorListWidgetItemDelegate * m_pBackListWidgetDelegate; - KviTalListWidget * m_pLevelListWidget; + KviTalListWidget * m_pLevelListWidget; MessageColorListWidgetItem * m_pForeItems[16]; MessageColorListWidgetItem * m_pBackItems[17]; - MessageListWidgetItem * m_pLastItem; - QCheckBox * m_pEnableLogging; - QToolButton * m_pIconButton; - QMenu * m_pIconPopup; + MessageListWidgetItem * m_pLastItem; + QCheckBox * m_pEnableLogging; + QToolButton * m_pIconButton; + QMenu * m_pIconPopup; + public: void saveLastItem(); protected slots: @@ -198,11 +205,11 @@ class OptionsWidget_standardColors : public KviOptionsWidget public: OptionsWidget_standardColors(QWidget * par); ~OptionsWidget_standardColors(); + private: KviColorSelector * m_pColorSelector[16]; private slots: void resetToDefaults(); }; - #endif //!_OPTW_MESSAGES_H_ diff --git a/src/modules/options/OptionsWidget_nickserv.cpp b/src/modules/options/OptionsWidget_nickserv.cpp index dc30fb823..ebffe0fc5 100644 --- a/src/modules/options/OptionsWidget_nickserv.cpp +++ b/src/modules/options/OptionsWidget_nickserv.cpp @@ -37,104 +37,107 @@ #include #include - // KviApplication.cpp extern KVIRC_API KviNickServRuleSet * g_pNickServRuleSet; - -NickServRuleEditor::NickServRuleEditor(QWidget * par,bool bUseServerMaskField) -: QDialog(par) +NickServRuleEditor::NickServRuleEditor(QWidget * par, bool bUseServerMaskField) + : QDialog(par) { - setWindowTitle(__tr2qs_ctx("NickServ Authentication Rule - KVIrc","options")); + setWindowTitle(__tr2qs_ctx("NickServ Authentication Rule - KVIrc", "options")); - QGridLayout * gl = new QGridLayout(this);//,bUseServerMaskField ? 7 : 6,4,10,5); + QGridLayout * gl = new QGridLayout(this); //,bUseServerMaskField ? 7 : 6,4,10,5); - QLabel * l = new QLabel(__tr2qs_ctx("Registered nickname:","options"),this); - gl->addWidget(l,0,0); + QLabel * l = new QLabel(__tr2qs_ctx("Registered nickname:", "options"), this); + gl->addWidget(l, 0, 0); m_pRegisteredNickEdit = new QLineEdit(this); - KviTalToolTip::add(m_pRegisteredNickEdit, __tr2qs_ctx("Put here the nickname that you have registered with NickServ","options")); - gl->addWidget(m_pRegisteredNickEdit,0,1,1,3); -// gl->addMultiCellWidget(m_pRegisteredNickEdit,0,0,1,3); + KviTalToolTip::add(m_pRegisteredNickEdit, __tr2qs_ctx("Put here the nickname that you have registered with NickServ", "options")); + gl->addWidget(m_pRegisteredNickEdit, 0, 1, 1, 3); + // gl->addMultiCellWidget(m_pRegisteredNickEdit,0,0,1,3); - l = new QLabel(__tr2qs_ctx("NickServ mask:","options"),this); - gl->addWidget(l,1,0); + l = new QLabel(__tr2qs_ctx("NickServ mask:", "options"), this); + gl->addWidget(l, 1, 0); m_pNickServMaskEdit = new QLineEdit(this); KviTalToolTip::add(m_pNickServMaskEdit, - __tr2qs_ctx("This is the mask that NickServ must match to be correctly identified as the NickServ service. " \ - "This usually will be something like NickServ!service@services.dalnet.
" \ - "You can use wildcards for this field, but generally it is a security flaw. " \ - "If you're 100%% sure that NO user on the network can use the nickname \"NickServ\", " \ - "the mask NickServ!*@* may be safe to use in this field.","options")); - gl->addWidget(m_pNickServMaskEdit,1,1,1,3); -// gl->addMultiCellWidget(m_pNickServMaskEdit,1,1,1,3); - - l = new QLabel(__tr2qs_ctx("Message regexp:","options"),this); - gl->addWidget(l,2,0); + __tr2qs_ctx("This is the mask that NickServ must match to be correctly identified as the NickServ service. " + "This usually will be something like NickServ!service@services.dalnet.
" + "You can use wildcards for this field, but generally it is a security flaw. " + "If you're 100%% sure that NO user on the network can use the nickname \"NickServ\", " + "the mask NickServ!*@* may be safe to use in this field.", + "options")); + gl->addWidget(m_pNickServMaskEdit, 1, 1, 1, 3); + // gl->addMultiCellWidget(m_pNickServMaskEdit,1,1,1,3); + + l = new QLabel(__tr2qs_ctx("Message regexp:", "options"), this); + gl->addWidget(l, 2, 0); m_pMessageRegexpEdit = new QLineEdit(this); - gl->addWidget(m_pMessageRegexpEdit,2,1,1,3); -// gl->addMultiCellWidget(m_pMessageRegexpEdit,2,2,1,3); + gl->addWidget(m_pMessageRegexpEdit, 2, 1, 1, 3); + // gl->addMultiCellWidget(m_pMessageRegexpEdit,2,2,1,3); KviTalToolTip::add(m_pMessageRegexpEdit, - __tr2qs_ctx("This is the simple regular expression that the identification request message " \ - "from NickServ must match in order to be correctly recognized.
" \ - "The message is usually something like \"To identify yourself please use /ns IDENTIFY password\" " \ - "and it is sent when the NickServ wants you to authenticate yourself. " \ - "You can use the * and ? wildcards.","options")); - l = new QLabel(__tr2qs_ctx("Identify command:","options"),this); - gl->addWidget(l,3,0); + __tr2qs_ctx("This is the simple regular expression that the identification request message " + "from NickServ must match in order to be correctly recognized.
" + "The message is usually something like \"To identify yourself please use /ns IDENTIFY password\" " + "and it is sent when the NickServ wants you to authenticate yourself. " + "You can use the * and ? wildcards.", + "options")); + l = new QLabel(__tr2qs_ctx("Identify command:", "options"), this); + gl->addWidget(l, 3, 0); m_pIdentifyCommandEdit = new QLineEdit(this); KviTalToolTip::add(m_pIdentifyCommandEdit, - __tr2qs_ctx("This is the command that will be executed when NickServ requests authentication " \ - "for the nickname described in this rule (if the both server and NickServ mask are matched). " \ - "This usually will be something like msg NickServ identify <yourpassword>.
" \ - "You can use msg -q if you don't want the password echoed on the screen. " \ - "Please note that there is no leading slash in this command.","options")); - gl->addWidget(m_pIdentifyCommandEdit,3,1,1,3); -// gl->addMultiCellWidget(m_pIdentifyCommandEdit,3,3,1,3); + __tr2qs_ctx("This is the command that will be executed when NickServ requests authentication " + "for the nickname described in this rule (if the both server and NickServ mask are matched). " + "This usually will be something like msg NickServ identify <yourpassword>.
" + "You can use msg -q if you don't want the password echoed on the screen. " + "Please note that there is no leading slash in this command.", + "options")); + gl->addWidget(m_pIdentifyCommandEdit, 3, 1, 1, 3); + // gl->addMultiCellWidget(m_pIdentifyCommandEdit,3,3,1,3); int iNextLine = 4; if(bUseServerMaskField) { - l = new QLabel(__tr2qs_ctx("Server mask:","options"),this); - gl->addWidget(l,4,0); + l = new QLabel(__tr2qs_ctx("Server mask:", "options"), this); + gl->addWidget(l, 4, 0); m_pServerMaskEdit = new QLineEdit(this); KviTalToolTip::add(m_pServerMaskEdit, - __tr2qs_ctx("This is the mask that the current server must match in order " \ - "for this rule to apply. It can contain * and ? wildcards.
Do NOT use simply \"*\" here...","options")); - gl->addWidget(m_pServerMaskEdit,4,1,1,3); -// gl->addMultiCellWidget(m_pServerMaskEdit,4,4,1,3); + __tr2qs_ctx("This is the mask that the current server must match in order " + "for this rule to apply. It can contain * and ? wildcards.
Do NOT use simply \"*\" here...", + "options")); + gl->addWidget(m_pServerMaskEdit, 4, 1, 1, 3); + // gl->addMultiCellWidget(m_pServerMaskEdit,4,4,1,3); iNextLine++; - } else { + } + else + { m_pServerMaskEdit = 0; } - - l = new QLabel(__tr2qs_ctx("Hint: Move the mouse cursor over the fields to get help","options"),this); + l = new QLabel(__tr2qs_ctx("Hint: Move the mouse cursor over the fields to get help", "options"), this); l->setMargin(10); - gl->addWidget(l,iNextLine,0,1,4); -// gl->addMultiCellWidget(l,iNextLine,iNextLine,0,3); + gl->addWidget(l, iNextLine, 0, 1, 4); + // gl->addMultiCellWidget(l,iNextLine,iNextLine,0,3); iNextLine++; - QPushButton * p = new QPushButton(__tr2qs_ctx("Cancel","options"),this); + QPushButton * p = new QPushButton(__tr2qs_ctx("Cancel", "options"), this); p->setMinimumWidth(100); - connect(p,SIGNAL(clicked()),this,SLOT(reject())); - gl->addWidget(p,iNextLine,2); + connect(p, SIGNAL(clicked()), this, SLOT(reject())); + gl->addWidget(p, iNextLine, 2); - m_pOkButton = new QPushButton(__tr2qs_ctx("OK","options"),this); + m_pOkButton = new QPushButton(__tr2qs_ctx("OK", "options"), this); m_pOkButton->setMinimumWidth(100); m_pOkButton->setDefault(true); - connect(m_pOkButton,SIGNAL(clicked()),this,SLOT(okPressed())); - gl->addWidget(m_pOkButton,iNextLine,3); + connect(m_pOkButton, SIGNAL(clicked()), this, SLOT(okPressed())); + gl->addWidget(m_pOkButton, iNextLine, 3); - gl->setColumnStretch(1,1); - gl->setRowStretch(bUseServerMaskField ? 5 : 4,1); + gl->setColumnStretch(1, 1); + gl->setRowStretch(bUseServerMaskField ? 5 : 4, 1); setMinimumWidth(250); } @@ -147,18 +150,18 @@ bool NickServRuleEditor::validate() { QString s = m_pRegisteredNickEdit->text(); - QString m = __tr2qs_ctx("Invalid NickServ Rule - KVIrc","options"); - QString o = __tr2qs_ctx("OK","options"); + QString m = __tr2qs_ctx("Invalid NickServ Rule - KVIrc", "options"); + QString o = __tr2qs_ctx("OK", "options"); if(s.isEmpty()) { - QMessageBox::warning(this,m,__tr2qs_ctx("The nickname field can't be empty!","options"),o); + QMessageBox::warning(this, m, __tr2qs_ctx("The nickname field can't be empty!", "options"), o); return false; } if(s.indexOf(QChar(' ')) != -1) { - QMessageBox::warning(this,m,__tr2qs_ctx("The nickname field can't contain spaces!","options"),o); + QMessageBox::warning(this, m, __tr2qs_ctx("The nickname field can't contain spaces!", "options"), o); return false; } @@ -166,7 +169,7 @@ bool NickServRuleEditor::validate() if(s.isEmpty()) { - QMessageBox::warning(this,m,__tr2qs_ctx("The NickServ mask can't be empty!
You must put at least * there.","options"),o); + QMessageBox::warning(this, m, __tr2qs_ctx("The NickServ mask can't be empty!
You must put at least * there.", "options"), o); return false; } @@ -174,7 +177,7 @@ bool NickServRuleEditor::validate() if(s.isEmpty()) { - QMessageBox::warning(this,m,__tr2qs_ctx("The message regexp can't be empty!
You must put at least * there.","options"),o); + QMessageBox::warning(this, m, __tr2qs_ctx("The message regexp can't be empty!
You must put at least * there.", "options"), o); return false; } @@ -182,7 +185,7 @@ bool NickServRuleEditor::validate() if(s.isEmpty()) { - QMessageBox::warning(this,m,__tr2qs_ctx("The IDENTIFY command can't be empty!","options"),o); + QMessageBox::warning(this, m, __tr2qs_ctx("The IDENTIFY command can't be empty!", "options"), o); return false; } @@ -191,7 +194,8 @@ bool NickServRuleEditor::validate() void NickServRuleEditor::okPressed() { - if(!validate())return; + if(!validate()) + return; accept(); } @@ -204,7 +208,8 @@ bool NickServRuleEditor::editRule(KviNickServRule * r) if(m_pServerMaskEdit) m_pServerMaskEdit->setText(r->serverMask().isEmpty() ? QString("irc.yourserver.org") : r->serverMask()); m_pRegisteredNickEdit->selectAll(); - if(exec() != QDialog::Accepted)return false; + if(exec() != QDialog::Accepted) + return false; r->setRegisteredNick(m_pRegisteredNickEdit->text()); r->setNickServMask(m_pNickServMaskEdit->text()); r->setMessageRegexp(m_pMessageRegexpEdit->text()); @@ -214,9 +219,8 @@ bool NickServRuleEditor::editRule(KviNickServRule * r) return true; } - OptionsWidget_nickServ::OptionsWidget_nickServ(QWidget * parent) -: KviOptionsWidget(parent) + : KviOptionsWidget(parent) { createLayout(); setObjectName("nickserv_options_widget"); @@ -226,10 +230,10 @@ OptionsWidget_nickServ::OptionsWidget_nickServ(QWidget * parent) KviNickServRuleSet * rs = g_pNickServRuleSet; bool bNickServEnabled = rs ? (rs->isEnabled() && !rs->isEmpty()) : false; - m_pNickServCheck = new QCheckBox(__tr2qs_ctx("Enable NickServ identification","options"),this); - gl->addWidget(m_pNickServCheck,0,0,1,3); -// gl->addMultiCellWidget(m_pNickServCheck,0,0,0,2); - KviTalToolTip::add(m_pNickServCheck,__tr2qs_ctx("This check enables the automatic identification with NickServ","options")); + m_pNickServCheck = new QCheckBox(__tr2qs_ctx("Enable NickServ identification", "options"), this); + gl->addWidget(m_pNickServCheck, 0, 0, 1, 3); + // gl->addMultiCellWidget(m_pNickServCheck,0,0,0,2); + KviTalToolTip::add(m_pNickServCheck, __tr2qs_ctx("This check enables the automatic identification with NickServ", "options")); m_pNickServCheck->setChecked(bNickServEnabled); m_pNickServTreeWidget = new QTreeWidget(this); @@ -237,59 +241,60 @@ OptionsWidget_nickServ::OptionsWidget_nickServ(QWidget * parent) m_pNickServTreeWidget->setAllColumnsShowFocus(true); QStringList columnLabels; - columnLabels.append(__tr2qs_ctx("Nickname","options")); - columnLabels.append(__tr2qs_ctx("Server Mask","options")); - columnLabels.append(__tr2qs_ctx("NickServ Mask","options")); - columnLabels.append(__tr2qs_ctx("NickServ Request Mask","options")); - columnLabels.append(__tr2qs_ctx("Identify Command","options")); + columnLabels.append(__tr2qs_ctx("Nickname", "options")); + columnLabels.append(__tr2qs_ctx("Server Mask", "options")); + columnLabels.append(__tr2qs_ctx("NickServ Mask", "options")); + columnLabels.append(__tr2qs_ctx("NickServ Request Mask", "options")); + columnLabels.append(__tr2qs_ctx("Identify Command", "options")); m_pNickServTreeWidget->setHeaderLabels(columnLabels); - connect(m_pNickServTreeWidget,SIGNAL(itemSelectionChanged()),this,SLOT(enableDisableNickServControls())); - - gl->addWidget(m_pNickServTreeWidget,1,0,1,3); -// gl->addMultiCellWidget(m_pNickServTreeWidget,1,1,0,2); - KviTalToolTip::add(m_pNickServTreeWidget,\ - __tr2qs_ctx("This is a list of NickServ identification rules. " \ - "KVIrc will use them to model its automatic interaction with NickServ on all the networks.
" \ - "Please be aware that this feature can cause your NickServ passwords to be stolen " \ - "if used improperly. Make sure that you fully understand the NickServ authentication protocol.
" \ - "In other words, be sure to know what you're doing.
" \ - "Also note that the password that you provide is stored as PLAIN TEXT.
" \ - "KVIrc supports also per-network NickServ authentication rules that can be " \ - "created in the \"Advanced...\" network options (accessible from the servers dialog)." - "","options")); - - m_pAddRuleButton = new QPushButton(__tr2qs_ctx("Add Rule","options"),this); - connect(m_pAddRuleButton,SIGNAL(clicked()),this,SLOT(addNickServRule())); - gl->addWidget(m_pAddRuleButton,2,0); - - m_pEditRuleButton = new QPushButton(__tr2qs_ctx("Edit Rule","options"),this); - connect(m_pEditRuleButton,SIGNAL(clicked()),this,SLOT(editNickServRule())); - gl->addWidget(m_pEditRuleButton,2,1); - - m_pDelRuleButton = new QPushButton(__tr2qs_ctx("Delete Rule","options"),this); - connect(m_pDelRuleButton,SIGNAL(clicked()),this,SLOT(delNickServRule())); - gl->addWidget(m_pDelRuleButton,2,2); - - connect(m_pNickServCheck,SIGNAL(toggled(bool)),this,SLOT(enableDisableNickServControls())); + connect(m_pNickServTreeWidget, SIGNAL(itemSelectionChanged()), this, SLOT(enableDisableNickServControls())); + + gl->addWidget(m_pNickServTreeWidget, 1, 0, 1, 3); + // gl->addMultiCellWidget(m_pNickServTreeWidget,1,1,0,2); + KviTalToolTip::add(m_pNickServTreeWidget, + __tr2qs_ctx("This is a list of NickServ identification rules. " + "KVIrc will use them to model its automatic interaction with NickServ on all the networks.
" + "Please be aware that this feature can cause your NickServ passwords to be stolen " + "if used improperly. Make sure that you fully understand the NickServ authentication protocol.
" + "In other words, be sure to know what you're doing.
" + "Also note that the password that you provide is stored as PLAIN TEXT.
" + "KVIrc supports also per-network NickServ authentication rules that can be " + "created in the \"Advanced...\" network options (accessible from the servers dialog)." + "", + "options")); + + m_pAddRuleButton = new QPushButton(__tr2qs_ctx("Add Rule", "options"), this); + connect(m_pAddRuleButton, SIGNAL(clicked()), this, SLOT(addNickServRule())); + gl->addWidget(m_pAddRuleButton, 2, 0); + + m_pEditRuleButton = new QPushButton(__tr2qs_ctx("Edit Rule", "options"), this); + connect(m_pEditRuleButton, SIGNAL(clicked()), this, SLOT(editNickServRule())); + gl->addWidget(m_pEditRuleButton, 2, 1); + + m_pDelRuleButton = new QPushButton(__tr2qs_ctx("Delete Rule", "options"), this); + connect(m_pDelRuleButton, SIGNAL(clicked()), this, SLOT(delNickServRule())); + gl->addWidget(m_pDelRuleButton, 2, 2); + + connect(m_pNickServCheck, SIGNAL(toggled(bool)), this, SLOT(enableDisableNickServControls())); if(rs && rs->rules()) { - QTreeWidgetItem *it; + QTreeWidgetItem * it; KviPointerList * ll = rs->rules(); - for(KviNickServRule * rule = ll->first();rule;rule = ll->next()) + for(KviNickServRule * rule = ll->first(); rule; rule = ll->next()) { it = new QTreeWidgetItem(m_pNickServTreeWidget); - it->setText(0,rule->registeredNick()); - it->setText(1,rule->serverMask()); - it->setText(2,rule->nickServMask()); - it->setText(3,rule->messageRegexp()); - it->setText(4,rule->identifyCommand()); + it->setText(0, rule->registeredNick()); + it->setText(1, rule->serverMask()); + it->setText(2, rule->nickServMask()); + it->setText(3, rule->messageRegexp()); + it->setText(4, rule->identifyCommand()); } } enableDisableNickServControls(); - gl->setRowStretch(1,1); + gl->setRowStretch(1, 1); } OptionsWidget_nickServ::~OptionsWidget_nickServ() @@ -299,38 +304,40 @@ OptionsWidget_nickServ::~OptionsWidget_nickServ() void OptionsWidget_nickServ::editNickServRule() { QTreeWidgetItem * it = (QTreeWidgetItem *)m_pNickServTreeWidget->currentItem(); - if(!it)return; - KviNickServRule r(it->text(0),it->text(2),it->text(3),it->text(4),it->text(1)); - NickServRuleEditor ed(this,true); + if(!it) + return; + KviNickServRule r(it->text(0), it->text(2), it->text(3), it->text(4), it->text(1)); + NickServRuleEditor ed(this, true); if(ed.editRule(&r)) { - it->setText(0,r.registeredNick()); - it->setText(1,r.serverMask()); - it->setText(2,r.nickServMask()); - it->setText(3,r.messageRegexp()); - it->setText(4,r.identifyCommand()); + it->setText(0, r.registeredNick()); + it->setText(1, r.serverMask()); + it->setText(2, r.nickServMask()); + it->setText(3, r.messageRegexp()); + it->setText(4, r.identifyCommand()); } } void OptionsWidget_nickServ::addNickServRule() { KviNickServRule r; - NickServRuleEditor ed(this,true); + NickServRuleEditor ed(this, true); if(ed.editRule(&r)) { - QTreeWidgetItem* it = new QTreeWidgetItem(m_pNickServTreeWidget); - it->setText(0,r.registeredNick()); - it->setText(1,r.serverMask()); - it->setText(2,r.nickServMask()); - it->setText(3,r.messageRegexp()); - it->setText(4,r.identifyCommand()); + QTreeWidgetItem * it = new QTreeWidgetItem(m_pNickServTreeWidget); + it->setText(0, r.registeredNick()); + it->setText(1, r.serverMask()); + it->setText(2, r.nickServMask()); + it->setText(3, r.messageRegexp()); + it->setText(4, r.identifyCommand()); } } void OptionsWidget_nickServ::delNickServRule() { QTreeWidgetItem * it = (QTreeWidgetItem *)m_pNickServTreeWidget->currentItem(); - if(!it)return; + if(!it) + return; delete it; enableDisableNickServControls(); } @@ -351,12 +358,12 @@ void OptionsWidget_nickServ::commit() if(m_pNickServTreeWidget->topLevelItemCount()) { g_pNickServRuleSet->setEnabled(m_pNickServCheck->isChecked()); - QTreeWidgetItem * it;// = m_pNickServTreeWidget->firstChild(); - for (int i=0;itopLevelItemCount();i++) -// while(it) + QTreeWidgetItem * it; // = m_pNickServTreeWidget->firstChild(); + for(int i = 0; i < m_pNickServTreeWidget->topLevelItemCount(); i++) + // while(it) { - it=(QTreeWidgetItem *)m_pNickServTreeWidget->topLevelItem(i); - g_pNickServRuleSet->addRule(KviNickServRule::createInstance(it->text(0),it->text(2),it->text(3),it->text(4),it->text(1))); + it = (QTreeWidgetItem *)m_pNickServTreeWidget->topLevelItem(i); + g_pNickServRuleSet->addRule(KviNickServRule::createInstance(it->text(0), it->text(2), it->text(3), it->text(4), it->text(1))); //it = it->nextSibling(); } } diff --git a/src/modules/options/OptionsWidget_nickserv.h b/src/modules/options/OptionsWidget_nickserv.h index fc0658cdd..d1b82cfa6 100644 --- a/src/modules/options/OptionsWidget_nickserv.h +++ b/src/modules/options/OptionsWidget_nickserv.h @@ -25,7 +25,6 @@ // //============================================================================= - #include "kvi_settings.h" #include "KviOptionsWidget.h" @@ -48,17 +47,20 @@ class NickServRuleEditor : public QDialog { Q_OBJECT public: - NickServRuleEditor(QWidget * par,bool bUseServerMaskField = false); + NickServRuleEditor(QWidget * par, bool bUseServerMaskField = false); ~NickServRuleEditor(); + protected: - QLineEdit * m_pRegisteredNickEdit; - QLineEdit * m_pNickServMaskEdit; - QLineEdit * m_pMessageRegexpEdit; - QLineEdit * m_pIdentifyCommandEdit; - QLineEdit * m_pServerMaskEdit; + QLineEdit * m_pRegisteredNickEdit; + QLineEdit * m_pNickServMaskEdit; + QLineEdit * m_pMessageRegexpEdit; + QLineEdit * m_pIdentifyCommandEdit; + QLineEdit * m_pServerMaskEdit; QPushButton * m_pOkButton; + public: bool editRule(KviNickServRule * r); + protected: bool validate(); protected slots: @@ -71,17 +73,19 @@ class OptionsWidget_nickServ : public KviOptionsWidget public: OptionsWidget_nickServ(QWidget * parent); ~OptionsWidget_nickServ(); + protected: QTreeWidget * m_pNickServTreeWidget; - QCheckBox * m_pNickServCheck; - QPushButton * m_pAddRuleButton; - QPushButton * m_pDelRuleButton; - QPushButton * m_pEditRuleButton; + QCheckBox * m_pNickServCheck; + QPushButton * m_pAddRuleButton; + QPushButton * m_pDelRuleButton; + QPushButton * m_pEditRuleButton; protected slots: void enableDisableNickServControls(); void addNickServRule(); void delNickServRule(); void editNickServRule(); + public: virtual void commit(); }; diff --git a/src/modules/options/OptionsWidget_notifier.cpp b/src/modules/options/OptionsWidget_notifier.cpp index dd0d67e6d..70caf034f 100644 --- a/src/modules/options/OptionsWidget_notifier.cpp +++ b/src/modules/options/OptionsWidget_notifier.cpp @@ -30,38 +30,38 @@ #include OptionsWidget_notifierLook::OptionsWidget_notifierLook(QWidget * parent) -: KviOptionsWidget(parent) + : KviOptionsWidget(parent) { setObjectName("notifierlook_options_widget"); createLayout(); - addFontSelector(0,0,1,0,__tr2qs_ctx("Font:","options"),KviOption_fontNotifier); - addColorSelector(0,1,1,1,__tr2qs_ctx("Background color:","options"),KviOption_colorNotifierBackground); - addColorSelector(0,2,1,2,__tr2qs_ctx("Foreground color:","options"),KviOption_colorNotifierForeground); - addFontSelector(0,3,1,3,__tr2qs_ctx("Title font:","options"),KviOption_fontNotifierTitle); - addColorSelector(0,4,1,4,__tr2qs_ctx("Title foreground color:","options"),KviOption_colorNotifierTitleForeground); + addFontSelector(0, 0, 1, 0, __tr2qs_ctx("Font:", "options"), KviOption_fontNotifier); + addColorSelector(0, 1, 1, 1, __tr2qs_ctx("Background color:", "options"), KviOption_colorNotifierBackground); + addColorSelector(0, 2, 1, 2, __tr2qs_ctx("Foreground color:", "options"), KviOption_colorNotifierForeground); + addFontSelector(0, 3, 1, 3, __tr2qs_ctx("Title font:", "options"), KviOption_fontNotifierTitle); + addColorSelector(0, 4, 1, 4, __tr2qs_ctx("Title foreground color:", "options"), KviOption_colorNotifierTitleForeground); - addPixmapSelector(0,5,1,5,__tr2qs_ctx("Background image:","options"),KviOption_pixmapNotifierBackground); + addPixmapSelector(0, 5, 1, 5, __tr2qs_ctx("Background image:", "options"), KviOption_pixmapNotifierBackground); - addLabel(0,6,0,6,__tr2qs_ctx("Horizontal align:","options")); - m_pHorizontalAlign=new QComboBox(this); - addWidgetToLayout(m_pHorizontalAlign,1,6,1,6); + addLabel(0, 6, 0, 6, __tr2qs_ctx("Horizontal align:", "options")); + m_pHorizontalAlign = new QComboBox(this); + addWidgetToLayout(m_pHorizontalAlign, 1, 6, 1, 6); - addLabel(0,7,0,7,__tr2qs_ctx("Vertical align:","options")); - m_pVerticalAlign=new QComboBox(this); - addWidgetToLayout(m_pVerticalAlign,1,7,1,7); + addLabel(0, 7, 0, 7, __tr2qs_ctx("Vertical align:", "options")); + m_pVerticalAlign = new QComboBox(this); + addWidgetToLayout(m_pVerticalAlign, 1, 7, 1, 7); - m_pHorizontalAlign->addItem(__tr2qs_ctx("Tile","options")); - m_pHorizontalAlign->addItem(__tr2qs_ctx("Left","options")); - m_pHorizontalAlign->addItem(__tr2qs_ctx("Right","options")); - m_pHorizontalAlign->addItem(__tr2qs_ctx("Center","options")); + m_pHorizontalAlign->addItem(__tr2qs_ctx("Tile", "options")); + m_pHorizontalAlign->addItem(__tr2qs_ctx("Left", "options")); + m_pHorizontalAlign->addItem(__tr2qs_ctx("Right", "options")); + m_pHorizontalAlign->addItem(__tr2qs_ctx("Center", "options")); - m_pVerticalAlign->addItem(__tr2qs_ctx("Tile","options")); - m_pVerticalAlign->addItem(__tr2qs_ctx("Top","options")); - m_pVerticalAlign->addItem(__tr2qs_ctx("Bottom","options")); - m_pVerticalAlign->addItem(__tr2qs_ctx("Center","options")); + m_pVerticalAlign->addItem(__tr2qs_ctx("Tile", "options")); + m_pVerticalAlign->addItem(__tr2qs_ctx("Top", "options")); + m_pVerticalAlign->addItem(__tr2qs_ctx("Bottom", "options")); + m_pVerticalAlign->addItem(__tr2qs_ctx("Center", "options")); - switch( KVI_OPTION_UINT(KviOption_uintNotifierPixmapAlign) & Qt::AlignHorizontal_Mask) + switch(KVI_OPTION_UINT(KviOption_uintNotifierPixmapAlign) & Qt::AlignHorizontal_Mask) { case Qt::AlignLeft: m_pHorizontalAlign->setCurrentIndex(1); @@ -76,7 +76,7 @@ OptionsWidget_notifierLook::OptionsWidget_notifierLook(QWidget * parent) m_pHorizontalAlign->setCurrentIndex(0); } - switch( KVI_OPTION_UINT(KviOption_uintNotifierPixmapAlign) & Qt::AlignVertical_Mask) + switch(KVI_OPTION_UINT(KviOption_uintNotifierPixmapAlign) & Qt::AlignVertical_Mask) { case Qt::AlignTop: m_pVerticalAlign->setCurrentIndex(1); @@ -91,7 +91,7 @@ OptionsWidget_notifierLook::OptionsWidget_notifierLook(QWidget * parent) m_pVerticalAlign->setCurrentIndex(0); } - layout()->setRowStretch(5,1); + layout()->setRowStretch(5, 1); } OptionsWidget_notifierLook::~OptionsWidget_notifierLook() @@ -100,40 +100,38 @@ OptionsWidget_notifierLook::~OptionsWidget_notifierLook() void OptionsWidget_notifierLook::commit() { - int iFlags=0; + int iFlags = 0; switch(m_pHorizontalAlign->currentIndex()) { case 1: - iFlags|=Qt::AlignLeft; + iFlags |= Qt::AlignLeft; break; case 2: - iFlags|=Qt::AlignRight; + iFlags |= Qt::AlignRight; break; case 3: - iFlags|=Qt::AlignHCenter; + iFlags |= Qt::AlignHCenter; break; } switch(m_pVerticalAlign->currentIndex()) { case 1: - iFlags|=Qt::AlignTop; + iFlags |= Qt::AlignTop; break; case 2: - iFlags|=Qt::AlignBottom; + iFlags |= Qt::AlignBottom; break; case 3: - iFlags|=Qt::AlignVCenter; + iFlags |= Qt::AlignVCenter; break; } - KVI_OPTION_UINT(KviOption_uintNotifierPixmapAlign)=iFlags; + KVI_OPTION_UINT(KviOption_uintNotifierPixmapAlign) = iFlags; KviOptionsWidget::commit(); } - - OptionsWidget_notifier::OptionsWidget_notifier(QWidget * parent) -: KviOptionsWidget(parent) + : KviOptionsWidget(parent) { setObjectName("notifier_options_widget"); @@ -141,50 +139,53 @@ OptionsWidget_notifier::OptionsWidget_notifier(QWidget * parent) int iRow = 0; - KviBoolSelector * b = addBoolSelector(0,iRow,0,iRow,__tr2qs_ctx("Enable the notifier","options"),KviOption_boolEnableNotifier); - QString szTip = __tr2qs_ctx("This is an option for the impatient: it allows one to forcibly and permanently disable " \ - "the notifier window. Please note that if this option is not activated then " \ - "the notifier will NOT popup even if all the other options around specify " \ - "to use it in response to particular events. Also note that this option " \ - "will make all the /notifier.* commands fail silently.","options"); - mergeTip(b,szTip); + KviBoolSelector * b = addBoolSelector(0, iRow, 0, iRow, __tr2qs_ctx("Enable the notifier", "options"), KviOption_boolEnableNotifier); + QString szTip = __tr2qs_ctx("This is an option for the impatient: it allows one to forcibly and permanently disable " + "the notifier window. Please note that if this option is not activated then " + "the notifier will NOT popup even if all the other options around specify " + "to use it in response to particular events. Also note that this option " + "will make all the /notifier.* commands fail silently.", + "options"); + mergeTip(b, szTip); iRow++; KviBoolSelector * b2; #ifdef COMPILE_KDE_SUPPORT - m_pKdeNotifier = addBoolSelector(0,iRow,0,iRow,__tr2qs_ctx("Use the KDE notifier","options"),KviOption_boolUseKDENotifier); - szTip += __tr2qs_ctx("This option uses the KDE notification system " \ - "instead of KVIrc one.
" \ - "This is cool if you want to better integrate KVIrc inside KDE. " \ - "Note that KDE's notifier isn't flexible and \"tabbed\" like KVIrc's","options"); - mergeTip(m_pKdeNotifier,szTip); + m_pKdeNotifier = addBoolSelector(0, iRow, 0, iRow, __tr2qs_ctx("Use the KDE notifier", "options"), KviOption_boolUseKDENotifier); + szTip += __tr2qs_ctx("This option uses the KDE notification system " + "instead of KVIrc one.
" + "This is cool if you want to better integrate KVIrc inside KDE. " + "Note that KDE's notifier isn't flexible and \"tabbed\" like KVIrc's", + "options"); + mergeTip(m_pKdeNotifier, szTip); m_pKdeNotifier->setEnabled(KVI_OPTION_BOOL(KviOption_boolEnableNotifier)); - connect(b,SIGNAL(toggled(bool)),m_pKdeNotifier,SLOT(setEnabled(bool))); - connect(m_pKdeNotifier,SIGNAL(toggled(bool)),this,SLOT(toggleNotifierProtocol(bool))); + connect(b, SIGNAL(toggled(bool)), m_pKdeNotifier, SLOT(setEnabled(bool))); + connect(m_pKdeNotifier, SIGNAL(toggled(bool)), this, SLOT(toggleNotifierProtocol(bool))); iRow++; #endif // COMPILE_KDE_SUPPORT #ifdef COMPILE_DBUS_SUPPORT - m_pDBusNotifier = addBoolSelector(0,iRow,0,iRow,__tr2qs_ctx("Use the D-Bus-based notifiers","options"),KviOption_boolUseDBusNotifier); - szTip += __tr2qs_ctx("This option uses the D-Bus-based notifier instead of " \ - "KVIrc one.
" \ - "This is cool if you want to better integrate KVIrc inside your " \ - "desktop environment. " \ - "Note that this notifier isn't flexible and \"tabbed\" like KVIrc's","options"); - mergeTip(m_pDBusNotifier,szTip); + m_pDBusNotifier = addBoolSelector(0, iRow, 0, iRow, __tr2qs_ctx("Use the D-Bus-based notifiers", "options"), KviOption_boolUseDBusNotifier); + szTip += __tr2qs_ctx("This option uses the D-Bus-based notifier instead of " + "KVIrc one.
" + "This is cool if you want to better integrate KVIrc inside your " + "desktop environment. " + "Note that this notifier isn't flexible and \"tabbed\" like KVIrc's", + "options"); + mergeTip(m_pDBusNotifier, szTip); m_pDBusNotifier->setEnabled(KVI_OPTION_BOOL(KviOption_boolEnableNotifier)); #ifdef COMPILE_KDE_SUPPORT m_pDBusNotifier->setEnabled(!KVI_OPTION_BOOL(KviOption_boolUseKDENotifier)); #endif // COMPILE_KDE_SUPPORT - connect(b,SIGNAL(toggled(bool)),m_pDBusNotifier,SLOT(setEnabled(bool))); + connect(b, SIGNAL(toggled(bool)), m_pDBusNotifier, SLOT(setEnabled(bool))); #ifdef COMPILE_KDE_SUPPORT - connect(m_pDBusNotifier,SIGNAL(toggled(bool)),this,SLOT(toggleNotifierProtocol(bool))); + connect(m_pDBusNotifier, SIGNAL(toggled(bool)), this, SLOT(toggleNotifierProtocol(bool))); #endif iRow++; @@ -192,61 +193,62 @@ OptionsWidget_notifier::OptionsWidget_notifier(QWidget * parent) #if defined(COMPILE_KDE_SUPPORT) || defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW) - b2 = addBoolSelector(0,iRow,0,iRow,__tr2qs_ctx("Don't show notifier when there is an active fullscreen window","options"),KviOption_boolDontShowNotifierIfActiveWindowIsFullScreen); + b2 = addBoolSelector(0, iRow, 0, iRow, __tr2qs_ctx("Don't show notifier when there is an active fullscreen window", "options"), KviOption_boolDontShowNotifierIfActiveWindowIsFullScreen); - szTip += __tr2qs_ctx("This option stops the notifier from being displayed when there is an active fullscreen window. " \ - "This is useful for gaming sessions where you may be distracted by the notifier or it may even switch " \ - "your game from fullscreen to window mode.","options"); - mergeTip(b2,szTip); + szTip += __tr2qs_ctx("This option stops the notifier from being displayed when there is an active fullscreen window. " + "This is useful for gaming sessions where you may be distracted by the notifier or it may even switch " + "your game from fullscreen to window mode.", + "options"); + mergeTip(b2, szTip); b2->setEnabled(KVI_OPTION_BOOL(KviOption_boolEnableNotifier)); - QObject::connect(b,SIGNAL(toggled(bool)),b2,SLOT(setEnabled(bool))); + QObject::connect(b, SIGNAL(toggled(bool)), b2, SLOT(setEnabled(bool))); iRow++; #endif //COMPILE_KDE_SUPPORT || COMPILE_ON_WINDOWS || COMPILE_ON_MINGW - b2 = addBoolSelector(0,iRow,0,iRow,__tr2qs_ctx("Enable notifier window flashing","options"),KviOption_boolNotifierFlashing); + b2 = addBoolSelector(0, iRow, 0, iRow, __tr2qs_ctx("Enable notifier window flashing", "options"), KviOption_boolNotifierFlashing); b2->setEnabled(KVI_OPTION_BOOL(KviOption_boolEnableNotifier)); - QObject::connect(b,SIGNAL(toggled(bool)),b2,SLOT(setEnabled(bool))); + QObject::connect(b, SIGNAL(toggled(bool)), b2, SLOT(setEnabled(bool))); iRow++; - b2 = addBoolSelector(0,iRow,0,iRow,__tr2qs_ctx("Enable notifier window fade effect","options"),KviOption_boolNotifierFading); + b2 = addBoolSelector(0, iRow, 0, iRow, __tr2qs_ctx("Enable notifier window fade effect", "options"), KviOption_boolNotifierFading); b2->setEnabled(KVI_OPTION_BOOL(KviOption_boolEnableNotifier)); - QObject::connect(b,SIGNAL(toggled(bool)),b2,SLOT(setEnabled(bool))); + QObject::connect(b, SIGNAL(toggled(bool)), b2, SLOT(setEnabled(bool))); iRow++; - KviTalGroupBox * g = addGroupBox(0,iRow,0,iRow,Qt::Horizontal,__tr2qs_ctx("Advanced Configuration","options")); - connect(b,SIGNAL(toggled(bool)),g,SLOT(setEnabled(bool))); + KviTalGroupBox * g = addGroupBox(0, iRow, 0, iRow, Qt::Horizontal, __tr2qs_ctx("Advanced Configuration", "options")); + connect(b, SIGNAL(toggled(bool)), g, SLOT(setEnabled(bool))); connect(b, - SIGNAL(toggled(bool)), - addUIntSelector(g,__tr2qs_ctx("Default auto hiding time for messages (0 to disable):","options"), - KviOption_uintNotifierAutoHideTime, - 0,86400,30,KVI_OPTION_BOOL(KviOption_boolEnableNotifier)), - SLOT(setEnabled(bool))); + SIGNAL(toggled(bool)), + addUIntSelector(g, __tr2qs_ctx("Default auto hiding time for messages (0 to disable):", "options"), + KviOption_uintNotifierAutoHideTime, + 0, 86400, 30, KVI_OPTION_BOOL(KviOption_boolEnableNotifier)), + SLOT(setEnabled(bool))); connect(b2, - SIGNAL(toggled(bool)), - addUIntSelector(g,__tr2qs_ctx("Notifier window opacity while active (mouseover):","options"), - KviOption_uintNotifierActiveTransparency, - 0,100,90,KVI_OPTION_BOOL(KviOption_boolNotifierFading)), - SLOT(setEnabled(bool))); + SIGNAL(toggled(bool)), + addUIntSelector(g, __tr2qs_ctx("Notifier window opacity while active (mouseover):", "options"), + KviOption_uintNotifierActiveTransparency, + 0, 100, 90, KVI_OPTION_BOOL(KviOption_boolNotifierFading)), + SLOT(setEnabled(bool))); connect(b2, - SIGNAL(toggled(bool)), - addUIntSelector(g,__tr2qs_ctx("Notifier window opacity while inactive:","options"), - KviOption_uintNotifierInactiveTransparency, - 0,100,40,KVI_OPTION_BOOL(KviOption_boolNotifierFading)), - SLOT(setEnabled(bool))); + SIGNAL(toggled(bool)), + addUIntSelector(g, __tr2qs_ctx("Notifier window opacity while inactive:", "options"), + KviOption_uintNotifierInactiveTransparency, + 0, 100, 40, KVI_OPTION_BOOL(KviOption_boolNotifierFading)), + SLOT(setEnabled(bool))); iRow++; - addRowSpacer(0,iRow,0,iRow); + addRowSpacer(0, iRow, 0, iRow); } OptionsWidget_notifier::~OptionsWidget_notifier() diff --git a/src/modules/options/OptionsWidget_notifier.h b/src/modules/options/OptionsWidget_notifier.h index ce350e4c2..00eb5758c 100644 --- a/src/modules/options/OptionsWidget_notifier.h +++ b/src/modules/options/OptionsWidget_notifier.h @@ -38,8 +38,9 @@ class OptionsWidget_notifierLook : public KviOptionsWidget { Q_OBJECT private: - QComboBox* m_pHorizontalAlign; - QComboBox* m_pVerticalAlign; + QComboBox * m_pHorizontalAlign; + QComboBox * m_pVerticalAlign; + public: OptionsWidget_notifierLook(QWidget * parent); ~OptionsWidget_notifierLook(); @@ -58,6 +59,7 @@ class OptionsWidget_notifier : public KviOptionsWidget public: OptionsWidget_notifier(QWidget * parent); ~OptionsWidget_notifier(); + private: #ifdef COMPILE_KDE_SUPPORT KviBoolSelector * m_pKdeNotifier; diff --git a/src/modules/options/OptionsWidget_notify.cpp b/src/modules/options/OptionsWidget_notify.cpp index d14a98743..461632fe6 100644 --- a/src/modules/options/OptionsWidget_notify.cpp +++ b/src/modules/options/OptionsWidget_notify.cpp @@ -31,7 +31,7 @@ #include OptionsWidget_notify::OptionsWidget_notify(QWidget * parent) -: KviOptionsWidget(parent) + : KviOptionsWidget(parent) { setObjectName("notify_options_widget"); createLayout(); @@ -40,48 +40,48 @@ OptionsWidget_notify::OptionsWidget_notify(QWidget * parent) KviTalGroupBox * g; KviUIntSelector * u; - KviBoolSelector* notifyEnableBox = addBoolSelector(0,0,0,0,__tr2qs_ctx("Use online notify list","options"),KviOption_boolUseNotifyList); + KviBoolSelector * notifyEnableBox = addBoolSelector(0, 0, 0, 0, __tr2qs_ctx("Use online notify list", "options"), KviOption_boolUseNotifyList); b = notifyEnableBox; - g = addGroupBox(0,1,0,1,Qt::Horizontal,__tr2qs_ctx("Configuration","options")); - connect(b,SIGNAL(toggled(bool)),g,SLOT(setEnabled(bool))); + g = addGroupBox(0, 1, 0, 1, Qt::Horizontal, __tr2qs_ctx("Configuration", "options")); + connect(b, SIGNAL(toggled(bool)), g, SLOT(setEnabled(bool))); - b = addBoolSelector(g,__tr2qs_ctx("Show notifications in active window","options"),KviOption_boolNotifyListChangesToActiveWindow,KVI_OPTION_BOOL(KviOption_boolUseNotifyList)); - connect(notifyEnableBox,SIGNAL(toggled(bool)),b,SLOT(setEnabled(bool))); + b = addBoolSelector(g, __tr2qs_ctx("Show notifications in active window", "options"), KviOption_boolNotifyListChangesToActiveWindow, KVI_OPTION_BOOL(KviOption_boolUseNotifyList)); + connect(notifyEnableBox, SIGNAL(toggled(bool)), b, SLOT(setEnabled(bool))); - b = addBoolSelector(g,__tr2qs_ctx("Flash window when users are going online","options"),KviOption_boolFlashWindowOnNotifyOnLine,KVI_OPTION_BOOL(KviOption_boolUseNotifyList)); - connect(notifyEnableBox,SIGNAL(toggled(bool)),b,SLOT(setEnabled(bool))); + b = addBoolSelector(g, __tr2qs_ctx("Flash window when users are going online", "options"), KviOption_boolFlashWindowOnNotifyOnLine, KVI_OPTION_BOOL(KviOption_boolUseNotifyList)); + connect(notifyEnableBox, SIGNAL(toggled(bool)), b, SLOT(setEnabled(bool))); - b = addBoolSelector(g,__tr2qs_ctx("Popup notifier when users are going online","options"),KviOption_boolPopupNotifierOnNotifyOnLine,KVI_OPTION_BOOL(KviOption_boolUseNotifyList)); - connect(notifyEnableBox,SIGNAL(toggled(bool)),b,SLOT(setEnabled(bool))); + b = addBoolSelector(g, __tr2qs_ctx("Popup notifier when users are going online", "options"), KviOption_boolPopupNotifierOnNotifyOnLine, KVI_OPTION_BOOL(KviOption_boolUseNotifyList)); + connect(notifyEnableBox, SIGNAL(toggled(bool)), b, SLOT(setEnabled(bool))); - g = addGroupBox(0,2,0,2,Qt::Horizontal,__tr2qs_ctx("Advanced Configuration","options")); - connect(notifyEnableBox,SIGNAL(toggled(bool)),g,SLOT(setEnabled(bool))); + g = addGroupBox(0, 2, 0, 2, Qt::Horizontal, __tr2qs_ctx("Advanced Configuration", "options")); + connect(notifyEnableBox, SIGNAL(toggled(bool)), g, SLOT(setEnabled(bool))); - b = addBoolSelector(g,__tr2qs_ctx("Check USERHOST for online users","options"),KviOption_boolNotifyListSendUserhostForOnlineUsers,KVI_OPTION_BOOL(KviOption_boolUseNotifyList)); - connect(notifyEnableBox,SIGNAL(toggled(bool)),b,SLOT(setEnabled(bool))); + b = addBoolSelector(g, __tr2qs_ctx("Check USERHOST for online users", "options"), KviOption_boolNotifyListSendUserhostForOnlineUsers, KVI_OPTION_BOOL(KviOption_boolUseNotifyList)); + connect(notifyEnableBox, SIGNAL(toggled(bool)), b, SLOT(setEnabled(bool))); - b = addBoolSelector(g,__tr2qs_ctx("Use \"smart\" notify list manager","options"),KviOption_boolUseIntelligentNotifyListManager,KVI_OPTION_BOOL(KviOption_boolUseNotifyList)); - connect(notifyEnableBox,SIGNAL(toggled(bool)),b,SLOT(setEnabled(bool))); + b = addBoolSelector(g, __tr2qs_ctx("Use \"smart\" notify list manager", "options"), KviOption_boolUseIntelligentNotifyListManager, KVI_OPTION_BOOL(KviOption_boolUseNotifyList)); + connect(notifyEnableBox, SIGNAL(toggled(bool)), b, SLOT(setEnabled(bool))); - b = addBoolSelector(g,__tr2qs_ctx("Use the WATCH method if available","options"),KviOption_boolUseWatchListIfAvailable,KVI_OPTION_BOOL(KviOption_boolUseNotifyList)); - connect(notifyEnableBox,SIGNAL(toggled(bool)),b,SLOT(setEnabled(bool))); + b = addBoolSelector(g, __tr2qs_ctx("Use the WATCH method if available", "options"), KviOption_boolUseWatchListIfAvailable, KVI_OPTION_BOOL(KviOption_boolUseNotifyList)); + connect(notifyEnableBox, SIGNAL(toggled(bool)), b, SLOT(setEnabled(bool))); - u = addUIntSelector(g,__tr2qs_ctx("Check interval:","options"),KviOption_uintNotifyListCheckTimeInSecs,5,3600,180,KVI_OPTION_BOOL(KviOption_boolUseNotifyList)); - u->setSuffix(__tr2qs_ctx(" sec","options")); - connect(notifyEnableBox,SIGNAL(toggled(bool)),u,SLOT(setEnabled(bool))); + u = addUIntSelector(g, __tr2qs_ctx("Check interval:", "options"), KviOption_uintNotifyListCheckTimeInSecs, 5, 3600, 180, KVI_OPTION_BOOL(KviOption_boolUseNotifyList)); + u->setSuffix(__tr2qs_ctx(" sec", "options")); + connect(notifyEnableBox, SIGNAL(toggled(bool)), u, SLOT(setEnabled(bool))); - u = addUIntSelector(g,__tr2qs_ctx("ISON delay:","options"),KviOption_uintNotifyListIsOnDelayTimeInSecs,5,180,6,KVI_OPTION_BOOL(KviOption_boolUseNotifyList)); - u->setSuffix(__tr2qs_ctx(" sec","options")); - connect(notifyEnableBox,SIGNAL(toggled(bool)),u,SLOT(setEnabled(bool))); + u = addUIntSelector(g, __tr2qs_ctx("ISON delay:", "options"), KviOption_uintNotifyListIsOnDelayTimeInSecs, 5, 180, 6, KVI_OPTION_BOOL(KviOption_boolUseNotifyList)); + u->setSuffix(__tr2qs_ctx(" sec", "options")); + connect(notifyEnableBox, SIGNAL(toggled(bool)), u, SLOT(setEnabled(bool))); - u = addUIntSelector(g,__tr2qs_ctx("USERHOST delay:","options"),KviOption_uintNotifyListUserhostDelayTimeInSecs,5,180,6,KVI_OPTION_BOOL(KviOption_boolUseNotifyList)); - u->setSuffix(__tr2qs_ctx(" sec","options")); - connect(notifyEnableBox,SIGNAL(toggled(bool)),u,SLOT(setEnabled(bool))); + u = addUIntSelector(g, __tr2qs_ctx("USERHOST delay:", "options"), KviOption_uintNotifyListUserhostDelayTimeInSecs, 5, 180, 6, KVI_OPTION_BOOL(KviOption_boolUseNotifyList)); + u->setSuffix(__tr2qs_ctx(" sec", "options")); + connect(notifyEnableBox, SIGNAL(toggled(bool)), u, SLOT(setEnabled(bool))); - addLabel(0,3,0,3,__tr2qs_ctx("

Note:
The notify list is managed using the \"Registered Users\" settings.

","options")); + addLabel(0, 3, 0, 3, __tr2qs_ctx("

Note:
The notify list is managed using the \"Registered Users\" settings.

", "options")); - addRowSpacer(0,4,0,4); + addRowSpacer(0, 4, 0, 4); } OptionsWidget_notify::~OptionsWidget_notify() diff --git a/src/modules/options/OptionsWidget_protection.cpp b/src/modules/options/OptionsWidget_protection.cpp index 2376de59a..ce325813a 100644 --- a/src/modules/options/OptionsWidget_protection.cpp +++ b/src/modules/options/OptionsWidget_protection.cpp @@ -31,7 +31,7 @@ #include OptionsWidget_protection::OptionsWidget_protection(QWidget * parent) -: KviOptionsWidget(parent) + : KviOptionsWidget(parent) { setObjectName("protection_options_widget"); diff --git a/src/modules/options/OptionsWidget_proxy.cpp b/src/modules/options/OptionsWidget_proxy.cpp index f140a4b9a..8bebd95f2 100644 --- a/src/modules/options/OptionsWidget_proxy.cpp +++ b/src/modules/options/OptionsWidget_proxy.cpp @@ -43,13 +43,12 @@ #include #include - -ProxyOptionsTreeWidgetItem::ProxyOptionsTreeWidgetItem(QTreeWidget *parent,const QPixmap &pm,KviProxy * prx) -: QTreeWidgetItem(parent) +ProxyOptionsTreeWidgetItem::ProxyOptionsTreeWidgetItem(QTreeWidget * parent, const QPixmap & pm, KviProxy * prx) + : QTreeWidgetItem(parent) { qDebug("Creating item"); - setText(0,prx->m_szHostname); - setIcon(0,QIcon(pm)); + setText(0, prx->m_szHostname); + setIcon(0, QIcon(pm)); m_pProxyData = new KviProxy(*prx); } @@ -60,67 +59,69 @@ ProxyOptionsTreeWidgetItem::~ProxyOptionsTreeWidgetItem() } OptionsWidget_proxy::OptionsWidget_proxy(QWidget * parent) -: KviOptionsWidget(parent,"proxy_options_widget") + : KviOptionsWidget(parent, "proxy_options_widget") { createLayout(); - m_pUseProxySelector = addBoolSelector(0,0,1,0,__tr2qs_ctx("Use proxy for all connections","options"),KviOption_boolUseProxyHost); - QString szTip = __tr2qs_ctx("When enabled, the selected proxy will be used as the default for all connections.
" \ - "An alternative option to define a specific per-server proxy, is also located " \ - "in the advanced server dialog in the connection tab.","options"); + m_pUseProxySelector = addBoolSelector(0, 0, 1, 0, __tr2qs_ctx("Use proxy for all connections", "options"), KviOption_boolUseProxyHost); + QString szTip = __tr2qs_ctx("When enabled, the selected proxy will be used as the default for all connections.
" + "An alternative option to define a specific per-server proxy, is also located " + "in the advanced server dialog in the connection tab.", + "options"); - mergeTip(m_pUseProxySelector,szTip); + mergeTip(m_pUseProxySelector, szTip); m_pTreeWidget = new QTreeWidget(this); - addWidgetToLayout(m_pTreeWidget,0,1,0,1); - m_pTreeWidget->setHeaderLabel(__tr2qs_ctx("Proxy","options")); + addWidgetToLayout(m_pTreeWidget, 0, 1, 0, 1); + m_pTreeWidget->setHeaderLabel(__tr2qs_ctx("Proxy", "options")); m_pTreeWidget->setRootIsDecorated(true); m_pTreeWidget->setAllColumnsShowFocus(true); m_pTreeWidget->setSelectionMode(QAbstractItemView::SingleSelection); - connect(m_pTreeWidget,SIGNAL(currentItemChanged(QTreeWidgetItem *,QTreeWidgetItem *)), - this,SLOT(currentItemChanged(QTreeWidgetItem *,QTreeWidgetItem *))); + connect(m_pTreeWidget, SIGNAL(currentItemChanged(QTreeWidgetItem *, QTreeWidgetItem *)), + this, SLOT(currentItemChanged(QTreeWidgetItem *, QTreeWidgetItem *))); m_pTreeWidget->setContextMenuPolicy(Qt::CustomContextMenu); - connect(m_pTreeWidget,SIGNAL(customContextMenuRequested(const QPoint &)), - this,SLOT(customContextMenuRequested(const QPoint &))); + connect(m_pTreeWidget, SIGNAL(customContextMenuRequested(const QPoint &)), + this, SLOT(customContextMenuRequested(const QPoint &))); - QString tiptxt = __tr2qs_ctx("This is the list of available proxy servers.
" \ - "Right-click on the list to add or remove proxies.","options"); + QString tiptxt = __tr2qs_ctx("This is the list of available proxy servers.
" + "Right-click on the list to add or remove proxies.", + "options"); - mergeTip(m_pTreeWidget,tiptxt); - mergeTip(m_pTreeWidget->viewport(),tiptxt); + mergeTip(m_pTreeWidget, tiptxt); + mergeTip(m_pTreeWidget->viewport(), tiptxt); KviTalVBox * vbox = new KviTalVBox(this); - addWidgetToLayout(vbox,1,1,1,1); + addWidgetToLayout(vbox, 1, 1, 1, 1); QToolButton * tb = new QToolButton(vbox); tb->setIcon(QIcon(*(g_pIconManager->getSmallIcon(KviIconManager::NewProxy)))); tb->setAutoRaise(true); - connect(tb,SIGNAL(clicked()),this,SLOT(newProxy())); - mergeTip(tb,__tr2qs_ctx("New proxy","options")); + connect(tb, SIGNAL(clicked()), this, SLOT(newProxy())); + mergeTip(tb, __tr2qs_ctx("New proxy", "options")); tb = new QToolButton(vbox); tb->setIcon(QIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Remove)))); tb->setAutoRaise(true); - connect(tb,SIGNAL(clicked()),this,SLOT(removeCurrent())); - mergeTip(tb,__tr2qs_ctx("Remove proxy","options")); + connect(tb, SIGNAL(clicked()), this, SLOT(removeCurrent())); + mergeTip(tb, __tr2qs_ctx("Remove proxy", "options")); QFrame * lll = new QFrame(vbox); - vbox->setStretchFactor(lll,100); + vbox->setStretchFactor(lll, 100); - KviTalGroupBox * gbox = addGroupBox(0,2,1,2,Qt::Horizontal,__tr2qs_ctx("Configuration","options")); + KviTalGroupBox * gbox = addGroupBox(0, 2, 1, 2, Qt::Horizontal, __tr2qs_ctx("Configuration", "options")); - m_pProxyLabel = new QLabel(__tr2qs_ctx("Proxy:","options"),gbox); + m_pProxyLabel = new QLabel(__tr2qs_ctx("Proxy:", "options"), gbox); m_pProxyEdit = new QLineEdit(gbox); - m_pPortLabel = new QLabel(__tr2qs_ctx("Port:","options"),gbox); + m_pPortLabel = new QLabel(__tr2qs_ctx("Port:", "options"), gbox); m_pPortEdit = new QLineEdit(gbox); - m_pIpLabel = new QLabel(__tr2qs_ctx("IP address:","options"),gbox); - m_pIpEditor = new KviIpEditor(gbox,KviIpEditor::IPv4); - m_pUserLabel = new QLabel(__tr2qs_ctx("Username:","options"),gbox); + m_pIpLabel = new QLabel(__tr2qs_ctx("IP address:", "options"), gbox); + m_pIpEditor = new KviIpEditor(gbox, KviIpEditor::IPv4); + m_pUserLabel = new QLabel(__tr2qs_ctx("Username:", "options"), gbox); m_pUserEdit = new QLineEdit(gbox); - m_pPassLabel = new QLabel(__tr2qs_ctx("Password:","options"),gbox); + m_pPassLabel = new QLabel(__tr2qs_ctx("Password:", "options"), gbox); m_pPassEdit = new QLineEdit(gbox); - m_pProtocolLabel = new QLabel(__tr2qs_ctx("Protocol:","options"),gbox); + m_pProtocolLabel = new QLabel(__tr2qs_ctx("Protocol:", "options"), gbox); m_pProtocolBox = new QComboBox(gbox); QStringList l; @@ -128,8 +129,8 @@ OptionsWidget_proxy::OptionsWidget_proxy(QWidget * parent) m_pProtocolBox->addItems(l); - m_pIPv6Check = new QCheckBox(__tr2qs_ctx("Use IPv6 protocol","options"),gbox); - connect(m_pIPv6Check,SIGNAL(toggled(bool)),this,SLOT(ipV6CheckToggled(bool))); + m_pIPv6Check = new QCheckBox(__tr2qs_ctx("Use IPv6 protocol", "options"), gbox); + connect(m_pIPv6Check, SIGNAL(toggled(bool)), this, SLOT(ipV6CheckToggled(bool))); #ifndef COMPILE_IPV6_SUPPORT m_pIPv6Check->setEnabled(false); #endif @@ -137,8 +138,8 @@ OptionsWidget_proxy::OptionsWidget_proxy(QWidget * parent) fillProxyList(); - layout()->setRowStretch(0,1); - layout()->setColumnStretch(0,1); + layout()->setRowStretch(0, 1); + layout()->setColumnStretch(0, 1); m_pContextPopup = new QMenu(this); } @@ -165,9 +166,9 @@ void OptionsWidget_proxy::fillProxyList() KviPointerList * l = g_pProxyDataBase->proxyList(); - for(KviProxy * p = l->first();p;p = l->next()) + for(KviProxy * p = l->first(); p; p = l->next()) { - prx = new ProxyOptionsTreeWidgetItem(m_pTreeWidget,*(g_pIconManager->getSmallIcon(KviIconManager::Proxy)),p); + prx = new ProxyOptionsTreeWidgetItem(m_pTreeWidget, *(g_pIconManager->getSmallIcon(KviIconManager::Proxy)), p); if(p == g_pProxyDataBase->currentProxy()) { prx->setSelected(true); @@ -176,14 +177,15 @@ void OptionsWidget_proxy::fillProxyList() } } if(!(g_pProxyDataBase->currentProxy())) - currentItemChanged(0,0); + currentItemChanged(0, 0); enableDisableUseProxySelector(); } -void OptionsWidget_proxy::currentItemChanged(QTreeWidgetItem *it,QTreeWidgetItem *) +void OptionsWidget_proxy::currentItemChanged(QTreeWidgetItem * it, QTreeWidgetItem *) { - if(m_pLastEditedItem)saveLastItem(); + if(m_pLastEditedItem) + saveLastItem(); m_pLastEditedItem = (ProxyOptionsTreeWidgetItem *)it; m_pProxyLabel->setEnabled(m_pLastEditedItem); @@ -208,10 +210,10 @@ void OptionsWidget_proxy::currentItemChanged(QTreeWidgetItem *it,QTreeWidgetItem { m_pProxyEdit->setText(m_pLastEditedItem->m_pProxyData->m_szHostname); - for(int i=0;icount();i++) + for(int i = 0; i < m_pProtocolBox->count(); i++) { KviCString txt = m_pProtocolBox->itemText(i); - if(kvi_strEqualCI(m_pLastEditedItem->m_pProxyData->protocolName().toUtf8().data(),txt.ptr())) + if(kvi_strEqualCI(m_pLastEditedItem->m_pProxyData->protocolName().toUtf8().data(), txt.ptr())) { m_pProtocolBox->setCurrentIndex(i); break; @@ -236,9 +238,11 @@ void OptionsWidget_proxy::currentItemChanged(QTreeWidgetItem *it,QTreeWidgetItem m_pUserEdit->setText(m_pLastEditedItem->m_pProxyData->m_szUser); m_pPassEdit->setText(m_pLastEditedItem->m_pProxyData->m_szPass); - KviCString tmp(KviCString::Format,"%u",m_pLastEditedItem->m_pProxyData->m_uPort); + KviCString tmp(KviCString::Format, "%u", m_pLastEditedItem->m_pProxyData->m_uPort); m_pPortEdit->setText(tmp.ptr()); - } else { + } + else + { m_pProxyEdit->setText(""); m_pUserEdit->setText(""); m_pPassEdit->setText(""); @@ -257,7 +261,7 @@ void OptionsWidget_proxy::saveLastItem() if(tmp.isEmpty()) tmp = "irc.unknown.net"; - m_pLastEditedItem->setText(0,tmp.ptr()); + m_pLastEditedItem->setText(0, tmp.ptr()); m_pLastEditedItem->m_pProxyData->m_szHostname = tmp; #ifdef COMPILE_IPV6_SUPPORT m_pLastEditedItem->m_pProxyData->m_bIsIPv6 = m_pIPv6Check->isChecked(); @@ -273,15 +277,15 @@ void OptionsWidget_proxy::saveLastItem() #ifdef COMPILE_IPV6_SUPPORT if(m_pIPv6Check->isChecked()) { - if((!KviQString::equalCI(tmpAddr,"0:0:0:0:0:0:0:0")) && - KviNetUtils::isValidStringIPv6(tmpAddr)) + if((!KviQString::equalCI(tmpAddr, "0:0:0:0:0:0:0:0")) && KviNetUtils::isValidStringIPv6(tmpAddr)) { m_pLastEditedItem->m_pProxyData->m_szIp = tmpAddr; } - } else { + } + else + { #endif - if((!KviQString::equalCI(tmpAddr,"0.0.0.0")) && - KviNetUtils::isValidStringIp(tmpAddr)) + if((!KviQString::equalCI(tmpAddr, "0.0.0.0")) && KviNetUtils::isValidStringIp(tmpAddr)) { m_pLastEditedItem->m_pProxyData->m_szIp = tmpAddr; } @@ -294,10 +298,11 @@ void OptionsWidget_proxy::saveLastItem() tmp = m_pPortEdit->text(); bool bOk; kvi_u32_t uPort = tmp.toUInt(&bOk); - if(!bOk)uPort = 1080; - m_pLastEditedItem->m_pProxyData->m_uPort = uPort; - tmp = m_pProtocolBox->currentText(); - m_pLastEditedItem->m_pProxyData->setNamedProtocol(tmp.ptr()); + if(!bOk) + uPort = 1080; + m_pLastEditedItem->m_pProxyData->m_uPort = uPort; + tmp = m_pProtocolBox->currentText(); + m_pLastEditedItem->m_pProxyData->setNamedProtocol(tmp.ptr()); } } @@ -308,16 +313,17 @@ void OptionsWidget_proxy::commit() ProxyOptionsTreeWidgetItem * it; - for(int i=0;itopLevelItemCount();i++) + for(int i = 0; i < m_pTreeWidget->topLevelItemCount(); i++) { - it=(ProxyOptionsTreeWidgetItem *)m_pTreeWidget->topLevelItem(i); + it = (ProxyOptionsTreeWidgetItem *)m_pTreeWidget->topLevelItem(i); QString tmp = it->text(0); if(!tmp.isEmpty()) { KviProxy * prx = new KviProxy(*(it->m_pProxyData)); g_pProxyDataBase->insertProxy(prx); - if(it == m_pLastEditedItem)g_pProxyDataBase->setCurrentProxy(prx); + if(it == m_pLastEditedItem) + g_pProxyDataBase->setCurrentProxy(prx); } } @@ -327,20 +333,20 @@ void OptionsWidget_proxy::commit() KviOptionsWidget::commit(); } -void OptionsWidget_proxy::customContextMenuRequested(const QPoint &pos) +void OptionsWidget_proxy::customContextMenuRequested(const QPoint & pos) { - QTreeWidgetItem *it=(QTreeWidgetItem *)m_pTreeWidget->itemAt(pos); + QTreeWidgetItem * it = (QTreeWidgetItem *)m_pTreeWidget->itemAt(pos); m_pContextPopup->clear(); - m_pContextPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::NewProxy)),__tr2qs_ctx("&New Proxy","options"),this,SLOT(newProxy())); - m_pContextPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::Remove)),__tr2qs_ctx("Re&move Proxy","options"),this,SLOT(removeCurrent())) - ->setEnabled(it); + m_pContextPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::NewProxy)), __tr2qs_ctx("&New Proxy", "options"), this, SLOT(newProxy())); + m_pContextPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::Remove)), __tr2qs_ctx("Re&move Proxy", "options"), this, SLOT(removeCurrent())) + ->setEnabled(it); m_pContextPopup->popup(QCursor::pos()); } void OptionsWidget_proxy::newProxy() { KviProxy prx; - ProxyOptionsTreeWidgetItem * it = new ProxyOptionsTreeWidgetItem(m_pTreeWidget,*(g_pIconManager->getSmallIcon(KviIconManager::Proxy)),&prx); + ProxyOptionsTreeWidgetItem * it = new ProxyOptionsTreeWidgetItem(m_pTreeWidget, *(g_pIconManager->getSmallIcon(KviIconManager::Proxy)), &prx); it->setSelected(true); m_pTreeWidget->setCurrentItem(it); m_pTreeWidget->scrollToItem(it); @@ -358,8 +364,10 @@ void OptionsWidget_proxy::removeCurrent() if(it) { it->setSelected(true); - } else { - currentItemChanged(0,0); + } + else + { + currentItemChanged(0, 0); } } } diff --git a/src/modules/options/OptionsWidget_proxy.h b/src/modules/options/OptionsWidget_proxy.h index 64a2fd2b4..3b7b1f3f2 100644 --- a/src/modules/options/OptionsWidget_proxy.h +++ b/src/modules/options/OptionsWidget_proxy.h @@ -44,13 +44,13 @@ extern KVIRC_API KviProxyDataBase * g_pProxyDataBase; class ProxyOptionsTreeWidgetItem : public QTreeWidgetItem { public: - ProxyOptionsTreeWidgetItem(QTreeWidget *parent,const QPixmap &pm,KviProxy * prx); + ProxyOptionsTreeWidgetItem(QTreeWidget * parent, const QPixmap & pm, KviProxy * prx); ~ProxyOptionsTreeWidgetItem(); + public: KviProxy * m_pProxyData; }; - #define KVI_OPTIONS_WIDGET_ICON_OptionsWidget_proxy KviIconManager::Proxy #define KVI_OPTIONS_WIDGET_NAME_OptionsWidget_proxy __tr2qs_no_lookup("Proxy Hosts") #define KVI_OPTIONS_WIDGET_PARENT_OptionsWidget_proxy OptionsWidget_connection @@ -63,35 +63,37 @@ class OptionsWidget_proxy : public KviOptionsWidget public: OptionsWidget_proxy(QWidget * parent); ~OptionsWidget_proxy(); + protected: - QTreeWidget * m_pTreeWidget; - QLabel * m_pProxyLabel; - QLineEdit * m_pProxyEdit; - QLabel * m_pIpLabel; - KviIpEditor * m_pIpEditor; - QLabel * m_pUserLabel; - QLineEdit * m_pUserEdit; - QLabel * m_pPassLabel; - QLineEdit * m_pPassEdit; - QLabel * m_pPortLabel; - QLineEdit * m_pPortEdit; - QLabel * m_pProtocolLabel; - QComboBox * m_pProtocolBox; - QMenu * m_pContextPopup; - QCheckBox * m_pIPv6Check; + QTreeWidget * m_pTreeWidget; + QLabel * m_pProxyLabel; + QLineEdit * m_pProxyEdit; + QLabel * m_pIpLabel; + KviIpEditor * m_pIpEditor; + QLabel * m_pUserLabel; + QLineEdit * m_pUserEdit; + QLabel * m_pPassLabel; + QLineEdit * m_pPassEdit; + QLabel * m_pPortLabel; + QLineEdit * m_pPortEdit; + QLabel * m_pProtocolLabel; + QComboBox * m_pProtocolBox; + QMenu * m_pContextPopup; + QCheckBox * m_pIPv6Check; KviBoolSelector * m_pUseProxySelector; ProxyOptionsTreeWidgetItem * m_pLastEditedItem; -private: +private: void fillProxyList(); void saveLastItem(); void enableDisableUseProxySelector(); protected slots: - void currentItemChanged(QTreeWidgetItem *it,QTreeWidgetItem *prev); - void customContextMenuRequested(const QPoint &pnt); + void currentItemChanged(QTreeWidgetItem * it, QTreeWidgetItem * prev); + void customContextMenuRequested(const QPoint & pnt); void newProxy(); void removeCurrent(); void ipV6CheckToggled(bool bEnabled); + public: virtual void commit(); }; diff --git a/src/modules/options/OptionsWidget_query.cpp b/src/modules/options/OptionsWidget_query.cpp index 91b727aaa..1174184d2 100644 --- a/src/modules/options/OptionsWidget_query.cpp +++ b/src/modules/options/OptionsWidget_query.cpp @@ -22,7 +22,6 @@ // //============================================================================= - #include "OptionsWidget_query.h" #include "KviOptions.h" @@ -31,9 +30,8 @@ #include - OptionsWidget_query::OptionsWidget_query(QWidget * parent) -: KviOptionsWidget(parent) + : KviOptionsWidget(parent) { setObjectName("query_options_widget"); createLayout(); @@ -41,72 +39,80 @@ OptionsWidget_query::OptionsWidget_query(QWidget * parent) KviBoolSelector * b; KviTalGroupBox * g; - g = addGroupBox(0,0,1,0,Qt::Horizontal,__tr2qs_ctx("Open Query for","options")); - b = addBoolSelector(g, __tr2qs_ctx("Private messages","options"),KviOption_boolCreateQueryOnPrivmsg); - mergeTip(b,__tr2qs_ctx("This option enables query window creation " \ - "when a private message (PRIVMSG) is received.
" \ - "If you disable this, private messages will " \ - "be shown in the active window or a common channel.","options")); - - b = addBoolSelector(g,__tr2qs_ctx("Private notices","options"),KviOption_boolCreateQueryOnNotice); - mergeTip(b,__tr2qs_ctx("This option enables query window creation " \ - "when a private notice (NOTICE) is received.
" \ - "If you disable this, private notices will " \ - "be shown in the active window or a common channel.","options")); - - b = addBoolSelector(0,1,1,1,__tr2qs_ctx("Open incoming query windows without focus","options"),KviOption_boolCreateIncomingQueriesAsMinimized); - mergeTip(b,__tr2qs_ctx("This option prevents incoming " \ - "query windows from diverting application focus.
" \ - "Enable this if you don't like queries " \ - "popping up while you're typing something in a channel.","options")); - - b = addBoolSelector(0,2,1,2, __tr2qs_ctx("Enable target user tracking","options"),KviOption_boolEnableQueryTracing); - mergeTip(b,__tr2qs_ctx("This option will enable target user tracking.
" \ - "Some actions of the target user (e.g. joins and parts) " \ - "will be displayed in the window.","options")); - -#if (defined(COMPILE_ON_WINDOWS) || defined(COMPILE_KDE_SUPPORT) || defined(COMPILE_ON_MINGW)) - b = addBoolSelector(0,3,1,3,__tr2qs_ctx("Flash system taskbar on new query message","options"),KviOption_boolFlashQueryWindowOnNewMessages); - mergeTip(b,__tr2qs_ctx("This option causes the system taskbar entry for KVIrc to flash when a new query message " \ - "is received and the KVIrc window is not the active.","options")); + g = addGroupBox(0, 0, 1, 0, Qt::Horizontal, __tr2qs_ctx("Open Query for", "options")); + b = addBoolSelector(g, __tr2qs_ctx("Private messages", "options"), KviOption_boolCreateQueryOnPrivmsg); + mergeTip(b, __tr2qs_ctx("This option enables query window creation " + "when a private message (PRIVMSG) is received.
" + "If you disable this, private messages will " + "be shown in the active window or a common channel.", + "options")); + + b = addBoolSelector(g, __tr2qs_ctx("Private notices", "options"), KviOption_boolCreateQueryOnNotice); + mergeTip(b, __tr2qs_ctx("This option enables query window creation " + "when a private notice (NOTICE) is received.
" + "If you disable this, private notices will " + "be shown in the active window or a common channel.", + "options")); + + b = addBoolSelector(0, 1, 1, 1, __tr2qs_ctx("Open incoming query windows without focus", "options"), KviOption_boolCreateIncomingQueriesAsMinimized); + mergeTip(b, __tr2qs_ctx("This option prevents incoming " + "query windows from diverting application focus.
" + "Enable this if you don't like queries " + "popping up while you're typing something in a channel.", + "options")); + + b = addBoolSelector(0, 2, 1, 2, __tr2qs_ctx("Enable target user tracking", "options"), KviOption_boolEnableQueryTracing); + mergeTip(b, __tr2qs_ctx("This option will enable target user tracking.
" + "Some actions of the target user (e.g. joins and parts) " + "will be displayed in the window.", + "options")); + +#if(defined(COMPILE_ON_WINDOWS) || defined(COMPILE_KDE_SUPPORT) || defined(COMPILE_ON_MINGW)) + b = addBoolSelector(0, 3, 1, 3, __tr2qs_ctx("Flash system taskbar on new query message", "options"), KviOption_boolFlashQueryWindowOnNewMessages); + mergeTip(b, __tr2qs_ctx("This option causes the system taskbar entry for KVIrc to flash when a new query message " + "is received and the KVIrc window is not the active.", + "options")); #endif - b = addBoolSelector(0,4,1,4, __tr2qs_ctx("Popup notifier on new query message","options"),KviOption_boolPopupNotifierOnNewQueryMessages); - mergeTip(b,__tr2qs_ctx("This option causes a small notifier window to pop up " \ - "in the lower right corner of the screen when a new message is received " \ - "and the KVIrc window is not active.","options")); - - b = addBoolSelector(0,5,1,5, __tr2qs_ctx("Popup notifier on new notice","options"),KviOption_boolPopupNotifierOnNewNotices); - mergeTip(b,__tr2qs_ctx("This option causes a small notifier window to pop up " \ - "in the lower right corner of the screen when a new notice is received " \ - "and the KVIrc window is not active.","options")); - - b = addBoolSelector(0,6,1,6, __tr2qs_ctx("Show information about query target at the top of the query","options"),KviOption_boolShowExtendedInfoInQueryLabel); - mergeTip(b,__tr2qs_ctx("This option enables query window information " \ - "label. It can show you known information about query target at the top of the window.
" \ - "Uncheck if you think,that it wastes your query space","options")); - - b = addBoolSelector(0,7,1,7,__tr2qs_ctx("Paste last query log","options"),KviOption_boolPasteLastLogOnQueryJoin); + b = addBoolSelector(0, 4, 1, 4, __tr2qs_ctx("Popup notifier on new query message", "options"), KviOption_boolPopupNotifierOnNewQueryMessages); + mergeTip(b, __tr2qs_ctx("This option causes a small notifier window to pop up " + "in the lower right corner of the screen when a new message is received " + "and the KVIrc window is not active.", + "options")); + + b = addBoolSelector(0, 5, 1, 5, __tr2qs_ctx("Popup notifier on new notice", "options"), KviOption_boolPopupNotifierOnNewNotices); + mergeTip(b, __tr2qs_ctx("This option causes a small notifier window to pop up " + "in the lower right corner of the screen when a new notice is received " + "and the KVIrc window is not active.", + "options")); + + b = addBoolSelector(0, 6, 1, 6, __tr2qs_ctx("Show information about query target at the top of the query", "options"), KviOption_boolShowExtendedInfoInQueryLabel); + mergeTip(b, __tr2qs_ctx("This option enables query window information " + "label. It can show you known information about query target at the top of the window.
" + "Uncheck if you think,that it wastes your query space", + "options")); + + b = addBoolSelector(0, 7, 1, 7, __tr2qs_ctx("Paste last query log", "options"), KviOption_boolPasteLastLogOnQueryJoin); KviTalHBox * box = new KviTalHBox(this); - addWidgetToLayout(box,0,8,1,8); + addWidgetToLayout(box, 0, 8, 1, 8); KviUIntSelector * u; - u = addUIntSelector(box,__tr2qs_ctx("Paste up to:","options"),KviOption_uintLinesToPasteOnQueryJoin,0,50,10, - KVI_OPTION_BOOL(KviOption_boolPasteLastLogOnQueryJoin)); - u->setSuffix(__tr2qs_ctx(" lines","options")); - mergeTip(u,__tr2qs_ctx("Minimum value: 0 lines
Maximum value: 50 lines","options")); + u = addUIntSelector(box, __tr2qs_ctx("Paste up to:", "options"), KviOption_uintLinesToPasteOnQueryJoin, 0, 50, 10, + KVI_OPTION_BOOL(KviOption_boolPasteLastLogOnQueryJoin)); + u->setSuffix(__tr2qs_ctx(" lines", "options")); + mergeTip(u, __tr2qs_ctx("Minimum value: 0 lines
Maximum value: 50 lines", "options")); - connect(b,SIGNAL(toggled(bool)),u,SLOT(setEnabled(bool))); + connect(b, SIGNAL(toggled(bool)), u, SLOT(setEnabled(bool))); - u = addUIntSelector(box,__tr2qs_ctx("Interval:","options"),KviOption_uintDaysIntervalToPasteOnQueryJoin,1,10,10, - KVI_OPTION_BOOL(KviOption_boolPasteLastLogOnQueryJoin)); - u->setSuffix(__tr2qs_ctx(" days","options")); - mergeTip(u,__tr2qs_ctx("Minimum value: 0 days
Maximum value: 10 days","options")); + u = addUIntSelector(box, __tr2qs_ctx("Interval:", "options"), KviOption_uintDaysIntervalToPasteOnQueryJoin, 1, 10, 10, + KVI_OPTION_BOOL(KviOption_boolPasteLastLogOnQueryJoin)); + u->setSuffix(__tr2qs_ctx(" days", "options")); + mergeTip(u, __tr2qs_ctx("Minimum value: 0 days
Maximum value: 10 days", "options")); - connect(b,SIGNAL(toggled(bool)),u,SLOT(setEnabled(bool))); + connect(b, SIGNAL(toggled(bool)), u, SLOT(setEnabled(bool))); - addRowSpacer(0,9,1,9); + addRowSpacer(0, 9, 1, 9); } OptionsWidget_query::~OptionsWidget_query() diff --git a/src/modules/options/OptionsWidget_servers.cpp b/src/modules/options/OptionsWidget_servers.cpp index 134911c71..11b85ba22 100644 --- a/src/modules/options/OptionsWidget_servers.cpp +++ b/src/modules/options/OptionsWidget_servers.cpp @@ -68,11 +68,11 @@ #include #if defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW) || defined(COMPILE_ON_MAC) - #include +#include #endif //COMPILE_ON_WINDOWS || COMPILE_ON_MINGW -IrcNetworkDetailsWidget::IrcNetworkDetailsWidget(QWidget * par,KviIrcNetwork * n) - : QDialog(par) +IrcNetworkDetailsWidget::IrcNetworkDetailsWidget(QWidget * par, KviIrcNetwork * n) + : QDialog(par) { setModal(true); setObjectName("network_details"); @@ -102,130 +102,134 @@ IrcNetworkDetailsWidget::IrcNetworkDetailsWidget(QWidget * par,KviIrcNetwork * n QGridLayout * g = new QGridLayout(this); - setWindowTitle(__tr2qs_ctx("Network Details and Configuration - KVIrc","options")); + setWindowTitle(__tr2qs_ctx("Network Details and Configuration - KVIrc", "options")); setWindowIcon(QIcon(*(g_pIconManager->getSmallIcon(KviIconManager::World)))); QString szTmp = ""; szTmp += n->name(); szTmp += ""; - QLabel * l = new QLabel(szTmp,this); + QLabel * l = new QLabel(szTmp, this); l->setFrameStyle(QFrame::Raised | QFrame::StyledPanel); l->setAlignment(Qt::AlignCenter); - g->addWidget(l,0,0,1,4); + g->addWidget(l, 0, 0, 1, 4); l->setMinimumWidth(200); - l = new QLabel(__tr2qs_ctx("Description:","options"),this); - g->addWidget(l,1,0); + l = new QLabel(__tr2qs_ctx("Description:", "options"), this); + g->addWidget(l, 1, 0); m_pDescEditor = new QLineEdit(this); - g->addWidget(m_pDescEditor,1,1,1,3); + g->addWidget(m_pDescEditor, 1, 1, 1, 3); m_pDescEditor->setText(n->description()); - KviTalToolTip::add(m_pDescEditor,__tr2qs_ctx("Put here a brief description of the network.","options")); - + KviTalToolTip::add(m_pDescEditor, __tr2qs_ctx("Put here a brief description of the network.", "options")); QTabWidget * tw = new QTabWidget(this); - g->addWidget(tw,2,0,1,4); + g->addWidget(tw, 2, 0, 1, 4); QWidget * tab = new QWidget(tw); QGridLayout * gl = new QGridLayout(tab); - KviTalGroupBox *gbox = new KviTalGroupBox(Qt::Horizontal,__tr2qs_ctx("Properties","options"),tab); - gl->addWidget(gbox,0,0,1,2); + KviTalGroupBox * gbox = new KviTalGroupBox(Qt::Horizontal, __tr2qs_ctx("Properties", "options"), tab); + gl->addWidget(gbox, 0, 0, 1, 2); QGridLayout * pPropertiesBoxLayout = new QGridLayout(); gbox->setLayout(pPropertiesBoxLayout); - l = new QLabel(__tr2qs_ctx("Username:","options"),gbox); - pPropertiesBoxLayout->addWidget(l,0,0); + l = new QLabel(__tr2qs_ctx("Username:", "options"), gbox); + pPropertiesBoxLayout->addWidget(l, 0, 0); m_pUserEditor = new QLineEdit(gbox); m_pUserEditor->setText(n->userName()); - pPropertiesBoxLayout->addWidget(m_pUserEditor,0,1); + pPropertiesBoxLayout->addWidget(m_pUserEditor, 0, 1); - KviTalToolTip::add(m_pUserEditor,__tr2qs_ctx("This is the username that KVIrc will use to login to servers on this network.\n" \ - "If this field is left empty (most common case), KVIrc will use the default username " \ - "specified in the \"Identity\" options tab.","options")); + KviTalToolTip::add(m_pUserEditor, __tr2qs_ctx("This is the username that KVIrc will use to login to servers on this network.\n" + "If this field is left empty (most common case), KVIrc will use the default username " + "specified in the \"Identity\" options tab.", + "options")); - l = new QLabel(__tr2qs_ctx("Password:","options"),gbox); - pPropertiesBoxLayout->addWidget(l,1,0); + l = new QLabel(__tr2qs_ctx("Password:", "options"), gbox); + pPropertiesBoxLayout->addWidget(l, 1, 0); m_pPassEditor = new KviPasswordLineEdit(gbox); m_pPassEditor->setText(n->password()); - pPropertiesBoxLayout->addWidget(m_pPassEditor,1,1); + pPropertiesBoxLayout->addWidget(m_pPassEditor, 1, 1); - KviTalToolTip::add(m_pPassEditor,__tr2qs_ctx("If this network requires a password, put it in this field, otherwise leave it empty.","options")); + KviTalToolTip::add(m_pPassEditor, __tr2qs_ctx("If this network requires a password, put it in this field, otherwise leave it empty.", "options")); - l = new QLabel(__tr2qs_ctx("Nickname:","options"),gbox); - pPropertiesBoxLayout->addWidget(l,2,0); + l = new QLabel(__tr2qs_ctx("Nickname:", "options"), gbox); + pPropertiesBoxLayout->addWidget(l, 2, 0); m_pNickEditor = new QLineEdit(gbox); - QValidator * v = new QRegExpValidator(QRegExp("[^-0-9 ][^ ]*",Qt::CaseSensitive),gbox); + QValidator * v = new QRegExpValidator(QRegExp("[^-0-9 ][^ ]*", Qt::CaseSensitive), gbox); m_pNickEditor->setValidator(v); m_pNickEditor->setText(n->nickName()); - pPropertiesBoxLayout->addWidget(m_pNickEditor,2,1); - + pPropertiesBoxLayout->addWidget(m_pNickEditor, 2, 1); - KviTalToolTip::add(m_pNickEditor,__tr2qs_ctx("You can specify a \"special\" nickname that will be used to log in to the servers on this network.
" \ - "If this field is left empty (most common case), the default nickname (specified in the \"Identity\" settings) will be used.","options")); + KviTalToolTip::add(m_pNickEditor, __tr2qs_ctx("You can specify a \"special\" nickname that will be used to log in to the servers on this network.
" + "If this field is left empty (most common case), the default nickname (specified in the \"Identity\" settings) will be used.", + "options")); - l = new QLabel(__tr2qs_ctx("Alt. nickname:","options"),gbox); - pPropertiesBoxLayout->addWidget(l,3,0); + l = new QLabel(__tr2qs_ctx("Alt. nickname:", "options"), gbox); + pPropertiesBoxLayout->addWidget(l, 3, 0); m_pAlternativeNickEditor = new QLineEdit(gbox); - v = new QRegExpValidator(QRegExp("[^-0-9 ][^ ]*",Qt::CaseSensitive),gbox); + v = new QRegExpValidator(QRegExp("[^-0-9 ][^ ]*", Qt::CaseSensitive), gbox); m_pAlternativeNickEditor->setValidator(v); m_pAlternativeNickEditor->setText(n->alternativeNickName()); - pPropertiesBoxLayout->addWidget(m_pAlternativeNickEditor,3,1); + pPropertiesBoxLayout->addWidget(m_pAlternativeNickEditor, 3, 1); - KviTalToolTip::add(m_pAlternativeNickEditor,__tr2qs_ctx("This nickname will be tried if the primary nickname for this network is already in use.
" \ - "If you leave it empty then the default nicknames specified in the identity options will be tried instead.","options")); + KviTalToolTip::add(m_pAlternativeNickEditor, __tr2qs_ctx("This nickname will be tried if the primary nickname for this network is already in use.
" + "If you leave it empty then the default nicknames specified in the identity options will be tried instead.", + "options")); - l = new QLabel(__tr2qs_ctx("Real name:","options"),gbox); - pPropertiesBoxLayout->addWidget(l,4,0); + l = new QLabel(__tr2qs_ctx("Real name:", "options"), gbox); + pPropertiesBoxLayout->addWidget(l, 4, 0); m_pRealEditor = new QLineEdit(gbox); m_pRealEditor->setText(n->realName()); - pPropertiesBoxLayout->addWidget(m_pRealEditor,4,1); + pPropertiesBoxLayout->addWidget(m_pRealEditor, 4, 1); - KviTalToolTip::add(m_pRealEditor,__tr2qs_ctx("You can specify a \"special\" real name that will be used to login with the servers on this network." \ - "If you leave this field empty (most common case), the default \"real name\" (specified in the \"Identity\" settings) will be used.","options")); + KviTalToolTip::add(m_pRealEditor, __tr2qs_ctx("You can specify a \"special\" real name that will be used to login with the servers on this network." + "If you leave this field empty (most common case), the default \"real name\" (specified in the \"Identity\" settings) will be used.", + "options")); - l = new QLabel(__tr2qs_ctx("Server encoding:","options"),tab); - gl->addWidget(l,1,0); + l = new QLabel(__tr2qs_ctx("Server encoding:", "options"), tab); + gl->addWidget(l, 1, 0); m_pEncodingEditor = new QComboBox(tab); m_pEncodingEditor->setDuplicatesEnabled(false); - gl->addWidget(m_pEncodingEditor,1,1); - KviTalToolTip::add(m_pEncodingEditor,__tr2qs_ctx("This box allows you to choose the preferred encoding for the servers in this network. " \ - "This encoding will be used for server specific needs, like referencing nicknames and channel names.
" \ - "If you choose \"Use System Encoding\" then the encoding will be set to the system-wide " \ - "value that you choose in the \"Encoding\" page of the options dialog.","options")); - - l = new QLabel(__tr2qs_ctx("Text encoding:","options"),tab); - gl->addWidget(l,2,0); + gl->addWidget(m_pEncodingEditor, 1, 1); + KviTalToolTip::add(m_pEncodingEditor, __tr2qs_ctx("This box allows you to choose the preferred encoding for the servers in this network. " + "This encoding will be used for server specific needs, like referencing nicknames and channel names.
" + "If you choose \"Use System Encoding\" then the encoding will be set to the system-wide " + "value that you choose in the \"Encoding\" page of the options dialog.", + "options")); + + l = new QLabel(__tr2qs_ctx("Text encoding:", "options"), tab); + gl->addWidget(l, 2, 0); m_pTextEncodingEditor = new QComboBox(tab); m_pTextEncodingEditor->setDuplicatesEnabled(false); - gl->addWidget(m_pTextEncodingEditor,2,1); - KviTalToolTip::add(m_pTextEncodingEditor,__tr2qs_ctx("This box allows you to choose the preferred encoding for the servers in this network. " \ - "This encoding will be used as the default for text messages.
" \ - "If you choose \"Use System Encoding\" then the encoding will be set to the system-wide " \ - "value that you choose in the \"Encoding\" page of the options dialog.","options")); + gl->addWidget(m_pTextEncodingEditor, 2, 1); + KviTalToolTip::add(m_pTextEncodingEditor, __tr2qs_ctx("This box allows you to choose the preferred encoding for the servers in this network. " + "This encoding will be used as the default for text messages.
" + "If you choose \"Use System Encoding\" then the encoding will be set to the system-wide " + "value that you choose in the \"Encoding\" page of the options dialog.", + "options")); int i = 0; - int srvcurrent = 0, txtcurrent=0; + int srvcurrent = 0, txtcurrent = 0; KviLocale::EncodingDescription * d = KviLocale::instance()->encodingDescription(i); QString tmp; - m_pEncodingEditor->addItem(__tr2qs_ctx("Use System Encoding","options")); - m_pTextEncodingEditor->addItem(__tr2qs_ctx("Use System Encoding","options")); + m_pEncodingEditor->addItem(__tr2qs_ctx("Use System Encoding", "options")); + m_pTextEncodingEditor->addItem(__tr2qs_ctx("Use System Encoding", "options")); while(d->pcName) { - tmp = QString("%1 (%2)").arg(d->pcName,d->pcDescription); - m_pEncodingEditor->insertItem(m_pEncodingEditor->count(),tmp); - m_pTextEncodingEditor->insertItem(m_pTextEncodingEditor->count(),tmp); - if(KviQString::equalCI(d->pcName,n->encoding())) + tmp = QString("%1 (%2)").arg(d->pcName, d->pcDescription); + m_pEncodingEditor->insertItem(m_pEncodingEditor->count(), tmp); + m_pTextEncodingEditor->insertItem(m_pTextEncodingEditor->count(), tmp); + if(KviQString::equalCI(d->pcName, n->encoding())) srvcurrent = i + 1; - if(KviQString::equalCI(d->pcName,n->textEncoding())) + if(KviQString::equalCI(d->pcName, n->textEncoding())) txtcurrent = i + 1; i = i + 1; d = KviLocale::instance()->encodingDescription(i); @@ -234,19 +238,19 @@ IrcNetworkDetailsWidget::IrcNetworkDetailsWidget(QWidget * par,KviIrcNetwork * n m_pEncodingEditor->setCurrentIndex(srvcurrent); m_pTextEncodingEditor->setCurrentIndex(txtcurrent); - m_pAutoConnectCheck = new QCheckBox(__tr2qs_ctx("Connect to this network at startup","options"),tab); + m_pAutoConnectCheck = new QCheckBox(__tr2qs_ctx("Connect to this network at startup", "options"), tab); m_pAutoConnectCheck->setChecked(n->autoConnect()); - gl->addWidget(m_pAutoConnectCheck,3,0,1,2); + gl->addWidget(m_pAutoConnectCheck, 3, 0, 1, 2); - KviTalToolTip::add(m_pAutoConnectCheck,__tr2qs_ctx("This option will cause KVIrc to automatically connect to this network at startup","options")); + KviTalToolTip::add(m_pAutoConnectCheck, __tr2qs_ctx("This option will cause KVIrc to automatically connect to this network at startup", "options")); - l = new QLabel("",tab); - gl->addWidget(l,4,0); + l = new QLabel("", tab); + gl->addWidget(l, 4, 0); - gl->setRowStretch(4,1); - gl->setColumnStretch(1,1); + gl->setRowStretch(4, 1); + gl->setColumnStretch(1, 1); - tw->addTab(tab,__tr2qs_ctx("General","options")); + tw->addTab(tab, __tr2qs_ctx("General", "options")); tab = new QWidget(tw); @@ -254,45 +258,48 @@ IrcNetworkDetailsWidget::IrcNetworkDetailsWidget(QWidget * par,KviIrcNetwork * n if(n->autoJoinChannelList()) m_lstChannels = *(n->autoJoinChannelList()); - m_pChannelListSelector = new KviChannelListSelector(tab,__tr2qs_ctx("Channels to Join Automatically upon Connect","options"),&m_lstChannels,true); + m_pChannelListSelector = new KviChannelListSelector(tab, __tr2qs_ctx("Channels to Join Automatically upon Connect", "options"), &m_lstChannels, true); - KviTalToolTip::add(m_pChannelListSelector,__tr2qs_ctx("Here you can set a list of channels to be joined automatically " \ - "after a connection to a server in this network has been established. To add a channel, type its name in the " \ - "text input below and click \"Add\".","options")); + KviTalToolTip::add(m_pChannelListSelector, __tr2qs_ctx("Here you can set a list of channels to be joined automatically " + "after a connection to a server in this network has been established. To add a channel, type its name in the " + "text input below and click \"Add\".", + "options")); - gl->addWidget(m_pChannelListSelector,0,0); + gl->addWidget(m_pChannelListSelector, 0, 0); - tw->addTab(tab,__tr2qs_ctx("Join Channels","options")); + tw->addTab(tab, __tr2qs_ctx("Join Channels", "options")); // after connect execute tab = new QWidget(tw); gl = new QGridLayout(tab); m_pOnConnectEditor = KviScriptEditor::createInstance(tab); - gl->addWidget(m_pOnConnectEditor,0,0); + gl->addWidget(m_pOnConnectEditor, 0, 0); m_pOnConnectEditor->setText(n->onConnectCommand()); m_pOnConnectEditor->setMinimumHeight(150); - KviTalToolTip::add(m_pOnConnectEditor,__tr2qs_ctx("The following commands will be executed after a connection to a server in this network has been established.
" \ - "Important: Enter commands without a preceding slash (e.g. quote pass secret instead of /quote pass secret).
"\ - "KVIrc will first send the USER command, then eventually PASS and NICK and then execute this " \ - "command sequence.","options")); + KviTalToolTip::add(m_pOnConnectEditor, __tr2qs_ctx("The following commands will be executed after a connection to a server in this network has been established.
" + "Important: Enter commands without a preceding slash (e.g. quote pass secret instead of /quote pass secret).
" + "KVIrc will first send the USER command, then eventually PASS and NICK and then execute this " + "command sequence.", + "options")); - tw->addTab(tab,__tr2qs_ctx("On Connect","options")); + tw->addTab(tab, __tr2qs_ctx("On Connect", "options")); tab = new QWidget(tw); gl = new QGridLayout(tab); m_pOnLoginEditor = KviScriptEditor::createInstance(tab); - gl->addWidget(m_pOnLoginEditor,0,0); + gl->addWidget(m_pOnLoginEditor, 0, 0); m_pOnLoginEditor->setText(n->onLoginCommand()); m_pOnLoginEditor->setMinimumHeight(150); - KviTalToolTip::add(m_pOnLoginEditor,__tr2qs_ctx("The following commands will be executed after a successful login to a server in this network.
" \ - "Important: Enter commands without a preceding slash (e.g. quote privatelog instead of /quote privatelog).
" - "This is useful for automatically opening queries, setting variables, etc.","options")); + KviTalToolTip::add(m_pOnLoginEditor, __tr2qs_ctx("The following commands will be executed after a successful login to a server in this network.
" + "Important: Enter commands without a preceding slash (e.g. quote privatelog instead of /quote privatelog).
" + "This is useful for automatically opening queries, setting variables, etc.", + "options")); - tw->addTab(tab,__tr2qs_ctx("On Login","options")); + tw->addTab(tab, __tr2qs_ctx("On Login", "options")); tab = new QWidget(tw); gl = new QGridLayout(tab); @@ -300,10 +307,10 @@ IrcNetworkDetailsWidget::IrcNetworkDetailsWidget(QWidget * par,KviIrcNetwork * n KviNickServRuleSet * rs = n->nickServRuleSet(); bool bNickServEnabled = rs ? (rs->isEnabled() && !rs->isEmpty()) : false; - m_pNickServCheck = new QCheckBox(__tr2qs_ctx("Enable NickServ identification","options"),tab); - gl->addWidget(m_pNickServCheck,0,0,1,3); + m_pNickServCheck = new QCheckBox(__tr2qs_ctx("Enable NickServ identification", "options"), tab); + gl->addWidget(m_pNickServCheck, 0, 0, 1, 3); - KviTalToolTip::add(m_pNickServCheck,__tr2qs_ctx("This check enables the automatic identification with NickServ","options")); + KviTalToolTip::add(m_pNickServCheck, __tr2qs_ctx("This check enables the automatic identification with NickServ", "options")); m_pNickServCheck->setChecked(bNickServEnabled); m_pNickServTreeWidget = new QTreeWidget(tab); @@ -311,111 +318,115 @@ IrcNetworkDetailsWidget::IrcNetworkDetailsWidget(QWidget * par,KviIrcNetwork * n m_pNickServTreeWidget->setAllColumnsShowFocus(true); m_pNickServTreeWidget->setColumnCount(4); QStringList columnLabels; - columnLabels.append(__tr2qs_ctx("Nickname","options")); - columnLabels.append(__tr2qs_ctx("NickServ Mask","options")); - columnLabels.append(__tr2qs_ctx("NickServ Request Mask","options")); - columnLabels.append(__tr2qs_ctx("Identify Command","options")); + columnLabels.append(__tr2qs_ctx("Nickname", "options")); + columnLabels.append(__tr2qs_ctx("NickServ Mask", "options")); + columnLabels.append(__tr2qs_ctx("NickServ Request Mask", "options")); + columnLabels.append(__tr2qs_ctx("Identify Command", "options")); m_pNickServTreeWidget->setHeaderLabels(columnLabels); - connect(m_pNickServTreeWidget,SIGNAL(itemSelectionChanged()),this,SLOT(enableDisableNickServControls())); - gl->addWidget(m_pNickServTreeWidget,1,0,1,3); + connect(m_pNickServTreeWidget, SIGNAL(itemSelectionChanged()), this, SLOT(enableDisableNickServControls())); + gl->addWidget(m_pNickServTreeWidget, 1, 0, 1, 3); - KviTalToolTip::add(m_pNickServTreeWidget,__tr2qs_ctx("This is a list of NickServ identification rules. " \ - "KVIrc will use them to model its automatic interaction with NickServ on this network.
" \ - "Please be aware that this feature can cause your NickServ passwords to be stolen " \ - "if used improperly. Make sure that you fully understand the NickServ authentication protocol.
" \ - "In other words, be sure to know what you're doing.
" \ - "Also note that the password that you provide is stored as PLAIN TEXT.","options")); + KviTalToolTip::add(m_pNickServTreeWidget, __tr2qs_ctx("This is a list of NickServ identification rules. " + "KVIrc will use them to model its automatic interaction with NickServ on this network.
" + "Please be aware that this feature can cause your NickServ passwords to be stolen " + "if used improperly. Make sure that you fully understand the NickServ authentication protocol.
" + "In other words, be sure to know what you're doing.
" + "Also note that the password that you provide is stored as PLAIN TEXT.", + "options")); - m_pAddRuleButton = new QPushButton(__tr2qs_ctx("Add Rule","options"),tab); - connect(m_pAddRuleButton,SIGNAL(clicked()),this,SLOT(addNickServRule())); - gl->addWidget(m_pAddRuleButton,2,0); + m_pAddRuleButton = new QPushButton(__tr2qs_ctx("Add Rule", "options"), tab); + connect(m_pAddRuleButton, SIGNAL(clicked()), this, SLOT(addNickServRule())); + gl->addWidget(m_pAddRuleButton, 2, 0); - m_pEditRuleButton = new QPushButton(__tr2qs_ctx("Edit Rule","options"),tab); - connect(m_pEditRuleButton,SIGNAL(clicked()),this,SLOT(editNickServRule())); - gl->addWidget(m_pEditRuleButton,2,1); + m_pEditRuleButton = new QPushButton(__tr2qs_ctx("Edit Rule", "options"), tab); + connect(m_pEditRuleButton, SIGNAL(clicked()), this, SLOT(editNickServRule())); + gl->addWidget(m_pEditRuleButton, 2, 1); - m_pDelRuleButton = new QPushButton(__tr2qs_ctx("Delete Rule","options"),tab); - connect(m_pDelRuleButton,SIGNAL(clicked()),this,SLOT(delNickServRule())); - gl->addWidget(m_pDelRuleButton,2,2); + m_pDelRuleButton = new QPushButton(__tr2qs_ctx("Delete Rule", "options"), tab); + connect(m_pDelRuleButton, SIGNAL(clicked()), this, SLOT(delNickServRule())); + gl->addWidget(m_pDelRuleButton, 2, 2); - connect(m_pNickServCheck,SIGNAL(toggled(bool)),this,SLOT(enableDisableNickServControls())); + connect(m_pNickServCheck, SIGNAL(toggled(bool)), this, SLOT(enableDisableNickServControls())); if(rs && rs->rules()) { KviPointerList * ll = rs->rules(); - for(KviNickServRule * rule = ll->first();rule;rule = ll->next()) + for(KviNickServRule * rule = ll->first(); rule; rule = ll->next()) { - QTreeWidgetItem* it = new QTreeWidgetItem(m_pNickServTreeWidget); - it->setText(0,rule->registeredNick()); - it->setText(1,rule->nickServMask()); - it->setText(2,rule->messageRegexp()); - it->setText(3,rule->identifyCommand()); + QTreeWidgetItem * it = new QTreeWidgetItem(m_pNickServTreeWidget); + it->setText(0, rule->registeredNick()); + it->setText(1, rule->nickServMask()); + it->setText(2, rule->messageRegexp()); + it->setText(3, rule->identifyCommand()); } } enableDisableNickServControls(); - gl->setRowStretch(1,1); + gl->setRowStretch(1, 1); - tw->addTab(tab,__tr2qs_ctx("NickServ","options")); + tw->addTab(tab, __tr2qs_ctx("NickServ", "options")); - QPushButton * b = new QPushButton(__tr2qs_ctx("&OK","options"),this); + QPushButton * b = new QPushButton(__tr2qs_ctx("&OK", "options"), this); b->setMinimumWidth(80); - g->addWidget(b,3,2); + g->addWidget(b, 3, 2); b->setDefault(true); - connect(b,SIGNAL(clicked()),this,SLOT(accept())); + connect(b, SIGNAL(clicked()), this, SLOT(accept())); - b = new QPushButton(__tr2qs_ctx("Cancel","options"),this); - g->addWidget(b,3,3); + b = new QPushButton(__tr2qs_ctx("Cancel", "options"), this); + g->addWidget(b, 3, 3); b->setMinimumWidth(80); - connect(b,SIGNAL(clicked()),this,SLOT(reject())); + connect(b, SIGNAL(clicked()), this, SLOT(reject())); - g->setRowStretch(2,1); - g->setColumnStretch(1,1); + g->setRowStretch(2, 1); + g->setColumnStretch(1, 1); tw->setMinimumWidth(375); } - IrcNetworkDetailsWidget::~IrcNetworkDetailsWidget() { - if(m_pOnConnectEditor) KviScriptEditor::destroyInstance(m_pOnConnectEditor); - if(m_pOnLoginEditor) KviScriptEditor::destroyInstance(m_pOnLoginEditor); + if(m_pOnConnectEditor) + KviScriptEditor::destroyInstance(m_pOnConnectEditor); + if(m_pOnLoginEditor) + KviScriptEditor::destroyInstance(m_pOnLoginEditor); } void IrcNetworkDetailsWidget::editNickServRule() { - QTreeWidgetItem * it = (QTreeWidgetItem *) m_pNickServTreeWidget->currentItem(); - if(!it)return; - KviNickServRule r(it->text(0),it->text(1),it->text(2),it->text(3)); - NickServRuleEditor ed(this,false); + QTreeWidgetItem * it = (QTreeWidgetItem *)m_pNickServTreeWidget->currentItem(); + if(!it) + return; + KviNickServRule r(it->text(0), it->text(1), it->text(2), it->text(3)); + NickServRuleEditor ed(this, false); if(ed.editRule(&r)) { - it->setText(0,r.registeredNick()); - it->setText(1,r.nickServMask()); - it->setText(2,r.messageRegexp()); - it->setText(3,r.identifyCommand()); + it->setText(0, r.registeredNick()); + it->setText(1, r.nickServMask()); + it->setText(2, r.messageRegexp()); + it->setText(3, r.identifyCommand()); } } void IrcNetworkDetailsWidget::addNickServRule() { KviNickServRule r; - NickServRuleEditor ed(this,false); + NickServRuleEditor ed(this, false); if(ed.editRule(&r)) { - QTreeWidgetItem *it = new QTreeWidgetItem(m_pNickServTreeWidget); - it->setText(0,r.registeredNick()); - it->setText(1,r.nickServMask()); - it->setText(2,r.messageRegexp()); - it->setText(3,r.identifyCommand()); + QTreeWidgetItem * it = new QTreeWidgetItem(m_pNickServTreeWidget); + it->setText(0, r.registeredNick()); + it->setText(1, r.nickServMask()); + it->setText(2, r.messageRegexp()); + it->setText(3, r.identifyCommand()); } } void IrcNetworkDetailsWidget::delNickServRule() { QTreeWidgetItem * it = (QTreeWidgetItem *)m_pNickServTreeWidget->currentItem(); - if(!it)return; + if(!it) + return; delete it; enableDisableNickServControls(); } @@ -446,7 +457,9 @@ void IrcNetworkDetailsWidget::fillData(KviIrcNetwork * n) if(m_pEncodingEditor->currentIndex() <= 0) { n->setEncoding(QString()); - } else { + } + else + { KviLocale::EncodingDescription * d = KviLocale::instance()->encodingDescription(m_pEncodingEditor->currentIndex() - 1); n->setEncoding(d->pcName); } @@ -457,7 +470,9 @@ void IrcNetworkDetailsWidget::fillData(KviIrcNetwork * n) if(m_pTextEncodingEditor->currentIndex() <= 0) { n->setTextEncoding(QString()); - } else { + } + else + { KviLocale::EncodingDescription * dd = KviLocale::instance()->encodingDescription(m_pTextEncodingEditor->currentIndex() - 1); n->setTextEncoding(dd->pcName); } @@ -466,8 +481,10 @@ void IrcNetworkDetailsWidget::fillData(KviIrcNetwork * n) if(m_pChannelListSelector) m_pChannelListSelector->commit(); - if(m_lstChannels.isEmpty())n->setAutoJoinChannelList(0); - else n->setAutoJoinChannelList(new QStringList(m_lstChannels)); + if(m_lstChannels.isEmpty()) + n->setAutoJoinChannelList(0); + else + n->setAutoJoinChannelList(new QStringList(m_lstChannels)); if(m_pNickServTreeWidget) { @@ -476,13 +493,15 @@ void IrcNetworkDetailsWidget::fillData(KviIrcNetwork * n) KviNickServRuleSet * rs = KviNickServRuleSet::createInstance(); rs->setEnabled(m_pNickServCheck->isChecked()); QTreeWidgetItem * it; - for (int i=0;itopLevelItemCount();i++) + for(int i = 0; i < m_pNickServTreeWidget->topLevelItemCount(); i++) { - it=(QTreeWidgetItem *) m_pNickServTreeWidget->topLevelItem(i); - rs->addRule(KviNickServRule::createInstance(it->text(0),it->text(1),it->text(2),it->text(3))); + it = (QTreeWidgetItem *)m_pNickServTreeWidget->topLevelItem(i); + rs->addRule(KviNickServRule::createInstance(it->text(0), it->text(1), it->text(2), it->text(3))); } n->setNickServRuleSet(rs); - } else n->setNickServRuleSet(0); + } + else + n->setNickServRuleSet(0); } if(m_pOnConnectEditor) @@ -500,9 +519,8 @@ void IrcNetworkDetailsWidget::fillData(KviIrcNetwork * n) } } - -IrcServerDetailsWidget::IrcServerDetailsWidget(QWidget * par,KviIrcServer * s) -: QDialog(par) +IrcServerDetailsWidget::IrcServerDetailsWidget(QWidget * par, KviIrcServer * s) + : QDialog(par) { setModal(true); setObjectName("server_details"); @@ -510,150 +528,157 @@ IrcServerDetailsWidget::IrcServerDetailsWidget(QWidget * par,KviIrcServer * s) m_szHostname = s->hostName(); QGridLayout * g = new QGridLayout(this); - setWindowTitle(__tr2qs_ctx("Server Details and Configuration - KVIrc","options")); + setWindowTitle(__tr2qs_ctx("Server Details and Configuration - KVIrc", "options")); setWindowIcon(QIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Server)))); - m_pHeaderLabel = new QLabel("",this); // the text will be set later + m_pHeaderLabel = new QLabel("", this); // the text will be set later m_pHeaderLabel->setFrameStyle(QFrame::Raised | QFrame::StyledPanel); m_pHeaderLabel->setAlignment(Qt::AlignCenter); - g->addWidget(m_pHeaderLabel,0,0,1,4); + g->addWidget(m_pHeaderLabel, 0, 0, 1, 4); m_pHeaderLabel->setMinimumWidth(200); - QLabel * l = new QLabel(__tr2qs_ctx("Description:","options"),this); - g->addWidget(l,1,0); + QLabel * l = new QLabel(__tr2qs_ctx("Description:", "options"), this); + g->addWidget(l, 1, 0); m_pDescEditor = new QLineEdit(this); - g->addWidget(m_pDescEditor,1,1,1,3); + g->addWidget(m_pDescEditor, 1, 1, 1, 3); m_pDescEditor->setText(s->description()); - KviTalToolTip::add(m_pDescEditor,__tr2qs_ctx("This is a brief description of this server. " \ - "This field has no restrictions but many server lists use it to describe the server's physical location","options")); + KviTalToolTip::add(m_pDescEditor, __tr2qs_ctx("This is a brief description of this server. " + "This field has no restrictions but many server lists use it to describe the server's physical location", + "options")); QTabWidget * tw = new QTabWidget(this); - g->addWidget(tw,2,0,1,4); + g->addWidget(tw, 2, 0, 1, 4); QWidget * tab = new QWidget(tw); QGridLayout * gl = new QGridLayout(tab); - KviTalGroupBox *gbox = new KviTalGroupBox(Qt::Horizontal,__tr2qs_ctx("Properties","options"),tab); - gl->addWidget(gbox,0,0); + KviTalGroupBox * gbox = new KviTalGroupBox(Qt::Horizontal, __tr2qs_ctx("Properties", "options"), tab); + gl->addWidget(gbox, 0, 0); QGridLayout * pPropertiesBoxLayout = new QGridLayout(); gbox->setLayout(pPropertiesBoxLayout); - l = new QLabel(__tr2qs_ctx("Username:","options"),gbox); - pPropertiesBoxLayout->addWidget(l,0,0); + l = new QLabel(__tr2qs_ctx("Username:", "options"), gbox); + pPropertiesBoxLayout->addWidget(l, 0, 0); m_pUserEditor = new QLineEdit(gbox); m_pUserEditor->setText(s->userName()); - pPropertiesBoxLayout->addWidget(m_pUserEditor,0,1); + pPropertiesBoxLayout->addWidget(m_pUserEditor, 0, 1); - KviTalToolTip::add(m_pUserEditor,__tr2qs_ctx("This is the username that KVIrc will use to login to this server.\n" \ - "If this field is left empty (most common case), KVIrc will first look if a username is specified " \ - "for the network that this server belongs to, and if that is empty then KVIrc will use the default username " \ - "specified in the \"Identity\" options tab.","options")); + KviTalToolTip::add(m_pUserEditor, __tr2qs_ctx("This is the username that KVIrc will use to login to this server.\n" + "If this field is left empty (most common case), KVIrc will first look if a username is specified " + "for the network that this server belongs to, and if that is empty then KVIrc will use the default username " + "specified in the \"Identity\" options tab.", + "options")); - l = new QLabel(__tr2qs_ctx("Password:","options"),gbox); - pPropertiesBoxLayout->addWidget(l,1,0); + l = new QLabel(__tr2qs_ctx("Password:", "options"), gbox); + pPropertiesBoxLayout->addWidget(l, 1, 0); m_pPassEditor = new KviPasswordLineEdit(gbox); m_pPassEditor->setText(s->password()); - pPropertiesBoxLayout->addWidget(m_pPassEditor,1,1); + pPropertiesBoxLayout->addWidget(m_pPassEditor, 1, 1); - KviTalToolTip::add(m_pPassEditor,__tr2qs_ctx("If this server requires a password, put it in this field, otherwise leave it empty.","options")); + KviTalToolTip::add(m_pPassEditor, __tr2qs_ctx("If this server requires a password, put it in this field, otherwise leave it empty.", "options")); - l = new QLabel(__tr2qs_ctx("Nickname:","options"),gbox); - pPropertiesBoxLayout->addWidget(l,2,0); + l = new QLabel(__tr2qs_ctx("Nickname:", "options"), gbox); + pPropertiesBoxLayout->addWidget(l, 2, 0); m_pNickEditor = new QLineEdit(gbox); - QValidator * v = new QRegExpValidator(QRegExp("[^-0-9 ][^ ]*"),gbox); + QValidator * v = new QRegExpValidator(QRegExp("[^-0-9 ][^ ]*"), gbox); m_pNickEditor->setValidator(v); m_pNickEditor->setText(s->nickName()); - pPropertiesBoxLayout->addWidget(m_pNickEditor,2,1); + pPropertiesBoxLayout->addWidget(m_pNickEditor, 2, 1); - KviTalToolTip::add(m_pNickEditor,__tr2qs_ctx("You can specify a \"special\" nickname that will be used to log in to this server.
" \ - "If this field is left empty (most common case), KVIrc will first look if a nickname is specified " \ - "for the network that this server belongs to, and if that is empty then the default nickname (specified in the \"Identity\" settings) will be used.","options")); + KviTalToolTip::add(m_pNickEditor, __tr2qs_ctx("You can specify a \"special\" nickname that will be used to log in to this server.
" + "If this field is left empty (most common case), KVIrc will first look if a nickname is specified " + "for the network that this server belongs to, and if that is empty then the default nickname (specified in the \"Identity\" settings) will be used.", + "options")); - l = new QLabel(__tr2qs_ctx("Alt. nickname:","options"),gbox); - pPropertiesBoxLayout->addWidget(l,3,0); + l = new QLabel(__tr2qs_ctx("Alt. nickname:", "options"), gbox); + pPropertiesBoxLayout->addWidget(l, 3, 0); m_pAlternativeNickEditor = new QLineEdit(gbox); - v = new QRegExpValidator(QRegExp("[^-0-9 ][^ ]*"),gbox); + v = new QRegExpValidator(QRegExp("[^-0-9 ][^ ]*"), gbox); m_pAlternativeNickEditor->setValidator(v); m_pAlternativeNickEditor->setText(s->alternativeNickName()); - pPropertiesBoxLayout->addWidget(m_pAlternativeNickEditor,3,1); + pPropertiesBoxLayout->addWidget(m_pAlternativeNickEditor, 3, 1); - KviTalToolTip::add(m_pAlternativeNickEditor,__tr2qs_ctx("This nickname will be tried if the primary nickname for this server is already in use.
" \ - "If you leave it empty then the default nicknames specified in the identity options will be tried instead.","options")); + KviTalToolTip::add(m_pAlternativeNickEditor, __tr2qs_ctx("This nickname will be tried if the primary nickname for this server is already in use.
" + "If you leave it empty then the default nicknames specified in the identity options will be tried instead.", + "options")); - l = new QLabel(__tr2qs_ctx("Real name:","options"),gbox); - pPropertiesBoxLayout->addWidget(l,4,0); + l = new QLabel(__tr2qs_ctx("Real name:", "options"), gbox); + pPropertiesBoxLayout->addWidget(l, 4, 0); m_pRealEditor = new QLineEdit(gbox); m_pRealEditor->setText(s->realName()); - pPropertiesBoxLayout->addWidget(m_pRealEditor,4,1); + pPropertiesBoxLayout->addWidget(m_pRealEditor, 4, 1); - KviTalToolTip::add(m_pRealEditor,__tr2qs_ctx("You can specify a \"special\" real name that will be used to login with this server.
" \ - "If you leave this field empty (most common case), KVIrc will first look if a real name is specified " \ - "for the network that this server belongs to, and if that is empty the default \"real name\" (specified in the \"Identity\" settings) will be used.","options")); + KviTalToolTip::add(m_pRealEditor, __tr2qs_ctx("You can specify a \"special\" real name that will be used to login with this server.
" + "If you leave this field empty (most common case), KVIrc will first look if a real name is specified " + "for the network that this server belongs to, and if that is empty the default \"real name\" (specified in the \"Identity\" settings) will be used.", + "options")); - gbox = new KviTalGroupBox(Qt::Horizontal,__tr2qs_ctx("User Mode","options"),tab); - gl->addWidget(gbox,1,0); + gbox = new KviTalGroupBox(Qt::Horizontal, __tr2qs_ctx("User Mode", "options"), tab); + gl->addWidget(gbox, 1, 0); - m_pUseDefaultInitUMode = new QCheckBox(__tr2qs_ctx("Use default user mode","options"),gbox); - KviTalToolTip::add(m_pUseDefaultInitUMode,__tr2qs_ctx("If this is enabled, the global initial user mode (configured from" \ - " the identity dialog) will be used. If disabled, you can configure an initial user mode for this server","options")); + m_pUseDefaultInitUMode = new QCheckBox(__tr2qs_ctx("Use default user mode", "options"), gbox); + KviTalToolTip::add(m_pUseDefaultInitUMode, __tr2qs_ctx("If this is enabled, the global initial user mode (configured from" + " the identity dialog) will be used. If disabled, you can configure an initial user mode for this server", + "options")); bool bHasUmode = !(s->initUMode().isEmpty()); KviCString szDefUMode = KVI_OPTION_STRING(KviOption_stringDefaultUserMode); m_pUseDefaultInitUMode->setChecked(!bHasUmode); - connect(m_pUseDefaultInitUMode,SIGNAL(toggled(bool)),this,SLOT(useDefaultInitUModeToggled(bool))); + connect(m_pUseDefaultInitUMode, SIGNAL(toggled(bool)), this, SLOT(useDefaultInitUModeToggled(bool))); - m_pIMode = new QCheckBox(__tr2qs_ctx("Invisible (+i)","options"),gbox); + m_pIMode = new QCheckBox(__tr2qs_ctx("Invisible (+i)", "options"), gbox); m_pIMode->setEnabled(bHasUmode); - m_pIMode->setChecked(bHasUmode ? bool(s->initUMode().contains('i',Qt::CaseInsensitive)) : bool(szDefUMode.contains('i',Qt::CaseInsensitive))); + m_pIMode->setChecked(bHasUmode ? bool(s->initUMode().contains('i', Qt::CaseInsensitive)) : bool(szDefUMode.contains('i', Qt::CaseInsensitive))); - m_pSMode = new QCheckBox(__tr2qs_ctx("Server notices (+s)","options"),gbox); + m_pSMode = new QCheckBox(__tr2qs_ctx("Server notices (+s)", "options"), gbox); m_pSMode->setEnabled(bHasUmode); - m_pSMode->setChecked(bHasUmode ? bool(s->initUMode().contains('s',Qt::CaseInsensitive)) : bool(szDefUMode.contains('s',Qt::CaseInsensitive))); + m_pSMode->setChecked(bHasUmode ? bool(s->initUMode().contains('s', Qt::CaseInsensitive)) : bool(szDefUMode.contains('s', Qt::CaseInsensitive))); - m_pWMode = new QCheckBox(__tr2qs_ctx("WALLOPS (+w)","options"),gbox); + m_pWMode = new QCheckBox(__tr2qs_ctx("WALLOPS (+w)", "options"), gbox); m_pWMode->setEnabled(bHasUmode); - m_pWMode->setChecked(bHasUmode ? bool(s->initUMode().contains('w',Qt::CaseInsensitive)) : bool(szDefUMode.contains('w',Qt::CaseInsensitive))); + m_pWMode->setChecked(bHasUmode ? bool(s->initUMode().contains('w', Qt::CaseInsensitive)) : bool(szDefUMode.contains('w', Qt::CaseInsensitive))); - l = new QLabel("",tab); - gl->addWidget(l,2,0); + l = new QLabel("", tab); + gl->addWidget(l, 2, 0); - gl->setRowStretch(2,1); + gl->setRowStretch(2, 1); - tw->addTab(tab,*(g_pIconManager->getSmallIcon(KviIconManager::Ident)),__tr2qs_ctx("Identity","options")); + tw->addTab(tab, *(g_pIconManager->getSmallIcon(KviIconManager::Ident)), __tr2qs_ctx("Identity", "options")); int iRow = 0; tab = new QWidget(tw); gl = new QGridLayout(tab); - l = new QLabel(__tr2qs_ctx("Port:","options"),tab); - gl->addWidget(l,iRow,0); + l = new QLabel(__tr2qs_ctx("Port:", "options"), tab); + gl->addWidget(l, iRow, 0); m_pPortEditor = new QLineEdit(tab); - gl->addWidget(m_pPortEditor,iRow,1); + gl->addWidget(m_pPortEditor, iRow, 1); QString tmpz; tmpz.setNum(s->port()); m_pPortEditor->setText(tmpz); - KviTalToolTip::add(m_pPortEditor,__tr2qs_ctx("This is the default port that this server will be contacted on.
Usually 6667 is OK.","options")); - connect(m_pPortEditor,SIGNAL(textChanged(const QString &)),this,SLOT(portEditorTextChanged(const QString &))); + KviTalToolTip::add(m_pPortEditor, __tr2qs_ctx("This is the default port that this server will be contacted on.
Usually 6667 is OK.", "options")); + connect(m_pPortEditor, SIGNAL(textChanged(const QString &)), this, SLOT(portEditorTextChanged(const QString &))); iRow++; - l = new QLabel(__tr2qs_ctx("IP address:","options"),tab); - gl->addWidget(l,iRow,0); - m_pIpEditor = new KviIpEditor(tab,KviIpEditor::IPv4); - gl->addWidget(m_pIpEditor,iRow,1); - KviTalToolTip::add(m_pIpEditor,__tr2qs_ctx("This is the IP address of this server, it is here for caching purposes.
" \ - "If you leave this field empty, KVIrc will fill it in the first time it connects to the server. " \ - "If you enable the \"cache IP address\" option below, KVIrc will use it as a \"cached result\" " \ - "and avoid looking it up again.","options")); + l = new QLabel(__tr2qs_ctx("IP address:", "options"), tab); + gl->addWidget(l, iRow, 0); + m_pIpEditor = new KviIpEditor(tab, KviIpEditor::IPv4); + gl->addWidget(m_pIpEditor, iRow, 1); + KviTalToolTip::add(m_pIpEditor, __tr2qs_ctx("This is the IP address of this server, it is here for caching purposes.
" + "If you leave this field empty, KVIrc will fill it in the first time it connects to the server. " + "If you enable the \"cache IP address\" option below, KVIrc will use it as a \"cached result\" " + "and avoid looking it up again.", + "options")); #ifdef COMPILE_IPV6_SUPPORT m_pIpEditor->setAddressType(s->isIPv6() ? KviIpEditor::IPv6 : KviIpEditor::IPv4); #else @@ -672,89 +697,94 @@ IrcServerDetailsWidget::IrcServerDetailsWidget(QWidget * par,KviIrcServer * s) iRow++; QGridLayout * pCheckBoxLayout = new QGridLayout(); - gl->addLayout(pCheckBoxLayout,iRow,0,1,2); + gl->addLayout(pCheckBoxLayout, iRow, 0, 1, 2); - m_pCacheIpCheck = new QCheckBox(__tr2qs_ctx("Cache IP address","options"),tab); - pCheckBoxLayout->addWidget(m_pCacheIpCheck,0,0); + m_pCacheIpCheck = new QCheckBox(__tr2qs_ctx("Cache IP address", "options"), tab); + pCheckBoxLayout->addWidget(m_pCacheIpCheck, 0, 0); - KviTalToolTip::add(m_pCacheIpCheck,__tr2qs_ctx("This check will enable IP address caching for this server:
" \ - "DNS lookups can be time-consuming and might be blocking on some platforms; " \ - "this option will cause KVIrc to look up the server hostname only once.

" \ - "Advanced: you can also use this option to force a certain server name to resolve " \ - "to a fixed IP address when either the DNS for that server is temporarily " \ - "unreachable or you want to avoid the round-robin lookups.","options")); + KviTalToolTip::add(m_pCacheIpCheck, __tr2qs_ctx("This check will enable IP address caching for this server:
" + "DNS lookups can be time-consuming and might be blocking on some platforms; " + "this option will cause KVIrc to look up the server hostname only once.

" + "Advanced: you can also use this option to force a certain server name to resolve " + "to a fixed IP address when either the DNS for that server is temporarily " + "unreachable or you want to avoid the round-robin lookups.", + "options")); m_pCacheIpCheck->setChecked(s->cacheIp()); - m_pUseAutoConnect = new QCheckBox(__tr2qs_ctx("Connect to this server at startup","options"),tab); + m_pUseAutoConnect = new QCheckBox(__tr2qs_ctx("Connect to this server at startup", "options"), tab); m_pUseAutoConnect->setChecked(s->autoConnect()); - pCheckBoxLayout->addWidget(m_pUseAutoConnect,0,1); + pCheckBoxLayout->addWidget(m_pUseAutoConnect, 0, 1); - KviTalToolTip::add(m_pUseAutoConnect,__tr2qs_ctx("This option will cause KVIrc to connect to the IRC server when it is started.","options")); + KviTalToolTip::add(m_pUseAutoConnect, __tr2qs_ctx("This option will cause KVIrc to connect to the IRC server when it is started.", "options")); - m_pUseIPV6Check = new QCheckBox(__tr2qs_ctx("Use IPv6 protocol","options"),tab); - pCheckBoxLayout->addWidget(m_pUseIPV6Check,1,0); + m_pUseIPV6Check = new QCheckBox(__tr2qs_ctx("Use IPv6 protocol", "options"), tab); + pCheckBoxLayout->addWidget(m_pUseIPV6Check, 1, 0); #ifdef COMPILE_IPV6_SUPPORT m_pUseIPV6Check->setChecked(s->isIPv6()); - connect(m_pUseIPV6Check,SIGNAL(toggled(bool)),this,SLOT(useIPV6CheckToggled(bool))); + connect(m_pUseIPV6Check, SIGNAL(toggled(bool)), this, SLOT(useIPV6CheckToggled(bool))); #else m_pUseIPV6Check->setEnabled(false); #endif - KviTalToolTip::add(m_pUseIPV6Check,__tr2qs_ctx("This check identifies IPv6 servers.
If enabled, KVIrc will attempt to use the IPv6 protocol " \ - "(thus your OS must have a working IPv6 stack and you must have an IPv6 connection).","options")); + KviTalToolTip::add(m_pUseIPV6Check, __tr2qs_ctx("This check identifies IPv6 servers.
If enabled, KVIrc will attempt to use the IPv6 protocol " + "(thus your OS must have a working IPv6 stack and you must have an IPv6 connection).", + "options")); - m_pUseSSLCheck = new QCheckBox(__tr2qs_ctx("Use SSL protocol","options"),tab); - pCheckBoxLayout->addWidget(m_pUseSSLCheck,1,1); + m_pUseSSLCheck = new QCheckBox(__tr2qs_ctx("Use SSL protocol", "options"), tab); + pCheckBoxLayout->addWidget(m_pUseSSLCheck, 1, 1); - KviTalToolTip::add(m_pUseSSLCheck,__tr2qs_ctx("This check will cause the connection to use the Secure Socket Layer " \ - "encryption support. Obviously, this server must have support for this, too. :)","options")); + KviTalToolTip::add(m_pUseSSLCheck, __tr2qs_ctx("This check will cause the connection to use the Secure Socket Layer " + "encryption support. Obviously, this server must have support for this, too. :)", + "options")); #ifdef COMPILE_SSL_SUPPORT m_pUseSSLCheck->setChecked(s->useSSL()); - connect(m_pUseSSLCheck,SIGNAL(toggled(bool)),this,SLOT(useSSLCheckToggled(bool))); + connect(m_pUseSSLCheck, SIGNAL(toggled(bool)), this, SLOT(useSSLCheckToggled(bool))); #else m_pUseSSLCheck->setEnabled(false); #endif iRow++; - l = new QLabel(__tr2qs_ctx("Protocol encoding:","options"),tab); - gl->addWidget(l,iRow,0); + l = new QLabel(__tr2qs_ctx("Protocol encoding:", "options"), tab); + gl->addWidget(l, iRow, 0); m_pEncodingEditor = new QComboBox(tab); m_pEncodingEditor->setDuplicatesEnabled(false); - gl->addWidget(m_pEncodingEditor,iRow,1); - KviTalToolTip::add(m_pEncodingEditor,__tr2qs_ctx("This box allows you to choose the preferred encoding for this server. " \ - "This encoding will be used for server specific needs, like referencing nicknames and channel names.
" \ - "If you choose \"Use Network Encoding\" then the encoding will be inherited from the " \ - "network that this server belongs to.","options")); + gl->addWidget(m_pEncodingEditor, iRow, 1); + KviTalToolTip::add(m_pEncodingEditor, __tr2qs_ctx("This box allows you to choose the preferred encoding for this server. " + "This encoding will be used for server specific needs, like referencing nicknames and channel names.
" + "If you choose \"Use Network Encoding\" then the encoding will be inherited from the " + "network that this server belongs to.", + "options")); iRow++; - l = new QLabel(__tr2qs_ctx("Text encoding:","options"),tab); - gl->addWidget(l,iRow,0); + l = new QLabel(__tr2qs_ctx("Text encoding:", "options"), tab); + gl->addWidget(l, iRow, 0); m_pTextEncodingEditor = new QComboBox(tab); m_pTextEncodingEditor->setDuplicatesEnabled(false); - gl->addWidget(m_pTextEncodingEditor,iRow,1); - KviTalToolTip::add(m_pTextEncodingEditor,__tr2qs_ctx("This box allows you to choose the preferred encoding for this server. " \ - "This will be used as the default encoding for all text messages.
" \ - "If you choose \"Use Network Encoding\" then the encoding will be inherited from the " \ - "network that this server belongs to.","options")); + gl->addWidget(m_pTextEncodingEditor, iRow, 1); + KviTalToolTip::add(m_pTextEncodingEditor, __tr2qs_ctx("This box allows you to choose the preferred encoding for this server. " + "This will be used as the default encoding for all text messages.
" + "If you choose \"Use Network Encoding\" then the encoding will be inherited from the " + "network that this server belongs to.", + "options")); int i = 0; - int srvcurrent = 0, txtcurrent=0; + int srvcurrent = 0, txtcurrent = 0; KviLocale::EncodingDescription * d = KviLocale::instance()->encodingDescription(i); QString tmp; - m_pEncodingEditor->addItem(__tr2qs_ctx("Use Network Encoding","options")); - m_pTextEncodingEditor->addItem(__tr2qs_ctx("Use Network Encoding","options")); + m_pEncodingEditor->addItem(__tr2qs_ctx("Use Network Encoding", "options")); + m_pTextEncodingEditor->addItem(__tr2qs_ctx("Use Network Encoding", "options")); while(d->pcName) { - tmp = QString("%1 (%2)").arg(d->pcName,d->pcDescription); - m_pEncodingEditor->insertItem(m_pEncodingEditor->count(),tmp); - m_pTextEncodingEditor->insertItem(m_pTextEncodingEditor->count(),tmp); - if(KviQString::equalCI(d->pcName,s->encoding())) + tmp = QString("%1 (%2)").arg(d->pcName, d->pcDescription); + m_pEncodingEditor->insertItem(m_pEncodingEditor->count(), tmp); + m_pTextEncodingEditor->insertItem(m_pTextEncodingEditor->count(), tmp); + if(KviQString::equalCI(d->pcName, s->encoding())) srvcurrent = i + 1; - if(KviQString::equalCI(d->pcName,s->textEncoding())) + if(KviQString::equalCI(d->pcName, s->textEncoding())) txtcurrent = i + 1; i = i + 1; d = KviLocale::instance()->encodingDescription(i); @@ -765,36 +795,37 @@ IrcServerDetailsWidget::IrcServerDetailsWidget(QWidget * par,KviIrcServer * s) iRow++; - l = new QLabel(__tr2qs_ctx("Proxy server:","options"),tab); - gl->addWidget(l,iRow,0); + l = new QLabel(__tr2qs_ctx("Proxy server:", "options"), tab); + gl->addWidget(l, iRow, 0); m_pProxyEditor = new QComboBox(tab); - gl->addWidget(m_pProxyEditor,iRow,1); - KviTalToolTip::add(m_pProxyEditor,__tr2qs_ctx("Defines the connection type that KVIrc should use to connect to this server.
" \ - "When it's set to *Default* KVIrc will use the global proxy settings, when it's set to *Direct Connection* " \ - "KVIrc will connect directly without using a proxy, or select a desired proxy you have previously added
" \ - "You can define or edit new proxy servers in *General Preferences* / *Connection* tab' \"Proxy hosts\" dialog.","options")); + gl->addWidget(m_pProxyEditor, iRow, 1); + KviTalToolTip::add(m_pProxyEditor, __tr2qs_ctx("Defines the connection type that KVIrc should use to connect to this server.
" + "When it's set to *Default* KVIrc will use the global proxy settings, when it's set to *Direct Connection* " + "KVIrc will connect directly without using a proxy, or select a desired proxy you have previously added
" + "You can define or edit new proxy servers in *General Preferences* / *Connection* tab' \"Proxy hosts\" dialog.", + "options")); - m_pProxyEditor->addItem(__tr2qs_ctx("Default","options")); - m_pProxyEditor->addItem(__tr2qs_ctx("Direct Connection","options")); + m_pProxyEditor->addItem(__tr2qs_ctx("Default", "options")); + m_pProxyEditor->addItem(__tr2qs_ctx("Direct Connection", "options")); KviPointerList * proxylist = g_pProxyDataBase->proxyList(); - for(KviProxy * p = proxylist->first();p;p = proxylist->next()) + for(KviProxy * p = proxylist->first(); p; p = proxylist->next()) { - m_pProxyEditor->insertItem(m_pProxyEditor->count(),QString("%1:%2").arg(p->hostName()).arg(p->port())); + m_pProxyEditor->insertItem(m_pProxyEditor->count(), QString("%1:%2").arg(p->hostName()).arg(p->port())); } - if(m_pProxyEditor->count() > (s->proxy()+2)) - m_pProxyEditor->setCurrentIndex(s->proxy()+2); + if(m_pProxyEditor->count() > (s->proxy() + 2)) + m_pProxyEditor->setCurrentIndex(s->proxy() + 2); iRow++; - l = new QLabel("",tab); - gl->addWidget(l,iRow,0,1,2); + l = new QLabel("", tab); + gl->addWidget(l, iRow, 0, 1, 2); - gl->setRowStretch(iRow,1); + gl->setRowStretch(iRow, 1); - tw->addTab(tab,*(g_pIconManager->getSmallIcon(KviIconManager::Socket)),__tr2qs_ctx("Connection","options")); + tw->addTab(tab, *(g_pIconManager->getSmallIcon(KviIconManager::Socket)), __tr2qs_ctx("Connection", "options")); tab = new QWidget(tw); @@ -802,55 +833,59 @@ IrcServerDetailsWidget::IrcServerDetailsWidget(QWidget * par,KviIrcServer * s) if(s->autoJoinChannelList()) m_lstChannels = *(s->autoJoinChannelList()); - m_pChannelListSelector = new KviChannelListSelector(tab,__tr2qs_ctx("Channels to Join Automatically upon Connect","options"),&m_lstChannels,true); - KviTalToolTip::add(m_pChannelListSelector,__tr2qs_ctx("Here you can set a list of channels to be joined automatically " \ - "after a connection to this server has been established. To add a channel, type its name in the " \ - "text input below and click \"Add\".","options")); + m_pChannelListSelector = new KviChannelListSelector(tab, __tr2qs_ctx("Channels to Join Automatically upon Connect", "options"), &m_lstChannels, true); + KviTalToolTip::add(m_pChannelListSelector, __tr2qs_ctx("Here you can set a list of channels to be joined automatically " + "after a connection to this server has been established. To add a channel, type its name in the " + "text input below and click \"Add\".", + "options")); - gl->addWidget(m_pChannelListSelector,0,0); + gl->addWidget(m_pChannelListSelector, 0, 0); - tw->addTab(tab,*(g_pIconManager->getSmallIcon(KviIconManager::Channel)),__tr2qs_ctx("Join Channels","options")); + tw->addTab(tab, *(g_pIconManager->getSmallIcon(KviIconManager::Channel)), __tr2qs_ctx("Join Channels", "options")); tab = new QWidget(tw); gl = new QGridLayout(tab); m_pOnConnectEditor = KviScriptEditor::createInstance(tab); - gl->addWidget(m_pOnConnectEditor,0,0); + gl->addWidget(m_pOnConnectEditor, 0, 0); m_pOnConnectEditor->setText(s->onConnectCommand()); m_pOnConnectEditor->setMinimumHeight(150); - KviTalToolTip::add(m_pOnConnectEditor,__tr2qs_ctx("The following commands will be executed after a connection has been established.
" \ - "Important: Enter commands without a preceding slash (e.g. quote pass secret instead of /quote pass secret).
"\ - "KVIrc will first send the USER command, then eventually PASS and NICK and then execute this " \ - "command sequence.
This is particularly useful for IRC bouncers that require login commands.","options")); + KviTalToolTip::add(m_pOnConnectEditor, __tr2qs_ctx("The following commands will be executed after a connection has been established.
" + "Important: Enter commands without a preceding slash (e.g. quote pass secret instead of /quote pass secret).
" + "KVIrc will first send the USER command, then eventually PASS and NICK and then execute this " + "command sequence.
This is particularly useful for IRC bouncers that require login commands.", + "options")); - tw->addTab(tab,__tr2qs_ctx("On Connect","options")); + tw->addTab(tab, __tr2qs_ctx("On Connect", "options")); tab = new QWidget(tw); gl = new QGridLayout(tab); m_pOnLoginEditor = KviScriptEditor::createInstance(tab); - gl->addWidget(m_pOnLoginEditor,0,0); + gl->addWidget(m_pOnLoginEditor, 0, 0); m_pOnLoginEditor->setText(s->onLoginCommand()); m_pOnLoginEditor->setMinimumHeight(150); - KviTalToolTip::add(m_pOnLoginEditor,__tr2qs_ctx("The following commands will be executed after a successful login to this server.
" \ - "Important: Enter commands without a preceding slash (e.g. quote privatelog instead of /quote privatelog).
" - "This is useful for automatically opening queries, setting variables, etc.","options")); + KviTalToolTip::add(m_pOnLoginEditor, __tr2qs_ctx("The following commands will be executed after a successful login to this server.
" + "Important: Enter commands without a preceding slash (e.g. quote privatelog instead of /quote privatelog).
" + "This is useful for automatically opening queries, setting variables, etc.", + "options")); - tw->addTab(tab,__tr2qs_ctx("On Login","options")); + tw->addTab(tab, __tr2qs_ctx("On Login", "options")); tab = new QWidget(tw); gl = new QGridLayout(tab); iRow = 0; - m_pEnableSTARTTLSCheck = new QCheckBox(__tr2qs_ctx("Switch to SSL/TLS by using the STARTTLS extension","options"),tab); - gl->addWidget(m_pEnableSTARTTLSCheck,iRow,0,1,2); - KviTalToolTip::add(m_pEnableSTARTTLSCheck,__tr2qs_ctx("This check enables the use of the Transport Layer Security " \ - "protocol. If you enable the Extended Capabilities below then the TLS protocol support will be detected by using " \ - "a CAP LS command. Without \"Extended Capabilities\" the STARTTLS command will be forcibly sent at the beginning of the " \ - "connection.","options")); + m_pEnableSTARTTLSCheck = new QCheckBox(__tr2qs_ctx("Switch to SSL/TLS by using the STARTTLS extension", "options"), tab); + gl->addWidget(m_pEnableSTARTTLSCheck, iRow, 0, 1, 2); + KviTalToolTip::add(m_pEnableSTARTTLSCheck, __tr2qs_ctx("This check enables the use of the Transport Layer Security " + "protocol. If you enable the Extended Capabilities below then the TLS protocol support will be detected by using " + "a CAP LS command. Without \"Extended Capabilities\" the STARTTLS command will be forcibly sent at the beginning of the " + "connection.", + "options")); #ifndef COMPILE_SSL_SUPPORT m_pEnableSTARTTLSCheck->setEnabled(false); #endif @@ -858,56 +893,57 @@ IrcServerDetailsWidget::IrcServerDetailsWidget(QWidget * par,KviIrcServer * s) iRow++; - QGroupBox * pCapGroup = new QGroupBox(__tr2qs_ctx("Extended Capabilities","options"),tab); - gl->addWidget(pCapGroup,iRow,0,1,2); + QGroupBox * pCapGroup = new QGroupBox(__tr2qs_ctx("Extended Capabilities", "options"), tab); + gl->addWidget(pCapGroup, iRow, 0, 1, 2); QGridLayout * pCapLayout = new QGridLayout(); pCapGroup->setLayout(pCapLayout); - m_pEnableCAPCheck = new QCheckBox(__tr2qs_ctx("Query extended capabilities on connect","options"),tab); - pCapLayout->addWidget(m_pEnableCAPCheck,0,0); + m_pEnableCAPCheck = new QCheckBox(__tr2qs_ctx("Query extended capabilities on connect", "options"), tab); + pCapLayout->addWidget(m_pEnableCAPCheck, 0, 0); - KviTalToolTip::add(m_pEnableCAPCheck,__tr2qs_ctx("This check will cause the connection to use the Extended Capability support.","options")); + KviTalToolTip::add(m_pEnableCAPCheck, __tr2qs_ctx("This check will cause the connection to use the Extended Capability support.", "options")); m_pEnableCAPCheck->setChecked(s->enabledCAP()); - QGroupBox * pSASLGroup = new QGroupBox(__tr2qs_ctx("SASL Authentication","options"),tab); - pCapLayout->addWidget(pSASLGroup,2,0); + QGroupBox * pSASLGroup = new QGroupBox(__tr2qs_ctx("SASL Authentication", "options"), tab); + pCapLayout->addWidget(pSASLGroup, 2, 0); QGridLayout * pSASLLayout = new QGridLayout(pSASLGroup); - m_pEnableSASLCheck = new QCheckBox(__tr2qs_ctx("Authenticate via SASL extension","options"),pSASLGroup); - pSASLLayout->addWidget(m_pEnableSASLCheck,0,0,1,2); - KviTalToolTip::add(m_pEnableSASLCheck,__tr2qs_ctx("This check enables the use of the SASL authentication protocol " \ - "If you enable the proper global option in the Connection/SSL tab and fill the SASL nickname and SASL " \ - "password fields in this page, the SASL protocol will be used for this server if available.","options")); + m_pEnableSASLCheck = new QCheckBox(__tr2qs_ctx("Authenticate via SASL extension", "options"), pSASLGroup); + pSASLLayout->addWidget(m_pEnableSASLCheck, 0, 0, 1, 2); + KviTalToolTip::add(m_pEnableSASLCheck, __tr2qs_ctx("This check enables the use of the SASL authentication protocol " + "If you enable the proper global option in the Connection/SSL tab and fill the SASL nickname and SASL " + "password fields in this page, the SASL protocol will be used for this server if available.", + "options")); m_pEnableSASLCheck->setChecked(s->enabledSASL()); - l = new QLabel(__tr2qs_ctx("SASL nickname:","options"),pSASLGroup); - pSASLLayout->addWidget(l,1,0); + l = new QLabel(__tr2qs_ctx("SASL nickname:", "options"), pSASLGroup); + pSASLLayout->addWidget(l, 1, 0); m_pSaslNickEditor = new QLineEdit(pSASLGroup); m_pSaslNickEditor->setText(s->saslNick()); - KviTalToolTip::add(m_pSaslNickEditor,__tr2qs_ctx("If you want to enable SASL authentication, insert your nickname here.","options")); - pSASLLayout->addWidget(m_pSaslNickEditor,1,1); + KviTalToolTip::add(m_pSaslNickEditor, __tr2qs_ctx("If you want to enable SASL authentication, insert your nickname here.", "options")); + pSASLLayout->addWidget(m_pSaslNickEditor, 1, 1); - l = new QLabel(__tr2qs_ctx("SASL password:","options"),pSASLGroup); - pSASLLayout->addWidget(l,2,0); + l = new QLabel(__tr2qs_ctx("SASL password:", "options"), pSASLGroup); + pSASLLayout->addWidget(l, 2, 0); m_pSaslPassEditor = new KviPasswordLineEdit(pSASLGroup); // <---- ????? m_pSaslPassEditor->setText(s->saslPass()); - KviTalToolTip::add(m_pSaslPassEditor,__tr2qs_ctx("If you want to enable SASL authentication, insert your password here.","options")); - pSASLLayout->addWidget(m_pSaslPassEditor,2,1); + KviTalToolTip::add(m_pSaslPassEditor, __tr2qs_ctx("If you want to enable SASL authentication, insert your password here.", "options")); + pSASLLayout->addWidget(m_pSaslPassEditor, 2, 1); pSASLGroup->setEnabled(s->enabledCAP()); - connect(m_pEnableCAPCheck,SIGNAL(toggled(bool)),pSASLGroup,SLOT(setEnabled(bool))); + connect(m_pEnableCAPCheck, SIGNAL(toggled(bool)), pSASLGroup, SLOT(setEnabled(bool))); iRow++; - l = new QLabel(__tr2qs_ctx("Link filter:","options"),tab); - gl->addWidget(l,iRow,0); + l = new QLabel(__tr2qs_ctx("Link filter:", "options"), tab); + gl->addWidget(l, iRow, 0); m_pLinkFilterEditor = new QComboBox(tab); m_pLinkFilterEditor->setEditable(true); m_pLinkFilterEditor->setDuplicatesEnabled(false); - gl->addWidget(m_pLinkFilterEditor,iRow,1); + gl->addWidget(m_pLinkFilterEditor, iRow, 1); m_pLinkFilterEditor->addItem(""); @@ -916,9 +952,11 @@ IrcServerDetailsWidget::IrcServerDetailsWidget(QWidget * par,KviIrcServer * s) if(mexl) { - for(KviModuleExtensionDescriptor * d = mexl->first();d;d = mexl->next()) + for(KviModuleExtensionDescriptor * d = mexl->first(); d; d = mexl->next()) m_pLinkFilterEditor->addItem(d->name().ptr()); - } else { + } + else + { if(!s->linkFilter().isEmpty()) m_pLinkFilterEditor->addItem(s->linkFilter()); } @@ -926,7 +964,7 @@ IrcServerDetailsWidget::IrcServerDetailsWidget(QWidget * par,KviIrcServer * s) if(!s->linkFilter().isEmpty()) { int i = m_pLinkFilterEditor->findText(s->linkFilter()); - if (i != -1) + if(i != -1) m_pLinkFilterEditor->setCurrentIndex(i); else m_pLinkFilterEditor->setEditText(s->linkFilter()); @@ -934,50 +972,55 @@ IrcServerDetailsWidget::IrcServerDetailsWidget(QWidget * par,KviIrcServer * s) else m_pLinkFilterEditor->setCurrentIndex(0); - KviTalToolTip::add(m_pLinkFilterEditor,__tr2qs_ctx("This field specifies the name of a module that exports a link filter for this type of server.
" \ - "For plain IRC connections, you don't need any link filters; this is used for incompatible protocols.","options")); + KviTalToolTip::add(m_pLinkFilterEditor, __tr2qs_ctx("This field specifies the name of a module that exports a link filter for this type of server.
" + "For plain IRC connections, you don't need any link filters; this is used for incompatible protocols.", + "options")); iRow++; - l = new QLabel(__tr2qs_ctx("ID:","options"),tab); - gl->addWidget(l,iRow,0); + l = new QLabel(__tr2qs_ctx("ID:", "options"), tab); + gl->addWidget(l, iRow, 0); m_pIdEditor = new QLineEdit(tab); - if(s->id().isEmpty())s->generateUniqueId(); + if(s->id().isEmpty()) + s->generateUniqueId(); m_pIdEditor->setText(s->id()); - gl->addWidget(m_pIdEditor,iRow,1); + gl->addWidget(m_pIdEditor, iRow, 1); - KviTalToolTip::add(m_pIdEditor,__tr2qs_ctx("This field allows you to specify a really unique ID for this server. " \ - "You will then be able to use /server -x <this_id> to make the connection. This is especially " \ - "useful when you have multiple server entries with the same hostname and port in different networks (bouncers?)","options")); + KviTalToolTip::add(m_pIdEditor, __tr2qs_ctx("This field allows you to specify a really unique ID for this server. " + "You will then be able to use /server -x <this_id> to make the connection. This is especially " + "useful when you have multiple server entries with the same hostname and port in different networks (bouncers?)", + "options")); iRow++; - tw->addTab(tab,__tr2qs_ctx("Advanced","options")); + tw->addTab(tab, __tr2qs_ctx("Advanced", "options")); // Placeholder for NickServ options (text with redirect to network settings) tab = new QWidget(tw); gl = new QGridLayout(tab); iRow = 0; - l = new QLabel(__tr2qs_ctx("NickServ settings are available only for the whole IRC network, not for specific servers.\n" \ - "To open network settings choose a network (with a globe) in list of networks and servers and click Advanced.","options"),tab); - gl->addWidget(l,iRow,0); - gl->setRowStretch(1,1); + l = new QLabel(__tr2qs_ctx("NickServ settings are available only for the whole IRC network, not for specific servers.\n" + "To open network settings choose a network (with a globe) in list of networks and servers and click Advanced.", + "options"), + tab); + gl->addWidget(l, iRow, 0); + gl->setRowStretch(1, 1); - tw->addTab(tab,__tr2qs_ctx("NickServ","options")); + tw->addTab(tab, __tr2qs_ctx("NickServ", "options")); - QPushButton * b = new QPushButton(__tr2qs_ctx("OK","options"),this); + QPushButton * b = new QPushButton(__tr2qs_ctx("OK", "options"), this); b->setMinimumWidth(80); - g->addWidget(b,3,2); + g->addWidget(b, 3, 2); b->setDefault(true); - connect(b,SIGNAL(clicked()),this,SLOT(accept())); + connect(b, SIGNAL(clicked()), this, SLOT(accept())); - b = new QPushButton(__tr2qs_ctx("Cancel","options"),this); - g->addWidget(b,3,3); + b = new QPushButton(__tr2qs_ctx("Cancel", "options"), this); + g->addWidget(b, 3, 3); b->setMinimumWidth(80); - connect(b,SIGNAL(clicked()),this,SLOT(reject())); + connect(b, SIGNAL(clicked()), this, SLOT(reject())); - g->setRowStretch(2,1); - g->setColumnStretch(1,1); + g->setRowStretch(2, 1); + g->setColumnStretch(1, 1); tw->setMinimumWidth(390); @@ -986,8 +1029,10 @@ IrcServerDetailsWidget::IrcServerDetailsWidget(QWidget * par,KviIrcServer * s) IrcServerDetailsWidget::~IrcServerDetailsWidget() { - if(m_pOnConnectEditor) KviScriptEditor::destroyInstance(m_pOnConnectEditor); - if(m_pOnLoginEditor) KviScriptEditor::destroyInstance(m_pOnLoginEditor); + if(m_pOnConnectEditor) + KviScriptEditor::destroyInstance(m_pOnConnectEditor); + if(m_pOnLoginEditor) + KviScriptEditor::destroyInstance(m_pOnLoginEditor); } void IrcServerDetailsWidget::useIPV6CheckToggled(bool) @@ -1013,8 +1058,10 @@ void IrcServerDetailsWidget::portEditorTextChanged(const QString &) void IrcServerDetailsWidget::setHeaderLabelText() { QString szTmp = "irc"; - if(m_pUseSSLCheck->isChecked())szTmp += "s"; - if(m_pUseIPV6Check->isChecked())szTmp += "6"; + if(m_pUseSSLCheck->isChecked()) + szTmp += "s"; + if(m_pUseIPV6Check->isChecked()) + szTmp += "6"; szTmp += "://"; szTmp += m_szHostname; szTmp += ":"; @@ -1023,7 +1070,8 @@ void IrcServerDetailsWidget::setHeaderLabelText() QString num = m_pPortEditor->text(); unsigned int uPort = num.toUInt(&bOk); - if(!bOk)uPort = 6667; + if(!bOk) + uPort = 6667; num.setNum(uPort); szTmp += num; szTmp += ""; @@ -1049,7 +1097,9 @@ void IrcServerDetailsWidget::fillData(KviIrcServer * s) if(m_pEncodingEditor->currentIndex() <= 0) { s->setEncoding(QString()); - } else { + } + else + { KviLocale::EncodingDescription * d = KviLocale::instance()->encodingDescription(m_pEncodingEditor->currentIndex() - 1); s->setEncoding(d->pcName); } @@ -1060,7 +1110,9 @@ void IrcServerDetailsWidget::fillData(KviIrcServer * s) if(m_pTextEncodingEditor->currentIndex() <= 0) { s->setTextEncoding(QString()); - } else { + } + else + { KviLocale::EncodingDescription * dd = KviLocale::instance()->encodingDescription(m_pTextEncodingEditor->currentIndex() - 1); s->setTextEncoding(dd->pcName); } @@ -1082,21 +1134,23 @@ void IrcServerDetailsWidget::fillData(KviIrcServer * s) s->setSaslNick(m_pSaslNickEditor->text()); s->setSaslPass(m_pSaslPassEditor->text()); if(m_pEnableSASLCheck) - s->setEnabledSASL( m_pEnableSASLCheck->isChecked() && - !m_pSaslNickEditor->text().isEmpty() && - !m_pSaslPassEditor->text().isEmpty()); + s->setEnabledSASL(m_pEnableSASLCheck->isChecked() && !m_pSaslNickEditor->text().isEmpty() && !m_pSaslPassEditor->text().isEmpty()); if(m_pIdEditor) s->setId(m_pIdEditor->text()); - if(s->id().isEmpty())s->generateUniqueId(); + if(s->id().isEmpty()) + s->generateUniqueId(); if(m_pUseDefaultInitUMode) { KviCString szUMode; if(!m_pUseDefaultInitUMode->isChecked()) { - if(m_pIMode->isChecked())szUMode.append('i'); - if(m_pWMode->isChecked())szUMode.append('w'); - if(m_pSMode->isChecked())szUMode.append('s'); + if(m_pIMode->isChecked()) + szUMode.append('i'); + if(m_pWMode->isChecked()) + szUMode.append('w'); + if(m_pSMode->isChecked()) + szUMode.append('s'); } s->setInitUMode(szUMode.ptr()); } @@ -1104,7 +1158,8 @@ void IrcServerDetailsWidget::fillData(KviIrcServer * s) QString tmp = m_pPortEditor->text(); bool bOk; kvi_u32_t uPort = tmp.toUInt(&bOk); - if(!bOk)uPort = 6667; + if(!bOk) + uPort = 6667; s->setPort(uPort); #ifdef COMPILE_IPV6_SUPPORT s->setIPv6(m_pUseIPV6Check->isChecked()); @@ -1121,26 +1176,34 @@ void IrcServerDetailsWidget::fillData(KviIrcServer * s) #ifdef COMPILE_IPV6_SUPPORT if(s->isIPv6()) { - if((!KviQString::equalCI(tmpAddr,"0:0:0:0:0:0:0:0")) && KviNetUtils::isValidStringIp(tmpAddr)) + if((!KviQString::equalCI(tmpAddr, "0:0:0:0:0:0:0:0")) && KviNetUtils::isValidStringIp(tmpAddr)) { s->setIp(tmpAddr); - } else { + } + else + { s->setCacheIp(false); s->setIp(""); } - } else { + } + else + { #endif - if((!KviQString::equalCI(tmpAddr,"0.0.0.0")) && KviNetUtils::isValidStringIp(tmpAddr)) + if((!KviQString::equalCI(tmpAddr, "0.0.0.0")) && KviNetUtils::isValidStringIp(tmpAddr)) { s->setIp(tmpAddr); - } else { + } + else + { s->setCacheIp(false); s->setIp(""); } #ifdef COMPILE_IPV6_SUPPORT } #endif - } else { + } + else + { s->setCacheIp(false); s->setIp(""); } @@ -1161,14 +1224,16 @@ void IrcServerDetailsWidget::fillData(KviIrcServer * s) if(m_pChannelListSelector) m_pChannelListSelector->commit(); - if(m_lstChannels.isEmpty())s->setAutoJoinChannelList(0); - else s->setAutoJoinChannelList(new QStringList(m_lstChannels)); + if(m_lstChannels.isEmpty()) + s->setAutoJoinChannelList(0); + else + s->setAutoJoinChannelList(new QStringList(m_lstChannels)); if(m_pUseAutoConnect) s->setAutoConnect(m_pUseAutoConnect->isChecked()); if(m_pProxyEditor) - s->setProxy(m_pProxyEditor->currentIndex()-2); + s->setProxy(m_pProxyEditor->currentIndex() - 2); } void IrcServerDetailsWidget::useDefaultInitUModeToggled(bool b) @@ -1181,51 +1246,52 @@ void IrcServerDetailsWidget::useDefaultInitUModeToggled(bool b) // KviApplication.cpp extern KVIRC_API KviIrcServerDataBase * g_pServerDataBase; -IrcServerOptionsTreeWidgetItem::IrcServerOptionsTreeWidgetItem(QTreeWidget *parent,const QPixmap &pm,const KviIrcNetwork *n) +IrcServerOptionsTreeWidgetItem::IrcServerOptionsTreeWidgetItem(QTreeWidget * parent, const QPixmap & pm, const KviIrcNetwork * n) : QTreeWidgetItem(parent) { - setIcon(0,QIcon(pm)); + setIcon(0, QIcon(pm)); m_pServerData = 0; m_pNetworkData = new KviIrcNetwork(*n); - setText(0,n->name()); - setText(1,n->description()); + setText(0, n->name()); + setText(1, n->description()); } -IrcServerOptionsTreeWidgetItem::IrcServerOptionsTreeWidgetItem(QTreeWidgetItem *parent,const QPixmap &pm,const KviIrcServer *s) +IrcServerOptionsTreeWidgetItem::IrcServerOptionsTreeWidgetItem(QTreeWidgetItem * parent, const QPixmap & pm, const KviIrcServer * s) : QTreeWidgetItem(parent) { - setIcon(0,QIcon(pm)); + setIcon(0, QIcon(pm)); m_pServerData = new KviIrcServer(*s); - setText(0,s->hostName()); - setText(1,s->description()); + setText(0, s->hostName()); + setText(1, s->description()); m_pNetworkData = 0; } IrcServerOptionsTreeWidgetItem::~IrcServerOptionsTreeWidgetItem() { - if(m_pServerData)delete m_pServerData; - if(m_pNetworkData)delete m_pNetworkData; + if(m_pServerData) + delete m_pServerData; + if(m_pNetworkData) + delete m_pNetworkData; } void IrcServerOptionsTreeWidgetItem::updateVisibleStrings() { if(m_pNetworkData) { - setText(0,m_pNetworkData->name()); - setText(1,m_pNetworkData->description()); + setText(0, m_pNetworkData->name()); + setText(1, m_pNetworkData->description()); return; } if(m_pServerData) { - setText(0,m_pServerData->hostName()); - setText(1,m_pServerData->description()); + setText(0, m_pServerData->hostName()); + setText(1, m_pServerData->description()); } } - OptionsWidget_servers::OptionsWidget_servers(QWidget * parent) -: KviOptionsWidget(parent) + : KviOptionsWidget(parent) { setObjectName("server_options_widget"); @@ -1234,64 +1300,65 @@ OptionsWidget_servers::OptionsWidget_servers(QWidget * parent) m_pContextPopup = new QMenu(this); m_pImportPopup = new QMenu(this); - connect(m_pImportPopup,SIGNAL(aboutToShow()),this,SLOT(importPopupAboutToShow())); - connect(m_pImportPopup,SIGNAL(triggered(QAction *)),this,SLOT(importPopupActivated(QAction *))); + connect(m_pImportPopup, SIGNAL(aboutToShow()), this, SLOT(importPopupAboutToShow())); + connect(m_pImportPopup, SIGNAL(triggered(QAction *)), this, SLOT(importPopupActivated(QAction *))); m_pServerDetailsDialog = 0; m_pNetworkDetailsDialog = 0; m_pImportFilter = 0; - m_pFilterLabel = new QLabel(__tr2qs_ctx("Filter:","options"),this); - addWidgetToLayout(m_pFilterLabel,0,0,0,0); + m_pFilterLabel = new QLabel(__tr2qs_ctx("Filter:", "options"), this); + addWidgetToLayout(m_pFilterLabel, 0, 0, 0, 0); m_pFilterEdit = new QLineEdit(this); - connect(m_pFilterEdit,SIGNAL(textEdited(const QString &)),this,SLOT(filterTextEdited(const QString &))); - KviTalToolTip::add(m_pFilterEdit,__tr2qs_ctx("If you are searching for a specific server or network, you can insert its name to filter the servers in the list","options")); - addWidgetToLayout(m_pFilterEdit,1,0,1,0); + connect(m_pFilterEdit, SIGNAL(textEdited(const QString &)), this, SLOT(filterTextEdited(const QString &))); + KviTalToolTip::add(m_pFilterEdit, __tr2qs_ctx("If you are searching for a specific server or network, you can insert its name to filter the servers in the list", "options")); + addWidgetToLayout(m_pFilterEdit, 1, 0, 1, 0); m_pShowFavoritesOnlyButton = new QToolButton(this); m_pShowFavoritesOnlyButton->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::FavoriteOff))); m_pShowFavoritesOnlyButton->setCheckable(true); m_pShowFavoritesOnlyButton->setChecked(KVI_OPTION_BOOL(KviOption_boolShowFavoriteServersOnly)); - KviTalToolTip::add(m_pShowFavoritesOnlyButton,__tr2qs_ctx("If this option is enabled, only servers you have favorited will be displayed","options")); - addWidgetToLayout(m_pShowFavoritesOnlyButton,3,0,3,0); - connect(m_pShowFavoritesOnlyButton,SIGNAL(toggled(bool)),this,SLOT(updateFavoritesFilter(bool))); // Sets the server to a favorite + KviTalToolTip::add(m_pShowFavoritesOnlyButton, __tr2qs_ctx("If this option is enabled, only servers you have favorited will be displayed", "options")); + addWidgetToLayout(m_pShowFavoritesOnlyButton, 3, 0, 3, 0); + connect(m_pShowFavoritesOnlyButton, SIGNAL(toggled(bool)), this, SLOT(updateFavoritesFilter(bool))); // Sets the server to a favorite m_pTreeWidget = new QTreeWidget(this); - addWidgetToLayout(m_pTreeWidget,0,1,1,1); + addWidgetToLayout(m_pTreeWidget, 0, 1, 1, 1); m_pTreeWidget->setColumnCount(2); QStringList columLabels; - columLabels.append(__tr2qs_ctx("Server","options")); - columLabels.append(__tr2qs_ctx("Description","options")); - m_pTreeWidget->setColumnWidth(0,250); - m_pTreeWidget->setColumnWidth(1,250); + columLabels.append(__tr2qs_ctx("Server", "options")); + columLabels.append(__tr2qs_ctx("Description", "options")); + m_pTreeWidget->setColumnWidth(0, 250); + m_pTreeWidget->setColumnWidth(1, 250); m_pTreeWidget->setSortingEnabled(true); - m_pTreeWidget->sortByColumn(0,Qt::AscendingOrder); + m_pTreeWidget->sortByColumn(0, Qt::AscendingOrder); m_pTreeWidget->setHeaderLabels(columLabels); m_pTreeWidget->setRootIsDecorated(true); m_pTreeWidget->setAllColumnsShowFocus(true); m_pTreeWidget->setSelectionMode(QAbstractItemView::SingleSelection); m_pTreeWidget->setContextMenuPolicy(Qt::CustomContextMenu); - connect(m_pTreeWidget,SIGNAL(customContextMenuRequested(const QPoint &)),this,SLOT(customContextMenuRequested(const QPoint &))); - connect(m_pTreeWidget,SIGNAL(currentItemChanged(QTreeWidgetItem *,QTreeWidgetItem *)),this,SLOT(currentItemChanged(QTreeWidgetItem *,QTreeWidgetItem *))); - connect(m_pTreeWidget,SIGNAL(itemDoubleClicked(QTreeWidgetItem*, int )),this,SLOT(itemDoubleClicked(QTreeWidgetItem*, int ))); + connect(m_pTreeWidget, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(customContextMenuRequested(const QPoint &))); + connect(m_pTreeWidget, SIGNAL(currentItemChanged(QTreeWidgetItem *, QTreeWidgetItem *)), this, SLOT(currentItemChanged(QTreeWidgetItem *, QTreeWidgetItem *))); + connect(m_pTreeWidget, SIGNAL(itemDoubleClicked(QTreeWidgetItem *, int)), this, SLOT(itemDoubleClicked(QTreeWidgetItem *, int))); - QString tiptxt = __tr2qs_ctx("This is the list of available IRC servers.
" \ - "Right-click on the list to add or remove servers and perform other actions.
"\ - "Double-click on a item for advanced options.","options"); - KviTalToolTip::add(m_pTreeWidget,tiptxt); - KviTalToolTip::add(m_pTreeWidget->viewport(),tiptxt); + QString tiptxt = __tr2qs_ctx("This is the list of available IRC servers.
" + "Right-click on the list to add or remove servers and perform other actions.
" + "Double-click on a item for advanced options.", + "options"); + KviTalToolTip::add(m_pTreeWidget, tiptxt); + KviTalToolTip::add(m_pTreeWidget->viewport(), tiptxt); KviTalVBox * vbox = new KviTalVBox(this); vbox->setSpacing(0); - addWidgetToLayout(vbox,3,1,3,1); + addWidgetToLayout(vbox, 3, 1, 3, 1); m_pNewNetworkButton = new QToolButton(vbox); m_pNewNetworkButton->setIcon(QIcon(*(g_pIconManager->getSmallIcon(KviIconManager::NewNetwork)))); m_pNewNetworkButton->setAutoRaise(true); - connect(m_pNewNetworkButton,SIGNAL(clicked()),this,SLOT(newNetwork())); - KviTalToolTip::add(m_pNewNetworkButton,__tr2qs_ctx("New network","options")); + connect(m_pNewNetworkButton, SIGNAL(clicked()), this, SLOT(newNetwork())); + KviTalToolTip::add(m_pNewNetworkButton, __tr2qs_ctx("New network", "options")); QFrame * f = new QFrame(vbox); f->setFrameStyle(QFrame::Sunken | QFrame::HLine); @@ -1299,35 +1366,35 @@ OptionsWidget_servers::OptionsWidget_servers(QWidget * parent) m_pNewServerButton = new QToolButton(vbox); m_pNewServerButton->setIcon(QIcon(*(g_pIconManager->getSmallIcon(KviIconManager::NewServer)))); m_pNewServerButton->setAutoRaise(true); - connect(m_pNewServerButton,SIGNAL(clicked()),this,SLOT(newServer())); - KviTalToolTip::add(m_pNewServerButton,__tr2qs_ctx("New server","options")); + connect(m_pNewServerButton, SIGNAL(clicked()), this, SLOT(newServer())); + KviTalToolTip::add(m_pNewServerButton, __tr2qs_ctx("New server", "options")); m_pFavoriteServerButton = new QToolButton(vbox); m_pFavoriteServerButton->setIcon(QIcon(*(g_pIconManager->getSmallIcon(KviIconManager::ServerFavorite)))); m_pFavoriteServerButton->setAutoRaise(true); - connect(m_pFavoriteServerButton,SIGNAL(clicked()),this,SLOT(favoriteServer())); - KviTalToolTip::add(m_pFavoriteServerButton,__tr2qs_ctx("Favorite/Unfavorite server","options")); + connect(m_pFavoriteServerButton, SIGNAL(clicked()), this, SLOT(favoriteServer())); + KviTalToolTip::add(m_pFavoriteServerButton, __tr2qs_ctx("Favorite/Unfavorite server", "options")); m_pRemoveButton = new QToolButton(vbox); m_pRemoveButton->setIcon(QIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Remove)))); m_pRemoveButton->setEnabled(false); m_pRemoveButton->setAutoRaise(true); - connect(m_pRemoveButton,SIGNAL(clicked()),this,SLOT(removeCurrent())); - KviTalToolTip::add(m_pRemoveButton,__tr2qs_ctx("Remove network/server","options")); + connect(m_pRemoveButton, SIGNAL(clicked()), this, SLOT(removeCurrent())); + KviTalToolTip::add(m_pRemoveButton, __tr2qs_ctx("Remove network/server", "options")); m_pCopyServerButton = new QToolButton(vbox); m_pCopyServerButton->setIcon(QIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Copy)))); m_pCopyServerButton->setEnabled(false); m_pCopyServerButton->setAutoRaise(true); - connect(m_pCopyServerButton,SIGNAL(clicked()),this,SLOT(copyServer())); - KviTalToolTip::add(m_pCopyServerButton,__tr2qs_ctx("Copy server","options")); + connect(m_pCopyServerButton, SIGNAL(clicked()), this, SLOT(copyServer())); + KviTalToolTip::add(m_pCopyServerButton, __tr2qs_ctx("Copy server", "options")); m_pPasteServerButton = new QToolButton(vbox); m_pPasteServerButton->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Paste))); m_pPasteServerButton->setEnabled(false); m_pPasteServerButton->setAutoRaise(true); - connect(m_pPasteServerButton,SIGNAL(clicked()),this,SLOT(pasteServer())); - KviTalToolTip::add(m_pPasteServerButton,__tr2qs_ctx("Paste server","options")); + connect(m_pPasteServerButton, SIGNAL(clicked()), this, SLOT(pasteServer())); + KviTalToolTip::add(m_pPasteServerButton, __tr2qs_ctx("Paste server", "options")); f = new QFrame(vbox); f->setFrameStyle(QFrame::Sunken | QFrame::HLine); @@ -1338,25 +1405,25 @@ OptionsWidget_servers::OptionsWidget_servers(QWidget * parent) m_pImportButton->setMenu(m_pImportPopup); m_pImportButton->setPopupMode(QToolButton::InstantPopup); - KviTalToolTip::add(m_pImportButton,__tr2qs_ctx("Import server list","options")); + KviTalToolTip::add(m_pImportButton, __tr2qs_ctx("Import server list", "options")); QFrame * lll = new QFrame(vbox); - vbox->setStretchFactor(lll,100); + vbox->setStretchFactor(lll, 100); - KviTalGroupBox *gbox = addGroupBox(0,2,3,2,Qt::Vertical,__tr2qs_ctx("Active Configuration","options")); - m_pSrvNetLabel = new QLabel(__tr2qs_ctx("Server:","options"),gbox); + KviTalGroupBox * gbox = addGroupBox(0, 2, 3, 2, Qt::Vertical, __tr2qs_ctx("Active Configuration", "options")); + m_pSrvNetLabel = new QLabel(__tr2qs_ctx("Server:", "options"), gbox); m_pSrvNetEdit = new QLineEdit(gbox); - connect(m_pSrvNetEdit,SIGNAL(textEdited(const QString &)),this,SLOT(serverNetworkEditTextEdited(const QString &))); - KviTalToolTip::add(m_pSrvNetEdit,__tr2qs_ctx("This is the name of the currently selected server or network","options")); + connect(m_pSrvNetEdit, SIGNAL(textEdited(const QString &)), this, SLOT(serverNetworkEditTextEdited(const QString &))); + KviTalToolTip::add(m_pSrvNetEdit, __tr2qs_ctx("This is the name of the currently selected server or network", "options")); - m_pDetailsButton = new QPushButton(__tr2qs_ctx("Advanced...","options"),gbox); - connect(m_pDetailsButton,SIGNAL(clicked()),this,SLOT(detailsClicked())); - KviTalToolTip::add(m_pDetailsButton,__tr2qs_ctx("Click here to edit advanced options for this entry","options")); + m_pDetailsButton = new QPushButton(__tr2qs_ctx("Advanced...", "options"), gbox); + connect(m_pDetailsButton, SIGNAL(clicked()), this, SLOT(detailsClicked())); + KviTalToolTip::add(m_pDetailsButton, __tr2qs_ctx("Click here to edit advanced options for this entry", "options")); m_pRecentPopup = new QMenu(gbox); - connect(m_pRecentPopup,SIGNAL(aboutToShow()),this,SLOT(recentServersPopupAboutToShow())); - connect(m_pRecentPopup,SIGNAL(triggered(QAction *)),this,SLOT(recentServersPopupClicked(QAction *))); + connect(m_pRecentPopup, SIGNAL(aboutToShow()), this, SLOT(recentServersPopupAboutToShow())); + connect(m_pRecentPopup, SIGNAL(triggered(QAction *)), this, SLOT(recentServersPopupClicked(QAction *))); QToolButton * tb = new QToolButton(gbox); tb->setIcon(QIcon(*(g_pIconManager->getSmallIcon(KviIconManager::History)))); @@ -1364,33 +1431,33 @@ OptionsWidget_servers::OptionsWidget_servers(QWidget * parent) tb->setAutoRaise(true); tb->setPopupMode(QToolButton::InstantPopup); - KviTalToolTip::add(tb,__tr2qs_ctx("This button shows a list of recently used servers.
It allows you to quickly find them in the list.","options")); + KviTalToolTip::add(tb, __tr2qs_ctx("This button shows a list of recently used servers.
It allows you to quickly find them in the list.", "options")); m_pShowThisDialogAtStartupSelector = NULL; // The "Show this dialog at startup" option is shown only when the server options widget is shown as standalone dialog if(parent->inherits("OptionsWidgetContainer")) { - m_pConnectCurrent = new QPushButton(__tr2qs_ctx("Connect &Now","options"),this); - addWidgetToLayout(m_pConnectCurrent,0,3,3,3); - connect(m_pConnectCurrent,SIGNAL(clicked()),this,SLOT(connectCurrentClicked())); + m_pConnectCurrent = new QPushButton(__tr2qs_ctx("Connect &Now", "options"), this); + addWidgetToLayout(m_pConnectCurrent, 0, 3, 3, 3); + connect(m_pConnectCurrent, SIGNAL(clicked()), this, SLOT(connectCurrentClicked())); - QPalette pal(QColor(0,0,0)); + QPalette pal(QColor(0, 0, 0)); /* QPalette::active defines the colors of the button/text when the KVIrc window has focus Keep button/text color in a spectrum that indicates a connect action is possible */ - pal.setColor(QPalette::Active,QPalette::Button,QColor(0,135,0)); - pal.setColor(QPalette::Active,QPalette::ButtonText,QColor(245,245,245)); + pal.setColor(QPalette::Active, QPalette::Button, QColor(0, 135, 0)); + pal.setColor(QPalette::Active, QPalette::ButtonText, QColor(245, 245, 245)); /* QPalette::Inactive defines the colors of the button/text when the KVIrc window looses focus Keep button/text color the same as QPalette::Active but use different shades */ - pal.setColor(QPalette::Inactive,QPalette::Button,QColor(50,135,50)); - pal.setColor(QPalette::Inactive,QPalette::ButtonText,QColor(225,225,225)); + pal.setColor(QPalette::Inactive, QPalette::Button, QColor(50, 135, 50)); + pal.setColor(QPalette::Inactive, QPalette::ButtonText, QColor(225, 225, 225)); /* QPalette::Disabled defines the colors of the button/text when for instance network is selected Keep button/text color in a spectrum that indicates no possible action is possible */ - pal.setColor(QPalette::Disabled,QPalette::Button,QColor(100,100,100)); - pal.setColor(QPalette::Disabled,QPalette::ButtonText,QColor(180,180,180)); + pal.setColor(QPalette::Disabled, QPalette::Button, QColor(100, 100, 100)); + pal.setColor(QPalette::Disabled, QPalette::ButtonText, QColor(180, 180, 180)); #if defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW) || defined(COMPILE_ON_MAC) // Kill the WindowXP/Mac style which does not honor palette @@ -1413,22 +1480,24 @@ OptionsWidget_servers::OptionsWidget_servers(QWidget * parent) fnt.setBold(true); m_pConnectCurrent->setFont(fnt); - KviTalToolTip::add(m_pConnectCurrent,__tr2qs_ctx("Hit this button to connect to the currently selected server.","options")); + KviTalToolTip::add(m_pConnectCurrent, __tr2qs_ctx("Hit this button to connect to the currently selected server.", "options")); OptionsWidgetContainer * pContainer = dynamic_cast(parent); if(pContainer) { - m_pShowThisDialogAtStartupSelector = addBoolSelector(pContainer,__tr2qs_ctx("Show this dialog at startup","options"),KviOption_boolShowServersConnectDialogOnStart); + m_pShowThisDialogAtStartupSelector = addBoolSelector(pContainer, __tr2qs_ctx("Show this dialog at startup", "options"), KviOption_boolShowServersConnectDialogOnStart); pContainer->setLeftCornerWidget(m_pShowThisDialogAtStartupSelector); // This selector can be destroyed upon reparenting: make sure it's removed from the selector list // (or we'll get a crash at commit() time...). - connect(m_pShowThisDialogAtStartupSelector,SIGNAL(destroyed()),this,SLOT(slotShowThisDialogAtStartupSelectorDestroyed())); - KviTalToolTip::add(m_pShowThisDialogAtStartupSelector,__tr2qs_ctx("If this option is enabled, the servers dialog will appear every time you start KVIrc","options")); + connect(m_pShowThisDialogAtStartupSelector, SIGNAL(destroyed()), this, SLOT(slotShowThisDialogAtStartupSelectorDestroyed())); + KviTalToolTip::add(m_pShowThisDialogAtStartupSelector, __tr2qs_ctx("If this option is enabled, the servers dialog will appear every time you start KVIrc", "options")); } new QShortcut(Qt::Key_Escape, parent, SLOT(close())); - } else { + } + else + { m_pConnectCurrent = NULL; } @@ -1441,8 +1510,8 @@ OptionsWidget_servers::OptionsWidget_servers(QWidget * parent) fillServerList(); updateFavoritesFilter(KVI_OPTION_BOOL(KviOption_boolShowFavoriteServersOnly)); - layout()->setRowStretch(1,1); - layout()->setColumnStretch(1,1); + layout()->setRowStretch(1, 1); + layout()->setColumnStretch(1, 1); setMinimumWidth(600); } @@ -1450,7 +1519,7 @@ OptionsWidget_servers::~OptionsWidget_servers() { if(m_pImportFilter) { - disconnect(m_pImportFilter,0,this,0); + disconnect(m_pImportFilter, 0, this, 0); m_pImportFilter->die(); m_pImportFilter = 0; } @@ -1478,10 +1547,10 @@ void OptionsWidget_servers::recentServersPopupAboutToShow() g_pApp->fillRecentServersPopup(m_pRecentPopup); m_pRecentPopup->addSeparator(); - m_pRecentPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::Remove)),__tr2qs("Clear Recent Servers List")); + m_pRecentPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::Remove)), __tr2qs("Clear Recent Servers List")); } -void OptionsWidget_servers::recentServersPopupClicked(QAction *pAction) +void OptionsWidget_servers::recentServersPopupClicked(QAction * pAction) { if(!g_pActiveWindow) return; // doh @@ -1497,21 +1566,21 @@ void OptionsWidget_servers::recentServersPopupClicked(QAction *pAction) if(szItemText == __tr2qs("Clear Recent Servers List")) { - KviKvsScript::run("option stringlistRecentServers",c); + KviKvsScript::run("option stringlistRecentServers", c); return; } selectBestServerByUrl(szItemText); } -void OptionsWidget_servers::selectBestServerByUrl(const QString &szUrl) +void OptionsWidget_servers::selectBestServerByUrl(const QString & szUrl) { if(szUrl.isEmpty()) return; KviIrcUrlParts oParts; - KviIrcUrl::split(szUrl,oParts); + KviIrcUrl::split(szUrl, oParts); int uCount = m_pTreeWidget->topLevelItemCount(); int uIdx = 0; @@ -1565,7 +1634,7 @@ void OptionsWidget_servers::selectBestServerByUrl(const QString &szUrl) { // exact match uIdx = uCount; // break the outer loop - break; // break the inner loop + break; // break the inner loop } } } @@ -1573,7 +1642,6 @@ void OptionsWidget_servers::selectBestServerByUrl(const QString &szUrl) if(pBestCandidate) m_pTreeWidget->setCurrentItem(pBestCandidate); - } void OptionsWidget_servers::connectCurrentClicked() @@ -1581,8 +1649,9 @@ void OptionsWidget_servers::connectCurrentClicked() saveLastItem(); commit(); KviCString szServer = m_pSrvNetEdit->text(); - if(szServer.isEmpty())return; - KviKvsScript::run("server -u",g_pApp->activeConsole()); + if(szServer.isEmpty()) + return; + KviKvsScript::run("server -u", g_pApp->activeConsole()); } void OptionsWidget_servers::fillServerList() @@ -1591,22 +1660,22 @@ void OptionsWidget_servers::fillServerList() IrcServerOptionsTreeWidgetItem * srv; IrcServerOptionsTreeWidgetItem * cur = 0; - KviPointerHashTableIterator it(*(g_pServerDataBase->recordDict())); + KviPointerHashTableIterator it(*(g_pServerDataBase->recordDict())); if(m_pConnectCurrent) m_pConnectCurrent->setEnabled(false); while(KviIrcNetwork * r = it.current()) { - net = new IrcServerOptionsTreeWidgetItem(m_pTreeWidget,*(g_pIconManager->getSmallIcon(KviIconManager::World)),r); + net = new IrcServerOptionsTreeWidgetItem(m_pTreeWidget, *(g_pIconManager->getSmallIcon(KviIconManager::World)), r); KviPointerList * sl = r->serverList(); bool bCurrent = r->name() == g_pServerDataBase->currentNetworkName().toUtf8().data(); net->setExpanded(bCurrent); - for(KviIrcServer * s = sl->first();s;s = sl->next()) + for(KviIrcServer * s = sl->first(); s; s = sl->next()) { unsigned icon = s->favorite() ? KviIconManager::ServerFavorite : KviIconManager::Server; - srv = new IrcServerOptionsTreeWidgetItem(net,*(g_pIconManager->getSmallIcon(icon)),s); + srv = new IrcServerOptionsTreeWidgetItem(net, *(g_pIconManager->getSmallIcon(icon)), s); if((s == r->currentServer()) && bCurrent) { @@ -1626,12 +1695,12 @@ void OptionsWidget_servers::fillServerList() } } -void OptionsWidget_servers::itemDoubleClicked(QTreeWidgetItem*, int ) +void OptionsWidget_servers::itemDoubleClicked(QTreeWidgetItem *, int) { detailsClicked(); } -void OptionsWidget_servers::currentItemChanged(QTreeWidgetItem *it,QTreeWidgetItem *) +void OptionsWidget_servers::currentItemChanged(QTreeWidgetItem * it, QTreeWidgetItem *) { saveLastItem(); m_pLastEditedItem = (IrcServerOptionsTreeWidgetItem *)it; @@ -1650,13 +1719,17 @@ void OptionsWidget_servers::currentItemChanged(QTreeWidgetItem *it,QTreeWidgetIt if(m_pLastEditedItem->m_pServerData) { - m_pSrvNetLabel->setText(__tr2qs_ctx("Server:","options")); + m_pSrvNetLabel->setText(__tr2qs_ctx("Server:", "options")); m_pSrvNetEdit->setText(m_pLastEditedItem->m_pServerData->hostName()); - } else { - m_pSrvNetLabel->setText(__tr2qs_ctx("Network:","options")); + } + else + { + m_pSrvNetLabel->setText(__tr2qs_ctx("Network:", "options")); m_pSrvNetEdit->setText(it->text(0)); } - } else { + } + else + { m_pRemoveButton->setEnabled(false); m_pCopyServerButton->setEnabled(true); m_pFavoriteServerButton->setEnabled(true); @@ -1666,7 +1739,7 @@ void OptionsWidget_servers::currentItemChanged(QTreeWidgetItem *it,QTreeWidgetIt m_pSrvNetLabel->setEnabled(false); m_pSrvNetEdit->setEnabled(false); - m_pSrvNetEdit->setText(__tr2qs_ctx("No selection","options")); + m_pSrvNetEdit->setText(__tr2qs_ctx("No selection", "options")); m_pDetailsButton->setEnabled(false); } } @@ -1680,41 +1753,41 @@ void OptionsWidget_servers::serverNetworkEditTextEdited(const QString &) // make sure the current item is currently visible (if it still exists) if(m_pLastEditedItem) - m_pTreeWidget->scrollToItem(m_pLastEditedItem,QTreeWidget::EnsureVisible); + m_pTreeWidget->scrollToItem(m_pLastEditedItem, QTreeWidget::EnsureVisible); } void OptionsWidget_servers::filterTextEdited(const QString &) { - QString szFilter=m_pFilterEdit->text().trimmed(); + QString szFilter = m_pFilterEdit->text().trimmed(); IrcServerOptionsTreeWidgetItem * network; - for (int i=0;itopLevelItemCount();i++) + for(int i = 0; i < m_pTreeWidget->topLevelItemCount(); i++) { - network = (IrcServerOptionsTreeWidgetItem *) m_pTreeWidget->topLevelItem(i); - if(network->m_pNetworkData->name().contains(szFilter, Qt::CaseInsensitive) || - network->m_pNetworkData->description().contains(szFilter, Qt::CaseInsensitive)) + network = (IrcServerOptionsTreeWidgetItem *)m_pTreeWidget->topLevelItem(i); + if(network->m_pNetworkData->name().contains(szFilter, Qt::CaseInsensitive) || network->m_pNetworkData->description().contains(szFilter, Qt::CaseInsensitive)) { network->setHidden(false); // if the net matches, we always show all its servers IrcServerOptionsTreeWidgetItem * ch; - for (int j=0;jchildCount();j++) + for(int j = 0; j < network->childCount(); j++) { - ch=(IrcServerOptionsTreeWidgetItem *)network->child(j); + ch = (IrcServerOptionsTreeWidgetItem *)network->child(j); ch->setHidden(false); } - } else { - uint uServers=0; + } + else + { + uint uServers = 0; IrcServerOptionsTreeWidgetItem * ch; - for (int j=0;jchildCount();j++) + for(int j = 0; j < network->childCount(); j++) { - bool bHidden=true; - ch=(IrcServerOptionsTreeWidgetItem *)network->child(j); + bool bHidden = true; + ch = (IrcServerOptionsTreeWidgetItem *)network->child(j); if(ch->m_pServerData) { - if(ch->m_pServerData->hostName().contains(szFilter, Qt::CaseInsensitive) || - ch->m_pServerData->description().contains(szFilter, Qt::CaseInsensitive)) - bHidden=false; + if(ch->m_pServerData->hostName().contains(szFilter, Qt::CaseInsensitive) || ch->m_pServerData->description().contains(szFilter, Qt::CaseInsensitive)) + bHidden = false; } if(!bHidden) @@ -1740,11 +1813,12 @@ void OptionsWidget_servers::saveLastItem() m_pLastEditedItem->m_pServerData->setHostName(tmp); m_pLastEditedItem->updateVisibleStrings(); - } else if(m_pLastEditedItem->m_pNetworkData) + } + else if(m_pLastEditedItem->m_pNetworkData) { QString tmp = m_pSrvNetEdit->text(); if(tmp.isEmpty()) - tmp = __tr2qs_ctx("UnknownNet","options"); + tmp = __tr2qs_ctx("UnknownNet", "options"); m_pLastEditedItem->m_pNetworkData->setName(tmp); m_pLastEditedItem->updateVisibleStrings(); @@ -1758,28 +1832,31 @@ void OptionsWidget_servers::commit() g_pServerDataBase->clear(); IrcServerOptionsTreeWidgetItem * network; - for (int i=0;itopLevelItemCount();i++) + for(int i = 0; i < m_pTreeWidget->topLevelItemCount(); i++) { - network=(IrcServerOptionsTreeWidgetItem *) m_pTreeWidget->topLevelItem(i); + network = (IrcServerOptionsTreeWidgetItem *)m_pTreeWidget->topLevelItem(i); QString tmp = network->m_pNetworkData->name(); KviIrcNetwork * pNetwork = g_pServerDataBase->findNetwork(tmp); if(pNetwork) { pNetwork->copyFrom(*(network->m_pNetworkData)); - } else { + } + else + { pNetwork = new KviIrcNetwork(tmp); pNetwork->copyFrom(*(network->m_pNetworkData)); g_pServerDataBase->addNetwork(pNetwork); } - if(network == m_pLastEditedItem)g_pServerDataBase->setCurrentNetwork(pNetwork->name()); + if(network == m_pLastEditedItem) + g_pServerDataBase->setCurrentNetwork(pNetwork->name()); IrcServerOptionsTreeWidgetItem * ch; - for (int j=0;jchildCount();j++) + for(int j = 0; j < network->childCount(); j++) { - KviIrcServer *srv; - ch=(IrcServerOptionsTreeWidgetItem *)network->child(j); + KviIrcServer * srv; + ch = (IrcServerOptionsTreeWidgetItem *)network->child(j); if(ch->m_pServerData) { @@ -1791,8 +1868,11 @@ void OptionsWidget_servers::commit() { srv = new KviIrcServer(*(ch->m_pServerData)); pNetwork->insertServer(srv); - } else *srv = *(ch->m_pServerData); - if(srv->id().isEmpty())srv->generateUniqueId(); + } + else + *srv = *(ch->m_pServerData); + if(srv->id().isEmpty()) + srv->generateUniqueId(); if(ch == m_pLastEditedItem) { @@ -1802,7 +1882,6 @@ void OptionsWidget_servers::commit() } } } - } KVI_OPTION_BOOL(KviOption_boolShowFavoriteServersOnly) = m_pShowFavoritesOnlyButton->isChecked(); @@ -1810,36 +1889,35 @@ void OptionsWidget_servers::commit() KviOptionsWidget::commit(); g_pApp->saveIrcServerDataBase(); // Ensure saving of the server DB - } -void OptionsWidget_servers::customContextMenuRequested(const QPoint &pnt) +void OptionsWidget_servers::customContextMenuRequested(const QPoint & pnt) { - QTreeWidgetItem *it = static_cast(m_pTreeWidget->itemAt(pnt)); + QTreeWidgetItem * it = static_cast(m_pTreeWidget->itemAt(pnt)); bool bServer = (it && static_cast(it)->m_pServerData); bool bFavorite = (bServer && static_cast(it)->m_pServerData->favorite()); m_pContextPopup->clear(); - m_pContextPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::NewNetwork)),__tr2qs_ctx("New Network","options"),this,SLOT(newNetwork())); - m_pContextPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::Remove)),__tr2qs_ctx("Remove Network","options"),this,SLOT(removeCurrent())) - ->setEnabled(!bServer); + m_pContextPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::NewNetwork)), __tr2qs_ctx("New Network", "options"), this, SLOT(newNetwork())); + m_pContextPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::Remove)), __tr2qs_ctx("Remove Network", "options"), this, SLOT(removeCurrent())) + ->setEnabled(!bServer); m_pContextPopup->addSeparator(); - m_pContextPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::NewServer)),__tr2qs_ctx("&New Server","options"),this,SLOT(newServer())); + m_pContextPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::NewServer)), __tr2qs_ctx("&New Server", "options"), this, SLOT(newServer())); m_pContextPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::ServerFavorite)), - __tr2qs_ctx(bFavorite?"Unfavorite Server":"Favorite Server","options"),this,SLOT(favoriteServer())); + __tr2qs_ctx(bFavorite ? "Unfavorite Server" : "Favorite Server", "options"), this, SLOT(favoriteServer())); m_pContextPopup->setEnabled(bServer); - m_pContextPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::Remove)),__tr2qs_ctx("Re&move Server","options"),this,SLOT(removeCurrent())) - ->setEnabled(bServer); - m_pContextPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::Copy)),__tr2qs_ctx("&Copy Server","options"),this,SLOT(copyServer())); + m_pContextPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::Remove)), __tr2qs_ctx("Re&move Server", "options"), this, SLOT(removeCurrent())) + ->setEnabled(bServer); + m_pContextPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::Copy)), __tr2qs_ctx("&Copy Server", "options"), this, SLOT(copyServer())); m_pContextPopup->setEnabled(bServer); - m_pContextPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::Paste)),__tr2qs_ctx("&Paste Server","options"),this,SLOT(pasteServer())) - ->setEnabled(m_pClipboard); + m_pContextPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::Paste)), __tr2qs_ctx("&Paste Server", "options"), this, SLOT(pasteServer())) + ->setEnabled(m_pClipboard); m_pContextPopup->addSeparator(); - m_pContextPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::Folder)),__tr2qs_ctx("Import Server List","options"))->setMenu(m_pImportPopup); - m_pContextPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::Remove)),__tr2qs_ctx("Clear Server List","options"),this,SLOT(clearList())); + m_pContextPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::Folder)), __tr2qs_ctx("Import Server List", "options"))->setMenu(m_pImportPopup); + m_pContextPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::Remove)), __tr2qs_ctx("Clear Server List", "options"), this, SLOT(clearList())); m_pContextPopup->popup(QCursor::pos()); } @@ -1850,21 +1928,22 @@ void OptionsWidget_servers::importPopupAboutToShow() KviModuleExtensionDescriptorList * l = KviModuleExtensionManager::instance()->getExtensionList("serverimport"); - if(!l)return; + if(!l) + return; - QAction *pAction; + QAction * pAction; - for(KviModuleExtensionDescriptor * d = l->first();d;d = l->next()) + for(KviModuleExtensionDescriptor * d = l->first(); d; d = l->next()) { if(d->icon()) - pAction = m_pImportPopup->addAction(*(d->icon()),d->visibleName()); + pAction = m_pImportPopup->addAction(*(d->icon()), d->visibleName()); else pAction = m_pImportPopup->addAction(d->visibleName()); pAction->setData(d->id()); } } -void OptionsWidget_servers::importPopupActivated(QAction *pAction) +void OptionsWidget_servers::importPopupActivated(QAction * pAction) { // ensure that we have all the modules : they could have been unloaded while the popup was displayed g_pModuleManager->loadModulesByCaps("serverimport"); @@ -1876,32 +1955,32 @@ void OptionsWidget_servers::importPopupActivated(QAction *pAction) // Oops! Internal error: I thought to have a module capable of importing servers // but actually it's not the case.. something weird happened (in the best case // the user has just unloaded the module and removed it from disk?) - KviMessageBox::warning(__tr2qs_ctx("Oops! Something weird happened:
Can't find any module capable of importing servers.","options")); + KviMessageBox::warning(__tr2qs_ctx("Oops! Something weird happened:
Can't find any module capable of importing servers.", "options")); return; } if(m_pImportFilter) { - disconnect(m_pImportFilter,0,this,0); + disconnect(m_pImportFilter, 0, this, 0); m_pImportFilter->die(); m_pImportFilter = 0; } - bool bOk=false; + bool bOk = false; int id = pAction->data().toInt(&bOk); if(!bOk) - return; + return; - m_pImportFilter = (KviMexServerImport *)KviModuleExtensionManager::instance()->allocateExtension("serverimport",id,0); + m_pImportFilter = (KviMexServerImport *)KviModuleExtensionManager::instance()->allocateExtension("serverimport", id, 0); if(!m_pImportFilter) { - KviMessageBox::warning(__tr2qs_ctx("Oops! Something weird happened:
Can't find the module that was capable of this import action. :(","options")); + KviMessageBox::warning(__tr2qs_ctx("Oops! Something weird happened:
Can't find the module that was capable of this import action. :(", "options")); return; } - connect(m_pImportFilter,SIGNAL(server(const KviIrcServer &,const QString&)),this,SLOT(importServer(const KviIrcServer &,const QString&))); - connect(m_pImportFilter,SIGNAL(destroyed()),this,SLOT(importerDead())); + connect(m_pImportFilter, SIGNAL(server(const KviIrcServer &, const QString &)), this, SLOT(importServer(const KviIrcServer &, const QString &))); + connect(m_pImportFilter, SIGNAL(destroyed()), this, SLOT(importerDead())); m_pImportFilter->start(); } @@ -1911,32 +1990,35 @@ void OptionsWidget_servers::importerDead() m_pImportFilter = 0; } -void OptionsWidget_servers::importServer(const KviIrcServer &s,const QString &network) +void OptionsWidget_servers::importServer(const KviIrcServer & s, const QString & network) { IrcServerOptionsTreeWidgetItem * net = findNetItem(network); if(!net) { KviIrcNetwork d(network); - net = new IrcServerOptionsTreeWidgetItem(m_pTreeWidget,*(g_pIconManager->getSmallIcon(KviIconManager::World)),&d); + net = new IrcServerOptionsTreeWidgetItem(m_pTreeWidget, *(g_pIconManager->getSmallIcon(KviIconManager::World)), &d); net->setExpanded(true); } - IrcServerOptionsTreeWidgetItem * srv ; - for(int i=0;ichildCount();i++) + IrcServerOptionsTreeWidgetItem * srv; + for(int i = 0; i < net->childCount(); i++) { - srv=(IrcServerOptionsTreeWidgetItem *) net->child(i); + srv = (IrcServerOptionsTreeWidgetItem *)net->child(i); if((srv)->m_pServerData->useSSL() == s.useSSL()) { if(srv->m_pServerData->isIPv6() == s.isIPv6()) { - if(KviQString::equalCI(srv->m_pServerData->hostName(),s.hostName())) + if(KviQString::equalCI(srv->m_pServerData->hostName(), s.hostName())) { // update the port srv->m_pServerData->setPort(s.port()); - if(!s.ip().isEmpty())srv->m_pServerData->setIp(s.ip()); - if(!s.password().isEmpty())srv->m_pServerData->setPassword(s.password()); - if(!s.nickName().isEmpty())srv->m_pServerData->setNickName(s.nickName()); + if(!s.ip().isEmpty()) + srv->m_pServerData->setIp(s.ip()); + if(!s.password().isEmpty()) + srv->m_pServerData->setPassword(s.password()); + if(!s.nickName().isEmpty()) + srv->m_pServerData->setNickName(s.nickName()); m_pTreeWidget->setCurrentItem(srv); m_pTreeWidget->scrollToItem(srv); return; @@ -1946,15 +2028,15 @@ void OptionsWidget_servers::importServer(const KviIrcServer &s,const QString &ne } // not found : add it! - IrcServerOptionsTreeWidgetItem * newServer = new IrcServerOptionsTreeWidgetItem(net,*(g_pIconManager->getSmallIcon(KviIconManager::Server)),&s); + IrcServerOptionsTreeWidgetItem * newServer = new IrcServerOptionsTreeWidgetItem(net, *(g_pIconManager->getSmallIcon(KviIconManager::Server)), &s); m_pTreeWidget->setCurrentItem(newServer); m_pTreeWidget->scrollToItem(newServer); } void OptionsWidget_servers::newNetwork() { - KviIrcNetwork d(__tr2qs_ctx("New Network","options")); - IrcServerOptionsTreeWidgetItem * it = new IrcServerOptionsTreeWidgetItem(m_pTreeWidget,*(g_pIconManager->getSmallIcon(KviIconManager::World)),&d); + KviIrcNetwork d(__tr2qs_ctx("New Network", "options")); + IrcServerOptionsTreeWidgetItem * it = new IrcServerOptionsTreeWidgetItem(m_pTreeWidget, *(g_pIconManager->getSmallIcon(KviIconManager::World)), &d); it->setExpanded(true); it->setSelected(true); m_pTreeWidget->setCurrentItem(it); @@ -1970,16 +2052,18 @@ void OptionsWidget_servers::newServer() if(m_pLastEditedItem->m_pServerData) { net = (IrcServerOptionsTreeWidgetItem *)m_pLastEditedItem->parent(); - if(!net)return; + if(!net) + return; } - else net = m_pLastEditedItem; + else + net = m_pLastEditedItem; KviIrcServer tmp; - tmp.setHostName(__tr2qs_ctx("irc.unknown.net","options")); + tmp.setHostName(__tr2qs_ctx("irc.unknown.net", "options")); tmp.setCacheIp(false); tmp.generateUniqueId(); - IrcServerOptionsTreeWidgetItem * it = new IrcServerOptionsTreeWidgetItem(net,*(g_pIconManager->getSmallIcon(KviIconManager::Server)),&tmp); + IrcServerOptionsTreeWidgetItem * it = new IrcServerOptionsTreeWidgetItem(net, *(g_pIconManager->getSmallIcon(KviIconManager::Server)), &tmp); net->setExpanded(true); @@ -2000,7 +2084,7 @@ void OptionsWidget_servers::favoriteServer() m_pLastEditedItem->m_pServerData->setFavorite(true); unsigned icon = m_pLastEditedItem->m_pServerData->favorite() ? KviIconManager::ServerFavorite : KviIconManager::Server; - m_pLastEditedItem->setIcon(0,*(g_pIconManager->getSmallIcon(icon))); + m_pLastEditedItem->setIcon(0, *(g_pIconManager->getSmallIcon(icon))); if(m_bShowingFavoritesOnly) updateFavoritesFilter(true); @@ -2016,7 +2100,7 @@ void OptionsWidget_servers::updateFavoritesFilter(bool bSet) uint uServers = 0; IrcServerOptionsTreeWidgetItem * ch; - for (int j = 0; j < network->childCount(); j++) + for(int j = 0; j < network->childCount(); j++) { bool bHidden = bSet ? true : false; ch = static_cast(network->child(j)); @@ -2041,7 +2125,8 @@ void OptionsWidget_servers::copyServer() { if(m_pLastEditedItem->m_pServerData) { - if(!m_pClipboard)m_pClipboard = new KviIrcServer(); + if(!m_pClipboard) + m_pClipboard = new KviIrcServer(); *m_pClipboard = *(m_pLastEditedItem->m_pServerData); m_pPasteServerButton->setEnabled(true); } @@ -2058,11 +2143,13 @@ void OptionsWidget_servers::pasteServer() if(m_pLastEditedItem->m_pServerData) { net = (IrcServerOptionsTreeWidgetItem *)m_pLastEditedItem->parent(); - if(!net)return; + if(!net) + return; } - else net = m_pLastEditedItem; + else + net = m_pLastEditedItem; - IrcServerOptionsTreeWidgetItem * it = new IrcServerOptionsTreeWidgetItem(net,*(g_pIconManager->getSmallIcon(KviIconManager::Server)),m_pClipboard); + IrcServerOptionsTreeWidgetItem * it = new IrcServerOptionsTreeWidgetItem(net, *(g_pIconManager->getSmallIcon(KviIconManager::Server)), m_pClipboard); it->m_pServerData->generateUniqueId(); // FIXME: This isn't necessarily unique... @@ -2086,13 +2173,17 @@ void OptionsWidget_servers::removeCurrent() { // top level item m_pTreeWidget->takeTopLevelItem(m_pTreeWidget->indexOfTopLevelItem(m_pLastEditedItem)); - } else { + } + else + { QTreeWidgetItem * tmp = m_pLastEditedItem->parent(); index = tmp->indexOfChild(m_pLastEditedItem); - if(index > -1) tmp->takeChild(index); + if(index > -1) + tmp->takeChild(index); } - if(!it)it = m_pTreeWidget->topLevelItem(0); + if(!it) + it = m_pTreeWidget->topLevelItem(0); if(it) { it->setSelected(true); @@ -2102,14 +2193,15 @@ void OptionsWidget_servers::removeCurrent() } } -IrcServerOptionsTreeWidgetItem * OptionsWidget_servers::findNetItem(const QString &netname) +IrcServerOptionsTreeWidgetItem * OptionsWidget_servers::findNetItem(const QString & netname) { IrcServerOptionsTreeWidgetItem * it; - for(int i=0;itopLevelItemCount();i++) + for(int i = 0; i < m_pTreeWidget->topLevelItemCount(); i++) { - it=(IrcServerOptionsTreeWidgetItem *)m_pTreeWidget->topLevelItem(i); - if(KviQString::equalCI(it->text(0),netname))return it; + it = (IrcServerOptionsTreeWidgetItem *)m_pTreeWidget->topLevelItem(i); + if(KviQString::equalCI(it->text(0), netname)) + return it; } return 0; } @@ -2118,27 +2210,30 @@ void OptionsWidget_servers::clearList() { QString txt = "

"; txt += __tr2qs_ctx("If you click Yes, all of your saved networks, servers, settings, and passwords will be lost.
" - "Would you like to continue?","options"); + "Would you like to continue?", + "options"); txt += "

"; if(QMessageBox::question(this, - __tr2qs_ctx("Confirm Clearing Server List - KVIrc","options"),txt, - __tr2qs_ctx("Yes","options"), __tr2qs_ctx("No","options"),0,1 - ) != 0) return; + __tr2qs_ctx("Confirm Clearing Server List - KVIrc", "options"), txt, + __tr2qs_ctx("Yes", "options"), __tr2qs_ctx("No", "options"), 0, 1) + != 0) + return; m_pTreeWidget->clear(); m_pLastEditedItem = 0; - currentItemChanged(0,0); + currentItemChanged(0, 0); } void OptionsWidget_servers::detailsClicked() { - if(!m_pLastEditedItem)return; + if(!m_pLastEditedItem) + return; if(m_pLastEditedItem->m_pServerData) { saveLastItem(); - m_pServerDetailsDialog = new IrcServerDetailsWidget(this,m_pLastEditedItem->m_pServerData); + m_pServerDetailsDialog = new IrcServerDetailsWidget(this, m_pLastEditedItem->m_pServerData); int retCode = m_pServerDetailsDialog->exec(); if(retCode == QDialog::Accepted) @@ -2161,7 +2256,7 @@ void OptionsWidget_servers::detailsClicked() { saveLastItem(); - m_pNetworkDetailsDialog = new IrcNetworkDetailsWidget(this,m_pLastEditedItem->m_pNetworkData); + m_pNetworkDetailsDialog = new IrcNetworkDetailsWidget(this, m_pLastEditedItem->m_pNetworkData); int retCode = m_pNetworkDetailsDialog->exec(); if(retCode == QDialog::Accepted) diff --git a/src/modules/options/OptionsWidget_servers.h b/src/modules/options/OptionsWidget_servers.h index 2b41dc206..1f8868a8d 100644 --- a/src/modules/options/OptionsWidget_servers.h +++ b/src/modules/options/OptionsWidget_servers.h @@ -49,16 +49,17 @@ class KviIrcNetwork; class KviIrcNetworkData; class KviMexServerImport; - class IrcServerOptionsTreeWidgetItem : public QTreeWidgetItem { public: - IrcServerOptionsTreeWidgetItem(QTreeWidget *parent,const QPixmap &pm,const KviIrcNetwork *n); - IrcServerOptionsTreeWidgetItem(QTreeWidgetItem *parent,const QPixmap &pm,const KviIrcServer *s); + IrcServerOptionsTreeWidgetItem(QTreeWidget * parent, const QPixmap & pm, const KviIrcNetwork * n); + IrcServerOptionsTreeWidgetItem(QTreeWidgetItem * parent, const QPixmap & pm, const KviIrcServer * s); ~IrcServerOptionsTreeWidgetItem(); + public: KviIrcServer * m_pServerData; KviIrcNetwork * m_pNetworkData; + public: KviIrcServer * serverData() const { @@ -69,41 +70,43 @@ public: { return m_pNetworkData; } + public: void updateVisibleStrings(); }; - class IrcNetworkDetailsWidget : public QDialog { Q_OBJECT public: - IrcNetworkDetailsWidget(QWidget * par,KviIrcNetwork * d); + IrcNetworkDetailsWidget(QWidget * par, KviIrcNetwork * d); ~IrcNetworkDetailsWidget(); + protected: - KviScriptEditor * m_pOnConnectEditor; - KviScriptEditor * m_pOnLoginEditor; + KviScriptEditor * m_pOnConnectEditor; + KviScriptEditor * m_pOnLoginEditor; - QLineEdit * m_pUserEditor; - KviPasswordLineEdit * m_pPassEditor; - QLineEdit * m_pNickEditor; - QLineEdit * m_pAlternativeNickEditor; - QLineEdit * m_pRealEditor; - QLineEdit * m_pDescEditor; + QLineEdit * m_pUserEditor; + KviPasswordLineEdit * m_pPassEditor; + QLineEdit * m_pNickEditor; + QLineEdit * m_pAlternativeNickEditor; + QLineEdit * m_pRealEditor; + QLineEdit * m_pDescEditor; - QComboBox * m_pEncodingEditor; - QComboBox * m_pTextEncodingEditor; + QComboBox * m_pEncodingEditor; + QComboBox * m_pTextEncodingEditor; - QCheckBox * m_pAutoConnectCheck; + QCheckBox * m_pAutoConnectCheck; - QTreeWidget * m_pNickServTreeWidget; - QCheckBox * m_pNickServCheck; - QPushButton * m_pAddRuleButton; - QPushButton * m_pDelRuleButton; - QPushButton * m_pEditRuleButton; + QTreeWidget * m_pNickServTreeWidget; + QCheckBox * m_pNickServCheck; + QPushButton * m_pAddRuleButton; + QPushButton * m_pDelRuleButton; + QPushButton * m_pEditRuleButton; - QStringList m_lstChannels; + QStringList m_lstChannels; KviChannelListSelector * m_pChannelListSelector; + public: void fillData(KviIrcNetwork * d); protected slots: @@ -117,53 +120,54 @@ class IrcServerDetailsWidget : public QDialog { Q_OBJECT public: - IrcServerDetailsWidget(QWidget * par,KviIrcServer * s); + IrcServerDetailsWidget(QWidget * par, KviIrcServer * s); ~IrcServerDetailsWidget(); + protected: - QString m_szHostname; - QLabel * m_pHeaderLabel; - KviScriptEditor * m_pOnConnectEditor; - KviScriptEditor * m_pOnLoginEditor; - QLineEdit * m_pUserEditor; - KviPasswordLineEdit * m_pPassEditor; - KviPasswordLineEdit * m_pSaslPassEditor; - QLineEdit * m_pNickEditor; - QLineEdit * m_pAlternativeNickEditor; - QLineEdit * m_pSaslNickEditor; - QLineEdit * m_pRealEditor; - QLineEdit * m_pDescEditor; - QLineEdit * m_pIdEditor; - QComboBox * m_pLinkFilterEditor; - QComboBox * m_pEncodingEditor; - QComboBox * m_pTextEncodingEditor; - KviIpEditor * m_pIpEditor; - QCheckBox * m_pCacheIpCheck; - QCheckBox * m_pUseSSLCheck; - QCheckBox * m_pEnableCAPCheck; - QCheckBox * m_pEnableSTARTTLSCheck; - QCheckBox * m_pEnableSASLCheck; - QCheckBox * m_pUseDefaultInitUMode; - QCheckBox * m_pIMode; - QCheckBox * m_pWMode; - QCheckBox * m_pSMode; - QCheckBox * m_pUseAutoConnect; - QCheckBox * m_pUseIPV6Check; - QLineEdit * m_pPortEditor; - QStringList m_lstChannels; + QString m_szHostname; + QLabel * m_pHeaderLabel; + KviScriptEditor * m_pOnConnectEditor; + KviScriptEditor * m_pOnLoginEditor; + QLineEdit * m_pUserEditor; + KviPasswordLineEdit * m_pPassEditor; + KviPasswordLineEdit * m_pSaslPassEditor; + QLineEdit * m_pNickEditor; + QLineEdit * m_pAlternativeNickEditor; + QLineEdit * m_pSaslNickEditor; + QLineEdit * m_pRealEditor; + QLineEdit * m_pDescEditor; + QLineEdit * m_pIdEditor; + QComboBox * m_pLinkFilterEditor; + QComboBox * m_pEncodingEditor; + QComboBox * m_pTextEncodingEditor; + KviIpEditor * m_pIpEditor; + QCheckBox * m_pCacheIpCheck; + QCheckBox * m_pUseSSLCheck; + QCheckBox * m_pEnableCAPCheck; + QCheckBox * m_pEnableSTARTTLSCheck; + QCheckBox * m_pEnableSASLCheck; + QCheckBox * m_pUseDefaultInitUMode; + QCheckBox * m_pIMode; + QCheckBox * m_pWMode; + QCheckBox * m_pSMode; + QCheckBox * m_pUseAutoConnect; + QCheckBox * m_pUseIPV6Check; + QLineEdit * m_pPortEditor; + QStringList m_lstChannels; KviChannelListSelector * m_pChannelListSelector; - QComboBox * m_pProxyEditor; + QComboBox * m_pProxyEditor; protected slots: void useDefaultInitUModeToggled(bool); void portEditorTextChanged(const QString &); void useIPV6CheckToggled(bool); void useSSLCheckToggled(bool); + public: void setHeaderLabelText(); - void fillData(KviIrcServer *s); + void fillData(KviIrcServer * s); }; - #define KVI_OPTIONS_WIDGET_ICON_OptionsWidget_servers KviIconManager::ServerConfiguration #define KVI_OPTIONS_WIDGET_NAME_OptionsWidget_servers __tr2qs_no_lookup("Servers and Configuration") #define KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_servers __tr2qs_no_lookup("connection") @@ -176,48 +180,50 @@ class OptionsWidget_servers : public KviOptionsWidget public: OptionsWidget_servers(QWidget * parent); ~OptionsWidget_servers(); + protected: - QTreeWidget * m_pTreeWidget; - QLabel * m_pSrvNetLabel; - QLineEdit * m_pSrvNetEdit; - QLabel * m_pFilterLabel; - QLineEdit * m_pFilterEdit; - QPushButton * m_pDetailsButton; - QMenu * m_pRecentPopup; - QMenu * m_pContextPopup; - QMenu * m_pImportPopup; - KviIrcServer * m_pClipboard; - QPushButton * m_pConnectCurrent; - QPushButton * m_pConnectNew; + QTreeWidget * m_pTreeWidget; + QLabel * m_pSrvNetLabel; + QLineEdit * m_pSrvNetEdit; + QLabel * m_pFilterLabel; + QLineEdit * m_pFilterEdit; + QPushButton * m_pDetailsButton; + QMenu * m_pRecentPopup; + QMenu * m_pContextPopup; + QMenu * m_pImportPopup; + KviIrcServer * m_pClipboard; + QPushButton * m_pConnectCurrent; + QPushButton * m_pConnectNew; IrcServerOptionsTreeWidgetItem * m_pLastEditedItem; - IrcServerDetailsWidget * m_pServerDetailsDialog; - IrcNetworkDetailsWidget * m_pNetworkDetailsDialog; - KviMexServerImport * m_pImportFilter; - KviBoolSelector * m_pShowThisDialogAtStartupSelector; - KviBoolSelector * m_pShowFavoritesOnly; - - QToolButton * m_pNewServerButton; - QToolButton * m_pNewNetworkButton; - QToolButton * m_pRemoveButton; - QToolButton * m_pFavoriteServer; - QToolButton * m_pCopyServerButton; - QToolButton * m_pPasteServerButton; - QToolButton * m_pImportButton; - QToolButton * m_pFavoriteServerButton; - bool m_bShowingFavoritesOnly; - QToolButton * m_pShowFavoritesOnlyButton; + IrcServerDetailsWidget * m_pServerDetailsDialog; + IrcNetworkDetailsWidget * m_pNetworkDetailsDialog; + KviMexServerImport * m_pImportFilter; + KviBoolSelector * m_pShowThisDialogAtStartupSelector; + KviBoolSelector * m_pShowFavoritesOnly; + + QToolButton * m_pNewServerButton; + QToolButton * m_pNewNetworkButton; + QToolButton * m_pRemoveButton; + QToolButton * m_pFavoriteServer; + QToolButton * m_pCopyServerButton; + QToolButton * m_pPasteServerButton; + QToolButton * m_pImportButton; + QToolButton * m_pFavoriteServerButton; + bool m_bShowingFavoritesOnly; + QToolButton * m_pShowFavoritesOnlyButton; + private: void fillServerList(); void saveLastItem(); - IrcServerOptionsTreeWidgetItem * findNetItem(const QString &netname); - void selectBestServerByUrl(const QString &szUrl); + IrcServerOptionsTreeWidgetItem * findNetItem(const QString & netname); + void selectBestServerByUrl(const QString & szUrl); protected slots: void slotShowThisDialogAtStartupSelectorDestroyed(); void importerDead(); - void importServer(const KviIrcServer & s,const QString &network); + void importServer(const KviIrcServer & s, const QString & network); void importPopupAboutToShow(); - void currentItemChanged(QTreeWidgetItem *cur,QTreeWidgetItem *prev); - void customContextMenuRequested(const QPoint &pnt); + void currentItemChanged(QTreeWidgetItem * cur, QTreeWidgetItem * prev); + void customContextMenuRequested(const QPoint & pnt); void newNetwork(); void removeCurrent(); void newServer(); @@ -226,14 +232,15 @@ protected slots: void copyServer(); void pasteServer(); void clearList(); - void itemDoubleClicked(QTreeWidgetItem*, int ); + void itemDoubleClicked(QTreeWidgetItem *, int); void detailsClicked(); void connectCurrentClicked(); void recentServersPopupAboutToShow(); - void recentServersPopupClicked(QAction *pAction); - void importPopupActivated(QAction *pAction); - void serverNetworkEditTextEdited(const QString &szNewText); - void filterTextEdited(const QString &szNewText); + void recentServersPopupClicked(QAction * pAction); + void importPopupActivated(QAction * pAction); + void serverNetworkEditTextEdited(const QString & szNewText); + void filterTextEdited(const QString & szNewText); + public: virtual void commit(); }; diff --git a/src/modules/options/OptionsWidget_sound.cpp b/src/modules/options/OptionsWidget_sound.cpp index 6ec1f1c96..e22cdbf7f 100644 --- a/src/modules/options/OptionsWidget_sound.cpp +++ b/src/modules/options/OptionsWidget_sound.cpp @@ -37,13 +37,10 @@ #include #include - // FIXME: This module doesn't ???? properly when auto-detection is performed! - - OptionsWidget_sound::OptionsWidget_sound(QWidget * pParent) -: KviOptionsWidget(pParent) + : KviOptionsWidget(pParent) { } @@ -51,54 +48,54 @@ OptionsWidget_sound::~OptionsWidget_sound() { } - OptionsWidget_soundGeneral::OptionsWidget_soundGeneral(QWidget * parent) -: KviOptionsWidget(parent) + : KviOptionsWidget(parent) { m_bFirstShow = true; setObjectName("sound_system_options_widget"); createLayout(); - KviTalGroupBox * g = addGroupBox(0,0,0,0,Qt::Horizontal,__tr2qs_ctx("Sound System","options"),true); + KviTalGroupBox * g = addGroupBox(0, 0, 0, 0, Qt::Horizontal, __tr2qs_ctx("Sound System", "options"), true); - KviTalToolTip::add(g,__tr2qs_ctx("This allows you to select the sound system to be used with KVIrc.","options")); + KviTalToolTip::add(g, __tr2qs_ctx("This allows you to select the sound system to be used with KVIrc.", "options")); KviTalHBox * h = new KviTalHBox(g); m_pSoundSystemBox = new QComboBox(h); - m_pSoundAutoDetectButton = new QPushButton(__tr2qs_ctx("Auto-detect","options"),h); - connect(m_pSoundAutoDetectButton,SIGNAL(clicked()),this,SLOT(soundAutoDetect())); + m_pSoundAutoDetectButton = new QPushButton(__tr2qs_ctx("Auto-detect", "options"), h); + connect(m_pSoundAutoDetectButton, SIGNAL(clicked()), this, SLOT(soundAutoDetect())); - m_pSoundTestButton = new QPushButton(__tr2qs_ctx("Test","options"),h); - connect(m_pSoundTestButton,SIGNAL(clicked()),this,SLOT(soundTest())); + m_pSoundTestButton = new QPushButton(__tr2qs_ctx("Test", "options"), h); + connect(m_pSoundTestButton, SIGNAL(clicked()), this, SLOT(soundTest())); - g = addGroupBox(0,1,0,1,Qt::Horizontal,__tr2qs_ctx("Media Player","options"),true); + g = addGroupBox(0, 1, 0, 1, Qt::Horizontal, __tr2qs_ctx("Media Player", "options"), true); - KviTalToolTip::add(g,__tr2qs_ctx("This allows you to select the preferred media player to be used with " \ - "the mediaplayer.* module commands and functions.","options")); + KviTalToolTip::add(g, __tr2qs_ctx("This allows you to select the preferred media player to be used with " + "the mediaplayer.* module commands and functions.", + "options")); h = new KviTalHBox(g); m_pMediaPlayerBox = new QComboBox(h); - m_pMediaAutoDetectButton = new QPushButton(__tr2qs_ctx("Auto-detect","options"),h); - connect(m_pMediaAutoDetectButton,SIGNAL(clicked()),this,SLOT(mediaAutoDetect())); + m_pMediaAutoDetectButton = new QPushButton(__tr2qs_ctx("Auto-detect", "options"), h); + connect(m_pMediaAutoDetectButton, SIGNAL(clicked()), this, SLOT(mediaAutoDetect())); - m_pMediaTestButton = new QPushButton(__tr2qs_ctx("Test","options"),h); - connect(m_pMediaTestButton,SIGNAL(clicked()),this,SLOT(mediaTest())); + m_pMediaTestButton = new QPushButton(__tr2qs_ctx("Test", "options"), h); + connect(m_pMediaTestButton, SIGNAL(clicked()), this, SLOT(mediaTest())); m_pMediaTestButton->setEnabled(false); - g = addGroupBox(0,2,0,2,Qt::Horizontal,__tr2qs_ctx("ID3 Tags Encoding","options"),true); + g = addGroupBox(0, 2, 0, 2, Qt::Horizontal, __tr2qs_ctx("ID3 Tags Encoding", "options"), true); - KviTalToolTip::add(g,__tr2qs_ctx("This allows you to select encoding of mp3 tags.","options")); + KviTalToolTip::add(g, __tr2qs_ctx("This allows you to select encoding of mp3 tags.", "options")); h = new KviTalHBox(g); m_pTagsEncodingCombo = new QComboBox(h); - m_pTagsEncodingCombo->addItem(__tr2qs_ctx("Use Language Encoding","options")); + m_pTagsEncodingCombo->addItem(__tr2qs_ctx("Use Language Encoding", "options")); int i = 0; int iMatch = 0; @@ -106,45 +103,44 @@ OptionsWidget_soundGeneral::OptionsWidget_soundGeneral(QWidget * parent) KviLocale::EncodingDescription * d = KviLocale::instance()->encodingDescription(i); while(d->pcName) { - if(KviQString::equalCI(d->pcName,KVI_OPTION_STRING(KviOption_stringMp3TagsEncoding))) + if(KviQString::equalCI(d->pcName, KVI_OPTION_STRING(KviOption_stringMp3TagsEncoding))) iMatch = i + 1; - m_pTagsEncodingCombo->insertItem(m_pTagsEncodingCombo->count(),d->pcName); + m_pTagsEncodingCombo->insertItem(m_pTagsEncodingCombo->count(), d->pcName); i++; d = KviLocale::instance()->encodingDescription(i); } m_pTagsEncodingCombo->setCurrentIndex(iMatch); #if defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW) - g = addGroupBox(0,3,0,3,Qt::Horizontal,__tr2qs_ctx("Winamp messages encoding","options"),true); + g = addGroupBox(0, 3, 0, 3, Qt::Horizontal, __tr2qs_ctx("Winamp messages encoding", "options"), true); - KviTalToolTip::add(g,__tr2qs_ctx("This allows you to select encoding of winamp messages.","options")); + KviTalToolTip::add(g, __tr2qs_ctx("This allows you to select encoding of winamp messages.", "options")); h = new KviTalHBox(g); m_pWinampEncodingCombo = new QComboBox(h); - m_pWinampEncodingCombo->addItem(__tr2qs_ctx("Use Language Encoding","options")); + m_pWinampEncodingCombo->addItem(__tr2qs_ctx("Use Language Encoding", "options")); i = 0; iMatch = 0; d = KviLocale::instance()->encodingDescription(i); while(d->pcName) { - if(KviQString::equalCI(d->pcName,KVI_OPTION_STRING(KviOption_stringWinampTextEncoding))) + if(KviQString::equalCI(d->pcName, KVI_OPTION_STRING(KviOption_stringWinampTextEncoding))) iMatch = i + 1; - m_pWinampEncodingCombo->insertItem(m_pWinampEncodingCombo->count(),d->pcName); + m_pWinampEncodingCombo->insertItem(m_pWinampEncodingCombo->count(), d->pcName); i++; d = KviLocale::instance()->encodingDescription(i); } m_pWinampEncodingCombo->setCurrentIndex(iMatch); - addRowSpacer(0,4,0,4); + addRowSpacer(0, 4, 0, 4); #else - addRowSpacer(0,3,0,3); + addRowSpacer(0, 3, 0, 3); #endif } - OptionsWidget_soundGeneral::~OptionsWidget_soundGeneral() { } @@ -178,13 +174,13 @@ void OptionsWidget_soundGeneral::soundTest() QString szFileName; - if(!g_pApp->findAudioFile(szFileName,QString::fromUtf8("jingle.wav"))) + if(!g_pApp->findAudioFile(szFileName, QString::fromUtf8("jingle.wav"))) { qDebug("Can't find the jingle.wav file: was it shipped with your KVIrc installation?"); return; } - m->ctrl("play",&szFileName); + m->ctrl("play", &szFileName); KVI_OPTION_STRING(KviOption_stringSoundSystem) = szSavedSoundSystem; } @@ -201,7 +197,7 @@ void OptionsWidget_soundGeneral::soundAutoDetect() g_pApp->setOverrideCursor(Qt::WaitCursor); - m->ctrl("detectSoundSystem",0); + m->ctrl("detectSoundSystem", 0); soundFillBox(); g_pApp->restoreOverrideCursor(); @@ -215,7 +211,7 @@ void OptionsWidget_soundGeneral::mediaAutoDetect() g_pApp->setOverrideCursor(Qt::WaitCursor); - m->ctrl("detectMediaPlayer",0); + m->ctrl("detectMediaPlayer", 0); mediaFillBox(); g_pApp->restoreOverrideCursor(); @@ -232,21 +228,21 @@ void OptionsWidget_soundGeneral::soundFillBox() if(!m) goto disable; - if(!m->ctrl("getAvailableSoundSystems",&l)) + if(!m->ctrl("getAvailableSoundSystems", &l)) goto disable; m_pSoundSystemBox->clear(); - for ( it = l.begin(); it != l.end(); ++it ) + for(it = l.begin(); it != l.end(); ++it) { m_pSoundSystemBox->addItem(*it); } cnt = m_pSoundSystemBox->count(); - for(i=0;iitemText(i); - if(KviQString::equalCI(t,KVI_OPTION_STRING(KviOption_stringSoundSystem))) + if(KviQString::equalCI(t, KVI_OPTION_STRING(KviOption_stringSoundSystem))) { m_pSoundSystemBox->setCurrentIndex(i); break; @@ -269,19 +265,21 @@ void OptionsWidget_soundGeneral::mediaFillBox() int i; KviModule * m = g_pModuleManager->getModule("mediaplayer"); - if(!m)goto disable; - if(!m->ctrl("getAvailableMediaPlayers",&l))goto disable; + if(!m) + goto disable; + if(!m->ctrl("getAvailableMediaPlayers", &l)) + goto disable; m_pMediaPlayerBox->clear(); - for ( it = l.begin(); it != l.end(); ++it ) + for(it = l.begin(); it != l.end(); ++it) { m_pMediaPlayerBox->addItem(*it); } cnt = m_pMediaPlayerBox->count(); - for(i=0;iitemText(i); - if(KviQString::equalCI(t,KVI_OPTION_STRING(KviOption_stringPreferredMediaPlayer))) + if(KviQString::equalCI(t, KVI_OPTION_STRING(KviOption_stringPreferredMediaPlayer))) { m_pMediaPlayerBox->setCurrentIndex(i); break; @@ -311,42 +309,44 @@ void OptionsWidget_soundGeneral::commit() { // guess from locale KVI_OPTION_STRING(KviOption_stringMp3TagsEncoding) = ""; - } else { + } + else + { KVI_OPTION_STRING(KviOption_stringMp3TagsEncoding) = m_pTagsEncodingCombo->itemText(idx); } - #if defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW) idx = m_pWinampEncodingCombo->currentIndex(); if(idx <= 0) { // guess from locale KVI_OPTION_STRING(KviOption_stringWinampTextEncoding) = ""; - } else { + } + else + { KVI_OPTION_STRING(KviOption_stringWinampTextEncoding) = m_pWinampEncodingCombo->itemText(idx); } #endif } OptionsWidget_sounds::OptionsWidget_sounds(QWidget * parent) -: KviOptionsWidget(parent) + : KviOptionsWidget(parent) { setObjectName("sound_options_widget"); createLayout(); - addLabel(0,0,0,0,__tr2qs_ctx("New query opened:","options")); - addSoundSelector(1,0,1,0,"",KviOption_stringOnNewQueryOpenedSound); - - addLabel(0,1,0,1,__tr2qs_ctx("New message in inactive query:","options")); - addSoundSelector(1,1,1,1,"",KviOption_stringOnQueryMessageSound); + addLabel(0, 0, 0, 0, __tr2qs_ctx("New query opened:", "options")); + addSoundSelector(1, 0, 1, 0, "", KviOption_stringOnNewQueryOpenedSound); - addLabel(0,2,0,2,__tr2qs_ctx("Highlighted message in inactive window:","options")); - addSoundSelector(1,2,1,2,"",KviOption_stringOnHighlightedMessageSound); + addLabel(0, 1, 0, 1, __tr2qs_ctx("New message in inactive query:", "options")); + addSoundSelector(1, 1, 1, 1, "", KviOption_stringOnQueryMessageSound); - addLabel(0,3,0,3,__tr2qs_ctx("When I am kicked:","options")); - addSoundSelector(1,3,1,3,"",KviOption_stringOnMeKickedSound); + addLabel(0, 2, 0, 2, __tr2qs_ctx("Highlighted message in inactive window:", "options")); + addSoundSelector(1, 2, 1, 2, "", KviOption_stringOnHighlightedMessageSound); - addRowSpacer(0,4,1,4); + addLabel(0, 3, 0, 3, __tr2qs_ctx("When I am kicked:", "options")); + addSoundSelector(1, 3, 1, 3, "", KviOption_stringOnMeKickedSound); + addRowSpacer(0, 4, 1, 4); } OptionsWidget_sounds::~OptionsWidget_sounds() diff --git a/src/modules/options/OptionsWidget_sound.h b/src/modules/options/OptionsWidget_sound.h index 9fe90d5f9..06f7c2920 100644 --- a/src/modules/options/OptionsWidget_sound.h +++ b/src/modules/options/OptionsWidget_sound.h @@ -34,7 +34,6 @@ #define KVI_OPTIONS_WIDGET_PARENT_OptionsWidget_sound OptionsWidget_general #define KVI_OPTIONS_WIDGET_CONTAINER_OptionsWidget_sound true - class OptionsWidget_sound : public KviOptionsWidget { Q_OBJECT @@ -55,6 +54,7 @@ class OptionsWidget_soundGeneral : public KviOptionsWidget public: OptionsWidget_soundGeneral(QWidget * parent); ~OptionsWidget_soundGeneral(); + protected: QComboBox * m_pSoundSystemBox; QPushButton * m_pSoundTestButton; @@ -68,11 +68,12 @@ protected: #endif QComboBox * m_pTagsEncodingCombo; bool m_bFirstShow; + protected: void soundFillBox(); void mediaFillBox(); virtual void commit(); - virtual void showEvent(QShowEvent *e); + virtual void showEvent(QShowEvent * e); protected slots: void soundTest(); void soundAutoDetect(); diff --git a/src/modules/options/OptionsWidget_textEncoding.cpp b/src/modules/options/OptionsWidget_textEncoding.cpp index e006383c1..f0084e6e3 100644 --- a/src/modules/options/OptionsWidget_textEncoding.cpp +++ b/src/modules/options/OptionsWidget_textEncoding.cpp @@ -39,44 +39,44 @@ QString g_szPrevSettedLocale; OptionsWidget_textEncoding::OptionsWidget_textEncoding(QWidget * parent) -: KviOptionsWidget(parent) + : KviOptionsWidget(parent) { setObjectName("textencoding_options_widget"); createLayout(); - KviTalGroupBox* gbox = addGroupBox(0,0,0,0,Qt::Horizontal,__tr2qs_ctx("Encoding","options")); - QGridLayout* grid = new QGridLayout; + KviTalGroupBox * gbox = addGroupBox(0, 0, 0, 0, Qt::Horizontal, __tr2qs_ctx("Encoding", "options")); + QGridLayout * grid = new QGridLayout; gbox->setLayout(grid); //server encoding - grid->addWidget(addLabel(gbox,__tr2qs_ctx("Default server encoding:","options")),0,0); + grid->addWidget(addLabel(gbox, __tr2qs_ctx("Default server encoding:", "options")), 0, 0); m_pSrvEncodingCombo = new QComboBox(gbox); - grid->addWidget(m_pSrvEncodingCombo,0,1); + grid->addWidget(m_pSrvEncodingCombo, 0, 1); - m_pSrvEncodingCombo->addItem(__tr2qs_ctx("Use Language Encoding","options")); + m_pSrvEncodingCombo->addItem(__tr2qs_ctx("Use Language Encoding", "options")); //text encoding - grid->addWidget(addLabel(gbox,__tr2qs_ctx("Default text encoding:","options")),1,0); + grid->addWidget(addLabel(gbox, __tr2qs_ctx("Default text encoding:", "options")), 1, 0); m_pTextEncodingCombo = new QComboBox(gbox); - grid->addWidget(m_pTextEncodingCombo,1,1); + grid->addWidget(m_pTextEncodingCombo, 1, 1); - m_pTextEncodingCombo->addItem(__tr2qs_ctx("Use Language Encoding","options")); + m_pTextEncodingCombo->addItem(__tr2qs_ctx("Use Language Encoding", "options")); //common between text and server encoding int i = 0; - int iTextMatch = 0, iSrvMatch=0; + int iTextMatch = 0, iSrvMatch = 0; KviLocale::EncodingDescription * d = KviLocale::instance()->encodingDescription(i); while(d->pcName) { - if(KviQString::equalCI(d->pcName,KVI_OPTION_STRING(KviOption_stringDefaultTextEncoding))) + if(KviQString::equalCI(d->pcName, KVI_OPTION_STRING(KviOption_stringDefaultTextEncoding))) iTextMatch = i + 1; - if(KviQString::equalCI(d->pcName,KVI_OPTION_STRING(KviOption_stringDefaultSrvEncoding))) + if(KviQString::equalCI(d->pcName, KVI_OPTION_STRING(KviOption_stringDefaultSrvEncoding))) iSrvMatch = i + 1; - m_pTextEncodingCombo->insertItem(m_pTextEncodingCombo->count(),d->pcName); - m_pSrvEncodingCombo->insertItem(m_pSrvEncodingCombo->count(),d->pcName); + m_pTextEncodingCombo->insertItem(m_pTextEncodingCombo->count(), d->pcName); + m_pSrvEncodingCombo->insertItem(m_pSrvEncodingCombo->count(), d->pcName); i++; d = KviLocale::instance()->encodingDescription(i); } @@ -84,23 +84,23 @@ OptionsWidget_textEncoding::OptionsWidget_textEncoding(QWidget * parent) m_pTextEncodingCombo->setCurrentIndex(iTextMatch); m_pSrvEncodingCombo->setCurrentIndex(iSrvMatch); - gbox = addGroupBox(0,1,0,1,Qt::Horizontal,__tr2qs_ctx("Language","options")); + gbox = addGroupBox(0, 1, 0, 1, Qt::Horizontal, __tr2qs_ctx("Language", "options")); grid = new QGridLayout; gbox->setLayout(grid); - grid->addWidget(addLabel(gbox,__tr2qs_ctx("Force language:","options")),0,0); + grid->addWidget(addLabel(gbox, __tr2qs_ctx("Force language:", "options")), 0, 0); m_pForcedLocaleCombo = new QComboBox(gbox); - grid->addWidget(m_pForcedLocaleCombo,0,1); + grid->addWidget(m_pForcedLocaleCombo, 0, 1); - grid->addWidget(addLabel(gbox,__tr2qs_ctx("Note: You must restart KVIrc to apply any language changes","options")),1,0,1,2); + grid->addWidget(addLabel(gbox, __tr2qs_ctx("Note: You must restart KVIrc to apply any language changes", "options")), 1, 0, 1, 2); - m_pForcedLocaleCombo->addItem(__tr2qs_ctx("Automatic detection","options")); - m_pForcedLocaleCombo->addItem(__tr2qs_ctx("en","options")); + m_pForcedLocaleCombo->addItem(__tr2qs_ctx("Automatic detection", "options")); + m_pForcedLocaleCombo->addItem(__tr2qs_ctx("en", "options")); QString szLangFile; - g_pApp->getLocalKvircDirectory(szLangFile,KviApplication::None,KVI_FORCE_LOCALE_FILE_NAME); + g_pApp->getLocalKvircDirectory(szLangFile, KviApplication::None, KVI_FORCE_LOCALE_FILE_NAME); bool bIsDefaultLocale = !KviFileUtils::fileExists(szLangFile); //We Have setted locale, but not restarted kvirc @@ -110,40 +110,41 @@ OptionsWidget_textEncoding::OptionsWidget_textEncoding(QWidget * parent) m_szLanguage = KviLocale::instance()->localeName(); QString szLocaleDir; - g_pApp->getGlobalKvircDirectory(szLocaleDir,KviApplication::Locale); + g_pApp->getGlobalKvircDirectory(szLocaleDir, KviApplication::Locale); - QStringList list=QDir(szLocaleDir).entryList(QStringList("kvirc_*.mo"),QDir::Files); + QStringList list = QDir(szLocaleDir).entryList(QStringList("kvirc_*.mo"), QDir::Files); i = 0; int iMatch = 0; for(QStringList::Iterator it = list.begin(); it != list.end(); ++it) { - QString szTmp=*it; - szTmp.replace("kvirc_",""); - szTmp.replace(".mo",""); - m_pForcedLocaleCombo->insertItem(m_pForcedLocaleCombo->count(),szTmp); - if(KviQString::equalCI(szTmp,m_szLanguage)) + QString szTmp = *it; + szTmp.replace("kvirc_", ""); + szTmp.replace(".mo", ""); + m_pForcedLocaleCombo->insertItem(m_pForcedLocaleCombo->count(), szTmp); + if(KviQString::equalCI(szTmp, m_szLanguage)) iMatch = i + 2; i++; } if(bIsDefaultLocale) m_pForcedLocaleCombo->setCurrentIndex(0); - else if(KviQString::equalCI(m_szLanguage,"en")) + else if(KviQString::equalCI(m_szLanguage, "en")) m_pForcedLocaleCombo->setCurrentIndex(1); else m_pForcedLocaleCombo->setCurrentIndex(iMatch); #ifdef COMPILE_ENCHANT_SUPPORT { - gbox = addGroupBox(0,2,0,2,Qt::Horizontal,__tr2qs_ctx("Spell Checker Dictionaries","options")); + gbox = addGroupBox(0, 2, 0, 2, Qt::Horizontal, __tr2qs_ctx("Spell Checker Dictionaries", "options")); KviKvsVariant availableDictionaries; KviKvsScript::evaluate("$spellchecker.availableDictionaries", NULL, NULL, &availableDictionaries); - const KviPointerHashTable* hashTable = availableDictionaries.hash()->dict(); + const KviPointerHashTable * hashTable = availableDictionaries.hash()->dict(); KviPointerHashTableIterator iter(*hashTable); QMap dictMap; - for (bool b = iter.moveFirst(); b; b = iter.moveNext()) { + for(bool b = iter.moveFirst(); b; b = iter.moveNext()) + { QString szDescription; iter.current()->asString(szDescription); dictMap[iter.currentKey()] = szDescription; @@ -162,22 +163,23 @@ OptionsWidget_textEncoding::OptionsWidget_textEncoding(QWidget * parent) m_pSpellCheckerDictionaries->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); int row = 0; - for (QMap::iterator it = dictMap.begin(); it != dictMap.end(); ++it, ++row) { - QTableWidgetItem* itemLang = new QTableWidgetItem(it.key()); + for(QMap::iterator it = dictMap.begin(); it != dictMap.end(); ++it, ++row) + { + QTableWidgetItem * itemLang = new QTableWidgetItem(it.key()); itemLang->setCheckState(KVI_OPTION_STRINGLIST(KviOption_stringlistSpellCheckerDictionaries).contains(it.key()) ? Qt::Checked : Qt::Unchecked); itemLang->setFlags(itemLang->flags() & ~Qt::ItemIsEditable); - m_pSpellCheckerDictionaries->setItem(row,0,itemLang); + m_pSpellCheckerDictionaries->setItem(row, 0, itemLang); - QTableWidgetItem* itemDesc = new QTableWidgetItem(it.value()); + QTableWidgetItem * itemDesc = new QTableWidgetItem(it.value()); itemDesc->setFlags(itemDesc->flags() & ~Qt::ItemIsEditable); - m_pSpellCheckerDictionaries->setItem(row,1,itemDesc); + m_pSpellCheckerDictionaries->setItem(row, 1, itemDesc); } m_pSpellCheckerDictionaries->resizeColumnsToContents(); m_pSpellCheckerDictionaries->resizeRowsToContents(); } #else - addRowSpacer(0,2,0,2); + addRowSpacer(0, 2, 0, 2); #endif } @@ -192,7 +194,9 @@ void OptionsWidget_textEncoding::commit() { // guess from locale KVI_OPTION_STRING(KviOption_stringDefaultTextEncoding) = ""; - } else { + } + else + { KVI_OPTION_STRING(KviOption_stringDefaultTextEncoding) = m_pTextEncodingCombo->itemText(idx); } @@ -201,21 +205,26 @@ void OptionsWidget_textEncoding::commit() { // guess from locale KVI_OPTION_STRING(KviOption_stringDefaultSrvEncoding) = ""; - } else { + } + else + { KVI_OPTION_STRING(KviOption_stringDefaultSrvEncoding) = m_pSrvEncodingCombo->itemText(idx); } - idx=m_pForcedLocaleCombo->currentIndex(); + idx = m_pForcedLocaleCombo->currentIndex(); QString szLangFile; - g_pApp->getLocalKvircDirectory(szLangFile,KviApplication::None,KVI_FORCE_LOCALE_FILE_NAME); - if(idx==0) { + g_pApp->getLocalKvircDirectory(szLangFile, KviApplication::None, KVI_FORCE_LOCALE_FILE_NAME); + if(idx == 0) + { if(KviFileUtils::fileExists(szLangFile)) KviFileUtils::removeFile(szLangFile); - } else { - g_szPrevSettedLocale=m_pForcedLocaleCombo->itemText(idx); - if(!KviFileUtils::writeFile(szLangFile,m_pForcedLocaleCombo->itemText(idx))) + } + else + { + g_szPrevSettedLocale = m_pForcedLocaleCombo->itemText(idx); + if(!KviFileUtils::writeFile(szLangFile, m_pForcedLocaleCombo->itemText(idx))) { - QMessageBox::critical(this,"KVIrc",__tr2qs_ctx("Unable to write language information to","options")+"\n"+szLangFile,__tr2qs_ctx("OK","options")); + QMessageBox::critical(this, "KVIrc", __tr2qs_ctx("Unable to write language information to", "options") + "\n" + szLangFile, __tr2qs_ctx("OK", "options")); } } /* if(!KviQString::equalCI(m_pForcedLocaleCombo->text(idx),m_szLanguage)) @@ -223,9 +232,11 @@ void OptionsWidget_textEncoding::commit() #ifdef COMPILE_ENCHANT_SUPPORT QStringList wantedDictionaries; - for (int i = 0; i < m_pSpellCheckerDictionaries->rowCount(); ++i) { - if (m_pSpellCheckerDictionaries->item(i,0)->checkState() == Qt::Checked) { - wantedDictionaries << m_pSpellCheckerDictionaries->item(i,0)->text(); + for(int i = 0; i < m_pSpellCheckerDictionaries->rowCount(); ++i) + { + if(m_pSpellCheckerDictionaries->item(i, 0)->checkState() == Qt::Checked) + { + wantedDictionaries << m_pSpellCheckerDictionaries->item(i, 0)->text(); } } KVI_OPTION_STRINGLIST(KviOption_stringlistSpellCheckerDictionaries) = wantedDictionaries; diff --git a/src/modules/options/OptionsWidget_textEncoding.h b/src/modules/options/OptionsWidget_textEncoding.h index e6fa7cae1..e5aa1f3e4 100644 --- a/src/modules/options/OptionsWidget_textEncoding.h +++ b/src/modules/options/OptionsWidget_textEncoding.h @@ -41,12 +41,14 @@ class OptionsWidget_textEncoding : public KviOptionsWidget public: OptionsWidget_textEncoding(QWidget * parent); ~OptionsWidget_textEncoding(); + protected: - QString m_szLanguage; + QString m_szLanguage; QComboBox * m_pTextEncodingCombo; QComboBox * m_pSrvEncodingCombo; QComboBox * m_pForcedLocaleCombo; QTableWidget * m_pSpellCheckerDictionaries; + public: virtual void commit(); }; diff --git a/src/modules/options/OptionsWidget_textIcons.cpp b/src/modules/options/OptionsWidget_textIcons.cpp index c55fef5bf..e07d6923e 100644 --- a/src/modules/options/OptionsWidget_textIcons.cpp +++ b/src/modules/options/OptionsWidget_textIcons.cpp @@ -42,36 +42,36 @@ #include #include -TextIconTableItem::TextIconTableItem(QTableWidget *,KviTextIcon * icon) -: QTableWidgetItem(QString(),Qt::ItemIsEditable) +TextIconTableItem::TextIconTableItem(QTableWidget *, KviTextIcon * icon) + : QTableWidgetItem(QString(), Qt::ItemIsEditable) { if(icon) - m_pIcon=icon; + m_pIcon = icon; else - m_pIcon=new KviTextIcon(KviIconManager::None); - QPixmap* pix=m_pIcon->pixmap(); - if(pix) setIcon(QIcon(*pix)); + m_pIcon = new KviTextIcon(KviIconManager::None); + QPixmap * pix = m_pIcon->pixmap(); + if(pix) + setIcon(QIcon(*pix)); } TextIconTableItem::~TextIconTableItem() { delete m_pIcon; - } void TextIconTableItem::setId(int id) { m_pIcon->setId(id); - QPixmap* pix=m_pIcon->pixmap(); - if(pix) setIcon(QIcon(*pix)); + QPixmap * pix = m_pIcon->pixmap(); + if(pix) + setIcon(QIcon(*pix)); } - OptionsWidget_textIcons::OptionsWidget_textIcons(QWidget * parent) -: KviOptionsWidget(parent) + : KviOptionsWidget(parent) { - m_pPopup=0; - m_iLastEditedRow=-1; + m_pPopup = 0; + m_iLastEditedRow = -1; m_pCurrentIconButton = 0; setObjectName("texticons_options_widget"); createLayout(); @@ -79,33 +79,34 @@ OptionsWidget_textIcons::OptionsWidget_textIcons(QWidget * parent) m_pTable = new QTableWidget(this); m_pTable->setColumnCount(2); - m_pTable->setColumnWidth(0,300); + m_pTable->setColumnWidth(0, 300); m_pTable->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch); m_pTable->horizontalHeader()->stretchLastSection(); m_pTable->setSelectionBehavior(QAbstractItemView::SelectRows); m_pTable->setSelectionMode(QAbstractItemView::SingleSelection); m_pTable->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); - mergeTip(m_pTable->viewport(),__tr2qs_ctx("This table contains the text icon associations.
" \ - "KVirc will use them to display the CTRL+I escape sequences and eventually the " \ - "emoticons.","options")); + mergeTip(m_pTable->viewport(), __tr2qs_ctx("This table contains the text icon associations.
" + "KVirc will use them to display the CTRL+I escape sequences and eventually the " + "emoticons.", + "options")); - layout()->addWidget(m_pTable,0,0,1,3); + layout()->addWidget(m_pTable, 0, 0, 1, 3); - m_pAdd = new QPushButton(__tr2qs_ctx("Add","options"),this); - layout()->addWidget(m_pAdd,1,0); - connect(m_pAdd,SIGNAL(clicked()),this,SLOT(addClicked())); + m_pAdd = new QPushButton(__tr2qs_ctx("Add", "options"), this); + layout()->addWidget(m_pAdd, 1, 0); + connect(m_pAdd, SIGNAL(clicked()), this, SLOT(addClicked())); - m_pDel = new QPushButton(__tr2qs_ctx("Delete","options"),this); - layout()->addWidget(m_pDel,1,1); - connect(m_pDel,SIGNAL(clicked()),this,SLOT(delClicked())); + m_pDel = new QPushButton(__tr2qs_ctx("Delete", "options"), this); + layout()->addWidget(m_pDel, 1, 1); + connect(m_pDel, SIGNAL(clicked()), this, SLOT(delClicked())); - m_pRestore = new QPushButton(__tr2qs_ctx("Restore","options"),this); - layout()->addWidget(m_pRestore,1,2); - connect(m_pRestore,SIGNAL(clicked()),this,SLOT(restoreClicked())); + m_pRestore = new QPushButton(__tr2qs_ctx("Restore", "options"), this); + layout()->addWidget(m_pRestore, 1, 2); + connect(m_pRestore, SIGNAL(clicked()), this, SLOT(restoreClicked())); - connect(m_pTable,SIGNAL(itemSelectionChanged()),this,SLOT(itemSelectionChanged())); - connect(m_pTable,SIGNAL(currentItemChanged(QTableWidgetItem *, QTableWidgetItem *)),this,SLOT(currentItemChanged(QTableWidgetItem *, QTableWidgetItem *))); + connect(m_pTable, SIGNAL(itemSelectionChanged()), this, SLOT(itemSelectionChanged())); + connect(m_pTable, SIGNAL(currentItemChanged(QTableWidgetItem *, QTableWidgetItem *)), this, SLOT(currentItemChanged(QTableWidgetItem *, QTableWidgetItem *))); fillTable(); } @@ -116,7 +117,7 @@ OptionsWidget_textIcons::~OptionsWidget_textIcons() void OptionsWidget_textIcons::fillTable() { - KviPointerHashTableIterator it(*(g_pTextIconManager->textIconDict())); + KviPointerHashTableIterator it(*(g_pTextIconManager->textIconDict())); m_pTable->clear(); QStringList header; @@ -126,20 +127,20 @@ void OptionsWidget_textIcons::fillTable() m_pTable->setRowCount(g_pTextIconManager->textIconDict()->count()); int idx = 0; - QTableWidgetItem *item0; - TextIconTableItem *item1; + QTableWidgetItem * item0; + TextIconTableItem * item1; while(KviTextIcon * i = it.current()) { - if(!m_pTable->item(idx,0)) + if(!m_pTable->item(idx, 0)) { item0 = new QTableWidgetItem(it.currentKey()); - m_pTable->setItem(idx,0,item0); + m_pTable->setItem(idx, 0, item0); } - item1 = new TextIconTableItem(m_pTable,new KviTextIcon(i)); + item1 = new TextIconTableItem(m_pTable, new KviTextIcon(i)); //remove from the item the ability to be edited as text item1->setFlags(item1->flags() ^ Qt::ItemIsEditable); - m_pTable->setItem(idx,1,item1); + m_pTable->setItem(idx, 1, item1); ++idx; ++it; @@ -153,9 +154,9 @@ void OptionsWidget_textIcons::doPopup() { if(!m_pPopup) { - m_pPopup = new QMenu(this); + m_pPopup = new QMenu(this); KviIconWidget * iw = new KviIconWidget(m_pPopup); - connect(iw,SIGNAL(selected(KviIconManager::SmallIcon)),this,SLOT(iconSelected(KviIconManager::SmallIcon))); + connect(iw, SIGNAL(selected(KviIconManager::SmallIcon)), this, SLOT(iconSelected(KviIconManager::SmallIcon))); QWidgetAction * pWaction = new QWidgetAction(m_pPopup); pWaction->setDefaultWidget(iw); m_pPopup->addAction(pWaction); @@ -168,26 +169,26 @@ void OptionsWidget_textIcons::iconSelected(KviIconManager::SmallIcon eIcon) m_pCurrentItem->icon()->setId(eIcon); m_pCurrentItem->setIcon(QIcon(*m_pCurrentItem->icon()->pixmap())); - KviTalHBox * pBox=new KviTalHBox(0); + KviTalHBox * pBox = new KviTalHBox(0); pBox->setSpacing(0); pBox->setMargin(0); m_pCurrentIconButton = new QToolButton(pBox); m_pCurrentIconButton->setMinimumWidth(150); m_pCurrentIconButton->setIcon(QIcon(*m_pCurrentItem->icon()->pixmap())); - connect(m_pCurrentIconButton,SIGNAL(clicked()),this,SLOT(doPopup())); + connect(m_pCurrentIconButton, SIGNAL(clicked()), this, SLOT(doPopup())); - QToolButton * pBrowseButton=new QToolButton(pBox); + QToolButton * pBrowseButton = new QToolButton(pBox); pBrowseButton->setText("..."); - connect(pBrowseButton,SIGNAL(clicked()),this,SLOT(chooseFromFile())); + connect(pBrowseButton, SIGNAL(clicked()), this, SLOT(chooseFromFile())); - m_pTable->setCellWidget(m_pCurrentItem->row(),1,pBox); + m_pTable->setCellWidget(m_pCurrentItem->row(), 1, pBox); } void OptionsWidget_textIcons::chooseFromFile() { QString szFile; - KviFileDialog::askForOpenFileName(szFile,__tr2qs_ctx("Select a File - KVIrc","options"),QString(),KVI_FILTER_IMAGE,false,true,this); + KviFileDialog::askForOpenFileName(szFile, __tr2qs_ctx("Select a File - KVIrc", "options"), QString(), KVI_FILTER_IMAGE, false, true, this); if(szFile.isEmpty()) return; @@ -199,18 +200,18 @@ void OptionsWidget_textIcons::chooseFromFile() QString szFileName = info.fileName(); QString szCurrentThemePath; - g_pApp->getLocalKvircDirectory(szCurrentThemePath,KviApplication::Themes,KVI_OPTION_STRING(KviOption_stringIconThemeSubdir)); + g_pApp->getLocalKvircDirectory(szCurrentThemePath, KviApplication::Themes, KVI_OPTION_STRING(KviOption_stringIconThemeSubdir)); szCurrentThemePath += KVI_PATH_SEPARATOR_CHAR; if(!KviFileUtils::directoryExists(szCurrentThemePath)) KviFileUtils::makeDir(szCurrentThemePath); - KviFileUtils::copyFile(szFile,szCurrentThemePath+szFileName); + KviFileUtils::copyFile(szFile, szCurrentThemePath + szFileName); m_pCurrentItem->icon()->setFilename(szFileName); - QPixmap *p = m_pCurrentItem->icon()->pixmap(); + QPixmap * p = m_pCurrentItem->icon()->pixmap(); m_pCurrentItem->setIcon(QIcon(*p)); if(m_pCurrentIconButton) @@ -223,13 +224,13 @@ void OptionsWidget_textIcons::itemSelectionChanged() m_pDel->setEnabled(i >= 0 && i < m_pTable->rowCount()); } -void OptionsWidget_textIcons::currentItemChanged(QTableWidgetItem *cur, QTableWidgetItem *prev) +void OptionsWidget_textIcons::currentItemChanged(QTableWidgetItem * cur, QTableWidgetItem * prev) { if(prev) { - QWidget * pOldWidget = m_pTable->cellWidget(prev->row(),1); + QWidget * pOldWidget = m_pTable->cellWidget(prev->row(), 1); if(pOldWidget) - m_pTable->setCellWidget(prev->row(),1,NULL); + m_pTable->setCellWidget(prev->row(), 1, NULL); } m_pCurrentItem = NULL; @@ -238,34 +239,34 @@ void OptionsWidget_textIcons::currentItemChanged(QTableWidgetItem *cur, QTableWi return; if(cur->column() != 1) return; - if(m_iLastEditedRow==cur->row() || cur == prev) + if(m_iLastEditedRow == cur->row() || cur == prev) return; m_pCurrentItem = (TextIconTableItem *)cur; - KviTalHBox * pBox=new KviTalHBox(0); + KviTalHBox * pBox = new KviTalHBox(0); pBox->setSpacing(0); pBox->setMargin(0); - m_pCurrentIconButton=new QToolButton(pBox); + m_pCurrentIconButton = new QToolButton(pBox); m_pCurrentIconButton->setMinimumWidth(150); m_pCurrentIconButton->setIcon(QIcon(cur->icon())); - connect(m_pCurrentIconButton,SIGNAL(clicked()),this,SLOT(doPopup())); + connect(m_pCurrentIconButton, SIGNAL(clicked()), this, SLOT(doPopup())); // FIXME: this does not work currently! - QToolButton * pBrowseButton=new QToolButton(pBox); + QToolButton * pBrowseButton = new QToolButton(pBox); pBrowseButton->setText("..."); - connect(pBrowseButton,SIGNAL(clicked()),this,SLOT(chooseFromFile())); + connect(pBrowseButton, SIGNAL(clicked()), this, SLOT(chooseFromFile())); - m_pTable->setCellWidget(cur->row(),1,pBox); - m_iLastEditedRow=cur->row(); + m_pTable->setCellWidget(cur->row(), 1, pBox); + m_iLastEditedRow = cur->row(); } void OptionsWidget_textIcons::addClicked() { m_pTable->setRowCount(m_pTable->rowCount() + 1); - m_pTable->setItem(m_pTable->rowCount() - 1,0,new QTableWidgetItem(__tr2qs_ctx("unnamed","options"))); - m_pTable->setItem(m_pTable->rowCount() - 1,1,new TextIconTableItem(m_pTable,0)); + m_pTable->setItem(m_pTable->rowCount() - 1, 0, new QTableWidgetItem(__tr2qs_ctx("unnamed", "options"))); + m_pTable->setItem(m_pTable->rowCount() - 1, 1, new TextIconTableItem(m_pTable, 0)); m_pTable->scrollToBottom(); m_pDel->setEnabled(true); } @@ -283,7 +284,8 @@ void OptionsWidget_textIcons::delClicked() if((i > -1) && (i < m_pTable->rowCount())) { m_pTable->removeRow(i); - if(m_pTable->rowCount() == 0) m_pDel->setEnabled(false); + if(m_pTable->rowCount() == 0) + m_pDel->setEnabled(false); } } @@ -292,26 +294,26 @@ void OptionsWidget_textIcons::commit() KviOptionsWidget::commit(); g_pTextIconManager->clear(); int n = m_pTable->rowCount(); - for(int i=0;i < n;i++) + for(int i = 0; i < n; i++) { - QString szVal = m_pTable->item(i,0)->text(); + QString szVal = m_pTable->item(i, 0)->text(); if(!szVal.isEmpty()) { - TextIconTableItem * it = (TextIconTableItem *)m_pTable->item(i,1); + TextIconTableItem * it = (TextIconTableItem *)m_pTable->item(i, 1); if(it) { - g_pTextIconManager->insert(szVal,*(it->icon())); + g_pTextIconManager->insert(szVal, *(it->icon())); } } } g_pTextIconManager->save(); - for(int i=0; icolumnCount(); j++) + for(int j = 0; j < m_pTable->columnCount(); j++) { - if(m_pTable->item(i,j)) - m_pTable->takeItem(i,j); + if(m_pTable->item(i, j)) + m_pTable->takeItem(i, j); } } } diff --git a/src/modules/options/OptionsWidget_textIcons.h b/src/modules/options/OptionsWidget_textIcons.h index 23885a3af..e1b78f2ba 100644 --- a/src/modules/options/OptionsWidget_textIcons.h +++ b/src/modules/options/OptionsWidget_textIcons.h @@ -41,16 +41,20 @@ class TextIconTableItem; class TextIconTableItem : public QTableWidgetItem { friend class OptionsWidget_textIcons; + public: - TextIconTableItem(QTableWidget * t,KviTextIcon * icon); + TextIconTableItem(QTableWidget * t, KviTextIcon * icon); ~TextIconTableItem(); + protected: KviTextIcon * m_pIcon; + public: - KviTextIcon * icon() { - return m_pIcon; }; + KviTextIcon * icon() + { + return m_pIcon; + }; void setId(int id); - }; class OptionsWidget_textIcons : public KviOptionsWidget @@ -59,22 +63,25 @@ class OptionsWidget_textIcons : public KviOptionsWidget public: OptionsWidget_textIcons(QWidget * parent); ~OptionsWidget_textIcons(); + protected: QTableWidget * m_pTable; int m_iLastEditedRow; - TextIconTableItem *m_pCurrentItem; - QPushButton * m_pAdd; - QPushButton * m_pDel; - QPushButton * m_pRestore; + TextIconTableItem * m_pCurrentItem; + QPushButton * m_pAdd; + QPushButton * m_pDel; + QPushButton * m_pRestore; QToolButton * m_pCurrentIconButton; - QMenu *m_pPopup; + QMenu * m_pPopup; + private: void fillTable(); + public: virtual void commit(); protected slots: void itemSelectionChanged(); - void currentItemChanged(QTableWidgetItem *cur, QTableWidgetItem *prev); + void currentItemChanged(QTableWidgetItem * cur, QTableWidgetItem * prev); void addClicked(); void delClicked(); void restoreClicked(); diff --git a/src/modules/options/OptionsWidget_theme.cpp b/src/modules/options/OptionsWidget_theme.cpp index 7ac5c5e50..41dfbf985 100644 --- a/src/modules/options/OptionsWidget_theme.cpp +++ b/src/modules/options/OptionsWidget_theme.cpp @@ -32,109 +32,112 @@ #include - OptionsWidget_theme::OptionsWidget_theme(QWidget * parent) -: KviOptionsWidget(parent) + : KviOptionsWidget(parent) { createLayout(); - KviBoolSelector * b = addBoolSelector(0,1,1,1,__tr2qs_ctx("Use global application font","options"),KviOption_boolUseGlobalApplicationFont); - KviTalToolTip::add(b,__tr2qs_ctx("This option will force a static font for every widget that has no specific font setting","options")); - addBoolSelector(0,0,1,0,__tr2qs_ctx("Show icons in popup menus","options"),KviOption_boolShowIconsInPopupMenus); - KviFontSelector * f = addFontSelector(0,2,1,2,__tr2qs_ctx("Global application font:","options"),KviOption_fontApplication, - KVI_OPTION_BOOL(KviOption_boolUseGlobalApplicationFont)); - connect(b,SIGNAL(toggled(bool)),f,SLOT(setEnabled(bool))); + KviBoolSelector * b = addBoolSelector(0, 1, 1, 1, __tr2qs_ctx("Use global application font", "options"), KviOption_boolUseGlobalApplicationFont); + KviTalToolTip::add(b, __tr2qs_ctx("This option will force a static font for every widget that has no specific font setting", "options")); + addBoolSelector(0, 0, 1, 0, __tr2qs_ctx("Show icons in popup menus", "options"), KviOption_boolShowIconsInPopupMenus); + KviFontSelector * f = addFontSelector(0, 2, 1, 2, __tr2qs_ctx("Global application font:", "options"), KviOption_fontApplication, + KVI_OPTION_BOOL(KviOption_boolUseGlobalApplicationFont)); + connect(b, SIGNAL(toggled(bool)), f, SLOT(setEnabled(bool))); - addRowSpacer(0,3,1,3); + addRowSpacer(0, 3, 1, 3); } OptionsWidget_theme::~OptionsWidget_theme() { } - OptionsWidget_themeTransparency::OptionsWidget_themeTransparency(QWidget * parent) -: KviOptionsWidget(parent) + : KviOptionsWidget(parent) { #ifdef COMPILE_PSEUDO_TRANSPARENCY createLayout(); - KviUIntSelector * u = addUIntSelector(0,0,1,0,__tr2qs_ctx("Global window opacity:","options"),KviOption_uintGlobalWindowOpacityPercent,50,100,100, true); + KviUIntSelector * u = addUIntSelector(0, 0, 1, 0, __tr2qs_ctx("Global window opacity:", "options"), KviOption_uintGlobalWindowOpacityPercent, 50, 100, 100, true); u->setSuffix("%"); - m_pUseTransparencyBoolSelector = addBoolSelector(0,1,1,1,__tr2qs_ctx("Enable transparency","options"),KviOption_boolUseGlobalPseudoTransparency); - #ifdef COMPILE_X11_SUPPORT - mergeTip(m_pUseTransparencyBoolSelector, - __tr2qs_ctx("This option makes all KVIrc windows look " \ - "transparent.
You must choose a blending " \ - "background image below or check the " \ - "\"Use compositing for real transparency\" option.","options")); - #elif defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW) - mergeTip(m_pUseTransparencyBoolSelector, - __tr2qs_ctx("This option makes all KVIrc windows look " \ - "transparent.
You must choose a blending " \ - "background image below or check the " \ - "\"Use desktop background for transparency\" option.","options")); - #else - mergeTip(m_pUseTransparencyBoolSelector, - __tr2qs_ctx("This option makes all KVIrc windows look " \ - "like transparent.
You must choose a blending " \ - "background image below.","options")); - #endif - - u = addUIntSelector(0,2,1,2,__tr2qs_ctx("Child window opacity:","options"),KviOption_uintGlobalTransparencyChildFadeFactor,0,100,35, - KVI_OPTION_BOOL(KviOption_boolUseGlobalPseudoTransparency)); + m_pUseTransparencyBoolSelector = addBoolSelector(0, 1, 1, 1, __tr2qs_ctx("Enable transparency", "options"), KviOption_boolUseGlobalPseudoTransparency); +#ifdef COMPILE_X11_SUPPORT + mergeTip(m_pUseTransparencyBoolSelector, + __tr2qs_ctx("This option makes all KVIrc windows look " + "transparent.
You must choose a blending " + "background image below or check the " + "\"Use compositing for real transparency\" option.", + "options")); +#elif defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW) + mergeTip(m_pUseTransparencyBoolSelector, + __tr2qs_ctx("This option makes all KVIrc windows look " + "transparent.
You must choose a blending " + "background image below or check the " + "\"Use desktop background for transparency\" option.", + "options")); +#else + mergeTip(m_pUseTransparencyBoolSelector, + __tr2qs_ctx("This option makes all KVIrc windows look " + "like transparent.
You must choose a blending " + "background image below.", + "options")); +#endif + + u = addUIntSelector(0, 2, 1, 2, __tr2qs_ctx("Child window opacity:", "options"), KviOption_uintGlobalTransparencyChildFadeFactor, 0, 100, 35, + KVI_OPTION_BOOL(KviOption_boolUseGlobalPseudoTransparency)); u->setSuffix("%"); - connect(m_pUseTransparencyBoolSelector,SIGNAL(toggled(bool)),u,SLOT(setEnabled(bool))); + connect(m_pUseTransparencyBoolSelector, SIGNAL(toggled(bool)), u, SLOT(setEnabled(bool))); - u = addUIntSelector(0,3,1,3,__tr2qs_ctx("Parent window opacity:","options"),KviOption_uintGlobalTransparencyParentFadeFactor,0,100,10, - KVI_OPTION_BOOL(KviOption_boolUseGlobalPseudoTransparency)); + u = addUIntSelector(0, 3, 1, 3, __tr2qs_ctx("Parent window opacity:", "options"), KviOption_uintGlobalTransparencyParentFadeFactor, 0, 100, 10, + KVI_OPTION_BOOL(KviOption_boolUseGlobalPseudoTransparency)); u->setSuffix("%"); - connect(m_pUseTransparencyBoolSelector,SIGNAL(toggled(bool)),u,SLOT(setEnabled(bool))); - - KviColorSelector * c = addColorSelector(0,4,1,4,__tr2qs_ctx("Blend color:","options"),KviOption_colorGlobalTransparencyFade, - KVI_OPTION_BOOL(KviOption_boolUseGlobalPseudoTransparency)); - connect(m_pUseTransparencyBoolSelector,SIGNAL(toggled(bool)),c,SLOT(setEnabled(bool))); - - #ifdef COMPILE_X11_SUPPORT - m_pUseCompositingForTransparencyBoolSelector = addBoolSelector(0,5,1,5,__tr2qs_ctx("Use compositing for real transparency","options"),KviOption_boolUseCompositingForTransparency, - KVI_OPTION_BOOL(KviOption_boolUseGlobalPseudoTransparency)); - - m_pGlobalBackgroundPixmapSelector = addPixmapSelector(0,6,1,6,__tr2qs_ctx("Transparency blend image:","options"),KviOption_pixmapGlobalTransparencyBackground, - KVI_OPTION_BOOL(KviOption_boolUseGlobalPseudoTransparency) && !KVI_OPTION_BOOL(KviOption_boolUseCompositingForTransparency)); - layout()->setRowStretch(6,1); - - if(g_pApp->supportsCompositing()) - { - connect(m_pUseTransparencyBoolSelector,SIGNAL(toggled(bool)),m_pUseCompositingForTransparencyBoolSelector,SLOT(setEnabled(bool))); - connect(m_pUseCompositingForTransparencyBoolSelector,SIGNAL(toggled(bool)),this,SLOT(enableGlobalBackgroundPixmapSelector(bool))); - } else { - m_pUseCompositingForTransparencyBoolSelector->setEnabled(false); - m_pUseCompositingForTransparencyBoolSelector->setChecked(false); - enableGlobalBackgroundPixmapSelector(true); - } - - #elif defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW) - m_pUseWindowsFakeDesktopTransparencyBoolSelector = addBoolSelector(0,5,1,5,__tr2qs_ctx("Use desktop background for transparency","options"),KviOption_boolUseWindowsDesktopForTransparency, - KVI_OPTION_BOOL(KviOption_boolUseGlobalPseudoTransparency)); - - m_pGlobalBackgroundPixmapSelector = addPixmapSelector(0,6,1,6,__tr2qs_ctx("Transparency blend image:","options"),KviOption_pixmapGlobalTransparencyBackground, - KVI_OPTION_BOOL(KviOption_boolUseGlobalPseudoTransparency) && !KVI_OPTION_BOOL(KviOption_boolUseCompositingForTransparency)); - layout()->setRowStretch(6,1); - - connect(m_pUseTransparencyBoolSelector,SIGNAL(toggled(bool)),m_pUseWindowsFakeDesktopTransparencyBoolSelector,SLOT(setEnabled(bool))); - connect(m_pUseWindowsFakeDesktopTransparencyBoolSelector,SIGNAL(toggled(bool)),this,SLOT(enableGlobalBackgroundPixmapSelector(bool))); - #else - m_pGlobalBackgroundPixmapSelector = addPixmapSelector(0,5,1,5,__tr2qs_ctx("Transparency blend image:","options"),KviOption_pixmapGlobalTransparencyBackground, - KVI_OPTION_BOOL(KviOption_boolUseGlobalPseudoTransparency)); - layout()->setRowStretch(5,1); - #endif //!COMPILE_X11_SUPPORT - - connect(m_pUseTransparencyBoolSelector,SIGNAL(toggled(bool)),this,SLOT(enableGlobalBackgroundPixmapSelector(bool))); + connect(m_pUseTransparencyBoolSelector, SIGNAL(toggled(bool)), u, SLOT(setEnabled(bool))); + + KviColorSelector * c = addColorSelector(0, 4, 1, 4, __tr2qs_ctx("Blend color:", "options"), KviOption_colorGlobalTransparencyFade, + KVI_OPTION_BOOL(KviOption_boolUseGlobalPseudoTransparency)); + connect(m_pUseTransparencyBoolSelector, SIGNAL(toggled(bool)), c, SLOT(setEnabled(bool))); + +#ifdef COMPILE_X11_SUPPORT + m_pUseCompositingForTransparencyBoolSelector = addBoolSelector(0, 5, 1, 5, __tr2qs_ctx("Use compositing for real transparency", "options"), KviOption_boolUseCompositingForTransparency, + KVI_OPTION_BOOL(KviOption_boolUseGlobalPseudoTransparency)); + + m_pGlobalBackgroundPixmapSelector = addPixmapSelector(0, 6, 1, 6, __tr2qs_ctx("Transparency blend image:", "options"), KviOption_pixmapGlobalTransparencyBackground, + KVI_OPTION_BOOL(KviOption_boolUseGlobalPseudoTransparency) && !KVI_OPTION_BOOL(KviOption_boolUseCompositingForTransparency)); + layout()->setRowStretch(6, 1); + + if(g_pApp->supportsCompositing()) + { + connect(m_pUseTransparencyBoolSelector, SIGNAL(toggled(bool)), m_pUseCompositingForTransparencyBoolSelector, SLOT(setEnabled(bool))); + connect(m_pUseCompositingForTransparencyBoolSelector, SIGNAL(toggled(bool)), this, SLOT(enableGlobalBackgroundPixmapSelector(bool))); + } + else + { + m_pUseCompositingForTransparencyBoolSelector->setEnabled(false); + m_pUseCompositingForTransparencyBoolSelector->setChecked(false); + enableGlobalBackgroundPixmapSelector(true); + } + +#elif defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW) + m_pUseWindowsFakeDesktopTransparencyBoolSelector = addBoolSelector(0, 5, 1, 5, __tr2qs_ctx("Use desktop background for transparency", "options"), KviOption_boolUseWindowsDesktopForTransparency, + KVI_OPTION_BOOL(KviOption_boolUseGlobalPseudoTransparency)); + + m_pGlobalBackgroundPixmapSelector = addPixmapSelector(0, 6, 1, 6, __tr2qs_ctx("Transparency blend image:", "options"), KviOption_pixmapGlobalTransparencyBackground, + KVI_OPTION_BOOL(KviOption_boolUseGlobalPseudoTransparency) && !KVI_OPTION_BOOL(KviOption_boolUseCompositingForTransparency)); + layout()->setRowStretch(6, 1); + + connect(m_pUseTransparencyBoolSelector, SIGNAL(toggled(bool)), m_pUseWindowsFakeDesktopTransparencyBoolSelector, SLOT(setEnabled(bool))); + connect(m_pUseWindowsFakeDesktopTransparencyBoolSelector, SIGNAL(toggled(bool)), this, SLOT(enableGlobalBackgroundPixmapSelector(bool))); +#else + m_pGlobalBackgroundPixmapSelector = addPixmapSelector(0, 5, 1, 5, __tr2qs_ctx("Transparency blend image:", "options"), KviOption_pixmapGlobalTransparencyBackground, + KVI_OPTION_BOOL(KviOption_boolUseGlobalPseudoTransparency)); + layout()->setRowStretch(5, 1); +#endif //!COMPILE_X11_SUPPORT + + connect(m_pUseTransparencyBoolSelector, SIGNAL(toggled(bool)), this, SLOT(enableGlobalBackgroundPixmapSelector(bool))); #else //!COMPILE_PSEUDO_TRANSPARENCY createLayout(); - addRowSpacer(0,0,0,0); + addRowSpacer(0, 0, 0, 0); #endif } @@ -145,29 +148,28 @@ OptionsWidget_themeTransparency::~OptionsWidget_themeTransparency() void OptionsWidget_themeTransparency::enableGlobalBackgroundPixmapSelector(bool) { #ifdef COMPILE_PSEUDO_TRANSPARENCY - #ifdef COMPILE_X11_SUPPORT - m_pGlobalBackgroundPixmapSelector->setEnabled(m_pUseTransparencyBoolSelector->isChecked() && !(m_pUseCompositingForTransparencyBoolSelector->isChecked())); - #elif defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW) - m_pGlobalBackgroundPixmapSelector->setEnabled(m_pUseTransparencyBoolSelector->isChecked() && !(m_pUseWindowsFakeDesktopTransparencyBoolSelector->isChecked())); - #else - m_pGlobalBackgroundPixmapSelector->setEnabled(m_pUseTransparencyBoolSelector->isChecked()); - #endif +#ifdef COMPILE_X11_SUPPORT + m_pGlobalBackgroundPixmapSelector->setEnabled(m_pUseTransparencyBoolSelector->isChecked() && !(m_pUseCompositingForTransparencyBoolSelector->isChecked())); +#elif defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW) + m_pGlobalBackgroundPixmapSelector->setEnabled(m_pUseTransparencyBoolSelector->isChecked() && !(m_pUseWindowsFakeDesktopTransparencyBoolSelector->isChecked())); +#else + m_pGlobalBackgroundPixmapSelector->setEnabled(m_pUseTransparencyBoolSelector->isChecked()); +#endif #endif } - OptionsWidget_themeToolBarApplets::OptionsWidget_themeToolBarApplets(QWidget * parent) -: KviOptionsWidget(parent) + : KviOptionsWidget(parent) { createLayout(); - addColorSelector(0,0,0,0,__tr2qs_ctx("Background color:","options"),KviOption_colorIrcToolBarAppletBackground); - addColorSelector(0,1,0,1,__tr2qs_ctx("Border color:","options"),KviOption_colorIrcToolBarAppletBorder); - addColorSelector(0,2,0,2,__tr2qs_ctx("Font color:","options"),KviOption_colorIrcToolBarAppletFont); + addColorSelector(0, 0, 0, 0, __tr2qs_ctx("Background color:", "options"), KviOption_colorIrcToolBarAppletBackground); + addColorSelector(0, 1, 0, 1, __tr2qs_ctx("Border color:", "options"), KviOption_colorIrcToolBarAppletBorder); + addColorSelector(0, 2, 0, 2, __tr2qs_ctx("Font color:", "options"), KviOption_colorIrcToolBarAppletFont); - addPixmapSelector(0,3,0,3,__tr2qs_ctx("Background image:","options"),KviOption_pixmapIrcToolBarAppletBackground); + addPixmapSelector(0, 3, 0, 3, __tr2qs_ctx("Background image:", "options"), KviOption_pixmapIrcToolBarAppletBackground); - layout()->setRowStretch(3,1); + layout()->setRowStretch(3, 1); } OptionsWidget_themeToolBarApplets::~OptionsWidget_themeToolBarApplets() diff --git a/src/modules/options/OptionsWidget_theme.h b/src/modules/options/OptionsWidget_theme.h index 491b72f29..ab3546f7f 100644 --- a/src/modules/options/OptionsWidget_theme.h +++ b/src/modules/options/OptionsWidget_theme.h @@ -28,7 +28,6 @@ #include "KviOptionsWidget.h" #include "KviSelectors.h" - #define KVI_OPTIONS_WIDGET_ICON_OptionsWidget_theme KviIconManager::Gui #define KVI_OPTIONS_WIDGET_NAME_OptionsWidget_theme __tr2qs_no_lookup("General") #define KVI_OPTIONS_WIDGET_KEYWORDS_OptionsWidget_theme __tr2qs_no_lookup("theme") @@ -53,15 +52,16 @@ class OptionsWidget_themeTransparency : public KviOptionsWidget public: OptionsWidget_themeTransparency(QWidget * parent); ~OptionsWidget_themeTransparency(); + protected: #ifdef COMPILE_PSEUDO_TRANSPARENCY KviPixmapSelector * m_pGlobalBackgroundPixmapSelector; KviBoolSelector * m_pUseTransparencyBoolSelector; - #ifdef COMPILE_X11_SUPPORT - KviBoolSelector * m_pUseCompositingForTransparencyBoolSelector; - #elif defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW) - KviBoolSelector * m_pUseWindowsFakeDesktopTransparencyBoolSelector; - #endif +#ifdef COMPILE_X11_SUPPORT + KviBoolSelector * m_pUseCompositingForTransparencyBoolSelector; +#elif defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW) + KviBoolSelector * m_pUseWindowsFakeDesktopTransparencyBoolSelector; +#endif #endif protected slots: void enableGlobalBackgroundPixmapSelector(bool); diff --git a/src/modules/options/OptionsWidget_tools.cpp b/src/modules/options/OptionsWidget_tools.cpp index 924402655..9717b7c77 100644 --- a/src/modules/options/OptionsWidget_tools.cpp +++ b/src/modules/options/OptionsWidget_tools.cpp @@ -31,16 +31,16 @@ #include OptionsWidget_tools::OptionsWidget_tools(QWidget * parent) -: KviOptionsWidget(parent) + : KviOptionsWidget(parent) { setObjectName("tools_options_widget"); createLayout(); - addLabel(0,0,0,0,__tr2qs_ctx("This section contains IRC tools "\ - "like away, lag and logging system. ","options")); - - addRowSpacer(0,1,0,1); + addLabel(0, 0, 0, 0, __tr2qs_ctx("This section contains IRC tools " + "like away, lag and logging system. ", + "options")); + addRowSpacer(0, 1, 0, 1); } OptionsWidget_tools::~OptionsWidget_tools() diff --git a/src/modules/options/OptionsWidget_topicLabel.cpp b/src/modules/options/OptionsWidget_topicLabel.cpp index 7385b5094..137a3c252 100644 --- a/src/modules/options/OptionsWidget_topicLabel.cpp +++ b/src/modules/options/OptionsWidget_topicLabel.cpp @@ -28,15 +28,14 @@ #include "KviOptions.h" #include "KviLocale.h" - -OptionsWidget_topicLabel::OptionsWidget_topicLabel(QWidget *p):KviOptionsWidget(p, "topic_label_look_options_widget") +OptionsWidget_topicLabel::OptionsWidget_topicLabel(QWidget * p) : KviOptionsWidget(p, "topic_label_look_options_widget") { createLayout(); - addFontSelector(0, 0, 0, 0, __tr2qs_ctx("Font:","options"), KviOption_fontLabel); - addColorSelector(0, 1, 0, 1, __tr2qs_ctx("Foreground color:","options"), KviOption_colorLabelForeground); - addColorSelector(0, 2, 0, 2, __tr2qs_ctx("Background color:","options"), KviOption_colorLabelBackground); - addPixmapSelector(0, 3, 0, 3, __tr2qs_ctx("Background image:","options"), KviOption_pixmapLabelBackground); + addFontSelector(0, 0, 0, 0, __tr2qs_ctx("Font:", "options"), KviOption_fontLabel); + addColorSelector(0, 1, 0, 1, __tr2qs_ctx("Foreground color:", "options"), KviOption_colorLabelForeground); + addColorSelector(0, 2, 0, 2, __tr2qs_ctx("Background color:", "options"), KviOption_colorLabelBackground); + addPixmapSelector(0, 3, 0, 3, __tr2qs_ctx("Background image:", "options"), KviOption_pixmapLabelBackground); layout()->setRowStretch(3, 1); } diff --git a/src/modules/options/OptionsWidget_topicLabel.h b/src/modules/options/OptionsWidget_topicLabel.h index 5c24fcde5..47e92197a 100644 --- a/src/modules/options/OptionsWidget_topicLabel.h +++ b/src/modules/options/OptionsWidget_topicLabel.h @@ -25,7 +25,6 @@ // //============================================================================= - #include "KviOptionsWidget.h" #define KVI_OPTIONS_WIDGET_ICON_OptionsWidget_topicLabel KviIconManager::Topic diff --git a/src/modules/options/OptionsWidget_tray.cpp b/src/modules/options/OptionsWidget_tray.cpp index 5012d6774..30dc4b660 100644 --- a/src/modules/options/OptionsWidget_tray.cpp +++ b/src/modules/options/OptionsWidget_tray.cpp @@ -32,43 +32,43 @@ #include - OptionsWidget_tray::OptionsWidget_tray(QWidget * parent) -: KviOptionsWidget(parent) + : KviOptionsWidget(parent) { setObjectName("tray_options_widget"); createLayout(); - m_pEnable = addBoolSelector(0,0,0,0, __tr2qs_ctx("Enable tray icon","options"), KviOption_boolShowDockExtension); + m_pEnable = addBoolSelector(0, 0, 0, 0, __tr2qs_ctx("Enable tray icon", "options"), KviOption_boolShowDockExtension); #ifndef COMPILE_ON_MAC - m_pMinimizeInTray = addBoolSelector(0,1,0,1,__tr2qs_ctx("Minimize in tray","options"),KviOption_boolMinimizeInTray); + m_pMinimizeInTray = addBoolSelector(0, 1, 0, 1, __tr2qs_ctx("Minimize in tray", "options"), KviOption_boolMinimizeInTray); #ifdef COMPILE_KDE_SUPPORT - QString szTip = __tr2qs_ctx("Take into account that if you're using KDE, this won't work if " \ - "you've set \"Keep window thumbnails\" as \"Always\" at \"Desktop Effects\" " \ - "advanced settings.","options"); - mergeTip(m_pMinimizeInTray,szTip); + QString szTip = __tr2qs_ctx("Take into account that if you're using KDE, this won't work if " + "you've set \"Keep window thumbnails\" as \"Always\" at \"Desktop Effects\" " + "advanced settings.", + "options"); + mergeTip(m_pMinimizeInTray, szTip); #endif #endif - m_pCloseInTray = addBoolSelector(0,2,0,2,__tr2qs_ctx("Close in tray","options"),KviOption_boolCloseInTray); + m_pCloseInTray = addBoolSelector(0, 2, 0, 2, __tr2qs_ctx("Close in tray", "options"), KviOption_boolCloseInTray); - m_pEnableFlashing = addBoolSelector(0,3,0,3,__tr2qs_ctx("Enable tray icon flashing","options"),KviOption_boolEnableTrayIconFlashing); - m_pLevelBasedNotify = addBoolSelector(0,4,0,4,__tr2qs_ctx("Enable level-based message notification (not a message-type based)","options"),KviOption_boolUseLevelBasedTrayNotification); + m_pEnableFlashing = addBoolSelector(0, 3, 0, 3, __tr2qs_ctx("Enable tray icon flashing", "options"), KviOption_boolEnableTrayIconFlashing); + m_pLevelBasedNotify = addBoolSelector(0, 4, 0, 4, __tr2qs_ctx("Enable level-based message notification (not a message-type based)", "options"), KviOption_boolUseLevelBasedTrayNotification); - m_pLevelsGroup = addGroupBox(0,5,0,5,Qt::Horizontal,__tr2qs_ctx("Select Message Levels to Notify","options")); + m_pLevelsGroup = addGroupBox(0, 5, 0, 5, Qt::Horizontal, __tr2qs_ctx("Select Message Levels to Notify", "options")); - addUIntSelector(m_pLevelsGroup,__tr2qs_ctx("Minimum level for low-priority messages:","options"), - KviOption_uintMinTrayLowLevelMessage, - 1,5,1,true); + addUIntSelector(m_pLevelsGroup, __tr2qs_ctx("Minimum level for low-priority messages:", "options"), + KviOption_uintMinTrayLowLevelMessage, + 1, 5, 1, true); - addUIntSelector(m_pLevelsGroup,__tr2qs_ctx("Minimum level for high-priority message:","options"), - KviOption_uintMinTrayHighLevelMessage, - 1,5,4,true); + addUIntSelector(m_pLevelsGroup, __tr2qs_ctx("Minimum level for high-priority message:", "options"), + KviOption_uintMinTrayHighLevelMessage, + 1, 5, 4, true); - addRowSpacer(0,6,0,6); + addRowSpacer(0, 6, 0, 6); - connect(m_pEnable,SIGNAL(toggled(bool)),this,SLOT(setEnabled(bool))); - connect(m_pLevelBasedNotify,SIGNAL(toggled(bool)),this,SLOT(setEnabled(bool))); + connect(m_pEnable, SIGNAL(toggled(bool)), this, SLOT(setEnabled(bool))); + connect(m_pLevelBasedNotify, SIGNAL(toggled(bool)), this, SLOT(setEnabled(bool))); setEnabled(true); } @@ -89,7 +89,9 @@ void OptionsWidget_tray::setEnabled(bool) m_pLevelsGroup->setEnabled(false); g_pMainWindow->executeInternalCommand(KVI_INTERNALCOMMAND_TRAYICON_SHOW); - } else { + } + else + { m_pCloseInTray->setEnabled(false); m_pEnableFlashing->setEnabled(false); m_pLevelBasedNotify->setEnabled(false); diff --git a/src/modules/options/OptionsWidget_tray.h b/src/modules/options/OptionsWidget_tray.h index 46111b7ff..49c46cac8 100644 --- a/src/modules/options/OptionsWidget_tray.h +++ b/src/modules/options/OptionsWidget_tray.h @@ -39,6 +39,7 @@ class OptionsWidget_tray : public KviOptionsWidget public: OptionsWidget_tray(QWidget * parent); ~OptionsWidget_tray(); + protected: KviBoolSelector * m_pEnable; KviBoolSelector * m_pEnableFlashing; diff --git a/src/modules/options/OptionsWidget_uparser.cpp b/src/modules/options/OptionsWidget_uparser.cpp index f84baa08d..ad71fec76 100644 --- a/src/modules/options/OptionsWidget_uparser.cpp +++ b/src/modules/options/OptionsWidget_uparser.cpp @@ -30,41 +30,42 @@ #include #include - OptionsWidget_uparser::OptionsWidget_uparser(QWidget * parent) -: KviOptionsWidget(parent,"uparser_options_widget") + : KviOptionsWidget(parent, "uparser_options_widget") { createLayout(); KviBoolSelector * b; KviBoolSelector * b1; - addBoolSelector(0,0,0,0,__tr2qs_ctx("Disable parser warnings","options"),KviOption_boolAvoidParserWarnings); - addBoolSelector(0,1,0,1,__tr2qs_ctx("Disable broken event handlers","options"),KviOption_boolDisableBrokenEventHandlers); - addBoolSelector(0,2,0,2,__tr2qs_ctx("Kill broken timers","options"),KviOption_boolKillBrokenTimers); - addBoolSelector(0,3,0,3,__tr2qs_ctx("Send unknown commands as /RAW","options"),KviOption_boolSendUnknownCommandsAsRaw); + addBoolSelector(0, 0, 0, 0, __tr2qs_ctx("Disable parser warnings", "options"), KviOption_boolAvoidParserWarnings); + addBoolSelector(0, 1, 0, 1, __tr2qs_ctx("Disable broken event handlers", "options"), KviOption_boolDisableBrokenEventHandlers); + addBoolSelector(0, 2, 0, 2, __tr2qs_ctx("Kill broken timers", "options"), KviOption_boolKillBrokenTimers); + addBoolSelector(0, 3, 0, 3, __tr2qs_ctx("Send unknown commands as /RAW", "options"), KviOption_boolSendUnknownCommandsAsRaw); + + addSeparator(0, 4, 0, 4); - addSeparator(0,4,0,4); + addBoolSelector(0, 5, 0, 5, __tr2qs_ctx("Automatically unload unused modules", "options"), KviOption_boolCleanupUnusedModules); + addBoolSelector(0, 6, 0, 6, __tr2qs_ctx("Ignore module versions (dangerous)", "options"), KviOption_boolIgnoreModuleVersions); - addBoolSelector(0,5,0,5,__tr2qs_ctx("Automatically unload unused modules","options"),KviOption_boolCleanupUnusedModules); - addBoolSelector(0,6,0,6,__tr2qs_ctx("Ignore module versions (dangerous)","options"),KviOption_boolIgnoreModuleVersions); + addSeparator(0, 7, 0, 7); - addSeparator(0,7,0,7); + b = addBoolSelector(0, 8, 0, 8, __tr2qs_ctx("Relay errors and warnings to debug window", "options"), KviOption_boolScriptErrorsToDebugWindow); + mergeTip(b, __tr2qs_ctx("This option will show the script errors and warnings " + "also in the special debug window. This makes tracking of scripts that might " + "be running in several windows far easier. The messages in the debug window " + "also contain a deeper call stack which will help you identifying the " + "scripting problems.", + "options")); - b = addBoolSelector(0,8,0,8,__tr2qs_ctx("Relay errors and warnings to debug window","options"),KviOption_boolScriptErrorsToDebugWindow); - mergeTip(b, __tr2qs_ctx("This option will show the script errors and warnings " \ - "also in the special debug window. This makes tracking of scripts that might " \ - "be running in several windows far easier. The messages in the debug window " \ - "also contain a deeper call stack which will help you identifying the " \ - "scripting problems.","options")); - - b1 = addBoolSelector(0,9,0,9,__tr2qs_ctx("Create debug window without focus","options"),KviOption_boolShowMinimizedDebugWindow); - mergeTip(b1, __tr2qs_ctx("This option prevents the debug window " \ - "from opening and diverting application focus.
" \ - "Enable this if you don't like the debug window " \ - "popping up while you're typing something in a channel.","options")); + b1 = addBoolSelector(0, 9, 0, 9, __tr2qs_ctx("Create debug window without focus", "options"), KviOption_boolShowMinimizedDebugWindow); + mergeTip(b1, __tr2qs_ctx("This option prevents the debug window " + "from opening and diverting application focus.
" + "Enable this if you don't like the debug window " + "popping up while you're typing something in a channel.", + "options")); - addRowSpacer(0,10,0,10); + addRowSpacer(0, 10, 0, 10); } OptionsWidget_uparser::~OptionsWidget_uparser() diff --git a/src/modules/options/OptionsWidget_urlHandlers.cpp b/src/modules/options/OptionsWidget_urlHandlers.cpp index 56f421fdf..fdc87f9f5 100644 --- a/src/modules/options/OptionsWidget_urlHandlers.cpp +++ b/src/modules/options/OptionsWidget_urlHandlers.cpp @@ -33,25 +33,24 @@ #include #include - OptionsWidget_urlHandlers::OptionsWidget_urlHandlers(QWidget * parent) -: KviOptionsWidget(parent) + : KviOptionsWidget(parent) { #if defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW) - #define START_ROW 2 +#define START_ROW 2 #else - #define START_ROW 1 +#define START_ROW 1 #endif setObjectName("urlhandlers_options_widget"); createLayout(); - KviTalGroupBox * gbox = addGroupBox(0,0,0,0,Qt::Horizontal,__tr2qs_ctx("Mouse Handler","options")); + KviTalGroupBox * gbox = addGroupBox(0, 0, 0, 0, Qt::Horizontal, __tr2qs_ctx("Mouse Handler", "options")); - addLabel(gbox,__tr2qs_ctx("How many clicks to open links?","options")); + addLabel(gbox, __tr2qs_ctx("How many clicks to open links?", "options")); - m_pClickRadio = new QRadioButton(__tr2qs_ctx("Single-click","options"),gbox); - m_pDoubleClickRadio = new QRadioButton(__tr2qs_ctx("Double-click","options"),gbox); + m_pClickRadio = new QRadioButton(__tr2qs_ctx("Single-click", "options"), gbox); + m_pDoubleClickRadio = new QRadioButton(__tr2qs_ctx("Double-click", "options"), gbox); switch(KVI_OPTION_UINT(KviOption_uintUrlMouseClickNum)) { @@ -63,23 +62,23 @@ OptionsWidget_urlHandlers::OptionsWidget_urlHandlers(QWidget * parent) break; } - gbox = addGroupBox(0,1,0,1,Qt::Horizontal,__tr2qs_ctx("Protocol Handler","options")); + gbox = addGroupBox(0, 1, 0, 1, Qt::Horizontal, __tr2qs_ctx("Protocol Handler", "options")); #if defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW) - KviBoolSelector *b = addBoolSelector(gbox,__tr2qs_ctx("Use system URL handlers","options"),KviOption_boolUseSystemUrlHandlers); + KviBoolSelector * b = addBoolSelector(gbox, __tr2qs_ctx("Use system URL handlers", "options"), KviOption_boolUseSystemUrlHandlers); #endif - m_pHttpHandler=addStringSelector(gbox,__tr2qs_ctx("http:// handler command:","options"),KviOption_stringUrlHttpCommand); + m_pHttpHandler = addStringSelector(gbox, __tr2qs_ctx("http:// handler command:", "options"), KviOption_stringUrlHttpCommand); m_pHttpHandler->setMinimumLabelWidth(225); - m_pHttpsHandler=addStringSelector(gbox,__tr2qs_ctx("https:// handler command:","options"),KviOption_stringUrlHttpsCommand); + m_pHttpsHandler = addStringSelector(gbox, __tr2qs_ctx("https:// handler command:", "options"), KviOption_stringUrlHttpsCommand); m_pHttpsHandler->setMinimumLabelWidth(225); - m_pFtpHandler=addStringSelector(gbox,__tr2qs_ctx("ftp:// handler command:","options"),KviOption_stringUrlFtpCommand); + m_pFtpHandler = addStringSelector(gbox, __tr2qs_ctx("ftp:// handler command:", "options"), KviOption_stringUrlFtpCommand); m_pFtpHandler->setMinimumLabelWidth(225); - m_pMailtoHandler=addStringSelector(gbox,__tr2qs_ctx("mailto: handler command:","options"),KviOption_stringUrlMailtoCommand); + m_pMailtoHandler = addStringSelector(gbox, __tr2qs_ctx("mailto: handler command:", "options"), KviOption_stringUrlMailtoCommand); m_pMailtoHandler->setMinimumLabelWidth(225); - m_pFileHandler=addStringSelector(gbox,__tr2qs_ctx("file:// handler command:","options"),KviOption_stringUrlFileCommand); + m_pFileHandler = addStringSelector(gbox, __tr2qs_ctx("file:// handler command:", "options"), KviOption_stringUrlFileCommand); m_pFileHandler->setMinimumLabelWidth(225); - m_pOtherHandler=addStringSelector(gbox,__tr2qs_ctx("Unknown protocol handler command:","options"),KviOption_stringUrlUnknownCommand); + m_pOtherHandler = addStringSelector(gbox, __tr2qs_ctx("Unknown protocol handler command:", "options"), KviOption_stringUrlUnknownCommand); m_pOtherHandler->setMinimumLabelWidth(225); #if defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW) @@ -89,10 +88,10 @@ OptionsWidget_urlHandlers::OptionsWidget_urlHandlers(QWidget * parent) m_pFileHandler->setEnabled(!KVI_OPTION_BOOL(KviOption_boolUseSystemUrlHandlers)); m_pMailtoHandler->setEnabled(!KVI_OPTION_BOOL(KviOption_boolUseSystemUrlHandlers)); m_pOtherHandler->setEnabled(!KVI_OPTION_BOOL(KviOption_boolUseSystemUrlHandlers)); - connect(b,SIGNAL(toggled(bool)),this,SLOT(toggleEditors(bool))); + connect(b, SIGNAL(toggled(bool)), this, SLOT(toggleEditors(bool))); #endif - addRowSpacer(0,START_ROW+6,0,START_ROW+6); + addRowSpacer(0, START_ROW + 6, 0, START_ROW + 6); } OptionsWidget_urlHandlers::~OptionsWidget_urlHandlers() @@ -114,44 +113,67 @@ void OptionsWidget_urlHandlers::commit() KviOptionsWidget::commit(); if(m_pClickRadio->isChecked()) - KVI_OPTION_UINT(KviOption_uintUrlMouseClickNum)=1; + KVI_OPTION_UINT(KviOption_uintUrlMouseClickNum) = 1; if(m_pDoubleClickRadio->isChecked()) - KVI_OPTION_UINT(KviOption_uintUrlMouseClickNum)=2; + KVI_OPTION_UINT(KviOption_uintUrlMouseClickNum) = 2; #if defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW) - KVI_OPTION_STRING(KviOption_stringUrlHttpCommand).replace("\\\\","@MAGIC@"); - KVI_OPTION_STRING(KviOption_stringUrlHttpCommand).replace("\\","\\\\"); - KVI_OPTION_STRING(KviOption_stringUrlHttpCommand).replace("@MAGIC@","\\\\"); - - KVI_OPTION_STRING(KviOption_stringUrlHttpsCommand).replace("\\\\","@MAGIC@"); - KVI_OPTION_STRING(KviOption_stringUrlHttpsCommand).replace("\\","\\\\"); - KVI_OPTION_STRING(KviOption_stringUrlHttpsCommand).replace("@MAGIC@","\\\\"); - - KVI_OPTION_STRING(KviOption_stringUrlFtpCommand).replace("\\\\","@MAGIC@"); - KVI_OPTION_STRING(KviOption_stringUrlFtpCommand).replace("\\","\\\\"); - KVI_OPTION_STRING(KviOption_stringUrlFtpCommand).replace("@MAGIC@","\\\\"); - - KVI_OPTION_STRING(KviOption_stringUrlMailtoCommand).replace("\\\\","@MAGIC@"); - KVI_OPTION_STRING(KviOption_stringUrlMailtoCommand).replace("\\","\\\\"); - KVI_OPTION_STRING(KviOption_stringUrlMailtoCommand).replace("@MAGIC@","\\\\"); - - KVI_OPTION_STRING(KviOption_stringUrlFileCommand).replace("\\\\","@MAGIC@"); - KVI_OPTION_STRING(KviOption_stringUrlFileCommand).replace("\\","\\\\"); - KVI_OPTION_STRING(KviOption_stringUrlFileCommand).replace("@MAGIC@","\\\\"); - - KVI_OPTION_STRING(KviOption_stringUrlUnknownCommand).replace("\\\\","@MAGIC@"); - KVI_OPTION_STRING(KviOption_stringUrlUnknownCommand).replace("\\","\\\\"); - KVI_OPTION_STRING(KviOption_stringUrlUnknownCommand).replace("@MAGIC@","\\\\"); + KVI_OPTION_STRING(KviOption_stringUrlHttpCommand) + .replace("\\\\", "@MAGIC@"); + KVI_OPTION_STRING(KviOption_stringUrlHttpCommand) + .replace("\\", "\\\\"); + KVI_OPTION_STRING(KviOption_stringUrlHttpCommand) + .replace("@MAGIC@", "\\\\"); + + KVI_OPTION_STRING(KviOption_stringUrlHttpsCommand) + .replace("\\\\", "@MAGIC@"); + KVI_OPTION_STRING(KviOption_stringUrlHttpsCommand) + .replace("\\", "\\\\"); + KVI_OPTION_STRING(KviOption_stringUrlHttpsCommand) + .replace("@MAGIC@", "\\\\"); + + KVI_OPTION_STRING(KviOption_stringUrlFtpCommand) + .replace("\\\\", "@MAGIC@"); + KVI_OPTION_STRING(KviOption_stringUrlFtpCommand) + .replace("\\", "\\\\"); + KVI_OPTION_STRING(KviOption_stringUrlFtpCommand) + .replace("@MAGIC@", "\\\\"); + + KVI_OPTION_STRING(KviOption_stringUrlMailtoCommand) + .replace("\\\\", "@MAGIC@"); + KVI_OPTION_STRING(KviOption_stringUrlMailtoCommand) + .replace("\\", "\\\\"); + KVI_OPTION_STRING(KviOption_stringUrlMailtoCommand) + .replace("@MAGIC@", "\\\\"); + + KVI_OPTION_STRING(KviOption_stringUrlFileCommand) + .replace("\\\\", "@MAGIC@"); + KVI_OPTION_STRING(KviOption_stringUrlFileCommand) + .replace("\\", "\\\\"); + KVI_OPTION_STRING(KviOption_stringUrlFileCommand) + .replace("@MAGIC@", "\\\\"); + + KVI_OPTION_STRING(KviOption_stringUrlUnknownCommand) + .replace("\\\\", "@MAGIC@"); + KVI_OPTION_STRING(KviOption_stringUrlUnknownCommand) + .replace("\\", "\\\\"); + KVI_OPTION_STRING(KviOption_stringUrlUnknownCommand) + .replace("@MAGIC@", "\\\\"); //Check for escaped " in url handler ( \" ) - KVI_OPTION_STRING(KviOption_stringUrlHttpCommand).replace("\\\\\"","\\\""); - KVI_OPTION_STRING(KviOption_stringUrlHttpsCommand).replace("\\\\\"","\\\""); - KVI_OPTION_STRING(KviOption_stringUrlFtpCommand).replace("\\\\\"","\\\""); - KVI_OPTION_STRING(KviOption_stringUrlMailtoCommand).replace("\\\\\"","\\\""); - KVI_OPTION_STRING(KviOption_stringUrlFileCommand).replace("\\\\\"","\\\""); - KVI_OPTION_STRING(KviOption_stringUrlUnknownCommand).replace("\\\\\"","\\\""); + KVI_OPTION_STRING(KviOption_stringUrlHttpCommand) + .replace("\\\\\"", "\\\""); + KVI_OPTION_STRING(KviOption_stringUrlHttpsCommand) + .replace("\\\\\"", "\\\""); + KVI_OPTION_STRING(KviOption_stringUrlFtpCommand) + .replace("\\\\\"", "\\\""); + KVI_OPTION_STRING(KviOption_stringUrlMailtoCommand) + .replace("\\\\\"", "\\\""); + KVI_OPTION_STRING(KviOption_stringUrlFileCommand) + .replace("\\\\\"", "\\\""); + KVI_OPTION_STRING(KviOption_stringUrlUnknownCommand) + .replace("\\\\\"", "\\\""); #endif } - #endif //_OPTW_URLHANDLERS_CPP_ diff --git a/src/modules/options/OptionsWidget_urlHandlers.h b/src/modules/options/OptionsWidget_urlHandlers.h index c797c6f8e..44f1debed 100644 --- a/src/modules/options/OptionsWidget_urlHandlers.h +++ b/src/modules/options/OptionsWidget_urlHandlers.h @@ -42,6 +42,7 @@ public: ~OptionsWidget_urlHandlers(); virtual void commit(); + protected: QRadioButton * m_pClickRadio; QRadioButton * m_pDoubleClickRadio; diff --git a/src/modules/options/OptionsWidget_userList.cpp b/src/modules/options/OptionsWidget_userList.cpp index 819279821..47bb8e81f 100644 --- a/src/modules/options/OptionsWidget_userList.cpp +++ b/src/modules/options/OptionsWidget_userList.cpp @@ -31,9 +31,8 @@ #include - OptionsWidget_userList::OptionsWidget_userList(QWidget * parent) -: KviOptionsWidget(parent,"userlistlook_options_widget") + : KviOptionsWidget(parent, "userlistlook_options_widget") { } @@ -41,123 +40,118 @@ OptionsWidget_userList::~OptionsWidget_userList() { } - OptionsWidget_userListForeground::OptionsWidget_userListForeground(QWidget * parent) -: KviOptionsWidget(parent,"userlistlook_foreground_options_widget") + : KviOptionsWidget(parent, "userlistlook_foreground_options_widget") { createLayout(); - addFontSelector(0,0,1,0,__tr2qs_ctx("Font:","options"),KviOption_fontUserListView); + addFontSelector(0, 0, 1, 0, __tr2qs_ctx("Font:", "options"), KviOption_fontUserListView); - KviTalGroupBox * g = addGroupBox(0,1,1,1,Qt::Horizontal,__tr2qs_ctx("Nickname Colors","options")); - addColorSelector(g,__tr2qs_ctx("Normal:","options"),KviOption_colorUserListViewNormalForeground); - addColorSelector(g,__tr2qs_ctx("Selected:","options"),KviOption_colorUserListViewSelectionForeground); - addColorSelector(g,__tr2qs_ctx("IRC Op:","options"),KviOption_colorUserListViewIrcOpForeground); - addColorSelector(g,__tr2qs_ctx("Channel owner:","options"),KviOption_colorUserListViewChanOwnerForeground); - addColorSelector(g,__tr2qs_ctx("Channel admin:","options"),KviOption_colorUserListViewChanAdminForeground); - addColorSelector(g,__tr2qs_ctx("Op:","options"),KviOption_colorUserListViewOpForeground); - addColorSelector(g,__tr2qs_ctx("Half-op:","options"),KviOption_colorUserListViewHalfOpForeground); - addColorSelector(g,__tr2qs_ctx("Voice:","options"),KviOption_colorUserListViewVoiceForeground); - addColorSelector(g,__tr2qs_ctx("User-op:","options"),KviOption_colorUserListViewUserOpForeground); + KviTalGroupBox * g = addGroupBox(0, 1, 1, 1, Qt::Horizontal, __tr2qs_ctx("Nickname Colors", "options")); + addColorSelector(g, __tr2qs_ctx("Normal:", "options"), KviOption_colorUserListViewNormalForeground); + addColorSelector(g, __tr2qs_ctx("Selected:", "options"), KviOption_colorUserListViewSelectionForeground); + addColorSelector(g, __tr2qs_ctx("IRC Op:", "options"), KviOption_colorUserListViewIrcOpForeground); + addColorSelector(g, __tr2qs_ctx("Channel owner:", "options"), KviOption_colorUserListViewChanOwnerForeground); + addColorSelector(g, __tr2qs_ctx("Channel admin:", "options"), KviOption_colorUserListViewChanAdminForeground); + addColorSelector(g, __tr2qs_ctx("Op:", "options"), KviOption_colorUserListViewOpForeground); + addColorSelector(g, __tr2qs_ctx("Half-op:", "options"), KviOption_colorUserListViewHalfOpForeground); + addColorSelector(g, __tr2qs_ctx("Voice:", "options"), KviOption_colorUserListViewVoiceForeground); + addColorSelector(g, __tr2qs_ctx("User-op:", "options"), KviOption_colorUserListViewUserOpForeground); KviTalHBox * ahb = new KviTalHBox(g); ahb->setSpacing(4); - KviBoolSelector * ab = addBoolSelector(ahb,__tr2qs_ctx("Away (blend color):","options"),KviOption_boolUserListViewUseAwayColor); - QString szTip = __tr2qs("The color selected, will be blended with the user rank foreground color.
" \ - "You should also consider your theme's style, color and the userlist background selected color for optimum visibility.
" \ - "If no color is selected respective user rank color specified will be used instead."); + KviBoolSelector * ab = addBoolSelector(ahb, __tr2qs_ctx("Away (blend color):", "options"), KviOption_boolUserListViewUseAwayColor); + QString szTip = __tr2qs("The color selected, will be blended with the user rank foreground color.
" + "You should also consider your theme's style, color and the userlist background selected color for optimum visibility.
" + "If no color is selected respective user rank color specified will be used instead."); - KviColorSelector * as = addColorSelector(ahb,QString(),KviOption_colorUserListViewAwayForeground); - connect(ab,SIGNAL(toggled(bool)),as,SLOT(setEnabled(bool))); + KviColorSelector * as = addColorSelector(ahb, QString(), KviOption_colorUserListViewAwayForeground); + connect(ab, SIGNAL(toggled(bool)), as, SLOT(setEnabled(bool))); mergeTip(ab, szTip); KviTalHBox * hb = new KviTalHBox(g); hb->setSpacing(4); - KviBoolSelector * b = addBoolSelector(hb,__tr2qs_ctx("Use different color for own nick:","options"),KviOption_boolUseDifferentColorForOwnNick); - KviColorSelector * s = addColorSelector(hb,"",KviOption_colorUserListViewOwnForeground,KVI_OPTION_BOOL(KviOption_boolUseDifferentColorForOwnNick)); - connect(b,SIGNAL(toggled(bool)),s,SLOT(setEnabled(bool))); + KviBoolSelector * b = addBoolSelector(hb, __tr2qs_ctx("Use different color for own nick:", "options"), KviOption_boolUseDifferentColorForOwnNick); + KviColorSelector * s = addColorSelector(hb, "", KviOption_colorUserListViewOwnForeground, KVI_OPTION_BOOL(KviOption_boolUseDifferentColorForOwnNick)); + connect(b, SIGNAL(toggled(bool)), s, SLOT(setEnabled(bool))); - addRowSpacer(0,3,0,3); + addRowSpacer(0, 3, 0, 3); } OptionsWidget_userListForeground::~OptionsWidget_userListForeground() { } - OptionsWidget_userListGrid::OptionsWidget_userListGrid(QWidget * parent) -: KviOptionsWidget(parent) + : KviOptionsWidget(parent) { createLayout(); - KviBoolSelector* b = addBoolSelector(0,0,0,0,__tr2qs_ctx("Draw nickname grid","options"),KviOption_boolUserListViewDrawGrid); + KviBoolSelector * b = addBoolSelector(0, 0, 0, 0, __tr2qs_ctx("Draw nickname grid", "options"), KviOption_boolUserListViewDrawGrid); - KviColorSelector* s = addColorSelector(0,1,0,1,__tr2qs_ctx("Grid color:","options"),KviOption_colorUserListViewGrid,KVI_OPTION_BOOL(KviOption_boolUserListViewDrawGrid)); - connect(b,SIGNAL(toggled(bool)),s,SLOT(setEnabled(bool))); + KviColorSelector * s = addColorSelector(0, 1, 0, 1, __tr2qs_ctx("Grid color:", "options"), KviOption_colorUserListViewGrid, KVI_OPTION_BOOL(KviOption_boolUserListViewDrawGrid)); + connect(b, SIGNAL(toggled(bool)), s, SLOT(setEnabled(bool))); - KviTalHBox* hb = new KviTalHBox(this); - addWidgetToLayout(hb,0,2,0,2); + KviTalHBox * hb = new KviTalHBox(this); + addWidgetToLayout(hb, 0, 2, 0, 2); hb->setSpacing(4); - QLabel * l = new QLabel(__tr2qs_ctx("Grid type:","options"),hb); + QLabel * l = new QLabel(__tr2qs_ctx("Grid type:", "options"), hb); l->setEnabled(KVI_OPTION_BOOL(KviOption_boolUserListViewDrawGrid)); - connect(b,SIGNAL(toggled(bool)),l,SLOT(setEnabled(bool))); + connect(b, SIGNAL(toggled(bool)), l, SLOT(setEnabled(bool))); m_pGridTypeCombo = new QComboBox(hb); - m_pGridTypeCombo->addItem(__tr2qs_ctx("3D Grid","options")); - m_pGridTypeCombo->addItem(__tr2qs_ctx("3D Buttons","options")); - m_pGridTypeCombo->addItem(__tr2qs_ctx("Plain Grid","options")); - m_pGridTypeCombo->addItem(__tr2qs_ctx("Dotted Grid","options")); + m_pGridTypeCombo->addItem(__tr2qs_ctx("3D Grid", "options")); + m_pGridTypeCombo->addItem(__tr2qs_ctx("3D Buttons", "options")); + m_pGridTypeCombo->addItem(__tr2qs_ctx("Plain Grid", "options")); + m_pGridTypeCombo->addItem(__tr2qs_ctx("Dotted Grid", "options")); m_pGridTypeCombo->setCurrentIndex(KVI_OPTION_UINT(KviOption_uintUserListViewGridType)); m_pGridTypeCombo->setEnabled(KVI_OPTION_BOOL(KviOption_boolUserListViewDrawGrid)); - connect(b,SIGNAL(toggled(bool)),m_pGridTypeCombo,SLOT(setEnabled(bool))); + connect(b, SIGNAL(toggled(bool)), m_pGridTypeCombo, SLOT(setEnabled(bool))); - addRowSpacer(0,3,0,3); + addRowSpacer(0, 3, 0, 3); } OptionsWidget_userListGrid::~OptionsWidget_userListGrid() { } - void OptionsWidget_userListGrid::commit() { KviOptionsWidget::commit(); KVI_OPTION_UINT(KviOption_uintUserListViewGridType) = m_pGridTypeCombo->currentIndex(); if(KVI_OPTION_UINT(KviOption_uintUserListViewGridType) > KVI_USERLISTVIEW_GRIDTYPE_MAXIMUM) KVI_OPTION_UINT(KviOption_uintUserListViewGridType) = KVI_USERLISTVIEW_GRIDTYPE_DEFAULT; - } - OptionsWidget_userListBackground::OptionsWidget_userListBackground(QWidget * parent) -: KviOptionsWidget(parent,"userlistlook_background_options_widget") + : KviOptionsWidget(parent, "userlistlook_background_options_widget") { createLayout(); - KviTalGroupBox * g = addGroupBox(0,0,1,0,Qt::Horizontal,__tr2qs_ctx("Background Colors","options")); - addColorSelector(g,__tr2qs_ctx("Normal:","options"),KviOption_colorUserListViewBackground); - addColorSelector(g,__tr2qs_ctx("Selected:","options"),KviOption_colorUserListViewSelectionBackground); + KviTalGroupBox * g = addGroupBox(0, 0, 1, 0, Qt::Horizontal, __tr2qs_ctx("Background Colors", "options")); + addColorSelector(g, __tr2qs_ctx("Normal:", "options"), KviOption_colorUserListViewBackground); + addColorSelector(g, __tr2qs_ctx("Selected:", "options"), KviOption_colorUserListViewSelectionBackground); - addPixmapSelector(0,1,1,1,__tr2qs_ctx("Background image:","options"),KviOption_pixmapUserListViewBackground); + addPixmapSelector(0, 1, 1, 1, __tr2qs_ctx("Background image:", "options"), KviOption_pixmapUserListViewBackground); - addLabel(0,2,0,2,__tr2qs_ctx("Horizontal alignment:","options")); - m_pHorizontalAlign=new QComboBox(this); - addWidgetToLayout(m_pHorizontalAlign,1,2,1,2); + addLabel(0, 2, 0, 2, __tr2qs_ctx("Horizontal alignment:", "options")); + m_pHorizontalAlign = new QComboBox(this); + addWidgetToLayout(m_pHorizontalAlign, 1, 2, 1, 2); - addLabel(0,3,0,3,__tr2qs_ctx("Vertical alignment:","options")); - m_pVerticalAlign=new QComboBox(this); - addWidgetToLayout(m_pVerticalAlign,1,3,1,3); + addLabel(0, 3, 0, 3, __tr2qs_ctx("Vertical alignment:", "options")); + m_pVerticalAlign = new QComboBox(this); + addWidgetToLayout(m_pVerticalAlign, 1, 3, 1, 3); - m_pHorizontalAlign->addItem(__tr2qs_ctx("Tile","options")); - m_pHorizontalAlign->addItem(__tr2qs_ctx("Left","options")); - m_pHorizontalAlign->addItem(__tr2qs_ctx("Right","options")); - m_pHorizontalAlign->addItem(__tr2qs_ctx("Center","options")); + m_pHorizontalAlign->addItem(__tr2qs_ctx("Tile", "options")); + m_pHorizontalAlign->addItem(__tr2qs_ctx("Left", "options")); + m_pHorizontalAlign->addItem(__tr2qs_ctx("Right", "options")); + m_pHorizontalAlign->addItem(__tr2qs_ctx("Center", "options")); - m_pVerticalAlign->addItem(__tr2qs_ctx("Tile","options")); - m_pVerticalAlign->addItem(__tr2qs_ctx("Top","options")); - m_pVerticalAlign->addItem(__tr2qs_ctx("Bottom","options")); - m_pVerticalAlign->addItem(__tr2qs_ctx("Center","options")); + m_pVerticalAlign->addItem(__tr2qs_ctx("Tile", "options")); + m_pVerticalAlign->addItem(__tr2qs_ctx("Top", "options")); + m_pVerticalAlign->addItem(__tr2qs_ctx("Bottom", "options")); + m_pVerticalAlign->addItem(__tr2qs_ctx("Center", "options")); - switch( KVI_OPTION_UINT(KviOption_uintUserListPixmapAlign) & Qt::AlignHorizontal_Mask) + switch(KVI_OPTION_UINT(KviOption_uintUserListPixmapAlign) & Qt::AlignHorizontal_Mask) { case Qt::AlignLeft: m_pHorizontalAlign->setCurrentIndex(1); @@ -172,7 +166,7 @@ OptionsWidget_userListBackground::OptionsWidget_userListBackground(QWidget * par m_pHorizontalAlign->setCurrentIndex(0); } - switch( KVI_OPTION_UINT(KviOption_uintUserListPixmapAlign) & Qt::AlignVertical_Mask) + switch(KVI_OPTION_UINT(KviOption_uintUserListPixmapAlign) & Qt::AlignVertical_Mask) { case Qt::AlignTop: m_pVerticalAlign->setCurrentIndex(1); @@ -186,7 +180,7 @@ OptionsWidget_userListBackground::OptionsWidget_userListBackground(QWidget * par default: m_pVerticalAlign->setCurrentIndex(0); } - layout()->setRowStretch(1,1); + layout()->setRowStretch(1, 1); } OptionsWidget_userListBackground::~OptionsWidget_userListBackground() @@ -197,55 +191,55 @@ void OptionsWidget_userListBackground::commit() { KviOptionsWidget::commit(); - int iFlags=0; + int iFlags = 0; switch(m_pHorizontalAlign->currentIndex()) { case 1: - iFlags|=Qt::AlignLeft; + iFlags |= Qt::AlignLeft; break; case 2: - iFlags|=Qt::AlignRight; + iFlags |= Qt::AlignRight; break; case 3: - iFlags|=Qt::AlignHCenter; + iFlags |= Qt::AlignHCenter; break; } switch(m_pVerticalAlign->currentIndex()) { case 1: - iFlags|=Qt::AlignTop; + iFlags |= Qt::AlignTop; break; case 2: - iFlags|=Qt::AlignBottom; + iFlags |= Qt::AlignBottom; break; case 3: - iFlags|=Qt::AlignVCenter; + iFlags |= Qt::AlignVCenter; break; } - KVI_OPTION_UINT(KviOption_uintUserListPixmapAlign)=iFlags; + KVI_OPTION_UINT(KviOption_uintUserListPixmapAlign) = iFlags; } - OptionsWidget_userListFeatures::OptionsWidget_userListFeatures(QWidget * parent) -: KviOptionsWidget(parent,"userlistfeatures_options_widget") + : KviOptionsWidget(parent, "userlistfeatures_options_widget") { createLayout(); - addBoolSelector(0,0,0,0,__tr2qs_ctx("Show gender icons","options"),KviOption_boolDrawGenderIcons); - addBoolSelector(0,1,0,1,__tr2qs_ctx("Show user rank channel icons","options"),KviOption_boolShowUserChannelIcons); - addBoolSelector(0,2,0,2,__tr2qs_ctx("Show user channel activity indicator","options"),KviOption_boolShowUserChannelState); - addBoolSelector(0,3,0,3,__tr2qs_ctx("Show label with userlist stats","options"),KviOption_boolShowUserListStatisticLabel); - addBoolSelector(0,4,0,4,__tr2qs_ctx("Enable user tooltip","options"),KviOption_boolShowUserListViewToolTips); - addBoolSelector(0,5,0,5,__tr2qs_ctx("Show avatars in userlist","options"),KviOption_boolShowAvatarsInUserlist); - addBoolSelector(0,6,0,6,__tr2qs_ctx("Enable animated avatars","options"),KviOption_boolEnableAnimatedAvatars); - KviBoolSelector * b = addBoolSelector(0,7,0,7,__tr2qs_ctx("Place nicks starting with non-alpha characters (such as _COOL_BOY_) last","options"),KviOption_boolPlaceNickWithNonAlphaCharsAtEnd); - mergeTip(b,__tr2qs_ctx("All nicknames which include characters such as [ ] ^ _ < > | etc. " \ - "will be sorted last in userlist after all regular nicknames.
" \ - "Select this option if you prefer to see regular nicknames sorted topmost " \ - "on userlist.

Note: " \ - "Changes to this option requires KVIrc restart.","options")); - addRowSpacer(0,8,0,8); + addBoolSelector(0, 0, 0, 0, __tr2qs_ctx("Show gender icons", "options"), KviOption_boolDrawGenderIcons); + addBoolSelector(0, 1, 0, 1, __tr2qs_ctx("Show user rank channel icons", "options"), KviOption_boolShowUserChannelIcons); + addBoolSelector(0, 2, 0, 2, __tr2qs_ctx("Show user channel activity indicator", "options"), KviOption_boolShowUserChannelState); + addBoolSelector(0, 3, 0, 3, __tr2qs_ctx("Show label with userlist stats", "options"), KviOption_boolShowUserListStatisticLabel); + addBoolSelector(0, 4, 0, 4, __tr2qs_ctx("Enable user tooltip", "options"), KviOption_boolShowUserListViewToolTips); + addBoolSelector(0, 5, 0, 5, __tr2qs_ctx("Show avatars in userlist", "options"), KviOption_boolShowAvatarsInUserlist); + addBoolSelector(0, 6, 0, 6, __tr2qs_ctx("Enable animated avatars", "options"), KviOption_boolEnableAnimatedAvatars); + KviBoolSelector * b = addBoolSelector(0, 7, 0, 7, __tr2qs_ctx("Place nicks starting with non-alpha characters (such as _COOL_BOY_) last", "options"), KviOption_boolPlaceNickWithNonAlphaCharsAtEnd); + mergeTip(b, __tr2qs_ctx("All nicknames which include characters such as [ ] ^ _ < > | etc. " + "will be sorted last in userlist after all regular nicknames.
" + "Select this option if you prefer to see regular nicknames sorted topmost " + "on userlist.

Note: " + "Changes to this option requires KVIrc restart.", + "options")); + addRowSpacer(0, 8, 0, 8); } OptionsWidget_userListFeatures::~OptionsWidget_userListFeatures() diff --git a/src/modules/options/OptionsWidget_userList.h b/src/modules/options/OptionsWidget_userList.h index 1a4bd8e3e..5a42b704b 100644 --- a/src/modules/options/OptionsWidget_userList.h +++ b/src/modules/options/OptionsWidget_userList.h @@ -49,16 +49,17 @@ public: #define KVI_OPTIONS_WIDGET_PARENT_OptionsWidget_userListBackground OptionsWidget_userList #define KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_userListBackground 30 - class OptionsWidget_userListBackground : public KviOptionsWidget { Q_OBJECT public: OptionsWidget_userListBackground(QWidget * parent); ~OptionsWidget_userListBackground(); + protected: - QComboBox* m_pHorizontalAlign; - QComboBox* m_pVerticalAlign; + QComboBox * m_pHorizontalAlign; + QComboBox * m_pVerticalAlign; + public: virtual void commit(); }; @@ -70,7 +71,6 @@ public: #define KVI_OPTIONS_WIDGET_PARENT_OptionsWidget_userListForeground OptionsWidget_userList #define KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_userListForeground 20 - class OptionsWidget_userListForeground : public KviOptionsWidget { Q_OBJECT @@ -86,15 +86,16 @@ public: #define KVI_OPTIONS_WIDGET_PARENT_OptionsWidget_userListGrid OptionsWidget_userList #define KVI_OPTIONS_WIDGET_PRIORITY_OptionsWidget_userListGrid 30 - class OptionsWidget_userListGrid : public KviOptionsWidget { Q_OBJECT public: OptionsWidget_userListGrid(QWidget * parent); ~OptionsWidget_userListGrid(); + protected: QComboBox * m_pGridTypeCombo; + public: virtual void commit(); }; diff --git a/src/modules/options/OptionsWidget_windowList.cpp b/src/modules/options/OptionsWidget_windowList.cpp index 7ea461fb5..41e76b7dd 100644 --- a/src/modules/options/OptionsWidget_windowList.cpp +++ b/src/modules/options/OptionsWidget_windowList.cpp @@ -28,41 +28,39 @@ #include "KviLocale.h" #include "KviOptions.h" - OptionsWidget_windowList::OptionsWidget_windowList(QWidget * parent) -: KviOptionsWidget(parent) + : KviOptionsWidget(parent) { setObjectName("windowlist_options_widget"); createLayout(); - addBoolSelector(0,0,0,0,__tr2qs_ctx("Use tree window list","options"),KviOption_boolUseTreeWindowListWindowList); - addBoolSelector(0,1,0,1,__tr2qs_ctx("Sort windows by name","options"),KviOption_boolSortWindowListItemsByName); - addBoolSelector(0,2,0,2,__tr2qs_ctx("Show window icons in window list","options"),KviOption_boolUseWindowListIcons); - KviBoolSelector * b = addBoolSelector(0,3,0,3,__tr2qs_ctx("Show activity meter in window list","options"),KviOption_boolUseWindowListActivityMeter); - mergeTip(b,__tr2qs_ctx("This option enables the usage of the window list activity meter. " \ - "Each window entry will have a small indicator of the activity that is going on in that window. " \ - "The indicator is a small square that changes colors, dark colors mean low activity, " \ - "while bright colors signal high activity. KVIrc also uses some heuristics to determine " \ - "whether the activity is somewhat \"human\" or it is generated by automated entities (such as bots " \ - "or IRC servers). \"Human\" activity causes the indicator to be shaded red while automated " \ - "activity causes the indicator to be shaded blue.","options")); - - addBoolSelector(0,4,0,4,__tr2qs_ctx("Show IRC context indicator in window list","options"),KviOption_boolUseWindowListIrcContextIndicator); - addBoolSelector(0,5,0,5,__tr2qs_ctx("Enable window tooltips","options"),KviOption_boolShowWindowListToolTips); - addBoolSelector(0,6,0,6,__tr2qs_ctx("Allow the window list to be moved","options"),KviOption_boolShowTreeWindowListHandle); - addBoolSelector(0,7,0,7,__tr2qs_ctx("Show user flag for channels","options"),KviOption_boolShowUserFlagForChannelsInWindowList); - - addRowSpacer(0,8,0,8); + addBoolSelector(0, 0, 0, 0, __tr2qs_ctx("Use tree window list", "options"), KviOption_boolUseTreeWindowListWindowList); + addBoolSelector(0, 1, 0, 1, __tr2qs_ctx("Sort windows by name", "options"), KviOption_boolSortWindowListItemsByName); + addBoolSelector(0, 2, 0, 2, __tr2qs_ctx("Show window icons in window list", "options"), KviOption_boolUseWindowListIcons); + KviBoolSelector * b = addBoolSelector(0, 3, 0, 3, __tr2qs_ctx("Show activity meter in window list", "options"), KviOption_boolUseWindowListActivityMeter); + mergeTip(b, __tr2qs_ctx("This option enables the usage of the window list activity meter. " + "Each window entry will have a small indicator of the activity that is going on in that window. " + "The indicator is a small square that changes colors, dark colors mean low activity, " + "while bright colors signal high activity. KVIrc also uses some heuristics to determine " + "whether the activity is somewhat \"human\" or it is generated by automated entities (such as bots " + "or IRC servers). \"Human\" activity causes the indicator to be shaded red while automated " + "activity causes the indicator to be shaded blue.", + "options")); + + addBoolSelector(0, 4, 0, 4, __tr2qs_ctx("Show IRC context indicator in window list", "options"), KviOption_boolUseWindowListIrcContextIndicator); + addBoolSelector(0, 5, 0, 5, __tr2qs_ctx("Enable window tooltips", "options"), KviOption_boolShowWindowListToolTips); + addBoolSelector(0, 6, 0, 6, __tr2qs_ctx("Allow the window list to be moved", "options"), KviOption_boolShowTreeWindowListHandle); + addBoolSelector(0, 7, 0, 7, __tr2qs_ctx("Show user flag for channels", "options"), KviOption_boolShowUserFlagForChannelsInWindowList); + + addRowSpacer(0, 8, 0, 8); } - OptionsWidget_windowList::~OptionsWidget_windowList() { } - OptionsWidget_windowListTree::OptionsWidget_windowListTree(QWidget * parent) -: KviOptionsWidget(parent) + : KviOptionsWidget(parent) { setObjectName("treewindowlist_options_widget"); } @@ -71,68 +69,65 @@ OptionsWidget_windowListTree::~OptionsWidget_windowListTree() { } - OptionsWidget_windowListTreeForeground::OptionsWidget_windowListTreeForeground(QWidget * parent) -: KviOptionsWidget(parent) + : KviOptionsWidget(parent) { setObjectName("treewindowlist_options_widget"); createLayout(); - addFontSelector(0,0,0,0,__tr2qs_ctx("Font:","options"),KviOption_fontTreeWindowList); + addFontSelector(0, 0, 0, 0, __tr2qs_ctx("Font:", "options"), KviOption_fontTreeWindowList); - KviTalGroupBox *g = addGroupBox(0,1,0,1,Qt::Horizontal,__tr2qs_ctx("Text/Alert Colors","options")); + KviTalGroupBox * g = addGroupBox(0, 1, 0, 1, Qt::Horizontal, __tr2qs_ctx("Text/Alert Colors", "options")); - addColorSelector(g,__tr2qs_ctx("Normal:","options"),KviOption_colorTreeWindowListForeground); - addColorSelector(g,__tr2qs_ctx("Selected:","options"),KviOption_colorTreeWindowListActiveForeground); - addColorSelector(g,__tr2qs_ctx("Alert level 1:","options"),KviOption_colorTreeWindowListHighlight1Foreground); - addColorSelector(g,__tr2qs_ctx("Alert level 2:","options"),KviOption_colorTreeWindowListHighlight2Foreground); - addColorSelector(g,__tr2qs_ctx("Alert level 3:","options"),KviOption_colorTreeWindowListHighlight3Foreground); - addColorSelector(g,__tr2qs_ctx("Alert level 4:","options"),KviOption_colorTreeWindowListHighlight4Foreground); - addColorSelector(g,__tr2qs_ctx("Alert level 5:","options"),KviOption_colorTreeWindowListHighlight5Foreground); + addColorSelector(g, __tr2qs_ctx("Normal:", "options"), KviOption_colorTreeWindowListForeground); + addColorSelector(g, __tr2qs_ctx("Selected:", "options"), KviOption_colorTreeWindowListActiveForeground); + addColorSelector(g, __tr2qs_ctx("Alert level 1:", "options"), KviOption_colorTreeWindowListHighlight1Foreground); + addColorSelector(g, __tr2qs_ctx("Alert level 2:", "options"), KviOption_colorTreeWindowListHighlight2Foreground); + addColorSelector(g, __tr2qs_ctx("Alert level 3:", "options"), KviOption_colorTreeWindowListHighlight3Foreground); + addColorSelector(g, __tr2qs_ctx("Alert level 4:", "options"), KviOption_colorTreeWindowListHighlight4Foreground); + addColorSelector(g, __tr2qs_ctx("Alert level 5:", "options"), KviOption_colorTreeWindowListHighlight5Foreground); - addColorSelector(0,2,0,2,__tr2qs_ctx("Progress bar color:","options"),KviOption_colorTreeWindowListProgress); + addColorSelector(0, 2, 0, 2, __tr2qs_ctx("Progress bar color:", "options"), KviOption_colorTreeWindowListProgress); - addRowSpacer(0,3,0,3); + addRowSpacer(0, 3, 0, 3); } - OptionsWidget_windowListTreeForeground::~OptionsWidget_windowListTreeForeground() { } - OptionsWidget_windowListTreeBackground::OptionsWidget_windowListTreeBackground(QWidget * parent) -: KviOptionsWidget(parent) + : KviOptionsWidget(parent) { setObjectName("treewindowlist_options_widget"); createLayout(); - KviTalGroupBox * g = addGroupBox(0,0,1,0,Qt::Horizontal,__tr2qs_ctx("Background Colors","options")); - addColorSelector(g,__tr2qs_ctx("Normal:","options"),KviOption_colorTreeWindowListBackground); - addColorSelector(g,__tr2qs_ctx("Selected:","options"),KviOption_colorTreeWindowListActiveBackground); + KviTalGroupBox * g = addGroupBox(0, 0, 1, 0, Qt::Horizontal, __tr2qs_ctx("Background Colors", "options")); + addColorSelector(g, __tr2qs_ctx("Normal:", "options"), KviOption_colorTreeWindowListBackground); + addColorSelector(g, __tr2qs_ctx("Selected:", "options"), KviOption_colorTreeWindowListActiveBackground); - addPixmapSelector(0,1,1,1,__tr2qs_ctx("Background image:","options"),KviOption_pixmapTreeWindowListBackground); + addPixmapSelector(0, 1, 1, 1, __tr2qs_ctx("Background image:", "options"), KviOption_pixmapTreeWindowListBackground); - addLabel(0,2,0,2,__tr2qs_ctx("Horizontal align:","options")); - m_pHorizontalAlign=new QComboBox(this); - addWidgetToLayout(m_pHorizontalAlign,1,2,1,2); + addLabel(0, 2, 0, 2, __tr2qs_ctx("Horizontal align:", "options")); + m_pHorizontalAlign = new QComboBox(this); + addWidgetToLayout(m_pHorizontalAlign, 1, 2, 1, 2); - addLabel(0,3,0,3,__tr2qs_ctx("Vertical align:","options")); - m_pVerticalAlign=new QComboBox(this); - addWidgetToLayout(m_pVerticalAlign,1,3,1,3); + addLabel(0, 3, 0, 3, __tr2qs_ctx("Vertical align:", "options")); + m_pVerticalAlign = new QComboBox(this); + addWidgetToLayout(m_pVerticalAlign, 1, 3, 1, 3); - m_pHorizontalAlign->addItem(__tr2qs_ctx("Tile","options")); - m_pHorizontalAlign->addItem(__tr2qs_ctx("Left","options")); - m_pHorizontalAlign->addItem(__tr2qs_ctx("Right","options")); - m_pHorizontalAlign->addItem(__tr2qs_ctx("Center","options")); + m_pHorizontalAlign->addItem(__tr2qs_ctx("Tile", "options")); + m_pHorizontalAlign->addItem(__tr2qs_ctx("Left", "options")); + m_pHorizontalAlign->addItem(__tr2qs_ctx("Right", "options")); + m_pHorizontalAlign->addItem(__tr2qs_ctx("Center", "options")); - m_pVerticalAlign->addItem(__tr2qs_ctx("Tile","options")); - m_pVerticalAlign->addItem(__tr2qs_ctx("Top","options")); - m_pVerticalAlign->addItem(__tr2qs_ctx("Bottom","options")); - m_pVerticalAlign->addItem(__tr2qs_ctx("Center","options")); + m_pVerticalAlign->addItem(__tr2qs_ctx("Tile", "options")); + m_pVerticalAlign->addItem(__tr2qs_ctx("Top", "options")); + m_pVerticalAlign->addItem(__tr2qs_ctx("Bottom", "options")); + m_pVerticalAlign->addItem(__tr2qs_ctx("Center", "options")); - switch( KVI_OPTION_UINT(KviOption_uintTreeWindowListPixmapAlign) & Qt::AlignHorizontal_Mask) + switch(KVI_OPTION_UINT(KviOption_uintTreeWindowListPixmapAlign) & Qt::AlignHorizontal_Mask) { case Qt::AlignLeft: m_pHorizontalAlign->setCurrentIndex(1); @@ -147,7 +142,7 @@ OptionsWidget_windowListTreeBackground::OptionsWidget_windowListTreeBackground(Q m_pHorizontalAlign->setCurrentIndex(0); } - switch( KVI_OPTION_UINT(KviOption_uintTreeWindowListPixmapAlign) & Qt::AlignVertical_Mask) + switch(KVI_OPTION_UINT(KviOption_uintTreeWindowListPixmapAlign) & Qt::AlignVertical_Mask) { case Qt::AlignTop: m_pVerticalAlign->setCurrentIndex(1); @@ -162,100 +157,94 @@ OptionsWidget_windowListTreeBackground::OptionsWidget_windowListTreeBackground(Q m_pVerticalAlign->setCurrentIndex(0); } - layout()->setRowStretch(1,1); + layout()->setRowStretch(1, 1); } - OptionsWidget_windowListTreeBackground::~OptionsWidget_windowListTreeBackground() { } - void OptionsWidget_windowListTreeBackground::commit() { KviOptionsWidget::commit(); - int iFlags=0; + int iFlags = 0; switch(m_pHorizontalAlign->currentIndex()) { case 1: - iFlags|=Qt::AlignLeft; + iFlags |= Qt::AlignLeft; break; case 2: - iFlags|=Qt::AlignRight; + iFlags |= Qt::AlignRight; break; case 3: - iFlags|=Qt::AlignHCenter; + iFlags |= Qt::AlignHCenter; break; } switch(m_pVerticalAlign->currentIndex()) { case 1: - iFlags|=Qt::AlignTop; + iFlags |= Qt::AlignTop; break; case 2: - iFlags|=Qt::AlignBottom; + iFlags |= Qt::AlignBottom; break; case 3: - iFlags|=Qt::AlignVCenter; + iFlags |= Qt::AlignVCenter; break; } - KVI_OPTION_UINT(KviOption_uintTreeWindowListPixmapAlign)=iFlags; + KVI_OPTION_UINT(KviOption_uintTreeWindowListPixmapAlign) = iFlags; } - OptionsWidget_windowListTreeFeatures::OptionsWidget_windowListTreeFeatures(QWidget * parent) -: KviOptionsWidget(parent) + : KviOptionsWidget(parent) { setObjectName("treewindowlist_options_widget"); createLayout(); KviUIntSelector * u; - - u = addUIntSelector(0,1,0,1,__tr2qs_ctx("Minimum width:","options"),KviOption_uintTreeWindowListMinimumWidth,24,1024,125); - u->setSuffix(__tr2qs_ctx(" pixels","options")); - addBoolSelector(0,3,0,3,__tr2qs_ctx("Mouse wheel changes the active window instead of scrolling the scrollbar","options"),KviOption_boolWheelScrollsWindowsList); - addRowSpacer(0,4,0,4); -} + u = addUIntSelector(0, 1, 0, 1, __tr2qs_ctx("Minimum width:", "options"), KviOption_uintTreeWindowListMinimumWidth, 24, 1024, 125); + u->setSuffix(__tr2qs_ctx(" pixels", "options")); + addBoolSelector(0, 3, 0, 3, __tr2qs_ctx("Mouse wheel changes the active window instead of scrolling the scrollbar", "options"), KviOption_boolWheelScrollsWindowsList); + addRowSpacer(0, 4, 0, 4); +} OptionsWidget_windowListTreeFeatures::~OptionsWidget_windowListTreeFeatures() { } - OptionsWidget_windowListClassic::OptionsWidget_windowListClassic(QWidget * parent) -: KviOptionsWidget(parent) + : KviOptionsWidget(parent) { setObjectName("classicwindowlist_options_widget"); createLayout(); KviUIntSelector * u; - addFontSelector(0,0,0,0,__tr2qs_ctx("Font:","options"),KviOption_fontWindowList); - KviTalGroupBox *g = addGroupBox(0,1,0,1,Qt::Horizontal,__tr2qs_ctx("Text/Alert Colors","options")); - addColorSelector(g,__tr2qs_ctx("Normal:","options"),KviOption_colorWindowListNormalText); - addColorSelector(g,__tr2qs_ctx("Minimized:","options"), KviOption_colorWindowListMinimizedText); - addColorSelector(g,__tr2qs_ctx("Alert level 1:","options"),KviOption_colorWindowListHighlight1Text); - addColorSelector(g,__tr2qs_ctx("Alert level 2:","options"),KviOption_colorWindowListHighlight2Text); - addColorSelector(g,__tr2qs_ctx("Alert level 3:","options"),KviOption_colorWindowListHighlight3Text); - addColorSelector(g,__tr2qs_ctx("Alert level 4:","options"),KviOption_colorWindowListHighlight4Text); - addColorSelector(g,__tr2qs_ctx("Alert level 5:","options"),KviOption_colorWindowListHighlight5Text); - - addColorSelector(0,2,0,2,__tr2qs_ctx("Progress bar color:","options"),KviOption_colorWindowListProgressBar); - u = addUIntSelector(0,3,0,3,__tr2qs_ctx("Minimum width of buttons:","options"),KviOption_uintWindowListButtonMinWidth,24,9999,100); - u->setSuffix(__tr2qs_ctx(" pixels","options")); - addBoolSelector(0,4,0,4,__tr2qs_ctx("Set maximum button width","options"),KviOption_boolClassicWindowListSetMaximumButtonWidth); - u = addUIntSelector(0,5,0,5,__tr2qs_ctx("Maximum width of buttons:","options"),KviOption_uintClassicWindowListMaximumButtonWidth,24,9999,100); - u->setSuffix(__tr2qs_ctx(" pixels","options")); - addBoolSelector(0,6,0,6,__tr2qs_ctx("Use flat buttons","options"),KviOption_boolUseFlatClassicWindowListButtons); - - addRowSpacer(0,7,0,7); + addFontSelector(0, 0, 0, 0, __tr2qs_ctx("Font:", "options"), KviOption_fontWindowList); + KviTalGroupBox * g = addGroupBox(0, 1, 0, 1, Qt::Horizontal, __tr2qs_ctx("Text/Alert Colors", "options")); + addColorSelector(g, __tr2qs_ctx("Normal:", "options"), KviOption_colorWindowListNormalText); + addColorSelector(g, __tr2qs_ctx("Minimized:", "options"), KviOption_colorWindowListMinimizedText); + addColorSelector(g, __tr2qs_ctx("Alert level 1:", "options"), KviOption_colorWindowListHighlight1Text); + addColorSelector(g, __tr2qs_ctx("Alert level 2:", "options"), KviOption_colorWindowListHighlight2Text); + addColorSelector(g, __tr2qs_ctx("Alert level 3:", "options"), KviOption_colorWindowListHighlight3Text); + addColorSelector(g, __tr2qs_ctx("Alert level 4:", "options"), KviOption_colorWindowListHighlight4Text); + addColorSelector(g, __tr2qs_ctx("Alert level 5:", "options"), KviOption_colorWindowListHighlight5Text); + + addColorSelector(0, 2, 0, 2, __tr2qs_ctx("Progress bar color:", "options"), KviOption_colorWindowListProgressBar); + u = addUIntSelector(0, 3, 0, 3, __tr2qs_ctx("Minimum width of buttons:", "options"), KviOption_uintWindowListButtonMinWidth, 24, 9999, 100); + u->setSuffix(__tr2qs_ctx(" pixels", "options")); + addBoolSelector(0, 4, 0, 4, __tr2qs_ctx("Set maximum button width", "options"), KviOption_boolClassicWindowListSetMaximumButtonWidth); + u = addUIntSelector(0, 5, 0, 5, __tr2qs_ctx("Maximum width of buttons:", "options"), KviOption_uintClassicWindowListMaximumButtonWidth, 24, 9999, 100); + u->setSuffix(__tr2qs_ctx(" pixels", "options")); + addBoolSelector(0, 6, 0, 6, __tr2qs_ctx("Use flat buttons", "options"), KviOption_boolUseFlatClassicWindowListButtons); + + addRowSpacer(0, 7, 0, 7); } - OptionsWidget_windowListClassic::~OptionsWidget_windowListClassic() { } diff --git a/src/modules/options/OptionsWidget_windowList.h b/src/modules/options/OptionsWidget_windowList.h index 0a6dcfd3c..a062273c7 100644 --- a/src/modules/options/OptionsWidget_windowList.h +++ b/src/modules/options/OptionsWidget_windowList.h @@ -25,12 +25,10 @@ // //=============================================================================== - #include "KviOptionsWidget.h" #include - #define KVI_OPTIONS_WIDGET_ICON_OptionsWidget_windowList KviIconManager::ClassicWindowList #define KVI_OPTIONS_WIDGET_NAME_OptionsWidget_windowList __tr2qs_no_lookup("Window List") #define KVI_OPTIONS_WIDGET_MINIMAL_USER_EXPERIENCE_LEVEL_OptionsWidget_windowList 2 @@ -84,8 +82,9 @@ class OptionsWidget_windowListTreeBackground : public KviOptionsWidget { Q_OBJECT private: - QComboBox* m_pHorizontalAlign; - QComboBox* m_pVerticalAlign; + QComboBox * m_pHorizontalAlign; + QComboBox * m_pVerticalAlign; + public: OptionsWidget_windowListTreeBackground(QWidget * parent); ~OptionsWidget_windowListTreeBackground(); diff --git a/src/modules/options/libkvioptions.cpp b/src/modules/options/libkvioptions.cpp index 9cb3ad246..ff958f594 100644 --- a/src/modules/options/libkvioptions.cpp +++ b/src/modules/options/libkvioptions.cpp @@ -38,7 +38,7 @@ #include -KviPointerHashTable * g_pOptionsDialogDict = 0; +KviPointerHashTable * g_pOptionsDialogDict = 0; OptionsInstanceManager * g_pOptionsInstanceManager = 0; @@ -70,7 +70,6 @@ static bool options_kvs_cmd_save(KviKvsModuleCommandCall *) return true; } - /* @doc: options.dialog @type: @@ -92,45 +91,51 @@ static bool options_kvs_cmd_save(KviKvsModuleCommandCall *) [fnc]$options.isDialog[/fnc] */ - static bool options_kvs_cmd_dialog(KviKvsModuleCommandCall * c) { QString szGroup; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("options_group",KVS_PT_STRING,KVS_PF_OPTIONAL,szGroup) + KVSM_PARAMETER("options_group", KVS_PT_STRING, KVS_PF_OPTIONAL, szGroup) KVSM_PARAMETERS_END(c) - if(szGroup.isEmpty())szGroup = "general"; + if(szGroup.isEmpty()) + szGroup = "general"; if(szGroup != "general" && szGroup != "theme") { - c->warning(__tr2qs_ctx("No such options_group %Q","options"),&szGroup); + c->warning(__tr2qs_ctx("No such options_group %Q", "options"), &szGroup); return true; } OptionsDialog * d = g_pOptionsDialogDict->find(szGroup); if(d) { - if(c->hasSwitch('t',"toplevel")) + if(c->hasSwitch('t', "toplevel")) { if(d->parent()) { d->setParent(0); - d->setGeometry(0,0,d->width(),d->height()); + d->setGeometry(0, 0, d->width(), d->height()); } - } else { + } + else + { if(d->parent() != g_pMainWindow->splitter()) { d->setParent(g_pMainWindow->splitter()); - d->setGeometry(0,0,d->width(),d->height()); + d->setGeometry(0, 0, d->width(), d->height()); d->show(); } } - } else { - if(c->hasSwitch('t',"toplevel")) + } + else + { + if(c->hasSwitch('t', "toplevel")) + { + d = new OptionsDialog(g_pMainWindow, szGroup, true); + } + else { - d = new OptionsDialog(g_pMainWindow,szGroup,true); - } else { - d = new OptionsDialog(g_pMainWindow->splitter(),szGroup,false); + d = new OptionsDialog(g_pMainWindow->splitter(), szGroup, false); } - g_pOptionsDialogDict->insert(szGroup,d); + g_pOptionsDialogDict->insert(szGroup, d); } d->raise(); d->show(); @@ -153,17 +158,16 @@ static bool options_kvs_cmd_dialog(KviKvsModuleCommandCall * c) @seealso: */ - -static void options_kvs_module_print_pages(KviKvsModuleCommandCall * c,OptionsWidgetInstanceEntry * e,const char * prefix) +static void options_kvs_module_print_pages(KviKvsModuleCommandCall * c, OptionsWidgetInstanceEntry * e, const char * prefix) { - c->window()->output(KVI_OUT_SYSTEMMESSAGE,"%s%c%s%c (%Q)",prefix,KviControlCodes::Bold,e->szClassName,KviControlCodes::Bold,&(e->szName)); + c->window()->output(KVI_OUT_SYSTEMMESSAGE, "%s%c%s%c (%Q)", prefix, KviControlCodes::Bold, e->szClassName, KviControlCodes::Bold, &(e->szName)); KviCString szPre = prefix; szPre.append(" "); if(e->pChildList) { - for(OptionsWidgetInstanceEntry * ex = e->pChildList->first();ex;ex = e->pChildList->next()) + for(OptionsWidgetInstanceEntry * ex = e->pChildList->first(); ex; ex = e->pChildList->next()) { - options_kvs_module_print_pages(c,ex,szPre.ptr()); + options_kvs_module_print_pages(c, ex, szPre.ptr()); } } } @@ -172,9 +176,9 @@ static bool options_kvs_cmd_pages(KviKvsModuleCommandCall * c) { KviPointerList * l = g_pOptionsInstanceManager->instanceEntryTree(); - for(OptionsWidgetInstanceEntry * e = l->first();e;e = l->next()) + for(OptionsWidgetInstanceEntry * e = l->first(); e; e = l->next()) { - options_kvs_module_print_pages(c,e,""); + options_kvs_module_print_pages(c, e, ""); } return true; @@ -201,13 +205,13 @@ static bool options_kvs_cmd_edit(KviKvsModuleCommandCall * c) { QString szOption; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("option",KVS_PT_STRING,0,szOption) + KVSM_PARAMETER("option", KVS_PT_STRING, 0, szOption) KVSM_PARAMETERS_END(c) OptionsWidgetInstanceEntry * e = g_pOptionsInstanceManager->findInstanceEntry(szOption.toUtf8().data()); if(!e) { - c->warning(__tr2qs_ctx("No such options page class name %Q","options"),&szOption); + c->warning(__tr2qs_ctx("No such options page class name %Q", "options"), &szOption); return true; } @@ -220,11 +224,10 @@ static bool options_kvs_cmd_edit(KviKvsModuleCommandCall * c) } OptionsWidgetContainer * wc = new OptionsWidgetContainer( - g_pMainWindow, - !c->hasSwitch('n',"non-modal") - ); + g_pMainWindow, + !c->hasSwitch('n', "non-modal")); - wc->setup(g_pOptionsInstanceManager->getInstance(e,wc)); + wc->setup(g_pOptionsInstanceManager->getInstance(e, wc)); //wc->setModal(true); @@ -256,14 +259,14 @@ static bool options_kvs_fnc_isdialog(KviKvsModuleFunctionCall * c) { QString szGroup; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("options_group",KVS_PT_STRING,KVS_PF_OPTIONAL,szGroup) + KVSM_PARAMETER("options_group", KVS_PT_STRING, KVS_PF_OPTIONAL, szGroup) KVSM_PARAMETERS_END(c) - if(szGroup.isEmpty())szGroup = "general"; + if(szGroup.isEmpty()) + szGroup = "general"; c->returnValue()->setBoolean(g_pOptionsDialogDict->find(szGroup)); return true; } - /* @doc: options.close @type: @@ -283,12 +286,11 @@ static bool options_kvs_fnc_isdialog(KviKvsModuleFunctionCall * c) [fnc]$options.isDialog[/fnc] */ - static bool options_kvs_cmd_close(KviKvsModuleCommandCall * c) { QString szGroup; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("options_group",KVS_PT_STRING,KVS_PF_OPTIONAL,szGroup) + KVSM_PARAMETER("options_group", KVS_PT_STRING, KVS_PF_OPTIONAL, szGroup) KVSM_PARAMETERS_END(c) if(szGroup.isEmpty()) szGroup = "general"; @@ -316,36 +318,36 @@ static bool options_kvs_cmd_close(KviKvsModuleCommandCall * c) return true; } - static bool options_module_init(KviModule * m) { g_pOptionsInstanceManager = new OptionsInstanceManager(); - KVSM_REGISTER_SIMPLE_COMMAND(m,"dialog",options_kvs_cmd_dialog); - KVSM_REGISTER_SIMPLE_COMMAND(m,"close",options_kvs_cmd_close); - KVSM_REGISTER_SIMPLE_COMMAND(m,"save",options_kvs_cmd_save); - KVSM_REGISTER_SIMPLE_COMMAND(m,"pages",options_kvs_cmd_pages); - KVSM_REGISTER_SIMPLE_COMMAND(m,"edit",options_kvs_cmd_edit); - KVSM_REGISTER_FUNCTION(m,"isDialog",options_kvs_fnc_isdialog); + KVSM_REGISTER_SIMPLE_COMMAND(m, "dialog", options_kvs_cmd_dialog); + KVSM_REGISTER_SIMPLE_COMMAND(m, "close", options_kvs_cmd_close); + KVSM_REGISTER_SIMPLE_COMMAND(m, "save", options_kvs_cmd_save); + KVSM_REGISTER_SIMPLE_COMMAND(m, "pages", options_kvs_cmd_pages); + KVSM_REGISTER_SIMPLE_COMMAND(m, "edit", options_kvs_cmd_edit); + KVSM_REGISTER_FUNCTION(m, "isDialog", options_kvs_fnc_isdialog); - g_pOptionsDialogDict = new KviPointerHashTable; + g_pOptionsDialogDict = new KviPointerHashTable; g_pOptionsDialogDict->setAutoDelete(false); return true; } -static bool options_module_cleanup(KviModule *m) +static bool options_module_cleanup(KviModule * m) { - KviPointerHashTableIterator it(*g_pOptionsDialogDict); + KviPointerHashTableIterator it(*g_pOptionsDialogDict); KviPointerList l; l.setAutoDelete(false); OptionsDialog * d; - while( (d = it.current()) ) + while((d = it.current())) { l.append(d); ++it; } - for(d = l.first();d;d = l.next())delete d; + for(d = l.first(); d; d = l.next()) + delete d; delete g_pOptionsDialogDict; g_pOptionsDialogDict = 0; @@ -362,13 +364,12 @@ static bool options_module_can_unload(KviModule *) } KVIRC_MODULE( - "Options", // module name - "4.0.0", // module version - "Copyright (C) 2000 Szymon Stefanek (pragma at kvirc dot net)", // author & (C) - "Options Dialog", - options_module_init, - options_module_can_unload, - 0, - options_module_cleanup, - "options" -) + "Options", // module name + "4.0.0", // module version + "Copyright (C) 2000 Szymon Stefanek (pragma at kvirc dot net)", // author & (C) + "Options Dialog", + options_module_init, + options_module_can_unload, + 0, + options_module_cleanup, + "options") diff --git a/src/modules/package/libkvipackage.cpp b/src/modules/package/libkvipackage.cpp index 3f7ed0e91..af9b3b9a5 100644 --- a/src/modules/package/libkvipackage.cpp +++ b/src/modules/package/libkvipackage.cpp @@ -43,17 +43,17 @@ static QString createRandomDir() { QString szDirName; char chars[] = { - 'A','B','C','D','E','F','G','H', - 'I','J','K','L','M','N','O','P', - 'Q','R','S','T','U','V','W','X', - 'Y','Z','a','b','c','d','e','f', - 'g','h','i','j','k','l','m','n', - 'o','p','q','r','s','t','u','v', - 'w','x','y','z','-','_','.' + 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', + 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', + 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', + 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', + 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', + 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', + 'w', 'x', 'y', 'z', '-', '_', '.' }; // Generate dir name - for(int i=0;i<10;i++) + for(int i = 0; i < 10; i++) { int n = rand() % sizeof(chars); szDirName.append(chars[n]); @@ -62,7 +62,6 @@ static QString createRandomDir() return szDirName; } - /* @doc: package.info @type: @@ -84,7 +83,7 @@ static bool package_kvs_fnc_info(KviKvsModuleFunctionCall * c) { QString szPath; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("package_path",KVS_PT_NONEMPTYSTRING,0,szPath) + KVSM_PARAMETER("package_path", KVS_PT_NONEMPTYSTRING, 0, szPath) KVSM_PARAMETERS_END(c) KviKvsHash * pHash = new KviKvsHash(); @@ -95,8 +94,8 @@ static bool package_kvs_fnc_info(KviKvsModuleFunctionCall * c) QString szTmpPath, szUnpackPath; QString szRandomDir = createRandomDir(); - g_pApp->getLocalKvircDirectory(szTmpPath,KviApplication::Tmp); - KviQString::ensureLastCharIs(szTmpPath,QChar(KVI_PATH_SEPARATOR_CHAR)); + g_pApp->getLocalKvircDirectory(szTmpPath, KviApplication::Tmp); + KviQString::ensureLastCharIs(szTmpPath, QChar(KVI_PATH_SEPARATOR_CHAR)); szUnpackPath = szTmpPath + szRandomDir; QDir szTmpDir(szUnpackPath); @@ -111,62 +110,60 @@ static bool package_kvs_fnc_info(KviKvsModuleFunctionCall * c) KviPackageReader r; // Unpack addon package into the random tmp dir - if(!r.unpack(szPath,szUnpackPath)) + if(!r.unpack(szPath, szUnpackPath)) { - pHash->set("error",new KviKvsVariant(r.lastError())); + pHash->set("error", new KviKvsVariant(r.lastError())); return true; } KviKvsHash * pInfoHash = new KviKvsHash(); - pHash->set("info",new KviKvsVariant(pInfoHash)); + pHash->set("info", new KviKvsVariant(pInfoHash)); QFileInfo inf(szPath); - pInfoHash->set("path",new KviKvsVariant(szPath)); - pInfoHash->set("name",new KviKvsVariant(inf.fileName())); - pInfoHash->set("size",new KviKvsVariant((kvs_int_t)inf.size())); + pInfoHash->set("path", new KviKvsVariant(szPath)); + pInfoHash->set("name", new KviKvsVariant(inf.fileName())); + pInfoHash->set("size", new KviKvsVariant((kvs_int_t)inf.size())); KviKvsHash * pMetadataHash = new KviKvsHash(); - pHash->set("metadata",new KviKvsVariant(pMetadataHash)); - - KviPointerHashTable * pInfoFields1 = r.stringInfoFields(); - KviPointerHashTableIterator it(*pInfoFields1); + pHash->set("metadata", new KviKvsVariant(pMetadataHash)); + KviPointerHashTable * pInfoFields1 = r.stringInfoFields(); + KviPointerHashTableIterator it(*pInfoFields1); while(it.current()) { - pMetadataHash->set(it.currentKey(),new KviKvsVariant(*(it.current()))); + pMetadataHash->set(it.currentKey(), new KviKvsVariant(*(it.current()))); it.moveNext(); } - KviPointerHashTable * pInfoFields2 = r.binaryInfoFields(); - KviPointerHashTableIterator it2(*pInfoFields2); + KviPointerHashTable * pInfoFields2 = r.binaryInfoFields(); + KviPointerHashTableIterator it2(*pInfoFields2); while(it2.current()) { - pMetadataHash->set(it2.currentKey(),new KviKvsVariant(QString("").arg(it2.current()->size()))); + pMetadataHash->set(it2.currentKey(), new KviKvsVariant(QString("").arg(it2.current()->size()))); it2.moveNext(); } KviKvsArray * pFilesArray = new KviKvsArray(); - pHash->set("files",new KviKvsVariant(pFilesArray)); + pHash->set("files", new KviKvsVariant(pFilesArray)); QStringList sl = KviFileUtils::getFileListing(szUnpackPath); - Q_FOREACH(QString fn,sl) + Q_FOREACH(QString fn, sl) pFilesArray->append(new KviKvsVariant(fn)); // delete the random tmp dir if(!KviFileUtils::deleteDir(szUnpackPath)) - qDebug("Could not delete temporary directory %s",szUnpackPath.toUtf8().data()); + qDebug("Could not delete temporary directory %s", szUnpackPath.toUtf8().data()); return true; } - /* @doc: package.extractfield @type: @@ -183,11 +180,11 @@ static bool package_kvs_fnc_info(KviKvsModuleFunctionCall * c) */ static bool package_kvs_cmd_extractField(KviKvsModuleCommandCall * c) { - QString szPackagePath,szFieldId,szTargetFileName; + QString szPackagePath, szFieldId, szTargetFileName; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("package_path",KVS_PT_NONEMPTYSTRING,0,szPackagePath) - KVSM_PARAMETER("field_id",KVS_PT_NONEMPTYSTRING,0,szFieldId) - KVSM_PARAMETER("target_file_name",KVS_PT_NONEMPTYSTRING,0,szTargetFileName) + KVSM_PARAMETER("package_path", KVS_PT_NONEMPTYSTRING, 0, szPackagePath) + KVSM_PARAMETER("field_id", KVS_PT_NONEMPTYSTRING, 0, szFieldId) + KVSM_PARAMETER("target_file_name", KVS_PT_NONEMPTYSTRING, 0, szTargetFileName) KVSM_PARAMETERS_END(c) KviPackageReader r; @@ -195,7 +192,7 @@ static bool package_kvs_cmd_extractField(KviKvsModuleCommandCall * c) // Unpack addon package into the random tmp dir if(!r.readHeader(szPackagePath)) { - c->warning(__tr2qs_ctx("Failed to load package file: %1","package").arg(r.lastError())); + c->warning(__tr2qs_ctx("Failed to load package file: %1", "package").arg(r.lastError())); return true; } @@ -203,25 +200,24 @@ static bool package_kvs_cmd_extractField(KviKvsModuleCommandCall * c) if(!pField) { - c->warning(__tr2qs_ctx("Package doesn't contain binary field %1","package").arg(szFieldId)); + c->warning(__tr2qs_ctx("Package doesn't contain binary field %1", "package").arg(szFieldId)); return true; } - if(!KviFileUtils::writeFile(szTargetFileName,*pField,false)) + if(!KviFileUtils::writeFile(szTargetFileName, *pField, false)) { - c->warning(__tr2qs_ctx("Failed to save file %1","package").arg(szTargetFileName)); + c->warning(__tr2qs_ctx("Failed to save file %1", "package").arg(szTargetFileName)); return true; } return true; } - -static bool package_module_init(KviModule *m) +static bool package_module_init(KviModule * m) { - KVSM_REGISTER_FUNCTION(m,"info",package_kvs_fnc_info); + KVSM_REGISTER_FUNCTION(m, "info", package_kvs_fnc_info); - KVSM_REGISTER_SIMPLE_COMMAND(m,"extractField",package_kvs_cmd_extractField); + KVSM_REGISTER_SIMPLE_COMMAND(m, "extractField", package_kvs_cmd_extractField); return true; } @@ -231,13 +227,12 @@ static bool package_module_cleanup(KviModule *) } KVIRC_MODULE( - "package", // module name - "1.0.0", // module version - "Copyright (C) 2015 Szymon Stefanek (pragma at kvirc dot net)", // author & (C) - "Interface to KVIrc package files", - package_module_init, - 0, - 0, - package_module_cleanup, - 0 -) + "package", // module name + "1.0.0", // module version + "Copyright (C) 2015 Szymon Stefanek (pragma at kvirc dot net)", // author & (C) + "Interface to KVIrc package files", + package_module_init, + 0, + 0, + package_module_cleanup, + 0) diff --git a/src/modules/perl/libkviperl.cpp b/src/modules/perl/libkviperl.cpp index 17230716a..70fe63521 100644 --- a/src/modules/perl/libkviperl.cpp +++ b/src/modules/perl/libkviperl.cpp @@ -32,34 +32,34 @@ #include "kvi_out.h" #ifdef COMPILE_PERL_SUPPORT - #include "../perlcore/perlcoreinterface.h" +#include "../perlcore/perlcoreinterface.h" - static KviModule * g_pPerlCoreModule = 0; +static KviModule * g_pPerlCoreModule = 0; #endif // COMPILE_PERL_SUPPORT #ifdef COMPILE_PERL_SUPPORT - #define KVS_CHECK_PERLCORE(_m,_c) \ - g_pPerlCoreModule = g_pModuleManager->getModule("perlcore"); \ - if(!g_pPerlCoreModule) \ - { \ - if(!_c->switches()->find('q',"quiet")) \ - { \ - _c->warning(__tr2qs_ctx("The perlcore module can't be loaded: Perl support not available","perl")); \ - _c->warning(__tr2qs_ctx("To see more details about loading failure try /perlcore.load","perl")); \ - return true; \ - } \ - } +#define KVS_CHECK_PERLCORE(_m, _c) \ + g_pPerlCoreModule = g_pModuleManager->getModule("perlcore"); \ + if(!g_pPerlCoreModule) \ + { \ + if(!_c->switches()->find('q', "quiet")) \ + { \ + _c->warning(__tr2qs_ctx("The perlcore module can't be loaded: Perl support not available", "perl")); \ + _c->warning(__tr2qs_ctx("To see more details about loading failure try /perlcore.load", "perl")); \ + return true; \ + } \ + } #else // !COMPILE_PERL_SUPPORT - #define KVS_CHECK_PERLCORE(_m,_c) +#define KVS_CHECK_PERLCORE(_m, _c) #endif // !COMPILE_PERL_SUPPORT #ifdef COMPILE_PERL_SUPPORT - #define KVS_CHECK_MODULE_STATE(_m,_c) KVS_CHECK_PERLCORE(_m,_c) +#define KVS_CHECK_MODULE_STATE(_m, _c) KVS_CHECK_PERLCORE(_m, _c) #else // !COMPILE_PERL_SUPPORT - #define KVS_CHECK_MODULE_STATE(_m,_c) \ - if(!_c->switches()->find('q',"quiet")) \ - _c->warning(__tr2qs_ctx("This KVIrc executable has been compiled without Perl scripting support","perl")); \ - return true; +#define KVS_CHECK_MODULE_STATE(_m, _c) \ + if(!_c->switches()->find('q', "quiet")) \ + _c->warning(__tr2qs_ctx("This KVIrc executable has been compiled without Perl scripting support", "perl")); \ + return true; #endif // !COMPILE_PERL_SUPPORT /* @@ -424,15 +424,15 @@ static bool perl_kvs_cmd_begin(KviKvsModuleCommandCall * c) // The parser sets the perl code as the first parameter of our call, // the remaining params are the context name and the arguments - QString szCode,szContext; + QString szCode, szContext; KviKvsVariantList vList; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("code",KVS_PT_STRING,0,szCode) - KVSM_PARAMETER("context",KVS_PT_STRING,KVS_PF_OPTIONAL,szContext) - KVSM_PARAMETER("args",KVS_PT_VARIANTLIST,KVS_PF_OPTIONAL,vList) + KVSM_PARAMETER("code", KVS_PT_STRING, 0, szCode) + KVSM_PARAMETER("context", KVS_PT_STRING, KVS_PF_OPTIONAL, szContext) + KVSM_PARAMETER("args", KVS_PT_VARIANTLIST, KVS_PF_OPTIONAL, vList) KVSM_PARAMETERS_END(c) - KVS_CHECK_MODULE_STATE(m,c) + KVS_CHECK_MODULE_STATE(m, c) #ifdef COMPILE_PERL_SUPPORT KviPerlCoreCtrlCommand_execute ex; @@ -440,45 +440,47 @@ static bool perl_kvs_cmd_begin(KviKvsModuleCommandCall * c) ex.pKvsContext = c->context(); ex.szContext = szContext; ex.szCode = szCode; - for(KviKvsVariant * v = vList.first();v;v = vList.next()) + for(KviKvsVariant * v = vList.first(); v; v = vList.next()) { QString tmp; v->asString(tmp); ex.lArgs.append(tmp); } - ex.bQuiet = c->switches()->find('q',"quiet"); + ex.bQuiet = c->switches()->find('q', "quiet"); - if(!g_pPerlCoreModule->ctrl(KVI_PERLCORECTRLCOMMAND_EXECUTE,&ex)) + if(!g_pPerlCoreModule->ctrl(KVI_PERLCORECTRLCOMMAND_EXECUTE, &ex)) { - if(!c->switches()->find('q',"quiet")) - c->warning(__tr2qs_ctx("The perlcore module failed to execute the code: something is wrong with the Perl support","perl")); + if(!c->switches()->find('q', "quiet")) + c->warning(__tr2qs_ctx("The perlcore module failed to execute the code: something is wrong with the Perl support", "perl")); return true; } if(!ex.lWarnings.isEmpty()) { - for(QStringList::Iterator it = ex.lWarnings.begin();it != ex.lWarnings.end();++it) + for(QStringList::Iterator it = ex.lWarnings.begin(); it != ex.lWarnings.end(); ++it) c->warning(*it); } if(!ex.bExitOk) { - if(!c->switches()->find('q',"quiet")) + if(!c->switches()->find('q', "quiet")) { - if(c->switches()->find('f',"fail-on-error")) + if(c->switches()->find('f', "fail-on-error")) { - c->warning(__tr2qs_ctx("Perl execution error:","perl")); + c->warning(__tr2qs_ctx("Perl execution error:", "perl")); c->warning(ex.szError); return false; - } else { - c->warning(__tr2qs_ctx("Perl execution error:","perl")); + } + else + { + c->warning(__tr2qs_ctx("Perl execution error:", "perl")); c->error(ex.szError); } } } - if(!c->switches()->find('n',"no-return")) + if(!c->switches()->find('n', "no-return")) c->context()->returnValue()->setString(ex.szRetVal); #endif //COMPILE_PERL_SUPPORT @@ -512,20 +514,20 @@ static bool perl_kvs_cmd_destroy(KviKvsModuleCommandCall * c) { QString szContext; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("context",KVS_PT_NONEMPTYSTRING,0,szContext) + KVSM_PARAMETER("context", KVS_PT_NONEMPTYSTRING, 0, szContext) KVSM_PARAMETERS_END(c) - KVS_CHECK_MODULE_STATE(m,c) + KVS_CHECK_MODULE_STATE(m, c) #ifdef COMPILE_PERL_SUPPORT KviPerlCoreCtrlCommand_destroy ex; ex.uSize = sizeof(KviPerlCoreCtrlCommand_destroy); ex.szContext = szContext; - if(!g_pPerlCoreModule->ctrl(KVI_PERLCORECTRLCOMMAND_DESTROY,&ex)) + if(!g_pPerlCoreModule->ctrl(KVI_PERLCORECTRLCOMMAND_DESTROY, &ex)) { - if(!c->switches()->find('q',"quiet")) - c->warning(__tr2qs_ctx("The perlcore module failed to execute the code: something is wrong with the Perl support","perl")); + if(!c->switches()->find('q', "quiet")) + c->warning(__tr2qs_ctx("The perlcore module failed to execute the code: something is wrong with the Perl support", "perl")); } #endif //COMPILE_PERL_SUPPORT @@ -551,7 +553,7 @@ static bool perl_kvs_fnc_isAvailable(KviKvsModuleFunctionCall * c) #ifdef COMPILE_PERL_SUPPORT g_pPerlCoreModule = g_pModuleManager->getModule("perlcore"); c->returnValue()->setBoolean(g_pPerlCoreModule ? true : false); -#else // COMPILE_PERL_SUPPORT +#else // COMPILE_PERL_SUPPORT c->returnValue()->setBoolean(false); #endif // COMPILE_PERL_SUPPORT return true; @@ -560,12 +562,12 @@ static bool perl_kvs_fnc_isAvailable(KviKvsModuleFunctionCall * c) static bool perl_module_init(KviModule * m) { // register the command anyway - KVSM_REGISTER_SIMPLE_COMMAND(m,"begin",perl_kvs_cmd_begin); - KVSM_REGISTER_SIMPLE_COMMAND(m,"destroy",perl_kvs_cmd_destroy); + KVSM_REGISTER_SIMPLE_COMMAND(m, "begin", perl_kvs_cmd_begin); + KVSM_REGISTER_SIMPLE_COMMAND(m, "destroy", perl_kvs_cmd_destroy); - KVSM_REGISTER_FUNCTION(m,"isAvailable",perl_kvs_fnc_isAvailable); + KVSM_REGISTER_FUNCTION(m, "isAvailable", perl_kvs_fnc_isAvailable); - // FIXME: perl.isSupported() +// FIXME: perl.isSupported() #ifdef COMPILE_PERL_SUPPORT g_pPerlCoreModule = g_pModuleManager->getModule("perlcore"); #endif // COMPILE_PERL_SUPPORT @@ -578,13 +580,12 @@ static bool perl_module_cleanup(KviModule *) } KVIRC_MODULE( - "Perl", // module name - "4.0.0", // module version - "Copyright (C) 2004 Szymon Stefanek (pragma at kvirc dot net)", // author & (C) - "Perl scripting engine", - perl_module_init, - 0, - 0, - perl_module_cleanup, - "perl" -) + "Perl", // module name + "4.0.0", // module version + "Copyright (C) 2004 Szymon Stefanek (pragma at kvirc dot net)", // author & (C) + "Perl scripting engine", + perl_module_init, + 0, + 0, + perl_module_cleanup, + "perl") diff --git a/src/modules/perlcore/libkviperlcore.cpp b/src/modules/perlcore/libkviperlcore.cpp index ee591e0b5..5b84aa7f3 100644 --- a/src/modules/perlcore/libkviperlcore.cpp +++ b/src/modules/perlcore/libkviperlcore.cpp @@ -36,7 +36,7 @@ #include #ifdef DEBUG - #undef DEBUG +#undef DEBUG #endif // I MUST say that the perl embedding process is somewhat ugly :( @@ -64,33 +64,33 @@ // This version should work nice with both, but warranty is 5.10-only. #ifdef COMPILE_PERL_SUPPORT - #include - #include - #include +#include +#include +#include - #define NEED_eval_pv - #include "ppport.h" +#define NEED_eval_pv +#include "ppport.h" - #include "KviKvsRunTimeContext.h" +#include "KviKvsRunTimeContext.h" - static KviKvsRunTimeContext * g_pCurrentKvsContext = 0; - static bool g_bExecuteQuiet = false; - static KviCString g_szLastReturnValue(""); - static QStringList g_lWarningList; +static KviKvsRunTimeContext * g_pCurrentKvsContext = 0; +static bool g_bExecuteQuiet = false; +static KviCString g_szLastReturnValue(""); +static QStringList g_lWarningList; - // this is why we can't have nice things -- part of perl 5.17.1+ - #ifdef __cplusplus - #define dNOOP (void)0 - #else - #define dNOOP extern int Perl___notused(void) - #endif +// this is why we can't have nice things -- part of perl 5.17.1+ +#ifdef __cplusplus +#define dNOOP (void)0 +#else +#define dNOOP extern int Perl___notused(void) +#endif - #include "xs.inc" +#include "xs.inc" #endif // COMPILE_PERL_SUPPORT // perl redefines bool :/// #ifdef bool - #undef bool +#undef bool #endif #ifdef COMPILE_PERL_SUPPORT @@ -106,21 +106,23 @@ class KviPerlInterpreter { public: - KviPerlInterpreter(const QString &szContextName); + KviPerlInterpreter(const QString & szContextName); ~KviPerlInterpreter(); + protected: - QString m_szContextName; + QString m_szContextName; PerlInterpreter * m_pInterpreter; + public: bool init(); // if this fails then well.. :D void done(); - bool execute(const QString &szCode,QStringList &args,QString &szRetVal,QString &szError,QStringList &lWarnings); + bool execute(const QString & szCode, QStringList & args, QString & szRetVal, QString & szError, QStringList & lWarnings); const QString & contextName() const { return m_szContextName; }; protected: QString svToQString(SV * sv); }; -KviPerlInterpreter::KviPerlInterpreter(const QString &szContextName) +KviPerlInterpreter::KviPerlInterpreter(const QString & szContextName) { m_szContextName = szContextName; m_pInterpreter = 0; @@ -139,13 +141,13 @@ KviPerlInterpreter::~KviPerlInterpreter() // Update: it is no more needed as of perl 5.10, since it is // included in the standard libperl interface. -extern "C" void boot_DynaLoader(pTHX_ CV* cv); +extern "C" void boot_DynaLoader(pTHX_ CV * cv); extern "C" void xs_init(pTHX) { char * file = (char *)__FILE__; // boot up the DynaLoader - newXS("DynaLoader::boot_DynaLoader",boot_DynaLoader,file); + newXS("DynaLoader::boot_DynaLoader", boot_DynaLoader, file); // now bootstrap the KVIrc module // This stuff is simply cutted and pasted from xs.inc // since I don't really know if it's safe to call @@ -166,14 +168,16 @@ extern "C" void xs_init(pTHX) bool KviPerlInterpreter::init() { - if(m_pInterpreter)done(); + if(m_pInterpreter) + done(); const char * daArgs[] = { "yo", "-e", "0", "-w" }; m_pInterpreter = perl_alloc(); - if(!m_pInterpreter)return false; + if(!m_pInterpreter) + return false; PERL_SET_CONTEXT(m_pInterpreter); PL_perl_destruct_level = 1; perl_construct(m_pInterpreter); - perl_parse(m_pInterpreter,xs_init,4,(char **)daArgs,NULL); + perl_parse(m_pInterpreter, xs_init, 4, (char **)daArgs, NULL); QString szInitCode; // this part of the code seems to be unnecessary @@ -188,29 +192,31 @@ bool KviPerlInterpreter::init() // I just haven't tried :D szInitCode = QString( - "{\n" \ - "package KVIrc;\n" \ - "require Exporter;\n" \ - "our @ISA = qw(Exporter);\n" \ - "1;\n" \ - "}\n" \ - "$g_szContext = \"%1\";\n" \ - "$g_bExecuteQuiet = 0;\n" \ - "$SIG{__WARN__} = sub\n" \ - "{\n" \ - " my($p,$f,$l,$x);\n" \ - " ($p,$f,$l) = caller;\n" \ - " KVIrc::internalWarning(\"At line \".$l.\" of Perl code: \");\n" \ - " KVIrc::internalWarning(join(' ',@_));\n" \ - "}\n").arg(m_szContextName); - - eval_pv(szInitCode.toUtf8().data(),false); + "{\n" + "package KVIrc;\n" + "require Exporter;\n" + "our @ISA = qw(Exporter);\n" + "1;\n" + "}\n" + "$g_szContext = \"%1\";\n" + "$g_bExecuteQuiet = 0;\n" + "$SIG{__WARN__} = sub\n" + "{\n" + " my($p,$f,$l,$x);\n" + " ($p,$f,$l) = caller;\n" + " KVIrc::internalWarning(\"At line \".$l.\" of Perl code: \");\n" + " KVIrc::internalWarning(join(' ',@_));\n" + "}\n") + .arg(m_szContextName); + + eval_pv(szInitCode.toUtf8().data(), false); return true; } void KviPerlInterpreter::done() { - if(!m_pInterpreter)return; + if(!m_pInterpreter) + return; PERL_SET_CONTEXT(m_pInterpreter); PL_perl_destruct_level = 1; perl_destruct(m_pInterpreter); @@ -221,23 +227,25 @@ void KviPerlInterpreter::done() QString KviPerlInterpreter::svToQString(SV * sv) { QString ret = ""; - if(!sv)return ret; + if(!sv) + return ret; STRLEN len; - char * ptr = SvPV(sv,len); - if(ptr)ret = ptr; + char * ptr = SvPV(sv, len); + if(ptr) + ret = ptr; return ret; } bool KviPerlInterpreter::execute( - const QString &szCode, - QStringList &args, - QString &szRetVal, - QString &szError, - QStringList &lWarnings) + const QString & szCode, + QStringList & args, + QString & szRetVal, + QString & szError, + QStringList & lWarnings) { if(!m_pInterpreter) { - szError = __tr2qs_ctx("Internal error: Perl interpreter not initialized","perl"); + szError = __tr2qs_ctx("Internal error: Perl interpreter not initialized", "perl"); return false; } @@ -247,7 +255,7 @@ bool KviPerlInterpreter::execute( PERL_SET_CONTEXT(m_pInterpreter); // clear the _ array - AV * pArgs = get_av("_",1); + AV * pArgs = get_av("_", 1); SV * pArg = av_shift(pArgs); while(SvOK(pArg)) { @@ -258,16 +266,16 @@ bool KviPerlInterpreter::execute( if(args.count() > 0) { // set the args in the _ arry - av_unshift(pArgs,(I32)args.count()); + av_unshift(pArgs, (I32)args.count()); int idx = 0; - for(QStringList::Iterator it = args.begin();it != args.end();++it) + for(QStringList::Iterator it = args.begin(); it != args.end(); ++it) { QString tmp = *it; const char * val = tmp.toUtf8().data(); if(val) { - pArg = newSVpv(val,tmp.length()); - if(!av_store(pArgs,idx,pArg)) + pArg = newSVpv(val, tmp.length()); + if(!av_store(pArgs, idx, pArg)) SvREFCNT_dec(pArg); } idx++; @@ -275,10 +283,10 @@ bool KviPerlInterpreter::execute( } // call the code - SV * pRet = eval_pv(szUtf8.data(),false); + SV * pRet = eval_pv(szUtf8.data(), false); // clear the _ array again - pArgs = get_av("_",1); + pArgs = get_av("_", 1); pArg = av_shift(pArgs); while(SvOK(pArg)) { @@ -298,39 +306,42 @@ bool KviPerlInterpreter::execute( lWarnings = g_lWarningList; // and the eventual error string - pRet = get_sv("@",false); + pRet = get_sv("@", false); if(pRet) { if(SvOK(pRet)) { szError = svToQString(pRet); - if(!szError.isEmpty())return false; + if(!szError.isEmpty()) + return false; } } return true; } -static KviPointerHashTable * g_pInterpreters = 0; +static KviPointerHashTable * g_pInterpreters = 0; -static KviPerlInterpreter * perlcore_get_interpreter(const QString &szContextName) +static KviPerlInterpreter * perlcore_get_interpreter(const QString & szContextName) { KviPerlInterpreter * i = g_pInterpreters->find(szContextName); - if(i)return i; + if(i) + return i; i = new KviPerlInterpreter(szContextName); if(!i->init()) { delete i; return 0; } - g_pInterpreters->replace(szContextName,i); + g_pInterpreters->replace(szContextName, i); return i; } -static void perlcore_destroy_interpreter(const QString &szContextName) +static void perlcore_destroy_interpreter(const QString & szContextName) { KviPerlInterpreter * i = g_pInterpreters->find(szContextName); - if(!i)return; + if(!i) + return; g_pInterpreters->remove(szContextName); i->done(); delete i; @@ -338,7 +349,7 @@ static void perlcore_destroy_interpreter(const QString &szContextName) static void perlcore_destroy_all_interpreters() { - KviPointerHashTableIterator it(*g_pInterpreters); + KviPointerHashTableIterator it(*g_pInterpreters); while(it.current()) { @@ -352,13 +363,14 @@ static void perlcore_destroy_all_interpreters() #endif // COMPILE_PERL_SUPPORT -static bool perlcore_module_ctrl(KviModule *,const char * cmd,void * param) +static bool perlcore_module_ctrl(KviModule *, const char * cmd, void * param) { #ifdef COMPILE_PERL_SUPPORT - if(kvi_strEqualCS(cmd,KVI_PERLCORECTRLCOMMAND_EXECUTE)) + if(kvi_strEqualCS(cmd, KVI_PERLCORECTRLCOMMAND_EXECUTE)) { KviPerlCoreCtrlCommand_execute * ex = (KviPerlCoreCtrlCommand_execute *)param; - if(ex->uSize != sizeof(KviPerlCoreCtrlCommand_execute))return false; + if(ex->uSize != sizeof(KviPerlCoreCtrlCommand_execute)) + return false; g_pCurrentKvsContext = ex->pKvsContext; g_bExecuteQuiet = ex->bQuiet; if(ex->szContext.isEmpty()) @@ -369,19 +381,22 @@ static bool perlcore_module_ctrl(KviModule *,const char * cmd,void * param) delete m; return false; } - ex->bExitOk = m->execute(ex->szCode,ex->lArgs,ex->szRetVal,ex->szError,ex->lWarnings); + ex->bExitOk = m->execute(ex->szCode, ex->lArgs, ex->szRetVal, ex->szError, ex->lWarnings); m->done(); delete m; - } else { + } + else + { KviPerlInterpreter * m = perlcore_get_interpreter(ex->szContext); - ex->bExitOk = m->execute(ex->szCode,ex->lArgs,ex->szRetVal,ex->szError,ex->lWarnings); + ex->bExitOk = m->execute(ex->szCode, ex->lArgs, ex->szRetVal, ex->szError, ex->lWarnings); } return true; } - if(kvi_strEqualCS(cmd,KVI_PERLCORECTRLCOMMAND_DESTROY)) + if(kvi_strEqualCS(cmd, KVI_PERLCORECTRLCOMMAND_DESTROY)) { KviPerlCoreCtrlCommand_destroy * de = (KviPerlCoreCtrlCommand_destroy *)param; - if(de->uSize != sizeof(KviPerlCoreCtrlCommand_destroy))return false; + if(de->uSize != sizeof(KviPerlCoreCtrlCommand_destroy)) + return false; perlcore_destroy_interpreter(de->szContext); return true; } @@ -392,14 +407,14 @@ static bool perlcore_module_ctrl(KviModule *,const char * cmd,void * param) static bool perlcore_module_init(KviModule *) { #ifdef COMPILE_PERL_SUPPORT - g_pInterpreters = new KviPointerHashTable(17,false); + g_pInterpreters = new KviPointerHashTable(17, false); g_pInterpreters->setAutoDelete(false); int daArgc = 4; const char * daArgs[] = { "yo", "-e", "0", "-w" }; - char ** daEnv=NULL; - PERL_SYS_INIT3(&daArgc,(char ***)&daArgs,&daEnv); + char ** daEnv = NULL; + PERL_SYS_INIT3(&daArgc, (char ***)&daArgs, &daEnv); return true; -#else // !COMPILE_PERL_SUPPORT +#else // !COMPILE_PERL_SUPPORT return false; #endif // !COMPILE_PERL_SUPPORT } @@ -410,7 +425,7 @@ static bool perlcore_module_cleanup(KviModule *) perlcore_destroy_all_interpreters(); delete g_pInterpreters; g_pInterpreters = 0; - // ifdef workaround for #842 +// ifdef workaround for #842 #ifndef COMPILE_ON_MAC PERL_SYS_TERM(); #endif @@ -427,13 +442,12 @@ static bool perlcore_module_can_unload(KviModule *) } KVIRC_MODULE( - "PerlCore", // module name - "4.0.0", // module version - "Copyright (C) 2008 Szymon Stefanek (pragma at kvirc dot net)", // author & (C) - "Perl scripting engine core", - perlcore_module_init, - perlcore_module_can_unload, - perlcore_module_ctrl, - perlcore_module_cleanup, - "perl" -) + "PerlCore", // module name + "4.0.0", // module version + "Copyright (C) 2008 Szymon Stefanek (pragma at kvirc dot net)", // author & (C) + "Perl scripting engine core", + perlcore_module_init, + perlcore_module_can_unload, + perlcore_module_ctrl, + perlcore_module_cleanup, + "perl") diff --git a/src/modules/perlcore/perlcoreinterface.h b/src/modules/perlcore/perlcoreinterface.h index e0f63e5b6..9fae7fb5a 100644 --- a/src/modules/perlcore/perlcoreinterface.h +++ b/src/modules/perlcore/perlcoreinterface.h @@ -31,21 +31,20 @@ #include - #define KVI_PERLCORECTRLCOMMAND_EXECUTE "execute" typedef struct _KviPerlCoreCtrlCommand_execute { - unsigned int uSize; + unsigned int uSize; KviKvsRunTimeContext * pKvsContext; - QString szContext; - QString szCode; - bool bExitOk; - QString szRetVal; - QString szError; - QStringList lWarnings; - QStringList lArgs; - bool bQuiet; + QString szContext; + QString szCode; + bool bExitOk; + QString szRetVal; + QString szError; + QStringList lWarnings; + QStringList lArgs; + bool bQuiet; } KviPerlCoreCtrlCommand_execute; #define KVI_PERLCORECTRLCOMMAND_DESTROY "destroy" @@ -53,7 +52,7 @@ typedef struct _KviPerlCoreCtrlCommand_execute typedef struct _KviPerlCoreCtrlCommand_destroy { unsigned int uSize; - QString szContext; + QString szContext; } KviPerlCoreCtrlCommand_destroy; #endif // !_PERLCOREINTERFACE_H_ diff --git a/src/modules/perlcore/ppport.h b/src/modules/perlcore/ppport.h index f0f9d6c4a..187afa347 100644 --- a/src/modules/perlcore/ppport.h +++ b/src/modules/perlcore/ppport.h @@ -47,7 +47,7 @@ __DATA__*/ #ifndef DPPP_NAMESPACE #define DPPP_NAMESPACE DPPP_ #endif -#define DPPP_CAT2(x,y) CAT2(x,y) +#define DPPP_CAT2(x, y) CAT2(x, y) #define DPPP_(name) DPPP_CAT2(DPPP_NAMESPACE, name) #ifndef PERL_REVISION #if !defined(__PATCHLEVEL_H_INCLUDED__) && !(defined(PATCHLEVEL) && defined(SUBVERSION)) @@ -63,8 +63,8 @@ __DATA__*/ #define PERL_SUBVERSION SUBVERSION #endif #endif -#define _dpppDEC2BCD(dec) ((((dec)/100)<<8)|((((dec)%100)/10)<<4)|((dec)%10)) -#define PERL_BCDVERSION ((_dpppDEC2BCD(PERL_REVISION)<<24)|(_dpppDEC2BCD(PERL_VERSION)<<12)|_dpppDEC2BCD(PERL_SUBVERSION)) +#define _dpppDEC2BCD(dec) ((((dec) / 100) << 8) | ((((dec) % 100) / 10) << 4) | ((dec) % 10)) +#define PERL_BCDVERSION ((_dpppDEC2BCD(PERL_REVISION) << 24) | (_dpppDEC2BCD(PERL_VERSION) << 12) | _dpppDEC2BCD(PERL_SUBVERSION)) #if PERL_REVISION != 5 #error ppport.h only works with Perl version 5 #endif @@ -89,7 +89,7 @@ __DATA__*/ #ifndef aTHX_ #define aTHX_ #endif -#if (PERL_BCDVERSION < 0x5006000) +#if(PERL_BCDVERSION < 0x5006000) #ifdef USE_THREADS #define aTHXR thr #define aTHXR_ thr, @@ -151,7 +151,7 @@ __DATA__*/ #ifdef SHRT_MAX #define PERL_SHORT_MAX ((short)SHRT_MAX) #else -#define PERL_SHORT_MAX ((short) (PERL_USHORT_MAX >> 1)) +#define PERL_SHORT_MAX ((short)(PERL_USHORT_MAX >> 1)) #endif #endif #endif @@ -228,7 +228,7 @@ __DATA__*/ #ifdef MAXLONG #define PERL_LONG_MAX ((long)MAXLONG) #else -#define PERL_LONG_MAX ((long) (PERL_ULONG_MAX >> 1)) +#define PERL_LONG_MAX ((long)(PERL_ULONG_MAX >> 1)) #endif #endif #endif @@ -265,7 +265,7 @@ __DATA__*/ #ifdef MAXLONGLONG #define PERL_QUAD_MAX ((long long)MAXLONGLONG) #else -#define PERL_QUAD_MAX ((long long) (PERL_UQUAD_MAX >> 1)) +#define PERL_QUAD_MAX ((long long)(PERL_UQUAD_MAX >> 1)) #endif #endif #endif @@ -400,20 +400,22 @@ __DATA__*/ #define UVSIZE IVSIZE #endif #ifndef sv_setuv -#define sv_setuv(sv, uv) \ -STMT_START { \ -UV TeMpUv = uv; \ -if (TeMpUv <= IV_MAX) \ -sv_setiv(sv, TeMpUv); \ -else \ -sv_setnv(sv, (double)TeMpUv); \ -} STMT_END +#define sv_setuv(sv, uv) \ + STMT_START \ + { \ + UV TeMpUv = uv; \ + if(TeMpUv <= IV_MAX) \ + sv_setiv(sv, TeMpUv); \ + else \ + sv_setnv(sv, (double)TeMpUv); \ + } \ + STMT_END #endif #ifndef newSVuv #define newSVuv(uv) ((uv) <= IV_MAX ? newSViv((IV)uv) : newSVnv((NV)uv)) #endif #ifndef sv_2uv -#define sv_2uv(sv) ((PL_Sv = (sv)), (UV) (SvNOK(PL_Sv) ? SvNV(PL_Sv) : sv_2nv(PL_Sv))) +#define sv_2uv(sv) ((PL_Sv = (sv)), (UV)(SvNOK(PL_Sv) ? SvNV(PL_Sv) : sv_2nv(PL_Sv))) #endif #ifndef SvUVX #define SvUVX(sv) ((UV)SvIVX(sv)) @@ -434,78 +436,96 @@ sv_setnv(sv, (double)TeMpUv); \ #define SvUOK(sv) SvIOK_UV(sv) #endif #ifndef XST_mUV -#define XST_mUV(i,v) (ST(i) = sv_2mortal(newSVuv(v)) ) +#define XST_mUV(i, v) (ST(i) = sv_2mortal(newSVuv(v))) #endif #ifndef XSRETURN_UV -#define XSRETURN_UV(v) STMT_START { XST_mUV(0,v); XSRETURN(1); } STMT_END +#define XSRETURN_UV(v) \ + STMT_START \ + { \ + XST_mUV(0, v); \ + XSRETURN(1); \ + } \ + STMT_END #endif #ifndef PUSHu -#define PUSHu(u) STMT_START { sv_setuv(TARG, (UV)(u)); PUSHTARG; } STMT_END +#define PUSHu(u) \ + STMT_START \ + { \ + sv_setuv(TARG, (UV)(u)); \ + PUSHTARG; \ + } \ + STMT_END #endif #ifndef XPUSHu -#define XPUSHu(u) STMT_START { sv_setuv(TARG, (UV)(u)); XPUSHTARG; } STMT_END +#define XPUSHu(u) \ + STMT_START \ + { \ + sv_setuv(TARG, (UV)(u)); \ + XPUSHTARG; \ + } \ + STMT_END #endif #ifdef HAS_MEMCMP #ifndef memNE -#define memNE(s1,s2,l) (memcmp(s1,s2,l)) +#define memNE(s1, s2, l) (memcmp(s1, s2, l)) #endif #ifndef memEQ -#define memEQ(s1,s2,l) (!memcmp(s1,s2,l)) +#define memEQ(s1, s2, l) (!memcmp(s1, s2, l)) #endif #else #ifndef memNE -#define memNE(s1,s2,l) (bcmp(s1,s2,l)) +#define memNE(s1, s2, l) (bcmp(s1, s2, l)) #endif #ifndef memEQ -#define memEQ(s1,s2,l) (!bcmp(s1,s2,l)) +#define memEQ(s1, s2, l) (!bcmp(s1, s2, l)) #endif #endif #ifndef memEQs #define memEQs(s1, l, s2) \ -(sizeof(s2)-1 == l && memEQ(s1, (s2 ""), (sizeof(s2)-1))) + (sizeof(s2) - 1 == l && memEQ(s1, (s2 ""), (sizeof(s2) - 1))) #endif #ifndef memNEs #define memNEs(s1, l, s2) !memEQs(s1, l, s2) #endif #ifndef MoveD -#define MoveD(s,d,n,t) memmove((char*)(d),(char*)(s), (n) * sizeof(t)) +#define MoveD(s, d, n, t) memmove((char *)(d), (char *)(s), (n) * sizeof(t)) #endif #ifndef CopyD -#define CopyD(s,d,n,t) memcpy((char*)(d),(char*)(s), (n) * sizeof(t)) +#define CopyD(s, d, n, t) memcpy((char *)(d), (char *)(s), (n) * sizeof(t)) #endif #ifdef HAS_MEMSET #ifndef ZeroD -#define ZeroD(d,n,t) memzero((char*)(d), (n) * sizeof(t)) +#define ZeroD(d, n, t) memzero((char *)(d), (n) * sizeof(t)) #endif #else #ifndef ZeroD -#define ZeroD(d,n,t) ((void)memzero((char*)(d), (n) * sizeof(t)), d) +#define ZeroD(d, n, t) ((void)memzero((char *)(d), (n) * sizeof(t)), d) #endif #endif #ifndef PoisonWith -#define PoisonWith(d,n,t,b) (void)memset((char*)(d), (U8)(b), (n) * sizeof(t)) +#define PoisonWith(d, n, t, b) (void) memset((char *)(d), (U8)(b), (n) * sizeof(t)) #endif #ifndef PoisonNew -#define PoisonNew(d,n,t) PoisonWith(d,n,t,0xAB) +#define PoisonNew(d, n, t) PoisonWith(d, n, t, 0xAB) #endif #ifndef PoisonFree -#define PoisonFree(d,n,t) PoisonWith(d,n,t,0xEF) +#define PoisonFree(d, n, t) PoisonWith(d, n, t, 0xEF) #endif #ifndef Poison -#define Poison(d,n,t) PoisonFree(d,n,t) +#define Poison(d, n, t) PoisonFree(d, n, t) #endif #ifndef Newx -#define Newx(v,n,t) New(0,v,n,t) +#define Newx(v, n, t) New(0, v, n, t) #endif #ifndef Newxc -#define Newxc(v,n,t,c) Newc(0,v,n,t,c) +#define Newxc(v, n, t, c) Newc(0, v, n, t, c) #endif #ifndef Newxz -#define Newxz(v,n,t) Newz(0,v,n,t) +#define Newxz(v, n, t) Newz(0, v, n, t) #endif #ifndef PERL_UNUSED_DECL #ifdef HASATTRIBUTE -#if (defined(__GNUC__) && defined(__cplusplus)) || defined(__INTEL_COMPILER) +#if(defined(__GNUC__) && defined(__cplusplus)) || defined(__INTEL_COMPILER) #define PERL_UNUSED_DECL #else #define PERL_UNUSED_DECL __attribute__((unused)) @@ -536,7 +556,7 @@ sv_setnv(sv, (double)TeMpUv); \ #define NOOP (void)0 #endif #ifndef dNOOP -#define dNOOP extern int Perl___notused PERL_UNUSED_DECL +#define dNOOP extern int Perl___notused PERL_UNUSED_DECL #endif #ifndef NVTYPE #if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE) @@ -547,39 +567,39 @@ sv_setnv(sv, (double)TeMpUv); \ typedef NVTYPE NV; #endif #ifndef INT2PTR -#if (IVSIZE == PTRSIZE) && (UVSIZE == PTRSIZE) +#if(IVSIZE == PTRSIZE) && (UVSIZE == PTRSIZE) #define PTRV UV -#define INT2PTR(any,d) (any)(d) +#define INT2PTR(any, d) (any)(d) #else #if PTRSIZE == LONGSIZE #define PTRV unsigned long #else #define PTRV unsigned #endif -#define INT2PTR(any,d) (any)(PTRV)(d) +#define INT2PTR(any, d) (any)(PTRV)(d) #endif #endif #ifndef PTR2ul #if PTRSIZE == LONGSIZE #define PTR2ul(p) (unsigned long)(p) #else -#define PTR2ul(p) INT2PTR(unsigned long,p) +#define PTR2ul(p) INT2PTR(unsigned long, p) #endif #endif #ifndef PTR2nat #define PTR2nat(p) (PTRV)(p) #endif #ifndef NUM2PTR -#define NUM2PTR(any,d) (any)PTR2nat(d) +#define NUM2PTR(any, d) (any) PTR2nat(d) #endif #ifndef PTR2IV -#define PTR2IV(p) INT2PTR(IV,p) +#define PTR2IV(p) INT2PTR(IV, p) #endif #ifndef PTR2UV -#define PTR2UV(p) INT2PTR(UV,p) +#define PTR2UV(p) INT2PTR(UV, p) #endif #ifndef PTR2NV -#define PTR2NV(p) NUM2PTR(NV,p) +#define PTR2NV(p) NUM2PTR(NV, p) #endif #undef START_EXTERN_C #undef END_EXTERN_C @@ -610,11 +630,11 @@ typedef NVTYPE NV; #define STMT_END ) #else #if defined(VOIDFLAGS) && (VOIDFLAGS) && (defined(sun) || defined(__sun__)) && !defined(__GNUC__) -#define STMT_START if (1) -#define STMT_END else (void)0 +#define STMT_START if(1) +#define STMT_END else(void)0 #else #define STMT_START do -#define STMT_END while (0) +#define STMT_END while(0) #endif #endif #ifndef boolSV @@ -633,10 +653,10 @@ typedef NVTYPE NV; #define AvFILLp AvFILL #endif #ifndef ERRSV -#define ERRSV get_sv("@",FALSE) +#define ERRSV get_sv("@", FALSE) #endif #ifndef gv_stashpvn -#define gv_stashpvn(str,len,create) gv_stashpv(str,create) +#define gv_stashpvn(str, len, create) gv_stashpv(str, create) #endif #ifndef get_cv #define get_cv perl_get_cv @@ -666,25 +686,28 @@ typedef NVTYPE NV; #define dXSTARG SV * targ = sv_newmortal() #endif #ifndef dAXMARK -#define dAXMARK I32 ax = POPMARK; \ -register SV ** const mark = PL_stack_base + ax++ +#define dAXMARK \ + I32 ax = POPMARK; \ + register SV ** const mark = PL_stack_base + ax++ #endif #ifndef XSprePUSH #define XSprePUSH (sp = PL_stack_base + ax - 1) #endif -#if (PERL_BCDVERSION < 0x5005000) +#if(PERL_BCDVERSION < 0x5005000) #undef XSRETURN -#define XSRETURN(off) \ -STMT_START { \ -PL_stack_sp = PL_stack_base + ax + ((off) - 1); \ -return; \ -} STMT_END +#define XSRETURN(off) \ + STMT_START \ + { \ + PL_stack_sp = PL_stack_base + ax + ((off)-1); \ + return; \ + } \ + STMT_END #endif #ifndef XSPROTO -#define XSPROTO(name) void name(pTHX_ CV* cv) +#define XSPROTO(name) void name(pTHX_ CV * cv) #endif #ifndef SVfARG -#define SVfARG(p) ((void*)(p)) +#define SVfARG(p) ((void *)(p)) #endif #ifndef PERL_ABS #define PERL_ABS(x) ((x) < 0 ? -(x) : (x)) @@ -702,32 +725,34 @@ return; \ #define CPERLscope(x) x #endif #ifndef PERL_HASH -#define PERL_HASH(hash,str,len) \ -STMT_START { \ -const char *s_PeRlHaSh = str; \ -I32 i_PeRlHaSh = len; \ -U32 hash_PeRlHaSh = 0; \ -while (i_PeRlHaSh--) \ -hash_PeRlHaSh = hash_PeRlHaSh * 33 + *s_PeRlHaSh++; \ -(hash) = hash_PeRlHaSh; \ -} STMT_END +#define PERL_HASH(hash, str, len) \ + STMT_START \ + { \ + const char * s_PeRlHaSh = str; \ + I32 i_PeRlHaSh = len; \ + U32 hash_PeRlHaSh = 0; \ + while(i_PeRlHaSh--) \ + hash_PeRlHaSh = hash_PeRlHaSh * 33 + *s_PeRlHaSh++; \ + (hash) = hash_PeRlHaSh; \ + } \ + STMT_END #endif #ifndef PERLIO_FUNCS_DECL #ifdef PERLIO_FUNCS_CONST #define PERLIO_FUNCS_DECL(funcs) const PerlIO_funcs funcs -#define PERLIO_FUNCS_CAST(funcs) (PerlIO_funcs*)(funcs) +#define PERLIO_FUNCS_CAST(funcs) (PerlIO_funcs *)(funcs) #else #define PERLIO_FUNCS_DECL(funcs) PerlIO_funcs funcs #define PERLIO_FUNCS_CAST(funcs) (funcs) #endif #endif -#if (PERL_BCDVERSION < 0x5009003) +#if(PERL_BCDVERSION < 0x5009003) #ifdef ARGSproto -typedef OP* (CPERLscope(*Perl_ppaddr_t))(ARGSproto); +typedef OP *(CPERLscope(*Perl_ppaddr_t))(ARGSproto); #else -typedef OP* (CPERLscope(*Perl_ppaddr_t))(pTHX); +typedef OP *(CPERLscope(*Perl_ppaddr_t))(pTHX); #endif -typedef OP* (CPERLscope(*Perl_check_t)) (pTHX_ OP*); +typedef OP *(CPERLscope(*Perl_check_t))(pTHX_ OP *); #endif #ifndef isPSXSPC #define isPSXSPC(c) (isSPACE(c) || (c) == '\v') @@ -758,7 +783,7 @@ typedef OP* (CPERLscope(*Perl_check_t)) (pTHX_ OP*); #define isXDIGIT(c) isxdigit(c) #endif #else -#if (PERL_BCDVERSION < 0x5010000) +#if(PERL_BCDVERSION < 0x5010000) #undef isPRINT #endif #ifdef HAS_QUAD @@ -774,10 +799,10 @@ typedef OP* (CPERLscope(*Perl_check_t)) (pTHX_ OP*); #define isALNUMC(c) (isALPHA(c) || isDIGIT(c)) #endif #ifndef isASCII -#define isASCII(c) ((WIDEST_UTYPE) (c) <= 127) +#define isASCII(c) ((WIDEST_UTYPE)(c) <= 127) #endif #ifndef isCNTRL -#define isCNTRL(c) ((WIDEST_UTYPE) (c) < ' ' || (c) == 127) +#define isCNTRL(c) ((WIDEST_UTYPE)(c) < ' ' || (c) == 127) #endif #ifndef isGRAPH #define isGRAPH(c) (isALNUM(c) || isPUNCT(c)) @@ -792,16 +817,14 @@ typedef OP* (CPERLscope(*Perl_check_t)) (pTHX_ OP*); #define isXDIGIT(c) (isDIGIT(c) || ((c) >= 'a' && (c) <= 'f') || ((c) >= 'A' && (c) <= 'F')) #endif #endif -#if (PERL_BCDVERSION >= 0x5008000) +#if(PERL_BCDVERSION >= 0x5008000) #ifndef HeUTF8 -#define HeUTF8(he) ((HeKLEN(he) == HEf_SVKEY) ? \ -SvUTF8(HeKEY_sv(he)) : \ -(U32)HeKUTF8(he)) +#define HeUTF8(he) ((HeKLEN(he) == HEf_SVKEY) ? SvUTF8(HeKEY_sv(he)) : (U32)HeKUTF8(he)) #endif #endif #ifndef PERL_SIGNALS_UNSAFE_FLAG #define PERL_SIGNALS_UNSAFE_FLAG 0x0001 -#if (PERL_BCDVERSION < 0x5008000) +#if(PERL_BCDVERSION < 0x5008000) #define D_PPP_PERL_SIGNALS_INIT PERL_SIGNALS_UNSAFE_FLAG #else #define D_PPP_PERL_SIGNALS_INIT 0 @@ -815,11 +838,11 @@ extern U32 DPPP_(my_PL_signals); #endif #define PL_signals DPPP_(my_PL_signals) #endif -#if (PERL_BCDVERSION <= 0x5005005) +#if(PERL_BCDVERSION <= 0x5005005) #define PL_ppaddr ppaddr #define PL_no_modify no_modify #endif -#if (PERL_BCDVERSION <= 0x5004005) +#if(PERL_BCDVERSION <= 0x5004005) #define PL_DBsignal DBsignal #define PL_DBsingle DBsingle #define PL_DBsub DBsub @@ -863,20 +886,20 @@ extern U32 DPPP_(my_PL_signals); #define PL_tainting tainting #define PL_tokenbuf tokenbuf #endif -#if (PERL_BCDVERSION >= 0x5009005) +#if(PERL_BCDVERSION >= 0x5009005) #ifdef DPPP_PL_parser_NO_DUMMY -#define D_PPP_my_PL_parser_var(var) ((PL_parser ? PL_parser : \ -(croak("panic: PL_parser == NULL in %s:%d", \ -__FILE__, __LINE__), (yy_parser *) NULL))->var) +#define D_PPP_my_PL_parser_var(var) ((PL_parser ? PL_parser : (croak("panic: PL_parser == NULL in %s:%d", \ + __FILE__, __LINE__), \ + (yy_parser *)NULL)) \ + ->var) #else #ifdef DPPP_PL_parser_NO_DUMMY_WARNING #define D_PPP_parser_dummy_warning(var) #else #define D_PPP_parser_dummy_warning(var) \ -warn("warning: dummy PL_" #var " used in %s:%d", __FILE__, __LINE__), + warn("warning: dummy PL_" #var " used in %s:%d", __FILE__, __LINE__), #endif -#define D_PPP_my_PL_parser_var(var) ((PL_parser ? PL_parser : \ -(D_PPP_parser_dummy_warning(var) &DPPP_(dummy_PL_parser)))->var) +#define D_PPP_my_PL_parser_var(var) ((PL_parser ? PL_parser : (D_PPP_parser_dummy_warning(var) & DPPP_(dummy_PL_parser)))->var) #if defined(NEED_PL_parser) static yy_parser DPPP_(dummy_PL_parser); #elif defined(NEED_PL_parser_GLOBAL) @@ -899,7 +922,7 @@ extern yy_parser DPPP_(dummy_PL_parser); #define PL_in_my_stash D_PPP_my_PL_parser_var(in_my_stash) #define PL_error_count D_PPP_my_PL_parser_var(error_count) #else -#define PL_parser ((void *) 1) +#define PL_parser ((void *)1) #endif #ifndef mPUSHs #define mPUSHs(s) PUSHs(sv_2mortal(s)) @@ -908,7 +931,7 @@ extern yy_parser DPPP_(dummy_PL_parser); #define PUSHmortal PUSHs(sv_newmortal()) #endif #ifndef mPUSHp -#define mPUSHp(p,l) sv_setpvn(PUSHmortal, (p), (l)) +#define mPUSHp(p, l) sv_setpvn(PUSHmortal, (p), (l)) #endif #ifndef mPUSHn #define mPUSHn(n) sv_setnv(PUSHmortal, (NV)(n)) @@ -926,16 +949,40 @@ extern yy_parser DPPP_(dummy_PL_parser); #define XPUSHmortal XPUSHs(sv_newmortal()) #endif #ifndef mXPUSHp -#define mXPUSHp(p,l) STMT_START { EXTEND(sp,1); sv_setpvn(PUSHmortal, (p), (l)); } STMT_END +#define mXPUSHp(p, l) \ + STMT_START \ + { \ + EXTEND(sp, 1); \ + sv_setpvn(PUSHmortal, (p), (l)); \ + } \ + STMT_END #endif #ifndef mXPUSHn -#define mXPUSHn(n) STMT_START { EXTEND(sp,1); sv_setnv(PUSHmortal, (NV)(n)); } STMT_END +#define mXPUSHn(n) \ + STMT_START \ + { \ + EXTEND(sp, 1); \ + sv_setnv(PUSHmortal, (NV)(n)); \ + } \ + STMT_END #endif #ifndef mXPUSHi -#define mXPUSHi(i) STMT_START { EXTEND(sp,1); sv_setiv(PUSHmortal, (IV)(i)); } STMT_END +#define mXPUSHi(i) \ + STMT_START \ + { \ + EXTEND(sp, 1); \ + sv_setiv(PUSHmortal, (IV)(i)); \ + } \ + STMT_END #endif #ifndef mXPUSHu -#define mXPUSHu(u) STMT_START { EXTEND(sp,1); sv_setuv(PUSHmortal, (UV)(u)); } STMT_END +#define mXPUSHu(u) \ + STMT_START \ + { \ + EXTEND(sp, 1); \ + sv_setuv(PUSHmortal, (UV)(u)); \ + } \ + STMT_END #endif #ifndef call_sv #define call_sv perl_call_sv @@ -966,113 +1013,124 @@ extern yy_parser DPPP_(dummy_PL_parser); #ifdef call_sv #undef call_sv #endif -#if (PERL_BCDVERSION < 0x5006000) -#define call_sv(sv, flags) ((flags) & G_METHOD ? perl_call_method((char *) SvPV_nolen_const(sv), \ -(flags) & ~G_METHOD) : perl_call_sv(sv, flags)) +#if(PERL_BCDVERSION < 0x5006000) +#define call_sv(sv, flags) ((flags)&G_METHOD ? perl_call_method((char *)SvPV_nolen_const(sv), \ + (flags) & ~G_METHOD) \ + : perl_call_sv(sv, flags)) #else -#define call_sv(sv, flags) ((flags) & G_METHOD ? Perl_call_method(aTHX_ (char *) SvPV_nolen_const(sv), \ -(flags) & ~G_METHOD) : Perl_call_sv(aTHX_ sv, flags)) +#define call_sv(sv, flags) ((flags)&G_METHOD ? Perl_call_method(aTHX_(char *)SvPV_nolen_const(sv), \ + (flags) & ~G_METHOD) \ + : Perl_call_sv(aTHX_ sv, flags)) #endif #endif #ifndef eval_pv #if defined(NEED_eval_pv) -static SV* DPPP_(my_eval_pv)(char *p, I32 croak_on_error); +static SV * DPPP_(my_eval_pv)(char * p, I32 croak_on_error); static #else -extern SV* DPPP_(my_eval_pv)(char *p, I32 croak_on_error); +extern SV * DPPP_(my_eval_pv)(char * p, I32 croak_on_error); #endif #ifdef eval_pv #undef eval_pv #endif -#define eval_pv(a,b) DPPP_(my_eval_pv)(aTHX_ a,b) +#define eval_pv(a, b) \ + DPPP_(my_eval_pv) \ + (aTHX_ a, b) #define Perl_eval_pv DPPP_(my_eval_pv) #if defined(NEED_eval_pv) || defined(NEED_eval_pv_GLOBAL) -SV* -DPPP_(my_eval_pv)(char *p, I32 croak_on_error) + SV * + DPPP_(my_eval_pv)(char * p, I32 croak_on_error) { -dSP; -SV* sv = newSVpv(p, 0); -PUSHMARK(sp); -eval_sv(sv, G_SCALAR); -SvREFCNT_dec(sv); -SPAGAIN; -sv = POPs; -PUTBACK; -if (croak_on_error && SvTRUE(GvSV(errgv))) -croak(SvPVx(GvSV(errgv), na)); -return sv; + dSP; + SV * sv = newSVpv(p, 0); + PUSHMARK(sp); + eval_sv(sv, G_SCALAR); + SvREFCNT_dec(sv); + SPAGAIN; + sv = POPs; + PUTBACK; + if(croak_on_error && SvTRUE(GvSV(errgv))) + croak(SvPVx(GvSV(errgv), na)); + return sv; } #endif #endif #ifndef vload_module #if defined(NEED_vload_module) -static void DPPP_(my_vload_module)(U32 flags, SV *name, SV *ver, va_list *args); +static void DPPP_(my_vload_module)(U32 flags, SV * name, SV * ver, va_list * args); static #else -extern void DPPP_(my_vload_module)(U32 flags, SV *name, SV *ver, va_list *args); +extern void DPPP_(my_vload_module)(U32 flags, SV * name, SV * ver, va_list * args); #endif #ifdef vload_module #undef vload_module #endif -#define vload_module(a,b,c,d) DPPP_(my_vload_module)(aTHX_ a,b,c,d) +#define vload_module(a, b, c, d) \ + DPPP_(my_vload_module) \ + (aTHX_ a, b, c, d) #define Perl_vload_module DPPP_(my_vload_module) #if defined(NEED_vload_module) || defined(NEED_vload_module_GLOBAL) -void -DPPP_(my_vload_module)(U32 flags, SV *name, SV *ver, va_list *args) + void + DPPP_(my_vload_module)(U32 flags, SV * name, SV * ver, va_list * args) { -dTHR; -dVAR; -OP *veop, *imop; -OP * const modname = newSVOP(OP_CONST, 0, name); -SvREADONLY_off(((SVOP*)modname)->op_sv); -modname->op_private |= OPpCONST_BARE; -if (ver) { -veop = newSVOP(OP_CONST, 0, ver); -} -else -veop = NULL; -if (flags & PERL_LOADMOD_NOIMPORT) { -imop = sawparens(newNULLLIST()); -} -else if (flags & PERL_LOADMOD_IMPORT_OPS) { -imop = va_arg(*args, OP*); -} -else { -SV *sv; -imop = NULL; -sv = va_arg(*args, SV*); -while (sv) { -imop = append_elem(OP_LIST, imop, newSVOP(OP_CONST, 0, sv)); -sv = va_arg(*args, SV*); -} -} -{ -const line_t ocopline = PL_copline; -COP * const ocurcop = PL_curcop; -const int oexpect = PL_expect; -#if (PERL_BCDVERSION >= 0x5004000) -utilize(!(flags & PERL_LOADMOD_DENY), start_subparse(FALSE, 0), -veop, modname, imop); -#elif (PERL_BCDVERSION > 0x5003000) -utilize(!(flags & PERL_LOADMOD_DENY), start_subparse(), -veop, modname, imop); -#else -utilize(!(flags & PERL_LOADMOD_DENY), start_subparse(), -modname, imop); -#endif -PL_expect = oexpect; -PL_copline = ocopline; -PL_curcop = ocurcop; -} + dTHR; + dVAR; + OP *veop, *imop; + OP * const modname = newSVOP(OP_CONST, 0, name); + SvREADONLY_off(((SVOP *)modname)->op_sv); + modname->op_private |= OPpCONST_BARE; + if(ver) + { + veop = newSVOP(OP_CONST, 0, ver); + } + else + veop = NULL; + if(flags & PERL_LOADMOD_NOIMPORT) + { + imop = sawparens(newNULLLIST()); + } + else if(flags & PERL_LOADMOD_IMPORT_OPS) + { + imop = va_arg(*args, OP *); + } + else + { + SV * sv; + imop = NULL; + sv = va_arg(*args, SV *); + while(sv) + { + imop = append_elem(OP_LIST, imop, newSVOP(OP_CONST, 0, sv)); + sv = va_arg(*args, SV *); + } + } + { + const line_t ocopline = PL_copline; + COP * const ocurcop = PL_curcop; + const int oexpect = PL_expect; +#if(PERL_BCDVERSION >= 0x5004000) + utilize(!(flags & PERL_LOADMOD_DENY), start_subparse(FALSE, 0), + veop, modname, imop); +#elif(PERL_BCDVERSION > 0x5003000) + utilize(!(flags & PERL_LOADMOD_DENY), start_subparse(), + veop, modname, imop); +#else + utilize(!(flags & PERL_LOADMOD_DENY), start_subparse(), + modname, imop); +#endif + PL_expect = oexpect; + PL_copline = ocopline; + PL_curcop = ocurcop; + } } #endif #endif #ifndef load_module #if defined(NEED_load_module) -static void DPPP_(my_load_module)(U32 flags, SV *name, SV *ver, ...); +static void DPPP_(my_load_module)(U32 flags, SV * name, SV * ver, ...); static #else -extern void DPPP_(my_load_module)(U32 flags, SV *name, SV *ver, ...); +extern void DPPP_(my_load_module)(U32 flags, SV * name, SV * ver, ...); #endif #ifdef load_module #undef load_module @@ -1080,13 +1138,13 @@ extern void DPPP_(my_load_module)(U32 flags, SV *name, SV *ver, ...); #define load_module DPPP_(my_load_module) #define Perl_load_module DPPP_(my_load_module) #if defined(NEED_load_module) || defined(NEED_load_module_GLOBAL) -void -DPPP_(my_load_module)(U32 flags, SV *name, SV *ver, ...) + void + DPPP_(my_load_module)(U32 flags, SV * name, SV * ver, ...) { -va_list args; -va_start(args, ver); -vload_module(flags, name, ver, &args); -va_end(args); + va_list args; + va_start(args, ver); + vload_module(flags, name, ver, &args); + va_end(args); } #endif #endif @@ -1095,105 +1153,107 @@ va_end(args); #endif #ifndef newRV_noinc #if defined(NEED_newRV_noinc) -static SV * DPPP_(my_newRV_noinc)(SV *sv); +static SV * DPPP_(my_newRV_noinc)(SV * sv); static #else -extern SV * DPPP_(my_newRV_noinc)(SV *sv); +extern SV * DPPP_(my_newRV_noinc)(SV * sv); #endif #ifdef newRV_noinc #undef newRV_noinc #endif -#define newRV_noinc(a) DPPP_(my_newRV_noinc)(aTHX_ a) +#define newRV_noinc(a) \ + DPPP_(my_newRV_noinc) \ + (aTHX_ a) #define Perl_newRV_noinc DPPP_(my_newRV_noinc) #if defined(NEED_newRV_noinc) || defined(NEED_newRV_noinc_GLOBAL) -SV * -DPPP_(my_newRV_noinc)(SV *sv) + SV * + DPPP_(my_newRV_noinc)(SV * sv) { -SV *rv = (SV *)newRV(sv); -SvREFCNT_dec(sv); -return rv; + SV * rv = (SV *)newRV(sv); + SvREFCNT_dec(sv); + return rv; } #endif #endif -#if (PERL_BCDVERSION < 0x5004063) && (PERL_BCDVERSION != 0x5004005) +#if(PERL_BCDVERSION < 0x5004063) && (PERL_BCDVERSION != 0x5004005) #if defined(NEED_newCONSTSUB) -static void DPPP_(my_newCONSTSUB)(HV *stash, const char *name, SV *sv); +static void DPPP_(my_newCONSTSUB)(HV * stash, const char * name, SV * sv); static #else -extern void DPPP_(my_newCONSTSUB)(HV *stash, const char *name, SV *sv); +extern void DPPP_(my_newCONSTSUB)(HV * stash, const char * name, SV * sv); #endif #ifdef newCONSTSUB #undef newCONSTSUB #endif -#define newCONSTSUB(a,b,c) DPPP_(my_newCONSTSUB)(aTHX_ a,b,c) +#define newCONSTSUB(a, b, c) \ + DPPP_(my_newCONSTSUB) \ + (aTHX_ a, b, c) #define Perl_newCONSTSUB DPPP_(my_newCONSTSUB) #if defined(NEED_newCONSTSUB) || defined(NEED_newCONSTSUB_GLOBAL) #define D_PPP_PL_copline PL_copline -void -DPPP_(my_newCONSTSUB)(HV *stash, const char *name, SV *sv) + void + DPPP_(my_newCONSTSUB)(HV * stash, const char * name, SV * sv) { -U32 oldhints = PL_hints; -HV *old_cop_stash = PL_curcop->cop_stash; -HV *old_curstash = PL_curstash; -line_t oldline = PL_curcop->cop_line; -PL_curcop->cop_line = D_PPP_PL_copline; -PL_hints &= ~HINT_BLOCK_SCOPE; -if (stash) -PL_curstash = PL_curcop->cop_stash = stash; -newSUB( -#if (PERL_BCDVERSION < 0x5003022) -start_subparse(), -#elif (PERL_BCDVERSION == 0x5003022) -start_subparse(0), -#else -start_subparse(FALSE, 0), -#endif -newSVOP(OP_CONST, 0, newSVpv((char *) name, 0)), -newSVOP(OP_CONST, 0, &PL_sv_no), -newSTATEOP(0, Nullch, newSVOP(OP_CONST, 0, sv)) -); -PL_hints = oldhints; -PL_curcop->cop_stash = old_cop_stash; -PL_curstash = old_curstash; -PL_curcop->cop_line = oldline; -} -#endif -#endif -#if defined(MULTIPLICITY) || defined(PERL_OBJECT) || \ -defined(PERL_CAPI) || defined(PERL_IMPLICIT_CONTEXT) + U32 oldhints = PL_hints; + HV * old_cop_stash = PL_curcop->cop_stash; + HV * old_curstash = PL_curstash; + line_t oldline = PL_curcop->cop_line; + PL_curcop->cop_line = D_PPP_PL_copline; + PL_hints &= ~HINT_BLOCK_SCOPE; + if(stash) + PL_curstash = PL_curcop->cop_stash = stash; + newSUB( +#if(PERL_BCDVERSION < 0x5003022) + start_subparse(), +#elif(PERL_BCDVERSION == 0x5003022) + start_subparse(0), +#else + start_subparse(FALSE, 0), +#endif + newSVOP(OP_CONST, 0, newSVpv((char *)name, 0)), + newSVOP(OP_CONST, 0, &PL_sv_no), + newSTATEOP(0, Nullch, newSVOP(OP_CONST, 0, sv))); + PL_hints = oldhints; + PL_curcop->cop_stash = old_cop_stash; + PL_curstash = old_curstash; + PL_curcop->cop_line = oldline; +} +#endif +#endif +#if defined(MULTIPLICITY) || defined(PERL_OBJECT) || defined(PERL_CAPI) || defined(PERL_IMPLICIT_CONTEXT) #ifndef START_MY_CXT #define START_MY_CXT -#if (PERL_BCDVERSION < 0x5004068) +#if(PERL_BCDVERSION < 0x5004068) #define dMY_CXT_SV \ -SV *my_cxt_sv = get_sv(MY_CXT_KEY, FALSE) + SV * my_cxt_sv = get_sv(MY_CXT_KEY, FALSE) #else -#define dMY_CXT_SV \ -SV *my_cxt_sv = *hv_fetch(PL_modglobal, MY_CXT_KEY, \ -sizeof(MY_CXT_KEY)-1, TRUE) +#define dMY_CXT_SV \ + SV * my_cxt_sv = *hv_fetch(PL_modglobal, MY_CXT_KEY, \ + sizeof(MY_CXT_KEY) - 1, TRUE) #endif #define dMY_CXT \ -dMY_CXT_SV; \ -my_cxt_t *my_cxtp = INT2PTR(my_cxt_t*,SvUV(my_cxt_sv)) -#define MY_CXT_INIT \ -dMY_CXT_SV; \ -\ -my_cxt_t *my_cxtp = (my_cxt_t*)SvPVX(newSV(sizeof(my_cxt_t)-1));\ -Zero(my_cxtp, 1, my_cxt_t); \ -sv_setuv(my_cxt_sv, PTR2UV(my_cxtp)) + dMY_CXT_SV; \ + my_cxt_t * my_cxtp = INT2PTR(my_cxt_t *, SvUV(my_cxt_sv)) +#define MY_CXT_INIT \ + dMY_CXT_SV; \ + \ + my_cxt_t * my_cxtp = (my_cxt_t *)SvPVX(newSV(sizeof(my_cxt_t) - 1)); \ + Zero(my_cxtp, 1, my_cxt_t); \ + sv_setuv(my_cxt_sv, PTR2UV(my_cxtp)) #define MY_CXT (*my_cxtp) -#define pMY_CXT my_cxt_t *my_cxtp +#define pMY_CXT my_cxt_t * my_cxtp #define pMY_CXT_ pMY_CXT, -#define _pMY_CXT ,pMY_CXT +#define _pMY_CXT , pMY_CXT #define aMY_CXT my_cxtp #define aMY_CXT_ aMY_CXT, -#define _aMY_CXT ,aMY_CXT +#define _aMY_CXT , aMY_CXT #endif #ifndef MY_CXT_CLONE -#define MY_CXT_CLONE \ -dMY_CXT_SV; \ -my_cxt_t *my_cxtp = (my_cxt_t*)SvPVX(newSV(sizeof(my_cxt_t)-1));\ -Copy(INT2PTR(my_cxt_t*, SvUV(my_cxt_sv)), my_cxtp, 1, my_cxt_t);\ -sv_setuv(my_cxt_sv, PTR2UV(my_cxtp)) +#define MY_CXT_CLONE \ + dMY_CXT_SV; \ + my_cxt_t * my_cxtp = (my_cxt_t *)SvPVX(newSV(sizeof(my_cxt_t) - 1)); \ + Copy(INT2PTR(my_cxt_t *, SvUV(my_cxt_sv)), my_cxtp, 1, my_cxt_t); \ + sv_setuv(my_cxt_sv, PTR2UV(my_cxtp)) #endif #else #ifndef START_MY_CXT @@ -1231,8 +1291,7 @@ sv_setuv(my_cxt_sv, PTR2UV(my_cxtp)) #endif #endif #ifndef NVef -#if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE) && \ -defined(PERL_PRIfldbl) && (PERL_BCDVERSION != 0x5006000) +#if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE) && defined(PERL_PRIfldbl) && (PERL_BCDVERSION != 0x5006000) #define NVef PERL_PRIeldbl #define NVff PERL_PRIfldbl #define NVgf PERL_PRIgldbl @@ -1244,100 +1303,112 @@ defined(PERL_PRIfldbl) && (PERL_BCDVERSION != 0x5006000) #endif #ifndef SvREFCNT_inc #ifdef PERL_USE_GCC_BRACE_GROUPS -#define SvREFCNT_inc(sv) \ -({ \ -SV * const _sv = (SV*)(sv); \ -if (_sv) \ -(SvREFCNT(_sv))++; \ -_sv; \ -}) +#define SvREFCNT_inc(sv) \ + ( \ + { \ + SV * const _sv = (SV *)(sv); \ + if(_sv) \ + (SvREFCNT(_sv))++; \ + _sv; \ + }) #else #define SvREFCNT_inc(sv) \ -((PL_Sv=(SV*)(sv)) ? (++(SvREFCNT(PL_Sv)),PL_Sv) : NULL) + ((PL_Sv = (SV *)(sv)) ? (++(SvREFCNT(PL_Sv)), PL_Sv) : NULL) #endif #endif #ifndef SvREFCNT_inc_simple #ifdef PERL_USE_GCC_BRACE_GROUPS -#define SvREFCNT_inc_simple(sv) \ -({ \ -if (sv) \ -(SvREFCNT(sv))++; \ -(SV *)(sv); \ -}) +#define SvREFCNT_inc_simple(sv) \ + ( \ + { \ + if(sv) \ + (SvREFCNT(sv))++; \ + (SV *)(sv); \ + }) #else #define SvREFCNT_inc_simple(sv) \ -((sv) ? (SvREFCNT(sv)++,(SV*)(sv)) : NULL) + ((sv) ? (SvREFCNT(sv)++, (SV *)(sv)) : NULL) #endif #endif #ifndef SvREFCNT_inc_NN #ifdef PERL_USE_GCC_BRACE_GROUPS -#define SvREFCNT_inc_NN(sv) \ -({ \ -SV * const _sv = (SV*)(sv); \ -SvREFCNT(_sv)++; \ -_sv; \ -}) +#define SvREFCNT_inc_NN(sv) \ + ( \ + { \ + SV * const _sv = (SV *)(sv); \ + SvREFCNT(_sv)++; \ + _sv; \ + }) #else #define SvREFCNT_inc_NN(sv) \ -(PL_Sv=(SV*)(sv),++(SvREFCNT(PL_Sv)),PL_Sv) + (PL_Sv = (SV *)(sv), ++(SvREFCNT(PL_Sv)), PL_Sv) #endif #endif #ifndef SvREFCNT_inc_void #ifdef PERL_USE_GCC_BRACE_GROUPS -#define SvREFCNT_inc_void(sv) \ -({ \ -SV * const _sv = (SV*)(sv); \ -if (_sv) \ -(void)(SvREFCNT(_sv)++); \ -}) +#define SvREFCNT_inc_void(sv) \ + ( \ + { \ + SV * const _sv = (SV *)(sv); \ + if(_sv) \ + (void)(SvREFCNT(_sv)++); \ + }) #else #define SvREFCNT_inc_void(sv) \ -(void)((PL_Sv=(SV*)(sv)) ? ++(SvREFCNT(PL_Sv)) : 0) + (void)((PL_Sv = (SV *)(sv)) ? ++(SvREFCNT(PL_Sv)) : 0) #endif #endif #ifndef SvREFCNT_inc_simple_void -#define SvREFCNT_inc_simple_void(sv) STMT_START { if (sv) SvREFCNT(sv)++; } STMT_END +#define SvREFCNT_inc_simple_void(sv) \ + STMT_START \ + { \ + if(sv) \ + SvREFCNT(sv)++; \ + } \ + STMT_END #endif #ifndef SvREFCNT_inc_simple_NN -#define SvREFCNT_inc_simple_NN(sv) (++SvREFCNT(sv), (SV*)(sv)) +#define SvREFCNT_inc_simple_NN(sv) (++SvREFCNT(sv), (SV *)(sv)) #endif #ifndef SvREFCNT_inc_void_NN -#define SvREFCNT_inc_void_NN(sv) (void)(++SvREFCNT((SV*)(sv))) +#define SvREFCNT_inc_void_NN(sv) (void)(++SvREFCNT((SV *)(sv))) #endif #ifndef SvREFCNT_inc_simple_void_NN -#define SvREFCNT_inc_simple_void_NN(sv) (void)(++SvREFCNT((SV*)(sv))) +#define SvREFCNT_inc_simple_void_NN(sv) (void)(++SvREFCNT((SV *)(sv))) #endif #ifndef newSV_type #if defined(NEED_newSV_type) -static SV* DPPP_(my_newSV_type)(pTHX_ svtype const t); +static SV * DPPP_(my_newSV_type)(pTHX_ svtype const t); static #else -extern SV* DPPP_(my_newSV_type)(pTHX_ svtype const t); +extern SV * DPPP_(my_newSV_type)(pTHX_ svtype const t); #endif #ifdef newSV_type #undef newSV_type #endif -#define newSV_type(a) DPPP_(my_newSV_type)(aTHX_ a) +#define newSV_type(a) \ + DPPP_(my_newSV_type) \ + (aTHX_ a) #define Perl_newSV_type DPPP_(my_newSV_type) #if defined(NEED_newSV_type) || defined(NEED_newSV_type_GLOBAL) -SV* -DPPP_(my_newSV_type)(pTHX_ svtype const t) + SV * + DPPP_(my_newSV_type)(pTHX_ svtype const t) { -SV* const sv = newSV(0); -sv_upgrade(sv, t); -return sv; + SV * const sv = newSV(0); + sv_upgrade(sv, t); + return sv; } #endif #endif -#if (PERL_BCDVERSION < 0x5006000) -#define D_PPP_CONSTPV_ARG(x) ((char *) (x)) +#if(PERL_BCDVERSION < 0x5006000) +#define D_PPP_CONSTPV_ARG(x) ((char *)(x)) #else #define D_PPP_CONSTPV_ARG(x) (x) #endif #ifndef newSVpvn -#define newSVpvn(data,len) ((data) \ -? ((len) ? newSVpv((data), (len)) : newSVpv("", 0)) \ -: newSV(0)) +#define newSVpvn(data, len) ((data) \ + ? ((len) ? newSVpv((data), (len)) : newSVpv("", 0)) \ + : newSV(0)) #endif #ifndef newSVpvn_utf8 #define newSVpvn_utf8(s, len, u) newSVpvn_flags((s), (len), (u) ? SVf_UTF8 : 0) @@ -1347,23 +1418,25 @@ return sv; #endif #ifndef newSVpvn_flags #if defined(NEED_newSVpvn_flags) -static SV * DPPP_(my_newSVpvn_flags)(pTHX_ const char *s, STRLEN len, U32 flags); +static SV * DPPP_(my_newSVpvn_flags)(pTHX_ const char * s, STRLEN len, U32 flags); static #else -extern SV * DPPP_(my_newSVpvn_flags)(pTHX_ const char *s, STRLEN len, U32 flags); +extern SV * DPPP_(my_newSVpvn_flags)(pTHX_ const char * s, STRLEN len, U32 flags); #endif #ifdef newSVpvn_flags #undef newSVpvn_flags #endif -#define newSVpvn_flags(a,b,c) DPPP_(my_newSVpvn_flags)(aTHX_ a,b,c) +#define newSVpvn_flags(a, b, c) \ + DPPP_(my_newSVpvn_flags) \ + (aTHX_ a, b, c) #define Perl_newSVpvn_flags DPPP_(my_newSVpvn_flags) #if defined(NEED_newSVpvn_flags) || defined(NEED_newSVpvn_flags_GLOBAL) -SV * -DPPP_(my_newSVpvn_flags)(pTHX_ const char *s, STRLEN len, U32 flags) + SV * + DPPP_(my_newSVpvn_flags)(pTHX_ const char * s, STRLEN len, U32 flags) { -SV *sv = newSVpvn(D_PPP_CONSTPV_ARG(s), len); -SvFLAGS(sv) |= (flags & SVf_UTF8); -return (flags & SVs_TEMP) ? sv_2mortal(sv) : sv; + SV * sv = newSVpvn(D_PPP_CONSTPV_ARG(s), len); + SvFLAGS(sv) |= (flags & SVf_UTF8); + return (flags & SVs_TEMP) ? sv_2mortal(sv) : sv; } #endif #endif @@ -1377,30 +1450,33 @@ return (flags & SVs_TEMP) ? sv_2mortal(sv) : sv; #define sv_2pv_nolen(sv) SvPV_nolen(sv) #endif #ifdef SvPVbyte -#if (PERL_BCDVERSION < 0x5007000) +#if(PERL_BCDVERSION < 0x5007000) #if defined(NEED_sv_2pvbyte) -static char * DPPP_(my_sv_2pvbyte)(pTHX_ SV *sv, STRLEN *lp); +static char * DPPP_(my_sv_2pvbyte)(pTHX_ SV * sv, STRLEN * lp); static #else -extern char * DPPP_(my_sv_2pvbyte)(pTHX_ SV *sv, STRLEN *lp); +extern char * DPPP_(my_sv_2pvbyte)(pTHX_ SV * sv, STRLEN * lp); #endif #ifdef sv_2pvbyte #undef sv_2pvbyte #endif -#define sv_2pvbyte(a,b) DPPP_(my_sv_2pvbyte)(aTHX_ a,b) +#define sv_2pvbyte(a, b) \ + DPPP_(my_sv_2pvbyte) \ + (aTHX_ a, b) #define Perl_sv_2pvbyte DPPP_(my_sv_2pvbyte) #if defined(NEED_sv_2pvbyte) || defined(NEED_sv_2pvbyte_GLOBAL) -char * -DPPP_(my_sv_2pvbyte)(pTHX_ SV *sv, STRLEN *lp) + char * + DPPP_(my_sv_2pvbyte)(pTHX_ SV * sv, STRLEN * lp) { -sv_utf8_downgrade(sv,0); -return SvPV(sv,*lp); + sv_utf8_downgrade(sv, 0); + return SvPV(sv, *lp); } #endif #undef SvPVbyte -#define SvPVbyte(sv, lp) \ -((SvFLAGS(sv) & (SVf_POK|SVf_UTF8)) == (SVf_POK) \ -? ((lp = SvCUR(sv)), SvPVX(sv)) : sv_2pvbyte(sv, &lp)) +#define SvPVbyte(sv, lp) \ + ((SvFLAGS(sv) & (SVf_POK | SVf_UTF8)) == (SVf_POK) \ + ? ((lp = SvCUR(sv)), SvPVX(sv)) \ + : sv_2pvbyte(sv, &lp)) #endif #else #define SvPVbyte SvPV @@ -1439,47 +1515,51 @@ return SvPV(sv,*lp); #ifndef SV_COW_SHARED_HASH_KEYS #define SV_COW_SHARED_HASH_KEYS 0 #endif -#if (PERL_BCDVERSION < 0x5007002) +#if(PERL_BCDVERSION < 0x5007002) #if defined(NEED_sv_2pv_flags) -static char * DPPP_(my_sv_2pv_flags)(pTHX_ SV *sv, STRLEN *lp, I32 flags); +static char * DPPP_(my_sv_2pv_flags)(pTHX_ SV * sv, STRLEN * lp, I32 flags); static #else -extern char * DPPP_(my_sv_2pv_flags)(pTHX_ SV *sv, STRLEN *lp, I32 flags); +extern char * DPPP_(my_sv_2pv_flags)(pTHX_ SV * sv, STRLEN * lp, I32 flags); #endif #ifdef sv_2pv_flags #undef sv_2pv_flags #endif -#define sv_2pv_flags(a,b,c) DPPP_(my_sv_2pv_flags)(aTHX_ a,b,c) +#define sv_2pv_flags(a, b, c) \ + DPPP_(my_sv_2pv_flags) \ + (aTHX_ a, b, c) #define Perl_sv_2pv_flags DPPP_(my_sv_2pv_flags) #if defined(NEED_sv_2pv_flags) || defined(NEED_sv_2pv_flags_GLOBAL) -char * -DPPP_(my_sv_2pv_flags)(pTHX_ SV *sv, STRLEN *lp, I32 flags) + char * + DPPP_(my_sv_2pv_flags)(pTHX_ SV * sv, STRLEN * lp, I32 flags) { -STRLEN n_a = (STRLEN) flags; -return sv_2pv(sv, lp ? lp : &n_a); + STRLEN n_a = (STRLEN)flags; + return sv_2pv(sv, lp ? lp : &n_a); } #endif #if defined(NEED_sv_pvn_force_flags) -static char * DPPP_(my_sv_pvn_force_flags)(pTHX_ SV *sv, STRLEN *lp, I32 flags); +static char * DPPP_(my_sv_pvn_force_flags)(pTHX_ SV * sv, STRLEN * lp, I32 flags); static #else -extern char * DPPP_(my_sv_pvn_force_flags)(pTHX_ SV *sv, STRLEN *lp, I32 flags); +extern char * DPPP_(my_sv_pvn_force_flags)(pTHX_ SV * sv, STRLEN * lp, I32 flags); #endif #ifdef sv_pvn_force_flags #undef sv_pvn_force_flags #endif -#define sv_pvn_force_flags(a,b,c) DPPP_(my_sv_pvn_force_flags)(aTHX_ a,b,c) +#define sv_pvn_force_flags(a, b, c) \ + DPPP_(my_sv_pvn_force_flags) \ + (aTHX_ a, b, c) #define Perl_sv_pvn_force_flags DPPP_(my_sv_pvn_force_flags) #if defined(NEED_sv_pvn_force_flags) || defined(NEED_sv_pvn_force_flags_GLOBAL) -char * -DPPP_(my_sv_pvn_force_flags)(pTHX_ SV *sv, STRLEN *lp, I32 flags) + char * + DPPP_(my_sv_pvn_force_flags)(pTHX_ SV * sv, STRLEN * lp, I32 flags) { -STRLEN n_a = (STRLEN) flags; -return sv_pvn_force(sv, lp ? lp : &n_a); + STRLEN n_a = (STRLEN)flags; + return sv_pvn_force(sv, lp ? lp : &n_a); } #endif #endif -#if (PERL_BCDVERSION < 0x5008008) || ( (PERL_BCDVERSION >= 0x5009000) && (PERL_BCDVERSION < 0x5009003) ) +#if(PERL_BCDVERSION < 0x5008008) || ((PERL_BCDVERSION >= 0x5009000) && (PERL_BCDVERSION < 0x5009003)) #define DPPP_SVPV_NOLEN_LP_ARG &PL_na #else #define DPPP_SVPV_NOLEN_LP_ARG 0 @@ -1491,27 +1571,28 @@ return sv_pvn_force(sv, lp ? lp : &n_a); #define SvPV_mutable(sv, lp) SvPV_flags_mutable(sv, lp, SV_GMAGIC) #endif #ifndef SvPV_flags -#define SvPV_flags(sv, lp, flags) \ -((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \ -? ((lp = SvCUR(sv)), SvPVX(sv)) : sv_2pv_flags(sv, &lp, flags)) +#define SvPV_flags(sv, lp, flags) \ + ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \ + ? ((lp = SvCUR(sv)), SvPVX(sv)) \ + : sv_2pv_flags(sv, &lp, flags)) #endif #ifndef SvPV_flags_const -#define SvPV_flags_const(sv, lp, flags) \ -((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \ -? ((lp = SvCUR(sv)), SvPVX_const(sv)) : \ -(const char*) sv_2pv_flags(sv, &lp, flags|SV_CONST_RETURN)) +#define SvPV_flags_const(sv, lp, flags) \ + ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \ + ? ((lp = SvCUR(sv)), SvPVX_const(sv)) \ + : (const char *)sv_2pv_flags(sv, &lp, flags | SV_CONST_RETURN)) #endif #ifndef SvPV_flags_const_nolen #define SvPV_flags_const_nolen(sv, flags) \ -((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \ -? SvPVX_const(sv) : \ -(const char*) sv_2pv_flags(sv, DPPP_SVPV_NOLEN_LP_ARG, flags|SV_CONST_RETURN)) + ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \ + ? SvPVX_const(sv) \ + : (const char *)sv_2pv_flags(sv, DPPP_SVPV_NOLEN_LP_ARG, flags | SV_CONST_RETURN)) #endif #ifndef SvPV_flags_mutable -#define SvPV_flags_mutable(sv, lp, flags) \ -((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \ -? ((lp = SvCUR(sv)), SvPVX_mutable(sv)) : \ -sv_2pv_flags(sv, &lp, flags|SV_MUTABLE_RETURN)) +#define SvPV_flags_mutable(sv, lp, flags) \ + ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \ + ? ((lp = SvCUR(sv)), SvPVX_mutable(sv)) \ + : sv_2pv_flags(sv, &lp, flags | SV_MUTABLE_RETURN)) #endif #ifndef SvPV_force #define SvPV_force(sv, lp) SvPV_force_flags(sv, lp, SV_GMAGIC) @@ -1529,30 +1610,34 @@ sv_2pv_flags(sv, &lp, flags|SV_MUTABLE_RETURN)) #define SvPV_force_nomg_nolen(sv) SvPV_force_flags_nolen(sv, 0) #endif #ifndef SvPV_force_flags -#define SvPV_force_flags(sv, lp, flags) \ -((SvFLAGS(sv) & (SVf_POK|SVf_THINKFIRST)) == SVf_POK \ -? ((lp = SvCUR(sv)), SvPVX(sv)) : sv_pvn_force_flags(sv, &lp, flags)) +#define SvPV_force_flags(sv, lp, flags) \ + ((SvFLAGS(sv) & (SVf_POK | SVf_THINKFIRST)) == SVf_POK \ + ? ((lp = SvCUR(sv)), SvPVX(sv)) \ + : sv_pvn_force_flags(sv, &lp, flags)) #endif #ifndef SvPV_force_flags_nolen -#define SvPV_force_flags_nolen(sv, flags) \ -((SvFLAGS(sv) & (SVf_POK|SVf_THINKFIRST)) == SVf_POK \ -? SvPVX(sv) : sv_pvn_force_flags(sv, DPPP_SVPV_NOLEN_LP_ARG, flags)) +#define SvPV_force_flags_nolen(sv, flags) \ + ((SvFLAGS(sv) & (SVf_POK | SVf_THINKFIRST)) == SVf_POK \ + ? SvPVX(sv) \ + : sv_pvn_force_flags(sv, DPPP_SVPV_NOLEN_LP_ARG, flags)) #endif #ifndef SvPV_force_flags_mutable -#define SvPV_force_flags_mutable(sv, lp, flags) \ -((SvFLAGS(sv) & (SVf_POK|SVf_THINKFIRST)) == SVf_POK \ -? ((lp = SvCUR(sv)), SvPVX_mutable(sv)) \ -: sv_pvn_force_flags(sv, &lp, flags|SV_MUTABLE_RETURN)) +#define SvPV_force_flags_mutable(sv, lp, flags) \ + ((SvFLAGS(sv) & (SVf_POK | SVf_THINKFIRST)) == SVf_POK \ + ? ((lp = SvCUR(sv)), SvPVX_mutable(sv)) \ + : sv_pvn_force_flags(sv, &lp, flags | SV_MUTABLE_RETURN)) #endif #ifndef SvPV_nolen -#define SvPV_nolen(sv) \ -((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \ -? SvPVX(sv) : sv_2pv_flags(sv, DPPP_SVPV_NOLEN_LP_ARG, SV_GMAGIC)) +#define SvPV_nolen(sv) \ + ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \ + ? SvPVX(sv) \ + : sv_2pv_flags(sv, DPPP_SVPV_NOLEN_LP_ARG, SV_GMAGIC)) #endif #ifndef SvPV_nolen_const -#define SvPV_nolen_const(sv) \ -((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \ -? SvPVX_const(sv) : sv_2pv_flags(sv, DPPP_SVPV_NOLEN_LP_ARG, SV_GMAGIC|SV_CONST_RETURN)) +#define SvPV_nolen_const(sv) \ + ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \ + ? SvPVX_const(sv) \ + : sv_2pv_flags(sv, DPPP_SVPV_NOLEN_LP_ARG, SV_GMAGIC | SV_CONST_RETURN)) #endif #ifndef SvPV_nomg #define SvPV_nomg(sv, lp) SvPV_flags(sv, lp, 0) @@ -1565,130 +1650,161 @@ sv_2pv_flags(sv, &lp, flags|SV_MUTABLE_RETURN)) #endif #ifndef SvPV_nomg_nolen #define SvPV_nomg_nolen(sv) ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \ -? SvPVX(sv) : sv_2pv_flags(sv, DPPP_SVPV_NOLEN_LP_ARG, 0)) + ? SvPVX(sv) \ + : sv_2pv_flags(sv, DPPP_SVPV_NOLEN_LP_ARG, 0)) #endif #ifndef SvPV_renew -#define SvPV_renew(sv,n) STMT_START { SvLEN_set(sv, n); \ -SvPV_set((sv), (char *) saferealloc( \ -(Malloc_t)SvPVX(sv), (MEM_SIZE)((n)))); \ -} STMT_END +#define SvPV_renew(sv, n) \ + STMT_START \ + { \ + SvLEN_set(sv, n); \ + SvPV_set((sv), (char *)saferealloc( \ + (Malloc_t)SvPVX(sv), (MEM_SIZE)((n)))); \ + } \ + STMT_END #endif #ifndef SvMAGIC_set -#define SvMAGIC_set(sv, val) \ -STMT_START { assert(SvTYPE(sv) >= SVt_PVMG); \ -(((XPVMG*) SvANY(sv))->xmg_magic = (val)); } STMT_END -#endif -#if (PERL_BCDVERSION < 0x5009003) +#define SvMAGIC_set(sv, val) \ + STMT_START \ + { \ + assert(SvTYPE(sv) >= SVt_PVMG); \ + (((XPVMG *)SvANY(sv))->xmg_magic = (val)); \ + } \ + STMT_END +#endif +#if(PERL_BCDVERSION < 0x5009003) #ifndef SvPVX_const -#define SvPVX_const(sv) ((const char*) (0 + SvPVX(sv))) +#define SvPVX_const(sv) ((const char *)(0 + SvPVX(sv))) #endif #ifndef SvPVX_mutable #define SvPVX_mutable(sv) (0 + SvPVX(sv)) #endif #ifndef SvRV_set -#define SvRV_set(sv, val) \ -STMT_START { assert(SvTYPE(sv) >= SVt_RV); \ -(((XRV*) SvANY(sv))->xrv_rv = (val)); } STMT_END +#define SvRV_set(sv, val) \ + STMT_START \ + { \ + assert(SvTYPE(sv) >= SVt_RV); \ + (((XRV *)SvANY(sv))->xrv_rv = (val)); \ + } \ + STMT_END #endif #else #ifndef SvPVX_const -#define SvPVX_const(sv) ((const char*)((sv)->sv_u.svu_pv)) +#define SvPVX_const(sv) ((const char *)((sv)->sv_u.svu_pv)) #endif #ifndef SvPVX_mutable #define SvPVX_mutable(sv) ((sv)->sv_u.svu_pv) #endif #ifndef SvRV_set -#define SvRV_set(sv, val) \ -STMT_START { assert(SvTYPE(sv) >= SVt_RV); \ -((sv)->sv_u.svu_rv = (val)); } STMT_END +#define SvRV_set(sv, val) \ + STMT_START \ + { \ + assert(SvTYPE(sv) >= SVt_RV); \ + ((sv)->sv_u.svu_rv = (val)); \ + } \ + STMT_END #endif #endif #ifndef SvSTASH_set -#define SvSTASH_set(sv, val) \ -STMT_START { assert(SvTYPE(sv) >= SVt_PVMG); \ -(((XPVMG*) SvANY(sv))->xmg_stash = (val)); } STMT_END -#endif -#if (PERL_BCDVERSION < 0x5004000) +#define SvSTASH_set(sv, val) \ + STMT_START \ + { \ + assert(SvTYPE(sv) >= SVt_PVMG); \ + (((XPVMG *)SvANY(sv))->xmg_stash = (val)); \ + } \ + STMT_END +#endif +#if(PERL_BCDVERSION < 0x5004000) #ifndef SvUV_set -#define SvUV_set(sv, val) \ -STMT_START { assert(SvTYPE(sv) == SVt_IV || SvTYPE(sv) >= SVt_PVIV); \ -(((XPVIV*) SvANY(sv))->xiv_iv = (IV) (val)); } STMT_END +#define SvUV_set(sv, val) \ + STMT_START \ + { \ + assert(SvTYPE(sv) == SVt_IV || SvTYPE(sv) >= SVt_PVIV); \ + (((XPVIV *)SvANY(sv))->xiv_iv = (IV)(val)); \ + } \ + STMT_END #endif #else #ifndef SvUV_set -#define SvUV_set(sv, val) \ -STMT_START { assert(SvTYPE(sv) == SVt_IV || SvTYPE(sv) >= SVt_PVIV); \ -(((XPVUV*) SvANY(sv))->xuv_uv = (val)); } STMT_END +#define SvUV_set(sv, val) \ + STMT_START \ + { \ + assert(SvTYPE(sv) == SVt_IV || SvTYPE(sv) >= SVt_PVIV); \ + (((XPVUV *)SvANY(sv))->xuv_uv = (val)); \ + } \ + STMT_END #endif #endif -#if (PERL_BCDVERSION >= 0x5004000) && !defined(vnewSVpvf) +#if(PERL_BCDVERSION >= 0x5004000) && !defined(vnewSVpvf) #if defined(NEED_vnewSVpvf) -static SV * DPPP_(my_vnewSVpvf)(pTHX_ const char *pat, va_list *args); +static SV * DPPP_(my_vnewSVpvf)(pTHX_ const char * pat, va_list * args); static #else -extern SV * DPPP_(my_vnewSVpvf)(pTHX_ const char *pat, va_list *args); +extern SV * DPPP_(my_vnewSVpvf)(pTHX_ const char * pat, va_list * args); #endif #ifdef vnewSVpvf #undef vnewSVpvf #endif -#define vnewSVpvf(a,b) DPPP_(my_vnewSVpvf)(aTHX_ a,b) +#define vnewSVpvf(a, b) \ + DPPP_(my_vnewSVpvf) \ + (aTHX_ a, b) #define Perl_vnewSVpvf DPPP_(my_vnewSVpvf) #if defined(NEED_vnewSVpvf) || defined(NEED_vnewSVpvf_GLOBAL) -SV * -DPPP_(my_vnewSVpvf)(pTHX_ const char *pat, va_list *args) + SV * + DPPP_(my_vnewSVpvf)(pTHX_ const char * pat, va_list * args) { -register SV *sv = newSV(0); -sv_vsetpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*)); -return sv; + register SV * sv = newSV(0); + sv_vsetpvfn(sv, pat, strlen(pat), args, Null(SV **), 0, Null(bool *)); + return sv; } #endif #endif -#if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_vcatpvf) -#define sv_vcatpvf(sv, pat, args) sv_vcatpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*)) +#if(PERL_BCDVERSION >= 0x5004000) && !defined(sv_vcatpvf) +#define sv_vcatpvf(sv, pat, args) sv_vcatpvfn(sv, pat, strlen(pat), args, Null(SV **), 0, Null(bool *)) #endif -#if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_vsetpvf) -#define sv_vsetpvf(sv, pat, args) sv_vsetpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*)) +#if(PERL_BCDVERSION >= 0x5004000) && !defined(sv_vsetpvf) +#define sv_vsetpvf(sv, pat, args) sv_vsetpvfn(sv, pat, strlen(pat), args, Null(SV **), 0, Null(bool *)) #endif -#if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_catpvf_mg) +#if(PERL_BCDVERSION >= 0x5004000) && !defined(sv_catpvf_mg) #if defined(NEED_sv_catpvf_mg) -static void DPPP_(my_sv_catpvf_mg)(pTHX_ SV *sv, const char *pat, ...); +static void DPPP_(my_sv_catpvf_mg)(pTHX_ SV * sv, const char * pat, ...); static #else -extern void DPPP_(my_sv_catpvf_mg)(pTHX_ SV *sv, const char *pat, ...); +extern void DPPP_(my_sv_catpvf_mg)(pTHX_ SV * sv, const char * pat, ...); #endif #define Perl_sv_catpvf_mg DPPP_(my_sv_catpvf_mg) #if defined(NEED_sv_catpvf_mg) || defined(NEED_sv_catpvf_mg_GLOBAL) -void -DPPP_(my_sv_catpvf_mg)(pTHX_ SV *sv, const char *pat, ...) + void + DPPP_(my_sv_catpvf_mg)(pTHX_ SV * sv, const char * pat, ...) { -va_list args; -va_start(args, pat); -sv_vcatpvfn(sv, pat, strlen(pat), &args, Null(SV**), 0, Null(bool*)); -SvSETMAGIC(sv); -va_end(args); + va_list args; + va_start(args, pat); + sv_vcatpvfn(sv, pat, strlen(pat), &args, Null(SV **), 0, Null(bool *)); + SvSETMAGIC(sv); + va_end(args); } #endif #endif #ifdef PERL_IMPLICIT_CONTEXT -#if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_catpvf_mg_nocontext) +#if(PERL_BCDVERSION >= 0x5004000) && !defined(sv_catpvf_mg_nocontext) #if defined(NEED_sv_catpvf_mg_nocontext) -static void DPPP_(my_sv_catpvf_mg_nocontext)(SV *sv, const char *pat, ...); +static void DPPP_(my_sv_catpvf_mg_nocontext)(SV * sv, const char * pat, ...); static #else -extern void DPPP_(my_sv_catpvf_mg_nocontext)(SV *sv, const char *pat, ...); +extern void DPPP_(my_sv_catpvf_mg_nocontext)(SV * sv, const char * pat, ...); #endif #define sv_catpvf_mg_nocontext DPPP_(my_sv_catpvf_mg_nocontext) #define Perl_sv_catpvf_mg_nocontext DPPP_(my_sv_catpvf_mg_nocontext) #if defined(NEED_sv_catpvf_mg_nocontext) || defined(NEED_sv_catpvf_mg_nocontext_GLOBAL) -void -DPPP_(my_sv_catpvf_mg_nocontext)(SV *sv, const char *pat, ...) + void + DPPP_(my_sv_catpvf_mg_nocontext)(SV * sv, const char * pat, ...) { -dTHX; -va_list args; -va_start(args, pat); -sv_vcatpvfn(sv, pat, strlen(pat), &args, Null(SV**), 0, Null(bool*)); -SvSETMAGIC(sv); -va_end(args); + dTHX; + va_list args; + va_start(args, pat); + sv_vcatpvfn(sv, pat, strlen(pat), &args, Null(SV **), 0, Null(bool *)); + SvSETMAGIC(sv); + va_end(args); } #endif #endif @@ -1700,53 +1816,55 @@ va_end(args); #define sv_catpvf_mg Perl_sv_catpvf_mg #endif #endif -#if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_vcatpvf_mg) -#define sv_vcatpvf_mg(sv, pat, args) \ -STMT_START { \ -sv_vcatpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*)); \ -SvSETMAGIC(sv); \ -} STMT_END +#if(PERL_BCDVERSION >= 0x5004000) && !defined(sv_vcatpvf_mg) +#define sv_vcatpvf_mg(sv, pat, args) \ + STMT_START \ + { \ + sv_vcatpvfn(sv, pat, strlen(pat), args, Null(SV **), 0, Null(bool *)); \ + SvSETMAGIC(sv); \ + } \ + STMT_END #endif -#if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_setpvf_mg) +#if(PERL_BCDVERSION >= 0x5004000) && !defined(sv_setpvf_mg) #if defined(NEED_sv_setpvf_mg) -static void DPPP_(my_sv_setpvf_mg)(pTHX_ SV *sv, const char *pat, ...); +static void DPPP_(my_sv_setpvf_mg)(pTHX_ SV * sv, const char * pat, ...); static #else -extern void DPPP_(my_sv_setpvf_mg)(pTHX_ SV *sv, const char *pat, ...); +extern void DPPP_(my_sv_setpvf_mg)(pTHX_ SV * sv, const char * pat, ...); #endif #define Perl_sv_setpvf_mg DPPP_(my_sv_setpvf_mg) #if defined(NEED_sv_setpvf_mg) || defined(NEED_sv_setpvf_mg_GLOBAL) -void -DPPP_(my_sv_setpvf_mg)(pTHX_ SV *sv, const char *pat, ...) + void + DPPP_(my_sv_setpvf_mg)(pTHX_ SV * sv, const char * pat, ...) { -va_list args; -va_start(args, pat); -sv_vsetpvfn(sv, pat, strlen(pat), &args, Null(SV**), 0, Null(bool*)); -SvSETMAGIC(sv); -va_end(args); + va_list args; + va_start(args, pat); + sv_vsetpvfn(sv, pat, strlen(pat), &args, Null(SV **), 0, Null(bool *)); + SvSETMAGIC(sv); + va_end(args); } #endif #endif #ifdef PERL_IMPLICIT_CONTEXT -#if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_setpvf_mg_nocontext) +#if(PERL_BCDVERSION >= 0x5004000) && !defined(sv_setpvf_mg_nocontext) #if defined(NEED_sv_setpvf_mg_nocontext) -static void DPPP_(my_sv_setpvf_mg_nocontext)(SV *sv, const char *pat, ...); +static void DPPP_(my_sv_setpvf_mg_nocontext)(SV * sv, const char * pat, ...); static #else -extern void DPPP_(my_sv_setpvf_mg_nocontext)(SV *sv, const char *pat, ...); +extern void DPPP_(my_sv_setpvf_mg_nocontext)(SV * sv, const char * pat, ...); #endif #define sv_setpvf_mg_nocontext DPPP_(my_sv_setpvf_mg_nocontext) #define Perl_sv_setpvf_mg_nocontext DPPP_(my_sv_setpvf_mg_nocontext) #if defined(NEED_sv_setpvf_mg_nocontext) || defined(NEED_sv_setpvf_mg_nocontext_GLOBAL) -void -DPPP_(my_sv_setpvf_mg_nocontext)(SV *sv, const char *pat, ...) + void + DPPP_(my_sv_setpvf_mg_nocontext)(SV * sv, const char * pat, ...) { -dTHX; -va_list args; -va_start(args, pat); -sv_vsetpvfn(sv, pat, strlen(pat), &args, Null(SV**), 0, Null(bool*)); -SvSETMAGIC(sv); -va_end(args); + dTHX; + va_list args; + va_start(args, pat); + sv_vsetpvfn(sv, pat, strlen(pat), &args, Null(SV **), 0, Null(bool *)); + SvSETMAGIC(sv); + va_end(args); } #endif #endif @@ -1758,40 +1876,44 @@ va_end(args); #define sv_setpvf_mg Perl_sv_setpvf_mg #endif #endif -#if (PERL_BCDVERSION >= 0x5004000) && !defined(sv_vsetpvf_mg) -#define sv_vsetpvf_mg(sv, pat, args) \ -STMT_START { \ -sv_vsetpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*)); \ -SvSETMAGIC(sv); \ -} STMT_END +#if(PERL_BCDVERSION >= 0x5004000) && !defined(sv_vsetpvf_mg) +#define sv_vsetpvf_mg(sv, pat, args) \ + STMT_START \ + { \ + sv_vsetpvfn(sv, pat, strlen(pat), args, Null(SV **), 0, Null(bool *)); \ + SvSETMAGIC(sv); \ + } \ + STMT_END #endif #ifndef newSVpvn_share #if defined(NEED_newSVpvn_share) -static SV * DPPP_(my_newSVpvn_share)(pTHX_ const char *src, I32 len, U32 hash); +static SV * DPPP_(my_newSVpvn_share)(pTHX_ const char * src, I32 len, U32 hash); static #else -extern SV * DPPP_(my_newSVpvn_share)(pTHX_ const char *src, I32 len, U32 hash); +extern SV * DPPP_(my_newSVpvn_share)(pTHX_ const char * src, I32 len, U32 hash); #endif #ifdef newSVpvn_share #undef newSVpvn_share #endif -#define newSVpvn_share(a,b,c) DPPP_(my_newSVpvn_share)(aTHX_ a,b,c) +#define newSVpvn_share(a, b, c) \ + DPPP_(my_newSVpvn_share) \ + (aTHX_ a, b, c) #define Perl_newSVpvn_share DPPP_(my_newSVpvn_share) #if defined(NEED_newSVpvn_share) || defined(NEED_newSVpvn_share_GLOBAL) -SV * -DPPP_(my_newSVpvn_share)(pTHX_ const char *src, I32 len, U32 hash) + SV * + DPPP_(my_newSVpvn_share)(pTHX_ const char * src, I32 len, U32 hash) { -SV *sv; -if (len < 0) -len = -len; -if (!hash) -PERL_HASH(hash, (char*) src, len); -sv = newSVpvn((char *) src, len); -sv_upgrade(sv, SVt_PVIV); -SvIVX(sv) = hash; -SvREADONLY_on(sv); -SvPOK_on(sv); -return sv; + SV * sv; + if(len < 0) + len = -len; + if(!hash) + PERL_HASH(hash, (char *)src, len); + sv = newSVpvn((char *)src, len); + sv_upgrade(sv, SVt_PVIV); + SvIVX(sv) = hash; + SvREADONLY_on(sv); + SvPOK_on(sv); + return sv; } #endif #endif @@ -1970,33 +2092,33 @@ return sv; #define ckWARN(a) PL_dowarn #endif #endif -#if (PERL_BCDVERSION >= 0x5004000) && !defined(warner) +#if(PERL_BCDVERSION >= 0x5004000) && !defined(warner) #if defined(NEED_warner) -static void DPPP_(my_warner)(U32 err, const char *pat, ...); +static void DPPP_(my_warner)(U32 err, const char * pat, ...); static #else -extern void DPPP_(my_warner)(U32 err, const char *pat, ...); +extern void DPPP_(my_warner)(U32 err, const char * pat, ...); #endif #define Perl_warner DPPP_(my_warner) #if defined(NEED_warner) || defined(NEED_warner_GLOBAL) -void -DPPP_(my_warner)(U32 err, const char *pat, ...) + void + DPPP_(my_warner)(U32 err, const char * pat, ...) { -SV *sv; -va_list args; -PERL_UNUSED_ARG(err); -va_start(args, pat); -sv = vnewSVpvf(pat, &args); -va_end(args); -sv_2mortal(sv); -warn("%s", SvPV_nolen(sv)); + SV * sv; + va_list args; + PERL_UNUSED_ARG(err); + va_start(args, pat); + sv = vnewSVpvf(pat, &args); + va_end(args); + sv_2mortal(sv); + warn("%s", SvPV_nolen(sv)); } #define warner Perl_warner #define Perl_warner_nocontext Perl_warner #endif #endif #ifndef STR_WITH_LEN -#define STR_WITH_LEN(s) (s ""), (sizeof(s)-1) +#define STR_WITH_LEN(s) (s ""), (sizeof(s) - 1) #endif #ifndef newSVpvs #define newSVpvs(str) newSVpvn(str "", sizeof(str) - 1) @@ -2026,18 +2148,28 @@ warn("%s", SvPV_nolen(sv)); #define gv_stashpvs(name, flags) gv_stashpvn(name "", sizeof(name) - 1, flags) #endif #ifndef get_cvs -#define get_cvs(name, flags) get_cvn_flags(name "", sizeof(name)-1, flags) +#define get_cvs(name, flags) get_cvn_flags(name "", sizeof(name) - 1, flags) #endif #ifndef SvGETMAGIC -#define SvGETMAGIC(x) STMT_START { if (SvGMAGICAL(x)) mg_get(x); } STMT_END +#define SvGETMAGIC(x) \ + STMT_START \ + { \ + if(SvGMAGICAL(x)) \ + mg_get(x); \ + } \ + STMT_END #endif #ifndef HEf_SVKEY #define HEf_SVKEY -2 #endif #if defined(__GNUC__) && !defined(PERL_GCC_BRACE_GROUPS_FORBIDDEN) -#define MUTABLE_PTR(p) ({ void *_p = (p); _p; }) +#define MUTABLE_PTR(p) ( \ + { \ + void * _p = (p); \ + _p; \ + }) #else -#define MUTABLE_PTR(p) ((void *) (p)) +#define MUTABLE_PTR(p) ((void *)(p)) #endif #define MUTABLE_SV(p) ((SV *)MUTABLE_PTR(p)) #ifndef PERL_MAGIC_sv @@ -2176,134 +2308,159 @@ warn("%s", SvPV_nolen(sv)); #define SvUV_nomg SvUV #endif #ifndef sv_catpv_mg -#define sv_catpv_mg(sv, ptr) \ -STMT_START { \ -SV *TeMpSv = sv; \ -sv_catpv(TeMpSv,ptr); \ -SvSETMAGIC(TeMpSv); \ -} STMT_END +#define sv_catpv_mg(sv, ptr) \ + STMT_START \ + { \ + SV * TeMpSv = sv; \ + sv_catpv(TeMpSv, ptr); \ + SvSETMAGIC(TeMpSv); \ + } \ + STMT_END #endif #ifndef sv_catpvn_mg -#define sv_catpvn_mg(sv, ptr, len) \ -STMT_START { \ -SV *TeMpSv = sv; \ -sv_catpvn(TeMpSv,ptr,len); \ -SvSETMAGIC(TeMpSv); \ -} STMT_END +#define sv_catpvn_mg(sv, ptr, len) \ + STMT_START \ + { \ + SV * TeMpSv = sv; \ + sv_catpvn(TeMpSv, ptr, len); \ + SvSETMAGIC(TeMpSv); \ + } \ + STMT_END #endif #ifndef sv_catsv_mg -#define sv_catsv_mg(dsv, ssv) \ -STMT_START { \ -SV *TeMpSv = dsv; \ -sv_catsv(TeMpSv,ssv); \ -SvSETMAGIC(TeMpSv); \ -} STMT_END +#define sv_catsv_mg(dsv, ssv) \ + STMT_START \ + { \ + SV * TeMpSv = dsv; \ + sv_catsv(TeMpSv, ssv); \ + SvSETMAGIC(TeMpSv); \ + } \ + STMT_END #endif #ifndef sv_setiv_mg -#define sv_setiv_mg(sv, i) \ -STMT_START { \ -SV *TeMpSv = sv; \ -sv_setiv(TeMpSv,i); \ -SvSETMAGIC(TeMpSv); \ -} STMT_END +#define sv_setiv_mg(sv, i) \ + STMT_START \ + { \ + SV * TeMpSv = sv; \ + sv_setiv(TeMpSv, i); \ + SvSETMAGIC(TeMpSv); \ + } \ + STMT_END #endif #ifndef sv_setnv_mg -#define sv_setnv_mg(sv, num) \ -STMT_START { \ -SV *TeMpSv = sv; \ -sv_setnv(TeMpSv,num); \ -SvSETMAGIC(TeMpSv); \ -} STMT_END +#define sv_setnv_mg(sv, num) \ + STMT_START \ + { \ + SV * TeMpSv = sv; \ + sv_setnv(TeMpSv, num); \ + SvSETMAGIC(TeMpSv); \ + } \ + STMT_END #endif #ifndef sv_setpv_mg -#define sv_setpv_mg(sv, ptr) \ -STMT_START { \ -SV *TeMpSv = sv; \ -sv_setpv(TeMpSv,ptr); \ -SvSETMAGIC(TeMpSv); \ -} STMT_END +#define sv_setpv_mg(sv, ptr) \ + STMT_START \ + { \ + SV * TeMpSv = sv; \ + sv_setpv(TeMpSv, ptr); \ + SvSETMAGIC(TeMpSv); \ + } \ + STMT_END #endif #ifndef sv_setpvn_mg -#define sv_setpvn_mg(sv, ptr, len) \ -STMT_START { \ -SV *TeMpSv = sv; \ -sv_setpvn(TeMpSv,ptr,len); \ -SvSETMAGIC(TeMpSv); \ -} STMT_END +#define sv_setpvn_mg(sv, ptr, len) \ + STMT_START \ + { \ + SV * TeMpSv = sv; \ + sv_setpvn(TeMpSv, ptr, len); \ + SvSETMAGIC(TeMpSv); \ + } \ + STMT_END #endif #ifndef sv_setsv_mg -#define sv_setsv_mg(dsv, ssv) \ -STMT_START { \ -SV *TeMpSv = dsv; \ -sv_setsv(TeMpSv,ssv); \ -SvSETMAGIC(TeMpSv); \ -} STMT_END +#define sv_setsv_mg(dsv, ssv) \ + STMT_START \ + { \ + SV * TeMpSv = dsv; \ + sv_setsv(TeMpSv, ssv); \ + SvSETMAGIC(TeMpSv); \ + } \ + STMT_END #endif #ifndef sv_setuv_mg -#define sv_setuv_mg(sv, i) \ -STMT_START { \ -SV *TeMpSv = sv; \ -sv_setuv(TeMpSv,i); \ -SvSETMAGIC(TeMpSv); \ -} STMT_END +#define sv_setuv_mg(sv, i) \ + STMT_START \ + { \ + SV * TeMpSv = sv; \ + sv_setuv(TeMpSv, i); \ + SvSETMAGIC(TeMpSv); \ + } \ + STMT_END #endif #ifndef sv_usepvn_mg -#define sv_usepvn_mg(sv, ptr, len) \ -STMT_START { \ -SV *TeMpSv = sv; \ -sv_usepvn(TeMpSv,ptr,len); \ -SvSETMAGIC(TeMpSv); \ -} STMT_END +#define sv_usepvn_mg(sv, ptr, len) \ + STMT_START \ + { \ + SV * TeMpSv = sv; \ + sv_usepvn(TeMpSv, ptr, len); \ + SvSETMAGIC(TeMpSv); \ + } \ + STMT_END #endif #ifndef SvVSTRING_mg #define SvVSTRING_mg(sv) (SvMAGICAL(sv) ? mg_find(sv, PERL_MAGIC_vstring) : NULL) #endif -#if (PERL_BCDVERSION < 0x5004000) -#elif (PERL_BCDVERSION < 0x5008000) -#define sv_magic_portable(sv, obj, how, name, namlen) \ -STMT_START { \ -SV *SvMp_sv = (sv); \ -char *SvMp_name = (char *) (name); \ -I32 SvMp_namlen = (namlen); \ -if (SvMp_name && SvMp_namlen == 0) \ -{ \ -MAGIC *mg; \ -sv_magic(SvMp_sv, obj, how, 0, 0); \ -mg = SvMAGIC(SvMp_sv); \ -mg->mg_len = -42; \ -mg->mg_ptr = SvMp_name; \ -} \ -else \ -{ \ -sv_magic(SvMp_sv, obj, how, SvMp_name, SvMp_namlen); \ -} \ -} STMT_END +#if(PERL_BCDVERSION < 0x5004000) +#elif(PERL_BCDVERSION < 0x5008000) +#define sv_magic_portable(sv, obj, how, name, namlen) \ + STMT_START \ + { \ + SV * SvMp_sv = (sv); \ + char * SvMp_name = (char *)(name); \ + I32 SvMp_namlen = (namlen); \ + if(SvMp_name && SvMp_namlen == 0) \ + { \ + MAGIC * mg; \ + sv_magic(SvMp_sv, obj, how, 0, 0); \ + mg = SvMAGIC(SvMp_sv); \ + mg->mg_len = -42; \ + mg->mg_ptr = SvMp_name; \ + } \ + else \ + { \ + sv_magic(SvMp_sv, obj, how, SvMp_name, SvMp_namlen); \ + } \ + } \ + STMT_END #else #define sv_magic_portable(a, b, c, d, e) sv_magic(a, b, c, d, e) #endif #if !defined(mg_findext) #if defined(NEED_mg_findext) -static MAGIC * DPPP_(my_mg_findext)(SV * sv, int type, const MGVTBL *vtbl); +static MAGIC * DPPP_(my_mg_findext)(SV * sv, int type, const MGVTBL * vtbl); static #else -extern MAGIC * DPPP_(my_mg_findext)(SV * sv, int type, const MGVTBL *vtbl); +extern MAGIC * DPPP_(my_mg_findext)(SV * sv, int type, const MGVTBL * vtbl); #endif #define mg_findext DPPP_(my_mg_findext) #define Perl_mg_findext DPPP_(my_mg_findext) #if defined(NEED_mg_findext) || defined(NEED_mg_findext_GLOBAL) -MAGIC * -DPPP_(my_mg_findext)(SV * sv, int type, const MGVTBL *vtbl) { -if (sv) { -MAGIC *mg; + MAGIC * + DPPP_(my_mg_findext)(SV * sv, int type, const MGVTBL * vtbl) +{ + if(sv) + { + MAGIC * mg; #ifdef AvPAD_NAMELIST -assert(!(SvTYPE(sv) == SVt_PVAV && AvPAD_NAMELIST(sv))); + assert(!(SvTYPE(sv) == SVt_PVAV && AvPAD_NAMELIST(sv))); #endif -for (mg = SvMAGIC (sv); mg; mg = mg->mg_moremagic) { -if (mg->mg_type == type && mg->mg_virtual == vtbl) -return mg; -} -} -return NULL; + for(mg = SvMAGIC(sv); mg; mg = mg->mg_moremagic) + { + if(mg->mg_type == type && mg->mg_virtual == vtbl) + return mg; + } + } + return NULL; } #endif #endif @@ -2317,47 +2474,54 @@ extern int DPPP_(my_sv_unmagicext)(pTHX_ SV * const sv, const int type, MGVTBL * #ifdef sv_unmagicext #undef sv_unmagicext #endif -#define sv_unmagicext(a,b,c) DPPP_(my_sv_unmagicext)(aTHX_ a,b,c) +#define sv_unmagicext(a, b, c) \ + DPPP_(my_sv_unmagicext) \ + (aTHX_ a, b, c) #define Perl_sv_unmagicext DPPP_(my_sv_unmagicext) #if defined(NEED_sv_unmagicext) || defined(NEED_sv_unmagicext_GLOBAL) -int -DPPP_(my_sv_unmagicext)(pTHX_ SV *const sv, const int type, MGVTBL *vtbl) + int + DPPP_(my_sv_unmagicext)(pTHX_ SV * const sv, const int type, MGVTBL * vtbl) { -MAGIC* mg; -MAGIC** mgp; -if (SvTYPE(sv) < SVt_PVMG || !SvMAGIC(sv)) -return 0; -mgp = &(SvMAGIC(sv)); -for (mg = *mgp; mg; mg = *mgp) { -const MGVTBL* const virt = mg->mg_virtual; -if (mg->mg_type == type && virt == vtbl) { -*mgp = mg->mg_moremagic; -if (virt && virt->svt_free) -virt->svt_free(aTHX_ sv, mg); -if (mg->mg_ptr && mg->mg_type != PERL_MAGIC_regex_global) { -if (mg->mg_len > 0) -Safefree(mg->mg_ptr); -else if (mg->mg_len == HEf_SVKEY) -SvREFCNT_dec(MUTABLE_SV(mg->mg_ptr)); -else if (mg->mg_type == PERL_MAGIC_utf8) -Safefree(mg->mg_ptr); -} -if (mg->mg_flags & MGf_REFCOUNTED) -SvREFCNT_dec(mg->mg_obj); -Safefree(mg); -} -else -mgp = &mg->mg_moremagic; -} -if (SvMAGIC(sv)) { -if (SvMAGICAL(sv)) -mg_magical(sv); -} -else { -SvMAGICAL_off(sv); -SvFLAGS(sv) |= (SvFLAGS(sv) & (SVp_IOK|SVp_NOK|SVp_POK)) >> PRIVSHIFT; -} -return 0; + MAGIC * mg; + MAGIC ** mgp; + if(SvTYPE(sv) < SVt_PVMG || !SvMAGIC(sv)) + return 0; + mgp = &(SvMAGIC(sv)); + for(mg = *mgp; mg; mg = *mgp) + { + const MGVTBL * const virt = mg->mg_virtual; + if(mg->mg_type == type && virt == vtbl) + { + *mgp = mg->mg_moremagic; + if(virt && virt->svt_free) + virt->svt_free(aTHX_ sv, mg); + if(mg->mg_ptr && mg->mg_type != PERL_MAGIC_regex_global) + { + if(mg->mg_len > 0) + Safefree(mg->mg_ptr); + else if(mg->mg_len == HEf_SVKEY) + SvREFCNT_dec(MUTABLE_SV(mg->mg_ptr)); + else if(mg->mg_type == PERL_MAGIC_utf8) + Safefree(mg->mg_ptr); + } + if(mg->mg_flags & MGf_REFCOUNTED) + SvREFCNT_dec(mg->mg_obj); + Safefree(mg); + } + else + mgp = &mg->mg_moremagic; + } + if(SvMAGIC(sv)) + { + if(SvMAGICAL(sv)) + mg_magical(sv); + } + else + { + SvMAGICAL_off(sv); + SvFLAGS(sv) |= (SvFLAGS(sv) & (SVp_IOK | SVp_NOK | SVp_POK)) >> PRIVSHIFT; + } + return 0; } #endif #endif @@ -2369,7 +2533,7 @@ return 0; #define CopFILEGV(c) (CopFILE(c) ? gv_fetchfile(CopFILE(c)) : Nullgv) #endif #ifndef CopFILE_set -#define CopFILE_set(c,pv) ((c)->cop_file = savepv(pv)) +#define CopFILE_set(c, pv) ((c)->cop_file = savepv(pv)) #endif #ifndef CopFILESV #define CopFILESV(c) (CopFILE(c) ? GvSV(gv_fetchfile(CopFILE(c))) : Nullsv) @@ -2381,28 +2545,28 @@ return 0; #define CopSTASHPV(c) ((c)->cop_stashpv) #endif #ifndef CopSTASHPV_set -#define CopSTASHPV_set(c,pv) ((c)->cop_stashpv = ((pv) ? savepv(pv) : Nullch)) +#define CopSTASHPV_set(c, pv) ((c)->cop_stashpv = ((pv) ? savepv(pv) : Nullch)) #endif #ifndef CopSTASH -#define CopSTASH(c) (CopSTASHPV(c) ? gv_stashpv(CopSTASHPV(c),GV_ADD) : Nullhv) +#define CopSTASH(c) (CopSTASHPV(c) ? gv_stashpv(CopSTASHPV(c), GV_ADD) : Nullhv) #endif #ifndef CopSTASH_set -#define CopSTASH_set(c,hv) CopSTASHPV_set(c, (hv) ? HvNAME(hv) : Nullch) +#define CopSTASH_set(c, hv) CopSTASHPV_set(c, (hv) ? HvNAME(hv) : Nullch) #endif #ifndef CopSTASH_eq -#define CopSTASH_eq(c,hv) ((hv) && (CopSTASHPV(c) == HvNAME(hv) \ -|| (CopSTASHPV(c) && HvNAME(hv) \ -&& strEQ(CopSTASHPV(c), HvNAME(hv))))) +#define CopSTASH_eq(c, hv) ((hv) && (CopSTASHPV(c) == HvNAME(hv) \ + || (CopSTASHPV(c) && HvNAME(hv) \ + && strEQ(CopSTASHPV(c), HvNAME(hv))))) #endif #else #ifndef CopFILEGV #define CopFILEGV(c) ((c)->cop_filegv) #endif #ifndef CopFILEGV_set -#define CopFILEGV_set(c,gv) ((c)->cop_filegv = (GV*)SvREFCNT_inc(gv)) +#define CopFILEGV_set(c, gv) ((c)->cop_filegv = (GV *)SvREFCNT_inc(gv)) #endif #ifndef CopFILE_set -#define CopFILE_set(c,pv) CopFILEGV_set((c), gv_fetchfile(pv)) +#define CopFILE_set(c, pv) CopFILEGV_set((c), gv_fetchfile(pv)) #endif #ifndef CopFILESV #define CopFILESV(c) (CopFILEGV(c) ? GvSV(CopFILEGV(c)) : Nullsv) @@ -2417,81 +2581,88 @@ return 0; #define CopSTASH(c) ((c)->cop_stash) #endif #ifndef CopSTASH_set -#define CopSTASH_set(c,hv) ((c)->cop_stash = (hv)) +#define CopSTASH_set(c, hv) ((c)->cop_stash = (hv)) #endif #ifndef CopSTASHPV #define CopSTASHPV(c) (CopSTASH(c) ? HvNAME(CopSTASH(c)) : Nullch) #endif #ifndef CopSTASHPV_set -#define CopSTASHPV_set(c,pv) CopSTASH_set((c), gv_stashpv(pv,GV_ADD)) +#define CopSTASHPV_set(c, pv) CopSTASH_set((c), gv_stashpv(pv, GV_ADD)) #endif #ifndef CopSTASH_eq -#define CopSTASH_eq(c,hv) (CopSTASH(c) == (hv)) +#define CopSTASH_eq(c, hv) (CopSTASH(c) == (hv)) #endif #endif -#if (PERL_BCDVERSION >= 0x5006000) +#if(PERL_BCDVERSION >= 0x5006000) #ifndef caller_cx #if defined(NEED_caller_cx) || defined(NEED_caller_cx_GLOBAL) static I32 -DPPP_dopoptosub_at(const PERL_CONTEXT *cxstk, I32 startingblock) +DPPP_dopoptosub_at(const PERL_CONTEXT * cxstk, I32 startingblock) { -I32 i; -for (i = startingblock; i >= 0; i--) { -register const PERL_CONTEXT * const cx = &cxstk[i]; -switch (CxTYPE(cx)) { -default: -continue; -case CXt_EVAL: -case CXt_SUB: -case CXt_FORMAT: -return i; -} -} -return i; + I32 i; + for(i = startingblock; i >= 0; i--) + { + register const PERL_CONTEXT * const cx = &cxstk[i]; + switch(CxTYPE(cx)) + { + default: + continue; + case CXt_EVAL: + case CXt_SUB: + case CXt_FORMAT: + return i; + } + } + return i; } #endif #if defined(NEED_caller_cx) -static const PERL_CONTEXT * DPPP_(my_caller_cx)(pTHX_ I32 count, const PERL_CONTEXT **dbcxp); +static const PERL_CONTEXT * DPPP_(my_caller_cx)(pTHX_ I32 count, const PERL_CONTEXT ** dbcxp); static #else -extern const PERL_CONTEXT * DPPP_(my_caller_cx)(pTHX_ I32 count, const PERL_CONTEXT **dbcxp); +extern const PERL_CONTEXT * DPPP_(my_caller_cx)(pTHX_ I32 count, const PERL_CONTEXT ** dbcxp); #endif #ifdef caller_cx #undef caller_cx #endif -#define caller_cx(a,b) DPPP_(my_caller_cx)(aTHX_ a,b) +#define caller_cx(a, b) \ + DPPP_(my_caller_cx) \ + (aTHX_ a, b) #define Perl_caller_cx DPPP_(my_caller_cx) #if defined(NEED_caller_cx) || defined(NEED_caller_cx_GLOBAL) -const PERL_CONTEXT * -DPPP_(my_caller_cx)(pTHX_ I32 count, const PERL_CONTEXT **dbcxp) + const PERL_CONTEXT * + DPPP_(my_caller_cx)(pTHX_ I32 count, const PERL_CONTEXT ** dbcxp) { -register I32 cxix = DPPP_dopoptosub_at(cxstack, cxstack_ix); -register const PERL_CONTEXT *cx; -register const PERL_CONTEXT *ccstack = cxstack; -const PERL_SI *top_si = PL_curstackinfo; -for (;;) { -while (cxix < 0 && top_si->si_type != PERLSI_MAIN) { -top_si = top_si->si_prev; -ccstack = top_si->si_cxstack; -cxix = DPPP_dopoptosub_at(ccstack, top_si->si_cxix); -} -if (cxix < 0) -return NULL; -if (PL_DBsub && GvCV(PL_DBsub) && cxix >= 0 && -ccstack[cxix].blk_sub.cv == GvCV(PL_DBsub)) -count++; -if (!count--) -break; -cxix = DPPP_dopoptosub_at(ccstack, cxix - 1); -} -cx = &ccstack[cxix]; -if (dbcxp) *dbcxp = cx; -if (CxTYPE(cx) == CXt_SUB || CxTYPE(cx) == CXt_FORMAT) { -const I32 dbcxix = DPPP_dopoptosub_at(ccstack, cxix - 1); -if (PL_DBsub && GvCV(PL_DBsub) && dbcxix >= 0 && ccstack[dbcxix].blk_sub.cv == GvCV(PL_DBsub)) -cx = &ccstack[dbcxix]; -} -return cx; + register I32 cxix = DPPP_dopoptosub_at(cxstack, cxstack_ix); + register const PERL_CONTEXT * cx; + register const PERL_CONTEXT * ccstack = cxstack; + const PERL_SI * top_si = PL_curstackinfo; + for(;;) + { + while(cxix < 0 && top_si->si_type != PERLSI_MAIN) + { + top_si = top_si->si_prev; + ccstack = top_si->si_cxstack; + cxix = DPPP_dopoptosub_at(ccstack, top_si->si_cxix); + } + if(cxix < 0) + return NULL; + if(PL_DBsub && GvCV(PL_DBsub) && cxix >= 0 && ccstack[cxix].blk_sub.cv == GvCV(PL_DBsub)) + count++; + if(!count--) + break; + cxix = DPPP_dopoptosub_at(ccstack, cxix - 1); + } + cx = &ccstack[cxix]; + if(dbcxp) + *dbcxp = cx; + if(CxTYPE(cx) == CXt_SUB || CxTYPE(cx) == CXt_FORMAT) + { + const I32 dbcxix = DPPP_dopoptosub_at(ccstack, cxix - 1); + if(PL_DBsub && GvCV(PL_DBsub) && dbcxix >= 0 && ccstack[dbcxix].blk_sub.cv == GvCV(PL_DBsub)) + cx = &ccstack[dbcxix]; + } + return cx; } #endif #endif @@ -2551,41 +2722,48 @@ extern bool DPPP_(my_grok_numeric_radix)(pTHX_ const char ** sp, const char * se #ifdef grok_numeric_radix #undef grok_numeric_radix #endif -#define grok_numeric_radix(a,b) DPPP_(my_grok_numeric_radix)(aTHX_ a,b) +#define grok_numeric_radix(a, b) \ + DPPP_(my_grok_numeric_radix) \ + (aTHX_ a, b) #define Perl_grok_numeric_radix DPPP_(my_grok_numeric_radix) #if defined(NEED_grok_numeric_radix) || defined(NEED_grok_numeric_radix_GLOBAL) -bool -DPPP_(my_grok_numeric_radix)(pTHX_ const char **sp, const char *send) + bool + DPPP_(my_grok_numeric_radix)(pTHX_ const char ** sp, const char * send) { #ifdef USE_LOCALE_NUMERIC #ifdef PL_numeric_radix_sv -if (PL_numeric_radix_sv && IN_LOCALE) { -STRLEN len; -char* radix = SvPV(PL_numeric_radix_sv, len); -if (*sp + len <= send && memEQ(*sp, radix, len)) { -*sp += len; -return TRUE; -} -} + if(PL_numeric_radix_sv && IN_LOCALE) + { + STRLEN len; + char * radix = SvPV(PL_numeric_radix_sv, len); + if(*sp + len <= send && memEQ(*sp, radix, len)) + { + *sp += len; + return TRUE; + } + } #else #include -dTHR; -struct lconv *lc = localeconv(); -char *radix = lc->decimal_point; -if (radix && IN_LOCALE) { -STRLEN len = strlen(radix); -if (*sp + len <= send && memEQ(*sp, radix, len)) { -*sp += len; -return TRUE; -} -} + dTHR; + struct lconv * lc = localeconv(); + char * radix = lc->decimal_point; + if(radix && IN_LOCALE) + { + STRLEN len = strlen(radix); + if(*sp + len <= send && memEQ(*sp, radix, len)) + { + *sp += len; + return TRUE; + } + } #endif #endif -if (*sp < send && **sp == '.') { -++*sp; -return TRUE; -} -return FALSE; + if(*sp < send && **sp == '.') + { + ++*sp; + return TRUE; + } + return FALSE; } #endif #endif @@ -2599,175 +2777,237 @@ extern int DPPP_(my_grok_number)(pTHX_ const char * pv, STRLEN len, UV * valuep) #ifdef grok_number #undef grok_number #endif -#define grok_number(a,b,c) DPPP_(my_grok_number)(aTHX_ a,b,c) +#define grok_number(a, b, c) \ + DPPP_(my_grok_number) \ + (aTHX_ a, b, c) #define Perl_grok_number DPPP_(my_grok_number) #if defined(NEED_grok_number) || defined(NEED_grok_number_GLOBAL) -int -DPPP_(my_grok_number)(pTHX_ const char *pv, STRLEN len, UV *valuep) + int + DPPP_(my_grok_number)(pTHX_ const char * pv, STRLEN len, UV * valuep) { -const char *s = pv; -const char *send = pv + len; -const UV max_div_10 = UV_MAX / 10; -const char max_mod_10 = UV_MAX % 10; -int numtype = 0; -int sawinf = 0; -int sawnan = 0; -while (s < send && isSPACE(*s)) -s++; -if (s == send) { -return 0; -} else if (*s == '-') { -s++; -numtype = IS_NUMBER_NEG; -} -else if (*s == '+') -s++; -if (s == send) -return 0; -if (isDIGIT(*s)) { -UV value = *s - '0'; -if (++s < send) { -int digit = *s - '0'; -if (digit >= 0 && digit <= 9) { -value = value * 10 + digit; -if (++s < send) { -digit = *s - '0'; -if (digit >= 0 && digit <= 9) { -value = value * 10 + digit; -if (++s < send) { -digit = *s - '0'; -if (digit >= 0 && digit <= 9) { -value = value * 10 + digit; -if (++s < send) { -digit = *s - '0'; -if (digit >= 0 && digit <= 9) { -value = value * 10 + digit; -if (++s < send) { -digit = *s - '0'; -if (digit >= 0 && digit <= 9) { -value = value * 10 + digit; -if (++s < send) { -digit = *s - '0'; -if (digit >= 0 && digit <= 9) { -value = value * 10 + digit; -if (++s < send) { -digit = *s - '0'; -if (digit >= 0 && digit <= 9) { -value = value * 10 + digit; -if (++s < send) { -digit = *s - '0'; -if (digit >= 0 && digit <= 9) { -value = value * 10 + digit; -if (++s < send) { -digit = *s - '0'; -while (digit >= 0 && digit <= 9 -&& (value < max_div_10 -|| (value == max_div_10 -&& digit <= max_mod_10))) { -value = value * 10 + digit; -if (++s < send) -digit = *s - '0'; -else -break; -} -if (digit >= 0 && digit <= 9 -&& (s < send)) { -do { -s++; -} while (s < send && isDIGIT(*s)); -numtype |= -IS_NUMBER_GREATER_THAN_UV_MAX; -goto skip_value; -} -} -} -} -} -} -} -} -} -} -} -} -} -} -} -} -} -} -numtype |= IS_NUMBER_IN_UV; -if (valuep) -*valuep = value; -skip_value: -if (GROK_NUMERIC_RADIX(&s, send)) { -numtype |= IS_NUMBER_NOT_INT; -while (s < send && isDIGIT(*s)) -s++; -} -} -else if (GROK_NUMERIC_RADIX(&s, send)) { -numtype |= IS_NUMBER_NOT_INT | IS_NUMBER_IN_UV; -if (s < send && isDIGIT(*s)) { -do { -s++; -} while (s < send && isDIGIT(*s)); -if (valuep) { -*valuep = 0; -} -} -else -return 0; -} else if (*s == 'I' || *s == 'i') { -s++; if (s == send || (*s != 'N' && *s != 'n')) return 0; -s++; if (s == send || (*s != 'F' && *s != 'f')) return 0; -s++; if (s < send && (*s == 'I' || *s == 'i')) { -s++; if (s == send || (*s != 'N' && *s != 'n')) return 0; -s++; if (s == send || (*s != 'I' && *s != 'i')) return 0; -s++; if (s == send || (*s != 'T' && *s != 't')) return 0; -s++; if (s == send || (*s != 'Y' && *s != 'y')) return 0; -s++; -} -sawinf = 1; -} else if (*s == 'N' || *s == 'n') { -s++; if (s == send || (*s != 'A' && *s != 'a')) return 0; -s++; if (s == send || (*s != 'N' && *s != 'n')) return 0; -s++; -sawnan = 1; -} else -return 0; -if (sawinf) { -numtype &= IS_NUMBER_NEG; -numtype |= IS_NUMBER_INFINITY | IS_NUMBER_NOT_INT; -} else if (sawnan) { -numtype &= IS_NUMBER_NEG; -numtype |= IS_NUMBER_NAN | IS_NUMBER_NOT_INT; -} else if (s < send) { -if (*s == 'e' || *s == 'E') { -numtype &= IS_NUMBER_NEG; -numtype |= IS_NUMBER_NOT_INT; -s++; -if (s < send && (*s == '-' || *s == '+')) -s++; -if (s < send && isDIGIT(*s)) { -do { -s++; -} while (s < send && isDIGIT(*s)); -} -else -return 0; -} -} -while (s < send && isSPACE(*s)) -s++; -if (s >= send) -return numtype; -if (len == 10 && memEQ(pv, "0 but true", 10)) { -if (valuep) -*valuep = 0; -return IS_NUMBER_IN_UV; -} -return 0; + const char * s = pv; + const char * send = pv + len; + const UV max_div_10 = UV_MAX / 10; + const char max_mod_10 = UV_MAX % 10; + int numtype = 0; + int sawinf = 0; + int sawnan = 0; + while(s < send && isSPACE(*s)) + s++; + if(s == send) + { + return 0; + } + else if(*s == '-') + { + s++; + numtype = IS_NUMBER_NEG; + } + else if(*s == '+') + s++; + if(s == send) + return 0; + if(isDIGIT(*s)) + { + UV value = *s - '0'; + if(++s < send) + { + int digit = *s - '0'; + if(digit >= 0 && digit <= 9) + { + value = value * 10 + digit; + if(++s < send) + { + digit = *s - '0'; + if(digit >= 0 && digit <= 9) + { + value = value * 10 + digit; + if(++s < send) + { + digit = *s - '0'; + if(digit >= 0 && digit <= 9) + { + value = value * 10 + digit; + if(++s < send) + { + digit = *s - '0'; + if(digit >= 0 && digit <= 9) + { + value = value * 10 + digit; + if(++s < send) + { + digit = *s - '0'; + if(digit >= 0 && digit <= 9) + { + value = value * 10 + digit; + if(++s < send) + { + digit = *s - '0'; + if(digit >= 0 && digit <= 9) + { + value = value * 10 + digit; + if(++s < send) + { + digit = *s - '0'; + if(digit >= 0 && digit <= 9) + { + value = value * 10 + digit; + if(++s < send) + { + digit = *s - '0'; + if(digit >= 0 && digit <= 9) + { + value = value * 10 + digit; + if(++s < send) + { + digit = *s - '0'; + while(digit >= 0 && digit <= 9 + && (value < max_div_10 + || (value == max_div_10 + && digit <= max_mod_10))) + { + value = value * 10 + digit; + if(++s < send) + digit = *s - '0'; + else + break; + } + if(digit >= 0 && digit <= 9 + && (s < send)) + { + do + { + s++; + } while(s < send && isDIGIT(*s)); + numtype |= IS_NUMBER_GREATER_THAN_UV_MAX; + goto skip_value; + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + } + numtype |= IS_NUMBER_IN_UV; + if(valuep) + *valuep = value; + skip_value: + if(GROK_NUMERIC_RADIX(&s, send)) + { + numtype |= IS_NUMBER_NOT_INT; + while(s < send && isDIGIT(*s)) + s++; + } + } + else if(GROK_NUMERIC_RADIX(&s, send)) + { + numtype |= IS_NUMBER_NOT_INT | IS_NUMBER_IN_UV; + if(s < send && isDIGIT(*s)) + { + do + { + s++; + } while(s < send && isDIGIT(*s)); + if(valuep) + { + *valuep = 0; + } + } + else + return 0; + } + else if(*s == 'I' || *s == 'i') + { + s++; + if(s == send || (*s != 'N' && *s != 'n')) + return 0; + s++; + if(s == send || (*s != 'F' && *s != 'f')) + return 0; + s++; + if(s < send && (*s == 'I' || *s == 'i')) + { + s++; + if(s == send || (*s != 'N' && *s != 'n')) + return 0; + s++; + if(s == send || (*s != 'I' && *s != 'i')) + return 0; + s++; + if(s == send || (*s != 'T' && *s != 't')) + return 0; + s++; + if(s == send || (*s != 'Y' && *s != 'y')) + return 0; + s++; + } + sawinf = 1; + } + else if(*s == 'N' || *s == 'n') + { + s++; + if(s == send || (*s != 'A' && *s != 'a')) + return 0; + s++; + if(s == send || (*s != 'N' && *s != 'n')) + return 0; + s++; + sawnan = 1; + } + else + return 0; + if(sawinf) + { + numtype &= IS_NUMBER_NEG; + numtype |= IS_NUMBER_INFINITY | IS_NUMBER_NOT_INT; + } + else if(sawnan) + { + numtype &= IS_NUMBER_NEG; + numtype |= IS_NUMBER_NAN | IS_NUMBER_NOT_INT; + } + else if(s < send) + { + if(*s == 'e' || *s == 'E') + { + numtype &= IS_NUMBER_NEG; + numtype |= IS_NUMBER_NOT_INT; + s++; + if(s < send && (*s == '-' || *s == '+')) + s++; + if(s < send && isDIGIT(*s)) + { + do + { + s++; + } while(s < send && isDIGIT(*s)); + } + else + return 0; + } + } + while(s < send && isSPACE(*s)) + s++; + if(s >= send) + return numtype; + if(len == 10 && memEQ(pv, "0 but true", 10)) + { + if(valuep) + *valuep = 0; + return IS_NUMBER_IN_UV; + } + return 0; } #endif #endif @@ -2781,75 +3021,87 @@ extern UV DPPP_(my_grok_bin)(pTHX_ const char * start, STRLEN * len_p, I32 * fla #ifdef grok_bin #undef grok_bin #endif -#define grok_bin(a,b,c,d) DPPP_(my_grok_bin)(aTHX_ a,b,c,d) +#define grok_bin(a, b, c, d) \ + DPPP_(my_grok_bin) \ + (aTHX_ a, b, c, d) #define Perl_grok_bin DPPP_(my_grok_bin) #if defined(NEED_grok_bin) || defined(NEED_grok_bin_GLOBAL) -UV -DPPP_(my_grok_bin)(pTHX_ const char *start, STRLEN *len_p, I32 *flags, NV *result) -{ -const char *s = start; -STRLEN len = *len_p; -UV value = 0; -NV value_nv = 0; -const UV max_div_2 = UV_MAX / 2; -bool allow_underscores = *flags & PERL_SCAN_ALLOW_UNDERSCORES; -bool overflowed = FALSE; -if (!(*flags & PERL_SCAN_DISALLOW_PREFIX)) { -if (len >= 1) { -if (s[0] == 'b') { -s++; -len--; -} -else if (len >= 2 && s[0] == '0' && s[1] == 'b') { -s+=2; -len-=2; -} -} -} -for (; len-- && *s; s++) { -char bit = *s; -if (bit == '0' || bit == '1') { -redo: -if (!overflowed) { -if (value <= max_div_2) { -value = (value << 1) | (bit - '0'); -continue; -} -warn("Integer overflow in binary number"); -overflowed = TRUE; -value_nv = (NV) value; -} -value_nv *= 2.0; -value_nv += (NV)(bit - '0'); -continue; -} -if (bit == '_' && len && allow_underscores && (bit = s[1]) -&& (bit == '0' || bit == '1')) + UV + DPPP_(my_grok_bin)(pTHX_ const char * start, STRLEN * len_p, I32 * flags, NV * result) { ---len; -++s; -goto redo; -} -if (!(*flags & PERL_SCAN_SILENT_ILLDIGIT)) -warn("Illegal binary digit '%c' ignored", *s); -break; -} -if ( ( overflowed && value_nv > 4294967295.0) + const char * s = start; + STRLEN len = *len_p; + UV value = 0; + NV value_nv = 0; + const UV max_div_2 = UV_MAX / 2; + bool allow_underscores = *flags & PERL_SCAN_ALLOW_UNDERSCORES; + bool overflowed = FALSE; + if(!(*flags & PERL_SCAN_DISALLOW_PREFIX)) + { + if(len >= 1) + { + if(s[0] == 'b') + { + s++; + len--; + } + else if(len >= 2 && s[0] == '0' && s[1] == 'b') + { + s += 2; + len -= 2; + } + } + } + for(; len-- && *s; s++) + { + char bit = *s; + if(bit == '0' || bit == '1') + { + redo: + if(!overflowed) + { + if(value <= max_div_2) + { + value = (value << 1) | (bit - '0'); + continue; + } + warn("Integer overflow in binary number"); + overflowed = TRUE; + value_nv = (NV)value; + } + value_nv *= 2.0; + value_nv += (NV)(bit - '0'); + continue; + } + if(bit == '_' && len && allow_underscores && (bit = s[1]) + && (bit == '0' || bit == '1')) + { + --len; + ++s; + goto redo; + } + if(!(*flags & PERL_SCAN_SILENT_ILLDIGIT)) + warn("Illegal binary digit '%c' ignored", *s); + break; + } + if((overflowed && value_nv > 4294967295.0) #if UVSIZE > 4 -|| (!overflowed && value > 0xffffffff ) + || (!overflowed && value > 0xffffffff) #endif -) { -warn("Binary number > 0b11111111111111111111111111111111 non-portable"); -} -*len_p = s - start; -if (!overflowed) { -*flags = 0; -return value; -} -*flags = PERL_SCAN_GREATER_THAN_UV_MAX; -if (result) -*result = value_nv; -return UV_MAX; + ) + { + warn("Binary number > 0b11111111111111111111111111111111 non-portable"); + } + *len_p = s - start; + if(!overflowed) + { + *flags = 0; + return value; + } + *flags = PERL_SCAN_GREATER_THAN_UV_MAX; + if(result) + *result = value_nv; + return UV_MAX; } #endif #endif @@ -2863,76 +3115,88 @@ extern UV DPPP_(my_grok_hex)(pTHX_ const char * start, STRLEN * len_p, I32 * fla #ifdef grok_hex #undef grok_hex #endif -#define grok_hex(a,b,c,d) DPPP_(my_grok_hex)(aTHX_ a,b,c,d) +#define grok_hex(a, b, c, d) \ + DPPP_(my_grok_hex) \ + (aTHX_ a, b, c, d) #define Perl_grok_hex DPPP_(my_grok_hex) #if defined(NEED_grok_hex) || defined(NEED_grok_hex_GLOBAL) -UV -DPPP_(my_grok_hex)(pTHX_ const char *start, STRLEN *len_p, I32 *flags, NV *result) -{ -const char *s = start; -STRLEN len = *len_p; -UV value = 0; -NV value_nv = 0; -const UV max_div_16 = UV_MAX / 16; -bool allow_underscores = *flags & PERL_SCAN_ALLOW_UNDERSCORES; -bool overflowed = FALSE; -const char *xdigit; -if (!(*flags & PERL_SCAN_DISALLOW_PREFIX)) { -if (len >= 1) { -if (s[0] == 'x') { -s++; -len--; -} -else if (len >= 2 && s[0] == '0' && s[1] == 'x') { -s+=2; -len-=2; -} -} -} -for (; len-- && *s; s++) { -xdigit = strchr((char *) PL_hexdigit, *s); -if (xdigit) { -redo: -if (!overflowed) { -if (value <= max_div_16) { -value = (value << 4) | ((xdigit - PL_hexdigit) & 15); -continue; -} -warn("Integer overflow in hexadecimal number"); -overflowed = TRUE; -value_nv = (NV) value; -} -value_nv *= 16.0; -value_nv += (NV)((xdigit - PL_hexdigit) & 15); -continue; -} -if (*s == '_' && len && allow_underscores && s[1] -&& (xdigit = strchr((char *) PL_hexdigit, s[1]))) + UV + DPPP_(my_grok_hex)(pTHX_ const char * start, STRLEN * len_p, I32 * flags, NV * result) { ---len; -++s; -goto redo; -} -if (!(*flags & PERL_SCAN_SILENT_ILLDIGIT)) -warn("Illegal hexadecimal digit '%c' ignored", *s); -break; -} -if ( ( overflowed && value_nv > 4294967295.0) + const char * s = start; + STRLEN len = *len_p; + UV value = 0; + NV value_nv = 0; + const UV max_div_16 = UV_MAX / 16; + bool allow_underscores = *flags & PERL_SCAN_ALLOW_UNDERSCORES; + bool overflowed = FALSE; + const char * xdigit; + if(!(*flags & PERL_SCAN_DISALLOW_PREFIX)) + { + if(len >= 1) + { + if(s[0] == 'x') + { + s++; + len--; + } + else if(len >= 2 && s[0] == '0' && s[1] == 'x') + { + s += 2; + len -= 2; + } + } + } + for(; len-- && *s; s++) + { + xdigit = strchr((char *)PL_hexdigit, *s); + if(xdigit) + { + redo: + if(!overflowed) + { + if(value <= max_div_16) + { + value = (value << 4) | ((xdigit - PL_hexdigit) & 15); + continue; + } + warn("Integer overflow in hexadecimal number"); + overflowed = TRUE; + value_nv = (NV)value; + } + value_nv *= 16.0; + value_nv += (NV)((xdigit - PL_hexdigit) & 15); + continue; + } + if(*s == '_' && len && allow_underscores && s[1] + && (xdigit = strchr((char *)PL_hexdigit, s[1]))) + { + --len; + ++s; + goto redo; + } + if(!(*flags & PERL_SCAN_SILENT_ILLDIGIT)) + warn("Illegal hexadecimal digit '%c' ignored", *s); + break; + } + if((overflowed && value_nv > 4294967295.0) #if UVSIZE > 4 -|| (!overflowed && value > 0xffffffff ) + || (!overflowed && value > 0xffffffff) #endif -) { -warn("Hexadecimal number > 0xffffffff non-portable"); -} -*len_p = s - start; -if (!overflowed) { -*flags = 0; -return value; -} -*flags = PERL_SCAN_GREATER_THAN_UV_MAX; -if (result) -*result = value_nv; -return UV_MAX; + ) + { + warn("Hexadecimal number > 0xffffffff non-portable"); + } + *len_p = s - start; + if(!overflowed) + { + *flags = 0; + return value; + } + *flags = PERL_SCAN_GREATER_THAN_UV_MAX; + if(result) + *result = value_nv; + return UV_MAX; } #endif #endif @@ -2946,65 +3210,74 @@ extern UV DPPP_(my_grok_oct)(pTHX_ const char * start, STRLEN * len_p, I32 * fla #ifdef grok_oct #undef grok_oct #endif -#define grok_oct(a,b,c,d) DPPP_(my_grok_oct)(aTHX_ a,b,c,d) +#define grok_oct(a, b, c, d) \ + DPPP_(my_grok_oct) \ + (aTHX_ a, b, c, d) #define Perl_grok_oct DPPP_(my_grok_oct) #if defined(NEED_grok_oct) || defined(NEED_grok_oct_GLOBAL) -UV -DPPP_(my_grok_oct)(pTHX_ const char *start, STRLEN *len_p, I32 *flags, NV *result) -{ -const char *s = start; -STRLEN len = *len_p; -UV value = 0; -NV value_nv = 0; -const UV max_div_8 = UV_MAX / 8; -bool allow_underscores = *flags & PERL_SCAN_ALLOW_UNDERSCORES; -bool overflowed = FALSE; -for (; len-- && *s; s++) { -int digit = *s - '0'; -if (digit >= 0 && digit <= 7) { -redo: -if (!overflowed) { -if (value <= max_div_8) { -value = (value << 3) | digit; -continue; -} -warn("Integer overflow in octal number"); -overflowed = TRUE; -value_nv = (NV) value; -} -value_nv *= 8.0; -value_nv += (NV)digit; -continue; -} -if (digit == ('_' - '0') && len && allow_underscores -&& (digit = s[1] - '0') && (digit >= 0 && digit <= 7)) + UV + DPPP_(my_grok_oct)(pTHX_ const char * start, STRLEN * len_p, I32 * flags, NV * result) { ---len; -++s; -goto redo; -} -if (digit == 8 || digit == 9) { -if (!(*flags & PERL_SCAN_SILENT_ILLDIGIT)) -warn("Illegal octal digit '%c' ignored", *s); -} -break; -} -if ( ( overflowed && value_nv > 4294967295.0) + const char * s = start; + STRLEN len = *len_p; + UV value = 0; + NV value_nv = 0; + const UV max_div_8 = UV_MAX / 8; + bool allow_underscores = *flags & PERL_SCAN_ALLOW_UNDERSCORES; + bool overflowed = FALSE; + for(; len-- && *s; s++) + { + int digit = *s - '0'; + if(digit >= 0 && digit <= 7) + { + redo: + if(!overflowed) + { + if(value <= max_div_8) + { + value = (value << 3) | digit; + continue; + } + warn("Integer overflow in octal number"); + overflowed = TRUE; + value_nv = (NV)value; + } + value_nv *= 8.0; + value_nv += (NV)digit; + continue; + } + if(digit == ('_' - '0') && len && allow_underscores + && (digit = s[1] - '0') && (digit >= 0 && digit <= 7)) + { + --len; + ++s; + goto redo; + } + if(digit == 8 || digit == 9) + { + if(!(*flags & PERL_SCAN_SILENT_ILLDIGIT)) + warn("Illegal octal digit '%c' ignored", *s); + } + break; + } + if((overflowed && value_nv > 4294967295.0) #if UVSIZE > 4 -|| (!overflowed && value > 0xffffffff ) + || (!overflowed && value > 0xffffffff) #endif -) { -warn("Octal number > 037777777777 non-portable"); -} -*len_p = s - start; -if (!overflowed) { -*flags = 0; -return value; -} -*flags = PERL_SCAN_GREATER_THAN_UV_MAX; -if (result) -*result = value_nv; -return UV_MAX; + ) + { + warn("Octal number > 037777777777 non-portable"); + } + *len_p = s - start; + if(!overflowed) + { + *flags = 0; + return value; + } + *flags = PERL_SCAN_GREATER_THAN_UV_MAX; + if(result) + *result = value_nv; + return UV_MAX; } #endif #endif @@ -3018,22 +3291,22 @@ extern int DPPP_(my_my_snprintf)(char * buffer, const Size_t len, const char * f #define my_snprintf DPPP_(my_my_snprintf) #define Perl_my_snprintf DPPP_(my_my_snprintf) #if defined(NEED_my_snprintf) || defined(NEED_my_snprintf_GLOBAL) -int -DPPP_(my_my_snprintf)(char *buffer, const Size_t len, const char *format, ...) + int + DPPP_(my_my_snprintf)(char * buffer, const Size_t len, const char * format, ...) { -dTHX; -int retval; -va_list ap; -va_start(ap, format); + dTHX; + int retval; + va_list ap; + va_start(ap, format); #ifdef HAS_VSNPRINTF -retval = vsnprintf(buffer, len, format, ap); + retval = vsnprintf(buffer, len, format, ap); #else -retval = vsprintf(buffer, format, ap); + retval = vsprintf(buffer, format, ap); #endif -va_end(ap); -if (retval < 0 || (len > 0 && (Size_t)retval >= len)) -Perl_croak(aTHX_ "panic: my_snprintf buffer overflow"); -return retval; + va_end(ap); + if(retval < 0 || (len > 0 && (Size_t)retval >= len)) + Perl_croak(aTHX_ "panic: my_snprintf buffer overflow"); + return retval; } #endif #endif @@ -3047,29 +3320,38 @@ extern int DPPP_(my_my_sprintf)(char * buffer, const char * pat, ...); #define my_sprintf DPPP_(my_my_sprintf) #define Perl_my_sprintf DPPP_(my_my_sprintf) #if defined(NEED_my_sprintf) || defined(NEED_my_sprintf_GLOBAL) -int -DPPP_(my_my_sprintf)(char *buffer, const char* pat, ...) + int + DPPP_(my_my_sprintf)(char * buffer, const char * pat, ...) { -va_list args; -va_start(args, pat); -vsprintf(buffer, pat, args); -va_end(args); -return strlen(buffer); + va_list args; + va_start(args, pat); + vsprintf(buffer, pat, args); + va_end(args); + return strlen(buffer); } #endif #endif #ifdef NO_XSLOCKS #ifdef dJMPENV -#define dXCPT dJMPENV; int rEtV = 0 -#define XCPT_TRY_START JMPENV_PUSH(rEtV); if (rEtV == 0) +#define dXCPT \ + dJMPENV; \ + int rEtV = 0 +#define XCPT_TRY_START \ + JMPENV_PUSH(rEtV); \ + if(rEtV == 0) #define XCPT_TRY_END JMPENV_POP; -#define XCPT_CATCH if (rEtV != 0) +#define XCPT_CATCH if(rEtV != 0) #define XCPT_RETHROW JMPENV_JUMP(rEtV) #else -#define dXCPT Sigjmp_buf oldTOP; int rEtV = 0 -#define XCPT_TRY_START Copy(top_env, oldTOP, 1, Sigjmp_buf); rEtV = Sigsetjmp(top_env, 1); if (rEtV == 0) +#define dXCPT \ + Sigjmp_buf oldTOP; \ + int rEtV = 0 +#define XCPT_TRY_START \ + Copy(top_env, oldTOP, 1, Sigjmp_buf); \ + rEtV = Sigsetjmp(top_env, 1); \ + if(rEtV == 0) #define XCPT_TRY_END Copy(oldTOP, top_env, 1, Sigjmp_buf); -#define XCPT_CATCH if (rEtV != 0) +#define XCPT_CATCH if(rEtV != 0) #define XCPT_RETHROW Siglongjmp(top_env, rEtV) #endif #endif @@ -3083,18 +3365,19 @@ extern Size_t DPPP_(my_my_strlcat)(char * dst, const char * src, Size_t size); #define my_strlcat DPPP_(my_my_strlcat) #define Perl_my_strlcat DPPP_(my_my_strlcat) #if defined(NEED_my_strlcat) || defined(NEED_my_strlcat_GLOBAL) -Size_t -DPPP_(my_my_strlcat)(char *dst, const char *src, Size_t size) + Size_t + DPPP_(my_my_strlcat)(char * dst, const char * src, Size_t size) { -Size_t used, length, copy; -used = strlen(dst); -length = strlen(src); -if (size > 0 && used < size - 1) { -copy = (length >= size - used) ? size - used - 1 : length; -memcpy(dst + used, src, copy); -dst[used + copy] = '\0'; -} -return used + length; + Size_t used, length, copy; + used = strlen(dst); + length = strlen(src); + if(size > 0 && used < size - 1) + { + copy = (length >= size - used) ? size - used - 1 : length; + memcpy(dst + used, src, copy); + dst[used + copy] = '\0'; + } + return used + length; } #endif #endif @@ -3108,17 +3391,18 @@ extern Size_t DPPP_(my_my_strlcpy)(char * dst, const char * src, Size_t size); #define my_strlcpy DPPP_(my_my_strlcpy) #define Perl_my_strlcpy DPPP_(my_my_strlcpy) #if defined(NEED_my_strlcpy) || defined(NEED_my_strlcpy_GLOBAL) -Size_t -DPPP_(my_my_strlcpy)(char *dst, const char *src, Size_t size) + Size_t + DPPP_(my_my_strlcpy)(char * dst, const char * src, Size_t size) { -Size_t length, copy; -length = strlen(src); -if (size > 0) { -copy = (length >= size) ? size - 1 : length; -memcpy(dst, src, copy); -dst[copy] = '\0'; -} -return length; + Size_t length, copy; + length = strlen(src); + if(size > 0) + { + copy = (length >= size) ? size - 1 : length; + memcpy(dst, src, copy); + dst[copy] = '\0'; + } + return length; } #endif #endif @@ -3159,10 +3443,10 @@ return length; #define PERL_PV_PRETTY_NOCLEAR PERL_PV_ESCAPE_NOCLEAR #endif #ifndef PERL_PV_PRETTY_DUMP -#define PERL_PV_PRETTY_DUMP PERL_PV_PRETTY_ELLIPSES|PERL_PV_PRETTY_QUOTE +#define PERL_PV_PRETTY_DUMP PERL_PV_PRETTY_ELLIPSES | PERL_PV_PRETTY_QUOTE #endif #ifndef PERL_PV_PRETTY_REGPROP -#define PERL_PV_PRETTY_REGPROP PERL_PV_PRETTY_ELLIPSES|PERL_PV_PRETTY_LTGT|PERL_PV_ESCAPE_RE +#define PERL_PV_PRETTY_REGPROP PERL_PV_PRETTY_ELLIPSES | PERL_PV_PRETTY_LTGT | PERL_PV_ESCAPE_RE #endif #ifndef pv_escape #if defined(NEED_pv_escape) @@ -3174,93 +3458,125 @@ extern char * DPPP_(my_pv_escape)(pTHX_ SV * dsv, char const * const str, const #ifdef pv_escape #undef pv_escape #endif -#define pv_escape(a,b,c,d,e,f) DPPP_(my_pv_escape)(aTHX_ a,b,c,d,e,f) +#define pv_escape(a, b, c, d, e, f) \ + DPPP_(my_pv_escape) \ + (aTHX_ a, b, c, d, e, f) #define Perl_pv_escape DPPP_(my_pv_escape) #if defined(NEED_pv_escape) || defined(NEED_pv_escape_GLOBAL) -char * -DPPP_(my_pv_escape)(pTHX_ SV *dsv, char const * const str, -const STRLEN count, const STRLEN max, -STRLEN * const escaped, const U32 flags) + char * + DPPP_(my_pv_escape)(pTHX_ SV * dsv, char const * const str, + const STRLEN count, const STRLEN max, + STRLEN * const escaped, const U32 flags) { -const char esc = flags & PERL_PV_ESCAPE_RE ? '%' : '\\'; -const char dq = flags & PERL_PV_ESCAPE_QUOTE ? '"' : esc; -char octbuf[32] = "%123456789ABCDF"; -STRLEN wrote = 0; -STRLEN chsize = 0; -STRLEN readsize = 1; + const char esc = flags & PERL_PV_ESCAPE_RE ? '%' : '\\'; + const char dq = flags & PERL_PV_ESCAPE_QUOTE ? '"' : esc; + char octbuf[32] = "%123456789ABCDF"; + STRLEN wrote = 0; + STRLEN chsize = 0; + STRLEN readsize = 1; #if defined(is_utf8_string) && defined(utf8_to_uvchr) -bool isuni = flags & PERL_PV_ESCAPE_UNI ? 1 : 0; + bool isuni = flags & PERL_PV_ESCAPE_UNI ? 1 : 0; #endif -const char *pv = str; -const char * const end = pv + count; -octbuf[0] = esc; -if (!(flags & PERL_PV_ESCAPE_NOCLEAR)) -sv_setpvs(dsv, ""); + const char * pv = str; + const char * const end = pv + count; + octbuf[0] = esc; + if(!(flags & PERL_PV_ESCAPE_NOCLEAR)) + sv_setpvs(dsv, ""); #if defined(is_utf8_string) && defined(utf8_to_uvchr) -if ((flags & PERL_PV_ESCAPE_UNI_DETECT) && is_utf8_string((U8*)pv, count)) -isuni = 1; + if((flags & PERL_PV_ESCAPE_UNI_DETECT) && is_utf8_string((U8 *)pv, count)) + isuni = 1; #endif -for (; pv < end && (!max || wrote < max) ; pv += readsize) { -const UV u = + for(; pv < end && (!max || wrote < max); pv += readsize) + { + const UV u = #if defined(is_utf8_string) && defined(utf8_to_uvchr) -isuni ? utf8_to_uvchr((U8*)pv, &readsize) : -#endif -(U8)*pv; -const U8 c = (U8)u & 0xFF; -if (u > 255 || (flags & PERL_PV_ESCAPE_ALL)) { -if (flags & PERL_PV_ESCAPE_FIRSTCHAR) -chsize = my_snprintf(octbuf, sizeof octbuf, -"%" UVxf, u); -else -chsize = my_snprintf(octbuf, sizeof octbuf, -"%cx{%" UVxf "}", esc, u); -} else if (flags & PERL_PV_ESCAPE_NOBACKSLASH) { -chsize = 1; -} else { -if (c == dq || c == esc || !isPRINT(c)) { -chsize = 2; -switch (c) { -case '\\' : -case '%' : if (c == esc) -octbuf[1] = esc; -else -chsize = 1; -break; -case '\v' : octbuf[1] = 'v'; break; -case '\t' : octbuf[1] = 't'; break; -case '\r' : octbuf[1] = 'r'; break; -case '\n' : octbuf[1] = 'n'; break; -case '\f' : octbuf[1] = 'f'; break; -case '"' : if (dq == '"') -octbuf[1] = '"'; -else -chsize = 1; -break; -default: chsize = my_snprintf(octbuf, sizeof octbuf, -pv < end && isDIGIT((U8)*(pv+readsize)) -? "%c%03o" : "%c%o", esc, c); -} -} else { -chsize = 1; -} -} -if (max && wrote + chsize > max) { -break; -} else if (chsize > 1) { -sv_catpvn(dsv, octbuf, chsize); -wrote += chsize; -} else { -char tmp[2]; -my_snprintf(tmp, sizeof tmp, "%c", c); -sv_catpvn(dsv, tmp, 1); -wrote++; -} -if (flags & PERL_PV_ESCAPE_FIRSTCHAR) -break; -} -if (escaped != NULL) -*escaped= pv - str; -return SvPVX(dsv); + isuni ? utf8_to_uvchr((U8 *)pv, &readsize) : +#endif + (U8)*pv; + const U8 c = (U8)u & 0xFF; + if(u > 255 || (flags & PERL_PV_ESCAPE_ALL)) + { + if(flags & PERL_PV_ESCAPE_FIRSTCHAR) + chsize = my_snprintf(octbuf, sizeof octbuf, + "%" UVxf, u); + else + chsize = my_snprintf(octbuf, sizeof octbuf, + "%cx{%" UVxf "}", esc, u); + } + else if(flags & PERL_PV_ESCAPE_NOBACKSLASH) + { + chsize = 1; + } + else + { + if(c == dq || c == esc || !isPRINT(c)) + { + chsize = 2; + switch(c) + { + case '\\': + case '%': + if(c == esc) + octbuf[1] = esc; + else + chsize = 1; + break; + case '\v': + octbuf[1] = 'v'; + break; + case '\t': + octbuf[1] = 't'; + break; + case '\r': + octbuf[1] = 'r'; + break; + case '\n': + octbuf[1] = 'n'; + break; + case '\f': + octbuf[1] = 'f'; + break; + case '"': + if(dq == '"') + octbuf[1] = '"'; + else + chsize = 1; + break; + default: + chsize = my_snprintf(octbuf, sizeof octbuf, + pv < end && isDIGIT((U8) * (pv + readsize)) + ? "%c%03o" + : "%c%o", + esc, c); + } + } + else + { + chsize = 1; + } + } + if(max && wrote + chsize > max) + { + break; + } + else if(chsize > 1) + { + sv_catpvn(dsv, octbuf, chsize); + wrote += chsize; + } + else + { + char tmp[2]; + my_snprintf(tmp, sizeof tmp, "%c", c); + sv_catpvn(dsv, tmp, 1); + wrote++; + } + if(flags & PERL_PV_ESCAPE_FIRSTCHAR) + break; + } + if(escaped != NULL) + *escaped = pv - str; + return SvPVX(dsv); } #endif #endif @@ -3274,34 +3590,36 @@ extern char * DPPP_(my_pv_pretty)(pTHX_ SV * dsv, char const * const str, const #ifdef pv_pretty #undef pv_pretty #endif -#define pv_pretty(a,b,c,d,e,f,g) DPPP_(my_pv_pretty)(aTHX_ a,b,c,d,e,f,g) +#define pv_pretty(a, b, c, d, e, f, g) \ + DPPP_(my_pv_pretty) \ + (aTHX_ a, b, c, d, e, f, g) #define Perl_pv_pretty DPPP_(my_pv_pretty) #if defined(NEED_pv_pretty) || defined(NEED_pv_pretty_GLOBAL) -char * -DPPP_(my_pv_pretty)(pTHX_ SV *dsv, char const * const str, const STRLEN count, -const STRLEN max, char const * const start_color, char const * const end_color, -const U32 flags) + char * + DPPP_(my_pv_pretty)(pTHX_ SV * dsv, char const * const str, const STRLEN count, + const STRLEN max, char const * const start_color, char const * const end_color, + const U32 flags) { -const U8 dq = (flags & PERL_PV_PRETTY_QUOTE) ? '"' : '%'; -STRLEN escaped; -if (!(flags & PERL_PV_PRETTY_NOCLEAR)) -sv_setpvs(dsv, ""); -if (dq == '"') -sv_catpvs(dsv, "\""); -else if (flags & PERL_PV_PRETTY_LTGT) -sv_catpvs(dsv, "<"); -if (start_color != NULL) -sv_catpv(dsv, D_PPP_CONSTPV_ARG(start_color)); -pv_escape(dsv, str, count, max, &escaped, flags | PERL_PV_ESCAPE_NOCLEAR); -if (end_color != NULL) -sv_catpv(dsv, D_PPP_CONSTPV_ARG(end_color)); -if (dq == '"') -sv_catpvs(dsv, "\""); -else if (flags & PERL_PV_PRETTY_LTGT) -sv_catpvs(dsv, ">"); -if ((flags & PERL_PV_PRETTY_ELLIPSES) && escaped < count) -sv_catpvs(dsv, "..."); -return SvPVX(dsv); + const U8 dq = (flags & PERL_PV_PRETTY_QUOTE) ? '"' : '%'; + STRLEN escaped; + if(!(flags & PERL_PV_PRETTY_NOCLEAR)) + sv_setpvs(dsv, ""); + if(dq == '"') + sv_catpvs(dsv, "\""); + else if(flags & PERL_PV_PRETTY_LTGT) + sv_catpvs(dsv, "<"); + if(start_color != NULL) + sv_catpv(dsv, D_PPP_CONSTPV_ARG(start_color)); + pv_escape(dsv, str, count, max, &escaped, flags | PERL_PV_ESCAPE_NOCLEAR); + if(end_color != NULL) + sv_catpv(dsv, D_PPP_CONSTPV_ARG(end_color)); + if(dq == '"') + sv_catpvs(dsv, "\""); + else if(flags & PERL_PV_PRETTY_LTGT) + sv_catpvs(dsv, ">"); + if((flags & PERL_PV_PRETTY_ELLIPSES) && escaped < count) + sv_catpvs(dsv, "..."); + return SvPVX(dsv); } #endif #endif @@ -3315,16 +3633,18 @@ extern char * DPPP_(my_pv_display)(pTHX_ SV * dsv, const char * pv, STRLEN cur, #ifdef pv_display #undef pv_display #endif -#define pv_display(a,b,c,d,e) DPPP_(my_pv_display)(aTHX_ a,b,c,d,e) +#define pv_display(a, b, c, d, e) \ + DPPP_(my_pv_display) \ + (aTHX_ a, b, c, d, e) #define Perl_pv_display DPPP_(my_pv_display) #if defined(NEED_pv_display) || defined(NEED_pv_display_GLOBAL) -char * -DPPP_(my_pv_display)(pTHX_ SV *dsv, const char *pv, STRLEN cur, STRLEN len, STRLEN pvlim) + char * + DPPP_(my_pv_display)(pTHX_ SV * dsv, const char * pv, STRLEN cur, STRLEN len, STRLEN pvlim) { -pv_pretty(dsv, pv, cur, pvlim, NULL, NULL, PERL_PV_PRETTY_DUMP); -if (len > cur && pv[cur] == '\0') -sv_catpvs(dsv, "\\0"); -return SvPVX(dsv); + pv_pretty(dsv, pv, cur, pvlim, NULL, NULL, PERL_PV_PRETTY_DUMP); + if(len > cur && pv[cur] == '\0') + sv_catpvs(dsv, "\\0"); + return SvPVX(dsv); } #endif #endif diff --git a/src/modules/popup/libkvipopup.cpp b/src/modules/popup/libkvipopup.cpp index 4b66c6fca..6338d6411 100644 --- a/src/modules/popup/libkvipopup.cpp +++ b/src/modules/popup/libkvipopup.cpp @@ -26,106 +26,110 @@ #include "KviLocale.h" #include "KviKvsPopupManager.h" -#define GET_KVS_POPUP(LOCKING_CHECK) \ - int iIdx = szPopupName.indexOf(QChar('.')); \ - if(iIdx == 0) \ - { \ - if(!c->hasSwitch('q',"quiet")) \ - c->warning(__tr2qs_ctx("Empty popup name supplied","kvs")); \ - return true; \ - } \ - if(iIdx > 0) \ - { \ - if(iIdx == szPopupName.size()) \ - { \ - if(!c->hasSwitch('q',"quiet")) \ - c->warning(__tr2qs_ctx("Empty subpopup name supplied","kvs")); \ - return true; \ - } \ - szSubPopupName = szPopupName.mid(iIdx+1); \ - szPopupName.truncate(iIdx); \ - } \ - KviKvsPopupMenu * pPopup = KviKvsPopupManager::instance()->lookup(szPopupName); \ - if(!pPopup) \ - { \ - if(!c->hasSwitch('q',"quiet")) \ - c->warning(__tr2qs_ctx("Popup \"%Q\" doesn't exist","kvs"),&szPopupName); \ - return true; \ - } \ - if(pPopup->LOCKING_CHECK()) \ - { \ - if(!c->hasSwitch('q',"quiet")) \ - c->warning(__tr2qs_ctx("Popup menu self-modification is not allowed (the popup is probably open)","kvs")); \ - return true; \ - } \ - while(!szSubPopupName.isEmpty()) \ - { \ - iIdx = szSubPopupName.indexOf(QChar('.')); \ - QString szTargetPopupName; \ - if(iIdx >= 0) \ - { \ - szTargetPopupName = szSubPopupName.mid(0,iIdx); \ - szSubPopupName = szSubPopupName.mid(iIdx+1); \ - } else { \ - szTargetPopupName = szSubPopupName; \ - szSubPopupName = QString(); \ - } \ - pPopup = pPopup->findChildPopupByName(szTargetPopupName); \ - if(!pPopup) \ - { \ - if(!c->hasSwitch('q',"quiet")) \ - c->warning(__tr2qs_ctx("Popup \"%Q\" doesn't exist","kvs"),&szTargetPopupName); \ - return true; \ - } \ - if(pPopup->LOCKING_CHECK()) \ - { \ - if(!c->hasSwitch('q',"quiet")) \ - c->warning(__tr2qs_ctx("Popup menu self-modification is not allowed (the popup is probably open)","kvs")); \ - return true; \ - } \ +#define GET_KVS_POPUP(LOCKING_CHECK) \ + int iIdx = szPopupName.indexOf(QChar('.')); \ + if(iIdx == 0) \ + { \ + if(!c->hasSwitch('q', "quiet")) \ + c->warning(__tr2qs_ctx("Empty popup name supplied", "kvs")); \ + return true; \ + } \ + if(iIdx > 0) \ + { \ + if(iIdx == szPopupName.size()) \ + { \ + if(!c->hasSwitch('q', "quiet")) \ + c->warning(__tr2qs_ctx("Empty subpopup name supplied", "kvs")); \ + return true; \ + } \ + szSubPopupName = szPopupName.mid(iIdx + 1); \ + szPopupName.truncate(iIdx); \ + } \ + KviKvsPopupMenu * pPopup = KviKvsPopupManager::instance()->lookup(szPopupName); \ + if(!pPopup) \ + { \ + if(!c->hasSwitch('q', "quiet")) \ + c->warning(__tr2qs_ctx("Popup \"%Q\" doesn't exist", "kvs"), &szPopupName); \ + return true; \ + } \ + if(pPopup->LOCKING_CHECK()) \ + { \ + if(!c->hasSwitch('q', "quiet")) \ + c->warning(__tr2qs_ctx("Popup menu self-modification is not allowed (the popup is probably open)", "kvs")); \ + return true; \ + } \ + while(!szSubPopupName.isEmpty()) \ + { \ + iIdx = szSubPopupName.indexOf(QChar('.')); \ + QString szTargetPopupName; \ + if(iIdx >= 0) \ + { \ + szTargetPopupName = szSubPopupName.mid(0, iIdx); \ + szSubPopupName = szSubPopupName.mid(iIdx + 1); \ + } \ + else \ + { \ + szTargetPopupName = szSubPopupName; \ + szSubPopupName = QString(); \ + } \ + pPopup = pPopup->findChildPopupByName(szTargetPopupName); \ + if(!pPopup) \ + { \ + if(!c->hasSwitch('q', "quiet")) \ + c->warning(__tr2qs_ctx("Popup \"%Q\" doesn't exist", "kvs"), &szTargetPopupName); \ + return true; \ + } \ + if(pPopup->LOCKING_CHECK()) \ + { \ + if(!c->hasSwitch('q', "quiet")) \ + c->warning(__tr2qs_ctx("Popup menu self-modification is not allowed (the popup is probably open)", "kvs")); \ + return true; \ + } \ } -#define GET_KVS_POPUP_FNC \ - int iIdx = szPopupName.indexOf(QChar('.')); \ - if(iIdx == 0) \ - { \ - c->warning(__tr2qs_ctx("Empty popup name supplied","kvs")); \ - return true; \ - } \ - if(iIdx > 0) \ - { \ - if(iIdx == szPopupName.size()) \ - { \ - c->warning(__tr2qs_ctx("Empty subpopup name supplied","kvs")); \ - return true; \ - } \ - szSubPopupName = szPopupName.mid(iIdx+1); \ - szPopupName.truncate(iIdx); \ - } \ - KviKvsPopupMenu * pPopup = KviKvsPopupManager::instance()->lookup(szPopupName); \ - if(!pPopup) \ - { \ - c->warning(__tr2qs_ctx("Popup \"%Q\" doesn't exist","kvs"),&szPopupName); \ - return true; \ - } \ - while(!szSubPopupName.isEmpty()) \ - { \ - iIdx = szSubPopupName.indexOf(QChar('.')); \ - QString szTargetPopupName; \ - if(iIdx >= 0) \ - { \ - szTargetPopupName = szSubPopupName.mid(0,iIdx); \ - szSubPopupName = szSubPopupName.mid(iIdx+1); \ - } else { \ - szTargetPopupName = szSubPopupName; \ - szSubPopupName = QString(); \ - } \ - pPopup = pPopup->findChildPopupByName(szSubPopupName); \ - if(!pPopup) \ - { \ - c->warning(__tr2qs_ctx("Popup \"%Q\" doesn't exist","kvs"),&szTargetPopupName); \ - return true; \ - } \ +#define GET_KVS_POPUP_FNC \ + int iIdx = szPopupName.indexOf(QChar('.')); \ + if(iIdx == 0) \ + { \ + c->warning(__tr2qs_ctx("Empty popup name supplied", "kvs")); \ + return true; \ + } \ + if(iIdx > 0) \ + { \ + if(iIdx == szPopupName.size()) \ + { \ + c->warning(__tr2qs_ctx("Empty subpopup name supplied", "kvs")); \ + return true; \ + } \ + szSubPopupName = szPopupName.mid(iIdx + 1); \ + szPopupName.truncate(iIdx); \ + } \ + KviKvsPopupMenu * pPopup = KviKvsPopupManager::instance()->lookup(szPopupName); \ + if(!pPopup) \ + { \ + c->warning(__tr2qs_ctx("Popup \"%Q\" doesn't exist", "kvs"), &szPopupName); \ + return true; \ + } \ + while(!szSubPopupName.isEmpty()) \ + { \ + iIdx = szSubPopupName.indexOf(QChar('.')); \ + QString szTargetPopupName; \ + if(iIdx >= 0) \ + { \ + szTargetPopupName = szSubPopupName.mid(0, iIdx); \ + szSubPopupName = szSubPopupName.mid(iIdx + 1); \ + } \ + else \ + { \ + szTargetPopupName = szSubPopupName; \ + szSubPopupName = QString(); \ + } \ + pPopup = pPopup->findChildPopupByName(szSubPopupName); \ + if(!pPopup) \ + { \ + c->warning(__tr2qs_ctx("Popup \"%Q\" doesn't exist", "kvs"), &szTargetPopupName); \ + return true; \ + } \ } /* @@ -164,17 +168,17 @@ static bool popup_kvs_cmd_addItem(KviKvsModuleCallbackCommandCall * c) { QString szPopupName, szSubPopupName, szItemId, szText, szIcon, szCondition; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("popupname",KVS_PT_NONEMPTYSTRING,0,szPopupName) - KVSM_PARAMETER("text",KVS_PT_NONEMPTYSTRING,0,szText) - KVSM_PARAMETER("icon",KVS_PT_STRING,KVS_PF_OPTIONAL,szIcon) - KVSM_PARAMETER("item_id",KVS_PT_STRING,KVS_PF_OPTIONAL,szItemId) - KVSM_PARAMETER("condition",KVS_PT_STRING,KVS_PF_OPTIONAL,szCondition) + KVSM_PARAMETER("popupname", KVS_PT_NONEMPTYSTRING, 0, szPopupName) + KVSM_PARAMETER("text", KVS_PT_NONEMPTYSTRING, 0, szText) + KVSM_PARAMETER("icon", KVS_PT_STRING, KVS_PF_OPTIONAL, szIcon) + KVSM_PARAMETER("item_id", KVS_PT_STRING, KVS_PF_OPTIONAL, szItemId) + KVSM_PARAMETER("condition", KVS_PT_STRING, KVS_PF_OPTIONAL, szCondition) KVSM_PARAMETERS_END(c) GET_KVS_POPUP(isHardLocked) - if(c->callback()->code().trimmed().isEmpty() && !c->hasSwitch('q',"quiet")) - c->warning(__tr2qs_ctx("Found empty instruction for popup item: maybe you need to fix the script?","kvs")); + if(c->callback()->code().trimmed().isEmpty() && !c->hasSwitch('q', "quiet")) + c->warning(__tr2qs_ctx("Found empty instruction for popup item: maybe you need to fix the script?", "kvs")); pPopup->addItem(szItemId, c->callback()->code(), szText, szIcon, szCondition); @@ -214,16 +218,16 @@ static bool popup_kvs_cmd_addItem(KviKvsModuleCallbackCommandCall * c) static bool popup_kvs_cmd_addPrologue(KviKvsModuleCallbackCommandCall * c) { - QString szPopupName, szSubPopupName,szItemId; + QString szPopupName, szSubPopupName, szItemId; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("popupname",KVS_PT_NONEMPTYSTRING,0,szPopupName) - KVSM_PARAMETER("item_id",KVS_PT_STRING,KVS_PF_OPTIONAL,szItemId) + KVSM_PARAMETER("popupname", KVS_PT_NONEMPTYSTRING, 0, szPopupName) + KVSM_PARAMETER("item_id", KVS_PT_STRING, KVS_PF_OPTIONAL, szItemId) KVSM_PARAMETERS_END(c) GET_KVS_POPUP(isSoftLocked) - if(c->callback()->code().trimmed().isEmpty() && !c->hasSwitch('q',"quiet")) - c->warning(__tr2qs_ctx("Found empty prologue block: maybe you need to fix the script?","kvs")); + if(c->callback()->code().trimmed().isEmpty() && !c->hasSwitch('q', "quiet")) + c->warning(__tr2qs_ctx("Found empty prologue block: maybe you need to fix the script?", "kvs")); pPopup->addPrologue(szItemId, c->callback()->code()); @@ -263,16 +267,16 @@ static bool popup_kvs_cmd_addPrologue(KviKvsModuleCallbackCommandCall * c) static bool popup_kvs_cmd_addEpilogue(KviKvsModuleCallbackCommandCall * c) { - QString szPopupName, szSubPopupName,szItemId; + QString szPopupName, szSubPopupName, szItemId; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("popupname",KVS_PT_NONEMPTYSTRING,0,szPopupName) - KVSM_PARAMETER("item_id",KVS_PT_STRING,KVS_PF_OPTIONAL,szItemId) + KVSM_PARAMETER("popupname", KVS_PT_NONEMPTYSTRING, 0, szPopupName) + KVSM_PARAMETER("item_id", KVS_PT_STRING, KVS_PF_OPTIONAL, szItemId) KVSM_PARAMETERS_END(c) GET_KVS_POPUP(isSoftLocked) - if(c->callback()->code().trimmed().isEmpty() && !c->hasSwitch('q',"quiet")) - c->warning(__tr2qs_ctx("Found empty epilogue block: maybe you need to fix the script?","kvs")); + if(c->callback()->code().trimmed().isEmpty() && !c->hasSwitch('q', "quiet")) + c->warning(__tr2qs_ctx("Found empty epilogue block: maybe you need to fix the script?", "kvs")); pPopup->addEpilogue(szItemId, c->callback()->code()); @@ -312,12 +316,12 @@ static bool popup_kvs_cmd_addExtPopup(KviKvsModuleCommandCall * c) { QString szPopupName, szSubPopupName, szItemId, szExtPopupName, szText, szIcon, szCondition; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("popupname",KVS_PT_NONEMPTYSTRING,0,szPopupName) - KVSM_PARAMETER("external_popup",KVS_PT_NONEMPTYSTRING,0,szExtPopupName) - KVSM_PARAMETER("text",KVS_PT_NONEMPTYSTRING,0,szText) - KVSM_PARAMETER("icon",KVS_PT_STRING,KVS_PF_OPTIONAL,szIcon) - KVSM_PARAMETER("item_id",KVS_PT_STRING,KVS_PF_OPTIONAL,szItemId) - KVSM_PARAMETER("condition",KVS_PT_STRING,KVS_PF_OPTIONAL,szCondition) + KVSM_PARAMETER("popupname", KVS_PT_NONEMPTYSTRING, 0, szPopupName) + KVSM_PARAMETER("external_popup", KVS_PT_NONEMPTYSTRING, 0, szExtPopupName) + KVSM_PARAMETER("text", KVS_PT_NONEMPTYSTRING, 0, szText) + KVSM_PARAMETER("icon", KVS_PT_STRING, KVS_PF_OPTIONAL, szIcon) + KVSM_PARAMETER("item_id", KVS_PT_STRING, KVS_PF_OPTIONAL, szItemId) + KVSM_PARAMETER("condition", KVS_PT_STRING, KVS_PF_OPTIONAL, szCondition) KVSM_PARAMETERS_END(c) GET_KVS_POPUP(isHardLocked) @@ -360,11 +364,11 @@ static bool popup_kvs_cmd_addLabel(KviKvsModuleCommandCall * c) { QString szPopupName, szSubPopupName, szItemId, szText, szIcon, szCondition; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("popupname",KVS_PT_NONEMPTYSTRING,0,szPopupName) - KVSM_PARAMETER("text",KVS_PT_NONEMPTYSTRING,0,szText) - KVSM_PARAMETER("icon",KVS_PT_STRING,KVS_PF_OPTIONAL,szIcon) - KVSM_PARAMETER("item_id",KVS_PT_STRING,KVS_PF_OPTIONAL,szItemId) - KVSM_PARAMETER("condition",KVS_PT_STRING,KVS_PF_OPTIONAL,szCondition) + KVSM_PARAMETER("popupname", KVS_PT_NONEMPTYSTRING, 0, szPopupName) + KVSM_PARAMETER("text", KVS_PT_NONEMPTYSTRING, 0, szText) + KVSM_PARAMETER("icon", KVS_PT_STRING, KVS_PF_OPTIONAL, szIcon) + KVSM_PARAMETER("item_id", KVS_PT_STRING, KVS_PF_OPTIONAL, szItemId) + KVSM_PARAMETER("condition", KVS_PT_STRING, KVS_PF_OPTIONAL, szCondition) KVSM_PARAMETERS_END(c) GET_KVS_POPUP(isHardLocked) @@ -407,11 +411,11 @@ static bool popup_kvs_cmd_addSubPopup(KviKvsModuleCommandCall * c) { QString szPopupName, szSubPopupName, szItemId, szText, szIcon, szCondition; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("popupname",KVS_PT_NONEMPTYSTRING,0,szPopupName) - KVSM_PARAMETER("text",KVS_PT_NONEMPTYSTRING,0,szText) - KVSM_PARAMETER("icon",KVS_PT_STRING,KVS_PF_OPTIONAL,szIcon) - KVSM_PARAMETER("item_id",KVS_PT_STRING,KVS_PF_OPTIONAL,szItemId) - KVSM_PARAMETER("condition",KVS_PT_STRING,KVS_PF_OPTIONAL,szCondition) + KVSM_PARAMETER("popupname", KVS_PT_NONEMPTYSTRING, 0, szPopupName) + KVSM_PARAMETER("text", KVS_PT_NONEMPTYSTRING, 0, szText) + KVSM_PARAMETER("icon", KVS_PT_STRING, KVS_PF_OPTIONAL, szIcon) + KVSM_PARAMETER("item_id", KVS_PT_STRING, KVS_PF_OPTIONAL, szItemId) + KVSM_PARAMETER("condition", KVS_PT_STRING, KVS_PF_OPTIONAL, szCondition) KVSM_PARAMETERS_END(c) GET_KVS_POPUP(isHardLocked) @@ -451,9 +455,9 @@ static bool popup_kvs_cmd_addSeparator(KviKvsModuleCommandCall * c) { QString szPopupName, szSubPopupName, szItemId, szCondition; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("popupname",KVS_PT_NONEMPTYSTRING,0,szPopupName) - KVSM_PARAMETER("item_id",KVS_PT_STRING,KVS_PF_OPTIONAL,szItemId) - KVSM_PARAMETER("condition",KVS_PT_STRING,KVS_PF_OPTIONAL,szCondition) + KVSM_PARAMETER("popupname", KVS_PT_NONEMPTYSTRING, 0, szPopupName) + KVSM_PARAMETER("item_id", KVS_PT_STRING, KVS_PF_OPTIONAL, szItemId) + KVSM_PARAMETER("condition", KVS_PT_STRING, KVS_PF_OPTIONAL, szCondition) KVSM_PARAMETERS_END(c) GET_KVS_POPUP(isHardLocked) @@ -489,7 +493,7 @@ static bool popup_kvs_cmd_clear(KviKvsModuleCommandCall * c) { QString szPopupName, szSubPopupName; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("popupname",KVS_PT_NONEMPTYSTRING,0,szPopupName) + KVSM_PARAMETER("popupname", KVS_PT_NONEMPTYSTRING, 0, szPopupName) KVSM_PARAMETERS_END(c) GET_KVS_POPUP(isSoftLocked) @@ -524,18 +528,18 @@ static bool popup_kvs_cmd_create(KviKvsModuleCommandCall * c) { QString szPopupName, szSubPopupName; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("popupname",KVS_PT_NONEMPTYSTRING,0,szPopupName) + KVSM_PARAMETER("popupname", KVS_PT_NONEMPTYSTRING, 0, szPopupName) KVSM_PARAMETERS_END(c) if(KviKvsPopupManager::instance()->lookup(szPopupName)) { - if(!c->hasSwitch('q',"quiet")) - c->warning(__tr2qs_ctx("The popup \"%Q\" already exists","kvs"),&szPopupName); + if(!c->hasSwitch('q', "quiet")) + c->warning(__tr2qs_ctx("The popup \"%Q\" already exists", "kvs"), &szPopupName); return true; } KviKvsPopupMenu * pMenu = new KviKvsPopupMenu(szPopupName); - KviKvsPopupManager::instance()->add(szPopupName,pMenu); + KviKvsPopupManager::instance()->add(szPopupName, pMenu); KviKvsPopupManager::instance()->emitRefresh(szPopupName); return true; @@ -564,20 +568,20 @@ static bool popup_kvs_cmd_destroy(KviKvsModuleCommandCall * c) { QString szPopupName, szSubPopupName; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("popupname",KVS_PT_NONEMPTYSTRING,0,szPopupName) + KVSM_PARAMETER("popupname", KVS_PT_NONEMPTYSTRING, 0, szPopupName) KVSM_PARAMETERS_END(c) KviKvsPopupMenu * pPopup = KviKvsPopupManager::instance()->lookup(szPopupName); if(!pPopup) { - if(!c->hasSwitch('q',"quiet")) - c->warning(__tr2qs_ctx("Popup \"%Q\" doesn't exist","kvs"),&szPopupName); + if(!c->hasSwitch('q', "quiet")) + c->warning(__tr2qs_ctx("Popup \"%Q\" doesn't exist", "kvs"), &szPopupName); return true; } if(pPopup->isSoftLocked()) { - if(!c->hasSwitch('q',"quiet")) - c->warning(__tr2qs_ctx("Popup menu self-modification is not allowed (the popup is probably open)","kvs")); + if(!c->hasSwitch('q', "quiet")) + c->warning(__tr2qs_ctx("Popup menu self-modification is not allowed (the popup is probably open)", "kvs")); return true; } @@ -613,21 +617,20 @@ static bool popup_kvs_cmd_destroy(KviKvsModuleCommandCall * c) [cmd]defpopup[/cmd], [cmd]popup.show[/cmd] */ - static bool popup_kvs_cmd_delItem(KviKvsModuleCommandCall * c) { - QString szPopupName, szSubPopupName,szItemId; + QString szPopupName, szSubPopupName, szItemId; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("popupname",KVS_PT_NONEMPTYSTRING,0,szPopupName) - KVSM_PARAMETER("item_id",KVS_PT_NONEMPTYSTRING,0,szItemId) + KVSM_PARAMETER("popupname", KVS_PT_NONEMPTYSTRING, 0, szPopupName) + KVSM_PARAMETER("item_id", KVS_PT_NONEMPTYSTRING, 0, szItemId) KVSM_PARAMETERS_END(c) GET_KVS_POPUP(isHardLocked) - if(!pPopup->removeItemByName(szItemId,c->hasSwitch('d',"deep"))) + if(!pPopup->removeItemByName(szItemId, c->hasSwitch('d', "deep"))) { - if(!c->hasSwitch('q',"quiet")) - c->warning(__tr2qs_ctx("The menu item with ID \"%Q\" doesn't exist in popup \"%Q\"","kvs"),&szItemId,&szPopupName); + if(!c->hasSwitch('q', "quiet")) + c->warning(__tr2qs_ctx("The menu item with ID \"%Q\" doesn't exist in popup \"%Q\"", "kvs"), &szItemId, &szPopupName); } KviKvsPopupManager::instance()->emitRefresh(szPopupName); @@ -654,23 +657,23 @@ static bool popup_kvs_fnc_exists(KviKvsModuleFunctionCall * c) { QString szPopupName, szSubPopupName; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("popupname",KVS_PT_NONEMPTYSTRING,0,szPopupName) + KVSM_PARAMETER("popupname", KVS_PT_NONEMPTYSTRING, 0, szPopupName) KVSM_PARAMETERS_END(c) int iIdx = szPopupName.indexOf(QChar('.')); if(iIdx == 0) { - c->warning(__tr2qs_ctx("Empty subpopup name supplied","kvs")); + c->warning(__tr2qs_ctx("Empty subpopup name supplied", "kvs")); return true; } if(iIdx > 0) { if(iIdx == szPopupName.size()) { - c->warning(__tr2qs_ctx("Empty subpopup name supplied","kvs")); + c->warning(__tr2qs_ctx("Empty subpopup name supplied", "kvs")); return true; } - szSubPopupName = szPopupName.mid(iIdx+1); + szSubPopupName = szPopupName.mid(iIdx + 1); szPopupName.truncate(iIdx); } KviKvsPopupMenu * pPopup = KviKvsPopupManager::instance()->lookup(szPopupName); @@ -713,7 +716,7 @@ static bool popup_kvs_fnc_isEmpty(KviKvsModuleFunctionCall * c) { QString szPopupName, szSubPopupName; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("popupname",KVS_PT_NONEMPTYSTRING,0,szPopupName) + KVSM_PARAMETER("popupname", KVS_PT_NONEMPTYSTRING, 0, szPopupName) KVSM_PARAMETERS_END(c) GET_KVS_POPUP_FNC @@ -770,7 +773,9 @@ static bool popup_kvs_fnc_currentItemId(KviKvsModuleFunctionCall * c) if(pPopupId) { c->returnValue()->setString(pPopupId); - } else { + } + else + { c->returnValue()->setNothing(); } return true; @@ -806,13 +811,14 @@ static bool popup_kvs_cmd_show(KviKvsModuleCommandCall * c) { QString szPopupName, szSubPopupName; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("popup_name",KVS_PT_NONEMPTYSTRING,0,szPopupName) + KVSM_PARAMETER("popup_name", KVS_PT_NONEMPTYSTRING, 0, szPopupName) KVSM_PARAMETERS_END(c) // copy parameters KviKvsVariantList * pPopupParams = new KviKvsVariantList(); c->params()->first(); - while(KviKvsVariant * v = c->params()->next())pPopupParams->append(new KviKvsVariant(*v)); + while(KviKvsVariant * v = c->params()->next()) + pPopupParams->append(new KviKvsVariant(*v)); KviKvsPopupMenu * pMenu = KviKvsPopupManager::instance()->lookup(szPopupName); @@ -820,7 +826,7 @@ static bool popup_kvs_cmd_show(KviKvsModuleCommandCall * c) { delete pPopupParams; pPopupParams = 0; - c->error(__tr2qs_ctx("Popup %Q is not defined","kvs"),&szPopupName); + c->error(__tr2qs_ctx("Popup %Q is not defined", "kvs"), &szPopupName); return false; } @@ -828,13 +834,13 @@ static bool popup_kvs_cmd_show(KviKvsModuleCommandCall * c) { delete pPopupParams; pPopupParams = 0; - c->error(__tr2qs_ctx("A popup menu can't be popped up twice","kvs")); + c->error(__tr2qs_ctx("A popup menu can't be popped up twice", "kvs")); return false; } QPoint pnt = QCursor::pos(); - KviKvsVariant * pCoords = c->getSwitch('p',"point"); + KviKvsVariant * pCoords = c->getSwitch('p', "point"); if(pCoords) { QString szCoords; @@ -842,44 +848,49 @@ static bool popup_kvs_cmd_show(KviKvsModuleCommandCall * c) int idx = szCoords.indexOf(','); bool bCoordsOk = true; - if(idx == -1)bCoordsOk = false; - else { + if(idx == -1) + bCoordsOk = false; + else + { QString szX = szCoords.left(idx); - szCoords.remove(0,idx + 1); - bool bOk1,bOk2; + szCoords.remove(0, idx + 1); + bool bOk1, bOk2; int iX = szX.toInt(&bOk1); int iY = szCoords.toInt(&bOk2); - if(bOk1 && bOk2)pnt = QPoint(iX,iY); - else bCoordsOk = false; + if(bOk1 && bOk2) + pnt = QPoint(iX, iY); + else + bCoordsOk = false; } - if(!bCoordsOk)c->warning(__tr2qs_ctx("Invalid syntax for screen coordinates, using cursor position","kvs")); + if(!bCoordsOk) + c->warning(__tr2qs_ctx("Invalid syntax for screen coordinates, using cursor position", "kvs")); } - pMenu->doPopup(pnt,c->window(),pPopupParams); + pMenu->doPopup(pnt, c->window(), pPopupParams); return true; } -static bool popup_module_init(KviModule *m) +static bool popup_module_init(KviModule * m) { - KVSM_REGISTER_CALLBACK_COMMAND(m,"addItem",popup_kvs_cmd_addItem); - KVSM_REGISTER_CALLBACK_COMMAND(m,"addPrologue",popup_kvs_cmd_addPrologue); - KVSM_REGISTER_CALLBACK_COMMAND(m,"addEpilogue",popup_kvs_cmd_addEpilogue); + KVSM_REGISTER_CALLBACK_COMMAND(m, "addItem", popup_kvs_cmd_addItem); + KVSM_REGISTER_CALLBACK_COMMAND(m, "addPrologue", popup_kvs_cmd_addPrologue); + KVSM_REGISTER_CALLBACK_COMMAND(m, "addEpilogue", popup_kvs_cmd_addEpilogue); - KVSM_REGISTER_SIMPLE_COMMAND(m,"addExtPopup",popup_kvs_cmd_addExtPopup); - KVSM_REGISTER_SIMPLE_COMMAND(m,"addLabel",popup_kvs_cmd_addLabel); - KVSM_REGISTER_SIMPLE_COMMAND(m,"addSubPopup",popup_kvs_cmd_addSubPopup); - KVSM_REGISTER_SIMPLE_COMMAND(m,"addSeparator",popup_kvs_cmd_addSeparator); + KVSM_REGISTER_SIMPLE_COMMAND(m, "addExtPopup", popup_kvs_cmd_addExtPopup); + KVSM_REGISTER_SIMPLE_COMMAND(m, "addLabel", popup_kvs_cmd_addLabel); + KVSM_REGISTER_SIMPLE_COMMAND(m, "addSubPopup", popup_kvs_cmd_addSubPopup); + KVSM_REGISTER_SIMPLE_COMMAND(m, "addSeparator", popup_kvs_cmd_addSeparator); - KVSM_REGISTER_SIMPLE_COMMAND(m,"clear",popup_kvs_cmd_clear); - KVSM_REGISTER_SIMPLE_COMMAND(m,"create",popup_kvs_cmd_create); - KVSM_REGISTER_SIMPLE_COMMAND(m,"delItem",popup_kvs_cmd_delItem); - KVSM_REGISTER_SIMPLE_COMMAND(m,"destroy",popup_kvs_cmd_destroy); - KVSM_REGISTER_SIMPLE_COMMAND(m,"show",popup_kvs_cmd_show); + KVSM_REGISTER_SIMPLE_COMMAND(m, "clear", popup_kvs_cmd_clear); + KVSM_REGISTER_SIMPLE_COMMAND(m, "create", popup_kvs_cmd_create); + KVSM_REGISTER_SIMPLE_COMMAND(m, "delItem", popup_kvs_cmd_delItem); + KVSM_REGISTER_SIMPLE_COMMAND(m, "destroy", popup_kvs_cmd_destroy); + KVSM_REGISTER_SIMPLE_COMMAND(m, "show", popup_kvs_cmd_show); - KVSM_REGISTER_FUNCTION(m,"exists",popup_kvs_fnc_exists); - KVSM_REGISTER_FUNCTION(m,"isEmpty",popup_kvs_fnc_isEmpty); - KVSM_REGISTER_FUNCTION(m,"currentItemId",popup_kvs_fnc_currentItemId); + KVSM_REGISTER_FUNCTION(m, "exists", popup_kvs_fnc_exists); + KVSM_REGISTER_FUNCTION(m, "isEmpty", popup_kvs_fnc_isEmpty); + KVSM_REGISTER_FUNCTION(m, "currentItemId", popup_kvs_fnc_currentItemId); return true; } @@ -895,13 +906,12 @@ static bool popup_module_can_unload(KviModule *) } KVIRC_MODULE( - "Userlist", // module name - "4.0.0", // module version - "Copyright (C) 2010 Fabio Bas (ctrlaltca at gmail dot com)", // author & (C) - "KVIrc popup management functions", - popup_module_init, - popup_module_can_unload, - 0, - popup_module_cleanup, - 0 -) + "Userlist", // module name + "4.0.0", // module version + "Copyright (C) 2010 Fabio Bas (ctrlaltca at gmail dot com)", // author & (C) + "KVIrc popup management functions", + popup_module_init, + popup_module_can_unload, + 0, + popup_module_cleanup, + 0) diff --git a/src/modules/popupeditor/PopupEditorWindow.cpp b/src/modules/popupeditor/PopupEditorWindow.cpp index feedfddac..6faee9739 100644 --- a/src/modules/popupeditor/PopupEditorWindow.cpp +++ b/src/modules/popupeditor/PopupEditorWindow.cpp @@ -52,21 +52,18 @@ #include #include - extern PopupEditorWindow * g_pPopupEditorWindow; - - //KviPopupEntryItem -PopupTreeWidgetItem::PopupTreeWidgetItem(QTreeWidget * pTreeWidget,PopupTreeWidgetItem * after,Type t) -: QTreeWidgetItem(pTreeWidget, after) +PopupTreeWidgetItem::PopupTreeWidgetItem(QTreeWidget * pTreeWidget, PopupTreeWidgetItem * after, Type t) + : QTreeWidgetItem(pTreeWidget, after) { m_type = t; init(); } -PopupTreeWidgetItem::PopupTreeWidgetItem(PopupTreeWidgetItem * parent,PopupTreeWidgetItem * after,Type t) -: QTreeWidgetItem(parent, after) +PopupTreeWidgetItem::PopupTreeWidgetItem(PopupTreeWidgetItem * parent, PopupTreeWidgetItem * after, Type t) + : QTreeWidgetItem(parent, after) { m_type = t; init(); @@ -77,31 +74,31 @@ void PopupTreeWidgetItem::init() switch(m_type) { case Item: - setText(1,__tr2qs_ctx("Item","editor")); - break; + setText(1, __tr2qs_ctx("Item", "editor")); + break; case Menu: - setText(1,__tr2qs_ctx("Submenu","editor")); - break; + setText(1, __tr2qs_ctx("Submenu", "editor")); + break; case ExtMenu: - setText(1,__tr2qs_ctx("External Menu","editor")); - break; + setText(1, __tr2qs_ctx("External Menu", "editor")); + break; case Separator: - setText(0,"-----------------------"); - setText(1,__tr2qs_ctx("Separator","editor")); - break; + setText(0, "-----------------------"); + setText(1, __tr2qs_ctx("Separator", "editor")); + break; case Label: - setText(1,__tr2qs_ctx("Label","editor")); - break; + setText(1, __tr2qs_ctx("Label", "editor")); + break; case Epilogue: - setText(0,__tr2qs_ctx("### Epilogue ###","editor")); - setText(1,__tr2qs_ctx("Epilogue","editor")); - break; + setText(0, __tr2qs_ctx("### Epilogue ###", "editor")); + setText(1, __tr2qs_ctx("Epilogue", "editor")); + break; case Prologue: - setText(0,__tr2qs_ctx("### Prologue ###","editor")); - setText(1,__tr2qs_ctx("Prologue","editor")); - break; + setText(0, __tr2qs_ctx("### Prologue ###", "editor")); + setText(1, __tr2qs_ctx("Prologue", "editor")); + break; default: - break; + break; } } @@ -114,10 +111,10 @@ void PopupTreeWidgetItem::setItemText(const QString & szText) case Label: case ExtMenu: m_szText = szText; - setText(0,szText); - break; + setText(0, szText); + break; default: - break; + break; } } @@ -131,9 +128,9 @@ void PopupTreeWidgetItem::setCondition(const QString & szCondition) case ExtMenu: case Separator: m_szCondition = szCondition; - break; + break; default: - break; + break; } } @@ -146,9 +143,9 @@ void PopupTreeWidgetItem::setCode(const QString & szCode) case Prologue: case ExtMenu: m_szCode = szCode; - break; + break; default: - break; + break; } } @@ -169,19 +166,18 @@ void PopupTreeWidgetItem::setIcon(const QString & szIcon) { QPixmap * pix = g_pIconManager->getImage(szIcon); if(pix) - QTreeWidgetItem::setIcon(0,QIcon(*pix)); + QTreeWidgetItem::setIcon(0, QIcon(*pix)); else - QTreeWidgetItem::setIcon(0,QIcon()); + QTreeWidgetItem::setIcon(0, QIcon()); } - break; + break; default: - break; + break; } } - SinglePopupEditor::SinglePopupEditor(QWidget * par) -: QWidget(par) + : QWidget(par) { m_pLastSelectedItem = nullptr; m_pContextPopup = new QMenu(this); @@ -193,21 +189,21 @@ SinglePopupEditor::SinglePopupEditor(QWidget * par) g->setSpacing(2); m_pNameEditor = new QLineEdit(this); - m_pNameEditor->setToolTip(__tr2qs_ctx("Popup name","editor")); + m_pNameEditor->setToolTip(__tr2qs_ctx("Popup name", "editor")); - g->addWidget(m_pNameEditor,0,0,1,2); + g->addWidget(m_pNameEditor, 0, 0, 1, 2); - m_pMenuButton = new QPushButton(__tr2qs_ctx("Test","editor"),this); - g->addWidget(m_pMenuButton,0,2); - connect(m_pMenuButton,SIGNAL(clicked()),this,SLOT(testPopup())); - QSplitter * spl = new QSplitter(Qt::Vertical,this); + m_pMenuButton = new QPushButton(__tr2qs_ctx("Test", "editor"), this); + g->addWidget(m_pMenuButton, 0, 2); + connect(m_pMenuButton, SIGNAL(clicked()), this, SLOT(testPopup())); + QSplitter * spl = new QSplitter(Qt::Vertical, this); spl->setObjectName("popupeditor_vertical_splitter"); spl->setChildrenCollapsible(false); m_pTreeWidget = new QTreeWidget(spl); m_pTreeWidget->setColumnCount(2); QStringList labels; - labels << __tr2qs_ctx("Item","editor") << __tr2qs_ctx("Type","editor"); + labels << __tr2qs_ctx("Item", "editor") << __tr2qs_ctx("Type", "editor"); m_pTreeWidget->setHeaderLabels(labels); m_pTreeWidget->setSelectionMode(QAbstractItemView::SingleSelection); m_pTreeWidget->setSelectionBehavior(QAbstractItemView::SelectRows); @@ -217,60 +213,59 @@ SinglePopupEditor::SinglePopupEditor(QWidget * par) m_pTreeWidget->setSortingEnabled(false); m_pTreeWidget->setContextMenuPolicy(Qt::CustomContextMenu); - connect(m_pTreeWidget,SIGNAL(itemSelectionChanged()),this,SLOT(selectionChanged())); - connect(m_pTreeWidget,SIGNAL(customContextMenuRequested(const QPoint &)), - this,SLOT(customContextMenuRequested(const QPoint &))); + connect(m_pTreeWidget, SIGNAL(itemSelectionChanged()), this, SLOT(selectionChanged())); + connect(m_pTreeWidget, SIGNAL(customContextMenuRequested(const QPoint &)), + this, SLOT(customContextMenuRequested(const QPoint &))); m_pEditor = KviScriptEditor::createInstance(spl); - g->addWidget(spl,1,0,1,3); + g->addWidget(spl, 1, 0, 1, 3); - QLabel * l = new QLabel(__tr2qs_ctx("Text:","editor"),this); - g->addWidget(l,2,0); + QLabel * l = new QLabel(__tr2qs_ctx("Text:", "editor"), this); + g->addWidget(l, 2, 0); m_pTextEditor = new QLineEdit(this); m_pTextEditor->setToolTip( - __tr2qs_ctx("Visible text
May contain identifiers that will be evaluated at popup call time.
For labels, this text can contain also limited HTML tags.","editor")); - g->addWidget(m_pTextEditor,2,1,1,2); + __tr2qs_ctx("Visible text
May contain identifiers that will be evaluated at popup call time.
For labels, this text can contain also limited HTML tags.", "editor")); + g->addWidget(m_pTextEditor, 2, 1, 1, 2); - l = new QLabel(__tr2qs_ctx("Condition:","editor"),this); + l = new QLabel(__tr2qs_ctx("Condition:", "editor"), this); l->setMargin(2); - g->addWidget(l,3,0); + g->addWidget(l, 3, 0); m_pConditionEditor = new QLineEdit(this); m_pConditionEditor->setToolTip( - __tr2qs_ctx("Boolean condition
Will be evaluated at popup call time in order to decide if this entry has to be shown.
An empty condition evaluates to true.","editor")); - g->addWidget(m_pConditionEditor,3,1,1,2); + __tr2qs_ctx("Boolean condition
Will be evaluated at popup call time in order to decide if this entry has to be shown.
An empty condition evaluates to true.", "editor")); + g->addWidget(m_pConditionEditor, 3, 1, 1, 2); - l = new QLabel(__tr2qs_ctx("Icon:","editor"),this); + l = new QLabel(__tr2qs_ctx("Icon:", "editor"), this); l->setMargin(2); - g->addWidget(l,4,0); + g->addWidget(l, 4, 0); m_pIconEditor = new QLineEdit(this); m_pIconEditor->setToolTip( - __tr2qs_ctx("Icon identifier
May be an internal icon ID, an absolute path or a relative path.
Portable scripts should never use absolute paths.","editor")); - g->addWidget(m_pIconEditor,4,1,1,2); + __tr2qs_ctx("Icon identifier
May be an internal icon ID, an absolute path or a relative path.
Portable scripts should never use absolute paths.", "editor")); + g->addWidget(m_pIconEditor, 4, 1, 1, 2); - l = new QLabel(__tr2qs_ctx("External menu:","editor"),this); + l = new QLabel(__tr2qs_ctx("External menu:", "editor"), this); l->setMargin(2); - g->addWidget(l,5,0); + g->addWidget(l, 5, 0); m_pExtNameEditor = new QLineEdit(this); m_pExtNameEditor->setToolTip( - __tr2qs_ctx("External menu name
This allows one to nest externally defined popup menus. The popup menu with the specified name will be looked up at menu setup time.","editor")); - g->addWidget(m_pExtNameEditor,5,1,1,2); + __tr2qs_ctx("External menu name
This allows one to nest externally defined popup menus. The popup menu with the specified name will be looked up at menu setup time.", "editor")); + g->addWidget(m_pExtNameEditor, 5, 1, 1, 2); - l = new QLabel(__tr2qs_ctx("Item ID:","editor"),this); + l = new QLabel(__tr2qs_ctx("Item ID:", "editor"), this); l->setMargin(2); - g->addWidget(l,6,0); - + g->addWidget(l, 6, 0); m_pIdEditor = new QLineEdit(this); m_pIdEditor->setToolTip( - __tr2qs_ctx("Item ID
This will allow you to use delpopupitem later.","editor")); - g->addWidget(m_pIdEditor,6,1,1,2); - g->setColumnStretch(1,1); - g->setRowStretch(1,1); + __tr2qs_ctx("Item ID
This will allow you to use delpopupitem later.", "editor")); + g->addWidget(m_pIdEditor, 6, 1, 1, 2); + g->setColumnStretch(1, 1); + g->setRowStretch(1, 1); } SinglePopupEditor::~SinglePopupEditor() @@ -283,59 +278,81 @@ SinglePopupEditor::~SinglePopupEditor() void SinglePopupEditor::testPopup() { - if(m_pTestPopup)delete m_pTestPopup; + if(m_pTestPopup) + delete m_pTestPopup; m_pTestPopup = getMenu(); - if(!m_pTestPopup)return; - connect(m_pTestPopup,SIGNAL(testModeItemClicked(KviKvsPopupMenuItem *)),this,SLOT(testModeMenuItemClicked(KviKvsPopupMenuItem *))); - QPoint pnt = m_pMenuButton->mapToGlobal(QPoint(0,m_pMenuButton->height())); + if(!m_pTestPopup) + return; + connect(m_pTestPopup, SIGNAL(testModeItemClicked(KviKvsPopupMenuItem *)), this, SLOT(testModeMenuItemClicked(KviKvsPopupMenuItem *))); + QPoint pnt = m_pMenuButton->mapToGlobal(QPoint(0, m_pMenuButton->height())); KviKvsVariantList * parms = new KviKvsVariantList(); parms->append(new KviKvsVariant(QString("test1"))); parms->append(new KviKvsVariant(QString("test2"))); parms->append(new KviKvsVariant(QString("test3"))); parms->append(new KviKvsVariant(QString("test4"))); - m_pTestPopup->doPopup(pnt,g_pActiveWindow,parms,true); + m_pTestPopup->doPopup(pnt, g_pActiveWindow, parms, true); } -PopupTreeWidgetItem * SinglePopupEditor::findMatchingItem(KviKvsPopupMenuItem * it,PopupTreeWidgetItem * item) +PopupTreeWidgetItem * SinglePopupEditor::findMatchingItem(KviKvsPopupMenuItem * it, PopupTreeWidgetItem * item) { - if(it->type() != KviKvsPopupMenuItem::Item)goto not_this_one; - if(item->m_type != PopupTreeWidgetItem::Item)goto not_this_one; - if(it->name() != item->m_szId)goto not_this_one; + if(it->type() != KviKvsPopupMenuItem::Item) + goto not_this_one; + if(item->m_type != PopupTreeWidgetItem::Item) + goto not_this_one; + if(it->name() != item->m_szId) + goto not_this_one; if(it->kvsText()) { - if(it->kvsText()->code() != item->m_szText)goto not_this_one; - } else { - if(!item->m_szText.isEmpty())goto not_this_one; + if(it->kvsText()->code() != item->m_szText) + goto not_this_one; + } + else + { + if(!item->m_szText.isEmpty()) + goto not_this_one; } if(it->kvsCode()) { - if(it->kvsCode()->code() != item->m_szCode)goto not_this_one; - } else { - if(!item->m_szCode.isEmpty())goto not_this_one; + if(it->kvsCode()->code() != item->m_szCode) + goto not_this_one; + } + else + { + if(!item->m_szCode.isEmpty()) + goto not_this_one; } if(it->kvsIcon()) { - if(it->kvsIcon()->code() != item->m_szIcon)goto not_this_one; - } else { - if(!item->m_szIcon.isEmpty())goto not_this_one; + if(it->kvsIcon()->code() != item->m_szIcon) + goto not_this_one; + } + else + { + if(!item->m_szIcon.isEmpty()) + goto not_this_one; } if(it->kvsCondition()) { - if(it->kvsCondition()->code() != item->m_szCondition)goto not_this_one; - } else { - if(!item->m_szCondition.isEmpty())goto not_this_one; + if(it->kvsCondition()->code() != item->m_szCondition) + goto not_this_one; + } + else + { + if(!item->m_szCondition.isEmpty()) + goto not_this_one; } return item; not_this_one: - int count=item->childCount(); - for(int i=0; ichildCount(); + for(int i = 0; i < count; i++) { item = (PopupTreeWidgetItem *)item->child(i); - PopupTreeWidgetItem * found = findMatchingItem(it,item); - if(found)return found; + PopupTreeWidgetItem * found = findMatchingItem(it, item); + if(found) + return found; } return 0; @@ -346,11 +363,11 @@ void SinglePopupEditor::testModeMenuItemClicked(KviKvsPopupMenuItem * it) saveLastSelectedItem(); // that's the first thingie // find the matching item and set it as current - int count=m_pTreeWidget->topLevelItemCount(); - for(int i=0; itopLevelItemCount(); + for(int i = 0; i < count; i++) { PopupTreeWidgetItem * item = (PopupTreeWidgetItem *)m_pTreeWidget->topLevelItem(i); - PopupTreeWidgetItem * found = findMatchingItem(it,item); + PopupTreeWidgetItem * found = findMatchingItem(it, item); if(found) { // set the item as current @@ -361,12 +378,11 @@ void SinglePopupEditor::testModeMenuItemClicked(KviKvsPopupMenuItem * it) return; } } - } -void SinglePopupEditor::customContextMenuRequested(const QPoint &pos) +void SinglePopupEditor::customContextMenuRequested(const QPoint & pos) { - QTreeWidgetItem *it=m_pTreeWidget->itemAt(pos); + QTreeWidgetItem * it = m_pTreeWidget->itemAt(pos); m_pContextPopup->clear(); @@ -379,106 +395,108 @@ void SinglePopupEditor::customContextMenuRequested(const QPoint &pos) bIsMenu = ((PopupTreeWidgetItem *)it)->m_type == PopupTreeWidgetItem::Menu; } - m_pContextPopup->addAction(__tr2qs_ctx("New Separator Below","editor"),this,SLOT(contextNewSeparatorBelow())); - m_pContextPopup->addAction(__tr2qs_ctx("New Separator Above","editor"),this,SLOT(contextNewSeparatorAbove())) - ->setEnabled(it); - m_pContextPopup->addAction(__tr2qs_ctx("New Separator Inside","editor"),this,SLOT(contextNewSeparatorInside())) - ->setEnabled(it && bIsMenu); + m_pContextPopup->addAction(__tr2qs_ctx("New Separator Below", "editor"), this, SLOT(contextNewSeparatorBelow())); + m_pContextPopup->addAction(__tr2qs_ctx("New Separator Above", "editor"), this, SLOT(contextNewSeparatorAbove())) + ->setEnabled(it); + m_pContextPopup->addAction(__tr2qs_ctx("New Separator Inside", "editor"), this, SLOT(contextNewSeparatorInside())) + ->setEnabled(it && bIsMenu); m_pContextPopup->addSeparator(); - m_pContextPopup->addAction(__tr2qs_ctx("New Label Below","editor"),this,SLOT(contextNewLabelBelow())); - m_pContextPopup->addAction(__tr2qs_ctx("New Label Above","editor"),this,SLOT(contextNewLabelAbove())) - ->setEnabled(it); - m_pContextPopup->addAction(__tr2qs_ctx("New Label Inside","editor"),this,SLOT(contextNewLabelInside())) - ->setEnabled(it && bIsMenu); + m_pContextPopup->addAction(__tr2qs_ctx("New Label Below", "editor"), this, SLOT(contextNewLabelBelow())); + m_pContextPopup->addAction(__tr2qs_ctx("New Label Above", "editor"), this, SLOT(contextNewLabelAbove())) + ->setEnabled(it); + m_pContextPopup->addAction(__tr2qs_ctx("New Label Inside", "editor"), this, SLOT(contextNewLabelInside())) + ->setEnabled(it && bIsMenu); m_pContextPopup->addSeparator(); - m_pContextPopup->addAction(__tr2qs_ctx("New Item Below","editor"),this,SLOT(contextNewItemBelow())); - m_pContextPopup->addAction(__tr2qs_ctx("New Item Above","editor"),this,SLOT(contextNewItemAbove())) - ->setEnabled(it); - m_pContextPopup->addAction(__tr2qs_ctx("New Item Inside","editor"),this,SLOT(contextNewItemInside())) - ->setEnabled(it && bIsMenu); + m_pContextPopup->addAction(__tr2qs_ctx("New Item Below", "editor"), this, SLOT(contextNewItemBelow())); + m_pContextPopup->addAction(__tr2qs_ctx("New Item Above", "editor"), this, SLOT(contextNewItemAbove())) + ->setEnabled(it); + m_pContextPopup->addAction(__tr2qs_ctx("New Item Inside", "editor"), this, SLOT(contextNewItemInside())) + ->setEnabled(it && bIsMenu); m_pContextPopup->addSeparator(); - m_pContextPopup->addAction(__tr2qs_ctx("New Menu Below","editor"),this,SLOT(contextNewMenuBelow())); - m_pContextPopup->addAction(__tr2qs_ctx("New Menu Above","editor"),this,SLOT(contextNewMenuAbove())) - ->setEnabled(it); - m_pContextPopup->addAction(__tr2qs_ctx("New Menu Inside","editor"),this,SLOT(contextNewMenuInside())) - ->setEnabled(it && bIsMenu); + m_pContextPopup->addAction(__tr2qs_ctx("New Menu Below", "editor"), this, SLOT(contextNewMenuBelow())); + m_pContextPopup->addAction(__tr2qs_ctx("New Menu Above", "editor"), this, SLOT(contextNewMenuAbove())) + ->setEnabled(it); + m_pContextPopup->addAction(__tr2qs_ctx("New Menu Inside", "editor"), this, SLOT(contextNewMenuInside())) + ->setEnabled(it && bIsMenu); m_pContextPopup->addSeparator(); - m_pContextPopup->addAction(__tr2qs_ctx("New External Menu Below","editor"),this,SLOT(contextNewExtMenuBelow())); - m_pContextPopup->addAction(__tr2qs_ctx("New External Menu Above","editor"),this,SLOT(contextNewExtMenuAbove())) - ->setEnabled(it); - m_pContextPopup->addAction(__tr2qs_ctx("New External Menu Inside","editor"),this,SLOT(contextNewExtMenuInside())) - ->setEnabled(it && bIsMenu); + m_pContextPopup->addAction(__tr2qs_ctx("New External Menu Below", "editor"), this, SLOT(contextNewExtMenuBelow())); + m_pContextPopup->addAction(__tr2qs_ctx("New External Menu Above", "editor"), this, SLOT(contextNewExtMenuAbove())) + ->setEnabled(it); + m_pContextPopup->addAction(__tr2qs_ctx("New External Menu Inside", "editor"), this, SLOT(contextNewExtMenuInside())) + ->setEnabled(it && bIsMenu); m_pContextPopup->addSeparator(); m_pContextPopup->addAction( - *(g_pIconManager->getSmallIcon(KviIconManager::Cut)), - __tr2qs_ctx("Cu&t","editor"),this,SLOT(contextCut())) - ->setEnabled(it); + *(g_pIconManager->getSmallIcon(KviIconManager::Cut)), + __tr2qs_ctx("Cu&t", "editor"), this, SLOT(contextCut())) + ->setEnabled(it); m_pContextPopup->addAction( - *(g_pIconManager->getSmallIcon(KviIconManager::Copy)), - __tr2qs_ctx("&Copy","editor"),this,SLOT(contextCopy())) - ->setEnabled(it); + *(g_pIconManager->getSmallIcon(KviIconManager::Copy)), + __tr2qs_ctx("&Copy", "editor"), this, SLOT(contextCopy())) + ->setEnabled(it); m_pContextPopup->addAction( - *(g_pIconManager->getSmallIcon(KviIconManager::Discard)), - __tr2qs_ctx("Re&move","editor"),this,SLOT(contextRemove())) - ->setEnabled(it); + *(g_pIconManager->getSmallIcon(KviIconManager::Discard)), + __tr2qs_ctx("Re&move", "editor"), this, SLOT(contextRemove())) + ->setEnabled(it); m_pContextPopup->addAction( - *(g_pIconManager->getSmallIcon(KviIconManager::Paste)), - __tr2qs_ctx("&Paste Below","editor"),this,SLOT(contextPasteBelow())) - ->setEnabled(m_pClipboard); + *(g_pIconManager->getSmallIcon(KviIconManager::Paste)), + __tr2qs_ctx("&Paste Below", "editor"), this, SLOT(contextPasteBelow())) + ->setEnabled(m_pClipboard); m_pContextPopup->addAction( - *(g_pIconManager->getSmallIcon(KviIconManager::Paste)), - __tr2qs_ctx("Paste Above","editor"),this,SLOT(contextPasteAbove())) - ->setEnabled(it && m_pClipboard); + *(g_pIconManager->getSmallIcon(KviIconManager::Paste)), + __tr2qs_ctx("Paste Above", "editor"), this, SLOT(contextPasteAbove())) + ->setEnabled(it && m_pClipboard); m_pContextPopup->addAction( - *(g_pIconManager->getSmallIcon(KviIconManager::Paste)), - __tr2qs_ctx("Paste Inside","editor"),this,SLOT(contextPasteInside())) - ->setEnabled(it && bIsMenu && m_pClipboard); + *(g_pIconManager->getSmallIcon(KviIconManager::Paste)), + __tr2qs_ctx("Paste Inside", "editor"), this, SLOT(contextPasteInside())) + ->setEnabled(it && bIsMenu && m_pClipboard); bool bSeparatorInserted = false; -// if(!findPrologue(parentMenu)) -// { + // if(!findPrologue(parentMenu)) + // { m_pContextPopup->addSeparator(); bSeparatorInserted = true; m_pContextPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::Prologue)), - __tr2qs_ctx("New Menu Prologue","editor"),this,SLOT(contextNewPrologue())); -// } + __tr2qs_ctx("New Menu Prologue", "editor"), this, SLOT(contextNewPrologue())); + // } -// if(!findEpilogue(parentMenu)) -// { - if(!bSeparatorInserted)m_pContextPopup->addSeparator(); + // if(!findEpilogue(parentMenu)) + // { + if(!bSeparatorInserted) + m_pContextPopup->addSeparator(); m_pContextPopup->addAction( - *(g_pIconManager->getSmallIcon(KviIconManager::Epilogue)), - __tr2qs_ctx("New Menu Epilogue","editor"),this,SLOT(contextNewEpilogue())); -// } + *(g_pIconManager->getSmallIcon(KviIconManager::Epilogue)), + __tr2qs_ctx("New Menu Epilogue", "editor"), this, SLOT(contextNewEpilogue())); + // } m_pContextPopup->popup(QCursor::pos()); } void SinglePopupEditor::createNewItemAboveLastSelected(PopupTreeWidgetItem::Type t) { - m_pTreeWidget->setCurrentItem(newItemAbove(m_pLastSelectedItem,t)); + m_pTreeWidget->setCurrentItem(newItemAbove(m_pLastSelectedItem, t)); } void SinglePopupEditor::createNewItemBelowLastSelected(PopupTreeWidgetItem::Type t) { - m_pTreeWidget->setCurrentItem(newItemBelow(m_pLastSelectedItem,t)); + m_pTreeWidget->setCurrentItem(newItemBelow(m_pLastSelectedItem, t)); } void SinglePopupEditor::createNewItemInsideLastSelected(PopupTreeWidgetItem::Type t) { - if(m_pLastSelectedItem)m_pLastSelectedItem->setExpanded(true); - m_pTreeWidget->setCurrentItem(newItemInside(m_pLastSelectedItem,t)); + if(m_pLastSelectedItem) + m_pLastSelectedItem->setExpanded(true); + m_pTreeWidget->setCurrentItem(newItemInside(m_pLastSelectedItem, t)); } void SinglePopupEditor::contextNewSeparatorAbove() @@ -555,76 +573,84 @@ void SinglePopupEditor::contextNewLabelInside() createNewItemInsideLastSelected(PopupTreeWidgetItem::Label); } -PopupTreeWidgetItem * SinglePopupEditor::newItem(PopupTreeWidgetItem * par,PopupTreeWidgetItem * after,PopupTreeWidgetItem::Type t) +PopupTreeWidgetItem * SinglePopupEditor::newItem(PopupTreeWidgetItem * par, PopupTreeWidgetItem * after, PopupTreeWidgetItem::Type t) { - if(par)return new PopupTreeWidgetItem(par,after,t); - return new PopupTreeWidgetItem(m_pTreeWidget,after,t); + if(par) + return new PopupTreeWidgetItem(par, after, t); + return new PopupTreeWidgetItem(m_pTreeWidget, after, t); } -PopupTreeWidgetItem * SinglePopupEditor::newItemBelow(PopupTreeWidgetItem * it,PopupTreeWidgetItem::Type t) +PopupTreeWidgetItem * SinglePopupEditor::newItemBelow(PopupTreeWidgetItem * it, PopupTreeWidgetItem::Type t) { - if(!it)return newItem(0,0,t); - return newItem((PopupTreeWidgetItem *)it->parent(),it,t); + if(!it) + return newItem(0, 0, t); + return newItem((PopupTreeWidgetItem *)it->parent(), it, t); } -PopupTreeWidgetItem * SinglePopupEditor::newItemAbove(PopupTreeWidgetItem * it,PopupTreeWidgetItem::Type t) +PopupTreeWidgetItem * SinglePopupEditor::newItemAbove(PopupTreeWidgetItem * it, PopupTreeWidgetItem::Type t) { - if(!it)return newItem(0,0,t); - return newItem((PopupTreeWidgetItem *)it->parent(),(PopupTreeWidgetItem *)m_pTreeWidget->itemAbove(it),t); + if(!it) + return newItem(0, 0, t); + return newItem((PopupTreeWidgetItem *)it->parent(), (PopupTreeWidgetItem *)m_pTreeWidget->itemAbove(it), t); } -PopupTreeWidgetItem * SinglePopupEditor::newItemInside(PopupTreeWidgetItem * it,PopupTreeWidgetItem::Type t) +PopupTreeWidgetItem * SinglePopupEditor::newItemInside(PopupTreeWidgetItem * it, PopupTreeWidgetItem::Type t) { if(it) { if(it->m_type != PopupTreeWidgetItem::Menu) { - return newItemBelow(it,t); + return newItemBelow(it, t); } } - return newItem(it,it,t); + return newItem(it, it, t); } void SinglePopupEditor::contextNewPrologue() { PopupTreeWidgetItem * it = m_pLastSelectedItem ? (PopupTreeWidgetItem *)m_pLastSelectedItem->parent() : 0; -// if(!findPrologue(it)) -// { - m_pTreeWidget->setCurrentItem(newItem(it,it,PopupTreeWidgetItem::Prologue)); -// } + // if(!findPrologue(it)) + // { + m_pTreeWidget->setCurrentItem(newItem(it, it, PopupTreeWidgetItem::Prologue)); + // } } void SinglePopupEditor::contextNewEpilogue() { PopupTreeWidgetItem * it = m_pLastSelectedItem ? (PopupTreeWidgetItem *)m_pLastSelectedItem->parent() : 0; -// if(!findEpilogue(it)) -// { + // if(!findEpilogue(it)) + // { PopupTreeWidgetItem * after = it ? (PopupTreeWidgetItem *)it->child(0) : (PopupTreeWidgetItem *)m_pTreeWidget->topLevelItem(0); if(after) { while(m_pTreeWidget->itemAbove(after)) { - if(after->parent()==m_pTreeWidget->itemAbove(after)->parent()) + if(after->parent() == m_pTreeWidget->itemAbove(after)->parent()) after = (PopupTreeWidgetItem *)m_pTreeWidget->itemAbove(after); } - } else { + } + else + { after = it; } - m_pTreeWidget->setCurrentItem(newItem(it,after,PopupTreeWidgetItem::Epilogue)); -// } + m_pTreeWidget->setCurrentItem(newItem(it, after, PopupTreeWidgetItem::Epilogue)); + // } } void SinglePopupEditor::contextCopy() { - if(!m_pLastSelectedItem)return; - if(m_pClipboard)delete m_pClipboard; + if(!m_pLastSelectedItem) + return; + if(m_pClipboard) + delete m_pClipboard; m_pClipboard = new KviKvsPopupMenu("clipboard"); - addItemToMenu(m_pClipboard,m_pLastSelectedItem); + addItemToMenu(m_pClipboard, m_pLastSelectedItem); } void SinglePopupEditor::contextCut() { - if(!m_pLastSelectedItem)return; + if(!m_pLastSelectedItem) + return; contextCopy(); delete m_pLastSelectedItem; @@ -634,7 +660,8 @@ void SinglePopupEditor::contextCut() void SinglePopupEditor::contextRemove() { - if(!m_pLastSelectedItem)return; + if(!m_pLastSelectedItem) + return; delete m_pLastSelectedItem; m_pLastSelectedItem = nullptr; @@ -643,22 +670,25 @@ void SinglePopupEditor::contextRemove() void SinglePopupEditor::contextPasteBelow() { - if(!m_pClipboard)return; + if(!m_pClipboard) + return; PopupTreeWidgetItem * par = m_pLastSelectedItem ? (PopupTreeWidgetItem *)m_pLastSelectedItem->parent() : 0; - populateMenu(m_pClipboard,par,m_pLastSelectedItem); + populateMenu(m_pClipboard, par, m_pLastSelectedItem); } void SinglePopupEditor::contextPasteAbove() { - if(!m_pClipboard)return; + if(!m_pClipboard) + return; PopupTreeWidgetItem * par = m_pLastSelectedItem ? (PopupTreeWidgetItem *)m_pLastSelectedItem->parent() : 0; PopupTreeWidgetItem * above = m_pLastSelectedItem ? (PopupTreeWidgetItem *)m_pTreeWidget->itemAbove(m_pLastSelectedItem) : 0; - populateMenu(m_pClipboard,par,above); + populateMenu(m_pClipboard, par, above); } void SinglePopupEditor::contextPasteInside() { - if(!m_pClipboard)return; + if(!m_pClipboard) + return; if(m_pLastSelectedItem) { if(m_pLastSelectedItem->m_type != PopupTreeWidgetItem::Menu) @@ -668,12 +698,13 @@ void SinglePopupEditor::contextPasteInside() } m_pLastSelectedItem->setExpanded(true); } - populateMenu(m_pClipboard,m_pLastSelectedItem,0); + populateMenu(m_pClipboard, m_pLastSelectedItem, 0); } void SinglePopupEditor::saveLastSelectedItem() { - if(!m_pLastSelectedItem)return; + if(!m_pLastSelectedItem) + return; QString tmp; @@ -689,7 +720,7 @@ void SinglePopupEditor::saveLastSelectedItem() } break; default: - break; + break; } m_pLastSelectedItem->setId(m_pIdEditor->text()); @@ -700,9 +731,9 @@ void SinglePopupEditor::saveLastSelectedItem() case PopupTreeWidgetItem::ExtMenu: case PopupTreeWidgetItem::Item: m_pLastSelectedItem->setIcon(m_pIconEditor->text()); - break; + break; default: - break; + break; } switch(m_pLastSelectedItem->m_type) @@ -712,9 +743,9 @@ void SinglePopupEditor::saveLastSelectedItem() case PopupTreeWidgetItem::Label: case PopupTreeWidgetItem::ExtMenu: m_pLastSelectedItem->setItemText(m_pTextEditor->text()); - break; + break; default: - break; + break; } switch(m_pLastSelectedItem->m_type) @@ -725,9 +756,9 @@ void SinglePopupEditor::saveLastSelectedItem() case PopupTreeWidgetItem::ExtMenu: case PopupTreeWidgetItem::Separator: m_pLastSelectedItem->setCondition(m_pConditionEditor->text()); - break; + break; default: - break; + break; } if(m_pLastSelectedItem->m_type == PopupTreeWidgetItem::ExtMenu) @@ -736,58 +767,58 @@ void SinglePopupEditor::saveLastSelectedItem() } } -void SinglePopupEditor::addItemToMenu(KviKvsPopupMenu * p,PopupTreeWidgetItem *it) +void SinglePopupEditor::addItemToMenu(KviKvsPopupMenu * p, PopupTreeWidgetItem * it) { it->m_szId = it->m_szId.trimmed(); switch(it->m_type) { case PopupTreeWidgetItem::Prologue: it->m_szCode = it->m_szCode.trimmed(); - p->addPrologue(it->m_szId,it->m_szCode); - break; + p->addPrologue(it->m_szId, it->m_szCode); + break; case PopupTreeWidgetItem::Epilogue: it->m_szCode = it->m_szCode.trimmed(); - p->addEpilogue(it->m_szId,it->m_szCode); - break; + p->addEpilogue(it->m_szId, it->m_szCode); + break; case PopupTreeWidgetItem::Separator: it->m_szCondition = it->m_szCondition.trimmed(); - p->addSeparator(it->m_szId,it->m_szCondition); - break; + p->addSeparator(it->m_szId, it->m_szCondition); + break; case PopupTreeWidgetItem::Label: it->m_szText = it->m_szText.trimmed(); it->m_szCondition = it->m_szCondition.trimmed(); it->m_szIcon = it->m_szIcon.trimmed(); - p->addLabel(it->m_szId,it->m_szText,it->m_szIcon,it->m_szCondition); - break; + p->addLabel(it->m_szId, it->m_szText, it->m_szIcon, it->m_szCondition); + break; case PopupTreeWidgetItem::Item: it->m_szText = it->m_szText.trimmed(); it->m_szIcon = it->m_szIcon.trimmed(); it->m_szCondition = it->m_szCondition.trimmed(); it->m_szCode = it->m_szCode.trimmed(); - p->addItem(it->m_szId,it->m_szCode,it->m_szText,it->m_szIcon,it->m_szCondition); - break; + p->addItem(it->m_szId, it->m_szCode, it->m_szText, it->m_szIcon, it->m_szCondition); + break; case PopupTreeWidgetItem::ExtMenu: it->m_szText = it->m_szText.trimmed(); it->m_szIcon = it->m_szIcon.trimmed(); it->m_szCondition = it->m_szCondition.trimmed(); - it->m_szCode = it->m_szCode.trimmed();// <-- this is the ext name in fact - p->addExtPopup(it->m_szId,it->m_szCode,it->m_szText,it->m_szIcon,it->m_szCondition); - break; + it->m_szCode = it->m_szCode.trimmed(); // <-- this is the ext name in fact + p->addExtPopup(it->m_szId, it->m_szCode, it->m_szText, it->m_szIcon, it->m_szCondition); + break; case PopupTreeWidgetItem::Menu: { it->m_szText = it->m_szText.trimmed(); it->m_szIcon = it->m_szIcon.trimmed(); it->m_szCondition = it->m_szCondition.trimmed(); - KviKvsPopupMenu * menu = p->addPopup(it->m_szId,it->m_szText,it->m_szIcon,it->m_szCondition); - int count= it->childCount(); - for(int i=0; iaddPopup(it->m_szId, it->m_szText, it->m_szIcon, it->m_szCondition); + int count = it->childCount(); + for(int i = 0; i < count; i++) { - addItemToMenu(menu,(PopupTreeWidgetItem *)it->child(i)); + addItemToMenu(menu, (PopupTreeWidgetItem *)it->child(i)); } } break; default: - break; + break; } } @@ -799,10 +830,10 @@ KviKvsPopupMenu * SinglePopupEditor::getMenu() KviKvsPopupMenu * p = new KviKvsPopupMenu(tmp); - int count= m_pTreeWidget->topLevelItemCount(); - for(int i=0; itopLevelItemCount(); + for(int i = 0; i < count; i++) { - addItemToMenu(p,(PopupTreeWidgetItem *)m_pTreeWidget->topLevelItem(i)); + addItemToMenu(p, (PopupTreeWidgetItem *)m_pTreeWidget->topLevelItem(i)); } return p; } @@ -821,9 +852,11 @@ void SinglePopupEditor::selectionChanged() if(m_pTreeWidget->selectedItems().empty()) { - it=0; - } else { - it= (QTreeWidgetItem*)m_pTreeWidget->selectedItems().first(); + it = 0; + } + else + { + it = (QTreeWidgetItem *)m_pTreeWidget->selectedItems().first(); } if(it) @@ -837,9 +870,9 @@ void SinglePopupEditor::selectionChanged() case PopupTreeWidgetItem::Item: m_pEditor->setText(((PopupTreeWidgetItem *)it)->m_szCode); bEditorEnabled = true; - break; + break; default: - break; + break; } switch(((PopupTreeWidgetItem *)it)->m_type) @@ -850,9 +883,10 @@ void SinglePopupEditor::selectionChanged() case PopupTreeWidgetItem::ExtMenu: m_pIconEditor->setText(((PopupTreeWidgetItem *)it)->m_szIcon); bIconEditorEnabled = true; - break; + break; default: - break; } + break; + } switch(((PopupTreeWidgetItem *)it)->m_type) { @@ -862,9 +896,9 @@ void SinglePopupEditor::selectionChanged() case PopupTreeWidgetItem::ExtMenu: m_pTextEditor->setText(((PopupTreeWidgetItem *)it)->m_szText); bTextEditorEnabled = true; - break; + break; default: - break; + break; } switch(((PopupTreeWidgetItem *)it)->m_type) @@ -876,100 +910,121 @@ void SinglePopupEditor::selectionChanged() case PopupTreeWidgetItem::Separator: m_pConditionEditor->setText(((PopupTreeWidgetItem *)it)->m_szCondition); bConditionEditorEnabled = true; - break; + break; default: - break; + break; } if(((PopupTreeWidgetItem *)it)->m_type == PopupTreeWidgetItem::ExtMenu) { m_pExtNameEditor->setText(((PopupTreeWidgetItem *)it)->m_szCode); - bNameEditorEnabled =true; + bNameEditorEnabled = true; } } m_pLastSelectedItem = (PopupTreeWidgetItem *)it; - if(!bEditorEnabled)m_pEditor->setText(""); + if(!bEditorEnabled) + m_pEditor->setText(""); m_pEditor->setEnabled(bEditorEnabled); - if(!bIconEditorEnabled)m_pIconEditor->setText(""); + if(!bIconEditorEnabled) + m_pIconEditor->setText(""); m_pIconEditor->setEnabled(bIconEditorEnabled); - if(!bConditionEditorEnabled)m_pConditionEditor->setText(""); + if(!bConditionEditorEnabled) + m_pConditionEditor->setText(""); m_pConditionEditor->setEnabled(bConditionEditorEnabled); - if(!bTextEditorEnabled)m_pTextEditor->setText(""); + if(!bTextEditorEnabled) + m_pTextEditor->setText(""); m_pTextEditor->setEnabled(bTextEditorEnabled); m_pExtNameEditor->setEnabled(bNameEditorEnabled); - if(!bNameEditorEnabled)m_pExtNameEditor->setText(""); - if(!it)m_pIdEditor->setText(""); + if(!bNameEditorEnabled) + m_pExtNameEditor->setText(""); + if(!it) + m_pIdEditor->setText(""); m_pIdEditor->setEnabled(it); } -void SinglePopupEditor::populateMenu(KviKvsPopupMenu * pop,PopupTreeWidgetItem * par,PopupTreeWidgetItem * theItem) +void SinglePopupEditor::populateMenu(KviKvsPopupMenu * pop, PopupTreeWidgetItem * par, PopupTreeWidgetItem * theItem) { - if(!pop)return; + if(!pop) + return; - for(KviKvsScript * sp = pop->prologues()->first();sp;sp = pop->prologues()->next()) + for(KviKvsScript * sp = pop->prologues()->first(); sp; sp = pop->prologues()->next()) { - if(par)theItem = new PopupTreeWidgetItem(par,theItem,PopupTreeWidgetItem::Prologue); - else theItem = new PopupTreeWidgetItem(m_pTreeWidget,theItem,PopupTreeWidgetItem::Prologue); + if(par) + theItem = new PopupTreeWidgetItem(par, theItem, PopupTreeWidgetItem::Prologue); + else + theItem = new PopupTreeWidgetItem(m_pTreeWidget, theItem, PopupTreeWidgetItem::Prologue); theItem->setCode(sp->code()); theItem->setId(sp->name()); } - for(KviKvsPopupMenuItem * item = pop->itemList()->first();item;item = pop->itemList()->next()) + for(KviKvsPopupMenuItem * item = pop->itemList()->first(); item; item = pop->itemList()->next()) { switch(item->type()) { case KviKvsPopupMenuItem::Item: - if(par)theItem = new PopupTreeWidgetItem(par,theItem,PopupTreeWidgetItem::Item); - else theItem = new PopupTreeWidgetItem(m_pTreeWidget,theItem,PopupTreeWidgetItem::Item); + if(par) + theItem = new PopupTreeWidgetItem(par, theItem, PopupTreeWidgetItem::Item); + else + theItem = new PopupTreeWidgetItem(m_pTreeWidget, theItem, PopupTreeWidgetItem::Item); theItem->setIcon(item->kvsIcon() ? item->kvsIcon()->code() : QString()); theItem->setItemText(item->kvsText() ? item->kvsText()->code() : QString()); theItem->setCondition(item->kvsCondition() ? item->kvsCondition()->code() : QString()); theItem->setCode(item->kvsCode() ? item->kvsCode()->code() : QString()); theItem->setId(item->name()); - break; + break; case KviKvsPopupMenuItem::ExtMenu: - if(par)theItem = new PopupTreeWidgetItem(par,theItem,PopupTreeWidgetItem::ExtMenu); - else theItem = new PopupTreeWidgetItem(m_pTreeWidget,theItem,PopupTreeWidgetItem::ExtMenu); + if(par) + theItem = new PopupTreeWidgetItem(par, theItem, PopupTreeWidgetItem::ExtMenu); + else + theItem = new PopupTreeWidgetItem(m_pTreeWidget, theItem, PopupTreeWidgetItem::ExtMenu); theItem->setIcon(item->kvsIcon() ? item->kvsIcon()->code() : QString()); theItem->setItemText(item->kvsText() ? item->kvsText()->code() : QString()); theItem->setCondition(item->kvsCondition() ? item->kvsCondition()->code() : QString()); theItem->setCode(((KviKvsPopupMenuItemExtMenu *)item)->extName()); theItem->setId(item->name()); - break; + break; case KviKvsPopupMenuItem::Label: - if(par)theItem = new PopupTreeWidgetItem(par,theItem,PopupTreeWidgetItem::Label); - else theItem = new PopupTreeWidgetItem(m_pTreeWidget,theItem,PopupTreeWidgetItem::Label); + if(par) + theItem = new PopupTreeWidgetItem(par, theItem, PopupTreeWidgetItem::Label); + else + theItem = new PopupTreeWidgetItem(m_pTreeWidget, theItem, PopupTreeWidgetItem::Label); theItem->setIcon(item->kvsIcon() ? item->kvsIcon()->code() : QString()); theItem->setItemText(item->kvsText() ? item->kvsText()->code() : QString()); theItem->setCondition(item->kvsCondition() ? item->kvsCondition()->code() : QString()); theItem->setId(item->name()); - break; + break; case KviKvsPopupMenuItem::Separator: - if(par)theItem = new PopupTreeWidgetItem(par,theItem,PopupTreeWidgetItem::Separator); - else theItem = new PopupTreeWidgetItem(m_pTreeWidget,theItem,PopupTreeWidgetItem::Separator); + if(par) + theItem = new PopupTreeWidgetItem(par, theItem, PopupTreeWidgetItem::Separator); + else + theItem = new PopupTreeWidgetItem(m_pTreeWidget, theItem, PopupTreeWidgetItem::Separator); theItem->setCondition(item->kvsCondition() ? item->kvsCondition()->code() : QString()); theItem->setId(item->name()); - break; + break; case KviKvsPopupMenuItem::Menu: - if(par)theItem = new PopupTreeWidgetItem(par,theItem,PopupTreeWidgetItem::Menu); - else theItem = new PopupTreeWidgetItem(m_pTreeWidget,theItem,PopupTreeWidgetItem::Menu); + if(par) + theItem = new PopupTreeWidgetItem(par, theItem, PopupTreeWidgetItem::Menu); + else + theItem = new PopupTreeWidgetItem(m_pTreeWidget, theItem, PopupTreeWidgetItem::Menu); theItem->setIcon(item->kvsIcon() ? item->kvsIcon()->code() : QString()); theItem->setItemText(item->kvsText() ? item->kvsText()->code() : QString()); theItem->setCondition(item->kvsCondition() ? item->kvsCondition()->code() : QString()); theItem->setId(item->name()); - populateMenu(((KviKvsPopupMenuItemMenu *)item)->menu(),theItem,0); - break; + populateMenu(((KviKvsPopupMenuItemMenu *)item)->menu(), theItem, 0); + break; default: - break; + break; } } - for(KviKvsScript * se = pop->epilogues()->first();se;se = pop->epilogues()->next()) + for(KviKvsScript * se = pop->epilogues()->first(); se; se = pop->epilogues()->next()) { - if(par)theItem = new PopupTreeWidgetItem(par,theItem,PopupTreeWidgetItem::Epilogue); - else theItem = new PopupTreeWidgetItem(m_pTreeWidget,theItem,PopupTreeWidgetItem::Epilogue); + if(par) + theItem = new PopupTreeWidgetItem(par, theItem, PopupTreeWidgetItem::Epilogue); + else + theItem = new PopupTreeWidgetItem(m_pTreeWidget, theItem, PopupTreeWidgetItem::Epilogue); theItem->setCode(se->code()); theItem->setId(se->name()); } @@ -990,8 +1045,10 @@ void SinglePopupEditor::edit(MenuTreeWidgetItem * it) if(it) { m_pNameEditor->setText(it->m_pPopup->popupName()); - populateMenu(it->m_pPopup,0,0); - } else { + populateMenu(it->m_pPopup, 0, 0); + } + else + { m_pIconEditor->setText(""); m_pIconEditor->setEnabled(false); m_pIdEditor->setText(""); @@ -1009,15 +1066,13 @@ void SinglePopupEditor::edit(MenuTreeWidgetItem * it) m_pTreeWidget->setEnabled(it); m_pNameEditor->setEnabled(it); m_pMenuButton->setEnabled(it); - } - -MenuTreeWidgetItem::MenuTreeWidgetItem(QTreeWidget * par,KviKvsPopupMenu * popup) -: QTreeWidgetItem(par) +MenuTreeWidgetItem::MenuTreeWidgetItem(QTreeWidget * par, KviKvsPopupMenu * popup) + : QTreeWidgetItem(par) { - setIcon(0,*(g_pIconManager->getSmallIcon(KviIconManager::Popup))); - setText(0,popup->popupName()); + setIcon(0, *(g_pIconManager->getSmallIcon(KviIconManager::Popup))); + setText(0, popup->popupName()); m_pPopup = popup; } @@ -1033,27 +1088,27 @@ void MenuTreeWidgetItem::replacePopup(KviKvsPopupMenu * popup) } PopupEditorWidget::PopupEditorWidget(QWidget * par) -: QWidget(par) + : QWidget(par) { m_bSaving = false; QGridLayout * l = new QGridLayout(this); - QSplitter * spl = new QSplitter(Qt::Horizontal,this); + QSplitter * spl = new QSplitter(Qt::Horizontal, this); spl->setObjectName("popupeditor_horizontal_splitter"); spl->setChildrenCollapsible(false); - l->addWidget(spl,0,0); + l->addWidget(spl, 0, 0); KviTalVBox * box = new KviTalVBox(spl); m_pTreeWidget = new QTreeWidget(box); - m_pTreeWidget->setHeaderLabel(__tr2qs_ctx("Popup","editor")); + m_pTreeWidget->setHeaderLabel(__tr2qs_ctx("Popup", "editor")); m_pTreeWidget->setSelectionMode(QAbstractItemView::ExtendedSelection); m_pTreeWidget->header()->setSortIndicatorShown(true); - QPushButton * pb = new QPushButton(__tr2qs_ctx("&Export All to...","editor"),box); - connect(pb,SIGNAL(clicked()),this,SLOT(exportAll())); - QPushButton * gn = new QPushButton(__tr2qs_ctx("&Export Selected to...","editor"),box); - connect(gn,SIGNAL(clicked()),this,SLOT(exportSelected())); + QPushButton * pb = new QPushButton(__tr2qs_ctx("&Export All to...", "editor"), box); + connect(pb, SIGNAL(clicked()), this, SLOT(exportAll())); + QPushButton * gn = new QPushButton(__tr2qs_ctx("&Export Selected to...", "editor"), box); + connect(gn, SIGNAL(clicked()), this, SLOT(exportSelected())); m_pEditor = new SinglePopupEditor(spl); @@ -1063,10 +1118,10 @@ PopupEditorWidget::PopupEditorWidget(QWidget * par) m_pContextPopup = new QMenu(this); m_pEmptyContextPopup = new QMenu(this); - spl->setStretchFactor(0,20); - spl->setStretchFactor(1,80); + spl->setStretchFactor(0, 20); + spl->setStretchFactor(1, 80); - currentItemChanged(0,0); + currentItemChanged(0, 0); } PopupEditorWidget::~PopupEditorWidget() @@ -1075,61 +1130,66 @@ PopupEditorWidget::~PopupEditorWidget() void PopupEditorWidget::oneTimeSetup() { - if(m_bOneTimeSetupDone)return; + if(m_bOneTimeSetupDone) + return; m_bOneTimeSetupDone = true; - const KviPointerHashTable * a = KviKvsPopupManager::instance()->popupDict(); - if(!a)return; + const KviPointerHashTable * a = KviKvsPopupManager::instance()->popupDict(); + if(!a) + return; - KviPointerHashTableIterator it(*a); + KviPointerHashTableIterator it(*a); while(it.current()) { KviKvsPopupMenu * popup = it.current(); KviKvsPopupMenu * copy = new KviKvsPopupMenu(popup->popupName()); copy->copyFrom(popup); - new MenuTreeWidgetItem(m_pTreeWidget,copy); + new MenuTreeWidgetItem(m_pTreeWidget, copy); ++it; } m_pTreeWidget->setContextMenuPolicy(Qt::CustomContextMenu); - connect(m_pTreeWidget,SIGNAL(currentItemChanged(QTreeWidgetItem *,QTreeWidgetItem *)),this,SLOT(currentItemChanged(QTreeWidgetItem *,QTreeWidgetItem *))); - connect(m_pTreeWidget,SIGNAL(customContextMenuRequested(const QPoint &)), - this,SLOT(customContextMenuRequested(const QPoint &))); - connect(KviKvsPopupManager::instance(),SIGNAL(popupRefresh(const QString &)),this,SLOT(popupRefresh(const QString &))); + connect(m_pTreeWidget, SIGNAL(currentItemChanged(QTreeWidgetItem *, QTreeWidgetItem *)), this, SLOT(currentItemChanged(QTreeWidgetItem *, QTreeWidgetItem *))); + connect(m_pTreeWidget, SIGNAL(customContextMenuRequested(const QPoint &)), + this, SLOT(customContextMenuRequested(const QPoint &))); + connect(KviKvsPopupManager::instance(), SIGNAL(popupRefresh(const QString &)), this, SLOT(popupRefresh(const QString &))); } -void PopupEditorWidget::popupRefresh(const QString &szName) +void PopupEditorWidget::popupRefresh(const QString & szName) { if(m_bSaving) return; - KviPointerHashTable * pTable = KviKvsPopupManager::instance()->popupDict(); - if(!pTable) return; + KviPointerHashTable * pTable = KviKvsPopupManager::instance()->popupDict(); + if(!pTable) + return; KviKvsPopupMenu * pPopup = pTable->find(szName); - if(!pPopup) return; + if(!pPopup) + return; // if it already exists, replace its popup - for(int i=0; itopLevelItemCount();i++) + for(int i = 0; i < m_pTreeWidget->topLevelItemCount(); i++) { MenuTreeWidgetItem * ch = (MenuTreeWidgetItem *)m_pTreeWidget->topLevelItem(i); - if(KviQString::equalCI(szName,ch->m_pPopup->popupName())) + if(KviQString::equalCI(szName, ch->m_pPopup->popupName())) { - if(ch==m_pLastEditedItem) + if(ch == m_pLastEditedItem) { if( - QMessageBox::warning(0,__tr2qs_ctx("Confirm Overwriting Current - KVIrc","editor"), - __tr2qs_ctx("An external script has changed the popup you are currently editing. Do you want to accept the external changes?","editor"), - QMessageBox::Yes,QMessageBox::No|QMessageBox::Default|QMessageBox::Escape) != QMessageBox::Yes - ) return; + QMessageBox::warning(0, __tr2qs_ctx("Confirm Overwriting Current - KVIrc", "editor"), + __tr2qs_ctx("An external script has changed the popup you are currently editing. Do you want to accept the external changes?", "editor"), + QMessageBox::Yes, QMessageBox::No | QMessageBox::Default | QMessageBox::Escape) + != QMessageBox::Yes) + return; } KviKvsPopupMenu * pCopy = new KviKvsPopupMenu(szName); pCopy->copyFrom(pPopup); ch->replacePopup(pCopy); //refresh current item - if(ch==m_pLastEditedItem) + if(ch == m_pLastEditedItem) m_pEditor->edit(m_pLastEditedItem); return; } @@ -1137,12 +1197,12 @@ void PopupEditorWidget::popupRefresh(const QString &szName) // create it KviKvsPopupMenu * pCopy = new KviKvsPopupMenu(szName); pCopy->copyFrom(pPopup); - new MenuTreeWidgetItem(m_pTreeWidget,pCopy); + new MenuTreeWidgetItem(m_pTreeWidget, pCopy); } -void PopupEditorWidget::customContextMenuRequested(const QPoint &pos) +void PopupEditorWidget::customContextMenuRequested(const QPoint & pos) { - QTreeWidgetItem *it=m_pTreeWidget->itemAt(pos); + QTreeWidgetItem * it = m_pTreeWidget->itemAt(pos); KVI_ASSERT(m_bOneTimeSetupDone); if(it) @@ -1150,67 +1210,73 @@ void PopupEditorWidget::customContextMenuRequested(const QPoint &pos) m_pContextPopup->clear(); m_pContextPopup->addAction( - *(g_pIconManager->getSmallIcon(KviIconManager::Popup)), - __tr2qs_ctx("&New Popup","editor"), - this,SLOT(newPopup())); + *(g_pIconManager->getSmallIcon(KviIconManager::Popup)), + __tr2qs_ctx("&New Popup", "editor"), + this, SLOT(newPopup())); m_pContextPopup->addAction( - *(g_pIconManager->getSmallIcon(KviIconManager::Discard)), - __tr2qs_ctx("Re&move Popup","editor"), - this,SLOT(removeCurrentPopup())) - ->setEnabled(it); + *(g_pIconManager->getSmallIcon(KviIconManager::Discard)), + __tr2qs_ctx("Re&move Popup", "editor"), + this, SLOT(removeCurrentPopup())) + ->setEnabled(it); m_pContextPopup->addAction( - *(g_pIconManager->getSmallIcon(KviIconManager::Save)), - __tr2qs_ctx("&Export Popup to...","editor"), - this,SLOT(exportCurrentPopup())) - ->setEnabled(it); + *(g_pIconManager->getSmallIcon(KviIconManager::Save)), + __tr2qs_ctx("&Export Popup to...", "editor"), + this, SLOT(exportCurrentPopup())) + ->setEnabled(it); m_pContextPopup->popup(QCursor::pos()); - } else { + } + else + { m_pEmptyContextPopup->clear(); m_pEmptyContextPopup->addAction( - *(g_pIconManager->getSmallIcon(KviIconManager::Popup)), - __tr2qs_ctx("&New Popup","editor"), - this,SLOT(newPopup())); + *(g_pIconManager->getSmallIcon(KviIconManager::Popup)), + __tr2qs_ctx("&New Popup", "editor"), + this, SLOT(newPopup())); m_pEmptyContextPopup->popup(QCursor::pos()); } } void PopupEditorWidget::exportCurrentPopup() { - if(!m_pLastEditedItem)return; + if(!m_pLastEditedItem) + return; saveLastEditedItem(); - if(!m_pLastEditedItem)return; + if(!m_pLastEditedItem) + return; QString szName = QDir::homePath(); - if(!szName.endsWith(QString(KVI_PATH_SEPARATOR)))szName += KVI_PATH_SEPARATOR; + if(!szName.endsWith(QString(KVI_PATH_SEPARATOR))) + szName += KVI_PATH_SEPARATOR; szName += m_pLastEditedItem->popup()->popupName(); szName += ".kvs"; QString szFile; - if(!KviFileDialog::askForSaveFileName(szFile,__tr2qs_ctx("Enter a Filename - KVIrc","editor"),szName,KVI_FILTER_SCRIPT,true,true,true,this))return; + if(!KviFileDialog::askForSaveFileName(szFile, __tr2qs_ctx("Enter a Filename - KVIrc", "editor"), szName, KVI_FILTER_SCRIPT, true, true, true, this)) + return; QString szOut; m_pLastEditedItem->popup()->generateDefPopup(szOut); - if(!KviFileUtils::writeFile(szFile,szOut)) + if(!KviFileUtils::writeFile(szFile, szOut)) { - QMessageBox::warning(this,__tr2qs_ctx("Writing to File Failed - KVIrc","editor"),__tr2qs_ctx("Unable to write to the popups file.","editor"),__tr2qs_ctx("OK","editor")); + QMessageBox::warning(this, __tr2qs_ctx("Writing to File Failed - KVIrc", "editor"), __tr2qs_ctx("Unable to write to the popups file.", "editor"), __tr2qs_ctx("OK", "editor")); } } void PopupEditorWidget::exportAll() { - bool bSelectedOnly=true; + bool bSelectedOnly = true; exportPopups(bSelectedOnly); } void PopupEditorWidget::exportSelected() { - bool bSelectedOnly=false; + bool bSelectedOnly = false; exportPopups(bSelectedOnly); } @@ -1219,12 +1285,12 @@ void PopupEditorWidget::exportPopups(bool bSelectedOnly) saveLastEditedItem(); QString out; - int count=0, topcount=m_pTreeWidget->topLevelItemCount(); + int count = 0, topcount = m_pTreeWidget->topLevelItemCount(); - for(int i=0; itopLevelItem(i); - if((it->isSelected()) || (bSelectedOnly == true) ) + if((it->isSelected()) || (bSelectedOnly == true)) { count++; QString tmp; @@ -1237,16 +1303,18 @@ void PopupEditorWidget::exportPopups(bool bSelectedOnly) return; QString szName = QDir::homePath(); - if(!szName.endsWith(QString(KVI_PATH_SEPARATOR)))szName += KVI_PATH_SEPARATOR; + if(!szName.endsWith(QString(KVI_PATH_SEPARATOR))) + szName += KVI_PATH_SEPARATOR; szName += "popups.kvs"; QString szFile; - if(!KviFileDialog::askForSaveFileName(szFile,__tr2qs_ctx("Enter a Filename - KVIrc","editor"),szName,KVI_FILTER_SCRIPT,true,true,true,this))return; + if(!KviFileDialog::askForSaveFileName(szFile, __tr2qs_ctx("Enter a Filename - KVIrc", "editor"), szName, KVI_FILTER_SCRIPT, true, true, true, this)) + return; - if(!KviFileUtils::writeFile(szFile,out)) + if(!KviFileUtils::writeFile(szFile, out)) { - QMessageBox::warning(this,__tr2qs_ctx("Writing to File Failed - KVIrc","editor"),__tr2qs_ctx("Unable to write to the popups file.","editor"),__tr2qs_ctx("OK","editor")); + QMessageBox::warning(this, __tr2qs_ctx("Writing to File Failed - KVIrc", "editor"), __tr2qs_ctx("Unable to write to the popups file.", "editor"), __tr2qs_ctx("OK", "editor")); } } @@ -1258,36 +1326,37 @@ void PopupEditorWidget::removeCurrentPopup() m_pLastEditedItem = nullptr; delete it; if(!m_pLastEditedItem) - currentItemChanged(0,0); + currentItemChanged(0, 0); } } void PopupEditorWidget::newPopup() { QString newName; - getUniquePopupName(0,newName); - MenuTreeWidgetItem * it = new MenuTreeWidgetItem(m_pTreeWidget,new KviKvsPopupMenu(newName)); + getUniquePopupName(0, newName); + MenuTreeWidgetItem * it = new MenuTreeWidgetItem(m_pTreeWidget, new KviKvsPopupMenu(newName)); m_pTreeWidget->setCurrentItem(it); } void PopupEditorWidget::saveLastEditedItem() { - if(!m_pLastEditedItem)return; + if(!m_pLastEditedItem) + return; KviKvsPopupMenu * m = m_pEditor->getMenu(); QString tmp = m->popupName(); QString old = m_pLastEditedItem->m_pPopup->popupName(); - if(!KviQString::equalCI(tmp,old)) + if(!KviQString::equalCI(tmp, old)) { - getUniquePopupName(m_pLastEditedItem,tmp); + getUniquePopupName(m_pLastEditedItem, tmp); m->setPopupName(tmp); } m_pLastEditedItem->replacePopup(m); - m_pLastEditedItem->setText(0,m->popupName()); + m_pLastEditedItem->setText(0, m->popupName()); } -void PopupEditorWidget::currentItemChanged(QTreeWidgetItem *it, QTreeWidgetItem *) +void PopupEditorWidget::currentItemChanged(QTreeWidgetItem * it, QTreeWidgetItem *) { saveLastEditedItem(); @@ -1296,7 +1365,7 @@ void PopupEditorWidget::currentItemChanged(QTreeWidgetItem *it, QTreeWidgetItem m_pEditor->edit(m_pLastEditedItem); } -void PopupEditorWidget::showEvent(QShowEvent *e) +void PopupEditorWidget::showEvent(QShowEvent * e) { oneTimeSetup(); QWidget::showEvent(e); @@ -1305,19 +1374,20 @@ void PopupEditorWidget::showEvent(QShowEvent *e) void PopupEditorWidget::commit() { m_bSaving = true; - if(!m_bOneTimeSetupDone)return; + if(!m_bOneTimeSetupDone) + return; saveLastEditedItem(); //KviKvsPopupManager::instance()->clear(); - int topcount=m_pTreeWidget->topLevelItemCount(); + int topcount = m_pTreeWidget->topLevelItemCount(); // Copy the original popup dict - KviPointerHashTable copy(*(KviKvsPopupManager::instance()->popupDict())); + KviPointerHashTable copy(*(KviKvsPopupManager::instance()->popupDict())); copy.setAutoDelete(false); - for(int i=0; itopLevelItem(i); KviKvsPopupMenu * p = KviKvsPopupManager::instance()->get(it->m_pPopup->popupName()); @@ -1329,7 +1399,7 @@ void PopupEditorWidget::commit() // the remaining elements in the copy need to be removed from // the "new" dictionary (they are no longer used) - KviPointerHashTableIterator iter(copy); + KviPointerHashTableIterator iter(copy); while(iter.current()) { @@ -1337,31 +1407,31 @@ void PopupEditorWidget::commit() ++iter; } - g_pApp->savePopups(); m_bSaving = false; } -void PopupEditorWidget::getUniquePopupName(MenuTreeWidgetItem *item,QString &buffer) +void PopupEditorWidget::getUniquePopupName(MenuTreeWidgetItem * item, QString & buffer) { KVI_ASSERT(m_bOneTimeSetupDone); - if(buffer.isEmpty())buffer = __tr2qs_ctx("unnamed","editor"); + if(buffer.isEmpty()) + buffer = __tr2qs_ctx("unnamed", "editor"); QString newName = buffer; bool bFound = true; int idx = 1; - int topcount=m_pTreeWidget->topLevelItemCount(); + int topcount = m_pTreeWidget->topLevelItemCount(); while(bFound) { bFound = false; - for(int i=0; itopLevelItem(i); - if(KviQString::equalCI(newName,ch->m_pPopup->popupName()) && (ch != item)) + if(KviQString::equalCI(newName, ch->m_pPopup->popupName()) && (ch != item)) { bFound = true; newName = QString("%1.%2").arg(buffer).arg(idx); @@ -1369,39 +1439,37 @@ void PopupEditorWidget::getUniquePopupName(MenuTreeWidgetItem *item,QString &buf break; } } - } buffer = newName; } - PopupEditorWindow::PopupEditorWindow() -: KviWindow(KviWindow::ScriptEditor,"popupeditor",0) + : KviWindow(KviWindow::ScriptEditor, "popupeditor", 0) { g_pPopupEditorWindow = this; QGridLayout * g = new QGridLayout(); m_pEditor = new PopupEditorWidget(this); - g->addWidget(m_pEditor,0,0,1,4); + g->addWidget(m_pEditor, 0, 0, 1, 4); - QPushButton * btn = new QPushButton(__tr2qs_ctx("&OK","editor"),this); - connect(btn,SIGNAL(clicked()),this,SLOT(okClicked())); + QPushButton * btn = new QPushButton(__tr2qs_ctx("&OK", "editor"), this); + connect(btn, SIGNAL(clicked()), this, SLOT(okClicked())); btn->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Accept))); - g->addWidget(btn,1,1); + g->addWidget(btn, 1, 1); - btn = new QPushButton(__tr2qs_ctx("&Apply","editor"),this); - connect(btn,SIGNAL(clicked()),this,SLOT(applyClicked())); + btn = new QPushButton(__tr2qs_ctx("&Apply", "editor"), this); + connect(btn, SIGNAL(clicked()), this, SLOT(applyClicked())); btn->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Accept))); - g->addWidget(btn,1,2); + g->addWidget(btn, 1, 2); - btn = new QPushButton(__tr2qs_ctx("Cancel","editor"),this); - connect(btn,SIGNAL(clicked()),this,SLOT(cancelClicked())); + btn = new QPushButton(__tr2qs_ctx("Cancel", "editor"), this); + connect(btn, SIGNAL(clicked()), this, SLOT(cancelClicked())); btn->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Discard))); - g->addWidget(btn,1,3); + g->addWidget(btn, 1, 3); - g->setRowStretch(0,1); - g->setColumnStretch(0,1); + g->setRowStretch(0, 1); + g->setColumnStretch(0, 1); setLayout(g); } @@ -1433,17 +1501,17 @@ QPixmap * PopupEditorWindow::myIconPtr() void PopupEditorWindow::fillCaptionBuffers() { - m_szPlainTextCaption = __tr2qs_ctx("Popup Editor","editor"); + m_szPlainTextCaption = __tr2qs_ctx("Popup Editor", "editor"); } -void PopupEditorWindow::getConfigGroupName(QString &szName) +void PopupEditorWindow::getConfigGroupName(QString & szName) { szName = "popupeditor"; } void PopupEditorWindow::saveProperties(KviConfigurationFile *) //cfg { -/* + /* #ifdef COMPILE_SCRIPTTOOLBAR cfg->writeEntry("Sizes",m_pEditor->sizes()); cfg->writeEntry("LastPopup",m_pEditor->lastEditedPopup().ptr()); @@ -1454,7 +1522,7 @@ void PopupEditorWindow::saveProperties(KviConfigurationFile *) //cfg void PopupEditorWindow::loadProperties(KviConfigurationFile *) // cfg { -/* + /* #ifdef COMPILE_SCRIPTTOOLBAR QValueList def; def.append(20); diff --git a/src/modules/popupeditor/PopupEditorWindow.h b/src/modules/popupeditor/PopupEditorWindow.h index 43375ca96..d3007449b 100644 --- a/src/modules/popupeditor/PopupEditorWindow.h +++ b/src/modules/popupeditor/PopupEditorWindow.h @@ -42,19 +42,32 @@ class MenuTreeWidgetItem; class PopupTreeWidgetItem : public QTreeWidgetItem { public: - enum Type { Item, Menu, Separator, Label, Epilogue, Prologue, ExtMenu }; + enum Type + { + Item, + Menu, + Separator, + Label, + Epilogue, + Prologue, + ExtMenu + }; + public: - PopupTreeWidgetItem(QTreeWidget * pTreeWidget,PopupTreeWidgetItem * after,Type t); - PopupTreeWidgetItem(PopupTreeWidgetItem * parent,PopupTreeWidgetItem * after,Type t); + PopupTreeWidgetItem(QTreeWidget * pTreeWidget, PopupTreeWidgetItem * after, Type t); + PopupTreeWidgetItem(PopupTreeWidgetItem * parent, PopupTreeWidgetItem * after, Type t); + public: - Type m_type; - QString m_szText; - QString m_szCondition; - QString m_szIcon; - QString m_szCode; - QString m_szId; + Type m_type; + QString m_szText; + QString m_szCondition; + QString m_szIcon; + QString m_szCode; + QString m_szId; + private: void init(); + public: void setItemText(const QString & szText); void setCondition(const QString & szCondition); @@ -63,43 +76,45 @@ public: void setId(const QString & szId); }; - class SinglePopupEditor : public QWidget { Q_OBJECT public: SinglePopupEditor(QWidget * par); ~SinglePopupEditor(); + protected: - QPushButton * m_pMenuButton; - KviKvsPopupMenu * m_pClipboard; - KviKvsPopupMenu * m_pTestPopup; - PopupTreeWidgetItem * m_pLastSelectedItem; - QTreeWidget * m_pTreeWidget; - QLineEdit * m_pNameEditor; - KviScriptEditor * m_pEditor; - QLineEdit * m_pTextEditor; - QLineEdit * m_pIdEditor; - QLineEdit * m_pIconEditor; - QLineEdit * m_pConditionEditor; - QLineEdit * m_pExtNameEditor; - QMenu * m_pContextPopup; + QPushButton * m_pMenuButton; + KviKvsPopupMenu * m_pClipboard; + KviKvsPopupMenu * m_pTestPopup; + PopupTreeWidgetItem * m_pLastSelectedItem; + QTreeWidget * m_pTreeWidget; + QLineEdit * m_pNameEditor; + KviScriptEditor * m_pEditor; + QLineEdit * m_pTextEditor; + QLineEdit * m_pIdEditor; + QLineEdit * m_pIconEditor; + QLineEdit * m_pConditionEditor; + QLineEdit * m_pExtNameEditor; + QMenu * m_pContextPopup; + public: void edit(MenuTreeWidgetItem * it); KviKvsPopupMenu * getMenu(); + protected: // theItem is the item above the first item that has to be inserted - void populateMenu(KviKvsPopupMenu * pop,PopupTreeWidgetItem * par,PopupTreeWidgetItem * theItem = 0); + void populateMenu(KviKvsPopupMenu * pop, PopupTreeWidgetItem * par, PopupTreeWidgetItem * theItem = 0); void saveLastSelectedItem(); - void addItemToMenu(KviKvsPopupMenu * pop,PopupTreeWidgetItem * par); - PopupTreeWidgetItem * newItem(PopupTreeWidgetItem * par,PopupTreeWidgetItem * after,PopupTreeWidgetItem::Type t); - PopupTreeWidgetItem * newItemBelow(PopupTreeWidgetItem * it,PopupTreeWidgetItem::Type t); - PopupTreeWidgetItem * newItemAbove(PopupTreeWidgetItem * it,PopupTreeWidgetItem::Type t); - PopupTreeWidgetItem * newItemInside(PopupTreeWidgetItem * it,PopupTreeWidgetItem::Type t); + void addItemToMenu(KviKvsPopupMenu * pop, PopupTreeWidgetItem * par); + PopupTreeWidgetItem * newItem(PopupTreeWidgetItem * par, PopupTreeWidgetItem * after, PopupTreeWidgetItem::Type t); + PopupTreeWidgetItem * newItemBelow(PopupTreeWidgetItem * it, PopupTreeWidgetItem::Type t); + PopupTreeWidgetItem * newItemAbove(PopupTreeWidgetItem * it, PopupTreeWidgetItem::Type t); + PopupTreeWidgetItem * newItemInside(PopupTreeWidgetItem * it, PopupTreeWidgetItem::Type t); void createNewItemAboveLastSelected(PopupTreeWidgetItem::Type t); void createNewItemBelowLastSelected(PopupTreeWidgetItem::Type t); void createNewItemInsideLastSelected(PopupTreeWidgetItem::Type t); - PopupTreeWidgetItem * findMatchingItem(KviKvsPopupMenuItem * it,PopupTreeWidgetItem * item); + PopupTreeWidgetItem * findMatchingItem(KviKvsPopupMenuItem * it, PopupTreeWidgetItem * item); protected slots: void contextCut(); void contextCopy(); @@ -125,76 +140,79 @@ protected slots: void contextNewPrologue(); void contextNewEpilogue(); void selectionChanged(); - void customContextMenuRequested(const QPoint &pnt); + void customContextMenuRequested(const QPoint & pnt); void testPopup(); void testModeMenuItemClicked(KviKvsPopupMenuItem * it); }; - - class MenuTreeWidgetItem : public QTreeWidgetItem { public: - MenuTreeWidgetItem(QTreeWidget * par,KviKvsPopupMenu * popup); + MenuTreeWidgetItem(QTreeWidget * par, KviKvsPopupMenu * popup); ~MenuTreeWidgetItem(); + public: KviKvsPopupMenu * m_pPopup; + public: - KviKvsPopupMenu * popup(){ return m_pPopup; }; + KviKvsPopupMenu * popup() { return m_pPopup; }; public: void replacePopup(KviKvsPopupMenu * popup); }; - class PopupEditorWidget : public QWidget { Q_OBJECT public: PopupEditorWidget(QWidget * par); ~PopupEditorWidget(); + public: - SinglePopupEditor * m_pEditor; - QTreeWidget * m_pTreeWidget; - MenuTreeWidgetItem * m_pLastEditedItem; - bool m_bOneTimeSetupDone; - QMenu * m_pContextPopup; - QMenu * m_pEmptyContextPopup; - bool m_bSaving; + SinglePopupEditor * m_pEditor; + QTreeWidget * m_pTreeWidget; + MenuTreeWidgetItem * m_pLastEditedItem; + bool m_bOneTimeSetupDone; + QMenu * m_pContextPopup; + QMenu * m_pEmptyContextPopup; + bool m_bSaving; + public: void commit(); void exportPopups(bool); protected slots: - void currentItemChanged(QTreeWidgetItem *it,QTreeWidgetItem *prev); - void customContextMenuRequested(const QPoint &pnt); + void currentItemChanged(QTreeWidgetItem * it, QTreeWidgetItem * prev); + void customContextMenuRequested(const QPoint & pnt); void newPopup(); void exportAll(); void exportSelected(); void exportCurrentPopup(); void removeCurrentPopup(); - void popupRefresh(const QString &szName); + void popupRefresh(const QString & szName); + protected: - void showEvent(QShowEvent *e); - void getExportPopupBuffer(QString &buffer,MenuTreeWidgetItem * it); + void showEvent(QShowEvent * e); + void getExportPopupBuffer(QString & buffer, MenuTreeWidgetItem * it); + private: void oneTimeSetup(); void saveLastEditedItem(); - void getUniquePopupName(MenuTreeWidgetItem * it,QString &buffer); + void getUniquePopupName(MenuTreeWidgetItem * it, QString & buffer); }; - - class PopupEditorWindow : public KviWindow { Q_OBJECT public: PopupEditorWindow(); ~PopupEditorWindow(); + protected: PopupEditorWidget * m_pEditor; + protected: virtual QPixmap * myIconPtr(); virtual void fillCaptionBuffers(); - virtual void getConfigGroupName(QString &szName); + virtual void getConfigGroupName(QString & szName); virtual void saveProperties(KviConfigurationFile *); virtual void loadProperties(KviConfigurationFile *); protected slots: diff --git a/src/modules/popupeditor/libkvipopupeditor.cpp b/src/modules/popupeditor/libkvipopupeditor.cpp index e467dfc7c..720ce5143 100644 --- a/src/modules/popupeditor/libkvipopupeditor.cpp +++ b/src/modules/popupeditor/libkvipopupeditor.cpp @@ -28,10 +28,8 @@ #include "KviLocale.h" #include "KviMainWindow.h" - PopupEditorWindow * g_pPopupEditorWindow = 0; - /* @doc: popupeditor.open @type: @@ -60,7 +58,7 @@ static bool popupeditor_kvs_cmd_open(KviKvsModuleCommandCall *) static bool popupeditor_module_init(KviModule * m) { - KVSM_REGISTER_SIMPLE_COMMAND(m,"open",popupeditor_kvs_cmd_open); + KVSM_REGISTER_SIMPLE_COMMAND(m, "open", popupeditor_kvs_cmd_open); g_pPopupEditorWindow = 0; return true; } @@ -79,13 +77,12 @@ static bool popupeditor_module_cleanup(KviModule *) } KVIRC_MODULE( - "PopupEditor", // module name - "4.0.0", // module version - "Copyright (C) 2008 Szymon Stefanek (pragma at kvirc dot net)", // author & (C) - "Editor for the script popups", - popupeditor_module_init, - popupeditor_module_can_unload, - 0, - popupeditor_module_cleanup, - "editor" -) + "PopupEditor", // module name + "4.0.0", // module version + "Copyright (C) 2008 Szymon Stefanek (pragma at kvirc dot net)", // author & (C) + "Editor for the script popups", + popupeditor_module_init, + popupeditor_module_can_unload, + 0, + popupeditor_module_cleanup, + "editor") diff --git a/src/modules/proxydb/libkviproxydb.cpp b/src/modules/proxydb/libkviproxydb.cpp index ab14ca74a..da5903e5b 100644 --- a/src/modules/proxydb/libkviproxydb.cpp +++ b/src/modules/proxydb/libkviproxydb.cpp @@ -54,22 +54,22 @@ static bool proxydb_kvs_fnc_protocol(KviKvsModuleFunctionCall * c) QString szProxy, szProtocol; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("proxy",KVS_PT_STRING,0,szProxy) + KVSM_PARAMETER("proxy", KVS_PT_STRING, 0, szProxy) KVSM_PARAMETERS_END(c) if(szProxy.isEmpty()) { - c->error(__tr2qs_ctx("You must provide the proxy hostname as parameter","serverdb")); + c->error(__tr2qs_ctx("You must provide the proxy hostname as parameter", "serverdb")); return false; } KviProxy objProxy; objProxy.setHostname(szProxy); - KviProxy * pRecord = g_pProxyDataBase->findProxy(&objProxy,true); + KviProxy * pRecord = g_pProxyDataBase->findProxy(&objProxy, true); if(!pRecord) { - c->error(__tr2qs_ctx("The specified proxy doesn't exist","serverdb")); + c->error(__tr2qs_ctx("The specified proxy doesn't exist", "serverdb")); return false; } @@ -96,7 +96,7 @@ static bool proxydb_get_helperer(KviKvsModuleFunctionCall * c, QString * szProxy QString szTmp; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("proxy",KVS_PT_STRING,0,szTmp) + KVSM_PARAMETER("proxy", KVS_PT_STRING, 0, szTmp) KVSM_PARAMETERS_END(c) *szProxy = szTmp; @@ -107,35 +107,36 @@ static KviProxy * proxydb_get_helper(KviKvsModuleFunctionCall * c) { QString szProxy; - if(!proxydb_get_helperer(c,&szProxy)) + if(!proxydb_get_helperer(c, &szProxy)) return nullptr; if(szProxy.isEmpty()) { - c->error(__tr2qs_ctx("You must provide the proxy hostname as parameter","serverdb")); + c->error(__tr2qs_ctx("You must provide the proxy hostname as parameter", "serverdb")); return nullptr; } KviProxy objProxy; objProxy.setHostname(szProxy); - KviProxy * pRecord = g_pProxyDataBase->findProxy(&objProxy,true); + KviProxy * pRecord = g_pProxyDataBase->findProxy(&objProxy, true); if(!pRecord) { - c->error(__tr2qs_ctx("The specified proxy doesn't exist","serverdb")); + c->error(__tr2qs_ctx("The specified proxy doesn't exist", "serverdb")); return nullptr; } return pRecord; } -#define PROXYDB_GET_PROPERTY(__functionName,__callName,__variantSetCallName) \ - static bool __functionName(KviKvsModuleFunctionCall * c) \ - { \ - KviProxy * pRecord = proxydb_get_helper(c); \ - if(pRecord == nullptr) return false; \ - c->returnValue()->__variantSetCallName(pRecord->__callName()); \ - return true; \ +#define PROXYDB_GET_PROPERTY(__functionName, __callName, __variantSetCallName) \ + static bool __functionName(KviKvsModuleFunctionCall * c) \ + { \ + KviProxy * pRecord = proxydb_get_helper(c); \ + if(pRecord == nullptr) \ + return false; \ + c->returnValue()->__variantSetCallName(pRecord->__callName()); \ + return true; \ } /* @@ -154,7 +155,7 @@ static KviProxy * proxydb_get_helper(KviKvsModuleFunctionCall * c) [module:serverdb]ServerDB module documentation[/module] */ -PROXYDB_GET_PROPERTY(proxydb_kvs_fnc_hostname,hostName,setString) +PROXYDB_GET_PROPERTY(proxydb_kvs_fnc_hostname, hostName, setString) /* @doc: proxydb.ip @@ -172,7 +173,7 @@ PROXYDB_GET_PROPERTY(proxydb_kvs_fnc_hostname,hostName,setString) [module:serverdb]ServerDB module documentation[/module] */ -PROXYDB_GET_PROPERTY(proxydb_kvs_fnc_ip,ip,setString) +PROXYDB_GET_PROPERTY(proxydb_kvs_fnc_ip, ip, setString) /* @doc: proxydb.password @@ -190,7 +191,7 @@ PROXYDB_GET_PROPERTY(proxydb_kvs_fnc_ip,ip,setString) [module:serverdb]ServerDB module documentation[/module] */ -PROXYDB_GET_PROPERTY(proxydb_kvs_fnc_password,pass,setString) +PROXYDB_GET_PROPERTY(proxydb_kvs_fnc_password, pass, setString) /* @doc: proxydb.username @@ -207,7 +208,7 @@ PROXYDB_GET_PROPERTY(proxydb_kvs_fnc_password,pass,setString) @seealso: [module:serverdb]ServerDB module documentation[/module] */ -PROXYDB_GET_PROPERTY(proxydb_kvs_fnc_username,user,setString) +PROXYDB_GET_PROPERTY(proxydb_kvs_fnc_username, user, setString) /* @doc: proxydb.isIPv6 @@ -225,7 +226,7 @@ PROXYDB_GET_PROPERTY(proxydb_kvs_fnc_username,user,setString) [module:serverdb]ServerDB module documentation[/module] */ -PROXYDB_GET_PROPERTY(proxydb_kvs_fnc_isIPv6,isIPv6,setBoolean) +PROXYDB_GET_PROPERTY(proxydb_kvs_fnc_isIPv6, isIPv6, setBoolean) /* @doc: proxydb.port @@ -243,7 +244,7 @@ PROXYDB_GET_PROPERTY(proxydb_kvs_fnc_isIPv6,isIPv6,setBoolean) [module:serverdb]ServerDB module documentation[/module] */ -PROXYDB_GET_PROPERTY(proxydb_kvs_fnc_port,port,setInteger) +PROXYDB_GET_PROPERTY(proxydb_kvs_fnc_port, port, setInteger) /* @doc: proxydb.addProxy @@ -285,54 +286,62 @@ static bool proxydb_kvs_cmd_addProxy(KviKvsModuleCommandCall * c) QString szProxy; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("proxy_name",KVS_PT_STRING,0,szProxy) + KVSM_PARAMETER("proxy_name", KVS_PT_STRING, 0, szProxy) KVSM_PARAMETERS_END(c) if(szProxy.isEmpty()) { - c->error(__tr2qs_ctx("You must provide the proxy name as parameter","serverdb")); + c->error(__tr2qs_ctx("You must provide the proxy name as parameter", "serverdb")); return false; } KviProxy * pProxy = new KviProxy(); pProxy->setHostname(szProxy); - KviProxy * pRecord = g_pProxyDataBase->findProxy(pProxy,true); + KviProxy * pRecord = g_pProxyDataBase->findProxy(pProxy, true); if(pRecord) { - if(c->switches()->find('q',"quiet")) + if(c->switches()->find('q', "quiet")) { delete pProxy; return true; } - c->error(__tr2qs_ctx("The specified proxy already exists","serverdb")); + c->error(__tr2qs_ctx("The specified proxy already exists", "serverdb")); delete pProxy; return false; } - if(c->switches()->find('i',"ipv6")) pProxy->setIPv6(true); + if(c->switches()->find('i', "ipv6")) + pProxy->setIPv6(true); QString tmp; - if(c->switches()->getAsStringIfExisting('p',"port",tmp)) + if(c->switches()->getAsStringIfExisting('p', "port", tmp)) { bool bOk; unsigned int uPort = tmp.toInt(&bOk); - if(!bOk) uPort = 6667; + if(!bOk) + uPort = 6667; pProxy->setPort(uPort); } - if(c->switches()->getAsStringIfExisting('u',"user",tmp)) pProxy->setUser(tmp); + if(c->switches()->getAsStringIfExisting('u', "user", tmp)) + pProxy->setUser(tmp); - if(c->switches()->getAsStringIfExisting('w',"password",tmp)) pProxy->setPass(tmp); + if(c->switches()->getAsStringIfExisting('w', "password", tmp)) + pProxy->setPass(tmp); - if(c->switches()->getAsStringIfExisting('r',"protocol",tmp)) + if(c->switches()->getAsStringIfExisting('r', "protocol", tmp)) { - if(tmp == "Socks4") pProxy->setProtocol(KviProxy::Socks4); - else if(tmp == "Socks5") pProxy->setProtocol(KviProxy::Socks5); - else if(tmp == "Http") pProxy->setProtocol(KviProxy::Http); - else { - c->error(__tr2qs_ctx("The specified protocol doesn't exist","serverdb")); + if(tmp == "Socks4") + pProxy->setProtocol(KviProxy::Socks4); + else if(tmp == "Socks5") + pProxy->setProtocol(KviProxy::Socks5); + else if(tmp == "Http") + pProxy->setProtocol(KviProxy::Http); + else + { + c->error(__tr2qs_ctx("The specified protocol doesn't exist", "serverdb")); delete pProxy; return false; } @@ -373,35 +382,37 @@ static bool proxydb_kvs_cmd_setPort(KviKvsModuleCommandCall * c) bool bOk; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("proxy",KVS_PT_STRING,0,szProxy) - KVSM_PARAMETER("port",KVS_PT_STRING,0,szPort) + KVSM_PARAMETER("proxy", KVS_PT_STRING, 0, szProxy) + KVSM_PARAMETER("port", KVS_PT_STRING, 0, szPort) KVSM_PARAMETERS_END(c) if(szProxy.isEmpty()) { - c->error(__tr2qs_ctx("You must provide the proxy hostname as parameter","serverdb")); + c->error(__tr2qs_ctx("You must provide the proxy hostname as parameter", "serverdb")); return false; } if(szPort.isEmpty()) { - c->error(__tr2qs_ctx("You must provide the port number as parameter","serverdb")); + c->error(__tr2qs_ctx("You must provide the port number as parameter", "serverdb")); return false; } KviProxy objProxy; objProxy.setHostname(szProxy); - KviProxy * pRecord = g_pProxyDataBase->findProxy(&objProxy,true); + KviProxy * pRecord = g_pProxyDataBase->findProxy(&objProxy, true); if(!pRecord) { - if(c->switches()->find('q',"quiet")) return true; - c->error(__tr2qs_ctx("The specified proxy doesn't exist","serverdb")); + if(c->switches()->find('q', "quiet")) + return true; + c->error(__tr2qs_ctx("The specified proxy doesn't exist", "serverdb")); return false; } uPort = szPort.toInt(&bOk); - if(!bOk) uPort = 1080; + if(!bOk) + uPort = 1080; pRecord->setPort(uPort); return true; @@ -444,38 +455,40 @@ static bool proxydb_kvs_cmd_setIp(KviKvsModuleCommandCall * c) QString szProxy, szIp; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("proxy",KVS_PT_STRING,0,szProxy) - KVSM_PARAMETER("ip",KVS_PT_STRING,0,szIp) + KVSM_PARAMETER("proxy", KVS_PT_STRING, 0, szProxy) + KVSM_PARAMETER("ip", KVS_PT_STRING, 0, szIp) KVSM_PARAMETERS_END(c) if(szProxy.isEmpty()) { - c->error(__tr2qs_ctx("You must provide the proxy hostname as parameter","serverdb")); + c->error(__tr2qs_ctx("You must provide the proxy hostname as parameter", "serverdb")); return false; } if(szIp.isEmpty()) { - c->error(__tr2qs_ctx("You must provide the IP as parameter","serverdb")); + c->error(__tr2qs_ctx("You must provide the IP as parameter", "serverdb")); return false; } KviProxy objProxy; objProxy.setHostname(szProxy); - KviProxy * pRecord = g_pProxyDataBase->findProxy(&objProxy,true); + KviProxy * pRecord = g_pProxyDataBase->findProxy(&objProxy, true); if(!pRecord) { - if(c->switches()->find('q',"quiet")) return true; - c->error(__tr2qs_ctx("The specified proxy doesn't exist","serverdb")); + if(c->switches()->find('q', "quiet")) + return true; + c->error(__tr2qs_ctx("The specified proxy doesn't exist", "serverdb")); return false; } QHostAddress host; if(!host.setAddress(szIp)) { - if(c->switches()->find('q',"quiet")) return true; - c->error(__tr2qs_ctx("The specified IP is not valid","serverdb")); + if(c->switches()->find('q', "quiet")) + return true; + c->error(__tr2qs_ctx("The specified IP is not valid", "serverdb")); return false; } @@ -514,24 +527,25 @@ static bool proxydb_kvs_cmd_setIPv6(KviKvsModuleCommandCall * c) bool bIPv6; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("proxy",KVS_PT_STRING,0,szProxy) - KVSM_PARAMETER("ipv6",KVS_PT_BOOLEAN,0,bIPv6) + KVSM_PARAMETER("proxy", KVS_PT_STRING, 0, szProxy) + KVSM_PARAMETER("ipv6", KVS_PT_BOOLEAN, 0, bIPv6) KVSM_PARAMETERS_END(c) if(szProxy.isEmpty()) { - c->error(__tr2qs_ctx("You must provide the proxy hostname as parameter","serverdb")); + c->error(__tr2qs_ctx("You must provide the proxy hostname as parameter", "serverdb")); return false; } KviProxy objProxy; objProxy.setHostname(szProxy); - KviProxy * pRecord = g_pProxyDataBase->findProxy(&objProxy,true); + KviProxy * pRecord = g_pProxyDataBase->findProxy(&objProxy, true); if(!pRecord) { - if(c->switches()->find('q',"quiet")) return true; - c->error(__tr2qs_ctx("The specified proxy doesn't exist","serverdb")); + if(c->switches()->find('q', "quiet")) + return true; + c->error(__tr2qs_ctx("The specified proxy doesn't exist", "serverdb")); return false; } @@ -570,80 +584,86 @@ static bool proxydb_kvs_cmd_setProtocol(KviKvsModuleCommandCall * c) QString szProxy, szProtocol; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("proxy",KVS_PT_STRING,0,szProxy) - KVSM_PARAMETER("protocol",KVS_PT_STRING,0,szProtocol) + KVSM_PARAMETER("proxy", KVS_PT_STRING, 0, szProxy) + KVSM_PARAMETER("protocol", KVS_PT_STRING, 0, szProtocol) KVSM_PARAMETERS_END(c) if(szProxy.isEmpty()) { - c->error(__tr2qs_ctx("You must provide the proxy hostname as parameter","serverdb")); + c->error(__tr2qs_ctx("You must provide the proxy hostname as parameter", "serverdb")); return false; } if(szProtocol.isEmpty()) { - c->error(__tr2qs_ctx("You must provide the protocol as parameter","serverdb")); + c->error(__tr2qs_ctx("You must provide the protocol as parameter", "serverdb")); return false; } KviProxy objProxy; objProxy.setHostname(szProxy); - KviProxy * pRecord = g_pProxyDataBase->findProxy(&objProxy,true); + KviProxy * pRecord = g_pProxyDataBase->findProxy(&objProxy, true); if(!pRecord) { - if(c->switches()->find('q',"quiet")) return true; - c->error(__tr2qs_ctx("The specified proxy doesn't exist","serverdb")); + if(c->switches()->find('q', "quiet")) + return true; + c->error(__tr2qs_ctx("The specified proxy doesn't exist", "serverdb")); return false; } - if(szProtocol == "Socks4") pRecord->setProtocol(KviProxy::Socks4); - else if(szProtocol == "Socks5") pRecord->setProtocol(KviProxy::Socks5); - else if(szProtocol == "Http") pRecord->setProtocol(KviProxy::Http); - else { - c->error(__tr2qs_ctx("The specified protocol doesn't exist","serverdb")); + if(szProtocol == "Socks4") + pRecord->setProtocol(KviProxy::Socks4); + else if(szProtocol == "Socks5") + pRecord->setProtocol(KviProxy::Socks5); + else if(szProtocol == "Http") + pRecord->setProtocol(KviProxy::Http); + else + { + c->error(__tr2qs_ctx("The specified protocol doesn't exist", "serverdb")); return false; } return true; } -#define PROXYDB_SET_PROPERTY(__functionName,__callName) \ - static bool __functionName(KviKvsModuleCommandCall * c) \ - { \ - QString szProxy, szPropertyName; \ - \ - KVSM_PARAMETERS_BEGIN(c) \ - KVSM_PARAMETER("proxy",KVS_PT_STRING,0,szProxy) \ - KVSM_PARAMETER("property",KVS_PT_STRING,KVS_PF_APPENDREMAINING,szPropertyName) \ - KVSM_PARAMETERS_END(c) \ - \ - if(szProxy.isEmpty()) \ - { \ - c->error(__tr2qs_ctx("You must provide the proxy hostname as parameter","serverdb")); \ - return false; \ - } \ - \ - if(szPropertyName.isEmpty()) \ - { \ - c->error(__tr2qs_ctx("You must provide the value as parameter","serverdb")); \ - return false; \ - } \ - \ - KviProxy objProxy; \ - objProxy.setHostname(szProxy); \ - \ - KviProxy * pRecord = g_pProxyDataBase->findProxy(&objProxy,true); \ - if(!pRecord) \ - { \ - if(c->switches()->find('q',"quiet")) return true; \ - c->error(__tr2qs_ctx("The specified proxy doesn't exist","serverdb")); \ - return false; \ - } \ - \ - pRecord->__callName(szPropertyName); \ - \ - return true; \ +#define PROXYDB_SET_PROPERTY(__functionName, __callName) \ + static bool __functionName(KviKvsModuleCommandCall * c) \ + { \ + QString szProxy, szPropertyName; \ + \ + KVSM_PARAMETERS_BEGIN(c) \ + KVSM_PARAMETER("proxy", KVS_PT_STRING, 0, szProxy) \ + KVSM_PARAMETER("property", KVS_PT_STRING, KVS_PF_APPENDREMAINING, szPropertyName) \ + KVSM_PARAMETERS_END(c) \ + \ + if(szProxy.isEmpty()) \ + { \ + c->error(__tr2qs_ctx("You must provide the proxy hostname as parameter", "serverdb")); \ + return false; \ + } \ + \ + if(szPropertyName.isEmpty()) \ + { \ + c->error(__tr2qs_ctx("You must provide the value as parameter", "serverdb")); \ + return false; \ + } \ + \ + KviProxy objProxy; \ + objProxy.setHostname(szProxy); \ + \ + KviProxy * pRecord = g_pProxyDataBase->findProxy(&objProxy, true); \ + if(!pRecord) \ + { \ + if(c->switches()->find('q', "quiet")) \ + return true; \ + c->error(__tr2qs_ctx("The specified proxy doesn't exist", "serverdb")); \ + return false; \ + } \ + \ + pRecord->__callName(szPropertyName); \ + \ + return true; \ } /* @@ -670,7 +690,7 @@ static bool proxydb_kvs_cmd_setProtocol(KviKvsModuleCommandCall * c) [module:serverdb]ServerDB module documentation[/module] */ -PROXYDB_SET_PROPERTY(proxydb_kvs_cmd_setHostname,setHostname) +PROXYDB_SET_PROPERTY(proxydb_kvs_cmd_setHostname, setHostname) /* @doc: proxydb.setPass @@ -696,7 +716,7 @@ PROXYDB_SET_PROPERTY(proxydb_kvs_cmd_setHostname,setHostname) [module:serverdb]ServerDB module documentation[/module] */ -PROXYDB_SET_PROPERTY(proxydb_kvs_cmd_setPass,setPass) +PROXYDB_SET_PROPERTY(proxydb_kvs_cmd_setPass, setPass) /* @doc: proxydb.setUser @@ -722,26 +742,26 @@ PROXYDB_SET_PROPERTY(proxydb_kvs_cmd_setPass,setPass) [module:serverdb]ServerDB module documentation[/module] */ -PROXYDB_SET_PROPERTY(proxydb_kvs_cmd_setUser,setUser) +PROXYDB_SET_PROPERTY(proxydb_kvs_cmd_setUser, setUser) static bool proxydb_module_init(KviModule * m) { - KVSM_REGISTER_FUNCTION(m,"hostname",proxydb_kvs_fnc_hostname); - KVSM_REGISTER_FUNCTION(m,"ip",proxydb_kvs_fnc_ip); - KVSM_REGISTER_FUNCTION(m,"isIPv6",proxydb_kvs_fnc_isIPv6); - KVSM_REGISTER_FUNCTION(m,"password",proxydb_kvs_fnc_password); - KVSM_REGISTER_FUNCTION(m,"port",proxydb_kvs_fnc_port); - KVSM_REGISTER_FUNCTION(m,"protocol",proxydb_kvs_fnc_protocol); - KVSM_REGISTER_FUNCTION(m,"username",proxydb_kvs_fnc_username); - - KVSM_REGISTER_SIMPLE_COMMAND(m,"addProxy",proxydb_kvs_cmd_addProxy); - KVSM_REGISTER_SIMPLE_COMMAND(m,"setHostname",proxydb_kvs_cmd_setHostname); - KVSM_REGISTER_SIMPLE_COMMAND(m,"setIp",proxydb_kvs_cmd_setIp); - KVSM_REGISTER_SIMPLE_COMMAND(m,"setIPv6",proxydb_kvs_cmd_setIPv6); - KVSM_REGISTER_SIMPLE_COMMAND(m,"setPass",proxydb_kvs_cmd_setPass); - KVSM_REGISTER_SIMPLE_COMMAND(m,"setPort",proxydb_kvs_cmd_setPort); - KVSM_REGISTER_SIMPLE_COMMAND(m,"setProtocol",proxydb_kvs_cmd_setProtocol); - KVSM_REGISTER_SIMPLE_COMMAND(m,"setUser",proxydb_kvs_cmd_setUser); + KVSM_REGISTER_FUNCTION(m, "hostname", proxydb_kvs_fnc_hostname); + KVSM_REGISTER_FUNCTION(m, "ip", proxydb_kvs_fnc_ip); + KVSM_REGISTER_FUNCTION(m, "isIPv6", proxydb_kvs_fnc_isIPv6); + KVSM_REGISTER_FUNCTION(m, "password", proxydb_kvs_fnc_password); + KVSM_REGISTER_FUNCTION(m, "port", proxydb_kvs_fnc_port); + KVSM_REGISTER_FUNCTION(m, "protocol", proxydb_kvs_fnc_protocol); + KVSM_REGISTER_FUNCTION(m, "username", proxydb_kvs_fnc_username); + + KVSM_REGISTER_SIMPLE_COMMAND(m, "addProxy", proxydb_kvs_cmd_addProxy); + KVSM_REGISTER_SIMPLE_COMMAND(m, "setHostname", proxydb_kvs_cmd_setHostname); + KVSM_REGISTER_SIMPLE_COMMAND(m, "setIp", proxydb_kvs_cmd_setIp); + KVSM_REGISTER_SIMPLE_COMMAND(m, "setIPv6", proxydb_kvs_cmd_setIPv6); + KVSM_REGISTER_SIMPLE_COMMAND(m, "setPass", proxydb_kvs_cmd_setPass); + KVSM_REGISTER_SIMPLE_COMMAND(m, "setPort", proxydb_kvs_cmd_setPort); + KVSM_REGISTER_SIMPLE_COMMAND(m, "setProtocol", proxydb_kvs_cmd_setProtocol); + KVSM_REGISTER_SIMPLE_COMMAND(m, "setUser", proxydb_kvs_cmd_setUser); return true; } @@ -757,13 +777,12 @@ static bool proxydb_module_can_unload(KviModule *) } KVIRC_MODULE( - "ProxyDB", // module name - "4.0.0", // module version - "Copyright (C) 2008 Elvio Basello (hellvis69 at netsons dot org)", // author & (C) - "IRC proxy serverDB related functions", - proxydb_module_init, - proxydb_module_can_unload, - 0, - proxydb_module_cleanup, - "serverdb" -) + "ProxyDB", // module name + "4.0.0", // module version + "Copyright (C) 2008 Elvio Basello (hellvis69 at netsons dot org)", // author & (C) + "IRC proxy serverDB related functions", + proxydb_module_init, + proxydb_module_can_unload, + 0, + proxydb_module_cleanup, + "serverdb") diff --git a/src/modules/python/libkvipython.cpp b/src/modules/python/libkvipython.cpp index a77646b38..4a44370b8 100644 --- a/src/modules/python/libkvipython.cpp +++ b/src/modules/python/libkvipython.cpp @@ -28,35 +28,35 @@ #include "KviLocale.h" #ifdef COMPILE_PYTHON_SUPPORT - #include "../pythoncore/pythoncoreinterface.h" - #include - - static KviModule * g_pPythonCoreModule = nullptr; - - #define KVS_CHECK_PYTHONCORE(_m,_c) \ - g_pPythonCoreModule = g_pModuleManager->getModule("pythoncore"); \ - if(!g_pPythonCoreModule) \ - { \ - if(!_c->switches()->find('q',"quiet")) \ - { \ - _c->warning(__tr2qs_ctx("The pythoncore module can't be loaded: Python support not available","python")); \ - _c->warning(__tr2qs_ctx("To see more details about loading failure try /pythoncore.load","python")); \ - return true; \ - } \ - } +#include "../pythoncore/pythoncoreinterface.h" +#include + +static KviModule * g_pPythonCoreModule = nullptr; + +#define KVS_CHECK_PYTHONCORE(_m, _c) \ + g_pPythonCoreModule = g_pModuleManager->getModule("pythoncore"); \ + if(!g_pPythonCoreModule) \ + { \ + if(!_c->switches()->find('q', "quiet")) \ + { \ + _c->warning(__tr2qs_ctx("The pythoncore module can't be loaded: Python support not available", "python")); \ + _c->warning(__tr2qs_ctx("To see more details about loading failure try /pythoncore.load", "python")); \ + return true; \ + } \ + } - #define KVS_CHECK_MODULE_STATE(_m,_c) KVS_CHECK_PYTHONCORE(_m,_c) +#define KVS_CHECK_MODULE_STATE(_m, _c) KVS_CHECK_PYTHONCORE(_m, _c) #else // COMPILE_PYTHON_SUPPORT - #define KVS_CHECK_PYTHONCORE(_m,_c) +#define KVS_CHECK_PYTHONCORE(_m, _c) - #define KVS_CHECK_MODULE_STATE(_m,_c) \ - if(!_c->switches()->find('q',"quiet")) \ - _c->warning(__tr2qs_ctx("This KVIrc executable has been compiled without Python scripting support","python")); \ - return true; +#define KVS_CHECK_MODULE_STATE(_m, _c) \ + if(!_c->switches()->find('q', "quiet")) \ + _c->warning(__tr2qs_ctx("This KVIrc executable has been compiled without Python scripting support", "python")); \ + return true; - static KviModule * g_pPythonCoreModule = nullptr; +static KviModule * g_pPythonCoreModule = nullptr; #endif // COMPILE_PYTHON_SUPPORT /* @@ -387,15 +387,15 @@ static bool python_kvs_cmd_begin(KviKvsModuleCommandCall * c) // The parser sets the Python code as the first parameter of our call, // the remaining params are the context name and the arguments - QString szCode,szContext; + QString szCode, szContext; KviKvsVariantList vList; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("code",KVS_PT_STRING,0,szCode) - KVSM_PARAMETER("context",KVS_PT_STRING,KVS_PF_OPTIONAL,szContext) - KVSM_PARAMETER("args",KVS_PT_VARIANTLIST,KVS_PF_OPTIONAL,vList) + KVSM_PARAMETER("code", KVS_PT_STRING, 0, szCode) + KVSM_PARAMETER("context", KVS_PT_STRING, KVS_PF_OPTIONAL, szContext) + KVSM_PARAMETER("args", KVS_PT_VARIANTLIST, KVS_PF_OPTIONAL, vList) KVSM_PARAMETERS_END(c) - KVS_CHECK_MODULE_STATE(m,c) + KVS_CHECK_MODULE_STATE(m, c) #ifdef COMPILE_PYTHON_SUPPORT KviPythonCoreCtrlCommand_execute ex; @@ -403,37 +403,37 @@ static bool python_kvs_cmd_begin(KviKvsModuleCommandCall * c) ex.pKvsContext = c->context(); ex.szContext = szContext; ex.szCode = szCode; - for(KviKvsVariant * v = vList.first();v;v = vList.next()) + for(KviKvsVariant * v = vList.first(); v; v = vList.next()) { QString tmp; v->asString(tmp); ex.lArgs.append(tmp); } - ex.bQuiet = c->switches()->find('q',"quiet"); + ex.bQuiet = c->switches()->find('q', "quiet"); - if(!g_pPythonCoreModule->ctrl(KVI_PYTHONCORECTRLCOMMAND_EXECUTE,&ex)) + if(!g_pPythonCoreModule->ctrl(KVI_PYTHONCORECTRLCOMMAND_EXECUTE, &ex)) { - if(!c->switches()->find('q',"quiet")) - c->warning(__tr2qs_ctx("The pythoncore module failed to execute the code: something is wrong with the Python support","python")); + if(!c->switches()->find('q', "quiet")) + c->warning(__tr2qs_ctx("The pythoncore module failed to execute the code: something is wrong with the Python support", "python")); return true; } if(!ex.lWarnings.isEmpty()) { - for(const auto& it : ex.lWarnings) + for(const auto & it : ex.lWarnings) c->warning(it); } - if(!ex.bExitOk && !c->switches()->find('q',"quiet")) + if(!ex.bExitOk && !c->switches()->find('q', "quiet")) { - c->warning(__tr2qs_ctx("Python execution error:","python")); + c->warning(__tr2qs_ctx("Python execution error:", "python")); c->warning(ex.szError); - if(c->switches()->find('f',"fail-on-error")) + if(c->switches()->find('f', "fail-on-error")) return false; } - if(!c->switches()->find('n',"no-return")) + if(!c->switches()->find('n', "no-return")) c->context()->returnValue()->setString(ex.szRetVal); #endif //COMPILE_PYTHON_SUPPORT @@ -467,20 +467,20 @@ static bool python_kvs_cmd_destroy(KviKvsModuleCommandCall * c) { QString szContext; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("context",KVS_PT_NONEMPTYSTRING,0,szContext) + KVSM_PARAMETER("context", KVS_PT_NONEMPTYSTRING, 0, szContext) KVSM_PARAMETERS_END(c) - KVS_CHECK_MODULE_STATE(m,c) + KVS_CHECK_MODULE_STATE(m, c) #ifdef COMPILE_PYTHON_SUPPORT KviPythonCoreCtrlCommand_destroy ex; ex.uSize = sizeof(KviPythonCoreCtrlCommand_destroy); ex.szContext = szContext; - if(!g_pPythonCoreModule->ctrl(KVI_PYTHONCORECTRLCOMMAND_DESTROY,&ex)) + if(!g_pPythonCoreModule->ctrl(KVI_PYTHONCORECTRLCOMMAND_DESTROY, &ex)) { - if(!c->switches()->find('q',"quiet")) - c->warning(__tr2qs_ctx("The pythoncore module failed to execute the code: something is wrong with the Python support","python")); + if(!c->switches()->find('q', "quiet")) + c->warning(__tr2qs_ctx("The pythoncore module failed to execute the code: something is wrong with the Python support", "python")); } #endif //COMPILE_PYTHON_SUPPORT @@ -515,10 +515,10 @@ static bool python_kvs_fnc_isAvailable(KviKvsModuleFunctionCall * c) static bool python_module_init(KviModule * m) { // register the command anyway - KVSM_REGISTER_SIMPLE_COMMAND(m,"begin",python_kvs_cmd_begin); - KVSM_REGISTER_SIMPLE_COMMAND(m,"destroy",python_kvs_cmd_destroy); + KVSM_REGISTER_SIMPLE_COMMAND(m, "begin", python_kvs_cmd_begin); + KVSM_REGISTER_SIMPLE_COMMAND(m, "destroy", python_kvs_cmd_destroy); - KVSM_REGISTER_FUNCTION(m,"isAvailable",python_kvs_fnc_isAvailable); + KVSM_REGISTER_FUNCTION(m, "isAvailable", python_kvs_fnc_isAvailable); #ifdef COMPILE_PYTHON_SUPPORT g_pPythonCoreModule = g_pModuleManager->getModule("pythoncore"); #endif @@ -531,13 +531,12 @@ static bool python_module_cleanup(KviModule *) } KVIRC_MODULE( - "Python", // module name - "4.0.0", // module version - "Copyright (C) 2008 Elvio Basello (hellvis69 at netsons dot org", // author & (C) - "Python Scripting Engine", - python_module_init, - 0, - 0, - python_module_cleanup, - "python" -) + "Python", // module name + "4.0.0", // module version + "Copyright (C) 2008 Elvio Basello (hellvis69 at netsons dot org", // author & (C) + "Python Scripting Engine", + python_module_init, + 0, + 0, + python_module_cleanup, + "python") diff --git a/src/modules/pythoncore/kvircmodule.cpp b/src/modules/pythoncore/kvircmodule.cpp index ef291b16f..f35589143 100644 --- a/src/modules/pythoncore/kvircmodule.cpp +++ b/src/modules/pythoncore/kvircmodule.cpp @@ -43,15 +43,18 @@ #if PY_MAJOR_VERSION >= 3 #define KVI_PyMODINIT_RETVAL(module) module #else -#define KVI_PyMODINIT_RETVAL(module) ; (void)(module) -struct PyModuleDef { +#define KVI_PyMODINIT_RETVAL(module) \ + ; \ + (void)(module) +struct PyModuleDef +{ char m_base; const char *m_name, *m_doc; int m_size; - PyMethodDef *m_methods; + PyMethodDef * m_methods; }; static const char PyModuleDef_HEAD_INIT = 0; -static PyObject *PyModule_Create(const struct PyModuleDef *def) +static PyObject * PyModule_Create(const struct PyModuleDef * def) { return Py_InitModule3(def->m_name, def->m_methods, def->m_doc); } @@ -66,7 +69,7 @@ extern QString g_lError; static PyObject * PyKVIrc_echo(PyObject * pSelf, PyObject * pArgs) { Q_UNUSED(pSelf); - const char * pcText = nullptr, *pcWinId = nullptr; + const char *pcText = nullptr, *pcWinId = nullptr; KviWindow * pWnd = nullptr; int iColorSet = 0; @@ -76,7 +79,7 @@ static PyObject * PyKVIrc_echo(PyObject * pSelf, PyObject * pArgs) return 0; // Sorry, we're NOT thread safe } - if(!PyArg_ParseTuple(pArgs,"s|is",&pcText,&iColorSet,&pcWinId)) + if(!PyArg_ParseTuple(pArgs, "s|is", &pcText, &iColorSet, &pcWinId)) return 0; if(pcText) @@ -91,20 +94,20 @@ static PyObject * PyKVIrc_echo(PyObject * pSelf, PyObject * pArgs) else if(g_pActiveWindow) pWnd = g_pActiveWindow; else - pWnd = (KviWindow *) g_pApp->activeConsole(); + pWnd = (KviWindow *)g_pApp->activeConsole(); } if(pWnd) - pWnd->outputNoFmt(iColorSet,QString::fromUtf8(pcText)); + pWnd->outputNoFmt(iColorSet, QString::fromUtf8(pcText)); } - return Py_BuildValue("i",1); + return Py_BuildValue("i", 1); } static PyObject * PyKVIrc_say(PyObject * pSelf, PyObject * pArgs) { Q_UNUSED(pSelf); - const char * pcText = nullptr, *pcWinId = nullptr; + const char *pcText = nullptr, *pcWinId = nullptr; KviWindow * pWnd = nullptr; if(QThread::currentThread() != g_pApp->thread()) @@ -113,7 +116,7 @@ static PyObject * PyKVIrc_say(PyObject * pSelf, PyObject * pArgs) return 0; // Sorry, we're NOT thread safe } - if(!PyArg_ParseTuple(pArgs,"s|s",&pcText,&pcWinId)) + if(!PyArg_ParseTuple(pArgs, "s|s", &pcText, &pcWinId)) return 0; if(pcText) @@ -128,16 +131,16 @@ static PyObject * PyKVIrc_say(PyObject * pSelf, PyObject * pArgs) else if(g_pActiveWindow) pWnd = g_pActiveWindow; else - pWnd = (KviWindow *) g_pApp->activeConsole(); + pWnd = (KviWindow *)g_pApp->activeConsole(); } if(pWnd) { QString szText = QString::fromUtf8(pcText); - KviUserInput::parse(szText,pWnd); + KviUserInput::parse(szText, pWnd); } } - return Py_BuildValue("i",1); + return Py_BuildValue("i", 1); } static PyObject * PyKVIrc_warning(PyObject * pSelf, PyObject * pArgs) @@ -151,7 +154,7 @@ static PyObject * PyKVIrc_warning(PyObject * pSelf, PyObject * pArgs) return 0; // Sorry, we're NOT thread safe } - if(!PyArg_ParseTuple(pArgs,"s",&pcText)) + if(!PyArg_ParseTuple(pArgs, "s", &pcText)) return 0; if(pcText && !g_bExecuteQuiet) @@ -160,7 +163,7 @@ static PyObject * PyKVIrc_warning(PyObject * pSelf, PyObject * pArgs) g_pCurrentKvsContext->warning(pcText); } - return Py_BuildValue("i",1); + return Py_BuildValue("i", 1); } static PyObject * PyKVIrc_getLocal(PyObject * pSelf, PyObject * pArgs) @@ -175,7 +178,7 @@ static PyObject * PyKVIrc_getLocal(PyObject * pSelf, PyObject * pArgs) return 0; // Sorry, we're NOT thread safe } - if(!PyArg_ParseTuple(pArgs,"s",&szVarName)) + if(!PyArg_ParseTuple(pArgs, "s", &szVarName)) return 0; if(g_pCurrentKvsContext) @@ -184,9 +187,11 @@ static PyObject * PyKVIrc_getLocal(PyObject * pSelf, PyObject * pArgs) if(pVar) { pVar->asString(tmp); - return Py_BuildValue("s",tmp.toUtf8().data()); - } else { - return Py_BuildValue("s",""); + return Py_BuildValue("s", tmp.toUtf8().data()); + } + else + { + return Py_BuildValue("s", ""); } } return 0; @@ -195,7 +200,7 @@ static PyObject * PyKVIrc_getLocal(PyObject * pSelf, PyObject * pArgs) static PyObject * PyKVIrc_setLocal(PyObject * pSelf, PyObject * pArgs) { Q_UNUSED(pSelf); - const char * szVarName = nullptr, *szVarValue = nullptr; + const char *szVarName = nullptr, *szVarValue = nullptr; QString tmp; if(QThread::currentThread() != g_pApp->thread()) @@ -204,7 +209,7 @@ static PyObject * PyKVIrc_setLocal(PyObject * pSelf, PyObject * pArgs) return 0; // Sorry, we're NOT thread safe } - if(!PyArg_ParseTuple(pArgs,"ss",&szVarName, &szVarValue)) + if(!PyArg_ParseTuple(pArgs, "ss", &szVarName, &szVarValue)) return 0; if(g_pCurrentKvsContext) @@ -213,10 +218,12 @@ static PyObject * PyKVIrc_setLocal(PyObject * pSelf, PyObject * pArgs) { KviKvsVariant * pVar = g_pCurrentKvsContext->localVariables()->get(szVarName); pVar->setString(szVarValue); - } else { + } + else + { g_pCurrentKvsContext->localVariables()->unset(szVarName); } - return Py_BuildValue("i",1); + return Py_BuildValue("i", 1); } return 0; } @@ -233,7 +240,7 @@ static PyObject * PyKVIrc_getGlobal(PyObject * pSelf, PyObject * pArgs) return 0; // Sorry, we're NOT thread safe } - if(!PyArg_ParseTuple(pArgs,"s",&szVarName)) + if(!PyArg_ParseTuple(pArgs, "s", &szVarName)) return 0; if(g_pCurrentKvsContext) @@ -242,9 +249,11 @@ static PyObject * PyKVIrc_getGlobal(PyObject * pSelf, PyObject * pArgs) if(pVar) { pVar->asString(tmp); - return Py_BuildValue("s",tmp.toUtf8().data()); - } else { - return Py_BuildValue("s",""); + return Py_BuildValue("s", tmp.toUtf8().data()); + } + else + { + return Py_BuildValue("s", ""); } } return 0; @@ -253,7 +262,7 @@ static PyObject * PyKVIrc_getGlobal(PyObject * pSelf, PyObject * pArgs) static PyObject * PyKVIrc_setGlobal(PyObject * pSelf, PyObject * pArgs) { Q_UNUSED(pSelf); - const char * szVarName = nullptr, *szVarValue = nullptr; + const char *szVarName = nullptr, *szVarValue = nullptr; QString tmp; if(QThread::currentThread() != g_pApp->thread()) @@ -262,7 +271,7 @@ static PyObject * PyKVIrc_setGlobal(PyObject * pSelf, PyObject * pArgs) return 0; // Sorry, we're NOT thread safe } - if(!PyArg_ParseTuple(pArgs,"ss",&szVarName, &szVarValue)) + if(!PyArg_ParseTuple(pArgs, "ss", &szVarName, &szVarValue)) return 0; if(g_pCurrentKvsContext) @@ -271,10 +280,12 @@ static PyObject * PyKVIrc_setGlobal(PyObject * pSelf, PyObject * pArgs) { KviKvsVariant * pVar = g_pCurrentKvsContext->globalVariables()->get(szVarName); pVar->setString(szVarValue); - } else { + } + else + { g_pCurrentKvsContext->globalVariables()->unset(szVarName); } - return Py_BuildValue("i",1); + return Py_BuildValue("i", 1); } return 0; } @@ -292,7 +303,7 @@ static PyObject * PyKVIrc_eval(PyObject * pSelf, PyObject * pArgs) return 0; // Sorry, we're NOT thread safe } - if(!PyArg_ParseTuple(pArgs,"s",&pcCode)) + if(!PyArg_ParseTuple(pArgs, "s", &pcCode)) return 0; if(pcCode) @@ -302,13 +313,13 @@ static PyObject * PyKVIrc_eval(PyObject * pSelf, PyObject * pArgs) else if(g_pActiveWindow) pWnd = g_pActiveWindow; else - pWnd = (KviWindow *) g_pApp->activeConsole(); + pWnd = (KviWindow *)g_pApp->activeConsole(); if(pWnd) { KviKvsVariant ret; QString szRet; - if(KviKvsScript::run(QString::fromUtf8(pcCode),pWnd,0,&ret)) + if(KviKvsScript::run(QString::fromUtf8(pcCode), pWnd, 0, &ret)) { ret.asString(szRet); pcRetVal = szRet.toUtf8().data(); @@ -316,7 +327,7 @@ static PyObject * PyKVIrc_eval(PyObject * pSelf, PyObject * pArgs) } } - return Py_BuildValue("s",pcRetVal); + return Py_BuildValue("s", pcRetVal); } static PyObject * PyKVIrc_internalWarning(PyObject * pSelf, PyObject * pArgs) @@ -330,13 +341,13 @@ static PyObject * PyKVIrc_internalWarning(PyObject * pSelf, PyObject * pArgs) return 0; // Sorry, we're NOT thread safe } - if(!PyArg_ParseTuple(pArgs,"s",&pcText)) + if(!PyArg_ParseTuple(pArgs, "s", &pcText)) return 0; if(pcText && !g_bExecuteQuiet) g_lWarningList.append(QString(pcText)); - return Py_BuildValue("i",1); + return Py_BuildValue("i", 1); } static PyObject * PyKVIrc_error(PyObject * pSelf, PyObject * pArgs) @@ -350,36 +361,36 @@ static PyObject * PyKVIrc_error(PyObject * pSelf, PyObject * pArgs) return 0; // Sorry, we're NOT thread safe } - if(!PyArg_ParseTuple(pArgs,"s",&pcText)) + if(!PyArg_ParseTuple(pArgs, "s", &pcText)) return 0; if(pcText) g_lError.append(pcText); - return Py_BuildValue("i",1); + return Py_BuildValue("i", 1); } static PyMethodDef KVIrcMethods[] = { { "echo", PyKVIrc_echo, METH_VARARGS, - "Outputs text to a KVIrc window" }, + "Outputs text to a KVIrc window" }, { "say", PyKVIrc_say, METH_VARARGS, - "Types text in a window" }, + "Types text in a window" }, { "warning", PyKVIrc_warning, METH_VARARGS, - "Prints a warning message" }, + "Prints a warning message" }, { "getLocal", PyKVIrc_getLocal, METH_VARARGS, - "Gets a local variable" }, + "Gets a local variable" }, { "setLocal", PyKVIrc_setLocal, METH_VARARGS, - "Sets a local variable" }, + "Sets a local variable" }, { "getGlobal", PyKVIrc_getGlobal, METH_VARARGS, - "Gets a global variable" }, + "Gets a global variable" }, { "setGlobal", PyKVIrc_setGlobal, METH_VARARGS, - "Sets a global variable" }, + "Sets a global variable" }, { "eval", PyKVIrc_eval, METH_VARARGS, - "Change the behaviour of a set of commands" }, + "Change the behaviour of a set of commands" }, { "internalWarning", PyKVIrc_internalWarning, METH_VARARGS, - "" }, + "" }, { "error", PyKVIrc_error, METH_VARARGS, - "" }, + "" }, { nullptr, nullptr, 0, nullptr } }; @@ -405,18 +416,22 @@ PyMODINIT_FUNC python_init() KVIrcMethods }; PyObject * pModule = PyModule_Create(&def); - if(!pModule) { + if(!pModule) + { KVI_ASSERT("Python: Unable to initialize KVIrc import module"); - } else { + } + else + { // Create a CObject containing the API pointer array's address PyObject * pC_API_Object = PyCObject_FromVoidPtr(PyKVIrc_API, nullptr); if(pC_API_Object) - PyModule_AddObject(pModule,"_C_API",pC_API_Object); + PyModule_AddObject(pModule, "_C_API", pC_API_Object); } return KVI_PyMODINIT_RETVAL(pModule); } -static struct KviPythonModuleInitializer { +static struct KviPythonModuleInitializer +{ KviPythonModuleInitializer() { PyImport_AppendInittab("kvirc", python_init); diff --git a/src/modules/pythoncore/kvircmodule.h b/src/modules/pythoncore/kvircmodule.h index 4fffacee4..53376d577 100644 --- a/src/modules/pythoncore/kvircmodule.h +++ b/src/modules/pythoncore/kvircmodule.h @@ -54,53 +54,54 @@ PyMODINIT_FUNC python_init(); #ifdef __cplusplus extern "C" { #endif - #ifndef KVIRC_MODULE - // This section is used in modules that use kvircmodule's API - static void ** PyKVIrc_API; +#ifndef KVIRC_MODULE +// This section is used in modules that use kvircmodule's API +static void ** PyKVIrc_API; - #define PyKVIrc_echo \ - (*(int (*)(const char * pcCmd)) PyKVIrc_API[0]) - #define PyKVIrc_say \ - (*(int (*)(const char * pcCmd)) PyKVIrc_API[1]) - #define PyKVIrc_warning \ - (*(int (*)(const char * pcCmd)) PyKVIrc_API[2]) - #define PyKVIrc_getLocal \ - (*(int (*)(const char * pcCmd)) PyKVIrc_API[3]) - #define PyKVIrc_setLocal \ - (*(int (*)(const char * pcCmd)) PyKVIrc_API[4]) - #define PyKVIrc_getGlobal \ - (*(int (*)(const char * pcCmd)) PyKVIrc_API[5]) - #define PyKVIrc_setGlobal \ - (*(int (*)(const char * pcCmd)) PyKVIrc_API[6]) - #define PyKVIrc_eval \ - (*(int (*)(const char * pcCmd)) PyKVIrc_API[7]) - #define PyKVIrc_internalWarning \ - (*(int (*)(const char * pcCmd)) PyKVIrc_API[8]) - #define PyKVIrc_error \ - (*(int (*)(const char * pcCmd)) PyKVIrc_API[9]) - /** +#define PyKVIrc_echo \ + (*(int (*)(const char * pcCmd))PyKVIrc_API[0]) +#define PyKVIrc_say \ + (*(int (*)(const char * pcCmd))PyKVIrc_API[1]) +#define PyKVIrc_warning \ + (*(int (*)(const char * pcCmd))PyKVIrc_API[2]) +#define PyKVIrc_getLocal \ + (*(int (*)(const char * pcCmd))PyKVIrc_API[3]) +#define PyKVIrc_setLocal \ + (*(int (*)(const char * pcCmd))PyKVIrc_API[4]) +#define PyKVIrc_getGlobal \ + (*(int (*)(const char * pcCmd))PyKVIrc_API[5]) +#define PyKVIrc_setGlobal \ + (*(int (*)(const char * pcCmd))PyKVIrc_API[6]) +#define PyKVIrc_eval \ + (*(int (*)(const char * pcCmd))PyKVIrc_API[7]) +#define PyKVIrc_internalWarning \ + (*(int (*)(const char * pcCmd))PyKVIrc_API[8]) +#define PyKVIrc_error \ + (*(int (*)(const char * pcCmd))PyKVIrc_API[9]) +/** * \brief Returns 0 on success, -1 otherwise * * In case on unsuccess, it sets the exception * \return int */ - inline static int import_kvirc() - { - PyObject * pModule = PyImport_ImportModule("kvirc"); - if(pModule) - { - PyObject * pC_API_Object = PyObject_GetAttrString(pModule,"_C_API"); +inline static int import_kvirc() +{ + PyObject * pModule = PyImport_ImportModule("kvirc"); + if(pModule) + { + PyObject * pC_API_Object = PyObject_GetAttrString(pModule, "_C_API"); - if(!pC_API_Object) return -1; + if(!pC_API_Object) + return -1; - if(PyCObject_Check(pC_API_Object)) - PyKVIrc_API = (void **)PyCObject_AsVoidPtr(pC_API_Object); + if(PyCObject_Check(pC_API_Object)) + PyKVIrc_API = (void **)PyCObject_AsVoidPtr(pC_API_Object); - Py_DECREF(pC_API_Object); - } - return 0; - } - #endif // KVIRC_MODULE + Py_DECREF(pC_API_Object); + } + return 0; +} +#endif // KVIRC_MODULE #ifdef __cplusplus } diff --git a/src/modules/pythoncore/libkvipythoncore.cpp b/src/modules/pythoncore/libkvipythoncore.cpp index 80c10325c..812e414b6 100644 --- a/src/modules/pythoncore/libkvipythoncore.cpp +++ b/src/modules/pythoncore/libkvipythoncore.cpp @@ -43,79 +43,85 @@ QString g_lError; static PyThreadState * mainThreadState = nullptr; -struct KviPythonLock { - KviPythonLock(PyThreadState * ts) { +struct KviPythonLock +{ + KviPythonLock(PyThreadState * ts) + { PyEval_RestoreThread(ts); } - ~KviPythonLock() { + ~KviPythonLock() + { PyEval_SaveThread(); } }; -struct KviPythonInterpreterDeleter { +struct KviPythonInterpreterDeleter +{ void operator()(PyThreadState * ts) const { - KviPythonLock lock{ts}; + KviPythonLock lock{ ts }; Py_EndInterpreter(ts); PyThreadState_Swap(mainThreadState); } }; -struct KviPythonInterpreter { +struct KviPythonInterpreter +{ KviPythonInterpreter(); - bool execute(QString, QStringList&, QString&, QString&, QStringList&); + bool execute(QString, QStringList &, QString &, QString &, QStringList &); std::unique_ptr m_uptrThreadState; }; -struct KviCaseInsensitiveQStringHash { - std::size_t operator()(const QString& s) const +struct KviCaseInsensitiveQStringHash +{ + std::size_t operator()(const QString & s) const { return static_cast(qHash(s.toLower())); } }; -struct KviCaseInsensitiveQStringEqual { - bool operator()(const QString& s, const QString& t) const +struct KviCaseInsensitiveQStringEqual +{ + bool operator()(const QString & s, const QString & t) const { return (s.toLower() == t.toLower()); } }; -static std::unordered_map g_Interpreters; +static std::unordered_map g_Interpreters; KviPythonInterpreter::KviPythonInterpreter() { - KviPythonLock lock{mainThreadState}; + KviPythonLock lock{ mainThreadState }; m_uptrThreadState.reset(Py_NewInterpreter()); // hook in the kvirc error handling routines QString szPreCode = QString( - "import kvirc\n" - "import sys\n" - "class kvirc_stderr_grabber:\n\tdef write(self,s):\n\t\tkvirc.error(s)\n" - "sys.stderr=kvirc_stderr_grabber()\n" - ); + "import kvirc\n" + "import sys\n" + "class kvirc_stderr_grabber:\n\tdef write(self,s):\n\t\tkvirc.error(s)\n" + "sys.stderr=kvirc_stderr_grabber()\n"); PyRun_SimpleString(szPreCode.toUtf8().data()); } -bool KviPythonInterpreter::execute(QString szCode, QStringList& lArgs, - QString& szRetVal, QString& szError, QStringList&) +bool KviPythonInterpreter::execute(QString szCode, QStringList & lArgs, + QString & szRetVal, QString & szError, QStringList &) { if(!m_uptrThreadState) { - szError = __tr2qs_ctx("Internal error: Python interpreter not initialized","python"); + szError = __tr2qs_ctx("Internal error: Python interpreter not initialized", "python"); return false; } g_lError.clear(); - KviPythonLock lock{m_uptrThreadState.get()}; + KviPythonLock lock{ m_uptrThreadState.get() }; QString szVarCode = "aArgs = ["; bool bFirst = true; - foreach(QString szArg,lArgs) + foreach(QString szArg, lArgs) { if(!bFirst) szVarCode += ","; @@ -142,7 +148,7 @@ bool KviPythonInterpreter::execute(QString szCode, QStringList& lArgs, return !retVal; } -static void pythoncore_destroy_interpreter(const QString& szContextName) +static void pythoncore_destroy_interpreter(const QString & szContextName) { const auto i = g_Interpreters.find(szContextName); @@ -152,7 +158,7 @@ static void pythoncore_destroy_interpreter(const QString& szContextName) #endif // COMPILE_PYTHON_SUPPORT -template +template T * castFromModParam(void * p) { T * ex = static_cast(p); @@ -163,31 +169,33 @@ T * castFromModParam(void * p) return ex; } -static bool pythoncore_module_ctrl(KviModule *,const char * cmd,void * param) +static bool pythoncore_module_ctrl(KviModule *, const char * cmd, void * param) { #ifdef COMPILE_PYTHON_SUPPORT - if(!strcmp(cmd,KVI_PYTHONCORECTRLCOMMAND_EXECUTE)) + if(!strcmp(cmd, KVI_PYTHONCORECTRLCOMMAND_EXECUTE)) { auto * pex = castFromModParam(param); if(!pex) return false; - auto& ex = *pex; + auto & ex = *pex; g_pCurrentKvsContext = ex.pKvsContext; g_bExecuteQuiet = ex.bQuiet; if(ex.szContext.isEmpty()) { KviPythonInterpreter m; - ex.bExitOk = m.execute(ex.szCode,ex.lArgs,ex.szRetVal,ex.szError,ex.lWarnings); - } else { - KviPythonInterpreter& m = g_Interpreters[ex.szContext]; - ex.bExitOk = m.execute(ex.szCode,ex.lArgs,ex.szRetVal,ex.szError,ex.lWarnings); + ex.bExitOk = m.execute(ex.szCode, ex.lArgs, ex.szRetVal, ex.szError, ex.lWarnings); + } + else + { + KviPythonInterpreter & m = g_Interpreters[ex.szContext]; + ex.bExitOk = m.execute(ex.szCode, ex.lArgs, ex.szRetVal, ex.szError, ex.lWarnings); } return true; } - if(!strcmp(cmd,KVI_PYTHONCORECTRLCOMMAND_DESTROY)) + if(!strcmp(cmd, KVI_PYTHONCORECTRLCOMMAND_DESTROY)) { auto * pde = castFromModParam(param); @@ -236,15 +244,14 @@ static bool pythoncore_module_can_unload(KviModule *) } KVIRC_MODULE( - "PythonCore", // module name - "4.0.0", // module version - "Copyright (C) 2008 Elvio Basello (hellvis69 at netsons dot org)\n" - "Copyright (C) 2009 Fabio Bas (ctrlaltca at libero dot it)\n" - "Copyright (C) 2016 Matt Ullman (staticfox at staticfox dot net)", - "Python Scripting Engine Core", - pythoncore_module_init, - pythoncore_module_can_unload, - pythoncore_module_ctrl, - pythoncore_module_cleanup, - "python" -) + "PythonCore", // module name + "4.0.0", // module version + "Copyright (C) 2008 Elvio Basello (hellvis69 at netsons dot org)\n" + "Copyright (C) 2009 Fabio Bas (ctrlaltca at libero dot it)\n" + "Copyright (C) 2016 Matt Ullman (staticfox at staticfox dot net)", + "Python Scripting Engine Core", + pythoncore_module_init, + pythoncore_module_can_unload, + pythoncore_module_ctrl, + pythoncore_module_cleanup, + "python") diff --git a/src/modules/pythoncore/pythoncoreinterface.h b/src/modules/pythoncore/pythoncoreinterface.h index f3aa03a18..bd594c0c8 100644 --- a/src/modules/pythoncore/pythoncoreinterface.h +++ b/src/modules/pythoncore/pythoncoreinterface.h @@ -31,21 +31,20 @@ #include - #define KVI_PYTHONCORECTRLCOMMAND_EXECUTE "execute" typedef struct _KviPythonCoreCtrlCommand_execute { - unsigned int uSize; + unsigned int uSize; KviKvsRunTimeContext * pKvsContext; - QString szContext; - QString szCode; - bool bExitOk; - QString szRetVal; - QString szError; - QStringList lWarnings; - QStringList lArgs; - bool bQuiet; + QString szContext; + QString szCode; + bool bExitOk; + QString szRetVal; + QString szError; + QStringList lWarnings; + QStringList lArgs; + bool bQuiet; } KviPythonCoreCtrlCommand_execute; #define KVI_PYTHONCORECTRLCOMMAND_DESTROY "destroy" @@ -53,7 +52,7 @@ typedef struct _KviPythonCoreCtrlCommand_execute typedef struct _KviPythonCoreCtrlCommand_destroy { unsigned int uSize; - QString szContext; + QString szContext; } KviPythonCoreCtrlCommand_destroy; #endif // !_PYTHONCOREINTERFACE_H_ diff --git a/src/modules/raweditor/RawEditorWindow.cpp b/src/modules/raweditor/RawEditorWindow.cpp index 2a8e1fa1d..ba40666ad 100644 --- a/src/modules/raweditor/RawEditorWindow.cpp +++ b/src/modules/raweditor/RawEditorWindow.cpp @@ -51,58 +51,55 @@ extern RawEditorWindow * g_pRawEditorWindow; - -RawTreeWidgetItem::RawTreeWidgetItem(QTreeWidget *par,int idx,bool bEnabled) -: QTreeWidgetItem(par) +RawTreeWidgetItem::RawTreeWidgetItem(QTreeWidget * par, int idx, bool bEnabled) + : QTreeWidgetItem(par) { m_iIdx = idx; - QString szName; + QString szName; szName.sprintf("%03d", idx); - setText(0,szName); + setText(0, szName); setEnabled(bEnabled); } -void RawHandlerTreeWidgetItem::setName(const QString &szName) +void RawHandlerTreeWidgetItem::setName(const QString & szName) { - setText(0,szName); + setText(0, szName); } RawEditorWidget::RawEditorWidget(QWidget * par) -: QWidget(par) + : QWidget(par) { setObjectName("raw_event_editor"); QGridLayout * l = new QGridLayout(this); - QSplitter * spl = new QSplitter(Qt::Horizontal,this); + QSplitter * spl = new QSplitter(Qt::Horizontal, this); spl->setObjectName("raweditor_splitter"); spl->setChildrenCollapsible(false); - l->addWidget(spl,0,0); + l->addWidget(spl, 0, 0); KviTalVBox * boxi = new KviTalVBox(spl); boxi->setMaximumWidth(200); m_pTreeWidget = new RawTreeWidget(boxi); - - m_pTreeWidget->setColumnCount(1); - m_pTreeWidget->setHeaderLabel(__tr2qs_ctx("RAW Event","editor")); + m_pTreeWidget->setHeaderLabel(__tr2qs_ctx("RAW Event", "editor")); -// m_pTreeWidget->setMultiSelection(false); + // m_pTreeWidget->setMultiSelection(false); m_pTreeWidget->setSelectionMode(QAbstractItemView::SingleSelection); -// m_pTreeWidget->setShowSortIndicator(true); + // m_pTreeWidget->setShowSortIndicator(true); m_pTreeWidget->setRootIsDecorated(true); m_pContextPopup = new QMenu(this); m_pTreeWidget->setContextMenuPolicy(Qt::CustomContextMenu); - connect(m_pTreeWidget,SIGNAL(currentItemChanged(QTreeWidgetItem *,QTreeWidgetItem *)),this,SLOT(currentItemChanged(QTreeWidgetItem *,QTreeWidgetItem *))); + connect(m_pTreeWidget, SIGNAL(currentItemChanged(QTreeWidgetItem *, QTreeWidgetItem *)), this, SLOT(currentItemChanged(QTreeWidgetItem *, QTreeWidgetItem *))); - connect(m_pTreeWidget,SIGNAL(customContextMenuRequested(const QPoint &)),this,SLOT(customContextMenuRequested(const QPoint &))); + connect(m_pTreeWidget, SIGNAL(customContextMenuRequested(const QPoint &)), this, SLOT(customContextMenuRequested(const QPoint &))); - QPushButton * pb = new QPushButton(__tr2qs_ctx("&Export All to...","editor"),boxi); - connect(pb,SIGNAL(clicked()),this,SLOT(exportAllEvents())); + QPushButton * pb = new QPushButton(__tr2qs_ctx("&Export All to...", "editor"), boxi); + connect(pb, SIGNAL(clicked()), this, SLOT(exportAllEvents())); KviTalVBox * box = new KviTalVBox(spl); m_pNameEditor = new QLineEdit(box); - m_pNameEditor->setToolTip(__tr2qs_ctx("Edit the RAW event handler name.","editor")); + m_pNameEditor->setToolTip(__tr2qs_ctx("Edit the RAW event handler name.", "editor")); m_pEditor = KviScriptEditor::createInstance(box); m_bOneTimeSetupDone = false; @@ -116,23 +113,24 @@ RawEditorWidget::~RawEditorWidget() void RawEditorWidget::oneTimeSetup() { - if(m_bOneTimeSetupDone)return; + if(m_bOneTimeSetupDone) + return; m_bOneTimeSetupDone = true; RawTreeWidgetItem * it; - for(unsigned int i = 0;i < 999;i++) + for(unsigned int i = 0; i < 999; i++) { KviPointerList * l = KviKvsEventManager::instance()->rawHandlers(i); if(l) { - it = new RawTreeWidgetItem(m_pTreeWidget,i,true); - for(KviKvsEventHandler * s = l->first();s;s = l->next()) + it = new RawTreeWidgetItem(m_pTreeWidget, i, true); + for(KviKvsEventHandler * s = l->first(); s; s = l->next()) { if(s->type() == KviKvsEventHandler::Script) { - new RawHandlerTreeWidgetItem(it,((KviKvsScriptEventHandler *)s)->name(), - ((KviKvsScriptEventHandler *)s)->code(),((KviKvsScriptEventHandler *)s)->isEnabled()); + new RawHandlerTreeWidgetItem(it, ((KviKvsScriptEventHandler *)s)->name(), + ((KviKvsScriptEventHandler *)s)->code(), ((KviKvsScriptEventHandler *)s)->isEnabled()); } } it->setExpanded(true); @@ -140,10 +138,10 @@ void RawEditorWidget::oneTimeSetup() } } -void RawEditorWidget::customContextMenuRequested(const QPoint &pos) +void RawEditorWidget::customContextMenuRequested(const QPoint & pos) { - QTreeWidgetItem *it; - it=(QTreeWidgetItem *)m_pTreeWidget->itemAt(pos); + QTreeWidgetItem * it; + it = (QTreeWidgetItem *)m_pTreeWidget->itemAt(pos); KVI_ASSERT(m_bOneTimeSetupDone); m_pContextPopup->clear(); if(it) @@ -152,43 +150,46 @@ void RawEditorWidget::customContextMenuRequested(const QPoint &pos) { if(!(((RawHandlerTreeWidgetItem *)it)->m_bEnabled)) m_pContextPopup->addAction( - *(g_pIconManager->getSmallIcon(KviIconManager::Handler)), - __tr2qs_ctx("&Enable Handler","editor"),this,SLOT(toggleCurrentHandlerEnabled())); + *(g_pIconManager->getSmallIcon(KviIconManager::Handler)), + __tr2qs_ctx("&Enable Handler", "editor"), this, SLOT(toggleCurrentHandlerEnabled())); else m_pContextPopup->addAction( - *(g_pIconManager->getSmallIcon(KviIconManager::HandlerDisabled)), - __tr2qs_ctx("&Disable Handler","editor"),this,SLOT(toggleCurrentHandlerEnabled())); + *(g_pIconManager->getSmallIcon(KviIconManager::HandlerDisabled)), + __tr2qs_ctx("&Disable Handler", "editor"), this, SLOT(toggleCurrentHandlerEnabled())); m_pContextPopup->addAction( - *(g_pIconManager->getSmallIcon(KviIconManager::Discard)), - __tr2qs_ctx("Re&move Handler","editor"), - this,SLOT(removeCurrentHandler())); + *(g_pIconManager->getSmallIcon(KviIconManager::Discard)), + __tr2qs_ctx("Re&move Handler", "editor"), + this, SLOT(removeCurrentHandler())); m_pContextPopup->addAction( - *(g_pIconManager->getSmallIcon(KviIconManager::Save)), - __tr2qs_ctx("&Export Handler to...","editor"), - this,SLOT(exportCurrentHandler())); - } else { + *(g_pIconManager->getSmallIcon(KviIconManager::Save)), + __tr2qs_ctx("&Export Handler to...", "editor"), + this, SLOT(exportCurrentHandler())); + } + else + { m_pContextPopup->addAction( - *(g_pIconManager->getSmallIcon(KviIconManager::Handler)), - __tr2qs_ctx("&New Handler","editor"), - this,SLOT(addHandlerForCurrentRaw())); + *(g_pIconManager->getSmallIcon(KviIconManager::Handler)), + __tr2qs_ctx("&New Handler", "editor"), + this, SLOT(addHandlerForCurrentRaw())); } } m_pContextPopup->addSeparator(); m_pContextPopup->addAction( - *(g_pIconManager->getSmallIcon(KviIconManager::RawEvent)), - __tr2qs_ctx("&Add RAW Event...","editor"), - this,SLOT(addRaw())); - m_pContextPopup->popup(mapToGlobal(QPoint(pos.x()+15,pos.y()))); + *(g_pIconManager->getSmallIcon(KviIconManager::RawEvent)), + __tr2qs_ctx("&Add RAW Event...", "editor"), + this, SLOT(addRaw())); + m_pContextPopup->popup(mapToGlobal(QPoint(pos.x() + 15, pos.y()))); } -void RawEditorWidget::getUniqueHandlerName(RawTreeWidgetItem *it,QString &buffer) +void RawEditorWidget::getUniqueHandlerName(RawTreeWidgetItem * it, QString & buffer) { KVI_ASSERT(m_bOneTimeSetupDone); QString newName = buffer; - if(newName.isEmpty())newName = __tr2qs_ctx("unnamed","editor"); + if(newName.isEmpty()) + newName = __tr2qs_ctx("unnamed", "editor"); bool bFound = true; int idx = 1; @@ -197,10 +198,10 @@ void RawEditorWidget::getUniqueHandlerName(RawTreeWidgetItem *it,QString &buffer { bFound = false; - for (int i=0;ichildCount();i++) + for(int i = 0; i < it->childCount(); i++) { - RawHandlerTreeWidgetItem * ch =(RawHandlerTreeWidgetItem *) it->child(i); - if(KviQString::equalCI(newName,ch->text(0))) + RawHandlerTreeWidgetItem * ch = (RawHandlerTreeWidgetItem *)it->child(i); + if(KviQString::equalCI(newName, ch->text(0))) { bFound = true; newName = QString("%1_%2").arg(buffer).arg(idx); @@ -208,7 +209,6 @@ void RawEditorWidget::getUniqueHandlerName(RawTreeWidgetItem *it,QString &buffer break; } } - } buffer = newName; @@ -218,14 +218,15 @@ void RawEditorWidget::addRaw() { bool bOk = false; - int iIdx = QInputDialog::getInt(this,__tr2qs_ctx("New RAW Event","editor"),__tr2qs_ctx("Enter the numeric code of the message (0-999)","editor"),0,0,999,1,&bOk); + int iIdx = QInputDialog::getInt(this, __tr2qs_ctx("New RAW Event", "editor"), __tr2qs_ctx("Enter the numeric code of the message (0-999)", "editor"), 0, 0, 999, 1, &bOk); - if(!bOk)return; + if(!bOk) + return; RawTreeWidgetItem * it; - for (int i=0;itopLevelItemCount();i++) + for(int i = 0; i < m_pTreeWidget->topLevelItemCount(); i++) { - it=(RawTreeWidgetItem *)m_pTreeWidget->topLevelItem(i); + it = (RawTreeWidgetItem *)m_pTreeWidget->topLevelItem(i); if(((RawTreeWidgetItem *)it)->m_iIdx == iIdx) { m_pTreeWidget->setCurrentItem(it); @@ -235,28 +236,27 @@ void RawEditorWidget::addRaw() } } - it = new RawTreeWidgetItem(m_pTreeWidget,iIdx,true); + it = new RawTreeWidgetItem(m_pTreeWidget, iIdx, true); m_pTreeWidget->setCurrentItem(it); m_pTreeWidget->clearSelection(); it->setSelected(true); add_handler: addHandlerForCurrentRaw(); - } void RawEditorWidget::addHandlerForCurrentRaw() { KVI_ASSERT(m_bOneTimeSetupDone); - RawTreeWidgetItem * it = (RawTreeWidgetItem *) m_pTreeWidget->currentItem(); + RawTreeWidgetItem * it = (RawTreeWidgetItem *)m_pTreeWidget->currentItem(); if(it) { if(it->parent() == 0) { - QString buffer = __tr2qs_ctx("default","editor"); - getUniqueHandlerName((RawTreeWidgetItem *)it,buffer); - QTreeWidgetItem * ch = new RawHandlerTreeWidgetItem(it,buffer,"",true); + QString buffer = __tr2qs_ctx("default", "editor"); + getUniqueHandlerName((RawTreeWidgetItem *)it, buffer); + QTreeWidgetItem * ch = new RawHandlerTreeWidgetItem(it, buffer, "", true); it->setEnabled(true); it->setExpanded(true); m_pTreeWidget->setCurrentItem(ch); @@ -272,12 +272,13 @@ void RawEditorWidget::removeCurrentHandler() if(m_pLastEditedItem) { QTreeWidgetItem * it = m_pLastEditedItem; - RawTreeWidgetItem * parent=(RawTreeWidgetItem *)it->parent(); + RawTreeWidgetItem * parent = (RawTreeWidgetItem *)it->parent(); m_pLastEditedItem = 0; delete it; m_pEditor->setEnabled(false); m_pNameEditor->setEnabled(false); - if (!parent->childCount()) parent->setEnabled(false); + if(!parent->childCount()) + parent->setEnabled(false); } } @@ -288,38 +289,38 @@ void RawEditorWidget::toggleCurrentHandlerEnabled() { m_pLastEditedItem->m_bEnabled = !(m_pLastEditedItem->m_bEnabled); m_pLastEditedItem->setEnabled(m_pLastEditedItem->m_bEnabled); - currentItemChanged(m_pLastEditedItem,m_pLastEditedItem); + currentItemChanged(m_pLastEditedItem, m_pLastEditedItem); } } void RawEditorWidget::commit() { - if(!m_bOneTimeSetupDone)return; // nothing to commit + if(!m_bOneTimeSetupDone) + return; // nothing to commit saveLastEditedItem(); KviKvsEventManager::instance()->removeAllScriptRawHandlers(); QTreeWidgetItem * it; - for(int i=0;itopLevelItemCount();i++) + for(int i = 0; i < m_pTreeWidget->topLevelItemCount(); i++) { - it=(QTreeWidgetItem *)m_pTreeWidget->topLevelItem(i); + it = (QTreeWidgetItem *)m_pTreeWidget->topLevelItem(i); if(it->childCount()) { QString szContext; QTreeWidgetItem * ch; - for (int j=0;jchildCount();j++) + for(int j = 0; j < it->childCount(); j++) { - ch=(QTreeWidgetItem *)it->child(j); - qDebug("Commit handler %s",((RawHandlerTreeWidgetItem *)ch)->text(0).toUtf8().data()); + ch = (QTreeWidgetItem *)it->child(j); + qDebug("Commit handler %s", ((RawHandlerTreeWidgetItem *)ch)->text(0).toUtf8().data()); //int a=(RawTreeWidgetItem *)it)->m_iIdx; szContext = QString("RawEvent%1::%2").arg(((RawTreeWidgetItem *)it)->m_iIdx).arg(((RawHandlerTreeWidgetItem *)ch)->text(0)); KviKvsScriptEventHandler * s = new KviKvsScriptEventHandler( - ((RawHandlerTreeWidgetItem *)ch)->text(0), - szContext, - ((RawHandlerTreeWidgetItem *)ch)->m_szBuffer, - ((RawHandlerTreeWidgetItem *)ch)->m_bEnabled - ); + ((RawHandlerTreeWidgetItem *)ch)->text(0), + szContext, + ((RawHandlerTreeWidgetItem *)ch)->m_szBuffer, + ((RawHandlerTreeWidgetItem *)ch)->m_bEnabled); - KviKvsEventManager::instance()->addRawHandler(((RawTreeWidgetItem *)it)->m_iIdx,s); + KviKvsEventManager::instance()->addRawHandler(((RawTreeWidgetItem *)it)->m_iIdx, s); } } } @@ -330,14 +331,15 @@ void RawEditorWidget::commit() void RawEditorWidget::saveLastEditedItem() { KVI_ASSERT(m_bOneTimeSetupDone); - if(!m_pLastEditedItem)return; + if(!m_pLastEditedItem) + return; QString buffer = m_pNameEditor->text(); - qDebug("Check lineedit name %s and internal %s",buffer.toUtf8().data(),m_pLastEditedItem->text(0).toUtf8().data()); - if(!KviQString::equalCI(buffer,m_pLastEditedItem->text(0))) + qDebug("Check lineedit name %s and internal %s", buffer.toUtf8().data(), m_pLastEditedItem->text(0).toUtf8().data()); + if(!KviQString::equalCI(buffer, m_pLastEditedItem->text(0))) { - getUniqueHandlerName((RawTreeWidgetItem *)(m_pLastEditedItem->parent()),buffer); - qDebug("Change name %s",buffer.toUtf8().data()); + getUniqueHandlerName((RawTreeWidgetItem *)(m_pLastEditedItem->parent()), buffer); + qDebug("Change name %s", buffer.toUtf8().data()); } m_pLastEditedItem->setName(buffer); @@ -347,7 +349,7 @@ void RawEditorWidget::saveLastEditedItem() m_pLastEditedItem->m_szBuffer = tmp; } -void RawEditorWidget::currentItemChanged(QTreeWidgetItem * it,QTreeWidgetItem *) +void RawEditorWidget::currentItemChanged(QTreeWidgetItem * it, QTreeWidgetItem *) { KVI_ASSERT(m_bOneTimeSetupDone); saveLastEditedItem(); @@ -358,25 +360,28 @@ void RawEditorWidget::currentItemChanged(QTreeWidgetItem * it,QTreeWidgetItem *) m_pNameEditor->setText(it->text(0)); m_pEditor->setEnabled(true); m_pEditor->setText(((RawHandlerTreeWidgetItem *)it)->m_szBuffer); - } else { + } + else + { m_pLastEditedItem = 0; m_pNameEditor->setEnabled(false); m_pNameEditor->setText(""); m_pEditor->setEnabled(false); - QString szTmp = QString(__tr2qs_ctx("\n\nRAW Event:\n%1","editor")).arg(((RawHandlerTreeWidgetItem *)it)->text(0)); + QString szTmp = QString(__tr2qs_ctx("\n\nRAW Event:\n%1", "editor")).arg(((RawHandlerTreeWidgetItem *)it)->text(0)); m_pEditor->setText(szTmp); } } -void RawEditorWidget::showEvent(QShowEvent *e) +void RawEditorWidget::showEvent(QShowEvent * e) { oneTimeSetup(); QWidget::showEvent(e); } -void RawEditorWidget::getExportEventBuffer(QString &buffer,RawHandlerTreeWidgetItem * it) +void RawEditorWidget::getExportEventBuffer(QString & buffer, RawHandlerTreeWidgetItem * it) { - if(!it->parent())return; + if(!it->parent()) + return; QString szBuf = it->m_szBuffer; @@ -402,12 +407,15 @@ void RawEditorWidget::getExportEventBuffer(QString &buffer,RawHandlerTreeWidgetI void RawEditorWidget::exportCurrentHandler() { - if(!m_pLastEditedItem)return; + if(!m_pLastEditedItem) + return; saveLastEditedItem(); - if(!m_pLastEditedItem)return; + if(!m_pLastEditedItem) + return; QString szName = QDir::homePath(); - if(!szName.endsWith(QString(KVI_PATH_SEPARATOR)))szName += KVI_PATH_SEPARATOR; + if(!szName.endsWith(QString(KVI_PATH_SEPARATOR))) + szName += KVI_PATH_SEPARATOR; szName += "raw"; szName += ((RawTreeWidgetItem *)(m_pLastEditedItem->parent()))->text(0); szName += "."; @@ -416,14 +424,15 @@ void RawEditorWidget::exportCurrentHandler() QString szFile; - if(!KviFileDialog::askForSaveFileName(szFile,__tr2qs_ctx("Choose a Filename - KVIrc","editor"),szName,KVI_FILTER_SCRIPT,true,true,true,this))return; + if(!KviFileDialog::askForSaveFileName(szFile, __tr2qs_ctx("Choose a Filename - KVIrc", "editor"), szName, KVI_FILTER_SCRIPT, true, true, true, this)) + return; QString szOut; - getExportEventBuffer(szOut,m_pLastEditedItem); + getExportEventBuffer(szOut, m_pLastEditedItem); - if(!KviFileUtils::writeFile(szFile,szOut)) + if(!KviFileUtils::writeFile(szFile, szOut)) { - QMessageBox::warning(this,__tr2qs_ctx("Writing to File Failed - KVIrc","editor"),__tr2qs_ctx("Unable to write to the RAW events file.","editor"),__tr2qs_ctx("&OK","editor")); + QMessageBox::warning(this, __tr2qs_ctx("Writing to File Failed - KVIrc", "editor"), __tr2qs_ctx("Unable to write to the RAW events file.", "editor"), __tr2qs_ctx("&OK", "editor")); } } @@ -434,62 +443,63 @@ void RawEditorWidget::exportAllEvents() RawTreeWidgetItem * it; QString out; - for (int i=0;itopLevelItemCount();i++) + for(int i = 0; i < m_pTreeWidget->topLevelItemCount(); i++) { - it=(RawTreeWidgetItem *)m_pTreeWidget->topLevelItem(i); + it = (RawTreeWidgetItem *)m_pTreeWidget->topLevelItem(i); RawHandlerTreeWidgetItem * item; - for (int j=0;jchildCount();j++) + for(int j = 0; j < it->childCount(); j++) { QString tmp; - item=(RawHandlerTreeWidgetItem *)it->child(j); - getExportEventBuffer(tmp,item); + item = (RawHandlerTreeWidgetItem *)it->child(j); + getExportEventBuffer(tmp, item); out += tmp; out += "\n"; } } QString szName = QDir::homePath(); - if(!szName.endsWith(QString(KVI_PATH_SEPARATOR)))szName += KVI_PATH_SEPARATOR; + if(!szName.endsWith(QString(KVI_PATH_SEPARATOR))) + szName += KVI_PATH_SEPARATOR; szName += "rawevents.kvs"; QString szFile; - if(!KviFileDialog::askForSaveFileName(szFile,__tr2qs_ctx("Choose a Filename - KVIrc","editor"),szName,KVI_FILTER_SCRIPT,true,true,true,this))return; + if(!KviFileDialog::askForSaveFileName(szFile, __tr2qs_ctx("Choose a Filename - KVIrc", "editor"), szName, KVI_FILTER_SCRIPT, true, true, true, this)) + return; - if(!KviFileUtils::writeFile(szFile,out)) + if(!KviFileUtils::writeFile(szFile, out)) { - QMessageBox::warning(this,__tr2qs_ctx("Writing to File Failed - KVIrc","editor"),__tr2qs_ctx("Unable to write to the RAW events file.","editor"),__tr2qs_ctx("OK","editor")); + QMessageBox::warning(this, __tr2qs_ctx("Writing to File Failed - KVIrc", "editor"), __tr2qs_ctx("Unable to write to the RAW events file.", "editor"), __tr2qs_ctx("OK", "editor")); } } - RawEditorWindow::RawEditorWindow() -: KviWindow(KviWindow::ScriptEditor,"raweditor",0) + : KviWindow(KviWindow::ScriptEditor, "raweditor", 0) { g_pRawEditorWindow = this; QGridLayout * g = new QGridLayout(); m_pEditor = new RawEditorWidget(this); - g->addWidget(m_pEditor,0,0,1,4); + g->addWidget(m_pEditor, 0, 0, 1, 4); - QPushButton * btn = new QPushButton(__tr2qs_ctx("&OK","editor"),this); - connect(btn,SIGNAL(clicked()),this,SLOT(okClicked())); + QPushButton * btn = new QPushButton(__tr2qs_ctx("&OK", "editor"), this); + connect(btn, SIGNAL(clicked()), this, SLOT(okClicked())); btn->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Accept))); - g->addWidget(btn,1,1); + g->addWidget(btn, 1, 1); - btn = new QPushButton(__tr2qs_ctx("&Apply","editor"),this); - connect(btn,SIGNAL(clicked()),this,SLOT(applyClicked())); + btn = new QPushButton(__tr2qs_ctx("&Apply", "editor"), this); + connect(btn, SIGNAL(clicked()), this, SLOT(applyClicked())); btn->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Accept))); - g->addWidget(btn,1,2); + g->addWidget(btn, 1, 2); - btn = new QPushButton(__tr2qs_ctx("Cancel","editor"),this); - connect(btn,SIGNAL(clicked()),this,SLOT(cancelClicked())); + btn = new QPushButton(__tr2qs_ctx("Cancel", "editor"), this); + connect(btn, SIGNAL(clicked()), this, SLOT(cancelClicked())); btn->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Discard))); - g->addWidget(btn,1,3); + g->addWidget(btn, 1, 3); - g->setRowStretch(0,1); - g->setColumnStretch(0,1); + g->setRowStretch(0, 1); + g->setColumnStretch(0, 1); setLayout(g); } @@ -521,10 +531,10 @@ QPixmap * RawEditorWindow::myIconPtr() void RawEditorWindow::fillCaptionBuffers() { - m_szPlainTextCaption = __tr2qs_ctx("RAW Editor","editor"); + m_szPlainTextCaption = __tr2qs_ctx("RAW Editor", "editor"); } -void RawEditorWindow::getConfigGroupName(QString &szName) +void RawEditorWindow::getConfigGroupName(QString & szName) { szName = "raweditor"; } diff --git a/src/modules/raweditor/RawEditorWindow.h b/src/modules/raweditor/RawEditorWindow.h index 9de743b31..7cbfa407d 100644 --- a/src/modules/raweditor/RawEditorWindow.h +++ b/src/modules/raweditor/RawEditorWindow.h @@ -37,52 +37,59 @@ class QMenu; class RawTreeWidget : public QTreeWidget { - public: - RawTreeWidget(QWidget *par) - : QTreeWidget(par){}; - void updateItem(QTreeWidgetItem *item) +public: + RawTreeWidget(QWidget * par) + : QTreeWidget(par){}; + void updateItem(QTreeWidgetItem * item) { - update(indexFromItem(item,0)); + update(indexFromItem(item, 0)); }; - ~RawTreeWidget() {}; + ~RawTreeWidget(){}; }; class RawTreeWidgetItem : public QTreeWidgetItem { public: int m_iIdx; + public: - RawTreeWidgetItem(QTreeWidget * par,int idx,bool bEnabled); - ~RawTreeWidgetItem() {}; + RawTreeWidgetItem(QTreeWidget * par, int idx, bool bEnabled); + ~RawTreeWidgetItem(){}; + public: void setEnabled(bool bEnabled) { - if (bEnabled) setIcon(0,QIcon(*g_pIconManager->getSmallIcon(KviIconManager::RawEvent))); - else setIcon(0,QIcon(*g_pIconManager->getSmallIcon(KviIconManager::RawEventNoHandlers))); - ((RawTreeWidget*)treeWidget())->updateItem(this); + if(bEnabled) + setIcon(0, QIcon(*g_pIconManager->getSmallIcon(KviIconManager::RawEvent))); + else + setIcon(0, QIcon(*g_pIconManager->getSmallIcon(KviIconManager::RawEventNoHandlers))); + ((RawTreeWidget *)treeWidget())->updateItem(this); }; }; class RawHandlerTreeWidgetItem : public QTreeWidgetItem { public: - RawHandlerTreeWidgetItem(QTreeWidgetItem * par,const QString & name,const QString & buffer,bool bEnabled) - : QTreeWidgetItem(par), m_szBuffer(buffer), m_bEnabled(bEnabled) + RawHandlerTreeWidgetItem(QTreeWidgetItem * par, const QString & name, const QString & buffer, bool bEnabled) + : QTreeWidgetItem(par), m_szBuffer(buffer), m_bEnabled(bEnabled) { - setText(0,name); + setText(0, name); setEnabled(bEnabled); }; - ~RawHandlerTreeWidgetItem() {}; + ~RawHandlerTreeWidgetItem(){}; + public: void setEnabled(bool bEnabled) { - if (bEnabled) setIcon(0,QIcon(*g_pIconManager->getSmallIcon(KviIconManager::Handler))); - else setIcon(0,QIcon(*g_pIconManager->getSmallIcon(KviIconManager::HandlerDisabled))); - ((RawTreeWidget*)treeWidget())->updateItem(this); + if(bEnabled) + setIcon(0, QIcon(*g_pIconManager->getSmallIcon(KviIconManager::Handler))); + else + setIcon(0, QIcon(*g_pIconManager->getSmallIcon(KviIconManager::HandlerDisabled))); + ((RawTreeWidget *)treeWidget())->updateItem(this); }; QString m_szBuffer; - bool m_bEnabled; - void setName(const QString &szName); + bool m_bEnabled; + void setName(const QString & szName); }; class RawEditorWidget : public QWidget @@ -91,29 +98,33 @@ class RawEditorWidget : public QWidget public: RawEditorWidget(QWidget * par); ~RawEditorWidget(); + public: KviScriptEditor * m_pEditor; - RawTreeWidget * m_pTreeWidget; - QLineEdit * m_pNameEditor; - QMenu * m_pContextPopup; + RawTreeWidget * m_pTreeWidget; + QLineEdit * m_pNameEditor; + QMenu * m_pContextPopup; RawHandlerTreeWidgetItem * m_pLastEditedItem; - bool m_bOneTimeSetupDone; + bool m_bOneTimeSetupDone; + public: void commit(); void saveLastEditedItem(); - void getUniqueHandlerName(RawTreeWidgetItem *it,QString &buffer); - void getExportEventBuffer(QString &szBuffer,RawHandlerTreeWidgetItem * it); + void getUniqueHandlerName(RawTreeWidgetItem * it, QString & buffer); + void getExportEventBuffer(QString & szBuffer, RawHandlerTreeWidgetItem * it); protected slots: - void currentItemChanged(QTreeWidgetItem *it,QTreeWidgetItem *); - void customContextMenuRequested(const QPoint &pnt); + void currentItemChanged(QTreeWidgetItem * it, QTreeWidgetItem *); + void customContextMenuRequested(const QPoint & pnt); void toggleCurrentHandlerEnabled(); void removeCurrentHandler(); void addHandlerForCurrentRaw(); void addRaw(); void exportAllEvents(); void exportCurrentHandler(); + protected: - void showEvent(QShowEvent *e); + void showEvent(QShowEvent * e); + private: void oneTimeSetup(); }; @@ -124,12 +135,14 @@ class RawEditorWindow : public KviWindow public: RawEditorWindow(); ~RawEditorWindow(); + protected: RawEditorWidget * m_pEditor; + protected: virtual QPixmap * myIconPtr(); virtual void fillCaptionBuffers(); - virtual void getConfigGroupName(QString &szName); + virtual void getConfigGroupName(QString & szName); virtual void saveProperties(KviConfigurationFile *); virtual void loadProperties(KviConfigurationFile *); protected slots: diff --git a/src/modules/raweditor/libkviraweditor.cpp b/src/modules/raweditor/libkviraweditor.cpp index 06a9060ca..acfc7ea86 100644 --- a/src/modules/raweditor/libkviraweditor.cpp +++ b/src/modules/raweditor/libkviraweditor.cpp @@ -28,10 +28,8 @@ #include "KviLocale.h" #include "KviMainWindow.h" - RawEditorWindow * g_pRawEditorWindow = 0; - /* @doc: raweditor.open @type: @@ -59,7 +57,7 @@ static bool raweditor_kvs_cmd_open(KviKvsModuleCommandCall *) static bool raweditor_module_init(KviModule * m) { - KVSM_REGISTER_SIMPLE_COMMAND(m,"open",raweditor_kvs_cmd_open); + KVSM_REGISTER_SIMPLE_COMMAND(m, "open", raweditor_kvs_cmd_open); g_pRawEditorWindow = 0; return true; } @@ -78,13 +76,12 @@ static bool raweditor_module_cleanup(KviModule *) } KVIRC_MODULE( - "RawEditor", // module name - "4.0.0", // module version - "Copyright (C) 2002 Szymon Stefanek (pragma at kvirc dot net)", // author & (C) - "Editor for the script RAW events", - raweditor_module_init, - raweditor_module_can_unload, - 0, - raweditor_module_cleanup, - "editor" -) + "RawEditor", // module name + "4.0.0", // module version + "Copyright (C) 2002 Szymon Stefanek (pragma at kvirc dot net)", // author & (C) + "Editor for the script RAW events", + raweditor_module_init, + raweditor_module_can_unload, + 0, + raweditor_module_cleanup, + "editor") diff --git a/src/modules/regchan/libkviregchan.cpp b/src/modules/regchan/libkviregchan.cpp index 35d0bf529..cefc0b9da 100644 --- a/src/modules/regchan/libkviregchan.cpp +++ b/src/modules/regchan/libkviregchan.cpp @@ -66,14 +66,14 @@ extern KVIRC_API KviRegisteredChannelDataBase * g_pRegisteredChannelDataBase; static bool regchan_kvs_cmd_add(KviKvsModuleCommandCall * c) { - QString szChan,szNetmask; + QString szChan, szNetmask; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("channel name",KVS_PT_NONEMPTYSTRING,0,szChan) - KVSM_PARAMETER("netmask",KVS_PT_STRING,KVS_PF_OPTIONAL,szNetmask) + KVSM_PARAMETER("channel name", KVS_PT_NONEMPTYSTRING, 0, szChan) + KVSM_PARAMETER("netmask", KVS_PT_STRING, KVS_PF_OPTIONAL, szNetmask) KVSM_PARAMETERS_END(c) if(szNetmask.isEmpty()) - szNetmask="*"; - g_pRegisteredChannelDataBase->add(new KviRegisteredChannel(szChan,szNetmask)); + szNetmask = "*"; + g_pRegisteredChannelDataBase->add(new KviRegisteredChannel(szChan, szNetmask)); return true; } @@ -106,22 +106,24 @@ static bool regchan_kvs_cmd_add(KviKvsModuleCommandCall * c) */ static bool regchan_kvs_cmd_remove(KviKvsModuleCommandCall * c) { - QString szChan,szNetwork; + QString szChan, szNetwork; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("channel name",KVS_PT_NONEMPTYSTRING,0,szChan) - KVSM_PARAMETER("network",KVS_PT_NONEMPTYSTRING,0,szNetwork) + KVSM_PARAMETER("channel name", KVS_PT_NONEMPTYSTRING, 0, szChan) + KVSM_PARAMETER("network", KVS_PT_NONEMPTYSTRING, 0, szNetwork) KVSM_PARAMETERS_END(c) KviRegisteredChannel * ch; - if(c->hasSwitch('e',"exactly")) - ch = g_pRegisteredChannelDataBase->findExact(szChan,szNetwork); + if(c->hasSwitch('e', "exactly")) + ch = g_pRegisteredChannelDataBase->findExact(szChan, szNetwork); else - ch = g_pRegisteredChannelDataBase->find(szChan,szNetwork); + ch = g_pRegisteredChannelDataBase->find(szChan, szNetwork); if(ch) { g_pRegisteredChannelDataBase->remove(ch); - } else { - if(!c->hasSwitch('q',"quiet")) - c->warning(__tr2qs_ctx("No such channel/netmask entry in the database","register")); + } + else + { + if(!c->hasSwitch('q', "quiet")) + c->warning(__tr2qs_ctx("No such channel/netmask entry in the database", "register")); } return true; } @@ -159,29 +161,33 @@ static bool regchan_kvs_cmd_remove(KviKvsModuleCommandCall * c) static bool regchan_kvs_cmd_setProperty(KviKvsModuleCommandCall * c) { - QString szChan,szNetwork,szProperty,szValue; + QString szChan, szNetwork, szProperty, szValue; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("channel name",KVS_PT_NONEMPTYSTRING,0,szChan) - KVSM_PARAMETER("network",KVS_PT_NONEMPTYSTRING,0,szNetwork) - KVSM_PARAMETER("property name",KVS_PT_NONEMPTYSTRING,0,szProperty) - KVSM_PARAMETER("value",KVS_PT_STRING,0,szValue) + KVSM_PARAMETER("channel name", KVS_PT_NONEMPTYSTRING, 0, szChan) + KVSM_PARAMETER("network", KVS_PT_NONEMPTYSTRING, 0, szNetwork) + KVSM_PARAMETER("property name", KVS_PT_NONEMPTYSTRING, 0, szProperty) + KVSM_PARAMETER("value", KVS_PT_STRING, 0, szValue) KVSM_PARAMETERS_END(c) KviRegisteredChannel * ch; - if(c->hasSwitch('e',"exactly")) - ch = g_pRegisteredChannelDataBase->findExact(szChan,szNetwork); + if(c->hasSwitch('e', "exactly")) + ch = g_pRegisteredChannelDataBase->findExact(szChan, szNetwork); else - ch = g_pRegisteredChannelDataBase->find(szChan,szNetwork); + ch = g_pRegisteredChannelDataBase->find(szChan, szNetwork); if(ch) { if(!szValue.isEmpty()) { - ch->setProperty(szProperty,szValue); - } else { + ch->setProperty(szProperty, szValue); + } + else + { ch->removeProperty(szProperty); } - } else { - if(!c->hasSwitch('q',"quiet")) - c->warning(__tr2qs_ctx("No such channel/netmask entry in the database","register")); + } + else + { + if(!c->hasSwitch('q', "quiet")) + c->warning(__tr2qs_ctx("No such channel/netmask entry in the database", "register")); } return true; } @@ -201,40 +207,38 @@ static bool regchan_kvs_cmd_setProperty(KviKvsModuleCommandCall * c) static bool regchan_kvs_cmd_showlist(KviKvsModuleCommandCall * c) { - c->window()->output(KVI_OUT_SYSTEMMESSAGE,__tr2qs_ctx("Registered channel list:","register")); + c->window()->output(KVI_OUT_SYSTEMMESSAGE, __tr2qs_ctx("Registered channel list:", "register")); int tot = 0; - QHash::Iterator it; - for(it = g_pRegisteredChannelDataBase->channelDict()->begin();it != g_pRegisteredChannelDataBase->channelDict()->end();++it) + QHash::Iterator it; + for(it = g_pRegisteredChannelDataBase->channelDict()->begin(); it != g_pRegisteredChannelDataBase->channelDict()->end(); ++it) { KviRegisteredChannelList * l = it.value(); KVI_ASSERT(l); - for(KviRegisteredChannel * ch = l->first();ch;ch = l->next()) + for(KviRegisteredChannel * ch = l->first(); ch; ch = l->next()) { tot++; c->window()->outputNoFmt( - KVI_OUT_SYSTEMMESSAGE, - __tr2qs_ctx("Channel: %1%2@%3","register") - .arg(QChar(KviControlCodes::Bold)) - .arg(ch->name()) - .arg(ch->netMask()) - ); + KVI_OUT_SYSTEMMESSAGE, + __tr2qs_ctx("Channel: %1%2@%3", "register") + .arg(QChar(KviControlCodes::Bold)) + .arg(ch->name()) + .arg(ch->netMask())); - for(QHash::Iterator it2 = ch->propertyDict()->begin();it2 != ch->propertyDict()->end();++it2) + for(QHash::Iterator it2 = ch->propertyDict()->begin(); it2 != ch->propertyDict()->end(); ++it2) { c->window()->outputNoFmt( - KVI_OUT_SYSTEMMESSAGE, - __tr2qs_ctx(" Property: %1=%2","register") - .arg(it2.key()) - .arg(it2.value()) - ); + KVI_OUT_SYSTEMMESSAGE, + __tr2qs_ctx(" Property: %1=%2", "register") + .arg(it2.key()) + .arg(it2.value())); } } } - c->window()->output(KVI_OUT_SYSTEMMESSAGE,__tr2qs_ctx("Total %d channels","register"),tot); + c->window()->output(KVI_OUT_SYSTEMMESSAGE, __tr2qs_ctx("Total %d channels", "register"), tot); return true; } @@ -261,33 +265,32 @@ static bool regchan_kvs_cmd_showlist(KviKvsModuleCommandCall * c) static bool regchan_kvs_fnc_list(KviKvsModuleFunctionCall * c) { - QString szChan,szNetmask; + QString szChan, szNetmask; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("channel name",KVS_PT_STRING,KVS_PF_OPTIONAL,szChan) - KVSM_PARAMETER("netmask",KVS_PT_STRING,KVS_PF_OPTIONAL,szNetmask) + KVSM_PARAMETER("channel name", KVS_PT_STRING, KVS_PF_OPTIONAL, szChan) + KVSM_PARAMETER("netmask", KVS_PT_STRING, KVS_PF_OPTIONAL, szNetmask) KVSM_PARAMETERS_END(c) - KviKvsArray* pArray = new KviKvsArray(); + KviKvsArray * pArray = new KviKvsArray(); - int aid=0; + int aid = 0; if(szChan.isEmpty()) - szChan="*"; + szChan = "*"; if(szNetmask.isEmpty()) - szNetmask="*"; + szNetmask = "*"; - - QHash::Iterator it; - for(it = g_pRegisteredChannelDataBase->channelDict()->begin();it != g_pRegisteredChannelDataBase->channelDict()->end();++it) + QHash::Iterator it; + for(it = g_pRegisteredChannelDataBase->channelDict()->begin(); it != g_pRegisteredChannelDataBase->channelDict()->end(); ++it) { KviRegisteredChannelList * l = it.value(); KVI_ASSERT(l); - for(KviRegisteredChannel * ch = l->first();ch;ch = l->next()) + for(KviRegisteredChannel * ch = l->first(); ch; ch = l->next()) { - if(KviQString::matchWildExpressions(ch->name(),szChan) && KviQString::matchWildExpressions(ch->netMask(),szNetmask)) + if(KviQString::matchWildExpressions(ch->name(), szChan) && KviQString::matchWildExpressions(ch->netMask(), szNetmask)) { - pArray->set(aid,new KviKvsVariant(QString::fromUtf8("%1@%2").arg(ch->name(),ch->netMask()))); + pArray->set(aid, new KviKvsVariant(QString::fromUtf8("%1@%2").arg(ch->name(), ch->netMask()))); aid++; } } @@ -319,13 +322,13 @@ static bool regchan_kvs_fnc_list(KviKvsModuleFunctionCall * c) static bool regchan_kvs_fnc_property(KviKvsModuleFunctionCall * c) { - QString szChan,szNetwork,szPropertyName; + QString szChan, szNetwork, szPropertyName; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("channel name",KVS_PT_STRING,0,szChan) - KVSM_PARAMETER("network",KVS_PT_STRING,0,szNetwork) - KVSM_PARAMETER("property name",KVS_PT_NONEMPTYSTRING,0,szPropertyName) + KVSM_PARAMETER("channel name", KVS_PT_STRING, 0, szChan) + KVSM_PARAMETER("network", KVS_PT_STRING, 0, szNetwork) + KVSM_PARAMETER("property name", KVS_PT_NONEMPTYSTRING, 0, szPropertyName) KVSM_PARAMETERS_END(c) - KviRegisteredChannel * ch = g_pRegisteredChannelDataBase->find(szChan,szNetwork); + KviRegisteredChannel * ch = g_pRegisteredChannelDataBase->find(szChan, szNetwork); if(ch) { QString szProp = ch->property(szPropertyName); @@ -356,15 +359,14 @@ static bool regchan_kvs_fnc_property(KviKvsModuleFunctionCall * c) [fnc]$regchan.find[/fnc] */ - static bool regchan_kvs_fnc_match(KviKvsModuleFunctionCall * c) { - QString szChan,szNetwork; + QString szChan, szNetwork; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("channel name",KVS_PT_STRING,0,szChan) - KVSM_PARAMETER("network",KVS_PT_STRING,0,szNetwork) + KVSM_PARAMETER("channel name", KVS_PT_STRING, 0, szChan) + KVSM_PARAMETER("network", KVS_PT_STRING, 0, szNetwork) KVSM_PARAMETERS_END(c) - KviRegisteredChannel * ch = g_pRegisteredChannelDataBase->find(szChan,szNetwork); + KviRegisteredChannel * ch = g_pRegisteredChannelDataBase->find(szChan, szNetwork); c->returnValue()->setBoolean(ch); return true; } @@ -395,26 +397,26 @@ static bool regchan_kvs_fnc_match(KviKvsModuleFunctionCall * c) static bool regchan_kvs_fnc_find(KviKvsModuleFunctionCall * c) { - QString szChan,szNetmask; + QString szChan, szNetmask; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("channel name",KVS_PT_STRING,0,szChan) - KVSM_PARAMETER("netmask",KVS_PT_STRING,0,szNetmask) + KVSM_PARAMETER("channel name", KVS_PT_STRING, 0, szChan) + KVSM_PARAMETER("netmask", KVS_PT_STRING, 0, szNetmask) KVSM_PARAMETERS_END(c) - KviRegisteredChannel * ch = g_pRegisteredChannelDataBase->find(szChan,szNetmask); + KviRegisteredChannel * ch = g_pRegisteredChannelDataBase->find(szChan, szNetmask); c->returnValue()->setBoolean(ch); return true; } static bool regchan_module_init(KviModule * m) { - KVSM_REGISTER_SIMPLE_COMMAND(m,"add",regchan_kvs_cmd_add); - KVSM_REGISTER_SIMPLE_COMMAND(m,"showlist",regchan_kvs_cmd_showlist); - KVSM_REGISTER_SIMPLE_COMMAND(m,"remove",regchan_kvs_cmd_remove); - KVSM_REGISTER_SIMPLE_COMMAND(m,"setProperty",regchan_kvs_cmd_setProperty); - KVSM_REGISTER_FUNCTION(m,"property",regchan_kvs_fnc_property); - KVSM_REGISTER_FUNCTION(m,"match",regchan_kvs_fnc_match); - KVSM_REGISTER_FUNCTION(m,"find",regchan_kvs_fnc_find); - KVSM_REGISTER_FUNCTION(m,"list",regchan_kvs_fnc_list); + KVSM_REGISTER_SIMPLE_COMMAND(m, "add", regchan_kvs_cmd_add); + KVSM_REGISTER_SIMPLE_COMMAND(m, "showlist", regchan_kvs_cmd_showlist); + KVSM_REGISTER_SIMPLE_COMMAND(m, "remove", regchan_kvs_cmd_remove); + KVSM_REGISTER_SIMPLE_COMMAND(m, "setProperty", regchan_kvs_cmd_setProperty); + KVSM_REGISTER_FUNCTION(m, "property", regchan_kvs_fnc_property); + KVSM_REGISTER_FUNCTION(m, "match", regchan_kvs_fnc_match); + KVSM_REGISTER_FUNCTION(m, "find", regchan_kvs_fnc_find); + KVSM_REGISTER_FUNCTION(m, "list", regchan_kvs_fnc_list); return true; } @@ -430,13 +432,12 @@ static bool regchan_module_can_unload(KviModule *) } KVIRC_MODULE( - "RegChan", // module name - "4.0.0", // module version - "Copyright (C) 2002 Szymon Stefanek (pragma at kvirc dot net)", // author & (C) - "Script interface to the registered channels database", - regchan_module_init, - regchan_module_can_unload, - 0, - regchan_module_cleanup, - "register" -) + "RegChan", // module name + "4.0.0", // module version + "Copyright (C) 2002 Szymon Stefanek (pragma at kvirc dot net)", // author & (C) + "Script interface to the registered channels database", + regchan_module_init, + regchan_module_can_unload, + 0, + regchan_module_cleanup, + "register") diff --git a/src/modules/reguser/RegisteredUserEntryDialog.cpp b/src/modules/reguser/RegisteredUserEntryDialog.cpp index 9c7775cb9..1eb24c37d 100644 --- a/src/modules/reguser/RegisteredUserEntryDialog.cpp +++ b/src/modules/reguser/RegisteredUserEntryDialog.cpp @@ -66,60 +66,59 @@ extern RegisteredUsersDialog * g_pRegisteredUsersDialog; KviRegisteredUserDataBase * g_pLocalRegisteredUserDataBase; // local copy! - -RegisteredUserPropertiesDialog::RegisteredUserPropertiesDialog(QWidget * p,KviPointerHashTable * dict) -: QDialog(p) +RegisteredUserPropertiesDialog::RegisteredUserPropertiesDialog(QWidget * p, KviPointerHashTable * dict) + : QDialog(p) { setObjectName("property_editor"); setWindowModality(Qt::WindowModal); m_pPropertyDict = dict; - setWindowTitle(__tr2qs_ctx("Property Editor - KVIrc","register")); + setWindowTitle(__tr2qs_ctx("Property Editor - KVIrc", "register")); setWindowIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Linux))); QGridLayout * g = new QGridLayout(this); m_pTable = new QTableWidget(this); //g->addMultiCellWidget(m_pTable,0,1,0,1); - g->addWidget(m_pTable,0,0); + g->addWidget(m_pTable, 0, 0); m_pTable->setColumnCount(2); m_pTable->setSelectionMode(QAbstractItemView::SingleSelection); m_pTable->setSelectionBehavior(QAbstractItemView::SelectRows); QStringList header; - header.append(__tr2qs_ctx("Property","register")); - header.append(__tr2qs_ctx("Value","register")); + header.append(__tr2qs_ctx("Property", "register")); + header.append(__tr2qs_ctx("Value", "register")); m_pTable->setHorizontalHeaderLabels(header); - m_pTable->setMinimumSize(250,250); + m_pTable->setMinimumSize(250, 250); //connect(m_pTable,SIGNAL(valueChanged(int,int)),this,SLOT(propertyValueChanged(int,int))); KviTalVBox * vb = new KviTalVBox(this); vb->setSpacing(4); - g->addWidget(vb,0,1,0,3); + g->addWidget(vb, 0, 1, 0, 3); - m_pAddButton = new QPushButton(__tr2qs_ctx("&New","register"),vb); - connect(m_pAddButton,SIGNAL(clicked()),this,SLOT(addClicked())); + m_pAddButton = new QPushButton(__tr2qs_ctx("&New", "register"), vb); + connect(m_pAddButton, SIGNAL(clicked()), this, SLOT(addClicked())); m_pAddButton->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::NewItem))); - m_pDelButton = new QPushButton(__tr2qs_ctx("&Remove","register"),vb); - connect(m_pDelButton,SIGNAL(clicked()),this,SLOT(delClicked())); + m_pDelButton = new QPushButton(__tr2qs_ctx("&Remove", "register"), vb); + connect(m_pDelButton, SIGNAL(clicked()), this, SLOT(delClicked())); m_pDelButton->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::DeleteItem))); KviTalHBox * b = new KviTalHBox(this); b->setSpacing(4); //g->addMultiCellWidget(b,2,2,1,2); - g->addWidget(b,1,1); - QPushButton * pb = new QPushButton(__tr2qs_ctx("&OK","register"),b); - connect(pb,SIGNAL(clicked()),this,SLOT(okClicked())); + g->addWidget(b, 1, 1); + QPushButton * pb = new QPushButton(__tr2qs_ctx("&OK", "register"), b); + connect(pb, SIGNAL(clicked()), this, SLOT(okClicked())); pb->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Accept))); - pb = new QPushButton(__tr2qs_ctx("Cancel","register"),b); - connect(pb,SIGNAL(clicked()),this,SLOT(reject())); + pb = new QPushButton(__tr2qs_ctx("Cancel", "register"), b); + connect(pb, SIGNAL(clicked()), this, SLOT(reject())); pb->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Discard))); - g->setRowStretch(1,1); - g->setColumnStretch(0,1); + g->setRowStretch(1, 1); + g->setColumnStretch(0, 1); fillData(); } @@ -128,7 +127,7 @@ RegisteredUserPropertiesDialog::~RegisteredUserPropertiesDialog() { } -void RegisteredUserPropertiesDialog::closeEvent(QCloseEvent *e) +void RegisteredUserPropertiesDialog::closeEvent(QCloseEvent * e) { e->accept(); //delete this; @@ -137,22 +136,23 @@ void RegisteredUserPropertiesDialog::closeEvent(QCloseEvent *e) void RegisteredUserPropertiesDialog::fillData() { m_pTable->setRowCount(m_pPropertyDict->count()); - KviPointerHashTableIterator it(*m_pPropertyDict); + KviPointerHashTableIterator it(*m_pPropertyDict); int row = 0; while(it.current()) { - QTableWidgetItem * m_pTableItem1 = new QTableWidgetItem(it.currentKey(),QTableWidgetItem::Type); + QTableWidgetItem * m_pTableItem1 = new QTableWidgetItem(it.currentKey(), QTableWidgetItem::Type); m_pTableItem1->setFlags(Qt::ItemIsEnabled | Qt::ItemIsEditable | Qt::ItemIsSelectable); - QTableWidgetItem * m_pTableItem2 = new QTableWidgetItem(*(it.current()),QTableWidgetItem::Type); + QTableWidgetItem * m_pTableItem2 = new QTableWidgetItem(*(it.current()), QTableWidgetItem::Type); m_pTableItem2->setFlags(Qt::ItemIsEnabled | Qt::ItemIsEditable | Qt::ItemIsSelectable); - m_pTable->setItem(row,0,m_pTableItem1); - m_pTable->setItem(row,1,m_pTableItem2); + m_pTable->setItem(row, 0, m_pTableItem1); + m_pTable->setItem(row, 1, m_pTableItem2); ++row; ++it; } - if(m_pTable->rowCount() == 0)m_pDelButton->setEnabled(false); + if(m_pTable->rowCount() == 0) + m_pDelButton->setEnabled(false); } void RegisteredUserPropertiesDialog::okClicked() @@ -160,13 +160,13 @@ void RegisteredUserPropertiesDialog::okClicked() m_pPropertyDict->clear(); int n = m_pTable->rowCount(); - for(int i=0;iitem(i,0)->text(); - QString szValue = m_pTable->item(i,1)->text(); + QString szName = m_pTable->item(i, 0)->text(); + QString szValue = m_pTable->item(i, 1)->text(); if((!szName.isEmpty()) && (!szValue.isEmpty())) { - m_pPropertyDict->replace(szName,new QString(szValue)); + m_pPropertyDict->replace(szName, new QString(szValue)); } } @@ -177,14 +177,14 @@ void RegisteredUserPropertiesDialog::addClicked() { m_pTable->setRowCount(m_pTable->rowCount() + 1); - QTableWidgetItem * m_pTableItem1 = new QTableWidgetItem("",QTableWidgetItem::Type); + QTableWidgetItem * m_pTableItem1 = new QTableWidgetItem("", QTableWidgetItem::Type); m_pTableItem1->setFlags(Qt::ItemIsEnabled | Qt::ItemIsEditable | Qt::ItemIsSelectable); - QTableWidgetItem * m_pTableItem2 = new QTableWidgetItem("",QTableWidgetItem::Type); + QTableWidgetItem * m_pTableItem2 = new QTableWidgetItem("", QTableWidgetItem::Type); m_pTableItem2->setFlags(Qt::ItemIsEnabled | Qt::ItemIsEditable | Qt::ItemIsSelectable); - m_pTable->setItem(m_pTable->rowCount() - 1,0,m_pTableItem1); - m_pTable->setItem(m_pTable->rowCount() - 1,1,m_pTableItem2); + m_pTable->setItem(m_pTable->rowCount() - 1, 0, m_pTableItem1); + m_pTable->setItem(m_pTable->rowCount() - 1, 1, m_pTableItem2); m_pDelButton->setEnabled(true); } @@ -196,74 +196,74 @@ void RegisteredUserPropertiesDialog::delClicked() { // remove row i m_pTable->removeRow(i); - if(m_pTable->rowCount() == 0)m_pDelButton->setEnabled(false); + if(m_pTable->rowCount() == 0) + m_pDelButton->setEnabled(false); } } - -RegisteredUserMaskDialog::RegisteredUserMaskDialog(QWidget * p,KviIrcMask * m) -: QDialog(p) +RegisteredUserMaskDialog::RegisteredUserMaskDialog(QWidget * p, KviIrcMask * m) + : QDialog(p) { setObjectName("reguser_mask_editor"); setWindowModality(Qt::WindowModal); m_pMask = m; - setWindowTitle(__tr2qs_ctx("Mask Editor - KVIrc","register")); + setWindowTitle(__tr2qs_ctx("Mask Editor - KVIrc", "register")); QGridLayout * g = new QGridLayout(this); - QLabel * l = new QLabel(__tr2qs_ctx("Insert a mask for this user.
It can contain the wildcard characters '*' and '?'.","register"),this); + QLabel * l = new QLabel(__tr2qs_ctx("Insert a mask for this user.
It can contain the wildcard characters '*' and '?'.", "register"), this); //l->setAlignment(Qt::AlignCenter); - g->addWidget(l,0,0,1,2); + g->addWidget(l, 0, 0, 1, 2); KviTalHBox * b = new KviTalHBox(this); - g->addWidget(b,1,0,1,2); + g->addWidget(b, 1, 0, 1, 2); m_pNickEdit = new QLineEdit(b); //m_pNickEdit->setMinimumWidth(120); m_pNickEdit->setAlignment(Qt::AlignRight); - m_pNickEdit->setToolTip(__tr2qs_ctx("This is the nickname that will match this user, default value is the registered name.","register")); + m_pNickEdit->setToolTip(__tr2qs_ctx("This is the nickname that will match this user, default value is the registered name.", "register")); - l = new QLabel("!",b); + l = new QLabel("!", b); l->setAlignment(Qt::AlignCenter); //l->setMinimumWidth(40); m_pUserEdit = new QLineEdit(b); //m_pUserEdit->setMinimumWidth(120); m_pUserEdit->setAlignment(Qt::AlignCenter); - m_pUserEdit->setToolTip(__tr2qs_ctx("This is the username that will match this user. * will match any username.","register")); + m_pUserEdit->setToolTip(__tr2qs_ctx("This is the username that will match this user. * will match any username.", "register")); - l = new QLabel("@",b); + l = new QLabel("@", b); l->setAlignment(Qt::AlignCenter); //l->setMinimumWidth(40); m_pHostEdit = new QLineEdit(b); //m_pHostEdit->setMinimumWidth(120); m_pHostEdit->setAlignment(Qt::AlignLeft); - m_pHostEdit->setToolTip(__tr2qs_ctx("This is the hostname that will match this user. * will match any hostname.","register")); + m_pHostEdit->setToolTip(__tr2qs_ctx("This is the hostname that will match this user. * will match any hostname.", "register")); // just a spacer -// l = new QLabel(" ",this); -// g->addMultiCellWidget(l,2,2,0,1); + // l = new QLabel(" ",this); + // g->addMultiCellWidget(l,2,2,0,1); -// QFrame * f = new QFrame(this); -// f->setFrameStyle(QFrame::HLine | QFrame::Sunken); -// g->addMultiCellWidget(f,3,3,0,1); + // QFrame * f = new QFrame(this); + // f->setFrameStyle(QFrame::HLine | QFrame::Sunken); + // g->addMultiCellWidget(f,3,3,0,1); b = new KviTalHBox(this); b->setSpacing(4); - g->addWidget(b,2,1); + g->addWidget(b, 2, 1); - QPushButton * pb = new QPushButton(__tr2qs_ctx("&OK","register"),b); - connect(pb,SIGNAL(clicked()),this,SLOT(okClicked())); + QPushButton * pb = new QPushButton(__tr2qs_ctx("&OK", "register"), b); + connect(pb, SIGNAL(clicked()), this, SLOT(okClicked())); //pb->setMinimumWidth(120); - pb = new QPushButton(__tr2qs_ctx("Cancel","register"),b); - connect(pb,SIGNAL(clicked()),this,SLOT(reject())); + pb = new QPushButton(__tr2qs_ctx("Cancel", "register"), b); + connect(pb, SIGNAL(clicked()), this, SLOT(reject())); //pb->setMinimumWidth(120); - g->setColumnStretch(0,1); - g->setRowStretch(0,1); + g->setColumnStretch(0, 1); + g->setRowStretch(0, 1); m_pNickEdit->setText(m->nick()); m_pUserEdit->setText(m->user()); @@ -274,7 +274,7 @@ RegisteredUserMaskDialog::~RegisteredUserMaskDialog() { } -void RegisteredUserMaskDialog::closeEvent(QCloseEvent *e) +void RegisteredUserMaskDialog::closeEvent(QCloseEvent * e) { e->accept(); //delete this; @@ -283,116 +283,116 @@ void RegisteredUserMaskDialog::closeEvent(QCloseEvent *e) void RegisteredUserMaskDialog::okClicked() { KviCString szTmp = m_pNickEdit->text(); - if(szTmp.isEmpty())szTmp = "*"; + if(szTmp.isEmpty()) + szTmp = "*"; m_pMask->setNick(szTmp.ptr()); szTmp = m_pUserEdit->text(); - if(szTmp.isEmpty())szTmp = "*"; + if(szTmp.isEmpty()) + szTmp = "*"; m_pMask->setUsername(szTmp.ptr()); szTmp = m_pHostEdit->text(); - if(szTmp.isEmpty())szTmp = "*"; + if(szTmp.isEmpty()) + szTmp = "*"; m_pMask->setHost(szTmp.ptr()); accept(); } - -RegisteredUserEntryDialog::RegisteredUserEntryDialog(QWidget *p,KviRegisteredUser * r,bool bModal) -: KviTalTabDialog(p,"reguser_entry_editor",bModal) +RegisteredUserEntryDialog::RegisteredUserEntryDialog(QWidget * p, KviRegisteredUser * r, bool bModal) + : KviTalTabDialog(p, "reguser_entry_editor", bModal) { m_pUser = r; m_pCustomColor = new QColor(); if(r) { - QString col=r->getProperty("customColor"); - KviStringConversion::fromString(col,(*m_pCustomColor)); + QString col = r->getProperty("customColor"); + KviStringConversion::fromString(col, (*m_pCustomColor)); } - m_pPropertyDict = new KviPointerHashTable(17,false); + m_pPropertyDict = new KviPointerHashTable(17, false); m_pPropertyDict->setAutoDelete(true); //setMinimumSize(400,450); setWindowIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Linux))); - setWindowTitle(__tr2qs_ctx("Registered User Entry - KVIrc","register")); + setWindowTitle(__tr2qs_ctx("Registered User Entry - KVIrc", "register")); QWidget * p1 = new QWidget(this); QGridLayout * g = new QGridLayout(p1); - QLabel * l = new QLabel(__tr2qs_ctx("Name:","register"),p1); - g->addWidget(l,0,0); + QLabel * l = new QLabel(__tr2qs_ctx("Name:", "register"), p1); + g->addWidget(l, 0, 0); m_pNameEdit = new QLineEdit(p1); - g->addWidget(m_pNameEdit,0,1); + g->addWidget(m_pNameEdit, 0, 1); - l = new QLabel(__tr2qs_ctx("Comment:","register"),p1); - g->addWidget(l,1,0); + l = new QLabel(__tr2qs_ctx("Comment:", "register"), p1); + g->addWidget(l, 1, 0); m_pCommentEdit = new QLineEdit(p1); - g->addWidget(m_pCommentEdit,1,1); + g->addWidget(m_pCommentEdit, 1, 1); QFrame * f = new QFrame(p1); - g->addWidget(f,2,0,1,2); + g->addWidget(f, 2, 0, 1, 2); f->setFrameStyle(QFrame::HLine | QFrame::Sunken); - l = new QLabel(__tr2qs_ctx("Masks:","register"),p1); - g->addWidget(l,3,0,1,2); + l = new QLabel(__tr2qs_ctx("Masks:", "register"), p1); + g->addWidget(l, 3, 0, 1, 2); m_pMaskListBox = new QListWidget(p1); - connect(m_pMaskListBox,SIGNAL(itemSelectionChanged()),this,SLOT(maskCurrentChanged())); - m_pMaskListBox->setMinimumSize(300,200); + connect(m_pMaskListBox, SIGNAL(itemSelectionChanged()), this, SLOT(maskCurrentChanged())); + m_pMaskListBox->setMinimumSize(300, 200); - g->addWidget(m_pMaskListBox,4,0,1,2); + g->addWidget(m_pMaskListBox, 4, 0, 1, 2); KviTalHBox * b = new KviTalHBox(p1); - g->addWidget(b,5,0,1,2); + g->addWidget(b, 5, 0, 1, 2); b->setSpacing(4); - m_pAddMaskButton = new QPushButton(__tr2qs_ctx("&Add...","register"),b); - connect(m_pAddMaskButton,SIGNAL(clicked()),this,SLOT(addMaskClicked())); + m_pAddMaskButton = new QPushButton(__tr2qs_ctx("&Add...", "register"), b); + connect(m_pAddMaskButton, SIGNAL(clicked()), this, SLOT(addMaskClicked())); m_pAddMaskButton->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::NewItem))); - m_pDelMaskButton = new QPushButton(__tr2qs_ctx("Re&move","register"),b); + m_pDelMaskButton = new QPushButton(__tr2qs_ctx("Re&move", "register"), b); m_pDelMaskButton->setEnabled(false); - connect(m_pDelMaskButton,SIGNAL(clicked()),this,SLOT(delMaskClicked())); + connect(m_pDelMaskButton, SIGNAL(clicked()), this, SLOT(delMaskClicked())); m_pDelMaskButton->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::DeleteItem))); - m_pEditMaskButton = new QPushButton(__tr2qs_ctx("&Edit","register"),b); + m_pEditMaskButton = new QPushButton(__tr2qs_ctx("&Edit", "register"), b); m_pEditMaskButton->setEnabled(false); - connect(m_pEditMaskButton,SIGNAL(clicked()),this,SLOT(editMaskClicked())); + connect(m_pEditMaskButton, SIGNAL(clicked()), this, SLOT(editMaskClicked())); m_pEditMaskButton->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::EditItem))); - g->setRowStretch(4,1); - g->setColumnStretch(1,1); + g->setRowStretch(4, 1); + g->setColumnStretch(1, 1); - addTab(p1,__tr2qs_ctx("Identity","register")); + addTab(p1, __tr2qs_ctx("Identity", "register")); QWidget * p2 = new QWidget(this); g = new QGridLayout(p2); - m_pNotifyCheck = new QCheckBox(__tr2qs_ctx("Notify when user is online","register"),p2); - g->addWidget(m_pNotifyCheck,0,0,1,3); + m_pNotifyCheck = new QCheckBox(__tr2qs_ctx("Notify when user is online", "register"), p2); + g->addWidget(m_pNotifyCheck, 0, 0, 1, 3); - m_pNotifyLabel = new QLabel(__tr2qs_ctx("Notify nicknames:","register"),p2); + m_pNotifyLabel = new QLabel(__tr2qs_ctx("Notify nicknames:", "register"), p2); m_pNotifyLabel->setEnabled(m_pNotifyCheck->isChecked()); - g->addWidget(m_pNotifyLabel,1,0); - m_pNotifyCheck->setToolTip(__tr2qs_ctx("You can enter a space separated list of nicknames.","register")); - + g->addWidget(m_pNotifyLabel, 1, 0); + m_pNotifyCheck->setToolTip(__tr2qs_ctx("You can enter a space separated list of nicknames.", "register")); m_pNotifyNick = new QLineEdit(p2); m_pNotifyNick->setEnabled(false); - g->addWidget(m_pNotifyNick,1,1,1,2); - connect(m_pNotifyCheck,SIGNAL(toggled(bool)),this,SLOT(notifyCheckClicked(bool))); - + g->addWidget(m_pNotifyNick, 1, 1, 1, 2); + connect(m_pNotifyCheck, SIGNAL(toggled(bool)), this, SLOT(notifyCheckClicked(bool))); f = new QFrame(p2); f->setFrameStyle(QFrame::HLine | QFrame::Sunken); - g->addWidget(f,2,0,1,3); + g->addWidget(f, 2, 0, 1, 3); m_pAvatar = 0; if(r) @@ -403,81 +403,82 @@ RegisteredUserEntryDialog::RegisteredUserEntryDialog(QWidget *p,KviRegisteredUse m_pAvatar = new KviPixmap(av.toUtf8().data()); } } - if(!m_pAvatar)m_pAvatar = new KviPixmap(); + if(!m_pAvatar) + m_pAvatar = new KviPixmap(); - m_pAvatarSelector = new KviPixmapSelector(p2,__tr2qs_ctx("Avatar:","register"),m_pAvatar,true); - g->addWidget(m_pAvatarSelector,3,0,1,3); + m_pAvatarSelector = new KviPixmapSelector(p2, __tr2qs_ctx("Avatar:", "register"), m_pAvatar, true); + g->addWidget(m_pAvatarSelector, 3, 0, 1, 3); f = new QFrame(p2); f->setFrameStyle(QFrame::HLine | QFrame::Sunken); - g->addWidget(f,4,0,1,3); + g->addWidget(f, 4, 0, 1, 3); - m_pCustomColorCheck = new QCheckBox(__tr2qs_ctx("Use custom color in userlist","register"),p2); + m_pCustomColorCheck = new QCheckBox(__tr2qs_ctx("Use custom color in userlist", "register"), p2); if(r) m_pCustomColorCheck->setChecked(r->getBoolProperty("useCustomColor")); - g->addWidget(m_pCustomColorCheck,5,0,1,2); + g->addWidget(m_pCustomColorCheck, 5, 0, 1, 2); - m_pCustomColorSelector = new KviColorSelector(p2,QString(),m_pCustomColor,1); - g->addWidget(m_pCustomColorSelector,5,2); + m_pCustomColorSelector = new KviColorSelector(p2, QString(), m_pCustomColor, 1); + g->addWidget(m_pCustomColorSelector, 5, 2); - QPushButton * pb = new QPushButton(__tr2qs_ctx("All Properties...","register"),p2); - connect(pb,SIGNAL(clicked()),this,SLOT(editAllPropertiesClicked())); - g->addWidget(pb,6,2); + QPushButton * pb = new QPushButton(__tr2qs_ctx("All Properties...", "register"), p2); + connect(pb, SIGNAL(clicked()), this, SLOT(editAllPropertiesClicked())); + g->addWidget(pb, 6, 2); - g->setColumnStretch(1,1); - g->setRowStretch(3,1); + g->setColumnStretch(1, 1); + g->setRowStretch(3, 1); - addTab(p2,__tr2qs_ctx("Properties","register")); + addTab(p2, __tr2qs_ctx("Properties", "register")); // Ignore TAB KviTalVBox * vb = new KviTalVBox(this); vb->setMargin(10); - m_pIgnoreEnabled = new QCheckBox(__tr2qs_ctx("Enable ignore for this user","register"),vb); + m_pIgnoreEnabled = new QCheckBox(__tr2qs_ctx("Enable ignore for this user", "register"), vb); - QGroupBox * gb = new QGroupBox(__tr2qs_ctx("Ignore Features","register"),vb); - connect(m_pIgnoreEnabled,SIGNAL(toggled(bool)),gb,SLOT(setEnabled(bool))); + QGroupBox * gb = new QGroupBox(__tr2qs_ctx("Ignore Features", "register"), vb); + connect(m_pIgnoreEnabled, SIGNAL(toggled(bool)), gb, SLOT(setEnabled(bool))); QVBoxLayout * layout = new QVBoxLayout(gb); layout->setMargin(20); layout->setSpacing(3); - m_pIgnoreQuery = new QCheckBox(__tr2qs_ctx("Ignore query messages","register"),gb); + m_pIgnoreQuery = new QCheckBox(__tr2qs_ctx("Ignore query messages", "register"), gb); layout->addWidget(m_pIgnoreQuery); - m_pIgnoreChannel = new QCheckBox(__tr2qs_ctx("Ignore channel messages","register"),gb); + m_pIgnoreChannel = new QCheckBox(__tr2qs_ctx("Ignore channel messages", "register"), gb); layout->addWidget(m_pIgnoreChannel); - m_pIgnoreNotice = new QCheckBox(__tr2qs_ctx("Ignore notice messages","register"),gb); + m_pIgnoreNotice = new QCheckBox(__tr2qs_ctx("Ignore notice messages", "register"), gb); layout->addWidget(m_pIgnoreNotice); - m_pIgnoreCtcp = new QCheckBox(__tr2qs_ctx("Ignore CTCP messages","register"),gb); + m_pIgnoreCtcp = new QCheckBox(__tr2qs_ctx("Ignore CTCP messages", "register"), gb); layout->addWidget(m_pIgnoreCtcp); - m_pIgnoreInvite = new QCheckBox(__tr2qs_ctx("Ignore invites","register"),gb); + m_pIgnoreInvite = new QCheckBox(__tr2qs_ctx("Ignore invites", "register"), gb); layout->addWidget(m_pIgnoreInvite); - m_pIgnoreDcc = new QCheckBox(__tr2qs_ctx("Ignore DCCs","register"),gb); + m_pIgnoreDcc = new QCheckBox(__tr2qs_ctx("Ignore DCCs", "register"), gb); layout->addWidget(m_pIgnoreDcc); - m_pIgnoreHighlight = new QCheckBox(__tr2qs_ctx("Ignore highlights","register"),gb); + m_pIgnoreHighlight = new QCheckBox(__tr2qs_ctx("Ignore highlights", "register"), gb); layout->addWidget(m_pIgnoreHighlight); - QWidget *w = new QWidget(vb); - w->setSizePolicy(QSizePolicy::Ignored,QSizePolicy::Ignored); + QWidget * w = new QWidget(vb); + w->setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Ignored); - addTab(vb,__tr2qs_ctx("Ignore","register")); + addTab(vb, __tr2qs_ctx("Ignore", "register")); - setCancelButton(__tr2qs_ctx("Cancel","register")); - setOkButton(__tr2qs_ctx("&OK","register")); - connect(this,SIGNAL(applyButtonPressed()),this,SLOT(okClicked())); - connect(this,SIGNAL(cancelButtonPressed()),this,SLOT(reject())); + setCancelButton(__tr2qs_ctx("Cancel", "register")); + setOkButton(__tr2qs_ctx("&OK", "register")); + connect(this, SIGNAL(applyButtonPressed()), this, SLOT(okClicked())); + connect(this, SIGNAL(cancelButtonPressed()), this, SLOT(reject())); if(r) { m_pNameEdit->setText(r->name()); m_pCommentEdit->setText(r->getProperty("comment")); - for(KviIrcMask * m = r->maskList()->first();m;m = r->maskList()->next()) + for(KviIrcMask * m = r->maskList()->first(); m; m = r->maskList()->next()) { QString mk = m->nick(); mk += QChar('!'); @@ -497,10 +498,10 @@ RegisteredUserEntryDialog::RegisteredUserEntryDialog(QWidget *p,KviRegisteredUse if(r->propertyDict()) { - KviPointerHashTableIterator it(*(r->propertyDict())); - while(QString *s = it.current()) + KviPointerHashTableIterator it(*(r->propertyDict())); + while(QString * s = it.current()) { - m_pPropertyDict->insert(it.currentKey(),new QString(*s)); + m_pPropertyDict->insert(it.currentKey(), new QString(*s)); ++it; } } @@ -516,7 +517,9 @@ RegisteredUserEntryDialog::RegisteredUserEntryDialog(QWidget *p,KviRegisteredUse m_pIgnoreInvite->setChecked(r->ignoreFlags() & KviRegisteredUser::Invite); m_pIgnoreDcc->setChecked(r->ignoreFlags() & KviRegisteredUser::Dcc); m_pIgnoreHighlight->setChecked(r->ignoreFlags() & KviRegisteredUser::Highlight); - } else { + } + else + { // default values if(!m_pIgnoreEnabled->isChecked()) { @@ -525,7 +528,7 @@ RegisteredUserEntryDialog::RegisteredUserEntryDialog(QWidget *p,KviRegisteredUse } } -void RegisteredUserEntryDialog::closeEvent(QCloseEvent *e) +void RegisteredUserEntryDialog::closeEvent(QCloseEvent * e) { e->accept(); okClicked(); @@ -548,12 +551,13 @@ void RegisteredUserEntryDialog::notifyCheckClicked(bool bChecked) QString szMask; if(m_pUser) { - for(KviIrcMask * m = m_pUser->maskList()->first();m;m = m_pUser->maskList()->next()) + for(KviIrcMask * m = m_pUser->maskList()->first(); m; m = m_pUser->maskList()->next()) { QString tmp = m->nick(); if((tmp.indexOf('*') == -1) && (tmp.indexOf('?') == -1) && (!tmp.isEmpty())) { - if(!szMask.isEmpty())szMask.append(' '); + if(!szMask.isEmpty()) + szMask.append(' '); szMask.append(tmp); } } @@ -561,10 +565,10 @@ void RegisteredUserEntryDialog::notifyCheckClicked(bool bChecked) if(szMask.isEmpty()) { szMask = m_pUser->name(); - szMask.replace(" ",""); - szMask.replace("'",""); - szMask.replace("&",""); - szMask.replace(",",""); + szMask.replace(" ", ""); + szMask.replace("'", ""); + szMask.replace("&", ""); + szMask.replace(",", ""); } m_pNotifyNick->setText(szMask); } @@ -584,13 +588,14 @@ void RegisteredUserEntryDialog::okClicked() QString szGroup; if(m_pUser) { - szGroup=m_pUser->group(); + szGroup = m_pUser->group(); g_pLocalRegisteredUserDataBase->removeUser(m_pUser->name()); } QString name = m_pNameEdit->text(); - if(name.isEmpty())name = "user"; + if(name.isEmpty()) + name = "user"; KviRegisteredUser * u; @@ -598,7 +603,8 @@ void RegisteredUserEntryDialog::okClicked() int idx = 1; - do { + do + { u = g_pLocalRegisteredUserDataBase->findUserByName(szNameOk); if(u) { @@ -607,7 +613,6 @@ void RegisteredUserEntryDialog::okClicked() } } while(u); - u = g_pLocalRegisteredUserDataBase->addUser(szNameOk); u->setGroup(szGroup); @@ -627,18 +632,18 @@ void RegisteredUserEntryDialog::okClicked() QString mask = m_pMaskListBox->item(idx)->text(); KviIrcMask * mk = new KviIrcMask(mask); g_pLocalRegisteredUserDataBase->removeMask(*mk); - g_pLocalRegisteredUserDataBase->addMask(u,mk); + g_pLocalRegisteredUserDataBase->addMask(u, mk); cnt--; idx++; } - u->setProperty("comment",m_pCommentEdit->text()); + u->setProperty("comment", m_pCommentEdit->text()); m_pAvatarSelector->commit(); if(!m_pAvatar->isNull()) { QString szPath = m_pAvatar->path(); - u->setProperty("avatar",szPath); + u->setProperty("avatar", szPath); } if(m_pNotifyCheck->isChecked()) @@ -647,33 +652,36 @@ void RegisteredUserEntryDialog::okClicked() if(szNicks.isEmpty()) { - u->setProperty("notify",QString("")); - } else { - u->setProperty("notify",szNicks); + u->setProperty("notify", QString("")); + } + else + { + u->setProperty("notify", szNicks); } - } else { - u->setProperty("notify",QString("")); + } + else + { + u->setProperty("notify", QString("")); } m_pPropertyDict->remove("comment"); m_pPropertyDict->remove("notify"); m_pPropertyDict->remove("avatar"); - KviPointerHashTableIterator it(*m_pPropertyDict); - while(QString *s = it.current()) + KviPointerHashTableIterator it(*m_pPropertyDict); + while(QString * s = it.current()) { - u->setProperty(it.currentKey(),*s); + u->setProperty(it.currentKey(), *s); ++it; } - u->setProperty("useCustomColor",m_pCustomColorCheck->isChecked()); + u->setProperty("useCustomColor", m_pCustomColorCheck->isChecked()); QString col; - KviStringConversion::toString(m_pCustomColorSelector->getColor(),col); - u->setProperty("customColor",col); + KviStringConversion::toString(m_pCustomColorSelector->getColor(), col); + u->setProperty("customColor", col); - - int iIgnoreFlags=0; + int iIgnoreFlags = 0; u->setIgnoreEnabled(m_pIgnoreEnabled->isChecked()); if(m_pIgnoreQuery->isChecked()) iIgnoreFlags |= KviRegisteredUser::Query; @@ -698,7 +706,7 @@ void RegisteredUserEntryDialog::okClicked() void RegisteredUserEntryDialog::addMaskClicked() { KviIrcMask mk; - RegisteredUserMaskDialog * dlg = new RegisteredUserMaskDialog(this,&mk); + RegisteredUserMaskDialog * dlg = new RegisteredUserMaskDialog(this, &mk); if(dlg->exec() == QDialog::Accepted) { QString m = mk.nick(); @@ -713,19 +721,22 @@ void RegisteredUserEntryDialog::addMaskClicked() void RegisteredUserEntryDialog::delMaskClicked() { - if(m_pMaskListBox->currentItem()) { + if(m_pMaskListBox->currentItem()) + { delete m_pMaskListBox->currentItem(); } } void RegisteredUserEntryDialog::editMaskClicked() { - if(!m_pMaskListBox->currentItem())return; + if(!m_pMaskListBox->currentItem()) + return; QString szM = m_pMaskListBox->currentItem()->text(); - if(szM.isEmpty())return; + if(szM.isEmpty()) + return; KviIrcMask mk(szM); - RegisteredUserMaskDialog * dlg = new RegisteredUserMaskDialog(this,&mk); + RegisteredUserMaskDialog * dlg = new RegisteredUserMaskDialog(this, &mk); if(dlg->exec() == QDialog::Accepted) { QString m = mk.nick(); @@ -745,10 +756,14 @@ void RegisteredUserEntryDialog::editAllPropertiesClicked() if(m_pAvatar->isNull()) { m_pPropertyDict->remove("avatar"); - } else { + } + else + { KviCString szPath = m_pAvatar->path(); - if(szPath.isEmpty())m_pPropertyDict->remove("avatar"); - else m_pPropertyDict->replace("avatar",new QString(szPath)); + if(szPath.isEmpty()) + m_pPropertyDict->remove("avatar"); + else + m_pPropertyDict->replace("avatar", new QString(szPath)); } if(m_pNotifyCheck->isChecked()) @@ -757,16 +772,19 @@ void RegisteredUserEntryDialog::editAllPropertiesClicked() if(!szNicks.isEmpty()) { - m_pPropertyDict->replace("notify",new QString(szNicks)); - } else { + m_pPropertyDict->replace("notify", new QString(szNicks)); + } + else + { m_pPropertyDict->remove("notify"); } - } else { + } + else + { m_pPropertyDict->remove("notify"); } - - RegisteredUserPropertiesDialog * dlg = new RegisteredUserPropertiesDialog(this,m_pPropertyDict); + RegisteredUserPropertiesDialog * dlg = new RegisteredUserPropertiesDialog(this, m_pPropertyDict); if(dlg->exec() != QDialog::Accepted) { delete dlg; @@ -786,7 +804,8 @@ void RegisteredUserEntryDialog::editAllPropertiesClicked() } m_pNotifyCheck->setChecked(bGotIt); m_pNotifyNick->setEnabled(bGotIt); - if(!bGotIt)m_pNotifyNick->setText(""); + if(!bGotIt) + m_pNotifyNick->setText(""); QString * avatar = m_pPropertyDict->find("avatar"); bGotIt = false; @@ -795,5 +814,4 @@ void RegisteredUserEntryDialog::editAllPropertiesClicked() if(!avatar->isEmpty()) m_pAvatarSelector->setImagePath(*avatar); } - } diff --git a/src/modules/reguser/RegisteredUserEntryDialog.h b/src/modules/reguser/RegisteredUserEntryDialog.h index 8d32f133b..36dd0d640 100644 --- a/src/modules/reguser/RegisteredUserEntryDialog.h +++ b/src/modules/reguser/RegisteredUserEntryDialog.h @@ -42,21 +42,23 @@ class KviRegisteredUser; #ifndef _EDITUSER_CPP_ - extern KviRegisteredUserDataBase * g_pLocalRegisteredUserDataBase; +extern KviRegisteredUserDataBase * g_pLocalRegisteredUserDataBase; #endif class RegisteredUserPropertiesDialog : public QDialog { Q_OBJECT public: - RegisteredUserPropertiesDialog(QWidget *p,KviPointerHashTable * dict); + RegisteredUserPropertiesDialog(QWidget * p, KviPointerHashTable * dict); ~RegisteredUserPropertiesDialog(); + protected: - QTableWidget *m_pTable; + QTableWidget * m_pTable; + + KviPointerHashTable * m_pPropertyDict; + QPushButton * m_pDelButton; + QPushButton * m_pAddButton; - KviPointerHashTable * m_pPropertyDict; - QPushButton * m_pDelButton; - QPushButton * m_pAddButton; protected: void fillData(); virtual void closeEvent(QCloseEvent *); @@ -66,13 +68,13 @@ protected slots: void delClicked(); }; - class RegisteredUserMaskDialog : public QDialog { Q_OBJECT public: - RegisteredUserMaskDialog(QWidget * p,KviIrcMask * m); + RegisteredUserMaskDialog(QWidget * p, KviIrcMask * m); ~RegisteredUserMaskDialog(); + protected: KviIrcMask * m_pMask; @@ -85,47 +87,47 @@ protected slots: void okClicked(); }; - class RegisteredUserEntryDialog : public KviTalTabDialog { Q_OBJECT public: - RegisteredUserEntryDialog(QWidget * p,KviRegisteredUser * r,bool bModal = true); + RegisteredUserEntryDialog(QWidget * p, KviRegisteredUser * r, bool bModal = true); virtual ~RegisteredUserEntryDialog(); + protected: - KviRegisteredUser * m_pUser; + KviRegisteredUser * m_pUser; - QLineEdit * m_pNameEdit; - QLineEdit * m_pCommentEdit; + QLineEdit * m_pNameEdit; + QLineEdit * m_pCommentEdit; - QListWidget * m_pMaskListBox; + QListWidget * m_pMaskListBox; - QPushButton * m_pDelMaskButton; - QPushButton * m_pEditMaskButton; - QPushButton * m_pAddMaskButton; + QPushButton * m_pDelMaskButton; + QPushButton * m_pEditMaskButton; + QPushButton * m_pAddMaskButton; - QCheckBox * m_pNotifyCheck; - QLineEdit * m_pNotifyNick; - QLabel * m_pNotifyLabel; + QCheckBox * m_pNotifyCheck; + QLineEdit * m_pNotifyNick; + QLabel * m_pNotifyLabel; - KviPixmap * m_pAvatar; - KviPixmapSelector * m_pAvatarSelector; + KviPixmap * m_pAvatar; + KviPixmapSelector * m_pAvatarSelector; - KviPointerHashTable * m_pPropertyDict; + KviPointerHashTable * m_pPropertyDict; - QCheckBox * m_pCustomColorCheck; - QColor * m_pCustomColor; - KviColorSelector * m_pCustomColorSelector; + QCheckBox * m_pCustomColorCheck; + QColor * m_pCustomColor; + KviColorSelector * m_pCustomColorSelector; //Ignore TAB - QCheckBox * m_pIgnoreEnabled; - QCheckBox * m_pIgnoreQuery; - QCheckBox * m_pIgnoreChannel; - QCheckBox * m_pIgnoreNotice; - QCheckBox * m_pIgnoreCtcp; - QCheckBox * m_pIgnoreInvite; - QCheckBox * m_pIgnoreDcc; - QCheckBox * m_pIgnoreHighlight; + QCheckBox * m_pIgnoreEnabled; + QCheckBox * m_pIgnoreQuery; + QCheckBox * m_pIgnoreChannel; + QCheckBox * m_pIgnoreNotice; + QCheckBox * m_pIgnoreCtcp; + QCheckBox * m_pIgnoreInvite; + QCheckBox * m_pIgnoreDcc; + QCheckBox * m_pIgnoreHighlight; virtual void closeEvent(QCloseEvent *); protected slots: diff --git a/src/modules/reguser/RegisteredUsersDialog.cpp b/src/modules/reguser/RegisteredUsersDialog.cpp index b3d29d679..30b5860b1 100644 --- a/src/modules/reguser/RegisteredUsersDialog.cpp +++ b/src/modules/reguser/RegisteredUsersDialog.cpp @@ -71,19 +71,18 @@ #define LVI_MINIMUM_TEXT_WIDTH 300 #define LVI_MINIMUM_CELL_WIDTH (LVI_MINIMUM_TEXT_WIDTH + LVI_BORDER + LVI_ICON_SIZE + LVI_SPACING + LVI_BORDER) - extern RegisteredUsersDialog * g_pRegisteredUsersDialog; KviRegisteredUsersListView::KviRegisteredUsersListView(QWidget * par) -: QTreeWidget(par) + : QTreeWidget(par) { setColumnCount(2); QStringList labels; - labels << __tr2qs_ctx("Name","register") << __tr2qs_ctx("Flags","register"); + labels << __tr2qs_ctx("Name", "register") << __tr2qs_ctx("Flags", "register"); setHeaderLabels(labels); - setColumnWidth(0,360); - setColumnWidth(1,20); + setColumnWidth(0, 360); + setColumnWidth(1, 20); setAllColumnsShowFocus(true); @@ -92,25 +91,27 @@ KviRegisteredUsersListView::KviRegisteredUsersListView(QWidget * par) setRootIsDecorated(true); setSortingEnabled(true); - setToolTip(__tr2qs_ctx("This is the list of registered users. " \ - "KVIrc can automatically recognize and associate properties to them.
" \ - "Use the buttons on the right to add, edit and remove entries. " \ - "The \"notify\" column allows you to quickly add users to the notify list. " \ - "Notify list fine-tuning can be performed by editing the entry properties.","register")); + setToolTip(__tr2qs_ctx("This is the list of registered users. " + "KVIrc can automatically recognize and associate properties to them.
" + "Use the buttons on the right to add, edit and remove entries. " + "The \"notify\" column allows you to quickly add users to the notify list. " + "Notify list fine-tuning can be performed by editing the entry properties.", + "register")); } -void KviRegisteredUsersListView::mousePressEvent (QMouseEvent *e) +void KviRegisteredUsersListView::mousePressEvent(QMouseEvent * e) { - if (e->button() == Qt::RightButton) + if(e->button() == Qt::RightButton) { - QTreeWidgetItem *i= itemAt(e->pos()); - if (i) emit rightButtonPressed(i,QCursor::pos()); + QTreeWidgetItem * i = itemAt(e->pos()); + if(i) + emit rightButtonPressed(i, QCursor::pos()); } QTreeWidget::mousePressEvent(e); } -RegisteredUsersDialogItem::RegisteredUsersDialogItem(QTreeWidgetItem * par,KviRegisteredUser * u) -: RegisteredUsersDialogItemBase(User,par), m_pUser(u) +RegisteredUsersDialogItem::RegisteredUsersDialogItem(QTreeWidgetItem * par, KviRegisteredUser * u) + : RegisteredUsersDialogItemBase(User, par), m_pUser(u) { QString szTmp; QString t = "
"; @@ -119,102 +120,111 @@ RegisteredUsersDialogItem::RegisteredUsersDialogItem(QTreeWidgetItem * par,KviRe szTmp = m_pUser->getProperty("notify"); if(szTmp.isEmpty()) { - t += __tr2qs_ctx("Notify disabled","register"); - } else { - t += __tr2qs_ctx("Notify as:","register"); + t += __tr2qs_ctx("Notify disabled", "register"); + } + else + { + t += __tr2qs_ctx("Notify as:", "register"); t += " "; t += szTmp; - } t += "]"; t += "
"; szTmp = m_pUser->getProperty("comment"); if(szTmp.isEmpty()) { - t += __tr2qs_ctx("No comment set","register"); - } else { - t += __tr2qs_ctx("Comment:","register"); + t += __tr2qs_ctx("No comment set", "register"); + } + else + { + t += __tr2qs_ctx("Comment:", "register"); t += " "; t += m_pUser->getProperty("comment"); } t += ""; m_pText.setHtml(t); m_pText.setTextWidth(-1); -// setText(0,t); + // setText(0,t); } RegisteredUsersDialogItem::~RegisteredUsersDialogItem() { } -QString RegisteredUsersDialogItem::key(int,bool) const +QString RegisteredUsersDialogItem::key(int, bool) const { return m_pUser->name(); } -void RegisteredUsersDialogItemDelegate::paint( QPainter * p, const QStyleOptionViewItem & option, const QModelIndex & index ) const +void RegisteredUsersDialogItemDelegate::paint(QPainter * p, const QStyleOptionViewItem & option, const QModelIndex & index) const { - RegisteredUsersDialogItemBase *item=static_cast(index.internalPointer()); + RegisteredUsersDialogItemBase * item = static_cast(index.internalPointer()); - if(item->type()==RegisteredUsersDialogItemBase::Group) + if(item->type() == RegisteredUsersDialogItemBase::Group) { //groups QStyledItemDelegate::paint(p, option, index); - } else { + } + else + { QStyleOptionViewItemV4 opt = option; initStyleOption(&opt, index); - if (opt.state & QStyle::State_Selected) - QApplication::style()->drawPrimitive(QStyle::PE_PanelItemViewItem,&opt, p); + if(opt.state & QStyle::State_Selected) + QApplication::style()->drawPrimitive(QStyle::PE_PanelItemViewItem, &opt, p); - RegisteredUsersDialogItem *it=(RegisteredUsersDialogItem*)item; + RegisteredUsersDialogItem * it = (RegisteredUsersDialogItem *)item; - if(index.column()==0) + if(index.column() == 0) { - QPoint pt=opt.rect.topLeft(); - pt.setX(pt.x()+LVI_BORDER); - pt.setY(pt.y()+LVI_BORDER); + QPoint pt = opt.rect.topLeft(); + pt.setX(pt.x() + LVI_BORDER); + pt.setY(pt.y() + LVI_BORDER); p->drawPixmap(pt, *(g_pIconManager->getBigIcon(KVI_BIGICON_REGUSERS))); - QRect cliprect=QRect(QPoint(0,0),QSize(opt.rect.width()-(LVI_ICON_SIZE+LVI_SPACING+LVI_BORDER),opt.rect.height())); + QRect cliprect = QRect(QPoint(0, 0), QSize(opt.rect.width() - (LVI_ICON_SIZE + LVI_SPACING + LVI_BORDER), opt.rect.height())); p->save(); - p->translate(opt.rect.x()+LVI_ICON_SIZE+LVI_SPACING, opt.rect.y()); + p->translate(opt.rect.x() + LVI_ICON_SIZE + LVI_SPACING, opt.rect.y()); it->m_pText.drawContents(p, cliprect); p->restore(); - } else { + } + else + { if(it->user()) { if(!it->user()->getProperty("notify").isEmpty()) - p->drawPixmap(opt.rect.topLeft().x()+LVI_BORDER,opt.rect.topLeft().y()+LVI_BORDER,*(g_pIconManager->getSmallIcon(KviIconManager::NotifyOnLine))); + p->drawPixmap(opt.rect.topLeft().x() + LVI_BORDER, opt.rect.topLeft().y() + LVI_BORDER, *(g_pIconManager->getSmallIcon(KviIconManager::NotifyOnLine))); else - p->drawPixmap(opt.rect.topLeft().x()+LVI_BORDER,opt.rect.topLeft().y()+LVI_BORDER,*(g_pIconManager->getSmallIcon(KviIconManager::NotifyOffLine))); + p->drawPixmap(opt.rect.topLeft().x() + LVI_BORDER, opt.rect.topLeft().y() + LVI_BORDER, *(g_pIconManager->getSmallIcon(KviIconManager::NotifyOffLine))); if(it->user()->ignoreEnabled()) - p->drawPixmap(opt.rect.topLeft().x()+LVI_BORDER,opt.rect.topLeft().y()+2*LVI_BORDER+16,*(g_pIconManager->getSmallIcon(KviIconManager::Ignore))); + p->drawPixmap(opt.rect.topLeft().x() + LVI_BORDER, opt.rect.topLeft().y() + 2 * LVI_BORDER + 16, *(g_pIconManager->getSmallIcon(KviIconManager::Ignore))); } } } } -QSize RegisteredUsersDialogItemDelegate::sizeHint( const QStyleOptionViewItem & option, const QModelIndex & index ) const +QSize RegisteredUsersDialogItemDelegate::sizeHint(const QStyleOptionViewItem & option, const QModelIndex & index) const { - RegisteredUsersDialogItemBase *item=static_cast(index.internalPointer()); + RegisteredUsersDialogItemBase * item = static_cast(index.internalPointer()); - if(item->type()==RegisteredUsersDialogItemBase::Group) + if(item->type() == RegisteredUsersDialogItemBase::Group) { //groups return QStyledItemDelegate::sizeHint(option, index); - } else { + } + else + { //users -// RegisteredUsersDialogItem *it=(RegisteredUsersDialogItem*)item; + // RegisteredUsersDialogItem *it=(RegisteredUsersDialogItem*)item; - return QSize(300, LVI_ICON_SIZE+2*LVI_BORDER); + return QSize(300, LVI_ICON_SIZE + 2 * LVI_BORDER); } } RegisteredUsersDialog::RegisteredUsersDialog(QWidget * par) -: QWidget(par) + : QWidget(par) { g_pRegisteredUsersDialog = this; @@ -222,96 +232,90 @@ RegisteredUsersDialog::RegisteredUsersDialog(QWidget * par) g_pLocalRegisteredUserDataBase->copyFrom(g_pRegisteredUserDataBase); setWindowIcon(*(g_pIconManager->getSmallIcon(KviIconManager::RegUsers))); - setWindowTitle(__tr2qs_ctx("Registered Users and Configuration - KVIrc","register")); + setWindowTitle(__tr2qs_ctx("Registered Users and Configuration - KVIrc", "register")); QGridLayout * g = new QGridLayout(this); - m_pListView = new KviRegisteredUsersListView(this); m_pListView->setItemDelegate(new RegisteredUsersDialogItemDelegate()); - connect(m_pListView,SIGNAL(itemPressed(QTreeWidgetItem *,int)),this,SLOT(itemPressed(QTreeWidgetItem *,int))); - connect(m_pListView,SIGNAL(itemDoubleClicked(QTreeWidgetItem *, int)),this,SLOT(itemDoubleClicked(QTreeWidgetItem *, int))); + connect(m_pListView, SIGNAL(itemPressed(QTreeWidgetItem *, int)), this, SLOT(itemPressed(QTreeWidgetItem *, int))); + connect(m_pListView, SIGNAL(itemDoubleClicked(QTreeWidgetItem *, int)), this, SLOT(itemDoubleClicked(QTreeWidgetItem *, int))); - g->addWidget(m_pListView,0,0,2,2); + g->addWidget(m_pListView, 0, 0, 2, 2); KviTalVBox * vbox = new KviTalVBox(this); vbox->setSpacing(4); - g->addWidget(vbox,0,2); + g->addWidget(vbox, 0, 2); - m_pWizardAddButton = new QPushButton(__tr2qs_ctx("Add Wizard...","register"),vbox); - connect(m_pWizardAddButton,SIGNAL(clicked()),this,SLOT(addWizardClicked())); - m_pWizardAddButton->setToolTip(__tr2qs_ctx("Add a registered user by means of a user-friendly wizard.","register")); + m_pWizardAddButton = new QPushButton(__tr2qs_ctx("Add Wizard...", "register"), vbox); + connect(m_pWizardAddButton, SIGNAL(clicked()), this, SLOT(addWizardClicked())); + m_pWizardAddButton->setToolTip(__tr2qs_ctx("Add a registered user by means of a user-friendly wizard.", "register")); //m_pWizardAddButton->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::NewItemByWizard))); - - m_pAddButton = new QPushButton(__tr2qs_ctx("&Add...","register"),vbox); - connect(m_pAddButton,SIGNAL(clicked()),this,SLOT(addClicked())); - m_pAddButton->setToolTip(__tr2qs_ctx("Open the edit dialog to create a new user entry.","register")); + m_pAddButton = new QPushButton(__tr2qs_ctx("&Add...", "register"), vbox); + connect(m_pAddButton, SIGNAL(clicked()), this, SLOT(addClicked())); + m_pAddButton->setToolTip(__tr2qs_ctx("Open the edit dialog to create a new user entry.", "register")); //m_pAddButton->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::NewItem))); - m_pAddGroupButton = new QPushButton(__tr2qs_ctx("&Add Group...","register"),vbox); - connect(m_pAddGroupButton,SIGNAL(clicked()),this,SLOT(addGroupClicked())); - m_pAddGroupButton->setToolTip(__tr2qs_ctx("Adds a new group","register")); + m_pAddGroupButton = new QPushButton(__tr2qs_ctx("&Add Group...", "register"), vbox); + connect(m_pAddGroupButton, SIGNAL(clicked()), this, SLOT(addGroupClicked())); + m_pAddGroupButton->setToolTip(__tr2qs_ctx("Adds a new group", "register")); //m_pAddGroupButton->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::NewItem))); - m_pRemoveButton = new QPushButton(__tr2qs_ctx("Re&move","register"),vbox); - connect(m_pRemoveButton,SIGNAL(clicked()),this,SLOT(removeClicked())); + m_pRemoveButton = new QPushButton(__tr2qs_ctx("Re&move", "register"), vbox); + connect(m_pRemoveButton, SIGNAL(clicked()), this, SLOT(removeClicked())); m_pRemoveButton->setEnabled(false); - m_pRemoveButton->setToolTip(__tr2qs_ctx("Remove the currently selected entries.","register")); + m_pRemoveButton->setToolTip(__tr2qs_ctx("Remove the currently selected entries.", "register")); //m_pRemoveButton->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::DeleteItem))); - - m_pEditButton = new QPushButton(__tr2qs_ctx("&Edit...","register"),vbox); - connect(m_pEditButton,SIGNAL(clicked()),this,SLOT(editClicked())); + m_pEditButton = new QPushButton(__tr2qs_ctx("&Edit...", "register"), vbox); + connect(m_pEditButton, SIGNAL(clicked()), this, SLOT(editClicked())); m_pEditButton->setEnabled(false); - m_pEditButton->setToolTip(__tr2qs_ctx("Edit the first selected entry.","register")); + m_pEditButton->setToolTip(__tr2qs_ctx("Edit the first selected entry.", "register")); //m_pEditButton->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::EditItem))); QFrame * f = new QFrame(vbox); f->setFrameStyle(QFrame::HLine | QFrame::Sunken); - m_pSelectAllButton = new QPushButton(__tr2qs_ctx("Select All","register"),vbox); - connect(m_pSelectAllButton,SIGNAL(clicked()),this,SLOT(selectAllClicked())); - m_pSelectAllButton->setToolTip(__tr2qs_ctx("Select all the entries","register")); + m_pSelectAllButton = new QPushButton(__tr2qs_ctx("Select All", "register"), vbox); + connect(m_pSelectAllButton, SIGNAL(clicked()), this, SLOT(selectAllClicked())); + m_pSelectAllButton->setToolTip(__tr2qs_ctx("Select all the entries", "register")); //m_pSelectAllButton->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Plus))); - m_pExportButton = new QPushButton(__tr2qs_ctx("Export to...","register"),vbox); + m_pExportButton = new QPushButton(__tr2qs_ctx("Export to...", "register"), vbox); m_pExportButton->setEnabled(false); - connect(m_pExportButton,SIGNAL(clicked()),this,SLOT(exportClicked())); - m_pExportButton->setToolTip(__tr2qs_ctx("Export the selected entries to a file.
All the data associated with the selected registered users will be exported.
You (or anyone else) can later import the entries by using the \"Import\" button.","register")); + connect(m_pExportButton, SIGNAL(clicked()), this, SLOT(exportClicked())); + m_pExportButton->setToolTip(__tr2qs_ctx("Export the selected entries to a file.
All the data associated with the selected registered users will be exported.
You (or anyone else) can later import the entries by using the \"Import\" button.", "register")); //m_pExportButton->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Save))); - - m_pImportButton = new QPushButton(__tr2qs_ctx("Import from...","register"),vbox); - connect(m_pImportButton,SIGNAL(clicked()),this,SLOT(importClicked())); - m_pImportButton->setToolTip(__tr2qs_ctx("Import entries from a file exported earlier by the \"export\" function of this dialog.","register")); + m_pImportButton = new QPushButton(__tr2qs_ctx("Import from...", "register"), vbox); + connect(m_pImportButton, SIGNAL(clicked()), this, SLOT(importClicked())); + m_pImportButton->setToolTip(__tr2qs_ctx("Import entries from a file exported earlier by the \"export\" function of this dialog.", "register")); //m_pImportButton->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Folder))); - KviTalHBox * hbox = new KviTalHBox(this); hbox->setSpacing(4); - g->addWidget(hbox,3,1,1,2); + g->addWidget(hbox, 3, 1, 1, 2); QPushButton * b; - - b = new QPushButton(__tr2qs_ctx("&OK","register"),hbox); - connect(b,SIGNAL(clicked()),this,SLOT(okClicked())); + b = new QPushButton(__tr2qs_ctx("&OK", "register"), hbox); + connect(b, SIGNAL(clicked()), this, SLOT(okClicked())); b->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Accept))); //b->setMinimumWidth(120); - b = new QPushButton(__tr2qs_ctx("Cancel","register"),hbox); - connect(b,SIGNAL(clicked()),this,SLOT(cancelClicked())); + b = new QPushButton(__tr2qs_ctx("Cancel", "register"), hbox); + connect(b, SIGNAL(clicked()), this, SLOT(cancelClicked())); b->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Discard))); //b->setMinimumWidth(120); g->addItem(new QSpacerItem(0, 15), 2, 0); - g->setColumnStretch(0,1); - g->setRowStretch(1,1); + g->setColumnStretch(0, 1); + g->setRowStretch(1, 1); - connect(m_pListView,SIGNAL(itemSelectionChanged()),this,SLOT(selectionChanged())); - connect(m_pListView,SIGNAL(rightButtonPressed(QTreeWidgetItem *, QPoint)),this,SLOT(rightButtonPressed(QTreeWidgetItem *, QPoint))); + connect(m_pListView, SIGNAL(itemSelectionChanged()), this, SLOT(selectionChanged())); + connect(m_pListView, SIGNAL(rightButtonPressed(QTreeWidgetItem *, QPoint)), this, SLOT(rightButtonPressed(QTreeWidgetItem *, QPoint))); new QShortcut(Qt::Key_Escape, this, SLOT(cancelClicked())); @@ -320,24 +324,26 @@ RegisteredUsersDialog::RegisteredUsersDialog(QWidget * par) if(!parent()) { if(KVI_OPTION_RECT(KviOption_rectRegisteredUsersDialogGeometry).y() < 5) - KVI_OPTION_RECT(KviOption_rectRegisteredUsersDialogGeometry).setY(5); + KVI_OPTION_RECT(KviOption_rectRegisteredUsersDialogGeometry) + .setY(5); //setGeometry(KVI_OPTION_RECT(KviOption_rectRegisteredUsersDialogGeometry)); resize(KVI_OPTION_RECT(KviOption_rectRegisteredUsersDialogGeometry).width(), - KVI_OPTION_RECT(KviOption_rectRegisteredUsersDialogGeometry).height()); + KVI_OPTION_RECT(KviOption_rectRegisteredUsersDialogGeometry).height()); QRect rect = g_pApp->desktop()->screenGeometry(g_pMainWindow); - move(rect.x() + ((rect.width() - KVI_OPTION_RECT(KviOption_rectRegisteredUsersDialogGeometry).width())/2),rect.y() + ((rect.height() - KVI_OPTION_RECT(KviOption_rectRegisteredUsersDialogGeometry).height())/2)); - + move(rect.x() + ((rect.width() - KVI_OPTION_RECT(KviOption_rectRegisteredUsersDialogGeometry).width()) / 2), rect.y() + ((rect.height() - KVI_OPTION_RECT(KviOption_rectRegisteredUsersDialogGeometry).height()) / 2)); } } RegisteredUsersDialog::~RegisteredUsersDialog() { #ifndef COMPILE_ON_MAC - if(!parent())KVI_OPTION_RECT(KviOption_rectRegisteredUsersDialogGeometry) = QRect(pos().x(),pos().y(),size().width(),size().height()); + if(!parent()) + KVI_OPTION_RECT(KviOption_rectRegisteredUsersDialogGeometry) = QRect(pos().x(), pos().y(), size().width(), size().height()); #else - if(!parent())KVI_OPTION_RECT(KviOption_rectRegisteredUsersDialogGeometry) = geometry(); + if(!parent()) + KVI_OPTION_RECT(KviOption_rectRegisteredUsersDialogGeometry) = geometry(); #endif g_pRegisteredUsersDialog = 0; @@ -346,13 +352,14 @@ RegisteredUsersDialog::~RegisteredUsersDialog() g_pLocalRegisteredUserDataBase = 0; } -void RegisteredUsersDialog::itemPressed(QTreeWidgetItem *it,int c) +void RegisteredUsersDialog::itemPressed(QTreeWidgetItem * it, int c) { - if(!it)return; - RegisteredUsersDialogItemBase* b=(RegisteredUsersDialogItemBase*)it; - if(b->type()==RegisteredUsersDialogItemBase::User) + if(!it) + return; + RegisteredUsersDialogItemBase * b = (RegisteredUsersDialogItemBase *)it; + if(b->type() == RegisteredUsersDialogItemBase::User) { - RegisteredUsersDialogItem *i = (RegisteredUsersDialogItem *)it; + RegisteredUsersDialogItem * i = (RegisteredUsersDialogItem *)it; QRect r = m_pListView->visualItemRect(i); int daw = m_pListView->columnWidth(0); @@ -367,12 +374,13 @@ void RegisteredUsersDialog::itemPressed(QTreeWidgetItem *it,int c) // try to find the nicknames to be notified QString szMask; - for(KviIrcMask * m = i->user()->maskList()->first();m;m = i->user()->maskList()->next()) + for(KviIrcMask * m = i->user()->maskList()->first(); m; m = i->user()->maskList()->next()) { QString tmp = m->nick(); if((tmp.indexOf('*') == -1) && (tmp.indexOf('?') == -1) && (!tmp.isEmpty())) { - if(!szMask.isEmpty())szMask.append(' '); + if(!szMask.isEmpty()) + szMask.append(' '); szMask.append(tmp); } } @@ -380,15 +388,17 @@ void RegisteredUsersDialog::itemPressed(QTreeWidgetItem *it,int c) if(szMask.isEmpty()) { szMask = i->user()->name(); - szMask.replace(" ",""); - szMask.replace("'",""); - szMask.replace("&",""); - szMask.replace(",",""); + szMask.replace(" ", ""); + szMask.replace("'", ""); + szMask.replace("&", ""); + szMask.replace(",", ""); } - i->user()->setProperty("notify",szMask); - } else { - i->user()->setProperty("notify",QString("")); // kill that + i->user()->setProperty("notify", szMask); + } + else + { + i->user()->setProperty("notify", QString("")); // kill that } m_pListView->repaint(r); @@ -396,15 +406,18 @@ void RegisteredUsersDialog::itemPressed(QTreeWidgetItem *it,int c) } } -void RegisteredUsersDialog::itemDoubleClicked(QTreeWidgetItem *it, int) +void RegisteredUsersDialog::itemDoubleClicked(QTreeWidgetItem * it, int) { - if(!it)return; - RegisteredUsersDialogItemBase* b=(RegisteredUsersDialogItemBase*)it; - if(b->type()==RegisteredUsersDialogItemBase::User) + if(!it) + return; + RegisteredUsersDialogItemBase * b = (RegisteredUsersDialogItemBase *)it; + if(b->type() == RegisteredUsersDialogItemBase::User) { editItem((RegisteredUsersDialogItem *)it); - } else { - RegisteredUsersGroupItem *i = (RegisteredUsersGroupItem *)b; + } + else + { + RegisteredUsersGroupItem * i = (RegisteredUsersGroupItem *)b; editGroup(i->group()); } } @@ -412,45 +425,47 @@ void RegisteredUsersDialog::itemDoubleClicked(QTreeWidgetItem *it, int) void RegisteredUsersDialog::addGroupClicked() { bool ok; - QString text = QInputDialog::getText( this, - "KVIrc", __tr2qs_ctx("Group name:","register"), QLineEdit::Normal, - QString(), &ok ); - if ( ok && !text.isEmpty() ) { + QString text = QInputDialog::getText(this, + "KVIrc", __tr2qs_ctx("Group name:", "register"), QLineEdit::Normal, + QString(), &ok); + if(ok && !text.isEmpty()) + { g_pLocalRegisteredUserDataBase->addGroup(text); fillList(); } } -void RegisteredUsersDialog::editGroup(KviRegisteredUserGroup* group) +void RegisteredUsersDialog::editGroup(KviRegisteredUserGroup * group) { bool ok; - QString text = QInputDialog::getText( this, - "KVIrc", __tr2qs_ctx("Group name:","register"), QLineEdit::Normal, - group->name(), &ok ); - if ( ok && !text.isEmpty() ) { - QString szOldGroup=group->name(); + QString text = QInputDialog::getText(this, + "KVIrc", __tr2qs_ctx("Group name:", "register"), QLineEdit::Normal, + group->name(), &ok); + if(ok && !text.isEmpty()) + { + QString szOldGroup = group->name(); g_pLocalRegisteredUserDataBase->groupDict()->setAutoDelete(0); g_pLocalRegisteredUserDataBase->groupDict()->remove(szOldGroup); g_pLocalRegisteredUserDataBase->groupDict()->setAutoDelete(1); group->setName(text); - g_pLocalRegisteredUserDataBase->groupDict()->insert(text,group); + g_pLocalRegisteredUserDataBase->groupDict()->insert(text, group); - KviPointerHashTable * d = g_pLocalRegisteredUserDataBase->userDict(); + KviPointerHashTable * d = g_pLocalRegisteredUserDataBase->userDict(); - for(KviRegisteredUser * u = d->first();u;u = d->next()) + for(KviRegisteredUser * u = d->first(); u; u = d->next()) { - if(u->group()==szOldGroup) + if(u->group() == szOldGroup) u->setGroup(text); } fillList(); // select the last edited item - for(int c=0;ctopLevelItemCount();c++) + for(int c = 0; c < m_pListView->topLevelItemCount(); c++) { QTreeWidgetItem * pGroup = m_pListView->topLevelItem(c); - if(KviQString::equalCI(pGroup->text(0),text)) + if(KviQString::equalCI(pGroup->text(0), text)) { pGroup->setSelected(true); m_pListView->setCurrentItem(pGroup); @@ -460,41 +475,40 @@ void RegisteredUsersDialog::editGroup(KviRegisteredUserGroup* group) } } - -void RegisteredUsersDialog::rightButtonPressed ( QTreeWidgetItem * pItem, QPoint pnt) +void RegisteredUsersDialog::rightButtonPressed(QTreeWidgetItem * pItem, QPoint pnt) { if(pItem) { - RegisteredUsersDialogItemBase* b=(RegisteredUsersDialogItemBase*)pItem; - if(b->type()==RegisteredUsersDialogItemBase::User) + RegisteredUsersDialogItemBase * b = (RegisteredUsersDialogItemBase *)pItem; + if(b->type() == RegisteredUsersDialogItemBase::User) { - QMenu *groups = new QMenu; + QMenu * groups = new QMenu; - KviPointerHashTable * pGroups = g_pLocalRegisteredUserDataBase->groupDict(); - for(KviPointerHashTableEntry * g = pGroups->firstEntry();g;g = pGroups->nextEntry()) + KviPointerHashTable * pGroups = g_pLocalRegisteredUserDataBase->groupDict(); + for(KviPointerHashTableEntry * g = pGroups->firstEntry(); g; g = pGroups->nextEntry()) { - groups->addAction(g->key()) - ->setData(g->data()->name()); + groups->addAction(g->key()) + ->setData(g->data()->name()); } - connect(groups,SIGNAL(triggered(QAction *)),this,SLOT(moveToGroupMenuClicked(QAction *))); + connect(groups, SIGNAL(triggered(QAction *)), this, SLOT(moveToGroupMenuClicked(QAction *))); - QMenu *mainPopup = new QMenu; - mainPopup->addAction(__tr2qs_ctx("Move to Group","register"))->setMenu(groups); + QMenu * mainPopup = new QMenu; + mainPopup->addAction(__tr2qs_ctx("Move to Group", "register"))->setMenu(groups); mainPopup->exec(pnt); } } } -void RegisteredUsersDialog::moveToGroupMenuClicked(QAction *pAction) +void RegisteredUsersDialog::moveToGroupMenuClicked(QAction * pAction) { - QString szGroup=pAction->data().toString(); + QString szGroup = pAction->data().toString(); - QList list = m_pListView->selectedItems(); - for(int i=0; i list = m_pListView->selectedItems(); + for(int i = 0; i < list.count(); i++) { - RegisteredUsersDialogItemBase* b=(RegisteredUsersDialogItemBase*)(list.at(i)); - if(b->type()==RegisteredUsersDialogItemBase::User) + RegisteredUsersDialogItemBase * b = (RegisteredUsersDialogItemBase *)(list.at(i)); + if(b->type() == RegisteredUsersDialogItemBase::User) { ((RegisteredUsersDialogItem *)list.at(i))->user()->setGroup(szGroup); } @@ -505,34 +519,38 @@ void RegisteredUsersDialog::moveToGroupMenuClicked(QAction *pAction) void RegisteredUsersDialog::fillList() { m_pListView->clear(); - KviPointerHashTable groupItems(5,false); + KviPointerHashTable groupItems(5, false); groupItems.setAutoDelete(false); - KviPointerHashTable * pGroups = g_pLocalRegisteredUserDataBase->groupDict(); - for(KviRegisteredUserGroup * g = pGroups->first();g;g = pGroups->next()) + KviPointerHashTable * pGroups = g_pLocalRegisteredUserDataBase->groupDict(); + for(KviRegisteredUserGroup * g = pGroups->first(); g; g = pGroups->next()) { - RegisteredUsersGroupItem* pCur = new RegisteredUsersGroupItem(m_pListView,g); - groupItems.insert(g->name(),pCur); + RegisteredUsersGroupItem * pCur = new RegisteredUsersGroupItem(m_pListView, g); + groupItems.insert(g->name(), pCur); pCur->setExpanded(true); } - KviPointerHashTable * d = g_pLocalRegisteredUserDataBase->userDict(); + KviPointerHashTable * d = g_pLocalRegisteredUserDataBase->userDict(); RegisteredUsersDialogItem * item; Q_UNUSED(item); - for(KviRegisteredUser * u = d->first();u;u = d->next()) + for(KviRegisteredUser * u = d->first(); u; u = d->next()) { if(u->group().isEmpty()) - u->setGroup(__tr2qs_ctx("Default","register")); + u->setGroup(__tr2qs_ctx("Default", "register")); if(groupItems.find(u->group())) { - item = new RegisteredUsersDialogItem(groupItems.find(u->group()),u); - } else if(groupItems.find(__tr2qs_ctx("Default","register"))) { - item = new RegisteredUsersDialogItem(groupItems.find(__tr2qs_ctx("Default","register")),u); - } else { //should never be called - KviRegisteredUserGroup* pGroup = g_pLocalRegisteredUserDataBase->addGroup(__tr2qs_ctx("Default","register")); - RegisteredUsersGroupItem* pCur = new RegisteredUsersGroupItem(m_pListView,pGroup); - groupItems.insert(__tr2qs_ctx("Default","register"),pCur); - item = new RegisteredUsersDialogItem(pCur,u); + item = new RegisteredUsersDialogItem(groupItems.find(u->group()), u); + } + else if(groupItems.find(__tr2qs_ctx("Default", "register"))) + { + item = new RegisteredUsersDialogItem(groupItems.find(__tr2qs_ctx("Default", "register")), u); + } + else + { //should never be called + KviRegisteredUserGroup * pGroup = g_pLocalRegisteredUserDataBase->addGroup(__tr2qs_ctx("Default", "register")); + RegisteredUsersGroupItem * pCur = new RegisteredUsersGroupItem(m_pListView, pGroup); + groupItems.insert(__tr2qs_ctx("Default", "register"), pCur); + item = new RegisteredUsersDialogItem(pCur, u); } } if(m_pListView->topLevelItem(0)) @@ -542,7 +560,7 @@ void RegisteredUsersDialog::fillList() } } -void RegisteredUsersDialog::closeEvent(QCloseEvent *e) +void RegisteredUsersDialog::closeEvent(QCloseEvent * e) { m_pListView->clear(); e->accept(); @@ -566,11 +584,12 @@ void RegisteredUsersDialog::cancelClicked() void RegisteredUsersDialog::addClicked() { - RegisteredUserEntryDialog * dlg = new RegisteredUserEntryDialog(this,0); + RegisteredUserEntryDialog * dlg = new RegisteredUserEntryDialog(this, 0); int ret = dlg->exec(); delete dlg; - if(!g_pRegisteredUsersDialog)return; // we have been deleted! + if(!g_pRegisteredUsersDialog) + return; // we have been deleted! if(ret == QDialog::Accepted) { @@ -580,10 +599,11 @@ void RegisteredUsersDialog::addClicked() void RegisteredUsersDialog::addWizardClicked() { - RegistrationWizard * w = new RegistrationWizard("",g_pLocalRegisteredUserDataBase,this,true); + RegistrationWizard * w = new RegistrationWizard("", g_pLocalRegisteredUserDataBase, this, true); int ret = w->exec(); delete w; - if(!g_pRegisteredUsersDialog)return; // we have been deleted! + if(!g_pRegisteredUsersDialog) + return; // we have been deleted! if(ret == QDialog::Accepted) { fillList(); @@ -593,49 +613,54 @@ void RegisteredUsersDialog::addWizardClicked() void RegisteredUsersDialog::removeClicked() { QList list = m_pListView->selectedItems(); - for(int i=0; itype()==RegisteredUsersDialogItemBase::User) + RegisteredUsersDialogItemBase * b = (RegisteredUsersDialogItemBase *)(list.at(i)); + if(b->type() == RegisteredUsersDialogItemBase::User) { g_pLocalRegisteredUserDataBase->removeUser(((RegisteredUsersDialogItem *)list.at(i))->user()->name()); - } else { + } + else + { g_pLocalRegisteredUserDataBase->removeGroup(((RegisteredUsersGroupItem *)list.at(i))->group()->name()); } } fillList(); -// RegisteredUsersDialogItem *it = (RegisteredUsersDialogItem *)m_pListView->firstChild(); -// RegisteredUsersDialogItemBase* b=(RegisteredUsersDialogItemBase*)it; -// if(b->type()==RegisteredUsersDialogItemBase::User) -// { -// KviPointerList l; -// l.setAutoDelete(false); -// while(it) -// { -// if(it->isSelected())l.append(it); -// it = (RegisteredUsersDialogItem *)it->nextSibling(); -// } -// -// for(RegisteredUsersDialogItem * i = l.first();i;i = l.next()) -// { -// //g_pLocalRegisteredUserDataBase->removeUser(i->user()->name()); -// delete i; -// } -// } else { -// -// } + // RegisteredUsersDialogItem *it = (RegisteredUsersDialogItem *)m_pListView->firstChild(); + // RegisteredUsersDialogItemBase* b=(RegisteredUsersDialogItemBase*)it; + // if(b->type()==RegisteredUsersDialogItemBase::User) + // { + // KviPointerList l; + // l.setAutoDelete(false); + // while(it) + // { + // if(it->isSelected())l.append(it); + // it = (RegisteredUsersDialogItem *)it->nextSibling(); + // } + // + // for(RegisteredUsersDialogItem * i = l.first();i;i = l.next()) + // { + // //g_pLocalRegisteredUserDataBase->removeUser(i->user()->name()); + // delete i; + // } + // } else { + // + // } } void RegisteredUsersDialog::editClicked() { - RegisteredUsersDialogItemBase* b=(RegisteredUsersDialogItemBase*)(m_pListView->currentItem()); - if(!b)return; - if(b->type()==RegisteredUsersDialogItemBase::User) + RegisteredUsersDialogItemBase * b = (RegisteredUsersDialogItemBase *)(m_pListView->currentItem()); + if(!b) + return; + if(b->type() == RegisteredUsersDialogItemBase::User) { - RegisteredUsersDialogItem *i = (RegisteredUsersDialogItem *)b; + RegisteredUsersDialogItem * i = (RegisteredUsersDialogItem *)b; editItem(i); - } else { - RegisteredUsersGroupItem *i = (RegisteredUsersGroupItem *)b; + } + else + { + RegisteredUsersGroupItem * i = (RegisteredUsersGroupItem *)b; editGroup(i->group()); } } @@ -648,24 +673,25 @@ void RegisteredUsersDialog::editItem(RegisteredUsersDialogItem * i) QString szName = u->name(); - RegisteredUserEntryDialog * dlg = new RegisteredUserEntryDialog(this,u); + RegisteredUserEntryDialog * dlg = new RegisteredUserEntryDialog(this, u); int res = dlg->exec(); delete dlg; - if(!g_pRegisteredUsersDialog)return; // we have been deleted! + if(!g_pRegisteredUsersDialog) + return; // we have been deleted! if(res == QDialog::Accepted) { fillList(); // select the last edited item - for(int c=0;ctopLevelItemCount();c++) + for(int c = 0; c < m_pListView->topLevelItemCount(); c++) { QTreeWidgetItem * pGroup = m_pListView->topLevelItem(c); - for(int d=0;dchildCount();d++) + for(int d = 0; d < pGroup->childCount(); d++) { - RegisteredUsersDialogItem * pUser = (RegisteredUsersDialogItem*) pGroup->child(d); - if(KviQString::equalCI(pUser->user()->name(),szName)) + RegisteredUsersDialogItem * pUser = (RegisteredUsersDialogItem *)pGroup->child(d); + if(KviQString::equalCI(pUser->user()->name(), szName)) { pUser->setSelected(true); m_pListView->setCurrentItem(pUser); @@ -690,7 +716,6 @@ void RegisteredUsersDialog::selectionChanged() m_pExportButton->setEnabled(bHaveSelected); } - #define KVI_REGUSER_DB_FILE_MAGIC 0x5334DBDB #define KVI_REGUSER_DB_FILE_VERSION 1 @@ -708,7 +733,7 @@ void RegisteredUsersDialog::exportClicked() QList list = m_pListView->selectedItems(); //only "user" entries matters, discard groups from count - for(int i=0; itype() == RegisteredUsersDialogItemBase::User) nEntries++; @@ -716,20 +741,22 @@ void RegisteredUsersDialog::exportClicked() if(nEntries < 1) { - KviMessageBox::warning(__tr2qs_ctx("No entries selected.","register")); + KviMessageBox::warning(__tr2qs_ctx("No entries selected.", "register")); return; } QString buffer; - if(!KviFileDialog::askForSaveFileName(buffer,__tr2qs_ctx("Enter a Filename - KVIrc","register"),0,0,true,true,true,this))return; + if(!KviFileDialog::askForSaveFileName(buffer, __tr2qs_ctx("Enter a Filename - KVIrc", "register"), 0, 0, true, true, true, this)) + return; - if(!g_pRegisteredUsersDialog)return; // we have been deleted! + if(!g_pRegisteredUsersDialog) + return; // we have been deleted! KviFile f(buffer); if(!f.open(QIODevice::WriteOnly | QIODevice::Truncate)) { - KviMessageBox::warning(__tr2qs_ctx("Can't open file %Q for writing.","register"),&buffer); + KviMessageBox::warning(__tr2qs_ctx("Can't open file %Q for writing.", "register"), &buffer); return; } @@ -738,76 +765,99 @@ void RegisteredUsersDialog::exportClicked() hf.version = KVI_REGUSER_DB_FILE_VERSION; hf.nentries = nEntries; - if(f.write((const char *)&hf,sizeof(KviReguserDbFileHeader)) != sizeof(KviReguserDbFileHeader))goto write_error; + if(f.write((const char *)&hf, sizeof(KviReguserDbFileHeader)) != sizeof(KviReguserDbFileHeader)) + goto write_error; - for(int i=0; itype()!=RegisteredUsersDialogItemBase::User) + RegisteredUsersDialogItemBase * pBase = (RegisteredUsersDialogItemBase *)list.at(i); + if(pBase->type() != RegisteredUsersDialogItemBase::User) continue; KviRegisteredUser * u = ((RegisteredUsersDialogItem *)list.at(i))->user(); if(u) { - if(!f.save(u->name()))goto write_error; - KviPointerHashTable * pd = u->propertyDict(); + if(!f.save(u->name())) + goto write_error; + KviPointerHashTable * pd = u->propertyDict(); if(pd) { - if(!f.save(pd->count()))goto write_error; - for(KviPointerHashTableEntry * pCur = pd->firstEntry();pCur;pCur = pd->nextEntry()) + if(!f.save(pd->count())) + goto write_error; + for(KviPointerHashTableEntry * pCur = pd->firstEntry(); pCur; pCur = pd->nextEntry()) { QString key = pCur->key(); - if(!f.save(key))goto write_error; - if(!f.save(*(pCur->data())))goto write_error; + if(!f.save(key)) + goto write_error; + if(!f.save(*(pCur->data()))) + goto write_error; } - } else { - if(!f.save(0))goto write_error; + } + else + { + if(!f.save(0)) + goto write_error; } KviPointerList * ml = u->maskList(); if(ml) { - if(!f.save(ml->count()))goto write_error; - for(KviIrcMask * m = ml->first();m;m = ml->next()) + if(!f.save(ml->count())) + goto write_error; + for(KviIrcMask * m = ml->first(); m; m = ml->next()) { QString fullMask; - m->mask(fullMask,KviIrcMask::NickUserHost); - if(!f.save(fullMask))goto write_error; + m->mask(fullMask, KviIrcMask::NickUserHost); + if(!f.save(fullMask)) + goto write_error; } - } else { - if(!f.save(0))goto write_error; + } + else + { + if(!f.save(0)) + goto write_error; } QString avatar; - if(u->getProperty("avatar",avatar)) + if(u->getProperty("avatar", avatar)) { - KviAvatar * av = g_pIconManager->getAvatar(QString(),avatar); + KviAvatar * av = g_pIconManager->getAvatar(QString(), avatar); if(av) { if(!av->pixmap()->isNull()) { - if(!f.save(1))goto write_error; + if(!f.save(1)) + goto write_error; QImageWriter io; io.setDevice(&f); io.setFormat("PNG"); - if(!io.write(av->pixmap()->toImage()))goto write_error; - } else { - if(!f.save(0))goto write_error; + if(!io.write(av->pixmap()->toImage())) + goto write_error; + } + else + { + if(!f.save(0)) + goto write_error; } - } else { - if(!f.save(0))goto write_error; } - } else { - if(!f.save(0))goto write_error; + else + { + if(!f.save(0)) + goto write_error; + } + } + else + { + if(!f.save(0)) + goto write_error; } } } goto succesfull_export; - write_error: - KviMessageBox::warning(__tr2qs_ctx("Can't export the registered users database: write error.","register")); + KviMessageBox::warning(__tr2qs_ctx("Can't export the registered users database: write error.", "register")); f.close(); return; @@ -826,63 +876,74 @@ void RegisteredUsersDialog::importClicked() //KviCString buffer; QString buffer; - if(!KviFileDialog::askForOpenFileName(buffer,__tr2qs_ctx("Select a File - KVIrc","register"),QString(),QString(),false,true,this))return; + if(!KviFileDialog::askForOpenFileName(buffer, __tr2qs_ctx("Select a File - KVIrc", "register"), QString(), QString(), false, true, this)) + return; - if(!g_pRegisteredUsersDialog)return; // we have been deleted! + if(!g_pRegisteredUsersDialog) + return; // we have been deleted! KviFile f(buffer); if(!f.open(QIODevice::ReadOnly)) { - KviMessageBox::warning(__tr2qs_ctx("Can't open file %Q for reading.","register"),&buffer); + KviMessageBox::warning(__tr2qs_ctx("Can't open file %Q for reading.", "register"), &buffer); return; } KviReguserDbFileHeader hf; unsigned int idx; - if(f.read((char *)&hf,sizeof(KviReguserDbFileHeader)) != sizeof(KviReguserDbFileHeader))goto read_error; + if(f.read((char *)&hf, sizeof(KviReguserDbFileHeader)) != sizeof(KviReguserDbFileHeader)) + goto read_error; if(hf.magic != KVI_REGUSER_DB_FILE_MAGIC) { - KviMessageBox::warning(__tr2qs_ctx("The file %Q doesn't appear to be a valid registered users database.","register"),&buffer); + KviMessageBox::warning(__tr2qs_ctx("The file %Q doesn't appear to be a valid registered users database.", "register"), &buffer); f.close(); return; } if(hf.version != KVI_REGUSER_DB_FILE_VERSION) { - KviMessageBox::warning(__tr2qs_ctx("The file %Q contains an invalid registered users database version.","register"),&buffer); + KviMessageBox::warning(__tr2qs_ctx("The file %Q contains an invalid registered users database version.", "register"), &buffer); f.close(); return; } - for(idx = 0;idx < hf.nentries;idx++) + for(idx = 0; idx < hf.nentries; idx++) { QString szName; - if(!f.load(szName))goto read_error; + if(!f.load(szName)) + goto read_error; KviRegisteredUser * u = g_pLocalRegisteredUserDataBase->getUser(szName); - if(!u) goto read_error; + if(!u) + goto read_error; unsigned int count = 0; - if(!f.load(count))goto read_error; - for(unsigned int up = 0;up < count;up++) + if(!f.load(count)) + goto read_error; + for(unsigned int up = 0; up < count; up++) { - QString szKey,szValue; - if(!f.load(szKey))goto read_error; - if(!f.load(szValue))goto read_error; - u->setProperty(szKey,szValue); + QString szKey, szValue; + if(!f.load(szKey)) + goto read_error; + if(!f.load(szValue)) + goto read_error; + u->setProperty(szKey, szValue); } - if(!f.load(count))goto read_error; - for(unsigned int um = 0;um < count;um++) + if(!f.load(count)) + goto read_error; + for(unsigned int um = 0; um < count; um++) { QString szMask; - if(!f.load(szMask))goto read_error; + if(!f.load(szMask)) + goto read_error; if(!szMask.isEmpty()) { KviIrcMask * m = new KviIrcMask(szMask); - g_pLocalRegisteredUserDataBase->addMask(u,m); + g_pLocalRegisteredUserDataBase->addMask(u, m); } } - if(!f.load(count))goto read_error; + if(!f.load(count)) + goto read_error; if(count) { // there is an avatar @@ -890,37 +951,39 @@ void RegisteredUsersDialog::importClicked() QImageReader io; io.setDevice(&f); io.setFormat("PNG"); - img=io.read(); -// if(io.read())goto read_error; + img = io.read(); + // if(io.read())goto read_error; - if(img.isNull())qDebug("Oops! Read a null image?"); + if(img.isNull()) + qDebug("Oops! Read a null image?"); QString fName = u->name(); KviFileUtils::adjustFilePath(fName); QString fPath; - int rnm = 0 ; + int rnm = 0; do { - g_pApp->getLocalKvircDirectory(fPath,KviApplication::Avatars,fName); + g_pApp->getLocalKvircDirectory(fPath, KviApplication::Avatars, fName); fPath.append(QString("%1.png").arg(rnm)); rnm++; } while(KviFileUtils::fileExists(fPath)); - if(!img.save(fPath,"PNG")) + if(!img.save(fPath, "PNG")) { - qDebug("Can't save image %s",fPath.toUtf8().data()); - } else { - u->setProperty("avatar",fPath); + qDebug("Can't save image %s", fPath.toUtf8().data()); + } + else + { + u->setProperty("avatar", fPath); } } } goto succesfull_import; - read_error: - KviMessageBox::warning(__tr2qs_ctx("Can't import the registered users database: read error.","register")); + KviMessageBox::warning(__tr2qs_ctx("Can't import the registered users database: read error.", "register")); f.close(); return; diff --git a/src/modules/reguser/RegisteredUsersDialog.h b/src/modules/reguser/RegisteredUsersDialog.h index 119e45ea4..6fadf08b3 100644 --- a/src/modules/reguser/RegisteredUsersDialog.h +++ b/src/modules/reguser/RegisteredUsersDialog.h @@ -38,48 +38,48 @@ #include #include -class KviRegisteredUsersListView : public QTreeWidget +class KviRegisteredUsersListView : public QTreeWidget { Q_OBJECT public: - KviRegisteredUsersListView(QWidget*); + KviRegisteredUsersListView(QWidget *); ~KviRegisteredUsersListView(){}; + protected: - void mousePressEvent (QMouseEvent *e); + void mousePressEvent(QMouseEvent * e); signals: - void rightButtonPressed(QTreeWidgetItem *,QPoint); + void rightButtonPressed(QTreeWidgetItem *, QPoint); }; class RegisteredUsersDialogItemDelegate : public QStyledItemDelegate { public: - RegisteredUsersDialogItemDelegate(KviRegisteredUsersListView * pWidget=0) - : QStyledItemDelegate(pWidget) {}; + RegisteredUsersDialogItemDelegate(KviRegisteredUsersListView * pWidget = 0) + : QStyledItemDelegate(pWidget){}; ~RegisteredUsersDialogItemDelegate(){}; - QSize sizeHint(const QStyleOptionViewItem &option,const QModelIndex &index) const; - void paint( QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index ) const; - + QSize sizeHint(const QStyleOptionViewItem & option, const QModelIndex & index) const; + void paint(QPainter * painter, const QStyleOptionViewItem & option, const QModelIndex & index) const; }; class RegisteredUsersDialogItemBase : public QTreeWidgetItem { public: - enum Types { User,Group }; -protected: - RegisteredUsersDialogItemBase(Types type,KviRegisteredUsersListView * par) - :QTreeWidgetItem(par),m_iType(type) - { - }; - RegisteredUsersDialogItemBase(Types type,QTreeWidgetItem * par) - :QTreeWidgetItem(par),m_iType(type) - { - }; - ~RegisteredUsersDialogItemBase() + enum Types { + User, + Group }; +protected: + RegisteredUsersDialogItemBase(Types type, KviRegisteredUsersListView * par) + : QTreeWidgetItem(par), m_iType(type){}; + RegisteredUsersDialogItemBase(Types type, QTreeWidgetItem * par) + : QTreeWidgetItem(par), m_iType(type){}; + ~RegisteredUsersDialogItemBase(){}; + private: RegisteredUsersDialogItemBase::Types m_iType; + public: RegisteredUsersDialogItemBase::Types type() { return m_iType; }; }; @@ -88,11 +88,12 @@ class RegisteredUsersGroupItem : public RegisteredUsersDialogItemBase { protected: KviRegisteredUserGroup * m_pGroup; + public: - RegisteredUsersGroupItem(KviRegisteredUsersListView * par,KviRegisteredUserGroup * g) - :RegisteredUsersDialogItemBase(Group,par), m_pGroup(g) + RegisteredUsersGroupItem(KviRegisteredUsersListView * par, KviRegisteredUserGroup * g) + : RegisteredUsersDialogItemBase(Group, par), m_pGroup(g) { - setText(0,m_pGroup->name()); + setText(0, m_pGroup->name()); } ~RegisteredUsersGroupItem() { @@ -103,16 +104,19 @@ public: class RegisteredUsersDialogItem : public RegisteredUsersDialogItemBase { friend class RegisteredUsersDialogItemDelegate; + protected: KviRegisteredUser * m_pUser; - QTextDocument m_pText; + QTextDocument m_pText; + public: - RegisteredUsersDialogItem(QTreeWidgetItem * par,KviRegisteredUser * u); + RegisteredUsersDialogItem(QTreeWidgetItem * par, KviRegisteredUser * u); ~RegisteredUsersDialogItem(); + public: - KviRegisteredUser * user(){ return m_pUser; }; - void setUser(KviRegisteredUser * u){ m_pUser = u; }; - virtual QString key(int,bool) const; + KviRegisteredUser * user() { return m_pUser; }; + void setUser(KviRegisteredUser * u) { m_pUser = u; }; + virtual QString key(int, bool) const; }; class RegisteredUsersDialog : public QWidget @@ -121,8 +125,9 @@ class RegisteredUsersDialog : public QWidget public: RegisteredUsersDialog(QWidget * par = 0); ~RegisteredUsersDialog(); + public: - KviRegisteredUsersListView * m_pListView; + KviRegisteredUsersListView * m_pListView; QPushButton * m_pAddButton; QPushButton * m_pWizardAddButton; QPushButton * m_pRemoveButton; @@ -131,10 +136,11 @@ public: QPushButton * m_pExportButton; QPushButton * m_pAddGroupButton; QPushButton * m_pSelectAllButton; + protected: void fillList(); void editItem(RegisteredUsersDialogItem * i); - void editGroup(KviRegisteredUserGroup* group); + void editGroup(KviRegisteredUserGroup * group); virtual void closeEvent(QCloseEvent *); protected slots: void cancelClicked(); @@ -148,10 +154,10 @@ protected slots: void addWizardClicked(); void addGroupClicked(); void selectAllClicked(); - void itemPressed(QTreeWidgetItem *it,int c); - void itemDoubleClicked(QTreeWidgetItem *it, int); - void rightButtonPressed ( QTreeWidgetItem *, QPoint); - void moveToGroupMenuClicked(QAction *pAction); + void itemPressed(QTreeWidgetItem * it, int c); + void itemDoubleClicked(QTreeWidgetItem * it, int); + void rightButtonPressed(QTreeWidgetItem *, QPoint); + void moveToGroupMenuClicked(QAction * pAction); }; #endif diff --git a/src/modules/reguser/RegistrationWizard.cpp b/src/modules/reguser/RegistrationWizard.cpp index 0dfabd350..7cd29fea4 100644 --- a/src/modules/reguser/RegistrationWizard.cpp +++ b/src/modules/reguser/RegistrationWizard.cpp @@ -22,7 +22,6 @@ // //============================================================================= - #include "RegistrationWizard.h" #include "KviLocale.h" @@ -43,12 +42,11 @@ #include #include - extern KVIRC_API KviRegisteredUserDataBase * g_pRegisteredUserDataBase; extern KviPointerList * g_pRegistrationWizardList; -RegistrationWizard::RegistrationWizard(const QString &startMask,KviRegisteredUserDataBase * db,QWidget * par,bool bModal) -: KviTalWizard(par) +RegistrationWizard::RegistrationWizard(const QString & startMask, KviRegisteredUserDataBase * db, QWidget * par, bool bModal) + : KviTalWizard(par) { m_pDb = db; @@ -60,21 +58,21 @@ RegistrationWizard::RegistrationWizard(const QString &startMask,KviRegisteredUse g_pRegistrationWizardList->append(this); - QGridLayout* m_pPage1Layout; - QGridLayout* m_pPage2Layout; - QGridLayout* m_pPage3Layout; - QGridLayout* m_pPage4Layout; - QGridLayout* m_pPage5Layout; + QGridLayout * m_pPage1Layout; + QGridLayout * m_pPage2Layout; + QGridLayout * m_pPage3Layout; + QGridLayout * m_pPage4Layout; + QGridLayout * m_pPage5Layout; - QLabel* TextLabel10_2; - QLabel* TextLabel10; - QLabel* TextLabel10_3; - QLabel* TextLabel10_3_2; + QLabel * TextLabel10_2; + QLabel * TextLabel10; + QLabel * TextLabel10_3; + QLabel * TextLabel10_3_2; QFrame * f; -// resize( 490, 456 ); - setWindowTitle(__tr2qs_ctx("User Registration Wizard - KVIrc","register")); + // resize( 490, 456 ); + setWindowTitle(__tr2qs_ctx("User Registration Wizard - KVIrc", "register")); setWindowIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Linux))); setSizeGripEnabled(true); @@ -85,26 +83,27 @@ RegistrationWizard::RegistrationWizard(const QString &startMask,KviRegisteredUse m_pPage1Layout->setMargin(8); m_pLabel1 = new QLabel(m_pPage1); - m_pLabel1->setText(__tr2qs_ctx("

Welcome to the user registration wizard.
This process allows you to add an IRC user to the database and set properties for that user. KVIrc will be (hopefully) able to recognize the user, add him to the notify list, and display the associated avatar.

First of all, you must insert an entry name or real name for the user you're going to register. The name will be used to identify the database entry and has no specific requirements, it can be a given name, nickname, or just some text to remind you of the real person.
Examples: \"George W Bush\", \"Dubya\".\n

","register")); + m_pLabel1->setText(__tr2qs_ctx("

Welcome to the user registration wizard.
This process allows you to add an IRC user to the database and set properties for that user. KVIrc will be (hopefully) able to recognize the user, add him to the notify list, and display the associated avatar.

First of all, you must insert an entry name or real name for the user you're going to register. The name will be used to identify the database entry and has no specific requirements, it can be a given name, nickname, or just some text to remind you of the real person.
Examples: \"George W Bush\", \"Dubya\".\n

", "register")); m_pLabel1->setWordWrap(true); - m_pPage1Layout->addWidget(m_pLabel1,0,0,1,2); + m_pPage1Layout->addWidget(m_pLabel1, 0, 0, 1, 2); m_pEditRealName = new QLineEdit(m_pPage1); //m_pEditRealName->setAlignment(int(QLineEdit::AlignHCenter)); - m_pPage1Layout->addWidget(m_pEditRealName,3,1); + m_pPage1Layout->addWidget(m_pEditRealName, 3, 1); m_pEntryNameLabel = new QLabel(m_pPage1); - m_pEntryNameLabel->setText(__tr2qs_ctx("Entry name:","register")); - m_pPage1Layout->addWidget(m_pEntryNameLabel,3,0); - m_pPage1Layout->setRowStretch(1,1); + m_pEntryNameLabel->setText(__tr2qs_ctx("Entry name:", "register")); + m_pPage1Layout->addWidget(m_pEntryNameLabel, 3, 0); + m_pPage1Layout->setRowStretch(1, 1); - addPage( m_pPage1,__tr2qs_ctx("Step 1: Entry Name","register")); + addPage(m_pPage1, __tr2qs_ctx("Step 1: Entry Name", "register")); - if(mask.nick() != "*")m_pEditRealName->setText(mask.nick()); + if(mask.nick() != "*") + m_pEditRealName->setText(mask.nick()); - connect(m_pEditRealName,SIGNAL(textChanged(const QString &)),this,SLOT(realNameChanged(const QString &))); + connect(m_pEditRealName, SIGNAL(textChanged(const QString &)), this, SLOT(realNameChanged(const QString &))); // PAGE 2 @@ -113,11 +112,11 @@ RegistrationWizard::RegistrationWizard(const QString &startMask,KviRegisteredUse m_pPage2Layout->setSpacing(4); m_pPage2Layout->setMargin(8); - m_pLabel2 = new QLabel( m_pPage2); - m_pLabel2->setText(__tr2qs_ctx("

A registered user is identified by one or more IRC masks.
A mask must be in the following form:
nickname!username@hostname
and can contain wildcard characters '*' and '?'. Be careful in choosing the masks, as they are the only way to verify the identity of a registered user.

You can enter at most two masks here, if you wish to add more masks, use the \"Edit\" button in the Registered Users dialog. You must enter at least one mask.

","register")); + m_pLabel2 = new QLabel(m_pPage2); + m_pLabel2->setText(__tr2qs_ctx("

A registered user is identified by one or more IRC masks.
A mask must be in the following form:
nickname!username@hostname
and can contain wildcard characters '*' and '?'. Be careful in choosing the masks, as they are the only way to verify the identity of a registered user.

You can enter at most two masks here, if you wish to add more masks, use the \"Edit\" button in the Registered Users dialog. You must enter at least one mask.

", "register")); m_pLabel2->setWordWrap(true); - m_pPage2Layout->addWidget(m_pLabel2,0,0,1,5); + m_pPage2Layout->addWidget(m_pLabel2, 0, 0, 1, 5); //KviCString szMask; @@ -127,54 +126,57 @@ RegistrationWizard::RegistrationWizard(const QString &startMask,KviRegisteredUse m_pNicknameEdit1 = new QLineEdit(m_pPage2); m_pNicknameEdit1->setAlignment(Qt::AlignRight); - if(mask.nick() != "*")m_pNicknameEdit1->setText(mask.nick()); - connect(m_pNicknameEdit1,SIGNAL(textChanged(const QString &)),this,SLOT(maskChanged(const QString &))); - m_pPage2Layout->addWidget( m_pNicknameEdit1,3,0); + if(mask.nick() != "*") + m_pNicknameEdit1->setText(mask.nick()); + connect(m_pNicknameEdit1, SIGNAL(textChanged(const QString &)), this, SLOT(maskChanged(const QString &))); + m_pPage2Layout->addWidget(m_pNicknameEdit1, 3, 0); m_pUsernameEdit1 = new QLineEdit(m_pPage2); m_pUsernameEdit1->setAlignment(Qt::AlignHCenter); - if(mask.hasUser())m_pUsernameEdit1->setText(mask.user()); - connect(m_pUsernameEdit1,SIGNAL(textChanged(const QString &)),this,SLOT(maskChanged(const QString &))); - m_pPage2Layout->addWidget(m_pUsernameEdit1,3,2); + if(mask.hasUser()) + m_pUsernameEdit1->setText(mask.user()); + connect(m_pUsernameEdit1, SIGNAL(textChanged(const QString &)), this, SLOT(maskChanged(const QString &))); + m_pPage2Layout->addWidget(m_pUsernameEdit1, 3, 2); m_pHostEdit1 = new QLineEdit(m_pPage2); - if(mask.hasHost())m_pHostEdit1->setText(mask.host()); - connect(m_pHostEdit1,SIGNAL(textChanged(const QString &)),this,SLOT(maskChanged(const QString &))); - m_pPage2Layout->addWidget(m_pHostEdit1,3,4); + if(mask.hasHost()) + m_pHostEdit1->setText(mask.host()); + connect(m_pHostEdit1, SIGNAL(textChanged(const QString &)), this, SLOT(maskChanged(const QString &))); + m_pPage2Layout->addWidget(m_pHostEdit1, 3, 4); m_pNicknameEdit2 = new QLineEdit(m_pPage2); m_pNicknameEdit2->setAlignment(Qt::AlignRight); - m_pPage2Layout->addWidget(m_pNicknameEdit2,4,0); + m_pPage2Layout->addWidget(m_pNicknameEdit2, 4, 0); m_pUsernameEdit2 = new QLineEdit(m_pPage2); m_pUsernameEdit2->setAlignment(Qt::AlignHCenter); - m_pPage2Layout->addWidget(m_pUsernameEdit2,4,2); + m_pPage2Layout->addWidget(m_pUsernameEdit2, 4, 2); m_pHostEdit2 = new QLineEdit(m_pPage2); - m_pPage2Layout->addWidget(m_pHostEdit2,4,4); + m_pPage2Layout->addWidget(m_pHostEdit2, 4, 4); TextLabel10_2 = new QLabel(m_pPage2); TextLabel10_2->setText("!"); TextLabel10_2->setAlignment(Qt::AlignCenter); - m_pPage2Layout->addWidget(TextLabel10_2,4,1); + m_pPage2Layout->addWidget(TextLabel10_2, 4, 1); TextLabel10 = new QLabel(m_pPage2); TextLabel10->setText("!"); TextLabel10->setAlignment(Qt::AlignCenter); - m_pPage2Layout->addWidget(TextLabel10,3,1); + m_pPage2Layout->addWidget(TextLabel10, 3, 1); TextLabel10_3 = new QLabel(m_pPage2); TextLabel10_3->setText("@"); TextLabel10_3->setAlignment(Qt::AlignCenter); - m_pPage2Layout->addWidget(TextLabel10_3,3,3); + m_pPage2Layout->addWidget(TextLabel10_3, 3, 3); TextLabel10_3_2 = new QLabel(m_pPage2); TextLabel10_3_2->setText("@"); TextLabel10_3_2->setAlignment(Qt::AlignCenter); - m_pPage2Layout->addWidget(TextLabel10_3_2,4,3); - m_pPage2Layout->setRowStretch(1,1); + m_pPage2Layout->addWidget(TextLabel10_3_2, 4, 3); + m_pPage2Layout->setRowStretch(1, 1); - addPage(m_pPage2,__tr2qs_ctx("Step 2: Mask Selection","register")); + addPage(m_pPage2, __tr2qs_ctx("Step 2: Mask Selection", "register")); // PAGE 3 @@ -184,20 +186,20 @@ RegistrationWizard::RegistrationWizard(const QString &startMask,KviRegisteredUse m_pPage3Layout->setMargin(8); m_pLabel3 = new QLabel(m_pPage3); - m_pLabel3->setText(__tr2qs_ctx("

If you want to store an avatar image for this user, you can set it here. KVIrc will show the avatar in the userlist next to the user's nickname.
An avatar can be in any supported image format (PNG is recommended). Keep in mind that KVIrc stores avatars in memory and has to resize them to fit in the userlist, thus it's better to use small, low-resolution images.

","register")); + m_pLabel3->setText(__tr2qs_ctx("

If you want to store an avatar image for this user, you can set it here. KVIrc will show the avatar in the userlist next to the user's nickname.
An avatar can be in any supported image format (PNG is recommended). Keep in mind that KVIrc stores avatars in memory and has to resize them to fit in the userlist, thus it's better to use small, low-resolution images.

", "register")); m_pLabel3->setWordWrap(true); - m_pPage3Layout->addWidget(m_pLabel3,0,0); + m_pPage3Layout->addWidget(m_pLabel3, 0, 0); f = new QFrame(m_pPage3); f->setFrameStyle(QFrame::HLine | QFrame::Sunken); - m_pPage3Layout->addWidget(f,1,0); + m_pPage3Layout->addWidget(f, 1, 0); m_pAvatar = new KviPixmap(); - m_pAvatarSelector = new KviPixmapSelector(m_pPage3,__tr2qs_ctx("Store an avatar for this user:","register"),m_pAvatar,true); - m_pPage3Layout->addWidget(m_pAvatarSelector,2,0); - m_pPage3Layout->setRowStretch(2,1); + m_pAvatarSelector = new KviPixmapSelector(m_pPage3, __tr2qs_ctx("Store an avatar for this user:", "register"), m_pAvatar, true); + m_pPage3Layout->addWidget(m_pAvatarSelector, 2, 0); + m_pPage3Layout->setRowStretch(2, 1); - addPage(m_pPage3,__tr2qs_ctx("Step 3: Avatar Selection","register")); + addPage(m_pPage3, __tr2qs_ctx("Step 3: Avatar Selection", "register")); // PAGE 4 @@ -207,35 +209,36 @@ RegistrationWizard::RegistrationWizard(const QString &startMask,KviRegisteredUse m_pPage4Layout->setMargin(8); m_pLabel4 = new QLabel(m_pPage4); - m_pLabel4->setText(__tr2qs_ctx("

If you want to be notified when this user is online or goes offline, you must specify the list of nicknames that KVIrc will look for.

You can enter at most two nicknames here, if you wish to add more nicknames, use the \"Edit\" button in the \"Registered Users\" dialog.

","register")); + m_pLabel4->setText(__tr2qs_ctx("

If you want to be notified when this user is online or goes offline, you must specify the list of nicknames that KVIrc will look for.

You can enter at most two nicknames here, if you wish to add more nicknames, use the \"Edit\" button in the \"Registered Users\" dialog.

", "register")); m_pLabel4->setWordWrap(true); - m_pPage4Layout->addWidget(m_pLabel4,0,0,1,5); + m_pPage4Layout->addWidget(m_pLabel4, 0, 0, 1, 5); m_pNotifyCheck = new QCheckBox(m_pPage4); - m_pNotifyCheck->setText(__tr2qs_ctx("Add this user to the notify list","register")); + m_pNotifyCheck->setText(__tr2qs_ctx("Add this user to the notify list", "register")); m_pNotifyCheck->setChecked(false); - connect(m_pNotifyCheck,SIGNAL(toggled(bool)),this,SLOT(notifyCheckToggled(bool))); - m_pPage4Layout->addWidget(m_pNotifyCheck,3,0,1,2); + connect(m_pNotifyCheck, SIGNAL(toggled(bool)), this, SLOT(notifyCheckToggled(bool))); + m_pPage4Layout->addWidget(m_pNotifyCheck, 3, 0, 1, 2); m_pNotifyNickLabel1 = new QLabel(m_pPage4); - m_pNotifyNickLabel1->setText(__tr2qs_ctx("Nickname:","register")); - m_pPage4Layout->addWidget(m_pNotifyNickLabel1,4,0); + m_pNotifyNickLabel1->setText(__tr2qs_ctx("Nickname:", "register")); + m_pPage4Layout->addWidget(m_pNotifyNickLabel1, 4, 0); m_pNotifyNickLabel2 = new QLabel(m_pPage4); - m_pNotifyNickLabel2->setText(__tr2qs_ctx("Nickname 2:","register")); - m_pPage4Layout->addWidget(m_pNotifyNickLabel2,5,0); + m_pNotifyNickLabel2->setText(__tr2qs_ctx("Nickname 2:", "register")); + m_pPage4Layout->addWidget(m_pNotifyNickLabel2, 5, 0); m_pNotifyNickEdit1 = new QLineEdit(m_pPage4); - if(mask.nick() != "*")m_pNotifyNickEdit1->setText(mask.nick()); - connect(m_pNotifyNickEdit1,SIGNAL(textChanged(const QString &)),this,SLOT(notifyNickChanged(const QString &))); - m_pPage4Layout->addWidget(m_pNotifyNickEdit1,4,1); + if(mask.nick() != "*") + m_pNotifyNickEdit1->setText(mask.nick()); + connect(m_pNotifyNickEdit1, SIGNAL(textChanged(const QString &)), this, SLOT(notifyNickChanged(const QString &))); + m_pPage4Layout->addWidget(m_pNotifyNickEdit1, 4, 1); m_pNotifyNickEdit2 = new QLineEdit(m_pPage4); - connect(m_pNotifyNickEdit2,SIGNAL(textChanged(const QString &)),this,SLOT(notifyNickChanged(const QString &))); - m_pPage4Layout->addWidget(m_pNotifyNickEdit2,5,1); - m_pPage4Layout->setRowStretch(1,1); + connect(m_pNotifyNickEdit2, SIGNAL(textChanged(const QString &)), this, SLOT(notifyNickChanged(const QString &))); + m_pPage4Layout->addWidget(m_pNotifyNickEdit2, 5, 1); + m_pPage4Layout->setRowStretch(1, 1); - addPage(m_pPage4,__tr2qs_ctx("Step 4: Notify List","register")); + addPage(m_pPage4, __tr2qs_ctx("Step 4: Notify List", "register")); // PAGE 5 @@ -245,20 +248,20 @@ RegistrationWizard::RegistrationWizard(const QString &startMask,KviRegisteredUse m_pPage5Layout->setMargin(8); m_pTextLabel5 = new QLabel(m_pPage5); - m_pTextLabel5->setText(__tr2qs_ctx("

That's it. The user registration has been completed.

Click \"Finish\" to close this dialog.

","register")); + m_pTextLabel5->setText(__tr2qs_ctx("

That's it. The user registration has been completed.

Click \"Finish\" to close this dialog.

", "register")); m_pTextLabel5->setWordWrap(true); - m_pPage5Layout->addWidget(m_pTextLabel5,0,0); - m_pPage5Layout->setRowStretch(1,1); + m_pPage5Layout->addWidget(m_pTextLabel5, 0, 0); + m_pPage5Layout->setRowStretch(1, 1); - addPage(m_pPage5,__tr2qs_ctx("Registration Complete","register")); + addPage(m_pPage5, __tr2qs_ctx("Registration Complete", "register")); - setFinishEnabled(m_pPage5,true); + setFinishEnabled(m_pPage5, true); QString dummy; maskChanged(dummy); realNameChanged(dummy); notifyCheckToggled(false); - setMinimumSize(QSize(350,420)); + setMinimumSize(QSize(350, 420)); // signals and slots connections } @@ -274,9 +277,10 @@ RegistrationWizard::~RegistrationWizard() void RegistrationWizard::reject() { KviTalWizard::reject(); - if(!m_bModal)delete this; -// hide(); -// g_pApp->collectGarbage(this); + if(!m_bModal) + delete this; + // hide(); + // g_pApp->collectGarbage(this); } void RegistrationWizard::accept() @@ -291,16 +295,17 @@ void RegistrationWizard::accept() QString szName = m_pEditRealName->text(); KviRegisteredUser * u; - if(bLocalDb) { - if(szName.isEmpty()) szName = "user"; + if(szName.isEmpty()) + szName = "user"; QString szNameOk = szName; int idx = 1; - do { + do + { u = m_pDb->findUserByName(szNameOk); if(u) { @@ -310,10 +315,12 @@ void RegistrationWizard::accept() } while(u); u = m_pDb->addUser(szNameOk); - - } else { + } + else + { u = m_pDb->findUserByName(szName); - if(!u)u = m_pDb->addUser(szName); + if(!u) + u = m_pDb->addUser(szName); } if(!u) @@ -331,9 +338,9 @@ void RegistrationWizard::accept() QString m3 = m_pHostEdit1->text(); if(!(m1.isEmpty() && m2.isEmpty() && m3.isEmpty())) { - mk = new KviIrcMask(m1,m2,m3); + mk = new KviIrcMask(m1, m2, m3); m_pDb->removeMask(*mk); - m_pDb->addMask(u,mk); + m_pDb->addMask(u, mk); } m1 = m_pNicknameEdit2->text(); @@ -341,12 +348,15 @@ void RegistrationWizard::accept() m3 = m_pHostEdit2->text(); if(!(m1.isEmpty() && m2.isEmpty() && m3.isEmpty())) { - if(m1.isEmpty())m1 = "*"; - if(m2.isEmpty())m2 = "*"; - if(m3.isEmpty())m3 = "*"; - mk = new KviIrcMask(m1,m2,m3); + if(m1.isEmpty()) + m1 = "*"; + if(m2.isEmpty()) + m2 = "*"; + if(m3.isEmpty()) + m3 = "*"; + mk = new KviIrcMask(m1, m2, m3); m_pDb->removeMask(*mk); - m_pDb->addMask(u,mk); + m_pDb->addMask(u, mk); } m_pAvatarSelector->commit(); @@ -356,7 +366,7 @@ void RegistrationWizard::accept() if(!m_pAvatar->isNull()) { QString szPath = m_pAvatar->path(); - u->setProperty("avatar",szPath); + u->setProperty("avatar", szPath); bSetAvatar = true; } @@ -373,8 +383,9 @@ void RegistrationWizard::accept() if(!m1.isEmpty()) { - u->setProperty("notify",m1); - if(!bLocalDb)g_pApp->restartNotifyLists(); + u->setProperty("notify", m1); + if(!bLocalDb) + g_pApp->restartNotifyLists(); } } @@ -383,18 +394,18 @@ void RegistrationWizard::accept() KviTalWizard::accept(); -// if(!m_bModal)delete this; -// hide(); -// g_pApp->collectGarbage(this); + // if(!m_bModal)delete this; + // hide(); + // g_pApp->collectGarbage(this); } - -void RegistrationWizard::showEvent(QShowEvent *e) +void RegistrationWizard::showEvent(QShowEvent * e) { - if(height() < 420)resize(width(),420); + if(height() < 420) + resize(width(), 420); QRect rect = g_pApp->desktop()->screenGeometry(g_pApp->desktop()->primaryScreen()); - move((rect.width() - width())/2,(rect.height() - height())/2); + move((rect.width() - width()) / 2, (rect.height() - height()) / 2); KviTalWizard::showEvent(e); } @@ -406,33 +417,33 @@ void RegistrationWizard::maskChanged(const QString &) if(tmp1.isEmpty()) { - setNextEnabled(m_pPage2,false); + setNextEnabled(m_pPage2, false); return; } if(tmp2.isEmpty()) { - setNextEnabled(m_pPage2,false); + setNextEnabled(m_pPage2, false); return; } if(tmp3.isEmpty()) { - setNextEnabled(m_pPage2,false); + setNextEnabled(m_pPage2, false); return; } - KviCString mask(KviCString::Format,"%s!%s@%s",tmp1.ptr(),tmp2.ptr(),tmp3.ptr()); + KviCString mask(KviCString::Format, "%s!%s@%s", tmp1.ptr(), tmp2.ptr(), tmp3.ptr()); //KviIrcMask m(mask.ptr()); - setNextEnabled(m_pPage2,mask!="*!*@*"); + setNextEnabled(m_pPage2, mask != "*!*@*"); } void RegistrationWizard::realNameChanged(const QString &) { QString tmp = m_pEditRealName->text(); - setNextEnabled(m_pPage1,!(tmp.isEmpty() || tmp.isNull())); + setNextEnabled(m_pPage1, !(tmp.isEmpty() || tmp.isNull())); } void RegistrationWizard::notifyNickChanged(const QString &) @@ -446,13 +457,16 @@ void RegistrationWizard::notifyNickChanged(const QString &) if(tmp.hasData()) { bYes = true; - } else { + } + else + { tmp = m_pNotifyNickEdit2->text(); - if(tmp.hasData())bYes = true; + if(tmp.hasData()) + bYes = true; } } - setNextEnabled(m_pPage4,bYes); + setNextEnabled(m_pPage4, bYes); } void RegistrationWizard::notifyCheckToggled(bool) diff --git a/src/modules/reguser/RegistrationWizard.h b/src/modules/reguser/RegistrationWizard.h index ded14e67c..b41ac6a06 100644 --- a/src/modules/reguser/RegistrationWizard.h +++ b/src/modules/reguser/RegistrationWizard.h @@ -43,7 +43,7 @@ class RegistrationWizard : public KviTalWizard { Q_OBJECT public: - RegistrationWizard(const QString &startMask,KviRegisteredUserDataBase * db = 0,QWidget * par = 0,bool bModal = false); + RegistrationWizard(const QString & startMask, KviRegisteredUserDataBase * db = 0, QWidget * par = 0, bool bModal = false); ~RegistrationWizard(); KviRegisteredUserDataBase * m_pDb; @@ -52,39 +52,40 @@ public: bool m_bModal; - QWidget* m_pPage1; - QLabel* m_pLabel1; - QLabel* m_pEntryNameLabel; - QLineEdit* m_pEditRealName; - QWidget* m_pPage2; - QLabel* m_pLabel2; - QLineEdit* m_pNicknameEdit1; - QLineEdit* m_pNicknameEdit2; - QLineEdit* m_pHostEdit1; - QLineEdit* m_pHostEdit2; - QLineEdit* m_pUsernameEdit1; - QLineEdit* m_pUsernameEdit2; - QWidget* m_pPage3; - QLabel* m_pLabel3; + QWidget * m_pPage1; + QLabel * m_pLabel1; + QLabel * m_pEntryNameLabel; + QLineEdit * m_pEditRealName; + QWidget * m_pPage2; + QLabel * m_pLabel2; + QLineEdit * m_pNicknameEdit1; + QLineEdit * m_pNicknameEdit2; + QLineEdit * m_pHostEdit1; + QLineEdit * m_pHostEdit2; + QLineEdit * m_pUsernameEdit1; + QLineEdit * m_pUsernameEdit2; + QWidget * m_pPage3; + QLabel * m_pLabel3; KviPixmapSelector * m_pAvatarSelector; - QWidget* m_pPage4; - QCheckBox* m_pNotifyCheck; - QLabel* m_pNotifyNickLabel1; - QLabel* m_pNotifyNickLabel2; - QLabel* m_pLabel4; - QLineEdit* m_pNotifyNickEdit1; - QLineEdit* m_pNotifyNickEdit2; - QWidget* m_pPage5; - QLabel* m_pTextLabel5; + QWidget * m_pPage4; + QCheckBox * m_pNotifyCheck; + QLabel * m_pNotifyNickLabel1; + QLabel * m_pNotifyNickLabel2; + QLabel * m_pLabel4; + QLineEdit * m_pNotifyNickEdit1; + QLineEdit * m_pNotifyNickEdit2; + QWidget * m_pPage5; + QLabel * m_pTextLabel5; KviPixmap * m_pAvatar; + protected: - virtual void showEvent(QShowEvent *e); + virtual void showEvent(QShowEvent * e); virtual void accept(); virtual void reject(); protected slots: - void realNameChanged(const QString &str); - void maskChanged(const QString &str); + void realNameChanged(const QString & str); + void maskChanged(const QString & str); void notifyNickChanged(const QString &); void notifyCheckToggled(bool); }; diff --git a/src/modules/reguser/libkvireguser.cpp b/src/modules/reguser/libkvireguser.cpp index 817a41055..16ac88c82 100644 --- a/src/modules/reguser/libkvireguser.cpp +++ b/src/modules/reguser/libkvireguser.cpp @@ -48,7 +48,6 @@ // KviApplication.cpp - extern KVIRC_API KviRegisteredUserDataBase * g_pRegisteredUserDataBase; KviPointerList * g_pRegistrationWizardList = 0; @@ -112,23 +111,29 @@ static bool reguser_kvs_cmd_edit(KviKvsModuleCommandCall * c) { if(g_pRegisteredUsersDialog) { - if(c->hasSwitch('t',"toplevel")) + if(c->hasSwitch('t', "toplevel")) { if(g_pRegisteredUsersDialog->parent()) { g_pRegisteredUsersDialog->setParent(0); } - } else { + } + else + { if(g_pRegisteredUsersDialog->parent() != g_pMainWindow->splitter()) { g_pRegisteredUsersDialog->setParent(g_pMainWindow->splitter()); } } - } else { - if(c->hasSwitch('t',"toplevel")) + } + else + { + if(c->hasSwitch('t', "toplevel")) { g_pRegisteredUsersDialog = new RegisteredUsersDialog(0); - } else { + } + else + { g_pRegisteredUsersDialog = new RegisteredUsersDialog(g_pMainWindow->splitter()); } } @@ -180,45 +185,49 @@ static bool reguser_kvs_cmd_add(KviKvsModuleCommandCall * c) QString szName; QString szMask; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("name",KVS_PT_STRING,0,szName) - KVSM_PARAMETER("mask",KVS_PT_STRING,0,szMask) + KVSM_PARAMETER("name", KVS_PT_STRING, 0, szName) + KVSM_PARAMETER("mask", KVS_PT_STRING, 0, szMask) KVSM_PARAMETERS_END(c) if(szName.isEmpty()) { - if(!c->hasSwitch('q',"quiet"))c->warning(__tr2qs_ctx("No name specified","register")); + if(!c->hasSwitch('q', "quiet")) + c->warning(__tr2qs_ctx("No name specified", "register")); return true; } - if(c->hasSwitch('r',"replace"))g_pRegisteredUserDataBase->removeUser(szName); - + if(c->hasSwitch('r', "replace")) + g_pRegisteredUserDataBase->removeUser(szName); KviRegisteredUser * u = g_pRegisteredUserDataBase->addUser(szName); QString group; - if(c->hasSwitch('g',"group")) + if(c->hasSwitch('g', "group")) { - c->switches()->getAsStringIfExisting('g',"group",group); + c->switches()->getAsStringIfExisting('g', "group", group); u->setGroup(group); } if(u == 0) { - if(c->hasSwitch('f',"force")) + if(c->hasSwitch('f', "force")) { u = g_pRegisteredUserDataBase->findUserByName(szName); - } else { - if(!c->hasSwitch('q',"quiet"))c->warning(__tr2qs_ctx("User already registered: found exact name match","register")); + } + else + { + if(!c->hasSwitch('q', "quiet")) + c->warning(__tr2qs_ctx("User already registered: found exact name match", "register")); } } - if(u) { if(!szMask.isEmpty()) { KviIrcMask * m = new KviIrcMask(szMask); - u = g_pRegisteredUserDataBase->addMask(u,m); + u = g_pRegisteredUserDataBase->addMask(u, m); if(u != 0) { - if(!c->hasSwitch('q',"quiet"))c->warning(__tr2qs_ctx("Mask %Q is already used to identify user %s","register"),&szMask,u->name().toUtf8().data()); + if(!c->hasSwitch('q', "quiet")) + c->warning(__tr2qs_ctx("Mask %Q is already used to identify user %s", "register"), &szMask, u->name().toUtf8().data()); } } } @@ -260,20 +269,24 @@ static bool reguser_kvs_cmd_remove(KviKvsModuleCommandCall * c) { QString szName; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("name",KVS_PT_STRING,0,szName) + KVSM_PARAMETER("name", KVS_PT_STRING, 0, szName) KVSM_PARAMETERS_END(c) if(szName.isEmpty()) { - if(!c->hasSwitch('q',"quiet"))c->warning(__tr2qs_ctx("No name specified","register")); + if(!c->hasSwitch('q', "quiet")) + c->warning(__tr2qs_ctx("No name specified", "register")); return true; } if(!(g_pRegisteredUserDataBase->removeUser(szName))) { - c->warning(__tr2qs_ctx("User not found (%Q)","register"),&szName); - } else { - if(c->hasSwitch('n',"restartnotifylists"))g_pApp->restartNotifyLists(); + c->warning(__tr2qs_ctx("User not found (%Q)", "register"), &szName); + } + else + { + if(c->hasSwitch('n', "restartnotifylists")) + g_pApp->restartNotifyLists(); } return true; } @@ -322,36 +335,38 @@ static bool reguser_kvs_cmd_addmask(KviKvsModuleCommandCall * c) QString szName; QString szMask; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("name",KVS_PT_STRING,0,szName) - KVSM_PARAMETER("mask",KVS_PT_STRING,0,szMask) + KVSM_PARAMETER("name", KVS_PT_STRING, 0, szName) + KVSM_PARAMETER("mask", KVS_PT_STRING, 0, szMask) KVSM_PARAMETERS_END(c) if(szName.isEmpty()) { - c->warning(__tr2qs_ctx("No name specified","register")); + c->warning(__tr2qs_ctx("No name specified", "register")); return true; } if(szMask.isEmpty()) { - c->warning(__tr2qs_ctx("No mask specified","register")); + c->warning(__tr2qs_ctx("No mask specified", "register")); return true; } KviRegisteredUser * u = g_pRegisteredUserDataBase->findUserByName(szName); if(!u) { - c->warning(__tr2qs_ctx("User %Q not found","register"),&szName); + c->warning(__tr2qs_ctx("User %Q not found", "register"), &szName); return true; } KviIrcMask * mk = new KviIrcMask(szMask); - if(c->hasSwitch('f',"force"))g_pRegisteredUserDataBase->removeMask(*mk); + if(c->hasSwitch('f', "force")) + g_pRegisteredUserDataBase->removeMask(*mk); - u = g_pRegisteredUserDataBase->addMask(u,mk); + u = g_pRegisteredUserDataBase->addMask(u, mk); - if(u != 0)c->warning(__tr2qs_ctx("Mask %Q already used to identify user %Q","register"),&szMask,&(u->name())); + if(u != 0) + c->warning(__tr2qs_ctx("Mask %Q already used to identify user %Q", "register"), &szMask, &(u->name())); return true; } @@ -394,19 +409,19 @@ static bool reguser_kvs_cmd_delmask(KviKvsModuleCommandCall * c) { QString szMask; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("mask",KVS_PT_STRING,0,szMask) + KVSM_PARAMETER("mask", KVS_PT_STRING, 0, szMask) KVSM_PARAMETERS_END(c) if(szMask.isEmpty()) { - c->warning(__tr2qs_ctx("No mask specified","register")); + c->warning(__tr2qs_ctx("No mask specified", "register")); return true; } KviIrcMask mk(szMask); if(!g_pRegisteredUserDataBase->removeMask(mk)) { - c->warning(__tr2qs_ctx("Mask %Q not found","register"),&szMask); + c->warning(__tr2qs_ctx("Mask %Q not found", "register"), &szMask); } return true; @@ -442,27 +457,30 @@ static bool reguser_kvs_cmd_setIgnoreEnabled(KviKvsModuleCommandCall * c) QString szName; bool bEnabled; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("name",KVS_PT_STRING,0,szName) - KVSM_PARAMETER("isEnabled",KVS_PT_BOOL,0,bEnabled) + KVSM_PARAMETER("name", KVS_PT_STRING, 0, szName) + KVSM_PARAMETER("isEnabled", KVS_PT_BOOL, 0, bEnabled) KVSM_PARAMETERS_END(c) if(szName.isEmpty()) { - if(!c->hasSwitch('q',"quiet"))c->warning(__tr2qs_ctx("No name specified","register")); + if(!c->hasSwitch('q', "quiet")) + c->warning(__tr2qs_ctx("No name specified", "register")); return true; } KviRegisteredUser * u = g_pRegisteredUserDataBase->findUserByName(szName); if(!u) { - if(!c->hasSwitch('q',"quiet"))c->warning(__tr2qs_ctx("User %Q not found","register"),&szName); - } else { + if(!c->hasSwitch('q', "quiet")) + c->warning(__tr2qs_ctx("User %Q not found", "register"), &szName); + } + else + { u->setIgnoreEnabled(bEnabled); } return true; } - /* @doc: reguser.setIgnoreFlags @type: @@ -510,34 +528,38 @@ static bool reguser_kvs_cmd_setIgnoreFlags(KviKvsModuleCommandCall * c) { QString szName; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("name",KVS_PT_STRING,0,szName) + KVSM_PARAMETER("name", KVS_PT_STRING, 0, szName) KVSM_PARAMETERS_END(c) if(szName.isEmpty()) { - if(!c->hasSwitch('q',"quiet"))c->warning(__tr2qs_ctx("No name specified","register")); + if(!c->hasSwitch('q', "quiet")) + c->warning(__tr2qs_ctx("No name specified", "register")); return true; } KviRegisteredUser * u = g_pRegisteredUserDataBase->findUserByName(szName); if(!u) { - if(!c->hasSwitch('q',"quiet"))c->warning(__tr2qs_ctx("User %Q not found","register"),&szName); - } else { - int iIgnoreFlags=0; - if(c->hasSwitch('p',"query")) + if(!c->hasSwitch('q', "quiet")) + c->warning(__tr2qs_ctx("User %Q not found", "register"), &szName); + } + else + { + int iIgnoreFlags = 0; + if(c->hasSwitch('p', "query")) iIgnoreFlags |= KviRegisteredUser::Query; - if(c->hasSwitch('c',"channel")) + if(c->hasSwitch('c', "channel")) iIgnoreFlags |= KviRegisteredUser::Channel; - if(c->hasSwitch('n',"notice")) + if(c->hasSwitch('n', "notice")) iIgnoreFlags |= KviRegisteredUser::Notice; - if(c->hasSwitch('t',"ctcp")) + if(c->hasSwitch('t', "ctcp")) iIgnoreFlags |= KviRegisteredUser::Ctcp; - if(c->hasSwitch('i',"invite")) + if(c->hasSwitch('i', "invite")) iIgnoreFlags |= KviRegisteredUser::Invite; - if(c->hasSwitch('d',"dcc")) + if(c->hasSwitch('d', "dcc")) iIgnoreFlags |= KviRegisteredUser::Dcc; - if(c->hasSwitch('h',"highlight")) + if(c->hasSwitch('h', "highlight")) iIgnoreFlags |= KviRegisteredUser::Highlight; u->setIgnoreFlags(iIgnoreFlags); } @@ -580,28 +602,27 @@ static bool reguser_kvs_fnc_getIgnoreFlags(KviKvsModuleFunctionCall * c) QString szName; QString szFlags; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("name",KVS_PT_STRING,0,szName) + KVSM_PARAMETER("name", KVS_PT_STRING, 0, szName) KVSM_PARAMETERS_END(c) KviRegisteredUser * u = g_pRegisteredUserDataBase->findUserByName(szName); if(u) { if(u->ignoreFlags() & KviRegisteredUser::Query) - szFlags+='q'; + szFlags += 'q'; if(u->ignoreFlags() & KviRegisteredUser::Channel) - szFlags+='c'; + szFlags += 'c'; if(u->ignoreFlags() & KviRegisteredUser::Notice) - szFlags+='n'; + szFlags += 'n'; if(u->ignoreFlags() & KviRegisteredUser::Ctcp) - szFlags+='t'; + szFlags += 't'; if(u->ignoreFlags() & KviRegisteredUser::Invite) - szFlags+='i'; + szFlags += 'i'; if(u->ignoreFlags() & KviRegisteredUser::Dcc) - szFlags+='d'; + szFlags += 'd'; if(u->ignoreFlags() & KviRegisteredUser::Highlight) - szFlags+='h'; + szFlags += 'h'; c->returnValue()->setString(szFlags); - } return true; } @@ -634,14 +655,13 @@ static bool reguser_kvs_fnc_isIgnoreEnabled(KviKvsModuleFunctionCall * c) { QString szName; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("name",KVS_PT_STRING,0,szName) + KVSM_PARAMETER("name", KVS_PT_STRING, 0, szName) KVSM_PARAMETERS_END(c) KviRegisteredUser * u = g_pRegisteredUserDataBase->findUserByName(szName); if(u) { c->returnValue()->setBoolean(u->ignoreEnabled()); - } return true; } @@ -687,31 +707,38 @@ static bool reguser_kvs_cmd_setproperty(KviKvsModuleCommandCall * c) QString szProperty; QString szValue; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("mask",KVS_PT_STRING,0,szName) - KVSM_PARAMETER("property",KVS_PT_STRING,0,szProperty) - KVSM_PARAMETER("value",KVS_PT_STRING,KVS_PF_OPTIONAL,szValue) + KVSM_PARAMETER("mask", KVS_PT_STRING, 0, szName) + KVSM_PARAMETER("property", KVS_PT_STRING, 0, szProperty) + KVSM_PARAMETER("value", KVS_PT_STRING, KVS_PF_OPTIONAL, szValue) KVSM_PARAMETERS_END(c) if(szName.isEmpty()) { - if(!c->hasSwitch('q',"quiet"))c->warning(__tr2qs_ctx("No name specified","register")); + if(!c->hasSwitch('q', "quiet")) + c->warning(__tr2qs_ctx("No name specified", "register")); return true; } if(szProperty.isEmpty()) { - if(!c->hasSwitch('q',"quiet"))c->warning(__tr2qs_ctx("No property specified","register")); + if(!c->hasSwitch('q', "quiet")) + c->warning(__tr2qs_ctx("No property specified", "register")); return true; } KviRegisteredUser * u = g_pRegisteredUserDataBase->findUserByName(szName); if(!u) { - if(!c->hasSwitch('q',"quiet"))c->warning(__tr2qs_ctx("User %Q not found","register"),&szName); - } else { - u->setProperty(szProperty,szValue); - if(c->hasSwitch('n',"restartnotifylists"))g_pApp->restartNotifyLists(); - if(c->hasSwitch('a',"resetavatar"))g_pApp->resetAvatarForMatchingUsers(u); + if(!c->hasSwitch('q', "quiet")) + c->warning(__tr2qs_ctx("User %Q not found", "register"), &szName); + } + else + { + u->setProperty(szProperty, szValue); + if(c->hasSwitch('n', "restartnotifylists")) + g_pApp->restartNotifyLists(); + if(c->hasSwitch('a', "resetavatar")) + g_pApp->resetAvatarForMatchingUsers(u); } return true; } @@ -746,22 +773,22 @@ static bool reguser_kvs_fnc_list(KviKvsModuleFunctionCall * c) QString szMask; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("user_mask",KVS_PT_STRING,KVS_PF_OPTIONAL,szMask) + KVSM_PARAMETER("user_mask", KVS_PT_STRING, KVS_PF_OPTIONAL, szMask) KVSM_PARAMETERS_END(c) KviIrcMask mask(szMask); - KviKvsArray* pArray = new KviKvsArray(); - int aid=0; + KviKvsArray * pArray = new KviKvsArray(); + int aid = 0; - KviPointerHashTable * d = g_pRegisteredUserDataBase->userDict(); - KviPointerHashTableIterator it(*d); + KviPointerHashTable * d = g_pRegisteredUserDataBase->userDict(); + KviPointerHashTableIterator it(*d); while(KviRegisteredUser * u = it.current()) { KviPointerList * ml = u->maskList(); if(u->matches(mask) || (ml->count() == 0)) { - pArray->set(aid,new KviKvsVariant(u->name())); + pArray->set(aid, new KviKvsVariant(u->name())); aid++; } ++it; @@ -801,55 +828,57 @@ static bool reguser_kvs_cmd_showlist(KviKvsModuleCommandCall * c) { QString szMask; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("mask",KVS_PT_STRING,KVS_PF_OPTIONAL,szMask) + KVSM_PARAMETER("mask", KVS_PT_STRING, KVS_PF_OPTIONAL, szMask) KVSM_PARAMETERS_END(c) KviIrcMask mask(szMask); - c->window()->outputNoFmt(KVI_OUT_SYSTEMMESSAGE,__tr2qs_ctx("Registered users database dump:","register")); + c->window()->outputNoFmt(KVI_OUT_SYSTEMMESSAGE, __tr2qs_ctx("Registered users database dump:", "register")); int count = 0; - KviPointerHashTable * d = g_pRegisteredUserDataBase->userDict(); - KviPointerHashTableIterator it(*d); + KviPointerHashTable * d = g_pRegisteredUserDataBase->userDict(); + KviPointerHashTableIterator it(*d); while(KviRegisteredUser * u = it.current()) { KviPointerList * ml = u->maskList(); if(u->matches(mask) || (ml->count() == 0)) { - c->window()->output(KVI_OUT_SYSTEMMESSAGE,__tr2qs_ctx("User: %c%Q","register"),KviControlCodes::Bold,&(u->name())); + c->window()->output(KVI_OUT_SYSTEMMESSAGE, __tr2qs_ctx("User: %c%Q", "register"), KviControlCodes::Bold, &(u->name())); if(ml->count() == 0) { - c->window()->output(KVI_OUT_SYSTEMWARNING,__tr2qs_ctx("Warning: this user has no registration masks","register")); - } else { - for(KviIrcMask * m = ml->first();m;m = ml->next()) + c->window()->output(KVI_OUT_SYSTEMWARNING, __tr2qs_ctx("Warning: this user has no registration masks", "register")); + } + else + { + for(KviIrcMask * m = ml->first(); m; m = ml->next()) { - c->window()->output(KVI_OUT_SYSTEMMESSAGE,__tr2qs_ctx("Mask: %Q!%Q@%Q","register"),&(m->nick()),&(m->user()),&(m->host())); + c->window()->output(KVI_OUT_SYSTEMMESSAGE, __tr2qs_ctx("Mask: %Q!%Q@%Q", "register"), &(m->nick()), &(m->user()), &(m->host())); } } - KviPointerHashTable * pd = u->propertyDict(); + KviPointerHashTable * pd = u->propertyDict(); if(pd) { - KviPointerHashTableIterator pdit(*pd); + KviPointerHashTableIterator pdit(*pd); while(pdit.current()) { QString key = pdit.currentKey(); - c->window()->output(KVI_OUT_SYSTEMMESSAGE,__tr2qs_ctx("Property: %Q=%Q","register"),&(key),pdit.current()); + c->window()->output(KVI_OUT_SYSTEMMESSAGE, __tr2qs_ctx("Property: %Q=%Q", "register"), &(key), pdit.current()); ++pdit; } - } else c->window()->outputNoFmt(KVI_OUT_SYSTEMMESSAGE,__tr2qs_ctx("No properties","register")); + } + else + c->window()->outputNoFmt(KVI_OUT_SYSTEMMESSAGE, __tr2qs_ctx("No properties", "register")); count++; } ++it; } - c->window()->output(KVI_OUT_SYSTEMMESSAGE,__tr2qs_ctx("Total: %d matching users (of %d in the database)","register"),count,d->count()); + c->window()->output(KVI_OUT_SYSTEMMESSAGE, __tr2qs_ctx("Total: %d matching users (of %d in the database)", "register"), count, d->count()); return true; } - - /* @doc: reguser.match @type: @@ -878,13 +907,14 @@ static bool reguser_kvs_fnc_match(KviKvsModuleFunctionCall * c) QString szMask; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("user_mask",KVS_PT_STRING,0,szMask) + KVSM_PARAMETER("user_mask", KVS_PT_STRING, 0, szMask) KVSM_PARAMETERS_END(c) KviIrcMask mask(szMask); //FIXME: it crashes kvirc //KviRegisteredUser * u = c->context()->connection()->userDataBase()->registeredUser(mask.nick(),mask.user(),mask.host()); - KviRegisteredUser * u = g_pRegisteredUserDataBase->findMatchingUser(mask.nick(),mask.user(),mask.host()); - if(u) c->returnValue()->setString(u->name()); + KviRegisteredUser * u = g_pRegisteredUserDataBase->findMatchingUser(mask.nick(), mask.user(), mask.host()); + if(u) + c->returnValue()->setString(u->name()); return true; } @@ -916,11 +946,12 @@ static bool reguser_kvs_fnc_exactMatch(KviKvsModuleFunctionCall * c) QString szMask; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("user_mask",KVS_PT_STRING,0,szMask) + KVSM_PARAMETER("user_mask", KVS_PT_STRING, 0, szMask) KVSM_PARAMETERS_END(c) KviIrcMask mask(szMask); KviRegisteredUser * u = g_pRegisteredUserDataBase->findUserWithMask(mask); - if(u) c->returnValue()->setString(u->name()); + if(u) + c->returnValue()->setString(u->name()); return true; } @@ -976,7 +1007,6 @@ static bool reguser_kvs_fnc_exactMatch(KviKvsModuleFunctionCall * c) // return c->leaveStackFrame(); //} - /* @doc: reguser.mask @type: @@ -1016,11 +1046,11 @@ static bool reguser_kvs_fnc_mask(KviKvsModuleFunctionCall * c) QString szName; QString szN; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("name",KVS_PT_STRING,0,szName) - KVSM_PARAMETER("N",KVS_PT_STRING,KVS_PF_OPTIONAL,szN) + KVSM_PARAMETER("name", KVS_PT_STRING, 0, szName) + KVSM_PARAMETER("N", KVS_PT_STRING, KVS_PF_OPTIONAL, szN) KVSM_PARAMETERS_END(c) - KviKvsArray* pArray = new KviKvsArray(); + KviKvsArray * pArray = new KviKvsArray(); KviRegisteredUser * u = g_pRegisteredUserDataBase->findUserByName(szName); if(u) { @@ -1028,13 +1058,16 @@ static bool reguser_kvs_fnc_mask(KviKvsModuleFunctionCall * c) if(n.hasData() && n.isUnsignedNum()) { KviIrcMask * m = u->maskList()->at(n.toInt()); - if(m) c->returnValue()->setString(m->nick()+"!"+m->user()+"@"+m->host()); - } else { - int aid=0; + if(m) + c->returnValue()->setString(m->nick() + "!" + m->user() + "@" + m->host()); + } + else + { + int aid = 0; - for(KviIrcMask * m = u->maskList()->first();m;m = u->maskList()->next()) + for(KviIrcMask * m = u->maskList()->first(); m; m = u->maskList()->next()) { - pArray->set(aid,new KviKvsVariant(QString(m->nick()+"!"+m->user()+"@"+m->host()))); + pArray->set(aid, new KviKvsVariant(QString(m->nick() + "!" + m->user() + "@" + m->host()))); aid++; } c->returnValue()->setArray(pArray); @@ -1079,15 +1112,15 @@ static bool reguser_kvs_fnc_property(KviKvsModuleFunctionCall * c) QString szName; QString szProperty; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("user_name",KVS_PT_STRING,0,szName) - KVSM_PARAMETER("property_name",KVS_PT_STRING,KVS_PF_OPTIONAL,szProperty) + KVSM_PARAMETER("user_name", KVS_PT_STRING, 0, szName) + KVSM_PARAMETER("property_name", KVS_PT_STRING, KVS_PF_OPTIONAL, szProperty) KVSM_PARAMETERS_END(c) KviRegisteredUser * u = g_pRegisteredUserDataBase->findUserByName(szName); if(u) { QString tmp; - u->getProperty(szProperty,tmp); + u->getProperty(szProperty, tmp); c->returnValue()->setString(tmp); } return true; @@ -1132,18 +1165,18 @@ static bool reguser_kvs_fnc_matchProperty(KviKvsModuleFunctionCall * c) QString szMask; QString szProperty; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("user_mask",KVS_PT_STRING,0,szMask) - KVSM_PARAMETER("property_name",KVS_PT_STRING,KVS_PF_OPTIONAL,szProperty) + KVSM_PARAMETER("user_mask", KVS_PT_STRING, 0, szMask) + KVSM_PARAMETER("property_name", KVS_PT_STRING, KVS_PF_OPTIONAL, szProperty) KVSM_PARAMETERS_END(c) KviIrcMask mask(szMask); //FIXME: it crashes kvirc //KviRegisteredUser * u = c->context()->connection()->userDataBase()->registeredUser(mask.nick(),mask.user(),mask.host()); - KviRegisteredUser * u = g_pRegisteredUserDataBase->findMatchingUser(mask.nick(),mask.user(),mask.host()); + KviRegisteredUser * u = g_pRegisteredUserDataBase->findMatchingUser(mask.nick(), mask.user(), mask.host()); if(u) { QString tmp; - u->getProperty(szProperty,tmp); + u->getProperty(szProperty, tmp); c->returnValue()->setString(tmp); } return true; @@ -1174,7 +1207,7 @@ static bool reguser_kvs_cmd_wizard(KviKvsModuleCommandCall * c) { QString szMask; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("mask",KVS_PT_STRING,KVS_PF_OPTIONAL,szMask) + KVSM_PARAMETER("mask", KVS_PT_STRING, KVS_PF_OPTIONAL, szMask) KVSM_PARAMETERS_END(c) RegistrationWizard * w = new RegistrationWizard(szMask); @@ -1188,35 +1221,37 @@ static bool reguser_module_init(KviModule * m) g_pRegistrationWizardList = new KviPointerList; g_pRegistrationWizardList->setAutoDelete(true); - KVSM_REGISTER_SIMPLE_COMMAND(m,"add",reguser_kvs_cmd_add); - KVSM_REGISTER_SIMPLE_COMMAND(m,"remove",reguser_kvs_cmd_remove); - KVSM_REGISTER_SIMPLE_COMMAND(m,"addmask",reguser_kvs_cmd_addmask); - KVSM_REGISTER_SIMPLE_COMMAND(m,"delmask",reguser_kvs_cmd_delmask); - KVSM_REGISTER_SIMPLE_COMMAND(m,"edit",reguser_kvs_cmd_edit); - KVSM_REGISTER_SIMPLE_COMMAND(m,"showlist",reguser_kvs_cmd_showlist); - KVSM_REGISTER_SIMPLE_COMMAND(m,"setproperty",reguser_kvs_cmd_setproperty); - KVSM_REGISTER_SIMPLE_COMMAND(m,"wizard",reguser_kvs_cmd_wizard); - KVSM_REGISTER_SIMPLE_COMMAND(m,"setIgnoreEnabled",reguser_kvs_cmd_setIgnoreEnabled); - KVSM_REGISTER_SIMPLE_COMMAND(m,"setIgnoreFlags",reguser_kvs_cmd_setIgnoreFlags); - - KVSM_REGISTER_FUNCTION(m,"match",reguser_kvs_fnc_match); - KVSM_REGISTER_FUNCTION(m,"list",reguser_kvs_fnc_list); - KVSM_REGISTER_FUNCTION(m,"exactMatch",reguser_kvs_fnc_exactMatch); - KVSM_REGISTER_FUNCTION(m,"mask",reguser_kvs_fnc_mask); - KVSM_REGISTER_FUNCTION(m,"property",reguser_kvs_fnc_property); - KVSM_REGISTER_FUNCTION(m,"matchProperty",reguser_kvs_fnc_matchProperty); - KVSM_REGISTER_FUNCTION(m,"getIgnoreFlags",reguser_kvs_fnc_getIgnoreFlags); - KVSM_REGISTER_FUNCTION(m,"isIgnoreEnabled",reguser_kvs_fnc_isIgnoreEnabled); + KVSM_REGISTER_SIMPLE_COMMAND(m, "add", reguser_kvs_cmd_add); + KVSM_REGISTER_SIMPLE_COMMAND(m, "remove", reguser_kvs_cmd_remove); + KVSM_REGISTER_SIMPLE_COMMAND(m, "addmask", reguser_kvs_cmd_addmask); + KVSM_REGISTER_SIMPLE_COMMAND(m, "delmask", reguser_kvs_cmd_delmask); + KVSM_REGISTER_SIMPLE_COMMAND(m, "edit", reguser_kvs_cmd_edit); + KVSM_REGISTER_SIMPLE_COMMAND(m, "showlist", reguser_kvs_cmd_showlist); + KVSM_REGISTER_SIMPLE_COMMAND(m, "setproperty", reguser_kvs_cmd_setproperty); + KVSM_REGISTER_SIMPLE_COMMAND(m, "wizard", reguser_kvs_cmd_wizard); + KVSM_REGISTER_SIMPLE_COMMAND(m, "setIgnoreEnabled", reguser_kvs_cmd_setIgnoreEnabled); + KVSM_REGISTER_SIMPLE_COMMAND(m, "setIgnoreFlags", reguser_kvs_cmd_setIgnoreFlags); + + KVSM_REGISTER_FUNCTION(m, "match", reguser_kvs_fnc_match); + KVSM_REGISTER_FUNCTION(m, "list", reguser_kvs_fnc_list); + KVSM_REGISTER_FUNCTION(m, "exactMatch", reguser_kvs_fnc_exactMatch); + KVSM_REGISTER_FUNCTION(m, "mask", reguser_kvs_fnc_mask); + KVSM_REGISTER_FUNCTION(m, "property", reguser_kvs_fnc_property); + KVSM_REGISTER_FUNCTION(m, "matchProperty", reguser_kvs_fnc_matchProperty); + KVSM_REGISTER_FUNCTION(m, "getIgnoreFlags", reguser_kvs_fnc_getIgnoreFlags); + KVSM_REGISTER_FUNCTION(m, "isIgnoreEnabled", reguser_kvs_fnc_isIgnoreEnabled); return true; } static bool reguser_module_cleanup(KviModule *) { - if(g_pRegisteredUsersDialog)delete g_pRegisteredUsersDialog; + if(g_pRegisteredUsersDialog) + delete g_pRegisteredUsersDialog; g_pRegisteredUsersDialog = 0; - while(RegistrationWizard * w = g_pRegistrationWizardList->first())delete w; + while(RegistrationWizard * w = g_pRegistrationWizardList->first()) + delete w; delete g_pRegistrationWizardList; g_pRegistrationWizardList = 0; @@ -1230,13 +1265,12 @@ static bool reguser_module_can_unload(KviModule *) } KVIRC_MODULE( - "Reguser", // module name - "4.0.0", // module version - "Copyright (C) 2002 Szymon Stefanek (pragma at kvirc dot net)", // author & (C) - "Script interface to the registered users database", - reguser_module_init, - reguser_module_can_unload, - 0, - reguser_module_cleanup, - "register" -) + "Reguser", // module name + "4.0.0", // module version + "Copyright (C) 2002 Szymon Stefanek (pragma at kvirc dot net)", // author & (C) + "Script interface to the registered users database", + reguser_module_init, + reguser_module_can_unload, + 0, + reguser_module_cleanup, + "register") diff --git a/src/modules/rijndael/BlowFish.cpp b/src/modules/rijndael/BlowFish.cpp index 3dbd8f0b2..3b63239a6 100644 --- a/src/modules/rijndael/BlowFish.cpp +++ b/src/modules/rijndael/BlowFish.cpp @@ -28,7 +28,6 @@ #ifdef COMPILE_CRYPT_SUPPORT - //Initialization with a fixed string which consists of the hexadecimal digits of PI (less the initial 3) //P-array, 18 32-bit subkeys const unsigned int BlowFish::scm_auiInitP[18] = { @@ -42,276 +41,276 @@ const unsigned int BlowFish::scm_auiInitP[18] = { //Four 32-bit S-boxes with 256 entries each const unsigned int BlowFish::scm_auiInitS[4][256] = { //0 - {0xd1310ba6, 0x98dfb5ac, 0x2ffd72db, 0xd01adfb7, - 0xb8e1afed, 0x6a267e96, 0xba7c9045, 0xf12c7f99, - 0x24a19947, 0xb3916cf7, 0x0801f2e2, 0x858efc16, - 0x636920d8, 0x71574e69, 0xa458fea3, 0xf4933d7e, - 0x0d95748f, 0x728eb658, 0x718bcd58, 0x82154aee, - 0x7b54a41d, 0xc25a59b5, 0x9c30d539, 0x2af26013, - 0xc5d1b023, 0x286085f0, 0xca417918, 0xb8db38ef, - 0x8e79dcb0, 0x603a180e, 0x6c9e0e8b, 0xb01e8a3e, - 0xd71577c1, 0xbd314b27, 0x78af2fda, 0x55605c60, - 0xe65525f3, 0xaa55ab94, 0x57489862, 0x63e81440, - 0x55ca396a, 0x2aab10b6, 0xb4cc5c34, 0x1141e8ce, - 0xa15486af, 0x7c72e993, 0xb3ee1411, 0x636fbc2a, - 0x2ba9c55d, 0x741831f6, 0xce5c3e16, 0x9b87931e, - 0xafd6ba33, 0x6c24cf5c, 0x7a325381, 0x28958677, - 0x3b8f4898, 0x6b4bb9af, 0xc4bfe81b, 0x66282193, - 0x61d809cc, 0xfb21a991, 0x487cac60, 0x5dec8032, - 0xef845d5d, 0xe98575b1, 0xdc262302, 0xeb651b88, - 0x23893e81, 0xd396acc5, 0x0f6d6ff3, 0x83f44239, - 0x2e0b4482, 0xa4842004, 0x69c8f04a, 0x9e1f9b5e, - 0x21c66842, 0xf6e96c9a, 0x670c9c61, 0xabd388f0, - 0x6a51a0d2, 0xd8542f68, 0x960fa728, 0xab5133a3, - 0x6eef0b6c, 0x137a3be4, 0xba3bf050, 0x7efb2a98, - 0xa1f1651d, 0x39af0176, 0x66ca593e, 0x82430e88, - 0x8cee8619, 0x456f9fb4, 0x7d84a5c3, 0x3b8b5ebe, - 0xe06f75d8, 0x85c12073, 0x401a449f, 0x56c16aa6, - 0x4ed3aa62, 0x363f7706, 0x1bfedf72, 0x429b023d, - 0x37d0d724, 0xd00a1248, 0xdb0fead3, 0x49f1c09b, - 0x075372c9, 0x80991b7b, 0x25d479d8, 0xf6e8def7, - 0xe3fe501a, 0xb6794c3b, 0x976ce0bd, 0x04c006ba, - 0xc1a94fb6, 0x409f60c4, 0x5e5c9ec2, 0x196a2463, - 0x68fb6faf, 0x3e6c53b5, 0x1339b2eb, 0x3b52ec6f, - 0x6dfc511f, 0x9b30952c, 0xcc814544, 0xaf5ebd09, - 0xbee3d004, 0xde334afd, 0x660f2807, 0x192e4bb3, - 0xc0cba857, 0x45c8740f, 0xd20b5f39, 0xb9d3fbdb, - 0x5579c0bd, 0x1a60320a, 0xd6a100c6, 0x402c7279, - 0x679f25fe, 0xfb1fa3cc, 0x8ea5e9f8, 0xdb3222f8, - 0x3c7516df, 0xfd616b15, 0x2f501ec8, 0xad0552ab, - 0x323db5fa, 0xfd238760, 0x53317b48, 0x3e00df82, - 0x9e5c57bb, 0xca6f8ca0, 0x1a87562e, 0xdf1769db, - 0xd542a8f6, 0x287effc3, 0xac6732c6, 0x8c4f5573, - 0x695b27b0, 0xbbca58c8, 0xe1ffa35d, 0xb8f011a0, - 0x10fa3d98, 0xfd2183b8, 0x4afcb56c, 0x2dd1d35b, - 0x9a53e479, 0xb6f84565, 0xd28e49bc, 0x4bfb9790, - 0xe1ddf2da, 0xa4cb7e33, 0x62fb1341, 0xcee4c6e8, - 0xef20cada, 0x36774c01, 0xd07e9efe, 0x2bf11fb4, - 0x95dbda4d, 0xae909198, 0xeaad8e71, 0x6b93d5a0, - 0xd08ed1d0, 0xafc725e0, 0x8e3c5b2f, 0x8e7594b7, - 0x8ff6e2fb, 0xf2122b64, 0x8888b812, 0x900df01c, - 0x4fad5ea0, 0x688fc31c, 0xd1cff191, 0xb3a8c1ad, - 0x2f2f2218, 0xbe0e1777, 0xea752dfe, 0x8b021fa1, - 0xe5a0cc0f, 0xb56f74e8, 0x18acf3d6, 0xce89e299, - 0xb4a84fe0, 0xfd13e0b7, 0x7cc43b81, 0xd2ada8d9, - 0x165fa266, 0x80957705, 0x93cc7314, 0x211a1477, - 0xe6ad2065, 0x77b5fa86, 0xc75442f5, 0xfb9d35cf, - 0xebcdaf0c, 0x7b3e89a0, 0xd6411bd3, 0xae1e7e49, - 0x00250e2d, 0x2071b35e, 0x226800bb, 0x57b8e0af, - 0x2464369b, 0xf009b91e, 0x5563911d, 0x59dfa6aa, - 0x78c14389, 0xd95a537f, 0x207d5ba2, 0x02e5b9c5, - 0x83260376, 0x6295cfa9, 0x11c81968, 0x4e734a41, - 0xb3472dca, 0x7b14a94a, 0x1b510052, 0x9a532915, - 0xd60f573f, 0xbc9bc6e4, 0x2b60a476, 0x81e67400, - 0x08ba6fb5, 0x571be91f, 0xf296ec6b, 0x2a0dd915, - 0xb6636521, 0xe7b9f9b6, 0xff34052e, 0xc5855664, - 0x53b02d5d, 0xa99f8fa1, 0x08ba4799, 0x6e85076a}, + { 0xd1310ba6, 0x98dfb5ac, 0x2ffd72db, 0xd01adfb7, + 0xb8e1afed, 0x6a267e96, 0xba7c9045, 0xf12c7f99, + 0x24a19947, 0xb3916cf7, 0x0801f2e2, 0x858efc16, + 0x636920d8, 0x71574e69, 0xa458fea3, 0xf4933d7e, + 0x0d95748f, 0x728eb658, 0x718bcd58, 0x82154aee, + 0x7b54a41d, 0xc25a59b5, 0x9c30d539, 0x2af26013, + 0xc5d1b023, 0x286085f0, 0xca417918, 0xb8db38ef, + 0x8e79dcb0, 0x603a180e, 0x6c9e0e8b, 0xb01e8a3e, + 0xd71577c1, 0xbd314b27, 0x78af2fda, 0x55605c60, + 0xe65525f3, 0xaa55ab94, 0x57489862, 0x63e81440, + 0x55ca396a, 0x2aab10b6, 0xb4cc5c34, 0x1141e8ce, + 0xa15486af, 0x7c72e993, 0xb3ee1411, 0x636fbc2a, + 0x2ba9c55d, 0x741831f6, 0xce5c3e16, 0x9b87931e, + 0xafd6ba33, 0x6c24cf5c, 0x7a325381, 0x28958677, + 0x3b8f4898, 0x6b4bb9af, 0xc4bfe81b, 0x66282193, + 0x61d809cc, 0xfb21a991, 0x487cac60, 0x5dec8032, + 0xef845d5d, 0xe98575b1, 0xdc262302, 0xeb651b88, + 0x23893e81, 0xd396acc5, 0x0f6d6ff3, 0x83f44239, + 0x2e0b4482, 0xa4842004, 0x69c8f04a, 0x9e1f9b5e, + 0x21c66842, 0xf6e96c9a, 0x670c9c61, 0xabd388f0, + 0x6a51a0d2, 0xd8542f68, 0x960fa728, 0xab5133a3, + 0x6eef0b6c, 0x137a3be4, 0xba3bf050, 0x7efb2a98, + 0xa1f1651d, 0x39af0176, 0x66ca593e, 0x82430e88, + 0x8cee8619, 0x456f9fb4, 0x7d84a5c3, 0x3b8b5ebe, + 0xe06f75d8, 0x85c12073, 0x401a449f, 0x56c16aa6, + 0x4ed3aa62, 0x363f7706, 0x1bfedf72, 0x429b023d, + 0x37d0d724, 0xd00a1248, 0xdb0fead3, 0x49f1c09b, + 0x075372c9, 0x80991b7b, 0x25d479d8, 0xf6e8def7, + 0xe3fe501a, 0xb6794c3b, 0x976ce0bd, 0x04c006ba, + 0xc1a94fb6, 0x409f60c4, 0x5e5c9ec2, 0x196a2463, + 0x68fb6faf, 0x3e6c53b5, 0x1339b2eb, 0x3b52ec6f, + 0x6dfc511f, 0x9b30952c, 0xcc814544, 0xaf5ebd09, + 0xbee3d004, 0xde334afd, 0x660f2807, 0x192e4bb3, + 0xc0cba857, 0x45c8740f, 0xd20b5f39, 0xb9d3fbdb, + 0x5579c0bd, 0x1a60320a, 0xd6a100c6, 0x402c7279, + 0x679f25fe, 0xfb1fa3cc, 0x8ea5e9f8, 0xdb3222f8, + 0x3c7516df, 0xfd616b15, 0x2f501ec8, 0xad0552ab, + 0x323db5fa, 0xfd238760, 0x53317b48, 0x3e00df82, + 0x9e5c57bb, 0xca6f8ca0, 0x1a87562e, 0xdf1769db, + 0xd542a8f6, 0x287effc3, 0xac6732c6, 0x8c4f5573, + 0x695b27b0, 0xbbca58c8, 0xe1ffa35d, 0xb8f011a0, + 0x10fa3d98, 0xfd2183b8, 0x4afcb56c, 0x2dd1d35b, + 0x9a53e479, 0xb6f84565, 0xd28e49bc, 0x4bfb9790, + 0xe1ddf2da, 0xa4cb7e33, 0x62fb1341, 0xcee4c6e8, + 0xef20cada, 0x36774c01, 0xd07e9efe, 0x2bf11fb4, + 0x95dbda4d, 0xae909198, 0xeaad8e71, 0x6b93d5a0, + 0xd08ed1d0, 0xafc725e0, 0x8e3c5b2f, 0x8e7594b7, + 0x8ff6e2fb, 0xf2122b64, 0x8888b812, 0x900df01c, + 0x4fad5ea0, 0x688fc31c, 0xd1cff191, 0xb3a8c1ad, + 0x2f2f2218, 0xbe0e1777, 0xea752dfe, 0x8b021fa1, + 0xe5a0cc0f, 0xb56f74e8, 0x18acf3d6, 0xce89e299, + 0xb4a84fe0, 0xfd13e0b7, 0x7cc43b81, 0xd2ada8d9, + 0x165fa266, 0x80957705, 0x93cc7314, 0x211a1477, + 0xe6ad2065, 0x77b5fa86, 0xc75442f5, 0xfb9d35cf, + 0xebcdaf0c, 0x7b3e89a0, 0xd6411bd3, 0xae1e7e49, + 0x00250e2d, 0x2071b35e, 0x226800bb, 0x57b8e0af, + 0x2464369b, 0xf009b91e, 0x5563911d, 0x59dfa6aa, + 0x78c14389, 0xd95a537f, 0x207d5ba2, 0x02e5b9c5, + 0x83260376, 0x6295cfa9, 0x11c81968, 0x4e734a41, + 0xb3472dca, 0x7b14a94a, 0x1b510052, 0x9a532915, + 0xd60f573f, 0xbc9bc6e4, 0x2b60a476, 0x81e67400, + 0x08ba6fb5, 0x571be91f, 0xf296ec6b, 0x2a0dd915, + 0xb6636521, 0xe7b9f9b6, 0xff34052e, 0xc5855664, + 0x53b02d5d, 0xa99f8fa1, 0x08ba4799, 0x6e85076a }, //1 - {0x4b7a70e9, 0xb5b32944, 0xdb75092e, 0xc4192623, - 0xad6ea6b0, 0x49a7df7d, 0x9cee60b8, 0x8fedb266, - 0xecaa8c71, 0x699a17ff, 0x5664526c, 0xc2b19ee1, - 0x193602a5, 0x75094c29, 0xa0591340, 0xe4183a3e, - 0x3f54989a, 0x5b429d65, 0x6b8fe4d6, 0x99f73fd6, - 0xa1d29c07, 0xefe830f5, 0x4d2d38e6, 0xf0255dc1, - 0x4cdd2086, 0x8470eb26, 0x6382e9c6, 0x021ecc5e, - 0x09686b3f, 0x3ebaefc9, 0x3c971814, 0x6b6a70a1, - 0x687f3584, 0x52a0e286, 0xb79c5305, 0xaa500737, - 0x3e07841c, 0x7fdeae5c, 0x8e7d44ec, 0x5716f2b8, - 0xb03ada37, 0xf0500c0d, 0xf01c1f04, 0x0200b3ff, - 0xae0cf51a, 0x3cb574b2, 0x25837a58, 0xdc0921bd, - 0xd19113f9, 0x7ca92ff6, 0x94324773, 0x22f54701, - 0x3ae5e581, 0x37c2dadc, 0xc8b57634, 0x9af3dda7, - 0xa9446146, 0x0fd0030e, 0xecc8c73e, 0xa4751e41, - 0xe238cd99, 0x3bea0e2f, 0x3280bba1, 0x183eb331, - 0x4e548b38, 0x4f6db908, 0x6f420d03, 0xf60a04bf, - 0x2cb81290, 0x24977c79, 0x5679b072, 0xbcaf89af, - 0xde9a771f, 0xd9930810, 0xb38bae12, 0xdccf3f2e, - 0x5512721f, 0x2e6b7124, 0x501adde6, 0x9f84cd87, - 0x7a584718, 0x7408da17, 0xbc9f9abc, 0xe94b7d8c, - 0xec7aec3a, 0xdb851dfa, 0x63094366, 0xc464c3d2, - 0xef1c1847, 0x3215d908, 0xdd433b37, 0x24c2ba16, - 0x12a14d43, 0x2a65c451, 0x50940002, 0x133ae4dd, - 0x71dff89e, 0x10314e55, 0x81ac77d6, 0x5f11199b, - 0x043556f1, 0xd7a3c76b, 0x3c11183b, 0x5924a509, - 0xf28fe6ed, 0x97f1fbfa, 0x9ebabf2c, 0x1e153c6e, - 0x86e34570, 0xeae96fb1, 0x860e5e0a, 0x5a3e2ab3, - 0x771fe71c, 0x4e3d06fa, 0x2965dcb9, 0x99e71d0f, - 0x803e89d6, 0x5266c825, 0x2e4cc978, 0x9c10b36a, - 0xc6150eba, 0x94e2ea78, 0xa5fc3c53, 0x1e0a2df4, - 0xf2f74ea7, 0x361d2b3d, 0x1939260f, 0x19c27960, - 0x5223a708, 0xf71312b6, 0xebadfe6e, 0xeac31f66, - 0xe3bc4595, 0xa67bc883, 0xb17f37d1, 0x018cff28, - 0xc332ddef, 0xbe6c5aa5, 0x65582185, 0x68ab9802, - 0xeecea50f, 0xdb2f953b, 0x2aef7dad, 0x5b6e2f84, - 0x1521b628, 0x29076170, 0xecdd4775, 0x619f1510, - 0x13cca830, 0xeb61bd96, 0x0334fe1e, 0xaa0363cf, - 0xb5735c90, 0x4c70a239, 0xd59e9e0b, 0xcbaade14, - 0xeecc86bc, 0x60622ca7, 0x9cab5cab, 0xb2f3846e, - 0x648b1eaf, 0x19bdf0ca, 0xa02369b9, 0x655abb50, - 0x40685a32, 0x3c2ab4b3, 0x319ee9d5, 0xc021b8f7, - 0x9b540b19, 0x875fa099, 0x95f7997e, 0x623d7da8, - 0xf837889a, 0x97e32d77, 0x11ed935f, 0x16681281, - 0x0e358829, 0xc7e61fd6, 0x96dedfa1, 0x7858ba99, - 0x57f584a5, 0x1b227263, 0x9b83c3ff, 0x1ac24696, - 0xcdb30aeb, 0x532e3054, 0x8fd948e4, 0x6dbc3128, - 0x58ebf2ef, 0x34c6ffea, 0xfe28ed61, 0xee7c3c73, - 0x5d4a14d9, 0xe864b7e3, 0x42105d14, 0x203e13e0, - 0x45eee2b6, 0xa3aaabea, 0xdb6c4f15, 0xfacb4fd0, - 0xc742f442, 0xef6abbb5, 0x654f3b1d, 0x41cd2105, - 0xd81e799e, 0x86854dc7, 0xe44b476a, 0x3d816250, - 0xcf62a1f2, 0x5b8d2646, 0xfc8883a0, 0xc1c7b6a3, - 0x7f1524c3, 0x69cb7492, 0x47848a0b, 0x5692b285, - 0x095bbf00, 0xad19489d, 0x1462b174, 0x23820e00, - 0x58428d2a, 0x0c55f5ea, 0x1dadf43e, 0x233f7061, - 0x3372f092, 0x8d937e41, 0xd65fecf1, 0x6c223bdb, - 0x7cde3759, 0xcbee7460, 0x4085f2a7, 0xce77326e, - 0xa6078084, 0x19f8509e, 0xe8efd855, 0x61d99735, - 0xa969a7aa, 0xc50c06c2, 0x5a04abfc, 0x800bcadc, - 0x9e447a2e, 0xc3453484, 0xfdd56705, 0x0e1e9ec9, - 0xdb73dbd3, 0x105588cd, 0x675fda79, 0xe3674340, - 0xc5c43465, 0x713e38d8, 0x3d28f89e, 0xf16dff20, - 0x153e21e7, 0x8fb03d4a, 0xe6e39f2b, 0xdb83adf7}, + { 0x4b7a70e9, 0xb5b32944, 0xdb75092e, 0xc4192623, + 0xad6ea6b0, 0x49a7df7d, 0x9cee60b8, 0x8fedb266, + 0xecaa8c71, 0x699a17ff, 0x5664526c, 0xc2b19ee1, + 0x193602a5, 0x75094c29, 0xa0591340, 0xe4183a3e, + 0x3f54989a, 0x5b429d65, 0x6b8fe4d6, 0x99f73fd6, + 0xa1d29c07, 0xefe830f5, 0x4d2d38e6, 0xf0255dc1, + 0x4cdd2086, 0x8470eb26, 0x6382e9c6, 0x021ecc5e, + 0x09686b3f, 0x3ebaefc9, 0x3c971814, 0x6b6a70a1, + 0x687f3584, 0x52a0e286, 0xb79c5305, 0xaa500737, + 0x3e07841c, 0x7fdeae5c, 0x8e7d44ec, 0x5716f2b8, + 0xb03ada37, 0xf0500c0d, 0xf01c1f04, 0x0200b3ff, + 0xae0cf51a, 0x3cb574b2, 0x25837a58, 0xdc0921bd, + 0xd19113f9, 0x7ca92ff6, 0x94324773, 0x22f54701, + 0x3ae5e581, 0x37c2dadc, 0xc8b57634, 0x9af3dda7, + 0xa9446146, 0x0fd0030e, 0xecc8c73e, 0xa4751e41, + 0xe238cd99, 0x3bea0e2f, 0x3280bba1, 0x183eb331, + 0x4e548b38, 0x4f6db908, 0x6f420d03, 0xf60a04bf, + 0x2cb81290, 0x24977c79, 0x5679b072, 0xbcaf89af, + 0xde9a771f, 0xd9930810, 0xb38bae12, 0xdccf3f2e, + 0x5512721f, 0x2e6b7124, 0x501adde6, 0x9f84cd87, + 0x7a584718, 0x7408da17, 0xbc9f9abc, 0xe94b7d8c, + 0xec7aec3a, 0xdb851dfa, 0x63094366, 0xc464c3d2, + 0xef1c1847, 0x3215d908, 0xdd433b37, 0x24c2ba16, + 0x12a14d43, 0x2a65c451, 0x50940002, 0x133ae4dd, + 0x71dff89e, 0x10314e55, 0x81ac77d6, 0x5f11199b, + 0x043556f1, 0xd7a3c76b, 0x3c11183b, 0x5924a509, + 0xf28fe6ed, 0x97f1fbfa, 0x9ebabf2c, 0x1e153c6e, + 0x86e34570, 0xeae96fb1, 0x860e5e0a, 0x5a3e2ab3, + 0x771fe71c, 0x4e3d06fa, 0x2965dcb9, 0x99e71d0f, + 0x803e89d6, 0x5266c825, 0x2e4cc978, 0x9c10b36a, + 0xc6150eba, 0x94e2ea78, 0xa5fc3c53, 0x1e0a2df4, + 0xf2f74ea7, 0x361d2b3d, 0x1939260f, 0x19c27960, + 0x5223a708, 0xf71312b6, 0xebadfe6e, 0xeac31f66, + 0xe3bc4595, 0xa67bc883, 0xb17f37d1, 0x018cff28, + 0xc332ddef, 0xbe6c5aa5, 0x65582185, 0x68ab9802, + 0xeecea50f, 0xdb2f953b, 0x2aef7dad, 0x5b6e2f84, + 0x1521b628, 0x29076170, 0xecdd4775, 0x619f1510, + 0x13cca830, 0xeb61bd96, 0x0334fe1e, 0xaa0363cf, + 0xb5735c90, 0x4c70a239, 0xd59e9e0b, 0xcbaade14, + 0xeecc86bc, 0x60622ca7, 0x9cab5cab, 0xb2f3846e, + 0x648b1eaf, 0x19bdf0ca, 0xa02369b9, 0x655abb50, + 0x40685a32, 0x3c2ab4b3, 0x319ee9d5, 0xc021b8f7, + 0x9b540b19, 0x875fa099, 0x95f7997e, 0x623d7da8, + 0xf837889a, 0x97e32d77, 0x11ed935f, 0x16681281, + 0x0e358829, 0xc7e61fd6, 0x96dedfa1, 0x7858ba99, + 0x57f584a5, 0x1b227263, 0x9b83c3ff, 0x1ac24696, + 0xcdb30aeb, 0x532e3054, 0x8fd948e4, 0x6dbc3128, + 0x58ebf2ef, 0x34c6ffea, 0xfe28ed61, 0xee7c3c73, + 0x5d4a14d9, 0xe864b7e3, 0x42105d14, 0x203e13e0, + 0x45eee2b6, 0xa3aaabea, 0xdb6c4f15, 0xfacb4fd0, + 0xc742f442, 0xef6abbb5, 0x654f3b1d, 0x41cd2105, + 0xd81e799e, 0x86854dc7, 0xe44b476a, 0x3d816250, + 0xcf62a1f2, 0x5b8d2646, 0xfc8883a0, 0xc1c7b6a3, + 0x7f1524c3, 0x69cb7492, 0x47848a0b, 0x5692b285, + 0x095bbf00, 0xad19489d, 0x1462b174, 0x23820e00, + 0x58428d2a, 0x0c55f5ea, 0x1dadf43e, 0x233f7061, + 0x3372f092, 0x8d937e41, 0xd65fecf1, 0x6c223bdb, + 0x7cde3759, 0xcbee7460, 0x4085f2a7, 0xce77326e, + 0xa6078084, 0x19f8509e, 0xe8efd855, 0x61d99735, + 0xa969a7aa, 0xc50c06c2, 0x5a04abfc, 0x800bcadc, + 0x9e447a2e, 0xc3453484, 0xfdd56705, 0x0e1e9ec9, + 0xdb73dbd3, 0x105588cd, 0x675fda79, 0xe3674340, + 0xc5c43465, 0x713e38d8, 0x3d28f89e, 0xf16dff20, + 0x153e21e7, 0x8fb03d4a, 0xe6e39f2b, 0xdb83adf7 }, //2 - {0xe93d5a68, 0x948140f7, 0xf64c261c, 0x94692934, - 0x411520f7, 0x7602d4f7, 0xbcf46b2e, 0xd4a20068, - 0xd4082471, 0x3320f46a, 0x43b7d4b7, 0x500061af, - 0x1e39f62e, 0x97244546, 0x14214f74, 0xbf8b8840, - 0x4d95fc1d, 0x96b591af, 0x70f4ddd3, 0x66a02f45, - 0xbfbc09ec, 0x03bd9785, 0x7fac6dd0, 0x31cb8504, - 0x96eb27b3, 0x55fd3941, 0xda2547e6, 0xabca0a9a, - 0x28507825, 0x530429f4, 0x0a2c86da, 0xe9b66dfb, - 0x68dc1462, 0xd7486900, 0x680ec0a4, 0x27a18dee, - 0x4f3ffea2, 0xe887ad8c, 0xb58ce006, 0x7af4d6b6, - 0xaace1e7c, 0xd3375fec, 0xce78a399, 0x406b2a42, - 0x20fe9e35, 0xd9f385b9, 0xee39d7ab, 0x3b124e8b, - 0x1dc9faf7, 0x4b6d1856, 0x26a36631, 0xeae397b2, - 0x3a6efa74, 0xdd5b4332, 0x6841e7f7, 0xca7820fb, - 0xfb0af54e, 0xd8feb397, 0x454056ac, 0xba489527, - 0x55533a3a, 0x20838d87, 0xfe6ba9b7, 0xd096954b, - 0x55a867bc, 0xa1159a58, 0xcca92963, 0x99e1db33, - 0xa62a4a56, 0x3f3125f9, 0x5ef47e1c, 0x9029317c, - 0xfdf8e802, 0x04272f70, 0x80bb155c, 0x05282ce3, - 0x95c11548, 0xe4c66d22, 0x48c1133f, 0xc70f86dc, - 0x07f9c9ee, 0x41041f0f, 0x404779a4, 0x5d886e17, - 0x325f51eb, 0xd59bc0d1, 0xf2bcc18f, 0x41113564, - 0x257b7834, 0x602a9c60, 0xdff8e8a3, 0x1f636c1b, - 0x0e12b4c2, 0x02e1329e, 0xaf664fd1, 0xcad18115, - 0x6b2395e0, 0x333e92e1, 0x3b240b62, 0xeebeb922, - 0x85b2a20e, 0xe6ba0d99, 0xde720c8c, 0x2da2f728, - 0xd0127845, 0x95b794fd, 0x647d0862, 0xe7ccf5f0, - 0x5449a36f, 0x877d48fa, 0xc39dfd27, 0xf33e8d1e, - 0x0a476341, 0x992eff74, 0x3a6f6eab, 0xf4f8fd37, - 0xa812dc60, 0xa1ebddf8, 0x991be14c, 0xdb6e6b0d, - 0xc67b5510, 0x6d672c37, 0x2765d43b, 0xdcd0e804, - 0xf1290dc7, 0xcc00ffa3, 0xb5390f92, 0x690fed0b, - 0x667b9ffb, 0xcedb7d9c, 0xa091cf0b, 0xd9155ea3, - 0xbb132f88, 0x515bad24, 0x7b9479bf, 0x763bd6eb, - 0x37392eb3, 0xcc115979, 0x8026e297, 0xf42e312d, - 0x6842ada7, 0xc66a2b3b, 0x12754ccc, 0x782ef11c, - 0x6a124237, 0xb79251e7, 0x06a1bbe6, 0x4bfb6350, - 0x1a6b1018, 0x11caedfa, 0x3d25bdd8, 0xe2e1c3c9, - 0x44421659, 0x0a121386, 0xd90cec6e, 0xd5abea2a, - 0x64af674e, 0xda86a85f, 0xbebfe988, 0x64e4c3fe, - 0x9dbc8057, 0xf0f7c086, 0x60787bf8, 0x6003604d, - 0xd1fd8346, 0xf6381fb0, 0x7745ae04, 0xd736fccc, - 0x83426b33, 0xf01eab71, 0xb0804187, 0x3c005e5f, - 0x77a057be, 0xbde8ae24, 0x55464299, 0xbf582e61, - 0x4e58f48f, 0xf2ddfda2, 0xf474ef38, 0x8789bdc2, - 0x5366f9c3, 0xc8b38e74, 0xb475f255, 0x46fcd9b9, - 0x7aeb2661, 0x8b1ddf84, 0x846a0e79, 0x915f95e2, - 0x466e598e, 0x20b45770, 0x8cd55591, 0xc902de4c, - 0xb90bace1, 0xbb8205d0, 0x11a86248, 0x7574a99e, - 0xb77f19b6, 0xe0a9dc09, 0x662d09a1, 0xc4324633, - 0xe85a1f02, 0x09f0be8c, 0x4a99a025, 0x1d6efe10, - 0x1ab93d1d, 0x0ba5a4df, 0xa186f20f, 0x2868f169, - 0xdcb7da83, 0x573906fe, 0xa1e2ce9b, 0x4fcd7f52, - 0x50115e01, 0xa70683fa, 0xa002b5c4, 0x0de6d027, - 0x9af88c27, 0x773f8641, 0xc3604c06, 0x61a806b5, - 0xf0177a28, 0xc0f586e0, 0x006058aa, 0x30dc7d62, - 0x11e69ed7, 0x2338ea63, 0x53c2dd94, 0xc2c21634, - 0xbbcbee56, 0x90bcb6de, 0xebfc7da1, 0xce591d76, - 0x6f05e409, 0x4b7c0188, 0x39720a3d, 0x7c927c24, - 0x86e3725f, 0x724d9db9, 0x1ac15bb4, 0xd39eb8fc, - 0xed545578, 0x08fca5b5, 0xd83d7cd3, 0x4dad0fc4, - 0x1e50ef5e, 0xb161e6f8, 0xa28514d9, 0x6c51133c, - 0x6fd5c7e7, 0x56e14ec4, 0x362abfce, 0xddc6c837, - 0xd79a3234, 0x92638212, 0x670efa8e, 0x406000e0}, + { 0xe93d5a68, 0x948140f7, 0xf64c261c, 0x94692934, + 0x411520f7, 0x7602d4f7, 0xbcf46b2e, 0xd4a20068, + 0xd4082471, 0x3320f46a, 0x43b7d4b7, 0x500061af, + 0x1e39f62e, 0x97244546, 0x14214f74, 0xbf8b8840, + 0x4d95fc1d, 0x96b591af, 0x70f4ddd3, 0x66a02f45, + 0xbfbc09ec, 0x03bd9785, 0x7fac6dd0, 0x31cb8504, + 0x96eb27b3, 0x55fd3941, 0xda2547e6, 0xabca0a9a, + 0x28507825, 0x530429f4, 0x0a2c86da, 0xe9b66dfb, + 0x68dc1462, 0xd7486900, 0x680ec0a4, 0x27a18dee, + 0x4f3ffea2, 0xe887ad8c, 0xb58ce006, 0x7af4d6b6, + 0xaace1e7c, 0xd3375fec, 0xce78a399, 0x406b2a42, + 0x20fe9e35, 0xd9f385b9, 0xee39d7ab, 0x3b124e8b, + 0x1dc9faf7, 0x4b6d1856, 0x26a36631, 0xeae397b2, + 0x3a6efa74, 0xdd5b4332, 0x6841e7f7, 0xca7820fb, + 0xfb0af54e, 0xd8feb397, 0x454056ac, 0xba489527, + 0x55533a3a, 0x20838d87, 0xfe6ba9b7, 0xd096954b, + 0x55a867bc, 0xa1159a58, 0xcca92963, 0x99e1db33, + 0xa62a4a56, 0x3f3125f9, 0x5ef47e1c, 0x9029317c, + 0xfdf8e802, 0x04272f70, 0x80bb155c, 0x05282ce3, + 0x95c11548, 0xe4c66d22, 0x48c1133f, 0xc70f86dc, + 0x07f9c9ee, 0x41041f0f, 0x404779a4, 0x5d886e17, + 0x325f51eb, 0xd59bc0d1, 0xf2bcc18f, 0x41113564, + 0x257b7834, 0x602a9c60, 0xdff8e8a3, 0x1f636c1b, + 0x0e12b4c2, 0x02e1329e, 0xaf664fd1, 0xcad18115, + 0x6b2395e0, 0x333e92e1, 0x3b240b62, 0xeebeb922, + 0x85b2a20e, 0xe6ba0d99, 0xde720c8c, 0x2da2f728, + 0xd0127845, 0x95b794fd, 0x647d0862, 0xe7ccf5f0, + 0x5449a36f, 0x877d48fa, 0xc39dfd27, 0xf33e8d1e, + 0x0a476341, 0x992eff74, 0x3a6f6eab, 0xf4f8fd37, + 0xa812dc60, 0xa1ebddf8, 0x991be14c, 0xdb6e6b0d, + 0xc67b5510, 0x6d672c37, 0x2765d43b, 0xdcd0e804, + 0xf1290dc7, 0xcc00ffa3, 0xb5390f92, 0x690fed0b, + 0x667b9ffb, 0xcedb7d9c, 0xa091cf0b, 0xd9155ea3, + 0xbb132f88, 0x515bad24, 0x7b9479bf, 0x763bd6eb, + 0x37392eb3, 0xcc115979, 0x8026e297, 0xf42e312d, + 0x6842ada7, 0xc66a2b3b, 0x12754ccc, 0x782ef11c, + 0x6a124237, 0xb79251e7, 0x06a1bbe6, 0x4bfb6350, + 0x1a6b1018, 0x11caedfa, 0x3d25bdd8, 0xe2e1c3c9, + 0x44421659, 0x0a121386, 0xd90cec6e, 0xd5abea2a, + 0x64af674e, 0xda86a85f, 0xbebfe988, 0x64e4c3fe, + 0x9dbc8057, 0xf0f7c086, 0x60787bf8, 0x6003604d, + 0xd1fd8346, 0xf6381fb0, 0x7745ae04, 0xd736fccc, + 0x83426b33, 0xf01eab71, 0xb0804187, 0x3c005e5f, + 0x77a057be, 0xbde8ae24, 0x55464299, 0xbf582e61, + 0x4e58f48f, 0xf2ddfda2, 0xf474ef38, 0x8789bdc2, + 0x5366f9c3, 0xc8b38e74, 0xb475f255, 0x46fcd9b9, + 0x7aeb2661, 0x8b1ddf84, 0x846a0e79, 0x915f95e2, + 0x466e598e, 0x20b45770, 0x8cd55591, 0xc902de4c, + 0xb90bace1, 0xbb8205d0, 0x11a86248, 0x7574a99e, + 0xb77f19b6, 0xe0a9dc09, 0x662d09a1, 0xc4324633, + 0xe85a1f02, 0x09f0be8c, 0x4a99a025, 0x1d6efe10, + 0x1ab93d1d, 0x0ba5a4df, 0xa186f20f, 0x2868f169, + 0xdcb7da83, 0x573906fe, 0xa1e2ce9b, 0x4fcd7f52, + 0x50115e01, 0xa70683fa, 0xa002b5c4, 0x0de6d027, + 0x9af88c27, 0x773f8641, 0xc3604c06, 0x61a806b5, + 0xf0177a28, 0xc0f586e0, 0x006058aa, 0x30dc7d62, + 0x11e69ed7, 0x2338ea63, 0x53c2dd94, 0xc2c21634, + 0xbbcbee56, 0x90bcb6de, 0xebfc7da1, 0xce591d76, + 0x6f05e409, 0x4b7c0188, 0x39720a3d, 0x7c927c24, + 0x86e3725f, 0x724d9db9, 0x1ac15bb4, 0xd39eb8fc, + 0xed545578, 0x08fca5b5, 0xd83d7cd3, 0x4dad0fc4, + 0x1e50ef5e, 0xb161e6f8, 0xa28514d9, 0x6c51133c, + 0x6fd5c7e7, 0x56e14ec4, 0x362abfce, 0xddc6c837, + 0xd79a3234, 0x92638212, 0x670efa8e, 0x406000e0 }, //3 - {0x3a39ce37, 0xd3faf5cf, 0xabc27737, 0x5ac52d1b, - 0x5cb0679e, 0x4fa33742, 0xd3822740, 0x99bc9bbe, - 0xd5118e9d, 0xbf0f7315, 0xd62d1c7e, 0xc700c47b, - 0xb78c1b6b, 0x21a19045, 0xb26eb1be, 0x6a366eb4, - 0x5748ab2f, 0xbc946e79, 0xc6a376d2, 0x6549c2c8, - 0x530ff8ee, 0x468dde7d, 0xd5730a1d, 0x4cd04dc6, - 0x2939bbdb, 0xa9ba4650, 0xac9526e8, 0xbe5ee304, - 0xa1fad5f0, 0x6a2d519a, 0x63ef8ce2, 0x9a86ee22, - 0xc089c2b8, 0x43242ef6, 0xa51e03aa, 0x9cf2d0a4, - 0x83c061ba, 0x9be96a4d, 0x8fe51550, 0xba645bd6, - 0x2826a2f9, 0xa73a3ae1, 0x4ba99586, 0xef5562e9, - 0xc72fefd3, 0xf752f7da, 0x3f046f69, 0x77fa0a59, - 0x80e4a915, 0x87b08601, 0x9b09e6ad, 0x3b3ee593, - 0xe990fd5a, 0x9e34d797, 0x2cf0b7d9, 0x022b8b51, - 0x96d5ac3a, 0x017da67d, 0xd1cf3ed6, 0x7c7d2d28, - 0x1f9f25cf, 0xadf2b89b, 0x5ad6b472, 0x5a88f54c, - 0xe029ac71, 0xe019a5e6, 0x47b0acfd, 0xed93fa9b, - 0xe8d3c48d, 0x283b57cc, 0xf8d56629, 0x79132e28, - 0x785f0191, 0xed756055, 0xf7960e44, 0xe3d35e8c, - 0x15056dd4, 0x88f46dba, 0x03a16125, 0x0564f0bd, - 0xc3eb9e15, 0x3c9057a2, 0x97271aec, 0xa93a072a, - 0x1b3f6d9b, 0x1e6321f5, 0xf59c66fb, 0x26dcf319, - 0x7533d928, 0xb155fdf5, 0x03563482, 0x8aba3cbb, - 0x28517711, 0xc20ad9f8, 0xabcc5167, 0xccad925f, - 0x4de81751, 0x3830dc8e, 0x379d5862, 0x9320f991, - 0xea7a90c2, 0xfb3e7bce, 0x5121ce64, 0x774fbe32, - 0xa8b6e37e, 0xc3293d46, 0x48de5369, 0x6413e680, - 0xa2ae0810, 0xdd6db224, 0x69852dfd, 0x09072166, - 0xb39a460a, 0x6445c0dd, 0x586cdecf, 0x1c20c8ae, - 0x5bbef7dd, 0x1b588d40, 0xccd2017f, 0x6bb4e3bb, - 0xdda26a7e, 0x3a59ff45, 0x3e350a44, 0xbcb4cdd5, - 0x72eacea8, 0xfa6484bb, 0x8d6612ae, 0xbf3c6f47, - 0xd29be463, 0x542f5d9e, 0xaec2771b, 0xf64e6370, - 0x740e0d8d, 0xe75b1357, 0xf8721671, 0xaf537d5d, - 0x4040cb08, 0x4eb4e2cc, 0x34d2466a, 0x0115af84, - 0xe1b00428, 0x95983a1d, 0x06b89fb4, 0xce6ea048, - 0x6f3f3b82, 0x3520ab82, 0x011a1d4b, 0x277227f8, - 0x611560b1, 0xe7933fdc, 0xbb3a792b, 0x344525bd, - 0xa08839e1, 0x51ce794b, 0x2f32c9b7, 0xa01fbac9, - 0xe01cc87e, 0xbcc7d1f6, 0xcf0111c3, 0xa1e8aac7, - 0x1a908749, 0xd44fbd9a, 0xd0dadecb, 0xd50ada38, - 0x0339c32a, 0xc6913667, 0x8df9317c, 0xe0b12b4f, - 0xf79e59b7, 0x43f5bb3a, 0xf2d519ff, 0x27d9459c, - 0xbf97222c, 0x15e6fc2a, 0x0f91fc71, 0x9b941525, - 0xfae59361, 0xceb69ceb, 0xc2a86459, 0x12baa8d1, - 0xb6c1075e, 0xe3056a0c, 0x10d25065, 0xcb03a442, - 0xe0ec6e0e, 0x1698db3b, 0x4c98a0be, 0x3278e964, - 0x9f1f9532, 0xe0d392df, 0xd3a0342b, 0x8971f21e, - 0x1b0a7441, 0x4ba3348c, 0xc5be7120, 0xc37632d8, - 0xdf359f8d, 0x9b992f2e, 0xe60b6f47, 0x0fe3f11d, - 0xe54cda54, 0x1edad891, 0xce6279cf, 0xcd3e7e6f, - 0x1618b166, 0xfd2c1d05, 0x848fd2c5, 0xf6fb2299, - 0xf523f357, 0xa6327623, 0x93a83531, 0x56cccd02, - 0xacf08162, 0x5a75ebb5, 0x6e163697, 0x88d273cc, - 0xde966292, 0x81b949d0, 0x4c50901b, 0x71c65614, - 0xe6c6c7bd, 0x327a140a, 0x45e1d006, 0xc3f27b9a, - 0xc9aa53fd, 0x62a80f00, 0xbb25bfe2, 0x35bdd2f6, - 0x71126905, 0xb2040222, 0xb6cbcf7c, 0xcd769c2b, - 0x53113ec0, 0x1640e3d3, 0x38abbd60, 0x2547adf0, - 0xba38209c, 0xf746ce76, 0x77afa1c5, 0x20756060, - 0x85cbfe4e, 0x8ae88dd8, 0x7aaaf9b0, 0x4cf9aa7e, - 0x1948c25c, 0x02fb8a8c, 0x01c36ae4, 0xd6ebe1f9, - 0x90d4f869, 0xa65cdea0, 0x3f09252d, 0xc208e69f, - 0xb74e6132, 0xce77e25b, 0x578fdfe3, 0x3ac372e6} + { 0x3a39ce37, 0xd3faf5cf, 0xabc27737, 0x5ac52d1b, + 0x5cb0679e, 0x4fa33742, 0xd3822740, 0x99bc9bbe, + 0xd5118e9d, 0xbf0f7315, 0xd62d1c7e, 0xc700c47b, + 0xb78c1b6b, 0x21a19045, 0xb26eb1be, 0x6a366eb4, + 0x5748ab2f, 0xbc946e79, 0xc6a376d2, 0x6549c2c8, + 0x530ff8ee, 0x468dde7d, 0xd5730a1d, 0x4cd04dc6, + 0x2939bbdb, 0xa9ba4650, 0xac9526e8, 0xbe5ee304, + 0xa1fad5f0, 0x6a2d519a, 0x63ef8ce2, 0x9a86ee22, + 0xc089c2b8, 0x43242ef6, 0xa51e03aa, 0x9cf2d0a4, + 0x83c061ba, 0x9be96a4d, 0x8fe51550, 0xba645bd6, + 0x2826a2f9, 0xa73a3ae1, 0x4ba99586, 0xef5562e9, + 0xc72fefd3, 0xf752f7da, 0x3f046f69, 0x77fa0a59, + 0x80e4a915, 0x87b08601, 0x9b09e6ad, 0x3b3ee593, + 0xe990fd5a, 0x9e34d797, 0x2cf0b7d9, 0x022b8b51, + 0x96d5ac3a, 0x017da67d, 0xd1cf3ed6, 0x7c7d2d28, + 0x1f9f25cf, 0xadf2b89b, 0x5ad6b472, 0x5a88f54c, + 0xe029ac71, 0xe019a5e6, 0x47b0acfd, 0xed93fa9b, + 0xe8d3c48d, 0x283b57cc, 0xf8d56629, 0x79132e28, + 0x785f0191, 0xed756055, 0xf7960e44, 0xe3d35e8c, + 0x15056dd4, 0x88f46dba, 0x03a16125, 0x0564f0bd, + 0xc3eb9e15, 0x3c9057a2, 0x97271aec, 0xa93a072a, + 0x1b3f6d9b, 0x1e6321f5, 0xf59c66fb, 0x26dcf319, + 0x7533d928, 0xb155fdf5, 0x03563482, 0x8aba3cbb, + 0x28517711, 0xc20ad9f8, 0xabcc5167, 0xccad925f, + 0x4de81751, 0x3830dc8e, 0x379d5862, 0x9320f991, + 0xea7a90c2, 0xfb3e7bce, 0x5121ce64, 0x774fbe32, + 0xa8b6e37e, 0xc3293d46, 0x48de5369, 0x6413e680, + 0xa2ae0810, 0xdd6db224, 0x69852dfd, 0x09072166, + 0xb39a460a, 0x6445c0dd, 0x586cdecf, 0x1c20c8ae, + 0x5bbef7dd, 0x1b588d40, 0xccd2017f, 0x6bb4e3bb, + 0xdda26a7e, 0x3a59ff45, 0x3e350a44, 0xbcb4cdd5, + 0x72eacea8, 0xfa6484bb, 0x8d6612ae, 0xbf3c6f47, + 0xd29be463, 0x542f5d9e, 0xaec2771b, 0xf64e6370, + 0x740e0d8d, 0xe75b1357, 0xf8721671, 0xaf537d5d, + 0x4040cb08, 0x4eb4e2cc, 0x34d2466a, 0x0115af84, + 0xe1b00428, 0x95983a1d, 0x06b89fb4, 0xce6ea048, + 0x6f3f3b82, 0x3520ab82, 0x011a1d4b, 0x277227f8, + 0x611560b1, 0xe7933fdc, 0xbb3a792b, 0x344525bd, + 0xa08839e1, 0x51ce794b, 0x2f32c9b7, 0xa01fbac9, + 0xe01cc87e, 0xbcc7d1f6, 0xcf0111c3, 0xa1e8aac7, + 0x1a908749, 0xd44fbd9a, 0xd0dadecb, 0xd50ada38, + 0x0339c32a, 0xc6913667, 0x8df9317c, 0xe0b12b4f, + 0xf79e59b7, 0x43f5bb3a, 0xf2d519ff, 0x27d9459c, + 0xbf97222c, 0x15e6fc2a, 0x0f91fc71, 0x9b941525, + 0xfae59361, 0xceb69ceb, 0xc2a86459, 0x12baa8d1, + 0xb6c1075e, 0xe3056a0c, 0x10d25065, 0xcb03a442, + 0xe0ec6e0e, 0x1698db3b, 0x4c98a0be, 0x3278e964, + 0x9f1f9532, 0xe0d392df, 0xd3a0342b, 0x8971f21e, + 0x1b0a7441, 0x4ba3348c, 0xc5be7120, 0xc37632d8, + 0xdf359f8d, 0x9b992f2e, 0xe60b6f47, 0x0fe3f11d, + 0xe54cda54, 0x1edad891, 0xce6279cf, 0xcd3e7e6f, + 0x1618b166, 0xfd2c1d05, 0x848fd2c5, 0xf6fb2299, + 0xf523f357, 0xa6327623, 0x93a83531, 0x56cccd02, + 0xacf08162, 0x5a75ebb5, 0x6e163697, 0x88d273cc, + 0xde966292, 0x81b949d0, 0x4c50901b, 0x71c65614, + 0xe6c6c7bd, 0x327a140a, 0x45e1d006, 0xc3f27b9a, + 0xc9aa53fd, 0x62a80f00, 0xbb25bfe2, 0x35bdd2f6, + 0x71126905, 0xb2040222, 0xb6cbcf7c, 0xcd769c2b, + 0x53113ec0, 0x1640e3d3, 0x38abbd60, 0x2547adf0, + 0xba38209c, 0xf746ce76, 0x77afa1c5, 0x20756060, + 0x85cbfe4e, 0x8ae88dd8, 0x7aaaf9b0, 0x4cf9aa7e, + 0x1948c25c, 0x02fb8a8c, 0x01c36ae4, 0xd6ebe1f9, + 0x90d4f869, 0xa65cdea0, 0x3f09252d, 0xc208e69f, + 0xb74e6132, 0xce77e25b, 0x578fdfe3, 0x3ac372e6 } }; //Constructor - Initialize the P and S boxes for a given Key -BlowFish::BlowFish(unsigned char* ucKey, unsigned int keysize, const SBlock& roChain) : m_oChain0(roChain), m_oChain(roChain) +BlowFish::BlowFish(unsigned char * ucKey, unsigned int keysize, const SBlock & roChain) : m_oChain0(roChain), m_oChain(roChain) { - if(keysize<1) - // throw exception("Incorrect key length"); - return; + if(keysize < 1) + // throw exception("Incorrect key length"); + return; /* * BRAINDEAD DEVELOPER DISCLAIMER: @@ -342,7 +341,7 @@ BlowFish::BlowFish(unsigned char* ucKey, unsigned int keysize, const SBlock& roC keysize = maxKeysize; // Allocate dynamically as we need a constant expression for the array size in c++ - unsigned char *aucLocalKey = new unsigned char[maxKeysize]; + unsigned char * aucLocalKey = new unsigned char[maxKeysize]; unsigned int i, j; KviMemory::copy(aucLocalKey, ucKey, keysize); @@ -352,14 +351,14 @@ BlowFish::BlowFish(unsigned char* ucKey, unsigned int keysize, const SBlock& roC KviMemory::copy(m_auiP, scm_auiInitP, sizeof(m_auiP)); KviMemory::copy(m_auiS, scm_auiInitS, sizeof(m_auiS)); //Load P boxes with key bytes - const unsigned char* p = aucLocalKey; - unsigned int x=0; + const unsigned char * p = aucLocalKey; + unsigned int x = 0; //Repeatedly cycle through the key bits until the entire P array has been XORed with key bits int iCount = 0; - for(i=0; i<18; i++) + for(i = 0; i < 18; i++) { - x=0; - for(int n=4; n--; ) + x = 0; + for(int n = 4; n--;) { x <<= 8; x |= *(p++); @@ -374,56 +373,72 @@ BlowFish::BlowFish(unsigned char* ucKey, unsigned int keysize, const SBlock& roC m_auiP[i] ^= x; } //Reflect P and S boxes through the evolving Blowfish - SBlock block(0UL,0UL); //all-zero block - for(i=0; i<18; ) + SBlock block(0UL, 0UL); //all-zero block + for(i = 0; i < 18;) Encrypt(block), m_auiP[i++] = block.m_uil, m_auiP[i++] = block.m_uir; - for(j=0; j<4; j++) - for(int k=0; k<256; ) + for(j = 0; j < 4; j++) + for(int k = 0; k < 256;) Encrypt(block), m_auiS[j][k++] = block.m_uil, m_auiS[j][k++] = block.m_uir; - delete [] aucLocalKey; + delete[] aucLocalKey; } //Sixteen Round Encipher of Block -void BlowFish::Encrypt(SBlock& block) +void BlowFish::Encrypt(SBlock & block) { unsigned int uiLeft = block.m_uil; unsigned int uiRight = block.m_uir; uiLeft ^= m_auiP[0]; - uiRight ^= F(uiLeft)^m_auiP[1]; uiLeft ^= F(uiRight)^m_auiP[2]; - uiRight ^= F(uiLeft)^m_auiP[3]; uiLeft ^= F(uiRight)^m_auiP[4]; - uiRight ^= F(uiLeft)^m_auiP[5]; uiLeft ^= F(uiRight)^m_auiP[6]; - uiRight ^= F(uiLeft)^m_auiP[7]; uiLeft ^= F(uiRight)^m_auiP[8]; - uiRight ^= F(uiLeft)^m_auiP[9]; uiLeft ^= F(uiRight)^m_auiP[10]; - uiRight ^= F(uiLeft)^m_auiP[11]; uiLeft ^= F(uiRight)^m_auiP[12]; - uiRight ^= F(uiLeft)^m_auiP[13]; uiLeft ^= F(uiRight)^m_auiP[14]; - uiRight ^= F(uiLeft)^m_auiP[15]; uiLeft ^= F(uiRight)^m_auiP[16]; + uiRight ^= F(uiLeft) ^ m_auiP[1]; + uiLeft ^= F(uiRight) ^ m_auiP[2]; + uiRight ^= F(uiLeft) ^ m_auiP[3]; + uiLeft ^= F(uiRight) ^ m_auiP[4]; + uiRight ^= F(uiLeft) ^ m_auiP[5]; + uiLeft ^= F(uiRight) ^ m_auiP[6]; + uiRight ^= F(uiLeft) ^ m_auiP[7]; + uiLeft ^= F(uiRight) ^ m_auiP[8]; + uiRight ^= F(uiLeft) ^ m_auiP[9]; + uiLeft ^= F(uiRight) ^ m_auiP[10]; + uiRight ^= F(uiLeft) ^ m_auiP[11]; + uiLeft ^= F(uiRight) ^ m_auiP[12]; + uiRight ^= F(uiLeft) ^ m_auiP[13]; + uiLeft ^= F(uiRight) ^ m_auiP[14]; + uiRight ^= F(uiLeft) ^ m_auiP[15]; + uiLeft ^= F(uiRight) ^ m_auiP[16]; uiRight ^= m_auiP[17]; block.m_uil = uiRight; block.m_uir = uiLeft; } //Sixteen Round Decipher of SBlock -void BlowFish::Decrypt(SBlock& block) +void BlowFish::Decrypt(SBlock & block) { unsigned int uiLeft = block.m_uil; unsigned int uiRight = block.m_uir; uiLeft ^= m_auiP[17]; - uiRight ^= F(uiLeft)^m_auiP[16]; uiLeft ^= F(uiRight)^m_auiP[15]; - uiRight ^= F(uiLeft)^m_auiP[14]; uiLeft ^= F(uiRight)^m_auiP[13]; - uiRight ^= F(uiLeft)^m_auiP[12]; uiLeft ^= F(uiRight)^m_auiP[11]; - uiRight ^= F(uiLeft)^m_auiP[10]; uiLeft ^= F(uiRight)^m_auiP[9]; - uiRight ^= F(uiLeft)^m_auiP[8]; uiLeft ^= F(uiRight)^m_auiP[7]; - uiRight ^= F(uiLeft)^m_auiP[6]; uiLeft ^= F(uiRight)^m_auiP[5]; - uiRight ^= F(uiLeft)^m_auiP[4]; uiLeft ^= F(uiRight)^m_auiP[3]; - uiRight ^= F(uiLeft)^m_auiP[2]; uiLeft ^= F(uiRight)^m_auiP[1]; + uiRight ^= F(uiLeft) ^ m_auiP[16]; + uiLeft ^= F(uiRight) ^ m_auiP[15]; + uiRight ^= F(uiLeft) ^ m_auiP[14]; + uiLeft ^= F(uiRight) ^ m_auiP[13]; + uiRight ^= F(uiLeft) ^ m_auiP[12]; + uiLeft ^= F(uiRight) ^ m_auiP[11]; + uiRight ^= F(uiLeft) ^ m_auiP[10]; + uiLeft ^= F(uiRight) ^ m_auiP[9]; + uiRight ^= F(uiLeft) ^ m_auiP[8]; + uiLeft ^= F(uiRight) ^ m_auiP[7]; + uiRight ^= F(uiLeft) ^ m_auiP[6]; + uiLeft ^= F(uiRight) ^ m_auiP[5]; + uiRight ^= F(uiLeft) ^ m_auiP[4]; + uiLeft ^= F(uiRight) ^ m_auiP[3]; + uiRight ^= F(uiLeft) ^ m_auiP[2]; + uiLeft ^= F(uiRight) ^ m_auiP[1]; uiRight ^= m_auiP[0]; block.m_uil = uiRight; block.m_uir = uiLeft; } //Semi-Portable Byte Shuffling -inline void BytesToBlock(unsigned char const* p, SBlock& b) +inline void BytesToBlock(unsigned char const * p, SBlock & b) { unsigned int y; //Left @@ -454,7 +469,7 @@ inline void BytesToBlock(unsigned char const* p, SBlock& b) b.m_uir |= y; } -inline void BlockToBytes(SBlock const& b, unsigned char* p) +inline void BlockToBytes(SBlock const & b, unsigned char * p) { unsigned int y; //Right @@ -479,10 +494,10 @@ inline void BlockToBytes(SBlock const& b, unsigned char* p) //Encrypt Buffer in Place //Returns false if n is multiple of 8 -void BlowFish::Encrypt(unsigned char* buf, unsigned int n, int iMode) +void BlowFish::Encrypt(unsigned char * buf, unsigned int n, int iMode) { //Check the buffer's length - should be > 0 and multiple of 8 - if((n==0)||(n%8!=0)) + if((n == 0) || (n % 8 != 0)) //throw exception("Incorrect buffer length"); return; @@ -496,7 +511,7 @@ void BlowFish::Encrypt(unsigned char* buf, unsigned int n, int iMode) work ^= chain; Encrypt(work); chain = work; - BlockToBytes(work, buf+=8); + BlockToBytes(work, buf += 8); } } else if(iMode == CFB) //CFB mode, using the Chain @@ -508,7 +523,7 @@ void BlowFish::Encrypt(unsigned char* buf, unsigned int n, int iMode) BytesToBlock(buf, work); work ^= chain; chain = work; - BlockToBytes(work, buf+=8); + BlockToBytes(work, buf += 8); } } else //ECB mode, not using the Chain @@ -517,17 +532,17 @@ void BlowFish::Encrypt(unsigned char* buf, unsigned int n, int iMode) { BytesToBlock(buf, work); Encrypt(work); - BlockToBytes(work, buf+=8); + BlockToBytes(work, buf += 8); } } } //Decrypt Buffer in Place //Returns false if n is multiple of 8 -void BlowFish::Decrypt(unsigned char* buf, unsigned int n, int iMode) +void BlowFish::Decrypt(unsigned char * buf, unsigned int n, int iMode) { //Check the buffer's length - should be > 0 and multiple of 8 - if((n==0)||(n%8!=0)) + if((n == 0) || (n % 8 != 0)) //throw exception("Incorrect buffer length"); return; @@ -542,7 +557,7 @@ void BlowFish::Decrypt(unsigned char* buf, unsigned int n, int iMode) Decrypt(work); work ^= chain; chain = crypt; - BlockToBytes(work, buf+=8); + BlockToBytes(work, buf += 8); } } else if(iMode == CFB) //CFB mode, using the Chain, not using Decrypt() @@ -555,7 +570,7 @@ void BlowFish::Decrypt(unsigned char* buf, unsigned int n, int iMode) crypt = work; work ^= chain; chain = crypt; - BlockToBytes(work, buf+=8); + BlockToBytes(work, buf += 8); } } else //ECB mode, not using the Chain @@ -564,17 +579,17 @@ void BlowFish::Decrypt(unsigned char* buf, unsigned int n, int iMode) { BytesToBlock(buf, work); Decrypt(work); - BlockToBytes(work, buf+=8); + BlockToBytes(work, buf += 8); } } } //Encrypt from Input Buffer to Output Buffer //Returns false if n is multiple of 8 -void BlowFish::Encrypt(const unsigned char* in, unsigned char* out, unsigned int n, int iMode) +void BlowFish::Encrypt(const unsigned char * in, unsigned char * out, unsigned int n, int iMode) { //Check the buffer's length - should be > 0 and multiple of 8 - if((n==0)||(n%8!=0)) + if((n == 0) || (n % 8 != 0)) //throw exception("Incorrect buffer length"); return; @@ -588,7 +603,7 @@ void BlowFish::Encrypt(const unsigned char* in, unsigned char* out, unsigned int work ^= chain; Encrypt(work); chain = work; - BlockToBytes(work, out+=8); + BlockToBytes(work, out += 8); } } else if(iMode == CFB) //CFB mode, using the Chain @@ -600,7 +615,7 @@ void BlowFish::Encrypt(const unsigned char* in, unsigned char* out, unsigned int BytesToBlock(in, work); work ^= chain; chain = work; - BlockToBytes(work, out+=8); + BlockToBytes(work, out += 8); } } else //ECB mode, not using the Chain @@ -609,17 +624,17 @@ void BlowFish::Encrypt(const unsigned char* in, unsigned char* out, unsigned int { BytesToBlock(in, work); Encrypt(work); - BlockToBytes(work, out+=8); + BlockToBytes(work, out += 8); } } } //Decrypt from Input Buffer to Output Buffer //Returns false if n is multiple of 8 -void BlowFish::Decrypt(const unsigned char* in, unsigned char* out, unsigned int n, int iMode) +void BlowFish::Decrypt(const unsigned char * in, unsigned char * out, unsigned int n, int iMode) { //Check the buffer's length - should be > 0 and multiple of 8 - if((n==0)||(n%8!=0)) + if((n == 0) || (n % 8 != 0)) //throw exception("Incorrect buffer length"); return; @@ -634,7 +649,7 @@ void BlowFish::Decrypt(const unsigned char* in, unsigned char* out, unsigned int Decrypt(work); work ^= chain; chain = crypt; - BlockToBytes(work, out+=8); + BlockToBytes(work, out += 8); } } else if(iMode == CFB) //CFB mode, using the Chain, not using Decrypt() @@ -647,7 +662,7 @@ void BlowFish::Decrypt(const unsigned char* in, unsigned char* out, unsigned int crypt = work; work ^= chain; chain = crypt; - BlockToBytes(work, out+=8); + BlockToBytes(work, out += 8); } } else //ECB mode, not using the Chain @@ -656,7 +671,7 @@ void BlowFish::Decrypt(const unsigned char* in, unsigned char* out, unsigned int { BytesToBlock(in, work); Decrypt(work); - BlockToBytes(work, out+=8); + BlockToBytes(work, out += 8); } } } diff --git a/src/modules/rijndael/BlowFish.h b/src/modules/rijndael/BlowFish.h index ccf464213..f67a7a973 100644 --- a/src/modules/rijndael/BlowFish.h +++ b/src/modules/rijndael/BlowFish.h @@ -37,7 +37,6 @@ // -mouser 1/08/05 //--------------------------------------------------------------------------- - // // BLOWFISH ENCRYPTION ALGORITHM // @@ -77,42 +76,51 @@ #if defined(COMPILE_CRYPT_SUPPORT) || defined(Q_MOC_RUN) - //Block Structure struct SBlock { //Constructors - SBlock(unsigned int l=0, unsigned int r=0) : m_uil(l), m_uir(r) {} + SBlock(unsigned int l = 0, unsigned int r = 0) : m_uil(l), m_uir(r) {} //Copy Constructor - SBlock(const SBlock& roBlock) : m_uil(roBlock.m_uil), m_uir(roBlock.m_uir) {} - SBlock& operator^=(SBlock& b) { m_uil ^= b.m_uil; m_uir ^= b.m_uir; return *this; } + SBlock(const SBlock & roBlock) : m_uil(roBlock.m_uil), m_uir(roBlock.m_uir) {} + SBlock & operator^=(SBlock & b) + { + m_uil ^= b.m_uil; + m_uir ^= b.m_uir; + return *this; + } unsigned int m_uil, m_uir; }; class BlowFish { public: - enum { ECB=0, CBC=1, CFB=2 }; + enum + { + ECB = 0, + CBC = 1, + CFB = 2 + }; //Constructor - Initialize the P and S boxes for a given Key - BlowFish(unsigned char* ucKey, unsigned int n, const SBlock& roChain = SBlock(0UL,0UL)); + BlowFish(unsigned char * ucKey, unsigned int n, const SBlock & roChain = SBlock(0UL, 0UL)); //Resetting the chaining block void ResetChain() { m_oChain = m_oChain0; } // Encrypt/Decrypt Buffer in Place - void Encrypt(unsigned char* buf, unsigned int n, int iMode=ECB); - void Decrypt(unsigned char* buf, unsigned int n, int iMode=ECB); + void Encrypt(unsigned char * buf, unsigned int n, int iMode = ECB); + void Decrypt(unsigned char * buf, unsigned int n, int iMode = ECB); // Encrypt/Decrypt from Input Buffer to Output Buffer - void Encrypt(const unsigned char* in, unsigned char* out, unsigned int n, int iMode=ECB); - void Decrypt(const unsigned char* in, unsigned char* out, unsigned int n, int iMode=ECB); + void Encrypt(const unsigned char * in, unsigned char * out, unsigned int n, int iMode = ECB); + void Decrypt(const unsigned char * in, unsigned char * out, unsigned int n, int iMode = ECB); -//Private Functions + //Private Functions private: unsigned int F(unsigned int ui); - void Encrypt(SBlock&); - void Decrypt(SBlock&); + void Encrypt(SBlock &); + void Decrypt(SBlock &); private: //The Initialization Vector, by default {0, 0} @@ -133,7 +141,7 @@ inline unsigned char Byte(unsigned int ui) //Function F inline unsigned int BlowFish::F(unsigned int ui) { - return ((m_auiS[0][Byte(ui>>24)] + m_auiS[1][Byte(ui>>16)]) ^ m_auiS[2][Byte(ui>>8)]) + m_auiS[3][Byte(ui)]; + return ((m_auiS[0][Byte(ui >> 24)] + m_auiS[1][Byte(ui >> 16)]) ^ m_auiS[2][Byte(ui >> 8)]) + m_auiS[3][Byte(ui)]; } #endif //COMPILE_CRYPT_SUPPORT diff --git a/src/modules/rijndael/InitVectorEngine.cpp b/src/modules/rijndael/InitVectorEngine.cpp index 651b7b8f3..776308260 100644 --- a/src/modules/rijndael/InitVectorEngine.cpp +++ b/src/modules/rijndael/InitVectorEngine.cpp @@ -40,7 +40,7 @@ namespace InitVectorEngine bDidInit = true; } - for(int i=0;i //#include -static UINT8 S[256]= -{ - 99, 124, 119, 123, 242, 107, 111, 197, 48, 1, 103, 43, 254, 215, 171, 118, - 202, 130, 201, 125, 250, 89, 71, 240, 173, 212, 162, 175, 156, 164, 114, 192, - 183, 253, 147, 38, 54, 63, 247, 204, 52, 165, 229, 241, 113, 216, 49, 21, - 4, 199, 35, 195, 24, 150, 5, 154, 7, 18, 128, 226, 235, 39, 178, 117, - 9, 131, 44, 26, 27, 110, 90, 160, 82, 59, 214, 179, 41, 227, 47, 132, - 83, 209, 0, 237, 32, 252, 177, 91, 106, 203, 190, 57, 74, 76, 88, 207, - 208, 239, 170, 251, 67, 77, 51, 133, 69, 249, 2, 127, 80, 60, 159, 168, - 81, 163, 64, 143, 146, 157, 56, 245, 188, 182, 218, 33, 16, 255, 243, 210, - 205, 12, 19, 236, 95, 151, 68, 23, 196, 167, 126, 61, 100, 93, 25, 115, - 96, 129, 79, 220, 34, 42, 144, 136, 70, 238, 184, 20, 222, 94, 11, 219, - 224, 50, 58, 10, 73, 6, 36, 92, 194, 211, 172, 98, 145, 149, 228, 121, - 231, 200, 55, 109, 141, 213, 78, 169, 108, 86, 244, 234, 101, 122, 174, 8, - 186, 120, 37, 46, 28, 166, 180, 198, 232, 221, 116, 31, 75, 189, 139, 138, - 112, 62, 181, 102, 72, 3, 246, 14, 97, 53, 87, 185, 134, 193, 29, 158, - 225, 248, 152, 17, 105, 217, 142, 148, 155, 30, 135, 233, 206, 85, 40, 223, - 140, 161, 137, 13, 191, 230, 66, 104, 65, 153, 45, 15, 176, 84, 187, 22 +static UINT8 S[256] = { + 99, 124, 119, 123, 242, 107, 111, 197, 48, 1, 103, 43, 254, 215, 171, 118, + 202, 130, 201, 125, 250, 89, 71, 240, 173, 212, 162, 175, 156, 164, 114, 192, + 183, 253, 147, 38, 54, 63, 247, 204, 52, 165, 229, 241, 113, 216, 49, 21, + 4, 199, 35, 195, 24, 150, 5, 154, 7, 18, 128, 226, 235, 39, 178, 117, + 9, 131, 44, 26, 27, 110, 90, 160, 82, 59, 214, 179, 41, 227, 47, 132, + 83, 209, 0, 237, 32, 252, 177, 91, 106, 203, 190, 57, 74, 76, 88, 207, + 208, 239, 170, 251, 67, 77, 51, 133, 69, 249, 2, 127, 80, 60, 159, 168, + 81, 163, 64, 143, 146, 157, 56, 245, 188, 182, 218, 33, 16, 255, 243, 210, + 205, 12, 19, 236, 95, 151, 68, 23, 196, 167, 126, 61, 100, 93, 25, 115, + 96, 129, 79, 220, 34, 42, 144, 136, 70, 238, 184, 20, 222, 94, 11, 219, + 224, 50, 58, 10, 73, 6, 36, 92, 194, 211, 172, 98, 145, 149, 228, 121, + 231, 200, 55, 109, 141, 213, 78, 169, 108, 86, 244, 234, 101, 122, 174, 8, + 186, 120, 37, 46, 28, 166, 180, 198, 232, 221, 116, 31, 75, 189, 139, 138, + 112, 62, 181, 102, 72, 3, 246, 14, 97, 53, 87, 185, 134, 193, 29, 158, + 225, 248, 152, 17, 105, 217, 142, 148, 155, 30, 135, 233, 206, 85, 40, 223, + 140, 161, 137, 13, 191, 230, 66, 104, 65, 153, 45, 15, 176, 84, 187, 22 }; - -static UINT8 T1[256][4]= -{ - {0xc6,0x63,0x63,0xa5}, {0xf8,0x7c,0x7c,0x84}, {0xee,0x77,0x77,0x99}, {0xf6,0x7b,0x7b,0x8d}, - {0xff,0xf2,0xf2,0x0d}, {0xd6,0x6b,0x6b,0xbd}, {0xde,0x6f,0x6f,0xb1}, {0x91,0xc5,0xc5,0x54}, - {0x60,0x30,0x30,0x50}, {0x02,0x01,0x01,0x03}, {0xce,0x67,0x67,0xa9}, {0x56,0x2b,0x2b,0x7d}, - {0xe7,0xfe,0xfe,0x19}, {0xb5,0xd7,0xd7,0x62}, {0x4d,0xab,0xab,0xe6}, {0xec,0x76,0x76,0x9a}, - {0x8f,0xca,0xca,0x45}, {0x1f,0x82,0x82,0x9d}, {0x89,0xc9,0xc9,0x40}, {0xfa,0x7d,0x7d,0x87}, - {0xef,0xfa,0xfa,0x15}, {0xb2,0x59,0x59,0xeb}, {0x8e,0x47,0x47,0xc9}, {0xfb,0xf0,0xf0,0x0b}, - {0x41,0xad,0xad,0xec}, {0xb3,0xd4,0xd4,0x67}, {0x5f,0xa2,0xa2,0xfd}, {0x45,0xaf,0xaf,0xea}, - {0x23,0x9c,0x9c,0xbf}, {0x53,0xa4,0xa4,0xf7}, {0xe4,0x72,0x72,0x96}, {0x9b,0xc0,0xc0,0x5b}, - {0x75,0xb7,0xb7,0xc2}, {0xe1,0xfd,0xfd,0x1c}, {0x3d,0x93,0x93,0xae}, {0x4c,0x26,0x26,0x6a}, - {0x6c,0x36,0x36,0x5a}, {0x7e,0x3f,0x3f,0x41}, {0xf5,0xf7,0xf7,0x02}, {0x83,0xcc,0xcc,0x4f}, - {0x68,0x34,0x34,0x5c}, {0x51,0xa5,0xa5,0xf4}, {0xd1,0xe5,0xe5,0x34}, {0xf9,0xf1,0xf1,0x08}, - {0xe2,0x71,0x71,0x93}, {0xab,0xd8,0xd8,0x73}, {0x62,0x31,0x31,0x53}, {0x2a,0x15,0x15,0x3f}, - {0x08,0x04,0x04,0x0c}, {0x95,0xc7,0xc7,0x52}, {0x46,0x23,0x23,0x65}, {0x9d,0xc3,0xc3,0x5e}, - {0x30,0x18,0x18,0x28}, {0x37,0x96,0x96,0xa1}, {0x0a,0x05,0x05,0x0f}, {0x2f,0x9a,0x9a,0xb5}, - {0x0e,0x07,0x07,0x09}, {0x24,0x12,0x12,0x36}, {0x1b,0x80,0x80,0x9b}, {0xdf,0xe2,0xe2,0x3d}, - {0xcd,0xeb,0xeb,0x26}, {0x4e,0x27,0x27,0x69}, {0x7f,0xb2,0xb2,0xcd}, {0xea,0x75,0x75,0x9f}, - {0x12,0x09,0x09,0x1b}, {0x1d,0x83,0x83,0x9e}, {0x58,0x2c,0x2c,0x74}, {0x34,0x1a,0x1a,0x2e}, - {0x36,0x1b,0x1b,0x2d}, {0xdc,0x6e,0x6e,0xb2}, {0xb4,0x5a,0x5a,0xee}, {0x5b,0xa0,0xa0,0xfb}, - {0xa4,0x52,0x52,0xf6}, {0x76,0x3b,0x3b,0x4d}, {0xb7,0xd6,0xd6,0x61}, {0x7d,0xb3,0xb3,0xce}, - {0x52,0x29,0x29,0x7b}, {0xdd,0xe3,0xe3,0x3e}, {0x5e,0x2f,0x2f,0x71}, {0x13,0x84,0x84,0x97}, - {0xa6,0x53,0x53,0xf5}, {0xb9,0xd1,0xd1,0x68}, {0x00,0x00,0x00,0x00}, {0xc1,0xed,0xed,0x2c}, - {0x40,0x20,0x20,0x60}, {0xe3,0xfc,0xfc,0x1f}, {0x79,0xb1,0xb1,0xc8}, {0xb6,0x5b,0x5b,0xed}, - {0xd4,0x6a,0x6a,0xbe}, {0x8d,0xcb,0xcb,0x46}, {0x67,0xbe,0xbe,0xd9}, {0x72,0x39,0x39,0x4b}, - {0x94,0x4a,0x4a,0xde}, {0x98,0x4c,0x4c,0xd4}, {0xb0,0x58,0x58,0xe8}, {0x85,0xcf,0xcf,0x4a}, - {0xbb,0xd0,0xd0,0x6b}, {0xc5,0xef,0xef,0x2a}, {0x4f,0xaa,0xaa,0xe5}, {0xed,0xfb,0xfb,0x16}, - {0x86,0x43,0x43,0xc5}, {0x9a,0x4d,0x4d,0xd7}, {0x66,0x33,0x33,0x55}, {0x11,0x85,0x85,0x94}, - {0x8a,0x45,0x45,0xcf}, {0xe9,0xf9,0xf9,0x10}, {0x04,0x02,0x02,0x06}, {0xfe,0x7f,0x7f,0x81}, - {0xa0,0x50,0x50,0xf0}, {0x78,0x3c,0x3c,0x44}, {0x25,0x9f,0x9f,0xba}, {0x4b,0xa8,0xa8,0xe3}, - {0xa2,0x51,0x51,0xf3}, {0x5d,0xa3,0xa3,0xfe}, {0x80,0x40,0x40,0xc0}, {0x05,0x8f,0x8f,0x8a}, - {0x3f,0x92,0x92,0xad}, {0x21,0x9d,0x9d,0xbc}, {0x70,0x38,0x38,0x48}, {0xf1,0xf5,0xf5,0x04}, - {0x63,0xbc,0xbc,0xdf}, {0x77,0xb6,0xb6,0xc1}, {0xaf,0xda,0xda,0x75}, {0x42,0x21,0x21,0x63}, - {0x20,0x10,0x10,0x30}, {0xe5,0xff,0xff,0x1a}, {0xfd,0xf3,0xf3,0x0e}, {0xbf,0xd2,0xd2,0x6d}, - {0x81,0xcd,0xcd,0x4c}, {0x18,0x0c,0x0c,0x14}, {0x26,0x13,0x13,0x35}, {0xc3,0xec,0xec,0x2f}, - {0xbe,0x5f,0x5f,0xe1}, {0x35,0x97,0x97,0xa2}, {0x88,0x44,0x44,0xcc}, {0x2e,0x17,0x17,0x39}, - {0x93,0xc4,0xc4,0x57}, {0x55,0xa7,0xa7,0xf2}, {0xfc,0x7e,0x7e,0x82}, {0x7a,0x3d,0x3d,0x47}, - {0xc8,0x64,0x64,0xac}, {0xba,0x5d,0x5d,0xe7}, {0x32,0x19,0x19,0x2b}, {0xe6,0x73,0x73,0x95}, - {0xc0,0x60,0x60,0xa0}, {0x19,0x81,0x81,0x98}, {0x9e,0x4f,0x4f,0xd1}, {0xa3,0xdc,0xdc,0x7f}, - {0x44,0x22,0x22,0x66}, {0x54,0x2a,0x2a,0x7e}, {0x3b,0x90,0x90,0xab}, {0x0b,0x88,0x88,0x83}, - {0x8c,0x46,0x46,0xca}, {0xc7,0xee,0xee,0x29}, {0x6b,0xb8,0xb8,0xd3}, {0x28,0x14,0x14,0x3c}, - {0xa7,0xde,0xde,0x79}, {0xbc,0x5e,0x5e,0xe2}, {0x16,0x0b,0x0b,0x1d}, {0xad,0xdb,0xdb,0x76}, - {0xdb,0xe0,0xe0,0x3b}, {0x64,0x32,0x32,0x56}, {0x74,0x3a,0x3a,0x4e}, {0x14,0x0a,0x0a,0x1e}, - {0x92,0x49,0x49,0xdb}, {0x0c,0x06,0x06,0x0a}, {0x48,0x24,0x24,0x6c}, {0xb8,0x5c,0x5c,0xe4}, - {0x9f,0xc2,0xc2,0x5d}, {0xbd,0xd3,0xd3,0x6e}, {0x43,0xac,0xac,0xef}, {0xc4,0x62,0x62,0xa6}, - {0x39,0x91,0x91,0xa8}, {0x31,0x95,0x95,0xa4}, {0xd3,0xe4,0xe4,0x37}, {0xf2,0x79,0x79,0x8b}, - {0xd5,0xe7,0xe7,0x32}, {0x8b,0xc8,0xc8,0x43}, {0x6e,0x37,0x37,0x59}, {0xda,0x6d,0x6d,0xb7}, - {0x01,0x8d,0x8d,0x8c}, {0xb1,0xd5,0xd5,0x64}, {0x9c,0x4e,0x4e,0xd2}, {0x49,0xa9,0xa9,0xe0}, - {0xd8,0x6c,0x6c,0xb4}, {0xac,0x56,0x56,0xfa}, {0xf3,0xf4,0xf4,0x07}, {0xcf,0xea,0xea,0x25}, - {0xca,0x65,0x65,0xaf}, {0xf4,0x7a,0x7a,0x8e}, {0x47,0xae,0xae,0xe9}, {0x10,0x08,0x08,0x18}, - {0x6f,0xba,0xba,0xd5}, {0xf0,0x78,0x78,0x88}, {0x4a,0x25,0x25,0x6f}, {0x5c,0x2e,0x2e,0x72}, - {0x38,0x1c,0x1c,0x24}, {0x57,0xa6,0xa6,0xf1}, {0x73,0xb4,0xb4,0xc7}, {0x97,0xc6,0xc6,0x51}, - {0xcb,0xe8,0xe8,0x23}, {0xa1,0xdd,0xdd,0x7c}, {0xe8,0x74,0x74,0x9c}, {0x3e,0x1f,0x1f,0x21}, - {0x96,0x4b,0x4b,0xdd}, {0x61,0xbd,0xbd,0xdc}, {0x0d,0x8b,0x8b,0x86}, {0x0f,0x8a,0x8a,0x85}, - {0xe0,0x70,0x70,0x90}, {0x7c,0x3e,0x3e,0x42}, {0x71,0xb5,0xb5,0xc4}, {0xcc,0x66,0x66,0xaa}, - {0x90,0x48,0x48,0xd8}, {0x06,0x03,0x03,0x05}, {0xf7,0xf6,0xf6,0x01}, {0x1c,0x0e,0x0e,0x12}, - {0xc2,0x61,0x61,0xa3}, {0x6a,0x35,0x35,0x5f}, {0xae,0x57,0x57,0xf9}, {0x69,0xb9,0xb9,0xd0}, - {0x17,0x86,0x86,0x91}, {0x99,0xc1,0xc1,0x58}, {0x3a,0x1d,0x1d,0x27}, {0x27,0x9e,0x9e,0xb9}, - {0xd9,0xe1,0xe1,0x38}, {0xeb,0xf8,0xf8,0x13}, {0x2b,0x98,0x98,0xb3}, {0x22,0x11,0x11,0x33}, - {0xd2,0x69,0x69,0xbb}, {0xa9,0xd9,0xd9,0x70}, {0x07,0x8e,0x8e,0x89}, {0x33,0x94,0x94,0xa7}, - {0x2d,0x9b,0x9b,0xb6}, {0x3c,0x1e,0x1e,0x22}, {0x15,0x87,0x87,0x92}, {0xc9,0xe9,0xe9,0x20}, - {0x87,0xce,0xce,0x49}, {0xaa,0x55,0x55,0xff}, {0x50,0x28,0x28,0x78}, {0xa5,0xdf,0xdf,0x7a}, - {0x03,0x8c,0x8c,0x8f}, {0x59,0xa1,0xa1,0xf8}, {0x09,0x89,0x89,0x80}, {0x1a,0x0d,0x0d,0x17}, - {0x65,0xbf,0xbf,0xda}, {0xd7,0xe6,0xe6,0x31}, {0x84,0x42,0x42,0xc6}, {0xd0,0x68,0x68,0xb8}, - {0x82,0x41,0x41,0xc3}, {0x29,0x99,0x99,0xb0}, {0x5a,0x2d,0x2d,0x77}, {0x1e,0x0f,0x0f,0x11}, - {0x7b,0xb0,0xb0,0xcb}, {0xa8,0x54,0x54,0xfc}, {0x6d,0xbb,0xbb,0xd6}, {0x2c,0x16,0x16,0x3a} +static UINT8 T1[256][4] = { + { 0xc6, 0x63, 0x63, 0xa5 }, { 0xf8, 0x7c, 0x7c, 0x84 }, { 0xee, 0x77, 0x77, 0x99 }, { 0xf6, 0x7b, 0x7b, 0x8d }, + { 0xff, 0xf2, 0xf2, 0x0d }, { 0xd6, 0x6b, 0x6b, 0xbd }, { 0xde, 0x6f, 0x6f, 0xb1 }, { 0x91, 0xc5, 0xc5, 0x54 }, + { 0x60, 0x30, 0x30, 0x50 }, { 0x02, 0x01, 0x01, 0x03 }, { 0xce, 0x67, 0x67, 0xa9 }, { 0x56, 0x2b, 0x2b, 0x7d }, + { 0xe7, 0xfe, 0xfe, 0x19 }, { 0xb5, 0xd7, 0xd7, 0x62 }, { 0x4d, 0xab, 0xab, 0xe6 }, { 0xec, 0x76, 0x76, 0x9a }, + { 0x8f, 0xca, 0xca, 0x45 }, { 0x1f, 0x82, 0x82, 0x9d }, { 0x89, 0xc9, 0xc9, 0x40 }, { 0xfa, 0x7d, 0x7d, 0x87 }, + { 0xef, 0xfa, 0xfa, 0x15 }, { 0xb2, 0x59, 0x59, 0xeb }, { 0x8e, 0x47, 0x47, 0xc9 }, { 0xfb, 0xf0, 0xf0, 0x0b }, + { 0x41, 0xad, 0xad, 0xec }, { 0xb3, 0xd4, 0xd4, 0x67 }, { 0x5f, 0xa2, 0xa2, 0xfd }, { 0x45, 0xaf, 0xaf, 0xea }, + { 0x23, 0x9c, 0x9c, 0xbf }, { 0x53, 0xa4, 0xa4, 0xf7 }, { 0xe4, 0x72, 0x72, 0x96 }, { 0x9b, 0xc0, 0xc0, 0x5b }, + { 0x75, 0xb7, 0xb7, 0xc2 }, { 0xe1, 0xfd, 0xfd, 0x1c }, { 0x3d, 0x93, 0x93, 0xae }, { 0x4c, 0x26, 0x26, 0x6a }, + { 0x6c, 0x36, 0x36, 0x5a }, { 0x7e, 0x3f, 0x3f, 0x41 }, { 0xf5, 0xf7, 0xf7, 0x02 }, { 0x83, 0xcc, 0xcc, 0x4f }, + { 0x68, 0x34, 0x34, 0x5c }, { 0x51, 0xa5, 0xa5, 0xf4 }, { 0xd1, 0xe5, 0xe5, 0x34 }, { 0xf9, 0xf1, 0xf1, 0x08 }, + { 0xe2, 0x71, 0x71, 0x93 }, { 0xab, 0xd8, 0xd8, 0x73 }, { 0x62, 0x31, 0x31, 0x53 }, { 0x2a, 0x15, 0x15, 0x3f }, + { 0x08, 0x04, 0x04, 0x0c }, { 0x95, 0xc7, 0xc7, 0x52 }, { 0x46, 0x23, 0x23, 0x65 }, { 0x9d, 0xc3, 0xc3, 0x5e }, + { 0x30, 0x18, 0x18, 0x28 }, { 0x37, 0x96, 0x96, 0xa1 }, { 0x0a, 0x05, 0x05, 0x0f }, { 0x2f, 0x9a, 0x9a, 0xb5 }, + { 0x0e, 0x07, 0x07, 0x09 }, { 0x24, 0x12, 0x12, 0x36 }, { 0x1b, 0x80, 0x80, 0x9b }, { 0xdf, 0xe2, 0xe2, 0x3d }, + { 0xcd, 0xeb, 0xeb, 0x26 }, { 0x4e, 0x27, 0x27, 0x69 }, { 0x7f, 0xb2, 0xb2, 0xcd }, { 0xea, 0x75, 0x75, 0x9f }, + { 0x12, 0x09, 0x09, 0x1b }, { 0x1d, 0x83, 0x83, 0x9e }, { 0x58, 0x2c, 0x2c, 0x74 }, { 0x34, 0x1a, 0x1a, 0x2e }, + { 0x36, 0x1b, 0x1b, 0x2d }, { 0xdc, 0x6e, 0x6e, 0xb2 }, { 0xb4, 0x5a, 0x5a, 0xee }, { 0x5b, 0xa0, 0xa0, 0xfb }, + { 0xa4, 0x52, 0x52, 0xf6 }, { 0x76, 0x3b, 0x3b, 0x4d }, { 0xb7, 0xd6, 0xd6, 0x61 }, { 0x7d, 0xb3, 0xb3, 0xce }, + { 0x52, 0x29, 0x29, 0x7b }, { 0xdd, 0xe3, 0xe3, 0x3e }, { 0x5e, 0x2f, 0x2f, 0x71 }, { 0x13, 0x84, 0x84, 0x97 }, + { 0xa6, 0x53, 0x53, 0xf5 }, { 0xb9, 0xd1, 0xd1, 0x68 }, { 0x00, 0x00, 0x00, 0x00 }, { 0xc1, 0xed, 0xed, 0x2c }, + { 0x40, 0x20, 0x20, 0x60 }, { 0xe3, 0xfc, 0xfc, 0x1f }, { 0x79, 0xb1, 0xb1, 0xc8 }, { 0xb6, 0x5b, 0x5b, 0xed }, + { 0xd4, 0x6a, 0x6a, 0xbe }, { 0x8d, 0xcb, 0xcb, 0x46 }, { 0x67, 0xbe, 0xbe, 0xd9 }, { 0x72, 0x39, 0x39, 0x4b }, + { 0x94, 0x4a, 0x4a, 0xde }, { 0x98, 0x4c, 0x4c, 0xd4 }, { 0xb0, 0x58, 0x58, 0xe8 }, { 0x85, 0xcf, 0xcf, 0x4a }, + { 0xbb, 0xd0, 0xd0, 0x6b }, { 0xc5, 0xef, 0xef, 0x2a }, { 0x4f, 0xaa, 0xaa, 0xe5 }, { 0xed, 0xfb, 0xfb, 0x16 }, + { 0x86, 0x43, 0x43, 0xc5 }, { 0x9a, 0x4d, 0x4d, 0xd7 }, { 0x66, 0x33, 0x33, 0x55 }, { 0x11, 0x85, 0x85, 0x94 }, + { 0x8a, 0x45, 0x45, 0xcf }, { 0xe9, 0xf9, 0xf9, 0x10 }, { 0x04, 0x02, 0x02, 0x06 }, { 0xfe, 0x7f, 0x7f, 0x81 }, + { 0xa0, 0x50, 0x50, 0xf0 }, { 0x78, 0x3c, 0x3c, 0x44 }, { 0x25, 0x9f, 0x9f, 0xba }, { 0x4b, 0xa8, 0xa8, 0xe3 }, + { 0xa2, 0x51, 0x51, 0xf3 }, { 0x5d, 0xa3, 0xa3, 0xfe }, { 0x80, 0x40, 0x40, 0xc0 }, { 0x05, 0x8f, 0x8f, 0x8a }, + { 0x3f, 0x92, 0x92, 0xad }, { 0x21, 0x9d, 0x9d, 0xbc }, { 0x70, 0x38, 0x38, 0x48 }, { 0xf1, 0xf5, 0xf5, 0x04 }, + { 0x63, 0xbc, 0xbc, 0xdf }, { 0x77, 0xb6, 0xb6, 0xc1 }, { 0xaf, 0xda, 0xda, 0x75 }, { 0x42, 0x21, 0x21, 0x63 }, + { 0x20, 0x10, 0x10, 0x30 }, { 0xe5, 0xff, 0xff, 0x1a }, { 0xfd, 0xf3, 0xf3, 0x0e }, { 0xbf, 0xd2, 0xd2, 0x6d }, + { 0x81, 0xcd, 0xcd, 0x4c }, { 0x18, 0x0c, 0x0c, 0x14 }, { 0x26, 0x13, 0x13, 0x35 }, { 0xc3, 0xec, 0xec, 0x2f }, + { 0xbe, 0x5f, 0x5f, 0xe1 }, { 0x35, 0x97, 0x97, 0xa2 }, { 0x88, 0x44, 0x44, 0xcc }, { 0x2e, 0x17, 0x17, 0x39 }, + { 0x93, 0xc4, 0xc4, 0x57 }, { 0x55, 0xa7, 0xa7, 0xf2 }, { 0xfc, 0x7e, 0x7e, 0x82 }, { 0x7a, 0x3d, 0x3d, 0x47 }, + { 0xc8, 0x64, 0x64, 0xac }, { 0xba, 0x5d, 0x5d, 0xe7 }, { 0x32, 0x19, 0x19, 0x2b }, { 0xe6, 0x73, 0x73, 0x95 }, + { 0xc0, 0x60, 0x60, 0xa0 }, { 0x19, 0x81, 0x81, 0x98 }, { 0x9e, 0x4f, 0x4f, 0xd1 }, { 0xa3, 0xdc, 0xdc, 0x7f }, + { 0x44, 0x22, 0x22, 0x66 }, { 0x54, 0x2a, 0x2a, 0x7e }, { 0x3b, 0x90, 0x90, 0xab }, { 0x0b, 0x88, 0x88, 0x83 }, + { 0x8c, 0x46, 0x46, 0xca }, { 0xc7, 0xee, 0xee, 0x29 }, { 0x6b, 0xb8, 0xb8, 0xd3 }, { 0x28, 0x14, 0x14, 0x3c }, + { 0xa7, 0xde, 0xde, 0x79 }, { 0xbc, 0x5e, 0x5e, 0xe2 }, { 0x16, 0x0b, 0x0b, 0x1d }, { 0xad, 0xdb, 0xdb, 0x76 }, + { 0xdb, 0xe0, 0xe0, 0x3b }, { 0x64, 0x32, 0x32, 0x56 }, { 0x74, 0x3a, 0x3a, 0x4e }, { 0x14, 0x0a, 0x0a, 0x1e }, + { 0x92, 0x49, 0x49, 0xdb }, { 0x0c, 0x06, 0x06, 0x0a }, { 0x48, 0x24, 0x24, 0x6c }, { 0xb8, 0x5c, 0x5c, 0xe4 }, + { 0x9f, 0xc2, 0xc2, 0x5d }, { 0xbd, 0xd3, 0xd3, 0x6e }, { 0x43, 0xac, 0xac, 0xef }, { 0xc4, 0x62, 0x62, 0xa6 }, + { 0x39, 0x91, 0x91, 0xa8 }, { 0x31, 0x95, 0x95, 0xa4 }, { 0xd3, 0xe4, 0xe4, 0x37 }, { 0xf2, 0x79, 0x79, 0x8b }, + { 0xd5, 0xe7, 0xe7, 0x32 }, { 0x8b, 0xc8, 0xc8, 0x43 }, { 0x6e, 0x37, 0x37, 0x59 }, { 0xda, 0x6d, 0x6d, 0xb7 }, + { 0x01, 0x8d, 0x8d, 0x8c }, { 0xb1, 0xd5, 0xd5, 0x64 }, { 0x9c, 0x4e, 0x4e, 0xd2 }, { 0x49, 0xa9, 0xa9, 0xe0 }, + { 0xd8, 0x6c, 0x6c, 0xb4 }, { 0xac, 0x56, 0x56, 0xfa }, { 0xf3, 0xf4, 0xf4, 0x07 }, { 0xcf, 0xea, 0xea, 0x25 }, + { 0xca, 0x65, 0x65, 0xaf }, { 0xf4, 0x7a, 0x7a, 0x8e }, { 0x47, 0xae, 0xae, 0xe9 }, { 0x10, 0x08, 0x08, 0x18 }, + { 0x6f, 0xba, 0xba, 0xd5 }, { 0xf0, 0x78, 0x78, 0x88 }, { 0x4a, 0x25, 0x25, 0x6f }, { 0x5c, 0x2e, 0x2e, 0x72 }, + { 0x38, 0x1c, 0x1c, 0x24 }, { 0x57, 0xa6, 0xa6, 0xf1 }, { 0x73, 0xb4, 0xb4, 0xc7 }, { 0x97, 0xc6, 0xc6, 0x51 }, + { 0xcb, 0xe8, 0xe8, 0x23 }, { 0xa1, 0xdd, 0xdd, 0x7c }, { 0xe8, 0x74, 0x74, 0x9c }, { 0x3e, 0x1f, 0x1f, 0x21 }, + { 0x96, 0x4b, 0x4b, 0xdd }, { 0x61, 0xbd, 0xbd, 0xdc }, { 0x0d, 0x8b, 0x8b, 0x86 }, { 0x0f, 0x8a, 0x8a, 0x85 }, + { 0xe0, 0x70, 0x70, 0x90 }, { 0x7c, 0x3e, 0x3e, 0x42 }, { 0x71, 0xb5, 0xb5, 0xc4 }, { 0xcc, 0x66, 0x66, 0xaa }, + { 0x90, 0x48, 0x48, 0xd8 }, { 0x06, 0x03, 0x03, 0x05 }, { 0xf7, 0xf6, 0xf6, 0x01 }, { 0x1c, 0x0e, 0x0e, 0x12 }, + { 0xc2, 0x61, 0x61, 0xa3 }, { 0x6a, 0x35, 0x35, 0x5f }, { 0xae, 0x57, 0x57, 0xf9 }, { 0x69, 0xb9, 0xb9, 0xd0 }, + { 0x17, 0x86, 0x86, 0x91 }, { 0x99, 0xc1, 0xc1, 0x58 }, { 0x3a, 0x1d, 0x1d, 0x27 }, { 0x27, 0x9e, 0x9e, 0xb9 }, + { 0xd9, 0xe1, 0xe1, 0x38 }, { 0xeb, 0xf8, 0xf8, 0x13 }, { 0x2b, 0x98, 0x98, 0xb3 }, { 0x22, 0x11, 0x11, 0x33 }, + { 0xd2, 0x69, 0x69, 0xbb }, { 0xa9, 0xd9, 0xd9, 0x70 }, { 0x07, 0x8e, 0x8e, 0x89 }, { 0x33, 0x94, 0x94, 0xa7 }, + { 0x2d, 0x9b, 0x9b, 0xb6 }, { 0x3c, 0x1e, 0x1e, 0x22 }, { 0x15, 0x87, 0x87, 0x92 }, { 0xc9, 0xe9, 0xe9, 0x20 }, + { 0x87, 0xce, 0xce, 0x49 }, { 0xaa, 0x55, 0x55, 0xff }, { 0x50, 0x28, 0x28, 0x78 }, { 0xa5, 0xdf, 0xdf, 0x7a }, + { 0x03, 0x8c, 0x8c, 0x8f }, { 0x59, 0xa1, 0xa1, 0xf8 }, { 0x09, 0x89, 0x89, 0x80 }, { 0x1a, 0x0d, 0x0d, 0x17 }, + { 0x65, 0xbf, 0xbf, 0xda }, { 0xd7, 0xe6, 0xe6, 0x31 }, { 0x84, 0x42, 0x42, 0xc6 }, { 0xd0, 0x68, 0x68, 0xb8 }, + { 0x82, 0x41, 0x41, 0xc3 }, { 0x29, 0x99, 0x99, 0xb0 }, { 0x5a, 0x2d, 0x2d, 0x77 }, { 0x1e, 0x0f, 0x0f, 0x11 }, + { 0x7b, 0xb0, 0xb0, 0xcb }, { 0xa8, 0x54, 0x54, 0xfc }, { 0x6d, 0xbb, 0xbb, 0xd6 }, { 0x2c, 0x16, 0x16, 0x3a } }; -static UINT8 T2[256][4]= -{ - {0xa5,0xc6,0x63,0x63}, {0x84,0xf8,0x7c,0x7c}, {0x99,0xee,0x77,0x77}, {0x8d,0xf6,0x7b,0x7b}, - {0x0d,0xff,0xf2,0xf2}, {0xbd,0xd6,0x6b,0x6b}, {0xb1,0xde,0x6f,0x6f}, {0x54,0x91,0xc5,0xc5}, - {0x50,0x60,0x30,0x30}, {0x03,0x02,0x01,0x01}, {0xa9,0xce,0x67,0x67}, {0x7d,0x56,0x2b,0x2b}, - {0x19,0xe7,0xfe,0xfe}, {0x62,0xb5,0xd7,0xd7}, {0xe6,0x4d,0xab,0xab}, {0x9a,0xec,0x76,0x76}, - {0x45,0x8f,0xca,0xca}, {0x9d,0x1f,0x82,0x82}, {0x40,0x89,0xc9,0xc9}, {0x87,0xfa,0x7d,0x7d}, - {0x15,0xef,0xfa,0xfa}, {0xeb,0xb2,0x59,0x59}, {0xc9,0x8e,0x47,0x47}, {0x0b,0xfb,0xf0,0xf0}, - {0xec,0x41,0xad,0xad}, {0x67,0xb3,0xd4,0xd4}, {0xfd,0x5f,0xa2,0xa2}, {0xea,0x45,0xaf,0xaf}, - {0xbf,0x23,0x9c,0x9c}, {0xf7,0x53,0xa4,0xa4}, {0x96,0xe4,0x72,0x72}, {0x5b,0x9b,0xc0,0xc0}, - {0xc2,0x75,0xb7,0xb7}, {0x1c,0xe1,0xfd,0xfd}, {0xae,0x3d,0x93,0x93}, {0x6a,0x4c,0x26,0x26}, - {0x5a,0x6c,0x36,0x36}, {0x41,0x7e,0x3f,0x3f}, {0x02,0xf5,0xf7,0xf7}, {0x4f,0x83,0xcc,0xcc}, - {0x5c,0x68,0x34,0x34}, {0xf4,0x51,0xa5,0xa5}, {0x34,0xd1,0xe5,0xe5}, {0x08,0xf9,0xf1,0xf1}, - {0x93,0xe2,0x71,0x71}, {0x73,0xab,0xd8,0xd8}, {0x53,0x62,0x31,0x31}, {0x3f,0x2a,0x15,0x15}, - {0x0c,0x08,0x04,0x04}, {0x52,0x95,0xc7,0xc7}, {0x65,0x46,0x23,0x23}, {0x5e,0x9d,0xc3,0xc3}, - {0x28,0x30,0x18,0x18}, {0xa1,0x37,0x96,0x96}, {0x0f,0x0a,0x05,0x05}, {0xb5,0x2f,0x9a,0x9a}, - {0x09,0x0e,0x07,0x07}, {0x36,0x24,0x12,0x12}, {0x9b,0x1b,0x80,0x80}, {0x3d,0xdf,0xe2,0xe2}, - {0x26,0xcd,0xeb,0xeb}, {0x69,0x4e,0x27,0x27}, {0xcd,0x7f,0xb2,0xb2}, {0x9f,0xea,0x75,0x75}, - {0x1b,0x12,0x09,0x09}, {0x9e,0x1d,0x83,0x83}, {0x74,0x58,0x2c,0x2c}, {0x2e,0x34,0x1a,0x1a}, - {0x2d,0x36,0x1b,0x1b}, {0xb2,0xdc,0x6e,0x6e}, {0xee,0xb4,0x5a,0x5a}, {0xfb,0x5b,0xa0,0xa0}, - {0xf6,0xa4,0x52,0x52}, {0x4d,0x76,0x3b,0x3b}, {0x61,0xb7,0xd6,0xd6}, {0xce,0x7d,0xb3,0xb3}, - {0x7b,0x52,0x29,0x29}, {0x3e,0xdd,0xe3,0xe3}, {0x71,0x5e,0x2f,0x2f}, {0x97,0x13,0x84,0x84}, - {0xf5,0xa6,0x53,0x53}, {0x68,0xb9,0xd1,0xd1}, {0x00,0x00,0x00,0x00}, {0x2c,0xc1,0xed,0xed}, - {0x60,0x40,0x20,0x20}, {0x1f,0xe3,0xfc,0xfc}, {0xc8,0x79,0xb1,0xb1}, {0xed,0xb6,0x5b,0x5b}, - {0xbe,0xd4,0x6a,0x6a}, {0x46,0x8d,0xcb,0xcb}, {0xd9,0x67,0xbe,0xbe}, {0x4b,0x72,0x39,0x39}, - {0xde,0x94,0x4a,0x4a}, {0xd4,0x98,0x4c,0x4c}, {0xe8,0xb0,0x58,0x58}, {0x4a,0x85,0xcf,0xcf}, - {0x6b,0xbb,0xd0,0xd0}, {0x2a,0xc5,0xef,0xef}, {0xe5,0x4f,0xaa,0xaa}, {0x16,0xed,0xfb,0xfb}, - {0xc5,0x86,0x43,0x43}, {0xd7,0x9a,0x4d,0x4d}, {0x55,0x66,0x33,0x33}, {0x94,0x11,0x85,0x85}, - {0xcf,0x8a,0x45,0x45}, {0x10,0xe9,0xf9,0xf9}, {0x06,0x04,0x02,0x02}, {0x81,0xfe,0x7f,0x7f}, - {0xf0,0xa0,0x50,0x50}, {0x44,0x78,0x3c,0x3c}, {0xba,0x25,0x9f,0x9f}, {0xe3,0x4b,0xa8,0xa8}, - {0xf3,0xa2,0x51,0x51}, {0xfe,0x5d,0xa3,0xa3}, {0xc0,0x80,0x40,0x40}, {0x8a,0x05,0x8f,0x8f}, - {0xad,0x3f,0x92,0x92}, {0xbc,0x21,0x9d,0x9d}, {0x48,0x70,0x38,0x38}, {0x04,0xf1,0xf5,0xf5}, - {0xdf,0x63,0xbc,0xbc}, {0xc1,0x77,0xb6,0xb6}, {0x75,0xaf,0xda,0xda}, {0x63,0x42,0x21,0x21}, - {0x30,0x20,0x10,0x10}, {0x1a,0xe5,0xff,0xff}, {0x0e,0xfd,0xf3,0xf3}, {0x6d,0xbf,0xd2,0xd2}, - {0x4c,0x81,0xcd,0xcd}, {0x14,0x18,0x0c,0x0c}, {0x35,0x26,0x13,0x13}, {0x2f,0xc3,0xec,0xec}, - {0xe1,0xbe,0x5f,0x5f}, {0xa2,0x35,0x97,0x97}, {0xcc,0x88,0x44,0x44}, {0x39,0x2e,0x17,0x17}, - {0x57,0x93,0xc4,0xc4}, {0xf2,0x55,0xa7,0xa7}, {0x82,0xfc,0x7e,0x7e}, {0x47,0x7a,0x3d,0x3d}, - {0xac,0xc8,0x64,0x64}, {0xe7,0xba,0x5d,0x5d}, {0x2b,0x32,0x19,0x19}, {0x95,0xe6,0x73,0x73}, - {0xa0,0xc0,0x60,0x60}, {0x98,0x19,0x81,0x81}, {0xd1,0x9e,0x4f,0x4f}, {0x7f,0xa3,0xdc,0xdc}, - {0x66,0x44,0x22,0x22}, {0x7e,0x54,0x2a,0x2a}, {0xab,0x3b,0x90,0x90}, {0x83,0x0b,0x88,0x88}, - {0xca,0x8c,0x46,0x46}, {0x29,0xc7,0xee,0xee}, {0xd3,0x6b,0xb8,0xb8}, {0x3c,0x28,0x14,0x14}, - {0x79,0xa7,0xde,0xde}, {0xe2,0xbc,0x5e,0x5e}, {0x1d,0x16,0x0b,0x0b}, {0x76,0xad,0xdb,0xdb}, - {0x3b,0xdb,0xe0,0xe0}, {0x56,0x64,0x32,0x32}, {0x4e,0x74,0x3a,0x3a}, {0x1e,0x14,0x0a,0x0a}, - {0xdb,0x92,0x49,0x49}, {0x0a,0x0c,0x06,0x06}, {0x6c,0x48,0x24,0x24}, {0xe4,0xb8,0x5c,0x5c}, - {0x5d,0x9f,0xc2,0xc2}, {0x6e,0xbd,0xd3,0xd3}, {0xef,0x43,0xac,0xac}, {0xa6,0xc4,0x62,0x62}, - {0xa8,0x39,0x91,0x91}, {0xa4,0x31,0x95,0x95}, {0x37,0xd3,0xe4,0xe4}, {0x8b,0xf2,0x79,0x79}, - {0x32,0xd5,0xe7,0xe7}, {0x43,0x8b,0xc8,0xc8}, {0x59,0x6e,0x37,0x37}, {0xb7,0xda,0x6d,0x6d}, - {0x8c,0x01,0x8d,0x8d}, {0x64,0xb1,0xd5,0xd5}, {0xd2,0x9c,0x4e,0x4e}, {0xe0,0x49,0xa9,0xa9}, - {0xb4,0xd8,0x6c,0x6c}, {0xfa,0xac,0x56,0x56}, {0x07,0xf3,0xf4,0xf4}, {0x25,0xcf,0xea,0xea}, - {0xaf,0xca,0x65,0x65}, {0x8e,0xf4,0x7a,0x7a}, {0xe9,0x47,0xae,0xae}, {0x18,0x10,0x08,0x08}, - {0xd5,0x6f,0xba,0xba}, {0x88,0xf0,0x78,0x78}, {0x6f,0x4a,0x25,0x25}, {0x72,0x5c,0x2e,0x2e}, - {0x24,0x38,0x1c,0x1c}, {0xf1,0x57,0xa6,0xa6}, {0xc7,0x73,0xb4,0xb4}, {0x51,0x97,0xc6,0xc6}, - {0x23,0xcb,0xe8,0xe8}, {0x7c,0xa1,0xdd,0xdd}, {0x9c,0xe8,0x74,0x74}, {0x21,0x3e,0x1f,0x1f}, - {0xdd,0x96,0x4b,0x4b}, {0xdc,0x61,0xbd,0xbd}, {0x86,0x0d,0x8b,0x8b}, {0x85,0x0f,0x8a,0x8a}, - {0x90,0xe0,0x70,0x70}, {0x42,0x7c,0x3e,0x3e}, {0xc4,0x71,0xb5,0xb5}, {0xaa,0xcc,0x66,0x66}, - {0xd8,0x90,0x48,0x48}, {0x05,0x06,0x03,0x03}, {0x01,0xf7,0xf6,0xf6}, {0x12,0x1c,0x0e,0x0e}, - {0xa3,0xc2,0x61,0x61}, {0x5f,0x6a,0x35,0x35}, {0xf9,0xae,0x57,0x57}, {0xd0,0x69,0xb9,0xb9}, - {0x91,0x17,0x86,0x86}, {0x58,0x99,0xc1,0xc1}, {0x27,0x3a,0x1d,0x1d}, {0xb9,0x27,0x9e,0x9e}, - {0x38,0xd9,0xe1,0xe1}, {0x13,0xeb,0xf8,0xf8}, {0xb3,0x2b,0x98,0x98}, {0x33,0x22,0x11,0x11}, - {0xbb,0xd2,0x69,0x69}, {0x70,0xa9,0xd9,0xd9}, {0x89,0x07,0x8e,0x8e}, {0xa7,0x33,0x94,0x94}, - {0xb6,0x2d,0x9b,0x9b}, {0x22,0x3c,0x1e,0x1e}, {0x92,0x15,0x87,0x87}, {0x20,0xc9,0xe9,0xe9}, - {0x49,0x87,0xce,0xce}, {0xff,0xaa,0x55,0x55}, {0x78,0x50,0x28,0x28}, {0x7a,0xa5,0xdf,0xdf}, - {0x8f,0x03,0x8c,0x8c}, {0xf8,0x59,0xa1,0xa1}, {0x80,0x09,0x89,0x89}, {0x17,0x1a,0x0d,0x0d}, - {0xda,0x65,0xbf,0xbf}, {0x31,0xd7,0xe6,0xe6}, {0xc6,0x84,0x42,0x42}, {0xb8,0xd0,0x68,0x68}, - {0xc3,0x82,0x41,0x41}, {0xb0,0x29,0x99,0x99}, {0x77,0x5a,0x2d,0x2d}, {0x11,0x1e,0x0f,0x0f}, - {0xcb,0x7b,0xb0,0xb0}, {0xfc,0xa8,0x54,0x54}, {0xd6,0x6d,0xbb,0xbb}, {0x3a,0x2c,0x16,0x16} +static UINT8 T2[256][4] = { + { 0xa5, 0xc6, 0x63, 0x63 }, { 0x84, 0xf8, 0x7c, 0x7c }, { 0x99, 0xee, 0x77, 0x77 }, { 0x8d, 0xf6, 0x7b, 0x7b }, + { 0x0d, 0xff, 0xf2, 0xf2 }, { 0xbd, 0xd6, 0x6b, 0x6b }, { 0xb1, 0xde, 0x6f, 0x6f }, { 0x54, 0x91, 0xc5, 0xc5 }, + { 0x50, 0x60, 0x30, 0x30 }, { 0x03, 0x02, 0x01, 0x01 }, { 0xa9, 0xce, 0x67, 0x67 }, { 0x7d, 0x56, 0x2b, 0x2b }, + { 0x19, 0xe7, 0xfe, 0xfe }, { 0x62, 0xb5, 0xd7, 0xd7 }, { 0xe6, 0x4d, 0xab, 0xab }, { 0x9a, 0xec, 0x76, 0x76 }, + { 0x45, 0x8f, 0xca, 0xca }, { 0x9d, 0x1f, 0x82, 0x82 }, { 0x40, 0x89, 0xc9, 0xc9 }, { 0x87, 0xfa, 0x7d, 0x7d }, + { 0x15, 0xef, 0xfa, 0xfa }, { 0xeb, 0xb2, 0x59, 0x59 }, { 0xc9, 0x8e, 0x47, 0x47 }, { 0x0b, 0xfb, 0xf0, 0xf0 }, + { 0xec, 0x41, 0xad, 0xad }, { 0x67, 0xb3, 0xd4, 0xd4 }, { 0xfd, 0x5f, 0xa2, 0xa2 }, { 0xea, 0x45, 0xaf, 0xaf }, + { 0xbf, 0x23, 0x9c, 0x9c }, { 0xf7, 0x53, 0xa4, 0xa4 }, { 0x96, 0xe4, 0x72, 0x72 }, { 0x5b, 0x9b, 0xc0, 0xc0 }, + { 0xc2, 0x75, 0xb7, 0xb7 }, { 0x1c, 0xe1, 0xfd, 0xfd }, { 0xae, 0x3d, 0x93, 0x93 }, { 0x6a, 0x4c, 0x26, 0x26 }, + { 0x5a, 0x6c, 0x36, 0x36 }, { 0x41, 0x7e, 0x3f, 0x3f }, { 0x02, 0xf5, 0xf7, 0xf7 }, { 0x4f, 0x83, 0xcc, 0xcc }, + { 0x5c, 0x68, 0x34, 0x34 }, { 0xf4, 0x51, 0xa5, 0xa5 }, { 0x34, 0xd1, 0xe5, 0xe5 }, { 0x08, 0xf9, 0xf1, 0xf1 }, + { 0x93, 0xe2, 0x71, 0x71 }, { 0x73, 0xab, 0xd8, 0xd8 }, { 0x53, 0x62, 0x31, 0x31 }, { 0x3f, 0x2a, 0x15, 0x15 }, + { 0x0c, 0x08, 0x04, 0x04 }, { 0x52, 0x95, 0xc7, 0xc7 }, { 0x65, 0x46, 0x23, 0x23 }, { 0x5e, 0x9d, 0xc3, 0xc3 }, + { 0x28, 0x30, 0x18, 0x18 }, { 0xa1, 0x37, 0x96, 0x96 }, { 0x0f, 0x0a, 0x05, 0x05 }, { 0xb5, 0x2f, 0x9a, 0x9a }, + { 0x09, 0x0e, 0x07, 0x07 }, { 0x36, 0x24, 0x12, 0x12 }, { 0x9b, 0x1b, 0x80, 0x80 }, { 0x3d, 0xdf, 0xe2, 0xe2 }, + { 0x26, 0xcd, 0xeb, 0xeb }, { 0x69, 0x4e, 0x27, 0x27 }, { 0xcd, 0x7f, 0xb2, 0xb2 }, { 0x9f, 0xea, 0x75, 0x75 }, + { 0x1b, 0x12, 0x09, 0x09 }, { 0x9e, 0x1d, 0x83, 0x83 }, { 0x74, 0x58, 0x2c, 0x2c }, { 0x2e, 0x34, 0x1a, 0x1a }, + { 0x2d, 0x36, 0x1b, 0x1b }, { 0xb2, 0xdc, 0x6e, 0x6e }, { 0xee, 0xb4, 0x5a, 0x5a }, { 0xfb, 0x5b, 0xa0, 0xa0 }, + { 0xf6, 0xa4, 0x52, 0x52 }, { 0x4d, 0x76, 0x3b, 0x3b }, { 0x61, 0xb7, 0xd6, 0xd6 }, { 0xce, 0x7d, 0xb3, 0xb3 }, + { 0x7b, 0x52, 0x29, 0x29 }, { 0x3e, 0xdd, 0xe3, 0xe3 }, { 0x71, 0x5e, 0x2f, 0x2f }, { 0x97, 0x13, 0x84, 0x84 }, + { 0xf5, 0xa6, 0x53, 0x53 }, { 0x68, 0xb9, 0xd1, 0xd1 }, { 0x00, 0x00, 0x00, 0x00 }, { 0x2c, 0xc1, 0xed, 0xed }, + { 0x60, 0x40, 0x20, 0x20 }, { 0x1f, 0xe3, 0xfc, 0xfc }, { 0xc8, 0x79, 0xb1, 0xb1 }, { 0xed, 0xb6, 0x5b, 0x5b }, + { 0xbe, 0xd4, 0x6a, 0x6a }, { 0x46, 0x8d, 0xcb, 0xcb }, { 0xd9, 0x67, 0xbe, 0xbe }, { 0x4b, 0x72, 0x39, 0x39 }, + { 0xde, 0x94, 0x4a, 0x4a }, { 0xd4, 0x98, 0x4c, 0x4c }, { 0xe8, 0xb0, 0x58, 0x58 }, { 0x4a, 0x85, 0xcf, 0xcf }, + { 0x6b, 0xbb, 0xd0, 0xd0 }, { 0x2a, 0xc5, 0xef, 0xef }, { 0xe5, 0x4f, 0xaa, 0xaa }, { 0x16, 0xed, 0xfb, 0xfb }, + { 0xc5, 0x86, 0x43, 0x43 }, { 0xd7, 0x9a, 0x4d, 0x4d }, { 0x55, 0x66, 0x33, 0x33 }, { 0x94, 0x11, 0x85, 0x85 }, + { 0xcf, 0x8a, 0x45, 0x45 }, { 0x10, 0xe9, 0xf9, 0xf9 }, { 0x06, 0x04, 0x02, 0x02 }, { 0x81, 0xfe, 0x7f, 0x7f }, + { 0xf0, 0xa0, 0x50, 0x50 }, { 0x44, 0x78, 0x3c, 0x3c }, { 0xba, 0x25, 0x9f, 0x9f }, { 0xe3, 0x4b, 0xa8, 0xa8 }, + { 0xf3, 0xa2, 0x51, 0x51 }, { 0xfe, 0x5d, 0xa3, 0xa3 }, { 0xc0, 0x80, 0x40, 0x40 }, { 0x8a, 0x05, 0x8f, 0x8f }, + { 0xad, 0x3f, 0x92, 0x92 }, { 0xbc, 0x21, 0x9d, 0x9d }, { 0x48, 0x70, 0x38, 0x38 }, { 0x04, 0xf1, 0xf5, 0xf5 }, + { 0xdf, 0x63, 0xbc, 0xbc }, { 0xc1, 0x77, 0xb6, 0xb6 }, { 0x75, 0xaf, 0xda, 0xda }, { 0x63, 0x42, 0x21, 0x21 }, + { 0x30, 0x20, 0x10, 0x10 }, { 0x1a, 0xe5, 0xff, 0xff }, { 0x0e, 0xfd, 0xf3, 0xf3 }, { 0x6d, 0xbf, 0xd2, 0xd2 }, + { 0x4c, 0x81, 0xcd, 0xcd }, { 0x14, 0x18, 0x0c, 0x0c }, { 0x35, 0x26, 0x13, 0x13 }, { 0x2f, 0xc3, 0xec, 0xec }, + { 0xe1, 0xbe, 0x5f, 0x5f }, { 0xa2, 0x35, 0x97, 0x97 }, { 0xcc, 0x88, 0x44, 0x44 }, { 0x39, 0x2e, 0x17, 0x17 }, + { 0x57, 0x93, 0xc4, 0xc4 }, { 0xf2, 0x55, 0xa7, 0xa7 }, { 0x82, 0xfc, 0x7e, 0x7e }, { 0x47, 0x7a, 0x3d, 0x3d }, + { 0xac, 0xc8, 0x64, 0x64 }, { 0xe7, 0xba, 0x5d, 0x5d }, { 0x2b, 0x32, 0x19, 0x19 }, { 0x95, 0xe6, 0x73, 0x73 }, + { 0xa0, 0xc0, 0x60, 0x60 }, { 0x98, 0x19, 0x81, 0x81 }, { 0xd1, 0x9e, 0x4f, 0x4f }, { 0x7f, 0xa3, 0xdc, 0xdc }, + { 0x66, 0x44, 0x22, 0x22 }, { 0x7e, 0x54, 0x2a, 0x2a }, { 0xab, 0x3b, 0x90, 0x90 }, { 0x83, 0x0b, 0x88, 0x88 }, + { 0xca, 0x8c, 0x46, 0x46 }, { 0x29, 0xc7, 0xee, 0xee }, { 0xd3, 0x6b, 0xb8, 0xb8 }, { 0x3c, 0x28, 0x14, 0x14 }, + { 0x79, 0xa7, 0xde, 0xde }, { 0xe2, 0xbc, 0x5e, 0x5e }, { 0x1d, 0x16, 0x0b, 0x0b }, { 0x76, 0xad, 0xdb, 0xdb }, + { 0x3b, 0xdb, 0xe0, 0xe0 }, { 0x56, 0x64, 0x32, 0x32 }, { 0x4e, 0x74, 0x3a, 0x3a }, { 0x1e, 0x14, 0x0a, 0x0a }, + { 0xdb, 0x92, 0x49, 0x49 }, { 0x0a, 0x0c, 0x06, 0x06 }, { 0x6c, 0x48, 0x24, 0x24 }, { 0xe4, 0xb8, 0x5c, 0x5c }, + { 0x5d, 0x9f, 0xc2, 0xc2 }, { 0x6e, 0xbd, 0xd3, 0xd3 }, { 0xef, 0x43, 0xac, 0xac }, { 0xa6, 0xc4, 0x62, 0x62 }, + { 0xa8, 0x39, 0x91, 0x91 }, { 0xa4, 0x31, 0x95, 0x95 }, { 0x37, 0xd3, 0xe4, 0xe4 }, { 0x8b, 0xf2, 0x79, 0x79 }, + { 0x32, 0xd5, 0xe7, 0xe7 }, { 0x43, 0x8b, 0xc8, 0xc8 }, { 0x59, 0x6e, 0x37, 0x37 }, { 0xb7, 0xda, 0x6d, 0x6d }, + { 0x8c, 0x01, 0x8d, 0x8d }, { 0x64, 0xb1, 0xd5, 0xd5 }, { 0xd2, 0x9c, 0x4e, 0x4e }, { 0xe0, 0x49, 0xa9, 0xa9 }, + { 0xb4, 0xd8, 0x6c, 0x6c }, { 0xfa, 0xac, 0x56, 0x56 }, { 0x07, 0xf3, 0xf4, 0xf4 }, { 0x25, 0xcf, 0xea, 0xea }, + { 0xaf, 0xca, 0x65, 0x65 }, { 0x8e, 0xf4, 0x7a, 0x7a }, { 0xe9, 0x47, 0xae, 0xae }, { 0x18, 0x10, 0x08, 0x08 }, + { 0xd5, 0x6f, 0xba, 0xba }, { 0x88, 0xf0, 0x78, 0x78 }, { 0x6f, 0x4a, 0x25, 0x25 }, { 0x72, 0x5c, 0x2e, 0x2e }, + { 0x24, 0x38, 0x1c, 0x1c }, { 0xf1, 0x57, 0xa6, 0xa6 }, { 0xc7, 0x73, 0xb4, 0xb4 }, { 0x51, 0x97, 0xc6, 0xc6 }, + { 0x23, 0xcb, 0xe8, 0xe8 }, { 0x7c, 0xa1, 0xdd, 0xdd }, { 0x9c, 0xe8, 0x74, 0x74 }, { 0x21, 0x3e, 0x1f, 0x1f }, + { 0xdd, 0x96, 0x4b, 0x4b }, { 0xdc, 0x61, 0xbd, 0xbd }, { 0x86, 0x0d, 0x8b, 0x8b }, { 0x85, 0x0f, 0x8a, 0x8a }, + { 0x90, 0xe0, 0x70, 0x70 }, { 0x42, 0x7c, 0x3e, 0x3e }, { 0xc4, 0x71, 0xb5, 0xb5 }, { 0xaa, 0xcc, 0x66, 0x66 }, + { 0xd8, 0x90, 0x48, 0x48 }, { 0x05, 0x06, 0x03, 0x03 }, { 0x01, 0xf7, 0xf6, 0xf6 }, { 0x12, 0x1c, 0x0e, 0x0e }, + { 0xa3, 0xc2, 0x61, 0x61 }, { 0x5f, 0x6a, 0x35, 0x35 }, { 0xf9, 0xae, 0x57, 0x57 }, { 0xd0, 0x69, 0xb9, 0xb9 }, + { 0x91, 0x17, 0x86, 0x86 }, { 0x58, 0x99, 0xc1, 0xc1 }, { 0x27, 0x3a, 0x1d, 0x1d }, { 0xb9, 0x27, 0x9e, 0x9e }, + { 0x38, 0xd9, 0xe1, 0xe1 }, { 0x13, 0xeb, 0xf8, 0xf8 }, { 0xb3, 0x2b, 0x98, 0x98 }, { 0x33, 0x22, 0x11, 0x11 }, + { 0xbb, 0xd2, 0x69, 0x69 }, { 0x70, 0xa9, 0xd9, 0xd9 }, { 0x89, 0x07, 0x8e, 0x8e }, { 0xa7, 0x33, 0x94, 0x94 }, + { 0xb6, 0x2d, 0x9b, 0x9b }, { 0x22, 0x3c, 0x1e, 0x1e }, { 0x92, 0x15, 0x87, 0x87 }, { 0x20, 0xc9, 0xe9, 0xe9 }, + { 0x49, 0x87, 0xce, 0xce }, { 0xff, 0xaa, 0x55, 0x55 }, { 0x78, 0x50, 0x28, 0x28 }, { 0x7a, 0xa5, 0xdf, 0xdf }, + { 0x8f, 0x03, 0x8c, 0x8c }, { 0xf8, 0x59, 0xa1, 0xa1 }, { 0x80, 0x09, 0x89, 0x89 }, { 0x17, 0x1a, 0x0d, 0x0d }, + { 0xda, 0x65, 0xbf, 0xbf }, { 0x31, 0xd7, 0xe6, 0xe6 }, { 0xc6, 0x84, 0x42, 0x42 }, { 0xb8, 0xd0, 0x68, 0x68 }, + { 0xc3, 0x82, 0x41, 0x41 }, { 0xb0, 0x29, 0x99, 0x99 }, { 0x77, 0x5a, 0x2d, 0x2d }, { 0x11, 0x1e, 0x0f, 0x0f }, + { 0xcb, 0x7b, 0xb0, 0xb0 }, { 0xfc, 0xa8, 0x54, 0x54 }, { 0xd6, 0x6d, 0xbb, 0xbb }, { 0x3a, 0x2c, 0x16, 0x16 } }; -static UINT8 T3[256][4]= -{ - {0x63,0xa5,0xc6,0x63}, {0x7c,0x84,0xf8,0x7c}, {0x77,0x99,0xee,0x77}, {0x7b,0x8d,0xf6,0x7b}, - {0xf2,0x0d,0xff,0xf2}, {0x6b,0xbd,0xd6,0x6b}, {0x6f,0xb1,0xde,0x6f}, {0xc5,0x54,0x91,0xc5}, - {0x30,0x50,0x60,0x30}, {0x01,0x03,0x02,0x01}, {0x67,0xa9,0xce,0x67}, {0x2b,0x7d,0x56,0x2b}, - {0xfe,0x19,0xe7,0xfe}, {0xd7,0x62,0xb5,0xd7}, {0xab,0xe6,0x4d,0xab}, {0x76,0x9a,0xec,0x76}, - {0xca,0x45,0x8f,0xca}, {0x82,0x9d,0x1f,0x82}, {0xc9,0x40,0x89,0xc9}, {0x7d,0x87,0xfa,0x7d}, - {0xfa,0x15,0xef,0xfa}, {0x59,0xeb,0xb2,0x59}, {0x47,0xc9,0x8e,0x47}, {0xf0,0x0b,0xfb,0xf0}, - {0xad,0xec,0x41,0xad}, {0xd4,0x67,0xb3,0xd4}, {0xa2,0xfd,0x5f,0xa2}, {0xaf,0xea,0x45,0xaf}, - {0x9c,0xbf,0x23,0x9c}, {0xa4,0xf7,0x53,0xa4}, {0x72,0x96,0xe4,0x72}, {0xc0,0x5b,0x9b,0xc0}, - {0xb7,0xc2,0x75,0xb7}, {0xfd,0x1c,0xe1,0xfd}, {0x93,0xae,0x3d,0x93}, {0x26,0x6a,0x4c,0x26}, - {0x36,0x5a,0x6c,0x36}, {0x3f,0x41,0x7e,0x3f}, {0xf7,0x02,0xf5,0xf7}, {0xcc,0x4f,0x83,0xcc}, - {0x34,0x5c,0x68,0x34}, {0xa5,0xf4,0x51,0xa5}, {0xe5,0x34,0xd1,0xe5}, {0xf1,0x08,0xf9,0xf1}, - {0x71,0x93,0xe2,0x71}, {0xd8,0x73,0xab,0xd8}, {0x31,0x53,0x62,0x31}, {0x15,0x3f,0x2a,0x15}, - {0x04,0x0c,0x08,0x04}, {0xc7,0x52,0x95,0xc7}, {0x23,0x65,0x46,0x23}, {0xc3,0x5e,0x9d,0xc3}, - {0x18,0x28,0x30,0x18}, {0x96,0xa1,0x37,0x96}, {0x05,0x0f,0x0a,0x05}, {0x9a,0xb5,0x2f,0x9a}, - {0x07,0x09,0x0e,0x07}, {0x12,0x36,0x24,0x12}, {0x80,0x9b,0x1b,0x80}, {0xe2,0x3d,0xdf,0xe2}, - {0xeb,0x26,0xcd,0xeb}, {0x27,0x69,0x4e,0x27}, {0xb2,0xcd,0x7f,0xb2}, {0x75,0x9f,0xea,0x75}, - {0x09,0x1b,0x12,0x09}, {0x83,0x9e,0x1d,0x83}, {0x2c,0x74,0x58,0x2c}, {0x1a,0x2e,0x34,0x1a}, - {0x1b,0x2d,0x36,0x1b}, {0x6e,0xb2,0xdc,0x6e}, {0x5a,0xee,0xb4,0x5a}, {0xa0,0xfb,0x5b,0xa0}, - {0x52,0xf6,0xa4,0x52}, {0x3b,0x4d,0x76,0x3b}, {0xd6,0x61,0xb7,0xd6}, {0xb3,0xce,0x7d,0xb3}, - {0x29,0x7b,0x52,0x29}, {0xe3,0x3e,0xdd,0xe3}, {0x2f,0x71,0x5e,0x2f}, {0x84,0x97,0x13,0x84}, - {0x53,0xf5,0xa6,0x53}, {0xd1,0x68,0xb9,0xd1}, {0x00,0x00,0x00,0x00}, {0xed,0x2c,0xc1,0xed}, - {0x20,0x60,0x40,0x20}, {0xfc,0x1f,0xe3,0xfc}, {0xb1,0xc8,0x79,0xb1}, {0x5b,0xed,0xb6,0x5b}, - {0x6a,0xbe,0xd4,0x6a}, {0xcb,0x46,0x8d,0xcb}, {0xbe,0xd9,0x67,0xbe}, {0x39,0x4b,0x72,0x39}, - {0x4a,0xde,0x94,0x4a}, {0x4c,0xd4,0x98,0x4c}, {0x58,0xe8,0xb0,0x58}, {0xcf,0x4a,0x85,0xcf}, - {0xd0,0x6b,0xbb,0xd0}, {0xef,0x2a,0xc5,0xef}, {0xaa,0xe5,0x4f,0xaa}, {0xfb,0x16,0xed,0xfb}, - {0x43,0xc5,0x86,0x43}, {0x4d,0xd7,0x9a,0x4d}, {0x33,0x55,0x66,0x33}, {0x85,0x94,0x11,0x85}, - {0x45,0xcf,0x8a,0x45}, {0xf9,0x10,0xe9,0xf9}, {0x02,0x06,0x04,0x02}, {0x7f,0x81,0xfe,0x7f}, - {0x50,0xf0,0xa0,0x50}, {0x3c,0x44,0x78,0x3c}, {0x9f,0xba,0x25,0x9f}, {0xa8,0xe3,0x4b,0xa8}, - {0x51,0xf3,0xa2,0x51}, {0xa3,0xfe,0x5d,0xa3}, {0x40,0xc0,0x80,0x40}, {0x8f,0x8a,0x05,0x8f}, - {0x92,0xad,0x3f,0x92}, {0x9d,0xbc,0x21,0x9d}, {0x38,0x48,0x70,0x38}, {0xf5,0x04,0xf1,0xf5}, - {0xbc,0xdf,0x63,0xbc}, {0xb6,0xc1,0x77,0xb6}, {0xda,0x75,0xaf,0xda}, {0x21,0x63,0x42,0x21}, - {0x10,0x30,0x20,0x10}, {0xff,0x1a,0xe5,0xff}, {0xf3,0x0e,0xfd,0xf3}, {0xd2,0x6d,0xbf,0xd2}, - {0xcd,0x4c,0x81,0xcd}, {0x0c,0x14,0x18,0x0c}, {0x13,0x35,0x26,0x13}, {0xec,0x2f,0xc3,0xec}, - {0x5f,0xe1,0xbe,0x5f}, {0x97,0xa2,0x35,0x97}, {0x44,0xcc,0x88,0x44}, {0x17,0x39,0x2e,0x17}, - {0xc4,0x57,0x93,0xc4}, {0xa7,0xf2,0x55,0xa7}, {0x7e,0x82,0xfc,0x7e}, {0x3d,0x47,0x7a,0x3d}, - {0x64,0xac,0xc8,0x64}, {0x5d,0xe7,0xba,0x5d}, {0x19,0x2b,0x32,0x19}, {0x73,0x95,0xe6,0x73}, - {0x60,0xa0,0xc0,0x60}, {0x81,0x98,0x19,0x81}, {0x4f,0xd1,0x9e,0x4f}, {0xdc,0x7f,0xa3,0xdc}, - {0x22,0x66,0x44,0x22}, {0x2a,0x7e,0x54,0x2a}, {0x90,0xab,0x3b,0x90}, {0x88,0x83,0x0b,0x88}, - {0x46,0xca,0x8c,0x46}, {0xee,0x29,0xc7,0xee}, {0xb8,0xd3,0x6b,0xb8}, {0x14,0x3c,0x28,0x14}, - {0xde,0x79,0xa7,0xde}, {0x5e,0xe2,0xbc,0x5e}, {0x0b,0x1d,0x16,0x0b}, {0xdb,0x76,0xad,0xdb}, - {0xe0,0x3b,0xdb,0xe0}, {0x32,0x56,0x64,0x32}, {0x3a,0x4e,0x74,0x3a}, {0x0a,0x1e,0x14,0x0a}, - {0x49,0xdb,0x92,0x49}, {0x06,0x0a,0x0c,0x06}, {0x24,0x6c,0x48,0x24}, {0x5c,0xe4,0xb8,0x5c}, - {0xc2,0x5d,0x9f,0xc2}, {0xd3,0x6e,0xbd,0xd3}, {0xac,0xef,0x43,0xac}, {0x62,0xa6,0xc4,0x62}, - {0x91,0xa8,0x39,0x91}, {0x95,0xa4,0x31,0x95}, {0xe4,0x37,0xd3,0xe4}, {0x79,0x8b,0xf2,0x79}, - {0xe7,0x32,0xd5,0xe7}, {0xc8,0x43,0x8b,0xc8}, {0x37,0x59,0x6e,0x37}, {0x6d,0xb7,0xda,0x6d}, - {0x8d,0x8c,0x01,0x8d}, {0xd5,0x64,0xb1,0xd5}, {0x4e,0xd2,0x9c,0x4e}, {0xa9,0xe0,0x49,0xa9}, - {0x6c,0xb4,0xd8,0x6c}, {0x56,0xfa,0xac,0x56}, {0xf4,0x07,0xf3,0xf4}, {0xea,0x25,0xcf,0xea}, - {0x65,0xaf,0xca,0x65}, {0x7a,0x8e,0xf4,0x7a}, {0xae,0xe9,0x47,0xae}, {0x08,0x18,0x10,0x08}, - {0xba,0xd5,0x6f,0xba}, {0x78,0x88,0xf0,0x78}, {0x25,0x6f,0x4a,0x25}, {0x2e,0x72,0x5c,0x2e}, - {0x1c,0x24,0x38,0x1c}, {0xa6,0xf1,0x57,0xa6}, {0xb4,0xc7,0x73,0xb4}, {0xc6,0x51,0x97,0xc6}, - {0xe8,0x23,0xcb,0xe8}, {0xdd,0x7c,0xa1,0xdd}, {0x74,0x9c,0xe8,0x74}, {0x1f,0x21,0x3e,0x1f}, - {0x4b,0xdd,0x96,0x4b}, {0xbd,0xdc,0x61,0xbd}, {0x8b,0x86,0x0d,0x8b}, {0x8a,0x85,0x0f,0x8a}, - {0x70,0x90,0xe0,0x70}, {0x3e,0x42,0x7c,0x3e}, {0xb5,0xc4,0x71,0xb5}, {0x66,0xaa,0xcc,0x66}, - {0x48,0xd8,0x90,0x48}, {0x03,0x05,0x06,0x03}, {0xf6,0x01,0xf7,0xf6}, {0x0e,0x12,0x1c,0x0e}, - {0x61,0xa3,0xc2,0x61}, {0x35,0x5f,0x6a,0x35}, {0x57,0xf9,0xae,0x57}, {0xb9,0xd0,0x69,0xb9}, - {0x86,0x91,0x17,0x86}, {0xc1,0x58,0x99,0xc1}, {0x1d,0x27,0x3a,0x1d}, {0x9e,0xb9,0x27,0x9e}, - {0xe1,0x38,0xd9,0xe1}, {0xf8,0x13,0xeb,0xf8}, {0x98,0xb3,0x2b,0x98}, {0x11,0x33,0x22,0x11}, - {0x69,0xbb,0xd2,0x69}, {0xd9,0x70,0xa9,0xd9}, {0x8e,0x89,0x07,0x8e}, {0x94,0xa7,0x33,0x94}, - {0x9b,0xb6,0x2d,0x9b}, {0x1e,0x22,0x3c,0x1e}, {0x87,0x92,0x15,0x87}, {0xe9,0x20,0xc9,0xe9}, - {0xce,0x49,0x87,0xce}, {0x55,0xff,0xaa,0x55}, {0x28,0x78,0x50,0x28}, {0xdf,0x7a,0xa5,0xdf}, - {0x8c,0x8f,0x03,0x8c}, {0xa1,0xf8,0x59,0xa1}, {0x89,0x80,0x09,0x89}, {0x0d,0x17,0x1a,0x0d}, - {0xbf,0xda,0x65,0xbf}, {0xe6,0x31,0xd7,0xe6}, {0x42,0xc6,0x84,0x42}, {0x68,0xb8,0xd0,0x68}, - {0x41,0xc3,0x82,0x41}, {0x99,0xb0,0x29,0x99}, {0x2d,0x77,0x5a,0x2d}, {0x0f,0x11,0x1e,0x0f}, - {0xb0,0xcb,0x7b,0xb0}, {0x54,0xfc,0xa8,0x54}, {0xbb,0xd6,0x6d,0xbb}, {0x16,0x3a,0x2c,0x16} +static UINT8 T3[256][4] = { + { 0x63, 0xa5, 0xc6, 0x63 }, { 0x7c, 0x84, 0xf8, 0x7c }, { 0x77, 0x99, 0xee, 0x77 }, { 0x7b, 0x8d, 0xf6, 0x7b }, + { 0xf2, 0x0d, 0xff, 0xf2 }, { 0x6b, 0xbd, 0xd6, 0x6b }, { 0x6f, 0xb1, 0xde, 0x6f }, { 0xc5, 0x54, 0x91, 0xc5 }, + { 0x30, 0x50, 0x60, 0x30 }, { 0x01, 0x03, 0x02, 0x01 }, { 0x67, 0xa9, 0xce, 0x67 }, { 0x2b, 0x7d, 0x56, 0x2b }, + { 0xfe, 0x19, 0xe7, 0xfe }, { 0xd7, 0x62, 0xb5, 0xd7 }, { 0xab, 0xe6, 0x4d, 0xab }, { 0x76, 0x9a, 0xec, 0x76 }, + { 0xca, 0x45, 0x8f, 0xca }, { 0x82, 0x9d, 0x1f, 0x82 }, { 0xc9, 0x40, 0x89, 0xc9 }, { 0x7d, 0x87, 0xfa, 0x7d }, + { 0xfa, 0x15, 0xef, 0xfa }, { 0x59, 0xeb, 0xb2, 0x59 }, { 0x47, 0xc9, 0x8e, 0x47 }, { 0xf0, 0x0b, 0xfb, 0xf0 }, + { 0xad, 0xec, 0x41, 0xad }, { 0xd4, 0x67, 0xb3, 0xd4 }, { 0xa2, 0xfd, 0x5f, 0xa2 }, { 0xaf, 0xea, 0x45, 0xaf }, + { 0x9c, 0xbf, 0x23, 0x9c }, { 0xa4, 0xf7, 0x53, 0xa4 }, { 0x72, 0x96, 0xe4, 0x72 }, { 0xc0, 0x5b, 0x9b, 0xc0 }, + { 0xb7, 0xc2, 0x75, 0xb7 }, { 0xfd, 0x1c, 0xe1, 0xfd }, { 0x93, 0xae, 0x3d, 0x93 }, { 0x26, 0x6a, 0x4c, 0x26 }, + { 0x36, 0x5a, 0x6c, 0x36 }, { 0x3f, 0x41, 0x7e, 0x3f }, { 0xf7, 0x02, 0xf5, 0xf7 }, { 0xcc, 0x4f, 0x83, 0xcc }, + { 0x34, 0x5c, 0x68, 0x34 }, { 0xa5, 0xf4, 0x51, 0xa5 }, { 0xe5, 0x34, 0xd1, 0xe5 }, { 0xf1, 0x08, 0xf9, 0xf1 }, + { 0x71, 0x93, 0xe2, 0x71 }, { 0xd8, 0x73, 0xab, 0xd8 }, { 0x31, 0x53, 0x62, 0x31 }, { 0x15, 0x3f, 0x2a, 0x15 }, + { 0x04, 0x0c, 0x08, 0x04 }, { 0xc7, 0x52, 0x95, 0xc7 }, { 0x23, 0x65, 0x46, 0x23 }, { 0xc3, 0x5e, 0x9d, 0xc3 }, + { 0x18, 0x28, 0x30, 0x18 }, { 0x96, 0xa1, 0x37, 0x96 }, { 0x05, 0x0f, 0x0a, 0x05 }, { 0x9a, 0xb5, 0x2f, 0x9a }, + { 0x07, 0x09, 0x0e, 0x07 }, { 0x12, 0x36, 0x24, 0x12 }, { 0x80, 0x9b, 0x1b, 0x80 }, { 0xe2, 0x3d, 0xdf, 0xe2 }, + { 0xeb, 0x26, 0xcd, 0xeb }, { 0x27, 0x69, 0x4e, 0x27 }, { 0xb2, 0xcd, 0x7f, 0xb2 }, { 0x75, 0x9f, 0xea, 0x75 }, + { 0x09, 0x1b, 0x12, 0x09 }, { 0x83, 0x9e, 0x1d, 0x83 }, { 0x2c, 0x74, 0x58, 0x2c }, { 0x1a, 0x2e, 0x34, 0x1a }, + { 0x1b, 0x2d, 0x36, 0x1b }, { 0x6e, 0xb2, 0xdc, 0x6e }, { 0x5a, 0xee, 0xb4, 0x5a }, { 0xa0, 0xfb, 0x5b, 0xa0 }, + { 0x52, 0xf6, 0xa4, 0x52 }, { 0x3b, 0x4d, 0x76, 0x3b }, { 0xd6, 0x61, 0xb7, 0xd6 }, { 0xb3, 0xce, 0x7d, 0xb3 }, + { 0x29, 0x7b, 0x52, 0x29 }, { 0xe3, 0x3e, 0xdd, 0xe3 }, { 0x2f, 0x71, 0x5e, 0x2f }, { 0x84, 0x97, 0x13, 0x84 }, + { 0x53, 0xf5, 0xa6, 0x53 }, { 0xd1, 0x68, 0xb9, 0xd1 }, { 0x00, 0x00, 0x00, 0x00 }, { 0xed, 0x2c, 0xc1, 0xed }, + { 0x20, 0x60, 0x40, 0x20 }, { 0xfc, 0x1f, 0xe3, 0xfc }, { 0xb1, 0xc8, 0x79, 0xb1 }, { 0x5b, 0xed, 0xb6, 0x5b }, + { 0x6a, 0xbe, 0xd4, 0x6a }, { 0xcb, 0x46, 0x8d, 0xcb }, { 0xbe, 0xd9, 0x67, 0xbe }, { 0x39, 0x4b, 0x72, 0x39 }, + { 0x4a, 0xde, 0x94, 0x4a }, { 0x4c, 0xd4, 0x98, 0x4c }, { 0x58, 0xe8, 0xb0, 0x58 }, { 0xcf, 0x4a, 0x85, 0xcf }, + { 0xd0, 0x6b, 0xbb, 0xd0 }, { 0xef, 0x2a, 0xc5, 0xef }, { 0xaa, 0xe5, 0x4f, 0xaa }, { 0xfb, 0x16, 0xed, 0xfb }, + { 0x43, 0xc5, 0x86, 0x43 }, { 0x4d, 0xd7, 0x9a, 0x4d }, { 0x33, 0x55, 0x66, 0x33 }, { 0x85, 0x94, 0x11, 0x85 }, + { 0x45, 0xcf, 0x8a, 0x45 }, { 0xf9, 0x10, 0xe9, 0xf9 }, { 0x02, 0x06, 0x04, 0x02 }, { 0x7f, 0x81, 0xfe, 0x7f }, + { 0x50, 0xf0, 0xa0, 0x50 }, { 0x3c, 0x44, 0x78, 0x3c }, { 0x9f, 0xba, 0x25, 0x9f }, { 0xa8, 0xe3, 0x4b, 0xa8 }, + { 0x51, 0xf3, 0xa2, 0x51 }, { 0xa3, 0xfe, 0x5d, 0xa3 }, { 0x40, 0xc0, 0x80, 0x40 }, { 0x8f, 0x8a, 0x05, 0x8f }, + { 0x92, 0xad, 0x3f, 0x92 }, { 0x9d, 0xbc, 0x21, 0x9d }, { 0x38, 0x48, 0x70, 0x38 }, { 0xf5, 0x04, 0xf1, 0xf5 }, + { 0xbc, 0xdf, 0x63, 0xbc }, { 0xb6, 0xc1, 0x77, 0xb6 }, { 0xda, 0x75, 0xaf, 0xda }, { 0x21, 0x63, 0x42, 0x21 }, + { 0x10, 0x30, 0x20, 0x10 }, { 0xff, 0x1a, 0xe5, 0xff }, { 0xf3, 0x0e, 0xfd, 0xf3 }, { 0xd2, 0x6d, 0xbf, 0xd2 }, + { 0xcd, 0x4c, 0x81, 0xcd }, { 0x0c, 0x14, 0x18, 0x0c }, { 0x13, 0x35, 0x26, 0x13 }, { 0xec, 0x2f, 0xc3, 0xec }, + { 0x5f, 0xe1, 0xbe, 0x5f }, { 0x97, 0xa2, 0x35, 0x97 }, { 0x44, 0xcc, 0x88, 0x44 }, { 0x17, 0x39, 0x2e, 0x17 }, + { 0xc4, 0x57, 0x93, 0xc4 }, { 0xa7, 0xf2, 0x55, 0xa7 }, { 0x7e, 0x82, 0xfc, 0x7e }, { 0x3d, 0x47, 0x7a, 0x3d }, + { 0x64, 0xac, 0xc8, 0x64 }, { 0x5d, 0xe7, 0xba, 0x5d }, { 0x19, 0x2b, 0x32, 0x19 }, { 0x73, 0x95, 0xe6, 0x73 }, + { 0x60, 0xa0, 0xc0, 0x60 }, { 0x81, 0x98, 0x19, 0x81 }, { 0x4f, 0xd1, 0x9e, 0x4f }, { 0xdc, 0x7f, 0xa3, 0xdc }, + { 0x22, 0x66, 0x44, 0x22 }, { 0x2a, 0x7e, 0x54, 0x2a }, { 0x90, 0xab, 0x3b, 0x90 }, { 0x88, 0x83, 0x0b, 0x88 }, + { 0x46, 0xca, 0x8c, 0x46 }, { 0xee, 0x29, 0xc7, 0xee }, { 0xb8, 0xd3, 0x6b, 0xb8 }, { 0x14, 0x3c, 0x28, 0x14 }, + { 0xde, 0x79, 0xa7, 0xde }, { 0x5e, 0xe2, 0xbc, 0x5e }, { 0x0b, 0x1d, 0x16, 0x0b }, { 0xdb, 0x76, 0xad, 0xdb }, + { 0xe0, 0x3b, 0xdb, 0xe0 }, { 0x32, 0x56, 0x64, 0x32 }, { 0x3a, 0x4e, 0x74, 0x3a }, { 0x0a, 0x1e, 0x14, 0x0a }, + { 0x49, 0xdb, 0x92, 0x49 }, { 0x06, 0x0a, 0x0c, 0x06 }, { 0x24, 0x6c, 0x48, 0x24 }, { 0x5c, 0xe4, 0xb8, 0x5c }, + { 0xc2, 0x5d, 0x9f, 0xc2 }, { 0xd3, 0x6e, 0xbd, 0xd3 }, { 0xac, 0xef, 0x43, 0xac }, { 0x62, 0xa6, 0xc4, 0x62 }, + { 0x91, 0xa8, 0x39, 0x91 }, { 0x95, 0xa4, 0x31, 0x95 }, { 0xe4, 0x37, 0xd3, 0xe4 }, { 0x79, 0x8b, 0xf2, 0x79 }, + { 0xe7, 0x32, 0xd5, 0xe7 }, { 0xc8, 0x43, 0x8b, 0xc8 }, { 0x37, 0x59, 0x6e, 0x37 }, { 0x6d, 0xb7, 0xda, 0x6d }, + { 0x8d, 0x8c, 0x01, 0x8d }, { 0xd5, 0x64, 0xb1, 0xd5 }, { 0x4e, 0xd2, 0x9c, 0x4e }, { 0xa9, 0xe0, 0x49, 0xa9 }, + { 0x6c, 0xb4, 0xd8, 0x6c }, { 0x56, 0xfa, 0xac, 0x56 }, { 0xf4, 0x07, 0xf3, 0xf4 }, { 0xea, 0x25, 0xcf, 0xea }, + { 0x65, 0xaf, 0xca, 0x65 }, { 0x7a, 0x8e, 0xf4, 0x7a }, { 0xae, 0xe9, 0x47, 0xae }, { 0x08, 0x18, 0x10, 0x08 }, + { 0xba, 0xd5, 0x6f, 0xba }, { 0x78, 0x88, 0xf0, 0x78 }, { 0x25, 0x6f, 0x4a, 0x25 }, { 0x2e, 0x72, 0x5c, 0x2e }, + { 0x1c, 0x24, 0x38, 0x1c }, { 0xa6, 0xf1, 0x57, 0xa6 }, { 0xb4, 0xc7, 0x73, 0xb4 }, { 0xc6, 0x51, 0x97, 0xc6 }, + { 0xe8, 0x23, 0xcb, 0xe8 }, { 0xdd, 0x7c, 0xa1, 0xdd }, { 0x74, 0x9c, 0xe8, 0x74 }, { 0x1f, 0x21, 0x3e, 0x1f }, + { 0x4b, 0xdd, 0x96, 0x4b }, { 0xbd, 0xdc, 0x61, 0xbd }, { 0x8b, 0x86, 0x0d, 0x8b }, { 0x8a, 0x85, 0x0f, 0x8a }, + { 0x70, 0x90, 0xe0, 0x70 }, { 0x3e, 0x42, 0x7c, 0x3e }, { 0xb5, 0xc4, 0x71, 0xb5 }, { 0x66, 0xaa, 0xcc, 0x66 }, + { 0x48, 0xd8, 0x90, 0x48 }, { 0x03, 0x05, 0x06, 0x03 }, { 0xf6, 0x01, 0xf7, 0xf6 }, { 0x0e, 0x12, 0x1c, 0x0e }, + { 0x61, 0xa3, 0xc2, 0x61 }, { 0x35, 0x5f, 0x6a, 0x35 }, { 0x57, 0xf9, 0xae, 0x57 }, { 0xb9, 0xd0, 0x69, 0xb9 }, + { 0x86, 0x91, 0x17, 0x86 }, { 0xc1, 0x58, 0x99, 0xc1 }, { 0x1d, 0x27, 0x3a, 0x1d }, { 0x9e, 0xb9, 0x27, 0x9e }, + { 0xe1, 0x38, 0xd9, 0xe1 }, { 0xf8, 0x13, 0xeb, 0xf8 }, { 0x98, 0xb3, 0x2b, 0x98 }, { 0x11, 0x33, 0x22, 0x11 }, + { 0x69, 0xbb, 0xd2, 0x69 }, { 0xd9, 0x70, 0xa9, 0xd9 }, { 0x8e, 0x89, 0x07, 0x8e }, { 0x94, 0xa7, 0x33, 0x94 }, + { 0x9b, 0xb6, 0x2d, 0x9b }, { 0x1e, 0x22, 0x3c, 0x1e }, { 0x87, 0x92, 0x15, 0x87 }, { 0xe9, 0x20, 0xc9, 0xe9 }, + { 0xce, 0x49, 0x87, 0xce }, { 0x55, 0xff, 0xaa, 0x55 }, { 0x28, 0x78, 0x50, 0x28 }, { 0xdf, 0x7a, 0xa5, 0xdf }, + { 0x8c, 0x8f, 0x03, 0x8c }, { 0xa1, 0xf8, 0x59, 0xa1 }, { 0x89, 0x80, 0x09, 0x89 }, { 0x0d, 0x17, 0x1a, 0x0d }, + { 0xbf, 0xda, 0x65, 0xbf }, { 0xe6, 0x31, 0xd7, 0xe6 }, { 0x42, 0xc6, 0x84, 0x42 }, { 0x68, 0xb8, 0xd0, 0x68 }, + { 0x41, 0xc3, 0x82, 0x41 }, { 0x99, 0xb0, 0x29, 0x99 }, { 0x2d, 0x77, 0x5a, 0x2d }, { 0x0f, 0x11, 0x1e, 0x0f }, + { 0xb0, 0xcb, 0x7b, 0xb0 }, { 0x54, 0xfc, 0xa8, 0x54 }, { 0xbb, 0xd6, 0x6d, 0xbb }, { 0x16, 0x3a, 0x2c, 0x16 } }; -static UINT8 T4[256][4]= -{ - {0x63,0x63,0xa5,0xc6}, {0x7c,0x7c,0x84,0xf8}, {0x77,0x77,0x99,0xee}, {0x7b,0x7b,0x8d,0xf6}, - {0xf2,0xf2,0x0d,0xff}, {0x6b,0x6b,0xbd,0xd6}, {0x6f,0x6f,0xb1,0xde}, {0xc5,0xc5,0x54,0x91}, - {0x30,0x30,0x50,0x60}, {0x01,0x01,0x03,0x02}, {0x67,0x67,0xa9,0xce}, {0x2b,0x2b,0x7d,0x56}, - {0xfe,0xfe,0x19,0xe7}, {0xd7,0xd7,0x62,0xb5}, {0xab,0xab,0xe6,0x4d}, {0x76,0x76,0x9a,0xec}, - {0xca,0xca,0x45,0x8f}, {0x82,0x82,0x9d,0x1f}, {0xc9,0xc9,0x40,0x89}, {0x7d,0x7d,0x87,0xfa}, - {0xfa,0xfa,0x15,0xef}, {0x59,0x59,0xeb,0xb2}, {0x47,0x47,0xc9,0x8e}, {0xf0,0xf0,0x0b,0xfb}, - {0xad,0xad,0xec,0x41}, {0xd4,0xd4,0x67,0xb3}, {0xa2,0xa2,0xfd,0x5f}, {0xaf,0xaf,0xea,0x45}, - {0x9c,0x9c,0xbf,0x23}, {0xa4,0xa4,0xf7,0x53}, {0x72,0x72,0x96,0xe4}, {0xc0,0xc0,0x5b,0x9b}, - {0xb7,0xb7,0xc2,0x75}, {0xfd,0xfd,0x1c,0xe1}, {0x93,0x93,0xae,0x3d}, {0x26,0x26,0x6a,0x4c}, - {0x36,0x36,0x5a,0x6c}, {0x3f,0x3f,0x41,0x7e}, {0xf7,0xf7,0x02,0xf5}, {0xcc,0xcc,0x4f,0x83}, - {0x34,0x34,0x5c,0x68}, {0xa5,0xa5,0xf4,0x51}, {0xe5,0xe5,0x34,0xd1}, {0xf1,0xf1,0x08,0xf9}, - {0x71,0x71,0x93,0xe2}, {0xd8,0xd8,0x73,0xab}, {0x31,0x31,0x53,0x62}, {0x15,0x15,0x3f,0x2a}, - {0x04,0x04,0x0c,0x08}, {0xc7,0xc7,0x52,0x95}, {0x23,0x23,0x65,0x46}, {0xc3,0xc3,0x5e,0x9d}, - {0x18,0x18,0x28,0x30}, {0x96,0x96,0xa1,0x37}, {0x05,0x05,0x0f,0x0a}, {0x9a,0x9a,0xb5,0x2f}, - {0x07,0x07,0x09,0x0e}, {0x12,0x12,0x36,0x24}, {0x80,0x80,0x9b,0x1b}, {0xe2,0xe2,0x3d,0xdf}, - {0xeb,0xeb,0x26,0xcd}, {0x27,0x27,0x69,0x4e}, {0xb2,0xb2,0xcd,0x7f}, {0x75,0x75,0x9f,0xea}, - {0x09,0x09,0x1b,0x12}, {0x83,0x83,0x9e,0x1d}, {0x2c,0x2c,0x74,0x58}, {0x1a,0x1a,0x2e,0x34}, - {0x1b,0x1b,0x2d,0x36}, {0x6e,0x6e,0xb2,0xdc}, {0x5a,0x5a,0xee,0xb4}, {0xa0,0xa0,0xfb,0x5b}, - {0x52,0x52,0xf6,0xa4}, {0x3b,0x3b,0x4d,0x76}, {0xd6,0xd6,0x61,0xb7}, {0xb3,0xb3,0xce,0x7d}, - {0x29,0x29,0x7b,0x52}, {0xe3,0xe3,0x3e,0xdd}, {0x2f,0x2f,0x71,0x5e}, {0x84,0x84,0x97,0x13}, - {0x53,0x53,0xf5,0xa6}, {0xd1,0xd1,0x68,0xb9}, {0x00,0x00,0x00,0x00}, {0xed,0xed,0x2c,0xc1}, - {0x20,0x20,0x60,0x40}, {0xfc,0xfc,0x1f,0xe3}, {0xb1,0xb1,0xc8,0x79}, {0x5b,0x5b,0xed,0xb6}, - {0x6a,0x6a,0xbe,0xd4}, {0xcb,0xcb,0x46,0x8d}, {0xbe,0xbe,0xd9,0x67}, {0x39,0x39,0x4b,0x72}, - {0x4a,0x4a,0xde,0x94}, {0x4c,0x4c,0xd4,0x98}, {0x58,0x58,0xe8,0xb0}, {0xcf,0xcf,0x4a,0x85}, - {0xd0,0xd0,0x6b,0xbb}, {0xef,0xef,0x2a,0xc5}, {0xaa,0xaa,0xe5,0x4f}, {0xfb,0xfb,0x16,0xed}, - {0x43,0x43,0xc5,0x86}, {0x4d,0x4d,0xd7,0x9a}, {0x33,0x33,0x55,0x66}, {0x85,0x85,0x94,0x11}, - {0x45,0x45,0xcf,0x8a}, {0xf9,0xf9,0x10,0xe9}, {0x02,0x02,0x06,0x04}, {0x7f,0x7f,0x81,0xfe}, - {0x50,0x50,0xf0,0xa0}, {0x3c,0x3c,0x44,0x78}, {0x9f,0x9f,0xba,0x25}, {0xa8,0xa8,0xe3,0x4b}, - {0x51,0x51,0xf3,0xa2}, {0xa3,0xa3,0xfe,0x5d}, {0x40,0x40,0xc0,0x80}, {0x8f,0x8f,0x8a,0x05}, - {0x92,0x92,0xad,0x3f}, {0x9d,0x9d,0xbc,0x21}, {0x38,0x38,0x48,0x70}, {0xf5,0xf5,0x04,0xf1}, - {0xbc,0xbc,0xdf,0x63}, {0xb6,0xb6,0xc1,0x77}, {0xda,0xda,0x75,0xaf}, {0x21,0x21,0x63,0x42}, - {0x10,0x10,0x30,0x20}, {0xff,0xff,0x1a,0xe5}, {0xf3,0xf3,0x0e,0xfd}, {0xd2,0xd2,0x6d,0xbf}, - {0xcd,0xcd,0x4c,0x81}, {0x0c,0x0c,0x14,0x18}, {0x13,0x13,0x35,0x26}, {0xec,0xec,0x2f,0xc3}, - {0x5f,0x5f,0xe1,0xbe}, {0x97,0x97,0xa2,0x35}, {0x44,0x44,0xcc,0x88}, {0x17,0x17,0x39,0x2e}, - {0xc4,0xc4,0x57,0x93}, {0xa7,0xa7,0xf2,0x55}, {0x7e,0x7e,0x82,0xfc}, {0x3d,0x3d,0x47,0x7a}, - {0x64,0x64,0xac,0xc8}, {0x5d,0x5d,0xe7,0xba}, {0x19,0x19,0x2b,0x32}, {0x73,0x73,0x95,0xe6}, - {0x60,0x60,0xa0,0xc0}, {0x81,0x81,0x98,0x19}, {0x4f,0x4f,0xd1,0x9e}, {0xdc,0xdc,0x7f,0xa3}, - {0x22,0x22,0x66,0x44}, {0x2a,0x2a,0x7e,0x54}, {0x90,0x90,0xab,0x3b}, {0x88,0x88,0x83,0x0b}, - {0x46,0x46,0xca,0x8c}, {0xee,0xee,0x29,0xc7}, {0xb8,0xb8,0xd3,0x6b}, {0x14,0x14,0x3c,0x28}, - {0xde,0xde,0x79,0xa7}, {0x5e,0x5e,0xe2,0xbc}, {0x0b,0x0b,0x1d,0x16}, {0xdb,0xdb,0x76,0xad}, - {0xe0,0xe0,0x3b,0xdb}, {0x32,0x32,0x56,0x64}, {0x3a,0x3a,0x4e,0x74}, {0x0a,0x0a,0x1e,0x14}, - {0x49,0x49,0xdb,0x92}, {0x06,0x06,0x0a,0x0c}, {0x24,0x24,0x6c,0x48}, {0x5c,0x5c,0xe4,0xb8}, - {0xc2,0xc2,0x5d,0x9f}, {0xd3,0xd3,0x6e,0xbd}, {0xac,0xac,0xef,0x43}, {0x62,0x62,0xa6,0xc4}, - {0x91,0x91,0xa8,0x39}, {0x95,0x95,0xa4,0x31}, {0xe4,0xe4,0x37,0xd3}, {0x79,0x79,0x8b,0xf2}, - {0xe7,0xe7,0x32,0xd5}, {0xc8,0xc8,0x43,0x8b}, {0x37,0x37,0x59,0x6e}, {0x6d,0x6d,0xb7,0xda}, - {0x8d,0x8d,0x8c,0x01}, {0xd5,0xd5,0x64,0xb1}, {0x4e,0x4e,0xd2,0x9c}, {0xa9,0xa9,0xe0,0x49}, - {0x6c,0x6c,0xb4,0xd8}, {0x56,0x56,0xfa,0xac}, {0xf4,0xf4,0x07,0xf3}, {0xea,0xea,0x25,0xcf}, - {0x65,0x65,0xaf,0xca}, {0x7a,0x7a,0x8e,0xf4}, {0xae,0xae,0xe9,0x47}, {0x08,0x08,0x18,0x10}, - {0xba,0xba,0xd5,0x6f}, {0x78,0x78,0x88,0xf0}, {0x25,0x25,0x6f,0x4a}, {0x2e,0x2e,0x72,0x5c}, - {0x1c,0x1c,0x24,0x38}, {0xa6,0xa6,0xf1,0x57}, {0xb4,0xb4,0xc7,0x73}, {0xc6,0xc6,0x51,0x97}, - {0xe8,0xe8,0x23,0xcb}, {0xdd,0xdd,0x7c,0xa1}, {0x74,0x74,0x9c,0xe8}, {0x1f,0x1f,0x21,0x3e}, - {0x4b,0x4b,0xdd,0x96}, {0xbd,0xbd,0xdc,0x61}, {0x8b,0x8b,0x86,0x0d}, {0x8a,0x8a,0x85,0x0f}, - {0x70,0x70,0x90,0xe0}, {0x3e,0x3e,0x42,0x7c}, {0xb5,0xb5,0xc4,0x71}, {0x66,0x66,0xaa,0xcc}, - {0x48,0x48,0xd8,0x90}, {0x03,0x03,0x05,0x06}, {0xf6,0xf6,0x01,0xf7}, {0x0e,0x0e,0x12,0x1c}, - {0x61,0x61,0xa3,0xc2}, {0x35,0x35,0x5f,0x6a}, {0x57,0x57,0xf9,0xae}, {0xb9,0xb9,0xd0,0x69}, - {0x86,0x86,0x91,0x17}, {0xc1,0xc1,0x58,0x99}, {0x1d,0x1d,0x27,0x3a}, {0x9e,0x9e,0xb9,0x27}, - {0xe1,0xe1,0x38,0xd9}, {0xf8,0xf8,0x13,0xeb}, {0x98,0x98,0xb3,0x2b}, {0x11,0x11,0x33,0x22}, - {0x69,0x69,0xbb,0xd2}, {0xd9,0xd9,0x70,0xa9}, {0x8e,0x8e,0x89,0x07}, {0x94,0x94,0xa7,0x33}, - {0x9b,0x9b,0xb6,0x2d}, {0x1e,0x1e,0x22,0x3c}, {0x87,0x87,0x92,0x15}, {0xe9,0xe9,0x20,0xc9}, - {0xce,0xce,0x49,0x87}, {0x55,0x55,0xff,0xaa}, {0x28,0x28,0x78,0x50}, {0xdf,0xdf,0x7a,0xa5}, - {0x8c,0x8c,0x8f,0x03}, {0xa1,0xa1,0xf8,0x59}, {0x89,0x89,0x80,0x09}, {0x0d,0x0d,0x17,0x1a}, - {0xbf,0xbf,0xda,0x65}, {0xe6,0xe6,0x31,0xd7}, {0x42,0x42,0xc6,0x84}, {0x68,0x68,0xb8,0xd0}, - {0x41,0x41,0xc3,0x82}, {0x99,0x99,0xb0,0x29}, {0x2d,0x2d,0x77,0x5a}, {0x0f,0x0f,0x11,0x1e}, - {0xb0,0xb0,0xcb,0x7b}, {0x54,0x54,0xfc,0xa8}, {0xbb,0xbb,0xd6,0x6d}, {0x16,0x16,0x3a,0x2c} +static UINT8 T4[256][4] = { + { 0x63, 0x63, 0xa5, 0xc6 }, { 0x7c, 0x7c, 0x84, 0xf8 }, { 0x77, 0x77, 0x99, 0xee }, { 0x7b, 0x7b, 0x8d, 0xf6 }, + { 0xf2, 0xf2, 0x0d, 0xff }, { 0x6b, 0x6b, 0xbd, 0xd6 }, { 0x6f, 0x6f, 0xb1, 0xde }, { 0xc5, 0xc5, 0x54, 0x91 }, + { 0x30, 0x30, 0x50, 0x60 }, { 0x01, 0x01, 0x03, 0x02 }, { 0x67, 0x67, 0xa9, 0xce }, { 0x2b, 0x2b, 0x7d, 0x56 }, + { 0xfe, 0xfe, 0x19, 0xe7 }, { 0xd7, 0xd7, 0x62, 0xb5 }, { 0xab, 0xab, 0xe6, 0x4d }, { 0x76, 0x76, 0x9a, 0xec }, + { 0xca, 0xca, 0x45, 0x8f }, { 0x82, 0x82, 0x9d, 0x1f }, { 0xc9, 0xc9, 0x40, 0x89 }, { 0x7d, 0x7d, 0x87, 0xfa }, + { 0xfa, 0xfa, 0x15, 0xef }, { 0x59, 0x59, 0xeb, 0xb2 }, { 0x47, 0x47, 0xc9, 0x8e }, { 0xf0, 0xf0, 0x0b, 0xfb }, + { 0xad, 0xad, 0xec, 0x41 }, { 0xd4, 0xd4, 0x67, 0xb3 }, { 0xa2, 0xa2, 0xfd, 0x5f }, { 0xaf, 0xaf, 0xea, 0x45 }, + { 0x9c, 0x9c, 0xbf, 0x23 }, { 0xa4, 0xa4, 0xf7, 0x53 }, { 0x72, 0x72, 0x96, 0xe4 }, { 0xc0, 0xc0, 0x5b, 0x9b }, + { 0xb7, 0xb7, 0xc2, 0x75 }, { 0xfd, 0xfd, 0x1c, 0xe1 }, { 0x93, 0x93, 0xae, 0x3d }, { 0x26, 0x26, 0x6a, 0x4c }, + { 0x36, 0x36, 0x5a, 0x6c }, { 0x3f, 0x3f, 0x41, 0x7e }, { 0xf7, 0xf7, 0x02, 0xf5 }, { 0xcc, 0xcc, 0x4f, 0x83 }, + { 0x34, 0x34, 0x5c, 0x68 }, { 0xa5, 0xa5, 0xf4, 0x51 }, { 0xe5, 0xe5, 0x34, 0xd1 }, { 0xf1, 0xf1, 0x08, 0xf9 }, + { 0x71, 0x71, 0x93, 0xe2 }, { 0xd8, 0xd8, 0x73, 0xab }, { 0x31, 0x31, 0x53, 0x62 }, { 0x15, 0x15, 0x3f, 0x2a }, + { 0x04, 0x04, 0x0c, 0x08 }, { 0xc7, 0xc7, 0x52, 0x95 }, { 0x23, 0x23, 0x65, 0x46 }, { 0xc3, 0xc3, 0x5e, 0x9d }, + { 0x18, 0x18, 0x28, 0x30 }, { 0x96, 0x96, 0xa1, 0x37 }, { 0x05, 0x05, 0x0f, 0x0a }, { 0x9a, 0x9a, 0xb5, 0x2f }, + { 0x07, 0x07, 0x09, 0x0e }, { 0x12, 0x12, 0x36, 0x24 }, { 0x80, 0x80, 0x9b, 0x1b }, { 0xe2, 0xe2, 0x3d, 0xdf }, + { 0xeb, 0xeb, 0x26, 0xcd }, { 0x27, 0x27, 0x69, 0x4e }, { 0xb2, 0xb2, 0xcd, 0x7f }, { 0x75, 0x75, 0x9f, 0xea }, + { 0x09, 0x09, 0x1b, 0x12 }, { 0x83, 0x83, 0x9e, 0x1d }, { 0x2c, 0x2c, 0x74, 0x58 }, { 0x1a, 0x1a, 0x2e, 0x34 }, + { 0x1b, 0x1b, 0x2d, 0x36 }, { 0x6e, 0x6e, 0xb2, 0xdc }, { 0x5a, 0x5a, 0xee, 0xb4 }, { 0xa0, 0xa0, 0xfb, 0x5b }, + { 0x52, 0x52, 0xf6, 0xa4 }, { 0x3b, 0x3b, 0x4d, 0x76 }, { 0xd6, 0xd6, 0x61, 0xb7 }, { 0xb3, 0xb3, 0xce, 0x7d }, + { 0x29, 0x29, 0x7b, 0x52 }, { 0xe3, 0xe3, 0x3e, 0xdd }, { 0x2f, 0x2f, 0x71, 0x5e }, { 0x84, 0x84, 0x97, 0x13 }, + { 0x53, 0x53, 0xf5, 0xa6 }, { 0xd1, 0xd1, 0x68, 0xb9 }, { 0x00, 0x00, 0x00, 0x00 }, { 0xed, 0xed, 0x2c, 0xc1 }, + { 0x20, 0x20, 0x60, 0x40 }, { 0xfc, 0xfc, 0x1f, 0xe3 }, { 0xb1, 0xb1, 0xc8, 0x79 }, { 0x5b, 0x5b, 0xed, 0xb6 }, + { 0x6a, 0x6a, 0xbe, 0xd4 }, { 0xcb, 0xcb, 0x46, 0x8d }, { 0xbe, 0xbe, 0xd9, 0x67 }, { 0x39, 0x39, 0x4b, 0x72 }, + { 0x4a, 0x4a, 0xde, 0x94 }, { 0x4c, 0x4c, 0xd4, 0x98 }, { 0x58, 0x58, 0xe8, 0xb0 }, { 0xcf, 0xcf, 0x4a, 0x85 }, + { 0xd0, 0xd0, 0x6b, 0xbb }, { 0xef, 0xef, 0x2a, 0xc5 }, { 0xaa, 0xaa, 0xe5, 0x4f }, { 0xfb, 0xfb, 0x16, 0xed }, + { 0x43, 0x43, 0xc5, 0x86 }, { 0x4d, 0x4d, 0xd7, 0x9a }, { 0x33, 0x33, 0x55, 0x66 }, { 0x85, 0x85, 0x94, 0x11 }, + { 0x45, 0x45, 0xcf, 0x8a }, { 0xf9, 0xf9, 0x10, 0xe9 }, { 0x02, 0x02, 0x06, 0x04 }, { 0x7f, 0x7f, 0x81, 0xfe }, + { 0x50, 0x50, 0xf0, 0xa0 }, { 0x3c, 0x3c, 0x44, 0x78 }, { 0x9f, 0x9f, 0xba, 0x25 }, { 0xa8, 0xa8, 0xe3, 0x4b }, + { 0x51, 0x51, 0xf3, 0xa2 }, { 0xa3, 0xa3, 0xfe, 0x5d }, { 0x40, 0x40, 0xc0, 0x80 }, { 0x8f, 0x8f, 0x8a, 0x05 }, + { 0x92, 0x92, 0xad, 0x3f }, { 0x9d, 0x9d, 0xbc, 0x21 }, { 0x38, 0x38, 0x48, 0x70 }, { 0xf5, 0xf5, 0x04, 0xf1 }, + { 0xbc, 0xbc, 0xdf, 0x63 }, { 0xb6, 0xb6, 0xc1, 0x77 }, { 0xda, 0xda, 0x75, 0xaf }, { 0x21, 0x21, 0x63, 0x42 }, + { 0x10, 0x10, 0x30, 0x20 }, { 0xff, 0xff, 0x1a, 0xe5 }, { 0xf3, 0xf3, 0x0e, 0xfd }, { 0xd2, 0xd2, 0x6d, 0xbf }, + { 0xcd, 0xcd, 0x4c, 0x81 }, { 0x0c, 0x0c, 0x14, 0x18 }, { 0x13, 0x13, 0x35, 0x26 }, { 0xec, 0xec, 0x2f, 0xc3 }, + { 0x5f, 0x5f, 0xe1, 0xbe }, { 0x97, 0x97, 0xa2, 0x35 }, { 0x44, 0x44, 0xcc, 0x88 }, { 0x17, 0x17, 0x39, 0x2e }, + { 0xc4, 0xc4, 0x57, 0x93 }, { 0xa7, 0xa7, 0xf2, 0x55 }, { 0x7e, 0x7e, 0x82, 0xfc }, { 0x3d, 0x3d, 0x47, 0x7a }, + { 0x64, 0x64, 0xac, 0xc8 }, { 0x5d, 0x5d, 0xe7, 0xba }, { 0x19, 0x19, 0x2b, 0x32 }, { 0x73, 0x73, 0x95, 0xe6 }, + { 0x60, 0x60, 0xa0, 0xc0 }, { 0x81, 0x81, 0x98, 0x19 }, { 0x4f, 0x4f, 0xd1, 0x9e }, { 0xdc, 0xdc, 0x7f, 0xa3 }, + { 0x22, 0x22, 0x66, 0x44 }, { 0x2a, 0x2a, 0x7e, 0x54 }, { 0x90, 0x90, 0xab, 0x3b }, { 0x88, 0x88, 0x83, 0x0b }, + { 0x46, 0x46, 0xca, 0x8c }, { 0xee, 0xee, 0x29, 0xc7 }, { 0xb8, 0xb8, 0xd3, 0x6b }, { 0x14, 0x14, 0x3c, 0x28 }, + { 0xde, 0xde, 0x79, 0xa7 }, { 0x5e, 0x5e, 0xe2, 0xbc }, { 0x0b, 0x0b, 0x1d, 0x16 }, { 0xdb, 0xdb, 0x76, 0xad }, + { 0xe0, 0xe0, 0x3b, 0xdb }, { 0x32, 0x32, 0x56, 0x64 }, { 0x3a, 0x3a, 0x4e, 0x74 }, { 0x0a, 0x0a, 0x1e, 0x14 }, + { 0x49, 0x49, 0xdb, 0x92 }, { 0x06, 0x06, 0x0a, 0x0c }, { 0x24, 0x24, 0x6c, 0x48 }, { 0x5c, 0x5c, 0xe4, 0xb8 }, + { 0xc2, 0xc2, 0x5d, 0x9f }, { 0xd3, 0xd3, 0x6e, 0xbd }, { 0xac, 0xac, 0xef, 0x43 }, { 0x62, 0x62, 0xa6, 0xc4 }, + { 0x91, 0x91, 0xa8, 0x39 }, { 0x95, 0x95, 0xa4, 0x31 }, { 0xe4, 0xe4, 0x37, 0xd3 }, { 0x79, 0x79, 0x8b, 0xf2 }, + { 0xe7, 0xe7, 0x32, 0xd5 }, { 0xc8, 0xc8, 0x43, 0x8b }, { 0x37, 0x37, 0x59, 0x6e }, { 0x6d, 0x6d, 0xb7, 0xda }, + { 0x8d, 0x8d, 0x8c, 0x01 }, { 0xd5, 0xd5, 0x64, 0xb1 }, { 0x4e, 0x4e, 0xd2, 0x9c }, { 0xa9, 0xa9, 0xe0, 0x49 }, + { 0x6c, 0x6c, 0xb4, 0xd8 }, { 0x56, 0x56, 0xfa, 0xac }, { 0xf4, 0xf4, 0x07, 0xf3 }, { 0xea, 0xea, 0x25, 0xcf }, + { 0x65, 0x65, 0xaf, 0xca }, { 0x7a, 0x7a, 0x8e, 0xf4 }, { 0xae, 0xae, 0xe9, 0x47 }, { 0x08, 0x08, 0x18, 0x10 }, + { 0xba, 0xba, 0xd5, 0x6f }, { 0x78, 0x78, 0x88, 0xf0 }, { 0x25, 0x25, 0x6f, 0x4a }, { 0x2e, 0x2e, 0x72, 0x5c }, + { 0x1c, 0x1c, 0x24, 0x38 }, { 0xa6, 0xa6, 0xf1, 0x57 }, { 0xb4, 0xb4, 0xc7, 0x73 }, { 0xc6, 0xc6, 0x51, 0x97 }, + { 0xe8, 0xe8, 0x23, 0xcb }, { 0xdd, 0xdd, 0x7c, 0xa1 }, { 0x74, 0x74, 0x9c, 0xe8 }, { 0x1f, 0x1f, 0x21, 0x3e }, + { 0x4b, 0x4b, 0xdd, 0x96 }, { 0xbd, 0xbd, 0xdc, 0x61 }, { 0x8b, 0x8b, 0x86, 0x0d }, { 0x8a, 0x8a, 0x85, 0x0f }, + { 0x70, 0x70, 0x90, 0xe0 }, { 0x3e, 0x3e, 0x42, 0x7c }, { 0xb5, 0xb5, 0xc4, 0x71 }, { 0x66, 0x66, 0xaa, 0xcc }, + { 0x48, 0x48, 0xd8, 0x90 }, { 0x03, 0x03, 0x05, 0x06 }, { 0xf6, 0xf6, 0x01, 0xf7 }, { 0x0e, 0x0e, 0x12, 0x1c }, + { 0x61, 0x61, 0xa3, 0xc2 }, { 0x35, 0x35, 0x5f, 0x6a }, { 0x57, 0x57, 0xf9, 0xae }, { 0xb9, 0xb9, 0xd0, 0x69 }, + { 0x86, 0x86, 0x91, 0x17 }, { 0xc1, 0xc1, 0x58, 0x99 }, { 0x1d, 0x1d, 0x27, 0x3a }, { 0x9e, 0x9e, 0xb9, 0x27 }, + { 0xe1, 0xe1, 0x38, 0xd9 }, { 0xf8, 0xf8, 0x13, 0xeb }, { 0x98, 0x98, 0xb3, 0x2b }, { 0x11, 0x11, 0x33, 0x22 }, + { 0x69, 0x69, 0xbb, 0xd2 }, { 0xd9, 0xd9, 0x70, 0xa9 }, { 0x8e, 0x8e, 0x89, 0x07 }, { 0x94, 0x94, 0xa7, 0x33 }, + { 0x9b, 0x9b, 0xb6, 0x2d }, { 0x1e, 0x1e, 0x22, 0x3c }, { 0x87, 0x87, 0x92, 0x15 }, { 0xe9, 0xe9, 0x20, 0xc9 }, + { 0xce, 0xce, 0x49, 0x87 }, { 0x55, 0x55, 0xff, 0xaa }, { 0x28, 0x28, 0x78, 0x50 }, { 0xdf, 0xdf, 0x7a, 0xa5 }, + { 0x8c, 0x8c, 0x8f, 0x03 }, { 0xa1, 0xa1, 0xf8, 0x59 }, { 0x89, 0x89, 0x80, 0x09 }, { 0x0d, 0x0d, 0x17, 0x1a }, + { 0xbf, 0xbf, 0xda, 0x65 }, { 0xe6, 0xe6, 0x31, 0xd7 }, { 0x42, 0x42, 0xc6, 0x84 }, { 0x68, 0x68, 0xb8, 0xd0 }, + { 0x41, 0x41, 0xc3, 0x82 }, { 0x99, 0x99, 0xb0, 0x29 }, { 0x2d, 0x2d, 0x77, 0x5a }, { 0x0f, 0x0f, 0x11, 0x1e }, + { 0xb0, 0xb0, 0xcb, 0x7b }, { 0x54, 0x54, 0xfc, 0xa8 }, { 0xbb, 0xbb, 0xd6, 0x6d }, { 0x16, 0x16, 0x3a, 0x2c } }; -static UINT8 T5[256][4]= -{ - {0x51,0xf4,0xa7,0x50}, {0x7e,0x41,0x65,0x53}, {0x1a,0x17,0xa4,0xc3}, {0x3a,0x27,0x5e,0x96}, - {0x3b,0xab,0x6b,0xcb}, {0x1f,0x9d,0x45,0xf1}, {0xac,0xfa,0x58,0xab}, {0x4b,0xe3,0x03,0x93}, - {0x20,0x30,0xfa,0x55}, {0xad,0x76,0x6d,0xf6}, {0x88,0xcc,0x76,0x91}, {0xf5,0x02,0x4c,0x25}, - {0x4f,0xe5,0xd7,0xfc}, {0xc5,0x2a,0xcb,0xd7}, {0x26,0x35,0x44,0x80}, {0xb5,0x62,0xa3,0x8f}, - {0xde,0xb1,0x5a,0x49}, {0x25,0xba,0x1b,0x67}, {0x45,0xea,0x0e,0x98}, {0x5d,0xfe,0xc0,0xe1}, - {0xc3,0x2f,0x75,0x02}, {0x81,0x4c,0xf0,0x12}, {0x8d,0x46,0x97,0xa3}, {0x6b,0xd3,0xf9,0xc6}, - {0x03,0x8f,0x5f,0xe7}, {0x15,0x92,0x9c,0x95}, {0xbf,0x6d,0x7a,0xeb}, {0x95,0x52,0x59,0xda}, - {0xd4,0xbe,0x83,0x2d}, {0x58,0x74,0x21,0xd3}, {0x49,0xe0,0x69,0x29}, {0x8e,0xc9,0xc8,0x44}, - {0x75,0xc2,0x89,0x6a}, {0xf4,0x8e,0x79,0x78}, {0x99,0x58,0x3e,0x6b}, {0x27,0xb9,0x71,0xdd}, - {0xbe,0xe1,0x4f,0xb6}, {0xf0,0x88,0xad,0x17}, {0xc9,0x20,0xac,0x66}, {0x7d,0xce,0x3a,0xb4}, - {0x63,0xdf,0x4a,0x18}, {0xe5,0x1a,0x31,0x82}, {0x97,0x51,0x33,0x60}, {0x62,0x53,0x7f,0x45}, - {0xb1,0x64,0x77,0xe0}, {0xbb,0x6b,0xae,0x84}, {0xfe,0x81,0xa0,0x1c}, {0xf9,0x08,0x2b,0x94}, - {0x70,0x48,0x68,0x58}, {0x8f,0x45,0xfd,0x19}, {0x94,0xde,0x6c,0x87}, {0x52,0x7b,0xf8,0xb7}, - {0xab,0x73,0xd3,0x23}, {0x72,0x4b,0x02,0xe2}, {0xe3,0x1f,0x8f,0x57}, {0x66,0x55,0xab,0x2a}, - {0xb2,0xeb,0x28,0x07}, {0x2f,0xb5,0xc2,0x03}, {0x86,0xc5,0x7b,0x9a}, {0xd3,0x37,0x08,0xa5}, - {0x30,0x28,0x87,0xf2}, {0x23,0xbf,0xa5,0xb2}, {0x02,0x03,0x6a,0xba}, {0xed,0x16,0x82,0x5c}, - {0x8a,0xcf,0x1c,0x2b}, {0xa7,0x79,0xb4,0x92}, {0xf3,0x07,0xf2,0xf0}, {0x4e,0x69,0xe2,0xa1}, - {0x65,0xda,0xf4,0xcd}, {0x06,0x05,0xbe,0xd5}, {0xd1,0x34,0x62,0x1f}, {0xc4,0xa6,0xfe,0x8a}, - {0x34,0x2e,0x53,0x9d}, {0xa2,0xf3,0x55,0xa0}, {0x05,0x8a,0xe1,0x32}, {0xa4,0xf6,0xeb,0x75}, - {0x0b,0x83,0xec,0x39}, {0x40,0x60,0xef,0xaa}, {0x5e,0x71,0x9f,0x06}, {0xbd,0x6e,0x10,0x51}, - {0x3e,0x21,0x8a,0xf9}, {0x96,0xdd,0x06,0x3d}, {0xdd,0x3e,0x05,0xae}, {0x4d,0xe6,0xbd,0x46}, - {0x91,0x54,0x8d,0xb5}, {0x71,0xc4,0x5d,0x05}, {0x04,0x06,0xd4,0x6f}, {0x60,0x50,0x15,0xff}, - {0x19,0x98,0xfb,0x24}, {0xd6,0xbd,0xe9,0x97}, {0x89,0x40,0x43,0xcc}, {0x67,0xd9,0x9e,0x77}, - {0xb0,0xe8,0x42,0xbd}, {0x07,0x89,0x8b,0x88}, {0xe7,0x19,0x5b,0x38}, {0x79,0xc8,0xee,0xdb}, - {0xa1,0x7c,0x0a,0x47}, {0x7c,0x42,0x0f,0xe9}, {0xf8,0x84,0x1e,0xc9}, {0x00,0x00,0x00,0x00}, - {0x09,0x80,0x86,0x83}, {0x32,0x2b,0xed,0x48}, {0x1e,0x11,0x70,0xac}, {0x6c,0x5a,0x72,0x4e}, - {0xfd,0x0e,0xff,0xfb}, {0x0f,0x85,0x38,0x56}, {0x3d,0xae,0xd5,0x1e}, {0x36,0x2d,0x39,0x27}, - {0x0a,0x0f,0xd9,0x64}, {0x68,0x5c,0xa6,0x21}, {0x9b,0x5b,0x54,0xd1}, {0x24,0x36,0x2e,0x3a}, - {0x0c,0x0a,0x67,0xb1}, {0x93,0x57,0xe7,0x0f}, {0xb4,0xee,0x96,0xd2}, {0x1b,0x9b,0x91,0x9e}, - {0x80,0xc0,0xc5,0x4f}, {0x61,0xdc,0x20,0xa2}, {0x5a,0x77,0x4b,0x69}, {0x1c,0x12,0x1a,0x16}, - {0xe2,0x93,0xba,0x0a}, {0xc0,0xa0,0x2a,0xe5}, {0x3c,0x22,0xe0,0x43}, {0x12,0x1b,0x17,0x1d}, - {0x0e,0x09,0x0d,0x0b}, {0xf2,0x8b,0xc7,0xad}, {0x2d,0xb6,0xa8,0xb9}, {0x14,0x1e,0xa9,0xc8}, - {0x57,0xf1,0x19,0x85}, {0xaf,0x75,0x07,0x4c}, {0xee,0x99,0xdd,0xbb}, {0xa3,0x7f,0x60,0xfd}, - {0xf7,0x01,0x26,0x9f}, {0x5c,0x72,0xf5,0xbc}, {0x44,0x66,0x3b,0xc5}, {0x5b,0xfb,0x7e,0x34}, - {0x8b,0x43,0x29,0x76}, {0xcb,0x23,0xc6,0xdc}, {0xb6,0xed,0xfc,0x68}, {0xb8,0xe4,0xf1,0x63}, - {0xd7,0x31,0xdc,0xca}, {0x42,0x63,0x85,0x10}, {0x13,0x97,0x22,0x40}, {0x84,0xc6,0x11,0x20}, - {0x85,0x4a,0x24,0x7d}, {0xd2,0xbb,0x3d,0xf8}, {0xae,0xf9,0x32,0x11}, {0xc7,0x29,0xa1,0x6d}, - {0x1d,0x9e,0x2f,0x4b}, {0xdc,0xb2,0x30,0xf3}, {0x0d,0x86,0x52,0xec}, {0x77,0xc1,0xe3,0xd0}, - {0x2b,0xb3,0x16,0x6c}, {0xa9,0x70,0xb9,0x99}, {0x11,0x94,0x48,0xfa}, {0x47,0xe9,0x64,0x22}, - {0xa8,0xfc,0x8c,0xc4}, {0xa0,0xf0,0x3f,0x1a}, {0x56,0x7d,0x2c,0xd8}, {0x22,0x33,0x90,0xef}, - {0x87,0x49,0x4e,0xc7}, {0xd9,0x38,0xd1,0xc1}, {0x8c,0xca,0xa2,0xfe}, {0x98,0xd4,0x0b,0x36}, - {0xa6,0xf5,0x81,0xcf}, {0xa5,0x7a,0xde,0x28}, {0xda,0xb7,0x8e,0x26}, {0x3f,0xad,0xbf,0xa4}, - {0x2c,0x3a,0x9d,0xe4}, {0x50,0x78,0x92,0x0d}, {0x6a,0x5f,0xcc,0x9b}, {0x54,0x7e,0x46,0x62}, - {0xf6,0x8d,0x13,0xc2}, {0x90,0xd8,0xb8,0xe8}, {0x2e,0x39,0xf7,0x5e}, {0x82,0xc3,0xaf,0xf5}, - {0x9f,0x5d,0x80,0xbe}, {0x69,0xd0,0x93,0x7c}, {0x6f,0xd5,0x2d,0xa9}, {0xcf,0x25,0x12,0xb3}, - {0xc8,0xac,0x99,0x3b}, {0x10,0x18,0x7d,0xa7}, {0xe8,0x9c,0x63,0x6e}, {0xdb,0x3b,0xbb,0x7b}, - {0xcd,0x26,0x78,0x09}, {0x6e,0x59,0x18,0xf4}, {0xec,0x9a,0xb7,0x01}, {0x83,0x4f,0x9a,0xa8}, - {0xe6,0x95,0x6e,0x65}, {0xaa,0xff,0xe6,0x7e}, {0x21,0xbc,0xcf,0x08}, {0xef,0x15,0xe8,0xe6}, - {0xba,0xe7,0x9b,0xd9}, {0x4a,0x6f,0x36,0xce}, {0xea,0x9f,0x09,0xd4}, {0x29,0xb0,0x7c,0xd6}, - {0x31,0xa4,0xb2,0xaf}, {0x2a,0x3f,0x23,0x31}, {0xc6,0xa5,0x94,0x30}, {0x35,0xa2,0x66,0xc0}, - {0x74,0x4e,0xbc,0x37}, {0xfc,0x82,0xca,0xa6}, {0xe0,0x90,0xd0,0xb0}, {0x33,0xa7,0xd8,0x15}, - {0xf1,0x04,0x98,0x4a}, {0x41,0xec,0xda,0xf7}, {0x7f,0xcd,0x50,0x0e}, {0x17,0x91,0xf6,0x2f}, - {0x76,0x4d,0xd6,0x8d}, {0x43,0xef,0xb0,0x4d}, {0xcc,0xaa,0x4d,0x54}, {0xe4,0x96,0x04,0xdf}, - {0x9e,0xd1,0xb5,0xe3}, {0x4c,0x6a,0x88,0x1b}, {0xc1,0x2c,0x1f,0xb8}, {0x46,0x65,0x51,0x7f}, - {0x9d,0x5e,0xea,0x04}, {0x01,0x8c,0x35,0x5d}, {0xfa,0x87,0x74,0x73}, {0xfb,0x0b,0x41,0x2e}, - {0xb3,0x67,0x1d,0x5a}, {0x92,0xdb,0xd2,0x52}, {0xe9,0x10,0x56,0x33}, {0x6d,0xd6,0x47,0x13}, - {0x9a,0xd7,0x61,0x8c}, {0x37,0xa1,0x0c,0x7a}, {0x59,0xf8,0x14,0x8e}, {0xeb,0x13,0x3c,0x89}, - {0xce,0xa9,0x27,0xee}, {0xb7,0x61,0xc9,0x35}, {0xe1,0x1c,0xe5,0xed}, {0x7a,0x47,0xb1,0x3c}, - {0x9c,0xd2,0xdf,0x59}, {0x55,0xf2,0x73,0x3f}, {0x18,0x14,0xce,0x79}, {0x73,0xc7,0x37,0xbf}, - {0x53,0xf7,0xcd,0xea}, {0x5f,0xfd,0xaa,0x5b}, {0xdf,0x3d,0x6f,0x14}, {0x78,0x44,0xdb,0x86}, - {0xca,0xaf,0xf3,0x81}, {0xb9,0x68,0xc4,0x3e}, {0x38,0x24,0x34,0x2c}, {0xc2,0xa3,0x40,0x5f}, - {0x16,0x1d,0xc3,0x72}, {0xbc,0xe2,0x25,0x0c}, {0x28,0x3c,0x49,0x8b}, {0xff,0x0d,0x95,0x41}, - {0x39,0xa8,0x01,0x71}, {0x08,0x0c,0xb3,0xde}, {0xd8,0xb4,0xe4,0x9c}, {0x64,0x56,0xc1,0x90}, - {0x7b,0xcb,0x84,0x61}, {0xd5,0x32,0xb6,0x70}, {0x48,0x6c,0x5c,0x74}, {0xd0,0xb8,0x57,0x42} +static UINT8 T5[256][4] = { + { 0x51, 0xf4, 0xa7, 0x50 }, { 0x7e, 0x41, 0x65, 0x53 }, { 0x1a, 0x17, 0xa4, 0xc3 }, { 0x3a, 0x27, 0x5e, 0x96 }, + { 0x3b, 0xab, 0x6b, 0xcb }, { 0x1f, 0x9d, 0x45, 0xf1 }, { 0xac, 0xfa, 0x58, 0xab }, { 0x4b, 0xe3, 0x03, 0x93 }, + { 0x20, 0x30, 0xfa, 0x55 }, { 0xad, 0x76, 0x6d, 0xf6 }, { 0x88, 0xcc, 0x76, 0x91 }, { 0xf5, 0x02, 0x4c, 0x25 }, + { 0x4f, 0xe5, 0xd7, 0xfc }, { 0xc5, 0x2a, 0xcb, 0xd7 }, { 0x26, 0x35, 0x44, 0x80 }, { 0xb5, 0x62, 0xa3, 0x8f }, + { 0xde, 0xb1, 0x5a, 0x49 }, { 0x25, 0xba, 0x1b, 0x67 }, { 0x45, 0xea, 0x0e, 0x98 }, { 0x5d, 0xfe, 0xc0, 0xe1 }, + { 0xc3, 0x2f, 0x75, 0x02 }, { 0x81, 0x4c, 0xf0, 0x12 }, { 0x8d, 0x46, 0x97, 0xa3 }, { 0x6b, 0xd3, 0xf9, 0xc6 }, + { 0x03, 0x8f, 0x5f, 0xe7 }, { 0x15, 0x92, 0x9c, 0x95 }, { 0xbf, 0x6d, 0x7a, 0xeb }, { 0x95, 0x52, 0x59, 0xda }, + { 0xd4, 0xbe, 0x83, 0x2d }, { 0x58, 0x74, 0x21, 0xd3 }, { 0x49, 0xe0, 0x69, 0x29 }, { 0x8e, 0xc9, 0xc8, 0x44 }, + { 0x75, 0xc2, 0x89, 0x6a }, { 0xf4, 0x8e, 0x79, 0x78 }, { 0x99, 0x58, 0x3e, 0x6b }, { 0x27, 0xb9, 0x71, 0xdd }, + { 0xbe, 0xe1, 0x4f, 0xb6 }, { 0xf0, 0x88, 0xad, 0x17 }, { 0xc9, 0x20, 0xac, 0x66 }, { 0x7d, 0xce, 0x3a, 0xb4 }, + { 0x63, 0xdf, 0x4a, 0x18 }, { 0xe5, 0x1a, 0x31, 0x82 }, { 0x97, 0x51, 0x33, 0x60 }, { 0x62, 0x53, 0x7f, 0x45 }, + { 0xb1, 0x64, 0x77, 0xe0 }, { 0xbb, 0x6b, 0xae, 0x84 }, { 0xfe, 0x81, 0xa0, 0x1c }, { 0xf9, 0x08, 0x2b, 0x94 }, + { 0x70, 0x48, 0x68, 0x58 }, { 0x8f, 0x45, 0xfd, 0x19 }, { 0x94, 0xde, 0x6c, 0x87 }, { 0x52, 0x7b, 0xf8, 0xb7 }, + { 0xab, 0x73, 0xd3, 0x23 }, { 0x72, 0x4b, 0x02, 0xe2 }, { 0xe3, 0x1f, 0x8f, 0x57 }, { 0x66, 0x55, 0xab, 0x2a }, + { 0xb2, 0xeb, 0x28, 0x07 }, { 0x2f, 0xb5, 0xc2, 0x03 }, { 0x86, 0xc5, 0x7b, 0x9a }, { 0xd3, 0x37, 0x08, 0xa5 }, + { 0x30, 0x28, 0x87, 0xf2 }, { 0x23, 0xbf, 0xa5, 0xb2 }, { 0x02, 0x03, 0x6a, 0xba }, { 0xed, 0x16, 0x82, 0x5c }, + { 0x8a, 0xcf, 0x1c, 0x2b }, { 0xa7, 0x79, 0xb4, 0x92 }, { 0xf3, 0x07, 0xf2, 0xf0 }, { 0x4e, 0x69, 0xe2, 0xa1 }, + { 0x65, 0xda, 0xf4, 0xcd }, { 0x06, 0x05, 0xbe, 0xd5 }, { 0xd1, 0x34, 0x62, 0x1f }, { 0xc4, 0xa6, 0xfe, 0x8a }, + { 0x34, 0x2e, 0x53, 0x9d }, { 0xa2, 0xf3, 0x55, 0xa0 }, { 0x05, 0x8a, 0xe1, 0x32 }, { 0xa4, 0xf6, 0xeb, 0x75 }, + { 0x0b, 0x83, 0xec, 0x39 }, { 0x40, 0x60, 0xef, 0xaa }, { 0x5e, 0x71, 0x9f, 0x06 }, { 0xbd, 0x6e, 0x10, 0x51 }, + { 0x3e, 0x21, 0x8a, 0xf9 }, { 0x96, 0xdd, 0x06, 0x3d }, { 0xdd, 0x3e, 0x05, 0xae }, { 0x4d, 0xe6, 0xbd, 0x46 }, + { 0x91, 0x54, 0x8d, 0xb5 }, { 0x71, 0xc4, 0x5d, 0x05 }, { 0x04, 0x06, 0xd4, 0x6f }, { 0x60, 0x50, 0x15, 0xff }, + { 0x19, 0x98, 0xfb, 0x24 }, { 0xd6, 0xbd, 0xe9, 0x97 }, { 0x89, 0x40, 0x43, 0xcc }, { 0x67, 0xd9, 0x9e, 0x77 }, + { 0xb0, 0xe8, 0x42, 0xbd }, { 0x07, 0x89, 0x8b, 0x88 }, { 0xe7, 0x19, 0x5b, 0x38 }, { 0x79, 0xc8, 0xee, 0xdb }, + { 0xa1, 0x7c, 0x0a, 0x47 }, { 0x7c, 0x42, 0x0f, 0xe9 }, { 0xf8, 0x84, 0x1e, 0xc9 }, { 0x00, 0x00, 0x00, 0x00 }, + { 0x09, 0x80, 0x86, 0x83 }, { 0x32, 0x2b, 0xed, 0x48 }, { 0x1e, 0x11, 0x70, 0xac }, { 0x6c, 0x5a, 0x72, 0x4e }, + { 0xfd, 0x0e, 0xff, 0xfb }, { 0x0f, 0x85, 0x38, 0x56 }, { 0x3d, 0xae, 0xd5, 0x1e }, { 0x36, 0x2d, 0x39, 0x27 }, + { 0x0a, 0x0f, 0xd9, 0x64 }, { 0x68, 0x5c, 0xa6, 0x21 }, { 0x9b, 0x5b, 0x54, 0xd1 }, { 0x24, 0x36, 0x2e, 0x3a }, + { 0x0c, 0x0a, 0x67, 0xb1 }, { 0x93, 0x57, 0xe7, 0x0f }, { 0xb4, 0xee, 0x96, 0xd2 }, { 0x1b, 0x9b, 0x91, 0x9e }, + { 0x80, 0xc0, 0xc5, 0x4f }, { 0x61, 0xdc, 0x20, 0xa2 }, { 0x5a, 0x77, 0x4b, 0x69 }, { 0x1c, 0x12, 0x1a, 0x16 }, + { 0xe2, 0x93, 0xba, 0x0a }, { 0xc0, 0xa0, 0x2a, 0xe5 }, { 0x3c, 0x22, 0xe0, 0x43 }, { 0x12, 0x1b, 0x17, 0x1d }, + { 0x0e, 0x09, 0x0d, 0x0b }, { 0xf2, 0x8b, 0xc7, 0xad }, { 0x2d, 0xb6, 0xa8, 0xb9 }, { 0x14, 0x1e, 0xa9, 0xc8 }, + { 0x57, 0xf1, 0x19, 0x85 }, { 0xaf, 0x75, 0x07, 0x4c }, { 0xee, 0x99, 0xdd, 0xbb }, { 0xa3, 0x7f, 0x60, 0xfd }, + { 0xf7, 0x01, 0x26, 0x9f }, { 0x5c, 0x72, 0xf5, 0xbc }, { 0x44, 0x66, 0x3b, 0xc5 }, { 0x5b, 0xfb, 0x7e, 0x34 }, + { 0x8b, 0x43, 0x29, 0x76 }, { 0xcb, 0x23, 0xc6, 0xdc }, { 0xb6, 0xed, 0xfc, 0x68 }, { 0xb8, 0xe4, 0xf1, 0x63 }, + { 0xd7, 0x31, 0xdc, 0xca }, { 0x42, 0x63, 0x85, 0x10 }, { 0x13, 0x97, 0x22, 0x40 }, { 0x84, 0xc6, 0x11, 0x20 }, + { 0x85, 0x4a, 0x24, 0x7d }, { 0xd2, 0xbb, 0x3d, 0xf8 }, { 0xae, 0xf9, 0x32, 0x11 }, { 0xc7, 0x29, 0xa1, 0x6d }, + { 0x1d, 0x9e, 0x2f, 0x4b }, { 0xdc, 0xb2, 0x30, 0xf3 }, { 0x0d, 0x86, 0x52, 0xec }, { 0x77, 0xc1, 0xe3, 0xd0 }, + { 0x2b, 0xb3, 0x16, 0x6c }, { 0xa9, 0x70, 0xb9, 0x99 }, { 0x11, 0x94, 0x48, 0xfa }, { 0x47, 0xe9, 0x64, 0x22 }, + { 0xa8, 0xfc, 0x8c, 0xc4 }, { 0xa0, 0xf0, 0x3f, 0x1a }, { 0x56, 0x7d, 0x2c, 0xd8 }, { 0x22, 0x33, 0x90, 0xef }, + { 0x87, 0x49, 0x4e, 0xc7 }, { 0xd9, 0x38, 0xd1, 0xc1 }, { 0x8c, 0xca, 0xa2, 0xfe }, { 0x98, 0xd4, 0x0b, 0x36 }, + { 0xa6, 0xf5, 0x81, 0xcf }, { 0xa5, 0x7a, 0xde, 0x28 }, { 0xda, 0xb7, 0x8e, 0x26 }, { 0x3f, 0xad, 0xbf, 0xa4 }, + { 0x2c, 0x3a, 0x9d, 0xe4 }, { 0x50, 0x78, 0x92, 0x0d }, { 0x6a, 0x5f, 0xcc, 0x9b }, { 0x54, 0x7e, 0x46, 0x62 }, + { 0xf6, 0x8d, 0x13, 0xc2 }, { 0x90, 0xd8, 0xb8, 0xe8 }, { 0x2e, 0x39, 0xf7, 0x5e }, { 0x82, 0xc3, 0xaf, 0xf5 }, + { 0x9f, 0x5d, 0x80, 0xbe }, { 0x69, 0xd0, 0x93, 0x7c }, { 0x6f, 0xd5, 0x2d, 0xa9 }, { 0xcf, 0x25, 0x12, 0xb3 }, + { 0xc8, 0xac, 0x99, 0x3b }, { 0x10, 0x18, 0x7d, 0xa7 }, { 0xe8, 0x9c, 0x63, 0x6e }, { 0xdb, 0x3b, 0xbb, 0x7b }, + { 0xcd, 0x26, 0x78, 0x09 }, { 0x6e, 0x59, 0x18, 0xf4 }, { 0xec, 0x9a, 0xb7, 0x01 }, { 0x83, 0x4f, 0x9a, 0xa8 }, + { 0xe6, 0x95, 0x6e, 0x65 }, { 0xaa, 0xff, 0xe6, 0x7e }, { 0x21, 0xbc, 0xcf, 0x08 }, { 0xef, 0x15, 0xe8, 0xe6 }, + { 0xba, 0xe7, 0x9b, 0xd9 }, { 0x4a, 0x6f, 0x36, 0xce }, { 0xea, 0x9f, 0x09, 0xd4 }, { 0x29, 0xb0, 0x7c, 0xd6 }, + { 0x31, 0xa4, 0xb2, 0xaf }, { 0x2a, 0x3f, 0x23, 0x31 }, { 0xc6, 0xa5, 0x94, 0x30 }, { 0x35, 0xa2, 0x66, 0xc0 }, + { 0x74, 0x4e, 0xbc, 0x37 }, { 0xfc, 0x82, 0xca, 0xa6 }, { 0xe0, 0x90, 0xd0, 0xb0 }, { 0x33, 0xa7, 0xd8, 0x15 }, + { 0xf1, 0x04, 0x98, 0x4a }, { 0x41, 0xec, 0xda, 0xf7 }, { 0x7f, 0xcd, 0x50, 0x0e }, { 0x17, 0x91, 0xf6, 0x2f }, + { 0x76, 0x4d, 0xd6, 0x8d }, { 0x43, 0xef, 0xb0, 0x4d }, { 0xcc, 0xaa, 0x4d, 0x54 }, { 0xe4, 0x96, 0x04, 0xdf }, + { 0x9e, 0xd1, 0xb5, 0xe3 }, { 0x4c, 0x6a, 0x88, 0x1b }, { 0xc1, 0x2c, 0x1f, 0xb8 }, { 0x46, 0x65, 0x51, 0x7f }, + { 0x9d, 0x5e, 0xea, 0x04 }, { 0x01, 0x8c, 0x35, 0x5d }, { 0xfa, 0x87, 0x74, 0x73 }, { 0xfb, 0x0b, 0x41, 0x2e }, + { 0xb3, 0x67, 0x1d, 0x5a }, { 0x92, 0xdb, 0xd2, 0x52 }, { 0xe9, 0x10, 0x56, 0x33 }, { 0x6d, 0xd6, 0x47, 0x13 }, + { 0x9a, 0xd7, 0x61, 0x8c }, { 0x37, 0xa1, 0x0c, 0x7a }, { 0x59, 0xf8, 0x14, 0x8e }, { 0xeb, 0x13, 0x3c, 0x89 }, + { 0xce, 0xa9, 0x27, 0xee }, { 0xb7, 0x61, 0xc9, 0x35 }, { 0xe1, 0x1c, 0xe5, 0xed }, { 0x7a, 0x47, 0xb1, 0x3c }, + { 0x9c, 0xd2, 0xdf, 0x59 }, { 0x55, 0xf2, 0x73, 0x3f }, { 0x18, 0x14, 0xce, 0x79 }, { 0x73, 0xc7, 0x37, 0xbf }, + { 0x53, 0xf7, 0xcd, 0xea }, { 0x5f, 0xfd, 0xaa, 0x5b }, { 0xdf, 0x3d, 0x6f, 0x14 }, { 0x78, 0x44, 0xdb, 0x86 }, + { 0xca, 0xaf, 0xf3, 0x81 }, { 0xb9, 0x68, 0xc4, 0x3e }, { 0x38, 0x24, 0x34, 0x2c }, { 0xc2, 0xa3, 0x40, 0x5f }, + { 0x16, 0x1d, 0xc3, 0x72 }, { 0xbc, 0xe2, 0x25, 0x0c }, { 0x28, 0x3c, 0x49, 0x8b }, { 0xff, 0x0d, 0x95, 0x41 }, + { 0x39, 0xa8, 0x01, 0x71 }, { 0x08, 0x0c, 0xb3, 0xde }, { 0xd8, 0xb4, 0xe4, 0x9c }, { 0x64, 0x56, 0xc1, 0x90 }, + { 0x7b, 0xcb, 0x84, 0x61 }, { 0xd5, 0x32, 0xb6, 0x70 }, { 0x48, 0x6c, 0x5c, 0x74 }, { 0xd0, 0xb8, 0x57, 0x42 } }; -static UINT8 T6[256][4]= -{ - {0x50,0x51,0xf4,0xa7}, {0x53,0x7e,0x41,0x65}, {0xc3,0x1a,0x17,0xa4}, {0x96,0x3a,0x27,0x5e}, - {0xcb,0x3b,0xab,0x6b}, {0xf1,0x1f,0x9d,0x45}, {0xab,0xac,0xfa,0x58}, {0x93,0x4b,0xe3,0x03}, - {0x55,0x20,0x30,0xfa}, {0xf6,0xad,0x76,0x6d}, {0x91,0x88,0xcc,0x76}, {0x25,0xf5,0x02,0x4c}, - {0xfc,0x4f,0xe5,0xd7}, {0xd7,0xc5,0x2a,0xcb}, {0x80,0x26,0x35,0x44}, {0x8f,0xb5,0x62,0xa3}, - {0x49,0xde,0xb1,0x5a}, {0x67,0x25,0xba,0x1b}, {0x98,0x45,0xea,0x0e}, {0xe1,0x5d,0xfe,0xc0}, - {0x02,0xc3,0x2f,0x75}, {0x12,0x81,0x4c,0xf0}, {0xa3,0x8d,0x46,0x97}, {0xc6,0x6b,0xd3,0xf9}, - {0xe7,0x03,0x8f,0x5f}, {0x95,0x15,0x92,0x9c}, {0xeb,0xbf,0x6d,0x7a}, {0xda,0x95,0x52,0x59}, - {0x2d,0xd4,0xbe,0x83}, {0xd3,0x58,0x74,0x21}, {0x29,0x49,0xe0,0x69}, {0x44,0x8e,0xc9,0xc8}, - {0x6a,0x75,0xc2,0x89}, {0x78,0xf4,0x8e,0x79}, {0x6b,0x99,0x58,0x3e}, {0xdd,0x27,0xb9,0x71}, - {0xb6,0xbe,0xe1,0x4f}, {0x17,0xf0,0x88,0xad}, {0x66,0xc9,0x20,0xac}, {0xb4,0x7d,0xce,0x3a}, - {0x18,0x63,0xdf,0x4a}, {0x82,0xe5,0x1a,0x31}, {0x60,0x97,0x51,0x33}, {0x45,0x62,0x53,0x7f}, - {0xe0,0xb1,0x64,0x77}, {0x84,0xbb,0x6b,0xae}, {0x1c,0xfe,0x81,0xa0}, {0x94,0xf9,0x08,0x2b}, - {0x58,0x70,0x48,0x68}, {0x19,0x8f,0x45,0xfd}, {0x87,0x94,0xde,0x6c}, {0xb7,0x52,0x7b,0xf8}, - {0x23,0xab,0x73,0xd3}, {0xe2,0x72,0x4b,0x02}, {0x57,0xe3,0x1f,0x8f}, {0x2a,0x66,0x55,0xab}, - {0x07,0xb2,0xeb,0x28}, {0x03,0x2f,0xb5,0xc2}, {0x9a,0x86,0xc5,0x7b}, {0xa5,0xd3,0x37,0x08}, - {0xf2,0x30,0x28,0x87}, {0xb2,0x23,0xbf,0xa5}, {0xba,0x02,0x03,0x6a}, {0x5c,0xed,0x16,0x82}, - {0x2b,0x8a,0xcf,0x1c}, {0x92,0xa7,0x79,0xb4}, {0xf0,0xf3,0x07,0xf2}, {0xa1,0x4e,0x69,0xe2}, - {0xcd,0x65,0xda,0xf4}, {0xd5,0x06,0x05,0xbe}, {0x1f,0xd1,0x34,0x62}, {0x8a,0xc4,0xa6,0xfe}, - {0x9d,0x34,0x2e,0x53}, {0xa0,0xa2,0xf3,0x55}, {0x32,0x05,0x8a,0xe1}, {0x75,0xa4,0xf6,0xeb}, - {0x39,0x0b,0x83,0xec}, {0xaa,0x40,0x60,0xef}, {0x06,0x5e,0x71,0x9f}, {0x51,0xbd,0x6e,0x10}, - {0xf9,0x3e,0x21,0x8a}, {0x3d,0x96,0xdd,0x06}, {0xae,0xdd,0x3e,0x05}, {0x46,0x4d,0xe6,0xbd}, - {0xb5,0x91,0x54,0x8d}, {0x05,0x71,0xc4,0x5d}, {0x6f,0x04,0x06,0xd4}, {0xff,0x60,0x50,0x15}, - {0x24,0x19,0x98,0xfb}, {0x97,0xd6,0xbd,0xe9}, {0xcc,0x89,0x40,0x43}, {0x77,0x67,0xd9,0x9e}, - {0xbd,0xb0,0xe8,0x42}, {0x88,0x07,0x89,0x8b}, {0x38,0xe7,0x19,0x5b}, {0xdb,0x79,0xc8,0xee}, - {0x47,0xa1,0x7c,0x0a}, {0xe9,0x7c,0x42,0x0f}, {0xc9,0xf8,0x84,0x1e}, {0x00,0x00,0x00,0x00}, - {0x83,0x09,0x80,0x86}, {0x48,0x32,0x2b,0xed}, {0xac,0x1e,0x11,0x70}, {0x4e,0x6c,0x5a,0x72}, - {0xfb,0xfd,0x0e,0xff}, {0x56,0x0f,0x85,0x38}, {0x1e,0x3d,0xae,0xd5}, {0x27,0x36,0x2d,0x39}, - {0x64,0x0a,0x0f,0xd9}, {0x21,0x68,0x5c,0xa6}, {0xd1,0x9b,0x5b,0x54}, {0x3a,0x24,0x36,0x2e}, - {0xb1,0x0c,0x0a,0x67}, {0x0f,0x93,0x57,0xe7}, {0xd2,0xb4,0xee,0x96}, {0x9e,0x1b,0x9b,0x91}, - {0x4f,0x80,0xc0,0xc5}, {0xa2,0x61,0xdc,0x20}, {0x69,0x5a,0x77,0x4b}, {0x16,0x1c,0x12,0x1a}, - {0x0a,0xe2,0x93,0xba}, {0xe5,0xc0,0xa0,0x2a}, {0x43,0x3c,0x22,0xe0}, {0x1d,0x12,0x1b,0x17}, - {0x0b,0x0e,0x09,0x0d}, {0xad,0xf2,0x8b,0xc7}, {0xb9,0x2d,0xb6,0xa8}, {0xc8,0x14,0x1e,0xa9}, - {0x85,0x57,0xf1,0x19}, {0x4c,0xaf,0x75,0x07}, {0xbb,0xee,0x99,0xdd}, {0xfd,0xa3,0x7f,0x60}, - {0x9f,0xf7,0x01,0x26}, {0xbc,0x5c,0x72,0xf5}, {0xc5,0x44,0x66,0x3b}, {0x34,0x5b,0xfb,0x7e}, - {0x76,0x8b,0x43,0x29}, {0xdc,0xcb,0x23,0xc6}, {0x68,0xb6,0xed,0xfc}, {0x63,0xb8,0xe4,0xf1}, - {0xca,0xd7,0x31,0xdc}, {0x10,0x42,0x63,0x85}, {0x40,0x13,0x97,0x22}, {0x20,0x84,0xc6,0x11}, - {0x7d,0x85,0x4a,0x24}, {0xf8,0xd2,0xbb,0x3d}, {0x11,0xae,0xf9,0x32}, {0x6d,0xc7,0x29,0xa1}, - {0x4b,0x1d,0x9e,0x2f}, {0xf3,0xdc,0xb2,0x30}, {0xec,0x0d,0x86,0x52}, {0xd0,0x77,0xc1,0xe3}, - {0x6c,0x2b,0xb3,0x16}, {0x99,0xa9,0x70,0xb9}, {0xfa,0x11,0x94,0x48}, {0x22,0x47,0xe9,0x64}, - {0xc4,0xa8,0xfc,0x8c}, {0x1a,0xa0,0xf0,0x3f}, {0xd8,0x56,0x7d,0x2c}, {0xef,0x22,0x33,0x90}, - {0xc7,0x87,0x49,0x4e}, {0xc1,0xd9,0x38,0xd1}, {0xfe,0x8c,0xca,0xa2}, {0x36,0x98,0xd4,0x0b}, - {0xcf,0xa6,0xf5,0x81}, {0x28,0xa5,0x7a,0xde}, {0x26,0xda,0xb7,0x8e}, {0xa4,0x3f,0xad,0xbf}, - {0xe4,0x2c,0x3a,0x9d}, {0x0d,0x50,0x78,0x92}, {0x9b,0x6a,0x5f,0xcc}, {0x62,0x54,0x7e,0x46}, - {0xc2,0xf6,0x8d,0x13}, {0xe8,0x90,0xd8,0xb8}, {0x5e,0x2e,0x39,0xf7}, {0xf5,0x82,0xc3,0xaf}, - {0xbe,0x9f,0x5d,0x80}, {0x7c,0x69,0xd0,0x93}, {0xa9,0x6f,0xd5,0x2d}, {0xb3,0xcf,0x25,0x12}, - {0x3b,0xc8,0xac,0x99}, {0xa7,0x10,0x18,0x7d}, {0x6e,0xe8,0x9c,0x63}, {0x7b,0xdb,0x3b,0xbb}, - {0x09,0xcd,0x26,0x78}, {0xf4,0x6e,0x59,0x18}, {0x01,0xec,0x9a,0xb7}, {0xa8,0x83,0x4f,0x9a}, - {0x65,0xe6,0x95,0x6e}, {0x7e,0xaa,0xff,0xe6}, {0x08,0x21,0xbc,0xcf}, {0xe6,0xef,0x15,0xe8}, - {0xd9,0xba,0xe7,0x9b}, {0xce,0x4a,0x6f,0x36}, {0xd4,0xea,0x9f,0x09}, {0xd6,0x29,0xb0,0x7c}, - {0xaf,0x31,0xa4,0xb2}, {0x31,0x2a,0x3f,0x23}, {0x30,0xc6,0xa5,0x94}, {0xc0,0x35,0xa2,0x66}, - {0x37,0x74,0x4e,0xbc}, {0xa6,0xfc,0x82,0xca}, {0xb0,0xe0,0x90,0xd0}, {0x15,0x33,0xa7,0xd8}, - {0x4a,0xf1,0x04,0x98}, {0xf7,0x41,0xec,0xda}, {0x0e,0x7f,0xcd,0x50}, {0x2f,0x17,0x91,0xf6}, - {0x8d,0x76,0x4d,0xd6}, {0x4d,0x43,0xef,0xb0}, {0x54,0xcc,0xaa,0x4d}, {0xdf,0xe4,0x96,0x04}, - {0xe3,0x9e,0xd1,0xb5}, {0x1b,0x4c,0x6a,0x88}, {0xb8,0xc1,0x2c,0x1f}, {0x7f,0x46,0x65,0x51}, - {0x04,0x9d,0x5e,0xea}, {0x5d,0x01,0x8c,0x35}, {0x73,0xfa,0x87,0x74}, {0x2e,0xfb,0x0b,0x41}, - {0x5a,0xb3,0x67,0x1d}, {0x52,0x92,0xdb,0xd2}, {0x33,0xe9,0x10,0x56}, {0x13,0x6d,0xd6,0x47}, - {0x8c,0x9a,0xd7,0x61}, {0x7a,0x37,0xa1,0x0c}, {0x8e,0x59,0xf8,0x14}, {0x89,0xeb,0x13,0x3c}, - {0xee,0xce,0xa9,0x27}, {0x35,0xb7,0x61,0xc9}, {0xed,0xe1,0x1c,0xe5}, {0x3c,0x7a,0x47,0xb1}, - {0x59,0x9c,0xd2,0xdf}, {0x3f,0x55,0xf2,0x73}, {0x79,0x18,0x14,0xce}, {0xbf,0x73,0xc7,0x37}, - {0xea,0x53,0xf7,0xcd}, {0x5b,0x5f,0xfd,0xaa}, {0x14,0xdf,0x3d,0x6f}, {0x86,0x78,0x44,0xdb}, - {0x81,0xca,0xaf,0xf3}, {0x3e,0xb9,0x68,0xc4}, {0x2c,0x38,0x24,0x34}, {0x5f,0xc2,0xa3,0x40}, - {0x72,0x16,0x1d,0xc3}, {0x0c,0xbc,0xe2,0x25}, {0x8b,0x28,0x3c,0x49}, {0x41,0xff,0x0d,0x95}, - {0x71,0x39,0xa8,0x01}, {0xde,0x08,0x0c,0xb3}, {0x9c,0xd8,0xb4,0xe4}, {0x90,0x64,0x56,0xc1}, - {0x61,0x7b,0xcb,0x84}, {0x70,0xd5,0x32,0xb6}, {0x74,0x48,0x6c,0x5c}, {0x42,0xd0,0xb8,0x57} +static UINT8 T6[256][4] = { + { 0x50, 0x51, 0xf4, 0xa7 }, { 0x53, 0x7e, 0x41, 0x65 }, { 0xc3, 0x1a, 0x17, 0xa4 }, { 0x96, 0x3a, 0x27, 0x5e }, + { 0xcb, 0x3b, 0xab, 0x6b }, { 0xf1, 0x1f, 0x9d, 0x45 }, { 0xab, 0xac, 0xfa, 0x58 }, { 0x93, 0x4b, 0xe3, 0x03 }, + { 0x55, 0x20, 0x30, 0xfa }, { 0xf6, 0xad, 0x76, 0x6d }, { 0x91, 0x88, 0xcc, 0x76 }, { 0x25, 0xf5, 0x02, 0x4c }, + { 0xfc, 0x4f, 0xe5, 0xd7 }, { 0xd7, 0xc5, 0x2a, 0xcb }, { 0x80, 0x26, 0x35, 0x44 }, { 0x8f, 0xb5, 0x62, 0xa3 }, + { 0x49, 0xde, 0xb1, 0x5a }, { 0x67, 0x25, 0xba, 0x1b }, { 0x98, 0x45, 0xea, 0x0e }, { 0xe1, 0x5d, 0xfe, 0xc0 }, + { 0x02, 0xc3, 0x2f, 0x75 }, { 0x12, 0x81, 0x4c, 0xf0 }, { 0xa3, 0x8d, 0x46, 0x97 }, { 0xc6, 0x6b, 0xd3, 0xf9 }, + { 0xe7, 0x03, 0x8f, 0x5f }, { 0x95, 0x15, 0x92, 0x9c }, { 0xeb, 0xbf, 0x6d, 0x7a }, { 0xda, 0x95, 0x52, 0x59 }, + { 0x2d, 0xd4, 0xbe, 0x83 }, { 0xd3, 0x58, 0x74, 0x21 }, { 0x29, 0x49, 0xe0, 0x69 }, { 0x44, 0x8e, 0xc9, 0xc8 }, + { 0x6a, 0x75, 0xc2, 0x89 }, { 0x78, 0xf4, 0x8e, 0x79 }, { 0x6b, 0x99, 0x58, 0x3e }, { 0xdd, 0x27, 0xb9, 0x71 }, + { 0xb6, 0xbe, 0xe1, 0x4f }, { 0x17, 0xf0, 0x88, 0xad }, { 0x66, 0xc9, 0x20, 0xac }, { 0xb4, 0x7d, 0xce, 0x3a }, + { 0x18, 0x63, 0xdf, 0x4a }, { 0x82, 0xe5, 0x1a, 0x31 }, { 0x60, 0x97, 0x51, 0x33 }, { 0x45, 0x62, 0x53, 0x7f }, + { 0xe0, 0xb1, 0x64, 0x77 }, { 0x84, 0xbb, 0x6b, 0xae }, { 0x1c, 0xfe, 0x81, 0xa0 }, { 0x94, 0xf9, 0x08, 0x2b }, + { 0x58, 0x70, 0x48, 0x68 }, { 0x19, 0x8f, 0x45, 0xfd }, { 0x87, 0x94, 0xde, 0x6c }, { 0xb7, 0x52, 0x7b, 0xf8 }, + { 0x23, 0xab, 0x73, 0xd3 }, { 0xe2, 0x72, 0x4b, 0x02 }, { 0x57, 0xe3, 0x1f, 0x8f }, { 0x2a, 0x66, 0x55, 0xab }, + { 0x07, 0xb2, 0xeb, 0x28 }, { 0x03, 0x2f, 0xb5, 0xc2 }, { 0x9a, 0x86, 0xc5, 0x7b }, { 0xa5, 0xd3, 0x37, 0x08 }, + { 0xf2, 0x30, 0x28, 0x87 }, { 0xb2, 0x23, 0xbf, 0xa5 }, { 0xba, 0x02, 0x03, 0x6a }, { 0x5c, 0xed, 0x16, 0x82 }, + { 0x2b, 0x8a, 0xcf, 0x1c }, { 0x92, 0xa7, 0x79, 0xb4 }, { 0xf0, 0xf3, 0x07, 0xf2 }, { 0xa1, 0x4e, 0x69, 0xe2 }, + { 0xcd, 0x65, 0xda, 0xf4 }, { 0xd5, 0x06, 0x05, 0xbe }, { 0x1f, 0xd1, 0x34, 0x62 }, { 0x8a, 0xc4, 0xa6, 0xfe }, + { 0x9d, 0x34, 0x2e, 0x53 }, { 0xa0, 0xa2, 0xf3, 0x55 }, { 0x32, 0x05, 0x8a, 0xe1 }, { 0x75, 0xa4, 0xf6, 0xeb }, + { 0x39, 0x0b, 0x83, 0xec }, { 0xaa, 0x40, 0x60, 0xef }, { 0x06, 0x5e, 0x71, 0x9f }, { 0x51, 0xbd, 0x6e, 0x10 }, + { 0xf9, 0x3e, 0x21, 0x8a }, { 0x3d, 0x96, 0xdd, 0x06 }, { 0xae, 0xdd, 0x3e, 0x05 }, { 0x46, 0x4d, 0xe6, 0xbd }, + { 0xb5, 0x91, 0x54, 0x8d }, { 0x05, 0x71, 0xc4, 0x5d }, { 0x6f, 0x04, 0x06, 0xd4 }, { 0xff, 0x60, 0x50, 0x15 }, + { 0x24, 0x19, 0x98, 0xfb }, { 0x97, 0xd6, 0xbd, 0xe9 }, { 0xcc, 0x89, 0x40, 0x43 }, { 0x77, 0x67, 0xd9, 0x9e }, + { 0xbd, 0xb0, 0xe8, 0x42 }, { 0x88, 0x07, 0x89, 0x8b }, { 0x38, 0xe7, 0x19, 0x5b }, { 0xdb, 0x79, 0xc8, 0xee }, + { 0x47, 0xa1, 0x7c, 0x0a }, { 0xe9, 0x7c, 0x42, 0x0f }, { 0xc9, 0xf8, 0x84, 0x1e }, { 0x00, 0x00, 0x00, 0x00 }, + { 0x83, 0x09, 0x80, 0x86 }, { 0x48, 0x32, 0x2b, 0xed }, { 0xac, 0x1e, 0x11, 0x70 }, { 0x4e, 0x6c, 0x5a, 0x72 }, + { 0xfb, 0xfd, 0x0e, 0xff }, { 0x56, 0x0f, 0x85, 0x38 }, { 0x1e, 0x3d, 0xae, 0xd5 }, { 0x27, 0x36, 0x2d, 0x39 }, + { 0x64, 0x0a, 0x0f, 0xd9 }, { 0x21, 0x68, 0x5c, 0xa6 }, { 0xd1, 0x9b, 0x5b, 0x54 }, { 0x3a, 0x24, 0x36, 0x2e }, + { 0xb1, 0x0c, 0x0a, 0x67 }, { 0x0f, 0x93, 0x57, 0xe7 }, { 0xd2, 0xb4, 0xee, 0x96 }, { 0x9e, 0x1b, 0x9b, 0x91 }, + { 0x4f, 0x80, 0xc0, 0xc5 }, { 0xa2, 0x61, 0xdc, 0x20 }, { 0x69, 0x5a, 0x77, 0x4b }, { 0x16, 0x1c, 0x12, 0x1a }, + { 0x0a, 0xe2, 0x93, 0xba }, { 0xe5, 0xc0, 0xa0, 0x2a }, { 0x43, 0x3c, 0x22, 0xe0 }, { 0x1d, 0x12, 0x1b, 0x17 }, + { 0x0b, 0x0e, 0x09, 0x0d }, { 0xad, 0xf2, 0x8b, 0xc7 }, { 0xb9, 0x2d, 0xb6, 0xa8 }, { 0xc8, 0x14, 0x1e, 0xa9 }, + { 0x85, 0x57, 0xf1, 0x19 }, { 0x4c, 0xaf, 0x75, 0x07 }, { 0xbb, 0xee, 0x99, 0xdd }, { 0xfd, 0xa3, 0x7f, 0x60 }, + { 0x9f, 0xf7, 0x01, 0x26 }, { 0xbc, 0x5c, 0x72, 0xf5 }, { 0xc5, 0x44, 0x66, 0x3b }, { 0x34, 0x5b, 0xfb, 0x7e }, + { 0x76, 0x8b, 0x43, 0x29 }, { 0xdc, 0xcb, 0x23, 0xc6 }, { 0x68, 0xb6, 0xed, 0xfc }, { 0x63, 0xb8, 0xe4, 0xf1 }, + { 0xca, 0xd7, 0x31, 0xdc }, { 0x10, 0x42, 0x63, 0x85 }, { 0x40, 0x13, 0x97, 0x22 }, { 0x20, 0x84, 0xc6, 0x11 }, + { 0x7d, 0x85, 0x4a, 0x24 }, { 0xf8, 0xd2, 0xbb, 0x3d }, { 0x11, 0xae, 0xf9, 0x32 }, { 0x6d, 0xc7, 0x29, 0xa1 }, + { 0x4b, 0x1d, 0x9e, 0x2f }, { 0xf3, 0xdc, 0xb2, 0x30 }, { 0xec, 0x0d, 0x86, 0x52 }, { 0xd0, 0x77, 0xc1, 0xe3 }, + { 0x6c, 0x2b, 0xb3, 0x16 }, { 0x99, 0xa9, 0x70, 0xb9 }, { 0xfa, 0x11, 0x94, 0x48 }, { 0x22, 0x47, 0xe9, 0x64 }, + { 0xc4, 0xa8, 0xfc, 0x8c }, { 0x1a, 0xa0, 0xf0, 0x3f }, { 0xd8, 0x56, 0x7d, 0x2c }, { 0xef, 0x22, 0x33, 0x90 }, + { 0xc7, 0x87, 0x49, 0x4e }, { 0xc1, 0xd9, 0x38, 0xd1 }, { 0xfe, 0x8c, 0xca, 0xa2 }, { 0x36, 0x98, 0xd4, 0x0b }, + { 0xcf, 0xa6, 0xf5, 0x81 }, { 0x28, 0xa5, 0x7a, 0xde }, { 0x26, 0xda, 0xb7, 0x8e }, { 0xa4, 0x3f, 0xad, 0xbf }, + { 0xe4, 0x2c, 0x3a, 0x9d }, { 0x0d, 0x50, 0x78, 0x92 }, { 0x9b, 0x6a, 0x5f, 0xcc }, { 0x62, 0x54, 0x7e, 0x46 }, + { 0xc2, 0xf6, 0x8d, 0x13 }, { 0xe8, 0x90, 0xd8, 0xb8 }, { 0x5e, 0x2e, 0x39, 0xf7 }, { 0xf5, 0x82, 0xc3, 0xaf }, + { 0xbe, 0x9f, 0x5d, 0x80 }, { 0x7c, 0x69, 0xd0, 0x93 }, { 0xa9, 0x6f, 0xd5, 0x2d }, { 0xb3, 0xcf, 0x25, 0x12 }, + { 0x3b, 0xc8, 0xac, 0x99 }, { 0xa7, 0x10, 0x18, 0x7d }, { 0x6e, 0xe8, 0x9c, 0x63 }, { 0x7b, 0xdb, 0x3b, 0xbb }, + { 0x09, 0xcd, 0x26, 0x78 }, { 0xf4, 0x6e, 0x59, 0x18 }, { 0x01, 0xec, 0x9a, 0xb7 }, { 0xa8, 0x83, 0x4f, 0x9a }, + { 0x65, 0xe6, 0x95, 0x6e }, { 0x7e, 0xaa, 0xff, 0xe6 }, { 0x08, 0x21, 0xbc, 0xcf }, { 0xe6, 0xef, 0x15, 0xe8 }, + { 0xd9, 0xba, 0xe7, 0x9b }, { 0xce, 0x4a, 0x6f, 0x36 }, { 0xd4, 0xea, 0x9f, 0x09 }, { 0xd6, 0x29, 0xb0, 0x7c }, + { 0xaf, 0x31, 0xa4, 0xb2 }, { 0x31, 0x2a, 0x3f, 0x23 }, { 0x30, 0xc6, 0xa5, 0x94 }, { 0xc0, 0x35, 0xa2, 0x66 }, + { 0x37, 0x74, 0x4e, 0xbc }, { 0xa6, 0xfc, 0x82, 0xca }, { 0xb0, 0xe0, 0x90, 0xd0 }, { 0x15, 0x33, 0xa7, 0xd8 }, + { 0x4a, 0xf1, 0x04, 0x98 }, { 0xf7, 0x41, 0xec, 0xda }, { 0x0e, 0x7f, 0xcd, 0x50 }, { 0x2f, 0x17, 0x91, 0xf6 }, + { 0x8d, 0x76, 0x4d, 0xd6 }, { 0x4d, 0x43, 0xef, 0xb0 }, { 0x54, 0xcc, 0xaa, 0x4d }, { 0xdf, 0xe4, 0x96, 0x04 }, + { 0xe3, 0x9e, 0xd1, 0xb5 }, { 0x1b, 0x4c, 0x6a, 0x88 }, { 0xb8, 0xc1, 0x2c, 0x1f }, { 0x7f, 0x46, 0x65, 0x51 }, + { 0x04, 0x9d, 0x5e, 0xea }, { 0x5d, 0x01, 0x8c, 0x35 }, { 0x73, 0xfa, 0x87, 0x74 }, { 0x2e, 0xfb, 0x0b, 0x41 }, + { 0x5a, 0xb3, 0x67, 0x1d }, { 0x52, 0x92, 0xdb, 0xd2 }, { 0x33, 0xe9, 0x10, 0x56 }, { 0x13, 0x6d, 0xd6, 0x47 }, + { 0x8c, 0x9a, 0xd7, 0x61 }, { 0x7a, 0x37, 0xa1, 0x0c }, { 0x8e, 0x59, 0xf8, 0x14 }, { 0x89, 0xeb, 0x13, 0x3c }, + { 0xee, 0xce, 0xa9, 0x27 }, { 0x35, 0xb7, 0x61, 0xc9 }, { 0xed, 0xe1, 0x1c, 0xe5 }, { 0x3c, 0x7a, 0x47, 0xb1 }, + { 0x59, 0x9c, 0xd2, 0xdf }, { 0x3f, 0x55, 0xf2, 0x73 }, { 0x79, 0x18, 0x14, 0xce }, { 0xbf, 0x73, 0xc7, 0x37 }, + { 0xea, 0x53, 0xf7, 0xcd }, { 0x5b, 0x5f, 0xfd, 0xaa }, { 0x14, 0xdf, 0x3d, 0x6f }, { 0x86, 0x78, 0x44, 0xdb }, + { 0x81, 0xca, 0xaf, 0xf3 }, { 0x3e, 0xb9, 0x68, 0xc4 }, { 0x2c, 0x38, 0x24, 0x34 }, { 0x5f, 0xc2, 0xa3, 0x40 }, + { 0x72, 0x16, 0x1d, 0xc3 }, { 0x0c, 0xbc, 0xe2, 0x25 }, { 0x8b, 0x28, 0x3c, 0x49 }, { 0x41, 0xff, 0x0d, 0x95 }, + { 0x71, 0x39, 0xa8, 0x01 }, { 0xde, 0x08, 0x0c, 0xb3 }, { 0x9c, 0xd8, 0xb4, 0xe4 }, { 0x90, 0x64, 0x56, 0xc1 }, + { 0x61, 0x7b, 0xcb, 0x84 }, { 0x70, 0xd5, 0x32, 0xb6 }, { 0x74, 0x48, 0x6c, 0x5c }, { 0x42, 0xd0, 0xb8, 0x57 } }; -static UINT8 T7[256][4]= -{ - {0xa7,0x50,0x51,0xf4}, {0x65,0x53,0x7e,0x41}, {0xa4,0xc3,0x1a,0x17}, {0x5e,0x96,0x3a,0x27}, - {0x6b,0xcb,0x3b,0xab}, {0x45,0xf1,0x1f,0x9d}, {0x58,0xab,0xac,0xfa}, {0x03,0x93,0x4b,0xe3}, - {0xfa,0x55,0x20,0x30}, {0x6d,0xf6,0xad,0x76}, {0x76,0x91,0x88,0xcc}, {0x4c,0x25,0xf5,0x02}, - {0xd7,0xfc,0x4f,0xe5}, {0xcb,0xd7,0xc5,0x2a}, {0x44,0x80,0x26,0x35}, {0xa3,0x8f,0xb5,0x62}, - {0x5a,0x49,0xde,0xb1}, {0x1b,0x67,0x25,0xba}, {0x0e,0x98,0x45,0xea}, {0xc0,0xe1,0x5d,0xfe}, - {0x75,0x02,0xc3,0x2f}, {0xf0,0x12,0x81,0x4c}, {0x97,0xa3,0x8d,0x46}, {0xf9,0xc6,0x6b,0xd3}, - {0x5f,0xe7,0x03,0x8f}, {0x9c,0x95,0x15,0x92}, {0x7a,0xeb,0xbf,0x6d}, {0x59,0xda,0x95,0x52}, - {0x83,0x2d,0xd4,0xbe}, {0x21,0xd3,0x58,0x74}, {0x69,0x29,0x49,0xe0}, {0xc8,0x44,0x8e,0xc9}, - {0x89,0x6a,0x75,0xc2}, {0x79,0x78,0xf4,0x8e}, {0x3e,0x6b,0x99,0x58}, {0x71,0xdd,0x27,0xb9}, - {0x4f,0xb6,0xbe,0xe1}, {0xad,0x17,0xf0,0x88}, {0xac,0x66,0xc9,0x20}, {0x3a,0xb4,0x7d,0xce}, - {0x4a,0x18,0x63,0xdf}, {0x31,0x82,0xe5,0x1a}, {0x33,0x60,0x97,0x51}, {0x7f,0x45,0x62,0x53}, - {0x77,0xe0,0xb1,0x64}, {0xae,0x84,0xbb,0x6b}, {0xa0,0x1c,0xfe,0x81}, {0x2b,0x94,0xf9,0x08}, - {0x68,0x58,0x70,0x48}, {0xfd,0x19,0x8f,0x45}, {0x6c,0x87,0x94,0xde}, {0xf8,0xb7,0x52,0x7b}, - {0xd3,0x23,0xab,0x73}, {0x02,0xe2,0x72,0x4b}, {0x8f,0x57,0xe3,0x1f}, {0xab,0x2a,0x66,0x55}, - {0x28,0x07,0xb2,0xeb}, {0xc2,0x03,0x2f,0xb5}, {0x7b,0x9a,0x86,0xc5}, {0x08,0xa5,0xd3,0x37}, - {0x87,0xf2,0x30,0x28}, {0xa5,0xb2,0x23,0xbf}, {0x6a,0xba,0x02,0x03}, {0x82,0x5c,0xed,0x16}, - {0x1c,0x2b,0x8a,0xcf}, {0xb4,0x92,0xa7,0x79}, {0xf2,0xf0,0xf3,0x07}, {0xe2,0xa1,0x4e,0x69}, - {0xf4,0xcd,0x65,0xda}, {0xbe,0xd5,0x06,0x05}, {0x62,0x1f,0xd1,0x34}, {0xfe,0x8a,0xc4,0xa6}, - {0x53,0x9d,0x34,0x2e}, {0x55,0xa0,0xa2,0xf3}, {0xe1,0x32,0x05,0x8a}, {0xeb,0x75,0xa4,0xf6}, - {0xec,0x39,0x0b,0x83}, {0xef,0xaa,0x40,0x60}, {0x9f,0x06,0x5e,0x71}, {0x10,0x51,0xbd,0x6e}, - {0x8a,0xf9,0x3e,0x21}, {0x06,0x3d,0x96,0xdd}, {0x05,0xae,0xdd,0x3e}, {0xbd,0x46,0x4d,0xe6}, - {0x8d,0xb5,0x91,0x54}, {0x5d,0x05,0x71,0xc4}, {0xd4,0x6f,0x04,0x06}, {0x15,0xff,0x60,0x50}, - {0xfb,0x24,0x19,0x98}, {0xe9,0x97,0xd6,0xbd}, {0x43,0xcc,0x89,0x40}, {0x9e,0x77,0x67,0xd9}, - {0x42,0xbd,0xb0,0xe8}, {0x8b,0x88,0x07,0x89}, {0x5b,0x38,0xe7,0x19}, {0xee,0xdb,0x79,0xc8}, - {0x0a,0x47,0xa1,0x7c}, {0x0f,0xe9,0x7c,0x42}, {0x1e,0xc9,0xf8,0x84}, {0x00,0x00,0x00,0x00}, - {0x86,0x83,0x09,0x80}, {0xed,0x48,0x32,0x2b}, {0x70,0xac,0x1e,0x11}, {0x72,0x4e,0x6c,0x5a}, - {0xff,0xfb,0xfd,0x0e}, {0x38,0x56,0x0f,0x85}, {0xd5,0x1e,0x3d,0xae}, {0x39,0x27,0x36,0x2d}, - {0xd9,0x64,0x0a,0x0f}, {0xa6,0x21,0x68,0x5c}, {0x54,0xd1,0x9b,0x5b}, {0x2e,0x3a,0x24,0x36}, - {0x67,0xb1,0x0c,0x0a}, {0xe7,0x0f,0x93,0x57}, {0x96,0xd2,0xb4,0xee}, {0x91,0x9e,0x1b,0x9b}, - {0xc5,0x4f,0x80,0xc0}, {0x20,0xa2,0x61,0xdc}, {0x4b,0x69,0x5a,0x77}, {0x1a,0x16,0x1c,0x12}, - {0xba,0x0a,0xe2,0x93}, {0x2a,0xe5,0xc0,0xa0}, {0xe0,0x43,0x3c,0x22}, {0x17,0x1d,0x12,0x1b}, - {0x0d,0x0b,0x0e,0x09}, {0xc7,0xad,0xf2,0x8b}, {0xa8,0xb9,0x2d,0xb6}, {0xa9,0xc8,0x14,0x1e}, - {0x19,0x85,0x57,0xf1}, {0x07,0x4c,0xaf,0x75}, {0xdd,0xbb,0xee,0x99}, {0x60,0xfd,0xa3,0x7f}, - {0x26,0x9f,0xf7,0x01}, {0xf5,0xbc,0x5c,0x72}, {0x3b,0xc5,0x44,0x66}, {0x7e,0x34,0x5b,0xfb}, - {0x29,0x76,0x8b,0x43}, {0xc6,0xdc,0xcb,0x23}, {0xfc,0x68,0xb6,0xed}, {0xf1,0x63,0xb8,0xe4}, - {0xdc,0xca,0xd7,0x31}, {0x85,0x10,0x42,0x63}, {0x22,0x40,0x13,0x97}, {0x11,0x20,0x84,0xc6}, - {0x24,0x7d,0x85,0x4a}, {0x3d,0xf8,0xd2,0xbb}, {0x32,0x11,0xae,0xf9}, {0xa1,0x6d,0xc7,0x29}, - {0x2f,0x4b,0x1d,0x9e}, {0x30,0xf3,0xdc,0xb2}, {0x52,0xec,0x0d,0x86}, {0xe3,0xd0,0x77,0xc1}, - {0x16,0x6c,0x2b,0xb3}, {0xb9,0x99,0xa9,0x70}, {0x48,0xfa,0x11,0x94}, {0x64,0x22,0x47,0xe9}, - {0x8c,0xc4,0xa8,0xfc}, {0x3f,0x1a,0xa0,0xf0}, {0x2c,0xd8,0x56,0x7d}, {0x90,0xef,0x22,0x33}, - {0x4e,0xc7,0x87,0x49}, {0xd1,0xc1,0xd9,0x38}, {0xa2,0xfe,0x8c,0xca}, {0x0b,0x36,0x98,0xd4}, - {0x81,0xcf,0xa6,0xf5}, {0xde,0x28,0xa5,0x7a}, {0x8e,0x26,0xda,0xb7}, {0xbf,0xa4,0x3f,0xad}, - {0x9d,0xe4,0x2c,0x3a}, {0x92,0x0d,0x50,0x78}, {0xcc,0x9b,0x6a,0x5f}, {0x46,0x62,0x54,0x7e}, - {0x13,0xc2,0xf6,0x8d}, {0xb8,0xe8,0x90,0xd8}, {0xf7,0x5e,0x2e,0x39}, {0xaf,0xf5,0x82,0xc3}, - {0x80,0xbe,0x9f,0x5d}, {0x93,0x7c,0x69,0xd0}, {0x2d,0xa9,0x6f,0xd5}, {0x12,0xb3,0xcf,0x25}, - {0x99,0x3b,0xc8,0xac}, {0x7d,0xa7,0x10,0x18}, {0x63,0x6e,0xe8,0x9c}, {0xbb,0x7b,0xdb,0x3b}, - {0x78,0x09,0xcd,0x26}, {0x18,0xf4,0x6e,0x59}, {0xb7,0x01,0xec,0x9a}, {0x9a,0xa8,0x83,0x4f}, - {0x6e,0x65,0xe6,0x95}, {0xe6,0x7e,0xaa,0xff}, {0xcf,0x08,0x21,0xbc}, {0xe8,0xe6,0xef,0x15}, - {0x9b,0xd9,0xba,0xe7}, {0x36,0xce,0x4a,0x6f}, {0x09,0xd4,0xea,0x9f}, {0x7c,0xd6,0x29,0xb0}, - {0xb2,0xaf,0x31,0xa4}, {0x23,0x31,0x2a,0x3f}, {0x94,0x30,0xc6,0xa5}, {0x66,0xc0,0x35,0xa2}, - {0xbc,0x37,0x74,0x4e}, {0xca,0xa6,0xfc,0x82}, {0xd0,0xb0,0xe0,0x90}, {0xd8,0x15,0x33,0xa7}, - {0x98,0x4a,0xf1,0x04}, {0xda,0xf7,0x41,0xec}, {0x50,0x0e,0x7f,0xcd}, {0xf6,0x2f,0x17,0x91}, - {0xd6,0x8d,0x76,0x4d}, {0xb0,0x4d,0x43,0xef}, {0x4d,0x54,0xcc,0xaa}, {0x04,0xdf,0xe4,0x96}, - {0xb5,0xe3,0x9e,0xd1}, {0x88,0x1b,0x4c,0x6a}, {0x1f,0xb8,0xc1,0x2c}, {0x51,0x7f,0x46,0x65}, - {0xea,0x04,0x9d,0x5e}, {0x35,0x5d,0x01,0x8c}, {0x74,0x73,0xfa,0x87}, {0x41,0x2e,0xfb,0x0b}, - {0x1d,0x5a,0xb3,0x67}, {0xd2,0x52,0x92,0xdb}, {0x56,0x33,0xe9,0x10}, {0x47,0x13,0x6d,0xd6}, - {0x61,0x8c,0x9a,0xd7}, {0x0c,0x7a,0x37,0xa1}, {0x14,0x8e,0x59,0xf8}, {0x3c,0x89,0xeb,0x13}, - {0x27,0xee,0xce,0xa9}, {0xc9,0x35,0xb7,0x61}, {0xe5,0xed,0xe1,0x1c}, {0xb1,0x3c,0x7a,0x47}, - {0xdf,0x59,0x9c,0xd2}, {0x73,0x3f,0x55,0xf2}, {0xce,0x79,0x18,0x14}, {0x37,0xbf,0x73,0xc7}, - {0xcd,0xea,0x53,0xf7}, {0xaa,0x5b,0x5f,0xfd}, {0x6f,0x14,0xdf,0x3d}, {0xdb,0x86,0x78,0x44}, - {0xf3,0x81,0xca,0xaf}, {0xc4,0x3e,0xb9,0x68}, {0x34,0x2c,0x38,0x24}, {0x40,0x5f,0xc2,0xa3}, - {0xc3,0x72,0x16,0x1d}, {0x25,0x0c,0xbc,0xe2}, {0x49,0x8b,0x28,0x3c}, {0x95,0x41,0xff,0x0d}, - {0x01,0x71,0x39,0xa8}, {0xb3,0xde,0x08,0x0c}, {0xe4,0x9c,0xd8,0xb4}, {0xc1,0x90,0x64,0x56}, - {0x84,0x61,0x7b,0xcb}, {0xb6,0x70,0xd5,0x32}, {0x5c,0x74,0x48,0x6c}, {0x57,0x42,0xd0,0xb8} +static UINT8 T7[256][4] = { + { 0xa7, 0x50, 0x51, 0xf4 }, { 0x65, 0x53, 0x7e, 0x41 }, { 0xa4, 0xc3, 0x1a, 0x17 }, { 0x5e, 0x96, 0x3a, 0x27 }, + { 0x6b, 0xcb, 0x3b, 0xab }, { 0x45, 0xf1, 0x1f, 0x9d }, { 0x58, 0xab, 0xac, 0xfa }, { 0x03, 0x93, 0x4b, 0xe3 }, + { 0xfa, 0x55, 0x20, 0x30 }, { 0x6d, 0xf6, 0xad, 0x76 }, { 0x76, 0x91, 0x88, 0xcc }, { 0x4c, 0x25, 0xf5, 0x02 }, + { 0xd7, 0xfc, 0x4f, 0xe5 }, { 0xcb, 0xd7, 0xc5, 0x2a }, { 0x44, 0x80, 0x26, 0x35 }, { 0xa3, 0x8f, 0xb5, 0x62 }, + { 0x5a, 0x49, 0xde, 0xb1 }, { 0x1b, 0x67, 0x25, 0xba }, { 0x0e, 0x98, 0x45, 0xea }, { 0xc0, 0xe1, 0x5d, 0xfe }, + { 0x75, 0x02, 0xc3, 0x2f }, { 0xf0, 0x12, 0x81, 0x4c }, { 0x97, 0xa3, 0x8d, 0x46 }, { 0xf9, 0xc6, 0x6b, 0xd3 }, + { 0x5f, 0xe7, 0x03, 0x8f }, { 0x9c, 0x95, 0x15, 0x92 }, { 0x7a, 0xeb, 0xbf, 0x6d }, { 0x59, 0xda, 0x95, 0x52 }, + { 0x83, 0x2d, 0xd4, 0xbe }, { 0x21, 0xd3, 0x58, 0x74 }, { 0x69, 0x29, 0x49, 0xe0 }, { 0xc8, 0x44, 0x8e, 0xc9 }, + { 0x89, 0x6a, 0x75, 0xc2 }, { 0x79, 0x78, 0xf4, 0x8e }, { 0x3e, 0x6b, 0x99, 0x58 }, { 0x71, 0xdd, 0x27, 0xb9 }, + { 0x4f, 0xb6, 0xbe, 0xe1 }, { 0xad, 0x17, 0xf0, 0x88 }, { 0xac, 0x66, 0xc9, 0x20 }, { 0x3a, 0xb4, 0x7d, 0xce }, + { 0x4a, 0x18, 0x63, 0xdf }, { 0x31, 0x82, 0xe5, 0x1a }, { 0x33, 0x60, 0x97, 0x51 }, { 0x7f, 0x45, 0x62, 0x53 }, + { 0x77, 0xe0, 0xb1, 0x64 }, { 0xae, 0x84, 0xbb, 0x6b }, { 0xa0, 0x1c, 0xfe, 0x81 }, { 0x2b, 0x94, 0xf9, 0x08 }, + { 0x68, 0x58, 0x70, 0x48 }, { 0xfd, 0x19, 0x8f, 0x45 }, { 0x6c, 0x87, 0x94, 0xde }, { 0xf8, 0xb7, 0x52, 0x7b }, + { 0xd3, 0x23, 0xab, 0x73 }, { 0x02, 0xe2, 0x72, 0x4b }, { 0x8f, 0x57, 0xe3, 0x1f }, { 0xab, 0x2a, 0x66, 0x55 }, + { 0x28, 0x07, 0xb2, 0xeb }, { 0xc2, 0x03, 0x2f, 0xb5 }, { 0x7b, 0x9a, 0x86, 0xc5 }, { 0x08, 0xa5, 0xd3, 0x37 }, + { 0x87, 0xf2, 0x30, 0x28 }, { 0xa5, 0xb2, 0x23, 0xbf }, { 0x6a, 0xba, 0x02, 0x03 }, { 0x82, 0x5c, 0xed, 0x16 }, + { 0x1c, 0x2b, 0x8a, 0xcf }, { 0xb4, 0x92, 0xa7, 0x79 }, { 0xf2, 0xf0, 0xf3, 0x07 }, { 0xe2, 0xa1, 0x4e, 0x69 }, + { 0xf4, 0xcd, 0x65, 0xda }, { 0xbe, 0xd5, 0x06, 0x05 }, { 0x62, 0x1f, 0xd1, 0x34 }, { 0xfe, 0x8a, 0xc4, 0xa6 }, + { 0x53, 0x9d, 0x34, 0x2e }, { 0x55, 0xa0, 0xa2, 0xf3 }, { 0xe1, 0x32, 0x05, 0x8a }, { 0xeb, 0x75, 0xa4, 0xf6 }, + { 0xec, 0x39, 0x0b, 0x83 }, { 0xef, 0xaa, 0x40, 0x60 }, { 0x9f, 0x06, 0x5e, 0x71 }, { 0x10, 0x51, 0xbd, 0x6e }, + { 0x8a, 0xf9, 0x3e, 0x21 }, { 0x06, 0x3d, 0x96, 0xdd }, { 0x05, 0xae, 0xdd, 0x3e }, { 0xbd, 0x46, 0x4d, 0xe6 }, + { 0x8d, 0xb5, 0x91, 0x54 }, { 0x5d, 0x05, 0x71, 0xc4 }, { 0xd4, 0x6f, 0x04, 0x06 }, { 0x15, 0xff, 0x60, 0x50 }, + { 0xfb, 0x24, 0x19, 0x98 }, { 0xe9, 0x97, 0xd6, 0xbd }, { 0x43, 0xcc, 0x89, 0x40 }, { 0x9e, 0x77, 0x67, 0xd9 }, + { 0x42, 0xbd, 0xb0, 0xe8 }, { 0x8b, 0x88, 0x07, 0x89 }, { 0x5b, 0x38, 0xe7, 0x19 }, { 0xee, 0xdb, 0x79, 0xc8 }, + { 0x0a, 0x47, 0xa1, 0x7c }, { 0x0f, 0xe9, 0x7c, 0x42 }, { 0x1e, 0xc9, 0xf8, 0x84 }, { 0x00, 0x00, 0x00, 0x00 }, + { 0x86, 0x83, 0x09, 0x80 }, { 0xed, 0x48, 0x32, 0x2b }, { 0x70, 0xac, 0x1e, 0x11 }, { 0x72, 0x4e, 0x6c, 0x5a }, + { 0xff, 0xfb, 0xfd, 0x0e }, { 0x38, 0x56, 0x0f, 0x85 }, { 0xd5, 0x1e, 0x3d, 0xae }, { 0x39, 0x27, 0x36, 0x2d }, + { 0xd9, 0x64, 0x0a, 0x0f }, { 0xa6, 0x21, 0x68, 0x5c }, { 0x54, 0xd1, 0x9b, 0x5b }, { 0x2e, 0x3a, 0x24, 0x36 }, + { 0x67, 0xb1, 0x0c, 0x0a }, { 0xe7, 0x0f, 0x93, 0x57 }, { 0x96, 0xd2, 0xb4, 0xee }, { 0x91, 0x9e, 0x1b, 0x9b }, + { 0xc5, 0x4f, 0x80, 0xc0 }, { 0x20, 0xa2, 0x61, 0xdc }, { 0x4b, 0x69, 0x5a, 0x77 }, { 0x1a, 0x16, 0x1c, 0x12 }, + { 0xba, 0x0a, 0xe2, 0x93 }, { 0x2a, 0xe5, 0xc0, 0xa0 }, { 0xe0, 0x43, 0x3c, 0x22 }, { 0x17, 0x1d, 0x12, 0x1b }, + { 0x0d, 0x0b, 0x0e, 0x09 }, { 0xc7, 0xad, 0xf2, 0x8b }, { 0xa8, 0xb9, 0x2d, 0xb6 }, { 0xa9, 0xc8, 0x14, 0x1e }, + { 0x19, 0x85, 0x57, 0xf1 }, { 0x07, 0x4c, 0xaf, 0x75 }, { 0xdd, 0xbb, 0xee, 0x99 }, { 0x60, 0xfd, 0xa3, 0x7f }, + { 0x26, 0x9f, 0xf7, 0x01 }, { 0xf5, 0xbc, 0x5c, 0x72 }, { 0x3b, 0xc5, 0x44, 0x66 }, { 0x7e, 0x34, 0x5b, 0xfb }, + { 0x29, 0x76, 0x8b, 0x43 }, { 0xc6, 0xdc, 0xcb, 0x23 }, { 0xfc, 0x68, 0xb6, 0xed }, { 0xf1, 0x63, 0xb8, 0xe4 }, + { 0xdc, 0xca, 0xd7, 0x31 }, { 0x85, 0x10, 0x42, 0x63 }, { 0x22, 0x40, 0x13, 0x97 }, { 0x11, 0x20, 0x84, 0xc6 }, + { 0x24, 0x7d, 0x85, 0x4a }, { 0x3d, 0xf8, 0xd2, 0xbb }, { 0x32, 0x11, 0xae, 0xf9 }, { 0xa1, 0x6d, 0xc7, 0x29 }, + { 0x2f, 0x4b, 0x1d, 0x9e }, { 0x30, 0xf3, 0xdc, 0xb2 }, { 0x52, 0xec, 0x0d, 0x86 }, { 0xe3, 0xd0, 0x77, 0xc1 }, + { 0x16, 0x6c, 0x2b, 0xb3 }, { 0xb9, 0x99, 0xa9, 0x70 }, { 0x48, 0xfa, 0x11, 0x94 }, { 0x64, 0x22, 0x47, 0xe9 }, + { 0x8c, 0xc4, 0xa8, 0xfc }, { 0x3f, 0x1a, 0xa0, 0xf0 }, { 0x2c, 0xd8, 0x56, 0x7d }, { 0x90, 0xef, 0x22, 0x33 }, + { 0x4e, 0xc7, 0x87, 0x49 }, { 0xd1, 0xc1, 0xd9, 0x38 }, { 0xa2, 0xfe, 0x8c, 0xca }, { 0x0b, 0x36, 0x98, 0xd4 }, + { 0x81, 0xcf, 0xa6, 0xf5 }, { 0xde, 0x28, 0xa5, 0x7a }, { 0x8e, 0x26, 0xda, 0xb7 }, { 0xbf, 0xa4, 0x3f, 0xad }, + { 0x9d, 0xe4, 0x2c, 0x3a }, { 0x92, 0x0d, 0x50, 0x78 }, { 0xcc, 0x9b, 0x6a, 0x5f }, { 0x46, 0x62, 0x54, 0x7e }, + { 0x13, 0xc2, 0xf6, 0x8d }, { 0xb8, 0xe8, 0x90, 0xd8 }, { 0xf7, 0x5e, 0x2e, 0x39 }, { 0xaf, 0xf5, 0x82, 0xc3 }, + { 0x80, 0xbe, 0x9f, 0x5d }, { 0x93, 0x7c, 0x69, 0xd0 }, { 0x2d, 0xa9, 0x6f, 0xd5 }, { 0x12, 0xb3, 0xcf, 0x25 }, + { 0x99, 0x3b, 0xc8, 0xac }, { 0x7d, 0xa7, 0x10, 0x18 }, { 0x63, 0x6e, 0xe8, 0x9c }, { 0xbb, 0x7b, 0xdb, 0x3b }, + { 0x78, 0x09, 0xcd, 0x26 }, { 0x18, 0xf4, 0x6e, 0x59 }, { 0xb7, 0x01, 0xec, 0x9a }, { 0x9a, 0xa8, 0x83, 0x4f }, + { 0x6e, 0x65, 0xe6, 0x95 }, { 0xe6, 0x7e, 0xaa, 0xff }, { 0xcf, 0x08, 0x21, 0xbc }, { 0xe8, 0xe6, 0xef, 0x15 }, + { 0x9b, 0xd9, 0xba, 0xe7 }, { 0x36, 0xce, 0x4a, 0x6f }, { 0x09, 0xd4, 0xea, 0x9f }, { 0x7c, 0xd6, 0x29, 0xb0 }, + { 0xb2, 0xaf, 0x31, 0xa4 }, { 0x23, 0x31, 0x2a, 0x3f }, { 0x94, 0x30, 0xc6, 0xa5 }, { 0x66, 0xc0, 0x35, 0xa2 }, + { 0xbc, 0x37, 0x74, 0x4e }, { 0xca, 0xa6, 0xfc, 0x82 }, { 0xd0, 0xb0, 0xe0, 0x90 }, { 0xd8, 0x15, 0x33, 0xa7 }, + { 0x98, 0x4a, 0xf1, 0x04 }, { 0xda, 0xf7, 0x41, 0xec }, { 0x50, 0x0e, 0x7f, 0xcd }, { 0xf6, 0x2f, 0x17, 0x91 }, + { 0xd6, 0x8d, 0x76, 0x4d }, { 0xb0, 0x4d, 0x43, 0xef }, { 0x4d, 0x54, 0xcc, 0xaa }, { 0x04, 0xdf, 0xe4, 0x96 }, + { 0xb5, 0xe3, 0x9e, 0xd1 }, { 0x88, 0x1b, 0x4c, 0x6a }, { 0x1f, 0xb8, 0xc1, 0x2c }, { 0x51, 0x7f, 0x46, 0x65 }, + { 0xea, 0x04, 0x9d, 0x5e }, { 0x35, 0x5d, 0x01, 0x8c }, { 0x74, 0x73, 0xfa, 0x87 }, { 0x41, 0x2e, 0xfb, 0x0b }, + { 0x1d, 0x5a, 0xb3, 0x67 }, { 0xd2, 0x52, 0x92, 0xdb }, { 0x56, 0x33, 0xe9, 0x10 }, { 0x47, 0x13, 0x6d, 0xd6 }, + { 0x61, 0x8c, 0x9a, 0xd7 }, { 0x0c, 0x7a, 0x37, 0xa1 }, { 0x14, 0x8e, 0x59, 0xf8 }, { 0x3c, 0x89, 0xeb, 0x13 }, + { 0x27, 0xee, 0xce, 0xa9 }, { 0xc9, 0x35, 0xb7, 0x61 }, { 0xe5, 0xed, 0xe1, 0x1c }, { 0xb1, 0x3c, 0x7a, 0x47 }, + { 0xdf, 0x59, 0x9c, 0xd2 }, { 0x73, 0x3f, 0x55, 0xf2 }, { 0xce, 0x79, 0x18, 0x14 }, { 0x37, 0xbf, 0x73, 0xc7 }, + { 0xcd, 0xea, 0x53, 0xf7 }, { 0xaa, 0x5b, 0x5f, 0xfd }, { 0x6f, 0x14, 0xdf, 0x3d }, { 0xdb, 0x86, 0x78, 0x44 }, + { 0xf3, 0x81, 0xca, 0xaf }, { 0xc4, 0x3e, 0xb9, 0x68 }, { 0x34, 0x2c, 0x38, 0x24 }, { 0x40, 0x5f, 0xc2, 0xa3 }, + { 0xc3, 0x72, 0x16, 0x1d }, { 0x25, 0x0c, 0xbc, 0xe2 }, { 0x49, 0x8b, 0x28, 0x3c }, { 0x95, 0x41, 0xff, 0x0d }, + { 0x01, 0x71, 0x39, 0xa8 }, { 0xb3, 0xde, 0x08, 0x0c }, { 0xe4, 0x9c, 0xd8, 0xb4 }, { 0xc1, 0x90, 0x64, 0x56 }, + { 0x84, 0x61, 0x7b, 0xcb }, { 0xb6, 0x70, 0xd5, 0x32 }, { 0x5c, 0x74, 0x48, 0x6c }, { 0x57, 0x42, 0xd0, 0xb8 } }; -static UINT8 T8[256][4]= -{ - {0xf4,0xa7,0x50,0x51}, {0x41,0x65,0x53,0x7e}, {0x17,0xa4,0xc3,0x1a}, {0x27,0x5e,0x96,0x3a}, - {0xab,0x6b,0xcb,0x3b}, {0x9d,0x45,0xf1,0x1f}, {0xfa,0x58,0xab,0xac}, {0xe3,0x03,0x93,0x4b}, - {0x30,0xfa,0x55,0x20}, {0x76,0x6d,0xf6,0xad}, {0xcc,0x76,0x91,0x88}, {0x02,0x4c,0x25,0xf5}, - {0xe5,0xd7,0xfc,0x4f}, {0x2a,0xcb,0xd7,0xc5}, {0x35,0x44,0x80,0x26}, {0x62,0xa3,0x8f,0xb5}, - {0xb1,0x5a,0x49,0xde}, {0xba,0x1b,0x67,0x25}, {0xea,0x0e,0x98,0x45}, {0xfe,0xc0,0xe1,0x5d}, - {0x2f,0x75,0x02,0xc3}, {0x4c,0xf0,0x12,0x81}, {0x46,0x97,0xa3,0x8d}, {0xd3,0xf9,0xc6,0x6b}, - {0x8f,0x5f,0xe7,0x03}, {0x92,0x9c,0x95,0x15}, {0x6d,0x7a,0xeb,0xbf}, {0x52,0x59,0xda,0x95}, - {0xbe,0x83,0x2d,0xd4}, {0x74,0x21,0xd3,0x58}, {0xe0,0x69,0x29,0x49}, {0xc9,0xc8,0x44,0x8e}, - {0xc2,0x89,0x6a,0x75}, {0x8e,0x79,0x78,0xf4}, {0x58,0x3e,0x6b,0x99}, {0xb9,0x71,0xdd,0x27}, - {0xe1,0x4f,0xb6,0xbe}, {0x88,0xad,0x17,0xf0}, {0x20,0xac,0x66,0xc9}, {0xce,0x3a,0xb4,0x7d}, - {0xdf,0x4a,0x18,0x63}, {0x1a,0x31,0x82,0xe5}, {0x51,0x33,0x60,0x97}, {0x53,0x7f,0x45,0x62}, - {0x64,0x77,0xe0,0xb1}, {0x6b,0xae,0x84,0xbb}, {0x81,0xa0,0x1c,0xfe}, {0x08,0x2b,0x94,0xf9}, - {0x48,0x68,0x58,0x70}, {0x45,0xfd,0x19,0x8f}, {0xde,0x6c,0x87,0x94}, {0x7b,0xf8,0xb7,0x52}, - {0x73,0xd3,0x23,0xab}, {0x4b,0x02,0xe2,0x72}, {0x1f,0x8f,0x57,0xe3}, {0x55,0xab,0x2a,0x66}, - {0xeb,0x28,0x07,0xb2}, {0xb5,0xc2,0x03,0x2f}, {0xc5,0x7b,0x9a,0x86}, {0x37,0x08,0xa5,0xd3}, - {0x28,0x87,0xf2,0x30}, {0xbf,0xa5,0xb2,0x23}, {0x03,0x6a,0xba,0x02}, {0x16,0x82,0x5c,0xed}, - {0xcf,0x1c,0x2b,0x8a}, {0x79,0xb4,0x92,0xa7}, {0x07,0xf2,0xf0,0xf3}, {0x69,0xe2,0xa1,0x4e}, - {0xda,0xf4,0xcd,0x65}, {0x05,0xbe,0xd5,0x06}, {0x34,0x62,0x1f,0xd1}, {0xa6,0xfe,0x8a,0xc4}, - {0x2e,0x53,0x9d,0x34}, {0xf3,0x55,0xa0,0xa2}, {0x8a,0xe1,0x32,0x05}, {0xf6,0xeb,0x75,0xa4}, - {0x83,0xec,0x39,0x0b}, {0x60,0xef,0xaa,0x40}, {0x71,0x9f,0x06,0x5e}, {0x6e,0x10,0x51,0xbd}, - {0x21,0x8a,0xf9,0x3e}, {0xdd,0x06,0x3d,0x96}, {0x3e,0x05,0xae,0xdd}, {0xe6,0xbd,0x46,0x4d}, - {0x54,0x8d,0xb5,0x91}, {0xc4,0x5d,0x05,0x71}, {0x06,0xd4,0x6f,0x04}, {0x50,0x15,0xff,0x60}, - {0x98,0xfb,0x24,0x19}, {0xbd,0xe9,0x97,0xd6}, {0x40,0x43,0xcc,0x89}, {0xd9,0x9e,0x77,0x67}, - {0xe8,0x42,0xbd,0xb0}, {0x89,0x8b,0x88,0x07}, {0x19,0x5b,0x38,0xe7}, {0xc8,0xee,0xdb,0x79}, - {0x7c,0x0a,0x47,0xa1}, {0x42,0x0f,0xe9,0x7c}, {0x84,0x1e,0xc9,0xf8}, {0x00,0x00,0x00,0x00}, - {0x80,0x86,0x83,0x09}, {0x2b,0xed,0x48,0x32}, {0x11,0x70,0xac,0x1e}, {0x5a,0x72,0x4e,0x6c}, - {0x0e,0xff,0xfb,0xfd}, {0x85,0x38,0x56,0x0f}, {0xae,0xd5,0x1e,0x3d}, {0x2d,0x39,0x27,0x36}, - {0x0f,0xd9,0x64,0x0a}, {0x5c,0xa6,0x21,0x68}, {0x5b,0x54,0xd1,0x9b}, {0x36,0x2e,0x3a,0x24}, - {0x0a,0x67,0xb1,0x0c}, {0x57,0xe7,0x0f,0x93}, {0xee,0x96,0xd2,0xb4}, {0x9b,0x91,0x9e,0x1b}, - {0xc0,0xc5,0x4f,0x80}, {0xdc,0x20,0xa2,0x61}, {0x77,0x4b,0x69,0x5a}, {0x12,0x1a,0x16,0x1c}, - {0x93,0xba,0x0a,0xe2}, {0xa0,0x2a,0xe5,0xc0}, {0x22,0xe0,0x43,0x3c}, {0x1b,0x17,0x1d,0x12}, - {0x09,0x0d,0x0b,0x0e}, {0x8b,0xc7,0xad,0xf2}, {0xb6,0xa8,0xb9,0x2d}, {0x1e,0xa9,0xc8,0x14}, - {0xf1,0x19,0x85,0x57}, {0x75,0x07,0x4c,0xaf}, {0x99,0xdd,0xbb,0xee}, {0x7f,0x60,0xfd,0xa3}, - {0x01,0x26,0x9f,0xf7}, {0x72,0xf5,0xbc,0x5c}, {0x66,0x3b,0xc5,0x44}, {0xfb,0x7e,0x34,0x5b}, - {0x43,0x29,0x76,0x8b}, {0x23,0xc6,0xdc,0xcb}, {0xed,0xfc,0x68,0xb6}, {0xe4,0xf1,0x63,0xb8}, - {0x31,0xdc,0xca,0xd7}, {0x63,0x85,0x10,0x42}, {0x97,0x22,0x40,0x13}, {0xc6,0x11,0x20,0x84}, - {0x4a,0x24,0x7d,0x85}, {0xbb,0x3d,0xf8,0xd2}, {0xf9,0x32,0x11,0xae}, {0x29,0xa1,0x6d,0xc7}, - {0x9e,0x2f,0x4b,0x1d}, {0xb2,0x30,0xf3,0xdc}, {0x86,0x52,0xec,0x0d}, {0xc1,0xe3,0xd0,0x77}, - {0xb3,0x16,0x6c,0x2b}, {0x70,0xb9,0x99,0xa9}, {0x94,0x48,0xfa,0x11}, {0xe9,0x64,0x22,0x47}, - {0xfc,0x8c,0xc4,0xa8}, {0xf0,0x3f,0x1a,0xa0}, {0x7d,0x2c,0xd8,0x56}, {0x33,0x90,0xef,0x22}, - {0x49,0x4e,0xc7,0x87}, {0x38,0xd1,0xc1,0xd9}, {0xca,0xa2,0xfe,0x8c}, {0xd4,0x0b,0x36,0x98}, - {0xf5,0x81,0xcf,0xa6}, {0x7a,0xde,0x28,0xa5}, {0xb7,0x8e,0x26,0xda}, {0xad,0xbf,0xa4,0x3f}, - {0x3a,0x9d,0xe4,0x2c}, {0x78,0x92,0x0d,0x50}, {0x5f,0xcc,0x9b,0x6a}, {0x7e,0x46,0x62,0x54}, - {0x8d,0x13,0xc2,0xf6}, {0xd8,0xb8,0xe8,0x90}, {0x39,0xf7,0x5e,0x2e}, {0xc3,0xaf,0xf5,0x82}, - {0x5d,0x80,0xbe,0x9f}, {0xd0,0x93,0x7c,0x69}, {0xd5,0x2d,0xa9,0x6f}, {0x25,0x12,0xb3,0xcf}, - {0xac,0x99,0x3b,0xc8}, {0x18,0x7d,0xa7,0x10}, {0x9c,0x63,0x6e,0xe8}, {0x3b,0xbb,0x7b,0xdb}, - {0x26,0x78,0x09,0xcd}, {0x59,0x18,0xf4,0x6e}, {0x9a,0xb7,0x01,0xec}, {0x4f,0x9a,0xa8,0x83}, - {0x95,0x6e,0x65,0xe6}, {0xff,0xe6,0x7e,0xaa}, {0xbc,0xcf,0x08,0x21}, {0x15,0xe8,0xe6,0xef}, - {0xe7,0x9b,0xd9,0xba}, {0x6f,0x36,0xce,0x4a}, {0x9f,0x09,0xd4,0xea}, {0xb0,0x7c,0xd6,0x29}, - {0xa4,0xb2,0xaf,0x31}, {0x3f,0x23,0x31,0x2a}, {0xa5,0x94,0x30,0xc6}, {0xa2,0x66,0xc0,0x35}, - {0x4e,0xbc,0x37,0x74}, {0x82,0xca,0xa6,0xfc}, {0x90,0xd0,0xb0,0xe0}, {0xa7,0xd8,0x15,0x33}, - {0x04,0x98,0x4a,0xf1}, {0xec,0xda,0xf7,0x41}, {0xcd,0x50,0x0e,0x7f}, {0x91,0xf6,0x2f,0x17}, - {0x4d,0xd6,0x8d,0x76}, {0xef,0xb0,0x4d,0x43}, {0xaa,0x4d,0x54,0xcc}, {0x96,0x04,0xdf,0xe4}, - {0xd1,0xb5,0xe3,0x9e}, {0x6a,0x88,0x1b,0x4c}, {0x2c,0x1f,0xb8,0xc1}, {0x65,0x51,0x7f,0x46}, - {0x5e,0xea,0x04,0x9d}, {0x8c,0x35,0x5d,0x01}, {0x87,0x74,0x73,0xfa}, {0x0b,0x41,0x2e,0xfb}, - {0x67,0x1d,0x5a,0xb3}, {0xdb,0xd2,0x52,0x92}, {0x10,0x56,0x33,0xe9}, {0xd6,0x47,0x13,0x6d}, - {0xd7,0x61,0x8c,0x9a}, {0xa1,0x0c,0x7a,0x37}, {0xf8,0x14,0x8e,0x59}, {0x13,0x3c,0x89,0xeb}, - {0xa9,0x27,0xee,0xce}, {0x61,0xc9,0x35,0xb7}, {0x1c,0xe5,0xed,0xe1}, {0x47,0xb1,0x3c,0x7a}, - {0xd2,0xdf,0x59,0x9c}, {0xf2,0x73,0x3f,0x55}, {0x14,0xce,0x79,0x18}, {0xc7,0x37,0xbf,0x73}, - {0xf7,0xcd,0xea,0x53}, {0xfd,0xaa,0x5b,0x5f}, {0x3d,0x6f,0x14,0xdf}, {0x44,0xdb,0x86,0x78}, - {0xaf,0xf3,0x81,0xca}, {0x68,0xc4,0x3e,0xb9}, {0x24,0x34,0x2c,0x38}, {0xa3,0x40,0x5f,0xc2}, - {0x1d,0xc3,0x72,0x16}, {0xe2,0x25,0x0c,0xbc}, {0x3c,0x49,0x8b,0x28}, {0x0d,0x95,0x41,0xff}, - {0xa8,0x01,0x71,0x39}, {0x0c,0xb3,0xde,0x08}, {0xb4,0xe4,0x9c,0xd8}, {0x56,0xc1,0x90,0x64}, - {0xcb,0x84,0x61,0x7b}, {0x32,0xb6,0x70,0xd5}, {0x6c,0x5c,0x74,0x48}, {0xb8,0x57,0x42,0xd0} +static UINT8 T8[256][4] = { + { 0xf4, 0xa7, 0x50, 0x51 }, { 0x41, 0x65, 0x53, 0x7e }, { 0x17, 0xa4, 0xc3, 0x1a }, { 0x27, 0x5e, 0x96, 0x3a }, + { 0xab, 0x6b, 0xcb, 0x3b }, { 0x9d, 0x45, 0xf1, 0x1f }, { 0xfa, 0x58, 0xab, 0xac }, { 0xe3, 0x03, 0x93, 0x4b }, + { 0x30, 0xfa, 0x55, 0x20 }, { 0x76, 0x6d, 0xf6, 0xad }, { 0xcc, 0x76, 0x91, 0x88 }, { 0x02, 0x4c, 0x25, 0xf5 }, + { 0xe5, 0xd7, 0xfc, 0x4f }, { 0x2a, 0xcb, 0xd7, 0xc5 }, { 0x35, 0x44, 0x80, 0x26 }, { 0x62, 0xa3, 0x8f, 0xb5 }, + { 0xb1, 0x5a, 0x49, 0xde }, { 0xba, 0x1b, 0x67, 0x25 }, { 0xea, 0x0e, 0x98, 0x45 }, { 0xfe, 0xc0, 0xe1, 0x5d }, + { 0x2f, 0x75, 0x02, 0xc3 }, { 0x4c, 0xf0, 0x12, 0x81 }, { 0x46, 0x97, 0xa3, 0x8d }, { 0xd3, 0xf9, 0xc6, 0x6b }, + { 0x8f, 0x5f, 0xe7, 0x03 }, { 0x92, 0x9c, 0x95, 0x15 }, { 0x6d, 0x7a, 0xeb, 0xbf }, { 0x52, 0x59, 0xda, 0x95 }, + { 0xbe, 0x83, 0x2d, 0xd4 }, { 0x74, 0x21, 0xd3, 0x58 }, { 0xe0, 0x69, 0x29, 0x49 }, { 0xc9, 0xc8, 0x44, 0x8e }, + { 0xc2, 0x89, 0x6a, 0x75 }, { 0x8e, 0x79, 0x78, 0xf4 }, { 0x58, 0x3e, 0x6b, 0x99 }, { 0xb9, 0x71, 0xdd, 0x27 }, + { 0xe1, 0x4f, 0xb6, 0xbe }, { 0x88, 0xad, 0x17, 0xf0 }, { 0x20, 0xac, 0x66, 0xc9 }, { 0xce, 0x3a, 0xb4, 0x7d }, + { 0xdf, 0x4a, 0x18, 0x63 }, { 0x1a, 0x31, 0x82, 0xe5 }, { 0x51, 0x33, 0x60, 0x97 }, { 0x53, 0x7f, 0x45, 0x62 }, + { 0x64, 0x77, 0xe0, 0xb1 }, { 0x6b, 0xae, 0x84, 0xbb }, { 0x81, 0xa0, 0x1c, 0xfe }, { 0x08, 0x2b, 0x94, 0xf9 }, + { 0x48, 0x68, 0x58, 0x70 }, { 0x45, 0xfd, 0x19, 0x8f }, { 0xde, 0x6c, 0x87, 0x94 }, { 0x7b, 0xf8, 0xb7, 0x52 }, + { 0x73, 0xd3, 0x23, 0xab }, { 0x4b, 0x02, 0xe2, 0x72 }, { 0x1f, 0x8f, 0x57, 0xe3 }, { 0x55, 0xab, 0x2a, 0x66 }, + { 0xeb, 0x28, 0x07, 0xb2 }, { 0xb5, 0xc2, 0x03, 0x2f }, { 0xc5, 0x7b, 0x9a, 0x86 }, { 0x37, 0x08, 0xa5, 0xd3 }, + { 0x28, 0x87, 0xf2, 0x30 }, { 0xbf, 0xa5, 0xb2, 0x23 }, { 0x03, 0x6a, 0xba, 0x02 }, { 0x16, 0x82, 0x5c, 0xed }, + { 0xcf, 0x1c, 0x2b, 0x8a }, { 0x79, 0xb4, 0x92, 0xa7 }, { 0x07, 0xf2, 0xf0, 0xf3 }, { 0x69, 0xe2, 0xa1, 0x4e }, + { 0xda, 0xf4, 0xcd, 0x65 }, { 0x05, 0xbe, 0xd5, 0x06 }, { 0x34, 0x62, 0x1f, 0xd1 }, { 0xa6, 0xfe, 0x8a, 0xc4 }, + { 0x2e, 0x53, 0x9d, 0x34 }, { 0xf3, 0x55, 0xa0, 0xa2 }, { 0x8a, 0xe1, 0x32, 0x05 }, { 0xf6, 0xeb, 0x75, 0xa4 }, + { 0x83, 0xec, 0x39, 0x0b }, { 0x60, 0xef, 0xaa, 0x40 }, { 0x71, 0x9f, 0x06, 0x5e }, { 0x6e, 0x10, 0x51, 0xbd }, + { 0x21, 0x8a, 0xf9, 0x3e }, { 0xdd, 0x06, 0x3d, 0x96 }, { 0x3e, 0x05, 0xae, 0xdd }, { 0xe6, 0xbd, 0x46, 0x4d }, + { 0x54, 0x8d, 0xb5, 0x91 }, { 0xc4, 0x5d, 0x05, 0x71 }, { 0x06, 0xd4, 0x6f, 0x04 }, { 0x50, 0x15, 0xff, 0x60 }, + { 0x98, 0xfb, 0x24, 0x19 }, { 0xbd, 0xe9, 0x97, 0xd6 }, { 0x40, 0x43, 0xcc, 0x89 }, { 0xd9, 0x9e, 0x77, 0x67 }, + { 0xe8, 0x42, 0xbd, 0xb0 }, { 0x89, 0x8b, 0x88, 0x07 }, { 0x19, 0x5b, 0x38, 0xe7 }, { 0xc8, 0xee, 0xdb, 0x79 }, + { 0x7c, 0x0a, 0x47, 0xa1 }, { 0x42, 0x0f, 0xe9, 0x7c }, { 0x84, 0x1e, 0xc9, 0xf8 }, { 0x00, 0x00, 0x00, 0x00 }, + { 0x80, 0x86, 0x83, 0x09 }, { 0x2b, 0xed, 0x48, 0x32 }, { 0x11, 0x70, 0xac, 0x1e }, { 0x5a, 0x72, 0x4e, 0x6c }, + { 0x0e, 0xff, 0xfb, 0xfd }, { 0x85, 0x38, 0x56, 0x0f }, { 0xae, 0xd5, 0x1e, 0x3d }, { 0x2d, 0x39, 0x27, 0x36 }, + { 0x0f, 0xd9, 0x64, 0x0a }, { 0x5c, 0xa6, 0x21, 0x68 }, { 0x5b, 0x54, 0xd1, 0x9b }, { 0x36, 0x2e, 0x3a, 0x24 }, + { 0x0a, 0x67, 0xb1, 0x0c }, { 0x57, 0xe7, 0x0f, 0x93 }, { 0xee, 0x96, 0xd2, 0xb4 }, { 0x9b, 0x91, 0x9e, 0x1b }, + { 0xc0, 0xc5, 0x4f, 0x80 }, { 0xdc, 0x20, 0xa2, 0x61 }, { 0x77, 0x4b, 0x69, 0x5a }, { 0x12, 0x1a, 0x16, 0x1c }, + { 0x93, 0xba, 0x0a, 0xe2 }, { 0xa0, 0x2a, 0xe5, 0xc0 }, { 0x22, 0xe0, 0x43, 0x3c }, { 0x1b, 0x17, 0x1d, 0x12 }, + { 0x09, 0x0d, 0x0b, 0x0e }, { 0x8b, 0xc7, 0xad, 0xf2 }, { 0xb6, 0xa8, 0xb9, 0x2d }, { 0x1e, 0xa9, 0xc8, 0x14 }, + { 0xf1, 0x19, 0x85, 0x57 }, { 0x75, 0x07, 0x4c, 0xaf }, { 0x99, 0xdd, 0xbb, 0xee }, { 0x7f, 0x60, 0xfd, 0xa3 }, + { 0x01, 0x26, 0x9f, 0xf7 }, { 0x72, 0xf5, 0xbc, 0x5c }, { 0x66, 0x3b, 0xc5, 0x44 }, { 0xfb, 0x7e, 0x34, 0x5b }, + { 0x43, 0x29, 0x76, 0x8b }, { 0x23, 0xc6, 0xdc, 0xcb }, { 0xed, 0xfc, 0x68, 0xb6 }, { 0xe4, 0xf1, 0x63, 0xb8 }, + { 0x31, 0xdc, 0xca, 0xd7 }, { 0x63, 0x85, 0x10, 0x42 }, { 0x97, 0x22, 0x40, 0x13 }, { 0xc6, 0x11, 0x20, 0x84 }, + { 0x4a, 0x24, 0x7d, 0x85 }, { 0xbb, 0x3d, 0xf8, 0xd2 }, { 0xf9, 0x32, 0x11, 0xae }, { 0x29, 0xa1, 0x6d, 0xc7 }, + { 0x9e, 0x2f, 0x4b, 0x1d }, { 0xb2, 0x30, 0xf3, 0xdc }, { 0x86, 0x52, 0xec, 0x0d }, { 0xc1, 0xe3, 0xd0, 0x77 }, + { 0xb3, 0x16, 0x6c, 0x2b }, { 0x70, 0xb9, 0x99, 0xa9 }, { 0x94, 0x48, 0xfa, 0x11 }, { 0xe9, 0x64, 0x22, 0x47 }, + { 0xfc, 0x8c, 0xc4, 0xa8 }, { 0xf0, 0x3f, 0x1a, 0xa0 }, { 0x7d, 0x2c, 0xd8, 0x56 }, { 0x33, 0x90, 0xef, 0x22 }, + { 0x49, 0x4e, 0xc7, 0x87 }, { 0x38, 0xd1, 0xc1, 0xd9 }, { 0xca, 0xa2, 0xfe, 0x8c }, { 0xd4, 0x0b, 0x36, 0x98 }, + { 0xf5, 0x81, 0xcf, 0xa6 }, { 0x7a, 0xde, 0x28, 0xa5 }, { 0xb7, 0x8e, 0x26, 0xda }, { 0xad, 0xbf, 0xa4, 0x3f }, + { 0x3a, 0x9d, 0xe4, 0x2c }, { 0x78, 0x92, 0x0d, 0x50 }, { 0x5f, 0xcc, 0x9b, 0x6a }, { 0x7e, 0x46, 0x62, 0x54 }, + { 0x8d, 0x13, 0xc2, 0xf6 }, { 0xd8, 0xb8, 0xe8, 0x90 }, { 0x39, 0xf7, 0x5e, 0x2e }, { 0xc3, 0xaf, 0xf5, 0x82 }, + { 0x5d, 0x80, 0xbe, 0x9f }, { 0xd0, 0x93, 0x7c, 0x69 }, { 0xd5, 0x2d, 0xa9, 0x6f }, { 0x25, 0x12, 0xb3, 0xcf }, + { 0xac, 0x99, 0x3b, 0xc8 }, { 0x18, 0x7d, 0xa7, 0x10 }, { 0x9c, 0x63, 0x6e, 0xe8 }, { 0x3b, 0xbb, 0x7b, 0xdb }, + { 0x26, 0x78, 0x09, 0xcd }, { 0x59, 0x18, 0xf4, 0x6e }, { 0x9a, 0xb7, 0x01, 0xec }, { 0x4f, 0x9a, 0xa8, 0x83 }, + { 0x95, 0x6e, 0x65, 0xe6 }, { 0xff, 0xe6, 0x7e, 0xaa }, { 0xbc, 0xcf, 0x08, 0x21 }, { 0x15, 0xe8, 0xe6, 0xef }, + { 0xe7, 0x9b, 0xd9, 0xba }, { 0x6f, 0x36, 0xce, 0x4a }, { 0x9f, 0x09, 0xd4, 0xea }, { 0xb0, 0x7c, 0xd6, 0x29 }, + { 0xa4, 0xb2, 0xaf, 0x31 }, { 0x3f, 0x23, 0x31, 0x2a }, { 0xa5, 0x94, 0x30, 0xc6 }, { 0xa2, 0x66, 0xc0, 0x35 }, + { 0x4e, 0xbc, 0x37, 0x74 }, { 0x82, 0xca, 0xa6, 0xfc }, { 0x90, 0xd0, 0xb0, 0xe0 }, { 0xa7, 0xd8, 0x15, 0x33 }, + { 0x04, 0x98, 0x4a, 0xf1 }, { 0xec, 0xda, 0xf7, 0x41 }, { 0xcd, 0x50, 0x0e, 0x7f }, { 0x91, 0xf6, 0x2f, 0x17 }, + { 0x4d, 0xd6, 0x8d, 0x76 }, { 0xef, 0xb0, 0x4d, 0x43 }, { 0xaa, 0x4d, 0x54, 0xcc }, { 0x96, 0x04, 0xdf, 0xe4 }, + { 0xd1, 0xb5, 0xe3, 0x9e }, { 0x6a, 0x88, 0x1b, 0x4c }, { 0x2c, 0x1f, 0xb8, 0xc1 }, { 0x65, 0x51, 0x7f, 0x46 }, + { 0x5e, 0xea, 0x04, 0x9d }, { 0x8c, 0x35, 0x5d, 0x01 }, { 0x87, 0x74, 0x73, 0xfa }, { 0x0b, 0x41, 0x2e, 0xfb }, + { 0x67, 0x1d, 0x5a, 0xb3 }, { 0xdb, 0xd2, 0x52, 0x92 }, { 0x10, 0x56, 0x33, 0xe9 }, { 0xd6, 0x47, 0x13, 0x6d }, + { 0xd7, 0x61, 0x8c, 0x9a }, { 0xa1, 0x0c, 0x7a, 0x37 }, { 0xf8, 0x14, 0x8e, 0x59 }, { 0x13, 0x3c, 0x89, 0xeb }, + { 0xa9, 0x27, 0xee, 0xce }, { 0x61, 0xc9, 0x35, 0xb7 }, { 0x1c, 0xe5, 0xed, 0xe1 }, { 0x47, 0xb1, 0x3c, 0x7a }, + { 0xd2, 0xdf, 0x59, 0x9c }, { 0xf2, 0x73, 0x3f, 0x55 }, { 0x14, 0xce, 0x79, 0x18 }, { 0xc7, 0x37, 0xbf, 0x73 }, + { 0xf7, 0xcd, 0xea, 0x53 }, { 0xfd, 0xaa, 0x5b, 0x5f }, { 0x3d, 0x6f, 0x14, 0xdf }, { 0x44, 0xdb, 0x86, 0x78 }, + { 0xaf, 0xf3, 0x81, 0xca }, { 0x68, 0xc4, 0x3e, 0xb9 }, { 0x24, 0x34, 0x2c, 0x38 }, { 0xa3, 0x40, 0x5f, 0xc2 }, + { 0x1d, 0xc3, 0x72, 0x16 }, { 0xe2, 0x25, 0x0c, 0xbc }, { 0x3c, 0x49, 0x8b, 0x28 }, { 0x0d, 0x95, 0x41, 0xff }, + { 0xa8, 0x01, 0x71, 0x39 }, { 0x0c, 0xb3, 0xde, 0x08 }, { 0xb4, 0xe4, 0x9c, 0xd8 }, { 0x56, 0xc1, 0x90, 0x64 }, + { 0xcb, 0x84, 0x61, 0x7b }, { 0x32, 0xb6, 0x70, 0xd5 }, { 0x6c, 0x5c, 0x74, 0x48 }, { 0xb8, 0x57, 0x42, 0xd0 } }; -static UINT8 S5[256]= -{ - 0x52,0x09,0x6a,0xd5, - 0x30,0x36,0xa5,0x38, - 0xbf,0x40,0xa3,0x9e, - 0x81,0xf3,0xd7,0xfb, - 0x7c,0xe3,0x39,0x82, - 0x9b,0x2f,0xff,0x87, - 0x34,0x8e,0x43,0x44, - 0xc4,0xde,0xe9,0xcb, - 0x54,0x7b,0x94,0x32, - 0xa6,0xc2,0x23,0x3d, - 0xee,0x4c,0x95,0x0b, - 0x42,0xfa,0xc3,0x4e, - 0x08,0x2e,0xa1,0x66, - 0x28,0xd9,0x24,0xb2, - 0x76,0x5b,0xa2,0x49, - 0x6d,0x8b,0xd1,0x25, - 0x72,0xf8,0xf6,0x64, - 0x86,0x68,0x98,0x16, - 0xd4,0xa4,0x5c,0xcc, - 0x5d,0x65,0xb6,0x92, - 0x6c,0x70,0x48,0x50, - 0xfd,0xed,0xb9,0xda, - 0x5e,0x15,0x46,0x57, - 0xa7,0x8d,0x9d,0x84, - 0x90,0xd8,0xab,0x00, - 0x8c,0xbc,0xd3,0x0a, - 0xf7,0xe4,0x58,0x05, - 0xb8,0xb3,0x45,0x06, - 0xd0,0x2c,0x1e,0x8f, - 0xca,0x3f,0x0f,0x02, - 0xc1,0xaf,0xbd,0x03, - 0x01,0x13,0x8a,0x6b, - 0x3a,0x91,0x11,0x41, - 0x4f,0x67,0xdc,0xea, - 0x97,0xf2,0xcf,0xce, - 0xf0,0xb4,0xe6,0x73, - 0x96,0xac,0x74,0x22, - 0xe7,0xad,0x35,0x85, - 0xe2,0xf9,0x37,0xe8, - 0x1c,0x75,0xdf,0x6e, - 0x47,0xf1,0x1a,0x71, - 0x1d,0x29,0xc5,0x89, - 0x6f,0xb7,0x62,0x0e, - 0xaa,0x18,0xbe,0x1b, - 0xfc,0x56,0x3e,0x4b, - 0xc6,0xd2,0x79,0x20, - 0x9a,0xdb,0xc0,0xfe, - 0x78,0xcd,0x5a,0xf4, - 0x1f,0xdd,0xa8,0x33, - 0x88,0x07,0xc7,0x31, - 0xb1,0x12,0x10,0x59, - 0x27,0x80,0xec,0x5f, - 0x60,0x51,0x7f,0xa9, - 0x19,0xb5,0x4a,0x0d, - 0x2d,0xe5,0x7a,0x9f, - 0x93,0xc9,0x9c,0xef, - 0xa0,0xe0,0x3b,0x4d, - 0xae,0x2a,0xf5,0xb0, - 0xc8,0xeb,0xbb,0x3c, - 0x83,0x53,0x99,0x61, - 0x17,0x2b,0x04,0x7e, - 0xba,0x77,0xd6,0x26, - 0xe1,0x69,0x14,0x63, - 0x55,0x21,0x0c,0x7d +static UINT8 S5[256] = { + 0x52, 0x09, 0x6a, 0xd5, + 0x30, 0x36, 0xa5, 0x38, + 0xbf, 0x40, 0xa3, 0x9e, + 0x81, 0xf3, 0xd7, 0xfb, + 0x7c, 0xe3, 0x39, 0x82, + 0x9b, 0x2f, 0xff, 0x87, + 0x34, 0x8e, 0x43, 0x44, + 0xc4, 0xde, 0xe9, 0xcb, + 0x54, 0x7b, 0x94, 0x32, + 0xa6, 0xc2, 0x23, 0x3d, + 0xee, 0x4c, 0x95, 0x0b, + 0x42, 0xfa, 0xc3, 0x4e, + 0x08, 0x2e, 0xa1, 0x66, + 0x28, 0xd9, 0x24, 0xb2, + 0x76, 0x5b, 0xa2, 0x49, + 0x6d, 0x8b, 0xd1, 0x25, + 0x72, 0xf8, 0xf6, 0x64, + 0x86, 0x68, 0x98, 0x16, + 0xd4, 0xa4, 0x5c, 0xcc, + 0x5d, 0x65, 0xb6, 0x92, + 0x6c, 0x70, 0x48, 0x50, + 0xfd, 0xed, 0xb9, 0xda, + 0x5e, 0x15, 0x46, 0x57, + 0xa7, 0x8d, 0x9d, 0x84, + 0x90, 0xd8, 0xab, 0x00, + 0x8c, 0xbc, 0xd3, 0x0a, + 0xf7, 0xe4, 0x58, 0x05, + 0xb8, 0xb3, 0x45, 0x06, + 0xd0, 0x2c, 0x1e, 0x8f, + 0xca, 0x3f, 0x0f, 0x02, + 0xc1, 0xaf, 0xbd, 0x03, + 0x01, 0x13, 0x8a, 0x6b, + 0x3a, 0x91, 0x11, 0x41, + 0x4f, 0x67, 0xdc, 0xea, + 0x97, 0xf2, 0xcf, 0xce, + 0xf0, 0xb4, 0xe6, 0x73, + 0x96, 0xac, 0x74, 0x22, + 0xe7, 0xad, 0x35, 0x85, + 0xe2, 0xf9, 0x37, 0xe8, + 0x1c, 0x75, 0xdf, 0x6e, + 0x47, 0xf1, 0x1a, 0x71, + 0x1d, 0x29, 0xc5, 0x89, + 0x6f, 0xb7, 0x62, 0x0e, + 0xaa, 0x18, 0xbe, 0x1b, + 0xfc, 0x56, 0x3e, 0x4b, + 0xc6, 0xd2, 0x79, 0x20, + 0x9a, 0xdb, 0xc0, 0xfe, + 0x78, 0xcd, 0x5a, 0xf4, + 0x1f, 0xdd, 0xa8, 0x33, + 0x88, 0x07, 0xc7, 0x31, + 0xb1, 0x12, 0x10, 0x59, + 0x27, 0x80, 0xec, 0x5f, + 0x60, 0x51, 0x7f, 0xa9, + 0x19, 0xb5, 0x4a, 0x0d, + 0x2d, 0xe5, 0x7a, 0x9f, + 0x93, 0xc9, 0x9c, 0xef, + 0xa0, 0xe0, 0x3b, 0x4d, + 0xae, 0x2a, 0xf5, 0xb0, + 0xc8, 0xeb, 0xbb, 0x3c, + 0x83, 0x53, 0x99, 0x61, + 0x17, 0x2b, 0x04, 0x7e, + 0xba, 0x77, 0xd6, 0x26, + 0xe1, 0x69, 0x14, 0x63, + 0x55, 0x21, 0x0c, 0x7d }; -static UINT8 U1[256][4]= -{ - {0x00,0x00,0x00,0x00}, {0x0e,0x09,0x0d,0x0b}, {0x1c,0x12,0x1a,0x16}, {0x12,0x1b,0x17,0x1d}, - {0x38,0x24,0x34,0x2c}, {0x36,0x2d,0x39,0x27}, {0x24,0x36,0x2e,0x3a}, {0x2a,0x3f,0x23,0x31}, - {0x70,0x48,0x68,0x58}, {0x7e,0x41,0x65,0x53}, {0x6c,0x5a,0x72,0x4e}, {0x62,0x53,0x7f,0x45}, - {0x48,0x6c,0x5c,0x74}, {0x46,0x65,0x51,0x7f}, {0x54,0x7e,0x46,0x62}, {0x5a,0x77,0x4b,0x69}, - {0xe0,0x90,0xd0,0xb0}, {0xee,0x99,0xdd,0xbb}, {0xfc,0x82,0xca,0xa6}, {0xf2,0x8b,0xc7,0xad}, - {0xd8,0xb4,0xe4,0x9c}, {0xd6,0xbd,0xe9,0x97}, {0xc4,0xa6,0xfe,0x8a}, {0xca,0xaf,0xf3,0x81}, - {0x90,0xd8,0xb8,0xe8}, {0x9e,0xd1,0xb5,0xe3}, {0x8c,0xca,0xa2,0xfe}, {0x82,0xc3,0xaf,0xf5}, - {0xa8,0xfc,0x8c,0xc4}, {0xa6,0xf5,0x81,0xcf}, {0xb4,0xee,0x96,0xd2}, {0xba,0xe7,0x9b,0xd9}, - {0xdb,0x3b,0xbb,0x7b}, {0xd5,0x32,0xb6,0x70}, {0xc7,0x29,0xa1,0x6d}, {0xc9,0x20,0xac,0x66}, - {0xe3,0x1f,0x8f,0x57}, {0xed,0x16,0x82,0x5c}, {0xff,0x0d,0x95,0x41}, {0xf1,0x04,0x98,0x4a}, - {0xab,0x73,0xd3,0x23}, {0xa5,0x7a,0xde,0x28}, {0xb7,0x61,0xc9,0x35}, {0xb9,0x68,0xc4,0x3e}, - {0x93,0x57,0xe7,0x0f}, {0x9d,0x5e,0xea,0x04}, {0x8f,0x45,0xfd,0x19}, {0x81,0x4c,0xf0,0x12}, - {0x3b,0xab,0x6b,0xcb}, {0x35,0xa2,0x66,0xc0}, {0x27,0xb9,0x71,0xdd}, {0x29,0xb0,0x7c,0xd6}, - {0x03,0x8f,0x5f,0xe7}, {0x0d,0x86,0x52,0xec}, {0x1f,0x9d,0x45,0xf1}, {0x11,0x94,0x48,0xfa}, - {0x4b,0xe3,0x03,0x93}, {0x45,0xea,0x0e,0x98}, {0x57,0xf1,0x19,0x85}, {0x59,0xf8,0x14,0x8e}, - {0x73,0xc7,0x37,0xbf}, {0x7d,0xce,0x3a,0xb4}, {0x6f,0xd5,0x2d,0xa9}, {0x61,0xdc,0x20,0xa2}, - {0xad,0x76,0x6d,0xf6}, {0xa3,0x7f,0x60,0xfd}, {0xb1,0x64,0x77,0xe0}, {0xbf,0x6d,0x7a,0xeb}, - {0x95,0x52,0x59,0xda}, {0x9b,0x5b,0x54,0xd1}, {0x89,0x40,0x43,0xcc}, {0x87,0x49,0x4e,0xc7}, - {0xdd,0x3e,0x05,0xae}, {0xd3,0x37,0x08,0xa5}, {0xc1,0x2c,0x1f,0xb8}, {0xcf,0x25,0x12,0xb3}, - {0xe5,0x1a,0x31,0x82}, {0xeb,0x13,0x3c,0x89}, {0xf9,0x08,0x2b,0x94}, {0xf7,0x01,0x26,0x9f}, - {0x4d,0xe6,0xbd,0x46}, {0x43,0xef,0xb0,0x4d}, {0x51,0xf4,0xa7,0x50}, {0x5f,0xfd,0xaa,0x5b}, - {0x75,0xc2,0x89,0x6a}, {0x7b,0xcb,0x84,0x61}, {0x69,0xd0,0x93,0x7c}, {0x67,0xd9,0x9e,0x77}, - {0x3d,0xae,0xd5,0x1e}, {0x33,0xa7,0xd8,0x15}, {0x21,0xbc,0xcf,0x08}, {0x2f,0xb5,0xc2,0x03}, - {0x05,0x8a,0xe1,0x32}, {0x0b,0x83,0xec,0x39}, {0x19,0x98,0xfb,0x24}, {0x17,0x91,0xf6,0x2f}, - {0x76,0x4d,0xd6,0x8d}, {0x78,0x44,0xdb,0x86}, {0x6a,0x5f,0xcc,0x9b}, {0x64,0x56,0xc1,0x90}, - {0x4e,0x69,0xe2,0xa1}, {0x40,0x60,0xef,0xaa}, {0x52,0x7b,0xf8,0xb7}, {0x5c,0x72,0xf5,0xbc}, - {0x06,0x05,0xbe,0xd5}, {0x08,0x0c,0xb3,0xde}, {0x1a,0x17,0xa4,0xc3}, {0x14,0x1e,0xa9,0xc8}, - {0x3e,0x21,0x8a,0xf9}, {0x30,0x28,0x87,0xf2}, {0x22,0x33,0x90,0xef}, {0x2c,0x3a,0x9d,0xe4}, - {0x96,0xdd,0x06,0x3d}, {0x98,0xd4,0x0b,0x36}, {0x8a,0xcf,0x1c,0x2b}, {0x84,0xc6,0x11,0x20}, - {0xae,0xf9,0x32,0x11}, {0xa0,0xf0,0x3f,0x1a}, {0xb2,0xeb,0x28,0x07}, {0xbc,0xe2,0x25,0x0c}, - {0xe6,0x95,0x6e,0x65}, {0xe8,0x9c,0x63,0x6e}, {0xfa,0x87,0x74,0x73}, {0xf4,0x8e,0x79,0x78}, - {0xde,0xb1,0x5a,0x49}, {0xd0,0xb8,0x57,0x42}, {0xc2,0xa3,0x40,0x5f}, {0xcc,0xaa,0x4d,0x54}, - {0x41,0xec,0xda,0xf7}, {0x4f,0xe5,0xd7,0xfc}, {0x5d,0xfe,0xc0,0xe1}, {0x53,0xf7,0xcd,0xea}, - {0x79,0xc8,0xee,0xdb}, {0x77,0xc1,0xe3,0xd0}, {0x65,0xda,0xf4,0xcd}, {0x6b,0xd3,0xf9,0xc6}, - {0x31,0xa4,0xb2,0xaf}, {0x3f,0xad,0xbf,0xa4}, {0x2d,0xb6,0xa8,0xb9}, {0x23,0xbf,0xa5,0xb2}, - {0x09,0x80,0x86,0x83}, {0x07,0x89,0x8b,0x88}, {0x15,0x92,0x9c,0x95}, {0x1b,0x9b,0x91,0x9e}, - {0xa1,0x7c,0x0a,0x47}, {0xaf,0x75,0x07,0x4c}, {0xbd,0x6e,0x10,0x51}, {0xb3,0x67,0x1d,0x5a}, - {0x99,0x58,0x3e,0x6b}, {0x97,0x51,0x33,0x60}, {0x85,0x4a,0x24,0x7d}, {0x8b,0x43,0x29,0x76}, - {0xd1,0x34,0x62,0x1f}, {0xdf,0x3d,0x6f,0x14}, {0xcd,0x26,0x78,0x09}, {0xc3,0x2f,0x75,0x02}, - {0xe9,0x10,0x56,0x33}, {0xe7,0x19,0x5b,0x38}, {0xf5,0x02,0x4c,0x25}, {0xfb,0x0b,0x41,0x2e}, - {0x9a,0xd7,0x61,0x8c}, {0x94,0xde,0x6c,0x87}, {0x86,0xc5,0x7b,0x9a}, {0x88,0xcc,0x76,0x91}, - {0xa2,0xf3,0x55,0xa0}, {0xac,0xfa,0x58,0xab}, {0xbe,0xe1,0x4f,0xb6}, {0xb0,0xe8,0x42,0xbd}, - {0xea,0x9f,0x09,0xd4}, {0xe4,0x96,0x04,0xdf}, {0xf6,0x8d,0x13,0xc2}, {0xf8,0x84,0x1e,0xc9}, - {0xd2,0xbb,0x3d,0xf8}, {0xdc,0xb2,0x30,0xf3}, {0xce,0xa9,0x27,0xee}, {0xc0,0xa0,0x2a,0xe5}, - {0x7a,0x47,0xb1,0x3c}, {0x74,0x4e,0xbc,0x37}, {0x66,0x55,0xab,0x2a}, {0x68,0x5c,0xa6,0x21}, - {0x42,0x63,0x85,0x10}, {0x4c,0x6a,0x88,0x1b}, {0x5e,0x71,0x9f,0x06}, {0x50,0x78,0x92,0x0d}, - {0x0a,0x0f,0xd9,0x64}, {0x04,0x06,0xd4,0x6f}, {0x16,0x1d,0xc3,0x72}, {0x18,0x14,0xce,0x79}, - {0x32,0x2b,0xed,0x48}, {0x3c,0x22,0xe0,0x43}, {0x2e,0x39,0xf7,0x5e}, {0x20,0x30,0xfa,0x55}, - {0xec,0x9a,0xb7,0x01}, {0xe2,0x93,0xba,0x0a}, {0xf0,0x88,0xad,0x17}, {0xfe,0x81,0xa0,0x1c}, - {0xd4,0xbe,0x83,0x2d}, {0xda,0xb7,0x8e,0x26}, {0xc8,0xac,0x99,0x3b}, {0xc6,0xa5,0x94,0x30}, - {0x9c,0xd2,0xdf,0x59}, {0x92,0xdb,0xd2,0x52}, {0x80,0xc0,0xc5,0x4f}, {0x8e,0xc9,0xc8,0x44}, - {0xa4,0xf6,0xeb,0x75}, {0xaa,0xff,0xe6,0x7e}, {0xb8,0xe4,0xf1,0x63}, {0xb6,0xed,0xfc,0x68}, - {0x0c,0x0a,0x67,0xb1}, {0x02,0x03,0x6a,0xba}, {0x10,0x18,0x7d,0xa7}, {0x1e,0x11,0x70,0xac}, - {0x34,0x2e,0x53,0x9d}, {0x3a,0x27,0x5e,0x96}, {0x28,0x3c,0x49,0x8b}, {0x26,0x35,0x44,0x80}, - {0x7c,0x42,0x0f,0xe9}, {0x72,0x4b,0x02,0xe2}, {0x60,0x50,0x15,0xff}, {0x6e,0x59,0x18,0xf4}, - {0x44,0x66,0x3b,0xc5}, {0x4a,0x6f,0x36,0xce}, {0x58,0x74,0x21,0xd3}, {0x56,0x7d,0x2c,0xd8}, - {0x37,0xa1,0x0c,0x7a}, {0x39,0xa8,0x01,0x71}, {0x2b,0xb3,0x16,0x6c}, {0x25,0xba,0x1b,0x67}, - {0x0f,0x85,0x38,0x56}, {0x01,0x8c,0x35,0x5d}, {0x13,0x97,0x22,0x40}, {0x1d,0x9e,0x2f,0x4b}, - {0x47,0xe9,0x64,0x22}, {0x49,0xe0,0x69,0x29}, {0x5b,0xfb,0x7e,0x34}, {0x55,0xf2,0x73,0x3f}, - {0x7f,0xcd,0x50,0x0e}, {0x71,0xc4,0x5d,0x05}, {0x63,0xdf,0x4a,0x18}, {0x6d,0xd6,0x47,0x13}, - {0xd7,0x31,0xdc,0xca}, {0xd9,0x38,0xd1,0xc1}, {0xcb,0x23,0xc6,0xdc}, {0xc5,0x2a,0xcb,0xd7}, - {0xef,0x15,0xe8,0xe6}, {0xe1,0x1c,0xe5,0xed}, {0xf3,0x07,0xf2,0xf0}, {0xfd,0x0e,0xff,0xfb}, - {0xa7,0x79,0xb4,0x92}, {0xa9,0x70,0xb9,0x99}, {0xbb,0x6b,0xae,0x84}, {0xb5,0x62,0xa3,0x8f}, - {0x9f,0x5d,0x80,0xbe}, {0x91,0x54,0x8d,0xb5}, {0x83,0x4f,0x9a,0xa8}, {0x8d,0x46,0x97,0xa3} +static UINT8 U1[256][4] = { + { 0x00, 0x00, 0x00, 0x00 }, { 0x0e, 0x09, 0x0d, 0x0b }, { 0x1c, 0x12, 0x1a, 0x16 }, { 0x12, 0x1b, 0x17, 0x1d }, + { 0x38, 0x24, 0x34, 0x2c }, { 0x36, 0x2d, 0x39, 0x27 }, { 0x24, 0x36, 0x2e, 0x3a }, { 0x2a, 0x3f, 0x23, 0x31 }, + { 0x70, 0x48, 0x68, 0x58 }, { 0x7e, 0x41, 0x65, 0x53 }, { 0x6c, 0x5a, 0x72, 0x4e }, { 0x62, 0x53, 0x7f, 0x45 }, + { 0x48, 0x6c, 0x5c, 0x74 }, { 0x46, 0x65, 0x51, 0x7f }, { 0x54, 0x7e, 0x46, 0x62 }, { 0x5a, 0x77, 0x4b, 0x69 }, + { 0xe0, 0x90, 0xd0, 0xb0 }, { 0xee, 0x99, 0xdd, 0xbb }, { 0xfc, 0x82, 0xca, 0xa6 }, { 0xf2, 0x8b, 0xc7, 0xad }, + { 0xd8, 0xb4, 0xe4, 0x9c }, { 0xd6, 0xbd, 0xe9, 0x97 }, { 0xc4, 0xa6, 0xfe, 0x8a }, { 0xca, 0xaf, 0xf3, 0x81 }, + { 0x90, 0xd8, 0xb8, 0xe8 }, { 0x9e, 0xd1, 0xb5, 0xe3 }, { 0x8c, 0xca, 0xa2, 0xfe }, { 0x82, 0xc3, 0xaf, 0xf5 }, + { 0xa8, 0xfc, 0x8c, 0xc4 }, { 0xa6, 0xf5, 0x81, 0xcf }, { 0xb4, 0xee, 0x96, 0xd2 }, { 0xba, 0xe7, 0x9b, 0xd9 }, + { 0xdb, 0x3b, 0xbb, 0x7b }, { 0xd5, 0x32, 0xb6, 0x70 }, { 0xc7, 0x29, 0xa1, 0x6d }, { 0xc9, 0x20, 0xac, 0x66 }, + { 0xe3, 0x1f, 0x8f, 0x57 }, { 0xed, 0x16, 0x82, 0x5c }, { 0xff, 0x0d, 0x95, 0x41 }, { 0xf1, 0x04, 0x98, 0x4a }, + { 0xab, 0x73, 0xd3, 0x23 }, { 0xa5, 0x7a, 0xde, 0x28 }, { 0xb7, 0x61, 0xc9, 0x35 }, { 0xb9, 0x68, 0xc4, 0x3e }, + { 0x93, 0x57, 0xe7, 0x0f }, { 0x9d, 0x5e, 0xea, 0x04 }, { 0x8f, 0x45, 0xfd, 0x19 }, { 0x81, 0x4c, 0xf0, 0x12 }, + { 0x3b, 0xab, 0x6b, 0xcb }, { 0x35, 0xa2, 0x66, 0xc0 }, { 0x27, 0xb9, 0x71, 0xdd }, { 0x29, 0xb0, 0x7c, 0xd6 }, + { 0x03, 0x8f, 0x5f, 0xe7 }, { 0x0d, 0x86, 0x52, 0xec }, { 0x1f, 0x9d, 0x45, 0xf1 }, { 0x11, 0x94, 0x48, 0xfa }, + { 0x4b, 0xe3, 0x03, 0x93 }, { 0x45, 0xea, 0x0e, 0x98 }, { 0x57, 0xf1, 0x19, 0x85 }, { 0x59, 0xf8, 0x14, 0x8e }, + { 0x73, 0xc7, 0x37, 0xbf }, { 0x7d, 0xce, 0x3a, 0xb4 }, { 0x6f, 0xd5, 0x2d, 0xa9 }, { 0x61, 0xdc, 0x20, 0xa2 }, + { 0xad, 0x76, 0x6d, 0xf6 }, { 0xa3, 0x7f, 0x60, 0xfd }, { 0xb1, 0x64, 0x77, 0xe0 }, { 0xbf, 0x6d, 0x7a, 0xeb }, + { 0x95, 0x52, 0x59, 0xda }, { 0x9b, 0x5b, 0x54, 0xd1 }, { 0x89, 0x40, 0x43, 0xcc }, { 0x87, 0x49, 0x4e, 0xc7 }, + { 0xdd, 0x3e, 0x05, 0xae }, { 0xd3, 0x37, 0x08, 0xa5 }, { 0xc1, 0x2c, 0x1f, 0xb8 }, { 0xcf, 0x25, 0x12, 0xb3 }, + { 0xe5, 0x1a, 0x31, 0x82 }, { 0xeb, 0x13, 0x3c, 0x89 }, { 0xf9, 0x08, 0x2b, 0x94 }, { 0xf7, 0x01, 0x26, 0x9f }, + { 0x4d, 0xe6, 0xbd, 0x46 }, { 0x43, 0xef, 0xb0, 0x4d }, { 0x51, 0xf4, 0xa7, 0x50 }, { 0x5f, 0xfd, 0xaa, 0x5b }, + { 0x75, 0xc2, 0x89, 0x6a }, { 0x7b, 0xcb, 0x84, 0x61 }, { 0x69, 0xd0, 0x93, 0x7c }, { 0x67, 0xd9, 0x9e, 0x77 }, + { 0x3d, 0xae, 0xd5, 0x1e }, { 0x33, 0xa7, 0xd8, 0x15 }, { 0x21, 0xbc, 0xcf, 0x08 }, { 0x2f, 0xb5, 0xc2, 0x03 }, + { 0x05, 0x8a, 0xe1, 0x32 }, { 0x0b, 0x83, 0xec, 0x39 }, { 0x19, 0x98, 0xfb, 0x24 }, { 0x17, 0x91, 0xf6, 0x2f }, + { 0x76, 0x4d, 0xd6, 0x8d }, { 0x78, 0x44, 0xdb, 0x86 }, { 0x6a, 0x5f, 0xcc, 0x9b }, { 0x64, 0x56, 0xc1, 0x90 }, + { 0x4e, 0x69, 0xe2, 0xa1 }, { 0x40, 0x60, 0xef, 0xaa }, { 0x52, 0x7b, 0xf8, 0xb7 }, { 0x5c, 0x72, 0xf5, 0xbc }, + { 0x06, 0x05, 0xbe, 0xd5 }, { 0x08, 0x0c, 0xb3, 0xde }, { 0x1a, 0x17, 0xa4, 0xc3 }, { 0x14, 0x1e, 0xa9, 0xc8 }, + { 0x3e, 0x21, 0x8a, 0xf9 }, { 0x30, 0x28, 0x87, 0xf2 }, { 0x22, 0x33, 0x90, 0xef }, { 0x2c, 0x3a, 0x9d, 0xe4 }, + { 0x96, 0xdd, 0x06, 0x3d }, { 0x98, 0xd4, 0x0b, 0x36 }, { 0x8a, 0xcf, 0x1c, 0x2b }, { 0x84, 0xc6, 0x11, 0x20 }, + { 0xae, 0xf9, 0x32, 0x11 }, { 0xa0, 0xf0, 0x3f, 0x1a }, { 0xb2, 0xeb, 0x28, 0x07 }, { 0xbc, 0xe2, 0x25, 0x0c }, + { 0xe6, 0x95, 0x6e, 0x65 }, { 0xe8, 0x9c, 0x63, 0x6e }, { 0xfa, 0x87, 0x74, 0x73 }, { 0xf4, 0x8e, 0x79, 0x78 }, + { 0xde, 0xb1, 0x5a, 0x49 }, { 0xd0, 0xb8, 0x57, 0x42 }, { 0xc2, 0xa3, 0x40, 0x5f }, { 0xcc, 0xaa, 0x4d, 0x54 }, + { 0x41, 0xec, 0xda, 0xf7 }, { 0x4f, 0xe5, 0xd7, 0xfc }, { 0x5d, 0xfe, 0xc0, 0xe1 }, { 0x53, 0xf7, 0xcd, 0xea }, + { 0x79, 0xc8, 0xee, 0xdb }, { 0x77, 0xc1, 0xe3, 0xd0 }, { 0x65, 0xda, 0xf4, 0xcd }, { 0x6b, 0xd3, 0xf9, 0xc6 }, + { 0x31, 0xa4, 0xb2, 0xaf }, { 0x3f, 0xad, 0xbf, 0xa4 }, { 0x2d, 0xb6, 0xa8, 0xb9 }, { 0x23, 0xbf, 0xa5, 0xb2 }, + { 0x09, 0x80, 0x86, 0x83 }, { 0x07, 0x89, 0x8b, 0x88 }, { 0x15, 0x92, 0x9c, 0x95 }, { 0x1b, 0x9b, 0x91, 0x9e }, + { 0xa1, 0x7c, 0x0a, 0x47 }, { 0xaf, 0x75, 0x07, 0x4c }, { 0xbd, 0x6e, 0x10, 0x51 }, { 0xb3, 0x67, 0x1d, 0x5a }, + { 0x99, 0x58, 0x3e, 0x6b }, { 0x97, 0x51, 0x33, 0x60 }, { 0x85, 0x4a, 0x24, 0x7d }, { 0x8b, 0x43, 0x29, 0x76 }, + { 0xd1, 0x34, 0x62, 0x1f }, { 0xdf, 0x3d, 0x6f, 0x14 }, { 0xcd, 0x26, 0x78, 0x09 }, { 0xc3, 0x2f, 0x75, 0x02 }, + { 0xe9, 0x10, 0x56, 0x33 }, { 0xe7, 0x19, 0x5b, 0x38 }, { 0xf5, 0x02, 0x4c, 0x25 }, { 0xfb, 0x0b, 0x41, 0x2e }, + { 0x9a, 0xd7, 0x61, 0x8c }, { 0x94, 0xde, 0x6c, 0x87 }, { 0x86, 0xc5, 0x7b, 0x9a }, { 0x88, 0xcc, 0x76, 0x91 }, + { 0xa2, 0xf3, 0x55, 0xa0 }, { 0xac, 0xfa, 0x58, 0xab }, { 0xbe, 0xe1, 0x4f, 0xb6 }, { 0xb0, 0xe8, 0x42, 0xbd }, + { 0xea, 0x9f, 0x09, 0xd4 }, { 0xe4, 0x96, 0x04, 0xdf }, { 0xf6, 0x8d, 0x13, 0xc2 }, { 0xf8, 0x84, 0x1e, 0xc9 }, + { 0xd2, 0xbb, 0x3d, 0xf8 }, { 0xdc, 0xb2, 0x30, 0xf3 }, { 0xce, 0xa9, 0x27, 0xee }, { 0xc0, 0xa0, 0x2a, 0xe5 }, + { 0x7a, 0x47, 0xb1, 0x3c }, { 0x74, 0x4e, 0xbc, 0x37 }, { 0x66, 0x55, 0xab, 0x2a }, { 0x68, 0x5c, 0xa6, 0x21 }, + { 0x42, 0x63, 0x85, 0x10 }, { 0x4c, 0x6a, 0x88, 0x1b }, { 0x5e, 0x71, 0x9f, 0x06 }, { 0x50, 0x78, 0x92, 0x0d }, + { 0x0a, 0x0f, 0xd9, 0x64 }, { 0x04, 0x06, 0xd4, 0x6f }, { 0x16, 0x1d, 0xc3, 0x72 }, { 0x18, 0x14, 0xce, 0x79 }, + { 0x32, 0x2b, 0xed, 0x48 }, { 0x3c, 0x22, 0xe0, 0x43 }, { 0x2e, 0x39, 0xf7, 0x5e }, { 0x20, 0x30, 0xfa, 0x55 }, + { 0xec, 0x9a, 0xb7, 0x01 }, { 0xe2, 0x93, 0xba, 0x0a }, { 0xf0, 0x88, 0xad, 0x17 }, { 0xfe, 0x81, 0xa0, 0x1c }, + { 0xd4, 0xbe, 0x83, 0x2d }, { 0xda, 0xb7, 0x8e, 0x26 }, { 0xc8, 0xac, 0x99, 0x3b }, { 0xc6, 0xa5, 0x94, 0x30 }, + { 0x9c, 0xd2, 0xdf, 0x59 }, { 0x92, 0xdb, 0xd2, 0x52 }, { 0x80, 0xc0, 0xc5, 0x4f }, { 0x8e, 0xc9, 0xc8, 0x44 }, + { 0xa4, 0xf6, 0xeb, 0x75 }, { 0xaa, 0xff, 0xe6, 0x7e }, { 0xb8, 0xe4, 0xf1, 0x63 }, { 0xb6, 0xed, 0xfc, 0x68 }, + { 0x0c, 0x0a, 0x67, 0xb1 }, { 0x02, 0x03, 0x6a, 0xba }, { 0x10, 0x18, 0x7d, 0xa7 }, { 0x1e, 0x11, 0x70, 0xac }, + { 0x34, 0x2e, 0x53, 0x9d }, { 0x3a, 0x27, 0x5e, 0x96 }, { 0x28, 0x3c, 0x49, 0x8b }, { 0x26, 0x35, 0x44, 0x80 }, + { 0x7c, 0x42, 0x0f, 0xe9 }, { 0x72, 0x4b, 0x02, 0xe2 }, { 0x60, 0x50, 0x15, 0xff }, { 0x6e, 0x59, 0x18, 0xf4 }, + { 0x44, 0x66, 0x3b, 0xc5 }, { 0x4a, 0x6f, 0x36, 0xce }, { 0x58, 0x74, 0x21, 0xd3 }, { 0x56, 0x7d, 0x2c, 0xd8 }, + { 0x37, 0xa1, 0x0c, 0x7a }, { 0x39, 0xa8, 0x01, 0x71 }, { 0x2b, 0xb3, 0x16, 0x6c }, { 0x25, 0xba, 0x1b, 0x67 }, + { 0x0f, 0x85, 0x38, 0x56 }, { 0x01, 0x8c, 0x35, 0x5d }, { 0x13, 0x97, 0x22, 0x40 }, { 0x1d, 0x9e, 0x2f, 0x4b }, + { 0x47, 0xe9, 0x64, 0x22 }, { 0x49, 0xe0, 0x69, 0x29 }, { 0x5b, 0xfb, 0x7e, 0x34 }, { 0x55, 0xf2, 0x73, 0x3f }, + { 0x7f, 0xcd, 0x50, 0x0e }, { 0x71, 0xc4, 0x5d, 0x05 }, { 0x63, 0xdf, 0x4a, 0x18 }, { 0x6d, 0xd6, 0x47, 0x13 }, + { 0xd7, 0x31, 0xdc, 0xca }, { 0xd9, 0x38, 0xd1, 0xc1 }, { 0xcb, 0x23, 0xc6, 0xdc }, { 0xc5, 0x2a, 0xcb, 0xd7 }, + { 0xef, 0x15, 0xe8, 0xe6 }, { 0xe1, 0x1c, 0xe5, 0xed }, { 0xf3, 0x07, 0xf2, 0xf0 }, { 0xfd, 0x0e, 0xff, 0xfb }, + { 0xa7, 0x79, 0xb4, 0x92 }, { 0xa9, 0x70, 0xb9, 0x99 }, { 0xbb, 0x6b, 0xae, 0x84 }, { 0xb5, 0x62, 0xa3, 0x8f }, + { 0x9f, 0x5d, 0x80, 0xbe }, { 0x91, 0x54, 0x8d, 0xb5 }, { 0x83, 0x4f, 0x9a, 0xa8 }, { 0x8d, 0x46, 0x97, 0xa3 } }; -static UINT8 U2[256][4]= -{ - {0x00,0x00,0x00,0x00}, {0x0b,0x0e,0x09,0x0d}, {0x16,0x1c,0x12,0x1a}, {0x1d,0x12,0x1b,0x17}, - {0x2c,0x38,0x24,0x34}, {0x27,0x36,0x2d,0x39}, {0x3a,0x24,0x36,0x2e}, {0x31,0x2a,0x3f,0x23}, - {0x58,0x70,0x48,0x68}, {0x53,0x7e,0x41,0x65}, {0x4e,0x6c,0x5a,0x72}, {0x45,0x62,0x53,0x7f}, - {0x74,0x48,0x6c,0x5c}, {0x7f,0x46,0x65,0x51}, {0x62,0x54,0x7e,0x46}, {0x69,0x5a,0x77,0x4b}, - {0xb0,0xe0,0x90,0xd0}, {0xbb,0xee,0x99,0xdd}, {0xa6,0xfc,0x82,0xca}, {0xad,0xf2,0x8b,0xc7}, - {0x9c,0xd8,0xb4,0xe4}, {0x97,0xd6,0xbd,0xe9}, {0x8a,0xc4,0xa6,0xfe}, {0x81,0xca,0xaf,0xf3}, - {0xe8,0x90,0xd8,0xb8}, {0xe3,0x9e,0xd1,0xb5}, {0xfe,0x8c,0xca,0xa2}, {0xf5,0x82,0xc3,0xaf}, - {0xc4,0xa8,0xfc,0x8c}, {0xcf,0xa6,0xf5,0x81}, {0xd2,0xb4,0xee,0x96}, {0xd9,0xba,0xe7,0x9b}, - {0x7b,0xdb,0x3b,0xbb}, {0x70,0xd5,0x32,0xb6}, {0x6d,0xc7,0x29,0xa1}, {0x66,0xc9,0x20,0xac}, - {0x57,0xe3,0x1f,0x8f}, {0x5c,0xed,0x16,0x82}, {0x41,0xff,0x0d,0x95}, {0x4a,0xf1,0x04,0x98}, - {0x23,0xab,0x73,0xd3}, {0x28,0xa5,0x7a,0xde}, {0x35,0xb7,0x61,0xc9}, {0x3e,0xb9,0x68,0xc4}, - {0x0f,0x93,0x57,0xe7}, {0x04,0x9d,0x5e,0xea}, {0x19,0x8f,0x45,0xfd}, {0x12,0x81,0x4c,0xf0}, - {0xcb,0x3b,0xab,0x6b}, {0xc0,0x35,0xa2,0x66}, {0xdd,0x27,0xb9,0x71}, {0xd6,0x29,0xb0,0x7c}, - {0xe7,0x03,0x8f,0x5f}, {0xec,0x0d,0x86,0x52}, {0xf1,0x1f,0x9d,0x45}, {0xfa,0x11,0x94,0x48}, - {0x93,0x4b,0xe3,0x03}, {0x98,0x45,0xea,0x0e}, {0x85,0x57,0xf1,0x19}, {0x8e,0x59,0xf8,0x14}, - {0xbf,0x73,0xc7,0x37}, {0xb4,0x7d,0xce,0x3a}, {0xa9,0x6f,0xd5,0x2d}, {0xa2,0x61,0xdc,0x20}, - {0xf6,0xad,0x76,0x6d}, {0xfd,0xa3,0x7f,0x60}, {0xe0,0xb1,0x64,0x77}, {0xeb,0xbf,0x6d,0x7a}, - {0xda,0x95,0x52,0x59}, {0xd1,0x9b,0x5b,0x54}, {0xcc,0x89,0x40,0x43}, {0xc7,0x87,0x49,0x4e}, - {0xae,0xdd,0x3e,0x05}, {0xa5,0xd3,0x37,0x08}, {0xb8,0xc1,0x2c,0x1f}, {0xb3,0xcf,0x25,0x12}, - {0x82,0xe5,0x1a,0x31}, {0x89,0xeb,0x13,0x3c}, {0x94,0xf9,0x08,0x2b}, {0x9f,0xf7,0x01,0x26}, - {0x46,0x4d,0xe6,0xbd}, {0x4d,0x43,0xef,0xb0}, {0x50,0x51,0xf4,0xa7}, {0x5b,0x5f,0xfd,0xaa}, - {0x6a,0x75,0xc2,0x89}, {0x61,0x7b,0xcb,0x84}, {0x7c,0x69,0xd0,0x93}, {0x77,0x67,0xd9,0x9e}, - {0x1e,0x3d,0xae,0xd5}, {0x15,0x33,0xa7,0xd8}, {0x08,0x21,0xbc,0xcf}, {0x03,0x2f,0xb5,0xc2}, - {0x32,0x05,0x8a,0xe1}, {0x39,0x0b,0x83,0xec}, {0x24,0x19,0x98,0xfb}, {0x2f,0x17,0x91,0xf6}, - {0x8d,0x76,0x4d,0xd6}, {0x86,0x78,0x44,0xdb}, {0x9b,0x6a,0x5f,0xcc}, {0x90,0x64,0x56,0xc1}, - {0xa1,0x4e,0x69,0xe2}, {0xaa,0x40,0x60,0xef}, {0xb7,0x52,0x7b,0xf8}, {0xbc,0x5c,0x72,0xf5}, - {0xd5,0x06,0x05,0xbe}, {0xde,0x08,0x0c,0xb3}, {0xc3,0x1a,0x17,0xa4}, {0xc8,0x14,0x1e,0xa9}, - {0xf9,0x3e,0x21,0x8a}, {0xf2,0x30,0x28,0x87}, {0xef,0x22,0x33,0x90}, {0xe4,0x2c,0x3a,0x9d}, - {0x3d,0x96,0xdd,0x06}, {0x36,0x98,0xd4,0x0b}, {0x2b,0x8a,0xcf,0x1c}, {0x20,0x84,0xc6,0x11}, - {0x11,0xae,0xf9,0x32}, {0x1a,0xa0,0xf0,0x3f}, {0x07,0xb2,0xeb,0x28}, {0x0c,0xbc,0xe2,0x25}, - {0x65,0xe6,0x95,0x6e}, {0x6e,0xe8,0x9c,0x63}, {0x73,0xfa,0x87,0x74}, {0x78,0xf4,0x8e,0x79}, - {0x49,0xde,0xb1,0x5a}, {0x42,0xd0,0xb8,0x57}, {0x5f,0xc2,0xa3,0x40}, {0x54,0xcc,0xaa,0x4d}, - {0xf7,0x41,0xec,0xda}, {0xfc,0x4f,0xe5,0xd7}, {0xe1,0x5d,0xfe,0xc0}, {0xea,0x53,0xf7,0xcd}, - {0xdb,0x79,0xc8,0xee}, {0xd0,0x77,0xc1,0xe3}, {0xcd,0x65,0xda,0xf4}, {0xc6,0x6b,0xd3,0xf9}, - {0xaf,0x31,0xa4,0xb2}, {0xa4,0x3f,0xad,0xbf}, {0xb9,0x2d,0xb6,0xa8}, {0xb2,0x23,0xbf,0xa5}, - {0x83,0x09,0x80,0x86}, {0x88,0x07,0x89,0x8b}, {0x95,0x15,0x92,0x9c}, {0x9e,0x1b,0x9b,0x91}, - {0x47,0xa1,0x7c,0x0a}, {0x4c,0xaf,0x75,0x07}, {0x51,0xbd,0x6e,0x10}, {0x5a,0xb3,0x67,0x1d}, - {0x6b,0x99,0x58,0x3e}, {0x60,0x97,0x51,0x33}, {0x7d,0x85,0x4a,0x24}, {0x76,0x8b,0x43,0x29}, - {0x1f,0xd1,0x34,0x62}, {0x14,0xdf,0x3d,0x6f}, {0x09,0xcd,0x26,0x78}, {0x02,0xc3,0x2f,0x75}, - {0x33,0xe9,0x10,0x56}, {0x38,0xe7,0x19,0x5b}, {0x25,0xf5,0x02,0x4c}, {0x2e,0xfb,0x0b,0x41}, - {0x8c,0x9a,0xd7,0x61}, {0x87,0x94,0xde,0x6c}, {0x9a,0x86,0xc5,0x7b}, {0x91,0x88,0xcc,0x76}, - {0xa0,0xa2,0xf3,0x55}, {0xab,0xac,0xfa,0x58}, {0xb6,0xbe,0xe1,0x4f}, {0xbd,0xb0,0xe8,0x42}, - {0xd4,0xea,0x9f,0x09}, {0xdf,0xe4,0x96,0x04}, {0xc2,0xf6,0x8d,0x13}, {0xc9,0xf8,0x84,0x1e}, - {0xf8,0xd2,0xbb,0x3d}, {0xf3,0xdc,0xb2,0x30}, {0xee,0xce,0xa9,0x27}, {0xe5,0xc0,0xa0,0x2a}, - {0x3c,0x7a,0x47,0xb1}, {0x37,0x74,0x4e,0xbc}, {0x2a,0x66,0x55,0xab}, {0x21,0x68,0x5c,0xa6}, - {0x10,0x42,0x63,0x85}, {0x1b,0x4c,0x6a,0x88}, {0x06,0x5e,0x71,0x9f}, {0x0d,0x50,0x78,0x92}, - {0x64,0x0a,0x0f,0xd9}, {0x6f,0x04,0x06,0xd4}, {0x72,0x16,0x1d,0xc3}, {0x79,0x18,0x14,0xce}, - {0x48,0x32,0x2b,0xed}, {0x43,0x3c,0x22,0xe0}, {0x5e,0x2e,0x39,0xf7}, {0x55,0x20,0x30,0xfa}, - {0x01,0xec,0x9a,0xb7}, {0x0a,0xe2,0x93,0xba}, {0x17,0xf0,0x88,0xad}, {0x1c,0xfe,0x81,0xa0}, - {0x2d,0xd4,0xbe,0x83}, {0x26,0xda,0xb7,0x8e}, {0x3b,0xc8,0xac,0x99}, {0x30,0xc6,0xa5,0x94}, - {0x59,0x9c,0xd2,0xdf}, {0x52,0x92,0xdb,0xd2}, {0x4f,0x80,0xc0,0xc5}, {0x44,0x8e,0xc9,0xc8}, - {0x75,0xa4,0xf6,0xeb}, {0x7e,0xaa,0xff,0xe6}, {0x63,0xb8,0xe4,0xf1}, {0x68,0xb6,0xed,0xfc}, - {0xb1,0x0c,0x0a,0x67}, {0xba,0x02,0x03,0x6a}, {0xa7,0x10,0x18,0x7d}, {0xac,0x1e,0x11,0x70}, - {0x9d,0x34,0x2e,0x53}, {0x96,0x3a,0x27,0x5e}, {0x8b,0x28,0x3c,0x49}, {0x80,0x26,0x35,0x44}, - {0xe9,0x7c,0x42,0x0f}, {0xe2,0x72,0x4b,0x02}, {0xff,0x60,0x50,0x15}, {0xf4,0x6e,0x59,0x18}, - {0xc5,0x44,0x66,0x3b}, {0xce,0x4a,0x6f,0x36}, {0xd3,0x58,0x74,0x21}, {0xd8,0x56,0x7d,0x2c}, - {0x7a,0x37,0xa1,0x0c}, {0x71,0x39,0xa8,0x01}, {0x6c,0x2b,0xb3,0x16}, {0x67,0x25,0xba,0x1b}, - {0x56,0x0f,0x85,0x38}, {0x5d,0x01,0x8c,0x35}, {0x40,0x13,0x97,0x22}, {0x4b,0x1d,0x9e,0x2f}, - {0x22,0x47,0xe9,0x64}, {0x29,0x49,0xe0,0x69}, {0x34,0x5b,0xfb,0x7e}, {0x3f,0x55,0xf2,0x73}, - {0x0e,0x7f,0xcd,0x50}, {0x05,0x71,0xc4,0x5d}, {0x18,0x63,0xdf,0x4a}, {0x13,0x6d,0xd6,0x47}, - {0xca,0xd7,0x31,0xdc}, {0xc1,0xd9,0x38,0xd1}, {0xdc,0xcb,0x23,0xc6}, {0xd7,0xc5,0x2a,0xcb}, - {0xe6,0xef,0x15,0xe8}, {0xed,0xe1,0x1c,0xe5}, {0xf0,0xf3,0x07,0xf2}, {0xfb,0xfd,0x0e,0xff}, - {0x92,0xa7,0x79,0xb4}, {0x99,0xa9,0x70,0xb9}, {0x84,0xbb,0x6b,0xae}, {0x8f,0xb5,0x62,0xa3}, - {0xbe,0x9f,0x5d,0x80}, {0xb5,0x91,0x54,0x8d}, {0xa8,0x83,0x4f,0x9a}, {0xa3,0x8d,0x46,0x97} +static UINT8 U2[256][4] = { + { 0x00, 0x00, 0x00, 0x00 }, { 0x0b, 0x0e, 0x09, 0x0d }, { 0x16, 0x1c, 0x12, 0x1a }, { 0x1d, 0x12, 0x1b, 0x17 }, + { 0x2c, 0x38, 0x24, 0x34 }, { 0x27, 0x36, 0x2d, 0x39 }, { 0x3a, 0x24, 0x36, 0x2e }, { 0x31, 0x2a, 0x3f, 0x23 }, + { 0x58, 0x70, 0x48, 0x68 }, { 0x53, 0x7e, 0x41, 0x65 }, { 0x4e, 0x6c, 0x5a, 0x72 }, { 0x45, 0x62, 0x53, 0x7f }, + { 0x74, 0x48, 0x6c, 0x5c }, { 0x7f, 0x46, 0x65, 0x51 }, { 0x62, 0x54, 0x7e, 0x46 }, { 0x69, 0x5a, 0x77, 0x4b }, + { 0xb0, 0xe0, 0x90, 0xd0 }, { 0xbb, 0xee, 0x99, 0xdd }, { 0xa6, 0xfc, 0x82, 0xca }, { 0xad, 0xf2, 0x8b, 0xc7 }, + { 0x9c, 0xd8, 0xb4, 0xe4 }, { 0x97, 0xd6, 0xbd, 0xe9 }, { 0x8a, 0xc4, 0xa6, 0xfe }, { 0x81, 0xca, 0xaf, 0xf3 }, + { 0xe8, 0x90, 0xd8, 0xb8 }, { 0xe3, 0x9e, 0xd1, 0xb5 }, { 0xfe, 0x8c, 0xca, 0xa2 }, { 0xf5, 0x82, 0xc3, 0xaf }, + { 0xc4, 0xa8, 0xfc, 0x8c }, { 0xcf, 0xa6, 0xf5, 0x81 }, { 0xd2, 0xb4, 0xee, 0x96 }, { 0xd9, 0xba, 0xe7, 0x9b }, + { 0x7b, 0xdb, 0x3b, 0xbb }, { 0x70, 0xd5, 0x32, 0xb6 }, { 0x6d, 0xc7, 0x29, 0xa1 }, { 0x66, 0xc9, 0x20, 0xac }, + { 0x57, 0xe3, 0x1f, 0x8f }, { 0x5c, 0xed, 0x16, 0x82 }, { 0x41, 0xff, 0x0d, 0x95 }, { 0x4a, 0xf1, 0x04, 0x98 }, + { 0x23, 0xab, 0x73, 0xd3 }, { 0x28, 0xa5, 0x7a, 0xde }, { 0x35, 0xb7, 0x61, 0xc9 }, { 0x3e, 0xb9, 0x68, 0xc4 }, + { 0x0f, 0x93, 0x57, 0xe7 }, { 0x04, 0x9d, 0x5e, 0xea }, { 0x19, 0x8f, 0x45, 0xfd }, { 0x12, 0x81, 0x4c, 0xf0 }, + { 0xcb, 0x3b, 0xab, 0x6b }, { 0xc0, 0x35, 0xa2, 0x66 }, { 0xdd, 0x27, 0xb9, 0x71 }, { 0xd6, 0x29, 0xb0, 0x7c }, + { 0xe7, 0x03, 0x8f, 0x5f }, { 0xec, 0x0d, 0x86, 0x52 }, { 0xf1, 0x1f, 0x9d, 0x45 }, { 0xfa, 0x11, 0x94, 0x48 }, + { 0x93, 0x4b, 0xe3, 0x03 }, { 0x98, 0x45, 0xea, 0x0e }, { 0x85, 0x57, 0xf1, 0x19 }, { 0x8e, 0x59, 0xf8, 0x14 }, + { 0xbf, 0x73, 0xc7, 0x37 }, { 0xb4, 0x7d, 0xce, 0x3a }, { 0xa9, 0x6f, 0xd5, 0x2d }, { 0xa2, 0x61, 0xdc, 0x20 }, + { 0xf6, 0xad, 0x76, 0x6d }, { 0xfd, 0xa3, 0x7f, 0x60 }, { 0xe0, 0xb1, 0x64, 0x77 }, { 0xeb, 0xbf, 0x6d, 0x7a }, + { 0xda, 0x95, 0x52, 0x59 }, { 0xd1, 0x9b, 0x5b, 0x54 }, { 0xcc, 0x89, 0x40, 0x43 }, { 0xc7, 0x87, 0x49, 0x4e }, + { 0xae, 0xdd, 0x3e, 0x05 }, { 0xa5, 0xd3, 0x37, 0x08 }, { 0xb8, 0xc1, 0x2c, 0x1f }, { 0xb3, 0xcf, 0x25, 0x12 }, + { 0x82, 0xe5, 0x1a, 0x31 }, { 0x89, 0xeb, 0x13, 0x3c }, { 0x94, 0xf9, 0x08, 0x2b }, { 0x9f, 0xf7, 0x01, 0x26 }, + { 0x46, 0x4d, 0xe6, 0xbd }, { 0x4d, 0x43, 0xef, 0xb0 }, { 0x50, 0x51, 0xf4, 0xa7 }, { 0x5b, 0x5f, 0xfd, 0xaa }, + { 0x6a, 0x75, 0xc2, 0x89 }, { 0x61, 0x7b, 0xcb, 0x84 }, { 0x7c, 0x69, 0xd0, 0x93 }, { 0x77, 0x67, 0xd9, 0x9e }, + { 0x1e, 0x3d, 0xae, 0xd5 }, { 0x15, 0x33, 0xa7, 0xd8 }, { 0x08, 0x21, 0xbc, 0xcf }, { 0x03, 0x2f, 0xb5, 0xc2 }, + { 0x32, 0x05, 0x8a, 0xe1 }, { 0x39, 0x0b, 0x83, 0xec }, { 0x24, 0x19, 0x98, 0xfb }, { 0x2f, 0x17, 0x91, 0xf6 }, + { 0x8d, 0x76, 0x4d, 0xd6 }, { 0x86, 0x78, 0x44, 0xdb }, { 0x9b, 0x6a, 0x5f, 0xcc }, { 0x90, 0x64, 0x56, 0xc1 }, + { 0xa1, 0x4e, 0x69, 0xe2 }, { 0xaa, 0x40, 0x60, 0xef }, { 0xb7, 0x52, 0x7b, 0xf8 }, { 0xbc, 0x5c, 0x72, 0xf5 }, + { 0xd5, 0x06, 0x05, 0xbe }, { 0xde, 0x08, 0x0c, 0xb3 }, { 0xc3, 0x1a, 0x17, 0xa4 }, { 0xc8, 0x14, 0x1e, 0xa9 }, + { 0xf9, 0x3e, 0x21, 0x8a }, { 0xf2, 0x30, 0x28, 0x87 }, { 0xef, 0x22, 0x33, 0x90 }, { 0xe4, 0x2c, 0x3a, 0x9d }, + { 0x3d, 0x96, 0xdd, 0x06 }, { 0x36, 0x98, 0xd4, 0x0b }, { 0x2b, 0x8a, 0xcf, 0x1c }, { 0x20, 0x84, 0xc6, 0x11 }, + { 0x11, 0xae, 0xf9, 0x32 }, { 0x1a, 0xa0, 0xf0, 0x3f }, { 0x07, 0xb2, 0xeb, 0x28 }, { 0x0c, 0xbc, 0xe2, 0x25 }, + { 0x65, 0xe6, 0x95, 0x6e }, { 0x6e, 0xe8, 0x9c, 0x63 }, { 0x73, 0xfa, 0x87, 0x74 }, { 0x78, 0xf4, 0x8e, 0x79 }, + { 0x49, 0xde, 0xb1, 0x5a }, { 0x42, 0xd0, 0xb8, 0x57 }, { 0x5f, 0xc2, 0xa3, 0x40 }, { 0x54, 0xcc, 0xaa, 0x4d }, + { 0xf7, 0x41, 0xec, 0xda }, { 0xfc, 0x4f, 0xe5, 0xd7 }, { 0xe1, 0x5d, 0xfe, 0xc0 }, { 0xea, 0x53, 0xf7, 0xcd }, + { 0xdb, 0x79, 0xc8, 0xee }, { 0xd0, 0x77, 0xc1, 0xe3 }, { 0xcd, 0x65, 0xda, 0xf4 }, { 0xc6, 0x6b, 0xd3, 0xf9 }, + { 0xaf, 0x31, 0xa4, 0xb2 }, { 0xa4, 0x3f, 0xad, 0xbf }, { 0xb9, 0x2d, 0xb6, 0xa8 }, { 0xb2, 0x23, 0xbf, 0xa5 }, + { 0x83, 0x09, 0x80, 0x86 }, { 0x88, 0x07, 0x89, 0x8b }, { 0x95, 0x15, 0x92, 0x9c }, { 0x9e, 0x1b, 0x9b, 0x91 }, + { 0x47, 0xa1, 0x7c, 0x0a }, { 0x4c, 0xaf, 0x75, 0x07 }, { 0x51, 0xbd, 0x6e, 0x10 }, { 0x5a, 0xb3, 0x67, 0x1d }, + { 0x6b, 0x99, 0x58, 0x3e }, { 0x60, 0x97, 0x51, 0x33 }, { 0x7d, 0x85, 0x4a, 0x24 }, { 0x76, 0x8b, 0x43, 0x29 }, + { 0x1f, 0xd1, 0x34, 0x62 }, { 0x14, 0xdf, 0x3d, 0x6f }, { 0x09, 0xcd, 0x26, 0x78 }, { 0x02, 0xc3, 0x2f, 0x75 }, + { 0x33, 0xe9, 0x10, 0x56 }, { 0x38, 0xe7, 0x19, 0x5b }, { 0x25, 0xf5, 0x02, 0x4c }, { 0x2e, 0xfb, 0x0b, 0x41 }, + { 0x8c, 0x9a, 0xd7, 0x61 }, { 0x87, 0x94, 0xde, 0x6c }, { 0x9a, 0x86, 0xc5, 0x7b }, { 0x91, 0x88, 0xcc, 0x76 }, + { 0xa0, 0xa2, 0xf3, 0x55 }, { 0xab, 0xac, 0xfa, 0x58 }, { 0xb6, 0xbe, 0xe1, 0x4f }, { 0xbd, 0xb0, 0xe8, 0x42 }, + { 0xd4, 0xea, 0x9f, 0x09 }, { 0xdf, 0xe4, 0x96, 0x04 }, { 0xc2, 0xf6, 0x8d, 0x13 }, { 0xc9, 0xf8, 0x84, 0x1e }, + { 0xf8, 0xd2, 0xbb, 0x3d }, { 0xf3, 0xdc, 0xb2, 0x30 }, { 0xee, 0xce, 0xa9, 0x27 }, { 0xe5, 0xc0, 0xa0, 0x2a }, + { 0x3c, 0x7a, 0x47, 0xb1 }, { 0x37, 0x74, 0x4e, 0xbc }, { 0x2a, 0x66, 0x55, 0xab }, { 0x21, 0x68, 0x5c, 0xa6 }, + { 0x10, 0x42, 0x63, 0x85 }, { 0x1b, 0x4c, 0x6a, 0x88 }, { 0x06, 0x5e, 0x71, 0x9f }, { 0x0d, 0x50, 0x78, 0x92 }, + { 0x64, 0x0a, 0x0f, 0xd9 }, { 0x6f, 0x04, 0x06, 0xd4 }, { 0x72, 0x16, 0x1d, 0xc3 }, { 0x79, 0x18, 0x14, 0xce }, + { 0x48, 0x32, 0x2b, 0xed }, { 0x43, 0x3c, 0x22, 0xe0 }, { 0x5e, 0x2e, 0x39, 0xf7 }, { 0x55, 0x20, 0x30, 0xfa }, + { 0x01, 0xec, 0x9a, 0xb7 }, { 0x0a, 0xe2, 0x93, 0xba }, { 0x17, 0xf0, 0x88, 0xad }, { 0x1c, 0xfe, 0x81, 0xa0 }, + { 0x2d, 0xd4, 0xbe, 0x83 }, { 0x26, 0xda, 0xb7, 0x8e }, { 0x3b, 0xc8, 0xac, 0x99 }, { 0x30, 0xc6, 0xa5, 0x94 }, + { 0x59, 0x9c, 0xd2, 0xdf }, { 0x52, 0x92, 0xdb, 0xd2 }, { 0x4f, 0x80, 0xc0, 0xc5 }, { 0x44, 0x8e, 0xc9, 0xc8 }, + { 0x75, 0xa4, 0xf6, 0xeb }, { 0x7e, 0xaa, 0xff, 0xe6 }, { 0x63, 0xb8, 0xe4, 0xf1 }, { 0x68, 0xb6, 0xed, 0xfc }, + { 0xb1, 0x0c, 0x0a, 0x67 }, { 0xba, 0x02, 0x03, 0x6a }, { 0xa7, 0x10, 0x18, 0x7d }, { 0xac, 0x1e, 0x11, 0x70 }, + { 0x9d, 0x34, 0x2e, 0x53 }, { 0x96, 0x3a, 0x27, 0x5e }, { 0x8b, 0x28, 0x3c, 0x49 }, { 0x80, 0x26, 0x35, 0x44 }, + { 0xe9, 0x7c, 0x42, 0x0f }, { 0xe2, 0x72, 0x4b, 0x02 }, { 0xff, 0x60, 0x50, 0x15 }, { 0xf4, 0x6e, 0x59, 0x18 }, + { 0xc5, 0x44, 0x66, 0x3b }, { 0xce, 0x4a, 0x6f, 0x36 }, { 0xd3, 0x58, 0x74, 0x21 }, { 0xd8, 0x56, 0x7d, 0x2c }, + { 0x7a, 0x37, 0xa1, 0x0c }, { 0x71, 0x39, 0xa8, 0x01 }, { 0x6c, 0x2b, 0xb3, 0x16 }, { 0x67, 0x25, 0xba, 0x1b }, + { 0x56, 0x0f, 0x85, 0x38 }, { 0x5d, 0x01, 0x8c, 0x35 }, { 0x40, 0x13, 0x97, 0x22 }, { 0x4b, 0x1d, 0x9e, 0x2f }, + { 0x22, 0x47, 0xe9, 0x64 }, { 0x29, 0x49, 0xe0, 0x69 }, { 0x34, 0x5b, 0xfb, 0x7e }, { 0x3f, 0x55, 0xf2, 0x73 }, + { 0x0e, 0x7f, 0xcd, 0x50 }, { 0x05, 0x71, 0xc4, 0x5d }, { 0x18, 0x63, 0xdf, 0x4a }, { 0x13, 0x6d, 0xd6, 0x47 }, + { 0xca, 0xd7, 0x31, 0xdc }, { 0xc1, 0xd9, 0x38, 0xd1 }, { 0xdc, 0xcb, 0x23, 0xc6 }, { 0xd7, 0xc5, 0x2a, 0xcb }, + { 0xe6, 0xef, 0x15, 0xe8 }, { 0xed, 0xe1, 0x1c, 0xe5 }, { 0xf0, 0xf3, 0x07, 0xf2 }, { 0xfb, 0xfd, 0x0e, 0xff }, + { 0x92, 0xa7, 0x79, 0xb4 }, { 0x99, 0xa9, 0x70, 0xb9 }, { 0x84, 0xbb, 0x6b, 0xae }, { 0x8f, 0xb5, 0x62, 0xa3 }, + { 0xbe, 0x9f, 0x5d, 0x80 }, { 0xb5, 0x91, 0x54, 0x8d }, { 0xa8, 0x83, 0x4f, 0x9a }, { 0xa3, 0x8d, 0x46, 0x97 } }; -static UINT8 U3[256][4]= -{ - {0x00,0x00,0x00,0x00}, {0x0d,0x0b,0x0e,0x09}, {0x1a,0x16,0x1c,0x12}, {0x17,0x1d,0x12,0x1b}, - {0x34,0x2c,0x38,0x24}, {0x39,0x27,0x36,0x2d}, {0x2e,0x3a,0x24,0x36}, {0x23,0x31,0x2a,0x3f}, - {0x68,0x58,0x70,0x48}, {0x65,0x53,0x7e,0x41}, {0x72,0x4e,0x6c,0x5a}, {0x7f,0x45,0x62,0x53}, - {0x5c,0x74,0x48,0x6c}, {0x51,0x7f,0x46,0x65}, {0x46,0x62,0x54,0x7e}, {0x4b,0x69,0x5a,0x77}, - {0xd0,0xb0,0xe0,0x90}, {0xdd,0xbb,0xee,0x99}, {0xca,0xa6,0xfc,0x82}, {0xc7,0xad,0xf2,0x8b}, - {0xe4,0x9c,0xd8,0xb4}, {0xe9,0x97,0xd6,0xbd}, {0xfe,0x8a,0xc4,0xa6}, {0xf3,0x81,0xca,0xaf}, - {0xb8,0xe8,0x90,0xd8}, {0xb5,0xe3,0x9e,0xd1}, {0xa2,0xfe,0x8c,0xca}, {0xaf,0xf5,0x82,0xc3}, - {0x8c,0xc4,0xa8,0xfc}, {0x81,0xcf,0xa6,0xf5}, {0x96,0xd2,0xb4,0xee}, {0x9b,0xd9,0xba,0xe7}, - {0xbb,0x7b,0xdb,0x3b}, {0xb6,0x70,0xd5,0x32}, {0xa1,0x6d,0xc7,0x29}, {0xac,0x66,0xc9,0x20}, - {0x8f,0x57,0xe3,0x1f}, {0x82,0x5c,0xed,0x16}, {0x95,0x41,0xff,0x0d}, {0x98,0x4a,0xf1,0x04}, - {0xd3,0x23,0xab,0x73}, {0xde,0x28,0xa5,0x7a}, {0xc9,0x35,0xb7,0x61}, {0xc4,0x3e,0xb9,0x68}, - {0xe7,0x0f,0x93,0x57}, {0xea,0x04,0x9d,0x5e}, {0xfd,0x19,0x8f,0x45}, {0xf0,0x12,0x81,0x4c}, - {0x6b,0xcb,0x3b,0xab}, {0x66,0xc0,0x35,0xa2}, {0x71,0xdd,0x27,0xb9}, {0x7c,0xd6,0x29,0xb0}, - {0x5f,0xe7,0x03,0x8f}, {0x52,0xec,0x0d,0x86}, {0x45,0xf1,0x1f,0x9d}, {0x48,0xfa,0x11,0x94}, - {0x03,0x93,0x4b,0xe3}, {0x0e,0x98,0x45,0xea}, {0x19,0x85,0x57,0xf1}, {0x14,0x8e,0x59,0xf8}, - {0x37,0xbf,0x73,0xc7}, {0x3a,0xb4,0x7d,0xce}, {0x2d,0xa9,0x6f,0xd5}, {0x20,0xa2,0x61,0xdc}, - {0x6d,0xf6,0xad,0x76}, {0x60,0xfd,0xa3,0x7f}, {0x77,0xe0,0xb1,0x64}, {0x7a,0xeb,0xbf,0x6d}, - {0x59,0xda,0x95,0x52}, {0x54,0xd1,0x9b,0x5b}, {0x43,0xcc,0x89,0x40}, {0x4e,0xc7,0x87,0x49}, - {0x05,0xae,0xdd,0x3e}, {0x08,0xa5,0xd3,0x37}, {0x1f,0xb8,0xc1,0x2c}, {0x12,0xb3,0xcf,0x25}, - {0x31,0x82,0xe5,0x1a}, {0x3c,0x89,0xeb,0x13}, {0x2b,0x94,0xf9,0x08}, {0x26,0x9f,0xf7,0x01}, - {0xbd,0x46,0x4d,0xe6}, {0xb0,0x4d,0x43,0xef}, {0xa7,0x50,0x51,0xf4}, {0xaa,0x5b,0x5f,0xfd}, - {0x89,0x6a,0x75,0xc2}, {0x84,0x61,0x7b,0xcb}, {0x93,0x7c,0x69,0xd0}, {0x9e,0x77,0x67,0xd9}, - {0xd5,0x1e,0x3d,0xae}, {0xd8,0x15,0x33,0xa7}, {0xcf,0x08,0x21,0xbc}, {0xc2,0x03,0x2f,0xb5}, - {0xe1,0x32,0x05,0x8a}, {0xec,0x39,0x0b,0x83}, {0xfb,0x24,0x19,0x98}, {0xf6,0x2f,0x17,0x91}, - {0xd6,0x8d,0x76,0x4d}, {0xdb,0x86,0x78,0x44}, {0xcc,0x9b,0x6a,0x5f}, {0xc1,0x90,0x64,0x56}, - {0xe2,0xa1,0x4e,0x69}, {0xef,0xaa,0x40,0x60}, {0xf8,0xb7,0x52,0x7b}, {0xf5,0xbc,0x5c,0x72}, - {0xbe,0xd5,0x06,0x05}, {0xb3,0xde,0x08,0x0c}, {0xa4,0xc3,0x1a,0x17}, {0xa9,0xc8,0x14,0x1e}, - {0x8a,0xf9,0x3e,0x21}, {0x87,0xf2,0x30,0x28}, {0x90,0xef,0x22,0x33}, {0x9d,0xe4,0x2c,0x3a}, - {0x06,0x3d,0x96,0xdd}, {0x0b,0x36,0x98,0xd4}, {0x1c,0x2b,0x8a,0xcf}, {0x11,0x20,0x84,0xc6}, - {0x32,0x11,0xae,0xf9}, {0x3f,0x1a,0xa0,0xf0}, {0x28,0x07,0xb2,0xeb}, {0x25,0x0c,0xbc,0xe2}, - {0x6e,0x65,0xe6,0x95}, {0x63,0x6e,0xe8,0x9c}, {0x74,0x73,0xfa,0x87}, {0x79,0x78,0xf4,0x8e}, - {0x5a,0x49,0xde,0xb1}, {0x57,0x42,0xd0,0xb8}, {0x40,0x5f,0xc2,0xa3}, {0x4d,0x54,0xcc,0xaa}, - {0xda,0xf7,0x41,0xec}, {0xd7,0xfc,0x4f,0xe5}, {0xc0,0xe1,0x5d,0xfe}, {0xcd,0xea,0x53,0xf7}, - {0xee,0xdb,0x79,0xc8}, {0xe3,0xd0,0x77,0xc1}, {0xf4,0xcd,0x65,0xda}, {0xf9,0xc6,0x6b,0xd3}, - {0xb2,0xaf,0x31,0xa4}, {0xbf,0xa4,0x3f,0xad}, {0xa8,0xb9,0x2d,0xb6}, {0xa5,0xb2,0x23,0xbf}, - {0x86,0x83,0x09,0x80}, {0x8b,0x88,0x07,0x89}, {0x9c,0x95,0x15,0x92}, {0x91,0x9e,0x1b,0x9b}, - {0x0a,0x47,0xa1,0x7c}, {0x07,0x4c,0xaf,0x75}, {0x10,0x51,0xbd,0x6e}, {0x1d,0x5a,0xb3,0x67}, - {0x3e,0x6b,0x99,0x58}, {0x33,0x60,0x97,0x51}, {0x24,0x7d,0x85,0x4a}, {0x29,0x76,0x8b,0x43}, - {0x62,0x1f,0xd1,0x34}, {0x6f,0x14,0xdf,0x3d}, {0x78,0x09,0xcd,0x26}, {0x75,0x02,0xc3,0x2f}, - {0x56,0x33,0xe9,0x10}, {0x5b,0x38,0xe7,0x19}, {0x4c,0x25,0xf5,0x02}, {0x41,0x2e,0xfb,0x0b}, - {0x61,0x8c,0x9a,0xd7}, {0x6c,0x87,0x94,0xde}, {0x7b,0x9a,0x86,0xc5}, {0x76,0x91,0x88,0xcc}, - {0x55,0xa0,0xa2,0xf3}, {0x58,0xab,0xac,0xfa}, {0x4f,0xb6,0xbe,0xe1}, {0x42,0xbd,0xb0,0xe8}, - {0x09,0xd4,0xea,0x9f}, {0x04,0xdf,0xe4,0x96}, {0x13,0xc2,0xf6,0x8d}, {0x1e,0xc9,0xf8,0x84}, - {0x3d,0xf8,0xd2,0xbb}, {0x30,0xf3,0xdc,0xb2}, {0x27,0xee,0xce,0xa9}, {0x2a,0xe5,0xc0,0xa0}, - {0xb1,0x3c,0x7a,0x47}, {0xbc,0x37,0x74,0x4e}, {0xab,0x2a,0x66,0x55}, {0xa6,0x21,0x68,0x5c}, - {0x85,0x10,0x42,0x63}, {0x88,0x1b,0x4c,0x6a}, {0x9f,0x06,0x5e,0x71}, {0x92,0x0d,0x50,0x78}, - {0xd9,0x64,0x0a,0x0f}, {0xd4,0x6f,0x04,0x06}, {0xc3,0x72,0x16,0x1d}, {0xce,0x79,0x18,0x14}, - {0xed,0x48,0x32,0x2b}, {0xe0,0x43,0x3c,0x22}, {0xf7,0x5e,0x2e,0x39}, {0xfa,0x55,0x20,0x30}, - {0xb7,0x01,0xec,0x9a}, {0xba,0x0a,0xe2,0x93}, {0xad,0x17,0xf0,0x88}, {0xa0,0x1c,0xfe,0x81}, - {0x83,0x2d,0xd4,0xbe}, {0x8e,0x26,0xda,0xb7}, {0x99,0x3b,0xc8,0xac}, {0x94,0x30,0xc6,0xa5}, - {0xdf,0x59,0x9c,0xd2}, {0xd2,0x52,0x92,0xdb}, {0xc5,0x4f,0x80,0xc0}, {0xc8,0x44,0x8e,0xc9}, - {0xeb,0x75,0xa4,0xf6}, {0xe6,0x7e,0xaa,0xff}, {0xf1,0x63,0xb8,0xe4}, {0xfc,0x68,0xb6,0xed}, - {0x67,0xb1,0x0c,0x0a}, {0x6a,0xba,0x02,0x03}, {0x7d,0xa7,0x10,0x18}, {0x70,0xac,0x1e,0x11}, - {0x53,0x9d,0x34,0x2e}, {0x5e,0x96,0x3a,0x27}, {0x49,0x8b,0x28,0x3c}, {0x44,0x80,0x26,0x35}, - {0x0f,0xe9,0x7c,0x42}, {0x02,0xe2,0x72,0x4b}, {0x15,0xff,0x60,0x50}, {0x18,0xf4,0x6e,0x59}, - {0x3b,0xc5,0x44,0x66}, {0x36,0xce,0x4a,0x6f}, {0x21,0xd3,0x58,0x74}, {0x2c,0xd8,0x56,0x7d}, - {0x0c,0x7a,0x37,0xa1}, {0x01,0x71,0x39,0xa8}, {0x16,0x6c,0x2b,0xb3}, {0x1b,0x67,0x25,0xba}, - {0x38,0x56,0x0f,0x85}, {0x35,0x5d,0x01,0x8c}, {0x22,0x40,0x13,0x97}, {0x2f,0x4b,0x1d,0x9e}, - {0x64,0x22,0x47,0xe9}, {0x69,0x29,0x49,0xe0}, {0x7e,0x34,0x5b,0xfb}, {0x73,0x3f,0x55,0xf2}, - {0x50,0x0e,0x7f,0xcd}, {0x5d,0x05,0x71,0xc4}, {0x4a,0x18,0x63,0xdf}, {0x47,0x13,0x6d,0xd6}, - {0xdc,0xca,0xd7,0x31}, {0xd1,0xc1,0xd9,0x38}, {0xc6,0xdc,0xcb,0x23}, {0xcb,0xd7,0xc5,0x2a}, - {0xe8,0xe6,0xef,0x15}, {0xe5,0xed,0xe1,0x1c}, {0xf2,0xf0,0xf3,0x07}, {0xff,0xfb,0xfd,0x0e}, - {0xb4,0x92,0xa7,0x79}, {0xb9,0x99,0xa9,0x70}, {0xae,0x84,0xbb,0x6b}, {0xa3,0x8f,0xb5,0x62}, - {0x80,0xbe,0x9f,0x5d}, {0x8d,0xb5,0x91,0x54}, {0x9a,0xa8,0x83,0x4f}, {0x97,0xa3,0x8d,0x46} +static UINT8 U3[256][4] = { + { 0x00, 0x00, 0x00, 0x00 }, { 0x0d, 0x0b, 0x0e, 0x09 }, { 0x1a, 0x16, 0x1c, 0x12 }, { 0x17, 0x1d, 0x12, 0x1b }, + { 0x34, 0x2c, 0x38, 0x24 }, { 0x39, 0x27, 0x36, 0x2d }, { 0x2e, 0x3a, 0x24, 0x36 }, { 0x23, 0x31, 0x2a, 0x3f }, + { 0x68, 0x58, 0x70, 0x48 }, { 0x65, 0x53, 0x7e, 0x41 }, { 0x72, 0x4e, 0x6c, 0x5a }, { 0x7f, 0x45, 0x62, 0x53 }, + { 0x5c, 0x74, 0x48, 0x6c }, { 0x51, 0x7f, 0x46, 0x65 }, { 0x46, 0x62, 0x54, 0x7e }, { 0x4b, 0x69, 0x5a, 0x77 }, + { 0xd0, 0xb0, 0xe0, 0x90 }, { 0xdd, 0xbb, 0xee, 0x99 }, { 0xca, 0xa6, 0xfc, 0x82 }, { 0xc7, 0xad, 0xf2, 0x8b }, + { 0xe4, 0x9c, 0xd8, 0xb4 }, { 0xe9, 0x97, 0xd6, 0xbd }, { 0xfe, 0x8a, 0xc4, 0xa6 }, { 0xf3, 0x81, 0xca, 0xaf }, + { 0xb8, 0xe8, 0x90, 0xd8 }, { 0xb5, 0xe3, 0x9e, 0xd1 }, { 0xa2, 0xfe, 0x8c, 0xca }, { 0xaf, 0xf5, 0x82, 0xc3 }, + { 0x8c, 0xc4, 0xa8, 0xfc }, { 0x81, 0xcf, 0xa6, 0xf5 }, { 0x96, 0xd2, 0xb4, 0xee }, { 0x9b, 0xd9, 0xba, 0xe7 }, + { 0xbb, 0x7b, 0xdb, 0x3b }, { 0xb6, 0x70, 0xd5, 0x32 }, { 0xa1, 0x6d, 0xc7, 0x29 }, { 0xac, 0x66, 0xc9, 0x20 }, + { 0x8f, 0x57, 0xe3, 0x1f }, { 0x82, 0x5c, 0xed, 0x16 }, { 0x95, 0x41, 0xff, 0x0d }, { 0x98, 0x4a, 0xf1, 0x04 }, + { 0xd3, 0x23, 0xab, 0x73 }, { 0xde, 0x28, 0xa5, 0x7a }, { 0xc9, 0x35, 0xb7, 0x61 }, { 0xc4, 0x3e, 0xb9, 0x68 }, + { 0xe7, 0x0f, 0x93, 0x57 }, { 0xea, 0x04, 0x9d, 0x5e }, { 0xfd, 0x19, 0x8f, 0x45 }, { 0xf0, 0x12, 0x81, 0x4c }, + { 0x6b, 0xcb, 0x3b, 0xab }, { 0x66, 0xc0, 0x35, 0xa2 }, { 0x71, 0xdd, 0x27, 0xb9 }, { 0x7c, 0xd6, 0x29, 0xb0 }, + { 0x5f, 0xe7, 0x03, 0x8f }, { 0x52, 0xec, 0x0d, 0x86 }, { 0x45, 0xf1, 0x1f, 0x9d }, { 0x48, 0xfa, 0x11, 0x94 }, + { 0x03, 0x93, 0x4b, 0xe3 }, { 0x0e, 0x98, 0x45, 0xea }, { 0x19, 0x85, 0x57, 0xf1 }, { 0x14, 0x8e, 0x59, 0xf8 }, + { 0x37, 0xbf, 0x73, 0xc7 }, { 0x3a, 0xb4, 0x7d, 0xce }, { 0x2d, 0xa9, 0x6f, 0xd5 }, { 0x20, 0xa2, 0x61, 0xdc }, + { 0x6d, 0xf6, 0xad, 0x76 }, { 0x60, 0xfd, 0xa3, 0x7f }, { 0x77, 0xe0, 0xb1, 0x64 }, { 0x7a, 0xeb, 0xbf, 0x6d }, + { 0x59, 0xda, 0x95, 0x52 }, { 0x54, 0xd1, 0x9b, 0x5b }, { 0x43, 0xcc, 0x89, 0x40 }, { 0x4e, 0xc7, 0x87, 0x49 }, + { 0x05, 0xae, 0xdd, 0x3e }, { 0x08, 0xa5, 0xd3, 0x37 }, { 0x1f, 0xb8, 0xc1, 0x2c }, { 0x12, 0xb3, 0xcf, 0x25 }, + { 0x31, 0x82, 0xe5, 0x1a }, { 0x3c, 0x89, 0xeb, 0x13 }, { 0x2b, 0x94, 0xf9, 0x08 }, { 0x26, 0x9f, 0xf7, 0x01 }, + { 0xbd, 0x46, 0x4d, 0xe6 }, { 0xb0, 0x4d, 0x43, 0xef }, { 0xa7, 0x50, 0x51, 0xf4 }, { 0xaa, 0x5b, 0x5f, 0xfd }, + { 0x89, 0x6a, 0x75, 0xc2 }, { 0x84, 0x61, 0x7b, 0xcb }, { 0x93, 0x7c, 0x69, 0xd0 }, { 0x9e, 0x77, 0x67, 0xd9 }, + { 0xd5, 0x1e, 0x3d, 0xae }, { 0xd8, 0x15, 0x33, 0xa7 }, { 0xcf, 0x08, 0x21, 0xbc }, { 0xc2, 0x03, 0x2f, 0xb5 }, + { 0xe1, 0x32, 0x05, 0x8a }, { 0xec, 0x39, 0x0b, 0x83 }, { 0xfb, 0x24, 0x19, 0x98 }, { 0xf6, 0x2f, 0x17, 0x91 }, + { 0xd6, 0x8d, 0x76, 0x4d }, { 0xdb, 0x86, 0x78, 0x44 }, { 0xcc, 0x9b, 0x6a, 0x5f }, { 0xc1, 0x90, 0x64, 0x56 }, + { 0xe2, 0xa1, 0x4e, 0x69 }, { 0xef, 0xaa, 0x40, 0x60 }, { 0xf8, 0xb7, 0x52, 0x7b }, { 0xf5, 0xbc, 0x5c, 0x72 }, + { 0xbe, 0xd5, 0x06, 0x05 }, { 0xb3, 0xde, 0x08, 0x0c }, { 0xa4, 0xc3, 0x1a, 0x17 }, { 0xa9, 0xc8, 0x14, 0x1e }, + { 0x8a, 0xf9, 0x3e, 0x21 }, { 0x87, 0xf2, 0x30, 0x28 }, { 0x90, 0xef, 0x22, 0x33 }, { 0x9d, 0xe4, 0x2c, 0x3a }, + { 0x06, 0x3d, 0x96, 0xdd }, { 0x0b, 0x36, 0x98, 0xd4 }, { 0x1c, 0x2b, 0x8a, 0xcf }, { 0x11, 0x20, 0x84, 0xc6 }, + { 0x32, 0x11, 0xae, 0xf9 }, { 0x3f, 0x1a, 0xa0, 0xf0 }, { 0x28, 0x07, 0xb2, 0xeb }, { 0x25, 0x0c, 0xbc, 0xe2 }, + { 0x6e, 0x65, 0xe6, 0x95 }, { 0x63, 0x6e, 0xe8, 0x9c }, { 0x74, 0x73, 0xfa, 0x87 }, { 0x79, 0x78, 0xf4, 0x8e }, + { 0x5a, 0x49, 0xde, 0xb1 }, { 0x57, 0x42, 0xd0, 0xb8 }, { 0x40, 0x5f, 0xc2, 0xa3 }, { 0x4d, 0x54, 0xcc, 0xaa }, + { 0xda, 0xf7, 0x41, 0xec }, { 0xd7, 0xfc, 0x4f, 0xe5 }, { 0xc0, 0xe1, 0x5d, 0xfe }, { 0xcd, 0xea, 0x53, 0xf7 }, + { 0xee, 0xdb, 0x79, 0xc8 }, { 0xe3, 0xd0, 0x77, 0xc1 }, { 0xf4, 0xcd, 0x65, 0xda }, { 0xf9, 0xc6, 0x6b, 0xd3 }, + { 0xb2, 0xaf, 0x31, 0xa4 }, { 0xbf, 0xa4, 0x3f, 0xad }, { 0xa8, 0xb9, 0x2d, 0xb6 }, { 0xa5, 0xb2, 0x23, 0xbf }, + { 0x86, 0x83, 0x09, 0x80 }, { 0x8b, 0x88, 0x07, 0x89 }, { 0x9c, 0x95, 0x15, 0x92 }, { 0x91, 0x9e, 0x1b, 0x9b }, + { 0x0a, 0x47, 0xa1, 0x7c }, { 0x07, 0x4c, 0xaf, 0x75 }, { 0x10, 0x51, 0xbd, 0x6e }, { 0x1d, 0x5a, 0xb3, 0x67 }, + { 0x3e, 0x6b, 0x99, 0x58 }, { 0x33, 0x60, 0x97, 0x51 }, { 0x24, 0x7d, 0x85, 0x4a }, { 0x29, 0x76, 0x8b, 0x43 }, + { 0x62, 0x1f, 0xd1, 0x34 }, { 0x6f, 0x14, 0xdf, 0x3d }, { 0x78, 0x09, 0xcd, 0x26 }, { 0x75, 0x02, 0xc3, 0x2f }, + { 0x56, 0x33, 0xe9, 0x10 }, { 0x5b, 0x38, 0xe7, 0x19 }, { 0x4c, 0x25, 0xf5, 0x02 }, { 0x41, 0x2e, 0xfb, 0x0b }, + { 0x61, 0x8c, 0x9a, 0xd7 }, { 0x6c, 0x87, 0x94, 0xde }, { 0x7b, 0x9a, 0x86, 0xc5 }, { 0x76, 0x91, 0x88, 0xcc }, + { 0x55, 0xa0, 0xa2, 0xf3 }, { 0x58, 0xab, 0xac, 0xfa }, { 0x4f, 0xb6, 0xbe, 0xe1 }, { 0x42, 0xbd, 0xb0, 0xe8 }, + { 0x09, 0xd4, 0xea, 0x9f }, { 0x04, 0xdf, 0xe4, 0x96 }, { 0x13, 0xc2, 0xf6, 0x8d }, { 0x1e, 0xc9, 0xf8, 0x84 }, + { 0x3d, 0xf8, 0xd2, 0xbb }, { 0x30, 0xf3, 0xdc, 0xb2 }, { 0x27, 0xee, 0xce, 0xa9 }, { 0x2a, 0xe5, 0xc0, 0xa0 }, + { 0xb1, 0x3c, 0x7a, 0x47 }, { 0xbc, 0x37, 0x74, 0x4e }, { 0xab, 0x2a, 0x66, 0x55 }, { 0xa6, 0x21, 0x68, 0x5c }, + { 0x85, 0x10, 0x42, 0x63 }, { 0x88, 0x1b, 0x4c, 0x6a }, { 0x9f, 0x06, 0x5e, 0x71 }, { 0x92, 0x0d, 0x50, 0x78 }, + { 0xd9, 0x64, 0x0a, 0x0f }, { 0xd4, 0x6f, 0x04, 0x06 }, { 0xc3, 0x72, 0x16, 0x1d }, { 0xce, 0x79, 0x18, 0x14 }, + { 0xed, 0x48, 0x32, 0x2b }, { 0xe0, 0x43, 0x3c, 0x22 }, { 0xf7, 0x5e, 0x2e, 0x39 }, { 0xfa, 0x55, 0x20, 0x30 }, + { 0xb7, 0x01, 0xec, 0x9a }, { 0xba, 0x0a, 0xe2, 0x93 }, { 0xad, 0x17, 0xf0, 0x88 }, { 0xa0, 0x1c, 0xfe, 0x81 }, + { 0x83, 0x2d, 0xd4, 0xbe }, { 0x8e, 0x26, 0xda, 0xb7 }, { 0x99, 0x3b, 0xc8, 0xac }, { 0x94, 0x30, 0xc6, 0xa5 }, + { 0xdf, 0x59, 0x9c, 0xd2 }, { 0xd2, 0x52, 0x92, 0xdb }, { 0xc5, 0x4f, 0x80, 0xc0 }, { 0xc8, 0x44, 0x8e, 0xc9 }, + { 0xeb, 0x75, 0xa4, 0xf6 }, { 0xe6, 0x7e, 0xaa, 0xff }, { 0xf1, 0x63, 0xb8, 0xe4 }, { 0xfc, 0x68, 0xb6, 0xed }, + { 0x67, 0xb1, 0x0c, 0x0a }, { 0x6a, 0xba, 0x02, 0x03 }, { 0x7d, 0xa7, 0x10, 0x18 }, { 0x70, 0xac, 0x1e, 0x11 }, + { 0x53, 0x9d, 0x34, 0x2e }, { 0x5e, 0x96, 0x3a, 0x27 }, { 0x49, 0x8b, 0x28, 0x3c }, { 0x44, 0x80, 0x26, 0x35 }, + { 0x0f, 0xe9, 0x7c, 0x42 }, { 0x02, 0xe2, 0x72, 0x4b }, { 0x15, 0xff, 0x60, 0x50 }, { 0x18, 0xf4, 0x6e, 0x59 }, + { 0x3b, 0xc5, 0x44, 0x66 }, { 0x36, 0xce, 0x4a, 0x6f }, { 0x21, 0xd3, 0x58, 0x74 }, { 0x2c, 0xd8, 0x56, 0x7d }, + { 0x0c, 0x7a, 0x37, 0xa1 }, { 0x01, 0x71, 0x39, 0xa8 }, { 0x16, 0x6c, 0x2b, 0xb3 }, { 0x1b, 0x67, 0x25, 0xba }, + { 0x38, 0x56, 0x0f, 0x85 }, { 0x35, 0x5d, 0x01, 0x8c }, { 0x22, 0x40, 0x13, 0x97 }, { 0x2f, 0x4b, 0x1d, 0x9e }, + { 0x64, 0x22, 0x47, 0xe9 }, { 0x69, 0x29, 0x49, 0xe0 }, { 0x7e, 0x34, 0x5b, 0xfb }, { 0x73, 0x3f, 0x55, 0xf2 }, + { 0x50, 0x0e, 0x7f, 0xcd }, { 0x5d, 0x05, 0x71, 0xc4 }, { 0x4a, 0x18, 0x63, 0xdf }, { 0x47, 0x13, 0x6d, 0xd6 }, + { 0xdc, 0xca, 0xd7, 0x31 }, { 0xd1, 0xc1, 0xd9, 0x38 }, { 0xc6, 0xdc, 0xcb, 0x23 }, { 0xcb, 0xd7, 0xc5, 0x2a }, + { 0xe8, 0xe6, 0xef, 0x15 }, { 0xe5, 0xed, 0xe1, 0x1c }, { 0xf2, 0xf0, 0xf3, 0x07 }, { 0xff, 0xfb, 0xfd, 0x0e }, + { 0xb4, 0x92, 0xa7, 0x79 }, { 0xb9, 0x99, 0xa9, 0x70 }, { 0xae, 0x84, 0xbb, 0x6b }, { 0xa3, 0x8f, 0xb5, 0x62 }, + { 0x80, 0xbe, 0x9f, 0x5d }, { 0x8d, 0xb5, 0x91, 0x54 }, { 0x9a, 0xa8, 0x83, 0x4f }, { 0x97, 0xa3, 0x8d, 0x46 } }; -static UINT8 U4[256][4]= -{ - {0x00,0x00,0x00,0x00}, {0x09,0x0d,0x0b,0x0e}, {0x12,0x1a,0x16,0x1c}, {0x1b,0x17,0x1d,0x12}, - {0x24,0x34,0x2c,0x38}, {0x2d,0x39,0x27,0x36}, {0x36,0x2e,0x3a,0x24}, {0x3f,0x23,0x31,0x2a}, - {0x48,0x68,0x58,0x70}, {0x41,0x65,0x53,0x7e}, {0x5a,0x72,0x4e,0x6c}, {0x53,0x7f,0x45,0x62}, - {0x6c,0x5c,0x74,0x48}, {0x65,0x51,0x7f,0x46}, {0x7e,0x46,0x62,0x54}, {0x77,0x4b,0x69,0x5a}, - {0x90,0xd0,0xb0,0xe0}, {0x99,0xdd,0xbb,0xee}, {0x82,0xca,0xa6,0xfc}, {0x8b,0xc7,0xad,0xf2}, - {0xb4,0xe4,0x9c,0xd8}, {0xbd,0xe9,0x97,0xd6}, {0xa6,0xfe,0x8a,0xc4}, {0xaf,0xf3,0x81,0xca}, - {0xd8,0xb8,0xe8,0x90}, {0xd1,0xb5,0xe3,0x9e}, {0xca,0xa2,0xfe,0x8c}, {0xc3,0xaf,0xf5,0x82}, - {0xfc,0x8c,0xc4,0xa8}, {0xf5,0x81,0xcf,0xa6}, {0xee,0x96,0xd2,0xb4}, {0xe7,0x9b,0xd9,0xba}, - {0x3b,0xbb,0x7b,0xdb}, {0x32,0xb6,0x70,0xd5}, {0x29,0xa1,0x6d,0xc7}, {0x20,0xac,0x66,0xc9}, - {0x1f,0x8f,0x57,0xe3}, {0x16,0x82,0x5c,0xed}, {0x0d,0x95,0x41,0xff}, {0x04,0x98,0x4a,0xf1}, - {0x73,0xd3,0x23,0xab}, {0x7a,0xde,0x28,0xa5}, {0x61,0xc9,0x35,0xb7}, {0x68,0xc4,0x3e,0xb9}, - {0x57,0xe7,0x0f,0x93}, {0x5e,0xea,0x04,0x9d}, {0x45,0xfd,0x19,0x8f}, {0x4c,0xf0,0x12,0x81}, - {0xab,0x6b,0xcb,0x3b}, {0xa2,0x66,0xc0,0x35}, {0xb9,0x71,0xdd,0x27}, {0xb0,0x7c,0xd6,0x29}, - {0x8f,0x5f,0xe7,0x03}, {0x86,0x52,0xec,0x0d}, {0x9d,0x45,0xf1,0x1f}, {0x94,0x48,0xfa,0x11}, - {0xe3,0x03,0x93,0x4b}, {0xea,0x0e,0x98,0x45}, {0xf1,0x19,0x85,0x57}, {0xf8,0x14,0x8e,0x59}, - {0xc7,0x37,0xbf,0x73}, {0xce,0x3a,0xb4,0x7d}, {0xd5,0x2d,0xa9,0x6f}, {0xdc,0x20,0xa2,0x61}, - {0x76,0x6d,0xf6,0xad}, {0x7f,0x60,0xfd,0xa3}, {0x64,0x77,0xe0,0xb1}, {0x6d,0x7a,0xeb,0xbf}, - {0x52,0x59,0xda,0x95}, {0x5b,0x54,0xd1,0x9b}, {0x40,0x43,0xcc,0x89}, {0x49,0x4e,0xc7,0x87}, - {0x3e,0x05,0xae,0xdd}, {0x37,0x08,0xa5,0xd3}, {0x2c,0x1f,0xb8,0xc1}, {0x25,0x12,0xb3,0xcf}, - {0x1a,0x31,0x82,0xe5}, {0x13,0x3c,0x89,0xeb}, {0x08,0x2b,0x94,0xf9}, {0x01,0x26,0x9f,0xf7}, - {0xe6,0xbd,0x46,0x4d}, {0xef,0xb0,0x4d,0x43}, {0xf4,0xa7,0x50,0x51}, {0xfd,0xaa,0x5b,0x5f}, - {0xc2,0x89,0x6a,0x75}, {0xcb,0x84,0x61,0x7b}, {0xd0,0x93,0x7c,0x69}, {0xd9,0x9e,0x77,0x67}, - {0xae,0xd5,0x1e,0x3d}, {0xa7,0xd8,0x15,0x33}, {0xbc,0xcf,0x08,0x21}, {0xb5,0xc2,0x03,0x2f}, - {0x8a,0xe1,0x32,0x05}, {0x83,0xec,0x39,0x0b}, {0x98,0xfb,0x24,0x19}, {0x91,0xf6,0x2f,0x17}, - {0x4d,0xd6,0x8d,0x76}, {0x44,0xdb,0x86,0x78}, {0x5f,0xcc,0x9b,0x6a}, {0x56,0xc1,0x90,0x64}, - {0x69,0xe2,0xa1,0x4e}, {0x60,0xef,0xaa,0x40}, {0x7b,0xf8,0xb7,0x52}, {0x72,0xf5,0xbc,0x5c}, - {0x05,0xbe,0xd5,0x06}, {0x0c,0xb3,0xde,0x08}, {0x17,0xa4,0xc3,0x1a}, {0x1e,0xa9,0xc8,0x14}, - {0x21,0x8a,0xf9,0x3e}, {0x28,0x87,0xf2,0x30}, {0x33,0x90,0xef,0x22}, {0x3a,0x9d,0xe4,0x2c}, - {0xdd,0x06,0x3d,0x96}, {0xd4,0x0b,0x36,0x98}, {0xcf,0x1c,0x2b,0x8a}, {0xc6,0x11,0x20,0x84}, - {0xf9,0x32,0x11,0xae}, {0xf0,0x3f,0x1a,0xa0}, {0xeb,0x28,0x07,0xb2}, {0xe2,0x25,0x0c,0xbc}, - {0x95,0x6e,0x65,0xe6}, {0x9c,0x63,0x6e,0xe8}, {0x87,0x74,0x73,0xfa}, {0x8e,0x79,0x78,0xf4}, - {0xb1,0x5a,0x49,0xde}, {0xb8,0x57,0x42,0xd0}, {0xa3,0x40,0x5f,0xc2}, {0xaa,0x4d,0x54,0xcc}, - {0xec,0xda,0xf7,0x41}, {0xe5,0xd7,0xfc,0x4f}, {0xfe,0xc0,0xe1,0x5d}, {0xf7,0xcd,0xea,0x53}, - {0xc8,0xee,0xdb,0x79}, {0xc1,0xe3,0xd0,0x77}, {0xda,0xf4,0xcd,0x65}, {0xd3,0xf9,0xc6,0x6b}, - {0xa4,0xb2,0xaf,0x31}, {0xad,0xbf,0xa4,0x3f}, {0xb6,0xa8,0xb9,0x2d}, {0xbf,0xa5,0xb2,0x23}, - {0x80,0x86,0x83,0x09}, {0x89,0x8b,0x88,0x07}, {0x92,0x9c,0x95,0x15}, {0x9b,0x91,0x9e,0x1b}, - {0x7c,0x0a,0x47,0xa1}, {0x75,0x07,0x4c,0xaf}, {0x6e,0x10,0x51,0xbd}, {0x67,0x1d,0x5a,0xb3}, - {0x58,0x3e,0x6b,0x99}, {0x51,0x33,0x60,0x97}, {0x4a,0x24,0x7d,0x85}, {0x43,0x29,0x76,0x8b}, - {0x34,0x62,0x1f,0xd1}, {0x3d,0x6f,0x14,0xdf}, {0x26,0x78,0x09,0xcd}, {0x2f,0x75,0x02,0xc3}, - {0x10,0x56,0x33,0xe9}, {0x19,0x5b,0x38,0xe7}, {0x02,0x4c,0x25,0xf5}, {0x0b,0x41,0x2e,0xfb}, - {0xd7,0x61,0x8c,0x9a}, {0xde,0x6c,0x87,0x94}, {0xc5,0x7b,0x9a,0x86}, {0xcc,0x76,0x91,0x88}, - {0xf3,0x55,0xa0,0xa2}, {0xfa,0x58,0xab,0xac}, {0xe1,0x4f,0xb6,0xbe}, {0xe8,0x42,0xbd,0xb0}, - {0x9f,0x09,0xd4,0xea}, {0x96,0x04,0xdf,0xe4}, {0x8d,0x13,0xc2,0xf6}, {0x84,0x1e,0xc9,0xf8}, - {0xbb,0x3d,0xf8,0xd2}, {0xb2,0x30,0xf3,0xdc}, {0xa9,0x27,0xee,0xce}, {0xa0,0x2a,0xe5,0xc0}, - {0x47,0xb1,0x3c,0x7a}, {0x4e,0xbc,0x37,0x74}, {0x55,0xab,0x2a,0x66}, {0x5c,0xa6,0x21,0x68}, - {0x63,0x85,0x10,0x42}, {0x6a,0x88,0x1b,0x4c}, {0x71,0x9f,0x06,0x5e}, {0x78,0x92,0x0d,0x50}, - {0x0f,0xd9,0x64,0x0a}, {0x06,0xd4,0x6f,0x04}, {0x1d,0xc3,0x72,0x16}, {0x14,0xce,0x79,0x18}, - {0x2b,0xed,0x48,0x32}, {0x22,0xe0,0x43,0x3c}, {0x39,0xf7,0x5e,0x2e}, {0x30,0xfa,0x55,0x20}, - {0x9a,0xb7,0x01,0xec}, {0x93,0xba,0x0a,0xe2}, {0x88,0xad,0x17,0xf0}, {0x81,0xa0,0x1c,0xfe}, - {0xbe,0x83,0x2d,0xd4}, {0xb7,0x8e,0x26,0xda}, {0xac,0x99,0x3b,0xc8}, {0xa5,0x94,0x30,0xc6}, - {0xd2,0xdf,0x59,0x9c}, {0xdb,0xd2,0x52,0x92}, {0xc0,0xc5,0x4f,0x80}, {0xc9,0xc8,0x44,0x8e}, - {0xf6,0xeb,0x75,0xa4}, {0xff,0xe6,0x7e,0xaa}, {0xe4,0xf1,0x63,0xb8}, {0xed,0xfc,0x68,0xb6}, - {0x0a,0x67,0xb1,0x0c}, {0x03,0x6a,0xba,0x02}, {0x18,0x7d,0xa7,0x10}, {0x11,0x70,0xac,0x1e}, - {0x2e,0x53,0x9d,0x34}, {0x27,0x5e,0x96,0x3a}, {0x3c,0x49,0x8b,0x28}, {0x35,0x44,0x80,0x26}, - {0x42,0x0f,0xe9,0x7c}, {0x4b,0x02,0xe2,0x72}, {0x50,0x15,0xff,0x60}, {0x59,0x18,0xf4,0x6e}, - {0x66,0x3b,0xc5,0x44}, {0x6f,0x36,0xce,0x4a}, {0x74,0x21,0xd3,0x58}, {0x7d,0x2c,0xd8,0x56}, - {0xa1,0x0c,0x7a,0x37}, {0xa8,0x01,0x71,0x39}, {0xb3,0x16,0x6c,0x2b}, {0xba,0x1b,0x67,0x25}, - {0x85,0x38,0x56,0x0f}, {0x8c,0x35,0x5d,0x01}, {0x97,0x22,0x40,0x13}, {0x9e,0x2f,0x4b,0x1d}, - {0xe9,0x64,0x22,0x47}, {0xe0,0x69,0x29,0x49}, {0xfb,0x7e,0x34,0x5b}, {0xf2,0x73,0x3f,0x55}, - {0xcd,0x50,0x0e,0x7f}, {0xc4,0x5d,0x05,0x71}, {0xdf,0x4a,0x18,0x63}, {0xd6,0x47,0x13,0x6d}, - {0x31,0xdc,0xca,0xd7}, {0x38,0xd1,0xc1,0xd9}, {0x23,0xc6,0xdc,0xcb}, {0x2a,0xcb,0xd7,0xc5}, - {0x15,0xe8,0xe6,0xef}, {0x1c,0xe5,0xed,0xe1}, {0x07,0xf2,0xf0,0xf3}, {0x0e,0xff,0xfb,0xfd}, - {0x79,0xb4,0x92,0xa7}, {0x70,0xb9,0x99,0xa9}, {0x6b,0xae,0x84,0xbb}, {0x62,0xa3,0x8f,0xb5}, - {0x5d,0x80,0xbe,0x9f}, {0x54,0x8d,0xb5,0x91}, {0x4f,0x9a,0xa8,0x83}, {0x46,0x97,0xa3,0x8d} +static UINT8 U4[256][4] = { + { 0x00, 0x00, 0x00, 0x00 }, { 0x09, 0x0d, 0x0b, 0x0e }, { 0x12, 0x1a, 0x16, 0x1c }, { 0x1b, 0x17, 0x1d, 0x12 }, + { 0x24, 0x34, 0x2c, 0x38 }, { 0x2d, 0x39, 0x27, 0x36 }, { 0x36, 0x2e, 0x3a, 0x24 }, { 0x3f, 0x23, 0x31, 0x2a }, + { 0x48, 0x68, 0x58, 0x70 }, { 0x41, 0x65, 0x53, 0x7e }, { 0x5a, 0x72, 0x4e, 0x6c }, { 0x53, 0x7f, 0x45, 0x62 }, + { 0x6c, 0x5c, 0x74, 0x48 }, { 0x65, 0x51, 0x7f, 0x46 }, { 0x7e, 0x46, 0x62, 0x54 }, { 0x77, 0x4b, 0x69, 0x5a }, + { 0x90, 0xd0, 0xb0, 0xe0 }, { 0x99, 0xdd, 0xbb, 0xee }, { 0x82, 0xca, 0xa6, 0xfc }, { 0x8b, 0xc7, 0xad, 0xf2 }, + { 0xb4, 0xe4, 0x9c, 0xd8 }, { 0xbd, 0xe9, 0x97, 0xd6 }, { 0xa6, 0xfe, 0x8a, 0xc4 }, { 0xaf, 0xf3, 0x81, 0xca }, + { 0xd8, 0xb8, 0xe8, 0x90 }, { 0xd1, 0xb5, 0xe3, 0x9e }, { 0xca, 0xa2, 0xfe, 0x8c }, { 0xc3, 0xaf, 0xf5, 0x82 }, + { 0xfc, 0x8c, 0xc4, 0xa8 }, { 0xf5, 0x81, 0xcf, 0xa6 }, { 0xee, 0x96, 0xd2, 0xb4 }, { 0xe7, 0x9b, 0xd9, 0xba }, + { 0x3b, 0xbb, 0x7b, 0xdb }, { 0x32, 0xb6, 0x70, 0xd5 }, { 0x29, 0xa1, 0x6d, 0xc7 }, { 0x20, 0xac, 0x66, 0xc9 }, + { 0x1f, 0x8f, 0x57, 0xe3 }, { 0x16, 0x82, 0x5c, 0xed }, { 0x0d, 0x95, 0x41, 0xff }, { 0x04, 0x98, 0x4a, 0xf1 }, + { 0x73, 0xd3, 0x23, 0xab }, { 0x7a, 0xde, 0x28, 0xa5 }, { 0x61, 0xc9, 0x35, 0xb7 }, { 0x68, 0xc4, 0x3e, 0xb9 }, + { 0x57, 0xe7, 0x0f, 0x93 }, { 0x5e, 0xea, 0x04, 0x9d }, { 0x45, 0xfd, 0x19, 0x8f }, { 0x4c, 0xf0, 0x12, 0x81 }, + { 0xab, 0x6b, 0xcb, 0x3b }, { 0xa2, 0x66, 0xc0, 0x35 }, { 0xb9, 0x71, 0xdd, 0x27 }, { 0xb0, 0x7c, 0xd6, 0x29 }, + { 0x8f, 0x5f, 0xe7, 0x03 }, { 0x86, 0x52, 0xec, 0x0d }, { 0x9d, 0x45, 0xf1, 0x1f }, { 0x94, 0x48, 0xfa, 0x11 }, + { 0xe3, 0x03, 0x93, 0x4b }, { 0xea, 0x0e, 0x98, 0x45 }, { 0xf1, 0x19, 0x85, 0x57 }, { 0xf8, 0x14, 0x8e, 0x59 }, + { 0xc7, 0x37, 0xbf, 0x73 }, { 0xce, 0x3a, 0xb4, 0x7d }, { 0xd5, 0x2d, 0xa9, 0x6f }, { 0xdc, 0x20, 0xa2, 0x61 }, + { 0x76, 0x6d, 0xf6, 0xad }, { 0x7f, 0x60, 0xfd, 0xa3 }, { 0x64, 0x77, 0xe0, 0xb1 }, { 0x6d, 0x7a, 0xeb, 0xbf }, + { 0x52, 0x59, 0xda, 0x95 }, { 0x5b, 0x54, 0xd1, 0x9b }, { 0x40, 0x43, 0xcc, 0x89 }, { 0x49, 0x4e, 0xc7, 0x87 }, + { 0x3e, 0x05, 0xae, 0xdd }, { 0x37, 0x08, 0xa5, 0xd3 }, { 0x2c, 0x1f, 0xb8, 0xc1 }, { 0x25, 0x12, 0xb3, 0xcf }, + { 0x1a, 0x31, 0x82, 0xe5 }, { 0x13, 0x3c, 0x89, 0xeb }, { 0x08, 0x2b, 0x94, 0xf9 }, { 0x01, 0x26, 0x9f, 0xf7 }, + { 0xe6, 0xbd, 0x46, 0x4d }, { 0xef, 0xb0, 0x4d, 0x43 }, { 0xf4, 0xa7, 0x50, 0x51 }, { 0xfd, 0xaa, 0x5b, 0x5f }, + { 0xc2, 0x89, 0x6a, 0x75 }, { 0xcb, 0x84, 0x61, 0x7b }, { 0xd0, 0x93, 0x7c, 0x69 }, { 0xd9, 0x9e, 0x77, 0x67 }, + { 0xae, 0xd5, 0x1e, 0x3d }, { 0xa7, 0xd8, 0x15, 0x33 }, { 0xbc, 0xcf, 0x08, 0x21 }, { 0xb5, 0xc2, 0x03, 0x2f }, + { 0x8a, 0xe1, 0x32, 0x05 }, { 0x83, 0xec, 0x39, 0x0b }, { 0x98, 0xfb, 0x24, 0x19 }, { 0x91, 0xf6, 0x2f, 0x17 }, + { 0x4d, 0xd6, 0x8d, 0x76 }, { 0x44, 0xdb, 0x86, 0x78 }, { 0x5f, 0xcc, 0x9b, 0x6a }, { 0x56, 0xc1, 0x90, 0x64 }, + { 0x69, 0xe2, 0xa1, 0x4e }, { 0x60, 0xef, 0xaa, 0x40 }, { 0x7b, 0xf8, 0xb7, 0x52 }, { 0x72, 0xf5, 0xbc, 0x5c }, + { 0x05, 0xbe, 0xd5, 0x06 }, { 0x0c, 0xb3, 0xde, 0x08 }, { 0x17, 0xa4, 0xc3, 0x1a }, { 0x1e, 0xa9, 0xc8, 0x14 }, + { 0x21, 0x8a, 0xf9, 0x3e }, { 0x28, 0x87, 0xf2, 0x30 }, { 0x33, 0x90, 0xef, 0x22 }, { 0x3a, 0x9d, 0xe4, 0x2c }, + { 0xdd, 0x06, 0x3d, 0x96 }, { 0xd4, 0x0b, 0x36, 0x98 }, { 0xcf, 0x1c, 0x2b, 0x8a }, { 0xc6, 0x11, 0x20, 0x84 }, + { 0xf9, 0x32, 0x11, 0xae }, { 0xf0, 0x3f, 0x1a, 0xa0 }, { 0xeb, 0x28, 0x07, 0xb2 }, { 0xe2, 0x25, 0x0c, 0xbc }, + { 0x95, 0x6e, 0x65, 0xe6 }, { 0x9c, 0x63, 0x6e, 0xe8 }, { 0x87, 0x74, 0x73, 0xfa }, { 0x8e, 0x79, 0x78, 0xf4 }, + { 0xb1, 0x5a, 0x49, 0xde }, { 0xb8, 0x57, 0x42, 0xd0 }, { 0xa3, 0x40, 0x5f, 0xc2 }, { 0xaa, 0x4d, 0x54, 0xcc }, + { 0xec, 0xda, 0xf7, 0x41 }, { 0xe5, 0xd7, 0xfc, 0x4f }, { 0xfe, 0xc0, 0xe1, 0x5d }, { 0xf7, 0xcd, 0xea, 0x53 }, + { 0xc8, 0xee, 0xdb, 0x79 }, { 0xc1, 0xe3, 0xd0, 0x77 }, { 0xda, 0xf4, 0xcd, 0x65 }, { 0xd3, 0xf9, 0xc6, 0x6b }, + { 0xa4, 0xb2, 0xaf, 0x31 }, { 0xad, 0xbf, 0xa4, 0x3f }, { 0xb6, 0xa8, 0xb9, 0x2d }, { 0xbf, 0xa5, 0xb2, 0x23 }, + { 0x80, 0x86, 0x83, 0x09 }, { 0x89, 0x8b, 0x88, 0x07 }, { 0x92, 0x9c, 0x95, 0x15 }, { 0x9b, 0x91, 0x9e, 0x1b }, + { 0x7c, 0x0a, 0x47, 0xa1 }, { 0x75, 0x07, 0x4c, 0xaf }, { 0x6e, 0x10, 0x51, 0xbd }, { 0x67, 0x1d, 0x5a, 0xb3 }, + { 0x58, 0x3e, 0x6b, 0x99 }, { 0x51, 0x33, 0x60, 0x97 }, { 0x4a, 0x24, 0x7d, 0x85 }, { 0x43, 0x29, 0x76, 0x8b }, + { 0x34, 0x62, 0x1f, 0xd1 }, { 0x3d, 0x6f, 0x14, 0xdf }, { 0x26, 0x78, 0x09, 0xcd }, { 0x2f, 0x75, 0x02, 0xc3 }, + { 0x10, 0x56, 0x33, 0xe9 }, { 0x19, 0x5b, 0x38, 0xe7 }, { 0x02, 0x4c, 0x25, 0xf5 }, { 0x0b, 0x41, 0x2e, 0xfb }, + { 0xd7, 0x61, 0x8c, 0x9a }, { 0xde, 0x6c, 0x87, 0x94 }, { 0xc5, 0x7b, 0x9a, 0x86 }, { 0xcc, 0x76, 0x91, 0x88 }, + { 0xf3, 0x55, 0xa0, 0xa2 }, { 0xfa, 0x58, 0xab, 0xac }, { 0xe1, 0x4f, 0xb6, 0xbe }, { 0xe8, 0x42, 0xbd, 0xb0 }, + { 0x9f, 0x09, 0xd4, 0xea }, { 0x96, 0x04, 0xdf, 0xe4 }, { 0x8d, 0x13, 0xc2, 0xf6 }, { 0x84, 0x1e, 0xc9, 0xf8 }, + { 0xbb, 0x3d, 0xf8, 0xd2 }, { 0xb2, 0x30, 0xf3, 0xdc }, { 0xa9, 0x27, 0xee, 0xce }, { 0xa0, 0x2a, 0xe5, 0xc0 }, + { 0x47, 0xb1, 0x3c, 0x7a }, { 0x4e, 0xbc, 0x37, 0x74 }, { 0x55, 0xab, 0x2a, 0x66 }, { 0x5c, 0xa6, 0x21, 0x68 }, + { 0x63, 0x85, 0x10, 0x42 }, { 0x6a, 0x88, 0x1b, 0x4c }, { 0x71, 0x9f, 0x06, 0x5e }, { 0x78, 0x92, 0x0d, 0x50 }, + { 0x0f, 0xd9, 0x64, 0x0a }, { 0x06, 0xd4, 0x6f, 0x04 }, { 0x1d, 0xc3, 0x72, 0x16 }, { 0x14, 0xce, 0x79, 0x18 }, + { 0x2b, 0xed, 0x48, 0x32 }, { 0x22, 0xe0, 0x43, 0x3c }, { 0x39, 0xf7, 0x5e, 0x2e }, { 0x30, 0xfa, 0x55, 0x20 }, + { 0x9a, 0xb7, 0x01, 0xec }, { 0x93, 0xba, 0x0a, 0xe2 }, { 0x88, 0xad, 0x17, 0xf0 }, { 0x81, 0xa0, 0x1c, 0xfe }, + { 0xbe, 0x83, 0x2d, 0xd4 }, { 0xb7, 0x8e, 0x26, 0xda }, { 0xac, 0x99, 0x3b, 0xc8 }, { 0xa5, 0x94, 0x30, 0xc6 }, + { 0xd2, 0xdf, 0x59, 0x9c }, { 0xdb, 0xd2, 0x52, 0x92 }, { 0xc0, 0xc5, 0x4f, 0x80 }, { 0xc9, 0xc8, 0x44, 0x8e }, + { 0xf6, 0xeb, 0x75, 0xa4 }, { 0xff, 0xe6, 0x7e, 0xaa }, { 0xe4, 0xf1, 0x63, 0xb8 }, { 0xed, 0xfc, 0x68, 0xb6 }, + { 0x0a, 0x67, 0xb1, 0x0c }, { 0x03, 0x6a, 0xba, 0x02 }, { 0x18, 0x7d, 0xa7, 0x10 }, { 0x11, 0x70, 0xac, 0x1e }, + { 0x2e, 0x53, 0x9d, 0x34 }, { 0x27, 0x5e, 0x96, 0x3a }, { 0x3c, 0x49, 0x8b, 0x28 }, { 0x35, 0x44, 0x80, 0x26 }, + { 0x42, 0x0f, 0xe9, 0x7c }, { 0x4b, 0x02, 0xe2, 0x72 }, { 0x50, 0x15, 0xff, 0x60 }, { 0x59, 0x18, 0xf4, 0x6e }, + { 0x66, 0x3b, 0xc5, 0x44 }, { 0x6f, 0x36, 0xce, 0x4a }, { 0x74, 0x21, 0xd3, 0x58 }, { 0x7d, 0x2c, 0xd8, 0x56 }, + { 0xa1, 0x0c, 0x7a, 0x37 }, { 0xa8, 0x01, 0x71, 0x39 }, { 0xb3, 0x16, 0x6c, 0x2b }, { 0xba, 0x1b, 0x67, 0x25 }, + { 0x85, 0x38, 0x56, 0x0f }, { 0x8c, 0x35, 0x5d, 0x01 }, { 0x97, 0x22, 0x40, 0x13 }, { 0x9e, 0x2f, 0x4b, 0x1d }, + { 0xe9, 0x64, 0x22, 0x47 }, { 0xe0, 0x69, 0x29, 0x49 }, { 0xfb, 0x7e, 0x34, 0x5b }, { 0xf2, 0x73, 0x3f, 0x55 }, + { 0xcd, 0x50, 0x0e, 0x7f }, { 0xc4, 0x5d, 0x05, 0x71 }, { 0xdf, 0x4a, 0x18, 0x63 }, { 0xd6, 0x47, 0x13, 0x6d }, + { 0x31, 0xdc, 0xca, 0xd7 }, { 0x38, 0xd1, 0xc1, 0xd9 }, { 0x23, 0xc6, 0xdc, 0xcb }, { 0x2a, 0xcb, 0xd7, 0xc5 }, + { 0x15, 0xe8, 0xe6, 0xef }, { 0x1c, 0xe5, 0xed, 0xe1 }, { 0x07, 0xf2, 0xf0, 0xf3 }, { 0x0e, 0xff, 0xfb, 0xfd }, + { 0x79, 0xb4, 0x92, 0xa7 }, { 0x70, 0xb9, 0x99, 0xa9 }, { 0x6b, 0xae, 0x84, 0xbb }, { 0x62, 0xa3, 0x8f, 0xb5 }, + { 0x5d, 0x80, 0xbe, 0x9f }, { 0x54, 0x8d, 0xb5, 0x91 }, { 0x4f, 0x9a, 0xa8, 0x83 }, { 0x46, 0x97, 0xa3, 0x8d } }; -static UINT32 rcon[30]= -{ +static UINT32 rcon[30] = { 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, @@ -978,15 +962,13 @@ static UINT32 rcon[30]= 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91 }; - - ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // API ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// Rijndael::Rijndael() { - m_state = Invalid; + m_state = Invalid; } Rijndael::~Rijndael() @@ -999,30 +981,34 @@ void Rijndael::updateInitVector(UINT8 * initVector) if(initVector) { // specified init vector - for(int i = 0;i < MAX_IV_SIZE;i++) + for(int i = 0; i < MAX_IV_SIZE; i++) { m_initVector[i] = initVector[i]; } - } else { + } + else + { // zero init vector - for(int i = 0;i < MAX_IV_SIZE;i++) + for(int i = 0; i < MAX_IV_SIZE; i++) { m_initVector[i] = 0; } } } -int Rijndael::init(Mode mode,Direction dir,const UINT8 * key,KeyLength keyLen,UINT8 * initVector) +int Rijndael::init(Mode mode, Direction dir, const UINT8 * key, KeyLength keyLen, UINT8 * initVector) { // Not initialized yet m_state = Invalid; // Check the mode - if((mode != CBC) && (mode != ECB) && (mode != CFB1))return RIJNDAEL_UNSUPPORTED_MODE; + if((mode != CBC) && (mode != ECB) && (mode != CFB1)) + return RIJNDAEL_UNSUPPORTED_MODE; m_mode = mode; // And the direction - if((dir != Encrypt) && (dir != Decrypt))return RIJNDAEL_UNSUPPORTED_DIRECTION; + if((dir != Encrypt) && (dir != Decrypt)) + return RIJNDAEL_UNSUPPORTED_DIRECTION; m_direction = dir; // Call this function even if no init vector has been specified @@ -1036,38 +1022,41 @@ int Rijndael::init(Mode mode,Direction dir,const UINT8 * key,KeyLength keyLen,UI case Key16Bytes: uKeyLenInBytes = 16; m_uRounds = 10; - break; + break; case Key24Bytes: uKeyLenInBytes = 24; m_uRounds = 12; - break; + break; case Key32Bytes: uKeyLenInBytes = 32; m_uRounds = 14; - break; + break; default: return RIJNDAEL_UNSUPPORTED_KEY_LENGTH; - break; + break; } // The number of rounds is calculated as // m_uRounds = (m_uKeyLenInBits / 32) + 6; - if(!key)return RIJNDAEL_BAD_KEY; + if(!key) + return RIJNDAEL_BAD_KEY; UINT8 keyMatrix[_MAX_KEY_COLUMNS][4]; - for(UINT32 i = 0;i < uKeyLenInBytes;i++)keyMatrix[i >> 2][i & 3] = key[i]; + for(UINT32 i = 0; i < uKeyLenInBytes; i++) + keyMatrix[i >> 2][i & 3] = key[i]; keySched(keyMatrix); - if(m_direction == Decrypt)keyEncToDec(); + if(m_direction == Decrypt) + keyEncToDec(); m_state = Valid; return RIJNDAEL_SUCCESS; } -int Rijndael::blockEncrypt(const UINT8 *input,int inputLen,UINT8 *outBuffer, UINT8 * initVector) +int Rijndael::blockEncrypt(const UINT8 * input, int inputLen, UINT8 * outBuffer, UINT8 * initVector) { int i, k, numBlocks; UINT8 block[16], iv[4][4]; @@ -1076,59 +1065,63 @@ int Rijndael::blockEncrypt(const UINT8 *input,int inputLen,UINT8 *outBuffer, UIN if(initVector) updateInitVector(initVector); - if(m_state != Valid)return RIJNDAEL_NOT_INITIALIZED; - if(m_direction != Encrypt)return RIJNDAEL_BAD_DIRECTION; + if(m_state != Valid) + return RIJNDAEL_NOT_INITIALIZED; + if(m_direction != Encrypt) + return RIJNDAEL_BAD_DIRECTION; - if(input == 0 || inputLen <= 0)return 0; + if(input == 0 || inputLen <= 0) + return 0; - numBlocks = inputLen/128; + numBlocks = inputLen / 128; - switch(m_mode){ + switch(m_mode) + { case ECB: - for(i = numBlocks;i > 0;i--) + for(i = numBlocks; i > 0; i--) { - encrypt(input,outBuffer); + encrypt(input, outBuffer); input += 16; outBuffer += 16; } - break; + break; case CBC: - ((UINT32*)block)[0] = ((UINT32*)m_initVector)[0] ^ ((const UINT32*)input)[0]; - ((UINT32*)block)[1] = ((UINT32*)m_initVector)[1] ^ ((UINT32*)input)[1]; - ((UINT32*)block)[2] = ((UINT32*)m_initVector)[2] ^ ((UINT32*)input)[2]; - ((UINT32*)block)[3] = ((UINT32*)m_initVector)[3] ^ ((UINT32*)input)[3]; - encrypt(block,outBuffer); + ((UINT32 *)block)[0] = ((UINT32 *)m_initVector)[0] ^ ((const UINT32 *)input)[0]; + ((UINT32 *)block)[1] = ((UINT32 *)m_initVector)[1] ^ ((UINT32 *)input)[1]; + ((UINT32 *)block)[2] = ((UINT32 *)m_initVector)[2] ^ ((UINT32 *)input)[2]; + ((UINT32 *)block)[3] = ((UINT32 *)m_initVector)[3] ^ ((UINT32 *)input)[3]; + encrypt(block, outBuffer); input += 16; - for(i = numBlocks - 1;i > 0;i--) + for(i = numBlocks - 1; i > 0; i--) { - ((UINT32*)block)[0] = ((UINT32*)outBuffer)[0] ^ ((UINT32*)input)[0]; - ((UINT32*)block)[1] = ((UINT32*)outBuffer)[1] ^ ((UINT32*)input)[1]; - ((UINT32*)block)[2] = ((UINT32*)outBuffer)[2] ^ ((UINT32*)input)[2]; - ((UINT32*)block)[3] = ((UINT32*)outBuffer)[3] ^ ((UINT32*)input)[3]; + ((UINT32 *)block)[0] = ((UINT32 *)outBuffer)[0] ^ ((UINT32 *)input)[0]; + ((UINT32 *)block)[1] = ((UINT32 *)outBuffer)[1] ^ ((UINT32 *)input)[1]; + ((UINT32 *)block)[2] = ((UINT32 *)outBuffer)[2] ^ ((UINT32 *)input)[2]; + ((UINT32 *)block)[3] = ((UINT32 *)outBuffer)[3] ^ ((UINT32 *)input)[3]; outBuffer += 16; - encrypt(block,outBuffer); + encrypt(block, outBuffer); input += 16; } - break; + break; case CFB1: #if STRICT_ALIGN - KviMemory::move(iv,m_initVector,16); + KviMemory::move(iv, m_initVector, 16); #else /* !STRICT_ALIGN */ - *((UINT32*)iv[0]) = *((UINT32*)(m_initVector )); - *((UINT32*)iv[1]) = *((UINT32*)(m_initVector + 4)); - *((UINT32*)iv[2]) = *((UINT32*)(m_initVector + 8)); - *((UINT32*)iv[3]) = *((UINT32*)(m_initVector +12)); + *((UINT32 *)iv[0]) = *((UINT32 *)(m_initVector)); + *((UINT32 *)iv[1]) = *((UINT32 *)(m_initVector + 4)); + *((UINT32 *)iv[2]) = *((UINT32 *)(m_initVector + 8)); + *((UINT32 *)iv[3]) = *((UINT32 *)(m_initVector + 12)); #endif /* ?STRICT_ALIGN */ for(i = numBlocks; i > 0; i--) { for(k = 0; k < 128; k++) { - *((UINT32*) block ) = *((UINT32*)iv[0]); - *((UINT32*)(block+ 4)) = *((UINT32*)iv[1]); - *((UINT32*)(block+ 8)) = *((UINT32*)iv[2]); - *((UINT32*)(block+12)) = *((UINT32*)iv[3]); - encrypt(block,block); - outBuffer[k/8] ^= (block[0] & 0x80) >> (k & 7); + *((UINT32 *)block) = *((UINT32 *)iv[0]); + *((UINT32 *)(block + 4)) = *((UINT32 *)iv[1]); + *((UINT32 *)(block + 8)) = *((UINT32 *)iv[2]); + *((UINT32 *)(block + 12)) = *((UINT32 *)iv[3]); + encrypt(block, block); + outBuffer[k / 8] ^= (block[0] & 0x80) >> (k & 7); iv[0][0] = (iv[0][0] << 1) | (iv[0][1] >> 7); iv[0][1] = (iv[0][1] << 1) | (iv[0][2] >> 7); iv[0][2] = (iv[0][2] << 1) | (iv[0][3] >> 7); @@ -1144,19 +1137,19 @@ int Rijndael::blockEncrypt(const UINT8 *input,int inputLen,UINT8 *outBuffer, UIN iv[3][0] = (iv[3][0] << 1) | (iv[3][1] >> 7); iv[3][1] = (iv[3][1] << 1) | (iv[3][2] >> 7); iv[3][2] = (iv[3][2] << 1) | (iv[3][3] >> 7); - iv[3][3] = (iv[3][3] << 1) | ((outBuffer[k/8] >> (7-(k&7))) & 1); + iv[3][3] = (iv[3][3] << 1) | ((outBuffer[k / 8] >> (7 - (k & 7))) & 1); } } - break; + break; default: return -1; - break; + break; } return 128 * numBlocks; } -int Rijndael::padEncrypt(const UINT8 *input, int inputOctets, UINT8 *outBuffer, UINT8 * initVector) +int Rijndael::padEncrypt(const UINT8 * input, int inputOctets, UINT8 * outBuffer, UINT8 * initVector) { int i, numBlocks, padLen; UINT8 block[16], *iv; @@ -1165,12 +1158,15 @@ int Rijndael::padEncrypt(const UINT8 *input, int inputOctets, UINT8 *outBuffer, if(initVector) updateInitVector(initVector); - if(m_state != Valid)return RIJNDAEL_NOT_INITIALIZED; - if(m_direction != Encrypt)return RIJNDAEL_NOT_INITIALIZED; + if(m_state != Valid) + return RIJNDAEL_NOT_INITIALIZED; + if(m_direction != Encrypt) + return RIJNDAEL_NOT_INITIALIZED; - if(input == 0 || inputOctets <= 0)return 0; + if(input == 0 || inputOctets <= 0) + return 0; - numBlocks = inputOctets/16; + numBlocks = inputOctets / 16; switch(m_mode) { @@ -1181,44 +1177,46 @@ int Rijndael::padEncrypt(const UINT8 *input, int inputOctets, UINT8 *outBuffer, input += 16; outBuffer += 16; } - padLen = 16 - (inputOctets - 16*numBlocks); -// assert(padLen > 0 && padLen <= 16); + padLen = 16 - (inputOctets - 16 * numBlocks); + // assert(padLen > 0 && padLen <= 16); KviMemory::move(block, input, 16 - padLen); KviMemory::set(block + 16 - padLen, padLen, padLen); - encrypt(block,outBuffer); - break; + encrypt(block, outBuffer); + break; case CBC: iv = m_initVector; for(i = numBlocks; i > 0; i--) { - ((UINT32*)block)[0] = ((UINT32*)input)[0] ^ ((UINT32*)iv)[0]; - ((UINT32*)block)[1] = ((UINT32*)input)[1] ^ ((UINT32*)iv)[1]; - ((UINT32*)block)[2] = ((UINT32*)input)[2] ^ ((UINT32*)iv)[2]; - ((UINT32*)block)[3] = ((UINT32*)input)[3] ^ ((UINT32*)iv)[3]; + ((UINT32 *)block)[0] = ((UINT32 *)input)[0] ^ ((UINT32 *)iv)[0]; + ((UINT32 *)block)[1] = ((UINT32 *)input)[1] ^ ((UINT32 *)iv)[1]; + ((UINT32 *)block)[2] = ((UINT32 *)input)[2] ^ ((UINT32 *)iv)[2]; + ((UINT32 *)block)[3] = ((UINT32 *)input)[3] ^ ((UINT32 *)iv)[3]; encrypt(block, outBuffer); iv = outBuffer; input += 16; outBuffer += 16; } - padLen = 16 - (inputOctets - 16*numBlocks); -// assert(padLen > 0 && padLen <= 16); // DO SOMETHING HERE ? - for (i = 0; i < 16 - padLen; i++) { + padLen = 16 - (inputOctets - 16 * numBlocks); + // assert(padLen > 0 && padLen <= 16); // DO SOMETHING HERE ? + for(i = 0; i < 16 - padLen; i++) + { block[i] = input[i] ^ iv[i]; } - for (i = 16 - padLen; i < 16; i++) { + for(i = 16 - padLen; i < 16; i++) + { block[i] = (UINT8)padLen ^ iv[i]; } - encrypt(block,outBuffer); - break; + encrypt(block, outBuffer); + break; default: return -1; - break; + break; } - return 16*(numBlocks + 1); + return 16 * (numBlocks + 1); } -int Rijndael::blockDecrypt(const UINT8 *input, int inputLen, UINT8 *outBuffer, UINT8 * initVector) +int Rijndael::blockDecrypt(const UINT8 * input, int inputLen, UINT8 * outBuffer, UINT8 * initVector) { int i, k, numBlocks; UINT8 block[16], iv[4][4]; @@ -1227,47 +1225,54 @@ int Rijndael::blockDecrypt(const UINT8 *input, int inputLen, UINT8 *outBuffer, U if(initVector) updateInitVector(initVector); - if(m_state != Valid)return RIJNDAEL_NOT_INITIALIZED; - if((m_mode != CFB1) && (m_direction == Encrypt))return RIJNDAEL_BAD_DIRECTION; + if(m_state != Valid) + return RIJNDAEL_NOT_INITIALIZED; + if((m_mode != CFB1) && (m_direction == Encrypt)) + return RIJNDAEL_BAD_DIRECTION; - if (input == 0 || inputLen <= 0)return 0; + if(input == 0 || inputLen <= 0) + return 0; - numBlocks = inputLen/128; + numBlocks = inputLen / 128; switch(m_mode) { case ECB: - for (i = numBlocks; i > 0; i--) + for(i = numBlocks; i > 0; i--) { - decrypt(input,outBuffer); + decrypt(input, outBuffer); input += 16; outBuffer += 16; } - break; + break; case CBC: #if STRICT_ALIGN - KviMemory::move(iv,m_initVector,16); + KviMemory::move(iv, m_initVector, 16); #else - *((UINT32*)iv[0]) = *((UINT32*)(m_initVector )); - *((UINT32*)iv[1]) = *((UINT32*)(m_initVector+ 4)); - *((UINT32*)iv[2]) = *((UINT32*)(m_initVector+ 8)); - *((UINT32*)iv[3]) = *((UINT32*)(m_initVector+12)); + *((UINT32 *)iv[0]) = *((UINT32 *)(m_initVector)); + *((UINT32 *)iv[1]) = *((UINT32 *)(m_initVector + 4)); + *((UINT32 *)iv[2]) = *((UINT32 *)(m_initVector + 8)); + *((UINT32 *)iv[3]) = *((UINT32 *)(m_initVector + 12)); #endif - for (i = numBlocks; i > 0; i--) + for(i = numBlocks; i > 0; i--) { decrypt(input, block); - ((UINT32*)block)[0] ^= *((UINT32*)iv[0]); - ((UINT32*)block)[1] ^= *((UINT32*)iv[1]); - ((UINT32*)block)[2] ^= *((UINT32*)iv[2]); - ((UINT32*)block)[3] ^= *((UINT32*)iv[3]); + ((UINT32 *)block)[0] ^= *((UINT32 *)iv[0]); + ((UINT32 *)block)[1] ^= *((UINT32 *)iv[1]); + ((UINT32 *)block)[2] ^= *((UINT32 *)iv[2]); + ((UINT32 *)block)[3] ^= *((UINT32 *)iv[3]); #if STRICT_ALIGN KviMemory::move(iv, input, 16); KviMemory::move(outBuf, block, 16); #else - *((UINT32*)iv[0]) = ((UINT32*)input)[0]; ((UINT32*)outBuffer)[0] = ((UINT32*)block)[0]; - *((UINT32*)iv[1]) = ((UINT32*)input)[1]; ((UINT32*)outBuffer)[1] = ((UINT32*)block)[1]; - *((UINT32*)iv[2]) = ((UINT32*)input)[2]; ((UINT32*)outBuffer)[2] = ((UINT32*)block)[2]; - *((UINT32*)iv[3]) = ((UINT32*)input)[3]; ((UINT32*)outBuffer)[3] = ((UINT32*)block)[3]; + *((UINT32 *)iv[0]) = ((UINT32 *)input)[0]; + ((UINT32 *)outBuffer)[0] = ((UINT32 *)block)[0]; + *((UINT32 *)iv[1]) = ((UINT32 *)input)[1]; + ((UINT32 *)outBuffer)[1] = ((UINT32 *)block)[1]; + *((UINT32 *)iv[2]) = ((UINT32 *)input)[2]; + ((UINT32 *)outBuffer)[2] = ((UINT32 *)block)[2]; + *((UINT32 *)iv[3]) = ((UINT32 *)input)[3]; + ((UINT32 *)outBuffer)[3] = ((UINT32 *)block)[3]; #endif input += 16; outBuffer += 16; @@ -1277,19 +1282,19 @@ int Rijndael::blockDecrypt(const UINT8 *input, int inputLen, UINT8 *outBuffer, U #if STRICT_ALIGN KviMemory::move(iv, m_initVector, 16); #else - *((UINT32*)iv[0]) = *((UINT32*)(m_initVector)); - *((UINT32*)iv[1]) = *((UINT32*)(m_initVector+ 4)); - *((UINT32*)iv[2]) = *((UINT32*)(m_initVector+ 8)); - *((UINT32*)iv[3]) = *((UINT32*)(m_initVector+12)); + *((UINT32 *)iv[0]) = *((UINT32 *)(m_initVector)); + *((UINT32 *)iv[1]) = *((UINT32 *)(m_initVector + 4)); + *((UINT32 *)iv[2]) = *((UINT32 *)(m_initVector + 8)); + *((UINT32 *)iv[3]) = *((UINT32 *)(m_initVector + 12)); #endif for(i = numBlocks; i > 0; i--) { for(k = 0; k < 128; k++) { - *((UINT32*) block ) = *((UINT32*)iv[0]); - *((UINT32*)(block+ 4)) = *((UINT32*)iv[1]); - *((UINT32*)(block+ 8)) = *((UINT32*)iv[2]); - *((UINT32*)(block+12)) = *((UINT32*)iv[3]); + *((UINT32 *)block) = *((UINT32 *)iv[0]); + *((UINT32 *)(block + 4)) = *((UINT32 *)iv[1]); + *((UINT32 *)(block + 8)) = *((UINT32 *)iv[2]); + *((UINT32 *)(block + 12)) = *((UINT32 *)iv[3]); encrypt(block, block); iv[0][0] = (iv[0][0] << 1) | (iv[0][1] >> 7); iv[0][1] = (iv[0][1] << 1) | (iv[0][2] >> 7); @@ -1306,20 +1311,20 @@ int Rijndael::blockDecrypt(const UINT8 *input, int inputLen, UINT8 *outBuffer, U iv[3][0] = (iv[3][0] << 1) | (iv[3][1] >> 7); iv[3][1] = (iv[3][1] << 1) | (iv[3][2] >> 7); iv[3][2] = (iv[3][2] << 1) | (iv[3][3] >> 7); - iv[3][3] = (iv[3][3] << 1) | ((input[k/8] >> (7-(k&7))) & 1); - outBuffer[k/8] ^= (block[0] & 0x80) >> (k & 7); + iv[3][3] = (iv[3][3] << 1) | ((input[k / 8] >> (7 - (k & 7))) & 1); + outBuffer[k / 8] ^= (block[0] & 0x80) >> (k & 7); } } - break; + break; default: return -1; - break; + break; } - return 128*numBlocks; + return 128 * numBlocks; } -int Rijndael::padDecrypt(const UINT8 *input, int inputOctets, UINT8 *outBuffer, UINT8 * initVector) +int Rijndael::padDecrypt(const UINT8 * input, int inputOctets, UINT8 * outBuffer, UINT8 * initVector) { int i, numBlocks, padLen; UINT8 block[16]; @@ -1329,18 +1334,23 @@ int Rijndael::padDecrypt(const UINT8 *input, int inputOctets, UINT8 *outBuffer, if(initVector) updateInitVector(initVector); - if(m_state != Valid)return RIJNDAEL_NOT_INITIALIZED; - if(m_direction != Decrypt)return RIJNDAEL_BAD_DIRECTION; + if(m_state != Valid) + return RIJNDAEL_NOT_INITIALIZED; + if(m_direction != Decrypt) + return RIJNDAEL_BAD_DIRECTION; - if(input == 0 || inputOctets <= 0)return 0; + if(input == 0 || inputOctets <= 0) + return 0; - if((inputOctets % 16) != 0)return RIJNDAEL_CORRUPTED_DATA; + if((inputOctets % 16) != 0) + return RIJNDAEL_CORRUPTED_DATA; - numBlocks = inputOctets/16; + numBlocks = inputOctets / 16; - switch(m_mode){ + switch(m_mode) + { case ECB: - for (i = numBlocks - 1; i > 0; i--) + for(i = numBlocks - 1; i > 0; i--) { decrypt(input, outBuffer); input += 16; @@ -1349,23 +1359,25 @@ int Rijndael::padDecrypt(const UINT8 *input, int inputOctets, UINT8 *outBuffer, decrypt(input, block); padLen = block[15]; - if (padLen >= 16)return RIJNDAEL_CORRUPTED_DATA; + if(padLen >= 16) + return RIJNDAEL_CORRUPTED_DATA; for(i = 16 - padLen; i < 16; i++) { - if(block[i] != padLen)return RIJNDAEL_CORRUPTED_DATA; + if(block[i] != padLen) + return RIJNDAEL_CORRUPTED_DATA; } KviMemory::move(outBuffer, block, 16 - padLen); - break; + break; case CBC: KviMemory::move(iv, m_initVector, 16); /* all blocks but last */ - for (i = numBlocks - 1; i > 0; i--) + for(i = numBlocks - 1; i > 0; i--) { decrypt(input, block); - ((UINT32*)block)[0] ^= iv[0]; - ((UINT32*)block)[1] ^= iv[1]; - ((UINT32*)block)[2] ^= iv[2]; - ((UINT32*)block)[3] ^= iv[3]; + ((UINT32 *)block)[0] ^= iv[0]; + ((UINT32 *)block)[1] ^= iv[1]; + ((UINT32 *)block)[2] ^= iv[2]; + ((UINT32 *)block)[3] ^= iv[3]; KviMemory::move(iv, input, 16); KviMemory::move(outBuffer, block, 16); input += 16; @@ -1373,35 +1385,36 @@ int Rijndael::padDecrypt(const UINT8 *input, int inputOctets, UINT8 *outBuffer, } /* last block */ decrypt(input, block); - ((UINT32*)block)[0] ^= iv[0]; - ((UINT32*)block)[1] ^= iv[1]; - ((UINT32*)block)[2] ^= iv[2]; - ((UINT32*)block)[3] ^= iv[3]; + ((UINT32 *)block)[0] ^= iv[0]; + ((UINT32 *)block)[1] ^= iv[1]; + ((UINT32 *)block)[2] ^= iv[2]; + ((UINT32 *)block)[3] ^= iv[3]; padLen = block[15]; - if(padLen <= 0 || padLen > 16)return RIJNDAEL_CORRUPTED_DATA; + if(padLen <= 0 || padLen > 16) + return RIJNDAEL_CORRUPTED_DATA; for(i = 16 - padLen; i < 16; i++) { - if(block[i] != padLen)return RIJNDAEL_CORRUPTED_DATA; + if(block[i] != padLen) + return RIJNDAEL_CORRUPTED_DATA; } KviMemory::move(outBuffer, block, 16 - padLen); break; default: return -1; - break; + break; } - return 16*numBlocks - padLen; + return 16 * numBlocks - padLen; } ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // ALGORITHM ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - void Rijndael::keySched(UINT8 key[_MAX_KEY_COLUMNS][4]) { - int j,rconpointer = 0; + int j, rconpointer = 0; // Calculate the necessary round keys // The number of calculations depends on keyBits and blockBits @@ -1411,23 +1424,22 @@ void Rijndael::keySched(UINT8 key[_MAX_KEY_COLUMNS][4]) // Copy the input key to the temporary key matrix - for(j = 0;j < uKeyColumns;j++) + for(j = 0; j < uKeyColumns; j++) { - *((UINT32*)(tempKey[j])) = *((UINT32*)(key[j])); + *((UINT32 *)(tempKey[j])) = *((UINT32 *)(key[j])); } unsigned int r = 0; int t = 0; // copy values into round key array - for(j = 0;(j < uKeyColumns) && (r <= m_uRounds); ) + for(j = 0; (j < uKeyColumns) && (r <= m_uRounds);) { - for(;(j < uKeyColumns) && (t < 4); j++, t++) + for(; (j < uKeyColumns) && (t < 4); j++, t++) { - *((UINT32*)m_expandedKey[r][t]) = *((UINT32*)tempKey[j]); + *((UINT32 *)m_expandedKey[r][t]) = *((UINT32 *)tempKey[j]); } - if(t == 4) { r++; @@ -1437,37 +1449,39 @@ void Rijndael::keySched(UINT8 key[_MAX_KEY_COLUMNS][4]) while(r <= m_uRounds) { - tempKey[0][0] ^= S[tempKey[uKeyColumns-1][1]]; - tempKey[0][1] ^= S[tempKey[uKeyColumns-1][2]]; - tempKey[0][2] ^= S[tempKey[uKeyColumns-1][3]]; - tempKey[0][3] ^= S[tempKey[uKeyColumns-1][0]]; + tempKey[0][0] ^= S[tempKey[uKeyColumns - 1][1]]; + tempKey[0][1] ^= S[tempKey[uKeyColumns - 1][2]]; + tempKey[0][2] ^= S[tempKey[uKeyColumns - 1][3]]; + tempKey[0][3] ^= S[tempKey[uKeyColumns - 1][0]]; tempKey[0][0] ^= rcon[rconpointer++]; - if (uKeyColumns != 8) + if(uKeyColumns != 8) { for(j = 1; j < uKeyColumns; j++) { - *((UINT32*)tempKey[j]) ^= *((UINT32*)tempKey[j-1]); + *((UINT32 *)tempKey[j]) ^= *((UINT32 *)tempKey[j - 1]); } - } else { - for(j = 1; j < uKeyColumns/2; j++) + } + else + { + for(j = 1; j < uKeyColumns / 2; j++) { - *((UINT32*)tempKey[j]) ^= *((UINT32*)tempKey[j-1]); + *((UINT32 *)tempKey[j]) ^= *((UINT32 *)tempKey[j - 1]); } - tempKey[uKeyColumns/2][0] ^= S[tempKey[uKeyColumns/2 - 1][0]]; - tempKey[uKeyColumns/2][1] ^= S[tempKey[uKeyColumns/2 - 1][1]]; - tempKey[uKeyColumns/2][2] ^= S[tempKey[uKeyColumns/2 - 1][2]]; - tempKey[uKeyColumns/2][3] ^= S[tempKey[uKeyColumns/2 - 1][3]]; - for(j = uKeyColumns/2 + 1; j < uKeyColumns; j++) + tempKey[uKeyColumns / 2][0] ^= S[tempKey[uKeyColumns / 2 - 1][0]]; + tempKey[uKeyColumns / 2][1] ^= S[tempKey[uKeyColumns / 2 - 1][1]]; + tempKey[uKeyColumns / 2][2] ^= S[tempKey[uKeyColumns / 2 - 1][2]]; + tempKey[uKeyColumns / 2][3] ^= S[tempKey[uKeyColumns / 2 - 1][3]]; + for(j = uKeyColumns / 2 + 1; j < uKeyColumns; j++) { - *((UINT32*)tempKey[j]) ^= *((UINT32*)tempKey[j-1]); + *((UINT32 *)tempKey[j]) ^= *((UINT32 *)tempKey[j - 1]); } } - for(j = 0; (j < uKeyColumns) && (r <= m_uRounds); ) + for(j = 0; (j < uKeyColumns) && (r <= m_uRounds);) { for(; (j < uKeyColumns) && (t < 4); j++, t++) { - *((UINT32*)m_expandedKey[r][t]) = *((UINT32*)tempKey[j]); + *((UINT32 *)m_expandedKey[r][t]) = *((UINT32 *)tempKey[j]); } if(t == 4) { @@ -1480,18 +1494,18 @@ void Rijndael::keySched(UINT8 key[_MAX_KEY_COLUMNS][4]) void Rijndael::keyEncToDec() { - UINT8 *w; + UINT8 * w; for(unsigned int r = 1; r < m_uRounds; r++) { w = m_expandedKey[r][0]; - *((UINT32*)w) = *((UINT32*)U1[w[0]]) ^ *((UINT32*)U2[w[1]]) ^ *((UINT32*)U3[w[2]]) ^ *((UINT32*)U4[w[3]]); + *((UINT32 *)w) = *((UINT32 *)U1[w[0]]) ^ *((UINT32 *)U2[w[1]]) ^ *((UINT32 *)U3[w[2]]) ^ *((UINT32 *)U4[w[3]]); w = m_expandedKey[r][1]; - *((UINT32*)w) = *((UINT32*)U1[w[0]]) ^ *((UINT32*)U2[w[1]]) ^ *((UINT32*)U3[w[2]]) ^ *((UINT32*)U4[w[3]]); + *((UINT32 *)w) = *((UINT32 *)U1[w[0]]) ^ *((UINT32 *)U2[w[1]]) ^ *((UINT32 *)U3[w[2]]) ^ *((UINT32 *)U4[w[3]]); w = m_expandedKey[r][2]; - *((UINT32*)w) = *((UINT32*)U1[w[0]]) ^ *((UINT32*)U2[w[1]]) ^ *((UINT32*)U3[w[2]]) ^ *((UINT32*)U4[w[3]]); + *((UINT32 *)w) = *((UINT32 *)U1[w[0]]) ^ *((UINT32 *)U2[w[1]]) ^ *((UINT32 *)U3[w[2]]) ^ *((UINT32 *)U4[w[3]]); w = m_expandedKey[r][3]; - *((UINT32*)w) = *((UINT32*)U1[w[0]]) ^ *((UINT32*)U2[w[1]]) ^ *((UINT32*)U3[w[2]]) ^ *((UINT32*)U4[w[3]]); + *((UINT32 *)w) = *((UINT32 *)U1[w[0]]) ^ *((UINT32 *)U2[w[1]]) ^ *((UINT32 *)U3[w[2]]) ^ *((UINT32 *)U4[w[3]]); } } @@ -1500,74 +1514,74 @@ void Rijndael::encrypt(const UINT8 a[16], UINT8 b[16]) unsigned int r; UINT8 temp[4][4]; - *((UINT32*)temp[0]) = *((UINT32*)(a )) ^ *((UINT32*)m_expandedKey[0][0]); - *((UINT32*)temp[1]) = *((UINT32*)(a+ 4)) ^ *((UINT32*)m_expandedKey[0][1]); - *((UINT32*)temp[2]) = *((UINT32*)(a+ 8)) ^ *((UINT32*)m_expandedKey[0][2]); - *((UINT32*)temp[3]) = *((UINT32*)(a+12)) ^ *((UINT32*)m_expandedKey[0][3]); - *((UINT32*)(b )) = *((UINT32*)T1[temp[0][0]]) - ^ *((UINT32*)T2[temp[1][1]]) - ^ *((UINT32*)T3[temp[2][2]]) - ^ *((UINT32*)T4[temp[3][3]]); - *((UINT32*)(b + 4)) = *((UINT32*)T1[temp[1][0]]) - ^ *((UINT32*)T2[temp[2][1]]) - ^ *((UINT32*)T3[temp[3][2]]) - ^ *((UINT32*)T4[temp[0][3]]); - *((UINT32*)(b + 8)) = *((UINT32*)T1[temp[2][0]]) - ^ *((UINT32*)T2[temp[3][1]]) - ^ *((UINT32*)T3[temp[0][2]]) - ^ *((UINT32*)T4[temp[1][3]]); - *((UINT32*)(b +12)) = *((UINT32*)T1[temp[3][0]]) - ^ *((UINT32*)T2[temp[0][1]]) - ^ *((UINT32*)T3[temp[1][2]]) - ^ *((UINT32*)T4[temp[2][3]]); - for(r = 1; r < m_uRounds-1; r++) + *((UINT32 *)temp[0]) = *((UINT32 *)(a)) ^ *((UINT32 *)m_expandedKey[0][0]); + *((UINT32 *)temp[1]) = *((UINT32 *)(a + 4)) ^ *((UINT32 *)m_expandedKey[0][1]); + *((UINT32 *)temp[2]) = *((UINT32 *)(a + 8)) ^ *((UINT32 *)m_expandedKey[0][2]); + *((UINT32 *)temp[3]) = *((UINT32 *)(a + 12)) ^ *((UINT32 *)m_expandedKey[0][3]); + *((UINT32 *)(b)) = *((UINT32 *)T1[temp[0][0]]) + ^ *((UINT32 *)T2[temp[1][1]]) + ^ *((UINT32 *)T3[temp[2][2]]) + ^ *((UINT32 *)T4[temp[3][3]]); + *((UINT32 *)(b + 4)) = *((UINT32 *)T1[temp[1][0]]) + ^ *((UINT32 *)T2[temp[2][1]]) + ^ *((UINT32 *)T3[temp[3][2]]) + ^ *((UINT32 *)T4[temp[0][3]]); + *((UINT32 *)(b + 8)) = *((UINT32 *)T1[temp[2][0]]) + ^ *((UINT32 *)T2[temp[3][1]]) + ^ *((UINT32 *)T3[temp[0][2]]) + ^ *((UINT32 *)T4[temp[1][3]]); + *((UINT32 *)(b + 12)) = *((UINT32 *)T1[temp[3][0]]) + ^ *((UINT32 *)T2[temp[0][1]]) + ^ *((UINT32 *)T3[temp[1][2]]) + ^ *((UINT32 *)T4[temp[2][3]]); + for(r = 1; r < m_uRounds - 1; r++) { - *((UINT32*)temp[0]) = *((UINT32*)(b )) ^ *((UINT32*)m_expandedKey[r][0]); - *((UINT32*)temp[1]) = *((UINT32*)(b+ 4)) ^ *((UINT32*)m_expandedKey[r][1]); - *((UINT32*)temp[2]) = *((UINT32*)(b+ 8)) ^ *((UINT32*)m_expandedKey[r][2]); - *((UINT32*)temp[3]) = *((UINT32*)(b+12)) ^ *((UINT32*)m_expandedKey[r][3]); - - *((UINT32*)(b )) = *((UINT32*)T1[temp[0][0]]) - ^ *((UINT32*)T2[temp[1][1]]) - ^ *((UINT32*)T3[temp[2][2]]) - ^ *((UINT32*)T4[temp[3][3]]); - *((UINT32*)(b + 4)) = *((UINT32*)T1[temp[1][0]]) - ^ *((UINT32*)T2[temp[2][1]]) - ^ *((UINT32*)T3[temp[3][2]]) - ^ *((UINT32*)T4[temp[0][3]]); - *((UINT32*)(b + 8)) = *((UINT32*)T1[temp[2][0]]) - ^ *((UINT32*)T2[temp[3][1]]) - ^ *((UINT32*)T3[temp[0][2]]) - ^ *((UINT32*)T4[temp[1][3]]); - *((UINT32*)(b +12)) = *((UINT32*)T1[temp[3][0]]) - ^ *((UINT32*)T2[temp[0][1]]) - ^ *((UINT32*)T3[temp[1][2]]) - ^ *((UINT32*)T4[temp[2][3]]); + *((UINT32 *)temp[0]) = *((UINT32 *)(b)) ^ *((UINT32 *)m_expandedKey[r][0]); + *((UINT32 *)temp[1]) = *((UINT32 *)(b + 4)) ^ *((UINT32 *)m_expandedKey[r][1]); + *((UINT32 *)temp[2]) = *((UINT32 *)(b + 8)) ^ *((UINT32 *)m_expandedKey[r][2]); + *((UINT32 *)temp[3]) = *((UINT32 *)(b + 12)) ^ *((UINT32 *)m_expandedKey[r][3]); + + *((UINT32 *)(b)) = *((UINT32 *)T1[temp[0][0]]) + ^ *((UINT32 *)T2[temp[1][1]]) + ^ *((UINT32 *)T3[temp[2][2]]) + ^ *((UINT32 *)T4[temp[3][3]]); + *((UINT32 *)(b + 4)) = *((UINT32 *)T1[temp[1][0]]) + ^ *((UINT32 *)T2[temp[2][1]]) + ^ *((UINT32 *)T3[temp[3][2]]) + ^ *((UINT32 *)T4[temp[0][3]]); + *((UINT32 *)(b + 8)) = *((UINT32 *)T1[temp[2][0]]) + ^ *((UINT32 *)T2[temp[3][1]]) + ^ *((UINT32 *)T3[temp[0][2]]) + ^ *((UINT32 *)T4[temp[1][3]]); + *((UINT32 *)(b + 12)) = *((UINT32 *)T1[temp[3][0]]) + ^ *((UINT32 *)T2[temp[0][1]]) + ^ *((UINT32 *)T3[temp[1][2]]) + ^ *((UINT32 *)T4[temp[2][3]]); } - *((UINT32*)temp[0]) = *((UINT32*)(b )) ^ *((UINT32*)m_expandedKey[m_uRounds-1][0]); - *((UINT32*)temp[1]) = *((UINT32*)(b+ 4)) ^ *((UINT32*)m_expandedKey[m_uRounds-1][1]); - *((UINT32*)temp[2]) = *((UINT32*)(b+ 8)) ^ *((UINT32*)m_expandedKey[m_uRounds-1][2]); - *((UINT32*)temp[3]) = *((UINT32*)(b+12)) ^ *((UINT32*)m_expandedKey[m_uRounds-1][3]); - b[ 0] = T1[temp[0][0]][1]; - b[ 1] = T1[temp[1][1]][1]; - b[ 2] = T1[temp[2][2]][1]; - b[ 3] = T1[temp[3][3]][1]; - b[ 4] = T1[temp[1][0]][1]; - b[ 5] = T1[temp[2][1]][1]; - b[ 6] = T1[temp[3][2]][1]; - b[ 7] = T1[temp[0][3]][1]; - b[ 8] = T1[temp[2][0]][1]; - b[ 9] = T1[temp[3][1]][1]; + *((UINT32 *)temp[0]) = *((UINT32 *)(b)) ^ *((UINT32 *)m_expandedKey[m_uRounds - 1][0]); + *((UINT32 *)temp[1]) = *((UINT32 *)(b + 4)) ^ *((UINT32 *)m_expandedKey[m_uRounds - 1][1]); + *((UINT32 *)temp[2]) = *((UINT32 *)(b + 8)) ^ *((UINT32 *)m_expandedKey[m_uRounds - 1][2]); + *((UINT32 *)temp[3]) = *((UINT32 *)(b + 12)) ^ *((UINT32 *)m_expandedKey[m_uRounds - 1][3]); + b[0] = T1[temp[0][0]][1]; + b[1] = T1[temp[1][1]][1]; + b[2] = T1[temp[2][2]][1]; + b[3] = T1[temp[3][3]][1]; + b[4] = T1[temp[1][0]][1]; + b[5] = T1[temp[2][1]][1]; + b[6] = T1[temp[3][2]][1]; + b[7] = T1[temp[0][3]][1]; + b[8] = T1[temp[2][0]][1]; + b[9] = T1[temp[3][1]][1]; b[10] = T1[temp[0][2]][1]; b[11] = T1[temp[1][3]][1]; b[12] = T1[temp[3][0]][1]; b[13] = T1[temp[0][1]][1]; b[14] = T1[temp[1][2]][1]; b[15] = T1[temp[2][3]][1]; - *((UINT32*)(b )) ^= *((UINT32*)m_expandedKey[m_uRounds][0]); - *((UINT32*)(b+ 4)) ^= *((UINT32*)m_expandedKey[m_uRounds][1]); - *((UINT32*)(b+ 8)) ^= *((UINT32*)m_expandedKey[m_uRounds][2]); - *((UINT32*)(b+12)) ^= *((UINT32*)m_expandedKey[m_uRounds][3]); + *((UINT32 *)(b)) ^= *((UINT32 *)m_expandedKey[m_uRounds][0]); + *((UINT32 *)(b + 4)) ^= *((UINT32 *)m_expandedKey[m_uRounds][1]); + *((UINT32 *)(b + 8)) ^= *((UINT32 *)m_expandedKey[m_uRounds][2]); + *((UINT32 *)(b + 12)) ^= *((UINT32 *)m_expandedKey[m_uRounds][3]); } void Rijndael::decrypt(const UINT8 a[16], UINT8 b[16]) @@ -1575,75 +1589,75 @@ void Rijndael::decrypt(const UINT8 a[16], UINT8 b[16]) int r; UINT8 temp[4][4]; - *((UINT32*)temp[0]) = *((UINT32*)(a )) ^ *((UINT32*)m_expandedKey[m_uRounds][0]); - *((UINT32*)temp[1]) = *((UINT32*)(a+ 4)) ^ *((UINT32*)m_expandedKey[m_uRounds][1]); - *((UINT32*)temp[2]) = *((UINT32*)(a+ 8)) ^ *((UINT32*)m_expandedKey[m_uRounds][2]); - *((UINT32*)temp[3]) = *((UINT32*)(a+12)) ^ *((UINT32*)m_expandedKey[m_uRounds][3]); - - *((UINT32*)(b )) = *((UINT32*)T5[temp[0][0]]) - ^ *((UINT32*)T6[temp[3][1]]) - ^ *((UINT32*)T7[temp[2][2]]) - ^ *((UINT32*)T8[temp[1][3]]); - *((UINT32*)(b+ 4)) = *((UINT32*)T5[temp[1][0]]) - ^ *((UINT32*)T6[temp[0][1]]) - ^ *((UINT32*)T7[temp[3][2]]) - ^ *((UINT32*)T8[temp[2][3]]); - *((UINT32*)(b+ 8)) = *((UINT32*)T5[temp[2][0]]) - ^ *((UINT32*)T6[temp[1][1]]) - ^ *((UINT32*)T7[temp[0][2]]) - ^ *((UINT32*)T8[temp[3][3]]); - *((UINT32*)(b+12)) = *((UINT32*)T5[temp[3][0]]) - ^ *((UINT32*)T6[temp[2][1]]) - ^ *((UINT32*)T7[temp[1][2]]) - ^ *((UINT32*)T8[temp[0][3]]); - for(r = m_uRounds-1; r > 1; r--) + *((UINT32 *)temp[0]) = *((UINT32 *)(a)) ^ *((UINT32 *)m_expandedKey[m_uRounds][0]); + *((UINT32 *)temp[1]) = *((UINT32 *)(a + 4)) ^ *((UINT32 *)m_expandedKey[m_uRounds][1]); + *((UINT32 *)temp[2]) = *((UINT32 *)(a + 8)) ^ *((UINT32 *)m_expandedKey[m_uRounds][2]); + *((UINT32 *)temp[3]) = *((UINT32 *)(a + 12)) ^ *((UINT32 *)m_expandedKey[m_uRounds][3]); + + *((UINT32 *)(b)) = *((UINT32 *)T5[temp[0][0]]) + ^ *((UINT32 *)T6[temp[3][1]]) + ^ *((UINT32 *)T7[temp[2][2]]) + ^ *((UINT32 *)T8[temp[1][3]]); + *((UINT32 *)(b + 4)) = *((UINT32 *)T5[temp[1][0]]) + ^ *((UINT32 *)T6[temp[0][1]]) + ^ *((UINT32 *)T7[temp[3][2]]) + ^ *((UINT32 *)T8[temp[2][3]]); + *((UINT32 *)(b + 8)) = *((UINT32 *)T5[temp[2][0]]) + ^ *((UINT32 *)T6[temp[1][1]]) + ^ *((UINT32 *)T7[temp[0][2]]) + ^ *((UINT32 *)T8[temp[3][3]]); + *((UINT32 *)(b + 12)) = *((UINT32 *)T5[temp[3][0]]) + ^ *((UINT32 *)T6[temp[2][1]]) + ^ *((UINT32 *)T7[temp[1][2]]) + ^ *((UINT32 *)T8[temp[0][3]]); + for(r = m_uRounds - 1; r > 1; r--) { - *((UINT32*)temp[0]) = *((UINT32*)(b )) ^ *((UINT32*)m_expandedKey[r][0]); - *((UINT32*)temp[1]) = *((UINT32*)(b+ 4)) ^ *((UINT32*)m_expandedKey[r][1]); - *((UINT32*)temp[2]) = *((UINT32*)(b+ 8)) ^ *((UINT32*)m_expandedKey[r][2]); - *((UINT32*)temp[3]) = *((UINT32*)(b+12)) ^ *((UINT32*)m_expandedKey[r][3]); - *((UINT32*)(b )) = *((UINT32*)T5[temp[0][0]]) - ^ *((UINT32*)T6[temp[3][1]]) - ^ *((UINT32*)T7[temp[2][2]]) - ^ *((UINT32*)T8[temp[1][3]]); - *((UINT32*)(b+ 4)) = *((UINT32*)T5[temp[1][0]]) - ^ *((UINT32*)T6[temp[0][1]]) - ^ *((UINT32*)T7[temp[3][2]]) - ^ *((UINT32*)T8[temp[2][3]]); - *((UINT32*)(b+ 8)) = *((UINT32*)T5[temp[2][0]]) - ^ *((UINT32*)T6[temp[1][1]]) - ^ *((UINT32*)T7[temp[0][2]]) - ^ *((UINT32*)T8[temp[3][3]]); - *((UINT32*)(b+12)) = *((UINT32*)T5[temp[3][0]]) - ^ *((UINT32*)T6[temp[2][1]]) - ^ *((UINT32*)T7[temp[1][2]]) - ^ *((UINT32*)T8[temp[0][3]]); + *((UINT32 *)temp[0]) = *((UINT32 *)(b)) ^ *((UINT32 *)m_expandedKey[r][0]); + *((UINT32 *)temp[1]) = *((UINT32 *)(b + 4)) ^ *((UINT32 *)m_expandedKey[r][1]); + *((UINT32 *)temp[2]) = *((UINT32 *)(b + 8)) ^ *((UINT32 *)m_expandedKey[r][2]); + *((UINT32 *)temp[3]) = *((UINT32 *)(b + 12)) ^ *((UINT32 *)m_expandedKey[r][3]); + *((UINT32 *)(b)) = *((UINT32 *)T5[temp[0][0]]) + ^ *((UINT32 *)T6[temp[3][1]]) + ^ *((UINT32 *)T7[temp[2][2]]) + ^ *((UINT32 *)T8[temp[1][3]]); + *((UINT32 *)(b + 4)) = *((UINT32 *)T5[temp[1][0]]) + ^ *((UINT32 *)T6[temp[0][1]]) + ^ *((UINT32 *)T7[temp[3][2]]) + ^ *((UINT32 *)T8[temp[2][3]]); + *((UINT32 *)(b + 8)) = *((UINT32 *)T5[temp[2][0]]) + ^ *((UINT32 *)T6[temp[1][1]]) + ^ *((UINT32 *)T7[temp[0][2]]) + ^ *((UINT32 *)T8[temp[3][3]]); + *((UINT32 *)(b + 12)) = *((UINT32 *)T5[temp[3][0]]) + ^ *((UINT32 *)T6[temp[2][1]]) + ^ *((UINT32 *)T7[temp[1][2]]) + ^ *((UINT32 *)T8[temp[0][3]]); } - *((UINT32*)temp[0]) = *((UINT32*)(b )) ^ *((UINT32*)m_expandedKey[1][0]); - *((UINT32*)temp[1]) = *((UINT32*)(b+ 4)) ^ *((UINT32*)m_expandedKey[1][1]); - *((UINT32*)temp[2]) = *((UINT32*)(b+ 8)) ^ *((UINT32*)m_expandedKey[1][2]); - *((UINT32*)temp[3]) = *((UINT32*)(b+12)) ^ *((UINT32*)m_expandedKey[1][3]); - b[ 0] = S5[temp[0][0]]; - b[ 1] = S5[temp[3][1]]; - b[ 2] = S5[temp[2][2]]; - b[ 3] = S5[temp[1][3]]; - b[ 4] = S5[temp[1][0]]; - b[ 5] = S5[temp[0][1]]; - b[ 6] = S5[temp[3][2]]; - b[ 7] = S5[temp[2][3]]; - b[ 8] = S5[temp[2][0]]; - b[ 9] = S5[temp[1][1]]; + *((UINT32 *)temp[0]) = *((UINT32 *)(b)) ^ *((UINT32 *)m_expandedKey[1][0]); + *((UINT32 *)temp[1]) = *((UINT32 *)(b + 4)) ^ *((UINT32 *)m_expandedKey[1][1]); + *((UINT32 *)temp[2]) = *((UINT32 *)(b + 8)) ^ *((UINT32 *)m_expandedKey[1][2]); + *((UINT32 *)temp[3]) = *((UINT32 *)(b + 12)) ^ *((UINT32 *)m_expandedKey[1][3]); + b[0] = S5[temp[0][0]]; + b[1] = S5[temp[3][1]]; + b[2] = S5[temp[2][2]]; + b[3] = S5[temp[1][3]]; + b[4] = S5[temp[1][0]]; + b[5] = S5[temp[0][1]]; + b[6] = S5[temp[3][2]]; + b[7] = S5[temp[2][3]]; + b[8] = S5[temp[2][0]]; + b[9] = S5[temp[1][1]]; b[10] = S5[temp[0][2]]; b[11] = S5[temp[3][3]]; b[12] = S5[temp[3][0]]; b[13] = S5[temp[2][1]]; b[14] = S5[temp[1][2]]; b[15] = S5[temp[0][3]]; - *((UINT32*)(b )) ^= *((UINT32*)m_expandedKey[0][0]); - *((UINT32*)(b+ 4)) ^= *((UINT32*)m_expandedKey[0][1]); - *((UINT32*)(b+ 8)) ^= *((UINT32*)m_expandedKey[0][2]); - *((UINT32*)(b+12)) ^= *((UINT32*)m_expandedKey[0][3]); + *((UINT32 *)(b)) ^= *((UINT32 *)m_expandedKey[0][0]); + *((UINT32 *)(b + 4)) ^= *((UINT32 *)m_expandedKey[0][1]); + *((UINT32 *)(b + 8)) ^= *((UINT32 *)m_expandedKey[0][2]); + *((UINT32 *)(b + 12)) ^= *((UINT32 *)m_expandedKey[0][3]); } #endif // COMPILE_CRYPT_SUPPORT diff --git a/src/modules/rijndael/Rijndael.h b/src/modules/rijndael/Rijndael.h index 7a3faed10..6905397e9 100644 --- a/src/modules/rijndael/Rijndael.h +++ b/src/modules/rijndael/Rijndael.h @@ -84,15 +84,15 @@ #if defined(COMPILE_CRYPT_SUPPORT) || defined(Q_MOC_RUN) -#define _MAX_KEY_COLUMNS (256/32) -#define _MAX_ROUNDS 14 +#define _MAX_KEY_COLUMNS (256 / 32) +#define _MAX_ROUNDS 14 //#define BITSPERBLOCK 128 /* Default number of bits in a cipher block */ -#define MAX_IV_SIZE 16 +#define MAX_IV_SIZE 16 #define STRICT_ALIGN 0 // We assume that unsigned int is 32 bits long.... -typedef unsigned char UINT8; -typedef unsigned int UINT32; +typedef unsigned char UINT8; +typedef unsigned int UINT32; typedef unsigned short UINT16; #define RIJNDAEL_SUCCESS 0 @@ -107,42 +107,63 @@ typedef unsigned short UINT16; class Rijndael { public: - enum Direction { Encrypt, Decrypt }; - enum Mode { ECB, CBC, CFB1 }; - enum KeyLength { Key16Bytes, Key24Bytes, Key32Bytes }; + enum Direction + { + Encrypt, + Decrypt + }; + enum Mode + { + ECB, + CBC, + CFB1 + }; + enum KeyLength + { + Key16Bytes, + Key24Bytes, + Key32Bytes + }; Rijndael(); ~Rijndael(); + protected: - enum State { Valid, Invalid }; + enum State + { + Valid, + Invalid + }; - State m_state; - Mode m_mode; + State m_state; + Mode m_mode; Direction m_direction; - UINT8 m_initVector[MAX_IV_SIZE]; - UINT32 m_uRounds; - UINT8 m_expandedKey[_MAX_ROUNDS+1][4][4]; + UINT8 m_initVector[MAX_IV_SIZE]; + UINT32 m_uRounds; + UINT8 m_expandedKey[_MAX_ROUNDS + 1][4][4]; + public: // Initializes the crypt session // Returns RIJNDAEL_SUCCESS or an error code - int init(Mode mode,Direction dir,const UINT8 *key,KeyLength keyLen,UINT8 * initVector = 0); + int init(Mode mode, Direction dir, const UINT8 * key, KeyLength keyLen, UINT8 * initVector = 0); // Input len is in BITS! // Encrypts inputLen / 128 blocks of input and puts it in outBuffer // outBuffer must be at least inputLen / 8 bytes long. // Returns the encrypted buffer length in BITS or an error code < 0 in case of error - int blockEncrypt(const UINT8 *input, int inputLen, UINT8 *outBuffer, UINT8 * initVector = 0); + int blockEncrypt(const UINT8 * input, int inputLen, UINT8 * outBuffer, UINT8 * initVector = 0); // Input len is in BYTES! // outBuffer must be at least inputLen + 16 bytes long // Returns the encrypted buffer length in BYTES or an error code < 0 in case of error - int padEncrypt(const UINT8 *input, int inputOctets, UINT8 *outBuffer, UINT8 * initVector = 0); + int padEncrypt(const UINT8 * input, int inputOctets, UINT8 * outBuffer, UINT8 * initVector = 0); // Input len is in BITS! // outBuffer must be at least inputLen / 8 bytes long // Returns the decrypted buffer length in BITS and an error code < 0 in case of error - int blockDecrypt(const UINT8 *input, int inputLen, UINT8 *outBuffer, UINT8 * initVector = 0); + int blockDecrypt(const UINT8 * input, int inputLen, UINT8 * outBuffer, UINT8 * initVector = 0); // Input len is in BYTES! // outBuffer must be at least inputLen bytes long // Returns the decrypted buffer length in BYTES and an error code < 0 in case of error - int padDecrypt(const UINT8 *input, int inputOctets, UINT8 *outBuffer, UINT8 * initVector = 0); + int padDecrypt(const UINT8 * input, int inputOctets, UINT8 * outBuffer, UINT8 * initVector = 0); + protected: void keySched(UINT8 key[_MAX_KEY_COLUMNS][4]); void keyEncToDec(); diff --git a/src/modules/rijndael/UglyBase64.cpp b/src/modules/rijndael/UglyBase64.cpp index 604aaf6b0..ec1248222 100644 --- a/src/modules/rijndael/UglyBase64.cpp +++ b/src/modules/rijndael/UglyBase64.cpp @@ -28,9 +28,9 @@ namespace UglyBase64 { - static unsigned char fake_base64[]="./0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; + static unsigned char fake_base64[] = "./0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; - void byteswap_buffer(unsigned char * p,int len) + void byteswap_buffer(unsigned char * p, int len) { while(len > 0) { @@ -48,14 +48,16 @@ namespace UglyBase64 unsigned int fake_base64dec(unsigned char c) { static char base64unmap[255]; - static bool didinit=false; + static bool didinit = false; if(!didinit) { // initialize base64unmap - for (int i=0;i<255;++i)base64unmap[i]=0; - for (int i=0;i<64;++i)base64unmap[fake_base64[i]]=i; - didinit=true; + for(int i = 0; i < 255; ++i) + base64unmap[i] = 0; + for(int i = 0; i < 64; ++i) + base64unmap[fake_base64[i]] = i; + didinit = true; } return base64unmap[c]; @@ -80,23 +82,33 @@ namespace UglyBase64 outb += 4; quint32 * dd2 = (quint32 *)outb; outb += 4; - *p++ = fake_base64[*dd2 & 0x3f]; *dd2 >>= 6; - *p++ = fake_base64[*dd2 & 0x3f]; *dd2 >>= 6; - *p++ = fake_base64[*dd2 & 0x3f]; *dd2 >>= 6; - *p++ = fake_base64[*dd2 & 0x3f]; *dd2 >>= 6; - *p++ = fake_base64[*dd2 & 0x3f]; *dd2 >>= 6; + *p++ = fake_base64[*dd2 & 0x3f]; + *dd2 >>= 6; + *p++ = fake_base64[*dd2 & 0x3f]; + *dd2 >>= 6; + *p++ = fake_base64[*dd2 & 0x3f]; + *dd2 >>= 6; + *p++ = fake_base64[*dd2 & 0x3f]; + *dd2 >>= 6; + *p++ = fake_base64[*dd2 & 0x3f]; + *dd2 >>= 6; *p++ = fake_base64[*dd2 & 0x3f]; - *p++ = fake_base64[*dd1 & 0x3f]; *dd1 >>= 6; - *p++ = fake_base64[*dd1 & 0x3f]; *dd1 >>= 6; - *p++ = fake_base64[*dd1 & 0x3f]; *dd1 >>= 6; - *p++ = fake_base64[*dd1 & 0x3f]; *dd1 >>= 6; - *p++ = fake_base64[*dd1 & 0x3f]; *dd1 >>= 6; + *p++ = fake_base64[*dd1 & 0x3f]; + *dd1 >>= 6; + *p++ = fake_base64[*dd1 & 0x3f]; + *dd1 >>= 6; + *p++ = fake_base64[*dd1 & 0x3f]; + *dd1 >>= 6; + *p++ = fake_base64[*dd1 & 0x3f]; + *dd1 >>= 6; + *p++ = fake_base64[*dd1 & 0x3f]; + *dd1 >>= 6; *p++ = fake_base64[*dd1 & 0x3f]; } } - void decode(KviCString & szText, unsigned char ** buf, int *len) + void decode(KviCString & szText, unsigned char ** buf, int * len) { // make sure its length is multiple of 12 (eventually pad with zeroes) if(szText.len() % 12) @@ -105,7 +117,8 @@ namespace UglyBase64 szText.setLen(szText.len() + (12 - (szText.len() % 12))); char * padB = szText.ptr() + oldL; char * padE = szText.ptr() + szText.len(); - while(padB < padE)*padB++ = 0; + while(padB < padE) + *padB++ = 0; } *len = (int)(szText.len() * 2) / 3; @@ -122,12 +135,14 @@ namespace UglyBase64 quint32 * dw2 = (quint32 *)bufp; bufp += 4; *dw2 = 0; - for(i=0;i < 6;i++)*dw2 |= (fake_base64dec(*p++)) << (i * 6); + for(i = 0; i < 6; i++) + *dw2 |= (fake_base64dec(*p++)) << (i * 6); *dw1 = 0; - for(i=0;i < 6;i++)*dw1 |= (fake_base64dec(*p++)) << (i * 6); + for(i = 0; i < 6; i++) + *dw1 |= (fake_base64dec(*p++)) << (i * 6); } // FIXME: this is probably needed only on LittleEndian machines! - byteswap_buffer(*buf,*len); + byteswap_buffer(*buf, *len); } }; diff --git a/src/modules/rijndael/UglyBase64.h b/src/modules/rijndael/UglyBase64.h index aab8bcfbb..75e277f63 100644 --- a/src/modules/rijndael/UglyBase64.h +++ b/src/modules/rijndael/UglyBase64.h @@ -32,6 +32,6 @@ class KviCString; namespace UglyBase64 { extern void encode(const unsigned char * out, const int len, KviCString & szText); - extern void decode(KviCString & szText, unsigned char ** buf, int *len); + extern void decode(KviCString & szText, unsigned char ** buf, int * len); }; #endif //!_UGLYBASE64_H_ diff --git a/src/modules/rijndael/libkvirijndael.cpp b/src/modules/rijndael/libkvirijndael.cpp index f0cc5a81f..ef57e5431 100644 --- a/src/modules/rijndael/libkvirijndael.cpp +++ b/src/modules/rijndael/libkvirijndael.cpp @@ -60,457 +60,502 @@ conversions. */ - - #if defined(COMPILE_CRYPT_SUPPORT) || defined(Q_MOC_RUN) - #include "KviMemory.h" - #include "KviPointerList.h" - #include "KviCryptEngineDescription.h" +#include "KviMemory.h" +#include "KviPointerList.h" +#include "KviCryptEngineDescription.h" - static KviPointerList * g_pEngineList = 0; +static KviPointerList * g_pEngineList = 0; + +KviRijndaelEngine::KviRijndaelEngine() + : KviCryptEngine() +{ + g_pEngineList->append(this); + m_pEncryptCipher = 0; + m_pDecryptCipher = 0; +} +KviRijndaelEngine::~KviRijndaelEngine() +{ + g_pEngineList->removeRef(this); + if(m_pEncryptCipher) + delete m_pEncryptCipher; + if(m_pDecryptCipher) + delete m_pDecryptCipher; +} - KviRijndaelEngine::KviRijndaelEngine() - : KviCryptEngine() +bool KviRijndaelEngine::init(const char * encKey, int encKeyLen, const char * decKey, int decKeyLen) +{ + if(m_pEncryptCipher) { - g_pEngineList->append(this); + delete m_pEncryptCipher; m_pEncryptCipher = 0; + } + if(m_pDecryptCipher) + { + delete m_pDecryptCipher; m_pDecryptCipher = 0; } - KviRijndaelEngine::~KviRijndaelEngine() + if(encKey && (encKeyLen > 0)) { - g_pEngineList->removeRef(this); - if(m_pEncryptCipher)delete m_pEncryptCipher; - if(m_pDecryptCipher)delete m_pDecryptCipher; + if(!(decKey && (decKeyLen > 0))) + { + decKey = encKey; + decKeyLen = encKeyLen; + } // else all } - - bool KviRijndaelEngine::init(const char *encKey,int encKeyLen,const char *decKey,int decKeyLen) + else { - if(m_pEncryptCipher) + // no encrypt key specified... + if(decKey && decKeyLen) { - delete m_pEncryptCipher; - m_pEncryptCipher = 0; + encKey = decKey; + encKeyLen = decKeyLen; } - if(m_pDecryptCipher) + else { - delete m_pDecryptCipher; - m_pDecryptCipher = 0; + // both keys missing + setLastError(__tr2qs("Missing both encryption and decryption key: at least one is needed")); + return false; } + } - if(encKey && (encKeyLen > 0)) - { - if(!(decKey && (decKeyLen > 0))) - { - decKey = encKey; - decKeyLen = encKeyLen; - } // else all - } else { - // no encrypt key specified... - if(decKey && decKeyLen) - { - encKey = decKey; - encKeyLen = decKeyLen; - } else { - // both keys missing - setLastError(__tr2qs("Missing both encryption and decryption key: at least one is needed")); - return false; - } - } + KviCString szTmpEncryptKey = KviCString(encKey, encKeyLen); + KviCString szTmpDecryptKey = KviCString(decKey, decKeyLen); - KviCString szTmpEncryptKey = KviCString(encKey,encKeyLen); - KviCString szTmpDecryptKey = KviCString(decKey,decKeyLen); + m_bEncryptMode = CBC; // default mode + m_bDecryptMode = CBC; // default mode - m_bEncryptMode = CBC; // default mode - m_bDecryptMode = CBC; // default mode + if(kvi_strEqualCIN("ecb:", szTmpEncryptKey.ptr(), 4) && (szTmpEncryptKey.len() > 4)) + { + szTmpEncryptKey.cutLeft(4); + m_bEncryptMode = ECB; + } + else if(kvi_strEqualCIN("old:", szTmpEncryptKey.ptr(), 4) && (szTmpEncryptKey.len() > 4)) + { + szTmpEncryptKey.cutLeft(4); + m_bEncryptMode = OldCBC; + } + else if(kvi_strEqualCIN("cbc:", szTmpEncryptKey.ptr(), 4) && (szTmpEncryptKey.len() > 4)) + { + szTmpEncryptKey.cutLeft(4); + } - if(kvi_strEqualCIN("ecb:",szTmpEncryptKey.ptr(),4) && (szTmpEncryptKey.len() > 4)) - { - szTmpEncryptKey.cutLeft(4); - m_bEncryptMode = ECB; - } else if(kvi_strEqualCIN("old:",szTmpEncryptKey.ptr(),4) && (szTmpEncryptKey.len() > 4)) { - szTmpEncryptKey.cutLeft(4); - m_bEncryptMode = OldCBC; - } else if(kvi_strEqualCIN("cbc:",szTmpEncryptKey.ptr(),4) && (szTmpEncryptKey.len() > 4)) { - szTmpEncryptKey.cutLeft(4); - } + if(kvi_strEqualCIN("ecb:", szTmpDecryptKey.ptr(), 4) && (szTmpDecryptKey.len() > 4)) + { + szTmpDecryptKey.cutLeft(4); + m_bDecryptMode = ECB; + } + else if(kvi_strEqualCIN("old:", szTmpDecryptKey.ptr(), 4) && (szTmpDecryptKey.len() > 4)) + { + szTmpDecryptKey.cutLeft(4); + m_bDecryptMode = OldCBC; + } + else if(kvi_strEqualCIN("cbc:", szTmpDecryptKey.ptr(), 4) && (szTmpDecryptKey.len() > 4)) + { + szTmpDecryptKey.cutLeft(4); + } - if(kvi_strEqualCIN("ecb:",szTmpDecryptKey.ptr(),4) && (szTmpDecryptKey.len() > 4)) - { - szTmpDecryptKey.cutLeft(4); - m_bDecryptMode = ECB; - } else if(kvi_strEqualCIN("old:",szTmpDecryptKey.ptr(),4) && (szTmpDecryptKey.len() > 4)) { - szTmpDecryptKey.cutLeft(4); - m_bDecryptMode = OldCBC; - } else if(kvi_strEqualCIN("cbc:",szTmpDecryptKey.ptr(),4) && (szTmpDecryptKey.len() > 4)) { - szTmpDecryptKey.cutLeft(4); - } + int defLen = getKeyLen(); - int defLen = getKeyLen(); + szTmpEncryptKey.padRight(defLen); + szTmpDecryptKey.padRight(defLen); - szTmpEncryptKey.padRight(defLen); - szTmpDecryptKey.padRight(defLen); + m_pEncryptCipher = new Rijndael(); - m_pEncryptCipher = new Rijndael(); + int retVal = m_pEncryptCipher->init( + (m_bEncryptMode == ECB) ? Rijndael::ECB : Rijndael::CBC, + Rijndael::Encrypt, + (unsigned char *)szTmpEncryptKey.ptr(), + getKeyLenId()); + if(retVal != RIJNDAEL_SUCCESS) + { + delete m_pEncryptCipher; + m_pEncryptCipher = 0; + setLastErrorFromRijndaelErrorCode(retVal); + return false; + } - int retVal = m_pEncryptCipher->init( - (m_bEncryptMode == ECB) ? Rijndael::ECB : Rijndael::CBC, - Rijndael::Encrypt, - (unsigned char *)szTmpEncryptKey.ptr(), - getKeyLenId()); - if(retVal != RIJNDAEL_SUCCESS) - { - delete m_pEncryptCipher; - m_pEncryptCipher = 0; - setLastErrorFromRijndaelErrorCode(retVal); - return false; - } + m_pDecryptCipher = new Rijndael(); + retVal = m_pDecryptCipher->init( + (m_bEncryptMode == ECB) ? Rijndael::ECB : Rijndael::CBC, + Rijndael::Decrypt, + (unsigned char *)szTmpDecryptKey.ptr(), + getKeyLenId()); + if(retVal != RIJNDAEL_SUCCESS) + { + delete m_pEncryptCipher; + m_pEncryptCipher = 0; + delete m_pDecryptCipher; + m_pDecryptCipher = 0; + setLastErrorFromRijndaelErrorCode(retVal); + return false; + } - m_pDecryptCipher = new Rijndael(); - retVal = m_pDecryptCipher->init( - (m_bEncryptMode == ECB) ? Rijndael::ECB : Rijndael::CBC, - Rijndael::Decrypt, - (unsigned char *)szTmpDecryptKey.ptr(), - getKeyLenId()); - if(retVal != RIJNDAEL_SUCCESS) - { - delete m_pEncryptCipher; - m_pEncryptCipher = 0; - delete m_pDecryptCipher; - m_pDecryptCipher = 0; - setLastErrorFromRijndaelErrorCode(retVal); - return false; - } + return true; +} - return true; +void KviRijndaelEngine::setLastErrorFromRijndaelErrorCode(int errCode) +{ + switch(errCode) + { + case RIJNDAEL_SUCCESS: + setLastError(__tr2qs("Error 0: success?")); + break; + case RIJNDAEL_UNSUPPORTED_MODE: + setLastError(__tr2qs("Unsupported encryption mode")); + break; + case RIJNDAEL_UNSUPPORTED_DIRECTION: + setLastError(__tr2qs("Unsupported direction")); + break; + case RIJNDAEL_UNSUPPORTED_KEY_LENGTH: + setLastError(__tr2qs("Unsupported key length")); + break; + case RIJNDAEL_BAD_KEY: + setLastError(__tr2qs("Bad key data")); + break; + case RIJNDAEL_NOT_INITIALIZED: + setLastError(__tr2qs("Engine not initialized")); + break; + case RIJNDAEL_BAD_DIRECTION: + setLastError(__tr2qs("Invalid direction for this engine")); + break; + case RIJNDAEL_CORRUPTED_DATA: + setLastError(__tr2qs("Corrupted message data or invalid decryption key")); + break; + default: + setLastError(__tr2qs("Unknown error")); + break; } +} - void KviRijndaelEngine::setLastErrorFromRijndaelErrorCode(int errCode) +KviCryptEngine::EncryptResult KviRijndaelEngine::encrypt(const char * plainText, KviCString & outBuffer) +{ + if(!m_pEncryptCipher) { - switch(errCode) - { - case RIJNDAEL_SUCCESS: setLastError(__tr2qs("Error 0: success?")); break; - case RIJNDAEL_UNSUPPORTED_MODE: setLastError(__tr2qs("Unsupported encryption mode")); break; - case RIJNDAEL_UNSUPPORTED_DIRECTION: setLastError(__tr2qs("Unsupported direction")); break; - case RIJNDAEL_UNSUPPORTED_KEY_LENGTH: setLastError(__tr2qs("Unsupported key length")); break; - case RIJNDAEL_BAD_KEY: setLastError(__tr2qs("Bad key data")); break; - case RIJNDAEL_NOT_INITIALIZED: setLastError(__tr2qs("Engine not initialized")); break; - case RIJNDAEL_BAD_DIRECTION: setLastError(__tr2qs("Invalid direction for this engine")); break; - case RIJNDAEL_CORRUPTED_DATA: setLastError(__tr2qs("Corrupted message data or invalid decryption key")); break; - default: setLastError(__tr2qs("Unknown error")); break; - } + setLastError(__tr2qs("Oops! Encryption cipher not initialized")); + return KviCryptEngine::EncryptError; + } + int len = (int)kvi_strLen(plainText); + char * buf = (char *)KviMemory::allocate(len + 16); // needed for the eventual padding + unsigned char * iv = 0; + if(m_bEncryptMode == CBC) + { + iv = (unsigned char *)KviMemory::allocate(MAX_IV_SIZE); + InitVectorEngine::fillRandomIV(iv, MAX_IV_SIZE); } - KviCryptEngine::EncryptResult KviRijndaelEngine::encrypt(const char * plainText,KviCString &outBuffer) + int retVal = m_pEncryptCipher->padEncrypt((const unsigned char *)plainText, len, (unsigned char *)buf, iv); + if(retVal < 0) { - if(!m_pEncryptCipher) - { - setLastError(__tr2qs("Oops! Encryption cipher not initialized")); - return KviCryptEngine::EncryptError; - } - int len = (int)kvi_strLen(plainText); - char * buf = (char *)KviMemory::allocate(len + 16); // needed for the eventual padding - unsigned char * iv = 0; - if(m_bEncryptMode == CBC) - { - iv = (unsigned char *)KviMemory::allocate(MAX_IV_SIZE); - InitVectorEngine::fillRandomIV(iv, MAX_IV_SIZE); - } + KviMemory::free(buf); + setLastErrorFromRijndaelErrorCode(retVal); + return KviCryptEngine::EncryptError; + } - int retVal = m_pEncryptCipher->padEncrypt((const unsigned char *)plainText,len,(unsigned char *)buf, iv); - if(retVal < 0) - { - KviMemory::free(buf); - setLastErrorFromRijndaelErrorCode(retVal); - return KviCryptEngine::EncryptError; - } + if(m_bEncryptMode == CBC) + { + // prepend the iv to the cyphered text + buf = (char *)KviMemory::reallocate(buf, retVal + MAX_IV_SIZE); + KviMemory::move(buf + MAX_IV_SIZE, buf, retVal); + KviMemory::move(buf, iv, MAX_IV_SIZE); + KviMemory::free(iv); + retVal += MAX_IV_SIZE; + } - if(m_bEncryptMode == CBC) - { - // prepend the iv to the cyphered text - buf = (char*) KviMemory::reallocate(buf, retVal + MAX_IV_SIZE); - KviMemory::move(buf + MAX_IV_SIZE, buf, retVal); - KviMemory::move(buf, iv, MAX_IV_SIZE); - KviMemory::free(iv); - retVal+=MAX_IV_SIZE; - } + if(!binaryToAscii(buf, retVal, outBuffer)) + { + KviMemory::free(buf); + return KviCryptEngine::EncryptError; + } + KviMemory::free(buf); - if(!binaryToAscii(buf,retVal,outBuffer)) + if(outBuffer.len() > maxEncryptLen()) + { + if(maxEncryptLen() > 0) { - KviMemory::free(buf); + setLastError(__tr2qs("Data buffer too long")); return KviCryptEngine::EncryptError; } - KviMemory::free(buf); + } + outBuffer.prepend(KviControlCodes::CryptEscape); + return KviCryptEngine::Encrypted; +} - if(outBuffer.len() > maxEncryptLen()) - { - if(maxEncryptLen() > 0) - { - setLastError(__tr2qs("Data buffer too long")); - return KviCryptEngine::EncryptError; - } - } - outBuffer.prepend(KviControlCodes::CryptEscape); - return KviCryptEngine::Encrypted; +KviCryptEngine::DecryptResult KviRijndaelEngine::decrypt(const char * inBuffer, KviCString & plainText) +{ + if(!m_pDecryptCipher) + { + setLastError(__tr2qs("Oops! Decryption cipher not initialized")); + return KviCryptEngine::DecryptError; } - KviCryptEngine::DecryptResult KviRijndaelEngine::decrypt(const char * inBuffer,KviCString &plainText) + if(*inBuffer != KviControlCodes::CryptEscape) { - if(!m_pDecryptCipher) - { - setLastError(__tr2qs("Oops! Decryption cipher not initialized")); - return KviCryptEngine::DecryptError; - } + plainText = inBuffer; + return KviCryptEngine::DecryptOkWasPlainText; + } - if(*inBuffer != KviControlCodes::CryptEscape) - { - plainText = inBuffer; - return KviCryptEngine::DecryptOkWasPlainText; - } + inBuffer++; - inBuffer++; + if(!*inBuffer) + { + plainText = inBuffer; + return KviCryptEngine::DecryptOkWasPlainText; // empty buffer + } - if(!*inBuffer) - { - plainText = inBuffer; - return KviCryptEngine::DecryptOkWasPlainText; // empty buffer - } + int len; + char * binary; - int len; - char * binary; + if(!asciiToBinary(inBuffer, &len, &binary)) + return KviCryptEngine::DecryptError; - if(!asciiToBinary(inBuffer,&len,&binary))return KviCryptEngine::DecryptError; + char * buf = (char *)KviMemory::allocate(len + 1); + unsigned char * iv = 0; + if(m_bEncryptMode == CBC) + { + // extract the IV from the cyphered string + len -= MAX_IV_SIZE; + iv = (unsigned char *)KviMemory::allocate(MAX_IV_SIZE); + KviMemory::move(iv, binary, MAX_IV_SIZE); + KviMemory::move(binary, binary + MAX_IV_SIZE, len); + binary = (char *)KviMemory::reallocate(binary, len); + } - char * buf = (char *)KviMemory::allocate(len + 1); - unsigned char * iv = 0; - if(m_bEncryptMode == CBC) - { - // extract the IV from the cyphered string - len-=MAX_IV_SIZE; - iv = (unsigned char *)KviMemory::allocate(MAX_IV_SIZE); - KviMemory::move(iv, binary, MAX_IV_SIZE); - KviMemory::move(binary, binary + MAX_IV_SIZE, len); - binary = (char*) KviMemory::reallocate(binary, len); - } + int retVal = m_pDecryptCipher->padDecrypt((const unsigned char *)binary, len, (unsigned char *)buf, iv); + KviMemory::free(binary); + KviMemory::free(iv); - int retVal = m_pDecryptCipher->padDecrypt((const unsigned char *)binary,len,(unsigned char *)buf, iv); - KviMemory::free(binary); - KviMemory::free(iv); + if(retVal < 0) + { + KviMemory::free(buf); + setLastErrorFromRijndaelErrorCode(retVal); + return KviCryptEngine::DecryptError; + } - if(retVal < 0) - { - KviMemory::free(buf); - setLastErrorFromRijndaelErrorCode(retVal); - return KviCryptEngine::DecryptError; - } + buf[retVal] = '\0'; - buf[retVal] = '\0'; + plainText = buf; - plainText = buf; + KviMemory::free(buf); + return KviCryptEngine::DecryptOkWasEncrypted; +} - KviMemory::free(buf); - return KviCryptEngine::DecryptOkWasEncrypted; - } +bool KviRijndaelHexEngine::binaryToAscii(const char * inBuffer, int len, KviCString & outBuffer) +{ + outBuffer.bufferToHex(inBuffer, len); + return true; +} - bool KviRijndaelHexEngine::binaryToAscii(const char * inBuffer,int len,KviCString &outBuffer) +bool KviRijndaelHexEngine::asciiToBinary(const char * inBuffer, int * len, char ** outBuffer) +{ + KviCString hex(inBuffer); + char * tmpBuf; + *len = hex.hexToBuffer(&tmpBuf, false); + if(*len < 0) { - outBuffer.bufferToHex(inBuffer,len); - return true; + setLastError(__tr2qs("The message is not a hexadecimal string: this is not my stuff")); + return false; } - - bool KviRijndaelHexEngine::asciiToBinary(const char * inBuffer,int * len,char ** outBuffer) + else { - KviCString hex(inBuffer); - char * tmpBuf; - *len = hex.hexToBuffer(&tmpBuf,false); - if(*len < 0) + if(len > 0) { - setLastError(__tr2qs("The message is not a hexadecimal string: this is not my stuff")); - return false; - } else { - if(len > 0) - { - *outBuffer = (char *)KviMemory::allocate(*len); - KviMemory::move(*outBuffer,tmpBuf,*len); - KviCString::freeBuffer(tmpBuf); - } + *outBuffer = (char *)KviMemory::allocate(*len); + KviMemory::move(*outBuffer, tmpBuf, *len); + KviCString::freeBuffer(tmpBuf); } - return true; } + return true; +} - bool KviRijndaelBase64Engine::binaryToAscii(const char * inBuffer,int len,KviCString &outBuffer) +bool KviRijndaelBase64Engine::binaryToAscii(const char * inBuffer, int len, KviCString & outBuffer) +{ + outBuffer.bufferToBase64(inBuffer, len); + return true; +} + +bool KviRijndaelBase64Engine::asciiToBinary(const char * inBuffer, int * len, char ** outBuffer) +{ + KviCString base64(inBuffer); + char * tmpBuf; + *len = base64.base64ToBuffer(&tmpBuf, false); + if(*len < 0) { - outBuffer.bufferToBase64(inBuffer,len); - return true; + setLastError(__tr2qs("The message is not a base64 string: this is not my stuff")); + return false; } - - bool KviRijndaelBase64Engine::asciiToBinary(const char * inBuffer,int * len,char ** outBuffer) + else { - KviCString base64(inBuffer); - char * tmpBuf; - *len = base64.base64ToBuffer(&tmpBuf,false); - if(*len < 0) + if(len > 0) { - setLastError(__tr2qs("The message is not a base64 string: this is not my stuff")); - return false; - } else { - if(len > 0) - { - *outBuffer = (char *)KviMemory::allocate(*len); - KviMemory::move(*outBuffer,tmpBuf,*len); - KviCString::freeBuffer(tmpBuf); - } + *outBuffer = (char *)KviMemory::allocate(*len); + KviMemory::move(*outBuffer, tmpBuf, *len); + KviCString::freeBuffer(tmpBuf); } - return true; } + return true; +} - static KviCryptEngine * allocRijndael128HexEngine() - { - return new KviRijndael128HexEngine(); - } +static KviCryptEngine * allocRijndael128HexEngine() +{ + return new KviRijndael128HexEngine(); +} + +static KviCryptEngine * allocRijndael192HexEngine() +{ + return new KviRijndael192HexEngine(); +} + +static KviCryptEngine * allocRijndael256HexEngine() +{ + return new KviRijndael256HexEngine(); +} + +static KviCryptEngine * allocRijndael128Base64Engine() +{ + return new KviRijndael128Base64Engine(); +} + +static KviCryptEngine * allocRijndael192Base64Engine() +{ + return new KviRijndael192Base64Engine(); +} + +static KviCryptEngine * allocRijndael256Base64Engine() +{ + return new KviRijndael256Base64Engine(); +} + +static void deallocRijndaelCryptEngine(KviCryptEngine * e) +{ + delete e; +} + +// Mircryption stuff + +#include "BlowFish.h" + +KviMircryptionEngine::KviMircryptionEngine() + : KviCryptEngine() +{ + g_pEngineList->append(this); +} - static KviCryptEngine * allocRijndael192HexEngine() +KviMircryptionEngine::~KviMircryptionEngine() +{ + g_pEngineList->removeRef(this); +} + +bool KviMircryptionEngine::init(const char * encKey, int encKeyLen, const char * decKey, int decKeyLen) +{ + if(encKey && (encKeyLen > 0)) { - return new KviRijndael192HexEngine(); + if(!(decKey && (decKeyLen > 0))) + { + decKey = encKey; + decKeyLen = encKeyLen; + } // else all } - - static KviCryptEngine * allocRijndael256HexEngine() + else { - return new KviRijndael256HexEngine(); + // no encrypt key specified... + if(decKey && decKeyLen) + { + encKey = decKey; + encKeyLen = decKeyLen; + } + else + { + // both keys missing + setLastError(__tr2qs("Missing both encryption and decryption key: at least one is needed")); + return false; + } } + m_szEncryptKey = KviCString(encKey, encKeyLen); + m_szDecryptKey = KviCString(decKey, decKeyLen); + + m_bEncryptCBC = true; + m_bDecryptCBC = true; - static KviCryptEngine * allocRijndael128Base64Engine() + if((kvi_strEqualCIN("ecb:", m_szEncryptKey.ptr(), 4) || kvi_strEqualCIN("old:", m_szEncryptKey.ptr(), 4)) + && (m_szEncryptKey.len() > 4)) { - return new KviRijndael128Base64Engine(); + m_bEncryptCBC = false; + m_szEncryptKey.cutLeft(4); } - - static KviCryptEngine * allocRijndael192Base64Engine() + else if(kvi_strEqualCIN("cbc:", m_szEncryptKey.ptr(), 4) && (m_szEncryptKey.len() > 4)) { - return new KviRijndael192Base64Engine(); + m_szEncryptKey.cutLeft(4); } - static KviCryptEngine * allocRijndael256Base64Engine() + if((kvi_strEqualCIN("ecb:", m_szDecryptKey.ptr(), 4) || kvi_strEqualCIN("old:", m_szDecryptKey.ptr(), 4)) + && (m_szDecryptKey.len() > 4)) { - return new KviRijndael256Base64Engine(); + m_bDecryptCBC = false; + m_szDecryptKey.cutLeft(4); } - - static void deallocRijndaelCryptEngine(KviCryptEngine * e) + else if(kvi_strEqualCIN("cbc:", m_szDecryptKey.ptr(), 4) && (m_szDecryptKey.len() > 4)) { - delete e; + m_szDecryptKey.cutLeft(4); } + return true; +} - // Mircryption stuff - - #include "BlowFish.h" - - KviMircryptionEngine::KviMircryptionEngine() - : KviCryptEngine() +KviCryptEngine::EncryptResult KviMircryptionEngine::encrypt(const char * plainText, KviCString & outBuffer) +{ + KviCString szPlain = plainText; + outBuffer = ""; + if(m_bEncryptCBC) { - g_pEngineList->append(this); + if(!doEncryptCBC(szPlain, outBuffer)) + return KviCryptEngine::EncryptError; } - - KviMircryptionEngine::~KviMircryptionEngine() + else { - g_pEngineList->removeRef(this); + if(!doEncryptECB(szPlain, outBuffer)) + return KviCryptEngine::EncryptError; } + outBuffer.prepend("+OK "); - bool KviMircryptionEngine::init(const char * encKey,int encKeyLen,const char * decKey,int decKeyLen) + if(outBuffer.len() > maxEncryptLen()) { - if(encKey && (encKeyLen > 0)) - { - if(!(decKey && (decKeyLen > 0))) - { - decKey = encKey; - decKeyLen = encKeyLen; - } // else all - } else { - // no encrypt key specified... - if(decKey && decKeyLen) - { - encKey = decKey; - encKeyLen = decKeyLen; - } else { - // both keys missing - setLastError(__tr2qs("Missing both encryption and decryption key: at least one is needed")); - return false; - } - } - m_szEncryptKey = KviCString(encKey,encKeyLen); - m_szDecryptKey = KviCString(decKey,decKeyLen); - - m_bEncryptCBC = true; - m_bDecryptCBC = true; - - if((kvi_strEqualCIN("ecb:",m_szEncryptKey.ptr(),4) || - kvi_strEqualCIN("old:",m_szEncryptKey.ptr(),4)) - && (m_szEncryptKey.len() > 4)) - { - m_bEncryptCBC = false; - m_szEncryptKey.cutLeft(4); - } else if(kvi_strEqualCIN("cbc:",m_szEncryptKey.ptr(),4) && (m_szEncryptKey.len() > 4)) { - m_szEncryptKey.cutLeft(4); - } - - if((kvi_strEqualCIN("ecb:",m_szDecryptKey.ptr(),4) || - kvi_strEqualCIN("old:",m_szDecryptKey.ptr(),4)) - && (m_szDecryptKey.len() > 4)) + if(maxEncryptLen() > 0) { - m_bDecryptCBC = false; - m_szDecryptKey.cutLeft(4); - } else if(kvi_strEqualCIN("cbc:",m_szDecryptKey.ptr(),4) && (m_szDecryptKey.len() > 4)) { - m_szDecryptKey.cutLeft(4); + setLastError(__tr2qs("Data buffer too long")); + return KviCryptEngine::EncryptError; } - - return true; } - KviCryptEngine::EncryptResult KviMircryptionEngine::encrypt(const char * plainText,KviCString &outBuffer) - { - KviCString szPlain = plainText; - outBuffer = ""; - if(m_bEncryptCBC) - { - if(!doEncryptCBC(szPlain,outBuffer))return KviCryptEngine::EncryptError; - } else { - if(!doEncryptECB(szPlain,outBuffer))return KviCryptEngine::EncryptError; - } - outBuffer.prepend("+OK "); - - if(outBuffer.len() > maxEncryptLen()) - { - if(maxEncryptLen() > 0) - { - setLastError(__tr2qs("Data buffer too long")); - return KviCryptEngine::EncryptError; - } - } + //outBuffer = MCPS2_STARTTAG; + //outBuffer += MCPS2_ENDTAG; + return KviCryptEngine::Encrypted; +} - //outBuffer = MCPS2_STARTTAG; - //outBuffer += MCPS2_ENDTAG; - return KviCryptEngine::Encrypted; - } - - KviCryptEngine::DecryptResult KviMircryptionEngine::decrypt(const char * inBuffer,KviCString &plainText) - { - plainText = ""; - KviCString szIn = inBuffer; - // various old versions - if(kvi_strEqualCSN(inBuffer,"mcps ",5)) - szIn.cutLeft(5); - else if(kvi_strEqualCSN(inBuffer,"+OK ",4)) - szIn.cutLeft(4); - else if(kvi_strEqualCSN(inBuffer,"OK ",3)) // some servers strip out the + - szIn.cutLeft(3); - else { - plainText = szIn; - return KviCryptEngine::DecryptOkWasPlainText; - } +KviCryptEngine::DecryptResult KviMircryptionEngine::decrypt(const char * inBuffer, KviCString & plainText) +{ + plainText = ""; + KviCString szIn = inBuffer; + // various old versions + if(kvi_strEqualCSN(inBuffer, "mcps ", 5)) + szIn.cutLeft(5); + else if(kvi_strEqualCSN(inBuffer, "+OK ", 4)) + szIn.cutLeft(4); + else if(kvi_strEqualCSN(inBuffer, "OK ", 3)) // some servers strip out the + + szIn.cutLeft(3); + else + { + plainText = szIn; + return KviCryptEngine::DecryptOkWasPlainText; + } - if(m_bDecryptCBC)return doDecryptCBC(szIn,plainText) ? KviCryptEngine::DecryptOkWasEncrypted : KviCryptEngine::DecryptError; - return doDecryptECB(szIn,plainText) ? KviCryptEngine::DecryptOkWasEncrypted : KviCryptEngine::DecryptError; + if(m_bDecryptCBC) + return doDecryptCBC(szIn, plainText) ? KviCryptEngine::DecryptOkWasEncrypted : KviCryptEngine::DecryptError; + return doDecryptECB(szIn, plainText) ? KviCryptEngine::DecryptOkWasEncrypted : KviCryptEngine::DecryptError; - /* + /* int len1 = kvi_strLen(MCPS2_STARTTAG); int len2 = kvi_strLen(MCPS2_ENDTAG); while(szIn.len() > 0) @@ -535,128 +580,129 @@ szIn.cutLeft(idx + len2); } */ - } +} - bool KviMircryptionEngine::doEncryptECB(KviCString &plain,KviCString &encoded) +bool KviMircryptionEngine::doEncryptECB(KviCString & plain, KviCString & encoded) +{ + // make sure it is a multiple of 8 bytes (eventually pad with zeroes) + if(plain.len() % 8) { - // make sure it is a multiple of 8 bytes (eventually pad with zeroes) - if(plain.len() % 8) - { - int oldL = plain.len(); - plain.setLen(plain.len() + (8 - (plain.len() % 8))); - char * padB = plain.ptr() + oldL; - char * padE = plain.ptr() + plain.len(); - while(padB < padE)*padB++ = 0; - } + int oldL = plain.len(); + plain.setLen(plain.len() + (8 - (plain.len() % 8))); + char * padB = plain.ptr() + oldL; + char * padE = plain.ptr() + plain.len(); + while(padB < padE) + *padB++ = 0; + } - //byteswap_buffer((unsigned char *)plain.ptr(),plain.len()); + //byteswap_buffer((unsigned char *)plain.ptr(),plain.len()); - unsigned char * out =(unsigned char *)KviMemory::allocate(plain.len()); // we use this to avoid endiannes problems + unsigned char * out = (unsigned char *)KviMemory::allocate(plain.len()); // we use this to avoid endiannes problems - BlowFish bf((unsigned char *)m_szEncryptKey.ptr(),m_szEncryptKey.len()); - bf.ResetChain(); - bf.Encrypt((unsigned char *)plain.ptr(),out,plain.len(),BlowFish::ECB); + BlowFish bf((unsigned char *)m_szEncryptKey.ptr(), m_szEncryptKey.len()); + bf.ResetChain(); + bf.Encrypt((unsigned char *)plain.ptr(), out, plain.len(), BlowFish::ECB); - UglyBase64::encode(out, plain.len(), encoded); - KviMemory::free(out); - return true; - } + UglyBase64::encode(out, plain.len(), encoded); + KviMemory::free(out); + return true; +} - bool KviMircryptionEngine::doDecryptECB(KviCString &encoded,KviCString &plain) - { - unsigned char * buf=0; - int len; - UglyBase64::decode(encoded, &buf, &len); +bool KviMircryptionEngine::doDecryptECB(KviCString & encoded, KviCString & plain) +{ + unsigned char * buf = 0; + int len; + UglyBase64::decode(encoded, &buf, &len); - plain.setLen(len); - BlowFish bf((unsigned char *)m_szDecryptKey.ptr(),m_szDecryptKey.len()); - bf.ResetChain(); - bf.Decrypt(buf,(unsigned char *)plain.ptr(),len,BlowFish::ECB); + plain.setLen(len); + BlowFish bf((unsigned char *)m_szDecryptKey.ptr(), m_szDecryptKey.len()); + bf.ResetChain(); + bf.Decrypt(buf, (unsigned char *)plain.ptr(), len, BlowFish::ECB); - KviMemory::free(buf); + KviMemory::free(buf); - return true; - } + return true; +} - bool KviMircryptionEngine::doEncryptCBC(KviCString &plain,KviCString &encoded) +bool KviMircryptionEngine::doEncryptCBC(KviCString & plain, KviCString & encoded) +{ + // make sure it is a multiple of 8 bytes (eventually pad with zeroes) + if(plain.len() % 8) { - // make sure it is a multiple of 8 bytes (eventually pad with zeroes) - if(plain.len() % 8) - { - int oldL = plain.len(); - plain.setLen(plain.len() + (8 - (plain.len() % 8))); - char * padB = plain.ptr() + oldL; - char * padE = plain.ptr() + plain.len(); - while(padB < padE)*padB++ = 0; - } + int oldL = plain.len(); + plain.setLen(plain.len() + (8 - (plain.len() % 8))); + char * padB = plain.ptr() + oldL; + char * padE = plain.ptr() + plain.len(); + while(padB < padE) + *padB++ = 0; + } - int ll = plain.len() + 8; - unsigned char * in = (unsigned char *)KviMemory::allocate(ll); + int ll = plain.len() + 8; + unsigned char * in = (unsigned char *)KviMemory::allocate(ll); - InitVectorEngine::fillRandomIV(in, 8); + InitVectorEngine::fillRandomIV(in, 8); - KviMemory::copy(in+8,plain.ptr(),plain.len()); + KviMemory::copy(in + 8, plain.ptr(), plain.len()); - // encrypt - unsigned char * out = (unsigned char *)KviMemory::allocate(ll); - BlowFish bf((unsigned char *)m_szEncryptKey.ptr(),m_szEncryptKey.len()); - bf.ResetChain(); - bf.Encrypt(in,out,ll,BlowFish::CBC); - KviMemory::free(in); + // encrypt + unsigned char * out = (unsigned char *)KviMemory::allocate(ll); + BlowFish bf((unsigned char *)m_szEncryptKey.ptr(), m_szEncryptKey.len()); + bf.ResetChain(); + bf.Encrypt(in, out, ll, BlowFish::CBC); + KviMemory::free(in); - encoded.bufferToBase64((const char *)out,ll); - KviMemory::free(out); + encoded.bufferToBase64((const char *)out, ll); + KviMemory::free(out); - encoded.prepend('*'); // prepend the signature + encoded.prepend('*'); // prepend the signature - return true; - } + return true; +} - bool KviMircryptionEngine::doDecryptCBC(KviCString &encoded,KviCString &plain) +bool KviMircryptionEngine::doDecryptCBC(KviCString & encoded, KviCString & plain) +{ + if(*(encoded.ptr()) != '*') { - if(*(encoded.ptr()) != '*') - { - qDebug("WARNING: specified a CBC key but the incoming message doesn't seem to be a CBC one"); - return doDecryptECB(encoded,plain); - } - encoded.cutLeft(1); - - char * tmpBuf; - int len = encoded.base64ToBuffer(&tmpBuf,false); - if(len < 0) - { - setLastError(__tr2qs("The message is not a base64 string: this is not my stuff")); - return false; - } - if((len < 8) || (len % 8)) - { - setLastError(__tr2qs("The message doesn't seem to be encoded with CBC Mircryption")); - if(len > 0)KviCString::freeBuffer(tmpBuf); - return false; - } + qDebug("WARNING: specified a CBC key but the incoming message doesn't seem to be a CBC one"); + return doDecryptECB(encoded, plain); + } + encoded.cutLeft(1); - plain.setLen(len); - BlowFish bf((unsigned char *)m_szDecryptKey.ptr(),m_szDecryptKey.len()); - bf.ResetChain(); - bf.Decrypt((unsigned char *)tmpBuf,(unsigned char *)plain.ptr(),len,BlowFish::CBC); + char * tmpBuf; + int len = encoded.base64ToBuffer(&tmpBuf, false); + if(len < 0) + { + setLastError(__tr2qs("The message is not a base64 string: this is not my stuff")); + return false; + } + if((len < 8) || (len % 8)) + { + setLastError(__tr2qs("The message doesn't seem to be encoded with CBC Mircryption")); + if(len > 0) + KviCString::freeBuffer(tmpBuf); + return false; + } - // kill the first 8 bytes (random IV) - plain.cutLeft(8); + plain.setLen(len); + BlowFish bf((unsigned char *)m_szDecryptKey.ptr(), m_szDecryptKey.len()); + bf.ResetChain(); + bf.Decrypt((unsigned char *)tmpBuf, (unsigned char *)plain.ptr(), len, BlowFish::CBC); - KviCString::freeBuffer(tmpBuf); + // kill the first 8 bytes (random IV) + plain.cutLeft(8); - return true; - } + KviCString::freeBuffer(tmpBuf); + return true; +} - static KviCryptEngine * allocMircryptionEngine() - { - return new KviMircryptionEngine(); - } +static KviCryptEngine * allocMircryptionEngine() +{ + return new KviMircryptionEngine(); +} #endif - // ======================================= // module routines // ======================================= @@ -666,14 +712,14 @@ static bool rijndael_module_init(KviModule * m) g_pEngineList = new KviPointerList; g_pEngineList->setAutoDelete(false); - QString szFormat = __tr2qs("Cryptographic engine based on the Advanced Encryption Standard (AES) algorithm called Rijndael. " \ - "
The text is first encrypted with Rijndael and then converted to %1 notation. " \ - "The keys used are %2 bit long and will be padded with zeros if you provide shorter ones. " \ - "If only one key is provided, this engine will use it for both encrypting and decrypting. " \ - "See the Rijndael module documentation for more info on the algorithm used. " \ - "
This engine works in CBC mode by default: other modes are considered INSECURE and should be avoided. " \ - "The old pseudo-CBC mode used in KVIrc < 4.2 is still available prefixing your key(s) with \"old:\"; " \ - "if you want to use ECB mode you must prefix your key(s) with \"ecb:\"."); + QString szFormat = __tr2qs("Cryptographic engine based on the Advanced Encryption Standard (AES) algorithm called Rijndael. " + "
The text is first encrypted with Rijndael and then converted to %1 notation. " + "The keys used are %2 bit long and will be padded with zeros if you provide shorter ones. " + "If only one key is provided, this engine will use it for both encrypting and decrypting. " + "See the Rijndael module documentation for more info on the algorithm used. " + "
This engine works in CBC mode by default: other modes are considered INSECURE and should be avoided. " + "The old pseudo-CBC mode used in KVIrc < 4.2 is still available prefixing your key(s) with \"old:\"; " + "if you want to use ECB mode you must prefix your key(s) with \"ecb:\"."); // FIXME: Maybe convert this repeated code to a function eh ? @@ -681,8 +727,7 @@ static bool rijndael_module_init(KviModule * m) d->m_szName = "Rijndael128Hex"; d->m_szAuthor = "Szymon Stefanek"; d->m_szDescription = QString(szFormat).arg(__tr2qs("hexadecimal")).arg(128); - d->m_iFlags = KviCryptEngine::CanEncrypt | KviCryptEngine::CanDecrypt | - KviCryptEngine::WantEncryptKey | KviCryptEngine::WantDecryptKey; + d->m_iFlags = KviCryptEngine::CanEncrypt | KviCryptEngine::CanDecrypt | KviCryptEngine::WantEncryptKey | KviCryptEngine::WantDecryptKey; d->m_allocFunc = allocRijndael128HexEngine; d->m_deallocFunc = deallocRijndaelCryptEngine; m->registerCryptEngine(d); @@ -691,8 +736,7 @@ static bool rijndael_module_init(KviModule * m) d->m_szName = "Rijndael192Hex"; d->m_szAuthor = "Szymon Stefanek"; d->m_szDescription = QString(szFormat).arg(__tr2qs("hexadecimal")).arg(192); - d->m_iFlags = KviCryptEngine::CanEncrypt | KviCryptEngine::CanDecrypt | - KviCryptEngine::WantEncryptKey | KviCryptEngine::WantDecryptKey; + d->m_iFlags = KviCryptEngine::CanEncrypt | KviCryptEngine::CanDecrypt | KviCryptEngine::WantEncryptKey | KviCryptEngine::WantDecryptKey; d->m_allocFunc = allocRijndael192HexEngine; d->m_deallocFunc = deallocRijndaelCryptEngine; m->registerCryptEngine(d); @@ -701,8 +745,7 @@ static bool rijndael_module_init(KviModule * m) d->m_szName = "Rijndael256Hex"; d->m_szAuthor = "Szymon Stefanek"; d->m_szDescription = QString(szFormat).arg(__tr2qs("hexadecimal")).arg(256); - d->m_iFlags = KviCryptEngine::CanEncrypt | KviCryptEngine::CanDecrypt | - KviCryptEngine::WantEncryptKey | KviCryptEngine::WantDecryptKey; + d->m_iFlags = KviCryptEngine::CanEncrypt | KviCryptEngine::CanDecrypt | KviCryptEngine::WantEncryptKey | KviCryptEngine::WantDecryptKey; d->m_allocFunc = allocRijndael256HexEngine; d->m_deallocFunc = deallocRijndaelCryptEngine; m->registerCryptEngine(d); @@ -711,8 +754,7 @@ static bool rijndael_module_init(KviModule * m) d->m_szName = "Rijndael128Base64"; d->m_szAuthor = "Szymon Stefanek"; d->m_szDescription = QString(szFormat).arg(__tr2qs("base64")).arg(128); - d->m_iFlags = KviCryptEngine::CanEncrypt | KviCryptEngine::CanDecrypt | - KviCryptEngine::WantEncryptKey | KviCryptEngine::WantDecryptKey; + d->m_iFlags = KviCryptEngine::CanEncrypt | KviCryptEngine::CanDecrypt | KviCryptEngine::WantEncryptKey | KviCryptEngine::WantDecryptKey; d->m_allocFunc = allocRijndael128Base64Engine; d->m_deallocFunc = deallocRijndaelCryptEngine; m->registerCryptEngine(d); @@ -721,8 +763,7 @@ static bool rijndael_module_init(KviModule * m) d->m_szName = "Rijndael192Base64"; d->m_szAuthor = "Szymon Stefanek"; d->m_szDescription = QString(szFormat).arg(__tr2qs("base64")).arg(192); - d->m_iFlags = KviCryptEngine::CanEncrypt | KviCryptEngine::CanDecrypt | - KviCryptEngine::WantEncryptKey | KviCryptEngine::WantDecryptKey; + d->m_iFlags = KviCryptEngine::CanEncrypt | KviCryptEngine::CanDecrypt | KviCryptEngine::WantEncryptKey | KviCryptEngine::WantDecryptKey; d->m_allocFunc = allocRijndael192Base64Engine; d->m_deallocFunc = deallocRijndaelCryptEngine; m->registerCryptEngine(d); @@ -731,24 +772,21 @@ static bool rijndael_module_init(KviModule * m) d->m_szName = "Rijndael256Base64"; d->m_szAuthor = "Szymon Stefanek"; d->m_szDescription = QString(szFormat).arg(__tr2qs("base64")).arg(256); - d->m_iFlags = KviCryptEngine::CanEncrypt | KviCryptEngine::CanDecrypt | - KviCryptEngine::WantEncryptKey | KviCryptEngine::WantDecryptKey; + d->m_iFlags = KviCryptEngine::CanEncrypt | KviCryptEngine::CanDecrypt | KviCryptEngine::WantEncryptKey | KviCryptEngine::WantDecryptKey; d->m_allocFunc = allocRijndael256Base64Engine; d->m_deallocFunc = deallocRijndaelCryptEngine; m->registerCryptEngine(d); - d = new KviCryptEngineDescription; d->m_szName = "Mircryption"; d->m_szAuthor = "Szymon Stefanek"; - d->m_szDescription = __tr2qs("Popular cryptographic engine based on the Blowfish encryption algorithm. " \ - "
The text is first encrypted with Blowfish and then converted to base64 notation. " \ - "The keys used have variable length and are specified as character strings. " \ - "You can specify keys long up to 56 bytes (448 bits) by default or change this with /option uintMaximumBlowFishKeySize UINT. " \ - "If only one key is provided, this engine will use it for both encrypting and decrypting. " \ - "
This engine works in CBC mode by default: if you want to use the old and INSECURE ECB mode you must prefix your key(s) with \"ecb:\" or \"old:\"."); - d->m_iFlags = KviCryptEngine::CanEncrypt | KviCryptEngine::CanDecrypt | - KviCryptEngine::WantEncryptKey | KviCryptEngine::WantDecryptKey; + d->m_szDescription = __tr2qs("Popular cryptographic engine based on the Blowfish encryption algorithm. " + "
The text is first encrypted with Blowfish and then converted to base64 notation. " + "The keys used have variable length and are specified as character strings. " + "You can specify keys long up to 56 bytes (448 bits) by default or change this with /option uintMaximumBlowFishKeySize UINT. " + "If only one key is provided, this engine will use it for both encrypting and decrypting. " + "
This engine works in CBC mode by default: if you want to use the old and INSECURE ECB mode you must prefix your key(s) with \"ecb:\" or \"old:\"."); + d->m_iFlags = KviCryptEngine::CanEncrypt | KviCryptEngine::CanDecrypt | KviCryptEngine::WantEncryptKey | KviCryptEngine::WantDecryptKey; d->m_allocFunc = allocMircryptionEngine; d->m_deallocFunc = deallocRijndaelCryptEngine; m->registerCryptEngine(d); @@ -759,7 +797,7 @@ static bool rijndael_module_init(KviModule * m) #endif } -static bool rijndael_module_cleanup(KviModule *m) +static bool rijndael_module_cleanup(KviModule * m) { #ifdef COMPILE_CRYPT_SUPPORT while(g_pEngineList->first()) @@ -786,14 +824,13 @@ static bool rijndael_module_can_unload(KviModule *) // plugin definition structure // ======================================= KVIRC_MODULE( - "Rijndael crypt engine", - "4.0.0", - "Szymon Stefanek \n" \ - "Fabio Bas ", - "Exports the rijndael crypt engine", - rijndael_module_init, - rijndael_module_can_unload, - 0, - rijndael_module_cleanup, - 0 -) + "Rijndael crypt engine", + "4.0.0", + "Szymon Stefanek \n" + "Fabio Bas ", + "Exports the rijndael crypt engine", + rijndael_module_init, + rijndael_module_can_unload, + 0, + rijndael_module_cleanup, + 0) diff --git a/src/modules/rijndael/libkvirijndael.h b/src/modules/rijndael/libkvirijndael.h index b69a02541..ba5f3f2c4 100644 --- a/src/modules/rijndael/libkvirijndael.h +++ b/src/modules/rijndael/libkvirijndael.h @@ -30,150 +30,165 @@ #ifdef COMPILE_CRYPT_SUPPORT - #include "KviCryptEngine.h" - #include "Rijndael.h" - - class KviRijndaelEngine : public KviCryptEngine - { - Q_OBJECT - public: - KviRijndaelEngine(); - virtual ~KviRijndaelEngine(); - private: - enum OperationalMode { - OldCBC = 1, /** Legacy (pre-4.2) mode: CBC with empty IV **/ - CBC = 2, /** CBC mode **/ - ECB = 3 /** ECB mode **/ - }; - Rijndael * m_pEncryptCipher; - Rijndael * m_pDecryptCipher; - OperationalMode m_bEncryptMode; - OperationalMode m_bDecryptMode; - public: - virtual bool init(const char *encKey,int encKeyLen,const char *decKey,int decKeyLen); - virtual KviCryptEngine::EncryptResult encrypt(const char * plainText,KviCString &outBuffer); - virtual KviCryptEngine::DecryptResult decrypt(const char * inBuffer,KviCString &plainText); - protected: - virtual bool binaryToAscii(const char *,int,KviCString &){ return false; }; - virtual bool asciiToBinary(const char *,int *,char **){ return false; }; - virtual int getKeyLen(){ return 32; }; - virtual Rijndael::KeyLength getKeyLenId(){ return Rijndael::Key32Bytes; }; - private: - void setLastErrorFromRijndaelErrorCode(int errCode); - }; - - class KviRijndaelHexEngine : public KviRijndaelEngine - { - Q_OBJECT - public: - KviRijndaelHexEngine() : KviRijndaelEngine() {}; - virtual ~KviRijndaelHexEngine(){}; - protected: - virtual bool binaryToAscii(const char * inBuffer,int len,KviCString &outBuffer); - virtual bool asciiToBinary(const char * inBuffer,int * len,char ** outBuffer); - }; - - class KviRijndael128HexEngine : public KviRijndaelHexEngine - { - Q_OBJECT - public: - KviRijndael128HexEngine() : KviRijndaelHexEngine() {}; - virtual ~KviRijndael128HexEngine(){}; - protected: - virtual int getKenLen(){ return 16; }; - virtual Rijndael::KeyLength getKeyLenId(){ return Rijndael::Key16Bytes; }; - }; - - class KviRijndael192HexEngine : public KviRijndaelHexEngine - { - Q_OBJECT - public: - KviRijndael192HexEngine() : KviRijndaelHexEngine() {}; - virtual ~KviRijndael192HexEngine(){}; - protected: - virtual int getKenLen(){ return 24; }; - virtual Rijndael::KeyLength getKeyLenId(){ return Rijndael::Key24Bytes; }; - }; - - class KviRijndael256HexEngine : public KviRijndaelHexEngine - { - Q_OBJECT - public: - KviRijndael256HexEngine() : KviRijndaelHexEngine() {}; - virtual ~KviRijndael256HexEngine(){}; - protected: - virtual int getKenLen(){ return 32; }; - }; - - class KviRijndaelBase64Engine : public KviRijndaelEngine - { - Q_OBJECT - public: - KviRijndaelBase64Engine() : KviRijndaelEngine() {}; - virtual ~KviRijndaelBase64Engine(){}; - protected: - virtual bool binaryToAscii(const char * inBuffer,int len,KviCString &outBuffer); - virtual bool asciiToBinary(const char * inBuffer,int * len,char ** outBuffer); - }; - - class KviRijndael128Base64Engine : public KviRijndaelBase64Engine - { - Q_OBJECT - public: - KviRijndael128Base64Engine() : KviRijndaelBase64Engine() {}; - virtual ~KviRijndael128Base64Engine(){}; - protected: - virtual int getKenLen(){ return 16; }; - virtual Rijndael::KeyLength getKeyLenId(){ return Rijndael::Key16Bytes; }; - }; - - class KviRijndael192Base64Engine : public KviRijndaelBase64Engine - { - Q_OBJECT - public: - KviRijndael192Base64Engine() : KviRijndaelBase64Engine() {}; - virtual ~KviRijndael192Base64Engine(){}; - protected: - virtual int getKenLen(){ return 24; }; - virtual Rijndael::KeyLength getKeyLenId(){ return Rijndael::Key24Bytes; }; - }; - - class KviRijndael256Base64Engine : public KviRijndaelBase64Engine - { - Q_OBJECT - public: - KviRijndael256Base64Engine() : KviRijndaelBase64Engine() {}; - virtual ~KviRijndael256Base64Engine(){}; - protected: - virtual int getKenLen(){ return 32; }; - }; - - // Mircyption stuff - #define MCPS2_STARTTAG "\xABm\xAB" - #define MCPS2_ENDTAG "\xBBm\xBB" - - class KviMircryptionEngine : public KviCryptEngine +#include "KviCryptEngine.h" +#include "Rijndael.h" + +class KviRijndaelEngine : public KviCryptEngine +{ + Q_OBJECT +public: + KviRijndaelEngine(); + virtual ~KviRijndaelEngine(); + +private: + enum OperationalMode { - Q_OBJECT - public: - KviMircryptionEngine(); - ~KviMircryptionEngine(); - protected: - KviCString m_szEncryptKey; - bool m_bEncryptCBC; - KviCString m_szDecryptKey; - bool m_bDecryptCBC; - public: - virtual bool isCryptographicEngine(){ return false; }; // we need to return false since it doesn't use the Qt::CTRL+P escape - virtual bool init(const char *encKey,int encKeyLen,const char *decKey,int decKeyLen); - virtual KviCryptEngine::EncryptResult encrypt(const char * plainText,KviCString &outBuffer); - virtual KviCryptEngine::DecryptResult decrypt(const char * inBuffer,KviCString &plainText); - protected: - bool doDecryptECB(KviCString &encoded,KviCString &plain); - bool doDecryptCBC(KviCString &encoded,KviCString &plain); - bool doEncryptECB(KviCString &plain,KviCString &encoded); - bool doEncryptCBC(KviCString &plain,KviCString &encoded); + OldCBC = 1, /** Legacy (pre-4.2) mode: CBC with empty IV **/ + CBC = 2, /** CBC mode **/ + ECB = 3 /** ECB mode **/ }; + Rijndael * m_pEncryptCipher; + Rijndael * m_pDecryptCipher; + OperationalMode m_bEncryptMode; + OperationalMode m_bDecryptMode; + +public: + virtual bool init(const char * encKey, int encKeyLen, const char * decKey, int decKeyLen); + virtual KviCryptEngine::EncryptResult encrypt(const char * plainText, KviCString & outBuffer); + virtual KviCryptEngine::DecryptResult decrypt(const char * inBuffer, KviCString & plainText); + +protected: + virtual bool binaryToAscii(const char *, int, KviCString &) { return false; }; + virtual bool asciiToBinary(const char *, int *, char **) { return false; }; + virtual int getKeyLen() { return 32; }; + virtual Rijndael::KeyLength getKeyLenId() { return Rijndael::Key32Bytes; }; +private: + void setLastErrorFromRijndaelErrorCode(int errCode); +}; + +class KviRijndaelHexEngine : public KviRijndaelEngine +{ + Q_OBJECT +public: + KviRijndaelHexEngine() : KviRijndaelEngine(){}; + virtual ~KviRijndaelHexEngine(){}; + +protected: + virtual bool binaryToAscii(const char * inBuffer, int len, KviCString & outBuffer); + virtual bool asciiToBinary(const char * inBuffer, int * len, char ** outBuffer); +}; + +class KviRijndael128HexEngine : public KviRijndaelHexEngine +{ + Q_OBJECT +public: + KviRijndael128HexEngine() : KviRijndaelHexEngine(){}; + virtual ~KviRijndael128HexEngine(){}; + +protected: + virtual int getKenLen() { return 16; }; + virtual Rijndael::KeyLength getKeyLenId() { return Rijndael::Key16Bytes; }; +}; + +class KviRijndael192HexEngine : public KviRijndaelHexEngine +{ + Q_OBJECT +public: + KviRijndael192HexEngine() : KviRijndaelHexEngine(){}; + virtual ~KviRijndael192HexEngine(){}; + +protected: + virtual int getKenLen() { return 24; }; + virtual Rijndael::KeyLength getKeyLenId() { return Rijndael::Key24Bytes; }; +}; + +class KviRijndael256HexEngine : public KviRijndaelHexEngine +{ + Q_OBJECT +public: + KviRijndael256HexEngine() : KviRijndaelHexEngine(){}; + virtual ~KviRijndael256HexEngine(){}; + +protected: + virtual int getKenLen() { return 32; }; +}; + +class KviRijndaelBase64Engine : public KviRijndaelEngine +{ + Q_OBJECT +public: + KviRijndaelBase64Engine() : KviRijndaelEngine(){}; + virtual ~KviRijndaelBase64Engine(){}; + +protected: + virtual bool binaryToAscii(const char * inBuffer, int len, KviCString & outBuffer); + virtual bool asciiToBinary(const char * inBuffer, int * len, char ** outBuffer); +}; + +class KviRijndael128Base64Engine : public KviRijndaelBase64Engine +{ + Q_OBJECT +public: + KviRijndael128Base64Engine() : KviRijndaelBase64Engine(){}; + virtual ~KviRijndael128Base64Engine(){}; + +protected: + virtual int getKenLen() { return 16; }; + virtual Rijndael::KeyLength getKeyLenId() { return Rijndael::Key16Bytes; }; +}; + +class KviRijndael192Base64Engine : public KviRijndaelBase64Engine +{ + Q_OBJECT +public: + KviRijndael192Base64Engine() : KviRijndaelBase64Engine(){}; + virtual ~KviRijndael192Base64Engine(){}; + +protected: + virtual int getKenLen() { return 24; }; + virtual Rijndael::KeyLength getKeyLenId() { return Rijndael::Key24Bytes; }; +}; + +class KviRijndael256Base64Engine : public KviRijndaelBase64Engine +{ + Q_OBJECT +public: + KviRijndael256Base64Engine() : KviRijndaelBase64Engine(){}; + virtual ~KviRijndael256Base64Engine(){}; + +protected: + virtual int getKenLen() { return 32; }; +}; + +// Mircyption stuff +#define MCPS2_STARTTAG "\xABm\xAB" +#define MCPS2_ENDTAG "\xBBm\xBB" + +class KviMircryptionEngine : public KviCryptEngine +{ + Q_OBJECT +public: + KviMircryptionEngine(); + ~KviMircryptionEngine(); + +protected: + KviCString m_szEncryptKey; + bool m_bEncryptCBC; + KviCString m_szDecryptKey; + bool m_bDecryptCBC; + +public: + virtual bool isCryptographicEngine() { return false; }; // we need to return false since it doesn't use the Qt::CTRL+P escape + virtual bool init(const char * encKey, int encKeyLen, const char * decKey, int decKeyLen); + virtual KviCryptEngine::EncryptResult encrypt(const char * plainText, KviCString & outBuffer); + virtual KviCryptEngine::DecryptResult decrypt(const char * inBuffer, KviCString & plainText); + +protected: + bool doDecryptECB(KviCString & encoded, KviCString & plain); + bool doDecryptCBC(KviCString & encoded, KviCString & plain); + bool doEncryptECB(KviCString & plain, KviCString & encoded); + bool doEncryptCBC(KviCString & plain, KviCString & encoded); +}; #endif // COMPILE_CRYPT_SUPPORT diff --git a/src/modules/rot13/libkvirot13.cpp b/src/modules/rot13/libkvirot13.cpp index 81a0a83a0..f57858980 100644 --- a/src/modules/rot13/libkvirot13.cpp +++ b/src/modules/rot13/libkvirot13.cpp @@ -29,8 +29,6 @@ #include "kvi_debug.h" #include "KviLocale.h" - - /* @doc: rot13 @type: @@ -43,70 +41,67 @@ Performs the "rotate by 13 places" substitution. */ - - #ifdef COMPILE_CRYPT_SUPPORT - #include "KviMemory.h" - #include "KviPointerList.h" - #include "KviCryptEngineDescription.h" +#include "KviMemory.h" +#include "KviPointerList.h" +#include "KviCryptEngineDescription.h" - static KviPointerList * g_pEngineList = 0; +static KviPointerList * g_pEngineList = 0; - KviRot13Engine::KviRot13Engine() - : KviCryptEngine() - { - g_pEngineList->append(this); - } +KviRot13Engine::KviRot13Engine() + : KviCryptEngine() +{ + g_pEngineList->append(this); +} - KviRot13Engine::~KviRot13Engine() - { - g_pEngineList->removeRef(this); - } +KviRot13Engine::~KviRot13Engine() +{ + g_pEngineList->removeRef(this); +} - bool KviRot13Engine::init(const char *,int,const char *,int) - { - return true; - } +bool KviRot13Engine::init(const char *, int, const char *, int) +{ + return true; +} - KviCryptEngine::EncryptResult KviRot13Engine::encrypt(const char * plainText,KviCString &outBuffer) +KviCryptEngine::EncryptResult KviRot13Engine::encrypt(const char * plainText, KviCString & outBuffer) +{ + outBuffer = plainText; + unsigned char * aux = (unsigned char *)outBuffer.ptr(); + while(*aux) { - outBuffer = plainText; - unsigned char * aux = (unsigned char *)outBuffer.ptr(); - while(*aux) + if(isalpha(*aux)) { - if(isalpha(*aux)) - { - char l = toupper(*aux); - if (l >= 'N' && l <= 'Z') - *aux = *aux - 13; - else if (l >= 'A' && l <= 'M') - *aux = *aux + 13; - } - aux++; + char l = toupper(*aux); + if(l >= 'N' && l <= 'Z') + *aux = *aux - 13; + else if(l >= 'A' && l <= 'M') + *aux = *aux + 13; } - - return KviCryptEngine::Encoded; + aux++; } - KviCryptEngine::DecryptResult KviRot13Engine::decrypt(const char * inBuffer,KviCString &plainText) - { - plainText = inBuffer; - return KviCryptEngine::DecryptOkWasPlainText; - } + return KviCryptEngine::Encoded; +} - static KviCryptEngine * allocRot13Engine() - { - return new KviRot13Engine(); - } +KviCryptEngine::DecryptResult KviRot13Engine::decrypt(const char * inBuffer, KviCString & plainText) +{ + plainText = inBuffer; + return KviCryptEngine::DecryptOkWasPlainText; +} - static void deallocRot13Engine(KviCryptEngine * e) - { - delete e; - } +static KviCryptEngine * allocRot13Engine() +{ + return new KviRot13Engine(); +} -#endif +static void deallocRot13Engine(KviCryptEngine * e) +{ + delete e; +} +#endif // ======================================= // module routines @@ -132,7 +127,7 @@ static bool rot13_module_init(KviModule * m) #endif } -static bool rot13_module_cleanup(KviModule *m) +static bool rot13_module_cleanup(KviModule * m) { #ifdef COMPILE_CRYPT_SUPPORT while(g_pEngineList->first()) @@ -159,13 +154,12 @@ static bool rot13_module_can_unload(KviModule *) // plugin definition structure // ======================================= KVIRC_MODULE( - "ROT13 crypt engine", - "4.0.0", - "Aeriana ", - "Exports the ROT13 text transformation engine", - rot13_module_init, - rot13_module_can_unload, - 0, - rot13_module_cleanup, - 0 -) + "ROT13 crypt engine", + "4.0.0", + "Aeriana ", + "Exports the ROT13 text transformation engine", + rot13_module_init, + rot13_module_can_unload, + 0, + rot13_module_cleanup, + 0) diff --git a/src/modules/rot13/libkvirot13.h b/src/modules/rot13/libkvirot13.h index 11f740baf..b64dfaa65 100644 --- a/src/modules/rot13/libkvirot13.h +++ b/src/modules/rot13/libkvirot13.h @@ -29,19 +29,20 @@ #ifdef COMPILE_CRYPT_SUPPORT - #include "KviCryptEngine.h" +#include "KviCryptEngine.h" - class KviRot13Engine : public KviCryptEngine - { - Q_OBJECT - public: - KviRot13Engine(); - ~KviRot13Engine(); - public: - virtual bool init(const char *encKey,int encKeyLen,const char *decKey,int decKeyLen); - virtual KviCryptEngine::EncryptResult encrypt(const char * plainText,KviCString &outBuffer); - virtual KviCryptEngine::DecryptResult decrypt(const char * inBuffer,KviCString &plainText); - }; +class KviRot13Engine : public KviCryptEngine +{ + Q_OBJECT +public: + KviRot13Engine(); + ~KviRot13Engine(); + +public: + virtual bool init(const char * encKey, int encKeyLen, const char * decKey, int decKeyLen); + virtual KviCryptEngine::EncryptResult encrypt(const char * plainText, KviCString & outBuffer); + virtual KviCryptEngine::DecryptResult decrypt(const char * inBuffer, KviCString & plainText); +}; #endif // COMPILE_CRYPT_SUPPORT diff --git a/src/modules/serverdb/libkviserverdb.cpp b/src/modules/serverdb/libkviserverdb.cpp index 823c6df4d..e946629c2 100644 --- a/src/modules/serverdb/libkviserverdb.cpp +++ b/src/modules/serverdb/libkviserverdb.cpp @@ -118,12 +118,12 @@ static bool serverdb_kvs_fnc_networkExists(KviKvsModuleFunctionCall * c) QString szNetwork; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("network_name",KVS_PT_STRING,0,szNetwork) + KVSM_PARAMETER("network_name", KVS_PT_STRING, 0, szNetwork) KVSM_PARAMETERS_END(c) if(szNetwork.isEmpty()) { - c->error(__tr2qs_ctx("You must provide the network name as parameter","serverdb")); + c->error(__tr2qs_ctx("You must provide the network name as parameter", "serverdb")); return false; } @@ -160,13 +160,13 @@ static bool serverdb_kvs_fnc_serverExists(KviKvsModuleFunctionCall * c) QString szServer, szNetwork; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("server_name",KVS_PT_STRING,0,szServer) - KVSM_PARAMETER("network_name",KVS_PT_STRING,KVS_PF_OPTIONAL,szNetwork) + KVSM_PARAMETER("server_name", KVS_PT_STRING, 0, szServer) + KVSM_PARAMETER("network_name", KVS_PT_STRING, KVS_PF_OPTIONAL, szNetwork) KVSM_PARAMETERS_END(c) if(szServer.isEmpty()) { - c->error(__tr2qs_ctx("You must provide the server name as parameter","serverdb")); + c->error(__tr2qs_ctx("You must provide the server name as parameter", "serverdb")); return false; } @@ -188,9 +188,11 @@ static bool serverdb_kvs_fnc_serverExists(KviKvsModuleFunctionCall * c) } c->returnValue()->setBoolean(true); - } else { + } + else + { // Check through all networks - KviPointerHashTableIterator it(*(g_pServerDataBase->recordDict())); + KviPointerHashTableIterator it(*(g_pServerDataBase->recordDict())); while(KviIrcNetwork * r = it.current()) { @@ -198,7 +200,7 @@ static bool serverdb_kvs_fnc_serverExists(KviKvsModuleFunctionCall * c) for(KviIrcServer * s = sl->first(); s; s = sl->next()) { - if(QString::compare(s->hostName().toUtf8().data(),szServer,Qt::CaseInsensitive)==0) + if(QString::compare(s->hostName().toUtf8().data(), szServer, Qt::CaseInsensitive) == 0) { c->returnValue()->setBoolean(true); return true; @@ -213,86 +215,83 @@ static bool serverdb_kvs_fnc_serverExists(KviKvsModuleFunctionCall * c) return true; } -#define BEGIN_SERVERDB_GET_NETWORK_PROPERTY(__functionName) \ - static bool __functionName(KviKvsModuleFunctionCall * c) \ - { \ - QString szName; \ - \ - KVSM_PARAMETERS_BEGIN(c) \ - KVSM_PARAMETER("name",KVS_PT_STRING,0,szName) \ - KVSM_PARAMETERS_END(c) \ - \ - if(szName.isEmpty()) \ - { \ - c->error(__tr2qs_ctx("You must provide the network name as parameter","serverdb")); \ - return false; \ - } \ - \ - KviIrcNetwork * pNetwork = g_pServerDataBase->findNetwork(szName); \ - if(!pNetwork) \ - { \ - c->error(__tr2qs_ctx("The specified network doesn't exist","serverdb")); \ - return false; \ +#define BEGIN_SERVERDB_GET_NETWORK_PROPERTY(__functionName) \ + static bool __functionName(KviKvsModuleFunctionCall * c) \ + { \ + QString szName; \ + \ + KVSM_PARAMETERS_BEGIN(c) \ + KVSM_PARAMETER("name", KVS_PT_STRING, 0, szName) \ + KVSM_PARAMETERS_END(c) \ + \ + if(szName.isEmpty()) \ + { \ + c->error(__tr2qs_ctx("You must provide the network name as parameter", "serverdb")); \ + return false; \ + } \ + \ + KviIrcNetwork * pNetwork = g_pServerDataBase->findNetwork(szName); \ + if(!pNetwork) \ + { \ + c->error(__tr2qs_ctx("The specified network doesn't exist", "serverdb")); \ + return false; \ } - #define END_SERVERDB_GET_NETWORK_PROPERTY \ - return true; \ + return true; \ } -#define SERVERDB_GET_NETWORK_PROPERTY(__functionName,__callName) \ - BEGIN_SERVERDB_GET_NETWORK_PROPERTY(__functionName) \ - \ - c->returnValue()->setString(pNetwork->__callName()); \ - \ +#define SERVERDB_GET_NETWORK_PROPERTY(__functionName, __callName) \ + BEGIN_SERVERDB_GET_NETWORK_PROPERTY(__functionName) \ + \ + c->returnValue()->setString(pNetwork->__callName()); \ + \ END_SERVERDB_GET_NETWORK_PROPERTY -#define BEGIN_SERVERDB_GET_SERVER_PROPERTY(__functionName) \ - static bool __functionName(KviKvsModuleFunctionCall * c) \ - { \ - QString szNetName, szServName; \ - \ - KVSM_PARAMETERS_BEGIN(c) \ - KVSM_PARAMETER("network_name",KVS_PT_STRING,0,szNetName) \ - KVSM_PARAMETER("server_name",KVS_PT_STRING,0,szServName) \ - KVSM_PARAMETERS_END(c) \ - \ - if(szNetName.isEmpty()) \ - { \ - c->error(__tr2qs_ctx("You must provide the network name as parameter","serverdb")); \ - return false; \ - } \ - \ - if(szServName.isEmpty()) \ - { \ - c->error(__tr2qs_ctx("You must provide the server name as parameter","serverdb")); \ - return false; \ - } \ - \ - KviIrcNetwork * pRecord = g_pServerDataBase->findNetwork(szNetName); \ - if(!pRecord) \ - { \ - c->error(__tr2qs_ctx("The specified network doesn't exist","serverdb")); \ - return false; \ - } \ - \ - KviIrcServer * pServer = pRecord->findServer(szServName); \ - if(!pServer) \ - { \ - c->error(__tr2qs_ctx("The specified server doesn't exist","serverdb")); \ - return false; \ +#define BEGIN_SERVERDB_GET_SERVER_PROPERTY(__functionName) \ + static bool __functionName(KviKvsModuleFunctionCall * c) \ + { \ + QString szNetName, szServName; \ + \ + KVSM_PARAMETERS_BEGIN(c) \ + KVSM_PARAMETER("network_name", KVS_PT_STRING, 0, szNetName) \ + KVSM_PARAMETER("server_name", KVS_PT_STRING, 0, szServName) \ + KVSM_PARAMETERS_END(c) \ + \ + if(szNetName.isEmpty()) \ + { \ + c->error(__tr2qs_ctx("You must provide the network name as parameter", "serverdb")); \ + return false; \ + } \ + \ + if(szServName.isEmpty()) \ + { \ + c->error(__tr2qs_ctx("You must provide the server name as parameter", "serverdb")); \ + return false; \ + } \ + \ + KviIrcNetwork * pRecord = g_pServerDataBase->findNetwork(szNetName); \ + if(!pRecord) \ + { \ + c->error(__tr2qs_ctx("The specified network doesn't exist", "serverdb")); \ + return false; \ + } \ + \ + KviIrcServer * pServer = pRecord->findServer(szServName); \ + if(!pServer) \ + { \ + c->error(__tr2qs_ctx("The specified server doesn't exist", "serverdb")); \ + return false; \ } - #define END_SERVERDB_GET_SERVER_PROPERTY \ - return true; \ + return true; \ } -#define SERVERDB_GET_SERVER_PROPERTY(__functionName,__callName,__variantSetCallName) \ - BEGIN_SERVERDB_GET_SERVER_PROPERTY(__functionName) \ - c->returnValue()->__variantSetCallName(pServer->__callName()); \ - END_SERVERDB_GET_SERVER_PROPERTY - +#define SERVERDB_GET_SERVER_PROPERTY(__functionName, __callName, __variantSetCallName) \ + BEGIN_SERVERDB_GET_SERVER_PROPERTY(__functionName) \ + c->returnValue()->__variantSetCallName(pServer->__callName()); \ + END_SERVERDB_GET_SERVER_PROPERTY /* @doc: serverdb.networkNickName @@ -309,7 +308,7 @@ static bool serverdb_kvs_fnc_serverExists(KviKvsModuleFunctionCall * c) @seealso: [module:serverdb]ServerDB module documentation[/module] */ -SERVERDB_GET_NETWORK_PROPERTY(serverdb_kvs_fnc_networkNickName,nickName) +SERVERDB_GET_NETWORK_PROPERTY(serverdb_kvs_fnc_networkNickName, nickName) /* @doc: serverdb.networkUserName @@ -326,7 +325,7 @@ SERVERDB_GET_NETWORK_PROPERTY(serverdb_kvs_fnc_networkNickName,nickName) @seealso: [module:serverdb]ServerDB module documentation[/module] */ -SERVERDB_GET_NETWORK_PROPERTY(serverdb_kvs_fnc_networkUserName,userName) +SERVERDB_GET_NETWORK_PROPERTY(serverdb_kvs_fnc_networkUserName, userName) /* @doc: serverdb.networkRealName @@ -343,7 +342,7 @@ SERVERDB_GET_NETWORK_PROPERTY(serverdb_kvs_fnc_networkUserName,userName) @seealso: [module:serverdb]ServerDB module documentation[/module] */ -SERVERDB_GET_NETWORK_PROPERTY(serverdb_kvs_fnc_networkRealName,realName) +SERVERDB_GET_NETWORK_PROPERTY(serverdb_kvs_fnc_networkRealName, realName) /* @doc: serverdb.networkEncoding @@ -360,7 +359,7 @@ SERVERDB_GET_NETWORK_PROPERTY(serverdb_kvs_fnc_networkRealName,realName) @seealso: [module:serverdb]ServerDB module documentation[/module] */ -SERVERDB_GET_NETWORK_PROPERTY(serverdb_kvs_fnc_networkEncoding,encoding) +SERVERDB_GET_NETWORK_PROPERTY(serverdb_kvs_fnc_networkEncoding, encoding) /* @doc: serverdb.networkTextEncoding @@ -377,7 +376,7 @@ SERVERDB_GET_NETWORK_PROPERTY(serverdb_kvs_fnc_networkEncoding,encoding) @seealso: [module:serverdb]ServerDB module documentation[/module] */ -SERVERDB_GET_NETWORK_PROPERTY(serverdb_kvs_fnc_networkTextEncoding,textEncoding) +SERVERDB_GET_NETWORK_PROPERTY(serverdb_kvs_fnc_networkTextEncoding, textEncoding) /* @doc: serverdb.networkDescription @@ -394,7 +393,7 @@ SERVERDB_GET_NETWORK_PROPERTY(serverdb_kvs_fnc_networkTextEncoding,textEncoding) @seealso: [module:serverdb]ServerDB module documentation[/module] */ -SERVERDB_GET_NETWORK_PROPERTY(serverdb_kvs_fnc_networkDescription,description) +SERVERDB_GET_NETWORK_PROPERTY(serverdb_kvs_fnc_networkDescription, description) /* @doc: serverdb.networkConnectCommand @@ -411,7 +410,7 @@ SERVERDB_GET_NETWORK_PROPERTY(serverdb_kvs_fnc_networkDescription,description) @seealso: [module:serverdb]ServerDB module documentation[/module] */ -SERVERDB_GET_NETWORK_PROPERTY(serverdb_kvs_fnc_networkConnectCommand,onConnectCommand) +SERVERDB_GET_NETWORK_PROPERTY(serverdb_kvs_fnc_networkConnectCommand, onConnectCommand) /* @doc: serverdb.networkLoginCommand @@ -428,7 +427,7 @@ SERVERDB_GET_NETWORK_PROPERTY(serverdb_kvs_fnc_networkConnectCommand,onConnectCo @seealso: [module:serverdb]ServerDB module documentation[/module] */ -SERVERDB_GET_NETWORK_PROPERTY(serverdb_kvs_fnc_networkLoginCommand,onLoginCommand) +SERVERDB_GET_NETWORK_PROPERTY(serverdb_kvs_fnc_networkLoginCommand, onLoginCommand) /* @doc: serverdb.networkName @@ -445,7 +444,7 @@ SERVERDB_GET_NETWORK_PROPERTY(serverdb_kvs_fnc_networkLoginCommand,onLoginComman @seealso: [module:serverdb]ServerDB module documentation[/module] */ -SERVERDB_GET_NETWORK_PROPERTY(serverdb_kvs_fnc_networkName,name) +SERVERDB_GET_NETWORK_PROPERTY(serverdb_kvs_fnc_networkName, name) /* @doc: serverdb.networkJoinChannels @@ -465,20 +464,20 @@ SERVERDB_GET_NETWORK_PROPERTY(serverdb_kvs_fnc_networkName,name) */ BEGIN_SERVERDB_GET_NETWORK_PROPERTY(serverdb_kvs_fnc_networkJoinChannels) - KviKvsArray * pArray = new KviKvsArray(); +KviKvsArray * pArray = new KviKvsArray(); - QStringList * pAutoJoinChannels = pNetwork->autoJoinChannelList(); - if(pAutoJoinChannels) +QStringList * pAutoJoinChannels = pNetwork->autoJoinChannelList(); +if(pAutoJoinChannels) +{ + kvs_uint_t idx = 0; + foreach(QString szEntry, *pAutoJoinChannels) { - kvs_uint_t idx = 0; - foreach(QString szEntry,*pAutoJoinChannels) - { - pArray->set(idx,new KviKvsVariant(szEntry)); - idx++; - } + pArray->set(idx, new KviKvsVariant(szEntry)); + idx++; } +} - c->returnValue()->setArray(pArray); +c->returnValue()->setArray(pArray); END_SERVERDB_GET_NETWORK_PROPERTY @@ -497,7 +496,7 @@ END_SERVERDB_GET_NETWORK_PROPERTY @seealso: [module:serverdb]ServerDB module documentation[/module] */ -SERVERDB_GET_SERVER_PROPERTY(serverdb_kvs_fnc_serverNickName,nickName,setString) +SERVERDB_GET_SERVER_PROPERTY(serverdb_kvs_fnc_serverNickName, nickName, setString) /* @doc: serverdb.serverUserName @@ -514,7 +513,7 @@ SERVERDB_GET_SERVER_PROPERTY(serverdb_kvs_fnc_serverNickName,nickName,setString) @seealso: [module:serverdb]ServerDB module documentation[/module] */ -SERVERDB_GET_SERVER_PROPERTY(serverdb_kvs_fnc_serverUserName,userName,setString) +SERVERDB_GET_SERVER_PROPERTY(serverdb_kvs_fnc_serverUserName, userName, setString) /* @doc: serverdb.serverRealName @@ -531,7 +530,7 @@ SERVERDB_GET_SERVER_PROPERTY(serverdb_kvs_fnc_serverUserName,userName,setString) @seealso: [module:serverdb]ServerDB module documentation[/module] */ -SERVERDB_GET_SERVER_PROPERTY(serverdb_kvs_fnc_serverRealName,realName,setString) +SERVERDB_GET_SERVER_PROPERTY(serverdb_kvs_fnc_serverRealName, realName, setString) /* @doc: serverdb.serverEncoding @@ -548,7 +547,7 @@ SERVERDB_GET_SERVER_PROPERTY(serverdb_kvs_fnc_serverRealName,realName,setString) @seealso: [module:serverdb]ServerDB module documentation[/module] */ -SERVERDB_GET_SERVER_PROPERTY(serverdb_kvs_fnc_serverEncoding,encoding,setString) +SERVERDB_GET_SERVER_PROPERTY(serverdb_kvs_fnc_serverEncoding, encoding, setString) /* @doc: serverdb.serverTextEncoding @@ -565,7 +564,7 @@ SERVERDB_GET_SERVER_PROPERTY(serverdb_kvs_fnc_serverEncoding,encoding,setString) @seealso: [module:serverdb]ServerDB module documentation[/module] */ -SERVERDB_GET_SERVER_PROPERTY(serverdb_kvs_fnc_serverTextEncoding,textEncoding,setString) +SERVERDB_GET_SERVER_PROPERTY(serverdb_kvs_fnc_serverTextEncoding, textEncoding, setString) /* @doc: serverdb.serverDescription @@ -582,7 +581,7 @@ SERVERDB_GET_SERVER_PROPERTY(serverdb_kvs_fnc_serverTextEncoding,textEncoding,se @seealso: [module:serverdb]ServerDB module documentation[/module] */ -SERVERDB_GET_SERVER_PROPERTY(serverdb_kvs_fnc_serverDescription,description,setString) +SERVERDB_GET_SERVER_PROPERTY(serverdb_kvs_fnc_serverDescription, description, setString) /* @doc: serverdb.serverConnectCommand @@ -599,7 +598,7 @@ SERVERDB_GET_SERVER_PROPERTY(serverdb_kvs_fnc_serverDescription,description,setS @seealso: [module:serverdb]ServerDB module documentation[/module] */ -SERVERDB_GET_SERVER_PROPERTY(serverdb_kvs_fnc_serverConnectCommand,onConnectCommand,setString) +SERVERDB_GET_SERVER_PROPERTY(serverdb_kvs_fnc_serverConnectCommand, onConnectCommand, setString) /* @doc: serverdb.serverLoginCommand @@ -616,7 +615,7 @@ SERVERDB_GET_SERVER_PROPERTY(serverdb_kvs_fnc_serverConnectCommand,onConnectComm @seealso: [module:serverdb]ServerDB module documentation[/module] */ -SERVERDB_GET_SERVER_PROPERTY(serverdb_kvs_fnc_serverLoginCommand,onLoginCommand,setString) +SERVERDB_GET_SERVER_PROPERTY(serverdb_kvs_fnc_serverLoginCommand, onLoginCommand, setString) /* @doc: serverdb.serverIp @@ -633,7 +632,7 @@ SERVERDB_GET_SERVER_PROPERTY(serverdb_kvs_fnc_serverLoginCommand,onLoginCommand, @seealso: [module:serverdb]ServerDB module documentation[/module] */ -SERVERDB_GET_SERVER_PROPERTY(serverdb_kvs_fnc_serverIp,ip,setString) +SERVERDB_GET_SERVER_PROPERTY(serverdb_kvs_fnc_serverIp, ip, setString) /* @doc: serverdb.serverId @@ -650,7 +649,7 @@ SERVERDB_GET_SERVER_PROPERTY(serverdb_kvs_fnc_serverIp,ip,setString) @seealso: [module:serverdb]ServerDB module documentation[/module] */ -SERVERDB_GET_SERVER_PROPERTY(serverdb_kvs_fnc_serverId,id,setString) +SERVERDB_GET_SERVER_PROPERTY(serverdb_kvs_fnc_serverId, id, setString) /* @doc: serverdb.serverPassword @@ -667,7 +666,7 @@ SERVERDB_GET_SERVER_PROPERTY(serverdb_kvs_fnc_serverId,id,setString) @seealso: [module:serverdb]ServerDB module documentation[/module] */ -SERVERDB_GET_SERVER_PROPERTY(serverdb_kvs_fnc_serverPassword,password,setString) +SERVERDB_GET_SERVER_PROPERTY(serverdb_kvs_fnc_serverPassword, password, setString) /* @doc: serverdb.serverPort @@ -684,7 +683,7 @@ SERVERDB_GET_SERVER_PROPERTY(serverdb_kvs_fnc_serverPassword,password,setString) @seealso: [module:serverdb]ServerDB module documentation[/module] */ -SERVERDB_GET_SERVER_PROPERTY(serverdb_kvs_fnc_serverPort,port,setInteger) +SERVERDB_GET_SERVER_PROPERTY(serverdb_kvs_fnc_serverPort, port, setInteger) /* @doc: serverdb.isAutoConnect @@ -701,7 +700,7 @@ SERVERDB_GET_SERVER_PROPERTY(serverdb_kvs_fnc_serverPort,port,setInteger) @seealso: [module:serverdb]ServerDB module documentation[/module] */ -SERVERDB_GET_SERVER_PROPERTY(serverdb_kvs_fnc_serverAutoConnect,autoConnect,setBoolean) +SERVERDB_GET_SERVER_PROPERTY(serverdb_kvs_fnc_serverAutoConnect, autoConnect, setBoolean) /* @doc: serverdb.isIPv6 @@ -718,7 +717,7 @@ SERVERDB_GET_SERVER_PROPERTY(serverdb_kvs_fnc_serverAutoConnect,autoConnect,setB @seealso: [module:serverdb]ServerDB module documentation[/module] */ -SERVERDB_GET_SERVER_PROPERTY(serverdb_kvs_fnc_serverIPv6,isIPv6,setBoolean) +SERVERDB_GET_SERVER_PROPERTY(serverdb_kvs_fnc_serverIPv6, isIPv6, setBoolean) /* @doc: serverdb.isSSL @@ -735,7 +734,7 @@ SERVERDB_GET_SERVER_PROPERTY(serverdb_kvs_fnc_serverIPv6,isIPv6,setBoolean) @seealso: [module:serverdb]ServerDB module documentation[/module] */ -SERVERDB_GET_SERVER_PROPERTY(serverdb_kvs_fnc_serverSSL,useSSL,setBoolean) +SERVERDB_GET_SERVER_PROPERTY(serverdb_kvs_fnc_serverSSL, useSSL, setBoolean) /* @doc: serverdb.cacheIp @@ -752,7 +751,7 @@ SERVERDB_GET_SERVER_PROPERTY(serverdb_kvs_fnc_serverSSL,useSSL,setBoolean) @seealso: [module:serverdb]ServerDB module documentation[/module] */ -SERVERDB_GET_SERVER_PROPERTY(serverdb_kvs_fnc_serverCacheIp,cacheIp,setBoolean) +SERVERDB_GET_SERVER_PROPERTY(serverdb_kvs_fnc_serverCacheIp, cacheIp, setBoolean) /* @doc: serverdb.favorite @@ -767,7 +766,7 @@ SERVERDB_GET_SERVER_PROPERTY(serverdb_kvs_fnc_serverCacheIp,cacheIp,setBoolean) @description: Returns true if KVIrc has the server set to a favorite, false otherwise */ -SERVERDB_GET_SERVER_PROPERTY(serverdb_kvs_fnc_serverFavorite,favorite,setBoolean) +SERVERDB_GET_SERVER_PROPERTY(serverdb_kvs_fnc_serverFavorite, favorite, setBoolean) /* @doc: serverdb.serverJoinChannels @@ -787,24 +786,23 @@ SERVERDB_GET_SERVER_PROPERTY(serverdb_kvs_fnc_serverFavorite,favorite,setBoolean */ BEGIN_SERVERDB_GET_SERVER_PROPERTY(serverdb_kvs_fnc_serverJoinChannels) - KviKvsArray * pArray = new KviKvsArray(); +KviKvsArray * pArray = new KviKvsArray(); - QStringList * pAutoJoinChannels = pServer->autoJoinChannelList(); - if(pAutoJoinChannels) +QStringList * pAutoJoinChannels = pServer->autoJoinChannelList(); +if(pAutoJoinChannels) +{ + kvs_uint_t idx = 0; + foreach(QString szEntry, *pAutoJoinChannels) { - kvs_uint_t idx = 0; - foreach(QString szEntry,*pAutoJoinChannels) - { - pArray->set(idx,new KviKvsVariant(szEntry)); - idx++; - } + pArray->set(idx, new KviKvsVariant(szEntry)); + idx++; } +} - c->returnValue()->setArray(pArray); +c->returnValue()->setArray(pArray); END_SERVERDB_GET_SERVER_PROPERTY - /* @doc: serverdb.addNetwork @type: @@ -833,25 +831,27 @@ static bool serverdb_kvs_cmd_addNetwork(KviKvsModuleCommandCall * c) QString szNetName, szNetwork; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("network_name",KVS_PT_STRING,0,szNetName) + KVSM_PARAMETER("network_name", KVS_PT_STRING, 0, szNetName) KVSM_PARAMETERS_END(c) if(szNetName.isEmpty()) { - c->error(__tr2qs_ctx("You must provide the network name as parameter","serverdb")); + c->error(__tr2qs_ctx("You must provide the network name as parameter", "serverdb")); return false; } KviIrcNetwork * pNetwork = g_pServerDataBase->findNetwork(szNetName); if(pNetwork) { - if(c->switches()->find('q',"quiet")) return true; - c->error(__tr2qs_ctx("The network specified already exists","serverdb")); + if(c->switches()->find('q', "quiet")) + return true; + c->error(__tr2qs_ctx("The network specified already exists", "serverdb")); return false; } pNetwork = new KviIrcNetwork(szNetName); - if(c->switches()->find('a',"autoconnect")) pNetwork->setAutoConnect(true); + if(c->switches()->find('a', "autoconnect")) + pNetwork->setAutoConnect(true); g_pServerDataBase->addNetwork(pNetwork); return true; @@ -906,19 +906,19 @@ static bool serverdb_kvs_cmd_addServer(KviKvsModuleCommandCall * c) QString szNetwork, szServer; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("network_name",KVS_PT_STRING,0,szNetwork) - KVSM_PARAMETER("server_name",KVS_PT_STRING,0,szServer) + KVSM_PARAMETER("network_name", KVS_PT_STRING, 0, szNetwork) + KVSM_PARAMETER("server_name", KVS_PT_STRING, 0, szServer) KVSM_PARAMETERS_END(c) if(szNetwork.isEmpty()) { - c->error(__tr2qs_ctx("You must provide the network name as parameter","serverdb")); + c->error(__tr2qs_ctx("You must provide the network name as parameter", "serverdb")); return false; } if(szServer.isEmpty()) { - c->error(__tr2qs_ctx("You must provide the server name as parameter","serverdb")); + c->error(__tr2qs_ctx("You must provide the server name as parameter", "serverdb")); return false; } @@ -926,7 +926,7 @@ static bool serverdb_kvs_cmd_addServer(KviKvsModuleCommandCall * c) if(!pRecord) { // FIXME: default to orphan servers - c->error(__tr2qs_ctx("The specified network doesn't exist","serverdb")); + c->error(__tr2qs_ctx("The specified network doesn't exist", "serverdb")); return false; } @@ -936,105 +936,116 @@ static bool serverdb_kvs_cmd_addServer(KviKvsModuleCommandCall * c) KviIrcServer * pServerRecord = pRecord->findServer(pServer); if(pServerRecord) { - if(c->switches()->find('q',"quiet")) return true; - c->error(__tr2qs_ctx("The specified server already exists","serverdb")); + if(c->switches()->find('q', "quiet")) + return true; + c->error(__tr2qs_ctx("The specified server already exists", "serverdb")); return false; } - if(c->switches()->find('a',"autoconnect")) pServer->setAutoConnect(true); - if(c->switches()->find('c',"cache-ip")) pServer->setCacheIp(true); - if(c->switches()->find('f',"favorite")) pServer->setFavorite(true); - if(c->switches()->find('i',"ipv6")) pServer->setIPv6(true); - if(c->switches()->find('s',"ssl")) pServer->setUseSSL(true); + if(c->switches()->find('a', "autoconnect")) + pServer->setAutoConnect(true); + if(c->switches()->find('c', "cache-ip")) + pServer->setCacheIp(true); + if(c->switches()->find('f', "favorite")) + pServer->setFavorite(true); + if(c->switches()->find('i', "ipv6")) + pServer->setIPv6(true); + if(c->switches()->find('s', "ssl")) + pServer->setUseSSL(true); QString tmp; - if(c->switches()->getAsStringIfExisting('p',"port",tmp)) + if(c->switches()->getAsStringIfExisting('p', "port", tmp)) { bool bOk; unsigned int uPort = tmp.toInt(&bOk); - if(!bOk) uPort = 6667; + if(!bOk) + uPort = 6667; pServer->setPort(uPort); } - if(c->switches()->getAsStringIfExisting('w',"password",tmp)) pServer->setPassword(tmp); + if(c->switches()->getAsStringIfExisting('w', "password", tmp)) + pServer->setPassword(tmp); pRecord->insertServer(pServer); return true; } -#define SERVERDB_SET_NETWORK_PROPERTY(__functionName,__callName) \ - static bool __functionName(KviKvsModuleCommandCall * c) \ - { \ - QString szName, szPropertyValue; \ - \ - KVSM_PARAMETERS_BEGIN(c) \ - KVSM_PARAMETER("name",KVS_PT_STRING,0,szName) \ - KVSM_PARAMETER("property",KVS_PT_STRING,KVS_PF_APPENDREMAINING,szPropertyValue) \ - KVSM_PARAMETERS_END(c) \ - \ - if(szName.isEmpty()) \ - { \ - c->error(__tr2qs_ctx("You must provide the network name as parameter","serverdb")); \ - return false; \ - } \ - \ - KviIrcNetwork * pNetwork = g_pServerDataBase->findNetwork(szName); \ - if(!pNetwork) \ - { \ - if(c->switches()->find('q',"quiet")) return true; \ - c->error(__tr2qs_ctx("The specified network doesn't exist","serverdb")); \ - return false; \ - } \ - \ - pNetwork->__callName(szPropertyValue); \ - \ - return true; \ +#define SERVERDB_SET_NETWORK_PROPERTY(__functionName, __callName) \ + static bool __functionName(KviKvsModuleCommandCall * c) \ + { \ + QString szName, szPropertyValue; \ + \ + KVSM_PARAMETERS_BEGIN(c) \ + KVSM_PARAMETER("name", KVS_PT_STRING, 0, szName) \ + KVSM_PARAMETER("property", KVS_PT_STRING, KVS_PF_APPENDREMAINING, szPropertyValue) \ + KVSM_PARAMETERS_END(c) \ + \ + if(szName.isEmpty()) \ + { \ + c->error(__tr2qs_ctx("You must provide the network name as parameter", "serverdb")); \ + return false; \ + } \ + \ + KviIrcNetwork * pNetwork = g_pServerDataBase->findNetwork(szName); \ + if(!pNetwork) \ + { \ + if(c->switches()->find('q', "quiet")) \ + return true; \ + c->error(__tr2qs_ctx("The specified network doesn't exist", "serverdb")); \ + return false; \ + } \ + \ + pNetwork->__callName(szPropertyValue); \ + \ + return true; \ } -#define SERVERDB_SET_SERVER_PROPERTY(__functionName,__callName) \ - static bool __functionName(KviKvsModuleCommandCall * c) \ - { \ - QString szNetName, szServName, szPropertyValue; \ - \ - KVSM_PARAMETERS_BEGIN(c) \ - KVSM_PARAMETER("network_name",KVS_PT_STRING,0,szNetName) \ - KVSM_PARAMETER("server_name",KVS_PT_STRING,0,szServName) \ - KVSM_PARAMETER("property",KVS_PT_STRING,KVS_PF_APPENDREMAINING,szPropertyValue) \ - KVSM_PARAMETERS_END(c) \ - \ - if(szNetName.isEmpty()) \ - { \ - c->error(__tr2qs_ctx("You must provide the network name as parameter","serverdb")); \ - return false; \ - } \ - \ - if(szServName.isEmpty()) \ - { \ - c->error(__tr2qs_ctx("You must provide the server name as parameter","serverdb")); \ - return false; \ - } \ - \ - KviIrcNetwork * pRecord = g_pServerDataBase->findNetwork(szNetName); \ - if(!pRecord) \ - { \ - if(c->switches()->find('q',"quiet")) return true; \ - c->error(__tr2qs_ctx("The specified network doesn't exist","serverdb")); \ - return false; \ - } \ - \ - KviIrcServer * pServer = pRecord->findServer(szServName); \ - if(!pServer) \ - { \ - if(c->switches()->find('q',"quiet")) return true; \ - c->error(__tr2qs_ctx("The specified server doesn't exist","serverdb")); \ - return false; \ - } \ - \ - pServer->__callName(szPropertyValue); \ - \ - return true; \ +#define SERVERDB_SET_SERVER_PROPERTY(__functionName, __callName) \ + static bool __functionName(KviKvsModuleCommandCall * c) \ + { \ + QString szNetName, szServName, szPropertyValue; \ + \ + KVSM_PARAMETERS_BEGIN(c) \ + KVSM_PARAMETER("network_name", KVS_PT_STRING, 0, szNetName) \ + KVSM_PARAMETER("server_name", KVS_PT_STRING, 0, szServName) \ + KVSM_PARAMETER("property", KVS_PT_STRING, KVS_PF_APPENDREMAINING, szPropertyValue) \ + KVSM_PARAMETERS_END(c) \ + \ + if(szNetName.isEmpty()) \ + { \ + c->error(__tr2qs_ctx("You must provide the network name as parameter", "serverdb")); \ + return false; \ + } \ + \ + if(szServName.isEmpty()) \ + { \ + c->error(__tr2qs_ctx("You must provide the server name as parameter", "serverdb")); \ + return false; \ + } \ + \ + KviIrcNetwork * pRecord = g_pServerDataBase->findNetwork(szNetName); \ + if(!pRecord) \ + { \ + if(c->switches()->find('q', "quiet")) \ + return true; \ + c->error(__tr2qs_ctx("The specified network doesn't exist", "serverdb")); \ + return false; \ + } \ + \ + KviIrcServer * pServer = pRecord->findServer(szServName); \ + if(!pServer) \ + { \ + if(c->switches()->find('q', "quiet")) \ + return true; \ + c->error(__tr2qs_ctx("The specified server doesn't exist", "serverdb")); \ + return false; \ + } \ + \ + pServer->__callName(szPropertyValue); \ + \ + return true; \ } /* @@ -1060,7 +1071,7 @@ static bool serverdb_kvs_cmd_addServer(KviKvsModuleCommandCall * c) @seealso: [module:serverdb]ServerDB module documentation[/module] */ -SERVERDB_SET_NETWORK_PROPERTY(serverdb_kvs_cmd_setNetworkNickName,setNickName) +SERVERDB_SET_NETWORK_PROPERTY(serverdb_kvs_cmd_setNetworkNickName, setNickName) /* @doc: serverdb.setNetworkUserName @@ -1085,7 +1096,7 @@ SERVERDB_SET_NETWORK_PROPERTY(serverdb_kvs_cmd_setNetworkNickName,setNickName) @seealso: [module:serverdb]ServerDB module documentation[/module] */ -SERVERDB_SET_NETWORK_PROPERTY(serverdb_kvs_cmd_setNetworkUserName,setUserName) +SERVERDB_SET_NETWORK_PROPERTY(serverdb_kvs_cmd_setNetworkUserName, setUserName) /* @doc: serverdb.setNetworkRealName @@ -1110,7 +1121,7 @@ SERVERDB_SET_NETWORK_PROPERTY(serverdb_kvs_cmd_setNetworkUserName,setUserName) @seealso: [module:serverdb]ServerDB module documentation[/module] */ -SERVERDB_SET_NETWORK_PROPERTY(serverdb_kvs_cmd_setNetworkRealName,setRealName) +SERVERDB_SET_NETWORK_PROPERTY(serverdb_kvs_cmd_setNetworkRealName, setRealName) /* @doc: serverdb.setNetworkEncoding @@ -1136,7 +1147,7 @@ SERVERDB_SET_NETWORK_PROPERTY(serverdb_kvs_cmd_setNetworkRealName,setRealName) @seealso: [module:serverdb]ServerDB module documentation[/module] */ -SERVERDB_SET_NETWORK_PROPERTY(serverdb_kvs_cmd_setNetworkEncoding,setEncoding) +SERVERDB_SET_NETWORK_PROPERTY(serverdb_kvs_cmd_setNetworkEncoding, setEncoding) /* @doc: serverdb.setNetworkTextEncoding @@ -1161,7 +1172,7 @@ SERVERDB_SET_NETWORK_PROPERTY(serverdb_kvs_cmd_setNetworkEncoding,setEncoding) @seealso: [module:serverdb]ServerDB module documentation[/module] */ -SERVERDB_SET_NETWORK_PROPERTY(serverdb_kvs_cmd_setNetworkTextEncoding,setTextEncoding) +SERVERDB_SET_NETWORK_PROPERTY(serverdb_kvs_cmd_setNetworkTextEncoding, setTextEncoding) /* @doc: serverdb.setNetworkDescription @@ -1186,7 +1197,7 @@ SERVERDB_SET_NETWORK_PROPERTY(serverdb_kvs_cmd_setNetworkTextEncoding,setTextEnc @seealso: [module:serverdb]ServerDB module documentation[/module] */ -SERVERDB_SET_NETWORK_PROPERTY(serverdb_kvs_cmd_setNetworkDescription,setDescription) +SERVERDB_SET_NETWORK_PROPERTY(serverdb_kvs_cmd_setNetworkDescription, setDescription) /* @doc: serverdb.setNetworkConnectCommand @@ -1211,7 +1222,7 @@ SERVERDB_SET_NETWORK_PROPERTY(serverdb_kvs_cmd_setNetworkDescription,setDescript @seealso: [module:serverdb]ServerDB module documentation[/module] */ -SERVERDB_SET_NETWORK_PROPERTY(serverdb_kvs_cmd_setNetworkConnectCommand,setOnConnectCommand) +SERVERDB_SET_NETWORK_PROPERTY(serverdb_kvs_cmd_setNetworkConnectCommand, setOnConnectCommand) /* @doc: serverdb.setNetworkLoginCommand @@ -1236,7 +1247,7 @@ SERVERDB_SET_NETWORK_PROPERTY(serverdb_kvs_cmd_setNetworkConnectCommand,setOnCon @seealso: [module:serverdb]ServerDB module documentation[/module] */ -SERVERDB_SET_NETWORK_PROPERTY(serverdb_kvs_cmd_setNetworkLoginCommand,setOnLoginCommand) +SERVERDB_SET_NETWORK_PROPERTY(serverdb_kvs_cmd_setNetworkLoginCommand, setOnLoginCommand) /* @doc: serverdb.setNetworkJoinChannels @@ -1259,7 +1270,7 @@ SERVERDB_SET_NETWORK_PROPERTY(serverdb_kvs_cmd_setNetworkLoginCommand,setOnLogin @seealso: [module:serverdb]ServerDB module documentation[/module] */ -SERVERDB_SET_NETWORK_PROPERTY(serverdb_kvs_cmd_setNetworkJoinChannels,setAutoJoinChannelList) +SERVERDB_SET_NETWORK_PROPERTY(serverdb_kvs_cmd_setNetworkJoinChannels, setAutoJoinChannelList) /* @doc: serverdb.setServerNickName @@ -1284,7 +1295,7 @@ SERVERDB_SET_NETWORK_PROPERTY(serverdb_kvs_cmd_setNetworkJoinChannels,setAutoJoi @seealso: [module:serverdb]ServerDB module documentation[/module] */ -SERVERDB_SET_SERVER_PROPERTY(serverdb_kvs_cmd_setServerNickName,setNickName) +SERVERDB_SET_SERVER_PROPERTY(serverdb_kvs_cmd_setServerNickName, setNickName) /* @doc: serverdb.setServerUserName @@ -1309,7 +1320,7 @@ SERVERDB_SET_SERVER_PROPERTY(serverdb_kvs_cmd_setServerNickName,setNickName) @seealso: [module:serverdb]ServerDB module documentation[/module] */ -SERVERDB_SET_SERVER_PROPERTY(serverdb_kvs_cmd_setServerUserName,setUserName) +SERVERDB_SET_SERVER_PROPERTY(serverdb_kvs_cmd_setServerUserName, setUserName) /* @doc: serverdb.setServerRealName @@ -1334,7 +1345,7 @@ SERVERDB_SET_SERVER_PROPERTY(serverdb_kvs_cmd_setServerUserName,setUserName) @seealso: [module:serverdb]ServerDB module documentation[/module] */ -SERVERDB_SET_SERVER_PROPERTY(serverdb_kvs_cmd_setServerRealName,setRealName) +SERVERDB_SET_SERVER_PROPERTY(serverdb_kvs_cmd_setServerRealName, setRealName) /* @doc: serverdb.setServerEncoding @@ -1360,7 +1371,7 @@ SERVERDB_SET_SERVER_PROPERTY(serverdb_kvs_cmd_setServerRealName,setRealName) @seealso: [module:serverdb]ServerDB module documentation[/module] */ -SERVERDB_SET_SERVER_PROPERTY(serverdb_kvs_cmd_setServerEncoding,setEncoding) +SERVERDB_SET_SERVER_PROPERTY(serverdb_kvs_cmd_setServerEncoding, setEncoding) /* @doc: serverdb.setServerTextEncoding @@ -1385,7 +1396,7 @@ SERVERDB_SET_SERVER_PROPERTY(serverdb_kvs_cmd_setServerEncoding,setEncoding) @seealso: [module:serverdb]ServerDB module documentation[/module] */ -SERVERDB_SET_SERVER_PROPERTY(serverdb_kvs_cmd_setServerTextEncoding,setTextEncoding) +SERVERDB_SET_SERVER_PROPERTY(serverdb_kvs_cmd_setServerTextEncoding, setTextEncoding) /* @doc: serverdb.setServerDescription @@ -1410,7 +1421,7 @@ SERVERDB_SET_SERVER_PROPERTY(serverdb_kvs_cmd_setServerTextEncoding,setTextEncod @seealso: [module:serverdb]ServerDB module documentation[/module] */ -SERVERDB_SET_SERVER_PROPERTY(serverdb_kvs_cmd_setServerDescription,setDescription) +SERVERDB_SET_SERVER_PROPERTY(serverdb_kvs_cmd_setServerDescription, setDescription) /* @doc: serverdb.setServerConnectCommand @@ -1435,7 +1446,7 @@ SERVERDB_SET_SERVER_PROPERTY(serverdb_kvs_cmd_setServerDescription,setDescriptio @seealso: [module:serverdb]ServerDB module documentation[/module] */ -SERVERDB_SET_SERVER_PROPERTY(serverdb_kvs_cmd_setServerConnectCommand,setOnConnectCommand) +SERVERDB_SET_SERVER_PROPERTY(serverdb_kvs_cmd_setServerConnectCommand, setOnConnectCommand) /* @doc: serverdb.setServerLoginCommand @@ -1460,7 +1471,7 @@ SERVERDB_SET_SERVER_PROPERTY(serverdb_kvs_cmd_setServerConnectCommand,setOnConne @seealso: [module:serverdb]ServerDB module documentation[/module] */ -SERVERDB_SET_SERVER_PROPERTY(serverdb_kvs_cmd_setServerLoginCommand,setOnLoginCommand) +SERVERDB_SET_SERVER_PROPERTY(serverdb_kvs_cmd_setServerLoginCommand, setOnLoginCommand) /* @doc: serverdb.setServerJoinChannels @@ -1483,7 +1494,7 @@ SERVERDB_SET_SERVER_PROPERTY(serverdb_kvs_cmd_setServerLoginCommand,setOnLoginCo @seealso: [module:serverdb]ServerDB module documentation[/module] */ -SERVERDB_SET_SERVER_PROPERTY(serverdb_kvs_cmd_setServerJoinChannels,setAutoJoinChannelList) +SERVERDB_SET_SERVER_PROPERTY(serverdb_kvs_cmd_setServerJoinChannels, setAutoJoinChannelList) static bool serverdb_module_init(KviModule * m) { @@ -1491,57 +1502,57 @@ static bool serverdb_module_init(KviModule * m) KVSM_REGISTER_SIMPLE_COMMAND(m,"updateList",serverdb_kvs_cmd_updateList); */ - KVSM_REGISTER_FUNCTION(m,"favorite",serverdb_kvs_fnc_serverFavorite); - KVSM_REGISTER_FUNCTION(m,"cacheIp",serverdb_kvs_fnc_serverCacheIp); - KVSM_REGISTER_FUNCTION(m,"networkConnectCommand",serverdb_kvs_fnc_networkConnectCommand); - KVSM_REGISTER_FUNCTION(m,"networkDescription",serverdb_kvs_fnc_networkDescription); - KVSM_REGISTER_FUNCTION(m,"networkEncoding",serverdb_kvs_fnc_networkEncoding); - KVSM_REGISTER_FUNCTION(m,"networkTextEncoding",serverdb_kvs_fnc_networkTextEncoding); - KVSM_REGISTER_FUNCTION(m,"networkLoginCommand",serverdb_kvs_fnc_networkLoginCommand); - KVSM_REGISTER_FUNCTION(m,"networkName",serverdb_kvs_fnc_networkName); - KVSM_REGISTER_FUNCTION(m,"networkNickName",serverdb_kvs_fnc_networkNickName); - KVSM_REGISTER_FUNCTION(m,"networkRealName",serverdb_kvs_fnc_networkRealName); - KVSM_REGISTER_FUNCTION(m,"networkUserName",serverdb_kvs_fnc_networkUserName); - KVSM_REGISTER_FUNCTION(m,"networkJoinChannels",serverdb_kvs_fnc_networkJoinChannels); - KVSM_REGISTER_FUNCTION(m,"serverConnectCommand",serverdb_kvs_fnc_serverConnectCommand); - KVSM_REGISTER_FUNCTION(m,"serverDescription",serverdb_kvs_fnc_serverDescription); - KVSM_REGISTER_FUNCTION(m,"serverEncoding",serverdb_kvs_fnc_serverEncoding); - KVSM_REGISTER_FUNCTION(m,"serverTextEncoding",serverdb_kvs_fnc_serverTextEncoding); - KVSM_REGISTER_FUNCTION(m,"serverId",serverdb_kvs_fnc_serverId) - KVSM_REGISTER_FUNCTION(m,"serverIp",serverdb_kvs_fnc_serverIp) - KVSM_REGISTER_FUNCTION(m,"serverLoginCommand",serverdb_kvs_fnc_serverLoginCommand); - KVSM_REGISTER_FUNCTION(m,"serverNickName",serverdb_kvs_fnc_serverNickName); - KVSM_REGISTER_FUNCTION(m,"serverPassword",serverdb_kvs_fnc_serverPassword); - KVSM_REGISTER_FUNCTION(m,"serverPort",serverdb_kvs_fnc_serverPort); - KVSM_REGISTER_FUNCTION(m,"serverRealName",serverdb_kvs_fnc_serverRealName); - KVSM_REGISTER_FUNCTION(m,"serverUserName",serverdb_kvs_fnc_serverUserName); - KVSM_REGISTER_FUNCTION(m,"serverJoinChannels",serverdb_kvs_fnc_serverJoinChannels); - KVSM_REGISTER_FUNCTION(m,"isAutoConnect",serverdb_kvs_fnc_serverAutoConnect); - KVSM_REGISTER_FUNCTION(m,"isIPv6",serverdb_kvs_fnc_serverIPv6); - KVSM_REGISTER_FUNCTION(m,"isSSL",serverdb_kvs_fnc_serverSSL); - KVSM_REGISTER_FUNCTION(m,"networkExists",serverdb_kvs_fnc_networkExists); - KVSM_REGISTER_FUNCTION(m,"serverExists",serverdb_kvs_fnc_serverExists); - - KVSM_REGISTER_SIMPLE_COMMAND(m,"addNetwork",serverdb_kvs_cmd_addNetwork); - KVSM_REGISTER_SIMPLE_COMMAND(m,"addServer",serverdb_kvs_cmd_addServer); - KVSM_REGISTER_SIMPLE_COMMAND(m,"setNetworkConnectCommand",serverdb_kvs_cmd_setNetworkConnectCommand); - KVSM_REGISTER_SIMPLE_COMMAND(m,"setNetworkEncoding",serverdb_kvs_cmd_setNetworkEncoding); - KVSM_REGISTER_SIMPLE_COMMAND(m,"setNetworkTextEncoding",serverdb_kvs_cmd_setNetworkTextEncoding); - KVSM_REGISTER_SIMPLE_COMMAND(m,"setNetworkDescription",serverdb_kvs_cmd_setNetworkDescription); - KVSM_REGISTER_SIMPLE_COMMAND(m,"setNetworkLoginCommand",serverdb_kvs_cmd_setNetworkLoginCommand); - KVSM_REGISTER_SIMPLE_COMMAND(m,"setNetworkNickName",serverdb_kvs_cmd_setNetworkNickName); - KVSM_REGISTER_SIMPLE_COMMAND(m,"setNetworkRealName",serverdb_kvs_cmd_setNetworkRealName); - KVSM_REGISTER_SIMPLE_COMMAND(m,"setNetworkUserName",serverdb_kvs_cmd_setNetworkUserName); - KVSM_REGISTER_SIMPLE_COMMAND(m,"setNetworkJoinChannels",serverdb_kvs_cmd_setNetworkJoinChannels); - KVSM_REGISTER_SIMPLE_COMMAND(m,"setServerConnectCommand",serverdb_kvs_cmd_setServerConnectCommand); - KVSM_REGISTER_SIMPLE_COMMAND(m,"setServerEncoding",serverdb_kvs_cmd_setServerEncoding); - KVSM_REGISTER_SIMPLE_COMMAND(m,"setServerTextEncoding",serverdb_kvs_cmd_setServerTextEncoding); - KVSM_REGISTER_SIMPLE_COMMAND(m,"setServerDescription",serverdb_kvs_cmd_setServerDescription); - KVSM_REGISTER_SIMPLE_COMMAND(m,"setServerLoginCommand",serverdb_kvs_cmd_setServerLoginCommand); - KVSM_REGISTER_SIMPLE_COMMAND(m,"setServerNickName",serverdb_kvs_cmd_setServerNickName); - KVSM_REGISTER_SIMPLE_COMMAND(m,"setServerRealName",serverdb_kvs_cmd_setServerRealName); - KVSM_REGISTER_SIMPLE_COMMAND(m,"setServerUserName",serverdb_kvs_cmd_setServerUserName); - KVSM_REGISTER_SIMPLE_COMMAND(m,"setServerJoinChannels",serverdb_kvs_cmd_setServerJoinChannels); + KVSM_REGISTER_FUNCTION(m, "favorite", serverdb_kvs_fnc_serverFavorite); + KVSM_REGISTER_FUNCTION(m, "cacheIp", serverdb_kvs_fnc_serverCacheIp); + KVSM_REGISTER_FUNCTION(m, "networkConnectCommand", serverdb_kvs_fnc_networkConnectCommand); + KVSM_REGISTER_FUNCTION(m, "networkDescription", serverdb_kvs_fnc_networkDescription); + KVSM_REGISTER_FUNCTION(m, "networkEncoding", serverdb_kvs_fnc_networkEncoding); + KVSM_REGISTER_FUNCTION(m, "networkTextEncoding", serverdb_kvs_fnc_networkTextEncoding); + KVSM_REGISTER_FUNCTION(m, "networkLoginCommand", serverdb_kvs_fnc_networkLoginCommand); + KVSM_REGISTER_FUNCTION(m, "networkName", serverdb_kvs_fnc_networkName); + KVSM_REGISTER_FUNCTION(m, "networkNickName", serverdb_kvs_fnc_networkNickName); + KVSM_REGISTER_FUNCTION(m, "networkRealName", serverdb_kvs_fnc_networkRealName); + KVSM_REGISTER_FUNCTION(m, "networkUserName", serverdb_kvs_fnc_networkUserName); + KVSM_REGISTER_FUNCTION(m, "networkJoinChannels", serverdb_kvs_fnc_networkJoinChannels); + KVSM_REGISTER_FUNCTION(m, "serverConnectCommand", serverdb_kvs_fnc_serverConnectCommand); + KVSM_REGISTER_FUNCTION(m, "serverDescription", serverdb_kvs_fnc_serverDescription); + KVSM_REGISTER_FUNCTION(m, "serverEncoding", serverdb_kvs_fnc_serverEncoding); + KVSM_REGISTER_FUNCTION(m, "serverTextEncoding", serverdb_kvs_fnc_serverTextEncoding); + KVSM_REGISTER_FUNCTION(m, "serverId", serverdb_kvs_fnc_serverId) + KVSM_REGISTER_FUNCTION(m, "serverIp", serverdb_kvs_fnc_serverIp) + KVSM_REGISTER_FUNCTION(m, "serverLoginCommand", serverdb_kvs_fnc_serverLoginCommand); + KVSM_REGISTER_FUNCTION(m, "serverNickName", serverdb_kvs_fnc_serverNickName); + KVSM_REGISTER_FUNCTION(m, "serverPassword", serverdb_kvs_fnc_serverPassword); + KVSM_REGISTER_FUNCTION(m, "serverPort", serverdb_kvs_fnc_serverPort); + KVSM_REGISTER_FUNCTION(m, "serverRealName", serverdb_kvs_fnc_serverRealName); + KVSM_REGISTER_FUNCTION(m, "serverUserName", serverdb_kvs_fnc_serverUserName); + KVSM_REGISTER_FUNCTION(m, "serverJoinChannels", serverdb_kvs_fnc_serverJoinChannels); + KVSM_REGISTER_FUNCTION(m, "isAutoConnect", serverdb_kvs_fnc_serverAutoConnect); + KVSM_REGISTER_FUNCTION(m, "isIPv6", serverdb_kvs_fnc_serverIPv6); + KVSM_REGISTER_FUNCTION(m, "isSSL", serverdb_kvs_fnc_serverSSL); + KVSM_REGISTER_FUNCTION(m, "networkExists", serverdb_kvs_fnc_networkExists); + KVSM_REGISTER_FUNCTION(m, "serverExists", serverdb_kvs_fnc_serverExists); + + KVSM_REGISTER_SIMPLE_COMMAND(m, "addNetwork", serverdb_kvs_cmd_addNetwork); + KVSM_REGISTER_SIMPLE_COMMAND(m, "addServer", serverdb_kvs_cmd_addServer); + KVSM_REGISTER_SIMPLE_COMMAND(m, "setNetworkConnectCommand", serverdb_kvs_cmd_setNetworkConnectCommand); + KVSM_REGISTER_SIMPLE_COMMAND(m, "setNetworkEncoding", serverdb_kvs_cmd_setNetworkEncoding); + KVSM_REGISTER_SIMPLE_COMMAND(m, "setNetworkTextEncoding", serverdb_kvs_cmd_setNetworkTextEncoding); + KVSM_REGISTER_SIMPLE_COMMAND(m, "setNetworkDescription", serverdb_kvs_cmd_setNetworkDescription); + KVSM_REGISTER_SIMPLE_COMMAND(m, "setNetworkLoginCommand", serverdb_kvs_cmd_setNetworkLoginCommand); + KVSM_REGISTER_SIMPLE_COMMAND(m, "setNetworkNickName", serverdb_kvs_cmd_setNetworkNickName); + KVSM_REGISTER_SIMPLE_COMMAND(m, "setNetworkRealName", serverdb_kvs_cmd_setNetworkRealName); + KVSM_REGISTER_SIMPLE_COMMAND(m, "setNetworkUserName", serverdb_kvs_cmd_setNetworkUserName); + KVSM_REGISTER_SIMPLE_COMMAND(m, "setNetworkJoinChannels", serverdb_kvs_cmd_setNetworkJoinChannels); + KVSM_REGISTER_SIMPLE_COMMAND(m, "setServerConnectCommand", serverdb_kvs_cmd_setServerConnectCommand); + KVSM_REGISTER_SIMPLE_COMMAND(m, "setServerEncoding", serverdb_kvs_cmd_setServerEncoding); + KVSM_REGISTER_SIMPLE_COMMAND(m, "setServerTextEncoding", serverdb_kvs_cmd_setServerTextEncoding); + KVSM_REGISTER_SIMPLE_COMMAND(m, "setServerDescription", serverdb_kvs_cmd_setServerDescription); + KVSM_REGISTER_SIMPLE_COMMAND(m, "setServerLoginCommand", serverdb_kvs_cmd_setServerLoginCommand); + KVSM_REGISTER_SIMPLE_COMMAND(m, "setServerNickName", serverdb_kvs_cmd_setServerNickName); + KVSM_REGISTER_SIMPLE_COMMAND(m, "setServerRealName", serverdb_kvs_cmd_setServerRealName); + KVSM_REGISTER_SIMPLE_COMMAND(m, "setServerUserName", serverdb_kvs_cmd_setServerUserName); + KVSM_REGISTER_SIMPLE_COMMAND(m, "setServerJoinChannels", serverdb_kvs_cmd_setServerJoinChannels); return true; } @@ -1557,13 +1568,12 @@ static bool serverdb_module_can_unload(KviModule *) } KVIRC_MODULE( - "ServerDB", // module name - "4.0.0", // module version - "Copyright (C) 2008 Elvio Basello (hellvis69 at netsons dot org)", // author & (C) - "IRC serverDB related functions", - serverdb_module_init, - serverdb_module_can_unload, - 0, - serverdb_module_cleanup, - "serverdb" -) + "ServerDB", // module name + "4.0.0", // module version + "Copyright (C) 2008 Elvio Basello (hellvis69 at netsons dot org)", // author & (C) + "IRC serverDB related functions", + serverdb_module_init, + serverdb_module_can_unload, + 0, + serverdb_module_cleanup, + "serverdb") diff --git a/src/modules/setup/SetupWizard.cpp b/src/modules/setup/SetupWizard.cpp index 167c2c2a8..153af8767 100644 --- a/src/modules/setup/SetupWizard.cpp +++ b/src/modules/setup/SetupWizard.cpp @@ -48,14 +48,13 @@ bool g_bFoundMirc; #include #if defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW) - #include // for MultiByteToWideChar - #include // CoCreateInstance, CoInitialize & CO. - #include // IShellLink IPersistFile & CO. +#include // for MultiByteToWideChar +#include // CoCreateInstance, CoInitialize & CO. +#include // IShellLink IPersistFile & CO. #else - #include // for symlink() +#include // for symlink() #endif - // libkvisetup.cpp extern QString g_szChoosenIncomingDirectory; extern int g_iThemeToApply; @@ -67,13 +66,13 @@ extern QString szMircServers; extern QString szMircIni; #if defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW) - #define KVI_LOCAL_KVIRC_SUBDIRECTORY_NAME "KVIrc4" +#define KVI_LOCAL_KVIRC_SUBDIRECTORY_NAME "KVIrc4" #else - #define KVI_LOCAL_KVIRC_SUBDIRECTORY_NAME ".config/KVIrc" +#define KVI_LOCAL_KVIRC_SUBDIRECTORY_NAME ".config/KVIrc" #endif SetupPage::SetupPage(SetupWizard * w) -: QWidget(w) + : QWidget(w) { QGridLayout * g = new QGridLayout(this); @@ -87,7 +86,7 @@ SetupPage::SetupPage(SetupWizard * w) //w->KviTalWizard::helpButton()->setText(__tr2qs("Help")); m_pPixmapLabel = new QLabel(this); - g->addWidget(m_pPixmapLabel,0,0); + g->addWidget(m_pPixmapLabel, 0, 0); m_pPixmapLabel->setPixmap(*(w->m_pLabelPixmap)); m_pPixmapLabel->setFixedSize(w->m_pLabelPixmap->size()); @@ -103,16 +102,16 @@ SetupPage::SetupPage(SetupWizard * w) //m_pVBox->setSizePolicy(QSizePolicy(QSizePolicy::Expanding)); //m_pVBox->setBackgroundColor(QColor(0,80,0)); //m_pVBox->setMaximumHeight(450); - g->addWidget(m_pVBox,0,1); + g->addWidget(m_pVBox, 0, 1); - g->setColumnStretch(1,1); + g->setColumnStretch(1, 1); QLabel * l = new QLabel(m_pVBox); l->setAlignment(Qt::AlignLeft | Qt::AlignTop); - QPalette pal=l->palette(); - pal.setColor(l->backgroundRole(), QColor(48,48,48)); //aka #303030 - pal.setColor(l->foregroundRole(), QColor(255,255,255)); //aka #FFFFFF + QPalette pal = l->palette(); + pal.setColor(l->backgroundRole(), QColor(48, 48, 48)); //aka #303030 + pal.setColor(l->foregroundRole(), QColor(255, 255, 255)); //aka #FFFFFF l->setPalette(pal); l->setText("

 KVIrc " KVI_VERSION "

"); l->setFrameStyle(QFrame::Sunken | QFrame::StyledPanel); @@ -123,16 +122,15 @@ SetupPage::SetupPage(SetupWizard * w) m_pTextLabel = new QLabel(m_pVBox); m_pTextLabel->setWordWrap(true); m_pTextLabel->setAlignment(Qt::AlignJustify | Qt::AlignTop); - m_pVBox->setStretchFactor(m_pTextLabel,1); + m_pVBox->setStretchFactor(m_pTextLabel, 1); } SetupPage::~SetupPage() { } - SetupWizard::SetupWizard() -: KviTalWizard(0) + : KviTalWizard(0) { setWindowTitle(__tr2qs("Setup Wizard - KVIrc")); @@ -142,13 +140,13 @@ SetupWizard::SetupWizard() QString szLabelText; QString szImagePath; - g_pApp->getGlobalKvircDirectory(szImagePath,KviApplication::Pics,"kvi_setup_label.png"); + g_pApp->getGlobalKvircDirectory(szImagePath, KviApplication::Pics, "kvi_setup_label.png"); m_pLabelPixmap = new QPixmap(szImagePath); if(m_pLabelPixmap->isNull()) { delete m_pLabelPixmap; - m_pLabelPixmap = new QPixmap(250,450); + m_pLabelPixmap = new QPixmap(250, 450); } ///////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -157,135 +155,130 @@ SetupWizard::SetupWizard() m_pWelcome = new SetupPage(this); // here we go... - QString szText = __tr2qs("

" \ - "

Welcome :)

" \ - "This is your first time running this version of KVIrc.
" \ - "This wizard will guide you through the few steps " \ - "required to complete the setup.

" \ - "If you had a previous version of KVIrc installed, no worries. You will " \ - "have a chance to preserve the old configuration." \ - "

" \ - "

Click \"Next\" to proceed.

"); + QString szText = __tr2qs("

" + "

Welcome :)

" + "This is your first time running this version of KVIrc.
" + "This wizard will guide you through the few steps " + "required to complete the setup.

" + "If you had a previous version of KVIrc installed, no worries. You will " + "have a chance to preserve the old configuration." + "

" + "

Click \"Next\" to proceed.

"); m_pWelcome->m_pTextLabel->setText(szText); - addPage(m_pWelcome,__tr2qs("Welcome to KVIrc")); - - setBackEnabled(m_pWelcome,false); - setHelpEnabled(m_pWelcome,false); + addPage(m_pWelcome, __tr2qs("Welcome to KVIrc")); + setBackEnabled(m_pWelcome, false); + setHelpEnabled(m_pWelcome, false); - ///////////////////////////////////////////////////////////////////////////////////////////////////////////// - // License +///////////////////////////////////////////////////////////////////////////////////////////////////////////// +// License #if defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW) //it have been already shown by installer SetupPage * m_pLicense = new SetupPage(this); - m_pLicense->m_pTextLabel->setText(__tr2qs( \ - "

All of the files in this distribution are covered by the GPL. " \ - "In human terms this can be read as follows:
" \ - "

    " \ - "
  • KVIrc is free, use it, have fun! :)
  • " \ - "
  • If you use any part of KVIrc in your own project, you must release that project under the same license.
  • " \ - "

" \ - "

The \"legalese\" version of the license is shown in the box below.

")); + m_pLicense->m_pTextLabel->setText(__tr2qs( + "

All of the files in this distribution are covered by the GPL. " + "In human terms this can be read as follows:
" + "

    " + "
  • KVIrc is free, use it, have fun! :)
  • " + "
  • If you use any part of KVIrc in your own project, you must release that project under the same license.
  • " + "

" + "

The \"legalese\" version of the license is shown in the box below.

")); QTextEdit * ed = new QTextEdit(m_pLicense->m_pVBox); ed->setReadOnly(true); ed->setWordWrapMode(QTextOption::NoWrap); QString szLicense; QString szLicensePath; - g_pApp->getGlobalKvircDirectory(szLicensePath,KviApplication::License,"COPYING"); - if(!KviFileUtils::loadFile(szLicensePath,szLicense)) + g_pApp->getGlobalKvircDirectory(szLicensePath, KviApplication::License, "COPYING"); + if(!KviFileUtils::loadFile(szLicensePath, szLicense)) { - szLicense = __tr("Oops! Can't find the license file.\n" \ - "It MUST be included in the distribution...\n" \ - "Please report to "); + szLicense = __tr("Oops! Can't find the license file.\n" + "It MUST be included in the distribution...\n" + "Please report to "); } ed->setText(szLicense); - m_pLicense->m_pVBox->setStretchFactor(ed,1); + m_pLicense->m_pVBox->setStretchFactor(ed, 1); - addPage(m_pLicense,__tr2qs("Dreaded License Agreement")); + addPage(m_pLicense, __tr2qs("Dreaded License Agreement")); - setHelpEnabled(m_pLicense,false); + setHelpEnabled(m_pLicense, false); #else m_pLicense = 0; #endif -///////////////////////////////////////////////////////////////////////////////////////////////////////////// + ///////////////////////////////////////////////////////////////////////////////////////////////////////////// // Directories m_pDirectory = new SetupPage(this); - m_pDirectory->m_pTextLabel->setText(__tr2qs("

Please choose a folder for " \ - "KVIrc to store its settings and other data, and another for downloaded files. " \ - "Make sure that you have permission to write to both folders.

" \ - "The suggested locations are fine in most cases. If you don't know what " \ - "this is about, just click \"Next\".

" \ - "If you had a previous version of KVIrc installed, you can choose " \ - "the existing directory for the settings, and your configuration " \ - "will be preserved." \ - "

")); - + m_pDirectory->m_pTextLabel->setText(__tr2qs("

Please choose a folder for " + "KVIrc to store its settings and other data, and another for downloaded files. " + "Make sure that you have permission to write to both folders.

" + "The suggested locations are fine in most cases. If you don't know what " + "this is about, just click \"Next\".

" + "If you had a previous version of KVIrc installed, you can choose " + "the existing directory for the settings, and your configuration " + "will be preserved." + "

")); QString tmp; - m_pDirButtonGroup = new KviTalGroupBox(Qt::Horizontal,__tr2qs("Store configuration in folder"),m_pDirectory->m_pVBox); - m_pDirUsePrev = new QRadioButton(__tr2qs("Use settings folder from previous installation"),m_pDirButtonGroup); - connect(m_pDirUsePrev,SIGNAL(clicked()),this,SLOT(oldDirClicked())); + m_pDirButtonGroup = new KviTalGroupBox(Qt::Horizontal, __tr2qs("Store configuration in folder"), m_pDirectory->m_pVBox); + m_pDirUsePrev = new QRadioButton(__tr2qs("Use settings folder from previous installation"), m_pDirButtonGroup); + connect(m_pDirUsePrev, SIGNAL(clicked()), this, SLOT(oldDirClicked())); m_pOldPathBox = new KviTalHBox(m_pDirButtonGroup); m_pOldDataPathEdit = new QLineEdit(m_pOldPathBox); - connect(m_pOldDataPathEdit,SIGNAL(textChanged ( const QString & )),this,SLOT(oldDataTextChanged ( const QString & ))); + connect(m_pOldDataPathEdit, SIGNAL(textChanged(const QString &)), this, SLOT(oldDataTextChanged(const QString &))); - QPushButton * pb = new QPushButton(__tr2qs("&Browse..."),m_pOldPathBox); - connect(pb,SIGNAL(clicked()),this,SLOT(chooseOldDataPath())); + QPushButton * pb = new QPushButton(__tr2qs("&Browse..."), m_pOldPathBox); + connect(pb, SIGNAL(clicked()), this, SLOT(chooseOldDataPath())); m_pOldPathBox->setSpacing(3); - m_pOldPathBox->setStretchFactor(m_pOldDataPathEdit,1); + m_pOldPathBox->setStretchFactor(m_pOldDataPathEdit, 1); - m_pDirUseNew = new QRadioButton(__tr2qs("Use new settings folder"),m_pDirButtonGroup); - connect(m_pDirUseNew,SIGNAL(clicked()),this,SLOT(newDirClicked())); + m_pDirUseNew = new QRadioButton(__tr2qs("Use new settings folder"), m_pDirButtonGroup); + connect(m_pDirUseNew, SIGNAL(clicked()), this, SLOT(newDirClicked())); - QLabel* l = new QLabel(m_pDirButtonGroup); + QLabel * l = new QLabel(m_pDirButtonGroup); l->setText(__tr2qs("Settings folder:")); m_pNewPathBox = new KviTalHBox(m_pDirButtonGroup); m_pDataPathEdit = new QLineEdit(m_pNewPathBox); - pb = new QPushButton(__tr2qs("&Browse..."),m_pNewPathBox); - connect(pb,SIGNAL(clicked()),this,SLOT(chooseDataPath())); + pb = new QPushButton(__tr2qs("&Browse..."), m_pNewPathBox); + connect(pb, SIGNAL(clicked()), this, SLOT(chooseDataPath())); m_pNewPathBox->setSpacing(3); - m_pNewPathBox->setStretchFactor(m_pDataPathEdit,1); + m_pNewPathBox->setStretchFactor(m_pDataPathEdit, 1); #if defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW) - tmp = QTextCodec::codecForLocale()->toUnicode(getenv( "APPDATA" )); + tmp = QTextCodec::codecForLocale()->toUnicode(getenv("APPDATA")); if(tmp.isEmpty()) tmp = QDir::homePath(); #else tmp = QDir::homePath(); #endif //COMPILE_ON_WINDOWS - KviQString::ensureLastCharIs(tmp,KVI_PATH_SEPARATOR_CHAR); + KviQString::ensureLastCharIs(tmp, KVI_PATH_SEPARATOR_CHAR); tmp.append(KVI_LOCAL_KVIRC_SUBDIRECTORY_NAME); KviFileUtils::adjustFilePath(tmp); m_pDataPathEdit->setText(tmp); - - l = new QLabel(m_pDirButtonGroup); l->setText(__tr2qs("Download files to folder:")); - m_pNewIncomingBox = new KviTalHBox(m_pDirButtonGroup); m_pIncomingPathEdit = new QLineEdit(m_pNewIncomingBox); - pb = new QPushButton(__tr2qs("&Browse..."),m_pNewIncomingBox); - connect(pb,SIGNAL(clicked()),this,SLOT(chooseIncomingPath())); + pb = new QPushButton(__tr2qs("&Browse..."), m_pNewIncomingBox); + connect(pb, SIGNAL(clicked()), this, SLOT(chooseIncomingPath())); m_pNewIncomingBox->setSpacing(3); - m_pNewIncomingBox->setStretchFactor(m_pIncomingPathEdit,1); + m_pNewIncomingBox->setStretchFactor(m_pIncomingPathEdit, 1); tmp = QDir::homePath(); - KviQString::ensureLastCharIs(tmp,KVI_PATH_SEPARATOR_CHAR); + KviQString::ensureLastCharIs(tmp, KVI_PATH_SEPARATOR_CHAR); tmp.append(KVI_DEFAULT_INCOMING_SUBDIRECTORY_NAME); KviFileUtils::adjustFilePath(tmp); m_pIncomingPathEdit->setText(tmp); @@ -293,9 +286,8 @@ SetupWizard::SetupWizard() m_pDirUseNew->toggle(); #if defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW) - m_pDirMakePortable = new QRadioButton(__tr2qs("All settings in shared program folder (portable)") - ,m_pDirButtonGroup); - connect(m_pDirMakePortable,SIGNAL(clicked()),this,SLOT(portableClicked())); + m_pDirMakePortable = new QRadioButton(__tr2qs("All settings in shared program folder (portable)"), m_pDirButtonGroup); + connect(m_pDirMakePortable, SIGNAL(clicked()), this, SLOT(portableClicked())); #endif // Pragma: Unused, takes only space. //m_pDirRestore = new QRadioButton(__tr2qs("Restore from backup archive"),m_pDirButtonGroup); @@ -305,218 +297,219 @@ SetupWizard::SetupWizard() //m_pDirectory->m_pVBox->setStretchFactor(m_pDirectory->m_pTextLabel,1); - addPage(m_pDirectory,__tr2qs("Application Folders")); - setHelpEnabled(m_pDirectory,false); + addPage(m_pDirectory, __tr2qs("Application Folders")); + setHelpEnabled(m_pDirectory, false); - connect(m_pDataPathEdit,SIGNAL(textChanged ( const QString & )),this,SLOT(newDataTextChanged ( const QString & ))); - connect(m_pIncomingPathEdit,SIGNAL(textChanged ( const QString & )),this,SLOT(newIncomingTextChanged ( const QString & ))); + connect(m_pDataPathEdit, SIGNAL(textChanged(const QString &)), this, SLOT(newDataTextChanged(const QString &))); + connect(m_pIncomingPathEdit, SIGNAL(textChanged(const QString &)), this, SLOT(newIncomingTextChanged(const QString &))); ///////////////////////////////////////////////////////////////////////////////////////////////////////////// // Identity m_pIdentity = new SetupPage(this); - m_pIdentity->m_pTextLabel->setText(__tr2qs("Please choose a nickname.

" \ - "Your nickname is the name that other IRC users will know you by. " \ - "It can't contain spaces or punctuation. Some IRC networks will shorten your nickname if it is more than 32 characters " \ - "long.

" - "If in doubt, just enter the first nick that comes to mind. " \ - "You will be able to change it later in the Identity properties, or with the /NICK command.")); + m_pIdentity->m_pTextLabel->setText(__tr2qs("Please choose a nickname.

" + "Your nickname is the name that other IRC users will know you by. " + "It can't contain spaces or punctuation. Some IRC networks will shorten your nickname if it is more than 32 characters " + "long.

" + "If in doubt, just enter the first nick that comes to mind. " + "You will be able to change it later in the Identity properties, or with the /NICK command.")); - KviTalGroupBox * gbox = new KviTalGroupBox(Qt::Horizontal,QString(),m_pIdentity->m_pVBox); + KviTalGroupBox * gbox = new KviTalGroupBox(Qt::Horizontal, QString(), m_pIdentity->m_pVBox); - m_pNickSelector = new KviStringSelector(gbox,__tr2qs("Nickname:"),&(KVI_OPTION_STRING(KviOption_stringNickname1)),true); + m_pNickSelector = new KviStringSelector(gbox, __tr2qs("Nickname:"), &(KVI_OPTION_STRING(KviOption_stringNickname1)), true); m_pNickSelector->setMinimumLabelWidth(120); m_pNickSelector->setMargin(0); - QObject::connect(m_pNickSelector->lineEdit(),SIGNAL(textChanged(const QString &)),this,SLOT(nickSelectorTextChanged(const QString &))); + QObject::connect(m_pNickSelector->lineEdit(), SIGNAL(textChanged(const QString &)), this, SLOT(nickSelectorTextChanged(const QString &))); - QValidator * v = new QRegExpValidator(QRegExp("[^-0-9 ][^ ]*"),gbox); + QValidator * v = new QRegExpValidator(QRegExp("[^-0-9 ][^ ]*"), gbox); m_pNickSelector->setValidator(v); QString szOptionalCtcpUserInfo = __tr2qs("This field is optional and will appear as part of the CTCP USERINFO reply."); QString szTrailing = "

" + szOptionalCtcpUserInfo; - gbox = new KviTalGroupBox(Qt::Horizontal,__tr2qs("Profile"),m_pIdentity->m_pVBox); + gbox = new KviTalGroupBox(Qt::Horizontal, __tr2qs("Profile"), m_pIdentity->m_pVBox); - m_pRealNameSelector = new KviStringSelector(gbox,__tr2qs("Real name:"),&(KVI_OPTION_STRING(KviOption_stringRealname)),true); + m_pRealNameSelector = new KviStringSelector(gbox, __tr2qs("Real name:"), &(KVI_OPTION_STRING(KviOption_stringRealname)), true); m_pRealNameSelector->setMinimumLabelWidth(120); m_pRealNameSelector->setMargin(0); - KviTalHBox* hb = new KviTalHBox(gbox); + KviTalHBox * hb = new KviTalHBox(gbox); hb->setSpacing(4); hb->setMargin(0); - l = new QLabel(__tr2qs("Age:"),hb); + l = new QLabel(__tr2qs("Age:"), hb); l->setMinimumWidth(120); m_pAgeCombo = new QComboBox(hb); - m_pAgeCombo->insertItem(0,__tr2qs("Unspecified")); + m_pAgeCombo->insertItem(0, __tr2qs("Unspecified")); unsigned int i; - for(i=1;i<120;i++) + for(i = 1; i < 120; i++) { QString tmp; tmp.setNum(i); - m_pAgeCombo->insertItem(m_pAgeCombo->count(),tmp); + m_pAgeCombo->insertItem(m_pAgeCombo->count(), tmp); } bool bOk; i = KVI_OPTION_STRING(KviOption_stringCtcpUserInfoAge).toUInt(&bOk); - if(!bOk)i = 0; - if(i > 120)i = 120; + if(!bOk) + i = 0; + if(i > 120) + i = 120; m_pAgeCombo->setCurrentIndex(i); - hb->setStretchFactor(m_pAgeCombo,1); - + hb->setStretchFactor(m_pAgeCombo, 1); hb = new KviTalHBox(gbox); hb->setSpacing(4); hb->setMargin(0); - l = new QLabel(__tr2qs("Gender:"),hb); + l = new QLabel(__tr2qs("Gender:"), hb); l->setMinimumWidth(120); m_pGenderCombo = new QComboBox(hb); - m_pGenderCombo->insertItem(0,__tr2qs("Unspecified")); - m_pGenderCombo->insertItem(1,__tr2qs("Female")); - m_pGenderCombo->insertItem(2,__tr2qs("Male")); + m_pGenderCombo->insertItem(0, __tr2qs("Unspecified")); + m_pGenderCombo->insertItem(1, __tr2qs("Female")); + m_pGenderCombo->insertItem(2, __tr2qs("Male")); - if(KviQString::equalCI(KVI_OPTION_STRING(KviOption_stringCtcpUserInfoGender),"Male")) + if(KviQString::equalCI(KVI_OPTION_STRING(KviOption_stringCtcpUserInfoGender), "Male")) m_pGenderCombo->setCurrentIndex(2); - else if(KviQString::equalCI(KVI_OPTION_STRING(KviOption_stringCtcpUserInfoGender),"Female")) + else if(KviQString::equalCI(KVI_OPTION_STRING(KviOption_stringCtcpUserInfoGender), "Female")) m_pGenderCombo->setCurrentIndex(1); else m_pGenderCombo->setCurrentIndex(0); - hb->setStretchFactor(m_pGenderCombo,1); + hb->setStretchFactor(m_pGenderCombo, 1); - m_pLocationSelector = new KviStringSelector(gbox,__tr2qs("Location:"),&(KVI_OPTION_STRING(KviOption_stringCtcpUserInfoLocation)),true); + m_pLocationSelector = new KviStringSelector(gbox, __tr2qs("Location:"), &(KVI_OPTION_STRING(KviOption_stringCtcpUserInfoLocation)), true); m_pLocationSelector->setMinimumLabelWidth(120); m_pLocationSelector->setMargin(0); - m_pLanguagesSelector = new KviStringSelector(gbox,__tr2qs("Languages:"),&(KVI_OPTION_STRING(KviOption_stringCtcpUserInfoLanguages)),true); + m_pLanguagesSelector = new KviStringSelector(gbox, __tr2qs("Languages:"), &(KVI_OPTION_STRING(KviOption_stringCtcpUserInfoLanguages)), true); m_pLanguagesSelector->setMinimumLabelWidth(120); m_pLanguagesSelector->setMargin(0); //m_pOtherInfoSelector = new KviStringSelector(gbox,__tr2qs("Other:"),&(KVI_OPTION_STRING(KviOption_stringCtcpUserInfoOther)),true); //m_pOtherInfoSelector->setMinimumLabelWidth(120); - addPage(m_pIdentity,__tr2qs("Identity")); + addPage(m_pIdentity, __tr2qs("Identity")); //l = new QLabel(m_pIdentity->m_pVBox," "); - setHelpEnabled(m_pIdentity,false); + setHelpEnabled(m_pIdentity, false); ///////////////////////////////////////////////////////////////////////////////////////////////////////////// // Default theme m_pTheme = new SetupPage(this); - m_pTheme->m_pTextLabel->setText(__tr2qs( \ - "

Here you can choose the default appearance of KVIrc.

" \ - "The Fancy theme uses icons, a transparent background and a lot of colors. " \ - "The Minimalist theme is designed for low-color displays " \ - "or for \"console\" extremists; it's more or less white text on a black background.

" \ - "If you had a previous version of KVIrc installed, you can choose to not apply any theme " \ - "in order to preserve your current visual settings.

" \ - "If you don't know what to choose, just use the default.

")); - - m_pThemeButtonGroup = new QGroupBox(m_pTheme->m_pVBox); - - QGridLayout *pThemeGrid = new QGridLayout(m_pThemeButtonGroup); + m_pTheme->m_pTextLabel->setText(__tr2qs( + "

Here you can choose the default appearance of KVIrc.

" + "The Fancy theme uses icons, a transparent background and a lot of colors. " + "The Minimalist theme is designed for low-color displays " + "or for \"console\" extremists; it's more or less white text on a black background.

" + "If you had a previous version of KVIrc installed, you can choose to not apply any theme " + "in order to preserve your current visual settings.

" + "If you don't know what to choose, just use the default.

")); + + m_pThemeButtonGroup = new QGroupBox(m_pTheme->m_pVBox); + + QGridLayout * pThemeGrid = new QGridLayout(m_pThemeButtonGroup); m_pThemeButtonGroup->setLayout(pThemeGrid); QString szThemeImagePath; - g_pApp->getGlobalKvircDirectory(szThemeImagePath,KviApplication::Pics,"kvi_setup_theme_hires.png"); + g_pApp->getGlobalKvircDirectory(szThemeImagePath, KviApplication::Pics, "kvi_setup_theme_hires.png"); - QPixmap* pHiResPixmap = new QPixmap(szThemeImagePath); + QPixmap * pHiResPixmap = new QPixmap(szThemeImagePath); if(pHiResPixmap->isNull()) { delete pHiResPixmap; - pHiResPixmap= new QPixmap(200,118); + pHiResPixmap = new QPixmap(200, 118); } - QLabel* pPixmapLabelHiRes = new QLabel(m_pThemeButtonGroup); + QLabel * pPixmapLabelHiRes = new QLabel(m_pThemeButtonGroup); pPixmapLabelHiRes->setPixmap(*pHiResPixmap); pPixmapLabelHiRes->setFixedSize(pHiResPixmap->size()); pPixmapLabelHiRes->setFrameStyle(QFrame::Sunken | QFrame::StyledPanel); pPixmapLabelHiRes->setMargin(0); - pThemeGrid->addWidget(pPixmapLabelHiRes, 1,1); + pThemeGrid->addWidget(pPixmapLabelHiRes, 1, 1); - m_pThemeHiRes = new QRadioButton(__tr2qs("&Fancy Theme"),m_pThemeButtonGroup); - pThemeGrid->addWidget(m_pThemeHiRes, 2,1); + m_pThemeHiRes = new QRadioButton(__tr2qs("&Fancy Theme"), m_pThemeButtonGroup); + pThemeGrid->addWidget(m_pThemeHiRes, 2, 1); - g_pApp->getGlobalKvircDirectory(szThemeImagePath,KviApplication::Pics,"kvi_setup_theme_lowres.png"); - QPixmap* pLowResPixmap = new QPixmap(szThemeImagePath); + g_pApp->getGlobalKvircDirectory(szThemeImagePath, KviApplication::Pics, "kvi_setup_theme_lowres.png"); + QPixmap * pLowResPixmap = new QPixmap(szThemeImagePath); if(pLowResPixmap->isNull()) { delete pLowResPixmap; - pLowResPixmap= new QPixmap(250,200); + pLowResPixmap = new QPixmap(250, 200); } - QLabel* pPixmapLabelLowRes = new QLabel(m_pThemeButtonGroup); + QLabel * pPixmapLabelLowRes = new QLabel(m_pThemeButtonGroup); pPixmapLabelLowRes->setPixmap(*pLowResPixmap); pPixmapLabelLowRes->setFixedSize(pLowResPixmap->size()); pPixmapLabelLowRes->setFrameStyle(QFrame::Sunken | QFrame::StyledPanel); pPixmapLabelLowRes->setMargin(0); - pThemeGrid->addWidget(pPixmapLabelLowRes, 1,2); + pThemeGrid->addWidget(pPixmapLabelLowRes, 1, 2); - m_pThemeLoRes = new QRadioButton(__tr2qs("&Minimalist Theme"),m_pThemeButtonGroup); - pThemeGrid->addWidget(m_pThemeLoRes, 2,2); - m_pThemeNone = new QRadioButton(__tr2qs("&Don't apply any theme"),m_pThemeButtonGroup); - pThemeGrid->addWidget(m_pThemeNone, 3,1); + m_pThemeLoRes = new QRadioButton(__tr2qs("&Minimalist Theme"), m_pThemeButtonGroup); + pThemeGrid->addWidget(m_pThemeLoRes, 2, 2); + m_pThemeNone = new QRadioButton(__tr2qs("&Don't apply any theme"), m_pThemeButtonGroup); + pThemeGrid->addWidget(m_pThemeNone, 3, 1); m_pThemeHiRes->setChecked(true); - addPage(m_pTheme,__tr2qs("Default Theme")); + addPage(m_pTheme, __tr2qs("Default Theme")); - setHelpEnabled(m_pTheme,false); + setHelpEnabled(m_pTheme, false); ///////////////////////////////////////////////////////////////////////////////////////////////////////////// // Desktop integration m_pDesktopIntegration = new SetupPage(this); - szText = __tr2qs( \ - "

" \ - "Here you can choose how much KVIrc will integrate with " \ - "your system." \ - "

" \ - "The default settings are fine for most users so if " \ - "you're in doubt just click \"Finish\" to continue." \ - "

"); + szText = __tr2qs( + "

" + "Here you can choose how much KVIrc will integrate with " + "your system." + "

" + "The default settings are fine for most users so if " + "you're in doubt just click \"Finish\" to continue." + "

"); m_pDesktopIntegration->m_pTextLabel->setText(szText); - addPage(m_pDesktopIntegration,__tr2qs("Desktop Integration")); + addPage(m_pDesktopIntegration, __tr2qs("Desktop Integration")); #if defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW) - m_pCreateUrlHandlers = new QCheckBox(__tr2qs("Make KVIrc the default IRC client"),m_pDesktopIntegration->m_pVBox); + m_pCreateUrlHandlers = new QCheckBox(__tr2qs("Make KVIrc the default IRC client"), m_pDesktopIntegration->m_pVBox); m_pCreateUrlHandlers->setChecked(true); #endif #ifdef COMPILE_KDE_SUPPORT - m_pCreateDesktopShortcut = new QCheckBox(__tr2qs("Create desktop shortcut"),m_pDesktopIntegration->m_pVBox); + m_pCreateDesktopShortcut = new QCheckBox(__tr2qs("Create desktop shortcut"), m_pDesktopIntegration->m_pVBox); m_pCreateDesktopShortcut->setChecked(true); #endif #if defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW) - m_pUseMircServerList = new QCheckBox(__tr2qs("Import server list from mIRC"),m_pDesktopIntegration->m_pVBox); + m_pUseMircServerList = new QCheckBox(__tr2qs("Import server list from mIRC"), m_pDesktopIntegration->m_pVBox); m_pUseMircServerList->setEnabled(false); #endif - setHelpEnabled(m_pDesktopIntegration,false); - setFinishEnabled(m_pDesktopIntegration,true); + setHelpEnabled(m_pDesktopIntegration, false); + setFinishEnabled(m_pDesktopIntegration, true); - // Preconfigured values +// Preconfigured values #if defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW) QString szTmp; - g_pApp->getGlobalKvircDirectory(szTmp,KviApplication::Config,"preinstalled.kvc"); + g_pApp->getGlobalKvircDirectory(szTmp, KviApplication::Config, "preinstalled.kvc"); if(KviFileUtils::fileExists(szTmp)) { - KviConfigurationFile cfg(szTmp,KviConfigurationFile::Read); + KviConfigurationFile cfg(szTmp, KviConfigurationFile::Read); cfg.setGroup("Setup"); - if(cfg.readBoolEntry("hideServerList",false)) + if(cfg.readBoolEntry("hideServerList", false)) { //setPageEnabled(m_pServers,false); //setFinishEnabled(m_pIdentity,true); @@ -524,39 +517,40 @@ SetupWizard::SetupWizard() KVI_OPTION_BOOL(KviOption_boolShowServersConnectDialogOnStart) = false; } int iDir; - iDir=cfg.readIntEntry("settingsDir",-1); - if(iDir>0) { + iDir = cfg.readIntEntry("settingsDir", -1); + if(iDir > 0) + { switch(iDir) { case 1: m_pDirUseNew->toggle(); - setPageEnabled(m_pDirectory,false); + setPageEnabled(m_pDirectory, false); break; case 2: m_pDirMakePortable->toggle(); - setPageEnabled(m_pDirectory,false); + setPageEnabled(m_pDirectory, false); break; } } } - //mIRC import - #define QUERY_BUFFER 2048 - char* buffer; +//mIRC import +#define QUERY_BUFFER 2048 + char * buffer; DWORD len = QUERY_BUFFER; - buffer = (char*)malloc(len*sizeof(char)); + buffer = (char *)malloc(len * sizeof(char)); HKEY hKey; QString szMircDir; - if(RegOpenKeyEx(HKEY_CLASSES_ROOT,"ChatFile\\DefaultIcon",0,KEY_READ,&hKey) == ERROR_SUCCESS ) + if(RegOpenKeyEx(HKEY_CLASSES_ROOT, "ChatFile\\DefaultIcon", 0, KEY_READ, &hKey) == ERROR_SUCCESS) { - if( RegQueryValueEx( hKey,0,0,0,(LPBYTE)buffer,&len) == ERROR_SUCCESS) + if(RegQueryValueEx(hKey, 0, 0, 0, (LPBYTE)buffer, &len) == ERROR_SUCCESS) { - szMircDir = QString::fromLocal8Bit(buffer,len); + szMircDir = QString::fromLocal8Bit(buffer, len); szMircDir.remove('"'); QString szMircFile = KviFileUtils::extractFileName(szMircDir); - szMircFile = szMircFile.left(szMircFile.length()-4); //cut off ".exe" + szMircFile = szMircFile.left(szMircFile.length() - 4); //cut off ".exe" szMircDir = KviFileUtils::extractFilePath(szMircDir); szMircIni = szMircDir + "/" + szMircFile + ".ini"; @@ -569,21 +563,19 @@ SetupWizard::SetupWizard() if(KviFileUtils::fileExists(szMircIni)) { - KviConfigurationFile cfg(szMircIni,KviConfigurationFile::Read,true); + KviConfigurationFile cfg(szMircIni, KviConfigurationFile::Read, true); if(cfg.hasGroup("mirc")) { g_bFoundMirc = true; cfg.setGroup("mirc"); - m_pNickSelector->setText(cfg.readEntry("nick",KVI_OPTION_STRING(KviOption_stringNickname1))); - m_pRealNameSelector->setText(cfg.readEntry("user",KVI_OPTION_STRING(KviOption_stringRealname))); - KVI_OPTION_STRING(KviOption_stringNickname2) = - cfg.readEntry("anick",KVI_OPTION_STRING(KviOption_stringNickname2)); - KVI_OPTION_STRING(KviOption_stringUsername) = - cfg.readEntry("email",KVI_OPTION_STRING(KviOption_stringUsername)).section('@',0,0); + m_pNickSelector->setText(cfg.readEntry("nick", KVI_OPTION_STRING(KviOption_stringNickname1))); + m_pRealNameSelector->setText(cfg.readEntry("user", KVI_OPTION_STRING(KviOption_stringRealname))); + KVI_OPTION_STRING(KviOption_stringNickname2) = cfg.readEntry("anick", KVI_OPTION_STRING(KviOption_stringNickname2)); + KVI_OPTION_STRING(KviOption_stringUsername) = cfg.readEntry("email", KVI_OPTION_STRING(KviOption_stringUsername)).section('@', 0, 0); if(cfg.hasGroup("files")) { - m_szMircServerIniFile = cfg.readEntry("servers","servers.ini"); + m_szMircServerIniFile = cfg.readEntry("servers", "servers.ini"); m_szMircServerIniFile.prepend('/'); m_szMircServerIniFile.prepend(szMircDir); if(KviFileUtils::fileExists(m_szMircServerIniFile)) @@ -609,13 +601,12 @@ SetupWizard::SetupWizard() enableOrDisableIdentityPageNextButton(); } - SetupWizard::~SetupWizard() { delete m_pLabelPixmap; } -void SetupWizard::showEvent(QShowEvent *e) +void SetupWizard::showEvent(QShowEvent * e) { int primary_screen = g_pApp->desktop()->primaryScreen(); QRect r = g_pApp->desktop()->screenGeometry(primary_screen); @@ -629,22 +620,25 @@ void SetupWizard::showEvent(QShowEvent *e) if(w < 800) { // 640x480 - if(ww < 630)ww = 630; - } else { - if(ww < 770)ww = 770; + if(ww < 630) + ww = 630; + } + else + { + if(ww < 770) + ww = 770; } - setGeometry(r.left() + (w - ww) / 2, r.top() + (h - wh) / 2,ww,wh); + setGeometry(r.left() + (w - ww) / 2, r.top() + (h - wh) / 2, ww, wh); KviTalWizard::showEvent(e); } void SetupWizard::enableOrDisableIdentityPageNextButton() { - setNextEnabled(m_pIdentity,!m_pNickSelector->currentText().trimmed().isEmpty()); + setNextEnabled(m_pIdentity, !m_pNickSelector->currentText().trimmed().isEmpty()); } - void SetupWizard::nickSelectorTextChanged(const QString & str) { enableOrDisableIdentityPageNextButton(); @@ -656,27 +650,32 @@ void SetupWizard::oldDirClicked() m_pNewPathBox->setEnabled(false); m_pNewIncomingBox->setEnabled(false); - if(m_pIdentity) setPageEnabled(m_pIdentity,false); - if(m_pTheme) setPageEnabled(m_pTheme,false); - if(m_pServers) setPageEnabled(m_pServers,false); + if(m_pIdentity) + setPageEnabled(m_pIdentity, false); + if(m_pTheme) + setPageEnabled(m_pTheme, false); + if(m_pServers) + setPageEnabled(m_pServers, false); - if(m_pOldDataPathEdit->text().isEmpty()) setNextEnabled(m_pDirectory,false); - else setNextEnabled(m_pDirectory,true); + if(m_pOldDataPathEdit->text().isEmpty()) + setNextEnabled(m_pDirectory, false); + else + setNextEnabled(m_pDirectory, true); } void SetupWizard::oldDataTextChanged(const QString & str) { - setNextEnabled(m_pDirectory,!str.isEmpty()); + setNextEnabled(m_pDirectory, !str.isEmpty()); } void SetupWizard::newDataTextChanged(const QString & str) { - setNextEnabled(m_pDirectory,!str.isEmpty() && !m_pIncomingPathEdit->text().isEmpty()); + setNextEnabled(m_pDirectory, !str.isEmpty() && !m_pIncomingPathEdit->text().isEmpty()); } void SetupWizard::newIncomingTextChanged(const QString & str) { - setNextEnabled(m_pDirectory,!str.isEmpty() && !m_pDataPathEdit->text().isEmpty()); + setNextEnabled(m_pDirectory, !str.isEmpty() && !m_pDataPathEdit->text().isEmpty()); } void SetupWizard::newDirClicked() @@ -685,12 +684,17 @@ void SetupWizard::newDirClicked() m_pNewPathBox->setEnabled(true); m_pNewIncomingBox->setEnabled(true); - if(m_pIdentity) setPageEnabled(m_pIdentity,true); - if(m_pTheme) setPageEnabled(m_pTheme,true); - if(m_pServers) setPageEnabled(m_pServers,true); + if(m_pIdentity) + setPageEnabled(m_pIdentity, true); + if(m_pTheme) + setPageEnabled(m_pTheme, true); + if(m_pServers) + setPageEnabled(m_pServers, true); - if(m_pDataPathEdit->text().isEmpty() || m_pIncomingPathEdit->text().isEmpty()) setNextEnabled(m_pDirectory,false); - else setNextEnabled(m_pDirectory,true); + if(m_pDataPathEdit->text().isEmpty() || m_pIncomingPathEdit->text().isEmpty()) + setNextEnabled(m_pDirectory, false); + else + setNextEnabled(m_pDirectory, true); } void SetupWizard::portableClicked() @@ -699,45 +703,48 @@ void SetupWizard::portableClicked() m_pNewPathBox->setEnabled(false); m_pNewIncomingBox->setEnabled(false); - if(m_pIdentity) setPageEnabled(m_pIdentity,true); - if(m_pTheme) setPageEnabled(m_pTheme,true); - if(m_pServers) setPageEnabled(m_pServers,true); + if(m_pIdentity) + setPageEnabled(m_pIdentity, true); + if(m_pTheme) + setPageEnabled(m_pTheme, true); + if(m_pServers) + setPageEnabled(m_pServers, true); - setNextEnabled(m_pDirectory,true); + setNextEnabled(m_pDirectory, true); } void SetupWizard::chooseOldDataPath() { // FIXME: We'd like to show hidden directories here ($HOME/.kvirc is hidden)... QString szBuffer = KviTalFileDialog::getExistingDirectoryPath( - m_pDataPathEdit->text(), - __tr2qs("Choose an Existing Configuration Folder - KVIrc Setup"), - this - ); + m_pDataPathEdit->text(), + __tr2qs("Choose an Existing Configuration Folder - KVIrc Setup"), + this); if(szBuffer.isEmpty()) return; KviFileUtils::adjustFilePath(szBuffer); - KviQString::ensureLastCharIs(szBuffer,KVI_PATH_SEPARATOR_CHAR); + KviQString::ensureLastCharIs(szBuffer, KVI_PATH_SEPARATOR_CHAR); if(!g_pApp->checkLocalKvircDirectory(szBuffer)) { if( - QMessageBox::question( - this, - __tr2qs("Confirm Setting Configuration Folder - KVIrc Setup"), - __tr2qs("The folder %1 doesn't seem to be a valid KVIrc settings folder. Do you want to use it anyway?") - .arg(szBuffer), - __tr2qs("&Yes"), - __tr2qs("&No"), - QString(), - 0, - 1 - ) == 0 - ) + QMessageBox::question( + this, + __tr2qs("Confirm Setting Configuration Folder - KVIrc Setup"), + __tr2qs("The folder %1 doesn't seem to be a valid KVIrc settings folder. Do you want to use it anyway?") + .arg(szBuffer), + __tr2qs("&Yes"), + __tr2qs("&No"), + QString(), + 0, + 1) + == 0) m_pOldDataPathEdit->setText(szBuffer); - } else { + } + else + { m_pOldDataPathEdit->setText(szBuffer); } } @@ -745,14 +752,13 @@ void SetupWizard::chooseOldDataPath() void SetupWizard::chooseDataPath() { QString szBuffer = KviTalFileDialog::getExistingDirectoryPath( - m_pDataPathEdit->text(), - __tr2qs("Choose a Configuration Folder - KVIrc Setup"), - this - ); + m_pDataPathEdit->text(), + __tr2qs("Choose a Configuration Folder - KVIrc Setup"), + this); KviFileUtils::adjustFilePath(szBuffer); if(!szBuffer.isEmpty()) { - KviQString::ensureLastCharIs(szBuffer,KVI_PATH_SEPARATOR_CHAR); + KviQString::ensureLastCharIs(szBuffer, KVI_PATH_SEPARATOR_CHAR); m_pDataPathEdit->setText(szBuffer); } } @@ -760,10 +766,9 @@ void SetupWizard::chooseDataPath() void SetupWizard::chooseIncomingPath() { QString szBuffer = KviTalFileDialog::getExistingDirectoryPath( - m_pIncomingPathEdit->text(), - __tr2qs("Choose a Download Folder - KVIrc Setup"), - this - ); + m_pIncomingPathEdit->text(), + __tr2qs("Choose a Download Folder - KVIrc Setup"), + this); KviFileUtils::adjustFilePath(szBuffer); if(!szBuffer.isEmpty()) { @@ -797,11 +802,12 @@ void SetupWizard::makeLink() // Dig in the registry looking up the Desktop path if(RegOpenKeyEx(HKEY_CURRENT_USER, - "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders", - 0,KEY_QUERY_VALUE,&hCU) == ERROR_SUCCESS) + "Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Shell Folders", + 0, KEY_QUERY_VALUE, &hCU) + == ERROR_SUCCESS) { - RegQueryValueEx(hCU,"Desktop",NULL,&lpType, - (unsigned char *)&szLink,&ulSize); + RegQueryValueEx(hCU, "Desktop", NULL, &lpType, + (unsigned char *)&szLink, &ulSize); RegCloseKey(hCU); } @@ -816,29 +822,30 @@ void SetupWizard::makeLink() CoInitialize(NULL); // we need COM+OLE // Fiddle with an obscure shell interface - IShellLink* psl; + IShellLink * psl; // Get a pointer to the IShellLink interface: this is kinda ugly :) - if(CoCreateInstance(CLSID_ShellLink,NULL,CLSCTX_INPROC_SERVER, - IID_IShellLink,(void **)&psl) == S_OK) + if(CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER, + IID_IShellLink, (void **)&psl) + == S_OK) { // just for fun, lookup another shell interface - IPersistFile* ppf; + IPersistFile * ppf; // Query IShellLink for the IPersistFile interface for // saving the shell link in persistent storage. - if(psl->QueryInterface(IID_IPersistFile,(void **)&ppf) == S_OK) + if(psl->QueryInterface(IID_IPersistFile, (void **)&ppf) == S_OK) { WORD wsz[MAX_PATH]; // Set the path to the shell link target. psl->SetPath(QTextCodec::codecForLocale()->fromUnicode(szKvircExec).data()); // Set the description of the shell link. psl->SetDescription("kvirc"); - // Ensure string is ANSI. - MultiByteToWideChar(CP_ACP,0,QTextCodec::codecForLocale()->fromUnicode(szLinkTarget).data(),-1,(LPWSTR)wsz,MAX_PATH); + // Ensure string is ANSI. + MultiByteToWideChar(CP_ACP, 0, QTextCodec::codecForLocale()->fromUnicode(szLinkTarget).data(), -1, (LPWSTR)wsz, MAX_PATH); // Save the link via the IPersistFile::Save method. - ppf->Save((LPCOLESTR)wsz,true); + ppf->Save((LPCOLESTR)wsz, true); ppf->Release(); } psl->Release(); @@ -849,92 +856,95 @@ void SetupWizard::makeLink() #ifdef COMPILE_KDE_SUPPORT QString tmp = QDir::homePath(); - KviQString::ensureLastCharIs(tmp,KVI_PATH_SEPARATOR_CHAR); + KviQString::ensureLastCharIs(tmp, KVI_PATH_SEPARATOR_CHAR); tmp.append("Desktop"); - KviQString::ensureLastCharIs(tmp,KVI_PATH_SEPARATOR_CHAR); + KviQString::ensureLastCharIs(tmp, KVI_PATH_SEPARATOR_CHAR); tmp.append("kvirc.desktop"); - QString contents = "[Desktop Entry]\n" \ - "GenericName=IRC Client\n" \ - "Comment=Connect to Internet Relay Chat\n" \ - "Exec=kvirc -m %u\n" \ - "Icon=kvirc\n" \ - "MapNotify=true\n" \ - "Name=KVIrc\n" \ - "Terminal=false\n" \ - "Type=Application\n" \ - "X-KDE-SubstituteUID=false\n"; - - KviFileUtils::writeFile(tmp,contents,false); + QString contents = "[Desktop Entry]\n" + "GenericName=IRC Client\n" + "Comment=Connect to Internet Relay Chat\n" + "Exec=kvirc -m %u\n" + "Icon=kvirc\n" + "MapNotify=true\n" + "Name=KVIrc\n" + "Terminal=false\n" + "Type=Application\n" + "X-KDE-SubstituteUID=false\n"; + + KviFileUtils::writeFile(tmp, contents, false); #endif //COMPILE_KDE_SUPPORT - } void SetupWizard::setUrlHandlers() { #if defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW) - QString szReg = "REGEDIT4\r\n" \ - "\r\n" \ - "[HKEY_CLASSES_ROOT\\irc]\r\n" \ - "@=\"URL:IRC Protocol\"\r\n" \ - "\"IRC Protocol\"=\"http://www.kvirc.net/\"\r\n" \ - "\"EditFlags\"=hex:02,00,00,00\r\n" \ - "\"URL Protocol\"=""\r\n" \ - "\r\n" \ - "[HKEY_CLASSES_ROOT\\irc\\DefaultIcon]\r\n" \ - "@=\"\\\"@KVIRCEXECUTABLE@\\\"\"\r\n" \ - "\r\n" \ - "[HKEY_CLASSES_ROOT\\irc\\shell]\r\n" \ - "@=\"\"\r\n" \ - "\r\n" \ - "[HKEY_CLASSES_ROOT\\irc\\shell\\open]\r\n" \ - "\"EditFlags\"=hex:01,00,00,00\r\n" \ - "\r\n" \ - "[HKEY_CLASSES_ROOT\\irc\\shell\\open\\command]\r\n" \ - "@=\"\\\"@KVIRCEXECUTABLE@\\\" %1\"\r\n" \ - "\r\n" \ - "[HKEY_CLASSES_ROOT\\irc6]\r\n" \ - "@=\"URL:IRC6 Protocol\"\r\n" \ - "\"IRC6 Protocol\"=\"http://www.kvirc.net/\"\r\n" \ - "\"EditFlags\"=hex:02,00,00,00\r\n" \ - "\"URL Protocol\"=""\r\n" \ - "\r\n" \ - "[HKEY_CLASSES_ROOT\\irc6\\DefaultIcon]\r\n" \ - "@=\"\\\"@KVIRCEXECUTABLE@\\\"\"\r\n" \ - "\r\n" \ - "[HKEY_CLASSES_ROOT\\irc6\\shell]\r\n" \ - "@=\"\"\r\n" \ - "\r\n" \ - "[HKEY_CLASSES_ROOT\\irc6\\shell\\open]\r\n" \ - "\"EditFlags\"=hex:01,00,00,00\r\n" \ - "\r\n" \ - "[HKEY_CLASSES_ROOT\\irc6\\shell\\open\\command]\r\n" \ - "@=\"\\\"@KVIRCEXECUTABLE@\\\" %1\"\r\n"; + QString szReg = "REGEDIT4\r\n" + "\r\n" + "[HKEY_CLASSES_ROOT\\irc]\r\n" + "@=\"URL:IRC Protocol\"\r\n" + "\"IRC Protocol\"=\"http://www.kvirc.net/\"\r\n" + "\"EditFlags\"=hex:02,00,00,00\r\n" + "\"URL Protocol\"=" + "\r\n" + "\r\n" + "[HKEY_CLASSES_ROOT\\irc\\DefaultIcon]\r\n" + "@=\"\\\"@KVIRCEXECUTABLE@\\\"\"\r\n" + "\r\n" + "[HKEY_CLASSES_ROOT\\irc\\shell]\r\n" + "@=\"\"\r\n" + "\r\n" + "[HKEY_CLASSES_ROOT\\irc\\shell\\open]\r\n" + "\"EditFlags\"=hex:01,00,00,00\r\n" + "\r\n" + "[HKEY_CLASSES_ROOT\\irc\\shell\\open\\command]\r\n" + "@=\"\\\"@KVIRCEXECUTABLE@\\\" %1\"\r\n" + "\r\n" + "[HKEY_CLASSES_ROOT\\irc6]\r\n" + "@=\"URL:IRC6 Protocol\"\r\n" + "\"IRC6 Protocol\"=\"http://www.kvirc.net/\"\r\n" + "\"EditFlags\"=hex:02,00,00,00\r\n" + "\"URL Protocol\"=" + "\r\n" + "\r\n" + "[HKEY_CLASSES_ROOT\\irc6\\DefaultIcon]\r\n" + "@=\"\\\"@KVIRCEXECUTABLE@\\\"\"\r\n" + "\r\n" + "[HKEY_CLASSES_ROOT\\irc6\\shell]\r\n" + "@=\"\"\r\n" + "\r\n" + "[HKEY_CLASSES_ROOT\\irc6\\shell\\open]\r\n" + "\"EditFlags\"=hex:01,00,00,00\r\n" + "\r\n" + "[HKEY_CLASSES_ROOT\\irc6\\shell\\open\\command]\r\n" + "@=\"\\\"@KVIRCEXECUTABLE@\\\" %1\"\r\n"; QString szKvircExec = g_pApp->m_szGlobalKvircDir; szKvircExec.append("\\kvirc.exe"); - szKvircExec.replace("\\","\\\\"); + szKvircExec.replace("\\", "\\\\"); - szReg.replace("@KVIRCEXECUTABLE@",QTextCodec::codecForLocale()->fromUnicode(szKvircExec)); + szReg.replace("@KVIRCEXECUTABLE@", QTextCodec::codecForLocale()->fromUnicode(szKvircExec)); QString szRegFile = g_pApp->m_szGlobalKvircDir; szRegFile.append("\\kvirc.reg"); - KviFileUtils::writeFile(szRegFile,szReg,false); + KviFileUtils::writeFile(szRegFile, szReg, false); QString szCmd = "regedit /S \""; szCmd += szRegFile; szCmd += "\""; - WinExec(QTextCodec::codecForLocale()->fromUnicode(szCmd).data(),SW_SHOW); + WinExec(QTextCodec::codecForLocale()->fromUnicode(szCmd).data(), SW_SHOW); #endif } void SetupWizard::reject() { - if(QMessageBox::warning(this,__tr2qs("Confirm Setup Abort - KVIrc Setup"), - __tr2qs("You have chosen to abort the setup.
KVIrc can't run until you complete this procedure.

Do you really wish to abort?"), - QMessageBox::Yes,QMessageBox::No|QMessageBox::Default|QMessageBox::Escape) != QMessageBox::Yes)return; + if(QMessageBox::warning(this, __tr2qs("Confirm Setup Abort - KVIrc Setup"), + __tr2qs("You have chosen to abort the setup.
KVIrc can't run until you complete this procedure.

Do you really wish to abort?"), + QMessageBox::Yes, QMessageBox::No | QMessageBox::Default | QMessageBox::Escape) + != QMessageBox::Yes) + return; KviTalWizard::reject(); } @@ -945,28 +955,32 @@ void SetupWizard::accept() if(m_pDirUsePrev->isChecked()) { - bNeedToApplyDefaults=false; - g_pApp->m_szLocalKvircDir = m_pOldDataPathEdit->text(); - } else { - bNeedToApplyDefaults=true; - if(m_pDirUseNew->isChecked()) { + bNeedToApplyDefaults = false; + g_pApp->m_szLocalKvircDir = m_pOldDataPathEdit->text(); + } + else + { + bNeedToApplyDefaults = true; + if(m_pDirUseNew->isChecked()) + { szDir = m_pDataPathEdit->text(); } #if defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW) - else { //portable - szDir = g_pApp->applicationDirPath()+KVI_PATH_SEPARATOR_CHAR+"Settings"; + else + { //portable + szDir = g_pApp->applicationDirPath() + KVI_PATH_SEPARATOR_CHAR + "Settings"; } #endif KviFileUtils::adjustFilePath(szDir); - KviQString::ensureLastCharIs(szDir,KVI_PATH_SEPARATOR_CHAR); + KviQString::ensureLastCharIs(szDir, KVI_PATH_SEPARATOR_CHAR); if(!KviFileUtils::directoryExists(szDir)) { if(!KviFileUtils::makeDir(szDir)) { - KviMessageBox::warning(__tr("Can't create directory %s.\n" \ - "You may not have write permission " \ - "for that path. Please go back and choose another directory.")); + KviMessageBox::warning(__tr("Can't create directory %s.\n" + "You may not have write permission " + "for that path. Please go back and choose another directory.")); setCurrentPage(m_pDirectory); return; } @@ -981,12 +995,14 @@ void SetupWizard::accept() g_pApp->m_szLocalKvircDir = szDir; KviFileUtils::adjustFilePath(g_pApp->m_szLocalKvircDir); - if(m_pDirUseNew->isChecked()) { + if(m_pDirUseNew->isChecked()) + { szDir = m_pIncomingPathEdit->text(); } #if defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW) - else { //portable - szDir = g_pApp->applicationDirPath()+KVI_PATH_SEPARATOR_CHAR+"Downloads"; + else + { //portable + szDir = g_pApp->applicationDirPath() + KVI_PATH_SEPARATOR_CHAR + "Downloads"; } #endif @@ -995,9 +1011,9 @@ void SetupWizard::accept() { if(!KviFileUtils::makeDir(szDir)) { - KviMessageBox::warning(__tr("Can't create directory %s.\n" \ - "You may not have write permission for that path.\n" \ - "Please go back and choose another directory.")); + KviMessageBox::warning(__tr("Can't create directory %s.\n" + "You may not have write permission for that path.\n" + "Please go back and choose another directory.")); setCurrentPage(m_pDirectory); return; } @@ -1010,7 +1026,7 @@ void SetupWizard::accept() QString localPath = QString("%1/global").arg(g_pApp->m_szLocalKvircDir); unlink(QTextCodec::codecForLocale()->fromUnicode(localPath).data()); int dummy; // make gcc happy - dummy = symlink(QTextCodec::codecForLocale()->fromUnicode(g_pApp->m_szGlobalKvircDir).data(),QTextCodec::codecForLocale()->fromUnicode(localPath).data()); + dummy = symlink(QTextCodec::codecForLocale()->fromUnicode(g_pApp->m_szGlobalKvircDir).data(), QTextCodec::codecForLocale()->fromUnicode(localPath).data()); Q_UNUSED(dummy); #endif @@ -1029,10 +1045,13 @@ void SetupWizard::accept() if(m_pThemeHiRes->isChecked()) { g_iThemeToApply = THEME_APPLY_HIRES; - } else if(m_pThemeLoRes->isChecked()) + } + else if(m_pThemeLoRes->isChecked()) { g_iThemeToApply = THEME_APPLY_LORES; - } else { + } + else + { g_iThemeToApply = THEME_APPLY_NONE; } } @@ -1048,7 +1067,8 @@ void SetupWizard::accept() KVI_OPTION_STRING(KviOption_stringNickname1) = KVI_OPTION_STRING(KviOption_stringNickname1).trimmed(); if(KVI_OPTION_STRING(KviOption_stringNickname1).length() > 32) - KVI_OPTION_STRING(KviOption_stringNickname1).truncate(32); + KVI_OPTION_STRING(KviOption_stringNickname1) + .truncate(32); if(KVI_OPTION_STRING(KviOption_stringNickname1).isEmpty()) KVI_OPTION_STRING(KviOption_stringNickname1) = KVI_DEFAULT_NICKNAME1; @@ -1057,7 +1077,9 @@ void SetupWizard::accept() if(KVI_OPTION_STRING(KviOption_stringNickname1).length() < 31) { szNickPart = KVI_OPTION_STRING(KviOption_stringNickname1); - } else { + } + else + { szNickPart = KVI_OPTION_STRING(KviOption_stringNickname1).left(30); } @@ -1068,26 +1090,31 @@ void SetupWizard::accept() KVI_OPTION_STRING(KviOption_stringNickname4) = QString(KVI_DEFAULT_NICKNAME4).replace(KVI_DEFAULT_NICKNAME_TOKEN, szNickPart); int i = m_pAgeCombo->currentIndex(); - if(i < 0)i = 0; - if(i > 120)i = 120; - if(i <= 0)KVI_OPTION_STRING(KviOption_stringCtcpUserInfoAge) = ""; - else KVI_OPTION_STRING(KviOption_stringCtcpUserInfoAge).setNum(i); + if(i < 0) + i = 0; + if(i > 120) + i = 120; + if(i <= 0) + KVI_OPTION_STRING(KviOption_stringCtcpUserInfoAge) = ""; + else + KVI_OPTION_STRING(KviOption_stringCtcpUserInfoAge) + .setNum(i); switch(m_pGenderCombo->currentIndex()) { case 1: // this should be in English KVI_OPTION_STRING(KviOption_stringCtcpUserInfoGender) = "Female"; - break; + break; case 2: // this should be in English KVI_OPTION_STRING(KviOption_stringCtcpUserInfoGender) = "Male"; - break; + break; default: KVI_OPTION_STRING(KviOption_stringCtcpUserInfoGender) = ""; - break; + break; } - /* +/* m_pServerHostSelector->commit(); m_pServerUrlSelector->commit(); //m_pServerConfigSelector->commit(); @@ -1113,9 +1140,11 @@ void SetupWizard::accept() #if defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW) if(m_pDirMakePortable->isChecked()) { - KviFileUtils::writeFile(g_pApp->applicationDirPath()+KVI_PATH_SEPARATOR_CHAR+"portable",QString("true")); - g_pApp->m_bPortable=true; - } else { + KviFileUtils::writeFile(g_pApp->applicationDirPath() + KVI_PATH_SEPARATOR_CHAR + "portable", QString("true")); + g_pApp->m_bPortable = true; + } + else + { #endif g_pApp->saveKvircDirectory(); #if defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW) diff --git a/src/modules/setup/SetupWizard.h b/src/modules/setup/SetupWizard.h index f5596a70c..9cec49c09 100644 --- a/src/modules/setup/SetupWizard.h +++ b/src/modules/setup/SetupWizard.h @@ -42,102 +42,102 @@ class SetupWizard; - class SetupPage : public QWidget { Q_OBJECT public: SetupPage(SetupWizard * w); ~SetupPage(); + public: KviTalVBox * m_pVBox; QLabel * m_pPixmapLabel; QLabel * m_pTextLabel; }; - #define THEME_APPLY_NONE 0 #define THEME_APPLY_HIRES 1 #define THEME_APPLY_LORES 2 -class SetupWizard : public KviTalWizard +class SetupWizard : public KviTalWizard { Q_OBJECT public: SetupWizard(); ~SetupWizard(); + public: - QPixmap * m_pLabelPixmap; + QPixmap * m_pLabelPixmap; - SetupPage * m_pWelcome; - SetupPage * m_pLicense; - SetupPage * m_pDirectory; - SetupPage * m_pIdentity; - SetupPage * m_pTheme; - SetupPage * m_pDesktopIntegration; - SetupPage * m_pServers; + SetupPage * m_pWelcome; + SetupPage * m_pLicense; + SetupPage * m_pDirectory; + SetupPage * m_pIdentity; + SetupPage * m_pTheme; + SetupPage * m_pDesktopIntegration; + SetupPage * m_pServers; // Theme - QGroupBox * m_pThemeButtonGroup; + QGroupBox * m_pThemeButtonGroup; - QRadioButton * m_pThemeHiRes; - QRadioButton * m_pThemeLoRes; - QRadioButton * m_pThemeNone; + QRadioButton * m_pThemeHiRes; + QRadioButton * m_pThemeLoRes; + QRadioButton * m_pThemeNone; // Welcome - QCheckBox * m_pCreateUrlHandlers; - QCheckBox * m_pCreateDesktopShortcut; + QCheckBox * m_pCreateUrlHandlers; + QCheckBox * m_pCreateDesktopShortcut; //Dir - QLineEdit * m_pDataPathEdit; - QLineEdit * m_pIncomingPathEdit; + QLineEdit * m_pDataPathEdit; + QLineEdit * m_pIncomingPathEdit; KviTalGroupBox * m_pDirButtonGroup; - QRadioButton * m_pDirUsePrev; - QRadioButton * m_pDirUseNew; + QRadioButton * m_pDirUsePrev; + QRadioButton * m_pDirUseNew; #if defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW) - QRadioButton * m_pDirMakePortable; + QRadioButton * m_pDirMakePortable; #endif //QRadioButton * m_pDirRestore; - QLineEdit * m_pOldDataPathEdit; - KviTalHBox * m_pOldPathBox; - KviTalHBox * m_pNewPathBox; - KviTalHBox * m_pNewIncomingBox; + QLineEdit * m_pOldDataPathEdit; + KviTalHBox * m_pOldPathBox; + KviTalHBox * m_pNewPathBox; + KviTalHBox * m_pNewIncomingBox; //Identify - QComboBox * m_pAgeCombo; - QComboBox * m_pGenderCombo; + QComboBox * m_pAgeCombo; + QComboBox * m_pGenderCombo; KviStringSelector * m_pNickSelector; KviStringSelector * m_pRealNameSelector; KviStringSelector * m_pLocationSelector; KviStringSelector * m_pLanguagesSelector; - //KviStringSelector * m_pOtherInfoSelector; - - //Servers - //KviTalGroupBox * m_pServersButtonGroup; - //QRadioButton * m_pServersChooseFromList; - //QRadioButton * m_pServersSpecifyManually; - //QRadioButton * m_pServersOpenIrcUrl; - //QRadioButton * m_pServersLoadConfig; +//KviStringSelector * m_pOtherInfoSelector; + +//Servers +//KviTalGroupBox * m_pServersButtonGroup; +//QRadioButton * m_pServersChooseFromList; +//QRadioButton * m_pServersSpecifyManually; +//QRadioButton * m_pServersOpenIrcUrl; +//QRadioButton * m_pServersLoadConfig; #if defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW) - QString m_szMircServerIniFile; - QCheckBox * m_pUseMircServerList; + QString m_szMircServerIniFile; + QCheckBox * m_pUseMircServerList; #endif - QString m_szServerConfigFile; - QString m_szServerUrl; - QString m_szServerHost; - unsigned int m_uServerPort; + QString m_szServerConfigFile; + QString m_szServerUrl; + QString m_szServerHost; + unsigned int m_uServerPort; KviStringSelector * m_pServerHostSelector; KviStringSelector * m_pServerUrlSelector; //KviFileSelector * m_pServerConfigSelector; - KviUIntSelector *m_pServerPortSelector; + KviUIntSelector * m_pServerPortSelector; protected: void makeLink(); void setUrlHandlers(); - virtual void showEvent(QShowEvent *e); + virtual void showEvent(QShowEvent * e); void enableOrDisableIdentityPageNextButton(); public slots: void chooseOldDataPath(); @@ -150,11 +150,10 @@ public slots: void newDirClicked(); void portableClicked(); - void nickSelectorTextChanged(const QString & ); - void oldDataTextChanged(const QString & ); - void newDataTextChanged(const QString & ); - void newIncomingTextChanged(const QString & ); + void nickSelectorTextChanged(const QString &); + void oldDataTextChanged(const QString &); + void newDataTextChanged(const QString &); + void newIncomingTextChanged(const QString &); }; - #endif //_SETUPWIZARD_H_ diff --git a/src/modules/setup/libkvisetup.cpp b/src/modules/setup/libkvisetup.cpp index 509bd1d3c..606ca9ac6 100644 --- a/src/modules/setup/libkvisetup.cpp +++ b/src/modules/setup/libkvisetup.cpp @@ -37,7 +37,6 @@ #include #include - // this will be chosen during the setup process QString g_szChoosenIncomingDirectory; int g_iThemeToApply = THEME_APPLY_NONE; @@ -48,9 +47,6 @@ QString szUrl; QString szMircServers; QString szMircIni; - - - // this is called by KviApplication when no local kvirc directory has been found // we have nothing to rely on yet... (settings have not been loaded yet) KVIMODULEEXPORTFUNC bool setup_begin() @@ -63,7 +59,6 @@ KVIMODULEEXPORTFUNC bool setup_begin() return (retcode == QDialog::Accepted); } - // this is called just after the first startup // all the subsystems are up and running (we even have a nice console // to write on if needed). @@ -75,7 +70,7 @@ KVIMODULEEXPORTFUNC void setup_finish() KVI_OPTION_STRING(KviOption_stringIncomingPath) = g_szChoosenIncomingDirectory; // Reset the quit message and the real name... if they contain the KVIrc version // then probably the user hasn't even edited them. - if(KVI_OPTION_STRING(KviOption_stringQuitMessage).indexOf("KVIrc",0,Qt::CaseInsensitive) != -1) + if(KVI_OPTION_STRING(KviOption_stringQuitMessage).indexOf("KVIrc", 0, Qt::CaseInsensitive) != -1) KVI_OPTION_STRING(KviOption_stringQuitMessage) = KVI_DEFAULT_QUIT_MESSAGE; // We deserve to change the user's part message in something nice :) KVI_OPTION_STRING(KviOption_stringPartMessage) = KVI_DEFAULT_PART_MESSAGE; @@ -89,18 +84,18 @@ KVIMODULEEXPORTFUNC void setup_finish() switch(g_iThemeToApply) { case THEME_APPLY_HIRES: - KviTheme::apply("Aria-2.0.0",KviThemeInfo::Builtin,out); - break; + KviTheme::apply("Aria-2.0.0", KviThemeInfo::Builtin, out); + break; case THEME_APPLY_LORES: - KviTheme::apply("MinimalDark-2.0.0",KviThemeInfo::Builtin,out); - break; - // default: no theme + KviTheme::apply("MinimalDark-2.0.0", KviThemeInfo::Builtin, out); + break; + // default: no theme } if(!szMircServers.isEmpty()) { - g_pServerDataBase->importFromMircIni(szMircServers,szMircIni, - KVI_OPTION_STRINGLIST(KviOption_stringlistRecentServers)); + g_pServerDataBase->importFromMircIni(szMircServers, szMircIni, + KVI_OPTION_STRINGLIST(KviOption_stringlistRecentServers)); g_pApp->saveIrcServerDataBase(); } @@ -109,14 +104,16 @@ KVIMODULEEXPORTFUNC void setup_finish() { KviKvsVariantList * pParams = new KviKvsVariantList(); pParams->append(szUrl); - KviKvsScript::run("openurl $0",g_pActiveWindow,pParams); + KviKvsScript::run("openurl $0", g_pActiveWindow, pParams); delete pParams; KVI_OPTION_BOOL(KviOption_boolShowServersConnectDialogOnStart) = true; - } else if(!szHost.isEmpty()) { + } + else if(!szHost.isEmpty()) + { KviKvsVariantList * pParams = new KviKvsVariantList(); pParams->append(szHost); pParams->append((kvs_int_t)uPort); - KviKvsScript::run("server $0 $1",g_pActiveWindow,pParams); + KviKvsScript::run("server $0 $1", g_pActiveWindow, pParams); delete pParams; KVI_OPTION_BOOL(KviOption_boolShowServersConnectDialogOnStart) = true; } @@ -125,7 +122,7 @@ KVIMODULEEXPORTFUNC void setup_finish() static bool setup_module_init(KviModule *) { - bNeedToApplyDefaults=true; + bNeedToApplyDefaults = true; return true; } @@ -140,13 +137,12 @@ static bool setup_module_can_unload(KviModule *) } KVIRC_MODULE( - "Setup Wizard", - "4.0.0", - "Szymon Stefanek ", - "First-time-run setup wizard", - setup_module_init, - setup_module_can_unload, - 0, - setup_module_cleanup, - 0 -) + "Setup Wizard", + "4.0.0", + "Szymon Stefanek ", + "First-time-run setup wizard", + setup_module_init, + setup_module_can_unload, + 0, + setup_module_cleanup, + 0) diff --git a/src/modules/sharedfile/libkvisharedfile.cpp b/src/modules/sharedfile/libkvisharedfile.cpp index 6ac2c0dae..ba60faf9a 100644 --- a/src/modules/sharedfile/libkvisharedfile.cpp +++ b/src/modules/sharedfile/libkvisharedfile.cpp @@ -35,10 +35,8 @@ #include - extern KVIRC_API KviSharedFilesManager * g_pSharedFilesManager; - /* @doc: sharedfile.add @type: @@ -74,19 +72,20 @@ extern KVIRC_API KviSharedFilesManager * g_pSharedFilesManager; static bool sharedfile_kvs_cmd_add(KviKvsModuleCommandCall * c) { - QString szFileName,szUserMask; + QString szFileName, szUserMask; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("filename",KVS_PT_NONEMPTYSTRING,0,szFileName) - KVSM_PARAMETER("user_mask",KVS_PT_NONEMPTYSTRING,KVS_PF_OPTIONAL,szUserMask) + KVSM_PARAMETER("filename", KVS_PT_NONEMPTYSTRING, 0, szFileName) + KVSM_PARAMETER("user_mask", KVS_PT_NONEMPTYSTRING, KVS_PF_OPTIONAL, szUserMask) KVSM_PARAMETERS_END(c) if(!KviFileUtils::isReadable(szFileName)) { - c->warning(__tr2qs_ctx("The file '%Q' is not readable","sharedfileswindow"),&szFileName); + c->warning(__tr2qs_ctx("The file '%Q' is not readable", "sharedfileswindow"), &szFileName); return true; } - if(szUserMask.isEmpty())szUserMask="*!*@*"; + if(szUserMask.isEmpty()) + szUserMask = "*!*@*"; KviIrcMask u(szUserMask); QString szm; @@ -94,37 +93,38 @@ static bool sharedfile_kvs_cmd_add(KviKvsModuleCommandCall * c) kvs_int_t timeout = 0; - if(KviKvsVariant * v = c->switches()->find('t',"timeout")) + if(KviKvsVariant * v = c->switches()->find('t', "timeout")) { if(!v->asInteger(timeout)) { - c->warning(__tr2qs_ctx("Invalid timeout, ignoring","sharedfileswindow")); + c->warning(__tr2qs_ctx("Invalid timeout, ignoring", "sharedfileswindow")); timeout = 0; } } QString szVisibleName = szFileName; - KviQString::cutToLast(szVisibleName,'/'); + KviQString::cutToLast(szVisibleName, '/'); - if(KviKvsVariant * n = c->switches()->find('n',"name")) + if(KviKvsVariant * n = c->switches()->find('n', "name")) { QString tmp; n->asString(tmp); if(tmp.isEmpty()) { - c->warning(__tr2qs_ctx("Invalid visible name: using default","sharedfileswindow")); - } else szVisibleName = tmp; + c->warning(__tr2qs_ctx("Invalid visible name: using default", "sharedfileswindow")); + } + else + szVisibleName = tmp; } - if(!g_pSharedFilesManager->addSharedFile(szVisibleName,szFileName,szUserMask,timeout)) + if(!g_pSharedFilesManager->addSharedFile(szVisibleName, szFileName, szUserMask, timeout)) { - c->warning(__tr2qs_ctx("Oops! Failed to add the sharedfile...","sharedfileswindow")); + c->warning(__tr2qs_ctx("Oops! Failed to add the sharedfile...", "sharedfileswindow")); } return true; } - /* @doc: sharedfile.remove @type: @@ -147,22 +147,20 @@ static bool sharedfile_kvs_cmd_add(KviKvsModuleCommandCall * c) static bool sharedfile_kvs_cmd_remove(KviKvsModuleCommandCall * c) { - QString szVisibleName,szUserMask; + QString szVisibleName, szUserMask; kvs_uint_t uSize; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("visible_name",KVS_PT_NONEMPTYSTRING,0,szVisibleName) - KVSM_PARAMETER("user_mask",KVS_PT_NONEMPTYSTRING,0,szUserMask) - KVSM_PARAMETER("filesize",KVS_PT_UINT,KVS_PF_OPTIONAL,uSize) + KVSM_PARAMETER("visible_name", KVS_PT_NONEMPTYSTRING, 0, szVisibleName) + KVSM_PARAMETER("user_mask", KVS_PT_NONEMPTYSTRING, 0, szUserMask) + KVSM_PARAMETER("filesize", KVS_PT_UINT, KVS_PF_OPTIONAL, uSize) KVSM_PARAMETERS_END(c) - if(!g_pSharedFilesManager->removeSharedFile(szVisibleName,szUserMask,uSize)) - c->warning(__tr2qs_ctx("No sharedfile with visible name '%Q' and user mask '%Q'","sharedfileswindow"),&szVisibleName,&szUserMask); + if(!g_pSharedFilesManager->removeSharedFile(szVisibleName, szUserMask, uSize)) + c->warning(__tr2qs_ctx("No sharedfile with visible name '%Q' and user mask '%Q'", "sharedfileswindow"), &szVisibleName, &szUserMask); return true; } - - /* @doc: sharedfile.clear @type: @@ -187,7 +185,6 @@ static bool sharedfile_kvs_cmd_clear(KviKvsModuleCommandCall *) return true; } - /* @doc: sharedfile.list @type: @@ -208,20 +205,20 @@ static bool sharedfile_kvs_cmd_clear(KviKvsModuleCommandCall *) static bool sharedfile_kvs_cmd_list(KviKvsModuleCommandCall * c) { - KviPointerHashTableIterator it(*(g_pSharedFilesManager->sharedFileListDict())); + KviPointerHashTableIterator it(*(g_pSharedFilesManager->sharedFileListDict())); int idx = 0; while(KviSharedFileList * l = it.current()) { - for(KviSharedFile * o = l->first();o;o = l->next()) + for(KviSharedFile * o = l->first(); o; o = l->next()) { - c->window()->output(KVI_OUT_NONE,"%c%d. %s", - KviControlCodes::Bold,idx + 1,it.currentKey().toUtf8().data()); - c->window()->output(KVI_OUT_NONE,__tr2qs_ctx("File: %s (%u bytes)","sharedfileswindow"), - o->absFilePath().toUtf8().data(),o->fileSize()); - c->window()->output(KVI_OUT_NONE,__tr2qs_ctx("Mask: %s","sharedfileswindow"), - o->userMask().toUtf8().data()); + c->window()->output(KVI_OUT_NONE, "%c%d. %s", + KviControlCodes::Bold, idx + 1, it.currentKey().toUtf8().data()); + c->window()->output(KVI_OUT_NONE, __tr2qs_ctx("File: %s (%u bytes)", "sharedfileswindow"), + o->absFilePath().toUtf8().data(), o->fileSize()); + c->window()->output(KVI_OUT_NONE, __tr2qs_ctx("Mask: %s", "sharedfileswindow"), + o->userMask().toUtf8().data()); if(o->expireTime() > 0) { int secs = ((int)(o->expireTime())) - ((int)(time(0))); @@ -229,8 +226,8 @@ static bool sharedfile_kvs_cmd_list(KviKvsModuleCommandCall * c) secs = secs % 3600; int mins = secs / 60; secs = secs % 60; - c->window()->output(KVI_OUT_NONE,__tr2qs_ctx("Expires in %d hours %d minutes %d seconds","sharedfileswindow"), - hour,mins,secs); + c->window()->output(KVI_OUT_NONE, __tr2qs_ctx("Expires in %d hours %d minutes %d seconds", "sharedfileswindow"), + hour, mins, secs); } ++idx; } @@ -239,8 +236,10 @@ static bool sharedfile_kvs_cmd_list(KviKvsModuleCommandCall * c) //#warning "FIND A BETTER KVI_OUT_*" - if(idx == 0)c->window()->outputNoFmt(KVI_OUT_NONE,__tr2qs_ctx("No active file sharedfile","sharedfileswindow")); - else c->window()->output(KVI_OUT_NONE,__tr2qs_ctx("Total: %d sharedfile","sharedfileswindow"),idx); + if(idx == 0) + c->window()->outputNoFmt(KVI_OUT_NONE, __tr2qs_ctx("No active file sharedfile", "sharedfileswindow")); + else + c->window()->output(KVI_OUT_NONE, __tr2qs_ctx("Total: %d sharedfile", "sharedfileswindow"), idx); return true; } @@ -248,10 +247,10 @@ static bool sharedfile_kvs_cmd_list(KviKvsModuleCommandCall * c) static bool sharedfile_module_init(KviModule * m) { - KVSM_REGISTER_SIMPLE_COMMAND(m,"add",sharedfile_kvs_cmd_add); - KVSM_REGISTER_SIMPLE_COMMAND(m,"remove",sharedfile_kvs_cmd_remove); - KVSM_REGISTER_SIMPLE_COMMAND(m,"list",sharedfile_kvs_cmd_list); - KVSM_REGISTER_SIMPLE_COMMAND(m,"clear",sharedfile_kvs_cmd_clear); + KVSM_REGISTER_SIMPLE_COMMAND(m, "add", sharedfile_kvs_cmd_add); + KVSM_REGISTER_SIMPLE_COMMAND(m, "remove", sharedfile_kvs_cmd_remove); + KVSM_REGISTER_SIMPLE_COMMAND(m, "list", sharedfile_kvs_cmd_list); + KVSM_REGISTER_SIMPLE_COMMAND(m, "clear", sharedfile_kvs_cmd_clear); return true; } @@ -267,13 +266,12 @@ static bool sharedfile_module_cleanup(KviModule *) } KVIRC_MODULE( - "SharedFiles", // module name - "4.0.0", // module version - "Copyright (C) 2000-2003 Szymon Stefanek (pragma at kvirc dot net)", // author & (C) - "User interface to the file sharing system", - sharedfile_module_init, - sharedfile_module_can_unload, - 0, - sharedfile_module_cleanup, - "sharedfileswindow" -) + "SharedFiles", // module name + "4.0.0", // module version + "Copyright (C) 2000-2003 Szymon Stefanek (pragma at kvirc dot net)", // author & (C) + "User interface to the file sharing system", + sharedfile_module_init, + sharedfile_module_can_unload, + 0, + sharedfile_module_cleanup, + "sharedfileswindow") diff --git a/src/modules/sharedfileswindow/SharedFilesWindow.cpp b/src/modules/sharedfileswindow/SharedFilesWindow.cpp index 757a03cc5..acbf3b8d6 100644 --- a/src/modules/sharedfileswindow/SharedFilesWindow.cpp +++ b/src/modules/sharedfileswindow/SharedFilesWindow.cpp @@ -48,63 +48,63 @@ extern SharedFilesWindow * g_pSharedFilesWindow; extern KVIRC_API KviSharedFilesManager * g_pSharedFilesManager; -SharedFileEditDialog::SharedFileEditDialog(QWidget * par,KviSharedFile * f) -: QDialog(par)//,"shared_file_editor",true) +SharedFileEditDialog::SharedFileEditDialog(QWidget * par, KviSharedFile * f) + : QDialog(par) //,"shared_file_editor",true) { setModal(true); setObjectName("shared_file_editor"); QGridLayout * g = new QGridLayout(this); - setWindowTitle(__tr2qs_ctx("Shared File Configuration - KVIrc","sharedfileswindow")); + setWindowTitle(__tr2qs_ctx("Shared File Configuration - KVIrc", "sharedfileswindow")); - QLabel * l = new QLabel(__tr2qs_ctx("Share name:","sharedfileswindow"),this); - g->addWidget(l, 0, 0 ); + QLabel * l = new QLabel(__tr2qs_ctx("Share name:", "sharedfileswindow"), this); + g->addWidget(l, 0, 0); m_pShareNameEdit = new QLineEdit(this); - g->addWidget(m_pShareNameEdit,0,1,1,3); + g->addWidget(m_pShareNameEdit, 0, 1, 1, 3); //g->addMultiCellWidget( m_pShareNameEdit, 0, 0, 1, 3 ); - l = new QLabel(__tr2qs_ctx("File path:","sharedfileswindow"),this); - g->addWidget(l, 1, 0 ); + l = new QLabel(__tr2qs_ctx("File path:", "sharedfileswindow"), this); + g->addWidget(l, 1, 0); m_pFilePathEdit = new QLineEdit(this); - g->addWidget(m_pFilePathEdit,1,1,1,2); + g->addWidget(m_pFilePathEdit, 1, 1, 1, 2); //g->addMultiCellWidget( m_pFilePathEdit, 1, 1, 1, 2 ); - m_pBrowseButton = new QPushButton(__tr2qs_ctx("&Browse...","sharedfileswindow"),this); - g->addWidget( m_pBrowseButton, 1, 3 ); - connect(m_pBrowseButton,SIGNAL(clicked()),this,SLOT(browse())); + m_pBrowseButton = new QPushButton(__tr2qs_ctx("&Browse...", "sharedfileswindow"), this); + g->addWidget(m_pBrowseButton, 1, 3); + connect(m_pBrowseButton, SIGNAL(clicked()), this, SLOT(browse())); - l = new QLabel(__tr2qs_ctx("User mask:","sharedfileswindow"),this); - g->addWidget(l, 2, 0 ); + l = new QLabel(__tr2qs_ctx("User mask:", "sharedfileswindow"), this); + g->addWidget(l, 2, 0); m_pUserMaskEdit = new QLineEdit(this); - g->addWidget(m_pUserMaskEdit,2,1,1,3); -// g->addMultiCellWidget( m_pUserMaskEdit, 2, 2, 1, 3 ); + g->addWidget(m_pUserMaskEdit, 2, 1, 1, 3); + // g->addMultiCellWidget( m_pUserMaskEdit, 2, 2, 1, 3 ); - m_pExpireCheckBox = new QCheckBox(__tr2qs_ctx("Expire at:","sharedfileswindow"),this); - g->addWidget(m_pExpireCheckBox,3,0); + m_pExpireCheckBox = new QCheckBox(__tr2qs_ctx("Expire at:", "sharedfileswindow"), this); + g->addWidget(m_pExpireCheckBox, 3, 0); m_pExpireDateTimeEdit = new QDateTimeEdit(this); - g->addWidget(m_pExpireDateTimeEdit,3,1,1,3); + g->addWidget(m_pExpireDateTimeEdit, 3, 1, 1, 3); //g->addMultiCellWidget(m_pExpireDateTimeEdit, 3, 3, 1, 3 ); - connect(m_pExpireCheckBox,SIGNAL(toggled(bool)),m_pExpireDateTimeEdit,SLOT(setEnabled(bool))); + connect(m_pExpireCheckBox, SIGNAL(toggled(bool)), m_pExpireDateTimeEdit, SLOT(setEnabled(bool))); QPushButton * pb; - pb = new QPushButton(__tr2qs_ctx("&OK","sharedfileswindow"),this); - connect(pb,SIGNAL(clicked()),this,SLOT(okClicked())); + pb = new QPushButton(__tr2qs_ctx("&OK", "sharedfileswindow"), this); + connect(pb, SIGNAL(clicked()), this, SLOT(okClicked())); pb->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Accept))); - g->addWidget(pb,5,2); - pb = new QPushButton(__tr2qs_ctx("Cancel","sharedfileswindow"),this); - connect(pb,SIGNAL(clicked()),this,SLOT(reject())); + g->addWidget(pb, 5, 2); + pb = new QPushButton(__tr2qs_ctx("Cancel", "sharedfileswindow"), this); + connect(pb, SIGNAL(clicked()), this, SLOT(reject())); pb->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Discard))); - g->addWidget(pb,5,3); + g->addWidget(pb, 5, 3); - g->setRowStretch(4,1); - g->setColumnStretch(0,1); + g->setRowStretch(4, 1); + g->setColumnStretch(0, 1); if(f) { @@ -116,24 +116,25 @@ SharedFileEditDialog::SharedFileEditDialog(QWidget * par,KviSharedFile * f) m_pExpireDateTimeEdit->setDateTime(dt); m_pExpireCheckBox->setChecked(f->expires()); m_pExpireDateTimeEdit->setEnabled(f->expires()); - } else { + } + else + { m_pExpireCheckBox->setChecked(false); m_pExpireDateTimeEdit->setDateTime(QDateTime::currentDateTime()); m_pExpireDateTimeEdit->setEnabled(false); } - } SharedFileEditDialog::~SharedFileEditDialog() { - } void SharedFileEditDialog::browse() { QString szBuf; QString szTxt = m_pFilePathEdit->text(); - if(!KviFileDialog::askForOpenFileName(szBuf,__tr2qs("Select a File - KVIrc"),szTxt,QString(),false,true,this))return; + if(!KviFileDialog::askForOpenFileName(szBuf, __tr2qs("Select a File - KVIrc"), szTxt, QString(), false, true, this)) + return; m_pFilePathEdit->setText(szBuf); } @@ -145,7 +146,7 @@ KviSharedFile * SharedFileEditDialog::getResult() QDateTime dt = m_pExpireDateTimeEdit->dateTime(); bool bExpires = m_pExpireCheckBox->isChecked(); QFileInfo f(szPath); - return new KviSharedFile(szName,szPath,szMask,bExpires ? dt.toTime_t() : (time_t)0,f.size()); + return new KviSharedFile(szName, szPath, szMask, bExpires ? dt.toTime_t() : (time_t)0, f.size()); } void SharedFileEditDialog::okClicked() @@ -156,47 +157,49 @@ void SharedFileEditDialog::okClicked() bool bExpires = m_pExpireCheckBox->isChecked(); if(bExpires && (dt <= QDateTime::currentDateTime())) { - QMessageBox::warning(this,__tr2qs_ctx("Invalid Expiry Time - KVIrc","sharedfileswindow"), - __tr2qs_ctx("The expiry date/time is in the past: please either remove the \"Expires at\"" \ - "check mark or specify a expiry date/time in the future","sharedfileswindow"), - __tr2qs_ctx("OK","sharedfileswindow")); + QMessageBox::warning(this, __tr2qs_ctx("Invalid Expiry Time - KVIrc", "sharedfileswindow"), + __tr2qs_ctx("The expiry date/time is in the past: please either remove the \"Expires at\"" + "check mark or specify a expiry date/time in the future", + "sharedfileswindow"), + __tr2qs_ctx("OK", "sharedfileswindow")); return; } if(szName.isEmpty()) { - QMessageBox::warning(this,__tr2qs_ctx("Invalid Share Name - KVIrc","sharedfileswindow"), - __tr2qs_ctx("The share name can't be empty, please correct it","sharedfileswindow"), - __tr2qs_ctx("OK","sharedfileswindow")); + QMessageBox::warning(this, __tr2qs_ctx("Invalid Share Name - KVIrc", "sharedfileswindow"), + __tr2qs_ctx("The share name can't be empty, please correct it", "sharedfileswindow"), + __tr2qs_ctx("OK", "sharedfileswindow")); return; } QFileInfo f(szPath); if(!(f.exists() && f.isFile() && f.isReadable())) { - QMessageBox::warning(this,__tr2qs_ctx("Error Opening File - KVIrc","sharedfileswindow"), - __tr2qs_ctx("The file doesn't exist or it is not readable, please check the path","sharedfileswindow"), - __tr2qs_ctx("OK","sharedfileswindow")); + QMessageBox::warning(this, __tr2qs_ctx("Error Opening File - KVIrc", "sharedfileswindow"), + __tr2qs_ctx("The file doesn't exist or it is not readable, please check the path", "sharedfileswindow"), + __tr2qs_ctx("OK", "sharedfileswindow")); return; } accept(); } - -SharedFilesTreeWidgetItem::SharedFilesTreeWidgetItem(QTreeWidget * lv,KviSharedFile * f) -: QTreeWidgetItem(lv) +SharedFilesTreeWidgetItem::SharedFilesTreeWidgetItem(QTreeWidget * lv, KviSharedFile * f) + : QTreeWidgetItem(lv) { - setText(0,f->name()); - setText(1,f->absFilePath()); - setText(2,f->userMask()); + setText(0, f->name()); + setText(1, f->absFilePath()); + setText(2, f->userMask()); if(f->expires()) { QDateTime dt; dt.setTime_t(f->expireTime()); - setText(3,dt.toString()); - } else { - setText(3,__tr2qs_ctx("Never","sharedfileswindow")); + setText(3, dt.toString()); + } + else + { + setText(3, __tr2qs_ctx("Never", "sharedfileswindow")); } m_pSharedFilePointer = f; } @@ -205,46 +208,45 @@ SharedFilesTreeWidgetItem::~SharedFilesTreeWidgetItem() { } - SharedFilesWindow::SharedFilesWindow() -: KviWindow(KviWindow::Tool,"shared files window",0) + : KviWindow(KviWindow::Tool, "shared files window", 0) { g_pSharedFilesWindow = this; - m_pSplitter = new KviTalSplitter(Qt::Horizontal,this); + m_pSplitter = new KviTalSplitter(Qt::Horizontal, this); m_pSplitter->setObjectName("sharedfiles_splitter"); KviTalVBox * vbox = new KviTalVBox(m_pSplitter); - m_pTreeWidget = new KviThemedTreeWidget(vbox, this, "sharedfileswindow_treewidget"); + m_pTreeWidget = new KviThemedTreeWidget(vbox, this, "sharedfileswindow_treewidget"); //m_pTreeWidget->header()->hide(); m_pTreeWidget->setAllColumnsShowFocus(true); QStringList columsLabels; - columsLabels.append(__tr2qs_ctx("Name","sharedfileswindow")); - columsLabels.append(__tr2qs_ctx("Filename","sharedfileswindow")); - columsLabels.append(__tr2qs_ctx("Mask","sharedfileswindow")); + columsLabels.append(__tr2qs_ctx("Name", "sharedfileswindow")); + columsLabels.append(__tr2qs_ctx("Filename", "sharedfileswindow")); + columsLabels.append(__tr2qs_ctx("Mask", "sharedfileswindow")); - columsLabels.append(__tr2qs_ctx("Expires","sharedfileswindow")); + columsLabels.append(__tr2qs_ctx("Expires", "sharedfileswindow")); m_pTreeWidget->setHeaderLabels(columsLabels); - m_pTreeWidget->setColumnWidth(0,200); - m_pTreeWidget->setColumnWidth(0,300); - m_pTreeWidget->setColumnWidth(0,300); - m_pTreeWidget->setColumnWidth(0,200); + m_pTreeWidget->setColumnWidth(0, 200); + m_pTreeWidget->setColumnWidth(0, 300); + m_pTreeWidget->setColumnWidth(0, 300); + m_pTreeWidget->setColumnWidth(0, 200); m_pTreeWidget->setSelectionMode(QAbstractItemView::SingleSelection); - connect(m_pTreeWidget,SIGNAL(itemSelectionChanged()),this,SLOT(enableButtons())); + connect(m_pTreeWidget, SIGNAL(itemSelectionChanged()), this, SLOT(enableButtons())); - connect(g_pSharedFilesManager,SIGNAL(sharedFilesChanged()),this,SLOT(fillFileView())); - connect(g_pSharedFilesManager,SIGNAL(sharedFileAdded(KviSharedFile *)),this,SLOT(sharedFileAdded(KviSharedFile *))); - connect(g_pSharedFilesManager,SIGNAL(sharedFileRemoved(KviSharedFile *)),this,SLOT(sharedFileRemoved(KviSharedFile *))); + connect(g_pSharedFilesManager, SIGNAL(sharedFilesChanged()), this, SLOT(fillFileView())); + connect(g_pSharedFilesManager, SIGNAL(sharedFileAdded(KviSharedFile *)), this, SLOT(sharedFileAdded(KviSharedFile *))); + connect(g_pSharedFilesManager, SIGNAL(sharedFileRemoved(KviSharedFile *)), this, SLOT(sharedFileRemoved(KviSharedFile *))); KviTalHBox * b = new KviTalHBox(vbox); - m_pAddButton = new QPushButton(__tr2qs_ctx("&Add...","sharedfileswindow"),b); - connect(m_pAddButton,SIGNAL(clicked()),this,SLOT(addClicked())); - m_pRemoveButton = new QPushButton(__tr2qs_ctx("Re&move","sharedfileswindow"),b); - connect(m_pRemoveButton,SIGNAL(clicked()),this,SLOT(removeClicked())); - m_pEditButton = new QPushButton(__tr2qs_ctx("&Edit","sharedfileswindow"),b); - connect(m_pEditButton,SIGNAL(clicked()),this,SLOT(editClicked())); + m_pAddButton = new QPushButton(__tr2qs_ctx("&Add...", "sharedfileswindow"), b); + connect(m_pAddButton, SIGNAL(clicked()), this, SLOT(addClicked())); + m_pRemoveButton = new QPushButton(__tr2qs_ctx("Re&move", "sharedfileswindow"), b); + connect(m_pRemoveButton, SIGNAL(clicked()), this, SLOT(removeClicked())); + m_pEditButton = new QPushButton(__tr2qs_ctx("&Edit", "sharedfileswindow"), b); + connect(m_pEditButton, SIGNAL(clicked()), this, SLOT(editClicked())); fillFileView(); } @@ -264,47 +266,54 @@ void SharedFilesWindow::enableButtons() void SharedFilesWindow::removeClicked() { SharedFilesTreeWidgetItem * it = (SharedFilesTreeWidgetItem *)m_pTreeWidget->currentItem(); - if(!it)return; + if(!it) + return; - g_pSharedFilesManager->removeSharedFile(it->readOnlySharedFilePointer()->name(),it->readOnlySharedFilePointer()); + g_pSharedFilesManager->removeSharedFile(it->readOnlySharedFilePointer()->name(), it->readOnlySharedFilePointer()); } void SharedFilesWindow::addClicked() { SharedFileEditDialog dlg(0); - if(dlg.exec() != QDialog::Accepted)return; + if(dlg.exec() != QDialog::Accepted) + return; KviSharedFile * f = dlg.getResult(); - if(!f)return; + if(!f) + return; g_pSharedFilesManager->addSharedFile(f); } void SharedFilesWindow::editClicked() { SharedFilesTreeWidgetItem * it = (SharedFilesTreeWidgetItem *)m_pTreeWidget->currentItem(); - if(!it)return; + if(!it) + return; - SharedFileEditDialog dlg(0,it->readOnlySharedFilePointer()); - if(dlg.exec() != QDialog::Accepted)return; + SharedFileEditDialog dlg(0, it->readOnlySharedFilePointer()); + if(dlg.exec() != QDialog::Accepted) + return; SharedFilesTreeWidgetItem * it2 = (SharedFilesTreeWidgetItem *)m_pTreeWidget->currentItem(); - if(it2 != it)return; // ooops ? + if(it2 != it) + return; // ooops ? KviSharedFile * f = dlg.getResult(); - if(!f)return; // ooops 2 ? + if(!f) + return; // ooops 2 ? - g_pSharedFilesManager->removeSharedFile(it->readOnlySharedFilePointer()->name(),it->readOnlySharedFilePointer()); + g_pSharedFilesManager->removeSharedFile(it->readOnlySharedFilePointer()->name(), it->readOnlySharedFilePointer()); g_pSharedFilesManager->addSharedFile(f); } void SharedFilesWindow::fillFileView() { m_pTreeWidget->clear(); - KviPointerHashTableIterator it(*(g_pSharedFilesManager->sharedFileListDict())); + KviPointerHashTableIterator it(*(g_pSharedFilesManager->sharedFileListDict())); while(KviSharedFileList * l = it.current()) { - for(KviSharedFile * o = l->first();o;o = l->next()) - new SharedFilesTreeWidgetItem(m_pTreeWidget,o); + for(KviSharedFile * o = l->first(); o; o = l->next()) + new SharedFilesTreeWidgetItem(m_pTreeWidget, o); ++it; } @@ -313,27 +322,25 @@ void SharedFilesWindow::fillFileView() void SharedFilesWindow::sharedFileAdded(KviSharedFile * f) { - new SharedFilesTreeWidgetItem(m_pTreeWidget,f); + new SharedFilesTreeWidgetItem(m_pTreeWidget, f); enableButtons(); } void SharedFilesWindow::sharedFileRemoved(KviSharedFile * f) { QTreeWidgetItem * it; - for (int i=0;itopLevelItemCount();i++) + for(int i = 0; i < m_pTreeWidget->topLevelItemCount(); i++) { - it=(QTreeWidgetItem *) m_pTreeWidget->topLevelItem(i); + it = (QTreeWidgetItem *)m_pTreeWidget->topLevelItem(i); if(((SharedFilesTreeWidgetItem *)it)->readOnlySharedFilePointer() == f) { - delete ((SharedFilesTreeWidgetItem *)it); + delete((SharedFilesTreeWidgetItem *)it); return; } } enableButtons(); } - - /* void SharedFilesWindow::tipRequest(KviDynamicToolTip * tip,const QPoint &pnt) { @@ -668,7 +675,7 @@ void SharedFilesWindow::clearTerminated() KviSharedFilesManager::instance()->killTerminatedTransfers(); } */ -void SharedFilesWindow::getBaseLogFileName(QString &buffer) +void SharedFilesWindow::getBaseLogFileName(QString & buffer) { buffer.sprintf("SHAREDFILES"); } @@ -681,7 +688,7 @@ QPixmap * SharedFilesWindow::myIconPtr() void SharedFilesWindow::resizeEvent(QResizeEvent *) { //int h = m_pInput->heightHint(); - m_pSplitter->setGeometry(0,0,width(),height()); + m_pSplitter->setGeometry(0, 0, width(), height()); //m_pInput->setGeometry(0,height() - h,width(),h); } @@ -692,7 +699,7 @@ QSize SharedFilesWindow::sizeHint() const void SharedFilesWindow::fillCaptionBuffers() { - m_szPlainTextCaption = __tr2qs_ctx("Shared Files","sharedfileswindow"); + m_szPlainTextCaption = __tr2qs_ctx("Shared Files", "sharedfileswindow"); } void SharedFilesWindow::die() @@ -700,8 +707,6 @@ void SharedFilesWindow::die() close(); } - - //#warning "Load & save properties of this kind of window" //void SharedFilesWindow::saveProperties() diff --git a/src/modules/sharedfileswindow/SharedFilesWindow.h b/src/modules/sharedfileswindow/SharedFilesWindow.h index dc2a04662..a9defece4 100644 --- a/src/modules/sharedfileswindow/SharedFilesWindow.h +++ b/src/modules/sharedfileswindow/SharedFilesWindow.h @@ -44,28 +44,29 @@ class QPushButton; class SharedFilesTreeWidgetItem : public QTreeWidgetItem { public: - SharedFilesTreeWidgetItem(QTreeWidget * lv,KviSharedFile * f); + SharedFilesTreeWidgetItem(QTreeWidget * lv, KviSharedFile * f); ~SharedFilesTreeWidgetItem(); + protected: KviSharedFile * m_pSharedFilePointer; // THIS IS READ ONLY! public: - KviSharedFile * readOnlySharedFilePointer(){ return m_pSharedFilePointer; }; + KviSharedFile * readOnlySharedFilePointer() { return m_pSharedFilePointer; }; }; - class SharedFileEditDialog : public QDialog { Q_OBJECT public: - SharedFileEditDialog(QWidget* par,KviSharedFile * f = 0); + SharedFileEditDialog(QWidget * par, KviSharedFile * f = 0); ~SharedFileEditDialog(); QDateTimeEdit * m_pExpireDateTimeEdit; - QLineEdit * m_pFilePathEdit; - QLineEdit * m_pUserMaskEdit; - QPushButton * m_pBrowseButton; - QLineEdit * m_pShareNameEdit; - QCheckBox * m_pExpireCheckBox; + QLineEdit * m_pFilePathEdit; + QLineEdit * m_pUserMaskEdit; + QPushButton * m_pBrowseButton; + QLineEdit * m_pShareNameEdit; + QCheckBox * m_pExpireCheckBox; + public: KviSharedFile * getResult(); protected slots: @@ -73,7 +74,6 @@ protected slots: void browse(); }; - class SharedFilesWindow : public KviWindow { friend class KviSharedFilesItem; @@ -81,21 +81,25 @@ class SharedFilesWindow : public KviWindow public: SharedFilesWindow(); ~SharedFilesWindow(); + protected: - QSplitter * m_pVertSplitter; + QSplitter * m_pVertSplitter; KviThemedTreeWidget * m_pTreeWidget; - QPushButton * m_pRemoveButton; - QPushButton * m_pEditButton; - QPushButton * m_pAddButton; + QPushButton * m_pRemoveButton; + QPushButton * m_pEditButton; + QPushButton * m_pAddButton; + public: // Methods virtual void die(); + protected: virtual QPixmap * myIconPtr(); virtual void fillCaptionBuffers(); - virtual void resizeEvent(QResizeEvent *e); - virtual void getBaseLogFileName(QString &buffer); + virtual void resizeEvent(QResizeEvent * e); + virtual void getBaseLogFileName(QString & buffer); + public: virtual QSize sizeHint() const; protected slots: diff --git a/src/modules/sharedfileswindow/libkvisharedfileswindow.cpp b/src/modules/sharedfileswindow/libkvisharedfileswindow.cpp index 6877f62d5..5a4891b45 100644 --- a/src/modules/sharedfileswindow/libkvisharedfileswindow.cpp +++ b/src/modules/sharedfileswindow/libkvisharedfileswindow.cpp @@ -58,24 +58,25 @@ SharedFilesWindow * g_pSharedFilesWindow = 0; static bool sharedfileswindow_kvs_cmd_open(KviKvsModuleCommandCall * c) { QString dummy; - bool bCreateMinimized = c->hasSwitch('m',"minimized"); - bool bNoRaise = c->hasSwitch('n',"noraise"); + bool bCreateMinimized = c->hasSwitch('m', "minimized"); + bool bNoRaise = c->hasSwitch('n', "noraise"); if(!g_pSharedFilesWindow) { g_pSharedFilesWindow = new SharedFilesWindow(); - g_pMainWindow->addWindow(g_pSharedFilesWindow,!bCreateMinimized); + g_pMainWindow->addWindow(g_pSharedFilesWindow, !bCreateMinimized); //if(bCreateMinimized)g_pSharedFilesWindow->minimize(); return true; } - if(!bNoRaise)g_pSharedFilesWindow->delayedAutoRaise(); + if(!bNoRaise) + g_pSharedFilesWindow->delayedAutoRaise(); return true; } static bool sharedfileswindow_module_init(KviModule * m) { - KVSM_REGISTER_SIMPLE_COMMAND(m,"open",sharedfileswindow_kvs_cmd_open); + KVSM_REGISTER_SIMPLE_COMMAND(m, "open", sharedfileswindow_kvs_cmd_open); return true; } @@ -93,13 +94,12 @@ static bool sharedfileswindow_module_can_unload(KviModule *) } KVIRC_MODULE( - "SharedFilesWindow", - "4.0.0", - "Copyright (C) 2003 Szymon Stefanek (pragma at kvirc dot net)", - "Shared files window extension", - sharedfileswindow_module_init, - sharedfileswindow_module_can_unload, - 0, - sharedfileswindow_module_cleanup, - "sharedfileswindow" -) + "SharedFilesWindow", + "4.0.0", + "Copyright (C) 2003 Szymon Stefanek (pragma at kvirc dot net)", + "Shared files window extension", + sharedfileswindow_module_init, + sharedfileswindow_module_can_unload, + 0, + sharedfileswindow_module_cleanup, + "sharedfileswindow") diff --git a/src/modules/snd/libkvisnd.cpp b/src/modules/snd/libkvisnd.cpp index ff0779868..a3af9bea0 100644 --- a/src/modules/snd/libkvisnd.cpp +++ b/src/modules/snd/libkvisnd.cpp @@ -37,51 +37,51 @@ #include #ifdef COMPILE_PHONON_SUPPORT - #include - #include - #include - #include +#include +#include +#include +#include #endif //!COMPILE_PHONON_SUPPORT #if defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW) - #include +#include #else //!COMPILE_ON_WINDOWS - #include - #include - #include - - #ifdef COMPILE_ESD_SUPPORT - #include - #endif //COMPILE_ESD_SUPPORT - - #ifdef COMPILE_OSS_SUPPORT - #include - #include - #ifdef HAVE_LINUX_SOUNDCARD_H - #include - #else - // Hint by Andy Fawcett: Thnx :) - #ifdef HAVE_SYS_SOUNDCARD_H - #include - #else - #ifdef HAVE_MACHINE_SOUNDCARD_H - #include - #else - #warning "Ops.. have no soundcard.h ? ... we're going to fail here :/" - #endif - #endif - #endif - #ifdef COMPILE_AUDIOFILE_SUPPORT - #include - #endif //COMPILE_AUDIOFILE_SUPPORT - #endif //COMPILE_OSS_SUPPORT +#include +#include +#include + +#ifdef COMPILE_ESD_SUPPORT +#include +#endif //COMPILE_ESD_SUPPORT + +#ifdef COMPILE_OSS_SUPPORT +#include +#include +#ifdef HAVE_LINUX_SOUNDCARD_H +#include +#else +// Hint by Andy Fawcett: Thnx :) +#ifdef HAVE_SYS_SOUNDCARD_H +#include +#else +#ifdef HAVE_MACHINE_SOUNDCARD_H +#include +#else +#warning "Ops.. have no soundcard.h ? ... we're going to fail here :/" +#endif +#endif +#endif +#ifdef COMPILE_AUDIOFILE_SUPPORT +#include +#endif //COMPILE_AUDIOFILE_SUPPORT +#endif //COMPILE_OSS_SUPPORT #endif static KviSoundPlayer * g_pSoundPlayer = 0; KviSoundPlayer::KviSoundPlayer() -: QObject() + : QObject() { m_pThreadList = new KviPointerList; m_pThreadList->setAutoDelete(true); @@ -92,32 +92,32 @@ KviSoundPlayer::KviSoundPlayer() m_pLastUsedSoundPlayerEntry = NULL; - m_pSoundSystemDict = new KviPointerHashTable(17,false); + m_pSoundSystemDict = new KviPointerHashTable(17, false); m_pSoundSystemDict->setAutoDelete(true); #ifdef COMPILE_PHONON_SUPPORT - m_pSoundSystemDict->insert("phonon",new KviSoundPlayerEntry(KVI_PTR2MEMBER(KviSoundPlayer::playPhonon),KVI_PTR2MEMBER(KviSoundPlayer::cleanupPhonon))); + m_pSoundSystemDict->insert("phonon", new KviSoundPlayerEntry(KVI_PTR2MEMBER(KviSoundPlayer::playPhonon), KVI_PTR2MEMBER(KviSoundPlayer::cleanupPhonon))); #endif //!COMPILE_PHONON_SUPPORT #if defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW) - m_pSoundSystemDict->insert("winmm",new KviSoundPlayerEntry(KVI_PTR2MEMBER(KviSoundPlayer::playWinmm),KVI_PTR2MEMBER(KviSoundPlayer::cleanupWinmm))); + m_pSoundSystemDict->insert("winmm", new KviSoundPlayerEntry(KVI_PTR2MEMBER(KviSoundPlayer::playWinmm), KVI_PTR2MEMBER(KviSoundPlayer::cleanupWinmm))); #else //!COMPILE_ON_WINDOWS - #ifdef COMPILE_OSS_SUPPORT - #ifdef COMPILE_AUDIOFILE_SUPPORT - m_pSoundSystemDict->insert("oss+audiofile",new KviSoundPlayerEntry(KVI_PTR2MEMBER(KviSoundPlayer::playOssAudiofile),KVI_PTR2MEMBER(KviSoundPlayer::cleanupOssAudiofile))); - #endif //COMPILE_AUDIOFILE_SUPPORT - m_pSoundSystemDict->insert("oss",new KviSoundPlayerEntry(KVI_PTR2MEMBER(KviSoundPlayer::playOss),KVI_PTR2MEMBER(KviSoundPlayer::cleanupOss))); - #endif //COMPILE_OSS_SUPPORT +#ifdef COMPILE_OSS_SUPPORT +#ifdef COMPILE_AUDIOFILE_SUPPORT + m_pSoundSystemDict->insert("oss+audiofile", new KviSoundPlayerEntry(KVI_PTR2MEMBER(KviSoundPlayer::playOssAudiofile), KVI_PTR2MEMBER(KviSoundPlayer::cleanupOssAudiofile))); +#endif //COMPILE_AUDIOFILE_SUPPORT + m_pSoundSystemDict->insert("oss", new KviSoundPlayerEntry(KVI_PTR2MEMBER(KviSoundPlayer::playOss), KVI_PTR2MEMBER(KviSoundPlayer::cleanupOss))); +#endif //COMPILE_OSS_SUPPORT - #ifdef COMPILE_ESD_SUPPORT - m_pSoundSystemDict->insert("esd",new KviSoundPlayerEntry(KVI_PTR2MEMBER(KviSoundPlayer::playEsd),KVI_PTR2MEMBER(KviSoundPlayer::cleanupEsd))); - #endif //COMPILE_ESD_SUPPORT +#ifdef COMPILE_ESD_SUPPORT + m_pSoundSystemDict->insert("esd", new KviSoundPlayerEntry(KVI_PTR2MEMBER(KviSoundPlayer::playEsd), KVI_PTR2MEMBER(KviSoundPlayer::cleanupEsd))); +#endif //COMPILE_ESD_SUPPORT #endif //!COMPILE_ON_WINDOWS - m_pSoundSystemDict->insert("qt",new KviSoundPlayerEntry(KVI_PTR2MEMBER(KviSoundPlayer::playQt),KVI_PTR2MEMBER(KviSoundPlayer::cleanupQt))); - m_pSoundSystemDict->insert("null",new KviSoundPlayerEntry(KVI_PTR2MEMBER(KviSoundPlayer::playNull),KVI_PTR2MEMBER(KviSoundPlayer::cleanupNull))); + m_pSoundSystemDict->insert("qt", new KviSoundPlayerEntry(KVI_PTR2MEMBER(KviSoundPlayer::playQt), KVI_PTR2MEMBER(KviSoundPlayer::cleanupQt))); + m_pSoundSystemDict->insert("null", new KviSoundPlayerEntry(KVI_PTR2MEMBER(KviSoundPlayer::playNull), KVI_PTR2MEMBER(KviSoundPlayer::cleanupNull))); } KviSoundPlayer::~KviSoundPlayer() @@ -162,9 +162,9 @@ void KviSoundPlayer::cleanupAfterLastPlayerEntry() m_pLastUsedSoundPlayerEntry = NULL; } -void KviSoundPlayer::getAvailableSoundSystems(QStringList *l) +void KviSoundPlayer::getAvailableSoundSystems(QStringList * l) { - KviPointerHashTableIterator it(*m_pSoundSystemDict); + KviPointerHashTableIterator it(*m_pSoundSystemDict); while(it.current()) { l->append(it.currentKey()); @@ -200,8 +200,9 @@ bool KviSoundPlayer::event(QEvent * e) if(e->type() == KVI_THREAD_EVENT) { KviThread * t = ((KviThreadEvent *)e)->sender(); - if(!t)return true; // huh ? - delete (KviSoundThread *)t; + if(!t) + return true; // huh ? + delete(KviSoundThread *)t; return true; } return QObject::event(e); @@ -222,22 +223,22 @@ void KviSoundPlayer::detectSoundSystem() #if defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW) KVI_OPTION_STRING(KviOption_stringSoundSystem) = "winmm"; #else - #ifdef COMPILE_ESD_SUPPORT - esd_format_t format = ESD_BITS16 | ESD_STREAM | ESD_PLAY | ESD_MONO; - int esd_fd = esd_play_stream(format, 8012, NULL, "kvirc"); - if(esd_fd >= 0) - { - KVI_OPTION_STRING(KviOption_stringSoundSystem) = "esd"; - return; - } - #endif - #ifdef COMPILE_OSS_SUPPORT - #ifdef COMPILE_AUDIOFILE_SUPPORT - KVI_OPTION_STRING(KviOption_stringSoundSystem) = "oss+audiofile"; - return; - #endif - KVI_OPTION_STRING(KviOption_stringSoundSystem) = "oss"; - #endif +#ifdef COMPILE_ESD_SUPPORT + esd_format_t format = ESD_BITS16 | ESD_STREAM | ESD_PLAY | ESD_MONO; + int esd_fd = esd_play_stream(format, 8012, NULL, "kvirc"); + if(esd_fd >= 0) + { + KVI_OPTION_STRING(KviOption_stringSoundSystem) = "esd"; + return; + } +#endif +#ifdef COMPILE_OSS_SUPPORT +#ifdef COMPILE_AUDIOFILE_SUPPORT + KVI_OPTION_STRING(KviOption_stringSoundSystem) = "oss+audiofile"; + return; +#endif + KVI_OPTION_STRING(KviOption_stringSoundSystem) = "oss"; +#endif KVI_OPTION_STRING(KviOption_stringSoundSystem) = "qt"; return; @@ -245,7 +246,7 @@ void KviSoundPlayer::detectSoundSystem() } #ifdef COMPILE_PHONON_SUPPORT -bool KviSoundPlayer::playPhonon(const QString &szFileName) +bool KviSoundPlayer::playPhonon(const QString & szFileName) { if(isMuted()) return true; @@ -253,7 +254,7 @@ bool KviSoundPlayer::playPhonon(const QString &szFileName) Phonon::MediaSource media(QUrl::fromLocalFile(szFileName)); if(!m_pPhononPlayer) - m_pPhononPlayer = Phonon::createPlayer(Phonon::MusicCategory,media); + m_pPhononPlayer = Phonon::createPlayer(Phonon::MusicCategory, media); else m_pPhononPlayer->setCurrentSource(media); @@ -263,9 +264,9 @@ bool KviSoundPlayer::playPhonon(const QString &szFileName) { QString szError = m_pPhononPlayer->errorString(); if(szError.isEmpty()) - qDebug("Phonon player in error state: can't play media '%s'",szFileName.isEmpty() ? "" : szFileName.toUtf8().data()); + qDebug("Phonon player in error state: can't play media '%s'", szFileName.isEmpty() ? "" : szFileName.toUtf8().data()); else - qDebug("Phonon player in error state: %s (can't play media '%s')",szError.toUtf8().data(),szFileName.isEmpty() ? "" : szFileName.toUtf8().data()); + qDebug("Phonon player in error state: %s (can't play media '%s')", szError.toUtf8().data(), szFileName.isEmpty() ? "" : szFileName.toUtf8().data()); return false; } @@ -285,72 +286,74 @@ void KviSoundPlayer::cleanupPhonon() #endif //!COMPILE_PHONON_SUPPORT #if defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW) - bool KviSoundPlayer::playWinmm(const QString &szFileName) - { - sndPlaySound(szFileName.toLocal8Bit().data(),SND_ASYNC | SND_NODEFAULT); +bool KviSoundPlayer::playWinmm(const QString & szFileName) +{ + sndPlaySound(szFileName.toLocal8Bit().data(), SND_ASYNC | SND_NODEFAULT); + return true; +} + +void KviSoundPlayer::cleanupWinmm() +{ + // FIXME: how to stop playing on windows ? +} +#else //!COMPILE_ON_WINDOWS +#ifdef COMPILE_OSS_SUPPORT +#ifdef COMPILE_AUDIOFILE_SUPPORT +bool KviSoundPlayer::playOssAudiofile(const QString & szFileName) +{ + if(isMuted()) return true; + KviOssAudiofileSoundThread * t = new KviOssAudiofileSoundThread(szFileName); + if(!t->start()) + { + delete t; + return false; } + return true; +} - void KviSoundPlayer::cleanupWinmm() +void KviSoundPlayer::cleanupOssAudiofile() +{ +} +#endif //COMPILE_AUDIOFILE_SUPPORT +bool KviSoundPlayer::playOss(const QString & szFileName) +{ + if(isMuted()) + return true; + KviOssSoundThread * t = new KviOssSoundThread(szFileName); + if(!t->start()) { - // FIXME: how to stop playing on windows ? + delete t; + return false; } -#else //!COMPILE_ON_WINDOWS - #ifdef COMPILE_OSS_SUPPORT - #ifdef COMPILE_AUDIOFILE_SUPPORT - bool KviSoundPlayer::playOssAudiofile(const QString &szFileName) - { - if(isMuted()) return true; - KviOssAudiofileSoundThread * t = new KviOssAudiofileSoundThread(szFileName); - if(!t->start()) - { - delete t; - return false; - } - return true; - } - - void KviSoundPlayer::cleanupOssAudiofile() - { - } - #endif //COMPILE_AUDIOFILE_SUPPORT - bool KviSoundPlayer::playOss(const QString &szFileName) - { - if(isMuted()) return true; - KviOssSoundThread * t = new KviOssSoundThread(szFileName); - if(!t->start()) - { - delete t; - return false; - } - return true; - } + return true; +} - void KviSoundPlayer::cleanupOss() - { - } - #endif //COMPILE_OSS_SUPPORT - #ifdef COMPILE_ESD_SUPPORT - bool KviSoundPlayer::playEsd(const QString &szFileName) - { - if(isMuted()) - return true; - KviEsdSoundThread * t = new KviEsdSoundThread(szFileName); - if(!t->start()) - { - delete t; - return false; - } - return true; - } +void KviSoundPlayer::cleanupOss() +{ +} +#endif //COMPILE_OSS_SUPPORT +#ifdef COMPILE_ESD_SUPPORT +bool KviSoundPlayer::playEsd(const QString & szFileName) +{ + if(isMuted()) + return true; + KviEsdSoundThread * t = new KviEsdSoundThread(szFileName); + if(!t->start()) + { + delete t; + return false; + } + return true; +} - void KviSoundPlayer::cleanupEsd() - { - } - #endif //COMPILE_ESD_SUPPORT +void KviSoundPlayer::cleanupEsd() +{ +} +#endif //COMPILE_ESD_SUPPORT #endif //!COMPILE_ON_WINDOWS -bool KviSoundPlayer::playQt(const QString &szFileName) +bool KviSoundPlayer::playQt(const QString & szFileName) { if(isMuted()) return true; @@ -374,7 +377,7 @@ void KviSoundPlayer::cleanupNull() { } -bool KviSoundPlayer::play(const QString &szFileName) +bool KviSoundPlayer::play(const QString & szFileName) { if(isMuted()) return true; @@ -384,14 +387,11 @@ bool KviSoundPlayer::play(const QString &szFileName) if(!e) { if( - (!KVI_OPTION_STRING(KviOption_stringSoundSystem).isEmpty()) && - (!KviQString::equalCI(KVI_OPTION_STRING(KviOption_stringSoundSystem),"unknown")) - ) + (!KVI_OPTION_STRING(KviOption_stringSoundSystem).isEmpty()) && (!KviQString::equalCI(KVI_OPTION_STRING(KviOption_stringSoundSystem), "unknown"))) { qDebug( - "Sound system '%s' is not valid, you may want to re-configure it in the options dialog...", - KVI_OPTION_STRING(KviOption_stringSoundSystem).toUtf8().data() - ); + "Sound system '%s' is not valid, you may want to re-configure it in the options dialog...", + KVI_OPTION_STRING(KviOption_stringSoundSystem).toUtf8().data()); return false; // detection already attempted (and failed?) } @@ -415,9 +415,8 @@ bool KviSoundPlayer::play(const QString &szFileName) return (this->*r)(szFileName); } - -KviSoundThread::KviSoundThread(const QString &szFileName) -: KviThread() +KviSoundThread::KviSoundThread(const QString & szFileName) + : KviThread() { g_pSoundPlayer->registerSoundThread(this); m_szFileName = szFileName; @@ -443,230 +442,229 @@ void KviSoundThread::run() { play(); #if !defined(COMPILE_ON_WINDOWS) && !defined(COMPILE_ON_MINGW) - postEvent(g_pSoundPlayer,new KviThreadEvent(KVI_THREAD_EVENT_SUCCESS)); + postEvent(g_pSoundPlayer, new KviThreadEvent(KVI_THREAD_EVENT_SUCCESS)); #endif } - #if !defined(COMPILE_ON_WINDOWS) && !defined(COMPILE_ON_MINGW) - #ifdef COMPILE_OSS_SUPPORT - #ifdef COMPILE_AUDIOFILE_SUPPORT - KviOssAudiofileSoundThread::KviOssAudiofileSoundThread(const QString &szFileName) - : KviSoundThread(szFileName) - { - } +#ifdef COMPILE_OSS_SUPPORT +#ifdef COMPILE_AUDIOFILE_SUPPORT +KviOssAudiofileSoundThread::KviOssAudiofileSoundThread(const QString & szFileName) + : KviSoundThread(szFileName) +{ +} - KviOssAudiofileSoundThread::~KviOssAudiofileSoundThread() - { - } +KviOssAudiofileSoundThread::~KviOssAudiofileSoundThread() +{ +} - void KviOssAudiofileSoundThread::play() - { - #define BUFFER_FRAMES 4096 +void KviOssAudiofileSoundThread::play() +{ +#define BUFFER_FRAMES 4096 - AFfilehandle file; - AFframecount framesRead; - int sampleFormat, sampleWidth, channelCount, format, freq; - float frameSize; - void * buffer; + AFfilehandle file; + AFframecount framesRead; + int sampleFormat, sampleWidth, channelCount, format, freq; + float frameSize; + void * buffer; - file = afOpenFile(m_szFileName.toUtf8().data(),"r",NULL); - if(!file) - { - qDebug("libaudiofile could not open the file %s",m_szFileName.toUtf8().data()); - qDebug("giving up playing sound..."); - return; // screwed up - } + file = afOpenFile(m_szFileName.toUtf8().data(), "r", NULL); + if(!file) + { + qDebug("libaudiofile could not open the file %s", m_szFileName.toUtf8().data()); + qDebug("giving up playing sound..."); + return; // screwed up + } - sampleFormat = -1; + sampleFormat = -1; - afGetVirtualSampleFormat(file, AF_DEFAULT_TRACK, &sampleFormat, &sampleWidth); + afGetVirtualSampleFormat(file, AF_DEFAULT_TRACK, &sampleFormat, &sampleWidth); - if(sampleFormat == -1) - { - qDebug("libaudiofile couldn't find the sample format for file %s",m_szFileName.toUtf8().data()); - qDebug("giving up playing sound..."); - afCloseFile(file); - return; // screwed up - } + if(sampleFormat == -1) + { + qDebug("libaudiofile couldn't find the sample format for file %s", m_szFileName.toUtf8().data()); + qDebug("giving up playing sound..."); + afCloseFile(file); + return; // screwed up + } - frameSize = afGetVirtualFrameSize(file, AF_DEFAULT_TRACK, 1); - channelCount = afGetVirtualChannels(file, AF_DEFAULT_TRACK); - buffer = KviMemory::allocate(int(BUFFER_FRAMES * frameSize)); + frameSize = afGetVirtualFrameSize(file, AF_DEFAULT_TRACK, 1); + channelCount = afGetVirtualChannels(file, AF_DEFAULT_TRACK); + buffer = KviMemory::allocate(int(BUFFER_FRAMES * frameSize)); - int audiofd_c = open("/dev/dsp", O_WRONLY /*| O_EXCL | O_NDELAY*/); + int audiofd_c = open("/dev/dsp", O_WRONLY /*| O_EXCL | O_NDELAY*/); - QFile audiofd; + QFile audiofd; - if(audiofd_c < 0) - { - qDebug("Could not open audio device /dev/dsp! [OSS+AUDIOFILE]"); - qDebug("(the device is probably busy, errno = %d)",errno); - goto exit_thread; - } + if(audiofd_c < 0) + { + qDebug("Could not open audio device /dev/dsp! [OSS+AUDIOFILE]"); + qDebug("(the device is probably busy, errno = %d)", errno); + goto exit_thread; + } - audiofd.open(audiofd_c,QIODevice::WriteOnly); // ???? what the heck is this for ? + audiofd.open(audiofd_c, QIODevice::WriteOnly); // ???? what the heck is this for ? - if (sampleWidth == 8) - format = AFMT_U8; - else if(sampleWidth == 16) - format = AFMT_S16_NE; + if(sampleWidth == 8) + format = AFMT_U8; + else if(sampleWidth == 16) + format = AFMT_S16_NE; - if(ioctl(audiofd.handle(),SNDCTL_DSP_SETFMT, &format) == -1) - { - qDebug("Could not set format width to DSP! [OSS]"); - goto exit_thread; - } + if(ioctl(audiofd.handle(), SNDCTL_DSP_SETFMT, &format) == -1) + { + qDebug("Could not set format width to DSP! [OSS]"); + goto exit_thread; + } - if (ioctl(audiofd.handle(),SNDCTL_DSP_CHANNELS, &channelCount) == -1) - { - qDebug("Could not set DSP channels! [OSS]"); - goto exit_thread; - } + if(ioctl(audiofd.handle(), SNDCTL_DSP_CHANNELS, &channelCount) == -1) + { + qDebug("Could not set DSP channels! [OSS]"); + goto exit_thread; + } - freq = (int) afGetRate(file, AF_DEFAULT_TRACK); - if (ioctl(audiofd.handle(), SNDCTL_DSP_SPEED, &freq) == -1) - { - qDebug("Could not set DSP speed %d! [OSS]",freq); - goto exit_thread; - } + freq = (int)afGetRate(file, AF_DEFAULT_TRACK); + if(ioctl(audiofd.handle(), SNDCTL_DSP_SPEED, &freq) == -1) + { + qDebug("Could not set DSP speed %d! [OSS]", freq); + goto exit_thread; + } - framesRead = afReadFrames(file, AF_DEFAULT_TRACK, buffer, BUFFER_FRAMES); + framesRead = afReadFrames(file, AF_DEFAULT_TRACK, buffer, BUFFER_FRAMES); - while(!m_bTerminate && (framesRead > 0)) - { - audiofd.write((char *)buffer,(int)(framesRead * frameSize)); - framesRead = afReadFrames(file, AF_DEFAULT_TRACK, buffer,BUFFER_FRAMES); - } + while(!m_bTerminate && (framesRead > 0)) + { + audiofd.write((char *)buffer, (int)(framesRead * frameSize)); + framesRead = afReadFrames(file, AF_DEFAULT_TRACK, buffer, BUFFER_FRAMES); + } - exit_thread: - audiofd.close(); - if(audiofd_c >= 0)close(audiofd_c); - afCloseFile(file); - KviMemory::free(buffer); - } - #endif //COMPILE_AUDIOFILE_SUPPORT +exit_thread: + audiofd.close(); + if(audiofd_c >= 0) + close(audiofd_c); + afCloseFile(file); + KviMemory::free(buffer); +} +#endif //COMPILE_AUDIOFILE_SUPPORT +KviOssSoundThread::KviOssSoundThread(const QString & szFileName) + : KviSoundThread(szFileName) +{ +} - KviOssSoundThread::KviOssSoundThread(const QString &szFileName) - : KviSoundThread(szFileName) - { - } +KviOssSoundThread::~KviOssSoundThread() +{ +} - KviOssSoundThread::~KviOssSoundThread() - { - } +void KviOssSoundThread::play() +{ +#define OSS_BUFFER_SIZE 16384 - void KviOssSoundThread::play() - { - #define OSS_BUFFER_SIZE 16384 + if(!m_szFileName.endsWith(QString(".au"))) + { + qDebug("Oss only player supports only *.au files"); + return; + } - if(!m_szFileName.endsWith(QString(".au"))) - { - qDebug("Oss only player supports only *.au files"); - return; - } + QFile f(m_szFileName); + int fd = -1; + char buf[OSS_BUFFER_SIZE]; + int iDataLen = 0; + int iSize = 0; - QFile f(m_szFileName); - int fd = -1; - char buf[OSS_BUFFER_SIZE]; - int iDataLen = 0; - int iSize = 0; + if(!f.open(QIODevice::ReadOnly)) + { + qDebug("Could not open sound file %s! [OSS]", m_szFileName.toUtf8().data()); + return; + } - if(!f.open(QIODevice::ReadOnly)) - { - qDebug("Could not open sound file %s! [OSS]",m_szFileName.toUtf8().data()); - return; - } + iSize = f.size(); - iSize = f.size(); + if(iSize < 24) + { + qDebug("Could not play sound, file %s too small! [OSS]", m_szFileName.toUtf8().data()); + goto exit_thread; + } - if(iSize < 24) - { - qDebug("Could not play sound, file %s too small! [OSS]",m_szFileName.toUtf8().data()); - goto exit_thread; - } + if(f.read(buf, 24) < 24) + { + qDebug("Error while reading the sound file header (%s)! [OSS]", m_szFileName.toUtf8().data()); + goto exit_thread; + } - if(f.read(buf,24) < 24) - { - qDebug("Error while reading the sound file header (%s)! [OSS]",m_szFileName.toUtf8().data()); - goto exit_thread; - } + iSize -= 24; - iSize -= 24; + fd = open("/dev/audio", O_WRONLY /* | O_EXCL | O_NDELAY*/); + if(fd < 0) + { + qDebug("Could not open device file /dev/audio!"); + qDebug("Maybe other program is using the device? Hint: fuser -uv /dev/audio"); + goto exit_thread; + } - fd = open("/dev/audio", O_WRONLY /* | O_EXCL | O_NDELAY*/); - if(fd < 0) + while(!m_bTerminate && (iSize > 0)) + { + int iCanRead = OSS_BUFFER_SIZE - iDataLen; + if(iCanRead > 0) + { + int iToRead = iSize > iCanRead ? iCanRead : iSize; + int iReaded = f.read(buf + iDataLen, iToRead); + if(iReaded < 1) { - qDebug("Could not open device file /dev/audio!"); - qDebug("Maybe other program is using the device? Hint: fuser -uv /dev/audio"); + qDebug("Error while reading the file data (%s)! [OSS]", m_szFileName.toUtf8().data()); goto exit_thread; } - - - while(!m_bTerminate && (iSize > 0)) + iSize -= iReaded; + iDataLen += iReaded; + } + if(iDataLen > 0) + { + int iWritten = write(fd, buf, iDataLen); + if(iWritten < 0) { - int iCanRead = OSS_BUFFER_SIZE - iDataLen; - if(iCanRead > 0) - { - int iToRead = iSize > iCanRead ? iCanRead : iSize; - int iReaded = f.read(buf + iDataLen,iToRead); - if(iReaded < 1) - { - qDebug("Error while reading the file data (%s)! [OSS]",m_szFileName.toUtf8().data()); - goto exit_thread; - } - iSize -= iReaded; - iDataLen += iReaded; - } - if(iDataLen > 0) + if((errno != EINTR) && (errno != EAGAIN)) { - int iWritten = write(fd,buf,iDataLen); - if(iWritten < 0) - { - if((errno != EINTR) && (errno != EAGAIN)) - { - qDebug("Error while writing the audio data (%s)! [OSS]",m_szFileName.toUtf8().data()); - goto exit_thread; - } - } - iDataLen -= iWritten; - } else { - // nothing to write ???? + qDebug("Error while writing the audio data (%s)! [OSS]", m_szFileName.toUtf8().data()); goto exit_thread; } } - - exit_thread: - f.close(); - if(fd > 0)close(fd); + iDataLen -= iWritten; + } + else + { + // nothing to write ???? + goto exit_thread; } + } +exit_thread: + f.close(); + if(fd > 0) + close(fd); +} - #endif //COMPILE_OSS_SUPPORT +#endif //COMPILE_OSS_SUPPORT - #ifdef COMPILE_ESD_SUPPORT +#ifdef COMPILE_ESD_SUPPORT - KviEsdSoundThread::KviEsdSoundThread(const QString &szFileName) - : KviSoundThread(szFileName) - { - } +KviEsdSoundThread::KviEsdSoundThread(const QString & szFileName) + : KviSoundThread(szFileName) +{ +} - KviEsdSoundThread::~KviEsdSoundThread() - { - } +KviEsdSoundThread::~KviEsdSoundThread() +{ +} - void KviEsdSoundThread::play() - { - // ESD has a really nice API - if(!esd_play_file(NULL,m_szFileName.toUtf8().data(),1)) // this is sync.. FIXME: it can't be stopped! - qDebug("Could not play sound %s! [ESD]",m_szFileName.toUtf8().data()); - } +void KviEsdSoundThread::play() +{ + // ESD has a really nice API + if(!esd_play_file(NULL, m_szFileName.toUtf8().data(), 1)) // this is sync.. FIXME: it can't be stopped! + qDebug("Could not play sound %s! [ESD]", m_szFileName.toUtf8().data()); +} - #endif //COMPILE_ESD_SUPPORT +#endif //COMPILE_ESD_SUPPORT #endif //!COMPILE_ON_WINDOWS - /* @doc: snd.play @type: @@ -695,19 +693,19 @@ static bool snd_kvs_cmd_play(KviKvsModuleCommandCall * c) { QString szFile; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("file name",KVS_PT_STRING,0,szFile) + KVSM_PARAMETER("file name", KVS_PT_STRING, 0, szFile) KVSM_PARAMETERS_END(c) if(szFile.isEmpty() || (!KviFileUtils::fileExists(szFile))) { - if(!c->hasSwitch('q',"quiet")) - c->warning(__tr2qs("Sound file '%Q' not found"),&szFile); + if(!c->hasSwitch('q', "quiet")) + c->warning(__tr2qs("Sound file '%Q' not found"), &szFile); return true; } if(!g_pSoundPlayer->play(szFile)) { - if(!c->hasSwitch('q',"quiet")) - c->warning(__tr2qs("Unable to play sound '%Q'"),&szFile); + if(!c->hasSwitch('q', "quiet")) + c->warning(__tr2qs("Unable to play sound '%Q'"), &szFile); } return true; @@ -716,16 +714,17 @@ static bool snd_kvs_cmd_play(KviKvsModuleCommandCall * c) static bool snd_kvs_cmd_autodetect(KviKvsModuleCommandCall * c) { g_pSoundPlayer->detectSoundSystem(); - if(KviQString::equalCI(KVI_OPTION_STRING(KviOption_stringSoundSystem),"null")) + if(KviQString::equalCI(KVI_OPTION_STRING(KviOption_stringSoundSystem), "null")) { - c->window()->outputNoFmt(KVI_OUT_SYSTEMERROR,__tr2qs("Sorry, I can't find a sound system to use on this machine")); - } else { - c->window()->output(KVI_OUT_SYSTEMMESSAGE,__tr2qs("Sound system detected to: %s"),KVI_OPTION_STRING(KviOption_stringSoundSystem).toUtf8().data()); + c->window()->outputNoFmt(KVI_OUT_SYSTEMERROR, __tr2qs("Sorry, I can't find a sound system to use on this machine")); + } + else + { + c->window()->output(KVI_OUT_SYSTEMMESSAGE, __tr2qs("Sound system detected to: %s"), KVI_OPTION_STRING(KviOption_stringSoundSystem).toUtf8().data()); } return true; } - /* @doc: snd.mute @type: @@ -784,7 +783,6 @@ static bool snd_kvs_cmd_unmute(KviKvsModuleCommandCall * c) Returns if the sounds muted */ - static bool snd_kvs_fnc_ismuted(KviKvsModuleFunctionCall * c) { c->returnValue()->setBoolean(g_pSoundPlayer->isMuted()); @@ -795,12 +793,12 @@ static bool snd_module_init(KviModule * m) { g_pSoundPlayer = new KviSoundPlayer(); - KVSM_REGISTER_SIMPLE_COMMAND(m,"autodetect",snd_kvs_cmd_autodetect); - KVSM_REGISTER_SIMPLE_COMMAND(m,"play",snd_kvs_cmd_play); - KVSM_REGISTER_SIMPLE_COMMAND(m,"mute",snd_kvs_cmd_mute); - KVSM_REGISTER_SIMPLE_COMMAND(m,"unmute",snd_kvs_cmd_unmute); + KVSM_REGISTER_SIMPLE_COMMAND(m, "autodetect", snd_kvs_cmd_autodetect); + KVSM_REGISTER_SIMPLE_COMMAND(m, "play", snd_kvs_cmd_play); + KVSM_REGISTER_SIMPLE_COMMAND(m, "mute", snd_kvs_cmd_mute); + KVSM_REGISTER_SIMPLE_COMMAND(m, "unmute", snd_kvs_cmd_unmute); - KVSM_REGISTER_FUNCTION(m,"isMuted",snd_kvs_fnc_ismuted); + KVSM_REGISTER_FUNCTION(m, "isMuted", snd_kvs_fnc_ismuted); return true; } @@ -817,21 +815,21 @@ static bool snd_module_can_unload(KviModule *) return !(g_pSoundPlayer->havePlayingSounds()); } -static bool snd_module_ctrl(KviModule *,const char * operation,void * param) +static bool snd_module_ctrl(KviModule *, const char * operation, void * param) { - if(kvi_strEqualCI(operation,"getAvailableSoundSystems")) + if(kvi_strEqualCI(operation, "getAvailableSoundSystems")) { // we expect param to be a pointer to QStringList - QStringList *l=(QStringList *)param; + QStringList * l = (QStringList *)param; g_pSoundPlayer->getAvailableSoundSystems(l); return true; } - if(kvi_strEqualCI(operation,"detectSoundSystem")) + if(kvi_strEqualCI(operation, "detectSoundSystem")) { g_pSoundPlayer->detectSoundSystem(); return true; } - if(kvi_strEqualCI(operation,"play")) + if(kvi_strEqualCI(operation, "play")) { QString * pszFileName = (QString *)param; if(pszFileName) @@ -841,16 +839,14 @@ static bool snd_module_ctrl(KviModule *,const char * operation,void * param) return false; } - KVIRC_MODULE( - "Sound", // module name - "4.0.0", // module version - "(C) 2002 Szymon Stefanek (pragma at kvirc dot net)," \ - "Juanjo Alvarez (juanjux at yahoo dot es)", // author & (C) - "Sound playing commands", - snd_module_init, - snd_module_can_unload, - snd_module_ctrl, - snd_module_cleanup, - 0 -) + "Sound", // module name + "4.0.0", // module version + "(C) 2002 Szymon Stefanek (pragma at kvirc dot net)," + "Juanjo Alvarez (juanjux at yahoo dot es)", // author & (C) + "Sound playing commands", + snd_module_init, + snd_module_can_unload, + snd_module_ctrl, + snd_module_cleanup, + 0) diff --git a/src/modules/snd/libkvisnd.h b/src/modules/snd/libkvisnd.h index c42572a0b..47f8ce119 100644 --- a/src/modules/snd/libkvisnd.h +++ b/src/modules/snd/libkvisnd.h @@ -39,65 +39,70 @@ class KviSoundPlayer; class KviSoundThread : public KviThread { public: - KviSoundThread(const QString &szFileName); + KviSoundThread(const QString & szFileName); virtual ~KviSoundThread(); + protected: bool m_bTerminate; QString m_szFileName; + public: void terminate(); + protected: virtual void play(); virtual void run(); }; - #if !defined(COMPILE_ON_WINDOWS) && !defined(COMPILE_ON_MINGW) - #ifdef COMPILE_OSS_SUPPORT - class KviOssSoundThread : public KviSoundThread - { - public: - KviOssSoundThread(const QString &szFileName); - virtual ~KviOssSoundThread(); - protected: - virtual void play(); - }; - - #ifdef COMPILE_AUDIOFILE_SUPPORT - class KviOssAudiofileSoundThread : public KviSoundThread - { - public: - KviOssAudiofileSoundThread(const QString &szFileName); - virtual ~KviOssAudiofileSoundThread(); - protected: - virtual void play(); - }; - #endif //COMPILE_AUDIOFILE_SUPPORT - #endif //COMPILE_OSS_SUPPORT - - #ifdef COMPILE_ESD_SUPPORT - class KviEsdSoundThread : public KviSoundThread - { - public: - KviEsdSoundThread(const QString &szFileName); - virtual ~KviEsdSoundThread(); - protected: - virtual void play(); - }; - #endif //COMPILE_ESD_SUPPORT - - #ifdef COMPILE_ARTS_SUPPORT - class KviArtsSoundThread : public KviSoundThread - { - public: - KviArtsSoundThread(const QString &szFileName); - virtual ~KviArtsSoundThread(); - protected: - virtual void play(); - }; - #endif //COMPILE_ARTS_SUPPORT -#endif //!COMPILE_ON_WINDOWS +#ifdef COMPILE_OSS_SUPPORT +class KviOssSoundThread : public KviSoundThread +{ +public: + KviOssSoundThread(const QString & szFileName); + virtual ~KviOssSoundThread(); + +protected: + virtual void play(); +}; + +#ifdef COMPILE_AUDIOFILE_SUPPORT +class KviOssAudiofileSoundThread : public KviSoundThread +{ +public: + KviOssAudiofileSoundThread(const QString & szFileName); + virtual ~KviOssAudiofileSoundThread(); + +protected: + virtual void play(); +}; +#endif //COMPILE_AUDIOFILE_SUPPORT +#endif //COMPILE_OSS_SUPPORT +#ifdef COMPILE_ESD_SUPPORT +class KviEsdSoundThread : public KviSoundThread +{ +public: + KviEsdSoundThread(const QString & szFileName); + virtual ~KviEsdSoundThread(); + +protected: + virtual void play(); +}; +#endif //COMPILE_ESD_SUPPORT + +#ifdef COMPILE_ARTS_SUPPORT +class KviArtsSoundThread : public KviSoundThread +{ +public: + KviArtsSoundThread(const QString & szFileName); + virtual ~KviArtsSoundThread(); + +protected: + virtual void play(); +}; +#endif //COMPILE_ARTS_SUPPORT +#endif //!COMPILE_ON_WINDOWS #ifdef COMPILE_PHONON_SUPPORT namespace Phonon @@ -106,7 +111,7 @@ namespace Phonon } #endif //!COMPILE_PHONON_SUPPORT -typedef bool (KviSoundPlayer::*SoundSystemPlayRoutine)(const QString &szFileName); +typedef bool (KviSoundPlayer::*SoundSystemPlayRoutine)(const QString & szFileName); typedef void (KviSoundPlayer::*SoundSystemCleanupRoutine)(); class KviSoundPlayerEntry @@ -114,9 +119,10 @@ class KviSoundPlayerEntry private: SoundSystemPlayRoutine m_pPlayRoutine; SoundSystemCleanupRoutine m_pCleanupRoutine; + public: - KviSoundPlayerEntry(SoundSystemPlayRoutine pPlayRoutine,SoundSystemCleanupRoutine pCleanupRoutine) - : m_pPlayRoutine(pPlayRoutine), m_pCleanupRoutine(pCleanupRoutine) + KviSoundPlayerEntry(SoundSystemPlayRoutine pPlayRoutine, SoundSystemCleanupRoutine pCleanupRoutine) + : m_pPlayRoutine(pPlayRoutine), m_pCleanupRoutine(pCleanupRoutine) { } @@ -129,7 +135,6 @@ public: { return m_pCleanupRoutine; } - }; class KviSoundPlayer : public QObject @@ -139,8 +144,9 @@ class KviSoundPlayer : public QObject public: KviSoundPlayer(); virtual ~KviSoundPlayer(); + public: - bool play(const QString &szFileName); + bool play(const QString & szFileName); void detectSoundSystem(); bool havePlayingSounds(); void getAvailableSoundSystems(QStringList * l); @@ -152,50 +158,52 @@ public: { KVI_OPTION_BOOL(KviOption_boolMuteAllSounds) = muted; } + protected: KviPointerList * m_pThreadList; - KviPointerHashTable * m_pSoundSystemDict; + KviPointerHashTable * m_pSoundSystemDict; #ifdef COMPILE_PHONON_SUPPORT Phonon::MediaObject * m_pPhononPlayer; #endif //!COMPILE_PHONON_SUPPORT KviSoundPlayerEntry * m_pLastUsedSoundPlayerEntry; + protected: void registerSoundThread(KviSoundThread * t); void unregisterSoundThread(KviSoundThread * t); - virtual bool event(QEvent *e); + virtual bool event(QEvent * e); + protected: void stopAllSoundThreads(); void cleanupAfterLastPlayerEntry(); #ifdef COMPILE_PHONON_SUPPORT - bool playPhonon(const QString &szFileName); + bool playPhonon(const QString & szFileName); void cleanupPhonon(); #endif //!COMPILE_PHONON_SUPPORT #if defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW) - bool playWinmm(const QString &szFileName); + bool playWinmm(const QString & szFileName); void cleanupWinmm(); #else //!COMPILE_ON_WINDOWS - #ifdef COMPILE_OSS_SUPPORT - bool playOss(const QString &szFileName); - void cleanupOss(); - #ifdef COMPILE_AUDIOFILE_SUPPORT - bool playOssAudiofile(const QString &szFileName); - void cleanupOssAudiofile(); - #endif //COMPILE_AUDIOFILE_SUPPORT - #endif //COMPILE_OSS_SUPPORT - #ifdef COMPILE_ARTS_SUPPORT - bool playArts(const QString &szFileName); - void cleanupArts(); - #endif //COMPILE_ARTS_SUPPORT - #ifdef COMPILE_ESD_SUPPORT - bool playEsd(const QString &szFileName); - void cleanupEsd(); - #endif //COMPILE_ESD_SUPPORT +#ifdef COMPILE_OSS_SUPPORT + bool playOss(const QString & szFileName); + void cleanupOss(); +#ifdef COMPILE_AUDIOFILE_SUPPORT + bool playOssAudiofile(const QString & szFileName); + void cleanupOssAudiofile(); +#endif //COMPILE_AUDIOFILE_SUPPORT +#endif //COMPILE_OSS_SUPPORT +#ifdef COMPILE_ARTS_SUPPORT + bool playArts(const QString & szFileName); + void cleanupArts(); +#endif //COMPILE_ARTS_SUPPORT +#ifdef COMPILE_ESD_SUPPORT + bool playEsd(const QString & szFileName); + void cleanupEsd(); +#endif //COMPILE_ESD_SUPPORT #endif //!COMPILE_ON_WINDOWS - bool playQt(const QString &szFileName); + bool playQt(const QString & szFileName); void cleanupQt(); - bool playNull(const QString &szFileName); + bool playNull(const QString & szFileName); void cleanupNull(); }; - #endif // _KVISND_H_ diff --git a/src/modules/socketspy/SocketSpyWindow.cpp b/src/modules/socketspy/SocketSpyWindow.cpp index 5e69a087f..1789b35de 100644 --- a/src/modules/socketspy/SocketSpyWindow.cpp +++ b/src/modules/socketspy/SocketSpyWindow.cpp @@ -35,12 +35,12 @@ extern KviPointerList * g_pSocketSpyWindowList; SocketSpyWindow::SocketSpyWindow(KviConsoleWindow * lpConsole) -: KviWindow(KviWindow::SocketSpy,"socket_spy",lpConsole), KviIrcDataStreamMonitor(lpConsole->context()) + : KviWindow(KviWindow::SocketSpy, "socket_spy", lpConsole), KviIrcDataStreamMonitor(lpConsole->context()) { g_pSocketSpyWindowList->append(this); - m_pSplitter = new KviTalSplitter(Qt::Horizontal,this); + m_pSplitter = new KviTalSplitter(Qt::Horizontal, this); setObjectName("spysocket_splitter"); - m_pIrcView = new KviIrcView(m_pSplitter,this); + m_pIrcView = new KviIrcView(m_pSplitter, this); // Ensure proper focusing //setFocusHandler(m_pIrcView,this); } @@ -62,7 +62,7 @@ QPixmap * SocketSpyWindow::myIconPtr() void SocketSpyWindow::resizeEvent(QResizeEvent *) { - m_pSplitter->setGeometry(0,0,width(),height()); + m_pSplitter->setGeometry(0, 0, width(), height()); } QSize SocketSpyWindow::sizeHint() const @@ -70,9 +70,9 @@ QSize SocketSpyWindow::sizeHint() const return m_pIrcView->sizeHint(); } -void SocketSpyWindow::getBaseLogFileName(QString &buffer) +void SocketSpyWindow::getBaseLogFileName(QString & buffer) { - buffer.sprintf("SOCKETSPY_%d",context()->id()); + buffer.sprintf("SOCKETSPY_%d", context()->id()); } void SocketSpyWindow::fillCaptionBuffers() @@ -82,25 +82,24 @@ void SocketSpyWindow::fillCaptionBuffers() bool SocketSpyWindow::incomingMessage(const char * message) { - outputNoFmt(KVI_OUT_SOCKETMESSAGE,console()->decodeText(message)); + outputNoFmt(KVI_OUT_SOCKETMESSAGE, console()->decodeText(message)); return false; } bool SocketSpyWindow::outgoingMessage(const char * message) { - outputNoFmt(KVI_OUT_RAW,console()->decodeText(message)); + outputNoFmt(KVI_OUT_RAW, console()->decodeText(message)); return false; - } void SocketSpyWindow::connectionInitiated() { - output(KVI_OUT_SOCKETWARNING,__tr2qs("Socket open")); + output(KVI_OUT_SOCKETWARNING, __tr2qs("Socket open")); } void SocketSpyWindow::connectionTerminated() { - output(KVI_OUT_SOCKETWARNING,__tr2qs("Socket closed")); + output(KVI_OUT_SOCKETWARNING, __tr2qs("Socket closed")); } void SocketSpyWindow::applyOptions() diff --git a/src/modules/socketspy/SocketSpyWindow.h b/src/modules/socketspy/SocketSpyWindow.h index 859a8d498..839901d10 100644 --- a/src/modules/socketspy/SocketSpyWindow.h +++ b/src/modules/socketspy/SocketSpyWindow.h @@ -36,12 +36,14 @@ class SocketSpyWindow : public KviWindow, public KviIrcDataStreamMonitor public: SocketSpyWindow(KviConsoleWindow * lpConsole); ~SocketSpyWindow(); + protected: virtual QPixmap * myIconPtr(); virtual void fillCaptionBuffers(); - virtual void resizeEvent(QResizeEvent *e); - virtual void getBaseLogFileName(QString &buffer); + virtual void resizeEvent(QResizeEvent * e); + virtual void getBaseLogFileName(QString & buffer); virtual void applyOptions(); + public: virtual QSize sizeHint() const; virtual bool incomingMessage(const char * message); diff --git a/src/modules/socketspy/libkvisocketspy.cpp b/src/modules/socketspy/libkvisocketspy.cpp index 08bb5e14a..81995cc5f 100644 --- a/src/modules/socketspy/libkvisocketspy.cpp +++ b/src/modules/socketspy/libkvisocketspy.cpp @@ -32,7 +32,6 @@ KviPointerList * g_pSocketSpyWindowList = 0; - /* @doc: socketspy.open @type: @@ -51,8 +50,9 @@ KviPointerList * g_pSocketSpyWindowList = 0; static bool socketspy_kvs_cmd_open(KviKvsModuleCommandCall * c) { - if(!c->window()->console())return c->context()->errorNoIrcContext(); - SocketSpyWindow *w = new SocketSpyWindow(c->window()->console()); + if(!c->window()->console()) + return c->context()->errorNoIrcContext(); + SocketSpyWindow * w = new SocketSpyWindow(c->window()->console()); g_pMainWindow->addWindow(w); return true; } @@ -62,7 +62,7 @@ static bool socketspy_module_init(KviModule * m) g_pSocketSpyWindowList = new KviPointerList; g_pSocketSpyWindowList->setAutoDelete(false); - KVSM_REGISTER_SIMPLE_COMMAND(m,"open",socketspy_kvs_cmd_open); + KVSM_REGISTER_SIMPLE_COMMAND(m, "open", socketspy_kvs_cmd_open); return true; } @@ -81,13 +81,12 @@ static bool socketspy_module_can_unload(KviModule *) } KVIRC_MODULE( - "SocketSpy", // module name - "4.0.0", // module version - "Copyright (C) 2000 Szymon Stefanek (pragma at kvirc dot net)", // author & (C) - "SocketSpy IRC socket traffic monitor", - socketspy_module_init, - socketspy_module_can_unload, - 0, - socketspy_module_cleanup, - 0 -) + "SocketSpy", // module name + "4.0.0", // module version + "Copyright (C) 2000 Szymon Stefanek (pragma at kvirc dot net)", // author & (C) + "SocketSpy IRC socket traffic monitor", + socketspy_module_init, + socketspy_module_can_unload, + 0, + socketspy_module_cleanup, + 0) diff --git a/src/modules/spaste/SlowPasteController.cpp b/src/modules/spaste/SlowPasteController.cpp index f3598237e..99ec083a0 100644 --- a/src/modules/spaste/SlowPasteController.cpp +++ b/src/modules/spaste/SlowPasteController.cpp @@ -38,8 +38,8 @@ extern KviPointerList * g_pControllerList; -SlowPasteController::SlowPasteController(KviWindow * w,int id) -: m_pClipBuff(NULL),m_pFile(NULL),m_pId(id),m_pWindow(w) +SlowPasteController::SlowPasteController(KviWindow * w, int id) + : m_pClipBuff(NULL), m_pFile(NULL), m_pId(id), m_pWindow(w) { g_pControllerList->append(this); //m_pWindow = w; @@ -63,15 +63,18 @@ SlowPasteController::~SlowPasteController() delete m_pClipBuff; } -bool SlowPasteController::pasteFileInit(QString &fileName) +bool SlowPasteController::pasteFileInit(QString & fileName) { - if(m_pClipBuff)return false; // can't paste a file while pasting the clipboard - if(m_pFile)return false; // can't paste two files at a time + if(m_pClipBuff) + return false; // can't paste a file while pasting the clipboard + if(m_pFile) + return false; // can't paste two files at a time m_pFile = new QFile(fileName); - if(!m_pFile->open(QIODevice::ReadOnly))return false; + if(!m_pFile->open(QIODevice::ReadOnly)) + return false; //avoid double connection - disconnect(m_pTimer,SIGNAL(timeout()),0,0); - connect(m_pTimer,SIGNAL(timeout()),this,SLOT(pasteFile())); + disconnect(m_pTimer, SIGNAL(timeout()), 0, 0); + connect(m_pTimer, SIGNAL(timeout()), this, SLOT(pasteFile())); //avoid timer reset if always active if(!m_pTimer->isActive()) m_pTimer->start(KVI_OPTION_UINT(KviOption_uintPasteDelay)); @@ -80,17 +83,20 @@ bool SlowPasteController::pasteFileInit(QString &fileName) bool SlowPasteController::pasteClipboardInit(void) { - if(m_pFile)return false; // can't paste clipboard while pasting a file + if(m_pFile) + return false; // can't paste clipboard while pasting a file QString tmp(g_pApp->clipboard()->text()); if(m_pClipBuff) { - (*m_pClipBuff) += tmp.isEmpty()?QStringList():tmp.split("\n",QString::KeepEmptyParts); - } else { - m_pClipBuff = new QStringList(tmp.isEmpty()?QStringList():tmp.split("\n",QString::KeepEmptyParts)); + (*m_pClipBuff) += tmp.isEmpty() ? QStringList() : tmp.split("\n", QString::KeepEmptyParts); + } + else + { + m_pClipBuff = new QStringList(tmp.isEmpty() ? QStringList() : tmp.split("\n", QString::KeepEmptyParts)); } //avoid double connection - disconnect(m_pTimer,SIGNAL(timeout()),0,0); - connect(m_pTimer,SIGNAL(timeout()),this,SLOT(pasteClipboard())); + disconnect(m_pTimer, SIGNAL(timeout()), 0, 0); + connect(m_pTimer, SIGNAL(timeout()), this, SLOT(pasteClipboard())); //avoid timer reset if always active if(!m_pTimer->isActive()) m_pTimer->start(KVI_OPTION_UINT(KviOption_uintPasteDelay)); @@ -101,22 +107,26 @@ void SlowPasteController::pasteFile(void) { QString line; char data[1024]; - if(m_pFile->readLine(data,sizeof(data)) != -1) + if(m_pFile->readLine(data, sizeof(data)) != -1) { line = data; if(line.isEmpty()) line = QChar(KviControlCodes::Reset); - line.replace('\t',QString(KVI_OPTION_UINT(KviOption_uintSpacesToExpandTabulationInput),' ')); //expand tabs to spaces + line.replace('\t', QString(KVI_OPTION_UINT(KviOption_uintSpacesToExpandTabulationInput), ' ')); //expand tabs to spaces if(!g_pApp->windowExists(m_pWindow)) { m_pFile->close(); delete this; - } else { + } + else + { m_pWindow->ownMessage(line.toLatin1()); } - } else { //File finished + } + else + { //File finished m_pFile->close(); delete this; } @@ -126,10 +136,12 @@ void SlowPasteController::pasteClipboard(void) { if(m_pClipBuff->isEmpty() || !g_pApp->windowExists(m_pWindow)) { - delete this; - } else { + delete this; + } + else + { QString line = m_pClipBuff->takeFirst(); - line.replace('\t',QString(KVI_OPTION_UINT(KviOption_uintSpacesToExpandTabulationInput),' ')); //expand tabs to spaces + line.replace('\t', QString(KVI_OPTION_UINT(KviOption_uintSpacesToExpandTabulationInput), ' ')); //expand tabs to spaces m_pWindow->ownMessage(line); } } diff --git a/src/modules/spaste/SlowPasteController.h b/src/modules/spaste/SlowPasteController.h index 7d99fb0a0..944724c81 100644 --- a/src/modules/spaste/SlowPasteController.h +++ b/src/modules/spaste/SlowPasteController.h @@ -25,7 +25,6 @@ // //============================================================================= - #include "KviWindow.h" #include "KviCString.h" @@ -37,24 +36,25 @@ class SlowPasteController : public QObject { Q_OBJECT public: - SlowPasteController(KviWindow * w,int id); + SlowPasteController(KviWindow * w, int id); ~SlowPasteController(); //bool pasteFileInit(KviCString * fileName); - bool pasteFileInit(QString &fileName); + bool pasteFileInit(QString & fileName); bool pasteClipboardInit(void); - int getId(void){return m_pId;}; - KviWindow * window(void){return m_pWindow;}; + int getId(void) { return m_pId; }; + KviWindow * window(void) { return m_pWindow; }; //void stop(void); protected slots: void pasteFile(void); void pasteClipboard(void); + private: - QStringList *m_pClipBuff; - QFile *m_pFile; - int m_pId; - KviWindow *m_pWindow; - QTimer *m_pTimer; + QStringList * m_pClipBuff; + QFile * m_pFile; + int m_pId; + KviWindow * m_pWindow; + QTimer * m_pTimer; }; #endif //SPASTE_CONTROLLER_H diff --git a/src/modules/spaste/libkvispaste.cpp b/src/modules/spaste/libkvispaste.cpp index 0f072a9b1..c47f9bfa8 100644 --- a/src/modules/spaste/libkvispaste.cpp +++ b/src/modules/spaste/libkvispaste.cpp @@ -39,7 +39,7 @@ #include #if !defined(COMPILE_ON_WINDOWS) && !defined(COMPILE_ON_MINGW) - #include +#include #endif KviPointerList * g_pControllerList = 0; @@ -47,25 +47,29 @@ int ctrlId = 0; static SlowPasteController * spaste_find_controller(KviWindow * w) { - for(SlowPasteController * spc = g_pControllerList->first();spc;spc = g_pControllerList->next()) + for(SlowPasteController * spc = g_pControllerList->first(); spc; spc = g_pControllerList->next()) { - if(spc->window() == w)return spc; + if(spc->window() == w) + return spc; } return 0; } -static KviWindow * spaste_kvs_find_window(QString &win, KviKvsModuleCommandCall * c) +static KviWindow * spaste_kvs_find_window(QString & win, KviKvsModuleCommandCall * c) { KviWindow * w; - if(!win.isEmpty())w = g_pApp->findWindow(win); - else w = c->window(); + if(!win.isEmpty()) + w = g_pApp->findWindow(win); + else + w = c->window(); if(!w) { - c->warning(__tr("Window with ID '%Q' not found"),&win); + c->warning(__tr("Window with ID '%Q' not found"), &win); return 0; } - if((w->type() == KviWindow::Channel) || (w->type() == KviWindow::Query) || (w->type() == KviWindow::DccChat))return w; - c->warning(__tr2qs("The specified window (%Q) is not a channel/query/DCC chat"),&win); + if((w->type() == KviWindow::Channel) || (w->type() == KviWindow::Query) || (w->type() == KviWindow::DccChat)) + return w; + c->warning(__tr2qs("The specified window (%Q) is not a channel/query/DCC chat"), &win); return 0; } @@ -92,14 +96,15 @@ static KviWindow * spaste_kvs_find_window(QString &win, KviKvsModuleCommandCall static bool spaste_kvs_cmd_file(KviKvsModuleCommandCall * c) { - QString szFile,szWindow; + QString szFile, szWindow; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("file name",KVS_PT_STRING,0,szFile) - KVSM_PARAMETER("window",KVS_PT_STRING,KVS_PF_OPTIONAL,szWindow) + KVSM_PARAMETER("file name", KVS_PT_STRING, 0, szFile) + KVSM_PARAMETER("window", KVS_PT_STRING, KVS_PF_OPTIONAL, szWindow) KVSM_PARAMETERS_END(c) - KviWindow * window = spaste_kvs_find_window(szWindow,c); - if(!window)return false; + KviWindow * window = spaste_kvs_find_window(szWindow, c); + if(!window) + return false; // FIXME //if(szFile.isEmpty() || (!KviFileUtils::fileExists(szFile.toAscii()))) @@ -110,22 +115,24 @@ static bool spaste_kvs_cmd_file(KviKvsModuleCommandCall * c) } QFile tmp(szFile); - if(!tmp.open(QIODevice::ReadOnly)) { + if(!tmp.open(QIODevice::ReadOnly)) + { c->warning(__tr2qs("I can't open that file")); return false; } tmp.close(); SlowPasteController * controller = spaste_find_controller(window); - if(!controller)controller = new SlowPasteController(window,++ctrlId); - if(!controller->pasteFileInit(szFile)) { + if(!controller) + controller = new SlowPasteController(window, ++ctrlId); + if(!controller->pasteFileInit(szFile)) + { c->warning(__tr2qs("Could not paste file")); return false; } return true; } - /* @doc: spaste.clipboard @type: @@ -154,13 +161,15 @@ static bool spaste_kvs_cmd_clipboard(KviKvsModuleCommandCall * c) { QString szWindow; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("window",KVS_PT_STRING,KVS_PF_OPTIONAL,szWindow) + KVSM_PARAMETER("window", KVS_PT_STRING, KVS_PF_OPTIONAL, szWindow) KVSM_PARAMETERS_END(c) - KviWindow * window = spaste_kvs_find_window(szWindow,c); - if(!window)return false; + KviWindow * window = spaste_kvs_find_window(szWindow, c); + if(!window) + return false; SlowPasteController * controller = spaste_find_controller(window); - if(!controller)controller = new SlowPasteController(window,++ctrlId); + if(!controller) + controller = new SlowPasteController(window, ++ctrlId); controller->pasteClipboardInit(); return true; } @@ -197,42 +206,43 @@ static bool spaste_kvs_cmd_clipboard(KviKvsModuleCommandCall * c) static bool spaste_kvs_cmd_stop(KviKvsModuleCommandCall * c) { - kvs_uint_t iId=0; + kvs_uint_t iId = 0; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("delay",KVS_PT_UNSIGNEDINTEGER,KVS_PF_OPTIONAL,iId) + KVSM_PARAMETER("delay", KVS_PT_UNSIGNEDINTEGER, KVS_PF_OPTIONAL, iId) KVSM_PARAMETERS_END(c) - if(c->hasSwitch('a',"all")) //Delete all spaste's + if(c->hasSwitch('a', "all")) //Delete all spaste's { - while(g_pControllerList->first()) delete g_pControllerList->first(); + while(g_pControllerList->first()) + delete g_pControllerList->first(); return true; } KviPointerListIterator it(*g_pControllerList); - SlowPasteController *item; + SlowPasteController * item; if(!iId) //Delete all spaste's from the current window { - if((c->window()->type() != KviWindow::Channel) && - (c->window()->type() != KviWindow::Query) && - (c->window()->type() != KviWindow::DccChat) && - (c->window()->type() != KviWindow::DeadChannel) && - (c->window()->type() != KviWindow::DeadQuery) - ) + if((c->window()->type() != KviWindow::Channel) && (c->window()->type() != KviWindow::Query) && (c->window()->type() != KviWindow::DccChat) && (c->window()->type() != KviWindow::DeadChannel) && (c->window()->type() != KviWindow::DeadQuery)) { QString szWinId = c->window()->id(); - c->warning(__tr2qs("The specified window (%Q) is not a Channel/Query/DCC"),&szWinId); + c->warning(__tr2qs("The specified window (%Q) is not a Channel/Query/DCC"), &szWinId); return false; - } else { - while( (item = it.current()) != 0) + } + else + { + while((item = it.current()) != 0) { ++it; - if(KviQString::equalCS(item->window()->id(),c->window()->id()))delete item; + if(KviQString::equalCS(item->window()->id(), c->window()->id())) + delete item; } } - } else { + } + else + { //Delete the spaste with the given id - while( (item = it.current()) != 0) + while((item = it.current()) != 0) { ++it; if(item->getId() == (kvs_int_t)iId) @@ -265,13 +275,13 @@ static bool spaste_kvs_cmd_stop(KviKvsModuleCommandCall * c) static bool spaste_kvs_cmd_list(KviKvsModuleCommandCall * c) { KviPointerListIterator it(*g_pControllerList); - SlowPasteController *item; + SlowPasteController * item; - while( (item = it.current()) != 0) + while((item = it.current()) != 0) { ++it; QString szWinId = item->window()->id(); - c->window()->output(KVI_OUT_NONE,__tr2qs("Slow-paste ID:%d Window:%Q"),item->getId(),&szWinId); + c->window()->output(KVI_OUT_NONE, __tr2qs("Slow-paste ID:%d Window:%Q"), item->getId(), &szWinId); } return true; } @@ -298,7 +308,7 @@ static bool spaste_kvs_cmd_setdelay(KviKvsModuleCommandCall * c) { kvs_int_t delay; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("delay",KVS_PT_INTEGER,0,delay) + KVSM_PARAMETER("delay", KVS_PT_INTEGER, 0, delay) KVSM_PARAMETERS_END(c) KVI_OPTION_UINT(KviOption_uintPasteDelay) = delay; return true; @@ -309,17 +319,18 @@ static bool spaste_module_init(KviModule * m) g_pControllerList = new KviPointerList; g_pControllerList->setAutoDelete(false); - KVSM_REGISTER_SIMPLE_COMMAND(m,"file",spaste_kvs_cmd_file); - KVSM_REGISTER_SIMPLE_COMMAND(m,"clipboard",spaste_kvs_cmd_clipboard); - KVSM_REGISTER_SIMPLE_COMMAND(m,"setdelay",spaste_kvs_cmd_setdelay); - KVSM_REGISTER_SIMPLE_COMMAND(m,"stop",spaste_kvs_cmd_stop); - KVSM_REGISTER_SIMPLE_COMMAND(m,"list",spaste_kvs_cmd_list); + KVSM_REGISTER_SIMPLE_COMMAND(m, "file", spaste_kvs_cmd_file); + KVSM_REGISTER_SIMPLE_COMMAND(m, "clipboard", spaste_kvs_cmd_clipboard); + KVSM_REGISTER_SIMPLE_COMMAND(m, "setdelay", spaste_kvs_cmd_setdelay); + KVSM_REGISTER_SIMPLE_COMMAND(m, "stop", spaste_kvs_cmd_stop); + KVSM_REGISTER_SIMPLE_COMMAND(m, "list", spaste_kvs_cmd_list); return true; } static bool spaste_module_cleanup(KviModule *) { - while(g_pControllerList->first()) delete g_pControllerList->first(); + while(g_pControllerList->first()) + delete g_pControllerList->first(); delete g_pControllerList; g_pControllerList = 0; @@ -332,13 +343,12 @@ static bool spaste_module_can_unload(KviModule *) } KVIRC_MODULE( - "SPaste", // module name - "4.0.0", // module version - "(C) 2002 Juanjo Alvarez (juanjux@yahoo.es)", // author & (C) - "Delayed paste commands", - spaste_module_init, - spaste_module_can_unload, - 0, - spaste_module_cleanup, - 0 -) + "SPaste", // module name + "4.0.0", // module version + "(C) 2002 Juanjo Alvarez (juanjux@yahoo.es)", // author & (C) + "Delayed paste commands", + spaste_module_init, + spaste_module_can_unload, + 0, + spaste_module_cleanup, + 0) diff --git a/src/modules/spaste/libkvispaste.h b/src/modules/spaste/libkvispaste.h index 2d8aa2605..bdd9da8a2 100644 --- a/src/modules/spaste/libkvispaste.h +++ b/src/modules/spaste/libkvispaste.h @@ -27,8 +27,9 @@ #include "KviWindow.h" -typedef struct _SPasteThreadData { - QString * strData; +typedef struct _SPasteThreadData +{ + QString * strData; KviWindow * win; } SPasteThreadData; diff --git a/src/modules/spellchecker/libkvispellchecker.cpp b/src/modules/spellchecker/libkvispellchecker.cpp index 76f8c5398..55cb3f19c 100644 --- a/src/modules/spellchecker/libkvispellchecker.cpp +++ b/src/modules/spellchecker/libkvispellchecker.cpp @@ -28,8 +28,8 @@ #include #include -static EnchantBroker* g_pEnchantBroker = NULL; -static KviPointerList* g_pEnchantDicts = NULL; +static EnchantBroker * g_pEnchantBroker = NULL; +static KviPointerList * g_pEnchantDicts = NULL; /* @doc: spellchecker.available_dictionaries @@ -46,22 +46,21 @@ static KviPointerList* g_pEnchantDicts = NULL; value is name of provider for that language (e.g. Aspell). */ static void spellchecker_enumerate_dicts( - const char* szLang, - const char* /*szName*/, - const char* szDesc, - const char* /*szFile*/, - void* pData - ) + const char * szLang, + const char * /*szName*/, + const char * szDesc, + const char * /*szFile*/, + void * pData) { - KviKvsHash* pHash = reinterpret_cast(pData); + KviKvsHash * pHash = reinterpret_cast(pData); pHash->set(szLang, new KviKvsVariant(szDesc)); } -static bool spellchecker_kvs_available_dictionaries(KviKvsModuleFunctionCall* c) +static bool spellchecker_kvs_available_dictionaries(KviKvsModuleFunctionCall * c) { KVSM_PARAMETERS_BEGIN(c) KVSM_PARAMETERS_END(c) - KviKvsHash* pHash = new KviKvsHash; + KviKvsHash * pHash = new KviKvsHash; enchant_broker_list_dicts(g_pEnchantBroker, spellchecker_enumerate_dicts, pHash); c->returnValue()->setHash(pHash); return true; @@ -80,23 +79,22 @@ static bool spellchecker_kvs_available_dictionaries(KviKvsModuleFunctionCall* c) @description: This function returns true if the word is spelled correctly. */ -static bool spellchecker_kvs_check(KviKvsModuleFunctionCall* c) +static bool spellchecker_kvs_check(KviKvsModuleFunctionCall * c) { QString szWord; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("word", KVS_PT_STRING, 0, szWord) + KVSM_PARAMETER("word", KVS_PT_STRING, 0, szWord) KVSM_PARAMETERS_END(c) QByteArray utf8 = szWord.toUtf8(); bool bResult = g_pEnchantDicts->isEmpty(); KviPointerListIterator it(*g_pEnchantDicts); - for (bool b = it.moveFirst(); b; b = it.moveNext()) + for(bool b = it.moveFirst(); b; b = it.moveNext()) bResult |= enchant_dict_check(*it, utf8.data(), utf8.size()) == 0; c->returnValue()->setBoolean(bResult); return true; } - /* @doc: spellchecker.suggestions @type: @@ -112,14 +110,14 @@ static bool spellchecker_kvs_check(KviKvsModuleFunctionCall* c) If the word seems to be spelled correctly or there are no dictionaries selected then the function returns an empty array. */ -static bool spellchecker_kvs_suggestions(KviKvsModuleFunctionCall* c) +static bool spellchecker_kvs_suggestions(KviKvsModuleFunctionCall * c) { QString szWord; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("word", KVS_PT_STRING, 0, szWord) + KVSM_PARAMETER("word", KVS_PT_STRING, 0, szWord) KVSM_PARAMETERS_END(c) - QHash hAllSuggestions; + QHash hAllSuggestions; if(!g_pEnchantDicts->isEmpty()) { @@ -129,12 +127,12 @@ static bool spellchecker_kvs_suggestions(KviKvsModuleFunctionCall* c) for(bool b = it.moveFirst(); b; b = it.moveNext()) { size_t iCount = 0; - char ** suggestions = enchant_dict_suggest(*it,utf8.data(),utf8.size(),&iCount); + char ** suggestions = enchant_dict_suggest(*it, utf8.data(), utf8.size(), &iCount); if(suggestions) { - for(size_t i=0;i lSuggestions = hAllSuggestions.keys(); - Q_FOREACH(QString szSuggestion,lSuggestions) + Q_FOREACH(QString szSuggestion, lSuggestions) pArray->append(new KviKvsVariant(szSuggestion)); c->returnValue()->setArray(pArray); @@ -151,15 +149,19 @@ static bool spellchecker_kvs_suggestions(KviKvsModuleFunctionCall* c) static void spellchecker_reload_dicts() { - while (!g_pEnchantDicts->isEmpty()) + while(!g_pEnchantDicts->isEmpty()) enchant_broker_free_dict(g_pEnchantBroker, g_pEnchantDicts->takeFirst()); - const QStringList& wantedDictionaries = KVI_OPTION_STRINGLIST(KviOption_stringlistSpellCheckerDictionaries); - foreach(QString szLang, wantedDictionaries) { - EnchantDict* pDict = enchant_broker_request_dict(g_pEnchantBroker, szLang.toUtf8().data()); - if (pDict) { + const QStringList & wantedDictionaries = KVI_OPTION_STRINGLIST(KviOption_stringlistSpellCheckerDictionaries); + foreach(QString szLang, wantedDictionaries) + { + EnchantDict * pDict = enchant_broker_request_dict(g_pEnchantBroker, szLang.toUtf8().data()); + if(pDict) + { g_pEnchantDicts->append(pDict); - } else { + } + else + { qDebug("Can't load spellchecker dictionary %s: %s", szLang.toUtf8().data(), enchant_broker_get_error(g_pEnchantBroker)); } } @@ -186,7 +188,7 @@ static bool spellchecker_kvs_reload_dictionaries(KviKvsModuleCommandCall * c) return true; } -static bool spellchecker_module_init(KviModule* m) +static bool spellchecker_module_init(KviModule * m) { g_pEnchantBroker = enchant_broker_init(); g_pEnchantDicts = new KviPointerList(/* bAutoDelete = */ false); @@ -200,9 +202,9 @@ static bool spellchecker_module_init(KviModule* m) return true; } -static bool spellchecker_module_cleanup(KviModule*) +static bool spellchecker_module_cleanup(KviModule *) { - while (!g_pEnchantDicts->isEmpty()) + while(!g_pEnchantDicts->isEmpty()) enchant_broker_free_dict(g_pEnchantBroker, g_pEnchantDicts->takeFirst()); delete g_pEnchantDicts; @@ -213,13 +215,12 @@ static bool spellchecker_module_cleanup(KviModule*) } KVIRC_MODULE( - "SpellChecker", // module name - "4.0.0", // module version - "Copyright (C) 2014 Alexey Sokolov (sokolov at google dot com)", // author & (C) - "Spell checker", - spellchecker_module_init, - 0, - 0, - spellchecker_module_cleanup, - 0 -) + "SpellChecker", // module name + "4.0.0", // module version + "Copyright (C) 2014 Alexey Sokolov (sokolov at google dot com)", // author & (C) + "Spell checker", + spellchecker_module_init, + 0, + 0, + spellchecker_module_cleanup, + 0) diff --git a/src/modules/str/libkvistr.cpp b/src/modules/str/libkvistr.cpp index 83bafc5d9..8e5b1eead 100644 --- a/src/modules/str/libkvistr.cpp +++ b/src/modules/str/libkvistr.cpp @@ -39,14 +39,14 @@ #include #ifdef COMPILE_SSL_SUPPORT - // The current implementation - #include - #include - #include +// The current implementation +#include +#include +#include #else - // The fallback we can always use, but with very limited set of - // functionality. - #include +// The fallback we can always use, but with very limited set of +// functionality. +#include #endif /* @@ -72,15 +72,15 @@ */ static bool str_kvs_fnc_section(KviKvsModuleFunctionCall * c) { - QString szString, szSeparator,szSplittedString; + QString szString, szSeparator, szSplittedString; kvs_int_t iPosFrom, iPosTo; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("string_to_split",KVS_PT_STRING,0,szString) - KVSM_PARAMETER("separator",KVS_PT_NONEMPTYSTRING,0,szSeparator) - KVSM_PARAMETER("pos_from",KVS_PT_INT,0,iPosFrom) - KVSM_PARAMETER("pos_to",KVS_PT_INT,0,iPosTo) + KVSM_PARAMETER("string_to_split", KVS_PT_STRING, 0, szString) + KVSM_PARAMETER("separator", KVS_PT_NONEMPTYSTRING, 0, szSeparator) + KVSM_PARAMETER("pos_from", KVS_PT_INT, 0, iPosFrom) + KVSM_PARAMETER("pos_to", KVS_PT_INT, 0, iPosTo) KVSM_PARAMETERS_END(c) - c->returnValue()->setString(szString.section(szSeparator,iPosFrom,iPosTo)); + c->returnValue()->setString(szString.section(szSeparator, iPosFrom, iPosTo)); return true; } @@ -108,8 +108,8 @@ static bool str_kvs_fnc_fromclipboard(KviKvsModuleFunctionCall * c) QString szString; KVSM_PARAMETERS_BEGIN(c) KVSM_PARAMETERS_END(c) - QClipboard *cb = QApplication::clipboard(); - szString = cb->text(QClipboard::Clipboard); + QClipboard * cb = QApplication::clipboard(); + szString = cb->text(QClipboard::Clipboard); c->returnValue()->setString(szString); return true; } @@ -135,10 +135,10 @@ static bool str_kvs_cmd_toClipboard(KviKvsModuleCommandCall * c) { QString szValue; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("value",KVS_PT_STRING,KVS_PF_OPTIONAL,szValue) + KVSM_PARAMETER("value", KVS_PT_STRING, KVS_PF_OPTIONAL, szValue) KVSM_PARAMETERS_END(c) - QClipboard *cb = QApplication::clipboard(); - cb->setText(szValue, QClipboard::Clipboard ); + QClipboard * cb = QApplication::clipboard(); + cb->setText(szValue, QClipboard::Clipboard); return true; } @@ -174,7 +174,7 @@ static bool str_kvs_fnc_len(KviKvsModuleFunctionCall * c) { QString szString; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("data",KVS_PT_STRING,0,szString) + KVSM_PARAMETER("data", KVS_PT_STRING, 0, szString) KVSM_PARAMETERS_END(c) c->returnValue()->setInteger(szString.length()); return true; @@ -198,9 +198,9 @@ static bool str_kvs_fnc_len(KviKvsModuleFunctionCall * c) */ static bool str_kvs_fnc_lowcase(KviKvsModuleFunctionCall * c) { - QString szString; + QString szString; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("string_to_convert",KVS_PT_STRING,0,szString) + KVSM_PARAMETER("string_to_convert", KVS_PT_STRING, 0, szString) KVSM_PARAMETERS_END(c) c->returnValue()->setString(KviQString::lowerISO88591(szString)); return true; @@ -224,9 +224,9 @@ static bool str_kvs_fnc_lowcase(KviKvsModuleFunctionCall * c) */ static bool str_kvs_fnc_upcase(KviKvsModuleFunctionCall * c) { - QString szString; + QString szString; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("string_to_convert",KVS_PT_STRING,0,szString) + KVSM_PARAMETER("string_to_convert", KVS_PT_STRING, 0, szString) KVSM_PARAMETERS_END(c) c->returnValue()->setString(KviQString::upperISO88591(szString)); return true; @@ -250,9 +250,9 @@ static bool str_kvs_fnc_upcase(KviKvsModuleFunctionCall * c) */ static bool str_kvs_fnc_localelowcase(KviKvsModuleFunctionCall * c) { - QString szString; + QString szString; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("string_to_convert",KVS_PT_STRING,0,szString) + KVSM_PARAMETER("string_to_convert", KVS_PT_STRING, 0, szString) KVSM_PARAMETERS_END(c) c->returnValue()->setString(szString.toLower()); return true; @@ -276,9 +276,9 @@ static bool str_kvs_fnc_localelowcase(KviKvsModuleFunctionCall * c) */ static bool str_kvs_fnc_localeupcase(KviKvsModuleFunctionCall * c) { - QString szString; + QString szString; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("string_to_convert",KVS_PT_STRING,0,szString) + KVSM_PARAMETER("string_to_convert", KVS_PT_STRING, 0, szString) KVSM_PARAMETERS_END(c) c->returnValue()->setString(szString.toUpper()); return true; @@ -302,13 +302,12 @@ static bool str_kvs_fnc_isnumber(KviKvsModuleFunctionCall * c) KviKvsVariant * v; KviKvsNumber num; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("givenstring",KVS_PT_VARIANT,0,v) + KVSM_PARAMETER("givenstring", KVS_PT_VARIANT, 0, v) KVSM_PARAMETERS_END(c) c->returnValue()->setBoolean(v->asNumber(num)); return true; } - /* @doc: str.isunsignednumber @type: @@ -328,13 +327,16 @@ static bool str_kvs_fnc_isunsignednumber(KviKvsModuleFunctionCall * c) KviKvsNumber nNum; bool bRet; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("givenstring",KVS_PT_VARIANT,0,v) + KVSM_PARAMETER("givenstring", KVS_PT_VARIANT, 0, v) KVSM_PARAMETERS_END(c) - if(!v->asNumber(nNum)) bRet = false; + if(!v->asNumber(nNum)) + bRet = false; else { - if(nNum.isInteger()) bRet = nNum.integer() >= 0; - else bRet = nNum.real() >= 0.0; + if(nNum.isInteger()) + bRet = nNum.integer() >= 0; + else + bRet = nNum.real() >= 0.0; } c->returnValue()->setBoolean(bRet); return true; @@ -360,10 +362,12 @@ static bool str_kvs_fnc_isempty(KviKvsModuleFunctionCall * c) QString v; bool bRet; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("datastring",KVS_PT_STRING,0,v) + KVSM_PARAMETER("datastring", KVS_PT_STRING, 0, v) KVSM_PARAMETERS_END(c) - if(v.isEmpty()) bRet = true; - else bRet = false; + if(v.isEmpty()) + bRet = true; + else + bRet = false; c->returnValue()->setBoolean(bRet); return true; } @@ -389,11 +393,11 @@ static bool str_kvs_fnc_contains(KviKvsModuleFunctionCall * c) QString szString, szSubString; bool bCase, bIs; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("container",KVS_PT_STRING,0,szString) - KVSM_PARAMETER("tofind",KVS_PT_STRING,0,szSubString) - KVSM_PARAMETER("case",KVS_PT_BOOL,KVS_PF_OPTIONAL,bCase) + KVSM_PARAMETER("container", KVS_PT_STRING, 0, szString) + KVSM_PARAMETER("tofind", KVS_PT_STRING, 0, szSubString) + KVSM_PARAMETER("case", KVS_PT_BOOL, KVS_PF_OPTIONAL, bCase) KVSM_PARAMETERS_END(c) - bIs = bCase ? szString.contains(szSubString,Qt::CaseSensitive) : szString.contains(szSubString,Qt::CaseInsensitive); + bIs = bCase ? szString.contains(szSubString, Qt::CaseSensitive) : szString.contains(szSubString, Qt::CaseInsensitive); c->returnValue()->setBoolean(bIs); return true; } @@ -419,11 +423,11 @@ static bool str_kvs_fnc_equal(KviKvsModuleFunctionCall * c) QString szString, szString2; bool bCase, bIs; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("fromcompare",KVS_PT_STRING,0,szString) - KVSM_PARAMETER("tocompare",KVS_PT_STRING,0,szString2) - KVSM_PARAMETER("case",KVS_PT_BOOL,KVS_PF_OPTIONAL,bCase) + KVSM_PARAMETER("fromcompare", KVS_PT_STRING, 0, szString) + KVSM_PARAMETER("tocompare", KVS_PT_STRING, 0, szString2) + KVSM_PARAMETER("case", KVS_PT_BOOL, KVS_PF_OPTIONAL, bCase) KVSM_PARAMETERS_END(c) - bIs = bCase ? KviQString::equalCS(szString,szString2) : KviQString::equalCI(szString,szString2); + bIs = bCase ? KviQString::equalCS(szString, szString2) : KviQString::equalCI(szString, szString2); c->returnValue()->setBoolean(bIs); return true; } @@ -450,11 +454,11 @@ static bool str_kvs_fnc_cmp(KviKvsModuleFunctionCall * c) bool bCase; int iCmp; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("fromcompare",KVS_PT_STRING,0,szString) - KVSM_PARAMETER("tocompare",KVS_PT_STRING,0,szString2) - KVSM_PARAMETER("case",KVS_PT_BOOL,KVS_PF_OPTIONAL,bCase) + KVSM_PARAMETER("fromcompare", KVS_PT_STRING, 0, szString) + KVSM_PARAMETER("tocompare", KVS_PT_STRING, 0, szString2) + KVSM_PARAMETER("case", KVS_PT_BOOL, KVS_PF_OPTIONAL, bCase) KVSM_PARAMETERS_END(c) - iCmp = bCase ? szString.compare(szString2,Qt::CaseSensitive) : szString.compare(szString2,Qt::CaseInsensitive); + iCmp = bCase ? szString.compare(szString2, Qt::CaseSensitive) : szString.compare(szString2, Qt::CaseInsensitive); c->returnValue()->setInteger(iCmp); return true; } @@ -484,13 +488,14 @@ static bool str_kvs_fnc_find(KviKvsModuleFunctionCall * c) QString szFindIn, szToFind; kvs_int_t iOcurence; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("findIn",KVS_PT_STRING,0,szFindIn) - KVSM_PARAMETER("tofind",KVS_PT_STRING,0,szToFind) - KVSM_PARAMETER("occurrence",KVS_PT_INTEGER,KVS_PF_OPTIONAL,iOcurence) + KVSM_PARAMETER("findIn", KVS_PT_STRING, 0, szFindIn) + KVSM_PARAMETER("tofind", KVS_PT_STRING, 0, szToFind) + KVSM_PARAMETER("occurrence", KVS_PT_INTEGER, KVS_PF_OPTIONAL, iOcurence) KVSM_PARAMETERS_END(c) int pos = 1; - if(iOcurence!=0) pos = iOcurence; - if(pos<1) + if(iOcurence != 0) + pos = iOcurence; + if(pos < 1) { c->returnValue()->setInteger(-1); return true; @@ -509,9 +514,9 @@ static bool str_kvs_fnc_find(KviKvsModuleFunctionCall * c) int idx; int totalIdx = 0; - while (cnt<=pos) + while(cnt <= pos) { - idx = szFindIn.right(szFindIn.length() - totalIdx).indexOf(szToFind,Qt::CaseInsensitive); + idx = szFindIn.right(szFindIn.length() - totalIdx).indexOf(szToFind, Qt::CaseInsensitive); if(idx == -1) { c->returnValue()->setInteger(-1); @@ -547,12 +552,12 @@ static bool str_kvs_fnc_findfirst(KviKvsModuleFunctionCall * c) int iIdx; kvs_int_t iFromIndex; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("findIn",KVS_PT_STRING,0,szString) - KVSM_PARAMETER("toFind",KVS_PT_STRING,0,szString2) - KVSM_PARAMETER("case",KVS_PT_BOOL,KVS_PF_OPTIONAL,bCase) - KVSM_PARAMETER("from_index",KVS_PT_INTEGER,KVS_PF_OPTIONAL,iFromIndex) + KVSM_PARAMETER("findIn", KVS_PT_STRING, 0, szString) + KVSM_PARAMETER("toFind", KVS_PT_STRING, 0, szString2) + KVSM_PARAMETER("case", KVS_PT_BOOL, KVS_PF_OPTIONAL, bCase) + KVSM_PARAMETER("from_index", KVS_PT_INTEGER, KVS_PF_OPTIONAL, iFromIndex) KVSM_PARAMETERS_END(c) - iIdx = bCase ? szString.indexOf(szString2,iFromIndex) : szString.indexOf(szString2,iFromIndex,Qt::CaseInsensitive); + iIdx = bCase ? szString.indexOf(szString2, iFromIndex) : szString.indexOf(szString2, iFromIndex, Qt::CaseInsensitive); c->returnValue()->setInteger(iIdx); return true; } @@ -578,11 +583,11 @@ static bool str_kvs_fnc_findlast(KviKvsModuleFunctionCall * c) bool bCase; int iIdx; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("findIn",KVS_PT_STRING,0,szString) - KVSM_PARAMETER("toFind",KVS_PT_STRING,0,szString2) - KVSM_PARAMETER("case",KVS_PT_BOOL,KVS_PF_OPTIONAL,bCase) + KVSM_PARAMETER("findIn", KVS_PT_STRING, 0, szString) + KVSM_PARAMETER("toFind", KVS_PT_STRING, 0, szString2) + KVSM_PARAMETER("case", KVS_PT_BOOL, KVS_PF_OPTIONAL, bCase) KVSM_PARAMETERS_END(c) - iIdx = bCase ? szString.lastIndexOf(szString2) : szString.lastIndexOf(szString2,-1,Qt::CaseInsensitive); + iIdx = bCase ? szString.lastIndexOf(szString2) : szString.lastIndexOf(szString2, -1, Qt::CaseInsensitive); c->returnValue()->setInteger(iIdx); return true; } @@ -606,8 +611,8 @@ static bool str_kvs_fnc_left(KviKvsModuleFunctionCall * c) QString szString; kvs_int_t iIdx; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("data",KVS_PT_STRING,0,szString) - KVSM_PARAMETER("index",KVS_PT_INTEGER,0,iIdx) + KVSM_PARAMETER("data", KVS_PT_STRING, 0, szString) + KVSM_PARAMETER("index", KVS_PT_INTEGER, 0, iIdx) KVSM_PARAMETERS_END(c) c->returnValue()->setString(szString.left(iIdx)); return true; @@ -633,8 +638,8 @@ static bool str_kvs_fnc_right(KviKvsModuleFunctionCall * c) QString szString; kvs_int_t iIdx; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("data",KVS_PT_STRING,0,szString) - KVSM_PARAMETER("index",KVS_PT_INTEGER,0,iIdx) + KVSM_PARAMETER("data", KVS_PT_STRING, 0, szString) + KVSM_PARAMETER("index", KVS_PT_INTEGER, 0, iIdx) KVSM_PARAMETERS_END(c) c->returnValue()->setString(szString.right(iIdx)); return true; @@ -659,13 +664,13 @@ static bool str_kvs_fnc_right(KviKvsModuleFunctionCall * c) static bool str_kvs_fnc_mid(KviKvsModuleFunctionCall * c) { QString szString; - kvs_int_t iIdx,iNchars; + kvs_int_t iIdx, iNchars; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("data",KVS_PT_STRING,0,szString) - KVSM_PARAMETER("startidx",KVS_PT_INTEGER,0,iIdx) - KVSM_PARAMETER("nchars",KVS_PT_INTEGER,KVS_PF_OPTIONAL,iNchars) + KVSM_PARAMETER("data", KVS_PT_STRING, 0, szString) + KVSM_PARAMETER("startidx", KVS_PT_INTEGER, 0, iIdx) + KVSM_PARAMETER("nchars", KVS_PT_INTEGER, KVS_PF_OPTIONAL, iNchars) KVSM_PARAMETERS_END(c) - c->returnValue()->setString(szString.mid(iIdx,iNchars<1?-1:iNchars)); + c->returnValue()->setString(szString.mid(iIdx, iNchars < 1 ? -1 : iNchars)); return true; } @@ -685,10 +690,10 @@ static bool str_kvs_fnc_mid(KviKvsModuleFunctionCall * c) */ static bool str_kvs_fnc_append(KviKvsModuleFunctionCall * c) { - QString szString,szString2; + QString szString, szString2; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("string",KVS_PT_STRING,0,szString) - KVSM_PARAMETER("toappend",KVS_PT_STRING,0,szString2) + KVSM_PARAMETER("string", KVS_PT_STRING, 0, szString) + KVSM_PARAMETER("toappend", KVS_PT_STRING, 0, szString2) KVSM_PARAMETERS_END(c) c->returnValue()->setString(szString.append(szString2)); return true; @@ -710,10 +715,10 @@ static bool str_kvs_fnc_append(KviKvsModuleFunctionCall * c) */ static bool str_kvs_fnc_prepend(KviKvsModuleFunctionCall * c) { - QString szString,szString2; + QString szString, szString2; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("string",KVS_PT_STRING,0,szString) - KVSM_PARAMETER("toprepend",KVS_PT_STRING,0,szString2) + KVSM_PARAMETER("string", KVS_PT_STRING, 0, szString) + KVSM_PARAMETER("toprepend", KVS_PT_STRING, 0, szString2) KVSM_PARAMETERS_END(c) c->returnValue()->setString(szString.prepend(szString2)); return true; @@ -736,14 +741,14 @@ static bool str_kvs_fnc_prepend(KviKvsModuleFunctionCall * c) */ static bool str_kvs_fnc_insert(KviKvsModuleFunctionCall * c) { - QString szString,szString2; + QString szString, szString2; kvs_int_t iIdx; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("string",KVS_PT_STRING,0,szString) - KVSM_PARAMETER("substring",KVS_PT_STRING,0,szString2) - KVSM_PARAMETER("nchars",KVS_PT_INTEGER,0,iIdx) + KVSM_PARAMETER("string", KVS_PT_STRING, 0, szString) + KVSM_PARAMETER("substring", KVS_PT_STRING, 0, szString2) + KVSM_PARAMETER("nchars", KVS_PT_INTEGER, 0, iIdx) KVSM_PARAMETERS_END(c) - c->returnValue()->setString(szString.insert(iIdx,szString2)); + c->returnValue()->setString(szString.insert(iIdx, szString2)); return true; } @@ -765,7 +770,7 @@ static bool str_kvs_fnc_strip(KviKvsModuleFunctionCall * c) { QString szString; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("string",KVS_PT_STRING,0,szString) + KVSM_PARAMETER("string", KVS_PT_STRING, 0, szString) KVSM_PARAMETERS_END(c) c->returnValue()->setString(szString.trimmed()); return true; @@ -789,13 +794,15 @@ static bool str_kvs_fnc_stripleft(KviKvsModuleFunctionCall * c) { QString szString; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("string",KVS_PT_STRING,0,szString) + KVSM_PARAMETER("string", KVS_PT_STRING, 0, szString) KVSM_PARAMETERS_END(c) if(szString.length() > 0) { int idx = 0; - while(szString[idx].isSpace())idx++; - if(idx > 0)szString.remove(0,idx); + while(szString[idx].isSpace()) + idx++; + if(idx > 0) + szString.remove(0, idx); } c->returnValue()->setString(szString); return true; @@ -819,16 +826,19 @@ static bool str_kvs_fnc_stripright(KviKvsModuleFunctionCall * c) { QString szString; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("string",KVS_PT_STRING,0,szString) + KVSM_PARAMETER("string", KVS_PT_STRING, 0, szString) KVSM_PARAMETERS_END(c) int iIdx = 0; - if (szString.isEmpty()) return true; - while(szString.at(szString.length() - (iIdx+1)).isSpace()) - { - iIdx++; - if (szString.length() - (iIdx+1)<0) break; - } - if(iIdx > 0)szString.remove(szString.length() - iIdx,iIdx); + if(szString.isEmpty()) + return true; + while(szString.at(szString.length() - (iIdx + 1)).isSpace()) + { + iIdx++; + if(szString.length() - (iIdx + 1) < 0) + break; + } + if(iIdx > 0) + szString.remove(szString.length() - iIdx, iIdx); c->returnValue()->setString(szString); return true; } @@ -851,7 +861,7 @@ static bool str_kvs_fnc_stripcolors(KviKvsModuleFunctionCall * c) { QString szString; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("string",KVS_PT_STRING,0,szString) + KVSM_PARAMETER("string", KVS_PT_STRING, 0, szString) KVSM_PARAMETERS_END(c) c->returnValue()->setString(KviControlCodes::stripControlBytes(szString)); return true; @@ -882,12 +892,12 @@ static bool str_kvs_fnc_replace(KviKvsModuleFunctionCall * c) QString szString, szNewStr, szToReplace; bool bCase; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("string",KVS_PT_STRING,0,szString) - KVSM_PARAMETER("toreplace",KVS_PT_STRING,0,szToReplace) - KVSM_PARAMETER("newstr",KVS_PT_STRING,0,szNewStr) - KVSM_PARAMETER("case",KVS_PT_BOOL,KVS_PF_OPTIONAL,bCase) + KVSM_PARAMETER("string", KVS_PT_STRING, 0, szString) + KVSM_PARAMETER("toreplace", KVS_PT_STRING, 0, szToReplace) + KVSM_PARAMETER("newstr", KVS_PT_STRING, 0, szNewStr) + KVSM_PARAMETER("case", KVS_PT_BOOL, KVS_PF_OPTIONAL, bCase) KVSM_PARAMETERS_END(c) - bCase ? szString.replace(szToReplace,szNewStr) : szString.replace(szToReplace,szNewStr,Qt::CaseInsensitive); + bCase ? szString.replace(szToReplace, szNewStr) : szString.replace(szToReplace, szNewStr, Qt::CaseInsensitive); c->returnValue()->setString(szString); return true; } @@ -909,19 +919,19 @@ static bool str_kvs_fnc_replace(KviKvsModuleFunctionCall * c) static bool str_kvs_fnc_urlencode(KviKvsModuleFunctionCall * c) { QString szString; - unsigned int idx=0; + unsigned int idx = 0; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("string",KVS_PT_STRING,0,szString) + KVSM_PARAMETER("string", KVS_PT_STRING, 0, szString) KVSM_PARAMETERS_END(c) - const char * const toReplace[]={ + const char * const toReplace[] = { " ", "#", "$", "/", ":", "<", "=", ">", "?", "@", "[", "\\", "]", "^", "`", "{", "|", "}", 0 }; - const char * const newStr[]={ + const char * const newStr[] = { "%20", "%23", "%24", "%2F", "%3A", "%3C", "%3D", "%3E", "%3F", "%40", "%5B", "%5C", "%5D", "%5E", "%60", @@ -930,7 +940,7 @@ static bool str_kvs_fnc_urlencode(KviKvsModuleFunctionCall * c) while(toReplace[idx]) { - szString.replace(toReplace[idx],newStr[idx],Qt::CaseInsensitive); + szString.replace(toReplace[idx], newStr[idx], Qt::CaseInsensitive); idx++; } @@ -964,16 +974,18 @@ static bool str_kvs_fnc_urlencode(KviKvsModuleFunctionCall * c) */ static bool str_kvs_fnc_lefttofirst(KviKvsModuleFunctionCall * c) { - QString szString,szNewstr; + QString szString, szNewstr; bool bCase; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("string",KVS_PT_STRING,0,szString) - KVSM_PARAMETER("substring",KVS_PT_STRING,0,szNewstr) - KVSM_PARAMETER("case",KVS_PT_BOOL,KVS_PF_OPTIONAL,bCase) + KVSM_PARAMETER("string", KVS_PT_STRING, 0, szString) + KVSM_PARAMETER("substring", KVS_PT_STRING, 0, szNewstr) + KVSM_PARAMETER("case", KVS_PT_BOOL, KVS_PF_OPTIONAL, bCase) KVSM_PARAMETERS_END(c) - int idx = bCase ? szString.indexOf(szNewstr,0) : szString.indexOf(szNewstr,0,Qt::CaseInsensitive); - if(idx != -1) c->returnValue()->setString(szString.left(idx)); - else c->returnValue()->setString(szString); + int idx = bCase ? szString.indexOf(szNewstr, 0) : szString.indexOf(szNewstr, 0, Qt::CaseInsensitive); + if(idx != -1) + c->returnValue()->setString(szString.left(idx)); + else + c->returnValue()->setString(szString); return true; } @@ -1003,16 +1015,18 @@ static bool str_kvs_fnc_lefttofirst(KviKvsModuleFunctionCall * c) */ static bool str_kvs_fnc_lefttolast(KviKvsModuleFunctionCall * c) { - QString szString,szNewstr; + QString szString, szNewstr; bool bCase; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("string",KVS_PT_STRING,0,szString) - KVSM_PARAMETER("substring",KVS_PT_STRING,0,szNewstr) - KVSM_PARAMETER("case",KVS_PT_BOOL,KVS_PF_OPTIONAL,bCase) + KVSM_PARAMETER("string", KVS_PT_STRING, 0, szString) + KVSM_PARAMETER("substring", KVS_PT_STRING, 0, szNewstr) + KVSM_PARAMETER("case", KVS_PT_BOOL, KVS_PF_OPTIONAL, bCase) KVSM_PARAMETERS_END(c) - int idx = bCase ? szString.lastIndexOf(szNewstr,-1) : szString.lastIndexOf(szNewstr,-1,Qt::CaseInsensitive); - if(idx != -1) c->returnValue()->setString(szString.left(idx)); - else c->returnValue()->setString(szString); + int idx = bCase ? szString.lastIndexOf(szNewstr, -1) : szString.lastIndexOf(szNewstr, -1, Qt::CaseInsensitive); + if(idx != -1) + c->returnValue()->setString(szString.left(idx)); + else + c->returnValue()->setString(szString); return true; } @@ -1042,16 +1056,18 @@ static bool str_kvs_fnc_lefttolast(KviKvsModuleFunctionCall * c) */ static bool str_kvs_fnc_rightfromfirst(KviKvsModuleFunctionCall * c) { - QString szString,szNewstr; + QString szString, szNewstr; bool bCase; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("string",KVS_PT_STRING,0,szString) - KVSM_PARAMETER("substring",KVS_PT_STRING,0,szNewstr) - KVSM_PARAMETER("case",KVS_PT_BOOL,KVS_PF_OPTIONAL,bCase) + KVSM_PARAMETER("string", KVS_PT_STRING, 0, szString) + KVSM_PARAMETER("substring", KVS_PT_STRING, 0, szNewstr) + KVSM_PARAMETER("case", KVS_PT_BOOL, KVS_PF_OPTIONAL, bCase) KVSM_PARAMETERS_END(c) - int idx = bCase ? szString.indexOf(szNewstr,0) : szString.indexOf(szNewstr,0,Qt::CaseInsensitive); - if(idx != -1) c->returnValue()->setString(szString.right(szString.length()-(idx+szNewstr.length()))); - else c->returnValue()->setString(""); + int idx = bCase ? szString.indexOf(szNewstr, 0) : szString.indexOf(szNewstr, 0, Qt::CaseInsensitive); + if(idx != -1) + c->returnValue()->setString(szString.right(szString.length() - (idx + szNewstr.length()))); + else + c->returnValue()->setString(""); return true; } @@ -1081,16 +1097,18 @@ static bool str_kvs_fnc_rightfromfirst(KviKvsModuleFunctionCall * c) */ static bool str_kvs_fnc_rightfromlast(KviKvsModuleFunctionCall * c) { - QString szString,szNewstr; + QString szString, szNewstr; bool bCase; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("string",KVS_PT_STRING,0,szString) - KVSM_PARAMETER("substring",KVS_PT_STRING,0,szNewstr) - KVSM_PARAMETER("case",KVS_PT_BOOL,KVS_PF_OPTIONAL,bCase) + KVSM_PARAMETER("string", KVS_PT_STRING, 0, szString) + KVSM_PARAMETER("substring", KVS_PT_STRING, 0, szNewstr) + KVSM_PARAMETER("case", KVS_PT_BOOL, KVS_PF_OPTIONAL, bCase) KVSM_PARAMETERS_END(c) - int idx = bCase ? szString.lastIndexOf(szNewstr,-1) : szString.lastIndexOf(szNewstr,-1,Qt::CaseInsensitive); - if(idx != -1) c->returnValue()->setString(szString.right(szString.length()-(idx+szNewstr.length()))); - else c->returnValue()->setString(""); + int idx = bCase ? szString.lastIndexOf(szNewstr, -1) : szString.lastIndexOf(szNewstr, -1, Qt::CaseInsensitive); + if(idx != -1) + c->returnValue()->setString(szString.right(szString.length() - (idx + szNewstr.length()))); + else + c->returnValue()->setString(""); return true; } @@ -1129,14 +1147,14 @@ static bool str_kvs_fnc_match(KviKvsModuleFunctionCall * c) QString szWildcard, szString, szFlags; bool bCase, bIs; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("wildcard",KVS_PT_NONEMPTYSTRING,0,szWildcard) - KVSM_PARAMETER("string",KVS_PT_STRING,0,szString) - KVSM_PARAMETER("flags",KVS_PT_STRING,KVS_PF_OPTIONAL,szFlags) - KVSM_PARAMETER("case",KVS_PT_BOOL,KVS_PF_OPTIONAL,bCase) + KVSM_PARAMETER("wildcard", KVS_PT_NONEMPTYSTRING, 0, szWildcard) + KVSM_PARAMETER("string", KVS_PT_STRING, 0, szString) + KVSM_PARAMETER("flags", KVS_PT_STRING, KVS_PF_OPTIONAL, szFlags) + KVSM_PARAMETER("case", KVS_PT_BOOL, KVS_PF_OPTIONAL, bCase) KVSM_PARAMETERS_END(c) bool bRegExp = (szFlags.indexOf(QChar('r')) != -1) || (szFlags.indexOf(QChar('R')) != -1); bool bExact = (szFlags.indexOf(QChar('e')) != -1) || (szFlags.indexOf(QChar('E')) != -1); - bIs = bCase ? KviQString::matchString(szWildcard,szString,bRegExp,bExact,true) : KviQString::matchString(szWildcard,szString,bRegExp,bExact); + bIs = bCase ? KviQString::matchString(szWildcard, szString, bRegExp, bExact, true) : KviQString::matchString(szWildcard, szString, bRegExp, bExact); c->returnValue()->setBoolean(bIs); return true; } @@ -1173,36 +1191,35 @@ static bool str_kvs_fnc_word(KviKvsModuleFunctionCall * c) QString szString; kvs_int_t iOccurence; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("occurrence",KVS_PT_INT,0,iOccurence) - KVSM_PARAMETER("string",KVS_PT_STRING,0,szString) + KVSM_PARAMETER("occurrence", KVS_PT_INT, 0, iOccurence) + KVSM_PARAMETER("string", KVS_PT_STRING, 0, szString) KVSM_PARAMETERS_END(c) int idx = 0; int cnt = 0; int begin; int len = szString.length(); - while (idxreturnValue()->setString(szString.mid(begin,idx-begin)); + c->returnValue()->setString(szString.mid(begin, idx - begin)); return true; } - cnt ++; + cnt++; } return true; - } /* @@ -1236,12 +1253,12 @@ static bool str_kvs_fnc_word(KviKvsModuleFunctionCall * c) */ static bool str_kvs_fnc_token(KviKvsModuleFunctionCall * c) { - QString szString,sep; + QString szString, sep; kvs_uint_t n; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("n",KVS_PT_UINT,0,n) - KVSM_PARAMETER("separator",KVS_PT_STRING,0,sep) - KVSM_PARAMETER("string",KVS_PT_STRING,0,szString) + KVSM_PARAMETER("n", KVS_PT_UINT, 0, n) + KVSM_PARAMETER("separator", KVS_PT_STRING, 0, sep) + KVSM_PARAMETER("string", KVS_PT_STRING, 0, szString) KVSM_PARAMETERS_END(c) if(sep.isEmpty()) { @@ -1253,23 +1270,23 @@ static bool str_kvs_fnc_token(KviKvsModuleFunctionCall * c) unsigned int cnt = 0; int begin; int len = szString.length(); - while (idxreturnValue()->setString(szString.mid(begin,idx-begin)); + c->returnValue()->setString(szString.mid(begin, idx - begin)); return true; } cnt++; @@ -1298,8 +1315,8 @@ static bool str_kvs_fnc_charsum(KviKvsModuleFunctionCall * c) QString szString; bool bCaseInsensitive; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("data",KVS_PT_STRING,0,szString) - KVSM_PARAMETER("bCaseInsensitive",KVS_PT_BOOL,KVS_PF_OPTIONAL,bCaseInsensitive) + KVSM_PARAMETER("data", KVS_PT_STRING, 0, szString) + KVSM_PARAMETER("bCaseInsensitive", KVS_PT_BOOL, KVS_PF_OPTIONAL, bCaseInsensitive) KVSM_PARAMETERS_END(c) unsigned int sum = 0; int idx = 0; @@ -1311,7 +1328,9 @@ static bool str_kvs_fnc_charsum(KviKvsModuleFunctionCall * c) sum += szString[idx].toLower().unicode(); idx++; } - } else { + } + else + { while(idx < len) { sum += szString[idx].unicode(); @@ -1322,7 +1341,6 @@ static bool str_kvs_fnc_charsum(KviKvsModuleFunctionCall * c) return true; } - /* @doc: str.chop @type: @@ -1338,11 +1356,11 @@ static bool str_kvs_fnc_charsum(KviKvsModuleFunctionCall * c) */ static bool str_kvs_fnc_chop(KviKvsModuleFunctionCall * c) { - QString szString,sep; + QString szString, sep; kvs_uint_t n; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("data",KVS_PT_NONEMPTYSTRING,0,szString) - KVSM_PARAMETER("n",KVS_PT_UINT,0,n) + KVSM_PARAMETER("data", KVS_PT_NONEMPTYSTRING, 0, szString) + KVSM_PARAMETER("n", KVS_PT_UINT, 0, n) KVSM_PARAMETERS_END(c) szString.chop(n); c->returnValue()->setString(szString); @@ -1366,17 +1384,18 @@ static bool str_kvs_fnc_chop(KviKvsModuleFunctionCall * c) */ static bool str_kvs_fnc_digest(KviKvsModuleFunctionCall * c) { - QString szString,szType,szResult; + QString szString, szType, szResult; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("data",KVS_PT_NONEMPTYSTRING,0,szString) - KVSM_PARAMETER("algorithm",KVS_PT_NONEMPTYSTRING,KVS_PF_OPTIONAL,szType) + KVSM_PARAMETER("data", KVS_PT_NONEMPTYSTRING, 0, szString) + KVSM_PARAMETER("algorithm", KVS_PT_NONEMPTYSTRING, KVS_PF_OPTIONAL, szType) KVSM_PARAMETERS_END(c) #if defined(COMPILE_SSL_SUPPORT) - if(szType.isEmpty()) szType = "md5"; + if(szType.isEmpty()) + szType = "md5"; EVP_MD_CTX mdctx; - const EVP_MD *md; + const EVP_MD * md; unsigned char md_value[EVP_MAX_MD_SIZE]; unsigned int md_len, i; char buff[3]; @@ -1385,7 +1404,7 @@ static bool str_kvs_fnc_digest(KviKvsModuleFunctionCall * c) md = EVP_get_digestbyname(szType.toUtf8().data()); if(!md) { - c->warning(__tr2qs("%Q algorithm is not supported"),&szType); + c->warning(__tr2qs("%Q algorithm is not supported"), &szType); return true; } @@ -1398,9 +1417,9 @@ static bool str_kvs_fnc_digest(KviKvsModuleFunctionCall * c) for(i = 0; i < md_len; i++) { #if defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW) - _snprintf(buff,3,"%02x",md_value[i]); + _snprintf(buff, 3, "%02x", md_value[i]); #else - snprintf(buff,3,"%02x",md_value[i]); + snprintf(buff, 3, "%02x", md_value[i]); #endif szResult.append(buff); } @@ -1411,13 +1430,17 @@ static bool str_kvs_fnc_digest(KviKvsModuleFunctionCall * c) if(szType.toLower() == "sha1") { qAlgo = QCryptographicHash::Sha1; - } else if(szType.toLower() == "md4") + } + else if(szType.toLower() == "md4") { qAlgo = QCryptographicHash::Md4; - } else if(szType.toLower() == "md5") + } + else if(szType.toLower() == "md5") { qAlgo = QCryptographicHash::Md5; - } else { + } + else + { c->warning(__tr2qs("KVIrc is compiled without Crypto++ or SSL support. $str.digest supports only MD4, MD5 and SHA1.")); return true; } @@ -1451,13 +1474,13 @@ static bool str_kvs_fnc_join(KviKvsModuleFunctionCall * c) KviKvsArrayCast ac; QString szFlags; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("separator",KVS_PT_STRING,0,szSep) - KVSM_PARAMETER("data",KVS_PT_ARRAYCAST,0,ac) - KVSM_PARAMETER("flags",KVS_PT_STRING,KVS_PF_OPTIONAL,szFlags) + KVSM_PARAMETER("separator", KVS_PT_STRING, 0, szSep) + KVSM_PARAMETER("data", KVS_PT_ARRAYCAST, 0, ac) + KVSM_PARAMETER("flags", KVS_PT_STRING, KVS_PF_OPTIONAL, szFlags) KVSM_PARAMETERS_END(c) QString szRet; - bool bSkipEmpty = szFlags.indexOf('n',0,Qt::CaseInsensitive) != -1; + bool bSkipEmpty = szFlags.indexOf('n', 0, Qt::CaseInsensitive) != -1; bool bFirst = true; @@ -1476,17 +1499,23 @@ static bool str_kvs_fnc_join(KviKvsModuleFunctionCall * c) { szRet = tmp; bFirst = false; - } else { + } + else + { szRet += szSep; szRet += tmp; } - } else { + } + else + { if(!bSkipEmpty) { if(bFirst) { bFirst = false; - } else { + } + else + { szRet += szSep; } } @@ -1538,13 +1567,13 @@ static bool str_kvs_fnc_join(KviKvsModuleFunctionCall * c) static bool str_kvs_fnc_grep(KviKvsModuleFunctionCall * c) { KviKvsArrayCast ac; - QString szMatch,szFlags; + QString szMatch, szFlags; kvs_int_t iOffset; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("match",KVS_PT_STRING,0,szMatch) - KVSM_PARAMETER("strings",KVS_PT_ARRAYCAST,0,ac) - KVSM_PARAMETER("flags",KVS_PT_STRING,KVS_PF_OPTIONAL,szFlags) - KVSM_PARAMETER("offset",KVS_PT_INTEGER,KVS_PF_OPTIONAL,iOffset) + KVSM_PARAMETER("match", KVS_PT_STRING, 0, szMatch) + KVSM_PARAMETER("strings", KVS_PT_ARRAYCAST, 0, ac) + KVSM_PARAMETER("flags", KVS_PT_STRING, KVS_PF_OPTIONAL, szFlags) + KVSM_PARAMETER("offset", KVS_PT_INTEGER, KVS_PF_OPTIONAL, iOffset) KVSM_PARAMETERS_END(c) KviKvsArray * n = new KviKvsArray(); @@ -1552,15 +1581,15 @@ static bool str_kvs_fnc_grep(KviKvsModuleFunctionCall * c) KviKvsArray * a = ac.array(); - bool bCaseSensitive = szFlags.indexOf('s',0,Qt::CaseInsensitive) != -1; - bool bRegexp = szFlags.indexOf('r',0,Qt::CaseInsensitive) != -1; - bool bWild = szFlags.indexOf('w',0,Qt::CaseInsensitive) != -1; + bool bCaseSensitive = szFlags.indexOf('s', 0, Qt::CaseInsensitive) != -1; + bool bRegexp = szFlags.indexOf('r', 0, Qt::CaseInsensitive) != -1; + bool bWild = szFlags.indexOf('w', 0, Qt::CaseInsensitive) != -1; // FIXME: The sub pattern matching does not belong to grep. // FIXME: DO NOT DOCUMENT FLAGS p and x (they should be removed) // 2015.08.24: Left for compatibility: remove in some years :) - bool bSubPatterns = szFlags.indexOf('p',0,Qt::CaseInsensitive) != -1; - bool bExcludeCompleteMatch = szFlags.indexOf('x',0,Qt::CaseInsensitive) != -1; + bool bSubPatterns = szFlags.indexOf('p', 0, Qt::CaseInsensitive) != -1; + bool bExcludeCompleteMatch = szFlags.indexOf('x', 0, Qt::CaseInsensitive) != -1; // 2015.08.24: End of "left for compatibility": remove in some years :) int idx = 0; @@ -1569,7 +1598,7 @@ static bool str_kvs_fnc_grep(KviKvsModuleFunctionCall * c) int i = 0; if(bRegexp || bWild) { - QRegExp re(szMatch,bCaseSensitive ? Qt::CaseSensitive : Qt::CaseInsensitive,bRegexp ? QRegExp::RegExp : QRegExp::Wildcard); + QRegExp re(szMatch, bCaseSensitive ? Qt::CaseSensitive : Qt::CaseInsensitive, bRegexp ? QRegExp::RegExp : QRegExp::Wildcard); while(idx < cnt) { KviKvsVariant * v = a->at(idx); @@ -1577,38 +1606,44 @@ static bool str_kvs_fnc_grep(KviKvsModuleFunctionCall * c) { QString sz; v->asString(sz); - int index=re.indexIn(sz,iOffset); - if( index != -1) + int index = re.indexIn(sz, iOffset); + if(index != -1) { // FIXME: The sub pattern matching does not belong to grep. // FIXME: DO NOT DOCUMENT FLAGS p and x (they should be removed) // 2015.08.24: Left for compatibility: remove in some years :) if(bSubPatterns) { - int start=0; - if (cnt==1){ - start=1; - n->set(i,new KviKvsVariant((kvs_int_t) (index+re.matchedLength()))); + int start = 0; + if(cnt == 1) + { + start = 1; + n->set(i, new KviKvsVariant((kvs_int_t)(index + re.matchedLength()))); i++; } - if (bExcludeCompleteMatch) start=1; - for (int j = start; j < re.capturedTexts().size(); ++j) + if(bExcludeCompleteMatch) + start = 1; + for(int j = start; j < re.capturedTexts().size(); ++j) { - n->set(i,new KviKvsVariant(re.capturedTexts().at(j))); + n->set(i, new KviKvsVariant(re.capturedTexts().at(j))); i++; } - } else { - // 2015.08.24: End of "left for compatibility": remove in some years :) - n->set(i,new KviKvsVariant(sz)); + } + else + { + // 2015.08.24: End of "left for compatibility": remove in some years :) + n->set(i, new KviKvsVariant(sz)); i++; - // 2015.08.24: Left for compatibility: remove in some years :) + // 2015.08.24: Left for compatibility: remove in some years :) } // 2015.08.24: End of "left for compatibility": remove in some years :) } } idx++; } - } else { + } + else + { while(idx < cnt) { KviKvsVariant * v = a->at(idx); @@ -1616,9 +1651,9 @@ static bool str_kvs_fnc_grep(KviKvsModuleFunctionCall * c) { QString sz; v->asString(sz); - if(sz.indexOf(szMatch,0,bCaseSensitive?Qt::CaseSensitive:Qt::CaseInsensitive) != -1) + if(sz.indexOf(szMatch, 0, bCaseSensitive ? Qt::CaseSensitive : Qt::CaseInsensitive) != -1) { - n->set(i,new KviKvsVariant(sz)); + n->set(i, new KviKvsVariant(sz)); i++; } } @@ -1678,32 +1713,34 @@ static bool str_kvs_fnc_grep(KviKvsModuleFunctionCall * c) */ static bool str_kvs_fnc_split(KviKvsModuleFunctionCall * c) { - QString szSep,szStr,szFla; + QString szSep, szStr, szFla; kvs_int_t iMaxItems; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("separator",KVS_PT_STRING,0,szSep) - KVSM_PARAMETER("string",KVS_PT_STRING,0,szStr) - KVSM_PARAMETER("flags",KVS_PT_STRING,KVS_PF_OPTIONAL,szFla) - KVSM_PARAMETER("maxitems",KVS_PT_INTEGER,KVS_PF_OPTIONAL,iMaxItems) + KVSM_PARAMETER("separator", KVS_PT_STRING, 0, szSep) + KVSM_PARAMETER("string", KVS_PT_STRING, 0, szStr) + KVSM_PARAMETER("flags", KVS_PT_STRING, KVS_PF_OPTIONAL, szFla) + KVSM_PARAMETER("maxitems", KVS_PT_INTEGER, KVS_PF_OPTIONAL, iMaxItems) KVSM_PARAMETERS_END(c) - if(c->params()->count() < 4)iMaxItems = -1; + if(c->params()->count() < 4) + iMaxItems = -1; KviKvsArray * a = new KviKvsArray(); c->returnValue()->setArray(a); if(szSep.isEmpty()) { - a->set(0,new KviKvsVariant(szStr)); + a->set(0, new KviKvsVariant(szStr)); return true; } - if(iMaxItems == 0)return true; + if(iMaxItems == 0) + return true; - bool bWild = szFla.indexOf('w',0,Qt::CaseInsensitive) != -1; - bool bContainsR = szFla.indexOf('r',0,Qt::CaseInsensitive) != -1; - bool bCaseSensitive = szFla.indexOf('s',0,Qt::CaseInsensitive) != -1; - bool bNoEmpty = szFla.indexOf('n',0,Qt::CaseInsensitive) != -1; + bool bWild = szFla.indexOf('w', 0, Qt::CaseInsensitive) != -1; + bool bContainsR = szFla.indexOf('r', 0, Qt::CaseInsensitive) != -1; + bool bCaseSensitive = szFla.indexOf('s', 0, Qt::CaseInsensitive) != -1; + bool bNoEmpty = szFla.indexOf('n', 0, Qt::CaseInsensitive) != -1; int id = 0; @@ -1713,26 +1750,29 @@ static bool str_kvs_fnc_split(KviKvsModuleFunctionCall * c) if(bContainsR || bWild) { - QRegExp re(szSep,bCaseSensitive?Qt::CaseSensitive:Qt::CaseInsensitive,bWild?QRegExp::Wildcard:QRegExp::RegExp); + QRegExp re(szSep, bCaseSensitive ? Qt::CaseSensitive : Qt::CaseInsensitive, bWild ? QRegExp::Wildcard : QRegExp::RegExp); - while((iMatch != -1) && (iMatch < iStrLen) && ((id < (iMaxItems-1)) || (iMaxItems < 0))) + while((iMatch != -1) && (iMatch < iStrLen) && ((id < (iMaxItems - 1)) || (iMaxItems < 0))) { - iMatch = re.indexIn(szStr,iBegin); + iMatch = re.indexIn(szStr, iBegin); if(iMatch != -1) { int len = re.matchedLength(); - if((len == 0) && (iBegin == iMatch))iMatch++; // safety measure for empty string matching + if((len == 0) && (iBegin == iMatch)) + iMatch++; // safety measure for empty string matching - QString tmp = szStr.mid(iBegin,iMatch - iBegin); + QString tmp = szStr.mid(iBegin, iMatch - iBegin); if(bNoEmpty) { if(!tmp.isEmpty()) { - a->set(id,new KviKvsVariant(tmp)); + a->set(id, new KviKvsVariant(tmp)); id++; } - } else { - a->set(id,new KviKvsVariant(tmp)); + } + else + { + a->set(id, new KviKvsVariant(tmp)); id++; } @@ -1740,22 +1780,26 @@ static bool str_kvs_fnc_split(KviKvsModuleFunctionCall * c) iBegin = iMatch; } } - } else { - while((iMatch != -1) && (iMatch < iStrLen) && ((id < (iMaxItems-1)) || (iMaxItems < 0))) + } + else + { + while((iMatch != -1) && (iMatch < iStrLen) && ((id < (iMaxItems - 1)) || (iMaxItems < 0))) { - iMatch = szStr.indexOf(szSep,iBegin,bCaseSensitive?Qt::CaseSensitive:Qt::CaseInsensitive); + iMatch = szStr.indexOf(szSep, iBegin, bCaseSensitive ? Qt::CaseSensitive : Qt::CaseInsensitive); if(iMatch != -1) { - QString tmp = szStr.mid(iBegin,iMatch - iBegin); + QString tmp = szStr.mid(iBegin, iMatch - iBegin); if(bNoEmpty) { if(!tmp.isEmpty()) { - a->set(id,new KviKvsVariant(tmp)); + a->set(id, new KviKvsVariant(tmp)); id++; } - } else { - a->set(id,new KviKvsVariant(tmp)); + } + else + { + a->set(id, new KviKvsVariant(tmp)); id++; } @@ -1767,17 +1811,21 @@ static bool str_kvs_fnc_split(KviKvsModuleFunctionCall * c) if(iBegin < iStrLen) { - QString tmpx = szStr.right(iStrLen-iBegin); + QString tmpx = szStr.right(iStrLen - iBegin); if(bNoEmpty) { if(!tmpx.isEmpty()) - a->set(id,new KviKvsVariant(tmpx)); - } else { - a->set(id,new KviKvsVariant(tmpx)); + a->set(id, new KviKvsVariant(tmpx)); } - } else { + else + { + a->set(id, new KviKvsVariant(tmpx)); + } + } + else + { if(!bNoEmpty) - a->set(id,new KviKvsVariant(QString())); // empty string at the end + a->set(id, new KviKvsVariant(QString())); // empty string at the end } return true; @@ -1831,8 +1879,8 @@ static bool str_kvs_fnc_printf(KviKvsModuleFunctionCall * c) QString szFormat; KviKvsVariantList vArgs; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("format",KVS_PT_STRING,0,szFormat) - KVSM_PARAMETER("vArgs",KVS_PT_VARIANTLIST,0,vArgs) + KVSM_PARAMETER("format", KVS_PT_STRING, 0, szFormat) + KVSM_PARAMETER("vArgs", KVS_PT_VARIANTLIST, 0, vArgs) KVSM_PARAMETERS_END(c) QString s; @@ -1851,7 +1899,7 @@ static bool str_kvs_fnc_printf(KviKvsModuleFunctionCall * c) //9999999999999999999999999999999\0 char numberBuffer[1024]; - char *pNumBuf; + char * pNumBuf; kvs_uint_t tmp; kvs_int_t argValue; kvs_uint_t argUValue; @@ -1859,27 +1907,28 @@ static bool str_kvs_fnc_printf(KviKvsModuleFunctionCall * c) QChar * p = buffer; - #define INCREMENT_MEM \ - { \ - allocsize += MEMINCREMENT; \ - buffer = (QChar *)KviMemory::reallocate(buffer,sizeof(QChar) * allocsize); \ - p = buffer + reallen; \ - } +#define INCREMENT_MEM \ + { \ + allocsize += MEMINCREMENT; \ + buffer = (QChar *)KviMemory::reallocate(buffer, sizeof(QChar) * allocsize); \ + p = buffer + reallen; \ + } - #define INCREMENT_MEM_BY(numchars) \ - { \ - allocsize += numchars + MEMINCREMENT; \ - buffer = (QChar *)KviMemory::reallocate(buffer,sizeof(QChar) * allocsize); \ - p = buffer + reallen; \ - } +#define INCREMENT_MEM_BY(numchars) \ + { \ + allocsize += numchars + MEMINCREMENT; \ + buffer = (QChar *)KviMemory::reallocate(buffer, sizeof(QChar) * allocsize); \ + p = buffer + reallen; \ + } KviKvsVariant * pVar; pVar = vArgs.first(); - for(; fmt->unicode() ; ++fmt) + for(; fmt->unicode(); ++fmt) { - if(reallen == allocsize)INCREMENT_MEM + if(reallen == allocsize) + INCREMENT_MEM //copy up to a '?' if(fmt->unicode() != '?') @@ -1895,12 +1944,16 @@ static bool str_kvs_fnc_printf(KviKvsModuleFunctionCall * c) case 's': { QString sz; - if(pVar)pVar->asString(sz); - if(sz.isEmpty())continue; + if(pVar) + pVar->asString(sz); + if(sz.isEmpty()) + continue; int len = sz.length(); - if((allocsize - reallen) < len)INCREMENT_MEM_BY(len) + if((allocsize - reallen) < len) + INCREMENT_MEM_BY(len) const QChar * ch = sz.unicode(); - while(len--)*p++ = *ch++; + while(len--) + *p++ = *ch++; reallen += sz.length(); pVar = vArgs.next(); continue; @@ -1914,7 +1967,9 @@ static bool str_kvs_fnc_printf(KviKvsModuleFunctionCall * c) c->warning(__tr2qs("Invalid argument for ?d escape sequence, 0 assumed")); argValue = 0; } - } else { + } + else + { c->warning(__tr2qs("Missing argument for ?d escape sequence, 0 assumed")); argValue = 0; } @@ -1925,18 +1980,24 @@ static bool str_kvs_fnc_printf(KviKvsModuleFunctionCall * c) reallen++; argValue = -argValue; //need to have it positive // most negative integer exception (avoid completely senseless (non digit) responses) - if(argValue < 0)argValue = 0; //we get -0 here + if(argValue < 0) + argValue = 0; //we get -0 here } //write the number in a temporary buffer pNumBuf = numberBuffer; - do { + do + { tmp = argValue / 10; *pNumBuf++ = argValue - (tmp * 10) + '0'; } while((argValue = tmp)); //copy now.... argUValue = pNumBuf - numberBuffer; //length of the number string - if((allocsize - reallen) < (int)argUValue)INCREMENT_MEM_BY(argUValue) - do { *p++ = QChar(*--pNumBuf); } while(pNumBuf != numberBuffer); + if((allocsize - reallen) < (int)argUValue) + INCREMENT_MEM_BY(argUValue) + do + { + *p++ = QChar(*--pNumBuf); + } while(pNumBuf != numberBuffer); reallen += argUValue; pVar = vArgs.next(); continue; @@ -1950,21 +2011,28 @@ static bool str_kvs_fnc_printf(KviKvsModuleFunctionCall * c) c->warning(__tr2qs("Invalid argument for ?u escape sequence, 0 assumed")); argValue = 0; } - } else { + } + else + { c->warning(__tr2qs("Missing argument for ?u escape sequence, 0 assumed")); argValue = 0; } argUValue = (kvs_uint_t)argValue; //write the number in a temporary buffer pNumBuf = numberBuffer; - do { + do + { tmp = argUValue / 10; *pNumBuf++ = argUValue - (tmp * 10) + '0'; } while((argUValue = tmp)); //copy now.... argValue = pNumBuf - numberBuffer; //length of the number string - if((allocsize - reallen) < argValue)INCREMENT_MEM_BY(argValue) - do { *p++ = *--pNumBuf; } while(pNumBuf != numberBuffer); + if((allocsize - reallen) < argValue) + INCREMENT_MEM_BY(argValue) + do + { + *p++ = *--pNumBuf; + } while(pNumBuf != numberBuffer); reallen += argValue; pVar = vArgs.next(); continue; @@ -1972,7 +2040,7 @@ static bool str_kvs_fnc_printf(KviKvsModuleFunctionCall * c) case 'h': case 'x': // hexadecimal unsigned integer { - static char hexsmalldigits[]="0123456789abcdef"; + static char hexsmalldigits[] = "0123456789abcdef"; if(pVar) { @@ -1981,7 +2049,9 @@ static bool str_kvs_fnc_printf(KviKvsModuleFunctionCall * c) c->warning(__tr2qs("Invalid argument for ?x escape sequence, 0 assumed")); argValue = 0; } - } else { + } + else + { c->warning(__tr2qs("Missing argument for ?x escape sequence, 0 assumed")); argValue = 0; } @@ -1989,14 +2059,19 @@ static bool str_kvs_fnc_printf(KviKvsModuleFunctionCall * c) //write the number in a temporary buffer pNumBuf = numberBuffer; - do { + do + { tmp = argUValue / 16; *pNumBuf++ = hexsmalldigits[argUValue - (tmp * 16)]; } while((argUValue = tmp)); //copy now.... argValue = pNumBuf - numberBuffer; //length of the number string - if((allocsize - reallen) < argValue)INCREMENT_MEM_BY(argValue) - do { *p++ = *--pNumBuf; } while(pNumBuf != numberBuffer); + if((allocsize - reallen) < argValue) + INCREMENT_MEM_BY(argValue) + do + { + *p++ = *--pNumBuf; + } while(pNumBuf != numberBuffer); reallen += argValue; pVar = vArgs.next(); continue; @@ -2004,7 +2079,7 @@ static bool str_kvs_fnc_printf(KviKvsModuleFunctionCall * c) case 'H': case 'X': // hexadecimal unsigned integer { - static char hexbigdigits[]="0123456789ABCDEF"; + static char hexbigdigits[] = "0123456789ABCDEF"; if(pVar) { if(!pVar->asInteger(argValue)) @@ -2012,21 +2087,28 @@ static bool str_kvs_fnc_printf(KviKvsModuleFunctionCall * c) c->warning(__tr2qs("Invalid argument for ?X escape sequence, 0 assumed")); argValue = 0; } - } else { + } + else + { c->warning(__tr2qs("Missing argument for ?X escape sequence, 0 assumed")); argValue = 0; } argUValue = (kvs_uint_t)argValue; //write the number in a temporary buffer pNumBuf = numberBuffer; - do { + do + { tmp = argUValue / 16; *pNumBuf++ = hexbigdigits[argUValue - (tmp * 16)]; } while((argUValue = tmp)); //copy now.... argValue = pNumBuf - numberBuffer; //length of the number string - if((allocsize - reallen) < argValue)INCREMENT_MEM_BY(argValue) - do { *p++ = *--pNumBuf; } while(pNumBuf != numberBuffer); + if((allocsize - reallen) < argValue) + INCREMENT_MEM_BY(argValue) + do + { + *p++ = *--pNumBuf; + } while(pNumBuf != numberBuffer); reallen += argValue; pVar = vArgs.next(); continue; @@ -2035,7 +2117,8 @@ static bool str_kvs_fnc_printf(KviKvsModuleFunctionCall * c) { if(fmt->unicode()) { - if(reallen == allocsize)INCREMENT_MEM + if(reallen == allocsize) + INCREMENT_MEM *p++ = *fmt; reallen++; } @@ -2068,7 +2151,7 @@ static bool str_kvs_fnc_printf(KviKvsModuleFunctionCall * c) } fmtbuffer[idx] = fmt->unicode(); - fmtbuffer[idx+1] = 0; + fmtbuffer[idx + 1] = 0; if(pVar) { @@ -2077,7 +2160,9 @@ static bool str_kvs_fnc_printf(KviKvsModuleFunctionCall * c) c->warning(__tr2qs("Invalid argument for a floating point escape sequence, 0.0 assumed")); argRValue = 0.0; } - } else { + } + else + { c->warning(__tr2qs("Missing argument for a floating point escape sequence, 0.0 assumed")); argRValue = 0; } @@ -2088,29 +2173,34 @@ static bool str_kvs_fnc_printf(KviKvsModuleFunctionCall * c) case 'F': case 'f': #if defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW) - _snprintf(numberBuffer,sizeof(numberBuffer),fmtbuffer,argRValue); + _snprintf(numberBuffer, sizeof(numberBuffer), fmtbuffer, argRValue); #else - ::sprintf(numberBuffer,fmtbuffer,argRValue); + ::sprintf(numberBuffer, fmtbuffer, argRValue); #endif //copy now.... argValue = kvi_strLen(numberBuffer); - if((allocsize - reallen) < argValue)INCREMENT_MEM_BY(argValue) + if((allocsize - reallen) < argValue) + INCREMENT_MEM_BY(argValue) pNumBuf = numberBuffer; - while(*pNumBuf){ *p++ = *pNumBuf++; } + while(*pNumBuf) + { + *p++ = *pNumBuf++; + } reallen += argValue; - break; + break; default: // anything else is crap.. invalid format fmt = save; - *p++ = '?'; //write it + *p++ = '?'; //write it reallen++; if(fmt->unicode()) { - if(reallen == allocsize)INCREMENT_MEM + if(reallen == allocsize) + INCREMENT_MEM *p++ = *fmt; reallen++; } - break; + break; } pVar = vArgs.next(); continue; @@ -2118,11 +2208,12 @@ static bool str_kvs_fnc_printf(KviKvsModuleFunctionCall * c) break; default: //a normal ? followed by some char { - *p++ = '?'; //write it + *p++ = '?'; //write it reallen++; if(fmt->unicode()) { - if(reallen == allocsize)INCREMENT_MEM + if(reallen == allocsize) + INCREMENT_MEM *p++ = *fmt; reallen++; } @@ -2131,7 +2222,7 @@ static bool str_kvs_fnc_printf(KviKvsModuleFunctionCall * c) } } - s.setUnicode(buffer,reallen); + s.setUnicode(buffer, reallen); KviMemory::free(buffer); } @@ -2139,7 +2230,6 @@ static bool str_kvs_fnc_printf(KviKvsModuleFunctionCall * c) return true; } - /* @doc: str.evpSign @type: @@ -2186,9 +2276,9 @@ static bool str_kvs_fnc_evpSign(KviKvsModuleFunctionCall * c) QByteArray szCert; QByteArray szPass; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("message",KVS_PT_NONEMPTYCSTRING,0,szMessage) - KVSM_PARAMETER("certificate",KVS_PT_NONEMPTYCSTRING,KVS_PF_OPTIONAL,szCert) - KVSM_PARAMETER("password",KVS_PT_NONEMPTYCSTRING,KVS_PF_OPTIONAL,szPass) + KVSM_PARAMETER("message", KVS_PT_NONEMPTYCSTRING, 0, szMessage) + KVSM_PARAMETER("certificate", KVS_PT_NONEMPTYCSTRING, KVS_PF_OPTIONAL, szCert) + KVSM_PARAMETER("password", KVS_PT_NONEMPTYCSTRING, KVS_PF_OPTIONAL, szPass) KVSM_PARAMETERS_END(c) #if defined(COMPILE_SSL_SUPPORT) @@ -2197,7 +2287,7 @@ static bool str_kvs_fnc_evpSign(KviKvsModuleFunctionCall * c) EVP_MD_CTX md_ctx; EVP_PKEY * pKey = 0; unsigned int len = 0; - unsigned char *sig = 0; + unsigned char * sig = 0; if(szCert.isEmpty()) { @@ -2209,10 +2299,10 @@ static bool str_kvs_fnc_evpSign(KviKvsModuleFunctionCall * c) return true; } - FILE * f = fopen(KVI_OPTION_STRING(KviOption_stringSSLPrivateKeyPath).toUtf8().data(),"r"); + FILE * f = fopen(KVI_OPTION_STRING(KviOption_stringSSLPrivateKeyPath).toUtf8().data(), "r"); if(!f) { - c->warning(__tr2qs("File I/O error while trying to use the private key file %s"),KVI_OPTION_STRING(KviOption_stringSSLPrivateKeyPath).toUtf8().data()); + c->warning(__tr2qs("File I/O error while trying to use the private key file %s"), KVI_OPTION_STRING(KviOption_stringSSLPrivateKeyPath).toUtf8().data()); c->returnValue()->setString(""); return true; } @@ -2224,14 +2314,16 @@ static bool str_kvs_fnc_evpSign(KviKvsModuleFunctionCall * c) if(!pKey) { - c->warning(__tr2qs("Can't read private key while trying to use the default private key certificate %s"),KVI_OPTION_STRING(KviOption_stringSSLPrivateKeyPath).toUtf8().data()); + c->warning(__tr2qs("Can't read private key while trying to use the default private key certificate %s"), KVI_OPTION_STRING(KviOption_stringSSLPrivateKeyPath).toUtf8().data()); c->returnValue()->setString(""); return true; } - } else { + } + else + { // get from parameter (with optional password) - BIO *in; - in = BIO_new_mem_buf((unsigned char*)szCert.data(), szCert.size()); + BIO * in; + in = BIO_new_mem_buf((unsigned char *)szCert.data(), szCert.size()); PEM_read_bio_PrivateKey(in, &pKey, NULL, szPass.data()); BIO_free(in); @@ -2244,11 +2336,11 @@ static bool str_kvs_fnc_evpSign(KviKvsModuleFunctionCall * c) } len = EVP_PKEY_size(pKey); - sig = (unsigned char*)KviMemory::allocate(len*sizeof(char)); + sig = (unsigned char *)KviMemory::allocate(len * sizeof(char)); EVP_SignInit(&md_ctx, EVP_sha1()); EVP_SignUpdate(&md_ctx, (unsigned char *)szMessage.data(), szMessage.length()); - if (EVP_SignFinal (&md_ctx, sig, &len, pKey)) + if(EVP_SignFinal(&md_ctx, sig, &len, pKey)) { QByteArray szSign((const char *)sig, len); OPENSSL_free(sig); @@ -2317,10 +2409,10 @@ static bool str_kvs_fnc_evpVerify(KviKvsModuleFunctionCall * c) QByteArray szPass; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("message",KVS_PT_NONEMPTYCSTRING,0,szMessage) - KVSM_PARAMETER("signature",KVS_PT_NONEMPTYCSTRING,0,szSignB64) - KVSM_PARAMETER("certificate",KVS_PT_NONEMPTYCSTRING,KVS_PF_OPTIONAL,szCert) - KVSM_PARAMETER("password",KVS_PT_NONEMPTYCSTRING,KVS_PF_OPTIONAL,szPass) + KVSM_PARAMETER("message", KVS_PT_NONEMPTYCSTRING, 0, szMessage) + KVSM_PARAMETER("signature", KVS_PT_NONEMPTYCSTRING, 0, szSignB64) + KVSM_PARAMETER("certificate", KVS_PT_NONEMPTYCSTRING, KVS_PF_OPTIONAL, szCert) + KVSM_PARAMETER("password", KVS_PT_NONEMPTYCSTRING, KVS_PF_OPTIONAL, szPass) KVSM_PARAMETERS_END(c) #if defined(COMPILE_SSL_SUPPORT) @@ -2330,8 +2422,8 @@ static bool str_kvs_fnc_evpVerify(KviKvsModuleFunctionCall * c) const char * message = szMessage.data(); EVP_MD_CTX md_ctx; - EVP_PKEY *pKey = 0; - X509 *cert = 0; + EVP_PKEY * pKey = 0; + X509 * cert = 0; int err = -1; if(szCert.isEmpty()) @@ -2344,10 +2436,10 @@ static bool str_kvs_fnc_evpVerify(KviKvsModuleFunctionCall * c) return true; } - FILE * f = fopen(KVI_OPTION_STRING(KviOption_stringSSLCertificatePath).toUtf8().data(),"r"); + FILE * f = fopen(KVI_OPTION_STRING(KviOption_stringSSLCertificatePath).toUtf8().data(), "r"); if(!f) { - c->warning(__tr2qs("File I/O error while trying to use the public key file %s"),KVI_OPTION_STRING(KviOption_stringSSLCertificatePath).toUtf8().data()); + c->warning(__tr2qs("File I/O error while trying to use the public key file %s"), KVI_OPTION_STRING(KviOption_stringSSLCertificatePath).toUtf8().data()); c->returnValue()->setString(""); return true; } @@ -2359,26 +2451,30 @@ static bool str_kvs_fnc_evpVerify(KviKvsModuleFunctionCall * c) if(cert) { - pKey = (EVP_PKEY *) X509_get_pubkey(cert); + pKey = (EVP_PKEY *)X509_get_pubkey(cert); X509_free(cert); } if(!pKey) { - c->warning(__tr2qs("Can't read public key while trying to use the default public key certificate %s"),KVI_OPTION_STRING(KviOption_stringSSLCertificatePath).toUtf8().data()); + c->warning(__tr2qs("Can't read public key while trying to use the default public key certificate %s"), KVI_OPTION_STRING(KviOption_stringSSLCertificatePath).toUtf8().data()); c->returnValue()->setString(""); return true; } - } else { + } + else + { // get from parameter (with optional password) - BIO *in = BIO_new_mem_buf((unsigned char*)szCert.data(), szCert.size()); + BIO * in = BIO_new_mem_buf((unsigned char *)szCert.data(), szCert.size()); PEM_read_bio_X509(in, &cert, 0, szPass.data()); if(cert) { - pKey = (EVP_PKEY *) X509_get_pubkey(cert); + pKey = (EVP_PKEY *)X509_get_pubkey(cert); X509_free(cert); - } else { + } + else + { pKey = PEM_read_bio_PUBKEY(in, NULL, 0, szPass.data()); } @@ -2394,7 +2490,7 @@ static bool str_kvs_fnc_evpVerify(KviKvsModuleFunctionCall * c) EVP_VerifyInit(&md_ctx, EVP_sha1()); EVP_VerifyUpdate(&md_ctx, message, strlen(message)); - err = EVP_VerifyFinal(&md_ctx, (unsigned char*)szSign.data(), szSign.size(), pKey); + err = EVP_VerifyFinal(&md_ctx, (unsigned char *)szSign.data(), szSign.size(), pKey); EVP_MD_CTX_cleanup(&md_ctx); EVP_PKEY_free(pKey); switch(err) @@ -2417,61 +2513,59 @@ static bool str_kvs_fnc_evpVerify(KviKvsModuleFunctionCall * c) #endif } - - /*********************************************************************/ // Module stuff /********************************************************************/ static bool str_module_init(KviModule * m) { - KVSM_REGISTER_FUNCTION(m,"append",str_kvs_fnc_append); - KVSM_REGISTER_FUNCTION(m,"charsum",str_kvs_fnc_charsum); - KVSM_REGISTER_FUNCTION(m,"chop",str_kvs_fnc_chop); - KVSM_REGISTER_FUNCTION(m,"cmp",str_kvs_fnc_cmp); - KVSM_REGISTER_FUNCTION(m,"contains",str_kvs_fnc_contains); - KVSM_REGISTER_FUNCTION(m,"digest",str_kvs_fnc_digest); - KVSM_REGISTER_FUNCTION(m,"equal",str_kvs_fnc_equal); - KVSM_REGISTER_FUNCTION(m,"find",str_kvs_fnc_find); - KVSM_REGISTER_FUNCTION(m,"findfirst",str_kvs_fnc_findfirst); - KVSM_REGISTER_FUNCTION(m,"findlast",str_kvs_fnc_findlast); - KVSM_REGISTER_FUNCTION(m,"fromClipboard",str_kvs_fnc_fromclipboard); - KVSM_REGISTER_FUNCTION(m,"grep",str_kvs_fnc_grep); - KVSM_REGISTER_FUNCTION(m,"insert",str_kvs_fnc_insert); - KVSM_REGISTER_FUNCTION(m,"isempty",str_kvs_fnc_isempty); - KVSM_REGISTER_FUNCTION(m,"isnumber",str_kvs_fnc_isnumber); - KVSM_REGISTER_FUNCTION(m,"isunsignednumber",str_kvs_fnc_isunsignednumber); - KVSM_REGISTER_FUNCTION(m,"join",str_kvs_fnc_join); - KVSM_REGISTER_FUNCTION(m,"left",str_kvs_fnc_left); - KVSM_REGISTER_FUNCTION(m,"lefttofirst",str_kvs_fnc_lefttofirst); - KVSM_REGISTER_FUNCTION(m,"lefttolast",str_kvs_fnc_lefttolast); - KVSM_REGISTER_FUNCTION(m,"len",str_kvs_fnc_len); - KVSM_REGISTER_FUNCTION(m,"length",str_kvs_fnc_len); - KVSM_REGISTER_FUNCTION(m,"localelowcase",str_kvs_fnc_localelowcase); - KVSM_REGISTER_FUNCTION(m,"localeupcase",str_kvs_fnc_localeupcase); - KVSM_REGISTER_FUNCTION(m,"lowcase",str_kvs_fnc_lowcase); - KVSM_REGISTER_FUNCTION(m,"match",str_kvs_fnc_match); - KVSM_REGISTER_FUNCTION(m,"mid",str_kvs_fnc_mid); - KVSM_REGISTER_FUNCTION(m,"prepend",str_kvs_fnc_prepend); - KVSM_REGISTER_FUNCTION(m,"printf",str_kvs_fnc_printf); - KVSM_REGISTER_FUNCTION(m,"replace",str_kvs_fnc_replace); - KVSM_REGISTER_FUNCTION(m,"right",str_kvs_fnc_right); - KVSM_REGISTER_FUNCTION(m,"rightfromfirst",str_kvs_fnc_rightfromfirst); - KVSM_REGISTER_FUNCTION(m,"rightfromlast",str_kvs_fnc_rightfromlast); - KVSM_REGISTER_FUNCTION(m,"section",str_kvs_fnc_section); - KVSM_REGISTER_FUNCTION(m,"split",str_kvs_fnc_split); - KVSM_REGISTER_FUNCTION(m,"strip",str_kvs_fnc_strip); - KVSM_REGISTER_FUNCTION(m,"stripcolors",str_kvs_fnc_stripcolors); - KVSM_REGISTER_FUNCTION(m,"stripleft",str_kvs_fnc_stripleft); - KVSM_REGISTER_FUNCTION(m,"stripright",str_kvs_fnc_stripright); - KVSM_REGISTER_FUNCTION(m,"token",str_kvs_fnc_token); - KVSM_REGISTER_FUNCTION(m,"upcase",str_kvs_fnc_upcase); - KVSM_REGISTER_FUNCTION(m,"urlencode",str_kvs_fnc_urlencode); - KVSM_REGISTER_FUNCTION(m,"word",str_kvs_fnc_word); - KVSM_REGISTER_FUNCTION(m,"evpSign",str_kvs_fnc_evpSign); - KVSM_REGISTER_FUNCTION(m,"evpVerify",str_kvs_fnc_evpVerify); - - KVSM_REGISTER_SIMPLE_COMMAND(m,"toClipboard",str_kvs_cmd_toClipboard); + KVSM_REGISTER_FUNCTION(m, "append", str_kvs_fnc_append); + KVSM_REGISTER_FUNCTION(m, "charsum", str_kvs_fnc_charsum); + KVSM_REGISTER_FUNCTION(m, "chop", str_kvs_fnc_chop); + KVSM_REGISTER_FUNCTION(m, "cmp", str_kvs_fnc_cmp); + KVSM_REGISTER_FUNCTION(m, "contains", str_kvs_fnc_contains); + KVSM_REGISTER_FUNCTION(m, "digest", str_kvs_fnc_digest); + KVSM_REGISTER_FUNCTION(m, "equal", str_kvs_fnc_equal); + KVSM_REGISTER_FUNCTION(m, "find", str_kvs_fnc_find); + KVSM_REGISTER_FUNCTION(m, "findfirst", str_kvs_fnc_findfirst); + KVSM_REGISTER_FUNCTION(m, "findlast", str_kvs_fnc_findlast); + KVSM_REGISTER_FUNCTION(m, "fromClipboard", str_kvs_fnc_fromclipboard); + KVSM_REGISTER_FUNCTION(m, "grep", str_kvs_fnc_grep); + KVSM_REGISTER_FUNCTION(m, "insert", str_kvs_fnc_insert); + KVSM_REGISTER_FUNCTION(m, "isempty", str_kvs_fnc_isempty); + KVSM_REGISTER_FUNCTION(m, "isnumber", str_kvs_fnc_isnumber); + KVSM_REGISTER_FUNCTION(m, "isunsignednumber", str_kvs_fnc_isunsignednumber); + KVSM_REGISTER_FUNCTION(m, "join", str_kvs_fnc_join); + KVSM_REGISTER_FUNCTION(m, "left", str_kvs_fnc_left); + KVSM_REGISTER_FUNCTION(m, "lefttofirst", str_kvs_fnc_lefttofirst); + KVSM_REGISTER_FUNCTION(m, "lefttolast", str_kvs_fnc_lefttolast); + KVSM_REGISTER_FUNCTION(m, "len", str_kvs_fnc_len); + KVSM_REGISTER_FUNCTION(m, "length", str_kvs_fnc_len); + KVSM_REGISTER_FUNCTION(m, "localelowcase", str_kvs_fnc_localelowcase); + KVSM_REGISTER_FUNCTION(m, "localeupcase", str_kvs_fnc_localeupcase); + KVSM_REGISTER_FUNCTION(m, "lowcase", str_kvs_fnc_lowcase); + KVSM_REGISTER_FUNCTION(m, "match", str_kvs_fnc_match); + KVSM_REGISTER_FUNCTION(m, "mid", str_kvs_fnc_mid); + KVSM_REGISTER_FUNCTION(m, "prepend", str_kvs_fnc_prepend); + KVSM_REGISTER_FUNCTION(m, "printf", str_kvs_fnc_printf); + KVSM_REGISTER_FUNCTION(m, "replace", str_kvs_fnc_replace); + KVSM_REGISTER_FUNCTION(m, "right", str_kvs_fnc_right); + KVSM_REGISTER_FUNCTION(m, "rightfromfirst", str_kvs_fnc_rightfromfirst); + KVSM_REGISTER_FUNCTION(m, "rightfromlast", str_kvs_fnc_rightfromlast); + KVSM_REGISTER_FUNCTION(m, "section", str_kvs_fnc_section); + KVSM_REGISTER_FUNCTION(m, "split", str_kvs_fnc_split); + KVSM_REGISTER_FUNCTION(m, "strip", str_kvs_fnc_strip); + KVSM_REGISTER_FUNCTION(m, "stripcolors", str_kvs_fnc_stripcolors); + KVSM_REGISTER_FUNCTION(m, "stripleft", str_kvs_fnc_stripleft); + KVSM_REGISTER_FUNCTION(m, "stripright", str_kvs_fnc_stripright); + KVSM_REGISTER_FUNCTION(m, "token", str_kvs_fnc_token); + KVSM_REGISTER_FUNCTION(m, "upcase", str_kvs_fnc_upcase); + KVSM_REGISTER_FUNCTION(m, "urlencode", str_kvs_fnc_urlencode); + KVSM_REGISTER_FUNCTION(m, "word", str_kvs_fnc_word); + KVSM_REGISTER_FUNCTION(m, "evpSign", str_kvs_fnc_evpSign); + KVSM_REGISTER_FUNCTION(m, "evpVerify", str_kvs_fnc_evpVerify); + + KVSM_REGISTER_SIMPLE_COMMAND(m, "toClipboard", str_kvs_cmd_toClipboard); return true; } @@ -2481,18 +2575,17 @@ static bool str_module_cleanup(KviModule *) } KVIRC_MODULE( - "Str", // module name - "4.0.0", // module version - "Copyright (C) 2002 Szymon Stefanek (pragma at kvirc dot net)"\ - " (C) 2002 Juanjo Alvarez (juanjux at yahoo dot es)" \ - " (C) 2005 Tonino Imbesi (grifisx at barmes dot org)" \ - " (C) 2005 Alessandro Carbone (elfonol at gmail dot com)" \ - " (C) 2009 Kai Wasserbäch (debian at carbon-project dot org)" \ - " (C) 2010 Elvio Basello (hell at hellvis69 dot netsons dot org)", // author & (C) - "Interface to the str system", - str_module_init, - 0, - 0, - str_module_cleanup, - 0 -) + "Str", // module name + "4.0.0", // module version + "Copyright (C) 2002 Szymon Stefanek (pragma at kvirc dot net)" + " (C) 2002 Juanjo Alvarez (juanjux at yahoo dot es)" + " (C) 2005 Tonino Imbesi (grifisx at barmes dot org)" + " (C) 2005 Alessandro Carbone (elfonol at gmail dot com)" + " (C) 2009 Kai Wasserbäch (debian at carbon-project dot org)" + " (C) 2010 Elvio Basello (hell at hellvis69 dot netsons dot org)", // author & (C) + "Interface to the str system", + str_module_init, + 0, + 0, + str_module_cleanup, + 0) diff --git a/src/modules/system/Plugin.cpp b/src/modules/system/Plugin.cpp index fd5fc2fdc..29c5db05b 100644 --- a/src/modules/system/Plugin.cpp +++ b/src/modules/system/Plugin.cpp @@ -104,7 +104,7 @@ [/example] */ -Plugin::Plugin(QLibrary * pLibrary, const QString& name) +Plugin::Plugin(QLibrary * pLibrary, const QString & name) { m_pLibrary = pLibrary; m_szName = name; @@ -112,25 +112,26 @@ Plugin::Plugin(QLibrary * pLibrary, const QString& name) Plugin::~Plugin() { - if(m_pLibrary->isLoaded()) m_pLibrary->unload(); + if(m_pLibrary->isLoaded()) + m_pLibrary->unload(); delete m_pLibrary; } -Plugin* Plugin::load(const QString& szFileName) +Plugin * Plugin::load(const QString & szFileName) { - QLibrary* pLibrary = new QLibrary(szFileName); - if (!pLibrary->load()) + QLibrary * pLibrary = new QLibrary(szFileName); + if(!pLibrary->load()) { delete pLibrary; return 0; } - Plugin* pPlugin = new Plugin(pLibrary,KviFileUtils::extractFileName(szFileName)); + Plugin * pPlugin = new Plugin(pLibrary, KviFileUtils::extractFileName(szFileName)); plugin_load function_load; function_load = (plugin_unload)pLibrary->resolve("_load"); - if (function_load) + if(function_load) { //TODO: THREAD function_load(); @@ -143,10 +144,11 @@ bool Plugin::pfree(char * pBuffer) plugin_free function_free; function_free = (plugin_free)m_pLibrary->resolve("_free"); - if (function_free) + if(function_free) { //TODO: THREAD - if(pBuffer) function_free(pBuffer); + if(pBuffer) + function_free(pBuffer); return true; } return false; @@ -157,7 +159,7 @@ bool Plugin::unload() plugin_unload function_unload; function_unload = (plugin_unload)m_pLibrary->resolve("_unload"); - if (function_unload) + if(function_unload) { //TODO: THREAD function_unload(); @@ -172,7 +174,7 @@ bool Plugin::canunload() plugin_canunload function_canunload; function_canunload = (plugin_canunload)m_pLibrary->resolve("_canunload"); - if (function_canunload) + if(function_canunload) { //TODO: THREAD return function_canunload(); @@ -180,19 +182,22 @@ bool Plugin::canunload() return true; } -int Plugin::call(const QString& pszFunctionName, int argc, char * argv[], char ** pBuffer) +int Plugin::call(const QString & pszFunctionName, int argc, char * argv[], char ** pBuffer) { int r; plugin_function function_call; function_call = (plugin_function)m_pLibrary->resolve(pszFunctionName.toUtf8().data()); - if (!function_call) + if(!function_call) { return -1; - } else { + } + else + { //TODO: THREAD - r = function_call(argc,argv,pBuffer); + r = function_call(argc, argv, pBuffer); } - if (r < 0) r = 0; // negative numbers are for error handling. + if(r < 0) + r = 0; // negative numbers are for error handling. return r; } @@ -201,14 +206,14 @@ QString Plugin::name() const return m_szName; } -void Plugin::setName(const QString& Name) +void Plugin::setName(const QString & Name) { m_szName = Name; } PluginManager::PluginManager() { - m_pPluginDict = new KviPointerHashTable(5,false); + m_pPluginDict = new KviPointerHashTable(5, false); m_pPluginDict->setAutoDelete(false); m_bCanUnload = true; @@ -216,18 +221,18 @@ PluginManager::PluginManager() PluginManager::~PluginManager() { - delete m_pPluginDict; + delete m_pPluginDict; } -bool PluginManager::pluginCall(KviKvsModuleFunctionCall *c) +bool PluginManager::pluginCall(KviKvsModuleFunctionCall * c) { // /echo $system.call("traffic.dll",about) QString szPluginPath; //contains full path and plugin name like "c:/plugin.dll" QString szFunctionName; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("plugin_path",KVS_PT_NONEMPTYSTRING,0,szPluginPath) - KVSM_PARAMETER("function",KVS_PT_NONEMPTYSTRING,0,szFunctionName) + KVSM_PARAMETER("plugin_path", KVS_PT_NONEMPTYSTRING, 0, szPluginPath) + KVSM_PARAMETER("function", KVS_PT_NONEMPTYSTRING, 0, szFunctionName) KVSM_PARAMETERS_END(c) //Check if there is such a plugin @@ -255,40 +260,41 @@ bool PluginManager::pluginCall(KviKvsModuleFunctionCall *c) iArgc = c->parameterCount() - 2; } - if (iArgc > 0) + if(iArgc > 0) { int i = 2; QString tmp; int iSize = 0; //Calculate buffer size - while (i < (iArgc + 2) ) + while(i < (iArgc + 2)) { c->params()->at(i)->asString(tmp); - iSize += tmp.length()+1; //+1 for the \0 characters + iSize += tmp.length() + 1; //+1 for the \0 characters i++; } //Allocate buffer - ppArgv = (char**)malloc(iArgc*sizeof(char*)); - pArgvBuffer = (char*)malloc(iSize); + ppArgv = (char **)malloc(iArgc * sizeof(char *)); + pArgvBuffer = (char *)malloc(iSize); i = 2; char * x = 0; x = pArgvBuffer; - while (i < (iArgc + 2) ) + while(i < (iArgc + 2)) { - ppArgv[i-2] = x; + ppArgv[i - 2] = x; c->params()->at(i)->asString(tmp); - strcpy(x,tmp.toLocal8Bit()); + strcpy(x, tmp.toLocal8Bit()); x += tmp.length(); *x = 0; x++; i++; } - - } else { + } + else + { //Avoid using unfilled variables ppArgv = 0; pArgvBuffer = 0; @@ -300,25 +306,26 @@ bool PluginManager::pluginCall(KviKvsModuleFunctionCall *c) Plugin * plugin; plugin = getPlugin(szPluginPath); - int r = plugin->call(szFunctionName,iArgc,ppArgv,&returnBuffer); + int r = plugin->call(szFunctionName, iArgc, ppArgv, &returnBuffer); if(r == -1) { c->error(__tr2qs("This plugin doesn't export the desired function.")); return true; } - if (r > 0) + if(r > 0) { c->returnValue()->setString(QString::fromLocal8Bit(returnBuffer)); } - //Clean up - if(pArgvBuffer) free(pArgvBuffer); - if(ppArgv) free(ppArgv); + if(pArgvBuffer) + free(pArgvBuffer); + if(ppArgv) + free(ppArgv); if(returnBuffer) { - if (!plugin->pfree(returnBuffer)) + if(!plugin->pfree(returnBuffer)) { c->warning(__tr2qs("The plugin has no function to free memory. This can result in memory leaks!")); } @@ -333,7 +340,7 @@ bool PluginManager::checkUnload() Always called when system module should be unloaded Checking here if all small "modules" can be unloaded */ - KviPointerHashTableIterator it(*m_pPluginDict); + KviPointerHashTableIterator it(*m_pPluginDict); m_bCanUnload = true; @@ -343,7 +350,9 @@ bool PluginManager::checkUnload() { it.current()->unload(); m_pPluginDict->remove(it.currentKey()); - } else { + } + else + { m_bCanUnload = false; } it.moveNext(); @@ -354,7 +363,7 @@ bool PluginManager::checkUnload() void PluginManager::unloadAll() { - KviPointerHashTableIterator it(*m_pPluginDict); + KviPointerHashTableIterator it(*m_pPluginDict); while(it.current()) { @@ -364,22 +373,24 @@ void PluginManager::unloadAll() } } -bool PluginManager::findPlugin(QString& szPath) +bool PluginManager::findPlugin(QString & szPath) { QString szFileName(KviFileUtils::extractFileName(szPath)); -// szFileName.detach(); + // szFileName.detach(); if(KviFileUtils::isAbsolutePath(szPath) && KviFileUtils::fileExists(szPath)) { // Ok, return true; - } else { + } + else + { //Plugin not found in direct way. Looking in kvirc local dir - g_pApp->getGlobalKvircDirectory(szPath,KviApplication::EasyPlugins,szFileName); + g_pApp->getGlobalKvircDirectory(szPath, KviApplication::EasyPlugins, szFileName); if(!KviFileUtils::fileExists(szPath)) { //Plugin not found in kvirc local dir. Looking in kvirc global dir - g_pApp->getLocalKvircDirectory(szPath,KviApplication::EasyPlugins,szFileName); + g_pApp->getLocalKvircDirectory(szPath, KviApplication::EasyPlugins, szFileName); if(!KviFileUtils::fileExists(szPath)) { @@ -390,32 +401,34 @@ bool PluginManager::findPlugin(QString& szPath) return true; } -bool PluginManager::isPluginLoaded(const QString& pSingleName) +bool PluginManager::isPluginLoaded(const QString & pSingleName) { Plugin * p = m_pPluginDict->find(pSingleName); - if (!p) + if(!p) return false; else return true; } -bool PluginManager::loadPlugin(const QString& szPluginPath) +bool PluginManager::loadPlugin(const QString & szPluginPath) { if(isPluginLoaded(szPluginPath)) { - return getPlugin(szPluginPath)!=0; - } else { + return getPlugin(szPluginPath) != 0; + } + else + { Plugin * plugin = Plugin::load(szPluginPath); if(plugin) { - m_pPluginDict->insert(szPluginPath,plugin); + m_pPluginDict->insert(szPluginPath, plugin); return true; } } return false; } -Plugin * PluginManager::getPlugin(const QString& szPluginPath) +Plugin * PluginManager::getPlugin(const QString & szPluginPath) { Plugin * p = m_pPluginDict->find(szPluginPath); return p; diff --git a/src/modules/system/Plugin.h b/src/modules/system/Plugin.h index 749d58a70..bbf46ce12 100644 --- a/src/modules/system/Plugin.h +++ b/src/modules/system/Plugin.h @@ -29,7 +29,7 @@ #include "KviPointerHashTable.h" #include -typedef int (*plugin_function)(int argc, char* argv[], char ** buffer); +typedef int (*plugin_function)(int argc, char * argv[], char ** buffer); typedef int (*plugin_unload)(); typedef int (*plugin_canunload)(); typedef int (*plugin_load)(); @@ -39,44 +39,51 @@ class Plugin { protected: // You have to create plugin instance by calling Plugin::load() - Plugin(QLibrary * pLibrary,const QString& name); + Plugin(QLibrary * pLibrary, const QString & name); + public: ~Plugin(); + private: // shared // internal - QLibrary *m_pLibrary; - QString m_szName; + QLibrary * m_pLibrary; + QString m_szName; + public: - static Plugin* load(const QString& szFileName); + static Plugin * load(const QString & szFileName); bool pfree(char * pBuffer); bool unload(); bool canunload(); - int call(const QString& szFunctionName, int argc, char * argv[], char ** pBuffer); + int call(const QString & szFunctionName, int argc, char * argv[], char ** pBuffer); QString name() const; - void setName(const QString& szName); + void setName(const QString & szName); + protected: }; class PluginManager { - public: - PluginManager(); - ~PluginManager(); - private: - // shared - bool m_bCanUnload; - // internal - KviPointerHashTable * m_pPluginDict; - public: - bool pluginCall(KviKvsModuleFunctionCall *c); - bool checkUnload(); - void unloadAll(); - protected: - bool findPlugin(QString& szName); - bool isPluginLoaded(const QString& szFileNameOrPathToLoad); - bool loadPlugin(const QString& szPluginPath); - Plugin * getPlugin(const QString& szPluginPath); +public: + PluginManager(); + ~PluginManager(); + +private: + // shared + bool m_bCanUnload; + // internal + KviPointerHashTable * m_pPluginDict; + +public: + bool pluginCall(KviKvsModuleFunctionCall * c); + bool checkUnload(); + void unloadAll(); + +protected: + bool findPlugin(QString & szName); + bool isPluginLoaded(const QString & szFileNameOrPathToLoad); + bool loadPlugin(const QString & szPluginPath); + Plugin * getPlugin(const QString & szPluginPath); }; #endif //_PLUGIN_H_ diff --git a/src/modules/system/libkvisystem.cpp b/src/modules/system/libkvisystem.cpp index b162b6820..9404b5a26 100644 --- a/src/modules/system/libkvisystem.cpp +++ b/src/modules/system/libkvisystem.cpp @@ -40,21 +40,21 @@ #include #if !defined(COMPILE_ON_WINDOWS) && !defined(COMPILE_ON_MINGW) - #include - #include - #include +#include +#include +#include #endif #ifdef COMPILE_DBUS_SUPPORT - #include +#include #endif #ifdef COMPILE_KDE_SUPPORT - #include // invokeTerminal() for system.runcmd -#else // tools we need to work around the absence of - // invokeTerminal() - #include - #include +#include // invokeTerminal() for system.runcmd +#else // tools we need to work around the absence of +// invokeTerminal() +#include +#include #endif PluginManager * g_pPluginManager; @@ -94,13 +94,12 @@ static bool system_kvs_fnc_ostype(KviKvsModuleFunctionCall * c) the uname() syscall. */ -static bool system_kvs_fnc_osname(KviKvsModuleFunctionCall *c) +static bool system_kvs_fnc_osname(KviKvsModuleFunctionCall * c) { c->returnValue()->setString(KviRuntimeInfo::name()); return true; } - /* @doc: system.osversion @type: @@ -115,7 +114,7 @@ static bool system_kvs_fnc_osname(KviKvsModuleFunctionCall *c) Returns the version of the operating system.[br] */ -static bool system_kvs_fnc_osversion(KviKvsModuleFunctionCall *c) +static bool system_kvs_fnc_osversion(KviKvsModuleFunctionCall * c) { // no params to process c->returnValue()->setString(KviRuntimeInfo::version()); @@ -136,7 +135,7 @@ static bool system_kvs_fnc_osversion(KviKvsModuleFunctionCall *c) Returns the release of the operating system.[br] */ -static bool system_kvs_fnc_osrelease(KviKvsModuleFunctionCall *c) +static bool system_kvs_fnc_osrelease(KviKvsModuleFunctionCall * c) { // no params to process c->returnValue()->setString(KviRuntimeInfo::release()); @@ -157,7 +156,7 @@ static bool system_kvs_fnc_osrelease(KviKvsModuleFunctionCall *c) Returns the machine of the operating system.[br] */ -static bool system_kvs_fnc_osmachine(KviKvsModuleFunctionCall *c) +static bool system_kvs_fnc_osmachine(KviKvsModuleFunctionCall * c) { // no params to process c->returnValue()->setString(KviRuntimeInfo::machine()); @@ -178,7 +177,7 @@ static bool system_kvs_fnc_osmachine(KviKvsModuleFunctionCall *c) Returns the nodename of the operating system.[br] */ -static bool system_kvs_fnc_osnodename(KviKvsModuleFunctionCall *c) +static bool system_kvs_fnc_osnodename(KviKvsModuleFunctionCall * c) { // no params to process c->returnValue()->setString(KviRuntimeInfo::nodename()); @@ -201,16 +200,16 @@ static bool system_kvs_fnc_osnodename(KviKvsModuleFunctionCall *c) Returns the value of the environment .[br] */ -static bool system_kvs_fnc_getenv(KviKvsModuleFunctionCall *c) +static bool system_kvs_fnc_getenv(KviKvsModuleFunctionCall * c) { QString szVariable; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("variable",KVS_PT_NONEMPTYSTRING,0,szVariable) + KVSM_PARAMETER("variable", KVS_PT_NONEMPTYSTRING, 0, szVariable) KVSM_PARAMETERS_END(c) QByteArray szVar = szVariable.toLocal8Bit(); -/*#ifdef COMPILE_ON_WINDOWS + /*#ifdef COMPILE_ON_WINDOWS QString env= getenv(szVar.data()); QString def= __tr2qs("No environment variable found, please don't use the %% in the request"); c->returnValue()->setString(env.isEmpty() ? QString::fromLocal8Bit(env) : QString::fromLocal8Bit(def)); @@ -218,7 +217,7 @@ static bool system_kvs_fnc_getenv(KviKvsModuleFunctionCall *c) */ char * b = KviEnvironment::getVariable(szVar.data()); c->returnValue()->setString(b ? QString::fromLocal8Bit(b) : QString()); -//#endif + //#endif return true; } @@ -245,13 +244,12 @@ static bool system_kvs_fnc_getenv(KviKvsModuleFunctionCall *c) [cmd]system.setSelection[/cmd] */ -static bool system_kvs_fnc_clipboard(KviKvsModuleFunctionCall *c) +static bool system_kvs_fnc_clipboard(KviKvsModuleFunctionCall * c) { c->returnValue()->setString(g_pApp->clipboard()->text(QClipboard::Clipboard)); return true; } - /* @doc: system.setClipboard @type: @@ -280,9 +278,9 @@ static bool system_kvs_cmd_setClipboard(KviKvsModuleCommandCall * c) QString szValue; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("data",KVS_PT_STRING,KVS_PF_OPTIONAL,szValue) + KVSM_PARAMETER("data", KVS_PT_STRING, KVS_PF_OPTIONAL, szValue) KVSM_PARAMETERS_END(c) - g_pApp->clipboard()->setText(szValue,QClipboard::Clipboard); + g_pApp->clipboard()->setText(szValue, QClipboard::Clipboard); return true; } @@ -312,9 +310,9 @@ static bool system_kvs_cmd_setSelection(KviKvsModuleCommandCall * c) { QString szValue; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("data",KVS_PT_STRING,KVS_PF_OPTIONAL,szValue) + KVSM_PARAMETER("data", KVS_PT_STRING, KVS_PF_OPTIONAL, szValue) KVSM_PARAMETERS_END(c) - g_pApp->clipboard()->setText(szValue,QClipboard::Selection); + g_pApp->clipboard()->setText(szValue, QClipboard::Selection); return true; } @@ -342,13 +340,12 @@ static bool system_kvs_cmd_setSelection(KviKvsModuleCommandCall * c) [cmd]system.setSelection[/cmd] */ -static bool system_kvs_fnc_selection(KviKvsModuleFunctionCall *c) +static bool system_kvs_fnc_selection(KviKvsModuleFunctionCall * c) { c->returnValue()->setString(g_pApp->clipboard()->text(QClipboard::Selection)); return true; } - /* @doc: system.checkModule @keyterms: @@ -369,19 +366,18 @@ static bool system_kvs_fnc_selection(KviKvsModuleFunctionCall *c) KVIrc engine. */ -static bool system_kvs_fnc_checkModule(KviKvsModuleFunctionCall *c) +static bool system_kvs_fnc_checkModule(KviKvsModuleFunctionCall * c) { QString szModuleName; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("module_name",KVS_PT_STRING,0,szModuleName) + KVSM_PARAMETER("module_name", KVS_PT_STRING, 0, szModuleName) KVSM_PARAMETERS_END(c) c->returnValue()->setBoolean(g_pModuleManager->loadModule(szModuleName)); return true; } - /* @doc: system.hostname @keyterms: @@ -398,14 +394,13 @@ static bool system_kvs_fnc_checkModule(KviKvsModuleFunctionCall *c) Returns the hostname of the machine that KVIrc is running on.[br] */ -static bool system_kvs_fnc_hostname(KviKvsModuleFunctionCall *c) +static bool system_kvs_fnc_hostname(KviKvsModuleFunctionCall * c) { // no params to process c->returnValue()->setString(KviRuntimeInfo::hostname()); return true; } - /* @doc: system.dbus @keyterms: @@ -454,19 +449,19 @@ static bool system_kvs_fnc_hostname(KviKvsModuleFunctionCall *c) [/example] */ -static bool system_kvs_fnc_dbus(KviKvsModuleFunctionCall *c) +static bool system_kvs_fnc_dbus(KviKvsModuleFunctionCall * c) { QString szService, szPath, szInterface, szMethod, szBusType; QStringList parms; - bool bRemoteTest=false; + bool bRemoteTest = false; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("service",KVS_PT_NONEMPTYSTRING,0,szService) - KVSM_PARAMETER("path",KVS_PT_NONEMPTYSTRING,0,szPath) - KVSM_PARAMETER("interface",KVS_PT_NONEMPTYSTRING,0,szInterface) - KVSM_PARAMETER("method",KVS_PT_NONEMPTYSTRING,0,szMethod) - KVSM_PARAMETER("bus_type",KVS_PT_STRING,KVS_PF_OPTIONAL,szBusType) - KVSM_PARAMETER("parameter_list",KVS_PT_STRINGLIST,KVS_PF_OPTIONAL,parms) + KVSM_PARAMETER("service", KVS_PT_NONEMPTYSTRING, 0, szService) + KVSM_PARAMETER("path", KVS_PT_NONEMPTYSTRING, 0, szPath) + KVSM_PARAMETER("interface", KVS_PT_NONEMPTYSTRING, 0, szInterface) + KVSM_PARAMETER("method", KVS_PT_NONEMPTYSTRING, 0, szMethod) + KVSM_PARAMETER("bus_type", KVS_PT_STRING, KVS_PF_OPTIONAL, szBusType) + KVSM_PARAMETER("parameter_list", KVS_PT_STRINGLIST, KVS_PF_OPTIONAL, parms) KVSM_PARAMETERS_END(c) #ifdef COMPILE_DBUS_SUPPORT @@ -479,17 +474,21 @@ static bool system_kvs_fnc_dbus(KviKvsModuleFunctionCall *c) if(szBusType == "system") { busType = QDBusConnection::systemBus(); - } else if(szBusType == "session"){ + } + else if(szBusType == "session") + { busType = QDBusConnection::sessionBus(); - } else { + } + else + { c->warning(__tr2qs("No DBus type specified")); return false; } - if(szService.left(1).compare("?")==0) + if(szService.left(1).compare("?") == 0) { - szService.remove(0,1); - bRemoteTest=true; + szService.remove(0, 1); + bRemoteTest = true; } QDBusInterface remoteApp(szService, szPath, szInterface, busType); @@ -499,7 +498,9 @@ static bool system_kvs_fnc_dbus(KviKvsModuleFunctionCall *c) { c->returnValue()->setInteger(0); return true; - } else { + } + else + { c->warning(__tr2qs("Invalid D-Bus interface")); return false; } @@ -513,7 +514,7 @@ static bool system_kvs_fnc_dbus(KviKvsModuleFunctionCall *c) QList ds; - for ( QStringList::Iterator it = parms.begin(); it != parms.end(); ++it ) + for(QStringList::Iterator it = parms.begin(); it != parms.end(); ++it) { KviCString tmp = *it; @@ -523,11 +524,12 @@ static bool system_kvs_fnc_dbus(KviKvsModuleFunctionCall *c) return false; } - KviCString szType = tmp.leftToFirst('=',false); - tmp.cutToFirst('=',true); - if(szType.isEmpty())szType = "int"; + KviCString szType = tmp.leftToFirst('=', false); + tmp.cutToFirst('=', true); + if(szType.isEmpty()) + szType = "int"; bool bOk; - if(kvi_strEqualCI("int",szType.ptr()) || kvi_strEqualCI("long",szType.ptr())) + if(kvi_strEqualCI("int", szType.ptr()) || kvi_strEqualCI("long", szType.ptr())) { int iii = tmp.toInt(&bOk); if(!bOk) @@ -536,19 +538,23 @@ static bool system_kvs_fnc_dbus(KviKvsModuleFunctionCall *c) return false; } ds << iii; - } else if(kvi_strEqualCI("QString",szType.ptr())) + } + else if(kvi_strEqualCI("QString", szType.ptr())) { QString ddd = tmp.ptr(); ds << ddd; - } else if(kvi_strEqualCI("QByteArray",szType.ptr())) + } + else if(kvi_strEqualCI("QByteArray", szType.ptr())) { QByteArray qcs = tmp.ptr(); ds << qcs; - } else if(kvi_strEqualCI("bool",szType.ptr())) + } + else if(kvi_strEqualCI("bool", szType.ptr())) { - bool bbb = kvi_strEqualCI(tmp.ptr(),"true"); + bool bbb = kvi_strEqualCI(tmp.ptr(), "true"); ds << bbb; - } else if(kvi_strEqualCI("unsigned int",szType.ptr()) || kvi_strEqualCI("uint",szType.ptr()) || kvi_strEqualCI("Q_UINT32",szType.ptr())) + } + else if(kvi_strEqualCI("unsigned int", szType.ptr()) || kvi_strEqualCI("uint", szType.ptr()) || kvi_strEqualCI("Q_UINT32", szType.ptr())) { unsigned int uii = tmp.toUInt(&bOk); if(!bOk) @@ -557,23 +563,26 @@ static bool system_kvs_fnc_dbus(KviKvsModuleFunctionCall *c) return false; } ds << uii; - } else { - c->warning(__tr2qs("Unsupported D-Bus parameter type %s"),tmp.ptr()); + } + else + { + c->warning(__tr2qs("Unsupported D-Bus parameter type %s"), tmp.ptr()); return false; } } QDBusMessage reply = remoteApp.callWithArgumentList(QDBus::Block, szMethod, ds); - if (reply.type() == QDBusMessage::ErrorMessage) + if(reply.type() == QDBusMessage::ErrorMessage) { QDBusError err = reply; - c->warning(__tr2qs("The D-Bus call returned an error \"%s\": %s"),qPrintable(err.name()), qPrintable(err.message())); + c->warning(__tr2qs("The D-Bus call returned an error \"%s\": %s"), qPrintable(err.name()), qPrintable(err.message())); return false; } QString szRetType; - foreach (QVariant v, reply.arguments()) { + foreach(QVariant v, reply.arguments()) + { switch(v.type()) { case QVariant::Bool: @@ -596,9 +605,9 @@ static bool system_kvs_fnc_dbus(KviKvsModuleFunctionCall *c) QStringList csl(v.toStringList()); KviKvsArray * arry = new KviKvsArray(); int idx = 0; - for(QStringList::Iterator iter = csl.begin();iter != csl.end();++iter) + for(QStringList::Iterator iter = csl.begin(); iter != csl.end(); ++iter) { - arry->set(idx,new KviKvsVariant(*iter)); + arry->set(idx, new KviKvsVariant(*iter)); idx++; } c->returnValue()->setArray(arry); @@ -609,18 +618,17 @@ static bool system_kvs_fnc_dbus(KviKvsModuleFunctionCall *c) c->returnValue()->setString(""); break; default: - c->warning(__tr2qs("Unsupported D-Bus call return type %s"),v.typeName()); + c->warning(__tr2qs("Unsupported D-Bus call return type %s"), v.typeName()); break; } } #else - c->warning(__tr2qs("D-Bus calls are available only under UNIX")); + c->warning(__tr2qs("D-Bus calls are available only under UNIX")); #endif return true; } - /* @doc: system.setenv @type: @@ -640,31 +648,31 @@ static bool system_kvs_fnc_dbus(KviKvsModuleFunctionCall *c) [fnc]$system.getenv[/fnc] */ - static bool system_kvs_cmd_setenv(KviKvsModuleCommandCall * c) { - QString szVariable,szValue; + QString szVariable, szValue; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("variable",KVS_PT_NONEMPTYSTRING,0,szVariable) - KVSM_PARAMETER("value",KVS_PT_STRING,KVS_PF_OPTIONAL,szValue) + KVSM_PARAMETER("variable", KVS_PT_NONEMPTYSTRING, 0, szVariable) + KVSM_PARAMETER("value", KVS_PT_STRING, KVS_PF_OPTIONAL, szValue) KVSM_PARAMETERS_END(c) QByteArray szVar = szVariable.toLocal8Bit(); QByteArray szVal = szValue.toLocal8Bit(); - if(szVal.isEmpty())KviEnvironment::unsetVariable(szVar.data()); + if(szVal.isEmpty()) + KviEnvironment::unsetVariable(szVar.data()); else { -/*#ifdef COMPILE_ON_WINDOWS + /*#ifdef COMPILE_ON_WINDOWS QString Var,Val,VarAndVal; Val = szVar.data(); Var = szVal.data(); VarAndVal = Var+"="+Val; putenv(VarAndVal); #else*/ // <-- this stuff is implicit in KviEnvironment::setVariable: that's why we have the kvi_ version. - KviEnvironment::setVariable(szVar.data(),szVal.data()); -/*#endif*/ + KviEnvironment::setVariable(szVar.data(), szVal.data()); + /*#endif*/ } return true; } @@ -708,8 +716,7 @@ static bool system_kvs_cmd_setenv(KviKvsModuleCommandCall * c) [/example] */ - -static bool system_kvs_fnc_plugin_call(KviKvsModuleFunctionCall *c) +static bool system_kvs_fnc_plugin_call(KviKvsModuleFunctionCall * c) { return g_pPluginManager->pluginCall(c); } @@ -741,12 +748,12 @@ static bool system_kvs_fnc_plugin_call(KviKvsModuleFunctionCall *c) [/example] */ // implements https://github.com/kvirc/KVIrc/issues/459 -static bool system_kvs_cmd_runcmd(KviKvsModuleCommandCall *c) +static bool system_kvs_cmd_runcmd(KviKvsModuleCommandCall * c) { QString szCommand; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("command",KVS_PT_NONEMPTYSTRING,KVS_PF_APPENDREMAINING,szCommand) + KVSM_PARAMETER("command", KVS_PT_NONEMPTYSTRING, KVS_PF_APPENDREMAINING, szCommand) KVSM_PARAMETERS_END(c) if(szCommand.isEmpty()) @@ -756,7 +763,7 @@ static bool system_kvs_cmd_runcmd(KviKvsModuleCommandCall *c) QStringList args; QProcess oProc; -#if defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW) // Only »cmd.exe /k« in the list. +#if defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW) // Only »cmd.exe /k« in the list. args << "/k" << szCommand; #elif defined(COMPILE_ON_MAC) args << "-e" << QString("tell application \"Terminal\" to do script \"%1\"").arg(szCommand); @@ -764,23 +771,21 @@ static bool system_kvs_cmd_runcmd(KviKvsModuleCommandCall *c) args << "-e" << szCommand; #endif // endif COMPILE_ON_WINDOWS - if(c->switches()->getAsStringIfExisting('t',"terminal",szTerminal)) + if(c->switches()->getAsStringIfExisting('t', "terminal", szTerminal)) { - if(!oProc.startDetached(szTerminal,args)) + if(!oProc.startDetached(szTerminal, args)) return c->error(__tr2qs("Failed to start the terminal program")); return true; } - - -#ifdef COMPILE_KDE_SUPPORT // We have invokeTerminal(). +#ifdef COMPILE_KDE_SUPPORT // We have invokeTerminal(). KToolInvocation::invokeTerminal(szCommand.toLocal8Bit()); -#else // No invokeTerminal() for us, we'll use a - // combination of QStringList and QProcess. +#else // No invokeTerminal() for us, we'll use a + // combination of QStringList and QProcess. QStringList szTerminals; -#if defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW) // Only »cmd.exe /k« in the list. +#if defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW) // Only »cmd.exe /k« in the list. szTerminals.append("cmd.exe"); #elif defined(COMPILE_ON_MAC) szTerminals.append("osascript"); @@ -791,16 +796,16 @@ static bool system_kvs_cmd_runcmd(KviKvsModuleCommandCall *c) szTerminals.append("x-terminal-emulator"); szTerminals.append("terminal"); szTerminals.append("xterm"); -#endif // endif COMPILE_ON_WINDOWS +#endif // endif COMPILE_ON_WINDOWS QString szTerm; while(!szTerminals.isEmpty()) { - szTerm=szTerminals.takeFirst(); + szTerm = szTerminals.takeFirst(); if(oProc.startDetached(szTerm, args)) return true; } -#endif // endif COMPILE_KDE_SUPPORT +#endif // endif COMPILE_KDE_SUPPORT return c->error(__tr2qs("Failed to start the terminal program")); } @@ -831,36 +836,35 @@ static bool system_kvs_fnc_ntohi(KviKvsModuleFunctionCall * c) kvs_uint_t uBytes; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("value",KVS_PT_INT,0,iValue) - KVSM_PARAMETER("bytecount",KVS_PT_UINT,KVS_PF_OPTIONAL,uBytes) + KVSM_PARAMETER("value", KVS_PT_INT, 0, iValue) + KVSM_PARAMETER("bytecount", KVS_PT_UINT, KVS_PF_OPTIONAL, uBytes) KVSM_PARAMETERS_END(c) switch(uBytes) { case 0: c->returnValue()->setInteger((kvs_int_t)KviByteOrder::networkByteOrderToLocalCpu32((kvi_u32_t)iValue)); - break; + break; case 1: c->returnValue()->setInteger((kvs_int_t)((kvi_u8_t)iValue)); - break; + break; case 2: c->returnValue()->setInteger((kvs_int_t)KviByteOrder::networkByteOrderToLocalCpu16((kvi_u16_t)iValue)); - break; + break; case 4: c->returnValue()->setInteger((kvs_int_t)KviByteOrder::networkByteOrderToLocalCpu32((kvi_u32_t)iValue)); - break; + break; case 8: c->returnValue()->setInteger((kvs_int_t)KviByteOrder::networkByteOrderToLocalCpu64((kvi_u64_t)iValue)); - break; + break; default: return c->error(__tr2qs("Bad bytecount specification: 1, 2, 4 and 8 are allowed")); - break; + break; } return true; } - /* @doc: system.htoni @type: @@ -887,30 +891,30 @@ static bool system_kvs_fnc_htoni(KviKvsModuleFunctionCall * c) kvs_uint_t uBytes; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("value",KVS_PT_INT,0,iValue) - KVSM_PARAMETER("bytecount",KVS_PT_UINT,KVS_PF_OPTIONAL,uBytes) + KVSM_PARAMETER("value", KVS_PT_INT, 0, iValue) + KVSM_PARAMETER("bytecount", KVS_PT_UINT, KVS_PF_OPTIONAL, uBytes) KVSM_PARAMETERS_END(c) switch(uBytes) { case 0: c->returnValue()->setInteger((kvs_int_t)KviByteOrder::localCpuToNetworkByteOrder32((kvi_u32_t)iValue)); - break; + break; case 1: c->returnValue()->setInteger((kvs_int_t)((kvi_u8_t)iValue)); - break; + break; case 2: c->returnValue()->setInteger((kvs_int_t)KviByteOrder::localCpuToNetworkByteOrder16((kvi_u16_t)iValue)); - break; + break; case 4: c->returnValue()->setInteger((kvs_int_t)KviByteOrder::localCpuToNetworkByteOrder32((kvi_u32_t)iValue)); - break; + break; case 8: c->returnValue()->setInteger((kvs_int_t)KviByteOrder::localCpuToNetworkByteOrder64((kvi_u64_t)iValue)); - break; + break; default: return c->error(__tr2qs("Bad bytecount specification: 1, 2, 4 and 8 are allowed")); - break; + break; } return true; @@ -918,26 +922,26 @@ static bool system_kvs_fnc_htoni(KviKvsModuleFunctionCall * c) static bool system_module_init(KviModule * m) { - KVSM_REGISTER_FUNCTION(m,"ostype",system_kvs_fnc_ostype); - KVSM_REGISTER_FUNCTION(m,"osname",system_kvs_fnc_osname); - KVSM_REGISTER_FUNCTION(m,"osversion",system_kvs_fnc_osversion); - KVSM_REGISTER_FUNCTION(m,"osrelease",system_kvs_fnc_osrelease); - KVSM_REGISTER_FUNCTION(m,"osmachine",system_kvs_fnc_osmachine); - KVSM_REGISTER_FUNCTION(m,"osnodename",system_kvs_fnc_osnodename); - KVSM_REGISTER_FUNCTION(m,"getenv",system_kvs_fnc_getenv); - KVSM_REGISTER_FUNCTION(m,"hostname",system_kvs_fnc_hostname); - KVSM_REGISTER_FUNCTION(m,"dbus",system_kvs_fnc_dbus); - KVSM_REGISTER_FUNCTION(m,"htoni",system_kvs_fnc_htoni); - KVSM_REGISTER_FUNCTION(m,"ntohi",system_kvs_fnc_ntohi); - KVSM_REGISTER_FUNCTION(m,"clipboard",system_kvs_fnc_clipboard); - KVSM_REGISTER_FUNCTION(m,"selection",system_kvs_fnc_selection); - KVSM_REGISTER_FUNCTION(m,"checkModule",system_kvs_fnc_checkModule); - KVSM_REGISTER_FUNCTION(m,"call",system_kvs_fnc_plugin_call); - - KVSM_REGISTER_SIMPLE_COMMAND(m,"setenv",system_kvs_cmd_setenv); - KVSM_REGISTER_SIMPLE_COMMAND(m,"setClipboard",system_kvs_cmd_setClipboard); - KVSM_REGISTER_SIMPLE_COMMAND(m,"setSelection",system_kvs_cmd_setSelection); - KVSM_REGISTER_SIMPLE_COMMAND(m,"runcmd",system_kvs_cmd_runcmd); + KVSM_REGISTER_FUNCTION(m, "ostype", system_kvs_fnc_ostype); + KVSM_REGISTER_FUNCTION(m, "osname", system_kvs_fnc_osname); + KVSM_REGISTER_FUNCTION(m, "osversion", system_kvs_fnc_osversion); + KVSM_REGISTER_FUNCTION(m, "osrelease", system_kvs_fnc_osrelease); + KVSM_REGISTER_FUNCTION(m, "osmachine", system_kvs_fnc_osmachine); + KVSM_REGISTER_FUNCTION(m, "osnodename", system_kvs_fnc_osnodename); + KVSM_REGISTER_FUNCTION(m, "getenv", system_kvs_fnc_getenv); + KVSM_REGISTER_FUNCTION(m, "hostname", system_kvs_fnc_hostname); + KVSM_REGISTER_FUNCTION(m, "dbus", system_kvs_fnc_dbus); + KVSM_REGISTER_FUNCTION(m, "htoni", system_kvs_fnc_htoni); + KVSM_REGISTER_FUNCTION(m, "ntohi", system_kvs_fnc_ntohi); + KVSM_REGISTER_FUNCTION(m, "clipboard", system_kvs_fnc_clipboard); + KVSM_REGISTER_FUNCTION(m, "selection", system_kvs_fnc_selection); + KVSM_REGISTER_FUNCTION(m, "checkModule", system_kvs_fnc_checkModule); + KVSM_REGISTER_FUNCTION(m, "call", system_kvs_fnc_plugin_call); + + KVSM_REGISTER_SIMPLE_COMMAND(m, "setenv", system_kvs_cmd_setenv); + KVSM_REGISTER_SIMPLE_COMMAND(m, "setClipboard", system_kvs_cmd_setClipboard); + KVSM_REGISTER_SIMPLE_COMMAND(m, "setSelection", system_kvs_cmd_setSelection); + KVSM_REGISTER_SIMPLE_COMMAND(m, "runcmd", system_kvs_cmd_runcmd); g_pPluginManager = new(PluginManager); @@ -953,20 +957,20 @@ static bool system_module_cleanup(KviModule *) static bool system_module_can_unload(KviModule *) { - if(!g_pPluginManager->checkUnload()) return false; + if(!g_pPluginManager->checkUnload()) + return false; return true; } KVIRC_MODULE( - "System", // module name - "4.0.0", // module version - "Copyright (C) 2001 Szymon Stefanek (pragma at kvirc dot net)" \ - " (C) 2005 Tonino Imbesi (grifisx at barmes dot org)"\ - " (C) 2005 Alessandro Carbone (elfonol at gmail dot com)",// author & (C) - "System information module", - system_module_init, - system_module_can_unload, - 0, - system_module_cleanup, - 0 -) + "System", // module name + "4.0.0", // module version + "Copyright (C) 2001 Szymon Stefanek (pragma at kvirc dot net)" + " (C) 2005 Tonino Imbesi (grifisx at barmes dot org)" + " (C) 2005 Alessandro Carbone (elfonol at gmail dot com)", // author & (C) + "System information module", + system_module_init, + system_module_can_unload, + 0, + system_module_cleanup, + 0) diff --git a/src/modules/term/TermWidget.cpp b/src/modules/term/TermWidget.cpp index 7687f7647..60efec2e6 100644 --- a/src/modules/term/TermWidget.cpp +++ b/src/modules/term/TermWidget.cpp @@ -37,139 +37,149 @@ #ifdef COMPILE_KDE4_SUPPORT - #include "klibloader.h" - #include "kparts/part.h" - #include "kparts/factory.h" - #include - - extern KviModule * g_pTermModule; - extern KviPointerList * g_pTermWidgetList; - extern KviPointerList * g_pTermWindowList; - - TermWidget::TermWidget(QWidget * par,bool bIsStandalone) - : QFrame(par) +#include "klibloader.h" +#include "kparts/part.h" +#include "kparts/factory.h" +#include + +extern KviModule * g_pTermModule; +extern KviPointerList * g_pTermWidgetList; +extern KviPointerList * g_pTermWindowList; + +TermWidget::TermWidget(QWidget * par, bool bIsStandalone) + : QFrame(par) +{ + setObjectName("term_widget"); + if(bIsStandalone) + g_pTermWidgetList->append(this); + m_bIsStandalone = bIsStandalone; + + m_pKonsolePart = 0; + m_pKonsoleWidget = 0; + + if(bIsStandalone) { - setObjectName("term_widget"); - if(bIsStandalone)g_pTermWidgetList->append(this); - m_bIsStandalone = bIsStandalone; - - m_pKonsolePart = 0; - m_pKonsoleWidget = 0; + m_pHBox = new KviTalHBox(this); + m_pTitleLabel = new QLabel(__tr2qs("Terminal Emulator"), m_pHBox); + m_pTitleLabel->setFrameStyle(QFrame::Raised | QFrame::StyledPanel); + m_pCloseButton = new QPushButton("", m_pHBox); + m_pCloseButton->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Close))); + m_pCloseButton->setToolTip(__tr2qs("Close this window")); + m_pHBox->setStretchFactor(m_pTitleLabel, 2); + connect(m_pCloseButton, SIGNAL(clicked()), this, SLOT(closeClicked())); + } + else + { + m_pHBox = 0; + m_pTitleLabel = 0; + m_pCloseButton = 0; + } - if(bIsStandalone) - { - m_pHBox = new KviTalHBox(this); - m_pTitleLabel = new QLabel(__tr2qs("Terminal Emulator"),m_pHBox); - m_pTitleLabel->setFrameStyle(QFrame::Raised | QFrame::StyledPanel); - m_pCloseButton = new QPushButton("",m_pHBox); - m_pCloseButton->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Close))); - m_pCloseButton->setToolTip(__tr2qs("Close this window")); - m_pHBox->setStretchFactor(m_pTitleLabel,2); - connect(m_pCloseButton,SIGNAL(clicked()),this,SLOT(closeClicked())); - } else { - m_pHBox = 0; - m_pTitleLabel = 0; - m_pCloseButton = 0; - } + setFrameStyle(QFrame::Sunken | QFrame::Panel); - setFrameStyle(QFrame::Sunken | QFrame::Panel); + KPluginFactory * pKonsoleFactory = KPluginLoader("libkonsolepart").factory(); - KPluginFactory *pKonsoleFactory = KPluginLoader("libkonsolepart").factory(); + if(pKonsoleFactory) + { + m_pKonsolePart = static_cast(pKonsoleFactory->create(this, this)); - if(pKonsoleFactory) + if(m_pKonsolePart) { - m_pKonsolePart = static_cast(pKonsoleFactory->create(this, this)); - - if(m_pKonsolePart) - { - // start the terminal - qobject_cast(m_pKonsolePart)->showShellInDir( QString() ); + // start the terminal + qobject_cast(m_pKonsolePart)->showShellInDir(QString()); - m_pKonsoleWidget = m_pKonsolePart->widget(); + m_pKonsoleWidget = m_pKonsolePart->widget(); - setFocusProxy(m_pKonsoleWidget); - m_pKonsoleWidget->show(); + setFocusProxy(m_pKonsoleWidget); + m_pKonsoleWidget->show(); - connect ( m_pKonsolePart, SIGNAL(destroyed()), this, SLOT(konsoleDestroyed()) ); - } else { - m_pKonsoleWidget = new QLabel(__tr2qs("Can't create the terminal emulation part"), this); - } - } else { - m_pKonsoleWidget = new QLabel(__tr2qs("Can't retrieve the terminal emulation factory"), this); + connect(m_pKonsolePart, SIGNAL(destroyed()), this, SLOT(konsoleDestroyed())); } - } - - TermWidget::~TermWidget() - { - if(m_pKonsoleWidget) - disconnect(m_pKonsoleWidget,SIGNAL(destroyed()),this,SLOT(konsoleDestroyed())); - - if(m_bIsStandalone)g_pTermWidgetList->removeRef(this); - if(g_pTermWindowList->isEmpty() && g_pTermWidgetList->isEmpty())g_pTermModule->unlock(); - } - - void TermWidget::resizeEvent(QResizeEvent *) - { - int hght = 0; - if(m_bIsStandalone) + else { - hght = m_pCloseButton->sizeHint().height(); - m_pHBox->setGeometry(1,1,width() - 2,hght + 1); - + m_pKonsoleWidget = new QLabel(__tr2qs("Can't create the terminal emulation part"), this); } - if(m_pKonsoleWidget) - m_pKonsoleWidget->setGeometry(1,hght + 1,width() - 2,height() - (hght + 2)); - } - - void TermWidget::closeClicked() - { - // this is called only in standalone mode - delete this; - } - - void TermWidget::konsoleDestroyed() - { - m_pKonsoleWidget = 0; - m_pKonsolePart = 0; - hide(); - QTimer::singleShot(0,this,SLOT(autoClose())); } - - void TermWidget::autoClose() + else { - if(m_bIsStandalone)delete this; - else ((KviWindow *)parent())->close(); + m_pKonsoleWidget = new QLabel(__tr2qs("Can't retrieve the terminal emulation factory"), this); } - - void TermWidget::changeTitle(int,const QString& str) +} + +TermWidget::~TermWidget() +{ + if(m_pKonsoleWidget) + disconnect(m_pKonsoleWidget, SIGNAL(destroyed()), this, SLOT(konsoleDestroyed())); + + if(m_bIsStandalone) + g_pTermWidgetList->removeRef(this); + if(g_pTermWindowList->isEmpty() && g_pTermWidgetList->isEmpty()) + g_pTermModule->unlock(); +} + +void TermWidget::resizeEvent(QResizeEvent *) +{ + int hght = 0; + if(m_bIsStandalone) { - if(m_bIsStandalone)m_pTitleLabel->setText(str); + hght = m_pCloseButton->sizeHint().height(); + m_pHBox->setGeometry(1, 1, width() - 2, hght + 1); } - - void TermWidget::notifySize(int,int) - { - } - - void TermWidget::changeColumns(int) + if(m_pKonsoleWidget) + m_pKonsoleWidget->setGeometry(1, hght + 1, width() - 2, height() - (hght + 2)); +} + +void TermWidget::closeClicked() +{ + // this is called only in standalone mode + delete this; +} + +void TermWidget::konsoleDestroyed() +{ + m_pKonsoleWidget = 0; + m_pKonsolePart = 0; + hide(); + QTimer::singleShot(0, this, SLOT(autoClose())); +} + +void TermWidget::autoClose() +{ + if(m_bIsStandalone) + delete this; + else + ((KviWindow *)parent())->close(); +} + +void TermWidget::changeTitle(int, const QString & str) +{ + if(m_bIsStandalone) + m_pTitleLabel->setText(str); +} + +void TermWidget::notifySize(int, int) +{ +} + +void TermWidget::changeColumns(int) +{ +} + +QSize TermWidget::sizeHint() const +{ + int hght = 0; + int wdth = 0; + if(m_pKonsoleWidget) { + hght += m_pKonsoleWidget->sizeHint().height(); + wdth = m_pKonsoleWidget->sizeHint().width(); } - - QSize TermWidget::sizeHint() const + if(m_pCloseButton) { - int hght = 0; - int wdth = 0; - if(m_pKonsoleWidget) - { - hght += m_pKonsoleWidget->sizeHint().height(); - wdth = m_pKonsoleWidget->sizeHint().width(); - } - if(m_pCloseButton) - { - hght += m_pCloseButton->sizeHint().height(); - } - - return QSize(wdth + 2,hght + 2); + hght += m_pCloseButton->sizeHint().height(); } + return QSize(wdth + 2, hght + 2); +} #endif //COMPILE_KDE4_SUPPORT diff --git a/src/modules/term/TermWidget.h b/src/modules/term/TermWidget.h index f1c2b3851..78d1b89c4 100644 --- a/src/modules/term/TermWidget.h +++ b/src/modules/term/TermWidget.h @@ -27,57 +27,60 @@ #include "kvi_settings.h" #ifdef COMPILE_KDE4_SUPPORT - #include - #include - #include - #include "KviTalHBox.h" +#include +#include +#include +#include "KviTalHBox.h" - #include "kparts/part.h" +#include "kparts/part.h" - class KviMainWindow; +class KviMainWindow; - class TermWidget : public QFrame - { - Q_OBJECT - Q_PROPERTY( int KviProperty_ChildFocusOwner READ dummy ) - public: - TermWidget(QWidget * par,bool bIsStandalone = false); - ~TermWidget(); - private: - KviTalHBox * m_pHBox; - QLabel * m_pTitleLabel; - QPushButton * m_pCloseButton; - KParts::Part * m_pKonsolePart; - bool m_bIsStandalone; - QWidget * m_pKonsoleWidget; - protected: - virtual void resizeEvent(QResizeEvent *e); - protected slots: - void closeClicked(); - void changeTitle(int i,const QString& str); - void notifySize(int,int); - void changeColumns(int); - public: - QWidget * konsoleWidget(){ return m_pKonsoleWidget ? m_pKonsoleWidget : this; }; - virtual QSize sizeHint() const; - int dummy() const { return 0; }; - protected slots: - void konsoleDestroyed(); - void autoClose(); - }; +class TermWidget : public QFrame +{ + Q_OBJECT + Q_PROPERTY(int KviProperty_ChildFocusOwner READ dummy) +public: + TermWidget(QWidget * par, bool bIsStandalone = false); + ~TermWidget(); + +private: + KviTalHBox * m_pHBox; + QLabel * m_pTitleLabel; + QPushButton * m_pCloseButton; + KParts::Part * m_pKonsolePart; + bool m_bIsStandalone; + QWidget * m_pKonsoleWidget; + +protected: + virtual void resizeEvent(QResizeEvent * e); +protected slots: + void closeClicked(); + void changeTitle(int i, const QString & str); + void notifySize(int, int); + void changeColumns(int); + +public: + QWidget * konsoleWidget() { return m_pKonsoleWidget ? m_pKonsoleWidget : this; }; + virtual QSize sizeHint() const; + int dummy() const { return 0; }; +protected slots: + void konsoleDestroyed(); + void autoClose(); +}; #else - // Dummy, to make moc happy - #include - - class TermWidget : public QObject +// Dummy, to make moc happy +#include + +class TermWidget : public QObject +{ + Q_OBJECT +public: + TermWidget() + : QObject() { - Q_OBJECT - public: - TermWidget() - : QObject() - { - } - }; + } +}; #endif #endif //_HELPWIDGET_H_ diff --git a/src/modules/term/TermWindow.cpp b/src/modules/term/TermWindow.cpp index 606f91696..8ea32d0e7 100644 --- a/src/modules/term/TermWindow.cpp +++ b/src/modules/term/TermWindow.cpp @@ -26,52 +26,52 @@ #include "TermWidget.h" #ifdef COMPILE_KDE4_SUPPORT - #include "KviIconManager.h" - #include "KviOptions.h" - #include "KviLocale.h" - #include "KviModule.h" +#include "KviIconManager.h" +#include "KviOptions.h" +#include "KviLocale.h" +#include "KviModule.h" - extern KviModule * g_pTermModule; - extern KviPointerList * g_pTermWindowList; - extern KviPointerList * g_pTermWidgetList; - extern KviIconManager * g_pIconManager; +extern KviModule * g_pTermModule; +extern KviPointerList * g_pTermWindowList; +extern KviPointerList * g_pTermWidgetList; +extern KviIconManager * g_pIconManager; - TermWindow::TermWindow(const char * name) - : KviWindow(KviWindow::Terminal,name) - { - g_pTermWindowList->append(this); - m_pTermWidget = 0; - m_pTermWidget = new TermWidget(this); - // Ensure proper focusing +TermWindow::TermWindow(const char * name) + : KviWindow(KviWindow::Terminal, name) +{ + g_pTermWindowList->append(this); + m_pTermWidget = 0; + m_pTermWidget = new TermWidget(this); + // Ensure proper focusing // setFocusHandler(m_pTermWidget->konsoleWidget(),this); - } +} - TermWindow::~TermWindow() - { - g_pTermWindowList->removeRef(this); - if(g_pTermWindowList->isEmpty() && g_pTermWidgetList->isEmpty())g_pTermModule->unlock(); - } +TermWindow::~TermWindow() +{ + g_pTermWindowList->removeRef(this); + if(g_pTermWindowList->isEmpty() && g_pTermWidgetList->isEmpty()) + g_pTermModule->unlock(); +} - QPixmap * TermWindow::myIconPtr() - { - return g_pIconManager->getSmallIcon(KviIconManager::Raw); - } +QPixmap * TermWindow::myIconPtr() +{ + return g_pIconManager->getSmallIcon(KviIconManager::Raw); +} - void TermWindow::resizeEvent(QResizeEvent *) - { - if(m_pTermWidget)m_pTermWidget->setGeometry(0,0,width(),height()); - } - - QSize TermWindow::sizeHint() const - { - return m_pTermWidget ? m_pTermWidget->sizeHint() : KviWindow::sizeHint(); - } - - void TermWindow::fillCaptionBuffers() - { - m_szPlainTextCaption = __tr("Terminal"); - } +void TermWindow::resizeEvent(QResizeEvent *) +{ + if(m_pTermWidget) + m_pTermWidget->setGeometry(0, 0, width(), height()); +} +QSize TermWindow::sizeHint() const +{ + return m_pTermWidget ? m_pTermWidget->sizeHint() : KviWindow::sizeHint(); +} +void TermWindow::fillCaptionBuffers() +{ + m_szPlainTextCaption = __tr("Terminal"); +} #endif diff --git a/src/modules/term/TermWindow.h b/src/modules/term/TermWindow.h index d488df959..954d9dc6f 100644 --- a/src/modules/term/TermWindow.h +++ b/src/modules/term/TermWindow.h @@ -27,39 +27,42 @@ #include "kvi_settings.h" #ifdef COMPILE_KDE4_SUPPORT - #include "KviWindow.h" - #include "KviCString.h" +#include "KviWindow.h" +#include "KviCString.h" - class TermWidget; +class TermWidget; - class TermWindow : public KviWindow - { - Q_OBJECT - public: - TermWindow(const char * name); - ~TermWindow(); - protected: - TermWidget * m_pTermWidget; - protected: - virtual QPixmap * myIconPtr(); - virtual void fillCaptionBuffers(); - virtual void resizeEvent(QResizeEvent *e); - public: - virtual QSize sizeHint() const; - }; +class TermWindow : public KviWindow +{ + Q_OBJECT +public: + TermWindow(const char * name); + ~TermWindow(); + +protected: + TermWidget * m_pTermWidget; + +protected: + virtual QPixmap * myIconPtr(); + virtual void fillCaptionBuffers(); + virtual void resizeEvent(QResizeEvent * e); + +public: + virtual QSize sizeHint() const; +}; #else - #include +#include - // Dummy, to make moc happy - class TermWindow : public QObject +// Dummy, to make moc happy +class TermWindow : public QObject +{ + Q_OBJECT +public: + TermWindow() + : QObject() { - Q_OBJECT - public: - TermWindow() - : QObject() - { - } - }; + } +}; #endif #endif //_KVI_HELPWINDOW_H_ diff --git a/src/modules/term/libkviterm.cpp b/src/modules/term/libkviterm.cpp index 54361b0f3..f08890bd1 100644 --- a/src/modules/term/libkviterm.cpp +++ b/src/modules/term/libkviterm.cpp @@ -31,11 +31,11 @@ #include #ifdef COMPILE_KDE4_SUPPORT - #include "TermWidget.h" - #include "TermWindow.h" +#include "TermWidget.h" +#include "TermWindow.h" - KviPointerList * g_pTermWidgetList = 0; - KviPointerList * g_pTermWindowList = 0; +KviPointerList * g_pTermWidgetList = 0; +KviPointerList * g_pTermWindowList = 0; #endif KviModule * g_pTermModule = 0; @@ -68,14 +68,15 @@ static bool term_kvs_cmd_open(KviKvsModuleCommandCall * c) #ifdef COMPILE_KDE4_SUPPORT c->module()->lock(); // multiple locks are allowed if( - c->hasSwitch('m',"mdi") || // compat only - c->hasSwitch('d',"dockable") - ) + c->hasSwitch('m', "mdi") || // compat only + c->hasSwitch('d', "dockable")) { - TermWindow *w = new TermWindow("Terminal emulator"); + TermWindow * w = new TermWindow("Terminal emulator"); g_pMainWindow->addWindow(w); - } else { - TermWidget *w = new TermWidget(g_pMainWindow->splitter(), true); + } + else + { + TermWidget * w = new TermWidget(g_pMainWindow->splitter(), true); w->show(); } #else @@ -95,7 +96,7 @@ static bool term_module_init(KviModule * m) g_pTermWindowList->setAutoDelete(false); #endif - KVSM_REGISTER_SIMPLE_COMMAND(m,"open",term_kvs_cmd_open); + KVSM_REGISTER_SIMPLE_COMMAND(m, "open", term_kvs_cmd_open); return true; } @@ -115,13 +116,12 @@ static bool term_module_cleanup(KviModule *) } KVIRC_MODULE( - "Term", // module name - "4.0.0", // module version - "Copyright (C) 2000 Szymon Stefanek (pragma at kvirc dot net)", // author & (C) - "Terminal emulator extension based on the KonsolePart KDE class", - term_module_init, - 0, - 0, - term_module_cleanup, - 0 -) + "Term", // module name + "4.0.0", // module version + "Copyright (C) 2000 Szymon Stefanek (pragma at kvirc dot net)", // author & (C) + "Terminal emulator extension based on the KonsolePart KDE class", + term_module_init, + 0, + 0, + term_module_cleanup, + 0) diff --git a/src/modules/texticons/libkvitexticons.cpp b/src/modules/texticons/libkvitexticons.cpp index c4bae2734..abf0ec610 100644 --- a/src/modules/texticons/libkvitexticons.cpp +++ b/src/modules/texticons/libkvitexticons.cpp @@ -47,33 +47,37 @@ static bool texticons_kvs_fnc_get(KviKvsModuleFunctionCall * c) { QString szIcon; - KviTextIcon* pIcon=0; + KviTextIcon * pIcon = 0; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("iconName",KVS_PT_NONEMPTYSTRING,KVS_PF_OPTIONAL,szIcon) + KVSM_PARAMETER("iconName", KVS_PT_NONEMPTYSTRING, KVS_PF_OPTIONAL, szIcon) KVSM_PARAMETERS_END(c) if(!szIcon.isNull()) { pIcon = g_pTextIconManager->lookupTextIcon(szIcon); if(!pIcon) { - c->warning("Icon '%s' not found",szIcon.toUtf8().data()); - } else { + c->warning("Icon '%s' not found", szIcon.toUtf8().data()); + } + else + { if(pIcon->id() != KviIconManager::None) c->returnValue()->setInteger(pIcon->id()); else c->returnValue()->setString(pIcon->filename()); } - } else { + } + else + { KviKvsHash * pHash = new KviKvsHash(); - KviPointerHashTableIterator it(*(g_pTextIconManager->textIconDict())); + KviPointerHashTableIterator it(*(g_pTextIconManager->textIconDict())); while(KviTextIcon * i = it.current()) { if(i->id() != KviIconManager::None) - pHash->set(it.currentKey(),new KviKvsVariant((kvs_int_t)(i->id()) )); + pHash->set(it.currentKey(), new KviKvsVariant((kvs_int_t)(i->id()))); else - pHash->set(it.currentKey(),new KviKvsVariant(i->filename())); + pHash->set(it.currentKey(), new KviKvsVariant(i->filename())); ++it; } c->returnValue()->setHash(pHash); @@ -102,24 +106,27 @@ static bool texticons_kvs_fnc_get(KviKvsModuleFunctionCall * c) */ static bool texticons_kvs_cmd_set(KviKvsModuleCommandCall * c) { - QString szName,szIcon; + QString szName, szIcon; KviTextIcon * pIcon = 0; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("iconName",KVS_PT_NONEMPTYSTRING,0,szName) - KVSM_PARAMETER("iconIdOrFile",KVS_PT_STRING,KVS_PF_OPTIONAL,szIcon) + KVSM_PARAMETER("iconName", KVS_PT_NONEMPTYSTRING, 0, szName) + KVSM_PARAMETER("iconIdOrFile", KVS_PT_STRING, KVS_PF_OPTIONAL, szIcon) KVSM_PARAMETERS_END(c) if(szIcon.isNull()) { g_pTextIconManager->textIconDict()->remove(szName); - } else { + } + else + { pIcon = g_pTextIconManager->lookupTextIcon(szName); if(!pIcon) { KviTextIcon * pTmpIcon = new KviTextIcon(KviIconManager::None); - g_pTextIconManager->insert(szName,*pTmpIcon); + g_pTextIconManager->insert(szName, *pTmpIcon); delete pTmpIcon; pIcon = g_pTextIconManager->lookupTextIcon(szName); - if(!pIcon) return false; + if(!pIcon) + return false; } bool bOk; @@ -128,16 +135,15 @@ static bool texticons_kvs_cmd_set(KviKvsModuleCommandCall * c) pIcon->setId(uResult); else pIcon->setFilename(szIcon); - } return true; } static bool texticons_module_init(KviModule * m) { - KVSM_REGISTER_SIMPLE_COMMAND(m,"set",texticons_kvs_cmd_set); + KVSM_REGISTER_SIMPLE_COMMAND(m, "set", texticons_kvs_cmd_set); - KVSM_REGISTER_FUNCTION(m,"get",texticons_kvs_fnc_get); + KVSM_REGISTER_FUNCTION(m, "get", texticons_kvs_fnc_get); return true; } @@ -147,16 +153,15 @@ static bool texticons_module_cleanup(KviModule *) } KVIRC_MODULE( - "Texticons", // module name - "4.0.0", // module version - "Copyright (C) 2006 Alexey Uzhva (wizard at opendoor dot ru)", - "Texticons handling functions module", - texticons_module_init, - 0, - 0, - texticons_module_cleanup, - 0 -) + "Texticons", // module name + "4.0.0", // module version + "Copyright (C) 2006 Alexey Uzhva (wizard at opendoor dot ru)", + "Texticons handling functions module", + texticons_module_init, + 0, + 0, + texticons_module_cleanup, + 0) /* @doc: texticons diff --git a/src/modules/theme/PackThemeDialog.cpp b/src/modules/theme/PackThemeDialog.cpp index 838684003..65c56984b 100644 --- a/src/modules/theme/PackThemeDialog.cpp +++ b/src/modules/theme/PackThemeDialog.cpp @@ -54,56 +54,54 @@ //#include //#include - - PackThemeDialog::PackThemeDialog(QWidget * pParent, KviPointerList * pThemeInfoList) -: QWizard(pParent) + : QWizard(pParent) { - setWindowTitle(__tr2qs_ctx("Export Theme - KVIrc","theme")); - setMinimumSize(400,350); - setDefaultProperty("QTextEdit","plainText",SIGNAL(textChanged())); + setWindowTitle(__tr2qs_ctx("Export Theme - KVIrc", "theme")); + setMinimumSize(400, 350); + setDefaultProperty("QTextEdit", "plainText", SIGNAL(textChanged())); m_pThemeInfoList = pThemeInfoList; QPixmap * pSide = g_pIconManager->getBigIcon("kvi_setup_label.png"); QPixmap * pLogo = g_pIconManager->getBigIcon("kvi_bigicon_addons.png"); #if defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW) - #if (_WIN32_WINNT >= 0x0600) - // We are on a Windows Vista / Seven - // It will fallback to XP if alpha compositing is disabled - setWizardStyle(QWizard::AeroStyle); - #else - // Windows XP - setWizardStyle(QWizard::ModernStyle); - setPixmap(QWizard::WatermarkPixmap,*pSide); - setPixmap(QWizard::LogoPixmap,*pLogo); - #endif +#if(_WIN32_WINNT >= 0x0600) + // We are on a Windows Vista / Seven + // It will fallback to XP if alpha compositing is disabled + setWizardStyle(QWizard::AeroStyle); +#else + // Windows XP + setWizardStyle(QWizard::ModernStyle); + setPixmap(QWizard::WatermarkPixmap, *pSide); + setPixmap(QWizard::LogoPixmap, *pLogo); +#endif #elif defined(COMPILE_ON_MAC) setWizardStyle(QWizard::MacStyle); - setPixmap(QWizard::BackgroundPixmap,*pSide); + setPixmap(QWizard::BackgroundPixmap, *pSide); #else // All other systems setWizardStyle(QWizard::ClassicStyle); - setPixmap(QWizard::WatermarkPixmap,*pSide); - setPixmap(QWizard::LogoPixmap,*pLogo); + setPixmap(QWizard::WatermarkPixmap, *pSide); + setPixmap(QWizard::LogoPixmap, *pLogo); #endif // Add a default property for file selectors - setDefaultProperty("KviFileSelector","tmpFile",SIGNAL(selectionChanged(const QString &))); + setDefaultProperty("KviFileSelector", "tmpFile", SIGNAL(selectionChanged(const QString &))); // Welcome page QWizardPage * pPage = new QWizardPage(this); QVBoxLayout * pLayout = new QVBoxLayout(pPage); pPage->setLayout(pLayout); - pPage->setTitle(__tr2qs_ctx("Welcome","theme")); + pPage->setTitle(__tr2qs_ctx("Welcome", "theme")); QString szText = "

"; - szText += __tr2qs_ctx("This procedure allows you to export the selected themes to a single package. It is useful when you want to distribute your themes to the public.","theme"); + szText += __tr2qs_ctx("This procedure allows you to export the selected themes to a single package. It is useful when you want to distribute your themes to the public.", "theme"); szText += "

"; - szText += __tr2qs_ctx("You will be asked to provide a package name, a description and, if you want, an icon/screenshot.","theme"); + szText += __tr2qs_ctx("You will be asked to provide a package name, a description and, if you want, an icon/screenshot.", "theme"); szText += "

"; - szText += __tr2qs_ctx("Hit the \"Next\" button to begin.","theme"); + szText += __tr2qs_ctx("Hit the \"Next\" button to begin.", "theme"); szText += "

"; QLabel * pLabel = new QLabel(pPage); @@ -133,11 +131,11 @@ PackThemeDialog::PackThemeDialog(QWidget * pParent, KviPointerList } PackThemeDataWidget::PackThemeDataWidget(PackThemeDialog * pParent) -: QWizardPage(pParent) + : QWizardPage(pParent) { setObjectName("theme_package_data_page"); - setTitle(__tr2qs_ctx("Theme Data","theme")); - setSubTitle(__tr2qs_ctx("This is the information list for the themes you're packaging. If it looks OK press \"Next\" to continue, otherwise press \"Cancel\" and review your themes first.","theme")); + setTitle(__tr2qs_ctx("Theme Data", "theme")); + setSubTitle(__tr2qs_ctx("This is the information list for the themes you're packaging. If it looks OK press \"Next\" to continue, otherwise press \"Cancel\" and review your themes first.", "theme")); } void PackThemeDataWidget::parseThemes(KviPointerList * pThemeInfoList) @@ -149,17 +147,18 @@ void PackThemeDataWidget::parseThemes(KviPointerList * pThemeInfoL KviThemeInfo * pThemeInfo = 0; bool bPackagePathSet = false; - QString szPackagePath = QDir::homePath(); - KviQString::ensureLastCharIs(szPackagePath,QChar(KVI_PATH_SEPARATOR_CHAR)); + KviQString::ensureLastCharIs(szPackagePath, QChar(KVI_PATH_SEPARATOR_CHAR)); if(pThemeInfoList->count() > 1) { szPackageName = "MyThemes"; - szPackageAuthor = __tr2qs_ctx("Your name here","theme"); + szPackageAuthor = __tr2qs_ctx("Your name here", "theme"); szPackageVersion = "1.0.0"; - szPackageDescription = __tr2qs_ctx("Enter a package description here...","theme"); - } else { + szPackageDescription = __tr2qs_ctx("Enter a package description here...", "theme"); + } + else + { if(pThemeInfoList->count() > 0) { pThemeInfo = pThemeInfoList->first(); @@ -208,18 +207,17 @@ void PackThemeDataWidget::parseThemes(KviPointerList * pThemeInfoL } ThemeFunctions::getThemeHtmlDescription( - szThemeDescription, - pThemeInfo->name(), - pThemeInfo->version(), - pThemeInfo->description(), - pThemeInfo->subdirectory(), - pThemeInfo->application(), - pThemeInfo->author(), - pThemeInfo->date(), - pThemeInfo->themeEngineVersion(), - pThemeInfo->smallScreenshot(), - iIdx - ); + szThemeDescription, + pThemeInfo->name(), + pThemeInfo->version(), + pThemeInfo->description(), + pThemeInfo->subdirectory(), + pThemeInfo->application(), + pThemeInfo->author(), + pThemeInfo->date(), + pThemeInfo->themeEngineVersion(), + pThemeInfo->smallScreenshot(), + iIdx); if(iIdx > 0) szThemesDescription += "


"; @@ -237,10 +235,10 @@ void PackThemeDataWidget::parseThemes(KviPointerList * pThemeInfoL pTextEdit->setDocument(pDoc); pLayout->addWidget(pTextEdit); - setField("packageName",QVariant(szPackageName)); - setField("packageVersion",szPackageVersion); - setField("packageDescription",szPackageDescription); - setField("packageAuthor",szPackageAuthor); + setField("packageName", QVariant(szPackageName)); + setField("packageVersion", szPackageVersion); + setField("packageDescription", szPackageDescription); + setField("packageAuthor", szPackageAuthor); } PackThemeDataWidget::~PackThemeDataWidget() @@ -248,60 +246,58 @@ PackThemeDataWidget::~PackThemeDataWidget() } PackThemeInfoWidget::PackThemeInfoWidget(PackThemeDialog * pParent) -: QWizardPage(pParent) + : QWizardPage(pParent) { setObjectName("theme_package_info_page"); - setTitle(__tr2qs_ctx("Package Information","theme")); - setSubTitle(__tr2qs_ctx("Here you need to provide information about you (the packager) and a short description of the package you're creating.","theme")); - + setTitle(__tr2qs_ctx("Package Information", "theme")); + setSubTitle(__tr2qs_ctx("Here you need to provide information about you (the packager) and a short description of the package you're creating.", "theme")); QGridLayout * pLayout = new QGridLayout(this); QLabel * pLabel = new QLabel(this); - pLabel->setText(__tr2qs_ctx("Package name:","theme")); - pLayout->addWidget(pLabel,1,0); + pLabel->setText(__tr2qs_ctx("Package name:", "theme")); + pLayout->addWidget(pLabel, 1, 0); m_pPackageNameEdit = new QLineEdit(this); pLabel->setBuddy(m_pPackageNameEdit); - pLayout->addWidget(m_pPackageNameEdit,1,1); + pLayout->addWidget(m_pPackageNameEdit, 1, 1); pLabel = new QLabel(this); - pLabel->setText(__tr2qs_ctx("Version:","theme")); - pLayout->addWidget(pLabel,2,0); + pLabel->setText(__tr2qs_ctx("Version:", "theme")); + pLayout->addWidget(pLabel, 2, 0); m_pPackageVersionEdit = new QLineEdit(this); pLabel->setBuddy(m_pPackageVersionEdit); - pLayout->addWidget(m_pPackageVersionEdit,2,1); + pLayout->addWidget(m_pPackageVersionEdit, 2, 1); pLabel = new QLabel(this); - pLabel->setText(__tr2qs_ctx("Description:","theme")); - pLayout->addWidget(pLabel,3,0); + pLabel->setText(__tr2qs_ctx("Description:", "theme")); + pLayout->addWidget(pLabel, 3, 0); m_pPackageDescriptionEdit = new QTextEdit(this); pLabel->setBuddy(m_pPackageDescriptionEdit); - pLayout->addWidget(m_pPackageDescriptionEdit,3,1); + pLayout->addWidget(m_pPackageDescriptionEdit, 3, 1); pLabel = new QLabel(this); - pLabel->setText(__tr2qs_ctx("Package author:","theme")); - pLayout->addWidget(pLabel,4,0); + pLabel->setText(__tr2qs_ctx("Package author:", "theme")); + pLayout->addWidget(pLabel, 4, 0); m_pPackageAuthorEdit = new QLineEdit(this); pLabel->setBuddy(m_pPackageAuthorEdit); - pLayout->addWidget(m_pPackageAuthorEdit,4,1); + pLayout->addWidget(m_pPackageAuthorEdit, 4, 1); - pLayout->setRowStretch(3,1); - pLayout->setColumnStretch(1,1); + pLayout->setRowStretch(3, 1); + pLayout->setColumnStretch(1, 1); // Store data in the fields - registerField("packageName*",m_pPackageNameEdit); - registerField("packageVersion*",m_pPackageVersionEdit); - registerField("packageDescription*",m_pPackageDescriptionEdit); - registerField("packageAuthor*",m_pPackageAuthorEdit); - + registerField("packageName*", m_pPackageNameEdit); + registerField("packageVersion*", m_pPackageVersionEdit); + registerField("packageDescription*", m_pPackageDescriptionEdit); + registerField("packageAuthor*", m_pPackageAuthorEdit); } void PackThemeInfoWidget::initializePage() { @@ -320,25 +316,25 @@ PackThemeInfoWidget::~PackThemeInfoWidget() } PackThemeImageWidget::PackThemeImageWidget(PackThemeDialog * pParent) -: QWizardPage(pParent) + : QWizardPage(pParent) { setObjectName("theme_package_image_page"); - setTitle(__tr2qs_ctx("Icon/Screenshot","theme")); - setSubTitle(__tr2qs_ctx("Here you can choose the image that will appear in the installation dialog for your theme package. It can be an icon, a logo or a screenshot and it should be not larger than 300x225. If you don't provide an image a simple default icon will be used at installation stage.","theme")); + setTitle(__tr2qs_ctx("Icon/Screenshot", "theme")); + setSubTitle(__tr2qs_ctx("Here you can choose the image that will appear in the installation dialog for your theme package. It can be an icon, a logo or a screenshot and it should be not larger than 300x225. If you don't provide an image a simple default icon will be used at installation stage.", "theme")); QVBoxLayout * pLayout = new QVBoxLayout(this); m_pImageLabel = new QLabel(this); m_pImageLabel->setFrameStyle(QFrame::Sunken | QFrame::Panel); - m_pImageLabel->setMinimumSize(300,225); + m_pImageLabel->setMinimumSize(300, 225); m_pImageLabel->setAlignment(Qt::AlignCenter | Qt::AlignVCenter); pLayout->addWidget(m_pImageLabel); - m_pImageSelector = new KviFileSelector(this,"",&m_szImagePath,true,0,KVI_FILTER_IMAGE); - connect(m_pImageSelector,SIGNAL(selectionChanged(const QString &)),this,SLOT(imageSelectionChanged(const QString &))); + m_pImageSelector = new KviFileSelector(this, "", &m_szImagePath, true, 0, KVI_FILTER_IMAGE); + connect(m_pImageSelector, SIGNAL(selectionChanged(const QString &)), this, SLOT(imageSelectionChanged(const QString &))); pLayout->addWidget(m_pImageSelector); // Store data in the fields - registerField("packageImagePath*",m_pImageSelector); + registerField("packageImagePath*", m_pImageSelector); //m_pImageSelectionPage = pPage; } @@ -355,43 +351,45 @@ void PackThemeImageWidget::imageSelectionChanged(const QString & szImagePath) QPixmap out; if(pix.width() > 300 || pix.height() > 225) { - pix=pix.scaled(300,225,Qt::KeepAspectRatio,Qt::SmoothTransformation); - out=out.fromImage(pix); - } else { - out=out.fromImage(pix); + pix = pix.scaled(300, 225, Qt::KeepAspectRatio, Qt::SmoothTransformation); + out = out.fromImage(pix); + } + else + { + out = out.fromImage(pix); } m_pImageLabel->setPixmap(out); return; } - QMessageBox::critical(this,__tr2qs_ctx("Export Theme - KVIrc","theme"),__tr2qs_ctx("Failed to load the selected image!","theme"), - QMessageBox::Ok,QMessageBox::NoButton,QMessageBox::NoButton); + QMessageBox::critical(this, __tr2qs_ctx("Export Theme - KVIrc", "theme"), __tr2qs_ctx("Failed to load the selected image!", "theme"), + QMessageBox::Ok, QMessageBox::NoButton, QMessageBox::NoButton); m_pImageSelector->setSelection(""); m_pImageLabel->setPixmap(QPixmap()); } PackThemeSaveWidget::PackThemeSaveWidget(PackThemeDialog * pParent) -: QWizardPage(pParent) + : QWizardPage(pParent) { setObjectName("theme_package_save_page"); - setTitle(__tr2qs_ctx("Package Path","theme")); - setSubTitle(__tr2qs_ctx("Here you must choose the file name for the theme package. It should have a *%1 extension.","theme").arg(KVI_FILEEXTENSION_THEMEPACKAGE)); + setTitle(__tr2qs_ctx("Package Path", "theme")); + setSubTitle(__tr2qs_ctx("Here you must choose the file name for the theme package. It should have a *%1 extension.", "theme").arg(KVI_FILEEXTENSION_THEMEPACKAGE)); QVBoxLayout * pLayout = new QVBoxLayout(this); QString szFilter = "*"; szFilter += KVI_FILEEXTENSION_THEMEPACKAGE; - m_pSavePathSelector = new KviFileSelector(this,"",&m_szPackagePath,true,KviFileSelector::ChooseSaveFileName,szFilter); + m_pSavePathSelector = new KviFileSelector(this, "", &m_szPackagePath, true, KviFileSelector::ChooseSaveFileName, szFilter); pLayout->addWidget(m_pSavePathSelector); QLabel * pLabel = new QLabel(this); pLabel->setWordWrap(true); - pLabel->setText(__tr2qs_ctx("Finally hit the \"Finish\" button to complete the packaging operation.","theme")); + pLabel->setText(__tr2qs_ctx("Finally hit the \"Finish\" button to complete the packaging operation.", "theme")); pLayout->addWidget(pLabel); // Store data in the fields - registerField("packageSavePath*",m_pSavePathSelector); + registerField("packageSavePath*", m_pSavePathSelector); } PackThemeSaveWidget::~PackThemeSaveWidget() @@ -417,7 +415,8 @@ PackThemeDialog::~PackThemeDialog() void PackThemeDialog::accept() { - if(!packTheme()) return; + if(!packTheme()) + return; QWizard::accept(); } @@ -436,32 +435,27 @@ bool PackThemeDialog::packTheme() QString szError; - if(! - ThemeFunctions::packageThemes( - m_szPackagePath, - m_szName, - m_szVersion, - m_szDescription, - m_szAuthor, - m_szImagePath, - *m_pThemeInfoList, - szError - ) - ) + if(!ThemeFunctions::packageThemes( + m_szPackagePath, + m_szName, + m_szVersion, + m_szDescription, + m_szAuthor, + m_szImagePath, + *m_pThemeInfoList, + szError)) { QMessageBox::critical(this, - __tr2qs_ctx("Export Theme - KVIrc","theme"), - szError, - QMessageBox::Ok,QMessageBox::NoButton,QMessageBox::NoButton - ); + __tr2qs_ctx("Export Theme - KVIrc", "theme"), + szError, + QMessageBox::Ok, QMessageBox::NoButton, QMessageBox::NoButton); return false; } QMessageBox::information(this, - __tr2qs_ctx("Exporting Theme - KVIrc","theme"), - __tr2qs("Theme package saved successfully."), - QMessageBox::Ok,QMessageBox::NoButton,QMessageBox::NoButton - ); + __tr2qs_ctx("Exporting Theme - KVIrc", "theme"), + __tr2qs("Theme package saved successfully."), + QMessageBox::Ok, QMessageBox::NoButton, QMessageBox::NoButton); return true; } diff --git a/src/modules/theme/PackThemeDialog.h b/src/modules/theme/PackThemeDialog.h index efe7a66f5..0fc4fe98e 100644 --- a/src/modules/theme/PackThemeDialog.h +++ b/src/modules/theme/PackThemeDialog.h @@ -48,20 +48,21 @@ class PackThemeDialog : public QWizard public: PackThemeDialog(QWidget * pParent, KviPointerList * pThemeInfoList); ~PackThemeDialog(); + protected: - PackThemeDataWidget * m_pPackThemeDataWidget; - PackThemeInfoWidget * m_pPackThemeInfoWidget; - PackThemeImageWidget * m_pPackThemeImageWidget; - PackThemeSaveWidget * m_pPackThemeSaveWidget; + PackThemeDataWidget * m_pPackThemeDataWidget; + PackThemeInfoWidget * m_pPackThemeInfoWidget; + PackThemeImageWidget * m_pPackThemeImageWidget; + PackThemeSaveWidget * m_pPackThemeSaveWidget; KviPointerList * m_pThemeInfoList; - QString m_szAuthor; - QString m_szName; - QString m_szVersion; - QString m_szDescription; - QString m_szImagePath; - QString m_szPackagePath; - QString m_szSavePath; + QString m_szAuthor; + QString m_szName; + QString m_szVersion; + QString m_szDescription; + QString m_szImagePath; + QString m_szPackagePath; + QString m_szSavePath; //QWidget * m_pImageSelectionPage; protected: @@ -75,6 +76,7 @@ class PackThemeDataWidget : public QWizardPage public: PackThemeDataWidget(PackThemeDialog * pParent); ~PackThemeDataWidget(); + public: void parseThemes(KviPointerList * pThemeInfoList); }; @@ -85,11 +87,13 @@ class PackThemeInfoWidget : public QWizardPage public: PackThemeInfoWidget(PackThemeDialog * pParent); ~PackThemeInfoWidget(); + public: QLineEdit * m_pPackageNameEdit; QTextEdit * m_pPackageDescriptionEdit; QLineEdit * m_pPackageVersionEdit; QLineEdit * m_pPackageAuthorEdit; + protected: virtual void initializePage(); }; @@ -100,10 +104,11 @@ class PackThemeImageWidget : public QWizardPage public: PackThemeImageWidget(PackThemeDialog * pParent); ~PackThemeImageWidget(); + protected: KviFileSelector * m_pImageSelector; - QLabel * m_pImageLabel; - QString m_szImagePath; + QLabel * m_pImageLabel; + QString m_szImagePath; protected slots: void imageSelectionChanged(const QString & szImagePath); }; @@ -114,9 +119,11 @@ class PackThemeSaveWidget : public QWizardPage public: PackThemeSaveWidget(PackThemeDialog * pParent); ~PackThemeSaveWidget(); + protected: KviFileSelector * m_pSavePathSelector; - QString m_szPackagePath; + QString m_szPackagePath; + protected: virtual void initializePage(); }; diff --git a/src/modules/theme/SaveThemeDialog.cpp b/src/modules/theme/SaveThemeDialog.cpp index 5255a363a..e94ba10e0 100644 --- a/src/modules/theme/SaveThemeDialog.cpp +++ b/src/modules/theme/SaveThemeDialog.cpp @@ -55,16 +55,14 @@ #include #include - - SaveThemeDialog::SaveThemeDialog(QWidget * pParent) -: KviTalWizard(pParent) + : KviTalWizard(pParent) { - setWindowTitle(__tr2qs_ctx("Save Current Theme - KVIrc","theme")); - setMinimumSize(400,350); + setWindowTitle(__tr2qs_ctx("Save Current Theme - KVIrc", "theme")); + setMinimumSize(400, 350); KviThemeInfo info; - info.load(KVI_OPTION_STRING(KviOption_stringIconThemeSubdir),KviThemeInfo::Auto); + info.load(KVI_OPTION_STRING(KviOption_stringIconThemeSubdir), KviThemeInfo::Auto); // welcome page ================================================================================== QWidget * pPage = new QWidget(this); @@ -73,22 +71,22 @@ SaveThemeDialog::SaveThemeDialog(QWidget * pParent) QLabel * pLabel = new QLabel(pPage); pLabel->setWordWrap(true); QString szText = "

"; - szText += __tr2qs_ctx("This procedure allows you to save the current theme settings to a single directory. It is useful if you want to apply other themes or play with the theme settings and later come back to this theme with a single click. It will also allow you to manually modify the theme settings and later export them to a distributable package.","theme"); + szText += __tr2qs_ctx("This procedure allows you to save the current theme settings to a single directory. It is useful if you want to apply other themes or play with the theme settings and later come back to this theme with a single click. It will also allow you to manually modify the theme settings and later export them to a distributable package.", "theme"); szText += "

"; - szText += __tr2qs_ctx("You will be asked to provide a theme name, a description and, if you want, a screenshot.","theme"); + szText += __tr2qs_ctx("You will be asked to provide a theme name, a description and, if you want, a screenshot.", "theme"); szText += "

"; - szText += __tr2qs_ctx("Hit the \"Next\" button to begin.","theme"); + szText += __tr2qs_ctx("Hit the \"Next\" button to begin.", "theme"); szText += "

"; pLabel->setText(szText); - pLayout->addWidget(pLabel,0,0); - pLayout->setRowStretch(1,1); + pLayout->addWidget(pLabel, 0, 0); + pLayout->setRowStretch(1, 1); - addPage(pPage,__tr2qs_ctx("Welcome","theme")); - setBackEnabled(pPage,false); - setNextEnabled(pPage,true); - setHelpEnabled(pPage,false); - setFinishEnabled(pPage,false); + addPage(pPage, __tr2qs_ctx("Welcome", "theme")); + setBackEnabled(pPage, false); + setNextEnabled(pPage, true); + setHelpEnabled(pPage, false); + setFinishEnabled(pPage, false); // packager information ================================================================================ @@ -96,83 +94,81 @@ SaveThemeDialog::SaveThemeDialog(QWidget * pParent) pLayout = new QGridLayout(pPage); pLabel = new QLabel(pPage); - pLabel->setText(__tr2qs_ctx("Here you need to provide information about you (the author) and a short description of the theme you're creating.","theme")); + pLabel->setText(__tr2qs_ctx("Here you need to provide information about you (the author) and a short description of the theme you're creating.", "theme")); pLabel->setWordWrap(true); pLabel->setTextFormat(Qt::RichText); - pLayout->addWidget(pLabel,0,0,1,2); + pLayout->addWidget(pLabel, 0, 0, 1, 2); pLabel = new QLabel(pPage); - pLabel->setText(__tr2qs_ctx("Theme name:","theme")); - pLayout->addWidget(pLabel,1,0); + pLabel->setText(__tr2qs_ctx("Theme name:", "theme")); + pLayout->addWidget(pLabel, 1, 0); m_pThemeNameEdit = new QLineEdit(pPage); m_pThemeNameEdit->setText(info.name()); - pLayout->addWidget(m_pThemeNameEdit,1,1); + pLayout->addWidget(m_pThemeNameEdit, 1, 1); pLabel = new QLabel(pPage); - pLabel->setText(__tr2qs_ctx("Version:","theme")); - pLayout->addWidget(pLabel,2,0); + pLabel->setText(__tr2qs_ctx("Version:", "theme")); + pLayout->addWidget(pLabel, 2, 0); m_pThemeVersionEdit = new QLineEdit(pPage); m_pThemeVersionEdit->setText(info.version()); QRegExp rx("\\d{1,2}\\.\\d{1,2}(\\.\\d{1,2})?"); - QValidator *validator = new QRegExpValidator(rx, this); + QValidator * validator = new QRegExpValidator(rx, this); m_pThemeVersionEdit->setValidator(validator); - pLayout->addWidget(m_pThemeVersionEdit,2,1); + pLayout->addWidget(m_pThemeVersionEdit, 2, 1); pLabel = new QLabel(pPage); - pLabel->setText(__tr2qs_ctx("Description:","theme")); - pLayout->addWidget(pLabel,3,0); + pLabel->setText(__tr2qs_ctx("Description:", "theme")); + pLayout->addWidget(pLabel, 3, 0); m_pThemeDescriptionEdit = new QTextEdit(pPage); m_pThemeDescriptionEdit->setText(info.description()); - pLayout->addWidget(m_pThemeDescriptionEdit,3,1); + pLayout->addWidget(m_pThemeDescriptionEdit, 3, 1); pLabel = new QLabel(pPage); - pLabel->setText(__tr2qs_ctx("Theme author:","theme")); - pLayout->addWidget(pLabel,4,0); + pLabel->setText(__tr2qs_ctx("Theme author:", "theme")); + pLayout->addWidget(pLabel, 4, 0); m_pAuthorNameEdit = new QLineEdit(pPage); m_pAuthorNameEdit->setText(info.author()); - pLayout->addWidget(m_pAuthorNameEdit,4,1); - + pLayout->addWidget(m_pAuthorNameEdit, 4, 1); - pLayout->setRowStretch(3,1); - pLayout->setColumnStretch(1,1); - - addPage(pPage,__tr2qs_ctx("Theme Information","theme")); - setBackEnabled(pPage,true); - setHelpEnabled(pPage,false); - setNextEnabled(pPage,true); - setFinishEnabled(pPage,false); + pLayout->setRowStretch(3, 1); + pLayout->setColumnStretch(1, 1); + addPage(pPage, __tr2qs_ctx("Theme Information", "theme")); + setBackEnabled(pPage, true); + setHelpEnabled(pPage, false); + setNextEnabled(pPage, true); + setFinishEnabled(pPage, false); // options page ================================================================================== pPage = new QWidget(this); pLayout = new QGridLayout(pPage); - m_pSaveIconsCheckBox = new QCheckBox(__tr2qs_ctx("Save icons and images with theme","theme"),this); + m_pSaveIconsCheckBox = new QCheckBox(__tr2qs_ctx("Save icons and images with theme", "theme"), this); m_pSaveIconsCheckBox->setChecked(true); pLabel = new QLabel(pPage); pLabel->setWordWrap(true); QString ozText = "

"; - ozText += __tr2qs_ctx("To use the default and latest icon/image set automatically, uncheck this option.

To replace specific icons/images in your theme, include only those you wish to replace.","theme"); + ozText += __tr2qs_ctx("To use the default and latest icon/image set automatically, uncheck this option.

To replace specific icons/images in your theme, include only those you wish to replace.", "theme"); ozText += "

"; - ozText += __tr2qs_ctx("Hit the \"Next\" button to continue.","theme"); + ozText += __tr2qs_ctx("Hit the \"Next\" button to continue.", "theme"); ozText += "

"; - pLayout->addWidget(m_pSaveIconsCheckBox,0,0); + pLayout->addWidget(m_pSaveIconsCheckBox, 0, 0); pLabel->setText(ozText); - pLayout->addWidget(pLabel,1,0); - pLayout->setRowStretch(2,1); + pLayout->addWidget(pLabel, 1, 0); + pLayout->setRowStretch(2, 1); - addPage(pPage,__tr2qs_ctx("Theme options","theme")); - setBackEnabled(pPage,true); - setNextEnabled(pPage,true); - setHelpEnabled(pPage,false); - setFinishEnabled(pPage,false); + addPage(pPage, __tr2qs_ctx("Theme options", "theme")); + setBackEnabled(pPage, true); + setNextEnabled(pPage, true); + setHelpEnabled(pPage, false); + setFinishEnabled(pPage, false); // screenshot/logo/icon ================================================================================ @@ -180,80 +176,80 @@ SaveThemeDialog::SaveThemeDialog(QWidget * pParent) pLayout = new QGridLayout(pPage); pLabel = new QLabel(pPage); - pLabel->setText(__tr2qs_ctx("Here you can either choose a screenshot image from disk or make one now. The screenshot will be displayed in the tooltips of the theme management dialog and will be also visible in the package installation dialog if you will export the theme to a distributable package.","theme")); + pLabel->setText(__tr2qs_ctx("Here you can either choose a screenshot image from disk or make one now. The screenshot will be displayed in the tooltips of the theme management dialog and will be also visible in the package installation dialog if you will export the theme to a distributable package.", "theme")); pLabel->setWordWrap(true); pLabel->setTextFormat(Qt::RichText); - pLayout->addWidget(pLabel,0,0); + pLayout->addWidget(pLabel, 0, 0); m_pImageLabel = new QLabel(pPage); m_pImageLabel->setFrameStyle(QFrame::Sunken | QFrame::Panel); - m_pImageLabel->setMinimumSize(300,225); + m_pImageLabel->setMinimumSize(300, 225); m_pImageLabel->setAlignment(Qt::AlignCenter | Qt::AlignVCenter); - pLayout->addWidget(m_pImageLabel,1,0); + pLayout->addWidget(m_pImageLabel, 1, 0); - m_pImageSelector = new KviFileSelector(pPage,"",&m_szScreenshotPath,true,0,KVI_FILTER_IMAGE); - connect(m_pImageSelector,SIGNAL(selectionChanged(const QString &)),this,SLOT(imageSelectionChanged(const QString &))); - pLayout->addWidget(m_pImageSelector,2,0); + m_pImageSelector = new KviFileSelector(pPage, "", &m_szScreenshotPath, true, 0, KVI_FILTER_IMAGE); + connect(m_pImageSelector, SIGNAL(selectionChanged(const QString &)), this, SLOT(imageSelectionChanged(const QString &))); + pLayout->addWidget(m_pImageSelector, 2, 0); QPushButton * pButton = new QPushButton(pPage); - pButton->setText(__tr2qs_ctx("Make Screenshot Now","theme")); - connect(pButton,SIGNAL(clicked()),this,SLOT(makeScreenshot())); - pLayout->addWidget(pButton,3,0); + pButton->setText(__tr2qs_ctx("Make Screenshot Now", "theme")); + connect(pButton, SIGNAL(clicked()), this, SLOT(makeScreenshot())); + pLayout->addWidget(pButton, 3, 0); - pLayout->setRowStretch(1,1); + pLayout->setRowStretch(1, 1); m_pImageSelectionPage = pPage; - addPage(pPage,__tr2qs_ctx("Screenshot","theme")); - setBackEnabled(pPage,true); - setHelpEnabled(pPage,false); - setNextEnabled(pPage,false); // a screenshot should be ALWAYS provided. - setFinishEnabled(pPage,false); // a screenshot should be ALWAYS provided. - + addPage(pPage, __tr2qs_ctx("Screenshot", "theme")); + setBackEnabled(pPage, true); + setHelpEnabled(pPage, false); + setNextEnabled(pPage, false); // a screenshot should be ALWAYS provided. + setFinishEnabled(pPage, false); // a screenshot should be ALWAYS provided. } SaveThemeDialog::~SaveThemeDialog() { } -void SaveThemeDialog::imageSelectionChanged(const QString &szImagePath) +void SaveThemeDialog::imageSelectionChanged(const QString & szImagePath) { QImage pix(szImagePath); if(!pix.isNull()) { QPixmap out; if(pix.width() > 300 || pix.height() > 225) - out = QPixmap::fromImage(pix.scaled(300,225,Qt::KeepAspectRatio)); + out = QPixmap::fromImage(pix.scaled(300, 225, Qt::KeepAspectRatio)); else out = QPixmap::fromImage(pix); m_pImageLabel->setPixmap(out); - setNextEnabled(m_pImageSelectionPage,true); - setFinishEnabled(m_pImageSelectionPage,true); + setNextEnabled(m_pImageSelectionPage, true); + setFinishEnabled(m_pImageSelectionPage, true); return; } - QMessageBox::critical(this,__tr2qs_ctx("Save Current Theme - KVIrc","theme"),__tr2qs_ctx("Failed to load the selected image!","theme"), - QMessageBox::Ok,QMessageBox::NoButton,QMessageBox::NoButton); + QMessageBox::critical(this, __tr2qs_ctx("Save Current Theme - KVIrc", "theme"), __tr2qs_ctx("Failed to load the selected image!", "theme"), + QMessageBox::Ok, QMessageBox::NoButton, QMessageBox::NoButton); m_pImageSelector->setSelection(""); m_pImageLabel->setPixmap(QPixmap()); - setNextEnabled(m_pImageSelectionPage,false); - setFinishEnabled(m_pImageSelectionPage,false); + setNextEnabled(m_pImageSelectionPage, false); + setFinishEnabled(m_pImageSelectionPage, false); } void SaveThemeDialog::accept() { - if(!saveTheme())return; + if(!saveTheme()) + return; KviTalWizard::accept(); } void SaveThemeDialog::makeScreenshot() { QString szFileName; - g_pApp->getTmpFileName(szFileName,"screenshot.png"); + g_pApp->getTmpFileName(szFileName, "screenshot.png"); if(!ThemeFunctions::makeKVIrcScreenshot(szFileName)) { - QMessageBox::critical(this,__tr2qs_ctx("Acquire Screenshot - KVIrc","theme"),__tr2qs_ctx("Failed to make a theme screenshot.","theme"), - QMessageBox::Ok,QMessageBox::NoButton,QMessageBox::NoButton); + QMessageBox::critical(this, __tr2qs_ctx("Acquire Screenshot - KVIrc", "theme"), __tr2qs_ctx("Failed to make a theme screenshot.", "theme"), + QMessageBox::Ok, QMessageBox::NoButton, QMessageBox::NoButton); return; } m_pImageSelector->setSelection(szFileName); @@ -268,8 +264,8 @@ bool SaveThemeDialog::saveTheme() sto.setName(m_pThemeNameEdit->text()); if(sto.name().isEmpty()) { - QMessageBox::critical(this,__tr2qs_ctx("Save Current Theme - KVIrc","theme"),__tr2qs_ctx("You must choose a theme name.","theme"),QMessageBox::Ok, - QMessageBox::NoButton,QMessageBox::NoButton); + QMessageBox::critical(this, __tr2qs_ctx("Save Current Theme - KVIrc", "theme"), __tr2qs_ctx("You must choose a theme name.", "theme"), QMessageBox::Ok, + QMessageBox::NoButton, QMessageBox::NoButton); return false; } @@ -284,42 +280,42 @@ bool SaveThemeDialog::saveTheme() sto.setVersion("1.0.0"); QString szSubdir = sto.name() + QString("-") + sto.version(); - szSubdir.replace(QRegExp("[^a-zA-Z0-9_\\-.][^a-zA-Z0-9_\\-.]*"),"_"); - sto.setDirectoryAndLocation(szSubdir,KviThemeInfo::User); + szSubdir.replace(QRegExp("[^a-zA-Z0-9_\\-.][^a-zA-Z0-9_\\-.]*"), "_"); + sto.setDirectoryAndLocation(szSubdir, KviThemeInfo::User); QString szAbsDir = sto.directory(); if(!KviFileUtils::makeDir(szAbsDir)) { - QMessageBox::critical(this,__tr2qs_ctx("Save Current Theme - KVIrc","theme"),__tr2qs_ctx("Unable to create theme directory.","theme"), - QMessageBox::Ok,QMessageBox::NoButton,QMessageBox::NoButton); + QMessageBox::critical(this, __tr2qs_ctx("Save Current Theme - KVIrc", "theme"), __tr2qs_ctx("Unable to create theme directory.", "theme"), + QMessageBox::Ok, QMessageBox::NoButton, QMessageBox::NoButton); return false; } - if(!KviTheme::save(sto,m_pSaveIconsCheckBox->isChecked())) + if(!KviTheme::save(sto, m_pSaveIconsCheckBox->isChecked())) { QString szErr = sto.lastError(); - QString szMsg2 = QString(__tr2qs_ctx("Unable to save theme: %1","theme")).arg(szErr); - QMessageBox::critical(this,__tr2qs_ctx("Save Current Theme - KVIrc","theme"),szMsg2, - QMessageBox::Ok,QMessageBox::NoButton,QMessageBox::NoButton); + QString szMsg2 = QString(__tr2qs_ctx("Unable to save theme: %1", "theme")).arg(szErr); + QMessageBox::critical(this, __tr2qs_ctx("Save Current Theme - KVIrc", "theme"), szMsg2, + QMessageBox::Ok, QMessageBox::NoButton, QMessageBox::NoButton); return false; } // write down the screenshot, if needed if(!m_szScreenshotPath.isEmpty()) { - if(!KviTheme::saveScreenshots(sto,m_szScreenshotPath)) + if(!KviTheme::saveScreenshots(sto, m_szScreenshotPath)) { - QMessageBox::critical(this,__tr2qs_ctx("Save Current Theme - KVIrc","theme"),__tr2qs_ctx("Failed to load the selected screenshot image: please fix it","theme"), - QMessageBox::Ok,QMessageBox::NoButton,QMessageBox::NoButton); + QMessageBox::critical(this, __tr2qs_ctx("Save Current Theme - KVIrc", "theme"), __tr2qs_ctx("Failed to load the selected screenshot image: please fix it", "theme"), + QMessageBox::Ok, QMessageBox::NoButton, QMessageBox::NoButton); setCurrentPage(m_pImageSelectionPage); return false; } } - QString szMsg = __tr2qs_ctx("Theme saved successfully to %1","theme").arg(szAbsDir); + QString szMsg = __tr2qs_ctx("Theme saved successfully to %1", "theme").arg(szAbsDir); - QMessageBox::information(this,__tr2qs_ctx("Save Current Theme - KVIrc","theme"),szMsg,QMessageBox::Ok, - QMessageBox::NoButton,QMessageBox::NoButton); + QMessageBox::information(this, __tr2qs_ctx("Save Current Theme - KVIrc", "theme"), szMsg, QMessageBox::Ok, + QMessageBox::NoButton, QMessageBox::NoButton); return true; } diff --git a/src/modules/theme/SaveThemeDialog.h b/src/modules/theme/SaveThemeDialog.h index f9913e883..2f852615c 100644 --- a/src/modules/theme/SaveThemeDialog.h +++ b/src/modules/theme/SaveThemeDialog.h @@ -38,24 +38,25 @@ class QTextEdit; class QCheckBox; class KviFileSelector; - class SaveThemeDialog : public KviTalWizard { Q_OBJECT public: SaveThemeDialog(QWidget * pParent); virtual ~SaveThemeDialog(); + protected: - QString m_szScreenshotPath; + QString m_szScreenshotPath; KviFileSelector * m_pImageSelector; - QLabel * m_pImageLabel; - QLineEdit * m_pThemeNameEdit; - QTextEdit * m_pThemeDescriptionEdit; - QLineEdit * m_pThemeVersionEdit; - QLineEdit * m_pAuthorNameEdit; - QWidget * m_pImageSelectionPage; - QPushButton * m_pOkButton; - QCheckBox * m_pSaveIconsCheckBox; + QLabel * m_pImageLabel; + QLineEdit * m_pThemeNameEdit; + QTextEdit * m_pThemeDescriptionEdit; + QLineEdit * m_pThemeVersionEdit; + QLineEdit * m_pAuthorNameEdit; + QWidget * m_pImageSelectionPage; + QPushButton * m_pOkButton; + QCheckBox * m_pSaveIconsCheckBox; + protected: virtual void accept(); bool saveTheme(); diff --git a/src/modules/theme/ThemeFunctions.cpp b/src/modules/theme/ThemeFunctions.cpp index c49c08437..b2b8aa22d 100644 --- a/src/modules/theme/ThemeFunctions.cpp +++ b/src/modules/theme/ThemeFunctions.cpp @@ -45,19 +45,18 @@ //#include - namespace ThemeFunctions { - static bool notAValidThemePackage(QString &szError) + static bool notAValidThemePackage(QString & szError) { - szError = __tr2qs_ctx("The selected file doesn't seem to be a valid KVIrc theme package","theme"); + szError = __tr2qs_ctx("The selected file doesn't seem to be a valid KVIrc theme package", "theme"); return false; } - bool installThemePackage(const QString &szThemePackageFileName,QString &szError,QWidget * pDialogParent) + bool installThemePackage(const QString & szThemePackageFileName, QString & szError, QWidget * pDialogParent) { - KviPointerHashTable * pInfoFields; + KviPointerHashTable * pInfoFields; QString * pValue; bool bInstall; QPixmap pix; @@ -73,7 +72,7 @@ namespace ThemeFunctions { qDebug("The selected file doesn't seem to be a valid KVIrc package"); QString szErr = r.lastError(); - szError = QString(__tr2qs_ctx("The selected file doesn't seem to be a valid KVIrc package: %1","theme")).arg(szErr); + szError = QString(__tr2qs_ctx("The selected file doesn't seem to be a valid KVIrc package: %1", "theme")).arg(szErr); return false; } @@ -83,7 +82,7 @@ namespace ThemeFunctions if(!pValue) return notAValidThemePackage(szError); - if(!KviQString::equalCI(*pValue,"ThemePack")) + if(!KviQString::equalCI(*pValue, "ThemePack")) return notAValidThemePackage(szError); pValue = pInfoFields->find("ThemePackVersion"); @@ -92,10 +91,11 @@ namespace ThemeFunctions return notAValidThemePackage(szError); // make sure the default fields exist - for(int i=0;i<6;i++) + for(int i = 0; i < 6; i++) { pValue = pInfoFields->find(check_fields[i]); - if(!pValue)return notAValidThemePackage(szError); + if(!pValue) + return notAValidThemePackage(szError); } pValue = pInfoFields->find("ThemeCount"); @@ -115,7 +115,7 @@ namespace ThemeFunctions // load its picture pByteArray = r.binaryInfoFields()->find("Image"); if(pByteArray) - pix.loadFromData(*pByteArray,0,0); + pix.loadFromData(*pByteArray, 0, 0); if(pix.isNull()) { @@ -131,16 +131,16 @@ namespace ThemeFunctions QString szPackageThemeEngineVersion; QString szPackageApplication; - QString szAuthor = __tr2qs_ctx("Author","theme"); - QString szCreatedAt = __tr2qs_ctx("Created at","theme"); - QString szCreatedOn = __tr2qs_ctx("Created with","theme"); + QString szAuthor = __tr2qs_ctx("Author", "theme"); + QString szCreatedAt = __tr2qs_ctx("Created at", "theme"); + QString szCreatedOn = __tr2qs_ctx("Created with", "theme"); - r.getStringInfoField("Name",szPackageName); - r.getStringInfoField("Version",szPackageVersion); - r.getStringInfoField("Author",szPackageAuthor); - r.getStringInfoField("Description",szPackageDescription); - r.getStringInfoField("Application",szPackageApplication); - r.getStringInfoField("Date",szPackageDate); + r.getStringInfoField("Name", szPackageName); + r.getStringInfoField("Version", szPackageVersion); + r.getStringInfoField("Author", szPackageAuthor); + r.getStringInfoField("Description", szPackageDescription); + r.getStringInfoField("Application", szPackageApplication); + r.getStringInfoField("Date", szPackageDate); QString szWarnings; QString szDetails = ""; @@ -163,47 +163,46 @@ namespace ThemeFunctions QString szThemeApplication; szTmp = QString("Theme%1Name").arg(iIdx); - r.getStringInfoField(szTmp,szThemeName); + r.getStringInfoField(szTmp, szThemeName); szTmp = QString("Theme%1Version").arg(iIdx); - r.getStringInfoField(szTmp,szThemeVersion); + r.getStringInfoField(szTmp, szThemeVersion); szTmp = QString("Theme%1Application").arg(iIdx); - r.getStringInfoField(szTmp,szThemeApplication); + r.getStringInfoField(szTmp, szThemeApplication); szTmp = QString("Theme%1Description").arg(iIdx); - r.getStringInfoField(szTmp,szThemeDescription); + r.getStringInfoField(szTmp, szThemeDescription); szTmp = QString("Theme%1Date").arg(iIdx); - r.getStringInfoField(szTmp,szThemeDate); + r.getStringInfoField(szTmp, szThemeDate); szTmp = QString("Theme%1Subdirectory").arg(iIdx); - r.getStringInfoField(szTmp,szThemeSubdirectory); + r.getStringInfoField(szTmp, szThemeSubdirectory); szTmp = QString("Theme%1Author").arg(iIdx); - r.getStringInfoField(szTmp,szThemeAuthor); + r.getStringInfoField(szTmp, szThemeAuthor); szTmp = QString("Theme%1ThemeEngineVersion").arg(iIdx); - r.getStringInfoField(szTmp,szThemeEngineVersion); + r.getStringInfoField(szTmp, szThemeEngineVersion); szTmp = QString("Theme%1Screenshot").arg(iIdx); QPixmap pixScreenshot; pByteArray = r.binaryInfoFields()->find(szTmp); if(pByteArray) - pixScreenshot.loadFromData(*pByteArray,0,0); + pixScreenshot.loadFromData(*pByteArray, 0, 0); if(szThemeName.isEmpty() || szThemeVersion.isEmpty() || szThemeSubdirectory.isEmpty() || szThemeEngineVersion.isEmpty()) bValid = false; - if(KviMiscUtils::compareVersions(szThemeEngineVersion,KVI_CURRENT_THEME_ENGINE_VERSION) < 0) + if(KviMiscUtils::compareVersions(szThemeEngineVersion, KVI_CURRENT_THEME_ENGINE_VERSION) < 0) bValid = false; QString szDetailsBuffer; getThemeHtmlDescription( - szDetailsBuffer, - szThemeName, - szThemeVersion, - szThemeDescription, - szThemeSubdirectory, - szThemeApplication, - szThemeAuthor, - szThemeDate, - szThemeEngineVersion, - pixScreenshot, - iIdx,&hd - ); + szDetailsBuffer, + szThemeName, + szThemeVersion, + szThemeDescription, + szThemeSubdirectory, + szThemeApplication, + szThemeAuthor, + szThemeDate, + szThemeEngineVersion, + pixScreenshot, + iIdx, &hd); if(iIdx > 0) szDetails += "


"; @@ -213,7 +212,7 @@ namespace ThemeFunctions if(!bValid) { szDetails += "

"; - szDetails += __tr2qs_ctx("Warning: this theme might be incompatible with this version of KVIrc","theme"); + szDetails += __tr2qs_ctx("Warning: this theme might be incompatible with this version of KVIrc", "theme"); szDetails += "

"; iValidThemeCount--; } @@ -222,18 +221,18 @@ namespace ThemeFunctions } szDetails += "

"; - szDetails += __tr2qs_ctx("Go Back to Package Data","theme"); + szDetails += __tr2qs_ctx("Go Back to Package Data", "theme"); szDetails += "

"; szDetails += ""; if(iValidThemeCount < iThemeCount) { szWarnings += "

"; - szWarnings += __tr2qs_ctx("Warning: the theme contained in this package might be either corrupted or incompatible with this version of KVIrc","theme"); + szWarnings += __tr2qs_ctx("Warning: the theme contained in this package might be either corrupted or incompatible with this version of KVIrc", "theme"); szWarnings += "

"; } - QString szShowDetails = __tr2qs_ctx("Show Details","theme"); + QString szShowDetails = __tr2qs_ctx("Show Details", "theme"); // clang-format off hd.szHtmlText = QString( @@ -266,18 +265,18 @@ namespace ThemeFunctions "").arg(szPackageName,szPackageVersion,szPackageDescription,szAuthor,szPackageAuthor,szCreatedAt,szPackageDate,szCreatedOn,szPackageApplication).arg(szWarnings,szShowDetails); // clang-format on - hd.addImageResource("theme_dialog_pack_image",pix); - hd.addHtmlResource("theme_dialog_details",szDetails); - hd.addHtmlResource("theme_dialog_main",hd.szHtmlText); + hd.addImageResource("theme_dialog_pack_image", pix); + hd.addHtmlResource("theme_dialog_details", szDetails); + hd.addHtmlResource("theme_dialog_main", hd.szHtmlText); QString beginCenter = "
"; QString endCenter = "
"; - hd.szCaption = __tr2qs_ctx("Install Theme Pack - KVIrc","theme"); - hd.szUpperLabelText = beginCenter + __tr2qs_ctx("You're about to install the following theme package","theme") + endCenter; - hd.szLowerLabelText = beginCenter + __tr2qs_ctx("Do you want to proceed with the installation?","theme") + endCenter; - hd.szButton1Text = __tr2qs_ctx("Do Not Install","theme"); - hd.szButton2Text = __tr2qs_ctx("Yes, Proceed","theme"); + hd.szCaption = __tr2qs_ctx("Install Theme Pack - KVIrc", "theme"); + hd.szUpperLabelText = beginCenter + __tr2qs_ctx("You're about to install the following theme package", "theme") + endCenter; + hd.szLowerLabelText = beginCenter + __tr2qs_ctx("Do you want to proceed with the installation?", "theme") + endCenter; + hd.szButton1Text = __tr2qs_ctx("Do Not Install", "theme"); + hd.szButton2Text = __tr2qs_ctx("Yes, Proceed", "theme"); hd.iDefaultButton = 2; hd.iCancelButton = 1; hd.pixIcon = *(g_pIconManager->getSmallIcon(KviIconManager::Theme)); @@ -285,15 +284,15 @@ namespace ThemeFunctions hd.iMinimumHeight = 420; hd.iFlags = KviHtmlDialogData::ForceMinimumSize; - bInstall = KviHtmlDialog::display(pDialogParent,&hd) == 2; + bInstall = KviHtmlDialog::display(pDialogParent, &hd) == 2; if(bInstall) { QString szUnpackPath; - g_pApp->getLocalKvircDirectory(szUnpackPath,KviApplication::Themes); - if(!r.unpack(szThemePackageFileName,szUnpackPath)) + g_pApp->getLocalKvircDirectory(szUnpackPath, KviApplication::Themes); + if(!r.unpack(szThemePackageFileName, szUnpackPath)) { QString szErr2 = r.lastError(); - szError = QString(__tr2qs_ctx("Failed to unpack the selected file: %1","theme")).arg(szErr2); + szError = QString(__tr2qs_ctx("Failed to unpack the selected file: %1", "theme")).arg(szErr2); return false; } } @@ -301,27 +300,25 @@ namespace ThemeFunctions return true; } - void getThemeHtmlDescription( - QString &szBuffer, - const QString &szThemeName, - const QString &szThemeVersion, - const QString &szThemeDescription, - const QString &szThemeSubdirectory, - const QString &szThemeApplication, - const QString &szThemeAuthor, - const QString &szThemeDate, - const QString &szThemeThemeEngineVersion, - const QPixmap &pixScreenshot, - int iUniqueIndexInDocument, - KviHtmlDialogData *hd - ) + QString & szBuffer, + const QString & szThemeName, + const QString & szThemeVersion, + const QString & szThemeDescription, + const QString & szThemeSubdirectory, + const QString & szThemeApplication, + const QString & szThemeAuthor, + const QString & szThemeDate, + const QString & szThemeThemeEngineVersion, + const QPixmap & pixScreenshot, + int iUniqueIndexInDocument, + KviHtmlDialogData * hd) { - QString szAuthor = __tr2qs_ctx("Author","theme"); - QString szCreatedAt = __tr2qs_ctx("Created at","theme"); - QString szCreatedOn = __tr2qs_ctx("Created with","theme"); - QString szThemeEngineVersion = __tr2qs_ctx("Theme engine version","theme"); - QString szSubdirectory = __tr2qs_ctx("Subdirectory","theme"); + QString szAuthor = __tr2qs_ctx("Author", "theme"); + QString szCreatedAt = __tr2qs_ctx("Created at", "theme"); + QString szCreatedOn = __tr2qs_ctx("Created with", "theme"); + QString szThemeEngineVersion = __tr2qs_ctx("Theme engine version", "theme"); + QString szSubdirectory = __tr2qs_ctx("Subdirectory", "theme"); QString szScreenshot; if(!pixScreenshot.isNull()) @@ -330,10 +327,13 @@ namespace ThemeFunctions QString szTmp; szTmp = QString("theme_shot%1").arg(iUniqueIndexInDocument); //FIXME in tooltip - if (hd) - hd->addImageResource(szTmp,pixScreenshot); - else szScreenshot = ""; - } else { + if(hd) + hd->addImageResource(szTmp, pixScreenshot); + else + szScreenshot = ""; + } + else + { szScreenshot = ""; } @@ -360,7 +360,7 @@ namespace ThemeFunctions // clang-format on } - bool makeKVIrcScreenshot(const QString &szSavePngFilePath,bool bMaximizeFrame) + bool makeKVIrcScreenshot(const QString & szSavePngFilePath, bool bMaximizeFrame) { if(bMaximizeFrame) { @@ -376,8 +376,9 @@ namespace ThemeFunctions if(pix.isNull()) bResult = false; - else { - if(!pix.save(szSavePngFilePath,"PNG")) + else + { + if(!pix.save(szSavePngFilePath, "PNG")) bResult = false; } @@ -386,27 +387,25 @@ namespace ThemeFunctions return bResult; } - bool packageThemes( - const QString &szPackagePath, - const QString &szPackageName, - const QString &szPackageVersion, - const QString &szPackageDescription, - const QString &szPackageAuthor, - const QString &szPackageImagePath, - KviPointerList &lThemeInfoList, - QString &szError - ) + const QString & szPackagePath, + const QString & szPackageName, + const QString & szPackageVersion, + const QString & szPackageDescription, + const QString & szPackageAuthor, + const QString & szPackageImagePath, + KviPointerList & lThemeInfoList, + QString & szError) { if(szPackagePath.isEmpty()) { - szError = __tr2qs_ctx("Invalid empty package path","theme"); + szError = __tr2qs_ctx("Invalid empty package path", "theme"); return false; } if(szPackageName.isEmpty()) { - szError = __tr2qs_ctx("Invalid empty package name","theme"); + szError = __tr2qs_ctx("Invalid empty package name", "theme"); return false; } @@ -417,93 +416,93 @@ namespace ThemeFunctions QImage pix(szPackageImagePath); if(pix.isNull()) { - szError = __tr2qs_ctx("Failed to load the selected image: please fix it","theme"); + szError = __tr2qs_ctx("Failed to load the selected image: please fix it", "theme"); return false; } if((pix.width() > 300) || (pix.height() > 225)) - out = out.fromImage(pix.scaled(300,225,Qt::KeepAspectRatio)); + out = out.fromImage(pix.scaled(300, 225, Qt::KeepAspectRatio)); else - out=out.fromImage(pix); + out = out.fromImage(pix); } KviPackageWriter f; - f.addInfoField("PackageType","ThemePack"); - f.addInfoField("ThemePackVersion",KVI_CURRENT_THEME_ENGINE_VERSION); - f.addInfoField("Name",szPackageName); - f.addInfoField("Version",szPackageVersion.isEmpty() ? "1.0.0" : szPackageVersion); - f.addInfoField("Author",szPackageAuthor); - f.addInfoField("Description",szPackageDescription); + f.addInfoField("PackageType", "ThemePack"); + f.addInfoField("ThemePackVersion", KVI_CURRENT_THEME_ENGINE_VERSION); + f.addInfoField("Name", szPackageName); + f.addInfoField("Version", szPackageVersion.isEmpty() ? "1.0.0" : szPackageVersion); + f.addInfoField("Author", szPackageAuthor); + f.addInfoField("Description", szPackageDescription); // this is the equivalent to an empty date.toString() call, but it's needed // to ensure qt4 will use the default() locale and not the system() one - f.addInfoField("Date",QDateTime::currentDateTime().toString(Qt::ISODate)); - f.addInfoField("Application","KVIrc " KVI_VERSION "." KVI_SOURCES_DATE); + f.addInfoField("Date", QDateTime::currentDateTime().toString(Qt::ISODate)); + f.addInfoField("Application", "KVIrc " KVI_VERSION "." KVI_SOURCES_DATE); if(!out.isNull()) { QByteArray * pba = new QByteArray(); - QBuffer buffer(pba,0); + QBuffer buffer(pba, 0); buffer.open(QIODevice::WriteOnly); - out.save(&buffer,"PNG"); + out.save(&buffer, "PNG"); buffer.close(); - f.addInfoField("Image",pba); // cool :) [no disk access needed] + f.addInfoField("Image", pba); // cool :) [no disk access needed] } QString szTmp; szTmp.setNum(lThemeInfoList.count()); - f.addInfoField("ThemeCount",szTmp); + f.addInfoField("ThemeCount", szTmp); int iIdx = 0; - for(KviThemeInfo * pInfo = lThemeInfoList.first();pInfo;pInfo = lThemeInfoList.next()) + for(KviThemeInfo * pInfo = lThemeInfoList.first(); pInfo; pInfo = lThemeInfoList.next()) { if(pInfo->name().isEmpty()) { - szError = __tr2qs_ctx("Invalid theme name","theme"); + szError = __tr2qs_ctx("Invalid theme name", "theme"); return false; } if(pInfo->version().isEmpty()) { - szError = __tr2qs_ctx("Invalid theme version","theme"); + szError = __tr2qs_ctx("Invalid theme version", "theme"); return false; } QString szSubdir = pInfo->name() + QString("-") + pInfo->version(); - szSubdir.replace(QRegExp("[^a-zA-Z0-9_\\-.][^a-zA-Z0-9_\\-.]*"),"_"); + szSubdir.replace(QRegExp("[^a-zA-Z0-9_\\-.][^a-zA-Z0-9_\\-.]*"), "_"); szTmp = QString("Theme%1Name").arg(iIdx); - f.addInfoField(szTmp,pInfo->name()); + f.addInfoField(szTmp, pInfo->name()); szTmp = QString("Theme%1Version").arg(iIdx); - f.addInfoField(szTmp,pInfo->version()); + f.addInfoField(szTmp, pInfo->version()); szTmp = QString("Theme%1Description").arg(iIdx); - f.addInfoField(szTmp,pInfo->description()); + f.addInfoField(szTmp, pInfo->description()); szTmp = QString("Theme%1Date").arg(iIdx); - f.addInfoField(szTmp,pInfo->date()); + f.addInfoField(szTmp, pInfo->date()); szTmp = QString("Theme%1Subdirectory").arg(iIdx); - f.addInfoField(szTmp,szSubdir); + f.addInfoField(szTmp, szSubdir); szTmp = QString("Theme%1Author").arg(iIdx); - f.addInfoField(szTmp,pInfo->author()); + f.addInfoField(szTmp, pInfo->author()); szTmp = QString("Theme%1Application").arg(iIdx); - f.addInfoField(szTmp,pInfo->application()); + f.addInfoField(szTmp, pInfo->application()); szTmp = QString("Theme%1ThemeEngineVersion").arg(iIdx); - f.addInfoField(szTmp,pInfo->themeEngineVersion()); + f.addInfoField(szTmp, pInfo->themeEngineVersion()); QPixmap pixScreenshot = pInfo->smallScreenshot(); if(!pixScreenshot.isNull()) { szTmp = QString("Theme%1Screenshot").arg(iIdx); QByteArray * pba = new QByteArray(); - QBuffer bufferz(pba,0); + QBuffer bufferz(pba, 0); bufferz.open(QIODevice::WriteOnly); - pixScreenshot.save(&bufferz,"PNG"); + pixScreenshot.save(&bufferz, "PNG"); bufferz.close(); - f.addInfoField(szTmp,pba); + f.addInfoField(szTmp, pba); } - if(!f.addDirectory(pInfo->directory(),szSubdir)) + if(!f.addDirectory(pInfo->directory(), szSubdir)) { - szError = __tr2qs_ctx("Packaging failed","theme"); + szError = __tr2qs_ctx("Packaging failed", "theme"); szError += ": "; szError += f.lastError(); return false; @@ -514,7 +513,7 @@ namespace ThemeFunctions if(!f.pack(szPackagePath)) { - szError = __tr2qs_ctx("Packaging failed","theme"); + szError = __tr2qs_ctx("Packaging failed", "theme"); szError += ": "; szError += f.lastError(); return false; diff --git a/src/modules/theme/ThemeFunctions.h b/src/modules/theme/ThemeFunctions.h index e427db83e..f4b68fdf9 100644 --- a/src/modules/theme/ThemeFunctions.h +++ b/src/modules/theme/ThemeFunctions.h @@ -35,37 +35,33 @@ namespace ThemeFunctions { - bool installThemePackage(const QString &szThemePackageFileName,QString &szError,QWidget * pDialogParent = 0); + bool installThemePackage(const QString & szThemePackageFileName, QString & szError, QWidget * pDialogParent = 0); void getThemeHtmlDescription( - QString &szBuffer, - const QString &szThemeName, - const QString &szThemeVersion, - const QString &szThemeDescription, - const QString &szThemeSubdirectory, - const QString &szThemeApplication, - const QString &szThemeAuthor, - const QString &szThemeDate, - const QString &szThemeThemeEngineVersion, - const QPixmap &pixScreenshot, - int iUniqueIndexInDocument = 0, - KviHtmlDialogData *hd=0 - ); + QString & szBuffer, + const QString & szThemeName, + const QString & szThemeVersion, + const QString & szThemeDescription, + const QString & szThemeSubdirectory, + const QString & szThemeApplication, + const QString & szThemeAuthor, + const QString & szThemeDate, + const QString & szThemeThemeEngineVersion, + const QPixmap & pixScreenshot, + int iUniqueIndexInDocument = 0, + KviHtmlDialogData * hd = 0); - bool makeKVIrcScreenshot(const QString &szSavePngFilePath,bool bMaximizeFrame = false); + bool makeKVIrcScreenshot(const QString & szSavePngFilePath, bool bMaximizeFrame = false); bool packageThemes( - const QString &szPackagePath, - const QString &szPackageName, - const QString &szPackageVersion, - const QString &szPackageDescription, - const QString &szPackageAuthor, - const QString &szPackageImagePath, - KviPointerList &lThemeInfo, - QString &szError - ); + const QString & szPackagePath, + const QString & szPackageName, + const QString & szPackageVersion, + const QString & szPackageDescription, + const QString & szPackageAuthor, + const QString & szPackageImagePath, + KviPointerList & lThemeInfo, + QString & szError); } - - #endif //!_THEMEFUNCTIONS_H_ diff --git a/src/modules/theme/ThemeManagementDialog.cpp b/src/modules/theme/ThemeManagementDialog.cpp index a5394a530..1358961b6 100644 --- a/src/modules/theme/ThemeManagementDialog.cpp +++ b/src/modules/theme/ThemeManagementDialog.cpp @@ -24,7 +24,7 @@ #include "kvi_settings.h" #if defined(COMPILE_WEBKIT_SUPPORT) - #include "WebThemeInterfaceDialog.h" +#include "WebThemeInterfaceDialog.h" #endif #include "ThemeManagementDialog.h" @@ -72,7 +72,7 @@ extern QRect g_rectManagementDialogGeometry; ThemeListWidgetItem::ThemeListWidgetItem(KviTalListWidget * pBox, KviThemeInfo * pInfo) -: KviTalListWidgetItem(pBox) + : KviTalListWidgetItem(pBox) { m_pThemeInfo = pInfo; @@ -91,7 +91,7 @@ ThemeListWidgetItem::ThemeListWidgetItem(KviTalListWidget * pBox, KviThemeInfo * if(!pInfo->author().isEmpty()) { szText += " "; - szText += __tr2qs_ctx("by","theme"); + szText += __tr2qs_ctx("by", "theme"); szText += " "; szText += pInfo->author(); szText += ""; @@ -111,16 +111,15 @@ ThemeListWidgetItem::~ThemeListWidgetItem() ThemeManagementDialog * ThemeManagementDialog::m_pInstance = 0; - ThemeManagementDialog::ThemeManagementDialog(QWidget * parent) -: QWidget(parent) + : QWidget(parent) { m_pItemDelegate = NULL; #ifdef COMPILE_WEBKIT_SUPPORT m_pWebThemeInterfaceDialog = NULL; #endif setObjectName("theme_options_widget"); - setWindowTitle(__tr2qs_ctx("Manage Themes - KVIrc","theme")); + setWindowTitle(__tr2qs_ctx("Manage Themes - KVIrc", "theme")); setWindowIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Theme))); m_pInstance = this; @@ -137,9 +136,9 @@ ThemeManagementDialog::ThemeManagementDialog(QWidget * parent) pTool = new QToolButton(pHBox); pTool->setIcon(*(g_pIconManager->getBigIcon(KVI_BIGICON_SAVE))); - pTool->setIconSize(QSize(32,32)); - pTool->setToolTip(__tr2qs_ctx("Save current theme...","theme")); - connect(pTool,SIGNAL(clicked()),this,SLOT(saveCurrentTheme())); + pTool->setIconSize(QSize(32, 32)); + pTool->setToolTip(__tr2qs_ctx("Save current theme...", "theme")); + connect(pTool, SIGNAL(clicked()), this, SLOT(saveCurrentTheme())); pSep = new QFrame(pHBox); pSep->setFrameStyle(QFrame::VLine | QFrame::Sunken); @@ -148,15 +147,15 @@ ThemeManagementDialog::ThemeManagementDialog(QWidget * parent) m_pPackThemeButton = new QToolButton(pHBox); m_pPackThemeButton->setIcon(*(g_pIconManager->getBigIcon(KVI_BIGICON_PACK))); - m_pPackThemeButton->setIconSize(QSize(32,32)); - m_pPackThemeButton->setToolTip(__tr2qs_ctx("Export selected themes to a distributable package","theme")); - connect(m_pPackThemeButton,SIGNAL(clicked()),this,SLOT(packTheme())); + m_pPackThemeButton->setIconSize(QSize(32, 32)); + m_pPackThemeButton->setToolTip(__tr2qs_ctx("Export selected themes to a distributable package", "theme")); + connect(m_pPackThemeButton, SIGNAL(clicked()), this, SLOT(packTheme())); m_pDeleteThemeButton = new QToolButton(pHBox); m_pDeleteThemeButton->setIcon(*(g_pIconManager->getBigIcon(KVI_BIGICON_REMOVE))); - m_pDeleteThemeButton->setIconSize(QSize(32,32)); - m_pDeleteThemeButton->setToolTip(__tr2qs_ctx("Delete selected themes","theme")); - connect(m_pDeleteThemeButton,SIGNAL(clicked()),this,SLOT(deleteTheme())); + m_pDeleteThemeButton->setIconSize(QSize(32, 32)); + m_pDeleteThemeButton->setToolTip(__tr2qs_ctx("Delete selected themes", "theme")); + connect(m_pDeleteThemeButton, SIGNAL(clicked()), this, SLOT(deleteTheme())); pSep = new QFrame(pHBox); pSep->setFrameStyle(QFrame::VLine | QFrame::Sunken); @@ -164,39 +163,38 @@ ThemeManagementDialog::ThemeManagementDialog(QWidget * parent) pTool = new QToolButton(pHBox); pTool->setIcon(*(g_pIconManager->getBigIcon(KVI_BIGICON_OPEN))); - pTool->setIconSize(QSize(32,32)); - pTool->setToolTip(__tr2qs_ctx("Install theme package from disk","theme")); - connect(pTool,SIGNAL(clicked()),this,SLOT(installFromFile())); + pTool->setIconSize(QSize(32, 32)); + pTool->setToolTip(__tr2qs_ctx("Install theme package from disk", "theme")); + connect(pTool, SIGNAL(clicked()), this, SLOT(installFromFile())); pTool = new QToolButton(pHBox); pTool->setIcon(*(g_pIconManager->getBigIcon(KVI_BIGICON_WWW))); - pTool->setIconSize(QSize(32,32)); - pTool->setToolTip(__tr2qs_ctx("Get more themes...","theme")); - connect(pTool,SIGNAL(clicked()),this,SLOT(getMoreThemes())); + pTool->setIconSize(QSize(32, 32)); + pTool->setToolTip(__tr2qs_ctx("Get more themes...", "theme")); + connect(pTool, SIGNAL(clicked()), this, SLOT(getMoreThemes())); - QWidget *w= new QWidget(pHBox); - w->setSizePolicy(QSizePolicy::Expanding,QSizePolicy::Minimum); + QWidget * w = new QWidget(pHBox); + w->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Minimum); m_pListWidget = new KviTalListWidget(this); m_pListWidget->setContextMenuPolicy(Qt::CustomContextMenu); m_pItemDelegate = new KviTalIconAndRichTextItemDelegate(m_pListWidget); - m_pItemDelegate->setDefaultIcon(g_pIconManager->getBigIcon(QString(KVI_BIGICON_THEME))->scaled(64,64,Qt::KeepAspectRatio)); // FIXME! - m_pItemDelegate->setMinimumSize(QSize(64,64)); - m_pItemDelegate->setIconSize(QSize(64,64)); + m_pItemDelegate->setDefaultIcon(g_pIconManager->getBigIcon(QString(KVI_BIGICON_THEME))->scaled(64, 64, Qt::KeepAspectRatio)); // FIXME! + m_pItemDelegate->setMinimumSize(QSize(64, 64)); + m_pItemDelegate->setIconSize(QSize(64, 64)); m_pListWidget->setItemDelegate(m_pItemDelegate); m_pListWidget->setMinimumHeight(400); m_pListWidget->setMinimumWidth(520); m_pListWidget->setSelectionMode(QAbstractItemView::ExtendedSelection); m_pListWidget->setSortingEnabled(true); - connect(m_pListWidget,SIGNAL(itemDoubleClicked(QListWidgetItem *)),this,SLOT(applyTheme(QListWidgetItem *))); - + connect(m_pListWidget, SIGNAL(itemDoubleClicked(QListWidgetItem *)), this, SLOT(applyTheme(QListWidgetItem *))); //FIXME tooltip //connect(m_pListWidget,SIGNAL(tipRequest(QListWidgetItem *,const QPoint &)),this,SLOT(tipRequest(QListWidgetItem *,const QPoint &))); - connect(m_pListWidget,SIGNAL(customContextMenuRequested(const QPoint &)), - this,SLOT(contextMenuRequested(const QPoint &))); - connect(m_pListWidget,SIGNAL(itemSelectionChanged()),this,SLOT(enableDisableButtons())); + connect(m_pListWidget, SIGNAL(customContextMenuRequested(const QPoint &)), + this, SLOT(contextMenuRequested(const QPoint &))); + connect(m_pListWidget, SIGNAL(itemSelectionChanged()), this, SLOT(enableDisableButtons())); pSep = new QFrame(this); pSep->setFrameStyle(QFrame::HLine | QFrame::Sunken); @@ -207,32 +205,32 @@ ThemeManagementDialog::ThemeManagementDialog(QWidget * parent) //g->addWidget(pSep,2,0); m_pCurrentInstalledThemeLabel = new QLabel(this); - m_pCurrentInstalledThemeLabel->setText(__tr2qs_ctx("Current Installed Theme: ","theme") + " " + KVI_OPTION_STRING(KviOption_stringIconThemeSubdir) + ""); -// g->addWidget(pLabel,2,0); + m_pCurrentInstalledThemeLabel->setText(__tr2qs_ctx("Current Installed Theme: ", "theme") + " " + KVI_OPTION_STRING(KviOption_stringIconThemeSubdir) + ""); + // g->addWidget(pLabel,2,0); pVBox->addWidget(m_pCurrentInstalledThemeLabel); pSep = new QFrame(this); pSep->setFrameStyle(QFrame::HLine | QFrame::Sunken); pSep->setMinimumWidth(400); -// g->addWidget(pSep,3,0); + // g->addWidget(pSep,3,0); pVBox->addWidget(pSep); -// g->addWidget(m_pListWidget,4,0); + // g->addWidget(m_pListWidget,4,0); pVBox->addWidget(m_pListWidget); -// KviDynamicToolTip * tip = new KviDynamicToolTip(m_pListWidget); -// connect(tip,SIGNAL(tipRequest(KviDynamicToolTip *,const QPoint &)),this,SLOT(tipRequest(KviDynamicToolTip *,const QPoint &))); + // KviDynamicToolTip * tip = new KviDynamicToolTip(m_pListWidget); + // connect(tip,SIGNAL(tipRequest(KviDynamicToolTip *,const QPoint &)),this,SLOT(tipRequest(KviDynamicToolTip *,const QPoint &))); - QPushButton * b = new QPushButton(__tr2qs("Close"),this); - b->setMaximumSize(b->sizeHint().width(),b->sizeHint().height()); - connect(b,SIGNAL(clicked()),this,SLOT(closeClicked())); -// g->addWidget(b,5,0); + QPushButton * b = new QPushButton(__tr2qs("Close"), this); + b->setMaximumSize(b->sizeHint().width(), b->sizeHint().height()); + connect(b, SIGNAL(clicked()), this, SLOT(closeClicked())); + // g->addWidget(b,5,0); pVBox->addWidget(b); -// g->setMargin(1); -// g->setSpacing(1); - pVBox->setAlignment(b,Qt::AlignRight); + // g->setMargin(1); + // g->setSpacing(1); + pVBox->setAlignment(b, Qt::AlignRight); fillThemeBox(); m_pContextPopup = new QMenu(this); @@ -241,18 +239,19 @@ ThemeManagementDialog::ThemeManagementDialog(QWidget * parent) g_rectManagementDialogGeometry.setY(5); } resize(g_rectManagementDialogGeometry.width(), - g_rectManagementDialogGeometry.height()); + g_rectManagementDialogGeometry.height()); QRect rect = g_pApp->desktop()->screenGeometry(g_pMainWindow); - move(rect.x() + ((rect.width() - g_rectManagementDialogGeometry.width())/2),rect.y() + ((rect.height() - g_rectManagementDialogGeometry.height())/2)); + move(rect.x() + ((rect.width() - g_rectManagementDialogGeometry.width()) / 2), rect.y() + ((rect.height() - g_rectManagementDialogGeometry.height()) / 2)); new QShortcut(Qt::Key_Escape, this, SLOT(closeClicked())); } ThemeManagementDialog::~ThemeManagementDialog() { - if (m_pItemDelegate) delete m_pItemDelegate; - g_rectManagementDialogGeometry = QRect(pos().x(),pos().y(),size().width(),size().height()); + if(m_pItemDelegate) + delete m_pItemDelegate; + g_rectManagementDialogGeometry = QRect(pos().x(), pos().y(), size().width(), size().height()); m_pInstance = 0; #ifdef COMPILE_WEBKIT_SUPPORT if(m_pWebThemeInterfaceDialog) @@ -279,17 +278,23 @@ void ThemeManagementDialog::display(bool bTopLevel) { m_pInstance->setParent(0); } - } else { + } + else + { if(m_pInstance->parent() != g_pMainWindow->splitter()) { m_pInstance->setParent(g_pMainWindow->splitter()); } } - } else { + } + else + { if(bTopLevel) { m_pInstance = new ThemeManagementDialog(0); - } else { + } + else + { m_pInstance = new ThemeManagementDialog(g_pMainWindow->splitter()); } } @@ -300,7 +305,8 @@ void ThemeManagementDialog::display(bool bTopLevel) void ThemeManagementDialog::cleanup() { - if(!m_pInstance)return; + if(!m_pInstance) + return; delete m_pInstance; m_pInstance = 0; } @@ -309,12 +315,13 @@ void ThemeManagementDialog::packTheme() { KviPointerList dl; dl.setAutoDelete(false); - QList itemsSelected = m_pListWidget->selectedItems (); - for(int i=0;i itemsSelected = m_pListWidget->selectedItems(); + for(int i = 0; i < itemsSelected.count(); i++) dl.append(((ThemeListWidgetItem *)itemsSelected.at(i))->themeInfo()); - if(dl.isEmpty())return; + if(dl.isEmpty()) + return; - PackThemeDialog * pDialog = new PackThemeDialog(this,&dl); + PackThemeDialog * pDialog = new PackThemeDialog(this, &dl); pDialog->exec(); pDialog->deleteLater(); } @@ -332,9 +339,9 @@ void ThemeManagementDialog::contextMenuRequested(const QPoint & pos) return; if(!pInfo->isBuiltin()) - m_pContextPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::Discard)),__tr2qs_ctx("&Remove Theme","theme"),this,SLOT(deleteTheme())); + m_pContextPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::Discard)), __tr2qs_ctx("&Remove Theme", "theme"), this, SLOT(deleteTheme())); - m_pContextPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::Accept)),__tr2qs_ctx("&Apply Theme","theme"),this,SLOT(applyCurrentTheme())); + m_pContextPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::Accept)), __tr2qs_ctx("&Apply Theme", "theme"), this, SLOT(applyCurrentTheme())); m_pContextPopup->popup(m_pListWidget->viewport()->mapToGlobal(pos)); } } @@ -352,32 +359,32 @@ void ThemeManagementDialog::applyCurrentTheme() if(!it) return; - if(!KviMessageBox::yesNo(__tr2qs_ctx("Apply Theme - KVIrc","theme"), - __tr2qs_ctx("Do you wish to apply theme \"%Q\" (version %Q)?","theme"), - &(it->themeInfo()->name()),&(it->themeInfo()->version()))) + if(!KviMessageBox::yesNo(__tr2qs_ctx("Apply Theme - KVIrc", "theme"), + __tr2qs_ctx("Do you wish to apply theme \"%Q\" (version %Q)?", "theme"), + &(it->themeInfo()->name()), &(it->themeInfo()->version()))) return; KviThemeInfo out; //qDebug("Apply theme item %x, info %x, %s : %s at location %d",(long)it,(long)it->themeInfo(),it->themeInfo()->directory().toUtf8().data(),it->themeInfo()->subdirectory().toUtf8().data(),it->themeInfo()->location()); - if(!KviTheme::apply(it->themeInfo()->subdirectory(),it->themeInfo()->location(),out)) + if(!KviTheme::apply(it->themeInfo()->subdirectory(), it->themeInfo()->location(), out)) { QString szErr = out.lastError(); - QString szMsg = QString(__tr2qs_ctx("Failed to apply the specified theme: %1","theme")).arg(szErr); - QMessageBox::critical(this,__tr2qs_ctx("Apply Theme - KVIrc","theme"),szMsg, - QMessageBox::Ok,QMessageBox::NoButton,QMessageBox::NoButton); + QString szMsg = QString(__tr2qs_ctx("Failed to apply the specified theme: %1", "theme")).arg(szErr); + QMessageBox::critical(this, __tr2qs_ctx("Apply Theme - KVIrc", "theme"), szMsg, + QMessageBox::Ok, QMessageBox::NoButton, QMessageBox::NoButton); return; } - m_pCurrentInstalledThemeLabel->setText(QString(__tr2qs_ctx("Current Installed Theme: %1","theme")).arg(KVI_OPTION_STRING(KviOption_stringIconThemeSubdir))); - m_pItemDelegate->setDefaultIcon(g_pIconManager->getBigIcon(QString(KVI_BIGICON_THEME))->scaled(64,64,Qt::KeepAspectRatio)); + m_pCurrentInstalledThemeLabel->setText(QString(__tr2qs_ctx("Current Installed Theme: %1", "theme")).arg(KVI_OPTION_STRING(KviOption_stringIconThemeSubdir))); + m_pItemDelegate->setDefaultIcon(g_pIconManager->getBigIcon(QString(KVI_BIGICON_THEME))->scaled(64, 64, Qt::KeepAspectRatio)); } void ThemeManagementDialog::deleteTheme() { QList itemsSelected = m_pListWidget->selectedItems(); - for(int i=0; i < itemsSelected.count(); i++) + for(int i = 0; i < itemsSelected.count(); i++) { ThemeListWidgetItem * pItem = dynamic_cast(itemsSelected.at(i)); if(!pItem) @@ -387,10 +394,9 @@ void ThemeManagementDialog::deleteTheme() continue; if(!KviMessageBox::yesNo( - __tr2qs_ctx("Delete Selected Theme - KVIrc","theme"), - __tr2qs_ctx("Do you really wish to delete theme \"%Q\" (version %Q)?","theme"), - &(pInfo->name()), &(pInfo->version())) - ) + __tr2qs_ctx("Delete Selected Theme - KVIrc", "theme"), + __tr2qs_ctx("Do you really wish to delete theme \"%Q\" (version %Q)?", "theme"), + &(pInfo->name()), &(pInfo->version()))) goto jump_out; QString szThemePath = ((ThemeListWidgetItem *)itemsSelected.at(i))->themeInfo()->directory(); @@ -406,17 +412,16 @@ void ThemeManagementDialog::installFromFile() QString szError; if(!KviFileDialog::askForOpenFileName( - szFileName, - __tr2qs_ctx("Select a Installation File - KVIrc","theme"), - QString(), - KVI_FILTER_THEME, - false, - true, - this) - ) + szFileName, + __tr2qs_ctx("Select a Installation File - KVIrc", "theme"), + QString(), + KVI_FILTER_THEME, + false, + true, + this)) return; - if(!ThemeFunctions::installThemePackage(szFileName,szError,this)) + if(!ThemeFunctions::installThemePackage(szFileName, szError, this)) { KviMessageBox::information(szError); return; @@ -431,9 +436,11 @@ void ThemeManagementDialog::getMoreThemes() if(m_pWebThemeInterfaceDialog) { m_pWebThemeInterfaceDialog->show(); - } else { + } + else + { m_pWebThemeInterfaceDialog = new WebThemeInterfaceDialog(); - QObject::connect(m_pWebThemeInterfaceDialog,SIGNAL(destroyed()),this,SLOT(webThemeInterfaceDialogDestroyed())); + QObject::connect(m_pWebThemeInterfaceDialog, SIGNAL(destroyed()), this, SLOT(webThemeInterfaceDialogDestroyed())); m_pWebThemeInterfaceDialog->show(); } #else @@ -462,23 +469,25 @@ void ThemeManagementDialog::saveCurrentTheme() void ThemeManagementDialog::fillThemeBox(bool bBuiltin) { QStringList slThemes; - KviTheme::installedThemeDirectories(slThemes,bBuiltin ? KviThemeInfo::Builtin : KviThemeInfo::User); + KviTheme::installedThemeDirectories(slThemes, bBuiltin ? KviThemeInfo::Builtin : KviThemeInfo::User); - for(int i=0;iload(slThemes.at(i),bBuiltin ? KviThemeInfo::Builtin : KviThemeInfo::User)) + if(inf->load(slThemes.at(i), bBuiltin ? KviThemeInfo::Builtin : KviThemeInfo::User)) { - ThemeListWidgetItem *it=new ThemeListWidgetItem(m_pListWidget,inf); + ThemeListWidgetItem * it = new ThemeListWidgetItem(m_pListWidget, inf); //qDebug("Item %x, info %x, info2 %x, %s : %s at location %d",(long)it,(long)inf,(long)it->themeInfo(),it->themeInfo()->directory().toUtf8().data(),it->themeInfo()->subdirectory().toUtf8().data(),it->themeInfo()->location()); - QPixmap pixmap=inf->smallScreenshot(); + QPixmap pixmap = inf->smallScreenshot(); if(!pixmap.isNull()) - it->setIcon(pixmap.scaled(300,280,Qt::KeepAspectRatio)); - } else { + it->setIcon(pixmap.scaled(300, 280, Qt::KeepAspectRatio)); + } + else + { delete inf; } } @@ -522,7 +531,7 @@ void ThemeManagementDialog::closeEvent(QCloseEvent * e) deleteLater(); } -void ThemeManagementDialog::tipRequest(QListWidgetItem *,const QPoint &) +void ThemeManagementDialog::tipRequest(QListWidgetItem *, const QPoint &) { // FIXME /* diff --git a/src/modules/theme/ThemeManagementDialog.h b/src/modules/theme/ThemeManagementDialog.h index b991c76c0..b09b4b2c8 100644 --- a/src/modules/theme/ThemeManagementDialog.h +++ b/src/modules/theme/ThemeManagementDialog.h @@ -40,7 +40,7 @@ #include "kvi_settings.h" #if defined(COMPILE_WEBKIT_SUPPORT) || defined(Q_MOC_RUN) - #include "WebThemeInterfaceDialog.h" +#include "WebThemeInterfaceDialog.h" #endif class QLineEdit; @@ -51,36 +51,39 @@ class KviDynamicToolTip; class ThemeListWidgetItem : public KviTalListWidgetItem { public: - ThemeListWidgetItem(KviTalListWidget * pBox,KviThemeInfo * pInfo); + ThemeListWidgetItem(KviTalListWidget * pBox, KviThemeInfo * pInfo); virtual ~ThemeListWidgetItem(); + public: KviThemeInfo * m_pThemeInfo; + public: - KviThemeInfo * themeInfo(){ return m_pThemeInfo; } + KviThemeInfo * themeInfo() { return m_pThemeInfo; } }; - class ThemeManagementDialog : public QWidget { Q_OBJECT public: ThemeManagementDialog(QWidget * parent); virtual ~ThemeManagementDialog(); + protected: - static ThemeManagementDialog * m_pInstance; + static ThemeManagementDialog * m_pInstance; KviTalIconAndRichTextItemDelegate * m_pItemDelegate; - KviTalListWidget * m_pListWidget; - QLabel * m_pCurrentInstalledThemeLabel; - QMenu * m_pContextPopup; - QToolButton * m_pDeleteThemeButton; - QToolButton * m_pPackThemeButton; + KviTalListWidget * m_pListWidget; + QLabel * m_pCurrentInstalledThemeLabel; + QMenu * m_pContextPopup; + QToolButton * m_pDeleteThemeButton; + QToolButton * m_pPackThemeButton; #if defined(COMPILE_WEBKIT_SUPPORT) || defined(Q_MOC_RUN) - WebThemeInterfaceDialog * m_pWebThemeInterfaceDialog; + WebThemeInterfaceDialog * m_pWebThemeInterfaceDialog; #endif public: - static ThemeManagementDialog * instance(){ return m_pInstance; } + static ThemeManagementDialog * instance() { return m_pInstance; } static void display(bool bTopLevel); static void cleanup(); + protected: void fillThemeBox(bool bBuiltin); virtual void closeEvent(QCloseEvent * e); diff --git a/src/modules/theme/WebThemeInterfaceDialog.cpp b/src/modules/theme/WebThemeInterfaceDialog.cpp index 7ba7c8a27..a1bf456f2 100644 --- a/src/modules/theme/WebThemeInterfaceDialog.cpp +++ b/src/modules/theme/WebThemeInterfaceDialog.cpp @@ -24,7 +24,6 @@ #include "kvi_settings.h" - #ifdef COMPILE_WEBKIT_SUPPORT #include "WebThemeInterfaceDialog.h" @@ -35,44 +34,38 @@ #include "KviIconManager.h" #include "KviLocale.h" - WebThemeInterfaceDialog::WebThemeInterfaceDialog(QWidget * par) -: KviWebPackageManagementDialog(par) + : KviWebPackageManagementDialog(par) { - setWindowTitle(__tr2qs_ctx("Download Themes - KVIrc","theme")); + setWindowTitle(__tr2qs_ctx("Download Themes - KVIrc", "theme")); // local dir for user defined themes - g_pApp->getLocalKvircDirectory(m_szLocalThemesPath,KviApplication::Themes); + g_pApp->getLocalKvircDirectory(m_szLocalThemesPath, KviApplication::Themes); m_szLocalThemesPath += KVI_PATH_SEPARATOR_CHAR; // global dir for builtin themes - g_pApp->getGlobalKvircDirectory(m_szGlobalThemesPath,KviApplication::Themes); + g_pApp->getGlobalKvircDirectory(m_szGlobalThemesPath, KviApplication::Themes); m_szGlobalThemesPath += KVI_PATH_SEPARATOR_CHAR; setPackagePageUrl( - QString::fromLatin1("http://www.kvirc.de/app/themes.php?version=" KVI_VERSION "&lang=%1") - .arg(QString::fromUtf8(KviLocale::instance()->localeName().ptr())) - ); + QString::fromLatin1("http://www.kvirc.de/app/themes.php?version=" KVI_VERSION "&lang=%1") + .arg(QString::fromUtf8(KviLocale::instance()->localeName().ptr()))); } WebThemeInterfaceDialog::~WebThemeInterfaceDialog() { } -bool WebThemeInterfaceDialog::installPackage(const QString &szPath,QString &szError) +bool WebThemeInterfaceDialog::installPackage(const QString & szPath, QString & szError) { - return ThemeFunctions::installThemePackage(szPath,szError,this); + return ThemeFunctions::installThemePackage(szPath, szError, this); } -bool WebThemeInterfaceDialog::packageIsInstalled(const QString &szId,const QString &szVersion) +bool WebThemeInterfaceDialog::packageIsInstalled(const QString & szId, const QString & szVersion) { QString szSubdir = szId + QString("-") + szVersion; - szSubdir.replace(QRegExp("[^a-zA-Z0-9_\\-.][^a-zA-Z0-9_\\-.]*"),"_"); + szSubdir.replace(QRegExp("[^a-zA-Z0-9_\\-.][^a-zA-Z0-9_\\-.]*"), "_"); - return \ - KviFileUtils::fileExists(m_szGlobalThemesPath+szSubdir) || \ - KviFileUtils::fileExists(m_szLocalThemesPath+szSubdir); + return KviFileUtils::fileExists(m_szGlobalThemesPath + szSubdir) || KviFileUtils::fileExists(m_szLocalThemesPath + szSubdir); } - - #endif //COMPILE_WEBKIT_SUPPORT diff --git a/src/modules/theme/WebThemeInterfaceDialog.h b/src/modules/theme/WebThemeInterfaceDialog.h index 7b2569391..cc517027c 100644 --- a/src/modules/theme/WebThemeInterfaceDialog.h +++ b/src/modules/theme/WebThemeInterfaceDialog.h @@ -24,19 +24,17 @@ // //============================================================================= - #include "kvi_settings.h" #ifdef COMPILE_WEBKIT_SUPPORT #include "KviWebPackageManagementDialog.h" - class WebThemeInterfaceDialog : public KviWebPackageManagementDialog { Q_OBJECT public: - WebThemeInterfaceDialog(QWidget *par=0); + WebThemeInterfaceDialog(QWidget * par = 0); ~WebThemeInterfaceDialog(); private: @@ -44,12 +42,10 @@ private: QString m_szGlobalThemesPath; protected: - virtual bool packageIsInstalled(const QString &szId,const QString &szVersion); - virtual bool installPackage(const QString &szPath,QString &szError); - + virtual bool packageIsInstalled(const QString & szId, const QString & szVersion); + virtual bool installPackage(const QString & szPath, QString & szError); }; #endif //COMPILE_WEBKIT_SUPPORT - #endif //_WEBTHEMEINTERFACEDIALOG_H_ diff --git a/src/modules/theme/libkvitheme.cpp b/src/modules/theme/libkvitheme.cpp index 9a8cfce2d..da6cca6ef 100644 --- a/src/modules/theme/libkvitheme.cpp +++ b/src/modules/theme/libkvitheme.cpp @@ -45,8 +45,7 @@ #include #include -QRect g_rectManagementDialogGeometry(0,0,0,0); - +QRect g_rectManagementDialogGeometry(0, 0, 0, 0); /* @doc: theme.install @@ -67,13 +66,13 @@ static bool theme_kvs_cmd_install(KviKvsModuleCommandCall * c) QString szThemePackFile; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("package_path",KVS_PT_STRING,0,szThemePackFile) + KVSM_PARAMETER("package_path", KVS_PT_STRING, 0, szThemePackFile) KVSM_PARAMETERS_END(c) QString szError; - if(!ThemeFunctions::installThemePackage(szThemePackFile,szError)) + if(!ThemeFunctions::installThemePackage(szThemePackFile, szError)) { - c->error(__tr2qs_ctx("Error installing theme package: %Q","theme"),&szError); + c->error(__tr2qs_ctx("Error installing theme package: %Q", "theme"), &szError); return false; } @@ -113,23 +112,23 @@ static bool theme_kvs_cmd_apply(KviKvsModuleCommandCall * c) QString szTheme; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("theme",KVS_PT_STRING,0,szTheme) + KVSM_PARAMETER("theme", KVS_PT_STRING, 0, szTheme) KVSM_PARAMETERS_END(c) KviThemeInfo out; KviThemeInfo::Location eLocation = KviThemeInfo::Auto; - if(c->switches()->find('b',"builtin")) + if(c->switches()->find('b', "builtin")) eLocation = KviThemeInfo::Builtin; - else if(c->switches()->find('e',"external")) + else if(c->switches()->find('e', "external")) eLocation = KviThemeInfo::External; - else if(c->switches()->find('u',"user")) + else if(c->switches()->find('u', "user")) eLocation = KviThemeInfo::User; - if(!KviTheme::apply(szTheme,eLocation,out)) + if(!KviTheme::apply(szTheme, eLocation, out)) { QString szErr = out.lastError(); - c->error(__tr2qs_ctx("Failed to apply theme: %Q","theme"),&szErr); + c->error(__tr2qs_ctx("Failed to apply theme: %Q", "theme"), &szErr); return false; } @@ -152,23 +151,23 @@ static bool theme_kvs_fnc_info(KviKvsModuleFunctionCall * c) QString szTheme; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("theme",KVS_PT_STRING,0,szTheme) + KVSM_PARAMETER("theme", KVS_PT_STRING, 0, szTheme) KVSM_PARAMETERS_END(c) - KviKvsHash *pHash = new KviKvsHash(); + KviKvsHash * pHash = new KviKvsHash(); c->returnValue()->setHash(pHash); KviThemeInfo theme; - if(!theme.load(szTheme,KviThemeInfo::Auto)) + if(!theme.load(szTheme, KviThemeInfo::Auto)) { - c->warning(__tr2qs_ctx("The theme package '%Q' doesn't exist","theme"),&szTheme); + c->warning(__tr2qs_ctx("The theme package '%Q' doesn't exist", "theme"), &szTheme); return true; } - pHash->set("name",new KviKvsVariant(theme.name())); - pHash->set("version",new KviKvsVariant(theme.version())); - pHash->set("author",new KviKvsVariant(theme.author())); - pHash->set("description",new KviKvsVariant(theme.description())); + pHash->set("name", new KviKvsVariant(theme.name())); + pHash->set("version", new KviKvsVariant(theme.version())); + pHash->set("author", new KviKvsVariant(theme.author())); + pHash->set("description", new KviKvsVariant(theme.description())); return true; } @@ -193,7 +192,7 @@ static bool theme_kvs_cmd_screenshot(KviKvsModuleCommandCall * c) QString szFileName; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("file_name_path",KVS_PT_STRING,KVS_PF_OPTIONAL,szFileName) + KVSM_PARAMETER("file_name_path", KVS_PT_STRING, KVS_PF_OPTIONAL, szFileName) KVSM_PARAMETERS_END(c) KviFileUtils::adjustFilePath(szFileName); @@ -202,15 +201,14 @@ static bool theme_kvs_cmd_screenshot(KviKvsModuleCommandCall * c) c->enterBlockingSection(); bool bResult = KviFileDialog::askForSaveFileName( - szTmp, - __tr2qs_ctx("Enter a Filename - KVIrc","theme"), //dialog header title - szFileName, - "*.png", - false, - false, - true, - g_pMainWindow - ); + szTmp, + __tr2qs_ctx("Enter a Filename - KVIrc", "theme"), //dialog header title + szFileName, + "*.png", + false, + false, + true, + g_pMainWindow); if(!c->leaveBlockingSection()) return false; // need to stop immediately @@ -224,13 +222,13 @@ static bool theme_kvs_cmd_screenshot(KviKvsModuleCommandCall * c) return true; // done KviFileUtils::adjustFilePath(szFileName); - if(QFileInfo(szFileName).suffix()!="png") - szFileName+=".png"; + if(QFileInfo(szFileName).suffix() != "png") + szFileName += ".png"; QString szError; if(!ThemeFunctions::makeKVIrcScreenshot(szFileName)) { - c->error(__tr2qs_ctx("Error capturing and saving screenshot!","theme")); + c->error(__tr2qs_ctx("Error capturing and saving screenshot!", "theme")); return false; } @@ -253,9 +251,9 @@ static bool theme_kvs_cmd_screenshot(KviKvsModuleCommandCall * c) otherwise it is opened as part of the current frame window.[br] */ -static bool theme_kvs_cmd_dialog(KviKvsModuleCommandCall *c) +static bool theme_kvs_cmd_dialog(KviKvsModuleCommandCall * c) { - ThemeManagementDialog::display(c->hasSwitch('t',"toplevel")); + ThemeManagementDialog::display(c->hasSwitch('t', "toplevel")); return true; } @@ -284,31 +282,31 @@ static bool theme_kvs_cmd_dialog(KviKvsModuleCommandCall *c) */ static bool theme_kvs_cmd_pack(KviKvsModuleCommandCall * c) { - QString szPath,szName,szVersion,szDescription,szAuthor,szImage; + QString szPath, szName, szVersion, szDescription, szAuthor, szImage; KviKvsArrayCast aCast; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("package_path",KVS_PT_NONEMPTYSTRING,0,szPath) - KVSM_PARAMETER("package_name",KVS_PT_NONEMPTYSTRING,0,szName) - KVSM_PARAMETER("package_version",KVS_PT_NONEMPTYSTRING,0,szVersion) - KVSM_PARAMETER("package_description",KVS_PT_STRING,0,szDescription) - KVSM_PARAMETER("package_author",KVS_PT_NONEMPTYSTRING,0,szAuthor) - KVSM_PARAMETER("package_image",KVS_PT_STRING,0,szImage) - KVSM_PARAMETER("theme",KVS_PT_ARRAYCAST,0,aCast) + KVSM_PARAMETER("package_path", KVS_PT_NONEMPTYSTRING, 0, szPath) + KVSM_PARAMETER("package_name", KVS_PT_NONEMPTYSTRING, 0, szName) + KVSM_PARAMETER("package_version", KVS_PT_NONEMPTYSTRING, 0, szVersion) + KVSM_PARAMETER("package_description", KVS_PT_STRING, 0, szDescription) + KVSM_PARAMETER("package_author", KVS_PT_NONEMPTYSTRING, 0, szAuthor) + KVSM_PARAMETER("package_image", KVS_PT_STRING, 0, szImage) + KVSM_PARAMETER("theme", KVS_PT_ARRAYCAST, 0, aCast) KVSM_PARAMETERS_END(c) KviKvsArray * pArray = aCast.array(); if((!pArray) || (pArray->size() < 1)) { - c->error(__tr2qs_ctx("No themes specified","theme")); + c->error(__tr2qs_ctx("No themes specified", "theme")); return false; } kvs_uint_t s = pArray->size(); QStringList lThemeList; - for(kvs_uint_t i=0;iat(i); if(!v) @@ -323,14 +321,13 @@ static bool theme_kvs_cmd_pack(KviKvsModuleCommandCall * c) KviPointerList lThemeInfoList; lThemeInfoList.setAutoDelete(true); - - Q_FOREACH(QString szTheme,lThemeList) + Q_FOREACH(QString szTheme, lThemeList) { KviThemeInfo * pInfo = new KviThemeInfo(); - if(!pInfo->load(szTheme,KviThemeInfo::External)) + if(!pInfo->load(szTheme, KviThemeInfo::External)) { QString szErr = pInfo->lastError(); - c->error(__tr2qs_ctx("Failed to load theme from directory %Q: %Q","theme"),&szTheme,&szErr); + c->error(__tr2qs_ctx("Failed to load theme from directory %Q: %Q", "theme"), &szTheme, &szErr); delete pInfo; return false; } @@ -340,56 +337,54 @@ static bool theme_kvs_cmd_pack(KviKvsModuleCommandCall * c) if(lThemeInfoList.isEmpty()) { - c->error(__tr2qs_ctx("No themes specified: refusing to create an empty theme package","theme")); + c->error(__tr2qs_ctx("No themes specified: refusing to create an empty theme package", "theme")); return false; } QString szError; if( - ThemeFunctions::packageThemes( - szPath, - szName, - szVersion, - szDescription, - szAuthor, - szImage, - lThemeInfoList, - szError - ) - ) + ThemeFunctions::packageThemes( + szPath, + szName, + szVersion, + szDescription, + szAuthor, + szImage, + lThemeInfoList, + szError)) return true; c->error(szError); return false; } -static bool theme_module_init(KviModule *m) +static bool theme_module_init(KviModule * m) { - KVSM_REGISTER_SIMPLE_COMMAND(m,"dialog",theme_kvs_cmd_dialog); - KVSM_REGISTER_SIMPLE_COMMAND(m,"install",theme_kvs_cmd_install); - KVSM_REGISTER_SIMPLE_COMMAND(m,"apply",theme_kvs_cmd_apply); - KVSM_REGISTER_SIMPLE_COMMAND(m,"screenshot",theme_kvs_cmd_screenshot); - KVSM_REGISTER_SIMPLE_COMMAND(m,"pack",theme_kvs_cmd_pack); + KVSM_REGISTER_SIMPLE_COMMAND(m, "dialog", theme_kvs_cmd_dialog); + KVSM_REGISTER_SIMPLE_COMMAND(m, "install", theme_kvs_cmd_install); + KVSM_REGISTER_SIMPLE_COMMAND(m, "apply", theme_kvs_cmd_apply); + KVSM_REGISTER_SIMPLE_COMMAND(m, "screenshot", theme_kvs_cmd_screenshot); + KVSM_REGISTER_SIMPLE_COMMAND(m, "pack", theme_kvs_cmd_pack); - KVSM_REGISTER_FUNCTION(m,"info",theme_kvs_fnc_info); + KVSM_REGISTER_FUNCTION(m, "info", theme_kvs_fnc_info); QString szBuf; m->getDefaultConfigFileName(szBuf); - KviConfigurationFile cfg(szBuf,KviConfigurationFile::Read); - g_rectManagementDialogGeometry = cfg.readRectEntry("EditorGeometry",QRect(10,10,390,440)); + KviConfigurationFile cfg(szBuf, KviConfigurationFile::Read); + g_rectManagementDialogGeometry = cfg.readRectEntry("EditorGeometry", QRect(10, 10, 390, 440)); return true; } -static bool theme_module_cleanup(KviModule *m) +static bool theme_module_cleanup(KviModule * m) { ThemeManagementDialog::cleanup(); QString szBuf; m->getDefaultConfigFileName(szBuf); - KviConfigurationFile cfg(szBuf,KviConfigurationFile::Write); - cfg.writeEntry("EditorGeometry",g_rectManagementDialogGeometry); + KviConfigurationFile cfg(szBuf, KviConfigurationFile::Write); + cfg.writeEntry("EditorGeometry", g_rectManagementDialogGeometry); return true; } @@ -399,15 +394,13 @@ static bool theme_module_can_unload(KviModule *) return (!ThemeManagementDialog::instance()); } - KVIRC_MODULE( - "Theme", // module name - "4.0.0", // module version - "Copyright (C) 2006 Szymon Stefanek (pragma at kvirc dot net)", // author & (C) - "Theme management functions", - theme_module_init, - theme_module_can_unload, - 0, - theme_module_cleanup, - "theme" -) + "Theme", // module name + "4.0.0", // module version + "Copyright (C) 2006 Szymon Stefanek (pragma at kvirc dot net)", // author & (C) + "Theme management functions", + theme_module_init, + theme_module_can_unload, + 0, + theme_module_cleanup, + "theme") diff --git a/src/modules/tip/libkvitip.cpp b/src/modules/tip/libkvitip.cpp index ba43604c1..d17c843a4 100644 --- a/src/modules/tip/libkvitip.cpp +++ b/src/modules/tip/libkvitip.cpp @@ -40,23 +40,23 @@ TipWindow * g_pTipWindow = 0; TipFrame::TipFrame(QWidget * par) -: QFrame(par) + : QFrame(par) { QString buffer; m_pLabel1 = new QLabel(this); m_pLabel2 = new QLabel(this); - g_pApp->findImage(buffer,"kvi_tip.png"); + g_pApp->findImage(buffer, "kvi_tip.png"); m_pLabel1->setPixmap(buffer); setStyleSheet("QFrame { background: black; }"); m_pLabel1->setStyleSheet("QLabel { background: black; }"); m_pLabel2->setStyleSheet("QLabel { background: black; color: white; }"); m_pLabel2->setWordWrap(true); - m_pLabel2->setSizePolicy(QSizePolicy::Minimum,QSizePolicy::Minimum); + m_pLabel2->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum); setFrameStyle(QFrame::Sunken | QFrame::WinPanel); - QGridLayout *layout = new QGridLayout(this); - layout->addWidget(m_pLabel1,0,0,1,1); - layout->addWidget(m_pLabel2,0,1,1,1); - layout->setColumnStretch(1,1); + QGridLayout * layout = new QGridLayout(this); + layout->addWidget(m_pLabel1, 0, 0, 1, 1); + layout->addWidget(m_pLabel2, 0, 1, 1, 1); + layout->setColumnStretch(1, 1); setLayout(layout); } @@ -65,7 +65,7 @@ TipFrame::~TipFrame() g_pTipWindow = 0; } -void TipFrame::setText(const QString &text) +void TipFrame::setText(const QString & text) { QString szText = text; m_pLabel2->setText(szText); @@ -78,63 +78,65 @@ TipWindow::TipWindow() m_pConfig = 0; m_pTipFrame = new TipFrame(this); - QPushButton * pb = new QPushButton("<<",this); - connect(pb,SIGNAL(clicked()),this,SLOT(prevTip())); + QPushButton * pb = new QPushButton("<<", this); + connect(pb, SIGNAL(clicked()), this, SLOT(prevTip())); - QPushButton * pb2 = new QPushButton(">>",this); - connect(pb2,SIGNAL(clicked()),this,SLOT(nextTip())); + QPushButton * pb2 = new QPushButton(">>", this); + connect(pb2, SIGNAL(clicked()), this, SLOT(nextTip())); - QPushButton * pb3 = new QPushButton(__tr2qs("Close"),this); - connect(pb3,SIGNAL(clicked()),this,SLOT(close())); + QPushButton * pb3 = new QPushButton(__tr2qs("Close"), this); + connect(pb3, SIGNAL(clicked()), this, SLOT(close())); pb3->setDefault(true); - m_pShowAtStartupCheck = new QCheckBox(__tr2qs("Show at startup"),this); + m_pShowAtStartupCheck = new QCheckBox(__tr2qs("Show at startup"), this); m_pShowAtStartupCheck->setChecked(KVI_OPTION_BOOL(KviOption_boolShowTipAtStartup)); setWindowIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Idea))); setWindowTitle(__tr2qs("Did You Know...")); //leave title as is - QGridLayout *layout = new QGridLayout(this); - layout->addWidget(m_pTipFrame,0,0,1,5); - layout->addWidget(m_pShowAtStartupCheck,1,0,1,1); - layout->addWidget(pb,1,2,1,1); - layout->addWidget(pb2,1,3,1,1); - layout->addWidget(pb3,1,4,1,1); + QGridLayout * layout = new QGridLayout(this); + layout->addWidget(m_pTipFrame, 0, 0, 1, 5); + layout->addWidget(m_pShowAtStartupCheck, 1, 0, 1, 1); + layout->addWidget(pb, 1, 2, 1, 1); + layout->addWidget(pb2, 1, 3, 1, 1); + layout->addWidget(pb3, 1, 4, 1, 1); setLayout(layout); pb3->setFocus(); - } TipWindow::~TipWindow() { KVI_OPTION_BOOL(KviOption_boolShowTipAtStartup) = m_pShowAtStartupCheck->isChecked(); - if(m_pConfig)closeConfig(); + if(m_pConfig) + closeConfig(); } void TipWindow::showEvent(QShowEvent *) { QRect rect = g_pApp->desktop()->screenGeometry(g_pApp->desktop()->primaryScreen()); - move((rect.width() - width())/2,(rect.height() - height())/2); + move((rect.width() - width()) / 2, (rect.height() - height()) / 2); } -bool TipWindow::openConfig(QString filename,bool bEnsureExists) +bool TipWindow::openConfig(QString filename, bool bEnsureExists) { - if(m_pConfig)closeConfig(); + if(m_pConfig) + closeConfig(); m_szConfigFileName = filename; -// m_szConfigFileName.cutToLast('/'); + // m_szConfigFileName.cutToLast('/'); QString buffer; - g_pApp->getReadOnlyConfigPath(buffer,m_szConfigFileName.toUtf8().data(),KviApplication::ConfigPlugins,true); - qDebug("Check path %s and file %s",buffer.toUtf8().data(),m_szConfigFileName.toUtf8().data()); + g_pApp->getReadOnlyConfigPath(buffer, m_szConfigFileName.toUtf8().data(), KviApplication::ConfigPlugins, true); + qDebug("Check path %s and file %s", buffer.toUtf8().data(), m_szConfigFileName.toUtf8().data()); if(bEnsureExists) { - if(!KviFileUtils::fileExists(buffer))return false; + if(!KviFileUtils::fileExists(buffer)) + return false; } - m_pConfig = new KviConfigurationFile(buffer,KviConfigurationFile::Read); + m_pConfig = new KviConfigurationFile(buffer, KviConfigurationFile::Read); return true; } @@ -142,7 +144,7 @@ bool TipWindow::openConfig(QString filename,bool bEnsureExists) void TipWindow::closeConfig() { QString buffer; - g_pApp->getLocalKvircDirectory(buffer,KviApplication::ConfigPlugins,m_szConfigFileName); + g_pApp->getLocalKvircDirectory(buffer, KviApplication::ConfigPlugins, m_szConfigFileName); m_pConfig->setSavePath(buffer); delete m_pConfig; m_pConfig = 0; @@ -154,32 +156,33 @@ void TipWindow::nextTip() { KviCString szLocale = KviLocale::instance()->localeName(); KviCString szFile; - szFile.sprintf("libkvitip_%s.kvc",szLocale.ptr()); - if(!openConfig(szFile.ptr(),true)) + szFile.sprintf("libkvitip_%s.kvc", szLocale.ptr()); + if(!openConfig(szFile.ptr(), true)) { szLocale.cutFromFirst('.'); szLocale.cutFromFirst('_'); szLocale.cutFromFirst('@'); - szFile.sprintf("libkvitip_%s.kvc",szLocale.ptr()); - if(!openConfig(szFile.ptr(),true)) + szFile.sprintf("libkvitip_%s.kvc", szLocale.ptr()); + if(!openConfig(szFile.ptr(), true)) { - openConfig("libkvitip.kvc",false); + openConfig("libkvitip.kvc", false); } } } - unsigned int uNumTips = m_pConfig->readUIntEntry("uNumTips",0); - unsigned int uCurTip = m_pConfig->readUIntEntry("uCurTip",0); + unsigned int uNumTips = m_pConfig->readUIntEntry("uNumTips", 0); + unsigned int uCurTip = m_pConfig->readUIntEntry("uCurTip", 0); uCurTip++; - if(uCurTip >= uNumTips)uCurTip = 0; + if(uCurTip >= uNumTips) + uCurTip = 0; - KviCString tmp(KviCString::Format,"%u",uCurTip); - QString szTip = m_pConfig->readEntry(tmp.ptr(),__tr2qs("Can't find any tip... :(")); + KviCString tmp(KviCString::Format, "%u", uCurTip); + QString szTip = m_pConfig->readEntry(tmp.ptr(), __tr2qs("Can't find any tip... :(")); //qDebug("REDECODED=%s",szTip.toUtf8().data()); - m_pConfig->writeEntry("uCurTip",uCurTip); + m_pConfig->writeEntry("uCurTip", uCurTip); m_pTipFrame->setText(szTip); } @@ -190,33 +193,34 @@ void TipWindow::prevTip() { KviCString szLocale = KviLocale::instance()->localeName(); KviCString szFile; - szFile.sprintf("libkvitip_%s.kvc",szLocale.ptr()); - if(!openConfig(szFile.ptr(),true)) + szFile.sprintf("libkvitip_%s.kvc", szLocale.ptr()); + if(!openConfig(szFile.ptr(), true)) { szLocale.cutFromFirst('.'); szLocale.cutFromFirst('_'); szLocale.cutFromFirst('@'); - szFile.sprintf("libkvitip_%s.kvc",szLocale.ptr()); - if(!openConfig(szFile.ptr(),true)) + szFile.sprintf("libkvitip_%s.kvc", szLocale.ptr()); + if(!openConfig(szFile.ptr(), true)) { - openConfig("libkvitip.kvc",false); + openConfig("libkvitip.kvc", false); } } } - unsigned int uNumTips = m_pConfig->readUIntEntry("uNumTips",0); - unsigned int uCurTip = m_pConfig->readUIntEntry("uCurTip",0); - + unsigned int uNumTips = m_pConfig->readUIntEntry("uNumTips", 0); + unsigned int uCurTip = m_pConfig->readUIntEntry("uCurTip", 0); - if(uCurTip == 0)uCurTip = uNumTips-1; - else uCurTip--; + if(uCurTip == 0) + uCurTip = uNumTips - 1; + else + uCurTip--; - KviCString tmp(KviCString::Format,"%u",uCurTip); - QString szTip = m_pConfig->readEntry(tmp.ptr(),__tr2qs("Can't find any tip... :(")); + KviCString tmp(KviCString::Format, "%u", uCurTip); + QString szTip = m_pConfig->readEntry(tmp.ptr(), __tr2qs("Can't find any tip... :(")); //qDebug("REDECODED=%s",szTip.toUtf8().data()); - m_pConfig->writeEntry("uCurTip",uCurTip); + m_pConfig->writeEntry("uCurTip", uCurTip); m_pTipFrame->setText(szTip); } @@ -246,26 +250,28 @@ static bool tip_kvs_cmd_open(KviKvsModuleCommandCall * c) { QString szTipfilename; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("filename",KVS_PT_STRING,KVS_PF_OPTIONAL,szTipfilename) + KVSM_PARAMETER("filename", KVS_PT_STRING, KVS_PF_OPTIONAL, szTipfilename) KVSM_PARAMETERS_END(c) - if(!g_pTipWindow)g_pTipWindow = new TipWindow(); - if (!szTipfilename.isEmpty()) + if(!g_pTipWindow) + g_pTipWindow = new TipWindow(); + if(!szTipfilename.isEmpty()) g_pTipWindow->openConfig(szTipfilename); g_pTipWindow->nextTip(); g_pTipWindow->show(); return true; } -static bool tip_module_init(KviModule *m) +static bool tip_module_init(KviModule * m) { - KVSM_REGISTER_SIMPLE_COMMAND(m,"open",tip_kvs_cmd_open); + KVSM_REGISTER_SIMPLE_COMMAND(m, "open", tip_kvs_cmd_open); return true; } static bool tip_module_cleanup(KviModule *) { - if(g_pTipWindow)g_pTipWindow->close(); + if(g_pTipWindow) + g_pTipWindow->close(); return true; } @@ -275,13 +281,12 @@ static bool tip_module_can_unload(KviModule *) } KVIRC_MODULE( - "Tip", // module name - "4.0.0", // module version - "Copyright (C) 2000 Szymon Stefanek (pragma at kvirc dot net)", // author & (C) - "\"Did you know...\" tip", - tip_module_init, - tip_module_can_unload, - 0, - tip_module_cleanup, - 0 -) + "Tip", // module name + "4.0.0", // module version + "Copyright (C) 2000 Szymon Stefanek (pragma at kvirc dot net)", // author & (C) + "\"Did you know...\" tip", + tip_module_init, + tip_module_can_unload, + 0, + tip_module_cleanup, + 0) diff --git a/src/modules/tip/libkvitip.h b/src/modules/tip/libkvitip.h index 15e3754a5..150309b5d 100644 --- a/src/modules/tip/libkvitip.h +++ b/src/modules/tip/libkvitip.h @@ -38,11 +38,13 @@ class TipFrame : public QFrame public: TipFrame(QWidget * par); ~TipFrame(); + private: - QLabel *m_pLabel1; - QLabel *m_pLabel2; + QLabel * m_pLabel1; + QLabel * m_pLabel2; + public: - void setText(const QString &text); + void setText(const QString & text); }; class TipWindow : public QWidget @@ -51,15 +53,17 @@ class TipWindow : public QWidget public: TipWindow(); ~TipWindow(); + protected: TipFrame * m_pTipFrame; - QCheckBox * m_pShowAtStartupCheck; - KviConfigurationFile * m_pConfig; - QString m_szConfigFileName; // no path! + QCheckBox * m_pShowAtStartupCheck; + KviConfigurationFile * m_pConfig; + QString m_szConfigFileName; // no path! protected: - virtual void showEvent(QShowEvent *e); + virtual void showEvent(QShowEvent * e); + public: - bool openConfig(QString filename,bool bEnsureExists = true); + bool openConfig(QString filename, bool bEnsureExists = true); void closeConfig(); public slots: void nextTip(); diff --git a/src/modules/tmphighlight/libkvitmphighlight.cpp b/src/modules/tmphighlight/libkvitmphighlight.cpp index 70c3fd3c4..8407c85f2 100644 --- a/src/modules/tmphighlight/libkvitmphighlight.cpp +++ b/src/modules/tmphighlight/libkvitmphighlight.cpp @@ -23,7 +23,6 @@ // //============================================================================= - #include "KviModule.h" #include "KviLocale.h" #include "KviChannelWindow.h" @@ -52,10 +51,12 @@ static bool tmphighlight_kvs_cmd_addnick(KviKvsModuleCommandCall * c) QString szNick; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("nick",KVS_PT_NONEMPTYSTRING,0,szNick) + KVSM_PARAMETER("nick", KVS_PT_NONEMPTYSTRING, 0, szNick) KVSM_PARAMETERS_END(c) - if( !c->window()->console() )return c->context()->errorNoIrcContext(); - if( c->window()->console()->isNotConnected() )return c->context()->errorNoIrcContext(); + if(!c->window()->console()) + return c->context()->errorNoIrcContext(); + if(c->window()->console()->isNotConnected()) + return c->context()->errorNoIrcContext(); if(c->window()->type() != KviWindow::Channel) { @@ -90,10 +91,12 @@ static bool tmphighlight_kvs_cmd_removenick(KviKvsModuleCommandCall * c) { QString szNick; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("nick",KVS_PT_NONEMPTYSTRING,0,szNick) + KVSM_PARAMETER("nick", KVS_PT_NONEMPTYSTRING, 0, szNick) KVSM_PARAMETERS_END(c) - if( !c->window()->console() )return c->context()->errorNoIrcContext(); - if( c->window()->console()->isNotConnected() )return c->context()->errorNoIrcContext(); + if(!c->window()->console()) + return c->context()->errorNoIrcContext(); + if(c->window()->console()->isNotConnected()) + return c->context()->errorNoIrcContext(); if(c->window()->type() != KviWindow::Channel) { @@ -131,12 +134,14 @@ static bool tmphighlight_kvs_cmd_addchannel(KviKvsModuleCommandCall * c) QString szWnd; KviWindow * pWnd; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("window_id",KVS_PT_STRING,KVS_PF_OPTIONAL,szWnd) + KVSM_PARAMETER("window_id", KVS_PT_STRING, KVS_PF_OPTIONAL, szWnd) KVSM_PARAMETERS_END(c) if(c->parameterList()->count() == 0) { pWnd = c->window(); - } else { + } + else + { pWnd = g_pApp->findWindow(szWnd.toUtf8().data()); if(!pWnd) { @@ -145,8 +150,10 @@ static bool tmphighlight_kvs_cmd_addchannel(KviKvsModuleCommandCall * c) } } - if( !pWnd->console() )return c->context()->errorNoIrcContext(); - if( pWnd->console()->isNotConnected() )return c->context()->errorNoIrcContext(); + if(!pWnd->console()) + return c->context()->errorNoIrcContext(); + if(pWnd->console()->isNotConnected()) + return c->context()->errorNoIrcContext(); if(pWnd->type() != KviWindow::Channel) { @@ -183,12 +190,14 @@ static bool tmphighlight_kvs_cmd_removechannel(KviKvsModuleCommandCall * c) QString szWnd; KviWindow * pWnd; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("window_id",KVS_PT_STRING,KVS_PF_OPTIONAL,szWnd) + KVSM_PARAMETER("window_id", KVS_PT_STRING, KVS_PF_OPTIONAL, szWnd) KVSM_PARAMETERS_END(c) if(c->parameterList()->count() == 0) { pWnd = c->window(); - } else { + } + else + { pWnd = g_pApp->findWindow(szWnd.toUtf8().data()); if(!pWnd) { @@ -197,8 +206,10 @@ static bool tmphighlight_kvs_cmd_removechannel(KviKvsModuleCommandCall * c) } } - if( !pWnd->console() )return c->context()->errorNoIrcContext(); - if( pWnd->console()->isNotConnected() )return c->context()->errorNoIrcContext(); + if(!pWnd->console()) + return c->context()->errorNoIrcContext(); + if(pWnd->console()->isNotConnected()) + return c->context()->errorNoIrcContext(); if(pWnd->type() != KviWindow::Channel) { @@ -233,10 +244,12 @@ static bool tmphighlight_kvs_fnc_isnickhighlighted(KviKvsModuleFunctionCall * c) { QString szNick; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("nick",KVS_PT_NONEMPTYSTRING,0,szNick) + KVSM_PARAMETER("nick", KVS_PT_NONEMPTYSTRING, 0, szNick) KVSM_PARAMETERS_END(c) - if( !c->window()->console() )return c->context()->errorNoIrcContext(); - if( c->window()->console()->isNotConnected() )return c->context()->errorNoIrcContext(); + if(!c->window()->console()) + return c->context()->errorNoIrcContext(); + if(c->window()->console()->isNotConnected()) + return c->context()->errorNoIrcContext(); if(c->window()->type() != KviWindow::Channel) { @@ -271,12 +284,14 @@ static bool tmphighlight_kvs_fnc_ischannelhighlighted(KviKvsModuleFunctionCall * QString szWnd; KviWindow * pWnd; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("window_id",KVS_PT_STRING,KVS_PF_OPTIONAL,szWnd) + KVSM_PARAMETER("window_id", KVS_PT_STRING, KVS_PF_OPTIONAL, szWnd) KVSM_PARAMETERS_END(c) if(c->parameterList()->count() == 0) { pWnd = c->window(); - } else { + } + else + { pWnd = g_pApp->findWindow(szWnd.toUtf8().data()); if(!pWnd) { @@ -285,8 +300,10 @@ static bool tmphighlight_kvs_fnc_ischannelhighlighted(KviKvsModuleFunctionCall * } } - if( !pWnd->console() )return c->context()->errorNoIrcContext(); - if( pWnd->console()->isNotConnected() )return c->context()->errorNoIrcContext(); + if(!pWnd->console()) + return c->context()->errorNoIrcContext(); + if(pWnd->console()->isNotConnected()) + return c->context()->errorNoIrcContext(); if(pWnd->type() != KviWindow::Channel) { @@ -300,12 +317,12 @@ static bool tmphighlight_kvs_fnc_ischannelhighlighted(KviKvsModuleFunctionCall * static bool tmphighlight_module_init(KviModule * m) { - KVSM_REGISTER_SIMPLE_COMMAND(m,"addNick",tmphighlight_kvs_cmd_addnick); - KVSM_REGISTER_SIMPLE_COMMAND(m,"removeNick",tmphighlight_kvs_cmd_removenick); - KVSM_REGISTER_SIMPLE_COMMAND(m,"addChannel",tmphighlight_kvs_cmd_addchannel); - KVSM_REGISTER_SIMPLE_COMMAND(m,"removeChannel",tmphighlight_kvs_cmd_removechannel); - KVSM_REGISTER_FUNCTION(m,"isNickHighLighted",tmphighlight_kvs_fnc_isnickhighlighted); - KVSM_REGISTER_FUNCTION(m,"isChannelHighLighted",tmphighlight_kvs_fnc_ischannelhighlighted); + KVSM_REGISTER_SIMPLE_COMMAND(m, "addNick", tmphighlight_kvs_cmd_addnick); + KVSM_REGISTER_SIMPLE_COMMAND(m, "removeNick", tmphighlight_kvs_cmd_removenick); + KVSM_REGISTER_SIMPLE_COMMAND(m, "addChannel", tmphighlight_kvs_cmd_addchannel); + KVSM_REGISTER_SIMPLE_COMMAND(m, "removeChannel", tmphighlight_kvs_cmd_removechannel); + KVSM_REGISTER_FUNCTION(m, "isNickHighLighted", tmphighlight_kvs_fnc_isnickhighlighted); + KVSM_REGISTER_FUNCTION(m, "isChannelHighLighted", tmphighlight_kvs_fnc_ischannelhighlighted); return true; } @@ -320,14 +337,13 @@ static bool tmphighlight_module_can_unload(KviModule *) } KVIRC_MODULE( - "TmpHighlight", // module name - "4.0.0", // module version - "(C) 2002 Juanjo Alvarez (juanjux@yahoo.es)" \ - "(C) 2009 Fabio Bas (ctrlaltca at libero dot it)", // author & (C) - "Temporary highlighting of channels and nicknames", - tmphighlight_module_init, - tmphighlight_module_can_unload, - 0, - tmphighlight_module_cleanup, - 0 -) + "TmpHighlight", // module name + "4.0.0", // module version + "(C) 2002 Juanjo Alvarez (juanjux@yahoo.es)" + "(C) 2009 Fabio Bas (ctrlaltca at libero dot it)", // author & (C) + "Temporary highlighting of channels and nicknames", + tmphighlight_module_init, + tmphighlight_module_can_unload, + 0, + tmphighlight_module_cleanup, + 0) diff --git a/src/modules/toolbar/libkvitoolbar.cpp b/src/modules/toolbar/libkvitoolbar.cpp index 38ba32d30..8db7f97ed 100644 --- a/src/modules/toolbar/libkvitoolbar.cpp +++ b/src/modules/toolbar/libkvitoolbar.cpp @@ -70,28 +70,32 @@ static bool toolbar_kvs_cmd_create(KviKvsModuleCommandCall * c) { - QString szId,szLabel,szIconId; + QString szId, szLabel, szIconId; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("id",KVS_PT_NONEMPTYSTRING,0,szId) - KVSM_PARAMETER("label",KVS_PT_STRING,KVS_PF_OPTIONAL,szLabel) - KVSM_PARAMETER("icon_id",KVS_PT_NONEMPTYSTRING,KVS_PF_OPTIONAL,szIconId) + KVSM_PARAMETER("id", KVS_PT_NONEMPTYSTRING, 0, szId) + KVSM_PARAMETER("label", KVS_PT_STRING, KVS_PF_OPTIONAL, szLabel) + KVSM_PARAMETER("icon_id", KVS_PT_NONEMPTYSTRING, KVS_PF_OPTIONAL, szIconId) KVSM_PARAMETERS_END(c) -/* if(!c->getParameterCode(1,szLabel)) + /* if(!c->getParameterCode(1,szLabel)) { c->error(__tr2qs("Internal error: call a head-shrinker")); return false; } */ - if(szLabel.isEmpty())szLabel = "$tr(Unnamed)"; + if(szLabel.isEmpty()) + szLabel = "$tr(Unnamed)"; KviCustomToolBarDescriptor * d = KviCustomToolBarManager::instance()->find(szId); if(d) { - if(!c->switches()->find('p',"preserve"))d->clear(); + if(!c->switches()->find('p', "preserve")) + d->clear(); d->rename(szLabel); - } else { - d = KviCustomToolBarManager::instance()->create(szId,szLabel); + } + else + { + d = KviCustomToolBarManager::instance()->create(szId, szLabel); } if(!szIconId.isEmpty()) @@ -127,20 +131,21 @@ static bool toolbar_kvs_cmd_clear(KviKvsModuleCommandCall * c) { QString szId; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("id",KVS_PT_NONEMPTYSTRING,0,szId) + KVSM_PARAMETER("id", KVS_PT_NONEMPTYSTRING, 0, szId) KVSM_PARAMETERS_END(c) KviCustomToolBarDescriptor * d = KviCustomToolBarManager::instance()->find(szId); - if(d)d->clear(); - else { - if(!c->switches()->find('q',"quiet")) + if(d) + d->clear(); + else + { + if(!c->switches()->find('q', "quiet")) c->warning(__tr2qs("The specified toolbar doesn't exist")); } return true; } - /* @doc: toolbar.destroy @type: @@ -166,24 +171,22 @@ static bool toolbar_kvs_cmd_clear(KviKvsModuleCommandCall * c) [cmd]toolbar.create[/cmd] */ - static bool toolbar_kvs_cmd_destroy(KviKvsModuleCommandCall * c) { QString szId; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("id",KVS_PT_NONEMPTYSTRING,0,szId) + KVSM_PARAMETER("id", KVS_PT_NONEMPTYSTRING, 0, szId) KVSM_PARAMETERS_END(c) if(!KviCustomToolBarManager::instance()->destroyDescriptor(szId)) { - if(!c->switches()->find('q',"quiet")) + if(!c->switches()->find('q', "quiet")) c->warning(__tr2qs("The specified toolbar doesn't exist")); } return true; } - /* @doc: toolbar.show @type: @@ -214,14 +217,14 @@ static bool toolbar_kvs_cmd_show(KviKvsModuleCommandCall * c) { QString szId; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("id",KVS_PT_NONEMPTYSTRING,0,szId) + KVSM_PARAMETER("id", KVS_PT_NONEMPTYSTRING, 0, szId) KVSM_PARAMETERS_END(c) KviCustomToolBarDescriptor * d = KviCustomToolBarManager::instance()->find(szId); if(!d) { - if(!c->switches()->find('q',"quiet")) + if(!c->switches()->find('q', "quiet")) c->warning(__tr2qs("The specified toolbar doesn't exist")); return true; } @@ -258,24 +261,24 @@ static bool toolbar_kvs_cmd_show(KviKvsModuleCommandCall * c) [cmd]toolbar.destroy[/cmd] */ - static bool toolbar_kvs_cmd_hide(KviKvsModuleCommandCall * c) { QString szId; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("id",KVS_PT_NONEMPTYSTRING,0,szId) + KVSM_PARAMETER("id", KVS_PT_NONEMPTYSTRING, 0, szId) KVSM_PARAMETERS_END(c) KviCustomToolBarDescriptor * d = KviCustomToolBarManager::instance()->find(szId); if(!d) { - if(!c->switches()->find('q',"quiet")) + if(!c->switches()->find('q', "quiet")) c->warning(__tr2qs("The specified toolbar doesn't exist")); return true; } - if(d->toolBar()) KviCustomToolBarManager::instance()->destroyDescriptor(d->id()); + if(d->toolBar()) + KviCustomToolBarManager::instance()->destroyDescriptor(d->id()); return true; } @@ -297,12 +300,11 @@ static bool toolbar_kvs_cmd_hide(KviKvsModuleCommandCall * c) [cmd]toolbar.create[/cmd] */ - static bool toolbar_kvs_fnc_exists(KviKvsModuleFunctionCall * c) { QString szId; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("id",KVS_PT_NONEMPTYSTRING,0,szId) + KVSM_PARAMETER("id", KVS_PT_NONEMPTYSTRING, 0, szId) KVSM_PARAMETERS_END(c) c->returnValue()->setBoolean(KviCustomToolBarManager::instance()->find(szId) ? true : false); @@ -330,7 +332,7 @@ static bool toolbar_kvs_fnc_isVisible(KviKvsModuleFunctionCall * c) { QString szId; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("id",KVS_PT_NONEMPTYSTRING,0,szId) + KVSM_PARAMETER("id", KVS_PT_NONEMPTYSTRING, 0, szId) KVSM_PARAMETERS_END(c) KviCustomToolBarDescriptor * d = KviCustomToolBarManager::instance()->find(szId); c->returnValue()->setBoolean(d ? (d->toolBar() ? true : false) : false); @@ -357,13 +359,13 @@ static bool toolbar_kvs_fnc_list(KviKvsModuleFunctionCall * c) { KviKvsArray * a = new KviKvsArray(); - KviPointerHashTableIterator it(*(KviCustomToolBarManager::instance()->descriptors())); + KviPointerHashTableIterator it(*(KviCustomToolBarManager::instance()->descriptors())); kvs_uint_t id = 0; while(KviCustomToolBarDescriptor * d = it.current()) { - a->set(id,new KviKvsVariant(d->id())); + a->set(id, new KviKvsVariant(d->id())); id++; ++it; } @@ -372,8 +374,6 @@ static bool toolbar_kvs_fnc_list(KviKvsModuleFunctionCall * c) return true; } - - /* @doc: toolbar.remove @type: @@ -410,46 +410,50 @@ static bool toolbar_kvs_cmd_removeitem(KviKvsModuleCommandCall * c) QString szId; KviKvsVariant * pvAction; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("id",KVS_PT_NONEMPTYSTRING,0,szId) - KVSM_PARAMETER("action",KVS_PT_VARIANT,0,pvAction) + KVSM_PARAMETER("id", KVS_PT_NONEMPTYSTRING, 0, szId) + KVSM_PARAMETER("action", KVS_PT_VARIANT, 0, pvAction) KVSM_PARAMETERS_END(c) KviCustomToolBarDescriptor * d = KviCustomToolBarManager::instance()->find(szId); if(!pvAction) { - if(!c->switches()->find('q',"quiet")) + if(!c->switches()->find('q', "quiet")) c->error(__tr2qs("No action name/index specified")); // syntax error return false; } if(!d) { - if(!c->switches()->find('q',"quiet")) + if(!c->switches()->find('q', "quiet")) c->warning(__tr2qs("The specified toolbar doesn't exist")); return true; } - if(c->switches()->find('i',"index")) + if(c->switches()->find('i', "index")) { kvs_int_t iAction; if(!pvAction->asInteger(iAction)) { - if(!c->switches()->find('q',"quiet")) + if(!c->switches()->find('q', "quiet")) c->warning(__tr2qs("The action parameter didn't evaluate to an index")); - } else { + } + else + { if(!d->removeAction(iAction)) { - if(!c->switches()->find('q',"quiet")) + if(!c->switches()->find('q', "quiet")) c->warning(__tr2qs("The toolbar doesn't contain the specified item")); } } - } else { + } + else + { QString szAction; pvAction->asString(szAction); if(!d->removeAction(szAction)) { - if(!c->switches()->find('q',"quiet")) + if(!c->switches()->find('q', "quiet")) c->warning(__tr2qs("The toolbar doesn't contain the specified item")); } } @@ -493,28 +497,28 @@ static bool toolbar_kvs_cmd_additem(KviKvsModuleCommandCall * c) QString szId; QString szAction; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("id",KVS_PT_NONEMPTYSTRING,0,szId) - KVSM_PARAMETER("action",KVS_PT_NONEMPTYSTRING,0,szAction) + KVSM_PARAMETER("id", KVS_PT_NONEMPTYSTRING, 0, szId) + KVSM_PARAMETER("action", KVS_PT_NONEMPTYSTRING, 0, szAction) KVSM_PARAMETERS_END(c) KviCustomToolBarDescriptor * d = KviCustomToolBarManager::instance()->find(szId); if(!d) { - if(!c->switches()->find('q',"quiet")) + if(!c->switches()->find('q', "quiet")) c->warning(__tr2qs("The specified toolbar doesn't exist")); return true; } if(!d->addAction(szAction)) { - if(!c->switches()->find('q',"quiet"))c->warning(__tr2qs("The action \"%Q\" doesn't exist"),&szAction); + if(!c->switches()->find('q', "quiet")) + c->warning(__tr2qs("The action \"%Q\" doesn't exist"), &szAction); } return true; } - /* @doc: toolbar.items @type: @@ -535,7 +539,7 @@ static bool toolbar_kvs_fnc_items(KviKvsModuleFunctionCall * c) { QString szId; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("id",KVS_PT_NONEMPTYSTRING,0,szId) + KVSM_PARAMETER("id", KVS_PT_NONEMPTYSTRING, 0, szId) KVSM_PARAMETERS_END(c) KviCustomToolBarDescriptor * d = KviCustomToolBarManager::instance()->find(szId); @@ -548,13 +552,13 @@ static bool toolbar_kvs_fnc_items(KviKvsModuleFunctionCall * c) KviKvsArray * a = new KviKvsArray(); - KviPointerHashTableIterator it(*(KviCustomToolBarManager::instance()->descriptors())); + KviPointerHashTableIterator it(*(KviCustomToolBarManager::instance()->descriptors())); kvs_uint_t id = 0; - for(QString * s = d->actions()->first();s;s = d->actions()->next()) + for(QString * s = d->actions()->first(); s; s = d->actions()->next()) { - a->set(id,new KviKvsVariant(*s)); + a->set(id, new KviKvsVariant(*s)); id++; ++it; } @@ -565,18 +569,18 @@ static bool toolbar_kvs_fnc_items(KviKvsModuleFunctionCall * c) static bool toolbar_module_init(KviModule * m) { - KVSM_REGISTER_SIMPLE_COMMAND(m,"create",toolbar_kvs_cmd_create) - KVSM_REGISTER_SIMPLE_COMMAND(m,"clear",toolbar_kvs_cmd_clear) - KVSM_REGISTER_SIMPLE_COMMAND(m,"destroy",toolbar_kvs_cmd_destroy) - KVSM_REGISTER_SIMPLE_COMMAND(m,"additem",toolbar_kvs_cmd_additem) - KVSM_REGISTER_SIMPLE_COMMAND(m,"remove",toolbar_kvs_cmd_removeitem) - KVSM_REGISTER_SIMPLE_COMMAND(m,"show",toolbar_kvs_cmd_show) - KVSM_REGISTER_SIMPLE_COMMAND(m,"hide",toolbar_kvs_cmd_hide) - - KVSM_REGISTER_FUNCTION(m,"exists",toolbar_kvs_fnc_exists) - KVSM_REGISTER_FUNCTION(m,"isVisible",toolbar_kvs_fnc_isVisible) - KVSM_REGISTER_FUNCTION(m,"list",toolbar_kvs_fnc_list) - KVSM_REGISTER_FUNCTION(m,"items",toolbar_kvs_fnc_items) + KVSM_REGISTER_SIMPLE_COMMAND(m, "create", toolbar_kvs_cmd_create) + KVSM_REGISTER_SIMPLE_COMMAND(m, "clear", toolbar_kvs_cmd_clear) + KVSM_REGISTER_SIMPLE_COMMAND(m, "destroy", toolbar_kvs_cmd_destroy) + KVSM_REGISTER_SIMPLE_COMMAND(m, "additem", toolbar_kvs_cmd_additem) + KVSM_REGISTER_SIMPLE_COMMAND(m, "remove", toolbar_kvs_cmd_removeitem) + KVSM_REGISTER_SIMPLE_COMMAND(m, "show", toolbar_kvs_cmd_show) + KVSM_REGISTER_SIMPLE_COMMAND(m, "hide", toolbar_kvs_cmd_hide) + + KVSM_REGISTER_FUNCTION(m, "exists", toolbar_kvs_fnc_exists) + KVSM_REGISTER_FUNCTION(m, "isVisible", toolbar_kvs_fnc_isVisible) + KVSM_REGISTER_FUNCTION(m, "list", toolbar_kvs_fnc_list) + KVSM_REGISTER_FUNCTION(m, "items", toolbar_kvs_fnc_items) return true; } @@ -587,13 +591,12 @@ static bool toolbar_module_cleanup(KviModule *) } KVIRC_MODULE( - "Toolbar", // module name - "4.0.0", // module version - "Copyright (C) 2002 Szymon Stefanek (pragma at kvirc dot net)", // author & (C) - "Interface to the scriptable toolbars", - toolbar_module_init, - 0, - 0, - toolbar_module_cleanup, - 0 -) + "Toolbar", // module name + "4.0.0", // module version + "Copyright (C) 2002 Szymon Stefanek (pragma at kvirc dot net)", // author & (C) + "Interface to the scriptable toolbars", + toolbar_module_init, + 0, + 0, + toolbar_module_cleanup, + 0) diff --git a/src/modules/toolbareditor/CustomizeToolBarsDialog.cpp b/src/modules/toolbareditor/CustomizeToolBarsDialog.cpp index 40c970683..0e9a7b93b 100644 --- a/src/modules/toolbareditor/CustomizeToolBarsDialog.cpp +++ b/src/modules/toolbareditor/CustomizeToolBarsDialog.cpp @@ -58,22 +58,20 @@ CustomizeToolBarsDialog * CustomizeToolBarsDialog::m_pInstance = 0; extern QRect g_rectToolBarEditorDialogGeometry; - - TrashcanLabel::TrashcanLabel(QWidget * p) -: QLabel(p) + : QLabel(p) { setPixmap(*(g_pIconManager->getBigIcon("kvi_bigicon_trashcan.png"))); - KviTalToolTip::add(this,__tr2qs_ctx("Drop here the icons from the toolbars to remove them","editor")); + KviTalToolTip::add(this, __tr2qs_ctx("Drop here the icons from the toolbars to remove them", "editor")); setFrameStyle(QFrame::Sunken | QFrame::WinPanel); setAcceptDrops(true); setAlignment(Qt::AlignCenter); - setMinimumSize(40,40); + setMinimumSize(40, 40); m_uFlashCount = 0; m_pFlashTimer = 0; - m_clrOriginal = palette().color(backgroundRole()); + m_clrOriginal = palette().color(backgroundRole()); setAutoFillBackground(true); //needed for flashing - connect(KviActionManager::instance(),SIGNAL(removeActionsHintRequest()),this,SLOT(flash())); + connect(KviActionManager::instance(), SIGNAL(removeActionsHintRequest()), this, SLOT(flash())); } TrashcanLabel::~TrashcanLabel() @@ -88,23 +86,26 @@ TrashcanLabel::~TrashcanLabel() void TrashcanLabel::flash() { m_uFlashCount = 0; - if(m_pFlashTimer)return; + if(m_pFlashTimer) + return; m_pFlashTimer = new QTimer(); - connect(m_pFlashTimer,SIGNAL(timeout()),this,SLOT(heartbeat())); + connect(m_pFlashTimer, SIGNAL(timeout()), this, SLOT(heartbeat())); m_pFlashTimer->start(200); } void TrashcanLabel::heartbeat() { m_uFlashCount++; - if(m_uFlashCount % 2){ + if(m_uFlashCount % 2) + { QPalette p = palette(); - p.setColor(backgroundRole(),QColor(0,0,0)); + p.setColor(backgroundRole(), QColor(0, 0, 0)); setPalette(p); } - else{ + else + { QPalette p = palette(); - p.setColor(backgroundRole(),m_clrOriginal); + p.setColor(backgroundRole(), m_clrOriginal); setPalette(p); } update(); @@ -118,94 +119,95 @@ void TrashcanLabel::heartbeat() void TrashcanLabel::dropEvent(QDropEvent * e) { - if(e->mimeData()->hasText()) e->acceptProposedAction(); + if(e->mimeData()->hasText()) + e->acceptProposedAction(); } void TrashcanLabel::dragEnterEvent(QDragEnterEvent * e) { - if(e->mimeData()->hasText()) e->acceptProposedAction(); + if(e->mimeData()->hasText()) + e->acceptProposedAction(); } - -CustomToolBarPropertiesDialog::CustomToolBarPropertiesDialog(QWidget * p,const QString &szText,const QString &szId,const QString &szLabel,const QString &szIconId) -: QDialog(p) +CustomToolBarPropertiesDialog::CustomToolBarPropertiesDialog(QWidget * p, const QString & szText, const QString & szId, const QString & szLabel, const QString & szIconId) + : QDialog(p) { m_szId = szId; m_szOriginalId = szId; m_szLabel = szLabel; - setWindowTitle(__tr2qs_ctx("Toolbar Properties - KVIrc","editor")); + setWindowTitle(__tr2qs_ctx("Toolbar Properties - KVIrc", "editor")); setWindowIcon(QIcon(*(g_pIconManager->getSmallIcon(KviIconManager::ToolBarEditor)))); setModal(true); QGridLayout * g = new QGridLayout(this); - QLabel * l = new QLabel(szText,this); - g->addWidget(l,0,0,1,6); + QLabel * l = new QLabel(szText, this); + g->addWidget(l, 0, 0, 1, 6); - l = new QLabel(__tr2qs_ctx("Label","editor") + ":",this); - g->addWidget(l,1,0); + l = new QLabel(__tr2qs_ctx("Label", "editor") + ":", this); + g->addWidget(l, 1, 0); m_pLabelEdit = new QLineEdit(this); - g->addWidget(m_pLabelEdit,1,1,1,5); + g->addWidget(m_pLabelEdit, 1, 1, 1, 5); m_pLabelEdit->setText(szLabel); - connect(m_pLabelEdit,SIGNAL(textChanged(const QString &)),this,SLOT(labelTextChanged(const QString &))); + connect(m_pLabelEdit, SIGNAL(textChanged(const QString &)), this, SLOT(labelTextChanged(const QString &))); - l = new QLabel(__tr2qs_ctx("Icon","editor") + ":",this); - g->addWidget(l,2,0); + l = new QLabel(__tr2qs_ctx("Icon", "editor") + ":", this); + g->addWidget(l, 2, 0); m_pIconEdit = new QLineEdit(this); m_pIconEdit->setReadOnly(true); - g->addWidget(m_pIconEdit,2,1,1,4); + g->addWidget(m_pIconEdit, 2, 1, 1, 4); m_pIconButton = new QPushButton(this); - g->addWidget(m_pIconButton,2,5,1,1); - connect(m_pIconButton,SIGNAL(clicked()),this,SLOT(iconButtonClicked())); + g->addWidget(m_pIconButton, 2, 5, 1, 1); + connect(m_pIconButton, SIGNAL(clicked()), this, SLOT(iconButtonClicked())); iconSelected(szIconId); m_pAdvanced = new QWidget(this); QGridLayout * ag = new QGridLayout(m_pAdvanced); - l = new QLabel(__tr2qs_ctx("ID","editor") + ":",m_pAdvanced); + l = new QLabel(__tr2qs_ctx("ID", "editor") + ":", m_pAdvanced); l->setMinimumWidth(100); - ag->addWidget(l,0,0); + ag->addWidget(l, 0, 0); m_pIdEdit = new QLineEdit(m_pAdvanced); - ag->addWidget(m_pIdEdit,0,1); - ag->setRowStretch(0,1); + ag->addWidget(m_pIdEdit, 0, 1); + ag->setRowStretch(0, 1); m_pIdEdit->setText(szId); - g->addWidget(m_pAdvanced,3,0,1,6); + g->addWidget(m_pAdvanced, 3, 0, 1, 6); m_pAdvanced->hide(); m_pLabelEdit->setFocus(); - QPushButton * pb = new QPushButton(__tr2qs_ctx("OK","editor"),this); - connect(pb,SIGNAL(clicked()),this,SLOT(okClicked())); + QPushButton * pb = new QPushButton(__tr2qs_ctx("OK", "editor"), this); + connect(pb, SIGNAL(clicked()), this, SLOT(okClicked())); pb->setMinimumWidth(80); - g->addWidget(pb,4,4,1,2); + g->addWidget(pb, 4, 4, 1, 2); - pb = new QPushButton(__tr2qs_ctx("Cancel","editor"),this); - connect(pb,SIGNAL(clicked()),this,SLOT(reject())); + pb = new QPushButton(__tr2qs_ctx("Cancel", "editor"), this); + connect(pb, SIGNAL(clicked()), this, SLOT(reject())); pb->setMinimumWidth(80); - g->addWidget(pb,4,3); + g->addWidget(pb, 4, 3); - m_pAdvancedButton = new QPushButton(__tr2qs_ctx("Advanced...","editor"),this); - connect(m_pAdvancedButton,SIGNAL(clicked()),this,SLOT(advancedClicked())); + m_pAdvancedButton = new QPushButton(__tr2qs_ctx("Advanced...", "editor"), this); + connect(m_pAdvancedButton, SIGNAL(clicked()), this, SLOT(advancedClicked())); m_pAdvancedButton->setMinimumWidth(110); - g->addWidget(m_pAdvancedButton,4,0,1,2); + g->addWidget(m_pAdvancedButton, 4, 0, 1, 2); - g->setRowStretch(0,1); - g->setColumnStretch(2,1); + g->setRowStretch(0, 1); + g->setColumnStretch(2, 1); } CustomToolBarPropertiesDialog::~CustomToolBarPropertiesDialog() { } -void CustomToolBarPropertiesDialog::iconSelected(const QString &szIconId) +void CustomToolBarPropertiesDialog::iconSelected(const QString & szIconId) { QPixmap * pix = g_pIconManager->getImage(szIconId); @@ -214,7 +216,9 @@ void CustomToolBarPropertiesDialog::iconSelected(const QString &szIconId) m_pIconButton->setIcon(QIcon(*pix)); m_szIconId = szIconId; m_pIconEdit->setText(szIconId); - } else { + } + else + { m_pIconButton->setText("Browse..."); m_szIconId = ""; m_pIconEdit->setText(""); @@ -223,7 +227,7 @@ void CustomToolBarPropertiesDialog::iconSelected(const QString &szIconId) void CustomToolBarPropertiesDialog::iconButtonClicked() { - KviImageDialog * dlg = new KviImageDialog(this,__tr2qs_ctx("Choose a Toolbar Icon - KVIrc","editor")); + KviImageDialog * dlg = new KviImageDialog(this, __tr2qs_ctx("Choose a Toolbar Icon - KVIrc", "editor")); if(dlg->exec() != QDialog::Accepted) { delete dlg; @@ -234,7 +238,7 @@ void CustomToolBarPropertiesDialog::iconButtonClicked() iconSelected(s); } -void CustomToolBarPropertiesDialog::labelTextChanged(const QString &s) +void CustomToolBarPropertiesDialog::labelTextChanged(const QString & s) { if(m_szOriginalId.isEmpty()) { @@ -247,7 +251,7 @@ void CustomToolBarPropertiesDialog::okClicked() { if(m_szLabel.isEmpty()) { - QMessageBox::information(this,__tr2qs_ctx("Invalid Toolbar Label - KVIrc","editor"),__tr2qs_ctx("The toolbar label can't be empty!","editor"),__tr2qs_ctx("OK","editor")); + QMessageBox::information(this, __tr2qs_ctx("Invalid Toolbar Label - KVIrc", "editor"), __tr2qs_ctx("The toolbar label can't be empty!", "editor"), __tr2qs_ctx("OK", "editor")); return; } @@ -260,11 +264,14 @@ void CustomToolBarPropertiesDialog::okClicked() { if(m_szId != m_szOriginalId) { - if(QMessageBox::information(this,__tr2qs_ctx("Duplicate Toolbar ID - KVIrc","editor"), - __tr2qs_ctx("The specified toolbar ID already exists.
" \ - "Would you like KVIrc to assign it automatically (so it doesn't " - "collide with any other toolbar) or you prefer to do it manually?","editor"), - __tr2qs_ctx("Manually","editor"),__tr2qs_ctx("Automatically","editor")) == 0)return; + if(QMessageBox::information(this, __tr2qs_ctx("Duplicate Toolbar ID - KVIrc", "editor"), + __tr2qs_ctx("The specified toolbar ID already exists.
" + "Would you like KVIrc to assign it automatically (so it doesn't " + "collide with any other toolbar) or you prefer to do it manually?", + "editor"), + __tr2qs_ctx("Manually", "editor"), __tr2qs_ctx("Automatically", "editor")) + == 0) + return; m_szId = KviCustomToolBarManager::instance()->idForNewToolBar(m_szLabel); } } @@ -279,61 +286,61 @@ void CustomToolBarPropertiesDialog::advancedClicked() if(m_pAdvanced->isVisible()) { m_pAdvanced->hide(); - m_pAdvancedButton->setText(__tr2qs_ctx("Advanced...","editor")); - } else { + m_pAdvancedButton->setText(__tr2qs_ctx("Advanced...", "editor")); + } + else + { m_pAdvanced->show(); - m_pAdvancedButton->setText(__tr2qs_ctx("Hide Advanced","editor")); + m_pAdvancedButton->setText(__tr2qs_ctx("Hide Advanced", "editor")); } - } - CustomizeToolBarsDialog::CustomizeToolBarsDialog(QWidget * p) -: QWidget(p) + : QWidget(p) { setObjectName("Toolbar_editor"); - setWindowTitle(__tr2qs_ctx("Customize Toolbars - KVIrc","editor")); + setWindowTitle(__tr2qs_ctx("Customize Toolbars - KVIrc", "editor")); setWindowIcon(*(g_pIconManager->getSmallIcon(KviIconManager::ToolBarEditor))); m_pInstance = this; QGridLayout * g = new QGridLayout(this); m_pDrawer = new KviActionDrawer(this); - g->addWidget(m_pDrawer,0,0,7,1); + g->addWidget(m_pDrawer, 0, 0, 7, 1); - QPushButton * b = new QPushButton(__tr2qs_ctx("New Toolbar","editor"),this); - connect(b,SIGNAL(clicked()),this,SLOT(newToolBar())); - g->addWidget(b,0,1); + QPushButton * b = new QPushButton(__tr2qs_ctx("New Toolbar", "editor"), this); + connect(b, SIGNAL(clicked()), this, SLOT(newToolBar())); + g->addWidget(b, 0, 1); - m_pDeleteToolBarButton = new QPushButton(__tr2qs_ctx("Delete Toolbar","editor"),this); - connect(m_pDeleteToolBarButton,SIGNAL(clicked()),this,SLOT(deleteToolBar())); - g->addWidget(m_pDeleteToolBarButton,1,1); + m_pDeleteToolBarButton = new QPushButton(__tr2qs_ctx("Delete Toolbar", "editor"), this); + connect(m_pDeleteToolBarButton, SIGNAL(clicked()), this, SLOT(deleteToolBar())); + g->addWidget(m_pDeleteToolBarButton, 1, 1); - m_pRenameToolBarButton = new QPushButton(__tr2qs_ctx("Edit Toolbar","editor"),this); - connect(m_pRenameToolBarButton,SIGNAL(clicked()),this,SLOT(renameToolBar())); - g->addWidget(m_pRenameToolBarButton,2,1); + m_pRenameToolBarButton = new QPushButton(__tr2qs_ctx("Edit Toolbar", "editor"), this); + connect(m_pRenameToolBarButton, SIGNAL(clicked()), this, SLOT(renameToolBar())); + g->addWidget(m_pRenameToolBarButton, 2, 1); QFrame * f = new QFrame(this); f->setFrameStyle(QFrame::HLine | QFrame::Sunken); - g->addWidget(f,3,1); + g->addWidget(f, 3, 1); - m_pExportToolBarButton = new QPushButton(__tr2qs_ctx("Export Toolbar","editor"),this); - connect(m_pExportToolBarButton,SIGNAL(clicked()),this,SLOT(exportToolBar())); - g->addWidget(m_pExportToolBarButton,4,1); + m_pExportToolBarButton = new QPushButton(__tr2qs_ctx("Export Toolbar", "editor"), this); + connect(m_pExportToolBarButton, SIGNAL(clicked()), this, SLOT(exportToolBar())); + g->addWidget(m_pExportToolBarButton, 4, 1); TrashcanLabel * t = new TrashcanLabel(this); - g->addWidget(t,6,1); + g->addWidget(t, 6, 1); - b = new QPushButton(__tr2qs_ctx("Close","editor"),this); - connect(b,SIGNAL(clicked()),this,SLOT(closeClicked())); - g->addWidget(b,7,1); + b = new QPushButton(__tr2qs_ctx("Close", "editor"), this); + connect(b, SIGNAL(clicked()), this, SLOT(closeClicked())); + g->addWidget(b, 7, 1); - g->setRowStretch(5,1); - g->setColumnStretch(0,1); + g->setRowStretch(5, 1); + g->setColumnStretch(0, 1); m_pDrawer->fill(); - connect(KviActionManager::instance(),SIGNAL(currentToolBarChanged()),this,SLOT(currentToolBarChanged())); + connect(KviActionManager::instance(), SIGNAL(currentToolBarChanged()), this, SLOT(currentToolBarChanged())); KviActionManager::instance()->customizeToolBarsDialogCreated(); currentToolBarChanged(); @@ -344,16 +351,16 @@ CustomizeToolBarsDialog::CustomizeToolBarsDialog(QWidget * p) } //setGeometry(KVI_OPTION_RECT(KviOption_rectRegisteredUsersDialogGeometry)); resize(g_rectToolBarEditorDialogGeometry.width(), - g_rectToolBarEditorDialogGeometry.height()); + g_rectToolBarEditorDialogGeometry.height()); move(g_rectToolBarEditorDialogGeometry.x(), - g_rectToolBarEditorDialogGeometry.y()); + g_rectToolBarEditorDialogGeometry.y()); new QShortcut(Qt::Key_Escape, this, SLOT(closeClicked())); } CustomizeToolBarsDialog::~CustomizeToolBarsDialog() { - g_rectToolBarEditorDialogGeometry = QRect(pos().x(),pos().y(),size().width(),size().height()); + g_rectToolBarEditorDialogGeometry = QRect(pos().x(), pos().y(), size().width(), size().height()); KviActionManager::instance()->customizeToolBarsDialogDestroyed(); m_pInstance = 0; @@ -368,7 +375,7 @@ void CustomizeToolBarsDialog::currentToolBarChanged() void CustomizeToolBarsDialog::showEvent(QShowEvent * e) { QRect rect = g_pApp->desktop()->screenGeometry(g_pMainWindow); - move(rect.x() + ((rect.width() - width())/2),rect.y() + ((rect.height() - height())/2)); + move(rect.x() + ((rect.width() - width()) / 2), rect.y() + ((rect.height() - height()) / 2)); QWidget::showEvent(e); } @@ -376,39 +383,46 @@ void CustomizeToolBarsDialog::showEvent(QShowEvent * e) void CustomizeToolBarsDialog::deleteToolBar() { KviCustomToolBar * t = KviActionManager::currentToolBar(); - if(!t)return; + if(!t) + return; if(QMessageBox::question(this, - __tr2qs_ctx("Confirm Toolbar Deletion - KVIrc","editor"), - __tr2qs_ctx("Do you really want to delete toolbar \"%1\"?","editor").arg(t->windowTitle()), - QMessageBox::Yes | QMessageBox::No, - QMessageBox::No) != QMessageBox::Yes)return; + __tr2qs_ctx("Confirm Toolbar Deletion - KVIrc", "editor"), + __tr2qs_ctx("Do you really want to delete toolbar \"%1\"?", "editor").arg(t->windowTitle()), + QMessageBox::Yes | QMessageBox::No, + QMessageBox::No) + != QMessageBox::Yes) + return; KviCustomToolBarManager::instance()->destroyDescriptor(t->descriptor()->id()); } void CustomizeToolBarsDialog::exportToolBar() { KviCustomToolBar * t = KviActionManager::currentToolBar(); - if(!t)return; + if(!t) + return; QString szName = QDir::homePath(); - if(!szName.endsWith(QString(KVI_PATH_SEPARATOR)))szName += KVI_PATH_SEPARATOR; + if(!szName.endsWith(QString(KVI_PATH_SEPARATOR))) + szName += KVI_PATH_SEPARATOR; szName += t->descriptor()->id(); szName += ".kvs"; QString szFile; - if(!KviFileDialog::askForSaveFileName(szFile,__tr2qs_ctx("Enter a Filename - KVIrc","editor"),szName,KVI_FILTER_SCRIPT,true,true,true,this))return; + if(!KviFileDialog::askForSaveFileName(szFile, __tr2qs_ctx("Enter a Filename - KVIrc", "editor"), szName, KVI_FILTER_SCRIPT, true, true, true, this)) + return; QString szCode; int ret = QMessageBox::question(this, - __tr2qs_ctx("Confirm Toolbar Export - KVIrc","editor"), - __tr2qs_ctx("Do you want the associated actions to be exported with the toolbar?","editor"), - __tr2qs_ctx("Yes","editor"), - __tr2qs_ctx("No","editor"), - __tr2qs_ctx("Cancel","editor")); + __tr2qs_ctx("Confirm Toolbar Export - KVIrc", "editor"), + __tr2qs_ctx("Do you want the associated actions to be exported with the toolbar?", "editor"), + __tr2qs_ctx("Yes", "editor"), + __tr2qs_ctx("No", "editor"), + __tr2qs_ctx("Cancel", "editor")); - if(ret == 2)return; + if(ret == 2) + return; bool bExportActions = ret == 0; @@ -417,7 +431,7 @@ void CustomizeToolBarsDialog::exportToolBar() KviPointerList * a = t->descriptor()->actions(); if(a) { - for(QString * s = a->first();s;s = a->next()) + for(QString * s = a->first(); s; s = a->next()) { KviAction * act = KviActionManager::instance()->getAction(*s); if(act) @@ -443,7 +457,7 @@ void CustomizeToolBarsDialog::exportToolBar() KviPointerList * aa = t->descriptor()->actions(); if(aa) { - for(QString * ss = aa->first();ss;ss = aa->next()) + for(QString * ss = aa->first(); ss; ss = aa->next()) { szCode += "toolbar.additem "; szCode += t->descriptor()->id(); @@ -457,22 +471,23 @@ void CustomizeToolBarsDialog::exportToolBar() szCode += t->descriptor()->id(); szCode += "\n"; - if(!KviFileUtils::writeFile(szFile,szCode)) + if(!KviFileUtils::writeFile(szFile, szCode)) { - QMessageBox::warning(this,__tr2qs_ctx("Write to Toolbar File Failed - KVIrc","editor"),__tr2qs_ctx("Unable to write to the toolbar file.","editor"),__tr2qs_ctx("OK","editor")); + QMessageBox::warning(this, __tr2qs_ctx("Write to Toolbar File Failed - KVIrc", "editor"), __tr2qs_ctx("Unable to write to the toolbar file.", "editor"), __tr2qs_ctx("OK", "editor")); } } void CustomizeToolBarsDialog::renameToolBar() { KviCustomToolBar * t = KviActionManager::currentToolBar(); - if(!t)return; + if(!t) + return; CustomToolBarPropertiesDialog * dlg = new CustomToolBarPropertiesDialog(this, - __tr2qs_ctx("Please specify the properties for the toolbar \"%1\"","editor").arg(t->windowTitle()), - t->descriptor()->id(), - t->descriptor()->labelCode(), - t->descriptor()->iconId()); + __tr2qs_ctx("Please specify the properties for the toolbar \"%1\"", "editor").arg(t->windowTitle()), + t->descriptor()->id(), + t->descriptor()->labelCode(), + t->descriptor()->iconId()); dlg->show(); if(dlg->exec() != QDialog::Accepted) @@ -486,18 +501,19 @@ void CustomizeToolBarsDialog::renameToolBar() QString icon = dlg->iconId(); delete dlg; - if((id == t->descriptor()->id()) && (label == t->descriptor()->labelCode()) && (icon == t->descriptor()->iconId()))return; + if((id == t->descriptor()->id()) && (label == t->descriptor()->labelCode()) && (icon == t->descriptor()->iconId())) + return; - KviCustomToolBarManager::instance()->renameDescriptor(t->descriptor()->id(),id,label); + KviCustomToolBarManager::instance()->renameDescriptor(t->descriptor()->id(), id, label); t->descriptor()->setIconId(icon); } void CustomizeToolBarsDialog::newToolBar() { CustomToolBarPropertiesDialog * dlg = new CustomToolBarPropertiesDialog(this, - __tr2qs_ctx("Please specify the properties for the new toolbar","editor"), - KviCustomToolBarManager::instance()->idForNewToolBar(__tr2qs_ctx("My Toolbar","editor")), - __tr2qs_ctx("My Toolbar","editor")); + __tr2qs_ctx("Please specify the properties for the new toolbar", "editor"), + KviCustomToolBarManager::instance()->idForNewToolBar(__tr2qs_ctx("My Toolbar", "editor")), + __tr2qs_ctx("My Toolbar", "editor")); dlg->show(); if(dlg->exec() != QDialog::Accepted) @@ -511,7 +527,7 @@ void CustomizeToolBarsDialog::newToolBar() QString icon = dlg->iconId(); delete dlg; - KviCustomToolBarDescriptor * d = KviCustomToolBarManager::instance()->create(id,label); + KviCustomToolBarDescriptor * d = KviCustomToolBarManager::instance()->create(id, label); d->setIconId(icon); KviCustomToolBar * t = d->createToolBar(); KviActionManager::instance()->setCurrentToolBar(t); @@ -524,7 +540,8 @@ void CustomizeToolBarsDialog::closeClicked() void CustomizeToolBarsDialog::cleanup() { - if(!m_pInstance)return; + if(!m_pInstance) + return; delete m_pInstance; m_pInstance = 0; } @@ -539,17 +556,23 @@ void CustomizeToolBarsDialog::display(bool bTopLevel) { m_pInstance->setParent(0); } - } else { + } + else + { if(m_pInstance->parent() != g_pMainWindow->splitter()) { m_pInstance->setParent(g_pMainWindow->splitter()); } } - } else { + } + else + { if(bTopLevel) { m_pInstance = new CustomizeToolBarsDialog(0); - } else { + } + else + { m_pInstance = new CustomizeToolBarsDialog(g_pMainWindow->splitter()); } } diff --git a/src/modules/toolbareditor/CustomizeToolBarsDialog.h b/src/modules/toolbareditor/CustomizeToolBarsDialog.h index 2abccceb5..28bf07652 100644 --- a/src/modules/toolbareditor/CustomizeToolBarsDialog.h +++ b/src/modules/toolbareditor/CustomizeToolBarsDialog.h @@ -38,27 +38,30 @@ class QPushButton; class QPushButton; class KviActionDrawer; - class CustomizeToolBarsDialog : public QWidget { Q_OBJECT protected: CustomizeToolBarsDialog(QWidget * p); + public: ~CustomizeToolBarsDialog(); + protected: KviActionDrawer * m_pDrawer; static CustomizeToolBarsDialog * m_pInstance; QPushButton * m_pDeleteToolBarButton; QPushButton * m_pRenameToolBarButton; QPushButton * m_pExportToolBarButton; + public: - static CustomizeToolBarsDialog * instance(){ return m_pInstance; }; + static CustomizeToolBarsDialog * instance() { return m_pInstance; }; static void display(bool bTopLevel); static void cleanup(); + protected: virtual void showEvent(QShowEvent * e); - virtual void closeEvent(QCloseEvent *e); + virtual void closeEvent(QCloseEvent * e); protected slots: void closeClicked(); void newToolBar(); @@ -69,13 +72,13 @@ protected slots: virtual void reject(); }; - class CustomToolBarPropertiesDialog : public QDialog { Q_OBJECT public: - CustomToolBarPropertiesDialog(QWidget * p,const QString &szText,const QString &szId = QString(),const QString &szLabel = QString(),const QString &szIconId = QString()); + CustomToolBarPropertiesDialog(QWidget * p, const QString & szText, const QString & szId = QString(), const QString & szLabel = QString(), const QString & szIconId = QString()); ~CustomToolBarPropertiesDialog(); + protected: QString m_szId; QString m_szOriginalId; @@ -87,30 +90,33 @@ protected: QLineEdit * m_pIconEdit; QPushButton * m_pIconButton; QPushButton * m_pAdvancedButton; + public: - const QString &id(){ return m_szId; }; - const QString &label(){ return m_szLabel; }; - const QString &iconId(){ return m_szIconId; }; + const QString & id() { return m_szId; }; + const QString & label() { return m_szLabel; }; + const QString & iconId() { return m_szIconId; }; protected slots: void okClicked(); void advancedClicked(); void iconButtonClicked(); - void labelTextChanged(const QString &s); + void labelTextChanged(const QString & s); + protected: - void iconSelected(const QString &szIconId); + void iconSelected(const QString & szIconId); }; - class TrashcanLabel : public QLabel { Q_OBJECT public: TrashcanLabel(QWidget * p); virtual ~TrashcanLabel(); + protected: unsigned int m_uFlashCount; QTimer * m_pFlashTimer; - QColor m_clrOriginal; + QColor m_clrOriginal; + protected: virtual void dragEnterEvent(QDragEnterEvent * e); virtual void dropEvent(QDropEvent * e); diff --git a/src/modules/toolbareditor/libkvitoolbareditor.cpp b/src/modules/toolbareditor/libkvitoolbareditor.cpp index 6af5148e3..7b0577773 100644 --- a/src/modules/toolbareditor/libkvitoolbareditor.cpp +++ b/src/modules/toolbareditor/libkvitoolbareditor.cpp @@ -31,7 +31,7 @@ #include "KviConfigurationFile.h" #include "KviApplication.h" -QRect g_rectToolBarEditorDialogGeometry(0,0,0,0); +QRect g_rectToolBarEditorDialogGeometry(0, 0, 0, 0); /* @doc: toolbareditor.open @@ -49,20 +49,19 @@ QRect g_rectToolBarEditorDialogGeometry(0,0,0,0); otherwise it is opened as part of the current frame window.[br] */ - -static bool toolbareditor_kvs_cmd_open(KviKvsModuleCommandCall *c) +static bool toolbareditor_kvs_cmd_open(KviKvsModuleCommandCall * c) { - CustomizeToolBarsDialog::display(c->hasSwitch('t',"toplevel")); + CustomizeToolBarsDialog::display(c->hasSwitch('t', "toplevel")); return true; } static bool toolbareditor_module_init(KviModule * m) { - KVSM_REGISTER_SIMPLE_COMMAND(m,"open",toolbareditor_kvs_cmd_open); + KVSM_REGISTER_SIMPLE_COMMAND(m, "open", toolbareditor_kvs_cmd_open); QString szBuf; m->getDefaultConfigFileName(szBuf); - KviConfigurationFile cfg(szBuf,KviConfigurationFile::Read); - g_rectToolBarEditorDialogGeometry = cfg.readRectEntry("EditorGeometry",QRect(10,10,390,440)); + KviConfigurationFile cfg(szBuf, KviConfigurationFile::Read); + g_rectToolBarEditorDialogGeometry = cfg.readRectEntry("EditorGeometry", QRect(10, 10, 390, 440)); return true; } @@ -72,26 +71,25 @@ static bool toolbareditor_module_can_unload(KviModule *) return (!CustomizeToolBarsDialog::instance()); } -static bool toolbareditor_module_cleanup(KviModule *m) +static bool toolbareditor_module_cleanup(KviModule * m) { CustomizeToolBarsDialog::cleanup(); QString szBuf; m->getDefaultConfigFileName(szBuf); - KviConfigurationFile cfg(szBuf,KviConfigurationFile::Write); - cfg.writeEntry("EditorGeometry",g_rectToolBarEditorDialogGeometry); + KviConfigurationFile cfg(szBuf, KviConfigurationFile::Write); + cfg.writeEntry("EditorGeometry", g_rectToolBarEditorDialogGeometry); return true; } KVIRC_MODULE( - "ToolbarEditor", // module name - "4.0.0", // module version - "Copyright (C) 2002 Szymon Stefanek (pragma at kvirc dot net)", // author & (C) - "Editor for the scriptable toolbars", - toolbareditor_module_init, - toolbareditor_module_can_unload, - 0, - toolbareditor_module_cleanup, - "editor" -) + "ToolbarEditor", // module name + "4.0.0", // module version + "Copyright (C) 2002 Szymon Stefanek (pragma at kvirc dot net)", // author & (C) + "Editor for the scriptable toolbars", + toolbareditor_module_init, + toolbareditor_module_can_unload, + 0, + toolbareditor_module_cleanup, + "editor") diff --git a/src/modules/torrent/KTorrentDbusInterface.cpp b/src/modules/torrent/KTorrentDbusInterface.cpp index 87e7a3be8..26c5a2766 100644 --- a/src/modules/torrent/KTorrentDbusInterface.cpp +++ b/src/modules/torrent/KTorrentDbusInterface.cpp @@ -28,89 +28,87 @@ #ifdef COMPILE_KDE_SUPPORT - #include "KviApplication.h" - #include "KviLocale.h" - - #include - - TORR_IMPLEMENT_DESCRIPTOR( - KTorrentDbusInterface, - "ktorrentdbus", - __tr2qs_ctx( - "An interface for KDE's excellent KTorrent client.\n" \ - "Download it from http://www.ktorrent.org\n", - "torrent" - ) - ) - - KTorrentDbusInterface::KTorrentDbusInterface() - { -// printf("KTorrentDbusInterface\n"); - -// QTimer *timer = new QTimer(this); -// connect(timer, SIGNAL(timeout()), this, SLOT(slotTimer())); -// timer->start(250, false); - - // make sure we have a list of files, - // otherwise functions dealing would - // fail if called the first time -// slotTimer(); - - } - - KTorrentDbusInterface::~KTorrentDbusInterface() - { -// printf("~KTorrentDbusInterface\n"); - } - - bool KTorrentDbusInterface::findRunningApp() - { - QDBusReply reply = QDBusConnection::sessionBus().interface()->registeredServiceNames(); - if (!reply.isValid()) /* something fishy with dbus, it won't work */ - return false; - - foreach (QString name, reply.value()) - if (name == "org.ktorrent.ktorrent") /* ktorrent is running */ - return true; - - return false; /* dbus works, ktorrent may be closed */ - } +#include "KviApplication.h" +#include "KviLocale.h" + +#include + +TORR_IMPLEMENT_DESCRIPTOR( + KTorrentDbusInterface, + "ktorrentdbus", + __tr2qs_ctx( + "An interface for KDE's excellent KTorrent client.\n" + "Download it from http://www.ktorrent.org\n", + "torrent")) + +KTorrentDbusInterface::KTorrentDbusInterface() +{ + // printf("KTorrentDbusInterface\n"); + + // QTimer *timer = new QTimer(this); + // connect(timer, SIGNAL(timeout()), this, SLOT(slotTimer())); + // timer->start(250, false); + + // make sure we have a list of files, + // otherwise functions dealing would + // fail if called the first time + // slotTimer(); +} + +KTorrentDbusInterface::~KTorrentDbusInterface() +{ + // printf("~KTorrentDbusInterface\n"); +} + +bool KTorrentDbusInterface::findRunningApp() +{ + QDBusReply reply = QDBusConnection::sessionBus().interface()->registeredServiceNames(); + if(!reply.isValid()) /* something fishy with dbus, it won't work */ + return false; + + foreach(QString name, reply.value()) + if(name == "org.ktorrent.ktorrent") /* ktorrent is running */ + return true; + + return false; /* dbus works, ktorrent may be closed */ +} + +int KTorrentDbusInterface::detect() +{ + QDBusReply reply = QDBusConnection::sessionBus().interface()->registeredServiceNames(); + if(!reply.isValid()) /* something fishy with dbus, it won't work */ + return 0; - int KTorrentDbusInterface::detect() - { - QDBusReply reply = QDBusConnection::sessionBus().interface()->registeredServiceNames(); - if (!reply.isValid()) /* something fishy with dbus, it won't work */ - return 0; + foreach(QString name, reply.value()) + if(name == "org.ktorrent.ktorrent") /* ktorrent is running */ + return 100; - foreach (QString name, reply.value()) - if (name == "org.ktorrent.ktorrent") /* ktorrent is running */ - return 100; + return 1; /* dbus works, ktorrent may be closed */ +} - return 1; /* dbus works, ktorrent may be closed */ - } - -#define KTDBUS_SIMPLE_CALL(__action) \ - QDBusInterface dbus_iface("org.ktorrent.ktorrent", "/core", \ - "org.ktorrent.KTorrent", QDBusConnection::sessionBus()); \ - QDBusMessage reply = dbus_iface.call(QDBus::Block, __action); \ - if (reply.type() == QDBusMessage::ErrorMessage) { \ - QDBusError err = reply; \ +#define KTDBUS_SIMPLE_CALL(__action) \ + QDBusInterface dbus_iface("org.ktorrent.ktorrent", "/core", \ + "org.ktorrent.KTorrent", QDBusConnection::sessionBus()); \ + QDBusMessage reply = dbus_iface.call(QDBus::Block, __action); \ + if(reply.type() == QDBusMessage::ErrorMessage) \ + { \ + QDBusError err = reply; \ qDebug("Error: %s\n%s\n", qPrintable(err.name()), qPrintable(err.message())); \ - return false; \ - } \ + return false; \ + } \ return true; - bool KTorrentDbusInterface::startAll() - { - KTDBUS_SIMPLE_CALL("startAll"); - return true; - } +bool KTorrentDbusInterface::startAll() +{ + KTDBUS_SIMPLE_CALL("startAll"); + return true; +} - bool KTorrentDbusInterface::stopAll() - { - KTDBUS_SIMPLE_CALL("stopAll"); - return true; - } +bool KTorrentDbusInterface::stopAll() +{ + KTDBUS_SIMPLE_CALL("stopAll"); + return true; +} /* void KTorrentDbusInterface::slotTimer() @@ -168,64 +166,64 @@ return true; } */ - bool KTorrentDbusInterface::start(int ) - { -/* +bool KTorrentDbusInterface::start(int) +{ + /* CHECK_RANGE_BOOL(i, m_ti.size()) qDebug("starting %s [%d]", (const char*)m_ti[i].name, m_ti[i].num); if (!voidRetIntDCOPCall("KTorrent", "start(int)", m_ti[i].num)) ERROR_RET_BOOL */ - return true; - } + return true; +} - bool KTorrentDbusInterface::stop(int ) - { -/* +bool KTorrentDbusInterface::stop(int) +{ + /* CHECK_RANGE_BOOL(i, m_ti.size()) qDebug("stopping %s [%d]", (const char*)m_ti[i].name, m_ti[i].num); if (!voidRetIntBoolDCOPCall("KTorrent", "stop(int, bool)", m_ti[i].num, true)) ERROR_RET_BOOL */ - return true; - } + return true; +} - bool KTorrentDbusInterface::announce(int ) - { -/* +bool KTorrentDbusInterface::announce(int) +{ + /* CHECK_RANGE_BOOL(i, m_ti.size()) qDebug("announcing %s [%d]", (const char*)m_ti[i].name, m_ti[i].num); if (!voidRetIntDCOPCall("KTorrent", "announce(int)", m_ti[i].num)) ERROR_RET_BOOL */ - return true; - } + return true; +} - QString KTorrentDbusInterface::state(int ) - { -/* +QString KTorrentDbusInterface::state(int) +{ + /* CHECK_RANGE_STRING(i, m_ti.size()) return m_ti[i].state; */ return QString(); - } +} - QString KTorrentDbusInterface::name(int ) - { +QString KTorrentDbusInterface::name(int) +{ /* CHECK_RANGE_STRING(i, m_ti.size()) return m_ti[i].name; */ return QString(); - } +} - int KTorrentDbusInterface::fileCount(int ) - { +int KTorrentDbusInterface::fileCount(int) +{ /* CHECK_RANGE_INT(i, m_ti.size()) @@ -236,10 +234,10 @@ return ret; */ return 0; - } +} - QString KTorrentDbusInterface::fileName(int, int ) - { +QString KTorrentDbusInterface::fileName(int, int) +{ /* CHECK_RANGE_STRING(i, m_ti.size()) @@ -252,10 +250,10 @@ return ret[file]; */ return QString(); - } +} - QString KTorrentDbusInterface::filePriority(int, int ) - { +QString KTorrentDbusInterface::filePriority(int, int) +{ /* CHECK_RANGE_STRING(i, m_ti.size()) @@ -276,10 +274,10 @@ ERROR_RET_STRING */ return QString(); - } +} - bool KTorrentDbusInterface::setFilePriority(int, int, const QString &) - { +bool KTorrentDbusInterface::setFilePriority(int, int, const QString &) +{ /* CHECK_RANGE_BOOL(i, m_ti.size()) @@ -298,17 +296,17 @@ if (!voidRetIntIntIntDCOPCall("KTorrent", "setFilePriority(int,int,int)", m_ti[i].num, file, prion)) ERROR_RET_BOOL */ - return true; - } + return true; +} - int KTorrentDbusInterface::count() - { - return 0; -// return m_ti.size(); - } +int KTorrentDbusInterface::count() +{ + return 0; + // return m_ti.size(); +} - float KTorrentDbusInterface::speedUp() - { +float KTorrentDbusInterface::speedUp() +{ /* KviQCStringList ret; if (!qcstringListRetVoidDCOPCall("KTorrent", "getInfo()", ret)) @@ -326,10 +324,10 @@ return f; */ return 0.0; - } +} - float KTorrentDbusInterface::speedDown() - { +float KTorrentDbusInterface::speedDown() +{ /* KviQCStringList ret; if (!qcstringListRetVoidDCOPCall("KTorrent", "getInfo()", ret)) @@ -347,10 +345,10 @@ return f; */ return 0.0; - } +} - float KTorrentDbusInterface::trafficUp() - { +float KTorrentDbusInterface::trafficUp() +{ /* KviQCStringList ret; if (!qcstringListRetVoidDCOPCall("KTorrent", "getInfo()", ret)) @@ -367,10 +365,10 @@ return f; */ return 0.0; - } +} - float KTorrentDbusInterface::trafficDown() - { +float KTorrentDbusInterface::trafficDown() +{ /* KviQCStringList ret; if (!qcstringListRetVoidDCOPCall("KTorrent", "getInfo()", ret)) @@ -387,7 +385,7 @@ return f; */ return 0.0; - } +} /* bool KTorrentDbusInterface::makeTorrentInfo(TorrentInfo &ti, const KviQCStringList &ret) { @@ -452,8 +450,8 @@ return true; } */ - int KTorrentDbusInterface::maxUploadSpeed() - { +int KTorrentDbusInterface::maxUploadSpeed() +{ /* int ret; if (!intRetVoidDCOPCall("KTorrent", "maxUploadRate()", ret)) @@ -464,10 +462,10 @@ return ret; */ return -1; - } +} - int KTorrentDbusInterface::maxDownloadSpeed() - { +int KTorrentDbusInterface::maxDownloadSpeed() +{ /* int ret; if (!intRetVoidDCOPCall("KTorrent", "maxDownloadRate()", ret)) @@ -478,25 +476,24 @@ return ret; */ return -1; - } +} - bool KTorrentDbusInterface::setMaxUploadSpeed(int ) - { +bool KTorrentDbusInterface::setMaxUploadSpeed(int) +{ /* if (!voidRetIntDCOPCall("KTorrent", "setMaxUploadSpeed(int)", kbytes_per_sec)) ERROR_RET_BOOL */ - return true; - } + return true; +} - bool KTorrentDbusInterface::setMaxDownloadSpeed(int ) - { +bool KTorrentDbusInterface::setMaxDownloadSpeed(int) +{ /* if (!voidRetIntDCOPCall("KTorrent", "setMaxDownloadSpeed(int)", kbytes_per_sec)) ERROR_RET_BOOL */ - return true; - } - + return true; +} #endif // COMPILE_KDE_SUPPORT diff --git a/src/modules/torrent/KTorrentDbusInterface.h b/src/modules/torrent/KTorrentDbusInterface.h index cf98e2f86..a777c2903 100644 --- a/src/modules/torrent/KTorrentDbusInterface.h +++ b/src/modules/torrent/KTorrentDbusInterface.h @@ -27,49 +27,48 @@ // //============================================================================= - #include "TorrentInterface.h" #ifdef COMPILE_KDE_SUPPORT - #include +#include - class KTorrentDbusInterface : public TorrentInterface - { - Q_OBJECT +class KTorrentDbusInterface : public TorrentInterface +{ + Q_OBJECT - public: - KTorrentDbusInterface(); - virtual ~KTorrentDbusInterface(); +public: + KTorrentDbusInterface(); + virtual ~KTorrentDbusInterface(); - virtual int detect(); + virtual int detect(); - virtual bool startAll(); - virtual bool stopAll(); + virtual bool startAll(); + virtual bool stopAll(); - virtual int count(); - virtual bool start(int i); - virtual bool stop(int i); - virtual bool announce(int i); - virtual QString state(int i); - virtual QString name(int i); - virtual int fileCount(int i); - virtual QString fileName(int i, int file); - virtual QString filePriority(int i, int file); - virtual bool setFilePriority(int i, int file, const QString &prio); + virtual int count(); + virtual bool start(int i); + virtual bool stop(int i); + virtual bool announce(int i); + virtual QString state(int i); + virtual QString name(int i); + virtual int fileCount(int i); + virtual QString fileName(int i, int file); + virtual QString filePriority(int i, int file); + virtual bool setFilePriority(int i, int file, const QString & prio); - virtual int maxUploadSpeed(); - virtual int maxDownloadSpeed(); + virtual int maxUploadSpeed(); + virtual int maxDownloadSpeed(); - virtual bool setMaxUploadSpeed(int kbytes_per_sec); - virtual bool setMaxDownloadSpeed(int kbytes_per_sec); + virtual bool setMaxUploadSpeed(int kbytes_per_sec); + virtual bool setMaxDownloadSpeed(int kbytes_per_sec); - virtual float speedUp(); - virtual float speedDown(); + virtual float speedUp(); + virtual float speedDown(); - virtual float trafficUp(); - virtual float trafficDown(); -/* + virtual float trafficUp(); + virtual float trafficDown(); + /* private slots: // polls client and extracts information. // this is done because the order of torrents returned changes @@ -108,12 +107,12 @@ QValueList m_ti; */ - private: -// bool makeTorrentInfo(TorrentInfo &ti, const KviQCStringList &ret); - bool findRunningApp(); - }; +private: + // bool makeTorrentInfo(TorrentInfo &ti, const KviQCStringList &ret); + bool findRunningApp(); +}; - TORR_DECLARE_DESCRIPTOR(KTorrentDbusInterface) +TORR_DECLARE_DESCRIPTOR(KTorrentDbusInterface) #endif // COMPILE_KDE_SUPPORT diff --git a/src/modules/torrent/StatusBarApplet.cpp b/src/modules/torrent/StatusBarApplet.cpp index 917599595..9bedd257c 100644 --- a/src/modules/torrent/StatusBarApplet.cpp +++ b/src/modules/torrent/StatusBarApplet.cpp @@ -32,63 +32,65 @@ #include "QTimer" -StatusBarApplet::StatusBarApplet(KviStatusBar *parent, KviStatusBarAppletDescriptor *desc) - : KviStatusBarApplet(parent, desc) +StatusBarApplet::StatusBarApplet(KviStatusBar * parent, KviStatusBarAppletDescriptor * desc) + : KviStatusBarApplet(parent, desc) { - QTimer *timer = new QTimer(this); + QTimer * timer = new QTimer(this); connect(timer, SIGNAL(timeout()), this, SLOT(update())); timer->setInterval(250); timer->setSingleShot(false); timer->start(250); - setText(__tr2qs_ctx("Torrent Client","torrent")); + setText(__tr2qs_ctx("Torrent Client", "torrent")); } StatusBarApplet::~StatusBarApplet() { } -static KviStatusBarApplet *CreateTorrentClientApplet(KviStatusBar *bar, KviStatusBarAppletDescriptor *desc) +static KviStatusBarApplet * CreateTorrentClientApplet(KviStatusBar * bar, KviStatusBarAppletDescriptor * desc) { KviStatusBarApplet * pApplet = new StatusBarApplet(bar, desc); pApplet->setIndex(bar->insertPermanentWidgetAtTheEnd(pApplet)); return pApplet; } -void StatusBarApplet::selfRegister(KviStatusBar *bar) +void StatusBarApplet::selfRegister(KviStatusBar * bar) { - KviStatusBarAppletDescriptor *d = new KviStatusBarAppletDescriptor( - __tr2qs_ctx("Torrent Client","torrent"), - "torrentapplet", - CreateTorrentClientApplet, - "torrent", *(g_pIconManager->getSmallIcon(KviIconManager::Away))); + KviStatusBarAppletDescriptor * d = new KviStatusBarAppletDescriptor( + __tr2qs_ctx("Torrent Client", "torrent"), + "torrentapplet", + CreateTorrentClientApplet, + "torrent", *(g_pIconManager->getSmallIcon(KviIconManager::Away))); bar->registerAppletDescriptor(d); } QString formatSize(float sz) { - if (sz >= 1024.0f*1024.0f*1024.0f) - return QString("%1 GiB").arg(sz / (1024.0f*1024.0f*1024.0f), 2, 'f', 2); - if (sz >= 1024.0f*1024.0f) - return QString("%1 MiB").arg(sz / (1024.0f*1024.0f), 2, 'f', 2); - if (sz >= 1024.0f) + if(sz >= 1024.0f * 1024.0f * 1024.0f) + return QString("%1 GiB").arg(sz / (1024.0f * 1024.0f * 1024.0f), 2, 'f', 2); + if(sz >= 1024.0f * 1024.0f) + return QString("%1 MiB").arg(sz / (1024.0f * 1024.0f), 2, 'f', 2); + if(sz >= 1024.0f) return QString("%1 KiB").arg(sz / 1024.0f, 2, 'f', 2); return QString("%1 B").arg(sz, 2, 'f', 2); } void StatusBarApplet::update() { - if (TorrentInterface::selected()) + if(TorrentInterface::selected()) { QString msg = QString("up: %1 K/s (%2), dn: %3 K/s (%4)") - .arg(TorrentInterface::selected()->speedUp(), 2) - .arg(formatSize(TorrentInterface::selected()->trafficUp())) - .arg(TorrentInterface::selected()->speedDown(), 2) - .arg(formatSize(TorrentInterface::selected()->trafficDown())); + .arg(TorrentInterface::selected()->speedUp(), 2) + .arg(formatSize(TorrentInterface::selected()->trafficUp())) + .arg(TorrentInterface::selected()->speedDown(), 2) + .arg(formatSize(TorrentInterface::selected()->trafficDown())); setText(msg); - } else { + } + else + { setText(__tr2qs_ctx("No client selected!", "torrent")); } } diff --git a/src/modules/torrent/StatusBarApplet.h b/src/modules/torrent/StatusBarApplet.h index 331ea6c26..26d3358c9 100644 --- a/src/modules/torrent/StatusBarApplet.h +++ b/src/modules/torrent/StatusBarApplet.h @@ -35,9 +35,9 @@ class StatusBarApplet : public KviStatusBarApplet { Q_OBJECT public: - StatusBarApplet(KviStatusBar *parent, KviStatusBarAppletDescriptor *desc); + StatusBarApplet(KviStatusBar * parent, KviStatusBarAppletDescriptor * desc); virtual ~StatusBarApplet(); - static void selfRegister(KviStatusBar *bar); + static void selfRegister(KviStatusBar * bar); private slots: void update(); }; diff --git a/src/modules/torrent/TorrentInterface.cpp b/src/modules/torrent/TorrentInterface.cpp index 95bdeca78..4752ca9c0 100644 --- a/src/modules/torrent/TorrentInterface.cpp +++ b/src/modules/torrent/TorrentInterface.cpp @@ -28,4 +28,4 @@ #include "KviLocale.h" -TorrentInterface *TorrentInterface::m_selected = 0; +TorrentInterface * TorrentInterface::m_selected = 0; diff --git a/src/modules/torrent/TorrentInterface.h b/src/modules/torrent/TorrentInterface.h index f913b1a59..29da5f12a 100644 --- a/src/modules/torrent/TorrentInterface.h +++ b/src/modules/torrent/TorrentInterface.h @@ -41,9 +41,9 @@ public: virtual int detect() = 0; // returns number of torrents in client - virtual int count()=0; + virtual int count() = 0; -/* + /* // path of torrent file virtual QCString getTorrentFile(int i)=0; @@ -51,22 +51,22 @@ public: virtual QCString getTorrentDataDir(int i)=0; */ // number of files in torrent - virtual int fileCount(int i)=0; + virtual int fileCount(int i) = 0; // name of file in torrent - virtual QString fileName(int i, int file)=0; + virtual QString fileName(int i, int file) = 0; // returns file priority (low, normal, high) - virtual QString filePriority(int i, int file)=0; + virtual QString filePriority(int i, int file) = 0; // sets file priority - virtual bool setFilePriority(int i, int file, const QString &prio)=0; + virtual bool setFilePriority(int i, int file, const QString & prio) = 0; - virtual bool start(int i)=0; - virtual bool stop(int i)=0; + virtual bool start(int i) = 0; + virtual bool stop(int i) = 0; - virtual bool announce(int i)=0; + virtual bool announce(int i) = 0; - virtual bool startAll()=0; - virtual bool stopAll()=0; -/* + virtual bool startAll() = 0; + virtual bool stopAll() = 0; + /* // remove torrent from client virtual bool removeTorrent(int i)=0; @@ -75,85 +75,89 @@ public: // returns state of torrent number i (Stopped, Stalled, Seeding, Downloading) // this uses getTorrentInfo() to obtain the state and then // returns it as string - virtual QString state(int i)=0; + virtual QString state(int i) = 0; // name of torrent as displayed in client // uses getTorrentInfo() - virtual QString name(int i)=0; + virtual QString name(int i) = 0; - virtual float speedUp()=0; - virtual float speedDown()=0; + virtual float speedUp() = 0; + virtual float speedDown() = 0; - virtual float trafficUp()=0; - virtual float trafficDown()=0; + virtual float trafficUp() = 0; + virtual float trafficDown() = 0; - virtual int maxUploadSpeed()=0; - virtual int maxDownloadSpeed()=0; + virtual int maxUploadSpeed() = 0; + virtual int maxDownloadSpeed() = 0; - virtual bool setMaxUploadSpeed(int kbytes_per_sec)=0; - virtual bool setMaxDownloadSpeed(int kbytes_per_sec)=0; + virtual bool setMaxUploadSpeed(int kbytes_per_sec) = 0; + virtual bool setMaxDownloadSpeed(int kbytes_per_sec) = 0; QString lastError() { return m_lastError; } - static void select(TorrentInterface *i) { m_selected = i; } - static TorrentInterface *selected() { return m_selected; } + static void select(TorrentInterface * i) { m_selected = i; } + static TorrentInterface * selected() { return m_selected; } protected: - QString m_lastError; - static TorrentInterface *m_selected; + QString m_lastError; + static TorrentInterface * m_selected; }; class TorrentInterfaceDescriptor { public: - TorrentInterfaceDescriptor() {}; - virtual ~TorrentInterfaceDescriptor() {}; + TorrentInterfaceDescriptor(){}; + virtual ~TorrentInterfaceDescriptor(){}; + public: virtual const QString & name() = 0; virtual const QString & description() = 0; virtual TorrentInterface * instance() = 0; }; -#define TORR_DECLARE_DESCRIPTOR(_interfaceclass) \ - class _interfaceclass ## Descriptor : public TorrentInterfaceDescriptor \ - { \ - public: \ - _interfaceclass ## Descriptor(); \ - virtual ~_interfaceclass ## Descriptor(); \ - protected: \ - _interfaceclass * m_pInstance; \ - QString m_szName; \ - QString m_szDescription; \ - public: \ - virtual const QString & name(); \ - virtual const QString & description(); \ - virtual TorrentInterface * instance(); \ +#define TORR_DECLARE_DESCRIPTOR(_interfaceclass) \ + class _interfaceclass##Descriptor : public TorrentInterfaceDescriptor \ + { \ + public: \ + _interfaceclass##Descriptor(); \ + virtual ~_interfaceclass##Descriptor(); \ + \ + protected: \ + _interfaceclass * m_pInstance; \ + QString m_szName; \ + QString m_szDescription; \ + \ + public: \ + virtual const QString & name(); \ + virtual const QString & description(); \ + virtual TorrentInterface * instance(); \ }; -#define TORR_IMPLEMENT_DESCRIPTOR(_interfaceclass,_name,_description) \ - _interfaceclass ## Descriptor::_interfaceclass ## Descriptor() \ - : TorrentInterfaceDescriptor() \ - { \ - m_pInstance = 0; \ - m_szName = _name; \ - m_szDescription = _description; \ - } \ - _interfaceclass ## Descriptor::~_interfaceclass ## Descriptor() \ - { \ - delete m_pInstance; \ - } \ - const QString & _interfaceclass ## Descriptor::name() \ - { \ - return m_szName; \ - } \ - const QString & _interfaceclass ## Descriptor::description() \ - { \ - return m_szDescription; \ - } \ - TorrentInterface * _interfaceclass ## Descriptor::instance() \ - { \ - if (!m_pInstance) m_pInstance = new _interfaceclass(); \ - return m_pInstance; \ +#define TORR_IMPLEMENT_DESCRIPTOR(_interfaceclass, _name, _description) \ + _interfaceclass##Descriptor::_interfaceclass##Descriptor() \ + : TorrentInterfaceDescriptor() \ + { \ + m_pInstance = 0; \ + m_szName = _name; \ + m_szDescription = _description; \ + } \ + _interfaceclass##Descriptor::~_interfaceclass##Descriptor() \ + { \ + delete m_pInstance; \ + } \ + const QString & _interfaceclass##Descriptor::name() \ + { \ + return m_szName; \ + } \ + const QString & _interfaceclass##Descriptor::description() \ + { \ + return m_szDescription; \ + } \ + TorrentInterface * _interfaceclass##Descriptor::instance() \ + { \ + if(!m_pInstance) \ + m_pInstance = new _interfaceclass(); \ + return m_pInstance; \ } #endif // _TC_INTERFACE_H_ diff --git a/src/modules/torrent/libkvitorrent.cpp b/src/modules/torrent/libkvitorrent.cpp index aacd461c8..46365584e 100644 --- a/src/modules/torrent/libkvitorrent.cpp +++ b/src/modules/torrent/libkvitorrent.cpp @@ -22,7 +22,6 @@ // //============================================================================= - #include "TorrentInterface.h" #include "KTorrentDbusInterface.h" #include "StatusBarApplet.h" @@ -35,18 +34,18 @@ static KviPointerList * g_pDescriptorList = 0; -static TorrentInterface *auto_detect_torrent_client(KviWindow * pOut = 0) +static TorrentInterface * auto_detect_torrent_client(KviWindow * pOut = 0) { int iBest = 0; TorrentInterface * pBest = 0; TorrentInterfaceDescriptor * d; TorrentInterfaceDescriptor * pDBest = 0; - for (d=g_pDescriptorList->first(); d!=0; d=g_pDescriptorList->next()) + for(d = g_pDescriptorList->first(); d != 0; d = g_pDescriptorList->next()) { // instance gets deleted by descriptor later - TorrentInterface *i = d->instance(); - if (i) + TorrentInterface * i = d->instance(); + if(i) { int iScore = i->detect(); if(iScore > iBest) @@ -59,14 +58,14 @@ static TorrentInterface *auto_detect_torrent_client(KviWindow * pOut = 0) if(pOut) { pOut->output(KVI_OUT_TORRENT, - __tr2qs_ctx("Trying torrent client interface \"%Q\": score %d", "torrent"), - &d->name(), - iScore); + __tr2qs_ctx("Trying torrent client interface \"%Q\": score %d", "torrent"), + &d->name(), + iScore); } } } -/* if(iBest < 90) + /* if(iBest < 90) { if(pOut) pOut->outputNoFmt(KVI_OUT_MULTIMEDIA,__tr2qs_ctx("Not sure about the results, trying a second, more aggressive detection pass","torrent")); @@ -99,174 +98,174 @@ static TorrentInterface *auto_detect_torrent_client(KviWindow * pOut = 0) KVI_OPTION_STRING(KviOption_stringPreferredTorrentClient) = pDBest->name(); if(pOut) pOut->output(KVI_OUT_TORRENT, - __tr2qs_ctx("Choosing torrent client interface \"%Q\"", "torrent"), - &pDBest->name()); - - } else + __tr2qs_ctx("Choosing torrent client interface \"%Q\"", "torrent"), + &pDBest->name()); + } + else { if(pOut) pOut->outputNoFmt(KVI_OUT_TORRENT, - __tr2qs_ctx("Seems that there is no usable torrent client on this machine", "torrent")); + __tr2qs_ctx("Seems that there is no usable torrent client on this machine", "torrent")); } return pBest; } -#define TC_KVS_FAIL_ON_NO_INTERFACE \ - if (!TorrentInterface::selected()) \ - { \ +#define TC_KVS_FAIL_ON_NO_INTERFACE \ + if(!TorrentInterface::selected()) \ + { \ c->warning(__tr2qs_ctx("No torrent client interface selected. Try /torrent.detect", "torrent")); \ - return true; \ + return true; \ + } + +#define TC_KVS_COMMAND(__name) static bool torrent_kvs_cmd_##__name(KviKvsModuleCommandCall * c) +#define TC_KVS_FUNCTION(__name) static bool torrent_kvs_fnc_##__name(KviKvsModuleFunctionCall * c) + +#define TC_KVS_COMMAND_ERROR \ + if(!c->hasSwitch('q', "quiet")) \ + { \ + c->warning(__tr2qs_ctx("The selected torrent client interface failed to execute the requested function", "torrent")); \ + QString tmp = __tr2qs_ctx("Last interface error: ", "torrent"); \ + tmp += TorrentInterface::selected()->lastError(); \ + c->warning(tmp); \ } -#define TC_KVS_COMMAND(__name) static bool torrent_kvs_cmd_ ## __name (KviKvsModuleCommandCall * c) -#define TC_KVS_FUNCTION(__name) static bool torrent_kvs_fnc_ ## __name (KviKvsModuleFunctionCall * c) - -#define TC_KVS_COMMAND_ERROR \ - if (!c->hasSwitch('q',"quiet")) \ - { \ - c->warning(__tr2qs_ctx("The selected torrent client interface failed to execute the requested function", "torrent")); \ - QString tmp = __tr2qs_ctx("Last interface error: ", "torrent"); \ - tmp += TorrentInterface::selected()->lastError(); \ - c->warning(tmp); \ - } \ - -#define TC_KVS_SIMPLE_COMMAND(__name, __ifacecommand) \ - TC_KVS_COMMAND(__name) \ - { \ - KVSM_PARAMETERS_BEGIN(c) \ - KVSM_PARAMETERS_END(c) \ - \ - TC_KVS_FAIL_ON_NO_INTERFACE \ - \ - if (!TorrentInterface::selected()->__ifacecommand()) \ - { \ - TC_KVS_COMMAND_ERROR \ - } \ - return true; \ +#define TC_KVS_SIMPLE_COMMAND(__name, __ifacecommand) \ + TC_KVS_COMMAND(__name) \ + { \ + KVSM_PARAMETERS_BEGIN(c) \ + KVSM_PARAMETERS_END(c) \ + \ + TC_KVS_FAIL_ON_NO_INTERFACE \ + \ + if(!TorrentInterface::selected()->__ifacecommand()) \ + { \ + TC_KVS_COMMAND_ERROR \ + } \ + return true; \ } -#define TC_KVS_INT_COMMAND(__name, __ifacecommand, __argname) \ - TC_KVS_COMMAND(__name) \ - { \ - kvs_int_t arg; \ - KVSM_PARAMETERS_BEGIN(c) \ - KVSM_PARAMETER(__argname, KVS_PT_INT, 0, arg) \ - KVSM_PARAMETERS_END(c) \ - \ - TC_KVS_FAIL_ON_NO_INTERFACE \ - \ - if (!TorrentInterface::selected()->__ifacecommand(arg)) \ - { \ - TC_KVS_COMMAND_ERROR \ - } \ - return true; \ +#define TC_KVS_INT_COMMAND(__name, __ifacecommand, __argname) \ + TC_KVS_COMMAND(__name) \ + { \ + kvs_int_t arg; \ + KVSM_PARAMETERS_BEGIN(c) \ + KVSM_PARAMETER(__argname, KVS_PT_INT, 0, arg) \ + KVSM_PARAMETERS_END(c) \ + \ + TC_KVS_FAIL_ON_NO_INTERFACE \ + \ + if(!TorrentInterface::selected()->__ifacecommand(arg)) \ + { \ + TC_KVS_COMMAND_ERROR \ + } \ + return true; \ } #define TC_KVS_INT_INT_STRING_COMMAND(__name, __ifacecommand, __argname1, __argname2, __argname3) \ - TC_KVS_COMMAND(__name) \ - { \ - kvs_int_t arg1; \ - kvs_int_t arg2; \ - QString arg3; \ - KVSM_PARAMETERS_BEGIN(c) \ - KVSM_PARAMETER(__argname1, KVS_PT_INT, 0, arg1) \ - KVSM_PARAMETER(__argname2, KVS_PT_INT, 0, arg2) \ - KVSM_PARAMETER(__argname3, KVS_PT_STRING, 0, arg3) \ - KVSM_PARAMETERS_END(c) \ - \ - TC_KVS_FAIL_ON_NO_INTERFACE \ - \ - if (!TorrentInterface::selected()->__ifacecommand(arg1, arg2, arg3)) \ - { \ - TC_KVS_COMMAND_ERROR \ - } \ - return true; \ + TC_KVS_COMMAND(__name) \ + { \ + kvs_int_t arg1; \ + kvs_int_t arg2; \ + QString arg3; \ + KVSM_PARAMETERS_BEGIN(c) \ + KVSM_PARAMETER(__argname1, KVS_PT_INT, 0, arg1) \ + KVSM_PARAMETER(__argname2, KVS_PT_INT, 0, arg2) \ + KVSM_PARAMETER(__argname3, KVS_PT_STRING, 0, arg3) \ + KVSM_PARAMETERS_END(c) \ + \ + TC_KVS_FAIL_ON_NO_INTERFACE \ + \ + if(!TorrentInterface::selected()->__ifacecommand(arg1, arg2, arg3)) \ + { \ + TC_KVS_COMMAND_ERROR \ + } \ + return true; \ } // TODO: error handling for functions -#define TC_KVS_STRINGRET_FUNCTION(__name, __ifacecommand) \ - TC_KVS_FUNCTION(__name) \ - { \ - TC_KVS_FAIL_ON_NO_INTERFACE \ +#define TC_KVS_STRINGRET_FUNCTION(__name, __ifacecommand) \ + TC_KVS_FUNCTION(__name) \ + { \ + TC_KVS_FAIL_ON_NO_INTERFACE \ QString szRet = TorrentInterface::selected()->__ifacecommand(); \ - c->returnValue()->setString(szRet); \ - return true; \ + c->returnValue()->setString(szRet); \ + return true; \ } -#define TC_KVS_INTRET_FUNCTION(__name, __ifacecommand) \ - TC_KVS_FUNCTION(__name) \ - { \ - TC_KVS_FAIL_ON_NO_INTERFACE \ +#define TC_KVS_INTRET_FUNCTION(__name, __ifacecommand) \ + TC_KVS_FUNCTION(__name) \ + { \ + TC_KVS_FAIL_ON_NO_INTERFACE \ kvs_int_t ret = TorrentInterface::selected()->__ifacecommand(); \ - c->returnValue()->setInteger(ret); \ - return true; \ + c->returnValue()->setInteger(ret); \ + return true; \ } -#define TC_KVS_FLOATRET_FUNCTION(__name, __ifacecommand) \ - TC_KVS_FUNCTION(__name) \ - { \ - TC_KVS_FAIL_ON_NO_INTERFACE \ +#define TC_KVS_FLOATRET_FUNCTION(__name, __ifacecommand) \ + TC_KVS_FUNCTION(__name) \ + { \ + TC_KVS_FAIL_ON_NO_INTERFACE \ kvs_real_t ret = TorrentInterface::selected()->__ifacecommand(); \ - c->returnValue()->setReal(ret); \ - return true; \ + c->returnValue()->setReal(ret); \ + return true; \ } -#define TC_KVS_INTRET_INT_FUNCTION(__name, __ifacecommand, __argname) \ - TC_KVS_FUNCTION(__name) \ - { \ - kvs_int_t arg; \ - KVSM_PARAMETERS_BEGIN(c) \ - KVSM_PARAMETER(__argname, KVS_PT_INT, 0, arg) \ - KVSM_PARAMETERS_END(c) \ - TC_KVS_FAIL_ON_NO_INTERFACE \ +#define TC_KVS_INTRET_INT_FUNCTION(__name, __ifacecommand, __argname) \ + TC_KVS_FUNCTION(__name) \ + { \ + kvs_int_t arg; \ + KVSM_PARAMETERS_BEGIN(c) \ + KVSM_PARAMETER(__argname, KVS_PT_INT, 0, arg) \ + KVSM_PARAMETERS_END(c) \ + TC_KVS_FAIL_ON_NO_INTERFACE \ kvs_int_t ret = TorrentInterface::selected()->__ifacecommand(arg); \ - c->returnValue()->setInteger(ret); \ - return true; \ + c->returnValue()->setInteger(ret); \ + return true; \ } -#define TC_KVS_STRINGRET_INT_FUNCTION(__name, __ifacecommand, __argname) \ - TC_KVS_FUNCTION(__name) \ - { \ - kvs_int_t arg; \ - KVSM_PARAMETERS_BEGIN(c) \ - KVSM_PARAMETER(__argname, KVS_PT_INT, 0, arg) \ - KVSM_PARAMETERS_END(c) \ - TC_KVS_FAIL_ON_NO_INTERFACE \ +#define TC_KVS_STRINGRET_INT_FUNCTION(__name, __ifacecommand, __argname) \ + TC_KVS_FUNCTION(__name) \ + { \ + kvs_int_t arg; \ + KVSM_PARAMETERS_BEGIN(c) \ + KVSM_PARAMETER(__argname, KVS_PT_INT, 0, arg) \ + KVSM_PARAMETERS_END(c) \ + TC_KVS_FAIL_ON_NO_INTERFACE \ QString szRet = TorrentInterface::selected()->__ifacecommand(arg); \ - c->returnValue()->setString(szRet); \ - return true; \ + c->returnValue()->setString(szRet); \ + return true; \ } #define TC_KVS_STRINGRET_INT_INT_FUNCTION(__name, __ifacecommand, __argname1, __argname2) \ - TC_KVS_FUNCTION(__name) \ - { \ - kvs_int_t arg1; \ - kvs_int_t arg2; \ - KVSM_PARAMETERS_BEGIN(c) \ - KVSM_PARAMETER(__argname1, KVS_PT_INT, 0, arg1) \ - KVSM_PARAMETER(__argname2, KVS_PT_INT, 0, arg2) \ - KVSM_PARAMETERS_END(c) \ - TC_KVS_FAIL_ON_NO_INTERFACE \ - QString szRet = TorrentInterface::selected()->__ifacecommand(arg1, arg2); \ - c->returnValue()->setString(szRet); \ - return true; \ + TC_KVS_FUNCTION(__name) \ + { \ + kvs_int_t arg1; \ + kvs_int_t arg2; \ + KVSM_PARAMETERS_BEGIN(c) \ + KVSM_PARAMETER(__argname1, KVS_PT_INT, 0, arg1) \ + KVSM_PARAMETER(__argname2, KVS_PT_INT, 0, arg2) \ + KVSM_PARAMETERS_END(c) \ + TC_KVS_FAIL_ON_NO_INTERFACE \ + QString szRet = TorrentInterface::selected()->__ifacecommand(arg1, arg2); \ + c->returnValue()->setString(szRet); \ + return true; \ } #define TC_KVS_INTRET_INT_INT_FUNCTION(__name, __ifacecommand, __argname1, __argname2) \ - TC_KVS_FUNCTION(__name) \ - { \ - kvs_int_t arg1; \ - kvs_int_t arg2; \ - KVSM_PARAMETERS_BEGIN(c) \ - KVSM_PARAMETER(__argname1, KVS_PT_INT, 0, arg1) \ - KVSM_PARAMETER(__argname2, KVS_PT_INT, 0, arg2) \ - KVSM_PARAMETERS_END(c) \ - TC_KVS_FAIL_ON_NO_INTERFACE \ - kvs_int_t ret = TorrentInterface::selected()->__ifacecommand(arg1, arg2); \ - c->returnValue()->setInteger(ret); \ - return true; \ + TC_KVS_FUNCTION(__name) \ + { \ + kvs_int_t arg1; \ + kvs_int_t arg2; \ + KVSM_PARAMETERS_BEGIN(c) \ + KVSM_PARAMETER(__argname1, KVS_PT_INT, 0, arg1) \ + KVSM_PARAMETER(__argname2, KVS_PT_INT, 0, arg2) \ + KVSM_PARAMETERS_END(c) \ + TC_KVS_FAIL_ON_NO_INTERFACE \ + kvs_int_t ret = TorrentInterface::selected()->__ifacecommand(arg1, arg2); \ + c->returnValue()->setInteger(ret); \ + return true; \ } /* @@ -297,7 +296,7 @@ static TorrentInterface *auto_detect_torrent_client(KviWindow * pOut = 0) TC_KVS_COMMAND(detect) { - TorrentInterface::select(auto_detect_torrent_client(c->hasSwitch('q',"quiet") ? 0 : c->window())); + TorrentInterface::select(auto_detect_torrent_client(c->hasSwitch('q', "quiet") ? 0 : c->window())); return true; } @@ -320,7 +319,6 @@ TC_KVS_COMMAND(detect) */ TC_KVS_INTRET_FUNCTION(maxUploadSpeed, maxUploadSpeed) - /* @doc: torrent.maxDownloadSpeed @type: @@ -699,33 +697,32 @@ TC_KVS_COMMAND(setClient) QString client; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("client", KVS_PT_STRING, 0, client) + KVSM_PARAMETER("client", KVS_PT_STRING, 0, client) KVSM_PARAMETERS_END(c) - for (TorrentInterfaceDescriptor *d = g_pDescriptorList->first(); d; d=g_pDescriptorList->next()) + for(TorrentInterfaceDescriptor * d = g_pDescriptorList->first(); d; d = g_pDescriptorList->next()) { - if (d->name() == client) + if(d->name() == client) { TorrentInterface::select(d->instance()); KVI_OPTION_STRING(KviOption_stringPreferredTorrentClient) = client; - if (!c->hasSwitch('q',"quiet")) + if(!c->hasSwitch('q', "quiet")) c->window()->output(KVI_OUT_TORRENT, - __tr2qs_ctx("Using client interface \"%Q\".", "torrent"), - &client); + __tr2qs_ctx("Using client interface \"%Q\".", "torrent"), + &client); return true; } } - if (!c->hasSwitch('q',"quiet")) + if(!c->hasSwitch('q', "quiet")) c->window()->output(KVI_OUT_TORRENT, - __tr2qs_ctx("Invalid client interface \"%Q\"!", "torrent"), - &client); + __tr2qs_ctx("Invalid client interface \"%Q\"!", "torrent"), + &client); return false; } - /* @doc: torrent.client @type: @@ -771,10 +768,10 @@ TC_KVS_FUNCTION(client) */ TC_KVS_FUNCTION(clientList) { - KviKvsArray *pArray = new KviKvsArray(); - int id=0; + KviKvsArray * pArray = new KviKvsArray(); + int id = 0; - for (TorrentInterfaceDescriptor *d=g_pDescriptorList->first(); d; d=g_pDescriptorList->next()) + for(TorrentInterfaceDescriptor * d = g_pDescriptorList->first(); d; d = g_pDescriptorList->next()) pArray->set(id++, new KviKvsVariant(d->name())); c->returnValue()->setArray(pArray); @@ -839,10 +836,10 @@ TC_KVS_STRINGRET_INT_FUNCTION(state, state, "torrent_number") [fnc]$torrent.filePriority[/fnc]: Returns the priority of a file in a torrent[br] */ -static bool torrent_module_init(KviModule *m) +static bool torrent_module_init(KviModule * m) { - #define TC_KVS_REGCMD(__name,__stringname) KVSM_REGISTER_SIMPLE_COMMAND(m, __stringname, torrent_kvs_cmd_ ## __name) - #define TC_KVS_REGFNC(__name,__stringname) KVSM_REGISTER_FUNCTION(m, __stringname, torrent_kvs_fnc_ ## __name) +#define TC_KVS_REGCMD(__name, __stringname) KVSM_REGISTER_SIMPLE_COMMAND(m, __stringname, torrent_kvs_cmd_##__name) +#define TC_KVS_REGFNC(__name, __stringname) KVSM_REGISTER_FUNCTION(m, __stringname, torrent_kvs_fnc_##__name) TC_KVS_REGCMD(detect, "detect"); TC_KVS_REGCMD(setClient, "setClient"); @@ -878,19 +875,18 @@ static bool torrent_module_init(KviModule *m) TorrentInterface::select(0); - if (g_pMainWindow->mainStatusBar()) + if(g_pMainWindow->mainStatusBar()) StatusBarApplet::selfRegister(g_pMainWindow->mainStatusBar()); - if(KVI_OPTION_STRING(KviOption_stringPreferredMediaPlayer) == "auto") { TorrentInterface::select(auto_detect_torrent_client()); - - } else + } + else { - for (TorrentInterfaceDescriptor *d=g_pDescriptorList->first(); d; d=g_pDescriptorList->next()) + for(TorrentInterfaceDescriptor * d = g_pDescriptorList->first(); d; d = g_pDescriptorList->next()) { - if (d->name() == KVI_OPTION_STRING(KviOption_stringPreferredTorrentClient)) + if(d->name() == KVI_OPTION_STRING(KviOption_stringPreferredTorrentClient)) TorrentInterface::select(d->instance()); } } @@ -898,20 +894,20 @@ static bool torrent_module_init(KviModule *m) return true; } -static bool torrent_module_cleanup(KviModule * ) +static bool torrent_module_cleanup(KviModule *) { delete g_pDescriptorList; return true; } -static bool torrent_module_can_unload(KviModule * ) +static bool torrent_module_can_unload(KviModule *) { return true; } -static bool torrent_module_ctrl(KviModule *,const char *,void *) // KviModule * m,const char * operation,void * param) +static bool torrent_module_ctrl(KviModule *, const char *, void *) // KviModule * m,const char * operation,void * param) { -/* if(kvi_strEqualCI(operation,"getAvailableMediaPlayers")) + /* if(kvi_strEqualCI(operation,"getAvailableMediaPlayers")) { // we expect param to be a pointer to QStringList QStringList * l = (QStringList *)param; @@ -931,14 +927,13 @@ static bool torrent_module_ctrl(KviModule *,const char *,void *) // KviModule * } KVIRC_MODULE( - "Torrent", - "4.0.0", - "Copyright (C) 2007 Alexander Stillich (torque at pltn dot org)" \ - " 2008 Fabio Bas (ctrlaltca at gmail dot com)", - "Interface to various torrent clients", - torrent_module_init, - torrent_module_can_unload, - torrent_module_ctrl, - torrent_module_cleanup, - "torrent" -) + "Torrent", + "4.0.0", + "Copyright (C) 2007 Alexander Stillich (torque at pltn dot org)" + " 2008 Fabio Bas (ctrlaltca at gmail dot com)", + "Interface to various torrent clients", + torrent_module_init, + torrent_module_can_unload, + torrent_module_ctrl, + torrent_module_cleanup, + "torrent") diff --git a/src/modules/trayicon/libkvitrayicon.cpp b/src/modules/trayicon/libkvitrayicon.cpp index 6eb3ecc3b..f08cb0a5d 100644 --- a/src/modules/trayicon/libkvitrayicon.cpp +++ b/src/modules/trayicon/libkvitrayicon.cpp @@ -54,13 +54,13 @@ #include #if defined(COMPILE_ON_WINDOWS) || defined(COMPILE_ON_MINGW) - #define ICON_SIZE 16 - #include +#define ICON_SIZE 16 +#include #else - #define ICON_SIZE 48 +#define ICON_SIZE 48 #endif -extern KVIRC_API KviPointerHashTable * g_pGlobalWindowDict; +extern KVIRC_API KviPointerHashTable * g_pGlobalWindowDict; static KviTrayIconWidget * g_pTrayIcon = nullptr; static QPixmap * g_pDock1 = nullptr; @@ -68,7 +68,7 @@ static QPixmap * g_pDock2 = nullptr; static QPixmap * g_pDock3 = nullptr; KviTrayIconWidget::KviTrayIconWidget() -: QSystemTrayIcon(g_pMainWindow), m_CurrentPixmap(ICON_SIZE,ICON_SIZE), m_Tip(g_pMainWindow,"dock_tooltip") + : QSystemTrayIcon(g_pMainWindow), m_CurrentPixmap(ICON_SIZE, ICON_SIZE), m_Tip(g_pMainWindow, "dock_tooltip") { g_pTrayIcon = this; m_pContextPopup = new QMenu(0); @@ -76,21 +76,21 @@ KviTrayIconWidget::KviTrayIconWidget() m_iConsoles = 0; m_iChannels = 0; - m_iQueries = 0; - m_iOther = 0; - m_bHidden = false; + m_iQueries = 0; + m_iOther = 0; + m_bHidden = false; m_pFlashingTimer = new QTimer(this); m_pFlashingTimer->setObjectName("flashing_timer"); connect(m_pFlashingTimer, SIGNAL(timeout()), this, SLOT(flashingTimerShot())); - m_bFlashed=false; + m_bFlashed = false; g_pMainWindow->setTrayIcon(this); m_pAwayPopup = new QMenu(0); #ifndef COMPILE_ON_MAC - m_pTitleLabel = new QLabel(__tr2qs("
KVIrc Tray Options
"),m_pContextPopup); + m_pTitleLabel = new QLabel(__tr2qs("
KVIrc Tray Options
"), m_pContextPopup); QPalette p; m_pTitleLabel->setStyleSheet("background-color: " + p.color(QPalette::Normal, QPalette::Mid).name()); QWidgetAction * pAction = new QWidgetAction(this); @@ -103,32 +103,31 @@ KviTrayIconWidget::KviTrayIconWidget() m_pAwayMenuId->setIcon(*(g_pIconManager->getSmallIcon(KviIconManager::Away))); m_pAwayMenuId->setText(__tr2qs("Away")); - QAction* id = m_pContextPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::Options)),__tr2qs("&Configure KVIrc..."),this,SLOT(executeInternalCommand(bool))); + QAction * id = m_pContextPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::Options)), __tr2qs("&Configure KVIrc..."), this, SLOT(executeInternalCommand(bool))); id->setData(KVI_INTERNALCOMMAND_OPTIONS_DIALOG); - id = m_pContextPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::Info)),__tr2qs("&About KVIrc"),this,SLOT(executeInternalCommand(bool))); + id = m_pContextPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::Info)), __tr2qs("&About KVIrc"), this, SLOT(executeInternalCommand(bool))); id->setData(KVI_INTERNALCOMMAND_ABOUT_ABOUTKVIRC); m_pContextPopup->addSeparator(); - m_pToggleFrame = m_pContextPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::DefaultIcon)),__tr2qs("Hide / Show"),this,SLOT(toggleParentFrame())); + m_pToggleFrame = m_pContextPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::DefaultIcon)), __tr2qs("Hide / Show"), this, SLOT(toggleParentFrame())); m_pContextPopup->addSeparator(); - id = m_pContextPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::TrayIcon)),__tr2qs("&Hide Tray Icon"),this,SLOT(disableTrayIcon())); + id = m_pContextPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::TrayIcon)), __tr2qs("&Hide Tray Icon"), this, SLOT(disableTrayIcon())); - id = m_pContextPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::QuitApp)),__tr2qs("&Quit"),g_pMainWindow,SLOT(close())); + id = m_pContextPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::QuitApp)), __tr2qs("&Quit"), g_pMainWindow, SLOT(close())); - connect(m_pContextPopup,SIGNAL(aboutToShow()),this,SLOT(fillContextPopup())); + connect(m_pContextPopup, SIGNAL(aboutToShow()), this, SLOT(fillContextPopup())); setIcon(*g_pDock1); - connect(this,SIGNAL(activated(QSystemTrayIcon::ActivationReason)),this,SLOT(activatedSlot(QSystemTrayIcon::ActivationReason))); + connect(this, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this, SLOT(activatedSlot(QSystemTrayIcon::ActivationReason))); } - KviTrayIconWidget::~KviTrayIconWidget() { - g_pTrayIcon=nullptr; + g_pTrayIcon = nullptr; g_pMainWindow->setTrayIcon(0); delete m_pAwayPopup; #ifndef COMPILE_ON_MAC @@ -150,7 +149,7 @@ void KviTrayIconWidget::executeInternalCommand(bool) if(pQaction == nullptr) { qDebug("Conversion from QObject::sender() to QAction* failed. libkvitrayicon.cpp %d", - __LINE__); + __LINE__); return; } @@ -166,7 +165,7 @@ void KviTrayIconWidget::die() void KviTrayIconWidget::flashingTimerShot() { - m_bFlashed=!m_bFlashed; + m_bFlashed = !m_bFlashed; refresh(); } @@ -179,8 +178,7 @@ void KviTrayIconWidget::disableTrayIcon() #define NIDLEMSGS 18 -static const char * idlemsgs[NIDLEMSGS]= -{ +static const char * idlemsgs[NIDLEMSGS] = { __tr("Nothing is happening..."), __tr("Just idling..."), __tr("Dum de dum de dum..."), @@ -201,11 +199,11 @@ static const char * idlemsgs[NIDLEMSGS]= __tr("idle idle idle idle!") }; -bool KviTrayIconWidget::event(QEvent *e) +bool KviTrayIconWidget::event(QEvent * e) { - if(e->type()==QEvent::ToolTip) + if(e->type() == QEvent::ToolTip) { - QPoint pos= g_pMainWindow->mapFromGlobal(QCursor::pos()); + QPoint pos = g_pMainWindow->mapFromGlobal(QCursor::pos()); QString tmp; KviWindowListBase * t = g_pMainWindow->windowListWidget(); @@ -213,7 +211,7 @@ bool KviTrayIconWidget::event(QEvent *e) QString line; bool first = true; - for(KviWindowListItem * b = t->firstItem();b;b = t->nextItem()) + for(KviWindowListItem * b = t->firstItem(); b; b = t->nextItem()) { if(b->kviWindow()->view()) @@ -223,12 +221,14 @@ bool KviTrayIconWidget::event(QEvent *e) line = b->kviWindow()->lastMessageText(); if(!line.isEmpty()) { - if(!first)tmp += "

\n"; - else first = false; - - line.replace(QChar('&'),"&"); - line.replace(QChar('<'),"<"); - line.replace(QChar('>'),">"); + if(!first) + tmp += "

\n"; + else + first = false; + + line.replace(QChar('&'), "&"); + line.replace(QChar('<'), "<"); + line.replace(QChar('>'), ">"); tmp += ""; tmp += b->kviWindow()->plainTextCaption(); tmp += "
"; @@ -238,14 +238,14 @@ bool KviTrayIconWidget::event(QEvent *e) } } - srand(time(0)); // We use the bad way to generate random numbers :))))) - if(tmp.isEmpty())tmp = __tr2qs_no_xgettext(idlemsgs[(int)(rand() % NIDLEMSGS)]); + if(tmp.isEmpty()) + tmp = __tr2qs_no_xgettext(idlemsgs[(int)(rand() % NIDLEMSGS)]); - m_Tip.tip(QRect(pos,QSize(0,0)),tmp); + m_Tip.tip(QRect(pos, QSize(0, 0)), tmp); return true; } return false; @@ -269,31 +269,36 @@ void KviTrayIconWidget::doAway(bool) id = act->data().toInt(&ok); if(!ok) return; - } else { + } + else + { return; } - if(id<0) + if(id < 0) { - KviPointerHashTableIterator it(*g_pGlobalWindowDict); + KviPointerHashTableIterator it(*g_pGlobalWindowDict); while(KviWindow * wnd = it.current()) { KviConsoleWindow * pConsole = dynamic_cast(wnd); if(pConsole && pConsole->isConnected()) { - if(id==-2) + if(id == -2) { pConsole->connection()->sendFmtData("AWAY"); - } else { + } + else + { pConsole->connection()->sendFmtData("AWAY :%s", - pConsole->connection()->encodeText(KVI_OPTION_STRING(KviOption_stringAwayMessage)).data() - ); + pConsole->connection()->encodeText(KVI_OPTION_STRING(KviOption_stringAwayMessage)).data()); } } - ++it; + ++it; } - } else { - KviConsoleWindow* pConsole=g_pApp->findConsole(static_cast(id)); + } + else + { + KviConsoleWindow * pConsole = g_pApp->findConsole(static_cast(id)); if(pConsole) { if(pConsole->isConnected()) @@ -301,10 +306,11 @@ void KviTrayIconWidget::doAway(bool) if(pConsole->connection()->userInfo()->isAway()) { pConsole->connection()->sendFmtData("AWAY"); - } else { + } + else + { pConsole->connection()->sendFmtData("AWAY :%s", - pConsole->connection()->encodeText(KVI_OPTION_STRING(KviOption_stringAwayMessage)).data() - ); + pConsole->connection()->encodeText(KVI_OPTION_STRING(KviOption_stringAwayMessage)).data()); } } } @@ -319,49 +325,55 @@ void KviTrayIconWidget::fillContextPopup() m_pAwayMenuId->setVisible(true); m_pAwayPopup->clear(); - QAction * pAllAway = m_pAwayPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::Away)),__tr2qs("Away on All"),this,SLOT(doAway(bool))); + QAction * pAllAway = m_pAwayPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::Away)), __tr2qs("Away on All"), this, SLOT(doAway(bool))); pAllAway->setData(-1); - QAction * pAllUnaway = m_pAwayPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::NotAway)),__tr2qs("Back on All"),this,SLOT(doAway(bool))); + QAction * pAllUnaway = m_pAwayPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::NotAway)), __tr2qs("Back on All"), this, SLOT(doAway(bool))); pAllUnaway->setData(-2); - QAction* pSeparator=m_pAwayPopup->addSeparator(); + QAction * pSeparator = m_pAwayPopup->addSeparator(); - KviPointerHashTableIterator it(*g_pGlobalWindowDict); - bool bAllAway=true; - bool bAllUnaway=true; - int iNetCount=0; + KviPointerHashTableIterator it(*g_pGlobalWindowDict); + bool bAllAway = true; + bool bAllUnaway = true; + int iNetCount = 0; while(KviWindow * wnd = it.current()) { KviConsoleWindow * pConsole = dynamic_cast(wnd); if(pConsole && pConsole->isConnected()) { - QAction* id; + QAction * id; if(pConsole->connection()->userInfo()->isAway()) { - id=m_pAwayPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::NotAway)),__tr2qs("Back on %1").arg(pConsole->currentNetworkName()),this,SLOT(doAway(bool))); + id = m_pAwayPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::NotAway)), __tr2qs("Back on %1").arg(pConsole->currentNetworkName()), this, SLOT(doAway(bool))); id->setData(pConsole->context()->id()); - bAllUnaway=false; - } else { - id=m_pAwayPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::Away)),__tr2qs("Away on %1").arg(pConsole->currentNetworkName()),this,SLOT(doAway(bool))); + bAllUnaway = false; + } + else + { + id = m_pAwayPopup->addAction(*(g_pIconManager->getSmallIcon(KviIconManager::Away)), __tr2qs("Away on %1").arg(pConsole->currentNetworkName()), this, SLOT(doAway(bool))); id->setData(pConsole->context()->id()); - bAllAway=false; + bAllAway = false; } id->setData(pConsole->context()->id()); iNetCount++; } - ++it; + ++it; } - if(iNetCount==1) + if(iNetCount == 1) { pAllAway->setVisible(false); pAllUnaway->setVisible(false); pSeparator->setVisible(false); - } else { + } + else + { pAllAway->setVisible(!bAllAway); pAllUnaway->setVisible(!bAllUnaway); } - } else { + } + else + { m_pAwayMenuId->setVisible(false); } } @@ -378,7 +390,9 @@ void KviTrayIconWidget::toggleParentFrame() { //qDebug("- window was maximized so calling showMaximized()"); g_pMainWindow->showMaximized(); - } else { + } + else + { //qDebug("- window wasn't maximized so calling plain show()"); g_pMainWindow->show(); } @@ -387,7 +401,8 @@ void KviTrayIconWidget::toggleParentFrame() SetForegroundWindow((HWND)g_pMainWindow->winId()); g_pMainWindow->activateWindow(); #endif - } else if(!g_pMainWindow->isVisible()) + } + else if(!g_pMainWindow->isVisible()) { //qDebug("- frame is not visible"); //restore mainwindow @@ -395,7 +410,9 @@ void KviTrayIconWidget::toggleParentFrame() { //qDebug("- window was maximized so calling showMaximized()"); g_pMainWindow->showMaximized(); - } else { + } + else + { //qDebug("- window wasn't maximized so calling plain show()"); g_pMainWindow->show(); } @@ -404,7 +421,9 @@ void KviTrayIconWidget::toggleParentFrame() SetForegroundWindow((HWND)g_pMainWindow->winId()); g_pMainWindow->activateWindow(); #endif - } else { + } + else + { //qDebug("- frame is visible: maximized state=%d, hiding",g_pMainWindow->isMaximized()); KVI_OPTION_BOOL(KviOption_boolFrameIsMaximized) = g_pMainWindow->isMaximized(); g_pMainWindow->hide(); @@ -415,13 +434,16 @@ void KviTrayIconWidget::refresh() { grabActivityInfo(); - if( (m_iChannels == 2) || (m_iQueries == 2) ) + if((m_iChannels == 2) || (m_iQueries == 2)) { - if(!m_pFlashingTimer->isActive() && KVI_OPTION_BOOL(KviOption_boolEnableTrayIconFlashing) ) + if(!m_pFlashingTimer->isActive() && KVI_OPTION_BOOL(KviOption_boolEnableTrayIconFlashing)) m_pFlashingTimer->start(1000); - } else { - if(m_pFlashingTimer->isActive()) m_pFlashingTimer->stop(); - m_bFlashed=false; + } + else + { + if(m_pFlashingTimer->isActive()) + m_pFlashingTimer->stop(); + m_bFlashed = false; } m_CurrentPixmap.fill(Qt::transparent); @@ -430,55 +452,56 @@ void KviTrayIconWidget::refresh() if(m_bFlashed) { - thisRestrictionOfQt4IsNotNice.drawPixmap((ICON_SIZE-16)/2,(ICON_SIZE-16)/2,16,16,*(g_pIconManager->getSmallIcon(KviIconManager::Message)),0,0,16,16); - } else { - thisRestrictionOfQt4IsNotNice.drawPixmap(0,0,ICON_SIZE/2,ICON_SIZE/2, - m_iOther ? - ((m_iOther == 2) ? *g_pDock3 : *g_pDock2) - : *g_pDock1,0,0,ICON_SIZE/2,ICON_SIZE/2); - - thisRestrictionOfQt4IsNotNice.drawPixmap(0,ICON_SIZE/2,ICON_SIZE/2,ICON_SIZE/2, - m_iConsoles ? - ((m_iConsoles == 2) ? *g_pDock3 : *g_pDock2) - : *g_pDock1,0,ICON_SIZE/2,ICON_SIZE/2,ICON_SIZE/2); - - thisRestrictionOfQt4IsNotNice.drawPixmap(ICON_SIZE/2,0,ICON_SIZE/2,ICON_SIZE/2, - m_iQueries ? - ((m_iQueries == 2) - ? *g_pDock3 : *g_pDock2) - : *g_pDock1,ICON_SIZE/2,0,ICON_SIZE/2,ICON_SIZE/2); - - thisRestrictionOfQt4IsNotNice.drawPixmap(ICON_SIZE/2,ICON_SIZE/2,ICON_SIZE/2,ICON_SIZE/2, - m_iChannels ? - ((m_iChannels == 2) ? *g_pDock3 : *g_pDock2) - : *g_pDock1 - ,ICON_SIZE/2,ICON_SIZE/2,ICON_SIZE/2,ICON_SIZE/2); - + thisRestrictionOfQt4IsNotNice.drawPixmap((ICON_SIZE - 16) / 2, (ICON_SIZE - 16) / 2, 16, 16, *(g_pIconManager->getSmallIcon(KviIconManager::Message)), 0, 0, 16, 16); + } + else + { + thisRestrictionOfQt4IsNotNice.drawPixmap(0, 0, ICON_SIZE / 2, ICON_SIZE / 2, + m_iOther ? ((m_iOther == 2) ? *g_pDock3 : *g_pDock2) + : *g_pDock1, + 0, 0, ICON_SIZE / 2, ICON_SIZE / 2); + + thisRestrictionOfQt4IsNotNice.drawPixmap(0, ICON_SIZE / 2, ICON_SIZE / 2, ICON_SIZE / 2, + m_iConsoles ? ((m_iConsoles == 2) ? *g_pDock3 : *g_pDock2) + : *g_pDock1, + 0, ICON_SIZE / 2, ICON_SIZE / 2, ICON_SIZE / 2); + + thisRestrictionOfQt4IsNotNice.drawPixmap(ICON_SIZE / 2, 0, ICON_SIZE / 2, ICON_SIZE / 2, + m_iQueries ? ((m_iQueries == 2) + ? *g_pDock3 + : *g_pDock2) + : *g_pDock1, + ICON_SIZE / 2, 0, ICON_SIZE / 2, ICON_SIZE / 2); + + thisRestrictionOfQt4IsNotNice.drawPixmap(ICON_SIZE / 2, ICON_SIZE / 2, ICON_SIZE / 2, ICON_SIZE / 2, + m_iChannels ? ((m_iChannels == 2) ? *g_pDock3 : *g_pDock2) + : *g_pDock1, + ICON_SIZE / 2, ICON_SIZE / 2, ICON_SIZE / 2, ICON_SIZE / 2); } updateIcon(); } -void KviTrayIconWidget::activatedSlot( QSystemTrayIcon::ActivationReason reason ) +void KviTrayIconWidget::activatedSlot(QSystemTrayIcon::ActivationReason reason) { switch(reason) { case QSystemTrayIcon::Trigger: - // This is single click +// This is single click #ifdef COMPILE_ON_MAC // On MacOSX one can only single-left-click the icon. // This activates the context menu and is quite confusing if it *also* hides the kvirc window. // So on mac we only _show_ the main window if it's hidden and the CloseInTray option is enabled. if((KVI_OPTION_BOOL(KviOption_boolCloseInTray) || KVI_OPTION_BOOL(KviOption_boolMinimizeInTray)) - && ((!g_pMainWindow->isVisible()) || g_pMainWindow->isMinimized())) + && ((!g_pMainWindow->isVisible()) || g_pMainWindow->isMinimized())) toggleParentFrame(); -#else //!COMPILE_ON_MAC +#else //!COMPILE_ON_MAC // on other platforms we always toggle the window toggleParentFrame(); #endif //!COMPILE_ON_MAC - break; + break; default: // we do nothing at this time - break; + break; } } @@ -488,22 +511,26 @@ void KviTrayIconWidget::grabActivityInfo() if(KVI_OPTION_BOOL(KviOption_boolUseLevelBasedTrayNotification)) { - if(KVI_OPTION_UINT(KviOption_uintMinTrayLowLevelMessage)>5) KVI_OPTION_UINT(KviOption_uintMinTrayLowLevelMessage)=5; - if(KVI_OPTION_UINT(KviOption_uintMinTrayHighLevelMessage)>5) KVI_OPTION_UINT(KviOption_uintMinTrayHighLevelMessage)=5; - - if(KVI_OPTION_UINT(KviOption_uintMinTrayLowLevelMessage)<1) KVI_OPTION_UINT(KviOption_uintMinTrayLowLevelMessage)=1; - if(KVI_OPTION_UINT(KviOption_uintMinTrayHighLevelMessage)<1) KVI_OPTION_UINT(KviOption_uintMinTrayHighLevelMessage)=1; - - if(KVI_OPTION_UINT(KviOption_uintMinTrayHighLevelMessage) 5) + KVI_OPTION_UINT(KviOption_uintMinTrayLowLevelMessage) = 5; + if(KVI_OPTION_UINT(KviOption_uintMinTrayHighLevelMessage) > 5) + KVI_OPTION_UINT(KviOption_uintMinTrayHighLevelMessage) = 5; + + if(KVI_OPTION_UINT(KviOption_uintMinTrayLowLevelMessage) < 1) + KVI_OPTION_UINT(KviOption_uintMinTrayLowLevelMessage) = 1; + if(KVI_OPTION_UINT(KviOption_uintMinTrayHighLevelMessage) < 1) + KVI_OPTION_UINT(KviOption_uintMinTrayHighLevelMessage) = 1; + + if(KVI_OPTION_UINT(KviOption_uintMinTrayHighLevelMessage) < KVI_OPTION_UINT(KviOption_uintMinTrayLowLevelMessage)) + KVI_OPTION_UINT(KviOption_uintMinTrayHighLevelMessage) = KVI_OPTION_UINT(KviOption_uintMinTrayLowLevelMessage); } m_iConsoles = 0; m_iChannels = 0; - m_iQueries = 0; - m_iOther = 0; + m_iQueries = 0; + m_iOther = 0; - for(KviWindowListItem * b = t->firstItem();b;b = t->nextItem()) + for(KviWindowListItem * b = t->firstItem(); b; b = t->nextItem()) { if(KVI_OPTION_BOOL(KviOption_boolUseLevelBasedTrayNotification)) { @@ -511,66 +538,89 @@ void KviTrayIconWidget::grabActivityInfo() switch(b->kviWindow()->type()) { case KviWindow::Console: - if(m_iConsoles < iLevel) m_iConsoles = iLevel; - break; + if(m_iConsoles < iLevel) + m_iConsoles = iLevel; + break; case KviWindow::Channel: - if(m_iChannels < iLevel) m_iChannels = iLevel; - break; + if(m_iChannels < iLevel) + m_iChannels = iLevel; + break; case KviWindow::Query: - if(m_iQueries < iLevel) m_iQueries = iLevel; - break; + if(m_iQueries < iLevel) + m_iQueries = iLevel; + break; default: - if(m_iOther < iLevel) m_iOther = iLevel; - break; + if(m_iOther < iLevel) + m_iOther = iLevel; + break; } - } else { + } + else + { if(b->kviWindow()->view()) { - unsigned int iLevel=0; + unsigned int iLevel = 0; if(b->kviWindow()->view()->haveUnreadedHighlightedMessages()) { - iLevel=2; - } else if(b->kviWindow()->view()->haveUnreadedMessages()) - { - iLevel=1; + iLevel = 2; } - if(iLevel>0) - switch(b->kviWindow()->type()) + else if(b->kviWindow()->view()->haveUnreadedMessages()) { - case KviWindow::Console: - if(m_iConsoles < iLevel) m_iConsoles = iLevel; - break; - case KviWindow::Channel: - if(m_iChannels < iLevel) m_iChannels = iLevel; - break; - case KviWindow::Query: - if(m_iQueries < iLevel) m_iQueries = iLevel; - break; - default: - if(m_iOther < iLevel) m_iOther = iLevel; - break; + iLevel = 1; } + if(iLevel > 0) + switch(b->kviWindow()->type()) + { + case KviWindow::Console: + if(m_iConsoles < iLevel) + m_iConsoles = iLevel; + break; + case KviWindow::Channel: + if(m_iChannels < iLevel) + m_iChannels = iLevel; + break; + case KviWindow::Query: + if(m_iQueries < iLevel) + m_iQueries = iLevel; + break; + default: + if(m_iOther < iLevel) + m_iOther = iLevel; + break; + } } } } if(KVI_OPTION_BOOL(KviOption_boolUseLevelBasedTrayNotification)) { - if(m_iConsoles >= KVI_OPTION_UINT(KviOption_uintMinTrayHighLevelMessage)) m_iConsoles=2; - else if(m_iConsoles >= KVI_OPTION_UINT(KviOption_uintMinTrayLowLevelMessage)) m_iConsoles=1; - else m_iConsoles=0; - - if(m_iChannels >= KVI_OPTION_UINT(KviOption_uintMinTrayHighLevelMessage)) m_iChannels=2; - else if(m_iChannels >= KVI_OPTION_UINT(KviOption_uintMinTrayLowLevelMessage)) m_iChannels=1; - else m_iChannels=0; - - if(m_iQueries >= KVI_OPTION_UINT(KviOption_uintMinTrayHighLevelMessage)) m_iQueries=2; - else if(m_iQueries >= KVI_OPTION_UINT(KviOption_uintMinTrayLowLevelMessage)) m_iQueries=1; - else m_iQueries=0; - - if(m_iOther >= KVI_OPTION_UINT(KviOption_uintMinTrayHighLevelMessage)) m_iOther=2; - else if(m_iOther >= KVI_OPTION_UINT(KviOption_uintMinTrayLowLevelMessage)) m_iOther=1; - else m_iOther=0; + if(m_iConsoles >= KVI_OPTION_UINT(KviOption_uintMinTrayHighLevelMessage)) + m_iConsoles = 2; + else if(m_iConsoles >= KVI_OPTION_UINT(KviOption_uintMinTrayLowLevelMessage)) + m_iConsoles = 1; + else + m_iConsoles = 0; + + if(m_iChannels >= KVI_OPTION_UINT(KviOption_uintMinTrayHighLevelMessage)) + m_iChannels = 2; + else if(m_iChannels >= KVI_OPTION_UINT(KviOption_uintMinTrayLowLevelMessage)) + m_iChannels = 1; + else + m_iChannels = 0; + + if(m_iQueries >= KVI_OPTION_UINT(KviOption_uintMinTrayHighLevelMessage)) + m_iQueries = 2; + else if(m_iQueries >= KVI_OPTION_UINT(KviOption_uintMinTrayLowLevelMessage)) + m_iQueries = 1; + else + m_iQueries = 0; + + if(m_iOther >= KVI_OPTION_UINT(KviOption_uintMinTrayHighLevelMessage)) + m_iOther = 2; + else if(m_iOther >= KVI_OPTION_UINT(KviOption_uintMinTrayLowLevelMessage)) + m_iOther = 1; + else + m_iOther = 0; } } @@ -639,7 +689,7 @@ static bool trayicon_kvs_cmd_show(KviKvsModuleCommandCall *) static bool trayicon_kvs_cmd_hide(KviKvsModuleCommandCall *) { delete g_pTrayIcon; - g_pTrayIcon=nullptr; + g_pTrayIcon = nullptr; // show the parent frame.. otherwise there will be no way to get it back if(!g_pMainWindow->isVisible()) @@ -690,14 +740,14 @@ static bool trayicon_kvs_cmd_hidewindow(KviKvsModuleCommandCall *) static bool trayicon_kvs_fnc_isvisible(KviKvsModuleFunctionCall * c) { - c->returnValue()->setBoolean(g_pTrayIcon!=nullptr); + c->returnValue()->setBoolean(g_pTrayIcon != nullptr); return true; } #if defined(COMPILE_KDE_SUPPORT) || defined(COMPILE_ON_MAC) - #define ICON_INFIX "mono" +#define ICON_INFIX "mono" #else - #define ICON_INFIX "normal" +#define ICON_INFIX "normal" #endif // ======================================= @@ -706,19 +756,19 @@ static bool trayicon_kvs_fnc_isvisible(KviKvsModuleFunctionCall * c) static bool trayicon_module_init(KviModule * m) { QString buffer; - g_pApp->findImage(buffer,QString("kvi_dock_" ICON_INFIX "_%1-0.png").arg(ICON_SIZE)); + g_pApp->findImage(buffer, QString("kvi_dock_" ICON_INFIX "_%1-0.png").arg(ICON_SIZE)); g_pDock1 = new QPixmap(buffer); - g_pApp->findImage(buffer,QString("kvi_dock_" ICON_INFIX "_%1-1.png").arg(ICON_SIZE)); + g_pApp->findImage(buffer, QString("kvi_dock_" ICON_INFIX "_%1-1.png").arg(ICON_SIZE)); g_pDock2 = new QPixmap(buffer); - g_pApp->findImage(buffer,QString("kvi_dock_" ICON_INFIX "_%1-2.png").arg(ICON_SIZE)); + g_pApp->findImage(buffer, QString("kvi_dock_" ICON_INFIX "_%1-2.png").arg(ICON_SIZE)); g_pDock3 = new QPixmap(buffer); - KVSM_REGISTER_SIMPLE_COMMAND(m,"hide",trayicon_kvs_cmd_hide); - KVSM_REGISTER_SIMPLE_COMMAND(m,"hidewindow",trayicon_kvs_cmd_hidewindow); - KVSM_REGISTER_SIMPLE_COMMAND(m,"show",trayicon_kvs_cmd_show); - KVSM_REGISTER_FUNCTION(m,"isVisible",trayicon_kvs_fnc_isvisible); + KVSM_REGISTER_SIMPLE_COMMAND(m, "hide", trayicon_kvs_cmd_hide); + KVSM_REGISTER_SIMPLE_COMMAND(m, "hidewindow", trayicon_kvs_cmd_hidewindow); + KVSM_REGISTER_SIMPLE_COMMAND(m, "show", trayicon_kvs_cmd_show); + KVSM_REGISTER_FUNCTION(m, "isVisible", trayicon_kvs_fnc_isvisible); return true; } @@ -742,22 +792,21 @@ static bool trayicon_module_cleanup(KviModule *) static bool trayicon_module_can_unload(KviModule *) { - return g_pTrayIcon==nullptr; + return g_pTrayIcon == nullptr; } // ======================================= // plugin definition structure // ======================================= KVIRC_MODULE( - "KVIrc Tray Icon Implementation", - "4.0.0", - "Copyright (C) 2001 Szymon Stefanek " \ - "Copyright (C) 2007 Alexey Uzhva " \ - "Copyright (C) 2008 Elvio Basello ", - "Exports the /trayicon.* interface\n", - trayicon_module_init, - trayicon_module_can_unload, - 0, - trayicon_module_cleanup, - 0 -) + "KVIrc Tray Icon Implementation", + "4.0.0", + "Copyright (C) 2001 Szymon Stefanek " + "Copyright (C) 2007 Alexey Uzhva " + "Copyright (C) 2008 Elvio Basello ", + "Exports the /trayicon.* interface\n", + trayicon_module_init, + trayicon_module_can_unload, + 0, + trayicon_module_cleanup, + 0) diff --git a/src/modules/trayicon/libkvitrayicon.h b/src/modules/trayicon/libkvitrayicon.h index 5507c91b0..0fefb08b5 100644 --- a/src/modules/trayicon/libkvitrayicon.h +++ b/src/modules/trayicon/libkvitrayicon.h @@ -44,6 +44,7 @@ class KviTrayIconWidget : public QSystemTrayIcon, public KviTrayIcon public: KviTrayIconWidget(); ~KviTrayIconWidget(); + protected: KviDynamicToolTip m_Tip; QMenu * m_pContextPopup; @@ -52,8 +53,8 @@ protected: QLabel * m_pTitleLabel; #endif - QAction* m_pToggleFrame; - QAction* m_pAwayMenuId; + QAction * m_pToggleFrame; + QAction * m_pAwayMenuId; bool m_bFlashed; bool m_bHidden; @@ -65,10 +66,12 @@ protected: unsigned int m_iChannels; unsigned int m_iQueries; unsigned int m_iOther; + public: virtual void refresh(); virtual void die(); void updateIcon(); + protected: void grabActivityInfo(); virtual bool event(QEvent * e); @@ -77,7 +80,7 @@ protected slots: void toggleParentFrame(); void doAway(bool); void flashingTimerShot(); - void activatedSlot( QSystemTrayIcon::ActivationReason reason ); + void activatedSlot(QSystemTrayIcon::ActivationReason reason); void executeInternalCommand(bool); void disableTrayIcon(); }; diff --git a/src/modules/upnp/Manager.cpp b/src/modules/upnp/Manager.cpp index 4bb41969b..db3e8d503 100644 --- a/src/modules/upnp/Manager.cpp +++ b/src/modules/upnp/Manager.cpp @@ -39,137 +39,115 @@ #include #include - namespace UPnP { -// Set the static variable -Manager* Manager::m_pInstance(0); - - -// The constructor -Manager::Manager() -: m_pActiveIgdControlPoint(0) -, m_bBroadcastFailed(false) -, m_bBroadcastFoundIt(false) -, m_pSsdpConnection(0) -, m_pSsdpTimer(0) -{ - -} - - - -// The destructor -Manager::~Manager() -{ - delete m_pSsdpTimer; - delete m_pSsdpConnection; - m_pInstance = 0; // Unregister the instance -} - - - -// Initialize the manager, detect all devices -void Manager::initialize() -{ - qDebug() << "UPnP::Manager: initiating a broadcast to detect UPnP devices..." << endl; - - - // Create the SSDP object to detect devices - m_pSsdpConnection = new SsdpConnection(); - connect(m_pSsdpConnection, SIGNAL( deviceFound(const QString&,int,const QString&) ), - this, SLOT( slotDeviceFound(const QString&,int,const QString&) ) ); - - // Create a timer - m_pSsdpTimer = new QTimer(this); - connect(m_pSsdpTimer, SIGNAL(timeout()), this, SLOT(slotBroadcastTimeout())); - - // Start a UPnP broadcast - m_bBroadcastFailed = false; - m_bBroadcastFoundIt = false; - m_pSsdpConnection->queryDevices(); - m_pSsdpTimer->setSingleShot(true); - m_pSsdpTimer->start(2000); -} - + // Set the static variable + Manager * Manager::m_pInstance(0); - -// Return the instance of the manager class -Manager * Manager::instance() -{ - // Create when it's required - if(m_pInstance == 0) + // The constructor + Manager::Manager() + : m_pActiveIgdControlPoint(0), m_bBroadcastFailed(false), m_bBroadcastFoundIt(false), m_pSsdpConnection(0), m_pSsdpTimer(0) { - m_pInstance = new Manager(); - m_pInstance->initialize(); } - return m_pInstance; -} - - + // The destructor + Manager::~Manager() + { + delete m_pSsdpTimer; + delete m_pSsdpConnection; + m_pInstance = 0; // Unregister the instance + } -// Return the external IP address -QString Manager::getExternalIpAddress() const -{ - // Do not expose activeIgd_; - return (m_pActiveIgdControlPoint != 0 ? m_pActiveIgdControlPoint->getExternalIpAddress() : QString()); -} + // Initialize the manager, detect all devices + void Manager::initialize() + { + qDebug() << "UPnP::Manager: initiating a broadcast to detect UPnP devices..." << endl; + + // Create the SSDP object to detect devices + m_pSsdpConnection = new SsdpConnection(); + connect(m_pSsdpConnection, SIGNAL(deviceFound(const QString &, int, const QString &)), + this, SLOT(slotDeviceFound(const QString &, int, const QString &))); + + // Create a timer + m_pSsdpTimer = new QTimer(this); + connect(m_pSsdpTimer, SIGNAL(timeout()), this, SLOT(slotBroadcastTimeout())); + + // Start a UPnP broadcast + m_bBroadcastFailed = false; + m_bBroadcastFoundIt = false; + m_pSsdpConnection->queryDevices(); + m_pSsdpTimer->setSingleShot(true); + m_pSsdpTimer->start(2000); + } + // Return the instance of the manager class + Manager * Manager::instance() + { + // Create when it's required + if(m_pInstance == 0) + { + m_pInstance = new Manager(); + m_pInstance->initialize(); + } + + return m_pInstance; + } + // Return the external IP address + QString Manager::getExternalIpAddress() const + { + // Do not expose activeIgd_; + return (m_pActiveIgdControlPoint != 0 ? m_pActiveIgdControlPoint->getExternalIpAddress() : QString()); + } -// Return true if a controlable gateway is available -bool Manager::isGatewayAvailable() -{ - return (m_pActiveIgdControlPoint != 0 && m_pActiveIgdControlPoint->isGatewayAvailable()); -} + // Return true if a controlable gateway is available + bool Manager::isGatewayAvailable() + { + return (m_pActiveIgdControlPoint != 0 && m_pActiveIgdControlPoint->isGatewayAvailable()); + } // Add a port mapping -void Manager::addPortMapping(const QString &protocol, const QString &remoteHost, int externalPort, const QString &internalClient, int internalPort, const QString &description, bool enabled, int leaseDuration) -{ - if(m_pActiveIgdControlPoint != 0) - m_pActiveIgdControlPoint->addPortMapping(protocol, remoteHost, externalPort, internalClient, internalPort, description, enabled, leaseDuration); -} - -// Delete a port mapping -void Manager::deletePortMapping(const QString &protocol, const QString &remoteHost, int externalPort) -{ - if(m_pActiveIgdControlPoint != 0) - m_pActiveIgdControlPoint->deletePortMapping(protocol, remoteHost, externalPort); -} - -// The broadcast failed -void Manager::slotBroadcastTimeout() -{ - if(!m_bBroadcastFoundIt) + void Manager::addPortMapping(const QString & protocol, const QString & remoteHost, int externalPort, const QString & internalClient, int internalPort, const QString & description, bool enabled, int leaseDuration) { - qDebug() << "UPnP::Manager: timeout, no broadcast response received!" << endl; + if(m_pActiveIgdControlPoint != 0) + m_pActiveIgdControlPoint->addPortMapping(protocol, remoteHost, externalPort, internalClient, internalPort, description, enabled, leaseDuration); + } - m_bBroadcastFailed = true; + // Delete a port mapping + void Manager::deletePortMapping(const QString & protocol, const QString & remoteHost, int externalPort) + { + if(m_pActiveIgdControlPoint != 0) + m_pActiveIgdControlPoint->deletePortMapping(protocol, remoteHost, externalPort); } -} + // The broadcast failed + void Manager::slotBroadcastTimeout() + { + if(!m_bBroadcastFoundIt) + { + qDebug() << "UPnP::Manager: timeout, no broadcast response received!" << endl; + m_bBroadcastFailed = true; + } + } -// A device was discovered by the SSDP broadcast -void Manager::slotDeviceFound(const QString &hostname, int port, const QString &rootUrl) -{ - qDebug() << "UPnP::Manager: device found, initializing IgdControlPoint to query it." << endl; + // A device was discovered by the SSDP broadcast + void Manager::slotDeviceFound(const QString & hostname, int port, const QString & rootUrl) + { + qDebug() << "UPnP::Manager: device found, initializing IgdControlPoint to query it." << endl; - // this blocks the action of our timeout timer - m_bBroadcastFoundIt = true; + // this blocks the action of our timeout timer + m_bBroadcastFoundIt = true; - IgdControlPoint *controlPoint = new IgdControlPoint(hostname, port, rootUrl); - m_lIgdControlPoints.append(controlPoint); + IgdControlPoint * controlPoint = new IgdControlPoint(hostname, port, rootUrl); + m_lIgdControlPoints.append(controlPoint); - if(m_pActiveIgdControlPoint == 0) - { - m_pActiveIgdControlPoint = controlPoint; - m_pActiveIgdControlPoint->initialize(); + if(m_pActiveIgdControlPoint == 0) + { + m_pActiveIgdControlPoint = controlPoint; + m_pActiveIgdControlPoint->initialize(); + } } -} - - -} // end of namespace +} // end of namespace diff --git a/src/modules/upnp/Manager.h b/src/modules/upnp/Manager.h index 43af04818..69fd14ed5 100644 --- a/src/modules/upnp/Manager.h +++ b/src/modules/upnp/Manager.h @@ -44,7 +44,7 @@ namespace UPnP { -/** + /** * The manager class is the public interface used by other networking classes. * It's implemented as singleton to provide easy access by other classes. * Devices are automatically detected at start-up, and maintained by this class. @@ -53,64 +53,61 @@ namespace UPnP * @author Diederik van der Boor * @ingroup NetworkUPnP */ -class Manager : public QObject -{ - Q_OBJECT - -public: // public methods - - // The destructor - virtual ~Manager(); - - // Return the external IP address - QString getExternalIpAddress() const; - - // Return the instance of the manager class - static Manager * instance(); - - // Return true if a controlable gateway is available - bool isGatewayAvailable(); - - // Add a port mapping - void addPortMapping(const QString &protocol, const QString &remoteHost, int externalPort, const QString &internalClient, int internalPort, const QString &description, bool enabled = true, int leaseDuration = 0); - // Delete a port mapping - void deletePortMapping(const QString &protocol, const QString &remoteHost, int externalPort); - -private slots: - // The broadcast failed - void slotBroadcastTimeout(); - // A device was discovered by the SSDP broadcast - void slotDeviceFound(const QString &hostname, int port, const QString &rootUrl); - - -private: // private methods - // The constructor (it's a singleton) - Manager(); - // Disable the copy constructor - Manager(const Manager &); - // Disable the assign operator - Manager& operator=(const Manager&); - // Initialize the manager, detect all devices - void initialize(); - -private: - // The active control point we're working with - IgdControlPoint *m_pActiveIgdControlPoint; - // True if the broadcast failed (false during the discovery process) - bool m_bBroadcastFailed; - // True if the broadcast found a device (false during the discovery process) - bool m_bBroadcastFoundIt; - // The instance of the singleton class - static Manager *m_pInstance; - // A list of all detected gateway devices - KviPointerList m_lIgdControlPoints; - // The SSDP connection to find all UPnP devices - SsdpConnection *m_pSsdpConnection; - // The timer to detect a broadcast timeout - QTimer *m_pSsdpTimer; -}; - - -} // End of namespace + class Manager : public QObject + { + Q_OBJECT + + public: // public methods + // The destructor + virtual ~Manager(); + + // Return the external IP address + QString getExternalIpAddress() const; + + // Return the instance of the manager class + static Manager * instance(); + + // Return true if a controlable gateway is available + bool isGatewayAvailable(); + + // Add a port mapping + void addPortMapping(const QString & protocol, const QString & remoteHost, int externalPort, const QString & internalClient, int internalPort, const QString & description, bool enabled = true, int leaseDuration = 0); + // Delete a port mapping + void deletePortMapping(const QString & protocol, const QString & remoteHost, int externalPort); + + private slots: + // The broadcast failed + void slotBroadcastTimeout(); + // A device was discovered by the SSDP broadcast + void slotDeviceFound(const QString & hostname, int port, const QString & rootUrl); + + private: // private methods + // The constructor (it's a singleton) + Manager(); + // Disable the copy constructor + Manager(const Manager &); + // Disable the assign operator + Manager & operator=(const Manager &); + // Initialize the manager, detect all devices + void initialize(); + + private: + // The active control point we're working with + IgdControlPoint * m_pActiveIgdControlPoint; + // True if the broadcast failed (false during the discovery process) + bool m_bBroadcastFailed; + // True if the broadcast found a device (false during the discovery process) + bool m_bBroadcastFoundIt; + // The instance of the singleton class + static Manager * m_pInstance; + // A list of all detected gateway devices + KviPointerList m_lIgdControlPoints; + // The SSDP connection to find all UPnP devices + SsdpConnection * m_pSsdpConnection; + // The timer to detect a broadcast timeout + QTimer * m_pSsdpTimer; + }; + +} // End of namespace #endif diff --git a/src/modules/upnp/RootService.cpp b/src/modules/upnp/RootService.cpp index abf945da8..81cd7b23a 100644 --- a/src/modules/upnp/RootService.cpp +++ b/src/modules/upnp/RootService.cpp @@ -43,274 +43,259 @@ namespace UPnP { - // Example message result: - // - // - // - // 1 - // 0 - // - // http://10.0.0.138 - // - // urn:schemas-upnp-org:device:InternetGatewayDevice:1 - // SpeedTouch 510 (0313QZ6S2) - // THOMSON multimedia - // http://www.thomson-multimedia.com - // DSL Internet Gateway - // SpeedTouch - // 510 - // http://www.speedtouch.com - // 0313QZ6S2 - // uuid:UPnP-SpeedTouch510-1_00-90-D0-8E-A1-6F - // /index.htm - // - // - // urn:schemas-upnp-org:service:Layer3Forwarding:1 - // urn:upnp-org:serviceId:layer3f - // /upnp/control/layer3f - // /upnp/event/layer3f - // /Layer3Forwarding.xml - // - // - // - // - // urn:schemas-upnp-org:device:LANDevice:1 - // LANDevice - // THOMSON multimedia - // SpeedTouch - // 0313QZ6S2 - // uuid:UPnP-SpeedTouch510-1_00-90-D0-8E-A1-6F_LD - // - // - // urn:schemas-upnp-org:service:LANHostConfigManagement:1 - // urn:upnp-org:serviceId:lanhcm - // /upnp/control/lanhcm - // /upnp/event/lanhcm - // /LANHostConfigManagement.xml - // - // - // - // - // urn:schemas-upnp-org:device:WANDevice:1 - // WANDevice - // THOMSON multimedia - // SpeedTouch - // 0313QZ6S2 - // uuid:UPnP-SpeedTouch510-1_00-90-D0-8E-A1-6F_WD - // - // - // urn:schemas-upnp-org:service:WANCommonInterfaceConfig:1 - // urn:upnp-org:serviceId:wancic - // /upnp/control/wancic - // /upnp/event/wancic - // /WANCommonInterfaceConfig.xml - // - // - // - // - // urn:schemas-upnp-org:device:WANConnectionDevice:1 - // WANConnectionDevice - // THOMSON multimedia - // SpeedTouch - // 0313QZ6S2 - // uuid:UPnP-SpeedTouch510-1_00-90-D0-8E-A1-6F_WCDpppoa - // - // - // urn:schemas-upnp-org:service:WANDSLLinkConfig:1 - // urn:upnp-org:serviceId:wandsllc:pppoa - // /upnp/control/wandsllcpppoa - // /upnp/event/wandsllcpppoa - // /WANDSLLinkConfig.xml - // - // - // urn:schemas-upnp-org:service:WANPPPConnection:1 - // urn:upnp-org:serviceId:wanpppc:pppoa - // /upnp/control/wanpppcpppoa - // /upnp/event/wanpppcpppoa - // /WANPPPConnection.xml - // - // - // - // - // - // - // - // - - -// The contructor -RootService::RootService(const QString &hostname, int port, const QString &rootUrl) -: Service(hostname, port, rootUrl) -, m_szHostname(hostname) -, m_iPort(port) -{ - -} - - -// The destructor -RootService::~RootService() -{ - -} - - -// Recursively add all devices and embedded devices to the deviceServices_ map -void RootService::addDeviceServices(const QDomNode &device) -{ - qDebug() << "UPnP discovered device " << XmlFunctions::getNodeValue(device, "/UDN") << endl; - - if(XmlFunctions::getNodeValue(device, "/deviceType") == InternetGatewayDeviceType) + // Example message result: + // + // + // + // 1 + // 0 + // + // http://10.0.0.138 + // + // urn:schemas-upnp-org:device:InternetGatewayDevice:1 + // SpeedTouch 510 (0313QZ6S2) + // THOMSON multimedia + // http://www.thomson-multimedia.com + // DSL Internet Gateway + // SpeedTouch + // 510 + // http://www.speedtouch.com + // 0313QZ6S2 + // uuid:UPnP-SpeedTouch510-1_00-90-D0-8E-A1-6F + // /index.htm + // + // + // urn:schemas-upnp-org:service:Layer3Forwarding:1 + // urn:upnp-org:serviceId:layer3f + // /upnp/control/layer3f + // /upnp/event/layer3f + // /Layer3Forwarding.xml + // + // + // + // + // urn:schemas-upnp-org:device:LANDevice:1 + // LANDevice + // THOMSON multimedia + // SpeedTouch + // 0313QZ6S2 + // uuid:UPnP-SpeedTouch510-1_00-90-D0-8E-A1-6F_LD + // + // + // urn:schemas-upnp-org:service:LANHostConfigManagement:1 + // urn:upnp-org:serviceId:lanhcm + // /upnp/control/lanhcm + // /upnp/event/lanhcm + // /LANHostConfigManagement.xml + // + // + // + // + // urn:schemas-upnp-org:device:WANDevice:1 + // WANDevice + // THOMSON multimedia + // SpeedTouch + // 0313QZ6S2 + // uuid:UPnP-SpeedTouch510-1_00-90-D0-8E-A1-6F_WD + // + // + // urn:schemas-upnp-org:service:WANCommonInterfaceConfig:1 + // urn:upnp-org:serviceId:wancic + // /upnp/control/wancic + // /upnp/event/wancic + // /WANCommonInterfaceConfig.xml + // + // + // + // + // urn:schemas-upnp-org:device:WANConnectionDevice:1 + // WANConnectionDevice + // THOMSON multimedia + // SpeedTouch + // 0313QZ6S2 + // uuid:UPnP-SpeedTouch510-1_00-90-D0-8E-A1-6F_WCDpppoa + // + // + // urn:schemas-upnp-org:service:WANDSLLinkConfig:1 + // urn:upnp-org:serviceId:wandsllc:pppoa + // /upnp/control/wandsllcpppoa + // /upnp/event/wandsllcpppoa + // /WANDSLLinkConfig.xml + // + // + // urn:schemas-upnp-org:service:WANPPPConnection:1 + // urn:upnp-org:serviceId:wanpppc:pppoa + // /upnp/control/wanpppcpppoa + // /upnp/event/wanpppcpppoa + // /WANPPPConnection.xml + // + // + // + // + // + // + // + // + + // The contructor + RootService::RootService(const QString & hostname, int port, const QString & rootUrl) + : Service(hostname, port, rootUrl), m_szHostname(hostname), m_iPort(port) { - QString description; - description = XmlFunctions::getNodeValue(device, "/friendlyName"); - if(description.isNull()) - description = XmlFunctions::getNodeValue(device, "/modelDescription"); - if(description.isNull()) - description = XmlFunctions::getNodeValue(device, "/modelName") + " " + XmlFunctions::getNodeValue(device, "/modelNumber"); - if(description.isNull()) - description = __tr2qs("Unknown"); - - qDebug() << "Model: " << description << endl; - - g_pApp->activeConsole()->output(KVI_OUT_GENERICSTATUS,__tr2qs_ctx("[UPNP]: found gateway device: %s","upnp"), description.toUtf8().data()); - - } - // Insert the given device node - // The "key" is the device/UDN tag, the value is a list of device/serviceList/service nodes - m_deviceServices.insert(XmlFunctions::getNodeValue(device, "/UDN"), - device.namedItem("serviceList").childNodes()); - // Find all embedded device nodes - QDomNodeList embeddedDevices = device.namedItem("deviceList").childNodes(); - for(int i = 0; i < embeddedDevices.count(); i++) + // The destructor + RootService::~RootService() { - if(embeddedDevices.item(i).nodeName() != "device") continue; - addDeviceServices(embeddedDevices.item(i)); } -} - - - -// Return the device type -QString RootService::getDeviceType() const -{ - return m_szDeviceType; -} - -// Return a service from the cached root device entry -ServiceParameters RootService::getServiceById(const QString &serviceId) const -{ - // Get a /root/device/serviceList/service/ tag - - ServiceParameters params; - QMap::const_iterator i = m_deviceServices.constBegin(); - while (i != m_deviceServices.constEnd()) { - if(getServiceById(serviceId, i.key(), params)) - return params; - ++i; + // Recursively add all devices and embedded devices to the deviceServices_ map + void RootService::addDeviceServices(const QDomNode & device) + { + qDebug() << "UPnP discovered device " << XmlFunctions::getNodeValue(device, "/UDN") << endl; + + if(XmlFunctions::getNodeValue(device, "/deviceType") == InternetGatewayDeviceType) + { + QString description; + description = XmlFunctions::getNodeValue(device, "/friendlyName"); + if(description.isNull()) + description = XmlFunctions::getNodeValue(device, "/modelDescription"); + if(description.isNull()) + description = XmlFunctions::getNodeValue(device, "/modelName") + " " + XmlFunctions::getNodeValue(device, "/modelNumber"); + if(description.isNull()) + description = __tr2qs("Unknown"); + + qDebug() << "Model: " << description << endl; + + g_pApp->activeConsole()->output(KVI_OUT_GENERICSTATUS, __tr2qs_ctx("[UPNP]: found gateway device: %s", "upnp"), description.toUtf8().data()); + } + // Insert the given device node + // The "key" is the device/UDN tag, the value is a list of device/serviceList/service nodes + m_deviceServices.insert(XmlFunctions::getNodeValue(device, "/UDN"), + device.namedItem("serviceList").childNodes()); + + // Find all embedded device nodes + QDomNodeList embeddedDevices = device.namedItem("deviceList").childNodes(); + for(int i = 0; i < embeddedDevices.count(); i++) + { + if(embeddedDevices.item(i).nodeName() != "device") + continue; + addDeviceServices(embeddedDevices.item(i)); + } } - //calling function check this field to understand if the struct is null - params.controlUrl = QString(); - return params; -} - -// Return a service from a cached embedded device entry -bool RootService::getServiceById(const QString &serviceId, const QString &deviceUdn, ServiceParameters ¶ms) const -{ - // Get a /root/device/deviceList/device/.../serviceList/service/serviceId tag - QDomNode service = XmlFunctions::getNodeChildByKey( m_deviceServices[deviceUdn], "serviceId", serviceId ); - - if(! service.isNull()) + // Return the device type + QString RootService::getDeviceType() const { - params.hostname = m_szHostname; - params.port = m_iPort; - params.controlUrl = XmlFunctions::getNodeValue(service, "/controlURL"); - params.scpdUrl = XmlFunctions::getNodeValue(service, "/SCPDURL"); - params.serviceId = XmlFunctions::getNodeValue(service, "/serviceId"); - params.serviceType = XmlFunctions::getNodeValue(service, "/serviceType"); - - return true; - } else { - return false; + return m_szDeviceType; } -} - - -// Return a service from the cached root device entry -ServiceParameters RootService::getServiceByType(const QString &serviceType) const -{ - // Get a /root/device/serviceList/service/ tag - ServiceParameters params; - QMap::const_iterator i = m_deviceServices.constBegin(); - while (i != m_deviceServices.constEnd()) { - if(getServiceByType(serviceType, i.key(), params)) - return params; - ++i; + // Return a service from the cached root device entry + ServiceParameters RootService::getServiceById(const QString & serviceId) const + { + // Get a /root/device/serviceList/service/ tag + + ServiceParameters params; + QMap::const_iterator i = m_deviceServices.constBegin(); + while(i != m_deviceServices.constEnd()) + { + if(getServiceById(serviceId, i.key(), params)) + return params; + ++i; + } + + //calling function check this field to understand if the struct is null + params.controlUrl = QString(); + return params; } - //calling function check this field to understand if the struct is null - params.controlUrl = QString(); - return params; - -} - - - -// Return a service from a cached embedded device entry -bool RootService::getServiceByType(const QString &serviceType, const QString &deviceUdn, ServiceParameters ¶ms) const -{ - // Get a /root/device/deviceList/device/.../serviceList/service/serviceType tag - QDomNode service = XmlFunctions::getNodeChildByKey( m_deviceServices[deviceUdn], "serviceType", serviceType ); - - if(! service.isNull()) + // Return a service from a cached embedded device entry + bool RootService::getServiceById(const QString & serviceId, const QString & deviceUdn, ServiceParameters & params) const { - params.hostname = m_szHostname; - params.port = m_iPort; - params.controlUrl = XmlFunctions::getNodeValue(service, "/controlURL"); - params.scpdUrl = XmlFunctions::getNodeValue(service, "/SCPDURL"); - params.serviceId = XmlFunctions::getNodeValue(service, "/serviceId"); - params.serviceType = serviceType; - - return true; - } else { - qWarning() << "UPnP::RootService::getServiceByType -" - << " type '" << serviceType << "' not found for device '" << deviceUdn << "'." << endl; - - return false; + // Get a /root/device/deviceList/device/.../serviceList/service/serviceId tag + QDomNode service = XmlFunctions::getNodeChildByKey(m_deviceServices[deviceUdn], "serviceId", serviceId); + + if(!service.isNull()) + { + params.hostname = m_szHostname; + params.port = m_iPort; + params.controlUrl = XmlFunctions::getNodeValue(service, "/controlURL"); + params.scpdUrl = XmlFunctions::getNodeValue(service, "/SCPDURL"); + params.serviceId = XmlFunctions::getNodeValue(service, "/serviceId"); + params.serviceType = XmlFunctions::getNodeValue(service, "/serviceType"); + + return true; + } + else + { + return false; + } } -} - + // Return a service from the cached root device entry + ServiceParameters RootService::getServiceByType(const QString & serviceType) const + { + // Get a /root/device/serviceList/service/ tag + + ServiceParameters params; + QMap::const_iterator i = m_deviceServices.constBegin(); + while(i != m_deviceServices.constEnd()) + { + if(getServiceByType(serviceType, i.key(), params)) + return params; + ++i; + } + + //calling function check this field to understand if the struct is null + params.controlUrl = QString(); + return params; + } -// The control point received a response to callInformationUrl() -void RootService::gotInformationResponse(const QDomNode &response) -{ - // Register all device UDN nodes for later - m_deviceServices.clear(); - addDeviceServices( XmlFunctions::getNode(response, "/device") ); - - // Fetch the required data - m_szDeviceType = XmlFunctions::getNodeValue(response, "/device/deviceType"); - m_szRootUdn = XmlFunctions::getNodeValue(response, "/device/UDN"); - - // The rootUdn_ is used to retrieve - // the /root/device/serviceList/service - // nodes from the deviceServices_ map -} - + // Return a service from a cached embedded device entry + bool RootService::getServiceByType(const QString & serviceType, const QString & deviceUdn, ServiceParameters & params) const + { + // Get a /root/device/deviceList/device/.../serviceList/service/serviceType tag + QDomNode service = XmlFunctions::getNodeChildByKey(m_deviceServices[deviceUdn], "serviceType", serviceType); + + if(!service.isNull()) + { + params.hostname = m_szHostname; + params.port = m_iPort; + params.controlUrl = XmlFunctions::getNodeValue(service, "/controlURL"); + params.scpdUrl = XmlFunctions::getNodeValue(service, "/SCPDURL"); + params.serviceId = XmlFunctions::getNodeValue(service, "/serviceId"); + params.serviceType = serviceType; + + return true; + } + else + { + qWarning() << "UPnP::RootService::getServiceByType -" + << " type '" << serviceType << "' not found for device '" << deviceUdn << "'." << endl; + + return false; + } + } + // The control point received a response to callInformationUrl() + void RootService::gotInformationResponse(const QDomNode & response) + { + // Register all device UDN nodes for later + m_deviceServices.clear(); + addDeviceServices(XmlFunctions::getNode(response, "/device")); -// Query the device for its service list -void RootService::queryDevice() -{ - callInformationUrl(); -} + // Fetch the required data + m_szDeviceType = XmlFunctions::getNodeValue(response, "/device/deviceType"); + m_szRootUdn = XmlFunctions::getNodeValue(response, "/device/UDN"); + // The rootUdn_ is used to retrieve + // the /root/device/serviceList/service + // nodes from the deviceServices_ map + } + // Query the device for its service list + void RootService::queryDevice() + { + callInformationUrl(); + } } // end of namespae diff --git a/src/modules/upnp/RootService.h b/src/modules/upnp/RootService.h index 750ce5a9f..971e86be2 100644 --- a/src/modules/upnp/RootService.h +++ b/src/modules/upnp/RootService.h @@ -36,13 +36,12 @@ #include "Service.h" - namespace UPnP { #define InternetGatewayDeviceType "urn:schemas-upnp-org:device:InternetGatewayDevice:1" -/** + /** * The services of a device can be retrieved using the device root service. * The URL of the root service is returned by an SSDP broadcast. * The root service returns the meta information and list of services the device supports. @@ -50,54 +49,49 @@ namespace UPnP * @author Diederik van der Boor * @ingroup NetworkUPnP */ -class RootService : public Service -{ -public: // public methods - - // The constructor - RootService(const QString &hostname, int port, const QString &rootUrl); - // The destructor - virtual ~RootService(); - - // Return the device type - QString getDeviceType() const; - - // Return a service from the cached root device entry - ServiceParameters getServiceById(const QString &serviceId) const; - // Return a service from a cached embedded device entry - bool getServiceById(const QString &serviceId, const QString &deviceUdn, ServiceParameters ¶ms) const; - // Return a service from the cached root device entry - ServiceParameters getServiceByType(const QString &serviceType) const; - // Return a service from a cached embedded device entry - bool getServiceByType(const QString &serviceType, const QString &deviceUdn, ServiceParameters ¶ms) const; - - // Query the device for its service list - void queryDevice(); - - -protected: // Protected methods - // The control point received a response to callInformationUrl() - virtual void gotInformationResponse(const QDomNode &response); - - -private: // Private methods - // Recursively add all devices and embedded devices to the deviceServices_ map - void addDeviceServices(const QDomNode &device); - - -private: - // The device type - QString m_szDeviceType; - // A collection of all services provided by the device - QMap m_deviceServices; - // The hostname of the device - QString m_szHostname; - // The port of the device - int m_iPort; - // The udn of the root device - QString m_szRootUdn; -}; - + class RootService : public Service + { + public: // public methods + // The constructor + RootService(const QString & hostname, int port, const QString & rootUrl); + // The destructor + virtual ~RootService(); + + // Return the device type + QString getDeviceType() const; + + // Return a service from the cached root device entry + ServiceParameters getServiceById(const QString & serviceId) const; + // Return a service from a cached embedded device entry + bool getServiceById(const QString & serviceId, const QString & deviceUdn, ServiceParameters & params) const; + // Return a service from the cached root device entry + ServiceParameters getServiceByType(const QString & serviceType) const; + // Return a service from a cached embedded device entry + bool getServiceByType(const QString & serviceType, const QString & deviceUdn, ServiceParameters & params) const; + + // Query the device for its service list + void queryDevice(); + + protected: // Protected methods + // The control point received a response to callInformationUrl() + virtual void gotInformationResponse(const QDomNode & response); + + private: // Private methods + // Recursively add all devices and embedded devices to the deviceServices_ map + void addDeviceServices(const QDomNode & device); + + private: + // The device type + QString m_szDeviceType; + // A collection of all services provided by the device + QMap m_deviceServices; + // The hostname of the device + QString m_szHostname; + // The port of the device + int m_iPort; + // The udn of the root device + QString m_szRootUdn; + }; } #endif diff --git a/src/modules/upnp/Service.cpp b/src/modules/upnp/Service.cpp index 747250531..e0547bfc2 100644 --- a/src/modules/upnp/Service.cpp +++ b/src/modules/upnp/Service.cpp @@ -45,304 +45,280 @@ // http://www.knoxscape.com/Upnp/NAT.htm // http://www.artima.com/spontaneous/upnp_digihome2.html - namespace UPnP { + // The constructor for information services + Service::Service(const QString & hostname, int port, const QString & informationUrl) + : m_iPendingRequests(0), m_szBaseXmlPrefix("s"), m_szHostname(hostname), m_iPort(port) + { + m_szInformationUrl = informationUrl; + qDebug() << "UPnP::Service: created information service url='" << m_szInformationUrl << "'." << endl; + } -// The constructor for information services -Service::Service(const QString &hostname, int port, const QString &informationUrl) -: m_iPendingRequests(0) -, m_szBaseXmlPrefix("s") -, m_szHostname(hostname) -, m_iPort(port) -{ - m_szInformationUrl = informationUrl; - qDebug() << "UPnP::Service: created information service url='" << m_szInformationUrl << "'." << endl; -} - - -// The constructor for action services -Service::Service(const ServiceParameters ¶ms) -: m_szControlUrl(params.controlUrl) -, m_szInformationUrl(params.scpdUrl) -, m_iPendingRequests(0) -, m_szServiceId(params.serviceId) -, m_szServiceType(params.serviceType) -, m_szBaseXmlPrefix("s") -, m_szHostname(params.hostname) -, m_iPort(params.port) -{ - qDebug() << "CREATED UPnP::Service: url='" << m_szControlUrl << "' id='" << m_szServiceId << "'." << endl; -} - - - -// The destructor -Service::~Service() -{ - qDebug() << "DESTROYED UPnP::Service [url=" << m_szControlUrl << ", id=" << m_szServiceId << "]" << endl; -} - - - -// Makes a UPnP action request -// TODO: rename to callMethod / callSoapMethod -int Service::callAction(const QString &actionName, const QString &prefix) -{ - return callActionInternal(actionName, 0, prefix); -} - - + // The constructor for action services + Service::Service(const ServiceParameters & params) + : m_szControlUrl(params.controlUrl), m_szInformationUrl(params.scpdUrl), m_iPendingRequests(0), m_szServiceId(params.serviceId), m_szServiceType(params.serviceType), m_szBaseXmlPrefix("s"), m_szHostname(params.hostname), m_iPort(params.port) + { + qDebug() << "CREATED UPnP::Service: url='" << m_szControlUrl << "' id='" << m_szServiceId << "'." << endl; + } -// Makes a UPnP action request -int Service::callAction(const QString &actionName, const QMap &arguments, const QString &prefix) -{ - return callActionInternal(actionName, &arguments, prefix); -} + // The destructor + Service::~Service() + { + qDebug() << "DESTROYED UPnP::Service [url=" << m_szControlUrl << ", id=" << m_szServiceId << "]" << endl; + } + // Makes a UPnP action request + // TODO: rename to callMethod / callSoapMethod + int Service::callAction(const QString & actionName, const QString & prefix) + { + return callActionInternal(actionName, 0, prefix); + } + // Makes a UPnP action request + int Service::callAction(const QString & actionName, const QMap & arguments, const QString & prefix) + { + return callActionInternal(actionName, &arguments, prefix); + } -// Makes a UPnP action request (keeps pointers from the external interface) -int Service::callActionInternal(const QString &actionName, const QMap *arguments, const QString &prefix) -{ - qDebug() << "UPnP::Service: calling remote procedure '" << actionName << "'." << endl; - - // Create the data message - //NOTE: we shouldm use serviceId_ instead of serviceType_, but it seems that my router - // (and maybe others) are reporting wrong Ids, while they're gonna accepting only the - // correct ones. This is a decoded reply from my Zyxel: - - // Service : - // servicetype = urn:schemas-upnp-org:service:Layer3Forwarding:1 - // controlurl = /UD/act?0 - // eventsuburl = /?0 - // scpdurl = /L3Fwd.xml - // serviceid = urn:upnp-org:serviceId:L3Forwarding1 - - // this router wants us to use servicetype in the following requests - - QString soapMessage = "\r\n" - "<" + m_szBaseXmlPrefix + ":Envelope xmlns:" + m_szBaseXmlPrefix + "=\"http://schemas.xmlsoap.org/soap/envelope/\"" - " " + m_szBaseXmlPrefix + ":encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\">\n" - " <" + m_szBaseXmlPrefix + ":Body>\n" - " <" + prefix + ":" + actionName + " xmlns:" + prefix + "=\"" + m_szServiceType + "\">\n"; - - // Do we have any arguments? - if(arguments != 0) + // Makes a UPnP action request (keeps pointers from the external interface) + int Service::callActionInternal(const QString & actionName, const QMap * arguments, const QString & prefix) { - // Add the arguments - QMap::const_iterator it; - for(it = arguments->begin(); it != arguments->end(); ++it) + qDebug() << "UPnP::Service: calling remote procedure '" << actionName << "'." << endl; + + // Create the data message + //NOTE: we shouldm use serviceId_ instead of serviceType_, but it seems that my router + // (and maybe others) are reporting wrong Ids, while they're gonna accepting only the + // correct ones. This is a decoded reply from my Zyxel: + + // Service : + // servicetype = urn:schemas-upnp-org:service:Layer3Forwarding:1 + // controlurl = /UD/act?0 + // eventsuburl = /?0 + // scpdurl = /L3Fwd.xml + // serviceid = urn:upnp-org:serviceId:L3Forwarding1 + + // this router wants us to use servicetype in the following requests + + QString soapMessage = "\r\n" + "<" + + m_szBaseXmlPrefix + ":Envelope xmlns:" + m_szBaseXmlPrefix + "=\"http://schemas.xmlsoap.org/soap/envelope/\"" + " " + + m_szBaseXmlPrefix + ":encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\">\n" + " <" + + m_szBaseXmlPrefix + ":Body>\n" + " <" + + prefix + ":" + actionName + " xmlns:" + prefix + "=\"" + m_szServiceType + "\">\n"; + + // Do we have any arguments? + if(arguments != 0) { - QString argumentName = it.key(); - soapMessage += "<" + argumentName + ">" + it.value() + ""; + // Add the arguments + QMap::const_iterator it; + for(it = arguments->begin(); it != arguments->end(); ++it) + { + QString argumentName = it.key(); + soapMessage += "<" + argumentName + ">" + it.value() + ""; + } } - } - - // Add the closing tags - soapMessage += " \n \n\n"; - - // Get an utf8 encoding string - QByteArray content = soapMessage.toUtf8().data(); - - // Create the HTTP header - QNetworkRequest request; - request.setHeader(QNetworkRequest::ContentTypeHeader, "text/xml"); - request.setHeader(QNetworkRequest::ContentLengthHeader, content.size()); - request.setRawHeader("SOAPAction", QString("\"%1#%2\"").arg(m_szServiceType, actionName).toUtf8()); - - QString port; - port.setNum(m_iPort); - request.setRawHeader("HOST", QString("%1:%2").arg(m_szHostname, port).toUtf8()); - - QUrl url; - url.setHost(m_szHostname); - url.setPort(m_iPort); - request.setUrl(url); - - // Send the POST request - m_iPendingRequests++; - QByteArray dummy; - QNetworkReply * pReply = KviNetworkAccessManager::getInstance()->post(request, dummy); - connect(pReply, SIGNAL(finished()), this, SLOT(slotRequestFinished())); + // Add the closing tags + soapMessage += " \n \n\n"; - return 0; -} + // Get an utf8 encoding string + QByteArray content = soapMessage.toUtf8().data(); + // Create the HTTP header + QNetworkRequest request; + request.setHeader(QNetworkRequest::ContentTypeHeader, "text/xml"); + request.setHeader(QNetworkRequest::ContentLengthHeader, content.size()); + request.setRawHeader("SOAPAction", QString("\"%1#%2\"").arg(m_szServiceType, actionName).toUtf8()); + QString port; + port.setNum(m_iPort); + request.setRawHeader("HOST", QString("%1:%2").arg(m_szHostname, port).toUtf8()); + QUrl url; + url.setHost(m_szHostname); + url.setPort(m_iPort); + request.setUrl(url); -// Makes a UPnP service request -// TODO: rename to downloadFile() -int Service::callInformationUrl() -{ - qDebug() << "UPnP::Service: requesting file '" << m_szInformationUrl << "'." << endl; - - // Send the GET request - // TODO: User-Agent: Mozilla/4.0 (compatible; UPnP/1.0; Windows NT/5.1) - m_iPendingRequests++; - - QNetworkRequest request; - QByteArray dummy; - QUrl url; - url.setHost(m_szHostname); - url.setPort(m_iPort); - url.setPath(m_szInformationUrl); - request.setUrl(url); - QNetworkReply * pReply = KviNetworkAccessManager::getInstance()->post(request, dummy); - connect(pReply, SIGNAL(finished()), this, SLOT(slotRequestFinished())); - - return 0; -} - - - -// Get the number of pending requests -int Service::getPendingRequests() const -{ - return m_iPendingRequests; -} - - -// The control point received an action failure indication -void Service::gotActionErrorResponse(const QDomNode &response) -{ - QString faultString = XmlFunctions::getNodeValue(response, "/faultstring"); - QString errorCode = XmlFunctions::getNodeValue(response, "/detail/" + faultString + "/errorCode"); - QString errorDescription = XmlFunctions::getNodeValue(response, "/detail/" + faultString + "/errorDescription"); - qWarning() << "UPnP::Service - Action failed: " << errorCode << " " << errorDescription << endl; -} + // Send the POST request + m_iPendingRequests++; + QByteArray dummy; + QNetworkReply * pReply = KviNetworkAccessManager::getInstance()->post(request, dummy); + connect(pReply, SIGNAL(finished()), this, SLOT(slotRequestFinished())); + return 0; + } -// The control point received a response to callAction() -void Service::gotActionResponse(const QString &responseType, const QMap &/*resultValues*/) -{ - qWarning() << "UPnP::Service - Action response '" << responseType << "' is not handled." << endl; -} - - - -// The control point received a response to callInformationUrl() -void Service::gotInformationResponse(const QDomNode &response) -{ - QString rootTagName = response.nodeName(); - qWarning() << "UPnP::Service - Service response (with root '" << rootTagName << "') is not handled." << endl; -} - - + // Makes a UPnP service request + // TODO: rename to downloadFile() + int Service::callInformationUrl() + { + qDebug() << "UPnP::Service: requesting file '" << m_szInformationUrl << "'." << endl; + + // Send the GET request + // TODO: User-Agent: Mozilla/4.0 (compatible; UPnP/1.0; Windows NT/5.1) + m_iPendingRequests++; + + QNetworkRequest request; + QByteArray dummy; + QUrl url; + url.setHost(m_szHostname); + url.setPort(m_iPort); + url.setPath(m_szInformationUrl); + request.setUrl(url); + QNetworkReply * pReply = KviNetworkAccessManager::getInstance()->post(request, dummy); + connect(pReply, SIGNAL(finished()), this, SLOT(slotRequestFinished())); + + return 0; + } -// The QHttp object retrieved data. -void Service::slotRequestFinished() -{ - QNetworkReply *reply = qobject_cast(sender()); + // Get the number of pending requests + int Service::getPendingRequests() const + { + return m_iPendingRequests; + } - qDebug() << "UPnP::Service: received HTTP response for request " << endl; + // The control point received an action failure indication + void Service::gotActionErrorResponse(const QDomNode & response) + { + QString faultString = XmlFunctions::getNodeValue(response, "/faultstring"); + QString errorCode = XmlFunctions::getNodeValue(response, "/detail/" + faultString + "/errorCode"); + QString errorDescription = XmlFunctions::getNodeValue(response, "/detail/" + faultString + "/errorDescription"); + qWarning() << "UPnP::Service - Action failed: " << errorCode << " " << errorDescription << endl; + } - if(!reply) + // The control point received a response to callAction() + void Service::gotActionResponse(const QString & responseType, const QMap & /*resultValues*/) { - qWarning() << "UPnP::Service - HTTP Request failed: " << reply->errorString() << endl; - m_iPendingRequests--; - emit queryFinished(true); - return; + qWarning() << "UPnP::Service - Action response '" << responseType << "' is not handled." << endl; } - if (reply->error() != QNetworkReply::NoError) + // The control point received a response to callInformationUrl() + void Service::gotInformationResponse(const QDomNode & response) { - qWarning() << "UPnP::Service - HTTP Request failed: " << reply->errorString() << endl; - m_iPendingRequests--; - emit queryFinished(true); - reply->deleteLater(); - return; + QString rootTagName = response.nodeName(); + qWarning() << "UPnP::Service - Service response (with root '" << rootTagName << "') is not handled." << endl; } - // Get the XML content - QByteArray response = reply->readAll(); - QDomDocument xml; + // The QHttp object retrieved data. + void Service::slotRequestFinished() + { + QNetworkReply * reply = qobject_cast(sender()); - qDebug() << "Response:\n" << response << "\n---\n"; + qDebug() << "UPnP::Service: received HTTP response for request " << endl; - // Parse the XML - QString errorMessage; - bool error = ! xml.setContent(response, false, &errorMessage); + if(!reply) + { + qWarning() << "UPnP::Service - HTTP Request failed: " << reply->errorString() << endl; + m_iPendingRequests--; + emit queryFinished(true); + return; + } - if(!error) - { - //extract the xml prefix used by the device; should be "s" + if(reply->error() != QNetworkReply::NoError) + { + qWarning() << "UPnP::Service - HTTP Request failed: " << reply->errorString() << endl; + m_iPendingRequests--; + emit queryFinished(true); + reply->deleteLater(); + return; + } + + // Get the XML content + QByteArray response = reply->readAll(); + QDomDocument xml; - //this is the reply of my Zyxel: - // - // - // - // WANIPConnection - // - // - // + qDebug() << "Response:\n" << response << "\n---\n"; - QString baseNamespace = xml.documentElement().tagName(); + // Parse the XML + QString errorMessage; + bool error = !xml.setContent(response, false, &errorMessage); - if(baseNamespace.length() > 0) + if(!error) { - int cutAt = baseNamespace.indexOf(':'); - if(cutAt > -1) + //extract the xml prefix used by the device; should be "s" + + //this is the reply of my Zyxel: + // + // + // + // WANIPConnection + // + // + // + + QString baseNamespace = xml.documentElement().tagName(); + + if(baseNamespace.length() > 0) { - baseNamespace.truncate(cutAt); - qDebug() << "Device is using " << baseNamespace << " as XML namespace" << endl; - m_szBaseXmlPrefix = baseNamespace; + int cutAt = baseNamespace.indexOf(':'); + if(cutAt > -1) + { + baseNamespace.truncate(cutAt); + qDebug() << "Device is using " << baseNamespace << " as XML namespace" << endl; + m_szBaseXmlPrefix = baseNamespace; + } } - } - // Determine how to process the data - if(xml.namedItem(m_szBaseXmlPrefix + ":Envelope").isNull()) - { - qDebug() << "UPnP::Service: plain XML detected, calling gotInformationResponse()." << endl; - // No SOAP envelope found, this is a normal response to callService() - gotInformationResponse( xml.lastChild() ); - } else { - qDebug() << xml.toString() << endl; - // Got a SOAP message response to callAction() - QDomNode resultNode = XmlFunctions::getNode(xml, "/" + m_szBaseXmlPrefix + ":Envelope/" + m_szBaseXmlPrefix + ":Body").firstChild(); + // Determine how to process the data + if(xml.namedItem(m_szBaseXmlPrefix + ":Envelope").isNull()) + { + qDebug() << "UPnP::Service: plain XML detected, calling gotInformationResponse()." << endl; + // No SOAP envelope found, this is a normal response to callService() + gotInformationResponse(xml.lastChild()); + } + else + { + qDebug() << xml.toString() << endl; + // Got a SOAP message response to callAction() + QDomNode resultNode = XmlFunctions::getNode(xml, "/" + m_szBaseXmlPrefix + ":Envelope/" + m_szBaseXmlPrefix + ":Body").firstChild(); - error = (resultNode.nodeName() == m_szBaseXmlPrefix + ":Fault"); + error = (resultNode.nodeName() == m_szBaseXmlPrefix + ":Fault"); - if(! error) - { - if(resultNode.nodeName().startsWith("m:") || resultNode.nodeName().startsWith("u:")) + if(!error) { - qDebug() << "UPnP::Service: SOAP envelope detected, calling gotActionResponse()." << endl; - // Action success, return SOAP body - QMap resultValues; - - // Parse all parameters - // It's possible to pass the entire QDomNode object to the gotActionResponse() - // function, but this is somewhat nicer, and reduces code boat in the subclasses - QDomNodeList children = resultNode.childNodes(); - for(int i = 0; i < children.count(); i++) + if(resultNode.nodeName().startsWith("m:") || resultNode.nodeName().startsWith("u:")) { - QString key = children.item(i).nodeName(); - resultValues[ key ] = children.item(i).toElement().text(); + qDebug() << "UPnP::Service: SOAP envelope detected, calling gotActionResponse()." << endl; + // Action success, return SOAP body + QMap resultValues; + + // Parse all parameters + // It's possible to pass the entire QDomNode object to the gotActionResponse() + // function, but this is somewhat nicer, and reduces code boat in the subclasses + QDomNodeList children = resultNode.childNodes(); + for(int i = 0; i < children.count(); i++) + { + QString key = children.item(i).nodeName(); + resultValues[key] = children.item(i).toElement().text(); + } + + // Call the gotActionResponse() + gotActionResponse(resultNode.nodeName().mid(2), resultValues); } - - // Call the gotActionResponse() - gotActionResponse(resultNode.nodeName().mid(2), resultValues); } - } else { - qDebug() << "UPnP::Service: SOAP error detected, calling gotActionResponse()." << endl; + else + { + qDebug() << "UPnP::Service: SOAP error detected, calling gotActionResponse()." << endl; - // Action failed - gotActionErrorResponse(resultNode); + // Action failed + gotActionErrorResponse(resultNode); + } } } - } else { - qWarning() << "UPnP::Service - XML parsing failed: " << errorMessage << endl; - } - - // Only emit when bytes>0 - m_iPendingRequests--; - emit queryFinished(error); -} + else + { + qWarning() << "UPnP::Service - XML parsing failed: " << errorMessage << endl; + } + // Only emit when bytes>0 + m_iPendingRequests--; + emit queryFinished(error); + } } // end of namespace diff --git a/src/modules/upnp/Service.h b/src/modules/upnp/Service.h index a4d77bf84..de81a5ee6 100644 --- a/src/modules/upnp/Service.h +++ b/src/modules/upnp/Service.h @@ -42,20 +42,19 @@ namespace UPnP { -// A datablock to make the exchange -// of service information easier -struct ServiceParameters -{ - QString hostname; - int port; - QString scpdUrl; - QString controlUrl; - QString serviceId; - QString serviceType; -}; - - -/** + // A datablock to make the exchange + // of service information easier + struct ServiceParameters + { + QString hostname; + int port; + QString scpdUrl; + QString controlUrl; + QString serviceId; + QString serviceType; + }; + + /** * This base class to implement calls to a UPnP-enabled device. * In UPnP terminology, a client is called a Control Point, and a service is a UPnP device. * @@ -66,68 +65,66 @@ struct ServiceParameters * @author Diederik van der Boor * @ingroup NetworkUPnP */ -class Service : public QObject -{ - Q_OBJECT - -public: // public methods - // The constructor for the root service - Service(const QString &hostname, int port, const QString &informationUrl); - // The constructor for action services - Service(const ServiceParameters ¶ms); - // The destructor - virtual ~Service(); - - // Get the number of pending requests - int getPendingRequests() const; - - -protected: // Protected methods - // Makes a UPnP action request - int callAction(const QString &actionName, const QString &prefix); - // Makes a UPnP action request - int callAction(const QString &actionName, const QMap &arguments, const QString &prefix); - // Makes a UPnP service request - int callInformationUrl(); - - // The control point received an action failure indication - virtual void gotActionErrorResponse(const QDomNode &response); - // The control point received a response to callAction() - virtual void gotActionResponse(const QString &responseType, const QMap &resultValues); - // The control point received a response to callInformationUrl() - virtual void gotInformationResponse(const QDomNode &response); - -private slots: - // The QHttp object retrieved data. - void slotRequestFinished(); - -private: - // Makes a UPnP action request (keeps pointers from the external interface) - int callActionInternal(const QString &actionName, const QMap *arguments, const QString &prefix); - -private: - // The URL to control the service - QString m_szControlUrl; - // The URL to request service information - QString m_szInformationUrl; - // The number of pending queries/actions - int m_iPendingRequests; - // The ID of the service - QString m_szServiceId; - // The Type of the service - QString m_szServiceType; - // The xml prefix used by the router - QString m_szBaseXmlPrefix; - // hostname - QString m_szHostname; - //port - int m_iPort; - -signals: - // Called when a query completed - void queryFinished(bool error); -}; - + class Service : public QObject + { + Q_OBJECT + + public: // public methods + // The constructor for the root service + Service(const QString & hostname, int port, const QString & informationUrl); + // The constructor for action services + Service(const ServiceParameters & params); + // The destructor + virtual ~Service(); + + // Get the number of pending requests + int getPendingRequests() const; + + protected: // Protected methods + // Makes a UPnP action request + int callAction(const QString & actionName, const QString & prefix); + // Makes a UPnP action request + int callAction(const QString & actionName, const QMap & arguments, const QString & prefix); + // Makes a UPnP service request + int callInformationUrl(); + + // The control point received an action failure indication + virtual void gotActionErrorResponse(const QDomNode & response); + // The control point received a response to callAction() + virtual void gotActionResponse(const QString & responseType, const QMap & resultValues); + // The control point received a response to callInformationUrl() + virtual void gotInformationResponse(const QDomNode & response); + + private slots: + // The QHttp object retrieved data. + void slotRequestFinished(); + + private: + // Makes a UPnP action request (keeps pointers from the external interface) + int callActionInternal(const QString & actionName, const QMap * arguments, const QString & prefix); + + private: + // The URL to control the service + QString m_szControlUrl; + // The URL to request service information + QString m_szInformationUrl; + // The number of pending queries/actions + int m_iPendingRequests; + // The ID of the service + QString m_szServiceId; + // The Type of the service + QString m_szServiceType; + // The xml prefix used by the router + QString m_szBaseXmlPrefix; + // hostname + QString m_szHostname; + //port + int m_iPort; + + signals: + // Called when a query completed + void queryFinished(bool error); + }; } #endif diff --git a/src/modules/upnp/SsdpConnection.cpp b/src/modules/upnp/SsdpConnection.cpp index 7440d10d1..11a316ce6 100644 --- a/src/modules/upnp/SsdpConnection.cpp +++ b/src/modules/upnp/SsdpConnection.cpp @@ -43,110 +43,104 @@ namespace UPnP { -SsdpConnection::SsdpConnection() -: QObject() -{ - m_pSocket = new QUdpSocket(); - connect(m_pSocket, SIGNAL(readyRead()), this, SLOT(slotDataReceived())); -} - -SsdpConnection::~SsdpConnection() -{ - if(m_pSocket != 0) + SsdpConnection::SsdpConnection() + : QObject() { - m_pSocket->close(); - delete m_pSocket; + m_pSocket = new QUdpSocket(); + connect(m_pSocket, SIGNAL(readyRead()), this, SLOT(slotDataReceived())); } -} - - - -// Data was received by the socket -void SsdpConnection::slotDataReceived() -{ - qDebug() << "UPnP::SsdpConnection: received " << m_pSocket->bytesAvailable() << " bytes." << endl; - - // Response from Diederik's Acatel router: - // - // HTTP/1.1 200 OK - // CACHE-CONTROL:max-age=1800 - // EXT: - // LOCATION:http://10.0.0.138:80/IGD.xml - // SERVER:SpeedTouch 510 4.0.2.0.0 UPnP/1.0 (0313QZ6S2) - // ST:upnp:rootdevice - // USN:uuid:UPnP-SpeedTouch510-1_00-90-D0-8E-A1-6F::upnp:rootdevice - // - - // This is from a Zyxel router: - // - // HTTP/1.1 200 OK - // ST:urn:schemas-upnp-org:device:InternetGatewayDevice:1 - // USN:uuid:11111111-%04x-c0a8-fcb30002cf618c::urn:schemas-upnp-org:device:InternetGatewayDevice:1 - // Location:http://192.168.252.179:80/DeviceDescription.xml - // Cache-Control: max-age=480 - // Server: ZyXEL-RomPlug/4.51 UPnP/1.0 IGD/1.00 - // Ext: - - while (m_pSocket->hasPendingDatagrams()) { - QByteArray datagram; - datagram.resize(m_pSocket->pendingDatagramSize()); - m_pSocket->readDatagram(datagram.data(), datagram.size()); - - qDebug("Received datagram: %s\n",datagram.data()); - - QString sspdResponse = QString::fromUtf8(datagram.data(), datagram.size()); - - // Find the location field manually, MimeMessage is not required - int locationStart = sspdResponse.indexOf("LOCATION:",0,Qt::CaseInsensitive); - int locationEnd = sspdResponse.indexOf("\r\n",locationStart,Qt::CaseSensitive); - - locationStart += 9; // length of field name - QString location = sspdResponse.mid(locationStart, locationEnd - locationStart); - - // Parse the URL syntax using KURL - QUrl url(location.trimmed()); - - qDebug("Found internet gateway: %s\n", location.toUtf8().data()); - // Emit success - emit deviceFound(url.host(), url.port(), url.path()); - + SsdpConnection::~SsdpConnection() + { + if(m_pSocket != 0) + { + m_pSocket->close(); + delete m_pSocket; + } } -} - -// Send a broadcast to detect all devices -void SsdpConnection::queryDevices(int bindPort) -{ - qDebug() << "UPnP::SsdpConnection: sending broadcast packet." << endl; - - // Send a packet to a broadcast address - QHostAddress address("239.255.255.250"); - - QString data = "M-SEARCH * HTTP/1.1\r\n" - "Host:239.255.255.250:1900\r\n" - "ST:urn:schemas-upnp-org:device:InternetGatewayDevice:1\r\n" - "Man:\"ssdp:discover\"\r\n" - "MX:3\r\n" - "\r\n"; - - // Bind the socket to a certain port - bool success = m_pSocket->bind(bindPort); - if(! success) + // Data was received by the socket + void SsdpConnection::slotDataReceived() { - qDebug() << "UPnP::SsdpConnection: failed to bind to port " << bindPort << "." << endl; + qDebug() << "UPnP::SsdpConnection: received " << m_pSocket->bytesAvailable() << " bytes." << endl; + + // Response from Diederik's Acatel router: + // + // HTTP/1.1 200 OK + // CACHE-CONTROL:max-age=1800 + // EXT: + // LOCATION:http://10.0.0.138:80/IGD.xml + // SERVER:SpeedTouch 510 4.0.2.0.0 UPnP/1.0 (0313QZ6S2) + // ST:upnp:rootdevice + // USN:uuid:UPnP-SpeedTouch510-1_00-90-D0-8E-A1-6F::upnp:rootdevice + // + + // This is from a Zyxel router: + // + // HTTP/1.1 200 OK + // ST:urn:schemas-upnp-org:device:InternetGatewayDevice:1 + // USN:uuid:11111111-%04x-c0a8-fcb30002cf618c::urn:schemas-upnp-org:device:InternetGatewayDevice:1 + // Location:http://192.168.252.179:80/DeviceDescription.xml + // Cache-Control: max-age=480 + // Server: ZyXEL-RomPlug/4.51 UPnP/1.0 IGD/1.00 + // Ext: + + while(m_pSocket->hasPendingDatagrams()) + { + QByteArray datagram; + datagram.resize(m_pSocket->pendingDatagramSize()); + m_pSocket->readDatagram(datagram.data(), datagram.size()); + + qDebug("Received datagram: %s\n", datagram.data()); + + QString sspdResponse = QString::fromUtf8(datagram.data(), datagram.size()); + + // Find the location field manually, MimeMessage is not required + int locationStart = sspdResponse.indexOf("LOCATION:", 0, Qt::CaseInsensitive); + int locationEnd = sspdResponse.indexOf("\r\n", locationStart, Qt::CaseSensitive); + + locationStart += 9; // length of field name + QString location = sspdResponse.mid(locationStart, locationEnd - locationStart); + + // Parse the URL syntax using KURL + QUrl url(location.trimmed()); + + qDebug("Found internet gateway: %s\n", location.toUtf8().data()); + // Emit success + emit deviceFound(url.host(), url.port(), url.path()); + } } - // Send the data - QByteArray dataBlock = data.toUtf8(); - int bytesWritten = m_pSocket->writeDatagram(dataBlock.data(), dataBlock.size(), address, 1900); - - if(bytesWritten == -1) + // Send a broadcast to detect all devices + void SsdpConnection::queryDevices(int bindPort) { - qDebug() << "UPnP::SsdpConnection: failed to send the UPnP broadcast packet." << endl; + qDebug() << "UPnP::SsdpConnection: sending broadcast packet." << endl; + + // Send a packet to a broadcast address + QHostAddress address("239.255.255.250"); + + QString data = "M-SEARCH * HTTP/1.1\r\n" + "Host:239.255.255.250:1900\r\n" + "ST:urn:schemas-upnp-org:device:InternetGatewayDevice:1\r\n" + "Man:\"ssdp:discover\"\r\n" + "MX:3\r\n" + "\r\n"; + + // Bind the socket to a certain port + bool success = m_pSocket->bind(bindPort); + if(!success) + { + qDebug() << "UPnP::SsdpConnection: failed to bind to port " << bindPort << "." << endl; + } + + // Send the data + QByteArray dataBlock = data.toUtf8(); + int bytesWritten = m_pSocket->writeDatagram(dataBlock.data(), dataBlock.size(), address, 1900); + + if(bytesWritten == -1) + { + qDebug() << "UPnP::SsdpConnection: failed to send the UPnP broadcast packet." << endl; + } } -} - - -} // end of namespace +} // end of namespace diff --git a/src/modules/upnp/SsdpConnection.h b/src/modules/upnp/SsdpConnection.h index d9a279060..0068f2f25 100644 --- a/src/modules/upnp/SsdpConnection.h +++ b/src/modules/upnp/SsdpConnection.h @@ -41,8 +41,7 @@ class QUdpSocket; namespace UPnP { - -/** + /** * The Simple Service Discovery Protocol allows UPnP clients * to discover UPnP devices on a network. * This is achieved by broadcasting a HTTP-like message over UDP. @@ -53,27 +52,26 @@ namespace UPnP * @author Diederik van der Boor * @ingroup NetworkUPnP */ -class SsdpConnection : public QObject -{ - Q_OBJECT + class SsdpConnection : public QObject + { + Q_OBJECT public: - SsdpConnection(); - virtual ~SsdpConnection(); + SsdpConnection(); + virtual ~SsdpConnection(); - void queryDevices(int bindPort = 1500); + void queryDevices(int bindPort = 1500); private slots: - // Data was received by the socket - void slotDataReceived(); + // Data was received by the socket + void slotDataReceived(); private: - QUdpSocket *m_pSocket; + QUdpSocket * m_pSocket; signals: - // Called when a query completed - void deviceFound(const QString &hostname, int port, const QString &rootUrl); -}; - + // Called when a query completed + void deviceFound(const QString & hostname, int port, const QString & rootUrl); + }; } #endif diff --git a/src/modules/upnp/WanConnectionService.cpp b/src/modules/upnp/WanConnectionService.cpp index 9073bb89a..8fa5f1753 100644 --- a/src/modules/upnp/WanConnectionService.cpp +++ b/src/modules/upnp/WanConnectionService.cpp @@ -37,163 +37,138 @@ namespace UPnP { - -// The constructor -WanConnectionService::WanConnectionService(const ServiceParameters ¶ms) -: Service(params) -, m_bNatEnabled(false) -{ - -} - - -// The destructor -WanConnectionService::~WanConnectionService() -{ - -} - - - -// Add a port mapping -void WanConnectionService::addPortMapping(const QString &protocol, const QString &remoteHost, int externalPort, - const QString &internalClient, int internalPort, const QString &description, - bool enabled, int leaseDuration) -{ - QMap arguments; - arguments["NewProtocol"] = protocol; - arguments["NewRemoteHost"] = remoteHost; - arguments["NewExternalPort"] = QString::number(externalPort); - arguments["NewInternalClient"] = internalClient; - arguments["NewInternalPort"] = QString::number(internalPort); - arguments["NewPortMappingDescription"] = description; - arguments["NewEnabled"] = QString::number(enabled ? 1 : 0); - arguments["NewLeaseDuration"] = QString::number(leaseDuration); - callAction("AddPortMapping", arguments, "m"); -} - - - -// Delete a port mapping -void WanConnectionService::deletePortMapping(const QString &protocol, const QString &remoteHost, int externalPort) -{ - QMap arguments; - arguments["NewProtocol"] = protocol; - arguments["NewRemoteHost"] = remoteHost; - arguments["NewExternalPort"] = QString::number(externalPort); - callAction("DeletePortMapping", arguments, "m"); -} - - - -// Return the external IP address -QString WanConnectionService::getExternalIpAddress() const -{ - return m_szExternalIpAddress; -} - - - -// Return true if NAT is enabled -bool WanConnectionService::getNatEnabled() const -{ - return m_bNatEnabled; -} - - - -// Return the port mappings -const KviPointerList& WanConnectionService::getPortMappings() const -{ - return m_lPortMappings; -} - - - -// The control point received a response to callAction() -void WanConnectionService::gotActionResponse(const QString &responseType, const QMap &resultValues) -{ - qDebug() << "UPnP::WanConnectionService: parsing action response:" - << " type='" << responseType << "'." << endl; - - // Check the message type - if(responseType == "GetExternalIPAddressResponse") + // The constructor + WanConnectionService::WanConnectionService(const ServiceParameters & params) + : Service(params), m_bNatEnabled(false) { - // Get the external IP address from the response - m_szExternalIpAddress = resultValues["NewExternalIPAddress"]; - - qDebug() << "UPnP::WanConnectionService: externalIp='" << m_szExternalIpAddress << "'." << endl; } - else if(responseType == "GetNATRSIPStatusResponse") - { - // Get the nat status from the response - m_bNatEnabled = (resultValues["NewNATEnabled"] == "1"); - qDebug() << "UPnP::WanConnectionService: natEnabled=" << m_bNatEnabled << "." << endl; - } - else if(responseType == "GetGenericPortMappingEntryResponse") + // The destructor + WanConnectionService::~WanConnectionService() { - // Find a place to store the data - PortMapping *map = new PortMapping; - - // Get the port mapping data from the response - map->enabled = (resultValues["NewEnabled"] == "1"); - map->externalPort = resultValues["NewExternalPort"].toInt(); - map->internalClient = resultValues["NewInternalClient"]; - map->internalPort = resultValues["NewInternalPort"].toInt(); - map->leaseDuration = resultValues["NewLeaseDuration"].toInt(); - map->description = resultValues["NewPortMappingDescription"]; - map->protocol = resultValues["NewProtocol"]; - map->remoteHost = resultValues["NewRemoteHost"]; - - // Register the mapping - m_lPortMappings.append(map); - - qDebug() << "UPnP::WanConnectionService - Received mapping: " << map->protocol << " " << map->remoteHost << ":" << map->externalPort - << " to " << map->internalClient << ":" << map->internalPort - << " max " << map->leaseDuration << "s '" << map->description << "' " << (map->enabled ? "enabled" : "disabled") << endl; } - else if(responseType == "AddPortMappingResponse") + + // Add a port mapping + void WanConnectionService::addPortMapping(const QString & protocol, const QString & remoteHost, int externalPort, + const QString & internalClient, int internalPort, const QString & description, + bool enabled, int leaseDuration) { - qDebug() << "UPnP::WanConnectionService - Received mapping enabled" << endl; + QMap arguments; + arguments["NewProtocol"] = protocol; + arguments["NewRemoteHost"] = remoteHost; + arguments["NewExternalPort"] = QString::number(externalPort); + arguments["NewInternalClient"] = internalClient; + arguments["NewInternalPort"] = QString::number(internalPort); + arguments["NewPortMappingDescription"] = description; + arguments["NewEnabled"] = QString::number(enabled ? 1 : 0); + arguments["NewLeaseDuration"] = QString::number(leaseDuration); + callAction("AddPortMapping", arguments, "m"); } - else if(responseType == "DeletePortMappingResponse") + + // Delete a port mapping + void WanConnectionService::deletePortMapping(const QString & protocol, const QString & remoteHost, int externalPort) { - qDebug() << "UPnP::WanConnectionService - Received mapping disabled" << endl; + QMap arguments; + arguments["NewProtocol"] = protocol; + arguments["NewRemoteHost"] = remoteHost; + arguments["NewExternalPort"] = QString::number(externalPort); + callAction("DeletePortMapping", arguments, "m"); } - else + + // Return the external IP address + QString WanConnectionService::getExternalIpAddress() const { - qDebug() << "UPnP::WanConnectionService - Unexpected response type" - << " '" << responseType << "' encountered." << endl; + return m_szExternalIpAddress; } -} + // Return true if NAT is enabled + bool WanConnectionService::getNatEnabled() const + { + return m_bNatEnabled; + } + // Return the port mappings + const KviPointerList & WanConnectionService::getPortMappings() const + { + return m_lPortMappings; + } -// Query for the external IP address -void WanConnectionService::queryExternalIpAddress() -{ - callAction("GetExternalIPAddress", "u"); -} - - - -// Query for the Nat status -void WanConnectionService::queryNatEnabled() -{ - callAction("GetNATRSIPStatus", "u"); -} - - + // The control point received a response to callAction() + void WanConnectionService::gotActionResponse(const QString & responseType, const QMap & resultValues) + { + qDebug() << "UPnP::WanConnectionService: parsing action response:" + << " type='" << responseType << "'." << endl; + + // Check the message type + if(responseType == "GetExternalIPAddressResponse") + { + // Get the external IP address from the response + m_szExternalIpAddress = resultValues["NewExternalIPAddress"]; + + qDebug() << "UPnP::WanConnectionService: externalIp='" << m_szExternalIpAddress << "'." << endl; + } + else if(responseType == "GetNATRSIPStatusResponse") + { + // Get the nat status from the response + m_bNatEnabled = (resultValues["NewNATEnabled"] == "1"); + + qDebug() << "UPnP::WanConnectionService: natEnabled=" << m_bNatEnabled << "." << endl; + } + else if(responseType == "GetGenericPortMappingEntryResponse") + { + // Find a place to store the data + PortMapping * map = new PortMapping; + + // Get the port mapping data from the response + map->enabled = (resultValues["NewEnabled"] == "1"); + map->externalPort = resultValues["NewExternalPort"].toInt(); + map->internalClient = resultValues["NewInternalClient"]; + map->internalPort = resultValues["NewInternalPort"].toInt(); + map->leaseDuration = resultValues["NewLeaseDuration"].toInt(); + map->description = resultValues["NewPortMappingDescription"]; + map->protocol = resultValues["NewProtocol"]; + map->remoteHost = resultValues["NewRemoteHost"]; + + // Register the mapping + m_lPortMappings.append(map); + + qDebug() << "UPnP::WanConnectionService - Received mapping: " << map->protocol << " " << map->remoteHost << ":" << map->externalPort + << " to " << map->internalClient << ":" << map->internalPort + << " max " << map->leaseDuration << "s '" << map->description << "' " << (map->enabled ? "enabled" : "disabled") << endl; + } + else if(responseType == "AddPortMappingResponse") + { + qDebug() << "UPnP::WanConnectionService - Received mapping enabled" << endl; + } + else if(responseType == "DeletePortMappingResponse") + { + qDebug() << "UPnP::WanConnectionService - Received mapping disabled" << endl; + } + else + { + qDebug() << "UPnP::WanConnectionService - Unexpected response type" + << " '" << responseType << "' encountered." << endl; + } + } -// Query for a port mapping entry -void WanConnectionService::queryPortMappingEntry(int index) -{ - QMap arguments; - arguments["NewPortMappingIndex"] = QString::number(index); - callAction("GetGenericPortMappingEntry", arguments, "m"); -} + // Query for the external IP address + void WanConnectionService::queryExternalIpAddress() + { + callAction("GetExternalIPAddress", "u"); + } + // Query for the Nat status + void WanConnectionService::queryNatEnabled() + { + callAction("GetNATRSIPStatus", "u"); + } + // Query for a port mapping entry + void WanConnectionService::queryPortMappingEntry(int index) + { + QMap arguments; + arguments["NewPortMappingIndex"] = QString::number(index); + callAction("GetGenericPortMappingEntry", arguments, "m"); + } } // End of namespace diff --git a/src/modules/upnp/WanConnectionService.h b/src/modules/upnp/WanConnectionService.h index c39c06a85..24e306dff 100644 --- a/src/modules/upnp/WanConnectionService.h +++ b/src/modules/upnp/WanConnectionService.h @@ -40,20 +40,19 @@ namespace UPnP { -struct PortMapping -{ - QString protocol; - QString remoteHost; - int externalPort; - QString internalClient; - int internalPort; - int leaseDuration; - QString description; - bool enabled; -}; - - -/** + struct PortMapping + { + QString protocol; + QString remoteHost; + int externalPort; + QString internalClient; + int internalPort; + int leaseDuration; + QString description; + bool enabled; + }; + + /** * The Wan(IP/PPP)Connection service controls the connection and port forwarding settings of a router. * The Layer3ForwardingService result either defines a WanIPConnection or WanPPPConnection service. * Which one is returned depends on the external connection type. @@ -63,52 +62,47 @@ struct PortMapping * @author Diederik van der Boor * @ingroup NetworkUPnP */ -class WanConnectionService : public Service -{ -public: // public methods - - // The constructor - WanConnectionService(const ServiceParameters ¶ms); - // The destructor - virtual ~WanConnectionService(); - - // Add a port mapping - void addPortMapping(const QString &protocol, const QString &remoteHost, int externalPort, - const QString &internalClient, int internalPort, const QString &description, - bool enabled = true, int leaseDuration = 0); - // Delete a port mapping - void deletePortMapping(const QString &protocol, const QString &remoteHost, int externalPort); - - // Return the external IP address - QString getExternalIpAddress() const; - // Return true if NAT is enabled - bool getNatEnabled() const; - // Return the port mappings - const KviPointerList& getPortMappings() const; - - // Query for the external IP address - void queryExternalIpAddress(); - // Query for the Nat status - void queryNatEnabled(); - // Query for a port mapping entry - void queryPortMappingEntry(int index); - - -protected: // protected methods - - // The control point received a response to callAction() - virtual void gotActionResponse(const QString &responseType, const QMap &resultValues); - - -private: // private attributes - // The external IP address - QString m_szExternalIpAddress; - // True if NAT is enabled - bool m_bNatEnabled; - // The current port mappings - KviPointerList m_lPortMappings; -}; - + class WanConnectionService : public Service + { + public: // public methods + // The constructor + WanConnectionService(const ServiceParameters & params); + // The destructor + virtual ~WanConnectionService(); + + // Add a port mapping + void addPortMapping(const QString & protocol, const QString & remoteHost, int externalPort, + const QString & internalClient, int internalPort, const QString & description, + bool enabled = true, int leaseDuration = 0); + // Delete a port mapping + void deletePortMapping(const QString & protocol, const QString & remoteHost, int externalPort); + + // Return the external IP address + QString getExternalIpAddress() const; + // Return true if NAT is enabled + bool getNatEnabled() const; + // Return the port mappings + const KviPointerList & getPortMappings() const; + + // Query for the external IP address + void queryExternalIpAddress(); + // Query for the Nat status + void queryNatEnabled(); + // Query for a port mapping entry + void queryPortMappingEntry(int index); + + protected: // protected methods + // The control point received a response to callAction() + virtual void gotActionResponse(const QString & responseType, const QMap & resultValues); + + private: // private attributes + // The external IP address + QString m_szExternalIpAddress; + // True if NAT is enabled + bool m_bNatEnabled; + // The current port mappings + KviPointerList m_lPortMappings; + }; } #endif diff --git a/src/modules/upnp/XmlFunctions.cpp b/src/modules/upnp/XmlFunctions.cpp index 39927fe74..c2d7caf6b 100644 --- a/src/modules/upnp/XmlFunctions.cpp +++ b/src/modules/upnp/XmlFunctions.cpp @@ -35,92 +35,84 @@ #include - // Helper function, get a specific node -QDomNode XmlFunctions::getNode( const QDomNode &rootNode, const QString &path ) +QDomNode XmlFunctions::getNode(const QDomNode & rootNode, const QString & path) { - QStringList pathItems = path.split( "/", QString::SkipEmptyParts ); - QDomNode childNode = rootNode.namedItem( pathItems[0] ); // can be a null node + QStringList pathItems = path.split("/", QString::SkipEmptyParts); + QDomNode childNode = rootNode.namedItem(pathItems[0]); // can be a null node - int i = 1; - while( i < pathItems.count() ) - { - if( childNode.isNull() ) - { - break; - } + int i = 1; + while(i < pathItems.count()) + { + if(childNode.isNull()) + { + break; + } - childNode = childNode.namedItem( pathItems[ i ] ); - i++; // not using for loop so i is always correct for kdDebug() below. - } + childNode = childNode.namedItem(pathItems[i]); + i++; // not using for loop so i is always correct for kdDebug() below. + } - if( childNode.isNull() ) { - qDebug() << "XmlFunctions::getNode() - Notice: node '" << pathItems[ i - 1 ] << "'" - << " does not exist (root=" << rootNode.nodeName() << " path=" << path << ")." << endl; - } + if(childNode.isNull()) + { + qDebug() << "XmlFunctions::getNode() - Notice: node '" << pathItems[i - 1] << "'" + << " does not exist (root=" << rootNode.nodeName() << " path=" << path << ")." << endl; + } - return childNode; + return childNode; } - - // Helper function, get the attribute text of a node -QString XmlFunctions::getNodeAttribute( const QDomNode &node, const QString &attribute ) +QString XmlFunctions::getNodeAttribute(const QDomNode & node, const QString & attribute) { - // Writing this is not funny - return node.attributes().namedItem( attribute ).toAttr().value(); -// node.toElement().attribute( attribute ); does not work for const nodes. + // Writing this is not funny + return node.attributes().namedItem(attribute).toAttr().value(); + // node.toElement().attribute( attribute ); does not work for const nodes. } - - // Helper function, get a specific child node -QDomNode XmlFunctions::getNodeChildByKey( const QDomNodeList &childNodes, const QString &keyTagName, const QString &keyValue ) +QDomNode XmlFunctions::getNodeChildByKey(const QDomNodeList & childNodes, const QString & keyTagName, const QString & keyValue) { - for( int i = 0; i < childNodes.count(); i++ ) - { -// kdDebug() << "node " << childNodes.item(i).nodeName() << "/" << keyTagName -// << "=" << childNodes.item(i).namedItem(keyTagName).toElement().text() << " == " << keyValue << "?" << endl; - - // If the node has an childname with a certain value... e.g. value .. - if( childNodes.item( i ).namedItem( keyTagName ).toElement().text() == keyValue) - { - // Return the node - return childNodes.item( i ); - } - } - - // Return a null node (is there a better way?) - return childNodes.item( childNodes.count() ); + for(int i = 0; i < childNodes.count(); i++) + { + // kdDebug() << "node " << childNodes.item(i).nodeName() << "/" << keyTagName + // << "=" << childNodes.item(i).namedItem(keyTagName).toElement().text() << " == " << keyValue << "?" << endl; + + // If the node has an childname with a certain value... e.g. value .. + if(childNodes.item(i).namedItem(keyTagName).toElement().text() == keyValue) + { + // Return the node + return childNodes.item(i); + } + } + + // Return a null node (is there a better way?) + return childNodes.item(childNodes.count()); } - - // Helper function, get the text value of a node -QString XmlFunctions::getNodeValue( const QDomNode &rootNode, const QString &path ) +QString XmlFunctions::getNodeValue(const QDomNode & rootNode, const QString & path) { - // Added code to avoid more assertion errors, and trace the cause. - if( rootNode.isNull() ) - { - qWarning() << "XmlFunctions::getNodeValue: attempted to request '" << path << "' on null root node." << endl; - return QString(); - } + // Added code to avoid more assertion errors, and trace the cause. + if(rootNode.isNull()) + { + qWarning() << "XmlFunctions::getNodeValue: attempted to request '" << path << "' on null root node." << endl; + return QString(); + } - - // Because writing node.namedItem("childItem").namedItem("child2").toElement().text() is not funny. - return getNode( rootNode, path ).toElement().text(); + // Because writing node.namedItem("childItem").namedItem("child2").toElement().text() is not funny. + return getNode(rootNode, path).toElement().text(); } - // Helper function, get the source XML of a node. -QString XmlFunctions::getSource( const QDomNode &node, int indent ) +QString XmlFunctions::getSource(const QDomNode & node, int indent) { - QString source; - QTextStream textStream( &source, QIODevice::WriteOnly ); - node.save( textStream, indent ); - return source; + QString source; + QTextStream textStream(&source, QIODevice::WriteOnly); + node.save(textStream, indent); + return source; } diff --git a/src/modules/upnp/XmlFunctions.h b/src/modules/upnp/XmlFunctions.h index b57361b2d..0d435b859 100644 --- a/src/modules/upnp/XmlFunctions.h +++ b/src/modules/upnp/XmlFunctions.h @@ -45,18 +45,18 @@ */ class XmlFunctions { - public: - // Helper function, get a specific node - static QDomNode getNode(const QDomNode &rootNode, const QString &path); - // Helper function, get the attribute text of a node - static QString getNodeAttribute(const QDomNode &node, const QString &attribute); - // Helper function, get a specific child node - static QDomNode getNodeChildByKey(const QDomNodeList &childNodes, - const QString &keyTagName, const QString &keyValue); - // Helper function, get the text value of a node - static QString getNodeValue(const QDomNode &rootNode, const QString &path); - // Helper function, get the source XML of a node. - static QString getSource( const QDomNode &node, int indent = 0 ); +public: + // Helper function, get a specific node + static QDomNode getNode(const QDomNode & rootNode, const QString & path); + // Helper function, get the attribute text of a node + static QString getNodeAttribute(const QDomNode & node, const QString & attribute); + // Helper function, get a specific child node + static QDomNode getNodeChildByKey(const QDomNodeList & childNodes, + const QString & keyTagName, const QString & keyValue); + // Helper function, get the text value of a node + static QString getNodeValue(const QDomNode & rootNode, const QString & path); + // Helper function, get the source XML of a node. + static QString getSource(const QDomNode & node, int indent = 0); }; #endif diff --git a/src/modules/upnp/igdcontrolpoint.cpp b/src/modules/upnp/igdcontrolpoint.cpp index 7ed70ed92..686d576ca 100644 --- a/src/modules/upnp/igdcontrolpoint.cpp +++ b/src/modules/upnp/igdcontrolpoint.cpp @@ -41,132 +41,124 @@ namespace UPnP { -#define WanIpConnectionType "urn:schemas-upnp-org:service:WANIPConnection:1" -#define WanPPPConnectionType "urn:schemas-upnp-org:service:WANPPPConnection:1" - -// The constructor -IgdControlPoint::IgdControlPoint(const QString &hostname, int port, const QString &rootUrl) -: QObject() -, m_bGatewayAvailable(false) -, m_iIgdPort(0) -, m_pRootService(0) -, m_pWanConnectionService(0) -{ - qDebug() << "CREATED UPnP::IgdControlPoint: created control point" - << " url='" << hostname << ":" << port << "/" << rootUrl << "'." << endl; - - qDebug() << "UPnP::IgdControlPoint: querying services..." << endl; - - // Store device url - m_szIgdHostname = hostname; - m_iIgdPort = port; - - // Query the device for it's services - m_pRootService = new RootService(m_szIgdHostname, m_iIgdPort, rootUrl); - connect(m_pRootService, SIGNAL(queryFinished(bool)), this, SLOT(slotDeviceQueried(bool))); -} +#define WanIpConnectionType "urn:schemas-upnp-org:service:WANIPConnection:1" +#define WanPPPConnectionType "urn:schemas-upnp-org:service:WANPPPConnection:1" + // The constructor + IgdControlPoint::IgdControlPoint(const QString & hostname, int port, const QString & rootUrl) + : QObject(), m_bGatewayAvailable(false), m_iIgdPort(0), m_pRootService(0), m_pWanConnectionService(0) + { + qDebug() << "CREATED UPnP::IgdControlPoint: created control point" + << " url='" << hostname << ":" << port << "/" << rootUrl << "'." << endl; + qDebug() << "UPnP::IgdControlPoint: querying services..." << endl; -// The destructor -IgdControlPoint::~IgdControlPoint() -{ - delete m_pRootService; - delete m_pWanConnectionService; + // Store device url + m_szIgdHostname = hostname; + m_iIgdPort = port; - qDebug() << "DESTROYED UPnP::IgdControlPoint [host=" << m_szIgdHostname << ", port=" << m_iIgdPort << "]" << endl; -} + // Query the device for it's services + m_pRootService = new RootService(m_szIgdHostname, m_iIgdPort, rootUrl); + connect(m_pRootService, SIGNAL(queryFinished(bool)), this, SLOT(slotDeviceQueried(bool))); + } + // The destructor + IgdControlPoint::~IgdControlPoint() + { + delete m_pRootService; + delete m_pWanConnectionService; + qDebug() << "DESTROYED UPnP::IgdControlPoint [host=" << m_szIgdHostname << ", port=" << m_iIgdPort << "]" << endl; + } -// Return the external IP address -QString IgdControlPoint::getExternalIpAddress() const -{ - // Do not expose wanConnectionService_; - if(m_pWanConnectionService != 0) + // Return the external IP address + QString IgdControlPoint::getExternalIpAddress() const { - return m_pWanConnectionService->getExternalIpAddress(); - } else { - return QString(); + // Do not expose wanConnectionService_; + if(m_pWanConnectionService != 0) + { + return m_pWanConnectionService->getExternalIpAddress(); + } + else + { + return QString(); + } } -} - - -// Initialize the control point -void IgdControlPoint::initialize() -{ - m_pRootService->queryDevice(); -} - - - -// Return true if a controlable gateway is available -bool IgdControlPoint::isGatewayAvailable() -{ - return m_bGatewayAvailable; -} + // Initialize the control point + void IgdControlPoint::initialize() + { + m_pRootService->queryDevice(); + } + // Return true if a controlable gateway is available + bool IgdControlPoint::isGatewayAvailable() + { + return m_bGatewayAvailable; + } -// The IGD was queried for it's services -void IgdControlPoint::slotDeviceQueried(bool error) -{ - if(! error) + // The IGD was queried for it's services + void IgdControlPoint::slotDeviceQueried(bool error) { - ServiceParameters params = m_pRootService->getServiceByType(WanIpConnectionType); + if(!error) + { + ServiceParameters params = m_pRootService->getServiceByType(WanIpConnectionType); - if(params.controlUrl.isNull()) - params = m_pRootService->getServiceByType(WanPPPConnectionType); + if(params.controlUrl.isNull()) + params = m_pRootService->getServiceByType(WanPPPConnectionType); - if(! params.controlUrl.isNull()) - { + if(!params.controlUrl.isNull()) + { - m_bGatewayAvailable = true; + m_bGatewayAvailable = true; - qDebug() << "UPnP::IgdControlPoint: WAN/IP connection service found, " - << "querying service '" << params.serviceId << "' for external IP address..." << endl; + qDebug() << "UPnP::IgdControlPoint: WAN/IP connection service found, " + << "querying service '" << params.serviceId << "' for external IP address..." << endl; - // Call the service - m_pWanConnectionService = new WanConnectionService(params); - connect(m_pWanConnectionService, SIGNAL(queryFinished(bool)), this, SLOT(slotWanQueryFinished(bool))); - m_pWanConnectionService->queryExternalIpAddress(); - } else { - qDebug() << "UPnP::IgdControlPoint: no PPP/IP connection service found :(" << endl; + // Call the service + m_pWanConnectionService = new WanConnectionService(params); + connect(m_pWanConnectionService, SIGNAL(queryFinished(bool)), this, SLOT(slotWanQueryFinished(bool))); + m_pWanConnectionService->queryExternalIpAddress(); + } + else + { + qDebug() << "UPnP::IgdControlPoint: no PPP/IP connection service found :(" << endl; + } } } -} - -// A WAN connection query was finished -void IgdControlPoint::slotWanQueryFinished(bool error) -{ - if(! error) + // A WAN connection query was finished + void IgdControlPoint::slotWanQueryFinished(bool error) { - qDebug() << "IgdControlPoint: UPnP gateway device found." << endl; - } else { - // Just started, the request for the external IP failed. This should succeed, abort portation - qDebug() << "Requesting external IP address failed, leaving UPnP gateway device untouched." << endl; + if(!error) + { + qDebug() << "IgdControlPoint: UPnP gateway device found." << endl; + } + else + { + // Just started, the request for the external IP failed. This should succeed, abort portation + qDebug() << "Requesting external IP address failed, leaving UPnP gateway device untouched." << endl; + } } -} -// Return the external IP address -void IgdControlPoint::addPortMapping(const QString &protocol, const QString &remoteHost, int externalPort,const QString &internalClient, int internalPort, const QString &description, bool enabled, int leaseDuration) -{ - // Do not expose wanConnectionService_; - if(m_pWanConnectionService != 0) + // Return the external IP address + void IgdControlPoint::addPortMapping(const QString & protocol, const QString & remoteHost, int externalPort, const QString & internalClient, int internalPort, const QString & description, bool enabled, int leaseDuration) { - m_pWanConnectionService->addPortMapping(protocol, remoteHost, externalPort, internalClient, internalPort, description, enabled, leaseDuration); + // Do not expose wanConnectionService_; + if(m_pWanConnectionService != 0) + { + m_pWanConnectionService->addPortMapping(protocol, remoteHost, externalPort, internalClient, internalPort, description, enabled, leaseDuration); + } } -} -// Delete a port mapping -void IgdControlPoint::deletePortMapping(const QString &protocol, const QString &remoteHost, int externalPort) -{ - // Do not expose wanConnectionService_; - if(m_pWanConnectionService != 0) + // Delete a port mapping + void IgdControlPoint::deletePortMapping(const QString & protocol, const QString & remoteHost, int externalPort) { - m_pWanConnectionService->deletePortMapping(protocol, remoteHost, externalPort); + // Do not expose wanConnectionService_; + if(m_pWanConnectionService != 0) + { + m_pWanConnectionService->deletePortMapping(protocol, remoteHost, externalPort); + } } -} -} // End of namespace +} // End of namespace diff --git a/src/modules/upnp/igdcontrolpoint.h b/src/modules/upnp/igdcontrolpoint.h index 7968aa949..91c46e1e4 100644 --- a/src/modules/upnp/igdcontrolpoint.h +++ b/src/modules/upnp/igdcontrolpoint.h @@ -39,11 +39,11 @@ namespace UPnP { -class SsdpConnection; -class RootService; -class WanConnectionService; + class SsdpConnection; + class RootService; + class WanConnectionService; -/** + /** * A control point is a UPnP term for "client". * It's the host that controls the UPnP device. * This control point specifically handles Internet Gateway Devices (routers in UPnP terminology). @@ -53,49 +53,46 @@ class WanConnectionService; * @author Diederik van der Boor * @ingroup NetworkUPnP */ -class IgdControlPoint : public QObject -{ - Q_OBJECT - -public: // public methods - - // The constructor - IgdControlPoint(const QString &hostname, int port, const QString &rootUrl); - // The destructor - virtual ~IgdControlPoint(); - - // Return the external IP address - QString getExternalIpAddress() const; - // Initialize the control point - void initialize(); - // Return true if a controlable gateway is available - bool isGatewayAvailable(); + class IgdControlPoint : public QObject + { + Q_OBJECT - // Add a port mapping - void addPortMapping(const QString &protocol, const QString &remoteHost, int externalPort, const QString &internalClient, int internalPort, const QString &description, bool enabled = true, int leaseDuration = 0); - // Delete a port mapping - void deletePortMapping(const QString &protocol, const QString &remoteHost, int externalPort); + public: // public methods + // The constructor + IgdControlPoint(const QString & hostname, int port, const QString & rootUrl); + // The destructor + virtual ~IgdControlPoint(); -private slots: - // The IGD was queried for it's services - void slotDeviceQueried(bool error); - // A WAN connection query was finished - void slotWanQueryFinished(bool error); + // Return the external IP address + QString getExternalIpAddress() const; + // Initialize the control point + void initialize(); + // Return true if a controlable gateway is available + bool isGatewayAvailable(); -private: // private attibutes - // Is a gateway available? - bool m_bGatewayAvailable; - // The host of the gateway - QString m_szIgdHostname; - // The port of the gateway - int m_iIgdPort; - // The root service - RootService *m_pRootService; - // The wan connection service - WanConnectionService *m_pWanConnectionService; -}; + // Add a port mapping + void addPortMapping(const QString & protocol, const QString & remoteHost, int externalPort, const QString & internalClient, int internalPort, const QString & description, bool enabled = true, int leaseDuration = 0); + // Delete a port mapping + void deletePortMapping(const QString & protocol, const QString & remoteHost, int externalPort); + private slots: + // The IGD was queried for it's services + void slotDeviceQueried(bool error); + // A WAN connection query was finished + void slotWanQueryFinished(bool error); + private: // private attibutes + // Is a gateway available? + bool m_bGatewayAvailable; + // The host of the gateway + QString m_szIgdHostname; + // The port of the gateway + int m_iIgdPort; + // The root service + RootService * m_pRootService; + // The wan connection service + WanConnectionService * m_pWanConnectionService; + }; } #endif diff --git a/src/modules/upnp/libkviupnp.cpp b/src/modules/upnp/libkviupnp.cpp index bd04abf84..880b1b70c 100644 --- a/src/modules/upnp/libkviupnp.cpp +++ b/src/modules/upnp/libkviupnp.cpp @@ -31,7 +31,7 @@ // Please use our common variable naming conventions and coding style :) // Let's be so:) -UPnP::Manager* g_pManager = 0; +UPnP::Manager * g_pManager = 0; /* @doc: upnp.getExternalIpAddress @@ -55,12 +55,11 @@ static bool upnp_kvs_fnc_getExternalIpAddress(KviKvsModuleFunctionCall * c) { if(g_pManager) { - c->returnValue()->setString(g_pManager->getExternalIpAddress()); + c->returnValue()->setString(g_pManager->getExternalIpAddress()); } return true; } - /* @doc: upnp.isGatewayAvailable @type: @@ -77,10 +76,10 @@ static bool upnp_kvs_fnc_getExternalIpAddress(KviKvsModuleFunctionCall * c) */ static bool upnp_kvs_fnc_isGatewayAvailable(KviKvsModuleFunctionCall * c) { - if (g_pManager) - { - c->returnValue()->setBoolean(g_pManager->isGatewayAvailable()); - } + if(g_pManager) + { + c->returnValue()->setBoolean(g_pManager->isGatewayAvailable()); + } return true; } @@ -114,13 +113,15 @@ static bool upnp_kvs_cmd_addPortMapping(KviKvsModuleCommandCall * c) KviKvsVariant * pSw; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("port",KVS_PT_INT,0,iPort) + KVSM_PARAMETER("port", KVS_PT_INT, 0, iPort) KVSM_PARAMETERS_END(c) - if( (pSw = c->switches()->find('a',"fake-address")) ) + if((pSw = c->switches()->find('a', "fake-address"))) { pSw->asString(szLocalIp); - } else { + } + else + { kvi_getLocalHostAddress(szLocalIp); } @@ -151,7 +152,7 @@ static bool upnp_kvs_cmd_delPortMapping(KviKvsModuleCommandCall * c) kvs_int_t iPort; QString tmp; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("port",KVS_PT_INT,0,iPort) + KVSM_PARAMETER("port", KVS_PT_INT, 0, iPort) KVSM_PARAMETERS_END(c) g_pManager->deletePortMapping("TCP", "", iPort); @@ -185,7 +186,7 @@ static bool upnp_kvs_cmd_refresh(KviKvsModuleCommandCall *) return true; } -static bool upnp_module_init(KviModule *m) +static bool upnp_module_init(KviModule * m) { if(g_pManager) delete g_pManager; @@ -193,11 +194,11 @@ static bool upnp_module_init(KviModule *m) g_pManager = UPnP::Manager::instance(); - KVSM_REGISTER_FUNCTION(m,"isGatewayAvailable",upnp_kvs_fnc_isGatewayAvailable); - KVSM_REGISTER_FUNCTION(m,"getExternalIpAddress",upnp_kvs_fnc_getExternalIpAddress); - KVSM_REGISTER_SIMPLE_COMMAND(m,"addPortMapping",upnp_kvs_cmd_addPortMapping); - KVSM_REGISTER_SIMPLE_COMMAND(m,"delPortMapping",upnp_kvs_cmd_delPortMapping); - KVSM_REGISTER_SIMPLE_COMMAND(m,"refresh",upnp_kvs_cmd_refresh); + KVSM_REGISTER_FUNCTION(m, "isGatewayAvailable", upnp_kvs_fnc_isGatewayAvailable); + KVSM_REGISTER_FUNCTION(m, "getExternalIpAddress", upnp_kvs_fnc_getExternalIpAddress); + KVSM_REGISTER_SIMPLE_COMMAND(m, "addPortMapping", upnp_kvs_cmd_addPortMapping); + KVSM_REGISTER_SIMPLE_COMMAND(m, "delPortMapping", upnp_kvs_cmd_delPortMapping); + KVSM_REGISTER_SIMPLE_COMMAND(m, "refresh", upnp_kvs_cmd_refresh); return true; } @@ -216,13 +217,12 @@ static bool upnp_module_can_unload(KviModule *) } KVIRC_MODULE( - "UPnP", // module name - "4.0.0", // module version - "Copyright (C) 2008 Fabio Bas (ctrlaltca at gmail dot com),", - "Universal Plug and Play", - upnp_module_init, - upnp_module_can_unload, - 0, - upnp_module_cleanup, - 0 -) + "UPnP", // module name + "4.0.0", // module version + "Copyright (C) 2008 Fabio Bas (ctrlaltca at gmail dot com),", + "Universal Plug and Play", + upnp_module_init, + upnp_module_can_unload, + 0, + upnp_module_cleanup, + 0) diff --git a/src/modules/url/libkviurl.cpp b/src/modules/url/libkviurl.cpp index 53d4cfb42..25eff493d 100644 --- a/src/modules/url/libkviurl.cpp +++ b/src/modules/url/libkviurl.cpp @@ -51,24 +51,23 @@ #include #include - #ifdef COMPILE_PSEUDO_TRANSPARENCY - extern KVIRC_API QPixmap * g_pShadedChildGlobalDesktopBackground; +extern KVIRC_API QPixmap * g_pShadedChildGlobalDesktopBackground; #endif typedef struct _UrlDlgList { - UrlDialog *dlg; + UrlDialog * dlg; int menu_id; } UrlDlgList; -const char *g_pUrlListFilename = "/list.kviurl"; -const char *g_pBanListFilename = "/list.kviban"; +const char * g_pUrlListFilename = "/list.kviurl"; +const char * g_pBanListFilename = "/list.kviban"; -KviPointerList *g_pList; -KviPointerList *g_pUrlDlgList; -KviPointerList *g_pBanList; -ConfigDialog *g_pConfigDialog; +KviPointerList * g_pList; +KviPointerList * g_pUrlDlgList; +KviPointerList * g_pBanList; +ConfigDialog * g_pConfigDialog; QString szConfigPath; @@ -79,28 +78,29 @@ void loadBanList(); UrlDlgList * findFrame(); void url_module_help(); - #define KVI_URL_EXTENSION_NAME "URL module extenstion" UrlDialogTreeWidget::UrlDialogTreeWidget(QWidget * par) -: QTreeWidget(par) + : QTreeWidget(par) { } -void UrlDialogTreeWidget::mousePressEvent (QMouseEvent *e) +void UrlDialogTreeWidget::mousePressEvent(QMouseEvent * e) { - if (e->button() == Qt::RightButton) + if(e->button() == Qt::RightButton) { - QTreeWidgetItem *i= itemAt(e->pos()); - if (i) emit rightButtonPressed(i,QCursor::pos()); - else emit contextMenuRequested(QCursor::pos()); + QTreeWidgetItem * i = itemAt(e->pos()); + if(i) + emit rightButtonPressed(i, QCursor::pos()); + else + emit contextMenuRequested(QCursor::pos()); } QTreeWidget::mousePressEvent(e); } void UrlDialogTreeWidget::paintEvent(QPaintEvent * event) { - QPainter *p = new QPainter(viewport()); + QPainter * p = new QPainter(viewport()); QStyleOptionViewItem option = viewOptions(); QRect rect = event->rect(); @@ -109,18 +109,21 @@ void UrlDialogTreeWidget::paintEvent(QPaintEvent * event) { p->save(); p->setCompositionMode(QPainter::CompositionMode_Source); - QColor col=KVI_OPTION_COLOR(KviOption_colorGlobalTransparencyFade); + QColor col = KVI_OPTION_COLOR(KviOption_colorGlobalTransparencyFade); col.setAlphaF((float)((float)KVI_OPTION_UINT(KviOption_uintGlobalTransparencyChildFadeFactor) / (float)100)); p->fillRect(rect, col); p->restore(); - } else if(g_pShadedChildGlobalDesktopBackground) + } + else if(g_pShadedChildGlobalDesktopBackground) + { + QPoint pnt = ((KviWindow *)parent())->isDocked() ? viewport()->mapTo(g_pMainWindow, rect.topLeft()) : viewport()->mapTo((KviWindow *)parent(), rect.topLeft()); + p->drawTiledPixmap(rect, *(g_pShadedChildGlobalDesktopBackground), pnt); + } + else { - QPoint pnt = ((KviWindow*)parent())->isDocked() ? viewport()->mapTo(g_pMainWindow, rect.topLeft()) : viewport()->mapTo((KviWindow*)parent(), rect.topLeft()); - p->drawTiledPixmap(rect,*(g_pShadedChildGlobalDesktopBackground), pnt); - } else { #endif //FIXME this is not the treewindowlist - p->fillRect(rect,KVI_OPTION_COLOR(KviOption_colorTreeWindowListBackground)); + p->fillRect(rect, KVI_OPTION_COLOR(KviOption_colorTreeWindowListBackground)); #ifdef COMPILE_PSEUDO_TRANSPARENCY } #endif @@ -134,16 +137,16 @@ void UrlDialogTreeWidget::paintEvent(QPaintEvent * event) // ---------------------------- CLASS URLDIALOG ------------------------begin // UrlDialog::UrlDialog(KviPointerList *) - :KviWindow(KviWindow::Tool,"URL List") + : KviWindow(KviWindow::Tool, "URL List") { setAutoFillBackground(false); m_pUrlList = new UrlDialogTreeWidget(this); - m_pMenuBar = new KviTalMenuBar(this,"URL menu"); + m_pMenuBar = new KviTalMenuBar(this, "URL menu"); //m_pUrlList = new KviListView(this,"list"); - KviConfigurationFile cfg(szConfigPath,KviConfigurationFile::Read); -/* + KviConfigurationFile cfg(szConfigPath, KviConfigurationFile::Read); + /* QMenu *pop; pop = new QMenu(this); @@ -166,30 +169,31 @@ UrlDialog::UrlDialog(KviPointerList *) QStringList labels; labels << __tr2qs("URL") << __tr2qs("Window") << __tr2qs("Count") << __tr2qs("Timestamp"); m_pUrlList->setHeaderLabels(labels); -/* + /* cfg.setGroup("colsWidth"); m_pUrlList->setColumnWidth(0,cfg.readIntEntry("Url",170)); m_pUrlList->setColumnWidth(1,cfg.readIntEntry("Window",130)); m_pUrlList->setColumnWidth(2,cfg.readIntEntry("Count",70)); m_pUrlList->setColumnWidth(3,cfg.readIntEntry("Timestamp",70)); */ - connect(m_pUrlList,SIGNAL(itemDoubleClicked(QTreeWidgetItem *, int)),SLOT(dblclk_url(QTreeWidgetItem *, int))); - connect(m_pUrlList,SIGNAL(rightButtonPressed(QTreeWidgetItem *, const QPoint &)),SLOT(popup(QTreeWidgetItem *, const QPoint &))); - connect(m_pUrlList,SIGNAL(contextMenuRequested(const QPoint &)),SLOT(contextMenu(const QPoint &))); -// setFocusHandlerNoChildren(m_pUrlList); + connect(m_pUrlList, SIGNAL(itemDoubleClicked(QTreeWidgetItem *, int)), SLOT(dblclk_url(QTreeWidgetItem *, int))); + connect(m_pUrlList, SIGNAL(rightButtonPressed(QTreeWidgetItem *, const QPoint &)), SLOT(popup(QTreeWidgetItem *, const QPoint &))); + connect(m_pUrlList, SIGNAL(contextMenuRequested(const QPoint &)), SLOT(contextMenu(const QPoint &))); + // setFocusHandlerNoChildren(m_pUrlList); m_pUrlList->setFocusPolicy(Qt::StrongFocus); m_pUrlList->setFocus(); } void UrlDialog::config() { - if (!g_pConfigDialog) g_pConfigDialog = new ConfigDialog(); + if(!g_pConfigDialog) + g_pConfigDialog = new ConfigDialog(); } void UrlDialog::help() { -//#warning "help" -// m_pFrm->requestHelpOn("doc_plugin_url.kvihelp"); + //#warning "help" + // m_pFrm->requestHelpOn("doc_plugin_url.kvihelp"); } void UrlDialog::saveList() @@ -205,8 +209,10 @@ void UrlDialog::loadList() void UrlDialog::clear() { g_pList->clear(); - for (UrlDlgList *tmpitem=g_pUrlDlgList->first();tmpitem;tmpitem=g_pUrlDlgList->next()) { - if (tmpitem->dlg) tmpitem->dlg->m_pUrlList->clear(); + for(UrlDlgList * tmpitem = g_pUrlDlgList->first(); tmpitem; tmpitem = g_pUrlDlgList->next()) + { + if(tmpitem->dlg) + tmpitem->dlg->m_pUrlList->clear(); } } @@ -237,14 +243,16 @@ void UrlDialog::close_slot() void UrlDialog::remove() { - if (!m_pUrlList->currentItem()) { - QMessageBox::warning(0,__tr2qs("Entry Selection - KVIrc"),__tr2qs("Must select a URL entry from the list to remove it."),QMessageBox::Ok,QMessageBox::NoButton,QMessageBox::NoButton); + if(!m_pUrlList->currentItem()) + { + QMessageBox::warning(0, __tr2qs("Entry Selection - KVIrc"), __tr2qs("Must select a URL entry from the list to remove it."), QMessageBox::Ok, QMessageBox::NoButton, QMessageBox::NoButton); return; } - for(KviUrl *tmp=g_pList->first();tmp;tmp=g_pList->next()) + for(KviUrl * tmp = g_pList->first(); tmp; tmp = g_pList->next()) { - if (tmp->url == m_pUrlList->currentItem()->text(0)) { + if(tmp->url == m_pUrlList->currentItem()->text(0)) + { g_pList->removeRef(tmp); delete m_pUrlList->currentItem(); //m_pUrlList->takeTopLevelItem(m_pUrlList->currentItem()); @@ -255,8 +263,8 @@ void UrlDialog::remove() void UrlDialog::findtext() { -//#warning "find text" -/* + //#warning "find text" + /* if (!m_pUrlList->currentItem()) { kvirc_plugin_warning_box(__tr("Select an URL")); return; @@ -279,70 +287,70 @@ void UrlDialog::findtext() */ } -void UrlDialog::dblclk_url(QTreeWidgetItem *item, int) +void UrlDialog::dblclk_url(QTreeWidgetItem * item, int) { - QString cmd="openurl "; + QString cmd = "openurl "; QString szUrl = item->text(0); KviQString::escapeKvs(&szUrl); cmd.append(szUrl); - KviKvsScript::run(cmd,this); + KviKvsScript::run(cmd, this); } -void UrlDialog::popup(QTreeWidgetItem *item, const QPoint &point) +void UrlDialog::popup(QTreeWidgetItem * item, const QPoint & point) { m_szUrl = item->text(0); - QMenu p("menu", 0); - p.addAction(__tr2qs("&Remove"),this,SLOT(remove())); -// p.addAction(__tr2qs("&Find Text"),this,SLOT(findtext())); - p.addSeparator(); - m_pListPopup = new QMenu("list", 0); + QMenu p("menu", 0); + p.addAction(__tr2qs("&Remove"), this, SLOT(remove())); + // p.addAction(__tr2qs("&Find Text"),this,SLOT(findtext())); + p.addSeparator(); + m_pListPopup = new QMenu("list", 0); - for(KviWindow *w=g_pMainWindow->windowList()->first();w;w=g_pMainWindow->windowList()->next()) + for(KviWindow * w = g_pMainWindow->windowList()->first(); w; w = g_pMainWindow->windowList()->next()) { - if ((w->type() == KviWindow::Channel) || - (w->type() == KviWindow::Query) || - (w->type() == KviWindow::DccChat)) + if((w->type() == KviWindow::Channel) || (w->type() == KviWindow::Query) || (w->type() == KviWindow::DccChat)) { m_pListPopup->addAction(w->plainTextCaption()); } } - p.addAction(__tr2qs("&Say to Window"))->setMenu(m_pListPopup); - connect(m_pListPopup,SIGNAL(triggered(QAction *)), this, SLOT(sayToWin(QAction *))); + p.addAction(__tr2qs("&Say to Window"))->setMenu(m_pListPopup); + connect(m_pListPopup, SIGNAL(triggered(QAction *)), this, SLOT(sayToWin(QAction *))); p.exec(point); } -void UrlDialog::contextMenu(const QPoint &point) +void UrlDialog::contextMenu(const QPoint & point) { - QMenu p("contextmenu", 0); - p.addAction(__tr2qs("Configure"),this,SLOT(config())); + QMenu p("contextmenu", 0); + p.addAction(__tr2qs("Configure"), this, SLOT(config())); p.exec(point); } void UrlDialog::sayToWin(QAction * act) { - KviWindow *wnd = g_pApp->findWindowByCaption(act->text()); + KviWindow * wnd = g_pApp->findWindowByCaption(act->text()); if(wnd) { QString szUrl = m_szUrl; QString szWindow = wnd->windowName(); KviQString::escapeKvs(&szUrl); KviQString::escapeKvs(&szWindow); - QString say=QString("PRIVMSG %1 %2").arg(szWindow, szUrl); - KviKvsScript::run(say,wnd); + QString say = QString("PRIVMSG %1 %2").arg(szWindow, szUrl); + KviKvsScript::run(say, wnd); g_pMainWindow->setActiveWindow(wnd); - } else { - QMessageBox::warning(0,__tr2qs("Window Not Found - KVIrc"),__tr2qs("Window not found."),QMessageBox::Ok,QMessageBox::NoButton,QMessageBox::NoButton); + } + else + { + QMessageBox::warning(0, __tr2qs("Window Not Found - KVIrc"), __tr2qs("Window not found."), QMessageBox::Ok, QMessageBox::NoButton, QMessageBox::NoButton); } } -QPixmap *UrlDialog::myIconPtr() +QPixmap * UrlDialog::myIconPtr() { return g_pIconManager->getSmallIcon(KviIconManager::Url); } void UrlDialog::addUrl(QString url, QString window, QString count, QString timestamp) { - QTreeWidgetItem *UrlItem = new QTreeWidgetItem(m_pUrlList); + QTreeWidgetItem * UrlItem = new QTreeWidgetItem(m_pUrlList); UrlItem->setText(0, url); UrlItem->setText(1, window); @@ -363,8 +371,8 @@ void UrlDialog::addUrl(QString url, QString window, QString count, QString times void UrlDialog::resizeEvent(QResizeEvent *) { int hght = m_pMenuBar->heightForWidth(width()); - m_pMenuBar->setGeometry(0,0,width(),hght); - m_pUrlList->setGeometry(0,hght,width(),height() - hght); + m_pMenuBar->setGeometry(0, 0, width(), hght); + m_pUrlList->setGeometry(0, hght, width(), height() - hght); } UrlDialog::~UrlDialog() @@ -381,11 +389,11 @@ UrlDialog::~UrlDialog() } */ delete m_pUrlList; -/* if (m_pListPopup) delete m_pListPopup; + /* if (m_pListPopup) delete m_pListPopup; m_pListPopup = 0; if (m_pMenuBar) delete m_pMenuBar; m_pMenuBar = 0;*/ - UrlDlgList *tmpitem = findFrame(); + UrlDlgList * tmpitem = findFrame(); tmpitem->dlg = 0; } @@ -394,42 +402,42 @@ UrlDialog::~UrlDialog() // --------------------------- CLASS CONFIGDIALOG ----------------------begin // ConfigDialog::ConfigDialog() -:QDialog() + : QDialog() { setWindowTitle(__tr2qs("URL Module Configuration - KVIrc")); - QGridLayout *g = new QGridLayout(this); + QGridLayout * g = new QGridLayout(this); - KviConfigurationFile *cfg = new KviConfigurationFile(szConfigPath,KviConfigurationFile::Read); + KviConfigurationFile * cfg = new KviConfigurationFile(szConfigPath, KviConfigurationFile::Read); cfg->setGroup("ConfigDialog"); - cb[0] = new QCheckBox(__tr2qs("Save URL list on module unload"),this); - cb[0]->setChecked(cfg->readBoolEntry("SaveUrlListOnUnload",false)); - g->addWidget(cb[0],0,0,1,2); + cb[0] = new QCheckBox(__tr2qs("Save URL list on module unload"), this); + cb[0]->setChecked(cfg->readBoolEntry("SaveUrlListOnUnload", false)); + g->addWidget(cb[0], 0, 0, 1, 2); - cb[1] = new QCheckBox(__tr2qs("Save columns width on URL list close"),this); - cb[1]->setChecked(cfg->readBoolEntry("SaveColumnWidthOnClose",false)); - g->addWidget(cb[1],1,0,1,2); + cb[1] = new QCheckBox(__tr2qs("Save columns width on URL list close"), this); + cb[1]->setChecked(cfg->readBoolEntry("SaveColumnWidthOnClose", false)); + g->addWidget(cb[1], 1, 0, 1, 2); - bool tmp = cfg->readBoolEntry("BanEnabled",false); + bool tmp = cfg->readBoolEntry("BanEnabled", false); delete cfg; - m_pBanFrame = new BanFrame(this,"banlist",tmp); - g->addWidget(m_pBanFrame,3,0,1,2); + m_pBanFrame = new BanFrame(this, "banlist", tmp); + g->addWidget(m_pBanFrame, 3, 0, 1, 2); - QPushButton *b; + QPushButton * b; // configure buttons - b = new QPushButton(__tr2qs("&Cancel"),this); + b = new QPushButton(__tr2qs("&Cancel"), this); b->setObjectName("discard"); - connect(b,SIGNAL(clicked()),this,SLOT(discardbtn())); - g->addWidget(b,4,0); + connect(b, SIGNAL(clicked()), this, SLOT(discardbtn())); + g->addWidget(b, 4, 0); - b = new QPushButton(__tr2qs("&OK"),this); + b = new QPushButton(__tr2qs("&OK"), this); b->setObjectName("accept"); - connect(b,SIGNAL(clicked()),this,SLOT(acceptbtn())); - g->addWidget(b,4,1); + connect(b, SIGNAL(clicked()), this, SLOT(acceptbtn())); + g->addWidget(b, 4, 1); show(); } @@ -441,13 +449,14 @@ void ConfigDialog::discardbtn() void ConfigDialog::acceptbtn() { - KviConfigurationFile *cfg = new KviConfigurationFile(szConfigPath,KviConfigurationFile::Write); + KviConfigurationFile * cfg = new KviConfigurationFile(szConfigPath, KviConfigurationFile::Write); cfg->setGroup("ConfigDialog"); - if (m_pBanFrame) m_pBanFrame->saveBans(cfg); + if(m_pBanFrame) + m_pBanFrame->saveBans(cfg); - cfg->writeEntry("SaveUrlListOnUnload",cb[0]->isChecked()); - cfg->writeEntry("SaveColumnWidthOnClose",cb[1]->isChecked()); + cfg->writeEntry("SaveUrlListOnUnload", cb[0]->isChecked()); + cfg->writeEntry("SaveColumnWidthOnClose", cb[1]->isChecked()); delete cfg; delete this; @@ -460,7 +469,8 @@ void ConfigDialog::closeEvent(QCloseEvent *) ConfigDialog::~ConfigDialog() { - for(int i=0;isetChecked(banEnabled); - g->addWidget(m_pEnable,0,0,1,2); + g->addWidget(m_pEnable, 0, 0, 1, 2); m_pBanList = new QListWidget(this); m_pBanList->setMinimumHeight(100); loadBanList(); - for(QString *tmp=g_pBanList->first();tmp;tmp=g_pBanList->next()) { + for(QString * tmp = g_pBanList->first(); tmp; tmp = g_pBanList->next()) + { m_pBanList->addItem(*tmp); // load ban list into listbox } m_pBanList->setEnabled(m_pEnable->isChecked()); - g->addWidget(m_pBanList,1,0,1,2); + g->addWidget(m_pBanList, 1, 0, 1, 2); - m_pAddBtn = new QPushButton(__tr2qs("&Add Ban"),this); + m_pAddBtn = new QPushButton(__tr2qs("&Add Ban"), this); m_pAddBtn->setObjectName("add"); - connect(m_pAddBtn,SIGNAL(clicked()),this,SLOT(addBan())); + connect(m_pAddBtn, SIGNAL(clicked()), this, SLOT(addBan())); m_pAddBtn->setEnabled(m_pEnable->isChecked()); - g->addWidget(m_pAddBtn,2,0); + g->addWidget(m_pAddBtn, 2, 0); - m_pRemoveBtn = new QPushButton(__tr2qs("&Remove Selected"),this); + m_pRemoveBtn = new QPushButton(__tr2qs("&Remove Selected"), this); m_pRemoveBtn->setObjectName("remove"); - connect(m_pRemoveBtn,SIGNAL(clicked()),this,SLOT(removeBan())); + connect(m_pRemoveBtn, SIGNAL(clicked()), this, SLOT(removeBan())); m_pRemoveBtn->setEnabled(m_pEnable->isChecked()); - g->addWidget(m_pRemoveBtn,2,1); + g->addWidget(m_pRemoveBtn, 2, 1); } void BanFrame::enableClicked() @@ -514,8 +525,9 @@ void BanFrame::enableClicked() void BanFrame::addBan() { bool ok = false; - QString *pText = new QString(QInputDialog::getText(this, __tr2qs("URL Ban List - KVIrc"),__tr2qs("Enter a URL to ban."),QLineEdit::Normal,QString(),&ok)); - if (ok && !pText->isEmpty()) { + QString * pText = new QString(QInputDialog::getText(this, __tr2qs("URL Ban List - KVIrc"), __tr2qs("Enter a URL to ban."), QLineEdit::Normal, QString(), &ok)); + if(ok && !pText->isEmpty()) + { g_pBanList->append(pText); m_pBanList->addItem(*pText); } @@ -526,14 +538,15 @@ void BanFrame::removeBan() if(!m_pBanList->currentItem()) return; - if (!m_pBanList->currentItem()->isSelected()) { - QMessageBox::warning(0,__tr2qs("Entry Selection - KVIrc"),__tr2qs("Must select a ban entry from the list to remove it."),QMessageBox::Ok,QMessageBox::NoButton,QMessageBox::NoButton); + if(!m_pBanList->currentItem()->isSelected()) + { + QMessageBox::warning(0, __tr2qs("Entry Selection - KVIrc"), __tr2qs("Must select a ban entry from the list to remove it."), QMessageBox::Ok, QMessageBox::NoButton, QMessageBox::NoButton); return; } QString item(m_pBanList->currentItem()->text()); - for(QString *tmp=g_pBanList->first();tmp;tmp=g_pBanList->next()) + for(QString * tmp = g_pBanList->first(); tmp; tmp = g_pBanList->next()) { - if (tmp->compare(item)==0) + if(tmp->compare(item) == 0) { g_pBanList->removeCurrent(); delete m_pBanList->currentItem(); @@ -542,18 +555,17 @@ void BanFrame::removeBan() } m_pBanList->removeItemWidget(m_pBanList->currentItem()); - } -void BanFrame::saveBans(KviConfigurationFile *cfg) +void BanFrame::saveBans(KviConfigurationFile * cfg) { - cfg->writeEntry("BanEnabled",m_pEnable->isChecked()); - if (m_pEnable->isChecked()) saveBanList(); + cfg->writeEntry("BanEnabled", m_pEnable->isChecked()); + if(m_pEnable->isChecked()) + saveBanList(); } BanFrame::~BanFrame() { - } // ---------------------------- CLASS URLTOOLBAR -------------------------end // @@ -561,7 +573,7 @@ BanFrame::~BanFrame() void saveUrlList() { QString urllist; - g_pApp->getLocalKvircDirectory(urllist,KviApplication::ConfigPlugins); + g_pApp->getLocalKvircDirectory(urllist, KviApplication::ConfigPlugins); urllist += g_pUrlListFilename; QFile file; file.setFileName(urllist); @@ -571,7 +583,7 @@ void saveUrlList() stream << g_pList->count() << endl; - for(KviUrl *tmp=g_pList->first();tmp;tmp=g_pList->next()) + for(KviUrl * tmp = g_pList->first(); tmp; tmp = g_pList->next()) { stream << tmp->url << endl; stream << tmp->window << endl; @@ -585,23 +597,27 @@ void saveUrlList() void loadUrlList() { QString urllist; - g_pApp->getLocalKvircDirectory(urllist,KviApplication::ConfigPlugins); + g_pApp->getLocalKvircDirectory(urllist, KviApplication::ConfigPlugins); urllist += g_pUrlListFilename; QFile file; file.setFileName(urllist); - if (!file.open(QIODevice::ReadOnly))return; + if(!file.open(QIODevice::ReadOnly)) + return; QTextStream stream(&file); g_pList->clear(); - for (UrlDlgList *tmpitem=g_pUrlDlgList->first();tmpitem;tmpitem=g_pUrlDlgList->next()) { - if (tmpitem->dlg) tmpitem->dlg->m_pUrlList->clear(); + for(UrlDlgList * tmpitem = g_pUrlDlgList->first(); tmpitem; tmpitem = g_pUrlDlgList->next()) + { + if(tmpitem->dlg) + tmpitem->dlg->m_pUrlList->clear(); } - KviUrl *tmp; - int i=0; + KviUrl * tmp; + int i = 0; int num = stream.readLine().toInt(); - while ((!stream.atEnd()) && (iurl = stream.readLine(); tmp->window = stream.readLine(); @@ -610,8 +626,10 @@ void loadUrlList() g_pList->append(tmp); - for (UrlDlgList *tmpitem=g_pUrlDlgList->first();tmpitem;tmpitem=g_pUrlDlgList->next()) { - if (tmpitem->dlg) { + for(UrlDlgList * tmpitem = g_pUrlDlgList->first(); tmpitem; tmpitem = g_pUrlDlgList->next()) + { + if(tmpitem->dlg) + { QString tmpCount; tmpCount.setNum(tmp->count); tmpitem->dlg->addUrl(QString(tmp->url), QString(tmp->window), tmpCount, QString(tmp->timestamp)); @@ -625,7 +643,7 @@ void loadUrlList() void saveBanList() { QString banlist; - g_pApp->getLocalKvircDirectory(banlist,KviApplication::ConfigPlugins); + g_pApp->getLocalKvircDirectory(banlist, KviApplication::ConfigPlugins); banlist += g_pBanListFilename; QFile file; file.setFileName(banlist); @@ -634,7 +652,7 @@ void saveBanList() QTextStream stream(&file); stream << g_pBanList->count() << endl; - for(QString *tmp=g_pBanList->first();tmp;tmp=g_pBanList->next()) + for(QString * tmp = g_pBanList->first(); tmp; tmp = g_pBanList->next()) { stream << *tmp << endl; } @@ -645,27 +663,28 @@ void saveBanList() void loadBanList() { QString banlist; - g_pApp->getLocalKvircDirectory(banlist,KviApplication::ConfigPlugins); + g_pApp->getLocalKvircDirectory(banlist, KviApplication::ConfigPlugins); banlist += g_pBanListFilename; QFile file; file.setFileName(banlist); - if (!file.open(QIODevice::ReadOnly))return; + if(!file.open(QIODevice::ReadOnly)) + return; QTextStream stream(&file); g_pBanList->clear(); - int i=0; + int i = 0; int num = stream.readLine().toInt(); - while ((!stream.atEnd()) && (iappend(tmp); i++; } file.close(); } - /* @doc: url.list @type: @@ -694,13 +713,14 @@ void loadBanList() static bool url_kvs_cmd_list(KviKvsModuleCommandCall *) { - UrlDlgList *tmpitem = findFrame(); - if (tmpitem->dlg) return false; + UrlDlgList * tmpitem = findFrame(); + if(tmpitem->dlg) + return false; tmpitem->dlg = new UrlDialog(g_pList); g_pMainWindow->addWindow(tmpitem->dlg); - for(KviUrl *tmp=g_pList->first();tmp;tmp=g_pList->next()) + for(KviUrl * tmp = g_pList->first(); tmp; tmp = g_pList->next()) { QString tmpCount; tmpCount.setNum(tmp->count); @@ -709,11 +729,12 @@ static bool url_kvs_cmd_list(KviKvsModuleCommandCall *) return true; } -UrlDlgList *findFrame() +UrlDlgList * findFrame() { - UrlDlgList *tmpitem = g_pUrlDlgList->first(); - if (!tmpitem) { - UrlDlgList *udl = new UrlDlgList(); + UrlDlgList * tmpitem = g_pUrlDlgList->first(); + if(!tmpitem) + { + UrlDlgList * udl = new UrlDlgList(); udl->dlg = 0; udl->menu_id = -1; g_pUrlDlgList->append(udl); @@ -744,42 +765,49 @@ UrlDlgList *findFrame() static bool url_kvs_cmd_config(KviKvsModuleCommandCall *) { - if (!g_pConfigDialog) g_pConfigDialog = new ConfigDialog(); + if(!g_pConfigDialog) + g_pConfigDialog = new ConfigDialog(); return true; } -int check_url(KviWindow *w,const QString &szUrl) // return 0 if no occurrence of the URL were found +int check_url(KviWindow * w, const QString & szUrl) // return 0 if no occurrence of the URL were found { int tmp = 0; - for(QString *tmpi=g_pBanList->first();tmpi;tmpi=g_pBanList->next()) + for(QString * tmpi = g_pBanList->first(); tmpi; tmpi = g_pBanList->next()) { - if (szUrl.indexOf(*tmpi,Qt::CaseInsensitive) != -1) tmp++; + if(szUrl.indexOf(*tmpi, Qt::CaseInsensitive) != -1) + tmp++; } - if (tmp > 0) return tmp; + if(tmp > 0) + return tmp; - for(KviUrl *u = g_pList->first();u;u=g_pList->next()) + for(KviUrl * u = g_pList->first(); u; u = g_pList->next()) { - if (u->url == szUrl) { + if(u->url == szUrl) + { u->window = w->plainTextCaption(); u->count++; tmp++; } } - for (UrlDlgList *tmpitem=g_pUrlDlgList->first();tmpitem;tmpitem=g_pUrlDlgList->next()) { - if (tmpitem->dlg) { - int count=tmpitem->dlg->m_pUrlList->topLevelItemCount(); - for(int i=0;ifirst(); tmpitem; tmpitem = g_pUrlDlgList->next()) + { + if(tmpitem->dlg) + { + int count = tmpitem->dlg->m_pUrlList->topLevelItemCount(); + for(int i = 0; i < count; i++) { - QTreeWidgetItem* it=tmpitem->dlg->m_pUrlList->topLevelItem(i); - if (it->text(0) == szUrl) { + QTreeWidgetItem * it = tmpitem->dlg->m_pUrlList->topLevelItem(i); + if(it->text(0) == szUrl) + { int tmpCount = it->text(2).toInt(); tmpCount++; QString tmpStr; tmpStr.setNum(tmpCount); - it->setText(2,tmpStr); - it->setText(1,w->plainTextCaption()); + it->setText(2, tmpStr); + it->setText(1, w->plainTextCaption()); } } } @@ -791,26 +819,29 @@ bool urllist_module_event_onUrl(KviKvsModuleEventCall * c) { KviKvsVariant * vUrl = c->firstParam(); QString szUrl; - if(vUrl)vUrl->asString(szUrl); + if(vUrl) + vUrl->asString(szUrl); - if (check_url(c->window(),szUrl) == 0) + if(check_url(c->window(), szUrl) == 0) { - KviUrl *tmp = new KviUrl; + KviUrl * tmp = new KviUrl; QString tmpTimestamp; QDate d = QDate::currentDate(); QString date; - date.sprintf("%d-%d%d-%d%d",d.year(),d.month() / 10,d.month() % 10,d.day() / 10,d.day() % 10); - tmpTimestamp = "["+date+"]"+" ["; - tmpTimestamp += QTime::currentTime().toString()+"]"; + date.sprintf("%d-%d%d-%d%d", d.year(), d.month() / 10, d.month() % 10, d.day() / 10, d.day() % 10); + tmpTimestamp = "[" + date + "]" + " ["; + tmpTimestamp += QTime::currentTime().toString() + "]"; tmp->url = szUrl; tmp->window = c->window()->plainTextCaption(); tmp->count = 1; tmp->timestamp = tmpTimestamp; g_pList->append(tmp); - for (UrlDlgList *tmpitem=g_pUrlDlgList->first();tmpitem;tmpitem=g_pUrlDlgList->next()) { - if (tmpitem->dlg) { + for(UrlDlgList * tmpitem = g_pUrlDlgList->first(); tmpitem; tmpitem = g_pUrlDlgList->next()) + { + if(tmpitem->dlg) + { QString tmpCount; tmpCount.setNum(tmp->count); tmpitem->dlg->addUrl(QString(tmp->url), QString(tmp->window), tmpCount, QString(tmp->timestamp)); @@ -821,7 +852,6 @@ bool urllist_module_event_onUrl(KviKvsModuleEventCall * c) return true; } - /* @doc: url.load @type: command @@ -835,8 +865,7 @@ bool urllist_module_event_onUrl(KviKvsModuleEventCall * c) Loads the URL list module which keeps track of all URLs shown in KVIrc windows. */ - -static bool url_module_init(KviModule *m) +static bool url_module_init(KviModule * m) { g_pList = new KviPointerList; g_pList->setAutoDelete(true); @@ -847,17 +876,17 @@ static bool url_module_init(KviModule *m) g_pBanList = new KviPointerList; g_pBanList->setAutoDelete(true); - KVSM_REGISTER_SIMPLE_COMMAND(m,"list",url_kvs_cmd_list); - KVSM_REGISTER_SIMPLE_COMMAND(m,"config",url_kvs_cmd_config); + KVSM_REGISTER_SIMPLE_COMMAND(m, "list", url_kvs_cmd_list); + KVSM_REGISTER_SIMPLE_COMMAND(m, "config", url_kvs_cmd_config); - m->kvsRegisterAppEventHandler(KviEvent_OnURL,urllist_module_event_onUrl); + m->kvsRegisterAppEventHandler(KviEvent_OnURL, urllist_module_event_onUrl); - g_pApp->getLocalKvircDirectory(szConfigPath,KviApplication::ConfigPlugins,"url.conf"); + g_pApp->getLocalKvircDirectory(szConfigPath, KviApplication::ConfigPlugins, "url.conf"); loadUrlList(); loadBanList(); - UrlDlgList *udl = new UrlDlgList(); + UrlDlgList * udl = new UrlDlgList(); udl->dlg = 0; g_pUrlDlgList->append(udl); @@ -866,11 +895,14 @@ static bool url_module_init(KviModule *m) static bool url_module_cleanup(KviModule *) { - KviConfigurationFile cfg(szConfigPath,KviConfigurationFile::Read); + KviConfigurationFile cfg(szConfigPath, KviConfigurationFile::Read); cfg.setGroup("ConfigDialog"); - if (cfg.readBoolEntry("SaveUrlListOnUnload",false) == true) saveUrlList(); - for (UrlDlgList *tmpitem=g_pUrlDlgList->first();tmpitem;tmpitem=g_pUrlDlgList->next()) { - if (tmpitem->dlg) tmpitem->dlg->close(); + if(cfg.readBoolEntry("SaveUrlListOnUnload", false) == true) + saveUrlList(); + for(UrlDlgList * tmpitem = g_pUrlDlgList->first(); tmpitem; tmpitem = g_pUrlDlgList->next()) + { + if(tmpitem->dlg) + tmpitem->dlg->close(); } delete g_pList; @@ -892,7 +924,8 @@ static bool url_module_can_unload(KviModule *) void url_module_config() { - if (!g_pConfigDialog) g_pConfigDialog = new ConfigDialog(); + if(!g_pConfigDialog) + g_pConfigDialog = new ConfigDialog(); } /* @@ -927,15 +960,13 @@ void url_module_config() [b]Ted Podgurski[/b] for toolbar's icons. */ - KVIRC_MODULE( - "URL", - "4.0.0", - "Copyright (C) 2002 Andrea Parrella ", - "URL list module for KVIrc", - url_module_init, - url_module_can_unload, - 0, - url_module_cleanup, - 0 -) + "URL", + "4.0.0", + "Copyright (C) 2002 Andrea Parrella ", + "URL list module for KVIrc", + url_module_init, + url_module_can_unload, + 0, + url_module_cleanup, + 0) diff --git a/src/modules/url/libkviurl.h b/src/modules/url/libkviurl.h index e92abf680..56203de3c 100644 --- a/src/modules/url/libkviurl.h +++ b/src/modules/url/libkviurl.h @@ -57,13 +57,14 @@ class UrlDialogTreeWidget : public QTreeWidget { Q_OBJECT public: - UrlDialogTreeWidget(QWidget*); + UrlDialogTreeWidget(QWidget *); ~UrlDialogTreeWidget(){}; + protected: - void mousePressEvent (QMouseEvent *e); + void mousePressEvent(QMouseEvent * e); void paintEvent(QPaintEvent * event); signals: - void rightButtonPressed(QTreeWidgetItem *,QPoint); + void rightButtonPressed(QTreeWidgetItem *, QPoint); void contextMenuRequested(QPoint); }; @@ -71,19 +72,21 @@ class UrlDialog : public KviWindow { Q_OBJECT public: - UrlDialog(KviPointerList *g_pList); + UrlDialog(KviPointerList * g_pList); ~UrlDialog(); + private: - KviTalMenuBar *m_pMenuBar; - QMenu *m_pListPopup; // dynamic popup menu - QString m_szUrl; // used to pass URLs to sayToWin slot + KviTalMenuBar * m_pMenuBar; + QMenu * m_pListPopup; // dynamic popup menu + QString m_szUrl; // used to pass URLs to sayToWin slot protected: - QPixmap *myIconPtr(); + QPixmap * myIconPtr(); void resizeEvent(QResizeEvent *); + public: - UrlDialogTreeWidget *m_pUrlList; + UrlDialogTreeWidget * m_pUrlList; void addUrl(QString url, QString window, QString count, QString timestamp); -// void saveProperties(); + // void saveProperties(); protected slots: void config(); void help(); @@ -93,9 +96,9 @@ protected slots: void close_slot(); void remove(); void findtext(); - void dblclk_url(QTreeWidgetItem *item, int); - void popup(QTreeWidgetItem *item, const QPoint &p); - void contextMenu(const QPoint &p); + void dblclk_url(QTreeWidgetItem * item, int); + void popup(QTreeWidgetItem * item, const QPoint & p); + void contextMenu(const QPoint & p); void sayToWin(QAction * act); }; @@ -103,14 +106,15 @@ class BanFrame : public QFrame { Q_OBJECT public: - BanFrame(QWidget *parent=0, const char *name=0, bool banEnable = false); + BanFrame(QWidget * parent = 0, const char * name = 0, bool banEnable = false); ~BanFrame(); - void saveBans(KviConfigurationFile *cfg); + void saveBans(KviConfigurationFile * cfg); + private: - QCheckBox *m_pEnable; - QListWidget *m_pBanList; - QPushButton *m_pAddBtn; - QPushButton *m_pRemoveBtn; + QCheckBox * m_pEnable; + QListWidget * m_pBanList; + QPushButton * m_pAddBtn; + QPushButton * m_pRemoveBtn; protected slots: void enableClicked(); void addBan(); @@ -125,9 +129,10 @@ class ConfigDialog : public QDialog public: ConfigDialog(); ~ConfigDialog(); + private: - QCheckBox *cb[cbnum]; - BanFrame *m_pBanFrame; + QCheckBox * cb[cbnum]; + BanFrame * m_pBanFrame; void closeEvent(QCloseEvent *); protected slots: void acceptbtn(); diff --git a/src/modules/userlist/libkviuserlist.cpp b/src/modules/userlist/libkviuserlist.cpp index 0ce8d00a0..080539d02 100644 --- a/src/modules/userlist/libkviuserlist.cpp +++ b/src/modules/userlist/libkviuserlist.cpp @@ -27,46 +27,50 @@ #include "KviChannelWindow.h" #include "KviUserListView.h" -#define GET_KVS_WINDOW_ID_AND_NICK \ - QString szWnd, szNick; \ - KviWindow * pWnd; \ - KVSM_PARAMETERS_BEGIN(c) \ - KVSM_PARAMETER("nick",KVS_PT_NONEMPTYSTRING,0,szNick) \ - KVSM_PARAMETER("window_id",KVS_PT_STRING,KVS_PF_OPTIONAL,szWnd) \ - KVSM_PARAMETERS_END(c) \ - if(c->parameterList()->count() == 1) \ - { \ - pWnd = c->window(); \ - } else { \ - pWnd = g_pApp->findWindow(szWnd.toUtf8().data()); \ - if(!pWnd) \ - { \ - if(!c->hasSwitch('q',"quiet")) \ - c->warning(__tr2qs("The window with ID '%s' doesn't exist"),szWnd.toUtf8().data()); \ - return true; \ - } \ - } \ - if(!pWnd) \ - return true; - -#define GET_KVS_FNC_WINDOW_ID \ - QString szWnd; \ - KviWindow * pWnd; \ - KVSM_PARAMETERS_BEGIN(c) \ - KVSM_PARAMETER("window_id",KVS_PT_STRING,KVS_PF_OPTIONAL,szWnd) \ - KVSM_PARAMETERS_END(c) \ - if(c->parameterList()->count() == 0) \ - { \ - pWnd = c->window(); \ - } else { \ - pWnd = g_pApp->findWindow(szWnd.toUtf8().data()); \ - if(!pWnd) \ - return true; \ - } \ - if(!pWnd) \ - { \ - return true; \ - } \ +#define GET_KVS_WINDOW_ID_AND_NICK \ + QString szWnd, szNick; \ + KviWindow * pWnd; \ + KVSM_PARAMETERS_BEGIN(c) \ + KVSM_PARAMETER("nick", KVS_PT_NONEMPTYSTRING, 0, szNick) \ + KVSM_PARAMETER("window_id", KVS_PT_STRING, KVS_PF_OPTIONAL, szWnd) \ + KVSM_PARAMETERS_END(c) \ + if(c->parameterList()->count() == 1) \ + { \ + pWnd = c->window(); \ + } \ + else \ + { \ + pWnd = g_pApp->findWindow(szWnd.toUtf8().data()); \ + if(!pWnd) \ + { \ + if(!c->hasSwitch('q', "quiet")) \ + c->warning(__tr2qs("The window with ID '%s' doesn't exist"), szWnd.toUtf8().data()); \ + return true; \ + } \ + } \ + if(!pWnd) \ + return true; + +#define GET_KVS_FNC_WINDOW_ID \ + QString szWnd; \ + KviWindow * pWnd; \ + KVSM_PARAMETERS_BEGIN(c) \ + KVSM_PARAMETER("window_id", KVS_PT_STRING, KVS_PF_OPTIONAL, szWnd) \ + KVSM_PARAMETERS_END(c) \ + if(c->parameterList()->count() == 0) \ + { \ + pWnd = c->window(); \ + } \ + else \ + { \ + pWnd = g_pApp->findWindow(szWnd.toUtf8().data()); \ + if(!pWnd) \ + return true; \ + } \ + if(!pWnd) \ + { \ + return true; \ + } // FIXME: #warning "THIS HAS TO WORK FOR QUERIES TOO!" /* @@ -105,7 +109,7 @@ static bool userlist_kvs_fnc_selected(KviKvsModuleFunctionCall * c) if(pWnd->type() != KviWindow::Channel) { - c->warning(__tr2qs_ctx("The specified window is not a channel","kvs")); + c->warning(__tr2qs_ctx("The specified window is not a channel", "kvs")); c->returnValue()->setNothing(); return true; } @@ -113,9 +117,9 @@ static bool userlist_kvs_fnc_selected(KviKvsModuleFunctionCall * c) KviKvsArray * a = new KviKvsArray(); kvs_int_t i = 0; - for(QString * s = ((KviChannelWindow *)pWnd)->firstSelectedNickname();s;s = ((KviChannelWindow *)pWnd)->nextSelectedNickname()) + for(QString * s = ((KviChannelWindow *)pWnd)->firstSelectedNickname(); s; s = ((KviChannelWindow *)pWnd)->nextSelectedNickname()) { - a->set(i,new KviKvsVariant(*s)); + a->set(i, new KviKvsVariant(*s)); i++; } @@ -129,11 +133,11 @@ static bool userlist_kvs_cmd_select(KviKvsModuleCommandCall * c) if(pWnd->type() != KviWindow::Channel) { - c->warning(__tr2qs_ctx("The specified window is not a channel","kvs")); + c->warning(__tr2qs_ctx("The specified window is not a channel", "kvs")); return true; } - ((KviUserListView*)((KviChannelWindow *)pWnd)->userListView())->select(szNick); + ((KviUserListView *)((KviChannelWindow *)pWnd)->userListView())->select(szNick); return true; } @@ -143,20 +147,20 @@ static bool userlist_kvs_cmd_ensureVisible(KviKvsModuleCommandCall * c) if(pWnd->type() != KviWindow::Channel) { - c->warning(__tr2qs_ctx("The specified window is not a channel","kvs")); + c->warning(__tr2qs_ctx("The specified window is not a channel", "kvs")); return true; } - ((KviUserListView*)((KviChannelWindow *)pWnd)->userListView())->ensureVisible(szNick); + ((KviUserListView *)((KviChannelWindow *)pWnd)->userListView())->ensureVisible(szNick); return true; } -static bool userlist_module_init(KviModule *m) +static bool userlist_module_init(KviModule * m) { - KVSM_REGISTER_FUNCTION(m,"selected",userlist_kvs_fnc_selected); + KVSM_REGISTER_FUNCTION(m, "selected", userlist_kvs_fnc_selected); - KVSM_REGISTER_SIMPLE_COMMAND(m,"select",userlist_kvs_cmd_select); - KVSM_REGISTER_SIMPLE_COMMAND(m,"ensureVisible",userlist_kvs_cmd_ensureVisible); + KVSM_REGISTER_SIMPLE_COMMAND(m, "select", userlist_kvs_cmd_select); + KVSM_REGISTER_SIMPLE_COMMAND(m, "ensureVisible", userlist_kvs_cmd_ensureVisible); return true; } @@ -171,13 +175,12 @@ static bool userlist_module_can_unload(KviModule *) } KVIRC_MODULE( - "Userlist", // module name - "4.0.0", // module version - "Copyright (C) 2010 Fabio Bas (ctrlaltca at gmail dot com)", // author & (C) - "KVIrc userlist management functions", - userlist_module_init, - userlist_module_can_unload, - 0, - userlist_module_cleanup, - 0 -) + "Userlist", // module name + "4.0.0", // module version + "Copyright (C) 2010 Fabio Bas (ctrlaltca at gmail dot com)", // author & (C) + "KVIrc userlist management functions", + userlist_module_init, + userlist_module_can_unload, + 0, + userlist_module_cleanup, + 0) diff --git a/src/modules/window/UserWindow.cpp b/src/modules/window/UserWindow.cpp index d9e7c073f..ccb607f44 100644 --- a/src/modules/window/UserWindow.cpp +++ b/src/modules/window/UserWindow.cpp @@ -30,9 +30,8 @@ extern KviPointerList * g_pUserWindowList; - -UserWindow::UserWindow(const char * pcName, QString &szIcon, KviConsoleWindow * pConsole, int iCreationFlags) -: KviWindow(KviWindow::UserWindow,pcName,pConsole) +UserWindow::UserWindow(const char * pcName, QString & szIcon, KviConsoleWindow * pConsole, int iCreationFlags) + : KviWindow(KviWindow::UserWindow, pcName, pConsole) { g_pUserWindowList->append(this); @@ -41,10 +40,10 @@ UserWindow::UserWindow(const char * pcName, QString &szIcon, KviConsoleWindow * m_szPlainTextCaption = pcName; fillSingleColorCaptionBuffers(m_szPlainTextCaption); - m_pIrcView = new KviIrcView(this,this); + m_pIrcView = new KviIrcView(this, this); if(iCreationFlags & HasInput) - m_pInput = new KviInput(this,0); + m_pInput = new KviInput(this, 0); else m_pInput = 0; @@ -61,9 +60,11 @@ UserWindow::~UserWindow() QPixmap * UserWindow::myIconPtr() { - QPixmap *pPix=g_pIconManager->getImage(m_szIcon); - if (!pPix) return g_pIconManager->getSmallIcon(0); - else return pPix; + QPixmap * pPix = g_pIconManager->getImage(m_szIcon); + if(!pPix) + return g_pIconManager->getSmallIcon(0); + else + return pPix; } void UserWindow::resizeEvent(QResizeEvent *) @@ -71,10 +72,12 @@ void UserWindow::resizeEvent(QResizeEvent *) if(m_pInput) { int hght = m_pInput->heightHint(); - m_pIrcView->setGeometry(0,0,width(),height() - hght); - m_pInput->setGeometry(0,height() - hght,width(),hght); - } else { - m_pIrcView->setGeometry(0,0,width(),height()); + m_pIrcView->setGeometry(0, 0, width(), height() - hght); + m_pInput->setGeometry(0, height() - hght, width(), hght); + } + else + { + m_pIrcView->setGeometry(0, 0, width(), height()); } } diff --git a/src/modules/window/UserWindow.h b/src/modules/window/UserWindow.h index 26c8e41e8..43df1af47 100644 --- a/src/modules/window/UserWindow.h +++ b/src/modules/window/UserWindow.h @@ -31,16 +31,23 @@ class UserWindow : public KviWindow { Q_OBJECT public: - enum CreationFlags { HasInput = 1 }; + enum CreationFlags + { + HasInput = 1 + }; + public: UserWindow(const char * pcName, QString & szIcon, KviConsoleWindow * pConsole = 0, int iCreationFlags = 0); ~UserWindow(); + protected: QString m_szIcon; + protected: virtual void resizeEvent(QResizeEvent *); virtual QPixmap * myIconPtr(); virtual void fillCaptionBuffers(); + public: void setWindowTitleStrings(const QString & szPlainText); }; diff --git a/src/modules/window/libkviwindow.cpp b/src/modules/window/libkviwindow.cpp index a9c736126..092c7ba34 100644 --- a/src/modules/window/libkviwindow.cpp +++ b/src/modules/window/libkviwindow.cpp @@ -43,55 +43,56 @@ #include - #ifdef COMPILE_CRYPT_SUPPORT - #include "KviCryptEngine.h" - #include "KviCryptController.h" - // KviApplication.cpp - extern KVIRC_API KviCryptEngineManager * g_pCryptEngineManager; +#include "KviCryptEngine.h" +#include "KviCryptController.h" +// KviApplication.cpp +extern KVIRC_API KviCryptEngineManager * g_pCryptEngineManager; #endif - // KviApplication.cpp -extern KVIRC_API KviPointerHashTable * g_pGlobalWindowDict; +extern KVIRC_API KviPointerHashTable * g_pGlobalWindowDict; KviPointerList * g_pUserWindowList = 0; // $window.caption $window.x $window.y $window.width $window.height $window.isActive $window.type // $window.input.text $window.input.cursorpos $window.input.textlen - -#define GET_KVS_WINDOW_ID \ - QString szWnd; \ - KviWindow * pWnd; \ - KVSM_PARAMETERS_BEGIN(c) \ - KVSM_PARAMETER("window_id",KVS_PT_STRING,KVS_PF_OPTIONAL,szWnd) \ - KVSM_PARAMETERS_END(c) \ - if(c->parameterList()->count() == 0) \ - { \ - pWnd = c->window(); \ - } else { \ - pWnd = g_pApp->findWindow(szWnd.toUtf8().data()); \ - if(!pWnd) \ - { \ - if(!c->hasSwitch('q',"quiet")) \ - c->warning(__tr2qs("The window with ID '%s' doesn't exist"),szWnd.toUtf8().data()); \ - return true; \ - } \ +#define GET_KVS_WINDOW_ID \ + QString szWnd; \ + KviWindow * pWnd; \ + KVSM_PARAMETERS_BEGIN(c) \ + KVSM_PARAMETER("window_id", KVS_PT_STRING, KVS_PF_OPTIONAL, szWnd) \ + KVSM_PARAMETERS_END(c) \ + if(c->parameterList()->count() == 0) \ + { \ + pWnd = c->window(); \ + } \ + else \ + { \ + pWnd = g_pApp->findWindow(szWnd.toUtf8().data()); \ + if(!pWnd) \ + { \ + if(!c->hasSwitch('q', "quiet")) \ + c->warning(__tr2qs("The window with ID '%s' doesn't exist"), szWnd.toUtf8().data()); \ + return true; \ + } \ } -#define GET_KVS_FNC_WINDOW_ID \ - QString szWnd; \ - KviWindow * pWnd; \ - KVSM_PARAMETERS_BEGIN(c) \ - KVSM_PARAMETER("window_id",KVS_PT_STRING,KVS_PF_OPTIONAL,szWnd) \ - KVSM_PARAMETERS_END(c) \ - if(c->parameterList()->count() == 0) \ - { \ - pWnd = c->window(); \ - } else { \ - pWnd = g_pApp->findWindow(szWnd.toUtf8().data()); \ - if(!pWnd) \ - return true; \ +#define GET_KVS_FNC_WINDOW_ID \ + QString szWnd; \ + KviWindow * pWnd; \ + KVSM_PARAMETERS_BEGIN(c) \ + KVSM_PARAMETER("window_id", KVS_PT_STRING, KVS_PF_OPTIONAL, szWnd) \ + KVSM_PARAMETERS_END(c) \ + if(c->parameterList()->count() == 0) \ + { \ + pWnd = c->window(); \ + } \ + else \ + { \ + pWnd = g_pApp->findWindow(szWnd.toUtf8().data()); \ + if(!pWnd) \ + return true; \ } /* @@ -121,11 +122,13 @@ static bool window_kvs_cmd_clearOutput(KviKvsModuleCommandCall * c) GET_KVS_WINDOW_ID if(pWnd) { - if(pWnd->view())pWnd->view()->clearBuffer(); + if(pWnd->view()) + pWnd->view()->clearBuffer(); if(pWnd->type() == KviWindow::Channel) { - KviChannelWindow *chan = (KviChannelWindow *)pWnd; - if(chan->messageView()) chan->messageView()->clearBuffer(); + KviChannelWindow * chan = (KviChannelWindow *)pWnd; + if(chan->messageView()) + chan->messageView()->clearBuffer(); } } return true; @@ -310,10 +313,12 @@ static bool window_kvs_fnc_activityLevel(KviKvsModuleFunctionCall * c) GET_KVS_FNC_WINDOW_ID if(pWnd) { - unsigned int v,t; - pWnd->activityMeter(&v,&t); + unsigned int v, t; + pWnd->activityMeter(&v, &t); c->returnValue()->setInteger(v); - } else { + } + else + { c->returnValue()->setInteger(0); } return true; @@ -349,10 +354,12 @@ static bool window_kvs_fnc_activityTemperature(KviKvsModuleFunctionCall * c) GET_KVS_FNC_WINDOW_ID if(pWnd) { - unsigned int v,t; - pWnd->activityMeter(&v,&t); + unsigned int v, t; + pWnd->activityMeter(&v, &t); c->returnValue()->setInteger(t); - } else { + } + else + { c->returnValue()->setInteger(0); } return true; @@ -387,7 +394,6 @@ static bool window_kvs_fnc_isDocked(KviKvsModuleFunctionCall * c) return true; } - /* @doc: window.hasInput @type: @@ -413,7 +419,8 @@ static bool window_kvs_fnc_hasInput(KviKvsModuleFunctionCall * c) if(pWnd) { c->returnValue()->setBoolean(pWnd->input() ? true : false); - } else + } + else c->returnValue()->setBoolean(false); return true; } @@ -447,7 +454,8 @@ static bool window_kvs_fnc_hasUserFocus(KviKvsModuleFunctionCall * c) { bool b = (pWnd == g_pActiveWindow) && pWnd->isActiveWindow(); c->returnValue()->setBoolean(b ? true : false); - } else + } + else c->returnValue()->setBoolean(false); return true; } @@ -506,7 +514,8 @@ static bool window_kvs_fnc_hasOutput(KviKvsModuleFunctionCall * c) if(pWnd) { c->returnValue()->setBoolean(pWnd->view() ? true : false); - } else + } + else c->returnValue()->setBoolean(false); return true; } @@ -532,7 +541,8 @@ static bool window_kvs_fnc_exists(KviKvsModuleFunctionCall * c) if(pWnd) { c->returnValue()->setBoolean(true); - } else + } + else c->returnValue()->setBoolean(false); return true; } @@ -566,18 +576,20 @@ static bool window_kvs_cmd_highlight(KviKvsModuleCommandCall * c) kvs_uint_t level; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("level",KVS_PT_UINT,0,level) - KVSM_PARAMETER("window_id",KVS_PT_STRING,KVS_PF_OPTIONAL,szWnd) + KVSM_PARAMETER("level", KVS_PT_UINT, 0, level) + KVSM_PARAMETER("window_id", KVS_PT_STRING, KVS_PF_OPTIONAL, szWnd) KVSM_PARAMETERS_END(c) if(c->parameterList()->count() == 1) { pWnd = c->window(); - } else { + } + else + { pWnd = g_pApp->findWindow(szWnd.toUtf8().data()); if(!pWnd) { - if(!c->hasSwitch('q',"quiet")) - c->warning(__tr2qs("The window with ID '%s' doesn't exist"),szWnd.toUtf8().data()); + if(!c->hasSwitch('q', "quiet")) + c->warning(__tr2qs("The window with ID '%s' doesn't exist"), szWnd.toUtf8().data()); return true; } } @@ -622,7 +634,9 @@ static bool window_kvs_fnc_highlightLevel(KviKvsModuleFunctionCall * c) unsigned int v; pWnd->highlightMeter(&v); c->returnValue()->setInteger(v); - } else { + } + else + { c->returnValue()->setInteger(0); } return true; @@ -810,10 +824,10 @@ static bool window_kvs_fnc_list(KviKvsModuleFunctionCall * c) QString szContext; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("type",KVS_PT_STRING,0,szType) - KVSM_PARAMETER("irc_context_id",KVS_PT_STRING,KVS_PF_OPTIONAL,szContext) + KVSM_PARAMETER("type", KVS_PT_STRING, 0, szType) + KVSM_PARAMETER("irc_context_id", KVS_PT_STRING, KVS_PF_OPTIONAL, szContext) KVSM_PARAMETERS_END(c) - KviKvsArray* pArray = new KviKvsArray(); + KviKvsArray * pArray = new KviKvsArray(); c->returnValue()->setArray(pArray); if(szType.isEmpty()) @@ -822,13 +836,13 @@ static bool window_kvs_fnc_list(KviKvsModuleFunctionCall * c) return true; } - int id=0; + int id = 0; - if(KviQString::equalCI(szContext,"all")) + if(KviQString::equalCI(szContext, "all")) { // all contexts but no "no_context" windows - bool bAllWindows = KviQString::equalCI(szType,"all"); - KviPointerHashTableIterator it(*g_pGlobalWindowDict); + bool bAllWindows = KviQString::equalCI(szType, "all"); + KviPointerHashTableIterator it(*g_pGlobalWindowDict); while(KviWindow * wnd = it.current()) { @@ -838,8 +852,10 @@ static bool window_kvs_fnc_list(KviKvsModuleFunctionCall * c) { pArray->set(id, new KviKvsVariant(QString(wnd->id()))); id++; - } else { - if(szType.toLower()==wnd->typeString()) + } + else + { + if(szType.toLower() == wnd->typeString()) { pArray->set(id, new KviKvsVariant(QString(wnd->id()))); id++; @@ -848,11 +864,12 @@ static bool window_kvs_fnc_list(KviKvsModuleFunctionCall * c) } ++it; } - } else if(KviQString::equalCI(szContext,"any")) + } + else if(KviQString::equalCI(szContext, "any")) { // all contexts and also "no_context" windows - bool bAllWindows = KviQString::equalCI(szType.toLower(),"all"); - KviPointerHashTableIterator it(*g_pGlobalWindowDict); + bool bAllWindows = KviQString::equalCI(szType.toLower(), "all"); + KviPointerHashTableIterator it(*g_pGlobalWindowDict); while(KviWindow * wnd = it.current()) { @@ -860,8 +877,10 @@ static bool window_kvs_fnc_list(KviKvsModuleFunctionCall * c) { pArray->set(id, new KviKvsVariant(QString(wnd->id()))); id++; - } else { - if(szType.toLower()==wnd->typeString()) + } + else + { + if(szType.toLower() == wnd->typeString()) { pArray->set(id, new KviKvsVariant(QString(wnd->id()))); id++; @@ -869,11 +888,12 @@ static bool window_kvs_fnc_list(KviKvsModuleFunctionCall * c) } ++it; } - } else if(KviQString::equalCI(szContext,"none")) + } + else if(KviQString::equalCI(szContext, "none")) { // only "no_context" windows - bool bAllWindows = KviQString::equalCI(szType.toLower(),"all"); - KviPointerHashTableIterator it(*g_pGlobalWindowDict); + bool bAllWindows = KviQString::equalCI(szType.toLower(), "all"); + KviPointerHashTableIterator it(*g_pGlobalWindowDict); while(KviWindow * wnd = it.current()) { @@ -883,8 +903,10 @@ static bool window_kvs_fnc_list(KviKvsModuleFunctionCall * c) { pArray->set(id, new KviKvsVariant(QString(wnd->id()))); id++; - } else { - if(szType.toLower()==wnd->typeString()) + } + else + { + if(szType.toLower() == wnd->typeString()) { pArray->set(id, new KviKvsVariant(QString(wnd->id()))); id++; @@ -893,8 +915,9 @@ static bool window_kvs_fnc_list(KviKvsModuleFunctionCall * c) } ++it; } - - } else { + } + else + { // some specified context unsigned int uId = 0; @@ -905,10 +928,12 @@ static bool window_kvs_fnc_list(KviKvsModuleFunctionCall * c) uId = szContext.toUInt(&bOk); if(!bOk) { - c->warning(__tr2qs("Invalid IRC context ID '%Q'"),&szContext); + c->warning(__tr2qs("Invalid IRC context ID '%Q'"), &szContext); return true; } - } else { + } + else + { // current irc context if(!c->window()->console()) { @@ -917,8 +942,8 @@ static bool window_kvs_fnc_list(KviKvsModuleFunctionCall * c) uId = c->window()->context()->id(); } - bool bAllWindows = KviQString::equalCI(szType.toLower(),"all"); - KviPointerHashTableIterator it(*g_pGlobalWindowDict); + bool bAllWindows = KviQString::equalCI(szType.toLower(), "all"); + KviPointerHashTableIterator it(*g_pGlobalWindowDict); while(KviWindow * wnd = it.current()) { @@ -930,8 +955,10 @@ static bool window_kvs_fnc_list(KviKvsModuleFunctionCall * c) { pArray->set(id, new KviKvsVariant(QString(wnd->id()))); id++; - } else { - if(szType.toLower()==wnd->typeString()) + } + else + { + if(szType.toLower() == wnd->typeString()) { pArray->set(id, new KviKvsVariant(QString(wnd->id()))); id++; @@ -943,7 +970,6 @@ static bool window_kvs_fnc_list(KviKvsModuleFunctionCall * c) } } return true; - } /* @@ -996,17 +1022,18 @@ static bool window_kvs_fnc_open(KviKvsModuleFunctionCall * c) QString szIcon; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("flags",KVS_PT_STRING,KVS_PF_OPTIONAL,szFlags) - KVSM_PARAMETER("caption",KVS_PT_STRING,KVS_PF_OPTIONAL,szCaption) - KVSM_PARAMETER("irc_context",KVS_PT_UINT,KVS_PF_OPTIONAL,uCtx) - KVSM_PARAMETER("icon",KVS_PT_STRING,KVS_PF_OPTIONAL,szIcon) + KVSM_PARAMETER("flags", KVS_PT_STRING, KVS_PF_OPTIONAL, szFlags) + KVSM_PARAMETER("caption", KVS_PT_STRING, KVS_PF_OPTIONAL, szCaption) + KVSM_PARAMETER("irc_context", KVS_PT_UINT, KVS_PF_OPTIONAL, uCtx) + KVSM_PARAMETER("icon", KVS_PT_STRING, KVS_PF_OPTIONAL, szIcon) KVSM_PARAMETERS_END(c) - QPixmap *pPix=g_pIconManager->getImage(szIcon); - if(!pPix){ + QPixmap * pPix = g_pIconManager->getImage(szIcon); + if(!pPix) + { - c->warning(__tr2qs("The specified icon doesn't exist: switching to 'none'")); - szIcon.prepend("$icon("); - szIcon.append(")"); + c->warning(__tr2qs("The specified icon doesn't exist: switching to 'none'")); + szIcon.prepend("$icon("); + szIcon.append(")"); } int iFlags = 0; if(szFlags.contains('i')) @@ -1023,12 +1050,12 @@ static bool window_kvs_fnc_open(KviKvsModuleFunctionCall * c) } UserWindow * pWnd = new UserWindow( - szCaption.toUtf8().data(), - szIcon, - pConsole, - iFlags); + szCaption.toUtf8().data(), + szIcon, + pConsole, + iFlags); - g_pMainWindow->addWindow(pWnd,!szFlags.contains('m')); + g_pMainWindow->addWindow(pWnd, !szFlags.contains('m')); c->returnValue()->setInteger(QString(pWnd->id()).toUInt()); return true; @@ -1060,22 +1087,24 @@ static bool window_kvs_cmd_setWindowTitle(KviKvsModuleCommandCall * c) QString szPlain; KviWindow * pWnd; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("window_id",KVS_PT_STRING,0,szWnd) - KVSM_PARAMETER("plain_text_caption",KVS_PT_STRING,0,szPlain) + KVSM_PARAMETER("window_id", KVS_PT_STRING, 0, szWnd) + KVSM_PARAMETER("plain_text_caption", KVS_PT_STRING, 0, szPlain) KVSM_PARAMETERS_END(c) pWnd = g_pApp->findWindow(szWnd.toUtf8().data()); if(!pWnd) { - if(!c->hasSwitch('q',"quiet")) - c->warning(__tr2qs("The window with ID '%s' doesn't exist"),szWnd.toUtf8().data()); + if(!c->hasSwitch('q', "quiet")) + c->warning(__tr2qs("The window with ID '%s' doesn't exist"), szWnd.toUtf8().data()); return true; } if(pWnd->type() == KviWindow::UserWindow) { ((UserWindow *)pWnd)->setWindowTitleStrings(szPlain); - } else { + } + else + { //store the window title (needed for functions that search windows by their captions) ((KviWindow *)pWnd)->setFixedCaption(szPlain); ((KviWindow *)pWnd)->setWindowTitle(szPlain); @@ -1108,26 +1137,25 @@ static bool window_kvs_cmd_setInputText(KviKvsModuleCommandCall * c) QString szText; KviWindow * pWnd; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("window_id",KVS_PT_STRING,0,szWnd) - KVSM_PARAMETER("text",KVS_PT_STRING,0, szText) + KVSM_PARAMETER("window_id", KVS_PT_STRING, 0, szWnd) + KVSM_PARAMETER("text", KVS_PT_STRING, 0, szText) KVSM_PARAMETERS_END(c) pWnd = g_pApp->findWindow(szWnd.toUtf8().data()); if(!pWnd) { - if(!c->hasSwitch('q',"quiet")) - c->warning(__tr2qs("The window with ID '%s' doesn't exist"),szWnd.toUtf8().data()); + if(!c->hasSwitch('q', "quiet")) + c->warning(__tr2qs("The window with ID '%s' doesn't exist"), szWnd.toUtf8().data()); return true; } if(pWnd->input()) pWnd->input()->setText(szText); - else - if(!c->hasSwitch('q',"quiet")) c->warning(__tr2qs("Window doesn't have input widget")); + else if(!c->hasSwitch('q', "quiet")) + c->warning(__tr2qs("Window doesn't have input widget")); return true; } - /* @doc: window.insertInInputText @type: @@ -1153,21 +1181,21 @@ static bool window_kvs_cmd_insertInInputText(KviKvsModuleCommandCall * c) QString szText; KviWindow * pWnd; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("window_id",KVS_PT_STRING,0,szWnd) - KVSM_PARAMETER("text",KVS_PT_STRING,0, szText) + KVSM_PARAMETER("window_id", KVS_PT_STRING, 0, szWnd) + KVSM_PARAMETER("text", KVS_PT_STRING, 0, szText) KVSM_PARAMETERS_END(c) pWnd = g_pApp->findWindow(szWnd.toUtf8().data()); if(!pWnd) { - if(!c->hasSwitch('q',"quiet")) - c->warning(__tr2qs("The window with ID '%s' doesn't exist"),szWnd.toUtf8().data()); + if(!c->hasSwitch('q', "quiet")) + c->warning(__tr2qs("The window with ID '%s' doesn't exist"), szWnd.toUtf8().data()); return true; } if(pWnd->input()) pWnd->input()->insertText(szText); - else - if(!c->hasSwitch('q',"quiet")) c->warning(__tr2qs("Window doesn't have input widget")); + else if(!c->hasSwitch('q', "quiet")) + c->warning(__tr2qs("Window doesn't have input widget")); return true; } @@ -1226,15 +1254,15 @@ static bool window_kvs_cmd_setBackground(KviKvsModuleCommandCall * c) QString szBackground; KviWindow * pWnd; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("window_id",KVS_PT_STRING,0,szWnd) - KVSM_PARAMETER("plain_text_caption",KVS_PT_STRING,0, szBackground) + KVSM_PARAMETER("window_id", KVS_PT_STRING, 0, szWnd) + KVSM_PARAMETER("plain_text_caption", KVS_PT_STRING, 0, szBackground) KVSM_PARAMETERS_END(c) pWnd = g_pApp->findWindow(szWnd.toUtf8().data()); if(!pWnd) { - if(!c->hasSwitch('q',"quiet")) - c->warning(__tr2qs("The window with ID '%s' doesn't exist"),szWnd.toUtf8().data()); + if(!c->hasSwitch('q', "quiet")) + c->warning(__tr2qs("The window with ID '%s' doesn't exist"), szWnd.toUtf8().data()); return true; } @@ -1268,8 +1296,6 @@ static bool window_kvs_cmd_setBackground(KviKvsModuleCommandCall * c) return true; } - - /* @doc: window.savePropertiesAsDefault @type: @@ -1297,19 +1323,21 @@ static bool window_kvs_cmd_savePropertiesAsDefault(KviKvsModuleCommandCall * c) } #ifdef COMPILE_CRYPT_SUPPORT -static bool initializeCryptEngine(KviCryptEngine * eng,KviCString &szEncryptKey,KviCString &szDecryptKey,QString &szError) +static bool initializeCryptEngine(KviCryptEngine * eng, KviCString & szEncryptKey, KviCString & szDecryptKey, QString & szError) { char * encKey = 0; int encKeyLen = 0; char * tmpKey; - encKeyLen = szEncryptKey.hexToBuffer(&tmpKey,false); + encKeyLen = szEncryptKey.hexToBuffer(&tmpKey, false); if(encKeyLen > 0) { encKey = (char *)KviMemory::allocate(encKeyLen); - KviMemory::move(encKey,tmpKey,encKeyLen); + KviMemory::move(encKey, tmpKey, encKeyLen); KviCString::freeBuffer(tmpKey); - } else { + } + else + { szError = __tr2qs("The encryption key wasn't a valid hexadecimal string"); return false; } @@ -1317,21 +1345,25 @@ static bool initializeCryptEngine(KviCryptEngine * eng,KviCString &szEncryptKey, char * decKey = 0; int decKeyLen = 0; - decKeyLen = szDecryptKey.hexToBuffer(&tmpKey,false); + decKeyLen = szDecryptKey.hexToBuffer(&tmpKey, false); if(decKeyLen > 0) { decKey = (char *)KviMemory::allocate(decKeyLen); - KviMemory::move(decKey,tmpKey,decKeyLen); + KviMemory::move(decKey, tmpKey, decKeyLen); KviCString::freeBuffer(tmpKey); - } else { + } + else + { szError = __tr2qs("The decryption key wasn't a valid hexadecimal string"); return false; } - bool bRet = eng->init(encKey,encKeyLen,decKey,decKeyLen); + bool bRet = eng->init(encKey, encKeyLen, decKey, decKeyLen); if(!bRet) szError = eng->lastError(); - if(encKey)KviMemory::free(encKey); - if(decKey)KviMemory::free(decKey); + if(encKey) + KviMemory::free(encKey); + if(decKey) + KviMemory::free(decKey); return bRet; } #endif @@ -1382,33 +1414,36 @@ static bool window_kvs_cmd_setCryptEngine(KviKvsModuleCommandCall * c) QString szDecryptKey; KVSM_PARAMETERS_BEGIN(c) - KVSM_PARAMETER("window_id",KVS_PT_STRING,0,szWnd) - KVSM_PARAMETER("enginename",KVS_PT_STRING,KVS_PF_OPTIONAL,szEngine) - KVSM_PARAMETER("hex_encrypt_key",KVS_PT_STRING,KVS_PF_OPTIONAL,szEncryptKey) - KVSM_PARAMETER("hex_decrypt_key",KVS_PT_STRING,KVS_PF_OPTIONAL,szDecryptKey) + KVSM_PARAMETER("window_id", KVS_PT_STRING, 0, szWnd) + KVSM_PARAMETER("enginename", KVS_PT_STRING, KVS_PF_OPTIONAL, szEngine) + KVSM_PARAMETER("hex_encrypt_key", KVS_PT_STRING, KVS_PF_OPTIONAL, szEncryptKey) + KVSM_PARAMETER("hex_decrypt_key", KVS_PT_STRING, KVS_PF_OPTIONAL, szDecryptKey) KVSM_PARAMETERS_END(c) - if(szDecryptKey.isEmpty())szDecryptKey = szEncryptKey; + if(szDecryptKey.isEmpty()) + szDecryptKey = szEncryptKey; #ifdef COMPILE_CRYPT_SUPPORT KviWindow * pWnd = g_pApp->findWindow(szWnd.toUtf8().data()); if(!pWnd) { - if(!c->hasSwitch('q',"quiet")) - c->warning(__tr2qs("The window with ID '%s' doesn't exist"),szWnd.toUtf8().data()); + if(!c->hasSwitch('q', "quiet")) + c->warning(__tr2qs("The window with ID '%s' doesn't exist"), szWnd.toUtf8().data()); return true; } - if(c->hasSwitch('n',"onlydecrypt") && c->hasSwitch('m',"onlyencrypt")) + if(c->hasSwitch('n', "onlydecrypt") && c->hasSwitch('m', "onlyencrypt")) { - if(!c->hasSwitch('q',"quiet")) + if(!c->hasSwitch('q', "quiet")) c->warning(__tr2qs("Both -n and -m switches specified, -n takes precedence")); } if(szEngine.isEmpty()) { pWnd->setCryptSessionInfo(0); - } else { + } + else + { if(szEncryptKey.isEmpty() || szDecryptKey.isEmpty()) { - if(!c->hasSwitch('q',"quiet")) + if(!c->hasSwitch('q', "quiet")) c->warning(__tr2qs("No encryption key specified: can't allocate engine")); return true; } @@ -1421,28 +1456,33 @@ static bool window_kvs_cmd_setCryptEngine(KviKvsModuleCommandCall * c) KviCString enc = KviCString(szEncryptKey.toUtf8().data()); KviCString dec = KviCString(szDecryptKey.toUtf8().data()); QString szError; - if(initializeCryptEngine(e,enc,dec,szError)) + if(initializeCryptEngine(e, enc, dec, szError)) { KviCryptSessionInfo * inf = KviCryptController::allocateCryptSessionInfo(); inf->m_pEngine = e; inf->m_szEngineName = szEngine; - inf->m_bDoEncrypt = (!c->hasSwitch('n',"onlydecrypt")); - inf->m_bDoDecrypt = (!c->hasSwitch('m',"onlyencrypt")) || c->hasSwitch('n',"onlydecrypt"); + inf->m_bDoEncrypt = (!c->hasSwitch('n', "onlydecrypt")); + inf->m_bDoDecrypt = (!c->hasSwitch('m', "onlyencrypt")) || c->hasSwitch('n', "onlydecrypt"); pWnd->setCryptSessionInfo(inf); - } else { - if(szError.isEmpty())szError = __tr2qs("Unknown engine error"); + } + else + { + if(szError.isEmpty()) + szError = __tr2qs("Unknown engine error"); g_pCryptEngineManager->deallocateEngine(e); - if(!c->hasSwitch('q',"quiet")) - c->warning(__tr2qs("Failed to initialize the specified encryption engine: %Q"),&szError); + if(!c->hasSwitch('q', "quiet")) + c->warning(__tr2qs("Failed to initialize the specified encryption engine: %Q"), &szError); } - } else { - if(!c->hasSwitch('q',"quiet")) - c->warning(__tr2qs("The encryption engine \"%Q\" doesn't exist"),&szEngine); + } + else + { + if(!c->hasSwitch('q', "quiet")) + c->warning(__tr2qs("The encryption engine \"%Q\" doesn't exist"), &szEngine); } } #else - if(!c->hasSwitch('q',"quiet")) + if(!c->hasSwitch('q', "quiet")) c->warning(__tr2qs("This executable has been compiled without crypt support")); #endif return true; @@ -1473,8 +1513,8 @@ static bool window_kvs_fnc_cryptEngine(KviKvsModuleFunctionCall * c) #ifdef COMPILE_CRYPT_SUPPORT if(KviCryptSessionInfo * pCryptSessionInfo = pWnd->cryptSessionInfo()) c->returnValue()->setString(pCryptSessionInfo->m_szEngineName); -#else //!COMPILE_CRYPT_SUPPORT - // do nothing +#else //!COMPILE_CRYPT_SUPPORT +// do nothing #endif //!COMPILE_CRYPT_SUPPORT } return true; @@ -1491,50 +1531,50 @@ static bool window_kvs_cmd_fake(KviKvsModuleCommandCall * c) return true; } -static bool window_module_init(KviModule *m) +static bool window_module_init(KviModule * m) { g_pUserWindowList = new KviPointerList(); g_pUserWindowList->setAutoDelete(false); - KVSM_REGISTER_FUNCTION(m,"activityTemperature",window_kvs_fnc_activityTemperature); - KVSM_REGISTER_FUNCTION(m,"activityLevel",window_kvs_fnc_activityLevel); - KVSM_REGISTER_FUNCTION(m,"highlightLevel",window_kvs_fnc_highlightLevel); - KVSM_REGISTER_FUNCTION(m,"console",window_kvs_fnc_console); - KVSM_REGISTER_FUNCTION(m,"hasUserFocus",window_kvs_fnc_hasUserFocus); - KVSM_REGISTER_FUNCTION(m,"hasOutput",window_kvs_fnc_hasOutput); - KVSM_REGISTER_FUNCTION(m,"isDocked",window_kvs_fnc_isDocked); - KVSM_REGISTER_FUNCTION(m,"isMinimized",window_kvs_fnc_fake); // compat only - KVSM_REGISTER_FUNCTION(m,"isMaximized",window_kvs_fnc_fake); // compat only - KVSM_REGISTER_FUNCTION(m,"caption",window_kvs_fnc_caption); - KVSM_REGISTER_FUNCTION(m,"type",window_kvs_fnc_type); - KVSM_REGISTER_FUNCTION(m,"exists",window_kvs_fnc_exists); - KVSM_REGISTER_FUNCTION(m,"hasInput",window_kvs_fnc_hasInput); - KVSM_REGISTER_FUNCTION(m,"list",window_kvs_fnc_list); - KVSM_REGISTER_FUNCTION(m,"open",window_kvs_fnc_open); - KVSM_REGISTER_FUNCTION(m,"inputText",window_kvs_fnc_inputText); - KVSM_REGISTER_FUNCTION(m,"context",window_kvs_fnc_context); - KVSM_REGISTER_FUNCTION(m,"cryptEngine",window_kvs_fnc_cryptEngine); - - KVSM_REGISTER_SIMPLE_COMMAND(m,"highlight",window_kvs_cmd_highlight); - KVSM_REGISTER_SIMPLE_COMMAND(m,"close",window_kvs_cmd_close); - KVSM_REGISTER_SIMPLE_COMMAND(m,"clearOutput",window_kvs_cmd_clearOutput); - KVSM_REGISTER_SIMPLE_COMMAND(m,"dock",window_kvs_cmd_dock); - KVSM_REGISTER_SIMPLE_COMMAND(m,"undock",window_kvs_cmd_undock); - KVSM_REGISTER_SIMPLE_COMMAND(m,"minimize",window_kvs_cmd_fake); - KVSM_REGISTER_SIMPLE_COMMAND(m,"maximize",window_kvs_cmd_fake); - KVSM_REGISTER_SIMPLE_COMMAND(m,"restore",window_kvs_cmd_fake); - KVSM_REGISTER_SIMPLE_COMMAND(m,"activate",window_kvs_cmd_activate); - KVSM_REGISTER_SIMPLE_COMMAND(m,"demandAttention",window_kvs_cmd_demandAttention); - KVSM_REGISTER_SIMPLE_COMMAND(m,"listtypes",window_kvs_cmd_listtypes); - KVSM_REGISTER_SIMPLE_COMMAND(m,"setBackground",window_kvs_cmd_setBackground); - KVSM_REGISTER_SIMPLE_COMMAND(m,"setWindowTitle",window_kvs_cmd_setWindowTitle); - KVSM_REGISTER_SIMPLE_COMMAND(m,"setCryptEngine",window_kvs_cmd_setCryptEngine); - KVSM_REGISTER_SIMPLE_COMMAND(m,"setInputText",window_kvs_cmd_setInputText); - KVSM_REGISTER_SIMPLE_COMMAND(m,"insertInInputText",window_kvs_cmd_insertInInputText); - KVSM_REGISTER_SIMPLE_COMMAND(m,"savePropertiesAsDefault",window_kvs_cmd_savePropertiesAsDefault); + KVSM_REGISTER_FUNCTION(m, "activityTemperature", window_kvs_fnc_activityTemperature); + KVSM_REGISTER_FUNCTION(m, "activityLevel", window_kvs_fnc_activityLevel); + KVSM_REGISTER_FUNCTION(m, "highlightLevel", window_kvs_fnc_highlightLevel); + KVSM_REGISTER_FUNCTION(m, "console", window_kvs_fnc_console); + KVSM_REGISTER_FUNCTION(m, "hasUserFocus", window_kvs_fnc_hasUserFocus); + KVSM_REGISTER_FUNCTION(m, "hasOutput", window_kvs_fnc_hasOutput); + KVSM_REGISTER_FUNCTION(m, "isDocked", window_kvs_fnc_isDocked); + KVSM_REGISTER_FUNCTION(m, "isMinimized", window_kvs_fnc_fake); // compat only + KVSM_REGISTER_FUNCTION(m, "isMaximized", window_kvs_fnc_fake); // compat only + KVSM_REGISTER_FUNCTION(m, "caption", window_kvs_fnc_caption); + KVSM_REGISTER_FUNCTION(m, "type", window_kvs_fnc_type); + KVSM_REGISTER_FUNCTION(m, "exists", window_kvs_fnc_exists); + KVSM_REGISTER_FUNCTION(m, "hasInput", window_kvs_fnc_hasInput); + KVSM_REGISTER_FUNCTION(m, "list", window_kvs_fnc_list); + KVSM_REGISTER_FUNCTION(m, "open", window_kvs_fnc_open); + KVSM_REGISTER_FUNCTION(m, "inputText", window_kvs_fnc_inputText); + KVSM_REGISTER_FUNCTION(m, "context", window_kvs_fnc_context); + KVSM_REGISTER_FUNCTION(m, "cryptEngine", window_kvs_fnc_cryptEngine); + + KVSM_REGISTER_SIMPLE_COMMAND(m, "highlight", window_kvs_cmd_highlight); + KVSM_REGISTER_SIMPLE_COMMAND(m, "close", window_kvs_cmd_close); + KVSM_REGISTER_SIMPLE_COMMAND(m, "clearOutput", window_kvs_cmd_clearOutput); + KVSM_REGISTER_SIMPLE_COMMAND(m, "dock", window_kvs_cmd_dock); + KVSM_REGISTER_SIMPLE_COMMAND(m, "undock", window_kvs_cmd_undock); + KVSM_REGISTER_SIMPLE_COMMAND(m, "minimize", window_kvs_cmd_fake); + KVSM_REGISTER_SIMPLE_COMMAND(m, "maximize", window_kvs_cmd_fake); + KVSM_REGISTER_SIMPLE_COMMAND(m, "restore", window_kvs_cmd_fake); + KVSM_REGISTER_SIMPLE_COMMAND(m, "activate", window_kvs_cmd_activate); + KVSM_REGISTER_SIMPLE_COMMAND(m, "demandAttention", window_kvs_cmd_demandAttention); + KVSM_REGISTER_SIMPLE_COMMAND(m, "listtypes", window_kvs_cmd_listtypes); + KVSM_REGISTER_SIMPLE_COMMAND(m, "setBackground", window_kvs_cmd_setBackground); + KVSM_REGISTER_SIMPLE_COMMAND(m, "setWindowTitle", window_kvs_cmd_setWindowTitle); + KVSM_REGISTER_SIMPLE_COMMAND(m, "setCryptEngine", window_kvs_cmd_setCryptEngine); + KVSM_REGISTER_SIMPLE_COMMAND(m, "setInputText", window_kvs_cmd_setInputText); + KVSM_REGISTER_SIMPLE_COMMAND(m, "insertInInputText", window_kvs_cmd_insertInInputText); + KVSM_REGISTER_SIMPLE_COMMAND(m, "savePropertiesAsDefault", window_kvs_cmd_savePropertiesAsDefault); // saveOutput (view()->saveBuffer()) -/* + /* m->registerFunction("geometry",window_module_fnc_geometry); m->registerCommand("setGeometry",window_module_cmd_setGeometry); @@ -1572,13 +1612,12 @@ static bool window_module_can_unload(KviModule *) } KVIRC_MODULE( - "Window", // module name - "4.0.0", // module version - "Copyright (C) 2001-2004 Szymon Stefanek (pragma at kvirc dot net)", // author & (C) - "KVIrc window management functions", - window_module_init, - window_module_can_unload, - 0, - window_module_cleanup, - 0 -) + "Window", // module name + "4.0.0", // module version + "Copyright (C) 2001-2004 Szymon Stefanek (pragma at kvirc dot net)", // author & (C) + "KVIrc window management functions", + window_module_init, + window_module_can_unload, + 0, + window_module_cleanup, + 0) -- cgit v1.3.1-10-gc9f91