+2007-01-26 George Staikos <staikos@kde.org>
+
+ Remove headers - not needed now.
+
+ * WebKit.pri:
+
2007-01-23 George Staikos <staikos@kde.org>
Put everything back since we can't build everything without it yet.
+2007-01-26 George Staikos <staikos@kde.org>
+
+ Reviewed by Zack.
+
+ Qt implementation.
+
+ * WebCore.pro:
+ * platform/qt/FontPlatformDataQt.cpp:
+ (WebCore::FontPlatformData::FontPlatformData):
+ * platform/qt/ScrollViewQt.cpp:
+ (WebCore::ScrollView::scrollbarUnderMouse):
+
2007-01-26 Brady Eidson <beidson@apple.com>
Reviewed by Anders' rubberstamp
platform/qt/GlyphPageTreeNodeQt.cpp \
platform/qt/CookieJarQt.cpp \
platform/qt/FontPlatformDataQt.cpp \
- platform/qt/PlatformScrollBarQt.cpp \
platform/qt/ScrollViewQt.cpp \
+ platform/qt/PlatformScrollBarQt.cpp \
platform/qt/TemporaryLinkStubs.cpp \
platform/qt/CursorQt.cpp \
platform/qt/WidgetQt.cpp \
m_font->setFamily(familyName.domString());
m_font->setPixelSize(qRound(fontDescription.computedSize()));
m_font->setItalic(fontDescription.italic());
- m_font->setWeight(fontDescription.weight());
+ if (fontDescription.bold()) {
+ // Qt's Bold is 75, Webkit is 63.
+ m_font->setWeight(QFont::Bold);
+ } else {
+ m_font->setWeight(fontDescription.weight());
+ }
}
FontPlatformData::~FontPlatformData()
#include "FrameView.h"
#include "FloatRect.h"
#include "IntPoint.h"
+#include "PlatformMouseEvent.h"
#include "FrameQt.h"
#include "ScrollViewCanvasQt.h"
+#include <QDebug>
#include <QScrollBar>
#include <QScrollArea>
PlatformScrollbar* ScrollView::scrollbarUnderMouse(const PlatformMouseEvent& mouseEvent)
{
// Probably don't care about this.
+#if 0
+ // Not so sure: frames with scrollbars have the wrong mouse cursor over
+ // the scrollbar. Is this why? FIXME
+ if (m_area->horizontalScrollBar()->geometry().contains(mouseEvent.pos())) {
+ return m_area->horizontalScrollBar();
+ }
+ if (m_area->verticalScrollBar()->geometry().contains(mouseEvent.pos())) {
+ return m_area->verticalScrollBar();
+ }
+#endif
return 0;
}
INCLUDEPATH += $$PWD/WebKitQt/Api
-# Remove this once we can actually use the API
-INCLUDEPATH += $$PWD/JavaScriptCore \
- $$PWD/WebCore \
- $$PWD/WebCore/platform \
- $$PWD/WebCore/platform/qt \
- $$PWD/WebCore/platform/network \
- $$PWD/WebCore/platform/graphics \
- $$PWD/WebCore/editing \
- $$PWD/WebCore/page \
- $$PWD/WebCore/page/qt \
- $$PWD/WebCore/dom \
- $$PWD/WebCore/html \
- $$PWD/WebCore/history \
- $$PWD/WebCore/rendering \
- $$PWD/WebCore/loader \
- $$PWD/WebCore/loader/qt \
- $$PWD/WebCore/css \
- $$PWD/WebCore/bridge \
- $$PWD/WebKitQt/WebCoreSupport
-
DEFINES += BUILDING_QT__=1
isEmpty(OUTPUT_DIR):OUTPUT_DIR=$$PWD/WebKitBuild/Release
/*
Copyright (C) 2007 Trolltech ASA
+ Copyright (C) 2007 Staikos Computing Services Inc.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
: QScrollArea(parent->widget())
, d(new QWebFramePrivate)
{
+ setLineWidth(0);
+ setMidLineWidth(0);
+ setFrameShape(QFrame::NoFrame);
d->page = parent->d->page;
d->frameLoaderClient = new FrameLoaderClientQt();
return externalRepresentation(d->frame->renderer());
}
+QString QWebFrame::title() const
+{
+ if (d->frame->document())
+ return d->frame->document()->title();
+ else return QString();
+}
QWebPage * QWebFrame::page() const
{
return d->page;
}
+QString QWebFrame::selectedText() const
+{
+ return d->frame->selectedText();
+}
+
void QWebFrame::resizeEvent(QResizeEvent *e)
{
QScrollArea::resizeEvent(e);
/*
Copyright (C) 2007 Trolltech ASA
+ Copyright (C) 2007 Staikos Computing Services Inc.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
QString markup() const;
QString innerText() const;
QString renderTreeDump() const;
+ QString selectedText() const;
+ QString title() const;
signals:
void cleared();
void loadDone(bool ok);
+ void titleChanged(const QString& title);
protected:
void resizeEvent(QResizeEvent *);
/*
Copyright (C) 2007 Trolltech ASA
+ Copyright (C) 2007 Staikos Computing Services Inc.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
/*
Copyright (C) 2007 Trolltech ASA
+ Copyright (C) 2007 Staikos Computing Services Inc.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
#include "KURL.h"
#include "qboxlayout.h"
+#include <QDebug>
+
using namespace WebCore;
QWebPagePrivate::QWebPagePrivate(QWebPage *qq)
{
if (parentFrame)
return new QWebFrame(parentFrame, frameData);
- return new QWebFrame(this, frameData);
+ QWebFrame *f = new QWebFrame(this, frameData);
+ connect(f, SIGNAL(titleChanged(const QString&)), this, SIGNAL(titleChanged(const QString&)));
+ return f;
}
void QWebPage::open(const QUrl &url)
{
- d->createMainFrame();
+ mainFrame()->d->frame->loader()->load(KURL(url.toString()));
+}
+
+QUrl QWebPage::url() const
+{
+ return QUrl((QString)mainFrame()->d->frame->loader()->url().url());
+}
- d->mainFrame->d->frame->loader()->load(KURL(url.toString()));
+QString QWebPage::title() const
+{
+ return mainFrame()->title();
}
QWebFrame *QWebPage::mainFrame() const
return d->mainFrame;
}
+QWebFrame *QWebPage::focusFrame() const
+{
+ Q_ASSERT(false);
+ return mainFrame(); // FIXME: this is not correct
+}
QSize QWebPage::sizeHint() const
{
return QSize(800, 600);
}
+void QWebPage::stop()
+{
+ FrameLoader *f = mainFrame()->d->frame->loader();
+ f->cancelMainResourceLoad();
+ f->stopAllLoaders();
+}
+
QWebPageHistory QWebPage::history() const
{
WebCore::BackForwardList *lst = d->page->backForwardList();
/*
Copyright (C) 2007 Trolltech ASA
+ Copyright (C) 2007 Staikos Computing Services Inc.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
void open(const QUrl &url);
-
QWebFrame *mainFrame() const;
+ QWebFrame *focusFrame() const;
+
QWebPageHistory history() const;
QSize sizeHint() const;
+ QString title() const;
+
+ QUrl url() const;
+
public slots:
+ /**
+ * Stops loading of the page, if loading.
+ */
+ void stop();
+
void goBack();
void goForward();
void goToHistoryItem(const QWebHistoryItem &item);
+
signals:
/**
* Signal is emitted when load is started on one of the child
* load finished is passed as an argument.
*/
void loadFinished(QWebFrame *frame);
+ /**
+ * Signal is emitted when the title of this page has changed.
+ * Applies only to the main frame. Sub-frame titles do not trigger this.
+ */
+ void titleChanged(const QString& title);
protected:
virtual QWebFrame *createFrame(QWebFrame *parentFrame, QWebFrameData *frameData);
+2007-01-26 George Staikos <staikos@kde.org>
+
+ Reviewed by Zack.
+
+ Qt implementation.
+
+ * Api/qwebframe.cpp:
+ (QWebFrame::QWebFrame):
+ (QWebFrame::title):
+ (QWebFrame::selectedText):
+ * Api/qwebframe.h:
+ * Api/qwebframe_p.h:
+ * Api/qwebpage.cpp:
+ (QWebPage::createFrame):
+ (QWebPage::open):
+ (QWebPage::url):
+ (QWebPage::title):
+ (QWebPage::focusFrame):
+ (QWebPage::stop):
+ * Api/qwebpage.h:
+ * WebCoreSupport/FrameLoaderClientQt.cpp:
+ (WebCore::FrameLoaderClientQt::setFrame):
+ (WebCore::FrameLoaderClientQt::detachFrameLoader):
+ (WebCore::FrameLoaderClientQt::dispatchDidReceiveTitle):
+ (WebCore::FrameLoaderClientQt::didChangeTitle):
+ (WebCore::FrameLoaderClientQt::setTitle):
+ * WebCoreSupport/FrameLoaderClientQt.h:
+
2007-01-26 Lars Knoll <lars@trolltech.com>
Make it compile again with Qt 4.2 and add the copyright
m_webFrame->page(), SIGNAL(loadProgressChanged(double)));
connect(this, SIGNAL(loadFinished(QWebFrame*)),
m_webFrame->page(), SIGNAL(loadFinished(QWebFrame *)));
+ connect(this, SIGNAL(titleChanged(const QString&)),
+ m_webFrame, SIGNAL(titleChanged(const QString&)));
}
void FrameLoaderClientQt::detachFrameLoader()
disconnect(this, SIGNAL(loadStarted(QWebFrame*)));
disconnect(this, SIGNAL(loadProgressChanged(double)));
disconnect(this, SIGNAL(loadFinished(QWebFrame*)));
+ disconnect(this, SIGNAL(titleChanged(const QString&)));
m_webFrame = 0;
m_frame = 0;
}
void FrameLoaderClientQt::dispatchDidReceiveTitle(const String& title)
{
- notImplemented();
+ setTitle(title);
}
void FrameLoaderClientQt::didChangeTitle(DocumentLoader *l)
{
- setTitle(l->title(), l->URL());
+ setTitle(l->title());
}
}
-void FrameLoaderClientQt::setTitle(const String& title, const KURL&)
+void FrameLoaderClientQt::setTitle(const String& title)
{
- //notImplemented();
+ QString t = title;
+ emit titleChanged(t);
+}
+
+
+void FrameLoaderClientQt::setTitle(const String& title, const KURL& url)
+{
+ Q_UNUSED(url)
+ setTitle(title);
}
#define FrameLoaderClientQt_H
#include <qobject.h>
+#include <QUrl>
#include "FrameLoaderClient.h"
#include "KURL.h"
void loadStarted(QWebFrame *frame);
void loadProgressChanged(double d);
void loadFinished(QWebFrame *frame);
+ void titleChanged(const QString& title);
+
public:
FrameLoaderClientQt();
~FrameLoaderClientQt();
virtual void addHistoryItemForFragmentScroll();
virtual void didFinishLoad();
virtual void prepareForDataSourceReplacement();
+ virtual void setTitle(const String& title);
virtual void setTitle(const String& title, const KURL&);
virtual String userAgent();