wl_resources field names coherency in structs
I brought that up in a PR a while ago and said I'd open an issues... So I tried to automate checks a bit with my rusty awk, probably better to check by hand at some point.
- What made me want to open a ticket iirc, list of children wl_resources (`<struct_name> *<field_name>):
wlr_wl_shell wl_resources;
wlr_linux_dmabuf wl_resources;
wlr_seat_client wl_resources;
wlr_output wl_resources;
wlr_layer_shell client_resources;
wlr_server_decoration_manager wl_resources;
wlr_subcompositor wl_resources;
wlr_subcompositor subsurface_resources;
wlr_compositor wl_resources;
wlr_compositor surface_resources;
wlr_compositor region_resources;
wlr_xdg_output resources;
wlr_xdg_output_manager resources;
wlr_data_device_manager wl_resources;
most are wl_resources
except a few that are just resources
, probably want to rename these, and some with specific names.
My personal opinion here would be to always use specific names if we can, but would need to look one at a time.
- "main" wl_resources e.g. points to the resource that made us create the current struct, usually a single pointer named 'resource'. That is coherent enough except
wlr_dmabuf_buffer *buffer_resource;
- while I'm at it, wl_global:
wlr_wl_shell *wl_global;
wlr_screenshooter *wl_global;
wlr_input_inhibit_manager *wl_global;
wlr_gamma_control_manager *wl_global;
wlr_linux_dmabuf *wl_global;
wlr_seat *wl_global;
wlr_output *wl_global;
wlr_layer_shell *wl_global;
wlr_server_decoration_manager *wl_global;
wlr_idle *wl_global;
wlr_subcompositor *wl_global;
wlr_compositor *wl_global;
wlr_xdg_output_manager *global;
wlr_xdg_shell *wl_global;
wlr_data_device_manager *global;
wlr_primary_selection_device_manager *global;
a couple could use renaming to wl_global I guess?
- Any other such field to look at?