diff options
Diffstat (limited to 'source/blender/editors/space_outliner')
-rw-r--r-- | source/blender/editors/space_outliner/outliner.c | 51 | ||||
-rw-r--r-- | source/blender/editors/space_outliner/outliner_intern.h | 2 | ||||
-rw-r--r-- | source/blender/editors/space_outliner/outliner_ops.c | 5 |
3 files changed, 58 insertions, 0 deletions
diff --git a/source/blender/editors/space_outliner/outliner.c b/source/blender/editors/space_outliner/outliner.c index 6ac094b3ad3..0df0cb46473 100644 --- a/source/blender/editors/space_outliner/outliner.c +++ b/source/blender/editors/space_outliner/outliner.c @@ -3452,6 +3452,57 @@ void OUTLINER_OT_data_operation(wmOperatorType *ot) } +/* ****** Drag & Drop ****** */ + +static int outliner_drag_invoke(bContext *C, wmOperator *op, wmEvent *event) +{ + wmWindow *win= CTX_wm_window(C); + Object *ob= CTX_data_active_object(C); + PointerRNA ptr; + + RNA_pointer_create(NULL, &RNA_Object, ob, &ptr); + + return OPERATOR_RUNNING_MODAL; +} + +static int outliner_drag_modal(bContext *C, wmOperator *op, wmEvent *event) +{ + switch(event->type) { + case MOUSEDRAG: + + break; + case MOUSEDROP: + return OPERATOR_FINISHED; + case ESCKEY: + return OPERATOR_CANCELLED; + } + + return OPERATOR_RUNNING_MODAL; +} + +static int outliner_drag_exec(bContext *C, wmOperator *op) +{ + return OPERATOR_FINISHED; +} + +void OUTLINER_OT_drag(wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Drag"; + ot->idname= "OUTLINER_OT_drag"; + + /* api callbacks */ + ot->invoke= outliner_drag_invoke; + ot->modal= outliner_drag_modal; + ot->exec= outliner_drag_exec; + + ot->poll= ED_operator_outliner_active; + + /* flags */ + /* ot->flag= OPTYPE_UNDO; */ +} + + /* ******************** */ diff --git a/source/blender/editors/space_outliner/outliner_intern.h b/source/blender/editors/space_outliner/outliner_intern.h index fc305361fe1..d5986f3ebbd 100644 --- a/source/blender/editors/space_outliner/outliner_intern.h +++ b/source/blender/editors/space_outliner/outliner_intern.h @@ -127,6 +127,8 @@ void OUTLINER_OT_group_operation(struct wmOperatorType *ot); void OUTLINER_OT_id_operation(struct wmOperatorType *ot); void OUTLINER_OT_data_operation(struct wmOperatorType *ot); +void OUTLINER_OT_drag(struct wmOperatorType *ot); + void OUTLINER_OT_show_one_level(struct wmOperatorType *ot); void OUTLINER_OT_show_active(struct wmOperatorType *ot); void OUTLINER_OT_show_hierarchy(struct wmOperatorType *ot); diff --git a/source/blender/editors/space_outliner/outliner_ops.c b/source/blender/editors/space_outliner/outliner_ops.c index 2e11eb379b4..417851982a3 100644 --- a/source/blender/editors/space_outliner/outliner_ops.c +++ b/source/blender/editors/space_outliner/outliner_ops.c @@ -56,6 +56,8 @@ void outliner_operatortypes(void) WM_operatortype_append(OUTLINER_OT_id_operation); WM_operatortype_append(OUTLINER_OT_data_operation); + WM_operatortype_append(OUTLINER_OT_drag); + WM_operatortype_append(OUTLINER_OT_show_one_level); WM_operatortype_append(OUTLINER_OT_show_active); WM_operatortype_append(OUTLINER_OT_show_hierarchy); @@ -87,6 +89,9 @@ void outliner_keymap(wmWindowManager *wm) WM_keymap_add_item(keymap, "OUTLINER_OT_item_rename", LEFTMOUSE, KM_PRESS, KM_CTRL, 0); WM_keymap_add_item(keymap, "OUTLINER_OT_operation", RIGHTMOUSE, KM_PRESS, 0, 0); + /* drag & drop */ + WM_keymap_add_item(keymap, "OUTLINER_OT_drag", MOUSEDRAG, KM_ANY, 0, 0); + WM_keymap_add_item(keymap, "OUTLINER_OT_show_hierarchy", HOMEKEY, KM_PRESS, 0, 0); WM_keymap_add_item(keymap, "OUTLINER_OT_show_active", PERIODKEY, KM_PRESS, 0, 0); |