The Battle for Wesnoth 1.21.0-dev
 
Loading...
Searching...
No Matches
editor_common.hpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2008 - 2025
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
37class display;
38
39namespace 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)
52 : editor_exception(msg)
53 {
54 }
55};
56
57// forward declarations
58class brush;
59class editor_action;
60class editor_controller;
61class editor_display;
62class editor_map;
63class editor_mouse_handler;
64class map_context;
65class map_fragment;
66class mouse_action;
67
68/** Action stack typedef. */
69using 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:88
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.
editor_exception(const std::string &msg)
editor_logic_exception(const std::string &msg)
Base class for all the errors encountered by the engine.