smithay icon indicating copy to clipboard operation
smithay copied to clipboard

POC of smithay-derive

Open PolyMeilex opened this issue 2 years ago • 3 comments

TODO: [ ] Support all modules [ ] Add old macro style as well, not only derive, and remove old definitions [ ] If we add non-derive style macro, crate should probably be renamed to smithay-macros or smithay-proc [ ] Use in anvil and smallvil

PolyMeilex avatar Jul 25 '23 19:07 PolyMeilex

Codecov Report

Patch coverage has no change and project coverage change: -0.32% :warning:

Comparison is base (8d239c7) 24.20% compared to head (5dbabfa) 23.88%. Report is 47 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1090      +/-   ##
==========================================
- Coverage   24.20%   23.88%   -0.32%     
==========================================
  Files         140      141       +1     
  Lines       22334    21695     -639     
==========================================
- Hits         5405     5182     -223     
+ Misses      16929    16513     -416     
Flag Coverage Δ
wlcs-buffer 20.92% <0.00%> (-0.39%) :arrow_down:
wlcs-core 20.55% <0.00%> (-0.42%) :arrow_down:
wlcs-output 8.41% <0.00%> (-0.13%) :arrow_down:
wlcs-pointer-input 22.59% <0.00%> (-0.32%) :arrow_down:

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
src/wayland/compositor/mod.rs 49.74% <0.00%> (-13.08%) :arrow_down:
src/wayland/module_registry.rs 0.00% <0.00%> (ø)
src/wayland/output/mod.rs 52.27% <0.00%> (-9.07%) :arrow_down:
src/wayland/shm/mod.rs 43.15% <0.00%> (-13.01%) :arrow_down:

... and 49 files with indirect coverage changes

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov-commenter avatar Jul 25 '23 19:07 codecov-commenter

So, this should also eliminate the need to write/copy long and arcane macro_rules! delegate_* declarations? That will be nice. That is not a highlight of dealing with code in smithay and mithay-client-toolkit.

smithay-macros may be a better name if we add other kinds of proc macros to it later. But it doesn't matter that much.

ids1024 avatar Jul 25 '23 20:07 ids1024

So, this should also eliminate the need to write/copy long and arcane macro_rules! delegate_* declarations?

Yep, the module descriptor is enough to handle both derive macros and our current style of macros if we'd want that (haven't implemented the non-derive variant yet, tho).

PolyMeilex avatar Jul 26 '23 01:07 PolyMeilex