Changeset View
Changeset View
Standalone View
Standalone View
effects.h
Show First 20 Lines • Show All 187 Lines • ▼ Show 20 Line(s) | 74 | public: | |||
---|---|---|---|---|---|
188 | void removeSupportProperty(const QByteArray& propertyName, Effect* effect) override; | 188 | void removeSupportProperty(const QByteArray& propertyName, Effect* effect) override; | ||
189 | 189 | | |||
190 | bool hasDecorationShadows() const override; | 190 | bool hasDecorationShadows() const override; | ||
191 | 191 | | |||
192 | bool decorationsHaveAlpha() const override; | 192 | bool decorationsHaveAlpha() const override; | ||
193 | 193 | | |||
194 | bool decorationSupportsBlurBehind() const override; | 194 | bool decorationSupportsBlurBehind() const override; | ||
195 | 195 | | |||
196 | EffectFrame* effectFrame(EffectFrameStyle style, bool staticSize, const QPoint& position, Qt::Alignment alignment) const override; | | |||
197 | | ||||
198 | QVariant kwinOption(KWinOption kwopt) override; | 196 | QVariant kwinOption(KWinOption kwopt) override; | ||
199 | bool isScreenLocked() const override; | 197 | bool isScreenLocked() const override; | ||
200 | 198 | | |||
201 | bool makeOpenGLContextCurrent() override; | 199 | bool makeOpenGLContextCurrent() override; | ||
202 | void doneOpenGLContextCurrent() override; | 200 | void doneOpenGLContextCurrent() override; | ||
203 | 201 | | |||
204 | xcb_connection_t *xcbConnection() const override; | 202 | xcb_connection_t *xcbConnection() const override; | ||
205 | xcb_window_t x11RootWindow() const override; | 203 | xcb_window_t x11RootWindow() const override; | ||
▲ Show 20 Lines • Show All 325 Lines • ▼ Show 20 Line(s) | |||||
531 | { | 529 | { | ||
532 | public: | 530 | public: | ||
533 | explicit EffectWindowGroupImpl(Group* g); | 531 | explicit EffectWindowGroupImpl(Group* g); | ||
534 | EffectWindowList members() const override; | 532 | EffectWindowList members() const override; | ||
535 | private: | 533 | private: | ||
536 | Group* group; | 534 | Group* group; | ||
537 | }; | 535 | }; | ||
538 | 536 | | |||
539 | class KWIN_EXPORT EffectFrameImpl | | |||
540 | : public QObject, public EffectFrame | | |||
541 | { | | |||
542 | Q_OBJECT | | |||
543 | public: | | |||
544 | explicit EffectFrameImpl(EffectFrameStyle style, bool staticSize = true, QPoint position = QPoint(-1, -1), | | |||
545 | Qt::Alignment alignment = Qt::AlignCenter); | | |||
546 | ~EffectFrameImpl() override; | | |||
547 | | ||||
548 | void free() override; | | |||
549 | void render(const QRegion ®ion = infiniteRegion(), double opacity = 1.0, double frameOpacity = 1.0) override; | | |||
550 | Qt::Alignment alignment() const override; | | |||
551 | void setAlignment(Qt::Alignment alignment) override; | | |||
552 | const QFont& font() const override; | | |||
553 | void setFont(const QFont& font) override; | | |||
554 | const QRect& geometry() const override; | | |||
555 | void setGeometry(const QRect& geometry, bool force = false) override; | | |||
556 | const QIcon& icon() const override; | | |||
557 | void setIcon(const QIcon& icon) override; | | |||
558 | const QSize& iconSize() const override; | | |||
559 | void setIconSize(const QSize& size) override; | | |||
560 | void setPosition(const QPoint& point) override; | | |||
561 | const QString& text() const override; | | |||
562 | void setText(const QString& text) override; | | |||
563 | EffectFrameStyle style() const override { | | |||
564 | return m_style; | | |||
565 | }; | | |||
566 | Plasma::FrameSvg& frame() { | | |||
567 | return m_frame; | | |||
568 | } | | |||
569 | bool isStatic() const { | | |||
570 | return m_static; | | |||
571 | }; | | |||
572 | void finalRender(QRegion region, double opacity, double frameOpacity) const; | | |||
573 | void setShader(GLShader* shader) override { | | |||
574 | m_shader = shader; | | |||
575 | } | | |||
576 | GLShader* shader() const override { | | |||
577 | return m_shader; | | |||
578 | } | | |||
579 | void setSelection(const QRect& selection) override; | | |||
580 | const QRect& selection() const { | | |||
581 | return m_selectionGeometry; | | |||
582 | } | | |||
583 | Plasma::FrameSvg& selectionFrame() { | | |||
584 | return m_selection; | | |||
585 | } | | |||
586 | /** | | |||
587 | * The foreground text color as specified by the default Plasma theme. | | |||
588 | */ | | |||
589 | QColor styledTextColor(); | | |||
590 | | ||||
591 | private Q_SLOTS: | | |||
592 | void plasmaThemeChanged(); | | |||
593 | | ||||
594 | private: | | |||
595 | Q_DISABLE_COPY(EffectFrameImpl) // As we need to use Qt slots we cannot copy this class | | |||
596 | void align(QRect &geometry); // positions geometry around m_point respecting m_alignment | | |||
597 | void autoResize(); // Auto-resize if not a static size | | |||
598 | | ||||
599 | EffectFrameStyle m_style; | | |||
600 | Plasma::FrameSvg m_frame; // TODO: share between all EffectFrames | | |||
601 | Plasma::FrameSvg m_selection; | | |||
602 | | ||||
603 | // Position | | |||
604 | bool m_static; | | |||
605 | QPoint m_point; | | |||
606 | Qt::Alignment m_alignment; | | |||
607 | QRect m_geometry; | | |||
608 | | ||||
609 | // Contents | | |||
610 | QString m_text; | | |||
611 | QFont m_font; | | |||
612 | QIcon m_icon; | | |||
613 | QSize m_iconSize; | | |||
614 | QRect m_selectionGeometry; | | |||
615 | | ||||
616 | Scene::EffectFrame* m_sceneFrame; | | |||
617 | GLShader* m_shader; | | |||
618 | | ||||
619 | Plasma::Theme *m_theme; | | |||
620 | }; | | |||
621 | | ||||
622 | inline | 537 | inline | ||
623 | QList<EffectWindow*> EffectsHandlerImpl::elevatedWindows() const | 538 | QList<EffectWindow*> EffectsHandlerImpl::elevatedWindows() const | ||
624 | { | 539 | { | ||
625 | if (isScreenLocked()) | 540 | if (isScreenLocked()) | ||
626 | return QList<EffectWindow*>(); | 541 | return QList<EffectWindow*>(); | ||
627 | return elevated_windows; | 542 | return elevated_windows; | ||
628 | } | 543 | } | ||
629 | 544 | | |||
▲ Show 20 Lines • Show All 49 Lines • Show Last 20 Lines |