diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-08-21 16:57:47 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-08-21 16:57:47 +0400 |
commit | 1c614f6cf63fb65622b855123d8db76898d3c9ca (patch) | |
tree | f3e576a33418ab929db9459ddb7028b40ce81923 /source/blender/makesrna/intern/makesrna.c | |
parent | 27797a45ee6cbc987350269e6827197f47daf036 (diff) |
2.5: layout.itemO now returns OperatorProperties to be filled in,
when passing properties=True as argument.
Other changes:
* uiItemR, uiItemFullR, uiItemFullO now accept a flag argument rather
than multiple different "boolean" arguments, but still exposed as
booleans to python.
* Fix RNA to support setting PROP_RNAPTR for return values.
Diffstat (limited to 'source/blender/makesrna/intern/makesrna.c')
-rw-r--r-- | source/blender/makesrna/intern/makesrna.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c index 05eac06de7f..83178f32d5f 100644 --- a/source/blender/makesrna/intern/makesrna.c +++ b/source/blender/makesrna/intern/makesrna.c @@ -1198,7 +1198,13 @@ static void rna_def_function_funcs(FILE *f, StructDefRNA *dsrna, FunctionDefRNA dparm= dfunc->cont.properties.first; for(; dparm; dparm= dparm->next) { - ptrstr= (dparm->prop->type == PROP_POINTER || dparm->prop->arraylength > 0)? "*" : ""; + if(dparm->prop->arraylength > 0) + ptrstr= "*"; + else if(dparm->prop==func->ret) + ptrstr= ((dparm->prop->type == PROP_POINTER) && !(dparm->prop->flag & PROP_RNAPTR))? "*": ""; + else + ptrstr= (dparm->prop->type == PROP_POINTER)? "*": ""; + fprintf(f, "\t%s%s %s%s;\n", rna_type_struct(dparm->prop), rna_parameter_type_name(dparm->prop), ptrstr, dparm->prop->identifier); } @@ -1274,7 +1280,7 @@ static void rna_def_function_funcs(FILE *f, StructDefRNA *dsrna, FunctionDefRNA if(func->ret) { dparm= rna_find_parameter_def(func->ret); - ptrstr= dparm->prop->type == PROP_POINTER || dparm->prop->arraylength > 0 ? "*" : ""; + ptrstr= (((dparm->prop->type == PROP_POINTER) && !(dparm->prop->flag & PROP_RNAPTR)) || (dparm->prop->arraylength > 0))? "*": ""; fprintf(f, "\t*((%s%s%s*)_retdata)= %s;\n", rna_type_struct(dparm->prop), rna_parameter_type_name(dparm->prop), ptrstr, func->ret->identifier); } } @@ -1516,7 +1522,7 @@ static void rna_generate_static_parameter_prototypes(BlenderRNA *brna, StructRNA if(dparm->prop==func->ret) { if(dparm->prop->arraylength) fprintf(f, "XXX no array return types yet"); /* XXX not supported */ - else if(dparm->prop->type == PROP_POINTER) + else if(dparm->prop->type == PROP_POINTER && !(dparm->prop->flag & PROP_RNAPTR)) fprintf(f, "%s%s *", rna_type_struct(dparm->prop), rna_parameter_type_name(dparm->prop)); else fprintf(f, "%s%s ", rna_type_struct(dparm->prop), rna_parameter_type_name(dparm->prop)); |