Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New API and XCB-1.14 support #105

Merged
merged 2 commits into from
Nov 11, 2021
Merged

New API and XCB-1.14 support #105

merged 2 commits into from
Nov 11, 2021

Conversation

rtbo
Copy link
Collaborator

@rtbo rtbo commented Sep 26, 2021

This PR aims to provide a safe and sound Rust API for XCB.
Along the way, I will also drop the FFI bindings and implement the extensions code directly in Rust. (rust-xcb will no longer link against the C extensions dynamic libraries)
Finally, the bindings are targeting the last version of the protocol: 1.14.

If I manage to get everything right, this will be rust-xcb v1.0.0
Do not hesitate to comment on the new API!

EDIT:
To get a grasp on the new API, the up-to-date crate documentation of this PR is automatically deployed here.

 - Simple structures that have the same memory layout than C are translated in
   Rust directly (e.g. points etc.)
 - More complex structures wrap a slice of raw data and provide accessor methods
   (`Debug` will still print all the members)
 - The masks use the `bitflags` crate macro
 - The enums are enums!
 - The unions are also enums, but they carry data
 - The Xids (handles to windows, pixmaps etc.) are type-safe implementations of
   the `Xid` trait, not just integers like with `0.x` versions.
 - The requests are structures that serialize themselves when passed to the
   `Connection`.
    - Each request has two type of cookie, for checked and unchecked requests.
      This allows type safe reply fetching and error checking
 - The protocol and each extension provide an `Event` and an `Error` enum,
   which are unified by the core library.
@rtbo rtbo merged commit 38b3cdf into v1.0-dev Nov 11, 2021
@rtbo rtbo deleted the xcb-1.14 branch November 12, 2021 20:27
@mahkoh mahkoh mentioned this pull request Dec 25, 2021
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant