The Battle for Wesnoth  1.19.0-dev
placer.cpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2012 - 2024
3  by Mark de Wever <koraq@xs4all.nl>
4  Part of the Battle for Wesnoth Project https://www.wesnoth.org/
5 
6  This program is free software; you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation; either version 2 of the License, or
9  (at your option) any later version.
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY.
12 
13  See the COPYING file for more details.
14 */
15 
16 #define GETTEXT_DOMAIN "wesnoth-lib"
17 
18 #include "gui/core/placer.hpp"
21 
22 #include <stdexcept>
23 
24 namespace gui2
25 {
26 
27 placer_base* placer_base::build(const grow_direction::type grow_dir, const unsigned parallel_items)
28 {
29  switch(grow_dir) {
30  case grow_direction::type::horizontal:
31  return new implementation::placer_horizontal_list(parallel_items);
32  case grow_direction::type::vertical:
33  return new implementation::placer_vertical_list(parallel_items);
34  default:
35  throw std::runtime_error("UNREACHABLE CODE REACHED");
36  };
37 }
38 
40 {
41 }
42 
43 } // namespace gui2
The placement class for a horizontal list.
The placement class for a vertical list.
Base class for the placement helper.
Definition: placer.hpp:52
static placer_base * build(const grow_direction::type grow_dir, const unsigned parallel_items)
Builder function.
Definition: placer.cpp:27
virtual ~placer_base()
Definition: placer.cpp:39
Placement helper for the horizontal list.
Generic file dialog.
Base class for the placement helper.
Placement helper for the vertical list.