diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-03-13 13:03:46 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-03-13 13:03:46 +0400 |
commit | aaa8a13c493a09b2db9ddd4421737c612a3634c8 (patch) | |
tree | 51c561f1d8c2d63341384fb5ba1d3fc97c5df040 /source/blender/makesrna/intern | |
parent | 2c8d3a969d11a5a40d34d51b5c0545267e7b6e90 (diff) |
code cleanup: use const events for modal and invoke operators.
Diffstat (limited to 'source/blender/makesrna/intern')
-rw-r--r-- | source/blender/makesrna/intern/rna_wm.c | 4 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_wm_api.c | 14 |
2 files changed, 14 insertions, 4 deletions
diff --git a/source/blender/makesrna/intern/rna_wm.c b/source/blender/makesrna/intern/rna_wm.c index 85059755b1b..9a160d8bb1e 100644 --- a/source/blender/makesrna/intern/rna_wm.c +++ b/source/blender/makesrna/intern/rna_wm.c @@ -947,7 +947,7 @@ static int operator_check(bContext *C, wmOperator *op) return result; } -static int operator_invoke(bContext *C, wmOperator *op, wmEvent *event) +static int operator_invoke(bContext *C, wmOperator *op, const wmEvent *event) { extern FunctionRNA rna_Operator_invoke_func; @@ -974,7 +974,7 @@ static int operator_invoke(bContext *C, wmOperator *op, wmEvent *event) } /* same as invoke */ -static int operator_modal(bContext *C, wmOperator *op, wmEvent *event) +static int operator_modal(bContext *C, wmOperator *op, const wmEvent *event) { extern FunctionRNA rna_Operator_modal_func; diff --git a/source/blender/makesrna/intern/rna_wm_api.c b/source/blender/makesrna/intern/rna_wm_api.c index b7895cc0e2d..64c5f7ae220 100644 --- a/source/blender/makesrna/intern/rna_wm_api.c +++ b/source/blender/makesrna/intern/rna_wm_api.c @@ -86,6 +86,16 @@ static void rna_event_timer_remove(struct wmWindowManager *wm, wmTimer *timer) WM_event_remove_timer(wm, timer->win, timer); } +/* wrap these because of 'const wmEvent *' */ +static int rna_Operator_confirm(bContext *C, wmOperator *op, wmEvent *event) +{ + return WM_operator_confirm(C, op, event); +} +static int rna_Operator_props_popup(bContext *C, wmOperator *op, wmEvent *event) +{ + return WM_operator_props_popup(C, op, event); +} + static wmKeyMapItem *rna_KeyMap_item_new(wmKeyMap *km, ReportList *reports, const char *idname, int type, int value, int any, int shift, int ctrl, int alt, int oskey, int keymodifier, int head) { @@ -266,7 +276,7 @@ void RNA_api_wm(StructRNA *srna) /* invoke functions, for use with python */ - func = RNA_def_function(srna, "invoke_props_popup", "WM_operator_props_popup"); + func = RNA_def_function(srna, "invoke_props_popup", "rna_Operator_props_popup"); RNA_def_function_ui_description(func, "Operator popup invoke"); rna_generic_op_invoke(func, WM_GEN_INVOKE_EVENT | WM_GEN_INVOKE_RETURN); @@ -284,7 +294,7 @@ void RNA_api_wm(StructRNA *srna) RNA_def_function_ui_description(func, "Operator popup invoke"); rna_generic_op_invoke(func, WM_GEN_INVOKE_SIZE | WM_GEN_INVOKE_RETURN); - func = RNA_def_function(srna, "invoke_confirm", "WM_operator_confirm"); + func = RNA_def_function(srna, "invoke_confirm", "rna_Operator_confirm"); RNA_def_function_ui_description(func, "Operator confirmation"); rna_generic_op_invoke(func, WM_GEN_INVOKE_EVENT | WM_GEN_INVOKE_RETURN); |