From 895c942289c81ca24346d3bb18d2b922ae469554 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Wed, 8 May 2013 14:56:19 +0200 Subject: Remove GlobalContext class. Move all native code from EventHandler class to NativeWindowX11 and NativeWindowWin32 classes. --- plugingui/window.cc | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'plugingui/window.cc') 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) -- cgit v1.2.3