And replace nullptr arguments for tooltips in UI button
creation functions with std::nullopt. Though the distinction
between "no tooltip" and "empty tooltip" doesn't seem to exist,
it seems safer to keep the distinction since it existed with null before.
This changes the ui-blocks buttons storage from Listbase to Vector.
Major changes that might cause a performance considerations are
in `ui_but_update_from_old_block` that requires to track buttons when restoring
button state between block redraws or in `uiItemFullR` that may needs to insert
uiButs in the middle of the vector to add decorators. This might not be as fast as
removing or inserting elements in the middle of a listbase container. Also buttons currently
don't know its position in the container, so to get the previous and next
button its required to make a lookup of the button in the container.
`UI_block_update_from_old> ui_but_update_from_old_block` restores the state
of buttons between frames, this is done by sequentially testing if a button is the
same as an old button, however since UI can be created procedurally some old buttons
may not be drawn while editing other button data, this requires an extra track of what
buttons may not match to a new button while comparing for restoring state, but still
this buttons may be candidates to match to an new button.
Not functional changes expected.
Ref: #117604
Co-authored-by: Julian Eisel <julian@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/127128
This PR refactors each UI template into its own `interface_template_*.cc`
file.
* Added `interface_templates_intern.hh` which exposes shared utility
functions and macros.
* Doxygen comment sections that were redundant of the file name were
removed. If they contained additional description, they were added
to the file Doxygen `\file` header.
* Short templates that were closely related were kept together in single
files (e.g `uiTemplateHistogram`, `uiTemplateWaveform` and
`uiTemplateVectorScope` are all in `interface_template_scopes.cc`).
In this case, Doxygen comment section were preserved.
The only things remaining in `interface_templates.cc` are:
* Common utility function exposed by `interface_templates_intern.hh`
* Small independent templates (`uiTemplatePathBuilder`,
`uiTemplateNodeSocket` and `uiTemplateFileSelectPath`)
Ref: https://projects.blender.org/blender/blender/issues/117604
Pull Request: https://projects.blender.org/blender/blender/pulls/132468