Browse Source

DPT: Fix mingw build; add getApp() method

tags/1.9.4
falkTX 12 years ago
parent
commit
f72c8010c8
5 changed files with 35 additions and 9 deletions
  1. +2
    -0
      source/libs/distrho/dgl/ImageAboutWindow.hpp
  2. +4
    -0
      source/libs/distrho/dgl/Widget.hpp
  3. +1
    -0
      source/libs/distrho/dgl/Window.hpp
  4. +5
    -0
      source/libs/distrho/dgl/src/Widget.cpp
  5. +23
    -9
      source/libs/distrho/dgl/src/Window.cpp

+ 2
- 0
source/libs/distrho/dgl/ImageAboutWindow.hpp View File

@@ -21,6 +21,8 @@
#include "Widget.hpp"
#include "Window.hpp"

#include <cstdint>

START_NAMESPACE_DISTRHO

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


+ 4
- 0
source/libs/distrho/dgl/Widget.hpp View File

@@ -19,10 +19,13 @@

#include "Geometry.hpp"

#include <cstdint>

START_NAMESPACE_DISTRHO

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

class App;
class Window;

class Widget
@@ -69,6 +72,7 @@ public:

int getModifiers();

App* getApp() const;
Window* getParent() const;
void repaint();



+ 1
- 0
source/libs/distrho/dgl/Window.hpp View File

@@ -44,6 +44,7 @@ public:
void setSize(unsigned int width, unsigned int height);
void setWindowTitle(const char* title);

App* getApp() const;
int getModifiers();
intptr_t getWindowId();



+ 5
- 0
source/libs/distrho/dgl/src/Widget.cpp View File

@@ -166,6 +166,11 @@ int Widget::getModifiers()
return fParent->getModifiers();
}

App* Widget::getApp() const
{
return fParent->getApp();
}

Window* Widget::getParent() const
{
return fParent;


+ 23
- 9
source/libs/distrho/dgl/src/Window.cpp View File

@@ -44,8 +44,9 @@ START_NAMESPACE_DISTRHO
class Window::Private
{
public:
Private(Window* self, App::Private* app, Private* parent, intptr_t parentId = 0)
Private(Window* self, App* app, App::Private* appPriv, Private* parent, intptr_t parentId = 0)
: kApp(app),
kAppPriv(appPriv),
kSelf(self),
kView(puglCreate(parentId, "Window", 600, 500, false, false)),
fParent(parent),
@@ -80,9 +81,11 @@ public:
puglSetReshapeFunc(kView, onReshapeCallback);
puglSetCloseFunc(kView, onCloseCallback);

#if DISTRHO_OS_LINUX
PuglInternals* impl = kView->impl;

#if DISTRHO_OS_WINDOWS
hwnd = impl->hwnd;
#elif DISTRHO_OS_LINUX
xDisplay = impl->display;
xWindow = impl->win;

@@ -95,7 +98,7 @@ public:
}
#endif

kApp->addWindow(kSelf);
kAppPriv->addWindow(kSelf);
}

~Private()
@@ -104,7 +107,7 @@ public:

if (kView != nullptr)
{
kApp->removeWindow(kSelf);
kAppPriv->removeWindow(kSelf);
puglDestroy(kView);
}
}
@@ -212,9 +215,9 @@ public:
#endif

if (yesNo)
kApp->oneShown();
kAppPriv->oneShown();
else
kApp->oneHidden();
kAppPriv->oneHidden();
}

void setSize(unsigned int width, unsigned int height)
@@ -245,6 +248,11 @@ public:
#endif
}

App* getApp() const
{
return kApp;
}

int getModifiers()
{
return puglGetModifiers(kView);
@@ -384,7 +392,8 @@ protected:
}

private:
App::Private* const kApp;
App* const kApp;
App::Private* const kAppPriv;
Window* const kSelf;
PuglView* const kView;

@@ -454,12 +463,12 @@ private:
// Window

Window::Window(App* app, Window* parent)
: kPrivate(new Private(this, app->kPrivate, (parent != nullptr) ? parent->kPrivate : nullptr))
: kPrivate(new Private(this, app, app->kPrivate, (parent != nullptr) ? parent->kPrivate : nullptr))
{
}

Window::Window(App* app, intptr_t parentId)
: kPrivate(new Private(this, app->kPrivate, nullptr, parentId))
: kPrivate(new Private(this, app, app->kPrivate, nullptr, parentId))
{
}

@@ -508,6 +517,11 @@ void Window::setWindowTitle(const char* title)
kPrivate->setWindowTitle(title);
}

App* Window::getApp() const
{
return kPrivate->getApp();
}

int Window::getModifiers()
{
return kPrivate->getModifiers();


Loading…
Cancel
Save