[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdebase/workspace/kwin/lib
From:       Martin Gräßlin <kde () martin-graesslin ! com>
Date:       2010-07-06 7:23:57
Message-ID: 20100706072357.9C4EAAC85D () svn ! kde ! org
[Download RAW message or body]

SVN commit 1146500 by graesslin:

The nice things about unstable ABIs is that you can remove deprecated paintText* \
methods, which are not used by any effect.

 M  +0 -107    kwineffects.cpp  
 M  +1 -55     kwineffects.h  


--- trunk/KDE/kdebase/workspace/kwin/lib/kwineffects.cpp #1146499:1146500
@@ -386,113 +386,6 @@
     return kwinconfig->group( "Effect-" + effectname );
     }
 
-bool EffectsHandler::paintText( const QString& text, const QRect& rect, const \
                QColor& color,
-        const QFont& font, const Qt::Alignment& alignment )
-{
-    QPainter p;
-    // Calculate size of the text
-    QFontMetrics fm( font );
-    QString painttext = fm.elidedText( text, Qt::ElideRight, rect.width() );
-    QRect textrect = fm.boundingRect( painttext );
-
-    // Create temporary QImage where the text will be drawn onto
-    QImage textImage( textrect.width(), textrect.height(), QImage::Format_ARGB32 );
-    textImage.fill( Qt::transparent );
-
-    // Draw the text
-    p.begin( &textImage );
-    p.setFont( font );
-    p.setRenderHint( QPainter::TextAntialiasing );
-    p.setPen( color );
-    p.drawText( -textrect.topLeft(), painttext );
-    p.end();
-
-    // Area covered by text
-    int rectX, rectY;
-    if( alignment & Qt::AlignLeft )
-        rectX = rect.x();
-    else if( alignment & Qt::AlignRight )
-        rectX = rect.right() - textrect.width();
-    else
-        rectX = rect.center().x() - textrect.width() / 2;
-    if( alignment & Qt::AlignTop )
-        rectY = rect.y();
-    else if( alignment & Qt::AlignBottom )
-        rectY = rect.bottom() - textrect.height();
-    else
-        rectY = rect.center().y() - textrect.height() / 2;
-    QRect area( rectX, rectY, textrect.width(), textrect.height() );
-
-#ifdef KWIN_HAVE_OPENGL_COMPOSITING
-    if( effects->compositingType() == OpenGLCompositing )
-        {
-        GLTexture textTexture( textImage, GL_TEXTURE_RECTANGLE_ARB );
-        glPushAttrib( GL_CURRENT_BIT | GL_ENABLE_BIT | GL_TEXTURE_BIT );
-        glEnable( GL_BLEND );
-        glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
-        textTexture.bind();
-        textTexture.render( infiniteRegion(), area );
-        textTexture.unbind();
-        glPopAttrib();
-        return true;
-        }
-#endif
-#ifdef KWIN_HAVE_XRENDER_COMPOSITING
-    if( effects->compositingType() == XRenderCompositing )
-        {
-        XRenderPicture textPicture( QPixmap::fromImage( textImage ));
-        XRenderComposite( display(), textImage.depth() == 32 ? PictOpOver : \
                PictOpSrc,
-            textPicture, None, effects->xrenderBufferPicture(),
-            0, 0, 0, 0, area.x(), area.y(), area.width(), area.height());
-        return true;
-        }
-#endif
-    return false;
-}
-
-bool EffectsHandler::paintTextWithBackground( const QString& text, const QRect& \
                rect, const QColor& color,
-        const QColor& bgcolor, const QFont& font, const Qt::Alignment& alignment )
-{
-    // Calculate size of the text
-    QFontMetrics fm( font );
-    QString painttext = fm.elidedText( text, Qt::ElideRight, rect.width() );
-    QRect textrect = fm.boundingRect( painttext );
-
-    // Area covered by text
-    int rectX, rectY;
-    if( alignment & Qt::AlignLeft )
-        rectX = rect.x();
-    else if( alignment & Qt::AlignRight )
-        rectX = rect.right() - textrect.width();
-    else
-        rectX = rect.center().x() - textrect.width() / 2;
-    if( alignment & Qt::AlignTop )
-        rectY = rect.y();
-    else if( alignment & Qt::AlignBottom )
-        rectY = rect.bottom() - textrect.height();
-    else
-        rectY = rect.center().y() - textrect.height() / 2;
-    QRect area( rectX, rectY, textrect.width(), textrect.height() );
-
-#ifdef KWIN_HAVE_OPENGL_COMPOSITING
-    if( effects->compositingType() == OpenGLCompositing )
-    {
-        glColor4f( bgcolor.redF(), bgcolor.greenF(), bgcolor.blueF(), \
                bgcolor.alphaF() );
-        renderRoundBox( area.adjusted( -8, -3, 8, 3 ), 5 );
-
-        return paintText( text, rect, color, font, alignment );
-    }
-#endif
-#ifdef KWIN_HAVE_XRENDER_COMPOSITING
-    if( effects->compositingType() == XRenderCompositing )
-    {
-        xRenderRoundBox( effects->xrenderBufferPicture(), area.adjusted( -8, -3, 8, \
                3 ), 5, bgcolor );
-        return paintText( text, rect, color, font, alignment );
-    }
-#endif
-    return false;
-}
-
 bool EffectsHandler::checkDriverBlacklist( const KConfigGroup& blacklist )
     {
 #ifdef KWIN_HAVE_OPENGL_COMPOSITING
--- trunk/KDE/kdebase/workspace/kwin/lib/kwineffects.h #1146499:1146500
@@ -169,7 +169,7 @@
 
 #define KWIN_EFFECT_API_MAKE_VERSION( major, minor ) (( major ) << 8 | ( minor ))
 #define KWIN_EFFECT_API_VERSION_MAJOR 0
-#define KWIN_EFFECT_API_VERSION_MINOR 150
+#define KWIN_EFFECT_API_VERSION_MINOR 151
 #define KWIN_EFFECT_API_VERSION KWIN_EFFECT_API_MAKE_VERSION( \
     KWIN_EFFECT_API_VERSION_MAJOR, KWIN_EFFECT_API_VERSION_MINOR )
 
