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
- Host: GitHub
- URL: https://github.com/swaywm/chicken-wlroots
- Owner: swaywm
- License: mit
- Created: 2019-02-10T19:12:00.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-09-07T16:46:43.000Z (about 5 years ago)
- Last Synced: 2024-12-25T13:16:15.006Z (10 months ago)
- Topics: bindings, chicken-scheme, chicken-scheme-eggs, wlroots
- Language: Scheme
- Homepage:
- Size: 119 KB
- Stars: 18
- Watchers: 5
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: COPYING
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
runchicken-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 usingset-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 formstructname-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 thewlr-\*-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
becomeswlr-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
theclock-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.