The general idea is to keep the 'old', C-style MEM_callocN signature, and slowly
replace most of its usages with the new, C++-style type-safer template version.
* `MEM_cnew<T>` allocation version is renamed to `MEM_callocN<T>`.
* `MEM_cnew_array<T>` allocation version is renamed to `MEM_calloc_arrayN<T>`.
* `MEM_cnew<T>` duplicate version is renamed to `MEM_dupallocN<T>`.
Similar templates type-safe version of `MEM_mallocN` will be added soon
as well.
Following discussions in !134452.
NOTE: For now static type checking in `MEM_callocN` and related are slightly
different for Windows MSVC. This compiler seems to consider structs using the
`DNA_DEFINE_CXX_METHODS` macro as non-trivial (likely because their default
copy constructors are deleted). So using checks on trivially
constructible/destructible instead on this compiler/system.
Pull Request: https://projects.blender.org/blender/blender/pulls/134771
There is no (good) reason to use 'refine' internal code to create RNA
pointers of IDs, these always ignore any 'ID inheritance', since by
definition the 'owner ID' info of an ID PointerRNA is always that ID.
Similarily, do not call RNA pointers creation code with null data, this
will simply return `PointerRNA_NULL`, can as well return that directly.
Pull Request: https://projects.blender.org/blender/blender/pulls/133668
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