rofi 1.7.9
xcb.h File Reference
#include <cairo.h>
#include <xcb/xcb.h>
Include dependency graph for xcb.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  _workarea
 

Macros

#define ATOM_ENUM(x)
 
#define ATOM_CHAR(x)
 
#define EWMH_ATOMS(X)
 

Typedefs

typedef struct _xcb_stuff xcb_stuff
 
typedef struct _workarea workarea
 

Enumerations

enum  { EWMH_ATOMS =(ATOM_ENUM) , NUM_NETATOMS }
 
enum  X11CursorType { CURSOR_DEFAULT = 0 , CURSOR_POINTER , CURSOR_TEXT , NUM_CURSORS }
 
enum  WindowManagerQuirk { WM_EWHM = 0 , WM_DO_NOT_CHANGE_CURRENT_DESKTOP = 1 , WM_PANGO_WORKSPACE_NAMES = 2 }
 

Functions

void xcb_stuff_set_clipboard (char *data)
 
xcb_window_t xcb_stuff_get_root_window (void)
 
char * window_get_text_prop (xcb_window_t w, xcb_atom_t atom)
 
void window_set_atom_prop (xcb_window_t w, xcb_atom_t prop, xcb_atom_t *atoms, int count)
 
int monitor_active (workarea *mon)
 
void rofi_xcb_set_input_focus (xcb_window_t w)
 
void rofi_xcb_revert_input_focus (void)
 
cairo_surface_t * x11_helper_get_bg_surface (void)
 
cairo_surface_t * x11_helper_get_screenshot_surface (void)
 
void x11_disable_decoration (xcb_window_t window)
 
void x11_set_cursor (xcb_window_t window, X11CursorType type)
 
cairo_surface_t * x11_helper_get_screenshot_surface_window (xcb_window_t window, int size)
 
void cairo_image_surface_blur (cairo_surface_t *surface, int radius, double deviation)
 
char * x11_helper_get_window_manager (void)
 

Variables

xcb_stuffxcb
 
const char * netatom_names []
 
xcb_atom_t netatoms [NUM_NETATOMS]
 
xcb_depth_t * depth
 
xcb_visualtype_t * visual
 
xcb_colormap_t map
 
WindowManagerQuirk current_window_manager
 

Macro Definition Documentation

◆ ATOM_CHAR

#define ATOM_CHAR ( x)
Value:
#x

Get the atoms as strings.

Definition at line 86 of file xcb.h.

◆ ATOM_ENUM

#define ATOM_ENUM ( x)
Value:
x

For getting the atoms in an enum

Definition at line 84 of file xcb.h.

◆ EWMH_ATOMS

#define EWMH_ATOMS ( X)
Value:
X(_NET_WM_WINDOW_OPACITY), X(I3_SOCKET_PATH), X(TARGETS), X(UTF8_STRING), \
X(STRING), X(CLIPBOARD), X(WM_WINDOW_ROLE), X(_XROOTPMAP_ID), \
X(_MOTIF_WM_HINTS), X(WM_TAKE_FOCUS), X(ESETROOT_PMAP_ID)

Atoms we want to pre-load

Definition at line 89 of file xcb.h.

Typedef Documentation

◆ workarea

typedef struct _workarea workarea

Structure describing a workarea/monitor.

◆ xcb_stuff

typedef struct _xcb_stuff xcb_stuff

xcb data structure type declaration.

Definition at line 40 of file xcb.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

enumeration of the atoms.

Enumerator
EWMH_ATOMS 
NUM_NETATOMS 

Definition at line 95 of file xcb.h.

◆ WindowManagerQuirk

List of window managers that need different behaviour to functioning.

Enumerator
WM_EWHM 

Default EWHM compatible window manager

WM_DO_NOT_CHANGE_CURRENT_DESKTOP 

I3 Window manager

WM_PANGO_WORKSPACE_NAMES 

PANGO WORKSPACE NAMES

Definition at line 205 of file xcb.h.

◆ X11CursorType

List of cursor types.

Enumerator
CURSOR_DEFAULT 

Default arrow cursor

CURSOR_POINTER 

Cursor denoting a clickable area

CURSOR_TEXT 

Cursor denoting an input field / selectable text

NUM_CURSORS 

Definition at line 184 of file xcb.h.

Function Documentation

◆ cairo_image_surface_blur()

