diff options
author | Michael Meeks <michael.meeks@suse.com> | 2011-10-07 12:41:35 +0100 |
---|---|---|
committer | Michael Meeks <michael.meeks@suse.com> | 2011-10-25 13:41:53 +0100 |
commit | 8d068d15b2dae039600aaa7bac7299055ce7aea8 (patch) | |
tree | b2616f0fcf210109f42e79941118542421fa53e5 /vcl/inc/generic | |
parent | 1a779145378b40eb717f5cf9e850cf7794490268 (diff) |
generic: share the PspGraphics code between gtk/unx and svp
Diffstat (limited to 'vcl/inc/generic')
-rw-r--r-- | vcl/inc/generic/geninst.h | 8 | ||||
-rw-r--r-- | vcl/inc/generic/genprn.h | 9 | ||||
-rw-r--r-- | vcl/inc/generic/genpspgraphics.h (renamed from vcl/inc/generic/pspgraphics.h) | 43 |
3 files changed, 34 insertions, 26 deletions
diff --git a/vcl/inc/generic/geninst.h b/vcl/inc/generic/geninst.h index 4fd8866d2b3a..621ff175f6fb 100644 --- a/vcl/inc/generic/geninst.h +++ b/vcl/inc/generic/geninst.h @@ -34,6 +34,7 @@ #include <vcl/solarmutex.hxx> #include <salinst.hxx> #include <saldatabasic.hxx> +#include <generic/genprn.h> class VCL_DLLPUBLIC SalYieldMutexReleaser { @@ -73,6 +74,7 @@ public: /* * Abstract generic class to build vclplugin's instance classes from */ +class GenPspGraphics; class ImplDevFontList; class VCL_DLLPUBLIC SalGenericInstance : public SalInstance { @@ -106,12 +108,18 @@ public: virtual void jobStartedPrinterUpdate(); virtual void jobEndedPrinterUpdate(); bool isPrinterInit() const { return mbPrinterInit; } + virtual GenPspGraphics *CreatePrintGraphics() = 0; // prolly belongs somewhere else ... just a font help static void RegisterFontSubstitutors( ImplDevFontList* pList ); static int FetchFontSubstitutionFlags(); }; +inline SalGenericInstance *GetGenericInstance() +{ + return static_cast<SalGenericInstance *>(GetSalData()->m_pInstance); +} + #endif // _SV_GENERIC_INST_H /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/inc/generic/genprn.h b/vcl/inc/generic/genprn.h index c3684ca4b9ab..4b8661e4e30c 100644 --- a/vcl/inc/generic/genprn.h +++ b/vcl/inc/generic/genprn.h @@ -35,12 +35,11 @@ #include "salprn.hxx" #include "vclpluginapi.h" -class PspGraphics; - +class GenPspGraphics; class VCL_DLLPUBLIC PspSalInfoPrinter : public SalInfoPrinter { public: - PspGraphics* m_pGraphics; + GenPspGraphics* m_pGraphics; psp::JobData m_aJobData; psp::PrinterGfx m_aPrinterGfx; @@ -74,7 +73,7 @@ public: bool m_bPdf:1; bool m_bSwallowFaxNo:1; bool m_bIsPDFWriterJob:1; - PspGraphics* m_pGraphics; + GenPspGraphics* m_pGraphics; psp::PrinterJob m_aPrintJob; psp::JobData m_aJobData; psp::PrinterGfx m_aPrinterGfx; @@ -82,7 +81,7 @@ public: bool m_bCollate; SalInfoPrinter* m_pInfoPrinter; - PspSalPrinter( SalInfoPrinter* ); + PspSalPrinter( SalInfoPrinter *pPrinter ); virtual ~PspSalPrinter(); // overload all pure virtual methods diff --git a/vcl/inc/generic/pspgraphics.h b/vcl/inc/generic/genpspgraphics.h index fd0a54d6ff1f..026113a1dc70 100644 --- a/vcl/inc/generic/pspgraphics.h +++ b/vcl/inc/generic/genpspgraphics.h @@ -26,8 +26,8 @@ * ************************************************************************/ -#ifndef _VCL_PSPGRAPHICS_H -#define _VCL_PSPGRAPHICS_H +#ifndef _VCL_GENPSPGRAPHICS_H +#define _VCL_GENPSPGRAPHICS_H #include "vcl/fontmanager.hxx" @@ -43,8 +43,9 @@ class ServerFont; class ImplDevFontAttributes; class SalInfoPrinter; -class VCL_DLLPUBLIC PspGraphics : public SalGraphics +class VCL_DLLPUBLIC GenPspGraphics : public SalGraphics { + protected: psp::JobData* m_pJobData; psp::PrinterGfx* m_pPrinterGfx; String* m_pPhoneNr; @@ -56,20 +57,20 @@ class VCL_DLLPUBLIC PspGraphics : public SalGraphics bool m_bFontVertical; SalInfoPrinter* m_pInfoPrinter; public: - PspGraphics( psp::JobData* pJob, psp::PrinterGfx* pGfx, String* pPhone, bool bSwallow, SalInfoPrinter* pInfoPrinter ) - : m_pJobData( pJob ), - m_pPrinterGfx( pGfx ), - m_pPhoneNr( pPhone ), - m_bSwallowFaxNo( bSwallow ), - m_bPhoneCollectionActive( false ), - m_bFontVertical( false ), - m_pInfoPrinter( pInfoPrinter ) - { for( int i = 0; i < MAX_FALLBACK; i++ ) m_pServerFont[i] = 0; } - virtual ~PspGraphics(); + GenPspGraphics(); + virtual ~GenPspGraphics(); + + void Init( psp::JobData* pJob, psp::PrinterGfx* pGfx, + String* pPhone, bool bSwallow, + SalInfoPrinter* pInfoPrinter ); + + // helper methods + static const void * DoGetEmbedFontData ( psp::fontID aFont, const sal_Ucs* pUnicodes, + sal_Int32* pWidths, FontSubsetInfo& rInfo, + long* pDataLen ); + static void DoFreeEmbedFontData( const void* pData, long nLen ); // helper methods for sharing with X11SalGraphics - static const void* DoGetEmbedFontData( psp::fontID aFont, const sal_Ucs* pUnicodes, sal_Int32* pWidths, FontSubsetInfo& rInfo, long* pDataLen ); - static void DoFreeEmbedFontData( const void* pData, long nLen ); static const Ucs2SIntMap* DoGetFontEncodingVector( psp::fontID aFont, const Ucs2OStrMap** pNonEncoded ); static void DoGetGlyphWidths( psp::fontID aFont, bool bVertical, @@ -114,11 +115,11 @@ public: FontSubsetInfo& rInfo ); virtual const Ucs2SIntMap* GetFontEncodingVector( const ImplFontData*, const Ucs2OStrMap** ppNonEncoded ); - virtual const void* GetEmbedFontData( const ImplFontData*, - const sal_Ucs* pUnicodes, - sal_Int32* pWidths, - FontSubsetInfo& rInfo, - long* pDataLen ); + virtual const void* GetEmbedFontData( const ImplFontData*, + const sal_Ucs* pUnicodes, + sal_Int32* pWidths, + FontSubsetInfo& rInfo, + long* pDataLen ); virtual void FreeEmbedFontData( const void* pData, long nDataLen ); virtual void GetGlyphWidths( const ImplFontData*, bool bVertical, @@ -187,6 +188,6 @@ public: virtual SystemFontData GetSysFontData( int nFallbacklevel ) const; }; -#endif // _VCL_PSPGRAPHICS_H +#endif // _VCL_GENPSPGRAPHICS_H /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |