2015-01-15 23:59:09 +00:00
|
|
|
#ifndef _BM_X11_H_
|
|
|
|
#define _BM_X11_H_
|
|
|
|
|
2021-10-17 16:33:37 +00:00
|
|
|
#include "internal.h"
|
|
|
|
|
2015-01-15 23:59:09 +00:00
|
|
|
#include <X11/Xlib.h>
|
|
|
|
#include <X11/keysym.h>
|
|
|
|
|
2021-05-07 14:38:15 +00:00
|
|
|
#include "renderers/cairo_renderer.h"
|
2015-01-15 23:59:09 +00:00
|
|
|
|
|
|
|
enum mod_bit {
|
|
|
|
MOD_SHIFT = 1<<0,
|
|
|
|
MOD_CTRL = 1<<1,
|
2015-01-18 01:34:18 +00:00
|
|
|
MOD_ALT = 1<<2,
|
2015-01-15 23:59:09 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct buffer {
|
|
|
|
struct cairo cairo;
|
|
|
|
uint32_t width, height;
|
|
|
|
bool created;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct window {
|
|
|
|
Display *display;
|
|
|
|
int32_t screen;
|
|
|
|
Drawable drawable;
|
|
|
|
XIM xim;
|
|
|
|
XIC xic;
|
2020-03-16 02:41:42 +00:00
|
|
|
Visual *visual;
|
2015-01-15 23:59:09 +00:00
|
|
|
|
|
|
|
KeySym keysym;
|
|
|
|
uint32_t mods;
|
|
|
|
|
|
|
|
struct buffer buffer;
|
|
|
|
uint32_t x, y, width, height, max_height;
|
2021-10-17 06:22:24 +00:00
|
|
|
uint32_t orig_width, orig_x;
|
|
|
|
uint32_t hmargin_size;
|
2021-12-26 16:38:11 +00:00
|
|
|
float width_factor;
|
2015-01-15 23:59:09 +00:00
|
|
|
uint32_t displayed;
|
|
|
|
|
2021-04-04 12:25:06 +00:00
|
|
|
int32_t monitor;
|
2021-10-17 16:33:37 +00:00
|
|
|
enum bm_align align;
|
2015-01-15 23:59:09 +00:00
|
|
|
|
|
|
|
struct {
|
2019-05-31 20:32:02 +00:00
|
|
|
void (*render)(struct cairo *cairo, uint32_t width, uint32_t max_height, const struct bm_menu *menu, struct cairo_paint_result *result);
|
2015-01-15 23:59:09 +00:00
|
|
|
} 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);
|
2021-04-04 12:25:06 +00:00
|
|
|
void bm_x11_window_set_monitor(struct window *window, int32_t monitor);
|
2021-10-17 16:33:37 +00:00
|
|
|
void bm_x11_window_set_align(struct window *window, enum bm_align align);
|
2021-12-26 16:38:11 +00:00
|
|
|
void bm_x11_window_set_width(struct window *window, uint32_t margin, float factor);
|
2015-01-15 23:59:09 +00:00
|
|
|
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 :*/
|