| @@ -1509,7 +1509,7 @@ int main(int argc, char* argv[]) | |||||
| // lock | // lock | ||||
| app.exec(); | app.exec(); | ||||
| delete vstGui; | delete vstGui; | ||||
| vstGui = nullptr; | vstGui = nullptr; | ||||
| @@ -33,10 +33,7 @@ | |||||
| #include <cstdio> | #include <cstdio> | ||||
| #include <cstdlib> | #include <cstdlib> | ||||
| #include <vector> | #include <vector> | ||||
| #ifndef __WINE__ | |||||
| # include <QtGui/QDialog> | |||||
| #endif | |||||
| #include <QtGui/QDialog> | |||||
| CARLA_BACKEND_START_NAMESPACE | CARLA_BACKEND_START_NAMESPACE | ||||
| @@ -49,12 +46,6 @@ CARLA_BACKEND_START_NAMESPACE | |||||
| #define CARLA_PROCESS_CONTINUE_CHECK if (! m_enabled) { x_engine->callback(CALLBACK_DEBUG, m_id, m_enabled, 0, 0.0); return; } | #define CARLA_PROCESS_CONTINUE_CHECK if (! m_enabled) { x_engine->callback(CALLBACK_DEBUG, m_id, m_enabled, 0, 0.0); return; } | ||||
| #ifdef __WINE__ | |||||
| typedef HWND GuiDataHandle; | |||||
| #else | |||||
| typedef QDialog* GuiDataHandle; | |||||
| #endif | |||||
| const unsigned short MAX_MIDI_EVENTS = 512; | const unsigned short MAX_MIDI_EVENTS = 512; | ||||
| const unsigned short MAX_POST_EVENTS = 152; | const unsigned short MAX_POST_EVENTS = 152; | ||||
| @@ -1272,9 +1263,9 @@ public: | |||||
| * | * | ||||
| * \note This function must be always called from the main thread. | * \note This function must be always called from the main thread. | ||||
| */ | */ | ||||
| virtual void setGuiData(const GuiDataHandle handle) | |||||
| virtual void setGuiData(QDialog* const dialog) | |||||
| { | { | ||||
| Q_UNUSED(handle); | |||||
| Q_UNUSED(dialog); | |||||
| } | } | ||||
| /*! | /*! | ||||
| @@ -20,10 +20,7 @@ | |||||
| #include "rtmempool/rtmempool.h" | #include "rtmempool/rtmempool.h" | ||||
| #include <QtCore/QDir> | #include <QtCore/QDir> | ||||
| #ifndef __WINE__ | |||||
| #include <QtGui/QLayout> | #include <QtGui/QLayout> | ||||
| #endif | |||||
| #ifdef HAVE_SUIL | #ifdef HAVE_SUIL | ||||
| #include <suil/suil.h> | #include <suil/suil.h> | ||||
| @@ -305,7 +302,7 @@ public: | |||||
| break; | break; | ||||
| case GUI_EXTERNAL_SUIL: | case GUI_EXTERNAL_SUIL: | ||||
| #if defined(HAVE_SUIL) && ! defined(__WINE__) | |||||
| #ifdef HAVE_SUIL | |||||
| if (ui.widget) | if (ui.widget) | ||||
| ((QWidget*)ui.widget)->close(); | ((QWidget*)ui.widget)->close(); | ||||
| #endif | #endif | ||||
| @@ -881,18 +878,16 @@ public: | |||||
| // ------------------------------------------------------------------- | // ------------------------------------------------------------------- | ||||
| // Set gui stuff | // Set gui stuff | ||||
| void setGuiData(const GuiDataHandle handle) | |||||
| void setGuiData(QDialog* const dialog) | |||||
| { | { | ||||
| switch(gui.type) | switch(gui.type) | ||||
| { | { | ||||
| case GUI_NONE: | case GUI_NONE: | ||||
| break; | break; | ||||
| #ifndef __WINE__ | |||||
| case GUI_INTERNAL_QT4: | case GUI_INTERNAL_QT4: | ||||
| if (ui.widget) | if (ui.widget) | ||||
| { | { | ||||
| QDialog* const dialog = handle; | |||||
| QWidget* const widget = (QWidget*)ui.widget; | QWidget* const widget = (QWidget*)ui.widget; | ||||
| dialog->layout()->addWidget(widget); | dialog->layout()->addWidget(widget); | ||||
| widget->adjustSize(); | widget->adjustSize(); | ||||
| @@ -900,18 +895,13 @@ public: | |||||
| widget->show(); | widget->show(); | ||||
| } | } | ||||
| break; | break; | ||||
| #endif | |||||
| case GUI_INTERNAL_COCOA: | case GUI_INTERNAL_COCOA: | ||||
| case GUI_INTERNAL_HWND: | case GUI_INTERNAL_HWND: | ||||
| case GUI_INTERNAL_X11: | case GUI_INTERNAL_X11: | ||||
| if (ui.descriptor) | if (ui.descriptor) | ||||
| { | { | ||||
| #ifdef __WINE__ | |||||
| features[lv2_feature_id_ui_parent]->data = (void*)handle; | |||||
| #else | |||||
| features[lv2_feature_id_ui_parent]->data = (void*)handle->winId(); | |||||
| #endif | |||||
| features[lv2_feature_id_ui_parent]->data = (void*)dialog->winId(); | |||||
| ui.handle = ui.descriptor->instantiate(ui.descriptor, | ui.handle = ui.descriptor->instantiate(ui.descriptor, | ||||
| descriptor->URI, ui.rdf_descriptor->Bundle, | descriptor->URI, ui.rdf_descriptor->Bundle, | ||||
| carla_lv2_ui_write_function, this, &ui.widget,features); | carla_lv2_ui_write_function, this, &ui.widget,features); | ||||
| @@ -973,7 +963,7 @@ public: | |||||
| break; | break; | ||||
| case GUI_EXTERNAL_SUIL: | case GUI_EXTERNAL_SUIL: | ||||
| #if defined(HAVE_SUIL) && ! defined(__WINE__) | |||||
| #ifdef HAVE_SUIL | |||||
| if (ui.widget) | if (ui.widget) | ||||
| { | { | ||||
| QWidget* const widget = (QWidget*)ui.widget; | QWidget* const widget = (QWidget*)ui.widget; | ||||
| @@ -18,12 +18,9 @@ | |||||
| #include "carla_plugin.h" | #include "carla_plugin.h" | ||||
| #include "carla_vst.h" | #include "carla_vst.h" | ||||
| #ifndef __WINE__ | |||||
| #include <QtGui/QDialog> | |||||
| #ifdef Q_WS_X11 | #ifdef Q_WS_X11 | ||||
| #include <QtGui/QX11Info> | #include <QtGui/QX11Info> | ||||
| #endif | #endif | ||||
| #endif | |||||
| CARLA_BACKEND_START_NAMESPACE | CARLA_BACKEND_START_NAMESPACE | ||||
| @@ -331,10 +328,9 @@ public: | |||||
| // ------------------------------------------------------------------- | // ------------------------------------------------------------------- | ||||
| // Set gui stuff | // Set gui stuff | ||||
| void setGuiData(const GuiDataHandle handle) | |||||
| void setGuiData(QDialog* const dialog) | |||||
| { | { | ||||
| qDebug("VstPlugin::setGuiData(%p)", handle); | |||||
| Q_ASSERT(handle); | |||||
| Q_ASSERT(dialog); | |||||
| if (gui.type == GUI_EXTERNAL_OSC) | if (gui.type == GUI_EXTERNAL_OSC) | ||||
| return; | return; | ||||
| @@ -344,12 +340,7 @@ public: | |||||
| value = (int64_t)QX11Info::display(); | value = (int64_t)QX11Info::display(); | ||||
| #endif | #endif | ||||
| #ifdef __WINE__ | |||||
| if (effect->dispatcher(effect, effEditOpen, 0, value, handle, 0.0f) == 1) | |||||
| #else | |||||
| const QDialog* const dialog = handle; | |||||
| if (effect->dispatcher(effect, effEditOpen, 0, value, (void*)dialog->winId(), 0.0f) == 1) | if (effect->dispatcher(effect, effEditOpen, 0, value, (void*)dialog->winId(), 0.0f) == 1) | ||||
| #endif | |||||
| { | { | ||||
| ERect* vstRect = nullptr; | ERect* vstRect = nullptr; | ||||
| effect->dispatcher(effect, effEditGetRect, 0, 0, &vstRect, 0.0f); | effect->dispatcher(effect, effEditGetRect, 0, 0, &vstRect, 0.0f); | ||||
| @@ -361,7 +352,7 @@ public: | |||||
| if (width <= 0 || height <= 0) | if (width <= 0 || height <= 0) | ||||
| { | { | ||||
| qCritical("VstPlugin::setGuiData(%p) - failed to get proper window size", handle); | |||||
| qCritical("VstPlugin::setGuiData(%p) - failed to get proper window size", dialog); | |||||
| return; | return; | ||||
| } | } | ||||
| @@ -369,7 +360,7 @@ public: | |||||
| gui.height = height; | gui.height = height; | ||||
| } | } | ||||
| else | else | ||||
| qCritical("VstPlugin::setGuiData(%p) - failed to get plugin window size", handle); | |||||
| qCritical("VstPlugin::setGuiData(%p) - failed to get plugin window size", dialog); | |||||
| } | } | ||||
| else | else | ||||
| { | { | ||||
| @@ -18,20 +18,11 @@ | |||||
| #ifndef CARLA_INCLUDES_H | #ifndef CARLA_INCLUDES_H | ||||
| #define CARLA_INCLUDES_H | #define CARLA_INCLUDES_H | ||||
| #ifdef __WINE__ | |||||
| # define __socklen_t_defined | |||||
| //# define __WINE_WINSOCK2__ | |||||
| //# define HRESULT LONG | |||||
| # define Q_CORE_EXPORT | |||||
| # define Q_GUI_EXPORT | |||||
| # define QT_NO_STL | |||||
| #endif | |||||
| #include <QtCore/Qt> | #include <QtCore/Qt> | ||||
| // TESTING - remove later | // TESTING - remove later | ||||
| #ifdef QTCREATOR_TEST | #ifdef QTCREATOR_TEST | ||||
| #undef Q_COMPILER_INITIALIZER_LISTS | |||||
| # undef Q_COMPILER_INITIALIZER_LISTS | |||||
| #endif | #endif | ||||
| #ifndef Q_COMPILER_LAMBDA | #ifndef Q_COMPILER_LAMBDA | ||||
| @@ -96,6 +96,7 @@ typedef struct _LV2_External_UI_Host { | |||||
| * LV2UI_Descriptor::instantiate() | * LV2UI_Descriptor::instantiate() | ||||
| */ | */ | ||||
| const char * plugin_human_id; | const char * plugin_human_id; | ||||
| } LV2_External_UI_Host; | } LV2_External_UI_Host; | ||||
| #ifdef __cplusplus | #ifdef __cplusplus | ||||