Commit 781540ce authored by kjk's avatar kjk

Reviewed by Maciej S.

        Gdk build fixes for recent refactorings.

        * Projects/gdk/webcore-gdk.bkl:
        * WebCoreSources.bkl:
        * page/gdk/DragControllerGdk.cpp:
        (WebCore::DragController::dragOperation):
        (WebCore::DragController::maxDragImageSize):
        * page/gdk/EventHandlerGdk.cpp:
        (WebCore::EventHandler::createDraggingClipboard):
        * platform/DragImage.h:
        * platform/gdk/ChromeClientGdk.h:
        * platform/gdk/CursorGdk.cpp:
        (WebCore::verticalTextCursor):
        (WebCore::cellCursor):
        (WebCore::contextMenuCursor):
        (WebCore::noDropCursor):
        (WebCore::copyCursor):
        (WebCore::progressCursor):
        (WebCore::aliasCursor):
        (WebCore::noneCursor):
        (WebCore::notAllowedCursor):
        * platform/gdk/EditorClientGdk.cpp:
        (WebCore::EditorClientGdk::shouldChangeSelectedRange):
        (WebCore::EditorClientGdk::isEditable):
        (WebCore::EditorClientGdk::textFieldDidBeginEditing):
        (WebCore::EditorClientGdk::textFieldDidEndEditing):
        (WebCore::EditorClientGdk::textDidChangeInTextField):
        (WebCore::EditorClientGdk::doTextFieldCommandFromEvent):
        (WebCore::EditorClientGdk::textWillBeDeletedInTextField):
        (WebCore::EditorClientGdk::textDidChangeInTextArea):
        * platform/gdk/EditorClientGdk.h:
        * platform/gdk/FrameGdk.cpp:
        (WebCore::Frame::print):
        (WebCore::Frame::issueTransposeCommand):
        (WebCore::Frame::respondToChangedSelection):
        (WebCore::Frame::cleanupPlatformScriptObjects):
        (WebCore::Frame::isCharacterSmartReplaceExempt):
        (WebCore::Frame::dragImageForSelection):
        * platform/gdk/FrameGdk.h:
        * platform/gdk/MimeTypeRegistryGdk.cpp: Added.
        * platform/gdk/TemporaryLinkStubs.cpp:
        (ChromeClientGdk::tabsToLinks):
        (ChromeClientGdk::windowResizerRect):
        (ChromeClientGdk::addToDirtyRegion):
        (ChromeClientGdk::scrollBackingStore):
        (ChromeClientGdk::updateBackingStore):
        * webcore-base.bkl:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@19741 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 9942b12b
