Changeset View
Changeset View
Standalone View
Standalone View
kcms/fonts/fonts.h
Show All 40 Lines | 38 | { | |||
---|---|---|---|---|---|
41 | Q_PROPERTY(QAbstractItemModel *subPixelOptionsModel READ subPixelOptionsModel CONSTANT) | 41 | Q_PROPERTY(QAbstractItemModel *subPixelOptionsModel READ subPixelOptionsModel CONSTANT) | ||
42 | Q_PROPERTY(int subPixelCurrentIndex READ subPixelCurrentIndex WRITE setSubPixelCurrentIndex NOTIFY subPixelCurrentIndexChanged); | 42 | Q_PROPERTY(int subPixelCurrentIndex READ subPixelCurrentIndex WRITE setSubPixelCurrentIndex NOTIFY subPixelCurrentIndexChanged); | ||
43 | Q_PROPERTY(QAbstractItemModel *hintingOptionsModel READ hintingOptionsModel CONSTANT) | 43 | Q_PROPERTY(QAbstractItemModel *hintingOptionsModel READ hintingOptionsModel CONSTANT) | ||
44 | Q_PROPERTY(int hintingCurrentIndex READ hintingCurrentIndex WRITE setHintingCurrentIndex NOTIFY hintingCurrentIndexChanged); | 44 | Q_PROPERTY(int hintingCurrentIndex READ hintingCurrentIndex WRITE setHintingCurrentIndex NOTIFY hintingCurrentIndexChanged); | ||
45 | 45 | | |||
46 | Q_PROPERTY(bool exclude READ exclude WRITE setExclude NOTIFY excludeChanged) | 46 | Q_PROPERTY(bool exclude READ exclude WRITE setExclude NOTIFY excludeChanged) | ||
47 | Q_PROPERTY(int excludeTo READ excludeTo WRITE setExcludeTo NOTIFY excludeToChanged) | 47 | Q_PROPERTY(int excludeTo READ excludeTo WRITE setExcludeTo NOTIFY excludeToChanged) | ||
48 | Q_PROPERTY(int excludeFrom READ excludeFrom WRITE setExcludeFrom NOTIFY excludeFromChanged) | 48 | Q_PROPERTY(int excludeFrom READ excludeFrom WRITE setExcludeFrom NOTIFY excludeFromChanged) | ||
49 | Q_PROPERTY(int antiAliasing READ antiAliasing WRITE setAntiAliasing NOTIFY aliasingChanged) | 49 | Q_PROPERTY(bool antiAliasing READ antiAliasing WRITE setAntiAliasing NOTIFY aliasingChanged) | ||
50 | Q_PROPERTY(int dpi READ dpi WRITE setDpi NOTIFY dpiChanged) | 50 | Q_PROPERTY(int dpi READ dpi WRITE setDpi NOTIFY dpiChanged) | ||
51 | 51 | | |||
52 | struct State | ||||
53 | { | ||||
54 | bool exclude; | ||||
55 | int excludeFrom; | ||||
56 | int excludeTo; | ||||
57 | int antiAliasing; | ||||
58 | bool antiAliasingHasLocalConfig; | ||||
59 | int dpi; | ||||
60 | int subPixel; | ||||
61 | int hinting; | ||||
62 | | ||||
63 | bool operator==(const State& other) const; | ||||
64 | bool operator!=(const State& other) const; | ||||
65 | }; | ||||
66 | | ||||
52 | public: | 67 | public: | ||
53 | enum AASetting { AAEnabled, AASystem, AADisabled }; | 68 | enum AASetting { AAEnabled, AASystem, AADisabled }; | ||
54 | #if defined(HAVE_FONTCONFIG) && defined (HAVE_X11) | 69 | #if defined(HAVE_FONTCONFIG) && defined (HAVE_X11) | ||
55 | FontAASettings(QObject *parent); | 70 | FontAASettings(QObject *parent); | ||
56 | 71 | | |||
57 | bool save(KXftConfig::AntiAliasing::State aaState); | 72 | bool save(KXftConfig::AntiAliasing::State aaState); | ||
58 | void load(); | 73 | void load(); | ||
59 | void defaults(); | 74 | void defaults(); | ||
60 | void setAntiAliasingState(KXftConfig::AntiAliasing::State aaState); | 75 | void setAntiAliasingState(KXftConfig::AntiAliasing::State aaState); | ||
61 | QAbstractItemModel* subPixelOptionsModel() { return m_subPixelOptionsModel; } | 76 | QAbstractItemModel* subPixelOptionsModel() { return m_subPixelOptionsModel; } | ||
62 | QAbstractItemModel* hintingOptionsModel() { return m_hintingOptionsModel; } | 77 | QAbstractItemModel* hintingOptionsModel() { return m_hintingOptionsModel; } | ||
63 | 78 | | |||
64 | void setExclude(bool exclude); | 79 | void setExclude(bool exclude); | ||
65 | bool exclude() const; | 80 | bool exclude() const; | ||
66 | 81 | | |||
67 | void setExcludeTo(const int &excludeTo); | 82 | void setExcludeTo(const int &excludeTo); | ||
68 | int excludeTo() const; | 83 | int excludeTo() const; | ||
69 | 84 | | |||
70 | void setExcludeFrom(const int &excludeTo); | 85 | void setExcludeFrom(const int &excludeTo); | ||
71 | int excludeFrom() const; | 86 | int excludeFrom() const; | ||
72 | 87 | | |||
73 | void setAntiAliasing(const int& antiAliasing); | 88 | void setAntiAliasing(bool antiAliasing); | ||
74 | int antiAliasing() const; | 89 | bool antiAliasing() const; | ||
90 | | ||||
91 | bool antiAliasingNeedsSave() const; | ||||
75 | 92 | | |||
76 | void setDpi(const int &dpi); | 93 | void setDpi(const int &dpi); | ||
77 | int dpi() const; | 94 | int dpi() const; | ||
78 | 95 | | |||
79 | int subPixelCurrentIndex(); | 96 | int subPixelCurrentIndex(); | ||
80 | void setSubPixelCurrentIndex(int idx); | 97 | void setSubPixelCurrentIndex(int idx); | ||
81 | int hintingCurrentIndex(); | 98 | int hintingCurrentIndex(); | ||
82 | void setHintingCurrentIndex(int idx); | 99 | void setHintingCurrentIndex(int idx); | ||
Show All 9 Lines | 105 | Q_SIGNALS: | |||
92 | void antiAliasingChanged(); | 109 | void antiAliasingChanged(); | ||
93 | void aliasingChanged(); | 110 | void aliasingChanged(); | ||
94 | void dpiChanged(); | 111 | void dpiChanged(); | ||
95 | void subPixelCurrentIndexChanged(); | 112 | void subPixelCurrentIndexChanged(); | ||
96 | void hintingCurrentIndexChanged(); | 113 | void hintingCurrentIndexChanged(); | ||
97 | 114 | | |||
98 | #if defined(HAVE_FONTCONFIG) && defined (HAVE_X11) | 115 | #if defined(HAVE_FONTCONFIG) && defined (HAVE_X11) | ||
99 | private: | 116 | private: | ||
100 | int m_excludeTo; | 117 | State m_state; | ||
101 | int m_excludeToOriginal; | 118 | State m_originalState; | ||
102 | int m_excludeFrom; | | |||
103 | int m_excludeFromOriginal; | | |||
104 | int m_antiAliasing; | | |||
105 | int m_antiAliasingOriginal; | | |||
106 | int m_dpi; | | |||
107 | int m_dpiOriginal; | | |||
108 | int m_subPixelCurrentIndex = 0; | | |||
109 | int m_subPixelCurrentIndexOriginal; | | |||
110 | int m_hintingCurrentIndex = 0; | | |||
111 | int m_hintingCurrentIndexOriginal; | | |||
112 | QStandardItemModel *m_subPixelOptionsModel; | 119 | QStandardItemModel *m_subPixelOptionsModel; | ||
113 | QStandardItemModel *m_hintingOptionsModel; | 120 | QStandardItemModel *m_hintingOptionsModel; | ||
114 | bool m_exclude = false; | | |||
115 | #endif | 121 | #endif | ||
116 | }; | 122 | }; | ||
117 | 123 | | |||
118 | /** | 124 | /** | ||
119 | * The Desktop/fonts tab in kcontrol. | 125 | * The Desktop/fonts tab in kcontrol. | ||
120 | */ | 126 | */ | ||
121 | class KFonts : public KQuickAddons::ConfigModule | 127 | class KFonts : public KQuickAddons::ConfigModule | ||
122 | { | 128 | { | ||
▲ Show 20 Lines • Show All 74 Lines • Show Last 20 Lines |