• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ WindowPaintData类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中WindowPaintData的典型用法代码示例。如果您正苦于以下问题:C++ WindowPaintData类的具体用法?C++ WindowPaintData怎么用?C++ WindowPaintData使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了WindowPaintData类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: paintWindow

void GlideEffect::paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data)
{
    InfoHash::const_iterator info = windows.constFind(w);
    if (info != windows.constEnd()) {
        const double progress = info->timeLine->currentValue();
        data.setRotationAxis(Qt::XAxis);
        data.setRotationAngle(angle * (1 - progress));
        data.multiplyOpacity(progress);
        switch(effect) {
        default:
        case GlideInOut:
            if (info->added)
                glideIn(w, data, info);
            else if (info->closed)
                glideOut(w, data, info);
            break;
        case GlideOutIn:
            if (info->added)
                glideOut(w, data, info);
            if (info->closed)
                glideIn(w, data, info);
            break;
        case GlideIn: glideIn(w, data, info); break;
        case GlideOut: glideOut(w, data, info); break;
        }
    }
    effects->paintWindow(w, mask, region, data);
}
开发者ID:KDE,项目名称:kde-workspace,代码行数:28,代码来源:glide.cpp


示例2: foreach

void TaskbarThumbnailEffect::paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data)
{
    effects->paintWindow(w, mask, region, data);   // paint window first
    if (thumbnails.contains(w)) {
        // paint thumbnails on it
        int mask = PAINT_WINDOW_TRANSFORMED;
        if (data.opacity() == 1.0)
            mask |= PAINT_WINDOW_OPAQUE;
        else
            mask |= PAINT_WINDOW_TRANSLUCENT;
        mask |= PAINT_WINDOW_LANCZOS;
        foreach (const Data & thumb, thumbnails.values(w)) {
            EffectWindow* thumbw = effects->findWindow(thumb.window);
            if (thumbw == NULL)
                continue;
            WindowPaintData thumbData(thumbw);
            thumbData.multiplyOpacity(data.opacity());
            QRect r, thumbRect(thumb.rect);
            thumbRect.translate(w->pos() + QPoint(data.xTranslation(), data.yTranslation()));
            thumbRect.setSize(QSize(thumbRect.width() * data.xScale(), thumbRect.height() * data.yScale())); // QSize has no vector multiplicator... :-(

            if (effects->isOpenGLCompositing()) {
                if (data.shader) {
                    thumbData.shader = data.shader;
                }
            } // if ( effects->compositingType() == KWin::OpenGLCompositing )
            setPositionTransformations(thumbData, r, thumbw, thumbRect, Qt::KeepAspectRatio);
            effects->drawWindow(thumbw, mask, r, thumbData);
        }
    }
开发者ID:walac,项目名称:kde-workspace,代码行数:30,代码来源:taskbarthumbnail.cpp


示例3: shouldBlur

bool BlurEffect::shouldBlur(const EffectWindow *w, int mask, const WindowPaintData &data) const
{
    if (!target->valid() || !shader || !shader->isValid())
        return false;

    if (effects->activeFullScreenEffect() && !w->data(WindowForceBlurRole).toBool())
        return false;

    if (w->isDesktop())
        return false;

    bool scaled = !qFuzzyCompare(data.xScale(), 1.0) && !qFuzzyCompare(data.yScale(), 1.0);
    bool translated = data.xTranslation() || data.yTranslation();

    if (scaled || ((translated || (mask & PAINT_WINDOW_TRANSFORMED)) && !w->data(WindowForceBlurRole).toBool()))
        return false;

    bool blurBehindDecos = effects->decorationsHaveAlpha() &&
                effects->decorationSupportsBlurBehind();

    if (!w->hasAlpha() && !(blurBehindDecos && w->hasDecoration()))
        return false;

    return true;
}
开发者ID:KDE,项目名称:kde-workspace,代码行数:25,代码来源:blur.cpp


示例4: paintWindow

void DimScreenEffect::paintWindow(EffectWindow *w, int mask, QRegion region, WindowPaintData &data)
{
    if (mActivated && (w != window) && w->isManaged()) {
        data.multiplyBrightness((1.0 - 0.33 * timeline.currentValue()));
        data.multiplySaturation((1.0 - 0.33 * timeline.currentValue()));
    }
    effects->paintWindow(w, mask, region, data);
}
开发者ID:walac,项目名称:kde-workspace,代码行数:8,代码来源:dimscreen.cpp


示例5: paintWindow

void SlidingPopupsEffect::paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data)
{
    bool animating = false;
    bool appearing = false;

    if (mAppearingWindows.contains(w)) {
        appearing = true;
        animating = true;
    } else if (mDisappearingWindows.contains(w) && w->isDeleted()) {
        appearing = false;
        animating = true;
    }

    if (animating) {
        qreal progress;
        if (appearing)
            progress = 1.0 - mAppearingWindows[ w ]->currentValue();
        else {
            if (mDisappearingWindows.contains(w))
                progress = mDisappearingWindows[ w ]->currentValue();
            else
                progress = 1.0;
        }
        const int start = mWindowsData[ w ].start;

        const QRect screenRect = effects->clientArea(FullScreenArea, w->screen(), w->desktop());
        int splitPoint = 0;
        const QRect geo = w->expandedGeometry();
        switch(mWindowsData[ w ].from) {
        case West:
            data.translate(- geo.width() * progress);
            splitPoint = geo.width() - (geo.x() + geo.width() - screenRect.x() - start);
            region = QRegion(geo.x() + splitPoint, geo.y(), geo.width() - splitPoint, geo.height());
            break;
        case North:
            data.translate(0.0, - geo.height() * progress);
            splitPoint = geo.height() - (geo.y() + geo.height() - screenRect.y() - start);
            region = QRegion(geo.x(), geo.y() + splitPoint, geo.width(), geo.height() - splitPoint);
            break;
        case East:
            data.translate(geo.width() * progress);
            splitPoint = screenRect.x() + screenRect.width() - geo.x() - start;
            region = QRegion(geo.x(), geo.y(), splitPoint, geo.height());
            break;
        case South:
        default:
            data.translate(0.0, geo.height() * progress);
            splitPoint = screenRect.y() + screenRect.height() - geo.y() - start;
            region = QRegion(geo.x(), geo.y(), geo.width(), splitPoint);
        }
    }

    effects->paintWindow(w, mask, region, data);
}
开发者ID:aarontc,项目名称:kde-workspace,代码行数:54,代码来源:slidingpopups.cpp


示例6: paintWindow

void DimInactiveEffect::paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data)
{
    if (dimWindow(w) || w == previousActive) {
        double previous = 1.0;
        if (w == previousActive)
            previous = previousActiveTimeline.currentValue();
        if (previousActiveTimeline.currentValue() == 1.0)
            previousActive = NULL;
        data.multiplyBrightness((1.0 - (dim_strength / 100.0) * timeline.currentValue() * previous));
        data.multiplySaturation((1.0 - (dim_strength / 100.0) * timeline.currentValue() * previous));
    }
    effects->paintWindow(w, mask, region, data);
}
开发者ID:aarontc,项目名称:kde-workspace,代码行数:13,代码来源:diminactive.cpp


示例7: glideOut

void GlideEffect::glideOut(EffectWindow* w, WindowPaintData& data)
{
    InfoHash::const_iterator info = windows.constFind(w);
    if (info == windows.constEnd())
        return;
    const double progress = info->timeLine->currentValue();
    data *= (2 - progress);
    data.translate(- int(w->width() / 2 * (1 - progress)), - int(w->height() / 2 * (1 - progress)));
}
开发者ID:aarontc,项目名称:kde-workspace,代码行数:9,代码来源:glide.cpp


示例8: paintWindow

void KscreenEffect::paintWindow(EffectWindow *w, int mask, QRegion region, WindowPaintData &data)
{
    switch (m_state) {
    case StateFadingOut:
        data.multiplyOpacity(1.0 - m_timeLine.currentValue());
        break;
    case StateFadedOut:
        data.multiplyOpacity(0.0);
        break;
    case StateFadingIn:
        data.multiplyOpacity(m_timeLine.currentValue());
        break;
    default:
        // no adjustment
        break;
    }
    effects->paintWindow(w, mask, region, data);
}
开发者ID:aarontc,项目名称:kde-workspace,代码行数:18,代码来源:kscreen.cpp


示例9: paintWindow

void ScaleInEffect::paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data)
{
    if (mTimeLineWindows.contains(w) && isScaleWindow(w)) {
        const qreal value = mTimeLineWindows[ w ]->currentValue();
        data.multiplyOpacity(value);
        data *= QVector2D(value, value);
        data += QPoint(int(w->width() / 2 * (1 - value)), int(w->height() / 2 * (1 - value)));
    }
    effects->paintWindow(w, mask, region, data);
}
开发者ID:mgottschlag,项目名称:kwin-tiling,代码行数:10,代码来源:scalein.cpp


