From 2ccada61cb1a7681c9736247fbcbbe0699002ecb Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 6 Feb 2024 14:44:03 +1100 Subject: [PATCH] Cleanup: improve naming consistency, use doxy sections for splash screen --- .../windowmanager/intern/wm_splash_screen.cc | 30 +++++++++++++------ 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/source/blender/windowmanager/intern/wm_splash_screen.cc b/source/blender/windowmanager/intern/wm_splash_screen.cc index e72573dd24a..92475e26e9a 100644 --- a/source/blender/windowmanager/intern/wm_splash_screen.cc +++ b/source/blender/windowmanager/intern/wm_splash_screen.cc @@ -52,7 +52,11 @@ #include "wm.hh" -static void wm_block_close(bContext *C, void *arg_block, void * /*arg*/) +/* -------------------------------------------------------------------- */ +/** \name Splash Screen + * \{ */ + +static void wm_block_splash_close(bContext *C, void *arg_block, void * /*arg*/) { wmWindow *win = CTX_wm_window(C); UI_popup_block_close(C, win, static_cast(arg_block)); @@ -190,11 +194,11 @@ static void wm_block_splash_close_on_fileselect(bContext *C, void *arg1, void * } if (has_fileselect) { - wm_block_close(C, arg1, nullptr); + wm_block_splash_close(C, arg1, nullptr); } } -static uiBlock *wm_block_create_splash(bContext *C, ARegion *region, void * /*arg*/) +static uiBlock *wm_block_splash_create(bContext *C, ARegion *region, void * /*arg*/) { const uiStyle *style = UI_style_get_dpi(); @@ -219,7 +223,7 @@ static uiBlock *wm_block_create_splash(bContext *C, ARegion *region, void * /*ar uiBut *but = uiDefButImage( block, ibuf, 0, 0.5f * U.widget_unit, splash_width, splash_height, nullptr); - UI_but_func_set(but, wm_block_close, block, nullptr); + UI_but_func_set(but, wm_block_splash_close, block, nullptr); wm_block_splash_add_label(block, BKE_blender_version_string(), @@ -271,7 +275,7 @@ static uiBlock *wm_block_create_splash(bContext *C, ARegion *region, void * /*ar static int wm_splash_invoke(bContext *C, wmOperator * /*op*/, const wmEvent * /*event*/) { - UI_popup_block_invoke(C, wm_block_create_splash, nullptr, nullptr); + UI_popup_block_invoke(C, wm_block_splash_create, nullptr, nullptr); return OPERATOR_FINISHED; } @@ -286,7 +290,13 @@ void WM_OT_splash(wmOperatorType *ot) ot->poll = WM_operator_winactive; } -static uiBlock *wm_block_create_about(bContext *C, ARegion *region, void * /*arg*/) +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Splash Screen: About + * \{ */ + +static uiBlock *wm_block_about_create(bContext *C, ARegion *region, void * /*arg*/) { const uiStyle *style = UI_style_get_dpi(); const int text_points_max = std::max(style->widget.points, style->widgetlabel.points); @@ -347,9 +357,9 @@ static uiBlock *wm_block_create_about(bContext *C, ARegion *region, void * /*arg return block; } -static int wm_about_invoke(bContext *C, wmOperator * /*op*/, const wmEvent * /*event*/) +static int wm_splash_about_invoke(bContext *C, wmOperator * /*op*/, const wmEvent * /*event*/) { - UI_popup_block_invoke(C, wm_block_create_about, nullptr, nullptr); + UI_popup_block_invoke(C, wm_block_about_create, nullptr, nullptr); return OPERATOR_FINISHED; } @@ -360,6 +370,8 @@ void WM_OT_splash_about(wmOperatorType *ot) ot->idname = "WM_OT_splash_about"; ot->description = "Open a window with information about Blender"; - ot->invoke = wm_about_invoke; + ot->invoke = wm_splash_about_invoke; ot->poll = WM_operator_winactive; } + +/** \} */