20 #ifndef __pbd_gtk_ui_h__
21 #define __pbd_gtk_ui_h__
34 #include <glibmm/thread.h>
36 #include <gtkmm/widget.h>
37 #include <gtkmm/style.h>
38 #ifndef GTK_NEW_TOOLTIP_API
39 #include <gtkmm/tooltips.h>
41 #include <gtkmm/textbuffer.h>
42 #include <gtkmm/main.h>
43 #include <gdkmm/color.h>
45 #ifndef ABSTRACT_UI_EXPORTS
46 #define ABSTRACT_UI_EXPORTS
82 int (*
function)(
void *);
93 if (type == ErrorMessage && msg) {
95 free (const_cast<char *>(msg));
107 _ui.receive (chn, msg);
116 UI (std::string
name,
int *argc,
char **argv[]);
127 bool caller_is_ui_thread ();
133 int load_rcfile (std::string,
bool themechange =
false);
136 void set_state (Gtk::Widget *w, Gtk::StateType state);
137 void popup_error (
const std::string& text);
138 void flush_pending ();
139 void toggle_errors ();
142 void set_tip (Gtk::Widget &w,
const gchar *tip);
143 void set_tip (Gtk::Widget &w,
const std::string &tip);
144 void set_tip (Gtk::Widget *w,
const gchar *tip,
const gchar *hlp=
"");
145 void idle_add (
int (*func)(
void *),
void *arg);
147 Gtk::Main&
main()
const {
return *theMain; }
149 template<
class T>
static bool idle_delete (T *obj) {
delete obj;
return false; }
151 Glib::signal_idle().connect (bind (slot (&UI::idle_delete<T>), obj));
158 Gdk::Color get_color (
const std::string& prompt,
bool& picked,
const Gdk::Color *initial = 0);
164 virtual int starting() = 0;
168 static bool just_hide_it (GdkEventAny *, Gtk::Window *);
171 virtual void handle_fatal (
const char *);
172 virtual void display_message (
const char *prefix, gint prefix_len,
173 Glib::RefPtr<Gtk::TextBuffer::Tag> ptag, Glib::RefPtr<Gtk::TextBuffer::Tag> mtag,
181 #ifndef GTK_NEW_TOOLTIP_API
194 static void signal_pipe_callback (
void *, gint, GdkInputCondition);
198 void color_selection_done (
bool status);
199 bool color_selection_deleted (GdkEventAny *);
void receive(Transmitter::Channel chn, const char *msg)
Glib::RefPtr< Gtk::TextBuffer::Tag > info_ptag
static bool idle_delete(T *obj)
Glib::RefPtr< Gtk::TextBuffer::Tag > warning_ptag
BaseUI::RequestType AddIdle
BaseUI::RequestType ErrorMessage
Glib::RefPtr< Gtk::TextBuffer::Tag > info_mtag
BaseUI::RequestType TouchDisplay
void delete_in_self(T *obj)
BaseUI::RequestType SetTip
BaseUI::RequestType AddTimeout
BaseUI::RequestType StateChange
Glib::RefPtr< Gtk::TextBuffer::Tag > fatal_mtag
gint just_hide_it(GdkEventAny *, Gtk::Window *)
static void delete_when_idle(T *obj)
sigc::signal< void > theme_changed
BaseUI::RequestType CallSlot
Glib::RefPtr< Gtk::TextBuffer::Tag > fatal_ptag
Glib::RefPtr< Gtk::TextBuffer::Tag > error_ptag
Glib::RefPtr< Gtk::TextBuffer::Tag > error_mtag
BaseUI::RequestType NullMessage
Glib::RefPtr< Gtk::TextBuffer::Tag > warning_mtag