Having switch-case like checks somewhere in the source code, to check which
ID-types support previews, is generally considered problematic.
Instead, the ID-type (or ID) itself should be able to say: "I support
previews". This localizes ID-type specific code, making it easier to maintain
and preventing issues like this:
https://developer.blender.org/rBfa96aa581192a14
By making this an ID-type callback taking the ID * as parameter, the ID can
do further checks to see if it should actually allow previews, e.g. objects can
check if the object-data type supports previews.
This patch also:
- Improves const correctness. The ID_PRV_CASE() macro silently cast away const.
- Fixes missing preview reading from external files for brushes & screens.