The Battle for Wesnoth  1.15.9+dev
gamestate_inspector.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2009 - 2018 by Yurii Chernyi <terraninfo@terraninfo.net>
3  Part of the Battle for Wesnoth Project https://www.wesnoth.org/
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; either version 2 of the License, or
8  (at your option) any later version.
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY.
11 
12  See the COPYING file for more details.
13 */
14 
15 #pragma once
16 
18 #include "variable.hpp"
19 
20 namespace game_events {class manager; }
21 class display_context;
22 
23 namespace gui2
24 {
25 namespace dialogs
26 {
27 
28 /**
29  * @ingroup GUIWindowDefinitionWML
30  *
31  * This shows the gamestate inspector.
32  * Key |Type |Mandatory|Description
33  * ------------------|--------------|---------|-----------
34  * inspector_name | control |yes |Name of the inspector.
35  * stuff_list | control |yes |List of various stuff that can be viewed.
36  * inspect | control |yes |The state of the variable or event.
37  * copy | @ref button |yes |A button to copy the state to clipboard.
38  */
40 {
41 public:
42  class model;
43  class view;
44  class controller;
45  gamestate_inspector(const config& vars, const game_events::manager& events, const display_context& dc, const std::string& title = "");
46 
48 
49 private:
50  /** Inherited from modal_dialog. */
51  virtual void pre_show(window& window) override;
52 
53  /** Inherited from modal_dialog, implemented by REGISTER_DIALOG. */
54  virtual const std::string& window_id() const override;
55 
56  std::shared_ptr<view> view_;
57  std::shared_ptr<model> model_;
58  std::shared_ptr<controller> controller_;
59  std::string title_;
60  const config& vars_;
63 };
64 } // namespace dialogs
65 } // namespace gui2
const game_events::manager & events_
This shows the gamestate inspector.
Generic file dialog.
Definition: field-fwd.hpp:22
Various uncategorised dialogs.
Domain specific events.
Definition: action_wml.cpp:86
The game event manager loads the scenario configuration object, and ensures that events are handled a...
Definition: manager.hpp:43
Handling of system events.
Definition: manager.hpp:42
Abstract base class for all modal dialogs.
std::shared_ptr< controller > controller_
A config object defines a single node in a WML file, with access to child nodes.
Definition: config.hpp:60
base class of top level items, the only item which needs to store the final canvases to draw on...
Definition: window.hpp:64