From 86cb184eb4401b2cd77fa2404cac8dcec6b9a7cf Mon Sep 17 00:00:00 2001 From: Rubidium Date: Wed, 17 Jan 2024 04:17:02 +0100 Subject: [PATCH] Codechange: use std::source_location over __FILE__ and __LINE__ for WindowDesc --- src/ai/ai_gui.cpp | 2 +- src/airport_gui.cpp | 4 ++-- src/autoreplace_gui.cpp | 6 +++--- src/bootstrap_gui.cpp | 8 ++++---- src/bridge_gui.cpp | 2 +- src/build_vehicle_gui.cpp | 2 +- src/cheat_gui.cpp | 2 +- src/company_gui.cpp | 12 ++++++------ src/console_gui.cpp | 2 +- src/date_gui.cpp | 2 +- src/depot_gui.cpp | 8 ++++---- src/dock_gui.cpp | 8 ++++---- src/engine_gui.cpp | 2 +- src/error_gui.cpp | 4 ++-- src/fios_gui.cpp | 6 +++--- src/framerate_gui.cpp | 4 ++-- src/game/game_gui.cpp | 2 +- src/genworld_gui.cpp | 8 ++++---- src/goal_gui.cpp | 6 +----- src/graph_gui.cpp | 16 ++++++++-------- src/group_gui.cpp | 4 ++-- src/help_gui.cpp | 2 +- src/highscore_gui.cpp | 4 ++-- src/industry_gui.cpp | 8 ++++---- src/intro_gui.cpp | 2 +- src/league_gui.cpp | 4 ++-- src/linkgraph/linkgraph_gui.cpp | 2 +- src/main_gui.cpp | 2 +- src/misc_gui.cpp | 10 +++++----- src/music_gui.cpp | 4 ++-- src/network/network_chat_gui.cpp | 2 +- src/network/network_content_gui.cpp | 4 ++-- src/network/network_gui.cpp | 14 +++++++------- src/newgrf_debug_gui.cpp | 6 +++--- src/newgrf_gui.cpp | 8 ++++---- src/news_gui.cpp | 12 ++++++------ src/object_gui.cpp | 2 +- src/order_gui.cpp | 6 +++--- src/osk_gui.cpp | 2 +- src/rail_gui.cpp | 10 +++++----- src/road_gui.cpp | 14 +++++++------- src/screenshot_gui.cpp | 2 +- src/script/script_gui.cpp | 6 +++--- src/settings_gui.cpp | 6 +++--- src/signs_gui.cpp | 4 ++-- src/smallmap_gui.cpp | 2 +- src/station_gui.cpp | 6 +++--- src/statusbar_gui.cpp | 2 +- src/story_gui.cpp | 4 ++-- src/subsidy_gui.cpp | 2 +- src/terraform_gui.cpp | 4 ++-- src/tests/test_window_desc.cpp | 6 +++--- src/textfile_gui.cpp | 2 +- src/timetable_gui.cpp | 2 +- src/toolbar_gui.cpp | 4 ++-- src/town_gui.cpp | 10 +++++----- src/transparency_gui.cpp | 2 +- src/tree_gui.cpp | 2 +- src/vehicle_gui.cpp | 14 +++++++------- src/viewport_gui.cpp | 2 +- src/waypoint_gui.cpp | 2 +- src/widgets/dropdown.cpp | 2 +- src/window.cpp | 8 ++++---- src/window_gui.h | 13 +++++++------ 64 files changed, 166 insertions(+), 169 deletions(-) diff --git a/src/ai/ai_gui.cpp b/src/ai/ai_gui.cpp index 0cd83ea8b3..68c0e3d2e5 100644 --- a/src/ai/ai_gui.cpp +++ b/src/ai/ai_gui.cpp @@ -82,7 +82,7 @@ static constexpr NWidgetPart _nested_ai_config_widgets[] = { }; /** Window definition for the configure AI window. */ -static WindowDesc _ai_config_desc(__FILE__, __LINE__, +static WindowDesc _ai_config_desc( WDP_CENTER, nullptr, 0, 0, WC_GAME_OPTIONS, WC_NONE, 0, diff --git a/src/airport_gui.cpp b/src/airport_gui.cpp index aa2069c425..ef80d44a9b 100644 --- a/src/airport_gui.cpp +++ b/src/airport_gui.cpp @@ -207,7 +207,7 @@ static constexpr NWidgetPart _nested_air_toolbar_widgets[] = { EndContainer(), }; -static WindowDesc _air_toolbar_desc(__FILE__, __LINE__, +static WindowDesc _air_toolbar_desc( WDP_ALIGN_TOOLBAR, "toolbar_air", 0, 0, WC_BUILD_TOOLBAR, WC_NONE, WDF_CONSTRUCTION, @@ -618,7 +618,7 @@ static constexpr NWidgetPart _nested_build_airport_widgets[] = { EndContainer(), }; -static WindowDesc _build_airport_desc(__FILE__, __LINE__, +static WindowDesc _build_airport_desc( WDP_AUTO, nullptr, 0, 0, WC_BUILD_STATION, WC_BUILD_TOOLBAR, WDF_CONSTRUCTION, diff --git a/src/autoreplace_gui.cpp b/src/autoreplace_gui.cpp index 5072dbb4ae..c494f24126 100644 --- a/src/autoreplace_gui.cpp +++ b/src/autoreplace_gui.cpp @@ -787,7 +787,7 @@ static constexpr NWidgetPart _nested_replace_rail_vehicle_widgets[] = { EndContainer(), }; -static WindowDesc _replace_rail_vehicle_desc(__FILE__, __LINE__, +static WindowDesc _replace_rail_vehicle_desc( WDP_AUTO, "replace_vehicle_train", 500, 140, WC_REPLACE_VEHICLE, WC_NONE, WDF_CONSTRUCTION, @@ -845,7 +845,7 @@ static constexpr NWidgetPart _nested_replace_road_vehicle_widgets[] = { EndContainer(), }; -static WindowDesc _replace_road_vehicle_desc(__FILE__, __LINE__, +static WindowDesc _replace_road_vehicle_desc( WDP_AUTO, "replace_vehicle_road", 500, 140, WC_REPLACE_VEHICLE, WC_NONE, WDF_CONSTRUCTION, @@ -899,7 +899,7 @@ static constexpr NWidgetPart _nested_replace_vehicle_widgets[] = { EndContainer(), }; -static WindowDesc _replace_vehicle_desc(__FILE__, __LINE__, +static WindowDesc _replace_vehicle_desc( WDP_AUTO, "replace_vehicle", 456, 118, WC_REPLACE_VEHICLE, WC_NONE, WDF_CONSTRUCTION, diff --git a/src/bootstrap_gui.cpp b/src/bootstrap_gui.cpp index 657c4faa17..3487998615 100644 --- a/src/bootstrap_gui.cpp +++ b/src/bootstrap_gui.cpp @@ -40,7 +40,7 @@ static constexpr NWidgetPart _background_widgets[] = { /** * Window description for the background window to prevent smearing. */ -static WindowDesc _background_desc(__FILE__, __LINE__, +static WindowDesc _background_desc( WDP_MANUAL, nullptr, 0, 0, WC_BOOTSTRAP, WC_NONE, WDF_NO_CLOSE, @@ -76,7 +76,7 @@ static constexpr NWidgetPart _nested_bootstrap_errmsg_widgets[] = { }; /** Window description for the error window. */ -static WindowDesc _bootstrap_errmsg_desc(__FILE__, __LINE__, +static WindowDesc _bootstrap_errmsg_desc( WDP_CENTER, nullptr, 0, 0, WC_BOOTSTRAP, WC_NONE, WDF_MODAL | WDF_NO_CLOSE, @@ -133,7 +133,7 @@ static constexpr NWidgetPart _nested_bootstrap_download_status_window_widgets[] }; /** Window description for the download window */ -static WindowDesc _bootstrap_download_status_window_desc(__FILE__, __LINE__, +static WindowDesc _bootstrap_download_status_window_desc( WDP_CENTER, nullptr, 0, 0, WC_NETWORK_STATUS_WINDOW, WC_NONE, WDF_MODAL | WDF_NO_CLOSE, @@ -185,7 +185,7 @@ static constexpr NWidgetPart _bootstrap_query_widgets[] = { }; /** The window description for the query. */ -static WindowDesc _bootstrap_query_desc(__FILE__, __LINE__, +static WindowDesc _bootstrap_query_desc( WDP_CENTER, nullptr, 0, 0, WC_CONFIRM_POPUP_QUERY, WC_NONE, WDF_NO_CLOSE, diff --git a/src/bridge_gui.cpp b/src/bridge_gui.cpp index 15eea9a0d0..90aa8580d7 100644 --- a/src/bridge_gui.cpp +++ b/src/bridge_gui.cpp @@ -341,7 +341,7 @@ static constexpr NWidgetPart _nested_build_bridge_widgets[] = { }; /** Window definition for the rail bridge selection window. */ -static WindowDesc _build_bridge_desc(__FILE__, __LINE__, +static WindowDesc _build_bridge_desc( WDP_AUTO, "build_bridge", 200, 114, WC_BUILD_BRIDGE, WC_BUILD_TOOLBAR, WDF_CONSTRUCTION, diff --git a/src/build_vehicle_gui.cpp b/src/build_vehicle_gui.cpp index 11211a2ae9..7d07f65882 100644 --- a/src/build_vehicle_gui.cpp +++ b/src/build_vehicle_gui.cpp @@ -1896,7 +1896,7 @@ struct BuildVehicleWindow : Window { }}; }; -static WindowDesc _build_vehicle_desc(__FILE__, __LINE__, +static WindowDesc _build_vehicle_desc( WDP_AUTO, "build_vehicle", 240, 268, WC_BUILD_VEHICLE, WC_NONE, WDF_CONSTRUCTION, diff --git a/src/cheat_gui.cpp b/src/cheat_gui.cpp index 0a1f7fbeee..394e7c5223 100644 --- a/src/cheat_gui.cpp +++ b/src/cheat_gui.cpp @@ -426,7 +426,7 @@ struct CheatWindow : Window { }; /** Window description of the cheats GUI. */ -static WindowDesc _cheats_desc(__FILE__, __LINE__, +static WindowDesc _cheats_desc( WDP_AUTO, "cheats", 0, 0, WC_CHEATS, WC_NONE, 0, diff --git a/src/company_gui.cpp b/src/company_gui.cpp index f15e66ce7c..9c05f513b8 100644 --- a/src/company_gui.cpp +++ b/src/company_gui.cpp @@ -529,7 +529,7 @@ struct CompanyFinancesWindow : Window { /** First conservative estimate of the maximum amount of money */ Money CompanyFinancesWindow::max_money = INT32_MAX; -static WindowDesc _company_finances_desc(__FILE__, __LINE__, +static WindowDesc _company_finances_desc( WDP_AUTO, "company_finances", 0, 0, WC_FINANCES, WC_NONE, 0, @@ -1139,7 +1139,7 @@ static constexpr NWidgetPart _nested_select_company_livery_widgets[] = { EndContainer(), }; -static WindowDesc _select_company_livery_desc(__FILE__, __LINE__, +static WindowDesc _select_company_livery_desc( WDP_AUTO, "company_color_scheme", 0, 0, WC_COMPANY_COLOUR, WC_NONE, 0, @@ -1764,7 +1764,7 @@ public: }; /** Company manager face selection window description */ -static WindowDesc _select_company_manager_face_desc(__FILE__, __LINE__, +static WindowDesc _select_company_manager_face_desc( WDP_AUTO, nullptr, 0, 0, WC_COMPANY_MANAGER_FACE, WC_NONE, WDF_CONSTRUCTION, @@ -2141,7 +2141,7 @@ struct CompanyInfrastructureWindow : Window } }; -static WindowDesc _company_infrastructure_desc(__FILE__, __LINE__, +static WindowDesc _company_infrastructure_desc( WDP_AUTO, "company_infrastructure", 0, 0, WC_COMPANY_INFRASTRUCTURE, WC_NONE, 0, @@ -2629,7 +2629,7 @@ struct CompanyWindow : Window } }; -static WindowDesc _company_desc(__FILE__, __LINE__, +static WindowDesc _company_desc( WDP_AUTO, "company", 0, 0, WC_COMPANY, WC_NONE, 0, @@ -2763,7 +2763,7 @@ static constexpr NWidgetPart _nested_buy_company_widgets[] = { EndContainer(), }; -static WindowDesc _buy_company_desc(__FILE__, __LINE__, +static WindowDesc _buy_company_desc( WDP_AUTO, nullptr, 0, 0, WC_BUY_COMPANY, WC_NONE, WDF_CONSTRUCTION, diff --git a/src/console_gui.cpp b/src/console_gui.cpp index 4d4d642976..2fd8b221ef 100644 --- a/src/console_gui.cpp +++ b/src/console_gui.cpp @@ -102,7 +102,7 @@ static constexpr NWidgetPart _nested_console_window_widgets[] = { NWidget(WWT_EMPTY, INVALID_COLOUR, WID_C_BACKGROUND), SetResize(1, 1), }; -static WindowDesc _console_window_desc(__FILE__, __LINE__, +static WindowDesc _console_window_desc( WDP_MANUAL, nullptr, 0, 0, WC_CONSOLE, WC_NONE, 0, diff --git a/src/date_gui.cpp b/src/date_gui.cpp index abbe8ad784..20a6718aeb 100644 --- a/src/date_gui.cpp +++ b/src/date_gui.cpp @@ -195,7 +195,7 @@ static constexpr NWidgetPart _nested_set_date_widgets[] = { }; /** Description of the date setting window. */ -static WindowDesc _set_date_desc(__FILE__, __LINE__, +static WindowDesc _set_date_desc( WDP_CENTER, nullptr, 0, 0, WC_SET_DATE, WC_NONE, 0, diff --git a/src/depot_gui.cpp b/src/depot_gui.cpp index c96ae80748..a630bf26e4 100644 --- a/src/depot_gui.cpp +++ b/src/depot_gui.cpp @@ -85,28 +85,28 @@ static constexpr NWidgetPart _nested_train_depot_widgets[] = { EndContainer(), }; -static WindowDesc _train_depot_desc(__FILE__, __LINE__, +static WindowDesc _train_depot_desc( WDP_AUTO, "depot_train", 362, 123, WC_VEHICLE_DEPOT, WC_NONE, 0, std::begin(_nested_train_depot_widgets), std::end(_nested_train_depot_widgets) ); -static WindowDesc _road_depot_desc(__FILE__, __LINE__, +static WindowDesc _road_depot_desc( WDP_AUTO, "depot_roadveh", 316, 97, WC_VEHICLE_DEPOT, WC_NONE, 0, std::begin(_nested_train_depot_widgets), std::end(_nested_train_depot_widgets) ); -static WindowDesc _ship_depot_desc(__FILE__, __LINE__, +static WindowDesc _ship_depot_desc( WDP_AUTO, "depot_ship", 306, 99, WC_VEHICLE_DEPOT, WC_NONE, 0, std::begin(_nested_train_depot_widgets), std::end(_nested_train_depot_widgets) ); -static WindowDesc _aircraft_depot_desc(__FILE__, __LINE__, +static WindowDesc _aircraft_depot_desc( WDP_AUTO, "depot_aircraft", 332, 99, WC_VEHICLE_DEPOT, WC_NONE, 0, diff --git a/src/dock_gui.cpp b/src/dock_gui.cpp index f43c1ae7ba..39518a2303 100644 --- a/src/dock_gui.cpp +++ b/src/dock_gui.cpp @@ -344,7 +344,7 @@ static constexpr NWidgetPart _nested_build_docks_toolbar_widgets[] = { EndContainer(), }; -static WindowDesc _build_docks_toolbar_desc(__FILE__, __LINE__, +static WindowDesc _build_docks_toolbar_desc( WDP_ALIGN_TOOLBAR, "toolbar_water", 0, 0, WC_BUILD_TOOLBAR, WC_NONE, WDF_CONSTRUCTION, @@ -388,7 +388,7 @@ static constexpr NWidgetPart _nested_build_docks_scen_toolbar_widgets[] = { }; /** Window definition for the build docks in scenario editor window. */ -static WindowDesc _build_docks_scen_toolbar_desc(__FILE__, __LINE__, +static WindowDesc _build_docks_scen_toolbar_desc( WDP_AUTO, "toolbar_water_scen", 0, 0, WC_SCEN_BUILD_TOOLBAR, WC_NONE, WDF_CONSTRUCTION, @@ -498,7 +498,7 @@ static constexpr NWidgetPart _nested_build_dock_station_widgets[] = { EndContainer(), }; -static WindowDesc _build_dock_station_desc(__FILE__, __LINE__, +static WindowDesc _build_dock_station_desc( WDP_AUTO, nullptr, 0, 0, WC_BUILD_STATION, WC_BUILD_TOOLBAR, WDF_CONSTRUCTION, @@ -593,7 +593,7 @@ static constexpr NWidgetPart _nested_build_docks_depot_widgets[] = { EndContainer(), }; -static WindowDesc _build_docks_depot_desc(__FILE__, __LINE__, +static WindowDesc _build_docks_depot_desc( WDP_AUTO, nullptr, 0, 0, WC_BUILD_DEPOT, WC_BUILD_TOOLBAR, WDF_CONSTRUCTION, diff --git a/src/engine_gui.cpp b/src/engine_gui.cpp index 4742e6e234..a6423be3a7 100644 --- a/src/engine_gui.cpp +++ b/src/engine_gui.cpp @@ -144,7 +144,7 @@ struct EnginePreviewWindow : Window { } }; -static WindowDesc _engine_preview_desc(__FILE__, __LINE__, +static WindowDesc _engine_preview_desc( WDP_CENTER, nullptr, 0, 0, WC_ENGINE_PREVIEW, WC_NONE, WDF_CONSTRUCTION, diff --git a/src/error_gui.cpp b/src/error_gui.cpp index b1cb2b0fe9..812e04cefa 100644 --- a/src/error_gui.cpp +++ b/src/error_gui.cpp @@ -43,7 +43,7 @@ static constexpr NWidgetPart _nested_errmsg_widgets[] = { EndContainer(), }; -static WindowDesc _errmsg_desc(__FILE__, __LINE__, +static WindowDesc _errmsg_desc( WDP_MANUAL, nullptr, 0, 0, WC_ERRMSG, WC_NONE, 0, @@ -63,7 +63,7 @@ static constexpr NWidgetPart _nested_errmsg_face_widgets[] = { EndContainer(), }; -static WindowDesc _errmsg_face_desc(__FILE__, __LINE__, +static WindowDesc _errmsg_face_desc( WDP_MANUAL, nullptr, 0, 0, WC_ERRMSG, WC_NONE, 0, diff --git a/src/fios_gui.cpp b/src/fios_gui.cpp index a6ec99bf81..f02b1b8edd 100644 --- a/src/fios_gui.cpp +++ b/src/fios_gui.cpp @@ -883,7 +883,7 @@ public: }; /** Load game/scenario */ -static WindowDesc _load_dialog_desc(__FILE__, __LINE__, +static WindowDesc _load_dialog_desc( WDP_CENTER, "load_game", 500, 294, WC_SAVELOAD, WC_NONE, 0, @@ -891,7 +891,7 @@ static WindowDesc _load_dialog_desc(__FILE__, __LINE__, ); /** Load heightmap */ -static WindowDesc _load_heightmap_dialog_desc(__FILE__, __LINE__, +static WindowDesc _load_heightmap_dialog_desc( WDP_CENTER, "load_heightmap", 257, 320, WC_SAVELOAD, WC_NONE, 0, @@ -899,7 +899,7 @@ static WindowDesc _load_heightmap_dialog_desc(__FILE__, __LINE__, ); /** Save game/scenario */ -static WindowDesc _save_dialog_desc(__FILE__, __LINE__, +static WindowDesc _save_dialog_desc( WDP_CENTER, "save_game", 500, 294, WC_SAVELOAD, WC_NONE, 0, diff --git a/src/framerate_gui.cpp b/src/framerate_gui.cpp index 114d5c2d89..6ffacd73bd 100644 --- a/src/framerate_gui.cpp +++ b/src/framerate_gui.cpp @@ -726,7 +726,7 @@ struct FramerateWindow : Window { } }; -static WindowDesc _framerate_display_desc(__FILE__, __LINE__, +static WindowDesc _framerate_display_desc( WDP_AUTO, "framerate_display", 0, 0, WC_FRAMERATE_DISPLAY, WC_NONE, 0, @@ -1017,7 +1017,7 @@ struct FrametimeGraphWindow : Window { } }; -static WindowDesc _frametime_graph_window_desc(__FILE__, __LINE__, +static WindowDesc _frametime_graph_window_desc( WDP_AUTO, "frametime_graph", 140, 90, WC_FRAMETIME_GRAPH, WC_NONE, 0, diff --git a/src/game/game_gui.cpp b/src/game/game_gui.cpp index a63100edb6..22f94ef055 100644 --- a/src/game/game_gui.cpp +++ b/src/game/game_gui.cpp @@ -73,7 +73,7 @@ static constexpr NWidgetPart _nested_gs_config_widgets[] = { }; /** Window definition for the configure GS window. */ -static WindowDesc _gs_config_desc(__FILE__, __LINE__, +static WindowDesc _gs_config_desc( WDP_CENTER, "settings_gs_config", 500, 350, WC_GAME_OPTIONS, WC_NONE, 0, diff --git a/src/genworld_gui.cpp b/src/genworld_gui.cpp index c895640756..6f5876a00b 100644 --- a/src/genworld_gui.cpp +++ b/src/genworld_gui.cpp @@ -1003,14 +1003,14 @@ struct GenerateLandscapeWindow : public Window { } }; -static WindowDesc _generate_landscape_desc(__FILE__, __LINE__, +static WindowDesc _generate_landscape_desc( WDP_CENTER, nullptr, 0, 0, WC_GENERATE_LANDSCAPE, WC_NONE, 0, std::begin(_nested_generate_landscape_widgets), std::end(_nested_generate_landscape_widgets) ); -static WindowDesc _heightmap_load_desc(__FILE__, __LINE__, +static WindowDesc _heightmap_load_desc( WDP_CENTER, nullptr, 0, 0, WC_GENERATE_LANDSCAPE, WC_NONE, 0, @@ -1313,7 +1313,7 @@ static constexpr NWidgetPart _nested_create_scenario_widgets[] = { EndContainer(), }; -static WindowDesc _create_scenario_desc(__FILE__, __LINE__, +static WindowDesc _create_scenario_desc( WDP_CENTER, nullptr, 0, 0, WC_GENERATE_LANDSCAPE, WC_NONE, 0, @@ -1339,7 +1339,7 @@ static constexpr NWidgetPart _nested_generate_progress_widgets[] = { }; -static WindowDesc _generate_progress_desc(__FILE__, __LINE__, +static WindowDesc _generate_progress_desc( WDP_CENTER, nullptr, 0, 0, WC_MODAL_PROGRESS, WC_NONE, 0, diff --git a/src/goal_gui.cpp b/src/goal_gui.cpp index d8be74d358..4e2334b9ef 100644 --- a/src/goal_gui.cpp +++ b/src/goal_gui.cpp @@ -302,7 +302,7 @@ static constexpr NWidgetPart _nested_goals_list_widgets[] = { EndContainer(), }; -static WindowDesc _goals_list_desc(__FILE__, __LINE__, +static WindowDesc _goals_list_desc( WDP_AUTO, "list_goals", 500, 127, WC_GOALS_LIST, WC_NONE, 0, @@ -447,28 +447,24 @@ static constexpr auto _nested_goal_question_widgets_error = NestedGoalWidgets static WindowDesc _goal_question_list_desc[] = { { - __FILE__, __LINE__, WDP_CENTER, nullptr, 0, 0, WC_GOAL_QUESTION, WC_NONE, WDF_CONSTRUCTION, std::begin(_nested_goal_question_widgets_question), std::end(_nested_goal_question_widgets_question), }, { - __FILE__, __LINE__, WDP_CENTER, nullptr, 0, 0, WC_GOAL_QUESTION, WC_NONE, WDF_CONSTRUCTION, std::begin(_nested_goal_question_widgets_info), std::end(_nested_goal_question_widgets_info), }, { - __FILE__, __LINE__, WDP_CENTER, nullptr, 0, 0, WC_GOAL_QUESTION, WC_NONE, WDF_CONSTRUCTION, std::begin(_nested_goal_question_widgets_warning), std::end(_nested_goal_question_widgets_warning), }, { - __FILE__, __LINE__, WDP_CENTER, nullptr, 0, 0, WC_GOAL_QUESTION, WC_NONE, WDF_CONSTRUCTION, diff --git a/src/graph_gui.cpp b/src/graph_gui.cpp index d1112c5eea..345a6af3fb 100644 --- a/src/graph_gui.cpp +++ b/src/graph_gui.cpp @@ -142,7 +142,7 @@ static constexpr NWidgetPart _nested_graph_legend_widgets[] = { EndContainer(), }; -static WindowDesc _graph_legend_desc(__FILE__, __LINE__, +static WindowDesc _graph_legend_desc( WDP_AUTO, "graph_legend", 0, 0, WC_GRAPH_LEGEND, WC_NONE, 0, @@ -692,7 +692,7 @@ static constexpr NWidgetPart _nested_operating_profit_widgets[] = { EndContainer(), }; -static WindowDesc _operating_profit_desc(__FILE__, __LINE__, +static WindowDesc _operating_profit_desc( WDP_AUTO, "graph_operating_profit", 0, 0, WC_OPERATING_PROFIT, WC_NONE, 0, @@ -751,7 +751,7 @@ static constexpr NWidgetPart _nested_income_graph_widgets[] = { EndContainer(), }; -static WindowDesc _income_graph_desc(__FILE__, __LINE__, +static WindowDesc _income_graph_desc( WDP_AUTO, "graph_income", 0, 0, WC_INCOME_GRAPH, WC_NONE, 0, @@ -808,7 +808,7 @@ static constexpr NWidgetPart _nested_delivered_cargo_graph_widgets[] = { EndContainer(), }; -static WindowDesc _delivered_cargo_graph_desc(__FILE__, __LINE__, +static WindowDesc _delivered_cargo_graph_desc( WDP_AUTO, "graph_delivered_cargo", 0, 0, WC_DELIVERED_CARGO, WC_NONE, 0, @@ -872,7 +872,7 @@ static constexpr NWidgetPart _nested_performance_history_widgets[] = { EndContainer(), }; -static WindowDesc _performance_history_desc(__FILE__, __LINE__, +static WindowDesc _performance_history_desc( WDP_AUTO, "graph_performance", 0, 0, WC_PERFORMANCE_HISTORY, WC_NONE, 0, @@ -929,7 +929,7 @@ static constexpr NWidgetPart _nested_company_value_graph_widgets[] = { EndContainer(), }; -static WindowDesc _company_value_graph_desc(__FILE__, __LINE__, +static WindowDesc _company_value_graph_desc( WDP_AUTO, "graph_company_value", 0, 0, WC_COMPANY_VALUE, WC_NONE, 0, @@ -1167,7 +1167,7 @@ static constexpr NWidgetPart _nested_cargo_payment_rates_widgets[] = { EndContainer(), }; -static WindowDesc _cargo_payment_rates_desc(__FILE__, __LINE__, +static WindowDesc _cargo_payment_rates_desc( WDP_AUTO, "graph_cargo_payment_rates", 0, 0, WC_PAYMENT_RATES, WC_NONE, 0, @@ -1460,7 +1460,7 @@ static constexpr NWidgetPart _nested_performance_rating_detail_widgets[] = { NWidgetFunction(MakePerformanceDetailPanels), }; -static WindowDesc _performance_rating_detail_desc(__FILE__, __LINE__, +static WindowDesc _performance_rating_detail_desc( WDP_AUTO, "league_details", 0, 0, WC_PERFORMANCE_DETAIL, WC_NONE, 0, diff --git a/src/group_gui.cpp b/src/group_gui.cpp index 00520c7ed8..5083da047a 100644 --- a/src/group_gui.cpp +++ b/src/group_gui.cpp @@ -1100,14 +1100,14 @@ public: }; -static WindowDesc _other_group_desc(__FILE__, __LINE__, +static WindowDesc _other_group_desc( WDP_AUTO, "list_groups", 460, 246, WC_INVALID, WC_NONE, 0, std::begin(_nested_group_widgets), std::end(_nested_group_widgets) ); -static WindowDesc _train_group_desc(__FILE__, __LINE__, +static WindowDesc _train_group_desc( WDP_AUTO, "list_groups_train", 525, 246, WC_TRAINS_LIST, WC_NONE, 0, diff --git a/src/help_gui.cpp b/src/help_gui.cpp index 8345430ed8..8012a880a1 100644 --- a/src/help_gui.cpp +++ b/src/help_gui.cpp @@ -193,7 +193,7 @@ static constexpr NWidgetPart _nested_helpwin_widgets[] = { EndContainer(), }; -static WindowDesc _helpwin_desc(__FILE__, __LINE__, +static WindowDesc _helpwin_desc( WDP_CENTER, nullptr, 0, 0, WC_HELPWIN, WC_NONE, 0, diff --git a/src/highscore_gui.cpp b/src/highscore_gui.cpp index 2198b191bc..3cd70d1712 100644 --- a/src/highscore_gui.cpp +++ b/src/highscore_gui.cpp @@ -214,14 +214,14 @@ static constexpr NWidgetPart _nested_highscore_widgets[] = { NWidget(WWT_PANEL, COLOUR_BROWN, WID_H_BACKGROUND), SetResize(1, 1), EndContainer(), }; -static WindowDesc _highscore_desc(__FILE__, __LINE__, +static WindowDesc _highscore_desc( WDP_MANUAL, nullptr, 0, 0, WC_HIGHSCORE, WC_NONE, 0, std::begin(_nested_highscore_widgets), std::end(_nested_highscore_widgets) ); -static WindowDesc _endgame_desc(__FILE__, __LINE__, +static WindowDesc _endgame_desc( WDP_MANUAL, nullptr, 0, 0, WC_ENDSCREEN, WC_NONE, 0, diff --git a/src/industry_gui.cpp b/src/industry_gui.cpp index 097e63cc40..a8e5b3bfee 100644 --- a/src/industry_gui.cpp +++ b/src/industry_gui.cpp @@ -292,7 +292,7 @@ static constexpr NWidgetPart _nested_build_industry_widgets[] = { }; /** Window definition of the dynamic place industries gui */ -static WindowDesc _build_industry_desc(__FILE__, __LINE__, +static WindowDesc _build_industry_desc( WDP_AUTO, "build_industry", 170, 212, WC_BUILD_INDUSTRY, WC_NONE, WDF_CONSTRUCTION, @@ -1216,7 +1216,7 @@ static constexpr NWidgetPart _nested_industry_view_widgets[] = { }; /** Window definition of the view industry gui */ -static WindowDesc _industry_view_desc(__FILE__, __LINE__, +static WindowDesc _industry_view_desc( WDP_AUTO, "view_industry", 260, 120, WC_INDUSTRY_VIEW, WC_NONE, 0, @@ -1920,7 +1920,7 @@ CargoID IndustryDirectoryWindow::produced_cargo_filter = CargoFilterCriteria::CF /** Window definition of the industry directory gui */ -static WindowDesc _industry_directory_desc(__FILE__, __LINE__, +static WindowDesc _industry_directory_desc( WDP_AUTO, "list_industries", 428, 190, WC_INDUSTRY_DIRECTORY, WC_NONE, 0, @@ -1959,7 +1959,7 @@ static constexpr NWidgetPart _nested_industry_cargoes_widgets[] = { }; /** Window description for the industry cargoes window. */ -static WindowDesc _industry_cargoes_desc(__FILE__, __LINE__, +static WindowDesc _industry_cargoes_desc( WDP_AUTO, "industry_cargoes", 300, 210, WC_INDUSTRY_CARGOES, WC_NONE, 0, diff --git a/src/intro_gui.cpp b/src/intro_gui.cpp index 2ffe2d4097..94399b47f8 100644 --- a/src/intro_gui.cpp +++ b/src/intro_gui.cpp @@ -456,7 +456,7 @@ static constexpr NWidgetPart _nested_select_game_widgets[] = { EndContainer(), }; -static WindowDesc _select_game_desc(__FILE__, __LINE__, +static WindowDesc _select_game_desc( WDP_CENTER, nullptr, 0, 0, WC_SELECT_GAME, WC_NONE, WDF_NO_CLOSE, diff --git a/src/league_gui.cpp b/src/league_gui.cpp index 696d0fe14c..2e0e6ee9d0 100644 --- a/src/league_gui.cpp +++ b/src/league_gui.cpp @@ -199,7 +199,7 @@ static constexpr NWidgetPart _nested_performance_league_widgets[] = { EndContainer(), }; -static WindowDesc _performance_league_desc(__FILE__, __LINE__, +static WindowDesc _performance_league_desc( WDP_AUTO, "performance_league", 0, 0, WC_COMPANY_LEAGUE, WC_NONE, 0, @@ -434,7 +434,7 @@ static constexpr NWidgetPart _nested_script_league_widgets[] = { EndContainer(), }; -static WindowDesc _script_league_desc(__FILE__, __LINE__, +static WindowDesc _script_league_desc( WDP_AUTO, "script_league", 0, 0, WC_COMPANY_LEAGUE, WC_NONE, 0, diff --git a/src/linkgraph/linkgraph_gui.cpp b/src/linkgraph/linkgraph_gui.cpp index 24cfb92098..7f9c944c4e 100644 --- a/src/linkgraph/linkgraph_gui.cpp +++ b/src/linkgraph/linkgraph_gui.cpp @@ -536,7 +536,7 @@ static constexpr NWidgetPart _nested_linkgraph_legend_widgets[] = { static_assert(WID_LGL_SATURATION_LAST - WID_LGL_SATURATION_FIRST == lengthof(LinkGraphOverlay::LINK_COLOURS[0]) - 1); -static WindowDesc _linkgraph_legend_desc(__FILE__, __LINE__, +static WindowDesc _linkgraph_legend_desc( WDP_AUTO, "toolbar_linkgraph", 0, 0, WC_LINKGRAPH_LEGEND, WC_NONE, 0, diff --git a/src/main_gui.cpp b/src/main_gui.cpp index a413cd3594..2784e04cda 100644 --- a/src/main_gui.cpp +++ b/src/main_gui.cpp @@ -513,7 +513,7 @@ struct MainWindow : Window }}; }; -static WindowDesc _main_window_desc(__FILE__, __LINE__, +static WindowDesc _main_window_desc( WDP_MANUAL, nullptr, 0, 0, WC_MAIN_WINDOW, WC_NONE, WDF_NO_CLOSE, diff --git a/src/misc_gui.cpp b/src/misc_gui.cpp index 790419cdfe..27a16d4452 100644 --- a/src/misc_gui.cpp +++ b/src/misc_gui.cpp @@ -59,7 +59,7 @@ static constexpr NWidgetPart _nested_land_info_widgets[] = { NWidget(WWT_PANEL, COLOUR_GREY, WID_LI_BACKGROUND), EndContainer(), }; -static WindowDesc _land_info_desc(__FILE__, __LINE__, +static WindowDesc _land_info_desc( WDP_AUTO, nullptr, 0, 0, WC_LAND_INFO, WC_NONE, 0, @@ -397,7 +397,7 @@ static constexpr NWidgetPart _nested_about_widgets[] = { EndContainer(), }; -static WindowDesc _about_desc(__FILE__, __LINE__, +static WindowDesc _about_desc( WDP_CENTER, nullptr, 0, 0, WC_GAME_OPTIONS, WC_NONE, 0, @@ -656,7 +656,7 @@ static constexpr NWidgetPart _nested_tooltips_widgets[] = { NWidget(WWT_EMPTY, INVALID_COLOUR, WID_TT_BACKGROUND), }; -static WindowDesc _tool_tips_desc(__FILE__, __LINE__, +static WindowDesc _tool_tips_desc( WDP_MANUAL, nullptr, 0, 0, // Coordinates and sizes are not used, WC_TOOLTIPS, WC_NONE, WDF_NO_FOCUS | WDF_NO_CLOSE, @@ -1069,7 +1069,7 @@ static constexpr NWidgetPart _nested_query_string_widgets[] = { EndContainer(), }; -static WindowDesc _query_string_desc(__FILE__, __LINE__, +static WindowDesc _query_string_desc( WDP_CENTER, nullptr, 0, 0, WC_QUERY_STRING, WC_NONE, 0, @@ -1212,7 +1212,7 @@ static constexpr NWidgetPart _nested_query_widgets[] = { EndContainer(), }; -static WindowDesc _query_desc(__FILE__, __LINE__, +static WindowDesc _query_desc( WDP_CENTER, nullptr, 0, 0, WC_CONFIRM_POPUP_QUERY, WC_NONE, WDF_MODAL, diff --git a/src/music_gui.cpp b/src/music_gui.cpp index 728ba73c5c..8ed2e0749a 100644 --- a/src/music_gui.cpp +++ b/src/music_gui.cpp @@ -667,7 +667,7 @@ static constexpr NWidgetPart _nested_music_track_selection_widgets[] = { EndContainer(), }; -static WindowDesc _music_track_selection_desc(__FILE__, __LINE__, +static WindowDesc _music_track_selection_desc( WDP_AUTO, nullptr, 0, 0, WC_MUSIC_TRACK_SELECTION, WC_NONE, 0, @@ -926,7 +926,7 @@ static constexpr NWidgetPart _nested_music_window_widgets[] = { EndContainer(), }; -static WindowDesc _music_window_desc(__FILE__, __LINE__, +static WindowDesc _music_window_desc( WDP_AUTO, "music", 0, 0, WC_MUSIC_WINDOW, WC_NONE, 0, diff --git a/src/network/network_chat_gui.cpp b/src/network/network_chat_gui.cpp index ece8f5e88a..1b83f67f76 100644 --- a/src/network/network_chat_gui.cpp +++ b/src/network/network_chat_gui.cpp @@ -506,7 +506,7 @@ static constexpr NWidgetPart _nested_chat_window_widgets[] = { }; /** The description of the chat window. */ -static WindowDesc _chat_window_desc(__FILE__, __LINE__, +static WindowDesc _chat_window_desc( WDP_MANUAL, nullptr, 0, 0, WC_SEND_NETWORK_MSG, WC_NONE, 0, diff --git a/src/network/network_content_gui.cpp b/src/network/network_content_gui.cpp index 479be14e51..2a37224498 100644 --- a/src/network/network_content_gui.cpp +++ b/src/network/network_content_gui.cpp @@ -94,7 +94,7 @@ static constexpr NWidgetPart _nested_network_content_download_status_window_widg }; /** Window description for the download window */ -static WindowDesc _network_content_download_status_window_desc(__FILE__, __LINE__, +static WindowDesc _network_content_download_status_window_desc( WDP_CENTER, nullptr, 0, 0, WC_NETWORK_STATUS_WINDOW, WC_NONE, WDF_MODAL, @@ -1113,7 +1113,7 @@ static constexpr NWidgetPart _nested_network_content_list_widgets[] = { }; /** Window description of the content list */ -static WindowDesc _network_content_list_desc(__FILE__, __LINE__, +static WindowDesc _network_content_list_desc( WDP_CENTER, "list_content", 630, 460, WC_NETWORK_WINDOW, WC_NONE, 0, diff --git a/src/network/network_gui.cpp b/src/network/network_gui.cpp index 89cc53879e..4c21dec535 100644 --- a/src/network/network_gui.cpp +++ b/src/network/network_gui.cpp @@ -955,7 +955,7 @@ static constexpr NWidgetPart _nested_network_game_widgets[] = { EndContainer(), }; -static WindowDesc _network_game_window_desc(__FILE__, __LINE__, +static WindowDesc _network_game_window_desc( WDP_CENTER, "list_servers", 1000, 730, WC_NETWORK_WINDOW, WC_NONE, 0, @@ -1222,7 +1222,7 @@ static constexpr NWidgetPart _nested_network_start_server_window_widgets[] = { EndContainer(), }; -static WindowDesc _network_start_server_window_desc(__FILE__, __LINE__, +static WindowDesc _network_start_server_window_desc( WDP_CENTER, nullptr, 0, 0, WC_NETWORK_WINDOW, WC_NONE, 0, @@ -1301,7 +1301,7 @@ static constexpr NWidgetPart _nested_client_list_widgets[] = { EndContainer(), }; -static WindowDesc _client_list_desc(__FILE__, __LINE__, +static WindowDesc _client_list_desc( WDP_AUTO, "list_clients", 220, 300, WC_CLIENT_LIST, WC_NONE, 0, @@ -2223,7 +2223,7 @@ static constexpr NWidgetPart _nested_network_join_status_window_widgets[] = { EndContainer(), }; -static WindowDesc _network_join_status_window_desc(__FILE__, __LINE__, +static WindowDesc _network_join_status_window_desc( WDP_CENTER, nullptr, 0, 0, WC_NETWORK_STATUS_WINDOW, WC_NONE, WDF_MODAL, @@ -2345,7 +2345,7 @@ static constexpr NWidgetPart _nested_network_company_password_window_widgets[] = EndContainer(), }; -static WindowDesc _network_company_password_window_desc(__FILE__, __LINE__, +static WindowDesc _network_company_password_window_desc( WDP_AUTO, nullptr, 0, 0, WC_COMPANY_PASSWORD_WINDOW, WC_NONE, 0, @@ -2454,7 +2454,7 @@ static constexpr NWidgetPart _nested_network_ask_relay_widgets[] = { EndContainer(), }; -static WindowDesc _network_ask_relay_desc(__FILE__, __LINE__, +static WindowDesc _network_ask_relay_desc( WDP_CENTER, nullptr, 0, 0, WC_NETWORK_ASK_RELAY, WC_NONE, WDF_MODAL, @@ -2552,7 +2552,7 @@ static constexpr NWidgetPart _nested_network_ask_survey_widgets[] = { EndContainer(), }; -static WindowDesc _network_ask_survey_desc(__FILE__, __LINE__, +static WindowDesc _network_ask_survey_desc( WDP_CENTER, nullptr, 0, 0, WC_NETWORK_ASK_SURVEY, WC_NONE, WDF_MODAL, diff --git a/src/newgrf_debug_gui.cpp b/src/newgrf_debug_gui.cpp index e200515e26..4ccc79e0e1 100644 --- a/src/newgrf_debug_gui.cpp +++ b/src/newgrf_debug_gui.cpp @@ -679,14 +679,14 @@ static constexpr NWidgetPart _nested_newgrf_inspect_widgets[] = { EndContainer(), }; -static WindowDesc _newgrf_inspect_chain_desc(__FILE__, __LINE__, +static WindowDesc _newgrf_inspect_chain_desc( WDP_AUTO, "newgrf_inspect_chain", 400, 300, WC_NEWGRF_INSPECT, WC_NONE, 0, std::begin(_nested_newgrf_inspect_chain_widgets), std::end(_nested_newgrf_inspect_chain_widgets) ); -static WindowDesc _newgrf_inspect_desc(__FILE__, __LINE__, +static WindowDesc _newgrf_inspect_desc( WDP_AUTO, "newgrf_inspect", 400, 300, WC_NEWGRF_INSPECT, WC_NONE, 0, @@ -1163,7 +1163,7 @@ static constexpr NWidgetPart _nested_sprite_aligner_widgets[] = { EndContainer(), }; -static WindowDesc _sprite_aligner_desc(__FILE__, __LINE__, +static WindowDesc _sprite_aligner_desc( WDP_AUTO, "sprite_aligner", 400, 300, WC_SPRITE_ALIGNER, WC_NONE, 0, diff --git a/src/newgrf_gui.cpp b/src/newgrf_gui.cpp index bcfe6810c3..695cad546a 100644 --- a/src/newgrf_gui.cpp +++ b/src/newgrf_gui.cpp @@ -541,7 +541,7 @@ static constexpr NWidgetPart _nested_newgrf_parameter_widgets[] = { }; /** Window definition for the change grf parameters window */ -static WindowDesc _newgrf_parameters_desc(__FILE__, __LINE__, +static WindowDesc _newgrf_parameters_desc( WDP_CENTER, "settings_newgrf_config", 500, 208, WC_GRF_PARAMETERS, WC_NONE, 0, @@ -1967,7 +1967,7 @@ static constexpr NWidgetPart _nested_newgrf_widgets[] = { }; /* Window definition of the manage newgrfs window */ -static WindowDesc _newgrf_desc(__FILE__, __LINE__, +static WindowDesc _newgrf_desc( WDP_CENTER, "settings_newgrf", 300, 263, WC_GAME_OPTIONS, WC_NONE, 0, @@ -2051,7 +2051,7 @@ static constexpr NWidgetPart _nested_save_preset_widgets[] = { }; /** Window description of the preset save window. */ -static WindowDesc _save_preset_desc(__FILE__, __LINE__, +static WindowDesc _save_preset_desc( WDP_CENTER, "save_preset", 140, 110, WC_SAVE_PRESET, WC_GAME_OPTIONS, WDF_MODAL, @@ -2196,7 +2196,7 @@ static constexpr NWidgetPart _nested_scan_progress_widgets[] = { }; /** Description of the widgets and other settings of the window. */ -static WindowDesc _scan_progress_desc(__FILE__, __LINE__, +static WindowDesc _scan_progress_desc( WDP_CENTER, nullptr, 0, 0, WC_MODAL_PROGRESS, WC_NONE, 0, diff --git a/src/news_gui.cpp b/src/news_gui.cpp index 01479f1872..f84676080c 100644 --- a/src/news_gui.cpp +++ b/src/news_gui.cpp @@ -96,7 +96,7 @@ static constexpr NWidgetPart _nested_normal_news_widgets[] = { EndContainer(), }; -static WindowDesc _normal_news_desc(__FILE__, __LINE__, +static WindowDesc _normal_news_desc( WDP_MANUAL, nullptr, 0, 0, WC_NEWS_WINDOW, WC_NONE, 0, @@ -123,7 +123,7 @@ static constexpr NWidgetPart _nested_vehicle_news_widgets[] = { EndContainer(), }; -static WindowDesc _vehicle_news_desc(__FILE__, __LINE__, +static WindowDesc _vehicle_news_desc( WDP_MANUAL, nullptr, 0, 0, WC_NEWS_WINDOW, WC_NONE, 0, @@ -151,7 +151,7 @@ static constexpr NWidgetPart _nested_company_news_widgets[] = { EndContainer(), }; -static WindowDesc _company_news_desc(__FILE__, __LINE__, +static WindowDesc _company_news_desc( WDP_MANUAL, nullptr, 0, 0, WC_NEWS_WINDOW, WC_NONE, 0, @@ -174,7 +174,7 @@ static constexpr NWidgetPart _nested_thin_news_widgets[] = { EndContainer(), }; -static WindowDesc _thin_news_desc(__FILE__, __LINE__, +static WindowDesc _thin_news_desc( WDP_MANUAL, nullptr, 0, 0, WC_NEWS_WINDOW, WC_NONE, 0, @@ -200,7 +200,7 @@ static constexpr NWidgetPart _nested_small_news_widgets[] = { EndContainer(), }; -static WindowDesc _small_news_desc(__FILE__, __LINE__, +static WindowDesc _small_news_desc( WDP_MANUAL, nullptr, 0, 0, WC_NEWS_WINDOW, WC_NONE, 0, @@ -1228,7 +1228,7 @@ static constexpr NWidgetPart _nested_message_history[] = { EndContainer(), }; -static WindowDesc _message_history_desc(__FILE__, __LINE__, +static WindowDesc _message_history_desc( WDP_AUTO, "list_news", 400, 140, WC_MESSAGE_HISTORY, WC_NONE, 0, diff --git a/src/object_gui.cpp b/src/object_gui.cpp index 6e911359aa..8d1880723a 100644 --- a/src/object_gui.cpp +++ b/src/object_gui.cpp @@ -711,7 +711,7 @@ static constexpr NWidgetPart _nested_build_object_widgets[] = { EndContainer(), }; -static WindowDesc _build_object_desc(__FILE__, __LINE__, +static WindowDesc _build_object_desc( WDP_AUTO, "build_object", 0, 0, WC_BUILD_OBJECT, WC_BUILD_TOOLBAR, WDF_CONSTRUCTION, diff --git a/src/order_gui.cpp b/src/order_gui.cpp index 9a8461370d..b52edc4067 100644 --- a/src/order_gui.cpp +++ b/src/order_gui.cpp @@ -1686,7 +1686,7 @@ static constexpr NWidgetPart _nested_orders_train_widgets[] = { EndContainer(), }; -static WindowDesc _orders_train_desc(__FILE__, __LINE__, +static WindowDesc _orders_train_desc( WDP_AUTO, "view_vehicle_orders_train", 384, 100, WC_VEHICLE_ORDERS, WC_VEHICLE_VIEW, WDF_CONSTRUCTION, @@ -1759,7 +1759,7 @@ static constexpr NWidgetPart _nested_orders_widgets[] = { EndContainer(), }; -static WindowDesc _orders_desc(__FILE__, __LINE__, +static WindowDesc _orders_desc( WDP_AUTO, "view_vehicle_orders", 384, 100, WC_VEHICLE_ORDERS, WC_VEHICLE_VIEW, WDF_CONSTRUCTION, @@ -1786,7 +1786,7 @@ static constexpr NWidgetPart _nested_other_orders_widgets[] = { EndContainer(), }; -static WindowDesc _other_orders_desc(__FILE__, __LINE__, +static WindowDesc _other_orders_desc( WDP_AUTO, "view_vehicle_orders_competitor", 384, 86, WC_VEHICLE_ORDERS, WC_VEHICLE_VIEW, WDF_CONSTRUCTION, diff --git a/src/osk_gui.cpp b/src/osk_gui.cpp index 00d311ff24..a6e16bff75 100644 --- a/src/osk_gui.cpp +++ b/src/osk_gui.cpp @@ -333,7 +333,7 @@ static constexpr NWidgetPart _nested_osk_widgets[] = { EndContainer(), }; -static WindowDesc _osk_desc(__FILE__, __LINE__, +static WindowDesc _osk_desc( WDP_CENTER, nullptr, 0, 0, WC_OSK, WC_NONE, 0, diff --git a/src/rail_gui.cpp b/src/rail_gui.cpp index 74779ebf74..bc107ccfeb 100644 --- a/src/rail_gui.cpp +++ b/src/rail_gui.cpp @@ -891,7 +891,7 @@ static constexpr NWidgetPart _nested_build_rail_widgets[] = { EndContainer(), }; -static WindowDesc _build_rail_desc(__FILE__, __LINE__, +static WindowDesc _build_rail_desc( WDP_ALIGN_TOOLBAR, "toolbar_rail", 0, 0, WC_BUILD_TOOLBAR, WC_NONE, WDF_CONSTRUCTION, @@ -1671,7 +1671,7 @@ static constexpr NWidgetPart _nested_station_builder_widgets[] = { }; /** High level window description of the station-build window (default & newGRF) */ -static WindowDesc _station_builder_desc(__FILE__, __LINE__, +static WindowDesc _station_builder_desc( WDP_AUTO, "build_station_rail", 350, 0, WC_BUILD_STATION, WC_BUILD_TOOLBAR, WDF_CONSTRUCTION, @@ -1931,7 +1931,7 @@ static constexpr NWidgetPart _nested_signal_builder_widgets[] = { }; /** Signal selection window description */ -static WindowDesc _signal_builder_desc(__FILE__, __LINE__, +static WindowDesc _signal_builder_desc( WDP_AUTO, nullptr, 0, 0, WC_BUILD_SIGNAL, WC_BUILD_TOOLBAR, WDF_CONSTRUCTION, @@ -2012,7 +2012,7 @@ static constexpr NWidgetPart _nested_build_depot_widgets[] = { EndContainer(), }; -static WindowDesc _build_depot_desc(__FILE__, __LINE__, +static WindowDesc _build_depot_desc( WDP_AUTO, nullptr, 0, 0, WC_BUILD_DEPOT, WC_BUILD_TOOLBAR, WDF_CONSTRUCTION, @@ -2241,7 +2241,7 @@ static constexpr NWidgetPart _nested_build_waypoint_widgets[] = { EndContainer(), }; -static WindowDesc _build_waypoint_desc(__FILE__, __LINE__, +static WindowDesc _build_waypoint_desc( WDP_AUTO, "build_waypoint", 0, 0, WC_BUILD_WAYPOINT, WC_BUILD_TOOLBAR, WDF_CONSTRUCTION, diff --git a/src/road_gui.cpp b/src/road_gui.cpp index d8cf2bf004..766a3434c4 100644 --- a/src/road_gui.cpp +++ b/src/road_gui.cpp @@ -851,7 +851,7 @@ static constexpr NWidgetPart _nested_build_road_widgets[] = { EndContainer(), }; -static WindowDesc _build_road_desc(__FILE__, __LINE__, +static WindowDesc _build_road_desc( WDP_ALIGN_TOOLBAR, "toolbar_road", 0, 0, WC_BUILD_TOOLBAR, WC_NONE, WDF_CONSTRUCTION, @@ -892,7 +892,7 @@ static constexpr NWidgetPart _nested_build_tramway_widgets[] = { EndContainer(), }; -static WindowDesc _build_tramway_desc(__FILE__, __LINE__, +static WindowDesc _build_tramway_desc( WDP_ALIGN_TOOLBAR, "toolbar_tramway", 0, 0, WC_BUILD_TOOLBAR, WC_NONE, WDF_CONSTRUCTION, @@ -947,7 +947,7 @@ static constexpr NWidgetPart _nested_build_road_scen_widgets[] = { EndContainer(), }; -static WindowDesc _build_road_scen_desc(__FILE__, __LINE__, +static WindowDesc _build_road_scen_desc( WDP_AUTO, "toolbar_road_scen", 0, 0, WC_SCEN_BUILD_TOOLBAR, WC_NONE, WDF_CONSTRUCTION, @@ -982,7 +982,7 @@ static constexpr NWidgetPart _nested_build_tramway_scen_widgets[] = { EndContainer(), }; -static WindowDesc _build_tramway_scen_desc(__FILE__, __LINE__, +static WindowDesc _build_tramway_scen_desc( WDP_AUTO, "toolbar_tram_scen", 0, 0, WC_SCEN_BUILD_TOOLBAR, WC_NONE, WDF_CONSTRUCTION, @@ -1079,7 +1079,7 @@ static constexpr NWidgetPart _nested_build_road_depot_widgets[] = { EndContainer(), }; -static WindowDesc _build_road_depot_desc(__FILE__, __LINE__, +static WindowDesc _build_road_depot_desc( WDP_AUTO, nullptr, 0, 0, WC_BUILD_DEPOT, WC_BUILD_TOOLBAR, WDF_CONSTRUCTION, @@ -1701,7 +1701,7 @@ static constexpr NWidgetPart _nested_road_station_picker_widgets[] = { EndContainer(), }; -static WindowDesc _road_station_picker_desc(__FILE__, __LINE__, +static WindowDesc _road_station_picker_desc( WDP_AUTO, "build_station_road", 0, 0, WC_BUS_STATION, WC_BUILD_TOOLBAR, WDF_CONSTRUCTION, @@ -1779,7 +1779,7 @@ static constexpr NWidgetPart _nested_tram_station_picker_widgets[] = { EndContainer(), }; -static WindowDesc _tram_station_picker_desc(__FILE__, __LINE__, +static WindowDesc _tram_station_picker_desc( WDP_AUTO, "build_station_tram", 0, 0, WC_BUS_STATION, WC_BUILD_TOOLBAR, WDF_CONSTRUCTION, diff --git a/src/screenshot_gui.cpp b/src/screenshot_gui.cpp index 268f4dec0c..8a91dc7eb3 100644 --- a/src/screenshot_gui.cpp +++ b/src/screenshot_gui.cpp @@ -60,7 +60,7 @@ static constexpr NWidgetPart _nested_screenshot[] = { EndContainer(), }; -static WindowDesc _screenshot_window_desc(__FILE__, __LINE__, +static WindowDesc _screenshot_window_desc( WDP_AUTO, "take_a_screenshot", 200, 100, WC_SCREENSHOT, WC_NONE, 0, diff --git a/src/script/script_gui.cpp b/src/script/script_gui.cpp index 33f17715e0..40ac7e3cfd 100644 --- a/src/script/script_gui.cpp +++ b/src/script/script_gui.cpp @@ -261,7 +261,7 @@ static constexpr NWidgetPart _nested_script_list_widgets[] = { }; /** Window definition for the ai list window. */ -static WindowDesc _script_list_desc(__FILE__, __LINE__, +static WindowDesc _script_list_desc( WDP_CENTER, "settings_script_list", 200, 234, WC_SCRIPT_LIST, WC_NONE, 0, @@ -606,7 +606,7 @@ static constexpr NWidgetPart _nested_script_settings_widgets[] = { }; /** Window definition for the Script settings window. */ -static WindowDesc _script_settings_desc(__FILE__, __LINE__, +static WindowDesc _script_settings_desc( WDP_CENTER, "settings_script", 500, 208, WC_SCRIPT_SETTINGS, WC_NONE, 0, @@ -1288,7 +1288,7 @@ EndContainer(), }; /** Window definition for the Script debug window. */ -static WindowDesc _script_debug_desc(__FILE__, __LINE__, +static WindowDesc _script_debug_desc( WDP_AUTO, "script_debug", 600, 450, WC_SCRIPT_DEBUG, WC_NONE, 0, diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp index 6eb44c6c1a..80a6f1056f 100644 --- a/src/settings_gui.cpp +++ b/src/settings_gui.cpp @@ -1173,7 +1173,7 @@ static constexpr NWidgetPart _nested_game_options_widgets[] = { EndContainer(), }; -static WindowDesc _game_options_desc(__FILE__, __LINE__, +static WindowDesc _game_options_desc( WDP_CENTER, nullptr, 0, 0, WC_GAME_OPTIONS, WC_NONE, 0, @@ -2883,7 +2883,7 @@ static constexpr NWidgetPart _nested_settings_selection_widgets[] = { EndContainer(), }; -static WindowDesc _settings_selection_desc(__FILE__, __LINE__, +static WindowDesc _settings_selection_desc( WDP_CENTER, "settings", 510, 450, WC_GAME_OPTIONS, WC_NONE, 0, @@ -3191,7 +3191,7 @@ static constexpr NWidgetPart _nested_cust_currency_widgets[] = { EndContainer(), }; -static WindowDesc _cust_currency_desc(__FILE__, __LINE__, +static WindowDesc _cust_currency_desc( WDP_CENTER, nullptr, 0, 0, WC_CUSTOM_CURRENCY, WC_NONE, 0, diff --git a/src/signs_gui.cpp b/src/signs_gui.cpp index 579548d86c..fd327eb020 100644 --- a/src/signs_gui.cpp +++ b/src/signs_gui.cpp @@ -383,7 +383,7 @@ static constexpr NWidgetPart _nested_sign_list_widgets[] = { EndContainer(), }; -static WindowDesc _sign_list_desc(__FILE__, __LINE__, +static WindowDesc _sign_list_desc( WDP_AUTO, "list_signs", 358, 138, WC_SIGN_LIST, WC_NONE, 0, @@ -549,7 +549,7 @@ static constexpr NWidgetPart _nested_query_sign_edit_widgets[] = { EndContainer(), }; -static WindowDesc _query_sign_edit_desc(__FILE__, __LINE__, +static WindowDesc _query_sign_edit_desc( WDP_CENTER, nullptr, 0, 0, WC_QUERY_STRING, WC_NONE, WDF_CONSTRUCTION, diff --git a/src/smallmap_gui.cpp b/src/smallmap_gui.cpp index 6544f42a9e..83afc1516d 100644 --- a/src/smallmap_gui.cpp +++ b/src/smallmap_gui.cpp @@ -1981,7 +1981,7 @@ static constexpr NWidgetPart _nested_smallmap_widgets[] = { EndContainer(), }; -static WindowDesc _smallmap_desc(__FILE__, __LINE__, +static WindowDesc _smallmap_desc( WDP_AUTO, "smallmap", 484, 314, WC_SMALLMAP, WC_NONE, 0, diff --git a/src/station_gui.cpp b/src/station_gui.cpp index 5f08c816ce..8fb5389802 100644 --- a/src/station_gui.cpp +++ b/src/station_gui.cpp @@ -762,7 +762,7 @@ static constexpr NWidgetPart _nested_company_stations_widgets[] = { EndContainer(), }; -static WindowDesc _company_stations_desc(__FILE__, __LINE__, +static WindowDesc _company_stations_desc( WDP_AUTO, "list_stations", 358, 162, WC_STATION_LIST, WC_NONE, 0, @@ -2130,7 +2130,7 @@ const StringID StationViewWindow::_group_names[] = { INVALID_STRING_ID }; -static WindowDesc _station_view_desc(__FILE__, __LINE__, +static WindowDesc _station_view_desc( WDP_AUTO, "view_station", 249, 117, WC_STATION_VIEW, WC_NONE, 0, @@ -2388,7 +2388,7 @@ struct SelectStationWindow : Window { } }; -static WindowDesc _select_station_desc(__FILE__, __LINE__, +static WindowDesc _select_station_desc( WDP_AUTO, "build_station_join", 200, 180, WC_SELECT_STATION, WC_NONE, WDF_CONSTRUCTION, diff --git a/src/statusbar_gui.cpp b/src/statusbar_gui.cpp index 19db459763..7229ffd803 100644 --- a/src/statusbar_gui.cpp +++ b/src/statusbar_gui.cpp @@ -228,7 +228,7 @@ static constexpr NWidgetPart _nested_main_status_widgets[] = { EndContainer(), }; -static WindowDesc _main_status_desc(__FILE__, __LINE__, +static WindowDesc _main_status_desc( WDP_MANUAL, nullptr, 0, 0, WC_STATUS_BAR, WC_NONE, WDF_NO_FOCUS | WDF_NO_CLOSE, diff --git a/src/story_gui.cpp b/src/story_gui.cpp index 5324aaad41..05d6bc44cc 100644 --- a/src/story_gui.cpp +++ b/src/story_gui.cpp @@ -968,14 +968,14 @@ static constexpr NWidgetPart _nested_story_book_widgets[] = { EndContainer(), }; -static WindowDesc _story_book_desc(__FILE__, __LINE__, +static WindowDesc _story_book_desc( WDP_AUTO, "view_story", 400, 300, WC_STORY_BOOK, WC_NONE, 0, std::begin(_nested_story_book_widgets), std::end(_nested_story_book_widgets) ); -static WindowDesc _story_book_gs_desc(__FILE__, __LINE__, +static WindowDesc _story_book_gs_desc( WDP_CENTER, "view_story_gs", 400, 300, WC_STORY_BOOK, WC_NONE, 0, diff --git a/src/subsidy_gui.cpp b/src/subsidy_gui.cpp index f0ca0dc260..f43226d5f4 100644 --- a/src/subsidy_gui.cpp +++ b/src/subsidy_gui.cpp @@ -267,7 +267,7 @@ static constexpr NWidgetPart _nested_subsidies_list_widgets[] = { EndContainer(), }; -static WindowDesc _subsidies_list_desc(__FILE__, __LINE__, +static WindowDesc _subsidies_list_desc( WDP_AUTO, "list_subsidies", 500, 127, WC_SUBSIDIES_LIST, WC_NONE, 0, diff --git a/src/terraform_gui.cpp b/src/terraform_gui.cpp index 164eb4c224..61751ec06a 100644 --- a/src/terraform_gui.cpp +++ b/src/terraform_gui.cpp @@ -351,7 +351,7 @@ static constexpr NWidgetPart _nested_terraform_widgets[] = { EndContainer(), }; -static WindowDesc _terraform_desc(__FILE__, __LINE__, +static WindowDesc _terraform_desc( WDP_MANUAL, "toolbar_landscape", 0, 0, WC_SCEN_LAND_GEN, WC_NONE, WDF_CONSTRUCTION, @@ -735,7 +735,7 @@ struct ScenarioEditorLandscapeGenerationWindow : Window { }, TerraformToolbarEditorGlobalHotkeys}; }; -static WindowDesc _scen_edit_land_gen_desc(__FILE__, __LINE__, +static WindowDesc _scen_edit_land_gen_desc( WDP_AUTO, "toolbar_landscape_scen", 0, 0, WC_SCEN_LAND_GEN, WC_NONE, WDF_CONSTRUCTION, diff --git a/src/tests/test_window_desc.cpp b/src/tests/test_window_desc.cpp index 3cd8406666..85d2f6ebd8 100644 --- a/src/tests/test_window_desc.cpp +++ b/src/tests/test_window_desc.cpp @@ -50,7 +50,7 @@ TEST_CASE("WindowDesc - ini_key validity") bool has_inikey = window_desc->ini_key != nullptr; bool has_widget = std::any_of(window_desc->nwid_begin, window_desc->nwid_end, [](const NWidgetPart &part) { return part.type == WWT_DEFSIZEBOX || part.type == WWT_STICKYBOX; }); - INFO(fmt::format("{}:{}", window_desc->file, window_desc->line)); + INFO(fmt::format("{}:{}", window_desc->source_location.file_name(), window_desc->source_location.line())); CAPTURE(has_inikey); CAPTURE(has_widget); @@ -78,7 +78,7 @@ TEST_CASE("WindowDesc - NWidgetParts properly closed") { const WindowDesc *window_desc = GENERATE(from_range(std::begin(*_window_descs), std::end(*_window_descs))); - INFO(fmt::format("{}:{}", window_desc->file, window_desc->line)); + INFO(fmt::format("{}:{}", window_desc->source_location.file_name(), window_desc->source_location.line())); CHECK(IsNWidgetTreeClosed(window_desc->nwid_begin, window_desc->nwid_end)); } @@ -87,7 +87,7 @@ TEST_CASE_METHOD(WindowDescTestsFixture, "WindowDesc - NWidgetPart validity") { const WindowDesc *window_desc = GENERATE(from_range(std::begin(*_window_descs), std::end(*_window_descs))); - INFO(fmt::format("{}:{}", window_desc->file, window_desc->line)); + INFO(fmt::format("{}:{}", window_desc->source_location.file_name(), window_desc->source_location.line())); NWidgetStacked *shade_select = nullptr; std::unique_ptr root = nullptr; diff --git a/src/textfile_gui.cpp b/src/textfile_gui.cpp index c07133f248..018c1c4f3e 100644 --- a/src/textfile_gui.cpp +++ b/src/textfile_gui.cpp @@ -74,7 +74,7 @@ static constexpr NWidgetPart _nested_textfile_widgets[] = { }; /** Window definition for the textfile window */ -static WindowDesc _textfile_desc(__FILE__, __LINE__, +static WindowDesc _textfile_desc( WDP_CENTER, "textfile", 630, 460, WC_TEXTFILE, WC_NONE, 0, diff --git a/src/timetable_gui.cpp b/src/timetable_gui.cpp index a7e700f536..5f4f99758d 100644 --- a/src/timetable_gui.cpp +++ b/src/timetable_gui.cpp @@ -852,7 +852,7 @@ static constexpr NWidgetPart _nested_timetable_widgets[] = { EndContainer(), }; -static WindowDesc _timetable_desc(__FILE__, __LINE__, +static WindowDesc _timetable_desc( WDP_AUTO, "view_vehicle_timetable", 400, 130, WC_VEHICLE_TIMETABLE, WC_VEHICLE_VIEW, WDF_CONSTRUCTION, diff --git a/src/toolbar_gui.cpp b/src/toolbar_gui.cpp index ec54fb1c07..c45db8a0b6 100644 --- a/src/toolbar_gui.cpp +++ b/src/toolbar_gui.cpp @@ -2196,7 +2196,7 @@ static constexpr NWidgetPart _nested_toolbar_normal_widgets[] = { NWidgetFunction(MakeMainToolbar), }; -static WindowDesc _toolb_normal_desc(__FILE__, __LINE__, +static WindowDesc _toolb_normal_desc( WDP_MANUAL, nullptr, 0, 0, WC_MAIN_TOOLBAR, WC_NONE, WDF_NO_FOCUS | WDF_NO_CLOSE, @@ -2536,7 +2536,7 @@ static constexpr NWidgetPart _nested_toolb_scen_widgets[] = { NWidgetFunction(MakeScenarioToolbar), }; -static WindowDesc _toolb_scen_desc(__FILE__, __LINE__, +static WindowDesc _toolb_scen_desc( WDP_MANUAL, nullptr, 0, 0, WC_MAIN_TOOLBAR, WC_NONE, WDF_NO_FOCUS | WDF_NO_CLOSE, diff --git a/src/town_gui.cpp b/src/town_gui.cpp index 3a46990641..dbe65e3742 100644 --- a/src/town_gui.cpp +++ b/src/town_gui.cpp @@ -339,7 +339,7 @@ public: } }; -static WindowDesc _town_authority_desc(__FILE__, __LINE__, +static WindowDesc _town_authority_desc( WDP_AUTO, "view_town_authority", 317, 222, WC_TOWN_AUTHORITY, WC_NONE, 0, @@ -633,7 +633,7 @@ static constexpr NWidgetPart _nested_town_game_view_widgets[] = { EndContainer(), }; -static WindowDesc _town_game_view_desc(__FILE__, __LINE__, +static WindowDesc _town_game_view_desc( WDP_AUTO, "view_town", 260, TownViewWindow::WID_TV_HEIGHT_NORMAL, WC_TOWN_VIEW, WC_NONE, 0, @@ -664,7 +664,7 @@ static constexpr NWidgetPart _nested_town_editor_view_widgets[] = { EndContainer(), }; -static WindowDesc _town_editor_view_desc(__FILE__, __LINE__, +static WindowDesc _town_editor_view_desc( WDP_AUTO, "view_town_scen", 260, TownViewWindow::WID_TV_HEIGHT_NORMAL, WC_TOWN_VIEW, WC_NONE, 0, @@ -1060,7 +1060,7 @@ GUITownList::SortFunction * const TownDirectoryWindow::sorter_funcs[] = { &TownRatingSorter, }; -static WindowDesc _town_directory_desc(__FILE__, __LINE__, +static WindowDesc _town_directory_desc( WDP_AUTO, "list_towns", 208, 202, WC_TOWN_DIRECTORY, WC_NONE, 0, @@ -1294,7 +1294,7 @@ public: } }; -static WindowDesc _found_town_desc(__FILE__, __LINE__, +static WindowDesc _found_town_desc( WDP_AUTO, "build_town", 160, 162, WC_FOUND_TOWN, WC_NONE, WDF_CONSTRUCTION, diff --git a/src/transparency_gui.cpp b/src/transparency_gui.cpp index d0379ad801..ec437ebe2a 100644 --- a/src/transparency_gui.cpp +++ b/src/transparency_gui.cpp @@ -148,7 +148,7 @@ static constexpr NWidgetPart _nested_transparency_widgets[] = { EndContainer(), }; -static WindowDesc _transparency_desc(__FILE__, __LINE__, +static WindowDesc _transparency_desc( WDP_MANUAL, "toolbar_transparency", 0, 0, WC_TRANSPARENCY_TOOLBAR, WC_NONE, 0, diff --git a/src/tree_gui.cpp b/src/tree_gui.cpp index 4a91853289..c0202513b6 100644 --- a/src/tree_gui.cpp +++ b/src/tree_gui.cpp @@ -313,7 +313,7 @@ static constexpr NWidgetPart _nested_build_trees_widgets[] = { EndContainer(), }; -static WindowDesc _build_trees_desc(__FILE__, __LINE__, +static WindowDesc _build_trees_desc( WDP_AUTO, "build_tree", 0, 0, WC_BUILD_TREES, WC_NONE, WDF_CONSTRUCTION, diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp index 7c12256061..6ed05fc076 100644 --- a/src/vehicle_gui.cpp +++ b/src/vehicle_gui.cpp @@ -1271,7 +1271,7 @@ static constexpr NWidgetPart _nested_vehicle_refit_widgets[] = { EndContainer(), }; -static WindowDesc _vehicle_refit_desc(__FILE__, __LINE__, +static WindowDesc _vehicle_refit_desc( WDP_AUTO, "view_vehicle_refit", 240, 174, WC_VEHICLE_REFIT, WC_VEHICLE_VIEW, WDF_CONSTRUCTION, @@ -2200,14 +2200,14 @@ public: } }; -static WindowDesc _vehicle_list_other_desc(__FILE__, __LINE__, +static WindowDesc _vehicle_list_other_desc( WDP_AUTO, "list_vehicles", 260, 246, WC_INVALID, WC_NONE, 0, std::begin(_nested_vehicle_list), std::end(_nested_vehicle_list) ); -static WindowDesc _vehicle_list_train_desc(__FILE__, __LINE__, +static WindowDesc _vehicle_list_train_desc( WDP_AUTO, "list_vehicles_train", 325, 246, WC_TRAINS_LIST, WC_NONE, 0, @@ -2766,7 +2766,7 @@ struct VehicleDetailsWindow : Window { }; /** Vehicle details window descriptor. */ -static WindowDesc _train_vehicle_details_desc(__FILE__, __LINE__, +static WindowDesc _train_vehicle_details_desc( WDP_AUTO, "view_vehicle_details_train", 405, 178, WC_VEHICLE_DETAILS, WC_VEHICLE_VIEW, 0, @@ -2774,7 +2774,7 @@ static WindowDesc _train_vehicle_details_desc(__FILE__, __LINE__, ); /** Vehicle details window descriptor for other vehicles than a train. */ -static WindowDesc _nontrain_vehicle_details_desc(__FILE__, __LINE__, +static WindowDesc _nontrain_vehicle_details_desc( WDP_AUTO, "view_vehicle_details", 405, 113, WC_VEHICLE_DETAILS, WC_VEHICLE_VIEW, 0, @@ -3373,7 +3373,7 @@ public: }; /** Vehicle view window descriptor for all vehicles but trains. */ -static WindowDesc _vehicle_view_desc(__FILE__, __LINE__, +static WindowDesc _vehicle_view_desc( WDP_AUTO, "view_vehicle", 250, 116, WC_VEHICLE_VIEW, WC_NONE, 0, @@ -3385,7 +3385,7 @@ static WindowDesc _vehicle_view_desc(__FILE__, __LINE__, * Vehicle view window descriptor for trains. Only minimum_height and * default_height are different for train view. */ -static WindowDesc _train_view_desc(__FILE__, __LINE__, +static WindowDesc _train_view_desc( WDP_AUTO, "view_vehicle_train", 250, 134, WC_VEHICLE_VIEW, WC_NONE, 0, diff --git a/src/viewport_gui.cpp b/src/viewport_gui.cpp index c2c55240ee..e872191975 100644 --- a/src/viewport_gui.cpp +++ b/src/viewport_gui.cpp @@ -142,7 +142,7 @@ public: } }; -static WindowDesc _extra_viewport_desc(__FILE__, __LINE__, +static WindowDesc _extra_viewport_desc( WDP_AUTO, "extra_viewport", 300, 268, WC_EXTRA_VIEWPORT, WC_NONE, 0, diff --git a/src/waypoint_gui.cpp b/src/waypoint_gui.cpp index 725f8f91d8..9e6fcdf0f9 100644 --- a/src/waypoint_gui.cpp +++ b/src/waypoint_gui.cpp @@ -183,7 +183,7 @@ static constexpr NWidgetPart _nested_waypoint_view_widgets[] = { }; /** The description of the waypoint view. */ -static WindowDesc _waypoint_view_desc(__FILE__, __LINE__, +static WindowDesc _waypoint_view_desc( WDP_AUTO, "view_waypoint", 260, 118, WC_WAYPOINT_VIEW, WC_NONE, 0, diff --git a/src/widgets/dropdown.cpp b/src/widgets/dropdown.cpp index b6a39596fc..ee8649fcb4 100644 --- a/src/widgets/dropdown.cpp +++ b/src/widgets/dropdown.cpp @@ -31,7 +31,7 @@ static constexpr NWidgetPart _nested_dropdown_menu_widgets[] = { EndContainer(), }; -static WindowDesc _dropdown_desc(__FILE__, __LINE__, +static WindowDesc _dropdown_desc( WDP_MANUAL, nullptr, 0, 0, WC_DROPDOWN_MENU, WC_NONE, WDF_NO_FOCUS, diff --git a/src/window.cpp b/src/window.cpp index 50455202c1..c1f39418d7 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -102,11 +102,11 @@ std::vector *_window_descs = nullptr; std::string _windows_file; /** Window description constructor. */ -WindowDesc::WindowDesc(const char * const file, const int line, WindowPosition def_pos, const char *ini_key, int16_t def_width_trad, int16_t def_height_trad, +WindowDesc::WindowDesc(WindowPosition def_pos, const char *ini_key, int16_t def_width_trad, int16_t def_height_trad, WindowClass window_class, WindowClass parent_class, uint32_t flags, - const NWidgetPart *nwid_begin, const NWidgetPart *nwid_end, HotkeyList *hotkeys) : - file(file), - line(line), + const NWidgetPart *nwid_begin, const NWidgetPart *nwid_end, HotkeyList *hotkeys, + const std::source_location location) : + source_location(location), default_pos(def_pos), cls(window_class), parent_cls(parent_class), diff --git a/src/window_gui.h b/src/window_gui.h index 54c75cbedc..3f6b15104f 100644 --- a/src/window_gui.h +++ b/src/window_gui.h @@ -152,14 +152,14 @@ struct HotkeyList; */ struct WindowDesc : ZeroedMemoryAllocator { - WindowDesc(const char * const file, const int line, WindowPosition default_pos, const char *ini_key, int16_t def_width_trad, int16_t def_height_trad, + WindowDesc(WindowPosition default_pos, const char *ini_key, int16_t def_width_trad, int16_t def_height_trad, WindowClass window_class, WindowClass parent_class, uint32_t flags, - const NWidgetPart *nwid_begin, const NWidgetPart *nwid_end, HotkeyList *hotkeys = nullptr); + const NWidgetPart *nwid_begin, const NWidgetPart *nwid_end, HotkeyList *hotkeys = nullptr, + const std::source_location location = std::source_location::current()); ~WindowDesc(); - const char * const file; ///< Source file of this definition - const int line; ///< Source line of this definition + const std::source_location source_location; ///< Source location of this definition WindowPosition default_pos; ///< Preferred position of the window. @see WindowPosition() WindowClass cls; ///< Class of the window, @see WindowClass. WindowClass parent_cls; ///< Class of the parent window. @see WindowClass @@ -184,10 +184,11 @@ private: int16_t default_height_trad; ///< Preferred initial height of the window (pixels at 1x zoom). /** - * Dummy private copy constructor to prevent compilers from + * Delete copy constructor to prevent compilers from * copying the structure, which fails due to _window_descs. */ - WindowDesc(const WindowDesc &other); + WindowDesc(const WindowDesc &) = delete; + WindowDesc& operator=(const WindowDesc &) = delete; }; /**