diff options
author | Jan Holesovsky <kendy@collabora.com> | 2014-11-13 17:59:39 +0100 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2014-11-14 00:07:05 +0100 |
commit | 48fa9f1e191ffec9be2dfd41061173c488276705 (patch) | |
tree | dd17be18318e810e1bab5454999fb0b34e452f56 /vcl/inc | |
parent | f2be14cdba8dbe0128751007acf9e82bde3e60a0 (diff) |
Revert "vcl: Abstract the Windows text rendering into a TextRenderImpl descendant."
Turns out it might be easier to actually subclass only the various SalLayout's
- let's try it first, and re-introduce this code again if not.
This reverts commit 309257ddadfdc3e46506036ed81f6e0695211ebe.
Diffstat (limited to 'vcl/inc')
-rw-r--r-- | vcl/inc/cairotextrender.hxx | 2 | ||||
-rw-r--r-- | vcl/inc/textrender.hxx | 7 | ||||
-rw-r--r-- | vcl/inc/win/salgdi.h | 23 | ||||
-rw-r--r-- | vcl/inc/wintextrender.hxx | 140 |
4 files changed, 26 insertions, 146 deletions
diff --git a/vcl/inc/cairotextrender.hxx b/vcl/inc/cairotextrender.hxx index ea995bb5edb6..e5db2ab7e612 100644 --- a/vcl/inc/cairotextrender.hxx +++ b/vcl/inc/cairotextrender.hxx @@ -79,7 +79,7 @@ protected: virtual cairo_surface_t* getCairoSurface() = 0; virtual void drawSurface(cairo_t* cr) = 0; - bool setFont(const FontSelectPattern *pEntry, int nFallbackLevel); +bool setFont( const FontSelectPattern *pEntry, int nFallbackLevel ); virtual void clipRegion(cairo_t* cr) = 0; diff --git a/vcl/inc/textrender.hxx b/vcl/inc/textrender.hxx index 2d9031a0cc2c..f4dcc8358cb1 100644 --- a/vcl/inc/textrender.hxx +++ b/vcl/inc/textrender.hxx @@ -17,8 +17,8 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_VCL_INC_TEXTRENDER_HXX -#define INCLUDED_VCL_INC_TEXTRENDER_HXX +#ifndef INCLUDED_VCL_INC_UNX_CAIROFONTIMPL_HXX +#define INCLUDED_VCL_INC_UNX_CAIROFONTIMPL_HXX #include <sal/types.h> #include <vcl/salgtype.hxx> @@ -29,6 +29,9 @@ #include "salglyphid.hxx" #include "fontsubset.hxx" +class PspSalPrinter; +class PspSalInfoPrinter; +class ServerFont; class ImplLayoutArgs; class ServerFontLayout; class PhysicalFontCollection; diff --git a/vcl/inc/win/salgdi.h b/vcl/inc/win/salgdi.h index 18709e150d81..69ea4cfde2cb 100644 --- a/vcl/inc/win/salgdi.h +++ b/vcl/inc/win/salgdi.h @@ -25,9 +25,7 @@ #include "outfont.hxx" #include "PhysicalFontFace.hxx" #include "impfont.hxx" -#include <textrender.hxx> #include <vcl/fontcapabilities.hxx> -#include <win/svsys.h> #include <boost/scoped_ptr.hpp> #include <boost/unordered_set.hpp> @@ -150,7 +148,6 @@ class WinSalGraphics : public SalGraphics friend class ScopedFont; private: boost::scoped_ptr<SalGraphicsImpl> mpImpl; - boost::scoped_ptr<TextRenderImpl> mpTextRenderImpl; HDC mhLocalDC; // HDC bool mbPrinter : 1; // is Printer @@ -159,13 +156,26 @@ private: bool mbScreen : 1; // is Screen compatible HWND mhWnd; // Window-Handle, when Window-Graphics + HFONT mhFonts[ MAX_FALLBACK ]; // Font + Fallbacks + const ImplWinFontData* mpWinFontData[ MAX_FALLBACK ]; // pointer to the most recent font face + ImplWinFontEntry* mpWinFontEntry[ MAX_FALLBACK ]; // pointer to the most recent font instance + float mfFontScale[ MAX_FALLBACK ]; // allows metrics emulation of huge font sizes + float mfCurrentFontScale; HRGN mhRegion; // vcl::Region Handle HPEN mhDefPen; // DefaultPen HBRUSH mhDefBrush; // DefaultBrush + HFONT mhDefFont; // DefaultFont HPALETTE mhDefPal; // DefaultPalette COLORREF mnTextColor; // TextColor RGNDATA* mpClipRgnData; // ClipRegion-Data RGNDATA* mpStdClipRgnData; // Cache Standard-ClipRegion-Data + LOGFONTA* mpLogFont; // LOG-Font which is currently selected (only W9x) + ImplFontAttrCache* mpFontAttrCache; // Cache font attributes from files in so/share/fonts + BYTE* mpFontCharSets; // All Charsets for the current font + BYTE mnFontCharSetCount; // Number of Charsets of the current font; 0 - if not queried + bool mbFontKernInit; // FALSE: FontKerns must be queried + KERNINGPAIR* mpFontKernPairs; // Kerning Pairs of the current Font + sal_uIntPtr mnFontKernPairCount;// Number of Kerning Pairs of the current Font int mnPenWidth; // Linienbreite public: @@ -275,6 +285,12 @@ protected: const SalBitmap* pAlphaBitmap); virtual bool drawAlphaRect( long nX, long nY, long nWidth, long nHeight, sal_uInt8 nTransparency ); +private: + // local helpers + + // get kernign pairs of the current font + sal_uLong GetKernPairs(); + public: // public SalGraphics methods, the interface to the independent vcl part @@ -366,6 +382,7 @@ public: bool bVertical, Int32Vector& rWidths, Ucs2UIntMap& rUnicodeEnc ); + virtual int GetMinKashidaWidth(); virtual bool GetGlyphBoundRect( sal_GlyphId, Rectangle& ); virtual bool GetGlyphOutline( sal_GlyphId, ::basegfx::B2DPolyPolygon& ); diff --git a/vcl/inc/wintextrender.hxx b/vcl/inc/wintextrender.hxx deleted file mode 100644 index 90b056113743..000000000000 --- a/vcl/inc/wintextrender.hxx +++ /dev/null @@ -1,140 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_VCL_INC_WINTEXTRENDER_HXX -#define INCLUDED_VCL_INC_WINTEXTRENDER_HXX - -#include <tools/rational.hxx> -#include <vcl/salgtype.hxx> -#include <vcl/sysdata.hxx> -#include <vcl/vclenum.hxx> -#include <vcl/metric.hxx> - -#include "salgdi.hxx" -#include "salglyphid.hxx" -#include "fontsubset.hxx" -#include <textrender.hxx> -#include <win/salgdi.h> - -class ImplLayoutArgs; -class ServerFontLayout; -class PhysicalFontCollection; -class PhysicalFontFace; - -/// Implementation of the GDI text rendering. -class WinTextRender : public TextRenderImpl -{ - /// Rendering for a printer? - bool mbPrinter; - - /// Parent WinSalGraphics. - WinSalGraphics& mrGraphics; - - HFONT mhFonts[ MAX_FALLBACK ]; ///< Font + Fallbacks - const ImplWinFontData* mpWinFontData[ MAX_FALLBACK ]; ///< pointer to the most recent font face - ImplWinFontEntry* mpWinFontEntry[ MAX_FALLBACK ]; ///< pointer to the most recent font instance - float mfFontScale[ MAX_FALLBACK ]; ///< allows metrics emulation of huge font sizes - float mfCurrentFontScale; - HFONT mhDefFont; ///< DefaultFont - - LOGFONTA* mpLogFont; ///< LOG-Font which is currently selected (only W9x) - ImplFontAttrCache* mpFontAttrCache; ///< Cache font attributes from files in so/share/fonts - BYTE* mpFontCharSets; ///< All Charsets for the current font - BYTE mnFontCharSetCount; ///< Number of Charsets of the current font; 0 - if not queried - bool mbFontKernInit; ///< FALSE: FontKerns must be queried - KERNINGPAIR* mpFontKernPairs; ///< Kerning Pairs of the current Font - sal_uIntPtr mnFontKernPairCount; ///< Number of Kerning Pairs of the current Font - -public: - WinTextRender(bool bPrinter, WinSalGraphics& rGraphics); - virtual ~WinTextRender(); - - virtual void SetTextColor(SalColor nSalColor) SAL_OVERRIDE; - - virtual sal_uInt16 SetFont(FontSelectPattern*, int nFallbackLevel) SAL_OVERRIDE; - - virtual void GetFontMetric(ImplFontMetricData*, int nFallbackLevel) SAL_OVERRIDE; - - virtual const FontCharMapPtr GetFontCharMap() const SAL_OVERRIDE; - - virtual bool GetFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const SAL_OVERRIDE; - - virtual void GetDevFontList(PhysicalFontCollection*) SAL_OVERRIDE; - - virtual void ClearDevFontCache() SAL_OVERRIDE; - - virtual bool AddTempDevFont(PhysicalFontCollection*, const OUString& rFileURL, const OUString& rFontName) SAL_OVERRIDE; - - virtual bool CreateFontSubset(const OUString& rToFile, - const PhysicalFontFace*, - sal_GlyphId* pGlyphIDs, - sal_uInt8* pEncoding, - sal_Int32* pWidths, - int nGlyphs, - FontSubsetInfo& rInfo) SAL_OVERRIDE; - - virtual const Ucs2SIntMap* GetFontEncodingVector(const PhysicalFontFace*, const Ucs2OStrMap** ppNonEncoded) SAL_OVERRIDE; - - virtual const void* GetEmbedFontData(const PhysicalFontFace*, - const sal_Ucs* pUnicodes, - sal_Int32* pWidths, - FontSubsetInfo& rInfo, - long* pDataLen) SAL_OVERRIDE; - - virtual void FreeEmbedFontData(const void* pData, long nDataLen) SAL_OVERRIDE; - - virtual void GetGlyphWidths(const PhysicalFontFace*, - bool bVertical, - Int32Vector& rWidths, - Ucs2UIntMap& rUnicodeEnc) SAL_OVERRIDE; - - virtual bool GetGlyphBoundRect(sal_GlyphId nIndex, Rectangle&) SAL_OVERRIDE; - - virtual bool GetGlyphOutline(sal_GlyphId nIndex, ::basegfx::B2DPolyPolygon&) SAL_OVERRIDE; - - virtual SalLayout* GetTextLayout(ImplLayoutArgs&, int nFallbackLevel) SAL_OVERRIDE; - - virtual void DrawServerFontLayout(const ServerFontLayout&) SAL_OVERRIDE; - - virtual SystemFontData GetSysFontData(int nFallbackLevel) const SAL_OVERRIDE; - -private: - HDC getHDC() const; - - /// Get kerning pairs of the current font. - sal_uLong GetKernPairs(); - - int GetMinKashidaWidth(); - - class ScopedFont - { - public: - explicit ScopedFont(WinTextRender & rData); - - ~ScopedFont(); - - private: - WinTextRender & m_rData; - HFONT m_hOrigFont; - }; -}; - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |