commit f022c766bd315b5bb22800b9ab78a4e1ec991edc
parent 02216aba747685fe3d8c1e7b95d7fc008249fee2
Author: falkTX <falktx@falktx.com>
Date: Sun, 10 Jul 2022 03:53:41 +0100
Add Application::getClassName(), more wasm pugl things
Signed-off-by: falkTX <falktx@falktx.com>
Diffstat:
2 files changed, 14 insertions(+), 1 deletion(-)
diff --git a/dgl/Application.hpp b/dgl/Application.hpp
@@ -109,7 +109,7 @@ public:
void removeIdleCallback(IdleCallback* callback);
/**
- Set the class name of the application.
+ Get the class name of the application.
This is a stable identifier for the application, used as the window class/instance name on X11 and Windows.
It is not displayed to the user, but can be used in scripts and by window managers,
@@ -117,6 +117,12 @@ public:
Plugins created with DPF have their class name automatically set based on DGL_NAMESPACE and plugin name.
*/
+ const char* getClassName() const noexcept;
+
+ /**
+ Set the class name of the application.
+ @see getClassName
+ */
void setClassName(const char* name);
private:
diff --git a/dgl/src/ApplicationPrivateData.cpp b/dgl/src/ApplicationPrivateData.cpp
@@ -45,6 +45,13 @@ static bool isThisTheMainThread(const d_ThreadHandle mainThreadHandle) noexcept
// --------------------------------------------------------------------------------------------------------------------
+const char* Application::getClassName() const noexcept
+{
+ return puglGetClassName(pData->world);
+}
+
+// --------------------------------------------------------------------------------------------------------------------
+
Application::PrivateData::PrivateData(const bool standalone)
: world(puglNewWorld(standalone ? PUGL_PROGRAM : PUGL_MODULE,
standalone ? PUGL_WORLD_THREADS : 0x0)),