25#include "RNA_prototypes.hh"
42 return timeline_region_v2d->
cur.
ymin;
60 return (
U.widget_unit * 0.8 * context->scale);
65 return ((context->channel_height / context->scale) -
icon_width_get(context)) / 2;
70 float y = (index - context->draw_offset) * context->channel_height;
76 int r_channel_range[2])
79 r_channel_range[0] =
max_ii(1,
floor(context->timeline_region_v2d->cur.ymin));
80 r_channel_range[1] =
ceil(context->timeline_region_v2d->cur.ymax);
83 BLI_rctf_init(&strip_boundbox, 0.0f, 0.0f, 1.0f, r_channel_range[1]);
85 CLAMP(r_channel_range[0], strip_boundbox.
ymin, strip_boundbox.
ymax);
91 char *dyn_tooltip =
static_cast<char *
>(argN);
97 const int channel_index,
114 context->v2d->cur.xmax / context->scale - offset,
134 const int channel_index,
152 context->v2d->cur.xmax / context->scale - offset,
172 return sseq->
runtime->rename_channel_index == channel_index;
183 const int channel_index,
184 const float used_width)
187 float margin = (context->channel_height / context->scale - text_size) / 2.0f;
191 float width =
max_ff(0.0f, context->v2d->cur.xmax / context->scale - used_width);
197 margin_x -= input_box_margin;
198 width += input_box_margin;
202 BLI_rctf_init(&rect, margin_x, margin_x + width, y, y + text_size);
208 const int channel_index,
209 const float used_width)
221 &context->scene->id, &RNA_SequenceTimelineChannel, channel);
242 sseq->
runtime->rename_channel_index = 0;
268 context->region->winy / context->scale);
271 int channel_range[2];
275 const float offset_lock = icon_width * 1.5f;
276 const float offset_mute = icon_width * 2.5f;
277 const float offset_width = icon_width * 3.5f;
280 for (
int channel = channel_range[0]; channel <= channel_range[1]; channel++) {
284 for (
int channel = channel_range[0]; channel <= channel_range[1]; channel++) {
305 r_context->
region = region;
306 r_context->
v2d = ®ion->v2d;
ScrArea * CTX_wm_area(const bContext *C)
Scene * CTX_data_scene(const bContext *C)
SpaceSeq * CTX_wm_space_seq(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.
constexpr int SEQ_MAX_CHANNELS
void UI_but_func_tooltip_set(uiBut *but, uiButToolTipFunc func, void *arg, uiFreeArgFunc free_arg)
uiBut * uiDefBut(uiBlock *block, int type, int retval, blender::StringRef str, int x, int y, short width, short height, void *poin, float min, float max, const char *tip)
uiBut * uiDefIconButR_prop(uiBlock *block, int type, int retval, int icon, int x, int y, short width, short height, PointerRNA *ptr, PropertyRNA *prop, int index, float min, float max, const char *tip)
const uiStyle * UI_style_get_dpi()
uiBlock * UI_block_begin(const bContext *C, ARegion *region, std::string name, eUIEmbossType emboss)
void UI_block_emboss_set(uiBlock *block, eUIEmbossType emboss)
void UI_block_draw(const bContext *C, uiBlock *block)
int int int UI_fontstyle_height_max(const uiFontStyle *fs)
bool UI_but_active_only(const bContext *C, ARegion *region, uiBlock *block, uiBut *but)
uiBut * uiDefButR(uiBlock *block, int type, int retval, const char *str, int x, int y, short width, short height, PointerRNA *ptr, const char *propname, int index, float min, float max, const char *tip)
void UI_block_end(const bContext *C, uiBlock *block)
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)
SeqTimelineChannel * SEQ_channel_get_by_index(const ListBase *channels, const int channel_index)
bool SEQ_channel_is_locked(const SeqTimelineChannel *channel)
ListBase * SEQ_channels_displayed_get(Editing *ed)
bool SEQ_channel_is_muted(const SeqTimelineChannel *channel)
char * SEQ_channel_name_get(ListBase *channels, const int channel_index)
void MEM_freeN(void *vmemh)
ccl_device_inline float2 floor(const float2 a)
ccl_device_inline float3 ceil(const float3 a)
PropertyRNA * RNA_struct_type_find_property(StructRNA *srna, const char *identifier)
PropertyRNA * RNA_struct_name_property(const StructRNA *type)
PointerRNA RNA_pointer_create(ID *id, StructRNA *type, void *data)
const char * RNA_property_identifier(const PropertyRNA *prop)
ListBase * SEQ_active_seqbase_get(const Editing *ed)
Editing * SEQ_editing_get(const Scene *scene)
void draw_channels(const bContext *C, ARegion *region)
static bool channel_is_being_renamed(const SpaceSeq *sseq, const int channel_index)
static float channel_index_y_min(const SeqChannelDrawContext *context, const int index)
static float channel_height_pixelspace_get(const View2D *timeline_region_v2d)
static float draw_channel_widget_mute(const SeqChannelDrawContext *context, uiBlock *block, const int channel_index, const float offset)
static void draw_channel_labels(const SeqChannelDrawContext *context, uiBlock *block, const int channel_index, const float used_width)
static float draw_channel_widget_lock(const SeqChannelDrawContext *context, uiBlock *block, const int channel_index, const float offset)
void channel_draw_context_init(const bContext *C, ARegion *region, SeqChannelDrawContext *r_context)
static void draw_background()
static void displayed_channel_range_get(const SeqChannelDrawContext *context, int r_channel_range[2])
static float draw_offset_get(const View2D *timeline_region_v2d)
static std::string draw_channel_widget_tooltip(bContext *, void *argN, const char *)
static rctf label_rect_init(const SeqChannelDrawContext *context, const int channel_index, const float used_width)
static float widget_y_offset(const SeqChannelDrawContext *context)
static float frame_width_pixelspace_get(const View2D *timeline_region_v2d)
static void draw_channel_headers(const SeqChannelDrawContext *context)
static float icon_width_get(const SeqChannelDrawContext *context)
static float text_size_get(const SeqChannelDrawContext *context)
void SEQ_timeline_expand_boundbox(const Scene *scene, const ListBase *seqbase, rctf *rect)
ARegion * timeline_region
View2D * timeline_region_v2d
SpaceSeq_Runtime * runtime
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
void wmOrtho2_pixelspace(const float x, const float y)