diff options
author | Campbell Barton <ideasman42@gmail.com> | 2009-11-07 01:51:08 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2009-11-07 01:51:08 +0300 |
commit | 6e47d9bb9c3f7e12ee3bdcf171d9adf1b3d62091 (patch) | |
tree | 4f7869a35a84136d64fd8435424d45f3cbfbdf21 /source/blender/editors | |
parent | e2f01e4c7cad9dc506d6a7309701b34c44815292 (diff) |
- modal keymap for border select
- revert circle select keys adjustments & view navigation while selecting (durian guys liked but allowed activating multiple circle select's at once)
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/animation/anim_channels_edit.c | 12 | ||||
-rw-r--r-- | source/blender/editors/animation/anim_markers.c | 15 | ||||
-rw-r--r-- | source/blender/editors/animation/drivers.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_action/action_select.c | 12 | ||||
-rw-r--r-- | source/blender/editors/space_console/console_report.c | 19 | ||||
-rw-r--r-- | source/blender/editors/space_file/file_ops.c | 20 | ||||
-rw-r--r-- | source/blender/editors/space_graph/graph_select.c | 20 | ||||
-rw-r--r-- | source/blender/editors/space_nla/nla_select.c | 10 | ||||
-rw-r--r-- | source/blender/editors/space_node/drawnode.c | 8 | ||||
-rw-r--r-- | source/blender/editors/space_node/node_select.c | 12 | ||||
-rw-r--r-- | source/blender/editors/space_sequencer/sequencer_select.c | 11 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/view3d_buttons.c | 21 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/view3d_select.c | 44 | ||||
-rw-r--r-- | source/blender/editors/uvedit/uvedit_ops.c | 8 |
14 files changed, 79 insertions, 135 deletions
diff --git a/source/blender/editors/animation/anim_channels_edit.c b/source/blender/editors/animation/anim_channels_edit.c index 01945a9733e..1e5f1eac867 100644 --- a/source/blender/editors/animation/anim_channels_edit.c +++ b/source/blender/editors/animation/anim_channels_edit.c @@ -1293,7 +1293,7 @@ static int animchannels_borderselect_exec(bContext *C, wmOperator *op) bAnimContext ac; rcti rect; short selectmode=0; - int event; + int gesture_mode; /* get editor data */ if (ANIM_animdata_get_context(C, &ac) == 0) @@ -1305,8 +1305,8 @@ static int animchannels_borderselect_exec(bContext *C, wmOperator *op) rect.xmax= RNA_int_get(op->ptr, "xmax"); rect.ymax= RNA_int_get(op->ptr, "ymax"); - event= RNA_int_get(op->ptr, "event_type"); - if (event == LEFTMOUSE) // FIXME... hardcoded + gesture_mode= RNA_int_get(op->ptr, "gesture_mode"); + if (gesture_mode == GESTURE_MODAL_SELECT) selectmode = ACHANNEL_SETFLAG_ADD; else selectmode = ACHANNEL_SETFLAG_CLEAR; @@ -1338,11 +1338,7 @@ void ANIM_OT_channels_select_border(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* rna */ - RNA_def_int(ot->srna, "event_type", 0, INT_MIN, INT_MAX, "Event Type", "", INT_MIN, INT_MAX); - RNA_def_int(ot->srna, "xmin", 0, INT_MIN, INT_MAX, "X Min", "", INT_MIN, INT_MAX); - RNA_def_int(ot->srna, "xmax", 0, INT_MIN, INT_MAX, "X Max", "", INT_MIN, INT_MAX); - RNA_def_int(ot->srna, "ymin", 0, INT_MIN, INT_MAX, "Y Min", "", INT_MIN, INT_MAX); - RNA_def_int(ot->srna, "ymax", 0, INT_MIN, INT_MAX, "Y Max", "", INT_MIN, INT_MAX); + WM_operator_properties_gesture_border(ot, FALSE); } /* ******************** Mouse-Click Operator *********************** */ diff --git a/source/blender/editors/animation/anim_markers.c b/source/blender/editors/animation/anim_markers.c index 54d569c10dd..463518a32ff 100644 --- a/source/blender/editors/animation/anim_markers.c +++ b/source/blender/editors/animation/anim_markers.c @@ -814,7 +814,7 @@ static int ed_marker_border_select_exec(bContext *C, wmOperator *op) ListBase *markers= context_get_markers(C); TimeMarker *marker; float xminf, xmaxf, yminf, ymaxf; - int event_type= RNA_int_get(op->ptr, "event_type"); + int gesture_mode= RNA_int_get(op->ptr, "gesture_mode"); int xmin= RNA_int_get(op->ptr, "xmin"); int xmax= RNA_int_get(op->ptr, "xmax"); int ymin= RNA_int_get(op->ptr, "ymin"); @@ -833,13 +833,12 @@ static int ed_marker_border_select_exec(bContext *C, wmOperator *op) /* XXX marker context */ for(marker= markers->first; marker; marker= marker->next) { if ((marker->frame > xminf) && (marker->frame <= xmaxf)) { - /* XXX weak... */ - switch (event_type) { - case LEFTMOUSE: + switch (gesture_mode) { + case GESTURE_MODAL_SELECT: if ((marker->flag & SELECT) == 0) marker->flag |= SELECT; break; - case RIGHTMOUSE: + case GESTURE_MODAL_DESELECT: if (marker->flag & SELECT) marker->flag &= ~SELECT; break; @@ -870,11 +869,7 @@ static void MARKER_OT_select_border(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* rna */ - RNA_def_int(ot->srna, "event_type", 0, INT_MIN, INT_MAX, "Event Type", "", INT_MIN, INT_MAX); - RNA_def_int(ot->srna, "xmin", 0, INT_MIN, INT_MAX, "X Min", "", INT_MIN, INT_MAX); - RNA_def_int(ot->srna, "xmax", 0, INT_MIN, INT_MAX, "X Max", "", INT_MIN, INT_MAX); - RNA_def_int(ot->srna, "ymin", 0, INT_MIN, INT_MAX, "Y Min", "", INT_MIN, INT_MAX); - RNA_def_int(ot->srna, "ymax", 0, INT_MIN, INT_MAX, "Y Max", "", INT_MIN, INT_MAX); + WM_operator_properties_gesture_border(ot, FALSE); } /* *********************** (de)select all ***************** */ diff --git a/source/blender/editors/animation/drivers.c b/source/blender/editors/animation/drivers.c index 5c2cbce4c5d..c08bf443851 100644 --- a/source/blender/editors/animation/drivers.c +++ b/source/blender/editors/animation/drivers.c @@ -367,7 +367,7 @@ static int add_driver_button_exec (bContext *C, wmOperator *op) PropertyRNA *prop= NULL; char *path; short success= 0; - int index, length, all= RNA_boolean_get(op->ptr, "all"); + int index, all= RNA_boolean_get(op->ptr, "all"); /* try to create driver using property retrieved from UI */ memset(&ptr, 0, sizeof(PointerRNA)); diff --git a/source/blender/editors/space_action/action_select.c b/source/blender/editors/space_action/action_select.c index c945f41bc55..cc8688031b0 100644 --- a/source/blender/editors/space_action/action_select.c +++ b/source/blender/editors/space_action/action_select.c @@ -300,7 +300,7 @@ static int actkeys_borderselect_exec(bContext *C, wmOperator *op) bAnimContext ac; rcti rect; short mode=0, selectmode=0; - int event; + int gesture_mode; /* get editor data */ if (ANIM_animdata_get_context(C, &ac) == 0) @@ -312,8 +312,8 @@ static int actkeys_borderselect_exec(bContext *C, wmOperator *op) rect.xmax= RNA_int_get(op->ptr, "xmax"); rect.ymax= RNA_int_get(op->ptr, "ymax"); - event= RNA_int_get(op->ptr, "event_type"); - if (event == LEFTMOUSE) // FIXME... hardcoded + gesture_mode= RNA_int_get(op->ptr, "gesture_mode"); + if (gesture_mode == GESTURE_MODAL_SELECT) selectmode = SELECT_ADD; else selectmode = SELECT_SUBTRACT; @@ -360,11 +360,7 @@ void ACT_OT_select_border(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* rna */ - RNA_def_int(ot->srna, "event_type", 0, INT_MIN, INT_MAX, "Event Type", "", INT_MIN, INT_MAX); - RNA_def_int(ot->srna, "xmin", 0, INT_MIN, INT_MAX, "X Min", "", INT_MIN, INT_MAX); - RNA_def_int(ot->srna, "xmax", 0, INT_MIN, INT_MAX, "X Max", "", INT_MIN, INT_MAX); - RNA_def_int(ot->srna, "ymin", 0, INT_MIN, INT_MAX, "Y Min", "", INT_MIN, INT_MAX); - RNA_def_int(ot->srna, "ymax", 0, INT_MIN, INT_MAX, "Y Max", "", INT_MIN, INT_MAX); + WM_operator_properties_gesture_border(ot, FALSE); RNA_def_boolean(ot->srna, "axis_range", 0, "Axis Range", ""); } diff --git a/source/blender/editors/space_console/console_report.c b/source/blender/editors/space_console/console_report.c index b6920d148fd..282e25a6a44 100644 --- a/source/blender/editors/space_console/console_report.c +++ b/source/blender/editors/space_console/console_report.c @@ -242,10 +242,9 @@ static int borderselect_exec(bContext *C, wmOperator *op) rcti rect; //rctf rectf, rq; - int val; + short selecting= (RNA_int_get(op->ptr, "gesture_mode")==GESTURE_MODAL_SELECT); //short mval[2]; - val= RNA_int_get(op->ptr, "event_type"); rect.xmin= RNA_int_get(op->ptr, "xmin"); rect.ymin= RNA_int_get(op->ptr, "ymin"); rect.xmax= RNA_int_get(op->ptr, "xmax"); @@ -265,7 +264,7 @@ static int borderselect_exec(bContext *C, wmOperator *op) /* get the first report if none found */ if(report_min==NULL) { - printf("find_min\n"); + // printf("find_min\n"); for(report=reports->list.first; report; report=report->next) { if(report->type & report_mask) { report_min= report; @@ -275,7 +274,7 @@ static int borderselect_exec(bContext *C, wmOperator *op) } if(report_max==NULL) { - printf("find_max\n"); + // printf("find_max\n"); for(report=reports->list.last; report; report=report->prev) { if(report->type & report_mask) { report_max= report; @@ -292,8 +291,10 @@ static int borderselect_exec(bContext *C, wmOperator *op) if((report->type & report_mask)==0) continue; - if(val==LEFTMOUSE) report->flag |= SELECT; - else report->flag &= ~SELECT; + if(selecting) + report->flag |= SELECT; + else + report->flag &= ~SELECT; } ED_area_tag_redraw(CTX_wm_area(C)); @@ -321,11 +322,7 @@ void CONSOLE_OT_select_border(wmOperatorType *ot) /* ot->flag= OPTYPE_REGISTER; */ /* rna */ - RNA_def_int(ot->srna, "event_type", 0, INT_MIN, INT_MAX, "Event Type", "", INT_MIN, INT_MAX); - RNA_def_int(ot->srna, "xmin", 0, INT_MIN, INT_MAX, "X Min", "", INT_MIN, INT_MAX); - RNA_def_int(ot->srna, "xmax", 0, INT_MIN, INT_MAX, "X Max", "", INT_MIN, INT_MAX); - RNA_def_int(ot->srna, "ymin", 0, INT_MIN, INT_MAX, "Y Min", "", INT_MIN, INT_MAX); - RNA_def_int(ot->srna, "ymax", 0, INT_MIN, INT_MAX, "Y Max", "", INT_MIN, INT_MAX); + WM_operator_properties_gesture_border(ot, FALSE); } diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c index c35ff6ed7b6..97d4e8019fe 100644 --- a/source/blender/editors/space_file/file_ops.c +++ b/source/blender/editors/space_file/file_ops.c @@ -124,12 +124,11 @@ static void clamp_to_filelist(int numfiles, int *first_file, int *last_file) } } -static FileSelect file_select(SpaceFile* sfile, ARegion* ar, const rcti* rect, short val) +static FileSelect file_select(SpaceFile* sfile, ARegion* ar, const rcti* rect, short selecting) { int first_file = -1; int last_file = -1; int act_file; - short selecting = (val == LEFTMOUSE); FileSelect retval = FILE_SELECT_FILE; FileSelectParams *params = ED_fileselect_get_params(sfile); @@ -198,10 +197,10 @@ static int file_border_select_exec(bContext *C, wmOperator *op) { ARegion *ar= CTX_wm_region(C); SpaceFile *sfile= CTX_wm_space_file(C); - short val; + short selecting; rcti rect; - val= RNA_int_get(op->ptr, "event_type"); + selecting= (RNA_int_get(op->ptr, "gesture_mode")==GESTURE_MODAL_SELECT); rect.xmin= RNA_int_get(op->ptr, "xmin"); rect.ymin= RNA_int_get(op->ptr, "ymin"); rect.xmax= RNA_int_get(op->ptr, "xmax"); @@ -209,7 +208,7 @@ static int file_border_select_exec(bContext *C, wmOperator *op) BLI_isect_rcti(&(ar->v2d.mask), &rect, &rect); - if (FILE_SELECT_DIR == file_select(sfile, ar, &rect, val )) { + if (FILE_SELECT_DIR == file_select(sfile, ar, &rect, selecting)) { WM_event_add_notifier(C, NC_SPACE|ND_SPACE_FILE_LIST, NULL); } else { WM_event_add_notifier(C, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL); @@ -228,15 +227,10 @@ void FILE_OT_select_border(wmOperatorType *ot) ot->invoke= WM_border_select_invoke; ot->exec= file_border_select_exec; ot->modal= WM_border_select_modal; + ot->poll= ED_operator_file_active; /* rna */ - RNA_def_int(ot->srna, "event_type", 0, INT_MIN, INT_MAX, "Event Type", "", INT_MIN, INT_MAX); - RNA_def_int(ot->srna, "xmin", 0, INT_MIN, INT_MAX, "X Min", "", INT_MIN, INT_MAX); - RNA_def_int(ot->srna, "xmax", 0, INT_MIN, INT_MAX, "X Max", "", INT_MIN, INT_MAX); - RNA_def_int(ot->srna, "ymin", 0, INT_MIN, INT_MAX, "Y Min", "", INT_MIN, INT_MAX); - RNA_def_int(ot->srna, "ymax", 0, INT_MIN, INT_MAX, "Y Max", "", INT_MIN, INT_MAX); - - ot->poll= ED_operator_file_active; + WM_operator_properties_gesture_border(ot, 0); } static int file_select_invoke(bContext *C, wmOperator *op, wmEvent *event) @@ -259,7 +253,7 @@ static int file_select_invoke(bContext *C, wmOperator *op, wmEvent *event) /* single select, deselect all selected first */ file_deselect_all(sfile); - if (FILE_SELECT_DIR == file_select(sfile, ar, &rect, val )) + if (FILE_SELECT_DIR == file_select(sfile, ar, &rect, val==LEFTMOUSE )) //LEFTMOUSE XXX, fixme WM_event_add_notifier(C, NC_SPACE|ND_SPACE_FILE_LIST, NULL); else WM_event_add_notifier(C, NC_SPACE|ND_SPACE_FILE_PARAMS, NULL); diff --git a/source/blender/editors/space_graph/graph_select.c b/source/blender/editors/space_graph/graph_select.c index 7eec9f31d86..09fde389f6f 100644 --- a/source/blender/editors/space_graph/graph_select.c +++ b/source/blender/editors/space_graph/graph_select.c @@ -279,23 +279,21 @@ static int graphkeys_borderselect_exec(bContext *C, wmOperator *op) bAnimContext ac; rcti rect; short mode=0, selectmode=0; - int event; /* get editor data */ if (ANIM_animdata_get_context(C, &ac) == 0) return OPERATOR_CANCELLED; - + + if(RNA_int_get(op->ptr, "gesture_mode")==GESTURE_MODAL_SELECT) + selectmode= SELECT_ADD; + else + selectmode= SELECT_SUBTRACT; + /* get settings from operator */ rect.xmin= RNA_int_get(op->ptr, "xmin"); rect.ymin= RNA_int_get(op->ptr, "ymin"); rect.xmax= RNA_int_get(op->ptr, "xmax"); rect.ymax= RNA_int_get(op->ptr, "ymax"); - - event= RNA_int_get(op->ptr, "event_type"); - if (event == LEFTMOUSE) // FIXME... hardcoded - selectmode = SELECT_ADD; - else - selectmode = SELECT_SUBTRACT; /* selection 'mode' depends on whether borderselect region only matters on one axis */ if (RNA_boolean_get(op->ptr, "axis_range")) { @@ -339,11 +337,7 @@ void GRAPH_OT_select_border(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER/*|OPTYPE_UNDO*/; /* rna */ - RNA_def_int(ot->srna, "event_type", 0, INT_MIN, INT_MAX, "Event Type", "", INT_MIN, INT_MAX); - RNA_def_int(ot->srna, "xmin", 0, INT_MIN, INT_MAX, "X Min", "", INT_MIN, INT_MAX); - RNA_def_int(ot->srna, "xmax", 0, INT_MIN, INT_MAX, "X Max", "", INT_MIN, INT_MAX); - RNA_def_int(ot->srna, "ymin", 0, INT_MIN, INT_MAX, "Y Min", "", INT_MIN, INT_MAX); - RNA_def_int(ot->srna, "ymax", 0, INT_MIN, INT_MAX, "Y Max", "", INT_MIN, INT_MAX); + WM_operator_properties_gesture_border(ot, FALSE); RNA_def_boolean(ot->srna, "axis_range", 0, "Axis Range", ""); } diff --git a/source/blender/editors/space_nla/nla_select.c b/source/blender/editors/space_nla/nla_select.c index dd9ef2621c5..7c8f2aef9d0 100644 --- a/source/blender/editors/space_nla/nla_select.c +++ b/source/blender/editors/space_nla/nla_select.c @@ -288,7 +288,6 @@ static int nlaedit_borderselect_exec(bContext *C, wmOperator *op) bAnimContext ac; rcti rect; short mode=0, selectmode=0; - int event; /* get editor data */ if (ANIM_animdata_get_context(C, &ac) == 0) @@ -300,8 +299,7 @@ static int nlaedit_borderselect_exec(bContext *C, wmOperator *op) rect.xmax= RNA_int_get(op->ptr, "xmax"); rect.ymax= RNA_int_get(op->ptr, "ymax"); - event= RNA_int_get(op->ptr, "event_type"); - if (event == LEFTMOUSE) // FIXME... hardcoded + if (RNA_int_get(op->ptr, "gesture_mode") == GESTURE_MODAL_SELECT) selectmode = SELECT_ADD; else selectmode = SELECT_SUBTRACT; @@ -347,11 +345,7 @@ void NLA_OT_select_border(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* rna */ - RNA_def_int(ot->srna, "event_type", 0, INT_MIN, INT_MAX, "Event Type", "", INT_MIN, INT_MAX); - RNA_def_int(ot->srna, "xmin", 0, INT_MIN, INT_MAX, "X Min", "", INT_MIN, INT_MAX); - RNA_def_int(ot->srna, "xmax", 0, INT_MIN, INT_MAX, "X Max", "", INT_MIN, INT_MAX); - RNA_def_int(ot->srna, "ymin", 0, INT_MIN, INT_MAX, "Y Min", "", INT_MIN, INT_MAX); - RNA_def_int(ot->srna, "ymax", 0, INT_MIN, INT_MAX, "Y Max", "", INT_MIN, INT_MAX); + WM_operator_properties_gesture_border(ot, 0); RNA_def_boolean(ot->srna, "axis_range", 0, "Axis Range", ""); } diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c index 403a8d1a591..42304e0daa3 100644 --- a/source/blender/editors/space_node/drawnode.c +++ b/source/blender/editors/space_node/drawnode.c @@ -315,7 +315,7 @@ static void node_buts_normal(uiLayout *layout, PointerRNA *ptr) (short)butr->xmin, (short)butr->xmin, butr->xmax-butr->xmin, butr->xmax-butr->xmin, sock->ns.vec, 0.0f, 1.0f, 0, 0, ""); } - +#if 0 // not used in 2.5x yet static void node_browse_tex_cb(bContext *C, void *ntree_v, void *node_v) { bNodeTree *ntree= ntree_v; @@ -345,7 +345,7 @@ static void node_browse_tex_cb(bContext *C, void *ntree_v, void *node_v) node->menunr= 0; } - +#endif static void node_dynamic_update_cb(bContext *C, void *ntree_v, void *node_v) { Material *ma; @@ -1342,9 +1342,9 @@ static void node_composit_buts_channel_matte(uiLayout *layout, PointerRNA *ptr) uiBlock *block= uiLayoutAbsoluteBlock(layout); bNode *node= ptr->data; rctf *butr= &node->butr; - short sx= (butr->xmax-butr->xmin)/4; +// short sx= (butr->xmax-butr->xmin)/4; short cx= (butr->xmax-butr->xmin)/3; - NodeChroma *c=node->storage; +// NodeChroma *c=node->storage; char *c1, *c2, *c3; /*color space selector*/ diff --git a/source/blender/editors/space_node/node_select.c b/source/blender/editors/space_node/node_select.c index ecbd46b720f..e082f3797c1 100644 --- a/source/blender/editors/space_node/node_select.c +++ b/source/blender/editors/space_node/node_select.c @@ -244,9 +244,7 @@ static int node_borderselect_exec(bContext *C, wmOperator *op) bNode *node; rcti rect; rctf rectf; - short val; - - val= RNA_int_get(op->ptr, "event_type"); + int gesture_mode= RNA_int_get(op->ptr, "gesture_mode"); rect.xmin= RNA_int_get(op->ptr, "xmin"); rect.ymin= RNA_int_get(op->ptr, "ymin"); @@ -261,7 +259,7 @@ static int node_borderselect_exec(bContext *C, wmOperator *op) for(node= snode->edittree->nodes.first; node; node= node->next) { if(BLI_isect_rctf(&rectf, &node->totr, NULL)) { - if(val==NODE_EXTEND) + if(gesture_mode==GESTURE_MODAL_SELECT) node->flag |= SELECT; else node->flag &= ~SELECT; @@ -290,11 +288,7 @@ void NODE_OT_select_border(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* rna */ - RNA_def_int(ot->srna, "event_type", 0, INT_MIN, INT_MAX, "Event Type", "", INT_MIN, INT_MAX); - RNA_def_int(ot->srna, "xmin", 0, INT_MIN, INT_MAX, "X Min", "", INT_MIN, INT_MAX); - RNA_def_int(ot->srna, "xmax", 0, INT_MIN, INT_MAX, "X Max", "", INT_MIN, INT_MAX); - RNA_def_int(ot->srna, "ymin", 0, INT_MIN, INT_MAX, "Y Min", "", INT_MIN, INT_MAX); - RNA_def_int(ot->srna, "ymax", 0, INT_MIN, INT_MAX, "Y Max", "", INT_MIN, INT_MAX); + WM_operator_properties_gesture_border(ot, FALSE); } /* ****** Select/Deselect All ****** */ diff --git a/source/blender/editors/space_sequencer/sequencer_select.c b/source/blender/editors/space_sequencer/sequencer_select.c index fc33dc139b6..381d9241094 100644 --- a/source/blender/editors/space_sequencer/sequencer_select.c +++ b/source/blender/editors/space_sequencer/sequencer_select.c @@ -793,13 +793,12 @@ static int sequencer_borderselect_exec(bContext *C, wmOperator *op) Sequence *seq; rcti rect; rctf rectf, rq; - int val; + short selecting = (RNA_int_get(op->ptr, "gesture_mode")==GESTURE_MODAL_SELECT); short mval[2]; if(ed==NULL) return OPERATOR_CANCELLED; - val= RNA_int_get(op->ptr, "event_type"); rect.xmin= RNA_int_get(op->ptr, "xmin"); rect.ymin= RNA_int_get(op->ptr, "ymin"); rect.xmax= RNA_int_get(op->ptr, "xmax"); @@ -816,7 +815,7 @@ static int sequencer_borderselect_exec(bContext *C, wmOperator *op) seq_rectf(seq, &rq); if(BLI_isect_rctf(&rq, &rectf, 0)) { - if(val==LEFTMOUSE) seq->flag |= SELECT; + if(selecting) seq->flag |= SELECT; else seq->flag &= SEQ_DESEL; recurs_sel_seq(seq); } @@ -845,9 +844,5 @@ void SEQUENCER_OT_select_border(wmOperatorType *ot) ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; /* rna */ - RNA_def_int(ot->srna, "event_type", 0, INT_MIN, INT_MAX, "Event Type", "", INT_MIN, INT_MAX); - RNA_def_int(ot->srna, "xmin", 0, INT_MIN, INT_MAX, "X Min", "", INT_MIN, INT_MAX); - RNA_def_int(ot->srna, "xmax", 0, INT_MIN, INT_MAX, "X Max", "", INT_MIN, INT_MAX); - RNA_def_int(ot->srna, "ymin", 0, INT_MIN, INT_MAX, "Y Min", "", INT_MIN, INT_MAX); - RNA_def_int(ot->srna, "ymax", 0, INT_MIN, INT_MAX, "Y Max", "", INT_MIN, INT_MAX); + WM_operator_properties_gesture_border(ot, FALSE); } diff --git a/source/blender/editors/space_view3d/view3d_buttons.c b/source/blender/editors/space_view3d/view3d_buttons.c index 12adfced5c2..2edccacff7a 100644 --- a/source/blender/editors/space_view3d/view3d_buttons.c +++ b/source/blender/editors/space_view3d/view3d_buttons.c @@ -574,13 +574,14 @@ static void v3d_transform_butsR(uiLayout *layout, PointerRNA *ptr) static void v3d_posearmature_buts(uiLayout *layout, View3D *v3d, Object *ob, float lim) { - uiBlock *block= uiLayoutGetBlock(layout); +// uiBlock *block= uiLayoutGetBlock(layout); bArmature *arm; bPoseChannel *pchan; Bone *bone= NULL; - TransformProperties *tfp= v3d->properties_storage; +// TransformProperties *tfp= v3d->properties_storage; PointerRNA pchanptr; - uiLayout *row, *col; + uiLayout *col; +// uiLayout *row; arm = ob->data; if (!arm || !ob->pose) return; @@ -682,11 +683,12 @@ void validate_editbonebutton_cb(bContext *C, void *bonev, void *namev) static void v3d_editarmature_buts(uiLayout *layout, View3D *v3d, Object *ob, float lim) { - uiBlock *block= uiLayoutGetBlock(layout); +// uiBlock *block= uiLayoutGetBlock(layout); bArmature *arm= ob->data; EditBone *ebone; - TransformProperties *tfp= v3d->properties_storage; - uiLayout *row, *col; +// TransformProperties *tfp= v3d->properties_storage; +// uiLayout *row; + uiLayout *col; PointerRNA eboneptr; ebone= arm->edbo->first; @@ -722,7 +724,8 @@ static void v3d_editmetaball_buts(uiLayout *layout, Object *ob, float lim) { PointerRNA mbptr, ptr; MetaBall *mball= ob->data; - uiLayout *row, *col; +// uiLayout *row; + uiLayout *col; if (!mball || !(mball->lastelem)) return; @@ -779,9 +782,9 @@ static int test_parent_loop(Object *par, Object *ob) static void do_view3d_region_buttons(bContext *C, void *arg, int event) { Scene *scene= CTX_data_scene(C); - Object *obedit= CTX_data_edit_object(C); +// Object *obedit= CTX_data_edit_object(C); View3D *v3d= CTX_wm_view3d(C); - BoundBox *bb; +// BoundBox *bb; Object *ob= OBACT; TransformProperties *tfp= v3d->properties_storage; diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c index 04658df3861..f0425974f29 100644 --- a/source/blender/editors/space_view3d/view3d_select.c +++ b/source/blender/editors/space_view3d/view3d_select.c @@ -1373,38 +1373,38 @@ static int view3d_borderselect_exec(bContext *C, wmOperator *op) MetaElem *ml; unsigned int buffer[4*MAXPICKBUF]; int a, index; - short hits, val; + short hits, selecting; view3d_operator_needs_opengl(C); /* setup view context for argument to callbacks */ view3d_set_viewcontext(C, &vc); - val= RNA_int_get(op->ptr, "event_type"); + selecting= (RNA_int_get(op->ptr, "gesture_mode")==GESTURE_MODAL_SELECT); rect.xmin= RNA_int_get(op->ptr, "xmin"); rect.ymin= RNA_int_get(op->ptr, "ymin"); rect.xmax= RNA_int_get(op->ptr, "xmax"); rect.ymax= RNA_int_get(op->ptr, "ymax"); if(obedit==NULL && (paint_facesel_test(OBACT))) { - face_borderselect(C, obact, &rect, (val==LEFTMOUSE)); + face_borderselect(C, obact, &rect, selecting); return OPERATOR_FINISHED; } else if(obedit==NULL && (obact && obact->mode & OB_MODE_PARTICLE_EDIT)) { - return PE_border_select(C, &rect, (val==LEFTMOUSE)); + return PE_border_select(C, &rect, selecting); } if(obedit) { if(obedit->type==OB_MESH) { Mesh *me= obedit->data; vc.em= me->edit_mesh; - do_mesh_box_select(&vc, &rect, (val==LEFTMOUSE)); + do_mesh_box_select(&vc, &rect, selecting); // if (EM_texFaceCheck()) WM_event_add_notifier(C, NC_GEOM|ND_SELECT, obedit->data); } else if(ELEM(obedit->type, OB_CURVE, OB_SURF)) { - do_nurbs_box_select(&vc, &rect, val==LEFTMOUSE); + do_nurbs_box_select(&vc, &rect, selecting); } else if(obedit->type==OB_MBALL) { MetaBall *mb = (MetaBall*)obedit->data; @@ -1416,14 +1416,14 @@ static int view3d_borderselect_exec(bContext *C, wmOperator *op) for(a=0; a<hits; a++) { if(ml->selcol1==buffer[ (4 * a) + 3 ]) { ml->flag |= MB_SCALE_RAD; - if(val==LEFTMOUSE) ml->flag |= SELECT; - else ml->flag &= ~SELECT; + if(selecting) ml->flag |= SELECT; + else ml->flag &= ~SELECT; break; } if(ml->selcol2==buffer[ (4 * a) + 3 ]) { ml->flag &= ~MB_SCALE_RAD; - if(val==LEFTMOUSE) ml->flag |= SELECT; - else ml->flag &= ~SELECT; + if(selecting) ml->flag |= SELECT; + else ml->flag &= ~SELECT; break; } } @@ -1447,14 +1447,14 @@ static int view3d_borderselect_exec(bContext *C, wmOperator *op) ebone = BLI_findlink(arm->edbo, index & ~(BONESEL_ANY)); if (index & BONESEL_TIP) { ebone->flag |= BONE_DONE; - if (val==LEFTMOUSE) ebone->flag |= BONE_TIPSEL; - else ebone->flag &= ~BONE_TIPSEL; + if (selecting) ebone->flag |= BONE_TIPSEL; + else ebone->flag &= ~BONE_TIPSEL; } if (index & BONESEL_ROOT) { ebone->flag |= BONE_DONE; - if (val==LEFTMOUSE) ebone->flag |= BONE_ROOTSEL; - else ebone->flag &= ~BONE_ROOTSEL; + if (selecting) ebone->flag |= BONE_ROOTSEL; + else ebone->flag &= ~BONE_ROOTSEL; } } } @@ -1474,7 +1474,7 @@ static int view3d_borderselect_exec(bContext *C, wmOperator *op) ebone = BLI_findlink(arm->edbo, index & ~(BONESEL_ANY)); if (index & BONESEL_BONE) { if(!(ebone->flag & BONE_DONE)) { - if (val==LEFTMOUSE) + if (selecting) ebone->flag |= (BONE_ROOTSEL|BONE_TIPSEL|BONE_SELECTED); else ebone->flag &= ~(BONE_ROOTSEL|BONE_TIPSEL|BONE_SELECTED); @@ -1486,7 +1486,7 @@ static int view3d_borderselect_exec(bContext *C, wmOperator *op) ED_armature_sync_selection(arm->edbo); } else if(obedit->type==OB_LATTICE) { - do_lattice_box_select(&vc, &rect, val==LEFTMOUSE); + do_lattice_box_select(&vc, &rect, selecting); } } else { /* no editmode, unified for bones and objects */ @@ -1494,7 +1494,6 @@ static int view3d_borderselect_exec(bContext *C, wmOperator *op) Object *ob= OBACT; unsigned int *vbuffer=NULL; /* selection buffer */ unsigned int *col; /* color in buffer */ - short selecting = 0; int bone_only; int totobj= MAXPICKBUF; // XXX solve later @@ -1503,9 +1502,6 @@ static int view3d_borderselect_exec(bContext *C, wmOperator *op) else bone_only= 0; - if (val==LEFTMOUSE) - selecting = 1; - /* selection buffer now has bones potentially too, so we add MAXPICKBUF */ vbuffer = MEM_mallocN(4 * (totobj+MAXPICKBUF) * sizeof(unsigned int), "selection buffer"); hits= view3d_opengl_select(&vc, vbuffer, 4*(totobj+MAXPICKBUF), &rect); @@ -1589,13 +1585,7 @@ void VIEW3D_OT_select_border(wmOperatorType *ot) ot->flag= OPTYPE_UNDO; /* rna */ - RNA_def_int(ot->srna, "event_type", 0, INT_MIN, INT_MAX, "Event Type", "", INT_MIN, INT_MAX); - RNA_def_int(ot->srna, "xmin", 0, INT_MIN, INT_MAX, "X Min", "", INT_MIN, INT_MAX); - RNA_def_int(ot->srna, "xmax", 0, INT_MIN, INT_MAX, "X Max", "", INT_MIN, INT_MAX); - RNA_def_int(ot->srna, "ymin", 0, INT_MIN, INT_MAX, "Y Min", "", INT_MIN, INT_MAX); - RNA_def_int(ot->srna, "ymax", 0, INT_MIN, INT_MAX, "Y Max", "", INT_MIN, INT_MAX); - - RNA_def_boolean(ot->srna, "extend", 0, "Extend", "Extend selection instead of deselecting everything first."); + WM_operator_properties_gesture_border(ot, TRUE); } /* ****** Mouse Select ****** */ diff --git a/source/blender/editors/uvedit/uvedit_ops.c b/source/blender/editors/uvedit/uvedit_ops.c index 47f10ce7aa8..f9a849798be 100644 --- a/source/blender/editors/uvedit/uvedit_ops.c +++ b/source/blender/editors/uvedit/uvedit_ops.c @@ -2045,7 +2045,7 @@ static int border_select_exec(bContext *C, wmOperator *op) UI_view2d_region_to_view(&ar->v2d, rect.xmax, rect.ymax, &rectf.xmax, &rectf.ymax); /* figure out what to select/deselect */ - select= (RNA_int_get(op->ptr, "event_type") == LEFTMOUSE); // XXX hardcoded + select= (RNA_int_get(op->ptr, "gesture_mode") == GESTURE_MODAL_SELECT); pinned= RNA_boolean_get(op->ptr, "pinned"); if(ts->uv_flag & UV_SYNC_SELECTION) @@ -2168,11 +2168,7 @@ void UV_OT_select_border(wmOperatorType *ot) /* properties */ RNA_def_boolean(ot->srna, "pinned", 0, "Pinned", "Border select pinned UVs only."); - RNA_def_int(ot->srna, "event_type", 0, INT_MIN, INT_MAX, "Event Type", "", INT_MIN, INT_MAX); - RNA_def_int(ot->srna, "xmin", 0, INT_MIN, INT_MAX, "X Min", "", INT_MIN, INT_MAX); - RNA_def_int(ot->srna, "xmax", 0, INT_MIN, INT_MAX, "X Max", "", INT_MIN, INT_MAX); - RNA_def_int(ot->srna, "ymin", 0, INT_MIN, INT_MAX, "Y Min", "", INT_MIN, INT_MAX); - RNA_def_int(ot->srna, "ymax", 0, INT_MIN, INT_MAX, "Y Max", "", INT_MIN, INT_MAX); + WM_operator_properties_gesture_border(ot, FALSE); } /* ******************** circle select operator **************** */ |