summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2018-09-30 14:00:54 +0000
committerJan-Marek Glogowski <glogow@fbihome.de>2018-10-25 17:35:05 +0200
commit134447e78f00d7378406d0a3fa5a4c5d3a02032e (patch)
treece9651e90cf291b8be43fd7459f80348a7d9ae1a /include
parent094e7b6a1028620c2b1503de8b51dc6a2482e290 (diff)
Move GlyphItem into its own header
Actually GlyphItem should be VCL internal, but this requires a transparent SalLayoutGlyphs (i.e. via pImpl), which I'm too lazy to implement currently. This seperation makes the affected source files more obvious and later migration of vcl/glyphitem.hxx easier. While at it apply the coding style and add '_' to member prefix. Change-Id: I61497af5c628c40f51597ce0ef286c47321acbc2 Reviewed-on: https://gerrit.libreoffice.org/62358 Tested-by: Jenkins Reviewed-by: Jan-Marek Glogowski <glogow@fbihome.de>
Diffstat (limited to 'include')
-rw-r--r--include/svtools/ruler.hxx1
-rw-r--r--include/vcl/glyphitem.hxx84
-rw-r--r--include/vcl/vcllayout.hxx61
3 files changed, 90 insertions, 56 deletions
diff --git a/include/svtools/ruler.hxx b/include/svtools/ruler.hxx
index d3a532db9650..5e1efddc6cf5 100644
--- a/include/svtools/ruler.hxx
+++ b/include/svtools/ruler.hxx
@@ -28,6 +28,7 @@
#include <vcl/window.hxx>
#include <vcl/virdev.hxx>
#include <vcl/field.hxx>
+#include <vcl/glyphitem.hxx>
#include <vcl/vcllayout.hxx>
#include <svtools/accessibleruler.hxx>
diff --git a/include/vcl/glyphitem.hxx b/include/vcl/glyphitem.hxx
new file mode 100644
index 000000000000..39d99bf69744
--- /dev/null
+++ b/include/vcl/glyphitem.hxx
@@ -0,0 +1,84 @@
+/* -*- 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_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
+
+ 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
+
+ int m_nFallbackLevel;
+
+ GlyphItem(int nCharPos, int nCharCount, sal_GlyphId aGlyphId, const Point& rLinearPos,
+ long nFlags, int nOrigWidth, int nXOffset)
+ : 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_nFallbackLevel(0)
+ {
+ }
+
+ 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
+ };
+
+ 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); }
+};
+
+#endif // INCLUDED_VCL_GLYPHITEM_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/vcllayout.hxx b/include/vcl/vcllayout.hxx
index ebd8c24ea401..81cb7be614fb 100644
--- a/include/vcl/vcllayout.hxx
+++ b/include/vcl/vcllayout.hxx
@@ -33,61 +33,10 @@ class PhysicalFontFace;
class SalGraphics;
namespace vcl
{
-class TextLayoutCache;
+ class TextLayoutCache;
}
-typedef sal_uInt16 sal_GlyphId;
-
-struct VCL_DLLPUBLIC GlyphItem
-{
- int mnFlags;
- int mnCharPos; // index in string
- int mnCharCount; // number of characters making up this glyph
-
- int mnOrigWidth; // original glyph width
- int mnNewWidth; // width after adjustments
- int mnXOffset;
-
- sal_GlyphId maGlyphId;
- Point maLinearPos; // absolute position of non rotated string
-
- int mnFallbackLevel;
-
-public:
- GlyphItem(int nCharPos, int nCharCount, sal_GlyphId aGlyphId, const Point& rLinearPos,
- long nFlags, int nOrigWidth, int nXOffset )
- : mnFlags(nFlags)
- , mnCharPos(nCharPos)
- , mnCharCount(nCharCount)
- , mnOrigWidth(nOrigWidth)
- , mnNewWidth(nOrigWidth)
- , mnXOffset(nXOffset)
- , maGlyphId(aGlyphId)
- , maLinearPos(rLinearPos)
- , mnFallbackLevel(0)
- { }
-
- 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
- };
-
- bool IsInCluster() const { return ((mnFlags & IS_IN_CLUSTER) != 0); }
- bool IsRTLGlyph() const { return ((mnFlags & IS_RTL_GLYPH) != 0); }
- bool IsDiacritic() const { return ((mnFlags & IS_DIACRITIC) != 0); }
- bool IsVertical() const { return ((mnFlags & IS_VERTICAL) != 0); }
- bool IsSpacing() const { return ((mnFlags & IS_SPACING) != 0); }
- bool AllowKashida() const { return ((mnFlags & ALLOW_KASHIDA) != 0); }
- bool IsDropped() const { return ((mnFlags & IS_DROPPED) != 0); }
- bool IsClusterStart() const { return ((mnFlags & IS_CLUSTER_START) != 0); }
-};
-
+struct GlyphItem;
typedef std::vector<GlyphItem> SalLayoutGlyphs;
// all positions/widths are in font units
@@ -158,11 +107,11 @@ public:
protected:
// used by layout engines
- SalLayout();
+ SalLayout();
private:
- SalLayout( const SalLayout& ) = delete;
- SalLayout& operator=( const SalLayout& ) = delete;
+ SalLayout(const SalLayout&) = delete;
+ SalLayout& operator=(const SalLayout&) = delete;
protected:
int mnMinCharPos;