The Battle for Wesnoth  1.13.10+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
editor_common.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2008 - 2017 by Tomasz Sniatowski <kailoran@gmail.com>
3  Part of the Battle for Wesnoth Project http://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 /**
16  * @file
17  * Main (common) editor header. Contains forward declarations for most classes,
18  * logging macro definitions and base exception declarations
19  */
20 
21 #pragma once
22 
23 #include "exceptions.hpp"
24 #include "log.hpp"
25 
26 #include <deque>
27 #include <memory>
28 
30 #define DBG_ED LOG_STREAM_INDENT(debug, log_editor)
31 #define LOG_ED LOG_STREAM_INDENT(info, log_editor)
32 #define WRN_ED LOG_STREAM_INDENT(warn, log_editor)
33 #define ERR_ED LOG_STREAM_INDENT(err, log_editor)
34 #define SCOPE_ED log_scope2(log_editor, __func__)
35 
36 class display;
37 
38 namespace editor {
39 
41 {
43  : game::error(msg)
44  {
45  }
46 };
47 
49 {
51  : editor_exception(msg)
52  {
53  }
54 };
55 
56 // forward declarations
57 class brush;
58 class editor_action;
59 class editor_controller;
60 class editor_display;
61 class editor_map;
62 class editor_mouse_handler;
63 class map_context;
64 class map_fragment;
65 class mouse_action;
66 
67 /** Action pointer typedef. */
68 using editor_action_ptr = std::unique_ptr<editor_action>;
69 
70 /** Action stack typedef. */
71 using action_stack = std::deque<editor_action_ptr>;
72 
73 } //end namespace editor
std::vector< char_t > string
std::unique_ptr< editor_action > editor_action_ptr
Action pointer typedef.
editor_exception(const std::string &msg)
editor_logic_exception(const std::string &msg)
static void msg(const char *act, debug_info &i, const char *to="", const char *result="")
Definition: debugger.cpp:110
lg::log_domain log_editor
std::deque< editor_action_ptr > action_stack
Action stack typedef.
Manage the empty-palette in the editor.
Definition: action.cpp:29
Base class for all the errors encountered by the engine.
Definition: exceptions.hpp:29
Standard logging facilities (interface).