OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2006, 2007, 2008 Apple Inc. All rights reserved. | 2 * Copyright (C) 2004, 2006, 2007, 2008 Apple Inc. All rights reserved. |
3 * Copyright (C) 2009 Holger Hans Peter Freyther | 3 * Copyright (C) 2009 Holger Hans Peter Freyther |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 virtual int visibleWidth() const OVERRIDE { return visibleContentRect().widt
h(); } | 128 virtual int visibleWidth() const OVERRIDE { return visibleContentRect().widt
h(); } |
129 virtual int visibleHeight() const OVERRIDE { return visibleContentRect().hei
ght(); } | 129 virtual int visibleHeight() const OVERRIDE { return visibleContentRect().hei
ght(); } |
130 | 130 |
131 // visibleContentRect().size() is computed from unscaledVisibleContentSize()
divided by the value of visibleContentScaleFactor. | 131 // visibleContentRect().size() is computed from unscaledVisibleContentSize()
divided by the value of visibleContentScaleFactor. |
132 // For the main frame, visibleContentScaleFactor is equal to the page's page
ScaleFactor; it's 1 otherwise. | 132 // For the main frame, visibleContentScaleFactor is equal to the page's page
ScaleFactor; it's 1 otherwise. |
133 IntSize unscaledVisibleContentSize(VisibleContentRectIncludesScrollbars = Ex
cludeScrollbars) const; | 133 IntSize unscaledVisibleContentSize(VisibleContentRectIncludesScrollbars = Ex
cludeScrollbars) const; |
134 virtual float visibleContentScaleFactor() const { return 1; } | 134 virtual float visibleContentScaleFactor() const { return 1; } |
135 | 135 |
136 // Functions for getting/setting the size webkit should use to layout the co
ntents. By default this is the same as the visible | 136 // Functions for getting/setting the size webkit should use to layout the co
ntents. By default this is the same as the visible |
137 // content size. Explicitly setting a layout size value will cause webkit to
layout the contents using this size instead. | 137 // content size. Explicitly setting a layout size value will cause webkit to
layout the contents using this size instead. |
138 IntSize layoutSize(VisibleContentRectIncludesScrollbars = ExcludeScrollbars)
const; | 138 virtual IntSize layoutSize(VisibleContentRectIncludesScrollbars = ExcludeScr
ollbars) const; |
139 int layoutWidth(VisibleContentRectIncludesScrollbars scrollbarInclusion = Ex
cludeScrollbars) const { return layoutSize(scrollbarInclusion).width(); } | 139 int layoutWidth(VisibleContentRectIncludesScrollbars scrollbarInclusion = Ex
cludeScrollbars) const { return layoutSize(scrollbarInclusion).width(); } |
140 int layoutHeight(VisibleContentRectIncludesScrollbars scrollbarInclusion = E
xcludeScrollbars) const { return layoutSize(scrollbarInclusion).height(); } | 140 int layoutHeight(VisibleContentRectIncludesScrollbars scrollbarInclusion = E
xcludeScrollbars) const { return layoutSize(scrollbarInclusion).height(); } |
141 IntSize fixedLayoutSize() const; | |
142 void setFixedLayoutSize(const IntSize&); | |
143 bool useFixedLayout() const; | |
144 void setUseFixedLayout(bool enable); | |
145 | 141 |
146 // Functions for getting/setting the size of the document contained inside t
he ScrollView (as an IntSize or as individual width and height | 142 // Functions for getting/setting the size of the document contained inside t
he ScrollView (as an IntSize or as individual width and height |
147 // values). | 143 // values). |
148 virtual IntSize contentsSize() const OVERRIDE; // Always at least as big as
the visibleWidth()/visibleHeight(). | 144 virtual IntSize contentsSize() const OVERRIDE; // Always at least as big as
the visibleWidth()/visibleHeight(). |
149 int contentsWidth() const { return contentsSize().width(); } | 145 int contentsWidth() const { return contentsSize().width(); } |
150 int contentsHeight() const { return contentsSize().height(); } | 146 int contentsHeight() const { return contentsSize().height(); } |
151 virtual void setContentsSize(const IntSize&); | 147 virtual void setContentsSize(const IntSize&); |
152 | 148 |
153 // Functions for querying the current scrolled position (both as a point, a
size, or as individual X and Y values). | 149 // Functions for querying the current scrolled position (both as a point, a
size, or as individual X and Y values). |
154 virtual IntPoint scrollPosition() const OVERRIDE { return visibleContentRect
().location(); } | 150 virtual IntPoint scrollPosition() const OVERRIDE { return visibleContentRect
().location(); } |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
311 bool m_prohibitsScrolling; | 307 bool m_prohibitsScrolling; |
312 | 308 |
313 HashSet<RefPtr<Widget> > m_children; | 309 HashSet<RefPtr<Widget> > m_children; |
314 | 310 |
315 // This bool is unused on Mac OS because we directly ask the platform widget | 311 // This bool is unused on Mac OS because we directly ask the platform widget |
316 // whether it is safe to blit on scroll. | 312 // whether it is safe to blit on scroll. |
317 bool m_canBlitOnScroll; | 313 bool m_canBlitOnScroll; |
318 | 314 |
319 IntSize m_scrollOffset; // FIXME: Would rather store this as a position, but
we will wait to make this change until more code is shared. | 315 IntSize m_scrollOffset; // FIXME: Would rather store this as a position, but
we will wait to make this change until more code is shared. |
320 IntPoint m_cachedScrollPosition; | 316 IntPoint m_cachedScrollPosition; |
321 IntSize m_fixedLayoutSize; | |
322 IntSize m_contentsSize; | 317 IntSize m_contentsSize; |
323 | 318 |
324 int m_scrollbarsAvoidingResizer; | 319 int m_scrollbarsAvoidingResizer; |
325 bool m_scrollbarsSuppressed; | 320 bool m_scrollbarsSuppressed; |
326 | 321 |
327 bool m_inUpdateScrollbars; | 322 bool m_inUpdateScrollbars; |
328 unsigned m_updateScrollbarsPass; | 323 unsigned m_updateScrollbarsPass; |
329 | 324 |
330 IntPoint m_panScrollIconPoint; | 325 IntPoint m_panScrollIconPoint; |
331 bool m_drawPanScrollIcon; | 326 bool m_drawPanScrollIcon; |
(...skipping 26 matching lines...) Expand all Loading... |
358 ASSERT(!widget || widget->isScrollView()); | 353 ASSERT(!widget || widget->isScrollView()); |
359 return static_cast<const ScrollView*>(widget); | 354 return static_cast<const ScrollView*>(widget); |
360 } | 355 } |
361 | 356 |
362 // This will catch anyone doing an unnecessary cast. | 357 // This will catch anyone doing an unnecessary cast. |
363 void toScrollView(const ScrollView*); | 358 void toScrollView(const ScrollView*); |
364 | 359 |
365 } // namespace WebCore | 360 } // namespace WebCore |
366 | 361 |
367 #endif // ScrollView_h | 362 #endif // ScrollView_h |
OLD | NEW |