Outliner: Added recursive select/deselect (CTRL+LMB) and extend (CTRL+SHIFT+LMB)
[blender.git] / source / blender / editors / space_outliner / outliner_ops.c
index a424520..b9e3942 100644 (file)
  *  \ingroup spoutliner
  */
 
-
-#include <stdlib.h>
-
 #include "DNA_space_types.h"
 
-#include "WM_api.h"
-#include "WM_types.h"
+#include "BLI_utildefines.h"
 
 #include "RNA_access.h"
 
-#include "BLI_utildefines.h"
+#include "WM_api.h"
+#include "WM_types.h"
 
 #include "outliner_intern.h"
 
-/* ************************** registration **********************************/
-
 
+/* ************************** registration **********************************/
 
 void outliner_operatortypes(void)
 {
        WM_operatortype_append(OUTLINER_OT_item_activate);
+       WM_operatortype_append(OUTLINER_OT_select_border);
        WM_operatortype_append(OUTLINER_OT_item_openclose);
        WM_operatortype_append(OUTLINER_OT_item_rename);
        WM_operatortype_append(OUTLINER_OT_operation);
@@ -76,19 +73,38 @@ void outliner_operatortypes(void)
        
        WM_operatortype_append(OUTLINER_OT_drivers_add_selected);
        WM_operatortype_append(OUTLINER_OT_drivers_delete_selected);
+
+       WM_operatortype_append(OUTLINER_OT_parent_drop);
+       WM_operatortype_append(OUTLINER_OT_parent_clear);
+       WM_operatortype_append(OUTLINER_OT_scene_drop);
+       WM_operatortype_append(OUTLINER_OT_material_drop);
 }
 
 void outliner_keymap(wmKeyConfig *keyconf)
 {
-       wmKeyMap *keymap= WM_keymap_find(keyconf, "Outliner", SPACE_OUTLINER, 0);
+       wmKeyMap *keymap = WM_keymap_find(keyconf, "Outliner", SPACE_OUTLINER, 0);
        wmKeyMapItem *kmi;
        
        WM_keymap_add_item(keymap, "OUTLINER_OT_item_rename", LEFTMOUSE, KM_DBL_CLICK, 0, 0);
 
        kmi = WM_keymap_add_item(keymap, "OUTLINER_OT_item_activate", LEFTMOUSE, KM_CLICK, 0, 0);
+       RNA_boolean_set(kmi->ptr, "recursive", FALSE);
        RNA_boolean_set(kmi->ptr, "extend", FALSE);
+
        kmi = WM_keymap_add_item(keymap, "OUTLINER_OT_item_activate", LEFTMOUSE, KM_CLICK, KM_SHIFT, 0);
+       RNA_boolean_set(kmi->ptr, "recursive", FALSE);
        RNA_boolean_set(kmi->ptr, "extend", TRUE);
+
+       kmi = WM_keymap_add_item(keymap, "OUTLINER_OT_item_activate", LEFTMOUSE, KM_CLICK, KM_CTRL, 0);
+       RNA_boolean_set(kmi->ptr, "recursive", TRUE);
+       RNA_boolean_set(kmi->ptr, "extend", FALSE);
+
+       kmi = WM_keymap_add_item(keymap, "OUTLINER_OT_item_activate", LEFTMOUSE, KM_CLICK, KM_CTRL | KM_SHIFT, 0);
+       RNA_boolean_set(kmi->ptr, "recursive", TRUE);
+       RNA_boolean_set(kmi->ptr, "extend", TRUE);
+
+
+       WM_keymap_add_item(keymap, "OUTLINER_OT_select_border", BKEY, KM_PRESS, 0, 0);
        
        kmi = WM_keymap_add_item(keymap, "OUTLINER_OT_item_openclose", RETKEY, KM_PRESS, 0, 0);
        RNA_boolean_set(kmi->ptr, "all", FALSE);