summaryrefslogtreecommitdiff
path: root/src/wx
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2012-10-24 19:49:14 +0100
committerCarl Hetherington <cth@carlh.net>2012-10-24 19:49:14 +0100
commit17830349b580b5933589f2b739671828b5cfc208 (patch)
tree9b81623c16cf4d899458a87d32337c4b7b7b0e39 /src/wx
parentbd8fa9a370f1739952c83107352baa08c79d095e (diff)
Cross-thread UI signalling.
Diffstat (limited to 'src/wx')
-rw-r--r--src/wx/wscript1
-rw-r--r--src/wx/wx_ui_signaller.cc34
-rw-r--r--src/wx/wx_ui_signaller.h32
3 files changed, 67 insertions, 0 deletions
diff --git a/src/wx/wscript b/src/wx/wscript
index df2edbde1..41514c5b1 100644
--- a/src/wx/wscript
+++ b/src/wx/wscript
@@ -24,6 +24,7 @@ def build(bld):
properties_dialog.cc
server_dialog.cc
wx_util.cc
+ wx_ui_signaller.cc
"""
# alignment.cc
diff --git a/src/wx/wx_ui_signaller.cc b/src/wx/wx_ui_signaller.cc
new file mode 100644
index 000000000..2e926edc6
--- /dev/null
+++ b/src/wx/wx_ui_signaller.cc
@@ -0,0 +1,34 @@
+/*
+ Copyright (C) 2012 Carl Hetherington <cth@carlh.net>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+*/
+
+#include <wx/wx.h>
+#include "wx_ui_signaller.h"
+
+wxUISignaller::wxUISignaller (wxEvtHandler* h)
+ : _handler (h)
+{
+
+}
+
+void
+wxUISignaller::wake_ui ()
+{
+ wxCommandEvent event (-1, -1);
+ _handler->AddPendingEvent (event);
+}
diff --git a/src/wx/wx_ui_signaller.h b/src/wx/wx_ui_signaller.h
new file mode 100644
index 000000000..d134d2b6d
--- /dev/null
+++ b/src/wx/wx_ui_signaller.h
@@ -0,0 +1,32 @@
+/*
+ Copyright (C) 2012 Carl Hetherington <cth@carlh.net>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+*/
+
+#include "ui_signaller.h"
+
+class wxEvtHandler;
+
+class wxUISignaller : public UISignaller
+{
+public:
+ wxUISignaller (wxEvtHandler *);
+ void wake_ui ();
+
+private:
+ wxEvtHandler* _handler;
+};