bemenu 1.0.0
Dynamic menu library and client program inspired by dmenu
x11.h
1 #ifndef _BM_X11_H_
2 #define _BM_X11_H_
3 
4 #include <X11/Xlib.h>
5 #include <X11/keysym.h>
6 
7 #include "renderers/cairo.h"
8 
9 enum mod_bit {
10  MOD_SHIFT = 1<<0,
11  MOD_CTRL = 1<<1,
12  MOD_ALT = 1<<2,
13 };
14 
15 struct buffer {
16  struct cairo cairo;
17  uint32_t width, height;
18  bool created;
19 };
20 
21 struct window {
22  Display *display;
23  int32_t screen;
24  Drawable drawable;
25  XIM xim;
26  XIC xic;
27 
28  KeySym keysym;
29  uint32_t mods;
30 
31  struct buffer buffer;
32  uint32_t x, y, width, height, max_height;
33  uint32_t displayed;
34 
35  uint32_t monitor;
36  bool bottom;
37 
38  struct {
39  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);
40  } notify;
41 };
42 
43 struct x11 {
44  Display *display;
45  struct window window;
46 };
47 
48 void bm_x11_window_render(struct window *window, const struct bm_menu *menu);
49 void bm_x11_window_key_press(struct window *window, XKeyEvent *ev);
50 void bm_x11_window_set_monitor(struct window *window, uint32_t monitor);
51 void bm_x11_window_set_bottom(struct window *window, bool bottom);
52 bool bm_x11_window_create(struct window *window, Display *display);
53 void bm_x11_window_destroy(struct window *window);
54 
55 #endif /* _BM_WAYLAND_H_ */
56 
57 /* vim: set ts=8 sw=4 tw=0 :*/
Definition: cairo.h:11
Definition: cairo.h:42
Definition: wayland.h:77
Definition: wayland.h:70
Definition: x11.h:43