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:
authorHans Goudey <h.goudey@me.com>2021-01-19 02:28:47 +0300
committerHans Goudey <h.goudey@me.com>2021-01-19 02:28:47 +0300
commit09c7c638905230a608a9b0204b68c775cf71bf67 (patch)
tree4b21efd9b23283ef236e756f46e3f75f5d2e6c61 /source/blender/editors/interface
parent4b4aec288458dd24721fdd61af38d3c316c2520b (diff)
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
Diffstat (limited to 'source/blender/editors/interface')
-rw-r--r--source/blender/editors/interface/interface_region_popup.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/source/blender/editors/interface/interface_region_popup.c b/source/blender/editors/interface/interface_region_popup.c
index 93e3dbb2cc8..c6c6cd1eeea 100644
--- a/source/blender/editors/interface/interface_region_popup.c
+++ b/source/blender/editors/interface/interface_region_popup.c
@@ -413,12 +413,11 @@ static void ui_block_region_draw(const bContext *C, ARegion *region)
/**
* Use to refresh centered popups on screen resizing (for splash).
*/
-static void ui_block_region_popup_window_listener(wmWindow *UNUSED(win),
- ScrArea *UNUSED(area),
- ARegion *region,
- wmNotifier *wmn,
- const Scene *UNUSED(scene))
+static void ui_block_region_popup_window_listener(wmRegionListenerParams *params)
{
+ ARegion *region = params->region;
+ wmNotifier *wmn = params->notifier;
+
switch (wmn->category) {
case NC_WINDOW: {
switch (wmn->action) {