diff options
29 files changed, 448 insertions, 355 deletions
diff --git a/vcl/Library_desktop_detector.mk b/vcl/Library_desktop_detector.mk index 49151cb19ff5..7963b1cfe5d5 100644 --- a/vcl/Library_desktop_detector.mk +++ b/vcl/Library_desktop_detector.mk @@ -37,7 +37,6 @@ $(eval $(call gb_Library_set_include,desktop_detector,\ -I$(SRCDIR)/vcl/inc/pch \ -I$(SRCDIR)/solenv/inc \ -I$(OUTDIR)/inc/offuh \ - -I$(OUTDIR)/inc/stl \ -I$(OUTDIR)/inc \ )) @@ -61,10 +60,8 @@ $(eval $(call gb_Library_add_linked_libs,desktop_detector,\ i18npaper \ i18nutil \ jvmaccess \ - stl \ cppu \ sal \ - vos3 \ X11 \ Xext \ SM \ diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk index e8ad1bcaed64..f7e8e25693d5 100755 --- a/vcl/Library_vcl.mk +++ b/vcl/Library_vcl.mk @@ -36,6 +36,7 @@ $(eval $(call gb_Library_set_componentfile,vcl,vcl/vcl.unx)) endif $(eval $(call gb_Library_add_package_headers,vcl,vcl_inc)) +$(eval $(call gb_Library_add_package_headers,vcl,vcl_afmhash)) $(eval $(call gb_Library_set_include,vcl,\ $$(INCLUDE) \ @@ -43,8 +44,8 @@ $(eval $(call gb_Library_set_include,vcl,\ -I$(SRCDIR)/vcl/inc/pch \ -I$(SRCDIR)/solenv/inc \ -I$(OUTDIR)/inc/offuh \ - -I$(OUTDIR)/inc/stl \ -I$(OUTDIR)/inc \ + -I$(WORKDIR)/CustomTarget/vcl/unx/generic/fontmanager \ )) ifeq ($(GUIBASE),unx) $(eval $(call gb_Library_set_cxxflags,vcl,\ @@ -74,10 +75,8 @@ $(eval $(call gb_Library_add_linked_libs,vcl,\ i18npaper \ i18nutil \ jvmaccess \ - stl \ cppu \ sal \ - vos3 \ $(gb_STDLIBS) \ )) @@ -251,6 +250,7 @@ $(eval $(call gb_Library_add_exception_objects,vcl,\ vcl/source/app/salvtables \ vcl/source/app/session \ vcl/source/app/settings \ + vcl/source/app/solarmutex \ vcl/source/app/sound \ vcl/source/app/stdtext \ vcl/source/app/svapp \ @@ -428,14 +428,11 @@ $(eval $(call gb_Library_set_defs,vcl,\ -DENABLE_GRAPHITE \ )) $(eval $(call gb_Library_add_exception_objects,vcl,\ - vcl/source/glyphs/graphite_cache \ vcl/source/glyphs/graphite_features \ vcl/source/glyphs/graphite_layout \ - vcl/source/glyphs/graphite_textsrc \ )) ifeq ($(GUIBASE),unx) $(eval $(call gb_Library_add_exception_objects,vcl,\ - vcl/source/glyphs/graphite_adaptors \ vcl/source/glyphs/graphite_serverfont \ )) ifeq ($(SYSTEM_GRAPHITE),YES) @@ -445,7 +442,7 @@ $(eval $(call gb_Library_set_ldflags,vcl,\ )) else $(eval $(call gb_Library_add_linked_static_libs,vcl,\ - graphite \ + graphite2_off \ )) endif endif diff --git a/vcl/Library_vclplug_gen.mk b/vcl/Library_vclplug_gen.mk index 52f4d7a362e9..494f36acc349 100755 --- a/vcl/Library_vclplug_gen.mk +++ b/vcl/Library_vclplug_gen.mk @@ -33,7 +33,6 @@ $(eval $(call gb_Library_set_include,vclplug_gen,\ -I$(SRCDIR)/vcl/inc/pch \ -I$(SRCDIR)/solenv/inc \ -I$(OUTDIR)/inc/offuh \ - -I$(OUTDIR)/inc/stl \ -I$(OUTDIR)/inc \ )) @@ -52,10 +51,8 @@ $(eval $(call gb_Library_add_linked_libs,vclplug_gen,\ i18npaper \ i18nutil \ jvmaccess \ - stl \ cppu \ sal \ - vos3 \ X11 \ Xext \ SM \ diff --git a/vcl/Library_vclplug_gtk.mk b/vcl/Library_vclplug_gtk.mk index feb63e06e794..62f5c334a23c 100755 --- a/vcl/Library_vclplug_gtk.mk +++ b/vcl/Library_vclplug_gtk.mk @@ -33,7 +33,6 @@ $(eval $(call gb_Library_set_include,vclplug_gtk,\ -I$(SRCDIR)/vcl/inc/pch \ -I$(SRCDIR)/solenv/inc \ -I$(OUTDIR)/inc/offuh \ - -I$(OUTDIR)/inc/stl \ -I$(OUTDIR)/inc \ )) @@ -81,10 +80,8 @@ $(eval $(call gb_Library_add_linked_libs,vclplug_gtk,\ i18npaper \ i18nutil \ jvmaccess \ - stl \ cppu \ sal \ - vos3 \ X11 \ Xext \ SM \ diff --git a/vcl/Library_vclplug_kde.mk b/vcl/Library_vclplug_kde.mk index a3fc45513707..efb134d912ac 100755 --- a/vcl/Library_vclplug_kde.mk +++ b/vcl/Library_vclplug_kde.mk @@ -33,7 +33,6 @@ $(eval $(call gb_Library_set_include,vclplug_kde,\ -I$(SRCDIR)/vcl/inc/pch \ -I$(SRCDIR)/solenv/inc \ -I$(OUTDIR)/inc/offuh \ - -I$(OUTDIR)/inc/stl \ -I$(OUTDIR)/inc \ )) @@ -68,10 +67,8 @@ $(eval $(call gb_Library_add_linked_libs,vclplug_kde,\ i18npaper \ i18nutil \ jvmaccess \ - stl \ cppu \ sal \ - vos3 \ X11 \ Xext \ SM \ diff --git a/vcl/Library_vclplug_kde4.mk b/vcl/Library_vclplug_kde4.mk index 30fc756b4a35..e7160ee55906 100755 --- a/vcl/Library_vclplug_kde4.mk +++ b/vcl/Library_vclplug_kde4.mk @@ -33,7 +33,6 @@ $(eval $(call gb_Library_set_include,vclplug_kde4,\ -I$(SRCDIR)/vcl/inc/pch \ -I$(SRCDIR)/solenv/inc \ -I$(OUTDIR)/inc/offuh \ - -I$(OUTDIR)/inc/stl \ -I$(OUTDIR)/inc \ )) @@ -68,10 +67,8 @@ $(eval $(call gb_Library_add_linked_libs,vclplug_kde4,\ i18npaper \ i18nutil \ jvmaccess \ - stl \ cppu \ sal \ - vos3 \ X11 \ Xext \ SM \ diff --git a/vcl/Library_vclplug_svp.mk b/vcl/Library_vclplug_svp.mk index 3051c0ce863e..e62e50beeaa0 100755 --- a/vcl/Library_vclplug_svp.mk +++ b/vcl/Library_vclplug_svp.mk @@ -33,7 +33,6 @@ $(eval $(call gb_Library_set_include,vclplug_svp,\ -I$(SRCDIR)/vcl/inc/pch \ -I$(SRCDIR)/solenv/inc \ -I$(OUTDIR)/inc/offuh \ - -I$(OUTDIR)/inc/stl \ -I$(OUTDIR)/inc \ )) @@ -44,6 +43,7 @@ $(eval $(call gb_Library_set_defs,vclplug_svp,\ $(eval $(call gb_Library_add_linked_libs,vclplug_svp,\ vcl \ + vclplug_gen \ tl \ utl \ sot \ @@ -58,10 +58,8 @@ $(eval $(call gb_Library_add_linked_libs,vclplug_svp,\ i18npaper \ i18nutil \ jvmaccess \ - stl \ cppu \ sal \ - vos3 \ X11 \ Xext \ SM \ diff --git a/vcl/Module_vcl.mk b/vcl/Module_vcl.mk index 929f60988bb1..895e479de822 100644 --- a/vcl/Module_vcl.mk +++ b/vcl/Module_vcl.mk @@ -40,6 +40,7 @@ $(eval $(call gb_Module_add_targets,vcl,\ Library_vclplug_gen \ Library_vclplug_svp \ Library_desktop_detector \ + Package_afmhash \ )) ifneq ($(ENABLE_GTK),) diff --git a/vcl/Package_afmhash.mk b/vcl/Package_afmhash.mk new file mode 100644 index 000000000000..d3de8357eb93 --- /dev/null +++ b/vcl/Package_afmhash.mk @@ -0,0 +1,29 @@ +# 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. 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. +# +# The Initial Developer of the Original Code is +# Bjoern Michaelsen <bjoern.michaelsen@canonical.com> (Canonical Ltd.) +# Portions created by the Initial Developer are Copyright (C) 2011 the +# Initial Developer. All Rights Reserved. +# +# Contributor(s): Jan Holesovsky <kendy@suse.cz> +# +# 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. + +$(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)) + +# vim: set noet sw=4: diff --git a/vcl/StaticLibrary_vclmain.mk b/vcl/StaticLibrary_vclmain.mk index ccf800b38ce6..cc38a2772d0f 100755 --- a/vcl/StaticLibrary_vclmain.mk +++ b/vcl/StaticLibrary_vclmain.mk @@ -33,7 +33,6 @@ $(eval $(call gb_StaticLibrary_set_include,vclmain,\ -I$(SRCDIR)/vcl/inc/pch \ -I$(SRCDIR)/solenv/inc \ -I$(OUTDIR)/inc/offuh \ - -I$(OUTDIR)/inc/stl \ -I$(OUTDIR)/inc \ )) @@ -49,7 +48,7 @@ $(call gb_StaticLibrary_get_target,vclmain) : $(OUTDIR)/lib/$(1) $$(eval $$(call gb_Deliver_add_deliverable,$(OUTDIR)/lib/$(1),$(call gb_CxxObject_get_target,vcl/source/salmain/salmain))) $(OUTDIR)/lib/$(1) : $(call gb_CxxObject_get_target,vcl/source/salmain/salmain) - $$(call gb_Deliver_deliver,$$<,$$@) + $$(call gb_Deliver_deliver,$$<,$$@) endef @@ -59,4 +58,4 @@ else $(eval $(call StaticLibrary_salmain_hack,salmain.o)) endif -# vim: set noet sw=4 ts=4: +# vim: set noet sw=4: diff --git a/vcl/inc/unx/salprn.h b/vcl/inc/unx/salprn.h index 783c85b160b5..e51a4b6d50f5 100644 --- a/vcl/inc/unx/salprn.h +++ b/vcl/inc/unx/salprn.h @@ -37,7 +37,7 @@ class PspGraphics; -class VCL_DLLPUBLIC PspSalInfoPrinter : public SalInfoPrinter +class VCLPLUG_GEN_PUBLIC PspSalInfoPrinter : public SalInfoPrinter { public: PspGraphics* m_pGraphics; @@ -64,7 +64,7 @@ public: virtual int GetLandscapeAngle( const ImplJobSetup* pSetupData ); }; -class VCL_DLLPUBLIC PspSalPrinter : public SalPrinter +class VCLPLUG_GEN_PUBLIC PspSalPrinter : public SalPrinter { public: String m_aFileName; diff --git a/vcl/source/app/svdata.cxx b/vcl/source/app/svdata.cxx index 409b4dee1da7..7648dbbae75c 100644 --- a/vcl/source/app/svdata.cxx +++ b/vcl/source/app/svdata.cxx @@ -42,8 +42,6 @@ #include "unotools/fontcfg.hxx" -#include "vos/mutex.hxx" - #include "cppuhelper/implbase1.hxx" #include "uno/current_context.hxx" diff --git a/vcl/source/app/svmain.cxx b/vcl/source/app/svmain.cxx index b54ebd855433..e1f9052792ff 100644 --- a/vcl/source/app/svmain.cxx +++ b/vcl/source/app/svmain.cxx @@ -31,10 +31,8 @@ #include "rtl/logfile.hxx" -#include "osl/file.hxx" - -#include "vos/signal.hxx" -#include "vos/process.hxx" +#include <osl/file.hxx> +#include <osl/signal.h> #include "tools/tools.h" #include "tools/debug.hxx" diff --git a/vcl/source/gdi/gdimtf.cxx b/vcl/source/gdi/gdimtf.cxx index ed15dfae81a2..93496bd2c2de 100644 --- a/vcl/source/gdi/gdimtf.cxx +++ b/vcl/source/gdi/gdimtf.cxx @@ -37,18 +37,20 @@ #include <vcl/window.hxx> #include <vcl/cvtsvm.hxx> #include <vcl/virdev.hxx> -#include <vcl/salbmp.hxx> #include <vcl/svapp.hxx> -#include <vcl/svdata.hxx> -#include <vcl/salinst.hxx> #include <vcl/gdimtf.hxx> #include <vcl/graphictools.hxx> #include <vcl/canvastools.hxx> #include <vcl/unohelp.hxx> +#include <salbmp.hxx> +#include <salinst.hxx> +#include <svdata.hxx> + #include <com/sun/star/beans/XFastPropertySet.hpp> -#include <com/sun/star/rendering/XCanvas.hpp> #include <com/sun/star/rendering/MtfRenderer.hpp> +#include <com/sun/star/rendering/XBitmapCanvas.hpp> +#include <com/sun/star/rendering/XCanvas.hpp> #include <comphelper/processfactory.hxx> #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/lang/XInitialization.hpp> diff --git a/vcl/source/gdi/outdev6.cxx b/vcl/source/gdi/outdev6.cxx index 2c0861ac9494..dd2d30642d25 100644 --- a/vcl/source/gdi/outdev6.cxx +++ b/vcl/source/gdi/outdev6.cxx @@ -1189,7 +1189,7 @@ void OutputDevice::ImplDraw2ColorFrame( const Rectangle& rRect, bool OutputDevice::DrawEPS( const Point& rPoint, const Size& rSize, const GfxLink& rGfxLink, GDIMetaFile* pSubst ) { - DBG_TRACE( "OutputDevice::DrawEPS()" ); + OSL_TRACE( "OutputDevice::DrawEPS()" ); bool bDrawn(true); @@ -1245,9 +1245,11 @@ bool OutputDevice::DrawEPS( const Point& rPoint, const Size& rSize, } // ------------------------------------------------------------------ + +void OutputDevice::DrawRenderGraphic( const Point& rPoint, const Size& rSize, const ::vcl::RenderGraphic& rRenderGraphic ) { - DBG_TRACE( "OutputDevice::DrawRenderGraphic()" ); + OSL_TRACE( "OutputDevice::DrawRenderGraphic()" ); if( mpMetaFile ) mpMetaFile->AddAction( new MetaRenderGraphicAction( rPoint, rSize, rRenderGraphic ) ); @@ -1263,5 +1265,6 @@ bool OutputDevice::DrawEPS( const Point& rPoint, const Size& rSize, DrawBitmapEx( rPoint, rSize, aRasterizer.Rasterize( aSizePixel ) ); mpMetaFile = pOldMetaFile; } +} -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/glyphs/gcach_ftyp.cxx b/vcl/source/glyphs/gcach_ftyp.cxx index c2b84a8e94a7..b92deb89a928 100644 --- a/vcl/source/glyphs/gcach_ftyp.cxx +++ b/vcl/source/glyphs/gcach_ftyp.cxx @@ -37,18 +37,16 @@ #include "gcach_ftyp.hxx" #include "vcl/svapp.hxx" - -#include "outfont.hxx" -#include "impfont.hxx" - +#include <outfont.hxx> +#include <impfont.hxx> #ifdef ENABLE_GRAPHITE #include <graphite2/Font.h> -#include "vcl/graphite_layout.hxx" +#include <graphite_layout.hxx> #endif #include "tools/poly.hxx" #include "basegfx/matrix/b2dhommatrix.hxx" -#include "basegfx/matrix/b2dhommatrixtools.hxx" +#include <basegfx/matrix/b2dhommatrixtools.hxx> #include "basegfx/polygon/b2dpolypolygon.hxx" #include "osl/file.hxx" diff --git a/vcl/source/glyphs/gcach_vdev.cxx b/vcl/source/glyphs/gcach_vdev.cxx new file mode 100644 index 000000000000..944d9aee16a3 --- /dev/null +++ b/vcl/source/glyphs/gcach_vdev.cxx @@ -0,0 +1,290 @@ +/* -*- 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 <gcach_vdev.hxx> + +#include <vcl/svapp.hxx> +#include <vcl/bitmap.hxx> +#include <vcl/outfont.hxx> +#include <vcl/virdev.hxx> +#include <vcl/metric.hxx> + +// ======================================================================= +// VirtDevServerFont +// ======================================================================= + +// ----------------------------------------------------------------------- + +void VirtDevServerFont::AnnounceFonts( ImplDevFontList* pToAdd ) +{ + // TODO: get fonts on server but not on client, + // problem is that currently there is no serverside virtual device... + VirtualDevice vdev( 1 ); + long nCount = vdev.GetDevFontCount(); + + for( int i = 0; i < nCount; ++i ) + { + const FontInfo aFontInfo = vdev.GetDevFont( i ); + + ImplFontData& rData = *new ImplFontData; + rData.SetSysData( new FontSysData( (void*)SERVERFONT_MAGIC ) ); + + rData.maName = aFontInfo.GetName(); + rData.maStyleName = aFontInfo.GetStyleName(); + rData.mnWidth = aFontInfo.GetWidth(); + rData.mnHeight = aFontInfo.GetHeight(); + rData.meFamily = aFontInfo.GetFamily(); + rData.meCharSet = aFontInfo.GetCharSet(); + rData.mePitch = aFontInfo.GetPitch(); + rData.meWidthType = aFontInfo.GetWidthType(); + rData.meWeight = aFontInfo.GetWeight(); + rData.meItalic = aFontInfo.GetItalic(); + rData.meType = aFontInfo.GetType(); + rData.meFamily = aFontInfo.GetFamily(); + + rData.mbOrientation = true; // TODO: where to get this info? + rData.mbDevice = false; + rData.mnQuality = 0; // prefer client-side fonts if available + + pToAdd->Add( &rData ); + } +} + +// ----------------------------------------------------------------------- + +void VirtDevServerFont::ClearFontList() +{ + // TODO +} + +// ----------------------------------------------------------------------- + +VirtDevServerFont* VirtDevServerFont::CreateFont( const ImplFontSelectData& rFSD ) +{ + VirtDevServerFont* pServerFont = NULL; + // TODO: search list of VirtDevServerFonts, return NULL if not found + // pServerFont = new VirtDevServerFont( rFSD ); + return pServerFont; +} + +// ----------------------------------------------------------------------- + +VirtDevServerFont::VirtDevServerFont( const ImplFontSelectData& rFSD ) +: ServerFont( rFSD) +{} + +// ----------------------------------------------------------------------- + +void VirtDevServerFont::FetchFontMetric( ImplFontMetricData& rTo, long& rFactor ) const +{ + const ImplFontSelectData& aFSD = GetFontSelData(); + + Font aFont; + aFont.SetName ( aFSD.maName ); + aFont.SetStyleName ( aFSD.maStyleName ); + aFont.SetHeight ( aFSD.mnHeight ); + aFont.SetWidth ( aFSD.mnWidth ); + aFont.SetOrientation( aFSD.mnOrientation ); + aFont.SetVertical ( GetFontSelData().mbVertical ); + + VirtualDevice vdev( 1 ); + FontMetric aMetric( vdev.GetFontMetric( aFont ) ); + + rFactor = 0x100; + + rTo.mnAscent = aMetric.GetAscent(); + rTo.mnDescent = aMetric.GetDescent(); + rTo.mnIntLeading = aMetric.GetIntLeading(); + rTo.mnExtLeading = aMetric.GetExtLeading(); + rTo.mnSlant = aMetric.GetSlant(); + rTo.meType = aMetric.GetType(); + rTo.mnFirstChar = 0x0020; // TODO: where to get this info? + rTo.mnLastChar = 0xFFFE; // TODO: where to get this info? + + rTo.mnWidth = aFSD.mnWidth; + rTo.maName = aFSD.maName; + rTo.maStyleName = aFSD.maStyleName; + rTo.mnOrientation = aFSD.mnOrientation; + rTo.meFamily = aFSD.meFamily; + rTo.meCharSet = aFSD.meCharSet; + rTo.meWeight = aFSD.meWeight; + rTo.meItalic = aFSD.meItalic; + rTo.mePitch = aFSD.mePitch; + rTo.mbDevice = sal_False; +} + +// ----------------------------------------------------------------------- + +int VirtDevServerFont::GetGlyphIndex( sal_Unicode aChar ) const +{ + return aChar; +} + +// ----------------------------------------------------------------------- + +void VirtDevServerFont::InitGlyphData( int nGlyphIndex, GlyphData& rGD ) const +{ + Font aFont; + aFont.SetName ( GetFontSelData().maName ); + aFont.SetStyleName ( GetFontSelData().maStyleName ); + aFont.SetHeight ( GetFontSelData().mnHeight ); + aFont.SetWidth ( GetFontSelData().mnWidth ); + aFont.SetOrientation( GetFontSelData().mnOrientation ); + aFont.SetVertical ( GetFontSelData().mbVertical ); + + VirtualDevice vdev( 1 ); + vdev.SetFont( aFont ); + + // get glyph metrics + sal_Int32 nCharWidth = 10; +// TODO: vdev.GetCharWidth( nGlyphIndex, nGlyphIndex, &nCharWidth ); + rGD.SetCharWidth( nCharWidth ); + + sal_Unicode aChar = nGlyphIndex; + String aGlyphStr( &aChar, 1 ); + Rectangle aRect; + if( vdev.GetTextBoundRect( aRect, aGlyphStr, 0, 1 ) ) + { + rGD.SetOffset( aRect.Top(), aRect.Left() ); + rGD.SetDelta( vdev.GetTextWidth( nGlyphIndex ), 0 ); + rGD.SetSize( aRect.GetSize() ); + } +} + +// ----------------------------------------------------------------------- + +bool VirtDevServerFont::GetAntialiasAdvice( void ) const +{ + return false; +} + +// ----------------------------------------------------------------------- + +bool VirtDevServerFont::GetGlyphBitmap1( int nGlyphIndex, RawBitmap& ) const +{ + /* + sal_Unicode aChar = nGlyphIndex; + String aGlyphStr( &aChar, 1 ); + + // draw bitmap + vdev.SetOutputSizePixel( aSize, sal_True ); + vdev.DrawText( Point(0,0)-rGD.GetMetric().GetOffset(), aGlyphStr ); + + // create new glyph item + + const Bitmap& rBitmap = vdev.GetBitmap( Point(0,0), aSize ); + rGD.SetBitmap( new Bitmap( rBitmap ) ); + return true; + */ + return false; +} + +// ----------------------------------------------------------------------- + +bool VirtDevServerFont::GetGlyphBitmap8( int nGlyphIndex, RawBitmap& ) const +{ + return false; +} + +// ----------------------------------------------------------------------- + +int VirtDevServerFont::GetGlyphKernValue( int, int ) const +{ + return 0; +} + +// ----------------------------------------------------------------------- + +sal_uLong VirtDevServerFont::GetKernPairs( ImplKernPairData** ppImplKernPairs ) const +{ + Font aFont; + aFont.SetName ( GetFontSelData().maName ); + aFont.SetStyleName ( GetFontSelData().maStyleName ); + aFont.SetHeight ( GetFontSelData().mnHeight ); + aFont.SetWidth ( GetFontSelData().mnWidth ); + aFont.SetOrientation( GetFontSelData().mnOrientation ); + aFont.SetVertical ( GetFontSelData().mbVertical ); + + VirtualDevice vdev( 1 ); + vdev.SetFont( aFont ); + + sal_uLong nPairs = vdev.GetKerningPairCount(); + if( nPairs > 0 ) + { + KerningPair* const pKernPairs = new KerningPair[ nPairs ]; + vdev.GetKerningPairs( nPairs, pKernPairs ); + + *ppImplKernPairs = new ImplKernPairData[ nPairs ]; + ImplKernPairData* pTo = *ppImplKernPairs; + KerningPair* pFrom = pKernPairs; + for ( sal_uLong n = 0; n < nPairs; n++ ) + { + pTo->mnChar1 = pFrom->nChar1; + pTo->mnChar2 = pFrom->nChar2; + pTo->mnKern = pFrom->nKern; + ++pFrom; + ++pTo; + } + + delete[] pKernPairs; + } + + return nPairs; +} + +// ----------------------------------------------------------------------- + +bool VirtDevServerFont::GetGlyphOutline( int nGlyphIndex, PolyPolygon& rPolyPoly ) const +{ + return false; + /* + Font aFont; + aFont.SetName ( GetFontSelData().maName ); + aFont.SetStyleName ( GetFontSelData().maStyleName ); + aFont.SetHeight ( GetFontSelData().mnHeight ); + aFont.SetWidth ( GetFontSelData().mnWidth ); + aFont.SetOrientation( GetFontSelData().mnOrientation ); + aFont.SetVertical ( GetFontSelData().mbVertical ); + + VirtualDevice vdev( 1 ); + vdev.SetFont( aFont ); + + const bool bOptimize = true; + + sal_Unicode aChar = nGlyphIndex; + String aGlyphStr( &aChar, 1 ); + return vdev.GetTextOutline( rPolyPoly, aGlyphStr, 0, 1, bOptimize ); + */ +} + +// ======================================================================= + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/glyphs/gcach_vdev.hxx b/vcl/source/glyphs/gcach_vdev.hxx new file mode 100644 index 000000000000..61cd02b1f9cc --- /dev/null +++ b/vcl/source/glyphs/gcach_vdev.hxx @@ -0,0 +1,60 @@ +/* -*- 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. + * + ************************************************************************/ + +#include <vcl/glyphcache.hxx> + +// ----------------------------------------------------------------------- + +class VirtDevServerFont : public ServerFont +{ +public: + virtual bool GetAntialiasAdvice( void ) const; + virtual bool GetGlyphBitmap1( int nGlyphIndex, RawBitmap& ) const; + virtual bool GetGlyphBitmap8( int nGlyphIndex, RawBitmap& ) const; + virtual bool GetGlyphOutline( int nGlyphIndex, PolyPolygon& ) const; + +protected: + friend class GlyphCache; + static void AnnounceFonts( ImplDevFontList* ); + static void ClearFontList(); + + static VirtDevServerFont* CreateFont( const ImplFontSelectData& ); + virtual void FetchFontMetric( ImplFontMetricData&, long& rFactor ) const; + virtual sal_uLong GetKernPairs( ImplKernPairData** ) const; + virtual int GetGlyphKernValue( int, int ) const; + + virtual int GetGlyphIndex( sal_Unicode ) const; + virtual void InitGlyphData( int nGlyphIndex, GlyphData& ) const; + +private: + VirtDevServerFont( const ImplFontSelectData& ); +}; + +// ----------------------------------------------------------------------- + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/glyphs/glyphcache.cxx b/vcl/source/glyphs/glyphcache.cxx index 54e946dc3831..c12eb1cabcf5 100644 --- a/vcl/source/glyphs/glyphcache.cxx +++ b/vcl/source/glyphs/glyphcache.cxx @@ -32,13 +32,11 @@ #include <stdio.h> #include <stdlib.h> #include <math.h> - +#include <vcl/salbtype.hxx> #include <gcach_ftyp.hxx> #include <vcl/svapp.hxx> #include <vcl/bitmap.hxx> -#include <vcl/salbtype.hxx> - #include <outfont.hxx> #ifdef ENABLE_GRAPHITE diff --git a/vcl/source/glyphs/graphite_layout.cxx b/vcl/source/glyphs/graphite_layout.cxx index b43a57b93392..44fab8c7a3e7 100644 --- a/vcl/source/glyphs/graphite_layout.cxx +++ b/vcl/source/glyphs/graphite_layout.cxx @@ -54,7 +54,6 @@ // Platform #include <svsys.h> -#include <graphite_adaptors.hxx> #include <salgdi.hxx> @@ -65,8 +64,8 @@ // Graphite Libraries (must be after vcl headers on windows) #include <graphite2/Segment.h> -#include "vcl/graphite_layout.hxx" -#include "vcl/graphite_features.hxx" +#include <graphite_layout.hxx> +#include <graphite_features.hxx> // Module private type definitions and forward declarations. // diff --git a/vcl/source/glyphs/graphite_serverfont.cxx b/vcl/source/glyphs/graphite_serverfont.cxx index 4ce0ebcc3f31..1f9ee322455a 100644 --- a/vcl/source/glyphs/graphite_serverfont.cxx +++ b/vcl/source/glyphs/graphite_serverfont.cxx @@ -37,9 +37,10 @@ // Platform #include <i18npool/mslangid.hxx> +#include <sallayout.hxx> // Module #include "gcach_ftyp.hxx" -#include <vcl/glyphcache.hxx> +#include <glyphcache.hxx> #include <graphite_features.hxx> //#include "graphite_textsrc.hxx" #include <graphite_serverfont.hxx> diff --git a/vcl/source/glyphs/graphite_textsrc.cxx b/vcl/source/glyphs/graphite_textsrc.cxx deleted file mode 100644 index 0758c10564c6..000000000000 --- a/vcl/source/glyphs/graphite_textsrc.cxx +++ /dev/null @@ -1,172 +0,0 @@ -/* -*- 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" - -// We need this to enable namespace support in libgrengine headers. -#define GR_NAMESPACE - -// Header files -// -// Standard Library -#include <string> -#include <cassert> -#include "graphite_textsrc.hxx" -#include <graphite_features.hxx> - -// class TextSourceAdaptor implementation. -// -TextSourceAdaptor::~TextSourceAdaptor() -{ - delete mpFeatures; -} - -gr::UtfType TextSourceAdaptor::utfEncodingForm() { - return gr::kutf16; -} - - -size_t TextSourceAdaptor::getLength() -{ - return maLayoutArgs.mnLength; -} - - -size_t TextSourceAdaptor::fetch(gr::toffset, size_t, gr::utf32 *) -{ - assert(false); - return 0; -} - - -size_t TextSourceAdaptor::fetch(gr::toffset offset, size_t char_count, gr::utf16 * char_buffer) -{ - assert(char_buffer); - - size_t copy_count = std::min(size_t(maLayoutArgs.mnLength), char_count); - std::copy(maLayoutArgs.mpStr + offset, maLayoutArgs.mpStr + offset + copy_count, char_buffer); - - return copy_count; -} - - -size_t TextSourceAdaptor::fetch(gr::toffset, size_t, gr::utf8 *) -{ - assert(false); - return 0; -} - - -inline void TextSourceAdaptor::getCharProperties(const int nCharIdx, int & min, int & lim, size_t & depth) -{ - maLayoutArgs.ResetPos(); - bool rtl = maLayoutArgs.mnFlags & SAL_LAYOUT_BIDI_RTL; - for(depth = ((rtl)? 1:0); maLayoutArgs.maRuns.GetRun(&min, &lim, &rtl); maLayoutArgs.maRuns.NextRun()) - { - if (min > nCharIdx) - break; - // Only increase the depth when a change of direction occurs. - depth += int(rtl ^ bool(depth & 0x1)); - if (min <= nCharIdx && nCharIdx < lim) - break; - } - // If there is no run for this position increment the depth, but don't - // change if this is out of bounds context - if (lim > 0 && nCharIdx >= lim && nCharIdx < maLayoutArgs.mnEndCharPos) - depth++; -} - - -bool TextSourceAdaptor::getRightToLeft(gr::toffset nCharIdx) -{ - size_t depth; - int min, lim = 0; - getCharProperties(nCharIdx, min, lim, depth); - //printf("getRtl %d,%x=%d\n", nCharIdx, maLayoutArgs.mpStr[nCharIdx], depth & 0x1); - return depth & 0x1; -} - - -unsigned int TextSourceAdaptor::getDirectionDepth(gr::toffset nCharIdx) -{ - size_t depth; - int min, lim; - getCharProperties(nCharIdx, min, lim, depth); - //printf("getDirectionDepth %d,%x=%d\n", nCharIdx, maLayoutArgs.mpStr[nCharIdx], depth); - return depth; -} - - -float TextSourceAdaptor::getVerticalOffset(gr::toffset) -{ - return 0.0f; //TODO: Implement correctly -} - -gr::isocode TextSourceAdaptor::getLanguage(gr::toffset) -{ - if (mpFeatures && mpFeatures->hasLanguage()) - return mpFeatures->getLanguage(); - gr::isocode unknown = {{0,0,0,0}}; - return unknown; -} - -std::pair<gr::toffset, gr::toffset> TextSourceAdaptor::propertyRange(gr::toffset nCharIdx) -{ - - if (nCharIdx < unsigned(maLayoutArgs.mnMinCharPos)) - return std::make_pair(0, maLayoutArgs.mnMinCharPos); - - if (nCharIdx < mnEnd) - return std::make_pair(maLayoutArgs.mnMinCharPos, mnEnd); - - return std::make_pair(mnEnd, maLayoutArgs.mnLength); -} - -size_t TextSourceAdaptor::getFontFeatures(gr::toffset, gr::FeatureSetting * settings) -{ - if (mpFeatures) return mpFeatures->getFontFeatures(settings); - return 0; -} - - -bool TextSourceAdaptor::sameSegment(gr::toffset char_idx1, gr::toffset char_idx2) -{ - const std::pair<gr::toffset, gr::toffset> - range1 = propertyRange(char_idx1), - range2 = propertyRange(char_idx2); - - return range1 == range2; -} - -void TextSourceAdaptor::setFeatures(const grutils::GrFeatureParser * pFeatures) -{ - mpFeatures = new grutils::GrFeatureParser(*pFeatures); -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/glyphs/graphite_textsrc.hxx b/vcl/source/glyphs/graphite_textsrc.hxx deleted file mode 100644 index f40f6052725d..000000000000 --- a/vcl/source/glyphs/graphite_textsrc.hxx +++ /dev/null @@ -1,121 +0,0 @@ -/* -*- 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. - * - ************************************************************************/ - -#ifndef _SV_GRAPHITETEXTSRC_HXX -#define _SV_GRAPHITETEXTSRC_HXX -// Description: Implements the Graphite interfaces IGrTextSource and -// IGrGraphics which provide Graphite with access to the -// app's text storage system and the platform's font and -// graphics systems. - -// We need this to enable namespace support in libgrengine headers. -#define GR_NAMESPACE - -// Standard Library -#include <stdexcept> -// Platform - -#ifdef WNT -#include <windows.h> -#endif - - -// Module -#include "vcl/dllapi.h" - -// Libraries -#include <graphite/GrClient.h> -#include <graphite/Font.h> -#include <graphite/ITextSource.h> - -// Module type definitions and forward declarations. -// -namespace grutils -{ - class GrFeatureParser; -} -// Implements the Adaptor pattern to adapt the LayoutArgs and the ServerFont interfaces to the -// gr::IGrTextSource interface. -// @author tse -// -class TextSourceAdaptor : public gr::ITextSource -{ -public: - TextSourceAdaptor(ImplLayoutArgs &layout_args, const int nContextLen) throw(); - ~TextSourceAdaptor(); - virtual gr::UtfType utfEncodingForm(); - virtual size_t getLength(); - virtual size_t fetch(gr::toffset ichMin, size_t cch, gr::utf32 * prgchBuffer); - virtual size_t fetch(gr::toffset ichMin, size_t cch, gr::utf16 * prgchwBuffer); - virtual size_t fetch(gr::toffset ichMin, size_t cch, gr::utf8 * prgchsBuffer); - virtual bool getRightToLeft(gr::toffset ich); - virtual unsigned int getDirectionDepth(gr::toffset ich); - virtual float getVerticalOffset(gr::toffset ich); - virtual gr::isocode getLanguage(gr::toffset ich); - - virtual std::pair<gr::toffset, gr::toffset> propertyRange(gr::toffset ich); - virtual size_t getFontFeatures(gr::toffset ich, gr::FeatureSetting * prgfset); - virtual bool sameSegment(gr::toffset ich1, gr::toffset ich2); - virtual bool featureVariations() { return false; } - - operator ImplLayoutArgs & () throw(); - void setFeatures(const grutils::GrFeatureParser * pFeatures); - const ImplLayoutArgs & getLayoutArgs() const { return maLayoutArgs; } - size_t getContextLength() const { return mnEnd; }; - inline void switchLayoutArgs(ImplLayoutArgs & newArgs); -private: - // Prevent the generation of a default assignment operator. - TextSourceAdaptor & operator=(const TextSourceAdaptor &); - - void getCharProperties(const int, int &, int &, size_t &); - - ImplLayoutArgs maLayoutArgs; - size_t mnEnd; - const grutils::GrFeatureParser * mpFeatures; -}; - -inline TextSourceAdaptor::TextSourceAdaptor(ImplLayoutArgs &la, const int nContextLen) throw() - : maLayoutArgs(la), - mnEnd(std::min(la.mnLength, nContextLen)), - mpFeatures(NULL) -{ -} - -inline TextSourceAdaptor::operator ImplLayoutArgs & () throw() { - return maLayoutArgs; -} - -inline void TextSourceAdaptor::switchLayoutArgs(ImplLayoutArgs & aNewArgs) -{ - mnEnd += aNewArgs.mnMinCharPos - maLayoutArgs.mnMinCharPos; - maLayoutArgs = aNewArgs; -} - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/window/btndlg.cxx b/vcl/source/window/btndlg.cxx index 577b7ad89edc..add12e4427bb 100644 --- a/vcl/source/window/btndlg.cxx +++ b/vcl/source/window/btndlg.cxx @@ -36,7 +36,7 @@ #include <vcl/button.hxx> #include <vcl/btndlg.hxx> -#include <vcl/svdata.hxx> + typedef boost::ptr_vector<ImplBtnDlgItem>::iterator btn_iterator; typedef boost::ptr_vector<ImplBtnDlgItem>::const_iterator btn_const_iterator; diff --git a/vcl/unx/generic/app/salinst.cxx b/vcl/unx/generic/app/salinst.cxx index 7233225f4d9b..81bc26cb3672 100644 --- a/vcl/unx/generic/app/salinst.cxx +++ b/vcl/unx/generic/app/salinst.cxx @@ -35,8 +35,6 @@ #include "osl/module.hxx" #include "tools/solarmutex.hxx" -#include "vos/mutex.hxx" - #include "unx/salunx.h" #include "unx/saldata.hxx" diff --git a/vcl/unx/generic/fontmanager/Makefile b/vcl/unx/generic/fontmanager/Makefile new file mode 100644 index 000000000000..7fb7b0325aea --- /dev/null +++ b/vcl/unx/generic/fontmanager/Makefile @@ -0,0 +1,32 @@ +# 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. 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. +# +# The Initial Developer of the Original Code is +# Bjoern Michaelsen <bjoern.michaelsen@canonical.com> (Canonical Ltd.) +# Portions created by the Initial Developer are Copyright (C) 2011 the +# Initial Developer. All Rights Reserved. +# +# Contributor(s): Jan Holesovsky <kendy@suse.cz> +# +# 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. + +all : afm_hash.hpp + +afm_hash.hpp : $(realpath $(dir $(firstword $(MAKEFILE_LIST))))/afm_keyword_list + $(GPERF) -C -t -l -L C++ -m 20 -Z AfmKeywordHash -k '1,4,6,$$' $< | sed -e "s/(char\*)0/(char\*)0, NOPE/g" | grep -v "^#line" > $@ + +.PHONY : all +# vim: set noet sw=4: diff --git a/vcl/unx/generic/fontmanager/parseAFM.cxx b/vcl/unx/generic/fontmanager/parseAFM.cxx index 242537c8e699..82d94f2518e0 100644 --- a/vcl/unx/generic/fontmanager/parseAFM.cxx +++ b/vcl/unx/generic/fontmanager/parseAFM.cxx @@ -333,7 +333,7 @@ static char *linetoken( FileInputStream* stream ) * * The algorithm is a standard Knuth binary search. */ -#include "afm_hash.cpp" +#include "afm_hash.hpp" static inline enum parseKey recognize( register char* ident, int len) { diff --git a/vcl/unx/generic/gdi/salgdi2.cxx b/vcl/unx/generic/gdi/salgdi2.cxx index 49dd7174d583..1382fff3d1c1 100644 --- a/vcl/unx/generic/gdi/salgdi2.cxx +++ b/vcl/unx/generic/gdi/salgdi2.cxx @@ -46,7 +46,7 @@ #include "printergfx.hxx" #include "vcl/bmpacc.hxx" -#include "vcl/outdata.hxx" +#include <outdata.hxx> #undef SALGDI2_TESTTRANS diff --git a/vcl/unx/headless/svpprn.hxx b/vcl/unx/headless/svpprn.hxx index e4625bf70792..f7e6a671f4b3 100644 --- a/vcl/unx/headless/svpprn.hxx +++ b/vcl/unx/headless/svpprn.hxx @@ -33,7 +33,7 @@ #include "printergfx.hxx" #include "printerjob.hxx" -#include "salprn.hxx" +#include <unx/salprn.h> #include "vclpluginapi.h" |