Signed-off-by: falkTX <falktx@falktx.com>pull/272/head
@@ -67,9 +67,9 @@ enum Key { | |||||
kKeyDelete = 0x7F, | kKeyDelete = 0x7F, | ||||
// Backwards compatibility with old DPF | // Backwards compatibility with old DPF | ||||
kCharBackspace = kKeyBackspace, | |||||
kCharEscape = kKeyEscape, | |||||
kCharDelete = kKeyDelete, | |||||
kCharBackspace DISTRHO_DEPRECATED_BY("kKeyBackspace") = kKeyBackspace, | |||||
kCharEscape DISTRHO_DEPRECATED_BY("kKeyEscape") = kKeyEscape, | |||||
kCharDelete DISTRHO_DEPRECATED_BY("kKeyDelete") = kKeyDelete, | |||||
// Unicode Private Use Area | // Unicode Private Use Area | ||||
kKeyF1 = 0xE000, | kKeyF1 = 0xE000, | ||||
@@ -374,7 +374,7 @@ public: | |||||
Draw this line using the current OpenGL state. | Draw this line using the current OpenGL state. | ||||
DEPRECATED please use draw(const GraphicsContext&) instead. | DEPRECATED please use draw(const GraphicsContext&) instead. | ||||
*/ | */ | ||||
// TODO mark deprecated | |||||
DISTRHO_DEPRECATED_BY("draw(const GraphicsContext&)") | |||||
void draw(); | void draw(); | ||||
#endif | #endif | ||||
@@ -492,14 +492,14 @@ public: | |||||
Draw this circle using the current OpenGL state. | Draw this circle using the current OpenGL state. | ||||
DEPRECATED please use draw(const GraphicsContext&) instead. | DEPRECATED please use draw(const GraphicsContext&) instead. | ||||
*/ | */ | ||||
// TODO mark deprecated | |||||
DISTRHO_DEPRECATED_BY("draw(const GraphicsContext&)") | |||||
void draw(); | void draw(); | ||||
/** | /** | ||||
Draw lines (outline of this circle) using the current OpenGL state. | Draw lines (outline of this circle) using the current OpenGL state. | ||||
DEPRECATED please use draw(const GraphicsContext&) instead. | |||||
DEPRECATED please use draw(const GraphicsContext&,T) instead. | |||||
*/ | */ | ||||
// TODO mark deprecated | |||||
DISTRHO_DEPRECATED_BY("drawOutline(const GraphicsContext&)") | |||||
void drawOutline(); | void drawOutline(); | ||||
#endif | #endif | ||||
@@ -585,14 +585,14 @@ public: | |||||
Draw this triangle using the current OpenGL state. | Draw this triangle using the current OpenGL state. | ||||
DEPRECATED please use draw(const GraphicsContext&) instead. | DEPRECATED please use draw(const GraphicsContext&) instead. | ||||
*/ | */ | ||||
// TODO mark deprecated | |||||
DISTRHO_DEPRECATED_BY("draw(const GraphicsContext&)") | |||||
void draw(); | void draw(); | ||||
/** | /** | ||||
Draw lines (outline of this triangle) using the current OpenGL state. | Draw lines (outline of this triangle) using the current OpenGL state. | ||||
DEPRECATED please use draw(const GraphicsContext&) instead. | |||||
DEPRECATED please use draw(const GraphicsContext&,T) instead. | |||||
*/ | */ | ||||
// TODO mark deprecated | |||||
DISTRHO_DEPRECATED_BY("drawOutline(const GraphicsContext&)") | |||||
void drawOutline(); | void drawOutline(); | ||||
#endif | #endif | ||||
@@ -804,14 +804,14 @@ public: | |||||
Draw this rectangle using the current OpenGL state. | Draw this rectangle using the current OpenGL state. | ||||
DEPRECATED please use draw(const GraphicsContext&) instead. | DEPRECATED please use draw(const GraphicsContext&) instead. | ||||
*/ | */ | ||||
// TODO mark deprecated | |||||
DISTRHO_DEPRECATED_BY("draw(const GraphicsContext&)") | |||||
void draw(); | void draw(); | ||||
/** DEPRECATED | /** DEPRECATED | ||||
Draw lines (outline of this rectangle) using the current OpenGL state. | Draw lines (outline of this rectangle) using the current OpenGL state. | ||||
DEPRECATED please use drawOutline(const GraphicsContext&) instead. | |||||
DEPRECATED please use drawOutline(const GraphicsContext&,T) instead. | |||||
*/ | */ | ||||
// TODO mark deprecated | |||||
DISTRHO_DEPRECATED_BY("drawOutline(const GraphicsContext&)") | |||||
void drawOutline(); | void drawOutline(); | ||||
private: | private: | ||||
@@ -22,7 +22,7 @@ | |||||
START_NAMESPACE_DGL | START_NAMESPACE_DGL | ||||
// TODO mark as deprecated | |||||
DISTRHO_DEPRECATED_BY("OpenGLImage") | |||||
typedef OpenGLImage Image; | typedef OpenGLImage Image; | ||||
END_NAMESPACE_DGL | END_NAMESPACE_DGL | ||||
@@ -180,19 +180,19 @@ public: | |||||
/** | /** | ||||
Draw this image at (0, 0) point using the current OpenGL context. | Draw this image at (0, 0) point using the current OpenGL context. | ||||
*/ | */ | ||||
// TODO mark as deprecated | |||||
DISTRHO_DEPRECATED_BY("draw(const GraphicsContext&)") | |||||
void draw(); | void draw(); | ||||
/** | /** | ||||
Draw this image at (x, y) point using the current OpenGL context. | Draw this image at (x, y) point using the current OpenGL context. | ||||
*/ | */ | ||||
// TODO mark as deprecated | |||||
DISTRHO_DEPRECATED_BY("drawAt(const GraphicsContext&,int,int)") | |||||
void drawAt(const int x, const int y); | void drawAt(const int x, const int y); | ||||
/** | /** | ||||
Draw this image at position @a pos using the current OpenGL context. | Draw this image at position @a pos using the current OpenGL context. | ||||
*/ | */ | ||||
// TODO mark as deprecated | |||||
DISTRHO_DEPRECATED_BY("drawAt(const GraphicsContext&,const Point<int>&)") | |||||
void drawAt(const Point<int>& pos); | void drawAt(const Point<int>& pos); | ||||
// FIXME this should not be needed | // FIXME this should not be needed | ||||
@@ -203,8 +203,9 @@ public: | |||||
/** | /** | ||||
Get the image type. | Get the image type. | ||||
DEPRECATED Type is always assumed to be GL_UNSIGNED_BYTE. | |||||
*/ | */ | ||||
// TODO mark as deprecated | |||||
DISTRHO_DEPRECATED | |||||
GLenum getType() const noexcept { return GL_UNSIGNED_BYTE; } | GLenum getType() const noexcept { return GL_UNSIGNED_BYTE; } | ||||
private: | private: | ||||
@@ -216,7 +217,7 @@ private: | |||||
typedef ImageBaseAboutWindow<OpenGLImage> OpenGLImageAboutWindow; | typedef ImageBaseAboutWindow<OpenGLImage> OpenGLImageAboutWindow; | ||||
// TODO deprecated | |||||
DISTRHO_DEPRECATED_BY("OpenGLImageAboutWindow") | |||||
typedef OpenGLImageAboutWindow ImageAboutWindow; | typedef OpenGLImageAboutWindow ImageAboutWindow; | ||||
// ----------------------------------------------------------------------- | // ----------------------------------------------------------------------- | ||||
@@ -77,8 +77,10 @@ public: | |||||
bool keepAspectRatio = false, | bool keepAspectRatio = false, | ||||
bool automaticallyScale = false); | bool automaticallyScale = false); | ||||
// TODO deprecated | |||||
DISTRHO_DEPRECATED_BY("getApp()") | |||||
Application& getParentApp() const noexcept { return getApp(); } | Application& getParentApp() const noexcept { return getApp(); } | ||||
DISTRHO_DEPRECATED_BY("getWindow()") | |||||
Window& getParentWindow() const noexcept { return getWindow(); } | Window& getParentWindow() const noexcept { return getWindow(); } | ||||
private: | private: | ||||
@@ -172,8 +172,10 @@ public: | |||||
*/ | */ | ||||
virtual void repaint() noexcept; | virtual void repaint() noexcept; | ||||
// TODO deprecated | |||||
DISTRHO_DEPRECATED_BY("getApp()") | |||||
Application& getParentApp() const noexcept { return getApp(); } | Application& getParentApp() const noexcept { return getApp(); } | ||||
DISTRHO_DEPRECATED_BY("getWindow()") | |||||
Window& getParentWindow() const noexcept { return getWindow(); } | Window& getParentWindow() const noexcept { return getWindow(); } | ||||
protected: | protected: | ||||
@@ -276,9 +276,13 @@ public: | |||||
void setTransientWinId(uintptr_t winId); | void setTransientWinId(uintptr_t winId); | ||||
*/ | */ | ||||
// TODO deprecated | |||||
DISTRHO_DEPRECATED_BY("isIgnoringKeyRepeat()") | |||||
inline bool getIgnoringKeyRepeat() const noexcept { return isIgnoringKeyRepeat(); } | inline bool getIgnoringKeyRepeat() const noexcept { return isIgnoringKeyRepeat(); } | ||||
inline double getScaling() const noexcept { return getScaling(); } | |||||
DISTRHO_DEPRECATED_BY("getScaleFactor()") | |||||
inline double getScaling() const noexcept { return getScaleFactor(); } | |||||
DISTRHO_DEPRECATED_BY("runAsModal(bool)") | |||||
inline void exec(bool blockWait = false) { runAsModal(blockWait); } | inline void exec(bool blockWait = false) { runAsModal(blockWait); } | ||||
protected: | protected: | ||||
@@ -75,6 +75,15 @@ | |||||
# define DISTRHO_DEPRECATED | # define DISTRHO_DEPRECATED | ||||
#endif | #endif | ||||
/* Define DISTRHO_DEPRECATED_BY */ | |||||
#if defined(__clang__) | |||||
# define DISTRHO_DEPRECATED_BY(other) __attribute__((deprecated("", other))) | |||||
#elif defined(__GNUC__) | |||||
# define DISTRHO_DEPRECATED_BY(other) __attribute__((deprecated("Use " other))) | |||||
#else | |||||
# define DISTRHO_DEPRECATED_BY(other) DISTRHO_DEPRECATED | |||||
#endif | |||||
/* Define DISTRHO_SAFE_ASSERT* */ | /* Define DISTRHO_SAFE_ASSERT* */ | ||||
#define DISTRHO_SAFE_ASSERT(cond) if (! (cond)) d_safe_assert(#cond, __FILE__, __LINE__); | #define DISTRHO_SAFE_ASSERT(cond) if (! (cond)) d_safe_assert(#cond, __FILE__, __LINE__); | ||||
#define DISTRHO_SAFE_ASSERT_BREAK(cond) if (! (cond)) { d_safe_assert(#cond, __FILE__, __LINE__); break; } | #define DISTRHO_SAFE_ASSERT_BREAK(cond) if (! (cond)) { d_safe_assert(#cond, __FILE__, __LINE__); break; } | ||||