The Battle for Wesnoth  1.19.0-dev
gamestate_inspector.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2009 - 2024
3  by Yurii Chernyi <terraninfo@terraninfo.net>
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 #include "variable.hpp"
20 
21 namespace game_events {class manager; }
22 class display_context;
23 
24 namespace gui2::dialogs
25 {
26 
27 /**
28  * @ingroup GUIWindowDefinitionWML
29  *
30  * This shows the gamestate inspector.
31  * Key |Type |Mandatory|Description
32  * ------------------|--------------|---------|-----------
33  * inspector_name | control |yes |Name of the inspector.
34  * stuff_list | control |yes |List of various stuff that can be viewed.
35  * inspect | control |yes |The state of the variable or event.
36  * copy | @ref button |yes |A button to copy the state to clipboard.
37  */
39 {
40 public:
41  class model;
42  class view;
43  class controller;
44  gamestate_inspector(const config& vars, const game_events::manager& events, const display_context& dc, const std::string& title = "");
45 
47 
48 private:
49  virtual void pre_show(window& window) override;
50 
51  virtual const std::string& window_id() const override;
52 
53  std::shared_ptr<view> view_;
54  std::shared_ptr<model> model_;
55  std::shared_ptr<controller> controller_;
56  std::string title_;
57  const config& vars_;
60 };
61 } // namespace dialogs
A config object defines a single node in a WML file, with access to child nodes.
Definition: config.hpp:159
Abstract class for exposing game data that doesn't depend on the GUI, however which for historical re...
The game event manager loads the scenario configuration object, and ensures that events are handled a...
Definition: manager.hpp:45
This shows the gamestate inspector.
const game_events::manager & events_
virtual void pre_show(window &window) override
Actions to be taken before showing the window.
virtual const std::string & window_id() const override
The ID of the window to build.
std::shared_ptr< controller > controller_
DEFINE_SIMPLE_DISPLAY_WRAPPER(gamestate_inspector)
gamestate_inspector(const config &vars, const game_events::manager &events, const display_context &dc, const std::string &title="")
Abstract base class for all modal dialogs.
base class of top level items, the only item which needs to store the final canvases to draw on.
Definition: window.hpp:63
Handling of system events.
Domain specific events.