Blender V5.3
sequencer_drag_drop.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2022 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
10
11#include "MEM_guardedalloc.h"
12
13#include "DNA_scene_types.h"
14#include "DNA_sound_types.h"
15#include "DNA_text_types.h"
16
17#include "BLI_listbase.hh"
18#include "BLI_math_base_c.hh"
19#include "BLI_path_utils.hh"
20#include "BLI_string.hh"
21#include "BLI_string_ref.hh"
22#include "BLI_string_utf8.hh"
23#include "BLI_string_utils.hh"
24
25#include "BLT_translation.hh"
26
27#include "BKE_context.hh"
28#include "BKE_file_handler.hh"
29#include "BKE_image.hh"
30#include "BKE_main.hh"
31#include "BKE_mask.hh"
32#include "BKE_movieclip.hh"
33#include "BKE_text.h"
34
35#include "SEQ_add.hh"
36#include "SEQ_channels.hh"
37#include "SEQ_iterator.hh"
38#include "SEQ_sequencer.hh"
39#include "SEQ_transform.hh"
40
41#include "UI_interface_c.hh"
42#include "UI_resources.hh"
43#include "UI_view2d.hh"
44
45#include "GPU_matrix.hh"
46#include "GPU_state.hh"
47
48#include "ED_screen.hh"
49#include "ED_transform.hh"
50
52#include "IMB_imbuf_types.hh"
53
54#include "MOV_read.hh"
55
56#include "WM_api.hh"
57#include "WM_types.hh"
58
59/* For querying audio files. */
60#ifdef WITH_AUDASPACE
61# include "BKE_sound.hh"
62# include <Exception.h>
63# include <file/File.h>
64# include <file/FileManager.h>
65#endif
66
67/* Own include. */
68#include "sequencer_intern.hh"
70
71namespace blender::ed::vse {
72
90
91/* The current drag and drop API doesn't allow us to easily pass along the
92 * required custom data to all callbacks that need it. Especially when
93 * preloading data on drag start.
94 * Therefore we will for now use a global variable for this.
95 */
97
98static bool generic_poll_operations(const bContext *C, const wmEvent *event, uint8_t type)
99{
100 const Scene *sequencer_scene = CTX_data_sequencer_scene(C);
101 if (sequencer_scene == nullptr) {
102 return false;
103 }
104
105 const Scene *scene = CTX_data_scene(C);
106 const ToolSettings *ts = scene->toolsettings;
107
108 g_drop_coords.fps = sequencer_scene->frames_per_second();
109 g_drop_coords.type = type;
110 /* Ideally we would reuse the transform modal keymap for snapping, but drag and drop doesn't have
111 * access to transform engine, so just hard-code the invert key to a sane default. */
112 const bool do_invert = event->modifier & KM_CTRL;
113 g_drop_coords.use_snapping = do_invert ? (ts->snap_flag_seq & SCE_SNAP) == 0 :
114 (ts->snap_flag_seq & SCE_SNAP) != 0;
115 g_drop_coords.use_ripple = (event->modifier & KM_SHIFT) != 0;
116 return true;
117}
118
119/* While drag-and-drop in the sequencer, the internal drop-box implementation allows to have a drop
120 * preview of the file dragged. This checks when drag-and-drop is done with a single file, and when
121 * only a expected `file_handler` can be used, so internal drop-box can be used instead of the
122 * `file_handler`. */
123static bool test_single_file_handler_poll(const bContext *C, wmDrag *drag, StringRef file_handler)
124{
125 const auto paths = WM_drag_get_paths(drag);
127 return paths.size() == 1 && file_handlers.size() == 1 &&
128 file_handler == file_handlers[0]->idname;
129}
130
131static bool is_image(wmDrag *drag)
132{
133 if (drag->type == WM_DRAG_PATH) {
135 if (file_type == FILE_TYPE_IMAGE) {
136 return true;
137 }
138 }
139 if (WM_drag_is_ID_type(drag, ID_IM)) {
140 return true;
141 }
142 return false;
143}
144
145static bool image_drop_poll(bContext *C, wmDrag *drag, const wmEvent *event)
146{
147 if (is_image(drag) && (drag->type != WM_DRAG_PATH ||
148 test_single_file_handler_poll(C, drag, "SEQUENCER_FH_image_strip")))
149 {
150 return generic_poll_operations(C, event, TH_SEQ_IMAGE);
151 }
152
153 return false;
154}
155
156static bool is_movie(wmDrag *drag)
157{
158 if (drag->type == WM_DRAG_PATH) {
160 if (file_type == FILE_TYPE_MOVIE) {
161 return true;
162 }
163 }
164 return false;
165}
166
167static bool movie_drop_poll(bContext *C, wmDrag *drag, const wmEvent *event)
168{
169 if (is_movie(drag) && (drag->type != WM_DRAG_PATH ||
170 test_single_file_handler_poll(C, drag, "SEQUENCER_FH_movie_strip")))
171 {
172 return generic_poll_operations(C, event, TH_SEQ_MOVIE);
173 }
174
175 return false;
176}
177
178static bool movieclip_drop_poll(bContext *C, wmDrag *drag, const wmEvent *event)
179{
180 if (WM_drag_is_ID_type(drag, ID_MC)) {
182 }
183
184 return false;
185}
186
187static bool scene_drop_poll(bContext *C, wmDrag *drag, const wmEvent *event)
188{
189 const Scene *sequencer_scene = CTX_data_sequencer_scene(C);
190 if (sequencer_scene == nullptr) {
191 return false;
192 }
193
194 if (WM_drag_is_ID_type(drag, ID_SCE) &&
195 WM_drag_get_local_ID(drag, ID_SCE) != &sequencer_scene->id)
196 {
197 return generic_poll_operations(C, event, TH_SEQ_SCENE);
198 }
199
200 return false;
201}
202
203static bool mask_drop_poll(bContext *C, wmDrag *drag, const wmEvent *event)
204{
205 if (WM_drag_is_ID_type(drag, ID_MSK)) {
206 return generic_poll_operations(C, event, TH_SEQ_MASK);
207 }
208
209 return false;
210}
211
212static bool is_text(wmDrag *drag)
213{
214 if (drag->type == WM_DRAG_PATH) {
215 return WM_drag_get_paths(drag).size() == 1 &&
217 }
218 return WM_drag_is_ID_type(drag, ID_TXT);
219}
220
221static bool text_drop_poll(bContext *C, wmDrag *drag, const wmEvent *event)
222{
223 if (is_text(drag) && (drag->type != WM_DRAG_PATH ||
224 test_single_file_handler_poll(C, drag, "SEQUENCER_FH_text_strip")))
225 {
226 return generic_poll_operations(C, event, TH_SEQ_TEXT);
227 }
228
229 return false;
230}
231
232static bool color_drop_poll(bContext *C, wmDrag *drag, const wmEvent *event)
233{
234 if (drag->type == WM_DRAG_COLOR) {
235 return generic_poll_operations(C, event, TH_SEQ_COLOR);
236 }
237
238 return false;
239}
240
241static bool is_sound(wmDrag *drag)
242{
243 if (drag->type == WM_DRAG_PATH) {
245 if (file_type == FILE_TYPE_SOUND) {
246 return true;
247 }
248 }
249 if (WM_drag_is_ID_type(drag, ID_SO)) {
250 return true;
251 }
252 return false;
253}
254
255static bool sound_drop_poll(bContext *C, wmDrag *drag, const wmEvent *event)
256{
257 if (is_sound(drag) && (drag->type != WM_DRAG_PATH ||
258 test_single_file_handler_poll(C, drag, "SEQUENCER_FH_sound_strip")))
259 {
260 return generic_poll_operations(C, event, TH_SEQ_AUDIO);
261 }
262
263 return false;
264}
265
266static float update_overlay_strip_position_data(bContext *C, const int mval[2])
267{
268 SeqDropCoords *coords = &g_drop_coords;
269 ARegion *region = CTX_wm_region(C);
271 View2D *v2d = &region->v2d;
272
273 /* Update the position were we would place the strip if we complete the drag and drop action.
274 */
275 ui::view2d_region_to_view(v2d, mval[0], mval[1], &coords->start_frame, &coords->channel);
276 coords->start_frame = roundf(coords->start_frame);
277 if (coords->channel < 1.0f) {
278 coords->channel = 1;
279 }
280
281 float channel = coords->channel;
282 float start_frame = coords->start_frame;
283 float end_frame;
284 float strip_len;
285
286 if (coords->playback_rate != 0.0f) {
287 float scene_playback_rate = float(scene->r.frs_sec) / scene->r.frs_sec_base;
288 strip_len = coords->strip_length / (coords->playback_rate / scene_playback_rate);
289 }
290 else if (coords->only_audio) {
291 float scene_playback_rate = float(scene->r.frs_sec) / scene->r.frs_sec_base;
292 strip_len = coords->audio_length * scene_playback_rate;
293 }
294 else {
295 strip_len = coords->strip_length;
296 }
297
298 end_frame = coords->start_frame + strip_len;
299
300 if (coords->use_snapping) {
301 /* Do snapping via the existing transform code. */
302 int snap_delta;
303 float2 snap_point;
304
305 const bool valid_snap = transform::snap_sequencer_calc_drag_drop(
306 scene, region, start_frame, end_frame, channel, &snap_delta, &snap_point);
307
308 if (valid_snap) {
309 /* We snapped onto something! */
310 start_frame += snap_delta;
311 coords->start_frame = start_frame;
312 end_frame = start_frame + strip_len;
313 coords->snap_point = snap_point;
314 }
315 else {
316 /* Nothing was snapped to, disable snap drawing. */
317 coords->use_snapping = false;
318 }
319 }
320
321 /* Check if there is a strip that would intersect with the new strip(s). */
322 coords->is_intersecting = false;
323 Strip dummy_strip{};
324 dummy_strip.channel_set(coords->channel);
325 dummy_strip.start = coords->start_frame;
326 dummy_strip.content_length_set(coords->strip_length);
327 dummy_strip.speed_factor = 1.0f;
328 dummy_strip.media_playback_rate = coords->playback_rate;
329 dummy_strip.flag = SEQ_AUTO_PLAYBACK_RATE;
331
332 for (int i = 0; i < coords->num_channels && !coords->is_intersecting; i++) {
334 scene, ed->current_strips(), &dummy_strip);
335 dummy_strip.channel_set(dummy_strip.channel + 1);
336 }
337
338 return strip_len;
339}
340
341static void sequencer_drop_copy(bContext *C, wmDrag *drag, wmDropBox *drop)
342{
344
345 if (g_drop_coords.in_use) {
347 /* We didn't read the mouse position, so we need to do it manually here. */
348 int xy[2];
349 wmWindow *win = CTX_wm_window(C);
350 xy[0] = win->runtime->eventstate->xy[0];
351 xy[1] = win->runtime->eventstate->xy[1];
352
353 ARegion *region = CTX_wm_region(C);
354 int mval[2];
355 /* Convert mouse coordinates to region local coordinates. */
356 mval[0] = xy[0] - region->winrct.xmin;
357 mval[1] = xy[1] - region->winrct.ymin;
358
360 }
361
362 RNA_int_set(drop->ptr, "frame_start", g_drop_coords.start_frame);
363 RNA_int_set(drop->ptr, "channel", g_drop_coords.channel);
364 RNA_boolean_set(drop->ptr, "skip_locked_or_muted_channels", false);
365 RNA_enum_set(drop->ptr,
366 "overlap_mode",
369 }
370 else {
371 /* We are dropped inside the preview region. Put the strip on top of the
372 * current displayed frame. */
374 ListBaseT<Strip> *seqbase = seq::active_seqbase_get(ed);
375 ListBaseT<SeqTimelineChannel> *channels = seq::channels_displayed_get(ed);
376 SpaceSeq *sseq = CTX_wm_space_seq(C);
377
379 scene, channels, seqbase, scene->r.cfra, sseq->chanshown);
380
381 /* Get the top most strip channel that is in view. */
382 int max_channel = -1;
383 for (Strip *strip : strips) {
384 max_channel = max_ii(strip->channel, max_channel);
385 }
386
387 if (max_channel != -1) {
388 RNA_int_set(drop->ptr, "channel", max_channel);
389 }
390 if (CTX_wm_window(C)->runtime->eventstate->modifier & KM_SHIFT) {
391 RNA_enum_set(drop->ptr, "overlap_mode", SEQ_OVERLAP_RIPPLE);
392 }
393 }
394
395 if (drag->type == WM_DRAG_COLOR) {
396 const ui::DragColorHandle *drag_info = static_cast<ui::DragColorHandle *>(drag->poin);
397 float4 color = drag_info->color;
398 if (!drag_info->gamma_corrected) {
400 }
401
402 RNA_enum_set(drop->ptr, "type", STRIP_TYPE_COLOR);
403 RNA_float_set_array(drop->ptr, "color", color);
404 return;
405 }
406
408 /* ID dropped. */
409 if (id != nullptr) {
410 const ID_Type id_type = GS(id->name);
411 if (id_type == ID_IM) {
412 Image *ima = id_cast<Image *>(id);
413 PointerRNA itemptr;
414 char dir[FILE_MAX], file[FILE_MAX];
415 BLI_path_split_dir_file(ima->filepath, dir, sizeof(dir), file, sizeof(file));
416 RNA_string_set(drop->ptr, "directory", dir);
417 RNA_collection_clear(drop->ptr, "files");
418 RNA_collection_add(drop->ptr, "files", &itemptr);
419 RNA_string_set(&itemptr, "name", file);
420 }
421 else if (id_type == ID_MC) {
422 Main *bmain = CTX_data_main(C);
423 RNA_enum_set(drop->ptr, "clip", BLI_findindex(&bmain->movieclips, id));
424 }
425 else if (id_type == ID_SCE) {
426 Main *bmain = CTX_data_main(C);
427 RNA_enum_set(drop->ptr, "scene", BLI_findindex(&bmain->scenes, id));
428 }
429 else if (id_type == ID_MSK) {
430 Main *bmain = CTX_data_main(C);
431 RNA_enum_set(drop->ptr, "mask", BLI_findindex(&bmain->masks, id));
432 }
433 else if (id_type == ID_TXT) {
434 size_t buf_len;
435 char *buf = txt_to_buf(id_cast<Text *>(id), &buf_len);
436 RNA_string_set(drop->ptr, "text", buf);
437 MEM_delete(buf);
438 }
439 else if (id_type == ID_SO) {
440 bSound *sound = id_cast<bSound *>(id);
441 RNA_string_set(drop->ptr, "filepath", sound->filepath);
442 RNA_struct_property_unset(drop->ptr, "name");
443 }
444
445 return;
446 }
447
448 const char *path = WM_drag_get_single_path(drag);
449 /* Path dropped. */
450 if (path) {
451 if (RNA_struct_find_property(drop->ptr, "filepath")) {
452 RNA_string_set(drop->ptr, "filepath", path);
453 }
454 if (RNA_struct_find_property(drop->ptr, "directory")) {
455 PointerRNA itemptr;
456 char dir[FILE_MAX], file[FILE_MAX];
457
458 BLI_path_split_dir_file(path, dir, sizeof(dir), file, sizeof(file));
459
460 RNA_string_set(drop->ptr, "directory", dir);
461
462 RNA_collection_clear(drop->ptr, "files");
463 RNA_collection_add(drop->ptr, "files", &itemptr);
464 RNA_string_set(&itemptr, "name", file);
465 }
466 }
467}
468
470static bool get_drag_path(const bContext * /*C*/, wmDrag *drag, char r_path[FILE_MAX])
471{
472 if (drag->type == WM_DRAG_COLOR) {
473 BLI_strncpy(r_path, IFACE_("Color"), FILE_MAX);
474 return false;
475 }
476
477 if (const wmDragAsset *asset_drag = WM_drag_get_asset_data(drag, 0)) {
478 BLI_strncpy(r_path, asset_drag->asset->get_name().c_str(), FILE_MAX);
479 return false;
480 }
481
482 ID *id = WM_drag_get_local_ID(drag, 0);
483 /* ID dropped. */
484 if (id != nullptr) {
485 const ID_Type id_type = GS(id->name);
486 if (id_type == ID_IM) {
487 Image *ima = id_cast<Image *>(id);
488 BLI_strncpy(r_path, ima->filepath, FILE_MAX);
489 }
490 else if (id_type == ID_MC) {
491 MovieClip *clip = id_cast<MovieClip *>(id);
492 BLI_strncpy(r_path, clip->filepath, FILE_MAX);
493 }
494 else if (id_type == ID_SO) {
495 bSound *sound = id_cast<bSound *>(id);
496 BLI_strncpy(r_path, sound->filepath, FILE_MAX);
497 }
498 else {
499 BLI_strncpy(r_path, id->name + 2, FILE_MAX);
500 return false;
501 }
503 return true;
504 }
505
507 return true;
508}
509
510static void draw_strip_in_view(bContext *C, wmWindow * /*win*/, wmDrag *drag, const int xy[2])
511{
512 SeqDropCoords *coords = &g_drop_coords;
513 if (!coords->in_use) {
514 return;
515 }
516
517 /* Needed to get user's snap settings later on when calculating drag and drop snaps. */
519
520 ARegion *region = CTX_wm_region(C);
521 int mval[2];
522 /* Convert mouse coordinates to region local coordinates. */
523 mval[0] = xy[0] - region->winrct.xmin;
524 mval[1] = xy[1] - region->winrct.ymin;
525
526 float strip_len = update_overlay_strip_position_data(C, mval);
527
530
531 /* Sometimes the active theme is not the sequencer theme, e.g. when an operator invokes the
532 * file browser. This makes sure we get the right color values for the theme. */
533 ui::theme::bThemeState theme_state;
534 ui::theme::theme_store(&theme_state);
536
537 if (coords->use_snapping) {
538 ui::view2d_view_ortho(&region->v2d);
541 }
542
543 /* Init GPU drawing. */
545
546 /* Draw strips. The code here is taken from sequencer_draw. */
547 float x1 = coords->start_frame;
548 float x2 = coords->start_frame + floorf(strip_len);
549 uchar strip_color[4];
550 strip_color[3] = 255;
551 uchar text_color[4] = {255, 255, 255, 255};
552
553 StripsDrawBatch batch(&region->v2d);
554
555 for (int i = 0; i < coords->num_channels; i++) {
556 float y1 = floorf(coords->channel) + i + STRIP_OFSBOTTOM;
557 float y2 = floorf(coords->channel) + i + STRIP_OFSTOP;
558
559 /* Audio strips sit at the bottom, video strips sit above them. */
560 if (i < coords->num_audio) {
562 }
563 else {
564 ui::theme::get_color_3ubv(coords->type, strip_color);
565 }
566
567 SeqStripDrawData &data = batch.add_strip(x1, x2, y2, y1, y2, x1, x2, 0, true);
569 data.col_background = color_pack(strip_color);
570
571 if (coords->is_intersecting) {
572 strip_color[0] = 255;
573 strip_color[1] = strip_color[2] = 33;
574 }
575 else {
576 if (coords->num_channels - 1 == i) {
577 text_color[0] = text_color[1] = text_color[2] = 255;
579 data.flags |= GPU_SEQ_FLAG_ACTIVE;
580 }
581 else {
582 text_color[0] = text_color[1] = text_color[2] = 10;
584 }
585 }
586 strip_color[3] = 204;
587 data.col_outline = color_pack(strip_color);
588
589 const float pixelx = ui::view2d_pixel_size_get_x(&region->v2d);
590 const float pixely = ui::view2d_pixel_size_get_y(&region->v2d);
591
592 /* Taken from strip_handle_draw_size_get(). */
593 const float handle_size = pixelx * (5.0f * U.pixelsize);
594
595 /* Calculate height needed for drawing text on strip. */
596 float text_margin_y = y2 - min_ff(0.40f, 20 * UI_SCALE_FAC * pixely);
597 float text_margin_x = 2.0f * handle_size;
598
599 rctf rect;
600 rect.xmin = x1 + text_margin_x;
601 rect.ymin = text_margin_y;
602 rect.xmax = x2 - text_margin_x;
603 rect.ymax = y2;
604
605 if (rect.xmax <= rect.xmin) {
606 /* Exit early and skip text drawing if the strip doesn't have any space to put the text
607 * into.
608 */
609 break;
610 }
611
612 SpaceSeq *sseq = CTX_wm_space_seq(C);
613 const char *text_sep = " | ";
614 const char *text_array[5];
615 char text_display[FILE_MAX];
616 char filename[FILE_MAX];
617 char path[FILE_MAX];
618 char strip_duration_text[16];
619 int len_text_arr = 0;
620
621 const bool is_filepath = get_drag_path(C, drag, path);
622
624 if (is_filepath) {
626 text_array[len_text_arr++] = filename;
627 }
628 else {
629 text_array[len_text_arr++] = path;
630 }
631 }
632
633 if (is_filepath && (sseq->timeline_overlay.flag & SEQ_TIMELINE_SHOW_STRIP_SOURCE)) {
634 Main *bmain = CTX_data_main(C);
636 text_array[len_text_arr++] = text_sep;
637 text_array[len_text_arr++] = path;
638 }
639
641 SNPRINTF_UTF8(strip_duration_text, "%d", int(x2 - x1));
642 text_array[len_text_arr++] = text_sep;
643 text_array[len_text_arr++] = strip_duration_text;
644 }
645
646 BLI_assert(len_text_arr <= ARRAY_SIZE(text_array));
647
648 const size_t text_display_len = BLI_string_join_array(
649 text_display, FILE_MAX, text_array, len_text_arr);
650
652 &region->v2d, &rect, text_display, text_display_len, text_color);
653 }
654 batch.flush_batch();
655
656 /* Clean after drawing up. */
657 ui::theme::theme_restore(&theme_state);
660
662}
663
665{
666 SeqDropCoords *coords = static_cast<SeqDropCoords *>(drop->draw_data);
667 if (coords && coords->in_use) {
668 return true;
669 }
670
671 coords = &g_drop_coords;
672 drop->draw_data = static_cast<void *>(&g_drop_coords);
673 coords->in_use = true;
674
675 return false;
676}
677
685};
686
687static void prefetch_data_fn(void *custom_data, wmJobWorkerStatus * /*worker_status*/)
688{
689 DropJobData *job_data = static_cast<DropJobData *>(custom_data);
690
691 if (job_data->only_audio) {
692#ifdef WITH_AUDASPACE
693 /* Get the sound file length */
694 AUD_Sound sound = AUD_Sound(new aud::File(job_data->path));
695 if (sound != nullptr) {
696
697 SoundInfo info = bke::sound_info_get(sound);
698 if (info.specs.channels != SOUND_CHANNELS_INVALID) {
700 }
701 try {
702 const int audio_streams = int(aud::FileManager::queryStreams(job_data->path).size());
703 g_drop_coords.num_channels = audio_streams;
705 }
706 catch (aud::Exception &ex) {
707 (void)ex;
708 }
709 /* The playback rate is defined by the scene. This will be computed later in
710 * #update_overlay_strip_position_data, when we know the scene from the context. So set it to
711 * 0 for now. */
713 return;
714 }
715#endif
716 }
717
718 /* The movie reader is not used to access pixel data here, so avoid internal colorspace
719 * conversions that ensures typical color pipeline in Blender as they might be expensive. */
720 ColorManagedColorspaceSettings colorspace_settings;
721 MovieReader *anim = openanim(job_data->path, ImBufFlags::Zero, 0, true, &colorspace_settings);
722
723 if (anim != nullptr) {
726 const int video_streams = MOV_get_video_stream_count(anim);
727 int audio_streams = 0;
728
729 MOV_close(anim);
730
731#ifdef WITH_AUDASPACE
732 try {
733 audio_streams = int(aud::FileManager::queryStreams(job_data->path).size());
734 }
735 catch (aud::Exception &ex) {
736 (void)ex;
737 }
738#endif
739 g_drop_coords.num_channels = video_streams + audio_streams;
740 g_drop_coords.num_audio = audio_streams;
741 }
742}
743
744static void free_prefetch_data_fn(void *custom_data)
745{
746 DropJobData *job_data = static_cast<DropJobData *>(custom_data);
747 MEM_delete(job_data);
748}
749
750static void start_audio_video_job(bContext *C, wmDrag *drag, bool only_audio)
751{
753
754 wmJob *wm_job = WM_jobs_get(wm,
755 nullptr,
756 nullptr,
757 "Loading previews...",
760
761 DropJobData *job_data = MEM_new_uninitialized<DropJobData>("SeqDragDropPreviewData");
762 get_drag_path(C, drag, job_data->path);
763
764 job_data->only_audio = only_audio;
765 g_drop_coords.only_audio = only_audio;
766
768 WM_jobs_timer(wm_job, 0.1, NC_WINDOW, NC_WINDOW);
769 WM_jobs_callbacks(wm_job, prefetch_data_fn, nullptr, nullptr, nullptr);
770
771 WM_jobs_start(wm, wm_job);
772}
773
774static void video_prefetch(bContext *C, wmDrag *drag)
775{
776 if (is_movie(drag)) {
777 start_audio_video_job(C, drag, false);
778 }
779}
780
781static void audio_prefetch(bContext *C, wmDrag *drag)
782{
783 if (is_sound(drag)) {
784 start_audio_video_job(C, drag, true);
785 }
786}
787
788static void movie_drop_on_enter(wmDropBox *drop, wmDrag * /*drag*/)
789{
790 if (generic_drop_draw_handling(drop)) {
791 return;
792 }
793}
794
795static void sound_drop_on_enter(wmDropBox *drop, wmDrag * /*drag*/)
796{
797 if (generic_drop_draw_handling(drop)) {
798 return;
799 }
800}
801
802static void image_drop_on_enter(wmDropBox *drop, wmDrag * /*drag*/)
803{
804 if (generic_drop_draw_handling(drop)) {
805 return;
806 }
807
808 SeqDropCoords *coords = static_cast<SeqDropCoords *>(drop->draw_data);
809 coords->strip_length = seq::default_strip_length(coords->fps);
810 coords->num_channels = 1;
811}
812
813static void movieclip_drop_on_enter(wmDropBox *drop, wmDrag *drag)
814{
815 if (generic_drop_draw_handling(drop)) {
816 return;
817 }
818
819 SeqDropCoords *coords = static_cast<SeqDropCoords *>(drop->draw_data);
820 ID *id = WM_drag_get_local_ID(drag, ID_MC);
821 coords->strip_length = id ? BKE_movieclip_get_duration(id_cast<MovieClip *>(id)) :
823 coords->num_channels = 1;
824 coords->num_audio = 0;
825 coords->playback_rate = 0.0f;
826 coords->only_audio = false;
827}
828
829static void scene_drop_on_enter(wmDropBox *drop, wmDrag *drag)
830{
831 if (generic_drop_draw_handling(drop)) {
832 return;
833 }
834
835 SeqDropCoords *coords = static_cast<SeqDropCoords *>(drop->draw_data);
836 ID *id = WM_drag_get_local_ID(drag, ID_SCE);
837 const Scene *scene = id_cast<Scene *>(id);
838 coords->strip_length = scene ? scene->r.efra - scene->r.sfra + 1 :
840 coords->num_channels = 1;
841 coords->num_audio = 0;
842 coords->playback_rate = 0.0f;
843 coords->only_audio = false;
844}
845
846static void mask_drop_on_enter(wmDropBox *drop, wmDrag *drag)
847{
848 if (generic_drop_draw_handling(drop)) {
849 return;
850 }
851
852 SeqDropCoords *coords = static_cast<SeqDropCoords *>(drop->draw_data);
853 ID *id = WM_drag_get_local_ID(drag, ID_MSK);
854 coords->strip_length = id ? BKE_mask_get_duration(id_cast<Mask *>(id)) :
856 coords->num_channels = 1;
857 coords->num_audio = 0;
858 coords->playback_rate = 0.0f;
859 coords->only_audio = false;
860}
861
862static void text_drop_on_enter(wmDropBox *drop, wmDrag * /*drag*/)
863{
864 if (generic_drop_draw_handling(drop)) {
865 return;
866 }
867
868 SeqDropCoords *coords = static_cast<SeqDropCoords *>(drop->draw_data);
869 coords->strip_length = seq::default_strip_length(coords->fps);
870 coords->num_channels = 1;
871 coords->num_audio = 0;
872 coords->playback_rate = 0.0f;
873 coords->only_audio = false;
874}
875
876static void color_drop_on_enter(wmDropBox *drop, wmDrag * /*drag*/)
877{
878 if (generic_drop_draw_handling(drop)) {
879 return;
880 }
881
882 SeqDropCoords *coords = static_cast<SeqDropCoords *>(drop->draw_data);
883 coords->strip_length = seq::default_strip_length(coords->fps);
884 coords->num_channels = 1;
885 coords->num_audio = 0;
886 coords->playback_rate = 0.0f;
887 coords->only_audio = false;
888}
889
890static void sequencer_drop_on_exit(wmDropBox *drop, wmDrag * /*drag*/)
891{
892 SeqDropCoords *coords = static_cast<SeqDropCoords *>(drop->draw_data);
893 if (coords) {
894 coords->in_use = false;
895 coords->has_read_mouse_pos = false;
896 drop->draw_data = nullptr;
897 }
898}
899
900static void nop_draw_droptip_fn(bContext * /*C*/,
901 wmWindow * /*win*/,
902 wmDrag * /*drag*/,
903 const int /*xy*/[2])
904{
905 /* Do nothing in here.
906 * This is to prevent the default drag and drop mouse overlay to be drawn.
907 */
908}
909
910/* This region dropbox definition. */
911static void sequencer_dropboxes_add_to_lb(ListBaseT<wmDropBox> *lb)
912{
913 wmDropBox *drop;
914 drop = WM_dropbox_add(
915 lb, "SEQUENCER_OT_image_strip_add", image_drop_poll, sequencer_drop_copy, nullptr, nullptr);
920
922
923 drop = WM_dropbox_add(
924 lb, "SEQUENCER_OT_movie_strip_add", movie_drop_poll, sequencer_drop_copy, nullptr, nullptr);
929
931
932 drop = WM_dropbox_add(lb,
933 "SEQUENCER_OT_movieclip_strip_add",
936 nullptr,
937 nullptr);
942
943 drop = WM_dropbox_add(
944 lb, "SEQUENCER_OT_scene_strip_add", scene_drop_poll, sequencer_drop_copy, nullptr, nullptr);
949
950 drop = WM_dropbox_add(
951 lb, "SEQUENCER_OT_mask_strip_add", mask_drop_poll, sequencer_drop_copy, nullptr, nullptr);
956
957 drop = WM_dropbox_add(
958 lb, "SEQUENCER_OT_text_strip_add", text_drop_poll, sequencer_drop_copy, nullptr, nullptr);
963
964 drop = WM_dropbox_add(
965 lb, "SEQUENCER_OT_effect_strip_add", color_drop_poll, sequencer_drop_copy, nullptr, nullptr);
970
971 drop = WM_dropbox_add(
972 lb, "SEQUENCER_OT_sound_strip_add", sound_drop_poll, sequencer_drop_copy, nullptr, nullptr);
977}
978
979static bool image_drop_preview_poll(bContext *C, wmDrag *drag, const wmEvent * /*event*/)
980{
981 return is_image(drag) && (drag->type != WM_DRAG_PATH ||
982 test_single_file_handler_poll(C, drag, "SEQUENCER_FH_image_strip"));
983}
984
985static bool movie_drop_preview_poll(bContext *C, wmDrag *drag, const wmEvent * /*event*/)
986{
987 return is_movie(drag) && (drag->type != WM_DRAG_PATH ||
988 test_single_file_handler_poll(C, drag, "SEQUENCER_FH_movie_strip"));
989}
990
991static bool movieclip_drop_preview_poll(bContext * /*C*/, wmDrag *drag, const wmEvent * /*event*/)
992{
993 return WM_drag_is_ID_type(drag, ID_MC);
994}
995
996static bool scene_drop_preview_poll(bContext *C, wmDrag *drag, const wmEvent * /*event*/)
997{
998 const Scene *sequencer_scene = CTX_data_sequencer_scene(C);
999 if (sequencer_scene == nullptr) {
1000 return false;
1001 }
1002
1003 return WM_drag_is_ID_type(drag, ID_SCE) &&
1004 WM_drag_get_local_ID(drag, ID_SCE) != &sequencer_scene->id;
1005}
1006
1007static bool mask_drop_preview_poll(bContext * /*C*/, wmDrag *drag, const wmEvent * /*event*/)
1008{
1009 return WM_drag_is_ID_type(drag, ID_MSK);
1010}
1011
1012static bool text_drop_preview_poll(bContext *C, wmDrag *drag, const wmEvent * /*event*/)
1013{
1014 return is_text(drag) && (drag->type != WM_DRAG_PATH ||
1015 test_single_file_handler_poll(C, drag, "SEQUENCER_FH_text_strip"));
1016}
1017
1018static bool color_drop_preview_poll(bContext * /*C*/, wmDrag *drag, const wmEvent * /*event*/)
1019{
1020 return drag->type == WM_DRAG_COLOR;
1021}
1022
1023static bool sound_drop_preview_poll(bContext *C, wmDrag *drag, const wmEvent * /*event*/)
1024{
1025 return is_sound(drag) && (drag->type != WM_DRAG_PATH ||
1026 test_single_file_handler_poll(C, drag, "SEQUENCER_FH_sound_strip"));
1027}
1028
1029static void sequencer_preview_dropboxes_add_to_lb(ListBaseT<wmDropBox> *lb)
1030{
1031 WM_dropbox_add(lb,
1032 "SEQUENCER_OT_image_strip_add",
1035 nullptr,
1036 nullptr);
1037
1038 WM_dropbox_add(lb,
1039 "SEQUENCER_OT_movie_strip_add",
1042 nullptr,
1043 nullptr);
1044
1045 WM_dropbox_add(lb,
1046 "SEQUENCER_OT_movieclip_strip_add",
1049 nullptr,
1050 nullptr);
1051
1052 WM_dropbox_add(lb,
1053 "SEQUENCER_OT_scene_strip_add",
1056 nullptr,
1057 nullptr);
1058
1059 WM_dropbox_add(lb,
1060 "SEQUENCER_OT_mask_strip_add",
1063 nullptr,
1064 nullptr);
1065
1066 WM_dropbox_add(lb,
1067 "SEQUENCER_OT_text_strip_add",
1070 nullptr,
1071 nullptr);
1072
1073 WM_dropbox_add(lb,
1074 "SEQUENCER_OT_effect_strip_add",
1077 nullptr,
1078 nullptr);
1079
1080 WM_dropbox_add(lb,
1081 "SEQUENCER_OT_sound_strip_add",
1084 nullptr,
1085 nullptr);
1086}
1087
1089{
1090 ListBaseT<wmDropBox> *lb = WM_dropboxmap_find("Sequencer", SPACE_SEQ, RGN_TYPE_WINDOW);
1092 lb = WM_dropboxmap_find("Sequencer", SPACE_SEQ, RGN_TYPE_PREVIEW);
1094}
1095
1096} // namespace blender::ed::vse
Main runtime representation of an asset.
std::shared_ptr< void > AUD_Sound
#define FILE_MAX
#define SNPRINTF_UTF8(dst, format,...)
#define IFACE_(msgid)
#define ID_BLEND_PATH_FROM_GLOBAL(_id)
Definition DNA_ID.h:691
#define STRIP_OFSBOTTOM
#define STRIP_OFSTOP
#define UI_SCALE_FAC
Singleton to manage exceptions.
@ GPU_SEQ_FLAG_BACKGROUND
@ GPU_SEQ_FLAG_SELECTED
@ GPU_SEQ_FLAG_BORDER
@ GPU_SEQ_FLAG_ACTIVE
Read Blender memory allocation and freeing.
#define C
Definition RandGen.cpp:29
#define NC_WINDOW
Definition WM_types.hh:388
SeqStripDrawData & add_strip(float content_start, float content_end, float top, float bottom, float content_top, float left_handle, float right_handle, float handle_width, bool single_image)
#define roundf(x)
Vector< FileHandlerType * > file_handlers_poll_file_drop(const bContext *C, const Span< std::string > paths)
Span< std::unique_ptr< FileHandlerType > > file_handlers()
bool snap_sequencer_calc_drag_drop(Scene *scene, ARegion *region, const int left_frame, const int right_frame, const int channel, int *r_snap_distance, float2 *r_snap_point)
void snap_sequencer_draw_drag_drop(Scene *scene, ARegion *region, const float2 snap_point)
static bool generic_poll_operations(const bContext *C, const wmEvent *event, uint8_t type)
static bool scene_drop_preview_poll(bContext *C, wmDrag *drag, const wmEvent *)
static bool get_drag_path(const bContext *, wmDrag *drag, char r_path[FILE_MAX])
static void draw_strip_in_view(bContext *C, wmWindow *, wmDrag *drag, const int xy[2])
static void nop_draw_droptip_fn(bContext *, wmWindow *, wmDrag *, const int[2])
static void sequencer_drop_on_exit(wmDropBox *drop, wmDrag *)
static void sequencer_dropboxes_add_to_lb(ListBaseT< wmDropBox > *lb)
static void text_drop_on_enter(wmDropBox *drop, wmDrag *)
static bool movie_drop_poll(bContext *C, wmDrag *drag, const wmEvent *event)
static bool is_sound(wmDrag *drag)
static bool movie_drop_preview_poll(bContext *C, wmDrag *drag, const wmEvent *)
static bool movieclip_drop_poll(bContext *C, wmDrag *drag, const wmEvent *event)
static bool movieclip_drop_preview_poll(bContext *, wmDrag *drag, const wmEvent *)
static bool color_drop_poll(bContext *C, wmDrag *drag, const wmEvent *event)
static bool image_drop_preview_poll(bContext *C, wmDrag *drag, const wmEvent *)
static bool is_image(wmDrag *drag)
uint color_pack(const uchar rgba[4])
static void sequencer_preview_dropboxes_add_to_lb(ListBaseT< wmDropBox > *lb)
static bool color_drop_preview_poll(bContext *, wmDrag *drag, const wmEvent *)
static void movieclip_drop_on_enter(wmDropBox *drop, wmDrag *drag)
static bool scene_drop_poll(bContext *C, wmDrag *drag, const wmEvent *event)
static bool is_movie(wmDrag *drag)
static void prefetch_data_fn(void *custom_data, wmJobWorkerStatus *)
static void video_prefetch(bContext *C, wmDrag *drag)
static void sequencer_drop_copy(bContext *C, wmDrag *drag, wmDropBox *drop)
static float update_overlay_strip_position_data(bContext *C, const int mval[2])
static bool text_drop_preview_poll(bContext *C, wmDrag *drag, const wmEvent *)
static bool mask_drop_preview_poll(bContext *, wmDrag *drag, const wmEvent *)
static void start_audio_video_job(bContext *C, wmDrag *drag, bool only_audio)
static void scene_drop_on_enter(wmDropBox *drop, wmDrag *drag)
static void mask_drop_on_enter(wmDropBox *drop, wmDrag *drag)
static bool mask_drop_poll(bContext *C, wmDrag *drag, const wmEvent *event)
static bool test_single_file_handler_poll(const bContext *C, wmDrag *drag, StringRef file_handler)
static void audio_prefetch(bContext *C, wmDrag *drag)
static void color_drop_on_enter(wmDropBox *drop, wmDrag *)
static SeqDropCoords g_drop_coords
static bool generic_drop_draw_handling(wmDropBox *drop)
static bool sound_drop_preview_poll(bContext *C, wmDrag *drag, const wmEvent *)
static bool image_drop_poll(bContext *C, wmDrag *drag, const wmEvent *event)
static void sound_drop_on_enter(wmDropBox *drop, wmDrag *)
static bool sound_drop_poll(bContext *C, wmDrag *drag, const wmEvent *event)
static void free_prefetch_data_fn(void *custom_data)
static bool text_drop_poll(bContext *C, wmDrag *drag, const wmEvent *event)
static bool is_text(wmDrag *drag)
static void movie_drop_on_enter(wmDropBox *drop, wmDrag *)
static void image_drop_on_enter(wmDropBox *drop, wmDrag *)
std::string filename(const std::string_view &str, size_t pos)
ListBaseT< Strip > * active_seqbase_get(const Editing *ed)
Definition sequencer.cc:463
bool transform_test_overlap(const Scene *scene, Strip *strip1, Strip *strip2)
Editing * editing_ensure(Scene *scene)
Definition sequencer.cc:309
ListBaseT< SeqTimelineChannel > * channels_displayed_get(const Editing *ed)
Definition channels.cc:26
VectorSet< Strip * > query_rendered_strips(const Scene *scene, ListBaseT< SeqTimelineChannel > *channels, ListBaseT< Strip > *seqbase, const int timeline_frame, const int displayed_channel)
Definition iterator.cc:239
int default_strip_length(const double scene_fps)
Definition strip_add.cc:64
eSeqOverlapMode tool_settings_overlap_mode_get(Scene *scene)
Definition sequencer.cc:445
void theme_store(bThemeState *theme_state)
void theme_set(int spacetype, int regionid)
void theme_restore(const bThemeState *theme_state)
void get_color_3ubv(int colorid, unsigned char col[3])
void view2d_view_ortho(const View2D *v2d)
Definition view2d.cc:1080
float view2d_pixel_size_get_y(const View2D *v2d)
Definition view2d.cc:1924
void view2d_view_restore(const bContext *C)
Definition view2d.cc:1147
void view2d_text_cache_draw(ARegion *region)
Definition view2d.cc:2139
void view2d_region_to_view(const View2D *v2d, float x, float y, float *r_view_x, float *r_view_y) ATTR_NONNULL()
Definition view2d.cc:1651
void view2d_text_cache_add_rectf(View2D *v2d, const rctf *rect_view, const char *str, size_t str_len, const unsigned char col[4])
Definition view2d.cc:2109
float view2d_pixel_size_get_x(const View2D *v2d)
Definition view2d.cc:1920
MINLINE float min_ff(float a, float b)
void * MEM_new_uninitialized(size_t len, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1) ATTR_NONNULL(2)
UserDef U
Definition blender.cc:58
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
void RNA_float_set_array(PointerRNA *ptr, const char *name, const float *values)
const char * WM_drag_get_single_path(const wmDrag *drag)
void wmOrtho2_region_pixelspace(const ARegion *region)
wmDropBox * WM_dropbox_add(ListBaseT< wmDropBox > *lb, const char *idname, bool(*poll)(bContext *C, wmDrag *drag, const wmEvent *event), void(*copy)(bContext *C, wmDrag *drag, wmDropBox *drop), void(*cancel)(Main *bmain, wmDrag *drag, wmDropBox *drop), WMDropboxTooltipFunc tooltip)
@ SOUND_CHANNELS_INVALID
Definition BKE_sound.hh:60
@ SEQ_TIMELINE_SHOW_STRIP_DURATION
@ SEQ_TIMELINE_SHOW_STRIP_NAME
@ SEQ_TIMELINE_SHOW_STRIP_SOURCE
Scene * CTX_data_sequencer_scene(const bContext *C)
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
wmDragAsset * WM_drag_get_asset_data(const wmDrag *drag, int idcode)
void WM_jobs_callbacks(wmJob *wm_job, wm_jobs_start_callback startjob, void(*initjob)(void *), void(*update)(void *), void(*endjob)(void *))
Definition wm_jobs.cc:407
bool BLI_path_abs(char path[FILE_MAX], const char *basepath) ATTR_NONNULL(1
void MOV_close(MovieReader *anim)
Definition movie_read.cc:70
void RNA_string_set(PointerRNA *ptr, const char *name, const char *value)
@ WM_JOB_TYPE_SEQ_DRAG_DROP_PREVIEW
Definition WM_api.hh:2048
void RNA_int_set(PointerRNA *ptr, const char *name, int value)
@ WM_DRAG_PATH
Definition WM_types.hh:1302
@ WM_DRAG_COLOR
Definition WM_types.hh:1312
void RNA_struct_property_unset(PointerRNA *ptr, const char *identifier)
wmWindow * CTX_wm_window(const bContext *C)
ID * WM_drag_get_local_ID_or_import_from_asset(const bContext *C, const wmDrag *drag, int idcode)
void RNA_enum_set(PointerRNA *ptr, const char *name, int value)
MINLINE int max_ii(int a, int b)
void WM_jobs_customdata_set(wmJob *wm_job, void *customdata, void(*free)(void *customdata))
Definition wm_jobs.cc:377
int BKE_mask_get_duration(Mask *mask)
@ WM_JOB_BACKGROUND
Definition WM_api.hh:1999
bool WM_drag_is_ID_type(const wmDrag *drag, int idcode)
SpaceSeq * CTX_wm_space_seq(const bContext *C)
@ GPU_BLEND_NONE
Definition GPU_state.hh:88
@ GPU_BLEND_ALPHA_PREMULT
Definition GPU_state.hh:91
void WM_jobs_start(wmWindowManager *wm, wmJob *wm_job)
Definition wm_jobs.cc:498
const char * BKE_main_blendfile_path(const Main *bmain) ATTR_NONNULL()
Definition main.cc:1058
VecBase< float, 4 > float4
int BLI_findindex(const ListBase *listbase, const void *vlink) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
Definition listbase.cc:593
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, size_t dst_maxncpy) ATTR_NONNULL(1
VecBase< float, 2 > float2
void RNA_collection_clear(PointerRNA *ptr, const char *name)
unsigned char uchar
Definition BKE_text.h:58
BMesh const char void * data
wmWindowManager * CTX_wm_manager(const bContext *C)
unsigned char uint8_t
Definition BKE_text.h:79
bool void BLI_path_rel(char path[FILE_MAX], const char *basepath) ATTR_NONNULL(1)
constexpr size_t ARRAY_SIZE(const T(&arg)[N]) noexcept
MovieReader * openanim(const char *filepath, ImBufFlags ibuf_flags, int streamindex, bool keep_original_colorspace, ColorManagedColorspaceSettings *colorspace_settings)
void RNA_boolean_set(PointerRNA *ptr, const char *name, bool value)
int WM_drag_get_path_file_type(const wmDrag *drag)
int BKE_movieclip_get_duration(MovieClip *clip)
void void void BLI_path_split_file_part(const char *filepath, char *file, size_t file_maxncpy) ATTR_NONNULL(1
Main * CTX_data_main(const bContext *C)
wmJob * WM_jobs_get(wmWindowManager *wm, wmWindow *win, const void *owner, const char *name, const eWM_JobFlag flag, const eWM_JobType job_type)
Definition wm_jobs.cc:228
int MOV_get_video_stream_count(MovieReader *anim)
bool BLI_path_extension_check(const char *path, const char *ext) ATTR_NONNULL(1
char * txt_to_buf(struct Text *text, size_t *r_buf_strlen) ATTR_NONNULL(1
Definition text.cc:1434
ID_Type GS(const char *name)
Definition DNA_ID.h:410
float MOV_get_fps(const MovieReader *anim)
Span< std::string > WM_drag_get_paths(const wmDrag *drag)
void BLI_path_split_dir_file(const char *filepath, char *dir, size_t dir_maxncpy, char *file, size_t file_maxncpy) ATTR_NONNULL(1
Scene * CTX_data_scene(const bContext *C)
void GPU_blend(GPUBlend blend)
Definition gpu_state.cc:44
ID * WM_drag_get_local_ID(const wmDrag *drag, short idcode)
BLI_INLINE void IMB_colormanagement_scene_linear_to_srgb_v3(float srgb[3], const float scene_linear[3])
size_t BLI_string_join_array(char *result, size_t result_maxncpy, const char *strings[], uint strings_num) ATTR_NONNULL()
ListBaseT< wmDropBox > * WM_dropboxmap_find(const char *idname, int spaceid, int regionid)
int MOV_get_duration_frames(const MovieReader *anim)
void GPU_matrix_pop()
void RNA_collection_add(PointerRNA *ptr, const char *name, PointerRNA *r_value)
ARegion * CTX_wm_region(const bContext *C)
void WM_jobs_timer(wmJob *wm_job, double time_step, uint note, uint endnote, void(*timer_step)(void *))
Definition wm_jobs.cc:393
void GPU_matrix_push()
#define floorf
KERNEL_FEATURE_LIGHT_PASSES KERNEL_FEATURE_PATH_GUIDING float
ListBaseT< MovieClip > movieclips
Definition BKE_main.hh:419
ListBaseT< Mask > masks
Definition BKE_main.hh:420
ListBaseT< Scene > scenes
Definition BKE_main.hh:386
struct RenderData r
struct ToolSettings * toolsettings
eSpaceSeq_SequencerTimelineOverlay_Flag flag
struct blender::SoundInfo::@227301210053207103375114031212057322370226174015 specs
struct SequencerTimelineOverlay timeline_overlay
char filepath[1024]
eWM_DragDataType type
Definition WM_types.hh:1424
void(*) draw_droptip(bContext *C, wmWindow *win, wmDrag *drag, const int xy[2])
Definition WM_types.hh:1488
PointerRNA * ptr
Definition WM_types.hh:1524
void(*) on_enter(wmDropBox *drop, wmDrag *drag)
Definition WM_types.hh:1466
void(*) on_drag_start(bContext *C, wmDrag *drag)
Definition WM_types.hh:1463
void(*) on_exit(wmDropBox *drop, wmDrag *drag)
Definition WM_types.hh:1472
void(*) draw_in_view(bContext *C, wmWindow *win, wmDrag *drag, const int xy[2])
Definition WM_types.hh:1496
bke::WindowRuntime * runtime