LEFT | RIGHT |
1 /* | 1 /* |
2 * $Id$ | |
3 * | |
4 * ***** BEGIN GPL LICENSE BLOCK ***** | 2 * ***** BEGIN GPL LICENSE BLOCK ***** |
5 * | 3 * |
6 * This program is free software; you can redistribute it and/or | 4 * This program is free software; you can redistribute it and/or |
7 * modify it under the terms of the GNU General Public License | 5 * modify it under the terms of the GNU General Public License |
8 * as published by the Free Software Foundation; either version 2 | 6 * as published by the Free Software Foundation; either version 2 |
9 * of the License, or (at your option) any later version. | 7 * of the License, or (at your option) any later version. |
10 * | 8 * |
11 * This program is distributed in the hope that it will be useful, | 9 * This program is distributed in the hope that it will be useful, |
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
(...skipping 20 matching lines...) Expand all Loading... |
34 #include <string.h> | 32 #include <string.h> |
35 #include <stdio.h> | 33 #include <stdio.h> |
36 | 34 |
37 #include "DNA_scene_types.h" | 35 #include "DNA_scene_types.h" |
38 #include "DNA_movieclip_types.h" | 36 #include "DNA_movieclip_types.h" |
39 | 37 |
40 #include "MEM_guardedalloc.h" | 38 #include "MEM_guardedalloc.h" |
41 | 39 |
42 #include "BLI_blenlib.h" | 40 #include "BLI_blenlib.h" |
43 #include "BLI_utildefines.h" | 41 #include "BLI_utildefines.h" |
| 42 #include "BLI_math.h" |
44 | 43 |
45 #include "BKE_main.h" | 44 #include "BKE_main.h" |
46 #include "BKE_context.h" | 45 #include "BKE_context.h" |
47 #include "BKE_screen.h" | 46 #include "BKE_screen.h" |
48 #include "BKE_movieclip.h" | 47 #include "BKE_movieclip.h" |
49 #include "BKE_tracking.h" | 48 #include "BKE_tracking.h" |
50 | 49 |
51 #include "IMB_imbuf_types.h" | 50 #include "IMB_imbuf_types.h" |
52 | 51 |
53 #include "ED_screen.h" | 52 #include "ED_screen.h" |
54 #include "ED_clip.h" | 53 #include "ED_clip.h" |
55 #include "ED_transform.h" | 54 #include "ED_transform.h" |
56 | 55 |
57 #include "IMB_imbuf.h" | 56 #include "IMB_imbuf.h" |
58 | 57 |
59 #include "BIF_gl.h" | 58 #include "BIF_gl.h" |
60 | 59 |
61 #include "WM_api.h" | 60 #include "WM_api.h" |
62 #include "WM_types.h" | 61 #include "WM_types.h" |
63 | 62 |
64 #include "UI_interface.h" | 63 #include "UI_interface.h" |
65 #include "UI_resources.h" | 64 #include "UI_resources.h" |
66 #include "UI_view2d.h" | 65 #include "UI_view2d.h" |
67 | 66 |
68 #include "RNA_access.h" | 67 #include "RNA_access.h" |
69 | 68 |
70 | 69 |
71 #include "clip_intern.h" // own include | 70 #include "clip_intern.h" // own include |
72 | 71 |
| 72 static void init_preview_region(const bContext *C, ARegion *ar) |
| 73 { |
| 74 Scene *scene= CTX_data_scene(C); |
| 75 |
| 76 ar->regiontype= RGN_TYPE_PREVIEW; |
| 77 ar->alignment= RGN_ALIGN_TOP; |
| 78 ar->flag|= RGN_FLAG_HIDDEN; |
| 79 |
| 80 ar->v2d.tot.xmin= 0.0f; |
| 81 ar->v2d.tot.ymin= (float)scene->r.sfra - 10.0f; |
| 82 ar->v2d.tot.xmax= (float)scene->r.efra; |
| 83 ar->v2d.tot.ymax= 10.0f; |
| 84 |
| 85 ar->v2d.cur= ar->v2d.tot; |
| 86 |
| 87 ar->v2d.min[0]= FLT_MIN; |
| 88 ar->v2d.min[1]= FLT_MIN; |
| 89 |
| 90 ar->v2d.max[0]= MAXFRAMEF; |
| 91 ar->v2d.max[1]= FLT_MAX; |
| 92 |
| 93 ar->v2d.scroll= (V2D_SCROLL_BOTTOM|V2D_SCROLL_SCALE_HORIZONTAL); |
| 94 ar->v2d.scroll |= (V2D_SCROLL_LEFT|V2D_SCROLL_SCALE_VERTICAL); |
| 95 |
| 96 ar->v2d.keeptot= 0; |
| 97 } |
| 98 |
| 99 static ARegion *clip_has_preview_region(const bContext *C, ScrArea *sa) |
| 100 { |
| 101 ARegion *ar, *arnew; |
| 102 |
| 103 ar= BKE_area_find_region_type(sa, RGN_TYPE_PREVIEW); |
| 104 if(ar) |
| 105 return ar; |
| 106 |
| 107 /* add subdiv level; after header */ |
| 108 ar= BKE_area_find_region_type(sa, RGN_TYPE_WINDOW); |
| 109 |
| 110 /* is error! */ |
| 111 if(ar==NULL) |
| 112 return NULL; |
| 113 |
| 114 arnew= MEM_callocN(sizeof(ARegion), "clip preview region"); |
| 115 |
| 116 BLI_insertlinkbefore(&sa->regionbase, ar, arnew); |
| 117 init_preview_region(C, arnew); |
| 118 |
| 119 return arnew; |
| 120 } |
| 121 |
73 static void clip_scopes_tag_refresh(ScrArea *sa) | 122 static void clip_scopes_tag_refresh(ScrArea *sa) |
74 { | 123 { |
75 SpaceClip *sc= (SpaceClip *)sa->spacedata.first; | 124 SpaceClip *sc= (SpaceClip *)sa->spacedata.first; |
76 ARegion *ar; | 125 ARegion *ar; |
77 | 126 |
78 if(sc->mode!=SC_MODE_TRACKING) | 127 if(sc->mode!=SC_MODE_TRACKING) |
79 return; | 128 return; |
80 | 129 |
81 /* only while proeprties are visible */ | 130 /* only while proeprties are visible */ |
82 for (ar=sa->regionbase.first; ar; ar=ar->next) { | 131 for (ar=sa->regionbase.first; ar; ar=ar->next) { |
(...skipping 11 matching lines...) Expand all Loading... |
94 | 143 |
95 if(clip) { | 144 if(clip) { |
96 MovieTrackingStabilization *stab= &clip->tracking.stabilization; | 145 MovieTrackingStabilization *stab= &clip->tracking.stabilization; |
97 | 146 |
98 stab->ok= 0; | 147 stab->ok= 0; |
99 } | 148 } |
100 } | 149 } |
101 | 150 |
102 /* ******************** default callbacks for clip space ***************** */ | 151 /* ******************** default callbacks for clip space ***************** */ |
103 | 152 |
104 static SpaceLink *clip_new(const bContext *UNUSED(C)) | 153 static SpaceLink *clip_new(const bContext *C) |
105 { | 154 { |
106 ARegion *ar; | 155 ARegion *ar; |
107 SpaceClip *sc; | 156 SpaceClip *sc; |
108 | 157 |
109 sc= MEM_callocN(sizeof(SpaceClip), "initclip"); | 158 sc= MEM_callocN(sizeof(SpaceClip), "initclip"); |
110 sc->spacetype= SPACE_CLIP; | 159 sc->spacetype= SPACE_CLIP; |
111 » sc->flag= SC_SHOW_MARKER_PATTERN|SC_SHOW_TRACK_PATH|SC_SHOW_GPENCIL|SC_M
ANUAL_CALIBRATION; | 160 » sc->flag= SC_SHOW_MARKER_PATTERN|SC_SHOW_TRACK_PATH|SC_SHOW_GPENCIL|SC_M
ANUAL_CALIBRATION|SC_SHOW_GRAPH_TRACKS|SC_SHOW_GRAPH_FRAMES; |
112 sc->zoom= 1.0f; | 161 sc->zoom= 1.0f; |
113 sc->path_length= 20; | 162 sc->path_length= 20; |
114 sc->scopes.track_preview_height= 120; | 163 sc->scopes.track_preview_height= 120; |
115 | 164 |
116 /* header */ | 165 /* header */ |
117 ar= MEM_callocN(sizeof(ARegion), "header for clip"); | 166 ar= MEM_callocN(sizeof(ARegion), "header for clip"); |
118 | 167 |
119 BLI_addtail(&sc->regionbase, ar); | 168 BLI_addtail(&sc->regionbase, ar); |
120 ar->regiontype= RGN_TYPE_HEADER; | 169 ar->regiontype= RGN_TYPE_HEADER; |
121 ar->alignment= RGN_ALIGN_BOTTOM; | 170 ar->alignment= RGN_ALIGN_BOTTOM; |
122 | 171 |
123 /* tools view */ | 172 /* tools view */ |
124 » ar= MEM_callocN(sizeof(ARegion), "tools for logic"); | 173 » ar= MEM_callocN(sizeof(ARegion), "tools for clip"); |
125 | 174 |
126 BLI_addtail(&sc->regionbase, ar); | 175 BLI_addtail(&sc->regionbase, ar); |
127 ar->regiontype= RGN_TYPE_TOOLS; | 176 ar->regiontype= RGN_TYPE_TOOLS; |
128 ar->alignment= RGN_ALIGN_LEFT; | 177 ar->alignment= RGN_ALIGN_LEFT; |
129 | 178 |
130 /* tool properties */ | 179 /* tool properties */ |
131 ar= MEM_callocN(sizeof(ARegion), "tool properties for clip"); | 180 ar= MEM_callocN(sizeof(ARegion), "tool properties for clip"); |
132 | 181 |
133 BLI_addtail(&sc->regionbase, ar); | 182 BLI_addtail(&sc->regionbase, ar); |
134 ar->regiontype= RGN_TYPE_TOOL_PROPS; | 183 ar->regiontype= RGN_TYPE_TOOL_PROPS; |
135 ar->alignment= RGN_ALIGN_BOTTOM|RGN_SPLIT_PREV; | 184 ar->alignment= RGN_ALIGN_BOTTOM|RGN_SPLIT_PREV; |
136 | 185 |
137 /* properties view */ | 186 /* properties view */ |
138 » ar= MEM_callocN(sizeof(ARegion), "properties for logic"); | 187 » ar= MEM_callocN(sizeof(ARegion), "properties for clip"); |
139 | 188 |
140 BLI_addtail(&sc->regionbase, ar); | 189 BLI_addtail(&sc->regionbase, ar); |
141 ar->regiontype= RGN_TYPE_UI; | 190 ar->regiontype= RGN_TYPE_UI; |
142 ar->alignment= RGN_ALIGN_RIGHT; | 191 ar->alignment= RGN_ALIGN_RIGHT; |
| 192 |
| 193 /* preview view */ |
| 194 ar= MEM_callocN(sizeof(ARegion), "preview for clip"); |
| 195 |
| 196 BLI_addtail(&sc->regionbase, ar); |
| 197 init_preview_region(C, ar); |
143 | 198 |
144 /* main area */ | 199 /* main area */ |
145 ar= MEM_callocN(sizeof(ARegion), "main area for clip"); | 200 ar= MEM_callocN(sizeof(ARegion), "main area for clip"); |
146 | 201 |
147 BLI_addtail(&sc->regionbase, ar); | 202 BLI_addtail(&sc->regionbase, ar); |
148 ar->regiontype= RGN_TYPE_WINDOW; | 203 ar->regiontype= RGN_TYPE_WINDOW; |
149 | 204 |
150 return (SpaceLink *)sc; | 205 return (SpaceLink *)sc; |
151 } | 206 } |
152 | 207 |
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
443 WM_keymap_add_menu(keymap, "CLIP_MT_tracking_specials", WKEY, KM_PRESS,
0, 0); | 498 WM_keymap_add_menu(keymap, "CLIP_MT_tracking_specials", WKEY, KM_PRESS,
0, 0); |
444 | 499 |
445 /* display */ | 500 /* display */ |
446 kmi= WM_keymap_add_item(keymap, "WM_OT_context_toggle", LKEY, KM_PRESS,
0, 0); | 501 kmi= WM_keymap_add_item(keymap, "WM_OT_context_toggle", LKEY, KM_PRESS,
0, 0); |
447 RNA_string_set(kmi->ptr, "data_path", "space_data.lock_selection"); | 502 RNA_string_set(kmi->ptr, "data_path", "space_data.lock_selection"); |
448 | 503 |
449 kmi= WM_keymap_add_item(keymap, "WM_OT_context_toggle", MKEY, KM_PRESS,
0, 0); | 504 kmi= WM_keymap_add_item(keymap, "WM_OT_context_toggle", MKEY, KM_PRESS,
0, 0); |
450 RNA_string_set(kmi->ptr, "data_path", "space_data.use_mute_footage"); | 505 RNA_string_set(kmi->ptr, "data_path", "space_data.use_mute_footage"); |
451 | 506 |
452 transform_keymap_for_space(keyconf, keymap, SPACE_CLIP); | 507 transform_keymap_for_space(keyconf, keymap, SPACE_CLIP); |
| 508 |
| 509 /* ******** Hotkeys avalaible for preview region only ******** */ |
| 510 |
| 511 keymap= WM_keymap_find(keyconf, "Clip Graph Editor", SPACE_CLIP, 0); |
| 512 |
| 513 /* "timeline" */ |
| 514 WM_keymap_add_item(keymap, "CLIP_OT_change_frame", LEFTMOUSE, KM_PRESS,
0, 0); |
453 } | 515 } |
454 | 516 |
455 const char *clip_context_dir[]= {"edit_movieclip", NULL}; | 517 const char *clip_context_dir[]= {"edit_movieclip", NULL}; |
456 | 518 |
457 static int clip_context(const bContext *C, const char *member, bContextDataResul
t *result) | 519 static int clip_context(const bContext *C, const char *member, bContextDataResul
t *result) |
458 { | 520 { |
459 SpaceClip *sc= CTX_wm_space_clip(C); | 521 SpaceClip *sc= CTX_wm_space_clip(C); |
460 | 522 |
461 if(CTX_data_dir(member)) { | 523 if(CTX_data_dir(member)) { |
462 CTX_data_dir_set(result, clip_context_dir); | 524 CTX_data_dir_set(result, clip_context_dir); |
463 return 1; | 525 return 1; |
464 } | 526 } |
465 else if(CTX_data_equals(member, "edit_movieclip")) { | 527 else if(CTX_data_equals(member, "edit_movieclip")) { |
466 CTX_data_id_pointer_set(result, &sc->clip->id); | 528 CTX_data_id_pointer_set(result, &sc->clip->id); |
467 return 1; | 529 return 1; |
468 } | 530 } |
469 | 531 |
470 return 0; | 532 return 0; |
471 } | 533 } |
472 | 534 |
473 static void clip_refresh(const bContext *C, ScrArea *UNUSED(sa)) | 535 static void clip_refresh(const bContext *C, ScrArea *sa) |
474 { | 536 { |
475 » SpaceClip *sc= CTX_wm_space_clip(C); | 537 » wmWindowManager *wm= CTX_wm_manager(C); |
| 538 » wmWindow *window= CTX_wm_window(C); |
| 539 » SpaceClip *sc= (SpaceClip *)sa->spacedata.first; |
| 540 » ARegion *ar_main= BKE_area_find_region_type(sa, RGN_TYPE_WINDOW); |
| 541 » ARegion *ar_preview= clip_has_preview_region(C, sa); |
| 542 » int view_changed= 0; |
| 543 |
| 544 » switch (sc->view) { |
| 545 » » case SC_VIEW_CLIP: |
| 546 » » » if (ar_preview && !(ar_preview->flag & RGN_FLAG_HIDDEN))
{ |
| 547 » » » » ar_preview->flag |= RGN_FLAG_HIDDEN; |
| 548 » » » » ar_preview->v2d.flag &= ~V2D_IS_INITIALISED; |
| 549 » » » » WM_event_remove_handlers((bContext*)C, &ar_previ
ew->handlers); |
| 550 » » » » view_changed= 1; |
| 551 » » » } |
| 552 » » » if (ar_main && ar_main->alignment != RGN_ALIGN_NONE) { |
| 553 » » » » ar_main->alignment= RGN_ALIGN_NONE; |
| 554 » » » » view_changed= 1; |
| 555 » » » } |
| 556 » » » if (ar_preview && ar_preview->alignment != RGN_ALIGN_NON
E) { |
| 557 » » » » ar_preview->alignment= RGN_ALIGN_NONE; |
| 558 » » » » view_changed= 1; |
| 559 » » » } |
| 560 » » » break; |
| 561 » » case SC_VIEW_GRAPH: |
| 562 » » » if (ar_preview && (ar_preview->flag & RGN_FLAG_HIDDEN))
{ |
| 563 » » » » ar_preview->flag &= ~RGN_FLAG_HIDDEN; |
| 564 » » » » ar_preview->v2d.flag &= ~V2D_IS_INITIALISED; |
| 565 » » » » ar_preview->v2d.cur = ar_preview->v2d.tot; |
| 566 » » » » view_changed= 1; |
| 567 » » » } |
| 568 » » » if (ar_main && ar_main->alignment != RGN_ALIGN_NONE) { |
| 569 » » » » ar_main->alignment= RGN_ALIGN_NONE; |
| 570 » » » » view_changed= 1; |
| 571 » » » } |
| 572 » » » if (ar_preview && ar_preview->alignment != RGN_ALIGN_TOP
) { |
| 573 » » » » ar_preview->alignment= RGN_ALIGN_TOP; |
| 574 » » » » view_changed= 1; |
| 575 » » » } |
| 576 » » » break; |
| 577 » } |
| 578 |
| 579 » if(view_changed) { |
| 580 » » ED_area_initialize(wm, window, sa); |
| 581 » » ED_area_tag_redraw(sa); |
| 582 » } |
476 | 583 |
477 BKE_movieclip_user_set_frame(&sc->user, CTX_data_scene(C)->r.cfra); | 584 BKE_movieclip_user_set_frame(&sc->user, CTX_data_scene(C)->r.cfra); |
478 } | 585 } |
479 | 586 |
480 /********************* main region ********************/ | 587 /********************* main region ********************/ |
481 | 588 |
482 /* sets up the fields of the View2D from zoom and offset */ | 589 /* sets up the fields of the View2D from zoom and offset */ |
483 static void movieclip_main_area_set_view2d(SpaceClip *sc, ARegion *ar) | 590 static void movieclip_main_area_set_view2d(SpaceClip *sc, ARegion *ar) |
484 { | 591 { |
485 MovieClip *clip= ED_space_clip(sc); | 592 MovieClip *clip= ED_space_clip(sc); |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
552 | 659 |
553 /* if trcking is in progress, we should sunchronize framenr from clipuse
r | 660 /* if trcking is in progress, we should sunchronize framenr from clipuse
r |
554 so latest tracked frame would be shown */ | 661 so latest tracked frame would be shown */ |
555 if(clip && clip->tracking_context) | 662 if(clip && clip->tracking_context) |
556 BKE_tracking_sync_user(&sc->user, clip->tracking_context); | 663 BKE_tracking_sync_user(&sc->user, clip->tracking_context); |
557 | 664 |
558 if(sc->flag&SC_LOCK_SELECTION) { | 665 if(sc->flag&SC_LOCK_SELECTION) { |
559 ImBuf *tmpibuf= NULL; | 666 ImBuf *tmpibuf= NULL; |
560 | 667 |
561 if(clip && clip->tracking.stabilization.flag&TRACKING_2D_STABILI
ZATION) { | 668 if(clip && clip->tracking.stabilization.flag&TRACKING_2D_STABILI
ZATION) { |
562 » » » tmpibuf= ED_space_clip_acquire_stable_buffer(sc, NULL, N
ULL, NULL); | 669 » » » tmpibuf= ED_space_clip_get_stable_buffer(sc, NULL, NULL,
NULL); |
563 } | 670 } |
564 | 671 |
565 ED_clip_view_selection(sc, ar, 0); | 672 ED_clip_view_selection(sc, ar, 0); |
| 673 |
| 674 sc->xof+= sc->xlockof; |
| 675 sc->yof+= sc->ylockof; |
566 | 676 |
567 if(tmpibuf) | 677 if(tmpibuf) |
568 IMB_freeImBuf(tmpibuf); | 678 IMB_freeImBuf(tmpibuf); |
569 } | 679 } |
570 | 680 |
571 /* clear and setup matrix */ | 681 /* clear and setup matrix */ |
572 UI_ThemeClearColor(TH_BACK); | 682 UI_ThemeClearColor(TH_BACK); |
573 glClear(GL_COLOR_BUFFER_BIT); | 683 glClear(GL_COLOR_BUFFER_BIT); |
574 | 684 |
575 /* data... */ | 685 /* data... */ |
(...skipping 13 matching lines...) Expand all Loading... |
589 | 699 |
590 static void clip_main_area_listener(ARegion *ar, wmNotifier *wmn) | 700 static void clip_main_area_listener(ARegion *ar, wmNotifier *wmn) |
591 { | 701 { |
592 /* context changes */ | 702 /* context changes */ |
593 switch(wmn->category) { | 703 switch(wmn->category) { |
594 case NC_SCREEN: | 704 case NC_SCREEN: |
595 if (wmn->data==ND_GPENCIL) | 705 if (wmn->data==ND_GPENCIL) |
596 ED_region_tag_redraw(ar); | 706 ED_region_tag_redraw(ar); |
597 break; | 707 break; |
598 } | 708 } |
| 709 } |
| 710 |
| 711 /****************** preview region ******************/ |
| 712 |
| 713 static void clip_preview_area_init(wmWindowManager *wm, ARegion *ar) |
| 714 { |
| 715 wmKeyMap *keymap; |
| 716 |
| 717 UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_CUSTOM, ar->winx, ar->w
iny); |
| 718 |
| 719 /* own keymap */ |
| 720 keymap= WM_keymap_find(wm->defaultconf, "Clip", SPACE_CLIP, 0); |
| 721 WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar
->winrct); |
| 722 |
| 723 keymap= WM_keymap_find(wm->defaultconf, "Clip Graph Editor", SPACE_CLIP,
0); |
| 724 WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar
->winrct); |
| 725 } |
| 726 |
| 727 static void clip_preview_area_draw(const bContext *C, ARegion *ar) |
| 728 { |
| 729 View2D *v2d= &ar->v2d; |
| 730 View2DScrollers *scrollers; |
| 731 SpaceClip *sc= CTX_wm_space_clip(C); |
| 732 Scene *scene= CTX_data_scene(C); |
| 733 short unitx= V2D_UNIT_FRAMESCALE, unity= V2D_UNIT_VALUES; |
| 734 |
| 735 /* clear and setup matrix */ |
| 736 UI_ThemeClearColor(TH_BACK); |
| 737 glClear(GL_COLOR_BUFFER_BIT); |
| 738 |
| 739 UI_view2d_view_ortho(v2d); |
| 740 |
| 741 /* data... */ |
| 742 draw_clip_graph(sc, ar, scene); |
| 743 |
| 744 /* reset view matrix */ |
| 745 UI_view2d_view_restore(C); |
| 746 |
| 747 /* scrollers */ |
| 748 scrollers= UI_view2d_scrollers_calc(C, v2d, unitx, V2D_GRID_NOCLAMP, uni
ty, V2D_GRID_NOCLAMP); |
| 749 UI_view2d_scrollers_draw(C, v2d, scrollers); |
| 750 UI_view2d_scrollers_free(scrollers); |
| 751 } |
| 752 |
| 753 static void clip_preview_area_listener(ARegion *UNUSED(ar), wmNotifier *UNUSED(w
mn)) |
| 754 { |
599 } | 755 } |
600 | 756 |
601 /****************** header region ******************/ | 757 /****************** header region ******************/ |
602 | 758 |
603 /* add handlers, stuff you only do once or on area/region changes */ | 759 /* add handlers, stuff you only do once or on area/region changes */ |
604 static void clip_header_area_init(wmWindowManager *UNUSED(wm), ARegion *ar) | 760 static void clip_header_area_init(wmWindowManager *UNUSED(wm), ARegion *ar) |
605 { | 761 { |
606 ED_region_header_init(ar); | 762 ED_region_header_init(ar); |
607 } | 763 } |
608 | 764 |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
707 st->context= clip_context; | 863 st->context= clip_context; |
708 st->refresh= clip_refresh; | 864 st->refresh= clip_refresh; |
709 | 865 |
710 /* regions: main window */ | 866 /* regions: main window */ |
711 art= MEM_callocN(sizeof(ARegionType), "spacetype clip region"); | 867 art= MEM_callocN(sizeof(ARegionType), "spacetype clip region"); |
712 art->regionid= RGN_TYPE_WINDOW; | 868 art->regionid= RGN_TYPE_WINDOW; |
713 art->init= clip_main_area_init; | 869 art->init= clip_main_area_init; |
714 art->draw= clip_main_area_draw; | 870 art->draw= clip_main_area_draw; |
715 art->listener= clip_main_area_listener; | 871 art->listener= clip_main_area_listener; |
716 art->keymapflag= ED_KEYMAP_FRAMES|ED_KEYMAP_UI|ED_KEYMAP_GPENCIL; | 872 art->keymapflag= ED_KEYMAP_FRAMES|ED_KEYMAP_UI|ED_KEYMAP_GPENCIL; |
| 873 |
| 874 BLI_addhead(&st->regiontypes, art); |
| 875 |
| 876 /* preview */ |
| 877 art= MEM_callocN(sizeof(ARegionType), "spacetype clip region preview"); |
| 878 art->regionid = RGN_TYPE_PREVIEW; |
| 879 art->prefsizey = 240; |
| 880 art->init= clip_preview_area_init; |
| 881 art->draw= clip_preview_area_draw; |
| 882 art->listener= clip_preview_area_listener; |
| 883 art->keymapflag= ED_KEYMAP_FRAMES|ED_KEYMAP_UI|ED_KEYMAP_VIEW2D; |
717 | 884 |
718 BLI_addhead(&st->regiontypes, art); | 885 BLI_addhead(&st->regiontypes, art); |
719 | 886 |
720 /* regions: properties */ | 887 /* regions: properties */ |
721 art= MEM_callocN(sizeof(ARegionType), "spacetype clip region properties"
); | 888 art= MEM_callocN(sizeof(ARegionType), "spacetype clip region properties"
); |
722 art->regionid= RGN_TYPE_UI; | 889 art->regionid= RGN_TYPE_UI; |
723 art->prefsizex= UI_COMPACT_PANEL_WIDTH; | 890 art->prefsizex= UI_COMPACT_PANEL_WIDTH; |
724 art->keymapflag= ED_KEYMAP_FRAMES|ED_KEYMAP_UI; | 891 art->keymapflag= ED_KEYMAP_FRAMES|ED_KEYMAP_UI; |
725 art->init= clip_properties_area_init; | 892 art->init= clip_properties_area_init; |
726 art->draw= clip_properties_area_draw; | 893 art->draw= clip_properties_area_draw; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
758 art->prefsizey= HEADERY; | 925 art->prefsizey= HEADERY; |
759 art->keymapflag= ED_KEYMAP_FRAMES|ED_KEYMAP_UI|ED_KEYMAP_VIEW2D|ED_KEYMA
P_HEADER; | 926 art->keymapflag= ED_KEYMAP_FRAMES|ED_KEYMAP_UI|ED_KEYMAP_VIEW2D|ED_KEYMA
P_HEADER; |
760 | 927 |
761 art->init= clip_header_area_init; | 928 art->init= clip_header_area_init; |
762 art->draw= clip_header_area_draw; | 929 art->draw= clip_header_area_draw; |
763 | 930 |
764 BLI_addhead(&st->regiontypes, art); | 931 BLI_addhead(&st->regiontypes, art); |
765 | 932 |
766 BKE_spacetype_register(st); | 933 BKE_spacetype_register(st); |
767 } | 934 } |
LEFT | RIGHT |