示例10: paintWindow

void ExplosionEffect::paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data)
{
    // Make sure we have OpenGL compositing and the window is vidible and not a
    //  special window
    bool useshader = (mValid && mWindows.contains(w));
    if (useshader) {
        double maxscaleadd = 1.5f;
        double scale = 1 + maxscaleadd * mWindows[w];
        data.setXScale(scale);
        data.setYScale(scale);
        data.translate(int(w->width() / 2 * (1 - scale)), int(w->height() / 2 * (1 - scale)));
        data.multiplyOpacity(0.99);  // Force blending
        ShaderManager *manager = ShaderManager::instance();
        GLShader *shader = manager->pushShader(ShaderManager::GenericShader);
        QMatrix4x4 screenTransformation = shader->getUniformMatrix4x4("screenTransformation");
        manager->popShader();
        ShaderManager::instance()->pushShader(mShader);
        mShader->setUniform("screenTransformation", screenTransformation);
        mShader->setUniform("factor", (float)mWindows[w]);
        mShader->setUniform("scale", (float)scale);
        mShader->setUniform("windowSize", QVector2D(w->width(), w->height()));
        glActiveTexture(GL_TEXTURE4);
        mStartOffsetTex->bind();
        glActiveTexture(GL_TEXTURE5);
        mEndOffsetTex->bind();
        glActiveTexture(GL_TEXTURE0);
        data.shader = mShader;
    }

    // Call the next effect.
    effects->paintWindow(w, mask, region, data);

    if (useshader) {
        ShaderManager::instance()->popShader();
        glActiveTexture(GL_TEXTURE4);
        mStartOffsetTex->unbind();
        glActiveTexture(GL_TEXTURE5);
        mEndOffsetTex->unbind();
        glActiveTexture(GL_TEXTURE0);
    }
}
开发者ID:mgottschlag,项目名称:kwin-tiling,代码行数:41,代码来源:explosion.cpp


示例11: QPoint

// Maps window coordinates to screen coordinates
QPoint SceneXrender::Window::mapToScreen(int mask, const WindowPaintData &data, const QPoint &point) const
{
    QPoint pt = point;

    if (mask & PAINT_WINDOW_TRANSFORMED) {
        // Apply the window transformation
        pt.rx() = pt.x() * data.xScale() + data.xTranslation();
        pt.ry() = pt.y() * data.yScale() + data.yTranslation();
    }

    // Move the point to the screen position
    pt += QPoint(x(), y());

    if (mask & PAINT_SCREEN_TRANSFORMED) {
        // Apply the screen transformation
        pt.rx() = pt.x() * screen_paint.xScale() + screen_paint.xTranslation();
        pt.ry() = pt.y() * screen_paint.yScale() + screen_paint.yTranslation();
    }

    return pt;
}
开发者ID:8l,项目名称:kwin,代码行数:22,代码来源:scene_xrender.cpp


示例12: y

// Maps window coordinates to screen coordinates
QRect SceneXrender::Window::mapToScreen(int mask, const WindowPaintData &data, const QRect &rect) const
{
    QRect r = rect;

    if (mask & PAINT_WINDOW_TRANSFORMED) {
        // Apply the window transformation
        r.moveTo(r.x() * data.xScale() + data.xTranslation(),
                 r.y() * data.yScale() + data.yTranslation());
        r.setWidth(r.width() * data.xScale());
        r.setHeight(r.height() * data.yScale());
    }

    // Move the rectangle to the screen position
    r.translate(x(), y());

    if (mask & PAINT_SCREEN_TRANSFORMED) {
        // Apply the screen transformation
        r.moveTo(r.x() * screen_paint.xScale() + screen_paint.xTranslation(),
                 r.y() * screen_paint.yScale() + screen_paint.yTranslation());
        r.setWidth(r.width() * screen_paint.xScale());
        r.setHeight(r.height() * screen_paint.yScale());
    }

    return r;
}
开发者ID:8l,项目名称:kwin,代码行数:26,代码来源:scene_xrender.cpp


示例13: drawWindow

