FrameQt.cpp 3.83 KB
Newer Older
1 2 3 4 5 6 7
/*
 * Copyright (C) 2006 Dirk Mueller <mueller@kde.org>
 * Copyright (C) 2006 Zack Rusin <zack@kde.org>
 * Copyright (C) 2006 George Staikos <staikos@kde.org>
 * Copyright (C) 2006 Simon Hausmann <hausmann@kde.org>
 * Copyright (C) 2006 Rob Buis <buis@kde.org>
 * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org>
mjs's avatar
mjs committed
8
 * Copyright (C) 2007 Trolltech ASA
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
 *
 * 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"
mjs's avatar
mjs committed
35
#include "Frame.h"
darin's avatar
darin committed
36

37 38 39 40 41 42 43 44
#include "Element.h"
#include "RenderObject.h"
#include "RenderWidget.h"
#include "RenderLayer.h"
#include "Page.h"
#include "Document.h"
#include "HTMLElement.h"
#include "DOMWindow.h"
weinig's avatar
weinig committed
45
#include "FrameLoadRequest.h"
andersca's avatar
andersca committed
46
#include "FrameLoaderClientQt.h"
47
#include "DOMImplementation.h"
mjs's avatar
mjs committed
48
#include "ResourceHandleInternal.h"
49 50 51
#include "Document.h"
#include "Settings.h"
#include "Plugin.h"
andersca's avatar
andersca committed
52
#include "FrameView.h"
53 54 55
#include "FramePrivate.h"
#include "GraphicsContext.h"
#include "HTMLDocument.h"
mjs's avatar
mjs committed
56
#include "ResourceHandle.h"
andersca's avatar
andersca committed
57
#include "FrameLoader.h"
58 59 60 61 62
#include "PlatformMouseEvent.h"
#include "PlatformKeyboardEvent.h"
#include "PlatformWheelEvent.h"
#include "MouseEventWithHitTestResults.h"
#include "SelectionController.h"
andersca's avatar
andersca committed
63
#include "kjs_proxy.h"
64
#include "TypingCommand.h"
65 66 67
#include "JSLock.h"
#include "kjs_window.h"
#include "runtime_root.h"
68
#include "runtime.h"
69
#include <QScrollArea>
kevino's avatar
kevino committed
70
#include "NotImplemented.h"
71 72 73

namespace WebCore {

darin's avatar
darin committed
74 75
// FIXME: Turned this off to fix buildbot. This function be either deleted or used.
#if 0
76 77 78 79
static void doScroll(const RenderObject* r, bool isHorizontal, int multiplier)
{
    // FIXME: The scrolling done here should be done in the default handlers
    // of the elements rather than here in the part.
aroben's avatar
aroben committed
80
    if (!r)
81 82 83 84 85
        return;

    //broken since it calls scroll on scrollbars
    //and we have none now
    //r->scroll(direction, KWQScrollWheel, multiplier);
aroben's avatar
aroben committed
86
    if (!r->layer())
87 88 89 90
        return;

    int x = r->layer()->scrollXOffset();
    int y = r->layer()->scrollYOffset();
aroben's avatar
aroben committed
91
    if (isHorizontal)
92 93 94 95 96 97
        x += multiplier;
    else
        y += multiplier;

    r->layer()->scrollToOffset(x, y, true, true);
}
darin's avatar
darin committed
98
#endif
99

mjs's avatar
mjs committed
100
KJS::Bindings::Instance* Frame::createScriptInstanceForWidget(WebCore::Widget* widget)
101
{
102 103 104
    return KJS::Bindings::Instance::createBindingForLanguageInstance(KJS::Bindings::Instance::QtLanguage,
                                                                     widget->qwidget(),
                                                                     bindingRootObject());
105 106
}

bdash's avatar
bdash committed
107
void Frame::clearPlatformScriptObjects()
108 109 110
{
}

111 112 113 114 115
DragImageRef Frame::dragImageForSelection() 
{
    return 0;
}
    
aroben's avatar
aroben committed
116 117 118
void Frame::dashboardRegionsChanged()
{
}
119

120
}
121
// vim: ts=4 sw=4 et