25#include "RNA_prototypes.hh"
44 return timeline_region_v2d->
cur.
ymin;
62 return (
U.widget_unit * 0.8 * context->scale);
67 return ((context->channel_height / context->scale) -
icon_width_get(context)) / 2;
72 float y = (index - context->draw_offset) * context->channel_height;
78 int r_channel_range[2])
81 r_channel_range[0] =
max_ii(1,
floor(context->timeline_region_v2d->cur.ymin));
82 r_channel_range[1] =
ceil(context->timeline_region_v2d->cur.ymax);
85 BLI_rctf_init(&strip_boundbox, 0.0f, 0.0f, 1.0f, r_channel_range[1]);
87 CLAMP(r_channel_range[0], strip_boundbox.
ymin, strip_boundbox.
ymax);
95 char *dyn_tooltip =
static_cast<char *
>(argN);
101 const int channel_index,
111 &context->scene->id, &RNA_SequenceTimelineChannel, channel);
119 context->v2d->cur.xmax / context->scale - offset,
139 const int channel_index,
150 &context->scene->id, &RNA_SequenceTimelineChannel, channel);
158 context->v2d->cur.xmax / context->scale - offset,
189 const int channel_index,
190 const float used_width)
193 float margin = (context->channel_height / context->scale - text_size) / 2.0f;
197 float width =
max_ff(0.0f, context->v2d->cur.xmax / context->scale - used_width);
203 margin_x -= input_box_margin;
204 width += input_box_margin;
214 const int channel_index,
215 const float used_width)
227 &context->scene->id, &RNA_SequenceTimelineChannel, channel);
274 context->region->winy / context->scale);
277 int channel_range[2];
281 const float offset_lock = icon_width * 1.5f;
282 const float offset_mute = icon_width * 2.5f;
283 const float offset_width = icon_width * 3.5f;
286 for (
int channel = channel_range[0]; channel <= channel_range[1]; channel++) {
290 for (
int channel = channel_range[0]; channel <= channel_range[1]; channel++) {
311 r_context->
region = region;
312 r_context->
v2d = ®ion->
v2d;
ScrArea * CTX_wm_area(const bContext *C)
SpaceSeq * CTX_wm_space_seq(const bContext *C)
Scene * CTX_data_sequencer_scene(const bContext *C)
ARegion * BKE_area_find_region_type(const ScrArea *area, int region_type)
MINLINE int round_fl_to_int(float a)
MINLINE float max_ff(float a, float b)
MINLINE float min_ff(float a, float b)
MINLINE int max_ii(int a, int b)
void BLI_rctf_init(struct rctf *rect, float xmin, float xmax, float ymin, float ymax)
BLI_INLINE float BLI_rctf_size_x(const struct rctf *rct)
BLI_INLINE float BLI_rctf_size_y(const struct rctf *rct)
char * BLI_sprintfN(const char *__restrict format,...) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_MALLOC ATTR_PRINTF_FORMAT(1
Read Guarded memory(de)allocation.
uiBut * uiDefButR(uiBlock *block, ButType type, int retval, std::optional< blender::StringRef > str, int x, int y, short width, short height, PointerRNA *ptr, blender::StringRefNull propname, int index, float min, float max, std::optional< blender::StringRef > tip)
void UI_block_emboss_set(uiBlock *block, blender::ui::EmbossType emboss)
uiBlock * UI_block_begin(const bContext *C, ARegion *region, std::string name, blender::ui::EmbossType emboss)
void UI_but_func_tooltip_set(uiBut *but, uiButToolTipFunc func, void *arg, uiFreeArgFunc free_arg)
const uiStyle * UI_style_get_dpi()
int UI_fontstyle_height_max(const uiFontStyle *fs)
uiBut * uiDefIconButR_prop(uiBlock *block, ButType type, int retval, int icon, int x, int y, short width, short height, PointerRNA *ptr, PropertyRNA *prop, int index, float min, float max, std::optional< blender::StringRef > tip)
void UI_block_draw(const bContext *C, uiBlock *block)
bool UI_but_active_only(const bContext *C, ARegion *region, uiBlock *block, uiBut *but)
void UI_block_end(const bContext *C, uiBlock *block)
uiBut * uiDefBut(uiBlock *block, uiButTypeWithPointerType but_and_ptr_type, int retval, blender::StringRef str, int x, int y, short width, short height, void *poin, float min, float max, std::optional< blender::StringRef > tip)
void UI_ThemeClearColor(int colorid)
void UI_view2d_view_restore(const bContext *C)
float UI_view2d_view_to_region_y(const View2D *v2d, float y)
void UI_view2d_view_ortho(const View2D *v2d)
float UI_view2d_view_to_region_x(const View2D *v2d, float x)
void MEM_freeN(void *vmemh)
static std::string draw_channel_widget_tooltip(bContext *, void *argN, const blender::StringRef)
static bool channel_is_being_renamed(const SpaceSeq *sseq, const int channel_index)
static float icon_width_get(const SeqChannelDrawContext *context)
static void draw_channel_headers(const SeqChannelDrawContext *context)
void channel_draw_context_init(const bContext *C, ARegion *region, SeqChannelDrawContext *r_context)
static float draw_offset_get(const View2D *timeline_region_v2d)
static float text_size_get(const SeqChannelDrawContext *context)
static void draw_background()
static float draw_channel_widget_mute(const SeqChannelDrawContext *context, uiBlock *block, const int channel_index, const float offset)
static float frame_width_pixelspace_get(const View2D *timeline_region_v2d)
static float draw_channel_widget_lock(const SeqChannelDrawContext *context, uiBlock *block, const int channel_index, const float offset)
static float widget_y_offset(const SeqChannelDrawContext *context)
static void displayed_channel_range_get(const SeqChannelDrawContext *context, int r_channel_range[2])
static rctf label_rect_init(const SeqChannelDrawContext *context, const int channel_index, const float used_width)
void draw_channels(const bContext *C, ARegion *region)
static float channel_height_pixelspace_get(const View2D *timeline_region_v2d)
static float channel_index_y_min(const SeqChannelDrawContext *context, const int index)
static void draw_channel_labels(const SeqChannelDrawContext *context, uiBlock *block, const int channel_index, const float used_width)
SeqTimelineChannel * channel_get_by_index(const ListBase *channels, const int channel_index)
ListBase * channels_displayed_get(const Editing *ed)
bool channel_is_locked(const SeqTimelineChannel *channel)
Editing * editing_get(const Scene *scene)
constexpr int MAX_CHANNELS
void timeline_expand_boundbox(const Scene *scene, const ListBase *seqbase, rctf *rect)
char * channel_name_get(ListBase *channels, const int channel_index)
bool channel_is_muted(const SeqTimelineChannel *channel)
ListBase * active_seqbase_get(const Editing *ed)
PropertyRNA * RNA_struct_type_find_property(StructRNA *srna, const char *identifier)
PropertyRNA * RNA_struct_name_property(const StructRNA *type)
PointerRNA RNA_pointer_create_discrete(ID *id, StructRNA *type, void *data)
const char * RNA_property_identifier(const PropertyRNA *prop)
SpaceSeq_Runtime * runtime
View2D * timeline_region_v2d
ARegion * timeline_region
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
void wmOrtho2_pixelspace(const float x, const float y)