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
path: root/source
diff options
context:
space:
mode:
authorTon Roosendaal <ton@blender.org>2008-12-22 13:09:56 +0300
committerTon Roosendaal <ton@blender.org>2008-12-22 13:09:56 +0300
commitbac4d10174da530427343e6238be16b8a8ee3ac8 (patch)
tree2b920dbf0ff67f4896619258cb0db032d6b2c851 /source
parentfa12c089b125a8705310122d0022bf82f4d93972 (diff)
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.
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenkernel/BKE_screen.h2
-rw-r--r--source/blender/editors/screen/area.c2
-rw-r--r--source/blender/editors/space_action/space_action.c4
-rw-r--r--source/blender/editors/space_api/spacetypes.c2
-rw-r--r--source/blender/editors/space_buttons/space_buttons.c2
-rw-r--r--source/blender/editors/space_file/space_file.c2
-rw-r--r--source/blender/editors/space_image/space_image.c2
-rw-r--r--source/blender/editors/space_info/space_info.c2
-rw-r--r--source/blender/editors/space_ipo/space_ipo.c5
-rw-r--r--source/blender/editors/space_nla/space_nla.c26
-rw-r--r--source/blender/editors/space_node/space_node.c2
-rw-r--r--source/blender/editors/space_outliner/space_outliner.c2
-rw-r--r--source/blender/editors/space_script/space_script.c2
-rw-r--r--source/blender/editors/space_sequencer/space_sequencer.c7
-rw-r--r--source/blender/editors/space_sound/space_sound.c2
-rw-r--r--source/blender/editors/space_text/space_text.c2
-rw-r--r--source/blender/editors/space_time/space_time.c8
-rw-r--r--source/blender/editors/space_view3d/space_view3d.c9
18 files changed, 54 insertions, 29 deletions
diff --git a/source/blender/blenkernel/BKE_screen.h b/source/blender/blenkernel/BKE_screen.h
index acb9814b64a..35bc40ded4c 100644
--- a/source/blender/blenkernel/BKE_screen.h
+++ b/source/blender/blenkernel/BKE_screen.h
@@ -57,7 +57,7 @@ typedef struct SpaceType {
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 *);
diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c
index f90c247d69d..1c47d9302a1 100644
--- a/source/blender/editors/screen/area.c
+++ b/source/blender/editors/screen/area.c
@@ -620,7 +620,7 @@ void area_newspace(bContext *C, ScrArea *sa, int type)
else {
/* new space */
if(st) {
- sl= st->new();
+ sl= st->new(C);
BLI_addhead(&sa->spacedata, sl);
/* swap regions */
diff --git a/source/blender/editors/space_action/space_action.c b/source/blender/editors/space_action/space_action.c
index a8e7a94cb19..7d6a4804dec 100644
--- a/source/blender/editors/space_action/space_action.c
+++ b/source/blender/editors/space_action/space_action.c
@@ -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 @@ static SpaceLink *action_new(void)
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;
diff --git a/source/blender/editors/space_api/spacetypes.c b/source/blender/editors/space_api/spacetypes.c
index e2f9ead8e59..ebfab2a8318 100644
--- a/source/blender/editors/space_api/spacetypes.c
+++ b/source/blender/editors/space_api/spacetypes.c
@@ -116,7 +116,7 @@ void ED_spacetypes_keymap(wmWindowManager *wm)
/* ****************************** space template *********************** */
/* allocate and init some vars */
-static SpaceLink *xxx_new(void)
+static SpaceLink *xxx_new(const bContext *C)
{
return NULL;
}
diff --git a/source/blender/editors/space_buttons/space_buttons.c b/source/blender/editors/space_buttons/space_buttons.c
index 6819a28406d..088664f5343 100644
--- a/source/blender/editors/space_buttons/space_buttons.c
+++ b/source/blender/editors/space_buttons/space_buttons.c
@@ -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;
diff --git a/source/blender/editors/space_file/space_file.c b/source/blender/editors/space_file/space_file.c
index 5e19a993b73..3d20dbe39a1 100644
--- a/source/blender/editors/space_file/space_file.c
+++ b/source/blender/editors/space_file/space_file.c
@@ -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;
diff --git a/source/blender/editors/space_image/space_image.c b/source/blender/editors/space_image/space_image.c
index 41389f442d2..3ac6d3f870b 100644
--- a/source/blender/editors/space_image/space_image.c
+++ b/source/blender/editors/space_image/space_image.c
@@ -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;
diff --git a/source/blender/editors/space_info/space_info.c b/source/blender/editors/space_info/space_info.c
index ae6b4333150..7ee6d67f7a8 100644
--- a/source/blender/editors/space_info/space_info.c
+++ b/source/blender/editors/space_info/space_info.c
@@ -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;
diff --git a/source/blender/editors/space_ipo/space_ipo.c b/source/blender/editors/space_ipo/space_ipo.c
index 23723062479..99b0ebcf03c 100644
--- a/source/blender/editors/space_ipo/space_ipo.c
+++ b/source/blender/editors/space_ipo/space_ipo.c
@@ -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 @@ static SpaceLink *ipo_new(void)
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;
diff --git a/source/blender/editors/space_nla/space_nla.c b/source/blender/editors/space_nla/space_nla.c
index 58f7b92e872..1be1908b681 100644
--- a/source/blender/editors/space_nla/space_nla.c
+++ b/source/blender/editors/space_nla/space_nla.c
@@ -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 @@ static SpaceLink *nla_duplicate(SpaceLink *sl)
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 @@ void ED_spacetype_nla(void)
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);
diff --git a/source/blender/editors/space_node/space_node.c b/source/blender/editors/space_node/space_node.c
index 642fe92d29b..2cba586b0a9 100644
--- a/source/blender/editors/space_node/space_node.c
+++ b/source/blender/editors/space_node/space_node.c
@@ -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;
diff --git a/source/blender/editors/space_outliner/space_outliner.c b/source/blender/editors/space_outliner/space_outliner.c
index ba694754e13..dd80b0d7a0e 100644
--- a/source/blender/editors/space_outliner/space_outliner.c
+++ b/source/blender/editors/space_outliner/space_outliner.c
@@ -532,7 +532,7 @@ static void outliner_header_area_free(ARegion *ar)
/* ******************** default callbacks for outliner space ***************** */
-static SpaceLink *outliner_new(void)
+static SpaceLink *outliner_new(const bContext *C)
{
ARegion *ar;
SpaceOops *soutliner;
diff --git a/source/blender/editors/space_script/space_script.c b/source/blender/editors/space_script/space_script.c
index 6693d71b507..d9fd4159fb1 100644
--- a/source/blender/editors/space_script/space_script.c
+++ b/source/blender/editors/space_script/space_script.c
@@ -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;
diff --git a/source/blender/editors/space_sequencer/space_sequencer.c b/source/blender/editors/space_sequencer/space_sequencer.c
index 2452b103a56..08f700d1cf9 100644
--- a/source/blender/editors/space_sequencer/space_sequencer.c
+++ b/source/blender/editors/space_sequencer/space_sequencer.c
@@ -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 @@ static SpaceLink *sequencer_new(void)
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;
diff --git a/source/blender/editors/space_sound/space_sound.c b/source/blender/editors/space_sound/space_sound.c
index 82ed6082a38..1b275e51e32 100644
--- a/source/blender/editors/space_sound/space_sound.c
+++ b/source/blender/editors/space_sound/space_sound.c
@@ -63,7 +63,7 @@
/* ******************** default callbacks for sound space ***************** */
-static SpaceLink *sound_new(void)
+static SpaceLink *sound_new(const bContext *C)
{
ARegion *ar;
SpaceSound *ssound;
diff --git a/source/blender/editors/space_text/space_text.c b/source/blender/editors/space_text/space_text.c
index bab9ce3c143..14caafe722e 100644
--- a/source/blender/editors/space_text/space_text.c
+++ b/source/blender/editors/space_text/space_text.c
@@ -63,7 +63,7 @@
/* ******************** default callbacks for text space ***************** */
-static SpaceLink *text_new(void)
+static SpaceLink *text_new(const bContext *C)
{
ARegion *ar;
SpaceText *stext;
diff --git a/source/blender/editors/space_time/space_time.c b/source/blender/editors/space_time/space_time.c
index fdba1829410..81c5334ef31 100644
--- a/source/blender/editors/space_time/space_time.c
+++ b/source/blender/editors/space_time/space_time.c
@@ -205,8 +205,9 @@ static void time_header_area_draw(const bContext *C, ARegion *ar)
/* ******************** default callbacks for time space ***************** */
-static SpaceLink *time_new(void)
+static SpaceLink *time_new(const bContext *C)
{
+ Scene *scene= CTX_data_scene(C);
ARegion *ar;
SpaceTime *stime;
@@ -229,10 +230,9 @@ static SpaceLink *time_new(void)
BLI_addtail(&stime->regionbase, ar);
ar->regiontype= RGN_TYPE_WINDOW;
- /* XXX here sfra and efra was used.... */
- ar->v2d.tot.xmin= (float)(- 4);
+ ar->v2d.tot.xmin= (float)(SFRA - 4);
ar->v2d.tot.ymin= 0.0f;
- ar->v2d.tot.xmax= (float)(250 + 4);
+ ar->v2d.tot.xmax= (float)(EFRA + 4);
ar->v2d.tot.ymax= 50.0f;
ar->v2d.cur= ar->v2d.tot;
diff --git a/source/blender/editors/space_view3d/space_view3d.c b/source/blender/editors/space_view3d/space_view3d.c
index e20490c0c07..96116af1c06 100644
--- a/source/blender/editors/space_view3d/space_view3d.c
+++ b/source/blender/editors/space_view3d/space_view3d.c
@@ -60,8 +60,9 @@
/* ******************** default callbacks for view3d space ***************** */
-static SpaceLink *view3d_new(void)
+static SpaceLink *view3d_new(const bContext *C)
{
+ Scene *scene= CTX_data_scene(C);
ARegion *ar;
View3D *vd;
@@ -69,9 +70,9 @@ static SpaceLink *view3d_new(void)
vd->spacetype= SPACE_VIEW3D;
vd->blockscale= 0.7f;
vd->lay= vd->layact= 1;
- if(G.scene) {
- vd->lay= vd->layact= G.scene->lay;
- vd->camera= G.scene->camera;
+ if(scene) {
+ vd->lay= vd->layact= scene->lay;
+ vd->camera= scene->camera;
}
vd->scenelock= 1;
vd->grid= 1.0f;