Commit 5604daf5 authored by zecke's avatar zecke

2007-07-22 Holger Hans Peter Freyther <zecke@selfish.org>

        Reviewed by Adam.

        Add WebKit/gtk/Api and WebCoreSupport API to the INCLUDEPATH to allow GdkLauncher to be
        build against it.

        * WebKit.pri:


WebCore:
2007-07-22  Holger Hans Peter Freyther  <zecke@selfish.org>

        Reviewed by Adam.

        WARNING: NO TEST CASES ADDED OR CHANGED

        Add the WebKit/Gtk API to the buildsystem, ask qmake to create a
        pkg-config file and install headers and libraries.

        Start to emit signals from FrameLoaderClientGdk, hide the kit Frame
        inside the the FrameLoaderClientGdk.

        Move ChromeClientGdk to WebKit/gtk/WebCoreSupport

        * WebCore.pro:
        * loader/gdk/FrameLoaderClientGdk.cpp:
        * loader/gdk/FrameLoaderClientGdk.h:
        * platform/gdk/ChromeClientGdk.h: Removed.
        * platform/gdk/FrameGdk.cpp: Remove code not belonging here
        * platform/gdk/FrameGdk.h:
        * platform/gdk/ScrollViewGdk.cpp: The gdkDrawable won't exist at that time and it is fine
        * platform/gdk/TemporaryLinkStubs.cpp: Removed ChromeClientGdk stubs

WebKit:
2007-07-22  Holger Hans Peter Freyther  <zecke@selfish.org>

        Reviewed by Adam.

        Add the first API and partial implementation of the WebKit/Gtk port as
        of http://bugs.webkit.org/show_bug.cgi?id=14678.

        The delegates of WebView will be modeled as signals. Delegates like the
        WebPolicyDelegate will be implemented as signals with default handlers.

        Start moving files to WebKit/gtk/WebCoreSupport.

        * gtk: Added.
        * gtk/Api: Added.
        * gtk/Api/headers.pri: Added.
        * gtk/Api/webkitgtk-marshal.list: Added.
        * gtk/Api/webkitgtkdefines.h: Added.
        * gtk/Api/webkitgtkframe.cpp: Added.
        * gtk/Api/webkitgtkframe.h: Added.
        * gtk/Api/webkitgtkframedata.cpp: Added.
        * gtk/Api/webkitgtkframedata.h: Added.
        * gtk/Api/webkitgtkglobal.cpp: Added.
        * gtk/Api/webkitgtkglobal.h: Added.
        * gtk/Api/webkitgtknetworkrequest.cpp: Added.
        * gtk/Api/webkitgtknetworkrequest.h: Added.
        * gtk/Api/webkitgtkpage.cpp: Added.
        * gtk/Api/webkitgtkpage.h: Added.
        * gtk/Api/webkitgtkprivate.cpp: Added.
        * gtk/Api/webkitgtkprivate.h: Added.
        * gtk/Api/webkitgtksettings.cpp: Added.
        * gtk/Api/webkitgtksettings.h: Added.
        * gtk/WebCoreSupport: Added.
        * gtk/WebCoreSupport/ChromeClientGdk.cpp: Added.
        (WebCore::ChromeClientGdk::ChromeClientGdk):
        (WebCore::ChromeClientGdk::chromeDestroyed):
        (WebCore::ChromeClientGdk::windowRect):
        (WebCore::ChromeClientGdk::setWindowRect):
        (WebCore::ChromeClientGdk::pageRect):
        (WebCore::ChromeClientGdk::scaleFactor):
        (WebCore::ChromeClientGdk::focus):
        (WebCore::ChromeClientGdk::unfocus):
        (WebCore::ChromeClientGdk::createWindow):
        (WebCore::ChromeClientGdk::createModalDialog):
        (WebCore::ChromeClientGdk::show):
        (WebCore::ChromeClientGdk::canRunModal):
        (WebCore::ChromeClientGdk::runModal):
        (WebCore::ChromeClientGdk::setToolbarsVisible):
        (WebCore::ChromeClientGdk::toolbarsVisible):
        (WebCore::ChromeClientGdk::setStatusbarVisible):
        (WebCore::ChromeClientGdk::statusbarVisible):
        (WebCore::ChromeClientGdk::setScrollbarsVisible):
        (WebCore::ChromeClientGdk::scrollbarsVisible):
        (WebCore::ChromeClientGdk::setMenubarVisible):
        (WebCore::ChromeClientGdk::menubarVisible):
        (WebCore::ChromeClientGdk::setResizable):
        (WebCore::ChromeClientGdk::closeWindowSoon):
        (WebCore::ChromeClientGdk::canTakeFocus):
        (WebCore::ChromeClientGdk::takeFocus):
        (WebCore::ChromeClientGdk::canRunBeforeUnloadConfirmPanel):
        (WebCore::ChromeClientGdk::runBeforeUnloadConfirmPanel):
        (WebCore::ChromeClientGdk::addMessageToConsole):
        (WebCore::ChromeClientGdk::runJavaScriptAlert):
        (WebCore::ChromeClientGdk::runJavaScriptConfirm):
        (WebCore::ChromeClientGdk::runJavaScriptPrompt):
        (WebCore::ChromeClientGdk::setStatusbarText):
        (WebCore::ChromeClientGdk::shouldInterruptJavaScript):
        (WebCore::ChromeClientGdk::tabsToLinks):
        (WebCore::ChromeClientGdk::windowResizerRect):
        (WebCore::ChromeClientGdk::addToDirtyRegion):
        (WebCore::ChromeClientGdk::scrollBackingStore):
        (WebCore::ChromeClientGdk::updateBackingStore):
        (WebCore::ChromeClientGdk::mouseDidMoveOverElement):
        (WebCore::ChromeClientGdk::setToolTip):
        (WebCore::ChromeClientGdk::print):
        * gtk/WebCoreSupport/ChromeClientGdk.h: Added.

