21#include <com/sun/star/awt/XWindow.hpp>
22#include <com/sun/star/awt/PosSize.hpp>
23#include <com/sun/star/lang/XMultiServiceFactory.hpp>
68 if (!
mpImpl->mxControlContainer.is() && _bCreateIfNecessary)
86 uno::Reference< awt::XControl > xControl(
mpImpl->mxControlContainer, uno::UNO_QUERY);
89 uno::Reference< uno::XInterface > xContext = xControl->getContext();
92 xControl->createPeer( uno::Reference<awt::XToolkit>(), uno::Reference<awt::XWindowPeer>() );
99 uno::Reference< lang::XMultiServiceFactory >
xFactory( ::comphelper::getProcessServiceFactory() );
100 const_cast< SdrPageWindow*
>( this )->
mpImpl->mxControlContainer.set(
xFactory->createInstance(
"com.sun.star.awt.UnoControlContainer"), uno::UNO_QUERY);
101 uno::Reference< awt::XControlModel >
xModel(
xFactory->createInstance(
"com.sun.star.awt.UnoControlContainerModel"), uno::UNO_QUERY);
102 uno::Reference< awt::XControl > xControl(
mpImpl->mxControlContainer, uno::UNO_QUERY);
104 xControl->setModel(
xModel);
110 uno::Reference< awt::XWindow > xContComp(
mpImpl->mxControlContainer, uno::UNO_QUERY);
112 xContComp->setPosSize(aPosPix.
X(), aPosPix.
Y(), aSizePix.
Width(), aSizePix.
Height(), awt::PosSize::POSSIZE);
116 if ( pViewAsFormView )
119 return mpImpl->mxControlContainer;
123 mpImpl(new
Impl(rPageView, rPaintWindow))
132 if (!
mpImpl->mxControlContainer.is())
139 if ( pViewAsFormView )
143 uno::Reference< lang::XComponent > xComponent(
mpImpl->mxControlContainer, uno::UNO_QUERY);
144 xComponent->dispose();
149 return mpImpl->mrPageView;
154 return *
mpImpl->mpPaintWindow;
159 return mpImpl->mpOriginalPaintWindow;
173 if (!
mpImpl->mpOriginalPaintWindow)
177 mpImpl->mpPaintWindow = &rPaintWindow;
178 mpImpl->mpOriginalPaintWindow->setPatched(&rPaintWindow);
179 return mpImpl->mpOriginalPaintWindow;
184 auto pPreviousPaintWindow =
mpImpl->mpPaintWindow;
185 mpImpl->mpPaintWindow = &rPaintWindow;
186 mpImpl->mpOriginalPaintWindow->setPatched(&rPaintWindow);
187 return pPreviousPaintWindow;
193 if (pPreviousPaintWindow ==
mpImpl->mpOriginalPaintWindow)
197 mpImpl->mpOriginalPaintWindow->setPatched(
nullptr);
198 mpImpl->mpOriginalPaintWindow =
nullptr;
203 mpImpl->mpPaintWindow = pPreviousPaintWindow;
204 mpImpl->mpOriginalPaintWindow->setPatched(pPreviousPaintWindow);
250 if(aCandidate.areControlPointsUsed())
255 if(aCandidate.count())
257 const sal_uInt32 nLoopCount(aCandidate.isClosed() ? aCandidate.count() : aCandidate.count() - 1);
261 for(sal_uInt32
a(0);
a < nLoopCount;
a++)
264 const basegfx::B2DPoint aBEnd(aCandidate.getB2DPoint((a + 1) % aCandidate.count()));
286 for(sal_uInt32
a(1);
a < rPageView.
GetPage()->GetObjCount();
a++)
294 aPolyB.
append(aCandidate);
298 if(aPolyA.count() && aPolyA.isClosed() && aPolyB.
count())
304 for(
auto const& rPolygon : aResult)
309 Color aColor(nR, nG, nB);
310 impPaintStrokePolygon(rPolygon, rOutDev, aColor);
331 SdrLayerIDSet aProcessLayers = bPrinter ?
mpImpl->mrPageView.GetPrintableLayers() :
mpImpl->mrPageView.GetVisibleLayers();
343 aProcessLayers.
Clear(nControlLayerId);
382 SdrLayerIDSet aProcessLayers = bPrinter ?
mpImpl->mrPageView.GetPrintableLayers() :
mpImpl->mrPageView.GetVisibleLayers();
385 if(aProcessLayers.
IsSet(*pId))
390 const bool bControlLayerProcessingActive(nControlLayerId == *pId);
403 aProcessLayers.
Set(*pId);
412 const bool bOldPageDecorationAllowed(
GetPageView().GetView().IsPageDecorationAllowed());
413 const bool bOldMasterPageVisualizationAllowed(
GetPageView().GetView().IsMasterPageVisualizationAllowed());
447 aDiscreteRange.
grow(1.0);
452 bool bNegativeX =
mpImpl->mrPageView.GetView().IsNegativeX();
473 bool bNegativeX =
mpImpl->mrPageView.GetView().IsNegativeX();
490 if (!
mpImpl->mpObjectContact)
494 "svx::svdraw::SdrPageWindow mpObjectContact");
497 return *
mpImpl->mpObjectContact;
502 if (!
mpImpl->mpObjectContact)
506 "svx::svdraw::SdrPageWindow mpObjectContact" );
509 return *
mpImpl->mpObjectContact;
514 return mpImpl->mpObjectContact !=
nullptr;
520 if (
mpImpl->mpObjectContact)
522 delete mpImpl->mpObjectContact;
523 mpImpl->mpObjectContact =
nullptr;
530 DBG_ASSERT( pOC,
"SdrPageWindow::SetDesignMode: invalid object contact!" );
const Point & GetOrigin() const
void EnableMapMode(bool bEnable=true)
basegfx::B2DHomMatrix GetViewTransformation() const
Size GetOutputSizePixel() const
void DrawLine(const Point &rStartPt, const Point &rEndPt)
const MapMode & GetMapMode() const
virtual vcl::Window * GetOwnerWindow() const
bool IsMapModeEnabled() const
constexpr tools::Long Y() const
constexpr tools::Long X() const
const OUString & GetControlLayerName() const
SdrLayerID GetLayerID(const OUString &rName) const
bool IsSet(SdrLayerID a) const
const SdrLayerAdmin & GetLayerAdmin() const
SdrObject * GetObj(size_t nNum) const
size_t GetObjCount() const
SdrPage * GetPage() const
void unpatchPaintWindow(SdrPaintWindow *pPreviousPaintWindow)
std::unique_ptr< Impl > mpImpl
rtl::Reference< sdr::overlay::OverlayManager > const & GetOverlayManager() const
bool HasObjectContact() const
determines whether there already exists an ObjectContact
SdrPaintWindow * patchPaintWindow(SdrPaintWindow &rPaintWindow)
css::uno::Reference< css::awt::XControlContainer > const & GetControlContainer(bool _bCreateIfNecessary=true) const
void PrepareRedraw(const vcl::Region &rReg)
void InvalidatePageWindow(const basegfx::B2DRange &rRange)
void SetDesignMode(bool _bDesignMode) const
sets all elements in the view which support a design and an alive mode into the given mode
SdrPaintWindow & GetPaintWindow() const
SdrPageWindow(const SdrPageWindow &)=delete
void RedrawLayer(const SdrLayerID *pId, sdr::contact::ViewObjectContactRedirector *pRedirector, basegfx::B2IRectangle const *)
const sdr::contact::ObjectContact & GetObjectContact() const
void RedrawAll(sdr::contact::ViewObjectContactRedirector *pRedirector)
void ResetObjectContact()
const SdrPaintWindow * GetOriginalPaintWindow() const
SdrPageView & GetPageView() const
A SdrPage contains exactly one SdrObjList and a description of the physical page dimensions (size / m...
bool IsPrintPreview() const
virtual void InvalidateOneWin(OutputDevice &rWin)
If the View should not call Invalidate() on the windows, override the following 2 methods and do some...
void SetMasterPageVisualizationAllowed(bool bNew)
SdrModel & GetModel() const
void SetPageDecorationAllowed(bool bNew)
const vcl::Region & GetRedrawRegion() const
rtl::Reference< sdr::overlay::OverlayManager > const & GetOverlayManager() const
OutputDevice & GetOutputDevice() const
bool OutputToWindow() const
void SetRedrawRegion(const vcl::Region &rNew)
virtual sdr::contact::ObjectContact * createViewSpecificObjectContact(SdrPageWindow &rPageWindow, const char *pDebugName) const
static void notifyInvalidation(SfxViewShell const *pThisView, tools::Rectangle const *)
static SAL_WARN_UNUSED_RESULT SfxViewShell * Current()
constexpr tools::Long Height() const
constexpr tools::Long Width() const
static css::uno::Reference< css::awt::XControlContainer > CreateControlContainer(vcl::Window *pWindow)
void append(const B2DPolygon &rPolygon, sal_uInt32 nCount=1)
BASEGFX_DLLPUBLIC void transform(const B2DHomMatrix &rMatrix)
void SetUNOControlsDesignMode(bool _bDesignMode) const
sets all UNO controls which are associated with this ObjectContact to design or alive mode.
#define DBG_ASSERT(sCon, aError)
Reference< XSingleServiceFactory > xFactory
tools::Long FRound(double fVal)
B2DPolygon adaptiveSubdivideByAngle(const B2DPolygon &rCandidate, double fAngleBound)
B2DPolyPolygon correctOrientations(const B2DPolyPolygon &rCandidate)
B2DPolyPolygon clipPolyPolygonOnPolyPolygon(const B2DPolyPolygon &rCandidate, const B2DPolyPolygon &rClip, bool bInside, bool bStroke, size_t *pPointLimit)
int uniform_int_distribution(int a, int b)
constexpr Point convert(const Point &rPoint, o3tl::Length eFrom, o3tl::Length eTo)
SdrPaintWindow * mpPaintWindow
sdr::contact::ObjectContact * mpObjectContact
SdrPaintWindow * mpOriginalPaintWindow
uno::Reference< awt::XControlContainer > mxControlContainer
Impl(SdrPageView &rPageView, SdrPaintWindow &rPaintWindow)
Reference< XModel > xModel