diff --git a/Plugins/org.blueberry.ui.qt/src/guitk/berryGuiTkIControlListener.cpp b/Plugins/org.blueberry.ui.qt/src/guitk/berryGuiTkIControlListener.cpp index af54dec720..56f55f2e04 100755 --- a/Plugins/org.blueberry.ui.qt/src/guitk/berryGuiTkIControlListener.cpp +++ b/Plugins/org.blueberry.ui.qt/src/guitk/berryGuiTkIControlListener.cpp @@ -1,67 +1,55 @@ /*============================================================================ The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center (DKFZ) All rights reserved. Use of this source code is governed by a 3-clause BSD license that can be found in the LICENSE file. ============================================================================*/ #include "berryGuiTkIControlListener.h" namespace berry { namespace GuiTk { IControlListener::~IControlListener() { } void IControlListener::Events ::AddListener(IControlListener::Pointer l) { if (l.IsNull()) return; Types types = l->GetEventTypes(); if (types & MOVED) movedEvent += Delegate(l.GetPointer(), &IControlListener::ControlMoved); if (types & RESIZED) resizedEvent += Delegate(l.GetPointer(), &IControlListener::ControlResized); if (types & ACTIVATED) activatedEvent += Delegate(l.GetPointer(), &IControlListener::ControlActivated); if (types & DESTROYED) destroyedEvent += Delegate(l.GetPointer(), &IControlListener::ControlDestroyed); } void IControlListener::Events ::RemoveListener(IControlListener::Pointer l) { if (l.IsNull()) return; movedEvent -= Delegate(l.GetPointer(), &IControlListener::ControlMoved); resizedEvent -= Delegate(l.GetPointer(), &IControlListener::ControlResized); activatedEvent -= Delegate(l.GetPointer(), &IControlListener::ControlActivated); destroyedEvent -= Delegate(l.GetPointer(), &IControlListener::ControlDestroyed); } -void -IControlListener -::ControlMoved(ControlEvent::Pointer) -{ -} - -void -IControlListener -::ControlResized(ControlEvent::Pointer) -{ -} - } } diff --git a/Plugins/org.blueberry.ui.qt/src/guitk/berryGuiTkIControlListener.h b/Plugins/org.blueberry.ui.qt/src/guitk/berryGuiTkIControlListener.h index a23534de0a..b43a2c3639 100755 --- a/Plugins/org.blueberry.ui.qt/src/guitk/berryGuiTkIControlListener.h +++ b/Plugins/org.blueberry.ui.qt/src/guitk/berryGuiTkIControlListener.h @@ -1,232 +1,232 @@ /*============================================================================ The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center (DKFZ) All rights reserved. Use of this source code is governed by a 3-clause BSD license that can be found in the LICENSE file. ============================================================================*/ #ifndef BERRYGUITKICONTROLLISTENER_H_ #define BERRYGUITKICONTROLLISTENER_H_ #include #include #include #include "berryGuiTkControlEvent.h" namespace berry { namespace GuiTk { /** * Classes which implement this interface provide methods * that deal with the events that are generated by moving * and resizing controls. *

* After creating an instance of a class that implements * this interface it can be added to a control using the * addControlListener method and removed using * the removeControlListener method. When a * control is moved or resized, the appropriate method will * be invoked. *

