1
0
forked from mirrors/0ad

Add missing ScriptInterface includes to

JSInterface_L10n.cpp from d6db5a466d,
JSInterface_Renderer.cpp and JSInterface_GUITypes.cpp from 4b1297b328,
JSInterface_VisualReplay.cpp from b830233498,
JSInterface_Game.cpp from 5f8be8e0c6,
JSInterface_Simulation.cpp from 921c5515a6,
JSInterface_Debug.cpp from d6cb9c845b,
JSInterface_Main.cpp from 486aec18d4, refs #4772,
JSInterface_Mod.cpp where it was incorrectly removed in af03c72f76.

Refs D1470.
Sort includes alphabetically, add recent Coding Convention macro
comments.

This was SVN commit r21789.
This commit is contained in:
elexis
2018-04-27 16:48:44 +00:00
parent 7ecd1d2c34
commit 13e1702777
33 changed files with 69 additions and 62 deletions
@@ -1,4 +1,4 @@
/* Copyright (C) 2017 Wildfire Games.
/* Copyright (C) 2018 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@@ -15,12 +15,11 @@
* along with 0 A.D. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef INCLUDED_JSINTERFACE_GAMEVIEW
#define INCLUDED_JSINTERFACE_GAMEVIEW
#include "scriptinterface/ScriptInterface.h"
#include "maths/FixedVector3D.h"
#include "scriptinterface/ScriptInterface.h"
#include "simulation2/helpers/Position.h"
#include "simulation2/system/Entity.h"
@@ -50,4 +49,4 @@ namespace JSI_GameView
#undef DECLARE_BOOLEAN_SCRIPT_SETTING
#endif
#endif // INCLUDED_JSINTERFACE_GAMEVIEW
@@ -1,4 +1,4 @@
/* Copyright (C) 2017 Wildfire Games.
/* Copyright (C) 2018 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@@ -21,8 +21,8 @@
#include "gui/GUIManager.h"
#include "gui/IGUIObject.h"
#include "scriptinterface/ScriptInterface.h"
#include "ps/GameSetup/Config.h"
#include "scriptinterface/ScriptInterface.h"
// Note that the initData argument may only contain clonable data.
// Functions aren't supported for example!
@@ -1,4 +1,4 @@
/* Copyright (C) 2017 Wildfire Games.
/* Copyright (C) 2018 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@@ -36,4 +36,4 @@ namespace JSI_GUIManager
void RegisterScriptFunctions(const ScriptInterface& scriptInterface);
}
#endif
#endif // INCLUDED_JSI_GUIMANAGER
@@ -1,4 +1,4 @@
/* Copyright (C) 2017 Wildfire Games.
/* Copyright (C) 2018 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@@ -18,7 +18,9 @@
#include "precompiled.h"
#include "JSInterface_GUITypes.h"
#include "ps/CStr.h"
#include "scriptinterface/ScriptInterface.h"
/**** GUISize ****/
JSClass JSI_GUISize::JSI_class = {
+4 -4
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 2017 Wildfire Games.
/* Copyright (C) 2018 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@@ -15,11 +15,11 @@
* along with 0 A.D. If not, see <http://www.gnu.org/licenses/>.
*/
#include "scriptinterface/ScriptInterface.h"
#ifndef INCLUDED_JSI_GUITYPES
#define INCLUDED_JSI_GUITYPES
#include "scriptinterface/ScriptInterface.h"
#define GUISTDTYPE(x) \
namespace JSI_GUI##x \
{ \
@@ -41,4 +41,4 @@ namespace JSI_GUITypes
void init(ScriptInterface& scriptInterface);
}
#endif
#endif // INCLUDED_JSI_GUITYPES
@@ -1,4 +1,4 @@
/* Copyright (C) 2017 Wildfire Games.
/* Copyright (C) 2018 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@@ -15,11 +15,11 @@
* along with 0 A.D. If not, see <http://www.gnu.org/licenses/>.
*/
#include "scriptinterface/ScriptInterface.h"
#ifndef INCLUDED_JSI_IGUIOBJECT
#define INCLUDED_JSI_IGUIOBJECT
#include "scriptinterface/ScriptInterface.h"
namespace JSI_IGUIObject
{
extern JSClass JSI_class;
@@ -35,4 +35,4 @@ namespace JSI_IGUIObject
void init(ScriptInterface& scriptInterface);
}
#endif
#endif // INCLUDED_JSI_IGUIOBJECT
+2 -1
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 2017 Wildfire Games.
/* Copyright (C) 2018 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@@ -22,6 +22,7 @@
#include "i18n/L10n.h"
#include "lib/utf8.h"
#include "ps/Profile.h"
#include "scriptinterface/ScriptInterface.h"
// Returns a translation of the specified English string into the current language.
std::wstring JSI_L10n::Translate(ScriptInterface::CxPrivate* UNUSED(pCxPrivate), const std::wstring& sourceString)
+3 -3
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 2017 Wildfire Games.
/* Copyright (C) 2018 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@@ -18,8 +18,8 @@
#ifndef INCLUDED_JSINTERFACE_L10N
#define INCLUDED_JSINTERFACE_L10N
#include "scriptinterface/ScriptInterface.h"
#include "lib/external_libraries/icu.h"
#include "scriptinterface/ScriptInterface.h"
/**
* Namespace for the functions of the JavaScript interface for
@@ -452,4 +452,4 @@ namespace JSI_L10n
void ReevaluateCurrentLocaleAndReload(ScriptInterface::CxPrivate* UNUSED(pCxPrivate));
}
#endif
#endif // INCLUDED_JSINTERFACE_L10N
+1 -1
View File
@@ -68,4 +68,4 @@ namespace JSI_Lobby
#endif // CONFIG2_LOBBY
}
#endif
#endif // INCLUDED_JSI_LOBBY
@@ -17,7 +17,7 @@
#include "precompiled.h"
#include "network/scripting/JSInterface_Network.h"
#include "JSInterface_Network.h"
#include "lib/external_libraries/enet.h"
#include "lib/external_libraries/libsdl.h"
@@ -28,6 +28,7 @@
#include "network/StunClient.h"
#include "ps/CLogger.h"
#include "ps/Game.h"
#include "scriptinterface/ScriptInterface.h"
u16 JSI_Network::GetDefaultPort(ScriptInterface::CxPrivate* UNUSED(pCxPrivate))
{
@@ -44,4 +44,4 @@ namespace JSI_Network
void RegisterScriptFunctions(const ScriptInterface& scriptInterface);
}
#endif
#endif // INCLUDED_JSI_NETWORK
+1
View File
@@ -27,6 +27,7 @@
#include "ps/Filesystem.h"
#include "ps/GameSetup/GameSetup.h"
#include "ps/GameSetup/Paths.h"
#include "scriptinterface/ScriptInterface.h"
std::vector<CStr> g_modsLoaded;
+3 -3
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 2017 Wildfire Games.
/* Copyright (C) 2018 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@@ -18,8 +18,8 @@
#ifndef INCLUDED_JSI_CONFIGDB
#define INCLUDED_JSI_CONFIGDB
#include "scriptinterface/ScriptInterface.h"
#include "ps/ConfigDB.h"
#include "scriptinterface/ScriptInterface.h"
namespace JSI_ConfigDB
{
@@ -36,4 +36,4 @@ namespace JSI_ConfigDB
void RegisterScriptFunctions(const ScriptInterface& scriptInterface);
}
#endif
#endif // INCLUDED_JSI_CONFIGDB
+2 -2
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 2017 Wildfire Games.
/* Copyright (C) 2018 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@@ -29,4 +29,4 @@ namespace JSI_Console
void RegisterScriptFunctions(const ScriptInterface& scriptInterface);
}
#endif
#endif // INCLUDED_JSI_CONSOLE
@@ -26,6 +26,7 @@
#include "ps/Profile.h"
#include "ps/ProfileViewer.h"
#include "ps/UserReport.h"
#include "scriptinterface/ScriptInterface.h"
/**
* Microseconds since the epoch.
+2 -2
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 2017 Wildfire Games.
/* Copyright (C) 2018 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@@ -36,4 +36,4 @@ namespace JSI_Debug
void RegisterScriptFunctions(const ScriptInterface& ScriptInterface);
}
#endif
#endif // INCLUDED_JSI_DEBUG
+2 -1
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 2017 Wildfire Games.
/* Copyright (C) 2018 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@@ -26,6 +26,7 @@
#include "ps/Game.h"
#include "ps/Replay.h"
#include "ps/World.h"
#include "scriptinterface/ScriptInterface.h"
#include "simulation2/system/TurnManager.h"
#include "simulation2/Simulation2.h"
#include "soundmanager/SoundManager.h"
+2 -2
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 2017 Wildfire Games.
/* Copyright (C) 2018 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@@ -40,4 +40,4 @@ namespace JSI_Game
void RegisterScriptFunctions(const ScriptInterface& ScriptInterface);
}
#endif
#endif // INCLUDED_JSI_GAME
+2 -1
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 2017 Wildfire Games.
/* Copyright (C) 2018 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@@ -28,6 +28,7 @@
#include "ps/GameSetup/Atlas.h"
#include "ps/Globals.h"
#include "ps/Hotkey.h"
#include "scriptinterface/ScriptInterface.h"
#include "tools/atlas/GameInterface/GameLoop.h"
extern void restart_mainloop_in_atlas();
+1 -1
View File
@@ -37,4 +37,4 @@ namespace JSI_Main
void RegisterScriptFunctions(const ScriptInterface& scriptInterface);
}
#endif
#endif // INCLUDED_JSI_MAIN
+1
View File
@@ -20,6 +20,7 @@
#include "JSInterface_Mod.h"
#include "ps/Mod.h"
#include "scriptinterface/ScriptInterface.h"
extern void restart_engine();
@@ -17,13 +17,14 @@
#include "precompiled.h"
#include "ps/scripting/JSInterface_SavedGame.h"
#include "JSInterface_SavedGame.h"
#include "network/NetClient.h"
#include "network/NetServer.h"
#include "ps/CLogger.h"
#include "ps/Game.h"
#include "ps/SavedGame.h"
#include "scriptinterface/ScriptInterface.h"
#include "simulation2/Simulation2.h"
#include "simulation2/system/TurnManager.h"
+1 -1
View File
@@ -33,4 +33,4 @@ namespace JSI_SavedGame
void RegisterScriptFunctions(const ScriptInterface& scriptInterface);
}
#endif
#endif // INCLUDED_JSI_SAVEDGAME
+5 -4
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 2017 Wildfire Games.
/* Copyright (C) 2018 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@@ -17,15 +17,16 @@
#include "precompiled.h"
#include <sstream>
#include "JSInterface_VFS.h"
#include "lib/file/vfs/vfs_util.h"
#include "ps/CLogger.h"
#include "ps/CStr.h"
#include "ps/Filesystem.h"
#include "scriptinterface/ScriptVal.h"
#include "scriptinterface/ScriptInterface.h"
#include "ps/scripting/JSInterface_VFS.h"
#include "lib/file/vfs/vfs_util.h"
#include <sstream>
// Only allow engine compartments to read files they may be concerned about.
#define PathRestriction_GUI {L""}
+2 -8
View File
@@ -1,4 +1,4 @@
/* Copyright (C) 2017 Wildfire Games.
/* Copyright (C) 2018 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@@ -15,17 +15,11 @@
* along with 0 A.D. If not, see <http://www.gnu.org/licenses/>.
*/
// JSInterface_VFS.h
//
// The JavaScript wrapper around useful snippets of the VFS
#ifndef INCLUDED_JSI_VFS
#define INCLUDED_JSI_VFS
#include "scriptinterface/ScriptInterface.h"
// these are registered in ScriptFunctions.cpp, hence the need for a header.
namespace JSI_VFS
{
// Return an array of pathname strings, one for each matching entry in the
@@ -61,4 +55,4 @@ namespace JSI_VFS
void RegisterScriptFunctions_Maps(const ScriptInterface& scriptInterface);
}
#endif
#endif // INCLUDED_JSI_VFS
@@ -1,4 +1,4 @@
/* Copyright (C) 2017 Wildfire Games.
/* Copyright (C) 2018 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@@ -17,11 +17,12 @@
#include "precompiled.h"
#include "ps/scripting/JSInterface_VisualReplay.h"
#include "JSInterface_VisualReplay.h"
#include "ps/CStr.h"
#include "ps/Profile.h"
#include "ps/VisualReplay.h"
#include "scriptinterface/ScriptInterface.h"
bool JSI_VisualReplay::StartVisualReplay(ScriptInterface::CxPrivate* UNUSED(pCxPrivate), const CStrW& directory)
{
@@ -33,4 +33,4 @@ namespace JSI_VisualReplay
CStrW GetReplayDirectoryName(ScriptInterface::CxPrivate* pCxPrivate, const CStrW& directoryName);
}
#endif
#endif // INCLUDED_JSI_VISUALREPLAY
@@ -1,4 +1,4 @@
/* Copyright (C) 2017 Wildfire Games.
/* Copyright (C) 2018 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@@ -18,9 +18,11 @@
#include "precompiled.h"
#include "JSInterface_Renderer.h"
#include "ps/Profile.h"
#include "renderer/Renderer.h"
#include "renderer/ShadowMap.h"
#include "scriptinterface/ScriptInterface.h"
#define IMPLEMENT_BOOLEAN_SCRIPT_SETTING(NAME, SCRIPTNAME) \
bool JSI_Renderer::Get##SCRIPTNAME##Enabled(ScriptInterface::CxPrivate* UNUSED(pCxPrivate)) \
@@ -1,4 +1,4 @@
/* Copyright (C) 2017 Wildfire Games.
/* Copyright (C) 2018 Wildfire Games.
* This file is part of 0 A.D.
*
* 0 A.D. is free software: you can redistribute it and/or modify
@@ -15,7 +15,6 @@
* along with 0 A.D. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef INCLUDED_JSINTERFACE_RENDERER
#define INCLUDED_JSINTERFACE_RENDERER
@@ -53,4 +52,4 @@ namespace JSI_Renderer
#undef DECLARE_BOOLEAN_SCRIPT_SETTING
#endif
#endif // INCLUDED_JSINTERFACE_RENDERER
@@ -17,14 +17,13 @@
#include "precompiled.h"
#include <fstream>
#include "JSInterface_Simulation.h"
#include "graphics/GameView.h"
#include "ps/Game.h"
#include "ps/GameSetup/Config.h"
#include "ps/Pyrogenesis.h"
#include "scriptinterface/ScriptInterface.h"
#include "simulation2/Simulation2.h"
#include "simulation2/system/Entity.h"
#include "simulation2/components/ICmpAIManager.h"
@@ -33,6 +32,8 @@
#include "simulation2/components/ICmpSelectable.h"
#include "simulation2/helpers/Selection.h"
#include <fstream>
JS::Value JSI_Simulation::GetInitAttributes(ScriptInterface::CxPrivate* pCxPrivate)
{
if (!g_Game)
@@ -38,4 +38,4 @@ namespace JSI_Simulation
void RegisterScriptFunctions(const ScriptInterface& ScriptInterface);
}
#endif
#endif // INCLUDED_JSI_SIMULATION
@@ -15,7 +15,6 @@
* along with 0 A.D. If not, see <http://www.gnu.org/licenses/>.
*/
#include "precompiled.h"
#include "scriptinterface/ScriptInterface.h"
#include "JSInterface_Sound.h"
@@ -24,6 +23,7 @@
#include "maths/Vector3D.h"
#include "ps/Filesystem.h"
#include "ps/Profile.h"
#include "scriptinterface/ScriptInterface.h"
#include "soundmanager/SoundManager.h"
#include <sstream>
@@ -26,4 +26,4 @@ namespace JSI_Sound
void RegisterScriptFunctions(const ScriptInterface& scriptInterface);
}
#endif // #ifndef INCLUDED_SOUNDSCRIPTINTERFACE
#endif // INCLUDED_SOUNDSCRIPTINTERFACE