Blender V2.61 - r43446
|
00001 /* 00002 * ***** BEGIN GPL LICENSE BLOCK ***** 00003 * 00004 * This program is free software; you can redistribute it and/or 00005 * modify it under the terms of the GNU General Public License 00006 * as published by the Free Software Foundation; either version 2 00007 * of the License, or (at your option) any later version. 00008 * 00009 * This program is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 * GNU General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU General Public License 00015 * along with this program; if not, write to the Free Software Foundation, 00016 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 00017 * 00018 * The Original Code is Copyright (C) 2008 Blender Foundation. 00019 * All rights reserved. 00020 * 00021 * 00022 * Contributor(s): Blender Foundation 00023 * 00024 * ***** END GPL LICENSE BLOCK ***** 00025 */ 00026 00032 #include <string.h> 00033 #include <stdio.h> 00034 00035 #include "DNA_scene_types.h" 00036 00037 #include "MEM_guardedalloc.h" 00038 00039 #include "BLI_blenlib.h" 00040 #include "BLI_math.h" 00041 #include "BLI_utildefines.h" 00042 00043 #include "BKE_context.h" 00044 #include "BKE_screen.h" 00045 #include "BKE_sequencer.h" 00046 #include "BKE_global.h" 00047 00048 #include "ED_space_api.h" 00049 #include "ED_sequencer.h" 00050 #include "ED_screen.h" 00051 #include "ED_view3d.h" /* only for sequencer view3d drawing callback */ 00052 00053 #include "WM_api.h" 00054 #include "WM_types.h" 00055 00056 #include "UI_resources.h" 00057 #include "UI_view2d.h" 00058 00059 #include "sequencer_intern.h" // own include 00060 00061 /* ******************** manage regions ********************* */ 00062 00063 ARegion *sequencer_has_buttons_region(ScrArea *sa) 00064 { 00065 ARegion *ar, *arnew; 00066 00067 ar= BKE_area_find_region_type(sa, RGN_TYPE_UI); 00068 if(ar) return ar; 00069 00070 /* add subdiv level; after header */ 00071 ar= BKE_area_find_region_type(sa, RGN_TYPE_HEADER); 00072 00073 /* is error! */ 00074 if(ar==NULL) return NULL; 00075 00076 arnew= MEM_callocN(sizeof(ARegion), "buttons for sequencer"); 00077 00078 BLI_insertlinkafter(&sa->regionbase, ar, arnew); 00079 arnew->regiontype= RGN_TYPE_UI; 00080 arnew->alignment= RGN_ALIGN_RIGHT; 00081 00082 arnew->flag = RGN_FLAG_HIDDEN; 00083 00084 return arnew; 00085 } 00086 00087 static ARegion *sequencer_find_region(ScrArea *sa, short type) 00088 { 00089 ARegion *ar=NULL; 00090 00091 for(ar= sa->regionbase.first; ar; ar= ar->next) 00092 if(ar->regiontype==type) 00093 return ar; 00094 00095 return ar; 00096 } 00097 00098 /* ******************** default callbacks for sequencer space ***************** */ 00099 00100 static SpaceLink *sequencer_new(const bContext *C) 00101 { 00102 Scene *scene= CTX_data_scene(C); 00103 ARegion *ar; 00104 SpaceSeq *sseq; 00105 00106 sseq= MEM_callocN(sizeof(SpaceSeq), "initsequencer"); 00107 sseq->spacetype= SPACE_SEQ; 00108 sseq->chanshown = 0; 00109 sseq->view = SEQ_VIEW_SEQUENCE; 00110 sseq->mainb = SEQ_DRAW_IMG_IMBUF; 00111 /* header */ 00112 ar= MEM_callocN(sizeof(ARegion), "header for sequencer"); 00113 00114 BLI_addtail(&sseq->regionbase, ar); 00115 ar->regiontype= RGN_TYPE_HEADER; 00116 ar->alignment= RGN_ALIGN_BOTTOM; 00117 00118 /* buttons/list view */ 00119 ar= MEM_callocN(sizeof(ARegion), "buttons for sequencer"); 00120 00121 BLI_addtail(&sseq->regionbase, ar); 00122 ar->regiontype= RGN_TYPE_UI; 00123 ar->alignment= RGN_ALIGN_RIGHT; 00124 ar->flag = RGN_FLAG_HIDDEN; 00125 00126 /* preview area */ 00127 /* NOTE: if you change values here, also change them in sequencer_init_preview_region */ 00128 ar= MEM_callocN(sizeof(ARegion), "preview area for sequencer"); 00129 BLI_addtail(&sseq->regionbase, ar); 00130 ar->regiontype= RGN_TYPE_PREVIEW; 00131 ar->alignment= RGN_ALIGN_TOP; 00132 ar->flag |= RGN_FLAG_HIDDEN; 00133 /* for now, aspect ratio should be maintained, and zoom is clamped within sane default limits */ 00134 ar->v2d.keepzoom= V2D_KEEPASPECT | V2D_KEEPZOOM; 00135 ar->v2d.minzoom= 0.00001f; 00136 ar->v2d.maxzoom= 100000.0f; 00137 ar->v2d.tot.xmin= -960.0f; /* 1920 width centered */ 00138 ar->v2d.tot.ymin= -540.0f; /* 1080 height centered */ 00139 ar->v2d.tot.xmax= 960.0f; 00140 ar->v2d.tot.ymax= 540.0f; 00141 ar->v2d.min[0]= 0.0f; 00142 ar->v2d.min[1]= 0.0f; 00143 ar->v2d.max[0]= 12000.0f; 00144 ar->v2d.max[1]= 12000.0f; 00145 ar->v2d.cur= ar->v2d.tot; 00146 ar->v2d.align= V2D_ALIGN_FREE; 00147 ar->v2d.keeptot= V2D_KEEPTOT_FREE; 00148 00149 00150 /* main area */ 00151 ar= MEM_callocN(sizeof(ARegion), "main area for sequencer"); 00152 00153 BLI_addtail(&sseq->regionbase, ar); 00154 ar->regiontype= RGN_TYPE_WINDOW; 00155 00156 00157 /* seq space goes from (0,8) to (0, efra) */ 00158 00159 ar->v2d.tot.xmin= 0.0f; 00160 ar->v2d.tot.ymin= 0.0f; 00161 ar->v2d.tot.xmax= scene->r.efra; 00162 ar->v2d.tot.ymax= 8.0f; 00163 00164 ar->v2d.cur= ar->v2d.tot; 00165 00166 ar->v2d.min[0]= 10.0f; 00167 ar->v2d.min[1]= 0.5f; 00168 00169 ar->v2d.max[0]= MAXFRAMEF; 00170 ar->v2d.max[1]= MAXSEQ; 00171 00172 ar->v2d.minzoom= 0.01f; 00173 ar->v2d.maxzoom= 100.0f; 00174 00175 ar->v2d.scroll |= (V2D_SCROLL_BOTTOM|V2D_SCROLL_SCALE_HORIZONTAL); 00176 ar->v2d.scroll |= (V2D_SCROLL_LEFT|V2D_SCROLL_SCALE_VERTICAL); 00177 ar->v2d.keepzoom= 0; 00178 ar->v2d.keeptot= 0; 00179 ar->v2d.align= V2D_ALIGN_NO_NEG_Y; 00180 00181 return (SpaceLink *)sseq; 00182 } 00183 00184 /* not spacelink itself */ 00185 static void sequencer_free(SpaceLink *UNUSED(sl)) 00186 { 00187 // SpaceSeq *sseq= (SpaceSequencer*) sl; 00188 00189 // XXX if(sseq->gpd) free_gpencil_data(sseq->gpd); 00190 00191 } 00192 00193 00194 /* spacetype; init callback */ 00195 static void sequencer_init(struct wmWindowManager *UNUSED(wm), ScrArea *UNUSED(sa)) 00196 { 00197 00198 } 00199 00200 static void sequencer_refresh(const bContext *C, ScrArea *sa) 00201 { 00202 wmWindowManager *wm= CTX_wm_manager(C); 00203 wmWindow *window= CTX_wm_window(C); 00204 SpaceSeq *sseq= (SpaceSeq *)sa->spacedata.first; 00205 ARegion *ar_main= sequencer_find_region(sa, RGN_TYPE_WINDOW); 00206 ARegion *ar_preview= sequencer_find_region(sa, RGN_TYPE_PREVIEW); 00207 int view_changed= 0; 00208 00209 switch (sseq->view) { 00210 case SEQ_VIEW_SEQUENCE: 00211 if (ar_main && (ar_main->flag & RGN_FLAG_HIDDEN)) { 00212 ar_main->flag &= ~RGN_FLAG_HIDDEN; 00213 ar_main->v2d.flag &= ~V2D_IS_INITIALISED; 00214 view_changed= 1; 00215 } 00216 if (ar_preview && !(ar_preview->flag & RGN_FLAG_HIDDEN)) { 00217 ar_preview->flag |= RGN_FLAG_HIDDEN; 00218 ar_preview->v2d.flag &= ~V2D_IS_INITIALISED; 00219 WM_event_remove_handlers((bContext*)C, &ar_preview->handlers); 00220 view_changed= 1; 00221 } 00222 if (ar_main && ar_main->alignment != RGN_ALIGN_NONE) { 00223 ar_main->alignment= RGN_ALIGN_NONE; 00224 view_changed= 1; 00225 } 00226 if (ar_preview && ar_preview->alignment != RGN_ALIGN_NONE) { 00227 ar_preview->alignment= RGN_ALIGN_NONE; 00228 view_changed= 1; 00229 } 00230 break; 00231 case SEQ_VIEW_PREVIEW: 00232 if (ar_main && !(ar_main->flag & RGN_FLAG_HIDDEN)) { 00233 ar_main->flag |= RGN_FLAG_HIDDEN; 00234 ar_main->v2d.flag &= ~V2D_IS_INITIALISED; 00235 WM_event_remove_handlers((bContext*)C, &ar_main->handlers); 00236 view_changed= 1; 00237 } 00238 if (ar_preview && (ar_preview->flag & RGN_FLAG_HIDDEN)) { 00239 ar_preview->flag &= ~RGN_FLAG_HIDDEN; 00240 ar_preview->v2d.flag &= ~V2D_IS_INITIALISED; 00241 ar_preview->v2d.cur = ar_preview->v2d.tot; 00242 view_changed= 1; 00243 } 00244 if (ar_main && ar_main->alignment != RGN_ALIGN_NONE) { 00245 ar_main->alignment= RGN_ALIGN_NONE; 00246 view_changed= 1; 00247 } 00248 if (ar_preview && ar_preview->alignment != RGN_ALIGN_NONE) { 00249 ar_preview->alignment= RGN_ALIGN_NONE; 00250 view_changed= 1; 00251 } 00252 break; 00253 case SEQ_VIEW_SEQUENCE_PREVIEW: 00254 if (ar_main && (ar_main->flag & RGN_FLAG_HIDDEN)) { 00255 ar_main->flag &= ~RGN_FLAG_HIDDEN; 00256 ar_main->v2d.flag &= ~V2D_IS_INITIALISED; 00257 view_changed= 1; 00258 } 00259 if (ar_preview && (ar_preview->flag & RGN_FLAG_HIDDEN)) { 00260 ar_preview->flag &= ~RGN_FLAG_HIDDEN; 00261 ar_preview->v2d.flag &= ~V2D_IS_INITIALISED; 00262 ar_preview->v2d.cur = ar_preview->v2d.tot; 00263 view_changed= 1; 00264 } 00265 if (ar_main && ar_main->alignment != RGN_ALIGN_NONE) { 00266 ar_main->alignment= RGN_ALIGN_NONE; 00267 view_changed= 1; 00268 } 00269 if (ar_preview && ar_preview->alignment != RGN_ALIGN_TOP) { 00270 ar_preview->alignment= RGN_ALIGN_TOP; 00271 view_changed= 1; 00272 } 00273 break; 00274 } 00275 00276 if(view_changed) { 00277 ED_area_initialize(wm, window, sa); 00278 ED_area_tag_redraw(sa); 00279 } 00280 } 00281 00282 static SpaceLink *sequencer_duplicate(SpaceLink *sl) 00283 { 00284 SpaceSeq *sseqn= MEM_dupallocN(sl); 00285 00286 /* clear or remove stuff from old */ 00287 // XXX sseq->gpd= gpencil_data_duplicate(sseq->gpd); 00288 00289 return (SpaceLink *)sseqn; 00290 } 00291 00292 00293 00294 /* *********************** sequencer (main) region ************************ */ 00295 /* add handlers, stuff you only do once or on area/region changes */ 00296 static void sequencer_main_area_init(wmWindowManager *wm, ARegion *ar) 00297 { 00298 wmKeyMap *keymap; 00299 ListBase *lb; 00300 00301 UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_CUSTOM, ar->winx, ar->winy); 00302 00303 keymap= WM_keymap_find(wm->defaultconf, "SequencerCommon", SPACE_SEQ, 0); 00304 WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct); 00305 00306 /* own keymap */ 00307 keymap= WM_keymap_find(wm->defaultconf, "Sequencer", SPACE_SEQ, 0); 00308 WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct); 00309 00310 /* add drop boxes */ 00311 lb= WM_dropboxmap_find("Sequencer", SPACE_SEQ, RGN_TYPE_WINDOW); 00312 00313 WM_event_add_dropbox_handler(&ar->handlers, lb); 00314 00315 } 00316 00317 static void sequencer_main_area_draw(const bContext *C, ARegion *ar) 00318 { 00319 // ScrArea *sa= CTX_wm_area(C); 00320 00321 /* NLE - strip editing timeline interface */ 00322 draw_timeline_seq(C, ar); 00323 } 00324 00325 /* ************* dropboxes ************* */ 00326 00327 static int image_drop_poll(bContext *UNUSED(C), wmDrag *drag, wmEvent *UNUSED(event)) 00328 { 00329 if(drag->type==WM_DRAG_PATH) 00330 if(ELEM(drag->icon, ICON_FILE_IMAGE, ICON_FILE_BLANK)) /* rule might not work? */ 00331 return 1; 00332 return 0; 00333 } 00334 00335 static int movie_drop_poll(bContext *UNUSED(C), wmDrag *drag, wmEvent *UNUSED(event)) 00336 { 00337 if(drag->type==WM_DRAG_PATH) 00338 if(ELEM3(drag->icon, 0, ICON_FILE_MOVIE, ICON_FILE_BLANK)) /* rule might not work? */ 00339 return 1; 00340 return 0; 00341 } 00342 00343 static int sound_drop_poll(bContext *UNUSED(C), wmDrag *drag, wmEvent *UNUSED(event)) 00344 { 00345 if(drag->type==WM_DRAG_PATH) 00346 if(ELEM(drag->icon, ICON_FILE_SOUND, ICON_FILE_BLANK)) /* rule might not work? */ 00347 return 1; 00348 return 0; 00349 } 00350 00351 static void sequencer_drop_copy(wmDrag *drag, wmDropBox *drop) 00352 { 00353 /* copy drag path to properties */ 00354 if(RNA_struct_find_property(drop->ptr, "filepath")) 00355 RNA_string_set(drop->ptr, "filepath", drag->path); 00356 00357 if(RNA_struct_find_property(drop->ptr, "directory")) { 00358 PointerRNA itemptr; 00359 char dir[FILE_MAX], file[FILE_MAX]; 00360 00361 BLI_split_dirfile(drag->path, dir, file, sizeof(dir), sizeof(file)); 00362 00363 RNA_string_set(drop->ptr, "directory", dir); 00364 00365 RNA_collection_clear(drop->ptr, "files"); 00366 RNA_collection_add(drop->ptr, "files", &itemptr); 00367 RNA_string_set(&itemptr, "name", file); 00368 } 00369 } 00370 00371 /* this region dropbox definition */ 00372 static void sequencer_dropboxes(void) 00373 { 00374 ListBase *lb= WM_dropboxmap_find("Sequencer", SPACE_SEQ, RGN_TYPE_WINDOW); 00375 00376 WM_dropbox_add(lb, "SEQUENCER_OT_image_strip_add", image_drop_poll, sequencer_drop_copy); 00377 WM_dropbox_add(lb, "SEQUENCER_OT_movie_strip_add", movie_drop_poll, sequencer_drop_copy); 00378 WM_dropbox_add(lb, "SEQUENCER_OT_sound_strip_add", sound_drop_poll, sequencer_drop_copy); 00379 } 00380 00381 /* ************* end drop *********** */ 00382 00383 /* add handlers, stuff you only do once or on area/region changes */ 00384 static void sequencer_header_area_init(wmWindowManager *UNUSED(wm), ARegion *ar) 00385 { 00386 ED_region_header_init(ar); 00387 } 00388 00389 static void sequencer_header_area_draw(const bContext *C, ARegion *ar) 00390 { 00391 ED_region_header(C, ar); 00392 } 00393 00394 static void sequencer_main_area_listener(ARegion *ar, wmNotifier *wmn) 00395 { 00396 /* context changes */ 00397 switch(wmn->category) { 00398 case NC_SCENE: 00399 switch(wmn->data) { 00400 case ND_FRAME: 00401 case ND_FRAME_RANGE: 00402 case ND_MARKERS: 00403 case ND_RENDER_OPTIONS: /* for FPS and FPS Base */ 00404 case ND_SEQUENCER: 00405 ED_region_tag_redraw(ar); 00406 break; 00407 } 00408 break; 00409 case NC_SPACE: 00410 if(wmn->data == ND_SPACE_SEQUENCER) 00411 ED_region_tag_redraw(ar); 00412 break; 00413 case NC_ID: 00414 if(wmn->action == NA_RENAME) 00415 ED_region_tag_redraw(ar); 00416 break; 00417 } 00418 } 00419 00420 /* *********************** preview region ************************ */ 00421 static void sequencer_preview_area_init(wmWindowManager *wm, ARegion *ar) 00422 { 00423 wmKeyMap *keymap; 00424 00425 UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_CUSTOM, ar->winx, ar->winy); 00426 00427 keymap= WM_keymap_find(wm->defaultconf, "SequencerCommon", SPACE_SEQ, 0); 00428 WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct); 00429 00430 /* own keymap */ 00431 keymap= WM_keymap_find(wm->defaultconf, "SequencerPreview", SPACE_SEQ, 0); 00432 WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct); 00433 } 00434 00435 static void sequencer_preview_area_draw(const bContext *C, ARegion *ar) 00436 { 00437 ScrArea *sa= CTX_wm_area(C); 00438 SpaceSeq *sseq= sa->spacedata.first; 00439 Scene *scene= CTX_data_scene(C); 00440 00441 /* XXX temp fix for wrong setting in sseq->mainb */ 00442 if (sseq->mainb == SEQ_DRAW_SEQUENCE) sseq->mainb = SEQ_DRAW_IMG_IMBUF; 00443 00444 draw_image_seq(C, scene, ar, sseq, scene->r.cfra, 0); 00445 00446 if(scene->ed && scene->ed->over_flag & SEQ_EDIT_OVERLAY_SHOW && sseq->mainb == SEQ_DRAW_IMG_IMBUF) { 00447 int over_cfra; 00448 00449 if(scene->ed->over_flag & SEQ_EDIT_OVERLAY_ABS) 00450 over_cfra= scene->ed->over_cfra; 00451 else 00452 over_cfra= scene->r.cfra + scene->ed->over_ofs; 00453 00454 if(over_cfra != scene->r.cfra) 00455 draw_image_seq(C, scene, ar, sseq, scene->r.cfra, over_cfra - scene->r.cfra); 00456 } 00457 00458 } 00459 00460 static void sequencer_preview_area_listener(ARegion *ar, wmNotifier *wmn) 00461 { 00462 /* context changes */ 00463 switch(wmn->category) { 00464 case NC_SCENE: 00465 switch(wmn->data) { 00466 case ND_FRAME: 00467 case ND_MARKERS: 00468 case ND_SEQUENCER: 00469 ED_region_tag_redraw(ar); 00470 break; 00471 } 00472 break; 00473 case NC_SPACE: 00474 if(wmn->data == ND_SPACE_SEQUENCER) 00475 ED_region_tag_redraw(ar); 00476 break; 00477 case NC_ID: 00478 switch(wmn->data) { 00479 case NA_RENAME: 00480 ED_region_tag_redraw(ar); 00481 break; 00482 } 00483 break; 00484 } 00485 } 00486 00487 /* *********************** buttons region ************************ */ 00488 00489 /* add handlers, stuff you only do once or on area/region changes */ 00490 static void sequencer_buttons_area_init(wmWindowManager *wm, ARegion *ar) 00491 { 00492 00493 ED_region_panels_init(wm, ar); 00494 00495 } 00496 00497 static void sequencer_buttons_area_draw(const bContext *C, ARegion *ar) 00498 { 00499 ED_region_panels(C, ar, 1, NULL, -1); 00500 } 00501 00502 static void sequencer_buttons_area_listener(ARegion *ar, wmNotifier *wmn) 00503 { 00504 /* context changes */ 00505 switch(wmn->category) { 00506 case NC_SCENE: 00507 switch(wmn->data) { 00508 case ND_FRAME: 00509 case ND_SEQUENCER: 00510 ED_region_tag_redraw(ar); 00511 break; 00512 } 00513 break; 00514 case NC_SPACE: 00515 if(wmn->data == ND_SPACE_SEQUENCER) 00516 ED_region_tag_redraw(ar); 00517 break; 00518 case NC_ID: 00519 if(wmn->action == NA_RENAME) 00520 ED_region_tag_redraw(ar); 00521 break; 00522 } 00523 } 00524 /* ************************************* */ 00525 00526 /* only called once, from space/spacetypes.c */ 00527 void ED_spacetype_sequencer(void) 00528 { 00529 SpaceType *st= MEM_callocN(sizeof(SpaceType), "spacetype sequencer"); 00530 ARegionType *art; 00531 00532 st->spaceid= SPACE_SEQ; 00533 strncpy(st->name, "Sequencer", BKE_ST_MAXNAME); 00534 00535 st->new= sequencer_new; 00536 st->free= sequencer_free; 00537 st->init= sequencer_init; 00538 st->duplicate= sequencer_duplicate; 00539 st->operatortypes= sequencer_operatortypes; 00540 st->keymap= sequencer_keymap; 00541 st->dropboxes= sequencer_dropboxes; 00542 st->refresh= sequencer_refresh; 00543 00544 /* regions: main window */ 00545 art= MEM_callocN(sizeof(ARegionType), "spacetype sequencer region"); 00546 art->regionid = RGN_TYPE_WINDOW; 00547 art->init= sequencer_main_area_init; 00548 art->draw= sequencer_main_area_draw; 00549 art->listener= sequencer_main_area_listener; 00550 art->keymapflag= ED_KEYMAP_VIEW2D|ED_KEYMAP_MARKERS|ED_KEYMAP_FRAMES|ED_KEYMAP_ANIMATION; 00551 00552 BLI_addhead(&st->regiontypes, art); 00553 00554 /* preview */ 00555 art= MEM_callocN(sizeof(ARegionType), "spacetype sequencer region"); 00556 art->regionid = RGN_TYPE_PREVIEW; 00557 art->prefsizey = 240; // XXX 00558 art->init= sequencer_preview_area_init; 00559 art->draw= sequencer_preview_area_draw; 00560 art->listener= sequencer_preview_area_listener; 00561 art->keymapflag= ED_KEYMAP_VIEW2D|ED_KEYMAP_FRAMES|ED_KEYMAP_ANIMATION; 00562 BLI_addhead(&st->regiontypes, art); 00563 00564 /* regions: listview/buttons */ 00565 art= MEM_callocN(sizeof(ARegionType), "spacetype sequencer region"); 00566 art->regionid = RGN_TYPE_UI; 00567 art->prefsizex= 220; // XXX 00568 art->keymapflag= ED_KEYMAP_UI|ED_KEYMAP_FRAMES; 00569 art->listener= sequencer_buttons_area_listener; 00570 art->init= sequencer_buttons_area_init; 00571 art->draw= sequencer_buttons_area_draw; 00572 BLI_addhead(&st->regiontypes, art); 00573 00574 /* Keep as python only for now 00575 sequencer_buttons_register(art); 00576 */ 00577 00578 /* regions: header */ 00579 art= MEM_callocN(sizeof(ARegionType), "spacetype sequencer region"); 00580 art->regionid = RGN_TYPE_HEADER; 00581 art->prefsizey= HEADERY; 00582 art->keymapflag= ED_KEYMAP_UI|ED_KEYMAP_VIEW2D|ED_KEYMAP_FRAMES|ED_KEYMAP_HEADER; 00583 00584 art->init= sequencer_header_area_init; 00585 art->draw= sequencer_header_area_draw; 00586 art->listener= sequencer_main_area_listener; 00587 00588 BLI_addhead(&st->regiontypes, art); 00589 00590 BKE_spacetype_register(st); 00591 00592 /* set the sequencer callback when not in background mode */ 00593 if(G.background==0) { 00594 sequencer_view3d_cb= ED_view3d_draw_offscreen_imbuf_simple; 00595 } 00596 } 00597