[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [18008] branches/blender2.5/blender/source /blender: 2.5
Ton Roosendaal
ton at blender.org
Mon Dec 22 11:09:56 CET 2008
Revision: 18008
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=18008
Author: ton
Date: 2008-12-22 11:09:56 +0100 (Mon, 22 Dec 2008)
Log Message:
-----------
2.5
Small area/space api fix: space->new() callbacks now require
Context pointer. Too many cases you want to initialize stuff...
Also: added dummy draw function for NLA channel region, was
too ugly.
Modified Paths:
--------------
branches/blender2.5/blender/source/blender/blenkernel/BKE_screen.h
branches/blender2.5/blender/source/blender/editors/screen/area.c
branches/blender2.5/blender/source/blender/editors/space_action/space_action.c
branches/blender2.5/blender/source/blender/editors/space_api/spacetypes.c
branches/blender2.5/blender/source/blender/editors/space_buttons/space_buttons.c
branches/blender2.5/blender/source/blender/editors/space_file/space_file.c
branches/blender2.5/blender/source/blender/editors/space_image/space_image.c
branches/blender2.5/blender/source/blender/editors/space_info/space_info.c
branches/blender2.5/blender/source/blender/editors/space_ipo/space_ipo.c
branches/blender2.5/blender/source/blender/editors/space_nla/space_nla.c
branches/blender2.5/blender/source/blender/editors/space_node/space_node.c
branches/blender2.5/blender/source/blender/editors/space_outliner/space_outliner.c
branches/blender2.5/blender/source/blender/editors/space_script/space_script.c
branches/blender2.5/blender/source/blender/editors/space_sequencer/space_sequencer.c
branches/blender2.5/blender/source/blender/editors/space_sound/space_sound.c
branches/blender2.5/blender/source/blender/editors/space_text/space_text.c
branches/blender2.5/blender/source/blender/editors/space_time/space_time.c
branches/blender2.5/blender/source/blender/editors/space_view3d/space_view3d.c
Modified: branches/blender2.5/blender/source/blender/blenkernel/BKE_screen.h
===================================================================
--- branches/blender2.5/blender/source/blender/blenkernel/BKE_screen.h 2008-12-22 10:07:13 UTC (rev 18007)
+++ branches/blender2.5/blender/source/blender/blenkernel/BKE_screen.h 2008-12-22 10:09:56 UTC (rev 18008)
@@ -57,7 +57,7 @@
int iconid; /* icon lookup for menus */
/* initial allocation, after this WM will call init() too */
- struct SpaceLink *(*new)(void);
+ struct SpaceLink *(*new)(const struct bContext *C);
/* not free spacelink itself */
void (*free)(struct SpaceLink *);
Modified: branches/blender2.5/blender/source/blender/editors/screen/area.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/screen/area.c 2008-12-22 10:07:13 UTC (rev 18007)
+++ branches/blender2.5/blender/source/blender/editors/screen/area.c 2008-12-22 10:09:56 UTC (rev 18008)
@@ -620,7 +620,7 @@
else {
/* new space */
if(st) {
- sl= st->new();
+ sl= st->new(C);
BLI_addhead(&sa->spacedata, sl);
/* swap regions */
Modified: branches/blender2.5/blender/source/blender/editors/space_action/space_action.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/space_action/space_action.c 2008-12-22 10:07:13 UTC (rev 18007)
+++ branches/blender2.5/blender/source/blender/editors/space_action/space_action.c 2008-12-22 10:09:56 UTC (rev 18008)
@@ -66,7 +66,7 @@
/* ******************** default callbacks for action space ***************** */
-static SpaceLink *action_new(void)
+static SpaceLink *action_new(const bContext *C)
{
ARegion *ar;
SpaceAction *saction;
@@ -105,7 +105,7 @@
ar->v2d.tot.ymax= 0.0f;
ar->v2d.cur.xmin= -2.0f;
- ar->v2d.cur.ymin= -2000.0f; /* ideally this would be the size of the region, but since we don't know that, set for 1:1 */
+ ar->v2d.cur.ymin= -2000.0f; /* ideally this would be the size of the region */
ar->v2d.cur.xmax= 100.0f;
ar->v2d.cur.ymax= 0.0f;
Modified: branches/blender2.5/blender/source/blender/editors/space_api/spacetypes.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/space_api/spacetypes.c 2008-12-22 10:07:13 UTC (rev 18007)
+++ branches/blender2.5/blender/source/blender/editors/space_api/spacetypes.c 2008-12-22 10:09:56 UTC (rev 18008)
@@ -116,7 +116,7 @@
/* ****************************** space template *********************** */
/* allocate and init some vars */
-static SpaceLink *xxx_new(void)
+static SpaceLink *xxx_new(const bContext *C)
{
return NULL;
}
Modified: branches/blender2.5/blender/source/blender/editors/space_buttons/space_buttons.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/space_buttons/space_buttons.c 2008-12-22 10:07:13 UTC (rev 18007)
+++ branches/blender2.5/blender/source/blender/editors/space_buttons/space_buttons.c 2008-12-22 10:09:56 UTC (rev 18008)
@@ -62,7 +62,7 @@
/* ******************** default callbacks for buttons space ***************** */
-static SpaceLink *buttons_new(void)
+static SpaceLink *buttons_new(const bContext *C)
{
ARegion *ar;
SpaceButs *sbuts;
Modified: branches/blender2.5/blender/source/blender/editors/space_file/space_file.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/space_file/space_file.c 2008-12-22 10:07:13 UTC (rev 18007)
+++ branches/blender2.5/blender/source/blender/editors/space_file/space_file.c 2008-12-22 10:09:56 UTC (rev 18008)
@@ -64,7 +64,7 @@
/* ******************** default callbacks for file space ***************** */
-static SpaceLink *file_new(void)
+static SpaceLink *file_new(const bContext *C)
{
ARegion *ar;
SpaceFile *sfile;
Modified: branches/blender2.5/blender/source/blender/editors/space_image/space_image.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/space_image/space_image.c 2008-12-22 10:07:13 UTC (rev 18007)
+++ branches/blender2.5/blender/source/blender/editors/space_image/space_image.c 2008-12-22 10:09:56 UTC (rev 18008)
@@ -63,7 +63,7 @@
/* ******************** default callbacks for image space ***************** */
-static SpaceLink *image_new(void)
+static SpaceLink *image_new(const bContext *C)
{
ARegion *ar;
SpaceImage *simage;
Modified: branches/blender2.5/blender/source/blender/editors/space_info/space_info.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/space_info/space_info.c 2008-12-22 10:07:13 UTC (rev 18007)
+++ branches/blender2.5/blender/source/blender/editors/space_info/space_info.c 2008-12-22 10:09:56 UTC (rev 18008)
@@ -62,7 +62,7 @@
/* ******************** default callbacks for info space ***************** */
-static SpaceLink *info_new(void)
+static SpaceLink *info_new(const bContext *C)
{
ARegion *ar;
SpaceInfo *sinfo;
Modified: branches/blender2.5/blender/source/blender/editors/space_ipo/space_ipo.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/space_ipo/space_ipo.c 2008-12-22 10:07:13 UTC (rev 18007)
+++ branches/blender2.5/blender/source/blender/editors/space_ipo/space_ipo.c 2008-12-22 10:09:56 UTC (rev 18008)
@@ -62,8 +62,9 @@
/* ******************** default callbacks for ipo space ***************** */
-static SpaceLink *ipo_new(void)
+static SpaceLink *ipo_new(const bContext *C)
{
+ Scene *scene= CTX_data_scene(C);
ARegion *ar;
SpaceIpo *sipo;
@@ -97,7 +98,7 @@
ar->v2d.tot.xmin= 0.0f;
ar->v2d.tot.ymin= -10.0f;
- ar->v2d.tot.xmax= 250.0;
+ ar->v2d.tot.xmax= scene->r.efra;
ar->v2d.tot.ymax= 10.0f;
ar->v2d.cur= ar->v2d.tot;
Modified: branches/blender2.5/blender/source/blender/editors/space_nla/space_nla.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/space_nla/space_nla.c 2008-12-22 10:07:13 UTC (rev 18007)
+++ branches/blender2.5/blender/source/blender/editors/space_nla/space_nla.c 2008-12-22 10:09:56 UTC (rev 18008)
@@ -63,7 +63,7 @@
/* ******************** default callbacks for nla space ***************** */
-static SpaceLink *nla_new(void)
+static SpaceLink *nla_new(const bContext *C)
{
ARegion *ar;
SpaceNla *snla;
@@ -142,6 +142,28 @@
return (SpaceLink *)snlan;
}
+static void nla_channel_area_draw(const bContext *C, ARegion *ar)
+{
+ /* draw entirely, view changes should be handled here */
+ // SpaceNla *snla= (SpaceNla*)CTX_wm_space_data(C);
+ // View2D *v2d= &ar->v2d;
+ float col[3];
+
+ /* clear and setup matrix */
+ UI_GetThemeColor3fv(TH_BACK, col);
+ glClearColor(col[0], col[1], col[2], 0.0);
+ glClear(GL_COLOR_BUFFER_BIT);
+
+ // UI_view2d_view_ortho(C, v2d);
+
+ /* data... */
+
+
+ /* reset view matrix */
+ //UI_view2d_view_restore(C);
+
+ /* scrollers? */
+}
/* add handlers, stuff you only do once or on area/region changes */
@@ -265,7 +287,7 @@
art->keymapflag= ED_KEYMAP_UI|ED_KEYMAP_VIEW2D;
//art->init= nla_channel_area_init;
- //art->draw= nla_channel_area_draw;
+ art->draw= nla_channel_area_draw;
BLI_addhead(&st->regiontypes, art);
Modified: branches/blender2.5/blender/source/blender/editors/space_node/space_node.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/space_node/space_node.c 2008-12-22 10:07:13 UTC (rev 18007)
+++ branches/blender2.5/blender/source/blender/editors/space_node/space_node.c 2008-12-22 10:09:56 UTC (rev 18008)
@@ -61,7 +61,7 @@
/* ******************** default callbacks for node space ***************** */
-static SpaceLink *node_new(void)
+static SpaceLink *node_new(const bContext *C)
{
ARegion *ar;
SpaceNode *snode;
Modified: branches/blender2.5/blender/source/blender/editors/space_outliner/space_outliner.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/space_outliner/space_outliner.c 2008-12-22 10:07:13 UTC (rev 18007)
+++ branches/blender2.5/blender/source/blender/editors/space_outliner/space_outliner.c 2008-12-22 10:09:56 UTC (rev 18008)
@@ -532,7 +532,7 @@
/* ******************** default callbacks for outliner space ***************** */
-static SpaceLink *outliner_new(void)
+static SpaceLink *outliner_new(const bContext *C)
{
ARegion *ar;
SpaceOops *soutliner;
Modified: branches/blender2.5/blender/source/blender/editors/space_script/space_script.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/space_script/space_script.c 2008-12-22 10:07:13 UTC (rev 18007)
+++ branches/blender2.5/blender/source/blender/editors/space_script/space_script.c 2008-12-22 10:09:56 UTC (rev 18008)
@@ -62,7 +62,7 @@
/* ******************** default callbacks for script space ***************** */
-static SpaceLink *script_new(void)
+static SpaceLink *script_new(const bContext *C)
{
ARegion *ar;
SpaceScript *sscript;
Modified: branches/blender2.5/blender/source/blender/editors/space_sequencer/space_sequencer.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/space_sequencer/space_sequencer.c 2008-12-22 10:07:13 UTC (rev 18007)
+++ branches/blender2.5/blender/source/blender/editors/space_sequencer/space_sequencer.c 2008-12-22 10:09:56 UTC (rev 18008)
@@ -62,8 +62,9 @@
/* ******************** default callbacks for sequencer space ***************** */
-static SpaceLink *sequencer_new(void)
+static SpaceLink *sequencer_new(const bContext *C)
{
+ Scene *scene= CTX_data_scene(C);
ARegion *ar;
SpaceSeq *sseq;
@@ -87,11 +88,11 @@
ar->regiontype= RGN_TYPE_WINDOW;
- /* seq space goes from (0,8) to (250, 0) */
+ /* seq space goes from (0,8) to (0, efra) */
ar->v2d.tot.xmin= 0.0f;
ar->v2d.tot.ymin= 0.0f;
- ar->v2d.tot.xmax= 250.0f;
+ ar->v2d.tot.xmax= scene->r.efra;
ar->v2d.tot.ymax= 8.0f;
ar->v2d.cur= ar->v2d.tot;
Modified: branches/blender2.5/blender/source/blender/editors/space_sound/space_sound.c
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list