Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2009-03-29 06:15:13 +0400
committerCampbell Barton <ideasman42@gmail.com>2009-03-29 06:15:13 +0400
commit931527e648acfbc2c7b71b59ce661dad9a4c1038 (patch)
treea00b98e524fb8ea459d1f915524ee3a08fb7c747 /source/blender/editors/animation/anim_markers.c
parent4a164ce520c8b8a5f4e8ff90aef7050694562dc9 (diff)
- use clear, set, add, enable, disable and toggle as a prefix in operator names
- use select as a suffix eg UV_OT_loop_select -> UV_OT_select_loop - Each select all operator was using slightly different wording... select_all, deselect_all, de_select_all, select_de_select_all -> select_all_toggle - selection -> select - POSE_OT_select_connected -> POSE_OT_select_linked to match other operators - NODE_OT_delete_selection -> NODE_OT_delete since its not used in other operators - ANIM_OT_previewrange_define -> ANIM_OT_previewrange_set to match other operators - NODE_OT_fit_all -> NODE_OT_view_all to match other operators - View2D_OT_* -> VIEW2D_OT_* to match VIEW3D - View2D_OT_view_downscroll -> VIEW2D_OT_scroll_down more logical - removed MARKER_OT_mouseselect_extend and made extend a boolean property of MARKER_OT_mouseselect - MARKER_OT_mouseselect -> MARKER_OT_select - GROUP_OT_group_remove -> GROUP_OT_objects_remove more logical since its removing objects from groups - MESH_OT_removedoublesflag -> MESH_OT_remove_doubles - redundant words MESH_OT_split_mesh -> MESH_OT_split, OBJECT_OT_object_delete -> OBJECT_OT_delete renamed selection operator properties extend_select -> extend column_select -> column select_children_only -> children_only ... Since these are all in the context of selection operators there is no need for the extra 'select' in the property name. Updated docs http://www.graphicall.org/ftp/ideasman42/html/bpyoperator-module.html
Diffstat (limited to 'source/blender/editors/animation/anim_markers.c')
-rw-r--r--source/blender/editors/animation/anim_markers.c49
1 files changed, 16 insertions, 33 deletions
diff --git a/source/blender/editors/animation/anim_markers.c b/source/blender/editors/animation/anim_markers.c
index 7817afc929c..fc52d9c4511 100644
--- a/source/blender/editors/animation/anim_markers.c
+++ b/source/blender/editors/animation/anim_markers.c
@@ -629,21 +629,17 @@ static int ed_marker_select(bContext *C, wmEvent *evt, int extend)
return OPERATOR_PASS_THROUGH;
}
-static int ed_marker_select_extend_invoke(bContext *C, wmOperator *op, wmEvent *evt)
-{
- return ed_marker_select(C, evt, 1);
-}
-
static int ed_marker_select_invoke(bContext *C, wmOperator *op, wmEvent *evt)
{
- return ed_marker_select(C, evt, 0);
+ short extend= RNA_boolean_get(op->ptr, "extend");
+ return ed_marker_select(C, evt, extend);
}
-static void MARKER_OT_mouseselect(wmOperatorType *ot)
+static void MARKER_OT_select(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Select Time Marker";
- ot->idname= "MARKER_OT_mouseselect";
+ ot->idname= "MARKER_OT_select";
/* api callbacks */
ot->invoke= ed_marker_select_invoke;
@@ -651,20 +647,8 @@ static void MARKER_OT_mouseselect(wmOperatorType *ot)
/* flags */
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
-}
-static void MARKER_OT_mouseselect_extend(wmOperatorType *ot)
-{
- /* identifiers */
- ot->name= "Extend Select Time Marker";
- ot->idname= "MARKER_OT_mouseselect_extend";
-
- /* api callbacks */
- ot->invoke= ed_marker_select_extend_invoke;
- ot->poll= ED_operator_areaactive;
-
- /* flags */
- ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+ RNA_def_boolean(ot->srna, "extend", 0, "Extend", "extend the selection");
}
/* *************************** border select markers **************** */
@@ -731,11 +715,11 @@ static int ed_marker_border_select_exec(bContext *C, wmOperator *op)
return 1;
}
-static void MARKER_OT_border_select(wmOperatorType *ot)
+static void MARKER_OT_select_border(wmOperatorType *ot)
{
/* identifiers */
ot->name= "Marker Border select";
- ot->idname= "MARKER_OT_border_select";
+ ot->idname= "MARKER_OT_select_border";
/* api callbacks */
ot->exec= ed_marker_border_select_exec;
@@ -796,11 +780,11 @@ static int ed_marker_select_all_invoke(bContext *C, wmOperator *op, wmEvent *evt
return ed_marker_select_all_exec(C, op);
}
-static void MARKER_OT_select_all(wmOperatorType *ot)
+static void MARKER_OT_select_all_toggle(wmOperatorType *ot)
{
/* identifiers */
ot->name= "(De)select all markers";
- ot->idname= "MARKER_OT_select_all";
+ ot->idname= "MARKER_OT_select_all_toggle";
/* api callbacks */
ot->exec= ed_marker_select_all_exec;
@@ -866,10 +850,9 @@ void ED_marker_operatortypes(void)
WM_operatortype_append(MARKER_OT_add);
WM_operatortype_append(MARKER_OT_move);
WM_operatortype_append(MARKER_OT_duplicate);
- WM_operatortype_append(MARKER_OT_mouseselect);
- WM_operatortype_append(MARKER_OT_mouseselect_extend);
- WM_operatortype_append(MARKER_OT_border_select);
- WM_operatortype_append(MARKER_OT_select_all);
+ WM_operatortype_append(MARKER_OT_select);
+ WM_operatortype_append(MARKER_OT_select_border);
+ WM_operatortype_append(MARKER_OT_select_all_toggle);
WM_operatortype_append(MARKER_OT_delete);
}
@@ -881,10 +864,10 @@ void ED_marker_keymap(wmWindowManager *wm)
WM_keymap_verify_item(keymap, "MARKER_OT_add", MKEY, KM_PRESS, 0, 0);
WM_keymap_verify_item(keymap, "MARKER_OT_move", EVT_TWEAK_S, KM_ANY, 0, 0);
WM_keymap_verify_item(keymap, "MARKER_OT_duplicate", DKEY, KM_PRESS, KM_SHIFT, 0);
- WM_keymap_verify_item(keymap, "MARKER_OT_mouseselect", SELECTMOUSE, KM_PRESS, 0, 0);
- WM_keymap_verify_item(keymap, "MARKER_OT_mouseselect_extend", SELECTMOUSE, KM_PRESS, KM_SHIFT, 0);
- WM_keymap_verify_item(keymap, "MARKER_OT_border_select", BKEY, KM_PRESS, 0, 0);
- WM_keymap_verify_item(keymap, "MARKER_OT_select_all", AKEY, KM_PRESS, 0, 0);
+ WM_keymap_verify_item(keymap, "MARKER_OT_select", SELECTMOUSE, KM_PRESS, 0, 0);
+ RNA_boolean_set(WM_keymap_add_item(keymap, "MARKER_OT_select", SELECTMOUSE, KM_PRESS, KM_SHIFT, 0)->ptr, "extend", 1);
+ WM_keymap_verify_item(keymap, "MARKER_OT_select_border", BKEY, KM_PRESS, 0, 0);
+ WM_keymap_verify_item(keymap, "MARKER_OT_select_all_toggle", AKEY, KM_PRESS, 0, 0);
WM_keymap_verify_item(keymap, "MARKER_OT_delete", XKEY, KM_PRESS, 0, 0);
WM_keymap_add_item(keymap, "MARKER_OT_move", GKEY, KM_PRESS, 0, 0);