void BlurEffect::drawWindow(EffectWindow *w, int mask, QRegion region, WindowPaintData &data)
{
    const QRect screen = effects->virtualScreenGeometry();
    if (shouldBlur(w, mask, data)) {
        QRegion shape = region & blurRegion(w).translated(w->pos()) & screen;

        const bool translated = data.xTranslation() || data.yTranslation();
        // let's do the evil parts - someone wants to blur behind a transformed window
        if (translated) {
            shape = shape.translated(data.xTranslation(), data.yTranslation());
            shape = shape & region;
        }

        if (!shape.isEmpty()) {
            if (m_shouldCache && !translated) {
                doCachedBlur(w, region, data.opacity());
            } else {
                doBlur(shape, screen, data.opacity());
            }
        }
    }

    // Draw the window over the blurred area
    effects->drawWindow(w, mask, region, data);
}
开发者ID:KDE,项目名称:kde-workspace,代码行数:25,代码来源:blur.cpp


示例14: paintWindow

void LogoutEffect::paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data)
{
    if (progress > 0.0) {
        if (effects->compositingType() == KWin::OpenGLCompositing) {
            // In OpenGL mode we add vignetting and, if supported, a slight blur
            if (blurSupported) {
                // When using blur we render everything to an FBO and as such don't do the vignetting
                // until after we render the FBO to the screen.
                if (w == logoutWindow) {
                    // Window is rendered after the FBO
                    windowOpacity = data.opacity();
                    data.setOpacity(0.0); // Cheat, we need the opacity for later but don't want to blur it
                } else {
                    if (logoutWindowPassed || ignoredWindows.contains(w)) {
                        // Window is rendered after the FBO
                        windows.append(w);
                        windowsOpacities[ w ] = data.opacity();
                        data.setOpacity(0.0);
                    } else // Window is added to the FBO
                        data.multiplySaturation((1.0 - progress * 0.2));
                }
            } else {
                // If we are not blurring then we are not rendering to an FBO
                if (w == logoutWindow)
                    // This is the logout window don't alter it but render our vignetting now
                    renderVignetting();
                else if (!logoutWindowPassed && !ignoredWindows.contains(w))
                    // Window is in the background, desaturate
                    data.multiplySaturation((1.0 - progress * 0.2));
                // All other windows are unaltered
            }
        }
        if (effects->compositingType() == KWin::XRenderCompositing) {
            // Since we can't do vignetting in XRender just do a stronger desaturation and darken
            if (w != logoutWindow && !logoutWindowPassed && !ignoredWindows.contains(w)) {
                data.multiplySaturation((1.0 - progress * 0.8));
                data.multiplyBrightness((1.0 - progress * 0.3));
            }
        }
        if (w == logoutWindow ||
                ignoredWindows.contains(w))   // HACK: All windows past the first ignored one should not be
            //       blurred as it affects the stacking order.
            // All following windows are on top of the logout window and should not be altered either
            logoutWindowPassed = true;
    }
    effects->paintWindow(w, mask, region, data);
}
开发者ID:mgottschlag,项目名称:kwin-tiling,代码行数:47,代码来源:logout.cpp


示例15: setPositionTransformations

void Effect::setPositionTransformations(WindowPaintData& data, QRect& region, EffectWindow* w,
                                        const QRect& r, Qt::AspectRatioMode aspect)
{
    QSize size = w->size();
    size.scale(r.size(), aspect);
    data.setXScale(size.width() / double(w->width()));
    data.setYScale(size.height() / double(w->height()));
    int width = int(w->width() * data.xScale());
    int height = int(w->height() * data.yScale());
    int x = r.x() + (r.width() - width) / 2;
    int y = r.y() + (r.height() - height) / 2;
    region = QRect(x, y, width, height);
    data.setXTranslation(x - w->x());
    data.setYTranslation(y - w->y());
}
开发者ID:KDE,项目名称:kde-workspace,代码行数:15,代码来源:kwineffects.cpp


示例16: paintWindow