2007-02-20 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
Reviewed by Maciej S.
Gdk build fixes for recent refactorings.
* Projects/gdk/webcore-gdk.bkl:
* WebCoreSources.bkl:
* page/gdk/DragControllerGdk.cpp:
(WebCore::DragController::dragOperation):
(WebCore::DragController::maxDragImageSize):
* page/gdk/EventHandlerGdk.cpp:
(WebCore::EventHandler::createDraggingClipboard):
* platform/DragImage.h:
* platform/gdk/ChromeClientGdk.h:
* platform/gdk/CursorGdk.cpp:
(WebCore::verticalTextCursor):
(WebCore::cellCursor):
(WebCore::contextMenuCursor):
(WebCore::noDropCursor):
(WebCore::copyCursor):
(WebCore::progressCursor):
(WebCore::aliasCursor):
(WebCore::noneCursor):
(WebCore::notAllowedCursor):
* platform/gdk/EditorClientGdk.cpp:
(WebCore::EditorClientGdk::shouldChangeSelectedRange):
(WebCore::EditorClientGdk::isEditable):
(WebCore::EditorClientGdk::textFieldDidBeginEditing):
(WebCore::EditorClientGdk::textFieldDidEndEditing):
(WebCore::EditorClientGdk::textDidChangeInTextField):
(WebCore::EditorClientGdk::doTextFieldCommandFromEvent):
(WebCore::EditorClientGdk::textWillBeDeletedInTextField):
(WebCore::EditorClientGdk::textDidChangeInTextArea):
* platform/gdk/EditorClientGdk.h:
* platform/gdk/FrameGdk.cpp:
(WebCore::Frame::print):
(WebCore::Frame::issueTransposeCommand):
(WebCore::Frame::respondToChangedSelection):
(WebCore::Frame::cleanupPlatformScriptObjects):
(WebCore::Frame::isCharacterSmartReplaceExempt):
(WebCore::Frame::dragImageForSelection):
* platform/gdk/FrameGdk.h:
* platform/gdk/MimeTypeRegistryGdk.cpp: Added.
* platform/gdk/TemporaryLinkStubs.cpp:
(ChromeClientGdk::tabsToLinks):
(ChromeClientGdk::windowResizerRect):
(ChromeClientGdk::addToDirtyRegion):
(ChromeClientGdk::scrollBackingStore):
(ChromeClientGdk::updateBackingStore):
* webcore-base.bkl:
2007-02-20 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
Reviewed by Darin.
......
......@@ -53,6 +53,7 @@
platform/gdk/CookieJarGdk.cpp
platform/gdk/CursorGdk.cpp
platform/gdk/DragDataGdk.cpp
platform/gdk/DragImageGdk.cpp
platform/gdk/EditorClientGdk.cpp
platform/gdk/FontCacheGdk.cpp
platform/gdk/FontDataGdk.cpp
......@@ -61,6 +62,7 @@
platform/gdk/FrameGdk.cpp
platform/gdk/GlyphPageTreeNodeGdk.cpp
platform/gdk/KeyEventGdk.cpp
platform/gdk/MimeTypeRegistryGdk.cpp
platform/gdk/MouseEventGdk.cpp
platform/gdk/PopupMenuGdk.cpp
platform/gdk/RenderThemeGdk.cpp
......
......@@ -166,6 +166,7 @@
platform/DeprecatedString.cpp
platform/DeprecatedStringList.cpp
platform/DeprecatedValueListImpl.cpp
platform/DragImage.cpp
platform/FileChooser.cpp
platform/Font.cpp
platform/FontCache.cpp
......
......@@ -33,6 +33,15 @@
namespace WebCore {
// FIXME: These values are straight out of DragControllerMac, so probably have
// little correlation with Gdk standards...
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;
bool DragController::isCopyKeyDown()
{
return false;
......@@ -45,6 +54,13 @@ DragOperation DragController::dragOperation(DragData* dragData)
return DragOperationCopy;
return DragOperationNone;
}
}
const IntSize& DragController::maxDragImageSize()
{
static const IntSize maxDragImageSize(400, 400);
return maxDragImageSize;
}
}
......@@ -52,11 +52,6 @@ static bool isKeyboardOptionTab(KeyboardEvent* event)
&& event->keyIdentifier() == "U+000009";
}
bool EventHandler::tabsToLinks(KeyboardEvent* event) const
{
return isKeyboardOptionTab(event);
}
bool EventHandler::tabsToAllControls(KeyboardEvent* event) const
{
bool handlingOptionTab = isKeyboardOptionTab(event);
......@@ -91,12 +86,6 @@ bool EventHandler::passMouseDownEventToWidget(Widget* widget)
return false;
}
bool EventHandler::handleDrag(const MouseEventWithHitTestResults& event)
{
// notImplemented(); // commented out because it's very chatty
return false;
}
bool EventHandler::eventActivatedView(const PlatformMouseEvent& event) const
{
notImplemented();
......@@ -115,6 +104,12 @@ bool EventHandler::passWheelEventToWidget(Widget* widget)
return false;
}
Clipboard* EventHandler::createDraggingClipboard() const
{
notImplemented();
return 0;
}
bool EventHandler::passMousePressEventToSubframe(MouseEventWithHitTestResults& mev, Frame* subframe)
{
return passSubframeEventToSubframe(mev, subframe);
......
......@@ -59,6 +59,8 @@ namespace WebCore {
typedef QImage* DragImageRef;
#elif PLATFORM(WIN)
typedef HBITMAP DragImageRef;
#elif PLATFORM(GDK)
typedef void* DragImageRef;
#endif
IntSize dragImageSize(DragImageRef);
......
......@@ -81,7 +81,12 @@ namespace WebCore {
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();
};
}
......
......@@ -198,54 +198,50 @@ const Cursor& rowResizeCursor()
return c;
}
// FIXME: should find better GDK cursors for those than a generic GDK_LEFT_PTR
const Cursor& verticalTextCursor()
{
// FIXME: optimize the way CursorQt is optmized: only one copy of a given
// cursor type
static Cursor c = gdk_cursor_new(GDK_LEFT_PTR);
return c;
return pointerCursor();
}
const Cursor& cellCursor()
{
static Cursor c = gdk_cursor_new(GDK_LEFT_PTR);
return c;
return pointerCursor();
}
const Cursor& contextMenuCursor()
{
static Cursor c = gdk_cursor_new(GDK_LEFT_PTR);
return c;
return pointerCursor();
}
const Cursor& noDropCursor()
{
static Cursor c = gdk_cursor_new(GDK_LEFT_PTR);
return c;
return pointerCursor();
}
const Cursor& copyCursor()
{
static Cursor c = gdk_cursor_new(GDK_LEFT_PTR);
return c;
return pointerCursor();
}
const Cursor& progressCursor()
{
static Cursor c = gdk_cursor_new(GDK_LEFT_PTR);
return c;
return pointerCursor();
}
const Cursor& aliasCursor()
{
static Cursor c = gdk_cursor_new(GDK_LEFT_PTR);
return c;
return pointerCursor();
}
const Cursor& noneCursor()
{
static Cursor c = gdk_cursor_new(GDK_LEFT_PTR);
return c;
return pointerCursor();
}
const Cursor& notAllowedCursor()
{
return pointerCursor();
}
}
/*
* 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 "DragImage.h"
#include "CachedImage.h"
#include "Image.h"
namespace WebCore {
IntSize dragImageSize(DragImageRef)
{
return IntSize(0, 0);
}
void deleteDragImage(DragImageRef)
{
}
DragImageRef scaleDragImage(DragImageRef image, float)
{
return image;
}
DragImageRef dissolveDragImageToFraction(DragImageRef image, float)
{
return image;
}
DragImageRef createDragImageFromImage(Image*)
{
return 0;
}
DragImageRef createDragImageIconForCachedImage(CachedImage*)
{
return 0;
}
}
......@@ -92,6 +92,12 @@ bool EditorClientGdk::shouldInsertText(String, Range*, EditorInsertAction)
return true;
}
bool EditorClientGdk::shouldChangeSelectedRange(Range* fromRange, Range* toRange, EAffinity, bool stillSelecting)
{
notImplemented();
return true;
}
bool EditorClientGdk::shouldApplyStyle(WebCore::CSSStyleDeclaration*,
WebCore::Range*)
{
......@@ -132,10 +138,8 @@ bool EditorClientGdk::selectWordBeforeMenuEvent()
bool EditorClientGdk::isEditable()
{
Frame* frame = m_page->focusController()->focusedOrMainFrame();
if (!frame)
return false;
return frame->selectionController()->isContentEditable();
notImplemented();
return true;
}
void EditorClientGdk::registerCommandForUndo(WTF::PassRefPtr<WebCore::EditCommand>)
......@@ -250,6 +254,37 @@ void EditorClientGdk::setPage(Page* page)
m_page = page;
}
void EditorClientGdk::textFieldDidBeginEditing(Element*)
{
notImplemented();
}
void EditorClientGdk::textFieldDidEndEditing(Element*)
{
notImplemented();
}
void EditorClientGdk::textDidChangeInTextField(Element*)
{
notImplemented();
}
bool EditorClientGdk::doTextFieldCommandFromEvent(Element*, KeyboardEvent*)
{
notImplemented();
return false;
}
void EditorClientGdk::textWillBeDeletedInTextField(Element*)
{
notImplemented();
}
void EditorClientGdk::textDidChangeInTextArea(Element*)
{
notImplemented();
}
}
// vim: ts=4 sw=4 et
......@@ -61,6 +61,8 @@ public:
virtual bool shouldEndEditing(Range*);
virtual bool shouldInsertNode(Node*, Range*, EditorInsertAction);
virtual bool shouldInsertText(String, Range*, EditorInsertAction);
virtual bool shouldChangeSelectedRange(Range* fromRange, Range* toRange, EAffinity, bool stillSelecting);
virtual bool shouldApplyStyle(CSSStyleDeclaration*, Range*);
virtual void didBeginEditing();
......@@ -81,6 +83,13 @@ public:
virtual void handleKeyPress(KeyboardEvent*);
virtual void textFieldDidBeginEditing(Element*);
virtual void textFieldDidEndEditing(Element*);
virtual void textDidChangeInTextField(Element*);
virtual bool doTextFieldCommandFromEvent(Element*, KeyboardEvent*);
virtual void textWillBeDeletedInTextField(Element*);
virtual void textDidChangeInTextArea(Element*);
// EditorClientGdk only
void setPage(Page*);
......
......@@ -259,92 +259,34 @@ void FrameGdk::handleGdkEvent(GdkEvent* event)
}
}
void FrameGdk::focusWindow()
void Frame::print()
{
notImplemented();
}
void FrameGdk::unfocusWindow()
void Frame::issueTransposeCommand()
{
notImplemented();
}
KJS::Bindings::Instance* FrameGdk::getObjectInstanceForWidget(Widget *)
void Frame::respondToChangedSelection(WebCore::Selection const&, bool)
{
notImplemented();
return 0;
}
KJS::Bindings::Instance* FrameGdk::getEmbedInstanceForWidget(Widget *)
{
notImplemented();
return 0;
}
KJS::Bindings::RootObject* FrameGdk::bindingRootObject()
{
notImplemented();
return 0;
}
void FrameGdk::print()
{
notImplemented();
}
KJS::Bindings::Instance* FrameGdk::getAppletInstanceForWidget(Widget*)
{
notImplemented();
return 0;
}
void FrameGdk::issueCutCommand()
{
notImplemented();
}
void FrameGdk::issueCopyCommand()
{
notImplemented();
}
void FrameGdk::issuePasteCommand()
{
notImplemented();
}
void FrameGdk::issueTransposeCommand()
{
notImplemented();
}
void FrameGdk::issuePasteAndMatchStyleCommand()
{
notImplemented();
// FIXME: If we want continous spell checking, we need to implement this.
}
Range* FrameGdk::markedTextRange() const
void Frame::cleanupPlatformScriptObjects()
{
// FIXME: Handle selections.
notImplemented();
return 0;
}
bool FrameGdk::shouldChangeSelection(const Selection&, const Selection&, WebCore::EAffinity, bool) const
bool Frame::isCharacterSmartReplaceExempt(UChar, bool)
{
// no-op
// no smart replace
return true;
}
void FrameGdk::respondToChangedSelection(WebCore::Selection const&, bool)
DragImageRef Frame::dragImageForSelection()
{
// FIXME: If we want continous spell checking, we need to implement this.
}
String FrameGdk::mimeTypeForFileName(String const&) const
{
notImplemented();
return String();
return 0;
}
}
......@@ -45,29 +45,6 @@ public:
FrameGdk(Page*, HTMLFrameOwnerElement*, FrameLoaderClientGdk*);
virtual ~FrameGdk();
// from Frame
virtual void unfocusWindow();
virtual void focusWindow();
virtual Range* markedTextRange() const;
virtual String mimeTypeForFileName(const String&) const;
virtual KJS::Bindings::Instance* getEmbedInstanceForWidget(Widget*);
virtual KJS::Bindings::Instance* getObjectInstanceForWidget(Widget*);
virtual KJS::Bindings::Instance* getAppletInstanceForWidget(Widget*);
virtual KJS::Bindings::RootObject* bindingRootObject();
virtual void issueCutCommand();
virtual void issueCopyCommand();
virtual void issuePasteCommand();
virtual void issuePasteAndMatchStyleCommand();
virtual void issueTransposeCommand();
virtual void respondToChangedSelection(const Selection& oldSelection, bool closeTyping);
virtual bool shouldChangeSelection(const Selection& oldSelection, const Selection& newSelection, EAffinity affinity, bool stillSelecting) const;
virtual void print();
// FrameGdk-only
void handleGdkEvent(GdkEvent*);
bool keyPress(const PlatformKeyboardEvent& keyEvent);
......@@ -86,9 +63,6 @@ private:
bool m_dumpRenderTreeAfterLoading;
};
inline FrameGdk* GdkFrame(Frame* frame) { return static_cast<FrameGdk*>(frame); }
inline const FrameGdk* GdkFrame(const Frame* frame) { return static_cast<const FrameGdk*>(frame); }
}
#endif
/*
* Copyright (C) 2006 Zack Rusin <zack@kde.org>
* Copyright (C) 2006 Apple Computer, Inc. All rights reserved.
* Copyright (C) 2007 Trolltech ASA
*
* 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 "MimeTypeRegistry.h"
namespace WebCore {
struct ExtensionMap {
const char* extension;
const char* mimeType;
};
static const ExtensionMap extensionMap [] = {
{ "bmp", "image/bmp" },
{ "gif", "image/gif" },
{ "html", "text/html" },
{ "ico", "image/x-icon" },
{ "jpeg", "image/jpeg" },
{ "jpg", "image/jpeg" },
{ "js", "application/x-javascript" },
{ "pdf", "application/pdf" },
{ "png", "image/png" },
{ "rss", "application/rss+xml" },
{ "svg", "image/svg+xml" },
{ "text", "text/plain" },
{ "txt", "text/plain" },
{ "xbm", "image/x-xbitmap" },
{ "xml", "text/xml" },
{ "xsl", "text/xsl" },
{ "xhtml", "application/xhtml+xml" },
{ 0, 0 }
};
String MimeTypeRegistry::getMIMETypeForExtension(const String &ext)
{
String s = ext.lower();
const ExtensionMap *e = extensionMap;
while (e->extension) {
if (s == e->extension)
return e->mimeType;
++e;
}
// unknown, let's just assume plain text
return "text/plain";
}
}
......@@ -158,6 +158,28 @@ bool ChromeClientGdk::shouldInterruptJavaScript()
return false;
}
bool ChromeClientGdk::tabsToLinks() const
{
return false;
}
IntRect ChromeClientGdk::windowResizerRect() const
{
notImplemented();
}
void ChromeClientGdk::addToDirtyRegion(const IntRect&)
{
notImplemented();
}
void ChromeClientGdk::scrollBackingStore(int dx, int dy, const IntRect& scrollViewRect, const IntRect& clipRect)
{
notImplemented();
}
void ChromeClientGdk::updateBackingStore()
{
notImplemented();
}
/********************************************************/
/* Completely empty stubs (mostly to allow DRT to run): */
/********************************************************/
......
......@@ -77,6 +77,7 @@ Base settings shared by all Bakefile-based ports.
<include>$(SRCDIR)/DerivedSources/WebCore</include>
<include>$(SRCDIR)/dom</include>
<include>$(SRCDIR)/editing</include>
<include>$(SRCDIR)/ForwardingHeaders/kjs</include>
<include>$(SRCDIR)/history</include>
<include>$(SRCDIR)/html</include>
<include>$(SRCDIR)/include</include>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment