From 2539e40403ae6bdf8a3551c209edf639b2dce44d Mon Sep 17 00:00:00 2001 From: dnk-88 Date: Sat, 15 Jan 2011 14:45:35 +0200 Subject: [PATCH] Changed: #1206 Update plugin system. Added experimental core plugin. Added new settings dialog. --- .../3d/object_viewer_qt/src/CMakeLists.txt | 6 +- .../src/extension_system/iplugin.h | 7 +- .../src/extension_system/iplugin_manager.h | 7 +- .../src/extension_system/iplugin_spec.h | 4 +- .../src/extension_system/plugin_manager.cpp | 2 +- .../src/extension_system/plugin_manager.h | 2 +- .../src/extension_system/plugin_spec.cpp | 2 +- .../src/extension_system/plugin_spec.h | 2 +- .../src/extension_system/plugin_view.h | 59 ----- .../src/extension_system/plugn_view.cpp | 75 ------- .../3d/object_viewer_qt/src/images/.directory | 3 - .../tools/3d/object_viewer_qt/src/main.cpp | 19 +- .../3d/object_viewer_qt/src/main_window.cpp | 11 +- .../3d/object_viewer_qt/src/main_window.h | 5 - .../tools/3d/object_viewer_qt/src/modules.cpp | 4 +- .../tools/3d/object_viewer_qt/src/modules.h | 4 +- .../3d/object_viewer_qt/src/object_viewer.cpp | 18 ++ .../src/plugins/CMakeLists.txt | 3 +- .../src/plugins/core/CMakeLists.txt | 54 +++++ .../src/plugins/core/core.qrc | 6 + .../src/plugins/core/core_constants.h | 132 ++++------- .../src/plugins/core/core_plugin.cpp | 136 ++++++++++++ .../src/plugins/core/core_plugin.h | 76 +++++++ .../src/plugins/core/images/nel.png | Bin 0 -> 15587 bytes .../src/plugins/core/images/preferences.png | Bin 0 -> 10286 bytes .../src/plugins/core/ioptions_page.h | 66 ++++++ .../src/plugins/core/main_window.cpp | 173 +++++++++++++++ .../src/plugins/core/main_window.h | 91 ++++++++ .../src/plugins/core/plugin_view_dialog.cpp | 73 ++++++ .../src/plugins/core/plugin_view_dialog.h | 47 ++++ .../core/plugin_view_dialog.ui} | 19 +- .../src/plugins/core/qnel_widget.cpp | 208 ++++++++++++++++++ .../src/plugins/core/qnel_widget.h | 97 ++++++++ .../core/search_paths_settings_page.cpp | 67 ++++++ .../plugins/core/search_paths_settings_page.h | 58 +++++ .../core/search_paths_settings_page.ui | 108 +++++++++ .../src/plugins/core/settings_dialog.cpp | 188 ++++++++++++++++ .../src/plugins/core/settings_dialog.h | 75 +++++++ .../src/plugins/core/settings_dialog.ui | 126 +++++++++++ .../src/plugins/example/plugin1.cpp | 10 +- .../src/plugins/example/plugin1.h | 14 +- .../src/plugins/log/log_plugin.cpp | 6 +- .../src/plugins/log/log_plugin.h | 16 +- .../ovqt_sheet_builder/ovqt_sheet_builder.cpp | 11 +- .../ovqt_sheet_builder/ovqt_sheet_builder.h | 14 +- 45 files changed, 1808 insertions(+), 296 deletions(-) delete mode 100644 code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_view.h delete mode 100644 code/nel/tools/3d/object_viewer_qt/src/extension_system/plugn_view.cpp delete mode 100644 code/nel/tools/3d/object_viewer_qt/src/images/.directory create mode 100644 code/nel/tools/3d/object_viewer_qt/src/plugins/core/CMakeLists.txt create mode 100644 code/nel/tools/3d/object_viewer_qt/src/plugins/core/core.qrc create mode 100644 code/nel/tools/3d/object_viewer_qt/src/plugins/core/core_plugin.cpp create mode 100644 code/nel/tools/3d/object_viewer_qt/src/plugins/core/core_plugin.h create mode 100644 code/nel/tools/3d/object_viewer_qt/src/plugins/core/images/nel.png create mode 100644 code/nel/tools/3d/object_viewer_qt/src/plugins/core/images/preferences.png create mode 100644 code/nel/tools/3d/object_viewer_qt/src/plugins/core/ioptions_page.h create mode 100644 code/nel/tools/3d/object_viewer_qt/src/plugins/core/main_window.cpp create mode 100644 code/nel/tools/3d/object_viewer_qt/src/plugins/core/main_window.h create mode 100644 code/nel/tools/3d/object_viewer_qt/src/plugins/core/plugin_view_dialog.cpp create mode 100644 code/nel/tools/3d/object_viewer_qt/src/plugins/core/plugin_view_dialog.h rename code/nel/tools/3d/object_viewer_qt/src/{extension_system/plugin_view.ui => plugins/core/plugin_view_dialog.ui} (88%) create mode 100644 code/nel/tools/3d/object_viewer_qt/src/plugins/core/qnel_widget.cpp create mode 100644 code/nel/tools/3d/object_viewer_qt/src/plugins/core/qnel_widget.h create mode 100644 code/nel/tools/3d/object_viewer_qt/src/plugins/core/search_paths_settings_page.cpp create mode 100644 code/nel/tools/3d/object_viewer_qt/src/plugins/core/search_paths_settings_page.h create mode 100644 code/nel/tools/3d/object_viewer_qt/src/plugins/core/search_paths_settings_page.ui create mode 100644 code/nel/tools/3d/object_viewer_qt/src/plugins/core/settings_dialog.cpp create mode 100644 code/nel/tools/3d/object_viewer_qt/src/plugins/core/settings_dialog.h create mode 100644 code/nel/tools/3d/object_viewer_qt/src/plugins/core/settings_dialog.ui diff --git a/code/nel/tools/3d/object_viewer_qt/src/CMakeLists.txt b/code/nel/tools/3d/object_viewer_qt/src/CMakeLists.txt index 9bca4cc8e..44c0b21bc 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/CMakeLists.txt +++ b/code/nel/tools/3d/object_viewer_qt/src/CMakeLists.txt @@ -22,8 +22,7 @@ SET(OBJECT_VIEWER_HDR main_window.h graphics_viewport.h animation_dialog.h vegetable_dialog.h global_wind_dialog.h day_night_dialog.h sun_color_dialog.h vegetable_noise_value_widget.h vegetable_density_page.h vegetable_landscape_page.h vegetable_scale_page.h vegetable_appearance_page.h vegetable_rotate_page.h - extension_system/iplugin_manager.h extension_system/plugin_manager.h - extension_system/plugin_view.h) + extension_system/iplugin_manager.h extension_system/plugin_manager.h) SET(OBJECT_VIEWER_UIS animation_form.ui animation_set_form.ui settings_form.ui setup_fog_form.ui slot_form.ui particle_control_form.ui particle_workspace_form.ui @@ -36,8 +35,7 @@ SET(OBJECT_VIEWER_UIS animation_form.ui animation_set_form.ui settings_form.ui particle_link_skeleton_form.ui water_pool_form.ui vegetable_dialog_form.ui vegetable_noise_value_form.ui global_wind_form.ui sun_color_form.ui day_night_form.ui vegetable_density_form.ui vegetable_apperance_form.ui vegetable_landscape_form.ui - vegetable_rotate_form.ui vegetable_scale_form.ui - extension_system/plugin_view.ui) + vegetable_rotate_form.ui vegetable_scale_form.ui) SET(OBJECT_VIEWER_RCS object_viewer_qt.qrc) diff --git a/code/nel/tools/3d/object_viewer_qt/src/extension_system/iplugin.h b/code/nel/tools/3d/object_viewer_qt/src/extension_system/iplugin.h index 8e7bb60f7..3d7e24028 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/extension_system/iplugin.h +++ b/code/nel/tools/3d/object_viewer_qt/src/extension_system/iplugin.h @@ -30,7 +30,7 @@ namespace NLMISC class INelContext; } -namespace NLQT +namespace ExtensionSystem { /** @@ -56,10 +56,11 @@ public: virtual QString version() const = 0; virtual QString vendor() const = 0; virtual QString description() const = 0; + virtual QList dependencies() const = 0; }; -}; //namespace NLQT +}; //namespace ExtensionSystem -Q_DECLARE_INTERFACE(NLQT::IPlugin, "com.ryzom.dev.ObjectViewerQt.IPlugin/0.9") +Q_DECLARE_INTERFACE(ExtensionSystem::IPlugin, "dev.ryzom.com.ObjectViewerQt.IPlugin/0.9.1") #endif // IPLUGIN_H diff --git a/code/nel/tools/3d/object_viewer_qt/src/extension_system/iplugin_manager.h b/code/nel/tools/3d/object_viewer_qt/src/extension_system/iplugin_manager.h index e9485dbea..f5537fc32 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/extension_system/iplugin_manager.h +++ b/code/nel/tools/3d/object_viewer_qt/src/extension_system/iplugin_manager.h @@ -24,11 +24,10 @@ #include #include -namespace NLQT +namespace ExtensionSystem { class IPluginSpec; - /** @interface IPluginManager @brief Interface for plugin system that manages the plugins, their life cycle and their registered objects. @@ -52,7 +51,7 @@ public: virtual void loadPlugins() = 0; virtual QStringList getPluginPaths() const = 0; virtual void setPluginPaths(const QStringList &paths) = 0; - virtual QList plugins() const = 0; + virtual QList plugins() const = 0; Q_SIGNALS: void objectAdded(QObject *obj); @@ -61,6 +60,6 @@ Q_SIGNALS: void pluginsChanged(); }; -}; // namespace NLQT +}; // namespace ExtensionSystem #endif // IPLUGINMANAGER_H diff --git a/code/nel/tools/3d/object_viewer_qt/src/extension_system/iplugin_spec.h b/code/nel/tools/3d/object_viewer_qt/src/extension_system/iplugin_spec.h index 617c240c3..a27b76cd0 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/extension_system/iplugin_spec.h +++ b/code/nel/tools/3d/object_viewer_qt/src/extension_system/iplugin_spec.h @@ -22,7 +22,7 @@ #include -namespace NLQT +namespace ExtensionSystem { class IPlugin; class IPluginManager; @@ -76,7 +76,7 @@ public: virtual QString errorString() const = 0; }; -} // namespace NLQT +} // namespace ExtensionSystem #endif // IPLUGINSPEC_H diff --git a/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_manager.cpp b/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_manager.cpp index b2cef4a8b..d400cc6aa 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_manager.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_manager.cpp @@ -25,7 +25,7 @@ #include "plugin_spec.h" -namespace NLQT +namespace ExtensionSystem { CPluginManager::CPluginManager(QObject *parent): diff --git a/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_manager.h b/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_manager.h index 774817e60..39e1044c0 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_manager.h +++ b/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_manager.h @@ -26,7 +26,7 @@ // Project include #include "iplugin_manager.h" -namespace NLQT +namespace ExtensionSystem { class IPlugin; diff --git a/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_spec.cpp b/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_spec.cpp index 85f1ad4fd..c65d4f6f3 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_spec.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_spec.cpp @@ -30,7 +30,7 @@ #include "iplugin.h" #include "iplugin_manager.h" -namespace NLQT +namespace ExtensionSystem { CPluginSpec::CPluginSpec(): diff --git a/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_spec.h b/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_spec.h index 156b93898..aadf6be1e 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_spec.h +++ b/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_spec.h @@ -22,7 +22,7 @@ #include "iplugin_spec.h" -namespace NLQT +namespace ExtensionSystem { class CPluginSpec: public IPluginSpec diff --git a/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_view.h b/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_view.h deleted file mode 100644 index 91c81b39e..000000000 --- a/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_view.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - Object Viewer Qt - Copyright (C) 2010 Dzmitry Kamiahin - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - -*/ - -#ifndef PLUGIN_VIEW_H -#define PLUGIN_VIEW_H - -#include "ui_plugin_view.h" - - -// STL includes - -// Qt includes - -// NeL includes - -// Project includes - - -namespace NLQT -{ - -class IPluginManager; - -class CPluginView: public QDialog -{ - Q_OBJECT - -public: - CPluginView(IPluginManager *pluginManager, QWidget *parent = 0); - ~CPluginView(); - -private Q_SLOTS: - void updateList(); - -private: - - IPluginManager *_pluginManager; - Ui::CPluginView _ui; -}; /* class CPluginView */ - -} /* namespace NLQT */ - -#endif // PLUGIN_VIEW_H diff --git a/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugn_view.cpp b/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugn_view.cpp deleted file mode 100644 index 7aa610dcb..000000000 --- a/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugn_view.cpp +++ /dev/null @@ -1,75 +0,0 @@ -/* - Object Viewer Qt - Copyright (C) 2010 Dzmitry Kamiahin - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - -*/ - -#include "plugin_view.h" - -// Qt includes -#include -#include -#include -#include -#include -#include - -// Project includes -#include "iplugin_spec.h" -#include "iplugin_manager.h" - -namespace NLQT -{ - -CPluginView::CPluginView(IPluginManager *pluginManager, QWidget *parent) - : QDialog(parent) -{ - _ui.setupUi(this); - _pluginManager = pluginManager; - - connect(_pluginManager, SIGNAL(pluginsChanged()), this, SLOT(updateList())); - - updateList(); -} - -CPluginView::~CPluginView() -{ -} - -void CPluginView::updateList() -{ - static QIcon okIcon = QApplication::style()->standardIcon(QStyle::SP_DialogApplyButton); - static QIcon errorIcon = QApplication::style()->standardIcon(QStyle::SP_DialogCancelButton); - - QList items; - Q_FOREACH (IPluginSpec *spec, _pluginManager->plugins()) - { - QTreeWidgetItem *item = new QTreeWidgetItem(QStringList() - << "" - << spec->name() - << QString("%1").arg(spec->version()) - << spec->vendor() - << QDir::toNativeSeparators(spec->filePath())); - item->setIcon(0, spec->hasError() ? errorIcon : okIcon); - items.append(item); - } - - _ui.pluginTreeWidget->clear(); - if (!items.isEmpty()) - _ui.pluginTreeWidget->addTopLevelItems(items); -} - -} /* namespace NLQT */ \ No newline at end of file diff --git a/code/nel/tools/3d/object_viewer_qt/src/images/.directory b/code/nel/tools/3d/object_viewer_qt/src/images/.directory deleted file mode 100644 index 8bcdbc317..000000000 --- a/code/nel/tools/3d/object_viewer_qt/src/images/.directory +++ /dev/null @@ -1,3 +0,0 @@ -[Dolphin] -ShowPreview=true -Timestamp=2010,8,4,0,59,20 diff --git a/code/nel/tools/3d/object_viewer_qt/src/main.cpp b/code/nel/tools/3d/object_viewer_qt/src/main.cpp index 1f972e0d4..e0671f478 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/main.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/main.cpp @@ -1,3 +1,20 @@ +// Object Viewer Qt - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// Copyright (C) 2010 Dzmitry Kamiahin +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + #include "stdpch.h" #include #include @@ -119,7 +136,7 @@ sint main(int argc, char **argv) Modules::plugMan().loadPlugins(); QStringList errors; - Q_FOREACH (NLQT::IPluginSpec *spec, Modules::plugMan().plugins()) + Q_FOREACH (ExtensionSystem::IPluginSpec *spec, Modules::plugMan().plugins()) if (spec->hasError()) errors.append(spec->fileName() + " : " + spec->errorString()); diff --git a/code/nel/tools/3d/object_viewer_qt/src/main_window.cpp b/code/nel/tools/3d/object_viewer_qt/src/main_window.cpp index 4bf9000d5..615d7026b 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/main_window.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/main_window.cpp @@ -46,8 +46,6 @@ #include "day_night_dialog.h" #include "sun_color_dialog.h" -#include "extension_system/plugin_view.h" - using namespace std; using namespace NLMISC; @@ -138,7 +136,6 @@ CMainWindow::~CMainWindow() delete _ParticleControlDialog; delete _ParticleWorkspaceDialog; delete _GraphicsViewport; - delete _PluginView; } void CMainWindow::setVisible(bool visible) @@ -349,10 +346,6 @@ void CMainWindow::createActions() _aboutQtAction = new QAction(tr("About &Qt"), this); _aboutQtAction->setStatusTip(tr("Show the Qt library's About box")); connect(_aboutQtAction, SIGNAL(triggered()), qApp, SLOT(aboutQt())); - - _pluginViewAction = new QAction(tr("About &Plugins"), this); - _pluginViewAction->setStatusTip(tr("Show the plugin view dialog")); - connect(_pluginViewAction, SIGNAL(triggered()), _PluginView, SLOT(show())); } void CMainWindow::createMenus() @@ -422,7 +415,6 @@ void CMainWindow::createMenus() _helpMenu->setObjectName("ovqt.Menu.Help"); _helpMenu->addAction(_aboutAction); _helpMenu->addAction(_aboutQtAction); - _helpMenu->addAction(_pluginViewAction); Modules::plugMan().addObject(_fileMenu); Modules::plugMan().addObject(_viewMenu); @@ -521,8 +513,6 @@ void CMainWindow::createDialogs() addDockWidget(Qt::RightDockWidgetArea, _SetupFog); _SetupFog->setVisible(false); - _PluginView = new CPluginView(&Modules::plugMan(), this); - connect(_ParticleControlDialog, SIGNAL(changeState()), _ParticleWorkspaceDialog, SLOT(setNewState())); connect(_ParticleWorkspaceDialog, SIGNAL(changeActiveNode()), _ParticleControlDialog, SLOT(updateActiveNode())); connect(_AnimationSetDialog->ui.setLengthPushButton, SIGNAL(clicked()), _AnimationDialog, SLOT(changeAnimLength())); @@ -629,6 +619,7 @@ void CMainWindow::updateRender() if (_isGraphicsInitialized && !Modules::objView().getDriver()->isLost()) { // 01. Render Driver (background color) + Modules::objView().getDriver()->activate(); Modules::objView().renderDriver(); // clear all buffers // 02. Render Sky (sky scene) diff --git a/code/nel/tools/3d/object_viewer_qt/src/main_window.h b/code/nel/tools/3d/object_viewer_qt/src/main_window.h index e14471940..a63a1bbad 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/main_window.h +++ b/code/nel/tools/3d/object_viewer_qt/src/main_window.h @@ -53,8 +53,6 @@ class CGlobalWindDialog; class CDayNightDialog; class CSunColorDialog; -class CPluginView; - class CMainWindow : public QMainWindow { Q_OBJECT @@ -115,8 +113,6 @@ private: CDayNightDialog *_DayNightDialog; CSunColorDialog *_SunColorDialog; - CPluginView *_PluginView; - CSkeletonTreeModel *_SkeletonTreeModel; QPalette _originalPalette; @@ -139,7 +135,6 @@ private: QAction *_resetSceneAction; QAction *_saveScreenshotAction; QAction *_settingsAction; - QAction *_pluginViewAction; QAction *_aboutAction; QAction *_aboutQtAction; };/* class CMainWindow */ diff --git a/code/nel/tools/3d/object_viewer_qt/src/modules.cpp b/code/nel/tools/3d/object_viewer_qt/src/modules.cpp index 204285d97..f2f4850c1 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/modules.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/modules.cpp @@ -26,14 +26,14 @@ NLQT::CMainWindow *Modules::_mainWindow = NULL; NLQT::CParticleEditor *Modules::_particleEditor = NULL; NLQT::CSoundSystem *Modules::_soundSystem = NULL; NLQT::CVegetableEditor *Modules::_vegetableEditor = NULL; -NLQT::CPluginManager *Modules::_pluginManager = NULL; +ExtensionSystem::CPluginManager *Modules::_pluginManager = NULL; void Modules::init() { if (_configuration == NULL) _configuration = new NLQT::CConfiguration; config().init(); - if (_pluginManager == NULL) _pluginManager = new NLQT::CPluginManager; + if (_pluginManager == NULL) _pluginManager = new ExtensionSystem::CPluginManager; if (_objectViewer == NULL) _objectViewer = new NLQT::CObjectViewer; if (_soundSystem == NULL) _soundSystem = new NLQT::CSoundSystem; if (_particleEditor == NULL) _particleEditor = new NLQT::CParticleEditor; diff --git a/code/nel/tools/3d/object_viewer_qt/src/modules.h b/code/nel/tools/3d/object_viewer_qt/src/modules.h index 02d8f01c5..441baf22e 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/modules.h +++ b/code/nel/tools/3d/object_viewer_qt/src/modules.h @@ -62,7 +62,7 @@ public: { return *_vegetableEditor; } - static NLQT::CPluginManager &plugMan() + static ExtensionSystem::CPluginManager &plugMan() { return *_pluginManager; } @@ -74,7 +74,7 @@ private: static NLQT::CParticleEditor *_particleEditor; static NLQT::CSoundSystem *_soundSystem; static NLQT::CVegetableEditor *_vegetableEditor; - static NLQT::CPluginManager *_pluginManager; + static ExtensionSystem::CPluginManager *_pluginManager; }; #endif // MODULES_H diff --git a/code/nel/tools/3d/object_viewer_qt/src/object_viewer.cpp b/code/nel/tools/3d/object_viewer_qt/src/object_viewer.cpp index 737e81379..ac8d56d5b 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/object_viewer.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/object_viewer.cpp @@ -174,6 +174,24 @@ void CObjectViewer::release() void CObjectViewer::updateInput() { _Driver->EventServer.pump(); + + // Test some keys + if (_Driver->AsyncListener.isKeyPushed(KeyQ)) + { + // Change render mode + switch (_Driver->getPolygonMode()) + { + case UDriver::Filled: + _Driver->setPolygonMode (UDriver::Line); + break; + case UDriver::Line: + _Driver->setPolygonMode (UDriver::Point); + break; + case UDriver::Point: + _Driver->setPolygonMode (UDriver::Filled); + break; + } + } // New matrix from camera _Scene->getCam().setTransformMode(NL3D::UTransformable::DirectMatrix); diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/CMakeLists.txt b/code/nel/tools/3d/object_viewer_qt/src/plugins/CMakeLists.txt index a866784b4..ac151cb0a 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/CMakeLists.txt +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/CMakeLists.txt @@ -1,3 +1,4 @@ +ADD_SUBDIRECTORY(core) ADD_SUBDIRECTORY(example) ADD_SUBDIRECTORY(ovqt_sheet_builder) -ADD_SUBDIRECTORY(log) +ADD_SUBDIRECTORY(log) \ No newline at end of file diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/CMakeLists.txt b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/CMakeLists.txt new file mode 100644 index 000000000..36a5e3d30 --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/CMakeLists.txt @@ -0,0 +1,54 @@ +INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_CURRENT_SOURCE_DIR} + ${LIBXML2_INCLUDE_DIR} + ${QT_INCLUDES}) + +FILE(GLOB SRC *.cpp *.h) +SET(OVQT_EXT_SYS_SRC ${CMAKE_CURRENT_SOURCE_DIR}/../../extension_system/iplugin.h + ${CMAKE_CURRENT_SOURCE_DIR}/../../extension_system/iplugin_manager.h + ${CMAKE_CURRENT_SOURCE_DIR}/../../extension_system/iplugin_spec.h) + +SET(OVQT_CORE_PLUGIN_HDR + ioptions_page.h + core_plugin.h + core_constants.h + main_window.h + settings_dialog.h + qnel_widget.h + search_paths_settings_page.h + plugin_view_dialog.h) + +SET(OVQT_CORE_PLUGIN_UIS settings_dialog.ui + plugin_view_dialog.ui + search_paths_settings_page.ui) + +SET(OVQT_CORE_PLUGIN_RCS core.qrc) + +SET(QT_USE_QTGUI TRUE) +SET(QT_USE_QTOPENGL TRUE) + +QT4_ADD_RESOURCES(OVQT_CORE_PLUGIN_RC_SRCS ${OVQT_CORE_PLUGIN_RCS}) +QT4_WRAP_CPP(OVQT_CORE_PLUGIN_MOC_SRC ${OVQT_CORE_PLUGIN_HDR}) +QT4_WRAP_UI(OVQT_CORE_PLUGIN_UI_HDRS ${OVQT_CORE_PLUGIN_UIS}) + +SOURCE_GROUP(QtResources FILES ${OVQT_CORE_PLUGIN_UIS} ${OVQT_CORE_PLUGIN_RCS}) +SOURCE_GROUP(QtGeneratedUiHdr FILES ${OVQT_CORE_PLUGIN_UI_HDRS}) +SOURCE_GROUP(QtGeneratedMocSrc FILES ${OVQT_CORE_PLUGIN_MOC_SRC}) +SOURCE_GROUP("Core Plugin" FILES ${SRC}) +SOURCE_GROUP("OVQT Extension System" FILES ${OVQT_EXT_SYS_SRC}) + +ADD_LIBRARY(ovqt_plugin_core MODULE ${SRC} ${OVQT_CORE_PLUGIN_MOC_SRC} ${OVQT_EXT_SYS_SRC} ${OVQT_CORE_PLUGIN_RC_SRCS} ${OVQT_CORE_PLUGIN_UI_HDRS}) + +TARGET_LINK_LIBRARIES(ovqt_plugin_core nelmisc nel3d ${QT_LIBRARIES}) + +IF(WITH_STLPORT) + TARGET_LINK_LIBRARIES(ovqt_plugin_core ${CMAKE_THREAD_LIBS_INIT}) +ENDIF(WITH_STLPORT) + +NL_DEFAULT_PROPS(ovqt_plugin_core "NeL, Tools, 3D: Object Viewer Qt Plugin: Core") +NL_ADD_RUNTIME_FLAGS(ovqt_plugin_core) +NL_ADD_LIB_SUFFIX(ovqt_plugin_core) + +ADD_DEFINITIONS(${LIBXML2_DEFINITIONS} -DQT_PLUGIN -DQT_SHARED ${QT_DEFINITIONS}) + +INSTALL(TARGETS ovqt_plugin_core LIBRARY DESTINATION lib RUNTIME DESTINATION bin ARCHIVE DESTINATION lib COMPONENT tools3d) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core.qrc b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core.qrc new file mode 100644 index 000000000..e6b5615d8 --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core.qrc @@ -0,0 +1,6 @@ + + + images/nel.png + images/preferences.png + + diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core_constants.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core_constants.h index fe859a26b..051c15e9d 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core_constants.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core_constants.h @@ -1,106 +1,64 @@ -/* - Object Viewer Qt - Copyright (C) 2010 Dzmitry Kamiahin - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - -*/ +// Object Viewer Qt - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// Copyright (C) 2010 Dzmitry Kamiahin +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . #ifndef CORE_CONSTANTS_H #define CORE_CONSTANTS_H -namespace Core { -namespace Constants { +namespace Core +{ +namespace Constants +{ -const char * const OVQT_VERSION_LONG = "0.0.1"; -const char * const OVQT_VENDOR = "Dzmitry Kamiahin"; -const char * const OVQT_YEAR = "2010"; +const char * const OVQT_VERSION_LONG = "0.0.1"; +const char * const OVQT_VENDOR = "Dzmitry Kamiahin"; +const char * const OVQT_YEAR = "2010, 2011"; //mainwindow -const char * const MAIN_WINDOW = "ObjectViewerQt.MainWindow"; +const char * const MAIN_WINDOW = "ObjectViewerQt.MainWindow"; //menubar -const char * const MENU_BAR = "ObjectViewerQt.MenuBar"; +const char * const MENU_BAR = "ObjectViewerQt.MenuBar"; //menus -const char * const M_FILE = "ObjectViewerQt.Menu.File"; -const char * const M_EDIT = "ObjectViewerQt.Menu.Edit"; -const char * const M_SCENE = "ObjectViewerQt.Menu.Scene"; -const char * const M_TOOLS = "ObjectViewerQt.Menu.Tools"; -const char * const M_WINDOW = "ObjectViewerQt.Menu.Window"; -const char * const M_HELP = "ObjectViewerQt.Menu.Help"; +const char * const M_FILE = "ObjectViewerQt.Menu.File"; +const char * const M_EDIT = "ObjectViewerQt.Menu.Edit"; +const char * const M_VIEW = "ObjectViewerQt.Menu.View"; +const char * const M_SCENE = "ObjectViewerQt.Menu.Scene"; +const char * const M_TOOLS = "ObjectViewerQt.Menu.Tools"; +const char * const M_WINDOW = "ObjectViewerQt.Menu.Window"; +const char * const M_HELP = "ObjectViewerQt.Menu.Help"; //actions -const char * const UNDO = "ObjectViewerQt.Undo"; -const char * const REDO = "ObjectViewerQt.Redo"; +const char * const NEW = "ObjectViewerQt.New"; +const char * const OPEN = "ObjectViewerQt.Open"; +const char * const EXIT = "ObjectViewerQt.Exit"; -const char * const NEW = "ObjectViewerQt.New"; -const char * const OPEN = "ObjectViewerQt.Open"; -const char * const SAVE = "ObjectViewerQt.Save"; -const char * const SAVEAS = "ObjectViewerQt.SaveAs"; -const char * const SAVEALL = "ObjectViewerQt.SaveAll"; -const char * const EXIT = "ObjectViewerQt.Exit"; +const char * const SETTINGS = "ObjectViewerQt.Settings"; +const char * const TOGGLE_FULLSCREEN = "ObjectViewerQt.ToggleFullScreen"; -const char * const SETTINGS = "ObjectViewerQt.Settings"; -const char * const TOGGLE_FULLSCREEN = "ObjectViewerQt.ToggleFullScreen"; - -const char * const MINIMIZE_WINDOW = "ObjectViewerQt.MinimizeWindow"; -const char * const ZOOM_WINDOW = "ObjectViewerQt.ZoomWindow"; - -const char * const CLOSE = "ObjectViewerQt.Close"; -const char * const CLOSEALL = "ObjectViewerQt.CloseAll"; -const char * const CLOSEOTHERS = "ObjectViewerQt.CloseOthers"; -const char * const ABOUT = "ObjectViewerQt.About"; -const char * const ABOUT_PLUGINS = "ObjectViewerQt.AboutPlugins"; -const char * const ABOUT_QT = "ObjectViewerQt.AboutQt"; - -const char * const ICON_NEL = ":/images/nel.png"; -const char * const ICON_NEL_IDE = ":/images/nel_ide_load.png -const char * const ICON_OPENFILE = ":/images/open-file.png"; -const char * const ICON_GO_DOWN = ":/images/go-down.png -const char * const ICON_GO_UP = ":/images/go-up.png -const char * const ICON_LIST_ADD = ":/images/list-add.png -const char * const ICON_LIST_REMOVE = ":/images/list-remove.png -const char * const ICON_PLAY = ":/images/play.png -const char * const ICON_PAUSE = ":/images/pause.png -const char * const ICON_STOP = ":/images/stop.png -const char * const ICON_SEEK_BACKWARD = ":/images/seek-backward.png -const char * const ICON_SEEK_FORWARD = ":/images/seek-forward.png -const char * const ICON_SKIP_BACKWARD = ":/images/skip-backward.png -const char * const ICON_SKIP_FORWARD = ":/images/skip-forward.png -const char * const ICON_SETTINGS = ":/images/preferences.png -const char * const ICON_TIME = ":/images/time.png -const char * const ICON_ANIM = ":/images/anim.png -const char * const ICON_ANIMSET = ":/images/animset.png -const char * const ICON_DAY_NIGHT = ":/images/dqynight.png -const char * const ICON_MIXER = ":/images/mixer.png -const char * const ICON_PARTICLES = ":/images/pqrticles.png -const char * const ICON_SOUND = ":/images/sound.png -const char * const ICON_VEGETABLE = ":/images/veget.png -const char * const ICON_WATER = ":/images/water.png -const char * const ICON_WIND = ":/images/wind.png -const char * const ICON_BACKGROUNDCOLOR = ":/images/ico_bgcolor.png -const char * const ICON_FRAMEDELAY = ":/images/ico_framedelay.png -const char * const ICON_SKELSCALE = ":/images/ico_skelscale.png -const char * const ICON_CLEAR = ":/images/clear.png -const char * const ICON_INSERT = ":/images/insert.png -const char * const ICON_NEW = ":/images/new.png -const char * const ICON_REFRESH = ":/images/refresh.png -const char * const ICON_SAVE_AS = ":/images/save-as.png -const char * const ICON_SAVE = ":/images/save.png -const char * const ICON_INSERT_HORIZONTAL = ":/images/insert-horizontal.png +const char * const CLOSE = "ObjectViewerQt.Close"; +const char * const CLOSEALL = "ObjectViewerQt.CloseAll"; +const char * const CLOSEOTHERS = "ObjectViewerQt.CloseOthers"; +const char * const ABOUT = "ObjectViewerQt.About"; +const char * const ABOUT_PLUGINS = "ObjectViewerQt.AboutPlugins"; +const char * const ABOUT_QT = "ObjectViewerQt.AboutQt"; +const char * const ICON_NEL = ":/core/images/nel.png"; +const char * const ICON_SETTINGS = ":/core/images/preferences.png"; } // namespace Constants } // namespace Core diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core_plugin.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core_plugin.cpp new file mode 100644 index 000000000..a2bc697cd --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core_plugin.cpp @@ -0,0 +1,136 @@ +// Object Viewer Qt - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// Copyright (C) 2010 Dzmitry Kamiahin +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#include "core_plugin.h" + +#include +#include +#include +#include +#include +#include + +#include "../../extension_system/iplugin_spec.h" + +#include "settings_dialog.h" +#include "core_constants.h" +#include "search_paths_settings_page.h" +#include "nel/misc/debug.h" + +using namespace Core; + +bool CorePlugin::initialize(ExtensionSystem::IPluginManager *pluginManager, QString *errorString) +{ + Q_UNUSED(errorString); + _plugMan = pluginManager; + // for old ovqt + QMainWindow *wnd = qobject_cast(objectByName("CMainWindow")); + if (!wnd) + { + *errorString = tr("Not found QMainWindow Object Viewer Qt."); + return false; + } + + //_mainWindow = new CMainWindow(_plugMan); + //_mainWindow->show(); + //_plugMan->addObject(new CSearchPathsSettingsPage(_mainWindow)); + return true; +} + +void CorePlugin::extensionsInitialized() +{ + // for old ovqt + _pluginView = new ExtensionSystem::CPluginView(_plugMan); + + QMenu *toolsMenu = qobject_cast(objectByName("ovqt.Menu.Tools")); + QMenu *helpMenu = qobject_cast(objectByName("ovqt.Menu.Help")); + nlassert(toolsMenu); + nlassert(helpMenu); + + QAction *newAction = toolsMenu->addAction(tr("New settings")); + QAction *newAction2 = helpMenu->addAction(tr("About plugins")); + newAction->setIcon(QIcon(Constants::ICON_SETTINGS)); + + connect(newAction, SIGNAL(triggered()), this, SLOT(execSettings())); + connect(newAction2, SIGNAL(triggered()), _pluginView, SLOT(show())); +} + +void CorePlugin::shutdown() +{ + //delete _mainWindow; + delete _pluginView; +} + +void CorePlugin::execSettings() +{ + CSettingsDialog settingsDialog(_plugMan); + settingsDialog.show(); + settingsDialog.execDialog(); +} + +void CorePlugin::setNelContext(NLMISC::INelContext *nelContext) +{ +#ifdef NL_OS_WINDOWS + // Ensure that a context doesn't exist yet. + // This only applies to platforms without PIC, e.g. Windows. + nlassert(!NLMISC::INelContext::isContextInitialised()); +#endif // NL_OS_WINDOWS + _LibContext = new NLMISC::CLibraryContext(*nelContext); +} + +QString CorePlugin::name() const +{ + return QLatin1String("Core"); +} + +QString CorePlugin::version() const +{ + return Constants::OVQT_VERSION_LONG; +} + +QString CorePlugin::vendor() const +{ + return Constants::OVQT_VENDOR; +} + +QString CorePlugin::description() const +{ + return "Core plugin."; +} + +QList CorePlugin::dependencies() const +{ + return QList(); +} + +QObject* CorePlugin::objectByName(const QString &name) const +{ + Q_FOREACH (QObject *qobj, _plugMan->allObjects()) + if (qobj->objectName() == name) + return qobj; + return 0; +} + +ExtensionSystem::IPluginSpec *CorePlugin::pluginByName(const QString &name) const +{ + Q_FOREACH (ExtensionSystem::IPluginSpec *spec, _plugMan->plugins()) + if (spec->name() == name) + return spec; + return 0; +} + +Q_EXPORT_PLUGIN(CorePlugin) diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core_plugin.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core_plugin.h new file mode 100644 index 000000000..1092bacaf --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/core_plugin.h @@ -0,0 +1,76 @@ +// Object Viewer Qt - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// Copyright (C) 2010 Dzmitry Kamiahin +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#ifndef CORE_PLUGIN_H +#define CORE_PLUGIN_H + +#include "../../extension_system/iplugin.h" +#include "main_window.h" + +#include "nel/misc/app_context.h" + +#include + +namespace NLMISC +{ +class CLibraryContext; +} + +namespace ExtensionSystem +{ +class IPluginSpec; +} + +namespace Core +{ + +class CorePlugin : public QObject, public ExtensionSystem::IPlugin +{ + Q_OBJECT + Q_INTERFACES(ExtensionSystem::IPlugin) +public: + + bool initialize(ExtensionSystem::IPluginManager *pluginManager, QString *errorString); + void extensionsInitialized(); + void shutdown(); + + void setNelContext(NLMISC::INelContext *nelContext); + + QString name() const; + QString version() const; + QString vendor() const; + QString description() const; + QList dependencies() const; + + QObject *objectByName(const QString &name) const; + ExtensionSystem::IPluginSpec *pluginByName(const QString &name) const; + +protected: + NLMISC::CLibraryContext *_LibContext; + +private Q_SLOTS: + void execSettings(); + +private: + ExtensionSystem::IPluginManager *_plugMan; + ExtensionSystem::CPluginView *_pluginView; + CMainWindow *_mainWindow; +}; + +} // namespace Core + +#endif // CORE_PLUGIN_H diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/images/nel.png b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/images/nel.png new file mode 100644 index 0000000000000000000000000000000000000000..d2139bb2557984f999a563059ea00f7e76436293 GIT binary patch literal 15587 zcmaKTc{G&oANDi5Suj~=>?OMxd-fT$$ui1b7)wmHC|eSY*{rU7BzZLus9*v^uC1-j9$Hv&?v*Q7=!J#&UiizwbDDV> z$cm1ut;CXK6gY{JnY0bRy+~XcBR&N|iIJE#@?tDU1`Gp0$r@!0l9SU8?#pW`I_-UZ zeRySuVu8RnLqh}^lc;pV`&n*h`CAqpv6tA5*a|W;F)o9~p#35Q)fvr!U{z)6n669}IlZ_2mp0?V;WI`${ z+c^r6xW%78+p1GXR)2pT+`hswli5;$9R@F{WcwP0zsF%M>4dIuEHDzdZEt4>@0Ar7 z7w?)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FHJ8hWR&O%dTI!aDH*qe zDxZLJs~h;aKtQN25v2di5CvEHhZ(w9QY*yx#f$!^@ViDni3zy@#U-m$WJ3&rr7$c+ z-%?238`UzqGs13X2A|^)H)|8}jMKw(W~9mfhpxter2dt8!@Fm9oABB$ z#vZ(Q2I2PYDzEr;!Wvz$Y+B3s_oFJw^>oPfq^02eF7i@C9 zdgH}9Z3XUhw#SfKE?@Vc8`YkXo=$OZjyKqA{d&-c6{bW;qR+$n1h#12Q92?(WkYAQ znm!TGnNlqzx=k)JM~?X&TZ8Cg8Xh8?=Y-lBLgYtKHSi;x!myDN5QRm~I@pS1({fxK zhoD_sV0$;=2F31^g4vfuz$HmY`BAul!f_>a_u_&Rfy{utX%pu?Y=BWHu$oLD2g=N9 zjHh*HDd~e%k!b#~ZpFjL7}l}YG$Gc=X)RuPFd5=fVEZ`>{1eo@ZwLQ8+?|t$-K3ED qiLHEpt}$vqsE==;|M$c&4Fo(6DE0di@OlB@zYgtlu(@wVVf-IpnGuly literal 0 HcmV?d00001 diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/images/preferences.png b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/images/preferences.png new file mode 100644 index 0000000000000000000000000000000000000000..729bc039355928ae3b0c39969f6dbfea6154a125 GIT binary patch literal 10286 zcmV+}DACu6P)ht(u001XPNkls{;HGWI__JUl#DxHgJ~hNxIja4^1(7DXDy3l>kE%``Fb?*~O_KZ=e|{5U>s z;+KZFq%PX%II&tE;}mI#8KjAh`9T*G|6TO>39fO8DPLzyo$=Ay;w`N2U%zLek$M)P zHwskRC{a*^n(5RU7J^IQz}C&Q|XN?OluH^>tjU0k!ltc8To^ky9-`Jg3YcvcUW8oS--jJSNi`2$Afj)i$!)~w$Q>o#tI)$2CF$~7Bc>B=>bnO6vtrp*FG1O(!> z7%($_?|xm(_}==sMEs2yQMe{rsL~jjN)ydgh>(BT5f+K7poyZhAY5k@siR_8xWV`t zuGC^&L9>6T8fMI%Z!Rl8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U^Bsm!i- zBD0qogvz05LKilk*|AX8ow>BN`SWOBENyw{WEDXi?Uh|S-`C==yk20=-^KR_(fQ~e zZGHZuQyUNdnST5B0nD!b@1M^hHphN|bN~e)r?oXUQAHp$5af{@Io^2>>2^$)b}8fd zj!>BDCdaevA5#Xqu>K5dIP1#f>|550iMxghCC+godhhVzP}c8*VXXUS?(d<%X(w*) zV}}x2YTGTeo2|9_lO8q!0&#b0qWn=#`wHw@2=ITqlRI*VHB|s%8U_M`;esT1m4cA& z(c(0o&G`Okiigz8Ft(F$mhWJC_)3^YPoa6xe!<^A9QiLAZu~udrJ*bU001R)MObuX zVRU6WV{&C-bY%cCFflMKFg7hQGgL7*IxsmpF*YkOGdeIZ=xu$&0000bbVXQnWMOn= zI&E)cX=Zr +// Copyright (C) 2010 Winch Gate Property Limited +// Copyright (C) 2011 Dzmitry Kamiahin +// Parts by Nokia Corporation (qt-info@nokia.com) Copyright (C) 2009. +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#ifndef IOPTIONS_PAGE_H +#define IOPTIONS_PAGE_H + +#include + +class QWidget; + +namespace Core +{ +/** +@interface IOptionsPage +@brief The IOptionsPage is an interface for providing options pages. +@details You need to subclass this interface and put an instance of your subclass + into the plugin manager object pool. +*/ +class IOptionsPage : public QObject +{ + Q_OBJECT +public: + IOptionsPage(QObject *parent = 0) : QObject(parent) {} + virtual ~IOptionsPage() {} + + /// id() is a unique identifier for referencing this page + virtual QString id() const = 0; + + /// trName() is the (translated) name for display. + virtual QString trName() const = 0; + + /// category() is the unique id for the category that the page should be displayed in + virtual QString category() const = 0; + + /// trCategory() is the translated category + virtual QString trCategory() const = 0; + + /// createPage() is called to retrieve the widget to show in the preferences dialog + /// The widget will be destroyed by the widget hierarchy when the dialog closes + virtual QWidget *createPage(QWidget *parent) = 0; + + /// apply() is called to store the settings. It should detect if any changes have been made and store those. + virtual void apply() = 0; + + /// finish() is called directly before the preferences dialog closes + virtual void finish() = 0; +}; + +} // namespace Core + +#endif // IOPTIONSPAGE_H diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/main_window.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/main_window.cpp new file mode 100644 index 000000000..7b15cde19 --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/main_window.cpp @@ -0,0 +1,173 @@ +// Object Viewer Qt - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// Copyright (C) 2011 Dzmitry Kamiahin +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +// Project includes +#include "main_window.h" +#include "core_constants.h" +#include "settings_dialog.h" + +// Qt includes +#include + +namespace Core +{ + +CMainWindow::CMainWindow(ExtensionSystem::IPluginManager *pluginManager, QWidget *parent) + : QMainWindow(parent), + _lastDir(".") +{ + _pluginManager = pluginManager; + + setObjectName(Constants::MAIN_WINDOW); + + _tabWidget = new QTabWidget(this); + setCentralWidget(_tabWidget); + + QWidget *qwidg1 = new QWidget(_tabWidget); + QWidget *qwidg2 = new QWidget(_tabWidget); + + _tabWidget->addTab(qwidg1, "tab1"); + _tabWidget->addTab(qwidg2, "tab2"); + + + QGridLayout *gridLayout = new QGridLayout(qwidg1); + gridLayout->setObjectName(QString::fromUtf8("gridLayout")); + NLQT::QNLWidget *_nelWidget = new NLQT::QNLWidget(qwidg1); + _nelWidget->setObjectName(QString::fromUtf8("NELWIdget1")); + gridLayout->addWidget(_nelWidget, 0, 0, 1, 1); + + QGridLayout *gridLayout2 = new QGridLayout(qwidg2); + NLQT::QNLWidget *_nelWidget2 = new NLQT::QNLWidget(qwidg2); + _nelWidget2->setObjectName(QString::fromUtf8("NELWIdget2")); + gridLayout2->addWidget(_nelWidget2, 0, 0, 1, 1); + + setDockNestingEnabled(true); + + _originalPalette = QApplication::palette(); + + createDialogs(); + createActions(); + createMenus(); + createStatusBar(); + + setWindowIcon(QIcon(Constants::ICON_NEL)); + setWindowTitle(tr("Object Viewer Qt")); +} + +CMainWindow::~CMainWindow() +{ + delete _pluginView; +} + +bool CMainWindow::showOptionsDialog(const QString &group, + const QString &page, + QWidget *parent) +{ + if (!parent) + parent = this; + CSettingsDialog _settingsDialog(_pluginManager, group, page, parent); + _settingsDialog.show(); + return _settingsDialog.execDialog(); +} + +void CMainWindow::about() +{ + QMessageBox::about(this, tr("About Object Viewer Qt"), + tr("

