23#include <com/sun/star/awt/XTopWindow.hpp>
24#include <com/sun/star/lang/NoSupportException.hpp>
38 const uno::Reference< uno::XComponentContext >& ) :
43 void SpriteCanvas::initialize()
48 if( !maArguments.hasElements() )
51 SAL_INFO(
"canvas.vcl",
"SpriteCanvas created" );
54 maPropHelper.addProperties(
57 [
this]() {
return this->maCanvasHelper.isUnsafeScrolling(); },
58 [
this](css::uno::Any
const& aAny)
mutable { this->maCanvasHelper.enableUnsafeScrolling(aAny); } )
60 [
this]() {
return this->maCanvasHelper.isSpriteBounds(); },
61 [
this](css::uno::Any
const& aAny)
mutable { this->maCanvasHelper.enableSpriteBounds(aAny); } ));
63 SAL_INFO(
"canvas.vcl",
"VCLSpriteCanvas::initialize called" );
66 "VCLSpriteCanvas::initialize: wrong number of arguments" );
76 maArguments[0].getValueTypeClass() == uno::TypeClass_HYPER &&
77 maArguments[3].getValueTypeClass() == uno::TypeClass_INTERFACE,
78 "VCLSpriteCanvas::initialize: wrong number of arguments, or wrong types" );
81 maArguments[0] >>= nPtr;
85 throw lang::NoSupportException(
"Passed OutDev invalid!",
nullptr);
87 uno::Reference< awt::XWindow > xParentWindow;
88 maArguments[3] >>= xParentWindow;
91 if( xParentWindow.is())
92 pOutDevProvider = std::make_shared<WindowOutDevHolder>(xParentWindow);
94 pOutDevProvider = std::make_shared<OutDevHolder>(*pOutDev);
97 maDeviceHelper.init( pOutDevProvider );
98 setWindow( xParentWindow.is()
99 ? uno::Reference<awt::XWindow2>(xParentWindow, uno::UNO_QUERY_THROW)
100 : uno::Reference<awt::XWindow2>());
101 maCanvasHelper.init( maDeviceHelper.getBackBuffer(),
107 maArguments.realloc(0);
110 SpriteCanvas::~SpriteCanvas()
112 SAL_INFO(
"canvas.vcl",
"SpriteCanvas destroyed" );
116 void SpriteCanvas::disposeThis()
121 SpriteCanvasBaseT::disposeThis();
126 return updateScreen( bUpdateAll );
131 return updateScreen( bUpdateAll );
141 return mbIsVisible && maCanvasHelper.updateScreen(bUpdateAll,
145 OUString SAL_CALL SpriteCanvas::getServiceName( )
147 return "com.sun.star.rendering.SpriteCanvas.VCL";
151 css::uno::Sequence<OUString> SpriteCanvas::getSupportedServiceNames()
153 return { SpriteCanvas::getServiceName() };
155 OUString SpriteCanvas::getImplementationName()
157 return "com.sun.star.comp.rendering.SpriteCanvas.VCL";
159 sal_Bool SpriteCanvas::supportsService(
const OUString& sServiceName)
165 const rendering::ViewState& viewState,
166 const rendering::RenderState& renderState,
173 return maCanvasHelper.repaint( rGrf, viewState, renderState, rPt, rSz, rAttr );
177extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
179 css::uno::XComponentContext* context, css::uno::Sequence<css::uno::Any>
const& args)
183 return cppu::acquire(
p.get());
constexpr OUStringLiteral sServiceName
Product of this component's factory.
SpriteCanvas(const css::uno::Sequence< css::uno::Any > &aArguments, const css::uno::Reference< css::uno::XComponentContext > &rxContext)
#define ENSURE_ARG_OR_THROW(c, m)
Sequence< PropertyValue > aArguments
#define SAL_INFO(area, stream)
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
std::shared_ptr< OutDevProvider > OutDevProviderSharedPtr
std::shared_ptr< GraphicObject > GraphicObjectSharedPtr
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * com_sun_star_comp_rendering_SpriteCanvas_VCL_get_implementation(css::uno::XComponentContext *context, css::uno::Sequence< css::uno::Any > const &args)