diff options
author | Vladimir Glazounov <vg@openoffice.org> | 2008-10-01 13:46:45 +0000 |
---|---|---|
committer | Vladimir Glazounov <vg@openoffice.org> | 2008-10-01 13:46:45 +0000 |
commit | 6ee5dfa150d408179e20a5525ff7ec46649e0e58 (patch) | |
tree | f1282052e25df8f62e9d78a1408e68f5c4e063e6 /vcl/unx | |
parent | 46a63a2af38e694327c5308168f499a549fb724e (diff) |
CWS-TOOLING: integrate CWS vcl94
Diffstat (limited to 'vcl/unx')
-rw-r--r-- | vcl/unx/gtk/a11y/atkwrapper.cxx | 11 | ||||
-rw-r--r-- | vcl/unx/gtk/window/gtkframe.cxx | 3 | ||||
-rw-r--r-- | vcl/unx/source/gdi/salgdi.cxx | 29 | ||||
-rw-r--r-- | vcl/unx/source/gdi/salgdi2.cxx | 21 | ||||
-rw-r--r-- | vcl/unx/source/gdi/salgdi3.cxx | 7 | ||||
-rw-r--r-- | vcl/unx/source/gdi/xrender_peer.hxx | 23 |
6 files changed, 48 insertions, 46 deletions
diff --git a/vcl/unx/gtk/a11y/atkwrapper.cxx b/vcl/unx/gtk/a11y/atkwrapper.cxx index b2b02d8f05af..927b8548a77a 100644 --- a/vcl/unx/gtk/a11y/atkwrapper.cxx +++ b/vcl/unx/gtk/a11y/atkwrapper.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: atkwrapper.cxx,v $ - * $Revision: 1.11 $ + * $Revision: 1.11.52.1 $ * * This file is part of OpenOffice.org. * @@ -344,8 +344,13 @@ wrapper_get_name( AtkObject *atk_obj ) obj->mpContext->getAccessibleName(), RTL_TEXTENCODING_UTF8); - g_free(atk_obj->name); - atk_obj->name = g_strdup(aName.getStr()); + int nCmp = atk_obj->name ? rtl_str_compare( atk_obj->name, aName.getStr() ) : -1; + if( nCmp != 0 ) + { + if( atk_obj->name ) + g_free(atk_obj->name); + atk_obj->name = g_strdup(aName.getStr()); + } } catch(const uno::Exception& e) { g_warning( "Exception in getAccessibleName()" ); diff --git a/vcl/unx/gtk/window/gtkframe.cxx b/vcl/unx/gtk/window/gtkframe.cxx index 00e5f6215cd7..c00d14a4a587 100644 --- a/vcl/unx/gtk/window/gtkframe.cxx +++ b/vcl/unx/gtk/window/gtkframe.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: gtkframe.cxx,v $ - * $Revision: 1.84 $ + * $Revision: 1.84.36.1 $ * * This file is part of OpenOffice.org. * @@ -1624,6 +1624,7 @@ void GtkSalFrame::moveToScreen( int nScreen ) GtkSalDisplay* pDisp = getDisplay(); m_aSystemData.aWindow = GDK_WINDOW_XWINDOW(m_pWindow->window); m_aSystemData.pVisual = pDisp->GetVisual( m_nScreen ).GetVisual(); + m_aSystemData.nScreen = nScreen; m_aSystemData.nDepth = pDisp->GetVisual( m_nScreen ).GetDepth(); m_aSystemData.aColormap = pDisp->GetColormap( m_nScreen ).GetXColormap(); m_aSystemData.pAppContext = NULL; diff --git a/vcl/unx/source/gdi/salgdi.cxx b/vcl/unx/source/gdi/salgdi.cxx index 2b21397248ef..60acda82091e 100644 --- a/vcl/unx/source/gdi/salgdi.cxx +++ b/vcl/unx/source/gdi/salgdi.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: salgdi.cxx,v $ - * $Revision: 1.53 $ + * $Revision: 1.53.16.1 $ * * This file is part of OpenOffice.org. * @@ -1361,36 +1361,25 @@ bool X11SalGraphics::drawPolyPolygon( const ::basegfx::B2DPolyPolygon& rPolyPoly } // create xrender Picture for polygon foreground - Display* pXDisplay = GetXDisplay(); - int nVisualDepth = pVisualFormat->depth; - SalDisplay::RenderEntry& rEntry = GetDisplay()->GetRenderEntries( m_nScreen )[ nVisualDepth ]; + SalDisplay::RenderEntry& rEntry = GetDisplay()->GetRenderEntries( m_nScreen )[ 32 ]; if( !rEntry.m_aPicture ) { -#ifdef DBG_UTIL - int iDummy; - unsigned uDummy; - XLIB_Window wDummy; - unsigned int nDrawDepth; - ::XGetGeometry( pXDisplay, hDrawable_, &wDummy, &iDummy, &iDummy, - &uDummy, &uDummy, &uDummy, &nDrawDepth ); - DBG_ASSERT( static_cast<unsigned>(nVisualDepth) == nDrawDepth, "depth messed up for XRender" ); -#endif // DBG_UTIL - - rEntry.m_aPixmap = ::XCreatePixmap( pXDisplay, hDrawable_, 1, 1, nVisualDepth ); + Display* pXDisplay = GetXDisplay(); + + rEntry.m_aPixmap = ::XCreatePixmap( pXDisplay, hDrawable_, 1, 1, 32 ); XRenderPictureAttributes aAttr; aAttr.repeat = true; - XRenderPictFormat* pXRPF = rRenderPeer.FindStandardFormat(PictStandardARGB32); - rEntry.m_aPicture = rRenderPeer.CreatePicture ( rEntry.m_aPixmap, pXRPF, CPRepeat, aAttr ); + XRenderPictFormat* pXRPF = rRenderPeer.FindStandardFormat( PictStandardARGB32 ); + rEntry.m_aPicture = rRenderPeer.CreatePicture( rEntry.m_aPixmap, pXRPF, CPRepeat, &aAttr ); } // set polygon foreground color and opacity - XRenderColor aRenderColor = GetXRenderColor( nBrushColor_ , fTransparency); + XRenderColor aRenderColor = GetXRenderColor( nBrushColor_ , fTransparency ); rRenderPeer.FillRectangle( PictOpSrc, rEntry.m_aPicture, &aRenderColor, 0, 0, 1, 1 ); // notify xrender of target drawable - XRenderPictureAttributes aAttr; - Picture aDst = rRenderPeer.CreatePicture( hDrawable_, pVisualFormat, 0, aAttr ); + Picture aDst = rRenderPeer.CreatePicture( hDrawable_, pVisualFormat, 0, NULL ); // set clipping if( pClipRegion_ && !XEmptyRegion( pClipRegion_ ) ) diff --git a/vcl/unx/source/gdi/salgdi2.cxx b/vcl/unx/source/gdi/salgdi2.cxx index f0dbc771ff76..8086ea8e8ea5 100644 --- a/vcl/unx/source/gdi/salgdi2.cxx +++ b/vcl/unx/source/gdi/salgdi2.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: salgdi2.cxx,v $ - * $Revision: 1.47 $ + * $Revision: 1.47.16.1 $ * * This file is part of OpenOffice.org. * @@ -820,8 +820,7 @@ bool X11SalGraphics::drawAlphaBitmap( const SalTwoRect& rTR, if( !pDstVisFmt ) return false; - XRenderPictureAttributes aAttr; - Picture aDstPic = rPeer.CreatePicture( hDrawable_, pDstVisFmt, 0, aAttr ); + Picture aDstPic = rPeer.CreatePicture( hDrawable_, pDstVisFmt, 0, NULL ); if( !aDstPic ) return false; @@ -844,7 +843,7 @@ bool X11SalGraphics::drawAlphaBitmap( const SalTwoRect& rTR, return false; XRenderPictFormat* pSrcVisFmt = pDstVisFmt; - Picture aSrcPic = rPeer.CreatePicture( aSrcPM, pSrcVisFmt, 0, aAttr ); + Picture aSrcPic = rPeer.CreatePicture( aSrcPM, pSrcVisFmt, 0, NULL ); if( !aSrcPic ) return false; @@ -899,8 +898,9 @@ bool X11SalGraphics::drawAlphaBitmap( const SalTwoRect& rTR, const_cast<SalBitmap&>(rAlphaBmp).ReleaseBuffer( pAlphaBuffer, TRUE ); + XRenderPictureAttributes aAttr; aAttr.repeat = true; - Picture aAlphaPic = rPeer.CreatePicture( aAlphaPM, pAlphaFormat, CPRepeat, aAttr ); + Picture aAlphaPic = rPeer.CreatePicture( aAlphaPM, pAlphaFormat, CPRepeat, &aAttr ); if( !aAlphaPic ) return false; @@ -948,17 +948,12 @@ bool X11SalGraphics::drawAlphaRect( long nX, long nY, long nWidth, if( !pDstVisFmt ) return false; - XRenderPictureAttributes aAttr; - Picture aDstPic = rPeer.CreatePicture( hDrawable_, pDstVisFmt, 0, aAttr ); + Picture aDstPic = rPeer.CreatePicture( hDrawable_, pDstVisFmt, 0, NULL ); if( !aDstPic ) return false; - XRenderColor aRenderColor = { - SALCOLOR_RED(nBrushColor_), - SALCOLOR_GREEN(nBrushColor_), - SALCOLOR_BLUE(nBrushColor_), - 255 - 255L*nTransparency/100 - }; + const double fTransparency = (100 - nTransparency) * (1.0/100); + const XRenderColor aRenderColor = GetXRenderColor( nBrushColor_ , fTransparency); rPeer.FillRectangle( PictOpOver, aDstPic, diff --git a/vcl/unx/source/gdi/salgdi3.cxx b/vcl/unx/source/gdi/salgdi3.cxx index 5caaaa81c425..f9fcf0929a88 100644 --- a/vcl/unx/source/gdi/salgdi3.cxx +++ b/vcl/unx/source/gdi/salgdi3.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: salgdi3.cxx,v $ - * $Revision: 1.158 $ + * $Revision: 1.157.12.2 $ * * This file is part of OpenOffice.org. * @@ -1053,7 +1053,7 @@ void X11SalGraphics::DrawServerAAFontString( const ServerFontLayout& rLayout ) XRenderPictureAttributes aAttr; aAttr.repeat = true; - rEntry.m_aPicture = rRenderPeer.CreatePicture ( rEntry.m_aPixmap, pVisualFormat, CPRepeat, aAttr ); + rEntry.m_aPicture = rRenderPeer.CreatePicture ( rEntry.m_aPixmap, pVisualFormat, CPRepeat, &aAttr ); } // set font foreground color and opacity @@ -1061,8 +1061,7 @@ void X11SalGraphics::DrawServerAAFontString( const ServerFontLayout& rLayout ) rRenderPeer.FillRectangle( PictOpSrc, rEntry.m_aPicture, &aRenderColor, 0, 0, 1, 1 ); // notify xrender of target drawable - XRenderPictureAttributes aAttr; - Picture aDst = rRenderPeer.CreatePicture( hDrawable_, pVisualFormat, 0, aAttr ); + Picture aDst = rRenderPeer.CreatePicture( hDrawable_, pVisualFormat, 0, NULL ); // set clipping if( pClipRegion_ && !XEmptyRegion( pClipRegion_ ) ) diff --git a/vcl/unx/source/gdi/xrender_peer.hxx b/vcl/unx/source/gdi/xrender_peer.hxx index 6b5a7688575c..24abd9d239e2 100644 --- a/vcl/unx/source/gdi/xrender_peer.hxx +++ b/vcl/unx/source/gdi/xrender_peer.hxx @@ -65,7 +65,7 @@ public: XRenderPictFormat* FindPictureFormat( unsigned long nMask, const XRenderPictFormat& ) const; Picture CreatePicture( Drawable, const XRenderPictFormat*, - unsigned long nDrawable, const XRenderPictureAttributes& ) const; + unsigned long nDrawable, const XRenderPictureAttributes* ) const; void SetPictureClipRegion( Picture, XLIB_Region ) const; void CompositePicture( int nOp, Picture aSrc, Picture aMask, Picture aDst, int nXSrc, int nYSrc, int nXMask, int nYMask, @@ -183,14 +183,14 @@ inline XRenderPictFormat* XRenderPeer::FindPictureFormat( unsigned long nFormatM inline Picture XRenderPeer::CreatePicture( Drawable aDrawable, const XRenderPictFormat* pVisFormat, unsigned long nValueMask, - const XRenderPictureAttributes& rRenderAttr ) const + const XRenderPictureAttributes* pRenderAttr ) const { #ifdef XRENDER_LINK return XRenderCreatePicture( mpDisplay, aDrawable, pVisFormat, - nValueMask, &rRenderAttr ); + nValueMask, pRenderAttr ); #else return (*mpXRenderCreatePicture)( mpDisplay, aDrawable, pVisFormat, - nValueMask, &rRenderAttr ); + nValueMask, pRenderAttr ); #endif } @@ -350,10 +350,23 @@ inline Picture& ScopedPic::Get() inline XRenderColor GetXRenderColor( const SalColor& rSalColor, double fTransparency = 0.0 ) { XRenderColor aRetVal; + // convert the SalColor aRetVal.red = SALCOLOR_RED( rSalColor ); aRetVal.red |= (aRetVal.red << 8); aRetVal.green = SALCOLOR_GREEN( rSalColor ); aRetVal.green |= (aRetVal.green << 8); aRetVal.blue = SALCOLOR_BLUE( rSalColor ); aRetVal.blue |= (aRetVal.blue << 8); - aRetVal.alpha = static_cast< unsigned short >((1.0 - fTransparency) * double(0xffff)); + + // handle transparency + aRetVal.alpha = 0xFFFF; // default to opaque + if( fTransparency != 0 ) + { + const double fAlpha = 1.0 - fTransparency; + aRetVal.alpha = static_cast<sal_uInt16>(fAlpha * 0xFFFF + 0.5); + // xrender wants pre-multiplied colors + aRetVal.red = static_cast<sal_uInt16>(fAlpha * aRetVal.red + 0.5); + aRetVal.green = static_cast<sal_uInt16>(fAlpha * aRetVal.green + 0.5); + aRetVal.blue = static_cast<sal_uInt16>(fAlpha * aRetVal.blue + 0.5); + } + return aRetVal; } |