* * @see ControlAdapter * @see ControlEvent */ struct BERRY_UI_QT IControlListener: public virtual Object { berryObjectMacro(berry::GuiTk::IControlListener); struct BERRY_UI_QT Events { enum Type { NONE = 0x00000000, MOVED = 0x00000001, RESIZED = 0x00000002, ACTIVATED = 0x00000004, DESTROYED = 0x00000008, ALL = 0xffffffff }; Q_DECLARE_FLAGS(Types, Type) typedef Message1 EventType; EventType movedEvent; EventType resizedEvent; EventType activatedEvent; EventType destroyedEvent; void AddListener(IControlListener::Pointer listener); void RemoveListener(IControlListener::Pointer listener); private: typedef MessageDelegate1 Delegate; }; ~IControlListener() override; virtual Events::Types GetEventTypes() const = 0; /** * Sent when the location (x, y) of a control changes relative * to its parent (or relative to the display, for Shells). - * - * @param e an event containing information about the move */ - virtual void ControlMoved(ControlEvent::Pointer e); + virtual void ControlMoved(ControlEvent::Pointer) + { + } /** * Sent when the size (width, height) of a control changes. - * - * @param e an event containing information about the resize */ - virtual void ControlResized(ControlEvent::Pointer e); + virtual void ControlResized(ControlEvent::Pointer) + { + } - virtual void ControlActivated(ControlEvent::Pointer /*e*/) + virtual void ControlActivated(ControlEvent::Pointer) { } - virtual void ControlDestroyed(ControlEvent::Pointer /*e*/) + virtual void ControlDestroyed(ControlEvent::Pointer) { } }; template struct ControlMovedAdapter: public IControlListener { typedef R Listener; typedef void (R::*Callback)(ControlEvent::Pointer); ControlMovedAdapter(R* l, Callback c) : listener(l), callback(c) { poco_assert(listener); poco_assert(callback); } Events::Types GetEventTypes() const override { return Events::MOVED; } void ControlMoved(ControlEvent::Pointer e) override { (listener->*callback)(e); } private: Listener* listener; Callback callback; }; template struct ControlResizedAdapter: public IControlListener { typedef R Listener; typedef void (R::*Callback)(ControlEvent::Pointer); ControlResizedAdapter(R* l, Callback c) : listener(l), callback(c) { poco_assert(listener); poco_assert(callback); } Events::Types GetEventTypes() const override { return Events::RESIZED; } void ControlResized(ControlEvent::Pointer e) override { (listener->*callback)(e); } private: Listener* listener; Callback callback; }; template struct ControlActivatedAdapter: public IControlListener { typedef R Listener; typedef void (R::*Callback)(ControlEvent::Pointer); ControlActivatedAdapter(R* l, Callback c) : listener(l), callback(c) { poco_assert(listener); poco_assert(callback); } Events::Types GetEventTypes() const override { return Events::ACTIVATED; } void ControlActivated(ControlEvent::Pointer e) override { (listener->*callback)(e); } private: Listener* listener; Callback callback; }; template struct ControlDestroyedAdapter: public IControlListener { typedef R Listener; typedef void (R::*Callback)(ControlEvent::Pointer); ControlDestroyedAdapter(R* l, Callback c) : listener(l), callback(c) { poco_assert(listener); poco_assert(callback); } Events::Types GetEventTypes() const override { return Events::DESTROYED; } void ControlDestroyed(ControlEvent::Pointer e) override { (listener->*callback)(e); } private: Listener* listener; Callback callback; }; } } Q_DECLARE_OPERATORS_FOR_FLAGS(berry::GuiTk::IControlListener::Events::Types) #endif /* BERRYGUITKICONTROLLISTENER_H_ */ diff --git a/Plugins/org.blueberry.ui.qt/src/guitk/berryGuiTkISelectionListener.cpp b/Plugins/org.blueberry.ui.qt/src/guitk/berryGuiTkISelectionListener.cpp index af85bed8c0..a150cc481f 100755 --- a/Plugins/org.blueberry.ui.qt/src/guitk/berryGuiTkISelectionListener.cpp +++ b/Plugins/org.blueberry.ui.qt/src/guitk/berryGuiTkISelectionListener.cpp @@ -1,57 +1,45 @@ /*============================================================================ The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center (DKFZ) All rights reserved. Use of this source code is governed by a 3-clause BSD license that can be found in the LICENSE file. ============================================================================*/ #include "berryGuiTkISelectionListener.h" namespace berry { namespace GuiTk { ISelectionListener::~ISelectionListener() { } void ISelectionListener::Events ::AddListener(ISelectionListener::Pointer l) { if (l.IsNull()) return; selected += Delegate(l.GetPointer(), &ISelectionListener::WidgetSelected); defaultSelected += Delegate(l.GetPointer(), &ISelectionListener::WidgetDefaultSelected); } void ISelectionListener::Events ::RemoveListener(ISelectionListener::Pointer l) { if (l.IsNull()) return; selected -= Delegate(l.GetPointer(), &ISelectionListener::WidgetSelected); defaultSelected -= Delegate(l.GetPointer(), &ISelectionListener::WidgetDefaultSelected); } -void -ISelectionListener -::WidgetSelected(SelectionEvent::Pointer) -{ -} - -void -ISelectionListener -::WidgetDefaultSelected(SelectionEvent::Pointer) -{ -} - } } diff --git a/Plugins/org.blueberry.ui.qt/src/guitk/berryGuiTkISelectionListener.h b/Plugins/org.blueberry.ui.qt/src/guitk/berryGuiTkISelectionListener.h index 0d2aac5927..b9360f424c 100755 --- a/Plugins/org.blueberry.ui.qt/src/guitk/berryGuiTkISelectionListener.h +++ b/Plugins/org.blueberry.ui.qt/src/guitk/berryGuiTkISelectionListener.h @@ -1,98 +1,94 @@ /*============================================================================ The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center (DKFZ) All rights reserved. Use of this source code is governed by a 3-clause BSD license that can be found in the LICENSE file. ============================================================================*/ #ifndef BERRYGUITKISELECTIONLISTENER_H_ #define BERRYGUITKISELECTIONLISTENER_H_ #include #include #include "berryGuiTkSelectionEvent.h" namespace berry { namespace GuiTk { /** * Classes which implement this interface provide methods * that deal with the events that are generated when selection * occurs in a control. *

