The Battle for Wesnoth  1.19.5+dev
editor_common.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2008 - 2024
3  by Tomasz Sniatowski <kailoran@gmail.com>
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 /**
17  * @file
18  * Main (common) editor header. Contains forward declarations for most classes,
19  * logging macro definitions and base exception declarations
20  */
21 
22 #pragma once
23 
24 #include "exceptions.hpp"
25 #include "log.hpp"
26 
27 #include <deque>
28 #include <memory>
29 
31 #define DBG_ED LOG_STREAM_INDENT(debug, log_editor)
32 #define LOG_ED LOG_STREAM_INDENT(info, log_editor)
33 #define WRN_ED LOG_STREAM_INDENT(warn, log_editor)
34 #define ERR_ED LOG_STREAM_INDENT(err, log_editor)
35 #define SCOPE_ED log_scope2(log_editor, __func__)
36 
37 class display;
38 
39 namespace editor {
40 
42 {
43  editor_exception(const std::string& msg)
44  : game::error(msg)
45  {
46  }
47 };
48 
50 {
51  editor_logic_exception(const std::string& msg)
53  {
54  }
55 };
56 
57 // forward declarations
58 class brush;
59 class editor_action;
60 class editor_controller;
61 class editor_display;
62 class editor_map;
63 class editor_mouse_handler;
64 class map_context;
65 class map_fragment;
66 class mouse_action;
67 
68 /** Action stack typedef. */
69 using action_stack = std::deque<std::unique_ptr<editor_action>>;
70 
71 } //end namespace editor
Sort-of-Singleton that many classes, both GUI and non-GUI, use to access the game data.
Definition: display.hpp:97
lg::log_domain log_editor
Standard logging facilities (interface).
Manage the empty-palette in the editor.
Definition: action.cpp:31
std::deque< std::unique_ptr< editor_action > > action_stack
Action stack typedef.
static void msg(const char *act, debug_info &i, const char *to="", const char *result="")
Definition: debugger.cpp:109
editor_exception(const std::string &msg)
editor_logic_exception(const std::string &msg)
Base class for all the errors encountered by the engine.
Definition: exceptions.hpp:29