25#include <com/sun/star/rendering/XCanvas.hpp>
41 OSL_ENSURE(
mxCanvas.is(),
"Canvas::Canvas() invalid XCanvas" );
43 ::canvas::tools::initViewState( maViewState );
46 ImplCanvas::~ImplCanvas()
50 void ImplCanvas::setTransformation( const ::basegfx::B2DHomMatrix& rMatrix )
52 ::canvas::tools::setViewStateTransform( maViewState, rMatrix );
58 return ::canvas::tools::getViewStateTransform( aMatrix,
62 void ImplCanvas::setClip( const ::basegfx::B2DPolyPolygon& rClipPoly )
65 maClipPolyPolygon = rClipPoly;
66 maViewState.Clip.clear();
69 void ImplCanvas::setClip()
71 maClipPolyPolygon.reset();
72 maViewState.Clip.clear();
77 return !maClipPolyPolygon ? nullptr : &(*maClipPolyPolygon);
82 return std::make_shared<ImplCanvas>( *
this );
85 void ImplCanvas::clear()
const
87 OSL_ENSURE(
mxCanvas.is(),
"ImplCanvas::clear(): Invalid XCanvas" );
91 uno::Reference< rendering::XCanvas > ImplCanvas::getUNOCanvas()
const
93 OSL_ENSURE(
mxCanvas.is(),
"ImplCanvas::getUNOCanvas(): Invalid XCanvas" );
98 rendering::ViewState ImplCanvas::getViewState()
const
100 if( maClipPolyPolygon && !maViewState.Clip.is() )
105 maViewState.Clip = ::basegfx::unotools::xPolyPolygonFromB2DPolyPolygon(
107 *maClipPolyPolygon );
Reference< rendering::XCanvas > mxCanvas
ImplCanvas(css::uno::Reference< css::rendering::XCanvas > xCanvas)
std::shared_ptr< Canvas > CanvasSharedPtr