Fix build

This involves splitting standard colors out of font/constants.cpp.
Serialization/string_utils.cpp, that is part of wesnothlib
(compiled into both client and server) uses ellipsis and Unicode minus sign
from font constants, which means that font/constants.cpp must be part of
wesnothlib as well. However, one of standard colors is evaluated by calling
inverse(const SDL_Color&) declared in sdl/utils.hpp. Sdl/utils.cpp has way
too many dependencies to live in wesnothlib.

Hence, standard colors are now in a file of their own:
font/standard_colors.cpp. That file is part of wesnoth (not wesnothlib) and
only available for the client.
This commit is contained in:
Jyrki Vesterinen 2016-10-16 18:34:22 +03:00
parent dd165091ff
commit 5e2af01fba
46 changed files with 100 additions and 40 deletions

View file

@ -220,6 +220,7 @@ set(libwesnoth-core_STAT_SRC
config.cpp
filesystem_boost.cpp
filesystem_common.cpp
font/constants.cpp
game_config.cpp
hash.cpp
log.cpp
@ -985,10 +986,10 @@ set(libwesnoth-game_STAT_SRC
display_context.cpp
events.cpp
floating_label.cpp
font/constants.cpp
font/font_config.cpp
font/marked-up_text.cpp
font/sdl_ttf.cpp
font/standard_colors.cpp
font/text.cpp
font/text_cache.cpp
font/text_formatting.cpp

View file

@ -16,6 +16,7 @@ for env in [test_env, client_env, env]:
libwesnoth_core_sources = Split("""
color_range.cpp
config.cpp
font/constants.cpp
hash.cpp
log.cpp
map/location.cpp
@ -90,10 +91,10 @@ libwesnoth_sources = Split("""
display.cpp
events.cpp
floating_label.cpp
font/constants.cpp
font/font_config.cpp
font/marked-up_text.cpp
font/sdl_ttf.cpp
font/standard_colors.cpp
font/text.cpp
font/text_cache.cpp
font/text_formatting.cpp

View file

@ -41,6 +41,7 @@
#include "play_controller.hpp"
#include "resources.hpp"
#include "units/udisplay.hpp"
#include "font/standard_colors.hpp"
#include "formula/string_utils.hpp"
#include "team.hpp"
#include "units/unit.hpp"

View file

@ -37,6 +37,7 @@
#include "image.hpp"
#include "log.hpp"
#include "font/marked-up_text.hpp"
#include "font/standard_colors.hpp"
#include "wml_separators.hpp"
#include "wml_exception.hpp"

View file

@ -22,6 +22,7 @@
#include "game_display.hpp"
#include "language.hpp"
#include "font/marked-up_text.hpp"
#include "font/standard_colors.hpp"
#include "resources.hpp"
#include "units/unit.hpp"
#include "units/abilities.hpp"

View file

@ -24,6 +24,7 @@
#include "sound.hpp"
#include "log.hpp"
#include "font/marked-up_text.hpp"
#include "font/standard_colors.hpp"
#include "scripting/plugins/context.hpp"
#include "scripting/plugins/manager.hpp"
#include "sdl/utils.hpp"

View file

@ -21,6 +21,7 @@
#include "cursor.hpp"
#include "display.hpp"
#include "fake_unit_manager.hpp"
#include "font/standard_colors.hpp"
#include "font/text.hpp"
#include "game_preferences.hpp"
#include "gettext.hpp"

View file

@ -52,6 +52,7 @@ namespace wb {
#include "display_context.hpp"
#include "filter_context.hpp"
#include "font/sdl_ttf.hpp"
#include "font/standard_colors.hpp"
#include "image.hpp" //only needed for enums (!)
#include "key.hpp"
#include "team.hpp"

View file

@ -23,6 +23,8 @@
#include "gui/dialogs/editor/edit_label.hpp"
#include "font/standard_colors.hpp"
namespace editor {
editor_action* mouse_action_map_label::click_left(editor_display& disp, int x, int y)

View file

@ -17,6 +17,7 @@
#include "editor_palettes.hpp"
#include "gettext.hpp"
#include "font/standard_colors.hpp"
#include "font/text_formatting.hpp"
#include "tooltips.hpp"
#include "overlay.hpp"

View file

@ -18,6 +18,7 @@
#include "gettext.hpp"
#include "font/marked-up_text.hpp"
#include "font/standard_colors.hpp"
#include "tooltips.hpp"
#include "editor/toolkit/editor_toolkit.hpp"

View file

@ -20,6 +20,7 @@
#include "font/constants.hpp"
#include "font/sdl_ttf.hpp"
#include "font/standard_colors.hpp"
#include "game_config.hpp"
#include "image.hpp"
#include "log.hpp"

View file

@ -16,6 +16,7 @@
#include "display.hpp"
#include "font/sdl_ttf.hpp"
#include "font/standard_colors.hpp"
#include "font/text.hpp"
#include "log.hpp"

View file

@ -18,6 +18,7 @@
#include "display_chat_manager.hpp"
#include "floating_label.hpp"
#include "font/standard_colors.hpp"
#include "game_display.hpp"
#include "game_preferences.hpp"
#include "log.hpp"

View file

@ -14,26 +14,8 @@
#include "constants.hpp"
#include "sdl/utils.hpp"
#include <SDL.h>
namespace font {
const SDL_Color NORMAL_COLOR = {0xDD,0xDD,0xDD,0},
GRAY_COLOR = {0x77,0x77,0x77,0},
LOBBY_COLOR = {0xBB,0xBB,0xBB,0},
GOOD_COLOR = {0x00,0xFF,0x00,0},
BAD_COLOR = {0xFF,0x00,0x00,0},
BLACK_COLOR = {0x00,0x00,0x00,0},
YELLOW_COLOR = {0xFF,0xFF,0x00,0},
BUTTON_COLOR = {0xBC,0xB0,0x88,0},
PETRIFIED_COLOR = {0xA0,0xA0,0xA0,0},
TITLE_COLOR = {0xBC,0xB0,0x88,0},
LABEL_COLOR = {0x6B,0x8C,0xFF,0},
BIGMAP_COLOR = {0xFF,0xFF,0xFF,0};
const SDL_Color DISABLED_COLOR = inverse(PETRIFIED_COLOR);
const int SIZE_NORMAL = 14;
const int

View file

@ -14,18 +14,10 @@
#pragma once
#include "global.hpp"
#include <SDL.h>
#include <string>
namespace font {
//various standard colors
extern const SDL_Color NORMAL_COLOR, GRAY_COLOR, LOBBY_COLOR, GOOD_COLOR, BAD_COLOR,
BLACK_COLOR, YELLOW_COLOR, BUTTON_COLOR, BIGMAP_COLOR,
PETRIFIED_COLOR, TITLE_COLOR, DISABLED_COLOR, LABEL_COLOR;
// font sizes, to be made theme parameters
extern const int SIZE_NORMAL;
// automatic computation of other font sizes, to be made a default for theme-provided values

View file

@ -25,6 +25,7 @@
#include "font/sdl_ttf.hpp"
#include "gettext.hpp"
#include "font/marked-up_text.hpp"
#include "font/standard_colors.hpp"
#include "serialization/string_utils.hpp"
#include "serialization/unicode.hpp"
#include "video.hpp"

View file

@ -0,0 +1,20 @@
#include "standard_colors.hpp"
#include <sdl/utils.hpp>
namespace font {
const SDL_Color NORMAL_COLOR = {0xDD,0xDD,0xDD,0},
GRAY_COLOR = {0x77,0x77,0x77,0},
LOBBY_COLOR = {0xBB,0xBB,0xBB,0},
GOOD_COLOR = {0x00,0xFF,0x00,0},
BAD_COLOR = {0xFF,0x00,0x00,0},
BLACK_COLOR = {0x00,0x00,0x00,0},
YELLOW_COLOR = {0xFF,0xFF,0x00,0},
BUTTON_COLOR = {0xBC,0xB0,0x88,0},
PETRIFIED_COLOR = {0xA0,0xA0,0xA0,0},
TITLE_COLOR = {0xBC,0xB0,0x88,0},
LABEL_COLOR = {0x6B,0x8C,0xFF,0},
BIGMAP_COLOR = {0xFF,0xFF,0xFF,0};
const SDL_Color DISABLED_COLOR = inverse(PETRIFIED_COLOR);
}

View file

@ -0,0 +1,26 @@
/*
* Copyright (C) 2008 - 2016 by Mark de Wever <koraq@xs4all.nl>
* Part of the Battle for Wesnoth Project http://www.wesnoth.org/
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY.
*
* See the COPYING file for more details.
*/
#ifndef FONT_STANDARD_COLORS_HPP
#define FONT_STANDARD_COLORS_HPP
#include <SDL.h>
namespace font {
extern const SDL_Color NORMAL_COLOR, GRAY_COLOR, LOBBY_COLOR, GOOD_COLOR, BAD_COLOR,
BLACK_COLOR, YELLOW_COLOR, BUTTON_COLOR, BIGMAP_COLOR,
PETRIFIED_COLOR, TITLE_COLOR, DISABLED_COLOR, LABEL_COLOR;
}
#endif

View file

@ -35,6 +35,7 @@
#include "map/map.hpp"
#include "map/label.hpp"
#include "font/marked-up_text.hpp"
#include "font/standard_colors.hpp"
#include "reports.hpp"
#include "resources.hpp"
#include "tod_manager.hpp"

View file

@ -13,6 +13,7 @@
*/
#include "mp_options.hpp"
#include "font/standard_colors.hpp"
#include "gettext.hpp"
#include "gui/auxiliary/find_widget.hpp"
#include "gui/core/window_builder.hpp"

View file

@ -34,6 +34,7 @@
#include "wml_exception.hpp"
#include "wml_separators.hpp"
#include "formula/string_utils.hpp"
#include "font/standard_colors.hpp"
#include "utils/functional.hpp"

View file

@ -21,6 +21,7 @@
#include "ai/configuration.hpp"
#include "construct_dialog.hpp"
#include "display_chat_manager.hpp"
#include "font/standard_colors.hpp"
#include "game_preferences.hpp"
#include "gettext.hpp"
#include "log.hpp"

View file

@ -47,6 +47,7 @@
#include "widgets/multimenu.hpp"
#include "sdl/utils.hpp"
#include "sdl/rect.hpp"
#include "font/standard_colors.hpp"
#include "utils/functional.hpp"

View file

@ -22,6 +22,7 @@
#include "construct_dialog.hpp"
#include "filesystem.hpp"
#include "font/sdl_ttf.hpp"
#include "font/standard_colors.hpp"
#include "game_preferences.hpp"
#include "lobby_preferences.hpp"
#include "map/exception.hpp"

View file

@ -17,6 +17,7 @@
#include "construct_dialog.hpp"
#include "video.hpp"
#include "font/sdl_ttf.hpp"
#include "font/standard_colors.hpp"
#include "formatter.hpp"
#include "game_preferences.hpp"
#include "gettext.hpp"

View file

@ -25,6 +25,7 @@
#include "image.hpp"
#include "log.hpp"
#include "font/marked-up_text.hpp"
#include "font/standard_colors.hpp"
#include "mp_game_utils.hpp"
#include "multiplayer_wait.hpp"
#include "statistics.hpp"

View file

@ -25,23 +25,24 @@
#include "hotkey/hotkey_command.hpp" // for is_scope_active, etc
#include "image.hpp" // for get_image, locator
#include "log.hpp" // for LOG_STREAM, logger, etc
#include "utils/make_enum.hpp" // for operator<<
#include "map/map.hpp" // for gamemap
#include "font/marked-up_text.hpp" // for is_cjk_char, word_wrap_text
#include "units/race.hpp" // for unit_race, etc
#include "utils/make_enum.hpp" // for operator<<
#include "map/map.hpp" // for gamemap
#include "font/marked-up_text.hpp" // for is_cjk_char, word_wrap_text
#include "font/standard_colors.hpp" // for NORMAL_COLOR
#include "units/race.hpp" // for unit_race, etc
#include "resources.hpp" // for tod_manager, config_manager
#include "sdl/utils.hpp" // for surface
#include "serialization/string_utils.hpp" // for split, quoted_split, etc
#include "serialization/unicode_cast.hpp" // for unicode_cast
#include "serialization/unicode_types.hpp" // for char_t, etc
#include "terrain/terrain.hpp" // for terrain_type
#include "terrain/terrain.hpp" // for terrain_type
#include "terrain/translation.hpp" // for operator==, t_list, etc
#include "terrain/type_data.hpp" // for terrain_type_data, etc
#include "time_of_day.hpp" // for time_of_day
#include "tod_manager.hpp" // for tod_manager
#include "tstring.hpp" // for t_string, operator<<
#include "units/types.hpp" // for unit_type, unit_type_data, etc
#include "serialization/unicode.hpp" // for iterator
#include "units/types.hpp" // for unit_type, unit_type_data, etc
#include "serialization/unicode.hpp" // for iterator
#include <assert.h> // for assert
#include <algorithm> // for sort, find, transform, etc

View file

@ -19,7 +19,7 @@
#include <string> // for string
#include <utility> // for pair
#include <SDL_video.h> // for SDL_Color (ptr only), etc
#include "font/constants.hpp" // for NORMAL_COLOR
#include "font/standard_colors.hpp" // for NORMAL_COLOR
#include "sdl/utils.hpp" // for surface
#include "widgets/scrollarea.hpp" // for scrollarea
class CVideo;

View file

@ -15,6 +15,7 @@
#include "hotkey/hotkey_handler.hpp"
#include "actions/create.hpp"
#include "font/standard_colors.hpp"
#include "formula/string_utils.hpp"
#include "game_display.hpp"
#include "game_errors.hpp"

View file

@ -14,6 +14,7 @@
#include "hotkey/hotkey_handler_sp.hpp"
#include "font/standard_colors.hpp"
#include "formula/string_utils.hpp"
#include "hotkey/hotkey_command.hpp"
#include "hotkey/hotkey_item.hpp"

View file

@ -24,6 +24,7 @@
#include "construct_dialog.hpp"
#include "gettext.hpp"
#include "font/marked-up_text.hpp"
#include "font/standard_colors.hpp"
#include "sdl/rect.hpp"
namespace hotkey {

View file

@ -15,7 +15,7 @@
#ifndef MAP_LABEL_HPP_INCLUDED
#define MAP_LABEL_HPP_INCLUDED
#include "font/constants.hpp"
#include "font/standard_colors.hpp"
#include "map/location.hpp"
#include "tstring.hpp"

View file

@ -64,6 +64,7 @@
#include "map/label.hpp"
#include "map_command_handler.hpp"
#include "font/marked-up_text.hpp"
#include "font/standard_colors.hpp"
#include "menu_events.hpp"
#include "mouse_events.hpp"
#include "play_controller.hpp"

View file

@ -18,8 +18,8 @@
#include "attack_prediction.hpp"
//#include "editor/editor_controller.hpp"
//#include "editor/palette/terrain_palettes.hpp"
#include "font/constants.hpp"
#include "font/pango/escape.hpp"
#include "font/standard_colors.hpp"
#include "font/text_formatting.hpp"
#include "game_preferences.hpp"
#include "gettext.hpp"

View file

@ -2302,9 +2302,10 @@ void server::bans_handler(const std::string& /*issuer_name*/, const std::string&
ban_manager_.list_deleted_bans(*out);
} else if (utf8::lowercase(parameters).find("deleted") == 0) {
std::string mask = parameters.substr(7);
ban_manager_.list_deleted_bans(*out, boost::trim(mask));
ban_manager_.list_deleted_bans(*out, boost::trim_copy(mask));
} else {
ban_manager_.list_bans(*out, boost::trim(parameters));
boost::trim(parameters);
ban_manager_.list_bans(*out, parameters);
}
} catch ( utf8::invalid_utf8_exception & e ) {

View file

@ -28,6 +28,7 @@
#include "hotkey/command_executor.hpp"
#include "log.hpp"
#include "font/marked-up_text.hpp"
#include "font/standard_colors.hpp"
#include "sdl/rect.hpp"
static lg::log_domain log_display("display");

View file

@ -38,6 +38,7 @@
#include "formula/string_utils.hpp"
#include "units/types.hpp"
#include "units/udisplay.hpp"
#include "font/standard_colors.hpp"
static lg::log_domain log_replay("replay");
#define DBG_REPLAY LOG_STREAM(debug, log_replay)

View file

@ -28,6 +28,7 @@
#include <set>
#include <map>
#include "formula/string_utils.hpp"
#include "font/standard_colors.hpp"
static lg::log_domain log_replay("replay");
#define DBG_REPLAY LOG_STREAM(debug, log_replay)

View file

@ -17,6 +17,7 @@
#include "floating_label.hpp"
#include "font/sdl_ttf.hpp"
#include "font/standard_colors.hpp"
#include "game_display.hpp"
#include "help/help.hpp"
#include "font/marked-up_text.hpp"

View file

@ -27,6 +27,7 @@
#include "config.hpp"
#include "fake_unit_manager.hpp"
#include "fake_unit_ptr.hpp"
#include "font/standard_colors.hpp"
#include "game_board.hpp"
#include "game_end_exceptions.hpp"
#include "map/map.hpp"

View file

@ -26,6 +26,7 @@
#include "image.hpp"
#include "log.hpp"
#include "font/marked-up_text.hpp"
#include "font/standard_colors.hpp"
#include "sdl/rect.hpp"
#include "serialization/string_utils.hpp"
#include "sound.hpp"

View file

@ -16,6 +16,7 @@
#define LABEL_HPP_INCLUDED
#include "font/constants.hpp"
#include "font/standard_colors.hpp"
#include "widget.hpp"
#include <string>
#include "sdl/image.hpp"

View file

@ -20,6 +20,7 @@
#include "game_config.hpp"
#include "font/sdl_ttf.hpp"
#include "font/standard_colors.hpp"
#include "language.hpp"
#include "image.hpp"
#include "font/marked-up_text.hpp"

View file

@ -19,6 +19,7 @@
#include "widgets/slider.hpp"
#include "game_config.hpp"
#include "font/sdl_ttf.hpp"
#include "font/standard_colors.hpp"
#include "image.hpp"
#include "sdl/rect.hpp"
#include "sound.hpp"

View file

@ -17,6 +17,7 @@
#include "serialization/unicode.hpp"
#include "font/constants.hpp"
#include "font/standard_colors.hpp"
#include "scrollarea.hpp"