diff --git a/source/blender/windowmanager/WM_keymap.hh b/source/blender/windowmanager/WM_keymap.hh index 838cd5b0c20..a1ed6274cf5 100644 --- a/source/blender/windowmanager/WM_keymap.hh +++ b/source/blender/windowmanager/WM_keymap.hh @@ -11,7 +11,6 @@ #include #include -#include "BLI_utildefines.h" #include "DNA_windowmanager_types.h" #include "WM_types.hh" diff --git a/source/blender/windowmanager/WM_types.hh b/source/blender/windowmanager/WM_types.hh index 9953c838c8b..61580ce1c28 100644 --- a/source/blender/windowmanager/WM_types.hh +++ b/source/blender/windowmanager/WM_types.hh @@ -118,7 +118,7 @@ struct wmWindowManager; #include "DNA_vec_types.h" #include "DNA_xr_types.h" -#include "BKE_wm_runtime.hh" +#include "BKE_wm_runtime.hh" // IWYU pragma: export #include "RNA_types.hh" diff --git a/source/blender/windowmanager/gizmo/WM_gizmo_api.hh b/source/blender/windowmanager/gizmo/WM_gizmo_api.hh index 415c50b9035..13728441727 100644 --- a/source/blender/windowmanager/gizmo/WM_gizmo_api.hh +++ b/source/blender/windowmanager/gizmo/WM_gizmo_api.hh @@ -13,6 +13,9 @@ #pragma once +#include "WM_gizmo_types.hh" +#include "wm_gizmo_fn.hh" + struct ARegion; struct bContext; struct IDProperty; @@ -40,8 +43,6 @@ struct wmOperatorType; struct wmWindow; struct wmWindowManager; -#include "wm_gizmo_fn.hh" - /* -------------------------------------------------------------------- */ /* #wmGizmo. */ diff --git a/source/blender/windowmanager/gizmo/intern/wm_gizmo.cc b/source/blender/windowmanager/gizmo/intern/wm_gizmo.cc index 661bbe2646a..4277e540999 100644 --- a/source/blender/windowmanager/gizmo/intern/wm_gizmo.cc +++ b/source/blender/windowmanager/gizmo/intern/wm_gizmo.cc @@ -10,11 +10,10 @@ #include "BLI_listbase.h" #include "BLI_math_matrix.h" +#include "BLI_math_vector.h" #include "BKE_context.hh" -#include "GPU_batch.hh" - #include "RNA_access.hh" #include "RNA_define.hh" #include "RNA_prototypes.hh" diff --git a/source/blender/windowmanager/gizmo/intern/wm_gizmo_group.cc b/source/blender/windowmanager/gizmo/intern/wm_gizmo_group.cc index b077cf9a04e..c2fc6ec4a2c 100644 --- a/source/blender/windowmanager/gizmo/intern/wm_gizmo_group.cc +++ b/source/blender/windowmanager/gizmo/intern/wm_gizmo_group.cc @@ -29,6 +29,7 @@ #include "RNA_access.hh" #include "WM_api.hh" +#include "WM_keymap.hh" #include "WM_types.hh" #include "wm_event_system.hh" diff --git a/source/blender/windowmanager/intern/wm.cc b/source/blender/windowmanager/intern/wm.cc index d082a65a13a..f5fb9505775 100644 --- a/source/blender/windowmanager/intern/wm.cc +++ b/source/blender/windowmanager/intern/wm.cc @@ -13,7 +13,6 @@ /* Allow using deprecated functionality for .blend file I/O. */ #define DNA_DEPRECATED_ALLOW -#include #include #include "DNA_windowmanager_types.h" @@ -38,6 +37,7 @@ #include "BKE_workspace.hh" #include "WM_api.hh" +#include "WM_keymap.hh" #include "WM_message.hh" #include "WM_types.hh" #include "wm.hh" diff --git a/source/blender/windowmanager/intern/wm_dragdrop.cc b/source/blender/windowmanager/intern/wm_dragdrop.cc index 8d4f7ef32bd..e7d4300fb18 100644 --- a/source/blender/windowmanager/intern/wm_dragdrop.cc +++ b/source/blender/windowmanager/intern/wm_dragdrop.cc @@ -21,8 +21,9 @@ #include "BLT_translation.hh" -#include "BLI_blenlib.h" #include "BLI_math_color.h" +#include "BLI_string.h" +#include "BLI_string_utf8.h" #include "BIF_glutil.hh" @@ -35,19 +36,19 @@ #include "BKE_preview_image.hh" #include "BKE_screen.hh" -#include "GHOST_C-api.h" - #include "BLO_readfile.hh" #include "ED_fileselect.hh" #include "ED_screen.hh" -#include "GPU_shader.hh" +#include "GPU_shader_builtin.hh" #include "GPU_state.hh" #include "IMB_imbuf.hh" #include "IMB_imbuf_types.hh" +#include "GHOST_Types.h" + #include "UI_interface.hh" #include "UI_interface_icons.hh" #include "UI_resources.hh" diff --git a/source/blender/windowmanager/intern/wm_event_query.cc b/source/blender/windowmanager/intern/wm_event_query.cc index 52317caea01..a0aca468aa7 100644 --- a/source/blender/windowmanager/intern/wm_event_query.cc +++ b/source/blender/windowmanager/intern/wm_event_query.cc @@ -15,9 +15,10 @@ #include "DNA_userdef_types.h" #include "DNA_windowmanager_types.h" -#include "BLI_blenlib.h" #include "BLI_math_rotation.h" #include "BLI_math_vector.h" +#include "BLI_string.h" +#include "BLI_string_utf8.h" #include "BLI_utildefines.h" #include "RNA_access.hh" diff --git a/source/blender/windowmanager/intern/wm_event_system.cc b/source/blender/windowmanager/intern/wm_event_system.cc index ff0dab320c9..f183df594f9 100644 --- a/source/blender/windowmanager/intern/wm_event_system.cc +++ b/source/blender/windowmanager/intern/wm_event_system.cc @@ -28,8 +28,10 @@ #include "GHOST_C-api.h" -#include "BLI_blenlib.h" #include "BLI_ghash.h" +#include "BLI_math_vector.h" +#include "BLI_string.h" +#include "BLI_string_utf8.h" #include "BLI_timer.h" #include "BLI_utildefines.h" @@ -67,6 +69,7 @@ #include "UI_view2d.hh" #include "WM_api.hh" +#include "WM_keymap.hh" #include "WM_message.hh" #include "WM_toolsystem.hh" #include "WM_types.hh" diff --git a/source/blender/windowmanager/intern/wm_files.cc b/source/blender/windowmanager/intern/wm_files.cc index f973adf74c3..03ff8767802 100644 --- a/source/blender/windowmanager/intern/wm_files.cc +++ b/source/blender/windowmanager/intern/wm_files.cc @@ -33,12 +33,12 @@ #include "MEM_CacheLimiterC-Api.h" #include "MEM_guardedalloc.h" -#include "BLI_blenlib.h" -#include "BLI_fileops_types.h" +#include "BLI_fileops.h" #include "BLI_filereader.h" #include "BLI_linklist.h" #include "BLI_math_time.h" #include "BLI_memory_cache.hh" +#include "BLI_string.h" #include "BLI_system.h" #include "BLI_threads.h" #include "BLI_time.h" @@ -132,6 +132,7 @@ #include "DEG_depsgraph.hh" #include "WM_api.hh" +#include "WM_keymap.hh" #include "WM_message.hh" #include "WM_toolsystem.hh" #include "WM_types.hh" diff --git a/source/blender/windowmanager/intern/wm_files_link.cc b/source/blender/windowmanager/intern/wm_files_link.cc index d870587a963..b6996d70f3f 100644 --- a/source/blender/windowmanager/intern/wm_files_link.cc +++ b/source/blender/windowmanager/intern/wm_files_link.cc @@ -11,7 +11,6 @@ #include #include #include -#include #include #include "CLG_log.h" @@ -21,8 +20,10 @@ #include "DNA_screen_types.h" #include "DNA_windowmanager_types.h" -#include "BLI_blenlib.h" +#include "BLI_fileops.h" #include "BLI_map.hh" +#include "BLI_path_utils.hh" +#include "BLI_string.h" #include "BLO_readfile.hh" diff --git a/source/blender/windowmanager/intern/wm_gesture.cc b/source/blender/windowmanager/intern/wm_gesture.cc index fcd60084aa9..048fc5a423a 100644 --- a/source/blender/windowmanager/intern/wm_gesture.cc +++ b/source/blender/windowmanager/intern/wm_gesture.cc @@ -16,8 +16,8 @@ #include "MEM_guardedalloc.h" #include "BLI_bitmap_draw_2d.h" -#include "BLI_blenlib.h" #include "BLI_lasso_2d.hh" +#include "BLI_rect.h" #include "BLI_utildefines.h" #include "WM_api.hh" diff --git a/source/blender/windowmanager/intern/wm_gesture_ops.cc b/source/blender/windowmanager/intern/wm_gesture_ops.cc index 799fdf7a99d..2c4796c2c90 100644 --- a/source/blender/windowmanager/intern/wm_gesture_ops.cc +++ b/source/blender/windowmanager/intern/wm_gesture_ops.cc @@ -12,8 +12,11 @@ * - Property definitions are in `wm_operator_props.cc`. */ #include "MEM_guardedalloc.h" + #include +#include + #include "DNA_space_types.h" #include "DNA_windowmanager_types.h" @@ -378,9 +381,7 @@ int WM_gesture_circle_modal(bContext *C, wmOperator *op, const wmEvent *event) else { rect->xmax += floor(fac); } - if (rect->xmax < 1) { - rect->xmax = 1; - } + rect->xmax = std::max(rect->xmax, 1); is_circle_size = true; break; case GESTURE_MODAL_CIRCLE_ADD: @@ -389,9 +390,7 @@ int WM_gesture_circle_modal(bContext *C, wmOperator *op, const wmEvent *event) break; case GESTURE_MODAL_CIRCLE_SUB: rect->xmax -= 2 + rect->xmax / 10; - if (rect->xmax < 1) { - rect->xmax = 1; - } + rect->xmax = std::max(rect->xmax, 1); is_circle_size = true; break; case GESTURE_MODAL_SELECT: diff --git a/source/blender/windowmanager/intern/wm_init_exit.cc b/source/blender/windowmanager/intern/wm_init_exit.cc index ed5646d09e2..30f10730f15 100644 --- a/source/blender/windowmanager/intern/wm_init_exit.cc +++ b/source/blender/windowmanager/intern/wm_init_exit.cc @@ -71,6 +71,7 @@ #include "RNA_define.hh" #include "WM_api.hh" +#include "WM_keymap.hh" #include "WM_message.hh" #include "WM_types.hh" @@ -102,7 +103,6 @@ #include "UI_resources.hh" #include "UI_string_search.hh" -#include "GPU_compilation_subprocess.hh" #include "GPU_context.hh" #include "GPU_init_exit.hh" #include "GPU_material.hh" diff --git a/source/blender/windowmanager/intern/wm_jobs.cc b/source/blender/windowmanager/intern/wm_jobs.cc index 1f98bf4f538..3d5bf00b608 100644 --- a/source/blender/windowmanager/intern/wm_jobs.cc +++ b/source/blender/windowmanager/intern/wm_jobs.cc @@ -14,7 +14,7 @@ #include "MEM_guardedalloc.h" -#include "BLI_blenlib.h" +#include "BLI_string.h" #include "BLI_threads.h" #include "BLI_time.h" #include "BLI_utildefines.h" @@ -268,7 +268,7 @@ static void wm_jobs_update_progress_bars(wmWindowManager *wm) /* If there are running jobs, set the global progress indicator. */ if (jobs_progress > 0) { - float progress = total_progress / float(jobs_progress); + float progress = total_progress / jobs_progress; LISTBASE_FOREACH (wmWindow *, win, &wm->windows) { WM_progress_set(win, progress); diff --git a/source/blender/windowmanager/intern/wm_keymap.cc b/source/blender/windowmanager/intern/wm_keymap.cc index 6ee93d3b246..5e7da7a9e74 100644 --- a/source/blender/windowmanager/intern/wm_keymap.cc +++ b/source/blender/windowmanager/intern/wm_keymap.cc @@ -20,7 +20,8 @@ #include "CLG_log.h" #include "MEM_guardedalloc.h" -#include "BLI_blenlib.h" +#include "BLI_string.h" +#include "BLI_string_utf8.h" #include "BLI_utildefines.h" #include "BLF_api.hh" @@ -40,6 +41,7 @@ #include "RNA_enum_types.hh" #include "WM_api.hh" +#include "WM_keymap.hh" #include "WM_types.hh" #include "wm_event_system.hh" #include "wm_event_types.hh" diff --git a/source/blender/windowmanager/intern/wm_keymap_utils.cc b/source/blender/windowmanager/intern/wm_keymap_utils.cc index a7dabbb8ad6..3970d91ea86 100644 --- a/source/blender/windowmanager/intern/wm_keymap_utils.cc +++ b/source/blender/windowmanager/intern/wm_keymap_utils.cc @@ -21,6 +21,7 @@ #include "RNA_access.hh" #include "WM_api.hh" +#include "WM_keymap.hh" #include "WM_types.hh" /* Menu wrapper for #WM_keymap_add_item. */ diff --git a/source/blender/windowmanager/intern/wm_menu_type.cc b/source/blender/windowmanager/intern/wm_menu_type.cc index 7330b48569b..3cbce121d5c 100644 --- a/source/blender/windowmanager/intern/wm_menu_type.cc +++ b/source/blender/windowmanager/intern/wm_menu_type.cc @@ -10,8 +10,6 @@ #include -#include "BLI_sys_types.h" - #include "DNA_windowmanager_types.h" #include "MEM_guardedalloc.h" diff --git a/source/blender/windowmanager/intern/wm_operator_props.cc b/source/blender/windowmanager/intern/wm_operator_props.cc index d683f5caf82..4ce21fd507d 100644 --- a/source/blender/windowmanager/intern/wm_operator_props.cc +++ b/source/blender/windowmanager/intern/wm_operator_props.cc @@ -15,7 +15,6 @@ #include "BKE_lib_id.hh" #include "BKE_main.hh" -#include "BLI_bounds.hh" #include "BLI_math_base.h" #include "BLI_rect.h" diff --git a/source/blender/windowmanager/intern/wm_operator_type.cc b/source/blender/windowmanager/intern/wm_operator_type.cc index 2aab2987277..2b788078172 100644 --- a/source/blender/windowmanager/intern/wm_operator_type.cc +++ b/source/blender/windowmanager/intern/wm_operator_type.cc @@ -17,7 +17,7 @@ #include "BLT_translation.hh" -#include "BLI_blenlib.h" +#include "BLI_string.h" #include "BLI_vector_set.hh" #include "BKE_context.hh" @@ -33,6 +33,7 @@ #endif #include "WM_api.hh" +#include "WM_keymap.hh" #include "WM_types.hh" #include "wm.hh" diff --git a/source/blender/windowmanager/intern/wm_operator_utils.cc b/source/blender/windowmanager/intern/wm_operator_utils.cc index 09cd123923c..70f1b1d391b 100644 --- a/source/blender/windowmanager/intern/wm_operator_utils.cc +++ b/source/blender/windowmanager/intern/wm_operator_utils.cc @@ -128,7 +128,7 @@ static bool interactive_value_update(ValueInteraction *inter, value_scale; if (event->modifier & KM_CTRL) { const double snap = 0.1; - value_delta = float(roundf(double(value_delta) / snap)) * snap; + value_delta = roundf(double(value_delta) / snap) * snap; } if (event->modifier & KM_SHIFT) { value_delta *= 0.1f; diff --git a/source/blender/windowmanager/intern/wm_operators.cc b/source/blender/windowmanager/intern/wm_operators.cc index f121c9f34b3..e21c08d5d29 100644 --- a/source/blender/windowmanager/intern/wm_operators.cc +++ b/source/blender/windowmanager/intern/wm_operators.cc @@ -39,10 +39,12 @@ #include "BLT_translation.hh" -#include "BLI_blenlib.h" #include "BLI_dial_2d.h" #include "BLI_math_rotation.h" #include "BLI_math_vector_types.hh" +#include "BLI_path_utils.hh" +#include "BLI_string.h" +#include "BLI_string_utf8.h" #include "BLI_time.h" #include "BLI_utildefines.h" @@ -95,6 +97,7 @@ #include "UI_resources.hh" #include "WM_api.hh" +#include "WM_keymap.hh" #include "WM_types.hh" #include "wm.hh" @@ -146,7 +149,7 @@ size_t WM_operator_py_idname(char *dst, const char *src) size_t WM_operator_bl_idname(char *dst, const char *src) { - const size_t from_len = size_t(strlen(src)); + const size_t from_len = strlen(src); const char *sep = strchr(src, OP_PY_SEP_CHAR); if (sep && (from_len <= OP_MAX_PY_IDNAME)) { @@ -2474,7 +2477,7 @@ bool WM_paint_cursor_end(wmPaintCursor *handle) { wmWindowManager *wm = static_cast(G_MAIN->wm.first); LISTBASE_FOREACH (wmPaintCursor *, pc, &wm->paintcursors) { - if (pc == (wmPaintCursor *)handle) { + if (pc == handle) { BLI_remlink(&wm->paintcursors, pc); MEM_freeN(pc); return true; diff --git a/source/blender/windowmanager/intern/wm_platform_support.cc b/source/blender/windowmanager/intern/wm_platform_support.cc index 260eab61c77..c30cfb56807 100644 --- a/source/blender/windowmanager/intern/wm_platform_support.cc +++ b/source/blender/windowmanager/intern/wm_platform_support.cc @@ -21,6 +21,7 @@ #include "BKE_appdir.hh" #include "BKE_global.hh" +#include "GPU_context.hh" #include "GPU_platform.hh" #define WM_PLATFORM_SUPPORT_TEXT_SIZE 1024 diff --git a/source/blender/windowmanager/intern/wm_platform_support.hh b/source/blender/windowmanager/intern/wm_platform_support.hh index 8a8a3e38e53..0ed10ce42bc 100644 --- a/source/blender/windowmanager/intern/wm_platform_support.hh +++ b/source/blender/windowmanager/intern/wm_platform_support.hh @@ -7,6 +7,4 @@ */ #pragma once -#include "BLI_sys_types.h" - bool WM_platform_support_perform_checks(); diff --git a/source/blender/windowmanager/intern/wm_playanim.cc b/source/blender/windowmanager/intern/wm_playanim.cc index 53fb92b22fa..3a8ca3cd1db 100644 --- a/source/blender/windowmanager/intern/wm_playanim.cc +++ b/source/blender/windowmanager/intern/wm_playanim.cc @@ -12,6 +12,7 @@ * this could be made into its own module, alongside creator. */ +#include #include #include #include @@ -1976,9 +1977,7 @@ static bool wm_main_playanim_intern(int argc, const char **argv, PlayArgs *args_ ps.picture = ps.picture->prev; } } - if (g_playanim.total_time > 0.0) { - g_playanim.total_time = 0.0; - } + g_playanim.total_time = std::min(g_playanim.total_time, 0.0); #ifdef WITH_AUDASPACE if (g_audaspace.playback_handle) { diff --git a/source/blender/windowmanager/intern/wm_splash_screen.cc b/source/blender/windowmanager/intern/wm_splash_screen.cc index 7d70eb4626d..8bcc97f6fa4 100644 --- a/source/blender/windowmanager/intern/wm_splash_screen.cc +++ b/source/blender/windowmanager/intern/wm_splash_screen.cc @@ -20,7 +20,7 @@ #include "DNA_userdef_types.h" #include "DNA_windowmanager_types.h" -#include "BLI_blenlib.h" +#include "BLI_path_utils.hh" #include "BLI_utildefines.h" #include "BKE_appdir.hh" diff --git a/source/blender/windowmanager/intern/wm_subwindow.cc b/source/blender/windowmanager/intern/wm_subwindow.cc index 3754416f104..f841436a844 100644 --- a/source/blender/windowmanager/intern/wm_subwindow.cc +++ b/source/blender/windowmanager/intern/wm_subwindow.cc @@ -9,13 +9,13 @@ */ #include "BLI_math_geom.h" -#include "BLI_math_vector.h" #include "BLI_rect.h" #include "DNA_screen_types.h" #include "DNA_windowmanager_types.h" #include "GPU_matrix.hh" +#include "GPU_state.hh" #include "GPU_viewport.hh" #include "WM_api.hh" diff --git a/source/blender/windowmanager/intern/wm_surface.cc b/source/blender/windowmanager/intern/wm_surface.cc index 2018d7d7328..699fd8b659e 100644 --- a/source/blender/windowmanager/intern/wm_surface.cc +++ b/source/blender/windowmanager/intern/wm_surface.cc @@ -11,8 +11,6 @@ # include "BLI_threads.h" #endif -#include "GHOST_C-api.h" - #include "GPU_context.hh" #include "GPU_framebuffer.hh" diff --git a/source/blender/windowmanager/intern/wm_window.cc b/source/blender/windowmanager/intern/wm_window.cc index 0809922aeca..4eea6101f31 100644 --- a/source/blender/windowmanager/intern/wm_window.cc +++ b/source/blender/windowmanager/intern/wm_window.cc @@ -8,6 +8,7 @@ * Window management, wrap GHOST. */ +#include #include #include #include @@ -28,7 +29,11 @@ #include "GHOST_C-api.h" -#include "BLI_blenlib.h" +#include "BLI_math_vector.h" +#include "BLI_path_utils.hh" +#include "BLI_rect.h" +#include "BLI_string.h" +#include "BLI_string_utf8.h" #include "BLI_system.h" #include "BLI_time.h" #include "BLI_utildefines.h" @@ -49,6 +54,7 @@ #include "RNA_enum_types.hh" #include "WM_api.hh" +#include "WM_keymap.hh" #include "WM_types.hh" #include "wm.hh" #include "wm_draw.hh" @@ -577,7 +583,7 @@ void WM_window_set_dpi(const wmWindow *win) U.dpi = auto_dpi * U.ui_scale * (72.0 / 96.0f); /* Automatically set larger pixel size for high DPI. */ - int pixelsize = max_ii(1, int(U.dpi / 64)); + int pixelsize = max_ii(1, (U.dpi / 64)); /* User adjustment for pixel size. */ pixelsize = max_ii(1, pixelsize + U.ui_line_width); @@ -1760,9 +1766,7 @@ static bool wm_window_timers_process(const bContext *C, int *sleep_us_p) if (wt->time_next >= time) { if ((has_event == false) && (sleep_us != 0)) { /* The timer is not ready to run but may run shortly. */ - if (wt->time_next < ntime_min) { - ntime_min = wt->time_next; - } + ntime_min = std::min(wt->time_next, ntime_min); } continue; } diff --git a/source/blender/windowmanager/intern/wm_window_private.hh b/source/blender/windowmanager/intern/wm_window_private.hh index 0a277ec76bf..6c34101d18a 100644 --- a/source/blender/windowmanager/intern/wm_window_private.hh +++ b/source/blender/windowmanager/intern/wm_window_private.hh @@ -7,11 +7,9 @@ */ #pragma once -#include "BLI_sys_types.h" - #include "GHOST_Types.h" -#include "GPU_context.hh" +#include "GPU_platform_backend_enum.h" struct bContext; diff --git a/source/blender/windowmanager/xr/intern/wm_xr_draw.cc b/source/blender/windowmanager/xr/intern/wm_xr_draw.cc index 0a0df2c530a..a742eafdcd2 100644 --- a/source/blender/windowmanager/xr/intern/wm_xr_draw.cc +++ b/source/blender/windowmanager/xr/intern/wm_xr_draw.cc @@ -13,6 +13,7 @@ #include #include "BLI_listbase.h" +#include "BLI_math_geom.h" #include "BLI_math_matrix.h" #include "BLI_math_rotation.h" #include "BLI_math_vector.h" @@ -20,10 +21,11 @@ #include "ED_view3d_offscreen.hh" #include "GHOST_C-api.h" + #include "GPU_batch_presets.hh" #include "GPU_immediate.hh" #include "GPU_matrix.hh" - +#include "GPU_state.hh" #include "GPU_viewport.hh" #include "WM_api.hh" diff --git a/source/blender/windowmanager/xr/intern/wm_xr_operators.cc b/source/blender/windowmanager/xr/intern/wm_xr_operators.cc index 088440a3652..1a7bf260524 100644 --- a/source/blender/windowmanager/xr/intern/wm_xr_operators.cc +++ b/source/blender/windowmanager/xr/intern/wm_xr_operators.cc @@ -35,6 +35,7 @@ #include "GHOST_Types.h" #include "GPU_immediate.hh" +#include "GPU_state.hh" #include "MEM_guardedalloc.h"