@@ -758,39 +758,6 @@
         virtual bool decorationsHaveAlpha() const = 0;
 
         /**
-         * @deprecated
-         * @see EffectFrame
-         * Paints given text onto screen, possibly in elided form
-         * @param text
-         * @param center center point of the painted text
-         * @param maxwidth if text is longer than this, is will be elided
-         * @param color color of the text, may contain alpha
-         * @param font font for the text
-         **/
-        bool paintText( const QString& text, const QPoint& center, int maxwidth,
-                        const QColor& color, const QFont& font = QFont() );
-        /**
-         * @deprecated
-         * @see EffectFrame
-         */
-        bool paintText( const QString& text, const QRect& rect, const QColor& color,
-                        const QFont& font = QFont(), const Qt::Alignment& alignment \
                = Qt::AlignCenter );
-        /**
-         * @deprecated
-         * @see EffectFrame
-         */
-        bool paintTextWithBackground( const QString& text, const QPoint& center, int \
                maxwidth,
-                                      const QColor& color, const QColor& bgcolor,
-                                      const QFont& font = QFont() );
-        /**
-         * @deprecated
-         * @see EffectFrame
-         */
-        bool paintTextWithBackground( const QString& text, const QRect& rect, const \
                QColor& color,
-                                      const QColor& bgcolor, const QFont& font = \
                QFont(),
-                                      const Qt::Alignment& alignment = \
                Qt::AlignCenter );
-
-        /**
          * Checks if the driver is on given blacklist.
          * The format of the blacklist is driver identifier as key (e.g. Intel) with \
                a list of
          * concrete driver render strings as the values. The renderer string \
consists of GL_RENDERER @@ -1807,27 +1774,6 @@
 extern KWIN_EXPORT EffectsHandler* effects;
 
 /***************************************************************
- EffectsHandler
-***************************************************************/
-
-inline
-bool EffectsHandler::paintText( const QString& text, const QPoint& center, int \
                maxwidth,
-        const QColor& color, const QFont& font )
-{
-    return paintText( text, QRect( center.x() - maxwidth / 2, center.y() - 5000, \
                maxwidth, 10000 ),
-        color, font, Qt::AlignCenter );
-}
-
-inline
-bool EffectsHandler::paintTextWithBackground( const QString& text, const QPoint& \
                center, int maxwidth,
-        const QColor& color, const QColor& bgcolor, const QFont& font )
-{
-    return paintTextWithBackground( text,
-        QRect( center.x() - maxwidth / 2, center.y() - 5000, maxwidth, 10000 ),
-        color, bgcolor, font, Qt::AlignCenter );
-}
-
-/***************************************************************
  WindowVertex
 ***************************************************************/
 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic