Skip to content

Commit

Permalink
Header changes/cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
peterix committed Dec 31, 2011
1 parent 1284b30 commit 9db20bd
Show file tree
Hide file tree
Showing 137 changed files with 899 additions and 1,199 deletions.
88 changes: 44 additions & 44 deletions library/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,61 +13,60 @@ include_directories (include)
include_directories (depends/md5)
include_directories (depends/tinyxml)
include_directories (depends/tthread)
include_directories (private)

execute_process(COMMAND perl xml/list.pl xml include/dfhack/df ";"
execute_process(COMMAND perl xml/list.pl xml include/df ";"
WORKING_DIRECTORY ${dfapi_SOURCE_DIR}
OUTPUT_VARIABLE GENERATED_HDRS)

SET(PROJECT_HDRS_INTERNAL
private/ContextShared.h
private/Internal.h
private/wdirent.h
)

SET(PROJECT_HDRS
include/Internal.h
include/DFHack.h
include/dfhack/Console.h
include/dfhack/Core.h
include/dfhack/DataDefs.h
include/dfhack/Error.h
include/dfhack/Export.h
include/dfhack/FakeSDL.h
include/dfhack/MiscUtils.h
include/dfhack/Module.h
include/dfhack/Pragma.h
include/dfhack/Process.h
include/dfhack/TileTypes.h
include/dfhack/Types.h
include/dfhack/Vector.h
include/dfhack/VersionInfo.h
include/dfhack/VersionInfoFactory.h
include/dfhack/Virtual.h
include/dfhack/extra/MapExtras.h
include/dfhack/extra/stopwatch.h
include/dfhack/extra/termutil.h
include/dfhack/modules/Buildings.h
include/dfhack/modules/Constructions.h
include/dfhack/modules/Units.h
include/dfhack/modules/Engravings.h
include/dfhack/modules/Gui.h
include/dfhack/modules/Items.h
include/dfhack/modules/kitchen.h
include/dfhack/modules/Maps.h
include/dfhack/modules/Materials.h
include/dfhack/modules/Notes.h
include/dfhack/modules/Translation.h
include/dfhack/modules/Vegetation.h
include/dfhack/modules/Vermin.h
include/dfhack/modules/World.h
include/dfhack/modules/Graphic.h
include/Console.h
include/Core.h
include/DataDefs.h
include/Error.h
include/Export.h
include/Hooks.h
include/MiscUtils.h
include/Module.h
include/Pragma.h
include/MemAccess.h
include/SDL_events.h
include/SDL_keyboard.h
include/SDL_keysym.h
include/TileTypes.h
include/Types.h
include/Vector.h
include/VersionInfo.h
include/VersionInfoFactory.h
include/Virtual.h
include/modules/Buildings.h
include/modules/Constructions.h
include/modules/Units.h
include/modules/Engravings.h
include/modules/Gui.h
include/modules/Items.h
include/modules/kitchen.h
include/modules/Maps.h
include/modules/MapCache.h
include/modules/Materials.h
include/modules/Notes.h
include/modules/Translation.h
include/modules/Vegetation.h
include/modules/Vermin.h
include/modules/World.h
include/modules/Graphic.h
)

SET(PROJECT_SRCS
Core.cpp
DataDefs.cpp
DataStatics.cpp
DataStaticsCtor.cpp
MiscUtils.cpp
PluginManager.cpp
TileTypes.cpp
VersionInfo.cpp
Expand Down Expand Up @@ -105,17 +104,18 @@ SET(PROJECT_HDRS_LINUX
)

SET(PROJECT_HDRS_WINDOWS
include/wdirent.h
)

SET(PROJECT_SRCS_LINUX
Console-linux.cpp
FakeSDL-linux.cpp
Hooks-linux.cpp
Process-linux.cpp
)

SET(PROJECT_SRCS_WINDOWS
Console-windows.cpp
FakeSDL-windows.cpp
Hooks-windows.cpp
Process-windows.cpp
)

Expand All @@ -139,14 +139,14 @@ FILE(GLOB GENERATE_INPUT_SCRIPTS ${dfapi_SOURCE_DIR}/xml/*.pm ${dfapi_SOURCE_DIR
FILE(GLOB GENERATE_INPUT_XMLS ${dfapi_SOURCE_DIR}/xml/*.xml)

ADD_CUSTOM_COMMAND(
OUTPUT ${dfapi_SOURCE_DIR}/include/dfhack/df/static.inc
COMMAND perl xml/codegen.pl xml include/dfhack/df
OUTPUT ${dfapi_SOURCE_DIR}/include/df/static.inc
COMMAND perl xml/codegen.pl xml include/df
WORKING_DIRECTORY ${dfapi_SOURCE_DIR}
MAIN_DEPENDENCY ${dfapi_SOURCE_DIR}/xml/codegen.pl
DEPENDS ${GENERATE_INPUT_XMLS} ${GENERATE_INPUT_SCRIPTS}
)

ADD_CUSTOM_TARGET(generate_headers DEPENDS ${dfapi_SOURCE_DIR}/include/dfhack/df/static.inc)
ADD_CUSTOM_TARGET(generate_headers DEPENDS ${dfapi_SOURCE_DIR}/include/df/static.inc)

# Compilation

Expand Down
4 changes: 2 additions & 2 deletions library/Console-linux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <errno.h>
#include <deque>

#include "dfhack/Console.h"
#include "dfhack/FakeSDL.h"
#include "Console.h"
#include "Hooks.h"
using namespace DFHack;

#include "tinythread.h"
Expand Down
4 changes: 2 additions & 2 deletions library/Console-windows.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ POSSIBILITY OF SUCH DAMAGE.
#include <istream>
#include <string>

#include "dfhack/Console.h"
#include "dfhack/FakeSDL.h"
#include "Console.h"
#include "Hooks.h"
#include <cstdio>
#include <cstdlib>
#include <sstream>
Expand Down
36 changes: 18 additions & 18 deletions library/Core.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,28 +34,28 @@ distribution.
#include <sstream>
using namespace std;

#include "dfhack/Error.h"
#include "dfhack/Process.h"
#include "dfhack/Core.h"
#include "dfhack/DataDefs.h"
#include "dfhack/Console.h"
#include "dfhack/Module.h"
#include "dfhack/VersionInfoFactory.h"
#include "dfhack/VersionInfo.h"
#include "dfhack/PluginManager.h"
#include "Error.h"
#include "MemAccess.h"
#include "Core.h"
#include "DataDefs.h"
#include "Console.h"
#include "Module.h"
#include "VersionInfoFactory.h"
#include "VersionInfo.h"
#include "PluginManager.h"
#include "ModuleFactory.h"
#include "dfhack/modules/Gui.h"
#include "dfhack/modules/World.h"
#include "dfhack/modules/Graphic.h"
#include "modules/Gui.h"
#include "modules/World.h"
#include "modules/Graphic.h"
using namespace DFHack;

#include "dfhack/SDL_fakes/events.h"
#include "SDL_events.h"

#include "dfhack/df/ui.h"
#include "dfhack/df/world.h"
#include "dfhack/df/world_data.h"
#include "dfhack/df/interface.h"
#include "dfhack/df/viewscreen_dwarfmodest.h"
#include "df/ui.h"
#include "df/world.h"
#include "df/world_data.h"
#include "df/interface.h"
#include "df/viewscreen_dwarfmodest.h"

#include <stdio.h>
#include <iomanip>
Expand Down
8 changes: 4 additions & 4 deletions library/DataDefs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ distribution.
#include <vector>
#include <map>

#include "dfhack/Process.h"
#include "dfhack/Core.h"
#include "dfhack/VersionInfo.h"
#include "MemAccess.h"
#include "Core.h"
#include "VersionInfo.h"
#include "tinythread.h"
// must be last due to MS stupidity
#include "dfhack/DataDefs.h"
#include "DataDefs.h"

using namespace DFHack;

Expand Down
14 changes: 7 additions & 7 deletions library/DataStatics.cpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#include "Internal.h"
#include "dfhack/DataDefs.h"
#include "dfhack/MiscUtils.h"
#include "DataDefs.h"
#include "MiscUtils.h"

#include "dfhack/df/world.h"
#include "dfhack/df/world_data.h"
#include "dfhack/df/ui.h"
#include "df/world.h"
#include "df/world_data.h"
#include "df/ui.h"

namespace {
template<class T>
Expand All @@ -14,5 +14,5 @@ namespace {
}

// Instantiate all the static objects
#include "dfhack/df/static.inc"
#include "dfhack/df/static.enums.inc"
#include "df/static.inc"
#include "df/static.enums.inc"
6 changes: 3 additions & 3 deletions library/DataStaticsCtor.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "Internal.h"
#include "dfhack/DataDefs.h"
#include "dfhack/MiscUtils.h"
#include "DataDefs.h"
#include "MiscUtils.h"

// Object constructors
#include "dfhack/df/static.ctors.inc"
#include "df/static.ctors.inc"
4 changes: 2 additions & 2 deletions library/FakeSDL-linux.cpp → library/Hooks-linux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ distribution.
#include <map>

#include "DFHack.h"
#include "dfhack/Core.h"
#include "dfhack/FakeSDL.h"
#include "Core.h"
#include "Hooks.h"
#include <iostream>

/*
Expand Down
6 changes: 3 additions & 3 deletions library/FakeSDL-windows.cpp → library/Hooks-windows.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ distribution.
#include <stdint.h>
#include <vector>
#include <string>
#include "dfhack/Core.h"
#include "dfhack/FakeSDL.h"
#include "Core.h"
#include "Hooks.h"
#include <stdio.h>

#include "tinythread.h"
#include "dfhack/modules/Graphic.h"
#include "modules/Graphic.h"

/*
* Plugin loading functions
Expand Down
15 changes: 7 additions & 8 deletions library/PluginManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ distribution.
*/

#include "Internal.h"
#include "dfhack/Core.h"
#include "dfhack/Process.h"
#include "dfhack/PluginManager.h"
#include "dfhack/Console.h"
#include "Core.h"
#include "MemAccess.h"
#include "PluginManager.h"
#include "Console.h"

#include "dfhack/DataDefs.h"
#include "dfhack/df/viewscreen.h"
#include "DataDefs.h"
#include "df/viewscreen.h"

using namespace DFHack;

Expand Down Expand Up @@ -278,7 +278,6 @@ command_result Plugin::invoke( std::string & command, std::vector <std::string>
for (int i = 0; i < commands.size();i++)
{
PluginCommand &cmd = commands[i];

if(cmd.name == command)
{
// running interactive things from some other source than the console would break it
Expand All @@ -294,7 +293,7 @@ command_result Plugin::invoke( std::string & command, std::vector <std::string>
df::viewscreen *top = c.getTopViewscreen();

if ((cmd.viewscreen_type && !cmd.viewscreen_type->is_instance(top))
|| !cmd.guard(&c, top))
|| !cmd.guard(&c, top))
{
c.con.printerr("Could not invoke %s: unsuitable UI state.\n", command.c_str());
cr = CR_FAILURE;
Expand Down
8 changes: 4 additions & 4 deletions library/Process-linux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ distribution.
using namespace std;

#include <md5wrapper.h>
#include "dfhack/Process.h"
#include "dfhack/VersionInfoFactory.h"
#include "dfhack/VersionInfo.h"
#include "dfhack/Error.h"
#include "MemAccess.h"
#include "VersionInfoFactory.h"
#include "VersionInfo.h"
#include "Error.h"
#include <string.h>
using namespace DFHack;

Expand Down
8 changes: 4 additions & 4 deletions library/Process-windows.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,10 @@ extern "C" __declspec(dllimport) NTSTATUS __stdcall RtlDestroyQueryDebugBuffer(
#include <map>
using namespace std;

#include "dfhack/VersionInfo.h"
#include "dfhack/VersionInfoFactory.h"
#include "dfhack/Error.h"
#include "dfhack/Process.h"
#include "VersionInfo.h"
#include "VersionInfoFactory.h"
#include "Error.h"
#include "MemAccess.h"
using namespace DFHack;
namespace DFHack
{
Expand Down
4 changes: 2 additions & 2 deletions library/TileTypes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ distribution.
*/

#include "Internal.h"
#include "dfhack/TileTypes.h"
#include "dfhack/Export.h"
#include "TileTypes.h"
#include "Export.h"

namespace DFHack
{
Expand Down
6 changes: 3 additions & 3 deletions library/VersionInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ distribution.
#include <map>
using namespace std;

#include "dfhack/VersionInfo.h"
#include "dfhack/Error.h"
#include "dfhack/Process.h"
#include "VersionInfo.h"
#include "Error.h"
#include "MemAccess.h"
using namespace DFHack;

//Inital amount of space in levels vector (since we usually know the number, efficient!)
Expand Down
6 changes: 3 additions & 3 deletions library/VersionInfoFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ distribution.
#include <iostream>
using namespace std;

#include "dfhack/VersionInfoFactory.h"
#include "dfhack/VersionInfo.h"
#include "dfhack/Error.h"
#include "VersionInfoFactory.h"
#include "VersionInfo.h"
#include "Error.h"
using namespace DFHack;

#include <tinyxml.h>
Expand Down
Loading

0 comments on commit 9db20bd

Please sign in to comment.