summaryrefslogtreecommitdiff
path: root/plugingui/nativewindow_pugl.h
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2015-11-21 19:53:31 +0100
committerBent Bisballe Nyeng <deva@aasimon.org>2015-11-21 19:53:31 +0100
commit77cd0b84e1cef83a4fa9b77663cea65b42355f7a (patch)
treed481d0899536dcae372465d0dd43755b387f3246 /plugingui/nativewindow_pugl.h
parenta9a74c18f5a232a619a883a3bc665a6f9707793c (diff)
Fix Pugl compilation for at least X11. Minor refactoring of NativeWindowPugl.
Diffstat (limited to 'plugingui/nativewindow_pugl.h')
-rw-r--r--plugingui/nativewindow_pugl.h58
1 files changed, 28 insertions, 30 deletions
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 <OpenGL/glu.h>
-#else
-# include <GL/glu.h>
-# include <GL/glext.h>
-# include <GL/gl.h>
-#endif
+#include <list>
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<Event*> 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::