| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2007 Rob Buis <buis@kde.org> | 2 * Copyright (C) 2007 Rob Buis <buis@kde.org> |
| 3 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> | 3 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> |
| 4 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 4 * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
| 5 * | 5 * |
| 6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
| 7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
| 8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
| 9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
| 10 * | 10 * |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 | 21 |
| 22 #ifndef SVGInlineTextBox_h | 22 #ifndef SVGInlineTextBox_h |
| 23 #define SVGInlineTextBox_h | 23 #define SVGInlineTextBox_h |
| 24 | 24 |
| 25 #include "core/rendering/InlineTextBox.h" | 25 #include "core/rendering/InlineTextBox.h" |
| 26 #include "core/rendering/svg/RenderSVGResource.h" | 26 #include "core/rendering/svg/RenderSVGResource.h" |
| 27 #include "core/rendering/svg/SVGTextLayoutEngine.h" | 27 #include "core/rendering/svg/SVGTextLayoutEngine.h" |
| 28 | 28 |
| 29 namespace blink { | 29 namespace blink { |
| 30 | 30 |
| 31 class SVGInlineTextBox FINAL : public InlineTextBox { | 31 class SVGInlineTextBox final : public InlineTextBox { |
| 32 public: | 32 public: |
| 33 SVGInlineTextBox(RenderObject&, int start, unsigned short length); | 33 SVGInlineTextBox(RenderObject&, int start, unsigned short length); |
| 34 | 34 |
| 35 virtual bool isSVGInlineTextBox() const OVERRIDE { return true; } | 35 virtual bool isSVGInlineTextBox() const override { return true; } |
| 36 | 36 |
| 37 virtual float virtualLogicalHeight() const OVERRIDE { return m_logicalHeight
; } | 37 virtual float virtualLogicalHeight() const override { return m_logicalHeight
; } |
| 38 void setLogicalHeight(float height) { m_logicalHeight = height; } | 38 void setLogicalHeight(float height) { m_logicalHeight = height; } |
| 39 | 39 |
| 40 virtual int offsetForPosition(float x, bool includePartialGlyphs = true) con
st OVERRIDE; | 40 virtual int offsetForPosition(float x, bool includePartialGlyphs = true) con
st override; |
| 41 virtual float positionForOffset(int offset) const OVERRIDE; | 41 virtual float positionForOffset(int offset) const override; |
| 42 | 42 |
| 43 virtual void paint(PaintInfo&, const LayoutPoint&, LayoutUnit lineTop, Layou
tUnit lineBottom) OVERRIDE; | 43 virtual void paint(PaintInfo&, const LayoutPoint&, LayoutUnit lineTop, Layou
tUnit lineBottom) override; |
| 44 virtual LayoutRect localSelectionRect(int startPosition, int endPosition) OV
ERRIDE; | 44 virtual LayoutRect localSelectionRect(int startPosition, int endPosition) ov
erride; |
| 45 | 45 |
| 46 bool mapStartEndPositionsIntoFragmentCoordinates(const SVGTextFragment&, int
& startPosition, int& endPosition) const; | 46 bool mapStartEndPositionsIntoFragmentCoordinates(const SVGTextFragment&, int
& startPosition, int& endPosition) const; |
| 47 | 47 |
| 48 virtual FloatRect calculateBoundaries() const OVERRIDE; | 48 virtual FloatRect calculateBoundaries() const override; |
| 49 | 49 |
| 50 void clearTextFragments() { m_textFragments.clear(); } | 50 void clearTextFragments() { m_textFragments.clear(); } |
| 51 Vector<SVGTextFragment>& textFragments() { return m_textFragments; } | 51 Vector<SVGTextFragment>& textFragments() { return m_textFragments; } |
| 52 const Vector<SVGTextFragment>& textFragments() const { return m_textFragment
s; } | 52 const Vector<SVGTextFragment>& textFragments() const { return m_textFragment
s; } |
| 53 | 53 |
| 54 virtual void dirtyLineBoxes() OVERRIDE; | 54 virtual void dirtyLineBoxes() override; |
| 55 | 55 |
| 56 bool startsNewTextChunk() const { return m_startsNewTextChunk; } | 56 bool startsNewTextChunk() const { return m_startsNewTextChunk; } |
| 57 void setStartsNewTextChunk(bool newTextChunk) { m_startsNewTextChunk = newTe
xtChunk; } | 57 void setStartsNewTextChunk(bool newTextChunk) { m_startsNewTextChunk = newTe
xtChunk; } |
| 58 | 58 |
| 59 int offsetForPositionInFragment(const SVGTextFragment&, float position, bool
includePartialGlyphs) const; | 59 int offsetForPositionInFragment(const SVGTextFragment&, float position, bool
includePartialGlyphs) const; |
| 60 FloatRect selectionRectForTextFragment(const SVGTextFragment&, int fragmentS
tartPosition, int fragmentEndPosition, RenderStyle*); | 60 FloatRect selectionRectForTextFragment(const SVGTextFragment&, int fragmentS
tartPosition, int fragmentEndPosition, RenderStyle*); |
| 61 TextRun constructTextRun(RenderStyle*, const SVGTextFragment&) const; | 61 TextRun constructTextRun(RenderStyle*, const SVGTextFragment&) const; |
| 62 | 62 |
| 63 private: | 63 private: |
| 64 | 64 |
| 65 virtual void paintDocumentMarker(GraphicsContext*, const FloatPoint&, Docume
ntMarker*, RenderStyle*, const Font&, bool) OVERRIDE FINAL; | 65 virtual void paintDocumentMarker(GraphicsContext*, const FloatPoint&, Docume
ntMarker*, RenderStyle*, const Font&, bool) override final; |
| 66 virtual void paintTextMatchMarker(GraphicsContext*, const FloatPoint&, Docum
entMarker*, RenderStyle*, const Font&) OVERRIDE FINAL; | 66 virtual void paintTextMatchMarker(GraphicsContext*, const FloatPoint&, Docum
entMarker*, RenderStyle*, const Font&) override final; |
| 67 | 67 |
| 68 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTes
tLocation& locationInContainer, const LayoutPoint& accumulatedOffset, LayoutUnit
lineTop, LayoutUnit lineBottom) OVERRIDE; | 68 virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTes
tLocation& locationInContainer, const LayoutPoint& accumulatedOffset, LayoutUnit
lineTop, LayoutUnit lineBottom) override; |
| 69 | 69 |
| 70 private: | 70 private: |
| 71 float m_logicalHeight; | 71 float m_logicalHeight; |
| 72 bool m_startsNewTextChunk : 1; | 72 bool m_startsNewTextChunk : 1; |
| 73 Vector<SVGTextFragment> m_textFragments; | 73 Vector<SVGTextFragment> m_textFragments; |
| 74 }; | 74 }; |
| 75 | 75 |
| 76 DEFINE_INLINE_BOX_TYPE_CASTS(SVGInlineTextBox); | 76 DEFINE_INLINE_BOX_TYPE_CASTS(SVGInlineTextBox); |
| 77 | 77 |
| 78 } // namespace blink | 78 } // namespace blink |
| 79 | 79 |
| 80 #endif // SVGInlineTextBox_h | 80 #endif // SVGInlineTextBox_h |
| OLD | NEW |