Removed all boost::assign::list_of

This commit is contained in:
Tomas Jakobsson 2017-11-03 01:33:08 +01:00
parent c70acc88de
commit ac01e8fcd4
5 changed files with 203 additions and 214 deletions

View file

@ -6,72 +6,72 @@
#include "Settings.h" #include "Settings.h"
#include "SystemData.h" #include "SystemData.h"
#include "Util.h" #include "Util.h"
#include <boost/assign/list_of.hpp>
using namespace PlatformIds; using namespace PlatformIds;
const std::map<PlatformId, const char*> gamesdb_platformid_map = boost::assign::map_list_of const std::map<PlatformId, const char*> gamesdb_platformid_map {
(THREEDO, "3DO") { THREEDO, "3DO" },
(AMIGA, "Amiga") { AMIGA, "Amiga" },
(AMSTRAD_CPC, "Amstrad CPC") { AMSTRAD_CPC, "Amstrad CPC" },
// missing apple2 // missing apple2
(ARCADE, "Arcade") { ARCADE, "Arcade" },
// missing atari 800 // missing atari 800
(ATARI_2600, "Atari 2600") { ATARI_2600, "Atari 2600" },
(ATARI_5200, "Atari 5200") { ATARI_5200, "Atari 5200" },
(ATARI_7800, "Atari 7800") { ATARI_7800, "Atari 7800" },
(ATARI_JAGUAR, "Atari Jaguar") { ATARI_JAGUAR, "Atari Jaguar" },
(ATARI_JAGUAR_CD, "Atari Jaguar CD") { ATARI_JAGUAR_CD, "Atari Jaguar CD" },
(ATARI_LYNX, "Atari Lynx") { ATARI_LYNX, "Atari Lynx" },
// missing atari ST/STE/Falcon // missing atari ST/STE/Falcon
(ATARI_XE, "Atari XE") { ATARI_XE, "Atari XE" },
(COLECOVISION, "Colecovision") { COLECOVISION, "Colecovision" },
(COMMODORE_64, "Commodore 64") { COMMODORE_64, "Commodore 64" },
(INTELLIVISION, "Intellivision") { INTELLIVISION, "Intellivision" },
(MAC_OS, "Mac OS") { MAC_OS, "Mac OS" },
(XBOX, "Microsoft Xbox") { XBOX, "Microsoft Xbox" },
(XBOX_360, "Microsoft Xbox 360") { XBOX_360, "Microsoft Xbox 360" },
(MSX, "MSX") { MSX, "MSX" },
(NEOGEO, "Neo Geo") { NEOGEO, "Neo Geo" },
(NEOGEO_POCKET, "Neo Geo Pocket") { NEOGEO_POCKET, "Neo Geo Pocket" },
(NEOGEO_POCKET_COLOR, "Neo Geo Pocket Color") { NEOGEO_POCKET_COLOR, "Neo Geo Pocket Color" },
(NINTENDO_3DS, "Nintendo 3DS") { NINTENDO_3DS, "Nintendo 3DS" },
(NINTENDO_64, "Nintendo 64") { NINTENDO_64, "Nintendo 64" },
(NINTENDO_DS, "Nintendo DS") { NINTENDO_DS, "Nintendo DS" },
(FAMICOM_DISK_SYSTEM, "Famicom Disk System") { FAMICOM_DISK_SYSTEM, "Famicom Disk System" },
(NINTENDO_ENTERTAINMENT_SYSTEM, "Nintendo Entertainment System (NES)") { NINTENDO_ENTERTAINMENT_SYSTEM, "Nintendo Entertainment System { NES)" },
(GAME_BOY, "Nintendo Game Boy") { GAME_BOY, "Nintendo Game Boy" },
(GAME_BOY_ADVANCE, "Nintendo Game Boy Advance") { GAME_BOY_ADVANCE, "Nintendo Game Boy Advance" },
(GAME_BOY_COLOR, "Nintendo Game Boy Color") { GAME_BOY_COLOR, "Nintendo Game Boy Color" },
(NINTENDO_GAMECUBE, "Nintendo GameCube") { NINTENDO_GAMECUBE, "Nintendo GameCube" },
(NINTENDO_WII, "Nintendo Wii") { NINTENDO_WII, "Nintendo Wii" },
(NINTENDO_WII_U, "Nintendo Wii U") { NINTENDO_WII_U, "Nintendo Wii U" },
(NINTENDO_VIRTUAL_BOY, "Nintendo Virtual Boy") { NINTENDO_VIRTUAL_BOY, "Nintendo Virtual Boy" },
(NINTENDO_GAME_AND_WATCH, "Game & Watch") { NINTENDO_GAME_AND_WATCH, "Game & Watch" },
(PC, "PC") { PC, "PC" },
(SEGA_32X, "Sega 32X") { SEGA_32X, "Sega 32X" },
(SEGA_CD, "Sega CD") { SEGA_CD, "Sega CD" },
(SEGA_DREAMCAST, "Sega Dreamcast") { SEGA_DREAMCAST, "Sega Dreamcast" },
(SEGA_GAME_GEAR, "Sega Game Gear") { SEGA_GAME_GEAR, "Sega Game Gear" },
(SEGA_GENESIS, "Sega Genesis") { SEGA_GENESIS, "Sega Genesis" },
(SEGA_MASTER_SYSTEM, "Sega Master System") { SEGA_MASTER_SYSTEM, "Sega Master System" },
(SEGA_MEGA_DRIVE, "Sega Mega Drive") { SEGA_MEGA_DRIVE, "Sega Mega Drive" },
(SEGA_SATURN, "Sega Saturn") { SEGA_SATURN, "Sega Saturn" },
(SEGA_SG1000, "SEGA SG-1000") { SEGA_SG1000, "SEGA SG-1000" },
(PLAYSTATION, "Sony Playstation") { PLAYSTATION, "Sony Playstation" },
(PLAYSTATION_2, "Sony Playstation 2") { PLAYSTATION_2, "Sony Playstation 2" },
(PLAYSTATION_3, "Sony Playstation 3") { PLAYSTATION_3, "Sony Playstation 3" },
(PLAYSTATION_4, "Sony Playstation 4") { PLAYSTATION_4, "Sony Playstation 4" },
(PLAYSTATION_VITA, "Sony Playstation Vita") { PLAYSTATION_VITA, "Sony Playstation Vita" },
(PLAYSTATION_PORTABLE, "Sony Playstation Portable") { PLAYSTATION_PORTABLE, "Sony Playstation Portable" },
(SUPER_NINTENDO, "Super Nintendo (SNES)") { SUPER_NINTENDO, "Super Nintendo { SNES)" },
(TURBOGRAFX_16, "TurboGrafx 16") { TURBOGRAFX_16, "TurboGrafx 16" },
(WONDERSWAN, "WonderSwan") { WONDERSWAN, "WonderSwan" },
(WONDERSWAN_COLOR, "WonderSwan Color") { WONDERSWAN_COLOR, "WonderSwan Color" },
(ZX_SPECTRUM, "Sinclair ZX Spectrum") { ZX_SPECTRUM, "Sinclair ZX Spectrum" },
(VIDEOPAC_ODYSSEY2, "Magnavox Odyssey 2") { VIDEOPAC_ODYSSEY2, "Magnavox Odyssey 2" },
(VECTREX, "Vectrex") { VECTREX, "Vectrex" },
(TRS80_COLOR_COMPUTER, "TRS-80 Color Computer") { TRS80_COLOR_COMPUTER, "TRS-80 Color Computer" },
(TANDY, "TRS-80 Color Computer"); { TANDY, "TRS-80 Color Computer" }
};
void thegamesdb_generate_scraper_requests(const ScraperSearchParams& params, std::queue< std::unique_ptr<ScraperRequest> >& requests, void thegamesdb_generate_scraper_requests(const ScraperSearchParams& params, std::queue< std::unique_ptr<ScraperRequest> >& requests,
std::vector<ScraperSearchResult>& results) std::vector<ScraperSearchResult>& results)

