diff --git a/src/aircraft_gui.cpp b/src/aircraft_gui.cpp index dbc6ee251d..750db29eec 100644 --- a/src/aircraft_gui.cpp +++ b/src/aircraft_gui.cpp @@ -11,7 +11,6 @@ #include "table/strings.h" #include "strings.h" #include "map.h" -#include "window.h" #include "gui.h" #include "vehicle.h" #include "gfx.h" diff --git a/src/airport_gui.cpp b/src/airport_gui.cpp index ef456e1443..f70ee4582b 100644 --- a/src/airport_gui.cpp +++ b/src/airport_gui.cpp @@ -8,7 +8,6 @@ #include "table/strings.h" #include "functions.h" #include "map.h" -#include "window.h" #include "gui.h" #include "viewport.h" #include "gfx.h" diff --git a/src/autoreplace_gui.cpp b/src/autoreplace_gui.cpp index a91c0f4318..9d4acfeaa2 100644 --- a/src/autoreplace_gui.cpp +++ b/src/autoreplace_gui.cpp @@ -9,7 +9,6 @@ #include "table/sprites.h" #include "table/strings.h" #include "strings.h" -#include "window.h" #include "gui.h" #include "command.h" #include "variables.h" diff --git a/src/bridge_gui.cpp b/src/bridge_gui.cpp index 85757bdf72..e1f4036c2b 100644 --- a/src/bridge_gui.cpp +++ b/src/bridge_gui.cpp @@ -8,7 +8,6 @@ #include "strings.h" #include "functions.h" #include "map.h" -#include "window.h" #include "gui.h" #include "viewport.h" #include "gfx.h" diff --git a/src/build_vehicle_gui.cpp b/src/build_vehicle_gui.cpp index 81c6652d40..b6e5468776 100644 --- a/src/build_vehicle_gui.cpp +++ b/src/build_vehicle_gui.cpp @@ -12,7 +12,6 @@ #include "functions.h" #include "table/sprites.h" #include "table/strings.h" -#include "window.h" #include "gui.h" #include "vehicle.h" #include "articulated_vehicles.h" diff --git a/src/console.cpp b/src/console.cpp index 78f6f11430..fca19fbc58 100644 --- a/src/console.cpp +++ b/src/console.cpp @@ -6,7 +6,6 @@ #include "openttd.h" #include "table/strings.h" #include "functions.h" -#include "window.h" #include "gui.h" #include "gfx.h" #include "player.h" diff --git a/src/console.h b/src/console.h index 3a58716f0f..4030c38514 100644 --- a/src/console.h +++ b/src/console.h @@ -5,6 +5,8 @@ #ifndef CONSOLE_H #define CONSOLE_H +#include "window_type.h" + /* maximum length of a typed in command */ #define ICON_CMDLN_SIZE 255 /* maximum length of a totally expanded command */ diff --git a/src/dock_gui.cpp b/src/dock_gui.cpp index 781b16a5f5..8aa11a5518 100644 --- a/src/dock_gui.cpp +++ b/src/dock_gui.cpp @@ -8,7 +8,6 @@ #include "table/strings.h" #include "functions.h" #include "map.h" -#include "window.h" #include "station.h" #include "gui.h" #include "viewport.h" diff --git a/src/economy.cpp b/src/economy.cpp index 5b4f108c55..eae326ddbd 100644 --- a/src/economy.cpp +++ b/src/economy.cpp @@ -15,7 +15,6 @@ #include "player.h" #include "station.h" #include "vehicle.h" -#include "window.h" #include "gfx.h" #include "command.h" #include "saveload.h" diff --git a/src/engine_gui.cpp b/src/engine_gui.cpp index 380b259979..288fc54e00 100644 --- a/src/engine_gui.cpp +++ b/src/engine_gui.cpp @@ -8,7 +8,6 @@ #include "strings.h" #include "table/sprites.h" #include "functions.h" -#include "window.h" #include "gui.h" #include "viewport.h" #include "gfx.h" diff --git a/src/genworld_gui.cpp b/src/genworld_gui.cpp index 82f263705a..3380e0373b 100644 --- a/src/genworld_gui.cpp +++ b/src/genworld_gui.cpp @@ -8,7 +8,6 @@ #include "functions.h" #include "table/strings.h" #include "table/sprites.h" -#include "window.h" #include "gui.h" #include "gfx.h" #include "strings.h" diff --git a/src/graph_gui.cpp b/src/graph_gui.cpp index ddabf882d1..1f9d0e8fe0 100644 --- a/src/graph_gui.cpp +++ b/src/graph_gui.cpp @@ -8,7 +8,6 @@ #include "strings.h" #include "table/sprites.h" #include "functions.h" -#include "window.h" #include "gui.h" #include "gfx.h" #include "player.h" diff --git a/src/group_cmd.cpp b/src/group_cmd.cpp index bb31c9d37a..f0e4de372f 100644 --- a/src/group_cmd.cpp +++ b/src/group_cmd.cpp @@ -16,7 +16,6 @@ #include "train.h" #include "aircraft.h" #include "string.h" -#include "window.h" #include "vehicle_gui.h" #include "strings.h" #include "misc/autoptr.hpp" diff --git a/src/group_gui.cpp b/src/group_gui.cpp index ce4742a922..a665b99d85 100644 --- a/src/group_gui.cpp +++ b/src/group_gui.cpp @@ -7,7 +7,6 @@ #include "functions.h" #include "table/strings.h" #include "table/sprites.h" -#include "window.h" #include "gui.h" #include "gfx.h" #include "vehicle.h" diff --git a/src/gui.h b/src/gui.h index 4b189804bc..8e65319311 100644 --- a/src/gui.h +++ b/src/gui.h @@ -6,7 +6,7 @@ #define GUI_H #include "station.h" -#include "window.h" +#include "window_gui.h" #include "string.h" /* main_gui.cpp */ diff --git a/src/industry_gui.cpp b/src/industry_gui.cpp index 1154b0a1dd..727a52f5cb 100644 --- a/src/industry_gui.cpp +++ b/src/industry_gui.cpp @@ -11,7 +11,6 @@ #include "table/sprites.h" #include "map.h" #include "gui.h" -#include "window.h" #include "gfx.h" #include "command.h" #include "viewport.h" diff --git a/src/intro_gui.cpp b/src/intro_gui.cpp index 488ac2892c..802783fd20 100644 --- a/src/intro_gui.cpp +++ b/src/intro_gui.cpp @@ -8,7 +8,6 @@ #include "strings.h" #include "table/sprites.h" #include "functions.h" -#include "window.h" #include "gui.h" #include "gfx.h" #include "player.h" diff --git a/src/main_gui.cpp b/src/main_gui.cpp index 100d0f4559..5e0f619989 100644 --- a/src/main_gui.cpp +++ b/src/main_gui.cpp @@ -14,7 +14,6 @@ #include "table/strings.h" #include "map.h" #include "tile.h" -#include "window.h" #include "gui.h" #include "viewport.h" #include "gfx.h" diff --git a/src/misc_cmd.cpp b/src/misc_cmd.cpp index cd42c59072..74fb313026 100644 --- a/src/misc_cmd.cpp +++ b/src/misc_cmd.cpp @@ -10,7 +10,6 @@ #include "command.h" #include "player.h" #include "gfx.h" -#include "window.h" #include "gui.h" #include "economy.h" #include "network/network.h" diff --git a/src/misc_gui.cpp b/src/misc_gui.cpp index da0fbb762a..812f7e1ac5 100644 --- a/src/misc_gui.cpp +++ b/src/misc_gui.cpp @@ -17,7 +17,6 @@ #include "strings.h" #include "table/tree_land.h" #include "map.h" -#include "window.h" #include "gui.h" #include "viewport.h" #include "gfx.h" diff --git a/src/music_gui.cpp b/src/music_gui.cpp index d97048610a..0b383d5e66 100644 --- a/src/music_gui.cpp +++ b/src/music_gui.cpp @@ -9,13 +9,13 @@ #include "strings.h" #include "functions.h" #include "fileio.h" -#include "window.h" #include "gfx.h" #include "sound.h" #include "macros.h" #include "variables.h" #include "music.h" #include "music/music_driver.hpp" +#include "window_gui.h" static byte _music_wnd_cursong; static bool _song_is_active; diff --git a/src/network/network_client.cpp b/src/network/network_client.cpp index 7c27e0b469..fcc2824e9c 100644 --- a/src/network/network_client.cpp +++ b/src/network/network_client.cpp @@ -17,7 +17,6 @@ #include "network_gui.h" #include "../saveload.h" #include "../command.h" -#include "../window.h" #include "../console.h" #include "../variables.h" #include "../ai/ai.h" diff --git a/src/network/network_gui.cpp b/src/network/network_gui.cpp index 876f74df00..70372d8bc8 100644 --- a/src/network/network_gui.cpp +++ b/src/network/network_gui.cpp @@ -16,7 +16,6 @@ #include "network_client.h" #include "network_gui.h" #include "network_gamelist.h" -#include "../window.h" #include "../gui.h" #include "../gfx.h" #include "../command.h" diff --git a/src/newgrf_gui.cpp b/src/newgrf_gui.cpp index fbd4934a71..710d9e5acf 100644 --- a/src/newgrf_gui.cpp +++ b/src/newgrf_gui.cpp @@ -8,7 +8,6 @@ #include "variables.h" #include "gfx.h" #include "gui.h" -#include "window.h" #include "table/strings.h" #include "table/sprites.h" #include "newgrf.h" diff --git a/src/news.h b/src/news.h index 436f2e40ff..1330f9aa17 100644 --- a/src/news.h +++ b/src/news.h @@ -5,6 +5,8 @@ #ifndef NEWS_H #define NEWS_H +#include "window_type.h" + struct NewsItem { StringID string_id; ///< Message text (sometimes also used for storing other info) uint16 duration; ///< Remaining time for showing this news message diff --git a/src/news_gui.cpp b/src/news_gui.cpp index 859786c128..28d34238f1 100644 --- a/src/news_gui.cpp +++ b/src/news_gui.cpp @@ -7,7 +7,6 @@ #include "strings.h" #include "table/sprites.h" #include "table/strings.h" -#include "window.h" #include "gui.h" #include "viewport.h" #include "gfx.h" diff --git a/src/openttd.cpp b/src/openttd.cpp index af80a9dd10..2f5250999e 100644 --- a/src/openttd.cpp +++ b/src/openttd.cpp @@ -31,7 +31,7 @@ #include "tunnel_map.h" #include "vehicle.h" #include "viewport.h" -#include "window.h" +#include "window_gui.h" #include "player.h" #include "command.h" #include "town.h" diff --git a/src/openttd.h b/src/openttd.h index 6ca6fc8a78..ec68bf914c 100644 --- a/src/openttd.h +++ b/src/openttd.h @@ -32,7 +32,6 @@ struct Pair { struct Vehicle; struct Depot; struct Waypoint; -struct Window; struct Station; struct ViewPort; struct Town; @@ -80,7 +79,6 @@ assert_compile(sizeof(DestinationID) == sizeof(DepotID)); assert_compile(sizeof(DestinationID) == sizeof(WaypointID)); assert_compile(sizeof(DestinationID) == sizeof(StationID)); -typedef int32 WindowNumber; enum { INVALID_YEAR = -1, @@ -500,91 +498,6 @@ struct TileTypeProcs { }; -enum WindowClass { - WC_NONE, - WC_MAIN_WINDOW = WC_NONE, - WC_MAIN_TOOLBAR, - WC_STATUS_BAR, - WC_BUILD_TOOLBAR, - WC_NEWS_WINDOW, - WC_TOWN_DIRECTORY, - WC_STATION_LIST, - WC_TOWN_VIEW, - WC_SMALLMAP, - WC_TRAINS_LIST, - WC_ROADVEH_LIST, - WC_SHIPS_LIST, - WC_AIRCRAFT_LIST, - WC_VEHICLE_VIEW, - WC_VEHICLE_DETAILS, - WC_VEHICLE_REFIT, - WC_VEHICLE_ORDERS, - WC_STATION_VIEW, - WC_VEHICLE_DEPOT, - WC_BUILD_VEHICLE, - WC_BUILD_BRIDGE, - WC_ERRMSG, - WC_BUILD_STATION, - WC_BUS_STATION, - WC_TRUCK_STATION, - WC_BUILD_DEPOT, - WC_COMPANY, - WC_FINANCES, - WC_PLAYER_COLOR, - WC_QUERY_STRING, - WC_SAVELOAD, - WC_SELECT_GAME, - WC_TOOLBAR_MENU, - WC_INCOME_GRAPH, - WC_OPERATING_PROFIT, - WC_TOOLTIPS, - WC_INDUSTRY_VIEW, - WC_PLAYER_FACE, - WC_LAND_INFO, - WC_TOWN_AUTHORITY, - WC_SUBSIDIES_LIST, - WC_GRAPH_LEGEND, - WC_DELIVERED_CARGO, - WC_PERFORMANCE_HISTORY, - WC_COMPANY_VALUE, - WC_COMPANY_LEAGUE, - WC_BUY_COMPANY, - WC_PAYMENT_RATES, - WC_ENGINE_PREVIEW, - WC_MUSIC_WINDOW, - WC_MUSIC_TRACK_SELECTION, - WC_SCEN_LAND_GEN, - WC_SCEN_TOWN_GEN, - WC_SCEN_INDUSTRY, - WC_SCEN_BUILD_ROAD, - WC_BUILD_TREES, - WC_SEND_NETWORK_MSG, - WC_DROPDOWN_MENU, - WC_BUILD_INDUSTRY, - WC_GAME_OPTIONS, - WC_NETWORK_WINDOW, - WC_INDUSTRY_DIRECTORY, - WC_MESSAGE_HISTORY, - WC_CHEATS, - WC_PERFORMANCE_DETAIL, - WC_CONSOLE, - WC_EXTRA_VIEW_PORT, - WC_CLIENT_LIST, - WC_NETWORK_STATUS_WINDOW, - WC_CUSTOM_CURRENCY, - WC_REPLACE_VEHICLE, - WC_HIGHSCORE, - WC_ENDSCREEN, - WC_SIGN_LIST, - WC_GENERATE_LANDSCAPE, - WC_GENERATE_PROGRESS_WINDOW, - WC_CONFIRM_POPUP_QUERY, - WC_TRANSPARENCY_TOOLBAR, - WC_VEHICLE_TIMETABLE, - WC_BUILD_SIGNAL, - WC_COMPANY_PASSWORD_WINDOW, -}; - enum ExpensesType { EXPENSES_CONSTRUCTION = 0, diff --git a/src/order_gui.cpp b/src/order_gui.cpp index 105ee842dd..80438ef7d7 100644 --- a/src/order_gui.cpp +++ b/src/order_gui.cpp @@ -12,7 +12,6 @@ #include "functions.h" #include "map.h" #include "tile.h" -#include "window.h" #include "gui.h" #include "gfx.h" #include "vehicle.h" diff --git a/src/player_gui.cpp b/src/player_gui.cpp index d296ed6d85..bec52e1a03 100644 --- a/src/player_gui.cpp +++ b/src/player_gui.cpp @@ -8,7 +8,6 @@ #include "table/strings.h" #include "strings.h" #include "functions.h" -#include "window.h" #include "gui.h" #include "viewport.h" #include "gfx.h" diff --git a/src/players.cpp b/src/players.cpp index 7f9b5ff7f8..9f6ce32fd9 100644 --- a/src/players.cpp +++ b/src/players.cpp @@ -25,10 +25,10 @@ #include "engine.h" #include "ai/ai.h" #include "date.h" -#include "window.h" #include "player_face.h" #include "group.h" #include "settings.h" +#include "window_func.h" /** * Sets the local player and updates the patch settings that are set on a diff --git a/src/rail_cmd.cpp b/src/rail_cmd.cpp index 15146f5e5d..bca945341f 100644 --- a/src/rail_cmd.cpp +++ b/src/rail_cmd.cpp @@ -29,7 +29,6 @@ #include "sprite.h" #include "depot.h" #include "waypoint.h" -#include "window.h" #include "rail.h" #include "railtypes.h" // include table for railtypes #include "newgrf.h" @@ -43,6 +42,7 @@ #include "transparency.h" #include "water.h" #include "tunnelbridge_map.h" +#include "window_func.h" const byte _track_sloped_sprites[14] = { diff --git a/src/rail_gui.cpp b/src/rail_gui.cpp index 2b48d7a23f..3dde487de3 100644 --- a/src/rail_gui.cpp +++ b/src/rail_gui.cpp @@ -12,7 +12,6 @@ #include "date.h" #include "map.h" #include "tile.h" -#include "window.h" #include "gui.h" #include "viewport.h" #include "gfx.h" diff --git a/src/road_cmd.cpp b/src/road_cmd.cpp index 26b016e7d1..e1c362a04b 100644 --- a/src/road_cmd.cpp +++ b/src/road_cmd.cpp @@ -15,7 +15,6 @@ #include "table/strings.h" #include "strings.h" #include "functions.h" -#include "window.h" #include "map.h" #include "landscape.h" #include "tile.h" @@ -36,6 +35,7 @@ #include "autoslope.h" #include "transparency.h" #include "tunnelbridge_map.h" +#include "window_func.h" #define M(x) (1 << (x)) diff --git a/src/road_gui.cpp b/src/road_gui.cpp index c6eeedf575..1204bf3148 100644 --- a/src/road_gui.cpp +++ b/src/road_gui.cpp @@ -10,7 +10,6 @@ #include "functions.h" #include "map.h" #include "tile.h" -#include "window.h" #include "gui.h" #include "viewport.h" #include "gfx.h" diff --git a/src/roadveh_gui.cpp b/src/roadveh_gui.cpp index 97aa325af8..86ca4e1426 100644 --- a/src/roadveh_gui.cpp +++ b/src/roadveh_gui.cpp @@ -9,7 +9,6 @@ #include "roadveh.h" #include "table/sprites.h" #include "table/strings.h" -#include "window.h" #include "gui.h" #include "strings.h" #include "vehicle.h" diff --git a/src/settings.cpp b/src/settings.cpp index 6e94cebea5..98be97da02 100644 --- a/src/settings.cpp +++ b/src/settings.cpp @@ -1085,7 +1085,6 @@ static void ini_save_setting_list(IniFile *ini, const char *grpname, char **list #include "table/strings.h" /* Begin - Callback Functions for the various settings */ -#include "window.h" #include "gui.h" #include "town.h" #include "gfx.h" diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp index f584e85410..14f82c59de 100644 --- a/src/settings_gui.cpp +++ b/src/settings_gui.cpp @@ -10,7 +10,6 @@ #include "strings.h" // XXX GetCurrentCurrencyRate() #include "table/sprites.h" #include "table/strings.h" -#include "window.h" #include "gui.h" #include "gfx.h" #include "command.h" diff --git a/src/signs_gui.cpp b/src/signs_gui.cpp index 0397ce49f3..d8d9a12ae3 100644 --- a/src/signs_gui.cpp +++ b/src/signs_gui.cpp @@ -7,7 +7,6 @@ #include "table/strings.h" #include "table/sprites.h" #include "functions.h" -#include "window.h" #include "gui.h" #include "gfx.h" #include "player.h" diff --git a/src/smallmap_gui.cpp b/src/smallmap_gui.cpp index 2208128b7a..3b6d469721 100644 --- a/src/smallmap_gui.cpp +++ b/src/smallmap_gui.cpp @@ -19,7 +19,6 @@ #include "gui.h" #include "tree_map.h" #include "tunnel_map.h" -#include "window.h" #include "gfx.h" #include "viewport.h" #include "player.h" diff --git a/src/sound.cpp b/src/sound.cpp index 312484c42b..0e8acfc3c7 100644 --- a/src/sound.cpp +++ b/src/sound.cpp @@ -10,12 +10,12 @@ #include "mixer.h" #include "sound.h" #include "vehicle.h" -#include "window.h" #include "viewport.h" #include "fileio.h" #include "newgrf_sound.h" #include "helpers.hpp" #include "fios.h" +#include "window_gui.h" static uint _file_count; static FileEntry *_files; diff --git a/src/station.cpp b/src/station.cpp index 2f69b1bac4..326521d8e7 100644 --- a/src/station.cpp +++ b/src/station.cpp @@ -14,7 +14,6 @@ #include "tile.h" #include "station.h" #include "gfx.h" -#include "window.h" #include "viewport.h" #include "command.h" #include "town.h" diff --git a/src/station_cmd.cpp b/src/station_cmd.cpp index 38a1af4947..3b64116fea 100644 --- a/src/station_cmd.cpp +++ b/src/station_cmd.cpp @@ -4,6 +4,7 @@ #include "stdafx.h" #include "openttd.h" +#include "string.h" #include "aircraft.h" #include "bridge_map.h" #include "cmd_helper.h" @@ -17,7 +18,6 @@ #include "tile.h" #include "station.h" #include "gfx.h" -#include "window.h" #include "viewport.h" #include "command.h" #include "town.h" diff --git a/src/station_gui.cpp b/src/station_gui.cpp index 9cc342830f..36c9948d76 100644 --- a/src/station_gui.cpp +++ b/src/station_gui.cpp @@ -8,7 +8,6 @@ #include "functions.h" #include "strings.h" #include "table/strings.h" -#include "window.h" #include "gui.h" #include "station.h" #include "gfx.h" diff --git a/src/subsidy_gui.cpp b/src/subsidy_gui.cpp index 0379ab29b7..91cfceb812 100644 --- a/src/subsidy_gui.cpp +++ b/src/subsidy_gui.cpp @@ -7,7 +7,6 @@ #include "table/strings.h" #include "strings.h" #include "functions.h" -#include "window.h" #include "station.h" #include "industry.h" #include "town.h" @@ -17,6 +16,7 @@ #include "variables.h" #include "date.h" #include "cargotype.h" +#include "window_gui.h" static void HandleSubsidyClick(int y) { diff --git a/src/terraform_gui.cpp b/src/terraform_gui.cpp index 115eb5de58..42f289e283 100644 --- a/src/terraform_gui.cpp +++ b/src/terraform_gui.cpp @@ -11,7 +11,6 @@ #include "functions.h" #include "player.h" #include "tile.h" -#include "window.h" #include "gui.h" #include "viewport.h" #include "gfx.h" diff --git a/src/timetable_gui.cpp b/src/timetable_gui.cpp index 4a3f919276..d18e881945 100644 --- a/src/timetable_gui.cpp +++ b/src/timetable_gui.cpp @@ -13,7 +13,6 @@ #include "engine.h" #include "gui.h" #include "string.h" -#include "window.h" #include "vehicle.h" #include "cargotype.h" #include "depot.h" diff --git a/src/town_gui.cpp b/src/town_gui.cpp index ebfd06278e..cdf6da8581 100644 --- a/src/town_gui.cpp +++ b/src/town_gui.cpp @@ -10,7 +10,6 @@ #include "table/sprites.h" #include "table/strings.h" #include "town.h" -#include "window.h" #include "gfx.h" #include "viewport.h" #include "gui.h" diff --git a/src/train_gui.cpp b/src/train_gui.cpp index 419e6bb267..7692b1e24b 100644 --- a/src/train_gui.cpp +++ b/src/train_gui.cpp @@ -9,7 +9,6 @@ #include "table/sprites.h" #include "table/strings.h" #include "strings.h" -#include "window.h" #include "gui.h" #include "vehicle.h" #include "viewport.h" diff --git a/src/transparency_gui.cpp b/src/transparency_gui.cpp index 1dd64a32e0..5b0fe21b11 100644 --- a/src/transparency_gui.cpp +++ b/src/transparency_gui.cpp @@ -5,7 +5,6 @@ #include "table/sprites.h" #include "table/strings.h" #include "functions.h" -#include "window.h" #include "gui.h" #include "viewport.h" #include "gfx.h" diff --git a/src/unix.cpp b/src/unix.cpp index 0dc98d63c6..521f513685 100644 --- a/src/unix.cpp +++ b/src/unix.cpp @@ -5,10 +5,10 @@ #include "stdafx.h" #include "openttd.h" #include "functions.h" -#include "window.h" #include "string.h" #include "table/strings.h" #include "variables.h" +#include "gui.h" #include #include diff --git a/src/vehicle.h b/src/vehicle.h index 0bc0fb0d97..48c507f152 100644 --- a/src/vehicle.h +++ b/src/vehicle.h @@ -10,6 +10,7 @@ #include "track_type.h" #include "rail_type.h" #include "road_type.h" +#include "window_type.h" #include "cargopacket.h" #include "texteff.hpp" diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp index 2aa2f193e0..629827d98b 100644 --- a/src/vehicle_gui.cpp +++ b/src/vehicle_gui.cpp @@ -12,7 +12,6 @@ #include "table/sprites.h" #include "table/strings.h" #include "vehicle.h" -#include "window.h" #include "engine.h" #include "gui.h" #include "command.h" diff --git a/src/vehicle_gui.h b/src/vehicle_gui.h index b9cfba174f..fe9235c045 100644 --- a/src/vehicle_gui.h +++ b/src/vehicle_gui.h @@ -5,7 +5,7 @@ #ifndef VEHICLE_GUI_H #define VEHICLE_GUI_H -#include "window.h" +#include "window_gui.h" #include "vehicle.h" void DrawVehicleProfitButton(const Vehicle *v, int x, int y); diff --git a/src/video/dedicated_v.cpp b/src/video/dedicated_v.cpp index 0d4afae5f6..f2d2aecabb 100644 --- a/src/video/dedicated_v.cpp +++ b/src/video/dedicated_v.cpp @@ -9,7 +9,6 @@ #include "../functions.h" #include "../gfx.h" #include "../network/network.h" -#include "../window.h" #include "../console.h" #include "../variables.h" #include "../genworld.h" diff --git a/src/video/null_v.cpp b/src/video/null_v.cpp index 81eed708c8..2250cbaf0d 100644 --- a/src/video/null_v.cpp +++ b/src/video/null_v.cpp @@ -4,7 +4,6 @@ #include "../openttd.h" #include "../gfx.h" #include "../variables.h" -#include "../window.h" #include "../debug.h" #include "../blitter/factory.hpp" #include "null_v.h" diff --git a/src/video/sdl_v.cpp b/src/video/sdl_v.cpp index c0cd58ef6f..e1130c3aed 100644 --- a/src/video/sdl_v.cpp +++ b/src/video/sdl_v.cpp @@ -10,8 +10,6 @@ #include "../gfx.h" #include "../macros.h" #include "../sdl.h" -#include "../window.h" -#include "../network/network.h" #include "../variables.h" #include "../blitter/factory.hpp" #include "sdl_v.h" diff --git a/src/video/win32_v.cpp b/src/video/win32_v.cpp index b742bbfd3c..0b8305a0df 100644 --- a/src/video/win32_v.cpp +++ b/src/video/win32_v.cpp @@ -5,10 +5,8 @@ #include "../functions.h" #include "../gfx.h" #include "../macros.h" -#include "../network/network.h" #include "../variables.h" #include "../win32.h" -#include "../window.h" #include "../blitter/factory.hpp" #include "win32_v.h" #include diff --git a/src/viewport.cpp b/src/viewport.cpp index aac54aeb36..1021a6cd94 100644 --- a/src/viewport.cpp +++ b/src/viewport.cpp @@ -14,7 +14,6 @@ #include "landscape.h" #include "map.h" #include "viewport.h" -#include "window.h" #include "vehicle.h" #include "station.h" #include "gfx.h" diff --git a/src/viewport.h b/src/viewport.h index b1bba7d4da..9cff8861d4 100644 --- a/src/viewport.h +++ b/src/viewport.h @@ -6,6 +6,7 @@ #define VIEWPORT_H #include "zoom.hpp" +#include "window_type.h" struct ViewPort { int left,top; // screen coordinates for the viewport diff --git a/src/widget.cpp b/src/widget.cpp index 59ab2433bc..a1a62d127e 100644 --- a/src/widget.cpp +++ b/src/widget.cpp @@ -8,9 +8,9 @@ #include "player.h" #include "table/sprites.h" #include "table/strings.h" -#include "window.h" #include "gfx.h" #include "viewport.h" +#include "window_gui.h" static Point HandleScrollbarHittest(const Scrollbar *sb, int top, int bottom) { diff --git a/src/win32.cpp b/src/win32.cpp index b1e143d4f1..98452773ae 100644 --- a/src/win32.cpp +++ b/src/win32.cpp @@ -11,7 +11,6 @@ #include "saveload.h" #include "string.h" #include "gfx.h" -#include "window.h" #include "fileio.h" #include #include diff --git a/src/window.cpp b/src/window.cpp index f5b9ac041a..5f05dfe892 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -9,7 +9,6 @@ #include "functions.h" #include "map.h" #include "player.h" -#include "window.h" #include "gfx.h" #include "viewport.h" #include "console.h" @@ -18,6 +17,7 @@ #include "genworld.h" #include "helpers.hpp" #include "blitter/factory.hpp" +#include "window_gui.h" /* delta between mouse cursor and upper left corner of dragged window */ static Point _drag_delta; diff --git a/src/window_func.h b/src/window_func.h new file mode 100644 index 0000000000..8f3e5ff1d6 --- /dev/null +++ b/src/window_func.h @@ -0,0 +1,40 @@ +/* $Id$ */ + +/** @file window.h Window functions not directly related to making/drawing windows. */ + +#ifndef WINDOW_FUNC_H +#define WINDOW_FUNC_H + +#include "window_type.h" + +/** + * Marks the window as dirty for repaint. + * + * @ingroup dirty + */ +void SetWindowDirty(const Window *w); +void SendWindowMessage(WindowClass wnd_class, WindowNumber wnd_num, int msg, int wparam, int lparam); +void SendWindowMessageClass(WindowClass wnd_class, int msg, int wparam, int lparam); + +Window *FindWindowById(WindowClass cls, WindowNumber number); +void DeleteWindow(Window *w); +void DeletePlayerWindows(PlayerID pi); +void ChangeWindowOwner(PlayerID old_player, PlayerID new_player); + +void ResizeWindow(Window *w, int x, int y); + +void InitWindowSystem(); +void UnInitWindowSystem(); +void ResetWindowSystem(); +void InputLoop(); +void InvalidateThisWindowData(Window *w); +void InvalidateWindowData(WindowClass cls, WindowNumber number); +void RelocateAllWindows(int neww, int newh); + +void DeleteNonVitalWindows(); +void DeleteAllNonVitalWindows(); +void HideVitalWindows(); +void ShowVitalWindows(); +Window **FindWindowZPosition(const Window *w); + +#endif /* WINDOW_FUNC_H */ diff --git a/src/window.h b/src/window_gui.h similarity index 99% rename from src/window.h rename to src/window_gui.h index 403b2268ee..b4f87661c0 100644 --- a/src/window.h +++ b/src/window_gui.h @@ -1,9 +1,9 @@ /* $Id$ */ -/** @file window.h regroups declarations for all windowing system, as well as a few helper functions */ +/** @file window_gui.h Functions, definitions and such used only by the GUI. */ -#ifndef WINDOW_H -#define WINDOW_H +#ifndef WINDOW_GUI_H +#define WINDOW_GUI_H #include "macros.h" #include "string.h" @@ -827,4 +827,4 @@ inline bool Window::IsWidgetLowered(byte widget_index) const return HasBit(this->widget[widget_index].display_flags, WIDG_LOWERED); } -#endif /* WINDOW_H */ +#endif /* WINDOW_GUI_H */ diff --git a/src/window_type.h b/src/window_type.h new file mode 100644 index 0000000000..bc8ee42b72 --- /dev/null +++ b/src/window_type.h @@ -0,0 +1,98 @@ +/* $Id$ */ + +/** @file window_type.h Types related to windows */ + +#ifndef WINDOW_TYPE_H +#define WINDOW_TYPE_H + +#include "core/enum_type.hpp" + +enum WindowClass { + WC_NONE, + WC_MAIN_WINDOW = WC_NONE, + WC_MAIN_TOOLBAR, + WC_STATUS_BAR, + WC_BUILD_TOOLBAR, + WC_NEWS_WINDOW, + WC_TOWN_DIRECTORY, + WC_STATION_LIST, + WC_TOWN_VIEW, + WC_SMALLMAP, + WC_TRAINS_LIST, + WC_ROADVEH_LIST, + WC_SHIPS_LIST, + WC_AIRCRAFT_LIST, + WC_VEHICLE_VIEW, + WC_VEHICLE_DETAILS, + WC_VEHICLE_REFIT, + WC_VEHICLE_ORDERS, + WC_STATION_VIEW, + WC_VEHICLE_DEPOT, + WC_BUILD_VEHICLE, + WC_BUILD_BRIDGE, + WC_ERRMSG, + WC_BUILD_STATION, + WC_BUS_STATION, + WC_TRUCK_STATION, + WC_BUILD_DEPOT, + WC_COMPANY, + WC_FINANCES, + WC_PLAYER_COLOR, + WC_QUERY_STRING, + WC_SAVELOAD, + WC_SELECT_GAME, + WC_TOOLBAR_MENU, + WC_INCOME_GRAPH, + WC_OPERATING_PROFIT, + WC_TOOLTIPS, + WC_INDUSTRY_VIEW, + WC_PLAYER_FACE, + WC_LAND_INFO, + WC_TOWN_AUTHORITY, + WC_SUBSIDIES_LIST, + WC_GRAPH_LEGEND, + WC_DELIVERED_CARGO, + WC_PERFORMANCE_HISTORY, + WC_COMPANY_VALUE, + WC_COMPANY_LEAGUE, + WC_BUY_COMPANY, + WC_PAYMENT_RATES, + WC_ENGINE_PREVIEW, + WC_MUSIC_WINDOW, + WC_MUSIC_TRACK_SELECTION, + WC_SCEN_LAND_GEN, + WC_SCEN_TOWN_GEN, + WC_SCEN_INDUSTRY, + WC_SCEN_BUILD_ROAD, + WC_BUILD_TREES, + WC_SEND_NETWORK_MSG, + WC_DROPDOWN_MENU, + WC_BUILD_INDUSTRY, + WC_GAME_OPTIONS, + WC_NETWORK_WINDOW, + WC_INDUSTRY_DIRECTORY, + WC_MESSAGE_HISTORY, + WC_CHEATS, + WC_PERFORMANCE_DETAIL, + WC_CONSOLE, + WC_EXTRA_VIEW_PORT, + WC_CLIENT_LIST, + WC_NETWORK_STATUS_WINDOW, + WC_CUSTOM_CURRENCY, + WC_REPLACE_VEHICLE, + WC_HIGHSCORE, + WC_ENDSCREEN, + WC_SIGN_LIST, + WC_GENERATE_LANDSCAPE, + WC_GENERATE_PROGRESS_WINDOW, + WC_CONFIRM_POPUP_QUERY, + WC_TRANSPARENCY_TOOLBAR, + WC_VEHICLE_TIMETABLE, + WC_BUILD_SIGNAL, + WC_COMPANY_PASSWORD_WINDOW, +}; + +struct Window; +typedef int32 WindowNumber; + +#endif /* WINDOW_TYPE_H */