OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) |
3 * (C) 2000 Antti Koivisto (koivisto@kde.org) | 3 * (C) 2000 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2000 Dirk Mueller (mueller@kde.org) | 4 * (C) 2000 Dirk Mueller (mueller@kde.org) |
5 * Copyright (C) 2003, 2006, 2007, 2011 Apple Inc. All rights reserved. | 5 * Copyright (C) 2003, 2006, 2007, 2011 Apple Inc. All rights reserved. |
6 * | 6 * |
7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 void setText(const LChar* c, unsigned len) { m_data.characters8 = c; m_len =
len; m_is8Bit = true;} | 187 void setText(const LChar* c, unsigned len) { m_data.characters8 = c; m_len =
len; m_is8Bit = true;} |
188 void setText(const UChar* c, unsigned len) { m_data.characters16 = c; m_len
= len; m_is8Bit = false;} | 188 void setText(const UChar* c, unsigned len) { m_data.characters16 = c; m_len
= len; m_is8Bit = false;} |
189 void setText(const String&); | 189 void setText(const String&); |
190 void setCharactersLength(unsigned charactersLength) { m_charactersLength = c
haractersLength; } | 190 void setCharactersLength(unsigned charactersLength) { m_charactersLength = c
haractersLength; } |
191 | 191 |
192 void setExpansionBehavior(ExpansionBehavior behavior) { m_expansionBehavior
= behavior; } | 192 void setExpansionBehavior(ExpansionBehavior behavior) { m_expansionBehavior
= behavior; } |
193 float horizontalGlyphStretch() const { return m_horizontalGlyphStretch; } | 193 float horizontalGlyphStretch() const { return m_horizontalGlyphStretch; } |
194 void setHorizontalGlyphStretch(float scale) { m_horizontalGlyphStretch = sca
le; } | 194 void setHorizontalGlyphStretch(float scale) { m_horizontalGlyphStretch = sca
le; } |
195 | 195 |
196 bool allowTabs() const { return m_allowTabs; } | 196 bool allowTabs() const { return m_allowTabs; } |
197 TabSize tabSize() const { return m_tabSize; } | 197 TabSize getTabSize() const { return m_tabSize; } |
198 void setTabSize(bool, TabSize); | 198 void setTabSize(bool, TabSize); |
199 | 199 |
200 float xPos() const { return m_xpos; } | 200 float xPos() const { return m_xpos; } |
201 void setXPos(float xPos) { m_xpos = xPos; } | 201 void setXPos(float xPos) { m_xpos = xPos; } |
202 float expansion() const { return m_expansion; } | 202 float expansion() const { return m_expansion; } |
203 bool allowsLeadingExpansion() const { return m_expansionBehavior & AllowLead
ingExpansion; } | 203 bool allowsLeadingExpansion() const { return m_expansionBehavior & AllowLead
ingExpansion; } |
204 bool allowsTrailingExpansion() const { return m_expansionBehavior & AllowTra
ilingExpansion; } | 204 bool allowsTrailingExpansion() const { return m_expansionBehavior & AllowTra
ilingExpansion; } |
205 TextDirection direction() const { return static_cast<TextDirection>(m_direct
ion); } | 205 TextDirection direction() const { return static_cast<TextDirection>(m_direct
ion); } |
206 bool rtl() const { return m_direction == RTL; } | 206 bool rtl() const { return m_direction == RTL; } |
207 bool ltr() const { return m_direction == LTR; } | 207 bool ltr() const { return m_direction == LTR; } |
208 bool directionalOverride() const { return m_directionalOverride; } | 208 bool directionalOverride() const { return m_directionalOverride; } |
209 bool spacingDisabled() const { return m_disableSpacing; } | 209 bool spacingDisabled() const { return m_disableSpacing; } |
210 | 210 |
211 void disableSpacing() { m_disableSpacing = true; } | 211 void disableSpacing() { m_disableSpacing = true; } |
212 void setDirection(TextDirection direction) { m_direction = direction; } | 212 void setDirection(TextDirection direction) { m_direction = direction; } |
213 void setDirectionalOverride(bool override) { m_directionalOverride = overrid
e; } | 213 void setDirectionalOverride(bool override) { m_directionalOverride = overrid
e; } |
214 | 214 |
215 void setTextJustify(TextJustify textJustify) { m_textJustify = static_cast<u
nsigned>(textJustify); } | 215 void setTextJustify(TextJustify textJustify) { m_textJustify = static_cast<u
nsigned>(textJustify); } |
216 TextJustify textJustify() const { return static_cast<TextJustify>(m_textJust
ify); } | 216 TextJustify getTextJustify() const { return static_cast<TextJustify>(m_textJ
ustify); } |
217 | 217 |
218 private: | 218 private: |
219 union { | 219 union { |
220 const LChar* characters8; | 220 const LChar* characters8; |
221 const UChar* characters16; | 221 const UChar* characters16; |
222 } m_data; | 222 } m_data; |
223 unsigned m_charactersLength; // Marks the end of the characters buffer. Defa
ult equals to m_len. | 223 unsigned m_charactersLength; // Marks the end of the characters buffer. Defa
ult equals to m_len. |
224 unsigned m_len; | 224 unsigned m_len; |
225 | 225 |
226 // m_xpos is the x position relative to the left start of the text line, not
relative to the left | 226 // m_xpos is the x position relative to the left start of the text line, not
relative to the left |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 | 261 |
262 const TextRun& run; | 262 const TextRun& run; |
263 int from; | 263 int from; |
264 int to; | 264 int to; |
265 FloatRect bounds; | 265 FloatRect bounds; |
266 RefPtr<const SkTextBlob>* cachedTextBlob; | 266 RefPtr<const SkTextBlob>* cachedTextBlob; |
267 }; | 267 }; |
268 | 268 |
269 } // namespace blink | 269 } // namespace blink |
270 #endif | 270 #endif |
OLD | NEW |