add visible() method to Tearoff so we can check whether or not it is hidden
[ardour.git] / libs / gtkmm2ext / gtkmm2ext / gtk_ui.h
index bac657a0288183be9bb968e12504b0d19910391b..bba3fb6fdf6b62f03b465e6830636b1dd2163ec1 100644 (file)
@@ -50,6 +50,7 @@ namespace Gtkmm2ext {
 
 class TextViewer;
 
+extern BaseUI::RequestType NullMessage;
 extern BaseUI::RequestType ErrorMessage;
 extern BaseUI::RequestType CallSlot;
 extern BaseUI::RequestType TouchDisplay;
@@ -74,6 +75,10 @@ struct UIRequest : public BaseUI::BaseRequestObject {
     Transmitter::Channel chn;
     void *arg;
     const char *msg2;
+
+    UIRequest () {
+            type = NullMessage;
+    }
     
     ~UIRequest () { 
            if (type == ErrorMessage && msg) {
@@ -109,11 +114,14 @@ class UI : public Receiver, public AbstractUI<UIRequest>
        void run (Receiver &old_receiver);
 
        void set_state (Gtk::Widget *w, Gtk::StateType state);
-       void popup_error (const char *text);
+       void popup_error (const std::string& text);
        void flush_pending ();
        void toggle_errors ();
+       void show_errors ();
        void touch_display (Touchable *);
-       void set_tip (Gtk::Widget *w, const gchar *tip, const gchar *hlp);
+       void set_tip (Gtk::Widget &w, const gchar *tip);
+       void set_tip (Gtk::Widget &w, const std::string &tip);
+       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; }
@@ -123,6 +131,10 @@ class UI : public Receiver, public AbstractUI<UIRequest>
                Glib::signal_idle().connect (bind (slot (&UI::idle_delete<T>), obj));
        }
 
+       template<class T> void delete_in_self (T *obj) {
+               call_slot (boost::bind (&UI::delete_in_self, this, obj));
+       }
+
        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,