replace ::cast_dynamic() with relevant ActionManager::get_*_action() calls
[ardour.git] / gtk2_ardour / option_editor.h
index 68b389601bd2993b40b8c016c1474911716dd7db..ca88dbf07b76655b5cc1e68102b260e612901757 100644 (file)
 #ifndef __gtk_ardour_option_editor_h__
 #define __gtk_ardour_option_editor_h__
 
-#include <gtkmm/notebook.h>
 #include <gtkmm/checkbutton.h>
 #include <gtkmm/comboboxtext.h>
+#include <gtkmm/filechooserbutton.h>
+#include <gtkmm/label.h>
+#include <gtkmm/notebook.h>
+#include <gtkmm/scale.h>
 #include <gtkmm/spinbutton.h>
 #include <gtkmm/table.h>
+#include <gtkmm/treestore.h>
+#include <gtkmm/treeview.h>
 #include <gtkmm/window.h>
 
 #include "widgets/slider_controller.h"
 
+#include "actions.h"
 #include "ardour_window.h"
 #include "audio_clock.h"
 #include "ardour/types.h"
@@ -182,6 +188,32 @@ protected:
        std::string _name;
 };
 
+/** Just a Gtk Checkbutton, masquerading as an option component */
+class CheckOption : public OptionEditorComponent , public Gtkmm2ext::Activatable, public sigc::trackable
+{
+public:
+       CheckOption (std::string const &, std::string const &, Glib::RefPtr<Gtk::Action> act );
+       void set_state_from_config () {}
+       void parameter_changed (std::string const &) {}
+       void add_to_page (OptionEditorPage*);
+
+       void set_sensitive (bool yn) {
+               _button->set_sensitive (yn);
+       }
+
+       Gtk::Widget& tip_widget() { return *_button; }
+
+protected:
+       void action_toggled ();
+       void action_sensitivity_changed () {}
+       void action_visibility_changed () {}
+
+       virtual void toggled ();
+
+       Gtk::CheckButton*      _button; ///< UI button
+       Gtk::Label*            _label; ///< label for button, so we can use markup
+};
+
 /** Component which provides the UI to handle a boolean option using a GTK CheckButton */
 class BoolOption : public Option
 {
@@ -553,6 +585,21 @@ private:
        sigc::slot<bool, ARDOUR::gain_t> _set;
 };
 
+class WidgetOption : public Option
+{
+  public:
+       WidgetOption (std::string const & i, std::string const & n, Gtk::Widget& w);
+
+       void add_to_page (OptionEditorPage*);
+       void parameter_changed (std::string const &) {}
+       void set_state_from_config () {}
+
+       Gtk::Widget& tip_widget() { return *_widget; }
+
+  private:
+       Gtk::Widget* _widget;
+};
+
 class ClockOption : public Option
 {
 public: