Browse Source

Fixing

gh-pages
falkTX 10 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 _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;
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:
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 = \
src/App.cpp.o \
src/Base.cpp.o \
src/Image.cpp.o \
src/ImageAboutWindow.cpp.o \
src/ImageButton.cpp.o \


+ 1
- 1
dgl/StandaloneWindow.hpp View File

@@ -71,7 +71,7 @@ protected:
App fApp;
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 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 _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)
{
idle();
msleep(10);
d_msleep(10);
}
}



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

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

#include "pugl/pugl.h"

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

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

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

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

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

exec_fini();
@@ -278,13 +278,13 @@ public:
void focus()
{
DBG("Window focus\n");
#if defined(DGL_OS_WINDOWS)
#if defined(DISTRHO_OS_WINDOWS)
SetForegroundWindow(hwnd);
SetActiveWindow(hwnd);
SetFocus(hwnd);
#elif defined(DGL_OS_MAC)
#elif defined(DISTRHO_OS_MAC)
puglImplFocus(fView);
#elif defined(DGL_OS_LINUX)
#elif defined(DISTRHO_OS_LINUX)
XRaiseWindow(xDisplay, xWindow);
XSetInputFocus(xDisplay, xWindow, RevertToPointerRoot, CurrentTime);
XFlush(xDisplay);
@@ -324,16 +324,16 @@ public:
if (yesNo && fFirstInit)
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)
ShowWindow(hwnd, fFirstInit ? SW_SHOWNORMAL : SW_RESTORE);
else
ShowWindow(hwnd, SW_HIDE);

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

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;

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

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

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

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

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

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

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

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

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


+ 1
- 1
distrho/DistrhoPlugin.hpp View File

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

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

#include <cmath>


+ 2
- 2
distrho/DistrhoUI.hpp View File

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

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

#include "../dgl/Widget.hpp"
@@ -89,7 +89,7 @@ private:
PrivateData* const pData;
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);
}

static inline
void d_pass() noexcept {}

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

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

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

#include "extra/d_string.hpp"

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

#endif // DISTRHO_UTILS_HPP_INCLUDED

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

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

/* 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(msg) catch(...) { d_safe_exception(msg, __FILE__, __LINE__); }


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

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

return 0;


Loading…
Cancel
Save