Module vpe.app_ui_support

Application level user interface support.

Currently this only works on X.Org based desktops.

AppWin

class vpe.app_ui_support.AppWin(dims_pixels, dims_cells, corners, borders, cell_size)

Information about Vim’s application window.

Parameters

dims_pixels

A sequence (w, h) giving the window’s undecorated size in pixels.

dims_cells

A sequence (w, h) giving the window’s undecorated size in character cells.

dims_corners

A sequence of pixel coordiates for the windows corners, in the order TL, TR, BR, BL. For TR and BR the X value is with repect to the right hand edge of the display. For BL and BR the Y value is with repect to the lower edge of the display.

borders

The pixel sizes of the window decoration borders in the order, left, right, top, bottom.

cell_size

The size of a character cell, in pixels.

Attributes

borders

The pixel sizes of the window decoration borders in the order, left, right, top, bottom.

cell_size

The size of a character cell, in pixels.

dims_cells

A sequence (w, h) giving the window’s undecorated size in character cells.

dims_corners

A sequence of pixel coordiates for the windows corners, in the order TL, TR, BR, BL. For TR and BR the X value is with repect to the right hand edge of the display. For BL and BR the Y value is with repect to the lower edge of the display.

dims_pixels

A sequence (w, h) giving the window’s undecorated size in pixels.

Properties

property columns Optional[int]

The calculated number of columns for this window.

This should be the same as the columns option value.

property decor_dims Tuple[int, int]

The windows dimension in pixels including window decoration.

Display

class vpe.app_ui_support.Display(w, h, x, y)

Information about a single display (physical screen).

Parameters

w

The width in pixels.

h

The height in pixels.

x

The X coordinate, in pixels, of the top left corner.

y

The Y coordinate, in pixels, of the top left corner.

Attributes

h

The height in pixels.

w

The width in pixels.

x

The X coordinate, in pixels, of the top left corner.

y

The Y coordinate, in pixels, of the top left corner.

Methods

contains_window(w) bool

Test whether a window is fully contained by this display.

Displays

class vpe.app_ui_support.Displays

Information about the available displays (physical screens).

Attributes

displays

A sequence of Display instances.

Methods

add(display)

Add a display.

find_display_for_window(w: AppWin) Optional[Display]

Find which display a given Window is on.

The position of the windows top-left corner is used for the determination.

Parameters

w: AppWin

The window bein searched for.

attach_vars

vpe.app_ui_support.attach_vars(**kwargs)

Decorator to attach variables to a function.

Parameters

kwargs

The names and initial values of the variables to add.

get_app_win_info

vpe.app_ui_support.get_app_win_info() Optional[AppWin]

Get information about the Vim application window.

get_display_info

vpe.app_ui_support.get_display_info() Displays

Get information about the displays (screens).