From ecc4e55b6666bdb20ed8e2e8e9a7fc2fbeff3731 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Thu, 18 Dec 2008 02:56:48 +0000 Subject: 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 --- source/blender/editors/space_script/script_header.c | 8 ++++---- source/blender/editors/space_script/space_script.c | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'source/blender/editors/space_script') diff --git a/source/blender/editors/space_script/script_header.c b/source/blender/editors/space_script/script_header.c index 8cc3966fdf1..7f18f4bbbeb 100644 --- a/source/blender/editors/space_script/script_header.c +++ b/source/blender/editors/space_script/script_header.c @@ -38,7 +38,7 @@ #include "BLI_blenlib.h" -#include "BKE_global.h" +#include "BKE_context.h" #include "BKE_screen.h" #include "ED_screen.h" @@ -66,7 +66,7 @@ static void do_viewmenu(bContext *C, void *arg, int event) static uiBlock *dummy_viewmenu(bContext *C, uiMenuBlockHandle *handle, void *arg_unused) { - ScrArea *curarea= C->area; + ScrArea *curarea= CTX_wm_area(C); uiBlock *block; short yco= 0, menuwidth=120; @@ -99,7 +99,7 @@ static void do_script_buttons(bContext *C, void *arg, int event) void script_header_buttons(const bContext *C, ARegion *ar) { - ScrArea *sa= C->area; + ScrArea *sa= CTX_wm_area(C); uiBlock *block; int xco, yco= 3; @@ -115,7 +115,7 @@ void script_header_buttons(const bContext *C, ARegion *ar) uiBlockSetEmboss(block, UI_EMBOSSP); xmax= GetButStringLength("View"); - uiDefPulldownBut(block, dummy_viewmenu, C->area, + uiDefPulldownBut(block, dummy_viewmenu, CTX_wm_area(C), "View", xco, yco-2, xmax-3, 24, ""); xco+=XIC+xmax; } diff --git a/source/blender/editors/space_script/space_script.c b/source/blender/editors/space_script/space_script.c index 8b9196ac506..6693d71b507 100644 --- a/source/blender/editors/space_script/space_script.c +++ b/source/blender/editors/space_script/space_script.c @@ -41,7 +41,7 @@ #include "BLI_rand.h" #include "BKE_colortools.h" -#include "BKE_global.h" +#include "BKE_context.h" #include "BKE_screen.h" #include "ED_space_api.h" @@ -139,7 +139,7 @@ static void script_main_area_init(wmWindowManager *wm, ARegion *ar) static void script_main_area_draw(const bContext *C, ARegion *ar) { /* draw entirely, view changes should be handled here */ - // SpaceScript *sscript= C->area->spacedata.first; + // SpaceScript *sscript= (SpaceScript*)CTX_wm_space_data(C); View2D *v2d= &ar->v2d; float col[3]; -- cgit v1.2.3