summaryrefslogtreecommitdiff
path: root/vcl/inc/sallayout.hxx
diff options
context:
space:
mode:
authorKhaled Hosny <khaledhosny@eglug.org>2018-05-10 12:48:13 +0200
committerKhaled Hosny <khaledhosny@eglug.org>2018-05-11 00:16:39 +0200
commita909afbc21e8cdd03a7f27db798f830c76aa91d2 (patch)
tree540641dd83ebf9f51556306022026600e567fb1c /vcl/inc/sallayout.hxx
parente37135d4139f7c614c46fff6f82d519a05f1d9f8 (diff)
Fold CommonSalLayout into GenericSalLayout
Now the crazy constructors of CommonSalLayout are gone, we can merge the two and drop one level of indirection. Change-Id: I166e4ed2c9d22c1ce75246d486f7526c4928f652 Reviewed-on: https://gerrit.libreoffice.org/54077 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Khaled Hosny <khaledhosny@eglug.org>
Diffstat (limited to 'vcl/inc/sallayout.hxx')
-rw-r--r--vcl/inc/sallayout.hxx61
1 files changed, 45 insertions, 16 deletions
diff --git a/vcl/inc/sallayout.hxx b/vcl/inc/sallayout.hxx
index e07d51e8b3e8..e94dcefeea50 100644
--- a/vcl/inc/sallayout.hxx
+++ b/vcl/inc/sallayout.hxx
@@ -25,6 +25,10 @@
#include <memory>
#include <vector>
+#include <hb.h>
+
+#include <com/sun/star/i18n/XBreakIterator.hpp>
+
#include <basegfx/polygon/b2dpolypolygon.hxx>
#include <i18nlangtag/languagetag.hxx>
#include <tools/gen.hxx>
@@ -32,6 +36,8 @@
#include <vcl/vclenum.hxx> // for typedef sal_UCS4
#include <vcl/devicecoordinate.hxx>
+#include "fontinstance.hxx"
+
#define MAX_FALLBACK 16
@@ -304,12 +310,15 @@ public:
class VCL_PLUGIN_PUBLIC GenericSalLayout : public SalLayout
{
public:
- // used by layout engines
- void AppendGlyph( const GlyphItem& );
- void Reserve(int size) { m_GlyphItems.reserve(size + 1); }
- virtual void ApplyDXArray(ImplLayoutArgs&) = 0;
- void Justify(DeviceCoordinate nNewWidth);
- void ApplyAsianKerning(const OUString& rStr);
+ GenericSalLayout(LogicalFontInstance&);
+ ~GenericSalLayout() override;
+
+ void AdjustLayout(ImplLayoutArgs&) final override;
+ bool LayoutText(ImplLayoutArgs&) final override;
+ void DrawText(SalGraphics&) const final override;
+ std::shared_ptr<vcl::TextLayoutCache> CreateTextLayoutCache(OUString const&) const final override;
+
+ bool IsKashidaPosValid(int nCharPos) const final override;
// used by upper layers
virtual DeviceCoordinate GetTextWidth() const override;
@@ -318,25 +327,45 @@ public:
virtual void GetCaretPositions( int nArraySize, long* pCaretXArray ) const override;
// used by display layers
+ LogicalFontInstance& GetFont() const { return *mpFont; }
+
virtual bool GetNextGlyph(const GlyphItem** pGlyph, Point& rPos, int&,
const PhysicalFontFace** pFallbackFont = nullptr) const override;
protected:
- GenericSalLayout();
- virtual ~GenericSalLayout() override;
-
// for glyph+font+script fallback
- virtual void MoveGlyph( int nStart, long nNewXPos ) override;
- virtual void DropGlyph( int nStart ) override;
- virtual void Simplify( bool bIsBase ) override;
-
- virtual bool GetCharWidths(DeviceCoordinate* pCharWidths) const = 0;
-
- std::vector<GlyphItem> m_GlyphItems;
+ void MoveGlyph(int nStart, long nNewXPos) final override;
+ void DropGlyph(int nStart) final override;
+ void Simplify(bool bIsBase) final override;
private:
GenericSalLayout( const GenericSalLayout& ) = delete;
GenericSalLayout& operator=( const GenericSalLayout& ) = delete;
+
+ void AppendGlyph( const GlyphItem& );
+ void Reserve(int size) { m_GlyphItems.reserve(size + 1); }
+ void ApplyDXArray(ImplLayoutArgs&);
+ void Justify(DeviceCoordinate nNewWidth);
+ void ApplyAsianKerning(const OUString& rStr);
+
+ bool GetCharWidths(DeviceCoordinate* pCharWidths) const;
+
+ void SetNeedFallback(ImplLayoutArgs&, sal_Int32, bool);
+
+ bool HasVerticalAlternate(sal_UCS4 aChar, sal_UCS4 aNextChar);
+
+ void ParseFeatures(const OUString& name);
+
+ LogicalFontInstance* const mpFont;
+ css::uno::Reference<css::i18n::XBreakIterator> mxBreak;
+
+ std::vector<GlyphItem> m_GlyphItems;
+
+ OString msLanguage;
+ std::vector<hb_feature_t> maFeatures;
+
+ hb_set_t* mpVertGlyphs;
+ const bool mbFuzzing;
};
#undef SalGraphics