summaryrefslogtreecommitdiff
path: root/vcl/inc
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@suse.com>2011-09-29 12:11:28 +0100
committerMichael Meeks <michael.meeks@suse.com>2011-10-25 13:41:47 +0100
commit08fb22932015cc0d57fa1dbe422e4109cf8be071 (patch)
tree34f3d8a6e15eb83000137a3ef63607b461fd5e28 /vcl/inc
parenta77fff188b96169f74224ab118c75f4c9f14fa36 (diff)
generic: re-structure generic code to increase re-use between backends
move more chunks of unx/generic into generic/ and into libvcl itself. This allows the headless backend to remove it's X linkage finally.
Diffstat (limited to 'vcl/inc')
-rw-r--r--vcl/inc/generic/geninst.h72
-rw-r--r--vcl/inc/generic/genprn.h (renamed from vcl/inc/unx/salprn.h)12
-rw-r--r--vcl/inc/generic/glyphcache.hxx (renamed from vcl/inc/unx/glyphcache.hxx)12
-rw-r--r--vcl/inc/generic/printergfx.hxx (renamed from vcl/inc/printergfx.hxx)4
-rw-r--r--vcl/inc/generic/printerjob.hxx (renamed from vcl/inc/printerjob.hxx)0
-rw-r--r--vcl/inc/generic/pspgraphics.h (renamed from vcl/inc/unx/pspgraphics.h)3
-rw-r--r--vcl/inc/salinst.hxx3
-rw-r--r--vcl/inc/unx/headless/svpinst.hxx6
-rw-r--r--vcl/inc/unx/headless/svpprn.hxx7
-rw-r--r--vcl/inc/unx/salinst.h38
10 files changed, 102 insertions, 55 deletions
diff --git a/vcl/inc/generic/geninst.h b/vcl/inc/generic/geninst.h
new file mode 100644
index 000000000000..61382f02912d
--- /dev/null
+++ b/vcl/inc/generic/geninst.h
@@ -0,0 +1,72 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License or as specified alternatively below. You may obtain a copy of
+ * the License at http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * Major Contributor(s):
+ * Copyright (C) 2011 SUSE, Inc.
+ *
+ * All Rights Reserved.
+ *
+ * For minor contributions see the git repository.
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+
+#ifndef _SV_GENERIC_INST_H
+#define _SV_GENERIC_INST_H
+
+#include <vcl/sv.h>
+#include <osl/thread.hxx>
+#include <vclpluginapi.h>
+#include <salinst.hxx>
+
+/*
+ * Abstract generic class to build vclplugin's instance classes from
+ */
+class ImplDevFontList;
+class VCL_DLLPUBLIC GenericInstance : public SalInstance
+{
+protected:
+ bool mbPrinterInit;
+
+public:
+ GenericInstance() : mbPrinterInit( false ) {}
+ virtual ~GenericInstance() {}
+
+ virtual SalInfoPrinter* CreateInfoPrinter ( SalPrinterQueueInfo* pQueueInfo,
+ ImplJobSetup* pSetupData );
+ virtual void DestroyInfoPrinter ( SalInfoPrinter* pPrinter );
+ virtual SalPrinter* CreatePrinter ( SalInfoPrinter* pInfoPrinter );
+ virtual void DestroyPrinter ( SalPrinter* pPrinter );
+
+ virtual void GetPrinterQueueInfo ( ImplPrnQueueList* pList );
+ virtual void GetPrinterQueueState ( SalPrinterQueueInfo* pInfo );
+ virtual void DeletePrinterQueueInfo ( SalPrinterQueueInfo* pInfo );
+ virtual String GetDefaultPrinter();
+ virtual void PostPrintersChanged() = 0;
+
+ virtual void updatePrinterUpdate();
+ virtual void jobStartedPrinterUpdate();
+ virtual void jobEndedPrinterUpdate();
+
+ bool isPrinterInit() const { return mbPrinterInit; }
+ static void RegisterFontSubstitutors( ImplDevFontList* pList );
+};
+
+#endif // _SV_GENERIC_INST_H
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/unx/salprn.h b/vcl/inc/generic/genprn.h
index e51a4b6d50f5..c3684ca4b9ab 100644
--- a/vcl/inc/unx/salprn.h
+++ b/vcl/inc/generic/genprn.h
@@ -26,18 +26,18 @@
*
************************************************************************/
-#ifndef _SV_SALPRN_H
-#define _SV_SALPRN_H
+#ifndef _SV_GENERIC_PRN_H
+#define _SV_GENERIC_PRN_H
#include "vcl/jobdata.hxx"
-#include "printergfx.hxx"
-#include "printerjob.hxx"
+#include "generic/printergfx.hxx"
+#include "generic/printerjob.hxx"
#include "salprn.hxx"
#include "vclpluginapi.h"
class PspGraphics;
-class VCLPLUG_GEN_PUBLIC PspSalInfoPrinter : public SalInfoPrinter
+class VCL_DLLPUBLIC PspSalInfoPrinter : public SalInfoPrinter
{
public:
PspGraphics* m_pGraphics;
@@ -64,7 +64,7 @@ public:
virtual int GetLandscapeAngle( const ImplJobSetup* pSetupData );
};
-class VCLPLUG_GEN_PUBLIC PspSalPrinter : public SalPrinter
+class VCL_DLLPUBLIC PspSalPrinter : public SalPrinter
{
public:
String m_aFileName;
diff --git a/vcl/inc/unx/glyphcache.hxx b/vcl/inc/generic/glyphcache.hxx
index e46fba2de3f5..f08cb2b2c049 100644
--- a/vcl/inc/unx/glyphcache.hxx
+++ b/vcl/inc/generic/glyphcache.hxx
@@ -72,7 +72,7 @@ namespace vcl
// =======================================================================
-class VCL_PLUGIN_PUBLIC GlyphCache
+class VCL_DLLPUBLIC GlyphCache
{
public:
explicit GlyphCache( GlyphCachePeer& );
@@ -185,7 +185,7 @@ private:
class FtFontInfo;
-class VCL_PLUGIN_PUBLIC ServerFont
+class VCL_DLLPUBLIC ServerFont
{
public:
ServerFont( const ImplFontSelectData&, FtFontInfo* );
@@ -301,7 +301,7 @@ private:
// =======================================================================
// a class for cache entries for physical font instances that are based on serverfonts
-class VCL_PLUGIN_PUBLIC ImplServerFontEntry : public ImplFontEntry
+class VCL_DLLPUBLIC ImplServerFontEntry : public ImplFontEntry
{
private:
ServerFont* mpServerFont;
@@ -317,7 +317,7 @@ public:
// =======================================================================
-class VCL_PLUGIN_PUBLIC ServerFontLayout : public GenericSalLayout
+class VCL_DLLPUBLIC ServerFontLayout : public GenericSalLayout
{
private:
ServerFont& mrServerFont;
@@ -362,7 +362,7 @@ protected:
// =======================================================================
-class VCL_PLUGIN_PUBLIC RawBitmap
+class VCL_DLLPUBLIC RawBitmap
{
public:
RawBitmap();
@@ -395,7 +395,7 @@ inline void ServerFont::SetExtended( int nInfo, void* pVoid )
// ExtraKernInfo allows an on-demand query of extra kerning info #i29881#
// The kerning values have to be scaled to match the font size before use
-class VCL_PLUGIN_PUBLIC ExtraKernInfo
+class VCL_DLLPUBLIC ExtraKernInfo
{
public:
ExtraKernInfo( sal_IntPtr nFontId );
diff --git a/vcl/inc/printergfx.hxx b/vcl/inc/generic/printergfx.hxx
index 840054a315de..a8d259a25384 100644
--- a/vcl/inc/printergfx.hxx
+++ b/vcl/inc/generic/printergfx.hxx
@@ -140,7 +140,7 @@ struct CharacterMetric;
* vcl/unx/source/gdi/salgdi2.cxx
*/
-class VCLPLUG_GEN_PUBLIC PrinterBmp
+class VCL_DLLPUBLIC PrinterBmp
{
public:
@@ -183,7 +183,7 @@ struct GraphicsStatus
class Font3;
-class VCLPLUG_GEN_PUBLIC PrinterGfx
+class VCL_DLLPUBLIC PrinterGfx
{
private:
diff --git a/vcl/inc/printerjob.hxx b/vcl/inc/generic/printerjob.hxx
index 62a1c078bc32..62a1c078bc32 100644
--- a/vcl/inc/printerjob.hxx
+++ b/vcl/inc/generic/printerjob.hxx
diff --git a/vcl/inc/unx/pspgraphics.h b/vcl/inc/generic/pspgraphics.h
index 1715ce38eb2c..fd0a54d6ff1f 100644
--- a/vcl/inc/unx/pspgraphics.h
+++ b/vcl/inc/generic/pspgraphics.h
@@ -43,7 +43,7 @@ class ServerFont;
class ImplDevFontAttributes;
class SalInfoPrinter;
-class VCLPLUG_GEN_PUBLIC PspGraphics : public SalGraphics
+class VCL_DLLPUBLIC PspGraphics : public SalGraphics
{
psp::JobData* m_pJobData;
psp::PrinterGfx* m_pPrinterGfx;
@@ -104,6 +104,7 @@ public:
virtual void GetDevFontList( ImplDevFontList* );
virtual void GetDevFontSubstList( OutputDevice* );
virtual bool AddTempDevFont( ImplDevFontList*, const String& rFileURL, const String& rFontName );
+
virtual sal_Bool CreateFontSubset( const rtl::OUString& rToFile,
const ImplFontData*,
sal_Int32* pGlyphIDs,
diff --git a/vcl/inc/salinst.hxx b/vcl/inc/salinst.hxx
index 408708bc806a..878aa6dd2d4d 100644
--- a/vcl/inc/salinst.hxx
+++ b/vcl/inc/salinst.hxx
@@ -112,9 +112,6 @@ public:
virtual void DeletePrinterQueueInfo( SalPrinterQueueInfo* pInfo ) = 0;
virtual String GetDefaultPrinter() = 0;
- // used only by the unix / headless backends to de-couple code
- virtual void PostPrintersChanged() {}
-
// SalTimer
virtual SalTimer* CreateSalTimer() = 0;
// SalI18NImeStatus
diff --git a/vcl/inc/unx/headless/svpinst.hxx b/vcl/inc/unx/headless/svpinst.hxx
index b61911ebc089..09f701f3b750 100644
--- a/vcl/inc/unx/headless/svpinst.hxx
+++ b/vcl/inc/unx/headless/svpinst.hxx
@@ -36,6 +36,7 @@
#include <salinst.hxx>
#include <salwtype.hxx>
#include <saltimer.hxx>
+#include <generic/geninst.h>
#include <list>
@@ -86,7 +87,7 @@ public:
// - SalInstance -
// ---------------
class SvpSalFrame;
-class SvpSalInstance : public SalInstance
+class SvpSalInstance : public GenericInstance
{
timeval m_aTimeout;
sal_uLong m_nTimeoutMS;
@@ -195,9 +196,6 @@ public:
virtual void AddToRecentDocumentList(const rtl::OUString& rFileUrl, const rtl::OUString& rMimeType);
- virtual void updatePrinterUpdate();
- virtual void jobStartedPrinterUpdate();
- virtual void jobEndedPrinterUpdate();
};
#endif // _SV_SALINST_HXX
diff --git a/vcl/inc/unx/headless/svpprn.hxx b/vcl/inc/unx/headless/svpprn.hxx
index f7e6a671f4b3..67861f6e6cb5 100644
--- a/vcl/inc/unx/headless/svpprn.hxx
+++ b/vcl/inc/unx/headless/svpprn.hxx
@@ -30,10 +30,9 @@
#define _SVP_SVPPRN_HXX
#include "vcl/jobdata.hxx"
-
-#include "printergfx.hxx"
-#include "printerjob.hxx"
-#include <unx/salprn.h>
+#include "generic/printergfx.hxx"
+#include "generic/printerjob.hxx"
+#include "generic/genprn.h"
#include "vclpluginapi.h"
diff --git a/vcl/inc/unx/salinst.h b/vcl/inc/unx/salinst.h
index dd1c942f01bf..53c16891131c 100644
--- a/vcl/inc/unx/salinst.h
+++ b/vcl/inc/unx/salinst.h
@@ -35,6 +35,7 @@
#include <vclpluginapi.h>
#include <salinst.hxx>
#include <vcl/solarmutex.hxx>
+#include "generic/geninst.h"
class VCLPLUG_GEN_PUBLIC SalYieldMutex : public vcl::SolarMutexObject
{
@@ -54,21 +55,20 @@ public:
};
// -=-= SalInstanceData =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
-class VCLPLUG_GEN_PUBLIC X11SalInstance : public SalInstance
+class VCLPLUG_GEN_PUBLIC X11SalInstance : public GenericInstance
{
protected:
SalYieldMutex* mpSalYieldMutex;
- bool mbPrinterInit;
public:
X11SalInstance( SalYieldMutex* pMutex )
- : mpSalYieldMutex( pMutex ),
- mbPrinterInit( false )
+ : GenericInstance()
+ , mpSalYieldMutex( pMutex )
{}
virtual ~X11SalInstance();
- virtual SalFrame* CreateChildFrame( SystemParentData* pParent, sal_uIntPtr nStyle );
- virtual SalFrame* CreateFrame( SalFrame* pParent, sal_uIntPtr nStyle );
+ virtual SalFrame* CreateChildFrame( SystemParentData* pParent, sal_uIntPtr nStyle );
+ virtual SalFrame* CreateFrame( SalFrame* pParent, sal_uIntPtr nStyle );
virtual void DestroyFrame( SalFrame* pFrame );
virtual SalObject* CreateObject( SalFrame* pParent, SystemWindowData* pWindowData, sal_Bool bShow = sal_True );
@@ -78,17 +78,6 @@ public:
long nDX, long nDY,
sal_uInt16 nBitCount, const SystemGraphicsData *pData = NULL );
virtual void DestroyVirtualDevice( SalVirtualDevice* pDevice );
-
- virtual SalInfoPrinter* CreateInfoPrinter( SalPrinterQueueInfo* pQueueInfo,
- ImplJobSetup* pSetupData );
- virtual void DestroyInfoPrinter( SalInfoPrinter* pPrinter );
- virtual SalPrinter* CreatePrinter( SalInfoPrinter* pInfoPrinter );
- virtual void DestroyPrinter( SalPrinter* pPrinter );
-
- virtual void GetPrinterQueueInfo( ImplPrnQueueList* pList );
- virtual void GetPrinterQueueState( SalPrinterQueueInfo* pInfo );
- virtual void DeletePrinterQueueInfo( SalPrinterQueueInfo* pInfo );
- virtual String GetDefaultPrinter();
virtual void PostPrintersChanged();
virtual SalTimer* CreateSalTimer();
@@ -98,15 +87,15 @@ public:
virtual SalSession* CreateSalSession();
virtual osl::SolarMutex* GetYieldMutex();
- virtual sal_uIntPtr ReleaseYieldMutex();
+ virtual sal_uIntPtr ReleaseYieldMutex();
virtual void AcquireYieldMutex( sal_uIntPtr nCount );
virtual bool CheckYieldMutex();
virtual void Yield( bool bWait, bool bHandleAllCurrentEvents );
virtual bool AnyInput( sal_uInt16 nType );
- virtual void* GetConnectionIdentifier( ConnectionIdentifierType& rReturnedType, int& rReturnedBytes );
- void FillFontPathList( std::list< rtl::OString >& o_rFontPaths );
+ virtual void* GetConnectionIdentifier( ConnectionIdentifierType& rReturnedType, int& rReturnedBytes );
+ void FillFontPathList( std::list< rtl::OString >& o_rFontPaths );
// dtrans implementation
virtual com::sun::star::uno::Reference< com::sun::star::uno::XInterface >
@@ -114,15 +103,6 @@ public:
virtual com::sun::star::uno::Reference< com::sun::star::uno::XInterface > CreateDragSource();
virtual com::sun::star::uno::Reference< com::sun::star::uno::XInterface > CreateDropTarget();
virtual void AddToRecentDocumentList(const rtl::OUString& rFileUrl, const rtl::OUString& rMimeType);
-
- virtual void updatePrinterUpdate();
- virtual void jobStartedPrinterUpdate();
- virtual void jobEndedPrinterUpdate();
-
- bool isPrinterInit() const
- {
- return mbPrinterInit;
- }
};
#endif // _SV_SALINST_H