summaryrefslogtreecommitdiff
path: root/vcl/inc
diff options
context:
space:
mode:
authorChris Sherlock <chris.sherlock79@gmail.com>2014-10-06 18:16:16 +1100
committerChris Sherlock <chris.sherlock79@gmail.com>2014-10-13 09:19:04 +0000
commitf6d61562d41b8a49449d881da66a3d8fa519487f (patch)
tree15571322cf3bf8475fe2e1c5d1d0ae9fd38f7c1d /vcl/inc
parentbb1d4f8c9a275a20e8795ee36ca3259376746e4f (diff)
vcl: Make ImplFontCharMap a pImpl and move functions to FontCharMap
To do this, I've made FontCharMap a friend class for ImplFontCharMap, and have moved the functions directly into FontCharMap. In this patch, I am attempting to stop the direct use of ImplFontCharMap by anything other than FontCharMap. However, FontCharMap itself requires a refcounter, so we will use FontCharMapPtr to access the font character map. Change-Id: I509b990a8cbd911c5cc1572c7d24fc5348ca06d9 Reviewed-on: https://gerrit.libreoffice.org/11823 Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com> Tested-by: Chris Sherlock <chris.sherlock79@gmail.com>
Diffstat (limited to 'vcl/inc')
-rw-r--r--vcl/inc/generic/genpspgraphics.h2
-rw-r--r--vcl/inc/generic/glyphcache.hxx4
-rw-r--r--vcl/inc/headless/svpgdi.hxx3
-rw-r--r--vcl/inc/impfont.hxx24
-rw-r--r--vcl/inc/quartz/salgdi.h8
-rw-r--r--vcl/inc/salgdi.hxx19
-rw-r--r--vcl/inc/unx/salgdi.h7
-rw-r--r--vcl/inc/win/salgdi.h6
8 files changed, 30 insertions, 43 deletions
diff --git a/vcl/inc/generic/genpspgraphics.h b/vcl/inc/generic/genpspgraphics.h
index 66c7f31f3802..2a562c341ff7 100644
--- a/vcl/inc/generic/genpspgraphics.h
+++ b/vcl/inc/generic/genpspgraphics.h
@@ -89,7 +89,7 @@ public:
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 ImplFontCharMapPtr GetImplFontCharMap() const SAL_OVERRIDE;
+ virtual const FontCharMapPtr GetFontCharMap() const SAL_OVERRIDE;
virtual bool GetFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const SAL_OVERRIDE;
virtual void GetDevFontList( PhysicalFontCollection* ) SAL_OVERRIDE;
// graphics must drop any cached font info
diff --git a/vcl/inc/generic/glyphcache.hxx b/vcl/inc/generic/glyphcache.hxx
index 1a3da60118fc..ba44ae8412b3 100644
--- a/vcl/inc/generic/glyphcache.hxx
+++ b/vcl/inc/generic/glyphcache.hxx
@@ -33,9 +33,9 @@
#include <com/sun/star/i18n/XBreakIterator.hpp>
#include <tools/gen.hxx>
#include <vcl/dllapi.h>
+#include <vcl/metric.hxx>
#include <outfont.hxx>
-#include <impfont.hxx>
#include <sallayout.hxx>
class FtFontInfo;
@@ -182,7 +182,7 @@ public:
const unsigned char* GetTable( const char* pName, sal_uLong* pLength );
int GetEmUnits() const { return maFaceFT->units_per_EM;}
const FT_Size_Metrics& GetMetricsFT() const { return maSizeFT->metrics; }
- const ImplFontCharMapPtr GetImplFontCharMap() const;
+ const FontCharMapPtr GetFontCharMap() const;
bool GetFontCapabilities(vcl::FontCapabilities &) const;
GlyphData& GetGlyphData( sal_GlyphId );
diff --git a/vcl/inc/headless/svpgdi.hxx b/vcl/inc/headless/svpgdi.hxx
index aad4693d35e7..a872d4a2019d 100644
--- a/vcl/inc/headless/svpgdi.hxx
+++ b/vcl/inc/headless/svpgdi.hxx
@@ -23,6 +23,7 @@
#include <basebmp/bitmapdevice.hxx>
#include <basebmp/color.hxx>
#include <vcl/sysdata.hxx>
+#include <vcl/metric.hxx>
#include "salgdi.hxx"
#include "sallayout.hxx"
@@ -156,7 +157,7 @@ public:
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 ImplFontCharMapPtr GetImplFontCharMap() const 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;
diff --git a/vcl/inc/impfont.hxx b/vcl/inc/impfont.hxx
index af97677f3999..8efb30b9363f 100644
--- a/vcl/inc/impfont.hxx
+++ b/vcl/inc/impfont.hxx
@@ -163,34 +163,18 @@ public:
explicit ImplFontCharMap( const CmapResult& );
virtual ~ImplFontCharMap();
- static ImplFontCharMapPtr GetDefaultMap( bool bSymbols=false);
-
- bool IsDefaultMap() const;
- bool HasChar( sal_uInt32 ) const;
- int CountCharsInRange( sal_uInt32 cMin, sal_uInt32 cMax ) const;
- int GetCharCount() const { return mnCharCount;}
-
- sal_uInt32 GetFirstChar() const { return mpRangeCodes[0];}
- sal_uInt32 GetLastChar() const;
-
- sal_uInt32 GetNextChar( sal_uInt32 ) const;
- sal_uInt32 GetPrevChar( sal_uInt32 ) const;
-
- int GetIndexFromChar( sal_uInt32 ) const;
- sal_uInt32 GetCharFromIndex( int ) const;
-
- int GetGlyphIndex( sal_uInt32 ) const;
-
private:
+ friend class FontCharMap;
friend void intrusive_ptr_add_ref(ImplFontCharMap* pImplFontCharMap);
friend void intrusive_ptr_release(ImplFontCharMap* pImplFontCharMap);
- int ImplFindRangeIndex( sal_uInt32 ) const;
-
// prevent assignment and copy construction
explicit ImplFontCharMap( const ImplFontCharMap& );
void operator=( const ImplFontCharMap& );
+ static ImplFontCharMapPtr getDefaultMap( bool bSymbols=false);
+ bool isDefaultMap() const;
+
private:
const sal_uInt32* mpRangeCodes; // pairs of StartCode/(EndCode+1)
const int* mpStartGlyphs; // range-specific mapper to glyphs
diff --git a/vcl/inc/quartz/salgdi.h b/vcl/inc/quartz/salgdi.h
index 0c58ca7da621..45a12c4ee63b 100644
--- a/vcl/inc/quartz/salgdi.h
+++ b/vcl/inc/quartz/salgdi.h
@@ -45,6 +45,7 @@ extern "C" {
#include "postmac.h"
#include <vcl/fontcapabilities.hxx>
+#include <vcl/metric.hxx>
#include "outfont.hxx"
#include "PhysicalFontFace.hxx"
@@ -73,7 +74,7 @@ public:
CoreTextStyle* CreateTextStyle( const FontSelectPattern& ) const;
int GetFontTable( const char pTagName[5], unsigned char* ) const;
- const ImplFontCharMapPtr GetImplFontCharMap() const;
+ const FontCharMapPtr GetFontCharMap() const;
bool GetFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const;
bool HasChar( sal_uInt32 cChar ) const;
@@ -85,7 +86,7 @@ protected:
private:
const sal_IntPtr mnFontId;
- mutable ImplFontCharMapPtr mpCharMap;
+ mutable FontCharMapPtr mpCharMap;
mutable vcl::FontCapabilities maFontCapabilities;
mutable bool mbOs2Read; // true if OS2-table related info is valid
mutable bool mbHasOs2Table;
@@ -330,8 +331,7 @@ public:
// get the current font's metrics
virtual void GetFontMetric( ImplFontMetricData*, int nFallbackLevel ) SAL_OVERRIDE;
// get the repertoire of the current font
- virtual const ImplFontCharMapPtr
- GetImplFontCharMap() const SAL_OVERRIDE;
+ virtual const FontCharMapPtr GetFontCharMap() const SAL_OVERRIDE;
virtual bool GetFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const SAL_OVERRIDE;
// graphics must fill supplied font list
virtual void GetDevFontList( PhysicalFontCollection* ) SAL_OVERRIDE;
diff --git a/vcl/inc/salgdi.hxx b/vcl/inc/salgdi.hxx
index c2752b92447f..b49f9ecd1083 100644
--- a/vcl/inc/salgdi.hxx
+++ b/vcl/inc/salgdi.hxx
@@ -20,15 +20,17 @@
#ifndef INCLUDED_VCL_INC_SALGDI_HXX
#define INCLUDED_VCL_INC_SALGDI_HXX
-#include "tools/solar.h"
-#include "vcl/dllapi.h"
-#include "vcl/salgtype.hxx"
-#include "osl/thread.hxx"
-#include "vcl/outdev.hxx"
-#include "vcl/salnativewidgets.hxx"
+#include <tools/solar.h>
+#include <osl/thread.hxx>
+
+#include <vcl/dllapi.h>
+#include <vcl/salgtype.hxx>
+#include <vcl/outdev.hxx>
+#include <vcl/salnativewidgets.hxx>
+#include <vcl/metric.hxx>
+
#include "salglyphid.hxx"
#include "sallayout.hxx"
-#include <impfont.hxx>
#include <map>
@@ -231,8 +233,7 @@ public:
virtual void GetFontMetric( ImplFontMetricData*, int nFallbackLevel = 0 ) = 0;
// get the repertoire of the current font
- virtual const ImplFontCharMapPtr
- GetImplFontCharMap() const = 0;
+ virtual const FontCharMapPtr GetFontCharMap() const = 0;
// get the layout capabilities of the current font
virtual bool GetFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const = 0;
diff --git a/vcl/inc/unx/salgdi.h b/vcl/inc/unx/salgdi.h
index 59af7ffba0f0..d34c5d1a9d27 100644
--- a/vcl/inc/unx/salgdi.h
+++ b/vcl/inc/unx/salgdi.h
@@ -24,8 +24,9 @@
#include <postx.h>
#include <tools/rational.hxx>
-#include "vcl/salgtype.hxx"
-#include "vcl/vclenum.hxx"
+#include <vcl/salgtype.hxx>
+#include <vcl/vclenum.hxx>
+#include <vcl/metric.hxx>
#include "salgdi.hxx"
#include "sallayout.hxx"
@@ -229,7 +230,7 @@ public:
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 ImplFontCharMapPtr GetImplFontCharMap() const 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;
diff --git a/vcl/inc/win/salgdi.h b/vcl/inc/win/salgdi.h
index ace973cde206..66c561830e49 100644
--- a/vcl/inc/win/salgdi.h
+++ b/vcl/inc/win/salgdi.h
@@ -94,7 +94,7 @@ public:
const gr_face* GraphiteFace() const;
#endif
- const ImplFontCharMapPtr GetImplFontCharMap() const;
+ FontCharMapPtr GetFontCharMap() const;
bool GetFontCapabilities(vcl::FontCapabilities &rFontCapabilities) const;
const Ucs2SIntMap* GetEncodingVector() const { return mpEncodingVector; }
void SetEncodingVector( const Ucs2SIntMap* pNewVec ) const
@@ -116,7 +116,7 @@ private:
#endif
mutable bool mbHasArabicSupport;
mutable bool mbFontCapabilitiesRead;
- mutable ImplFontCharMapPtr mpUnicodeMap;
+ mutable FontCharMapPtr mpUnicodeMap;
mutable const Ucs2SIntMap* mpEncodingVector;
mutable vcl::FontCapabilities maFontCapabilities;
@@ -310,7 +310,7 @@ public:
// get the current font's metrics
virtual void GetFontMetric( ImplFontMetricData*, int nFallbackLevel );
// get the repertoire of the current font
- virtual const ImplFontCharMapPtr GetImplFontCharMap() const;
+ virtual const FontCharMapPtr GetFontCharMap() const;
// get the layout capabilities of the current font
virtual bool GetFontCapabilities(vcl::FontCapabilities &rGetFontCapabilities) const;
// graphics must fill supplied font list