rofi 1.7.5
xcb.h
Go to the documentation of this file.
1/*
2 * rofi
3 *
4 * MIT/X11 License
5 * Copyright © 2013-2022 Qball Cow <qball@gmpclient.org>
6 *
7 * Permission is hereby granted, free of charge, to any person obtaining
8 * a copy of this software and associated documentation files (the
9 * "Software"), to deal in the Software without restriction, including
10 * without limitation the rights to use, copy, modify, merge, publish,
11 * distribute, sublicense, and/or sell copies of the Software, and to
12 * permit persons to whom the Software is furnished to do so, subject to
13 * the following conditions:
14 *
15 * The above copyright notice and this permission notice shall be
16 * included in all copies or substantial portions of the Software.
17 *
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
21 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
22 * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
23 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25 *
26 */
27
28#ifndef ROFI_XCB_H
29#define ROFI_XCB_H
30
31#include <cairo.h>
32#include <xcb/xcb.h>
33
37typedef struct _xcb_stuff xcb_stuff;
38
42extern xcb_stuff *xcb;
43
49xcb_window_t xcb_stuff_get_root_window(void);
50
60char *window_get_text_prop(xcb_window_t w, xcb_atom_t atom);
61
70void window_set_atom_prop(xcb_window_t w, xcb_atom_t prop, xcb_atom_t *atoms,
71 int count);
72
74#define ATOM_ENUM(x) x
76#define ATOM_CHAR(x) #x
77
79#define EWMH_ATOMS(X) \
80 X(_NET_WM_WINDOW_OPACITY), X(I3_SOCKET_PATH), X(UTF8_STRING), X(STRING), \
81 X(CLIPBOARD), X(WM_WINDOW_ROLE), X(_XROOTPMAP_ID), X(_MOTIF_WM_HINTS), \
82 X(WM_TAKE_FOCUS), X(ESETROOT_PMAP_ID)
83
87extern const char *netatom_names[];
89extern xcb_atom_t netatoms[NUM_NETATOMS];
90
94typedef struct _workarea {
100 int x;
102 int y;
104 int w;
106 int h;
107 int mw, mh;
109 char *name;
113
122
128void rofi_xcb_set_input_focus(xcb_window_t w);
129
134
138extern xcb_depth_t *depth;
142extern xcb_visualtype_t *visual;
146extern xcb_colormap_t map;
147
153cairo_surface_t *x11_helper_get_bg_surface(void);
161cairo_surface_t *x11_helper_get_screenshot_surface(void);
162
169void x11_disable_decoration(xcb_window_t window);
170
183
190void x11_set_cursor(xcb_window_t window, X11CursorType type);
191
205
211
221cairo_surface_t *x11_helper_get_screenshot_surface_window(xcb_window_t window,
222 int size);
223
231void cairo_image_surface_blur(cairo_surface_t *surface, double radius,
232 double deviation);
233
234#endif
int w
Definition xcb.h:104
int x
Definition xcb.h:100
int monitor_id
Definition xcb.h:96
char * name
Definition xcb.h:109
int mh
Definition xcb.h:107
struct _workarea * next
Definition xcb.h:111
int h
Definition xcb.h:106
int mw
Definition xcb.h:107
int primary
Definition xcb.h:98
int y
Definition xcb.h:102
workarea mon
Definition view.c:111
unsigned long long count
Definition view.c:120
xcb_colormap_t map
Definition xcb.c:98
int monitor_active(workarea *mon)
Definition xcb.c:992
cairo_surface_t * x11_helper_get_screenshot_surface(void)
Definition xcb.c:337
char * window_get_text_prop(xcb_window_t w, xcb_atom_t atom)
Definition xcb.c:377
xcb_stuff * xcb
Definition xcb.c:91
xcb_depth_t * depth
Definition xcb.c:96
#define EWMH_ATOMS(X)
Definition xcb.h:79
void rofi_xcb_revert_input_focus(void)
Definition xcb.c:1358
cairo_surface_t * x11_helper_get_bg_surface(void)
Definition xcb.c:363
void rofi_xcb_set_input_focus(xcb_window_t w)
Definition xcb.c:1335
WindowManagerQuirk
Definition xcb.h:195
@ WM_PANGO_WORKSPACE_NAMES
Definition xcb.h:201
@ WM_DO_NOT_CHANGE_CURRENT_DESKTOP
Definition xcb.h:199
@ WM_EWHM
Definition xcb.h:197
@ WM_ROOT_WINDOW_OFFSET
Definition xcb.h:203
void x11_set_cursor(xcb_window_t window, X11CursorType type)
Definition xcb.c:1806
struct _workarea workarea
X11CursorType
Definition xcb.h:174
@ CURSOR_POINTER
Definition xcb.h:178
@ CURSOR_DEFAULT
Definition xcb.h:176
@ NUM_CURSORS
Definition xcb.h:181
@ CURSOR_TEXT
Definition xcb.h:180
#define ATOM_ENUM(x)
Definition xcb.h:74
@ NUM_NETATOMS
Definition xcb.h:85
xcb_window_t xcb_stuff_get_root_window(void)
Definition xcb.c:1747
void window_set_atom_prop(xcb_window_t w, xcb_atom_t prop, xcb_atom_t *atoms, int count)
Definition xcb.c:403
const char * netatom_names[]
Definition xcb.c:104
void cairo_image_surface_blur(cairo_surface_t *surface, double radius, double deviation)
Definition xcb.c:167
WindowManagerQuirk current_window_manager
Definition xcb.c:80
void x11_disable_decoration(xcb_window_t window)
Definition xcb.c:1782
xcb_atom_t netatoms[NUM_NETATOMS]
Definition xcb.c:103
xcb_visualtype_t * visual
Definition xcb.c:97
cairo_surface_t * x11_helper_get_screenshot_surface_window(xcb_window_t window, int size)
Definition xcb.c:276