The Battle for Wesnoth  1.13.10+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
text_cache.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2016 - 2017 by Chris Beck<render787@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  * Note: Specific to sdl_ttf
17  */
18 
19 #pragma once
20 
21 #include "text_surface.hpp"
22 
23 #include <list>
24 
25 namespace font {
26 
28 {
29 public:
30  static text_surface &find(text_surface const &t);
31  static void resize(unsigned int size);
32 private:
33  typedef std::list< text_surface > text_list;
34  static text_list cache_;
35  static unsigned int max_size_;
36 };
37 
38 } // end namespace font
Note: Specific to sdl_ttf.
static text_surface & find(text_surface const &t)
Definition: text_cache.cpp:37
static text_list cache_
Definition: text_cache.hpp:34
std::list< text_surface > text_list
Definition: text_cache.hpp:33
size_t size(const utf8::string &str)
Length in characters of a UTF-8 string.
Definition: unicode.cpp:86
static void resize(unsigned int size)
Definition: text_cache.cpp:26
static unsigned int max_size_
Definition: text_cache.hpp:35
double t
Definition: astarsearch.cpp:64