bar: wip: define a 'backend' interface

Implement the current XCB backend in terms of this new interface.
This commit is contained in:
Daniel Eklöf 2019-01-29 20:59:25 +01:00
parent f37dfbc727
commit 88daaf0ab7
6 changed files with 503 additions and 403 deletions

View file

@ -1,16 +1,11 @@
#pragma once
#include <xcb/xcb.h>
#include <xcb/randr.h>
#include <xcb/render.h>
#include <xcb/xcb_aux.h>
#include <xcb/xcb_cursor.h>
#include <xcb/xcb_event.h>
#include <xcb/xcb_ewmh.h>
#include <cairo.h>
#include <cairo-xcb.h>
#include "../bar.h"
#include "backend.h"
struct private {
/* From bar_config */
char *monitor;
@ -53,6 +48,11 @@ struct private {
cairo_t *cairo;
cairo_surface_t *cairo_surface;
struct {
void *data;
const struct backend *iface;
} backend;
#if 0
/* Backend specifics */
xcb_connection_t *conn;
@ -62,4 +62,5 @@ struct private {
xcb_gc_t gc;
xcb_cursor_context_t *cursor_ctx;
xcb_cursor_t cursor;
#endif
};