rofi 1.7.8
xcb.h
Go to the documentation of this file.
1/*
2 * rofi
3 *
4 * MIT/X11 License
5 * Copyright © 2013-2023 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#ifdef XCB_IMDKIT
33#include <xcb-imdkit/imclient.h>
34#endif
35#include <xcb/xcb.h>
36
40typedef struct _xcb_stuff xcb_stuff;
41
45extern xcb_stuff *xcb;
46
52void xcb_stuff_set_clipboard(char *data);
53
59xcb_window_t xcb_stuff_get_root_window(void);
60
70char *window_get_text_prop(xcb_window_t w, xcb_atom_t atom);
71
80void window_set_atom_prop(xcb_window_t w, xcb_atom_t prop, xcb_atom_t *atoms,
81 int count);
82
84#define ATOM_ENUM(x) x
86#define ATOM_CHAR(x) #x
87
89#define EWMH_ATOMS(X) \
90 X(_NET_WM_WINDOW_OPACITY), X(I3_SOCKET_PATH), X(TARGETS), X(UTF8_STRING), \
91 X(STRING), X(CLIPBOARD), X(WM_WINDOW_ROLE), X(_XROOTPMAP_ID), \
92 X(_MOTIF_WM_HINTS), X(WM_TAKE_FOCUS), X(ESETROOT_PMAP_ID)
93
97extern const char *netatom_names[];
99extern xcb_atom_t netatoms[NUM_NETATOMS];
100
104typedef struct _workarea {
110 int x;
112 int y;
114 int w;
116 int h;
117 int mw, mh;
119 char *name;
123
132
138void rofi_xcb_set_input_focus(xcb_window_t w);
139
144
148extern xcb_depth_t *depth;
152extern xcb_visualtype_t *visual;
156extern xcb_colormap_t map;
157
163cairo_surface_t *x11_helper_get_bg_surface(void);
171cairo_surface_t *x11_helper_get_screenshot_surface(void);
172
179void x11_disable_decoration(xcb_window_t window);
180
193
200void x11_set_cursor(xcb_window_t window, X11CursorType type);
201
213
219
230cairo_surface_t *x11_helper_get_screenshot_surface_window(xcb_window_t window,
231 int size);
232
240void cairo_image_surface_blur(cairo_surface_t *surface, double radius,
241 double deviation);
242
243#ifdef XCB_IMDKIT
247void x11_event_handler_fowarding(xcb_xim_t *im, xcb_xic_t ic,
248 xcb_key_press_event_t *event, void *user_data);
249#endif
250
257#endif
int w
Definition xcb.h:114
int x
Definition xcb.h:110
int monitor_id
Definition xcb.h:106
char * name
Definition xcb.h:119
int mh
Definition xcb.h:117
struct _workarea * next
Definition xcb.h:121
int h
Definition xcb.h:116
int mw
Definition xcb.h:117
int primary
Definition xcb.h:108
int y
Definition xcb.h:112
workarea mon
Definition view.c:131
unsigned long long count
Definition view.c:147
xcb_colormap_t map
Definition xcb.c:108
int monitor_active(workarea *mon)
Definition xcb.c:1004
cairo_surface_t * x11_helper_get_screenshot_surface(void)
Definition xcb.c:347
char * window_get_text_prop(xcb_window_t w, xcb_atom_t atom)
Definition xcb.c:387
xcb_stuff * xcb
Definition xcb.c:101
xcb_depth_t * depth
Definition xcb.c:106
#define EWMH_ATOMS(X)
Definition xcb.h:89
void rofi_xcb_revert_input_focus(void)
Definition xcb.c:1517
cairo_surface_t * x11_helper_get_bg_surface(void)
Definition xcb.c:373
void rofi_xcb_set_input_focus(xcb_window_t w)
Definition xcb.c:1494
WindowManagerQuirk
Definition xcb.h:205
@ WM_PANGO_WORKSPACE_NAMES
Definition xcb.h:211
@ WM_DO_NOT_CHANGE_CURRENT_DESKTOP
Definition xcb.h:209
@ WM_EWHM
Definition xcb.h:207
void x11_set_cursor(xcb_window_t window, X11CursorType type)
Definition xcb.c:2005
struct _workarea workarea
X11CursorType
Definition xcb.h:184
@ CURSOR_POINTER
Definition xcb.h:188
@ CURSOR_DEFAULT
Definition xcb.h:186
@ NUM_CURSORS
Definition xcb.h:191
@ CURSOR_TEXT
Definition xcb.h:190
char * x11_helper_get_window_manager(void)
Definition xcb.c:1626
#define ATOM_ENUM(x)
Definition xcb.h:84
@ NUM_NETATOMS
Definition xcb.h:95
xcb_window_t xcb_stuff_get_root_window(void)
Definition xcb.c:1941
void window_set_atom_prop(xcb_window_t w, xcb_atom_t prop, xcb_atom_t *atoms, int count)
Definition xcb.c:413
const char * netatom_names[]
Definition xcb.c:114
void cairo_image_surface_blur(cairo_surface_t *surface, double radius, double deviation)
Definition xcb.c:177
WindowManagerQuirk current_window_manager
Definition xcb.c:85
void xcb_stuff_set_clipboard(char *data)
Definition xcb.c:2017
void x11_disable_decoration(xcb_window_t window)
Definition xcb.c:1981
xcb_atom_t netatoms[NUM_NETATOMS]
Definition xcb.c:113
xcb_visualtype_t * visual
Definition xcb.c:107
cairo_surface_t * x11_helper_get_screenshot_surface_window(xcb_window_t window, int size)
Definition xcb.c:286