OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) |
3 * Copyright (C) 2003, 2004, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r
ight reserved. | 3 * Copyright (C) 2003, 2004, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r
ight reserved. |
4 * Copyright (C) 2010 Google Inc. All rights reserved. | 4 * Copyright (C) 2010 Google Inc. 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 * |
11 * This library is distributed in the hope that it will be useful, | 11 * This library is distributed in the hope that it will be useful, |
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
14 * Library General Public License for more details. | 14 * Library General Public License for more details. |
15 * | 15 * |
16 * You should have received a copy of the GNU Library General Public License | 16 * You should have received a copy of the GNU Library General Public License |
17 * along with this library; see the file COPYING.LIB. If not, write to | 17 * along with this library; see the file COPYING.LIB. If not, write to |
18 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 18 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
19 * Boston, MA 02110-1301, USA. | 19 * Boston, MA 02110-1301, USA. |
20 * | 20 * |
21 */ | 21 */ |
22 | 22 |
23 #ifndef LineBreaker_h | 23 #ifndef LineBreaker_h |
24 #define LineBreaker_h | 24 #define LineBreaker_h |
25 | 25 |
26 #include "core/layout/api/LineLayoutBlockFlow.h" | 26 #include "core/layout/api/LineLayoutBlockFlow.h" |
27 #include "core/layout/line/InlineIterator.h" | 27 #include "core/layout/line/InlineIterator.h" |
28 #include "core/layout/line/LineInfo.h" | 28 #include "core/layout/line/LineInfo.h" |
| 29 #include "wtf/Allocator.h" |
29 #include "wtf/Vector.h" | 30 #include "wtf/Vector.h" |
30 | 31 |
31 namespace blink { | 32 namespace blink { |
32 | 33 |
33 enum WhitespacePosition { LeadingWhitespace, TrailingWhitespace }; | 34 enum WhitespacePosition { LeadingWhitespace, TrailingWhitespace }; |
34 | 35 |
35 struct LayoutTextInfo; | 36 struct LayoutTextInfo; |
36 | 37 |
37 class LineBreaker { | 38 class LineBreaker { |
| 39 STACK_ALLOCATED(); |
38 public: | 40 public: |
39 friend class BreakingContext; | 41 friend class BreakingContext; |
40 LineBreaker(LineLayoutBlockFlow block) | 42 LineBreaker(LineLayoutBlockFlow block) |
41 : m_block(block) | 43 : m_block(block) |
42 { | 44 { |
43 reset(); | 45 reset(); |
44 } | 46 } |
45 | 47 |
46 InlineIterator nextLineBreak(InlineBidiResolver&, LineInfo&, LayoutTextInfo&
, | 48 InlineIterator nextLineBreak(InlineBidiResolver&, LineInfo&, LayoutTextInfo&
, |
47 FloatingObject* lastFloatFromPreviousLine, WordMeasurements&); | 49 FloatingObject* lastFloatFromPreviousLine, WordMeasurements&); |
48 | 50 |
49 bool lineWasHyphenated() { return m_hyphenated; } | 51 bool lineWasHyphenated() { return m_hyphenated; } |
50 const Vector<LineLayoutBox>& positionedObjects() { return m_positionedObject
s; } | 52 const Vector<LineLayoutBox>& positionedObjects() { return m_positionedObject
s; } |
51 EClear clear() { return m_clear; } | 53 EClear clear() { return m_clear; } |
52 private: | 54 private: |
53 void reset(); | 55 void reset(); |
54 | 56 |
55 void skipLeadingWhitespace(InlineBidiResolver&, LineInfo&, FloatingObject* l
astFloatFromPreviousLine, LineWidth&); | 57 void skipLeadingWhitespace(InlineBidiResolver&, LineInfo&, FloatingObject* l
astFloatFromPreviousLine, LineWidth&); |
56 | 58 |
57 LineLayoutBlockFlow m_block; | 59 LineLayoutBlockFlow m_block; |
58 bool m_hyphenated; | 60 bool m_hyphenated; |
59 EClear m_clear; | 61 EClear m_clear; |
60 Vector<LineLayoutBox> m_positionedObjects; | 62 Vector<LineLayoutBox> m_positionedObjects; |
61 }; | 63 }; |
62 | 64 |
63 } | 65 } |
64 | 66 |
65 #endif // LineBreaker_h | 67 #endif // LineBreaker_h |
OLD | NEW |