From e0570881958583911a61a0d0653c8eca83545ec7 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Sat, 4 Sep 2021 07:39:27 -0600 Subject: [PATCH] remove unused, empty glib event source/callback code (was from an experiment during nutempo2 development) --- libs/gtkmm2ext/gtk_ui.cc | 12 ----------- libs/gtkmm2ext/gtkmm2ext/gtk_ui.h | 5 ----- libs/pbd/base_ui.cc | 7 ------- libs/pbd/glib_event_source.cc | 19 ------------------ libs/pbd/pbd/base_ui.h | 3 --- libs/pbd/pbd/glib_event_source.h | 33 ------------------------------- libs/pbd/wscript | 1 - 7 files changed, 80 deletions(-) delete mode 100644 libs/pbd/glib_event_source.cc delete mode 100644 libs/pbd/pbd/glib_event_source.h diff --git a/libs/gtkmm2ext/gtk_ui.cc b/libs/gtkmm2ext/gtk_ui.cc index b7fa23d1d3..d3335e3476 100644 --- a/libs/gtkmm2ext/gtk_ui.cc +++ b/libs/gtkmm2ext/gtk_ui.cc @@ -73,17 +73,11 @@ BaseUI::RequestType Gtkmm2ext::AddTimeout = BaseUI::new_request_type(); template class AbstractUI; -void -UI::event_loop_precall () -{ -} - UI::UI (string application_name, string thread_name, int *argc, char ***argv) : AbstractUI (thread_name) , _receiver (*this) , global_bindings (0) , errors (0) - , event_callback (boost::bind (&UI::event_loop_precall, this)) { theMain = new Main (argc, argv); @@ -117,12 +111,6 @@ UI::UI (string application_name, string thread_name, int *argc, char ***argv) EventLoop::register_request_buffer_factory ("gui", request_buffer_factory); - /* - * every time the main loop runs (i.e. before any actual event handling - */ - - event_callback.attach (MainContext::get_default()); - /* attach our request source to the default main context */ attach_request_source (); diff --git a/libs/gtkmm2ext/gtkmm2ext/gtk_ui.h b/libs/gtkmm2ext/gtkmm2ext/gtk_ui.h index cc38766d54..af3d29ed89 100644 --- a/libs/gtkmm2ext/gtkmm2ext/gtk_ui.h +++ b/libs/gtkmm2ext/gtkmm2ext/gtk_ui.h @@ -50,7 +50,6 @@ #define ABSTRACT_UI_EXPORTS #endif #include "pbd/abstract_ui.h" -#include "pbd/glib_event_source.h" #include "pbd/ringbufferNPT.h" #include "pbd/pool.h" #include "pbd/error.h" @@ -171,8 +170,6 @@ protected: Glib::RefPtr ptag, Glib::RefPtr mtag, const char *msg); - virtual void event_loop_precall (); - private: static UI *theGtkUI; @@ -205,8 +202,6 @@ private: bool color_picked; void do_request (UIRequest*); - - GlibEventLoopCallback event_callback; }; } /* namespace */ diff --git a/libs/pbd/base_ui.cc b/libs/pbd/base_ui.cc index e2f368527f..96cffa55e9 100644 --- a/libs/pbd/base_ui.cc +++ b/libs/pbd/base_ui.cc @@ -60,7 +60,6 @@ BaseUI::BaseUI (const string& loop_name) , m_context(MainContext::get_default()) , run_loop_thread (0) , request_channel (true) - , glib_event_callback (boost::bind (&BaseUI::event_loop_precall, this)) { base_ui_instance = this; request_channel.set_receive_handler (sigc::mem_fun (*this, &BaseUI::request_handler)); @@ -121,12 +120,6 @@ BaseUI::run () _main_loop = MainLoop::create (m_context); attach_request_source (); - /* - * every time the main loop runs (i.e. before any actual event handling) - */ - - glib_event_callback.attach (m_context); - Glib::Threads::Mutex::Lock lm (_run_lock); run_loop_thread = Glib::Threads::Thread::create (mem_fun (*this, &BaseUI::main_thread)); _running.wait (_run_lock); diff --git a/libs/pbd/glib_event_source.cc b/libs/pbd/glib_event_source.cc deleted file mode 100644 index 59ae3d7c86..0000000000 --- a/libs/pbd/glib_event_source.cc +++ /dev/null @@ -1,19 +0,0 @@ -#include "pbd/glib_event_source.h" - -bool -GlibEventLoopSource::prepare (int& timeout) -{ - return false; -} - -bool -GlibEventLoopSource::check () -{ - return false; -} - -bool -GlibEventLoopSource::dispatch (sigc::slot_base*) -{ - return false; -} diff --git a/libs/pbd/pbd/base_ui.h b/libs/pbd/pbd/base_ui.h index 0d10308392..a17dc33b01 100644 --- a/libs/pbd/pbd/base_ui.h +++ b/libs/pbd/pbd/base_ui.h @@ -33,7 +33,6 @@ #include "pbd/libpbd_visibility.h" #include "pbd/crossthread.h" #include "pbd/event_loop.h" -#include "pbd/glib_event_source.h" #include "pbd/pthread_utils.h" /** A BaseUI is an abstraction designed to be used with any "user @@ -129,8 +128,6 @@ class LIBPBD_API BaseUI : public sigc::trackable, public PBD::EventLoop int setup_request_pipe (); void main_thread (); - - GlibEventLoopCallback glib_event_callback; }; #endif /* __pbd_base_ui_h__ */ diff --git a/libs/pbd/pbd/glib_event_source.h b/libs/pbd/pbd/glib_event_source.h deleted file mode 100644 index 3a90610f99..0000000000 --- a/libs/pbd/pbd/glib_event_source.h +++ /dev/null @@ -1,33 +0,0 @@ -#ifndef __libpbd_glib_event_source_h__ -#define __libpbd_glib_event_source_h__ - -#include - -#include - -class LIBPBD_API GlibEventLoopSource : public Glib::Source -{ - public: - GlibEventLoopSource () {}; - - bool prepare (int& timeout); - bool check(); - bool dispatch (sigc::slot_base*); -}; - - -class LIBPBD_API GlibEventLoopCallback : public GlibEventLoopSource -{ - public: - GlibEventLoopCallback (boost::function callback) : _callback (callback) {} - - bool check() { - _callback(); - return false; - } - - private: - boost::function _callback; -}; - -#endif /* __libpbd_glib_event_source_h__ */ diff --git a/libs/pbd/wscript b/libs/pbd/wscript index f0e45d7146..60aca6f24c 100644 --- a/libs/pbd/wscript +++ b/libs/pbd/wscript @@ -51,7 +51,6 @@ libpbd_sources = [ 'file_archive.cc', 'file_utils.cc', 'fpu.cc', - 'glib_event_source.cc', 'id.cc', 'locale_guard.cc', 'localtime_r.cc',