aboutsummaryrefslogtreecommitdiff
path: root/src/window.h
diff options
context:
space:
mode:
authorFederico Angelilli <code@fedang.net>2024-07-08 16:41:06 +0200
committerFederico Angelilli <code@fedang.net>2024-07-08 16:41:06 +0200
commit8e392c583c7c0b68bae6204bf98e7f8e077c5bbf (patch)
treeeec9e15918194a6f4bca9ce4de479783c0ddbada /src/window.h
parent5d170a634ead0119f6e5a9f63c23b2b064126f75 (diff)
Rewrite display code
Diffstat (limited to 'src/window.h')
-rw-r--r--src/window.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/window.h b/src/window.h
new file mode 100644
index 0000000..74cc231
--- /dev/null
+++ b/src/window.h
@@ -0,0 +1,31 @@
+#ifndef COMET_WINDOW_H
+#define COMET_WINDOW_H
+
+#include <cairo.h>
+#include <xcb/xcb.h>
+#include <xcb/xcb_aux.h>
+
+#include "display.h"
+
+typedef struct {
+ display_t *display;
+ xcb_drawable_t window;
+ uint32_t cw_mask;
+ xcb_params_cw_t cw_params;
+ cairo_surface_t *surface;
+ cairo_t *cr;
+ int x, y;
+ int width, height;
+} window_t;
+
+void window_init(window_t *window, display_t *display);
+
+void window_move(window_t *window, int x, int y);
+
+void window_resize(window_t *window, int width, int height);
+
+void window_present(window_t *window, cairo_surface_t *surface, int width, int height);
+
+void window_close(window_t *window);
+
+#endif