Browse Source

Fixing

gh-pages
falkTX 11 years ago
parent
commit
0bff606f51
14 changed files with 54 additions and 57 deletions
  1. +1
    -1
      dgl/App.hpp
  2. +1
    -1
      dgl/CairoWidget.hpp
  3. +1
    -1
      dgl/ImageAboutWindow.hpp
  4. +0
    -1
      dgl/Makefile
  5. +1
    -1
      dgl/StandaloneWindow.hpp
  6. +1
    -1
      dgl/Widget.hpp
  7. +1
    -1
      dgl/Window.hpp
  8. +1
    -1
      dgl/src/App.cpp
  9. +36
    -36
      dgl/src/Window.cpp
  10. +1
    -1
      distrho/DistrhoPlugin.hpp
  11. +2
    -2
      distrho/DistrhoUI.hpp
  12. +3
    -5
      distrho/DistrhoUtils.hpp
  13. +4
    -4
      distrho/src/DistrhoDefines.h
  14. +1
    -1
      examples/nekobi-ui.cpp

+ 1
- 1
dgl/App.hpp View File

@@ -56,7 +56,7 @@ private:
void _oneShown(); void _oneShown();
void _oneHidden(); void _oneHidden();


DISTRHO_LEAK_DETECTOR(App)
DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(App)
}; };


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


+ 1
- 1
dgl/CairoWidget.hpp View File

@@ -198,7 +198,7 @@ private:
cairo_surface_t* fSurface; cairo_surface_t* fSurface;
GLuint fTextureId; GLuint fTextureId;


DISTRHO_LEAK_DETECTOR(CairoWidget)
DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(CairoWidget)
}; };


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


+ 1
- 1
dgl/ImageAboutWindow.hpp View File

@@ -48,7 +48,7 @@ protected:
private: private:
Image fImgBackground; Image fImgBackground;


DISTRHO_LEAK_DETECTOR(ImageAboutWindow)
DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(ImageAboutWindow)
}; };


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


+ 0
- 1
dgl/Makefile View File

@@ -16,7 +16,6 @@ LINK_FLAGS += $(DGL_LIBS)


OBJS = \ OBJS = \
src/App.cpp.o \ src/App.cpp.o \
src/Base.cpp.o \
src/Image.cpp.o \ src/Image.cpp.o \
src/ImageAboutWindow.cpp.o \ src/ImageAboutWindow.cpp.o \
src/ImageButton.cpp.o \ src/ImageButton.cpp.o \


+ 1
- 1
dgl/StandaloneWindow.hpp View File

@@ -71,7 +71,7 @@ protected:
App fApp; App fApp;
Window fWindow; Window fWindow;


DISTRHO_LEAK_DETECTOR(StandaloneWindow)
DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(StandaloneWindow)
}; };


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


+ 1
- 1
dgl/Widget.hpp View File

@@ -98,7 +98,7 @@ private:
friend class CairoWidget; friend class CairoWidget;
friend class Window; friend class Window;


DISTRHO_LEAK_DETECTOR(Widget)
DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(Widget)
}; };


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


+ 1
- 1
dgl/Window.hpp View File

@@ -78,7 +78,7 @@ private:
void _removeWidget(Widget* const widget); void _removeWidget(Widget* const widget);
void _idle(); void _idle();


DISTRHO_LEAK_DETECTOR(Window)
DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(Window)
}; };


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


+ 1
- 1
dgl/src/App.cpp View File

@@ -68,7 +68,7 @@ void App::exec()
while (pData->doLoop) while (pData->doLoop)
{ {
idle(); idle();
msleep(10);
d_msleep(10);
} }
} }




+ 36
- 36
dgl/src/Window.cpp View File

@@ -27,16 +27,16 @@


#include "pugl/pugl.h" #include "pugl/pugl.h"


