*/
-#include <fst.h>
+#include <gtkmm.h>
#include <gtk/gtk.h>
#include <gtk/gtksocket.h>
+#include <fst.h>
#include "ardour/plugin_insert.h"
#include "ardour/windows_vst_plugin.h"
#include "windows_vst_plugin_ui.h"
+#ifdef PLATFORM_WINDOWS
+#include <gdk/gdkwin32.h>
+#elif defined __APPLE__
+// TODO
+#else
#include <gdk/gdkx.h>
+#endif
using namespace Gtk;
using namespace ARDOUR;
using namespace PBD;
-WindowsVSTPluginUI::WindowsVSTPluginUI (boost::shared_ptr<PluginInsert> pi, boost::shared_ptr<VSTPlugin> vp)
+WindowsVSTPluginUI::WindowsVSTPluginUI (boost::shared_ptr<PluginInsert> pi, boost::shared_ptr<VSTPlugin> vp, GtkWidget *parent)
: VSTPluginUI (pi, vp)
{
- fst_run_editor (_vst->state(), NULL);
+#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 ()
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;
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
}