Final sweep of renames to drop t- prefix

This commit is contained in:
Celtic Minstrel 2016-11-09 01:12:18 -05:00
parent 10b6a34615
commit b6c88df9e7
136 changed files with 720 additions and 724 deletions

View file

@ -314,7 +314,7 @@ unit_ptr get_amla_unit(const unit &u, const config &mod_option)
}
void advance_unit(map_location loc, const tadvancement_option &advance_to, bool fire_event)
void advance_unit(map_location loc, const advancement_option &advance_to, bool fire_event)
{
unit_map::unit_iterator u = resources::units->find(loc);
if(!u.valid()) {

View file

@ -63,7 +63,7 @@ unit_ptr get_advanced_unit(const unit &u, const std::string &advance_to);
*/
unit_ptr get_amla_unit(const unit &u, const config &mod_option);
using tadvancement_option = boost::variant<std::string /*change type*/, const config* /*apply amla*/>;
using advancement_option = boost::variant<std::string /*change type*/, const config* /*apply amla*/>;
/**
* Function which will advance the unit at @a loc to 'advance_to'.
@ -73,4 +73,4 @@ using tadvancement_option = boost::variant<std::string /*change type*/, const co
* we couldn't safely pass in a reference to the item in the map
* that we're going to delete, since deletion would invalidate the reference.
*/
void advance_unit(map_location loc, const tadvancement_option &advance_to, bool fire_event = true);
void advance_unit(map_location loc, const advancement_option &advance_to, bool fire_event = true);

View file

@ -302,7 +302,7 @@ bool game_board::change_terrain(const map_location &loc, const std::string &t_st
t_translation::terrain_code terrain = t_translation::read_terrain_code(t_str);
if (terrain == t_translation::NONE_TERRAIN) return false;
terrain_type_data::tmerge_mode mode = terrain_type_data::BOTH;
terrain_type_data::merge_mode mode = terrain_type_data::BOTH;
if (mode_str == "base") mode = terrain_type_data::BASE;
else if (mode_str == "overlay") mode = terrain_type_data::OVERLAY;

View file

@ -71,7 +71,7 @@ namespace game_events
* Ensures that villages are properly lost and that new terrains are discovered.
*/
void change_terrain(const map_location &loc, const t_translation::terrain_code &t,
terrain_type_data::tmerge_mode mode, bool replace_if_failed);
terrain_type_data::merge_mode mode, bool replace_if_failed);
}
#endif // GAME_EVENTS_ACTION_WML_H_INCLUDED

View file

@ -360,7 +360,7 @@ void cave_map_generator::cave_map_generator_job::place_castle(int starting_posit
t_translation::coordinate coord(
loc.x + gamemap::default_border
, loc.y + gamemap::default_border);
starting_positions_.insert(t_translation::tstarting_positions::value_type(std::to_string(starting_position), coord));
starting_positions_.insert(t_translation::starting_positions::value_type(std::to_string(starting_position), coord));
}
map_location adj[6];

View file

@ -81,7 +81,7 @@ private:
bool flipx_, flipy_;
t_translation::ter_map map_;
t_translation::tstarting_positions starting_positions_;
t_translation::starting_positions starting_positions_;
std::map<std::string,size_t> chamber_ids_;
std::vector<chamber> chambers_;
std::vector<passage> passages_;

View file

@ -525,7 +525,7 @@ map_location default_map_generator_job::random_point_at_side(size_t width, size_
/** Function which, given the map will output it in a valid format. */
static std::string output_map(const terrain_map& terrain,
t_translation::tstarting_positions& starting_positions)
t_translation::starting_positions& starting_positions)
{
// Remember that we only want the middle 1/9th of the map.
// All other segments of the map are there only to give
@ -783,7 +783,7 @@ std::string default_map_generator_job::default_generate_map(generator_data data,
}
}
t_translation::tstarting_positions starting_positions;
t_translation::starting_positions starting_positions;
LOG_NG << output_map(terrain, starting_positions);
LOG_NG << "Placed landforms. " << (SDL_GetTicks() - ticks) << " ticks elapsed" << "\n";
ticks = SDL_GetTicks();
@ -1148,7 +1148,7 @@ std::string default_map_generator_job::default_generate_map(generator_data data,
const int y = c->y;
const int player = c - castles.begin() + 1;
const t_translation::coordinate coord(x, y);
starting_positions.insert(t_translation::tstarting_positions::value_type(std::to_string(player), coord));
starting_positions.insert(t_translation::starting_positions::value_type(std::to_string(player), coord));
terrain[x][y] = t_translation::HUMAN_KEEP;
const int castle_array[13][2] = {

View file

@ -30,8 +30,8 @@ namespace gui2
{
template <class T>
inline bool sort(const pane::titem& lhs,
const pane::titem& rhs,
inline bool sort(const pane::item& lhs,
const pane::item& rhs,
const std::string& tag,
const bool ascending)
{
@ -63,7 +63,7 @@ inline bool sort(const pane::titem& lhs,
*
* @returns Whether or not the comparison found a match.
*/
inline bool contains(const pane::titem& item,
inline bool contains(const pane::item& item,
const std::string& tag,
const text_box& text_box)
{

View file

@ -105,8 +105,8 @@ window* build(CVideo& video, const builder_window::window_resolution* definition
win->set_click_dismiss(definition->click_dismiss);
std::shared_ptr<const window_definition::tresolution>
conf = std::static_pointer_cast<const window_definition::tresolution>(
std::shared_ptr<const window_definition::resolution>
conf = std::static_pointer_cast<const window_definition::resolution>(
win->config());
assert(conf);

View file

@ -28,7 +28,7 @@ namespace gui2
namespace implementation
{
using scrollbar_mode = scrollbar_container::tscrollbar_mode;
using scrollbar_mode = scrollbar_container::scrollbar_mode;
/**
* Returns the vertical alignment.

View file

@ -380,7 +380,7 @@ void addon_description::pre_show(window& window)
url_textbox.set_active(false);
if(!feedback_url_.empty()) {
url_none.set_visible(control::tvisible::invisible);
url_none.set_visible(control::visibility::invisible);
connect_signal_mouse_left_click(
url_go_button,
@ -398,15 +398,15 @@ void addon_description::pre_show(window& window)
url_go_button.set_active(false);
url_copy_button.set_active(false);
url_go_button.set_visible(control::tvisible::invisible);
url_copy_button.set_visible(control::tvisible::invisible);
url_textbox.set_visible(control::tvisible::invisible);
url_go_button.set_visible(control::visibility::invisible);
url_copy_button.set_visible(control::visibility::invisible);
url_textbox.set_visible(control::visibility::invisible);
}
if(!desktop::open_object_is_supported()) {
// No point in displaying the button on platforms that can't do
// open_object().
url_go_button.set_visible(control::tvisible::invisible);
url_go_button.set_visible(control::visibility::invisible);
}
}

View file

@ -402,7 +402,7 @@ void addon_manager::pre_show(window& window)
if(!desktop::open_object_is_supported()) {
// No point in displaying the button on platforms that can't do
// open_object().
url_go_button.set_visible(control::tvisible::invisible);
url_go_button.set_visible(control::visibility::invisible);
}
connect_signal_mouse_left_click(

View file

@ -150,7 +150,7 @@ void campaign_difficulty::pre_show(window& window)
widget *widget = grid->find("victory", false);
if (widget && !preferences::is_campaign_completed(campaign_id_, d["define"])) {
widget->set_visible(widget::tvisible::hidden);
widget->set_visible(widget::visibility::hidden);
}
}
}

View file

@ -208,7 +208,7 @@ void campaign_selection::pre_show(window& window)
if(tree_view* tree
= find_widget<tree_view>(&window, "campaign_tree", false, false)) {
tree->set_visible(widget::tvisible::invisible);
tree->set_visible(widget::visibility::invisible);
}
/***** Setup campaign list. *****/
@ -249,7 +249,7 @@ void campaign_selection::pre_show(window& window)
widget* widget = grid->find("victory", false);
if(widget && !campaign["completed"].to_bool()) {
widget->set_visible(widget::tvisible::hidden);
widget->set_visible(widget::visibility::hidden);
}
/*** Add detail item ***/

View file

@ -170,13 +170,13 @@ void debug_clock::update_time(const bool force)
}
}
debug_clock::ttime::ttime() : hour(0), minute(0), second(0), millisecond(0)
debug_clock::time::time() : hour(0), minute(0), second(0), millisecond(0)
{
}
void debug_clock::ttime::set_current_time()
void debug_clock::time::set_current_time()
{
time_t now = time(nullptr);
time_t now = ::time(nullptr);
tm* stamp = localtime(&now);
hour = stamp->tm_hour;
@ -185,7 +185,7 @@ void debug_clock::ttime::set_current_time()
millisecond = 0;
}
bool debug_clock::ttime::step(const unsigned milliseconds)
bool debug_clock::time::step(const unsigned milliseconds)
{
millisecond += milliseconds;

View file

@ -81,9 +81,9 @@ private:
event::signal_function signal_;
/** Helper struct to keep track of the time. */
struct ttime
struct time
{
ttime();
time();
/**
* Sets the fields to the current time.
@ -125,7 +125,7 @@ private:
* @note Since the dialog is used to test the drawing routine by keeping
* track of the calls to the drawing routine, the clock might be off.
*/
ttime time_;
time time_;
/** Inherited from modal_dialog, implemented by REGISTER_DIALOG. */
virtual const std::string& window_id() const;

View file

@ -121,9 +121,9 @@ void end_credits::pre_show(window& window)
// This should probably be implemented as a scrollbar mode.
// Also, for some reason hiding the whole grid doesn't work, and the elements need to be hidden manually
if(grid* v_grid = dynamic_cast<grid*>(text_widget_->find("_vertical_scrollbar_grid", false))) {
find_widget<scrollbar_base>(v_grid, "_vertical_scrollbar", false).set_visible(widget::tvisible::hidden);
find_widget<repeating_button>(v_grid, "_half_page_up", false).set_visible(widget::tvisible::hidden);
find_widget<repeating_button>(v_grid, "_half_page_down", false).set_visible(widget::tvisible::hidden);
find_widget<scrollbar_base>(v_grid, "_vertical_scrollbar", false).set_visible(widget::visibility::hidden);
find_widget<repeating_button>(v_grid, "_half_page_up", false).set_visible(widget::visibility::hidden);
find_widget<repeating_button>(v_grid, "_half_page_down", false).set_visible(widget::visibility::hidden);
}
}

View file

@ -176,7 +176,7 @@ void file_dialog::pre_show(window& window)
title.set_label(title_);
if(msg_.empty()) {
message.set_visible(gui2::widget::tvisible::invisible);
message.set_visible(gui2::widget::visibility::invisible);
} else {
message.set_label(msg_);
message.set_use_markup(true);
@ -263,8 +263,8 @@ void file_dialog::pre_show(window& window)
mkdir_button.set_active(false);
rm_button.set_active(false);
mkdir_button.set_visible(widget::tvisible::invisible);
rm_button.set_visible(widget::tvisible::invisible);
mkdir_button.set_visible(widget::visibility::invisible);
rm_button.set_visible(widget::visibility::invisible);
}
refresh_fileview(window);
@ -662,7 +662,7 @@ void file_dialog::on_bookmark_add_cmd(window& window)
std::string label = default_label;
const bool confirm = tbookmark_create::execute(label, window.video());
const bool confirm = bookmark_create::execute(label, window.video());
if(!confirm) {
return;
}

View file

@ -44,7 +44,7 @@ public:
}
private:
friend class tbookmark_create;
friend class bookmark_create;
bool bookmark_mode_;
@ -62,7 +62,7 @@ private:
void pre_show(window& window);
};
class tbookmark_create
class bookmark_create
{
public:
/** The execute function; see @ref modal_dialog for more information. */

View file

@ -180,7 +180,7 @@ void game_version::pre_show(window& window)
if(!desktop::open_object_is_supported()) {
// No point in displaying these on platforms that can't do
// open_object().
browse_w.set_visible(control::tvisible::invisible);
browse_w.set_visible(control::visibility::invisible);
}
if(!desktop::clipboard::available()) {
@ -192,7 +192,7 @@ void game_version::pre_show(window& window)
#ifndef _WIN32
grid& w32_options_grid
= find_widget<grid>(&window, "win32_paths", false);
w32_options_grid.set_visible(widget::tvisible::invisible);
w32_options_grid.set_visible(widget::visibility::invisible);
#else
button& stderr_button
= find_widget<button>(&window, "open_stderr", false);

View file

@ -204,12 +204,12 @@ public:
std::ostringstream out;
out << current_page_ + 1 << '/' << n_pages;
pages_->set_label(out.str());
left_->set_visible(widget::tvisible::visible);
right_->set_visible(widget::tvisible::visible);
left_->set_visible(widget::visibility::visible);
right_->set_visible(widget::visibility::visible);
} else {
pages_->set_label("");
left_->set_visible(widget::tvisible::invisible);
right_->set_visible(widget::tvisible::invisible);
left_->set_visible(widget::visibility::invisible);
right_->set_visible(widget::visibility::invisible);
}
}
@ -217,8 +217,8 @@ public:
{
stuff_list_->clear();
pages_->set_label("");
left_->set_visible(widget::tvisible::invisible);
right_->set_visible(widget::tvisible::invisible);
left_->set_visible(widget::visibility::invisible);
right_->set_visible(widget::visibility::invisible);
}
void page(int where)
@ -420,8 +420,8 @@ public:
std::bind(&gamestate_inspector::controller::handle_page_button_clicked,
this, true));
left_button->set_visible(widget::tvisible::invisible);
right_button->set_visible(widget::tvisible::invisible);
left_button->set_visible(widget::visibility::invisible);
right_button->set_visible(widget::visibility::invisible);
if (!desktop::clipboard::available()) {
copy_button->set_active(false);

View file

@ -67,7 +67,7 @@ void lobby_info::delete_games()
}
namespace gui2
{
void do_mp_notify(t_notify_mode mode, const std::string & sender, const std::string & message)
void do_mp_notify(notify_mode mode, const std::string & sender, const std::string & message)
{
switch (mode) {
case NOTIFY_WHISPER:

View file

@ -119,7 +119,7 @@ private:
boost::dynamic_bitset<> games_visibility_;
};
enum t_notify_mode {
enum notify_mode {
NOTIFY_NONE,
NOTIFY_MESSAGE,
NOTIFY_MESSAGE_OTHER_WINDOW,
@ -135,7 +135,7 @@ enum t_notify_mode {
namespace gui2
{
void do_mp_notify(t_notify_mode mode, const std::string & sender, const std::string & message);
inline void do_mp_notify(t_notify_mode mode) { do_mp_notify(mode, "", ""); }
void do_mp_notify(notify_mode mode, const std::string & sender, const std::string & message);
inline void do_mp_notify(notify_mode mode) { do_mp_notify(mode, "", ""); }
}
#endif

View file

@ -240,7 +240,7 @@ void modify_grid_with_data(grid* grid, const std::map<std::string, string_map>&
void set_visible_if_exists(grid* grid, const std::string& id, bool visible)
{
if(widget* w = grid->find(id, false)) {
w->set_visible(visible ? widget::tvisible::visible : widget::tvisible::invisible);
w->set_visible(visible ? widget::visibility::visible : widget::visibility::invisible);
}
}
@ -1093,7 +1093,7 @@ void lobby_main::user_dialog_callback(user_info* info)
delay_playerlist_update_ = true;
if(dlg.result_open_whisper()) {
tlobby_chat_window* t = chatbox_->whisper_window_open(info->name, true);
lobby_chat_window* t = chatbox_->whisper_window_open(info->name, true);
chatbox_->switch_to_window(t);
}

View file

@ -108,8 +108,8 @@ public:
CREATE
};
void do_notify(t_notify_mode mode) { do_notify(mode, "", ""); }
void do_notify(t_notify_mode mode, const std::string & sender, const std::string & message) { do_mp_notify(mode, sender, message); }
void do_notify(notify_mode mode) { do_notify(mode, "", ""); }
void do_notify(notify_mode mode, const std::string & sender, const std::string & message) { do_mp_notify(mode, sender, message); }
protected:

View file

@ -119,7 +119,7 @@ void lobby_player_info::pre_show(window& window)
if(!preferences::is_authenticated()) {
widget* aw = window.find("admin", false);
aw->set_visible(widget::tvisible::invisible);
aw->set_visible(widget::visibility::invisible);
}
}

View file

@ -80,14 +80,14 @@ void message::pre_show(window& window)
if(!title_.empty()) {
title_widget.set_label(title_);
} else {
title_widget.set_visible(widget::tvisible::invisible);
title_widget.set_visible(widget::visibility::invisible);
}
control& img_widget = find_widget<image>(&window, "image", false);
if(!image_.empty()) {
img_widget.set_label(image_);
} else {
img_widget.set_visible(widget::tvisible::invisible);
img_widget.set_visible(widget::visibility::invisible);
}
control& label = find_widget<control>(&window, "label", false);
@ -120,7 +120,7 @@ void message::set_button_caption(const button_id button,
}
void message::set_button_visible(const button_id button,
const widget::tvisible visible)
const widget::visibility visible)
{
buttons_[button].visible = visible;
if(buttons_[button].button) {
@ -139,7 +139,7 @@ void message::set_button_retval(const button_id button, const int retval)
message::tbutton_status::tbutton_status()
: button(nullptr)
, caption()
, visible(widget::tvisible::invisible)
, visible(widget::visibility::invisible)
, retval(window::NONE)
{
}
@ -176,25 +176,25 @@ int show_message(CVideo& video,
case message::auto_close:
break;
case message::ok_button:
dlg.set_button_visible(message::ok, widget::tvisible::visible);
dlg.set_button_visible(message::ok, widget::visibility::visible);
dlg.set_button_caption(message::ok, _("OK"));
break;
case message::close_button:
dlg.set_button_visible(message::ok, widget::tvisible::visible);
dlg.set_button_visible(message::ok, widget::visibility::visible);
break;
case message::ok_cancel_buttons:
dlg.set_button_visible(message::ok, widget::tvisible::visible);
dlg.set_button_visible(message::ok, widget::visibility::visible);
dlg.set_button_caption(message::ok, _("OK"));
/* FALL DOWN */
case message::cancel_button:
dlg.set_button_visible(message::cancel,
widget::tvisible::visible);
widget::visibility::visible);
break;
case message::yes_no_buttons:
dlg.set_button_visible(message::ok, widget::tvisible::visible);
dlg.set_button_visible(message::ok, widget::visibility::visible);
dlg.set_button_caption(message::ok, _("Yes"));
dlg.set_button_visible(message::cancel,
widget::tvisible::visible);
widget::visibility::visible);
dlg.set_button_caption(message::cancel, _("No"));
break;
}

View file

@ -82,7 +82,7 @@ public:
const std::string& caption);
void set_button_visible(const button_id button,
const widget::tvisible visible);
const widget::visibility visible);
void set_button_retval(const button_id button, const int retval);
@ -144,7 +144,7 @@ private:
button* button;
std::string caption;
widget::tvisible visible;
widget::visibility visible;
int retval;
};

View file

@ -137,16 +137,16 @@ void mp_alerts_options::pre_show(window& window)
toggle_button * in_lobby;
in_lobby = &find_widget<toggle_button>(&window,"ready_for_start_lobby", false);
in_lobby->set_visible(widget::tvisible::invisible);
in_lobby->set_visible(widget::visibility::invisible);
in_lobby = &find_widget<toggle_button>(&window,"game_has_begun_lobby", false);
in_lobby->set_visible(widget::tvisible::invisible);
in_lobby->set_visible(widget::visibility::invisible);
in_lobby = &find_widget<toggle_button>(&window,"turn_changed_sound", false); // If we get a sound for this then don't remove this button
in_lobby->set_visible(widget::tvisible::invisible);
in_lobby->set_visible(widget::visibility::invisible);
in_lobby = &find_widget<toggle_button>(&window,"turn_changed_lobby", false);
in_lobby->set_visible(widget::tvisible::invisible);
in_lobby->set_visible(widget::visibility::invisible);
button * defaults;
defaults = &find_widget<button>(&window,"revert_to_defaults", false);

View file

@ -113,7 +113,7 @@ void mp_cmd_wrapper::pre_show(window& window)
if(grid* g = find_widget<grid>(&window, "mod_options", false, false)) {
g->set_active(authenticated);
g->set_visible(authenticated ? widget::tvisible::visible : widget::tvisible::invisible);
g->set_visible(authenticated ? widget::visibility::visible : widget::visibility::invisible);
}
/**

View file

@ -262,7 +262,7 @@ void mp_create_game::pre_show(window& win)
// No mods, hide the header
if(mod_list.get_item_count() <= 0) {
find_widget<control>(&win, "mods_header", false).set_visible(window::tvisible::invisible);
find_widget<control>(&win, "mods_header", false).set_visible(window::visibility::invisible);
} else {
on_mod_select(win);
}

View file

@ -297,7 +297,7 @@ void mp_join_game::pre_show(window& window)
plugins_context_->set_callback("chat", [&chat](const config& cfg) { chat.send_chat_message(cfg["message"], false); }, true);
// TODO: the old mp wait dialog didn't have an OK button. Evaluate if we want to add one. Hiding it for now
find_widget<button>(&window, "ok", false).set_visible(widget::tvisible::hidden);
find_widget<button>(&window, "ok", false).set_visible(widget::visibility::hidden);
}
void mp_join_game::generate_side_list(window& window)
@ -408,8 +408,8 @@ void mp_join_game::generate_side_list(window& window)
grid& row_grid = node.get_grid();
if(income_amt == 0) {
find_widget<image>(&row_grid, "income_icon", false).set_visible(widget::tvisible::invisible);
find_widget<label>(&row_grid, "side_income", false).set_visible(widget::tvisible::invisible);
find_widget<image>(&row_grid, "income_icon", false).set_visible(widget::visibility::invisible);
find_widget<label>(&row_grid, "side_income", false).set_visible(widget::visibility::invisible);
}
}
}

View file

@ -131,7 +131,7 @@ int mp_options_helper::remove_nodes_for_type(const std::string& type)
void mp_options_helper::update_status_label()
{
// No custom options, display a message
no_options_notice_.set_visible(options_tree_.empty() ? window::tvisible::visible : window::tvisible::invisible);
no_options_notice_.set_visible(options_tree_.empty() ? window::visibility::visible : window::visibility::invisible);
}
template<typename T>

View file

@ -284,8 +284,8 @@ void mp_staging::add_side_node(window& window, ng::side_engine_ptr side)
// TODO: maybe display the saved values
if(saved_game) {
slider_gold.set_visible(widget::tvisible::invisible);
slider_income.set_visible(widget::tvisible::invisible);
slider_gold.set_visible(widget::visibility::invisible);
slider_income.set_visible(widget::visibility::invisible);
}
//
@ -323,7 +323,7 @@ void mp_staging::on_controller_select(ng::side_engine_ptr side, grid& row_grid)
menu_button& controller_selection = find_widget<menu_button>(&row_grid, "controller", false);
if(side->controller_changed(controller_selection.get_value())) {
ai_selection.set_visible(side->controller() == ng::CNTR_COMPUTER ? widget::tvisible::visible : widget::tvisible::hidden);
ai_selection.set_visible(side->controller() == ng::CNTR_COMPUTER ? widget::visibility::visible : widget::visibility::hidden);
set_state_changed();
}

View file

@ -175,7 +175,7 @@ void preferences_dialog::update_friends_list_controls(window& window, listbox& l
find_widget<button>(&window, "remove", false).set_active(!list_empty);
find_widget<label>(&window, "no_friends_notice", false).set_visible(
list_empty ? window::tvisible::visible : window::tvisible::invisible);
list_empty ? window::visibility::visible : window::visibility::invisible);
}
void preferences_dialog::add_friend_list_entry(const bool is_friend, text_box& textbox, window& window)
@ -553,11 +553,11 @@ void preferences_dialog::post_build(window& window)
assert(main_grid);
grid& details_grid = find_widget<grid>(main_grid, "prefs_setter_grid", false);
details_grid.set_visible(control::tvisible::invisible);
details_grid.set_visible(control::visibility::invisible);
// The toggle widget for toggle-type options (hidden for other types)
toggle_button& toggle_box = find_widget<toggle_button>(main_grid, "value_toggle", false);
toggle_box.set_visible(control::tvisible::hidden);
toggle_box.set_visible(control::visibility::hidden);
if(!option["description"].empty()) {
find_widget<control>(main_grid, "description", false).set_label(option["description"]);
@ -567,7 +567,7 @@ void preferences_dialog::post_build(window& window)
case ADVANCED_PREF_TYPE::TOGGLE: {
//main_grid->remove_child("setter");
toggle_box.set_visible(control::tvisible::visible);
toggle_box.set_visible(control::visibility::visible);
toggle_box.set_value(get(pref_name, option["default"].to_bool()));
connect_signal_mouse_left_click(toggle_box, std::bind(
@ -905,12 +905,12 @@ void preferences_dialog::on_advanced_prefs_list_select(listbox& list, window& wi
if(has_description || (selected_type != ADVANCED_PREF_TYPE::SPECIAL && selected_type != ADVANCED_PREF_TYPE::TOGGLE)) {
find_widget<widget>(get_advanced_row_grid(list, selected_row), "prefs_setter_grid", false)
.set_visible(control::tvisible::visible);
.set_visible(control::visibility::visible);
}
if(last_selected_item_ != selected_row) {
find_widget<widget>(get_advanced_row_grid(list, last_selected_item_), "prefs_setter_grid", false)
.set_visible(control::tvisible::invisible);
.set_visible(control::visibility::invisible);
last_selected_item_ = selected_row;
}

View file

@ -114,7 +114,7 @@ void simple_item_selector::pre_show(window& window)
}
if(single_button_) {
button_cancel.set_visible(gui2::widget::tvisible::invisible);
button_cancel.set_visible(gui2::widget::visibility::invisible);
}
}

View file

@ -164,7 +164,7 @@ void show(CVideo& video,
{
t.show(video);
}
catch(twindow_builder_invalid_id&)
catch(window_builder_invalid_id&)
{
ERR_CFG << "Tip with the requested id '" << window_id
<< "' doesn't exist, fall back to the default.\n";
@ -173,7 +173,7 @@ void show(CVideo& video,
{
t.show(video);
}
catch(twindow_builder_invalid_id&)
catch(window_builder_invalid_id&)
{
ERR_CFG << "Default tooltip doesn't exist, no message shown."
<< std::endl;

View file

@ -417,7 +417,7 @@ void title_screen::pre_show(window& win)
});
if(game_config_manager::get()->game_config().child_range("core").size() <= 1) {
find_widget<button>(&win, "cores", false).set_visible(window::tvisible::invisible);
find_widget<button>(&win, "cores", false).set_visible(window::visibility::invisible);
}
//
@ -457,8 +457,8 @@ void title_screen::pre_show(window& win)
std::bind(&title_screen::show_debug_clock_window, this, std::ref(win.video())));
find_widget<button>(&win, "clock", false).set_visible(show_debug_clock_button
? widget::tvisible::visible
: widget::tvisible::invisible);
? widget::visibility::visible
: widget::visibility::invisible);
}
void title_screen::on_resize(window& win)

View file

@ -46,7 +46,7 @@ public:
* Values for actions which leave the title screen.
* Actions that merely show a dialog are not included here.
*/
enum tresult {
enum result {
// Start playing a single-player game, such as the tutorial or a campaign
LAUNCH_GAME,
// Connect to an MP server

View file

@ -46,12 +46,12 @@ void transient_message::pre_show(window& window)
{
if(hide_title_) {
widget& title = find_widget<widget>(&window, "title", false);
title.set_visible(widget::tvisible::invisible);
title.set_visible(widget::visibility::invisible);
}
if(hide_image_) {
widget& image = find_widget<widget>(&window, "image", false);
image.set_visible(widget::tvisible::invisible);
image.set_visible(widget::visibility::invisible);
}
}
} // namespace dialogs

View file

@ -153,19 +153,19 @@ void unit_list::pre_show(window& window)
// NOTE: this needs to be done *after* the row is added
// TODO: show custom statuses
if(!unit->get_state(unit::STATE_PETRIFIED)) {
find_widget<image>(row_grid, "unit_status_petrified", false).set_visible(widget::tvisible::invisible);
find_widget<image>(row_grid, "unit_status_petrified", false).set_visible(widget::visibility::invisible);
}
if(!unit->get_state(unit::STATE_POISONED)) {
find_widget<image>(row_grid, "unit_status_poisoned", false).set_visible(widget::tvisible::invisible);
find_widget<image>(row_grid, "unit_status_poisoned", false).set_visible(widget::visibility::invisible);
}
if(!unit->get_state(unit::STATE_SLOWED)) {
find_widget<image>(row_grid, "unit_status_slowed", false).set_visible(widget::tvisible::invisible);
find_widget<image>(row_grid, "unit_status_slowed", false).set_visible(widget::visibility::invisible);
}
if(!unit->invisible(unit->get_location(), *resources::gameboard, false)) {
find_widget<image>(row_grid, "unit_status_invisible", false).set_visible(widget::tvisible::invisible);
find_widget<image>(row_grid, "unit_status_invisible", false).set_visible(widget::visibility::invisible);
}
}

View file

@ -209,13 +209,13 @@ void wml_error::pre_show(window& window)
{
if(!have_files_) {
control& filelist = find_widget<control>(&window, "files", false);
filelist.set_visible(control::tvisible::invisible);
filelist.set_visible(control::visibility::invisible);
}
if(!have_post_summary_) {
control& post_summary
= find_widget<control>(&window, "post_summary", false);
post_summary.set_visible(control::tvisible::invisible);
post_summary.set_visible(control::visibility::invisible);
}
button& copy_button = find_widget<button>(&window, "copy", false);

View file

@ -94,8 +94,8 @@ void wml_message_base::pre_show(window& window)
window.set_click_dismiss(false);
window.set_escape_disabled(true);
} else {
caption.set_visible(widget::tvisible::invisible);
input.set_visible(widget::tvisible::invisible);
caption.set_visible(widget::visibility::invisible);
input.set_visible(widget::visibility::invisible);
}
// Find the option list related fields.
@ -129,7 +129,7 @@ void wml_message_base::pre_show(window& window)
// click_dismiss has been disabled due to the input.
}
} else {
options.set_visible(widget::tvisible::invisible);
options.set_visible(widget::visibility::invisible);
}
window.set_click_dismiss(!has_input_ && option_list_.empty());
}

View file

@ -153,7 +153,7 @@ button_definition::button_definition(const config& cfg)
{
DBG_GUI_P << "Parsing button " << id << '\n';
load_resolutions<tresolution>(cfg);
load_resolutions<resolution>(cfg);
}
/*WIKI
@ -184,7 +184,7 @@ button_definition::button_definition(const config& cfg)
* @end{tag}{name="button_definition"}
* @end{parent}{name="gui/"}
*/
button_definition::tresolution::tresolution(const config& cfg)
button_definition::resolution::resolution(const config& cfg)
: resolution_definition(cfg)
{
// Note the order should be the same as the enum state_t in button.hpp.

View file

@ -120,9 +120,9 @@ struct button_definition : public control_definition
{
explicit button_definition(const config& cfg);
struct tresolution : public resolution_definition
struct resolution : public resolution_definition
{
explicit tresolution(const config& cfg);
explicit resolution(const config& cfg);
};
};

View file

@ -67,12 +67,12 @@ chatbox::chatbox()
void chatbox::active_window_changed()
{
tlobby_chat_window& t = open_windows_[active_window_];
lobby_chat_window& t = open_windows_[active_window_];
// Clear pending messages notification in room listbox
grid* grid = roomlistbox_->get_row_grid(active_window_);
find_widget<image>(grid, "pending_messages", false).set_visible(widget::tvisible::hidden);
find_widget<image>(grid, "pending_messages", false).set_visible(widget::visibility::hidden);
t.pending_messages = 0;
@ -81,7 +81,7 @@ void chatbox::active_window_changed()
}
}
void chatbox::switch_to_window(tlobby_chat_window* t)
void chatbox::switch_to_window(lobby_chat_window* t)
{
switch_to_window(t - &open_windows_[0]);
}
@ -126,7 +126,7 @@ void chatbox::send_message_button_callback()
// the other party without having to specify it's nick.
chat_handler::do_speak(input);
} else {
tlobby_chat_window& t = open_windows_[active_window_];
lobby_chat_window& t = open_windows_[active_window_];
if(t.whisper) {
send_whisper(t.name, input);
@ -258,7 +258,7 @@ void chatbox::add_whisper_sent(const std::string& receiver, const std::string& m
{
if(whisper_window_active(receiver)) {
add_active_window_message(preferences::login(), message, true);
} else if(tlobby_chat_window* t = whisper_window_open(receiver, preferences::auto_open_whisper_windows())) {
} else if(lobby_chat_window* t = whisper_window_open(receiver, preferences::auto_open_whisper_windows())) {
switch_to_window(t);
add_active_window_message(preferences::login(), message, true);
} else {
@ -297,7 +297,7 @@ void chatbox::add_whisper_received(const std::string& sender, const std::string&
void chatbox::add_chat_room_message_sent(const std::string& room,
const std::string& message)
{
tlobby_chat_window* t = room_window_open(room, false);
lobby_chat_window* t = room_window_open(room, false);
if(!t) {
LOG_LB << "Cannot add sent message to ui for room " << room << ", player not in the room\n";
return;
@ -325,7 +325,7 @@ void chatbox::add_chat_room_message_received(const std::string& room,
return;
}
t_notify_mode notify_mode = NOTIFY_NONE;
notify_mode notify_mode = NOTIFY_NONE;
ri->log().add_message(speaker, message);
if(room_window_active(room)) {
@ -350,27 +350,27 @@ void chatbox::add_chat_room_message_received(const std::string& room,
bool chatbox::whisper_window_active(const std::string& name)
{
const tlobby_chat_window& t = open_windows_[active_window_];
const lobby_chat_window& t = open_windows_[active_window_];
return t.name == name && t.whisper == true;
}
bool chatbox::room_window_active(const std::string& room)
{
const tlobby_chat_window& t = open_windows_[active_window_];
const lobby_chat_window& t = open_windows_[active_window_];
return t.name == room && t.whisper == false;
}
tlobby_chat_window* chatbox::room_window_open(const std::string& room, const bool open_new, const bool allow_close)
lobby_chat_window* chatbox::room_window_open(const std::string& room, const bool open_new, const bool allow_close)
{
return search_create_window(room, false, open_new, allow_close);
}
tlobby_chat_window* chatbox::whisper_window_open(const std::string& name, bool open_new)
lobby_chat_window* chatbox::whisper_window_open(const std::string& name, bool open_new)
{
return search_create_window(name, true, open_new, true);
}
tlobby_chat_window* chatbox::search_create_window(const std::string& name,
lobby_chat_window* chatbox::search_create_window(const std::string& name,
const bool whisper,
const bool open_new,
const bool allow_close)
@ -385,7 +385,7 @@ tlobby_chat_window* chatbox::search_create_window(const std::string& name,
return nullptr;
}
open_windows_.push_back(tlobby_chat_window(name, whisper));
open_windows_.push_back(lobby_chat_window(name, whisper));
std::map<std::string, string_map> data;
string_map item;
@ -417,15 +417,15 @@ tlobby_chat_window* chatbox::search_create_window(const std::string& name,
std::bind(&chatbox::close_window_button_callback, this, open_windows_.back(), _3, _4));
if(!allow_close) {
close_button.set_visible(control::tvisible::hidden);
close_button.set_visible(control::visibility::hidden);
}
return &open_windows_.back();
}
void chatbox::close_window_button_callback(tlobby_chat_window& chat_window, bool& handled, bool& halt)
void chatbox::close_window_button_callback(lobby_chat_window& chat_window, bool& handled, bool& halt)
{
const int index = std::find_if(open_windows_.begin(), open_windows_.end(), [&chat_window](const tlobby_chat_window& room) {
const int index = std::find_if(open_windows_.begin(), open_windows_.end(), [&chat_window](const lobby_chat_window& room) {
return room.name == chat_window.name;
}) - open_windows_.begin();
@ -444,7 +444,7 @@ void chatbox::send_to_server(const ::config& cfg)
void chatbox::increment_waiting_whsipers(const std::string& name)
{
if(tlobby_chat_window* t = whisper_window_open(name, false)) {
if(lobby_chat_window* t = whisper_window_open(name, false)) {
t->pending_messages++;
if(t->pending_messages == 1) {
DBG_LB << "do whisper pending mark row " << (t - &open_windows_[0]) << " with " << t->name << "\n";
@ -453,14 +453,14 @@ void chatbox::increment_waiting_whsipers(const std::string& name)
// label& label = grid->get_widget<label>("room", false);
// label.set_use_markup(true);
// label.set_label(colorize("<" + t->name + ">", "red"));
find_widget<image>(grid, "pending_messages", false).set_visible(widget::tvisible::visible);
find_widget<image>(grid, "pending_messages", false).set_visible(widget::visibility::visible);
}
}
}
void chatbox::increment_waiting_messages(const std::string& room)
{
if(tlobby_chat_window* t = room_window_open(room, false)) {
if(lobby_chat_window* t = room_window_open(room, false)) {
t->pending_messages++;
if(t->pending_messages == 1) {
int idx = t - &open_windows_[0];
@ -470,14 +470,14 @@ void chatbox::increment_waiting_messages(const std::string& room)
// label& label = grid->get_widget<label>("room", false);
// label.set_use_markup(true);
// label.set_label(colorize(t->name, "red"));
find_widget<image>(grid, "pending_messages", false).set_visible(widget::tvisible::visible);
find_widget<image>(grid, "pending_messages", false).set_visible(widget::visibility::visible);
}
}
}
void chatbox::add_whisper_window_whisper(const std::string& sender, const std::string& message)
{
tlobby_chat_window* t = whisper_window_open(sender, false);
lobby_chat_window* t = whisper_window_open(sender, false);
if(!t) {
ERR_LB << "Whisper window not open in add_whisper_window_whisper for " << sender << "\n";
return;
@ -497,7 +497,7 @@ void chatbox::add_active_window_whisper(const std::string& sender,
void chatbox::close_window(size_t idx)
{
const tlobby_chat_window& t = open_windows_[idx];
const lobby_chat_window& t = open_windows_[idx];
bool active_changed = idx == active_window_;
DBG_LB << "Close window " << idx << " - " << t.name << "\n";
@ -541,7 +541,7 @@ void chatbox::add_room_window_message(const std::string& room,
const std::string& sender,
const std::string& message)
{
tlobby_chat_window* t = room_window_open(room, false);
lobby_chat_window* t = room_window_open(room, false);
if(!t) {
ERR_LB << "Room window not open in add_room_window_message for " << room << "\n";
return;
@ -562,7 +562,7 @@ void chatbox::add_active_window_message(const std::string& sender,
room_info* chatbox::active_window_room()
{
const tlobby_chat_window& t = open_windows_[active_window_];
const lobby_chat_window& t = open_windows_[active_window_];
if(t.whisper) {
return nullptr;
}
@ -595,7 +595,7 @@ void chatbox::process_room_join(const ::config& data)
}
} else {
if(player == preferences::login()) {
tlobby_chat_window* t = room_window_open(room, true);
lobby_chat_window* t = room_window_open(room, true);
lobby_info().open_room(room);
r = lobby_info().get_room(room);
assert(r);
@ -733,10 +733,10 @@ bool chatbox::process_network_data(const ::config& data)
chatbox_definition::chatbox_definition(const config& cfg)
: control_definition(cfg)
{
load_resolutions<tresolution>(cfg);
load_resolutions<resolution>(cfg);
}
chatbox_definition::tresolution::tresolution(const config& cfg)
chatbox_definition::resolution::resolution(const config& cfg)
: resolution_definition(cfg), grid()
{
state.push_back(state_definition(cfg.child("background")));
@ -766,9 +766,9 @@ widget* builder_chatbox::build() const
DBG_GUI_G << "Window builder: placed unit preview pane '" << id
<< "' with definition '" << definition << "'.\n";
std::shared_ptr<const chatbox_definition::tresolution> conf
std::shared_ptr<const chatbox_definition::resolution> conf
= std::static_pointer_cast<
const chatbox_definition::tresolution>(widget->config());
const chatbox_definition::resolution>(widget->config());
assert(conf);

View file

@ -41,9 +41,9 @@ namespace implementation
}
struct tlobby_chat_window
struct lobby_chat_window
{
tlobby_chat_window(const std::string& name, bool whisper)
lobby_chat_window(const std::string& name, bool whisper)
: name(name), whisper(whisper), pending_messages(0)
{
}
@ -119,7 +119,7 @@ private:
text_box* chat_input_;
std::vector<tlobby_chat_window> open_windows_;
std::vector<lobby_chat_window> open_windows_;
size_t active_window_;
@ -205,7 +205,7 @@ public:
* Switch to the window given by a valid pointer (e.g. received from a call
* to *_window_open)
*/
void switch_to_window(tlobby_chat_window* t);
void switch_to_window(lobby_chat_window* t);
void switch_to_window(size_t id);
@ -223,7 +223,7 @@ public:
* 'close' button will be disabled.
* @return valid ptr if the window was found or added, null otherwise
*/
tlobby_chat_window* room_window_open(const std::string& room,
lobby_chat_window* room_window_open(const std::string& room,
const bool open_new, const bool allow_close = true);
/**
@ -231,18 +231,18 @@ public:
* then it will be created if not found.
* @return valid ptr if the window was found or added, null otherwise
*/
tlobby_chat_window* whisper_window_open(const std::string& name,
lobby_chat_window* whisper_window_open(const std::string& name,
bool open_new);
/**
* Helper function to find and open a new window, used by *_window_open
*/
tlobby_chat_window* search_create_window(const std::string& name, const bool whisper, const bool open_new, const bool allow_close);
lobby_chat_window* search_create_window(const std::string& name, const bool whisper, const bool open_new, const bool allow_close);
void do_notify(t_notify_mode mode) { do_notify(mode, "", ""); }
void do_notify(t_notify_mode mode, const std::string & sender, const std::string & message) { do_mp_notify(mode, sender, message); }
void do_notify(notify_mode mode) { do_notify(mode, "", ""); }
void do_notify(notify_mode mode, const std::string & sender, const std::string & message) { do_mp_notify(mode, sender, message); }
void close_window_button_callback(tlobby_chat_window& chat_window, bool& handled, bool& halt);
void close_window_button_callback(lobby_chat_window& chat_window, bool& handled, bool& halt);
void process_room_join(const ::config& data);
@ -263,9 +263,9 @@ struct chatbox_definition : public control_definition
explicit chatbox_definition(const config& cfg);
struct tresolution : public resolution_definition
struct resolution : public resolution_definition
{
explicit tresolution(const config& cfg);
explicit resolution(const config& cfg);
builder_grid_ptr grid;
};

View file

@ -141,8 +141,8 @@ void container_base::impl_draw_children(surface& frame_buffer,
int x_offset,
int y_offset)
{
assert(get_visible() == widget::tvisible::visible
&& grid_.get_visible() == widget::tvisible::visible);
assert(get_visible() == widget::visibility::visible
&& grid_.get_visible() == widget::visibility::visible);
grid_.draw_children(frame_buffer, x_offset, y_offset);
}

View file

@ -137,7 +137,7 @@ void control::set_members(const string_map& data)
bool control::disable_click_dismiss() const
{
return get_visible() == widget::tvisible::visible && get_active();
return get_visible() == widget::visibility::visible && get_active();
}
iterator::walker_base* control::create_walker()

View file

@ -442,7 +442,7 @@ void debug_layout_graph::grid_generate_info(std::ostream& out,
}
void debug_layout_graph::child_generate_info(std::ostream& out,
const grid::tchild& child,
const grid::child& child,
const std::string& id) const
{
assert(!id.empty());

View file

@ -171,7 +171,7 @@ private:
* @param id The dof-file-id of the child.
*/
void child_generate_info(std::ostream& out,
const grid::tchild& child,
const grid::child& child,
const std::string& id) const;
/***** ***** Helper ***** *****/

View file

@ -70,7 +70,7 @@ drawing_definition::drawing_definition(const config& cfg)
{
DBG_GUI_P << "Parsing drawing " << id << '\n';
load_resolutions<tresolution>(cfg);
load_resolutions<resolution>(cfg);
}
/*WIKI
@ -97,7 +97,7 @@ drawing_definition::drawing_definition(const config& cfg)
* @end{tag}{name="drawing_definition"}
* @end{parent}{name="gui/"}
*/
drawing_definition::tresolution::tresolution(const config& cfg)
drawing_definition::resolution::resolution(const config& cfg)
: resolution_definition(cfg)
{
/*

View file

@ -91,9 +91,9 @@ struct drawing_definition : public control_definition
{
explicit drawing_definition(const config& cfg);
struct tresolution : public resolution_definition
struct resolution : public resolution_definition
{
explicit tresolution(const config& cfg);
explicit resolution(const config& cfg);
};
};

View file

@ -22,7 +22,7 @@
#include "gui/widgets/selectable.hpp"
#include "gui/widgets/toggle_button.hpp"
#include "gui/widgets/toggle_panel.hpp"
#include "gui/widgets/window.hpp" // For window::tvisible
#include "gui/widgets/window.hpp" // For window::visibility
#include "wml_exception.hpp"
namespace gui2
@ -527,8 +527,8 @@ struct show : public virtual generator_base
{
void select(grid& grid, const bool show)
{
grid.set_visible(show ? widget::tvisible::visible
: widget::tvisible::hidden);
grid.set_visible(show ? widget::visibility::visible
: widget::visibility::hidden);
}
/**
@ -651,8 +651,8 @@ public:
/*** Set the proper visible state. ***/
items_[index]->shown = show;
items_[index]
->grid.set_visible(show ? widget::tvisible::visible
: widget::tvisible::invisible);
->grid.set_visible(show ? widget::visibility::visible
: widget::visibility::invisible);
/*** Update the selection. ***/
minimum_selection::set_item_shown(index, show);
@ -663,7 +663,7 @@ public:
virtual bool get_item_shown(const unsigned index) const override
{
assert(index < items_.size());
return items_[index]->shown && items_[index]->grid.get_visible() != window::tvisible::invisible;
return items_[index]->shown && items_[index]->grid.get_visible() != window::visibility::invisible;
}
@ -755,7 +755,7 @@ public:
assert(list_builder);
assert(index == -1 || static_cast<unsigned>(index) < items_.size());
titem* item = new titem;
child* item = new child;
list_builder->build(&item->grid);
init(&item->grid, item_data, callback);
@ -796,7 +796,7 @@ public:
{
for(auto item : items_)
{
if(item->grid.get_visible() != widget::tvisible::invisible
if(item->grid.get_visible() != widget::visibility::invisible
&& item->shown) {
item->grid.layout_initialise(full_initialisation);
@ -851,12 +851,12 @@ public:
int x_offset,
int y_offset) override
{
assert(this->get_visible() == widget::tvisible::visible);
assert(this->get_visible() == widget::visibility::visible);
calculate_order();
for(auto index : order_)
{
titem* item = items_[index];
if(item->grid.get_visible() == widget::tvisible::visible
child* item = items_[index];
if(item->grid.get_visible() == widget::visibility::visible
&& item->shown) {
item->grid.draw_children(frame_buffer, x_offset, y_offset);
@ -959,10 +959,10 @@ protected:
private:
/** Definition of an item. */
struct titem
struct child
{
titem() : grid(), selected(false), shown(true), ordered_index(0)
child() : grid(), selected(false), shown(true), ordered_index(0)
{
}
@ -993,8 +993,8 @@ private:
int last_selected_item_;
/** The items in the generator. */
typedef std::vector<titem*> titems;
titems items_;
typedef std::vector<child*> child_list;
child_list items_;
/** the elements of order_ are indexes to items_ */
mutable std::vector<size_t> order_;
@ -1015,9 +1015,9 @@ private:
struct calculate_order_helper
{
const torder_func& order_func_;
const titems& items_;
const child_list& items_;
calculate_order_helper(const torder_func& order_func, const titems& items)
calculate_order_helper(const torder_func& order_func, const child_list& items)
: order_func_(order_func)
, items_(items)
{

View file

@ -28,7 +28,7 @@
#define LOG_IMPL_HEADER "grid [" + grid.id() + "] " + __func__ + ':'
#define LOG_CHILD_SCOPE_HEADER \
"grid::tchild [" + (widget_ ? widget_->id() : "-") + "] " + __func__
"grid::child [" + (widget_ ? widget_->id() : "-") + "] " + __func__
#define LOG_CHILD_HEADER LOG_CHILD_SCOPE_HEADER + ':'
namespace gui2
@ -76,7 +76,7 @@ void grid::set_child(widget* widget,
assert(flags & VERTICAL_MASK);
assert(flags & HORIZONTAL_MASK);
tchild& cell = child(row, col);
child& cell = get_child(row, col);
// clear old child if any
if(cell.get_widget()) {
@ -141,7 +141,7 @@ void grid::remove_child(const unsigned row, const unsigned col)
{
assert(row < rows_ && col < cols_);
tchild& cell = child(row, col);
child& cell = get_child(row, col);
if(cell.get_widget()) {
delete cell.get_widget();
@ -398,7 +398,7 @@ point grid::calculate_best_size() const
for(unsigned row = 0; row < rows_; ++row) {
for(unsigned col = 0; col < cols_; ++col) {
const point size = child(row, col).get_best_size();
const point size = get_child(row, col).get_best_size();
if(size.x > static_cast<int>(col_width_[col])) {
col_width_[col] = size.x;
@ -645,7 +645,7 @@ bool grid::has_widget(const widget& widget) const
bool grid::disable_click_dismiss() const
{
if(get_visible() != widget::tvisible::visible) {
if(get_visible() != widget::visibility::visible) {
return false;
}
@ -702,7 +702,7 @@ void grid::set_rows_cols(const unsigned rows, const unsigned cols)
children_.resize(rows_ * cols_);
}
point grid::tchild::get_best_size() const
point grid::child::get_best_size() const
{
log_scope2(log_gui_layout, LOG_CHILD_SCOPE_HEADER)
@ -712,7 +712,7 @@ point grid::tchild::get_best_size() const
return border_space();
}
if(widget_->get_visible() == widget::tvisible::invisible) {
if(widget_->get_visible() == widget::visibility::invisible) {
DBG_GUI_L << LOG_CHILD_HEADER << " has widget " << true
<< " widget visible " << false << " returning 0,0"
<< ".\n";
@ -727,10 +727,10 @@ point grid::tchild::get_best_size() const
return best_size;
}
void grid::tchild::place(point origin, point size)
void grid::child::place(point origin, point size)
{
assert(get_widget());
if(get_widget()->get_visible() == widget::tvisible::invisible) {
if(get_widget()->get_visible() == widget::visibility::invisible) {
return;
}
@ -855,22 +855,22 @@ void grid::tchild::place(point origin, point size)
get_widget()->place(widget_orig, widget_size);
}
void grid::tchild::layout_initialise(const bool full_initialisation)
void grid::child::layout_initialise(const bool full_initialisation)
{
assert(widget_);
if(widget_->get_visible() != widget::tvisible::invisible) {
if(widget_->get_visible() != widget::visibility::invisible) {
widget_->layout_initialise(full_initialisation);
}
}
const std::string& grid::tchild::id() const
const std::string& grid::child::id() const
{
assert(widget_);
return widget_->id();
}
point grid::tchild::border_space() const
point grid::child::border_space() const
{
point result(0, 0);
@ -901,8 +901,8 @@ void grid::layout(const point& origin)
<< " at origin " << orig << " with size " << size
<< ".\n";
if(child(row, col).get_widget()) {
child(row, col).place(orig, size);
if(get_child(row, col).get_widget()) {
get_child(row, col).place(orig, size);
}
orig.x += col_width_[col];
@ -924,7 +924,7 @@ void grid::impl_draw_children(surface& frame_buffer, int x_offset, int y_offset)
* the area not used for resizing the screen, this call `fixes' that.
*/
assert(get_visible() == widget::tvisible::visible);
assert(get_visible() == widget::visibility::visible);
set_is_dirty(false);
for(auto & child : children_)
@ -933,11 +933,11 @@ void grid::impl_draw_children(surface& frame_buffer, int x_offset, int y_offset)
widget* widget = child.get_widget();
assert(widget);
if(widget->get_visible() != widget::tvisible::visible) {
if(widget->get_visible() != widget::visibility::visible) {
continue;
}
if(widget->get_drawing_action() == widget::tredraw_action::none) {
if(widget->get_drawing_action() == widget::redraw_action::none) {
continue;
}
@ -955,7 +955,7 @@ unsigned grid_implementation::row_request_reduce_height(
unsigned required_height = 0;
for(size_t x = 0; x < grid.cols_; ++x) {
grid::tchild& cell = grid.child(row, x);
grid::child& cell = grid.get_child(row, x);
cell_request_reduce_height(cell, maximum_height);
const point size(cell.get_best_size());
@ -980,7 +980,7 @@ unsigned grid_implementation::column_request_reduce_width(
unsigned required_width = 0;
for(size_t y = 0; y < grid.rows_; ++y) {
grid::tchild& cell = grid.child(y, column);
grid::child& cell = grid.get_child(y, column);
cell_request_reduce_width(cell, maximum_width);
const point size(cell.get_best_size());
@ -999,12 +999,12 @@ unsigned grid_implementation::column_request_reduce_width(
}
void
grid_implementation::cell_request_reduce_height(grid::tchild& child,
grid_implementation::cell_request_reduce_height(grid::child& child,
const unsigned maximum_height)
{
assert(child.widget_);
if(child.widget_->get_visible() == widget::tvisible::invisible) {
if(child.widget_->get_visible() == widget::visibility::invisible) {
return;
}
@ -1013,12 +1013,12 @@ grid_implementation::cell_request_reduce_height(grid::tchild& child,
}
void
grid_implementation::cell_request_reduce_width(grid::tchild& child,
grid_implementation::cell_request_reduce_width(grid::child& child,
const unsigned maximum_width)
{
assert(child.widget_);
if(child.widget_->get_visible() == widget::tvisible::invisible) {
if(child.widget_->get_visible() == widget::visibility::invisible) {
return;
}

View file

@ -175,13 +175,13 @@ public:
/** Returns the widget in the selected cell. */
const widget* get_widget(const unsigned row, const unsigned col) const
{
return child(row, col).get_widget();
return get_child(row, col).get_widget();
}
/** Returns the widget in the selected cell. */
widget* get_widget(const unsigned row, const unsigned col)
{
return child(row, col).get_widget();
return get_child(row, col).get_widget();
}
virtual bool can_mouse_focus() const override { return false; }
@ -306,12 +306,12 @@ public:
private:
/** Child item of the grid. */
class tchild
class child
{
friend struct grid_implementation;
public:
tchild() : flags_(0), border_size_(0), widget_(nullptr)
child() : flags_(0), border_size_(0), widget_(nullptr)
// Fixme make a class where we can store some properties in the cache
// regarding size etc.
@ -394,15 +394,15 @@ private:
/** Returns the space needed for the border. */
point border_space() const;
}; // class tchild
}; // class child
public:
/** Iterator for the tchild items. */
/** Iterator for the child items. */
class iterator
{
public:
iterator(std::vector<tchild>::iterator itor) : itor_(itor)
iterator(std::vector<child>::iterator itor) : itor_(itor)
{
}
@ -434,7 +434,7 @@ public:
}
private:
std::vector<tchild>::iterator itor_;
std::vector<child>::iterator itor_;
};
iterator begin()
@ -473,12 +473,12 @@ private:
* All children are stored in a 1D vector and the formula to access a cell
* is: rows_ * col + row. All other vectors use the same access formula.
*/
std::vector<tchild> children_;
const tchild& child(const unsigned row, const unsigned col) const
std::vector<child> children_;
const child& get_child(const unsigned row, const unsigned col) const
{
return children_[rows_ * col + row];
}
tchild& child(const unsigned row, const unsigned col)
child& get_child(const unsigned row, const unsigned col)
{
return children_[rows_ * col + row];
}

View file

@ -56,7 +56,7 @@ struct grid_implementation
const point& coordinate,
const bool must_be_active)
{
typedef typename utils::const_clone<grid::tchild, W>::type hack;
typedef typename utils::const_clone<grid::child, W>::type hack;
for(hack & child : grid.children_)
{
@ -92,7 +92,7 @@ struct grid_implementation
return widget;
}
typedef typename utils::const_clone<grid::tchild, W>::type hack;
typedef typename utils::const_clone<grid::child, W>::type hack;
for(hack & child : grid.children_)
{
@ -143,7 +143,7 @@ private:
* @param child The cell whose widget needs to be resized.
* @param maximum_height The wanted maximum height.
*/
static void cell_request_reduce_height(grid::tchild& child,
static void cell_request_reduce_height(grid::child& child,
const unsigned maximum_height);
/**
@ -152,7 +152,7 @@ private:
* @param child The cell whose widget needs to be resized.
* @param maximum_width The wanted maximum width.
*/
static void cell_request_reduce_width(grid::tchild& child,
static void cell_request_reduce_width(grid::child& child,
const unsigned maximum_width);
};

View file

@ -35,9 +35,9 @@ REGISTER_WIDGET(horizontal_scrollbar)
unsigned horizontal_scrollbar::minimum_positioner_length() const
{
std::shared_ptr<const horizontal_scrollbar_definition::tresolution>
std::shared_ptr<const horizontal_scrollbar_definition::resolution>
conf = std::static_pointer_cast<const horizontal_scrollbar_definition::
tresolution>(config());
resolution>(config());
assert(conf);
return conf->minimum_positioner_length;
@ -45,9 +45,9 @@ unsigned horizontal_scrollbar::minimum_positioner_length() const
unsigned horizontal_scrollbar::maximum_positioner_length() const
{
std::shared_ptr<const horizontal_scrollbar_definition::tresolution>
std::shared_ptr<const horizontal_scrollbar_definition::resolution>
conf = std::static_pointer_cast<const horizontal_scrollbar_definition::
tresolution>(config());
resolution>(config());
assert(conf);
return conf->maximum_positioner_length;
@ -55,9 +55,9 @@ unsigned horizontal_scrollbar::maximum_positioner_length() const
unsigned horizontal_scrollbar::offset_before() const
{
std::shared_ptr<const horizontal_scrollbar_definition::tresolution>
std::shared_ptr<const horizontal_scrollbar_definition::resolution>
conf = std::static_pointer_cast<const horizontal_scrollbar_definition::
tresolution>(config());
resolution>(config());
assert(conf);
return conf->left_offset;
@ -65,9 +65,9 @@ unsigned horizontal_scrollbar::offset_before() const
unsigned horizontal_scrollbar::offset_after() const
{
std::shared_ptr<const horizontal_scrollbar_definition::tresolution>
std::shared_ptr<const horizontal_scrollbar_definition::resolution>
conf = std::static_pointer_cast<const horizontal_scrollbar_definition::
tresolution>(config());
resolution>(config());
assert(conf);
return conf->right_offset;
@ -121,7 +121,7 @@ horizontal_scrollbar_definition::horizontal_scrollbar_definition(
{
DBG_GUI_P << "Parsing horizontal scrollbar " << id << '\n';
load_resolutions<tresolution>(cfg);
load_resolutions<resolution>(cfg);
}
/*WIKI
@ -172,7 +172,7 @@ horizontal_scrollbar_definition::horizontal_scrollbar_definition(
* @end{tag}{name="horizontal_scrollbar_definition"}
* @end{parent}{name="gui/"}
*/
horizontal_scrollbar_definition::tresolution::tresolution(const config& cfg)
horizontal_scrollbar_definition::resolution::resolution(const config& cfg)
: resolution_definition(cfg)
, minimum_positioner_length(cfg["minimum_positioner_length"])
, maximum_positioner_length(cfg["maximum_positioner_length"])

View file

@ -77,9 +77,9 @@ struct horizontal_scrollbar_definition : public control_definition
{
explicit horizontal_scrollbar_definition(const config& cfg);
struct tresolution : public resolution_definition
struct resolution : public resolution_definition
{
explicit tresolution(const config& cfg);
explicit resolution(const config& cfg);
unsigned minimum_positioner_length;
unsigned maximum_positioner_length;

View file

@ -103,7 +103,7 @@ image_definition::image_definition(const config& cfg)
{
DBG_GUI_P << "Parsing image " << id << '\n';
load_resolutions<tresolution>(cfg);
load_resolutions<resolution>(cfg);
}
/*WIKI
@ -129,7 +129,7 @@ image_definition::image_definition(const config& cfg)
* @end{tag}{name="image_definition"}
* @end{parent}{name="gui/"}
*/
image_definition::tresolution::tresolution(const config& cfg)
image_definition::resolution::resolution(const config& cfg)
: resolution_definition(cfg)
{
// Note the order should be the same as the enum state_t in image.hpp.

View file

@ -103,9 +103,9 @@ struct image_definition : public control_definition
{
explicit image_definition(const config& cfg);
struct tresolution : public resolution_definition
struct resolution : public resolution_definition
{
explicit tresolution(const config& cfg);
explicit resolution(const config& cfg);
};
};

View file

@ -138,8 +138,8 @@ void label::load_config_extra()
{
assert(config());
std::shared_ptr<const label_definition::tresolution>
conf = std::static_pointer_cast<const label_definition::tresolution>(
std::shared_ptr<const label_definition::resolution>
conf = std::static_pointer_cast<const label_definition::resolution>(
config());
assert(conf);
@ -220,7 +220,7 @@ label_definition::label_definition(const config& cfg)
{
DBG_GUI_P << "Parsing label " << id << '\n';
load_resolutions<tresolution>(cfg);
load_resolutions<resolution>(cfg);
}
/*WIKI
@ -261,7 +261,7 @@ label_definition::label_definition(const config& cfg)
* @end{tag}{name="label_definition"}
* @end{parent}{name="gui/"}
*/
label_definition::tresolution::tresolution(const config& cfg)
label_definition::resolution::resolution(const config& cfg)
: resolution_definition(cfg)
, link_aware(cfg["link_aware"].to_bool(false))
, link_color(cfg["link_color"].str().size() > 0 ? cfg["link_color"].str() : "#ffff00")

View file

@ -138,9 +138,9 @@ struct label_definition : public control_definition
explicit label_definition(const config& cfg);
struct tresolution : public resolution_definition
struct resolution : public resolution_definition
{
explicit tresolution(const config& cfg);
explicit resolution(const config& cfg);
bool link_aware;
std::string link_color;

View file

@ -140,7 +140,7 @@ void list_view::remove_row(const unsigned row, unsigned count)
unsigned height_reduced = 0;
for(; count; --count) {
if(generator_->item(row).get_visible() != tvisible::invisible) {
if(generator_->item(row).get_visible() != visibility::invisible) {
height_reduced += generator_->item(row).get_height();
}
generator_->delete_item(row);
@ -181,7 +181,7 @@ void list_view::set_row_shown(const unsigned row, const bool shown)
bool resize_needed = false;
{
window::tinvalidate_layout_blocker invalidate_layout_blocker(*window);
window::invalidate_layout_blocker invalidate_layout_blocker(*window);
generator_->set_item_shown(row, shown);
generator_->place(generator_->get_origin(),
@ -213,7 +213,7 @@ void list_view::set_row_shown(const boost::dynamic_bitset<>& shown)
bool resize_needed = false;
{
window::tinvalidate_layout_blocker invalidate_layout_blocker(*window);
window::invalidate_layout_blocker invalidate_layout_blocker(*window);
for(size_t i = 0; i < shown.size(); ++i) {
generator_->set_item_shown(i, shown[i]);
@ -325,7 +325,7 @@ void list_view::resize_content(
void list_view::init()
{
init_grid(cast<listbox_definition::tresolution>(config()).grid);
init_grid(cast<listbox_definition::resolution>(config()).grid);
set_single_child(find_widget<grid>(&grid(), "_list_grid", false),
generator_);
@ -336,19 +336,19 @@ void list_view::init()
*/
grid* g = find_widget<grid>(&grid(), "_header_grid", false, false);
if(g)
g->set_visible(widget::tvisible::invisible);
g->set_visible(widget::visibility::invisible);
g = find_widget<grid>(&grid(), "_footer_grid", false, false);
if(g)
g->set_visible(widget::tvisible::invisible);
g->set_visible(widget::visibility::invisible);
g = find_widget<grid>(&grid(), "_vertical_scrollbar_grid", false, false);
if(g)
g->set_visible(widget::tvisible::invisible);
g->set_visible(widget::visibility::invisible);
g = find_widget<grid>(&grid(), "_horizontal_scrollbar_grid", false, false);
if(g)
g->set_visible(widget::tvisible::invisible);
g->set_visible(widget::visibility::invisible);
}
bool list_view::get_active() const

View file

@ -114,7 +114,7 @@ void listbox::remove_row(const unsigned row, unsigned count)
int row_pos_y = is_horizonal_ ? -1 : generator_->item(row).get_y() - content_grid_->get_y();
int row_pos_x = is_horizonal_ ? -1 : 0;
for(; count; --count) {
if(generator_->item(row).get_visible() != tvisible::invisible) {
if(generator_->item(row).get_visible() != visibility::invisible) {
if(is_horizonal_) {
width_reduced += generator_->item(row).get_width();
}
@ -162,7 +162,7 @@ void listbox::set_row_shown(const unsigned row, const bool shown)
bool resize_needed;
{
window::tinvalidate_layout_blocker invalidate_layout_blocker(*window);
window::invalidate_layout_blocker invalidate_layout_blocker(*window);
generator_->set_item_shown(row, shown);
point best_size = generator_->calculate_best_size();
@ -200,7 +200,7 @@ void listbox::set_row_shown(const boost::dynamic_bitset<>& shown)
bool resize_needed;
{
window::tinvalidate_layout_blocker invalidate_layout_blocker(*window);
window::invalidate_layout_blocker invalidate_layout_blocker(*window);
for(size_t i = 0; i < shown.size(); ++i) {
generator_->set_item_shown(i, shown[i]);
@ -296,7 +296,7 @@ void listbox::set_self_active(const bool /*active*/)
bool listbox::update_content_size()
{
if(get_visible() == widget::tvisible::invisible) {
if(get_visible() == widget::visibility::invisible) {
return true;
}
@ -391,7 +391,7 @@ void listbox::resize_content(const int width_modification,
void listbox::resize_content(const widget& row)
{
if(row.get_visible() == tvisible::invisible) {
if(row.get_visible() == visibility::invisible) {
return;
}
@ -713,7 +713,7 @@ listbox_definition::listbox_definition(const config& cfg)
{
DBG_GUI_P << "Parsing listbox " << id << '\n';
load_resolutions<tresolution>(cfg);
load_resolutions<resolution>(cfg);
}
/*WIKI
@ -795,7 +795,7 @@ listbox_definition::listbox_definition(const config& cfg)
* @macro = horizontal_listbox_description
* The definition of a horizontal listbox is the same as for a normal listbox.
*/
listbox_definition::tresolution::tresolution(const config& cfg)
listbox_definition::resolution::resolution(const config& cfg)
: resolution_definition(cfg), grid(nullptr)
{
// Note the order should be the same as the enum state_t in listbox.hpp.
@ -1020,8 +1020,8 @@ widget* builder_listbox::build() const
DBG_GUI_G << "Window builder: placed listbox '" << id
<< "' with definition '" << definition << "'.\n";
std::shared_ptr<const listbox_definition::tresolution>
conf = std::static_pointer_cast<const listbox_definition::tresolution>(
std::shared_ptr<const listbox_definition::resolution>
conf = std::static_pointer_cast<const listbox_definition::resolution>(
widget->config());
assert(conf);
@ -1145,8 +1145,8 @@ widget* builder_horizontal_listbox::build() const
DBG_GUI_G << "Window builder: placed listbox '" << id
<< "' with definition '" << definition << "'.\n";
std::shared_ptr<const listbox_definition::tresolution>
conf = std::static_pointer_cast<const listbox_definition::tresolution>(
std::shared_ptr<const listbox_definition::resolution>
conf = std::static_pointer_cast<const listbox_definition::resolution>(
widget->config());
assert(conf);
@ -1270,8 +1270,8 @@ widget* builder_grid_listbox::build() const
DBG_GUI_G << "Window builder: placed listbox '" << id
<< "' with definition '" << definition << "'.\n";
std::shared_ptr<const listbox_definition::tresolution>
conf = std::static_pointer_cast<const listbox_definition::tresolution>(
std::shared_ptr<const listbox_definition::resolution>
conf = std::static_pointer_cast<const listbox_definition::resolution>(
widget->config());
assert(conf);

View file

@ -404,9 +404,9 @@ struct listbox_definition : public control_definition
explicit listbox_definition(const config& cfg);
struct tresolution : public resolution_definition
struct resolution : public resolution_definition
{
explicit tresolution(const config& cfg);
explicit resolution(const config& cfg);
builder_grid_ptr grid;
};
@ -425,8 +425,8 @@ struct builder_listbox : public builder_control
widget* build() const;
scrollbar_container::tscrollbar_mode vertical_scrollbar_mode;
scrollbar_container::tscrollbar_mode horizontal_scrollbar_mode;
scrollbar_container::scrollbar_mode vertical_scrollbar_mode;
scrollbar_container::scrollbar_mode horizontal_scrollbar_mode;
builder_grid_ptr header;
builder_grid_ptr footer;
@ -452,8 +452,8 @@ struct builder_horizontal_listbox : public builder_control
widget* build() const;
scrollbar_container::tscrollbar_mode vertical_scrollbar_mode;
scrollbar_container::tscrollbar_mode horizontal_scrollbar_mode;
scrollbar_container::scrollbar_mode vertical_scrollbar_mode;
scrollbar_container::scrollbar_mode horizontal_scrollbar_mode;
builder_grid_ptr list_builder;
@ -476,8 +476,8 @@ struct builder_grid_listbox : public builder_control
widget* build() const;
scrollbar_container::tscrollbar_mode vertical_scrollbar_mode;
scrollbar_container::tscrollbar_mode horizontal_scrollbar_mode;
scrollbar_container::scrollbar_mode vertical_scrollbar_mode;
scrollbar_container::scrollbar_mode horizontal_scrollbar_mode;
builder_grid_ptr list_builder;

View file

@ -37,22 +37,22 @@ namespace gui2
REGISTER_WIDGET(matrix)
tstate_default::tstate_default() : state_(ENABLED)
state_default::state_default() : state_(ENABLED)
{
}
void tstate_default::set_active(const bool active)
void state_default::set_active(const bool active)
{
if(get_active() != active) {
state_ = active ? ENABLED : DISABLED;
}
}
bool tstate_default::get_active() const
bool state_default::get_active() const
{
return state_ != DISABLED;
}
unsigned tstate_default::get_state() const
unsigned state_default::get_state() const
{
return state_;
}
@ -60,8 +60,8 @@ unsigned tstate_default::get_state() const
matrix::matrix(const implementation::builder_matrix& builder)
: tbase(builder, get_control_type()), content_(), pane_(nullptr)
{
std::shared_ptr<const matrix_definition::tresolution>
cfg = std::static_pointer_cast<const matrix_definition::tresolution>(
std::shared_ptr<const matrix_definition::resolution>
cfg = std::static_pointer_cast<const matrix_definition::resolution>(
config());
builder_widget::replacements_map replacements;
@ -219,10 +219,10 @@ matrix_definition::matrix_definition(const config& cfg)
{
DBG_GUI_P << "Parsing matrix " << id << '\n';
load_resolutions<tresolution>(cfg);
load_resolutions<resolution>(cfg);
}
matrix_definition::tresolution::tresolution(const config& cfg)
matrix_definition::resolution::resolution(const config& cfg)
: resolution_definition(cfg)
, content(new builder_grid(cfg.child("content", "[matrix_definition]")))
{

View file

@ -32,10 +32,10 @@ namespace implementation
struct builder_matrix;
}
class tstate_default
class state_default
{
public:
tstate_default();
state_default();
void set_active(const bool active);
@ -95,7 +95,7 @@ public:
}
};
typedef control_NEW<tstate_default> tbase;
typedef control_NEW<state_default> tbase;
/** The matrix class. */
class matrix : public tbase
@ -237,9 +237,9 @@ struct matrix_definition : public control_definition
explicit matrix_definition(const config& cfg);
struct tresolution : public resolution_definition
struct resolution : public resolution_definition
{
explicit tresolution(const config& cfg);
explicit resolution(const config& cfg);
builder_grid_ptr content;
};
@ -258,8 +258,8 @@ struct builder_matrix : public builder_control
widget* build() const;
scrollbar_container::tscrollbar_mode vertical_scrollbar_mode;
scrollbar_container::tscrollbar_mode horizontal_scrollbar_mode;
scrollbar_container::scrollbar_mode vertical_scrollbar_mode;
scrollbar_container::scrollbar_mode horizontal_scrollbar_mode;
builder_grid_ptr builder_top;
builder_grid_ptr builder_bottom;

View file

@ -204,7 +204,7 @@ menu_button_definition::menu_button_definition(const config& cfg)
{
DBG_GUI_P << "Parsing menu_button " << id << '\n';
load_resolutions<tresolution>(cfg);
load_resolutions<resolution>(cfg);
}
/*WIKI
@ -235,7 +235,7 @@ menu_button_definition::menu_button_definition(const config& cfg)
* @end{tag}{name="menu_button_definition"}
* @end{parent}{name="gui/"}
*/
menu_button_definition::tresolution::tresolution(const config& cfg)
menu_button_definition::resolution::resolution(const config& cfg)
: resolution_definition(cfg)
{
// Note the order should be the same as the enum state_t in menu_button.hpp.

View file

@ -150,9 +150,9 @@ struct menu_button_definition : public control_definition
{
explicit menu_button_definition(const config& cfg);
struct tresolution : public resolution_definition
struct resolution : public resolution_definition
{
explicit tresolution(const config& cfg);
explicit resolution(const config& cfg);
};
};

View file

@ -62,9 +62,9 @@ unsigned minimap::get_state() const
}
/** Key type for the cache. */
struct tkey
struct key_type
{
tkey(const int w, const int h, const std::string& map_data)
key_type(const int w, const int h, const std::string& map_data)
: w(w), h(h), map_data(map_data)
{
}
@ -79,7 +79,7 @@ struct tkey
const std::string map_data;
};
static bool operator<(const tkey& lhs, const tkey& rhs)
static bool operator<(const key_type& lhs, const key_type& rhs)
{
return lhs.w < rhs.w
|| (lhs.w == rhs.w
@ -88,9 +88,9 @@ static bool operator<(const tkey& lhs, const tkey& rhs)
}
/** Value type for the cache. */
struct tvalue
struct value_type
{
tvalue(const surface& surf) : surf(surf), age(1)
value_type(const surface& surf) : surf(surf), age(1)
{
}
@ -134,7 +134,7 @@ static const size_t cache_max_size = 100;
static const ::config* terrain = nullptr;
/** The cache. */
typedef std::map<tkey, tvalue> tcache;
typedef std::map<key_type, value_type> tcache;
static tcache cache;
static bool compare(const std::pair<unsigned, tcache::iterator>& lhs,
@ -197,7 +197,7 @@ const surface minimap::get_image(const int w, const int h) const
cache.clear();
}
const tkey key(w, h, map_data_);
const key_type key(w, h, map_data_);
tcache::iterator itor = cache.find(key);
if(itor != cache.end()) {
@ -216,7 +216,7 @@ const surface minimap::get_image(const int w, const int h) const
{
const gamemap map(std::make_shared<terrain_type_data>(*terrain_), map_data_);
const surface surf = image::getMinimap(w, h, map, nullptr);
cache.insert(std::make_pair(key, tvalue(surf)));
cache.insert(std::make_pair(key, value_type(surf)));
#ifdef DEBUG_MINIMAP_CACHE
std::cerr << '-';
#endif
@ -269,7 +269,7 @@ minimap_definition::minimap_definition(const config& cfg)
{
DBG_GUI_P << "Parsing minimap " << id << '\n';
load_resolutions<tresolution>(cfg);
load_resolutions<resolution>(cfg);
}
/*WIKI
@ -291,7 +291,7 @@ minimap_definition::minimap_definition(const config& cfg)
* @end{tag}{name="minimap_definition"}
* @end{parent}{name="gui/"}
*/
minimap_definition::tresolution::tresolution(const config& cfg)
minimap_definition::resolution::resolution(const config& cfg)
: resolution_definition(cfg)
{
// Note the order should be the same as the enum state_t in minimap.hpp.

View file

@ -115,9 +115,9 @@ struct minimap_definition : public control_definition
{
explicit minimap_definition(const config& cfg);
struct tresolution : public resolution_definition
struct resolution : public resolution_definition
{
explicit tresolution(const config& cfg);
explicit resolution(const config& cfg);
};
};

View file

@ -185,7 +185,7 @@ multi_page_definition::multi_page_definition(const config& cfg)
{
DBG_GUI_P << "Parsing multipage " << id << '\n';
load_resolutions<tresolution>(cfg);
load_resolutions<resolution>(cfg);
}
/*WIKI
@ -209,7 +209,7 @@ multi_page_definition::multi_page_definition(const config& cfg)
* @end{parent}{name="gui/"}
* A multipage has no states.
*/
multi_page_definition::tresolution::tresolution(const config& cfg)
multi_page_definition::resolution::resolution(const config& cfg)
: resolution_definition(cfg), grid(nullptr)
{
const config& child = cfg.child("grid");
@ -312,8 +312,8 @@ widget* builder_multi_page::build() const
DBG_GUI_G << "Window builder: placed multi_page '" << id
<< "' with definition '" << definition << "'.\n";
std::shared_ptr<const multi_page_definition::tresolution>
conf = std::static_pointer_cast<const multi_page_definition::tresolution>(
std::shared_ptr<const multi_page_definition::resolution>
conf = std::static_pointer_cast<const multi_page_definition::resolution>(
widget->config());
assert(conf);

View file

@ -177,9 +177,9 @@ struct multi_page_definition : public control_definition
{
explicit multi_page_definition(const config& cfg);
struct tresolution : public resolution_definition
struct resolution : public resolution_definition
{
explicit tresolution(const config& cfg);
explicit resolution(const config& cfg);
builder_grid_ptr grid;
};

View file

@ -41,7 +41,7 @@ namespace gui2
* functions. It also facilitates to create duplicates of functions for a const
* and a non-const member function.
*/
struct tpane_implementation
struct pane_implementation
{
/**
* Implementation for the wrappers for
@ -61,11 +61,10 @@ struct tpane_implementation
return nullptr;
}
typedef typename utils::const_clone<pane::titem, W>::reference thack;
for(thack item : pane->items_)
for(auto item : pane->items_)
{
if(item.grid->get_visible() == widget::tvisible::invisible) {
if(item.grid->get_visible() == widget::visibility::invisible) {
continue;
}
@ -95,8 +94,7 @@ struct tpane_implementation
static typename utils::const_clone<grid, W>::pointer
get_grid(W pane, const unsigned id)
{
typedef typename utils::const_clone<pane::titem, W>::reference thack;
for(thack item : pane->items_)
for(auto item : pane->items_)
{
if(item.id == id) {
@ -142,7 +140,7 @@ pane* pane::build(const implementation::builder_pane& builder)
unsigned pane::create_item(const std::map<std::string, string_map>& item_data,
const std::map<std::string, std::string>& tags)
{
titem item = { item_id_generator_++, tags, item_builder_->build() };
item item = { item_id_generator_++, tags, item_builder_->build() };
item.grid->set_parent(this);
@ -183,7 +181,7 @@ void pane::layout_initialise(const bool full_initialisation)
for(auto & item : items_)
{
if(item.grid->get_visible() != widget::tvisible::invisible) {
if(item.grid->get_visible() != widget::visibility::invisible) {
item.grid->layout_initialise(full_initialisation);
}
}
@ -196,7 +194,7 @@ pane::impl_draw_children(surface& frame_buffer, int x_offset, int y_offset)
for(auto & item : items_)
{
if(item.grid->get_visible() != widget::tvisible::invisible) {
if(item.grid->get_visible() != widget::visibility::invisible) {
item.grid->draw_children(frame_buffer, x_offset, y_offset);
}
}
@ -224,8 +222,8 @@ void pane::filter(const tfilter_functor& filter_functor)
for(auto & item : items_)
{
item.grid->set_visible(filter_functor(item)
? widget::tvisible::visible
: widget::tvisible::invisible);
? widget::visibility::visible
: widget::visibility::invisible);
}
set_origin_children();
@ -237,13 +235,13 @@ void pane::request_reduce_width(const unsigned /*maximum_width*/)
widget* pane::find_at(const point& coordinate, const bool must_be_active)
{
return tpane_implementation::find_at(this, coordinate, must_be_active);
return pane_implementation::find_at(this, coordinate, must_be_active);
}
const widget* pane::find_at(const point& coordinate,
const bool must_be_active) const
{
return tpane_implementation::find_at(this, coordinate, must_be_active);
return pane_implementation::find_at(this, coordinate, must_be_active);
}
point pane::calculate_best_size() const
@ -267,12 +265,12 @@ iterator::walker_base* pane::create_walker()
grid* pane::get_grid(const unsigned id)
{
return tpane_implementation::get_grid(this, id);
return pane_implementation::get_grid(this, id);
}
const grid* pane::get_grid(const unsigned id) const
{
return tpane_implementation::get_grid(this, id);
return pane_implementation::get_grid(this, id);
}
void pane::place_children()
@ -281,7 +279,7 @@ void pane::place_children()
unsigned index = 0;
for(auto & item : items_)
{
if(item.grid->get_visible() == widget::tvisible::invisible) {
if(item.grid->get_visible() == widget::visibility::invisible) {
continue;
}
@ -297,7 +295,7 @@ void pane::set_origin_children()
unsigned index = 0;
for(auto & item : items_)
{
if(item.grid->get_visible() == widget::tvisible::invisible) {
if(item.grid->get_visible() == widget::visibility::invisible) {
continue;
}
@ -313,7 +311,7 @@ void pane::place_or_set_origin_children()
unsigned index = 0;
for(auto & item : items_)
{
if(item.grid->get_visible() == widget::tvisible::invisible) {
if(item.grid->get_visible() == widget::visibility::invisible) {
continue;
}
@ -334,7 +332,7 @@ void pane::prepare_placement() const
for(const auto & item : items_)
{
if(item.grid->get_visible() == widget::tvisible::invisible) {
if(item.grid->get_visible() == widget::visibility::invisible) {
continue;
}
@ -353,7 +351,7 @@ void pane::signal_handler_request_placement(dispatcher& dispatcher,
for(auto & item : items_)
{
if(item.grid->has_widget(*wgt)) {
if(item.grid->get_visible() != widget::tvisible::invisible) {
if(item.grid->get_visible() != widget::visibility::invisible) {
/*
* This time we call init layout but also the linked widget

View file

@ -39,10 +39,10 @@ class grid;
class pane : public widget
{
friend struct tpane_implementation;
friend struct pane_implementation;
public:
struct titem
struct item
{
unsigned id;
@ -51,9 +51,9 @@ public:
grid* grid;
};
typedef std::function<bool(const titem&, const titem&)> tcompare_functor;
typedef std::function<bool(const item&, const item&)> tcompare_functor;
typedef std::function<bool(const titem&)> tfilter_functor;
typedef std::function<bool(const item&)> tfilter_functor;
/** @deprecated Use the second overload. */
explicit pane(const builder_grid_ptr item_builder);
@ -152,7 +152,7 @@ public:
private:
/** The items in the pane. */
std::list<titem> items_;
std::list<item> items_;
/** The builer for the items in the list. */
builder_grid_ptr item_builder_;

View file

@ -36,8 +36,8 @@ REGISTER_WIDGET(panel)
SDL_Rect panel::get_client_rect() const
{
std::shared_ptr<const panel_definition::tresolution> conf
= std::static_pointer_cast<const panel_definition::tresolution>(
std::shared_ptr<const panel_definition::resolution> conf
= std::static_pointer_cast<const panel_definition::resolution>(
config());
assert(conf);
@ -76,8 +76,8 @@ void panel::impl_draw_foreground(surface& frame_buffer, int x_offset, int y_offs
point panel::border_space() const
{
std::shared_ptr<const panel_definition::tresolution> conf
= std::static_pointer_cast<const panel_definition::tresolution>(
std::shared_ptr<const panel_definition::resolution> conf
= std::static_pointer_cast<const panel_definition::resolution>(
config());
assert(conf);
@ -102,7 +102,7 @@ panel_definition::panel_definition(const config& cfg)
{
DBG_GUI_P << "Parsing panel " << id << '\n';
load_resolutions<tresolution>(cfg);
load_resolutions<resolution>(cfg);
}
/*WIKI
@ -143,7 +143,7 @@ panel_definition::panel_definition(const config& cfg)
* @end{tag}{name="panel_definition"}
* @end{parent}{name="gui/"}
*/
panel_definition::tresolution::tresolution(const config& cfg)
panel_definition::resolution::resolution(const config& cfg)
: resolution_definition(cfg)
, top_border(cfg["top_border"])
, bottom_border(cfg["bottom_border"])

View file

@ -80,9 +80,9 @@ struct panel_definition : public control_definition
{
explicit panel_definition(const config& cfg);
struct tresolution : public resolution_definition
struct resolution : public resolution_definition
{
explicit tresolution(const config& cfg);
explicit resolution(const config& cfg);
unsigned top_border;
unsigned bottom_border;

View file

@ -81,7 +81,7 @@ progress_bar_definition::progress_bar_definition(const config& cfg)
{
DBG_GUI_P << "Parsing progress bar " << id << '\n';
load_resolutions<tresolution>(cfg);
load_resolutions<resolution>(cfg);
}
/*WIKI
@ -106,7 +106,7 @@ progress_bar_definition::progress_bar_definition(const config& cfg)
* @end{tag}{name="progress_bar_definition"}
* @end{parent}{name="gui/"}
*/
progress_bar_definition::tresolution::tresolution(const config& cfg)
progress_bar_definition::resolution::resolution(const config& cfg)
: resolution_definition(cfg)
{
// Note the order should be the same as the enum state_t in progress_bar.hpp.

View file

@ -81,9 +81,9 @@ struct progress_bar_definition : public control_definition
{
explicit progress_bar_definition(const config& cfg);
struct tresolution : public resolution_definition
struct resolution : public resolution_definition
{
explicit tresolution(const config& cfg);
explicit resolution(const config& cfg);
};
};

View file

@ -173,7 +173,7 @@ repeating_button_definition::repeating_button_definition(const config& cfg)
{
DBG_GUI_P << "Parsing repeating button " << id << '\n';
load_resolutions<tresolution>(cfg);
load_resolutions<resolution>(cfg);
}
/*WIKI
@ -204,7 +204,7 @@ repeating_button_definition::repeating_button_definition(const config& cfg)
* @end{tag}{name="repeating_button_definition"}
* @end{parent}{name="gui/"}
*/
repeating_button_definition::tresolution::tresolution(const config& cfg)
repeating_button_definition::resolution::resolution(const config& cfg)
: resolution_definition(cfg)
{
// Note the order should be the same as the enum state_t in

View file

@ -122,9 +122,9 @@ struct repeating_button_definition : public control_definition
{
explicit repeating_button_definition(const config& cfg);
struct tresolution : public resolution_definition
struct resolution : public resolution_definition
{
explicit tresolution(const config& cfg);
explicit resolution(const config& cfg);
};
};

View file

@ -141,7 +141,7 @@ scroll_label_definition::scroll_label_definition(const config& cfg)
{
DBG_GUI_P << "Parsing scroll label " << id << '\n';
load_resolutions<tresolution>(cfg);
load_resolutions<resolution>(cfg);
}
/*WIKI
@ -186,7 +186,7 @@ scroll_label_definition::scroll_label_definition(const config& cfg)
* @end{tag}{name="scroll_label_definition"}
* @end{parent}{name="gui/"}
*/
scroll_label_definition::tresolution::tresolution(const config& cfg)
scroll_label_definition::resolution::resolution(const config& cfg)
: resolution_definition(cfg), grid(nullptr)
{
// Note the order should be the same as the enum state_t is scroll_label.hpp.
@ -257,8 +257,8 @@ widget* builder_scroll_label::build() const
widget->set_vertical_scrollbar_mode(vertical_scrollbar_mode);
widget->set_horizontal_scrollbar_mode(horizontal_scrollbar_mode);
std::shared_ptr<const scroll_label_definition::tresolution>
conf = std::static_pointer_cast<const scroll_label_definition::tresolution>(
std::shared_ptr<const scroll_label_definition::resolution>
conf = std::static_pointer_cast<const scroll_label_definition::resolution>(
widget->config());
assert(conf);

View file

@ -111,9 +111,9 @@ struct scroll_label_definition : public control_definition
{
explicit scroll_label_definition(const config& cfg);
struct tresolution : public resolution_definition
struct resolution : public resolution_definition
{
explicit tresolution(const config& cfg);
explicit resolution(const config& cfg);
builder_grid_ptr grid;
};
@ -132,8 +132,8 @@ struct builder_scroll_label : public builder_control
widget* build() const;
scrollbar_container::tscrollbar_mode vertical_scrollbar_mode;
scrollbar_container::tscrollbar_mode horizontal_scrollbar_mode;
scrollbar_container::scrollbar_mode vertical_scrollbar_mode;
scrollbar_container::scrollbar_mode horizontal_scrollbar_mode;
bool wrap_on;
const std::string text_alignment;
};

View file

@ -51,7 +51,7 @@ scrollbar_base::scrollbar_base()
&scrollbar_base::signal_handler_left_button_up, this, _2, _3));
}
void scrollbar_base::scroll(const tscroll scroll)
void scrollbar_base::scroll(const scroll_mode scroll)
{
switch(scroll) {
case BEGIN:

View file

@ -52,7 +52,7 @@ public:
* When scrolling we always scroll a 'fixed' amount, these are the
* parameters for these amounts.
*/
enum tscroll {
enum scroll_mode {
BEGIN, /**< Go to begin position. */
ITEM_BACKWARDS, /**< Go one item towards the begin. */
HALF_JUMP_BACKWARDS, /**< Go half the visible items towards the begin.
@ -71,7 +71,7 @@ public:
*
* @param scroll 'step size' to scroll.
*/
void scroll(const tscroll scroll);
void scroll(const scroll_mode scroll);
/** Is the positioner at the beginning of the scrollbar? */
bool at_begin() const

View file

@ -45,9 +45,9 @@ static const std::string button_down_names[]
* Returns a map with the names of all buttons and the scrollbar jump they're
* supposed to execute.
*/
const std::map<std::string, scrollbar_base::tscroll>& scroll_lookup()
const std::map<std::string, scrollbar_base::scroll_mode>& scroll_lookup()
{
static std::map<std::string, scrollbar_base::tscroll> lookup;
static std::map<std::string, scrollbar_base::scroll_mode> lookup;
if(lookup.empty()) {
lookup["_begin"] = scrollbar_base::BEGIN;
lookup["_line_up"] = scrollbar_base::ITEM_BACKWARDS;
@ -127,34 +127,34 @@ void scrollbar_container::layout_initialise(const bool full_initialisation)
switch(vertical_scrollbar_mode_) {
case ALWAYS_VISIBLE:
vertical_scrollbar_grid_->set_visible(
widget::tvisible::visible);
widget::visibility::visible);
break;
case AUTO_VISIBLE:
vertical_scrollbar_grid_->set_visible(
widget::tvisible::hidden);
widget::visibility::hidden);
break;
default:
vertical_scrollbar_grid_->set_visible(
widget::tvisible::invisible);
widget::visibility::invisible);
}
assert(horizontal_scrollbar_grid_);
switch(horizontal_scrollbar_mode_) {
case ALWAYS_VISIBLE:
horizontal_scrollbar_grid_->set_visible(
widget::tvisible::visible);
widget::visibility::visible);
break;
case AUTO_VISIBLE:
horizontal_scrollbar_grid_->set_visible(
widget::tvisible::hidden);
widget::visibility::hidden);
break;
default:
horizontal_scrollbar_grid_->set_visible(
widget::tvisible::invisible);
widget::visibility::invisible);
}
}
@ -174,7 +174,7 @@ void scrollbar_container::request_reduce_height(const unsigned maximum_height)
const unsigned offset
= horizontal_scrollbar_grid_
&& horizontal_scrollbar_grid_->get_visible()
!= widget::tvisible::invisible
!= widget::visibility::invisible
? horizontal_scrollbar_grid_->get_best_size().y
: 0;
@ -195,16 +195,16 @@ void scrollbar_container::request_reduce_height(const unsigned maximum_height)
assert(vertical_scrollbar_grid_);
const bool resized = vertical_scrollbar_grid_->get_visible()
== widget::tvisible::invisible;
== widget::visibility::invisible;
// Always set the bar visible, is a nop is already visible.
vertical_scrollbar_grid_->set_visible(widget::tvisible::visible);
vertical_scrollbar_grid_->set_visible(widget::visibility::visible);
const point scrollbar_size = vertical_scrollbar_grid_->get_best_size();
// If showing the scrollbar increased the height, hide and abort.
if(resized && scrollbar_size.y > size.y) {
vertical_scrollbar_grid_->set_visible(widget::tvisible::invisible);
vertical_scrollbar_grid_->set_visible(widget::visibility::invisible);
DBG_GUI_L << LOG_HEADER << " request failed, showing the scrollbar"
<< " increased the height to " << scrollbar_size.y << ".\n";
return;
@ -239,7 +239,7 @@ void scrollbar_container::request_reduce_width(const unsigned maximum_width)
const unsigned offset
= vertical_scrollbar_grid_
&& vertical_scrollbar_grid_->get_visible()
!= widget::tvisible::invisible
!= widget::visibility::invisible
? vertical_scrollbar_grid_->get_best_size().x
: 0;
@ -260,7 +260,7 @@ void scrollbar_container::request_reduce_width(const unsigned maximum_width)
// Always set the bar visible, is a nop when it's already visible.
assert(horizontal_scrollbar_grid_);
horizontal_scrollbar_grid_->set_visible(widget::tvisible::visible);
horizontal_scrollbar_grid_->set_visible(widget::visibility::visible);
size = get_best_size();
point scrollbar_size = horizontal_scrollbar_grid_->get_best_size();
@ -270,7 +270,7 @@ void scrollbar_container::request_reduce_width(const unsigned maximum_width)
* minimum size.
*/
if(vertical_scrollbar_grid_->get_visible()
!= widget::tvisible::invisible) {
!= widget::visibility::invisible) {
scrollbar_size.x += vertical_scrollbar_grid_->get_best_size().x;
}
@ -279,7 +279,7 @@ void scrollbar_container::request_reduce_width(const unsigned maximum_width)
if(horizontal_scrollbar_mode_ == AUTO_VISIBLE_FIRST_RUN && scrollbar_size.x
> size.x) {
horizontal_scrollbar_grid_->set_visible(widget::tvisible::invisible);
horizontal_scrollbar_grid_->set_visible(widget::visibility::invisible);
DBG_GUI_L << LOG_HEADER << " request failed, showing the scrollbar"
<< " increased the width to " << scrollbar_size.x << ".\n";
return;
@ -309,14 +309,14 @@ point scrollbar_container::calculate_best_size() const
/***** get vertical scrollbar size *****/
const point vertical_scrollbar
= vertical_scrollbar_grid_->get_visible()
== widget::tvisible::invisible
== widget::visibility::invisible
? point()
: vertical_scrollbar_grid_->get_best_size();
/***** get horizontal scrollbar size *****/
const point horizontal_scrollbar
= horizontal_scrollbar_grid_->get_visible()
== widget::tvisible::invisible
== widget::visibility::invisible
? point()
: horizontal_scrollbar_grid_->get_best_size();
@ -350,14 +350,14 @@ point scrollbar_container::calculate_best_size() const
static void
set_scrollbar_mode(grid* scrollbar_grid,
scrollbar_base* scrollbar,
scrollbar_container::tscrollbar_mode& scrollbar_mode,
scrollbar_container::scrollbar_mode& scrollbar_mode,
const unsigned items,
const unsigned visible_items)
{
assert(scrollbar_grid && scrollbar);
if(scrollbar_mode == scrollbar_container::ALWAYS_INVISIBLE) {
scrollbar_grid->set_visible(widget::tvisible::invisible);
scrollbar_grid->set_visible(widget::visibility::invisible);
return;
}
@ -370,8 +370,8 @@ set_scrollbar_mode(grid* scrollbar_grid,
const bool scrollbar_needed = items > visible_items;
scrollbar_grid->set_visible(scrollbar_needed
? widget::tvisible::visible
: widget::tvisible::hidden);
? widget::visibility::visible
: widget::visibility::hidden);
}
}
static bool is_inserted_before(unsigned insertion_pos, unsigned old_item_count, unsigned old_position, unsigned visible_items)
@ -389,7 +389,7 @@ static bool is_inserted_before(unsigned insertion_pos, unsigned old_item_count,
static void
adjust_scrollbar_mode(grid* scrollbar_grid,
scrollbar_base* scrollbar,
scrollbar_container::tscrollbar_mode& scrollbar_mode,
scrollbar_container::scrollbar_mode& scrollbar_mode,
const unsigned items_before,
const unsigned items_after,
const int insertion_pos,
@ -405,7 +405,7 @@ adjust_scrollbar_mode(grid* scrollbar_grid,
const bool inserted_before_visible_area = is_inserted_before(static_cast<unsigned>(insertion_pos), items_before, previous_item_position, visible_items);
if(scrollbar_mode == scrollbar_container::ALWAYS_INVISIBLE) {
scrollbar_grid->set_visible(widget::tvisible::invisible);
scrollbar_grid->set_visible(widget::visibility::invisible);
return;
}
@ -419,8 +419,8 @@ adjust_scrollbar_mode(grid* scrollbar_grid,
const bool scrollbar_needed = items_after > visible_items;
scrollbar_grid->set_visible(scrollbar_needed
? widget::tvisible::visible
: widget::tvisible::hidden);
? widget::visibility::visible
: widget::visibility::hidden);
}
}
@ -579,7 +579,7 @@ bool scrollbar_container::content_resize_request(const bool force_sizing)
if(horizontal_scrollbar_mode_ == ALWAYS_INVISIBLE
|| (horizontal_scrollbar_mode_ == AUTO_VISIBLE_FIRST_RUN
&& horizontal_scrollbar_grid_->get_visible()
== widget::tvisible::invisible)) {
== widget::visibility::invisible)) {
DBG_GUI_L << LOG_HEADER
<< " can't use horizontal scrollbar, ask window.\n";
@ -595,7 +595,7 @@ bool scrollbar_container::content_resize_request(const bool force_sizing)
if(vertical_scrollbar_mode_ == ALWAYS_INVISIBLE
|| (vertical_scrollbar_mode_ == AUTO_VISIBLE_FIRST_RUN
&& vertical_scrollbar_grid_->get_visible()
== widget::tvisible::invisible)) {
== widget::visibility::invisible)) {
DBG_GUI_L << LOG_HEADER
<< " can't use vertical scrollbar, ask window.\n";
@ -681,7 +681,7 @@ bool scrollbar_container::content_resize_width(const int width_modification, con
if(horizontal_scrollbar_mode_ == ALWAYS_INVISIBLE
|| (horizontal_scrollbar_mode_ == AUTO_VISIBLE_FIRST_RUN
&& horizontal_scrollbar_grid_->get_visible()
== widget::tvisible::invisible)) {
== widget::visibility::invisible)) {
DBG_GUI_L << " can't use horizontal scrollbar, ask window.\n";
window* window = get_window();
@ -733,7 +733,7 @@ bool scrollbar_container::content_resize_height(const int height_modification, c
if(vertical_scrollbar_mode_ == ALWAYS_INVISIBLE
|| (vertical_scrollbar_mode_ == AUTO_VISIBLE_FIRST_RUN
&& vertical_scrollbar_grid_->get_visible()
== widget::tvisible::invisible)) {
== widget::visibility::invisible)) {
DBG_GUI_L << " can't use vertical scrollbar, ask window.\n";
window* window = get_window();
@ -822,7 +822,7 @@ void scrollbar_container::finalize_setup()
}
void scrollbar_container::set_vertical_scrollbar_mode(
const tscrollbar_mode scrollbar_mode)
const scrollbar_mode scrollbar_mode)
{
if(vertical_scrollbar_mode_ != scrollbar_mode) {
vertical_scrollbar_mode_ = scrollbar_mode;
@ -830,7 +830,7 @@ void scrollbar_container::set_vertical_scrollbar_mode(
}
void scrollbar_container::set_horizontal_scrollbar_mode(
const tscrollbar_mode scrollbar_mode)
const scrollbar_mode scrollbar_mode)
{
if(horizontal_scrollbar_mode_ != scrollbar_mode) {
horizontal_scrollbar_mode_ = scrollbar_mode;
@ -841,8 +841,8 @@ void scrollbar_container::impl_draw_children(surface& frame_buffer,
int x_offset,
int y_offset)
{
assert(get_visible() == widget::tvisible::visible
&& content_grid_->get_visible() == widget::tvisible::visible);
assert(get_visible() == widget::visibility::visible
&& content_grid_->get_visible() == widget::visibility::visible);
// Inherited.
container_base::impl_draw_children(frame_buffer, x_offset, y_offset);
@ -1025,7 +1025,7 @@ void scrollbar_container::set_horizontal_scrollbar_item_position(
}
void scrollbar_container::scroll_vertical_scrollbar(
const scrollbar_base::tscroll scroll)
const scrollbar_base::scroll_mode scroll)
{
assert(vertical_scrollbar_);
@ -1034,7 +1034,7 @@ void scrollbar_container::scroll_vertical_scrollbar(
}
void scrollbar_container::scroll_horizontal_scrollbar(
const scrollbar_base::tscroll scroll)
const scrollbar_base::scroll_mode scroll)
{
assert(horizontal_scrollbar_);
@ -1219,7 +1219,7 @@ scrollbar_container::signal_handler_sdl_wheel_up(const event::event_t event,
assert(vertical_scrollbar_grid_ && vertical_scrollbar_);
if(vertical_scrollbar_grid_->get_visible() == widget::tvisible::visible) {
if(vertical_scrollbar_grid_->get_visible() == widget::visibility::visible) {
vertical_scrollbar_->scroll(scrollbar_base::HALF_JUMP_BACKWARDS);
scrollbar_moved();
handled = true;
@ -1234,7 +1234,7 @@ scrollbar_container::signal_handler_sdl_wheel_down(const event::event_t event,
assert(vertical_scrollbar_grid_ && vertical_scrollbar_);
if(vertical_scrollbar_grid_->get_visible() == widget::tvisible::visible) {
if(vertical_scrollbar_grid_->get_visible() == widget::visibility::visible) {
vertical_scrollbar_->scroll(scrollbar_base::HALF_JUMP_FORWARD);
scrollbar_moved();
handled = true;
@ -1250,7 +1250,7 @@ scrollbar_container::signal_handler_sdl_wheel_left(const event::event_t event,
assert(horizontal_scrollbar_grid_ && horizontal_scrollbar_);
if(horizontal_scrollbar_grid_->get_visible()
== widget::tvisible::visible) {
== widget::visibility::visible) {
horizontal_scrollbar_->scroll(scrollbar_base::HALF_JUMP_BACKWARDS);
scrollbar_moved();
handled = true;
@ -1266,7 +1266,7 @@ scrollbar_container::signal_handler_sdl_wheel_right(const event::event_t event,
assert(horizontal_scrollbar_grid_ && horizontal_scrollbar_);
if(horizontal_scrollbar_grid_->get_visible()
== widget::tvisible::visible) {
== widget::visibility::visible) {
horizontal_scrollbar_->scroll(scrollbar_base::HALF_JUMP_FORWARD);
scrollbar_moved();
handled = true;

View file

@ -59,7 +59,7 @@ public:
}
/** The way to handle the showing or hiding of the scrollbar. */
enum tscrollbar_mode {
enum scrollbar_mode {
/**
* The scrollbar is always shown, whether needed or not.
*/
@ -147,15 +147,15 @@ public:
/***** ***** ***** setters / getters for members ***** ****** *****/
/** @note shouldn't be called after being shown in a dialog. */
void set_vertical_scrollbar_mode(const tscrollbar_mode scrollbar_mode);
tscrollbar_mode get_vertical_scrollbar_mode() const
void set_vertical_scrollbar_mode(const scrollbar_mode scrollbar_mode);
scrollbar_mode get_vertical_scrollbar_mode() const
{
return vertical_scrollbar_mode_;
}
/** @note shouldn't be called after being shown in a dialog. */
void set_horizontal_scrollbar_mode(const tscrollbar_mode scrollbar_mode);
tscrollbar_mode get_horizontal_scrollbar_mode() const
void set_horizontal_scrollbar_mode(const scrollbar_mode scrollbar_mode);
scrollbar_mode get_horizontal_scrollbar_mode() const
{
return horizontal_scrollbar_mode_;
}
@ -212,14 +212,14 @@ public:
*
* @param scroll The position to scroll to.
*/
void scroll_vertical_scrollbar(const scrollbar_base::tscroll scroll);
void scroll_vertical_scrollbar(const scrollbar_base::scroll_mode scroll);
/**
* Scrolls the horizontal scrollbar.
*
* @param scroll The position to scroll to.
*/
void scroll_horizontal_scrollbar(const scrollbar_base::tscroll scroll);
void scroll_horizontal_scrollbar(const scrollbar_base::scroll_mode scroll);
/**
* Callback when the scrollbar moves (NOTE maybe only one callback needed).
@ -473,7 +473,7 @@ private:
* This value should only be modified before showing, doing it while
* showing results in UB.
*/
tscrollbar_mode vertical_scrollbar_mode_, horizontal_scrollbar_mode_;
scrollbar_mode vertical_scrollbar_mode_, horizontal_scrollbar_mode_;
/** These are valid after finalize_setup(). */
grid* vertical_scrollbar_grid_, *horizontal_scrollbar_grid_;

View file

@ -60,7 +60,7 @@ scrollbar_panel_definition::scrollbar_panel_definition(const config& cfg)
{
DBG_GUI_P << "Parsing scrollbar panel " << id << '\n';
load_resolutions<tresolution>(cfg);
load_resolutions<resolution>(cfg);
}
/*WIKI
@ -88,7 +88,7 @@ scrollbar_panel_definition::scrollbar_panel_definition(const config& cfg)
* @end{tag}{name="scrollbar_panel_definition"}
* @end{parent}{name="gui/"}
*/
scrollbar_panel_definition::tresolution::tresolution(const config& cfg)
scrollbar_panel_definition::resolution::resolution(const config& cfg)
: resolution_definition(cfg), grid()
{
// The panel needs to know the order.
@ -162,8 +162,8 @@ widget* builder_scrollbar_panel::build() const
DBG_GUI_G << "Window builder: placed scrollbar_panel '" << id
<< "' with definition '" << definition << "'.\n";
std::shared_ptr<const scrollbar_panel_definition::tresolution> conf
= std::static_pointer_cast<const scrollbar_panel_definition::tresolution>(
std::shared_ptr<const scrollbar_panel_definition::resolution> conf
= std::static_pointer_cast<const scrollbar_panel_definition::resolution>(
panel->config());
assert(conf);

View file

@ -72,9 +72,9 @@ struct scrollbar_panel_definition : public control_definition
explicit scrollbar_panel_definition(const config& cfg);
struct tresolution : public resolution_definition
struct resolution : public resolution_definition
{
explicit tresolution(const config& cfg);
explicit resolution(const config& cfg);
builder_grid_ptr grid;
};
@ -93,8 +93,8 @@ struct builder_scrollbar_panel : public builder_control
widget* build() const;
scrollbar_container::tscrollbar_mode vertical_scrollbar_mode;
scrollbar_container::tscrollbar_mode horizontal_scrollbar_mode;
scrollbar_container::scrollbar_mode vertical_scrollbar_mode;
scrollbar_container::scrollbar_mode horizontal_scrollbar_mode;
builder_grid_ptr grid_;
};

View file

@ -485,7 +485,7 @@ void register_window(const std::string& id)
}
}
std::vector<std::string> tunit_test_access_only::get_registered_window_list()
std::vector<std::string> unit_test_access_only::get_registered_window_list()
{
return gui2::registered_window_types();
}
@ -668,10 +668,10 @@ get_window_builder(const std::string& type)
if(current_gui != default_gui) {
window = default_gui->second.window_types.find(type);
if(window == default_gui->second.window_types.end()) {
throw twindow_builder_invalid_id();
throw window_builder_invalid_id();
}
} else if(window == current_gui->second.window_types.end()) {
throw twindow_builder_invalid_id();
throw window_builder_invalid_id();
}
}

View file

@ -60,7 +60,7 @@ void register_window(const std::string& id);
* This is used in the unit tests, but these implementation details shouldn't
* be used in the normal code.
*/
class tunit_test_access_only
class unit_test_access_only
{
friend std::vector<std::string>& unit_test_registered_window_list();
@ -139,7 +139,7 @@ resolution_definition_ptr get_control(const std::string& control_type,
const std::string& definition);
/** Helper struct to signal that get_window_builder failed. */
struct twindow_builder_invalid_id
struct window_builder_invalid_id
{
};
@ -152,7 +152,7 @@ struct twindow_builder_invalid_id
* @pre There is a valid builder for @p type at the
* current resolution.
*
* @throw twindow_builder_invalid_id
* @throw window_builder_invalid_id
* When the precondition is violated.
*
* @param type The type of builder window to get.

View file

@ -63,9 +63,9 @@ point slider::calculate_best_size() const
if(best_slider_length_ != 0) {
// Override length.
std::shared_ptr<const slider_definition::tresolution> conf
std::shared_ptr<const slider_definition::resolution> conf
= std::static_pointer_cast<const slider_definition::
tresolution>(config());
resolution>(config());
assert(conf);
@ -156,8 +156,8 @@ void slider::child_callback_positioner_moved()
unsigned slider::minimum_positioner_length() const
{
std::shared_ptr<const slider_definition::tresolution>
conf = std::static_pointer_cast<const slider_definition::tresolution>(
std::shared_ptr<const slider_definition::resolution>
conf = std::static_pointer_cast<const slider_definition::resolution>(
config());
assert(conf);
return conf->minimum_positioner_length;
@ -165,8 +165,8 @@ unsigned slider::minimum_positioner_length() const
unsigned slider::maximum_positioner_length() const
{
std::shared_ptr<const slider_definition::tresolution>
conf = std::static_pointer_cast<const slider_definition::tresolution>(
std::shared_ptr<const slider_definition::resolution>
conf = std::static_pointer_cast<const slider_definition::resolution>(
config());
assert(conf);
return conf->maximum_positioner_length;
@ -174,8 +174,8 @@ unsigned slider::maximum_positioner_length() const
unsigned slider::offset_before() const
{
std::shared_ptr<const slider_definition::tresolution>
conf = std::static_pointer_cast<const slider_definition::tresolution>(
std::shared_ptr<const slider_definition::resolution>
conf = std::static_pointer_cast<const slider_definition::resolution>(
config());
assert(conf);
return conf->left_offset;
@ -183,8 +183,8 @@ unsigned slider::offset_before() const
unsigned slider::offset_after() const
{
std::shared_ptr<const slider_definition::tresolution>
conf = std::static_pointer_cast<const slider_definition::tresolution>(
std::shared_ptr<const slider_definition::resolution>
conf = std::static_pointer_cast<const slider_definition::resolution>(
config());
assert(conf);
return conf->right_offset;
@ -348,7 +348,7 @@ slider_definition::slider_definition(const config& cfg)
{
DBG_GUI_P << "Parsing slider " << id << '\n';
load_resolutions<tresolution>(cfg);
load_resolutions<resolution>(cfg);
}
/*WIKI
@ -398,7 +398,7 @@ slider_definition::slider_definition(const config& cfg)
* @end{tag}{name="slider_definition"}
* @end{parent}{name="gui/"}
*/
slider_definition::tresolution::tresolution(const config& cfg)
slider_definition::resolution::resolution(const config& cfg)
: resolution_definition(cfg)
, minimum_positioner_length(cfg["minimum_positioner_length"])
, maximum_positioner_length(cfg["maximum_positioner_length"])

View file

@ -217,9 +217,9 @@ struct slider_definition : public control_definition
{
explicit slider_definition(const config& cfg);
struct tresolution : public resolution_definition
struct resolution : public resolution_definition
{
explicit tresolution(const config& cfg);
explicit resolution(const config& cfg);
unsigned minimum_positioner_length;
unsigned maximum_positioner_length;

View file

@ -76,7 +76,7 @@ spacer_definition::spacer_definition(const config& cfg)
{
DBG_GUI_P << "Parsing spacer " << id << '\n';
load_resolutions<tresolution>(cfg);
load_resolutions<resolution>(cfg);
}
/*WIKI
@ -93,7 +93,7 @@ spacer_definition::spacer_definition(const config& cfg)
* @end{tag}{name="spacer_definition"}
* @end{parent}{name="gui/"}
*/
spacer_definition::tresolution::tresolution(const config& cfg)
spacer_definition::resolution::resolution(const config& cfg)
: resolution_definition(cfg)
{
}

View file

@ -89,9 +89,9 @@ struct spacer_definition : public control_definition
{
explicit spacer_definition(const config& cfg);
struct tresolution : public resolution_definition
struct resolution : public resolution_definition
{
explicit tresolution(const config& cfg);
explicit resolution(const config& cfg);
};
};

View file

@ -138,12 +138,12 @@ void stacked_widget::select_layer(const int layer)
// Select current layer, leave the rest unselected.
select_layer_internal(i, selected);
generator_->item(i).set_visible(selected
? widget::tvisible::visible
: widget::tvisible::hidden);
? widget::visibility::visible
: widget::visibility::hidden);
} else {
// Select everything.
select_layer_internal(i, true);
generator_->item(i).set_visible(widget::tvisible::visible);
generator_->item(i).set_visible(widget::visibility::visible);
}
}
}
@ -166,7 +166,7 @@ stacked_widget_definition::stacked_widget_definition(const config& cfg)
{
DBG_GUI_P << "Parsing stacked widget " << id << '\n';
load_resolutions<tresolution>(cfg);
load_resolutions<resolution>(cfg);
}
/*WIKI
@ -189,7 +189,7 @@ stacked_widget_definition::stacked_widget_definition(const config& cfg)
* @end{tag}{name="stacked_widget_definition"}
* @end{parent}{name="gui/"}
*/
stacked_widget_definition::tresolution::tresolution(const config& cfg)
stacked_widget_definition::resolution::resolution(const config& cfg)
: resolution_definition(cfg), grid(nullptr)
{
// Add a dummy state since every widget needs a state.
@ -250,8 +250,8 @@ widget* builder_stacked_widget::build() const
DBG_GUI_G << "Window builder: placed stacked widget '" << id
<< "' with definition '" << definition << "'.\n";
std::shared_ptr<const stacked_widget_definition::tresolution>
conf = std::static_pointer_cast<const stacked_widget_definition::tresolution>(
std::shared_ptr<const stacked_widget_definition::resolution>
conf = std::static_pointer_cast<const stacked_widget_definition::resolution>(
widget->config());
assert(conf);

View file

@ -116,9 +116,9 @@ struct stacked_widget_definition : public control_definition
{
explicit stacked_widget_definition(const config& cfg);
struct tresolution : public resolution_definition
struct resolution : public resolution_definition
{
explicit tresolution(const config& cfg);
explicit resolution(const config& cfg);
builder_grid_ptr grid;
};

View file

@ -244,8 +244,8 @@ void text_box::update_offsets()
{
assert(config());
std::shared_ptr<const text_box_definition::tresolution>
conf = std::static_pointer_cast<const text_box_definition::tresolution>(
std::shared_ptr<const text_box_definition::resolution>
conf = std::static_pointer_cast<const text_box_definition::resolution>(
config());
assert(conf);
@ -328,8 +328,8 @@ void text_box::load_config_extra()
{
assert(config());
std::shared_ptr<const text_box_definition::tresolution>
conf = std::static_pointer_cast<const text_box_definition::tresolution>(
std::shared_ptr<const text_box_definition::resolution>
conf = std::static_pointer_cast<const text_box_definition::resolution>(
config());
assert(conf);
@ -402,7 +402,7 @@ text_box_definition::text_box_definition(const config& cfg)
{
DBG_GUI_P << "Parsing text_box " << id << '\n';
load_resolutions<tresolution>(cfg);
load_resolutions<resolution>(cfg);
}
/*WIKI
@ -441,7 +441,7 @@ text_box_definition::text_box_definition(const config& cfg)
* @end{tag}{name="ext_box_definition"}
* @end{parent}{name="gui/"}
*/
text_box_definition::tresolution::tresolution(const config& cfg)
text_box_definition::resolution::resolution(const config& cfg)
: resolution_definition(cfg)
, text_x_offset(cfg["text_x_offset"])
, text_y_offset(cfg["text_y_offset"])

View file

@ -284,9 +284,9 @@ struct text_box_definition : public control_definition
{
explicit text_box_definition(const config& cfg);
struct tresolution : public resolution_definition
struct resolution : public resolution_definition
{
explicit tresolution(const config& cfg);
explicit resolution(const config& cfg);
typed_formula<unsigned> text_x_offset;
typed_formula<unsigned> text_y_offset;

Some files were not shown because too many files have changed in this diff Show more