From bac4d10174da530427343e6238be16b8a8ee3ac8 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Mon, 22 Dec 2008 10:09:56 +0000 Subject: 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. --- source/blender/editors/space_nla/space_nla.c | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) (limited to 'source/blender/editors/space_nla/space_nla.c') 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); -- cgit v1.2.3