summaryrefslogtreecommitdiff
path: root/plugingui/window.cc
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2013-05-08 14:56:19 +0200
committerBent Bisballe Nyeng <deva@aasimon.org>2013-05-08 14:56:19 +0200
commit895c942289c81ca24346d3bb18d2b922ae469554 (patch)
tree58a5ad2ae9ad311bfa59daaa8114a83b5277c3c5 /plugingui/window.cc
parent8cacd4e097bb969fe6de20d88e98763deef658e6 (diff)
Remove GlobalContext class. Move all native code from EventHandler class to NativeWindowX11 and NativeWindowWin32 classes.
Diffstat (limited to 'plugingui/window.cc')
-rw-r--r--plugingui/window.cc20
1 files changed, 11 insertions, 9 deletions
diff --git a/plugingui/window.cc b/plugingui/window.cc
index 580a3c6..1f98c6f 100644
--- a/plugingui/window.cc
+++ b/plugingui/window.cc
@@ -42,15 +42,9 @@
#include "nativewindow_win32.h"
#endif/*WIN32*/
-GUI::Window *gwindow = NULL;
-
-GUI::Window::Window(GlobalContext *gctx)
+GUI::Window::Window()
: Widget(NULL), wpixbuf(100, 100), back(":bg.png"), logo(":logo.png")
{
- gwindow = this;
-
- this->gctx = gctx;
-
_x = _y = 100;
_width = wpixbuf.width;
_height = wpixbuf.height;
@@ -61,17 +55,25 @@ GUI::Window::Window(GlobalContext *gctx)
_mouseFocus = NULL;
#ifdef X11
- native = new NativeWindowX11(gctx, this);
+ native = new NativeWindowX11(this);
#endif/*X11*/
#ifdef WIN32
- native = new NativeWindowWin32(gctx, this);
+ native = new NativeWindowWin32(this);
#endif/*WIN32*/
+
+ eventhandler = new GUI::EventHandler(native, this);
}
GUI::Window::~Window()
{
delete native;
+ delete eventhandler;
+}
+
+GUI::EventHandler *GUI::Window::eventHandler()
+{
+ return eventhandler;
}
void GUI::Window::setCaption(std::string caption)