Blender V5.0
time_scrub_ui.cc File Reference
#include "BKE_context.hh"
#include "BKE_scene.hh"
#include "GPU_immediate.hh"
#include "GPU_matrix.hh"
#include "GPU_state.hh"
#include "ED_time_scrub_ui.hh"
#include "WM_api.hh"
#include "WM_types.hh"
#include "UI_interface.hh"
#include "UI_interface_icons.hh"
#include "UI_interface_layout.hh"
#include "UI_resources.hh"
#include "UI_view2d.hh"
#include "DNA_scene_types.h"
#include "BLI_math_base.h"
#include "BLI_rect.h"
#include "BLI_string_utf8.h"
#include "BLI_timecode.h"
#include "RNA_access.hh"
#include "RNA_prototypes.hh"

Go to the source code of this file.

Functions

void ED_time_scrub_region_rect_get (const ARegion *region, rcti *r_rect)
static int get_centered_text_y (const rcti *rect)
static void draw_background (const rcti *rect)
static void get_current_time_str (const Scene *scene, bool display_seconds, int frame, char *r_str, uint str_maxncpy)
static void draw_current_frame (const Scene *scene, bool display_seconds, const View2D *v2d, const rcti *scrub_region_rect, int current_frame, bool display_stalk=true)
void ED_time_scrub_draw_current_frame (const ARegion *region, const Scene *scene, bool display_seconds, bool display_stalk)
void ED_time_scrub_draw (const ARegion *region, const Scene *scene, bool display_seconds, bool discrete_frames, const int base)
rcti ED_time_scrub_clamp_scroller_mask (const rcti &scroller_mask)
bool ED_time_scrub_event_in_region (const ARegion *region, const wmEvent *event)
bool ED_time_scrub_event_in_region_poll (const wmWindow *, const ScrArea *, const ARegion *region, const wmEvent *event)
void ED_time_scrub_channel_search_draw (const bContext *C, ARegion *region, bDopeSheet *dopesheet)

Function Documentation

◆ draw_background()

◆ draw_current_frame()

◆ ED_time_scrub_channel_search_draw()

◆ ED_time_scrub_clamp_scroller_mask()

rcti ED_time_scrub_clamp_scroller_mask ( const rcti & scroller_mask)

Scroll-bars shouldn't overlap the time scrub UI. So this returns a mask adjusted to exclude it, which can be passed to UI_view2d_scrollers_draw().

Parameters
scroller_maskTypically View2D.mask (or something smaller, if further parts have been masked out already).

Definition at line 219 of file time_scrub_ui.cc.

References UI_TIME_SCRUB_MARGIN_Y, and rcti::ymax.

Referenced by action_main_region_draw_overlay(), blender::ed::vse::draw_timeline_seq_display(), graph_main_region_draw_overlay(), graph_region_draw(), and blender::ed::vse::load_data_init_from_operator().

◆ ED_time_scrub_draw()

void ED_time_scrub_draw ( const ARegion * region,
const Scene * scene,
bool display_seconds,
bool discrete_frames,
int base )

Draw the scrub area with numbers inside.

Parameters
display_secondsDefines if the display is in seconds or in frames.
baseDefines the base number from which the number distance is calculated. The distance is always a simple fraction or a multiple of that number.

Definition at line 189 of file time_scrub_ui.cc.

References draw_background(), ED_time_scrub_region_rect_get(), get_centered_text_y(), GPU_matrix_pop_projection(), GPU_matrix_push_projection(), TH_TIME_SCRUB_TEXT, UI_SCALE_FAC, UI_view2d_draw_scale_x__discrete_frames_or_seconds(), UI_view2d_draw_scale_x__frames_or_seconds(), ARegion::v2d, wmOrtho2_region_pixelspace(), and rcti::ymin.

Referenced by action_main_region_draw(), dopesheet_region_draw(), blender::ed::vse::draw_timeline_seq(), graph_main_region_draw(), graph_region_draw(), and nla_main_region_draw().

◆ ED_time_scrub_draw_current_frame()

◆ ED_time_scrub_event_in_region()

bool ED_time_scrub_event_in_region ( const ARegion * region,
const wmEvent * event )

◆ ED_time_scrub_event_in_region_poll()

bool ED_time_scrub_event_in_region_poll ( const wmWindow * win,
const ScrArea * area,
const ARegion * region,
const wmEvent * event )

Follow the EventHandlerPoll function signature.

Definition at line 233 of file time_scrub_ui.cc.

References ED_time_scrub_event_in_region().

Referenced by clip_preview_region_init(), and ed_default_handlers().

◆ ED_time_scrub_region_rect_get()

void ED_time_scrub_region_rect_get ( const ARegion * region,
rcti * r_rect )

◆ get_centered_text_y()

int get_centered_text_y ( const rcti * rect)
static

Definition at line 45 of file time_scrub_ui.cc.

References BLI_rcti_cent_y(), and UI_SCALE_FAC.

Referenced by ED_time_scrub_draw().

◆ get_current_time_str()

void get_current_time_str ( const Scene * scene,
bool display_seconds,
int frame,
char * r_str,
uint str_maxncpy )
static

Definition at line 67 of file time_scrub_ui.cc.

References BLI_snprintf_utf8(), BLI_timecode_string_from_time(), FRA2TIME, and U.

Referenced by draw_current_frame().