void TranslucencyEffect::paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data)
{
    if (w->isDesktop() || w->isDock()) {
        effects->paintWindow(w, mask, region, data);
        return;
    }
    // Handling active and inactive windows
    if (inactive != 1.0 && isInactive(w)) {
        data.multiplyOpacity(inactive);

        if (w == previous) {
            data.multiplyOpacity((inactive + ((1.0 - inactive) * (1.0 - activeinactive_timeline.currentValue()))));
            if (activeinactive_timeline.currentValue() < 1.0)
                w->addRepaintFull();
            else
                previous = NULL;
        }
    } else {
        // Fading in
        if (!isInactive(w) && !w->isDesktop()) {
            data.multiplyOpacity((inactive + ((1.0 - inactive) * activeinactive_timeline.currentValue())));
            if (activeinactive_timeline.currentValue() < 1.0)
                w->addRepaintFull();
        }
        // decoration and dialogs
        if (decoration != 1.0 && w->hasDecoration())
            data.multiplyDecorationOpacity(decoration);
        if (dialogs != 1.0 && w->isDialog())
            data.multiplyOpacity(dialogs);

        // Handling moving and resizing
        if (moveresize != 1.0 && !w->isDesktop() && !w->isDock()) {
            double progress = moveresize_timeline.currentValue();
            if (w->isUserMove() || w->isUserResize()) {
                // Fading to translucent
                data.multiplyOpacity((moveresize + ((1.0 - moveresize) * (1.0 - progress))));
                if (progress < 1.0 && progress > 0.0) {
                    w->addRepaintFull();
                    fadeout = w;
                }
            } else {
                // Fading back to more opaque
                if (w == fadeout && !w->isUserMove() && !w->isUserResize()) {
                    data.multiplyOpacity((moveresize + ((1.0 - moveresize) * (progress))));
                    if (progress == 1.0 || progress == 0.0)
                        fadeout = NULL;
                    else
                        w->addRepaintFull();

                }
            }
        }

        // Menus and combos
        if (dropdownmenus != 1.0 && w->isDropdownMenu())
            data.multiplyOpacity(dropdownmenus);
        if (popupmenus != 1.0 && w->isPopupMenu())
            data.multiplyOpacity(popupmenus);
        if (tornoffmenus != 1.0 && w->isMenu())
            data.multiplyOpacity(tornoffmenus);
        if (comboboxpopups != 1.0 && w->isComboBox())
            data.multiplyOpacity(comboboxpopups);

    }
    effects->paintWindow(w, mask, region, data);
}
开发者ID:mgottschlag,项目名称:kwin-tiling,代码行数:66,代码来源:translucency.cpp


示例17: paintWindow

void HighlightWindowEffect::paintWindow(EffectWindow* w, int mask, QRegion region, WindowPaintData& data)
{
    data.multiplyOpacity(m_windowOpacity.value(w, 1.0f));
    effects->paintWindow(w, mask, region, data);
}
开发者ID:walac,项目名称:kde-workspace,代码行数:5,代码来源:highlightwindow.cpp


示例18: glideOut

void GlideEffect::glideOut(EffectWindow* w, WindowPaintData& data, const InfoHash::const_iterator &info)
{
    const double progress = info->timeLine->currentValue();
    data *= (2 - progress);
    data.translate(- int(w->width() / 2 * (1 - progress)), - int(w->height() / 2 * (1 - progress)));
}
开发者ID:KDE,项目名称:kde-workspace,代码行数:6,代码来源:glide.cpp


示例19: PaintData

WindowPaintData::WindowPaintData(const WindowPaintData &other)
    : PaintData()
    , quads(other.quads)
    , shader(other.shader)
    , d(new WindowPaintDataPrivate())
{
    setXScale(other.xScale());
    setYScale(other.yScale());
    setZScale(other.zScale());
    translate(other.translation());
    setRotationOrigin(other.rotationOrigin());
    setRotationAxis(other.rotationAxis());
    setRotationAngle(other.rotationAngle());
    setOpacity(other.opacity());
    setSaturation(other.saturation());
    setBrightness(other.brightness());
    setScreen(other.screen());
    setCrossFadeProgress(other.crossFadeProgress());
    setProjectionMatrix(other.projectionMatrix());
    setModelViewMatrix(other.modelViewMatrix());
    d->screenProjectionMatrix = other.d->screenProjectionMatrix;
}
开发者ID:KDE,项目名称:kwin,代码行数:22,代码来源:kwineffects.cpp


示例20: PaintData

WindowPaintData::WindowPaintData(const WindowPaintData &other)
    : PaintData()
    , quads(other.quads)
    , shader(other.shader)
    , d(new WindowPaintDataPrivate())
{
    setXScale(other.xScale());
    setYScale(other.yScale());
    setZScale(other.zScale());
    translate(other.translation());
    setRotationOrigin(other.rotationOrigin());
    setRotationAxis(other.rotationAxis());
    setRotationAngle(other.rotationAngle());
    setOpacity(other.opacity());
    setDecorationOpacity(other.decorationOpacity());
    setSaturation(other.saturation());
    setBrightness(other.brightness());
    setScreen(other.screen());
    setCrossFadeProgress(other.crossFadeProgress());
}
开发者ID:KDE,项目名称:kde-workspace,代码行数:20,代码来源:kwineffects.cpp



注:本文中的WindowPaintData类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ WindowProjection类代码示例发布时间:2022-05-31
下一篇:
C++ WindowManager类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap