rofi  1.5.4
xcb.h
Go to the documentation of this file.
1 /*
2  * rofi
3  *
4  * MIT/X11 License
5  * Copyright © 2013-2017 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 <xcb/xcb.h>
32 #include <cairo.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, int count );
71 
73 #define ATOM_ENUM( x ) x
74 
75 #define ATOM_CHAR( x ) # x
76 
78 #define EWMH_ATOMS( X ) \
79  X ( _NET_WM_WINDOW_OPACITY ), \
80  X ( I3_SOCKET_PATH ), \
81  X ( UTF8_STRING ), \
82  X ( STRING ), \
83  X ( CLIPBOARD ), \
84  X ( WM_WINDOW_ROLE ), \
85  X ( _XROOTPMAP_ID ), \
86  X ( _MOTIF_WM_HINTS ), \
87  X ( ESETROOT_PMAP_ID )
88 
92 extern const char *netatom_names[];
94 extern xcb_atom_t netatoms[NUM_NETATOMS];
95 
99 typedef struct _workarea
100 {
104  int primary;
106  int x;
108  int y;
110  int w;
112  int h;
113  int mw, mh;
115  char *name;
117  struct _workarea *next;
119 
127 int monitor_active ( workarea *mon );
128 
132 extern xcb_depth_t *depth;
136 extern xcb_visualtype_t *visual;
140 extern xcb_colormap_t map;
141 
147 cairo_surface_t * x11_helper_get_bg_surface ( void );
155 cairo_surface_t *x11_helper_get_screenshot_surface ( void );
156 
163 void x11_disable_decoration ( xcb_window_t window );
164 
168 typedef enum
169 {
171  WM_EWHM = 0,
177 
183 
184 #endif
_workarea::x
int x
Definition: xcb.h:106
workarea
struct _workarea workarea
_workarea::mw
int mw
Definition: xcb.h:113
x11_helper_get_bg_surface
cairo_surface_t * x11_helper_get_bg_surface(void)
Definition: xcb.c:141
_workarea::y
int y
Definition: xcb.h:108
map
xcb_colormap_t map
Definition: xcb.c:94
mon
workarea mon
Definition: view.c:112
x11_disable_decoration
void x11_disable_decoration(xcb_window_t window)
Definition: xcb.c:1362
xcb_stuff_get_root_window
xcb_window_t xcb_stuff_get_root_window(void)
Definition: xcb.c:1322
_workarea::monitor_id
int monitor_id
Definition: xcb.h:102
_xcb_stuff
Definition: xcb-internal.h:44
_workarea::next
struct _workarea * next
Definition: xcb.h:117
WM_DO_NOT_CHANGE_CURRENT_DESKTOP
@ WM_DO_NOT_CHANGE_CURRENT_DESKTOP
Definition: xcb.h:173
netatom_names
const char * netatom_names[]
Definition: xcb.c:100
WM_PANGO_WORKSPACE_NAMES
@ WM_PANGO_WORKSPACE_NAMES
Definition: xcb.h:175
_workarea
Definition: xcb.h:100
_workarea::h
int h
Definition: xcb.h:112
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:178
depth
xcb_depth_t * depth
Definition: xcb.c:92
visual
xcb_visualtype_t * visual
Definition: xcb.c:93
_workarea::w
int w
Definition: xcb.h:110
EWMH_ATOMS
#define EWMH_ATOMS(X)
Definition: xcb.h:78
monitor_active
int monitor_active(workarea *mon)
Definition: xcb.c:681
WM_EWHM
@ WM_EWHM
Definition: xcb.h:171
ATOM_ENUM
#define ATOM_ENUM(x)
Definition: xcb.h:73
_workarea::name
char * name
Definition: xcb.h:115
WindowManagerQuirk
WindowManagerQuirk
Definition: xcb.h:169
x11_helper_get_screenshot_surface
cairo_surface_t * x11_helper_get_screenshot_surface(void)
Definition: xcb.c:106
count
unsigned long long count
Definition: view.c:116
netatoms
xcb_atom_t netatoms[NUM_NETATOMS]
Definition: xcb.c:99
_workarea::primary
int primary
Definition: xcb.h:104
_workarea::mh
int mh
Definition: xcb.h:113
current_window_manager
WindowManagerQuirk current_window_manager
Definition: xcb.c:74
window_get_text_prop
char * window_get_text_prop(xcb_window_t w, xcb_atom_t atom)
Definition: xcb.c:153
NUM_NETATOMS
@ NUM_NETATOMS
Definition: xcb.h:90
xcb
xcb_stuff * xcb
Definition: xcb.c:87