OLD | NEW |
1 /* | 1 /* |
2 Copyright (C) 1997 Martin Jones (mjones@kde.org) | 2 Copyright (C) 1997 Martin Jones (mjones@kde.org) |
3 (C) 1998 Waldo Bastian (bastian@kde.org) | 3 (C) 1998 Waldo Bastian (bastian@kde.org) |
4 (C) 1998, 1999 Torben Weis (weis@kde.org) | 4 (C) 1998, 1999 Torben Weis (weis@kde.org) |
5 (C) 1999 Lars Knoll (knoll@kde.org) | 5 (C) 1999 Lars Knoll (knoll@kde.org) |
6 (C) 1999 Antti Koivisto (koivisto@kde.org) | 6 (C) 1999 Antti Koivisto (koivisto@kde.org) |
7 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv
ed. | 7 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv
ed. |
8 | 8 |
9 This library is free software; you can redistribute it and/or | 9 This library is free software; you can redistribute it and/or |
10 modify it under the terms of the GNU Library General Public | 10 modify it under the terms of the GNU Library General Public |
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 void incrementVisuallyNonEmptyPixelCount(const IntSize&); | 236 void incrementVisuallyNonEmptyPixelCount(const IntSize&); |
237 void setIsVisuallyNonEmpty() { m_isVisuallyNonEmpty = true; } | 237 void setIsVisuallyNonEmpty() { m_isVisuallyNonEmpty = true; } |
238 void enableAutoSizeMode(const IntSize& minSize, const IntSize& maxSize); | 238 void enableAutoSizeMode(const IntSize& minSize, const IntSize& maxSize); |
239 void disableAutoSizeMode() { disposeAutoSizeInfo(); } | 239 void disableAutoSizeMode() { disposeAutoSizeInfo(); } |
240 | 240 |
241 void forceLayoutForPagination(const FloatSize& pageSize, const FloatSize& or
iginalPageSize, float maximumShrinkFactor); | 241 void forceLayoutForPagination(const FloatSize& pageSize, const FloatSize& or
iginalPageSize, float maximumShrinkFactor); |
242 | 242 |
243 bool scrollToFragment(const KURL&); | 243 bool scrollToFragment(const KURL&); |
244 bool scrollToAnchor(const String&); | 244 bool scrollToAnchor(const String&); |
245 void maintainScrollPositionAtAnchor(Node*); | 245 void maintainScrollPositionAtAnchor(Node*); |
| 246 |
246 void scrollElementToRect(Element*, const IntRect&); | 247 void scrollElementToRect(Element*, const IntRect&); |
247 void scrollContentsIfNeededRecursive(); | 248 void scrollContentsIfNeededRecursive(); |
248 | 249 |
249 // Methods to convert points and rects between the coordinate space of the r
enderer, and this view. | 250 // Methods to convert points and rects between the coordinate space of the r
enderer, and this view. |
250 IntRect convertFromRenderer(const LayoutObject&, const IntRect&) const; | 251 IntRect convertFromRenderer(const LayoutObject&, const IntRect&) const; |
251 IntRect convertToRenderer(const LayoutObject&, const IntRect&) const; | 252 IntRect convertToRenderer(const LayoutObject&, const IntRect&) const; |
252 IntPoint convertFromRenderer(const LayoutObject&, const IntPoint&) const; | 253 IntPoint convertFromRenderer(const LayoutObject&, const IntPoint&) const; |
253 IntPoint convertToRenderer(const LayoutObject&, const IntPoint&) const; | 254 IntPoint convertToRenderer(const LayoutObject&, const IntPoint&) const; |
254 | 255 |
255 bool isFrameViewScrollCorner(RenderScrollbarPart* scrollCorner) const { retu
rn m_scrollCorner == scrollCorner; } | 256 bool isFrameViewScrollCorner(RenderScrollbarPart* scrollCorner) const { retu
rn m_scrollCorner == scrollCorner; } |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
459 | 460 |
460 // Scroll the actual contents of the view (either blitting or invalidating a
s needed). | 461 // Scroll the actual contents of the view (either blitting or invalidating a
s needed). |
461 void scrollContents(const IntSize& scrollDelta); | 462 void scrollContents(const IntSize& scrollDelta); |
462 | 463 |
463 // This gives us a means of blocking painting on our scrollbars until the fi
rst layout has occurred. | 464 // This gives us a means of blocking painting on our scrollbars until the fi
rst layout has occurred. |
464 void setScrollbarsSuppressed(bool suppressed, bool repaintOnUnsuppress = fal
se); | 465 void setScrollbarsSuppressed(bool suppressed, bool repaintOnUnsuppress = fal
se); |
465 bool scrollbarsSuppressed() const { return m_scrollbarsSuppressed; } | 466 bool scrollbarsSuppressed() const { return m_scrollbarsSuppressed; } |
466 | 467 |
467 bool drawPanScrollIcon() { return m_shouldDrawPanScrollIcon; } | 468 bool drawPanScrollIcon() { return m_shouldDrawPanScrollIcon; } |
468 | 469 |
469 IntPoint rootViewToContents(const IntPoint&) const; | 470 IntPoint rootFrameToContents(const IntPoint&) const; |
470 IntPoint contentsToRootView(const IntPoint&) const; | 471 IntRect rootFrameToContents(const IntRect&) const; |
471 IntRect rootViewToContents(const IntRect&) const; | 472 IntPoint contentsToRootFrame(const IntPoint&) const; |
472 IntRect contentsToRootView(const IntRect&) const; | 473 IntRect contentsToRootFrame(const IntRect&) const; |
473 | 474 |
474 // Event coordinates are assumed to be in the coordinate space of a window t
hat contains | 475 // Event coordinates are assumed to be in the coordinate space of a window t
hat contains |
475 // the entire widget hierarchy. It is up to the platform to decide what the
precise definition | 476 // the entire widget hierarchy. It is up to the platform to decide what the
precise definition |
476 // of containing window is. (For example on Mac it is the containing NSWindo
w.) | 477 // of containing window is. (For example on Mac it is the containing NSWindo
w.) |
477 IntPoint windowToContents(const IntPoint&) const; | 478 IntPoint windowToContents(const IntPoint&) const; |
478 FloatPoint windowToContents(const FloatPoint&) const; | 479 FloatPoint windowToContents(const FloatPoint&) const; |
479 IntPoint contentsToWindow(const IntPoint&) const; | 480 IntPoint contentsToWindow(const IntPoint&) const; |
480 IntRect windowToContents(const IntRect&) const; | 481 IntRect windowToContents(const IntRect&) const; |
481 IntRect contentsToWindow(const IntRect&) const; | 482 IntRect contentsToWindow(const IntRect&) const; |
482 | 483 |
| 484 // Methods for converting between Frame and Content (i.e. Document) coordina
tes. |
| 485 // Frame coordinates are relative to the top left corner of the frame and so |
| 486 // they are affected by scroll offset. Content coordinates are relative to t
he |
| 487 // document's top left corner and thus are not affected by scroll offset. |
| 488 IntPoint contentsToFrame(const IntPoint&) const; |
| 489 IntRect contentsToFrame(const IntRect&) const; |
| 490 IntPoint frameToContents(const IntPoint&) const; |
| 491 FloatPoint frameToContents(const FloatPoint&) const; |
| 492 IntRect frameToContents(const IntRect&) const; |
| 493 |
483 // Functions for converting to screen coordinates. | 494 // Functions for converting to screen coordinates. |
484 IntRect contentsToScreen(const IntRect&) const; | 495 IntRect contentsToScreen(const IntRect&) const; |
485 | 496 |
486 // These functions are used to enable scrollbars to avoid window resizer con
trols that overlap the scroll view. | 497 // These functions are used to enable scrollbars to avoid window resizer con
trols that overlap the scroll view. |
487 // This happens only on Mac OS X 10.6. | 498 // This happens only on Mac OS X 10.6. |
488 IntRect windowResizerRect() const; | 499 IntRect windowResizerRect() const; |
489 bool containsScrollbarsAvoidingResizer() const; | 500 bool containsScrollbarsAvoidingResizer() const; |
490 void adjustScrollbarsAvoidingResizerCount(int overlapDelta); | 501 void adjustScrollbarsAvoidingResizerCount(int overlapDelta); |
491 void windowResizerRectChanged(); | 502 void windowResizerRectChanged(); |
492 | 503 |
493 // For platforms that need to hit test scrollbars from within the engine's e
vent handlers (like Win32). | 504 // For platforms that need to hit test scrollbars from within the engine's e
vent handlers (like Win32). |
494 Scrollbar* scrollbarAtWindowPoint(const IntPoint& windowPoint); | 505 Scrollbar* scrollbarAtWindowPoint(const IntPoint&); |
495 Scrollbar* scrollbarAtViewPoint(const IntPoint& viewPoint); | 506 Scrollbar* scrollbarAtFramePoint(const IntPoint&); |
496 | 507 |
497 virtual IntPoint convertChildToSelf(const Widget* child, const IntPoint& poi
nt) const override | 508 virtual IntPoint convertChildToSelf(const Widget* child, const IntPoint& poi
nt) const override |
498 { | 509 { |
499 IntPoint newPoint = point; | 510 IntPoint newPoint = point; |
500 if (!isFrameViewScrollbar(child)) | 511 if (!isFrameViewScrollbar(child)) |
501 newPoint = point - scrollOffset(); | 512 newPoint = contentsToFrame(point); |
502 newPoint.moveBy(child->location()); | 513 newPoint.moveBy(child->location()); |
503 return newPoint; | 514 return newPoint; |
504 } | 515 } |
505 | 516 |
506 virtual IntPoint convertSelfToChild(const Widget* child, const IntPoint& poi
nt) const override | 517 virtual IntPoint convertSelfToChild(const Widget* child, const IntPoint& poi
nt) const override |
507 { | 518 { |
508 IntPoint newPoint = point; | 519 IntPoint newPoint = point; |
509 if (!isFrameViewScrollbar(child)) | 520 if (!isFrameViewScrollbar(child)) |
510 newPoint = point + scrollOffset(); | 521 newPoint = frameToContents(point); |
511 newPoint.moveBy(-child->location()); | 522 newPoint.moveBy(-child->location()); |
512 return newPoint; | 523 return newPoint; |
513 } | 524 } |
514 | 525 |
515 // Widget override. Handles painting of the contents of the view as well as
the scrollbars. | 526 // Widget override. Handles painting of the contents of the view as well as
the scrollbars. |
516 virtual void paint(GraphicsContext*, const IntRect&) override; | 527 virtual void paint(GraphicsContext*, const IntRect&) override; |
517 void paintContents(GraphicsContext*, const IntRect& damageRect); | 528 void paintContents(GraphicsContext*, const IntRect& damageRect); |
518 | 529 |
519 // Widget overrides to ensure that our children's visibility status is kept
up to date when we get shown and hidden. | 530 // Widget overrides to ensure that our children's visibility status is kept
up to date when we get shown and hidden. |
520 virtual void show() override; | 531 virtual void show() override; |
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
744 bool m_verticalOverflow; | 755 bool m_verticalOverflow; |
745 LayoutObject* m_viewportRenderer; | 756 LayoutObject* m_viewportRenderer; |
746 | 757 |
747 bool m_wasScrolledByUser; | 758 bool m_wasScrolledByUser; |
748 bool m_inProgrammaticScroll; | 759 bool m_inProgrammaticScroll; |
749 bool m_safeToPropagateScrollToParent; | 760 bool m_safeToPropagateScrollToParent; |
750 | 761 |
751 double m_lastPaintTime; | 762 double m_lastPaintTime; |
752 | 763 |
753 bool m_isTrackingPaintInvalidations; // Used for testing. | 764 bool m_isTrackingPaintInvalidations; // Used for testing. |
| 765 |
| 766 // In frame coordinates. |
754 Vector<IntRect> m_trackedPaintInvalidationRects; | 767 Vector<IntRect> m_trackedPaintInvalidationRects; |
755 | 768 |
756 RefPtrWillBeMember<Node> m_nodeToDraw; | 769 RefPtrWillBeMember<Node> m_nodeToDraw; |
757 PaintBehavior m_paintBehavior; | 770 PaintBehavior m_paintBehavior; |
758 bool m_isPainting; | 771 bool m_isPainting; |
759 | 772 |
760 unsigned m_visuallyNonEmptyCharacterCount; | 773 unsigned m_visuallyNonEmptyCharacterCount; |
761 unsigned m_visuallyNonEmptyPixelCount; | 774 unsigned m_visuallyNonEmptyPixelCount; |
762 bool m_isVisuallyNonEmpty; | 775 bool m_isVisuallyNonEmpty; |
763 bool m_firstVisuallyNonEmptyLayoutCallbackPending; | 776 bool m_firstVisuallyNonEmptyLayoutCallbackPending; |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
844 static const unsigned visualPixelThreshold = 32 * 32; | 857 static const unsigned visualPixelThreshold = 32 * 32; |
845 if (m_visuallyNonEmptyPixelCount > visualPixelThreshold) | 858 if (m_visuallyNonEmptyPixelCount > visualPixelThreshold) |
846 setIsVisuallyNonEmpty(); | 859 setIsVisuallyNonEmpty(); |
847 } | 860 } |
848 | 861 |
849 DEFINE_TYPE_CASTS(FrameView, Widget, widget, widget->isFrameView(), widget.isFra
meView()); | 862 DEFINE_TYPE_CASTS(FrameView, Widget, widget, widget->isFrameView(), widget.isFra
meView()); |
850 | 863 |
851 } // namespace blink | 864 } // namespace blink |
852 | 865 |
853 #endif // FrameView_h | 866 #endif // FrameView_h |
OLD | NEW |