Changeset - r8107:82461791b7a2
src/airport_gui.cpp
Show inline comments
 
/* $Id$ */
 

	
 
/** @file airport_gui.cpp */
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "table/sprites.h"
 
#include "table/strings.h"
 
#include "functions.h"
 
#include "map.h"
 
#include "window_gui.h"
 
#include "gui.h"
 
#include "station_gui.h"
 
#include "viewport.h"
 
#include "gfx.h"
 
#include "sound.h"
 
#include "command.h"
 
#include "vehicle.h"
 
#include "station.h"
 
#include "airport.h"
 
#include "depot.h"
 

	
 
static byte _selected_airport_type;
 

	
 
static void ShowBuildAirportPicker();
src/bridge_gui.cpp
Show inline comments
 
/* $Id$ */
 

	
 
/** @file bridge_gui.cpp Graphical user interface for bridge construction */
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "table/strings.h"
 
#include "strings.h"
 
#include "functions.h"
 
#include "map.h"
 
#include "gui.h"
 
#include "window_gui.h"
 
#include "viewport.h"
 
#include "gfx.h"
 
#include "command.h"
 
#include "sound.h"
 
#include "variables.h"
 
#include "bridge.h"
 

	
 
static struct BridgeData {
 
	uint8 last_size;
 
	uint count;
 
	TileIndex start_tile;
 
