diff options
author | pinkerton@google.com <pinkerton@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-27 18:38:45 +0000 |
---|---|---|
committer | pinkerton@google.com <pinkerton@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-27 18:38:45 +0000 |
commit | 618e3e67a63a164a4a5ed7640f5826504b17d39d (patch) | |
tree | 9263c760f5d567472d37e514e9010ec8c10b274d | |
parent | 1e5645ff803bf73889ced446dab5b5f81e6023c0 (diff) | |
download | chromium_src-618e3e67a63a164a4a5ed7640f5826504b17d39d.zip chromium_src-618e3e67a63a164a4a5ed7640f5826504b17d39d.tar.gz chromium_src-618e3e67a63a164a4a5ed7640f5826504b17d39d.tar.bz2 |
add stub for ScrollViewMac to build in platform/mac
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@1450 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | webkit/port/platform/mac/ScrollViewMac.mm | 213 | ||||
-rw-r--r-- | webkit/webkit.xcodeproj/project.pbxproj | 20 |
2 files changed, 221 insertions, 12 deletions
diff --git a/webkit/port/platform/mac/ScrollViewMac.mm b/webkit/port/platform/mac/ScrollViewMac.mm new file mode 100644 index 0000000..7007f40 --- /dev/null +++ b/webkit/port/platform/mac/ScrollViewMac.mm @@ -0,0 +1,213 @@ +/* + * Copyright (C) 2004, 2006 Apple Computer, Inc. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY + * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#import "config.h" +#import "ScrollView.h" + +#import "FloatRect.h" +#import "IntRect.h" +#import "BlockExceptions.h" +#import "Logging.h" +#import "WebCoreFrameView.h" + +/* + This class implementation does NOT actually emulate the Qt ScrollView. + It does provide an implementation that khtml will use to interact with + WebKit's WebFrameView documentView and our NSScrollView subclass. + + ScrollView's view is a NSScrollView (or subclass of NSScrollView) + in most cases. That scrollview is a subview of an + WebCoreFrameView. The WebCoreFrameView's documentView will also be + the scroll view's documentView. + + The WebCoreFrameView's size is the frame size. The WebCoreFrameView's documentView + corresponds to the frame content size. The scrollview itself is autosized to the + WebCoreFrameView's size (see Widget::resize). +*/ + +namespace WebCore { + +int ScrollView::visibleWidth() const { + return frameGeometry().width(); +} + +int ScrollView::visibleHeight() const { + return frameGeometry().height(); +} + +FloatRect ScrollView::visibleContentRect() const { + return FloatRect(frameGeometry()); +} + +FloatRect ScrollView::visibleContentRectConsideringExternalScrollers() const { + return FloatRect(frameGeometry()); +} + +int ScrollView::contentsWidth() const { + return frameGeometry().width(); +} + +int ScrollView::contentsHeight() const { + return frameGeometry().height(); +} + +int ScrollView::contentsX() const { + return frameGeometry().x(); +} + +int ScrollView::contentsY() const { + return frameGeometry().y(); +} + + +IntSize ScrollView::scrollOffset() const +{ + return IntSize(); +} + +void ScrollView::scrollBy(int dx, int dy) +{ + setContentsPos(contentsX() + dx, contentsY() + dy); +} + +void ScrollView::scrollRectIntoViewRecursively(const IntRect& r) +{ +} + +void ScrollView::setContentsPos(int x, int y) +{ +} + +void ScrollView::setVScrollbarMode(ScrollbarMode vMode) +{ +} + +void ScrollView::setHScrollbarMode(ScrollbarMode hMode) +{ +} + +void ScrollView::setScrollbarsMode(ScrollbarMode mode) +{ +} + +ScrollbarMode ScrollView::vScrollbarMode() const +{ + return ScrollbarAuto; +} + +ScrollbarMode ScrollView::hScrollbarMode() const +{ + return ScrollbarAuto; +} + +void ScrollView::suppressScrollbars(bool suppressed, bool repaintOnUnsuppress) +{ +} + +void ScrollView::addChild(Widget* child) +{ +} + +void ScrollView::removeChild(Widget* child) +{ + child->removeFromSuperview(); +} + +void ScrollView::resizeContents(int w, int h) +{ +#if 0 + // TODO(pinkerton) - figure this out later. + contentsGeometry.setWidth(w); + contentsGeometry.setHeight(h); +#endif + resize (w, h); +} + +void ScrollView::updateContents(const IntRect &rect, bool now) +{ +} + +void ScrollView::update() +{ +} + +// "Containing Window" means the NSWindow's coord system, which is origin lower left + +IntPoint ScrollView::contentsToWindow(const IntPoint& contentsPoint) const +{ + return IntPoint(contentsPoint.x(), + frameGeometry().height() - contentsPoint.y()); +} + +IntPoint ScrollView::windowToContents(const IntPoint& point) const +{ + return IntPoint(point.x(), frameGeometry().height() - point.y()); +} + +IntRect ScrollView::contentsToWindow(const IntRect& contentsRect) const +{ + IntRect flipped_rect = contentsRect; + flipped_rect.setY(frameGeometry().height() - flipped_rect.y()); + return flipped_rect; +} + +IntRect ScrollView::windowToContents(const IntRect& rect) const +{ + IntRect flipped_rect = rect; + flipped_rect.setY(frameGeometry().height() - flipped_rect.y()); + return flipped_rect; +} + +void ScrollView::setStaticBackground(bool b) +{ +} + +PlatformScrollbar* ScrollView::scrollbarUnderMouse(const PlatformMouseEvent& mouseEvent) +{ + // On Mac, the ScrollView is really the "document", so events will never flow into it to get to the scrollers. + return 0; +} + +bool ScrollView::inWindow() const +{ + return true; +} + +void ScrollView::wheelEvent(PlatformWheelEvent&) +{ + // Do nothing. NSScrollView handles doing the scroll for us. +} + +bool ScrollView::scroll(ScrollDirection direction, ScrollGranularity granularity) { + NSLog(@"ScrollViewMacSkia::scroll should do something here"); + return true; +} + +NSView* ScrollView::getDocumentView() const { + // TODO(pinkerton): we really gotta figure out how we're doing scrolling + return nil; +} + +} diff --git a/webkit/webkit.xcodeproj/project.pbxproj b/webkit/webkit.xcodeproj/project.pbxproj index edfc656..eb15469 100644 --- a/webkit/webkit.xcodeproj/project.pbxproj +++ b/webkit/webkit.xcodeproj/project.pbxproj @@ -5880,12 +5880,8 @@ ABCF2EE60E075FD900763F29 /* RenderThemeMacSkia.mm in Sources */ = {isa = PBXBuildFile; fileRef = ABCF2EE40E075FD900763F29 /* RenderThemeMacSkia.mm */; }; ABD16FA80DC6D4CF0013D3AA /* webinputevent_mac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 825405440D92E3DA0006B936 /* webinputevent_mac.mm */; }; ABD16FA90DC6D4D70013D3AA /* webinputevent.h in Headers */ = {isa = PBXBuildFile; fileRef = 825405450D92E3DA0006B936 /* webinputevent.h */; }; - ABDBD0F70E07611E005DDFD1 /* ScrollViewMacSkia.mm in Sources */ = {isa = PBXBuildFile; fileRef = ABF5263F0E075D17005EECE5 /* ScrollViewMacSkia.mm */; }; - ABDBD0F80E076121005DDFD1 /* ScrollViewMacSkia.mm in Sources */ = {isa = PBXBuildFile; fileRef = ABF5263F0E075D17005EECE5 /* ScrollViewMacSkia.mm */; }; ABDBD10F0E0762C8005DDFD1 /* RenderThemeMacSkia.mm in Sources */ = {isa = PBXBuildFile; fileRef = ABCF2EE40E075FD900763F29 /* RenderThemeMacSkia.mm */; }; ABDBD1100E0762CD005DDFD1 /* RenderThemeMacSkia.mm in Sources */ = {isa = PBXBuildFile; fileRef = ABCF2EE40E075FD900763F29 /* RenderThemeMacSkia.mm */; }; - ABF526400E075D17005EECE5 /* ScrollViewMacSkia.mm in Sources */ = {isa = PBXBuildFile; fileRef = ABF5263F0E075D17005EECE5 /* ScrollViewMacSkia.mm */; }; - ABF526410E075D17005EECE5 /* ScrollViewMacSkia.mm in Sources */ = {isa = PBXBuildFile; fileRef = ABF5263F0E075D17005EECE5 /* ScrollViewMacSkia.mm */; }; E45062E10E40B5420025A81A /* SkiaUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E45062DF0E40B5420025A81A /* SkiaUtils.cpp */; }; E45062E20E40B5420025A81A /* SkiaUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = E45062E00E40B5420025A81A /* SkiaUtils.h */; }; E45062E30E40B5420025A81A /* SkiaUtils.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E45062DF0E40B5420025A81A /* SkiaUtils.cpp */; }; @@ -7479,7 +7475,6 @@ E456268C0E268E87005E4685 /* PathCG.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7B5E8FC10D7F3CC1001ECF42 /* PathCG.cpp */; }; E456268D0E268E87005E4685 /* PDFDocumentImage.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7B5E8FC20D7F3CC1001ECF42 /* PDFDocumentImage.cpp */; }; E456268E0E268E87005E4685 /* WebCoreURLResponse.mm in Sources */ = {isa = PBXBuildFile; fileRef = 820A61940DE7592C00871E2D /* WebCoreURLResponse.mm */; }; - E456268F0E268E87005E4685 /* ScrollViewMacSkia.mm in Sources */ = {isa = PBXBuildFile; fileRef = ABF5263F0E075D17005EECE5 /* ScrollViewMacSkia.mm */; }; E45626900E268E87005E4685 /* RenderThemeMacSkia.mm in Sources */ = {isa = PBXBuildFile; fileRef = ABCF2EE40E075FD900763F29 /* RenderThemeMacSkia.mm */; }; E45626A80E268F03005E4685 /* config.h in Headers */ = {isa = PBXBuildFile; fileRef = 7BBFD2130DB7D09D00C447C7 /* config.h */; }; E45626A90E268F03005E4685 /* alt_404_page_resource_fetcher.h in Headers */ = {isa = PBXBuildFile; fileRef = 825404EC0D92E3DA0006B936 /* alt_404_page_resource_fetcher.h */; }; @@ -7638,6 +7633,9 @@ E499F6090E646DCF00DFB0F8 /* BackForwardList.h in Headers */ = {isa = PBXBuildFile; fileRef = 7B5E8BCB0D7F3B39001ECF42 /* BackForwardList.h */; }; E49E4D960E5DEA6000AD47F7 /* BackForwardList.h in Headers */ = {isa = PBXBuildFile; fileRef = 7B5E8BCB0D7F3B39001ECF42 /* BackForwardList.h */; }; E49E4D970E5DEA6100AD47F7 /* BackForwardList.h in Headers */ = {isa = PBXBuildFile; fileRef = 7B5E8BCB0D7F3B39001ECF42 /* BackForwardList.h */; }; + E49E507D0E65D36300AD47F7 /* ScrollViewMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = E49E507C0E65D36300AD47F7 /* ScrollViewMac.mm */; }; + E49E507E0E65D36300AD47F7 /* ScrollViewMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = E49E507C0E65D36300AD47F7 /* ScrollViewMac.mm */; }; + E49E507F0E65D36300AD47F7 /* ScrollViewMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = E49E507C0E65D36300AD47F7 /* ScrollViewMac.mm */; }; E4A134090E37C47E00110AA2 /* v8_proxy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7B0095EA0DAFF0DD00F72082 /* v8_proxy.cpp */; }; E4A238C70E3FA19C002BDE14 /* image_decoder.cc in Sources */ = {isa = PBXBuildFile; fileRef = E4A238C50E3FA19C002BDE14 /* image_decoder.cc */; }; E4A238C80E3FA19C002BDE14 /* image_decoder.h in Headers */ = {isa = PBXBuildFile; fileRef = E4A238C60E3FA19C002BDE14 /* image_decoder.h */; }; @@ -12999,7 +12997,6 @@ 82C260770DCBA03E005CFE91 /* XBMImageDecoder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = XBMImageDecoder.cpp; sourceTree = "<group>"; }; AB7933600DC649EF00BC58F3 /* CharsetData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CharsetData.cpp; sourceTree = "<group>"; }; ABCF2EE40E075FD900763F29 /* RenderThemeMacSkia.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = RenderThemeMacSkia.mm; path = port/platform/RenderThemeMacSkia.mm; sourceTree = SOURCE_ROOT; }; - ABF5263F0E075D17005EECE5 /* ScrollViewMacSkia.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = ScrollViewMacSkia.mm; path = ../../../../../webkit/port/platform/ScrollViewMacSkia.mm; sourceTree = "<group>"; }; E45062DF0E40B5420025A81A /* SkiaUtils.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SkiaUtils.cpp; sourceTree = "<group>"; }; E45062E00E40B5420025A81A /* SkiaUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SkiaUtils.h; sourceTree = "<group>"; }; E45626950E268E87005E4685 /* libWebCore_v8_chrome.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libWebCore_v8_chrome.a; sourceTree = BUILT_PRODUCTS_DIR; }; @@ -13011,6 +13008,7 @@ E48A06D90E3F840F00172919 /* image_resource_fetcher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = image_resource_fetcher.h; path = glue/image_resource_fetcher.h; sourceTree = "<group>"; }; E48A07220E3F95A000172919 /* NativeImageSkia.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NativeImageSkia.cpp; sourceTree = "<group>"; }; E48A07230E3F95A000172919 /* NativeImageSkia.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NativeImageSkia.h; sourceTree = "<group>"; }; + E49E507C0E65D36300AD47F7 /* ScrollViewMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = ScrollViewMac.mm; path = port/platform/mac/ScrollViewMac.mm; sourceTree = SOURCE_ROOT; }; E4A238C50E3FA19C002BDE14 /* image_decoder.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = image_decoder.cc; path = glue/image_decoder.cc; sourceTree = "<group>"; }; E4A238C60E3FA19C002BDE14 /* image_decoder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = image_decoder.h; path = glue/image_decoder.h; sourceTree = "<group>"; }; E4A970720E36128B00E8EF3B /* FrameWin.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FrameWin.h; path = port/bridge/FrameWin.h; sourceTree = SOURCE_ROOT; }; @@ -16188,7 +16186,7 @@ 7B5E90F20D7F3CC2001ECF42 /* PlatformScrollBarMac.mm */, 7B5E90F30D7F3CC2001ECF42 /* PlugInInfoStoreMac.mm */, 7B5E90F40D7F3CC2001ECF42 /* PopupMenuMac.mm */, - ABF5263F0E075D17005EECE5 /* ScrollViewMacSkia.mm */, + E49E507C0E65D36300AD47F7 /* ScrollViewMac.mm */, 7B5E90F60D7F3CC2001ECF42 /* SearchPopupMenuMac.mm */, 7B5E90F70D7F3CC2001ECF42 /* SharedBufferMac.mm */, 7B5E90F80D7F3CC2001ECF42 /* SharedTimerMac.cpp */, @@ -23568,7 +23566,6 @@ buildActionMask = 2147483647; files = ( 7B0E5AFD0DB3DC51007D4907 /* devnull.cpp in Sources */, - ABF526410E075D17005EECE5 /* ScrollViewMacSkia.mm in Sources */, ABCF2EE60E075FD900763F29 /* RenderThemeMacSkia.mm in Sources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -23578,7 +23575,6 @@ buildActionMask = 2147483647; files = ( 7B12F8C30D8F41F300CB6E8F /* devnull.cpp in Sources */, - ABF526400E075D17005EECE5 /* ScrollViewMacSkia.mm in Sources */, ABCF2EE50E075FD900763F29 /* RenderThemeMacSkia.mm in Sources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -24445,11 +24441,11 @@ 82C261600DCBB3BB005CFE91 /* PathCG.cpp in Sources */, 82C261610DCBB3BB005CFE91 /* PDFDocumentImage.cpp in Sources */, 820A61980DE7592C00871E2D /* WebCoreURLResponse.mm in Sources */, - ABDBD0F80E076121005DDFD1 /* ScrollViewMacSkia.mm in Sources */, ABDBD1100E0762CD005DDFD1 /* RenderThemeMacSkia.mm in Sources */, 82A9A8CC0E3E4BBF0038C474 /* FrameMac.mm in Sources */, 82761E950E3FA26E0030D324 /* TextCodecMac.cpp in Sources */, 82761F870E3FAC700030D324 /* AccessibilityObject.cpp in Sources */, + E49E507E0E65D36300AD47F7 /* ScrollViewMac.mm in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -25338,9 +25334,9 @@ 82C261500DCBB3BB005CFE91 /* PathCG.cpp in Sources */, 82C261510DCBB3BB005CFE91 /* PDFDocumentImage.cpp in Sources */, 820A61960DE7592C00871E2D /* WebCoreURLResponse.mm in Sources */, - ABDBD0F70E07611E005DDFD1 /* ScrollViewMacSkia.mm in Sources */, ABDBD10F0E0762C8005DDFD1 /* RenderThemeMacSkia.mm in Sources */, 82761F830E3FAC700030D324 /* AccessibilityObject.cpp in Sources */, + E49E507F0E65D36300AD47F7 /* ScrollViewMac.mm in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -27067,11 +27063,11 @@ E456268C0E268E87005E4685 /* PathCG.cpp in Sources */, E456268D0E268E87005E4685 /* PDFDocumentImage.cpp in Sources */, E456268E0E268E87005E4685 /* WebCoreURLResponse.mm in Sources */, - E456268F0E268E87005E4685 /* ScrollViewMacSkia.mm in Sources */, E45626900E268E87005E4685 /* RenderThemeMacSkia.mm in Sources */, 82A9A8CF0E3E4EE80038C474 /* FrameMac.mm in Sources */, 82761E970E3FA26F0030D324 /* TextCodecMac.cpp in Sources */, 82761F850E3FAC700030D324 /* AccessibilityObject.cpp in Sources */, + E49E507D0E65D36300AD47F7 /* ScrollViewMac.mm in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; |