#if defined(DGL_OS_WINDOWS)
#if defined(DISTRHO_OS_WINDOWS)
# include "pugl/pugl_win.cpp" # include "pugl/pugl_win.cpp"
#elif defined(DGL_OS_MAC)
#elif defined(DISTRHO_OS_MAC)
# include "pugl/pugl_osx_extended.h" # include "pugl/pugl_osx_extended.h"
extern "C" { extern "C" {
struct PuglViewImpl { struct PuglViewImpl {
int width; int width;
int height; int height;
};} };}
#elif defined(DGL_OS_LINUX)
#elif defined(DISTRHO_OS_LINUX)
# include <sys/types.h> # include <sys/types.h>
# include <unistd.h> # include <unistd.h>
extern "C" { extern "C" {
@@ -80,12 +80,12 @@ public:
fVisible(false), fVisible(false),
fResizable(true), fResizable(true),
fUsingEmbed(false), fUsingEmbed(false),
#if defined(DGL_OS_WINDOWS)
#if defined(DISTRHO_OS_WINDOWS)
hwnd(0) hwnd(0)
#elif defined(DGL_OS_LINUX)
#elif defined(DISTRHO_OS_LINUX)
xDisplay(nullptr), xDisplay(nullptr),
xWindow(0) xWindow(0)
#elif defined(DGL_OS_MAC)
#elif defined(DISTRHO_OS_MAC)
fNeedsIdle(true) fNeedsIdle(true)
#else #else
_dummy('\0') _dummy('\0')
@@ -104,12 +104,12 @@ public:
fResizable(true), fResizable(true),
fUsingEmbed(false), fUsingEmbed(false),
fModal(parent.pData), fModal(parent.pData),
#if defined(DGL_OS_WINDOWS)
#if defined(DISTRHO_OS_WINDOWS)
hwnd(0) hwnd(0)
#elif defined(DGL_OS_LINUX)
#elif defined(DISTRHO_OS_LINUX)
xDisplay(nullptr), xDisplay(nullptr),
xWindow(0) xWindow(0)
#elif defined(DGL_OS_MAC)
#elif defined(DISTRHO_OS_MAC)
fNeedsIdle(false) fNeedsIdle(false)
#else #else
_dummy('\0') _dummy('\0')
@@ -118,7 +118,7 @@ public:
DBG("Creating window with parent..."); DBGF; DBG("Creating window with parent..."); DBGF;
init(); init();


#ifdef DGL_OS_LINUX
#ifdef DISTRHO_OS_LINUX
const PuglInternals* const parentImpl(parent.pData->fView->impl); const PuglInternals* const parentImpl(parent.pData->fView->impl);


XSetTransientForHint(xDisplay, xWindow, parentImpl->win); XSetTransientForHint(xDisplay, xWindow, parentImpl->win);
@@ -133,12 +133,12 @@ public:
fVisible(parentId != 0), fVisible(parentId != 0),
fResizable(parentId == 0), fResizable(parentId == 0),
fUsingEmbed(parentId != 0), fUsingEmbed(parentId != 0),
#if defined(DGL_OS_WINDOWS)
#if defined(DISTRHO_OS_WINDOWS)
hwnd(0) hwnd(0)
#elif defined(DGL_OS_LINUX)
#elif defined(DISTRHO_OS_LINUX)
xDisplay(nullptr), xDisplay(nullptr),
xWindow(0) xWindow(0)
#elif defined(DGL_OS_MAC)
#elif defined(DISTRHO_OS_MAC)
fNeedsIdle(false) fNeedsIdle(false)
#else #else
_dummy('\0') _dummy('\0')
@@ -181,11 +181,11 @@ public:
puglSetReshapeFunc(fView, onReshapeCallback); puglSetReshapeFunc(fView, onReshapeCallback);
puglSetCloseFunc(fView, onCloseCallback); puglSetCloseFunc(fView, onCloseCallback);


#if defined(DGL_OS_WINDOWS)
#if defined(DISTRHO_OS_WINDOWS)
PuglInternals* impl = fView->impl; PuglInternals* impl = fView->impl;
hwnd = impl->hwnd; hwnd = impl->hwnd;
assert(hwnd != 0); assert(hwnd != 0);
#elif defined(DGL_OS_LINUX)
#elif defined(DISTRHO_OS_LINUX)
PuglInternals* impl = fView->impl; PuglInternals* impl = fView->impl;
xDisplay = impl->display; xDisplay = impl->display;
xWindow = impl->win; xWindow = impl->win;
@@ -228,9 +228,9 @@ public:
fView = nullptr; fView = nullptr;
} }


