rework the window reference
@@ -44,28 +44,25 @@ extern "C" {
#pragma pack(push, CLAP_ALIGN)
-// Reference to an OS window
-typedef struct clap_gui_window {
- const char *api;
- union {
- struct {
- void *hwnd;
- } win32;
+typedef struct clap_gui_window_x11 {
+ const char *display;
+ unsigned long window;
+} clap_gui_window_x11_t;
- struct {
+typedef struct clap_gui_window_cocoa {
void *nsView;
- } cocoa;
+} clap_gui_window_cocoa_t;
- struct {
- const char *display;
- unsigned long window;
- } x11;
+typedef struct clap_gui_window_win32 {
+ void *hwnd;
+} clap_gui_window_win32_t;
- struct {
- // TODO
- unsigned long window;
- } wayland;
- };
+// Represent a window reference.
+// api is one of CLAP_GUI_API_XXX
+// specific has to be casted to the corresponding clap_gui_window_xxx.
+typedef struct clap_gui_window {
+ const char *api;
+ const void *specific;
} clap_gui_window_t;
// Size (width, height) is in pixels; the corresponding windowing system extension is
