From ab41fc59820938df287c369362ea25fa7a91ef96 Mon Sep 17 00:00:00 2001 From: Armin Le Grand Date: Tue, 30 Mar 2010 17:54:56 +0200 Subject: renaissance1 #i110498# All needed changes for SoftShadow for DRawPage visualisation --- svx/inc/svdstr.hrc | 1 + svx/source/sdr/contact/viewcontactofsdrpage.cxx | 84 ++++++++++++++++------ .../sdr/contact/viewobjectcontactofsdrpage.cxx | 6 ++ svx/source/svdraw/svdstr.src | 5 ++ 4 files changed, 73 insertions(+), 23 deletions(-) (limited to 'svx') diff --git a/svx/inc/svdstr.hrc b/svx/inc/svdstr.hrc index f1c19b4e0895..2a1b1df52dec 100644 --- a/svx/inc/svdstr.hrc +++ b/svx/inc/svdstr.hrc @@ -756,6 +756,7 @@ //BFS01#define SIP_SDRATTRSET_GRAF (SIP_Begin + 258) #define SIP_SA_MARKERS (SIP_Begin + 258) +#define SIP_SA_PAGESHADOW35X35 (SIP_Begin + 259) #define SIP_SA_FINE_MARKERS (SIP_Begin + 260) // #100499# diff --git a/svx/source/sdr/contact/viewcontactofsdrpage.cxx b/svx/source/sdr/contact/viewcontactofsdrpage.cxx index c4a51200d5fc..be5d0de79cae 100644 --- a/svx/source/sdr/contact/viewcontactofsdrpage.cxx +++ b/svx/source/sdr/contact/viewcontactofsdrpage.cxx @@ -45,6 +45,10 @@ #include #include #include +#include +#include "svdstr.hrc" +#include "svdglob.hxx" +#include ////////////////////////////////////////////////////////////////////////////// @@ -130,31 +134,59 @@ namespace sdr drawinglayer::primitive2d::Primitive2DSequence ViewContactOfPageShadow::createViewIndependentPrimitive2DSequence() const { + static bool bUseOldPageShadow(false); const SdrPage& rPage = getPage(); basegfx::B2DHomMatrix aPageMatrix; aPageMatrix.set(0, 0, (double)rPage.GetWdt()); aPageMatrix.set(1, 1, (double)rPage.GetHgt()); - // create page shadow polygon - const double fPageBorderFactor(1.0 / 256.0); - basegfx::B2DPolygon aPageShadowPolygon; - aPageShadowPolygon.append(basegfx::B2DPoint(1.0, fPageBorderFactor)); - aPageShadowPolygon.append(basegfx::B2DPoint(1.0 + fPageBorderFactor, fPageBorderFactor)); - aPageShadowPolygon.append(basegfx::B2DPoint(1.0 + fPageBorderFactor, 1.0 + fPageBorderFactor)); - aPageShadowPolygon.append(basegfx::B2DPoint(fPageBorderFactor, 1.0 + fPageBorderFactor)); - aPageShadowPolygon.append(basegfx::B2DPoint(fPageBorderFactor, 1.0)); - aPageShadowPolygon.append(basegfx::B2DPoint(1.0, 1.0)); - aPageShadowPolygon.setClosed(true); - aPageShadowPolygon.transform(aPageMatrix); + if(bUseOldPageShadow) + { + // create page shadow polygon + const double fPageBorderFactor(1.0 / 256.0); + basegfx::B2DPolygon aPageShadowPolygon; + aPageShadowPolygon.append(basegfx::B2DPoint(1.0, fPageBorderFactor)); + aPageShadowPolygon.append(basegfx::B2DPoint(1.0 + fPageBorderFactor, fPageBorderFactor)); + aPageShadowPolygon.append(basegfx::B2DPoint(1.0 + fPageBorderFactor, 1.0 + fPageBorderFactor)); + aPageShadowPolygon.append(basegfx::B2DPoint(fPageBorderFactor, 1.0 + fPageBorderFactor)); + aPageShadowPolygon.append(basegfx::B2DPoint(fPageBorderFactor, 1.0)); + aPageShadowPolygon.append(basegfx::B2DPoint(1.0, 1.0)); + aPageShadowPolygon.setClosed(true); + aPageShadowPolygon.transform(aPageMatrix); + + // We have only the page information, not the view information. Use the + // svtools::FONTCOLOR color for initialisation + const svtools::ColorConfig aColorConfig; + const Color aShadowColor(aColorConfig.GetColorValue(svtools::FONTCOLOR).nColor); + const basegfx::BColor aRGBShadowColor(aShadowColor.getBColor()); + const drawinglayer::primitive2d::Primitive2DReference xReference( + new drawinglayer::primitive2d::PolyPolygonColorPrimitive2D( + basegfx::B2DPolyPolygon(aPageShadowPolygon), + aRGBShadowColor)); + + return drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1); + } + else + { + static vcl::DeleteOnDeinit< BitmapEx > aPageShadow35x35( + new BitmapEx(ResId(SIP_SA_PAGESHADOW35X35, *ImpGetResMgr()))); - // We have only the page information, not the view information. Use the - // svtools::FONTCOLOR color for initialisation - const svtools::ColorConfig aColorConfig; - const Color aShadowColor(aColorConfig.GetColorValue(svtools::FONTCOLOR).nColor); - const basegfx::BColor aRGBShadowColor(aShadowColor.getBColor()); - const drawinglayer::primitive2d::Primitive2DReference xReference(new drawinglayer::primitive2d::PolyPolygonColorPrimitive2D(basegfx::B2DPolyPolygon(aPageShadowPolygon), aRGBShadowColor)); + if(aPageShadow35x35.get()) + { + static drawinglayer::primitive2d::DiscreteShadow aDiscreteShadow(*aPageShadow35x35.get()); - return drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1); + const drawinglayer::primitive2d::Primitive2DReference xReference( + new drawinglayer::primitive2d::DiscreteShadowPrimitive2D( + aPageMatrix, + aDiscreteShadow)); + + return drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1); + } + else + { + return drawinglayer::primitive2d::Primitive2DSequence(); + } + } } ViewContactOfPageShadow::ViewContactOfPageShadow(ViewContactOfSdrPage& rParentViewContactOfSdrPage) @@ -315,11 +347,17 @@ namespace sdr const SdrPage& rPage = getPage(); const basegfx::B2DRange aPageBorderRange(0.0, 0.0, (double)rPage.GetWdt(), (double)rPage.GetHgt()); - // We have only the page information, not the view information. Use the - // svtools::FONTCOLOR color for initialisation - const svtools::ColorConfig aColorConfig; - const Color aBorderColor(aColorConfig.GetColorValue(svtools::FONTCOLOR).nColor); - const basegfx::BColor aRGBBorderColor(aBorderColor.getBColor()); + // Changed to 0x949599 for renaissance, before svtools::FONTCOLOR was used. + // Added old case as fallback for HighContrast. + basegfx::BColor aRGBBorderColor(0x94 / (double)0xff, 0x95 / (double)0xff, 0x99 / (double)0xff); + + if(Application::GetSettings().GetStyleSettings().GetHighContrastMode()) + { + const svtools::ColorConfig aColorConfig; + const Color aBorderColor(aColorConfig.GetColorValue(svtools::FONTCOLOR).nColor); + + aRGBBorderColor = aBorderColor.getBColor(); + } if(rPage.getPageBorderOnlyLeftRight()) { diff --git a/svx/source/sdr/contact/viewobjectcontactofsdrpage.cxx b/svx/source/sdr/contact/viewobjectcontactofsdrpage.cxx index c751ba2ada76..f7145dcd9d73 100644 --- a/svx/source/sdr/contact/viewobjectcontactofsdrpage.cxx +++ b/svx/source/sdr/contact/viewobjectcontactofsdrpage.cxx @@ -320,6 +320,12 @@ namespace sdr return false; } + // no page shadow for high contrast mode + if(GetObjectContact().isDrawModeHighContrast()) + { + return false; + } + return true; } } // end of namespace contact diff --git a/svx/source/svdraw/svdstr.src b/svx/source/svdraw/svdstr.src index ee6cbaea9632..3569aa35c6ff 100644 --- a/svx/source/svdraw/svdstr.src +++ b/svx/source/svdraw/svdstr.src @@ -2741,6 +2741,11 @@ String SIP_SA_GRAFRESERVE4 { Text = "" ; }; String SIP_SA_GRAFRESERVE5 { Text = "" ; }; String SIP_SA_GRAFRESERVE6 { Text = "" ; }; +Bitmap SIP_SA_PAGESHADOW35X35 +{ + File = "pageshadow35x35.png"; +}; + Bitmap SIP_SA_MARKERS { File = "markers.bmp"; -- cgit From 4cda571eda7bd9abe5f95d13a6d0b0cb93ed24b0 Mon Sep 17 00:00:00 2001 From: Andre Fischer Date: Thu, 8 Jul 2010 12:27:24 +0200 Subject: renaissance1: resolved merge conflicts, cleanup. --- svx/inc/svx/svxids.hrc | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 svx/inc/svx/svxids.hrc (limited to 'svx') diff --git a/svx/inc/svx/svxids.hrc b/svx/inc/svx/svxids.hrc old mode 100644 new mode 100755 -- cgit From b8d78852acfa632daa32d5827d0ee64fd6102c80 Mon Sep 17 00:00:00 2001 From: Andre Fischer Date: Thu, 5 Aug 2010 15:59:10 +0200 Subject: renaissance1: #i113685# Avoid (indirect) static BitmapEx. --- svx/source/sdr/contact/viewcontactofsdrpage.cxx | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'svx') diff --git a/svx/source/sdr/contact/viewcontactofsdrpage.cxx b/svx/source/sdr/contact/viewcontactofsdrpage.cxx index 29d11b3dfe26..ad65b647001e 100644 --- a/svx/source/sdr/contact/viewcontactofsdrpage.cxx +++ b/svx/source/sdr/contact/viewcontactofsdrpage.cxx @@ -169,24 +169,19 @@ namespace sdr } else { - static vcl::DeleteOnDeinit< BitmapEx > aPageShadow35x35( - new BitmapEx(ResId(SIP_SA_PAGESHADOW35X35, *ImpGetResMgr()))); - - if(aPageShadow35x35.get()) + static vcl::DeleteOnDeinit + aDiscreteShadow(new drawinglayer::primitive2d::DiscreteShadow( + BitmapEx(ResId(SIP_SA_PAGESHADOW35X35, *ImpGetResMgr())))); + if (aDiscreteShadow.get() != NULL) { - static drawinglayer::primitive2d::DiscreteShadow aDiscreteShadow(*aPageShadow35x35.get()); - const drawinglayer::primitive2d::Primitive2DReference xReference( new drawinglayer::primitive2d::DiscreteShadowPrimitive2D( aPageMatrix, - aDiscreteShadow)); + *aDiscreteShadow.get())); return drawinglayer::primitive2d::Primitive2DSequence(&xReference, 1); } - else - { - return drawinglayer::primitive2d::Primitive2DSequence(); - } + return drawinglayer::primitive2d::Primitive2DSequence(); } } -- cgit