The Battle for Wesnoth  1.19.5+dev
instance.hpp
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 #pragma once
17 
19 
20 #include "config.hpp"
21 
22 namespace gui2
23 {
24 
25 namespace implementation
26 {
27 
29 {
30  explicit builder_instance(const config& cfg);
31 
32  virtual std::unique_ptr<widget> build() const override;
33 
34  virtual std::unique_ptr<widget> build(const replacements_map& replacements) const override;
35 
36  /**
37  * Holds a copy of the cfg parameter in the constructor.
38  *
39  * This is used when instantiating a spacer, it can still use the
40  * parameters originally sent.
41  */
43 };
44 
45 } // namespace implementation
46 
47 } // namespace gui2
A config object defines a single node in a WML file, with access to child nodes.
Definition: config.hpp:172
Definitions for the interface to Wesnoth Markup Language (WML).
Generic file dialog.
Contains the implementation details for lexical_cast and shouldn't be used directly.
Contains the info needed to instantiate a widget.
std::map< std::string, std::shared_ptr< builder_widget > > replacements_map
The replacements type is used to define replacement types.
virtual std::unique_ptr< widget > build() const override
Definition: instance.cpp:33
config configuration
Holds a copy of the cfg parameter in the constructor.
Definition: instance.hpp:42