#define __pbd_gtk_ui_h__
#include <string>
-#include <queue>
#include <map>
#include <stdint.h>
#include <setjmp.h>
#include <pthread.h>
+
+#include <glibmm/thread.h>
+
#include <gtkmm/widget.h>
#include <gtkmm/style.h>
+#ifndef GTK_NEW_TOOLTIP_API
+#include <gtkmm/tooltips.h>
+#endif
#include <gtkmm/textbuffer.h>
#include <gtkmm/main.h>
#include <gdkmm/color.h>
#include <pbd/error.h>
#include <pbd/receiver.h>
-using std::string;
-using std::queue;
-
class Touchable;
namespace Gtkmm2ext {
Transmitter::Channel chn;
void *arg;
const char *msg2;
- sigc::slot<void> slot;
~UIRequest () {
if (type == ErrorMessage && msg) {
free ((char *)msg);
}
}
- };
+};
class UI : public Receiver, public AbstractUI<UIRequest>
{
public:
- UI (string name, int *argc, char **argv[]);
+ UI (std::string name, int *argc, char **argv[]);
virtual ~UI ();
static UI *instance() { return theGtkUI; }
bool caller_is_ui_thread ();
- static pthread_t thread_id() { return gui_thread; }
+ static Glib::Thread* thread_id() { return gui_thread; }
/* Gtk-UI specific interfaces */
bool running ();
void quit ();
- void kill ();
- int load_rcfile (string, bool themechange = false);
+ int load_rcfile (std::string, bool themechange = false);
void run (Receiver &old_receiver);
void set_state (Gtk::Widget *w, Gtk::StateType state);
void set_tip (Gtk::Widget *w, const gchar *tip, const gchar *hlp);
void idle_add (int (*func)(void *), void *arg);
+ Gtk::Main& main() const { return *theMain; }
+
template<class T> static bool idle_delete (T *obj) { delete obj; return false; }
template<class T> static void delete_when_idle (T *obj) {
Glib::signal_idle().connect (bind (slot (&UI::idle_delete<T>), obj));
}
- Gdk::Color get_color (const string& prompt, bool& picked, const Gdk::Color *initial = 0);
+ Gdk::Color get_color (const std::string& prompt, bool& picked, const Gdk::Color *initial = 0);
/* starting is sent just before we enter the main loop,
stopping just after we return from it (at the top level)
static bool just_hide_it (GdkEventAny *, Gtk::Window *);
- static pthread_t the_gui_thread() { return gui_thread; }
+ static Glib::Thread* the_gui_thread() { return gui_thread; }
protected:
virtual void handle_fatal (const char *);
- virtual void display_message (const char *prefix, gint prefix_len,
- Glib::RefPtr<Gtk::TextBuffer::Tag> ptag,
- Glib::RefPtr<Gtk::TextBuffer::Tag> mtag,
- const char *msg);
+ virtual void display_message (const char *prefix, gint prefix_len,
+ Glib::RefPtr<Gtk::TextBuffer::Tag> ptag, Glib::RefPtr<Gtk::TextBuffer::Tag> mtag,
+ const char *msg);
private:
static UI *theGtkUI;
- static pthread_t gui_thread;
+ static Glib::Thread* gui_thread;
bool _active;
Gtk::Main *theMain;
+#ifndef GTK_NEW_TOOLTIP_API
+ Gtk::Tooltips *tips;
+#endif
TextViewer *errors;
Glib::RefPtr<Gtk::TextBuffer::Tag> error_ptag;
Glib::RefPtr<Gtk::TextBuffer::Tag> error_mtag;