- depricated area "headbutofs" and "headbutlen", which is now fully
  replaced with view2d handling. 
- needed to add header default V2D_ALIGN_NO_NEG_Y, V2D_LOCKOFS_Y seems
  to not do anything atm :) 

- new: running blender in debug (blender -d) will print the current
  handler and operator in use (not mousemove)
This commit is contained in:
Ton Roosendaal 2008-12-15 13:23:55 +00:00
parent d48f4b6012
commit a1e0868018
20 changed files with 30 additions and 21 deletions

@ -5062,7 +5062,7 @@ static void area_add_header_region(ScrArea *sa, ListBase *lb)
ar->v2d.keepzoom = (V2D_LOCKZOOM_X|V2D_LOCKZOOM_Y|V2D_KEEPZOOM|V2D_KEEPASPECT); ar->v2d.keepzoom = (V2D_LOCKZOOM_X|V2D_LOCKZOOM_Y|V2D_KEEPZOOM|V2D_KEEPASPECT);
ar->v2d.keepofs = V2D_LOCKOFS_Y; ar->v2d.keepofs = V2D_LOCKOFS_Y;
ar->v2d.keeptot = 2; // this keeps the view in place when region size changes... ar->v2d.keeptot = 2; // this keeps the view in place when region size changes...
ar->v2d.align = V2D_ALIGN_NO_NEG_X; ar->v2d.align = V2D_ALIGN_NO_NEG_X|V2D_ALIGN_NO_NEG_Y;
} }

@ -72,7 +72,7 @@ void UI_view2d_header_default(View2D *v2d)
v2d->keepzoom = (V2D_LOCKZOOM_X|V2D_LOCKZOOM_Y|V2D_KEEPZOOM|V2D_KEEPASPECT); v2d->keepzoom = (V2D_LOCKZOOM_X|V2D_LOCKZOOM_Y|V2D_KEEPZOOM|V2D_KEEPASPECT);
v2d->keepofs = V2D_LOCKOFS_Y; v2d->keepofs = V2D_LOCKOFS_Y;
v2d->keeptot = 2; // this keeps the view in place when region size changes... v2d->keeptot = 2; // this keeps the view in place when region size changes...
v2d->align = V2D_ALIGN_NO_NEG_X; v2d->align = V2D_ALIGN_NO_NEG_X|V2D_ALIGN_NO_NEG_Y;
} }

@ -123,7 +123,7 @@ void action_header_buttons(const bContext *C, ARegion *ar)
uiBlockSetEmboss(block, UI_EMBOSS); uiBlockSetEmboss(block, UI_EMBOSS);
/* always as last */ /* always as last */
sa->headbutlen= xco+XIC+80; // +80 because the last button is not an icon UI_view2d_totRect_set(&ar->v2d, xco+XIC+80, ar->v2d.tot.ymax-ar->v2d.tot.ymin);
uiEndBlock(C, block); uiEndBlock(C, block);
uiDrawBlock(block); uiDrawBlock(block);

@ -191,7 +191,7 @@ void buttons_header_buttons(const bContext *C, ARegion *ar)
/* always as last */ /* always as last */
sa->headbutlen= xco+XIC+80; // +80 because the last button is not an icon UI_view2d_totRect_set(&ar->v2d, xco+XIC+80, ar->v2d.tot.ymax-ar->v2d.tot.ymin);
uiEndBlock(C, block); uiEndBlock(C, block);
uiDrawBlock(block); uiDrawBlock(block);

@ -124,7 +124,7 @@ void file_header_buttons(const bContext *C, ARegion *ar)
uiBlockSetEmboss(block, UI_EMBOSS); uiBlockSetEmboss(block, UI_EMBOSS);
/* always as last */ /* always as last */
sa->headbutlen= xco+XIC+80; // +80 because the last button is not an icon UI_view2d_totRect_set(&ar->v2d, xco+XIC+80, ar->v2d.tot.ymax-ar->v2d.tot.ymin);
uiEndBlock(C, block); uiEndBlock(C, block);
uiDrawBlock(block); uiDrawBlock(block);

@ -123,7 +123,7 @@ void image_header_buttons(const bContext *C, ARegion *ar)
uiBlockSetEmboss(block, UI_EMBOSS); uiBlockSetEmboss(block, UI_EMBOSS);
/* always as last */ /* always as last */
sa->headbutlen= xco+XIC+80; // +80 because the last button is not an icon UI_view2d_totRect_set(&ar->v2d, xco+XIC+80, ar->v2d.tot.ymax-ar->v2d.tot.ymin);
uiEndBlock(C, block); uiEndBlock(C, block);
uiDrawBlock(block); uiDrawBlock(block);

