39#include <com/sun/star/awt/DeviceCapability.hpp>
40#include <com/sun/star/awt/XWindow.hpp>
41#include <com/sun/star/rendering/CanvasFactory.hpp>
42#include <com/sun/star/rendering/XSpriteCanvas.hpp>
44#ifdef DISABLE_DYNLOADING
50#ifdef DISABLE_DYNLOADING
59 meOutDevType(eOutDevType),
164 SAL_WARN(
"vcl.gdi",
"OutputDevice::~OutputDevice(): OutputDevice::Push() calls != OutputDevice::Pop() calls" );
195 SAL_WARN(
"vcl.gdi",
"No mpGraphics set");
205 SAL_WARN(
"vcl.gdi",
"No mpGraphics set");
241#if ENABLE_CAIRO_CANVAS
265 return mpGraphics->CreateSurface(*
this, x, y, width, height);
273 return mpGraphics->CreateBitmapSurface(*
this, rData, rSize);
279 return css::uno::Any();
281 return mpGraphics->GetNativeSurfaceHandle(rSurface, rSize);
289 css::uno::Sequence< sal_Int8 >
aSeq(
reinterpret_cast<sal_Int8 const *
>(&aSysData),
292 return css::uno::Any(
aSeq);
395 return pWrapper ? pWrapper->
CreateGraphics(
this ) : css::uno::Reference< css::awt::XGraphics >();
418 const Point& rSrcPt,
const Size& rSrcSize )
453 if (nSrcWidth && nSrcHeight && nDestWidth && nDestHeight)
456 nSrcWidth, nSrcHeight,
458 nDestWidth, nDestHeight);
471 const Point& rSrcPt,
const Size& rSrcSize,
535 const Point& rSrcPt,
const Size& rSrcSize,
536 bool bWindowInvalidate )
559 if (nSrcWidth && nSrcHeight)
562 nSrcWidth, nSrcHeight,
564 nSrcWidth, nSrcHeight);
595 if (!pCheckedSrc->mpGraphics && !pCheckedSrc->AcquireGraphics())
597 pSrcGraphics = pCheckedSrc->mpGraphics;
600 pSrcGraphics =
nullptr;
622 return this == &rSrcDev ? nullptr : &rSrcDev;
699 rRegion = aMirroredRegion;
718 css::awt::DeviceInfo aInfo;
720 aInfo.Width = rDevSz.
Width();
721 aInfo.Height = rDevSz.
Height();
724 aInfo.PixelPerMeterX = aTmpSz.
Width();
725 aInfo.PixelPerMeterY = aTmpSz.
Height();
728 aInfo.Capabilities = css::awt::DeviceCapability::RASTEROPERATIONS |
729 css::awt::DeviceCapability::GETBITS;
740 aInfo.RightInset = 0;
741 aInfo.BottomInset = 0;
749 Reference< css::rendering::XCanvas > xCanvas(
mxCanvas );
760 Reference< css::rendering::XCanvas > xCanvas(
mxCanvas );
761 Reference< css::rendering::XSpriteCanvas > xSpriteCanvas( xCanvas, UNO_QUERY );
762 if( xSpriteCanvas.is() )
763 return xSpriteCanvas;
766 return Reference< css::rendering::XSpriteCanvas >( xCanvas, UNO_QUERY );
779 Sequence< Any > aArg{
780 Any(
reinterpret_cast<sal_Int64
>(
this)),
783 Any(Reference< css::awt::XWindow >()),
790 css::rendering::CanvasFactory::create( xContext ) );
791 Reference<css::lang::XMultiComponentFactory> xCanvasFactory(xStaticCanvasFactory.
get());
792 Reference< css::rendering::XCanvas > xCanvas;
794 if(xCanvasFactory.is())
796 xCanvas.set( xCanvasFactory->createInstanceWithArgumentsAndContext(
798 OUString(
"com.sun.star.rendering.SpriteCanvas" ) :
799 OUString(
"com.sun.star.rendering.Canvas" ),
811 css::uno::Reference< css::rendering::XCanvas > xCanvas(
mxCanvas );
814 css::uno::Reference< css::lang::XComponent > xCanvasComponent( xCanvas, css::uno::UNO_QUERY );
815 if( xCanvasComponent.is() )
816 xCanvasComponent->dispose();
static bool GetLayoutRTL()
Base class used mainly for the LibreOffice Desktop class.
Some things multiple-inherit from VclAbstractDialog and OutputDevice, so we need to use virtual inher...
tools::Long mnEmphasisAscent
virtual css::awt::DeviceInfo GetDeviceInfo() const
std::vector< VCLXGraphics * > * GetUnoGraphicsList() const
virtual void InitClipRegion()
SalGraphics const * GetGraphics() const
Get the graphic context that the output device uses to draw on.
OutputDevice(const OutputDevice &)=delete
virtual void SetSettings(const AllSettings &rSettings)
SAL_DLLPRIVATE tools::Long ImplLogicYToDevicePixel(tools::Long nY) const
Convert a logical Y coordinate to a device pixel's Y coordinate.
tools::Rectangle GetOutputRectPixel() const
void DrawBitmapEx(const Point &rDestPt, const BitmapEx &rBitmapEx)
SAL_DLLPRIVATE bool ImplIsAntiparallel() const
void SetAntialiasing(AntialiasingFlags nMode)
tools::Long mnOutOffY
Output offset for device output in pixel (pseudo window offset within window system's frames)
void EnableOutput(bool bEnable=true)
css::awt::DeviceInfo GetCommonDeviceInfo(Size const &aDevSize) const
css::uno::Reference< css::rendering::XSpriteCanvas > GetSpriteCanvas() const
request XSpriteCanvas render interface
RasterOp GetRasterOp() const
std::shared_ptr< ImplFontCache > mxFontCache
virtual ~OutputDevice() override
virtual void dispose() override
css::uno::WeakReference< css::rendering::XCanvas > mxCanvas
virtual bool AcquireGraphics() const =0
Acquire a graphics device that the output device uses to draw on.
tools::Long mnOutOffX
Output offset for device output in pixel (pseudo window offset within window system's frames)
tools::Long mnOutOffLogicX
Additional output offset in logical coordinates, applied in PixelToLogic (used by SetPixelOffset/GetP...
Size GetOutputSizePixel() const
std::unique_ptr< ImplOutDevData > mpOutDevData
SAL_DLLPRIVATE bool ImplIsRecordLayout() const
std::shared_ptr< vcl::font::PhysicalFontCollection > mxFontCollection
void DrawRect(const tools::Rectangle &rRect)
OutDevViewType meOutDevViewType
bool SupportsCairo() const
virtual void DrawOutDevDirectProcess(const OutputDevice &rSrcDev, SalTwoRect &rPosAry, SalGraphics *pSrcGraphics)
SystemGraphicsData GetSystemGfxData() const
SAL_DLLPRIVATE tools::Long ImplLogicHeightToDevicePixel(tools::Long nHeight) const
Convert a logical height to a height in units of device pixels.
css::uno::Reference< css::awt::XGraphics > CreateUnoGraphics()
vcl::text::ComplexTextLayoutFlags mnTextLayoutMode
void SetConnectMetaFile(GDIMetaFile *pMtf)
virtual void DrawOutDev(const Point &rDestPt, const Size &rDestSize, const Point &rSrcPt, const Size &rSrcSize)
SAL_DLLPRIVATE tools::Long ImplLogicWidthToDevicePixel(tools::Long nWidth) const
Convert a logical width to a width in units of device pixels.
virtual sal_uInt16 GetBitCount() const
tools::Long mnEmphasisDescent
SalGraphics * mpGraphics
Graphics context to draw on.
VclPtr< OutputDevice > mpNextGraphics
Next output device in list.
cairo::SurfaceSharedPtr CreateBitmapSurface(const BitmapSystemData &rData, const Size &rSize) const
Create Surface for given bitmap data.
void SetOutOffYPixel(tools::Long nOutOffY)
virtual css::uno::Reference< css::rendering::XCanvas > ImplGetCanvas(bool bSpriteCanvas) const
rtl::Reference< LogicalFontInstance > mpFontInstance
SAL_DLLPRIVATE void drawOutDevDirect(const OutputDevice &rSrcDev, SalTwoRect &rPosAry)
LanguageType meTextLanguage
bool IsRTLEnabled() const
SAL_DLLPRIVATE void ImplDisposeCanvas()
std::vector< vcl::State > maOutDevStateStack
bool SupportsOperation(OutDevSupportType) const
Query an OutputDevice to see whether it supports a specific operation.
css::uno::Any GetSystemGfxDataAny() const
SAL_WARN_UNUSED_RESULT Point LogicToPixel(const Point &rLogicPt) const
AntialiasingFlags mnAntialiasing
SAL_DLLPRIVATE void ImplInvalidateViewTransform()
Invalidate the view transformation.
void SetRasterOp(RasterOp eRasterOp)
SAL_DLLPRIVATE void ReMirror(Point &rPoint) const
virtual bool HasMirroredGraphics() const
cairo::SurfaceSharedPtr CreateSurface(const cairo::CairoSurfaceSharedPtr &rSurface) const
Create Surface from given cairo surface.
virtual Bitmap GetBitmap(const Point &rSrcPt, const Size &rSize) const
void SetOutOffXPixel(tools::Long nOutOffX)
bool IsDeviceOutputNecessary() const
virtual void CopyArea(const Point &rDestPt, const Point &rSrcPt, const Size &rSrcSize, bool bWindowInvalidate=false)
tools::Long mnOutOffOrigX
Additional output pixel offset, applied in LogicToPixel (used by SetPixelOffset/GetPixelOffset)
VclPtr< VirtualDevice > mpAlphaVDev
sal_Int32 mnDPIScalePercentage
For HiDPI displays, we want to draw elements for a percentage larger.
tools::Long mnOutOffOrigY
Additional output pixel offset, applied in LogicToPixel (used by SetPixelOffset/GetPixelOffset)
std::unique_ptr< vcl::font::PhysicalFontFaceCollection > mpFontFaceCollection
void SetDrawMode(DrawModeFlags nDrawMode)
css::uno::Any GetNativeSurfaceHandle(cairo::SurfaceSharedPtr &rSurface, const basegfx::B2ISize &rSize) const
Return native handle for underlying surface.
std::vector< VCLXGraphics * > * CreateUnoGraphicsList()
tools::Long mnTextOffX
font specific text alignment offsets in pixel units
std::optional< AllSettings > moSettings
css::uno::Reference< css::rendering::XCanvas > GetCanvas() const
request XCanvas render interface
tools::Long mnOutOffLogicY
Additional output offset in logical coordinates, applied in PixelToLogic (used by SetPixelOffset/GetP...
std::vector< VCLXGraphics * > * mpUnoGraphicsList
virtual const OutputDevice * DrawOutDevDirectCheck(const OutputDevice &rSrcDev) const
virtual void EnableRTL(bool bEnable=true)
vcl::ExtOutDevData * mpExtOutDevData
virtual tools::Rectangle GetBackgroundComponentBounds() const
SAL_DLLPRIVATE tools::Long ImplLogicXToDevicePixel(tools::Long nX) const
Convert a logical X coordinate to a device pixel's X coordinate.
OUString GetRenderBackendName() const
VclPtr< OutputDevice > mpPrevGraphics
Previous output device in list.
virtual void CopyDeviceArea(SalTwoRect &aPosAry, bool bWindowInvalidate)
BitmapEx GetBitmapEx(const Point &rSrcPt, const Size &rSize) const
Query extended bitmap (with alpha channel, if available).
virtual bool IsVirtual() const
constexpr tools::Long Y() const
void setX(tools::Long nX)
void setY(tools::Long nY)
constexpr tools::Long X() const
void mirror(tools::Long &nX, const OutputDevice &rOutDev) const
virtual void SetXORMode(bool bSet, bool bInvertOnly)=0
virtual SystemGraphicsData GetGraphicsData() const =0
SalLayoutFlags GetLayout() const
void setAntiAlias(bool bNew)
virtual bool supportsOperation(OutDevSupportType) const =0
void CopyBits(const SalTwoRect &rPosAry, const OutputDevice &rOutDev)
virtual OUString getRenderBackendName() const
virtual sal_uInt16 GetBitCount() const =0
constexpr tools::Long Height() const
constexpr tools::Long Width() const
virtual void ReleaseAllGraphics(OutputDevice *pOutDev)=0
static UnoWrapperBase * GetUnoWrapper(bool bCreateIfNotExists=true)
Get the application's UNO wrapper object.
virtual css::uno::Reference< css::awt::XGraphics > CreateGraphics(OutputDevice *pOutDev)=0
virtual void EnableRTL(bool bEnable=true) override
SAL_DLLPRIVATE void ImplFillOpaqueRectangle(const tools::Rectangle &rRect)
Used for alpha VDev, to set areas to opaque.
Similar to DeleteOnDeinit, the DeleteUnoReferenceOnDeinit template class makes sure that a static UNO...
css::uno::Reference< I > get()
void Union(const tools::Rectangle &rRegion)
void GetRegionRectangles(RectangleVector &rTarget) const
constexpr ::Color COL_WHITE(0xFF, 0xFF, 0xFF)
constexpr ::Color COL_BLACK(0x00, 0x00, 0x00)
constexpr ::Color COL_TRANSPARENT(ColorTransparency, 0xFF, 0xFF, 0xFF, 0xFF)
#define DBG_TESTSOLARMUTEX()
Sequence< sal_Int8 > aSeq
#define SAL_WARN(area, stream)
std::shared_ptr< Surface > SurfaceSharedPtr
std::shared_ptr< cairo_surface_t > CairoSurfaceSharedPtr
Reference< XComponentContext > getProcessComponentContext()
uno::Sequence< double > maFillColor
BmpMirrorFlags AdjustTwoRect(SalTwoRect &rTwoRect, const Size &rSizePix)
std::vector< tools::Rectangle > RectangleVector
tools::Long mnMapScDenomX
Scaling factor - denominator in X direction.
tools::Long mnMapScDenomY
Scaling factor - denominator in Y direction.
tools::Long mnMapScNumY
Scaling factor - numerator in Y direction.
tools::Long mnMapOfsY
Offset in Y direction.
tools::Long mnMapScNumX
Scaling factor - numerator in X direction.
tools::Long mnMapOfsX
Offset in X direction.