|
|
@@ -44,8 +44,9 @@ START_NAMESPACE_DISTRHO |
|
|
class Window::Private |
|
|
class Window::Private |
|
|
{ |
|
|
{ |
|
|
public: |
|
|
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), |
|
|
: kApp(app), |
|
|
|
|
|
kAppPriv(appPriv), |
|
|
kSelf(self), |
|
|
kSelf(self), |
|
|
kView(puglCreate(parentId, "Window", 600, 500, false, false)), |
|
|
kView(puglCreate(parentId, "Window", 600, 500, false, false)), |
|
|
fParent(parent), |
|
|
fParent(parent), |
|
|
@@ -80,9 +81,11 @@ public: |
|
|
puglSetReshapeFunc(kView, onReshapeCallback); |
|
|
puglSetReshapeFunc(kView, onReshapeCallback); |
|
|
puglSetCloseFunc(kView, onCloseCallback); |
|
|
puglSetCloseFunc(kView, onCloseCallback); |
|
|
|
|
|
|
|
|
#if DISTRHO_OS_LINUX |
|
|
|
|
|
PuglInternals* impl = kView->impl; |
|
|
PuglInternals* impl = kView->impl; |
|
|
|
|
|
|
|
|
|
|
|
#if DISTRHO_OS_WINDOWS |
|
|
|
|
|
hwnd = impl->hwnd; |
|
|
|
|
|
#elif DISTRHO_OS_LINUX |
|
|
xDisplay = impl->display; |
|
|
xDisplay = impl->display; |
|
|
xWindow = impl->win; |
|
|
xWindow = impl->win; |
|
|
|
|
|
|
|
|
@@ -95,7 +98,7 @@ public: |
|
|
} |
|
|
} |
|
|
#endif |
|
|
#endif |
|
|
|
|
|
|
|
|
kApp->addWindow(kSelf); |
|
|
|
|
|
|
|
|
kAppPriv->addWindow(kSelf); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
~Private() |
|
|
~Private() |
|
|
@@ -104,7 +107,7 @@ public: |
|
|
|
|
|
|
|
|
if (kView != nullptr) |
|
|
if (kView != nullptr) |
|
|
{ |
|
|
{ |
|
|
kApp->removeWindow(kSelf); |
|
|
|
|
|
|
|
|
kAppPriv->removeWindow(kSelf); |
|
|
puglDestroy(kView); |
|
|
puglDestroy(kView); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
@@ -212,9 +215,9 @@ public: |
|
|
#endif |
|
|
#endif |
|
|
|
|
|
|
|
|
if (yesNo) |
|
|
if (yesNo) |
|
|
kApp->oneShown(); |
|
|
|
|
|
|
|
|
kAppPriv->oneShown(); |
|
|
else |
|
|
else |
|
|
kApp->oneHidden(); |
|
|
|
|
|
|
|
|
kAppPriv->oneHidden(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
void setSize(unsigned int width, unsigned int height) |
|
|
void setSize(unsigned int width, unsigned int height) |
|
|
@@ -245,6 +248,11 @@ public: |
|
|
#endif |
|
|
#endif |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
App* getApp() const |
|
|
|
|
|
{ |
|
|
|
|
|
return kApp; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
int getModifiers() |
|
|
int getModifiers() |
|
|
{ |
|
|
{ |
|
|
return puglGetModifiers(kView); |
|
|
return puglGetModifiers(kView); |
|
|
@@ -384,7 +392,8 @@ protected: |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
private: |
|
|
private: |
|
|
App::Private* const kApp; |
|
|
|
|
|
|
|
|
App* const kApp; |
|
|
|
|
|
App::Private* const kAppPriv; |
|
|
Window* const kSelf; |
|
|
Window* const kSelf; |
|
|
PuglView* const kView; |
|
|
PuglView* const kView; |
|
|
|
|
|
|
|
|
@@ -454,12 +463,12 @@ private: |
|
|
// Window |
|
|
// Window |
|
|
|
|
|
|
|
|
Window::Window(App* app, Window* parent) |
|
|
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) |
|
|
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); |
|
|
kPrivate->setWindowTitle(title); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
App* Window::getApp() const |
|
|
|
|
|
{ |
|
|
|
|
|
return kPrivate->getApp(); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
int Window::getModifiers() |
|
|
int Window::getModifiers() |
|
|
{ |
|
|
{ |
|
|
return kPrivate->getModifiers(); |
|
|
return kPrivate->getModifiers(); |
|
|
|