Blender  V3.3
sequencer_channels_edit.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2022 Blender Foundation. All rights reserved. */
3 
8 #include "DNA_scene_types.h"
9 #include "DNA_screen_types.h"
11 
12 #include "BKE_context.h"
13 
14 #include "BLI_blenlib.h"
15 #include "BLI_utildefines.h"
16 
17 #include "ED_screen.h"
18 
19 #include "UI_view2d.h"
20 
21 #include "SEQ_channels.h"
22 #include "SEQ_sequencer.h"
23 #include "SEQ_time.h"
24 
25 #include "WM_api.h"
26 
27 #include "RNA_define.h"
28 #include "RNA_enum_types.h"
29 
30 /* Own include. */
31 #include "sequencer_intern.h"
32 
34  wmOperator *UNUSED(op),
35  const wmEvent *event)
36 {
38  SpaceSeq *sseq = CTX_wm_space_seq(C);
40  float mouse_y = UI_view2d_region_to_view_y(context.timeline_region_v2d, event->mval[1]);
41 
42  sseq->runtime.rename_channel_index = mouse_y;
44  return OPERATOR_FINISHED;
45 }
46 
48 {
49  /* Identifiers. */
50  ot->name = "Rename Channel";
51  ot->idname = "SEQUENCER_OT_rename_channel";
52 
53  /* Api callbacks. */
56 
57  /* Flags. */
59 }
struct Scene * CTX_data_scene(const bContext *C)
Definition: context.c:1090
struct SpaceSeq * CTX_wm_space_seq(const bContext *C)
Definition: context.c:851
struct ARegion * CTX_wm_region(const bContext *C)
Definition: context.c:749
#define UNUSED(x)
@ OPERATOR_FINISHED
#define C
Definition: RandGen.cpp:25
float UI_view2d_region_to_view_y(const struct View2D *v2d, float y)
Definition: view2d.cc:1660
#define ND_SEQUENCER
Definition: WM_types.h:385
@ OPTYPE_INTERNAL
Definition: WM_types.h:168
@ OPTYPE_UNDO
Definition: WM_types.h:148
@ OPTYPE_REGISTER
Definition: WM_types.h:146
#define NC_SCENE
Definition: WM_types.h:328
void channel_draw_context_init(const bContext *C, ARegion *region, SeqChannelDrawContext *r_context)
static int sequencer_rename_channel_invoke(bContext *C, wmOperator *UNUSED(op), const wmEvent *event)
void SEQUENCER_OT_rename_channel(struct wmOperatorType *ot)
bool sequencer_edit_poll(bContext *C)
SpaceSeqRuntime runtime
int mval[2]
Definition: WM_types.h:684
int(* invoke)(struct bContext *, struct wmOperator *, const struct wmEvent *) ATTR_WARN_UNUSED_RESULT
Definition: WM_types.h:919
const char * name
Definition: WM_types.h:888
const char * idname
Definition: WM_types.h:890
bool(* poll)(struct bContext *) ATTR_WARN_UNUSED_RESULT
Definition: WM_types.h:943
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
wmOperatorType * ot
Definition: wm_files.c:3479