Cleanup: Rename Panel * variables from pa to panel
[blender.git] / source / blender / editors / space_sequencer / sequencer_ops.c
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * The Original Code is Copyright (C) 2008 Blender Foundation.
17  * All rights reserved.
18  */
19
20 /** \file
21  * \ingroup spseq
22  */
23
24 #include <math.h>
25 #include <stdlib.h>
26
27 #include "DNA_space_types.h"
28
29 #include "WM_api.h"
30 #include "WM_types.h"
31
32 #include "ED_markers.h"
33 #include "ED_select_utils.h"
34 #include "ED_sequencer.h"
35 #include "ED_transform.h" /* transform keymap */
36
37 #include "BKE_sequencer.h"
38
39 #include "sequencer_intern.h"
40
41 /* ************************** registration **********************************/
42
43 void sequencer_operatortypes(void)
44 {
45   /* sequencer_edit.c */
46   WM_operatortype_append(SEQUENCER_OT_split);
47   WM_operatortype_append(SEQUENCER_OT_slip);
48   WM_operatortype_append(SEQUENCER_OT_mute);
49   WM_operatortype_append(SEQUENCER_OT_unmute);
50   WM_operatortype_append(SEQUENCER_OT_lock);
51   WM_operatortype_append(SEQUENCER_OT_unlock);
52   WM_operatortype_append(SEQUENCER_OT_reload);
53   WM_operatortype_append(SEQUENCER_OT_refresh_all);
54   WM_operatortype_append(SEQUENCER_OT_reassign_inputs);
55   WM_operatortype_append(SEQUENCER_OT_swap_inputs);
56   WM_operatortype_append(SEQUENCER_OT_duplicate);
57   WM_operatortype_append(SEQUENCER_OT_delete);
58   WM_operatortype_append(SEQUENCER_OT_offset_clear);
59   WM_operatortype_append(SEQUENCER_OT_images_separate);
60   WM_operatortype_append(SEQUENCER_OT_meta_toggle);
61   WM_operatortype_append(SEQUENCER_OT_meta_make);
62   WM_operatortype_append(SEQUENCER_OT_meta_separate);
63
64   WM_operatortype_append(SEQUENCER_OT_gap_remove);
65   WM_operatortype_append(SEQUENCER_OT_gap_insert);
66   WM_operatortype_append(SEQUENCER_OT_snap);
67   WM_operatortype_append(SEQUENCER_OT_strip_jump);
68   WM_operatortype_append(SEQUENCER_OT_swap);
69   WM_operatortype_append(SEQUENCER_OT_swap_data);
70   WM_operatortype_append(SEQUENCER_OT_rendersize);
71
72   WM_operatortype_append(SEQUENCER_OT_export_subtitles);
73
74   WM_operatortype_append(SEQUENCER_OT_copy);
75   WM_operatortype_append(SEQUENCER_OT_paste);
76
77   WM_operatortype_append(SEQUENCER_OT_view_all);
78   WM_operatortype_append(SEQUENCER_OT_view_selected);
79   WM_operatortype_append(SEQUENCER_OT_view_frame);
80   WM_operatortype_append(SEQUENCER_OT_view_all_preview);
81   WM_operatortype_append(SEQUENCER_OT_view_toggle);
82   WM_operatortype_append(SEQUENCER_OT_view_zoom_ratio);
83   WM_operatortype_append(SEQUENCER_OT_view_ghost_border);
84
85   WM_operatortype_append(SEQUENCER_OT_rebuild_proxy);
86   WM_operatortype_append(SEQUENCER_OT_enable_proxies);
87   WM_operatortype_append(SEQUENCER_OT_change_effect_input);
88   WM_operatortype_append(SEQUENCER_OT_change_effect_type);
89   WM_operatortype_append(SEQUENCER_OT_change_path);
90
91   WM_operatortype_append(SEQUENCER_OT_set_range_to_strips);
92
93   /* sequencer_select.c */
94   WM_operatortype_append(SEQUENCER_OT_select_all);
95   WM_operatortype_append(SEQUENCER_OT_select);
96   WM_operatortype_append(SEQUENCER_OT_select_more);
97   WM_operatortype_append(SEQUENCER_OT_select_less);
98   WM_operatortype_append(SEQUENCER_OT_select_linked_pick);
99   WM_operatortype_append(SEQUENCER_OT_select_linked);
100   WM_operatortype_append(SEQUENCER_OT_select_handles);
101   WM_operatortype_append(SEQUENCER_OT_select_side);
102   WM_operatortype_append(SEQUENCER_OT_select_box);
103   WM_operatortype_append(SEQUENCER_OT_select_grouped);
104
105   /* sequencer_add.c */
106   WM_operatortype_append(SEQUENCER_OT_scene_strip_add);
107   WM_operatortype_append(SEQUENCER_OT_movieclip_strip_add);
108   WM_operatortype_append(SEQUENCER_OT_mask_strip_add);
109   WM_operatortype_append(SEQUENCER_OT_movie_strip_add);
110   WM_operatortype_append(SEQUENCER_OT_sound_strip_add);
111   WM_operatortype_append(SEQUENCER_OT_image_strip_add);
112   WM_operatortype_append(SEQUENCER_OT_effect_strip_add);
113
114   /* sequencer_modifiers.c */
115   WM_operatortype_append(SEQUENCER_OT_strip_modifier_add);
116   WM_operatortype_append(SEQUENCER_OT_strip_modifier_remove);
117   WM_operatortype_append(SEQUENCER_OT_strip_modifier_move);
118   WM_operatortype_append(SEQUENCER_OT_strip_modifier_copy);
119
120   /* sequencer_view.h */
121   WM_operatortype_append(SEQUENCER_OT_sample);
122 }
123
124 void sequencer_keymap(wmKeyConfig *keyconf)
125 {
126   /* Common items ------------------------------------------------------------------ */
127   WM_keymap_ensure(keyconf, "SequencerCommon", SPACE_SEQ, 0);
128
129   /* Strips Region --------------------------------------------------------------- */
130   WM_keymap_ensure(keyconf, "Sequencer", SPACE_SEQ, 0);
131
132   /* Preview Region ----------------------------------------------------------- */
133   WM_keymap_ensure(keyconf, "SequencerPreview", SPACE_SEQ, 0);
134 }
135
136 void ED_operatormacros_sequencer(void)
137 {
138   wmOperatorType *ot;
139
140   ot = WM_operatortype_append_macro("SEQUENCER_OT_duplicate_move",
141                                     "Duplicate Strips",
142                                     "Duplicate selected strips and move them",
143                                     OPTYPE_UNDO | OPTYPE_REGISTER);
144
145   WM_operatortype_macro_define(ot, "SEQUENCER_OT_duplicate");
146   WM_operatortype_macro_define(ot, "TRANSFORM_OT_seq_slide");
147 }