X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Fwindows_vst_plugin_ui.cc;h=e8bb51cb1c945bd0c4a2961d9d73dff3608b7060;hb=736038556fa41607d54a57fd3339d4fd1782bddf;hp=6288ba50e1b2086dae99a3a309b86a7902413e64;hpb=aed44005b26eb359025b33f10c8d588ab732d096;p=ardour.git diff --git a/gtk2_ardour/windows_vst_plugin_ui.cc b/gtk2_ardour/windows_vst_plugin_ui.cc index 6288ba50e1..e8bb51cb1c 100644 --- a/gtk2_ardour/windows_vst_plugin_ui.cc +++ b/gtk2_ardour/windows_vst_plugin_ui.cc @@ -17,26 +17,43 @@ */ -#include +#include #include #include +#include #include "ardour/plugin_insert.h" #include "ardour/windows_vst_plugin.h" #include "windows_vst_plugin_ui.h" +#ifdef PLATFORM_WINDOWS +#include +#elif defined __APPLE__ +// TODO +#else #include +#endif using namespace Gtk; using namespace ARDOUR; using namespace PBD; -WindowsVSTPluginUI::WindowsVSTPluginUI (boost::shared_ptr pi, boost::shared_ptr vp) +WindowsVSTPluginUI::WindowsVSTPluginUI (boost::shared_ptr pi, boost::shared_ptr vp, GtkWidget *parent) : VSTPluginUI (pi, vp) { - fst_run_editor (_vst->state()); +#ifdef GDK_WINDOWING_WIN32 + gtk_widget_realize(parent); + void* hWndHost = gdk_win32_drawable_get_handle(parent->window); + + fst_run_editor (_vst->state(), hWndHost); + // TODO pack a placeholder (compare to VSTPluginUI::VSTPluginUI X11 socket) + // have placeholder use VSTPluginUI::get_preferred_height(), width() + // TODO pack plugin_analysis_expander at the bottom. +#else + fst_run_editor (_vst->state(), NULL); pack_start (plugin_analysis_expander, true, true); +#endif } WindowsVSTPluginUI::~WindowsVSTPluginUI () @@ -50,10 +67,6 @@ WindowsVSTPluginUI::package (Gtk::Window& win) { VSTPluginUI::package (win); - /* This assumes that the window's owner understands the XEmbed protocol */ - - _socket.add_id (fst_get_XID (_vst->state ())); - fst_move_window_into_view (_vst->state ()); return 0; @@ -112,6 +125,7 @@ WindowsVSTPluginUI::get_XID () return _vst->state()->xid; } +#ifdef GDK_WINDOWING_X11 typedef int (*error_handler_t)( Display *, XErrorEvent *); static Display *the_gtk_display; static error_handler_t wine_error_handler; @@ -128,13 +142,17 @@ fst_xerror_handler (Display* disp, XErrorEvent* ev) return wine_error_handler (disp, ev); } } +#endif void windows_vst_gui_init (int *argc, char **argv[]) { - wine_error_handler = XSetErrorHandler (NULL); gtk_init (argc, argv); + +#ifdef GDK_WINDOWING_X11 + wine_error_handler = XSetErrorHandler (NULL); the_gtk_display = gdk_x11_display_get_xdisplay (gdk_display_get_default()); gtk_error_handler = XSetErrorHandler (fst_xerror_handler); +#endif }