OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) Research In Motion Limited 2010-2012. All rights reserved. | 2 * Copyright (C) Research In Motion Limited 2010-2012. All rights reserved. |
3 * | 3 * |
4 * This library is free software; you can redistribute it and/or | 4 * This library is free software; you can redistribute it and/or |
5 * modify it under the terms of the GNU Library General Public | 5 * modify it under the terms of the GNU Library General Public |
6 * License as published by the Free Software Foundation; either | 6 * License as published by the Free Software Foundation; either |
7 * version 2 of the License, or (at your option) any later version. | 7 * version 2 of the License, or (at your option) any later version. |
8 * | 8 * |
9 * This library is distributed in the hope that it will be useful, | 9 * This library is distributed in the hope that it will be useful, |
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 19 matching lines...) Expand all Loading... |
30 class SVGTextMetrics { | 30 class SVGTextMetrics { |
31 public: | 31 public: |
32 enum MetricsType { | 32 enum MetricsType { |
33 SkippedSpaceMetrics | 33 SkippedSpaceMetrics |
34 }; | 34 }; |
35 | 35 |
36 SVGTextMetrics(); | 36 SVGTextMetrics(); |
37 SVGTextMetrics(MetricsType); | 37 SVGTextMetrics(MetricsType); |
38 SVGTextMetrics(LayoutSVGInlineText*, unsigned position, unsigned length, flo
at width); | 38 SVGTextMetrics(LayoutSVGInlineText*, unsigned position, unsigned length, flo
at width); |
39 | 39 |
40 // FIXME: Migrate away from these to the two below. | |
41 static SVGTextMetrics measureCharacterRange(LayoutSVGInlineText*, unsigned p
osition, unsigned length); | |
42 static TextRun constructTextRun(LayoutSVGInlineText*, unsigned position, uns
igned length); | |
43 | |
44 static SVGTextMetrics measureCharacterRange(LayoutSVGInlineText*, unsigned p
osition, unsigned length, TextDirection); | 40 static SVGTextMetrics measureCharacterRange(LayoutSVGInlineText*, unsigned p
osition, unsigned length, TextDirection); |
45 static TextRun constructTextRun(LayoutSVGInlineText*, unsigned position, uns
igned length, TextDirection); | 41 static TextRun constructTextRun(LayoutSVGInlineText*, unsigned position, uns
igned length, TextDirection); |
46 | 42 |
47 bool isEmpty() const { return !m_width && !m_height && m_length <= 1; } | 43 bool isEmpty() const { return !m_width && !m_height && m_length <= 1; } |
48 | 44 |
49 float width() const { return m_width; } | 45 float width() const { return m_width; } |
50 void setWidth(float width) { m_width = width; } | 46 void setWidth(float width) { m_width = width; } |
51 | 47 |
52 float height() const { return m_height; } | 48 float height() const { return m_height; } |
53 unsigned length() const { return m_length; } | 49 unsigned length() const { return m_length; } |
54 | 50 |
55 private: | 51 private: |
56 SVGTextMetrics(LayoutSVGInlineText*, const TextRun&); | 52 SVGTextMetrics(LayoutSVGInlineText*, const TextRun&); |
57 | 53 |
58 float m_width; | 54 float m_width; |
59 float m_height; | 55 float m_height; |
60 unsigned m_length; | 56 unsigned m_length; |
61 }; | 57 }; |
62 | 58 |
63 } // namespace blink | 59 } // namespace blink |
64 | 60 |
65 #endif | 61 #endif |
OLD | NEW |