diff options
author | hdu <duerr@sun.com> | 2010-02-15 17:23:06 +0100 |
---|---|---|
committer | hdu <duerr@sun.com> | 2010-02-15 17:23:06 +0100 |
commit | b0b248a9d63fdbed74fb87aaf6a5246beb30369d (patch) | |
tree | b081ec935768c7bc83e63362166ff33b7a69f3b8 /vcl/win | |
parent | 8ebc09348128bd97de5e27a5c6a728c9a688dd3f (diff) | |
parent | da2c680d23b67d4721aa29f740475fd6d40e2e08 (diff) |
merged with DEV300_m71
Diffstat (limited to 'vcl/win')
-rw-r--r-- | vcl/win/inc/salprn.h | 5 | ||||
-rw-r--r-- | vcl/win/source/gdi/salgdi3.cxx | 6 | ||||
-rw-r--r-- | vcl/win/source/gdi/salgdi_gdiplus.cxx | 74 | ||||
-rw-r--r-- | vcl/win/source/gdi/salnativewidgets-luna.cxx | 61 | ||||
-rw-r--r-- | vcl/win/source/gdi/salprn.cxx | 72 | ||||
-rwxr-xr-x[-rw-r--r--] | vcl/win/source/window/salframe.cxx | 5 |
6 files changed, 176 insertions, 47 deletions
diff --git a/vcl/win/inc/salprn.h b/vcl/win/inc/salprn.h index 58d721fd043a..890ff70bc3d6 100644 --- a/vcl/win/inc/salprn.h +++ b/vcl/win/inc/salprn.h @@ -88,7 +88,6 @@ public: virtual String GetPaperBinName( const ImplJobSetup* pSetupData, ULONG nPaperBin ); virtual void InitPaperFormats( const ImplJobSetup* pSetupData ); virtual int GetLandscapeAngle( const ImplJobSetup* pSetupData ); - virtual DuplexMode GetDuplexMode( const ImplJobSetup* pSetupData ); }; // ----------------- @@ -117,7 +116,9 @@ public: virtual BOOL StartJob( const XubString* pFileName, const XubString& rJobName, const XubString& rAppName, - ULONG nCopies, BOOL bCollate, + ULONG nCopies, + bool bCollate, + bool bDirect, ImplJobSetup* pSetupData ); virtual BOOL EndJob(); virtual BOOL AbortJob(); diff --git a/vcl/win/source/gdi/salgdi3.cxx b/vcl/win/source/gdi/salgdi3.cxx index d82830a9022f..12fdad65dfb1 100644 --- a/vcl/win/source/gdi/salgdi3.cxx +++ b/vcl/win/source/gdi/salgdi3.cxx @@ -65,6 +65,7 @@ #include "basegfx/polygon/b2dpolygon.hxx" #include "basegfx/polygon/b2dpolypolygon.hxx" #include "basegfx/matrix/b2dhommatrix.hxx" +#include <basegfx/matrix/b2dhommatrixtools.hxx> #include "sft.hxx" @@ -2480,9 +2481,8 @@ BOOL WinSalGraphics::GetGlyphOutline( long nIndex, // rescaling needed for the PolyPolygon conversion if( rB2DPolyPoly.count() ) { - ::basegfx::B2DHomMatrix aMatrix; - aMatrix.scale( mfFontScale/256, mfFontScale/256 ); - rB2DPolyPoly.transform( aMatrix ); + const double fFactor(mfFontScale/256); + rB2DPolyPoly.transform(basegfx::tools::createScaleB2DHomMatrix(fFactor, fFactor)); } return bRet; diff --git a/vcl/win/source/gdi/salgdi_gdiplus.cxx b/vcl/win/source/gdi/salgdi_gdiplus.cxx index 5c00c786e22d..29e4ff1d801e 100644 --- a/vcl/win/source/gdi/salgdi_gdiplus.cxx +++ b/vcl/win/source/gdi/salgdi_gdiplus.cxx @@ -62,9 +62,9 @@ // ----------------------------------------------------------------------- -void impAddB2DPolygonToGDIPlusGraphicsPath(Gdiplus::GraphicsPath& rPath, const basegfx::B2DPolygon& rPolygon) +void impAddB2DPolygonToGDIPlusGraphicsPathReal(Gdiplus::GraphicsPath& rPath, const basegfx::B2DPolygon& rPolygon, bool bNoLineJoin) { - const sal_uInt32 nCount(rPolygon.count()); + sal_uInt32 nCount(rPolygon.count()); if(nCount) { @@ -97,8 +97,58 @@ void impAddB2DPolygonToGDIPlusGraphicsPath(Gdiplus::GraphicsPath& rPath, const b if(a + 1 < nEdgeCount) { - aCurr = aNext; aFCurr = aFNext; + + if(bNoLineJoin) + { + rPath.StartFigure(); + } + } + } + } +} + +void impAddB2DPolygonToGDIPlusGraphicsPathInteger(Gdiplus::GraphicsPath& rPath, const basegfx::B2DPolygon& rPolygon, bool bNoLineJoin) +{ + sal_uInt32 nCount(rPolygon.count()); + + if(nCount) + { + const sal_uInt32 nEdgeCount(rPolygon.isClosed() ? nCount : nCount - 1); + const bool bControls(rPolygon.areControlPointsUsed()); + basegfx::B2DPoint aCurr(rPolygon.getB2DPoint(0)); + Gdiplus::Point aICurr(INT(aCurr.getX()), INT(aCurr.getY())); + + for(sal_uInt32 a(0); a < nEdgeCount; a++) + { + const sal_uInt32 nNextIndex((a + 1) % nCount); + const basegfx::B2DPoint aNext(rPolygon.getB2DPoint(nNextIndex)); + const Gdiplus::Point aINext(INT(aNext.getX()), INT(aNext.getY())); + + if(bControls && (rPolygon.isNextControlPointUsed(a) || rPolygon.isPrevControlPointUsed(nNextIndex))) + { + const basegfx::B2DPoint aCa(rPolygon.getNextControlPoint(a)); + const basegfx::B2DPoint aCb(rPolygon.getPrevControlPoint(nNextIndex)); + + rPath.AddBezier( + aICurr, + Gdiplus::Point(INT(aCa.getX()), INT(aCa.getY())), + Gdiplus::Point(INT(aCb.getX()), INT(aCb.getY())), + aINext); + } + else + { + rPath.AddLine(aICurr, aINext); + } + + if(a + 1 < nEdgeCount) + { + aICurr = aINext; + + if(bNoLineJoin) + { + rPath.StartFigure(); + } } } } @@ -123,7 +173,7 @@ bool WinSalGraphics::drawPolyPolygon( const ::basegfx::B2DPolyPolygon& rPolyPoly aPath.StartFigure(); // #i101491# not needed for first run } - impAddB2DPolygonToGDIPlusGraphicsPath(aPath, rPolyPolygon.getB2DPolygon(a)); + impAddB2DPolygonToGDIPlusGraphicsPathReal(aPath, rPolyPolygon.getB2DPolygon(a), false); aPath.CloseFigure(); } @@ -152,11 +202,16 @@ bool WinSalGraphics::drawPolyLine(const basegfx::B2DPolygon& rPolygon, const bas Gdiplus::Color aTestColor(255, SALCOLOR_RED(maLineColor), SALCOLOR_GREEN(maLineColor), SALCOLOR_BLUE(maLineColor)); Gdiplus::Pen aTestPen(aTestColor, Gdiplus::REAL(rLineWidths.getX())); Gdiplus::GraphicsPath aPath; + bool bNoLineJoin(false); switch(eLineJoin) { default : // basegfx::B2DLINEJOIN_NONE : { + if(basegfx::fTools::more(rLineWidths.getX(), 0.0)) + { + bNoLineJoin = true; + } break; } case basegfx::B2DLINEJOIN_BEVEL : @@ -179,9 +234,16 @@ bool WinSalGraphics::drawPolyLine(const basegfx::B2DPolygon& rPolygon, const bas } } - impAddB2DPolygonToGDIPlusGraphicsPath(aPath, rPolygon); + if(nCount > 250 && basegfx::fTools::more(rLineWidths.getX(), 1.5)) + { + impAddB2DPolygonToGDIPlusGraphicsPathInteger(aPath, rPolygon, bNoLineJoin); + } + else + { + impAddB2DPolygonToGDIPlusGraphicsPathReal(aPath, rPolygon, bNoLineJoin); + } - if(rPolygon.isClosed()) + if(rPolygon.isClosed() && !bNoLineJoin) { // #i101491# needed to create the correct line joins aPath.CloseFigure(); diff --git a/vcl/win/source/gdi/salnativewidgets-luna.cxx b/vcl/win/source/gdi/salnativewidgets-luna.cxx index 5a5703e10944..5c85d5d67144 100644 --- a/vcl/win/source/gdi/salnativewidgets-luna.cxx +++ b/vcl/win/source/gdi/salnativewidgets-luna.cxx @@ -337,7 +337,7 @@ BOOL ImplDrawTheme( HTHEME hTheme, HDC hDC, int iPart, int iState, RECT rc, cons } -Rectangle ImplGetThemeRect( HTHEME hTheme, HDC hDC, int iPart, int iState, const Rectangle& aRect ) +Rectangle ImplGetThemeRect( HTHEME hTheme, HDC hDC, int iPart, int iState, const Rectangle& aRect, THEMESIZE eTS = TS_TRUE ) { SIZE aSz; RECT rc; @@ -345,7 +345,7 @@ Rectangle ImplGetThemeRect( HTHEME hTheme, HDC hDC, int iPart, int iState, const rc.right = aRect.nRight; rc.top = aRect.nTop; rc.bottom = aRect.nBottom; - HRESULT hr = vsAPI.GetThemePartSize( hTheme, hDC, iPart, iState, NULL, TS_TRUE, &aSz ); // TS_TRUE returns optimal size + HRESULT hr = vsAPI.GetThemePartSize( hTheme, hDC, iPart, iState, NULL, eTS, &aSz ); // TS_TRUE returns optimal size if( hr == S_OK ) return Rectangle( 0, 0, aSz.cx, aSz.cy ); else @@ -1109,6 +1109,63 @@ BOOL WinSalGraphics::getNativeControlRegion( ControlType nType, bRet = TRUE; } } + + if( (nType == CTRL_LISTBOX || nType == CTRL_COMBOBOX ) && nPart == PART_ENTIRE_CONTROL ) + { + HTHEME hTheme = getThemeHandle( mhWnd, L"Combobox"); + if( hTheme ) + { + Rectangle aBoxRect( rControlRegion.GetBoundRect() ); + Rectangle aRect( ImplGetThemeRect( hTheme, hDC, CP_DROPDOWNBUTTON, + CBXS_NORMAL, aBoxRect ) ); + Rectangle aBrdRect( ImplGetThemeRect( hTheme, hDC, CP_BORDER, + CBB_HOT, aBoxRect ) ); + aRect.Top() -= aBrdRect.GetHeight(); + if( aRect.GetHeight() > aBoxRect.GetHeight() ) + aBoxRect.Bottom() = aBoxRect.Top() + aRect.GetHeight(); + if( aRect.GetWidth() > aBoxRect.GetWidth() ) + aBoxRect.Right() = aBoxRect.Left() + aRect.GetWidth(); + rNativeContentRegion = aBoxRect; + rNativeBoundingRegion = rNativeContentRegion; + if( !aRect.IsEmpty() ) + bRet = TRUE; + } + } + + if( (nType == CTRL_EDITBOX || nType == CTRL_SPINBOX) && nPart == PART_ENTIRE_CONTROL ) + { + HTHEME hTheme = getThemeHandle( mhWnd, L"Edit"); + if( hTheme ) + { + // get borderr size + Rectangle aBoxRect( rControlRegion.GetBoundRect() ); + Rectangle aRect( ImplGetThemeRect( hTheme, hDC, EP_BACKGROUNDWITHBORDER, + EBWBS_HOT, aBoxRect ) ); + // ad app font height + NONCLIENTMETRICSW aNonClientMetrics; + aNonClientMetrics.cbSize = sizeof( aNonClientMetrics ); + if ( SystemParametersInfoW( SPI_GETNONCLIENTMETRICS, sizeof( aNonClientMetrics ), &aNonClientMetrics, 0 ) ) + { + long nFontHeight = aNonClientMetrics.lfMessageFont.lfHeight; + if( nFontHeight < 0 ) + nFontHeight = -nFontHeight; + + if( aRect.GetHeight() && nFontHeight ) + { + aRect.Bottom() += aRect.GetHeight(); + aRect.Bottom() += nFontHeight; + if( aRect.GetHeight() > aBoxRect.GetHeight() ) + aBoxRect.Bottom() = aBoxRect.Top() + aRect.GetHeight(); + if( aRect.GetWidth() > aBoxRect.GetWidth() ) + aBoxRect.Right() = aBoxRect.Left() + aRect.GetWidth(); + rNativeContentRegion = aBoxRect; + rNativeBoundingRegion = rNativeContentRegion; + bRet = TRUE; + } + } + } + } + ReleaseDC( mhWnd, hDC ); return( bRet ); } diff --git a/vcl/win/source/gdi/salprn.cxx b/vcl/win/source/gdi/salprn.cxx index ecf91aea7c1b..f4f55dd0adbf 100644 --- a/vcl/win/source/gdi/salprn.cxx +++ b/vcl/win/source/gdi/salprn.cxx @@ -1059,6 +1059,21 @@ static void ImplDevModeToJobSetup( WinSalInfoPrinter* pPrinter, ImplJobSetup* pS break; } } + + if( nFlags & SAL_JOBSET_DUPLEXMODE ) + { + DuplexMode eDuplex = DUPLEX_UNKNOWN; + if( (CHOOSE_DEVMODE(dmFields) & DM_DUPLEX) ) + { + if( CHOOSE_DEVMODE(dmDuplex) == DMDUP_SIMPLEX ) + eDuplex = DUPLEX_OFF; + else if( CHOOSE_DEVMODE(dmDuplex) == DMDUP_VERTICAL ) + eDuplex = DUPLEX_LONGEDGE; + else if( CHOOSE_DEVMODE(dmDuplex) == DMDUP_HORIZONTAL ) + eDuplex = DUPLEX_SHORTEDGE; + } + pSetupData->meDuplexMode = eDuplex; + } } // ----------------------------------------------------------------------- @@ -1326,6 +1341,26 @@ static void ImplJobSetupToDevMode( WinSalInfoPrinter* pPrinter, ImplJobSetup* pS } } } + if( (nFlags & SAL_JOBSET_DUPLEXMODE) ) + { + switch( pSetupData->meDuplexMode ) + { + case DUPLEX_OFF: + CHOOSE_DEVMODE(dmFields) |= DM_DUPLEX; + CHOOSE_DEVMODE(dmDuplex) = DMDUP_SIMPLEX; + break; + case DUPLEX_SHORTEDGE: + CHOOSE_DEVMODE(dmFields) |= DM_DUPLEX; + CHOOSE_DEVMODE(dmDuplex) = DMDUP_HORIZONTAL; + break; + case DUPLEX_LONGEDGE: + CHOOSE_DEVMODE(dmFields) |= DM_DUPLEX; + CHOOSE_DEVMODE(dmDuplex) = DMDUP_VERTICAL; + break; + case DUPLEX_UNKNOWN: + break; + } + } } // ----------------------------------------------------------------------- @@ -1559,39 +1594,6 @@ void WinSalInfoPrinter::InitPaperFormats( const ImplJobSetup* pSetupData ) // ----------------------------------------------------------------------- -DuplexMode WinSalInfoPrinter::GetDuplexMode( const ImplJobSetup* pSetupData ) -{ - DuplexMode nRet = DUPLEX_UNKNOWN; - if ( pSetupData &&pSetupData->mpDriverData ) - { - if( aSalShlData.mbWPrinter ) - { - DEVMODEW* pDevMode = SAL_DEVMODE_W( pSetupData ); - if ( pDevMode && (pDevMode->dmFields & DM_DUPLEX )) - { - if ( pDevMode->dmDuplex == DMDUP_SIMPLEX ) - nRet = DUPLEX_OFF; - else - nRet = DUPLEX_ON; - } - } - else - { - DEVMODEA* pDevMode = SAL_DEVMODE_A( pSetupData ); - if ( pDevMode && (pDevMode->dmFields & DM_DUPLEX )) - { - if ( pDevMode->dmDuplex == DMDUP_SIMPLEX ) - nRet = DUPLEX_OFF; - else - nRet = DUPLEX_ON; - } - } - } - return nRet; -} - -// ----------------------------------------------------------------------- - int WinSalInfoPrinter::GetLandscapeAngle( const ImplJobSetup* pSetupData ) { int nRet = ImplDeviceCaps( this, DC_ORIENTATION, NULL, pSetupData ); @@ -1964,7 +1966,9 @@ static int lcl_StartDocA( HDC hDC, DOCINFOA* pInfo, WinSalPrinter* pPrt ) BOOL WinSalPrinter::StartJob( const XubString* pFileName, const XubString& rJobName, const XubString&, - ULONG nCopies, BOOL bCollate, + ULONG nCopies, + bool bCollate, + bool /*bDirect*/, ImplJobSetup* pSetupData ) { mnError = 0; diff --git a/vcl/win/source/window/salframe.cxx b/vcl/win/source/window/salframe.cxx index fc92757e0925..8bbd32994dec 100644..100755 --- a/vcl/win/source/window/salframe.cxx +++ b/vcl/win/source/window/salframe.cxx @@ -2978,6 +2978,11 @@ void WinSalFrame::UpdateSettings( AllSettings& rSettings ) aStyleSettings.SetCheckedColor( Color( nRed, nGreen, nBlue ) ); } + // caret width + DWORD nCaretWidth = 2; + if( SystemParametersInfo( SPI_GETCARETWIDTH, 0, &nCaretWidth, 0 ) ) + aStyleSettings.SetCursorSize( nCaretWidth ); + // High contrast HIGHCONTRAST hc; hc.cbSize = sizeof( HIGHCONTRAST ); |