Blender V2.61 - r43446

outliner_ops.c

Go to the documentation of this file.
00001 /*
00002  * ***** BEGIN GPL LICENSE BLOCK *****
00003  *
00004  * This program is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU General Public License
00006  * as published by the Free Software Foundation; either version 2
00007  * of the License, or (at your option) any later version. 
00008  *
00009  * This program is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program; if not, write to the Free Software Foundation,
00016  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00017  *
00018  * The Original Code is Copyright (C) 2008 Blender Foundation.
00019  * All rights reserved.
00020  *
00021  * 
00022  * Contributor(s): Blender Foundation
00023  *
00024  * ***** END GPL LICENSE BLOCK *****
00025  */
00026 
00032 #include <stdlib.h>
00033 
00034 #include "DNA_space_types.h"
00035 
00036 #include "WM_api.h"
00037 #include "WM_types.h"
00038 
00039 #include "RNA_access.h"
00040 
00041 #include "BLI_utildefines.h"
00042 
00043 #include "outliner_intern.h"
00044 
00045 /* ************************** registration **********************************/
00046 
00047 
00048 
00049 void outliner_operatortypes(void)
00050 {
00051     WM_operatortype_append(OUTLINER_OT_item_activate);
00052     WM_operatortype_append(OUTLINER_OT_item_openclose);
00053     WM_operatortype_append(OUTLINER_OT_item_rename);
00054     WM_operatortype_append(OUTLINER_OT_operation);
00055     WM_operatortype_append(OUTLINER_OT_object_operation);
00056     WM_operatortype_append(OUTLINER_OT_group_operation);
00057     WM_operatortype_append(OUTLINER_OT_id_operation);
00058     WM_operatortype_append(OUTLINER_OT_data_operation);
00059     WM_operatortype_append(OUTLINER_OT_animdata_operation);
00060     WM_operatortype_append(OUTLINER_OT_action_set);
00061 
00062     WM_operatortype_append(OUTLINER_OT_show_one_level);
00063     WM_operatortype_append(OUTLINER_OT_show_active);
00064     WM_operatortype_append(OUTLINER_OT_show_hierarchy);
00065     WM_operatortype_append(OUTLINER_OT_scroll_page);
00066     
00067     WM_operatortype_append(OUTLINER_OT_selected_toggle);
00068     WM_operatortype_append(OUTLINER_OT_expanded_toggle);
00069     
00070     WM_operatortype_append(OUTLINER_OT_renderability_toggle);
00071     WM_operatortype_append(OUTLINER_OT_selectability_toggle);
00072     WM_operatortype_append(OUTLINER_OT_visibility_toggle);
00073     
00074     WM_operatortype_append(OUTLINER_OT_keyingset_add_selected);
00075     WM_operatortype_append(OUTLINER_OT_keyingset_remove_selected);
00076     
00077     WM_operatortype_append(OUTLINER_OT_drivers_add_selected);
00078     WM_operatortype_append(OUTLINER_OT_drivers_delete_selected);
00079 }
00080 
00081 void outliner_keymap(wmKeyConfig *keyconf)
00082 {
00083     wmKeyMap *keymap= WM_keymap_find(keyconf, "Outliner", SPACE_OUTLINER, 0);
00084     wmKeyMapItem *kmi;
00085     
00086     WM_keymap_add_item(keymap, "OUTLINER_OT_item_rename", LEFTMOUSE, KM_DBL_CLICK, 0, 0);
00087 
00088     kmi = WM_keymap_add_item(keymap, "OUTLINER_OT_item_activate", LEFTMOUSE, KM_CLICK, 0, 0);
00089     RNA_boolean_set(kmi->ptr, "extend", FALSE);
00090     kmi = WM_keymap_add_item(keymap, "OUTLINER_OT_item_activate", LEFTMOUSE, KM_CLICK, KM_SHIFT, 0);
00091     RNA_boolean_set(kmi->ptr, "extend", TRUE);
00092     
00093     kmi = WM_keymap_add_item(keymap, "OUTLINER_OT_item_openclose", RETKEY, KM_PRESS, 0, 0);
00094     RNA_boolean_set(kmi->ptr, "all", FALSE);
00095     kmi = WM_keymap_add_item(keymap, "OUTLINER_OT_item_openclose", RETKEY, KM_PRESS, KM_SHIFT, 0);
00096     RNA_boolean_set(kmi->ptr, "all", TRUE);
00097     
00098     WM_keymap_add_item(keymap, "OUTLINER_OT_item_rename", LEFTMOUSE, KM_PRESS, KM_CTRL, 0);
00099     WM_keymap_add_item(keymap, "OUTLINER_OT_operation", RIGHTMOUSE, KM_PRESS, 0, 0);
00100 
00101     WM_keymap_add_item(keymap, "OUTLINER_OT_show_hierarchy", HOMEKEY, KM_PRESS, 0, 0);
00102     
00103     WM_keymap_add_item(keymap, "OUTLINER_OT_show_active", PERIODKEY, KM_PRESS, 0, 0);
00104     WM_keymap_add_item(keymap, "OUTLINER_OT_show_active", PADPERIOD, KM_PRESS, 0, 0);
00105     
00106     WM_keymap_add_item(keymap, "OUTLINER_OT_scroll_page", PAGEDOWNKEY, KM_PRESS, 0, 0);
00107     kmi = WM_keymap_add_item(keymap, "OUTLINER_OT_scroll_page", PAGEUPKEY, KM_PRESS, 0, 0);
00108     RNA_boolean_set(kmi->ptr, "up", TRUE);
00109     
00110     WM_keymap_add_item(keymap, "OUTLINER_OT_show_one_level", PADPLUSKEY, KM_PRESS, 0, 0); /* open */
00111     kmi = WM_keymap_add_item(keymap, "OUTLINER_OT_show_one_level", PADMINUS, KM_PRESS, 0, 0);
00112     RNA_boolean_set(kmi->ptr, "open", FALSE); /* close */
00113     
00114     WM_keymap_verify_item(keymap, "OUTLINER_OT_selected_toggle", AKEY, KM_PRESS, 0, 0);
00115     WM_keymap_verify_item(keymap, "OUTLINER_OT_expanded_toggle", AKEY, KM_PRESS, KM_SHIFT, 0);
00116     
00117     WM_keymap_verify_item(keymap, "OUTLINER_OT_renderability_toggle", RKEY, KM_PRESS, 0, 0);
00118     WM_keymap_verify_item(keymap, "OUTLINER_OT_selectability_toggle", SKEY, KM_PRESS, 0, 0);
00119     WM_keymap_verify_item(keymap, "OUTLINER_OT_visibility_toggle", VKEY, KM_PRESS, 0, 0);
00120     
00121     
00122     /* keying sets - only for databrowse */
00123     WM_keymap_verify_item(keymap, "OUTLINER_OT_keyingset_add_selected", KKEY, KM_PRESS, 0, 0);
00124     WM_keymap_verify_item(keymap, "OUTLINER_OT_keyingset_remove_selected", KKEY, KM_PRESS, KM_ALT, 0);
00125     
00126     WM_keymap_verify_item(keymap, "ANIM_OT_keyframe_insert", IKEY, KM_PRESS, 0, 0);
00127     WM_keymap_verify_item(keymap, "ANIM_OT_keyframe_delete", IKEY, KM_PRESS, KM_ALT, 0);
00128     
00129     WM_keymap_verify_item(keymap, "OUTLINER_OT_drivers_add_selected", DKEY, KM_PRESS, 0, 0);
00130     WM_keymap_verify_item(keymap, "OUTLINER_OT_drivers_delete_selected", DKEY, KM_PRESS, KM_ALT, 0);
00131 }
00132