From 22086e50382b99de092899a203e520c30f50b618 Mon Sep 17 00:00:00 2001 From: Federico Angelilli Date: Wed, 15 Nov 2023 22:35:41 +0100 Subject: Add `Connection` to separate xcb setup from window logic --- connection.h | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 connection.h (limited to 'connection.h') diff --git a/connection.h b/connection.h new file mode 100644 index 0000000..d028cce --- /dev/null +++ b/connection.h @@ -0,0 +1,29 @@ +#ifndef COMET_CONNECTION_H +#define COMET_CONNECTION_H + +#include +#include +#include +#include +#include +#include + + +// TODO: Make this opaque +typedef struct { + xcb_connection_t *connection; + xcb_screen_t *screen; + xcb_randr_screen_size_t *screen_size; + double screen_dpi; + xcb_visualtype_t *visual_type; + xcb_depth_t *depth; + xcb_xrm_database_t *database; + xcb_errors_context_t *errors; + xcb_ewmh_connection_t ewmh; +} Connection; + +Connection *connection_create(); + +void connection_destroy(Connection *con); + +#endif -- cgit v1.2.3