CMake: add WITH_LINKER_LLD option for unix platforms
[blender-staging.git] / source / blender / editors / space_action / action_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 spaction
22  */
23
24 #include <math.h>
25 #include <stdlib.h>
26
27 #include "DNA_space_types.h"
28
29 #include "ED_anim_api.h"
30 #include "ED_markers.h"
31 #include "ED_object.h"
32 #include "ED_select_utils.h"
33 #include "ED_transform.h"
34
35 #include "action_intern.h"
36
37 #include "RNA_access.h"
38
39 #include "WM_api.h"
40 #include "WM_types.h"
41
42 /* ************************** registration - operator types **********************************/
43
44 void action_operatortypes(void)
45 {
46   /* keyframes */
47   /* selection */
48   WM_operatortype_append(ACTION_OT_clickselect);
49   WM_operatortype_append(ACTION_OT_select_all);
50   WM_operatortype_append(ACTION_OT_select_box);
51   WM_operatortype_append(ACTION_OT_select_lasso);
52   WM_operatortype_append(ACTION_OT_select_circle);
53   WM_operatortype_append(ACTION_OT_select_column);
54   WM_operatortype_append(ACTION_OT_select_linked);
55   WM_operatortype_append(ACTION_OT_select_more);
56   WM_operatortype_append(ACTION_OT_select_less);
57   WM_operatortype_append(ACTION_OT_select_leftright);
58
59   /* editing */
60   WM_operatortype_append(ACTION_OT_snap);
61   WM_operatortype_append(ACTION_OT_mirror);
62   WM_operatortype_append(ACTION_OT_frame_jump);
63   WM_operatortype_append(ACTION_OT_handle_type);
64   WM_operatortype_append(ACTION_OT_interpolation_type);
65   WM_operatortype_append(ACTION_OT_extrapolation_type);
66   WM_operatortype_append(ACTION_OT_easing_type);
67   WM_operatortype_append(ACTION_OT_keyframe_type);
68   WM_operatortype_append(ACTION_OT_sample);
69   WM_operatortype_append(ACTION_OT_clean);
70   WM_operatortype_append(ACTION_OT_delete);
71   WM_operatortype_append(ACTION_OT_duplicate);
72   WM_operatortype_append(ACTION_OT_keyframe_insert);
73   WM_operatortype_append(ACTION_OT_copy);
74   WM_operatortype_append(ACTION_OT_paste);
75
76   WM_operatortype_append(ACTION_OT_new);
77   WM_operatortype_append(ACTION_OT_unlink);
78
79   WM_operatortype_append(ACTION_OT_push_down);
80   WM_operatortype_append(ACTION_OT_stash);
81   WM_operatortype_append(ACTION_OT_stash_and_create);
82
83   WM_operatortype_append(ACTION_OT_layer_next);
84   WM_operatortype_append(ACTION_OT_layer_prev);
85
86   WM_operatortype_append(ACTION_OT_previewrange_set);
87   WM_operatortype_append(ACTION_OT_view_all);
88   WM_operatortype_append(ACTION_OT_view_selected);
89   WM_operatortype_append(ACTION_OT_view_frame);
90
91   WM_operatortype_append(ACTION_OT_markers_make_local);
92 }
93
94 void ED_operatormacros_action(void)
95 {
96   wmOperatorType *ot;
97   wmOperatorTypeMacro *otmacro;
98
99   ot = WM_operatortype_append_macro("ACTION_OT_duplicate_move",
100                                     "Duplicate",
101                                     "Make a copy of all selected keyframes and move them",
102                                     OPTYPE_UNDO | OPTYPE_REGISTER);
103   WM_operatortype_macro_define(ot, "ACTION_OT_duplicate");
104   otmacro = WM_operatortype_macro_define(ot, "TRANSFORM_OT_transform");
105   RNA_enum_set(otmacro->ptr, "mode", TFM_TIME_DUPLICATE);
106   RNA_boolean_set(otmacro->ptr, "use_proportional_edit", false);
107 }
108
109 /* ************************** registration - keymaps **********************************/
110
111 /* --------------- */
112
113 void action_keymap(wmKeyConfig *keyconf)
114 {
115   /* keymap for all regions */
116   WM_keymap_ensure(keyconf, "Dopesheet Generic", SPACE_ACTION, 0);
117
118   /* channels */
119   /* Channels are not directly handled by the Action Editor module,
120    * but are inherited from the Animation module.
121    * All the relevant operations, keymaps, drawing, etc.
122    * can therefore all be found in that module instead, as these
123    * are all used for the Graph-Editor too.
124    */
125
126   /* keyframes */
127   WM_keymap_ensure(keyconf, "Dopesheet", SPACE_ACTION, 0);
128 }