2.5: Curve edit mode. Transform works again, and editcurve.c is
[blender.git] / source / blender / editors / curve / curve_ops.c
1 /**
2  * $Id:
3  *
4  * ***** BEGIN GPL LICENSE BLOCK *****
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; either version 2
9  * of the License, or (at your option) any later version. 
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software Foundation,
18  * Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
19  *
20  * The Original Code is Copyright (C) 2009 Blender Foundation.
21  * All rights reserved.
22  *
23  * 
24  * Contributor(s): Blender Foundation
25  *
26  * ***** END GPL LICENSE BLOCK *****
27  */
28
29 #include <stdlib.h>
30 #include <math.h>
31
32 #include "MEM_guardedalloc.h"
33
34 #include "DNA_object_types.h"
35 #include "DNA_scene_types.h"
36 #include "DNA_screen_types.h"
37 #include "DNA_space_types.h"
38 #include "DNA_userdef_types.h"
39 #include "DNA_view3d_types.h"
40 #include "DNA_windowmanager_types.h"
41
42 #include "BLI_arithb.h"
43 #include "BLI_blenlib.h"
44
45 #include "BKE_context.h"
46 #include "BKE_global.h"
47 #include "BKE_utildefines.h"
48
49 #include "RNA_access.h"
50 #include "RNA_define.h"
51
52 #include "WM_api.h"
53 #include "WM_types.h"
54
55 #include "ED_screen.h"
56 #include "ED_object.h"
57
58 #include "curve_intern.h"
59
60
61 /* ************************** registration **********************************/
62
63
64 void ED_operatortypes_curve(void)
65 {
66         WM_operatortype_append(FONT_OT_textedit);
67
68         WM_operatortype_append(CURVE_OT_separate);
69         WM_operatortype_append(CURVE_OT_switch_direction);
70         WM_operatortype_append(CURVE_OT_set_weight);
71         WM_operatortype_append(CURVE_OT_set_radius);
72         WM_operatortype_append(CURVE_OT_smooth);
73         WM_operatortype_append(CURVE_OT_smooth_curve_radius);
74         WM_operatortype_append(CURVE_OT_de_select_first);
75         WM_operatortype_append(CURVE_OT_de_select_last);
76         WM_operatortype_append(CURVE_OT_de_select_all);
77         WM_operatortype_append(CURVE_OT_hide);
78         WM_operatortype_append(CURVE_OT_reveal);
79         WM_operatortype_append(CURVE_OT_select_invert);
80         WM_operatortype_append(CURVE_OT_subdivide);
81         WM_operatortype_append(CURVE_OT_set_spline_type);
82         WM_operatortype_append(CURVE_OT_make_segment);
83         WM_operatortype_append(CURVE_OT_spin);
84         WM_operatortype_append(CURVE_OT_add_vertex);
85         WM_operatortype_append(CURVE_OT_extrude);
86         WM_operatortype_append(CURVE_OT_make_cyclic);
87         WM_operatortype_append(CURVE_OT_select_linked);
88         WM_operatortype_append(CURVE_OT_select_row);
89         WM_operatortype_append(CURVE_OT_select_next);
90         WM_operatortype_append(CURVE_OT_select_previous);
91         WM_operatortype_append(CURVE_OT_select_more);
92         WM_operatortype_append(CURVE_OT_select_less);
93         WM_operatortype_append(CURVE_OT_select_random);
94         WM_operatortype_append(CURVE_OT_select_every_nth);
95         WM_operatortype_append(CURVE_OT_add_duplicate);
96         WM_operatortype_append(CURVE_OT_delete);
97         WM_operatortype_append(CURVE_OT_set_smooth);
98         WM_operatortype_append(CURVE_OT_clear_tilt);
99 }
100
101 void ED_keymap_curve(wmWindowManager *wm)
102 {
103         ListBase *keymap= WM_keymap_listbase(wm, "Font", 0, 0);
104         
105         /* only set in editmode font, by space_view3d listener */
106         WM_keymap_add_item(keymap, "FONT_OT_textedit", KM_TEXTINPUT, KM_ANY, KM_ANY, 0);
107
108         /* only set in editmode curve, by space_view3d listener */
109         keymap= WM_keymap_listbase(wm, "Curve", 0, 0);
110         
111         WM_keymap_add_item(keymap, "OBJECT_OT_curve_add", AKEY, KM_PRESS, KM_SHIFT, 0);
112 }
113