Blender V4.3
sequencer_channels_edit.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2022 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
9#include "DNA_scene_types.h"
10#include "DNA_screen_types.h"
12
13#include "BKE_context.hh"
14
15#include "BLI_utildefines.h"
16
17#include "ED_screen.hh"
18
19#include "UI_view2d.hh"
20
21#include "WM_api.hh"
22
23/* Own include. */
24#include "sequencer_intern.hh"
25
26static int sequencer_rename_channel_invoke(bContext *C, wmOperator * /*op*/, const wmEvent *event)
27{
29 SpaceSeq *sseq = CTX_wm_space_seq(C);
31 float mouse_y = UI_view2d_region_to_view_y(context.timeline_region_v2d, event->mval[1]);
32
33 sseq->runtime->rename_channel_index = mouse_y;
35 return OPERATOR_FINISHED;
36}
37
39{
40 /* Identifiers. */
41 ot->name = "Rename Channel";
42 ot->idname = "SEQUENCER_OT_rename_channel";
43
44 /* Api callbacks. */
47
48 /* Flags. */
50}
Scene * CTX_data_scene(const bContext *C)
SpaceSeq * CTX_wm_space_seq(const bContext *C)
ARegion * CTX_wm_region(const bContext *C)
float UI_view2d_region_to_view_y(const View2D *v2d, float y)
Definition view2d.cc:1657
#define ND_SEQUENCER
Definition WM_types.hh:404
@ OPTYPE_INTERNAL
Definition WM_types.hh:182
@ OPTYPE_UNDO
Definition WM_types.hh:162
@ OPTYPE_REGISTER
Definition WM_types.hh:160
#define NC_SCENE
Definition WM_types.hh:345
void channel_draw_context_init(const bContext *C, ARegion *region, SeqChannelDrawContext *r_context)
static int sequencer_rename_channel_invoke(bContext *C, wmOperator *, const wmEvent *event)
void SEQUENCER_OT_rename_channel(wmOperatorType *ot)
bool sequencer_edit_with_channel_region_poll(bContext *C)
SpaceSeq_Runtime * runtime
int mval[2]
Definition WM_types.hh:728
const char * name
Definition WM_types.hh:990
bool(* poll)(bContext *C) ATTR_WARN_UNUSED_RESULT
Definition WM_types.hh:1042
const char * idname
Definition WM_types.hh:992
int(* invoke)(bContext *C, wmOperator *op, const wmEvent *event) ATTR_WARN_UNUSED_RESULT
Definition WM_types.hh:1022
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
wmOperatorType * ot
Definition wm_files.cc:4125