1 #pragma once
2 
3 #include <X11/Xlib.h>
4 #include <string>
5 
6 struct _XftFont;
7 class XConnection;
8 struct _XOC;
9 
10 /**
11  * @brief This class has two purposes: 1. Allow different
12  * HSFont objects to use the same font resources in X. 2. hide
13  * X includes from font.h. So only the decoration renderer
14  * needs to include fontdata.h
15  */
16 class FontData {
17 public:
FontData()18     FontData() {}
19     ~FontData();
20 
21     void initFromStr(const std::string& source);
22 
23     struct _XftFont* xftFont_ = nullptr;
24     XFontStruct* xFontStruct_ = nullptr;
25     struct _XOC *xFontSet_ = nullptr; // _XOC* = XFontSet
26 
27     static XConnection* s_xconnection;
28 private:
29 };
30