diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2013-05-08 14:56:19 +0200 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2013-05-08 14:56:19 +0200 |
commit | 895c942289c81ca24346d3bb18d2b922ae469554 (patch) | |
tree | 58a5ad2ae9ad311bfa59daaa8114a83b5277c3c5 /plugingui/plugingui.cc | |
parent | 8cacd4e097bb969fe6de20d88e98763deef658e6 (diff) |
Remove GlobalContext class. Move all native code from EventHandler class to NativeWindowX11 and NativeWindowWin32 classes.
Diffstat (limited to 'plugingui/plugingui.cc')
-rw-r--r-- | plugingui/plugingui.cc | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/plugingui/plugingui.cc b/plugingui/plugingui.cc index 3c2cb4c..5b2f2e3 100644 --- a/plugingui/plugingui.cc +++ b/plugingui/plugingui.cc @@ -29,7 +29,6 @@ #include <hugin.hpp> #include <stdio.h> -#include "globalcontext.h" #include "knob.h" #include "verticalline.h" @@ -184,9 +183,7 @@ PluginGUI::PluginGUI(DrumGizmo *drumgizmo) this->drumgizmo = drumgizmo; - gctx = NULL; window = NULL; - eventhandler = NULL; running = true; closing = false; @@ -231,7 +228,7 @@ void PluginGUI::thread_main() if(!running) break; - eventhandler->processEvents(window); + window->eventHandler()->processEvents(); Message *msg; if((msg = drumgizmo->receiveGUIMessage()) != NULL) { @@ -301,8 +298,6 @@ void PluginGUI::thread_main() void PluginGUI::deinit() { if(window) delete window; - if(eventhandler) delete eventhandler; - if(gctx) delete gctx; } void closeEventHandler(void *ptr) @@ -314,11 +309,10 @@ void closeEventHandler(void *ptr) void PluginGUI::init() { DEBUG(gui, "init"); - gctx = new GUI::GlobalContext(); - eventhandler = new GUI::EventHandler(gctx); - eventhandler->registerCloseHandler(closeEventHandler, (void*)&closing); + window = new GUI::Window(); + window->eventHandler()->registerCloseHandler(closeEventHandler, + (void*)&closing); - window = new GUI::Window(gctx); window->resize(370, 330); window->setCaption("DrumGizmo v"VERSION); @@ -470,7 +464,7 @@ void PluginGUI::init() void PluginGUI::show() { - if(!gctx) init(); + if(!window) init(); window->show(); } @@ -488,7 +482,7 @@ void PluginGUI::processEvents() } #ifndef USE_THREAD - eventhandler->processEvents(window); + window->eventHandler()->processEvents(window); #endif/*USE_THREAD*/ } |