35#include "RNA_prototypes.hh"
68 const Scene *scene,
bool display_seconds,
int frame,
char *r_str,
uint str_maxncpy)
70 if (display_seconds) {
72 r_str, str_maxncpy, -1,
FRA2TIME(frame), scene->frames_per_second(),
U.timecode_style);
82 const rcti *scrub_region_rect,
84 bool display_stalk =
true)
94 const float box_width = std::max(text_width + (2.0f * text_padding), box_min_width);
97 const float tri_top =
ceil(scrub_region_rect->
ymin + box_margin);
119 immVertex2f(
pos,
floor(frame_x + tri_half_width + shadow_width + 1.0f + diag_offset), tri_top);
120 immVertex2f(
pos, frame_x + 0.5f, tri_top - tri_height - diag_offset - shadow_width);
128 rect.
xmin =
floor(subframe_x) - shadow_width;
129 rect.
xmax = rect.
xmin +
U.pixelsize + shadow_width + shadow_width;
132 rect.
xmin =
floor(subframe_x -
U.pixelsize) - shadow_width;
133 rect.
xmax =
floor(subframe_x +
U.pixelsize + 1.0f) + shadow_width;
136 rect.
ymax =
ceil(scrub_region_rect->
ymax - box_margin + shadow_width);
143 rect.
xmin = frame_x - (box_width / 2.0f);
144 rect.
xmax = frame_x + (box_width / 2.0f) + 1.0f;
145 rect.
ymin =
floor(scrub_region_rect->
ymin + (box_margin - shadow_width));
146 rect.
ymax =
ceil(scrub_region_rect->
ymax - box_margin + shadow_width);
148 &rect, fg_color,
nullptr, 1.0f, bg_color, shadow_width, box_corner_radius);
174 bool display_seconds,
181 rcti scrub_region_rect;
185 scene, display_seconds, v2d, &scrub_region_rect, scene->
r.
cfra, display_stalk);
191 bool display_seconds,
192 bool discrete_frames,
200 rcti scrub_region_rect;
205 rcti numbers_rect = scrub_region_rect;
207 if (discrete_frames) {
221 rcti clamped_mask = scroller_mask;
269 rect.
xmin + padding_x,
bScreen * CTX_wm_screen(const bContext *C)
float BKE_scene_ctime_get(const Scene *scene)
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 size_t size_t BLI_snprintf_utf8(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(GPUBlend blend)
void GPU_polygon_smooth(bool enable)
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)
@ TH_TIME_SCRUB_BACKGROUND
void UI_GetThemeColor4fv(int colorid, float col[4])
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, int base)
#define UI_TIME_SCRUB_MARGIN_Y
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, int base)
float UI_view2d_view_to_region_x(const View2D *v2d, float x)
int2 block_layout_resolve(uiBlock *block)
uiLayout & block_layout(uiBlock *block, LayoutDirection direction, LayoutType type, int x, int y, int size, int em, int padding, const uiStyle *style)
void block_layout_set_current(uiBlock *block, uiLayout *layout)
PointerRNA RNA_pointer_create_discrete(ID *id, StructRNA *type, void *data)
void scale_y_set(float scale)
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_draw(const ARegion *region, const Scene *scene, bool display_seconds, bool discrete_frames, const int base)
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)
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)