Browse Source

mingw DPT/pugl fixes

tags/v0.9.0
falkTX 12 years ago
parent
commit
174e6fb602
5 changed files with 34 additions and 9 deletions
  1. +11
    -1
      c++/carla-native/distrho/DistrhoPluginCarla.cpp
  2. +13
    -5
      c++/distrho-plugin-toolkit/DistrhoUIOpenGL.h
  3. +1
    -0
      c++/distrho-plugin-toolkit/DistrhoUIOpenGLExt.h
  4. +6
    -0
      c++/distrho-plugin-toolkit/src/DistrhoUIOpenGLExt.cpp
  5. +3
    -3
      c++/distrho-plugin-toolkit/src/pugl/pugl_win.cpp

+ 11
- 1
c++/carla-native/distrho/DistrhoPluginCarla.cpp View File

@@ -47,7 +47,7 @@ public:
: QDialog(nullptr),
m_host(host),
m_plugin(plugin),
ui(this, winId(), setParameterCallback, setStateCallback, uiEditParameterCallback, uiSendNoteCallback, uiResizeCallback)
ui(this, realWinId(), setParameterCallback, setStateCallback, uiEditParameterCallback, uiSendNoteCallback, uiResizeCallback)
{
setFixedSize(ui.getWidth(), ui.getHeight());
setWindowTitle("TEST GUI");
@@ -57,6 +57,16 @@ public:
{
}

intptr_t realWinId() const
{
WId wId = winId();
#if DISTRHO_OS_WINDOWS
return (intptr_t)static_cast<HWND>(wId);
#else
return wId;
#endif
}

// ---------------------------------------------

void carla_show(const bool yesNo)


+ 13
- 5
c++/distrho-plugin-toolkit/DistrhoUIOpenGL.h View File

@@ -30,6 +30,14 @@
# include <GL/glu.h>
#endif

#if defined(GL_BGR_EXT) && ! defined(GL_BGR)
# define GL_BGR GL_BGR_EXT
#endif

#if defined(GL_BGRA_EXT) && ! defined(GL_BGRA)
# define GL_BGRA GL_BGRA_EXT
#endif

START_NAMESPACE_DISTRHO

// -------------------------------------------------
@@ -68,11 +76,11 @@ enum Key {
KEY_SUPER
};

enum Mod {
MOD_SHIFT = 1 << 0, /**< Shift key */
MOD_CTRL = 1 << 1, /**< Control key */
MOD_ALT = 1 << 2, /**< Alt/Option key */
MOD_SUPER = 1 << 3 /**< Mod4/Command/Windows key */
enum Modifier {
MODIFIER_SHIFT = 1 << 0, /**< Shift key */
MODIFIER_CTRL = 1 << 1, /**< Control key */
MODIFIER_ALT = 1 << 2, /**< Alt/Option key */
MODIFIER_SUPER = 1 << 3 /**< Mod4/Command/Windows key */
};

// -------------------------------------------------


+ 1
- 0
c++/distrho-plugin-toolkit/DistrhoUIOpenGLExt.h View File

@@ -23,6 +23,7 @@
#ifdef DISTRHO_UI_OPENGL

#include "DistrhoUIOpenGL.h"
#include <GL/gl.h>

START_NAMESPACE_DISTRHO



+ 6
- 0
c++/distrho-plugin-toolkit/src/DistrhoUIOpenGLExt.cpp View File

@@ -697,6 +697,12 @@ public:

XSetTransientForHint(display, thisWindow, parentWindow);
XMapRaised(display, thisWindow);
#else
return;

// unused
(void)parentView;
(void)parentSize;
#endif
}



+ 3
- 3
c++/distrho-plugin-toolkit/src/pugl/pugl_win.cpp View File

@@ -74,7 +74,7 @@ puglCreate(PuglNativeWindow parent,

impl->hwnd = CreateWindow(
"Pugl", title,
WS_VISIBLE | (parent ? WS_CHILD : (WS_POPUPWINDOW | WS_CAPTION)),
(addToDesktop ? WS_VISIBLE : 0) | (parent ? WS_CHILD : (WS_POPUPWINDOW | WS_CAPTION)),
0, 0, width, height,
(HWND)parent, NULL, NULL, NULL);
if (!impl->hwnd) {
@@ -109,6 +109,7 @@ puglCreate(PuglNativeWindow parent,
return view;

// unused
(void)resizable;
(void)addToDesktop;
(void)x11Display;
}
@@ -213,7 +214,6 @@ setModifiers(PuglView* view)
static LRESULT
handleMessage(PuglView* view, UINT message, WPARAM wParam, LPARAM lParam)
{
MSG msg;
PAINTSTRUCT ps;
PuglKey key;

@@ -270,7 +270,7 @@ handleMessage(PuglView* view, UINT message, WPARAM wParam, LPARAM lParam)
break;
} // else nobreak
case WM_KEYUP:
if (key = keySymToSpecial(wParam)) {
if ((key = keySymToSpecial(wParam))) {
if (view->specialFunc) {
view->specialFunc(view, message == WM_KEYDOWN, key);
}


Loading…
Cancel
Save