WebKitTools:
2007-07-22  Holger Hans Peter Freyther  <zecke@selfish.org>

        Reviewed by Adam.

        Make the GdkLauncher use the new WebKit/Gtk API. Change webkitdirs.pm to
        honor --qmakearg for the Gdk/Gtk build as well.

        * GdkLauncher/main.cpp: Switch to the new API
        * Scripts/webkitdirs.pm: Allow to specify --qmakearg, e.g. to control the WEBKIT_{INC,LIB}_DIR 





git-svn-id: http://svn.webkit.org/repository/webkit/trunk@24537 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 2a4134de
2007-07-22 Holger Hans Peter Freyther <zecke@selfish.org>
Reviewed by Adam.
Add WebKit/gtk/Api and WebCoreSupport API to the INCLUDEPATH to allow GdkLauncher to be
build against it.
* WebKit.pri:
2007-07-18 Simon Hausmann <hausmann@kde.org>
Reviewed by Zack.
......
2007-07-22 Holger Hans Peter Freyther <zecke@selfish.org>
Reviewed by Adam.
WARNING: NO TEST CASES ADDED OR CHANGED
Add the WebKit/Gtk API to the buildsystem, ask qmake to create a
pkg-config file and install headers and libraries.
Start to emit signals from FrameLoaderClientGdk, hide the kit Frame
inside the the FrameLoaderClientGdk.
Move ChromeClientGdk to WebKit/gtk/WebCoreSupport
* WebCore.pro:
* loader/gdk/FrameLoaderClientGdk.cpp:
* loader/gdk/FrameLoaderClientGdk.h:
* platform/gdk/ChromeClientGdk.h: Removed.
* platform/gdk/FrameGdk.cpp: Remove code not belonging here
* platform/gdk/FrameGdk.h:
* platform/gdk/ScrollViewGdk.cpp: The gdkDrawable won't exist at that time and it is fine
* platform/gdk/TemporaryLinkStubs.cpp: Removed ChromeClientGdk stubs
2007-07-22 Maciej Stachowiak <mjs@apple.com>
Reviewed by Adam.
......@@ -20,7 +20,7 @@ CONFIG -= warn_on
QMAKE_CXXFLAGS += -Wreturn-type
#QMAKE_CXXFLAGS += -Wall -Wno-undef -Wno-unused-parameter
qt-port:contains(QT_CONFIG, reduce_exports):CONFIG += hide_symbols
contains(QT_CONFIG, reduce_exports):CONFIG += hide_symbols
unix:contains(QT_CONFIG, reduce_relocations):CONFIG += bsymbolic_functions
linux-*: DEFINES += HAVE_STDINT_H
......@@ -89,7 +89,9 @@ gdk-port {
page/gdk \
platform/graphics/cairo \
platform/graphics/svg/cairo \
platform/network/curl
platform/network/curl \
../WebKit/gtk/Api \
../WebKit/gtk/WebCoreSupport
}
INCLUDEPATH += $$PWD \
......@@ -816,7 +818,18 @@ qt-port:SOURCES += \
../WebKitQt/Api/qwebobjectplugin.cpp \
../WebKitQt/Api/qwebobjectpluginconnector.cpp
gdk-port:SOURCES += \
gdk-port {
HEADERS += \
../WebKit/gtk/Api/webkitgtkdefines.h \
../WebKit/gtk/Api/webkitgtkframe.h \
../WebKit/gtk/Api/webkitgtkframedata.h \
../WebKit/gtk/Api/webkitgtkglobal.h \
../WebKit/gtk/Api/webkitgtknetworkrequest.h \
../WebKit/gtk/Api/webkitgtkpage.h \
../WebKit/gtk/Api/webkitgtkprivate.h \
../WebKit/gtk/Api/webkitgtksettings.h \
../WebKit/gtk/WebCoreSupport/ChromeClientGdk.h
SOURCES += \
platform/TextCodecICU.cpp \
platform/TextBreakIteratorICU.cpp \
page/gdk/EventHandlerGdk.cpp \
......@@ -866,7 +879,16 @@ gdk-port:SOURCES += \
platform/image-decoders/jpeg/JPEGImageDecoder.cpp \
platform/image-decoders/bmp/BMPImageDecoder.cpp \
platform/image-decoders/ico/ICOImageDecoder.cpp \
platform/image-decoders/xbm/XBMImageDecoder.cpp
platform/image-decoders/xbm/XBMImageDecoder.cpp \
../WebKit/gtk/Api/webkitgtkframe.cpp \
../WebKit/gtk/Api/webkitgtkframedata.cpp \
../WebKit/gtk/Api/webkitgtkglobal.cpp \
../WebKit/gtk/Api/webkitgtknetworkrequest.cpp \
../WebKit/gtk/Api/webkitgtkpage.cpp \
../WebKit/gtk/Api/webkitgtkprivate.cpp \
../WebKit/gtk/Api/webkitgtksettings.cpp \
../WebKit/gtk/WebCoreSupport/ChromeClientGdk.cpp
}
contains(DEFINES, ENABLE_ICONDATABASE=1) {
qt-port: INCLUDEPATH += $$[QT_INSTALL_PREFIX]/src/3rdparty/sqlite/
......@@ -1437,3 +1459,38 @@ qt-port {
}
}
gdk-port {
isEmpty(WEBKIT_LIB_DIR):WEBKIT_LIB_DIR=$$[QT_INSTALL_LIBS]
isEmpty(WEBKIT_INC_DIR):WEBKIT_INC_DIR=$$[QT_INSTALL_HEADERS]/WebKitGtk
target.path = $$WEBKIT_LIB_DIR
include($$PWD/../WebKit/gtk/Api/headers.pri)
headers.files = $$WEBKIT_API_HEADERS
headers.path = $$WEBKIT_INC_DIR
INSTALLS += target headers
unix {
CONFIG += create_pc create_prl
QMAKE_PKGCONFIG_LIBDIR = $$target.path
QMAKE_PKGCONFIG_INCDIR = $$headers.path
QMAKE_PKGCONFIG_DESTDIR = pkgconfig
lib_replace.match = $$DESTDIR
lib_replace.replace = $$[QT_INSTALL_LIBS]
QMAKE_PKGCONFIG_INSTALL_REPLACE += lib_replace
}
GENMARSHALS = ../WebKit/gtk/Api/webkitgtk-marshal.list
GENMARSHALS_PREFIX = webkit_gtk_marshal
#
# integrate glib-genmarshal as additional compiler
#
QMAKE_GENMARSHAL_CC = glib-genmarshal
glib-genmarshal.commands = $${QMAKE_GENMARSHAL_CC} --prefix=$${GENMARSHALS_PREFIX} ${QMAKE_FILE_IN} --header --body >${QMAKE_FILE_OUT}
glib-genmarshal.output = $$OUT_PWD/${QMAKE_FILE_BASE}.h
glib-genmarshal.input = GENMARSHALS
glib-genmarshal.CONFIG = no_link
glib-genmarshal.variable_out = PRE_TARGETDEPS
glib-genmarshal.name = GENMARSHALS
QMAKE_EXTRA_UNIX_COMPILERS += glib-genmarshal
}
......@@ -4,6 +4,7 @@
* Copyright (C) 2006 Apple Computer, Inc. All rights reserved.
* Copyright (C) 2007 Trolltech ASA
* Copyright (C) 2007 Alp Toker <alp.toker@collabora.co.uk>
* Copyright (C) 2007 Holger Hans Peter Freyther
*
* All rights reserved.
*
......@@ -38,19 +39,22 @@
#include "NotImplemented.h"
#include "PlatformString.h"
#include "ResourceRequest.h"
#include "CString.h"
#include "ProgressTracker.h"
#include "webkitgtkpage.h"
#include "webkitgtkframe.h"
#include "webkitgtkprivate.h"
#include <stdio.h>
using namespace WebKitGtk;
namespace WebCore {
FrameLoaderClientGdk::FrameLoaderClientGdk()
: m_frame(0)
FrameLoaderClientGdk::FrameLoaderClientGdk(WebKitGtkFrame* frame)
: m_frame(frame)
, m_firstData(false)
{
}
Frame* FrameLoaderClientGdk::frame()
{
return static_cast<Frame*>(m_frame);
ASSERT(m_frame);
}
String FrameLoaderClientGdk::userAgent(const KURL&)
......@@ -67,17 +71,15 @@ WTF::PassRefPtr<WebCore::DocumentLoader> FrameLoaderClientGdk::createDocumentLoa
void FrameLoaderClientGdk::dispatchWillSubmitForm(FramePolicyFunction policyFunction, PassRefPtr<FormState>)
{
// FIXME: This is surely too simple
ASSERT(frame() && policyFunction);
if (!frame() || !policyFunction)
ASSERT(policyFunction);
if (!policyFunction)
return;
(frame()->loader()->*policyFunction)(PolicyUse);
(core(m_frame)->loader()->*policyFunction)(PolicyUse);
}
void FrameLoaderClientGdk::committedLoad(DocumentLoader* loader, const char* data, int length)
{
if (!frame())
return;
FrameLoader *fl = loader->frameLoader();
fl->setEncoding(m_response.textEncodingName(), false);
fl->addData(data, length);
......@@ -105,17 +107,23 @@ void FrameLoaderClientGdk::assignIdentifierToInitialRequest(unsigned long identi
void FrameLoaderClientGdk::postProgressStartedNotification()
{
// no progress notification for now
WebKitGtkPage* page = getPageFromFrame(m_frame);
g_signal_emit_by_name(page, "load_started", m_frame);
}
void FrameLoaderClientGdk::postProgressEstimateChangedNotification()
{
// no progress notification for now
WebKitGtkPage* kitPage = getPageFromFrame(m_frame);
Page* corePage = core(kitPage);
g_signal_emit_by_name(kitPage, "load_progress_changed", lround(corePage->progress()->estimatedProgress()*100));
}
void FrameLoaderClientGdk::postProgressFinishedNotification()
{
// no progress notification for now
WebKitGtkPage* page = getPageFromFrame(m_frame);
g_signal_emit_by_name(page, "load_finished", m_frame);
}
void FrameLoaderClientGdk::frameLoaderDestroyed()
......@@ -133,28 +141,28 @@ void FrameLoaderClientGdk::dispatchDidReceiveResponse(DocumentLoader*, unsigned
void FrameLoaderClientGdk::dispatchDecidePolicyForMIMEType(FramePolicyFunction policyFunction, const String&, const ResourceRequest&)
{
// FIXME: we need to call directly here (comment copied from Qt version)
ASSERT(frame() && policyFunction);
if (!frame() || !policyFunction)
ASSERT(policyFunction);
if (!policyFunction)
return;
(frame()->loader()->*policyFunction)(PolicyUse);
(core(m_frame)->loader()->*policyFunction)(PolicyUse);
}
void FrameLoaderClientGdk::dispatchDecidePolicyForNewWindowAction(FramePolicyFunction policyFunction, const NavigationAction&, const ResourceRequest&, const String&)
{
ASSERT(frame() && policyFunction);
if (!frame() || !policyFunction)
ASSERT(policyFunction);
if (!policyFunction)
return;
// FIXME: I think Qt version marshals this to another thread so when we
// have multi-threaded download, we might need to do the same
(frame()->loader()->*policyFunction)(PolicyIgnore);
(core(m_frame)->loader()->*policyFunction)(PolicyIgnore);
}
void FrameLoaderClientGdk::dispatchDecidePolicyForNavigationAction(FramePolicyFunction policyFunction, const NavigationAction&, const ResourceRequest&)
{
ASSERT(frame() && policyFunction);
if (!frame() || !policyFunction)
ASSERT(policyFunction);
if (!policyFunction)
return;
(frame()->loader()->*policyFunction)(PolicyUse);
(core(m_frame)->loader()->*policyFunction)(PolicyUse);
}
Widget* FrameLoaderClientGdk::createPlugin(Element*, const KURL&, const Vector<String>&, const Vector<String>&, const String&, bool)
......@@ -203,7 +211,7 @@ String FrameLoaderClientGdk::overrideMediaType() const
void FrameLoaderClientGdk::windowObjectCleared() const
{
notImplemented();
g_signal_emit_by_name(m_frame, "cleared");
}
void FrameLoaderClientGdk::setMainFrameDocumentReady(bool)
......@@ -225,8 +233,7 @@ bool FrameLoaderClientGdk::hasFrameView() const
void FrameLoaderClientGdk::dispatchDidFinishLoad()
{
FrameGdk *frameGdk = static_cast<FrameGdk*>(m_frame);
frameGdk->onDidFinishLoad();
g_signal_emit_by_name(m_frame, "load_done", true);
}
void FrameLoaderClientGdk::frameLoadCompleted()
......@@ -269,9 +276,23 @@ void FrameLoaderClientGdk::dispatchDidCancelClientRedirect() { notImplemented();
void FrameLoaderClientGdk::dispatchWillPerformClientRedirect(const KURL&, double, double) { notImplemented(); }
void FrameLoaderClientGdk::dispatchDidChangeLocationWithinPage() { notImplemented(); }
void FrameLoaderClientGdk::dispatchWillClose() { notImplemented(); }
void FrameLoaderClientGdk::dispatchDidReceiveIcon() { notImplemented(); }
void FrameLoaderClientGdk::dispatchDidStartProvisionalLoad() { notImplemented(); }
void FrameLoaderClientGdk::dispatchDidReceiveTitle(const String&) { notImplemented(); }
void FrameLoaderClientGdk::dispatchDidReceiveIcon()
{
WebKitGtkPage* page = getPageFromFrame(m_frame);
g_signal_emit_by_name(page, "icon_loaded", m_frame);
}
void FrameLoaderClientGdk::dispatchDidStartProvisionalLoad()
{
}
void FrameLoaderClientGdk::dispatchDidReceiveTitle(const String& title)
{
notImplemented();
}
void FrameLoaderClientGdk::dispatchDidCommitLoad() { notImplemented(); }
void FrameLoaderClientGdk::dispatchDidFinishDocumentLoad() { notImplemented(); }
void FrameLoaderClientGdk::dispatchDidFirstLayout() { notImplemented(); }
......@@ -292,17 +313,46 @@ bool FrameLoaderClientGdk::canHandleRequest(const ResourceRequest&) const { notI
bool FrameLoaderClientGdk::canShowMIMEType(const String&) const { notImplemented(); return true; }
bool FrameLoaderClientGdk::representationExistsForURLScheme(const String&) const { notImplemented(); return false; }
String FrameLoaderClientGdk::generatedMIMETypeForURLScheme(const String&) const { notImplemented(); return String(); }
void FrameLoaderClientGdk::provisionalLoadStarted() { notImplemented(); }
void FrameLoaderClientGdk::didFinishLoad() { notImplemented(); }
void FrameLoaderClientGdk::provisionalLoadStarted()
{
notImplemented();
}
void FrameLoaderClientGdk::didFinishLoad() {
notImplemented();
}
void FrameLoaderClientGdk::prepareForDataSourceReplacement() { notImplemented(); }
void FrameLoaderClientGdk::setTitle(const String&, const KURL&) { notImplemented(); }
void FrameLoaderClientGdk::setTitle(const String& title, const KURL& url)
{
WebKitGtkPage* page = getPageFromFrame(m_frame);
CString titleString = title.utf8();
DeprecatedCString urlString = url.prettyURL().utf8();
g_signal_emit_by_name(m_frame, "title_changed", titleString.data(), urlString.data());
if (m_frame == webkit_gtk_page_get_main_frame(page))
g_signal_emit_by_name(page, "title_changed", titleString.data(), urlString.data());
}
void FrameLoaderClientGdk::setDocumentViewFromCachedPage(WebCore::CachedPage*) { notImplemented(); }
void FrameLoaderClientGdk::dispatchDidReceiveContentLength(DocumentLoader*, unsigned long identifier, int lengthReceived) { notImplemented(); }
void FrameLoaderClientGdk::dispatchDidFinishLoading(DocumentLoader*, unsigned long identifier) { notImplemented(); }
void FrameLoaderClientGdk::dispatchDidFailLoading(DocumentLoader*, unsigned long identifier, const ResourceError&) { notImplemented(); }
bool FrameLoaderClientGdk::dispatchDidLoadResourceFromMemoryCache(DocumentLoader*, const ResourceRequest&, const ResourceResponse&, int length) { notImplemented(); return false; }
void FrameLoaderClientGdk::dispatchDidFailProvisionalLoad(const ResourceError&) { notImplemented(); }
void FrameLoaderClientGdk::dispatchDidFailLoad(const ResourceError&) { notImplemented(); }
void FrameLoaderClientGdk::dispatchDidFailProvisionalLoad(const ResourceError&)
{
g_signal_emit_by_name(m_frame, "load_done", false);
}
void FrameLoaderClientGdk::dispatchDidFailLoad(const ResourceError&)
{
g_signal_emit_by_name(m_frame, "load_done", false);
}
void FrameLoaderClientGdk::download(ResourceHandle*, const ResourceRequest&, const ResourceRequest&, const ResourceResponse&) { notImplemented(); }
ResourceError FrameLoaderClientGdk::cancelledError(const ResourceRequest&) { notImplemented(); return ResourceError(); }
ResourceError FrameLoaderClientGdk::blockedError(const ResourceRequest&) { notImplemented(); return ResourceError(); }
......
......@@ -33,18 +33,19 @@
#include "ResourceResponse.h"
typedef struct _WebKitGtkFrame WebKitGtkFrame;
namespace WebCore {
class FrameGdk;
class FrameLoaderClientGdk : public FrameLoaderClient {
public:
FrameLoaderClientGdk();
FrameLoaderClientGdk(WebKitGtkFrame*);
virtual ~FrameLoaderClientGdk() { }
virtual void frameLoaderDestroyed();
void setFrame(FrameGdk *frame) { m_frame = frame; }
Frame* frame();
WebKitGtkFrame* webFrame() const { return m_frame; }
virtual bool hasWebView() const;
virtual bool hasFrameView() const;
......@@ -177,7 +178,7 @@ namespace WebCore {
virtual bool canCachePage() const;
virtual void download(ResourceHandle*, const ResourceRequest&, const ResourceRequest&, const ResourceResponse&);
private:
FrameGdk *m_frame;
WebKitGtkFrame* m_frame;
ResourceResponse m_response;
bool m_firstData;
};
......
/*
* 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 ChromeClientGdk_h
#define ChromeClientGdk_h
#include "ChromeClient.h"
namespace WebCore {
class ChromeClientGdk : public ChromeClient {
public:
virtual ~ChromeClientGdk() { }
virtual void chromeDestroyed();
virtual void setWindowRect(const FloatRect&);
virtual FloatRect windowRect();
virtual FloatRect pageRect();
virtual float scaleFactor();
virtual void focus();
virtual void unfocus();
virtual bool canTakeFocus(FocusDirection);
virtual void takeFocus(FocusDirection);
virtual Page* createWindow(Frame*, const FrameLoadRequest&);
virtual Page* createModalDialog(Frame*, const FrameLoadRequest&);
virtual void show();
virtual bool canRunModal();
virtual void runModal();
virtual void setToolbarsVisible(bool);
virtual bool toolbarsVisible();
virtual void setStatusbarVisible(bool);
virtual bool statusbarVisible();
virtual void setScrollbarsVisible(bool);
virtual bool scrollbarsVisible();
virtual void setMenubarVisible(bool);
virtual bool menubarVisible();
virtual void setResizable(bool);
virtual void addMessageToConsole(const String& message, unsigned int lineNumber,
const String& sourceID);
virtual bool canRunBeforeUnloadConfirmPanel();
virtual bool runBeforeUnloadConfirmPanel(const String& message, Frame* frame);
virtual void closeWindowSoon();
virtual void runJavaScriptAlert(Frame*, const String&);
virtual bool runJavaScriptConfirm(Frame*, const String&);
virtual bool runJavaScriptPrompt(Frame*, const String& message, const String& defaultValue, String& result);
virtual void setStatusbarText(const String&);
virtual bool shouldInterruptJavaScript();
virtual bool tabsToLinks() const;
virtual IntRect windowResizerRect() const;
virtual void addToDirtyRegion(const IntRect&);
virtual void scrollBackingStore(int dx, int dy, const IntRect& scrollViewRect, const IntRect& clipRect);
virtual void updateBackingStore();
virtual void mouseDidMoveOverElement(const HitTestResult&, unsigned modifierFlags);
virtual void setToolTip(const String&);
virtual void print(Frame*);
};
}
#endif // ChromeClientGdk_h
......@@ -39,9 +39,12 @@
#include "NotImplemented.h"
#include "Page.h"
#include "PlatformKeyboardEvent.h"
#include "webkitgtkprivate.h"
#include <stdio.h>
using namespace WebKitGtk;
namespace WebCore {
bool EditorClientGdk::shouldDeleteRange(Range*)
......@@ -207,12 +210,11 @@ void EditorClientGdk::toggleContinuousSpellChecking()
void EditorClientGdk::toggleGrammarChecking()
{
EditorClientGdk();
}
void EditorClientGdk::handleKeypress(KeyboardEvent* event)
{
Frame* frame = m_page->focusController()->focusedOrMainFrame();
Frame* frame = core(m_page)->focusController()->focusedOrMainFrame();
if (!frame)
return;
......@@ -255,13 +257,9 @@ void EditorClientGdk::handleInputMethodKeypress(KeyboardEvent*)
notImplemented();
}
EditorClientGdk::EditorClientGdk()
{
}
void EditorClientGdk::setPage(Page* page)
EditorClientGdk::EditorClientGdk(WebKitGtkPage* page)
: m_page(page)
{
m_page = page;
}
void EditorClientGdk::textFieldDidBeginEditing(Element*)
......
......@@ -34,13 +34,15 @@
#include <wtf/Forward.h>
typedef struct _WebKitGtkPage WebKitGtkPage;
namespace WebCore {
class Page;
class EditorClientGdk : public EditorClient {
public:
EditorClientGdk();
EditorClientGdk(WebKitGtkPage*);
// from EditorClient
virtual void pageDestroyed();
......@@ -102,11 +104,8 @@ public:
virtual bool spellingUIIsShowing();
virtual void getGuessesForWord(const String&, Vector<String>& guesses);
// EditorClientGdk only
void setPage(Page*);
private:
Page* m_page;
WebKitGtkPage* m_page;
};
}
......
......@@ -54,6 +54,7 @@
#include "SelectionController.h"
#include "Settings.h"
#include "TypingCommand.h"
#include "webkitgtkframe.h"
#include <gdk/gdk.h>
#include <gtk/gtk.h>
......@@ -88,9 +89,6 @@ namespace WebCore {
FrameGdk::FrameGdk(Page* page, HTMLFrameOwnerElement* ownerElement, FrameLoaderClientGdk* frameLoader)
: Frame(page, ownerElement, frameLoader)
{
m_exitAfterLoading = false;
m_dumpRenderTreeAfterLoading = false;
Settings* settings = page->settings();
settings->setLoadsImagesAutomatically(true);
settings->setMinimumFontSize(5);
......@@ -104,8 +102,6 @@ FrameGdk::FrameGdk(Page* page, HTMLFrameOwnerElement* ownerElement, FrameLoaderC
settings->setSansSerifFontFamily("Arial");
settings->setFixedFontFamily("Courier");
settings->setStandardFontFamily("Arial");
frameLoader->setFrame(this);
}
FrameGdk::~FrameGdk()
......@@ -113,14 +109,6 @@ FrameGdk::~FrameGdk()
loader()->cancelAndClear();
}
void FrameGdk::onDidFinishLoad()
{
if (dumpRenderTreeAfterLoading())
dumpRenderTree();
if (exitAfterLoading())
gtk_main_quit(); // FIXME: a bit drastic?
}
void FrameGdk::dumpRenderTree() const
{
if (view()->needsLayout())
......
......@@ -40,6 +40,7 @@ class FrameGdk;
class FrameLoaderClientGdk;
class FormData;
class FrameGdk : public Frame {
public:
FrameGdk(Page*, HTMLFrameOwnerElement*, FrameLoaderClientGdk*);
......@@ -49,17 +50,6 @@ public:
bool keyPress(const PlatformKeyboardEvent& keyEvent);
void dumpRenderTree() const;
void setExitAfterLoading(bool exitAfterLoading) { m_exitAfterLoading = exitAfterLoading; }
bool exitAfterLoading() const { return m_exitAfterLoading; }
void setDumpRenderTreeAfterLoading(bool dumpRenderTreeAfterLoading) { m_dumpRenderTreeAfterLoading = dumpRenderTreeAfterLoading; }
bool dumpRenderTreeAfterLoading() const { return m_dumpRenderTreeAfterLoading; }
void onDidFinishLoad();
private:
bool m_exitAfterLoading;
bool m_dumpRenderTreeAfterLoading;
};
}
......
......@@ -54,8 +54,6 @@ public:
, vScrollbarMode(ScrollbarAuto)
, hScrollbarMode(ScrollbarAuto)
, layout(0)
, horizontalAdjustment(0)
, verticalAdjustment(0)
, scrollBarsNeedUpdate(false)
{ }
......@@ -64,8 +62,6 @@ public:
ScrollbarMode vScrollbarMode;
ScrollbarMode hScrollbarMode;
GtkLayout *layout;
GtkAdjustment *horizontalAdjustment;
GtkAdjustment *verticalAdjustment;
IntSize contentsSize;
IntSize viewPortSize;
bool scrollBarsNeedUpdate;
......@@ -151,14 +147,14 @@ void ScrollView::resizeContents(int w, int h)
int ScrollView::contentsX() const
{
g_return_val_if_fail(m_data->horizontalAdjustment, 0);
return static_cast<int>(gtk_adjustment_get_value(m_data->horizontalAdjustment));
g_return_val_if_fail(gtk_layout_get_hadjustment(m_data->layout), 0);
return static_cast<int>(gtk_adjustment_get_value(gtk_layout_get_hadjustment(m_data->layout)));
}
int ScrollView::contentsY() const
{
g_return_val_if_fail(m_data->verticalAdjustment, 0);
return static_cast<int>(gtk_adjustment_get_value(m_data->verticalAdjustment));
g_return_val_if_fail(gtk_layout_get_vadjustment(m_data->layout), 0);