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; | ||||
| 161 | bool subPixelTypeHasLocalConfig() const; | ||||
| 162 | bool hintStyleHasLocalConfig() const; | ||||
| 159 | bool changed() | 163 | bool changed() | ||
| 160 | { | 164 | { | ||
| 161 | return m_madeChanges; | 165 | return m_madeChanges; | ||
| 162 | } | 166 | } | ||
| 163 | static QString description(SubPixel::Type t); | 167 | static QString description(SubPixel::Type t); | ||
| 164 | static const char *toStr(SubPixel::Type t); | 168 | static const char *toStr(SubPixel::Type t); | ||
| 165 | static QString description(Hint::Style s); | 169 | static QString description(Hint::Style s); | ||
| 166 | static const char *toStr(Hint::Style s); | 170 | static const char *toStr(Hint::Style s); | ||
| 167 | bool aliasingEnabled(); | 171 | bool aliasingEnabled(); | ||
| 168 | 172 | | |||
| 169 | private: | 173 | private: | ||
| 170 | 174 | | |||
| 175 | bool parseConfigFile(const QString& filename); | ||||
| 171 | void readContents(); | 176 | void readContents(); | ||
| 172 | void applySubPixelType(); | 177 | void applySubPixelType(); | ||
| 173 | void applyHintStyle(); | 178 | void applyHintStyle(); | ||
| 174 | void applyAntiAliasing(); | 179 | void applyAntiAliasing(); | ||
| 175 | void setHinting(bool set); | 180 | void setHinting(bool set); | ||
| 176 | void applyHinting(); | 181 | void applyHinting(); | ||
| 177 | void applyExcludeRange(bool pixel); | 182 | void applyExcludeRange(bool pixel); | ||
| 183 | QString getConfigFile(); | ||||
| 178 | 184 | | |||
| 179 | private: | 185 | private: | ||
| 180 | 186 | | |||
| 187 | QStringList m_globalFiles; | ||||
| 188 | | ||||
| 181 | SubPixel m_subPixel; | 189 | SubPixel m_subPixel; | ||
| 182 | Exclude m_excludeRange, | 190 | Exclude m_excludeRange, | ||
| 183 | m_excludePixelRange; | 191 | m_excludePixelRange; | ||
| 184 | Hint m_hint; | 192 | Hint m_hint; | ||
| 185 | Hinting m_hinting; | 193 | Hinting m_hinting; | ||
| 186 | AntiAliasing m_antiAliasing; | 194 | AntiAliasing m_antiAliasing; | ||
| 195 | bool m_antiAliasingHasLocalConfig; | ||||
| 196 | bool m_subPixelHasLocalConfig; | ||||
| 197 | bool m_hintHasLocalConfig; | ||||
| 187 | QDomDocument m_doc; | 198 | QDomDocument m_doc; | ||
| 188 | QString m_file; | 199 | QString m_file; | ||
| 189 | bool m_madeChanges; | 200 | bool m_madeChanges; | ||
| 190 | time_t m_time; | 201 | time_t m_time; | ||
| 191 | }; | 202 | }; | ||
| 192 | 203 | | |||
| 193 | #endif | 204 | #endif | ||
| 194 | 205 | | |||
| 195 | #endif | 206 | #endif | ||