diff options
author | Elia Sarti <vekoon@gmail.com> | 2009-07-30 00:51:05 +0400 |
---|---|---|
committer | Elia Sarti <vekoon@gmail.com> | 2009-07-30 00:51:05 +0400 |
commit | 49faf9011ad09e18ee21a25a58393fdada508623 (patch) | |
tree | 1d05876babfe57a9ea7378917c1d5791219bd6b9 | |
parent | 2621dd90e39e7d447255d86a7111641d2098e404 (diff) |
2.5 / Drag & Drop
Removed all related code. Talked with Ton about this and agreed to postpone it at indefinite time in the future, when things get more relaxed.
Files saved since my first commit should not break although I'm not 100% sure.
9 files changed, 1 insertions, 157 deletions
diff --git a/source/blender/editors/space_outliner/outliner.c b/source/blender/editors/space_outliner/outliner.c index b05d9637a69..84dea679767 100644 --- a/source/blender/editors/space_outliner/outliner.c +++ b/source/blender/editors/space_outliner/outliner.c @@ -3514,56 +3514,6 @@ void OUTLINER_OT_data_operation(wmOperatorType *ot) } -/* ****** Drag & Drop ****** */ - -static int outliner_drag_invoke(bContext *C, wmOperator *op, wmEvent *event) -{ - 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 65b0708d64b..4f9a0f686b9 100644 --- a/source/blender/editors/space_outliner/outliner_intern.h +++ b/source/blender/editors/space_outliner/outliner_intern.h @@ -129,8 +129,6 @@ 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 417851982a3..2e11eb379b4 100644 --- a/source/blender/editors/space_outliner/outliner_ops.c +++ b/source/blender/editors/space_outliner/outliner_ops.c @@ -56,8 +56,6 @@ 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); @@ -89,9 +87,6 @@ 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); diff --git a/source/blender/editors/space_view3d/view3d_intern.h b/source/blender/editors/space_view3d/view3d_intern.h index 382ba68e95f..3e9382509f4 100644 --- a/source/blender/editors/space_view3d/view3d_intern.h +++ b/source/blender/editors/space_view3d/view3d_intern.h @@ -115,7 +115,6 @@ void VIEW3D_OT_select_extend(struct wmOperatorType *ot); void VIEW3D_OT_select_circle(struct wmOperatorType *ot); void VIEW3D_OT_select_border(struct wmOperatorType *ot); void VIEW3D_OT_select_lasso(struct wmOperatorType *ot); -void VIEW3D_OT_drag(struct wmOperatorType *ot); /* view3d_view.c */ void VIEW3D_OT_smoothview(struct wmOperatorType *ot); diff --git a/source/blender/editors/space_view3d/view3d_ops.c b/source/blender/editors/space_view3d/view3d_ops.c index c82db3bbe32..112847272e5 100644 --- a/source/blender/editors/space_view3d/view3d_ops.c +++ b/source/blender/editors/space_view3d/view3d_ops.c @@ -73,7 +73,6 @@ void view3d_operatortypes(void) WM_operatortype_append(VIEW3D_OT_view_center); WM_operatortype_append(VIEW3D_OT_select); WM_operatortype_append(VIEW3D_OT_select_border); - WM_operatortype_append(VIEW3D_OT_drag); WM_operatortype_append(VIEW3D_OT_clip_border); WM_operatortype_append(VIEW3D_OT_select_circle); WM_operatortype_append(VIEW3D_OT_smoothview); @@ -217,9 +216,6 @@ void view3d_keymap(wmWindowManager *wm) WM_keymap_add_item(keymap, "VIEW3D_OT_camera_to_view", PAD0, KM_PRESS, KM_ALT|KM_CTRL, 0); WM_keymap_add_item(keymap, "VIEW3D_OT_snap_menu", SKEY, KM_PRESS, KM_SHIFT, 0); - - /* drag & drop (disabled) */ -// WM_keymap_add_item(keymap, "VIEW3D_OT_drag", MOUSEDRAG, KM_ANY, 0, 0); /* radial control */ RNA_enum_set(WM_keymap_add_item(keymap, "SCULPT_OT_radial_control", FKEY, KM_PRESS, 0, 0)->ptr, "mode", WM_RADIALCONTROL_SIZE); diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c index 4a702665c88..54e556b58ed 100644 --- a/source/blender/editors/space_view3d/view3d_select.c +++ b/source/blender/editors/space_view3d/view3d_select.c @@ -1602,56 +1602,6 @@ void VIEW3D_OT_select(wmOperatorType *ot) } -/* ****** Drag & Drop ****** */ - -static int view3d_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 view3d_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 view3d_drag_exec(bContext *C, wmOperator *op) -{ - return OPERATOR_FINISHED; -} - -void VIEW3D_OT_drag(wmOperatorType *ot) -{ - /* identifiers */ - ot->name= "Drag"; - ot->idname= "VIEW3D_OT_drag"; - - /* api callbacks */ - ot->invoke= view3d_drag_invoke; - ot->modal= view3d_drag_modal; - ot->exec= view3d_drag_exec; - ot->poll= ED_operator_view3d_active; - - /* flags */ - /* ot->flag= OPTYPE_UNDO; */ -} - - /* -------------------- circle select --------------------------------------------- */ static void mesh_circle_doSelectVert(void *userData, EditVert *eve, int x, int y, int index) diff --git a/source/blender/makesdna/DNA_windowmanager_types.h b/source/blender/makesdna/DNA_windowmanager_types.h index 704acbfd52b..b6a2b4c0544 100644 --- a/source/blender/makesdna/DNA_windowmanager_types.h +++ b/source/blender/makesdna/DNA_windowmanager_types.h @@ -146,9 +146,7 @@ typedef struct wmWindow { short cursor; /* current mouse cursor type */ short lastcursor; /* for temp waitcursor */ short addmousemove; /* internal: tag this for extra mousemove event, makes cursors/buttons active on UI switching */ - short downstate; /* used for drag & drop: remembers mouse button down state */ - short downx, downy; /* mouse coords for button down event */ - short pad3, pad4, pad5; + int pad3; struct wmEvent *eventstate; /* storage for event system */ diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index 33e8a392ba3..3f668b23b24 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -1485,23 +1485,6 @@ void wm_event_add_ghostevent(wmWindow *win, int type, void *customdata) update_tablet_data(win, &event); wm_event_add(win, &event); - - cx = abs((win->downx - event.x)); - cy = abs((win->downy - event.y)); - - /* probably minimum drag size should be #defined instead of hardcoded 3 - * also, cy seems always to be 6 pixels off, not sure why - */ - if ((win->downstate == LEFTMOUSE || win->downstate == MOUSEDRAG) && (cx > 3 || cy > 9)) { - wmEvent dragevt= *evt; - dragevt.type= MOUSEDRAG; - dragevt.customdata= NULL; - dragevt.customdatafree= 0; - - win->downstate= MOUSEDRAG; - - wm_event_add(win, &dragevt); - } } break; } @@ -1525,28 +1508,6 @@ void wm_event_add_ghostevent(wmWindow *win, int type, void *customdata) update_tablet_data(win, &event); wm_event_add(win, &event); - - if (event.val) { - win->downstate= event.type; - win->downx= event.x; - win->downy= event.y; - } - else { - short downstate= win->downstate; - - win->downstate= 0; - win->downx= 0; - win->downy= 0; - - if (downstate == MOUSEDRAG) { - wmEvent dropevt= *evt; - dropevt.type= MOUSEDROP; - dropevt.customdata= NULL; - dropevt.customdatafree= 0; - - wm_event_add(win, &dropevt); - } - } break; } diff --git a/source/blender/windowmanager/wm_event_types.h b/source/blender/windowmanager/wm_event_types.h index ee18a0fb45b..3da621bda85 100644 --- a/source/blender/windowmanager/wm_event_types.h +++ b/source/blender/windowmanager/wm_event_types.h @@ -56,9 +56,6 @@ /* only use if you want user option switch possible */ #define ACTIONMOUSE 0x005 #define SELECTMOUSE 0x006 - /* drag & drop support */ -#define MOUSEDRAG 0x007 -#define MOUSEDROP 0x008 /* defaults from ghost */ #define WHEELUPMOUSE 0x00a #define WHEELDOWNMOUSE 0x00b |