void cairo_image_surface_blur ( cairo_surface_t * surface,
int radius,
double deviation )
Parameters
surface
radius
deviation

Blur the content of the surface with radius and deviation.

Definition at line 176 of file xcb.c.

References create_kernel(), TICK, and TICK_N.

Referenced by rofi_view_setup_fake_transparency().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ monitor_active()

int monitor_active ( workarea * mon)
Parameters
monworkarea to be filled in.

Fills in mon with the information about the monitor rofi should show on.

Returns
TRUE if monitor is found, FALSE if no monitor could be detected.

Definition at line 1003 of file xcb.c.

References config, mon, mon_cache, mon_set, monitor_active_from_id(), monitor_active_from_winid(), monitor_dimensions(), monitor_get_dimension(), and xcb.

Referenced by __create_window(), config_sanity_check(), and rofi_theme_parse_process_conditionals().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rofi_xcb_revert_input_focus()

void rofi_xcb_revert_input_focus ( void )

IF set, revert the focus back to the original applications.

Definition at line 1516 of file xcb.c.

References xcb.

Referenced by rofi_view_cleanup(), and rofi_view_hide().

Here is the caller graph for this function:

◆ rofi_xcb_set_input_focus()

void rofi_xcb_set_input_focus ( xcb_window_t w)
Parameters
wrofis window

Stores old input focus for reverting and set focus to rofi.

Definition at line 1493 of file xcb.c.

References config, and xcb.

Referenced by rofi_view_create().

Here is the caller graph for this function:

◆ window_get_text_prop()

char * window_get_text_prop ( xcb_window_t w,
xcb_atom_t atom )
Parameters
wThe xcb_window_t to read property from.
atomThe property identifier

Get text property defined by atom from window. Support utf8.

Returns
a newly allocated string with the result or NULL

Definition at line 386 of file xcb.c.

References netatoms, rofi_latin_to_utf8_strdup(), and xcb.

Referenced by rofi_view_paste().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ window_set_atom_prop()

void window_set_atom_prop ( xcb_window_t w,
xcb_atom_t prop,
xcb_atom_t * atoms,
int count )
Parameters
wThe xcb_window_t to set property on
propAtom of the property to change
atomsList of atoms to change the property too
countThe length of the atoms list.

Set property on window.

Definition at line 412 of file xcb.c.

References count, and xcb.

Referenced by __create_window().

Here is the caller graph for this function:

◆ x11_disable_decoration()

void x11_disable_decoration ( xcb_window_t window)
Parameters
windowThe X11 window to modify

Set the right hints to disable the window decoration. (Set MOTIF_WM_HINTS, decoration field)

Definition at line 1991 of file xcb.c.

References flags, netatoms, and xcb.

Referenced by __create_window().

Here is the caller graph for this function:

◆ x11_helper_get_bg_surface()

cairo_surface_t * x11_helper_get_bg_surface ( void )

Gets a surface containing the background image of the desktop.

Returns
a cairo surface with the background image of the desktop.

Definition at line 372 of file xcb.c.

References get_root_pixmap(), netatoms, root_visual, and xcb.

Referenced by rofi_view_setup_fake_transparency().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ x11_helper_get_screenshot_surface()

cairo_surface_t * x11_helper_get_screenshot_surface ( void )

Gets a surface for the root window of the desktop.

Can be used to take screenshot.

Returns
a cairo surface for the root window of the desktop.

Holds for each supported modifier the possible modifier mask. Check x11_mod_masks[MODIFIER]&mask != 0 to see if MODIFIER is activated.

Definition at line 346 of file xcb.c.

References root_visual, xcb, and xcb_stuff_get_root_window().

Referenced by rofi_view_setup_fake_transparency().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ x11_helper_get_screenshot_surface_window()

cairo_surface_t * x11_helper_get_screenshot_surface_window ( xcb_window_t window,
int size )
Parameters
windowthe window the screenshot
sizeSize of the thumbnail

Creates a thumbnail of the window.

Returns
NULL if window was not found, or unmapped, otherwise returns a cairo_surface.

Definition at line 285 of file xcb.c.

References lookup_visual(), and xcb.

Here is the call graph for this function:

◆ x11_helper_get_window_manager()

char * x11_helper_get_window_manager ( void )

Get the currently detected window manager.

Returns
NULL when non found, otherwise a string (free with g_free)

