From 09c7c638905230a608a9b0204b68c775cf71bf67 Mon Sep 17 00:00:00 2001 From: Hans Goudey Date: Mon, 18 Jan 2021 17:28:47 -0600 Subject: UI Code Quality: Use "params" struct for area and region callbacks These functions with many arguments can be unwieldy. Aside from the obvious issues with rewriting the list of arguments and the opportunities for error and frustration that presents, the long list of arguments make these systems hard to change. So when an argument should be added, someone might skip that and add some hack instead. So, as proposed in T73586#1037210, this patch instead uses a "params" struct for each of these callbacks. - Use param argument for `ARegionType.listener` - Remove unused window field in region listener - Use param argument for `SpaceType.listener` - Use params struct for `ARegionType.message_subscribe` Differential Revision: https://developer.blender.org/D9750 --- source/blender/editors/space_script/space_script.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'source/blender/editors/space_script/space_script.c') diff --git a/source/blender/editors/space_script/space_script.c b/source/blender/editors/space_script/space_script.c index 3330ba14530..68697f20f9c 100644 --- a/source/blender/editors/space_script/space_script.c +++ b/source/blender/editors/space_script/space_script.c @@ -156,13 +156,8 @@ static void script_header_region_draw(const bContext *C, ARegion *region) ED_region_header(C, region); } -static void script_main_region_listener(wmWindow *UNUSED(win), - ScrArea *UNUSED(area), - ARegion *UNUSED(region), - wmNotifier *UNUSED(wmn), - const Scene *UNUSED(scene)) +static void script_main_region_listener(wmRegionListenerParams *UNUSED(params)) { -/* context changes */ /* XXX - Todo, need the ScriptSpace accessible to get the python script to run. */ #if 0 BPY_run_script_space_listener() -- cgit v1.2.3