34#include "RNA_prototypes.hh"
66 const Scene *scene,
bool display_seconds,
int frame,
char *r_str,
uint str_maxncpy)
68 if (display_seconds) {
79 const rcti *scrub_region_rect,
81 bool display_stalk =
true)
107 subframe_x - (line_outline +
U.pixelsize),
108 scrub_region_rect->
ymax - box_padding,
109 subframe_x + (line_outline +
U.pixelsize),
115 subframe_x -
U.pixelsize,
116 scrub_region_rect->
ymax - box_padding,
117 subframe_x +
U.pixelsize,
125 float outline_color[4];
129 rect.
xmin = frame_x - box_width / 2 +
U.pixelsize / 2;
130 rect.
xmax = frame_x + box_width / 2 +
U.pixelsize / 2;
131 rect.
ymin = scrub_region_rect->
ymin + box_padding;
132 rect.
ymax = scrub_region_rect->
ymax - box_padding;
134 &rect, bg_color,
nullptr, 1.0f, outline_color,
U.pixelsize, 4 *
UI_SCALE_FAC);
142 +fstyle, frame_x - text_width / 2 +
U.pixelsize / 2,
y, frame_str, text_color);
147 bool display_seconds,
154 rcti scrub_region_rect;
158 scene, display_seconds, v2d, &scrub_region_rect, scene->
r.
cfra, display_stalk);
164 bool display_seconds,
165 bool discrete_frames)
172 rcti scrub_region_rect;
177 rcti numbers_rect = scrub_region_rect;
179 if (discrete_frames) {
181 region, v2d, &numbers_rect, scene, display_seconds,
TH_TEXT);
185 region, v2d, &numbers_rect, scene, display_seconds,
TH_TEXT);
193 rcti clamped_mask = scroller_mask;
240 rect.
xmin + padding_x,
bScreen * CTX_wm_screen(const bContext *C)
float BKE_scene_ctime_get(const Scene *scene)
MINLINE int round_fl_to_int(float a)
MINLINE int max_ii(int a, int b)
bool BLI_rcti_isect_pt_v(const struct rcti *rect, const int xy[2])
BLI_INLINE int BLI_rcti_size_x(const struct rcti *rct)
BLI_INLINE int BLI_rcti_cent_y(const struct rcti *rct)
size_t BLI_snprintf(char *__restrict dst, size_t dst_maxncpy, const char *__restrict format,...) ATTR_NONNULL(1
size_t BLI_timecode_string_from_time(char *str, size_t maxncpy, int brevity_level, float time_seconds, double fps, short timecode_style) ATTR_NONNULL()
void GPU_matrix_push_projection()
void GPU_matrix_pop_projection()
@ GPU_SHADER_3D_UNIFORM_COLOR
void GPU_blend(eGPUBlend blend)
void UI_fontstyle_draw_simple(const uiFontStyle *fs, float x, float y, const char *str, const uchar col[4])
uiBlock * UI_block_begin(const bContext *C, ARegion *region, std::string name, blender::ui::EmbossType emboss)
void UI_block_bounds_set_normal(uiBlock *block, int addval)
void UI_draw_roundbox_4fv_ex(const rctf *rect, const float inner1[4], const float inner2[4], float shade_dir, const float outline[4], float outline_width, float rad)
const uiStyle * UI_style_get_dpi()
void UI_draw_roundbox_corner_set(int type)
void UI_block_draw(const bContext *C, uiBlock *block)
void UI_block_align_begin(uiBlock *block)
int UI_fontstyle_string_width(const uiFontStyle *fs, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1
void UI_block_flag_enable(uiBlock *block, int flag)
void UI_block_end(const bContext *C, uiBlock *block)
void UI_block_align_end(uiBlock *block)
void uiLayoutSetScaleY(uiLayout *layout, float scale)
uiLayout * UI_block_layout(uiBlock *block, int dir, int type, int x, int y, int size, int em, int padding, const uiStyle *style)
void UI_block_layout_resolve(uiBlock *block, int *r_x, int *r_y)
void UI_block_layout_set_current(uiBlock *block, uiLayout *layout)
@ TH_TIME_SCRUB_BACKGROUND
void UI_GetThemeColorShade4fv(int colorid, int offset, float col[4])
void UI_GetThemeColor4ubv(int colorid, unsigned char col[4])
void UI_view2d_draw_scale_x__discrete_frames_or_seconds(const ARegion *region, const View2D *v2d, const rcti *rect, const Scene *scene, bool display_seconds, int colorid)
void UI_view2d_draw_scale_x__frames_or_seconds(const ARegion *region, const View2D *v2d, const rcti *rect, const Scene *scene, bool display_seconds, int colorid)
#define UI_TIME_SCRUB_MARGIN_Y
float UI_view2d_view_to_region_x(const View2D *v2d, float x)
PointerRNA RNA_pointer_create_discrete(ID *id, StructRNA *type, void *data)
void prop(PointerRNA *ptr, PropertyRNA *prop, int index, int value, eUI_Item_Flag flag, std::optional< blender::StringRef > name_opt, int icon, std::optional< blender::StringRef > placeholder=std::nullopt)
static void get_current_time_str(const Scene *scene, bool display_seconds, int frame, char *r_str, uint str_maxncpy)
rcti ED_time_scrub_clamp_scroller_mask(const rcti &scroller_mask)
static void draw_background(const rcti *rect)
void ED_time_scrub_region_rect_get(const ARegion *region, rcti *r_rect)
void ED_time_scrub_channel_search_draw(const bContext *C, ARegion *region, bDopeSheet *dopesheet)
bool ED_time_scrub_event_in_region_poll(const wmWindow *, const ScrArea *, const ARegion *region, const wmEvent *event)
void ED_time_scrub_draw_current_frame(const ARegion *region, const Scene *scene, bool display_seconds, bool display_stalk)
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(const ARegion *region, const Scene *scene, bool display_seconds, bool discrete_frames)
static int get_centered_text_y(const rcti *rect)
bool ED_time_scrub_event_in_region(const ARegion *region, const wmEvent *event)
void wmOrtho2_region_pixelspace(const ARegion *region)