me

/

vx11 Public
1 branch
Tree Top files
Code
Clone with HTTPS:
Clone with SSH:
diviocity improve coverage XD 6de7c1113616d30335010eea79fd03d19722b474 last Nov 29
composite improve coverage XD last Nov 29 17.83 KB
examples improve coverage XD last Nov 29 121.7 KB
fontconfig improve coverage XD last Nov 29 93.97 KB
randr improve coverage XD last Nov 29 97.34 KB
render improve coverage XD last Nov 29 95.15 KB
screensaver initial release last Nov 12 9.24 KB
shape initial release last Nov 12 18.19 KB
tests improve coverage XD last Nov 29 11.22 KB
xft improve coverage XD last Nov 29 33.54 KB
xinerama initial release last Nov 12 6.75 KB
.editorconfig initial release last Nov 12 123 bytes
.gitattributes initial release last Nov 12 173 bytes
.gitignore improve coverage XD last Nov 29 511 bytes
AGENTS.md improve coverage XD last Nov 29 6.05 KB
COPYING.X11 initial release last Nov 12 50.23 KB
LICENSE initial release last Nov 12 1.13 KB
README.md improve coverage XD last Nov 29 3.31 KB
abi.v initial release last Nov 12 363 bytes
bindings_test.v initial release last Nov 12 1.5 KB
connection.v initial release last Nov 12 3.63 KB
constants.v improve coverage XD last Nov 29 159.36 KB
events.v initial release last Nov 12 2.11 KB
functions.c.v improve coverage XD last Nov 29 179.19 KB
graphics.v initial release last Nov 12 2.54 KB
image.c.v initial release last Nov 12 927 bytes
methods.v improve coverage XD last Nov 29 103.26 KB
property.v initial release last Nov 12 2.21 KB
types.c.v improve coverage XD last Nov 29 44.02 KB
v.mod initial release last Nov 12 133 bytes
vx11.v initial release last Nov 12 142 bytes
vx11_bridge.h improve coverage XD last Nov 29 40.23 KB
window.v initial release last Nov 12 4.35 KB
626 KiB

vx11

UNIX X11 bindings for V, with generated raw APIs and native helpers for windows, events, drawing, properties, and resource ownership. No V package dependencies.

Coverage

The core maps public function declarations from Xlib.h, Xutil.h, Xresource.h, and XKBlib.h, including XKB, resource databases, input methods, font sets, images, and keysyms. It also wraps XImage operation macros. Bindings are generated from installed headers; each wrapper and constant names its C counterpart in a comment.

Native helpers provide connections, windows, graphics contexts, checked event accessors, copied properties, and event loops accepting functions, closures, or bound methods. Generated connection methods also expose advanced Xlib calls.

Optional imports add their own library dependencies:

Import Coverage
vx11.xinerama Complete public Xinerama API; monitor snapshots and activity checks
vx11.shape Complete public SHAPE API; window regions and shape events
vx11.screensaver Complete public MIT-SCREEN-SAVER API; idle time, state, and notifications
vx11.randr Complete public XRandR 1.6 API; outputs, CRTCs, modes, monitors, gamma, properties, and events (details)
vx11.composite Complete public XComposite API; cached window previews (details)
vx11.render Complete public XRender 0.11 API; pictures, compositing, gradients, transforms, filters, glyph sets, and cursors (details)
vx11.xft All non-variadic Xft calls; native UTF-8 text, positioned glyphs, and font helpers
vx11.fontconfig All non-variadic fontconfig.h calls and constants; patterns, matching, listing, charsets, languages, and application fonts

XInput2 is not provided. Fontconfig's FreeType bridge (fcfreetype.h) is not bound, so vx11.fontconfig needs no FreeType headers. Text shaping, bidi ordering, and automatic fallback layout remain application responsibilities.

Getting started

Install V, a C compiler, libX11, and its development headers. Optional modules need their corresponding development libraries; Xft/Fontconfig also use pkg-config and FreeType headers. Core vx11 links only libX11.

Try some examples:

v run examples/hello.v
v run examples/events.v
v run examples/xft_text.v

See the example gallery for runnable demos and screenshots.

Native handles share ownership state and close idempotently. Release graphics contexts, Xft draw contexts, and fonts before windows, then close the connection. Native returned strings and arrays are copied V values. Raw calls retain Xlib's ownership rules and asynchronous errors; native helpers validate local inputs but do not catch every server error. C-backed types preserve the UNIX ABI, including C long widths for XIDs and property storage.

Development

The generated bindings are committed; the generator is not part of this repository.

v -check -shared .
v test bindings_test.v
v -o /tmp/vx11-integration tests/integration.v
xvfb-run -a /tmp/vx11-integration

Additional integration coverage lives in tests/, composite/tests/, randr/tests/, and render/tests/. See AGENTS.md for extension and text test commands. Tested on Linux x86-64.

MIT licensed; bundled X11-derived material retains its accompanying notices.