diff options
author | Bastien Montagne <bastien@blender.org> | 2020-05-07 13:36:35 +0300 |
---|---|---|
committer | Bastien Montagne <bastien@blender.org> | 2020-05-07 17:49:11 +0300 |
commit | e39878b90ef8c1fa503441d3117d44587af38de3 (patch) | |
tree | a71a8ac39e9c2edbfbb3c901d372a3e3201b090d /source/blender/blenkernel/BKE_idtype.h | |
parent | c59c318f33433571cf6a3042022f8e72ac718738 (diff) |
Initial step to move libquery to IDTypeInfo.
Part of T74960 (and hence T75724).
This commit only adds the basics helper code, and alter some internal libquery
code to use it.
Porting each IDType to the new system will be done gradually from there,
to allow better detection and handling of potential issues.
Differential Revision: https://developer.blender.org/D7598
Diffstat (limited to 'source/blender/blenkernel/BKE_idtype.h')
-rw-r--r-- | source/blender/blenkernel/BKE_idtype.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_idtype.h b/source/blender/blenkernel/BKE_idtype.h index 6dc504c2007..b6dfadd3b2a 100644 --- a/source/blender/blenkernel/BKE_idtype.h +++ b/source/blender/blenkernel/BKE_idtype.h @@ -33,6 +33,7 @@ extern "C" { #endif struct ID; +struct LibraryForeachIDData; struct Main; /** IDTypeInfo.flags. */ @@ -60,6 +61,8 @@ typedef void (*IDTypeFreeDataFunction)(struct ID *id); /** \param flag: See BKE_lib_id.h's LIB_ID_MAKELOCAL_... flags. */ typedef void (*IDTypeMakeLocalFunction)(struct Main *bmain, struct ID *id, const int flags); +typedef void (*IDTypeForeachIDFunction)(struct ID *id, struct LibraryForeachIDData *data); + typedef struct IDTypeInfo { /* ********** General IDType data. ********** */ @@ -121,6 +124,12 @@ typedef struct IDTypeInfo { * `BKE_lib_id_make_local_generic()` is enough. */ IDTypeMakeLocalFunction make_local; + + /** + * Called by `BKE_library_foreach_ID_link()` to apply a callback over all other ID usages (ID + * pointers) of given data-block. + */ + IDTypeForeachIDFunction foreach_id; } IDTypeInfo; /* ********** Declaration of each IDTypeInfo. ********** */ |