zenilib  0.5.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Fonts.h
Go to the documentation of this file.
1 /* This file is part of the Zenipex Library (zenilib).
2  * Copyright (C) 2011 Mitchell Keith Bloch (bazald).
3  *
4  * zenilib is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * zenilib is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public License
15  * along with zenilib. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
34 #ifndef ZENI_FONTS_H
35 #define ZENI_FONTS_H
36 
37 #include <Zeni/Database.h>
38 #include <Zeni/Font.h>
39 
40 #include <vector>
41 
42 namespace Zeni {
43 
44  class ZENI_GRAPHICS_DLL Fonts;
45 
46 #ifdef _WINDOWS
47  ZENI_GRAPHICS_EXT template class ZENI_GRAPHICS_DLL Singleton<Fonts>;
48  ZENI_GRAPHICS_EXT template class ZENI_GRAPHICS_DLL Database<Font>;
49 #endif
50 
51  class ZENI_GRAPHICS_DLL Fonts : public Singleton<Fonts>, public Database<Font> {
52  friend class Singleton<Fonts>;
53 
54  static Fonts * create();
55 
56 #ifdef _WINDOWS
57 #pragma warning( push )
58 #pragma warning( disable : 4251 )
59 #endif
60  static class Lose : public Event::Handler {
61  void operator()() {
62  get().lose_resources();
63  }
64 
65  Lose * duplicate() const {
66  return new Lose;
67  }
68 
69  public:
70  Lose() {}
71 
72  // Undefined
73  Lose(const Lose &);
74  Lose operator=(const Lose &);
75  } g_lose;
76 
77  static class Unlose : public Event::Handler {
78  void operator()() {
79  get().unlose_resources();
80  }
81 
82  Unlose * duplicate() const {
83  return new Unlose;
84  }
85 
86  public:
87  Unlose() {}
88 
89  // Undefined
90  Unlose(const Unlose &);
91  Unlose operator=(const Unlose &);
92  } g_unlose;
93 #ifdef _WINDOWS
94 #pragma warning( pop )
95 #endif
96 
97  Fonts();
98  ~Fonts();
99 
100  // Undefined
101  Fonts(const Fonts &);
102  Fonts & operator=(const Fonts &);
103 
104  virtual Font * load(XML_Element_c &xml_element, const String &name, const String &filename);
105  };
106 
107  ZENI_GRAPHICS_DLL Fonts & get_Fonts();
108 
109 }
110 
111 #endif
A Font database read in from a file.
Definition: Fonts.h:51
EGLImageKHR EGLint * name
Definition: eglext.h:284
Fonts & get_Fonts()
Get access to the singleton.
Definition: Fonts.cpp:60