Changed: #1193 Updated object viewer plugin with latest API changes to OVQT plugin system. Added the plugin-spec file.

This commit is contained in:
dnk-88 2011-09-26 01:36:02 +03:00
parent 54b76eec02
commit 7471561ba0
9 changed files with 78 additions and 102 deletions

View file

@ -52,7 +52,7 @@
#include "object_viewer_constants.h" #include "object_viewer_constants.h"
#include "../core/icore.h" #include "../core/icore.h"
#include "../core/imenu_manager.h" #include "../core/menu_manager.h"
#include "../core/core_constants.h" #include "../core/core_constants.h"
using namespace std; using namespace std;
@ -259,7 +259,7 @@ void CMainWindow::createActions()
void CMainWindow::createMenus() void CMainWindow::createMenus()
{ {
Core::IMenuManager *menuManager = Core::ICore::instance()->menuManager(); Core::MenuManager *menuManager = Core::ICore::instance()->menuManager();
_openAction = menuManager->action(Core::Constants::OPEN); _openAction = menuManager->action(Core::Constants::OPEN);

View file

@ -22,76 +22,76 @@ namespace NLQT
{ {
namespace Constants namespace Constants
{ {
const char * const OBJECT_VIEWER_PLUGIN = "ObjectViewer"; const char *const OBJECT_VIEWER_PLUGIN = "ObjectViewer";
//mainwindow //mainwindow
const char * const MAIN_WINDOW = "ObjectViewer.MainWindow"; const char *const MAIN_WINDOW = "ObjectViewer.MainWindow";
//settings //settings
const char * const OBJECT_VIEWER_SECTION = "ObjectViewer"; const char *const OBJECT_VIEWER_SECTION = "ObjectViewer";
const char * const GRAPHICS_DRIVER = "GraphicsDriver"; const char *const GRAPHICS_DRIVER = "GraphicsDriver";
const char * const ENABLE_BLOOM = "EnableBloom"; const char *const ENABLE_BLOOM = "EnableBloom";
const char * const ENABLE_SQUARE_BLOOM = "EnableSquareBloom"; const char *const ENABLE_SQUARE_BLOOM = "EnableSquareBloom";
const char * const BLOOM_DENSITY = "BloomDensity"; const char *const BLOOM_DENSITY = "BloomDensity";
const char * const QT_STYLE = "QtStyle"; const char *const QT_STYLE = "QtStyle";
const char * const QT_PALETTE = "QtPalette"; const char *const QT_PALETTE = "QtPalette";
const char * const FONT = "Font"; const char *const FONT = "Font";
const char * const SOUND_ENABLE = "SoundEnable"; const char *const SOUND_ENABLE = "SoundEnable";
const char * const SOUND_DRIVER = "SoundDriver"; const char *const SOUND_DRIVER = "SoundDriver";
const char * const SOUND_DEVICE = "SoundDevice"; const char *const SOUND_DEVICE = "SoundDevice";
const char * const SOUND_AUTO_LOAD_SAMPLE = "SoundAutoLoadSample"; const char *const SOUND_AUTO_LOAD_SAMPLE = "SoundAutoLoadSample";
const char * const SOUND_ENABLE_OCCLUDE_OBSTRUCT = "SoundEnableOccludeObstruct"; const char *const SOUND_ENABLE_OCCLUDE_OBSTRUCT = "SoundEnableOccludeObstruct";
const char * const SOUND_ENABLE_REVERB = "SoundEnableReverb"; const char *const SOUND_ENABLE_REVERB = "SoundEnableReverb";
const char * const SOUND_MANUAL_ROLL_OFF = "SoundManualRolloff"; const char *const SOUND_MANUAL_ROLL_OFF = "SoundManualRolloff";
const char * const SOUND_FORCE_SOFTWARE = "SoundForceSoftware"; const char *const SOUND_FORCE_SOFTWARE = "SoundForceSoftware";
const char * const SOUND_USE_ADCPM = "SoundUseADPCM"; const char *const SOUND_USE_ADCPM = "SoundUseADPCM";
const char * const SOUND_MAX_TRACK = "SoundMaxTrack"; const char *const SOUND_MAX_TRACK = "SoundMaxTrack";
const char * const SOUND_PACKED_SHEET_PATH = "SoundPackedSheetPath"; const char *const SOUND_PACKED_SHEET_PATH = "SoundPackedSheetPath";
const char * const SOUND_SAMPLE_PATH = "SoundSamplePath"; const char *const SOUND_SAMPLE_PATH = "SoundSamplePath";
const char * const VEGET_TILE_BANK = "VegetTileBank"; const char *const VEGET_TILE_BANK = "VegetTileBank";
const char * const VEGET_TILE_FAR_BANK = "VegetTileFarBank"; const char *const VEGET_TILE_FAR_BANK = "VegetTileFarBank";
const char * const VEGET_TEXTURE = "VegetTexture"; const char *const VEGET_TEXTURE = "VegetTexture";
const char * const VEGET_LANDSCAPE_ZONES = "VegetLandscapeZones"; const char *const VEGET_LANDSCAPE_ZONES = "VegetLandscapeZones";
const char * const COARSE_MESH_TEXTURE = "CoarseMeshTexture"; const char *const COARSE_MESH_TEXTURE = "CoarseMeshTexture";
const char * const ICON_ADD_ITEM = ":/icons/ic_nel_add_item.png"; const char *const ICON_ADD_ITEM = ":/icons/ic_nel_add_item.png";
const char * const ICON_INSERT_ITEM = ":/icons/ic_nel_insert_item.png"; const char *const ICON_INSERT_ITEM = ":/icons/ic_nel_insert_item.png";
const char * const ICON_DELETE_ITEM = ":/icons/ic_nel_delete_item.png"; const char *const ICON_DELETE_ITEM = ":/icons/ic_nel_delete_item.png";
const char * const ICON_DOWN_ITEM = ":/icons/ic_nel_down_item.png"; const char *const ICON_DOWN_ITEM = ":/icons/ic_nel_down_item.png";
const char * const ICON_UP_ITEM = ":/icons/ic_nel_up_item.png"; const char *const ICON_UP_ITEM = ":/icons/ic_nel_up_item.png";
const char * const ICON_CAMERA_ADD = ":/icons/ic_nel_camera_add.png"; const char *const ICON_CAMERA_ADD = ":/icons/ic_nel_camera_add.png";
const char * const ICON_CAMERA_DEL = ":/icons/ic_nel_camera_del.png"; const char *const ICON_CAMERA_DEL = ":/icons/ic_nel_camera_del.png";
const char * const ICON_CAMERA_3DEDIT = ":/icons/ic_nel_camera_3dedit.png"; const char *const ICON_CAMERA_3DEDIT = ":/icons/ic_nel_camera_3dedit.png";
const char * const ICON_CAMERA_FPS = ":/icons/ic_nel_camera_fps.png"; const char *const ICON_CAMERA_FPS = ":/icons/ic_nel_camera_fps.png";
const char * const ICON_RESET_CAMERA = ":/icons/ic_nel_reset_camera.png"; const char *const ICON_RESET_CAMERA = ":/icons/ic_nel_reset_camera.png";
const char * const ICON_ANIM = ":/icons/ic_nel_anim.png"; const char *const ICON_ANIM = ":/icons/ic_nel_anim.png";
const char * const ICON_ANIMSET = ":/icons/ic_nel_animset.png"; const char *const ICON_ANIMSET = ":/icons/ic_nel_animset.png";
const char * const ICON_BGCOLOR = ":/icons/ic_nel_bgcolor.png"; const char *const ICON_BGCOLOR = ":/icons/ic_nel_bgcolor.png";
const char * const ICON_DAYNIGHT = ":/icons/ic_nel_daynight.png"; const char *const ICON_DAYNIGHT = ":/icons/ic_nel_daynight.png";
const char * const ICON_FRAMEDELAY = ":/icons/ic_nel_framedelay.png"; const char *const ICON_FRAMEDELAY = ":/icons/ic_nel_framedelay.png";
const char * const ICON_MIXER = ":/icons/ic_nel_mixer.png"; const char *const ICON_MIXER = ":/icons/ic_nel_mixer.png";
const char * const ICON_MRM_MESH = ":/icons/ic_nel_mrm_mesh.png"; const char *const ICON_MRM_MESH = ":/icons/ic_nel_mrm_mesh.png";
const char * const ICON_PARTICLES = ":/icons/ic_nel_particles.png"; const char *const ICON_PARTICLES = ":/icons/ic_nel_particles.png";
const char * const ICON_SKELSCALE = ":/icons/ic_nel_skelscale.png"; const char *const ICON_SKELSCALE = ":/icons/ic_nel_skelscale.png";
const char * const ICON_VEGET = ":/icons/ic_nel_veget.png"; const char *const ICON_VEGET = ":/icons/ic_nel_veget.png";
const char * const ICON_VEGETSET = ":/icons/ic_nel_vegetset.png"; const char *const ICON_VEGETSET = ":/icons/ic_nel_vegetset.png";
const char * const ICON_WATER = ":/icons/ic_nel_water.png"; const char *const ICON_WATER = ":/icons/ic_nel_water.png";
const char * const ICON_WIND = ":/icons/ic_nel_wind.png"; const char *const ICON_WIND = ":/icons/ic_nel_wind.png";
const char * const ICON_COLLISION_ZONE_ITEM_SMALL = ":/icons/particles_system_24/ic_nel_collision_zone_item_24.png"; const char *const ICON_COLLISION_ZONE_ITEM_SMALL = ":/icons/particles_system_24/ic_nel_collision_zone_item_24.png";
const char * const ICON_EMITTER_ITEM_SMALL = ":/icons/particles_system_24/ic_nel_emitter_item_24.png"; const char *const ICON_EMITTER_ITEM_SMALL = ":/icons/particles_system_24/ic_nel_emitter_item_24.png";
const char * const ICON_FORCE_ITEM_SMALL = ":/icons/particles_system_24/ic_nel_force_item_24.png"; const char *const ICON_FORCE_ITEM_SMALL = ":/icons/particles_system_24/ic_nel_force_item_24.png";
const char * const ICON_INSTANCE_ITEM_SMALL = ":/icons/particles_system_24/ic_nel_instance_item_24.png"; const char *const ICON_INSTANCE_ITEM_SMALL = ":/icons/particles_system_24/ic_nel_instance_item_24.png";
const char * const ICON_LIGHT_ITEM_SMALL = ":/icons/particles_system_24/ic_nel_light_item_24.png"; const char *const ICON_LIGHT_ITEM_SMALL = ":/icons/particles_system_24/ic_nel_light_item_24.png";
const char * const ICON_LOCATED_ITEM_SMALL = ":/icons/particles_system_24/ic_nel_located_item_24.png"; const char *const ICON_LOCATED_ITEM_SMALL = ":/icons/particles_system_24/ic_nel_located_item_24.png";
const char * const ICON_PARTICLE_ITEM_SMALL = ":/icons/particles_system_24/ic_nel_particle_item_24.png"; const char *const ICON_PARTICLE_ITEM_SMALL = ":/icons/particles_system_24/ic_nel_particle_item_24.png";
const char * const ICON_PARTICLE_SYSTEM_SMALL = ":/icons/particles_system_24/ic_nel_particle_system_24.png"; const char *const ICON_PARTICLE_SYSTEM_SMALL = ":/icons/particles_system_24/ic_nel_particle_system_24.png";
const char * const ICON_PARTICLE_SYSTEM_CLOSE_SMALL = ":/icons/particles_system_24/ic_nel_particle_system_close_24.png"; const char *const ICON_PARTICLE_SYSTEM_CLOSE_SMALL = ":/icons/particles_system_24/ic_nel_particle_system_close_24.png";
const char * const ICON_PARTICLES_SMALL = ":/icons/particles_system_24/ic_nel_particles_24.png"; const char *const ICON_PARTICLES_SMALL = ":/icons/particles_system_24/ic_nel_particles_24.png";
const char * const ICON_SOUND_ITEM_SMALL = ":/icons/particles_system_24/ic_nel_sound_item_24.png"; const char *const ICON_SOUND_ITEM_SMALL = ":/icons/particles_system_24/ic_nel_sound_item_24.png";
const char * const ICON_WORKSPACE_ITEM_SMALL = ":/icons/particles_system_24/ic_nel_workspace_item_24.png"; const char *const ICON_WORKSPACE_ITEM_SMALL = ":/icons/particles_system_24/ic_nel_workspace_item_24.png";
} // namespace Constants } // namespace Constants
} // namespace NLQT } // namespace NLQT

View file

@ -56,33 +56,6 @@ void ObjectViewerPlugin::setNelContext(NLMISC::INelContext *nelContext)
_LibContext = new NLMISC::CLibraryContext(*nelContext); _LibContext = new NLMISC::CLibraryContext(*nelContext);
} }
QString ObjectViewerPlugin::name() const
{
return "ObjectViewer";
}
QString ObjectViewerPlugin::version() const
{
return "0.8";
}
QString ObjectViewerPlugin::vendor() const
{
return Core::Constants::OVQT_VENDOR;
}
QString ObjectViewerPlugin::description() const
{
return "Object Viewer plugin.";
}
QStringList ObjectViewerPlugin::dependencies() const
{
QStringList list;
list.append(Core::Constants::OVQT_CORE_PLUGIN);
return list;
}
void ObjectViewerPlugin::addAutoReleasedObject(QObject *obj) void ObjectViewerPlugin::addAutoReleasedObject(QObject *obj)
{ {
_plugMan->addObject(obj); _plugMan->addObject(obj);

View file

@ -36,15 +36,8 @@ public:
bool initialize(ExtensionSystem::IPluginManager *pluginManager, QString *errorString); bool initialize(ExtensionSystem::IPluginManager *pluginManager, QString *errorString);
void extensionsInitialized(); void extensionsInitialized();
void shutdown(); void shutdown();
void setNelContext(NLMISC::INelContext *nelContext); void setNelContext(NLMISC::INelContext *nelContext);
QString name() const;
QString version() const;
QString vendor() const;
QString description() const;
QStringList dependencies() const;
void addAutoReleasedObject(QObject *obj); void addAutoReleasedObject(QObject *obj);
protected: protected:

View file

@ -0,0 +1,10 @@
<plugin-spec>
<library-name>ovqt_plugin_object_viewer</library-name>
<name>ObjectViewer</name>
<version>0.8</version>
<vendor>Ryzom Core</vendor>
<description>Object Viewer plugin.</description>
<dependencies>
<dependency plugin-name="Core" version="0.8"/>
</dependencies>
</plugin-spec>

View file

@ -43,7 +43,7 @@ namespace NLQT
class CLocatedItem: public QListWidgetItem class CLocatedItem: public QListWidgetItem
{ {
public: public:
CLocatedItem ( const QString & text, QListWidget *parent = 0, int type = UserType ): CLocatedItem ( const QString &text, QListWidget *parent = 0, int type = UserType ):
QListWidgetItem(text, parent, type), _loc(NULL) {} QListWidgetItem(text, parent, type), _loc(NULL) {}
void setUserData(NL3D::CPSLocated *loc) void setUserData(NL3D::CPSLocated *loc)

View file

@ -332,7 +332,7 @@ public:
/// Restick all objects, useful after loading /// Restick all objects, useful after loading
void restickAllObjects(); void restickAllObjects();
TNodeVect& getNodeList() TNodeVect &getNodeList()
{ {
return _Nodes; return _Nodes;
} }

View file

@ -44,7 +44,7 @@ namespace NLQT
class CLocatedBindableItem: public QListWidgetItem class CLocatedBindableItem: public QListWidgetItem
{ {
public: public:
CLocatedBindableItem ( const QString & text, QListWidget * parent = 0, int type = UserType ): CLocatedBindableItem ( const QString &text, QListWidget *parent = 0, int type = UserType ):
QListWidgetItem(text, parent, type), _lb(NULL) {} QListWidgetItem(text, parent, type), _lb(NULL) {}
void setUserData(NL3D::CPSLocatedBindable *loc) void setUserData(NL3D::CPSLocatedBindable *loc)

View file

@ -190,7 +190,7 @@ NLSOUND::USource *CSoundSystem::create(const std::string &soundName)
return NULL; return NULL;
} }
void CSoundSystem::playAnimation(std::string& name, float lastTime, float curTime, NLSOUND::CSoundContext &context) void CSoundSystem::playAnimation(std::string &name, float lastTime, float curTime, NLSOUND::CSoundContext &context)
{ {
if (_AnimManager == NULL) if (_AnimManager == NULL)
{ {