aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2022-05-20 14:23:40 -0400
committerDavid Robillard <d@drobilla.net>2022-05-21 16:49:47 -0400
commit692dbf482859e91f0dbadaa97152ab779f9a4648 (patch)
treed44fc399b8babcb45bc3c9f8e95b784496f06c72
parentd8e02dad9e4a19b5b4e5234ea14b6f0f0bef9fab (diff)
downloadpugl-692dbf482859e91f0dbadaa97152ab779f9a4648.tar.gz
pugl-692dbf482859e91f0dbadaa97152ab779f9a4648.tar.bz2
pugl-692dbf482859e91f0dbadaa97152ab779f9a4648.zip
Rename PUGL_UNSUPPORTED_TYPE to be more generic
-rw-r--r--bindings/cpp/include/pugl/pugl.hpp4
-rw-r--r--include/pugl/pugl.h6
-rw-r--r--meson.build2
-rw-r--r--src/implementation.c4
-rw-r--r--src/mac.m2
-rw-r--r--src/win.c2
-rw-r--r--src/x11.c2
-rw-r--r--test/test_strerror.c2
8 files changed, 12 insertions, 12 deletions
diff --git a/bindings/cpp/include/pugl/pugl.hpp b/bindings/cpp/include/pugl/pugl.hpp
index 743d37f..5387c91 100644
--- a/bindings/cpp/include/pugl/pugl.hpp
+++ b/bindings/cpp/include/pugl/pugl.hpp
@@ -195,10 +195,10 @@ enum class Status {
realizeFailed, ///< @copydoc PUGL_REALIZE_FAILED
setFormatFailed, ///< @copydoc PUGL_SET_FORMAT_FAILED
createContextFailed, ///< @copydoc PUGL_CREATE_CONTEXT_FAILED
- unsupportedType, ///< @copydoc PUGL_UNSUPPORTED_TYPE
+ unsupported, ///< @copydoc PUGL_UNSUPPORTED
};
-static_assert(Status(PUGL_UNSUPPORTED_TYPE) == Status::unsupportedType, "");
+static_assert(Status(PUGL_UNSUPPORTED) == Status::unsupported, "");
/// @copydoc puglStrerror
inline const char*
diff --git a/include/pugl/pugl.h b/include/pugl/pugl.h
index 4f30348..4abe247 100644
--- a/include/pugl/pugl.h
+++ b/include/pugl/pugl.h
@@ -585,7 +585,7 @@ typedef enum {
PUGL_REALIZE_FAILED, ///< System view realization failed
PUGL_SET_FORMAT_FAILED, ///< Failed to set pixel format
PUGL_CREATE_CONTEXT_FAILED, ///< Failed to create drawing context
- PUGL_UNSUPPORTED_TYPE, ///< Unsupported data type
+ PUGL_UNSUPPORTED, ///< Unsupported operation
} PuglStatus;
/// Return a string describing a status code
@@ -1302,8 +1302,8 @@ puglStopTimer(PuglView* view, uintptr_t id);
puglPostRedisplayRect(), but will always send a message to the X server,
even when called in an event handler.
- @return #PUGL_UNSUPPORTED_TYPE if sending events of this type is not
- supported, #PUGL_UNKNOWN_ERROR if sending the event failed.
+ @return #PUGL_UNSUPPORTED if sending events of this type is not supported,
+ #PUGL_UNKNOWN_ERROR if sending the event failed.
*/
PUGL_API
PuglStatus
diff --git a/meson.build b/meson.build
index 9530cbf..7a8690d 100644
--- a/meson.build
+++ b/meson.build
@@ -2,7 +2,7 @@
# SPDX-License-Identifier: CC0-1.0 OR ISC
project('pugl', ['c'],
- version: '0.3.0',
+ version: '0.4.0',
license: 'ISC',
meson_version: '>= 0.49.2',
default_options: [
diff --git a/src/implementation.c b/src/implementation.c
index e7835f6..166aebd 100644
--- a/src/implementation.c
+++ b/src/implementation.c
@@ -28,7 +28,7 @@ puglStrerror(const PuglStatus status)
case PUGL_REALIZE_FAILED: return "View creation failed";
case PUGL_SET_FORMAT_FAILED: return "Failed to set pixel format";
case PUGL_CREATE_CONTEXT_FAILED: return "Failed to create drawing context";
- case PUGL_UNSUPPORTED_TYPE: return "Unsupported data type";
+ case PUGL_UNSUPPORTED: return "Unsupported operation";
}
// clang-format on
@@ -489,7 +489,7 @@ puglSetInternalClipboard(PuglView* const view,
const size_t len)
{
if (type && !!strcmp(type, "text/plain")) {
- return PUGL_UNSUPPORTED_TYPE;
+ return PUGL_UNSUPPORTED;
}
puglSetBlob(&view->clipboard, data, len);
diff --git a/src/mac.m b/src/mac.m
index 865355a..1040aa7 100644
--- a/src/mac.m
+++ b/src/mac.m
@@ -1204,7 +1204,7 @@ puglSendEvent(PuglView* view, const PuglEvent* event)
return PUGL_SUCCESS;
}
- return PUGL_UNSUPPORTED_TYPE;
+ return PUGL_UNSUPPORTED;
}
#ifndef PUGL_DISABLE_DEPRECATED
diff --git a/src/win.c b/src/win.c
index 737f843..40a5cb7 100644
--- a/src/win.c
+++ b/src/win.c
@@ -813,7 +813,7 @@ puglSendEvent(PuglView* view, const PuglEvent* event)
return PUGL_SUCCESS;
}
- return PUGL_UNSUPPORTED_TYPE;
+ return PUGL_UNSUPPORTED;
}
#ifndef PUGL_DISABLE_DEPRECATED
diff --git a/src/x11.c b/src/x11.c
index ca23a76..046211c 100644
--- a/src/x11.c
+++ b/src/x11.c
@@ -989,7 +989,7 @@ puglSendEvent(PuglView* const view, const PuglEvent* const event)
: PUGL_UNKNOWN_ERROR;
}
- return PUGL_UNSUPPORTED_TYPE;
+ return PUGL_UNSUPPORTED;
}
#ifndef PUGL_DISABLE_DEPRECATED
diff --git a/test/test_strerror.c b/test/test_strerror.c
index 0d38fe3..ec96ecb 100644
--- a/test/test_strerror.c
+++ b/test/test_strerror.c
@@ -14,7 +14,7 @@
int
main(void)
{
- for (unsigned i = 0; i <= PUGL_UNSUPPORTED_TYPE; ++i) {
+ for (unsigned i = 0; i <= PUGL_UNSUPPORTED; ++i) {
const char* const string = puglStrerror((PuglStatus)i);
assert(isupper(string[0]));