make PluginUIWindow inherit from ArdourWindow not GtkWindow

This commit is contained in:
Paul Davis 2013-05-02 10:11:57 -04:00
parent f04c35cb1c
commit 7df1654947
3 changed files with 7 additions and 28 deletions

View file

@ -82,11 +82,10 @@ using namespace Gtkmm2ext;
using namespace Gtk; using namespace Gtk;
PluginUIWindow::PluginUIWindow ( PluginUIWindow::PluginUIWindow (
Gtk::Window* win,
boost::shared_ptr<PluginInsert> insert, boost::shared_ptr<PluginInsert> insert,
bool scrollable, bool scrollable,
bool editor) bool editor)
: parent (win) : ArdourWindow (string())
, was_visible (false) , was_visible (false)
, _keyboard_focused (false) , _keyboard_focused (false)
#ifdef AUDIOUNIT_SUPPORT #ifdef AUDIOUNIT_SUPPORT
@ -96,7 +95,6 @@ PluginUIWindow::PluginUIWindow (
{ {
bool have_gui = false; bool have_gui = false;
Label* label = manage (new Label()); Label* label = manage (new Label());
label->set_markup ("<b>THIS IS THE PLUGIN UI</b>"); label->set_markup ("<b>THIS IS THE PLUGIN UI</b>");
@ -147,7 +145,6 @@ PluginUIWindow::PluginUIWindow (
signal_unmap_event().connect (sigc::mem_fun (*pu, &GenericPluginUI::stop_updating)); signal_unmap_event().connect (sigc::mem_fun (*pu, &GenericPluginUI::stop_updating));
} }
// set_position (Gtk::WIN_POS_MOUSE);
set_name ("PluginEditor"); set_name ("PluginEditor");
add_events (Gdk::KEY_PRESS_MASK|Gdk::KEY_RELEASE_MASK|Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK); add_events (Gdk::KEY_PRESS_MASK|Gdk::KEY_RELEASE_MASK|Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK);
@ -163,6 +160,7 @@ PluginUIWindow::PluginUIWindow (
set_default_size (w, h); set_default_size (w, h);
set_resizable (_pluginui->resizable()); set_resizable (_pluginui->resizable());
set_position (Gtk::WIN_POS_MOUSE);
} }
PluginUIWindow::~PluginUIWindow () PluginUIWindow::~PluginUIWindow ()
@ -170,19 +168,10 @@ PluginUIWindow::~PluginUIWindow ()
delete _pluginui; delete _pluginui;
} }
void
PluginUIWindow::set_parent (Gtk::Window* win)
{
parent = win;
}
void void
PluginUIWindow::on_map () PluginUIWindow::on_map ()
{ {
Window::on_map (); Window::on_map ();
#ifdef __APPLE__
set_keep_above (true);
#endif // __APPLE__
} }
bool bool
@ -236,10 +225,6 @@ PluginUIWindow::on_show ()
Window::on_show (); Window::on_show ();
} }
} }
if (parent) {
// set_transient_for (*parent);
}
} }
void void

View file

@ -50,6 +50,7 @@
#include "automation_controller.h" #include "automation_controller.h"
#include "ardour_button.h" #include "ardour_button.h"
#include "ardour_window.h"
namespace ARDOUR { namespace ARDOUR {
class PluginInsert; class PluginInsert;
@ -278,11 +279,10 @@ class GenericPluginUI : public PlugUIBase, public Gtk::VBox
bool integer_printer (char* buf, Gtk::Adjustment &, ControlUI *); bool integer_printer (char* buf, Gtk::Adjustment &, ControlUI *);
}; };
class PluginUIWindow : public Gtk::Window class PluginUIWindow : public ArdourWindow
{ {
public: public:
PluginUIWindow (Gtk::Window*, PluginUIWindow (boost::shared_ptr<ARDOUR::PluginInsert> insert,
boost::shared_ptr<ARDOUR::PluginInsert> insert,
bool scrollable=false, bool scrollable=false,
bool editor=true); bool editor=true);
~PluginUIWindow (); ~PluginUIWindow ();

View file

@ -2094,20 +2094,16 @@ ProcessorBox::toggle_edit_processor (boost::shared_ptr<Processor> processor)
/* these are both allowed to be null */ /* these are both allowed to be null */
Container* toplevel = get_toplevel();
Window* win = dynamic_cast<Gtk::Window*>(toplevel);
Window* w = get_processor_ui (plugin_insert); Window* w = get_processor_ui (plugin_insert);
if (w == 0) { if (w == 0) {
plugin_ui = new PluginUIWindow (win, plugin_insert); plugin_ui = new PluginUIWindow (plugin_insert);
plugin_ui->set_title (generate_processor_title (plugin_insert)); plugin_ui->set_title (generate_processor_title (plugin_insert));
set_processor_ui (plugin_insert, plugin_ui); set_processor_ui (plugin_insert, plugin_ui);
} else { } else {
plugin_ui = dynamic_cast<PluginUIWindow *> (w); plugin_ui = dynamic_cast<PluginUIWindow *> (w);
plugin_ui->set_parent (win);
} }
gidget = plugin_ui; gidget = plugin_ui;
@ -2155,9 +2151,7 @@ ProcessorBox::toggle_edit_generic_processor (boost::shared_ptr<Processor> proces
return; return;
} }
Container* toplevel = get_toplevel(); PluginUIWindow* plugin_ui = new PluginUIWindow (plugin_insert, true, false);
Window* win = dynamic_cast<Gtk::Window*>(toplevel);
PluginUIWindow* plugin_ui = new PluginUIWindow(win, plugin_insert, true, false);
plugin_ui->set_title(generate_processor_title (plugin_insert)); plugin_ui->set_title(generate_processor_title (plugin_insert));
if (plugin_ui->is_visible()) { if (plugin_ui->is_visible()) {