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

Generate wrapper objects for extension resources #629

Merged
merged 9 commits into from
Jul 25, 2021
Merged

Conversation

psychon
Copy link
Owner

@psychon psychon commented Jul 25, 2021

Instead of just generating wrappers just for xproto, this PR also implements wrappers damage, record, render, shm, sync, and xfixes. At least the part of those that fits in the current scheme.

Fixes: #78

This commit moves the xproto resource to an extra module and changes the
type to not contain a fixed-size array. This is both in preparation for
also adding information about extension resources.

Signed-off-by: Uli Schlachter <psychon@znc.in>
Signed-off-by: Uli Schlachter <psychon@znc.in>
Signed-off-by: Uli Schlachter <psychon@znc.in>
xfixes adds the Region type. A region can also be created via
composite's CreateRegionFromBorderClip. The wrapper for this type is
also added on RegionWrapper.

Signed-off-by: Uli Schlachter <psychon@znc.in>
Signed-off-by: Uli Schlachter <psychon@znc.in>
Signed-off-by: Uli Schlachter <psychon@znc.in>
error: called `.as_ref().map(|ns| &**ns)` on an Option value. This can be done more directly by calling `request_ns.as_deref()` instead
   --> generator/src/generator/namespace/resource_wrapper.rs:172:22
    |
172 |     let request_ns = request_ns.as_ref().map(|ns| &**ns).unwrap_or(generator.ns);
    |                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try using as_deref instead: `request_ns.as_deref()`
    |
    = note: `-D clippy::option-as-ref-deref` implied by `-D warnings`
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#option_as_ref_deref

Signed-off-by: Uli Schlachter <psychon@znc.in>
str::split_once() was stabilised in Rust 1.52.0. Thus, we cannot use it
with our minimum supported rust version of 1.41 and need to reimplement
it ourselves. Yay.

Signed-off-by: Uli Schlachter <psychon@znc.in>
error: this expression borrows a reference (`&xcbgen::defs::Module`) that is immediately dereferenced by the compiler
  --> generator/src/generator/mod.rs:57:13
   |
57 |             &module,
   |             ^^^^^^^ help: change this to: `module`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow

Signed-off-by: Uli Schlachter <psychon@znc.in>
@mergify mergify bot merged commit a7b38f0 into master Jul 25, 2021
@mergify mergify bot deleted the generate-wrappers2 branch July 25, 2021 11:44
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.

Add some wrapper for resources (e.g. pixmaps) that frees them on drop (free_pixmap())
2 participants