From 77cd0b84e1cef83a4fa9b77663cea65b42355f7a Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Sat, 21 Nov 2015 19:53:31 +0100 Subject: Fix Pugl compilation for at least X11. Minor refactoring of NativeWindowPugl. --- plugingui/nativewindow_pugl.h | 58 +++++++++++++++++++++---------------------- 1 file changed, 28 insertions(+), 30 deletions(-) (limited to 'plugingui/nativewindow_pugl.h') diff --git a/plugingui/nativewindow_pugl.h b/plugingui/nativewindow_pugl.h index cf761fd..f5d89ab 100644 --- a/plugingui/nativewindow_pugl.h +++ b/plugingui/nativewindow_pugl.h @@ -24,49 +24,47 @@ * along with DrumGizmo; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -#ifndef __DRUMGIZMO_NATIVEWINDOW_PUGL_H__ -#define __DRUMGIZMO_NATIVEWINDOW_PUGL_H__ -#endif/*__DRUMGIZMO_NATIVEWINDOW_PUGL_H__*/ +#pragma once #include "nativewindow.h" - -#include "window.h" - #include "pugl.h" -#ifdef __APPLE__ -# include -#else -# include -# include -# include -#endif +#include namespace GUI { +class Event; class Window; + class NativeWindowPugl : public NativeWindow { public: - NativeWindowPugl(GUI::Window *window); - ~NativeWindowPugl(); + NativeWindowPugl(Window *window); + ~NativeWindowPugl(); - void init(); - void setFixedSize(int width, int height); - void resize(int width, int height); - void move(int x, int y); - void show(); - void setCaption(const std::string &caption); - void hide(); - void handleBuffer(); - void redraw(); - void grabMouse(bool grab); + void init(); + void setFixedSize(int width, int height); + void resize(int width, int height); + void move(int x, int y); + void show(); + void setCaption(const std::string &caption); + void hide(); + void handleBuffer(); + void redraw(); + void grabMouse(bool grab); - bool hasEvent(); - Event *getNextEvent(); + bool hasEvent(); + Event *getNextEvent(); private: - GUI::Window *window; - PuglView* view; -}; + Window* window{nullptr}; + PuglView* view{nullptr}; + + std::list eventq; + // Internal pugl c-callbacks + static void onDisplay(PuglView* view); + static void onMouse(PuglView* view, int button, bool press, int x, int y); + static void onKeyboard(PuglView* view, bool press, uint32_t key); }; + +} // GUI:: -- cgit v1.2.3