This is an attempt to complete the proposal T53798.
Since the preview of area split has to share internal variables of SCREEN_OT_area_split, I decided to convert the drawing function in ED_screen_draw into a callback.
But as the existing draw_callbacks are limited to areas. The solution taken was to extend the API including draw_callbacks to the struct wmWindow.
So this patch can be divided into three stages:
- Create API for draw_callbacks in struct wmWindow;
- Split the ED_screen_draw function into ED_screen_draw_edges, ED_screen_draw_join_shape and ED_screen_draw_split_preview and use the last two functions as callbacks called in SCREEN_OT_area_split and SCREEN_OT_area_join respectively;
- Calculate a snap factor in ED_screen_draw_split_preview.
I will gladly accept other suggestions ;)