(svn r13228) -Codechange: split console.h.

This commit is contained in:
rubidium 2008-05-24 10:15:06 +00:00
parent 0c47d3fc14
commit 6c20f77330
21 changed files with 107 additions and 44 deletions

View File

@ -876,7 +876,19 @@
>
</File>
<File
RelativePath=".\..\src\console.h"
RelativePath=".\..\src\console_func.h"
>
</File>
<File
RelativePath=".\..\src\console_gui.h"
>
</File>
<File
RelativePath=".\..\src\console_internal.h"
>
</File>
<File
RelativePath=".\..\src\console_type.h"
>
</File>
<File

View File

@ -873,7 +873,19 @@
>
</File>
<File
RelativePath=".\..\src\console.h"
RelativePath=".\..\src\console_func.h"
>
</File>
<File
RelativePath=".\..\src\console_gui.h"
>
</File>
<File
RelativePath=".\..\src\console_internal.h"
>
</File>
<File
RelativePath=".\..\src\console_type.h"
>
</File>
<File

View File

@ -144,7 +144,10 @@ cargotype.h
cmd_helper.h
command_func.h
command_type.h
console.h
console_func.h
console_gui.h
console_internal.h
console_type.h
cheat_func.h
cheat_type.h
currency.h

View File

@ -7,10 +7,11 @@
#include "gui.h"
#include "textbuf_gui.h"
#include "window_gui.h"
#include "console_gui.h"
#include "variables.h"
#include <stdarg.h>
#include <string.h>
#include "console.h"
#include "console_internal.h"
#include "network/network.h"
#include "network/network_data.h"
#include "network/network_server.h"

View File

@ -4,7 +4,7 @@
#include "stdafx.h"
#include "openttd.h"
#include "console.h"
#include "console_internal.h"
#include "debug.h"
#include "engine_func.h"
#include "landscape.h"

31
src/console_func.h Normal file
View File

@ -0,0 +1,31 @@
/* $Id$ */
/** @file console_func.h Console functions used outside of the console code. */
#ifndef CONSOLE_FUNC_H
#define CONSOLE_FUNC_H
#include "console_type.h"
/* console colors/modes */
extern byte _icolour_def;
extern byte _icolour_err;
extern byte _icolour_warn;
extern byte _icolour_dbg;
extern byte _icolour_cmd;
extern IConsoleModes _iconsole_mode;
/* console functions */
void IConsoleInit();
void IConsoleFree();
void IConsoleClose();
/* console output */
void IConsolePrint(uint16 color_code, const char *string);
void CDECL IConsolePrintF(uint16 color_code, const char *s, ...);
void IConsoleDebug(const char *dbg, const char *string);
/* Parser */
void IConsoleCmdExec(const char *cmdstr);
#endif /* CONSOLE_FUNC_H */

13
src/console_gui.h Normal file
View File

@ -0,0 +1,13 @@
/* $Id$ */
/** @file console_gui.h GUI related functions in the console. */
#ifndef CONSOLE_GUI_H
#define CONSOLE_GUI_H
#include "window_type.h"
void IConsoleResize(Window *w);
void IConsoleSwitch();
#endif /* CONSOLE_GUI_H */

View File

