summaryrefslogtreecommitdiff
path: root/window.h
diff options
context:
space:
mode:
authorMikhail Burakov <mburakov@mailbox.org>2023-04-02 12:09:20 +0200
committerMikhail Burakov <mburakov@mailbox.org>2023-04-07 13:47:39 +0200
commiteecbacdc1ab1b29fee71f3a689e01cabe12b3730 (patch)
tree0b6c924678a31ed2f46061f7767a99bb40b57737 /window.h
parent972e03b4a09b790d9ed9c8102cc897a75c9bb751 (diff)
Major rewrite of window to support input events
Diffstat (limited to 'window.h')
-rw-r--r--window.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/window.h b/window.h
index 80562f3..a0f6b0d 100644
--- a/window.h
+++ b/window.h
@@ -24,12 +24,18 @@
struct Window;
struct Frame;
-struct Window* WindowCreate(void);
+struct WindowEventHandlers {
+ void (*OnClose)(void* user);
+ void (*OnKey)(void* user, unsigned key, bool pressed);
+};
+
+struct Window* WindowCreate(
+ const struct WindowEventHandlers* window_event_handlers, void* user);
int WindowGetEventsFd(const struct Window* window);
bool WindowProcessEvents(const struct Window* window);
bool WindowAssignFrames(struct Window* window, size_t nframes,
const struct Frame* frames);
bool WindowShowFrame(struct Window* window, size_t index);
-void WindowDestroy(struct Window** window);
+void WindowDestroy(struct Window* window);
#endif // RECEIVER_WINDOW_H_