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_rna.c | |
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_rna.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_rna.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/source/blender/makesrna/intern/rna_rna.c b/source/blender/makesrna/intern/rna_rna.c index 727bdac087b..abded187b33 100644 --- a/source/blender/makesrna/intern/rna_rna.c +++ b/source/blender/makesrna/intern/rna_rna.c @@ -178,7 +178,7 @@ static int rna_idproperty_known(CollectionPropertyIterator *iter, void *data) * for the second loop where we go over unknown id properties */ do { for (prop = ptype->cont.properties.first; prop; prop = prop->next) - if ((prop->flag & PROP_BUILTIN) == 0 && STREQ(prop->identifier, idprop->name)) + if ((prop->flag_internal & PROP_INTERN_BUILTIN) == 0 && STREQ(prop->identifier, idprop->name)) return 1; } while ((ptype = ptype->base)); @@ -191,7 +191,7 @@ static int rna_property_builtin(CollectionPropertyIterator *UNUSED(iter), void * /* function to skip builtin rna properties */ - return (prop->flag & PROP_BUILTIN); + return (prop->flag_internal & PROP_INTERN_BUILTIN); } static int rna_function_builtin(CollectionPropertyIterator *UNUSED(iter), void *data) @@ -385,7 +385,7 @@ int rna_builtin_properties_lookup_string(PointerRNA *ptr, const char *key, Point } else { for (prop = srna->cont.properties.first; prop; prop = prop->next) { - if (!(prop->flag & PROP_BUILTIN) && STREQ(prop->identifier, key)) { + if (!(prop->flag_internal & PROP_INTERN_BUILTIN) && STREQ(prop->identifier, key)) { propptr.type = &RNA_Property; propptr.data = prop; @@ -557,19 +557,19 @@ static int rna_Property_animatable_get(PointerRNA *ptr) static int rna_Property_use_output_get(PointerRNA *ptr) { PropertyRNA *prop = (PropertyRNA *)ptr->data; - return (prop->flag & PROP_OUTPUT) != 0; + return (prop->flag_parameter & PARM_OUTPUT) != 0; } static int rna_Property_is_required_get(PointerRNA *ptr) { PropertyRNA *prop = (PropertyRNA *)ptr->data; - return (prop->flag & PROP_REQUIRED) != 0; + return (prop->flag_parameter & PARM_REQUIRED) != 0; } static int rna_Property_is_argument_optional_get(PointerRNA *ptr) { PropertyRNA *prop = (PropertyRNA *)ptr->data; - return (prop->flag & PROP_PYFUNC_OPTIONAL) != 0; + return (prop->flag_parameter & PARM_PYFUNC_OPTIONAL) != 0; } static int rna_Property_is_never_none_get(PointerRNA *ptr) @@ -625,7 +625,7 @@ static int rna_Property_is_registered_optional_get(PointerRNA *ptr) static int rna_Property_is_runtime_get(PointerRNA *ptr) { PropertyRNA *prop = (PropertyRNA *)ptr->data; - return (prop->flag & PROP_RUNTIME) != 0; + return (prop->flag_internal & PROP_INTERN_RUNTIME) != 0; } |