diff --git a/BlueBerry/Bundles/org.blueberry.core.runtime/src/internal/berryRegistryObjectFactory.cpp b/BlueBerry/Bundles/org.blueberry.core.runtime/src/internal/berryRegistryObjectFactory.cpp index d464584120..c2487bd056 100644 --- a/BlueBerry/Bundles/org.blueberry.core.runtime/src/internal/berryRegistryObjectFactory.cpp +++ b/BlueBerry/Bundles/org.blueberry.core.runtime/src/internal/berryRegistryObjectFactory.cpp @@ -1,92 +1,96 @@ /*=================================================================== BlueBerry Platform Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #include "berryRegistryObjectFactory.h" #include "berryConfigurationElement.h" #include "berryExtension.h" #include "berryExtensionPoint.h" #include "berryRegistryContribution.h" namespace berry { RegistryObjectFactory::RegistryObjectFactory(ExtensionRegistry* registry) : registry(registry) { } +RegistryObjectFactory::~RegistryObjectFactory() +{ +} + SmartPointer RegistryObjectFactory::CreateContribution(const QString& contributorId, bool persist) { RegistryContribution::Pointer res(new RegistryContribution(contributorId, registry, persist)); return res; } SmartPointer RegistryObjectFactory::CreateExtensionPoint(bool persist) { ExtensionPoint::Pointer res(new ExtensionPoint(registry, persist)); return res; } SmartPointer RegistryObjectFactory::CreateExtensionPoint(int self, const QList children, int dataOffset, bool persist) { ExtensionPoint::Pointer res(new ExtensionPoint(self, children, dataOffset, registry, persist)); return res; } SmartPointer RegistryObjectFactory::CreateExtension(bool persist) { Extension::Pointer res(new Extension(registry, persist)); return res; } SmartPointer RegistryObjectFactory::CreateExtension(int self, const QString& simpleId, const QString& namespaze, const QList& children, int extraData, bool persist) { Extension::Pointer res(new Extension(self, simpleId, namespaze, children, extraData, registry, persist)); return res; } SmartPointer RegistryObjectFactory::CreateConfigurationElement(bool persist) { ConfigurationElement::Pointer res(new ConfigurationElement(registry, persist)); return res; } SmartPointer RegistryObjectFactory::CreateConfigurationElement(int self, const QString& contributorId, const QString& name, const QList& propertiesAndValue, const QList& children, int extraDataOffset, int parent, short parentType, bool persist) { ConfigurationElement::Pointer res(new ConfigurationElement(self, contributorId, name, propertiesAndValue, children, extraDataOffset, parent, parentType, registry, persist)); return res; } } diff --git a/BlueBerry/Bundles/org.blueberry.core.runtime/src/internal/berryRegistryObjectFactory.h b/BlueBerry/Bundles/org.blueberry.core.runtime/src/internal/berryRegistryObjectFactory.h index aec2b0aa53..596da3d451 100644 --- a/BlueBerry/Bundles/org.blueberry.core.runtime/src/internal/berryRegistryObjectFactory.h +++ b/BlueBerry/Bundles/org.blueberry.core.runtime/src/internal/berryRegistryObjectFactory.h @@ -1,81 +1,83 @@ /*=================================================================== BlueBerry Platform Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef BERRYREGISTRYOBJECTFACTORY_H #define BERRYREGISTRYOBJECTFACTORY_H #include namespace berry { template class SmartPointer; class ConfigurationElement; class Extension; class ExtensionPoint; class ExtensionRegistry; class RegistryContribution; /** * A factory method for the creation of the registry objects. */ class RegistryObjectFactory { protected: // The extension registry that this element factory works in ExtensionRegistry* registry; public: RegistryObjectFactory(ExtensionRegistry* registry); + virtual ~RegistryObjectFactory(); + //////////////////////////////////////////////////////////////////////////// // Contribution virtual SmartPointer CreateContribution(const QString& contributorId, bool persist); //////////////////////////////////////////////////////////////////////////// // Extension point virtual SmartPointer CreateExtensionPoint(bool persist); virtual SmartPointer CreateExtensionPoint(int self, const QList children, int dataOffset, bool persist); //////////////////////////////////////////////////////////////////////////// // Extension virtual SmartPointer CreateExtension(bool persist); virtual SmartPointer CreateExtension(int self, const QString& simpleId, const QString& namespaze, const QList& children, int extraData, bool persist); //////////////////////////////////////////////////////////////////////////// // Configuration element virtual SmartPointer CreateConfigurationElement(bool persist); virtual SmartPointer CreateConfigurationElement(int self, const QString& contributorId, const QString& name, const QList& propertiesAndValue, const QList& children, int extraDataOffset, int parent, short parentType, bool persist); }; } #endif // BERRYREGISTRYOBJECTFACTORY_H diff --git a/BlueBerry/Bundles/org.blueberry.ui.qt/src/berryIDropTargetListener.cpp b/BlueBerry/Bundles/org.blueberry.ui.qt/src/berryIDropTargetListener.cpp index e11795cd6d..80ac4580cc 100644 --- a/BlueBerry/Bundles/org.blueberry.ui.qt/src/berryIDropTargetListener.cpp +++ b/BlueBerry/Bundles/org.blueberry.ui.qt/src/berryIDropTargetListener.cpp @@ -1,48 +1,52 @@ /*=================================================================== BlueBerry Platform Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #include "berryIDropTargetListener.h" namespace berry { +IDropTargetListener::~IDropTargetListener() +{ +} + void IDropTargetListener::Events::AddListener(IDropTargetListener* l) { if (l == 0) return; Types t = l->GetDropTargetEventTypes(); if (t & ENTER) dragEnter += DragEnterDelegate(l, &IDropTargetListener::DragEnterEvent); if (t & LEAVE) dragLeave += DragLeaveDelegate(l, &IDropTargetListener::DragLeaveEvent); if (t & MOVE) dragMove += DragMoveDelegate(l, &IDropTargetListener::DragMoveEvent); if (t & DROP) drop += DropDelegate(l, &IDropTargetListener::DropEvent); } void IDropTargetListener::Events::RemoveListener(IDropTargetListener* l) { if (l == 0) return; dragEnter -= DragEnterDelegate(l, &IDropTargetListener::DragEnterEvent); dragLeave -= DragLeaveDelegate(l, &IDropTargetListener::DragLeaveEvent); dragMove -= DragMoveDelegate(l, &IDropTargetListener::DragMoveEvent); drop -= DropDelegate(l, &IDropTargetListener::DropEvent); } } diff --git a/BlueBerry/Bundles/org.blueberry.ui.qt/src/berryIDropTargetListener.h b/BlueBerry/Bundles/org.blueberry.ui.qt/src/berryIDropTargetListener.h index 73bb89e410..911ff7bc83 100644 --- a/BlueBerry/Bundles/org.blueberry.ui.qt/src/berryIDropTargetListener.h +++ b/BlueBerry/Bundles/org.blueberry.ui.qt/src/berryIDropTargetListener.h @@ -1,82 +1,84 @@ /*=================================================================== BlueBerry Platform Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef BERRYIDROPTARGETLISTENER_H #define BERRYIDROPTARGETLISTENER_H #include #include "berryMessage.h" class QDragEnterEvent; class QDragLeaveEvent; class QDragMoveEvent; class QDropEvent; namespace berry { struct BERRY_UI_QT IDropTargetListener { + virtual ~IDropTargetListener(); + struct Events { enum Type { NONE = 0x00000000, ENTER = 0x00000001, LEAVE = 0x00000002, MOVE = 0x00000004, DROP = 0x00000008, ALL = 0xffffffff }; Q_DECLARE_FLAGS(Types, Type) typedef Message1 DragEnterEventType; typedef Message1 DragLeaveEventType; typedef Message1 DragMoveEventType; typedef Message1 DropEventType; DragEnterEventType dragEnter; DragLeaveEventType dragLeave; DragMoveEventType dragMove; DropEventType drop; void AddListener(IDropTargetListener* listener); void RemoveListener(IDropTargetListener* listener); private: typedef MessageDelegate1 DragEnterDelegate; typedef MessageDelegate1 DragLeaveDelegate; typedef MessageDelegate1 DragMoveDelegate; typedef MessageDelegate1 DropDelegate; }; virtual Events::Types GetDropTargetEventTypes() const = 0; virtual void DragEnterEvent(QDragEnterEvent* /*event*/) {} virtual void DragLeaveEvent(QDragLeaveEvent* /*event*/) {} virtual void DragMoveEvent(QDragMoveEvent* /*event*/) {} virtual void DropEvent(QDropEvent* /*event*/) {} }; } Q_DECLARE_OPERATORS_FOR_FLAGS(berry::IDropTargetListener::Events::Types) #endif // BERRYIDROPTARGETLISTENER_H