diff options
author | Jari Vetoniemi <mailroxas@gmail.com> | 2015-01-16 01:59:09 +0200 |
---|---|---|
committer | Jari Vetoniemi <mailroxas@gmail.com> | 2015-01-16 01:59:09 +0200 |
commit | ada6edc175eb89d318e55204368e2ba5dad07b1b (patch) | |
tree | 035ff1c1db386e48135705b5c663060248b3fa66 /lib/renderers/x11/x11.h | |
parent | 0cd1c991d20c5c10190e520071691e849541f619 (diff) | |
download | bemenu-ada6edc175eb89d318e55204368e2ba5dad07b1b.tar.gz bemenu-ada6edc175eb89d318e55204368e2ba5dad07b1b.tar.bz2 bemenu-ada6edc175eb89d318e55204368e2ba5dad07b1b.zip |
Add X11 renderer.
Diffstat (limited to 'lib/renderers/x11/x11.h')
-rw-r--r-- | lib/renderers/x11/x11.h | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/lib/renderers/x11/x11.h b/lib/renderers/x11/x11.h new file mode 100644 index 0000000..e930cb2 --- /dev/null +++ b/lib/renderers/x11/x11.h @@ -0,0 +1,56 @@ +#ifndef _BM_X11_H_ +#define _BM_X11_H_ + +#include <X11/Xlib.h> +#include <X11/keysym.h> + +#include "renderers/cairo.h" + +enum mod_bit { + MOD_SHIFT = 1<<0, + MOD_CTRL = 1<<1, +}; + +struct buffer { + struct cairo cairo; + uint32_t width, height; + bool created; +}; + +struct window { + Display *display; + int32_t screen; + Drawable drawable; + XIM xim; + XIC xic; + + KeySym keysym; + uint32_t mods; + + struct buffer buffer; + uint32_t x, y, width, height, max_height; + uint32_t displayed; + + uint32_t monitor; + bool bottom; + + struct { + void (*render)(struct cairo *cairo, uint32_t width, uint32_t height, uint32_t max_height, const struct bm_menu *menu, struct cairo_paint_result *result); + } notify; +}; + +struct x11 { + Display *display; + struct window window; +}; + +void bm_x11_window_render(struct window *window, const struct bm_menu *menu); +void bm_x11_window_key_press(struct window *window, XKeyEvent *ev); +void bm_x11_window_set_monitor(struct window *window, uint32_t monitor); +void bm_x11_window_set_bottom(struct window *window, bool bottom); +bool bm_x11_window_create(struct window *window, Display *display); +void bm_x11_window_destroy(struct window *window); + +#endif /* _BM_WAYLAND_H_ */ + +/* vim: set ts=8 sw=4 tw=0 :*/ |