#if defined(DGL_OS_WINDOWS)
#if defined(DISTRHO_OS_WINDOWS)
hwnd = 0; hwnd = 0;
#elif defined(DGL_OS_LINUX)
#elif defined(DISTRHO_OS_LINUX)
xDisplay = nullptr; xDisplay = nullptr;
xWindow = 0; xWindow = 0;
#endif #endif
@@ -262,7 +262,7 @@ public:
for (; fVisible && fModal.enabled;) for (; fVisible && fModal.enabled;)
{ {
idle(); idle();
msleep(10);
d_msleep(10);
} }


exec_fini(); exec_fini();
@@ -278,13 +278,13 @@ public:
void focus() void focus()
{ {
DBG("Window focus\n"); DBG("Window focus\n");
#if defined(DGL_OS_WINDOWS)
#if defined(DISTRHO_OS_WINDOWS)
SetForegroundWindow(hwnd); SetForegroundWindow(hwnd);
SetActiveWindow(hwnd); SetActiveWindow(hwnd);
SetFocus(hwnd); SetFocus(hwnd);
#elif defined(DGL_OS_MAC)
#elif defined(DISTRHO_OS_MAC)
puglImplFocus(fView); puglImplFocus(fView);
#elif defined(DGL_OS_LINUX)
#elif defined(DISTRHO_OS_LINUX)
XRaiseWindow(xDisplay, xWindow); XRaiseWindow(xDisplay, xWindow);
XSetInputFocus(xDisplay, xWindow, RevertToPointerRoot, CurrentTime); XSetInputFocus(xDisplay, xWindow, RevertToPointerRoot, CurrentTime);
XFlush(xDisplay); XFlush(xDisplay);
@@ -324,16 +324,16 @@ public:
if (yesNo && fFirstInit) if (yesNo && fFirstInit)
setSize(static_cast<unsigned int>(fView->width), static_cast<unsigned int>(fView->height), true); setSize(static_cast<unsigned int>(fView->width), static_cast<unsigned int>(fView->height), true);


#if defined(DGL_OS_WINDOWS)
#if defined(DISTRHO_OS_WINDOWS)
if (yesNo) if (yesNo)
ShowWindow(hwnd, fFirstInit ? SW_SHOWNORMAL : SW_RESTORE); ShowWindow(hwnd, fFirstInit ? SW_SHOWNORMAL : SW_RESTORE);
else else
ShowWindow(hwnd, SW_HIDE); ShowWindow(hwnd, SW_HIDE);


UpdateWindow(hwnd); UpdateWindow(hwnd);
#elif defined(DGL_OS_MAC)
#elif defined(DISTRHO_OS_MAC)
puglImplSetVisible(fView, yesNo); puglImplSetVisible(fView, yesNo);
#elif defined(DGL_OS_LINUX)
#elif defined(DISTRHO_OS_LINUX)
if (yesNo) if (yesNo)
XMapRaised(xDisplay, xWindow); XMapRaised(xDisplay, xWindow);
else else
@@ -417,7 +417,7 @@ public:


DBGp("Window setSize called %s, size %i %i\n", forced ? "(forced)" : "(not forced)", width, height); DBGp("Window setSize called %s, size %i %i\n", forced ? "(forced)" : "(not forced)", width, height);


#if defined(DGL_OS_WINDOWS)
#if defined(DISTRHO_OS_WINDOWS)
int winFlags = WS_POPUPWINDOW | WS_CAPTION; int winFlags = WS_POPUPWINDOW | WS_CAPTION;


if (fResizable) if (fResizable)
@@ -430,9 +430,9 @@ public:


if (! forced) if (! forced)
UpdateWindow(hwnd); UpdateWindow(hwnd);
#elif defined(DGL_OS_MAC)
#elif defined(DISTRHO_OS_MAC)
puglImplSetSize(fView, width, height, forced); puglImplSetSize(fView, width, height, forced);
#elif defined(DGL_OS_LINUX)
#elif defined(DISTRHO_OS_LINUX)
XResizeWindow(xDisplay, xWindow, width, height); XResizeWindow(xDisplay, xWindow, width, height);


if (! fResizable) if (! fResizable)
@@ -464,18 +464,18 @@ public:
{ {
DBGp("Window setTitle \"%s\"\n", title); DBGp("Window setTitle \"%s\"\n", title);


#if defined(DGL_OS_WINDOWS)
#if defined(DISTRHO_OS_WINDOWS)
SetWindowTextA(hwnd, title); SetWindowTextA(hwnd, title);
#elif defined(DGL_OS_MAC)
#elif defined(DISTRHO_OS_MAC)
puglImplSetTitle(fView, title); puglImplSetTitle(fView, title);
#elif defined(DGL_OS_LINUX)
#elif defined(DISTRHO_OS_LINUX)
XStoreName(xDisplay, xWindow, title); XStoreName(xDisplay, xWindow, title);
#endif #endif
} }


void setTransientWinId(const intptr_t winId) void setTransientWinId(const intptr_t winId)
{ {
#if defined(DGL_OS_LINUX)
#if defined(DISTRHO_OS_LINUX)
XSetTransientForHint(xDisplay, xWindow, static_cast< ::Window>(winId)); XSetTransientForHint(xDisplay, xWindow, static_cast< ::Window>(winId));
#else #else
return; return;
@@ -522,7 +522,7 @@ public:
{ {
puglProcessEvents(fView); puglProcessEvents(fView);


#ifdef DGL_OS_MAC
#ifdef DISTRHO_OS_MAC
if (fNeedsIdle) if (fNeedsIdle)
puglImplIdle(fView); puglImplIdle(fView);
#endif #endif
@@ -547,7 +547,7 @@ public:
fModal.enabled = true; fModal.enabled = true;
fModal.parent->fModal.childFocus = this; fModal.parent->fModal.childFocus = this;


#ifdef DGL_OS_WINDOWS
#ifdef DISTRHO_OS_WINDOWS
// Center this window // Center this window
PuglInternals* const parentImpl = fModal.parent->fView->impl; PuglInternals* const parentImpl = fModal.parent->fView->impl;


@@ -744,12 +744,12 @@ private:
} }
} fModal; } fModal;


#if defined(DGL_OS_WINDOWS)
#if defined(DISTRHO_OS_WINDOWS)
HWND hwnd; HWND hwnd;
#elif defined(DGL_OS_LINUX)
#elif defined(DISTRHO_OS_LINUX)
Display* xDisplay; Display* xDisplay;
::Window xWindow; ::Window xWindow;
#elif defined(DGL_OS_MAC)
#elif defined(DISTRHO_OS_MAC)
bool fNeedsIdle; bool fNeedsIdle;
#else #else
char _dummy; char _dummy;


+ 1
- 1
distrho/DistrhoPlugin.hpp View File

@@ -17,7 +17,7 @@
#ifndef DISTRHO_PLUGIN_HPP_INCLUDED #ifndef DISTRHO_PLUGIN_HPP_INCLUDED
#define DISTRHO_PLUGIN_HPP_INCLUDED #define DISTRHO_PLUGIN_HPP_INCLUDED


#include "DistrhoUtils.hpp"
#include "extra/d_string.hpp"
#include "src/DistrhoPluginChecks.h" #include "src/DistrhoPluginChecks.h"


#include <cmath> #include <cmath>


+ 2
- 2
distrho/DistrhoUI.hpp View File

@@ -17,7 +17,7 @@
#ifndef DISTRHO_UI_HPP_INCLUDED #ifndef DISTRHO_UI_HPP_INCLUDED
#define DISTRHO_UI_HPP_INCLUDED #define DISTRHO_UI_HPP_INCLUDED


#include "DistrhoUtils.hpp"
#include "extra/d_leakdetector.hpp"
#include "src/DistrhoPluginChecks.h" #include "src/DistrhoPluginChecks.h"


#include "../dgl/Widget.hpp" #include "../dgl/Widget.hpp"
@@ -89,7 +89,7 @@ private:
PrivateData* const pData; PrivateData* const pData;
friend class UIExporter; friend class UIExporter;


DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(Plugin)
DISTRHO_DECLARE_NON_COPYABLE_WITH_LEAK_DETECTOR(UI)
}; };


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


