rofi  1.7.0
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
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
Definition: xcb.h:94
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:117
xcb_colormap_t map
Definition: xcb.c:95
int monitor_active(workarea *mon)
Definition: xcb.c:937
cairo_surface_t * x11_helper_get_screenshot_surface(void)
Definition: xcb.c:334
xcb_stuff * xcb
Definition: xcb.c:88
xcb_depth_t * depth
Definition: xcb.c:93
#define EWMH_ATOMS(X)
Definition: xcb.h:79
void rofi_xcb_revert_input_focus(void)
Definition: xcb.c:1250
void rofi_xcb_set_input_focus(xcb_window_t w)
Definition: xcb.c:1227
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:1693
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
cairo_surface_t * x11_helper_get_bg_surface(void)
Definition: xcb.c:360
#define ATOM_ENUM(x)
Definition: xcb.h:74
@ NUM_NETATOMS
Definition: xcb.h:85
cairo_surface_t * x11_helper_get_screenshot_surface_window(xcb_window_t window, int size)
Definition: xcb.c:273
xcb_window_t xcb_stuff_get_root_window(void)
Definition: xcb.c:1634
void window_set_atom_prop(xcb_window_t w, xcb_atom_t prop, xcb_atom_t *atoms, int count)
Definition: xcb.c:400
const char * netatom_names[]
Definition: xcb.c:101
void cairo_image_surface_blur(cairo_surface_t *surface, double radius, double deviation)
Definition: xcb.c:164
WindowManagerQuirk current_window_manager
Definition: xcb.c:77
char * window_get_text_prop(xcb_window_t w, xcb_atom_t atom)
Definition: xcb.c:374
void x11_disable_decoration(xcb_window_t window)
Definition: xcb.c:1669
xcb_atom_t netatoms[NUM_NETATOMS]
Definition: xcb.c:100
xcb_visualtype_t * visual
Definition: xcb.c:94