Object Viewer Qt NG

" + "

Author: dnk-88

Compiled on %1 %2").arg(__DATE__).arg(__TIME__)); +} + +void CMainWindow::createActions() +{ + _openAction = new QAction(tr("&Open..."), this); + _openAction->setIcon(QIcon(":/images/open-file.png")); + _openAction->setShortcut(QKeySequence::Open); + _openAction->setStatusTip(tr("Open an existing file")); +// connect(_openAction, SIGNAL(triggered()), this, SLOT(open())); + + _exitAction = new QAction(tr("E&xit"), this); + _exitAction->setShortcut(tr("Ctrl+Q")); + _exitAction->setStatusTip(tr("Exit the application")); + connect(_exitAction, SIGNAL(triggered()), this, SLOT(close())); + + _settingsAction = new QAction(tr("&Settings"), this); + _settingsAction->setIcon(QIcon(":/images/preferences.png")); + _settingsAction->setStatusTip(tr("Open the settings dialog")); + connect(_settingsAction, SIGNAL(triggered()), this, SLOT(showOptionsDialog())); + + _aboutAction = new QAction(tr("&About"), this); + _aboutAction->setStatusTip(tr("Show the application's About box")); + connect(_aboutAction, SIGNAL(triggered()), this, SLOT(about())); + + _aboutQtAction = new QAction(tr("About &Qt"), this); + _aboutQtAction->setStatusTip(tr("Show the Qt library's About box")); + connect(_aboutQtAction, SIGNAL(triggered()), qApp, SLOT(aboutQt())); + + _pluginViewAction = new QAction(tr("About &Plugins"), this); + _pluginViewAction->setStatusTip(tr("Show the plugin view dialog")); + connect(_pluginViewAction, SIGNAL(triggered()), _pluginView, SLOT(show())); +} + +void CMainWindow::createMenus() +{ + _fileMenu = menuBar()->addMenu(tr("&File")); + _fileMenu->setObjectName(Constants::M_FILE); + _fileMenu->addSeparator(); + _fileMenu->addAction(_exitAction); + + _editMenu = menuBar()->addMenu(tr("&Edit")); + _editMenu->setObjectName(Constants::M_EDIT); + + _viewMenu = menuBar()->addMenu(tr("&View")); + _viewMenu->setObjectName(Constants::M_VIEW); + + _toolsMenu = menuBar()->addMenu(tr("&Tools")); + _toolsMenu->setObjectName(Constants::M_TOOLS); + + + _toolsMenu->addSeparator(); + + _toolsMenu->addAction(_settingsAction); + + menuBar()->addSeparator(); + + _helpMenu = menuBar()->addMenu(tr("&Help")); + _helpMenu->setObjectName(Constants::M_HELP); + _helpMenu->addAction(_aboutAction); + _helpMenu->addAction(_aboutQtAction); + _helpMenu->addAction(_pluginViewAction); + + _pluginManager->addObject(_fileMenu); + _pluginManager->addObject(_editMenu); + _pluginManager->addObject(_viewMenu); + _pluginManager->addObject(_toolsMenu); + _pluginManager->addObject(_helpMenu); +} + +void CMainWindow::createStatusBar() +{ + statusBar()->showMessage(tr("StatusReady")); +} + +void CMainWindow::createDialogs() +{ + _pluginView = new ExtensionSystem::CPluginView(_pluginManager, this); +} + +} /* namespace Core */ + +/* end of file */ diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/main_window.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/main_window.h new file mode 100644 index 000000000..49c668b14 --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/main_window.h @@ -0,0 +1,91 @@ +// Object Viewer Qt - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// Copyright (C) 2011 Dzmitry Kamiahin +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#ifndef MAIN_WINDOW_H +#define MAIN_WINDOW_H + +// STL includes + +// Qt includes +#include +#include + +// Project includes +#include "qnel_widget.h" +#include "../../extension_system/iplugin.h" +#include "plugin_view_dialog.h" + +namespace Core +{ +class CSettingsDialog; + +class CMainWindow : public QMainWindow +{ + Q_OBJECT + +public: + CMainWindow(ExtensionSystem::IPluginManager *pluginManager, QWidget *parent = 0); + ~CMainWindow(); + + inline QSettings *settings() const + { + return _settings; + } + +private Q_SLOTS: + bool showOptionsDialog(const QString &group = QString(), + const QString &page = QString(), + QWidget *parent = 0); + void about(); + +private: + void createActions(); + void createMenus(); + void createStatusBar(); + void createDialogs(); + + ExtensionSystem::IPluginManager *_pluginManager; + ExtensionSystem::CPluginView *_pluginView; + + QPalette _originalPalette; + QString _lastDir; + + QSettings *_settings; + + QTimer *_mainTimer; + QTimer *_statusBarTimer; + + QTabWidget *_tabWidget; + + QMenu *_fileMenu; + QMenu *_editMenu; + QMenu *_viewMenu; + QMenu *_toolsMenu; + QMenu *_helpMenu; + + QAction *_openAction; + QAction *_exitAction; + QAction *_settingsAction; + QAction *_pluginViewAction; + QAction *_aboutAction; + QAction *_aboutQtAction; + +};/* class CMainWindow */ + +} /* namespace Core */ + +#endif // MAIN_WINDOW_H diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/plugin_view_dialog.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/plugin_view_dialog.cpp new file mode 100644 index 000000000..b45d46418 --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/plugin_view_dialog.cpp @@ -0,0 +1,73 @@ +// Object Viewer Qt - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// Copyright (C) 2011 Dzmitry Kamiahin +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#include "plugin_view_dialog.h" + +// Qt includes +#include +#include +#include +#include +#include +#include + +// Project includes +#include "../../extension_system/iplugin_spec.h" +#include "../../extension_system/iplugin_manager.h" + +namespace ExtensionSystem +{ + +CPluginView::CPluginView(IPluginManager *pluginManager, QWidget *parent) + : QDialog(parent) +{ + _ui.setupUi(this); + _pluginManager = pluginManager; + + connect(_pluginManager, SIGNAL(pluginsChanged()), this, SLOT(updateList())); + + updateList(); +} + +CPluginView::~CPluginView() +{ +} + +void CPluginView::updateList() +{ + static QIcon okIcon = QApplication::style()->standardIcon(QStyle::SP_DialogApplyButton); + static QIcon errorIcon = QApplication::style()->standardIcon(QStyle::SP_DialogCancelButton); + + QList items; + Q_FOREACH (IPluginSpec *spec, _pluginManager->plugins()) + { + QTreeWidgetItem *item = new QTreeWidgetItem(QStringList() + << "" + << spec->name() + << QString("%1").arg(spec->version()) + << spec->vendor() + << QDir::toNativeSeparators(spec->filePath())); + item->setIcon(0, spec->hasError() ? errorIcon : okIcon); + items.append(item); + } + + _ui.pluginTreeWidget->clear(); + if (!items.isEmpty()) + _ui.pluginTreeWidget->addTopLevelItems(items); +} + +} /* namespace NLQT */ \ No newline at end of file diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/plugin_view_dialog.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/plugin_view_dialog.h new file mode 100644 index 000000000..0f12b64a3 --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/plugin_view_dialog.h @@ -0,0 +1,47 @@ +// Object Viewer Qt - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// Copyright (C) 2011 Dzmitry Kamiahin +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#ifndef PLUGIN_VIEW_H +#define PLUGIN_VIEW_H + +#include "ui_plugin_view_dialog.h" + +namespace ExtensionSystem +{ + +class IPluginManager; + +class CPluginView: public QDialog +{ + Q_OBJECT + +public: + CPluginView(IPluginManager *pluginManager, QWidget *parent = 0); + ~CPluginView(); + +private Q_SLOTS: + void updateList(); + +private: + + IPluginManager *_pluginManager; + Ui::CPluginView _ui; +}; /* class CPluginView */ + +} /* namespace NLQT */ + +#endif // PLUGIN_VIEW_H diff --git a/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_view.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/plugin_view_dialog.ui similarity index 88% rename from code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_view.ui rename to code/nel/tools/3d/object_viewer_qt/src/plugins/core/plugin_view_dialog.ui index 8bf90fdf3..2fb0f568e 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/extension_system/plugin_view.ui +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/plugin_view_dialog.ui @@ -17,7 +17,7 @@ true - + true @@ -37,6 +37,9 @@ true + + 100 + State @@ -84,7 +87,7 @@ - + Qt::Horizontal @@ -97,13 +100,23 @@ - + Close + + + + false + + + All objects list + + + diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/qnel_widget.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/qnel_widget.cpp new file mode 100644 index 000000000..53dd4c7b3 --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/qnel_widget.cpp @@ -0,0 +1,208 @@ +// Object Viewer Qt - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// Copyright (C) 2011 Dzmitry Kamiahin +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#include "qnel_widget.h" + +// STL includes + +// Qt includes +#include +#include + +// NeL includes +#include +#include +#include +#include + +namespace NLQT +{ + +QNLWidget::QNLWidget(QWidget *parent) + : QWidget(parent), + _driver(NULL), + _initialized(false), + _interval(25) +{ + init(); + _mainTimer = new QTimer(this); + connect(_mainTimer, SIGNAL(timeout()), this, SLOT(updateRender())); +} + +QNLWidget::~QNLWidget() +{ + release(); +} + +void QNLWidget::init() +{ + // create the driver + _driver = NL3D::UDriver::createDriver(NULL, false, NULL); + nlassert(_driver); + + // initialize the nel 3d viewport + _driver->setDisplay(winId(), NL3D::UDriver::CMode(width(), height(), 32)); + + // set the cache size for the font manager(in bytes) + _driver->setFontManagerMaxMemory(2097152); + + _initialized = true; +} + +void QNLWidget::release() +{ + _mainTimer->stop(); + delete _mainTimer; + if (_initialized) + { + _driver->release(); + delete _driver; + _driver = NULL; + } +} + +void QNLWidget::setInterval(int msec) +{ + _interval = msec; + _mainTimer->setInterval(msec); +} + +void QNLWidget::updateRender() +{ + if (isVisible()) + { + if (_initialized) + _driver->EventServer.pump(); + if (_initialized && !_driver->isLost()) + { + _driver->activate(); + _driver->clearBuffers(NLMISC::CRGBA(125,12,58)); + + // swap 3d buffers + _driver->swapBuffers(); + } + } +} + +void QNLWidget::showEvent(QShowEvent *showEvent) +{ + QWidget::showEvent(showEvent); + if (isVisible()) + { + _driver->activate(); + _mainTimer->start(_interval); + } + else + _mainTimer->stop(); +} + +#if defined(NL_OS_WINDOWS) || defined(NL_OS_MAC) +// Qt does not provide wheel events through winEvent() and macEvent() (but it +// does through x11Event(), which is inconsistent...) +// Workaround is to handle wheel events like implemented below. +// +// TODO: this is not a clean solution, because all but wheel events are +// handled using winEvent(), x11Event(), macEvent(). But this seems to be a +// limitation of current (4.7.1) Qt versions. (see e.g. qapplication_mac.mm) +void QNLWidget::wheelEvent(QWheelEvent *event) +{ + // Get relative positions. + float fX = 1.0f - (float)event->pos().x() / this->width(); + float fY = 1.0f - (float)event->pos().y() / this->height(); + + // Get the buttons currently pressed. + uint32 buttons = NLMISC::noButton; + if(event->buttons() & Qt::LeftButton) buttons |= NLMISC::leftButton; + if(event->buttons() & Qt::RightButton) buttons |= NLMISC::rightButton; + if(event->buttons() & Qt::MidButton) buttons |= NLMISC::middleButton; + if(event->modifiers() & Qt::ControlModifier) buttons |= NLMISC::ctrlButton; + if(event->modifiers() & Qt::ShiftModifier) buttons |= NLMISC::shiftButton; + if(event->modifiers() & Qt::AltModifier) buttons |= NLMISC::altButton; + + if(event->delta() > 0) + _driver->EventServer.postEvent( + new NLMISC::CEventMouseWheel(-fX, fY, (NLMISC::TMouseButton)buttons, true, NULL)); + else + _driver->EventServer.postEvent( + new NLMISC::CEventMouseWheel(-fX, fY, (NLMISC::TMouseButton)buttons, false, NULL)); +} +#endif // defined(NL_OS_WINDOWS) || defined(NL_OS_MAC) + + +#if defined(NL_OS_WINDOWS) + +typedef bool (*winProc)(NL3D::IDriver *driver, HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); + +bool QNLWidget::winEvent(MSG *message, long *result) +{ + if (_driver && _driver->isActive()) + { + NL3D::IDriver *driver = dynamic_cast(_driver)->getDriver(); + if (driver) + { + winProc proc = (winProc)driver->getWindowProc(); + return proc(driver, message->hwnd, message->message, message->wParam, message->lParam); + } + } + + return false; +} + +#elif defined(NL_OS_MAC) + +typedef bool (*cocoaProc)(NL3D::IDriver *, const void *e); + +bool QNLWidget::macEvent(EventHandlerCallRef caller, EventRef event) +{ + if(caller) + nlerror("You are using QtCarbon! Only QtCocoa supported, please upgrade Qt"); + + if (_driver && _driver->isActive()) + { + NL3D::IDriver *driver = dynamic_cast(_driver)->getDriver(); + if (driver) + { + cocoaProc proc = (cocoaProc)driver->getWindowProc(); + return proc(driver, event); + } + } + + return false; +} + +#elif defined(NL_OS_UNIX) + +typedef bool (*x11Proc)(NL3D::IDriver *drv, XEvent *e); + +bool QNLWidget::x11Event(XEvent *event) +{ + if (_driver && _driver->isActive()) + { + NL3D::IDriver *driver = dynamic_cast(_driver)->getDriver(); + if (driver) + { + x11Proc proc = (x11Proc)driver->getWindowProc(); + return proc(driver, event); + } + } + + return false; +} +#endif + +} /* namespace NLQT */ + diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/qnel_widget.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/qnel_widget.h new file mode 100644 index 000000000..a8238fa39 --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/qnel_widget.h @@ -0,0 +1,97 @@ +// Object Viewer Qt - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// Copyright (C) 2011 Dzmitry Kamiahin +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#ifndef QNEL_WIDGET_H +#define QNEL_WIDGET_H + +// NeL includes +#include +#include + +// Qt includes +#include +#include + +class QAction; + +namespace NL3D +{ +class UDriver; +class UScene; +} + +namespace NLQT +{ + +/** +@class QNLWidget +@brief Responsible for interaction between Qt and NeL. +@details Automatically begins to update the render if the widget is visible +or suspends the updating of render if the widget is hidden. +*/ +class QNLWidget : public QWidget +{ + Q_OBJECT + +public: + QNLWidget(QWidget *parent); + virtual ~QNLWidget(); + + /// Set the update interval renderer + void setInterval(int msec); + + virtual QPaintEngine* paintEngine() const + { + return NULL; + } + +private Q_SLOTS: + void updateRender(); + +protected: + virtual void showEvent(QShowEvent *showEvent); + +#if defined(NL_OS_WINDOWS) || defined(NL_OS_MAC) + virtual void wheelEvent(QWheelEvent *event); +#endif + +#if defined(NL_OS_WINDOWS) + virtual bool winEvent(MSG *message, long *result); +#elif defined(NL_OS_MAC) + virtual bool macEvent(EventHandlerCallRef caller, EventRef event); +#elif defined(NL_OS_UNIX) + virtual bool x11Event(XEvent *event); +#endif + +private: + void init(); + void release(); + + QNLWidget(const QNLWidget &); + QNLWidget &operator=(const QNLWidget &); + + NL3D::UDriver *_driver; + QTimer *_mainTimer; + bool _initialized; + int _interval; + +}; /* class QNLWidget */ + +} /* namespace NLQT */ + + +#endif // QNEL_WIDGET_H diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/search_paths_settings_page.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/search_paths_settings_page.cpp new file mode 100644 index 000000000..21a9aa12c --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/search_paths_settings_page.cpp @@ -0,0 +1,67 @@ +// Object Viewer Qt - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// Copyright (C) 2011 Dzmitry Kamiahin +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#include "search_paths_settings_page.h" + +// Qt includes +#include + +// NeL includes + +// Project includes + +namespace Core +{ + +CSearchPathsSettingsPage::CSearchPathsSettingsPage(QObject *parent) + : IOptionsPage(parent), + _currentPage(NULL) +{ +} + +QString CSearchPathsSettingsPage::id() const +{ + return QLatin1String("SearchPaths"); +} + +QString CSearchPathsSettingsPage::trName() const +{ + return tr("Search Paths"); +} + +QString CSearchPathsSettingsPage::category() const +{ + return QLatin1String("General"); +} + +QString CSearchPathsSettingsPage::trCategory() const +{ + return tr("General"); +} + +QWidget *CSearchPathsSettingsPage::createPage(QWidget *parent) +{ + _currentPage = new QWidget(parent); + _ui.setupUi(_currentPage); + return _currentPage; +} + +void CSearchPathsSettingsPage::apply() +{ +} + +} /* namespace Core */ \ No newline at end of file diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/search_paths_settings_page.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/search_paths_settings_page.h new file mode 100644 index 000000000..b2f2398a0 --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/search_paths_settings_page.h @@ -0,0 +1,58 @@ +// Object Viewer Qt - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// Copyright (C) 2011 Dzmitry Kamiahin +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + + +#ifndef SEARCH_PATHS_SETTINGS_PAGE_H +#define SEARCH_PATHS_SETTINGS_PAGE_H + +#include + +#include "ioptions_page.h" + +#include "ui_search_paths_settings_page.h" + +class QWidget; + +namespace Core +{ +/** +@class CSearchPathsSettingsPage +*/ +class CSearchPathsSettingsPage : public IOptionsPage +{ + Q_OBJECT +public: + CSearchPathsSettingsPage(QObject *parent = 0); + virtual ~CSearchPathsSettingsPage() {} + + virtual QString id() const; + virtual QString trName() const; + virtual QString category() const; + virtual QString trCategory() const; + virtual QWidget *createPage(QWidget *parent); + + virtual void apply(); + virtual void finish() {} + +private: + QWidget *_currentPage; + Ui::CSearchPathsSettingsPage _ui; +}; + +} // namespace Core + +#endif // SEARCH_PATHS_SETTINGS_H diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/search_paths_settings_page.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/search_paths_settings_page.ui new file mode 100644 index 000000000..4a034ba25 --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/search_paths_settings_page.ui @@ -0,0 +1,108 @@ + + + CSearchPathsSettingsPage + + + + 0 + 0 + 422 + 272 + + + + Form + + + + + + Search paths + + + + + + + + + + + + 0 + 0 + + + + ... + + + + :/images/list-add.png:/images/list-add.png + + + + 16 + 16 + + + + + + + + ... + + + + :/images/list-remove.png:/images/list-remove.png + + + + + + + ... + + + + :/images/go-up.png:/images/go-up.png + + + + + + + ... + + + + :/images/go-down.png:/images/go-down.png + + + + + + + + + Qt::Vertical + + + + 20 + 195 + + + + + + + + + + + + + + diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/settings_dialog.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/settings_dialog.cpp new file mode 100644 index 000000000..acb8ca856 --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/settings_dialog.cpp @@ -0,0 +1,188 @@ +// Object Viewer Qt - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// Copyright (C) 2011 Dzmitry Kamiahin +// Parts by Nokia Corporation (qt-info@nokia.com) Copyright (C) 2009. +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#include "settings_dialog.h" + +// Qt includes +#include +#include + +namespace Core +{ + +struct PageData +{ + int index; + QString category; + QString id; +}; + +Q_DECLARE_METATYPE(PageData); + +CSettingsDialog::CSettingsDialog(ExtensionSystem::IPluginManager *pluginManager, + const QString &categoryId, + const QString &pageId, + QWidget *parent) + : QDialog(parent), + _applied(false) +{ + _ui.setupUi(this); + + _plugMan = pluginManager; + + QString initialCategory = categoryId; + QString initialPage = pageId; + + _ui.buttonBox->button(QDialogButtonBox::Ok)->setDefault(true); + + connect(_ui.buttonBox->button(QDialogButtonBox::Apply), SIGNAL(clicked()), this, SLOT(apply())); + + _ui.splitter->setCollapsible(1, false); + _ui.pageTree->header()->setVisible(false); + + connect(_ui.pageTree, SIGNAL(currentItemChanged(QTreeWidgetItem *, QTreeWidgetItem *)), + this, SLOT(pageSelected())); + + QMap categories; + + QList pages; + QList all = _plugMan->allObjects(); + Q_FOREACH(QObject *obj, all) + { + IOptionsPage *page = qobject_cast(obj); + if (page) + pages.append(page); + } + + int index = 0; + Q_FOREACH(IOptionsPage *page, pages) + { + PageData pageData; + pageData.index = index; + pageData.category = page->category(); + pageData.id = page->id(); + + QTreeWidgetItem *item = new QTreeWidgetItem; + item->setText(0, page->trName()); + item->setData(0, Qt::UserRole, qVariantFromValue(pageData)); + + QStringList categoriesId = page->category().split(QLatin1Char('|')); + QStringList trCategories = page->trCategory().split(QLatin1Char('|')); + QString currentCategory = categoriesId.at(0); + + QTreeWidgetItem *treeitem; + if (!categories.contains(currentCategory)) + { + treeitem = new QTreeWidgetItem(_ui.pageTree); + treeitem->setText(0, trCategories.at(0)); + treeitem->setData(0, Qt::UserRole, qVariantFromValue(pageData)); + categories.insert(currentCategory, treeitem); + } + + int catCount = 1; + while (catCount < categoriesId.count()) + { + if (!categories.contains(currentCategory + QLatin1Char('|') + categoriesId.at(catCount))) + { + treeitem = new QTreeWidgetItem(categories.value(currentCategory)); + currentCategory += QLatin1Char('|') + categoriesId.at(catCount); + treeitem->setText(0, trCategories.at(catCount)); + treeitem->setData(0, Qt::UserRole, qVariantFromValue(pageData)); + categories.insert(currentCategory, treeitem); + } + else + { + currentCategory += QLatin1Char('|') + categoriesId.at(catCount); + } + ++catCount; + } + + categories.value(currentCategory)->addChild(item); + + _pages.append(page); + _ui.stackedPages->addWidget(page->createPage(_ui.stackedPages)); + + if (page->id() == initialPage && currentCategory == initialCategory) + { + _ui.stackedPages->setCurrentIndex(_ui.stackedPages->count()); + _ui.pageTree->setCurrentItem(item); + } + + index++; + } + + QList sizes; + sizes << 150 << 300; + _ui.splitter->setSizes(sizes); + + _ui.splitter->setStretchFactor(_ui.splitter->indexOf(_ui.pageTree), 0); + _ui.splitter->setStretchFactor(_ui.splitter->indexOf(_ui.layoutWidget), 1); +} + +CSettingsDialog::~CSettingsDialog() +{ +} + +void CSettingsDialog::pageSelected() +{ + QTreeWidgetItem *item = _ui.pageTree->currentItem(); + PageData data = item->data(0, Qt::UserRole).value(); + int index = data.index; + _currentCategory = data.category; + _currentPage = data.id; + _ui.stackedPages->setCurrentIndex(index); +} + +void CSettingsDialog::accept() +{ + _applied = true; + Q_FOREACH(IOptionsPage *page, _pages) + { + page->apply(); + page->finish(); + } + done(QDialog::Accepted); +} + +void CSettingsDialog::reject() +{ + Q_FOREACH(IOptionsPage *page, _pages) + page->finish(); + done(QDialog::Rejected); +} + +void CSettingsDialog::apply() +{ + Q_FOREACH(IOptionsPage *page, _pages) + page->apply(); + _applied = true; +} + +bool CSettingsDialog::execDialog() +{ + _applied = false; + exec(); + return _applied; +} + +void CSettingsDialog::done(int val) +{ + QDialog::done(val); +} + +} /* namespace Core */ \ No newline at end of file diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/settings_dialog.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/settings_dialog.h new file mode 100644 index 000000000..2ca58236a --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/settings_dialog.h @@ -0,0 +1,75 @@ +// Object Viewer Qt - MMORPG Framework +// Copyright (C) 2010 Winch Gate Property Limited +// Copyright (C) 2011 Dzmitry Kamiahin +// Parts by Nokia Corporation (qt-info@nokia.com) Copyright (C) 2009. +// +// This program is free software: you can redistribute it and/or modify +// it under the terms of the GNU Affero General Public License as +// published by the Free Software Foundation, either version 3 of the +// License, or (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU Affero General Public License for more details. +// +// You should have received a copy of the GNU Affero General Public License +// along with this program. If not, see . + +#ifndef SETTINGS_DIALOG_H +#define SETTINGS_DIALOG_H + +#include "ui_settings_dialog.h" + +// Qt includes +#include + +// Project includes +#include "ioptions_page.h" +#include "../../extension_system/iplugin.h" + +namespace Core +{ + +/** +@class CSettingsDialog +@brief Settings dialog +*/ +class CSettingsDialog: public QDialog +{ + Q_OBJECT + +public: + CSettingsDialog(ExtensionSystem::IPluginManager *pluginManager, + const QString &initialCategory = QString(), + const QString &initialPage = QString(), + QWidget *parent = 0); + + ~CSettingsDialog(); + + /// Run the dialog and return true if 'Ok' was choosen or 'Apply' was invoked at least once + bool execDialog(); + +public Q_SLOTS: + void done(int); + +private Q_SLOTS: + void pageSelected(); + void accept(); + void reject(); + void apply(); + +private: + QList _pages; + bool _applied; + QString _currentCategory; + QString _currentPage; + + ExtensionSystem::IPluginManager *_plugMan; + + Ui::CSettingsDialog _ui; +}; /* class CSettingsDialog */ + +} /* namespace Core */ + +#endif // SETTINGS_DIALOG_H diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/core/settings_dialog.ui b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/settings_dialog.ui new file mode 100644 index 000000000..e536f0dc2 --- /dev/null +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/core/settings_dialog.ui @@ -0,0 +1,126 @@ + + + CSettingsDialog + + + + 0 + 0 + 697 + 476 + + + + Settings + + + + :/core/images/preferences.png:/core/images/preferences.png + + + + 6 + + + 9 + + + + + Qt::Horizontal + + + + + 0 + 0 + + + + 1 + + + + 0 + + + + + + + 6 + + + 0 + + + + + + 350 + 250 + + + + + + + + Qt::Horizontal + + + + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Apply|QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + + + + + buttonBox + accepted() + CSettingsDialog + accept() + + + 297 + 361 + + + 297 + 193 + + + + + buttonBox + rejected() + CSettingsDialog + reject() + + + 297 + 361 + + + 297 + 193 + + + + + diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/example/plugin1.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/example/plugin1.cpp index 3c5c3864e..c79ad079e 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/example/plugin1.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/example/plugin1.cpp @@ -13,15 +13,15 @@ using namespace Plugin; -bool MyPlugin::initialize(NLQT::IPluginManager *pluginManager, QString *errorString) +bool MyPlugin::initialize(ExtensionSystem::IPluginManager *pluginManager, QString *errorString) { Q_UNUSED(errorString); _plugMan = pluginManager; QString str; - QList listPlug = pluginManager->plugins(); + QList listPlug = pluginManager->plugins(); - Q_FOREACH (NLQT::IPluginSpec *plugSpec, listPlug) + Q_FOREACH (ExtensionSystem::IPluginSpec *plugSpec, listPlug) str += plugSpec->name(); nlinfo(str.toStdString().c_str()); @@ -99,9 +99,9 @@ QObject* MyPlugin::objectByName(const QString &name) const return 0; } -NLQT::IPluginSpec *MyPlugin::pluginByName(const QString &name) const +ExtensionSystem::IPluginSpec *MyPlugin::pluginByName(const QString &name) const { - Q_FOREACH (NLQT::IPluginSpec *spec, _plugMan->plugins()) + Q_FOREACH (ExtensionSystem::IPluginSpec *spec, _plugMan->plugins()) if (spec->name() == name) return spec; return 0; diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/example/plugin1.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/example/plugin1.h index 02d80e1dc..f5a458873 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/example/plugin1.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/example/plugin1.h @@ -12,7 +12,7 @@ namespace NLMISC class CLibraryContext; } -namespace NLQT +namespace ExtensionSystem { class IPluginSpec; } @@ -20,13 +20,13 @@ class IPluginSpec; namespace Plugin { -class MyPlugin : public QObject, public NLQT::IPlugin +class MyPlugin : public QObject, public ExtensionSystem::IPlugin { Q_OBJECT - Q_INTERFACES(NLQT::IPlugin) + Q_INTERFACES(ExtensionSystem::IPlugin) public: - bool initialize(NLQT::IPluginManager *pluginManager, QString *errorString); + bool initialize(ExtensionSystem::IPluginManager *pluginManager, QString *errorString); void extensionsInitialized(); void setNelContext(NLMISC::INelContext *nelContext); @@ -37,7 +37,7 @@ public: QString description() const; QObject *objectByName(const QString &name) const; - NLQT::IPluginSpec *pluginByName(const QString &name) const; + ExtensionSystem::IPluginSpec *pluginByName(const QString &name) const; private Q_SLOTS: void execMessageBox(); @@ -46,10 +46,10 @@ protected: NLMISC::CLibraryContext *_LibContext; private: - NLQT::IPluginManager *_plugMan; + ExtensionSystem::IPluginManager *_plugMan; }; -} // namespace Plugin1 +} // namespace Plugin #endif // PLUGIN1_H diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/log/log_plugin.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/log/log_plugin.cpp index 82f65a85a..c93503ad5 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/log/log_plugin.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/log/log_plugin.cpp @@ -55,7 +55,7 @@ CLogPlugin::~CLogPlugin() delete _displayer; } -bool CLogPlugin::initialize(NLQT::IPluginManager *pluginManager, QString *errorString) +bool CLogPlugin::initialize(ExtensionSystem::IPluginManager *pluginManager, QString *errorString) { Q_UNUSED(errorString); _plugMan = pluginManager; @@ -120,9 +120,9 @@ QObject* CLogPlugin::objectByName(const QString &name) const return 0; } -NLQT::IPluginSpec *CLogPlugin::pluginByName(const QString &name) const +ExtensionSystem::IPluginSpec *CLogPlugin::pluginByName(const QString &name) const { - Q_FOREACH (NLQT::IPluginSpec *spec, _plugMan->plugins()) + Q_FOREACH (ExtensionSystem::IPluginSpec *spec, _plugMan->plugins()) if (spec->name() == name) return spec; return 0; diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/log/log_plugin.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/log/log_plugin.h index c7661342c..7f81ec8d4 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/log/log_plugin.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/log/log_plugin.h @@ -35,24 +35,28 @@ namespace NLMISC class CLibraryContext; } -namespace NLQT +namespace ExtensionSystem { class IPluginSpec; +} + +namespace NLQT +{ class CQtDisplayer; } namespace Plugin { - class CLogPlugin : public QDockWidget, public NLQT::IPlugin + class CLogPlugin : public QDockWidget, public ExtensionSystem::IPlugin { Q_OBJECT - Q_INTERFACES(NLQT::IPlugin) + Q_INTERFACES(ExtensionSystem::IPlugin) public: CLogPlugin(QWidget *parent = 0); ~CLogPlugin(); - bool initialize(NLQT::IPluginManager *pluginManager, QString *errorString); + bool initialize(ExtensionSystem::IPluginManager *pluginManager, QString *errorString); void extensionsInitialized(); void setNelContext(NLMISC::INelContext *nelContext); @@ -63,13 +67,13 @@ namespace Plugin QString description() const; QObject *objectByName(const QString &name) const; - NLQT::IPluginSpec *pluginByName(const QString &name) const; + ExtensionSystem::IPluginSpec *pluginByName(const QString &name) const; protected: NLMISC::CLibraryContext *_LibContext; private: - NLQT::IPluginManager *_plugMan; + ExtensionSystem::IPluginManager *_plugMan; Ui::CLogPlugin _ui; diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/ovqt_sheet_builder/ovqt_sheet_builder.cpp b/code/nel/tools/3d/object_viewer_qt/src/plugins/ovqt_sheet_builder/ovqt_sheet_builder.cpp index 13ae954e6..daf907d09 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/ovqt_sheet_builder/ovqt_sheet_builder.cpp +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/ovqt_sheet_builder/ovqt_sheet_builder.cpp @@ -31,7 +31,7 @@ using namespace Plugin; -bool SheetBuilderPlugin::initialize(NLQT::IPluginManager *pluginManager, QString *errorString) +bool SheetBuilderPlugin::initialize(ExtensionSystem::IPluginManager *pluginManager, QString *errorString) { Q_UNUSED(errorString); _plugMan = pluginManager; @@ -100,6 +100,11 @@ QString SheetBuilderPlugin::description() const return "make_sheet_id equivalent"; } +QList SheetBuilderPlugin::dependencies() const +{ + return QList(); +} + QObject* SheetBuilderPlugin::objectByName(const QString &name) const { Q_FOREACH (QObject *qobj, _plugMan->allObjects()) @@ -108,9 +113,9 @@ QObject* SheetBuilderPlugin::objectByName(const QString &name) const return 0; } -NLQT::IPluginSpec *SheetBuilderPlugin::pluginByName(const QString &name) const +ExtensionSystem::IPluginSpec *SheetBuilderPlugin::pluginByName(const QString &name) const { - Q_FOREACH (NLQT::IPluginSpec *spec, _plugMan->plugins()) + Q_FOREACH (ExtensionSystem::IPluginSpec *spec, _plugMan->plugins()) if (spec->name() == name) return spec; return 0; diff --git a/code/nel/tools/3d/object_viewer_qt/src/plugins/ovqt_sheet_builder/ovqt_sheet_builder.h b/code/nel/tools/3d/object_viewer_qt/src/plugins/ovqt_sheet_builder/ovqt_sheet_builder.h index dc2b18c30..d134c35fc 100644 --- a/code/nel/tools/3d/object_viewer_qt/src/plugins/ovqt_sheet_builder/ovqt_sheet_builder.h +++ b/code/nel/tools/3d/object_viewer_qt/src/plugins/ovqt_sheet_builder/ovqt_sheet_builder.h @@ -28,7 +28,7 @@ namespace NLMISC class CLibraryContext; } -namespace NLQT +namespace ExtensionSystem { class IPluginSpec; } @@ -36,12 +36,12 @@ namespace NLQT namespace Plugin { - class SheetBuilderPlugin : public QObject, public NLQT::IPlugin + class SheetBuilderPlugin : public QObject, public ExtensionSystem::IPlugin { Q_OBJECT - Q_INTERFACES(NLQT::IPlugin) + Q_INTERFACES(ExtensionSystem::IPlugin) public: - bool initialize(NLQT::IPluginManager *pluginManager, QString *errorString); + bool initialize(ExtensionSystem::IPluginManager *pluginManager, QString *errorString); void extensionsInitialized(); void setNelContext(NLMISC::INelContext *nelContext); @@ -50,9 +50,9 @@ namespace Plugin QString version() const; QString vendor() const; QString description() const; - + QList dependencies() const; QObject *objectByName(const QString &name) const; - NLQT::IPluginSpec *pluginByName(const QString &name) const; + ExtensionSystem::IPluginSpec *pluginByName(const QString &name) const; void buildSheet(bool clean); @@ -63,7 +63,7 @@ namespace Plugin NLMISC::CLibraryContext *_LibContext; private: - NLQT::IPluginManager *_plugMan; + ExtensionSystem::IPluginManager *_plugMan; };