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