summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2018-10-27 21:44:39 +0200
committerJan-Marek Glogowski <glogow@fbihome.de>2018-10-30 12:45:03 +0100
commitadf71090c94b90d95d3b320e070d53b7071751cd (patch)
tree1760879530bf5cdfec74f8b1478a0a7e55856ffe /include
parent7b0f2ee441b0cbcb88f3020df40c49e7cd6f9fb1 (diff)
Hide SalLayoutGlyphs details
Nobody outside of VCL should deal with GlyphItems. Change-Id: Id84b0f320bc49f790658f23efe129b92262c2aea Reviewed-on: https://gerrit.libreoffice.org/62446 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
Diffstat (limited to 'include')
-rw-r--r--include/vcl/glyphitem.hxx65
-rw-r--r--include/vcl/outdev.hxx3
-rw-r--r--include/vcl/vcllayout.hxx4
3 files changed, 16 insertions, 56 deletions
diff --git a/include/vcl/glyphitem.hxx b/include/vcl/glyphitem.hxx
index 5019e5825c47..75213a5b49c5 100644
--- a/include/vcl/glyphitem.hxx
+++ b/include/vcl/glyphitem.hxx
@@ -20,64 +20,27 @@
#ifndef INCLUDED_VCL_GLYPHITEM_HXX
#define INCLUDED_VCL_GLYPHITEM_HXX
-#include <rtl/ref.hxx>
-#include <tools/gen.hxx>
-#include <vcl/dllapi.h>
-
-class LogicalFontInstance;
-
typedef sal_uInt16 sal_GlyphId;
-struct VCL_DLLPUBLIC GlyphItem
-{
- int m_nFlags;
- int m_nCharPos; // index in string
- int m_nCharCount; // number of characters m_aking up this glyph
+struct GlyphItem;
+class SalLayoutGlyphsImpl;
- int m_nOrigWidth; // original glyph width
- int m_nNewWidth; // width after adjustments
- int m_nXOffset;
-
- sal_GlyphId m_aGlyphId;
- Point m_aLinearPos; // absolute position of non rotated string
+class VCL_DLLPUBLIC SalLayoutGlyphs final
+{
+ friend class SalLayoutGlyphsImpl;
+ SalLayoutGlyphsImpl* m_pImpl;
- LogicalFontInstance* m_pFontInstance;
+public:
+ SalLayoutGlyphs();
+ SalLayoutGlyphs(const SalLayoutGlyphs&);
+ ~SalLayoutGlyphs();
- GlyphItem(int nCharPos, int nCharCount, sal_GlyphId aGlyphId, const Point& rLinearPos,
- long nFlags, int nOrigWidth, int nXOffset, LogicalFontInstance* pFontInstance)
- : m_nFlags(nFlags)
- , m_nCharPos(nCharPos)
- , m_nCharCount(nCharCount)
- , m_nOrigWidth(nOrigWidth)
- , m_nNewWidth(nOrigWidth)
- , m_nXOffset(nXOffset)
- , m_aGlyphId(aGlyphId)
- , m_aLinearPos(rLinearPos)
- , m_pFontInstance(pFontInstance)
- {
- assert(pFontInstance);
- }
+ SalLayoutGlyphs& operator=(const SalLayoutGlyphs&);
- enum
- {
- IS_IN_CLUSTER = 0x001,
- IS_RTL_GLYPH = 0x002,
- IS_DIACRITIC = 0x004,
- IS_VERTICAL = 0x008,
- IS_SPACING = 0x010,
- ALLOW_KASHIDA = 0x020,
- IS_DROPPED = 0x040,
- IS_CLUSTER_START = 0x080
- };
+ SalLayoutGlyphsImpl* Impl() const { return m_pImpl; }
- bool IsInCluster() const { return ((m_nFlags & IS_IN_CLUSTER) != 0); }
- bool IsRTLGlyph() const { return ((m_nFlags & IS_RTL_GLYPH) != 0); }
- bool IsDiacritic() const { return ((m_nFlags & IS_DIACRITIC) != 0); }
- bool IsVertical() const { return ((m_nFlags & IS_VERTICAL) != 0); }
- bool IsSpacing() const { return ((m_nFlags & IS_SPACING) != 0); }
- bool AllowKashida() const { return ((m_nFlags & ALLOW_KASHIDA) != 0); }
- bool IsDropped() const { return ((m_nFlags & IS_DROPPED) != 0); }
- bool IsClusterStart() const { return ((m_nFlags & IS_CLUSTER_START) != 0); }
+ bool empty() const;
+ void clear();
};
#endif // INCLUDED_VCL_GLYPHITEM_HXX
diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx
index 8970fe0e3788..8f93be10c284 100644
--- a/include/vcl/outdev.hxx
+++ b/include/vcl/outdev.hxx
@@ -31,6 +31,7 @@
#include <vcl/devicecoordinate.hxx>
#include <vcl/dllapi.h>
#include <vcl/font.hxx>
+#include <vcl/glyphitem.hxx>
#include <vcl/region.hxx>
#include <vcl/mapmod.hxx>
#include <vcl/wall.hxx>
@@ -150,8 +151,6 @@ namespace o3tl
}
typedef std::vector< tools::Rectangle > MetricVector;
-struct GlyphItem;
-typedef std::vector<GlyphItem> SalLayoutGlyphs;
// OutputDevice-Types
diff --git a/include/vcl/vcllayout.hxx b/include/vcl/vcllayout.hxx
index 3237973e9ffc..ced231713966 100644
--- a/include/vcl/vcllayout.hxx
+++ b/include/vcl/vcllayout.hxx
@@ -27,6 +27,7 @@
#include <tools/gen.hxx>
#include <vcl/devicecoordinate.hxx>
#include <vcl/dllapi.h>
+#include <vcl/glyphitem.hxx>
class ImplLayoutArgs;
class PhysicalFontFace;
@@ -36,9 +37,6 @@ namespace vcl
class TextLayoutCache;
}
-struct GlyphItem;
-typedef std::vector<GlyphItem> SalLayoutGlyphs;
-
// all positions/widths are in font units
// one exception: drawposition is in pixel units