wlroots icon indicating copy to clipboard operation
wlroots copied to clipboard

consistently define protocol enums in wlr types

Open acrisci opened this issue 7 years ago • 3 comments

We have three patterns that I know of for defining enums that come from external protocols in wlr types.

  1. untyped enums (uint32_t)
  2. use external enums directly (like layer shell)
  3. use wrapped wlr types

We had a discussion at the hackathon and determined that we should use approach 2) in all parts of the library so the code should be refactored to use this pattern.


wlroots has migrated to gitlab.freedesktop.org. This issue has been moved to:

https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/770

acrisci avatar Mar 28 '18 23:03 acrisci

Note that we will need to keep using approach 1 for bitfields (e.g. cases where multiple enum values can be used at once (e.g. ZWLR_LAYER_SURFACE_V1_ANCHOR_TOP | ZWLR_LAYER_SURFACE_V1_ANCHOR_RIGHT)

ddevault avatar Mar 28 '18 23:03 ddevault

This will require all users of the library to have the external headers available. Some of those aren't distributed in separatly in packages, what's the plan for those? Will wlr include the generated protocol headers for the application, or will applications be expected to provide them in their build environment?

Ongy avatar Mar 29 '18 16:03 Ongy

will applications be expected to provide them in their build environment?

yes

ddevault avatar Mar 29 '18 18:03 ddevault