Changeset View
Changeset View
Standalone View
Standalone View
kcms/fonts/kxftconfig.h
Show All 21 Lines | |||||
22 | 22 | | |||
23 | #include <config-workspace.h> | 23 | #include <config-workspace.h> | ||
24 | 24 | | |||
25 | #ifdef HAVE_FONTCONFIG | 25 | #ifdef HAVE_FONTCONFIG | ||
26 | 26 | | |||
27 | #include <time.h> | 27 | #include <time.h> | ||
28 | 28 | | |||
29 | #include <QDomDocument> | 29 | #include <QDomDocument> | ||
30 | #include <QStringList> | ||||
30 | 31 | | |||
31 | class KXftConfig | 32 | class KXftConfig | ||
32 | { | 33 | { | ||
33 | public: | 34 | public: | ||
34 | 35 | | |||
35 | struct Item { | 36 | struct Item { | ||
36 | Item(QDomNode &n) : node(n), toBeRemoved(false) {} | 37 | Item(QDomNode &n) : node(n), toBeRemoved(false) {} | ||
37 | Item() : toBeRemoved(false) {} | 38 | Item() : toBeRemoved(false) {} | ||
▲ Show 20 Lines • Show All 113 Lines • ▼ Show 20 Line(s) | 144 | public: | |||
151 | bool getSubPixelType(SubPixel::Type &type); | 152 | bool getSubPixelType(SubPixel::Type &type); | ||
152 | void setSubPixelType(SubPixel::Type type); // SubPixel::None => turn off sub-pixel rendering | 153 | void setSubPixelType(SubPixel::Type type); // SubPixel::None => turn off sub-pixel rendering | ||
153 | bool getExcludeRange(double &from, double &to); | 154 | bool getExcludeRange(double &from, double &to); | ||
154 | void setExcludeRange(double from, double to); // from:0, to:0 => turn off exclude range | 155 | void setExcludeRange(double from, double to); // from:0, to:0 => turn off exclude range | ||
155 | bool getHintStyle(Hint::Style &style); | 156 | bool getHintStyle(Hint::Style &style); | ||
156 | void setHintStyle(Hint::Style style); | 157 | void setHintStyle(Hint::Style style); | ||
157 | void setAntiAliasing(AntiAliasing::State state); | 158 | void setAntiAliasing(AntiAliasing::State state); | ||
158 | AntiAliasing::State getAntiAliasing() const; | 159 | AntiAliasing::State getAntiAliasing() const; | ||
160 | bool antiAliasingHasLocalConfig() const; | ||||
159 | bool changed() | 161 | bool changed() | ||
160 | { | 162 | { | ||
161 | return m_madeChanges; | 163 | return m_madeChanges; | ||
162 | } | 164 | } | ||
163 | static QString description(SubPixel::Type t); | 165 | static QString description(SubPixel::Type t); | ||
164 | static const char *toStr(SubPixel::Type t); | 166 | static const char *toStr(SubPixel::Type t); | ||
165 | static QString description(Hint::Style s); | 167 | static QString description(Hint::Style s); | ||
166 | static const char *toStr(Hint::Style s); | 168 | static const char *toStr(Hint::Style s); | ||
167 | bool aliasingEnabled(); | 169 | bool aliasingEnabled(); | ||
168 | 170 | | |||
169 | private: | 171 | private: | ||
170 | 172 | | |||
173 | bool parseConfigFile(const QString& filename); | ||||
171 | void readContents(); | 174 | void readContents(); | ||
172 | void applySubPixelType(); | 175 | void applySubPixelType(); | ||
173 | void applyHintStyle(); | 176 | void applyHintStyle(); | ||
174 | void applyAntiAliasing(); | 177 | void applyAntiAliasing(); | ||
175 | void setHinting(bool set); | 178 | void setHinting(bool set); | ||
176 | void applyHinting(); | 179 | void applyHinting(); | ||
177 | void applyExcludeRange(bool pixel); | 180 | void applyExcludeRange(bool pixel); | ||
181 | QString getConfigFile(); | ||||
178 | 182 | | |||
179 | private: | 183 | private: | ||
180 | 184 | | |||
185 | QStringList m_globalFiles; | ||||
186 | | ||||
181 | SubPixel m_subPixel; | 187 | SubPixel m_subPixel; | ||
182 | Exclude m_excludeRange, | 188 | Exclude m_excludeRange, | ||
183 | m_excludePixelRange; | 189 | m_excludePixelRange; | ||
184 | Hint m_hint; | 190 | Hint m_hint; | ||
185 | Hinting m_hinting; | 191 | Hinting m_hinting; | ||
186 | AntiAliasing m_antiAliasing; | 192 | AntiAliasing m_antiAliasing; | ||
193 | bool m_antiAliasingHasLocalConfig; | ||||
187 | QDomDocument m_doc; | 194 | QDomDocument m_doc; | ||
188 | QString m_file; | 195 | QString m_file; | ||
189 | bool m_madeChanges; | 196 | bool m_madeChanges; | ||
190 | time_t m_time; | 197 | time_t m_time; | ||
191 | }; | 198 | }; | ||
192 | 199 | | |||
193 | #endif | 200 | #endif | ||
194 | 201 | | |||
195 | #endif | 202 | #endif |