@@ -24,9 +24,11 @@ | |||||
// ----------------------------------------------------------------------- | // ----------------------------------------------------------------------- | ||||
// Forward class names | // Forward class names | ||||
#ifdef DISTRHO_DEFINES_H_INCLUDED | |||||
START_NAMESPACE_DISTRHO | START_NAMESPACE_DISTRHO | ||||
class UI; | class UI; | ||||
END_NAMESPACE_DISTRHO | END_NAMESPACE_DISTRHO | ||||
#endif | |||||
START_NAMESPACE_DGL | START_NAMESPACE_DGL | ||||
@@ -394,7 +396,9 @@ private: | |||||
friend class NanoWidget; | friend class NanoWidget; | ||||
friend class Window; | friend class Window; | ||||
friend class StandaloneWindow; | friend class StandaloneWindow; | ||||
#ifdef DISTRHO_DEFINES_H_INCLUDED | |||||
friend class DISTRHO_NAMESPACE::UI; | friend class DISTRHO_NAMESPACE::UI; | ||||
#endif | |||||
DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(Widget) | DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(Widget) | ||||
}; | }; | ||||
@@ -19,9 +19,11 @@ | |||||
#include "Geometry.hpp" | #include "Geometry.hpp" | ||||
#ifdef DISTRHO_DEFINES_H_INCLUDED | |||||
START_NAMESPACE_DISTRHO | START_NAMESPACE_DISTRHO | ||||
class UIExporter; | class UIExporter; | ||||
END_NAMESPACE_DISTRHO | END_NAMESPACE_DISTRHO | ||||
#endif | |||||
START_NAMESPACE_DGL | START_NAMESPACE_DGL | ||||
@@ -129,7 +131,9 @@ private: | |||||
friend class Application; | friend class Application; | ||||
friend class Widget; | friend class Widget; | ||||
friend class StandaloneWindow; | friend class StandaloneWindow; | ||||
#ifdef DISTRHO_DEFINES_H_INCLUDED | |||||
friend class DISTRHO_NAMESPACE::UIExporter; | friend class DISTRHO_NAMESPACE::UIExporter; | ||||
#endif | |||||
virtual void _addWidget(Widget* const widget); | virtual void _addWidget(Widget* const widget); | ||||
virtual void _removeWidget(Widget* const widget); | virtual void _removeWidget(Widget* const widget); | ||||
@@ -32,6 +32,8 @@ | |||||
#if defined(DISTRHO_OS_WINDOWS) | #if defined(DISTRHO_OS_WINDOWS) | ||||
# include "pugl/pugl_win.cpp" | # include "pugl/pugl_win.cpp" | ||||
# undef max | |||||
# undef min | |||||
#elif defined(DISTRHO_OS_MAC) | #elif defined(DISTRHO_OS_MAC) | ||||
# define PuglWindow DISTRHO_JOIN_MACRO(PuglWindow, DGL_NAMESPACE) | # define PuglWindow DISTRHO_JOIN_MACRO(PuglWindow, DGL_NAMESPACE) | ||||
# define PuglOpenGLView DISTRHO_JOIN_MACRO(PuglOpenGLView, DGL_NAMESPACE) | # define PuglOpenGLView DISTRHO_JOIN_MACRO(PuglOpenGLView, DGL_NAMESPACE) | ||||
@@ -573,7 +575,7 @@ struct Window::PrivateData { | |||||
#if defined(DISTRHO_OS_WINDOWS) | #if defined(DISTRHO_OS_WINDOWS) | ||||
const int winFlags = WS_POPUPWINDOW | WS_CAPTION | (fResizable ? WS_SIZEBOX : 0x0); | const int winFlags = WS_POPUPWINDOW | WS_CAPTION | (fResizable ? WS_SIZEBOX : 0x0); | ||||
RECT wr = { 0, 0, static_cast<long>(width), static_cast<long>(height) }; | |||||
RECT wr = { 0, 0, static_cast<LONG>(width), static_cast<LONG>(height) }; | |||||
AdjustWindowRectEx(&wr, fUsingEmbed ? WS_CHILD : winFlags, FALSE, WS_EX_TOPMOST); | AdjustWindowRectEx(&wr, fUsingEmbed ? WS_CHILD : winFlags, FALSE, WS_EX_TOPMOST); | ||||
SetWindowPos(hwnd, 0, 0, 0, wr.right-wr.left, wr.bottom-wr.top, | SetWindowPos(hwnd, 0, 0, 0, wr.right-wr.left, wr.bottom-wr.top, | ||||
@@ -111,7 +111,11 @@ puglCreateWindow(PuglView* view, const char* title) | |||||
static int wc_count = 0; | static int wc_count = 0; | ||||
char classNameBuf[256]; | char classNameBuf[256]; | ||||
std::srand((std::time(NULL))); | std::srand((std::time(NULL))); | ||||
#ifdef __WINE__ | |||||
std::snprintf(classNameBuf, sizeof(classNameBuf), "%s_%d-%d", title, std::rand(), ++wc_count); | |||||
#else | |||||
_snprintf(classNameBuf, sizeof(classNameBuf), "%s_%d-%d", title, std::rand(), ++wc_count); | _snprintf(classNameBuf, sizeof(classNameBuf), "%s_%d-%d", title, std::rand(), ++wc_count); | ||||
#endif | |||||
classNameBuf[sizeof(classNameBuf)-1] = '\0'; | classNameBuf[sizeof(classNameBuf)-1] = '\0'; | ||||
impl->wc.style = CS_OWNDC; | impl->wc.style = CS_OWNDC; | ||||