summaryrefslogtreecommitdiff
path: root/plugingui/eventhandler.h
diff options
context:
space:
mode:
Diffstat (limited to 'plugingui/eventhandler.h')
-rw-r--r--plugingui/eventhandler.h37
1 files changed, 18 insertions, 19 deletions
diff --git a/plugingui/eventhandler.h b/plugingui/eventhandler.h
index 028418d..b865cbb 100644
--- a/plugingui/eventhandler.h
+++ b/plugingui/eventhandler.h
@@ -24,39 +24,38 @@
* along with DrumGizmo; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
-#ifndef __DRUMGIZMO_EVENTHANDLER_H__
-#define __DRUMGIZMO_EVENTHANDLER_H__
+#pragma once
#include "guievent.h"
#include "nativewindow.h"
-//#include "window.h"
+#include "notifier.h"
namespace GUI {
+
class Window;
class EventHandler {
public:
- EventHandler(NativeWindow *native, Window *window);
-
- void processEvents();
+ EventHandler(NativeWindow *nativeWindow, Window *window);
- bool hasEvent();
- Event *getNextEvent();
+ //! \brief Process all evebts currently in the event queue.
+ void processEvents();
- void registerCloseHandler(void (*handler)(void *), void *ptr);
+ //! \brief Query if any events are currently in the event queue.
+ bool hasEvent();
-private:
- Window *window;
- int last_click;
- void (*closeHandler)(void *);
- void *closeHandlerPtr;
+ //! \brief Get a single event from the event queue.
+ //! \return A pointer to the event or nullptr if there are none.
+ Event *getNextEvent();
- // Used to ignore mouse button release after a double click.
- bool last_was_dbl_click;
+ Notifier<> closeNotifier;
- NativeWindow *native;
-};
+private:
+ Window *window;
+ NativeWindow *nativeWindow;
+ // Used to ignore mouse button release after a double click.
+ bool lastWasDoubleClick;
};
-#endif/*__DRUMGIZMO_EVENTHANDLER_H__*/
+} // GUI::