56 if(&(candidate->GetOutputDevice()) == &rOut)
58 return candidate.get();
62 if(
nullptr != candidate->getPatched() && &(candidate->getPatched()->GetOutputDevice()) == &rOut)
79 [&](
const std::unique_ptr<SdrPaintWindow>&
p) {
return p.get() == &rOld; });
106 const sal_uInt32 nMaximumQuadraticPixels)
121 nMaximumQuadraticPixels);
128 : mrSdrModelFromSdrView(rSdrModel)
129 , mpModel(&rSdrModel)
130 , mpActualOutDev(nullptr)
132 , mpDefaultStyleSheet(nullptr)
133 , maDefaultAttr(rSdrModel.GetItemPool())
139 , mbPageVisible(true)
140 , mbPageShadowVisible(true)
141 , mbPageBorderVisible(true)
142 , mbBordVisible(true)
143 , mbGridVisible(true)
145 , mbHlplVisible(true)
147 , mbGlueVisible(false)
148 , mbGlueVisible2(false)
149 , mbGlueVisible3(false)
150 , mbGlueVisible4(false)
151 , mbSomeObjChgdFlag(false)
152 , mbSwapAsynchron(false)
153 , mbPrintPreview(false)
154 , mbAnimationPause(false)
155 , mbBufferedOutputAllowed(false)
156 , mbBufferedOverlayAllowed(false)
157 , mbPagePaintingAllowed(true)
158 , mbPreviewRenderer(false)
162 , mbHideFormControl(false)
197 if (rHint.
GetId() == SfxHintId::Dying)
202 if (rHint.
GetId() != SfxHintId::ThisIsAnSdrHint)
237 if (mbSomeObjChgdFlag) {
238 mbSomeObjChgdFlag=
false;
247 const_cast<SdrPaintView*
>(
this)->ImpComeBackHdl(&const_cast<SdrPaintView*>(
this)->maComeBackIdle);
302 if (nMinMov>=0)
return sal_uInt16(nMinMov);
316 if (nHitTol>=0)
return sal_uInt16(nHitTol);
382 DBG_ASSERT(pNewWin,
"SdrPaintView::AddWindowToPaintView: No OutputDevice(!)");
388 mpPageView->AddPaintWindowToPageView(*pNewPaintWindow);
394 assert(pOldWin &&
"SdrPaintView::DeleteWindowFromPaintView: No OutputDevice(!)");
401 mpPageView->RemovePaintWindowFromPageView(*pCandidate);
477 #ifdef SVX_REPAINT_TIMER_TEST
478 #define REMEMBERED_TIMES_COUNT (10)
479 static bool bDoTimerTest(
false);
480 static bool bTimesInited(
false);
481 static sal_uInt32 nRepeatCount(10);
482 static double fLastTimes[REMEMBERED_TIMES_COUNT];
489 count = nRepeatCount;
492 for(a = 0; a < count; a++)
494 #endif // SVX_REPAINT_TIMER_TEST
516 OSL_ENSURE(pPaintWindow,
"SdrPaintView::CompleteRedraw: No OutDev (!)");
521 #ifdef SVX_REPAINT_TIMER_TEST
527 const sal_uInt64 nNeededTime(nStopTime - nStartTime);
528 const double fTimePerPaint((
double)nNeededTime / (
double)nRepeatCount);
532 for(a = 0; a < REMEMBERED_TIMES_COUNT; a++)
534 fLastTimes[a] = fTimePerPaint;
541 for(a = 1; a < REMEMBERED_TIMES_COUNT; a++)
543 fLastTimes[a - 1] = fLastTimes[a];
546 fLastTimes[REMEMBERED_TIMES_COUNT - 1] = fTimePerPaint;
549 double fAddedTimes(0.0);
551 for(a = 0; a < REMEMBERED_TIMES_COUNT; a++)
553 fAddedTimes += fLastTimes[a];
556 const double fAverageTimePerPaint(fAddedTimes / (
double)REMEMBERED_TIMES_COUNT);
558 fprintf(stderr,
"-----------(start result)----------\n");
559 fprintf(stderr,
"StartTime : %" SAL_PRIuUINT64
", StopTime: %" SAL_PRIuUINT64
", NeededTime: %" SAL_PRIuUINT64
", TimePerPaint: %f\n", nStartTime, nStopTime, nNeededTime, fTimePerPaint);
560 fprintf(stderr,
"Remembered times: ");
562 for(a = 0; a < REMEMBERED_TIMES_COUNT; a++)
564 fprintf(stderr,
"%d: %f ", a, fLastTimes[a]);
567 fprintf(stderr,
"\n");
568 fprintf(stderr,
"AverageTimePerPaint: %f\n", fAverageTimePerPaint);
569 fprintf(stderr,
"-----------(stop result)----------\n");
571 #endif // SVX_REPAINT_TIMER_TEST
579 OSL_ENSURE(pOut,
"SdrPaintView::BeginCompleteRedraw: No OutDev (!)");
605 mpPageView->CompleteRedraw(rPaintWindow, rReg, pRedirector);
611 std::unique_ptr<SdrPaintWindow> pPaintWindow;
615 pPaintWindow.reset(&rPaintWindow);
616 pPaintWindow->setTemporaryTarget(
false);
622 delete &rPaintWindow;
638 static_cast< SdrView*
>(
this)->TextEditDrawing(rPaintWindow);
648 for (
SdrView* pView = aIter.FirstView(); pView; pView = aIter.NextView())
653 if (pView->IsTextEdit() && pView->GetSdrPageView())
655 pView->TextEditDrawing(rPaintWindow);
674 OSL_ENSURE(pPaintWindow,
"SdrPaintView::BeginDrawLayers: No SdrPaintWindow (!)");
688 mpPageView->setPreparedPageWindow(pKnownTarget);
710 OSL_ENSURE(pPaintWindow,
"SdrPaintView::UpdateDrawLayersRegion: No SdrPaintWindow (!)");
720 mpPageView->setPreparedPageWindow(pKnownTarget);
749 return aOptimizedRepaintRegion;
768 mpPageView->setPreparedPageWindow(pKnownTarget);
784 for(sal_uInt32 nWinNum(0); nWinNum < nWindowCount; nWinNum++)
796 for (
size_t nObjNum=0; nObjNum<nObjCount; ++nObjNum) {
799 if (pGPL!=
nullptr && pGPL->
GetCount()!=0) {
800 pGPL->
Invalidate(static_cast<vcl::Window&>(rOutDev), pObj);
812 for(sal_uInt32
a(0);
a < nWindowCount;
a++)
827 for(sal_uInt32
a(0);
a < nWindowCount;
a++)
837 aOrg.setX(-aOrg.X() ); aOrg.setY(-aOrg.Y() );
851 vcl::Window& rWin(static_cast<vcl::Window&>(rDevice));
858 vcl::Window& rWin(static_cast<vcl::Window&>(rDevice));
860 rWin.
Invalidate(rRect, InvalidateFlags::NoErase);
892 bool bMeasure=
dynamic_cast<const SdrView*
>(
this) !=
nullptr && static_cast<SdrView*>(
this)->
IsMeasureTool();
897 if (pLayer!=
nullptr) {
911 bool bMeasure=
dynamic_cast<const SdrView*
>(
this) !=
nullptr && static_cast<const SdrView*>(
this)->
IsMeasureTool();
924 bool bHasEEFeatureItems=
false;
930 sal_uInt16 nW=pItem->Which();
935 if(bHasEEFeatureItems)
938 VclMessageType::Info, VclButtonsType::Ok,
939 "SdrPaintView::SetDefaultAttr(): Setting EE_FEATURE items at the SdrView does not make sense! It only leads to overhead and unreadable documents."));
957 if (pStyleSheet!=
nullptr && !bDontRemoveHardAttr) {
964 nWhich=aIter.NextWhich();
1011 if( aActualSize.IsEmpty() )
1015 bool bNewScale=
false;
1016 bool bNeedMoreX=aNewSize.
Width()>aActualSize.Width();
1017 bool bNeedMoreY=aNewSize.Height()>aActualSize.Height();
1018 if (bNeedMoreX || bNeedMoreY)
1022 Fraction aXFact(aNewSize.Width(),aActualSize.Width());
1023 Fraction aYFact(aNewSize.Height(),aActualSize.Height());
1024 if (aYFact>aXFact) aXFact=aYFact;
1025 aXFact*=
aMap.GetScaleX();
1026 aXFact.ReduceInaccurate(10);
1027 aMap.SetScaleX(aXFact);
1028 aMap.SetScaleY(aYFact);
1038 if (l>rRect.
Left()) dx=rRect.
Left()-l;
1039 else if (r<rRect.
Right()) dx=rRect.
Right()-r;
1040 if (o>rRect.
Top()) dy=rRect.
Top()-o;
1042 aMap.SetOrigin(
Point(aOrg.X()-dx,aOrg.Y()-dy));
1044 if (dx!=0 || dy!=0) {
1074 for(sal_uInt32 b(0); b <
mpPageView->PageWindowCount(); b++)
1130 mpPageView->SetApplicationBackgroundColor(aBackgroundColor);
1139 mpPageView->SetApplicationDocumentColor(aDocumentColor);
1184 for(sal_uInt32
a(0);
a <
mpPageView->PageWindowCount();
a++)
#define LINK(Instance, Class, Member)
OutDevType GetOutDevType() const
virtual void HideSdrPage()
const size_t count(pCandidateA->getBorderLines().size())
virtual bool IsTextEdit() const
SdrHintKind GetKind() const
SdrPaintView(SdrModel &rSdrModel, OutputDevice *pOut)
void SetStyleSheet(SfxStyleSheet *pStyleSheet, bool bDontRemoveHardAttr)
virtual bool IsAction() const
void EndDrawLayers(SdrPaintWindow &rPaintWindow, bool bPaintFormLayer)
SdrPaintWindow * getPatched() const
bool Set(const SfxItemSet &, bool bDeep=true)
virtual void ModelHasChanged()
void ImpFormLayerDrawing(SdrPaintWindow &rPaintWindow)
virtual void DeleteWindowFromPaintView(OutputDevice *pOldWin)
void SetDefaultStyleSheet(SfxStyleSheet *pStyleSheet, bool bDontRemoveHardAttr)
void SetAnimationPause(bool bSet)
Set/unset pause state for animations.
bool IsBufferedOutputAllowed() const
SdrPaintWindow * FindPaintWindow(const OutputDevice &rOut) const
void FlushComeBackTimer() const
bool mbBufferedOutputAllowed
SdrObject * GetObj(size_t nNum) const
size_t GetObjCount() const
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
void GlueInvalidate() const
const MapMode & GetMapMode() const
B2DVector getRange() const
void MergeNotPersistDefaultAttr(SfxItemSet &rAttr) const
vcl::Region GetPaintRegion() const
void DeletePaintWindow(SdrPaintWindow &rOld)
virtual SfxItemSet & GetItemSet()
virtual SdrPaintWindow * BeginCompleteRedraw(OutputDevice *pOut)
sal_uInt16 GetCount() const
void SetAnimationEnabled(bool bEnable=true)
virtual void DoConnect(SdrOle2Obj *pOleObj)
For Plugins Is called by the Paint of the OLE object.
void SetLayerPrintable(const OUString &rName, bool bPrn)
bool mbBufferedOverlayAllowed
bool IsMeasureTool() const
sal_uInt16 ImpGetMinMovLogic(short nMinMov, const OutputDevice *pOut) const
void SetLayerVisible(const OUString &rName, bool bShow)
void SetRedrawRegion(const vcl::Region &rNew)
void SetBufferedOutputAllowed(bool bNew)
HashMap_OWString_Interface aMap
const SfxPoolItem * NextItem()
sal_uInt16 ImpGetHitTolLogic(short nHitTol, const OutputDevice *pOut) const
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
OutputDevice & GetTargetOutputDevice()
bool OutputToWindow() const
virtual void Start() override
void LeaveAllGroup()
Leave all entered object groups of all visible Pages (like chdir \ in MS-DOS)
B2DHomMatrix createScaleTranslateB2DHomMatrix(double fScaleX, double fScaleY, double fTranslateX, double fTranslateY)
void SetApplicationBackgroundColor(Color aBackgroundColor)
void DoCompleteRedraw(SdrPaintWindow &rPaintWindow, const vcl::Region &rReg, sdr::contact::ViewObjectContactRedirector *pRedirector=nullptr)
OutputDevice * GetFirstOutputDevice() const
constexpr SdrLayerID SDRLAYER_NOTFOUND(0xff)
std::unique_ptr< SdrPageView > mpPageView
bool IsLayerPrintable(const OUString &rName) const
bool IsLayerVisible(const OUString &rName) const
void SetLayerLocked(const OUString &rName, bool bLock=true)
sal_uInt32 PaintWindowCount() const
void SetAnimationMode(const SdrAnimationMode eMode)
Mode when starting an animation in the Paint Handler:
void SetDebugName(const char *pDebugName)
virtual bool KeyInput(const KeyEvent &rKEvt, vcl::Window *pWin)
SfxStyleSheet * GetStyleSheet() const
virtual void ClearPageView()
SfxStyleSheet * mpDefaultStyleSheet
void GetAttributes(SfxItemSet &rTargetSet, bool bOnlyHardAttr) const
const OUString & GetControlLayerName() const
sal_uInt16 ClearItem(sal_uInt16 nWhich=0)
virtual const SdrGluePointList * GetGluePointList() const
SdrPaintWindow * BeginDrawLayers(OutputDevice *pOut, const vcl::Region &rReg, bool bDisableIntersect=false)
void SetBufferedOverlayAllowed(bool bNew)
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
#define DBG_ASSERT(sCon, aError)
SvtOptionsDrawinglayer maDrawinglayerOpt
void setTemporaryTarget(bool bNew)
SAL_DLLPRIVATE void SetPaused(bool bNew)
constexpr TypedWhichId< SdrLayerNameItem > SDRATTR_LAYERNAME(SDRATTR_NOTPERSIST_FIRST+4)
virtual void MakeVisible(const tools::Rectangle &rRect, vcl::Window &rWin)
bool IsBufferedOverlayAllowed() const
virtual void Invalidate(InvalidateFlags nFlags=InvalidateFlags::NONE)
Size GetOutputSize() const
BitmapEx convertMetafileToBitmapEx(const GDIMetaFile &rMtf, const basegfx::B2DRange &rTargetRange, const sal_uInt32 nMaximumQuadraticPixels)
Helper to convert any GDIMetaFile to a good quality BitmapEx, using default parameters and graphic::X...
bool getTemporaryTarget() const
tools::Long Width() const
const OUString & GetName() const
void SetAttributes(const SfxItemSet &rSet, bool bReplaceAll)
SdrLayer * GetLayerPerID(SdrLayerID nID)
void Intersect(const tools::Rectangle &rRegion)
const vcl::Region & GetRedrawRegion() const
void LeaveOneGroup()
Leave an object group of all visible Pages (like chdir .. in MS-DOS)
virtual SdrPageView * ShowSdrPage(SdrPage *pPage)
void StartListening(SfxBroadcaster &rBroadcaster, DuplicateHandling eDuplicateHanding=DuplicateHandling::Unexpected)
virtual void AddWindowToPaintView(OutputDevice *pNewWin, vcl::Window *pWindow)
constexpr sal_uInt16 EE_FEATURE_START(EE_CHAR_END+1)
void SetDefaultAttr(const SfxItemSet &rAttr, bool bReplaceAll)
Default attributes at the View Newly created objects are assigned these attributes by default when th...
constexpr TypedWhichId< SdrLayerIdItem > SDRATTR_LAYERID(SDRATTR_NOTPERSIST_FIRST+3)
const sdr::contact::ObjectContact & GetObjectContact() const
SdrAnimationMode meAnimationMode
void PrepareRedraw(const vcl::Region &rReg)
virtual bool IsChart() const
void SetAnimationTimer(sal_uInt32 nTime)
Point PixelToLogic(const Point &rDevicePt) const
void ConfigurationChanged(::utl::ConfigurationBroadcaster *, ConfigurationHints) override
void PreparePreRenderDevice()
void UpdateDrawLayersRegion(OutputDevice *pOut, const vcl::Region &rReg)
std::vector< std::unique_ptr< SdrPaintWindow > > maPaintWindows
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
void Broadcast(const SfxHint &rHint)
css::uno::Reference< css::graphic::XPrimitive2D > Primitive2DReference
void SetNotPersistDefaultAttr(const SfxItemSet &rAttr)
bool IsPaintBuffer() const
virtual void Scroll(tools::Long nHorzScroll, tools::Long nVertScroll, ScrollFlags nFlags=ScrollFlags::NONE)
SfxStyleSheet * GetDefaultStyleSheet() const
void OutputPreRenderDevice(const vcl::Region &rExpandedRegion)
bool IsLayerLocked(const OUString &rName) const
SdrPaintWindow & GetPaintWindow() const
void EndListening(SfxBroadcaster &rBroadcaster, bool bRemoveAllDuplicates=false)
SAL_DLLPRIVATE bool IsPaused() const
B2DPoint getMinimum() const
virtual void MovAction(const Point &rPnt)
const ::std::vector< Color > ImpSvNumberformatScan::StandardColor COL_BLACK
virtual void CompleteRedraw(OutputDevice *pOut, const vcl::Region &rReg, sdr::contact::ViewObjectContactRedirector *pRedirector=nullptr)
void SetInvokeHandler(const Link< Timer *, void > &rLink)
void SetPagePaintingAllowed(bool bNew)
static vcl::Region OptimizeDrawLayersRegion(OutputDevice *pOut, const vcl::Region &rReg, bool bDisableIntersect)
const Point & GetOrigin() const
SdrPageView * GetSdrPageView() const
void onChangeColorConfig()
constexpr sal_uInt16 EE_FEATURE_END(EE_FEATURE_FIELD+0)
svtools::ColorConfig maColorConfig
void DrawOverlay(const vcl::Region &rRegion)
BitmapEx convertPrimitive2DSequenceToBitmapEx(const std::deque< css::uno::Reference< css::graphic::XPrimitive2D > > &rSequence, const basegfx::B2DRange &rTargetRange, const sal_uInt32 nMaximumQuadraticPixels)
void SetPriority(TaskPriority ePriority)
const SdrPage * GetPage() const
A SdrPage contains exactly one SdrObjList and a description of the physical page dimensions (size / m...
void SetActualWin(const OutputDevice *pWin)
IMPL_LINK_NOARG(SdrPaintView, ImpComeBackHdl, Timer *, void)
bool IsOverlayBuffer() const
const SdrLayerAdmin & GetLayerAdmin() const
virtual void InvalidateOneWin(OutputDevice &rWin)
If the View should not call Invalidate() on the windows, override the following 2 methods and do some...
bool IsInvalidItem(const SfxPoolItem *pItem)
SAL_DLLPRIVATE void SetTime(sal_uInt32 nTime)
SdrLayerID GetLayerID(const OUString &rName) const
SdrModel * GetModel() const
virtual void TakeActionRect(tools::Rectangle &rRect) const
bool IsGroupEntered() const
Determine, whether Leave is useful or not.
OutputDevice & GetOutputDevice() const
bool mbPagePaintingAllowed
VclPtr< OutputDevice > mpActualOutDev
SdrPaintWindow * GetPaintWindow(sal_uInt32 nIndex) const
static weld::MessageDialog * CreateMessageDialog(weld::Widget *pParent, VclMessageType eMessageType, VclButtonsType eButtonType, const OUString &rPrimaryMessage, bool bMobile=false)
virtual void EndCompleteRedraw(SdrPaintWindow &rPaintWindow, bool bPaintFormLayer)
const SfxPoolItem * GetCurItem() const
void Invalidate(vcl::Window &rWin, const SdrObject *pObj) const
virtual ~SdrPaintView() override
void SetApplicationDocumentColor(Color aDocumentColor)