@ -146,7 +146,7 @@ void info_header_buttons(const bContext *C, ARegion *ar)
uiBlockSetEmboss(block, UI_EMBOSS); uiBlockSetEmboss(block, UI_EMBOSS);
/* always as last */ /* always as last */
sa->headbutlen= xco+XIC+80; // +80 because the last button is not an icon UI_view2d_totRect_set(&ar->v2d, xco+XIC+80, ar->v2d.tot.ymax-ar->v2d.tot.ymin);
uiEndBlock(C, block); uiEndBlock(C, block);
uiDrawBlock(block); uiDrawBlock(block);

@ -122,7 +122,7 @@ void ipo_header_buttons(const bContext *C, ARegion *ar)
uiBlockSetEmboss(block, UI_EMBOSS); uiBlockSetEmboss(block, UI_EMBOSS);
/* always as last */ /* always as last */
sa->headbutlen= xco+XIC+80; // +80 because the last button is not an icon UI_view2d_totRect_set(&ar->v2d, xco+XIC+80, ar->v2d.tot.ymax-ar->v2d.tot.ymin);
uiEndBlock(C, block); uiEndBlock(C, block);
uiDrawBlock(block); uiDrawBlock(block);

@ -123,7 +123,7 @@ void nla_header_buttons(const bContext *C, ARegion *ar)
uiBlockSetEmboss(block, UI_EMBOSS); uiBlockSetEmboss(block, UI_EMBOSS);
/* always as last */ /* always as last */
sa->headbutlen= xco+XIC+80; // +80 because the last button is not an icon UI_view2d_totRect_set(&ar->v2d, xco+XIC+80, ar->v2d.tot.ymax-ar->v2d.tot.ymin);
uiEndBlock(C, block); uiEndBlock(C, block);
uiDrawBlock(block); uiDrawBlock(block);

@ -122,7 +122,7 @@ void node_header_buttons(const bContext *C, ARegion *ar)
uiBlockSetEmboss(block, UI_EMBOSS); uiBlockSetEmboss(block, UI_EMBOSS);
/* always as last */ /* always as last */
sa->headbutlen= xco+XIC+80; // +80 because the last button is not an icon UI_view2d_totRect_set(&ar->v2d, xco+XIC+80, ar->v2d.tot.ymax-ar->v2d.tot.ymin);
uiEndBlock(C, block); uiEndBlock(C, block);
uiDrawBlock(block); uiDrawBlock(block);

@ -133,7 +133,7 @@ void outliner_header_buttons(const bContext *C, ARegion *ar)
} }
/* always as last */ /* always as last */
sa->headbutlen= xco+XIC+80; // +80 because the last button is not an icon UI_view2d_totRect_set(&ar->v2d, xco+XIC+80, ar->v2d.tot.ymax-ar->v2d.tot.ymin);
uiEndBlock(C, block); uiEndBlock(C, block);
uiDrawBlock(block); uiDrawBlock(block);

@ -442,6 +442,11 @@ static void outliner_main_area_free(ARegion *ar)
/* ************************ header outliner area region *********************** */ /* ************************ header outliner area region *********************** */
/* add handlers, stuff you only do once or on area/region changes */
static void outliner_header_area_init(wmWindowManager *wm, ARegion *ar)
{
UI_view2d_size_update(&ar->v2d, ar->winx, ar->winy);
}
static void outliner_header_area_draw(const bContext *C, ARegion *ar) static void outliner_header_area_draw(const bContext *C, ARegion *ar)
{ {
@ -455,6 +460,9 @@ static void outliner_header_area_draw(const bContext *C, ARegion *ar)
glClearColor(col[0], col[1], col[2], 0.0); glClearColor(col[0], col[1], col[2], 0.0);
glClear(GL_COLOR_BUFFER_BIT); glClear(GL_COLOR_BUFFER_BIT);
/* set view2d view matrix for scrolling (without scrollers) */
UI_view2d_view_ortho(C, &ar->v2d);
outliner_header_buttons(C, ar); outliner_header_buttons(C, ar);
} }
@ -586,8 +594,9 @@ void ED_spacetype_outliner(void)
art= MEM_callocN(sizeof(ARegionType), "spacetype time region"); art= MEM_callocN(sizeof(ARegionType), "spacetype time region");
art->regionid = RGN_TYPE_HEADER; art->regionid = RGN_TYPE_HEADER;
art->minsizey= HEADERY; art->minsizey= HEADERY;
art->keymapflag= ED_KEYMAP_UI; art->keymapflag= ED_KEYMAP_UI|ED_KEYMAP_VIEW2D;
art->init= outliner_header_area_init;
art->draw= outliner_header_area_draw; art->draw= outliner_header_area_draw;
art->free= outliner_header_area_free; art->free= outliner_header_area_free;
BLI_addhead(&st->regiontypes, art); BLI_addhead(&st->regiontypes, art);