Definition at line 1625 of file xcb.c.

References xcb, and xcb_stuff_get_root_window().

Referenced by help().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ x11_set_cursor()

void x11_set_cursor ( xcb_window_t window,
X11CursorType type )
Parameters
window
type

Change mouse cursor

Definition at line 2015 of file xcb.c.

References cursors, NUM_CURSORS, and xcb.

Referenced by rofi_view_set_cursor().

Here is the caller graph for this function:

◆ xcb_stuff_get_root_window()

xcb_window_t xcb_stuff_get_root_window ( void )

Get the root window.

Returns
the root window.

Definition at line 1949 of file xcb.c.

References xcb.

Referenced by __create_window(), display_late_setup(), display_setup(), lazy_grab_keyboard(), lazy_grab_pointer(), x11_helper_discover_window_manager(), x11_helper_get_screenshot_surface(), and x11_helper_get_window_manager().

Here is the caller graph for this function:

◆ xcb_stuff_set_clipboard()

void xcb_stuff_set_clipboard ( char * data)
Parameters
dataString to copy to clipboard.

copies string to clipboard.

Definition at line 2027 of file xcb.c.

References xcb.

Referenced by main_loop_x11_event_handler_view(), rofi_view_cleanup(), and rofi_view_trigger_global_action().

Here is the caller graph for this function:

Variable Documentation

◆ current_window_manager

WindowManagerQuirk current_window_manager
extern

Indicates the current window manager. This is used for work-arounds.

Definition at line 85 of file xcb.c.

Referenced by x11_helper_discover_window_manager().

◆ depth

xcb_depth_t* depth
extern

Depth of visual

Depth of root window.

Definition at line 106 of file xcb.c.

Referenced by __create_window(), rofi_view_temp_configure_notify(), rofi_view_window_update_size(), and x11_create_visual_and_colormap().

◆ map

xcb_colormap_t map
extern

Color map to use for creating window

Definition at line 108 of file xcb.c.

Referenced by __create_window(), rofi_view_cleanup(), and x11_create_visual_and_colormap().

◆ netatom_names

const char* netatom_names[]
extern

atoms as string

Definition at line 114 of file xcb.c.

Referenced by x11_create_frequently_used_atoms().

◆ netatoms

◆ visual

xcb_visualtype_t* visual
extern

Visual to use for creating window

Definition at line 107 of file xcb.c.

Referenced by __create_window(), rofi_view_temp_configure_notify(), rofi_view_window_update_size(), and x11_create_visual_and_colormap().

◆ xcb

xcb_stuff* xcb
extern

Global pointer to xcb_stuff instance.

Definition at line 101 of file xcb.c.

Referenced by __create_window(), display_cleanup(), display_dump_monitor_layout(), display_early_cleanup(), display_setup(), display_startup_notification(), lazy_grab_keyboard(), main_loop_x11_event_handler(), main_loop_x11_event_handler_view(), monitor_active(), monitor_active_from_id(), monitor_active_from_id_focused(), monitor_active_from_winid(), monitor_dimensions(), monitor_get_dimension(), pointer_get(), release_keyboard(), release_pointer(), rofi_key_press_event_handler(), rofi_key_release_event_handler(), rofi_view_cleanup(), rofi_view_create(), rofi_view_error_dialog(), rofi_view_hide(), rofi_view_paste(), rofi_view_ping_mouse(), rofi_view_repaint(), rofi_view_set_selected_line(), rofi_view_set_window_title(), rofi_view_temp_configure_notify(), rofi_view_trigger_global_action(), rofi_view_window_update_size(), rofi_xcb_revert_input_focus(), rofi_xcb_set_input_focus(), take_keyboard(), take_pointer(), window_get_text_prop(), window_set_atom_prop(), x11_build_monitor_layout(), x11_build_monitor_layout_xinerama(), x11_create_frequently_used_atoms(), x11_create_visual_and_colormap(), x11_disable_decoration(), x11_get_monitor_from_output(), x11_helper_discover_window_manager(), x11_helper_get_bg_surface(), x11_helper_get_screenshot_surface(), x11_helper_get_screenshot_surface_window(), x11_helper_get_window_manager(), x11_is_extension_present(), x11_lookup_cursors(), x11_monitors_free(), x11_set_cursor(), xcb_stuff_get_root_window(), and xcb_stuff_set_clipboard().