21#include <com/sun/star/awt/Rectangle.hpp>
22#include <com/sun/star/awt/XDevice.hpp>
23#include <com/sun/star/graphic/XGraphic.hpp>
24#include <com/sun/star/graphic/XGraphicRenderer.hpp>
25#include <com/sun/star/lang/XServiceInfo.hpp>
26#include <com/sun/star/uno/XComponentContext.hpp>
38#define UNOGRAPHIC_DEVICE 1
39#define UNOGRAPHIC_DESTINATIONRECT 2
40#define UNOGRAPHIC_RENDERDATA 3
47 public css::lang::XServiceInfo,
48 public css::lang::XTypeProvider,
50 public css::graphic::XGraphicRenderer
59 virtual css::uno::Any SAL_CALL
queryAggregation(
const css::uno::Type & rType )
override;
60 virtual css::uno::Any SAL_CALL
queryInterface(
const css::uno::Type & rType )
override;
61 virtual void SAL_CALL
acquire()
noexcept override;
62 virtual void SAL_CALL
release()
noexcept override;
70 virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes( )
override;
71 virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId( )
override;
78 virtual void SAL_CALL render(
const css::uno::Reference< css::graphic::XGraphic >&
Graphic )
override;
82 css::uno::Reference< css::awt::XDevice > mxDevice;
86 css::uno::Any maRenderData;
89GraphicRendererVCL::GraphicRendererVCL() :
100 aAny <<= uno::Reference< lang::XServiceInfo >(
this);
102 aAny <<= uno::Reference< lang::XTypeProvider >(
this);
104 aAny <<= uno::Reference< beans::XPropertySet >(
this);
106 aAny <<= uno::Reference< beans::XPropertyState >(
this);
108 aAny <<= uno::Reference< beans::XMultiPropertySet >(
this);
110 aAny <<= uno::Reference< graphic::XGraphicRenderer >(
this);
112 aAny = OWeakAggObject::queryAggregation( rType );
120 return OWeakAggObject::queryInterface( rType );
124void SAL_CALL GraphicRendererVCL::acquire()
127 OWeakAggObject::acquire();
131void SAL_CALL GraphicRendererVCL::release()
134 OWeakAggObject::release();
138OUString SAL_CALL GraphicRendererVCL::getImplementationName()
140 return "com.sun.star.comp.graphic.GraphicRendererVCL";
149uno::Sequence< OUString > SAL_CALL GraphicRendererVCL::getSupportedServiceNames()
151 return {
"com.sun.star.graphic.GraphicRendererVCL" };
155uno::Sequence< uno::Type > SAL_CALL GraphicRendererVCL::getTypes()
157 static const uno::Sequence< uno::Type >
aTypes {
168uno::Sequence< sal_Int8 > SAL_CALL GraphicRendererVCL::getImplementationId()
170 return css::uno::Sequence<sal_Int8>();
176 static ::comphelper::PropertyMapEntry
const aEntries[] =
193 switch( (*ppEntries)->mnHandle )
197 uno::Reference< awt::XDevice > xDevice;
199 if( ( *
pValues >>= xDevice ) && xDevice.is() )
214 awt::Rectangle aAWTRect;
219 Size( aAWTRect.Width, aAWTRect.Height ) );
243 switch( (*ppEntries)->mnHandle )
254 const awt::Rectangle aAWTRect( maDestRect.Left(), maDestRect.Top(),
255 maDestRect.GetWidth(), maDestRect.GetHeight() );
273void SAL_CALL GraphicRendererVCL::render(
const uno::Reference< graphic::XGraphic >& rxGraphic )
275 if( mpOutDev && mxDevice.is() && rxGraphic.is() )
281 aGraphicObject.
Draw(*mpOutDev, maDestRect.TopLeft(), maDestRect.GetSize());
288extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface *
290 css::uno::XComponentContext *,
291 css::uno::Sequence<css::uno::Any>
const &)
293 return cppu::acquire(
new GraphicRendererVCL);
const PropertyValue * pValues
bool Draw(OutputDevice &rOut, const Point &rPt, const Size &rSz, const GraphicAttr *pAttr=nullptr) const
static OutputDevice * GetOutputDevice(const css::uno::Reference< css::awt::XDevice > &rxDevice)
virtual void _getPropertyValues(const comphelper::PropertyMapEntry **ppEntries, css::uno::Any *pValue)=0
virtual void _setPropertyValues(const comphelper::PropertyMapEntry **ppEntries, const css::uno::Any *pValues)=0
virtual css::uno::Any SAL_CALL queryAggregation(const css::uno::Type &rType) SAL_OVERRIDE
virtual css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType) SAL_OVERRIDE
virtual void SAL_CALL acquire() SAL_NOEXCEPT SAL_OVERRIDE
virtual void SAL_CALL release() SAL_NOEXCEPT SAL_OVERRIDE
css::uno::Type const & get()
ScXMLEditAttributeMap::Entry const aEntries[]
css::uno::Sequence< OUString > getSupportedServiceNames()
OUString getImplementationName()
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
#define UNOGRAPHIC_RENDERDATA
#define UNOGRAPHIC_DEVICE
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * com_sun_star_comp_graphic_GraphicRendererVCL_get_implementation(css::uno::XComponentContext *, css::uno::Sequence< css::uno::Any > const &)
#define UNOGRAPHIC_DESTINATIONRECT