@ -123,7 +123,7 @@ void script_header_buttons(const bContext *C, ARegion *ar)
uiBlockSetEmboss(block, UI_EMBOSS); uiBlockSetEmboss(block, UI_EMBOSS);
/* always as last */ /* always as last */
sa->headbutlen= xco+XIC+80; // +80 because the last button is not an icon UI_view2d_totRect_set(&ar->v2d, xco+XIC+80, ar->v2d.tot.ymax-ar->v2d.tot.ymin);
uiEndBlock(C, block); uiEndBlock(C, block);
uiDrawBlock(block); uiDrawBlock(block);

@ -123,7 +123,7 @@ void sequencer_header_buttons(const bContext *C, ARegion *ar)
uiBlockSetEmboss(block, UI_EMBOSS); uiBlockSetEmboss(block, UI_EMBOSS);
/* always as last */ /* always as last */
sa->headbutlen= xco+XIC+80; // +80 because the last button is not an icon UI_view2d_totRect_set(&ar->v2d, xco+XIC+80, ar->v2d.tot.ymax-ar->v2d.tot.ymin);
uiEndBlock(C, block); uiEndBlock(C, block);
uiDrawBlock(block); uiDrawBlock(block);

@ -123,7 +123,7 @@ void sound_header_buttons(const bContext *C, ARegion *ar)
uiBlockSetEmboss(block, UI_EMBOSS); uiBlockSetEmboss(block, UI_EMBOSS);
/* always as last */ /* always as last */
sa->headbutlen= xco+XIC+80; // +80 because the last button is not an icon UI_view2d_totRect_set(&ar->v2d, xco+XIC+80, ar->v2d.tot.ymax-ar->v2d.tot.ymin);
uiEndBlock(C, block); uiEndBlock(C, block);
uiDrawBlock(block); uiDrawBlock(block);

@ -123,7 +123,7 @@ void text_header_buttons(const bContext *C, ARegion *ar)
uiBlockSetEmboss(block, UI_EMBOSS); uiBlockSetEmboss(block, UI_EMBOSS);
/* always as last */ /* always as last */
sa->headbutlen= xco+XIC+80; // +80 because the last button is not an icon UI_view2d_totRect_set(&ar->v2d, xco+XIC+80, ar->v2d.tot.ymax-ar->v2d.tot.ymin);
uiEndBlock(C, block); uiEndBlock(C, block);
uiDrawBlock(block); uiDrawBlock(block);

@ -570,7 +570,7 @@ void time_header_buttons(const bContext *C, ARegion *ar)
/* always as last */ /* always as last */
sa->headbutlen= xco+XIC+80; // +80 because the last button is not an icon UI_view2d_totRect_set(&ar->v2d, xco+XIC+80, ar->v2d.tot.ymax-ar->v2d.tot.ymin);
uiEndBlock(C, block); uiEndBlock(C, block);
uiDrawBlock(block); uiDrawBlock(block);

@ -123,7 +123,7 @@ void view3d_header_buttons(const bContext *C, ARegion *ar)
uiBlockSetEmboss(block, UI_EMBOSS); uiBlockSetEmboss(block, UI_EMBOSS);
/* always as last */ /* always as last */
sa->headbutlen= xco+XIC+80; // +80 because the last button is not an icon UI_view2d_totRect_set(&ar->v2d, xco+XIC+80, ar->v2d.tot.ymax-ar->v2d.tot.ymin);
uiEndBlock(C, block); uiEndBlock(C, block);
uiDrawBlock(block); uiDrawBlock(block);

@ -101,7 +101,7 @@ typedef struct ScrArea {
short winx, winy; /* size */ short winx, winy; /* size */
short headertype; /* OLD! 0=no header, 1= down, 2= up */ short headertype; /* OLD! 0=no header, 1= down, 2= up */
short headbutlen, headbutofs; /* OLD! */ int pad;
short cursor, flag; short cursor, flag;
ScriptLink scriptlink; ScriptLink scriptlink;

@ -549,8 +549,8 @@ static int wm_handlers_do(bContext *C, wmEvent *event, ListBase *handlers)
for(kmi= handler->keymap->first; kmi; kmi= kmi->next) { for(kmi= handler->keymap->first; kmi; kmi= kmi->next) {
if(wm_eventmatch(event, kmi)) { if(wm_eventmatch(event, kmi)) {
/* if(event->type!=MOUSEMOVE) if((G.f & G_DEBUG) && event->type!=MOUSEMOVE)
printf("handle evt %d win %d op %s\n", event->type, C->window->winid, kmi->idname); */ printf("handle evt %d win %d op %s\n", event->type, C->window->winid, kmi->idname);
event->keymap_idname= kmi->idname; /* weak, but allows interactive callback to not use rawkey */ event->keymap_idname= kmi->idname; /* weak, but allows interactive callback to not use rawkey */