aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2025-02-07 15:41:18 -0500
committerDavid Robillard <d@drobilla.net>2025-02-07 15:41:18 -0500
commit2d5c5c205605c23dbfba71017730aa3d529cf6c6 (patch)
treefac1e05a2bb687c6bc6908bfe7e34c6b69770102 /include
parent7976df1832f8164e459902dc247a232f49b61064 (diff)
downloadpugl-2d5c5c205605c23dbfba71017730aa3d529cf6c6.tar.gz
pugl-2d5c5c205605c23dbfba71017730aa3d529cf6c6.tar.bz2
pugl-2d5c5c205605c23dbfba71017730aa3d529cf6c6.zip
Update clang-format configuration
Diffstat (limited to 'include')
-rw-r--r--include/pugl/attributes.h8
-rw-r--r--include/pugl/cairo.h3
-rw-r--r--include/pugl/gl.h12
-rw-r--r--include/pugl/pugl.h165
-rw-r--r--include/pugl/stub.h3
-rw-r--r--include/pugl/vulkan.h21
6 files changed, 70 insertions, 142 deletions
diff --git a/include/pugl/attributes.h b/include/pugl/attributes.h
index 775a852..1e2264c 100644
--- a/include/pugl/attributes.h
+++ b/include/pugl/attributes.h
@@ -36,13 +36,9 @@
#endif
/// A const function in the public API that only reads parameters
-#define PUGL_CONST_API \
- PUGL_API \
- PUGL_CONST_FUNC
+#define PUGL_CONST_API PUGL_API PUGL_CONST_FUNC
/// A malloc function in the public API that returns allocated memory
-#define PUGL_MALLOC_API \
- PUGL_API \
- PUGL_MALLOC_FUNC
+#define PUGL_MALLOC_API PUGL_API PUGL_MALLOC_FUNC
#endif // PUGL_ATTRIBUTES_H
diff --git a/include/pugl/cairo.h b/include/pugl/cairo.h
index 9a0eccf..8a5ae4e 100644
--- a/include/pugl/cairo.h
+++ b/include/pugl/cairo.h
@@ -21,8 +21,7 @@ PUGL_BEGIN_DECLS
Pass the returned value to puglSetBackend() to draw to a view with Cairo.
*/
-PUGL_CONST_API
-const PuglBackend*
+PUGL_CONST_API const PuglBackend*
puglCairoBackend(void);
/**
diff --git a/include/pugl/gl.h b/include/pugl/gl.h
index 9ea7cfe..f4d5f3d 100644
--- a/include/pugl/gl.h
+++ b/include/pugl/gl.h
@@ -42,8 +42,7 @@ typedef void (*PuglGlFunc)(void);
/**
Return the address of an OpenGL extension function.
*/
-PUGL_API
-PuglGlFunc
+PUGL_API PuglGlFunc
puglGetProcAddress(const char* name);
/**
@@ -53,8 +52,7 @@ puglGetProcAddress(const char* name);
doing things like loading textures. Note that this must not be used for
drawing, which may only be done while processing an expose event.
*/
-PUGL_API
-PuglStatus
+PUGL_API PuglStatus
puglEnterContext(PuglView* view);
/**
@@ -62,8 +60,7 @@ puglEnterContext(PuglView* view);
This must only be called after puglEnterContext().
*/
-PUGL_API
-PuglStatus
+PUGL_API PuglStatus
puglLeaveContext(PuglView* view);
/**
@@ -71,8 +68,7 @@ puglLeaveContext(PuglView* view);
Pass the returned value to puglSetBackend() to draw to a view with OpenGL.
*/
-PUGL_CONST_API
-const PuglBackend*
+PUGL_CONST_API const PuglBackend*
puglGlBackend(void);
PUGL_END_DECLS
diff --git a/include/pugl/pugl.h b/include/pugl/pugl.h
index 0fb2bf7..eacb42f 100644
--- a/include/pugl/pugl.h
+++ b/include/pugl/pugl.h
@@ -734,8 +734,7 @@ typedef enum {
} PuglStatus;
/// Return a string describing a status code
-PUGL_CONST_API
-const char*
+PUGL_CONST_API const char*
puglStrerror(PuglStatus status);
/**
@@ -791,13 +790,11 @@ typedef uint32_t PuglWorldFlags;
@param flags Flags to control world features.
@return A new world, which must be later freed with puglFreeWorld().
*/
-PUGL_MALLOC_API
-PuglWorld*
+PUGL_MALLOC_API PuglWorld*
puglNewWorld(PuglWorldType type, PuglWorldFlags flags);
/// Free a world allocated with puglNewWorld()
-PUGL_API
-void
+PUGL_API void
puglFreeWorld(PuglWorld* world);
/**
@@ -808,13 +805,11 @@ puglFreeWorld(PuglWorld* world);
The handle is opaque to Pugl and is not interpreted in any way.
*/
-PUGL_API
-void
+PUGL_API void
puglSetWorldHandle(PuglWorld* world, PuglWorldHandle handle);
/// Get the user data for the world
-PUGL_API
-PuglWorldHandle
+PUGL_API PuglWorldHandle
puglGetWorldHandle(PuglWorld* world);
/**
@@ -826,8 +821,7 @@ puglGetWorldHandle(PuglWorld* world);
Windows: Returns the `HMODULE` of the calling process.
*/
-PUGL_API
-void*
+PUGL_API void*
puglGetNativeWorld(PuglWorld* world);
/**
@@ -836,8 +830,7 @@ puglGetNativeWorld(PuglWorld* world);
The string value only needs to be valid for the duration of this call, it
will be copied if necessary.
*/
-PUGL_API
-PuglStatus
+PUGL_API PuglStatus
puglSetWorldString(PuglWorld* world, PuglStringHint key, const char* value);
/**
@@ -846,8 +839,7 @@ puglSetWorldString(PuglWorld* world, PuglStringHint key, const char* value);
The returned string should be accessed immediately, or copied. It may
become invalid upon any call to any function that manipulates the same view.
*/
-PUGL_API
-const char*
+PUGL_API const char*
puglGetWorldString(const PuglWorld* world, PuglStringHint key);
/**
@@ -857,8 +849,7 @@ puglGetWorldString(const PuglWorld* world, PuglStringHint key);
time is only useful to compare against other times returned by this
function, its absolute value has no meaning.
*/
-PUGL_API
-double
+PUGL_API double
puglGetTime(const PuglWorld* world);
/**
@@ -883,8 +874,7 @@ puglGetTime(const PuglWorld* world);
@return #PUGL_SUCCESS if events are read, #PUGL_FAILURE if no events are
read, or an error.
*/
-PUGL_API
-PuglStatus
+PUGL_API PuglStatus
puglUpdate(PuglWorld* world, double timeout);
/**
@@ -1050,18 +1040,15 @@ typedef PuglStatus (*PuglEventFunc)(PuglView* view, const PuglEvent* event);
It must first be configured, then the system view can be created with
puglRealize().
*/
-PUGL_MALLOC_API
-PuglView*
+PUGL_MALLOC_API PuglView*
puglNewView(PuglWorld* world);
/// Free a view created with puglNewView()
-PUGL_API
-void
+PUGL_API void
puglFreeView(PuglView* view);
/// Return the world that `view` is a part of
-PUGL_API
-PuglWorld*
+PUGL_API PuglWorld*
puglGetWorld(PuglView* view);
/**
@@ -1073,13 +1060,11 @@ puglGetWorld(PuglView* view);
The handle is opaque to Pugl and is not interpreted in any way.
*/
-PUGL_API
-void
+PUGL_API void
puglSetHandle(PuglView* view, PuglHandle handle);
/// Get the user data for a view
-PUGL_API
-PuglHandle
+PUGL_API PuglHandle
puglGetHandle(PuglView* view);
/**
@@ -1099,18 +1084,15 @@ puglGetHandle(PuglView* view);
applications must link against the appropriate backend library, or be sure
to compile in the appropriate code if using a local copy of Pugl.
*/
-PUGL_API
-PuglStatus
+PUGL_API PuglStatus
puglSetBackend(PuglView* view, const PuglBackend* backend);
/// Return the graphics backend used by a view
-PUGL_API
-const PuglBackend*
+PUGL_API const PuglBackend*
puglGetBackend(const PuglView* view);
/// Set the function to call when an event occurs
-PUGL_API
-PuglStatus
+PUGL_API PuglStatus
puglSetEventFunc(PuglView* view, PuglEventFunc eventFunc);
/**
@@ -1118,8 +1100,7 @@ puglSetEventFunc(PuglView* view, PuglEventFunc eventFunc);
This only has an effect when called before puglRealize().
*/
-PUGL_API
-PuglStatus
+PUGL_API PuglStatus
puglSetViewHint(PuglView* view, PuglViewHint hint, int value);
/**
@@ -1129,8 +1110,7 @@ puglSetViewHint(PuglView* view, PuglViewHint hint, int value);
hint which was initially set to PUGL_DONT_CARE, or has been adjusted from
the suggested value.
*/
-PUGL_API
-int
+PUGL_API int
puglGetViewHint(const PuglView* view, PuglViewHint hint);
/**
@@ -1140,8 +1120,7 @@ puglGetViewHint(const PuglView* view, PuglViewHint hint);
string value only needs to be valid for the duration of this call, it will
be copied if necessary.
*/
-PUGL_API
-PuglStatus
+PUGL_API PuglStatus
puglSetViewString(PuglView* view, PuglStringHint key, const char* value);
/**
@@ -1150,8 +1129,7 @@ puglSetViewString(PuglView* view, PuglStringHint key, const char* value);
The returned string should be accessed immediately, or copied. It may
become invalid upon any call to any function that manipulates the same view.
*/
-PUGL_API
-const char*
+PUGL_API const char*
puglGetViewString(const PuglView* view, PuglStringHint key);
/**
@@ -1166,8 +1144,7 @@ puglGetViewString(const PuglView* view, PuglStringHint key);
that is reasonably sized on a 96 DPI display, and the scale 2.0 should have
text twice that large.
*/
-PUGL_API
-double
+PUGL_API double
puglGetScaleFactor(const PuglView* view);
/**
@@ -1182,8 +1159,7 @@ puglGetScaleFactor(const PuglView* view);
The position is in screen coordinates with an upper left origin.
*/
-PUGL_API
-PuglRect
+PUGL_API PuglRect
puglGetFrame(const PuglView* view);
/**
@@ -1194,8 +1170,7 @@ puglGetFrame(const PuglView* view);
@return #PUGL_UNKNOWN_ERROR on failure, in which case the view frame is
unchanged.
*/
-PUGL_API
-PuglStatus
+PUGL_API PuglStatus
puglSetFrame(PuglView* view, PuglRect frame);
/**
@@ -1204,8 +1179,7 @@ puglSetFrame(PuglView* view, PuglRect frame);
@return #PUGL_UNKNOWN_ERROR on failure, in which case the view frame is
unchanged.
*/
-PUGL_API
-PuglStatus
+PUGL_API PuglStatus
puglSetPosition(PuglView* view, int x, int y);
/**
@@ -1214,8 +1188,7 @@ puglSetPosition(PuglView* view, int x, int y);
@return #PUGL_UNKNOWN_ERROR on failure, in which case the view frame is
unchanged.
*/
-PUGL_API
-PuglStatus
+PUGL_API PuglStatus
puglSetSize(PuglView* view, unsigned width, unsigned height);
/**
@@ -1230,8 +1203,7 @@ puglSetSize(PuglView* view, unsigned width, unsigned height);
@return #PUGL_UNKNOWN_ERROR on failure, but always succeeds if the view is
not yet realized.
*/
-PUGL_API
-PuglStatus
+PUGL_API PuglStatus
puglSetSizeHint(PuglView* view,
PuglSizeHint hint,
unsigned width,
@@ -1249,13 +1221,11 @@ puglSetSizeHint(PuglView* view,
This must be called before puglRealize(), reparenting is not supported.
*/
-PUGL_API
-PuglStatus
+PUGL_API PuglStatus
puglSetParent(PuglView* view, PuglNativeView parent);
/// Return the parent window this view is embedded in, or null
-PUGL_API
-PuglNativeView
+PUGL_API PuglNativeView
puglGetParent(const PuglView* view);
/**
@@ -1268,8 +1238,7 @@ puglGetParent(const PuglView* view);
A view can either have a parent (for embedding) or a transient parent (for
top-level windows like dialogs), but not both.
*/
-PUGL_API
-PuglStatus
+PUGL_API PuglStatus
puglSetTransientParent(PuglView* view, PuglNativeView parent);
/**
@@ -1278,8 +1247,7 @@ puglSetTransientParent(PuglView* view, PuglNativeView parent);
@return The native handle to the window this view is a transient child of,
or null.
*/
-PUGL_API
-PuglNativeView
+PUGL_API PuglNativeView
puglGetTransientParent(const PuglView* view);
/**
@@ -1291,8 +1259,7 @@ puglGetTransientParent(const PuglView* view);
The view should be fully configured using the above functions before this is
called. This function may only be called once per view.
*/
-PUGL_API
-PuglStatus
+PUGL_API PuglStatus
puglRealize(PuglView* view);
/**
@@ -1301,8 +1268,7 @@ puglRealize(PuglView* view);
This is the inverse of puglRealize(). After this call, the view no longer
corresponds to a real system view, and can be realized again later.
*/
-PUGL_API
-PuglStatus
+PUGL_API PuglStatus
puglUnrealize(PuglView* view);
/// A command to control the behaviour of puglShow()
@@ -1346,13 +1312,11 @@ typedef enum {
If the view is currently hidden, it will be shown and possibly raised to the
top depending on the platform.
*/
-PUGL_API
-PuglStatus
+PUGL_API PuglStatus
puglShow(PuglView* view, PuglShowCommand command);
/// Hide the current window
-PUGL_API
-PuglStatus
+PUGL_API PuglStatus
puglHide(PuglView* view);
/**
@@ -1365,8 +1329,7 @@ puglHide(PuglView* view);
used to determine if the state has actually been set. Any changes to the
actual state of the view will arrive in later configure events.
*/
-PUGL_API
-PuglStatus
+PUGL_API PuglStatus
puglSetViewStyle(PuglView* view, PuglViewStyleFlags flags);
/**
@@ -1375,18 +1338,15 @@ puglSetViewStyle(PuglView* view, PuglViewStyleFlags flags);
The result is determined based on the state announced in the last configure
event.
*/
-PUGL_API
-PuglViewStyleFlags
+PUGL_API PuglViewStyleFlags
puglGetViewStyle(const PuglView* view);
/// Return true iff the view is currently visible
-PUGL_API
-bool
+PUGL_API bool
puglGetVisible(const PuglView* view);
/// Return the native window handle
-PUGL_API
-PuglNativeView
+PUGL_API PuglNativeView
puglGetNativeView(PuglView* view);
/**
@@ -1407,8 +1367,7 @@ puglGetNativeView(PuglView* view);
All other backends: returns null.
*/
-PUGL_API
-void*
+PUGL_API void*
puglGetContext(PuglView* view);
/**
@@ -1420,8 +1379,7 @@ puglGetContext(PuglView* view);
platforms. If called elsewhere, an expose will be enqueued to be processed
in the next event loop iteration.
*/
-PUGL_API
-PuglStatus
+PUGL_API PuglStatus
puglObscureView(PuglView* view);
/**
@@ -1441,8 +1399,7 @@ puglObscureView(PuglView* view);
@param width The width of the rectangle to obscure.
@param height The height coordinate of the rectangle to obscure.
*/
-PUGL_API
-PuglStatus
+PUGL_API PuglStatus
puglObscureRegion(PuglView* view,
int x,
int y,
@@ -1486,13 +1443,11 @@ typedef enum {
@return #PUGL_SUCCESS if the focus was successfully grabbed, or an error.
*/
-PUGL_API
-PuglStatus
+PUGL_API PuglStatus
puglGrabFocus(PuglView* view);
/// Return whether `view` has the keyboard input focus
-PUGL_API
-bool
+PUGL_API bool
puglHasFocus(const PuglView* view);
/**
@@ -1500,8 +1455,7 @@ puglHasFocus(const PuglView* view);
A #PUGL_DATA_OFFER event will be sent if data is available.
*/
-PUGL_API
-PuglStatus
+PUGL_API PuglStatus
puglPaste(PuglView* view);
/**
@@ -1509,8 +1463,7 @@ puglPaste(PuglView* view);
Returns zero if the clipboard is empty.
*/
-PUGL_API
-uint32_t
+PUGL_API uint32_t
puglGetNumClipboardTypes(const PuglView* view);
/**
@@ -1522,8 +1475,7 @@ puglGetNumClipboardTypes(const PuglView* view);
Returns null if `typeIndex` is out of bounds according to
puglGetNumClipboardTypes().
*/
-PUGL_API
-const char*
+PUGL_API const char*
puglGetClipboardType(const PuglView* view, uint32_t typeIndex);
/**
@@ -1542,8 +1494,7 @@ puglGetClipboardType(const PuglView* view, uint32_t typeIndex);
the `typeIndex` argument to the call of puglGetClipboardType() that returned
the accepted type.
*/
-PUGL_API
-PuglStatus
+PUGL_API PuglStatus
puglAcceptOffer(PuglView* view,
const PuglDataOfferEvent* offer,
uint32_t typeIndex);
@@ -1559,8 +1510,7 @@ puglAcceptOffer(PuglView* view,
@param data The data to copy to the clipboard.
@param len The length of data in bytes (including terminator if necessary).
*/
-PUGL_API
-PuglStatus
+PUGL_API PuglStatus
puglSetClipboard(PuglView* view,
const char* type,
const void* data,
@@ -1577,8 +1527,7 @@ puglSetClipboard(PuglView* view,
@param[out] len Set to the length of the data in bytes.
@return The clipboard contents, or null.
*/
-PUGL_API
-const void*
+PUGL_API const void*
puglGetClipboard(PuglView* view, uint32_t typeIndex, size_t* len);
/**
@@ -1592,8 +1541,7 @@ puglGetClipboard(PuglView* view, uint32_t typeIndex, size_t* len);
#PUGL_UNSUPPORTED if setting the cursor is not supported on this system, or
another error if the cursor is known but loading it fails.
*/
-PUGL_API
-PuglStatus
+PUGL_API PuglStatus
puglSetCursor(PuglView* view, PuglCursor cursor);
/**
@@ -1622,8 +1570,7 @@ puglSetCursor(PuglView* view, PuglCursor cursor);
@return #PUGL_FAILURE if timers are not supported by the system,
#PUGL_UNKNOWN_ERROR if setting the timer failed.
*/
-PUGL_API
-PuglStatus
+PUGL_API PuglStatus
puglStartTimer(PuglView* view, uintptr_t id, double timeout);
/**
@@ -1635,8 +1582,7 @@ puglStartTimer(PuglView* view, uintptr_t id, double timeout);
@return #PUGL_FAILURE if timers are not supported by this system,
#PUGL_UNKNOWN_ERROR if stopping the timer failed.
*/
-PUGL_API
-PuglStatus
+PUGL_API PuglStatus
puglStopTimer(PuglView* view, uintptr_t id);
/**
@@ -1655,8 +1601,7 @@ puglStopTimer(PuglView* view, uintptr_t id);
@return #PUGL_UNSUPPORTED if sending events of this type is not supported,
#PUGL_UNKNOWN_ERROR if sending the event failed.
*/
-PUGL_API
-PuglStatus
+PUGL_API PuglStatus
puglSendEvent(PuglView* view, const PuglEvent* event);
/**
diff --git a/include/pugl/stub.h b/include/pugl/stub.h
index e81e56f..73f20aa 100644
--- a/include/pugl/stub.h
+++ b/include/pugl/stub.h
@@ -22,8 +22,7 @@ PUGL_BEGIN_DECLS
This backend just creates a simple native window without setting up any
portable graphics API.
*/
-PUGL_CONST_API
-const PuglBackend*
+PUGL_CONST_API const PuglBackend*
puglStubBackend(void);
/**
diff --git a/include/pugl/vulkan.h b/include/pugl/vulkan.h
index 73745ca..325c39d 100644
--- a/include/pugl/vulkan.h
+++ b/include/pugl/vulkan.h
@@ -70,8 +70,7 @@ typedef struct PuglVulkanLoaderImpl PuglVulkanLoader;
@return A new Vulkan loader, or null on failure.
*/
-PUGL_API
-PuglVulkanLoader*
+PUGL_API PuglVulkanLoader*
puglNewVulkanLoader(PuglWorld* world, const char* libraryName);
/**
@@ -80,8 +79,7 @@ puglNewVulkanLoader(PuglWorld* world, const char* libraryName);
Note that this closes the Vulkan library, so no Vulkan objects or API may be
used after this is called.
*/
-PUGL_API
-void
+PUGL_API void
puglFreeVulkanLoader(PuglVulkanLoader* loader);
/**
@@ -90,8 +88,7 @@ puglFreeVulkanLoader(PuglVulkanLoader* loader);
@return Null if the Vulkan library does not contain this function (which is
unlikely and indicates a broken system).
*/
-PUGL_API
-PFN_vkGetInstanceProcAddr
+PUGL_API PFN_vkGetInstanceProcAddr
puglGetInstanceProcAddrFunc(const PuglVulkanLoader* loader);
/**
@@ -100,8 +97,7 @@ puglGetInstanceProcAddrFunc(const PuglVulkanLoader* loader);
@return Null if the Vulkan library does not contain this function (which is
unlikely and indicates a broken system).
*/
-PUGL_API
-PFN_vkGetDeviceProcAddr
+PUGL_API PFN_vkGetDeviceProcAddr
puglGetDeviceProcAddrFunc(const PuglVulkanLoader* loader);
/**
@@ -113,8 +109,7 @@ puglGetDeviceProcAddrFunc(const PuglVulkanLoader* loader);
@param[out] count The number of extensions in the returned array.
@return An array of extension name strings.
*/
-PUGL_API
-const char* const*
+PUGL_API const char* const*
puglGetInstanceExtensions(uint32_t* count);
/**
@@ -127,8 +122,7 @@ puglGetInstanceExtensions(uint32_t* count);
@param[out] surface Pointed to a newly created Vulkan surface.
@return `VK_SUCCESS` on success, or a Vulkan error code.
*/
-PUGL_API
-VkResult
+PUGL_API VkResult
puglCreateSurface(PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr,
PuglView* view,
VkInstance instance,
@@ -140,8 +134,7 @@ puglCreateSurface(PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr,
Pass the returned value to puglSetBackend() to draw to a view with Vulkan.
*/
-PUGL_CONST_API
-const PuglBackend*
+PUGL_CONST_API const PuglBackend*
puglVulkanBackend(void);
/**