	TileIndex end_tile;
src/build_vehicle_gui.cpp
Show inline comments
 
@@ -7,24 +7,25 @@
 
#include "train.h"
 
#include "roadveh.h"
 
#include "ship.h"
 
#include "aircraft.h"
 
#include "debug.h"
 
#include "functions.h"
 
#include "table/sprites.h"
 
#include "table/strings.h"
 
#include "gui.h"
 
#include "vehicle.h"
 
#include "articulated_vehicles.h"
 
#include "gfx.h"
 
#include "textbuf_gui.h"
 
#include "station.h"
 
#include "command.h"
 
#include "engine.h"
 
#include "player.h"
 
#include "depot.h"
 
#include "airport.h"
 
#include "vehicle_gui.h"
 
#include "newgrf_engine.h"
 
#include "date.h"
 
#include "strings.h"
 
#include "cargotype.h"
 
#include "group.h"
src/command.cpp
Show inline comments
 
@@ -7,24 +7,25 @@
 
#include "table/strings.h"
 
#include "strings.h"
 
#include "functions.h"
 
#include "landscape.h"
 
#include "map.h"
 
#include "gui.h"
 
#include "command.h"
 
#include "player.h"
 
#include "network/network.h"
 
#include "variables.h"
 
#include "genworld.h"
 
#include "newgrf_storage.h"
 
#include "tile.h"
 

	
 
const char *_cmd_text = NULL;
 

	
 
/**
 
 * Helper macro to define the header of all command handler macros.
 
 *
 
 * This macro create the function header for a given command handler function, as
 
 * all command handler functions got the parameters from the #CommandProc callback
 
 * type.
 
 *
 
 * @param yyyy The desired function name of the new command handler function.
 
 */
src/console.cpp
Show inline comments
 
/* $Id$ */
 

	
 
/** @file console.cpp */
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "table/strings.h"
 
#include "functions.h"
 
#include "gui.h"
 
#include "textbuf_gui.h"
 
#include "window_gui.h"
 
#include "gfx.h"
 
#include "player.h"
 
#include "variables.h"
 
#include "string.h"
 
#include <stdarg.h>
 
#include <string.h>
 
#include "console.h"
 
#include "helpers.hpp"
 
#include "network/network.h"
 
#include "network/network_data.h"
 
#include "network/network_server.h"
 

	
src/depot_gui.cpp
Show inline comments
 
@@ -4,24 +4,25 @@
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "functions.h"
 
#include "train.h"
 
#include "roadveh.h"
 
#include "ship.h"
 
#include "aircraft.h"
 
#include "table/strings.h"
 
#include "strings.h"
 
#include "table/sprites.h"
 
#include "gui.h"
 
#include "textbuf_gui.h"
 
#include "gfx.h"
 
#include "vehicle.h"
 
#include "viewport.h"
 
#include "command.h"
 
#include "depot.h"
 
#include "vehicle_gui.h"
 
#include "station_map.h"
 
#include "newgrf_engine.h"
 
#include "spritecache.h"
 

	
 
/*
 
 * Since all depot window sizes aren't the same, we need to modify sizes a little.
src/dock_gui.cpp
Show inline comments
 
/* $Id$ */
 

	
 
/** @file dock_gui.cpp */
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "table/sprites.h"
 
#include "table/strings.h"
 
#include "functions.h"
 
#include "map.h"
 
#include "station.h"
 
#include "gui.h"
 
#include "window_gui.h"
 
#include "station_gui.h"
 
#include "viewport.h"
 
#include "gfx.h"
 
#include "sound.h"
 
#include "command.h"
 
#include "variables.h"
 
#include "water.h"
 

	
 
static void ShowBuildDockStationPicker();
 
static void ShowBuildDocksDepotPicker();
 

	
 
static Axis _ship_depot_direction;
 

	
src/engine_gui.cpp
Show inline comments
 
/* $Id$ */
 

	
 
/** @file engine_gui.cpp */
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "table/strings.h"
 
#include "strings.h"
 
#include "table/sprites.h"
 
#include "functions.h"
 
#include "gui.h"
 
#include "window_gui.h"
 
#include "viewport.h"
 
#include "gfx.h"
 
#include "engine.h"
 
#include "command.h"
 
#include "news.h"
 
#include "variables.h"
 
#include "newgrf_engine.h"
 

	
 

	
 
static StringID GetEngineCategoryName(EngineID engine)
 
{
 
	switch (GetEngine(engine)->type) {
src/genworld.cpp
Show inline comments
 
@@ -5,25 +5,25 @@
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "functions.h"
 
#include "landscape.h"
 
#include "player.h"
 
#include "table/sprites.h"
 
#include "variables.h"
 
#include "thread.h"
 
#include "command.h"
 
#include "genworld.h"
 
#include "gfx.h"
 
#include "gfxinit.h"
 
#include "gui.h"
 
#include "window_func.h"
 
#include "network/network.h"
 
#include "debug.h"
 
#include "settings.h"
 
#include "heightmap.h"
 
#include "date.h"
 
#include "viewport.h"
 

	
 
void GenerateClearTile();
 
void GenerateIndustries();
 
void GenerateUnmovables();
 
bool GenerateTowns();
 
void GenerateTrees();
src/genworld_gui.cpp
Show inline comments
 
/* $Id$ */
 

	
 
/** @file genworld_gui.cpp */
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "heightmap.h"
 
#include "functions.h"
 
#include "table/strings.h"
 
#include "table/sprites.h"
 
#include "gui.h"
 
#include "window_gui.h"
 
#include "textbuf_gui.h"
 
#include "gfx.h"
 
#include "tile.h"
 
#include "strings.h"
 
#include "gfxinit.h"
 
#include "player.h"
 
#include "command.h"
 
#include "sound.h"
 
#include "variables.h"
 
#include "string.h"
 
#include "settings.h"
 
#include "debug.h"
 
#include "genworld.h"
 
#include "network/network.h"
 
#include "thread.h"
src/graph_gui.cpp
Show inline comments
 
/* $Id$ */
 

	
 
/** @file graph_gui.cpp */
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "table/strings.h"
 
#include "strings.h"
 
#include "table/sprites.h"
 
#include "functions.h"
 
#include "gui.h"
 
#include "window_gui.h"
 
#include "gfx.h"
 
#include "player.h"
 
#include "economy.h"
 
#include "variables.h"
 
#include "date.h"
 
#include "helpers.hpp"
 
#include "cargotype.h"
 

	
 
/* Bitmasks of player and cargo indices that shouldn't be drawn. */
 
static uint _legend_excluded_players;
 
static uint _legend_excluded_cargo;
 

	
src/group_gui.cpp
Show inline comments
 
/* $Id$ */
 

	
 
/** @file group_gui.cpp */
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "functions.h"
 
#include "table/strings.h"
 
#include "table/sprites.h"
 
#include "gui.h"
 
#include "window_gui.h"
 
#include "textbuf_gui.h"
 
#include "gfx.h"
 
#include "vehicle.h"
 
#include "command.h"
 
#include "engine.h"
 
#include "vehicle_gui.h"
 
#include "depot.h"
 
#include "train.h"
 
#include "date.h"
 
#include "group.h"
 
#include "helpers.hpp"
 
#include "viewport.h"
 
#include "strings.h"
src/gui.h
Show inline comments
 
/* $Id$ */
 

	
 
/** @file gui.h */
 

	
 
#ifndef GUI_H
 
#define GUI_H
 

	
 
#include "station.h"
 
#include "window_gui.h"
 
#include "string.h"
 
#include "window_type.h"
 
#include "rail_type.h"
 
#include "road_type.h"
 
#include "vehicle.h"
 

	
 
/* main_gui.cpp */
 
void SetupColorsAndInitialWindow();
 
void CcPlaySound10(bool success, TileIndex tile, uint32 p1, uint32 p2);
 
void CcBuildCanal(bool success, TileIndex tile, uint32 p1, uint32 p2);
 
void CcTerraform(bool success, TileIndex tile, uint32 p1, uint32 p2);
 

	
 
/* settings_gui.cpp */
 
void ShowGameOptions();
 
void ShowGameDifficulty();
 
void ShowPatchesSelection();
 
void DrawArrowButtons(int x, int y, int ctab, byte state, bool clickable_left, bool clickable_right);
 

	
 
/* graph_gui.cpp */
 
void ShowOperatingProfitGraph();
 
@@ -97,66 +98,42 @@ void ShowAboutWindow();
 
void ShowBuildTreesToolbar();
 
void ShowBuildTreesScenToolbar();
 
void ShowTownDirectory();
 
void ShowIndustryDirectory();
 
void ShowSubsidiesList();
 
void ShowPlayerStations(PlayerID player);
 
void ShowPlayerFinances(PlayerID player);
 
void ShowPlayerCompany(PlayerID player);
 

	
 
void ShowEstimatedCostOrIncome(Money cost, int x, int y);
 
void ShowErrorMessage(StringID msg_1, StringID msg_2, int x, int y);
 

	
 
enum StationCoverageType {
 
	SCT_PASSENGERS_ONLY,
 
	SCT_NON_PASSENGERS_ONLY,
 
	SCT_ALL
 
};
 

	
 
void DrawStationCoverageAreaText(int sx, int sy, StationCoverageType sct, int rad);
 
void CheckRedrawStationCoverage(const Window *w);
 

	
 
void ShowSmallMap();
 
void ShowExtraViewPortWindow();
 
void SetVScrollCount(Window *w, int num);
 
void SetVScroll2Count(Window *w, int num);
 
void SetHScrollCount(Window *w, int num);
 

	
 
void ShowCheatWindow();
 

	
 
void DrawEditBox(Window *w, querystr_d *string, int wid);
 
void HandleEditBox(Window *w, querystr_d *string, int wid);
 
int HandleEditBoxKey(Window *w, querystr_d *string, int wid, WindowEvent *we);
 
bool HandleCaret(Textbuf *tb);
 

	
 
void DeleteTextBufferAll(Textbuf *tb);
 
bool DeleteTextBufferChar(Textbuf *tb, int delmode);
 
bool InsertTextBufferChar(Textbuf *tb, uint32 key);
 
bool InsertTextBufferClipboard(Textbuf *tb);
 
bool MoveTextBufferPos(Textbuf *tb, int navmode);
 
void InitializeTextBuffer(Textbuf *tb, const char *buf, uint16 maxlength, uint16 maxwidth);
 
void UpdateTextBufferSize(Textbuf *tb);
 

	
 
void BuildFileList();
 
void SetFiosType(const byte fiostype);
 

	
 
/* FIOS_TYPE_FILE, FIOS_TYPE_OLDFILE etc. different colours */
 
extern const TextColour _fios_colors[];
 

	
 
/* bridge_gui.cpp */
 
void ShowBuildBridgeWindow(uint start, uint end, byte type);
 

	
 
void ShowBuildIndustryWindow();
 
void ShowQueryString(StringID str, StringID caption, uint maxlen, uint maxwidth, Window *parent, CharSetFilter afilter);
 
void ShowQuery(StringID caption, StringID message, Window *w, void (*callback)(Window*, bool));
 
void ShowMusicWindow();
 

	
 
/* main_gui.cpp */
 
void HandleOnEditText(const char *str);
 
VARDEF bool _station_show_coverage;
 
VARDEF PlaceProc *_place_proc;
 

	
 
/* vehicle_gui.cpp */
 
void InitializeGUI();
 

	
 
void ShowPlayerGroup(PlayerID player, VehicleType veh);
 

	
src/industry_gui.cpp
Show inline comments
 
@@ -2,24 +2,26 @@
 

	
 
/** @file industry_gui.cpp */
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "debug.h"
 
#include "functions.h"
 
#include "strings.h"
 
#include "table/strings.h"
 
#include "table/sprites.h"
 
#include "map.h"
 
#include "gui.h"
 
#include "window_gui.h"
 
#include "textbuf_gui.h"
 
#include "gfx.h"
 
#include "command.h"
 
#include "viewport.h"
 
#include "industry.h"
 
#include "town.h"
 
#include "variables.h"
 
#include "helpers.hpp"
 
#include "cargotype.h"
 
#include "newgrf.h"
 
#include "newgrf_callbacks.h"
 
#include "newgrf_industries.h"
 
#include "newgrf_text.h"
src/intro_gui.cpp
Show inline comments
 
/* $Id$ */
 

	
 
/** @file intro_gui.cpp */
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "table/strings.h"
 
#include "strings.h"
 
#include "table/sprites.h"
 
#include "functions.h"
 
#include "gui.h"
 
#include "window_gui.h"
 
#include "textbuf_gui.h"
 
#include "gfx.h"
 
#include "player.h"
 
#include "network/network.h"
 
#include "variables.h"
 
#include "settings.h"
 
#include "heightmap.h"
 
#include "genworld.h"
 
#include "network/network_gui.h"
 
#include "newgrf.h"
 

	
 
static const Widget _select_game_widgets[] = {
 
{    WWT_CAPTION, RESIZE_NONE, 13,   0, 335,   0,  13, STR_0307_OPENTTD,         STR_NULL},
src/main_gui.cpp
Show inline comments
 
@@ -6,24 +6,27 @@
 
#include "openttd.h"
 
#include "heightmap.h"
 
#include "currency.h"
 
#include "functions.h"
 
#include "spritecache.h"
 
#include "station.h"
 
#include "strings.h"
 
#include "table/sprites.h"
 
#include "table/strings.h"
 
#include "map.h"
 
#include "tile.h"
 
#include "gui.h"
 
#include "window_gui.h"
 
#include "window_func.h"
 
#include "textbuf_gui.h"
 
#include "viewport.h"
 
#include "gfx.h"
 
#include "player.h"
 
#include "command.h"
 
#include "news.h"
 
#include "town.h"
 
#include "vehicle.h"
 
#include "console.h"
 
#include "sound.h"
 
#include "network/network.h"
 
#include "signs.h"
 
#include "waypoint.h"
src/misc_cmd.cpp
Show inline comments
 
@@ -2,24 +2,26 @@
 

	
 
/** @file misc_cmd.cpp */
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "functions.h"
 
#include "string.h"
 
#include "table/strings.h"
 
#include "command.h"
 
#include "player.h"
 
#include "gfx.h"
 
#include "gui.h"
 
#include "window_func.h"
 
#include "textbuf_gui.h"
 
#include "economy.h"
 
#include "network/network.h"
 
#include "variables.h"
 
#include "livery.h"
 
#include "player_face.h"
 
#include "strings.h"
 

	
 
/** Change the player's face.
 
 * @param tile unused
 
 * @param flags operation to perform
 
 * @param p1 unused
 
 * @param p2 face bitmasked
src/misc_gui.cpp
Show inline comments
 
@@ -9,24 +9,27 @@
 
#include "functions.h"
 
#include "landscape.h"
 
#include "newgrf.h"
 
#include "newgrf_text.h"
 
#include "saveload.h"
 
#include "strings.h"
 
#include "table/sprites.h"
 
#include "table/strings.h"
 
#include "strings.h"
 
#include "table/tree_land.h"
 
#include "map.h"
 
#include "gui.h"
 
#include "window_gui.h"
 
#include "station_gui.h"
 
#include "textbuf_gui.h"
 
#include "viewport.h"
 
#include "gfx.h"
 
#include "station.h"
 
#include "command.h"
 
#include "player.h"
 
#include "town.h"
 
#include "sound.h"
 
#include "network/network.h"
 
#include "string.h"
 
#include "variables.h"
 
#include "vehicle.h"
 
#include "train.h"
src/network/network_gui.cpp
Show inline comments
 
@@ -8,38 +8,45 @@
 
#include "../table/sprites.h"
 
#include "network.h"
 
#include "../date.h"
 

	
 
#include "../fios.h"
 
#include "table/strings.h"
 
#include "../functions.h"
 
#include "network_data.h"
 
#include "network_client.h"
 
#include "network_gui.h"
 
#include "network_gamelist.h"
 
#include "../gui.h"
 
#include "../window_gui.h"
 
#include "../textbuf_gui.h"
 
#include "../gfx.h"
 
#include "../command.h"
 
#include "../variables.h"
 
#include "network_server.h"
 
#include "network_udp.h"
 
#include "../settings.h"
 
#include "../string.h"
 
#include "../town.h"
 
#include "../newgrf.h"
 
#include "../helpers.hpp"
 

	
 
#define BGC 5
 
#define BTC 15
 

	
 
struct chatquerystr_d : public querystr_d {
 
	int dest;
 
};
 
assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(chatquerystr_d));
 

	
 
struct network_d {
 
	PlayerID company;        // select company in network lobby
 
	byte field;              // select text-field in start-server and game-listing
 
	byte widget_id;          ///< The widget that has the pop-up input menu
 
	NetworkGameList *server; // selected server in lobby and game-listing
 
	FiosItem *map;           // selected map in start-server
 
};
 
assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(network_d));
 

	
 
struct network_ql_d {
 
	network_d n;                 // see above; general stuff
 
	querystr_d q;                // text-input in start-server and game-listing
src/newgrf_gui.cpp
Show inline comments
 
/* $Id$ */
 

	
 
/** @file newgrf_gui.cpp */
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "functions.h"
 
#include "variables.h"
 
#include "gfx.h"
 
#include "gui.h"
 
#include "window_gui.h"
 
#include "textbuf_gui.h"
 
#include "table/strings.h"
 
#include "table/sprites.h"
 
#include "newgrf.h"
 
#include "newgrf_config.h"
 
#include "strings.h"
 
#include "helpers.hpp"
 

	
 
/** Parse an integerlist string and set each found value
 
 * @param p the string to be parsed. Each element in the list is seperated by a
 
 * comma or a space character
 
 * @param items pointer to the integerlist-array that will be filled with values
 
 * @param maxitems the maximum number of elements the integerlist-array has
src/news_gui.cpp
Show inline comments
 
/* $Id$ */
 

	
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "functions.h"
 
#include "strings.h"
 
#include "table/sprites.h"
 
#include "table/strings.h"
 
#include "gui.h"
 
#include "window_gui.h"
 
#include "viewport.h"
 
#include "gfx.h"
 
#include "news.h"
 
#include "vehicle.h"
 
#include "sound.h"
 
#include "variables.h"
 
#include "date.h"
 
#include "string.h"
 
#include "transparency.h"
 

	
 
/** @file news_gui.cpp
 
 *
src/openttd.cpp
Show inline comments
 
@@ -22,24 +22,25 @@
 
#include "spritecache.h"
 
#include "strings.h"
 
#include "gfx.h"
 
#include "gfxinit.h"
 
#include "gui.h"
 
#include "landscape.h"
 
#include "station.h"
 
#include "station_map.h"
 
#include "town_map.h"
 
#include "tunnel_map.h"
 
#include "vehicle.h"
 
#include "viewport.h"
 
#include "window_func.h"
 
#include "window_gui.h"
 
#include "player.h"
 
#include "command.h"
 
#include "town.h"
 
#include "industry.h"
 
#include "news.h"
 
#include "engine.h"
 
#include "sound.h"
 
#include "economy.h"
 
#include "fileio.h"
 
#include "airport.h"
 
#include "aircraft.h"
src/order_gui.cpp
Show inline comments
 
@@ -4,24 +4,25 @@
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "road_map.h"
 
#include "station_map.h"
 
#include "table/sprites.h"
 
#include "table/strings.h"
 
#include "strings.h"
 
#include "functions.h"
 
#include "map.h"
 
#include "tile.h"
 
#include "gui.h"
 
#include "window_gui.h"
 
#include "gfx.h"
 
#include "vehicle.h"
 
#include "station.h"
 
#include "town.h"
 
#include "command.h"
 
#include "viewport.h"
 
#include "depot.h"
 
#include "waypoint.h"
 
#include "train.h"
 
#include "water_map.h"
 
#include "vehicle_gui.h"
 
#include "timetable.h"
src/player_gui.cpp
Show inline comments
 
/* $Id$ */
 

	
 
/** @file player_gui.cpp */
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "table/sprites.h"
 
#include "table/strings.h"
 
#include "strings.h"
 
#include "functions.h"
 
#include "gui.h"
 
#include "window_gui.h"
 
#include "textbuf_gui.h"
 
#include "viewport.h"
 
#include "gfx.h"
 
#include "player.h"
 
#include "command.h"
 
#include "vehicle.h"
 
#include "economy.h"
 
#include "network/network.h"
 
#include "variables.h"
 
#include "roadveh.h"
 
#include "train.h"
 
#include "aircraft.h"
 
#include "date.h"
src/rail_gui.cpp
Show inline comments
 
@@ -4,24 +4,26 @@
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "table/sprites.h"
 
#include "table/strings.h"
 
#include "strings.h"
 
#include "functions.h"
 
#include "landscape.h"
 
#include "date.h"
 
#include "map.h"
 
#include "tile.h"
 
#include "gui.h"
 
#include "window_gui.h"
 
#include "station_gui.h"
 
#include "viewport.h"
 
#include "gfx.h"
 
#include "sound.h"
 
#include "command.h"
 
#include "vehicle.h"
 
#include "station.h"
 
#include "waypoint.h"
 
#include "debug.h"
 
#include "variables.h"
 
#include "newgrf_callbacks.h"
 
#include "newgrf_station.h"
 
#include "train.h"
src/road_gui.cpp
Show inline comments
 
@@ -2,24 +2,26 @@
 

	
 
/** @file road_gui.cpp */
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "table/sprites.h"
 
#include "table/strings.h"
 
#include "strings.h"
 
#include "functions.h"
 
#include "map.h"
 
#include "tile.h"
 
#include "gui.h"
 
#include "window_gui.h"
 
#include "station_gui.h"
 
#include "viewport.h"
 
#include "gfx.h"
 
#include "sound.h"
 
#include "command.h"
 
#include "variables.h"
 
#include "road_cmd.h"
 
#include "road_map.h"
 
#include "station_map.h"
 
//needed for catchments
 
#include "station.h"
 

	
 

	
src/roadveh_gui.cpp
Show inline comments
 
/* $Id$ */
 

	
 
/** @file roadveh_gui.cpp */
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "debug.h"
 
#include "functions.h"
 
#include "roadveh.h"
 
#include "table/sprites.h"
 
#include "table/strings.h"
 
#include "gui.h"
 
#include "window_gui.h"
 
#include "strings.h"
 
#include "vehicle.h"
 
#include "viewport.h"
 
#include "command.h"
 
#include "depot.h"
 
#include "vehicle_gui.h"
 
#include "newgrf_engine.h"
 

	
 

	
 
void DrawRoadVehDetails(const Vehicle *v, int x, int y)
 
{
 
	uint y_offset = RoadVehHasArticPart(v) ? 15 :0;
src/saveload.cpp
Show inline comments
 
@@ -18,24 +18,25 @@
 
#include "debug.h"
 
#include "functions.h"
 
#include "vehicle.h"
 
#include "station.h"
 
#include "thread.h"
 
#include "town.h"
 
#include "player.h"
 
#include "saveload.h"
 
#include "network/network.h"
 
#include "variables.h"
 
#include "table/strings.h"
 
#include "strings.h"
 
#include "window_func.h"
 
#include <list>
 

	
 
extern const uint16 SAVEGAME_VERSION = 83;
 
uint16 _sl_version;       ///< the major savegame version identifier
 
byte   _sl_minor_version; ///< the minor savegame version, DO NOT USE!
 

	
 
typedef void WriterProc(uint len);
 
typedef uint ReaderProc();
 

	
 
/** The saveload struct, containing reader-writer functions, bufffer, version, etc. */
 
static struct {
 
	bool save;                           ///< are we doing a save or a load atm. True when saving
src/settings.cpp
Show inline comments
 
@@ -35,24 +35,25 @@
 
#include "console.h"
 
#include "saveload.h"
 
#include "npf.h"
 
#include "yapf/yapf.h"
 
#include "newgrf.h"
 
#include "newgrf_config.h"
 
#include "genworld.h"
 
#include "date.h"
 
#include "rail.h"
 
#include "train.h"
 
#include "helpers.hpp"
 
#include "news.h"
 
#include "window_func.h"
 
#ifdef WITH_FREETYPE
 
#include "gfx.h"
 
#include "fontcache.h"
 
#endif
 
#include "spritecache.h"
 
#include "transparency.h"
 

	
 
/** The patch values that are used for new games and/or modified in config file */
 
Patches _patches_newgame;
 

	
 
struct IniFile;
 
struct IniItem;
src/settings_gui.cpp
Show inline comments
 
@@ -2,24 +2,26 @@
 

	
 
/** @file settings_gui.cpp */
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "currency.h"
 
#include "functions.h"
 
#include "string.h"
 
#include "strings.h" // XXX GetCurrentCurrencyRate()
 
#include "table/sprites.h"
 
#include "table/strings.h"
 
#include "gui.h"
 
#include "window_gui.h"
 
#include "textbuf_gui.h"
 
#include "gfx.h"
 
#include "command.h"
 
#include "engine.h"
 
#include "screenshot.h"
 
#include "newgrf.h"
 
#include "network/network.h"
 
#include "town.h"
 
#include "variables.h"
 
#include "settings.h"
 
#include "vehicle.h"
 
#include "date.h"
 
#include "helpers.hpp"
src/ship_gui.cpp
Show inline comments
 
@@ -2,24 +2,25 @@
 

	
 
/** @file ship_gui.cpp */
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "debug.h"
 
#include "functions.h"
 
#include "ship.h"
 
#include "table/strings.h"
 
#include "strings.h"
 
#include "table/sprites.h"
 
#include "gui.h"
 
#include "window_gui.h"
 
#include "vehicle.h"
 
#include "viewport.h"
 
#include "command.h"
 
#include "depot.h"
 
#include "vehicle_gui.h"
 
#include "newgrf_engine.h"
 

	
 
void DrawShipImage(const Vehicle *v, int x, int y, VehicleID selection)
 
{
 
	DrawSprite(v->GetImage(DIR_W), GetVehiclePalette(v), x + 32, y + 10);
 

	
 
	if (v->index == selection) {
src/signs_gui.cpp
Show inline comments
 
/* $Id$ */
 

	
 
/** @file signs_gui.cpp */
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "table/strings.h"
 
#include "table/sprites.h"
 
#include "functions.h"
 
#include "gui.h"
 
#include "textbuf_gui.h"
 
#include "window_gui.h"
 
#include "gfx.h"
 
#include "player.h"
 
#include "signs.h"
 
#include "strings.h"
 
#include "debug.h"
 
#include "variables.h"
 
#include "helpers.hpp"
 
#include "command.h"
 

	
 
static const Sign **_sign_sort;
 
static uint _num_sign_sort;
 

	
src/smallmap_gui.cpp
Show inline comments
 
@@ -8,24 +8,25 @@
 
#include "bridge_map.h"
 
#include "clear_map.h"
 
#include "industry_map.h"
 
#include "industry.h"
 
#include "station_map.h"
 
#include "table/strings.h"
 
#include "strings.h"
 
#include "table/sprites.h"
 
#include "landscape.h"
 
#include "map.h"
 
#include "tile.h"
 
#include "gui.h"
 
#include "window_gui.h"
 
#include "tree_map.h"
 
#include "tunnel_map.h"
 
#include "gfx.h"
 
#include "viewport.h"
 
#include "player.h"
 
#include "vehicle.h"
 
#include "town.h"
 
#include "sound.h"
 
#include "variables.h"
 
#include "blitter/factory.hpp"
 
#include "tunnelbridge_map.h"
 

	
src/station_gui.cpp
Show inline comments
 
/* $Id$ */
 

	
 
/** @file station_gui.cpp */
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "debug.h"
 
#include "functions.h"
 
#include "strings.h"
 
#include "table/strings.h"
 
#include "gui.h"
 
#include "window_gui.h"
 
#include "textbuf_gui.h"
 
#include "station.h"
 
#include "gfx.h"
 
#include "player.h"
 
#include "economy.h"
 
#include "town.h"
 
#include "command.h"
 
#include "variables.h"
 
#include "vehicle_gui.h"
 
#include "date.h"
 
#include "vehicle.h"
 
#include "table/sprites.h"
 
#include "helpers.hpp"
src/station_gui.h
Show inline comments
 
@@ -43,13 +43,22 @@ enum StationViewWidgets {
 
	SVW_ACCEPTS    =  8, ///< 'Accepts' button
 
	SVW_RENAME     =  9, ///< 'Rename' button
 
	SVW_TRAINS     = 10, ///< List of scheduled trains button
 
	SVW_ROADVEHS,        ///< List of scheduled road vehs button
 
	SVW_PLANES,          ///< List of scheduled planes button
 
	SVW_SHIPS,           ///< List of scheduled ships button
 
};
 

	
 
/* sorter stuff */
 
void RebuildStationLists();
 
void ResortStationLists();
 

	
 
enum StationCoverageType {
 
	SCT_PASSENGERS_ONLY,
 
	SCT_NON_PASSENGERS_ONLY,
 
	SCT_ALL
 
};
 

	
 
void DrawStationCoverageAreaText(int sx, int sy, StationCoverageType sct, int rad);
 
void CheckRedrawStationCoverage(const Window *w);
 

	
 
#endif /* STATION_GUI_H */
src/terraform_gui.cpp
Show inline comments
 
@@ -3,24 +3,25 @@
 
/** @file terraform_gui.cpp */
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "bridge_map.h"
 
#include "clear_map.h"
 
#include "table/sprites.h"
 
#include "table/strings.h"
 
#include "functions.h"
 
#include "player.h"
 
#include "tile.h"
 
#include "gui.h"
 
#include "window_gui.h"
 
#include "viewport.h"
 
#include "gfx.h"
 
#include "sound.h"
 
#include "command.h"
 
#include "vehicle.h"
 
#include "signs.h"
 
#include "variables.h"
 

	
 
void CcTerraform(bool success, TileIndex tile, uint32 p1, uint32 p2)
 
{
 
	if (success) {
 
		SndPlayTileFx(SND_1F_SPLAT, tile);
src/textbuf_gui.h
Show inline comments
 
new file 100644
 
/* $Id$ */
 

	
 
/** @file textbuf_gui.h Stuff related to the text buffer GUI. */
 

	
 
#ifndef TEXTBUF_GUI_H
 
#define TEXTBUF_GUI_H
 

	
 
#include "window_type.h"
 

	
 
struct Textbuf {
 
	char *buf;                  ///< buffer in which text is saved
 
	uint16 maxlength, maxwidth; ///< the maximum size of the buffer. Maxwidth specifies screensize in pixels, maxlength is in bytes
 
	uint16 length, width;       ///< the current size of the string. Width specifies screensize in pixels, length is in bytes
 
	bool caret;                 ///< is the caret ("_") visible or not
 
	uint16 caretpos;            ///< the current position of the caret in the buffer, in bytes
 
	uint16 caretxoffs;          ///< the current position of the caret in pixels
 
};
 

	
 
struct querystr_d {
 
	StringID caption;
 
	Textbuf text;
 
	const char *orig;
 
	CharSetFilter afilter;
 
	bool handled;
 
};
 
assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(querystr_d));
 

	
 

	
 
void DrawEditBox(Window *w, querystr_d *string, int wid);
 
void HandleEditBox(Window *w, querystr_d *string, int wid);
 
int HandleEditBoxKey(Window *w, querystr_d *string, int wid, WindowEvent *we);
 
bool HandleCaret(Textbuf *tb);
 

	
 
void DeleteTextBufferAll(Textbuf *tb);
 
bool DeleteTextBufferChar(Textbuf *tb, int delmode);
 
bool InsertTextBufferChar(Textbuf *tb, uint32 key);
 
bool InsertTextBufferClipboard(Textbuf *tb);
 
bool MoveTextBufferPos(Textbuf *tb, int navmode);
 
void InitializeTextBuffer(Textbuf *tb, const char *buf, uint16 maxlength, uint16 maxwidth);
 
void UpdateTextBufferSize(Textbuf *tb);
 

	
 
void ShowQueryString(StringID str, StringID caption, uint maxlen, uint maxwidth, Window *parent, CharSetFilter afilter);
 
void ShowQuery(StringID caption, StringID message, Window *w, void (*callback)(Window*, bool));
 

	
 
#endif /* TEXTBUF_GUI_H */
src/timetable_gui.cpp
Show inline comments
 
@@ -3,24 +3,26 @@
 
/** @file timetable_gui.cpp */
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "functions.h"
 
#include "variables.h"
 
#include "table/strings.h"
 
#include "strings.h"
 
#include "command.h"
 
#include "date.h"
 
#include "engine.h"
 
#include "gui.h"
 
#include "window_gui.h"
 
#include "textbuf_gui.h"
 
#include "string.h"
 
#include "vehicle.h"
 
#include "cargotype.h"
 
#include "depot.h"
 

	
 
static int GetOrderFromTimetableWndPt(Window *w, int y, const Vehicle *v)
 
{
 
	/*
 
	 * Calculation description:
 
	 * 15 = 14 (w->widget[ORDER_WIDGET_ORDER_LIST].top) + 1 (frame-line)
 
	 * 10 = order text hight
 
	 */
src/town_gui.cpp
Show inline comments
 
@@ -4,24 +4,26 @@
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "debug.h"
 
#include "functions.h"
 
#include "strings.h"
 
#include "table/sprites.h"
 
#include "table/strings.h"
 
#include "town.h"
 
#include "gfx.h"
 
#include "viewport.h"
 
#include "gui.h"
 
#include "window_gui.h"
 
#include "textbuf_gui.h"
 
#include "command.h"
 
#include "player.h"
 
#include "network/network.h"
 
#include "variables.h"
 
#include "helpers.hpp"
 

	
 
enum TownAuthorityWidget {
 
	TWA_CLOSEBOX = 0,
 
	TWA_CAPTION,
 
	TWA_RATING_INFO,
 
	TWA_COMMAND_LIST,
 
	TWA_SCROLLBAR,
src/train_gui.cpp
Show inline comments
 
/* $Id$ */
 

	
 
/** @file train_gui.cpp */
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "debug.h"
 
#include "functions.h"
 
#include "table/sprites.h"
 
#include "table/strings.h"
 
#include "strings.h"
 
#include "gui.h"
 
#include "window_gui.h"
 
#include "vehicle.h"
 
#include "viewport.h"
 
#include "command.h"
 
#include "vehicle_gui.h"
 
#include "depot.h"
 
#include "train.h"
 
#include "newgrf_engine.h"
 

	
 
void CcBuildWagon(bool success, TileIndex tile, uint32 p1, uint32 p2)
 
{
 
	Vehicle *v, *found;
 

	
src/transparency_gui.cpp
Show inline comments
 
/* $Id$ */
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "table/sprites.h"
 
#include "table/strings.h"
 
#include "functions.h"
 
#include "gui.h"
 
#include "window_gui.h"
 
#include "viewport.h"
 
#include "gfx.h"
 
#include "sound.h"
 
#include "variables.h"
 
#include "transparency.h"
 

	
 
TransparencyOptionBits _transparency_opt;
 

	
 
enum TransparencyToolbarWidgets{
 
	/* Widgets not toggled when pressing the X key */
 
	TTW_WIDGET_SIGNS = 3,    ///< Make signs background transparent
 

	
src/unix.cpp
Show inline comments
 
/* $Id$ */
 

	
 
/** @file unix.cpp */
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "functions.h"
 
#include "string.h"
 
#include "table/strings.h"
 
#include "variables.h"
 
#include "gui.h"
 
#include "textbuf_gui.h"
 

	
 
#include <dirent.h>
 
#include <unistd.h>
 
#include <sys/stat.h>
 
#include <time.h>
 
#include <signal.h>
 

	
 
#if (defined(_POSIX_VERSION) && _POSIX_VERSION >= 200112L) || defined(__GLIBC__)
 
	#define HAS_STATVFS
 
#endif
 

	
 
#ifdef HAS_STATVFS
src/vehicle_gui.cpp
Show inline comments
 
@@ -5,24 +5,26 @@
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "debug.h"
 
#include "functions.h"
 
#include "player.h"
 
#include "station.h"
 
#include "strings.h"
 
#include "table/sprites.h"
 
#include "table/strings.h"
 
#include "vehicle.h"
 
#include "engine.h"
 
#include "gui.h"
 
#include "window_gui.h"
 
#include "textbuf_gui.h"
 
#include "command.h"
 
#include "gfx.h"
 
#include "variables.h"
 
#include "vehicle_gui.h"
 
#include "viewport.h"
 
#include "train.h"
 
#include "newgrf_callbacks.h"
 
#include "newgrf_engine.h"
 
#include "newgrf_text.h"
 
#include "date.h"
 
#include "ship.h"
 
#include "aircraft.h"
src/win32.cpp
Show inline comments
 
@@ -2,24 +2,25 @@
 

	
 
/** @file win32.cpp Implementation of MS Windows system calls */
 

	
 
#include "stdafx.h"
 
#include "openttd.h"
 
#include "debug.h"
 
#include "functions.h"
 
#include "macros.h"
 
#include "helpers.hpp"
 
#include "saveload.h"
 
#include "string.h"
 
#include "gfx.h"
 
#include "textbuf_gui.h"
 
#include "fileio.h"
 
#include <windows.h>
 
#include <winnt.h>
 
#include <wininet.h>
 
#include <io.h>
 
#include <fcntl.h>
 
#include <shlobj.h> // SHGetFolderPath
 
#include "variables.h"
 
#include "win32.h"
 
#include "fios.h" // opendir/readdir/closedir
 
#include "fileio.h"
 
#include <ctype.h>
src/window_func.h
Show inline comments
 
@@ -13,28 +13,30 @@
 
 * @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);
 
int PositionMainToolbar(Window *w);
 

	
 
void InitWindowSystem();
 
void UnInitWindowSystem();
 
void ResetWindowSystem();
 
void SetupColorsAndInitialWindow();
 
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 */
src/window_gui.h
Show inline comments
 
@@ -10,26 +10,24 @@
 
#include "order.h"
 
#include "rail_type.h"
 
#include "road_type.h"
 
#include "airport.h"
 
#include "vehicle.h"
 
#include "viewport.h"
 

	
 
/**
 
 * The maximum number of windows that can be opened.
 
 */
 
static const int MAX_NUMBER_OF_WINDOWS = 25;
 

	
 
struct WindowEvent;
 

	
 
typedef void WindowProc(Window *w, WindowEvent *e);
 

	
 
/* How the resize system works:
 
    First, you need to add a WWT_RESIZEBOX to the widgets, and you need
 
     to add the flag WDF_RESIZABLE to the window. Now the window is ready
 
     to resize itself.
 
    As you may have noticed, all widgets have a RESIZE_XXX in their line.
 
     This lines controls how the widgets behave on resize. RESIZE_NONE means
 
     it doesn't do anything. Any other option let's one of the borders
 
     move with the changed width/height. So if a widget has
 
     RESIZE_RIGHT, and the window is made 5 pixels wider by the user,
 
     the right of the window will also be made 5 pixels wider.
 
@@ -219,38 +217,25 @@ enum WindowDefaultFlag {
 
	WDF_RESIZABLE       =   1 << 6, ///< A window can be resized
 
	WDF_MODAL           =   1 << 7, ///< The window is a modal child of some other window, meaning the parent is 'inactive'
 
};
 

	
 
/* can be used as x or y coordinates to cause a specific placement */
 
enum WindowDefaultPosition {
 
	WDP_AUTO      = -1, ///< Find a place automatically
 
	WDP_CENTER    = -2, ///< Center the window (left/right or top/bottom)
 
	WDP_ALIGN_TBR = -3, ///< Align the right side of the window with the right side of the main toolbar
 
	WDP_ALIGN_TBL = -4, ///< Align the left side of the window with the left side of the main toolbar
 
};
 

	
 
struct Textbuf {
 
	char *buf;                  ///< buffer in which text is saved
 
	uint16 maxlength, maxwidth; ///< the maximum size of the buffer. Maxwidth specifies screensize in pixels, maxlength is in bytes
 
	uint16 length, width;       ///< the current size of the string. Width specifies screensize in pixels, length is in bytes
 
	bool caret;                 ///< is the caret ("_") visible or not
 
	uint16 caretpos;            ///< the current position of the caret in the buffer, in bytes
 
	uint16 caretxoffs;          ///< the current position of the caret in pixels
 
};
 

	
 
#define WP(ptr, str) (*(str*)(ptr)->custom)
 
/* You cannot 100% reliably calculate the biggest custom struct as
 
 * the number of pointers in it and alignment will have a huge impact.
 
 * 96 is the largest window-size for 64-bit machines currently */
 
#define WINDOW_CUSTOM_SIZE 96
 

	
 
struct Scrollbar {
 
	uint16 count, cap, pos;
 
};
 

	
 
struct ResizeInfo {
 
	uint width; ///< Minimum width and height
 
	uint height;
 
	uint step_width; ///< In how big steps the width and height go
 
	uint step_height;
 
};
 

	
 
@@ -298,38 +283,24 @@ struct Window {
 
	void ToggleWidgetLoweredState(byte widget_index);
 
	void LowerWidget(byte widget_index);
 
	void RaiseWidget(byte widget_index);
 
	bool IsWidgetLowered(byte widget_index) const;
 

	
 
	void RaiseButtons();
 
	void CDECL SetWidgetsDisabledState(bool disab_stat, int widgets, ...);
 
	void CDECL SetWidgetsHiddenState(bool hidden_stat, int widgets, ...);
 
	void CDECL SetWidgetsLoweredState(bool lowered_stat, int widgets, ...);
 
	void InvalidateWidget(byte widget_index) const;
 
};
 

	
 
struct querystr_d {
 
	StringID caption;
 
	Textbuf text;
 
	const char *orig;
 
	CharSetFilter afilter;
 
	bool handled;
 
};
 
assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(querystr_d));
 

	
 
struct chatquerystr_d : public querystr_d {
 
	int dest;
 
};
 
assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(chatquerystr_d));
 

	
 
struct menu_d {
 
	byte item_count;      ///< follow_vehicle
 
	byte sel_index;       ///< scrollpos_x
 
	byte main_button;     ///< scrollpos_y
 
	byte action_id;
 
	StringID string_id;   ///< unk30
 
	uint16 checked_items; ///< unk32
 
	byte disabled_items;
 
};
 
assert_compile(WINDOW_CUSTOM_SIZE >= sizeof(menu_d));
 

	
 
struct def_d {
 
@@ -628,25 +599,24 @@ Window *AllocateWindowDescFront(const Wi
 

	
 
void DrawWindowViewport(const Window *w);
 
void ResizeWindow(Window *w, int x, int y);
 

	
 
void InitWindowSystem();
 
void UnInitWindowSystem();
 
void ResetWindowSystem();
 
int GetMenuItemIndex(const Window *w, int x, int y);
 
void InputLoop();
 
void InvalidateThisWindowData(Window *w);
 
void InvalidateWindowData(WindowClass cls, WindowNumber number);
 
void RelocateAllWindows(int neww, int newh);
 
int PositionMainToolbar(Window *w);
 

	
 
/* misc_gui.cpp */
 
void GuiShowTooltipsWithArgs(StringID str, uint paramcount, const uint64 params[]);
 
static inline void GuiShowTooltips(StringID str)
 
{
 
	GuiShowTooltipsWithArgs(str, 0, NULL);
 
}
 

	
 
/* widget.cpp */
 
int GetWidgetFromPos(const Window *w, int x, int y);
 
void DrawWindowWidgets(const Window *w);
 
void ShowDropDownMenu(Window *w, const StringID *strings, int selected, int button, uint32 disabled_mask, uint32 hidden_mask);
src/window_type.h
Show inline comments
 
@@ -84,15 +84,23 @@ enum WindowClass {
 
	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;
 
struct WindowEvent;
 
typedef int32 WindowNumber;
 

	
 
/**
 
 * You cannot 100% reliably calculate the biggest custom struct as
 
 * the number of pointers in it and alignment will have a huge impact.
 
 * 96 is the largest window-size for 64-bit machines currently.
 
 */
 
#define WINDOW_CUSTOM_SIZE 96
 

	
 
#endif /* WINDOW_TYPE_H */
0 comments (0 inline, 0 general)