OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2006, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2004, 2006, 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 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 #define THUMB_POSITION_AFFECTS_BUTTONS | 48 #define THUMB_POSITION_AFFECTS_BUTTONS |
49 #endif | 49 #endif |
50 | 50 |
51 namespace WebCore { | 51 namespace WebCore { |
52 | 52 |
53 PassRefPtr<Scrollbar> Scrollbar::createNativeScrollbar(ScrollableArea* scrollabl
eArea, ScrollbarOrientation orientation, ScrollbarControlSize size) | 53 PassRefPtr<Scrollbar> Scrollbar::createNativeScrollbar(ScrollableArea* scrollabl
eArea, ScrollbarOrientation orientation, ScrollbarControlSize size) |
54 { | 54 { |
55 return adoptRef(new Scrollbar(scrollableArea, orientation, size)); | 55 return adoptRef(new Scrollbar(scrollableArea, orientation, size)); |
56 } | 56 } |
57 | 57 |
58 Scrollbar::Scrollbar(ScrollableArea* scrollableArea, ScrollbarOrientation orient
ation, ScrollbarControlSize controlSize, | 58 Scrollbar::Scrollbar(ScrollableArea* scrollableArea, ScrollbarOrientation orient
ation, ScrollbarControlSize controlSize, ScrollbarTheme* theme) |
59 ScrollbarTheme* theme) | |
60 : m_scrollableArea(scrollableArea) | 59 : m_scrollableArea(scrollableArea) |
61 , m_orientation(orientation) | 60 , m_orientation(orientation) |
62 , m_controlSize(controlSize) | 61 , m_controlSize(controlSize) |
63 , m_theme(theme) | 62 , m_theme(theme) |
64 , m_visibleSize(0) | 63 , m_visibleSize(0) |
65 , m_totalSize(0) | 64 , m_totalSize(0) |
66 , m_currentPos(0) | 65 , m_currentPos(0) |
67 , m_dragOrigin(0) | 66 , m_dragOrigin(0) |
68 , m_hoveredPart(NoPart) | 67 , m_hoveredPart(NoPart) |
69 , m_pressedPart(NoPart) | 68 , m_pressedPart(NoPart) |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 bool Scrollbar::isScrollableAreaActive() const | 114 bool Scrollbar::isScrollableAreaActive() const |
116 { | 115 { |
117 return m_scrollableArea && m_scrollableArea->isActive(); | 116 return m_scrollableArea && m_scrollableArea->isActive(); |
118 } | 117 } |
119 | 118 |
120 bool Scrollbar::isScrollViewScrollbar() const | 119 bool Scrollbar::isScrollViewScrollbar() const |
121 { | 120 { |
122 return parent() && parent()->isFrameView() && toFrameView(parent())->isScrol
lViewScrollbar(this); | 121 return parent() && parent()->isFrameView() && toFrameView(parent())->isScrol
lViewScrollbar(this); |
123 } | 122 } |
124 | 123 |
| 124 TextDirection Scrollbar::textDirection() const |
| 125 { |
| 126 if (m_orientation == VerticalScrollbar && m_scrollableArea) |
| 127 return m_scrollableArea->textDirection(); |
| 128 return LTR; |
| 129 } |
| 130 |
125 void Scrollbar::offsetDidChange() | 131 void Scrollbar::offsetDidChange() |
126 { | 132 { |
127 ASSERT(m_scrollableArea); | 133 ASSERT(m_scrollableArea); |
128 | 134 |
129 float position = scrollableAreaCurrentPos(); | 135 float position = scrollableAreaCurrentPos(); |
130 if (position == m_currentPos) | 136 if (position == m_currentPos) |
131 return; | 137 return; |
132 | 138 |
133 int oldThumbPosition = theme()->thumbPosition(this); | 139 int oldThumbPosition = theme()->thumbPosition(this); |
134 m_currentPos = position; | 140 m_currentPos = position; |
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
589 if (!m_scrollableArea) | 595 if (!m_scrollableArea) |
590 return 0; | 596 return 0; |
591 | 597 |
592 if (m_orientation == HorizontalScrollbar) | 598 if (m_orientation == HorizontalScrollbar) |
593 return m_scrollableArea->scrollPosition().x() - m_scrollableArea->minimu
mScrollPosition().x(); | 599 return m_scrollableArea->scrollPosition().x() - m_scrollableArea->minimu
mScrollPosition().x(); |
594 | 600 |
595 return m_scrollableArea->scrollPosition().y() - m_scrollableArea->minimumScr
ollPosition().y(); | 601 return m_scrollableArea->scrollPosition().y() - m_scrollableArea->minimumScr
ollPosition().y(); |
596 } | 602 } |
597 | 603 |
598 } // namespace WebCore | 604 } // namespace WebCore |
OLD | NEW |