diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2016-02-09 14:44:06 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2016-02-09 14:51:07 +0300 |
commit | 337b718695c8b31dadc22438b9f1af40d225e0ad (patch) | |
tree | 976974961c40f6d764beef0a1389599998fe3496 /source/blender/makesrna/RNA_access.h | |
parent | ae2036e69b88abb5c65179a70e97be17655bc7d4 (diff) |
Fix T47371 - add access to 'static' enum items.
Some dynamic enums, which do not need a valid context pointer, have their 'itemf'
callback always called. This is annoying for introspection tools (like the ones generating
translations, or API documentation), because it means they never have access to all possible
options (enum items).
So now, there is also an `enum_items_static` accessor to get only statically-defined
enum items.
Note: only i18n tools take advantage of this currently, others are still to be updated.
Reviewers: campbellbarton, sergey
Differential Revision: https://developer.blender.org/D1782
Diffstat (limited to 'source/blender/makesrna/RNA_access.h')
-rw-r--r-- | source/blender/makesrna/RNA_access.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h index 050c55b2347..6dee89ebe9b 100644 --- a/source/blender/makesrna/RNA_access.h +++ b/source/blender/makesrna/RNA_access.h @@ -818,6 +818,9 @@ bool RNA_enum_description(EnumPropertyItem *item, const int value, const char ** int RNA_enum_from_value(EnumPropertyItem *item, const int value); int RNA_enum_from_identifier(EnumPropertyItem *item, const char *identifier); +void RNA_property_enum_items_ex( + struct bContext *C, PointerRNA *ptr, PropertyRNA *prop, const bool use_static, + EnumPropertyItem **item, int *r_totitem, bool *r_free); void RNA_property_enum_items(struct bContext *C, PointerRNA *ptr, PropertyRNA *prop, EnumPropertyItem **item, int *r_totitem, bool *r_free); void RNA_property_enum_items_gettexted(struct bContext *C, PointerRNA *ptr, PropertyRNA *prop, |