dbates@webkit.org | b8ade58 | 2014-01-09 22:59:07 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2009 Apple Inc. All rights reserved. |
| 3 | * |
| 4 | * Redistribution and use in source and binary forms, with or without |
| 5 | * modification, are permitted provided that the following conditions |
| 6 | * are met: |
| 7 | * 1. Redistributions of source code must retain the above copyright |
| 8 | * notice, this list of conditions and the following disclaimer. |
| 9 | * 2. Redistributions in binary form must reproduce the above copyright |
| 10 | * notice, this list of conditions and the following disclaimer in the |
| 11 | * documentation and/or other materials provided with the distribution. |
| 12 | * |
| 13 | * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' |
| 14 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, |
| 15 | * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
| 16 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS |
| 17 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
| 18 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
| 19 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
| 20 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
| 21 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
| 22 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF |
| 23 | * THE POSSIBILITY OF SUCH DAMAGE. |
| 24 | */ |
| 25 | |
| 26 | #include "config.h" |
| 27 | #include "SelectionRect.h" |
| 28 | |
| 29 | namespace WebCore { |
| 30 | |
| 31 | SelectionRect::SelectionRect(const IntRect& rect, bool isHorizontal, int columnNumber) |
| 32 | : m_rect(rect) |
| 33 | , m_direction(LTR) |
| 34 | , m_minX(0) |
| 35 | , m_maxX(0) |
| 36 | , m_maxY(0) |
| 37 | , m_lineNumber(0) |
| 38 | , m_isLineBreak(false) |
| 39 | , m_isFirstOnLine(false) |
| 40 | , m_isLastOnLine(false) |
| 41 | , m_containsStart(false) |
| 42 | , m_containsEnd(false) |
| 43 | , m_isHorizontal(isHorizontal) |
| 44 | , m_isInFixedPosition(false) |
| 45 | , m_isRubyText(false) |
| 46 | , m_columnNumber(columnNumber) |
| 47 | { |
| 48 | } |
| 49 | |
| 50 | // FIXME: We should move some of these arguments to an auxillary struct. |
| 51 | SelectionRect::SelectionRect(const IntRect& rect, TextDirection direction, int minX, int maxX, int maxY, |
| 52 | int lineNumber, bool isLineBreak, bool isFirstOnLine, bool isLastOnLine, bool containsStart, bool containsEnd, |
| 53 | bool isHorizontal, bool isInFixedPosition, bool isRubyText, int columnNumber) |
| 54 | : m_rect(rect) |
| 55 | , m_direction(direction) |
| 56 | , m_minX(minX) |
| 57 | , m_maxX(maxX) |
| 58 | , m_maxY(maxY) |
| 59 | , m_lineNumber(lineNumber) |
| 60 | , m_isLineBreak(isLineBreak) |
| 61 | , m_isFirstOnLine(isFirstOnLine) |
| 62 | , m_isLastOnLine(isLastOnLine) |
| 63 | , m_containsStart(containsStart) |
| 64 | , m_containsEnd(containsEnd) |
| 65 | , m_isHorizontal(isHorizontal) |
| 66 | , m_isInFixedPosition(isInFixedPosition) |
| 67 | , m_isRubyText(isRubyText) |
| 68 | , m_columnNumber(columnNumber) |
| 69 | { |
| 70 | } |
| 71 | |
| 72 | SelectionRect::SelectionRect() |
| 73 | : m_direction(LTR) |
| 74 | , m_minX(0) |
| 75 | , m_maxX(0) |
| 76 | , m_maxY(0) |
| 77 | , m_lineNumber(0) |
| 78 | , m_isLineBreak(false) |
| 79 | , m_isFirstOnLine(false) |
| 80 | , m_isLastOnLine(false) |
| 81 | , m_containsStart(false) |
| 82 | , m_containsEnd(false) |
| 83 | , m_isHorizontal(true) |
| 84 | , m_isInFixedPosition(false) |
| 85 | , m_isRubyText(false) |
| 86 | , m_columnNumber(0) |
| 87 | { |
| 88 | } |
| 89 | |
| 90 | } // namespace WebCore |