aboutsummaryrefslogtreecommitdiffstats
path: root/pugl/pugl.h
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2019-08-04 18:09:55 +0200
committerDavid Robillard <d@drobilla.net>2019-09-03 08:34:39 +0200
commit411c7ddbb044d0eae8307858d1254ca830f0a44a (patch)
treeea84103827e11fa7069f2e314227543577600da8 /pugl/pugl.h
parentd015bf0d762b40c6c0d5a7af71add8710d3792ad (diff)
downloadpugl-411c7ddbb044d0eae8307858d1254ca830f0a44a.tar.gz
pugl-411c7ddbb044d0eae8307858d1254ca830f0a44a.tar.bz2
pugl-411c7ddbb044d0eae8307858d1254ca830f0a44a.zip
Move deprecated API to a separate section of the header
This just makes things easier to read.
Diffstat (limited to 'pugl/pugl.h')
-rw-r--r--pugl/pugl.h165
1 files changed, 87 insertions, 78 deletions
diff --git a/pugl/pugl.h b/pugl/pugl.h
index 6b60f69..457b780 100644
--- a/pugl/pugl.h
+++ b/pugl/pugl.h
@@ -41,14 +41,6 @@
# define PUGL_API
#endif
-#if defined(__clang__)
-# define PUGL_DEPRECATED_BY(name) __attribute__((deprecated("", name)))
-#elif defined(__GNUC__)
-# define PUGL_DEPRECATED_BY(name) __attribute__((deprecated("Use " name)))
-#else
-# define PUGL_DEPRECATED_BY(name)
-#endif
-
#ifdef __cplusplus
extern "C" {
#endif
@@ -504,21 +496,6 @@ puglDispatchEvents(PuglWorld* world);
*/
/**
- Create a Pugl application and view.
-
- To create a window, call the various puglInit* functions as necessary, then
- call puglCreateWindow().
-
- @deprecated Use puglNewApp() and puglNewView().
-
- @param pargc Pointer to argument count (currently unused).
- @param argv Arguments (currently unused).
- @return A newly created view.
-*/
-PUGL_API PUGL_DEPRECATED_BY("puglNewView") PuglView*
-puglInit(int* pargc, char** argv);
-
-/**
Create a new view.
A view represents a window, but a window will not be shown until configured
@@ -558,14 +535,6 @@ PUGL_API void
puglInitWindowParent(PuglView* view, PuglNativeWindow parent);
/**
- Set the window size before creating a window.
-
- @deprecated Use puglSetFrame().
-*/
-PUGL_API PUGL_DEPRECATED_BY("puglSetFrame") void
-puglInitWindowSize(PuglView* view, int width, int height);
-
-/**
Set the minimum window size before creating a window.
*/
PUGL_API void
@@ -589,14 +558,6 @@ puglInitWindowAspectRatio(PuglView* view,
int maxY);
/**
- Enable or disable resizing before creating a window.
-
- @deprecated Use puglInitWindowHint() with @ref PUGL_RESIZABLE.
-*/
-PUGL_API PUGL_DEPRECATED_BY("puglInitWindowHint") void
-puglInitResizable(PuglView* view, bool resizable);
-
-/**
Set transient parent before creating a window.
On X11, parent must be a Window.
@@ -675,12 +636,6 @@ PUGL_API bool
puglGetVisible(PuglView* view);
/**
- Get the current size of the view.
-*/
-PUGL_API PUGL_DEPRECATED_BY("puglGetFrame") void
-puglGetSize(PuglView* view, int* width, int* height);
-
-/**
Get the current position and size of the view.
*/
PUGL_API PuglRect
@@ -753,14 +708,6 @@ PUGL_API void
puglSetEventFunc(PuglView* view, PuglEventFunc eventFunc);
/**
- Ignore synthetic repeated key events.
-
- @deprecated Use puglInitWindowHint() with @ref PUGL_IGNORE_KEY_REPEAT.
-*/
-PUGL_API PUGL_DEPRECATED_BY("puglInitWindowHint") void
-puglIgnoreKeyRepeat(PuglView* view, bool ignore);
-
-/**
Return true iff `view` has the input focus.
*/
PUGL_API bool
@@ -783,31 +730,6 @@ PUGL_API void
puglRequestAttention(PuglView* view);
/**
- Block and wait for an event to be ready.
-
- This can be used in a loop to only process events via puglProcessEvents when
- necessary. This function will block indefinitely if no events are
- available, so is not appropriate for use in programs that need to perform
- regular updates (e.g. animation).
-
- @deprecated Use puglPollEvents().
-*/
-PUGL_API PUGL_DEPRECATED_BY("puglPollEvents") PuglStatus
-puglWaitForEvent(PuglView* view);
-
-/**
- Process all pending window events.
-
- This handles input events as well as rendering, so it should be called
- regularly and rapidly enough to keep the UI responsive. This function does
- not block if no events are pending.
-
- @deprecated Use puglDispatchEvents().
-*/
-PUGL_API PUGL_DEPRECATED_BY("puglDispatchEvents") PuglStatus
-puglProcessEvents(PuglView* view);
-
-/**
@}
*/
@@ -829,6 +751,34 @@ PUGL_API void
puglPostRedisplay(PuglView* view);
/**
+ @name Deprecated API
+ @{
+*/
+
+#if defined(__clang__)
+# define PUGL_DEPRECATED_BY(name) __attribute__((deprecated("", name)))
+#elif defined(__GNUC__)
+# define PUGL_DEPRECATED_BY(name) __attribute__((deprecated("Use " name)))
+#else
+# define PUGL_DEPRECATED_BY(name)
+#endif
+
+/**
+ Create a Pugl application and view.
+
+ To create a window, call the various puglInit* functions as necessary, then
+ call puglCreateWindow().
+
+ @deprecated Use puglNewApp() and puglNewView().
+
+ @param pargc Pointer to argument count (currently unused).
+ @param argv Arguments (currently unused).
+ @return A newly created view.
+*/
+PUGL_API PUGL_DEPRECATED_BY("puglNewView") PuglView*
+puglInit(int* pargc, char** argv);
+
+/**
Destroy an app and view created with `puglInit()`.
@deprecated Use puglFreeApp() and puglFreeView().
@@ -837,6 +787,65 @@ PUGL_API PUGL_DEPRECATED_BY("puglFreeView") void
puglDestroy(PuglView* view);
/**
+ Set the window size before creating a window.
+
+ @deprecated Use puglSetFrame().
+*/
+PUGL_API PUGL_DEPRECATED_BY("puglSetFrame") void
+puglInitWindowSize(PuglView* view, int width, int height);
+
+/**
+ Enable or disable resizing before creating a window.
+
+ @deprecated Use puglInitWindowHint() with @ref PUGL_RESIZABLE.
+*/
+PUGL_API PUGL_DEPRECATED_BY("puglInitWindowHint") void
+puglInitResizable(PuglView* view, bool resizable);
+
+/**
+ Get the current size of the view.
+
+ @deprecated Use puglGetFrame().
+
+*/
+PUGL_API PUGL_DEPRECATED_BY("puglGetFrame") void
+puglGetSize(PuglView* view, int* width, int* height);
+
+/**
+ Ignore synthetic repeated key events.
+
+ @deprecated Use puglInitWindowHint() with @ref PUGL_IGNORE_KEY_REPEAT.
+*/
+PUGL_API PUGL_DEPRECATED_BY("puglInitWindowHint") void
+puglIgnoreKeyRepeat(PuglView* view, bool ignore);
+
+/**
+ Block and wait for an event to be ready.
+
+ This can be used in a loop to only process events via puglProcessEvents when
+ necessary. This function will block indefinitely if no events are
+ available, so is not appropriate for use in programs that need to perform
+ regular updates (e.g. animation).
+
+ @deprecated Use puglPollEvents().
+*/
+PUGL_API PUGL_DEPRECATED_BY("puglPollEvents") PuglStatus
+puglWaitForEvent(PuglView* view);
+
+/**
+ Process all pending window events.
+
+ This handles input events as well as rendering, so it should be called
+ regularly and rapidly enough to keep the UI responsive. This function does
+ not block if no events are pending.
+
+ @deprecated Use puglDispatchEvents().
+*/
+PUGL_API PUGL_DEPRECATED_BY("puglDispatchEvents") PuglStatus
+puglProcessEvents(PuglView* view);
+
+/**
+ @}
@}
*/