Blender  V3.3
space_sequencer.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2008 Blender Foundation. All rights reserved. */
3 
8 #include <math.h>
9 #include <stdio.h>
10 #include <string.h>
11 
12 #include "DNA_mask_types.h"
13 #include "DNA_scene_types.h"
14 
15 #include "MEM_guardedalloc.h"
16 
17 #include "BLI_blenlib.h"
18 #include "BLI_ghash.h"
19 #include "BLI_math_base.h"
20 
21 #include "BKE_global.h"
22 #include "BKE_lib_remap.h"
23 #include "BKE_screen.h"
25 
26 #include "GPU_state.h"
27 
28 #include "ED_markers.h"
29 #include "ED_screen.h"
30 #include "ED_space_api.h"
31 #include "ED_time_scrub_ui.h"
32 #include "ED_transform.h"
33 #include "ED_view3d.h"
34 #include "ED_view3d_offscreen.h" /* Only for sequencer view3d drawing callback. */
35 
36 #include "WM_api.h"
37 #include "WM_message.h"
38 
39 #include "SEQ_sequencer.h"
40 #include "SEQ_time.h"
41 #include "SEQ_transform.h"
42 #include "SEQ_utils.h"
43 
44 #include "UI_interface.h"
45 #include "UI_view2d.h"
46 
47 #include "IMB_imbuf.h"
48 
49 /* Only for cursor drawing. */
50 #include "DRW_engine.h"
51 
52 /* Own include. */
53 #include "sequencer_intern.h"
54 
55 /**************************** common state *****************************/
56 
58 {
59  SpaceSeq *sseq = (SpaceSeq *)area->spacedata.first;
60 
61  sseq->scopes.reference_ibuf = NULL;
62 }
63 
64 /* ******************** manage regions ********************* */
65 
67 {
68  ARegion *region = NULL;
69 
70  for (region = area->regionbase.first; region; region = region->next) {
71  if (region->regiontype == type) {
72  return region;
73  }
74  }
75 
76  return region;
77 }
78 
79 /* ******************** default callbacks for sequencer space ***************** */
80 
82 {
83  ARegion *region;
84  SpaceSeq *sseq;
85 
86  sseq = MEM_callocN(sizeof(SpaceSeq), "initsequencer");
87  sseq->spacetype = SPACE_SEQ;
88  sseq->chanshown = 0;
89  sseq->view = SEQ_VIEW_SEQUENCE;
90  sseq->mainb = SEQ_DRAW_IMG_IMBUF;
96 
97  BLI_rctf_init(&sseq->runtime.last_thumbnail_area, 0.0f, 0.0f, 0.0f, 0.0f);
99 
100  /* Header. */
101  region = MEM_callocN(sizeof(ARegion), "header for sequencer");
102 
103  BLI_addtail(&sseq->regionbase, region);
104  region->regiontype = RGN_TYPE_HEADER;
106 
107  /* Tool header. */
108  region = MEM_callocN(sizeof(ARegion), "tool header for sequencer");
109 
110  BLI_addtail(&sseq->regionbase, region);
114 
115  /* Buttons/list view. */
116  region = MEM_callocN(sizeof(ARegion), "buttons for sequencer");
117 
118  BLI_addtail(&sseq->regionbase, region);
119  region->regiontype = RGN_TYPE_UI;
120  region->alignment = RGN_ALIGN_RIGHT;
121  region->flag = RGN_FLAG_HIDDEN;
122 
123  /* Toolbar. */
124  region = MEM_callocN(sizeof(ARegion), "tools for sequencer");
125 
126  BLI_addtail(&sseq->regionbase, region);
127  region->regiontype = RGN_TYPE_TOOLS;
128  region->alignment = RGN_ALIGN_LEFT;
129  region->flag = RGN_FLAG_HIDDEN;
131 
132  /* Channels. */
133  region = MEM_callocN(sizeof(ARegion), "channels for sequencer");
134 
135  BLI_addtail(&sseq->regionbase, region);
136  region->regiontype = RGN_TYPE_CHANNELS;
137  region->alignment = RGN_ALIGN_LEFT;
138 
139  /* Preview region. */
140  /* NOTE: if you change values here, also change them in sequencer_init_preview_region. */
141  region = MEM_callocN(sizeof(ARegion), "preview region for sequencer");
142  BLI_addtail(&sseq->regionbase, region);
143  region->regiontype = RGN_TYPE_PREVIEW;
144  region->alignment = RGN_ALIGN_TOP;
145  region->flag |= RGN_FLAG_HIDDEN;
146  /* For now, aspect ratio should be maintained, and zoom is clamped within sane default limits. */
148  region->v2d.minzoom = 0.001f;
149  region->v2d.maxzoom = 1000.0f;
150  region->v2d.tot.xmin = -960.0f; /* 1920 width centered. */
151  region->v2d.tot.ymin = -540.0f; /* 1080 height centered. */
152  region->v2d.tot.xmax = 960.0f;
153  region->v2d.tot.ymax = 540.0f;
154  region->v2d.min[0] = 0.0f;
155  region->v2d.min[1] = 0.0f;
156  region->v2d.max[0] = 12000.0f;
157  region->v2d.max[1] = 12000.0f;
158  region->v2d.cur = region->v2d.tot;
159  region->v2d.align = V2D_ALIGN_FREE;
160  region->v2d.keeptot = V2D_KEEPTOT_FREE;
161 
162  /* Main region. */
163  region = MEM_callocN(sizeof(ARegion), "main region for sequencer");
164 
165  BLI_addtail(&sseq->regionbase, region);
166  region->regiontype = RGN_TYPE_WINDOW;
167 
168  /* Seq space goes from (0,8) to (0, efra). */
169  region->v2d.tot.xmin = 0.0f;
170  region->v2d.tot.ymin = 0.0f;
171  region->v2d.tot.xmax = scene->r.efra;
172  region->v2d.tot.ymax = 8.5f;
173 
174  region->v2d.cur = region->v2d.tot;
175 
176  region->v2d.min[0] = 10.0f;
177  region->v2d.min[1] = 1.0f;
178 
179  region->v2d.max[0] = MAXFRAMEF;
180  region->v2d.max[1] = MAXSEQ;
181 
182  region->v2d.minzoom = 0.01f;
183  region->v2d.maxzoom = 100.0f;
184 
187  region->v2d.keepzoom = 0;
188  region->v2d.keeptot = 0;
190  region->v2d.align = V2D_ALIGN_NO_NEG_Y;
191 
193 
194  return (SpaceLink *)sseq;
195 }
196 
197 /* Not spacelink itself. */
198 static void sequencer_free(SpaceLink *sl)
199 {
200  SpaceSeq *sseq = (SpaceSeq *)sl;
201  SequencerScopes *scopes = &sseq->scopes;
202 
203  /* XXX if (sseq->gpd) BKE_gpencil_free_data(sseq->gpd); */
204 
205  if (scopes->zebra_ibuf) {
206  IMB_freeImBuf(scopes->zebra_ibuf);
207  }
208 
209  if (scopes->waveform_ibuf) {
210  IMB_freeImBuf(scopes->waveform_ibuf);
211  }
212 
213  if (scopes->sep_waveform_ibuf) {
215  }
216 
217  if (scopes->vector_ibuf) {
218  IMB_freeImBuf(scopes->vector_ibuf);
219  }
220 
221  if (scopes->histogram_ibuf) {
222  IMB_freeImBuf(scopes->histogram_ibuf);
223  }
224 
229  }
230 }
231 
232 /* Spacetype init callback. */
234 {
235 }
236 
237 static void sequencer_refresh(const bContext *C, ScrArea *area)
238 {
240  wmWindow *window = CTX_wm_window(C);
241  SpaceSeq *sseq = (SpaceSeq *)area->spacedata.first;
244  bool view_changed = false;
245 
246  switch (sseq->view) {
247  case SEQ_VIEW_SEQUENCE:
248  if (region_main && (region_main->flag & RGN_FLAG_HIDDEN)) {
249  region_main->flag &= ~RGN_FLAG_HIDDEN;
250  region_main->v2d.flag &= ~V2D_IS_INIT;
251  view_changed = true;
252  }
253  if (region_preview && !(region_preview->flag & RGN_FLAG_HIDDEN)) {
254  region_preview->flag |= RGN_FLAG_HIDDEN;
255  region_preview->v2d.flag &= ~V2D_IS_INIT;
256  WM_event_remove_handlers((bContext *)C, &region_preview->handlers);
257  view_changed = true;
258  }
259  if (region_main && region_main->alignment != RGN_ALIGN_NONE) {
260  region_main->alignment = RGN_ALIGN_NONE;
261  view_changed = true;
262  }
263  if (region_preview && region_preview->alignment != RGN_ALIGN_NONE) {
264  region_preview->alignment = RGN_ALIGN_NONE;
265  view_changed = true;
266  }
267  break;
268  case SEQ_VIEW_PREVIEW:
269  if (region_main && !(region_main->flag & RGN_FLAG_HIDDEN)) {
270  region_main->flag |= RGN_FLAG_HIDDEN;
271  region_main->v2d.flag &= ~V2D_IS_INIT;
272  WM_event_remove_handlers((bContext *)C, &region_main->handlers);
273  view_changed = true;
274  }
275  if (region_preview && (region_preview->flag & RGN_FLAG_HIDDEN)) {
276  region_preview->flag &= ~RGN_FLAG_HIDDEN;
277  region_preview->v2d.flag &= ~V2D_IS_INIT;
278  region_preview->v2d.cur = region_preview->v2d.tot;
279  view_changed = true;
280  }
281  if (region_main && region_main->alignment != RGN_ALIGN_NONE) {
282  region_main->alignment = RGN_ALIGN_NONE;
283  view_changed = true;
284  }
285  if (region_preview && region_preview->alignment != RGN_ALIGN_NONE) {
286  region_preview->alignment = RGN_ALIGN_NONE;
287  view_changed = true;
288  }
289  break;
291  if (region_main && region_preview) {
292  /* Get available height (without DPI correction). */
293  const float height = (area->winy - ED_area_headersize()) / UI_DPI_FAC;
294 
295  /* We reuse hidden region's size, allows to find same layout as before if we just switch
296  * between one 'full window' view and the combined one. This gets lost if we switch to both
297  * 'full window' views before, though... Better than nothing. */
298  if (region_main->flag & RGN_FLAG_HIDDEN) {
299  region_main->flag &= ~RGN_FLAG_HIDDEN;
300  region_main->v2d.flag &= ~V2D_IS_INIT;
301  region_preview->sizey = (int)(height - region_main->sizey);
302  view_changed = true;
303  }
304  if (region_preview->flag & RGN_FLAG_HIDDEN) {
305  region_preview->flag &= ~RGN_FLAG_HIDDEN;
306  region_preview->v2d.flag &= ~V2D_IS_INIT;
307  region_preview->v2d.cur = region_preview->v2d.tot;
308  region_main->sizey = (int)(height - region_preview->sizey);
309  view_changed = true;
310  }
311  if (region_main->alignment != RGN_ALIGN_NONE) {
312  region_main->alignment = RGN_ALIGN_NONE;
313  view_changed = true;
314  }
315  if (region_preview->alignment != RGN_ALIGN_TOP) {
316  region_preview->alignment = RGN_ALIGN_TOP;
317  view_changed = true;
318  }
319  /* Final check that both preview and main height are reasonable. */
320  if (region_preview->sizey < 10 || region_main->sizey < 10 ||
321  region_preview->sizey + region_main->sizey > height) {
322  region_preview->sizey = roundf(height * 0.4f);
323  region_main->sizey = (int)(height - region_preview->sizey);
324  view_changed = true;
325  }
326  }
327  break;
328  }
329 
331  if (sseq->view == SEQ_VIEW_SEQUENCE) {
332  if (region_channels && (region_channels->flag & RGN_FLAG_HIDDEN)) {
333  region_channels->flag &= ~RGN_FLAG_HIDDEN;
334  region_channels->v2d.flag &= ~V2D_IS_INIT;
335  view_changed = true;
336  }
337  if (region_channels && region_channels->alignment != RGN_ALIGN_LEFT) {
338  region_channels->alignment = RGN_ALIGN_LEFT;
339  view_changed = true;
340  }
341  }
342  else {
343  if (region_channels && !(region_channels->flag & RGN_FLAG_HIDDEN)) {
344  region_channels->flag |= RGN_FLAG_HIDDEN;
345  region_channels->v2d.flag &= ~V2D_IS_INIT;
346  WM_event_remove_handlers((bContext *)C, &region_channels->handlers);
347  view_changed = true;
348  }
349  if (region_channels && region_channels->alignment != RGN_ALIGN_NONE) {
350  region_channels->alignment = RGN_ALIGN_NONE;
351  view_changed = true;
352  }
353  }
354 
355  if (view_changed) {
356  ED_area_init(wm, window, area);
358  }
359 }
360 
362 {
363  SpaceSeq *sseqn = MEM_dupallocN(sl);
364 
365  /* Clear or remove stuff from old. */
366  /* XXX sseq->gpd = gpencil_data_duplicate(sseq->gpd, false); */
367 
368  memset(&sseqn->scopes, 0, sizeof(sseqn->scopes));
369  memset(&sseqn->runtime, 0, sizeof(sseqn->runtime));
370 
371  return (SpaceLink *)sseqn;
372 }
373 
375 {
376  ScrArea *area = params->area;
377  wmNotifier *wmn = params->notifier;
378 
379  /* Context changes. */
380  switch (wmn->category) {
381  case NC_SCENE:
382  switch (wmn->data) {
383  case ND_FRAME:
384  case ND_SEQUENCER:
386  break;
387  }
388  break;
389  case NC_WINDOW:
390  case NC_SPACE:
391  if (wmn->data == ND_SPACE_SEQUENCER) {
393  }
394  break;
395  case NC_GPENCIL:
396  if (wmn->data & ND_GPENCIL_EDITMODE) {
398  }
399  break;
400  }
401 }
402 
403 /* DO NOT make this static, this hides the symbol and breaks API generation script. */
404 extern const char *sequencer_context_dir[]; /* Quiet warning. */
405 const char *sequencer_context_dir[] = {"edit_mask", NULL};
406 
407 static int /*eContextResult*/ sequencer_context(const bContext *C,
408  const char *member,
410 {
412 
413  if (CTX_data_dir(member)) {
415 
416  return CTX_RESULT_OK;
417  }
418  if (CTX_data_equals(member, "edit_mask")) {
420  if (mask) {
422  }
423  return CTX_RESULT_OK;
424  }
425 
427 }
428 
430 {
431  VIEW2D_GGT_navigate_impl(gzgt, "SEQUENCER_GGT_navigate");
432 }
433 
435 {
436  gzgt->name = "Sequencer Transform Gizmo";
437  gzgt->idname = "SEQUENCER_GGT_gizmo2d";
438 
441 
444 
446 }
447 
449 {
450  gzgt->name = "Sequencer Translate Gizmo";
451  gzgt->idname = "SEQUENCER_GGT_gizmo2d_translate";
452 
455 
458 
460 }
461 
463 {
464  gzgt->name = "Sequencer Transform Gizmo Resize";
465  gzgt->idname = "SEQUENCER_GGT_gizmo2d_resize";
466 
469 
472 
474 }
475 
477 {
478  gzgt->name = "Sequencer Transform Gizmo Resize";
479  gzgt->idname = "SEQUENCER_GGT_gizmo2d_rotate";
480 
483 
486 
488 }
489 
490 static void sequencer_gizmos(void)
491 {
494 
499 
501 }
502 
503 /* *********************** sequencer (main) region ************************ */
504 /* Add handlers, stuff you only do once or on area/region changes. */
506 {
507  wmKeyMap *keymap;
508  ListBase *lb;
509 
510  UI_view2d_region_reinit(&region->v2d, V2D_COMMONVIEW_CUSTOM, region->winx, region->winy);
511 
512 #if 0
513  keymap = WM_keymap_ensure(wm->defaultconf, "Mask Editing", 0, 0);
515 #endif
516 
517  keymap = WM_keymap_ensure(wm->defaultconf, "SequencerCommon", SPACE_SEQ, 0);
519 
520  /* Own keymap. */
521  keymap = WM_keymap_ensure(wm->defaultconf, "Sequencer", SPACE_SEQ, 0);
523 
524  /* Add drop boxes. */
525  lb = WM_dropboxmap_find("Sequencer", SPACE_SEQ, RGN_TYPE_WINDOW);
526 
528 }
529 
530 /* Strip editing timeline. */
531 static void sequencer_main_region_draw(const bContext *C, ARegion *region)
532 {
533  draw_timeline_seq(C, region);
534 }
535 
536 /* Strip editing timeline. */
538 {
539  draw_timeline_seq_display(C, region);
540 }
541 
542 static void sequencer_main_clamp_view(const bContext *C, ARegion *region)
543 {
544  SpaceSeq *sseq = CTX_wm_space_seq(C);
545 
546  if ((sseq->flag & SEQ_CLAMP_VIEW) == 0) {
547  return;
548  }
549 
550  View2D *v2d = &region->v2d;
553 
554  if (ed == NULL) {
555  return;
556  }
557 
558  /* Transformation uses edge panning to move view. Also if smooth view is running, don't apply
559  * clamping to prevent overriding this functionality. */
560  if (G.moving || v2d->smooth_timer != NULL) {
561  return;
562  }
563 
564  /* Initialize default view with 7 channels, that are visible even if empty. */
565  rctf strip_boundbox;
566  BLI_rctf_init(&strip_boundbox, 0.0f, 0.0f, 1.0f, 7.0f);
567  SEQ_timeline_expand_boundbox(scene, ed->seqbasep, &strip_boundbox);
568 
569  /* Clamp Y max. Scrubbing area height must be added, so strips aren't occluded. */
570  rcti scrub_rect;
571  ED_time_scrub_region_rect_get(region, &scrub_rect);
572  const float pixel_view_size_y = BLI_rctf_size_y(&v2d->cur) / BLI_rcti_size_y(&v2d->mask);
573  const float scrub_bar_height = BLI_rcti_size_y(&scrub_rect) * pixel_view_size_y;
574 
575  /* Channel n has range of <n, n+1>. */
576  strip_boundbox.ymax += 1.0f + scrub_bar_height;
577 
578  /* Clamp Y min. Scroller and marker area height must be added, so strips aren't occluded. */
579  float scroll_bar_height = v2d->hor.ymax * pixel_view_size_y;
580 
583  float markers_size = UI_MARKER_MARGIN_Y * pixel_view_size_y;
584  strip_boundbox.ymin -= markers_size;
585  }
586  else {
587  strip_boundbox.ymin -= scroll_bar_height;
588  }
589 
590  /* If strip is deleted, don't move view automatically, keep current range until it is changed. */
591  strip_boundbox.ymax = max_ff(sseq->runtime.timeline_clamp_custom_range, strip_boundbox.ymax);
592 
593  rctf view_clamped = v2d->cur;
594 
595  const float range_y = BLI_rctf_size_y(&view_clamped);
596  if (view_clamped.ymax > strip_boundbox.ymax) {
597  view_clamped.ymax = strip_boundbox.ymax;
598  view_clamped.ymin = max_ff(strip_boundbox.ymin, strip_boundbox.ymax - range_y);
599  }
600  if (view_clamped.ymin < strip_boundbox.ymin) {
601  view_clamped.ymin = strip_boundbox.ymin;
602  view_clamped.ymax = min_ff(strip_boundbox.ymax, strip_boundbox.ymin + range_y);
603  }
604 
605  v2d->cur = view_clamped;
606 }
607 
609 {
610  SpaceSeq *sseq = CTX_wm_space_seq(C);
611  View2D *v2d = &region->v2d;
612 
613  if ((v2d->flag & V2D_IS_NAVIGATING) == 0) {
615  }
616 }
617 
618 static void sequencer_main_region_layout(const bContext *C, ARegion *region)
619 {
621  sequencer_main_clamp_view(C, region);
622 }
623 
625 {
627  sequencer_main_clamp_view(C, region);
628 }
629 
631 {
632  ARegion *region = params->region;
633  wmNotifier *wmn = params->notifier;
634 
635  /* Context changes. */
636  switch (wmn->category) {
637  case NC_SCENE:
638  switch (wmn->data) {
639  case ND_FRAME:
640  case ND_FRAME_RANGE:
641  case ND_MARKERS:
642  case ND_RENDER_OPTIONS: /* For FPS and FPS Base. */
643  case ND_SEQUENCER:
644  case ND_RENDER_RESULT:
645  ED_region_tag_redraw(region);
646  break;
647  }
648  break;
649  case NC_ANIMATION:
650  switch (wmn->data) {
651  case ND_KEYFRAME:
652  ED_region_tag_redraw(region);
653  break;
654  }
655  break;
656  case NC_SPACE:
657  if (wmn->data == ND_SPACE_SEQUENCER) {
658  ED_region_tag_redraw(region);
659  }
660  break;
661  case NC_ID:
662  if (wmn->action == NA_RENAME) {
663  ED_region_tag_redraw(region);
664  }
665  break;
666  case NC_SCREEN:
667  if (ELEM(wmn->data, ND_ANIMPLAY)) {
668  ED_region_tag_redraw(region);
669  }
670  break;
671  }
672 }
673 
675 {
676  struct wmMsgBus *mbus = params->message_bus;
677  Scene *scene = params->scene;
678  ARegion *region = params->region;
679 
680  wmMsgSubscribeValue msg_sub_value_region_tag_redraw = {
681  .owner = region,
682  .user_data = region,
684  };
685 
686  /* Timeline depends on scene properties. */
687  {
688  bool use_preview = (scene->r.flag & SCER_PRV_RANGE);
689  const PropertyRNA *props[] = {
690  use_preview ? &rna_Scene_frame_preview_start : &rna_Scene_frame_start,
691  use_preview ? &rna_Scene_frame_preview_end : &rna_Scene_frame_end,
692  &rna_Scene_use_preview_range,
693  &rna_Scene_frame_current,
694  };
695 
696  PointerRNA idptr;
697  RNA_id_pointer_create(&scene->id, &idptr);
698 
699  for (int i = 0; i < ARRAY_SIZE(props); i++) {
700  WM_msg_subscribe_rna(mbus, &idptr, props[i], &msg_sub_value_region_tag_redraw, __func__);
701  }
702  }
703 
704  {
705  StructRNA *type_array[] = {
706  &RNA_SequenceEditor,
707 
708  &RNA_Sequence,
709  /* Members of 'Sequence'. */
710  &RNA_SequenceCrop,
711  &RNA_SequenceTransform,
712  &RNA_SequenceModifier,
713  &RNA_SequenceColorBalanceData,
714  };
715  wmMsgParams_RNA msg_key_params = {{0}};
716  for (int i = 0; i < ARRAY_SIZE(type_array); i++) {
717  msg_key_params.ptr.type = type_array[i];
719  mbus, &msg_key_params, &msg_sub_value_region_tag_redraw, __func__);
720  }
721  }
722 }
723 
724 /* *********************** header region ************************ */
725 /* Add handlers, stuff you only do once or on area/region changes. */
727 {
728  ED_region_header_init(region);
729 }
730 
731 static void sequencer_header_region_draw(const bContext *C, ARegion *region)
732 {
733  ED_region_header(C, region);
734 }
735 
736 /* *********************** toolbar region ************************ */
737 /* Add handlers, stuff you only do once or on area/region changes. */
739 {
740  wmKeyMap *keymap;
741 
743  ED_region_panels_init(wm, region);
744 
745  keymap = WM_keymap_ensure(wm->defaultconf, "SequencerCommon", SPACE_SEQ, 0);
747 }
748 
749 static void sequencer_tools_region_draw(const bContext *C, ARegion *region)
750 {
751  ED_region_panels(C, region);
752 }
753 /* *********************** preview region ************************ */
755 {
756  wmKeyMap *keymap;
757 
758  UI_view2d_region_reinit(&region->v2d, V2D_COMMONVIEW_CUSTOM, region->winx, region->winy);
759 
760 #if 0
761  keymap = WM_keymap_ensure(wm->defaultconf, "Mask Editing", 0, 0);
763 #endif
764 
765  keymap = WM_keymap_ensure(wm->defaultconf, "SequencerCommon", SPACE_SEQ, 0);
767 
768  /* Own keymap. */
769  keymap = WM_keymap_ensure(wm->defaultconf, "SequencerPreview", SPACE_SEQ, 0);
771 
774 }
775 
776 static void sequencer_preview_region_layout(const bContext *C, ARegion *region)
777 {
778  SpaceSeq *sseq = CTX_wm_space_seq(C);
779 
780  if (sseq->flag & SEQ_ZOOM_TO_FIT) {
781  View2D *v2d = &region->v2d;
782  v2d->cur = v2d->tot;
783  }
784 }
785 
787 {
788  SpaceSeq *sseq = CTX_wm_space_seq(C);
789  sseq->flag &= ~SEQ_ZOOM_TO_FIT;
790 }
791 
792 static bool is_cursor_visible(const SpaceSeq *sseq)
793 {
794  if (G.moving & G_TRANSFORM_CURSOR) {
795  return true;
796  }
797 
798  if ((sseq->flag & SEQ_SHOW_OVERLAY) &&
800  return true;
801  }
802  return false;
803 }
804 
805 static void sequencer_preview_region_draw(const bContext *C, ARegion *region)
806 {
808  SpaceSeq *sseq = area->spacedata.first;
811  const bool draw_overlay = sseq->flag & SEQ_SHOW_OVERLAY;
812  const bool draw_frame_overlay = (scene->ed &&
814  draw_overlay);
815  const bool is_playing = ED_screen_animation_playing(wm);
816 
817  if (!(draw_frame_overlay && (sseq->overlay_frame_type == SEQ_OVERLAY_FRAME_TYPE_REFERENCE))) {
818  sequencer_draw_preview(C, scene, region, sseq, scene->r.cfra, 0, false, false);
819  }
820 
821  if (draw_frame_overlay && sseq->overlay_frame_type != SEQ_OVERLAY_FRAME_TYPE_CURRENT) {
822  int over_cfra;
823 
825  over_cfra = scene->ed->overlay_frame_abs;
826  }
827  else {
828  over_cfra = scene->r.cfra + scene->ed->overlay_frame_ofs;
829  }
830 
831  if ((over_cfra != scene->r.cfra) ||
834  C, scene, region, sseq, scene->r.cfra, over_cfra - scene->r.cfra, true, false);
835  }
836  }
837 
838  /* No need to show the cursor for scopes. */
839  if ((is_playing == false) && (sseq->mainb == SEQ_DRAW_IMG_IMBUF) && is_cursor_visible(sseq)) {
840  GPU_color_mask(true, true, true, true);
841  GPU_depth_mask(false);
843 
844  float cursor_pixel[2];
845  SEQ_image_preview_unit_to_px(scene, sseq->cursor, cursor_pixel);
846 
847  DRW_draw_cursor_2d_ex(region, cursor_pixel);
848  }
849 
850  if ((is_playing == false) && (sseq->gizmo_flag & SEQ_GIZMO_HIDE) == 0) {
852  }
853 
854  if ((U.uiflag & USER_SHOW_FPS) && ED_screen_animation_no_scrub(wm)) {
855  const rcti *rect = ED_region_visible_rect(region);
856  int xoffset = rect->xmin + U.widget_unit;
857  int yoffset = rect->ymax;
858  ED_scene_draw_fps(scene, xoffset, &yoffset);
859  }
860 }
861 
863 {
864  ARegion *region = params->region;
865  wmNotifier *wmn = params->notifier;
866 
868 
869  /* Context changes. */
870  switch (wmn->category) {
871  case NC_GPENCIL:
872  if (ELEM(wmn->action, NA_EDITED, NA_SELECTED)) {
873  ED_region_tag_redraw(region);
874  }
875  break;
876  case NC_SCENE:
877  switch (wmn->data) {
878  case ND_FRAME:
879  case ND_MARKERS:
880  case ND_SEQUENCER:
881  case ND_RENDER_OPTIONS:
883  ED_region_tag_redraw(region);
884  break;
885  }
886  break;
887  case NC_ANIMATION:
888  switch (wmn->data) {
889  case ND_KEYFRAME:
890  ED_region_tag_redraw(region);
891  break;
892  }
893  break;
894  case NC_SPACE:
895  if (wmn->data == ND_SPACE_SEQUENCER) {
896  ED_region_tag_redraw(region);
897  }
898  break;
899  case NC_ID:
900  switch (wmn->data) {
901  case NA_RENAME:
902  ED_region_tag_redraw(region);
903  break;
904  }
905  break;
906  case NC_MASK:
907  if (wmn->action == NA_EDITED) {
908  ED_region_tag_redraw(region);
909  }
910  break;
911  }
912 }
913 
914 /* *********************** buttons region ************************ */
915 
916 /* Add handlers, stuff you only do once or on area/region changes. */
918 {
919  wmKeyMap *keymap;
920 
921  keymap = WM_keymap_ensure(wm->defaultconf, "SequencerCommon", SPACE_SEQ, 0);
923 
924  UI_panel_category_active_set_default(region, "Strip");
925  ED_region_panels_init(wm, region);
926 }
927 
928 static void sequencer_buttons_region_draw(const bContext *C, ARegion *region)
929 {
930  ED_region_panels(C, region);
931 }
932 
934 {
935  ARegion *region = params->region;
936  wmNotifier *wmn = params->notifier;
937 
938  /* Context changes. */
939  switch (wmn->category) {
940  case NC_GPENCIL:
941  if (ELEM(wmn->action, NA_EDITED, NA_SELECTED)) {
942  ED_region_tag_redraw(region);
943  }
944  break;
945  case NC_SCENE:
946  switch (wmn->data) {
947  case ND_FRAME:
948  case ND_SEQUENCER:
949  ED_region_tag_redraw(region);
950  break;
951  }
952  break;
953  case NC_SPACE:
954  if (wmn->data == ND_SPACE_SEQUENCER) {
955  ED_region_tag_redraw(region);
956  }
957  break;
958  case NC_ID:
959  if (wmn->action == NA_RENAME) {
960  ED_region_tag_redraw(region);
961  }
962  break;
963  }
964 }
965 
967  SpaceLink *slink,
968  const struct IDRemapper *mappings)
969 {
970  SpaceSeq *sseq = (SpaceSeq *)slink;
971  BKE_id_remapper_apply(mappings, (ID **)&sseq->gpd, ID_REMAP_APPLY_DEFAULT);
972 }
973 
974 /* ************************************* */
975 
976 /* add handlers, stuff you only do once or on area/region changes */
978 {
979  wmKeyMap *keymap;
980 
981  region->alignment = RGN_ALIGN_LEFT;
982 
983  UI_view2d_region_reinit(&region->v2d, V2D_COMMONVIEW_LIST, region->winx, region->winy);
984 
985  keymap = WM_keymap_ensure(wm->defaultconf, "Sequencer Channels", SPACE_SEQ, 0);
987 }
988 
989 static void sequencer_channel_region_draw(const bContext *C, ARegion *region)
990 {
991  draw_channels(C, region);
992 }
993 
995 {
996  SpaceType *st = MEM_callocN(sizeof(SpaceType), "spacetype sequencer");
997  ARegionType *art;
998 
999  st->spaceid = SPACE_SEQ;
1000  strncpy(st->name, "Sequencer", BKE_ST_MAXNAME);
1001 
1002  st->create = sequencer_create;
1003  st->free = sequencer_free;
1004  st->init = sequencer_init;
1005  st->duplicate = sequencer_duplicate;
1006  st->operatortypes = sequencer_operatortypes;
1007  st->keymap = sequencer_keymap;
1008  st->context = sequencer_context;
1009  st->gizmos = sequencer_gizmos;
1010  st->dropboxes = sequencer_dropboxes;
1011  st->refresh = sequencer_refresh;
1012  st->listener = sequencer_listener;
1013  st->id_remap = sequencer_id_remap;
1014 
1015  /* Create regions: */
1016  /* Main window. */
1017  art = MEM_callocN(sizeof(ARegionType), "spacetype sequencer region");
1018  art->regionid = RGN_TYPE_WINDOW;
1026  /* NOTE: inclusion of #ED_KEYMAP_GIZMO is currently for scripts and isn't used by default. */
1029  BLI_addhead(&st->regiontypes, art);
1030 
1031  /* Preview. */
1032  art = MEM_callocN(sizeof(ARegionType), "spacetype sequencer region");
1033  art->regionid = RGN_TYPE_PREVIEW;
1041  BLI_addhead(&st->regiontypes, art);
1042 
1043  /* Listview/buttons. */
1044  art = MEM_callocN(sizeof(ARegionType), "spacetype sequencer region");
1045  art->regionid = RGN_TYPE_UI;
1046  art->prefsizex = UI_SIDEBAR_PANEL_WIDTH * 1.3f;
1052  BLI_addhead(&st->regiontypes, art);
1053 
1055  /* Toolbar. */
1056  art = MEM_callocN(sizeof(ARegionType), "spacetype sequencer tools region");
1057  art->regionid = RGN_TYPE_TOOLS;
1058  art->prefsizex = 58; /* XXX */
1059  art->prefsizey = 50; /* XXX */
1065  BLI_addhead(&st->regiontypes, art);
1066 
1067  /* Channels. */
1068  art = MEM_callocN(sizeof(ARegionType), "spacetype sequencer channels");
1069  art->regionid = RGN_TYPE_CHANNELS;
1071  art->keymapflag = ED_KEYMAP_UI;
1075  BLI_addhead(&st->regiontypes, art);
1076 
1077  /* Tool header. */
1078  art = MEM_callocN(sizeof(ARegionType), "spacetype sequencer tool header region");
1080  art->prefsizey = HEADERY;
1086  BLI_addhead(&st->regiontypes, art);
1087 
1088  /* Header. */
1089  art = MEM_callocN(sizeof(ARegionType), "spacetype sequencer region");
1090  art->regionid = RGN_TYPE_HEADER;
1091  art->prefsizey = HEADERY;
1093 
1097  BLI_addhead(&st->regiontypes, art);
1098 
1099  /* HUD. */
1100  art = ED_area_type_hud(st->spaceid);
1101  BLI_addhead(&st->regiontypes, art);
1102 
1104 
1105  /* Set the sequencer callback when not in background mode. */
1106  if (G.background == 0) {
1108  }
1109 }
struct ScrArea * CTX_wm_area(const bContext *C)
Definition: context.c:738
struct Scene * CTX_data_scene(const bContext *C)
Definition: context.c:1090
void CTX_data_dir_set(bContextDataResult *result, const char **dir)
Definition: context.c:696
bool CTX_data_equals(const char *member, const char *str)
Definition: context.c:634
void CTX_data_id_pointer_set(bContextDataResult *result, struct ID *id)
Definition: context.c:644
bool CTX_data_dir(const char *member)
Definition: context.c:639
struct wmWindowManager * CTX_wm_manager(const bContext *C)
Definition: context.c:713
struct SpaceSeq * CTX_wm_space_seq(const bContext *C)
Definition: context.c:851
@ CTX_RESULT_MEMBER_NOT_FOUND
Definition: BKE_context.h:75
@ CTX_RESULT_OK
Definition: BKE_context.h:72
struct wmWindow * CTX_wm_window(const bContext *C)
Definition: context.c:723
@ G_TRANSFORM_CURSOR
Definition: BKE_global.h:257
@ ID_REMAP_APPLY_DEFAULT
IDRemapperApplyResult BKE_id_remapper_apply(const struct IDRemapper *id_remapper, struct ID **r_id_ptr, IDRemapperApplyOptions options)
#define BKE_ST_MAXNAME
Definition: BKE_screen.h:53
void BKE_spacetype_register(struct SpaceType *st)
Definition: screen.c:391
SequencerDrawView sequencer_view3d_fn
Definition: render.c:82
void BLI_ghash_free(GHash *gh, GHashKeyFreeFP keyfreefp, GHashValFreeFP valfreefp)
Definition: BLI_ghash.c:863
BLI_INLINE bool BLI_listbase_is_empty(const struct ListBase *lb)
Definition: BLI_listbase.h:269
void BLI_addhead(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition: listbase.c:60
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition: listbase.c:80
MINLINE float max_ff(float a, float b)
MINLINE float min_ff(float a, float b)
BLI_INLINE int BLI_rcti_size_y(const struct rcti *rct)
Definition: BLI_rect.h:190
void BLI_rctf_init(struct rctf *rect, float xmin, float xmax, float ymin, float ymax)
Definition: rct.c:407
BLI_INLINE float BLI_rctf_size_y(const struct rctf *rct)
Definition: BLI_rect.h:198
#define ARRAY_SIZE(arr)
#define UNUSED(x)
#define ELEM(...)
#define SCER_PRV_RANGE
#define MAXFRAMEF
#define HEADERY
@ RGN_FLAG_HIDDEN
@ RGN_FLAG_HIDDEN_BY_USER
@ RGN_TYPE_CHANNELS
@ RGN_TYPE_TOOL_HEADER
@ RGN_TYPE_UI
@ RGN_TYPE_WINDOW
@ RGN_TYPE_PREVIEW
@ RGN_TYPE_HEADER
@ RGN_TYPE_TOOLS
@ RGN_ALIGN_BOTTOM
@ RGN_ALIGN_LEFT
@ RGN_ALIGN_TOP
@ RGN_ALIGN_RIGHT
@ RGN_ALIGN_NONE
#define SEQ_EDIT_OVERLAY_FRAME_ABS
#define SEQ_EDIT_OVERLAY_FRAME_SHOW
#define MAXSEQ
@ SPACE_SEQ
@ SEQ_TIMELINE_SHOW_FCURVES
@ SEQ_TIMELINE_SHOW_STRIP_DURATION
@ SEQ_TIMELINE_SHOW_STRIP_SOURCE
@ SEQ_TIMELINE_SHOW_STRIP_NAME
@ SEQ_TIMELINE_SHOW_GRID
@ SEQ_TIMELINE_SHOW_STRIP_COLOR_TAG
@ SEQ_GIZMO_HIDE
@ SEQ_VIEW_SEQUENCE_PREVIEW
@ SEQ_VIEW_SEQUENCE
@ SEQ_VIEW_PREVIEW
@ SEQ_PREVIEW_SHOW_GPENCIL
@ SEQ_PREVIEW_SHOW_OUTLINE_SELECTED
@ SEQ_PREVIEW_SHOW_2D_CURSOR
@ SEQ_OVERLAY_FRAME_TYPE_RECT
@ SEQ_OVERLAY_FRAME_TYPE_CURRENT
@ SEQ_OVERLAY_FRAME_TYPE_REFERENCE
@ SEQ_DRAW_IMG_IMBUF
@ SEQ_SHOW_MARKERS
@ SEQ_USE_ALPHA
@ SEQ_ZOOM_TO_FIT
@ SEQ_CLAMP_VIEW
@ SEQ_SHOW_OVERLAY
@ USER_SHOW_FPS
@ USER_HEADER_BOTTOM
@ V2D_KEEPTOT_FREE
@ V2D_LIMITZOOM
@ V2D_KEEPZOOM
@ V2D_KEEPASPECT
@ V2D_IS_NAVIGATING
@ V2D_IS_INIT
@ V2D_VIEWSYNC_AREA_VERTICAL
@ V2D_SCROLL_VERTICAL_HIDE
@ V2D_SCROLL_VERTICAL_HANDLES
@ V2D_SCROLL_RIGHT
@ V2D_SCROLL_BOTTOM
@ V2D_SCROLL_HORIZONTAL_HANDLES
@ V2D_ALIGN_NO_NEG_Y
@ V2D_ALIGN_FREE
void DRW_draw_cursor_2d_ex(const struct ARegion *region, const float cursor[2])
void ED_area_tag_redraw(ScrArea *area)
Definition: area.c:729
@ ED_KEYMAP_UI
Definition: ED_screen.h:691
@ ED_KEYMAP_ANIMATION
Definition: ED_screen.h:695
@ ED_KEYMAP_HEADER
Definition: ED_screen.h:697
@ ED_KEYMAP_TOOL
Definition: ED_screen.h:693
@ ED_KEYMAP_GPENCIL
Definition: ED_screen.h:699
@ ED_KEYMAP_GIZMO
Definition: ED_screen.h:692
@ ED_KEYMAP_VIEW2D
Definition: ED_screen.h:694
@ ED_KEYMAP_FRAMES
Definition: ED_screen.h:696
bScreen * ED_screen_animation_no_scrub(const struct wmWindowManager *wm)
void ED_region_header(const struct bContext *C, struct ARegion *region)
void ED_region_do_msg_notify_tag_redraw(struct bContext *C, struct wmMsgSubscribeKey *msg_key, struct wmMsgSubscribeValue *msg_val)
void ED_area_do_mgs_subscribe_for_tool_ui(const struct wmRegionMessageSubscribeParams *params)
int ED_region_generic_tools_region_snap_size(const struct ARegion *region, int size, int axis)
void ED_region_generic_tools_region_message_subscribe(const struct wmRegionMessageSubscribeParams *params)
int ED_area_headersize(void)
Definition: area.c:3422
void ED_region_panels(const struct bContext *C, struct ARegion *region)
void ED_area_do_mgs_subscribe_for_tool_header(const struct wmRegionMessageSubscribeParams *params)
struct ARegionType * ED_area_type_hud(int space_type)
bScreen * ED_screen_animation_playing(const struct wmWindowManager *wm)
void ED_region_panels_init(struct wmWindowManager *wm, struct ARegion *region)
Definition: area.c:3153
void ED_region_tag_redraw(struct ARegion *region)
Definition: area.c:655
void ED_region_header_init(struct ARegion *region)
Definition: area.c:3417
void ED_area_init(struct wmWindowManager *wm, struct wmWindow *win, struct ScrArea *area)
Definition: area.c:1902
const rcti * ED_region_visible_rect(ARegion *region)
Definition: area.c:3763
void ED_widgetgroup_gizmo2d_xform_no_cage_callbacks_set(struct wmGizmoGroupType *gzgt)
void ED_widgetgroup_gizmo2d_xform_callbacks_set(struct wmGizmoGroupType *gzgt)
void ED_widgetgroup_gizmo2d_rotate_callbacks_set(struct wmGizmoGroupType *gzgt)
void ED_widgetgroup_gizmo2d_resize_callbacks_set(struct wmGizmoGroupType *gzgt)
void ED_scene_draw_fps(const struct Scene *scene, int xoffset, int *yoffset)
struct ImBuf * ED_view3d_draw_offscreen_imbuf_simple(struct Depsgraph *depsgraph, struct Scene *scene, struct View3DShading *shading_override, eDrawType drawtype, struct Object *camera, int width, int height, eImBufFlags imbuf_flags, eV3DOffscreenDrawFlag draw_flags, int alpha_mode, const char *viewname, struct GPUOffScreen *ofs, char err_out[256])
Definition: view3d_draw.c:1980
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei height
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum type
void GPU_depth_mask(bool depth)
Definition: gpu_state.cc:107
void GPU_color_mask(bool r, bool g, bool b, bool a)
Definition: gpu_state.cc:95
@ GPU_DEPTH_NONE
Definition: GPU_state.h:83
void GPU_depth_test(eGPUDepthTest test)
Definition: gpu_state.cc:65
Read Guarded memory(de)allocation.
#define C
Definition: RandGen.cpp:25
void UI_panel_category_active_set_default(struct ARegion *region, const char *idname)
#define UI_SIDEBAR_PANEL_WIDTH
Definition: UI_interface.h:242
#define UI_DPI_FAC
Definition: UI_interface.h:305
#define UI_COMPACT_PANEL_WIDTH
Definition: UI_interface.h:241
void VIEW2D_GGT_navigate_impl(struct wmGizmoGroupType *gzgt, const char *idname)
#define UI_MARKER_MARGIN_Y
Definition: UI_view2d.h:449
void UI_view2d_region_reinit(struct View2D *v2d, short type, int winx, int winy)
Definition: view2d.cc:217
@ V2D_COMMONVIEW_LIST
Definition: UI_view2d.h:38
@ V2D_COMMONVIEW_CUSTOM
Definition: UI_view2d.h:34
@ WM_GIZMOMAP_DRAWSTEP_2D
@ WM_GIZMOGROUPTYPE_TOOL_FALLBACK_KEYMAP
@ WM_GIZMOGROUPTYPE_DELAY_REFRESH_FOR_TWEAK
#define ND_SEQUENCER
Definition: WM_types.h:385
#define ND_SPACE_SEQUENCER
Definition: WM_types.h:478
#define NC_WINDOW
Definition: WM_types.h:325
#define NC_ID
Definition: WM_types.h:345
#define ND_RENDER_RESULT
Definition: WM_types.h:394
#define ND_GPENCIL_EDITMODE
Definition: WM_types.h:451
#define ND_RENDER_OPTIONS
Definition: WM_types.h:383
#define NC_ANIMATION
Definition: WM_types.h:338
#define NC_SCREEN
Definition: WM_types.h:327
#define ND_ANIMPLAY
Definition: WM_types.h:372
#define NC_SCENE
Definition: WM_types.h:328
#define NA_EDITED
Definition: WM_types.h:523
#define ND_FRAME_RANGE
Definition: WM_types.h:399
#define ND_MARKERS
Definition: WM_types.h:381
#define ND_FRAME
Definition: WM_types.h:382
#define NC_GPENCIL
Definition: WM_types.h:349
#define NC_MASK
Definition: WM_types.h:348
#define NA_RENAME
Definition: WM_types.h:527
#define ND_KEYFRAME
Definition: WM_types.h:442
#define NC_SPACE
Definition: WM_types.h:342
#define NA_SELECTED
Definition: WM_types.h:528
#define ND_DRAW_RENDER_VIEWPORT
Definition: WM_types.h:418
ListBase * ED_context_get_markers(const bContext *C)
Definition: anim_markers.c:88
unsigned int U
Definition: btGjkEpa3.h:78
Scene scene
void IMB_freeImBuf(ImBuf *UNUSED(ibuf))
const vector< Marker > & markers
uiWidgetBaseParameters params[MAX_WIDGET_BASE_BATCH]
void *(* MEM_dupallocN)(const void *vmemh)
Definition: mallocn.c:28
void *(* MEM_callocN)(size_t len, const char *str)
Definition: mallocn.c:31
ccl_device_inline float4 mask(const int4 &mask, const float4 &a)
Definition: math_float4.h:513
#define G(x, y, z)
static void area(int d1, int d2, int e1, int e2, float weights[2])
static const pxr::TfToken st("st", pxr::TfToken::Immortal)
void RNA_id_pointer_create(ID *id, PointerRNA *r_ptr)
Definition: rna_access.c:112
Editing * SEQ_editing_get(const Scene *scene)
Definition: sequencer.c:241
void sequencer_buttons_register(ARegionType *art)
void draw_channels(const bContext *C, ARegion *region)
void sequencer_dropboxes(void)
void draw_timeline_seq_display(const bContext *C, ARegion *region)
void sequencer_draw_preview(const bContext *C, Scene *scene, ARegion *region, SpaceSeq *sseq, int timeline_frame, int offset, bool draw_overlay, bool draw_backdrop)
void draw_timeline_seq(const bContext *C, ARegion *region)
void last_displayed_thumbnails_list_free(void *val)
void sequencer_operatortypes(void)
Definition: sequencer_ops.c:22
void sequencer_keymap(struct wmKeyConfig *keyconf)
static void sequencer_main_region_view2d_changed(const bContext *C, ARegion *region)
static void sequencer_channel_region_init(wmWindowManager *wm, ARegion *region)
static void SEQUENCER_GGT_gizmo2d(wmGizmoGroupType *gzgt)
static void sequencer_preview_region_listener(const wmRegionListenerParams *params)
static SpaceLink * sequencer_duplicate(SpaceLink *sl)
static void sequencer_preview_region_view2d_changed(const bContext *C, ARegion *UNUSED(region))
static ARegion * sequencer_find_region(ScrArea *area, short type)
static void SEQUENCER_GGT_gizmo2d_rotate(wmGizmoGroupType *gzgt)
static void sequencer_listener(const wmSpaceTypeListenerParams *params)
static void sequencer_main_region_layout(const bContext *C, ARegion *region)
static void sequencer_main_region_init(wmWindowManager *wm, ARegion *region)
const char * sequencer_context_dir[]
static SpaceLink * sequencer_create(const ScrArea *UNUSED(area), const Scene *scene)
static void sequencer_preview_region_layout(const bContext *C, ARegion *region)
static void sequencer_main_region_listener(const wmRegionListenerParams *params)
static void sequencer_preview_region_draw(const bContext *C, ARegion *region)
static void sequencer_header_region_draw(const bContext *C, ARegion *region)
static void sequencer_main_region_draw_overlay(const bContext *C, ARegion *region)
static void sequencer_free(SpaceLink *sl)
static bool is_cursor_visible(const SpaceSeq *sseq)
static void sequencer_buttons_region_listener(const wmRegionListenerParams *params)
static void sequencer_header_region_init(wmWindowManager *UNUSED(wm), ARegion *region)
static void sequencer_main_clamp_view(const bContext *C, ARegion *region)
static void sequencer_channel_region_draw(const bContext *C, ARegion *region)
static void sequencer_preview_region_init(wmWindowManager *wm, ARegion *region)
static void SEQUENCER_GGT_gizmo2d_resize(wmGizmoGroupType *gzgt)
static void sequencer_main_region_draw(const bContext *C, ARegion *region)
static void SEQUENCER_GGT_gizmo2d_translate(wmGizmoGroupType *gzgt)
void ED_spacetype_sequencer(void)
static void sequencer_scopes_tag_refresh(ScrArea *area)
static void sequencer_init(struct wmWindowManager *UNUSED(wm), ScrArea *UNUSED(area))
static void sequencer_buttons_region_draw(const bContext *C, ARegion *region)
static void sequencer_main_region_message_subscribe(const wmRegionMessageSubscribeParams *params)
static void sequencer_refresh(const bContext *C, ScrArea *area)
static int sequencer_context(const bContext *C, const char *member, bContextDataResult *result)
static void SEQUENCER_GGT_navigate(wmGizmoGroupType *gzgt)
static void sequencer_id_remap(ScrArea *UNUSED(area), SpaceLink *slink, const struct IDRemapper *mappings)
static void sequencer_buttons_region_init(wmWindowManager *wm, ARegion *region)
static void sequencer_main_region_clamp_custom_set(const bContext *C, ARegion *region)
static void sequencer_gizmos(void)
static void sequencer_tools_region_draw(const bContext *C, ARegion *region)
static void sequencer_tools_region_init(wmWindowManager *wm, ARegion *region)
void SEQ_timeline_expand_boundbox(const Scene *scene, const ListBase *seqbase, rctf *rect)
Definition: strip_time.c:354
void SEQ_image_preview_unit_to_px(const Scene *scene, const float co_src[2], float co_dst[2])
void(* draw)(const struct bContext *C, struct ARegion *region)
Definition: BKE_screen.h:151
void(* message_subscribe)(const wmRegionMessageSubscribeParams *params)
Definition: BKE_screen.h:167
int(* snap_size)(const struct ARegion *region, int size, int axis)
Definition: BKE_screen.h:163
void(* draw_overlay)(const struct bContext *C, struct ARegion *region)
Definition: BKE_screen.h:159
void(* listener)(const wmRegionListenerParams *params)
Definition: BKE_screen.h:165
void(* on_view2d_changed)(const struct bContext *C, struct ARegion *region)
Definition: BKE_screen.h:192
int keymapflag
Definition: BKE_screen.h:208
void(* layout)(const struct bContext *C, struct ARegion *region)
Definition: BKE_screen.h:161
void(* init)(struct wmWindowManager *wm, struct ARegion *region)
Definition: BKE_screen.h:147
struct ARegion * next
ListBase handlers
short alignment
short regiontype
struct wmGizmoMap * gizmo_map
ListBase * seqbasep
int overlay_frame_flag
Definition: DNA_ID.h:368
struct StructRNA * type
Definition: RNA_types.h:37
struct Editing * ed
struct RenderData r
struct ImBuf * reference_ibuf
struct ImBuf * waveform_ibuf
struct ImBuf * sep_waveform_ibuf
struct ImBuf * zebra_ibuf
struct ImBuf * histogram_ibuf
struct ImBuf * vector_ibuf
float timeline_clamp_custom_range
struct GHash * last_displayed_thumbnails
struct rctf last_thumbnail_area
short chanshown
char overlay_frame_type
SpaceSeqRuntime runtime
struct SequencerScopes scopes
float cursor[2]
struct bGPdata * gpd
struct SequencerTimelineOverlay timeline_overlay
ListBase regionbase
struct SequencerPreviewOverlay preview_overlay
short flag
float minzoom
short align
short keeptot
float max[2]
short keepzoom
struct wmTimer * smooth_timer
float min[2]
short scroll
float maxzoom
float xmax
Definition: DNA_vec_types.h:69
float xmin
Definition: DNA_vec_types.h:69
float ymax
Definition: DNA_vec_types.h:70
float ymin
Definition: DNA_vec_types.h:70
int ymax
Definition: DNA_vec_types.h:64
int xmin
Definition: DNA_vec_types.h:63
const char * idname
eWM_GizmoFlagGroupTypeFlag flag
struct wmGizmoMapType_Params gzmap_params
const char * name
unsigned int data
Definition: WM_types.h:308
unsigned int action
Definition: WM_types.h:308
unsigned int category
Definition: WM_types.h:308
struct wmKeyConfig * defaultconf
void ED_time_scrub_region_rect_get(const ARegion *region, rcti *rect)
Definition: time_scrub_ui.c:35
Mask * SEQ_active_mask_get(Scene *scene)
Definition: utils.c:440
ListBase * WM_dropboxmap_find(const char *idname, int spaceid, int regionid)
Definition: wm_dragdrop.cc:76
wmEventHandler_Dropbox * WM_event_add_dropbox_handler(ListBase *handlers, ListBase *dropboxes)
wmEventHandler_Keymap * WM_event_add_keymap_handler_v2d_mask(ListBase *handlers, wmKeyMap *keymap)
void WM_event_remove_handlers(bContext *C, ListBase *handlers)
wmGizmoGroupTypeRef * WM_gizmogrouptype_append_and_link(wmGizmoMapType *gzmap_type, void(*wtfunc)(struct wmGizmoGroupType *))
wmGizmoGroupType * WM_gizmogrouptype_append(void(*wtfunc)(struct wmGizmoGroupType *))
wmGizmoMapType * WM_gizmomaptype_ensure(const struct wmGizmoMapType_Params *gzmap_params)
void WM_gizmomap_tag_refresh(wmGizmoMap *gzmap)
Definition: wm_gizmo_map.c:308
void WM_gizmomap_draw(wmGizmoMap *gzmap, const bContext *C, const eWM_GizmoFlagMapDrawStep drawstep)
Definition: wm_gizmo_map.c:483
wmKeyMap * WM_keymap_ensure(wmKeyConfig *keyconf, const char *idname, int spaceid, int regionid)
Definition: wm_keymap.c:852
void WM_msg_subscribe_rna_params(struct wmMsgBus *mbus, const wmMsgParams_RNA *msg_key_params, const wmMsgSubscribeValue *msg_val_params, const char *id_repr)
void WM_msg_subscribe_rna(struct wmMsgBus *mbus, PointerRNA *ptr, const PropertyRNA *prop, const wmMsgSubscribeValue *msg_val_params, const char *id_repr)