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 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
464 | 464 |
465 // Scroll the actual contents of the view (either blitting or invalidating a
s needed). | 465 // Scroll the actual contents of the view (either blitting or invalidating a
s needed). |
466 void scrollContents(const IntSize& scrollDelta); | 466 void scrollContents(const IntSize& scrollDelta); |
467 | 467 |
468 // This gives us a means of blocking painting on our scrollbars until the fi
rst layout has occurred. | 468 // This gives us a means of blocking painting on our scrollbars until the fi
rst layout has occurred. |
469 void setScrollbarsSuppressed(bool suppressed, bool repaintOnUnsuppress = fal
se); | 469 void setScrollbarsSuppressed(bool suppressed, bool repaintOnUnsuppress = fal
se); |
470 bool scrollbarsSuppressed() const { return m_scrollbarsSuppressed; } | 470 bool scrollbarsSuppressed() const { return m_scrollbarsSuppressed; } |
471 | 471 |
472 bool drawPanScrollIcon() { return m_shouldDrawPanScrollIcon; } | 472 bool drawPanScrollIcon() { return m_shouldDrawPanScrollIcon; } |
473 | 473 |
| 474 // Methods for converting between this frame and other coordinate spaces. |
| 475 // For definitions and an explanation of the varous spaces, please see: |
| 476 // http://www.chromium.org/developers/design-documents/blink-coordinate-spac
es |
474 IntPoint rootFrameToContents(const IntPoint&) const; | 477 IntPoint rootFrameToContents(const IntPoint&) const; |
| 478 FloatPoint rootFrameToContents(const FloatPoint&) const; |
475 IntRect rootFrameToContents(const IntRect&) const; | 479 IntRect rootFrameToContents(const IntRect&) const; |
476 IntPoint contentsToRootFrame(const IntPoint&) const; | 480 IntPoint contentsToRootFrame(const IntPoint&) const; |
477 IntRect contentsToRootFrame(const IntRect&) const; | 481 IntRect contentsToRootFrame(const IntRect&) const; |
478 | 482 |
479 // Event coordinates are assumed to be in the coordinate space of a window t
hat contains | 483 IntRect viewportToContents(const IntRect&) const; |
480 // the entire widget hierarchy. It is up to the platform to decide what the
precise definition | 484 IntRect contentsToViewport(const IntRect&) const; |
481 // of containing window is. (For example on Mac it is the containing NSWindo
w.) | 485 IntPoint contentsToViewport(const IntPoint&) const; |
482 IntPoint windowToContents(const IntPoint&) const; | 486 IntPoint viewportToContents(const IntPoint&) const; |
483 FloatPoint windowToContents(const FloatPoint&) const; | 487 |
484 IntPoint contentsToWindow(const IntPoint&) const; | 488 // FIXME: Some external callers expect to get back a rect that's positioned |
485 IntRect windowToContents(const IntRect&) const; | 489 // in viewport space, but sized in CSS pixels. This is an artifact of the |
486 IntRect contentsToWindow(const IntRect&) const; | 490 // old pinch-zoom path. These callers should be converted to expect a rect |
| 491 // fully in viewport space. crbug.com/459591. |
| 492 IntRect soonToBeRemovedContentsToUnscaledViewport(const IntRect&) const; |
| 493 IntPoint soonToBeRemovedUnscaledViewportToContents(const IntPoint&) const; |
487 | 494 |
488 // Methods for converting between Frame and Content (i.e. Document) coordina
tes. | 495 // Methods for converting between Frame and Content (i.e. Document) coordina
tes. |
489 // Frame coordinates are relative to the top left corner of the frame and so | 496 // Frame coordinates are relative to the top left corner of the frame and so |
490 // they are affected by scroll offset. Content coordinates are relative to t
he | 497 // they are affected by scroll offset. Content coordinates are relative to t
he |
491 // document's top left corner and thus are not affected by scroll offset. | 498 // document's top left corner and thus are not affected by scroll offset. |
492 IntPoint contentsToFrame(const IntPoint&) const; | 499 IntPoint contentsToFrame(const IntPoint&) const; |
493 IntRect contentsToFrame(const IntRect&) const; | 500 IntRect contentsToFrame(const IntRect&) const; |
494 IntPoint frameToContents(const IntPoint&) const; | 501 IntPoint frameToContents(const IntPoint&) const; |
495 FloatPoint frameToContents(const FloatPoint&) const; | 502 FloatPoint frameToContents(const FloatPoint&) const; |
496 IntRect frameToContents(const IntRect&) const; | 503 IntRect frameToContents(const IntRect&) const; |
497 | 504 |
498 // Functions for converting to screen coordinates. | 505 // Functions for converting to screen coordinates. |
499 IntRect contentsToScreen(const IntRect&) const; | 506 IntRect contentsToScreen(const IntRect&) const; |
500 | 507 |
501 // These functions are used to enable scrollbars to avoid window resizer con
trols that overlap the scroll view. | 508 // These functions are used to enable scrollbars to avoid window resizer con
trols that overlap the scroll view. |
502 // This happens only on Mac OS X 10.6. | 509 // This happens only on Mac OS X 10.6. |
503 IntRect windowResizerRect() const; | 510 IntRect windowResizerRect() const; |
504 bool containsScrollbarsAvoidingResizer() const; | 511 bool containsScrollbarsAvoidingResizer() const; |
505 void adjustScrollbarsAvoidingResizerCount(int overlapDelta); | 512 void adjustScrollbarsAvoidingResizerCount(int overlapDelta); |
506 void windowResizerRectChanged(); | 513 void windowResizerRectChanged(); |
507 | 514 |
508 // For platforms that need to hit test scrollbars from within the engine's e
vent handlers (like Win32). | 515 // For platforms that need to hit test scrollbars from within the engine's e
vent handlers (like Win32). |
509 Scrollbar* scrollbarAtWindowPoint(const IntPoint&); | 516 Scrollbar* scrollbarAtRootFramePoint(const IntPoint&); |
510 Scrollbar* scrollbarAtFramePoint(const IntPoint&); | 517 Scrollbar* scrollbarAtFramePoint(const IntPoint&); |
511 | 518 |
512 virtual IntPoint convertChildToSelf(const Widget* child, const IntPoint& poi
nt) const override | 519 virtual IntPoint convertChildToSelf(const Widget* child, const IntPoint& poi
nt) const override |
513 { | 520 { |
514 IntPoint newPoint = point; | 521 IntPoint newPoint = point; |
515 if (!isFrameViewScrollbar(child)) | 522 if (!isFrameViewScrollbar(child)) |
516 newPoint = contentsToFrame(point); | 523 newPoint = contentsToFrame(point); |
517 newPoint.moveBy(child->location()); | 524 newPoint.moveBy(child->location()); |
518 return newPoint; | 525 return newPoint; |
519 } | 526 } |
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
857 static const unsigned visualPixelThreshold = 32 * 32; | 864 static const unsigned visualPixelThreshold = 32 * 32; |
858 if (m_visuallyNonEmptyPixelCount > visualPixelThreshold) | 865 if (m_visuallyNonEmptyPixelCount > visualPixelThreshold) |
859 setIsVisuallyNonEmpty(); | 866 setIsVisuallyNonEmpty(); |
860 } | 867 } |
861 | 868 |
862 DEFINE_TYPE_CASTS(FrameView, Widget, widget, widget->isFrameView(), widget.isFra
meView()); | 869 DEFINE_TYPE_CASTS(FrameView, Widget, widget, widget->isFrameView(), widget.isFra
meView()); |
863 | 870 |
864 } // namespace blink | 871 } // namespace blink |
865 | 872 |
866 #endif // FrameView_h | 873 #endif // FrameView_h |
OLD | NEW |