@ -1,11 +1,11 @@
/* $Id$ */
/** @file console.h In-game console. */
/** @file console_internal.h Internally used functions for the console. */
#ifndef CONSOLE_H
#define CONSOLE_H
#ifndef CONSOLE_INTERNAL_H
#define CONSOLE_INTERNAL_H
#include "window_type.h"
#include "console_func.h"
/* maximum length of a typed in command */
#define ICON_CMDLN_SIZE 255
@ -22,12 +22,6 @@ enum IConsoleVarTypes {
ICONSOLE_VAR_STRING
};
enum IConsoleModes {
ICONSOLE_FULL,
ICONSOLE_OPENED,
ICONSOLE_CLOSED
};
enum IConsoleHookTypes {
ICONSOLE_HOOK_ACCESS,
ICONSOLE_HOOK_PRE_ACTION,
@ -107,27 +101,11 @@ extern IConsoleCmd *_iconsole_cmds; ///< list of registred commands
extern IConsoleVar *_iconsole_vars; ///< list of registred vars
extern IConsoleAlias *_iconsole_aliases; ///< list of registred aliases
/* console colors/modes */
extern byte _icolour_def;
extern byte _icolour_err;
extern byte _icolour_warn;
extern byte _icolour_dbg;
extern byte _icolour_cmd;
extern IConsoleModes _iconsole_mode;
/* console functions */
void IConsoleInit();
void IConsoleFree();
void IConsoleClearBuffer();
void IConsoleResize(Window *w);
void IConsoleSwitch();
void IConsoleClose();
void IConsoleOpen();
/* console output */
void IConsolePrint(uint16 color_code, const char *string);
void CDECL IConsolePrintF(uint16 color_code, const char *s, ...);
void IConsoleDebug(const char *dbg, const char *string);
void IConsoleWarning(const char *string);
void IConsoleError(const char *string);
@ -145,7 +123,6 @@ void IConsoleVarPrintGetValue(const IConsoleVar *var);
void IConsoleVarPrintSetValue(const IConsoleVar *var);
/* Parser */
void IConsoleCmdExec(const char *cmdstr);
void IConsoleVarExec(const IConsoleVar *var, byte tokencount, char *token[]);
/* console std lib (register ingame commands/aliases/variables) */

14
src/console_type.h Normal file
View File

@ -0,0 +1,14 @@
/* $Id$ */
/** @file console_type.h Globally used console related types. */
#ifndef CONSOLE_TYPE_H
#define CONSOLE_TYPE_H
enum IConsoleModes {
ICONSOLE_FULL,
ICONSOLE_OPENED,
ICONSOLE_CLOSED
};
#endif /* CONSOLE_TYPE_H */

View File

@ -6,7 +6,7 @@
#include <stdio.h>
#include <stdarg.h>
#include "openttd.h"
#include "console.h"
#include "console_func.h"
#include "debug.h"
#include "string_func.h"
#include "network/core/core.h"

View File

@ -13,7 +13,7 @@
#include "viewport_func.h"
#include "command_func.h"
#include "news_gui.h"
#include "console.h"
#include "console_gui.h"
#include "waypoint.h"
#include "genworld.h"
#include "transparency_gui.h"

View File

@ -23,7 +23,7 @@
#include "core/tcp.h"
#include "core/core.h"
#include "network_gui.h"
#include "../console.h" /* IConsoleCmdExec */
#include "../console_func.h"
#include <stdarg.h> /* va_list */
#include "../md5.h"
#include "../fileio.h"

View File

@ -14,7 +14,7 @@
#include "network_gui.h"
#include "../saveload.h"
#include "../command_func.h"
#include "../console.h"
#include "../console_func.h"
#include "../variables.h"
#include "../ai/ai.h"
#include "../core/alloc_func.hpp"

View File

@ -15,7 +15,7 @@
#include "../date_func.h"
#include "network_server.h"
#include "network_udp.h"
#include "../console.h"
#include "../console_func.h"
#include "../command_func.h"
#include "../saveload.h"
#include "../station_base.h"

View File

@ -41,7 +41,7 @@
#include "fios.h"
#include "airport.h"
#include "aircraft.h"
#include "console.h"
#include "console_func.h"
#include "screenshot.h"
#include "network/network.h"
#include "signs_base.h"

View File

@ -28,7 +28,7 @@
#include "network/network_internal.h"
#include "settings_internal.h"
#include "command_func.h"
#include "console.h"
#include "console_func.h"
#include "saveload.h"
#include "npf.h"
#include "yapf/yapf.h"

View File

@ -6,7 +6,7 @@
#include "openttd.h"
#include "landscape.h"
#include "gfx_func.h"
#include "console.h"
#include "console_func.h"
#include "variables.h"
#include "blitter/factory.hpp"
#include "texteff.hpp"

View File

@ -10,7 +10,6 @@
#include "variables.h"
#include "void_map.h"
#include "tgp.h"
#include "console.h"
#include "genworld.h"
#include "core/alloc_func.hpp"
#include "core/random_func.hpp"

View File

@ -35,7 +35,7 @@
#include "signs_func.h"
#include "fios.h"
#include "functions.h"
#include "console.h"
#include "console_gui.h"
#include "news_gui.h"
#include "tilehighlight_func.h"

View File

@ -11,7 +11,7 @@
#include "../gfx_func.h"
#include "../network/network.h"
#include "../network/network_internal.h"
#include "../console.h"
#include "../console_func.h"
#include "../variables.h"
#include "../genworld.h"
#include "../fileio.h"

View File

@ -8,7 +8,8 @@
#include "debug.h"
#include "player_func.h"
#include "gfx_func.h"
#include "console.h"
#include "console_func.h"
#include "console_gui.h"
#include "viewport_func.h"
#include "variables.h"
#include "genworld.h"