Changeset View
Changeset View
Standalone View
Standalone View
libkwineffects/kwinglobals.h
Show All 16 Lines | |||||
17 | You should have received a copy of the GNU General Public License | 17 | You should have received a copy of the GNU General Public License | ||
18 | along with this program. If not, see <http://www.gnu.org/licenses/>. | 18 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
19 | *********************************************************************/ | 19 | *********************************************************************/ | ||
20 | 20 | | |||
21 | #ifndef KWIN_LIB_KWINGLOBALS_H | 21 | #ifndef KWIN_LIB_KWINGLOBALS_H | ||
22 | #define KWIN_LIB_KWINGLOBALS_H | 22 | #define KWIN_LIB_KWINGLOBALS_H | ||
23 | 23 | | |||
24 | #include <QCoreApplication> | 24 | #include <QCoreApplication> | ||
25 | #include <QImage> | ||||
26 | #include <QPoint> | ||||
25 | #include <QVariant> | 27 | #include <QVariant> | ||
26 | #include <QtX11Extras/QX11Info> | 28 | #include <QtX11Extras/QX11Info> | ||
27 | #include <QCoreApplication> | 29 | #include <QCoreApplication> | ||
28 | #include <QVariant> | 30 | #include <QVariant> | ||
29 | 31 | | |||
30 | #include <kwin_export.h> | 32 | #include <kwin_export.h> | ||
31 | 33 | | |||
32 | #include <xcb/xcb.h> | 34 | #include <xcb/xcb.h> | ||
▲ Show 20 Lines • Show All 159 Lines • ▼ Show 20 Line(s) | |||||
192 | 194 | | |||
193 | inline | 195 | inline | ||
194 | KWIN_EXPORT int displayHeight() | 196 | KWIN_EXPORT int displayHeight() | ||
195 | { | 197 | { | ||
196 | xcb_screen_t *screen = defaultScreen(); | 198 | xcb_screen_t *screen = defaultScreen(); | ||
197 | return screen ? screen->height_in_pixels : 0; | 199 | return screen ? screen->height_in_pixels : 0; | ||
198 | } | 200 | } | ||
199 | 201 | | |||
202 | /** | ||||
203 | * Short wrapper for a cursor image provided by the Platform. | ||||
204 | * @since 5.9 | ||||
205 | **/ | ||||
206 | class PlatformCursorImage { | ||||
207 | public: | ||||
208 | explicit PlatformCursorImage() | ||||
209 | : m_image() | ||||
210 | , m_hotSpot() | ||||
211 | { | ||||
212 | } | ||||
213 | explicit PlatformCursorImage(const QImage &image, const QPoint &hotSpot) | ||||
214 | : m_image(image) | ||||
215 | , m_hotSpot(hotSpot) | ||||
216 | { | ||||
217 | } | ||||
218 | virtual ~PlatformCursorImage() = default; | ||||
219 | | ||||
220 | QImage image() const { | ||||
221 | return m_image; | ||||
222 | } | ||||
223 | QPoint hotSpot() const { | ||||
224 | return m_hotSpot; | ||||
225 | } | ||||
226 | | ||||
227 | private: | ||||
228 | QImage m_image; | ||||
229 | QPoint m_hotSpot; | ||||
230 | }; | ||||
231 | | ||||
200 | } // namespace | 232 | } // namespace | ||
201 | 233 | | |||
202 | #define KWIN_SINGLETON_VARIABLE(ClassName, variableName) \ | 234 | #define KWIN_SINGLETON_VARIABLE(ClassName, variableName) \ | ||
203 | public: \ | 235 | public: \ | ||
204 | static ClassName *create(QObject *parent = nullptr);\ | 236 | static ClassName *create(QObject *parent = nullptr);\ | ||
205 | static ClassName *self() { return variableName; }\ | 237 | static ClassName *self() { return variableName; }\ | ||
206 | protected: \ | 238 | protected: \ | ||
207 | explicit ClassName(QObject *parent = nullptr); \ | 239 | explicit ClassName(QObject *parent = nullptr); \ | ||
Show All 18 Lines |