ManaPlus
textmanager.h
Go to the documentation of this file.
1 /*
2  * The ManaPlus Client
3  * Copyright (C) 2008 Douglas Boffey <[email protected]>
4  * Copyright (C) 2011-2019 The ManaPlus Developers
5  * Copyright (C) 2019-2021 Andrei Karas
6  *
7  * This file is part of The ManaPlus Client.
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program. If not, see <http://www.gnu.org/licenses/>.
21  */
22 
23 #ifndef TEXTMANAGER_H
24 #define TEXTMANAGER_H
25 
26 #include <list>
27 
28 #include "localconsts.h"
29 
30 class Graphics;
31 class Text;
32 
34 {
35  public:
39  TextManager();
40 
42 
43 
46  ~TextManager();
47 
51  void addText(Text *const text);
52 
56  void moveText(Text *const text, const int x, const int y) const;
57 
61  void removeText(const Text *const text);
62 
66  void draw(Graphics *const graphics,
67  const int xOff,
68  const int yOff) A_NONNULL(2);
69 
70  private:
74  void place(const Text *const textObj, const Text *const omit,
75  const int &x, int &y, const int h) const;
76 
77  typedef std::list<Text *> TextList;
79 };
80 
81 extern TextManager *textManager;
82 
83 #endif // TEXTMANAGER_H
void removeText(const Text *const text)
Definition: textmanager.cpp:58
void moveText(Text *const text, const int x, const int y) const
Definition: textmanager.cpp:48
TextList mTextList
Definition: textmanager.h:78
std::list< Text * > TextList
Definition: textmanager.h:77
void addText(Text *const text)
Definition: textmanager.cpp:40
void place(const Text *const textObj, const Text *const omit, const int &x, int &y, const int h) const
Definition: textmanager.cpp:83
void draw(Graphics *const graphics, const int xOff, const int yOff)
Definition: textmanager.cpp:74
Definition: text.h:40
#define A_NONNULL(...)
Definition: localconsts.h:168
#define final
Definition: localconsts.h:46
#define A_DELETE_COPY(func)
Definition: localconsts.h:53
TextManager * textManager
Definition: textmanager.cpp:33