From 96ca7a5a2ae976c587c676baf87446a55961e507 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 6 Jun 2022 22:34:08 -0400 Subject: Consolidate common deprecated API implementation --- include/pugl/pugl.h | 32 ++++++++++++++++++++------------ 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 -- cgit v1.2.1