aboutsummaryrefslogtreecommitdiff
path: root/src/connect.h
blob: 242881911afa5f8ebfc76a72f58405fb37b7d2a9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#ifndef COMET_CONNEC_H
#define COMET_CONNEC_H

#include <glib.h>
#include <xcb/xcb.h>
#include <xcb/xcb_ewmh.h>
#include <xcb/xcb_xrm.h>
#include <xcb/xcb_errors.h>
#include <xcb/randr.h>

// Forward declaration
typedef struct State State;

typedef struct Connection Connection;

// TODO: Make this opaque
struct Connection {
    xcb_connection_t *connection;
    xcb_screen_t *screen;
    xcb_randr_get_screen_info_reply_t *info_reply;
    xcb_randr_screen_size_t *screen_size;
    double screen_dpi;
    int screen_depth;
    xcb_visualtype_t *visual_type;
    xcb_xrm_database_t *database;
    xcb_errors_context_t *errors;
    xcb_ewmh_connection_t ewmh;
    GSource *source;
    State *state;
};

Connection *connect_create();

void connect_attach_source(Connection *con);

void connect_attach_state(Connection *con, State *state);

void connect_destroy(Connection *con);

#endif

// vim: ts=4 sw=4 et