diff options
author | The Android Open Source Project <initial-contribution@android.com> | 2009-03-03 18:28:41 -0800 |
---|---|---|
committer | The Android Open Source Project <initial-contribution@android.com> | 2009-03-03 18:28:41 -0800 |
commit | 648161bb0edfc3d43db63caed5cc5213bc6cb78f (patch) | |
tree | 4b825dc642cb6eb9a060e54bf8d69288fbee4904 /WebCore/page/win | |
parent | a65af38181ac7d34544586bdb5cd004de93897ad (diff) | |
download | external_webkit-648161bb0edfc3d43db63caed5cc5213bc6cb78f.zip external_webkit-648161bb0edfc3d43db63caed5cc5213bc6cb78f.tar.gz external_webkit-648161bb0edfc3d43db63caed5cc5213bc6cb78f.tar.bz2 |
auto import from //depot/cupcake/@135843
Diffstat (limited to 'WebCore/page/win')
-rw-r--r-- | WebCore/page/win/AXObjectCacheWin.cpp | 61 | ||||
-rw-r--r-- | WebCore/page/win/AccessibilityObjectWin.cpp | 37 | ||||
-rw-r--r-- | WebCore/page/win/AccessibilityObjectWrapperWin.h | 54 | ||||
-rw-r--r-- | WebCore/page/win/DragControllerWin.cpp | 64 | ||||
-rw-r--r-- | WebCore/page/win/EventHandlerWin.cpp | 111 | ||||
-rw-r--r-- | WebCore/page/win/FrameCGWin.cpp | 87 | ||||
-rw-r--r-- | WebCore/page/win/FrameCairoWin.cpp | 42 | ||||
-rw-r--r-- | WebCore/page/win/FrameWin.cpp | 101 | ||||
-rw-r--r-- | WebCore/page/win/FrameWin.h | 41 | ||||
-rw-r--r-- | WebCore/page/win/PageWin.cpp | 38 |
10 files changed, 0 insertions, 636 deletions
diff --git a/WebCore/page/win/AXObjectCacheWin.cpp b/WebCore/page/win/AXObjectCacheWin.cpp deleted file mode 100644 index da30ac5..0000000 --- a/WebCore/page/win/AXObjectCacheWin.cpp +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (C) 2008 Apple 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 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 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. - */ - - -#include "config.h" -#include "AXObjectCache.h" - -#include "AccessibilityObject.h" - -namespace WebCore { - -void AXObjectCache::detachWrapper(AccessibilityObject* obj) -{ - // On Windows, AccessibilityObjects are created when get_accChildCount is - // called, but they are not wrapped until get_accChild is called, so this - // object may not have a wrapper. - if (AccessibilityObjectWrapper* wrapper = obj->wrapper()) - wrapper->detach(); -} - -void AXObjectCache::attachWrapper(AccessibilityObject*) -{ - // On Windows, AccessibilityObjects are wrapped when the accessibility - // software requests them via get_accChild. -} - -void AXObjectCache::postNotification(RenderObject*, const String&) -{ -} - -void AXObjectCache::postNotificationToElement(RenderObject*, const String&) -{ -} - -void AXObjectCache::handleFocusedUIElementChanged() -{ -} - -} // namespace WebCore diff --git a/WebCore/page/win/AccessibilityObjectWin.cpp b/WebCore/page/win/AccessibilityObjectWin.cpp deleted file mode 100644 index e309ac8..0000000 --- a/WebCore/page/win/AccessibilityObjectWin.cpp +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (C) 2008 Apple 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 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 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. - */ - - -#include "config.h" -#include "AccessibilityObject.h" - -namespace WebCore { - -bool AccessibilityObject::accessibilityIgnoreAttachment() const -{ - return false; -} - -} // namespace WebCore diff --git a/WebCore/page/win/AccessibilityObjectWrapperWin.h b/WebCore/page/win/AccessibilityObjectWrapperWin.h deleted file mode 100644 index 779443c..0000000 --- a/WebCore/page/win/AccessibilityObjectWrapperWin.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (C) 2008 Apple 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 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 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. - */ - - -#ifndef AccessibilityObjectWrapperWin_h -#define AccessibilityObjectWrapperWin_h - -namespace WebCore { - - class AccessibilityObject; - - class AccessibilityObjectWrapper : public IUnknown { - public: - // IUnknown - virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void** ppvObject) = 0; - virtual ULONG STDMETHODCALLTYPE AddRef(void) = 0; - virtual ULONG STDMETHODCALLTYPE Release(void) = 0; - - virtual void detach() = 0; - bool attached() const { return m_object; } - AccessibilityObject* accessibilityObject() const { return m_object; } - - protected: - AccessibilityObjectWrapper(AccessibilityObject* obj) : m_object(obj) { } - AccessibilityObjectWrapper() : m_object(0) { } - - AccessibilityObject* m_object; - }; - -} // namespace WebCore - -#endif // AccessibilityObjectWrapperWin_h diff --git a/WebCore/page/win/DragControllerWin.cpp b/WebCore/page/win/DragControllerWin.cpp deleted file mode 100644 index 41f3008..0000000 --- a/WebCore/page/win/DragControllerWin.cpp +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (C) 2007 Apple 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. - */ - -#include "config.h" -#include "DragController.h" - -#include "DragData.h" -#include "windows.h" -#include "SelectionController.h" -#include <wtf/RefPtr.h> - -namespace WebCore { - -const int DragController::LinkDragBorderInset = 2; -const int DragController::MaxOriginalImageArea = 1500 * 1500; -const int DragController::DragIconRightInset = 7; -const int DragController::DragIconBottomInset = 3; - -const float DragController::DragImageAlpha = 0.75f; - -DragOperation DragController::dragOperation(DragData* dragData) -{ - //FIXME: to match the macos behaviour we should return DragOperationNone - //if we are a modal window, we are the drag source, or the window is an attached sheet - //If this can be determined from within WebCore operationForDrag can be pulled into - //WebCore itself - ASSERT(dragData); - return dragData->containsURL() && !m_didInitiateDrag ? DragOperationCopy : DragOperationNone; -} - -bool DragController::isCopyKeyDown() { - return ::GetAsyncKeyState(VK_CONTROL); -} - -const IntSize& DragController::maxDragImageSize() -{ - static const IntSize maxDragImageSize(200, 200); - - return maxDragImageSize; -} - -} diff --git a/WebCore/page/win/EventHandlerWin.cpp b/WebCore/page/win/EventHandlerWin.cpp deleted file mode 100644 index bfd2b02..0000000 --- a/WebCore/page/win/EventHandlerWin.cpp +++ /dev/null @@ -1,111 +0,0 @@ -/* - * Copyright (C) 2006, 2007, 2008 Apple 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. - */ - -#include "config.h" -#include "EventHandler.h" - -#include "ClipboardWin.h" -#include "Cursor.h" -#include "FloatPoint.h" -#include "FocusController.h" -#include "FrameView.h" -#include "Frame.h" -#include "HitTestRequest.h" -#include "HitTestResult.h" -#include "MouseEventWithHitTestResults.h" -#include "Page.h" -#include "PlatformKeyboardEvent.h" -#include "PlatformWheelEvent.h" -#include "Scrollbar.h" -#include "SelectionController.h" -#include "WCDataObject.h" -#include "NotImplemented.h" - -namespace WebCore { - -unsigned EventHandler::s_accessKeyModifiers = PlatformKeyboardEvent::AltKey; - -const double EventHandler::TextDragDelay = 0.0; - -bool EventHandler::passMousePressEventToSubframe(MouseEventWithHitTestResults& mev, Frame* subframe) -{ - subframe->eventHandler()->handleMousePressEvent(mev.event()); - return true; -} - -bool EventHandler::passMouseMoveEventToSubframe(MouseEventWithHitTestResults& mev, Frame* subframe, HitTestResult* hoveredNode) -{ - if (m_mouseDownMayStartDrag && !m_mouseDownWasInSubframe) - return false; - subframe->eventHandler()->handleMouseMoveEvent(mev.event(), hoveredNode); - return true; -} - -bool EventHandler::passMouseReleaseEventToSubframe(MouseEventWithHitTestResults& mev, Frame* subframe) -{ - subframe->eventHandler()->handleMouseReleaseEvent(mev.event()); - return true; -} - -bool EventHandler::passWheelEventToWidget(PlatformWheelEvent& wheelEvent, Widget* widget) -{ - if (!widget->isFrameView()) - return false; - - return static_cast<FrameView*>(widget)->frame()->eventHandler()->handleWheelEvent(wheelEvent); -} - -bool EventHandler::tabsToAllControls(KeyboardEvent*) const -{ - return true; -} - -bool EventHandler::eventActivatedView(const PlatformMouseEvent& event) const -{ - return event.activatedWebView(); -} - -PassRefPtr<Clipboard> EventHandler::createDraggingClipboard() const -{ - COMPtr<WCDataObject> dataObject; - WCDataObject::createInstance(&dataObject); - return ClipboardWin::create(true, dataObject.get(), ClipboardWritable); -} - -void EventHandler::focusDocumentView() -{ - Page* page = m_frame->page(); - if (!page) - return; - page->focusController()->setFocusedFrame(m_frame); -} - -bool EventHandler::passWidgetMouseDownEventToWidget(const MouseEventWithHitTestResults&) -{ - notImplemented(); - return false; -} - -} diff --git a/WebCore/page/win/FrameCGWin.cpp b/WebCore/page/win/FrameCGWin.cpp deleted file mode 100644 index ad22967..0000000 --- a/WebCore/page/win/FrameCGWin.cpp +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright (C) 2006, 2007, 2008 Apple 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. - */ - -#include "config.h" -#include "FrameWin.h" - -#include <windows.h> - -#include "FrameView.h" -#include "GraphicsContext.h" -#include "Settings.h" - -#include <CoreGraphics/CoreGraphics.h> - -using std::min; - -namespace WebCore { - -static void drawRectIntoContext(IntRect rect, FrameView* view, GraphicsContext* gc) -{ - IntSize offset = view->scrollOffset(); - rect.move(-offset.width(), -offset.height()); - rect = view->convertToContainingWindow(rect); - - gc->concatCTM(AffineTransform().translate(-rect.x(), -rect.y())); - - view->paint(gc, rect); -} - -HBITMAP imageFromSelection(Frame* frame, bool forceBlackText) -{ - frame->view()->setPaintRestriction(forceBlackText ? PaintRestrictionSelectionOnlyBlackText : PaintRestrictionSelectionOnly); - FloatRect fr = frame->selectionRect(); - IntRect ir(static_cast<int>(fr.x()), static_cast<int>(fr.y()), - static_cast<int>(fr.width()), static_cast<int>(fr.height())); - - void* bits; - HDC hdc = CreateCompatibleDC(0); - int w = ir.width(); - int h = ir.height(); - BITMAPINFO bmp = { { sizeof(BITMAPINFOHEADER), w, h, 1, 32 } }; - - HBITMAP hbmp = CreateDIBSection(0, &bmp, DIB_RGB_COLORS, static_cast<void**>(&bits), 0, 0); - HBITMAP hbmpOld = static_cast<HBITMAP>(SelectObject(hdc, hbmp)); - CGColorSpaceRef deviceRGB = CGColorSpaceCreateDeviceRGB(); - CGContextRef context = CGBitmapContextCreate(static_cast<void*>(bits), w, h, - 8, w * sizeof(RGBQUAD), deviceRGB, kCGBitmapByteOrder32Little | kCGImageAlphaPremultipliedFirst); - CGColorSpaceRelease(deviceRGB); - CGContextSaveGState(context); - - GraphicsContext gc(context); - - frame->document()->updateLayout(); - drawRectIntoContext(ir, frame->view(), &gc); - - CGContextRelease(context); - SelectObject(hdc, hbmpOld); - DeleteDC(hdc); - - frame->view()->setPaintRestriction(PaintRestrictionNone); - - return hbmp; -} - -} // namespace WebCore diff --git a/WebCore/page/win/FrameCairoWin.cpp b/WebCore/page/win/FrameCairoWin.cpp deleted file mode 100644 index a645a10..0000000 --- a/WebCore/page/win/FrameCairoWin.cpp +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (C) 2008 Apple 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. - */ - -#include "config.h" -#include "FrameWin.h" - -#include "EditorClient.h" -#include "NotImplemented.h" - -using std::min; - -namespace WebCore { - -HBITMAP imageFromSelection(Frame* frame, bool forceBlackText) -{ - notImplemented(); - return 0; -} - -} // namespace WebCore diff --git a/WebCore/page/win/FrameWin.cpp b/WebCore/page/win/FrameWin.cpp deleted file mode 100644 index 536f5d8..0000000 --- a/WebCore/page/win/FrameWin.cpp +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright (C) 2006, 2007, 2008 Apple 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. - */ - -#include "config.h" -#include "runtime.h" -#include "FrameWin.h" - -#include "AffineTransform.h" -#include "FloatRect.h" -#include "Document.h" -#include "FramePrivate.h" -#include "RenderView.h" -#include "Settings.h" - -using std::min; - -namespace WebCore { - -void computePageRectsForFrame(Frame* frame, const IntRect& printRect, float headerHeight, float footerHeight, float userScaleFactor, Vector<IntRect>& pages, int& outPageHeight) -{ - ASSERT(frame); - - pages.clear(); - outPageHeight = 0; - - if (!frame->document() || !frame->view() || !frame->document()->renderer()) - return; - - RenderView* root = static_cast<RenderView*>(frame->document()->renderer()); - - if (!root) { - LOG_ERROR("document to be printed has no renderer"); - return; - } - - if (userScaleFactor <= 0) { - LOG_ERROR("userScaleFactor has bad value %.2f", userScaleFactor); - return; - } - - float ratio = static_cast<float>(printRect.height()) / static_cast<float>(printRect.width()); - - float pageWidth = static_cast<float>(root->docWidth()); - float pageHeight = pageWidth * ratio; - outPageHeight = static_cast<int>(pageHeight); // this is the height of the page adjusted by margins - pageHeight -= (headerHeight + footerHeight); - - if (pageHeight <= 0) { - LOG_ERROR("pageHeight has bad value %.2f", pageHeight); - return; - } - - float currPageHeight = pageHeight / userScaleFactor; - float docHeight = root->layer()->height(); - float docWidth = root->layer()->width(); - float currPageWidth = pageWidth / userScaleFactor; - - - // always return at least one page, since empty files should print a blank page - float printedPagesHeight = 0.0f; - do { - float proposedBottom = min(docHeight, printedPagesHeight + pageHeight); - frame->adjustPageHeight(&proposedBottom, printedPagesHeight, proposedBottom, printedPagesHeight); - currPageHeight = max(1.0f, proposedBottom - printedPagesHeight); - - pages.append(IntRect(0, printedPagesHeight, currPageWidth, currPageHeight)); - printedPagesHeight += currPageHeight; - } while (printedPagesHeight < docHeight); -} - -DragImageRef Frame::dragImageForSelection() -{ - if (selection()->isRange()) - return imageFromSelection(this, false); - - return 0; -} - -} // namespace WebCore diff --git a/WebCore/page/win/FrameWin.h b/WebCore/page/win/FrameWin.h deleted file mode 100644 index 405c7b2..0000000 --- a/WebCore/page/win/FrameWin.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (C) 2006, 2007 Apple 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. - */ - -#ifndef FrameWin_H -#define FrameWin_H - -#include "Frame.h" - -// Forward declared so we don't need wingdi.h. -typedef struct HBITMAP__* HBITMAP; - -namespace WebCore { - - HBITMAP imageFromSelection(Frame* frame, bool forceWhiteText); - void computePageRectsForFrame(Frame*, const IntRect& printRect, float headerHeight, float footerHeight, float userScaleFactor,Vector<IntRect>& pages, int& pageHeight); - -} - -#endif diff --git a/WebCore/page/win/PageWin.cpp b/WebCore/page/win/PageWin.cpp deleted file mode 100644 index f4c744a..0000000 --- a/WebCore/page/win/PageWin.cpp +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (C) 2006, 2007 Apple 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. - */ - -#include "config.h" -#include "Page.h" - -#include "Frame.h" -#include "FrameView.h" -#include "FloatRect.h" -#include <windows.h> - -namespace WebCore { - -HINSTANCE Page::s_instanceHandle = 0; - -} // namespace WebCore |