Blender  V3.3
Classes | Typedefs | Functions | Variables
sequencer_drag_drop.c File Reference
#include "MEM_guardedalloc.h"
#include "DNA_scene_types.h"
#include "DNA_sound_types.h"
#include "BLI_blenlib.h"
#include "BLI_string_utils.h"
#include "BKE_context.h"
#include "BKE_global.h"
#include "BKE_image.h"
#include "BKE_main.h"
#include "SEQ_channels.h"
#include "SEQ_iterator.h"
#include "SEQ_sequencer.h"
#include "SEQ_transform.h"
#include "UI_resources.h"
#include "UI_view2d.h"
#include "GPU_immediate.h"
#include "GPU_matrix.h"
#include "ED_screen.h"
#include "ED_transform.h"
#include "IMB_imbuf.h"
#include "IMB_imbuf_types.h"
#include "WM_api.h"
#include "WM_types.h"
#include "sequencer_intern.h"

Go to the source code of this file.

Classes

struct  SeqDropCoords
 
struct  DropJobData
 

Typedefs

typedef struct SeqDropCoords SeqDropCoords
 
typedef struct DropJobData DropJobData
 

Functions

static void generic_poll_operations (const wmEvent *event, uint8_t type)
 
static bool image_drop_poll (bContext *UNUSED(C), wmDrag *drag, const wmEvent *event)
 
static bool is_movie (wmDrag *drag)
 
static bool movie_drop_poll (bContext *UNUSED(C), wmDrag *drag, const wmEvent *event)
 
static bool is_sound (wmDrag *drag)
 
static bool sound_drop_poll (bContext *UNUSED(C), wmDrag *drag, const wmEvent *event)
 
static float update_overlay_strip_position_data (bContext *C, const int mval[2])
 
static void sequencer_drop_copy (bContext *C, wmDrag *drag, wmDropBox *drop)
 
static void get_drag_path (wmDrag *drag, char r_path[FILE_MAX])
 
static void draw_seq_in_view (bContext *C, wmWindow *UNUSED(win), wmDrag *drag, const int xy[2])
 
static bool generic_drop_draw_handling (struct wmDropBox *drop)
 
static void prefetch_data_fn (void *custom_data, short *UNUSED(stop), short *UNUSED(do_update), float *UNUSED(progress))
 
static void free_prefetch_data_fn (void *custom_data)
 
static void start_audio_video_job (bContext *C, wmDrag *drag, bool only_audio)
 
static void video_prefetch (bContext *C, wmDrag *drag)
 
static void audio_prefetch (bContext *C, wmDrag *drag)
 
static void movie_drop_draw_activate (struct wmDropBox *drop, wmDrag *UNUSED(drag))
 
static void sound_drop_draw_activate (struct wmDropBox *drop, wmDrag *UNUSED(drag))
 
static void image_drop_draw_activate (struct wmDropBox *drop, wmDrag *UNUSED(drag))
 
static void sequencer_drop_draw_deactivate (struct wmDropBox *drop, wmDrag *UNUSED(drag))
 
static void nop_draw_droptip_fn (bContext *UNUSED(C), wmWindow *UNUSED(win), wmDrag *UNUSED(drag), const int UNUSED(xy[2]))
 
static void sequencer_dropboxes_add_to_lb (ListBase *lb)
 
static bool image_drop_preview_poll (bContext *UNUSED(C), wmDrag *drag, const wmEvent *UNUSED(event))
 
static bool movie_drop_preview_poll (bContext *UNUSED(C), wmDrag *drag, const wmEvent *UNUSED(event))
 
static bool sound_drop_preview_poll (bContext *UNUSED(C), wmDrag *drag, const wmEvent *UNUSED(event))
 
static void sequencer_preview_dropboxes_add_to_lb (ListBase *lb)
 
void sequencer_dropboxes (void)
 

Variables

static SeqDropCoords g_drop_coords = {.in_use = false, .has_read_mouse_pos = false}
 

Typedef Documentation

