diff options
author | Steve Block <steveblock@google.com> | 2011-05-06 11:45:16 +0100 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2011-05-12 13:44:10 +0100 |
commit | cad810f21b803229eb11403f9209855525a25d57 (patch) | |
tree | 29a6fd0279be608e0fe9ffe9841f722f0f4e4269 /Source/WebCore/platform/brew | |
parent | 121b0cf4517156d0ac5111caf9830c51b69bae8f (diff) | |
download | external_webkit-cad810f21b803229eb11403f9209855525a25d57.zip external_webkit-cad810f21b803229eb11403f9209855525a25d57.tar.gz external_webkit-cad810f21b803229eb11403f9209855525a25d57.tar.bz2 |
Merge WebKit at r75315: Initial merge by git.
Change-Id: I570314b346ce101c935ed22a626b48c2af266b84
Diffstat (limited to 'Source/WebCore/platform/brew')
33 files changed, 3264 insertions, 0 deletions
diff --git a/Source/WebCore/platform/brew/ClipboardBrew.cpp b/Source/WebCore/platform/brew/ClipboardBrew.cpp new file mode 100644 index 0000000..c0504bc --- /dev/null +++ b/Source/WebCore/platform/brew/ClipboardBrew.cpp @@ -0,0 +1,122 @@ +/* + * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. + * Copyright (C) 2010 Company 100, Inc. + * + * 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 "ClipboardBrew.h" + +#include "CachedImage.h" +#include "Element.h" +#include "FileList.h" +#include "Frame.h" +#include "NotImplemented.h" +#include "Range.h" + +namespace WebCore { + +PassRefPtr<Clipboard> Clipboard::create(ClipboardAccessPolicy, DragData*, Frame*) +{ + return 0; +} + +ClipboardBrew::ClipboardBrew(ClipboardAccessPolicy policy, ClipboardType clipboardType) + : Clipboard(policy, clipboardType) +{ +} + +ClipboardBrew::~ClipboardBrew() +{ +} + +void ClipboardBrew::clearData(const String&) +{ + ASSERT(isForDragAndDrop()); +} + +void ClipboardBrew::clearAllData() +{ + ASSERT(isForDragAndDrop()); +} + +String ClipboardBrew::getData(const String&, bool& success) const +{ + success = false; + return ""; +} + +bool ClipboardBrew::setData(const String&, const String&) +{ + ASSERT(isForDragAndDrop()); + return false; +} + +// extensions beyond IE's API +HashSet<String> ClipboardBrew::types() const +{ + return HashSet<String>(); +} + +PassRefPtr<FileList> ClipboardBrew::files() const +{ + notImplemented(); + return 0; +} + +void ClipboardBrew::setDragImage(CachedImage*, const IntPoint&) +{ +} + +void ClipboardBrew::setDragImageElement(Node*, const IntPoint&) +{ +} + +DragImageRef ClipboardBrew::createDragImage(IntPoint&) const +{ + return 0; +} + +void ClipboardBrew::declareAndWriteDragImage(Element*, const KURL&, const String&, Frame*) +{ +} + +void ClipboardBrew::writeURL(const KURL&, const String&, Frame*) +{ +} + +void ClipboardBrew::writeRange(Range* selectedRange, Frame*) +{ + ASSERT(selectedRange); +} + +void ClipboardBrew::writePlainText(const String&) +{ +} + +bool ClipboardBrew::hasData() +{ + return false; +} + +} // namespace WebCore diff --git a/Source/WebCore/platform/brew/ClipboardBrew.h b/Source/WebCore/platform/brew/ClipboardBrew.h new file mode 100644 index 0000000..1faf031 --- /dev/null +++ b/Source/WebCore/platform/brew/ClipboardBrew.h @@ -0,0 +1,65 @@ +/* + * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. + * Copyright (C) 2010 Company 100, Inc. + * + * 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 ClipboardBrew_h +#define ClipboardBrew_h + +#include "CachedResourceClient.h" +#include "Clipboard.h" + +namespace WebCore { + +class CachedImage; + +class ClipboardBrew : public Clipboard, public CachedResourceClient { +public: + ClipboardBrew(ClipboardAccessPolicy policy, ClipboardType); + ~ClipboardBrew(); + + void clearData(const String&); + void clearAllData(); + String getData(const String&, bool& success) const; + bool setData(const String&, const String&); + + // extensions beyond IE's API + HashSet<String> types() const; + virtual PassRefPtr<FileList> files() const; + + void setDragImage(CachedImage*, const IntPoint&); + void setDragImageElement(Node*, const IntPoint&); + + virtual DragImageRef createDragImage(IntPoint&) const; + virtual void declareAndWriteDragImage(Element*, const KURL&, const String&, Frame*); + virtual void writeURL(const KURL&, const String&, Frame*); + virtual void writeRange(Range*, Frame*); + virtual void writePlainText(const String&); + + virtual bool hasData(); +}; + +} // namespace WebCore + +#endif // ClipboardBrew_h diff --git a/Source/WebCore/platform/brew/ContextMenuBrew.cpp b/Source/WebCore/platform/brew/ContextMenuBrew.cpp new file mode 100644 index 0000000..56ac351 --- /dev/null +++ b/Source/WebCore/platform/brew/ContextMenuBrew.cpp @@ -0,0 +1,105 @@ +/* + * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. + * Copyright (C) 2010 Company 100, Inc. + * + * 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 "ContextMenu.h" + +#include "NotImplemented.h" +#include <wtf/text/CString.h> + +namespace WebCore { + +ContextMenu::ContextMenu() +{ + ASSERT_NOT_REACHED(); + notImplemented(); +} + +ContextMenu::ContextMenu(const PlatformMenuDescription menu) +{ + ASSERT_NOT_REACHED(); + notImplemented(); +} + +ContextMenu::~ContextMenu() +{ + ASSERT_NOT_REACHED(); + notImplemented(); +} + +unsigned ContextMenu::itemCount() const +{ + ASSERT_NOT_REACHED(); + return 0; +} + +void ContextMenu::insertItem(unsigned int position, ContextMenuItem& item) +{ + ASSERT_NOT_REACHED(); + notImplemented(); +} + +void ContextMenu::appendItem(ContextMenuItem& item) +{ + ASSERT_NOT_REACHED(); + notImplemented(); +} + +ContextMenuItem* ContextMenu::itemWithAction(unsigned action) +{ + ASSERT_NOT_REACHED(); + notImplemented(); + return 0; +} + +ContextMenuItem* ContextMenu::itemAtIndex(unsigned index, const PlatformMenuDescription platformDescription) +{ + ASSERT_NOT_REACHED(); + notImplemented(); + return 0; +} + +void ContextMenu::setPlatformDescription(PlatformMenuDescription menu) +{ + ASSERT_NOT_REACHED(); + notImplemented(); +} + +PlatformMenuDescription ContextMenu::platformDescription() const +{ + ASSERT_NOT_REACHED(); + notImplemented(); + return 0; +} + +PlatformMenuDescription ContextMenu::releasePlatformDescription() +{ + ASSERT_NOT_REACHED(); + notImplemented(); + return 0; +} + +} diff --git a/Source/WebCore/platform/brew/ContextMenuItemBrew.cpp b/Source/WebCore/platform/brew/ContextMenuItemBrew.cpp new file mode 100644 index 0000000..717084d --- /dev/null +++ b/Source/WebCore/platform/brew/ContextMenuItemBrew.cpp @@ -0,0 +1,139 @@ +/* + * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. + * Copyright (C) 2010 Company 100, Inc. + * + * 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 "ContextMenuItem.h" + +#include "ContextMenu.h" +#include "NotImplemented.h" + +#include <wtf/text/CString.h> + +namespace WebCore { + +ContextMenuItem::ContextMenuItem(PlatformMenuDescription item) +{ + ASSERT_NOT_REACHED(); + notImplemented(); +} + +ContextMenuItem::ContextMenuItem(ContextMenu* subMenu) +{ + ASSERT_NOT_REACHED(); + notImplemented(); +} + +ContextMenuItem::ContextMenuItem(ContextMenuItemType type, ContextMenuAction action, const String& title, ContextMenu* subMenu) +{ + ASSERT_NOT_REACHED(); + notImplemented(); +} + +ContextMenuItem::~ContextMenuItem() +{ + ASSERT_NOT_REACHED(); + notImplemented(); +} + +PlatformMenuDescription ContextMenuItem::releasePlatformDescription() +{ + ASSERT_NOT_REACHED(); + notImplemented(); + return 0; +} + +ContextMenuItemType ContextMenuItem::type() const +{ + ASSERT_NOT_REACHED(); + notImplemented(); + return ActionType; +} + +ContextMenuAction ContextMenuItem::action() const +{ + ASSERT_NOT_REACHED(); + notImplemented(); + return ContextMenuItemTagNoAction; +} + +String ContextMenuItem::title() const +{ + ASSERT_NOT_REACHED(); + notImplemented(); + return String(); +} + +PlatformMenuDescription ContextMenuItem::platformSubMenu() const +{ + ASSERT_NOT_REACHED(); + notImplemented(); + return 0; +} + +void ContextMenuItem::setType(ContextMenuItemType type) +{ + ASSERT_NOT_REACHED(); + notImplemented(); +} + +void ContextMenuItem::setAction(ContextMenuAction action) +{ + ASSERT_NOT_REACHED(); + notImplemented(); +} + +void ContextMenuItem::setTitle(const String& title) +{ + ASSERT_NOT_REACHED(); + notImplemented(); +} + +void ContextMenuItem::setSubMenu(ContextMenu* subMenu) +{ + ASSERT_NOT_REACHED(); + notImplemented(); +} + +void ContextMenuItem::setChecked(bool checked) +{ + ASSERT_NOT_REACHED(); + notImplemented(); +} + +void ContextMenuItem::setEnabled(bool enabled) +{ + ASSERT_NOT_REACHED(); + notImplemented(); +} + +bool ContextMenuItem::enabled() const +{ + ASSERT_NOT_REACHED(); + notImplemented(); + return false; +} + +} diff --git a/Source/WebCore/platform/brew/CursorBrew.cpp b/Source/WebCore/platform/brew/CursorBrew.cpp new file mode 100644 index 0000000..3296b03 --- /dev/null +++ b/Source/WebCore/platform/brew/CursorBrew.cpp @@ -0,0 +1,320 @@ +/* + * Copyright (C) 2010 Company 100, Inc. + * Copyright (C) 2004, 2006 Apple Computer, 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. + */ + +#define LOG_TAG "WebCore" + +#include "config.h" +#include "Cursor.h" + +#include "NotImplemented.h" + +#include <wtf/StdLibExtras.h> + +namespace WebCore { + +Cursor::Cursor(Image*, const IntPoint&) +{ + notImplemented(); +} + +Cursor::Cursor(const Cursor&) +{ + notImplemented(); +} + +Cursor::~Cursor() +{ + notImplemented(); +} + +Cursor& Cursor::operator=(const Cursor&) +{ + notImplemented(); + return *this; +} + +static inline Cursor& dummyCursor() +{ + DEFINE_STATIC_LOCAL(Cursor, c, ()); + return c; +} + +const Cursor& pointerCursor() +{ + notImplemented(); + return dummyCursor(); +} + +const Cursor& crossCursor() +{ + notImplemented(); + return dummyCursor(); +} + +const Cursor& handCursor() +{ + notImplemented(); + return dummyCursor(); +} + +const Cursor& moveCursor() +{ + notImplemented(); + return dummyCursor(); +} + +const Cursor& iBeamCursor() +{ + notImplemented(); + return dummyCursor(); +} + +const Cursor& waitCursor() +{ + notImplemented(); + return dummyCursor(); +} + +const Cursor& helpCursor() +{ + notImplemented(); + return dummyCursor(); +} + +const Cursor& eastResizeCursor() +{ + notImplemented(); + return dummyCursor(); +} + +const Cursor& northResizeCursor() +{ + notImplemented(); + return dummyCursor(); +} + +const Cursor& northEastResizeCursor() +{ + notImplemented(); + return dummyCursor(); +} + +const Cursor& northWestResizeCursor() +{ + notImplemented(); + return dummyCursor(); +} + +const Cursor& southResizeCursor() +{ + notImplemented(); + return dummyCursor(); +} + +const Cursor& southEastResizeCursor() +{ + notImplemented(); + return dummyCursor(); +} + +const Cursor& southWestResizeCursor() +{ + notImplemented(); + return dummyCursor(); +} + +const Cursor& westResizeCursor() +{ + notImplemented(); + return dummyCursor(); +} + +const Cursor& northSouthResizeCursor() +{ + notImplemented(); + return dummyCursor(); +} + +const Cursor& eastWestResizeCursor() +{ + notImplemented(); + return dummyCursor(); +} + +const Cursor& northEastSouthWestResizeCursor() +{ + notImplemented(); + return dummyCursor(); +} + +const Cursor& northWestSouthEastResizeCursor() +{ + notImplemented(); + return dummyCursor(); +} + +const Cursor& columnResizeCursor() +{ + notImplemented(); + return dummyCursor(); +} + +const Cursor& rowResizeCursor() +{ + notImplemented(); + return dummyCursor(); +} + +const Cursor& verticalTextCursor() +{ + notImplemented(); + return dummyCursor(); +} + +const Cursor& cellCursor() +{ + notImplemented(); + return dummyCursor(); +} + +const Cursor& contextMenuCursor() +{ + notImplemented(); + return dummyCursor(); +} + +const Cursor& noDropCursor() +{ + notImplemented(); + return dummyCursor(); +} + +const Cursor& copyCursor() +{ + notImplemented(); + return dummyCursor(); +} + +const Cursor& progressCursor() +{ + notImplemented(); + return dummyCursor(); +} + +const Cursor& aliasCursor() +{ + notImplemented(); + return dummyCursor(); +} + +const Cursor& noneCursor() +{ + notImplemented(); + return dummyCursor(); +} + +const Cursor& notAllowedCursor() +{ + return dummyCursor(); +} + +const Cursor& zoomInCursor() +{ + return dummyCursor(); +} + +const Cursor& zoomOutCursor() +{ + return dummyCursor(); +} + +const Cursor& middlePanningCursor() +{ + notImplemented(); + return dummyCursor(); +} + +const Cursor& eastPanningCursor() +{ + notImplemented(); + return dummyCursor(); +} + +const Cursor& northPanningCursor() +{ + notImplemented(); + return dummyCursor(); +} + +const Cursor& northEastPanningCursor() +{ + notImplemented(); + return dummyCursor(); +} + +const Cursor& northWestPanningCursor() +{ + notImplemented(); + return dummyCursor(); +} + +const Cursor& southPanningCursor() +{ + notImplemented(); + return dummyCursor(); +} + +const Cursor& southEastPanningCursor() +{ + notImplemented(); + return dummyCursor(); +} + +const Cursor& southWestPanningCursor() +{ + notImplemented(); + return dummyCursor(); +} + +const Cursor& westPanningCursor() +{ + notImplemented(); + return dummyCursor(); +} + +const Cursor& grabCursor() +{ + notImplemented(); + return dummyCursor(); +} + +const Cursor& grabbingCursor() +{ + notImplemented(); + return dummyCursor(); +} + +} // namespace WebCore diff --git a/Source/WebCore/platform/brew/DragDataBrew.cpp b/Source/WebCore/platform/brew/DragDataBrew.cpp new file mode 100644 index 0000000..d114fd6 --- /dev/null +++ b/Source/WebCore/platform/brew/DragDataBrew.cpp @@ -0,0 +1,89 @@ +/* + * Copyright (C) 2007 Apple Inc. All rights reserved. + * Copyright (C) 2010 Company 100, Inc. + * + * 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 "DragData.h" + +#include "Document.h" +#include "DocumentFragment.h" + +namespace WebCore { + +bool DragData::canSmartReplace() const +{ + return false; +} + +bool DragData::containsColor() const +{ + return false; +} + +bool DragData::containsPlainText() const +{ + return false; +} + +String DragData::asPlainText() const +{ + return String(); +} + +Color DragData::asColor() const +{ + return Color(); +} + +bool DragData::containsCompatibleContent() const +{ + return false; +} + +bool DragData::containsURL(FilenameConversionPolicy filenamePolicy) const +{ + return false; +} + +String DragData::asURL(FilenameConversionPolicy filenamePolicy, String*) const +{ + return String(); +} + +PassRefPtr<DocumentFragment> DragData::asFragment(Document*) const +{ + return 0; +} + +void DragData::asFilenames(Vector<String>&) const +{ +} + +bool DragData::containsFiles() const +{ + return false; +} + +} // namespace WebCore diff --git a/Source/WebCore/platform/brew/EventLoopBrew.cpp b/Source/WebCore/platform/brew/EventLoopBrew.cpp new file mode 100644 index 0000000..286b983 --- /dev/null +++ b/Source/WebCore/platform/brew/EventLoopBrew.cpp @@ -0,0 +1,36 @@ +/* + * Copyright (C) 2010 Company 100, 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: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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 THE COPYRIGHT HOLDERS ``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 "EventLoop.h" + +namespace WebCore { + +void EventLoop::cycle() +{ + // BREW MP does not have an explicit event loop. +} + +} // namespace WebCore diff --git a/Source/WebCore/platform/brew/FileChooserBrew.cpp b/Source/WebCore/platform/brew/FileChooserBrew.cpp new file mode 100644 index 0000000..79755bb --- /dev/null +++ b/Source/WebCore/platform/brew/FileChooserBrew.cpp @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. + * Copyright (C) 2007-2009 Torch Mobile, Inc. + * Copyright (C) 2009 Company 100 Inc. + * + * 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 "FileChooser.h" + +#include "FileSystem.h" +#include "LocalizedStrings.h" +#include "StringTruncator.h" + +namespace WebCore { + +String FileChooser::basenameForWidth(const Font& font, int width) const +{ + if (width <= 0) + return String(); + + String string; + if (m_filenames.isEmpty()) + string = fileButtonNoFileSelectedLabel(); + else if (m_filenames.size() == 1) + string = pathGetFileName(m_filenames[0]); + else + return StringTruncator::rightTruncate(String::number(m_filenames.size()) + " files", width, font, false); + + return StringTruncator::centerTruncate(string, width, font, false); +} + +} diff --git a/Source/WebCore/platform/brew/FileSystemBrew.cpp b/Source/WebCore/platform/brew/FileSystemBrew.cpp new file mode 100644 index 0000000..61d568d --- /dev/null +++ b/Source/WebCore/platform/brew/FileSystemBrew.cpp @@ -0,0 +1,259 @@ +/* + * Copyright (C) 2010 Company 100, 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. + * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 "FileSystem.h" + +#include "NotImplemented.h" + +#include <AEEAppGen.h> +#include <AEEFile.h> +#include <AEEStdLib.h> + +#include <wtf/RandomNumber.h> +#include <wtf/brew/RefPtrBrew.h> +#include <wtf/brew/ShellBrew.h> +#include <wtf/text/CString.h> +#include <wtf/text/StringBuilder.h> +#include <wtf/text/WTFString.h> + +namespace WebCore { + +bool getFileSize(const String& path, long long& result) +{ + RefPtr<IFileMgr> fileMgr = createRefPtrInstance<IFileMgr>(AEECLSID_FILEMGR); + FileInfo info; + + if (IFILEMGR_GetInfo(fileMgr.get(), path.utf8().data(), &info) == SUCCESS) { + result = info.dwSize; + return true; + } + + return false; +} + +bool getFileModificationTime(const String& path, time_t& result) +{ + // There is no way to get file modification time in BREW. IFILEMGR_GetInfoEx() returns + // only file creation time. + return false; +} + +bool fileExists(const String& path) +{ + RefPtr<IFileMgr> fileMgr = createRefPtrInstance<IFileMgr>(AEECLSID_FILEMGR); + + return (IFILEMGR_Test(fileMgr.get(), path.utf8().data()) == SUCCESS); +} + +bool deleteFile(const String& path) +{ + RefPtr<IFileMgr> fileMgr = createRefPtrInstance<IFileMgr>(AEECLSID_FILEMGR); + + return (IFILEMGR_Remove(fileMgr.get(), path.utf8().data()) == SUCCESS); +} + +bool deleteEmptyDirectory(const String& path) +{ + RefPtr<IFileMgr> fileMgr = createRefPtrInstance<IFileMgr>(AEECLSID_FILEMGR); + + return (IFILEMGR_RmDir(fileMgr.get(), path.utf8().data()) == SUCCESS); +} + +String pathByAppendingComponent(const String& path, const String& component) +{ + if (component.isEmpty()) + return path; + + Vector<UChar, 1024> buffer; + + buffer.append(path.characters(), path.length()); + + if (buffer.last() != L'/' && component[0] != L'/') + buffer.append(L'/'); + + buffer.append(component.characters(), component.length()); + + return String(buffer.data(), buffer.size()); +} + +CString fileSystemRepresentation(const String& path) +{ + return path.utf8(); +} + +static String canonicalPath(const String& path) +{ + RefPtr<IFileMgr> fileMgr = createRefPtrInstance<IFileMgr>(AEECLSID_FILEMGR); + + // Get the buffer size required to resolve the path. + int canonPathLen; + IFILEMGR_ResolvePath(fileMgr.get(), path.utf8().data(), 0, &canonPathLen); + + // Resolve the path to the canonical path. + Vector<char> canonPathBuffer(canonPathLen); + IFILEMGR_ResolvePath(fileMgr.get(), path.utf8().data(), canonPathBuffer.data(), &canonPathLen); + + String canonPath(canonPathBuffer.data()); + + // Remove the trailing '/'. + int lastDivPos = canonPath.reverseFind('/'); + int endPos = canonPath.length(); + if (lastDivPos == endPos - 1) + canonPath = canonPath.substring(0, canonPath.length() - 1); + + return canonPath; +} + +static bool makeAllDirectories(IFileMgr* fileManager, const String& path) +{ + if (path == canonicalPath(AEEFS_HOME_DIR)) + return true; + + int lastDivPos = path.reverseFind('/'); + int endPos = path.length(); + if (lastDivPos == path.length() - 1) { + endPos -= 1; + lastDivPos = path.reverseFind('/', lastDivPos); + } + + if (lastDivPos > 0) { + if (!makeAllDirectories(fileManager, path.substring(0, lastDivPos))) + return false; + } + + String folder(path.substring(0, endPos)); + + // IFILEMGR_MkDir return SUCCESS when the file is successfully created or if file already exists. + // So we need to check fileinfo.attrib. + IFILEMGR_MkDir(fileManager, folder.utf8().data()); + + FileInfo fileInfo; + if (IFILEMGR_GetInfo(fileManager, folder.utf8().data(), &fileInfo) != SUCCESS) + return false; + + return fileInfo.attrib & _FA_DIR; +} + +bool makeAllDirectories(const String& path) +{ + RefPtr<IFileMgr> fileMgr = createRefPtrInstance<IFileMgr>(AEECLSID_FILEMGR); + + return makeAllDirectories(fileMgr.get(), canonicalPath(path)); +} + +String homeDirectoryPath() +{ + const int webViewClassId = 0x010aa04c; + return String::format("fs:/~0X%08X/", webViewClassId); +} + +String pathGetFileName(const String& path) +{ + return path.substring(path.reverseFind('/') + 1); +} + +String directoryName(const String& path) +{ + String fileName = pathGetFileName(path); + String dirName = String(path); + dirName.truncate(dirName.length() - pathGetFileName(path).length()); + return dirName; +} + +CString openTemporaryFile(const char* prefix, PlatformFileHandle& handle) +{ + // BREW does not have a system-wide temporary directory, + // use "fs:/~/tmp" as our temporary directory. + String tempPath("fs:/~/tmp"); + + RefPtr<IFileMgr> fileMgr = createRefPtrInstance<IFileMgr>(AEECLSID_FILEMGR); + + // Create the temporary directory if it does not exist. + IFILEMGR_MkDir(fileMgr.get(), tempPath.utf8().data()); + + // Loop until we find a temporary filename that does not exist. + int number = static_cast<int>(randomNumber() * 10000); + CString filename; + do { + StringBuilder builder; + builder.append(tempPath); + builder.append('/'); + builder.append(prefix); + builder.append(String::number(number)); + filename = builder.toString().utf8(); + number++; + } while (IFILEMGR_Test(fileMgr.get(), filename.data()) == SUCCESS); + + IFile* tempFile = IFILEMGR_OpenFile(fileMgr.get(), filename.data(), _OFM_CREATE); + if (tempFile) { + handle = tempFile; + return filename; + } + + return CString(); +} + +void closeFile(PlatformFileHandle& handle) +{ + if (isHandleValid(handle)) { + IFILE_Release(handle); + handle = invalidPlatformFileHandle; + } +} + +int writeToFile(PlatformFileHandle handle, const char* data, int length) +{ + if (!isHandleValid(handle)) + return -1; + + int bytesWritten = IFILE_Write(handle, data, length); + if (!bytesWritten) + return -1; + return bytesWritten; +} + +bool unloadModule(PlatformModule module) +{ + notImplemented(); + + return false; +} + +Vector<String> listDirectory(const String& path, const String& filter) +{ + Vector<String> entries; + + // OK to not implement listDirectory, because it's only used for plug-ins and + // Brew MP does not support the plug-in at the moment. + notImplemented(); + + return entries; +} + +} diff --git a/Source/WebCore/platform/brew/KURLBrew.cpp b/Source/WebCore/platform/brew/KURLBrew.cpp new file mode 100644 index 0000000..3f21ddd --- /dev/null +++ b/Source/WebCore/platform/brew/KURLBrew.cpp @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2010 Company 100, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public License + * along with this library; see the file COPYING.LIB. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + * + */ +#include "config.h" +#include "KURL.h" + +#include <wtf/text/CString.h> + +#include <AEEFile.h> + +namespace WebCore { + +String KURL::fileSystemPath() const +{ + // Access files relative to the current module directory in a case-sensitive manner. + // As IWeb "file:" engine opens files in BREW's application-relative file namespace, + // we follow the same policy here. + return String(AEEFS_HOME_DIR) + path(); +} + +} diff --git a/Source/WebCore/platform/brew/LanguageBrew.cpp b/Source/WebCore/platform/brew/LanguageBrew.cpp new file mode 100644 index 0000000..ce41973 --- /dev/null +++ b/Source/WebCore/platform/brew/LanguageBrew.cpp @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2010 Company 100, 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 "Language.h" + +#include "NotImplemented.h" +#include "PlatformString.h" + +namespace WebCore { + +String platformDefaultLanguage() +{ + notImplemented(); + return String(); +} + +} diff --git a/Source/WebCore/platform/brew/LocalizedStringsBrew.cpp b/Source/WebCore/platform/brew/LocalizedStringsBrew.cpp new file mode 100644 index 0000000..08e2002 --- /dev/null +++ b/Source/WebCore/platform/brew/LocalizedStringsBrew.cpp @@ -0,0 +1,500 @@ +/* + * Copyright (C) 2009 Company 100, 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 "LocalizedStrings.h" + +#include "NotImplemented.h" +#include "PlatformString.h" + +namespace WebCore { + +String submitButtonDefaultLabel() +{ + return "Submit"; +} + +String inputElementAltText() +{ + return String(); +} + +String resetButtonDefaultLabel() +{ + return "Reset"; +} + +String searchableIndexIntroduction() +{ + return "Searchable Index"; +} + +String fileButtonChooseFileLabel() +{ + return "Choose File"; +} + +String fileButtonNoFileSelectedLabel() +{ + return "No file selected"; +} + +String contextMenuItemTagOpenLinkInNewWindow() +{ + return "Open in new tab"; +} + +String contextMenuItemTagDownloadLinkToDisk() +{ + return "Download link to disk"; +} + +String contextMenuItemTagCopyLinkToClipboard() +{ + return "Copy link to clipboard"; +} + +String contextMenuItemTagOpenImageInNewWindow() +{ + return "Open image in new window"; +} + +String contextMenuItemTagDownloadImageToDisk() +{ + return "Download image to disk"; +} + +String contextMenuItemTagCopyImageToClipboard() +{ + return "Copy image to clipboard"; +} + +String contextMenuItemTagOpenVideoInNewWindow() +{ + return "Open video in new window"; +} + +String contextMenuItemTagOpenAudioInNewWindow() +{ + return "Open audio in new window"; +} + +String contextMenuItemTagCopyVideoLinkToClipboard() +{ + return "Copy Video link location"; +} + +String contextMenuItemTagCopyAudioLinkToClipboard() +{ + return "Copy audio link location"; +} + +String contextMenuItemTagToggleMediaControls() +{ + return "Toggle media controls"; +} + +String contextMenuItemTagToggleMediaLoop() +{ + return "Toggle media loop playback"; +} + +String contextMenuItemTagEnterVideoFullscreen() +{ + return "Switch video to fullscreen"; +} + +String contextMenuItemTagMediaPlay() +{ + return "Play"; +} + +String contextMenuItemTagMediaPause() +{ + return "Pause"; +} + +String contextMenuItemTagMediaMute() +{ + return "Mute"; +} + +String contextMenuItemTagOpenFrameInNewWindow() +{ + return "Open frame in new window"; +} + +String contextMenuItemTagCopy() +{ + return "Copy"; +} + +String contextMenuItemTagGoBack() +{ + return "Go back"; +} + +String contextMenuItemTagGoForward() +{ + return "Go forward"; +} + +String contextMenuItemTagStop() +{ + return "Stop"; +} + +String contextMenuItemTagReload() +{ + return "Reload"; +} + +String contextMenuItemTagCut() +{ + return "Cut"; +} + +String contextMenuItemTagPaste() +{ + return "Paste"; +} + +String contextMenuItemTagNoGuessesFound() +{ + return "No guesses found"; +} + +String contextMenuItemTagIgnoreSpelling() +{ + return "Ignore spelling"; +} + +String contextMenuItemTagLearnSpelling() +{ + return "Learn spelling"; +} + +String contextMenuItemTagSearchWeb() +{ + return "Search web"; +} + +String contextMenuItemTagLookUpInDictionary() +{ + return "Lookup in dictionary"; +} + +String contextMenuItemTagOpenLink() +{ + return "Open link"; +} + +String contextMenuItemTagIgnoreGrammar() +{ + return "Ignore grammar"; +} + +String contextMenuItemTagSpellingMenu() +{ + return "Spelling menu"; +} + +String contextMenuItemTagShowSpellingPanel(bool show) +{ + return "Show spelling panel"; +} + +String contextMenuItemTagCheckSpelling() +{ + return "Check spelling"; +} + +String contextMenuItemTagCheckSpellingWhileTyping() +{ + return "Check spelling while typing"; +} + +String contextMenuItemTagCheckGrammarWithSpelling() +{ + return "Check for grammar with spelling"; +} + +String contextMenuItemTagFontMenu() +{ + return "Font menu"; +} + +String contextMenuItemTagBold() +{ + return "Bold"; +} + +String contextMenuItemTagItalic() +{ + return "Italic"; +} + +String contextMenuItemTagUnderline() +{ + return "Underline"; +} + +String contextMenuItemTagOutline() +{ + return "Outline"; +} + +String contextMenuItemTagWritingDirectionMenu() +{ + return "Writing direction menu"; +} + +String contextMenuItemTagDefaultDirection() +{ + return "Default direction"; +} + +String contextMenuItemTagLeftToRight() +{ + return "Left to right"; +} + +String contextMenuItemTagRightToLeft() +{ + return "Right to left"; +} + +String contextMenuItemTagInspectElement() +{ + return "Inspect"; +} + +String searchMenuNoRecentSearchesText() +{ + return "No recent text searches"; +} + +String searchMenuRecentSearchesText() +{ + return "Recent text searches"; +} + +String searchMenuClearRecentSearchesText() +{ + return "Clear recent text searches"; +} + +String unknownFileSizeText() +{ + return "Unknown"; +} + +String AXWebAreaText() +{ + return String(); +} + +String AXLinkText() +{ + return String(); +} + +String AXListMarkerText() +{ + return String(); +} + +String AXImageMapText() +{ + return String(); +} + +String AXHeadingText() +{ + return String(); +} + +String imageTitle(const String& filename, const IntSize& size) +{ + return String(filename); +} + +String contextMenuItemTagTextDirectionMenu() +{ + return String(); +} + +String AXButtonActionVerb() +{ + return String(); +} + +String AXTextFieldActionVerb() +{ + return String(); +} + +String AXRadioButtonActionVerb() +{ + return String(); +} + +String AXCheckedCheckBoxActionVerb() +{ + return String(); +} + +String AXUncheckedCheckBoxActionVerb() +{ + return String(); +} + +String AXLinkActionVerb() +{ + return String(); +} + +String AXMenuListPopupActionVerb() +{ + return String(); +} + +String AXMenuListActionVerb() +{ + return String(); +} + +String AXDefinitionListTermText() +{ + return String(); +} + +String AXDefinitionListDefinitionText() +{ + return String(); +} + +String validationMessageValueMissingText() +{ + notImplemented(); + return String(); +} + +String validationMessageValueMissingForCheckboxText() +{ + notImplemented(); + return validationMessageValueMissingText(); +} + +String validationMessageValueMissingForFileText() +{ + notImplemented(); + return validationMessageValueMissingText(); +} + +String validationMessageValueMissingForMultipleFileText() +{ + notImplemented(); + return validationMessageValueMissingText(); +} + +String validationMessageValueMissingForRadioText() +{ + notImplemented(); + return validationMessageValueMissingText(); +} + +String validationMessageValueMissingForSelectText() +{ + notImplemented(); + return validationMessageValueMissingText(); +} + +String validationMessageTypeMismatchText() +{ + notImplemented(); + return String(); +} + +String validationMessageTypeMismatchForEmailText() +{ + notImplemented(); + return validationMessageTypeMismatchText(); +} + +String validationMessageTypeMismatchForMultipleEmailText() +{ + notImplemented(); + return validationMessageTypeMismatchText(); +} + +String validationMessageTypeMismatchForURLText() +{ + notImplemented(); + return validationMessageTypeMismatchText(); +} + +String validationMessagePatternMismatchText() +{ + notImplemented(); + return String(); +} + +String validationMessageTooLongText(int, int) +{ + notImplemented(); + return String(); +} + +String validationMessageRangeUnderflowText(const String&) +{ + notImplemented(); + return String(); +} + +String validationMessageRangeOverflowText(const String&) +{ + notImplemented(); + return String(); +} + +String validationMessageStepMismatchText(const String&, const String&) +{ + notImplemented(); + return String(); +} + +String missingPluginText() +{ + return "Missing Plug-in"; +} + +String crashedPluginText() +{ + return "Plug-in Crashed"; +} + +} // namespace WebCore + diff --git a/Source/WebCore/platform/brew/LoggingBrew.cpp b/Source/WebCore/platform/brew/LoggingBrew.cpp new file mode 100644 index 0000000..e8f79f7 --- /dev/null +++ b/Source/WebCore/platform/brew/LoggingBrew.cpp @@ -0,0 +1,45 @@ +/* + * Copyright (C) 2009 Company 100, Inc. + * + * 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 "Logging.h" + +namespace WebCore { + +void InitializeLoggingChannelsIfNecessary() +{ + // FIXME: Should read the logging channels from a file. + static bool haveInitializedLoggingChannels = false; + if (haveInitializedLoggingChannels) + return; + + haveInitializedLoggingChannels = true; + + // By default we log calls to notImplemented(). + LogNotYetImplemented.state = WTFLogChannelOn; +} + +} // namespace WebCore + diff --git a/Source/WebCore/platform/brew/MIMETypeRegistryBrew.cpp b/Source/WebCore/platform/brew/MIMETypeRegistryBrew.cpp new file mode 100644 index 0000000..0a538c2 --- /dev/null +++ b/Source/WebCore/platform/brew/MIMETypeRegistryBrew.cpp @@ -0,0 +1,85 @@ +/* + * Copyright (C) 2006 Zack Rusin <zack@kde.org> + * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. + * Copyright (C) 2007 Trolltech ASA + * Copyright (C) 2009 Company 100, Inc. + * + * 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" + +#include "PlatformString.h" + +namespace WebCore { + +struct ExtensionMap { + const char* extension; + const char* mimeType; +}; + +static const ExtensionMap extensionMap[] = { + { "bmp", "image/bmp" }, + { "css", "text/css" }, + { "gif", "image/gif" }, + { "html", "text/html" }, + { "htm", "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 str = ext.lower(); + + const ExtensionMap* e = extensionMap; + while (e->extension) { + if (str == e->extension) + return e->mimeType; + ++e; + } + + // unknown, let's just assume plain text + return "text/plain"; +} + +bool MIMETypeRegistry::isApplicationPluginMIMEType(const String&) +{ + return false; +} + +} // namespace WebCore + diff --git a/Source/WebCore/platform/brew/PasteboardBrew.cpp b/Source/WebCore/platform/brew/PasteboardBrew.cpp new file mode 100644 index 0000000..e5049b4 --- /dev/null +++ b/Source/WebCore/platform/brew/PasteboardBrew.cpp @@ -0,0 +1,93 @@ +/* + * Copyright (C) 2006, 2007 Apple Inc. All rights reserved. + * Copyright (C) 2009 Company 100, Inc. + * + * 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 "Pasteboard.h" + +#include "DocumentFragment.h" +#include "NotImplemented.h" +#include "Range.h" + +#include <wtf/text/CString.h> + +namespace WebCore { + +Pasteboard* Pasteboard::generalPasteboard() +{ + static Pasteboard* pasteboard = new Pasteboard; + return pasteboard; +} + +Pasteboard::Pasteboard() +{ + notImplemented(); +} + +void Pasteboard::clear() +{ + notImplemented(); +} + +void Pasteboard::writeSelection(Range* selectedRange, bool canSmartCopyOrDelete, Frame* frame) +{ + notImplemented(); +} + +void Pasteboard::writePlainText(const String& text) +{ + notImplemented(); +} + +void Pasteboard::writeURL(const KURL& url, const String& titleStr, Frame* frame) +{ + notImplemented(); +} + +void Pasteboard::writeImage(Node* node, const KURL&, const String&) +{ + notImplemented(); +} + +bool Pasteboard::canSmartReplace() +{ + notImplemented(); + return false; +} + +String Pasteboard::plainText(Frame* frame) +{ + notImplemented(); + return String(); +} + +PassRefPtr<DocumentFragment> Pasteboard::documentFragment(Frame* frame, PassRefPtr<Range> context, bool allowPlainText, bool& chosePlainText) +{ + notImplemented(); + return 0; +} + +} // namespace WebCore diff --git a/Source/WebCore/platform/brew/PlatformKeyboardEventBrew.cpp b/Source/WebCore/platform/brew/PlatformKeyboardEventBrew.cpp new file mode 100644 index 0000000..bd41c9a --- /dev/null +++ b/Source/WebCore/platform/brew/PlatformKeyboardEventBrew.cpp @@ -0,0 +1,261 @@ +/* + * Copyright (C) 2010 Company 100, 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 "PlatformKeyboardEvent.h" + +#include "NotImplemented.h" +#include "WindowsKeyboardCodes.h" + +#include <AEEEvent.h> +#include <AEEIKeysMapping.h> +#include <AEEKeysMapping.bid> +#include <AEEStdDef.h> +#include <AEEVCodes.h> + +#include <wtf/brew/RefPtrBrew.h> +#include <wtf/brew/ShellBrew.h> + +namespace WebCore { + +static String keyIdentifierForBrewKeyCode(uint16 keyCode) +{ + switch (keyCode) { + case AVK_LALT: + case AVK_RALT: + return "Alt"; + case AVK_LCTRL: + case AVK_RCTRL: + return "Control"; + case AVK_LSHIFT: + case AVK_RSHIFT: + return "Shift"; + case AVK_CAPLK: + return "CapsLock"; + case AVK_FUNCTION1: + return "F1"; + case AVK_FUNCTION2: + return "F2"; + case AVK_FUNCTION3: + return "F3"; + case AVK_FUNCTION4: + return "F4"; + case AVK_FUNCTION5: + return "F5"; + case AVK_FUNCTION6: + return "F6"; + case AVK_FUNCTION7: + return "F7"; + case AVK_FUNCTION8: + return "F8"; + case AVK_FUNCTION9: + return "F9"; + case AVK_FUNCTION10: + return "F10"; + case AVK_FUNCTION11: + return "F11"; + case AVK_FUNCTION12: + return "F12"; + case AVK_PRSCRN: + return "PrintScreen"; + case AVK_LEFT: + return "Left"; + case AVK_RIGHT: + return "Right"; + case AVK_UP: + return "Up"; + case AVK_DOWN: + return "Down"; + case AVK_TXINSERT: + return "Insert"; + case AVK_ENTER: + return "Enter"; + case AVK_TXHOME: + return "Home"; + case AVK_TXDELETE: + // Standard says that DEL becomes U+007F. + return "U+007F"; + case AVK_TXEND: + return "End"; + case AVK_TXPGUP: + return "PageUp"; + case AVK_TXPGDOWN: + return "PageDown"; + case AVK_FUNCTION: + return "U+0009"; + default: + return String::format("U+%04X", toASCIIUpper(keyCode)); + } +} + +static int windowsKeyCodeForKeyEvent(uint16 code) +{ + switch (code) { + case AVK_CLR: + return VK_BACK; // (08) BACKSPACE key + case AVK_ENTER: + return VK_RETURN; // (0D) Return key + case AVK_SPACE: + return VK_SPACE; // (20) SPACEBAR + case AVK_TXPGUP: + return VK_PRIOR; // (21) PAGE UP key + case AVK_TXPGDOWN: + return VK_NEXT; // (22) PAGE DOWN key + case AVK_TXEND: + return VK_END; // (23) END key + case AVK_TXHOME: + return VK_HOME; // (24) HOME key + case AVK_LEFT: + return VK_LEFT; // (25) LEFT ARROW key + case AVK_UP: + return VK_UP; // (26) UP ARROW key + case AVK_RIGHT: + return VK_RIGHT; // (27) RIGHT ARROW key + case AVK_DOWN: + return VK_DOWN; // (28) DOWN ARROW key + case AVK_TXINSERT: + return VK_INSERT; // (2D) INS key + case AVK_TXDELETE: + return VK_DELETE; // (2E) DEL key + case AVK_FUNCTION: + return VK_TAB; // (09) TAB key + default: + return 0; + } +} + +static inline String singleCharacterString(UChar c) +{ + UChar text; + + // Some key codes are not mapped to Unicode characters. Convert them to Unicode characters here. + switch (c) { + case AVK_0: + text = VK_0; + break; + case AVK_1: + text = VK_1; + break; + case AVK_2: + text = VK_2; + break; + case AVK_3: + text = VK_3; + break; + case AVK_4: + text = VK_4; + break; + case AVK_5: + text = VK_5; + break; + case AVK_6: + text = VK_6; + break; + case AVK_7: + text = VK_7; + break; + case AVK_8: + text = VK_8; + break; + case AVK_9: + text = VK_9; + break; + case AVK_STAR: + text = '*'; + break; + case AVK_POUND: + text = '#'; + break; + case AVK_FUNCTION1: + text = '='; + break; + case AVK_FUNCTION2: + text = '/'; + break; + case AVK_FUNCTION3: + text = '_'; + break; + case AVK_PUNC1: + text = ','; + break; + case AVK_PUNC2: + text = '.'; + break; + case AVK_SPACE: + text = VK_SPACE; + break; + default: + text = c; + break; + } + + return String(&text, 1); +} + +PlatformKeyboardEvent::PlatformKeyboardEvent(AEEEvent event, uint16 code, uint32 modifiers, Type type) + : m_type(type) + , m_isKeypad(false) + , m_metaKey(false) + , m_windowsVirtualKeyCode((type == RawKeyDown || type == KeyUp) ? windowsKeyCodeForKeyEvent(code) : 0) +{ + if ((m_type == Char) && modifiers) { + RefPtr<IKeysMapping> keysMapping = createRefPtrInstance<IKeysMapping>(AEECLSID_KeysMapping); + int result = IKeysMapping_GetMapping(keysMapping.get(), code, modifiers, reinterpret_cast<AECHAR*>(&code)); + if (result == AEE_SUCCESS) // Reset the modifier when key code is successfully mapped. + modifiers = 0; + } + + m_text = (type == Char) ? singleCharacterString(code) : String(); + m_unmodifiedText = (type == Char) ? singleCharacterString(code) : String(); + m_keyIdentifier = (type == Char) ? String() : keyIdentifierForBrewKeyCode(code); + m_nativeVirtualKeyCode = code; + m_autoRepeat = modifiers & KB_AUTOREPEAT; + m_shiftKey = modifiers & (KB_LSHIFT | KB_RSHIFT); + m_ctrlKey = modifiers & (KB_LCTRL | KB_RCTRL); + m_altKey = modifiers & (KB_LALT | KB_RALT); +} + +void PlatformKeyboardEvent::disambiguateKeyDownEvent(Type type, bool) +{ + // No KeyDown events on BREW to disambiguate. + ASSERT_NOT_REACHED(); +} + +bool PlatformKeyboardEvent::currentCapsLockState() +{ + notImplemented(); + return false; +} + +void PlatformKeyboardEvent::getCurrentModifierState(bool& shiftKey, bool& ctrlKey, bool& altKey, bool& metaKey) +{ + notImplemented(); + shiftKey = false; + ctrlKey = false; + altKey = false; + metaKey = false; +} + +} // namespace WebCore diff --git a/Source/WebCore/platform/brew/PlatformMouseEventBrew.cpp b/Source/WebCore/platform/brew/PlatformMouseEventBrew.cpp new file mode 100644 index 0000000..a118d19 --- /dev/null +++ b/Source/WebCore/platform/brew/PlatformMouseEventBrew.cpp @@ -0,0 +1,80 @@ +/* + * Copyright (C) 2009 Company 100, 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 "PlatformMouseEvent.h" + +#include <AEEEvent.h> +#include <AEEPointerHelpers.h> +#include <AEEStdDef.h> +#include <AEEVCodes.h> + +namespace WebCore { + +PlatformMouseEvent::PlatformMouseEvent(AEEEvent event, uint16 wParam, uint32 dwParam) +{ + switch (event) { + case EVT_POINTER_DOWN: + m_eventType = MouseEventPressed; + break; + case EVT_POINTER_UP: + m_eventType = MouseEventReleased; + break; + case EVT_POINTER_MOVE: + case EVT_POINTER_STALE_MOVE: + m_eventType = MouseEventMoved; + break; + default: + m_eventType = MouseEventMoved; + break; + }; + + char* dwParamStr = reinterpret_cast<char*>(dwParam); + + int x, y; + AEE_POINTER_GET_XY(dwParamStr, &x, &y); + m_position = IntPoint(x, y); + // Use IDisplay, so position and global position are the same. + m_globalPosition = m_position; + + uint32 keyModifiers = AEE_POINTER_GET_KEY_MODIFIERS(dwParamStr); + m_shiftKey = keyModifiers & (KB_LSHIFT | KB_RSHIFT); + m_ctrlKey = keyModifiers & (KB_LCTRL | KB_RCTRL); + m_altKey = keyModifiers & (KB_LALT | KB_RALT); + m_metaKey = m_altKey; + + // AEE_POINTER_GET_MOUSE_MODIFIERS(dwParamStr) always returns 0, + // so it is impossible to know which button is pressed or released. + // Just use LeftButton because Brew MP usually runs on touch device. + m_button = LeftButton; + + // AEE_POINTER_GET_TIME returns milliseconds + m_timestamp = AEE_POINTER_GET_TIME(dwParamStr) * 0.001; + + m_clickCount = AEE_POINTER_GET_CLICKCOUNT(dwParamStr); +} + +} // namespace WebCore + diff --git a/Source/WebCore/platform/brew/PlatformTouchEventBrew.cpp b/Source/WebCore/platform/brew/PlatformTouchEventBrew.cpp new file mode 100644 index 0000000..9f31dae --- /dev/null +++ b/Source/WebCore/platform/brew/PlatformTouchEventBrew.cpp @@ -0,0 +1,76 @@ +/* + * Copyright 2010, Company 100, 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: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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 THE COPYRIGHT HOLDERS ``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 THE COPYRIGHT OWNER 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 "PlatformTouchEvent.h" + +#include <AEEEvent.h> +#include <AEEPointerHelpers.h> +#include <AEEVCodes.h> + +#if ENABLE(TOUCH_EVENTS) + +namespace WebCore { + +PlatformTouchEvent::PlatformTouchEvent(AEEEvent event, uint16 wParam, uint32 dwParam) + : m_metaKey(false) +{ + PlatformTouchPoint::State state; + + switch (event) { + case EVT_POINTER_DOWN: + m_type = TouchStart; + state = PlatformTouchPoint::TouchPressed; + break; + case EVT_POINTER_UP: + m_type = TouchEnd; + state = PlatformTouchPoint::TouchReleased; + break; + case EVT_POINTER_MOVE: + case EVT_POINTER_STALE_MOVE: + m_type = TouchMove; + state = PlatformTouchPoint::TouchMoved; + break; + default: + ASSERT_NOT_REACHED(); + } + + char* dwParamStr = reinterpret_cast<char*>(dwParam); + int x, y; + AEE_POINTER_GET_XY(dwParamStr, &x, &y); + IntPoint windowPos = IntPoint(x, y); + + int id = AEE_POINTER_GET_PTRID(dwParamStr); + m_touchPoints.append(PlatformTouchPoint(id, windowPos, state)); + + uint32 keyModifiers = AEE_POINTER_GET_KEY_MODIFIERS(dwParamStr); + m_altKey = keyModifiers & (KB_LALT | KB_RALT); + m_shiftKey = keyModifiers & (KB_LSHIFT | KB_RSHIFT); + m_ctrlKey = keyModifiers & (KB_LCTRL | KB_RCTRL); +} + +} + +#endif diff --git a/Source/WebCore/platform/brew/PlatformTouchPointBrew.cpp b/Source/WebCore/platform/brew/PlatformTouchPointBrew.cpp new file mode 100644 index 0000000..6943182 --- /dev/null +++ b/Source/WebCore/platform/brew/PlatformTouchPointBrew.cpp @@ -0,0 +1,41 @@ +/* + * Copyright 2010, Company 100, 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: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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 THE COPYRIGHT HOLDERS ``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 THE COPYRIGHT OWNER 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 "PlatformTouchPoint.h" + +#if ENABLE(TOUCH_EVENTS) + +namespace WebCore { + +PlatformTouchPoint::PlatformTouchPoint(int id, const IntPoint& windowPos, State state) + : m_id(id) + , m_state(state) + , m_screenPos(windowPos) + , m_pos(windowPos) { } + +} + +#endif diff --git a/Source/WebCore/platform/brew/PopupMenuBrew.cpp b/Source/WebCore/platform/brew/PopupMenuBrew.cpp new file mode 100644 index 0000000..18b2b45 --- /dev/null +++ b/Source/WebCore/platform/brew/PopupMenuBrew.cpp @@ -0,0 +1,87 @@ +/* + * Copyright (C) 2006, 2008 Apple Inc. All rights reserved. + * Copyright (C) 2008 INdT - Instituto Nokia de Tecnologia + * Copyright (C) 2009-2010 ProFUSION embedded systems + * Copyright (C) 2009-2010 Samsung Electronics + * Copyright (C) 2010 Company 100, Inc. + * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public License + * along with this library; see the file COPYING.LIB. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + * + */ + +#include "config.h" +#include "PopupMenuBrew.h" + +#include "Chrome.h" +#include "ChromeClientBrew.h" +#include "FrameView.h" +#include "NotImplemented.h" + +namespace WebCore { + +PopupMenuBrew::PopupMenuBrew(PopupMenuClient* menuList) + : m_popupClient(menuList) + , m_view(0) +{ +} + +PopupMenuBrew::~PopupMenuBrew() +{ + // Tell client to destroy data related to this popup since this object is + // going away. + hide(); +} + +void PopupMenuBrew::disconnectClient() +{ + m_popupClient = 0; +} + +void PopupMenuBrew::show(const IntRect& rect, FrameView* view, int index) +{ + ASSERT(m_popupClient); + ChromeClientBrew* chromeClient = static_cast<ChromeClientBrew*>(view->frame()->page()->chrome()->client()); + ASSERT(chromeClient); + + m_view = view; + chromeClient->createSelectPopup(m_popupClient, index, rect); +} + +void PopupMenuBrew::hide() +{ + ASSERT(m_view); + ChromeClientBrew* chromeClient = static_cast<ChromeClientBrew*>(m_view->frame()->page()->chrome()->client()); + ASSERT(chromeClient); + + chromeClient->destroySelectPopup(); +} + +void PopupMenuBrew::updateFromElement() +{ + client()->setTextFromItem(client()->selectedIndex()); +} + +// This code must be moved to the concrete brew ChromeClient that is not in repository. +// I kept this code commented out here to prevent loosing the information of what +// must be the return value for brew. + +// bool PopupMenuBrew::itemWritingDirectionIsNatural() +// { +// return true; +// } + +} // namespace WebCore diff --git a/Source/WebCore/platform/brew/PopupMenuBrew.h b/Source/WebCore/platform/brew/PopupMenuBrew.h new file mode 100644 index 0000000..0c171df --- /dev/null +++ b/Source/WebCore/platform/brew/PopupMenuBrew.h @@ -0,0 +1,53 @@ +/* + * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public License + * along with this library; see the file COPYING.LIB. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#ifndef PopupMenuBrew_h +#define PopupMenuBrew_h + +#include "IntRect.h" +#include "PopupMenu.h" +#include "PopupMenuClient.h" +#include <wtf/PassRefPtr.h> +#include <wtf/RefCounted.h> + +namespace WebCore { + +class FrameView; +class Scrollbar; + +class PopupMenuBrew : public PopupMenu { +public: + PopupMenuBrew(PopupMenuClient*); + ~PopupMenuBrew(); + + virtual void show(const IntRect&, FrameView*, int index); + virtual void hide(); + virtual void updateFromElement(); + virtual void disconnectClient(); + +private: + PopupMenuClient* client() const { return m_popupClient; } + + PopupMenuClient* m_popupClient; + FrameView* m_view; +}; + +} + +#endif // PopupMenuBrew_h diff --git a/Source/WebCore/platform/brew/SSLKeyGeneratorBrew.cpp b/Source/WebCore/platform/brew/SSLKeyGeneratorBrew.cpp new file mode 100644 index 0000000..dc1a148 --- /dev/null +++ b/Source/WebCore/platform/brew/SSLKeyGeneratorBrew.cpp @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2010 Company 100, Inc. All Rights Reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public License + * along with this library; see the file COPYING.LIB. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + */ + +#include "config.h" +#include "SSLKeyGenerator.h" + +#include "NotImplemented.h" + +namespace WebCore { + +void getSupportedKeySizes(Vector<String>& v) +{ + notImplemented(); +} + +String signedPublicKeyAndChallengeString(unsigned index, const String& challenge, const KURL& url) +{ + notImplemented(); + return String(); +} + +} // namespace WebCore diff --git a/Source/WebCore/platform/brew/ScreenBrew.cpp b/Source/WebCore/platform/brew/ScreenBrew.cpp new file mode 100644 index 0000000..6316ee0 --- /dev/null +++ b/Source/WebCore/platform/brew/ScreenBrew.cpp @@ -0,0 +1,94 @@ +/* + * Copyright (C) 2009 Company 100, 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 "Screen.h" + +#include "FloatRect.h" +#include "Frame.h" +#include "FrameView.h" +#include "IntRect.h" +#include "NotImplemented.h" +#include "Page.h" +#include "Widget.h" + +#include <AEEAppGen.h> +#include <AEEStdLib.h> +#include <wtf/brew/RefPtrBrew.h> + +namespace WebCore { + +struct DisplayInfo { + int width; + int height; + int depth; +}; + +static void getDisplayInfo(DisplayInfo& info) +{ + IDisplay* display = reinterpret_cast<AEEApplet*>(GETAPPINSTANCE())->m_pIDisplay; + RefPtr<IBitmap> bitmap = adoptRef(IDisplay_GetDestination(display)); + + AEEBitmapInfo bitmapInfo; + IBitmap_GetInfo(bitmap.get(), &bitmapInfo, sizeof(AEEBitmapInfo)); + + info.width = bitmapInfo.cx; + info.height = bitmapInfo.cy; + info.depth = bitmapInfo.nDepth; +} + +FloatRect screenRect(Widget*) +{ + DisplayInfo info; + getDisplayInfo(info); + + return FloatRect(0, 0, info.width, info.height); +} + +FloatRect screenAvailableRect(Widget* widget) +{ + return screenRect(widget); +} + +int screenDepth(Widget*) +{ + DisplayInfo info; + getDisplayInfo(info); + + return info.depth; +} + +int screenDepthPerComponent(Widget* widget) +{ + return screenDepth(widget); +} + +bool screenIsMonochrome(Widget*) +{ + return false; +} + +} // namespace WebCore + diff --git a/Source/WebCore/platform/brew/ScrollbarThemeBrew.cpp b/Source/WebCore/platform/brew/ScrollbarThemeBrew.cpp new file mode 100644 index 0000000..af64f90 --- /dev/null +++ b/Source/WebCore/platform/brew/ScrollbarThemeBrew.cpp @@ -0,0 +1,42 @@ +/* + * Copyright (C) 2009-2010 Company 100, 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 "ScrollbarThemeBrew.h" + +namespace WebCore { + +ScrollbarTheme* ScrollbarTheme::nativeTheme() +{ + DEFINE_STATIC_LOCAL(ScrollbarThemeBrew, theme, ()); + return &theme; +} + +ScrollbarThemeBrew::~ScrollbarThemeBrew() +{ +} + +} + diff --git a/Source/WebCore/platform/brew/ScrollbarThemeBrew.h b/Source/WebCore/platform/brew/ScrollbarThemeBrew.h new file mode 100644 index 0000000..df438c4 --- /dev/null +++ b/Source/WebCore/platform/brew/ScrollbarThemeBrew.h @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2009-2010 Company 100, 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 ScrollbarThemeBrew_h +#define ScrollbarThemeBrew_h + +#include "ScrollbarTheme.h" + +namespace WebCore { + +class ScrollbarThemeBrew : public ScrollbarTheme { +public: + virtual ~ScrollbarThemeBrew(); +}; + +} +#endif diff --git a/Source/WebCore/platform/brew/SearchPopupMenuBrew.cpp b/Source/WebCore/platform/brew/SearchPopupMenuBrew.cpp new file mode 100644 index 0000000..81ca624 --- /dev/null +++ b/Source/WebCore/platform/brew/SearchPopupMenuBrew.cpp @@ -0,0 +1,58 @@ +/* + * Copyright (C) 2010 Company 100, Inc. All rights reserved. + * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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 THE COPYRIGHT HOLDERS ``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 "SearchPopupMenuBrew.h" + +namespace WebCore { + +// Save the past searches stored in 'searchItems' to a database associated with 'name' +void SearchPopupMenuBrew::saveRecentSearches(const AtomicString& name, const Vector<String>& searchItems) +{ +} + +// Load past searches associated with 'name' from the database to 'searchItems' +void SearchPopupMenuBrew::loadRecentSearches(const AtomicString& name, Vector<String>& searchItems) +{ +} + +// Create a search popup menu - not sure what else we have to do here +SearchPopupMenuBrew::SearchPopupMenuBrew(PopupMenuClient* client) + : m_popup(adoptRef(new PopupMenuBrew(client))) +{ +} + +bool SearchPopupMenuBrew::enabled() +{ + return false; +} + +PopupMenu* SearchPopupMenuBrew::popupMenu() +{ + return m_popup.get(); +} + +} // namespace WebCore diff --git a/Source/WebCore/platform/brew/SearchPopupMenuBrew.h b/Source/WebCore/platform/brew/SearchPopupMenuBrew.h new file mode 100644 index 0000000..4ce7005 --- /dev/null +++ b/Source/WebCore/platform/brew/SearchPopupMenuBrew.h @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies). + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public License + * along with this library; see the file COPYING.LIB. If not, write to + * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + * Boston, MA 02110-1301, USA. + * + */ + +#ifndef SearchPopupMenuBrew_h +#define SearchPopupMenuBrew_h + +#include "PopupMenuBrew.h" +#include "SearchPopupMenu.h" + +namespace WebCore { + +class SearchPopupMenuBrew : public SearchPopupMenu { +public: + SearchPopupMenuBrew(PopupMenuClient*); + + virtual PopupMenu* popupMenu(); + virtual void saveRecentSearches(const AtomicString& name, const Vector<String>& searchItems); + virtual void loadRecentSearches(const AtomicString& name, Vector<String>& searchItems); + virtual bool enabled(); + +private: + RefPtr<PopupMenuBrew> m_popup; +}; + +} + +#endif // SearchPopupMenuBrew_h diff --git a/Source/WebCore/platform/brew/SharedBufferBrew.cpp b/Source/WebCore/platform/brew/SharedBufferBrew.cpp new file mode 100644 index 0000000..3d4c20a --- /dev/null +++ b/Source/WebCore/platform/brew/SharedBufferBrew.cpp @@ -0,0 +1,77 @@ +/* + * Copyright (C) 2010 Company 100, 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 "SharedBuffer.h" + +#include "FileSystem.h" +#include "ShellBrew.h" + +#include <AEEAppGen.h> +#include <AEEFile.h> +#include <AEEStdLib.h> + +#include <wtf/OwnPtr.h> +#include <wtf/text/CString.h> + +namespace WebCore { + +PassRefPtr<SharedBuffer> SharedBuffer::createWithContentsOfFile(const String& filePath) +{ + if (filePath.isEmpty()) + return 0; + + long long fileSize; + if (!fileExists(filePath) || !getFileSize(filePath, fileSize)) + return 0; + + RefPtr<SharedBuffer> result = create(); + result->m_buffer.grow(fileSize); + + OwnPtr<IFileMgr> fileMgr = createInstance<IFileMgr>(AEECLSID_FILEMGR); + + CString filename = fileSystemRepresentation(filePath); + OwnPtr<IFile> file(IFILEMGR_OpenFile(fileMgr.get(), filename.data(), _OFM_READ)); + + if (!file) { + LOG_ERROR("Failed to open file %s to create shared buffer, errno(%i)", filePath.ascii().data(), IFILEMGR_GetLastError(fileMgr.get())); + return 0; + } + + size_t totalBytesRead = 0; + int32 bytesRead; + while ((bytesRead = IFILE_Read(file.get(), result->m_buffer.data() + totalBytesRead, fileSize - totalBytesRead)) > 0) + totalBytesRead += bytesRead; + result->m_size = totalBytesRead; + + if (totalBytesRead != fileSize) { + LOG_ERROR("Failed to fully read contents of file %s - errno(%i)", filePath.ascii().data(), IFILEMGR_GetLastError(fileMgr.get())); + return 0; + } + + return result.release(); +} + +} // namespace WebCore diff --git a/Source/WebCore/platform/brew/SharedTimerBrew.cpp b/Source/WebCore/platform/brew/SharedTimerBrew.cpp new file mode 100644 index 0000000..d20fe48 --- /dev/null +++ b/Source/WebCore/platform/brew/SharedTimerBrew.cpp @@ -0,0 +1,80 @@ +/* + * Copyright (C) 2006 Apple Computer, Inc. All rights reserved. + * Copyright (C) 2009 Company 100, Inc. + * + * 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 "SharedTimer.h" + +#include <AEEAppGen.h> +#include <AEEStdLib.h> + +#include <wtf/CurrentTime.h> + +namespace WebCore { + +static void (*sharedTimerFiredFunction)(); + +static AEECallback sharedTimerCallback; + +static void invokeCallback(void*) +{ + sharedTimerFiredFunction(); +} + +void setSharedTimerFiredFunction(void (*f)()) +{ + sharedTimerFiredFunction = f; +} + +void setSharedTimerFireTime(double fireTime) +{ + ASSERT(sharedTimerFiredFunction); + + CALLBACK_Cancel(&sharedTimerCallback); + + double interval = fireTime - currentTime(); + int intervalInMS; + + if (interval < 0) + intervalInMS = 0; + else { + interval *= 1000; + intervalInMS = static_cast<int>(interval); + } + + sharedTimerCallback.pfnCancel = 0; + sharedTimerCallback.pfnNotify = invokeCallback; + sharedTimerCallback.pNotifyData = 0; + + IShell* shell = reinterpret_cast<AEEApplet*>(GETAPPINSTANCE())->m_pIShell; + ISHELL_SetTimerEx(shell, intervalInMS, &sharedTimerCallback); +} + +void stopSharedTimer() +{ + CALLBACK_Cancel(&sharedTimerCallback); +} + +} diff --git a/Source/WebCore/platform/brew/SoundBrew.cpp b/Source/WebCore/platform/brew/SoundBrew.cpp new file mode 100644 index 0000000..a616943 --- /dev/null +++ b/Source/WebCore/platform/brew/SoundBrew.cpp @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2009 Company 100, 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 "Sound.h" + +#include <AEEAppGen.h> +#include <AEEStdLib.h> + +namespace WebCore { + +void systemBeep() +{ + // systemBeep is used by Editor to notify errors when a user cuts or pastes + // where these operations are not permitted. + // Use BEEP_ERROR with loud volume. + IShell* shell = reinterpret_cast<AEEApplet*>(GETAPPINSTANCE())->m_pIShell; + ISHELL_Beep(shell, BEEP_ERROR, TRUE); +} + +} // namespace WebCore + diff --git a/Source/WebCore/platform/brew/SystemTimeBrew.cpp b/Source/WebCore/platform/brew/SystemTimeBrew.cpp new file mode 100644 index 0000000..c1e39fb --- /dev/null +++ b/Source/WebCore/platform/brew/SystemTimeBrew.cpp @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2010 Company 100. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * 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 THE COPYRIGHT HOLDERS ``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 "SystemTime.h" + +#include <float.h> + +namespace WebCore { + +float userIdleTime() +{ + // return an arbitrarily high userIdleTime so that releasing pages from the page cache isn't postponed + return FLT_MAX; +} + +} + diff --git a/Source/WebCore/platform/brew/TemporaryLinkStubs.cpp b/Source/WebCore/platform/brew/TemporaryLinkStubs.cpp new file mode 100644 index 0000000..d75c224 --- /dev/null +++ b/Source/WebCore/platform/brew/TemporaryLinkStubs.cpp @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2010 Company 100, 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 "NotImplemented.h" + +using namespace WebCore; + +namespace WebCore { + +void setCookieStoragePrivateBrowsingEnabled(bool) +{ + notImplemented(); +} + +} + diff --git a/Source/WebCore/platform/brew/WidgetBrew.cpp b/Source/WebCore/platform/brew/WidgetBrew.cpp new file mode 100644 index 0000000..5aff731 --- /dev/null +++ b/Source/WebCore/platform/brew/WidgetBrew.cpp @@ -0,0 +1,82 @@ +/* + * Copyright (C) 2009 Company 100, 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 "Widget.h" + +#include "Cursor.h" +#include "GraphicsContext.h" +#include "IntRect.h" +#include "NotImplemented.h" + +namespace WebCore { + +Widget::Widget(PlatformWidget widget) +{ + init(widget); +} + +Widget::~Widget() +{ +} + +IntRect Widget::frameRect() const +{ + return m_frame; +} + +void Widget::setFrameRect(const IntRect& rect) +{ + m_frame = rect; +} + +void Widget::setFocus(bool) +{ +} + +void Widget::setCursor(const Cursor& cursor) +{ +} + +void Widget::show() +{ +} + +void Widget::hide() +{ +} + +void Widget::paint(GraphicsContext* p, IntRect const& r) +{ + notImplemented(); +} + +void Widget::setIsSelected(bool) +{ + notImplemented(); +} + +} // namespace WebCore + |