rofi  1.7.3
xcb.h
Go to the documentation of this file.
1 /*
2  * rofi
3  *
4  * MIT/X11 License
5  * Copyright © 2013-2021 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 
37 typedef struct _xcb_stuff xcb_stuff;
38 
42 extern xcb_stuff *xcb;
43 
49 xcb_window_t xcb_stuff_get_root_window(void);
50 
60 char *window_get_text_prop(xcb_window_t w, xcb_atom_t atom);
61 
70 void 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
75 
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 
87 extern const char *netatom_names[];
89 extern xcb_atom_t netatoms[NUM_NETATOMS];
90 
94 typedef struct _workarea {
98  int primary;
100  int x;
102  int y;
104  int w;
106  int h;
107  int mw, mh;
109  char *name;
111  struct _workarea *next;
113 
122 
128 void rofi_xcb_set_input_focus(xcb_window_t w);
129 
133 void rofi_xcb_revert_input_focus(void);
134 
138 extern xcb_depth_t *depth;
142 extern xcb_visualtype_t *visual;
146 extern xcb_colormap_t map;
147 
153 cairo_surface_t *x11_helper_get_bg_surface(void);
161 cairo_surface_t *x11_helper_get_screenshot_surface(void);
162 
169 void x11_disable_decoration(xcb_window_t window);
170 
174 typedef enum {
183 
190 void x11_set_cursor(xcb_window_t window, X11CursorType type);
191 
195 typedef enum {
197  WM_EWHM = 0,
205 
211 
221 cairo_surface_t *x11_helper_get_screenshot_surface_window(xcb_window_t window,
222  int size);
223 
231 void cairo_image_surface_blur(cairo_surface_t *surface, double radius,
232  double deviation);
233 
234 #endif
_workarea::x
int x
Definition: xcb.h:100
rofi_xcb_set_input_focus
void rofi_xcb_set_input_focus(xcb_window_t w)
Definition: xcb.c:1310
workarea
struct _workarea workarea
X11CursorType
X11CursorType
Definition: xcb.h:174
_workarea::mw
int mw
Definition: xcb.h:107
x11_helper_get_bg_surface
cairo_surface_t * x11_helper_get_bg_surface(void)
Definition: xcb.c:363
_workarea::y
int y
Definition: xcb.h:102
map
xcb_colormap_t map
Definition: xcb.c:98
mon
workarea mon
Definition: view.c:111
x11_disable_decoration
void x11_disable_decoration(xcb_window_t window)
Definition: xcb.c:1757
xcb_stuff_get_root_window
xcb_window_t xcb_stuff_get_root_window(void)
Definition: xcb.c:1722
_workarea::monitor_id
int monitor_id
Definition: xcb.h:96
_xcb_stuff
Definition: xcb-internal.h:44
_workarea::next
struct _workarea * next
Definition: xcb.h:111
cairo_image_surface_blur
void cairo_image_surface_blur(cairo_surface_t *surface, double radius, double deviation)
Definition: xcb.c:167
WM_DO_NOT_CHANGE_CURRENT_DESKTOP
@ WM_DO_NOT_CHANGE_CURRENT_DESKTOP
Definition: xcb.h:199
netatom_names
const char * netatom_names[]
Definition: xcb.c:104
WM_PANGO_WORKSPACE_NAMES
@ WM_PANGO_WORKSPACE_NAMES
Definition: xcb.h:201
NUM_NETATOMS
@ NUM_NETATOMS
Definition: xcb.h:85
_workarea
Definition: xcb.h:94
_workarea::h
int h
Definition: xcb.h:106
window_set_atom_prop
void window_set_atom_prop(xcb_window_t w, xcb_atom_t prop, xcb_atom_t *atoms, int count)
Definition: xcb.c:403
depth
xcb_depth_t * depth
Definition: xcb.c:96
CURSOR_DEFAULT
@ CURSOR_DEFAULT
Definition: xcb.h:176
visual
xcb_visualtype_t * visual
Definition: xcb.c:97
CURSOR_TEXT
@ CURSOR_TEXT
Definition: xcb.h:180
_workarea::w
int w
Definition: xcb.h:104
EWMH_ATOMS
#define EWMH_ATOMS(X)
Definition: xcb.h:79
monitor_active
int monitor_active(workarea *mon)
Definition: xcb.c:973
WM_EWHM
@ WM_EWHM
Definition: xcb.h:197
ATOM_ENUM
#define ATOM_ENUM(x)
Definition: xcb.h:74
_workarea::name
char * name
Definition: xcb.h:109
WindowManagerQuirk
WindowManagerQuirk
Definition: xcb.h:195
x11_helper_get_screenshot_surface
cairo_surface_t * x11_helper_get_screenshot_surface(void)
Definition: xcb.c:337
count
unsigned long long count
Definition: view.c:117
netatoms
xcb_atom_t netatoms[NUM_NETATOMS]
Definition: xcb.c:103
_workarea::primary
int primary
Definition: xcb.h:98
x11_helper_get_screenshot_surface_window
cairo_surface_t * x11_helper_get_screenshot_surface_window(xcb_window_t window, int size)
Definition: xcb.c:276
rofi_xcb_revert_input_focus
void rofi_xcb_revert_input_focus(void)
Definition: xcb.c:1333
_workarea::mh
int mh
Definition: xcb.h:107
x11_set_cursor
void x11_set_cursor(xcb_window_t window, X11CursorType type)
Definition: xcb.c:1781
current_window_manager
WindowManagerQuirk current_window_manager
Definition: xcb.c:80
window_get_text_prop
char * window_get_text_prop(xcb_window_t w, xcb_atom_t atom)
Definition: xcb.c:377
WM_ROOT_WINDOW_OFFSET
@ WM_ROOT_WINDOW_OFFSET
Definition: xcb.h:203
CURSOR_POINTER
@ CURSOR_POINTER
Definition: xcb.h:178
xcb
xcb_stuff * xcb
Definition: xcb.c:91
NUM_CURSORS
@ NUM_CURSORS
Definition: xcb.h:181