* After creating an instance of a class that implements * this interface it can be added to a control using the * addSelectionListener method and removed using * the removeSelectionListener method. When * selection occurs in a control the appropriate method * will be invoked. *

* * @see SelectionAdapter * @see SelectionEvent */ struct BERRY_UI_QT ISelectionListener: public virtual Object { berryObjectMacro(berry::GuiTk::ISelectionListener); struct BERRY_UI_QT Events { typedef Message1 EventType; EventType selected; EventType defaultSelected; void AddListener(ISelectionListener::Pointer listener); void RemoveListener(ISelectionListener::Pointer listener); private: typedef MessageDelegate1 Delegate; }; ~ISelectionListener() override; /** * Sent when selection occurs in the control. *

* For example, selection occurs in a List when the user selects * an item or items with the keyboard or mouse. On some platforms, * the event occurs when a mouse button or key is pressed. On others, * it happens when the mouse or key is released. The exact key or * mouse gesture that causes this event is platform specific. *

- * - * @param e an event containing information about the selection */ - virtual void WidgetSelected(SelectionEvent::Pointer e); + virtual void WidgetSelected(SelectionEvent::Pointer) {} /** * Sent when default selection occurs in the control. *

* For example, on some platforms default selection occurs in a List * when the user double-clicks an item or types return in a Text. * On some platforms, the event occurs when a mouse button or key is * pressed. On others, it happens when the mouse or key is released. * The exact key or mouse gesture that causes this event is platform * specific. *

- * - * @param e an event containing information about the default selection */ - virtual void WidgetDefaultSelected(SelectionEvent::Pointer e); + virtual void WidgetDefaultSelected(SelectionEvent::Pointer) {} }; } } #endif /* BERRYGUITKISELECTIONLISTENER_H_ */ diff --git a/Plugins/org.mitk.gui.common/src/mitkIRenderWindowPartListener.h b/Plugins/org.mitk.gui.common/src/mitkIRenderWindowPartListener.h index 3e0e9a2f5f..104a1be3c6 100644 --- a/Plugins/org.mitk.gui.common/src/mitkIRenderWindowPartListener.h +++ b/Plugins/org.mitk.gui.common/src/mitkIRenderWindowPartListener.h @@ -1,61 +1,59 @@ /*============================================================================ The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center (DKFZ) All rights reserved. Use of this source code is governed by a 3-clause BSD license that can be found in the LICENSE file. ============================================================================*/ #ifndef MITKIRENDERWINDOWPARTLISTENER_H #define MITKIRENDERWINDOWPARTLISTENER_H #include namespace mitk { struct IRenderWindowPart; /** * \ingroup org_mitk_gui_common * * \brief Interface for berry::IViewPart implementations to be notified about mitk::IRenderWindowPart lifecycle changes. * * This interface is intended to be implemented by subclasses of berry::IWorkbenchPart. If implemented, * the interface methods are called automatically if a Workbench part which implementes mitk::IRenderWindowPart * is activated or deactivated. * * The notion of activated and deactivated is slightly different from the usual Workbench part lifecycle. */ struct MITK_GUI_COMMON_PLUGIN IRenderWindowPartListener { virtual ~IRenderWindowPartListener(); /** * Called when an IRenderWindowPart is activated or if it becomes visible and no * other IRenderWindowPart was activated before. * * \param renderWindowPart The newly activated IRenderWindowPart. */ virtual void RenderWindowPartActivated(mitk::IRenderWindowPart* renderWindowPart) = 0; /** * Called when an IRenderWindowPart becomes invisible and if it was active before. * * \param renderWindowPart The deactivated IRenderWindowPart. */ virtual void RenderWindowPartDeactivated(mitk::IRenderWindowPart* renderWindowPart) = 0; /** * Called when an IRenderWindowPart changes and if it was active before. - * - * \param renderWindowPart The modified IRenderWindowPart. */ - virtual void RenderWindowPartInputChanged(mitk::IRenderWindowPart* renderWindowPart) {}; + virtual void RenderWindowPartInputChanged(mitk::IRenderWindowPart*) {}; }; } #endif // MITKIRENDERWINDOWPARTLISTENER_H