diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2016-12-12 17:23:55 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2016-12-12 17:46:06 +0300 |
commit | 440d1042798113a0e8115ea1f1d016a44712e7a0 (patch) | |
tree | 147ca3dfc851aa635538a988005afa5ed89ac65a /source/blender/makesrna/intern/rna_internal_types.h | |
parent | 62703850ad560b5832c4e42143f563d11ba21cf4 (diff) |
Refactor RNA property: split flags in property flags, parameter flags, and internal flags.
This gives us 9 flags available again for properties (we had none anymore),
and also makes things slightly cleaner.
To simplify (and make more clear the differences between mere properties
and function parameters), also added RNA_def_parameter_flags function (and
its clear counterpart), to be used instead of RNA_def_property_flag for
function parameters.
This patch is also a big cleanup (some RNA function definitions were
still using 'prop' PropertyRNA pointer, etc.).
And yes, am aware this will be annoying for all branches, but we really need
to get new flags available for properties (will need at least one for override, etc.).
Reviewers: sergey, Severin
Subscribers: dfelinto, brecht
Differential Revision: https://developer.blender.org/D2400
Diffstat (limited to 'source/blender/makesrna/intern/rna_internal_types.h')
-rw-r--r-- | source/blender/makesrna/intern/rna_internal_types.h | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/source/blender/makesrna/intern/rna_internal_types.h b/source/blender/makesrna/intern/rna_internal_types.h index 04b85b8997e..fce81e6967e 100644 --- a/source/blender/makesrna/intern/rna_internal_types.h +++ b/source/blender/makesrna/intern/rna_internal_types.h @@ -162,6 +162,10 @@ struct PropertyRNA { const char *identifier; /* various options */ int flag; + /* Function parameters flags. */ + short flag_parameter; + /* Internal ("private") flags. */ + short flag_internal; /* user readable name */ const char *name; @@ -183,7 +187,7 @@ struct PropertyRNA { /* array lengths lengths for all dimensions (when arraydimension > 0) */ unsigned int arraylength[RNA_MAX_ARRAY_DIMENSION]; unsigned int totarraylength; - + /* callback for updates on change */ UpdateFunc update; int noteflag; @@ -209,6 +213,15 @@ struct PropertyRNA { void *py_data; }; +/* internal flags WARNING! 16bits only! */ +typedef enum PropertyFlagIntern { + PROP_INTERN_BUILTIN = (1 << 0), + PROP_INTERN_RUNTIME = (1 << 1), + PROP_INTERN_RAW_ACCESS = (1 << 2), + PROP_INTERN_RAW_ARRAY = (1 << 3), + PROP_INTERN_FREE_POINTERS = (1 << 4), +} PropertyFlagIntern; + /* Property Types */ typedef struct BoolPropertyRNA { @@ -347,7 +360,7 @@ struct StructRNA { * which is useful for subclassing RNA */ void *py_type; void *blender_type; - + /* various options */ int flag; @@ -359,7 +372,7 @@ struct StructRNA { const char *translation_context; /* icon ID */ int icon; - + /* property that defines the name */ PropertyRNA *nameproperty; |