Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2009-04-19 17:37:59 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2009-04-19 17:37:59 +0400
commitadff6aeb1c749183921c0facd373972bbeb874b4 (patch)
tree07987d408713eee8a3dd8bb5cb4ecf3c112de654 /source/blender/blenkernel/intern/screen.c
parentd880257d165888638b7c924fb6ef7071343b783e (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/blenkernel/intern/screen.c')
-rw-r--r--source/blender/blenkernel/intern/screen.c21
1 files changed, 6 insertions, 15 deletions
diff --git a/source/blender/blenkernel/intern/screen.c b/source/blender/blenkernel/intern/screen.c
index 2f3ca52a09e..f43dc287062 100644
--- a/source/blender/blenkernel/intern/screen.c
+++ b/source/blender/blenkernel/intern/screen.c
@@ -53,25 +53,16 @@ static ListBase spacetypes= {NULL, NULL};
static void spacetype_free(SpaceType *st)
{
ARegionType *art;
+ PanelType *pt;
for(art= st->regiontypes.first; art; art= art->next) {
BLI_freelistN(&art->drawcalls);
-#ifdef DISABLE_PYTHON
+
+ for(pt= art->paneltypes.first; pt; pt= pt->next)
+ if(pt->py_free)
+ pt->py_free(pt->py_data);
+
BLI_freelistN(&art->paneltypes);
-#else
- {
- PanelType *pnl, *pnl_next;
- for(pnl= art->paneltypes.first; pnl; pnl= pnl_next) {
- pnl_next= pnl->next;
-
- if(pnl->py_data)
- BPY_DECREF(pnl->py_data);
-
- MEM_freeN(pnl);
- }
- art->paneltypes.first= art->paneltypes.last= NULL;
- }
-#endif
BLI_freelistN(&art->headertypes);
}