-
Notifications
You must be signed in to change notification settings - Fork 341
Document the types passed to each wl_listener
#3239
Comments
I've documented these in the type system of zig-wlroots but haven't found time to port this information back to the upstream wlroots headers in the form of comments. For example: events: extern struct {
frame: wl.Signal(*Output),
damage: wl.Signal(*event.Damage),
needs_frame: wl.Signal(*Output),
precommit: wl.Signal(*event.Precommit),
commit: wl.Signal(*event.Commit),
present: wl.Signal(*event.Present),
bind: wl.Signal(*event.Bind),
enable: wl.Signal(*Output),
mode: wl.Signal(*Output),
description: wl.Signal(*Output),
destroy: wl.Signal(*Output),
}, These are already documented by comments in some places in wlroots, but not all. |
Note, in some places the doc comment is missing, but that just means "no data"/NULL. |
Currently wlroots usually passes a pointer to the struct itself is there is no doc comment. For example in wlroots/include/wlr/types/wlr_output.h Lines 152 to 173 in 13cdb84
However wlroots passes a Is this intentional? |
It's mostly cargo-culting. I'd like to stop doing this and replace all of these with NULL, because this would allow us to extend the API without breaking it (ref #1008 (comment)). |
Does that include constructor events? Presumably a new_surface event needs to pass the |
This doesn't include listeners with an already-useful data pointer, such as |
wl_listener.notify
only gets avoid *
so the actual parameter type needs to be documented.wlroots has migrated to gitlab.freedesktop.org. This issue has been moved to:
https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3239
The text was updated successfully, but these errors were encountered: