[Libreoffice-commits] core.git: include/vcl vcl/inc vcl/quartz vcl/source vcl/unx vcl/win

Chris Sherlock chris.sherlock79 at gmail.com
Mon Jan 11 16:05:47 PST 2016


 include/vcl/fontcharmap.hxx                    |   23 ++++++-
 vcl/inc/impfont.hxx                            |   57 -----------------
 vcl/inc/impfontcharmap.hxx                     |   82 +++++++++++++++++++++++++
 vcl/quartz/salgdi.cxx                          |    1 
 vcl/source/gdi/impfont.cxx                     |    2 
 vcl/unx/generic/fontmanager/fontmanager.cxx    |    2 
 vcl/unx/generic/glyphs/freetype_glyphcache.cxx |    1 
 vcl/win/gdi/salfont.cxx                        |    1 
 8 files changed, 107 insertions(+), 62 deletions(-)

New commits:
commit 27154c4bb5ed80d699d706ebd1a84e807c3f1625
Author: Chris Sherlock <chris.sherlock79 at gmail.com>
Date:   Mon Jan 11 18:31:28 2016 +1100

    vcl: split off ImplFontCharMap into it's own header file
    
    Change-Id: I6173cd191cd771b1f030fa737617b1067278ee10
    Reviewed-on: https://gerrit.libreoffice.org/21338
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Chris Sherlock <chris.sherlock79 at gmail.com>

diff --git a/include/vcl/fontcharmap.hxx b/include/vcl/fontcharmap.hxx
index c4d495c..b0dca54 100644
--- a/include/vcl/fontcharmap.hxx
+++ b/include/vcl/fontcharmap.hxx
@@ -17,8 +17,8 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_FONTCHARMAP_METRIC_HXX
-#define INCLUDED_FONTCHARMAP_METRIC_HXX
+#ifndef INCLUDED_FONTCHARMAP_HXX
+#define INCLUDED_FONTCHARMAP_HXX
 
 #include <vcl/dllapi.h>
 #include <vcl/font.hxx>
@@ -164,6 +164,23 @@ inline void intrusive_ptr_release(FontCharMap* pFontCharMap)
         delete pFontCharMap;
 }
 
-#endif // INCLUDED_FONTCHARMAP_METRIC_HXX
+
+// CmapResult is a normalized version of the many CMAP formats
+class VCL_PLUGIN_PUBLIC CmapResult
+{
+public:
+    explicit            CmapResult( bool bSymbolic = false,
+                            const sal_uInt32* pRangeCodes = nullptr, int nRangeCount = 0,
+                            const int* pStartGlyphs = nullptr, const sal_uInt16* pGlyphIds = nullptr );
+
+    const sal_uInt32*   mpRangeCodes;
+    const int*          mpStartGlyphs;
+    const sal_uInt16*   mpGlyphIds;
+    int                 mnRangeCount;
+    bool                mbSymbolic;
+    bool                mbRecoded;
+};
+
+#endif // INCLUDED_FONTCHARMAP_HXX
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/inc/impfont.hxx b/vcl/inc/impfont.hxx
index 904c9eb..77b90a4 100644
--- a/vcl/inc/impfont.hxx
+++ b/vcl/inc/impfont.hxx
@@ -161,64 +161,7 @@ private:
     FcPattern* mpPattern;
 };
 
-// - ImplFontCharMap -
 
-class CmapResult;
-
-class VCL_PLUGIN_PUBLIC ImplFontCharMap
-{
-public:
-    explicit            ImplFontCharMap( const CmapResult& );
-    virtual             ~ImplFontCharMap();
-
-private:
-    friend class FontCharMap;
-    friend void intrusive_ptr_add_ref(ImplFontCharMap* pImplFontCharMap);
-    friend void intrusive_ptr_release(ImplFontCharMap* pImplFontCharMap);
-
-                        ImplFontCharMap( const ImplFontCharMap& ) = delete;
-    void                operator=( const ImplFontCharMap& ) = delete;
-
-    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
-    const sal_uInt16*   mpGlyphIds;       // individual glyphid mappings
-    int                 mnRangeCount;
-    int                 mnCharCount;      // covered codepoints
-    mutable sal_uInt32  mnRefCount;
-};
-
-inline void intrusive_ptr_add_ref(ImplFontCharMap* pImplFontCharMap)
-{
-    ++pImplFontCharMap->mnRefCount;
-}
-
-inline void intrusive_ptr_release(ImplFontCharMap* pImplFontCharMap)
-{
-    if (--pImplFontCharMap->mnRefCount == 0)
-        delete pImplFontCharMap;
-}
-
-// CmapResult is a normalized version of the many CMAP formats
-class VCL_PLUGIN_PUBLIC CmapResult
-{
-public:
-    explicit            CmapResult( bool bSymbolic = false,
-                            const sal_uInt32* pRangeCodes = nullptr, int nRangeCount = 0,
-                            const int* pStartGlyphs = nullptr, const sal_uInt16* pGlyphIds = nullptr );
-
-    const sal_uInt32*   mpRangeCodes;
-    const int*          mpStartGlyphs;
-    const sal_uInt16*   mpGlyphIds;
-    int                 mnRangeCount;
-    bool                mbSymbolic;
-    bool                mbRecoded;
-};
-
-bool ParseCMAP( const unsigned char* pRawData, int nRawLength, CmapResult& );
 
 #endif // INCLUDED_VCL_INC_IMPFONT_HXX
 
