Skip to content

Commit

Permalink
Add X11EmbedContainer Qt5 port
Browse files Browse the repository at this point in the history
  • Loading branch information
lukas-w committed Sep 1, 2017
1 parent 24d320d commit e661d26
Show file tree
Hide file tree
Showing 6 changed files with 1,295 additions and 9 deletions.
1 change: 1 addition & 0 deletions plugins/vst_base/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ SET(REMOTE_VST_PLUGIN_FILEPATH "RemoteVstPlugin" CACHE STRING "Relative file pat

ADD_DEFINITIONS(-DREMOTE_VST_PLUGIN_FILEPATH="${REMOTE_VST_PLUGIN_FILEPATH}")
BUILD_PLUGIN(vstbase vst_base.cpp VstPlugin.cpp VstPlugin.h communication.h MOCFILES VstPlugin.h)
TARGET_LINK_LIBRARIES(vstbase x11embedcontainer)

IF(LMMS_BUILD_LINUX AND NOT WANT_VST_NOWINE)

Expand Down
9 changes: 1 addition & 8 deletions plugins/vst_base/VstPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,7 @@
#include <QMdiArea>
#include <QMdiSubWindow>
#ifdef LMMS_BUILD_LINUX
#if QT_VERSION < 0x050000
#include <QX11EmbedContainer>
#include <QX11Info>
#endif
#include "X11EmbedContainer.h"
#else
#include <QLayout>
#endif
Expand Down Expand Up @@ -244,25 +241,21 @@ void VstPlugin::showEditor( QWidget * _parent, bool isEffect )
sw->setAttribute( Qt::WA_TranslucentBackground );
sw->setWindowFlags( Qt::FramelessWindowHint );
sw->setWidget( m_pluginWidget );
#if QT_VERSION < 0x050000
QX11EmbedContainer * xe = new QX11EmbedContainer( sw );
xe->embedClient( m_pluginWindowID );
xe->setFixedSize( m_pluginGeometry );
xe->show();
#endif
}
else
{
sw->setWindowFlags( Qt::WindowCloseButtonHint );
sw->setWidget( m_pluginWidget );

#if QT_VERSION < 0x050000
QX11EmbedContainer * xe = new QX11EmbedContainer( sw );
xe->embedClient( m_pluginWindowID );
xe->setFixedSize( m_pluginGeometry );
xe->move( 4, 24 );
xe->show();
#endif
}
}

Expand Down
2 changes: 1 addition & 1 deletion plugins/vst_base/VstPlugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ public slots:

QString m_plugin;
QPointer<QWidget> m_pluginWidget;
int m_pluginWindowID;
WId m_pluginWindowID;
QSize m_pluginGeometry;

bool m_badDllFormat;
Expand Down
19 changes: 19 additions & 0 deletions src/gui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,25 @@ SET(LMMS_SRCS
PARENT_SCOPE
)

IF(QT5)
add_library(x11embedcontainer STATIC
X11EmbedContainer
)
FIND_PACKAGE(Qt5Core COMPONENTS Private)
FIND_PACKAGE(Qt5Widgets COMPONENTS Private)
FIND_PACKAGE(Qt5X11Extras REQUIRED)

include_directories(${Qt5Core_PRIVATE_INCLUDE_DIRS})
include_directories(${Qt5Widgets_PRIVATE_INCLUDE_DIRS})


target_link_Libraries(x11embedcontainer
xcb xcb-util X11-xcb Qt5::X11Extras
)
ELSE()
add_library(x11embedcontainer STATIC /dev/null)
ENDIF()

set(LMMS_UIS
${LMMS_UIS}
gui/dialogs/about_dialog.ui
Expand Down
Loading

0 comments on commit e661d26

Please sign in to comment.