diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2008-12-18 05:56:48 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2008-12-18 05:56:48 +0300 |
commit | ecc4e55b6666bdb20ed8e2e8e9a7fc2fbeff3731 (patch) | |
tree | 35b5a56c8b43fdf6d61a01302b2e458f6245bfe8 /source/blender/windowmanager/intern/wm_keymap.c | |
parent | 241dbe6e85a916cc55b5e749596aaf0ef3dffd90 (diff) |
2.5
Context API
This adds the context API as described here. The main practical change
now is that C is not longer directly accessible but has to be accessed
through accessor functions. This basically adds the implementation of
the API and adaption of existing code with some minor changes. The next
task of course is to actually use this design to cleanup of bad level
calls and global access, in blenkernel, blenloader.
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/Context
Error, Warning and Debug Info Reporting
This adds the error reporting API as described here. It should help
clean up error() calls in non-ui code, but eventually can become used
for gathering messages for a console window, and throwing exceptions
in python scripts when an error happens executing something.
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/Reports
Diffstat (limited to 'source/blender/windowmanager/intern/wm_keymap.c')
-rw-r--r-- | source/blender/windowmanager/intern/wm_keymap.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/source/blender/windowmanager/intern/wm_keymap.c b/source/blender/windowmanager/intern/wm_keymap.c index 139fff45b48..a7ce67aeeba 100644 --- a/source/blender/windowmanager/intern/wm_keymap.c +++ b/source/blender/windowmanager/intern/wm_keymap.c @@ -36,7 +36,7 @@ #include "BLI_blenlib.h" #include "BKE_blender.h" -#include "BKE_global.h" +#include "BKE_context.h" #include "BKE_library.h" #include "BKE_main.h" @@ -515,8 +515,8 @@ char *WM_key_event_operator_string(bContext *C, char *opname, int opcontext, cha /* find right handler list based on specified context */ if(opcontext == WM_OP_REGION_WIN) { - if(C->area) { - ARegion *ar= C->area->regionbase.first; + if(CTX_wm_area(C)) { + ARegion *ar= CTX_wm_area(C)->regionbase.first; for(; ar; ar= ar->next) if(ar->regiontype==RGN_TYPE_WINDOW) break; @@ -526,16 +526,16 @@ char *WM_key_event_operator_string(bContext *C, char *opname, int opcontext, cha } } else if(opcontext == WM_OP_AREA) { - if(C->area) - handlers= &C->area->handlers; + if(CTX_wm_area(C)) + handlers= &CTX_wm_area(C)->handlers; } else if(opcontext == WM_OP_SCREEN) { - if(C->window) - handlers= &C->window->handlers; + if(CTX_wm_window(C)) + handlers= &CTX_wm_window(C)->handlers; } else { - if(C->region) - handlers= &C->region->handlers; + if(CTX_wm_region(C)) + handlers= &CTX_wm_region(C)->handlers; } if(!handlers) |