diff options
author | Campbell Barton <ideasman42@gmail.com> | 2016-05-08 19:32:54 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2016-05-08 19:37:34 +0300 |
commit | 2d8db0de79157975f710eece613da275d7b4036e (patch) | |
tree | a3cf3042fc82c964f78cb25339b86a03be4c0e64 /source/blender | |
parent | cbaa25eb88a25852791d4f8b18fb9e9137fea401 (diff) |
Docs: explain some details of RNA enums
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/makesrna/RNA_types.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/source/blender/makesrna/RNA_types.h b/source/blender/makesrna/RNA_types.h index 04a2361b903..d8bea93bcbc 100644 --- a/source/blender/makesrna/RNA_types.h +++ b/source/blender/makesrna/RNA_types.h @@ -301,11 +301,25 @@ typedef struct RawArray { int stride; } RawArray; +/** + * This struct is are typically defined in arrays which define an *enum* for RNA, + * which is used by the RNA API both for user-interface and the Python API. + */ typedef struct EnumPropertyItem { + /** The internal value of the enum, not exposed to users. */ int value; + /** + * Note that identifiers must be unique within the array, + * by convention they're upper case with underscores for separators. + * - An empty string is used to define menu separators. + * - NULL denotes the end of the array of items. + */ const char *identifier; + /** Optional icon, typically 'ICON_NONE' */ int icon; + /** Name displayed in the interface. */ const char *name; + /** Longer description used in the interface. */ const char *description; } EnumPropertyItem; |