tdf#156230: Use SvpGraphicsBackend in GenPspGraphics

We no longer draw to PostScript, so old backend is unneeded.

Change-Id: I069ce735b303721be7de6abf69aa26c1b25a9107
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155063
Tested-by: Jenkins
Reviewed-by: خالد حسني <khaled@libreoffice.org>
diff --git a/vcl/headless/svpprn.cxx b/vcl/headless/svpprn.cxx
index a6b448a..b745ba6 100644
--- a/vcl/headless/svpprn.cxx
+++ b/vcl/headless/svpprn.cxx
@@ -176,7 +176,6 @@ SalInfoPrinter* SvpSalInstance::CreateInfoPrinter( SalPrinterQueueInfo* pQueueIn
        PrinterInfoManager& rManager( PrinterInfoManager::get() );
        PrinterInfo aInfo( rManager.getPrinterInfo( pQueueInfo->maPrinterName ) );
        pPrinter->m_aJobData = aInfo;
        pPrinter->m_aPrinterGfx.Init( pPrinter->m_aJobData );

        if( pJobSetup->GetDriverData() )
            JobData::constructFromStreamBuffer( pJobSetup->GetDriverData(),
diff --git a/vcl/inc/salprn.hxx b/vcl/inc/salprn.hxx
index c6c7657..e7d0859 100644
--- a/vcl/inc/salprn.hxx
+++ b/vcl/inc/salprn.hxx
@@ -23,10 +23,12 @@
#include <i18nutil/paper.hxx>
#include <vcl/prntypes.hxx>
#include <vcl/dllapi.h>
#include <tools/gen.hxx>

#include "salptype.hxx"

#include <vector>
#include <optional>

class SalGraphics;
class SalFrame;
diff --git a/vcl/inc/unx/genprn.h b/vcl/inc/unx/genprn.h
index 67bf42b..5b022e8 100644
--- a/vcl/inc/unx/genprn.h
+++ b/vcl/inc/unx/genprn.h
@@ -21,7 +21,6 @@
#define INCLUDED_VCL_INC_GENERIC_GENPRN_H

#include <jobdata.hxx>
#include <unx/printergfx.hxx>
#include <salprn.hxx>

class GenPspGraphics;
@@ -30,7 +29,6 @@ class VCL_DLLPUBLIC PspSalInfoPrinter : public SalInfoPrinter
public:
    std::unique_ptr<GenPspGraphics> m_pGraphics;
    psp::JobData            m_aJobData;
    psp::PrinterGfx         m_aPrinterGfx;

    PspSalInfoPrinter();
    virtual ~PspSalInfoPrinter() override;
@@ -59,7 +57,6 @@ public:
    OUString                  m_aTmpFile;
    SalInfoPrinter*         m_pInfoPrinter;
    psp::JobData            m_aJobData;
    psp::PrinterGfx         m_aPrinterGfx;
    sal_uInt32              m_nCopies;
    bool                    m_bCollate;
    bool                    m_bPdf;
diff --git a/vcl/inc/unx/genpspgraphics.h b/vcl/inc/unx/genpspgraphics.h
index 1eba266..16cb2bd 100644
--- a/vcl/inc/unx/genpspgraphics.h
+++ b/vcl/inc/unx/genpspgraphics.h
@@ -28,9 +28,9 @@
#include <salgdi.hxx>
#include <sallayout.hxx>

#include <unx/GenPspGfxBackend.hxx>
#include <unx/cairotextrender.hxx>

#include <headless/SvpGraphicsBackend.hxx>
#include <headless/CairoCommon.hxx>

namespace vcl::font
@@ -39,7 +39,7 @@ class PhysicalFontFace;
class PhysicalFontCollection;
}

namespace psp { struct JobData; class PrinterGfx; }
namespace psp { struct JobData; }

class FreetypeFontInstance;
class FontAttributes;
@@ -48,18 +48,18 @@ class FontMetricData;

class VCL_DLLPUBLIC GenPspGraphics final : public SalGraphicsAutoDelegateToImpl
{
    std::unique_ptr<GenPspGfxBackend> m_pBackend;

    psp::JobData*           m_pJobData;

    CairoCommon             m_aCairoCommon;
    CairoTextRender         m_aTextRenderImpl;
    std::unique_ptr<SvpGraphicsBackend> m_pBackend;

public:
                            GenPspGraphics();
    virtual                ~GenPspGraphics() override;

    void                    Init( psp::JobData* pJob, psp::PrinterGfx* pGfx );
    void                    Init(psp::JobData* pJob);

    // helper methods
    static FontAttributes   Info2FontAttributes(const psp::FastPrintFontInfo&);
diff --git a/vcl/unx/generic/app/sm.cxx b/vcl/unx/generic/app/sm.cxx
index b6a4c4a..3ad2c85 100644
--- a/vcl/unx/generic/app/sm.cxx
+++ b/vcl/unx/generic/app/sm.cxx
@@ -32,6 +32,7 @@

#include <rtl/process.h>
#include <osl/security.h>
#include <osl/diagnose.h>

#include <X11/Xlib.h>
#include <X11/Xatom.h>
diff --git a/vcl/unx/generic/print/genprnpsp.cxx b/vcl/unx/generic/print/genprnpsp.cxx
index 560f0f4..0154938 100644
--- a/vcl/unx/generic/print/genprnpsp.cxx
+++ b/vcl/unx/generic/print/genprnpsp.cxx
@@ -43,6 +43,7 @@
#include <rtl/ustrbuf.hxx>
#include <rtl/ustring.hxx>
#include <sal/log.hxx>
#include <osl/file.hxx>

#include <utility>
#include <vcl/gdimtf.hxx>
@@ -270,7 +271,6 @@ void SalGenericInstance::configurePspInfoPrinter(PspSalInfoPrinter *pPrinter,
    PrinterInfoManager& rManager( PrinterInfoManager::get() );
    PrinterInfo aInfo( rManager.getPrinterInfo( pQueueInfo->maPrinterName ) );
    pPrinter->m_aJobData = aInfo;
    pPrinter->m_aPrinterGfx.Init( pPrinter->m_aJobData );

    if( pJobSetup->GetDriverData() )
        JobData::constructFromStreamBuffer( pJobSetup->GetDriverData(),
@@ -396,7 +396,7 @@ SalGraphics* PspSalInfoPrinter::AcquireGraphics()
    if( ! m_pGraphics )
    {
        m_pGraphics = GetGenericInstance()->CreatePrintGraphics();
        m_pGraphics->Init(&m_aJobData, &m_aPrinterGfx);
        m_pGraphics->Init(&m_aJobData);
        pRet = m_pGraphics.get();
    }
    return pRet;
diff --git a/vcl/unx/generic/print/genpspgraphics.cxx b/vcl/unx/generic/print/genpspgraphics.cxx
index fc19e01..a8f2536 100644
--- a/vcl/unx/generic/print/genpspgraphics.cxx
+++ b/vcl/unx/generic/print/genpspgraphics.cxx
@@ -41,7 +41,6 @@
#include <unx/freetype_glyphcache.hxx>
#include <unx/geninst.h>
#include <unx/genpspgraphics.h>
#include <unx/printergfx.hxx>
#include <langboost.hxx>
#include <font/LogicalFontInstance.hxx>
#include <fontattributes.hxx>
@@ -61,12 +60,12 @@ using namespace psp;
GenPspGraphics::GenPspGraphics()
    : m_pJobData( nullptr )
    , m_aTextRenderImpl(m_aCairoCommon)
    , m_pBackend(new SvpGraphicsBackend(m_aCairoCommon))
{
}

void GenPspGraphics::Init(psp::JobData* pJob, psp::PrinterGfx* pGfx)
void GenPspGraphics::Init(psp::JobData* pJob)
{
    m_pBackend = std::make_unique<GenPspGfxBackend>(pGfx);
    m_pJobData = pJob;
    SetLayout( SalLayoutFlags::NONE );
}
diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx
index a864141..df7b8fc 100644
--- a/vcl/unx/gtk3/gtkinst.cxx
+++ b/vcl/unx/gtk3/gtkinst.cxx
@@ -17,6 +17,7 @@

#include <dndhelper.hxx>
#include <osl/process.h>
#include <osl/file.hxx>
#include <unx/gtk/gtkdata.hxx>
#include <unx/gtk/gtkinst.hxx>
#include <unx/genprn.h>