Blender Git Commit Log

Git Commits -> Revision 09c7c63

Revision 09c7c63 by Hans Goudey (master)
January 18, 2021, 23:28 (GMT)
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

Commit Details:

Full Hash: 09c7c638905230a608a9b0204b68c775cf71bf67
Parent Commit: 4b4aec2
Lines Changed: +375, -475

26 Modified Paths:

/source/blender/blenkernel/BKE_screen.h (+27, -16) (Diff)
/source/blender/editors/include/ED_screen.h (+10, -34) (Diff)
/source/blender/editors/interface/interface_region_popup.c (+4, -5) (Diff)
/source/blender/editors/screen/area.c (+37, -35) (Diff)
/source/blender/editors/screen/area_utils.c (+6, -7) (Diff)
/source/blender/editors/space_action/space_action.c (+33, -39) (Diff)
/source/blender/editors/space_buttons/space_buttons.c (+16, -23) (Diff)
/source/blender/editors/space_clip/space_clip.c (+24, -32) (Diff)
/source/blender/editors/space_console/space_console.c (+4, -6) (Diff)
/source/blender/editors/space_file/space_file.c (+20, -34) (Diff)
/source/blender/editors/space_graph/space_graph.c (+14, -16) (Diff)
/source/blender/editors/space_image/space_image.c (+21, -21) (Diff)
/source/blender/editors/space_info/space_info.c (+11, -18) (Diff)
/source/blender/editors/space_nla/space_nla.c (+29, -33) (Diff)
/source/blender/editors/space_node/space_node.c (+7, -9) (Diff)
/source/blender/editors/space_outliner/space_outliner.c (+13, -17) (Diff)
/source/blender/editors/space_script/space_script.c (+1, -6) (Diff)
/source/blender/editors/space_sequencer/space_sequencer.c (+21, -26) (Diff)
/source/blender/editors/space_statusbar/space_statusbar.c (+8, -12) (Diff)
/source/blender/editors/space_text/space_text.c (+3, -4) (Diff)
/source/blender/editors/space_topbar/space_topbar.c (+13, -17) (Diff)
/source/blender/editors/space_userpref/space_userpref.c (+4, -30) (Diff)
/source/blender/editors/space_view3d/space_view3d.c (+26, -30) (Diff)
/source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c (+1, -1) (Diff)
/source/blender/windowmanager/gizmo/WM_gizmo_api.h (+1, -1) (Diff)
/source/blender/windowmanager/intern/wm_event_system.c (+21, -3) (Diff)
By: Miika HämäläinenLast update: Nov-07-2014 14:18MiikaHweb | 2003-2021