| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| 11 * documentation and/or other materials provided with the distribution. | 11 * documentation and/or other materials provided with the distribution. |
| 12 * | 12 * |
| 13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY | 13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY |
| 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
| 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
| 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR | 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR |
| 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
| 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
| 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR | 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR |
| 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY | 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY |
| 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
| 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
| 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 24 */ | 24 */ |
| 25 | 25 |
| 26 #ifndef TextMetrics_h | 26 #ifndef TextMetrics_h |
| 27 #define TextMetrics_h | 27 #define TextMetrics_h |
| 28 | 28 |
| 29 #include "bindings/core/v8/ScriptWrappable.h" | 29 #include "bindings/core/v8/ScriptWrappable.h" |
| 30 #include "platform/heap/Handle.h" |
| 30 #include "wtf/PassRefPtr.h" | 31 #include "wtf/PassRefPtr.h" |
| 31 #include "wtf/RefCounted.h" | 32 #include "wtf/RefCounted.h" |
| 32 | 33 |
| 33 namespace blink { | 34 namespace blink { |
| 34 | 35 |
| 35 class TextMetrics : public RefCounted<TextMetrics>, public ScriptWrappable { | 36 class TextMetrics FINAL : public RefCountedWillBeGarbageCollected<TextMetrics>,
public ScriptWrappable { |
| 36 public: | 37 public: |
| 37 static PassRefPtr<TextMetrics> create() { return adoptRef(new TextMetrics);
} | 38 static PassRefPtrWillBeRawPtr<TextMetrics> create() { return adoptRefWillBeN
oop(new TextMetrics); } |
| 38 | 39 |
| 39 float width() const { return m_width; } | 40 float width() const { return m_width; } |
| 40 void setWidth(float w) { m_width = w; } | 41 void setWidth(float w) { m_width = w; } |
| 41 | 42 |
| 42 float actualBoundingBoxLeft() const { return m_actualBoundingBoxLeft; } | 43 float actualBoundingBoxLeft() const { return m_actualBoundingBoxLeft; } |
| 43 void setActualBoundingBoxLeft(float actualBoundingBoxLeft) { m_actualBoundin
gBoxLeft = actualBoundingBoxLeft; } | 44 void setActualBoundingBoxLeft(float actualBoundingBoxLeft) { m_actualBoundin
gBoxLeft = actualBoundingBoxLeft; } |
| 44 | 45 |
| 45 float actualBoundingBoxRight() const { return m_actualBoundingBoxRight; } | 46 float actualBoundingBoxRight() const { return m_actualBoundingBoxRight; } |
| 46 void setActualBoundingBoxRight(float actualBoundingBoxRight) { m_actualBound
ingBoxRight = actualBoundingBoxRight; } | 47 void setActualBoundingBoxRight(float actualBoundingBoxRight) { m_actualBound
ingBoxRight = actualBoundingBoxRight; } |
| 47 | 48 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 65 | 66 |
| 66 float hangingBaseline() const { return m_hangingBaseline; } | 67 float hangingBaseline() const { return m_hangingBaseline; } |
| 67 void setHangingBaseline(float hangingBaseline) { m_hangingBaseline = hanging
Baseline; } | 68 void setHangingBaseline(float hangingBaseline) { m_hangingBaseline = hanging
Baseline; } |
| 68 | 69 |
| 69 float alphabeticBaseline() const { return m_alphabeticBaseline; } | 70 float alphabeticBaseline() const { return m_alphabeticBaseline; } |
| 70 void setAlphabeticBaseline(float alphabeticBaseline) { m_alphabeticBaseline
= alphabeticBaseline; } | 71 void setAlphabeticBaseline(float alphabeticBaseline) { m_alphabeticBaseline
= alphabeticBaseline; } |
| 71 | 72 |
| 72 float ideographicBaseline() const { return m_ideographicBaseline; } | 73 float ideographicBaseline() const { return m_ideographicBaseline; } |
| 73 void setIdeographicBaseline(float ideographicBaseline) { m_ideographicBaseli
ne = ideographicBaseline; } | 74 void setIdeographicBaseline(float ideographicBaseline) { m_ideographicBaseli
ne = ideographicBaseline; } |
| 74 | 75 |
| 76 void trace(Visitor*) { } |
| 77 |
| 75 private: | 78 private: |
| 76 TextMetrics() | 79 TextMetrics() |
| 77 : m_width(0) | 80 : m_width(0) |
| 78 , m_actualBoundingBoxLeft(0) | 81 , m_actualBoundingBoxLeft(0) |
| 79 , m_actualBoundingBoxRight(0) | 82 , m_actualBoundingBoxRight(0) |
| 80 , m_fontBoundingBoxAscent(0) | 83 , m_fontBoundingBoxAscent(0) |
| 81 , m_fontBoundingBoxDescent(0) | 84 , m_fontBoundingBoxDescent(0) |
| 82 , m_actualBoundingBoxAscent(0) | 85 , m_actualBoundingBoxAscent(0) |
| 83 , m_actualBoundingBoxDescent(0) | 86 , m_actualBoundingBoxDescent(0) |
| 84 , m_emHeightAscent(0) | 87 , m_emHeightAscent(0) |
| (...skipping 18 matching lines...) Expand all Loading... |
| 103 float m_emHeightAscent; | 106 float m_emHeightAscent; |
| 104 float m_emHeightDescent; | 107 float m_emHeightDescent; |
| 105 float m_hangingBaseline; | 108 float m_hangingBaseline; |
| 106 float m_alphabeticBaseline; | 109 float m_alphabeticBaseline; |
| 107 float m_ideographicBaseline; | 110 float m_ideographicBaseline; |
| 108 }; | 111 }; |
| 109 | 112 |
| 110 } // namespace blink | 113 } // namespace blink |
| 111 | 114 |
| 112 #endif // TextMetrics_h | 115 #endif // TextMetrics_h |
| OLD | NEW |