diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-07-28 20:33:02 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-07-28 20:33:02 +0400 |
commit | 74e4ad20c9e8d19f85aaa2995652e3f65bdfc0c9 (patch) | |
tree | 7f20ead7facacb69f02ab9384bcd855598878133 /source/blender/blenkernel/intern | |
parent | f4f3a9b08b04077e6e9272e4fdd4cd550b47be02 (diff) |
2.5: code cleanup, added CTX_wm_space_* for each space type,
instead of casting everywhere.
Diffstat (limited to 'source/blender/blenkernel/intern')
-rw-r--r-- | source/blender/blenkernel/intern/context.c | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/context.c b/source/blender/blenkernel/intern/context.c index 08182dc873b..78c29a96bff 100644 --- a/source/blender/blenkernel/intern/context.c +++ b/source/blender/blenkernel/intern/context.c @@ -256,6 +256,83 @@ struct SpaceImage *CTX_wm_space_image(const bContext *C) return NULL; } +struct SpaceButs *CTX_wm_space_buts(const bContext *C) +{ + if(C->wm.area && C->wm.area->spacetype==SPACE_BUTS) + return C->wm.area->spacedata.first; + return NULL; +} + +struct SpaceFile *CTX_wm_space_file(const bContext *C) +{ + if(C->wm.area && C->wm.area->spacetype==SPACE_FILE) + return C->wm.area->spacedata.first; + return NULL; +} + +struct SpaceSeq *CTX_wm_space_seq(const bContext *C) +{ + if(C->wm.area && C->wm.area->spacetype==SPACE_SEQ) + return C->wm.area->spacedata.first; + return NULL; +} + +struct SpaceOops *CTX_wm_space_outliner(const bContext *C) +{ + if(C->wm.area && C->wm.area->spacetype==SPACE_OUTLINER) + return C->wm.area->spacedata.first; + return NULL; +} + +struct SpaceNla *CTX_wm_space_nla(const bContext *C) +{ + if(C->wm.area && C->wm.area->spacetype==SPACE_NLA) + return C->wm.area->spacedata.first; + return NULL; +} + +struct SpaceTime *CTX_wm_space_time(const bContext *C) +{ + if(C->wm.area && C->wm.area->spacetype==SPACE_TIME) + return C->wm.area->spacedata.first; + return NULL; +} + +struct SpaceNode *CTX_wm_space_node(const bContext *C) +{ + if(C->wm.area && C->wm.area->spacetype==SPACE_NODE) + return C->wm.area->spacedata.first; + return NULL; +} + +struct SpaceLogic *CTX_wm_space_logic(const bContext *C) +{ + if(C->wm.area && C->wm.area->spacetype==SPACE_LOGIC) + return C->wm.area->spacedata.first; + return NULL; +} + +struct SpaceIpo *CTX_wm_space_graph(const bContext *C) +{ + if(C->wm.area && C->wm.area->spacetype==SPACE_IPO) + return C->wm.area->spacedata.first; + return NULL; +} + +struct SpaceAction *CTX_wm_space_action(const bContext *C) +{ + if(C->wm.area && C->wm.area->spacetype==SPACE_ACTION) + return C->wm.area->spacedata.first; + return NULL; +} + +struct SpaceInfo *CTX_wm_space_info(const bContext *C) +{ + if(C->wm.area && C->wm.area->spacetype==SPACE_INFO) + return C->wm.area->spacedata.first; + return NULL; +} + void CTX_wm_manager_set(bContext *C, wmWindowManager *wm) { C->wm.manager= wm; |