+ 3
- 5
distrho/DistrhoUtils.hpp View File

@@ -63,6 +63,9 @@ long d_cconst(const int a, const int b, const int c, const int d) noexcept
return (a << 24) | (b << 16) | (c << 8) | (d << 0); return (a << 24) | (b << 16) | (c << 8) | (d << 0);
} }


static inline
void d_pass() noexcept {}

// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
// string print functions // string print functions


@@ -163,11 +166,6 @@ void d_msleep(const uint msecs)
} DISTRHO_SAFE_EXCEPTION("carla_msleep"); } DISTRHO_SAFE_EXCEPTION("carla_msleep");
} }


// -----------------------------------------------------------------------
// we always need this class

#include "extra/d_string.hpp"

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


#endif // DISTRHO_UTILS_HPP_INCLUDED #endif // DISTRHO_UTILS_HPP_INCLUDED

+ 4
- 4
distrho/src/DistrhoDefines.h View File

@@ -67,10 +67,10 @@
#endif #endif


/* Define DISTRHO_SAFE_ASSERT* */ /* Define DISTRHO_SAFE_ASSERT* */
#define DISTRHO_SAFE_ASSERT(cond) if (cond) pass(); else d_safe_assert(#cond, __FILE__, __LINE__);
#define DISTRHO_SAFE_ASSERT_BREAK(cond) if (cond) pass(); else { d_safe_assert(#cond, __FILE__, __LINE__); break; }
#define DISTRHO_SAFE_ASSERT_CONTINUE(cond) if (cond) pass(); else { d_safe_assert(#cond, __FILE__, __LINE__); continue; }
#define DISTRHO_SAFE_ASSERT_RETURN(cond, ret) if (cond) pass(); else { d_safe_assert(#cond, __FILE__, __LINE__); return ret; }
#define DISTRHO_SAFE_ASSERT(cond) if (cond) d_pass(); else d_safe_assert(#cond, __FILE__, __LINE__);
#define DISTRHO_SAFE_ASSERT_BREAK(cond) if (cond) d_pass(); else { d_safe_assert(#cond, __FILE__, __LINE__); break; }
#define DISTRHO_SAFE_ASSERT_CONTINUE(cond) if (cond) d_pass(); else { d_safe_assert(#cond, __FILE__, __LINE__); continue; }
#define DISTRHO_SAFE_ASSERT_RETURN(cond, ret) if (cond) d_pass(); else { d_safe_assert(#cond, __FILE__, __LINE__); return ret; }


/* Define DISTRHO_SAFE_EXCEPTION */ /* Define DISTRHO_SAFE_EXCEPTION */
#define DISTRHO_SAFE_EXCEPTION(msg) catch(...) { d_safe_exception(msg, __FILE__, __LINE__); } #define DISTRHO_SAFE_EXCEPTION(msg) catch(...) { d_safe_exception(msg, __FILE__, __LINE__); }


+ 1
- 1
examples/nekobi-ui.cpp View File

@@ -45,7 +45,7 @@ int main()
{ {
gui.idle(); gui.idle();
app.idle(); app.idle();
msleep(10);
d_msleep(10);
} }


return 0; return 0;


Loading…
Cancel
Save