diff options
author | David Robillard <d@drobilla.net> | 2022-06-06 22:34:08 -0400 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2022-06-08 22:04:49 -0400 |
commit | 96ca7a5a2ae976c587c676baf87446a55961e507 (patch) | |
tree | 6e9eeb5dc0305cc9cdfd0b69c31473224ae7fc6e | |
parent | 8f505887090d0d6a16a0f3b06638fa297b9a4255 (diff) | |
download | pugl-96ca7a5a2ae976c587c676baf87446a55961e507.tar.gz pugl-96ca7a5a2ae976c587c676baf87446a55961e507.tar.bz2 pugl-96ca7a5a2ae976c587c676baf87446a55961e507.zip |
Consolidate common deprecated API implementation
-rw-r--r-- | include/pugl/pugl.h | 32 | ||||
-rw-r--r-- | src/common.c | 28 |
2 files changed, 20 insertions, 40 deletions
diff --git a/include/pugl/pugl.h b/include/pugl/pugl.h index 38d93b7..dc9c010 100644 --- a/include/pugl/pugl.h +++ b/include/pugl/pugl.h @@ -1795,10 +1795,12 @@ puglProcessEvents(PuglView* view); @deprecated Use puglUpdate(). */ -PUGL_API -PUGL_DEPRECATED_BY("puglUpdate") +static inline PUGL_DEPRECATED_BY("puglUpdate") PuglStatus -puglPollEvents(PuglWorld* world, double timeout); +puglPollEvents(PuglWorld* world, double timeout) +{ + return puglUpdate(world, timeout); +} /** Dispatch any pending events to views. @@ -1810,20 +1812,26 @@ puglPollEvents(PuglWorld* world, double timeout); @deprecated Use puglUpdate(). */ -PUGL_API -PUGL_DEPRECATED_BY("puglUpdate") +static inline PUGL_DEPRECATED_BY("puglUpdate") PuglStatus -puglDispatchEvents(PuglWorld* world); +puglDispatchEvents(PuglWorld* world) +{ + return puglUpdate(world, 0.0); +} -PUGL_API -PUGL_DEPRECATED_BY("puglShow") +static inline PUGL_DEPRECATED_BY("puglShow") PuglStatus -puglShowWindow(PuglView* view); +puglShowWindow(PuglView* view) +{ + return puglShow(view); +} -PUGL_API -PUGL_DEPRECATED_BY("puglHide") +static inline PUGL_DEPRECATED_BY("puglHide") PuglStatus -puglHideWindow(PuglView* view); +puglHideWindow(PuglView* view) +{ + return puglHide(view); +} /** Set the default size of the view. diff --git a/src/common.c b/src/common.c index dc01da4..9ea3594 100644 --- a/src/common.c +++ b/src/common.c @@ -267,31 +267,3 @@ puglGetContext(PuglView* view) { return view->backend->getContext(view); } - -#ifndef PUGL_DISABLE_DEPRECATED - -PuglStatus -puglPollEvents(PuglWorld* world, double timeout) -{ - return puglUpdate(world, timeout); -} - -PuglStatus -puglDispatchEvents(PuglWorld* world) -{ - return puglUpdate(world, 0.0); -} - -PuglStatus -puglShowWindow(PuglView* view) -{ - return puglShow(view); -} - -PuglStatus -puglHideWindow(PuglView* view) -{ - return puglHide(view); -} - -#endif |