An open API service indexing awesome lists of open source software.

https://github.com/swaywm/chicken-wlroots

CHICKEN Scheme bindings for wlroots
https://github.com/swaywm/chicken-wlroots

bindings chicken-scheme chicken-scheme-eggs wlroots

Last synced: 3 months ago
JSON representation

CHICKEN Scheme bindings for wlroots

Awesome Lists containing this project

README

          

chicken-wlroots [WIP]
=====================

Chicken Scheme bindings for wlroots.

Building
--------

Dependencies:

* CHICKEN 5
* [chicken-wayland-server](https://github.com/drewt/chicken-wayland-server)
* [chicken-xkbcommon](https://github.com/drewt/chicken-xkbcommon) (for example programs)
* [wlroots](https://github.com/swaywm/wlroots)

Simply run chicken-install in this directory to build and install
chicken-wlroots as an egg. To avoid building the egg as root, you can either
run chicken-install -sudo to get permissions via sudo, or else
[change the repository location](https://wiki.call-cc.org/man/5/Extension%20tools#changing-the-repository-location)
to a directory that you can write to.

Usage
-----

### Memory Management

These are low level bindings. Most wlroots objects allocated via these bindings
are not garbage collected (with a few exceptions). You may set up your own
memory management scheme using set-finalizer! where appropriate.

The wlroots objects which *are* garbage collected are:

* wlr-box
* wlr-matrix (not actually a wlroots type, but a wrapper for a float[9])

### Naming Conventions

Module naming mimics the structure of the wlroots headers. E.g., the module
(wlr types wlr-box) exports all of the identifiers declared in the
header "wlr/types/wlr\_box.h".

SRFI-17 getter/setter procedures are defined for accessing struct members.
They take the form structname-membername. For nested structs,
only getters are defined.

Constructors for wlroots types take the form make-wlr-type.
Constructors are only exported where it makes sense to do so (e.g. wlr-box); in
most cases you should use the wlr-\*-create functions provided by
wlroots.

Procedures use the usual kebab-case convention.

Enums use the convention enum-prefix/kind, e.g.
WLR\_INPUT\_DEVICE\_KEYBOARD becomes
wlr-input-device/keyboard.

### Differences from the C API

For C functions taking output parameters, these bindings remove the output
parameters (unless their input value is also meaningful) and return multiple
values instead. The order of the returned values is the C return value,
followed by the output parameters in order.

Because some wlroots functions take a struct timespec as an
argument, these bindings provide a module (wlr time) which exports
the clock-gettime function.

Examples
--------

Example programs can be found in the src/examples directory. These are fairly
direct translations from C, so do not expect idiomatic Scheme.

To build the examples, run make after installing chicken-wlroots.