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>2008-12-18 05:56:48 +0300
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2008-12-18 05:56:48 +0300
commitecc4e55b6666bdb20ed8e2e8e9a7fc2fbeff3731 (patch)
tree35b5a56c8b43fdf6d61a01302b2e458f6245bfe8 /source/blender/editors/space_info
parent241dbe6e85a916cc55b5e749596aaf0ef3dffd90 (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/editors/space_info')
-rw-r--r--source/blender/editors/space_info/info_header.c16
-rw-r--r--source/blender/editors/space_info/space_info.c4
2 files changed, 10 insertions, 10 deletions
diff --git a/source/blender/editors/space_info/info_header.c b/source/blender/editors/space_info/info_header.c
index efaae1afb2e..9d6c7be9898 100644
--- a/source/blender/editors/space_info/info_header.c
+++ b/source/blender/editors/space_info/info_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;
@@ -100,7 +100,7 @@ static void do_info_buttons(bContext *C, void *arg, int event)
void info_header_buttons(const bContext *C, ARegion *ar)
{
- ScrArea *sa= C->area;
+ ScrArea *sa= CTX_wm_area(C);
uiBlock *block;
int xco, yco= 3;
@@ -116,23 +116,23 @@ void info_header_buttons(const bContext *C, ARegion *ar)
uiBlockSetEmboss(block, UI_EMBOSSP);
xmax= GetButStringLength("File");
- uiDefPulldownBut(block, dummy_viewmenu, C->area, "File", xco, yco, xmax-3, 22, "");
+ uiDefPulldownBut(block, dummy_viewmenu, sa, "File", xco, yco, xmax-3, 22, "");
xco+= xmax;
xmax= GetButStringLength("Add");
- uiDefPulldownBut(block, dummy_viewmenu, C->area, "Add", xco, yco, xmax-3, 22, "");
+ uiDefPulldownBut(block, dummy_viewmenu, sa, "Add", xco, yco, xmax-3, 22, "");
xco+= xmax;
xmax= GetButStringLength("Timeline");
- uiDefPulldownBut(block, dummy_viewmenu, C->area, "Timeline", xco, yco, xmax-3, 22, "");
+ uiDefPulldownBut(block, dummy_viewmenu, sa, "Timeline", xco, yco, xmax-3, 22, "");
xco+= xmax;
xmax= GetButStringLength("Game");
- uiDefPulldownBut(block, dummy_viewmenu, C->area, "Game", xco, yco, xmax-3, 22, "");
+ uiDefPulldownBut(block, dummy_viewmenu, sa, "Game", xco, yco, xmax-3, 22, "");
xco+= xmax;
xmax= GetButStringLength("Render");
- uiDefPulldownBut(block, dummy_viewmenu, C->area, "Render", xco, yco, xmax-3, 22, "");
+ uiDefPulldownBut(block, dummy_viewmenu, sa, "Render", xco, yco, xmax-3, 22, "");
xco+= xmax;
xmax= GetButStringLength("Help");
diff --git a/source/blender/editors/space_info/space_info.c b/source/blender/editors/space_info/space_info.c
index 7ef08495ae1..ae6b4333150 100644
--- a/source/blender/editors/space_info/space_info.c
+++ b/source/blender/editors/space_info/space_info.c
@@ -40,8 +40,8 @@
#include "BLI_arithb.h"
#include "BLI_rand.h"
+#include "BKE_context.h"
#include "BKE_colortools.h"
-#include "BKE_global.h"
#include "BKE_screen.h"
#include "ED_space_api.h"
@@ -129,7 +129,7 @@ static void info_main_area_init(wmWindowManager *wm, ARegion *ar)
static void info_main_area_draw(const bContext *C, ARegion *ar)
{
/* draw entirely, view changes should be handled here */
- // SpaceInfo *sinfo= C->area->spacedata.first;
+ // SpaceInfo *sinfo= (SpaceInfo*)CTX_wm_space_data(C);
View2D *v2d= &ar->v2d;
float col[3];