From a019f1d3d6a6f8bd17d4683e9a948a84a0ba9925 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Wed, 11 Jun 2008 10:10:31 +0000 Subject: 2.5 Branch ========== * Changed wmOperatorType, removing init/exit callbacks and adding cancel callback, removed default storage in favor of properties. Defined return values for exec/invoke/modal/cancel. * Don't allocate operator on the stack, and removed operator copy for handlers. Now it frees based on return values from callbacks, and just keeps a wmOperator on the heap. Also it now registers after the operator is fully finished, to get the correct final properties. * Changed OP_get_* functions to return 1 if the property is found and 0 otherwise, gives more readable code in my opinion. Added OP_verify_* functions to quickly check if the property is available and set if it's not, that's common for exec/invoke. * Removed WM_operatortypelist_append in favor of WM_operatortype_append which takes a function pointer instead of a list, avoids macro's and duplicating code. * Fix a crash where the handler would still be used while it was freed by the operator. * Spacetypes now have operatortypes() and keymap() callbacks to abstract them a bit more. * Renamed C->curarea to C->area for consistency. Removed View3D/View2D/ SpaceIpo from bContext, seems bad to keep these. * Set context variables like window/screen/area/region to NULL again when leaving that context, instead of leaving the pointers there. * Added if(G.f & G_DEBUG) for many of the prints, makes output a bit cleaner and easier to debug. * Fixed priority of the editors/interface module in scons, would otherwise give link errors. * Added start of generic view2d api. * Added space_time with some basic drawing and a single operator to change the frame. --- source/blender/blenkernel/BKE_screen.h | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) (limited to 'source/blender/blenkernel/BKE_screen.h') diff --git a/source/blender/blenkernel/BKE_screen.h b/source/blender/blenkernel/BKE_screen.h index 4c968eb0450..14090719de6 100644 --- a/source/blender/blenkernel/BKE_screen.h +++ b/source/blender/blenkernel/BKE_screen.h @@ -8,11 +8,7 @@ * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 -<<<<<<< .mine - * of the License, or (at your option) any later version. -======= * of the License, or (at your option) any later version. ->>>>>>> .r13159 * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -40,6 +36,8 @@ struct ScrArea; struct bScreen; struct ARegion; struct wmNotifier; +struct wmWindowManager; +struct ListBase; /* spacetype has everything stored to get an editor working, it gets initialized via spacetypes_init() in editors/area/spacetypes.c */ @@ -52,14 +50,25 @@ typedef struct SpaceType { int spaceid; /* unique space identifier */ int iconid; /* icon lookup for menus */ - struct SpaceLink *(*new)(void); /* calls init too */ - void (*free)(struct SpaceLink *sl); /* not free sl itself */ + /* calls init too */ + struct SpaceLink *(*new)(void); + /* not free spacelink itself */ + void (*free)(struct SpaceLink *); - void (*init)(struct ScrArea *); /* init is to cope with internal contextual changes, adds handlers, sets screarea regions */ - void (*refresh)(struct bContext *, struct ScrArea *); /* refresh is for external bContext changes */ - - struct SpaceLink *(*duplicate)(struct SpaceLink *sl); /* after a spacedata copy, an init should result in exact same situation */ + /* init is to cope with internal contextual changes, adds handlers, + * sets screarea regions */ + void (*init)(struct wmWindowManager *, struct ScrArea *); + /* refresh is for external bContext changes */ + void (*refresh)(struct bContext *, struct ScrArea *); + /* after a spacedata copy, an init should result in exact same situation */ + struct SpaceLink *(*duplicate)(struct SpaceLink *); + + /* register operator types on startup */ + void (*operatortypes)(void); + /* add default items to keymap */ + void (*keymap)(struct wmWindowManager *); + /* read and write... */ } SpaceType; @@ -80,6 +89,7 @@ void BKE_screen_area_free(struct ScrArea *sa); void free_screen(struct bScreen *sc); struct SpaceType *BKE_spacetype_from_id(int spaceid); +const struct ListBase *BKE_spacetypes_list(void); void BKE_spacetype_register(struct SpaceType *st); void BKE_spacedata_freelist(ListBase *lb); void BKE_spacedata_copylist(ListBase *lb1, ListBase *lb2); -- cgit v1.2.3