Blender
V4.3
source
blender
editors
space_sequencer
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
"
11
#include "
DNA_windowmanager_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
26
static
int
sequencer_rename_channel_invoke
(
bContext
*C,
wmOperator
*
/*op*/
,
const
wmEvent
*event)
27
{
28
SeqChannelDrawContext
context;
29
SpaceSeq
*sseq =
CTX_wm_space_seq
(C);
30
channel_draw_context_init
(C,
CTX_wm_region
(C), &context);
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;
34
WM_event_add_notifier
(C,
NC_SCENE
|
ND_SEQUENCER
,
CTX_data_scene
(C));
35
return
OPERATOR_FINISHED
;
36
}
37
38
void
SEQUENCER_OT_rename_channel
(
wmOperatorType
*
ot
)
39
{
40
/* Identifiers. */
41
ot
->
name
=
"Rename Channel"
;
42
ot
->
idname
=
"SEQUENCER_OT_rename_channel"
;
43
44
/* Api callbacks. */
45
ot
->
invoke
=
sequencer_rename_channel_invoke
;
46
ot
->
poll
=
sequencer_edit_with_channel_region_poll
;
47
48
/* Flags. */
49
ot
->
flag
=
OPTYPE_REGISTER
|
OPTYPE_UNDO
|
OPTYPE_INTERNAL
;
50
}
BKE_context.hh
CTX_data_scene
Scene * CTX_data_scene(const bContext *C)
Definition
blenkernel/intern/context.cc:1111
CTX_wm_space_seq
SpaceSeq * CTX_wm_space_seq(const bContext *C)
Definition
blenkernel/intern/context.cc:864
CTX_wm_region
ARegion * CTX_wm_region(const bContext *C)
Definition
blenkernel/intern/context.cc:762
BLI_utildefines.h
DNA_scene_types.h
DNA_screen_types.h
DNA_windowmanager_types.h
OPERATOR_FINISHED
@ OPERATOR_FINISHED
Definition
DNA_windowmanager_types.h:661
ED_screen.hh
UI_view2d.hh
UI_view2d_region_to_view_y
float UI_view2d_region_to_view_y(const View2D *v2d, float y)
Definition
view2d.cc:1657
WM_api.hh
ND_SEQUENCER
#define ND_SEQUENCER
Definition
WM_types.hh:404
OPTYPE_INTERNAL
@ OPTYPE_INTERNAL
Definition
WM_types.hh:182
OPTYPE_UNDO
@ OPTYPE_UNDO
Definition
WM_types.hh:162
OPTYPE_REGISTER
@ OPTYPE_REGISTER
Definition
WM_types.hh:160
NC_SCENE
#define NC_SCENE
Definition
WM_types.hh:345
channel_draw_context_init
void channel_draw_context_init(const bContext *C, ARegion *region, SeqChannelDrawContext *r_context)
Definition
sequencer_channels_draw.cc:299
sequencer_rename_channel_invoke
static int sequencer_rename_channel_invoke(bContext *C, wmOperator *, const wmEvent *event)
Definition
sequencer_channels_edit.cc:26
SEQUENCER_OT_rename_channel
void SEQUENCER_OT_rename_channel(wmOperatorType *ot)
Definition
sequencer_channels_edit.cc:38
sequencer_edit_with_channel_region_poll
bool sequencer_edit_with_channel_region_poll(bContext *C)
Definition
sequencer_edit.cc:160
sequencer_intern.hh
SeqChannelDrawContext
Definition
sequencer_intern.hh:66
SpaceSeq
Definition
DNA_space_types.h:664
SpaceSeq::runtime
SpaceSeq_Runtime * runtime
Definition
DNA_space_types.h:709
bContext
Definition
blenkernel/intern/context.cc:61
wmEvent
Definition
WM_types.hh:718
wmEvent::mval
int mval[2]
Definition
WM_types.hh:728
wmOperatorType
Definition
WM_types.hh:988
wmOperatorType::name
const char * name
Definition
WM_types.hh:990
wmOperatorType::flag
short flag
Definition
WM_types.hh:1110
wmOperatorType::poll
bool(* poll)(bContext *C) ATTR_WARN_UNUSED_RESULT
Definition
WM_types.hh:1042
wmOperatorType::idname
const char * idname
Definition
WM_types.hh:992
wmOperatorType::invoke
int(* invoke)(bContext *C, wmOperator *op, const wmEvent *event) ATTR_WARN_UNUSED_RESULT
Definition
WM_types.hh:1022
wmOperator
Definition
DNA_windowmanager_types.h:623
WM_event_add_notifier
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
Definition
wm_event_system.cc:387
ot
wmOperatorType * ot
Definition
wm_files.cc:4125
Generated on Thu Feb 6 2025 07:36:39 for Blender by
doxygen
1.11.0