OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004 Apple Computer, Inc. All rights reserved. | 2 * Copyright (C) 2004 Apple Computer, 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 |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 static EphemeralRangeInComposedTree asRange(const VisibleSelection&); | 75 static EphemeralRangeInComposedTree asRange(const VisibleSelection&); |
76 static bool equalSelections(const VisibleSelection&, const VisibleSelect
ion&); | 76 static bool equalSelections(const VisibleSelection&, const VisibleSelect
ion&); |
77 static bool isRange(const VisibleSelection& selection) { return selectio
nType(selection) == RangeSelection; } | 77 static bool isRange(const VisibleSelection& selection) { return selectio
nType(selection) == RangeSelection; } |
78 static PositionType selectionBase(const VisibleSelection& selection) { r
eturn selection.baseInComposedTree(); } | 78 static PositionType selectionBase(const VisibleSelection& selection) { r
eturn selection.baseInComposedTree(); } |
79 static PositionType selectionExtent(const VisibleSelection& selection) {
return selection.extentInComposedTree(); } | 79 static PositionType selectionExtent(const VisibleSelection& selection) {
return selection.extentInComposedTree(); } |
80 static PositionType selectionStart(const VisibleSelection& selection) {
return selection.startInComposedTree(); } | 80 static PositionType selectionStart(const VisibleSelection& selection) {
return selection.startInComposedTree(); } |
81 static PositionType selectionEnd(const VisibleSelection& selection) { re
turn selection.endInComposedTree(); } | 81 static PositionType selectionEnd(const VisibleSelection& selection) { re
turn selection.endInComposedTree(); } |
82 static SelectionType selectionType(const VisibleSelection& selection) {
return selection.selectionTypeInComposedTree(); } | 82 static SelectionType selectionType(const VisibleSelection& selection) {
return selection.selectionTypeInComposedTree(); } |
83 static VisiblePosition selectionVisibleStart(const VisibleSelection& sel
ection) | 83 static VisiblePosition selectionVisibleStart(const VisibleSelection& sel
ection) |
84 { | 84 { |
85 return visiblePositionOf(selectionStart(selection), isRange(selectio
n) ? TextAffinity::Downstream : selection.affinity()); | 85 return createVisiblePosition(selectionStart(selection), isRange(sele
ction) ? TextAffinity::Downstream : selection.affinity()); |
86 } | 86 } |
87 static VisiblePosition selectionVisibleEnd(const VisibleSelection& selec
tion) | 87 static VisiblePosition selectionVisibleEnd(const VisibleSelection& selec
tion) |
88 { | 88 { |
89 return visiblePositionOf(selectionEnd(selection), isRange(selection)
? TextAffinity::Upstream : selection.affinity()); | 89 return createVisiblePosition(selectionEnd(selection), isRange(select
ion) ? TextAffinity::Upstream : selection.affinity()); |
90 } | 90 } |
91 static PositionType toPositionType(const Position& position) { return to
PositionInComposedTree(position); } | 91 static PositionType toPositionType(const Position& position) { return to
PositionInComposedTree(position); } |
92 }; | 92 }; |
93 | 93 |
94 VisibleSelection(); | 94 VisibleSelection(); |
95 | 95 |
96 VisibleSelection(const Position&, TextAffinity, bool isDirectional = false); | 96 VisibleSelection(const Position&, TextAffinity, bool isDirectional = false); |
97 VisibleSelection(const Position& base, const Position& extent, TextAffinity
= SEL_DEFAULT_AFFINITY, bool isDirectional = false); | 97 VisibleSelection(const Position& base, const Position& extent, TextAffinity
= SEL_DEFAULT_AFFINITY, bool isDirectional = false); |
98 VisibleSelection(const PositionInComposedTree& base, const PositionInCompose
dTree& extent, TextAffinity = SEL_DEFAULT_AFFINITY, bool isDirectional = false); | 98 VisibleSelection(const PositionInComposedTree& base, const PositionInCompose
dTree& extent, TextAffinity = SEL_DEFAULT_AFFINITY, bool isDirectional = false); |
99 | 99 |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 | 258 |
259 } // namespace blink | 259 } // namespace blink |
260 | 260 |
261 #ifndef NDEBUG | 261 #ifndef NDEBUG |
262 // Outside the WebCore namespace for ease of invocation from gdb. | 262 // Outside the WebCore namespace for ease of invocation from gdb. |
263 void showTree(const blink::VisibleSelection&); | 263 void showTree(const blink::VisibleSelection&); |
264 void showTree(const blink::VisibleSelection*); | 264 void showTree(const blink::VisibleSelection*); |
265 #endif | 265 #endif |
266 | 266 |
267 #endif // VisibleSelection_h | 267 #endif // VisibleSelection_h |
OLD | NEW |