OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2006, 2007, 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 818 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
829 updateScrollbars(scrollOffset()); | 829 updateScrollbars(scrollOffset()); |
830 positionScrollbarLayers(); | 830 positionScrollbarLayers(); |
831 } | 831 } |
832 | 832 |
833 void ScrollView::updateScrollCorner() | 833 void ScrollView::updateScrollCorner() |
834 { | 834 { |
835 } | 835 } |
836 | 836 |
837 void ScrollView::paintScrollCorner(GraphicsContext* context, const IntRect& corn
erRect) | 837 void ScrollView::paintScrollCorner(GraphicsContext* context, const IntRect& corn
erRect) |
838 { | 838 { |
839 ScrollbarTheme::theme()->paintScrollCorner(this, context, cornerRect); | 839 ScrollbarTheme::theme()->paintScrollCorner(context, cornerRect); |
840 } | 840 } |
841 | 841 |
842 void ScrollView::paintScrollbar(GraphicsContext* context, Scrollbar* bar, const
IntRect& rect) | 842 void ScrollView::paintScrollbar(GraphicsContext* context, Scrollbar* bar, const
IntRect& rect) |
843 { | 843 { |
844 bar->paint(context, rect); | 844 bar->paint(context, rect); |
845 } | 845 } |
846 | 846 |
847 void ScrollView::invalidateScrollCornerRect(const IntRect& rect) | 847 void ScrollView::invalidateScrollCornerRect(const IntRect& rect) |
848 { | 848 { |
849 invalidateRect(rect); | 849 invalidateRect(rect); |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
969 IntRect verticalOverhangRect; | 969 IntRect verticalOverhangRect; |
970 calculateOverhangAreasForPainting(horizontalOverhangRect, verticalOverhangRe
ct); | 970 calculateOverhangAreasForPainting(horizontalOverhangRect, verticalOverhangRe
ct); |
971 if (!horizontalOverhangRect.isEmpty()) | 971 if (!horizontalOverhangRect.isEmpty()) |
972 window->invalidateContentsAndRootView(horizontalOverhangRect); | 972 window->invalidateContentsAndRootView(horizontalOverhangRect); |
973 if (!verticalOverhangRect.isEmpty()) | 973 if (!verticalOverhangRect.isEmpty()) |
974 window->invalidateContentsAndRootView(verticalOverhangRect); | 974 window->invalidateContentsAndRootView(verticalOverhangRect); |
975 } | 975 } |
976 | 976 |
977 void ScrollView::paintOverhangAreas(GraphicsContext* context, const IntRect& hor
izontalOverhangRect, const IntRect& verticalOverhangRect, const IntRect& dirtyRe
ct) | 977 void ScrollView::paintOverhangAreas(GraphicsContext* context, const IntRect& hor
izontalOverhangRect, const IntRect& verticalOverhangRect, const IntRect& dirtyRe
ct) |
978 { | 978 { |
979 ScrollbarTheme::theme()->paintOverhangBackground(this, context, horizontalOv
erhangRect, verticalOverhangRect, dirtyRect); | 979 ScrollbarTheme::theme()->paintOverhangBackground(context, horizontalOverhang
Rect, verticalOverhangRect, dirtyRect); |
980 ScrollbarTheme::theme()->paintOverhangShadows(this, context, horizontalOverh
angRect, verticalOverhangRect, dirtyRect); | 980 ScrollbarTheme::theme()->paintOverhangShadows(context, scrollOffset(), horiz
ontalOverhangRect, verticalOverhangRect, dirtyRect); |
981 } | 981 } |
982 | 982 |
983 void ScrollView::calculateAndPaintOverhangAreas(GraphicsContext* context, const
IntRect& dirtyRect) | 983 void ScrollView::calculateAndPaintOverhangAreas(GraphicsContext* context, const
IntRect& dirtyRect) |
984 { | 984 { |
985 IntRect horizontalOverhangRect; | 985 IntRect horizontalOverhangRect; |
986 IntRect verticalOverhangRect; | 986 IntRect verticalOverhangRect; |
987 calculateOverhangAreasForPainting(horizontalOverhangRect, verticalOverhangRe
ct); | 987 calculateOverhangAreasForPainting(horizontalOverhangRect, verticalOverhangRe
ct); |
988 | 988 |
989 if (dirtyRect.intersects(horizontalOverhangRect) || dirtyRect.intersects(ver
ticalOverhangRect)) | 989 if (dirtyRect.intersects(horizontalOverhangRect) || dirtyRect.intersects(ver
ticalOverhangRect)) |
990 paintOverhangAreas(context, horizontalOverhangRect, verticalOverhangRect
, dirtyRect); | 990 paintOverhangAreas(context, horizontalOverhangRect, verticalOverhangRect
, dirtyRect); |
991 } | 991 } |
992 | 992 |
993 void ScrollView::calculateAndPaintOverhangBackground(GraphicsContext* context, c
onst IntRect& dirtyRect) | 993 void ScrollView::calculateAndPaintOverhangBackground(GraphicsContext* context, c
onst IntRect& dirtyRect) |
994 { | 994 { |
995 IntRect horizontalOverhangRect; | 995 IntRect horizontalOverhangRect; |
996 IntRect verticalOverhangRect; | 996 IntRect verticalOverhangRect; |
997 calculateOverhangAreasForPainting(horizontalOverhangRect, verticalOverhangRe
ct); | 997 calculateOverhangAreasForPainting(horizontalOverhangRect, verticalOverhangRe
ct); |
998 | 998 |
999 if (dirtyRect.intersects(horizontalOverhangRect) || dirtyRect.intersects(ver
ticalOverhangRect)) | 999 if (dirtyRect.intersects(horizontalOverhangRect) || dirtyRect.intersects(ver
ticalOverhangRect)) |
1000 ScrollbarTheme::theme()->paintOverhangBackground(this, context, horizont
alOverhangRect, verticalOverhangRect, dirtyRect); | 1000 ScrollbarTheme::theme()->paintOverhangBackground(context, horizontalOver
hangRect, verticalOverhangRect, dirtyRect); |
1001 } | 1001 } |
1002 | 1002 |
1003 bool ScrollView::isPointInScrollbarCorner(const IntPoint& windowPoint) | 1003 bool ScrollView::isPointInScrollbarCorner(const IntPoint& windowPoint) |
1004 { | 1004 { |
1005 if (!scrollbarCornerPresent()) | 1005 if (!scrollbarCornerPresent()) |
1006 return false; | 1006 return false; |
1007 | 1007 |
1008 IntPoint viewPoint = convertFromContainingWindow(windowPoint); | 1008 IntPoint viewPoint = convertFromContainingWindow(windowPoint); |
1009 | 1009 |
1010 if (m_horizontalScrollbar) { | 1010 if (m_horizontalScrollbar) { |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1144 int ScrollView::pageStep(ScrollbarOrientation orientation) const | 1144 int ScrollView::pageStep(ScrollbarOrientation orientation) const |
1145 { | 1145 { |
1146 int length = (orientation == HorizontalScrollbar) ? visibleWidth() : visible
Height(); | 1146 int length = (orientation == HorizontalScrollbar) ? visibleWidth() : visible
Height(); |
1147 int minPageStep = static_cast<float>(length) * minFractionToStepWhenPaging()
; | 1147 int minPageStep = static_cast<float>(length) * minFractionToStepWhenPaging()
; |
1148 int pageStep = std::max(minPageStep, length - maxOverlapBetweenPages()); | 1148 int pageStep = std::max(minPageStep, length - maxOverlapBetweenPages()); |
1149 | 1149 |
1150 return std::max(pageStep, 1); | 1150 return std::max(pageStep, 1); |
1151 } | 1151 } |
1152 | 1152 |
1153 } // namespace WebCore | 1153 } // namespace WebCore |
OLD | NEW |