Changeset View
Changeset View
Standalone View
Standalone View
libkwineffects/kwineffects.h
Show All 37 Lines | |||||
38 | #include <QVector> | 38 | #include <QVector> | ||
39 | #include <QLoggingCategory> | 39 | #include <QLoggingCategory> | ||
40 | #include <QList> | 40 | #include <QList> | ||
41 | #include <QHash> | 41 | #include <QHash> | ||
42 | #include <QStack> | 42 | #include <QStack> | ||
43 | #include <QScopedPointer> | 43 | #include <QScopedPointer> | ||
44 | 44 | | |||
45 | #include <KPluginFactory> | 45 | #include <KPluginFactory> | ||
46 | #include <KSharedConfig> | ||||
46 | 47 | | |||
47 | #include <assert.h> | 48 | #include <assert.h> | ||
48 | #include <limits.h> | 49 | #include <limits.h> | ||
49 | #include <netwm.h> | 50 | #include <netwm.h> | ||
50 | 51 | | |||
51 | #include <functional> | 52 | #include <functional> | ||
52 | 53 | | |||
53 | class KConfigGroup; | 54 | class KConfigGroup; | ||
▲ Show 20 Lines • Show All 606 Lines • ▼ Show 20 Line(s) | 660 | static void setPositionTransformations(WindowPaintData& data, QRect& region, EffectWindow* w, | |||
660 | const QRect& r, Qt::AspectRatioMode aspect); | 661 | const QRect& r, Qt::AspectRatioMode aspect); | ||
661 | 662 | | |||
662 | public Q_SLOTS: | 663 | public Q_SLOTS: | ||
663 | virtual bool borderActivated(ElectricBorder border); | 664 | virtual bool borderActivated(ElectricBorder border); | ||
664 | 665 | | |||
665 | protected: | 666 | protected: | ||
666 | xcb_connection_t *xcbConnection() const; | 667 | xcb_connection_t *xcbConnection() const; | ||
667 | xcb_window_t x11RootWindow() const; | 668 | xcb_window_t x11RootWindow() const; | ||
669 | | ||||
670 | /** | ||||
671 | * An implementing class can call this with it's kconfig compiled singleton class. | ||||
672 | * This method will perform the instance on the class. | ||||
673 | * @since 5.9 | ||||
674 | **/ | ||||
675 | template <typename T> | ||||
676 | void initConfig(); | ||||
668 | }; | 677 | }; | ||
669 | 678 | | |||
670 | 679 | | |||
671 | /** | 680 | /** | ||
672 | * Prefer the KWIN_EFFECT_FACTORY macros. | 681 | * Prefer the KWIN_EFFECT_FACTORY macros. | ||
673 | */ | 682 | */ | ||
674 | class KWINEFFECTS_EXPORT EffectPluginFactory : public KPluginFactory | 683 | class KWINEFFECTS_EXPORT EffectPluginFactory : public KPluginFactory | ||
675 | { | 684 | { | ||
▲ Show 20 Lines • Show All 610 Lines • ▼ Show 20 Line(s) | 819 | public: | |||
1286 | /** | 1295 | /** | ||
1287 | * Hides a previously shown on-screen-message again. | 1296 | * Hides a previously shown on-screen-message again. | ||
1288 | * @param flags The flags for how to hide the message | 1297 | * @param flags The flags for how to hide the message | ||
1289 | * @see showOnScreenMessage | 1298 | * @see showOnScreenMessage | ||
1290 | * @since 5.9 | 1299 | * @since 5.9 | ||
1291 | **/ | 1300 | **/ | ||
1292 | virtual void hideOnScreenMessage(OnScreenMessageHideFlags flags = OnScreenMessageHideFlags()) = 0; | 1301 | virtual void hideOnScreenMessage(OnScreenMessageHideFlags flags = OnScreenMessageHideFlags()) = 0; | ||
1293 | 1302 | | |||
1303 | /* | ||||
1304 | * @returns The configuration used by the EffectsHandler. | ||||
1305 | * @since 5.10 | ||||
1306 | **/ | ||||
1307 | virtual KSharedConfigPtr config() const = 0; | ||||
1308 | | ||||
1294 | Q_SIGNALS: | 1309 | Q_SIGNALS: | ||
1295 | /** | 1310 | /** | ||
1296 | * Signal emitted when the current desktop changed. | 1311 | * Signal emitted when the current desktop changed. | ||
1297 | * @param oldDesktop The previously current desktop | 1312 | * @param oldDesktop The previously current desktop | ||
1298 | * @param newDesktop The new current desktop | 1313 | * @param newDesktop The new current desktop | ||
1299 | * @param with The window which is taken over to the new desktop, can be NULL | 1314 | * @param with The window which is taken over to the new desktop, can be NULL | ||
1300 | * @since 4.9 | 1315 | * @since 4.9 | ||
1301 | */ | 1316 | */ | ||
▲ Show 20 Lines • Show All 2133 Lines • ▼ Show 20 Line(s) | |||||
3435 | Effect | 3450 | Effect | ||
3436 | ***************************************************************/ | 3451 | ***************************************************************/ | ||
3437 | template <typename T> | 3452 | template <typename T> | ||
3438 | int Effect::animationTime(int defaultDuration) | 3453 | int Effect::animationTime(int defaultDuration) | ||
3439 | { | 3454 | { | ||
3440 | return animationTime(T::duration() != 0 ? T::duration() : defaultDuration); | 3455 | return animationTime(T::duration() != 0 ? T::duration() : defaultDuration); | ||
3441 | } | 3456 | } | ||
3442 | 3457 | | |||
3458 | template <typename T> | ||||
3459 | void Effect::initConfig() | ||||
3460 | { | ||||
3461 | T::instance(effects->config()); | ||||
3462 | } | ||||
3463 | | ||||
3443 | } // namespace | 3464 | } // namespace | ||
3444 | Q_DECLARE_METATYPE(KWin::EffectWindow*) | 3465 | Q_DECLARE_METATYPE(KWin::EffectWindow*) | ||
3445 | Q_DECLARE_METATYPE(QList<KWin::EffectWindow*>) | 3466 | Q_DECLARE_METATYPE(QList<KWin::EffectWindow*>) | ||
3446 | 3467 | | |||
3447 | /** @} */ | 3468 | /** @} */ | ||
3448 | 3469 | | |||
3449 | #endif // KWINEFFECTS_H | 3470 | #endif // KWINEFFECTS_H |