diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-04-19 17:37:59 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-04-19 17:37:59 +0400 |
commit | adff6aeb1c749183921c0facd373972bbeb874b4 (patch) | |
tree | 07987d408713eee8a3dd8bb5cb4ecf3c112de654 /source/blender/makesrna/intern/rna_internal_types.h | |
parent | d880257d165888638b7c924fb6ef7071343b783e (diff) |
RNA: Generic Type Registration
The Python API to define Panels and Operators is based on subclassing,
this makes that system more generic, and based on RNA. Hopefully that
will make it easy to make various parts of Blender more extensible.
* The system simply uses RNA properties and functions and marks them
with REGISTER to make them part of the type registration process.
Additionally, the struct must provide a register/unregister callback
to create/free the PanelType or similar.
* From the python side there were some small changes, mainly that
registration now goes trough bpy.types.register instead of
bpy.ui.addPanel.
* Only Panels have been wrapped this way now. Check rna_ui.c to see
how this code works. There's still some rough edges and possibilities
to make it cleaner, though it works without any manual python code.
* Started some docs here:
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/RNATypeRegistration
* Also changed some RNA_property and RNA_struct functions to not
require a PointerRNA anymore, where they were not required (which
is actually the cause of most changed files).
Diffstat (limited to 'source/blender/makesrna/intern/rna_internal_types.h')
-rw-r--r-- | source/blender/makesrna/intern/rna_internal_types.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_internal_types.h b/source/blender/makesrna/intern/rna_internal_types.h index 5e44b7f7452..50a4db8e158 100644 --- a/source/blender/makesrna/intern/rna_internal_types.h +++ b/source/blender/makesrna/intern/rna_internal_types.h @@ -32,6 +32,8 @@ struct ContainerRNA; struct StructRNA; struct PropertyRNA; struct PointerRNA; +struct FunctionRNA; +struct ReportList; struct CollectionPropertyIterator; struct bContext; @@ -248,6 +250,7 @@ struct StructRNA { /* python type, this is a subtype of pyrna_struct_Type but used so each struct can have its own type * which is useful for subclassing RNA */ void *py_type; + void *blender_type; /* unique identifier */ const char *identifier; @@ -280,6 +283,10 @@ struct StructRNA { /* function to find path to this struct in an ID */ StructPathFunc path; + /* function to register/unregister subclasses */ + StructRegisterFunc reg; + StructUnregisterFunc unreg; + /* functions of this struct */ ListBase functions; }; |