diff options
author | Bastien Montagne <b.mont29@gmail.com> | 2020-03-19 21:37:00 +0300 |
---|---|---|
committer | Bastien Montagne <b.mont29@gmail.com> | 2020-03-19 21:39:23 +0300 |
commit | 12b621059a6f1337e8ae8fdd9533e7808225e71e (patch) | |
tree | d04a2fddc28152235191e2d93884f4d143410d85 /source/blender/blenkernel/BKE_idtype.h | |
parent | 0b7854323d41f3a1a55a40ddf76a90e2017a0784 (diff) |
Cleanup/refactor: remove BKE_idcode, in favour of BKE_idtype.
Mpving utils from idcode to idtype proved to be somewhat painful for
some reasons, but now all looks good.
Had to add a fake/empty shell for the special snowflake too,
`ID_LINK_PLACEHOLDER/INDEX_ID_NULL`...
Diffstat (limited to 'source/blender/blenkernel/BKE_idtype.h')
-rw-r--r-- | source/blender/blenkernel/BKE_idtype.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_idtype.h b/source/blender/blenkernel/BKE_idtype.h index 60eee2035f5..93bcfe5323d 100644 --- a/source/blender/blenkernel/BKE_idtype.h +++ b/source/blender/blenkernel/BKE_idtype.h @@ -166,6 +166,8 @@ extern IDTypeInfo IDType_ID_HA; extern IDTypeInfo IDType_ID_PT; extern IDTypeInfo IDType_ID_VO; +extern IDTypeInfo IDType_ID_LINK_PLACEHOLDER; + /* ********** Helpers/Utils API. ********** */ /* Module initialization. */ @@ -175,6 +177,22 @@ void BKE_idtype_init(void); const struct IDTypeInfo *BKE_idtype_get_info_from_idcode(const short id_code); const struct IDTypeInfo *BKE_idtype_get_info_from_id(const struct ID *id); +const char *BKE_idtype_idcode_to_name(const short idcode); +const char *BKE_idtype_idcode_to_name_plural(const short idcode); +const char *BKE_idtype_idcode_to_translation_context(const short idcode); +bool BKE_idtype_idcode_is_linkable(const short idcode); +bool BKE_idtype_idcode_is_valid(const short idcode); + +short BKE_idtype_idcode_from_name(const char *name); + +uint64_t BKE_idtype_idcode_to_idfilter(const short idcode); +short BKE_idtype_idcode_from_idfilter(const uint64_t idfilter); + +int BKE_idtype_idcode_to_index(const short idcode); +short BKE_idtype_idcode_from_index(const int index); + +short BKE_idtype_idcode_iter_step(int *index); + #ifdef __cplusplus } #endif |