25#include "RNA_prototypes.hh"
43 return timeline_region_v2d->
cur.
ymin;
61 return (
U.widget_unit * 0.8 * context->scale);
66 return ((context->channel_height / context->scale) -
icon_width_get(context)) / 2;
71 float y = (
index - context->draw_offset) * context->channel_height;
77 int r_channel_range[2])
80 r_channel_range[0] =
max_ii(1,
floor(context->timeline_region_v2d->cur.ymin));
81 r_channel_range[1] =
ceil(context->timeline_region_v2d->cur.ymax);
84 BLI_rctf_init(&strip_boundbox, 0.0f, 0.0f, 1.0f, r_channel_range[1]);
86 CLAMP(r_channel_range[0], strip_boundbox.
ymin, strip_boundbox.
ymax);
94 char *dyn_tooltip =
static_cast<char *
>(argN);
100 const int channel_index,
107 const int icon = channel->is_muted() ? ICON_CHECKBOX_DEHLT : ICON_CHECKBOX_HLT;
110 &context->scene->id, RNA_SequenceTimelineChannel, channel);
117 context->v2d->cur.xmax / context->scale - offset,
129 "%s channel %d", channel->is_muted() ?
"Unmute" :
"Mute", channel_index);
137 const int channel_index,
145 const int icon = channel->is_locked() ? ICON_LOCKED : ICON_UNLOCKED;
148 &context->scene->id, RNA_SequenceTimelineChannel, channel);
155 context->v2d->cur.xmax / context->scale - offset,
167 "%s channel %d", channel->is_locked() ?
"Unlock" :
"Lock", channel_index);
186 const int channel_index,
187 const float used_width)
190 float margin = (context->channel_height / context->scale - text_size) / 2.0f;
194 float width =
max_ff(0.0f, context->v2d->cur.xmax / context->scale - used_width);
200 margin_x -= input_box_margin;
201 width += input_box_margin;
211 const int channel_index,
212 const float used_width)
224 &context->scene->id, RNA_SequenceTimelineChannel, channel);
243 if (button_active_only(context->C, context->region, block, but) ==
false) {
250 const char *label = channel->
name;
269 context->region->winy / context->scale);
272 int channel_range[2];
276 const float offset_lock = icon_width * 1.5f;
277 const float offset_mute = icon_width * 2.5f;
278 const float offset_width = icon_width * 3.5f;
281 for (
int channel = channel_range[0]; channel <= channel_range[1]; channel++) {
285 for (
int channel = channel_range[0]; channel <= channel_range[1]; channel++) {
289 block_end(context->C, block);
290 block_draw(context->C, block);
306 r_context->
region = region;
307 r_context->
v2d = ®ion->
v2d;
Read Blender memory allocation and freeing.
static std::string draw_channel_widget_tooltip(bContext *, void *argN, const 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_lock(const SeqChannelDrawContext *context, ui::Block *block, const int channel_index, const float offset)
static void draw_channel_labels(const SeqChannelDrawContext *context, ui::Block *block, const int channel_index, const float used_width)
static float frame_width_pixelspace_get(const View2D *timeline_region_v2d)
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)
static float draw_channel_widget_mute(const SeqChannelDrawContext *context, ui::Block *block, const int channel_index, const float offset)
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)
ListBaseT< Strip > * active_seqbase_get(const Editing *ed)
Editing * editing_get(const Scene *scene)
constexpr int MAX_CHANNELS
SeqTimelineChannel * channel_get_by_index(const ListBaseT< SeqTimelineChannel > *channels, const int channel_index)
void timeline_expand_boundbox(const Scene *scene, const ListBaseT< Strip > *seqbase, rctf *rect)
ListBaseT< SeqTimelineChannel > * channels_displayed_get(const Editing *ed)
void frame_buffer_clear(int colorid)
void view2d_view_ortho(const View2D *v2d)
void view2d_view_restore(const bContext *C)
float view2d_view_to_region_y(const View2D *v2d, float y)
const uiStyle * style_get_dpi()
int fontstyle_height_max(const uiFontStyle *fs)
float view2d_view_to_region_x(const View2D *v2d, float x)
MINLINE float min_ff(float a, float b)
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
ScrArea * CTX_wm_area(const bContext *C)
Scene * CTX_data_sequencer_scene(const bContext *C)
void wmOrtho2_pixelspace(const float x, const float y)
MINLINE int round_fl_to_int(float a)
const char * RNA_property_identifier(const PropertyRNA *prop)
char * BLI_sprintfN(const char *__restrict format,...) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_MALLOC ATTR_PRINTF_FORMAT(1
MINLINE int max_ii(int a, int b)
void MEM_delete_void(void *vmemh)
SpaceSeq * CTX_wm_space_seq(const bContext *C)
BLI_INLINE float BLI_rctf_size_y(const struct rctf *rct)
PointerRNA RNA_pointer_create_discrete(ID *id, StructRNA *type, void *data)
PropertyRNA * RNA_struct_type_find_property(StructRNA *srna, const char *identifier)
PropertyRNA * RNA_struct_name_property(const StructRNA *type)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
ARegion * BKE_area_find_region_type(const ScrArea *area, int region_type)
BLI_INLINE float BLI_rctf_size_x(const struct rctf *rct)
MINLINE float max_ff(float a, float b)
void BLI_rctf_init(struct rctf *rect, float xmin, float xmax, float ymin, float ymax)
ed::vse::SpaceSeq_Runtime * runtime
View2D * timeline_region_v2d
ListBaseT< SeqTimelineChannel > * channels
ListBaseT< Strip > * seqbase
ARegion * timeline_region