aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_utils.h
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2020-03-09 21:49:58 +0100
committerDavid Robillard <d@drobilla.net>2020-03-09 22:17:44 +0100
commit9be7bab7cf3c63cafa07e5a70d6c59559ffdc1de (patch)
treedb882f9d08f5b91b31271cd2844cae11f64bf1dd /test/test_utils.h
parenta303b9374dbb9eeef1a31dcad3cb0a4e9b7fd5a3 (diff)
downloadpugl-9be7bab7cf3c63cafa07e5a70d6c59559ffdc1de.tar.gz
pugl-9be7bab7cf3c63cafa07e5a70d6c59559ffdc1de.tar.bz2
pugl-9be7bab7cf3c63cafa07e5a70d6c59559ffdc1de.zip
Add PuglEventClient and puglSendEvent()
This event makes it possible to send an arbitrary event to a view, which is useful for many things. In particular, this method of communication with views will wake up the event loop, unlike hacks in applications that share data in some other way.
Diffstat (limited to 'test/test_utils.h')
-rw-r--r--test/test_utils.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/test_utils.h b/test/test_utils.h
index aca3376..7dc6e6e 100644
--- a/test/test_utils.h
+++ b/test/test_utils.h
@@ -14,8 +14,11 @@
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+#define __STDC_FORMAT_MACROS 1
+
#include "pugl/pugl.h"
+#include <inttypes.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>
@@ -118,6 +121,11 @@ printEvent(const PuglEvent* event, const char* prefix, const bool verbose)
return PRINT("%sFocus out%s\n",
prefix,
event->focus.grab ? " (ungrab)" : "");
+ case PUGL_CLIENT:
+ return PRINT("%sClient %" PRIXPTR " %" PRIXPTR "\n",
+ prefix,
+ event->client.data1,
+ event->client.data2);
default:
break;
}