View file

@ -6,13 +6,13 @@
#include "platform.h" #include "platform.h"
#include "Settings.h" #include "Settings.h"
#include "SystemData.h" #include "SystemData.h"
#include <boost/assign/list_of.hpp>
#include <boost/filesystem/operations.hpp> #include <boost/filesystem/operations.hpp>
#include <FreeImage.h> #include <FreeImage.h>
#include <fstream> #include <fstream>
const std::map<std::string, generate_scraper_requests_func> scraper_request_funcs = boost::assign::map_list_of const std::map<std::string, generate_scraper_requests_func> scraper_request_funcs {
("TheGamesDB", &thegamesdb_generate_scraper_requests); { "TheGamesDB", &thegamesdb_generate_scraper_requests }
};
std::unique_ptr<ScraperSearchHandle> startScraperSearch(const ScraperSearchParams& params) std::unique_ptr<ScraperSearchHandle> startScraperSearch(const ScraperSearchParams& params)
{ {

View file

@ -2,7 +2,6 @@
#include "Log.h" #include "Log.h"
#include "platform.h" #include "platform.h"
#include <boost/assign/list_of.hpp>
#include <boost/filesystem/operations.hpp> #include <boost/filesystem/operations.hpp>
#include <pugixml/src/pugixml.hpp> #include <pugixml/src/pugixml.hpp>
@ -10,18 +9,19 @@ Settings* Settings::sInstance = NULL;
// these values are NOT saved to es_settings.xml // these values are NOT saved to es_settings.xml
// since they're set through command-line arguments, and not the in-program settings menu // since they're set through command-line arguments, and not the in-program settings menu
std::vector<const char*> settings_dont_save = boost::assign::list_of std::vector<const char*> settings_dont_save {
("Debug") { "Debug" },
("DebugGrid") { "DebugGrid" },
("DebugText") { "DebugText" },
("ForceKid") { "ForceKid" },
("ForceKiosk") { "ForceKiosk" },
("IgnoreGamelist") { "IgnoreGamelist" },
("HideConsole") { "HideConsole" },
("ShowExit") { "ShowExit" },
("SplashScreen") { "SplashScreen" },
("VSync") { "VSync" },
("Windowed"); { "Windowed" }
};
Settings::Settings() Settings::Settings()
{ {

View file

@ -5,134 +5,123 @@
#include "Log.h" #include "Log.h"
#include "platform.h" #include "platform.h"
#include "Settings.h" #include "Settings.h"
#include <boost/assign/list_of.hpp>
#include <boost/filesystem/operations.hpp> #include <boost/filesystem/operations.hpp>
#include <boost/xpressive/xpressive_static.hpp> #include <boost/xpressive/xpressive_static.hpp>
// This is a work around for some ambiguity that is introduced in C++11 that boost::assign::map_list_of leave open. std::vector<std::string> ThemeData::sSupportedViews { { "system" }, { "basic" }, { "detailed" }, { "video" } };
// We use makeMap(actualmap) to implicitly convert the boost::assign::map_list_of's return type to ElementMapType. std::vector<std::string> ThemeData::sSupportedFeatures { { "video" }, { "carousel" }, { "z-index" } };
// Problem exists with gcc 4.7 and Boost 1.51. Works fine with MSVC2010 without this hack.
typedef std::map<std::string, ThemeData::ElementPropertyType> ElementMapType;
template<typename T>
ElementMapType makeMap(const T& mapInit)
{
ElementMapType m = mapInit;
return m;
}
std::vector<std::string> ThemeData::sSupportedViews = boost::assign::list_of("system")("basic")("detailed")("video"); std::map<std::string, std::map<std::string, ThemeData::ElementPropertyType>> ThemeData::sElementMap {
std::vector<std::string> ThemeData::sSupportedFeatures = boost::assign::list_of("video")("carousel")("z-index"); { "image", {
{ "pos", NORMALIZED_PAIR },
std::map< std::string, ElementMapType > ThemeData::sElementMap = boost::assign::map_list_of { "size", NORMALIZED_PAIR },
("image", makeMap(boost::assign::map_list_of { "maxSize", NORMALIZED_PAIR },
("pos", NORMALIZED_PAIR) { "origin", NORMALIZED_PAIR },
("size", NORMALIZED_PAIR) { "rotation", FLOAT },
("maxSize", NORMALIZED_PAIR) { "rotationOrigin", NORMALIZED_PAIR },
("origin", NORMALIZED_PAIR) { "path", PATH },
("rotation", FLOAT) { "default", PATH },
("rotationOrigin", NORMALIZED_PAIR) { "tile", BOOLEAN },
("path", PATH) { "color", COLOR },
("default", PATH) { "zIndex", FLOAT } } },
("tile", BOOLEAN) { "text", {
("color", COLOR) { "pos", NORMALIZED_PAIR },
("zIndex", FLOAT))) { "size", NORMALIZED_PAIR },
("text", makeMap(boost::assign::map_list_of { "origin", NORMALIZED_PAIR },
("pos", NORMALIZED_PAIR) { "rotation", FLOAT },
("size", NORMALIZED_PAIR) { "rotationOrigin", NORMALIZED_PAIR },
("origin", NORMALIZED_PAIR) { "text", STRING },
("rotation", FLOAT) { "backgroundColor", COLOR },
("rotationOrigin", NORMALIZED_PAIR) { "fontPath", PATH },
("text", STRING) { "fontSize", FLOAT },
("backgroundColor", COLOR) { "color", COLOR },
("fontPath", PATH) { "alignment", STRING },
("fontSize", FLOAT) { "forceUppercase", BOOLEAN },
("color", COLOR) { "lineSpacing", FLOAT },
("alignment", STRING) { "value", STRING },
("forceUppercase", BOOLEAN) { "zIndex", FLOAT } } },
("lineSpacing", FLOAT) { "textlist", {
("value", STRING) { "pos", NORMALIZED_PAIR },
("zIndex", FLOAT))) { "size", NORMALIZED_PAIR },
("textlist", makeMap(boost::assign::map_list_of { "origin", NORMALIZED_PAIR },
("pos", NORMALIZED_PAIR) { "selectorHeight", FLOAT },
("size", NORMALIZED_PAIR) { "selectorOffsetY", FLOAT },
("origin", NORMALIZED_PAIR) { "selectorColor", COLOR },
("selectorHeight", FLOAT) { "selectorImagePath", PATH },
("selectorOffsetY", FLOAT) { "selectorImageTile", BOOLEAN },
("selectorColor", COLOR) { "selectedColor", COLOR },
("selectorImagePath", PATH) { "primaryColor", COLOR },
("selectorImageTile", BOOLEAN) { "secondaryColor", COLOR },
("selectedColor", COLOR) { "fontPath", PATH },
("primaryColor", COLOR) { "fontSize", FLOAT },
("secondaryColor", COLOR) { "scrollSound", PATH },
("fontPath", PATH) { "alignment", STRING },
("fontSize", FLOAT) { "horizontalMargin", FLOAT },
("scrollSound", PATH) { "forceUppercase", BOOLEAN },
("alignment", STRING) { "lineSpacing", FLOAT },
("horizontalMargin", FLOAT) { "zIndex", FLOAT } } },
("forceUppercase", BOOLEAN) { "container", {
("lineSpacing", FLOAT) { "pos", NORMALIZED_PAIR },
("zIndex", FLOAT))) { "size", NORMALIZED_PAIR },
("container", makeMap(boost::assign::map_list_of { "origin", NORMALIZED_PAIR },
("pos", NORMALIZED_PAIR) { "zIndex", FLOAT } } },
("size", NORMALIZED_PAIR) { "ninepatch", {
("origin", NORMALIZED_PAIR) { "pos", NORMALIZED_PAIR },
("zIndex", FLOAT))) { "size", NORMALIZED_PAIR },
("ninepatch", makeMap(boost::assign::map_list_of { "path", PATH },
("pos", NORMALIZED_PAIR) { "zIndex", FLOAT } } },
("size", NORMALIZED_PAIR) { "datetime", {
("path", PATH) { "pos", NORMALIZED_PAIR },
("zIndex", FLOAT))) { "size", NORMALIZED_PAIR },
("datetime", makeMap(boost::assign::map_list_of { "color", COLOR },
("pos", NORMALIZED_PAIR) { "fontPath", PATH },
("size", NORMALIZED_PAIR) { "fontSize", FLOAT },
("color", COLOR) { "forceUppercase", BOOLEAN },
("fontPath", PATH) { "zIndex", FLOAT } } },
("fontSize", FLOAT) { "rating", {
("forceUppercase", BOOLEAN) { "pos", NORMALIZED_PAIR },
("zIndex", FLOAT))) { "size", NORMALIZED_PAIR },
("rating", makeMap(boost::assign::map_list_of { "origin", NORMALIZED_PAIR },
("pos", NORMALIZED_PAIR) { "rotation", FLOAT },
("size", NORMALIZED_PAIR) { "rotationOrigin", NORMALIZED_PAIR },
("origin", NORMALIZED_PAIR) { "color", COLOR },
("rotation", FLOAT) { "filledPath", PATH },
("rotationOrigin", NORMALIZED_PAIR) { "unfilledPath", PATH },
("color", COLOR) { "zIndex", FLOAT } } },
("filledPath", PATH) { "sound", {
("unfilledPath", PATH) { "path", PATH } } },
("zIndex", FLOAT))) { "helpsystem", {
("sound", makeMap(boost::assign::map_list_of { "pos", NORMALIZED_PAIR },
("path", PATH))) { "textColor", COLOR },
("helpsystem", makeMap(boost::assign::map_list_of { "iconColor", COLOR },
("pos", NORMALIZED_PAIR) { "fontPath", PATH },
("textColor", COLOR) { "fontSize", FLOAT } } },
("iconColor", COLOR) { "video", {
("fontPath", PATH) { "pos", NORMALIZED_PAIR },
("fontSize", FLOAT))) { "size", NORMALIZED_PAIR },
("video", makeMap(boost::assign::map_list_of { "maxSize", NORMALIZED_PAIR },
("pos", NORMALIZED_PAIR) { "origin", NORMALIZED_PAIR },
("size", NORMALIZED_PAIR) { "rotation", FLOAT },
("maxSize", NORMALIZED_PAIR) { "rotationOrigin", NORMALIZED_PAIR },
("origin", NORMALIZED_PAIR) { "default", PATH },
("rotation", FLOAT) { "delay", FLOAT },
("rotationOrigin", NORMALIZED_PAIR) { "zIndex", FLOAT },
("default", PATH) { "showSnapshotNoVideo", BOOLEAN },
("delay", FLOAT) { "showSnapshotDelay", BOOLEAN } } },
("zIndex", FLOAT) { "carousel", {
("showSnapshotNoVideo", BOOLEAN) { "type", STRING },
("showSnapshotDelay", BOOLEAN))) { "size", NORMALIZED_PAIR },
("carousel", makeMap(boost::assign::map_list_of { "pos", NORMALIZED_PAIR },
("type", STRING) { "origin", NORMALIZED_PAIR },
("size", NORMALIZED_PAIR) { "color", COLOR },
("pos", NORMALIZED_PAIR) { "logoScale", FLOAT },
("origin", NORMALIZED_PAIR) { "logoRotation", FLOAT },
("color", COLOR) { "logoRotationOrigin", NORMALIZED_PAIR },
("logoScale", FLOAT) { "logoSize", NORMALIZED_PAIR },
("logoRotation", FLOAT) { "logoAlignment", STRING },
("logoRotationOrigin", NORMALIZED_PAIR) { "maxLogoCount", FLOAT },
("logoSize", NORMALIZED_PAIR) { "zIndex", FLOAT } } }
("logoAlignment", STRING) };
("maxLogoCount", FLOAT)
("zIndex", FLOAT)));
namespace fs = boost::filesystem; namespace fs = boost::filesystem;

View file

@ -7,7 +7,6 @@
#include "Log.h" #include "Log.h"
#include "Settings.h" #include "Settings.h"
#include "Util.h" #include "Util.h"
#include <boost/assign/list_of.hpp>
#define OFFSET_X 12 // move the entire thing right by this amount (px) #define OFFSET_X 12 // move the entire thing right by this amount (px)
#define OFFSET_Y 12 // move the entire thing up by this amount (px) #define OFFSET_Y 12 // move the entire thing up by this amount (px)
@ -15,18 +14,19 @@
#define ICON_TEXT_SPACING 8 // space between [icon] and [text] (px) #define ICON_TEXT_SPACING 8 // space between [icon] and [text] (px)
#define ENTRY_SPACING 16 // space between [text] and next [icon] (px) #define ENTRY_SPACING 16 // space between [text] and next [icon] (px)
static const std::map<std::string, const char*> ICON_PATH_MAP = boost::assign::map_list_of static const std::map<std::string, const char*> ICON_PATH_MAP {
("up/down", ":/help/dpad_updown.svg") { "up/down", ":/help/dpad_updown.svg" },
("left/right", ":/help/dpad_leftright.svg") { "left/right", ":/help/dpad_leftright.svg" },
("up/down/left/right", ":/help/dpad_all.svg") { "up/down/left/right", ":/help/dpad_all.svg" },
("a", ":/help/button_a.svg") { "a", ":/help/button_a.svg" },
("b", ":/help/button_b.svg") { "b", ":/help/button_b.svg" },
("x", ":/help/button_x.svg") { "x", ":/help/button_x.svg" },
("y", ":/help/button_y.svg") { "y", ":/help/button_y.svg" },
("l", ":/help/button_l.svg") { "l", ":/help/button_l.svg" },
("r", ":/help/button_r.svg") { "r", ":/help/button_r.svg" },
("start", ":/help/button_start.svg") { "start", ":/help/button_start.svg" },
("select", ":/help/button_select.svg"); { "select", ":/help/button_select.svg" }
};
HelpComponent::HelpComponent(Window* window) : GuiComponent(window) HelpComponent::HelpComponent(Window* window) : GuiComponent(window)
{ {