diff --git a/vcl/inc/impfontcharmap.hxx b/vcl/inc/impfontcharmap.hxx
new file mode 100644
index 0000000..ef5c961
--- /dev/null
+++ b/vcl/inc/impfontcharmap.hxx
@@ -0,0 +1,82 @@
+/* -*- 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_IMPFONTCHARMAP_HXX
+#define INCLUDED_VCL_INC_IMPFONTCHARMAP_HXX
+
+#include <rtl/ustring.hxx>
+#include <tools/gen.hxx>
+#include <i18nlangtag/languagetag.hxx>
+#include <tools/color.hxx>
+#include <vcl/dllapi.h>
+#include <vcl/vclenum.hxx>
+#include <vcl/fntstyle.hxx>
+#include <fontinstance.hxx>
+#include <vcl/fontcharmap.hxx>
+
+#include <boost/intrusive_ptr.hpp>
+
+class ImplFontCharMap;
+typedef boost::intrusive_ptr< ImplFontCharMap > ImplFontCharMapPtr;
+
+
+class CmapResult;
+
+class VCL_PLUGIN_PUBLIC ImplFontCharMap
+{
+public:
+    explicit            ImplFontCharMap( const CmapResult& );
+    virtual             ~ImplFontCharMap();
+
+private:
+    friend class FontCharMap;
+    friend void intrusive_ptr_add_ref(ImplFontCharMap* pImplFontCharMap);
+    friend void intrusive_ptr_release(ImplFontCharMap* pImplFontCharMap);
+
+                        ImplFontCharMap( const ImplFontCharMap& ) = delete;
+    void                operator=( const ImplFontCharMap& ) = delete;
+
+    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
+    const sal_uInt16*   mpGlyphIds;       // individual glyphid mappings
+    int                 mnRangeCount;
+    int                 mnCharCount;      // covered codepoints
+    mutable sal_uInt32  mnRefCount;
+};
+
+inline void intrusive_ptr_add_ref(ImplFontCharMap* pImplFontCharMap)
+{
+    ++pImplFontCharMap->mnRefCount;
+}
+
+inline void intrusive_ptr_release(ImplFontCharMap* pImplFontCharMap)
+{
+    if (--pImplFontCharMap->mnRefCount == 0)
+        delete pImplFontCharMap;
+}
+
+bool ParseCMAP( const unsigned char* pRawData, int nRawLength, CmapResult& );
+
+#endif // INCLUDED_VCL_INC_IMPFONTCHARMAP_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/quartz/salgdi.cxx b/vcl/quartz/salgdi.cxx
index 9a917ec..ad10cc8 100644
--- a/vcl/quartz/salgdi.cxx
+++ b/vcl/quartz/salgdi.cxx
@@ -40,6 +40,7 @@
 #include "ctfonts.hxx"
 #include "fontsubset.hxx"
 #include "impfont.hxx"
+#include "impfontcharmap.hxx"
 #ifdef MACOSX
 #include "osx/salframe.h"
 #endif
diff --git a/vcl/source/gdi/impfont.cxx b/vcl/source/gdi/impfont.cxx
index 4061a40..6c458b5 100644
--- a/vcl/source/gdi/impfont.cxx
+++ b/vcl/source/gdi/impfont.cxx
@@ -17,7 +17,7 @@
  */
 #include <vcl/fontcharmap.hxx>
 #include <fontinstance.hxx>
-#include <impfont.hxx>
+#include <impfontcharmap.hxx>
 
 #include <vector>
 #include <set>
diff --git a/vcl/unx/generic/fontmanager/fontmanager.cxx b/vcl/unx/generic/fontmanager/fontmanager.cxx
index a926e97..e9a51ff 100644
--- a/vcl/unx/generic/fontmanager/fontmanager.cxx
+++ b/vcl/unx/generic/fontmanager/fontmanager.cxx
@@ -27,7 +27,7 @@
 
 #include "fontcache.hxx"
 #include "fontsubset.hxx"
-#include "impfont.hxx"
+#include "impfontcharmap.hxx"
 #include "svdata.hxx"
 #include "unx/geninst.h"
 #include "fontmanager.hxx"
diff --git a/vcl/unx/generic/glyphs/freetype_glyphcache.cxx b/vcl/unx/generic/glyphs/freetype_glyphcache.cxx
index 5417590..2f539a9 100644
--- a/vcl/unx/generic/glyphs/freetype_glyphcache.cxx
+++ b/vcl/unx/generic/glyphs/freetype_glyphcache.cxx
@@ -68,6 +68,7 @@
 #include <sys/stat.h>
 #include <sys/mman.h>
 #include "fontmanager.hxx"
+#include "impfontcharmap.hxx"
 
 static FT_Library aLibFT = nullptr;
 
diff --git a/vcl/win/gdi/salfont.cxx b/vcl/win/gdi/salfont.cxx
index 9decea8..4781b14 100644
--- a/vcl/win/gdi/salfont.cxx
+++ b/vcl/win/gdi/salfont.cxx
@@ -49,6 +49,7 @@
 #include "sft.hxx"
 #include "win/saldata.hxx"
 #include "win/salgdi.h"
+#include "impfontcharmap.hxx"
 
 using namespace vcl;
 


More information about the Libreoffice-commits mailing list