diff options
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/Library_vcl.mk | 31 | ||||
-rw-r--r-- | vcl/Library_vclplug_gen.mk | 8 | ||||
-rw-r--r-- | vcl/Library_vclplug_svp.mk | 8 | ||||
-rw-r--r-- | vcl/Package_afmhash.mk | 4 | ||||
-rw-r--r-- | vcl/README | 30 | ||||
-rw-r--r-- | vcl/generic/fontmanager/Makefile (renamed from vcl/unx/generic/fontmanager/Makefile) | 0 | ||||
-rw-r--r-- | vcl/generic/fontmanager/adobeenc.tab (renamed from vcl/unx/generic/fontmanager/adobeenc.tab) | 0 | ||||
-rwxr-xr-x | vcl/generic/fontmanager/afm_keyword_list (renamed from vcl/unx/generic/fontmanager/afm_keyword_list) | 0 | ||||
-rw-r--r-- | vcl/generic/fontmanager/fontcache.cxx (renamed from vcl/unx/generic/fontmanager/fontcache.cxx) | 0 | ||||
-rw-r--r-- | vcl/generic/fontmanager/fontconfig.cxx (renamed from vcl/unx/generic/fontmanager/fontconfig.cxx) | 0 | ||||
-rw-r--r-- | vcl/generic/fontmanager/fontmanager.cxx (renamed from vcl/unx/generic/fontmanager/fontmanager.cxx) | 0 | ||||
-rw-r--r-- | vcl/generic/fontmanager/helper.cxx (renamed from vcl/unx/generic/fontmanager/helper.cxx) | 0 | ||||
-rw-r--r-- | vcl/generic/fontmanager/parseAFM.cxx (renamed from vcl/unx/generic/fontmanager/parseAFM.cxx) | 0 | ||||
-rw-r--r-- | vcl/generic/fontmanager/parseAFM.hxx (renamed from vcl/unx/generic/fontmanager/parseAFM.hxx) | 0 | ||||
-rw-r--r-- | vcl/generic/glyphs/gcach_ftyp.cxx (renamed from vcl/unx/generic/glyphs/gcach_ftyp.cxx) | 0 | ||||
-rw-r--r-- | vcl/generic/glyphs/gcach_ftyp.hxx (renamed from vcl/unx/generic/glyphs/gcach_ftyp.hxx) | 2 | ||||
-rw-r--r-- | vcl/generic/glyphs/gcach_layout.cxx (renamed from vcl/unx/generic/glyphs/gcach_layout.cxx) | 0 | ||||
-rw-r--r-- | vcl/generic/glyphs/gcach_rbmp.cxx (renamed from vcl/unx/generic/glyphs/gcach_rbmp.cxx) | 2 | ||||
-rw-r--r-- | vcl/generic/glyphs/glyphcache.cxx (renamed from vcl/unx/generic/glyphs/glyphcache.cxx) | 0 | ||||
-rw-r--r-- | vcl/generic/glyphs/graphite_serverfont.cxx (renamed from vcl/unx/generic/glyphs/graphite_serverfont.cxx) | 2 | ||||
-rw-r--r-- | vcl/generic/print/bitmap_gfx.cxx (renamed from vcl/unx/generic/printergfx/bitmap_gfx.cxx) | 2 | ||||
-rw-r--r-- | vcl/generic/print/common_gfx.cxx (renamed from vcl/unx/generic/printergfx/common_gfx.cxx) | 4 | ||||
-rw-r--r-- | vcl/generic/print/fontsubst.cxx | 227 | ||||
-rw-r--r-- | vcl/generic/print/genprnpsp.cxx (renamed from vcl/unx/generic/gdi/salprnpsp.cxx) | 151 | ||||
-rw-r--r-- | vcl/generic/print/glyphset.cxx (renamed from vcl/unx/generic/printergfx/glyphset.cxx) | 2 | ||||
-rw-r--r-- | vcl/generic/print/glyphset.hxx (renamed from vcl/unx/generic/printergfx/glyphset.hxx) | 0 | ||||
-rw-r--r-- | vcl/generic/print/printerjob.cxx (renamed from vcl/unx/generic/printergfx/printerjob.cxx) | 4 | ||||
-rw-r--r-- | vcl/generic/print/psheader.ps (renamed from vcl/unx/generic/printergfx/psheader.ps) | 0 | ||||
-rw-r--r-- | vcl/generic/print/pspgraphics.cxx (renamed from vcl/unx/generic/gdi/pspgraphics.cxx) | 11 | ||||
-rw-r--r-- | vcl/generic/print/psputil.cxx (renamed from vcl/unx/generic/printergfx/psputil.cxx) | 0 | ||||
-rw-r--r-- | vcl/generic/print/psputil.hxx (renamed from vcl/unx/generic/printergfx/psputil.hxx) | 0 | ||||
-rw-r--r-- | vcl/generic/print/text_gfx.cxx (renamed from vcl/unx/generic/printergfx/text_gfx.cxx) | 2 | ||||
-rw-r--r-- | vcl/inc/generic/geninst.h | 72 | ||||
-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.hxx | 3 | ||||
-rw-r--r-- | vcl/inc/unx/headless/svpinst.hxx | 6 | ||||
-rw-r--r-- | vcl/inc/unx/headless/svpprn.hxx | 7 | ||||
-rw-r--r-- | vcl/inc/unx/salinst.h | 38 | ||||
-rw-r--r-- | vcl/unx/generic/app/salinst.cxx | 2 | ||||
-rw-r--r-- | vcl/unx/generic/gdi/gcach_xpeer.hxx | 2 | ||||
-rw-r--r-- | vcl/unx/generic/gdi/salgdi.cxx | 2 | ||||
-rw-r--r-- | vcl/unx/generic/gdi/salgdi2.cxx | 2 | ||||
-rw-r--r-- | vcl/unx/generic/gdi/salgdi3.cxx | 183 | ||||
-rw-r--r-- | vcl/unx/generic/window/salframe.cxx | 2 | ||||
-rw-r--r-- | vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx | 2 | ||||
-rw-r--r-- | vcl/unx/gtk/window/gtkframe.cxx | 2 | ||||
-rw-r--r-- | vcl/unx/headless/svpprn.cxx | 106 | ||||
-rw-r--r-- | vcl/unx/headless/svppspgraphics.cxx | 4 | ||||
-rw-r--r-- | vcl/unx/headless/svptext.cxx | 2 |
53 files changed, 447 insertions, 509 deletions
diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk index 0d479f086a09..339e57fb6a66 100644 --- a/vcl/Library_vcl.mk +++ b/vcl/Library_vcl.mk @@ -50,7 +50,7 @@ $(eval $(call gb_Library_set_include,vcl,\ -I$(SRCDIR)/solenv/inc \ -I$(OUTDIR)/inc \ $(if $(filter WNTGCC,$(OS)$(COM)),-I$(OUTDIR)/inc/external/wine) \ - -I$(WORKDIR)/CustomTarget/vcl/unx/generic/fontmanager \ + -I$(WORKDIR)/CustomTarget/vcl/generic/fontmanager \ )) $(eval $(call gb_Library_add_defs,vcl,\ @@ -264,6 +264,15 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\ vcl/source/window/window \ vcl/source/window/winproc \ vcl/source/window/wrkwin \ + vcl/generic/print/bitmap_gfx \ + vcl/generic/print/common_gfx \ + vcl/generic/print/glyphset \ + vcl/generic/print/printerjob \ + vcl/generic/print/psputil \ + vcl/generic/print/pspgraphics \ + vcl/generic/print/genprnpsp \ + vcl/generic/print/text_gfx \ + vcl/generic/print/fontsubst \ )) # optional parts @@ -282,7 +291,7 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\ # handle X11 platforms, which have additional files and possibly system graphite ifeq ($(GUIBASE),unx) $(eval $(call gb_Library_add_exception_objects,vcl,\ - vcl/unx/generic/glyphs/graphite_serverfont \ + vcl/generic/glyphs/graphite_serverfont \ )) else $(eval $(call gb_Library_add_linked_libs,vcl,\ @@ -398,15 +407,15 @@ $(eval $(call gb_Library_add_defs,vcl,\ -D_XSALSET_LIBNAME=\"$(call gb_Library_get_runtime_filename,spa)\" \ )) $(eval $(call gb_Library_add_exception_objects,vcl,\ - vcl/unx/generic/glyphs/gcach_ftyp \ - vcl/unx/generic/glyphs/gcach_layout \ - vcl/unx/generic/glyphs/gcach_rbmp \ - vcl/unx/generic/glyphs/glyphcache \ - vcl/unx/generic/fontmanager/fontcache \ - vcl/unx/generic/fontmanager/fontconfig \ - vcl/unx/generic/fontmanager/fontmanager \ - vcl/unx/generic/fontmanager/helper \ - vcl/unx/generic/fontmanager/parseAFM \ + vcl/generic/glyphs/gcach_ftyp \ + vcl/generic/glyphs/gcach_layout \ + vcl/generic/glyphs/gcach_rbmp \ + vcl/generic/glyphs/glyphcache \ + vcl/generic/fontmanager/fontcache \ + vcl/generic/fontmanager/fontconfig \ + vcl/generic/fontmanager/fontmanager \ + vcl/generic/fontmanager/helper \ + vcl/generic/fontmanager/parseAFM \ vcl/unx/generic/plugadapt/salplug \ vcl/unx/generic/printer/cupsmgr \ vcl/unx/generic/printer/jobdata \ diff --git a/vcl/Library_vclplug_gen.mk b/vcl/Library_vclplug_gen.mk index ffc70a87079f..ab2320827a39 100644 --- a/vcl/Library_vclplug_gen.mk +++ b/vcl/Library_vclplug_gen.mk @@ -96,20 +96,12 @@ $(eval $(call gb_Library_add_exception_objects,vclplug_gen,\ vcl/unx/generic/dtrans/X11_service \ vcl/unx/generic/dtrans/X11_transferable \ vcl/unx/generic/gdi/gcach_xpeer \ - vcl/unx/generic/gdi/pspgraphics \ vcl/unx/generic/gdi/salbmp \ vcl/unx/generic/gdi/salgdi2 \ vcl/unx/generic/gdi/salgdi3 \ vcl/unx/generic/gdi/salgdi \ - vcl/unx/generic/gdi/salprnpsp \ vcl/unx/generic/gdi/salvd \ vcl/unx/generic/gdi/xrender_peer \ - vcl/unx/generic/printergfx/bitmap_gfx \ - vcl/unx/generic/printergfx/common_gfx \ - vcl/unx/generic/printergfx/glyphset \ - vcl/unx/generic/printergfx/printerjob \ - vcl/unx/generic/printergfx/psputil \ - vcl/unx/generic/printergfx/text_gfx \ vcl/unx/generic/window/FWS \ vcl/unx/generic/window/salframe \ vcl/unx/generic/window/salobj \ diff --git a/vcl/Library_vclplug_svp.mk b/vcl/Library_vclplug_svp.mk index 40a01f6d2f12..da2a83781a56 100644 --- a/vcl/Library_vclplug_svp.mk +++ b/vcl/Library_vclplug_svp.mk @@ -41,7 +41,6 @@ $(eval $(call gb_Library_add_cxxflags,vclplug_svp,\ )) $(eval $(call gb_Library_add_defs,vclplug_svp,\ - -D_XSALSET_LIBNAME=\"$(call gb_Library_get_runtime_filename,spa)\" \ -DVCLPLUG_SVP_IMPLEMENTATION \ )) @@ -89,13 +88,6 @@ $(eval $(call gb_Library_add_exception_objects,vclplug_svp,\ vcl/unx/headless/svppspgraphics \ vcl/unx/headless/svptext \ vcl/unx/headless/svpvd \ - vcl/unx/generic/gdi/salprnpsp \ - vcl/unx/generic/printergfx/bitmap_gfx \ - vcl/unx/generic/printergfx/common_gfx \ - vcl/unx/generic/printergfx/glyphset \ - vcl/unx/generic/printergfx/printerjob \ - vcl/unx/generic/printergfx/psputil \ - vcl/unx/generic/printergfx/text_gfx \ )) ifeq ($(OS),LINUX) diff --git a/vcl/Package_afmhash.mk b/vcl/Package_afmhash.mk index 90d8b8254c58..2aa384b78f10 100644 --- a/vcl/Package_afmhash.mk +++ b/vcl/Package_afmhash.mk @@ -24,7 +24,7 @@ # in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable # instead of those above. -$(eval $(call gb_Package_Package,vcl_afmhash,$(WORKDIR)/CustomTarget/vcl/unx/generic/fontmanager)) -$(eval $(call gb_Package_add_customtarget,vcl_afmhash,vcl/unx/generic/fontmanager)) +$(eval $(call gb_Package_Package,vcl_afmhash,$(WORKDIR)/CustomTarget/vcl/generic/fontmanager)) +$(eval $(call gb_Package_add_customtarget,vcl_afmhash,vcl/generic/fontmanager)) # vim: set noet sw=4 ts=4: diff --git a/vcl/README b/vcl/README new file mode 100644 index 000000000000..c752457d5247 --- /dev/null +++ b/vcl/README @@ -0,0 +1,30 @@ +Welcome to the Visual Class Libraries (vcl) code + + +source/ + + the main cross-platform chunk of source + +inc/ + + cross-platform abstraction headers / definition + vcl/ + + external headers + +generic/ + + shared helper code for backends, + actually built into vcl + +aqua/ + + OS/X backend +ios/ + + skeleton Android backend +win/ + + windows backend +unx/ + + unix specific platform backend code and its' sub-platforms + gtk/ + gtk3/ + kde/ + generic/ - raw X + + + diff --git a/vcl/unx/generic/fontmanager/Makefile b/vcl/generic/fontmanager/Makefile index 7fb7b0325aea..7fb7b0325aea 100644 --- a/vcl/unx/generic/fontmanager/Makefile +++ b/vcl/generic/fontmanager/Makefile diff --git a/vcl/unx/generic/fontmanager/adobeenc.tab b/vcl/generic/fontmanager/adobeenc.tab index 492e92f3fcf2..492e92f3fcf2 100644 --- a/vcl/unx/generic/fontmanager/adobeenc.tab +++ b/vcl/generic/fontmanager/adobeenc.tab diff --git a/vcl/unx/generic/fontmanager/afm_keyword_list b/vcl/generic/fontmanager/afm_keyword_list index c9bb13467e3e..c9bb13467e3e 100755 --- a/vcl/unx/generic/fontmanager/afm_keyword_list +++ b/vcl/generic/fontmanager/afm_keyword_list diff --git a/vcl/unx/generic/fontmanager/fontcache.cxx b/vcl/generic/fontmanager/fontcache.cxx index 78a16260d179..78a16260d179 100644 --- a/vcl/unx/generic/fontmanager/fontcache.cxx +++ b/vcl/generic/fontmanager/fontcache.cxx diff --git a/vcl/unx/generic/fontmanager/fontconfig.cxx b/vcl/generic/fontmanager/fontconfig.cxx index be91349eadc4..be91349eadc4 100644 --- a/vcl/unx/generic/fontmanager/fontconfig.cxx +++ b/vcl/generic/fontmanager/fontconfig.cxx diff --git a/vcl/unx/generic/fontmanager/fontmanager.cxx b/vcl/generic/fontmanager/fontmanager.cxx index 80cddeec3317..80cddeec3317 100644 --- a/vcl/unx/generic/fontmanager/fontmanager.cxx +++ b/vcl/generic/fontmanager/fontmanager.cxx diff --git a/vcl/unx/generic/fontmanager/helper.cxx b/vcl/generic/fontmanager/helper.cxx index 50203276fedd..50203276fedd 100644 --- a/vcl/unx/generic/fontmanager/helper.cxx +++ b/vcl/generic/fontmanager/helper.cxx diff --git a/vcl/unx/generic/fontmanager/parseAFM.cxx b/vcl/generic/fontmanager/parseAFM.cxx index 82d94f2518e0..82d94f2518e0 100644 --- a/vcl/unx/generic/fontmanager/parseAFM.cxx +++ b/vcl/generic/fontmanager/parseAFM.cxx diff --git a/vcl/unx/generic/fontmanager/parseAFM.hxx b/vcl/generic/fontmanager/parseAFM.hxx index 0c390bd8cf8d..0c390bd8cf8d 100644 --- a/vcl/unx/generic/fontmanager/parseAFM.hxx +++ b/vcl/generic/fontmanager/parseAFM.hxx diff --git a/vcl/unx/generic/glyphs/gcach_ftyp.cxx b/vcl/generic/glyphs/gcach_ftyp.cxx index ffa4aa33b642..ffa4aa33b642 100644 --- a/vcl/unx/generic/glyphs/gcach_ftyp.cxx +++ b/vcl/generic/glyphs/gcach_ftyp.cxx diff --git a/vcl/unx/generic/glyphs/gcach_ftyp.hxx b/vcl/generic/glyphs/gcach_ftyp.hxx index f3af00b6f791..7386bb3d1e82 100644 --- a/vcl/unx/generic/glyphs/gcach_ftyp.hxx +++ b/vcl/generic/glyphs/gcach_ftyp.hxx @@ -29,7 +29,7 @@ #ifndef _SV_GCACHFTYP_HXX #define _SV_GCACHFTYP_HXX -#include "unx/glyphcache.hxx" +#include "generic/glyphcache.hxx" #include <rtl/textcvt.h> diff --git a/vcl/unx/generic/glyphs/gcach_layout.cxx b/vcl/generic/glyphs/gcach_layout.cxx index ae5ad511268d..ae5ad511268d 100644 --- a/vcl/unx/generic/glyphs/gcach_layout.cxx +++ b/vcl/generic/glyphs/gcach_layout.cxx diff --git a/vcl/unx/generic/glyphs/gcach_rbmp.cxx b/vcl/generic/glyphs/gcach_rbmp.cxx index 47321a343458..a5dd5aebacf1 100644 --- a/vcl/unx/generic/glyphs/gcach_rbmp.cxx +++ b/vcl/generic/glyphs/gcach_rbmp.cxx @@ -29,7 +29,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_vcl.hxx" -#include "unx/glyphcache.hxx" +#include "generic/glyphcache.hxx" #include <string.h> //------------------------------------------------------------------------ diff --git a/vcl/unx/generic/glyphs/glyphcache.cxx b/vcl/generic/glyphs/glyphcache.cxx index 5322b6502310..5322b6502310 100644 --- a/vcl/unx/generic/glyphs/glyphcache.cxx +++ b/vcl/generic/glyphs/glyphcache.cxx diff --git a/vcl/unx/generic/glyphs/graphite_serverfont.cxx b/vcl/generic/glyphs/graphite_serverfont.cxx index d7928eae77b9..fd5babf5efe8 100644 --- a/vcl/unx/generic/glyphs/graphite_serverfont.cxx +++ b/vcl/generic/glyphs/graphite_serverfont.cxx @@ -40,7 +40,7 @@ #include <sallayout.hxx> // Module #include "gcach_ftyp.hxx" -#include "unx/glyphcache.hxx" +#include "generic/glyphcache.hxx" #include <graphite_features.hxx> #include <graphite_serverfont.hxx> diff --git a/vcl/unx/generic/printergfx/bitmap_gfx.cxx b/vcl/generic/print/bitmap_gfx.cxx index 0c139678f8ab..f0b1bd4fe966 100644 --- a/vcl/unx/generic/printergfx/bitmap_gfx.cxx +++ b/vcl/generic/print/bitmap_gfx.cxx @@ -31,7 +31,7 @@ #include "psputil.hxx" -#include "printergfx.hxx" +#include "generic/printergfx.hxx" #include "vcl/strhelper.hxx" namespace psp { diff --git a/vcl/unx/generic/printergfx/common_gfx.cxx b/vcl/generic/print/common_gfx.cxx index e57617395f38..f2dc2acaaab1 100644 --- a/vcl/unx/generic/printergfx/common_gfx.cxx +++ b/vcl/generic/print/common_gfx.cxx @@ -32,8 +32,8 @@ #include "psputil.hxx" #include "glyphset.hxx" -#include "printergfx.hxx" -#include "printerjob.hxx" +#include "generic/printergfx.hxx" +#include "generic/printerjob.hxx" #include "vcl/fontmanager.hxx" #include "vcl/strhelper.hxx" #include "vcl/printerinfomanager.hxx" diff --git a/vcl/generic/print/fontsubst.cxx b/vcl/generic/print/fontsubst.cxx new file mode 100644 index 000000000000..5c0dff6f25be --- /dev/null +++ b/vcl/generic/print/fontsubst.cxx @@ -0,0 +1,227 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +// MARKER(update_precomp.py): autogen include statement, do not remove +#include "precompiled_vcl.hxx" +#include "generic/geninst.h" +#include "generic/pspgraphics.h" +#include "generic/glyphcache.hxx" + +#include "vcl/sysdata.hxx" +#include "outfont.hxx" +#include <i18npool/mslangid.hxx> + +#include "generic/printergfx.hxx" +#include "salbmp.hxx" +#include "impfont.hxx" +#include "outfont.hxx" +#include "outdev.h" +#include "fontsubset.hxx" +#include "salprn.hxx" +#include "region.h" + +// =========================================================================== +// platform specific font substitution hooks +// =========================================================================== + +class FcPreMatchSubstititution +: public ImplPreMatchFontSubstitution +{ +public: + bool FindFontSubstitute( ImplFontSelectData& ) const; +}; + +class FcGlyphFallbackSubstititution +: public ImplGlyphFallbackFontSubstitution +{ + // TODO: add a cache +public: + bool FindFontSubstitute( ImplFontSelectData&, OUString& rMissingCodes ) const; +}; + +void RegisterFontSubstitutors( ImplDevFontList* pList ) +{ + // init font substitution defaults + int nDisableBits = 0; +#ifdef SOLARIS + nDisableBits = 1; // disable "font fallback" here on default +#endif + // apply the environment variable if any + const char* pEnvStr = ::getenv( "SAL_DISABLE_FC_SUBST" ); + if( pEnvStr ) + { + if( (*pEnvStr >= '0') && (*pEnvStr <= '9') ) + nDisableBits = (*pEnvStr - '0'); + else + nDisableBits = ~0U; // no specific bits set: disable all + } + + // register font fallback substitutions (unless disabled by bit0) + if( (nDisableBits & 1) == 0 ) + { + static FcPreMatchSubstititution aSubstPreMatch; + pList->SetPreMatchHook( &aSubstPreMatch ); + } + + // register glyph fallback substitutions (unless disabled by bit1) + if( (nDisableBits & 2) == 0 ) + { + static FcGlyphFallbackSubstititution aSubstFallback; + pList->SetFallbackHook( &aSubstFallback ); + } +} + +// ----------------------------------------------------------------------- + +static ImplFontSelectData GetFcSubstitute(const ImplFontSelectData &rFontSelData, OUString& rMissingCodes ) +{ + ImplFontSelectData aRet(rFontSelData); + + const rtl::OString aLangAttrib = MsLangId::convertLanguageToIsoByteString( rFontSelData.meLanguage ); + + FontItalic eItalic = rFontSelData.GetSlant(); + FontWeight eWeight = rFontSelData.GetWeight(); + FontWidth eWidth = rFontSelData.GetWidthType(); + FontPitch ePitch = rFontSelData.GetPitch(); + + const psp::PrintFontManager& rMgr = psp::PrintFontManager::get(); + aRet.maSearchName = rMgr.Substitute( rFontSelData.maTargetName, rMissingCodes, aLangAttrib, eItalic, eWeight, eWidth, ePitch); + + aRet.meItalic = eItalic; + aRet.meWeight = eWeight; + aRet.meWidthType = eWidth; + aRet.mePitch = ePitch; + + return aRet; +} + +namespace +{ + bool uselessmatch(const ImplFontSelectData &rOrig, const ImplFontSelectData &rNew) + { + return + ( + rOrig.maTargetName == rNew.maSearchName && + rOrig.meWeight == rNew.meWeight && + rOrig.meItalic == rNew.meItalic && + rOrig.mePitch == rNew.mePitch && + rOrig.meWidthType == rNew.meWidthType + ); + } +} + +//-------------------------------------------------------------------------- + +bool FcPreMatchSubstititution::FindFontSubstitute( ImplFontSelectData &rFontSelData ) const +{ + // We dont' actually want to talk to Fontconfig at all for symbol fonts + if( rFontSelData.IsSymbolFont() ) + return false; + // StarSymbol is a unicode font, but it still deserves the symbol flag + if( 0 == rFontSelData.maSearchName.CompareIgnoreCaseToAscii( "starsymbol", 10) + || 0 == rFontSelData.maSearchName.CompareIgnoreCaseToAscii( "opensymbol", 10) ) + return false; + + //Note: see fdo#41556 if you feel compelled to cache the results here, + //remember that fontconfig can return e.g. an italic font for a non-italic + //input and/or different fonts depending on fontsize, bold, etc settings so + //don't cache just on the name, cache on all the input and be don't just + //return the original selection data with the fontname updated + rtl::OUString aDummy; + const ImplFontSelectData aOut = GetFcSubstitute( rFontSelData, aDummy ); + + if( !aOut.maSearchName.Len() ) + return false; + + const bool bHaveSubstitute = !uselessmatch( rFontSelData, aOut ); + +#ifdef DEBUG + const ByteString aOrigName( rFontSelData.maTargetName, RTL_TEXTENCODING_UTF8 ); + const ByteString aSubstName( aOut.maSearchName, RTL_TEXTENCODING_UTF8 ); + printf( "FcPreMatchSubstititution \"%s\" bipw=%d%d%d%d -> ", + aOrigName.GetBuffer(), rFontSelData.meWeight, rFontSelData.meItalic, + rFontSelData.mePitch, rFontSelData.meWidthType ); + if( !bHaveSubstitute ) + printf( "no substitute available\n" ); + else + printf( "\"%s\" bipw=%d%d%d%d\n", aSubstName.GetBuffer(), + aOut.meWeight, aOut.meItalic, aOut.mePitch, aOut.meWidthType ); +#endif + + if( bHaveSubstitute ) + rFontSelData = aOut; + + return bHaveSubstitute; +} + +// ----------------------------------------------------------------------- + +bool FcGlyphFallbackSubstititution::FindFontSubstitute( ImplFontSelectData& rFontSelData, + rtl::OUString& rMissingCodes ) const +{ + // We dont' actually want to talk to Fontconfig at all for symbol fonts + if( rFontSelData.IsSymbolFont() ) + return false; + // StarSymbol is a unicode font, but it still deserves the symbol flag + if( 0 == rFontSelData.maSearchName.CompareIgnoreCaseToAscii( "starsymbol", 10) + || 0 == rFontSelData.maSearchName.CompareIgnoreCaseToAscii( "opensymbol", 10) ) + return false; + + const ImplFontSelectData aOut = GetFcSubstitute( rFontSelData, rMissingCodes ); + // TODO: cache the unicode + srcfont specific result + // FC doing it would be preferable because it knows the invariables + // e.g. FC knows the FC rule that all Arial gets replaced by LiberationSans + // whereas we would have to check for every size or attribute + if( !aOut.maSearchName.Len() ) + return false; + + const bool bHaveSubstitute = !uselessmatch( rFontSelData, aOut ); + +#ifdef DEBUG + const ByteString aOrigName( rFontSelData.maTargetName, RTL_TEXTENCODING_UTF8 ); + const ByteString aSubstName( aOut.maSearchName, RTL_TEXTENCODING_UTF8 ); + printf( "FcGFSubstititution \"%s\" bipw=%d%d%d%d ->", + aOrigName.GetBuffer(), rFontSelData.meWeight, rFontSelData.meItalic, + rFontSelData.mePitch, rFontSelData.meWidthType ); + if( !bHaveSubstitute ) + printf( "no substitute available\n" ); + else + printf( "\"%s\" bipw=%d%d%d%d\n", aSubstName.GetBuffer(), + aOut.meWeight, aOut.meItalic, aOut.mePitch, aOut.meWidthType ); +#endif + + if( bHaveSubstitute ) + rFontSelData = aOut; + + return bHaveSubstitute; +} + +// =========================================================================== + + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/generic/gdi/salprnpsp.cxx b/vcl/generic/print/genprnpsp.cxx index 790e9183e0f1..c0b88fe001b7 100644 --- a/vcl/unx/generic/gdi/salprnpsp.cxx +++ b/vcl/generic/print/genprnpsp.cxx @@ -54,13 +54,10 @@ #include "vcl/pdfwriter.hxx" #include "vcl/printerinfomanager.hxx" -#include <unx/salunx.h> -#include "unx/saldisp.hxx" -#include "unx/salinst.h" -#include "unx/salprn.h" -#include "unx/salframe.h" -#include "unx/pspgraphics.h" -#include "unx/saldata.hxx" +#include "saldatabasic.hxx" +#include "generic/genprn.h" +#include "generic/geninst.h" +#include "generic/pspgraphics.h" #include "jobset.h" #include "print.h" @@ -385,10 +382,8 @@ static bool createPdf( const String& rToFile, const String& rFromFile, const Str * SalInstance */ -// ----------------------------------------------------------------------- - -SalInfoPrinter* X11SalInstance::CreateInfoPrinter( SalPrinterQueueInfo* pQueueInfo, - ImplJobSetup* pJobSetup ) +SalInfoPrinter* GenericInstance::CreateInfoPrinter( SalPrinterQueueInfo* pQueueInfo, + ImplJobSetup* pJobSetup ) { mbPrinterInit = true; // create and initialize SalInfoPrinter @@ -426,16 +421,12 @@ SalInfoPrinter* X11SalInstance::CreateInfoPrinter( SalPrinterQueueInfo* pQueueIn return pPrinter; } -// ----------------------------------------------------------------------- - -void X11SalInstance::DestroyInfoPrinter( SalInfoPrinter* pPrinter ) +void GenericInstance::DestroyInfoPrinter( SalInfoPrinter* pPrinter ) { delete pPrinter; } -// ----------------------------------------------------------------------- - -SalPrinter* X11SalInstance::CreatePrinter( SalInfoPrinter* pInfoPrinter ) +SalPrinter* GenericInstance::CreatePrinter( SalInfoPrinter* pInfoPrinter ) { mbPrinterInit = true; // create and initialize SalPrinter @@ -445,16 +436,12 @@ SalPrinter* X11SalInstance::CreatePrinter( SalInfoPrinter* pInfoPrinter ) return pPrinter; } -// ----------------------------------------------------------------------- - -void X11SalInstance::DestroyPrinter( SalPrinter* pPrinter ) +void GenericInstance::DestroyPrinter( SalPrinter* pPrinter ) { delete pPrinter; } -// ----------------------------------------------------------------------- - -void X11SalInstance::GetPrinterQueueInfo( ImplPrnQueueList* pList ) +void GenericInstance::GetPrinterQueueInfo( ImplPrnQueueList* pList ) { mbPrinterInit = true; PrinterInfoManager& rManager( PrinterInfoManager::get() ); @@ -493,39 +480,29 @@ void X11SalInstance::GetPrinterQueueInfo( ImplPrnQueueList* pList ) } } -// ----------------------------------------------------------------------- - -void X11SalInstance::DeletePrinterQueueInfo( SalPrinterQueueInfo* pInfo ) +void GenericInstance::DeletePrinterQueueInfo( SalPrinterQueueInfo* pInfo ) { delete pInfo; } -// ----------------------------------------------------------------------- - -void X11SalInstance::GetPrinterQueueState( SalPrinterQueueInfo* ) +void GenericInstance::GetPrinterQueueState( SalPrinterQueueInfo* ) { mbPrinterInit = true; } -// ----------------------------------------------------------------------- - -String X11SalInstance::GetDefaultPrinter() +String GenericInstance::GetDefaultPrinter() { mbPrinterInit = true; PrinterInfoManager& rManager( PrinterInfoManager::get() ); return rManager.getDefaultPrinter(); } -// ======================================================================= - PspSalInfoPrinter::PspSalInfoPrinter() { m_pGraphics = NULL; m_bPapersInit = false; } -// ----------------------------------------------------------------------- - PspSalInfoPrinter::~PspSalInfoPrinter() { if( m_pGraphics ) @@ -535,8 +512,6 @@ PspSalInfoPrinter::~PspSalInfoPrinter() } } -// ----------------------------------------------------------------------- - void PspSalInfoPrinter::InitPaperFormats( const ImplJobSetup* ) { m_aPaperFormats.clear(); @@ -560,15 +535,11 @@ void PspSalInfoPrinter::InitPaperFormats( const ImplJobSetup* ) } } -// ----------------------------------------------------------------------- - int PspSalInfoPrinter::GetLandscapeAngle( const ImplJobSetup* ) { return 900; } -// ----------------------------------------------------------------------- - SalGraphics* PspSalInfoPrinter::GetGraphics() { // return a valid pointer only once @@ -585,8 +556,6 @@ SalGraphics* PspSalInfoPrinter::GetGraphics() return pRet; } -// ----------------------------------------------------------------------- - void PspSalInfoPrinter::ReleaseGraphics( SalGraphics* pGraphics ) { if( pGraphics == m_pGraphics ) @@ -597,8 +566,6 @@ void PspSalInfoPrinter::ReleaseGraphics( SalGraphics* pGraphics ) return; } -// ----------------------------------------------------------------------- - sal_Bool PspSalInfoPrinter::Setup( SalFrame* pFrame, ImplJobSetup* pJobSetup ) { if( ! pFrame || ! pJobSetup ) @@ -637,8 +604,6 @@ sal_Bool PspSalInfoPrinter::Setup( SalFrame* pFrame, ImplJobSetup* pJobSetup ) return sal_False; } -// ----------------------------------------------------------------------- - // This function gets the driver data and puts it into pJobSetup // If pJobSetup->mpDriverData is NOT NULL, then the independend // data should be merged into the driver data @@ -666,8 +631,6 @@ sal_Bool PspSalInfoPrinter::SetPrinterData( ImplJobSetup* pJobSetup ) return sal_True; } -// ----------------------------------------------------------------------- - // This function merges the independ driver data // and sets the new independ data in pJobSetup // Only the data must be changed, where the bit @@ -777,8 +740,6 @@ sal_Bool PspSalInfoPrinter::SetData( return sal_False; } -// ----------------------------------------------------------------------- - void PspSalInfoPrinter::GetPageInfo( const ImplJobSetup* pJobSetup, long& rOutWidth, long& rOutHeight, @@ -821,8 +782,6 @@ void PspSalInfoPrinter::GetPageInfo( } } -// ----------------------------------------------------------------------- - sal_uLong PspSalInfoPrinter::GetPaperBinCount( const ImplJobSetup* pJobSetup ) { if( ! pJobSetup ) @@ -835,8 +794,6 @@ sal_uLong PspSalInfoPrinter::GetPaperBinCount( const ImplJobSetup* pJobSetup ) return pKey ? pKey->countValues() : 0; } -// ----------------------------------------------------------------------- - String PspSalInfoPrinter::GetPaperBinName( const ImplJobSetup* pJobSetup, sal_uLong nPaperBin ) { JobData aData; @@ -859,8 +816,6 @@ String PspSalInfoPrinter::GetPaperBinName( const ImplJobSetup* pJobSetup, sal_uL return aRet; } -// ----------------------------------------------------------------------- - sal_uLong PspSalInfoPrinter::GetCapabilities( const ImplJobSetup* pJobSetup, sal_uInt16 nType ) { switch( nType ) @@ -920,12 +875,9 @@ sal_uLong PspSalInfoPrinter::GetCapabilities( const ImplJobSetup* pJobSetup, sal return 0; } -// ======================================================================= - /* * SalPrinter */ - PspSalPrinter::PspSalPrinter( SalInfoPrinter* pInfoPrinter ) : m_bFax( false ), m_bPdf( false ), @@ -938,14 +890,10 @@ sal_uLong PspSalInfoPrinter::GetCapabilities( const ImplJobSetup* pJobSetup, sal { } -// ----------------------------------------------------------------------- - PspSalPrinter::~PspSalPrinter() { } -// ----------------------------------------------------------------------- - static String getTmpName() { rtl::OUString aTmp, aSys; @@ -1038,8 +986,6 @@ sal_Bool PspSalPrinter::StartJob( return m_aPrintJob.StartJob( m_aTmpFile.Len() ? m_aTmpFile : m_aFileName, nMode, rJobName, rAppName, m_aJobData, &m_aPrinterGfx, bDirect ) ? sal_True : sal_False; } -// ----------------------------------------------------------------------- - sal_Bool PspSalPrinter::EndJob() { sal_Bool bSuccess = sal_False; @@ -1070,8 +1016,6 @@ sal_Bool PspSalPrinter::EndJob() return bSuccess; } -// ----------------------------------------------------------------------- - sal_Bool PspSalPrinter::AbortJob() { sal_Bool bAbort = m_aPrintJob.AbortJob() ? sal_True : sal_False; @@ -1079,8 +1023,6 @@ sal_Bool PspSalPrinter::AbortJob() return bAbort; } -// ----------------------------------------------------------------------- - SalGraphics* PspSalPrinter::StartPage( ImplJobSetup* pJobSetup, sal_Bool ) { JobData::constructFromStreamBuffer( pJobSetup->mpDriverData, pJobSetup->mnDriverDataLen, m_aJobData ); @@ -1100,8 +1042,6 @@ SalGraphics* PspSalPrinter::StartPage( ImplJobSetup* pJobSetup, sal_Bool ) return m_pGraphics; } -// ----------------------------------------------------------------------- - sal_Bool PspSalPrinter::EndPage() { sal_Bool bResult = m_aPrintJob.EndPage(); @@ -1109,15 +1049,11 @@ sal_Bool PspSalPrinter::EndPage() return bResult ? sal_True : sal_False; } -// ----------------------------------------------------------------------- - sal_uLong PspSalPrinter::GetErrorCode() { return 0; } -// ----------------------------------------------------------------------- - struct PDFNewJobParameters { Size maPageSize; @@ -1386,40 +1322,33 @@ sal_Bool PspSalPrinter::StartJob( const String* i_pFileName, const String& i_rJo } -namespace x11 +class PrinterUpdate { - class PrinterUpdate - { - static Timer* pPrinterUpdateTimer; - static int nActiveJobs; - - static void doUpdate(); - DECL_STATIC_LINK( PrinterUpdate, UpdateTimerHdl, void* ); - public: - static void update(X11SalInstance &rInstance); - static void jobStarted() { nActiveJobs++; } - static void jobEnded(); - }; -} - -/* - * x11::PrinterUpdate - */ + static Timer* pPrinterUpdateTimer; + static int nActiveJobs; + + static void doUpdate(); + DECL_STATIC_LINK( PrinterUpdate, UpdateTimerHdl, void* ); +public: + static void update(GenericInstance &rInstance); + static void jobStarted() { nActiveJobs++; } + static void jobEnded(); +}; -Timer* x11::PrinterUpdate::pPrinterUpdateTimer = NULL; -int x11::PrinterUpdate::nActiveJobs = 0; +Timer* PrinterUpdate::pPrinterUpdateTimer = NULL; +int PrinterUpdate::nActiveJobs = 0; -void x11::PrinterUpdate::doUpdate() +void PrinterUpdate::doUpdate() { ::psp::PrinterInfoManager& rManager( ::psp::PrinterInfoManager::get() ); - SalInstance *pInst = GetSalData()->m_pInstance; + GenericInstance *pInst = static_cast<GenericInstance *>( GetSalData()->m_pInstance ); if( pInst && rManager.checkPrintersChanged( false ) ) pInst->PostPrintersChanged(); } // ----------------------------------------------------------------------- -IMPL_STATIC_LINK_NOINSTANCE( x11::PrinterUpdate, UpdateTimerHdl, void*, EMPTYARG ) +IMPL_STATIC_LINK_NOINSTANCE( PrinterUpdate, UpdateTimerHdl, void*, EMPTYARG ) { if( nActiveJobs < 1 ) { @@ -1433,9 +1362,7 @@ IMPL_STATIC_LINK_NOINSTANCE( x11::PrinterUpdate, UpdateTimerHdl, void*, EMPTYARG return 0; } -// ----------------------------------------------------------------------- - -void x11::PrinterUpdate::update(X11SalInstance &rInstance) +void PrinterUpdate::update(GenericInstance &rInstance) { if( Application::GetSettings().GetMiscSettings().GetDisablePrinting() ) return; @@ -1453,24 +1380,22 @@ void x11::PrinterUpdate::update(X11SalInstance &rInstance) { pPrinterUpdateTimer = new Timer(); pPrinterUpdateTimer->SetTimeout( 500 ); - pPrinterUpdateTimer->SetTimeoutHdl( STATIC_LINK( NULL, x11::PrinterUpdate, UpdateTimerHdl ) ); + pPrinterUpdateTimer->SetTimeoutHdl( STATIC_LINK( NULL, PrinterUpdate, UpdateTimerHdl ) ); pPrinterUpdateTimer->Start(); } } -void X11SalInstance::updatePrinterUpdate() +void GenericInstance::updatePrinterUpdate() { - x11::PrinterUpdate::update(*this); + PrinterUpdate::update(*this); } -void X11SalInstance::jobStartedPrinterUpdate() +void GenericInstance::jobStartedPrinterUpdate() { - x11::PrinterUpdate::jobStarted(); + PrinterUpdate::jobStarted(); } -// ----------------------------------------------------------------------- - -void x11::PrinterUpdate::jobEnded() +void PrinterUpdate::jobEnded() { nActiveJobs--; if( nActiveJobs < 1 ) @@ -1485,9 +1410,9 @@ void x11::PrinterUpdate::jobEnded() } } -void X11SalInstance::jobEndedPrinterUpdate() +void GenericInstance::jobEndedPrinterUpdate() { - x11::PrinterUpdate::jobEnded(); + PrinterUpdate::jobEnded(); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/generic/printergfx/glyphset.cxx b/vcl/generic/print/glyphset.cxx index a49e5a0e21a7..b040e631e766 100644 --- a/vcl/unx/generic/printergfx/glyphset.cxx +++ b/vcl/generic/print/glyphset.cxx @@ -34,7 +34,7 @@ #include "sft.hxx" -#include "printergfx.hxx" +#include "generic/printergfx.hxx" #include "fontsubset.hxx" #include "vcl/fontmanager.hxx" diff --git a/vcl/unx/generic/printergfx/glyphset.hxx b/vcl/generic/print/glyphset.hxx index c8b009c91155..c8b009c91155 100644 --- a/vcl/unx/generic/printergfx/glyphset.hxx +++ b/vcl/generic/print/glyphset.hxx diff --git a/vcl/unx/generic/printergfx/printerjob.cxx b/vcl/generic/print/printerjob.cxx index c6fa885acc4c..5b3d8668082e 100644 --- a/vcl/unx/generic/printergfx/printerjob.cxx +++ b/vcl/generic/print/printerjob.cxx @@ -39,8 +39,8 @@ #include "psputil.hxx" #include "glyphset.hxx" -#include "printerjob.hxx" -#include "printergfx.hxx" +#include "generic/printerjob.hxx" +#include "generic/printergfx.hxx" #include "vcl/ppdparser.hxx" #include "vcl/strhelper.hxx" #include "vcl/printerinfomanager.hxx" diff --git a/vcl/unx/generic/printergfx/psheader.ps b/vcl/generic/print/psheader.ps index 6a0e350d9ddc..6a0e350d9ddc 100644 --- a/vcl/unx/generic/printergfx/psheader.ps +++ b/vcl/generic/print/psheader.ps diff --git a/vcl/unx/generic/gdi/pspgraphics.cxx b/vcl/generic/print/pspgraphics.cxx index a3cae9210c06..c99ae54b4ed5 100644 --- a/vcl/unx/generic/gdi/pspgraphics.cxx +++ b/vcl/generic/print/pspgraphics.cxx @@ -36,8 +36,9 @@ #include <sys/stat.h> #include <sys/types.h> -#include "unx/pspgraphics.h" -#include "unx/glyphcache.hxx" +#include "generic/geninst.h" +#include "generic/pspgraphics.h" +#include "generic/glyphcache.hxx" #include "vcl/jobdata.hxx" #include "vcl/printerinfomanager.hxx" @@ -45,7 +46,7 @@ #include "vcl/svapp.hxx" #include "vcl/sysdata.hxx" -#include "printergfx.hxx" +#include "generic/printergfx.hxx" #include "salbmp.hxx" #include "impfont.hxx" #include "outfont.hxx" @@ -862,8 +863,6 @@ bool PspGraphics::AddTempDevFont( ImplDevFontList*, const String&,const String& return false; } -void RegisterFontSubstitutors( ImplDevFontList* ); - void PspGraphics::GetDevFontList( ImplDevFontList *pList ) { ::std::list< psp::fontID > aList; @@ -878,7 +877,7 @@ void PspGraphics::GetDevFontList( ImplDevFontList *pList ) // register platform specific font substitutions if available if( rMgr.hasFontconfig() ) - RegisterFontSubstitutors( pList ); + GenericInstance::RegisterFontSubstitutors( pList ); } void PspGraphics::GetDevFontSubstList( OutputDevice* pOutDev ) diff --git a/vcl/unx/generic/printergfx/psputil.cxx b/vcl/generic/print/psputil.cxx index 2664bac8d022..2664bac8d022 100644 --- a/vcl/unx/generic/printergfx/psputil.cxx +++ b/vcl/generic/print/psputil.cxx diff --git a/vcl/unx/generic/printergfx/psputil.hxx b/vcl/generic/print/psputil.hxx index 2aaffda6519f..2aaffda6519f 100644 --- a/vcl/unx/generic/printergfx/psputil.hxx +++ b/vcl/generic/print/psputil.hxx diff --git a/vcl/unx/generic/printergfx/text_gfx.cxx b/vcl/generic/print/text_gfx.cxx index 14dd8c332d27..ca79b86564b3 100644 --- a/vcl/unx/generic/printergfx/text_gfx.cxx +++ b/vcl/generic/print/text_gfx.cxx @@ -34,7 +34,7 @@ #include "psputil.hxx" #include "glyphset.hxx" -#include "printergfx.hxx" +#include "generic/printergfx.hxx" #include "vcl/fontmanager.hxx" #include "vcl/helper.hxx" 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 diff --git a/vcl/unx/generic/app/salinst.cxx b/vcl/unx/generic/app/salinst.cxx index 07ad6f304d3a..514ff82ee3fb 100644 --- a/vcl/unx/generic/app/salinst.cxx +++ b/vcl/unx/generic/app/salinst.cxx @@ -41,7 +41,7 @@ #include "unx/saldisp.hxx" #include "unx/salinst.h" #include "unx/salframe.h" -#include "unx/salprn.h" +#include "generic/genprn.h" #include "unx/sm.hxx" #include "vcl/apptypes.hxx" diff --git a/vcl/unx/generic/gdi/gcach_xpeer.hxx b/vcl/unx/generic/gdi/gcach_xpeer.hxx index de019d74d6c4..df5f5168535c 100644 --- a/vcl/unx/generic/gdi/gcach_xpeer.hxx +++ b/vcl/unx/generic/gdi/gcach_xpeer.hxx @@ -33,7 +33,7 @@ #include <X11/extensions/Xrender.h> #include <tools/postx.h> -#include "unx/glyphcache.hxx" +#include "generic/glyphcache.hxx" class SalDisplay; struct MultiScreenGlyph; diff --git a/vcl/unx/generic/gdi/salgdi.cxx b/vcl/unx/generic/gdi/salgdi.cxx index b1b8d337430d..1eb14c5d3192 100644 --- a/vcl/unx/generic/gdi/salgdi.cxx +++ b/vcl/unx/generic/gdi/salgdi.cxx @@ -52,7 +52,7 @@ #include "unx/salframe.h" #include "unx/salvd.h" -#include "printergfx.hxx" +#include "generic/printergfx.hxx" #include "xrender_peer.hxx" #include "region.h" diff --git a/vcl/unx/generic/gdi/salgdi2.cxx b/vcl/unx/generic/gdi/salgdi2.cxx index 1382fff3d1c1..a73a3caaf9e1 100644 --- a/vcl/unx/generic/gdi/salgdi2.cxx +++ b/vcl/unx/generic/gdi/salgdi2.cxx @@ -43,7 +43,7 @@ #include "unx/salvd.h" #include "xrender_peer.hxx" -#include "printergfx.hxx" +#include "generic/printergfx.hxx" #include "vcl/bmpacc.hxx" #include <outdata.hxx> diff --git a/vcl/unx/generic/gdi/salgdi3.cxx b/vcl/unx/generic/gdi/salgdi3.cxx index 0ced0200b194..79139392c664 100644 --- a/vcl/unx/generic/gdi/salgdi3.cxx +++ b/vcl/unx/generic/gdi/salgdi3.cxx @@ -58,7 +58,7 @@ #include <boost/unordered_set.hpp> #include <vcl/sysdata.hxx> -#include "printergfx.hxx" +#include "generic/printergfx.hxx" #include "vcl/fontmanager.hxx" #include "vcl/jobdata.hxx" #include "vcl/printerinfomanager.hxx" @@ -68,7 +68,7 @@ #include "unx/saldata.hxx" #include "unx/saldisp.hxx" #include "unx/salgdi.h" -#include "unx/pspgraphics.h" +#include "generic/pspgraphics.h" #include "unx/salvd.h" #include "gcach_xpeer.hxx" @@ -601,7 +601,7 @@ void X11SalGraphics::GetDevFontList( ImplDevFontList *pList ) // register platform specific font substitutions if available if( rMgr.hasFontconfig() ) - RegisterFontSubstitutors( pList ); + GenericInstance::RegisterFontSubstitutors( pList ); ImplGetSVData()->maGDIData.mbNativeFontConfig = rMgr.hasFontconfig(); } @@ -839,181 +839,4 @@ void X11SalGraphics::GetGlyphWidths( const ImplFontData* pFont, PspGraphics::DoGetGlyphWidths( aFont, bVertical, rWidths, rUnicodeEnc ); } -// =========================================================================== -// platform specific font substitution hooks - -class FcPreMatchSubstititution -: public ImplPreMatchFontSubstitution -{ -public: - bool FindFontSubstitute( ImplFontSelectData& ) const; -}; - -class FcGlyphFallbackSubstititution -: public ImplGlyphFallbackFontSubstitution -{ - // TODO: add a cache -public: - bool FindFontSubstitute( ImplFontSelectData&, OUString& rMissingCodes ) const; -}; - -void RegisterFontSubstitutors( ImplDevFontList* pList ) -{ - // init font substitution defaults - int nDisableBits = 0; -#ifdef SOLARIS - nDisableBits = 1; // disable "font fallback" here on default -#endif - // apply the environment variable if any - const char* pEnvStr = ::getenv( "SAL_DISABLE_FC_SUBST" ); - if( pEnvStr ) - { - if( (*pEnvStr >= '0') && (*pEnvStr <= '9') ) - nDisableBits = (*pEnvStr - '0'); - else - nDisableBits = ~0U; // no specific bits set: disable all - } - - // register font fallback substitutions (unless disabled by bit0) - if( (nDisableBits & 1) == 0 ) - { - static FcPreMatchSubstititution aSubstPreMatch; - pList->SetPreMatchHook( &aSubstPreMatch ); - } - - // register glyph fallback substitutions (unless disabled by bit1) - if( (nDisableBits & 2) == 0 ) - { - static FcGlyphFallbackSubstititution aSubstFallback; - pList->SetFallbackHook( &aSubstFallback ); - } -} - -// ----------------------------------------------------------------------- - -static ImplFontSelectData GetFcSubstitute(const ImplFontSelectData &rFontSelData, OUString& rMissingCodes ) -{ - ImplFontSelectData aRet(rFontSelData); - - const rtl::OString aLangAttrib = MsLangId::convertLanguageToIsoByteString( rFontSelData.meLanguage ); - - FontItalic eItalic = rFontSelData.GetSlant(); - FontWeight eWeight = rFontSelData.GetWeight(); - FontWidth eWidth = rFontSelData.GetWidthType(); - FontPitch ePitch = rFontSelData.GetPitch(); - - const psp::PrintFontManager& rMgr = psp::PrintFontManager::get(); - aRet.maSearchName = rMgr.Substitute( rFontSelData.maTargetName, rMissingCodes, aLangAttrib, eItalic, eWeight, eWidth, ePitch); - - aRet.meItalic = eItalic; - aRet.meWeight = eWeight; - aRet.meWidthType = eWidth; - aRet.mePitch = ePitch; - - return aRet; -} - -namespace -{ - bool uselessmatch(const ImplFontSelectData &rOrig, const ImplFontSelectData &rNew) - { - return - ( - rOrig.maTargetName == rNew.maSearchName && - rOrig.meWeight == rNew.meWeight && - rOrig.meItalic == rNew.meItalic && - rOrig.mePitch == rNew.mePitch && - rOrig.meWidthType == rNew.meWidthType - ); - } -} - -//-------------------------------------------------------------------------- - -bool FcPreMatchSubstititution::FindFontSubstitute( ImplFontSelectData &rFontSelData ) const -{ - // We dont' actually want to talk to Fontconfig at all for symbol fonts - if( rFontSelData.IsSymbolFont() ) - return false; - // StarSymbol is a unicode font, but it still deserves the symbol flag - if( 0 == rFontSelData.maSearchName.CompareIgnoreCaseToAscii( "starsymbol", 10) - || 0 == rFontSelData.maSearchName.CompareIgnoreCaseToAscii( "opensymbol", 10) ) - return false; - - //Note: see fdo#41556 if you feel compelled to cache the results here, - //remember that fontconfig can return e.g. an italic font for a non-italic - //input and/or different fonts depending on fontsize, bold, etc settings so - //don't cache just on the name, cache on all the input and be don't just - //return the original selection data with the fontname updated - rtl::OUString aDummy; - const ImplFontSelectData aOut = GetFcSubstitute( rFontSelData, aDummy ); - - if( !aOut.maSearchName.Len() ) - return false; - - const bool bHaveSubstitute = !uselessmatch( rFontSelData, aOut ); - -#ifdef DEBUG - const ByteString aOrigName( rFontSelData.maTargetName, RTL_TEXTENCODING_UTF8 ); - const ByteString aSubstName( aOut.maSearchName, RTL_TEXTENCODING_UTF8 ); - printf( "FcPreMatchSubstititution \"%s\" bipw=%d%d%d%d -> ", - aOrigName.GetBuffer(), rFontSelData.meWeight, rFontSelData.meItalic, - rFontSelData.mePitch, rFontSelData.meWidthType ); - if( !bHaveSubstitute ) - printf( "no substitute available\n" ); - else - printf( "\"%s\" bipw=%d%d%d%d\n", aSubstName.GetBuffer(), - aOut.meWeight, aOut.meItalic, aOut.mePitch, aOut.meWidthType ); -#endif - - if( bHaveSubstitute ) - rFontSelData = aOut; - - return bHaveSubstitute; -} - -// ----------------------------------------------------------------------- - -bool FcGlyphFallbackSubstititution::FindFontSubstitute( ImplFontSelectData& rFontSelData, - rtl::OUString& rMissingCodes ) const -{ - // We dont' actually want to talk to Fontconfig at all for symbol fonts - if( rFontSelData.IsSymbolFont() ) - return false; - // StarSymbol is a unicode font, but it still deserves the symbol flag - if( 0 == rFontSelData.maSearchName.CompareIgnoreCaseToAscii( "starsymbol", 10) - || 0 == rFontSelData.maSearchName.CompareIgnoreCaseToAscii( "opensymbol", 10) ) - return false; - - const ImplFontSelectData aOut = GetFcSubstitute( rFontSelData, rMissingCodes ); - // TODO: cache the unicode + srcfont specific result - // FC doing it would be preferable because it knows the invariables - // e.g. FC knows the FC rule that all Arial gets replaced by LiberationSans - // whereas we would have to check for every size or attribute - if( !aOut.maSearchName.Len() ) - return false; - - const bool bHaveSubstitute = !uselessmatch( rFontSelData, aOut ); - -#ifdef DEBUG - const ByteString aOrigName( rFontSelData.maTargetName, RTL_TEXTENCODING_UTF8 ); - const ByteString aSubstName( aOut.maSearchName, RTL_TEXTENCODING_UTF8 ); - printf( "FcGFSubstititution \"%s\" bipw=%d%d%d%d ->", - aOrigName.GetBuffer(), rFontSelData.meWeight, rFontSelData.meItalic, - rFontSelData.mePitch, rFontSelData.meWidthType ); - if( !bHaveSubstitute ) - printf( "no substitute available\n" ); - else - printf( "\"%s\" bipw=%d%d%d%d\n", aSubstName.GetBuffer(), - aOut.meWeight, aOut.meItalic, aOut.mePitch, aOut.meWidthType ); -#endif - - if( bHaveSubstitute ) - rFontSelData = aOut; - - return bHaveSubstitute; -} - -// =========================================================================== - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/generic/window/salframe.cxx b/vcl/unx/generic/window/salframe.cxx index f027d50b9c6d..85a11ecf5d5e 100644 --- a/vcl/unx/generic/window/salframe.cxx +++ b/vcl/unx/generic/window/salframe.cxx @@ -62,7 +62,7 @@ #include "unx/soicon.hxx" #include "unx/sm.hxx" #include "unx/wmadaptor.hxx" -#include "unx/salprn.h" +#include "generic/genprn.h" #include "unx/salbmp.h" #include "unx/i18n_ic.hxx" #include "unx/i18n_keysym.hxx" diff --git a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx index d168917842a2..cb1a6f8aba13 100644 --- a/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx +++ b/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx @@ -36,7 +36,7 @@ #include "unx/gtk/gtkinst.hxx" #include "unx/gtk/gtkgdi.hxx" -#include "unx/pspgraphics.h" +#include "generic/pspgraphics.h" #include "unx/saldata.hxx" #include "unx/saldisp.hxx" diff --git a/vcl/unx/gtk/window/gtkframe.cxx b/vcl/unx/gtk/window/gtkframe.cxx index cd5059a0b13c..9775dbcdabd4 100644 --- a/vcl/unx/gtk/window/gtkframe.cxx +++ b/vcl/unx/gtk/window/gtkframe.cxx @@ -37,7 +37,7 @@ #include <unx/wmadaptor.hxx> #include <unx/sm.hxx> #include <unx/salbmp.h> -#include <unx/salprn.h> +#include <generic/genprn.h> #include <unx/headless/svpgdi.hxx> #include <vcl/floatwin.hxx> #include <vcl/svapp.hxx> diff --git a/vcl/unx/headless/svpprn.cxx b/vcl/unx/headless/svpprn.cxx index df159987ca35..5fe71e052082 100644 --- a/vcl/unx/headless/svpprn.cxx +++ b/vcl/unx/headless/svpprn.cxx @@ -319,110 +319,4 @@ sal_Bool SvpSalInfoPrinter::Setup( SalFrame*, ImplJobSetup* ) return sal_False; } -/* - * svp::PrinterUpdate - */ - -namespace svp -{ - class PrinterUpdate - { - static Timer* pPrinterUpdateTimer; - static int nActiveJobs; - - static void doUpdate(); - DECL_STATIC_LINK( PrinterUpdate, UpdateTimerHdl, void* ); - public: - static void update(); - static void jobStarted() { nActiveJobs++; } - static void jobEnded(); - }; -} - -Timer* svp::PrinterUpdate::pPrinterUpdateTimer = NULL; -int svp::PrinterUpdate::nActiveJobs = 0; - -void svp::PrinterUpdate::doUpdate() -{ - ::psp::PrinterInfoManager& rManager( ::psp::PrinterInfoManager::get() ); - SalInstance *pInst = GetSalData()->m_pInstance; - if( pInst && rManager.checkPrintersChanged( false ) ) - pInst->PostPrintersChanged(); -} - -// ----------------------------------------------------------------------- - -IMPL_STATIC_LINK_NOINSTANCE( svp::PrinterUpdate, UpdateTimerHdl, void*, ) -{ - if( nActiveJobs < 1 ) - { - doUpdate(); - delete pPrinterUpdateTimer; - pPrinterUpdateTimer = NULL; - } - else - pPrinterUpdateTimer->Start(); - - return 0; -} - -// ----------------------------------------------------------------------- - -void svp::PrinterUpdate::update() -{ - if( Application::GetSettings().GetMiscSettings().GetDisablePrinting() ) - return; - - static bool bOnce = false; - if( ! bOnce ) - { - bOnce = true; - // start background printer detection - psp::PrinterInfoManager::get(); - return; - } - - if( nActiveJobs < 1 ) - doUpdate(); - else if( ! pPrinterUpdateTimer ) - { - pPrinterUpdateTimer = new Timer(); - pPrinterUpdateTimer->SetTimeout( 500 ); - pPrinterUpdateTimer->SetTimeoutHdl( STATIC_LINK( NULL, svp::PrinterUpdate, UpdateTimerHdl ) ); - pPrinterUpdateTimer->Start(); - } -} - -void SvpSalInstance::updatePrinterUpdate() -{ - svp::PrinterUpdate::update(); -} - -// ----------------------------------------------------------------------- - -void svp::PrinterUpdate::jobEnded() -{ - nActiveJobs--; - if( nActiveJobs < 1 ) - { - if( pPrinterUpdateTimer ) - { - pPrinterUpdateTimer->Stop(); - delete pPrinterUpdateTimer; - pPrinterUpdateTimer = NULL; - doUpdate(); - } - } -} - -void SvpSalInstance::jobStartedPrinterUpdate() -{ - svp::PrinterUpdate::jobStarted(); -} - -void SvpSalInstance::jobEndedPrinterUpdate() -{ - svp::PrinterUpdate::jobEnded(); -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/unx/headless/svppspgraphics.cxx b/vcl/unx/headless/svppspgraphics.cxx index 0e6832efc694..cff75c3751c0 100644 --- a/vcl/unx/headless/svppspgraphics.cxx +++ b/vcl/unx/headless/svppspgraphics.cxx @@ -52,10 +52,10 @@ #include "impfont.hxx" #include "outfont.hxx" #include "fontsubset.hxx" -#include "printergfx.hxx" +#include "generic/printergfx.hxx" #include "unx/headless/svppspgraphics.hxx" #include "unx/headless/svpbmp.hxx" -#include "unx/glyphcache.hxx" +#include "generic/glyphcache.hxx" #include "region.h" using namespace psp; diff --git a/vcl/unx/headless/svptext.cxx b/vcl/unx/headless/svptext.cxx index 9f3a0167f24d..9aa0eeb7f2c6 100644 --- a/vcl/unx/headless/svptext.cxx +++ b/vcl/unx/headless/svptext.cxx @@ -42,7 +42,7 @@ #include <impfont.hxx> #include <rtl/instance.hxx> -#include "unx/glyphcache.hxx" +#include "generic/glyphcache.hxx" #include "unx/headless/svpgdi.hxx" #include "unx/headless/svpbmp.hxx" #include "unx/headless/svppspgraphics.hxx" |