◆ DropJobData

typedef struct DropJobData DropJobData

◆ SeqDropCoords

typedef struct SeqDropCoords SeqDropCoords

Function Documentation

◆ audio_prefetch()

static void audio_prefetch ( bContext C,
wmDrag drag 
)
static

Definition at line 598 of file sequencer_drag_drop.c.

References C, is_sound(), and start_audio_video_job().

Referenced by sequencer_dropboxes_add_to_lb().

◆ draw_seq_in_view()

static void draw_seq_in_view ( bContext C,
wmWindow UNUSEDwin,
wmDrag drag,
const int  xy[2] 
)
static

Definition at line 335 of file sequencer_drag_drop.c.

References ARRAY_SIZE, BKE_main_blendfile_path(), BLI_assert, BLI_path_rel(), BLI_rctf_size_x(), BLI_rctf_size_y(), BLI_rcti_size_x(), BLI_rcti_size_y(), BLI_split_file_part(), BLI_string_join_array(), C, SeqDropCoords::channel, SeqDropCoords::channel_len, CTX_data_main(), CTX_wm_region(), CTX_wm_space_seq(), View2D::cur, ED_draw_sequencer_snap_point(), FILE_MAX, SequencerTimelineOverlay::flag, floorf, g_drop_coords, get_drag_path(), GPU_blend(), GPU_BLEND_ALPHA, GPU_BLEND_NONE, GPU_COMP_F32, GPU_FETCH_FLOAT, GPU_line_smooth(), GPU_line_width(), GPU_matrix_pop(), GPU_matrix_push(), GPU_SHADER_2D_UNIFORM_COLOR, GPU_vertformat_attr_add(), if(), immBindBuiltinProgram(), immRectf(), immUnbindProgram(), immUniformColor3fvAlpha(), immVertexFormat(), SeqDropCoords::in_use, SeqDropCoords::is_intersecting, View2D::mask, min_ff(), pos, RGN_TYPE_WINDOW, SEQ_STRIP_OFSBOTTOM, SEQ_STRIP_OFSTOP, SEQ_TIMELINE_SHOW_STRIP_DURATION, SEQ_TIMELINE_SHOW_STRIP_NAME, SEQ_TIMELINE_SHOW_STRIP_SOURCE, SeqDropCoords::snap_point_x, SNPRINTF, SPACE_SEQ, SeqDropCoords::start_frame, TH_SEQ_ACTIVE, TH_SEQ_AUDIO, TH_SEQ_MOVIE, TH_SEQ_SELECTED, SpaceSeq::timeline_overlay, SeqDropCoords::type, UI_GetThemeColor3fv(), UI_SetTheme(), UI_Theme_Restore(), UI_Theme_Store(), UI_view2d_text_cache_add_rectf(), UI_view2d_text_cache_draw(), UI_view2d_view_ortho(), update_overlay_strip_position_data(), SeqDropCoords::use_snapping, ARegion::v2d, ARegion::winrct, x2, rcti::xmin, rctf::xmin, xy, y1, and rcti::ymin.

Referenced by sequencer_dropboxes_add_to_lb().

◆ free_prefetch_data_fn()

static void free_prefetch_data_fn ( void custom_data)
static

Definition at line 559 of file sequencer_drag_drop.c.

References MEM_freeN.

Referenced by start_audio_video_job().

◆ generic_drop_draw_handling()

static bool generic_drop_draw_handling ( struct wmDropBox drop)
static

◆ generic_poll_operations()

static void generic_poll_operations ( const wmEvent event,
uint8_t  type 
)
static

◆ get_drag_path()

static void get_drag_path ( wmDrag drag,
char  r_path[FILE_MAX] 
)
static

◆ image_drop_draw_activate()

static void image_drop_draw_activate ( struct wmDropBox drop,
wmDrag UNUSEDdrag 
)
static

◆ image_drop_poll()

static bool image_drop_poll ( bContext UNUSEDC,
wmDrag drag,
const wmEvent event 
)
static

◆ image_drop_preview_poll()

static bool image_drop_preview_poll ( bContext UNUSEDC,
wmDrag drag,
const wmEvent UNUSEDevent 
)
static

◆ is_movie()

static bool is_movie ( wmDrag drag)
static

◆ is_sound()

static bool is_sound ( wmDrag drag)
static

◆ movie_drop_draw_activate()

static void movie_drop_draw_activate ( struct wmDropBox drop,
wmDrag UNUSEDdrag 
)
static

Definition at line 605 of file sequencer_drag_drop.c.

References generic_drop_draw_handling().

Referenced by sequencer_dropboxes_add_to_lb().

◆ movie_drop_poll()

static bool movie_drop_poll ( bContext UNUSEDC,
wmDrag drag,
const wmEvent event 
)
static

Definition at line 108 of file sequencer_drag_drop.c.

References generic_poll_operations(), is_movie(), and TH_SEQ_MOVIE.

Referenced by sequencer_dropboxes_add_to_lb().

◆ movie_drop_preview_poll()

static bool movie_drop_preview_poll ( bContext UNUSEDC,
wmDrag drag,
const wmEvent UNUSEDevent 
)
static

◆ nop_draw_droptip_fn()

static void nop_draw_droptip_fn ( bContext UNUSEDC,
wmWindow UNUSEDwin,
wmDrag UNUSEDdrag,
const int   UNUSEDxy[2] 
)
static

Definition at line 640 of file sequencer_drag_drop.c.

Referenced by sequencer_dropboxes_add_to_lb().

◆ prefetch_data_fn()

static void prefetch_data_fn ( void custom_data,
short *  UNUSEDstop,
short *  UNUSEDdo_update,
float UNUSEDprogress 
)
static

◆ sequencer_drop_copy()

static void sequencer_drop_copy ( bContext C,
wmDrag drag,
wmDropBox drop 
)
static

◆ sequencer_drop_draw_deactivate()

static void sequencer_drop_draw_deactivate ( struct wmDropBox drop,
wmDrag UNUSEDdrag 
)
static

◆ sequencer_dropboxes()

void sequencer_dropboxes ( void  )

◆ sequencer_dropboxes_add_to_lb()

static void sequencer_dropboxes_add_to_lb ( ListBase lb)
static

◆ sequencer_preview_dropboxes_add_to_lb()

static void sequencer_preview_dropboxes_add_to_lb ( ListBase lb)
static

◆ sound_drop_draw_activate()

static void sound_drop_draw_activate ( struct wmDropBox drop,
wmDrag UNUSEDdrag 
)
static

Definition at line 612 of file sequencer_drag_drop.c.

References generic_drop_draw_handling().

Referenced by sequencer_dropboxes_add_to_lb().

◆ sound_drop_poll()

static bool sound_drop_poll ( bContext UNUSEDC,
wmDrag drag,
const wmEvent event 
)
static

Definition at line 131 of file sequencer_drag_drop.c.

References generic_poll_operations(), is_sound(), and TH_SEQ_AUDIO.

Referenced by sequencer_dropboxes_add_to_lb().

◆ sound_drop_preview_poll()

static bool sound_drop_preview_poll ( bContext UNUSEDC,
wmDrag drag,
const wmEvent UNUSEDevent 
)
static

◆ start_audio_video_job()

static void start_audio_video_job ( bContext C,
wmDrag drag,
bool  only_audio 
)
static

◆ update_overlay_strip_position_data()

static float update_overlay_strip_position_data ( bContext C,
const int  mval[2] 
)
static

◆ video_prefetch()

static void video_prefetch ( bContext C,
wmDrag drag 
)
static

Definition at line 591 of file sequencer_drag_drop.c.

References C, is_movie(), and start_audio_video_job().

Referenced by sequencer_dropboxes_add_to_lb().

Variable Documentation

◆ g_drop_coords

SeqDropCoords g_drop_coords = {.in_use = false, .has_read_mouse_pos = false}
static