summaryrefslogtreecommitdiffstats
path: root/WebCore/platform/haiku
diff options
context:
space:
mode:
authorBen Murdoch <benm@google.com>2009-08-11 17:01:47 +0100
committerBen Murdoch <benm@google.com>2009-08-11 18:21:02 +0100
commit0bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5 (patch)
tree2943df35f62d885c89d01063cc528dd73b480fea /WebCore/platform/haiku
parent7e7a70bfa49a1122b2597a1e6367d89eb4035eca (diff)
downloadexternal_webkit-0bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5.zip
external_webkit-0bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5.tar.gz
external_webkit-0bf48ef3be53ddaa52bbead65dfd75bf90e7a2b5.tar.bz2
Merge in WebKit r47029.
Diffstat (limited to 'WebCore/platform/haiku')
-rw-r--r--WebCore/platform/haiku/ClipboardHaiku.cpp207
-rw-r--r--WebCore/platform/haiku/ClipboardHaiku.h73
-rw-r--r--WebCore/platform/haiku/ContextMenuHaiku.cpp143
-rw-r--r--WebCore/platform/haiku/ContextMenuItemHaiku.cpp164
-rw-r--r--WebCore/platform/haiku/CookieJarHaiku.cpp61
-rw-r--r--WebCore/platform/haiku/CursorHaiku.cpp237
-rw-r--r--WebCore/platform/haiku/DragDataHaiku.cpp109
-rw-r--r--WebCore/platform/haiku/DragImageHaiku.cpp74
-rw-r--r--WebCore/platform/haiku/EventLoopHaiku.cpp41
-rw-r--r--WebCore/platform/haiku/FileChooserHaiku.cpp46
-rw-r--r--WebCore/platform/haiku/FileSystemHaiku.cpp82
-rw-r--r--WebCore/platform/haiku/KeyboardCodes.h544
-rw-r--r--WebCore/platform/haiku/MIMETypeRegistryHaiku.cpp75
-rw-r--r--WebCore/platform/haiku/PasteboardHaiku.cpp138
-rw-r--r--WebCore/platform/haiku/PlatformKeyboardEventHaiku.cpp193
-rw-r--r--WebCore/platform/haiku/PlatformMouseEventHaiku.cpp82
-rw-r--r--WebCore/platform/haiku/PlatformWheelEventHaiku.cpp62
-rw-r--r--WebCore/platform/haiku/PopupMenuHaiku.cpp68
-rw-r--r--WebCore/platform/haiku/ScreenHaiku.cpp86
-rw-r--r--WebCore/platform/haiku/SearchPopupMenuHaiku.cpp51
-rw-r--r--WebCore/platform/haiku/SoundHaiku.cpp42
-rw-r--r--WebCore/platform/haiku/TemporaryLinkStubs.cpp126
-rw-r--r--WebCore/platform/haiku/WidgetHaiku.cpp95
23 files changed, 2799 insertions, 0 deletions
diff --git a/WebCore/platform/haiku/ClipboardHaiku.cpp b/WebCore/platform/haiku/ClipboardHaiku.cpp
new file mode 100644
index 0000000..845c08c
--- /dev/null
+++ b/WebCore/platform/haiku/ClipboardHaiku.cpp
@@ -0,0 +1,207 @@
+/*
+ * Copyright (C) 2007 Apple Inc. All rights reserved.
+ * Copyright (C) 2007 Ryan Leavengood <leavengood@gmail.com>
+ *
+ * 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 "ClipboardHaiku.h"
+
+#include "IntPoint.h"
+#include "FileList.h"
+#include "NotImplemented.h"
+#include "PlatformString.h"
+#include "StringHash.h"
+
+#include <support/Locker.h>
+#include <app/Clipboard.h>
+#include <Message.h>
+#include <String.h>
+#include <wtf/HashTable.h>
+
+
+namespace WebCore {
+
+ClipboardHaiku::ClipboardHaiku(ClipboardAccessPolicy policy, bool forDragging)
+ : Clipboard(policy, forDragging)
+{
+}
+
+void ClipboardHaiku::clearData(const String& type)
+{
+ if (be_clipboard->Lock()) {
+ BMessage* data = be_clipboard->Data();
+
+ if (data) {
+ data->RemoveName(BString(type).String());
+ be_clipboard->Commit();
+ }
+
+ be_clipboard->Unlock();
+ }
+}
+
+void ClipboardHaiku::clearAllData()
+{
+ if (be_clipboard->Lock()) {
+ be_clipboard->Clear();
+ be_clipboard->Commit();
+ be_clipboard->Unlock();
+ }
+}
+
+String ClipboardHaiku::getData(const String& type, bool& success) const
+{
+ BString result;
+ success = false;
+
+ if (be_clipboard->Lock()) {
+ BMessage* data = be_clipboard->Data();
+
+ if (data)
+ if (data->FindString(BString(type).String(), &result) == B_OK)
+ success = true;
+
+ be_clipboard->Unlock();
+ }
+
+ return result;
+}
+
+bool ClipboardHaiku::setData(const String& type, const String& data)
+{
+ bool result = false;
+
+ if (be_clipboard->Lock()) {
+ BMessage* bdata = be_clipboard->Data();
+
+ if (bdata) {
+ bdata->RemoveName(BString(type).String());
+
+ if (bdata->AddString(BString(type).String(), BString(data)) == B_OK)
+ result = true;
+ }
+
+ be_clipboard->Commit();
+ be_clipboard->Unlock();
+ }
+
+ return result;
+}
+
+// Extensions beyond IE's API.
+HashSet<String> ClipboardHaiku::types() const
+{
+ HashSet<String> result;
+
+ if (be_clipboard->Lock()) {
+ BMessage* data = be_clipboard->Data();
+
+ if (data) {
+ char* name;
+ uint32 type;
+ int32 count;
+
+ for (int32 i = 0; data->GetInfo(B_ANY_TYPE, i, &name, &type, &count) == B_OK; i++)
+ result.add(name);
+ }
+
+ be_clipboard->Unlock();
+ }
+
+ return result;
+}
+
+PassRefPtr<FileList> ClipboardHaiku::files() const
+{
+ notImplemented();
+ return 0;
+}
+
+IntPoint ClipboardHaiku::dragLocation() const
+{
+ notImplemented();
+ return IntPoint(0, 0);
+}
+
+CachedImage* ClipboardHaiku::dragImage() const
+{
+ notImplemented();
+ return 0;
+}
+
+void ClipboardHaiku::setDragImage(CachedImage*, const IntPoint&)
+{
+ notImplemented();
+}
+
+Node* ClipboardHaiku::dragImageElement()
+{
+ notImplemented();
+ return 0;
+}
+
+void ClipboardHaiku::setDragImageElement(Node*, const IntPoint&)
+{
+ notImplemented();
+}
+
+DragImageRef ClipboardHaiku::createDragImage(IntPoint& dragLocation) const
+{
+ notImplemented();
+ return 0;
+}
+
+void ClipboardHaiku::declareAndWriteDragImage(Element*, const KURL&, const String&, Frame*)
+{
+ notImplemented();
+}
+
+void ClipboardHaiku::writeURL(const KURL&, const String&, Frame*)
+{
+ notImplemented();
+}
+
+void ClipboardHaiku::writeRange(Range*, Frame*)
+{
+ notImplemented();
+}
+
+bool ClipboardHaiku::hasData()
+{
+ bool result = false;
+
+ if (be_clipboard->Lock()) {
+ BMessage* data = be_clipboard->Data();
+
+ if (data)
+ result = !data->IsEmpty();
+
+ be_clipboard->Unlock();
+ }
+
+ return result;
+}
+
+} // namespace WebCore
+
diff --git a/WebCore/platform/haiku/ClipboardHaiku.h b/WebCore/platform/haiku/ClipboardHaiku.h
new file mode 100644
index 0000000..23e3d7b
--- /dev/null
+++ b/WebCore/platform/haiku/ClipboardHaiku.h
@@ -0,0 +1,73 @@
+/*
+ * Copyright (C) 2007 Apple Inc. All rights reserved.
+ * Copyright (C) 2007 Ryan Leavengood <leavengood@gmail.com>
+ *
+ * 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 ClipboardHaiku_h
+#define ClipboardHaiku_h
+
+#include "Clipboard.h"
+#include "ClipboardAccessPolicy.h"
+
+namespace WebCore {
+ class CachedImage;
+
+ // State available during IE's events for drag and drop and copy/paste.
+ class ClipboardHaiku : public Clipboard {
+ public:
+ static PassRefPtr<ClipboardHaiku> create(ClipboardAccessPolicy policy, bool forDragging)
+ {
+ return adoptRef(new ClipboardHaiku(policy, forDragging));
+ }
+ ~ClipboardHaiku() { }
+
+ void clearData(const String& type);
+ void clearAllData();
+ String getData(const String& type, bool& success) const;
+ bool setData(const String& type, const String& data);
+
+ // Extensions beyond IE's API.
+ HashSet<String> types() const;
+ virtual PassRefPtr<FileList> files() const;
+
+ IntPoint dragLocation() const;
+ CachedImage* dragImage() const;
+ void setDragImage(CachedImage*, const IntPoint&);
+ Node* dragImageElement();
+ void setDragImageElement(Node*, const IntPoint&);
+
+ virtual DragImageRef createDragImage(IntPoint& dragLoc) const;
+ virtual void declareAndWriteDragImage(Element*, const KURL&, const String& title, Frame*);
+ virtual void writeURL(const KURL&, const String&, Frame*);
+ virtual void writeRange(Range*, Frame*);
+
+ virtual bool hasData();
+
+ private:
+ ClipboardHaiku(ClipboardAccessPolicy, bool forDragging);
+ };
+} // namespace WebCore
+
+#endif // ClipboardHaiku_h
+
diff --git a/WebCore/platform/haiku/ContextMenuHaiku.cpp b/WebCore/platform/haiku/ContextMenuHaiku.cpp
new file mode 100644
index 0000000..03b8978
--- /dev/null
+++ b/WebCore/platform/haiku/ContextMenuHaiku.cpp
@@ -0,0 +1,143 @@
+/*
+ * Copyright (C) 2006 Zack Rusin <zack@kde.org>
+ * Copyright (C) 2007 Ryan Leavengood <leavengood@gmail.com>
+ *
+ * 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 "ContextMenuItem.h"
+#include "ContextMenuController.h"
+#include "Frame.h"
+#include "FrameView.h"
+#include "Document.h"
+
+#include <wtf/Assertions.h>
+
+#include <Looper.h>
+#include <Menu.h>
+#include <Message.h>
+
+
+namespace WebCore {
+
+// FIXME: This class isn't used yet
+class ContextMenuReceiver : public BLooper
+{
+public:
+ ContextMenuReceiver(ContextMenu* menu)
+ : BLooper("context_menu_receiver")
+ , m_menu(menu)
+ {
+ m_result = -1;
+ }
+
+ void HandleMessage(BMessage* msg)
+ {
+ m_result = msg->what;
+ if (m_result != -1) {
+ BMenuItem* item = m_menu->platformDescription()->FindItem(m_result);
+ if (!item) {
+ printf("Error: Context menu item with code %i not found!\n", m_result);
+ return;
+ }
+ ContextMenuItem cmItem(item);
+ m_menu->controller()->contextMenuItemSelected(&cmItem);
+ cmItem.releasePlatformDescription();
+ }
+ }
+
+ int Result()
+ {
+ return m_result;
+ }
+
+private:
+ ContextMenu* m_menu;
+ int m_result;
+};
+
+ContextMenu::ContextMenu(const HitTestResult& result)
+ : m_hitTestResult(result)
+ , m_platformDescription(NULL)
+{
+ /* Get position */
+ if (result.innerNode() && result.innerNode()->document()) {
+ BView* view = result.innerNode()->document()->frame()->view()->platformWidget();
+ int child = 0;
+ while (view->ChildAt(child)) {
+ if (view->ChildAt(child)->Name() == "scroll_view_canvas") {
+ m_point = view->ChildAt(child)->ConvertToScreen(BPoint(result.point().x(), result.point().y()));
+ break;
+ }
+ child++;
+ }
+ }
+ m_platformDescription = new BMenu("context_menu");
+}
+
+ContextMenu::~ContextMenu()
+{
+ delete m_platformDescription;
+}
+
+void ContextMenu::appendItem(ContextMenuItem& item)
+{
+ checkOrEnableIfNeeded(item);
+
+ BMenuItem* bItem = item.releasePlatformDescription();
+ if (bItem)
+ m_platformDescription->AddItem(bItem);
+}
+
+unsigned ContextMenu::itemCount() const
+{
+ return m_platformDescription->CountItems();
+}
+
+void ContextMenu::insertItem(unsigned position, ContextMenuItem& item)
+{
+ checkOrEnableIfNeeded(item);
+
+ BMenuItem* bItem = item.releasePlatformDescription();
+ if (bItem)
+ m_platformDescription->AddItem(bItem, position);
+}
+
+PlatformMenuDescription ContextMenu::platformDescription() const
+{
+ return m_platformDescription;
+}
+
+void ContextMenu::setPlatformDescription(PlatformMenuDescription menu)
+{
+ if (static_cast<BMenu*>(menu) == m_platformDescription)
+ return;
+
+ delete m_platformDescription;
+ m_platformDescription = static_cast<BMenu*>(menu);
+}
+
+} // namespace WebCore
+
diff --git a/WebCore/platform/haiku/ContextMenuItemHaiku.cpp b/WebCore/platform/haiku/ContextMenuItemHaiku.cpp
new file mode 100644
index 0000000..cd5abaf
--- /dev/null
+++ b/WebCore/platform/haiku/ContextMenuItemHaiku.cpp
@@ -0,0 +1,164 @@
+/*
+ * Copyright (C) 2006 Zack Rusin <zack@kde.org>
+ * Copyright (C) 2007 Ryan Leavengood <leavengood@gmail.com>
+ *
+ * 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 <Menu.h>
+#include <MenuItem.h>
+#include <Message.h>
+#include <String.h>
+
+
+using namespace WebCore;
+
+ContextMenuItem::ContextMenuItem(PlatformMenuItemDescription item)
+{
+ m_platformDescription = item;
+}
+
+ContextMenuItem::ContextMenuItem(ContextMenu* subMenu)
+{
+ m_platformDescription = new BMenuItem(subMenu->platformDescription(),
+ new BMessage(ContextMenuItemTagNoAction));
+}
+
+ContextMenuItem::ContextMenuItem(ContextMenuItemType type, ContextMenuAction action,
+ const String& title, ContextMenu* subMenu)
+{
+ if (type == ActionType)
+ m_platformDescription = new BMenuItem(BString(title).String(), new BMessage(action));
+ else if (type == SeparatorType)
+ m_platformDescription = new BSeparatorItem();
+ else {
+ m_platformDescription = new BMenuItem(subMenu->platformDescription(), new BMessage(action));
+ m_platformDescription->SetLabel(BString(title).String());
+ }
+}
+
+ContextMenuItem::~ContextMenuItem()
+{
+ delete m_platformDescription;
+}
+
+PlatformMenuItemDescription ContextMenuItem::releasePlatformDescription()
+{
+ BMenuItem* item = m_platformDescription;
+ m_platformDescription = NULL;
+ return item;
+}
+
+ContextMenuItemType ContextMenuItem::type() const
+{
+ if (dynamic_cast<BSeparatorItem*>(m_platformDescription))
+ return SeparatorType;
+ if (m_platformDescription->Submenu())
+ return SubmenuType;
+ return ActionType;
+}
+
+void ContextMenuItem::setType(ContextMenuItemType type)
+{
+ ContextMenuAction theAction = action();
+ String theTitle = title();
+ BMenu* subMenu = platformSubMenu();
+ delete m_platformDescription;
+
+ if (type == ActionType)
+ m_platformDescription = new BMenuItem(BString(theTitle).String(), new BMessage(theAction));
+ else if (type == SeparatorType)
+ m_platformDescription = new BSeparatorItem();
+ else {
+ if (subMenu) {
+ m_platformDescription = new BMenuItem(subMenu, new BMessage(theAction));
+ m_platformDescription->SetLabel(BString(theTitle).String());
+ } else
+ m_platformDescription = new BMenuItem(BString(theTitle).String(), new BMessage(theAction));
+ }
+}
+
+ContextMenuAction ContextMenuItem::action() const
+{
+ if (!m_platformDescription)
+ return ContextMenuItemTagNoAction;
+ return static_cast<WebCore::ContextMenuAction>(m_platformDescription->Message()->what);
+}
+
+void ContextMenuItem::setAction(ContextMenuAction action)
+{
+ if (m_platformDescription)
+ m_platformDescription->Message()->what = action;
+}
+
+String ContextMenuItem::title() const
+{
+ if (m_platformDescription)
+ return "";
+ return BString(m_platformDescription->Label());
+}
+
+void ContextMenuItem::setTitle(const String& title)
+{
+ // FIXME: We need to find a better way to convert WebKit Strings into c strings
+ m_platformDescription->SetLabel(BString(title).String());
+}
+
+PlatformMenuDescription ContextMenuItem::platformSubMenu() const
+{
+ return m_platformDescription->Submenu();
+}
+
+void ContextMenuItem::setSubMenu(ContextMenu* menu)
+{
+ // FIXME: We assume m_platformDescription is valid
+ const char* title = m_platformDescription->Label();
+ delete m_platformDescription;
+ m_platformDescription = new BMenuItem(menu->platformDescription(), new BMessage(action()));
+ m_platformDescription->SetLabel(title);
+}
+
+void ContextMenuItem::setChecked(bool checked)
+{
+ if (m_platformDescription)
+ m_platformDescription->SetMarked(checked);
+}
+
+void ContextMenuItem::setEnabled(bool enable)
+{
+ if (m_platformDescription)
+ m_platformDescription->SetEnabled(enable);
+}
+
+bool ContextMenuItem::enabled() const
+{
+ if (!m_platformDescription)
+ return true;
+ return m_platformDescription->IsEnabled();
+}
+
diff --git a/WebCore/platform/haiku/CookieJarHaiku.cpp b/WebCore/platform/haiku/CookieJarHaiku.cpp
new file mode 100644
index 0000000..73519d7
--- /dev/null
+++ b/WebCore/platform/haiku/CookieJarHaiku.cpp
@@ -0,0 +1,61 @@
+/*
+ * Copyright (C) 2006 George Staikos <staikos@kde.org>
+ * Copyright (C) 2007 Ryan Leavengood <leavengood@gmail.com>
+ *
+ * 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 "CookieJar.h"
+
+#include "KURL.h"
+#include "PlatformString.h"
+#include "StringHash.h"
+
+#include <wtf/HashMap.h>
+
+
+namespace WebCore {
+
+// FIXME: Shouldn't this be saved to and restored from disk too?
+static HashMap<String, String> cookieJar;
+
+void setCookies(const KURL& url, const KURL& /*policyURL*/, const String& value)
+{
+ cookieJar.set(url.string(), value);
+}
+
+String cookies(const KURL& url)
+{
+ return cookieJar.get(url.string());
+}
+
+bool cookiesEnabled()
+{
+ // FIXME: This should probably be a setting
+ return true;
+}
+
+} // namespace WebCore
+
diff --git a/WebCore/platform/haiku/CursorHaiku.cpp b/WebCore/platform/haiku/CursorHaiku.cpp
new file mode 100644
index 0000000..7f010d5
--- /dev/null
+++ b/WebCore/platform/haiku/CursorHaiku.cpp
@@ -0,0 +1,237 @@
+/*
+ * Copyright (C) 2007 Ryan Leavengood <leavengood@gmail.com>
+ *
+ * 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 "Cursor.h"
+
+#include "NotImplemented.h"
+
+#include <app/AppDefs.h>
+
+
+namespace WebCore {
+
+Cursor::Cursor(PlatformCursor cursor)
+ : m_impl(cursor)
+{
+}
+
+Cursor::Cursor(const Cursor& other)
+ : m_impl(other.m_impl)
+{
+}
+
+Cursor::~Cursor()
+{
+}
+
+Cursor::Cursor(Image*, const IntPoint&)
+{
+ notImplemented();
+}
+
+Cursor& Cursor::operator=(const Cursor& other)
+{
+ m_impl = other.m_impl;
+ return *this;
+}
+
+static Cursor globalCursor = const_cast<BCursor*>(B_CURSOR_SYSTEM_DEFAULT);
+static Cursor ibeamCursor = const_cast<BCursor*>(B_CURSOR_I_BEAM);
+
+const Cursor& pointerCursor()
+{
+ return globalCursor;
+}
+
+const Cursor& moveCursor()
+{
+ return globalCursor;
+}
+
+const Cursor& crossCursor()
+{
+ return globalCursor;
+}
+
+const Cursor& handCursor()
+{
+ return globalCursor;
+}
+
+const Cursor& iBeamCursor()
+{
+ return ibeamCursor;
+}
+
+const Cursor& waitCursor()
+{
+ return globalCursor;
+}
+
+const Cursor& helpCursor()
+{
+ return globalCursor;
+}
+
+const Cursor& eastResizeCursor()
+{
+ return globalCursor;
+}
+
+const Cursor& northResizeCursor()
+{
+ return globalCursor;
+}
+
+const Cursor& northEastResizeCursor()
+{
+ return globalCursor;
+}
+
+const Cursor& northWestResizeCursor()
+{
+ return globalCursor;
+}
+
+const Cursor& southResizeCursor()
+{
+ return globalCursor;
+}
+
+const Cursor& southEastResizeCursor()
+{
+ return globalCursor;
+}
+
+const Cursor& southWestResizeCursor()
+{
+ return globalCursor;
+}
+
+const Cursor& westResizeCursor()
+{
+ return globalCursor;
+}
+
+const Cursor& northSouthResizeCursor()
+{
+ return globalCursor;
+}
+
+const Cursor& eastWestResizeCursor()
+{
+ return globalCursor;
+}
+
+const Cursor& northEastSouthWestResizeCursor()
+{
+ return globalCursor;
+}
+
+const Cursor& northWestSouthEastResizeCursor()
+{
+ return globalCursor;
+}
+
+const Cursor& columnResizeCursor()
+{
+ return globalCursor;
+}
+
+const Cursor& rowResizeCursor()
+{
+ return globalCursor;
+}
+
+const Cursor& verticalTextCursor()
+{
+ return globalCursor;
+}
+
+const Cursor& cellCursor()
+{
+ return globalCursor;
+}
+
+const Cursor& contextMenuCursor()
+{
+ return globalCursor;
+}
+
+const Cursor& noDropCursor()
+{
+ return globalCursor;
+}
+
+const Cursor& copyCursor()
+{
+ return globalCursor;
+}
+
+const Cursor& progressCursor()
+{
+ return globalCursor;
+}
+
+const Cursor& aliasCursor()
+{
+ return globalCursor;
+}
+
+const Cursor& noneCursor()
+{
+ return globalCursor;
+}
+
+const Cursor& notAllowedCursor()
+{
+ return globalCursor;
+}
+
+const Cursor& zoomInCursor()
+{
+ return globalCursor;
+}
+
+const Cursor& zoomOutCursor()
+{
+ return globalCursor;
+}
+
+const Cursor& grabCursor()
+{
+ return globalCursor;
+}
+
+const Cursor& grabbingCursor()
+{
+ return globalCursor;
+}
+
+} // namespace WebCore
+
diff --git a/WebCore/platform/haiku/DragDataHaiku.cpp b/WebCore/platform/haiku/DragDataHaiku.cpp
new file mode 100644
index 0000000..b42b311
--- /dev/null
+++ b/WebCore/platform/haiku/DragDataHaiku.cpp
@@ -0,0 +1,109 @@
+/*
+ * Copyright (C) 2007 Apple Inc. All rights reserved.
+ * Copyright (C) 2007 Ryan Leavengood <leavengood@gmail.com>
+ *
+ * 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"
+#include "ClipboardHaiku.h"
+
+#include "NotImplemented.h"
+
+
+namespace WebCore {
+
+bool DragData::canSmartReplace() const
+{
+ notImplemented();
+ return false;
+}
+
+bool DragData::containsColor() const
+{
+ notImplemented();
+ return false;
+}
+
+bool DragData::containsFiles() const
+{
+ notImplemented();
+ return false;
+}
+
+void DragData::asFilenames(Vector<String>& result) const
+{
+ notImplemented();
+}
+
+bool DragData::containsPlainText() const
+{
+ notImplemented();
+ return false;
+}
+
+String DragData::asPlainText() const
+{
+ notImplemented();
+ return String();
+}
+
+Color DragData::asColor() const
+{
+ notImplemented();
+ return Color();
+}
+
+WTF::PassRefPtr<Clipboard> DragData::createClipboard(ClipboardAccessPolicy policy) const
+{
+ return new ClipboardHaiku(policy, true);
+}
+
+bool DragData::containsCompatibleContent() const
+{
+ return containsColor() || containsURL() || containsPlainText();
+}
+
+bool DragData::containsURL() const
+{
+ notImplemented();
+ return false;
+}
+
+String DragData::asURL(String* title) const
+{
+ notImplemented();
+ return String();
+}
+
+PassRefPtr<DocumentFragment> DragData::asFragment(Document*) const
+{
+ notImplemented();
+ return 0;
+}
+
+} // namespace WebCore
+
diff --git a/WebCore/platform/haiku/DragImageHaiku.cpp b/WebCore/platform/haiku/DragImageHaiku.cpp
new file mode 100644
index 0000000..17a79f4
--- /dev/null
+++ b/WebCore/platform/haiku/DragImageHaiku.cpp
@@ -0,0 +1,74 @@
+/*
+ * Copyright (C) 2007 Apple Inc. All rights reserved.
+ * Copyright (C) 2007 Ryan Leavengood <leavengood@gmail.com>
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "DragImage.h"
+
+#include "CachedImage.h"
+#include "Image.h"
+
+#include "NotImplemented.h"
+
+
+namespace WebCore {
+
+IntSize dragImageSize(DragImageRef)
+{
+ notImplemented();
+ return IntSize(0, 0);
+}
+
+void deleteDragImage(DragImageRef)
+{
+ notImplemented();
+}
+
+DragImageRef scaleDragImage(DragImageRef image, FloatSize)
+{
+ notImplemented();
+ return image;
+}
+
+DragImageRef dissolveDragImageToFraction(DragImageRef image, float)
+{
+ notImplemented();
+ return image;
+}
+
+DragImageRef createDragImageFromImage(Image*)
+{
+ notImplemented();
+ return 0;
+}
+
+DragImageRef createDragImageIconForCachedImage(CachedImage*)
+{
+ notImplemented();
+ return 0;
+}
+
+} // namespace WebCore
+
diff --git a/WebCore/platform/haiku/EventLoopHaiku.cpp b/WebCore/platform/haiku/EventLoopHaiku.cpp
new file mode 100644
index 0000000..4750e6f
--- /dev/null
+++ b/WebCore/platform/haiku/EventLoopHaiku.cpp
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2009 Maxime Simon
+ *
+ * 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 "EventLoop.h"
+
+#include <app/Application.h>
+
+
+namespace WebCore {
+
+void EventLoop::cycle()
+{
+ if (!be_app)
+ m_ended = true;
+}
+
+} // namespace WebCore
+
diff --git a/WebCore/platform/haiku/FileChooserHaiku.cpp b/WebCore/platform/haiku/FileChooserHaiku.cpp
new file mode 100644
index 0000000..b0e42b6
--- /dev/null
+++ b/WebCore/platform/haiku/FileChooserHaiku.cpp
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org>
+ * Copyright (C) 2007 Ryan Leavengood <leavengood@gmail.com>
+ *
+ * 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 "FileChooser.h"
+
+#include "NotImplemented.h"
+#include "Icon.h"
+
+
+namespace WebCore {
+
+FileChooser::FileChooser(FileChooserClient* client, const String& filename)
+ : m_client(client)
+ , m_filenames()
+ , m_icon(chooseIcon(filename))
+{
+ m_filenames.append(filename);
+}
+
+String FileChooser::basenameForWidth(const Font&, int width) const
+{
+ notImplemented();
+ return String();
+}
+
+} // namespace WebCore
+
diff --git a/WebCore/platform/haiku/FileSystemHaiku.cpp b/WebCore/platform/haiku/FileSystemHaiku.cpp
new file mode 100644
index 0000000..7400cd1
--- /dev/null
+++ b/WebCore/platform/haiku/FileSystemHaiku.cpp
@@ -0,0 +1,82 @@
+/*
+ * Copyright (C) 2007 Ryan Leavengood <leavengood@gmail.com>
+ *
+ * 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 "FileSystem.h"
+
+#include "CString.h"
+#include "PlatformString.h"
+
+#include "NotImplemented.h"
+
+
+namespace WebCore {
+
+CString fileSystemRepresentation(const String& string)
+{
+ return string.utf8();
+}
+
+String homeDirectoryPath()
+{
+ notImplemented();
+ return String();
+}
+
+CString openTemporaryFile(const char* prefix, PlatformFileHandle& handle)
+{
+ notImplemented();
+ handle = invalidPlatformFileHandle;
+ return CString();
+}
+
+void closeFile(PlatformFileHandle&)
+{
+ notImplemented();
+}
+
+int writeToFile(PlatformFileHandle, const char* data, int length)
+{
+ notImplemented();
+ return 0;
+}
+
+bool unloadModule(PlatformModule)
+{
+ notImplemented();
+ return false;
+}
+
+Vector<String> listDirectory(const String& path, const String& filter)
+{
+ Vector<String> entries;
+ notImplemented();
+ return entries;
+}
+
+} // namespace WebCore
+
diff --git a/WebCore/platform/haiku/KeyboardCodes.h b/WebCore/platform/haiku/KeyboardCodes.h
new file mode 100644
index 0000000..6f0d490
--- /dev/null
+++ b/WebCore/platform/haiku/KeyboardCodes.h
@@ -0,0 +1,544 @@
+/*
+ * Copyright (C) 2006 Michael Emmel mike.emmel@gmail.com
+ * Copyright (C) 2007 Ryan Leavengood <leavengood@gmail.com>
+ *
+ * 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.
+ */
+
+#ifndef KeyboardCodes_h
+#define KeyboardCodes_h
+
+
+namespace WebCore {
+ // VK_LBUTTON (01) Left mouse button
+ // VK_RBUTTON (02) Right mouse button
+ // VK_CANCEL (03) Control-break processing
+ // VK_MBUTTON (04) Middle mouse button (three-button mouse)
+ // VK_XBUTTON1 (05)
+ // VK_XBUTTON2 (06)
+
+ // VK_BACK (08) BACKSPACE key
+ const int VK_BACK = 0x08;
+
+ // VK_TAB (09) TAB key
+ const int VK_TAB = 0x09;
+
+ // VK_CLEAR (0C) CLEAR key
+ const int VK_CLEAR = 0x0C;
+
+ // VK_RETURN (0D)
+ const int VK_RETURN = 0x0D;
+
+ // VK_SHIFT (10) SHIFT key
+ const int VK_SHIFT = 0x10;
+
+ // VK_CONTROL (11) CTRL key
+ const int VK_CONTROL = 0x11;
+
+ // VK_MENU (12) ALT key
+ const int VK_MENU = 0x12;
+
+ // VK_PAUSE (13) PAUSE key
+ const int VK_PAUSE = 0x13;
+
+ // VK_CAPITAL (14) CAPS LOCK key
+ const int VK_CAPITAL = 0x14;
+
+ // VK_KANA (15) Input Method Editor (IME) Kana mode
+ const int VK_KANA = 0x15;
+
+ // VK_HANGUEL (15) IME Hanguel mode (maintained for compatibility; use VK_HANGUL)
+ // VK_HANGUL (15) IME Hangul mode
+ const int VK_HANGUL = 0x15;
+
+ // VK_JUNJA (17) IME Junja mode
+ const int VK_JUNJA = 0x17;
+
+ // VK_FINAL (18) IME final mode
+ const int VK_FINAL = 0x18;
+
+ // VK_HANJA (19) IME Hanja mode
+ const int VK_HANJA = 0x19;
+
+ // VK_KANJI (19) IME Kanji mode
+ const int VK_KANJI = 0x19;
+
+ // VK_ESCAPE (1B) ESC key
+ const int VK_ESCAPE = 0x1B;
+
+ // VK_CONVERT (1C) IME convert
+ const int VK_CONVERT = 0x1C;
+
+ // VK_NONCONVERT (1D) IME nonconvert
+ const int VK_NONCONVERT = 0x1D;
+
+ // VK_ACCEPT (1E) IME accept
+ const int VK_ACCEPT = 0x1E;
+
+ // VK_MODECHANGE (1F) IME mode change request
+ const int VK_MODECHANGE = 0x1F;
+
+ // VK_SPACE (20) SPACEBAR
+ const int VK_SPACE = 0x20;
+
+ // VK_PRIOR (21) PAGE UP key
+ const int VK_PRIOR = 0x21;
+
+ // VK_NEXT (22) PAGE DOWN key
+ const int VK_NEXT = 0x22;
+
+ // VK_END (23) END key
+ const int VK_END = 0x23;
+
+ // VK_HOME (24) HOME key
+ const int VK_HOME = 0x24;
+
+ // VK_LEFT (25) LEFT ARROW key
+ const int VK_LEFT = 0x25;
+
+ // VK_UP (26) UP ARROW key
+ const int VK_UP = 0x26;
+
+ // VK_RIGHT (27) RIGHT ARROW key
+ const int VK_RIGHT = 0x27;
+
+ // VK_DOWN (28) DOWN ARROW key
+ const int VK_DOWN = 0x28;
+
+ // VK_SELECT (29) SELECT key
+ const int VK_SELECT = 0x29;
+
+ // VK_PRINT (2A) PRINT key
+ const int VK_PRINT = 0x2A;
+
+ // VK_EXECUTE (2B) EXECUTE key
+ const int VK_EXECUTE = 0x2B;
+
+ // VK_SNAPSHOT (2C) PRINT SCREEN key
+ const int VK_SNAPSHOT = 0x2C;
+
+ // VK_INSERT (2D) INS key
+ const int VK_INSERT = 0x2D;
+
+ // VK_DELETE (2E) DEL key
+ const int VK_DELETE = 0x2E;
+
+ // VK_HELP (2F) HELP key
+ const int VK_HELP = 0x2F;
+
+ // (30) 0 key
+ const int VK_0 = 0x30;
+
+ // (31) 1 key
+ const int VK_1 = 0x31;
+
+ // (32) 2 key
+ const int VK_2 = 0x32;
+
+ // (33) 3 key
+ const int VK_3 = 0x33;
+
+ // (34) 4 key
+ const int VK_4 = 0x34;
+
+ // (35) 5 key;
+
+ const int VK_5 = 0x35;
+
+ // (36) 6 key
+ const int VK_6 = 0x36;
+
+ // (37) 7 key
+ const int VK_7 = 0x37;
+
+ // (38) 8 key
+ const int VK_8 = 0x38;
+
+ // (39) 9 key
+ const int VK_9 = 0x39;
+
+ // (41) A key
+ const int VK_A = 0x41;
+
+ // (42) B key
+ const int VK_B = 0x42;
+
+ // (43) C key
+ const int VK_C = 0x43;
+
+ // (44) D key
+ const int VK_D = 0x44;
+
+ // (45) E key
+ const int VK_E = 0x45;
+
+ // (46) F key
+ const int VK_F = 0x46;
+
+ // (47) G key
+ const int VK_G = 0x47;
+
+ // (48) H key
+ const int VK_H = 0x48;
+
+ // (49) I key
+ const int VK_I = 0x49;
+
+ // (4A) J key
+ const int VK_J = 0x4A;
+
+ // (4B) K key
+ const int VK_K = 0x4B;
+
+ // (4C) L key
+ const int VK_L = 0x4C;
+
+ // (4D) M key
+ const int VK_M = 0x4D;
+
+ // (4E) N key
+ const int VK_N = 0x4E;
+
+ // (4F) O key
+ const int VK_O = 0x4F;
+
+ // (50) P key
+ const int VK_P = 0x50;
+
+ // (51) Q key
+ const int VK_Q = 0x51;
+
+ // (52) R key
+ const int VK_R = 0x52;
+
+ // (53) S key
+ const int VK_S = 0x53;
+
+ // (54) T key
+ const int VK_T = 0x54;
+
+ // (55) U key
+ const int VK_U = 0x55;
+
+ // (56) V key
+ const int VK_V = 0x56;
+
+ // (57) W key
+ const int VK_W = 0x57;
+
+ // (58) X key
+ const int VK_X = 0x58;
+
+ // (59) Y key
+ const int VK_Y = 0x59;
+
+ // (5A) Z key
+ const int VK_Z = 0x5A;
+
+ // VK_LWIN (5B) Left Windows key (Microsoft Natural keyboard)
+ const int VK_LWIN = 0x5B;
+
+ // VK_RWIN (5C) Right Windows key (Natural keyboard)
+ const int VK_RWIN = 0x5C;
+
+ // VK_APPS (5D) Applications key (Natural keyboard)
+ const int VK_APPS = 0x5D;
+
+ // VK_SLEEP (5F) Computer Sleep key
+ const int VK_SLEEP = 0x5F;
+
+ // VK_NUMPAD0 (60) Numeric keypad 0 key
+ const int VK_NUMPAD0 = 0x60;
+
+ // VK_NUMPAD1 (61) Numeric keypad 1 key
+ const int VK_NUMPAD1 = 0x61;
+
+ // VK_NUMPAD2 (62) Numeric keypad 2 key
+ const int VK_NUMPAD2 = 0x62;
+
+ // VK_NUMPAD3 (63) Numeric keypad 3 key
+ const int VK_NUMPAD3 = 0x63;
+
+ // VK_NUMPAD4 (64) Numeric keypad 4 key
+ const int VK_NUMPAD4 = 0x64;
+
+ // VK_NUMPAD5 (65) Numeric keypad 5 key
+ const int VK_NUMPAD5 = 0x65;
+
+ // VK_NUMPAD6 (66) Numeric keypad 6 key
+ const int VK_NUMPAD6 = 0x66;
+
+ // VK_NUMPAD7 (67) Numeric keypad 7 key
+ const int VK_NUMPAD7 = 0x67;
+
+ // VK_NUMPAD8 (68) Numeric keypad 8 key
+ const int VK_NUMPAD8 = 0x68;
+
+ // VK_NUMPAD9 (69) Numeric keypad 9 key
+ const int VK_NUMPAD9 = 0x69;
+
+ // VK_MULTIPLY (6A) Multiply key
+ const int VK_MULTIPLY = 0x6A;
+
+ // VK_ADD (6B) Add key
+ const int VK_ADD = 0x6B;
+
+ // VK_SEPARATOR (6C) Separator key
+ const int VK_SEPARATOR = 0x6C;
+
+ // VK_SUBTRACT (6D) Subtract key
+ const int VK_SUBTRACT = 0x6D;
+
+ // VK_DECIMAL (6E) Decimal key
+ const int VK_DECIMAL = 0x6E;
+
+ // VK_DIVIDE (6F) Divide key
+ const int VK_DIVIDE = 0x6F;
+
+ // VK_F1 (70) F1 key
+ const int VK_F1 = 0x70;
+
+ // VK_F2 (71) F2 key
+ const int VK_F2 = 0x71;
+
+ // VK_F3 (72) F3 key
+ const int VK_F3 = 0x72;
+
+ // VK_F4 (73) F4 key
+ const int VK_F4 = 0x73;
+
+ // VK_F5 (74) F5 key
+ const int VK_F5 = 0x74;
+
+ // VK_F6 (75) F6 key
+ const int VK_F6 = 0x75;
+
+ // VK_F7 (76) F7 key
+ const int VK_F7 = 0x76;
+
+ // VK_F8 (77) F8 key
+ const int VK_F8 = 0x77;
+
+ // VK_F9 (78) F9 key
+ const int VK_F9 = 0x78;
+
+ // VK_F10 (79) F10 key
+ const int VK_F10 = 0x79;
+
+ // VK_F11 (7A) F11 key
+ const int VK_F11 = 0x7A;
+
+ // VK_F12 (7B) F12 key
+ const int VK_F12 = 0x7B;
+
+ // VK_F13 (7C) F13 key
+ const int VK_F13 = 0x7C;
+
+ // VK_F14 (7D) F14 key
+ const int VK_F14 = 0x7D;
+
+ // VK_F15 (7E) F15 key
+ const int VK_F15 = 0x7E;
+
+ // VK_F16 (7F) F16 key
+ const int VK_F16 = 0x7F;
+
+ // VK_F17 (80H) F17 key
+ const int VK_F17 = 0x80;
+
+ // VK_F18 (81H) F18 key
+ const int VK_F18 = 0x81;
+
+ // VK_F19 (82H) F19 key
+ const int VK_F19 = 0x82;
+
+ // VK_F20 (83H) F20 key
+ const int VK_F20 = 0x83;
+
+ // VK_F21 (84H) F21 key
+ const int VK_F21 = 0x84;
+
+ // VK_F22 (85H) F22 key
+ const int VK_F22 = 0x85;
+
+ // VK_F23 (86H) F23 key
+ const int VK_F23 = 0x86;
+
+ // VK_F24 (87H) F24 key
+ const int VK_F24 = 0x87;
+
+ // VK_NUMLOCK (90) NUM LOCK key
+ const int VK_NUMLOCK = 0x90;
+
+ // VK_SCROLL (91) SCROLL LOCK key
+ const int VK_SCROLL = 0x91;
+
+ // VK_LSHIFT (A0) Left SHIFT key
+ const int VK_LSHIFT = 0xA0;
+
+ // VK_RSHIFT (A1) Right SHIFT key
+ const int VK_RSHIFT = 0xA1;
+
+ // VK_LCONTROL (A2) Left CONTROL key
+ const int VK_LCONTROL = 0xA2;
+
+ // VK_RCONTROL (A3) Right CONTROL key
+ const int VK_RCONTROL = 0xA3;
+
+ // VK_LMENU (A4) Left MENU key
+ const int VK_LMENU = 0xA4;
+
+ // VK_RMENU (A5) Right MENU key
+ const int VK_RMENU = 0xA5;
+
+ // VK_BROWSER_BACK (A6) Windows 2000/XP: Browser Back key
+ const int VK_BROWSER_BACK = 0xA6;
+
+ // VK_BROWSER_FORWARD (A7) Windows 2000/XP: Browser Forward key
+ const int VK_BROWSER_FORWARD = 0xA7;
+
+ // VK_BROWSER_REFRESH (A8) Windows 2000/XP: Browser Refresh key
+ const int VK_BROWSER_REFRESH = 0xA8;
+
+ // VK_BROWSER_STOP (A9) Windows 2000/XP: Browser Stop key
+ const int VK_BROWSER_STOP = 0xA9;
+
+ // VK_BROWSER_SEARCH (AA) Windows 2000/XP: Browser Search key
+ const int VK_BROWSER_SEARCH = 0xAA;
+
+ // VK_BROWSER_FAVORITES (AB) Windows 2000/XP: Browser Favorites key
+ const int VK_BROWSER_FAVORITES = 0xAB;
+
+ // VK_BROWSER_HOME (AC) Windows 2000/XP: Browser Start and Home key
+ const int VK_BROWSER_HOME = 0xAC;
+
+ // VK_VOLUME_MUTE (AD) Windows 2000/XP: Volume Mute key
+ const int VK_VOLUME_MUTE = 0xAD;
+
+ // VK_VOLUME_DOWN (AE) Windows 2000/XP: Volume Down key
+ const int VK_VOLUME_DOWN = 0xAE;
+
+ // VK_VOLUME_UP (AF) Windows 2000/XP: Volume Up key
+ const int VK_VOLUME_UP = 0xAF;
+
+ // VK_MEDIA_NEXT_TRACK (B0) Windows 2000/XP: Next Track key
+ const int VK_MEDIA_NEXT_TRACK = 0xB0;
+
+ // VK_MEDIA_PREV_TRACK (B1) Windows 2000/XP: Previous Track key
+ const int VK_MEDIA_PREV_TRACK = 0xB1;
+
+ // VK_MEDIA_STOP (B2) Windows 2000/XP: Stop Media key
+ const int VK_MEDIA_STOP = 0xB2;
+
+ // VK_MEDIA_PLAY_PAUSE (B3) Windows 2000/XP: Play/Pause Media key
+ const int VK_MEDIA_PLAY_PAUSE = 0xB3;
+
+ // VK_LAUNCH_MAIL (B4) Windows 2000/XP: Start Mail key
+ const int VK_MEDIA_LAUNCH_MAIL = 0xB4;
+
+ // VK_LAUNCH_MEDIA_SELECT (B5) Windows 2000/XP: Select Media key
+ const int VK_MEDIA_LAUNCH_MEDIA_SELECT = 0xB5;
+
+ // VK_LAUNCH_APP1 (B6) Windows 2000/XP: Start Application 1 key
+ const int VK_MEDIA_LAUNCH_APP1 = 0xB6;
+
+ // VK_LAUNCH_APP2 (B7) Windows 2000/XP: Start Application 2 key
+ const int VK_MEDIA_LAUNCH_APP2 = 0xB7;
+
+ // VK_OEM_1 (BA) Used for miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the ';:' key
+ const int VK_OEM_1 = 0xBA;
+
+ // VK_OEM_PLUS (BB) Windows 2000/XP: For any country/region, the '+' key
+ const int VK_OEM_PLUS = 0xBB;
+
+ // VK_OEM_COMMA (BC) Windows 2000/XP: For any country/region, the ',' key
+ const int VK_OEM_COMMA = 0xBC;
+
+ // VK_OEM_MINUS (BD) Windows 2000/XP: For any country/region, the '-' key
+ const int VK_OEM_MINUS = 0xBD;
+
+ // VK_OEM_PERIOD (BE) Windows 2000/XP: For any country/region, the '.' key
+ const int VK_OEM_PERIOD = 0xBE;
+
+ // VK_OEM_2 (BF) Used for miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the '/?' key
+ const int VK_OEM_2 = 0xBF;
+
+ // VK_OEM_3 (C0) Used for miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the '`~' key
+ const int VK_OEM_3 = 0xC0;
+
+ // VK_OEM_4 (DB) Used for miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the '[{' key
+ const int VK_OEM_4 = 0xDB;
+
+ // VK_OEM_5 (DC) Used for miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the '\|' key
+ const int VK_OEM_5 = 0xDC;
+
+ // VK_OEM_6 (DD) Used for miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the ']}' key
+ const int VK_OEM_6 = 0xDD;
+
+ // VK_OEM_7 (DE) Used for miscellaneous characters; it can vary by keyboard. Windows 2000/XP: For the US standard keyboard, the 'single-quote/double-quote' key
+ const int VK_OEM_7 = 0xDE;
+
+ // VK_OEM_8 (DF) Used for miscellaneous characters; it can vary by keyboard.
+ const int VK_OEM_8 = 0xDF;
+
+ // VK_OEM_102 (E2) Windows 2000/XP: Either the angle bracket key or the backslash key on the RT 102-key keyboard
+ const int VK_OEM_102 = 0xE2;
+
+ // VK_PROCESSKEY (E5) Windows 95/98/Me, Windows NT 4.0, Windows 2000/XP: IME PROCESS key
+ const int VK_PROCESSKEY = 0xE5;
+
+ // VK_PACKET (E7) Windows 2000/XP: Used to pass Unicode characters as if they were keystrokes. The VK_PACKET key is the low word of a 32-bit Virtual Key value used for non-keyboard input methods. For more information, see Remark in KEYBDINPUT,SendInput, WM_KEYDOWN, and WM_KEYUP
+ const int VK_PACKET = 0xE7;
+
+ // VK_ATTN (F6) Attn key
+ const int VK_ATTN = 0xF6;
+
+ // VK_CRSEL (F7) CrSel key
+ const int VK_CRSEL = 0xF7;
+
+ // VK_EXSEL (F8) ExSel key
+ const int VK_EXSEL = 0xF8;
+
+ // VK_EREOF (F9) Erase EOF key
+ const int VK_EREOF = 0xF9;
+
+ // VK_PLAY (FA) Play key
+ const int VK_PLAY = 0xFA;
+
+ // VK_ZOOM (FB) Zoom key
+ const int VK_ZOOM = 0xFB;
+
+ // VK_NONAME (FC) Reserved for future use
+ const int VK_NONAME = 0xFC;
+
+ // VK_PA1 (FD) PA1 key
+ const int VK_PA1 = 0xFD;
+
+ // VK_OEM_CLEAR (FE) Clear key
+ const int VK_OEM_CLEAR = 0xFE;
+
+ const int VK_UNKNOWN = 0;
+} // namespace WebCore
+
+#endif // KeyboardCodes_h
diff --git a/WebCore/platform/haiku/MIMETypeRegistryHaiku.cpp b/WebCore/platform/haiku/MIMETypeRegistryHaiku.cpp
new file mode 100644
index 0000000..59ae19a
--- /dev/null
+++ b/WebCore/platform/haiku/MIMETypeRegistryHaiku.cpp
@@ -0,0 +1,75 @@
+/*
+ * Copyright (C) 2006 Zack Rusin <zack@kde.org>
+ * Copyright (C) 2006 Apple Computer, Inc. All rights reserved.
+ * Copyright (C) 2007 Trolltech ASA
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "MIMETypeRegistry.h"
+
+#include "PlatformString.h"
+
+
+namespace WebCore {
+struct ExtensionMap {
+ const char* extension;
+ const char* mimeType;
+};
+
+static const ExtensionMap extensionMap [] = {
+ { "bmp", "image/bmp" },
+ { "gif", "image/gif" },
+ { "html", "text/html" },
+ { "ico", "image/x-icon" },
+ { "jpeg", "image/jpeg" },
+ { "jpg", "image/jpeg" },
+ { "js", "application/x-javascript" },
+ { "pdf", "application/pdf" },
+ { "png", "image/png" },
+ { "rss", "application/rss+xml" },
+ { "svg", "image/svg+xml" },
+ { "text", "text/plain" },
+ { "txt", "text/plain" },
+ { "xbm", "image/x-xbitmap" },
+ { "xml", "text/xml" },
+ { "xsl", "text/xsl" },
+ { "xhtml", "application/xhtml+xml" },
+ { 0, 0 }
+};
+
+// FIXME: Use the Haiku MIME registry
+String MIMETypeRegistry::getMIMETypeForExtension(const String &ext)
+{
+ String str = ext.lower();
+ const ExtensionMap *extMap = extensionMap;
+ while (extMap->extension) {
+ if (str == extMap->extension)
+ return extMap->mimeType;
+ ++extMap;
+ }
+ // unknown, let's just assume plain text
+ return "text/plain";
+}
+} // namespace WebCore
+
diff --git a/WebCore/platform/haiku/PasteboardHaiku.cpp b/WebCore/platform/haiku/PasteboardHaiku.cpp
new file mode 100644
index 0000000..67a7f5b
--- /dev/null
+++ b/WebCore/platform/haiku/PasteboardHaiku.cpp
@@ -0,0 +1,138 @@
+/*
+ * Copyright (C) 2006 Zack Rusin <zack@kde.org>
+ * Copyright (C) 2007 Ryan Leavengood <leavengood@gmail.com>
+ *
+ * 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 "Editor.h"
+#include "Frame.h"
+#include "KURL.h"
+#include "NotImplemented.h"
+#include "markup.h"
+#include <support/Locker.h>
+#include <Clipboard.h>
+#include <Message.h>
+#include <String.h>
+
+
+namespace WebCore {
+
+Pasteboard::Pasteboard()
+{
+}
+
+Pasteboard* Pasteboard::generalPasteboard()
+{
+ static Pasteboard* pasteboard = new Pasteboard();
+ return pasteboard;
+}
+
+void Pasteboard::writeSelection(Range* selectedRange, bool canSmartCopyOrDelete, Frame* frame)
+{
+ BClipboard clipboard("WebKit");
+ if (!clipboard.Lock())
+ return;
+
+ clipboard.Clear();
+ BMessage* data = clipboard.Data();
+ if (!data)
+ return;
+
+ data->AddString("text/plain", BString(frame->selectedText()));
+ clipboard.Commit();
+
+ clipboard.Unlock();
+}
+
+bool Pasteboard::canSmartReplace()
+{
+ notImplemented();
+ return false;
+}
+
+String Pasteboard::plainText(Frame* frame)
+{
+ BClipboard clipboard("WebKit");
+ if (!clipboard.Lock())
+ return String();
+
+ BMessage* data = clipboard.Data();
+ if (!data)
+ return String();
+
+ BString string;
+ data->FindString("text/plain", &string);
+
+ clipboard.Unlock();
+
+ return string;
+}
+
+PassRefPtr<DocumentFragment> Pasteboard::documentFragment(Frame* frame, PassRefPtr<Range> context,
+ bool allowPlainText, bool& chosePlainText)
+{
+ notImplemented();
+ return 0;
+}
+
+void Pasteboard::writeURL(const KURL& url, const String&, Frame*)
+{
+ BClipboard clipboard("WebKit");
+ if (!clipboard.Lock())
+ return;
+
+ clipboard.Clear();
+
+ BMessage* data = clipboard.Data();
+ if (!data)
+ return;
+
+ data->AddString("text/plain", url.string());
+ clipboard.Commit();
+
+ clipboard.Unlock();
+}
+
+void Pasteboard::writeImage(Node*, const KURL&, const String&)
+{
+ notImplemented();
+}
+
+void Pasteboard::clear()
+{
+ BClipboard clipboard("WebKit");
+ if (!clipboard.Lock())
+ return;
+
+ clipboard.Clear();
+ clipboard.Commit();
+
+ clipboard.Unlock();
+}
+
+} // namespace WebCore
+
diff --git a/WebCore/platform/haiku/PlatformKeyboardEventHaiku.cpp b/WebCore/platform/haiku/PlatformKeyboardEventHaiku.cpp
new file mode 100644
index 0000000..1545dfb
--- /dev/null
+++ b/WebCore/platform/haiku/PlatformKeyboardEventHaiku.cpp
@@ -0,0 +1,193 @@
+/*
+ * Copyright (C) 2007 Ryan Leavengood <leavengood@gmail.com>
+ * Copyright (C) 2008 Andrea Anzani <andrea.anzani@gmail.com>
+ *
+ * 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 "KeyboardCodes.h"
+#include "NotImplemented.h"
+#include <InterfaceDefs.h>
+#include <Message.h>
+#include <String.h>
+
+
+namespace WebCore {
+
+static String keyIdentifierForHaikuKeyCode(char singleByte, int keyCode)
+{
+ switch (singleByte) {
+ case B_FUNCTION_KEY:
+
+ switch (keyCode) {
+ case B_F1_KEY:
+ return "F1";
+ case B_F2_KEY:
+ return "F2";
+ case B_F3_KEY:
+ return "F3";
+ case B_F4_KEY:
+ return "F4";
+ case B_F5_KEY:
+ return "F5";
+ case B_F6_KEY:
+ return "F6";
+ case B_F7_KEY:
+ return "F7";
+ case B_F8_KEY:
+ return "F8";
+ case B_F9_KEY:
+ return "F9";
+ case B_F10_KEY:
+ return "F10";
+ case B_F11_KEY:
+ return "F11";
+ case B_F12_KEY:
+ return "F12";
+ case B_PRINT_KEY:
+ return "Print";
+ case B_PAUSE_KEY:
+ return "Pause";
+ case B_SCROLL_KEY:
+ return ""; // FIXME
+ }
+ break;
+
+ case B_BACKSPACE:
+ return "U+0009";
+ case B_LEFT_ARROW:
+ return "Left";
+ case B_RIGHT_ARROW:
+ return "Right";
+ case B_UP_ARROW:
+ return "Up";
+ case B_DOWN_ARROW:
+ return "Down";
+ case B_INSERT:
+ return "Insert";
+ case B_ENTER:
+ return "Enter";
+ case B_DELETE:
+ return "U+007F";
+ case B_HOME:
+ return "Home";
+ case B_END:
+ return "End";
+ case B_PAGE_UP:
+ return "PageUp";
+ case B_PAGE_DOWN:
+ return "PageDown";
+ case B_TAB:
+ return "U+0009";
+ }
+
+ return String::format("U+%04X", toASCIIUpper(keyCode));
+}
+
+static int windowsKeyCodeForKeyEvent(char singleByte)
+{
+ switch (singleByte) {
+ case B_BACKSPACE:
+ return VK_BACK; // (08) BACKSPACE key
+ case B_TAB:
+ return VK_TAB; // (09) TAB key
+ case B_RETURN:
+ return VK_RETURN; //(0D) Return key
+ case B_ESCAPE:
+ return VK_ESCAPE; // (1B) ESC key
+ case B_SPACE:
+ return VK_SPACE; // (20) SPACEBAR
+ case B_PAGE_UP:
+ return VK_PRIOR; // (21) PAGE UP key
+ case B_PAGE_DOWN:
+ return VK_NEXT; // (22) PAGE DOWN key
+ case B_END:
+ return VK_END; // (23) END key
+ case B_HOME:
+ return VK_HOME; // (24) HOME key
+ case B_LEFT_ARROW:
+ return VK_LEFT; // (25) LEFT ARROW key
+ case B_UP_ARROW:
+ return VK_UP; // (26) UP ARROW key
+ case B_RIGHT_ARROW:
+ return VK_RIGHT; // (27) RIGHT ARROW key
+ case B_DOWN_ARROW:
+ return VK_DOWN; // (28) DOWN ARROW key
+ case B_INSERT:
+ return VK_INSERT; // (2D) INS key
+ case B_DELETE:
+ return VK_DELETE; // (2E) DEL key
+ case 0x2e:
+ default:
+ return 0;
+ }
+}
+
+PlatformKeyboardEvent::PlatformKeyboardEvent(BMessage* message)
+ : m_autoRepeat(false)
+ , m_ctrlKey(false)
+ , m_altKey(false)
+ , m_metaKey(false)
+ , m_isKeypad(false)
+ , m_shiftKey(false)
+{
+ BString bytes = message->FindString("bytes");
+
+ m_text = String::fromUTF8(bytes.String(), bytes.Length());
+ m_unmodifiedText = String(bytes.String(), bytes.Length());
+ m_keyIdentifier = keyIdentifierForHaikuKeyCode(bytes.ByteAt(0), message->FindInt32("key"));
+
+ if (message->what == B_KEY_UP)
+ m_type = KeyUp;
+ else if (message->what == B_KEY_DOWN)
+ m_type = KeyDown;
+
+ m_windowsVirtualKeyCode = windowsKeyCodeForKeyEvent(bytes.ByteAt(0));
+}
+
+void PlatformKeyboardEvent::disambiguateKeyDownEvent(Type type, bool)
+{
+ // Can only change type from KeyDown to RawKeyDown or Char, as we lack information for other conversions.
+ ASSERT(m_type == KeyDown);
+ m_type = type;
+ if (type == RawKeyDown) {
+ m_text = String();
+ m_unmodifiedText = String();
+ } else {
+ m_keyIdentifier = String();
+ m_windowsVirtualKeyCode = 0;
+ }
+}
+
+bool PlatformKeyboardEvent::currentCapsLockState()
+{
+ notImplemented();
+ return false;
+}
+
+} // namespace WebCore
+
diff --git a/WebCore/platform/haiku/PlatformMouseEventHaiku.cpp b/WebCore/platform/haiku/PlatformMouseEventHaiku.cpp
new file mode 100644
index 0000000..d212f8b
--- /dev/null
+++ b/WebCore/platform/haiku/PlatformMouseEventHaiku.cpp
@@ -0,0 +1,82 @@
+/*
+ * Copyright (C) 2007 Ryan Leavengood <leavengood@gmail.com>
+ * Copyright (C) 2009 Maxime Simon <simon.maxime@gmail.com>
+ *
+ * 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 <Message.h>
+#include <SupportDefs.h>
+
+
+namespace WebCore {
+
+PlatformMouseEvent::PlatformMouseEvent(const BMessage* message)
+ : m_timestamp(message->FindInt64("when"))
+ , m_position(IntPoint(message->FindPoint("where")))
+ , m_globalPosition(message->FindPoint("globalPosition"))
+ , m_shiftKey(false)
+ , m_ctrlKey(false)
+ , m_altKey(false)
+ , m_metaKey(false)
+ , m_clickCount(message->FindInt32("clicks"))
+{
+ int32 buttons = message->FindInt32("buttons");
+ switch (buttons) {
+ case 1:
+ m_button = LeftButton;
+ break;
+ case 2:
+ m_button = RightButton;
+ break;
+ case 3:
+ m_button = MiddleButton;
+ break;
+ default:
+ m_button = NoButton;
+ break;
+ };
+
+ switch (message->what) {
+ case B_MOUSE_DOWN:
+ m_eventType = MouseEventPressed;
+ break;
+ case B_MOUSE_UP:
+ m_eventType = MouseEventReleased;
+ m_button = LeftButton; // FIXME: Webcore wants to know the button released but we don't know.
+ break;
+ case B_MOUSE_MOVED:
+ m_eventType = MouseEventMoved;
+ break;
+ default:
+ m_eventType = MouseEventMoved;
+ break;
+ };
+}
+
+} // namespace WebCore
+
diff --git a/WebCore/platform/haiku/PlatformWheelEventHaiku.cpp b/WebCore/platform/haiku/PlatformWheelEventHaiku.cpp
new file mode 100644
index 0000000..3945f48
--- /dev/null
+++ b/WebCore/platform/haiku/PlatformWheelEventHaiku.cpp
@@ -0,0 +1,62 @@
+/*
+ * Copyright (C) 2007 Ryan Leavengood <leavengood@gmail.com>
+ * Copyright (C) 2009 Maxime Simon <simon.maxime@gmail.com>
+ *
+ * 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 "PlatformWheelEvent.h"
+
+#include "Scrollbar.h"
+
+#include <Message.h>
+#include <Point.h>
+
+
+namespace WebCore {
+
+PlatformWheelEvent::PlatformWheelEvent(BMessage* message)
+ : m_granularity(ScrollByPixelWheelEvent)
+ , m_shiftKey(false)
+ , m_ctrlKey(false)
+ , m_altKey(false)
+ , m_metaKey(false)
+ , m_isAccepted(false)
+{
+ m_position = IntPoint(message->FindPoint("position"));
+ m_globalPosition = IntPoint(message->FindPoint("global_position"));
+
+ m_deltaX = message->FindFloat("be:wheel_delta_x");
+ m_deltaY = message->FindFloat("be:wheel_delta_y");
+
+ m_wheelTicksX = m_deltaX;
+ m_wheelTicksY = m_deltaY;
+
+ m_deltaX *= -cScrollbarPixelsPerLineStep;
+ m_deltaY *= -cScrollbarPixelsPerLineStep;
+}
+
+} // namespace WebCore
+
diff --git a/WebCore/platform/haiku/PopupMenuHaiku.cpp b/WebCore/platform/haiku/PopupMenuHaiku.cpp
new file mode 100644
index 0000000..9d608c8
--- /dev/null
+++ b/WebCore/platform/haiku/PopupMenuHaiku.cpp
@@ -0,0 +1,68 @@
+/*
+ * This file is part of the popup menu implementation for <select> elements in WebCore.
+ *
+ * Copyright (C) 2007 Ryan Leavengood <leavengood@gmail.com>
+ *
+ * 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 "PopupMenu.h"
+
+#include "FrameView.h"
+
+#include "NotImplemented.h"
+#include <Menu.h>
+
+
+namespace WebCore {
+
+PopupMenu::PopupMenu(PopupMenuClient* client)
+ : m_popupClient(client)
+ , m_menu(0)
+{
+}
+
+PopupMenu::~PopupMenu()
+{
+ delete m_menu;
+ m_menu = 0;
+}
+
+void PopupMenu::show(const IntRect& rect, FrameView* view, int index)
+{
+ notImplemented();
+}
+
+void PopupMenu::hide()
+{
+ notImplemented();
+}
+
+void PopupMenu::updateFromElement()
+{
+ notImplemented();
+}
+
+bool PopupMenu::itemWritingDirectionIsNatural()
+{
+ notImplemented();
+ return true;
+}
+
+} // namespace WebCore
+
diff --git a/WebCore/platform/haiku/ScreenHaiku.cpp b/WebCore/platform/haiku/ScreenHaiku.cpp
new file mode 100644
index 0000000..d43297b
--- /dev/null
+++ b/WebCore/platform/haiku/ScreenHaiku.cpp
@@ -0,0 +1,86 @@
+/*
+ * Copyright (C) 2007 Ryan Leavengood <leavengood@gmail.com>
+ *
+ * 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 <GraphicsDefs.h>
+#include <interface/Screen.h>
+
+
+namespace WebCore {
+
+FloatRect screenRect(Widget*)
+{
+ BScreen screen;
+ // FIXME: We assume this screen is valid
+ return FloatRect(screen.Frame());
+}
+
+FloatRect screenAvailableRect(Widget* widget)
+{
+ // FIXME: We could use the get_deskbar_frame() function
+ // from InterfaceDefs.h to make this smaller
+ return screenRect(widget);
+}
+
+int screenDepth(Widget*)
+{
+ BScreen screen;
+ // FIXME: We assume this screen is valid
+ color_space cs = screen.ColorSpace();
+
+ size_t pixelChunk, rowAlignment, pixelsPerChunk;
+ if (get_pixel_size_for(cs, &pixelChunk, &rowAlignment, &pixelsPerChunk) == B_OK)
+ // FIXME: Not sure if this is right
+ return pixelChunk * 8;
+
+ return 8;
+}
+
+int screenDepthPerComponent(Widget*)
+{
+ notImplemented();
+ return 8;
+}
+
+bool screenIsMonochrome(Widget*)
+{
+ BScreen screen;
+ // FIXME: We assume this screen is valid
+ return screen.ColorSpace() == B_MONOCHROME_1_BIT;
+}
+
+} // namespace WebCore
+
diff --git a/WebCore/platform/haiku/SearchPopupMenuHaiku.cpp b/WebCore/platform/haiku/SearchPopupMenuHaiku.cpp
new file mode 100644
index 0000000..fd5d96c
--- /dev/null
+++ b/WebCore/platform/haiku/SearchPopupMenuHaiku.cpp
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 2007 Ryan Leavengood <leavengood@gmail.com>
+ *
+ * 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 "SearchPopupMenu.h"
+
+#include "AtomicString.h"
+#include "NotImplemented.h"
+
+
+namespace WebCore {
+
+SearchPopupMenu::SearchPopupMenu(PopupMenuClient* client)
+ : PopupMenu(client)
+{
+}
+
+void SearchPopupMenu::saveRecentSearches(const AtomicString& name, const Vector<String>& searchItems)
+{
+ notImplemented();
+}
+
+void SearchPopupMenu::loadRecentSearches(const AtomicString& name, Vector<String>& searchItems)
+{
+ notImplemented();
+}
+
+bool SearchPopupMenu::enabled()
+{
+ notImplemented();
+ return false;
+}
+
+} // namespace WebCore
+
diff --git a/WebCore/platform/haiku/SoundHaiku.cpp b/WebCore/platform/haiku/SoundHaiku.cpp
new file mode 100644
index 0000000..9bee93f
--- /dev/null
+++ b/WebCore/platform/haiku/SoundHaiku.cpp
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2007 Ryan Leavengood <leavengood@gmail.com>
+ *
+ * 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 <Beep.h>
+
+
+namespace WebCore {
+
+void systemBeep()
+{
+ beep();
+}
+
+} // namespace WebCore
+
diff --git a/WebCore/platform/haiku/TemporaryLinkStubs.cpp b/WebCore/platform/haiku/TemporaryLinkStubs.cpp
new file mode 100644
index 0000000..48380fc
--- /dev/null
+++ b/WebCore/platform/haiku/TemporaryLinkStubs.cpp
@@ -0,0 +1,126 @@
+/*
+ * Copyright (C) 2006 Apple Computer, Inc. All rights reserved.
+ * Copyright (C) 2006 Michael Emmel mike.emmel@gmail.com
+ * Copyright (C) 2006 George Staikos <staikos@kde.org>
+ * Copyright (C) 2006 Dirk Mueller <mueller@kde.org>
+ * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org>
+ * Copyright (C) 2007 Ryan Leavengood <leavengood@gmail.com>
+ * Copyright (C) 2009 Maxime Simon <simon.maxime@gmail.com>
+ *
+ * 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 "AXObjectCache.h"
+#include "CachedResource.h"
+#include "CookieJar.h"
+#include "Cursor.h"
+#include "DataGridColumnList.h"
+#include "FileSystem.h"
+#include "Font.h"
+#include "Frame.h"
+#include "FrameView.h"
+#include "GraphicsContext.h"
+#include "History.h"
+#include "IconLoader.h"
+#include "InspectorController.h"
+#include "IntPoint.h"
+#include "KURL.h"
+#include "Language.h"
+#include "Node.h"
+#include "NotImplemented.h"
+#include "Path.h"
+#include "PlatformMouseEvent.h"
+#include "PlatformScrollBar.h"
+#include "PluginInfoStore.h"
+#include "RenderTheme.h"
+#include "Screen.h"
+#include "Scrollbar.h"
+#include "ScrollbarTheme.h"
+#include "SharedBuffer.h"
+#include "TextBoundaries.h"
+#include "Threading.h"
+#include "Widget.h"
+#include "loader.h"
+#include <runtime/JSValue.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+using namespace WebCore;
+
+Vector<char> loadResourceIntoArray(const char*)
+{
+ notImplemented();
+ return Vector<char>();
+}
+
+namespace WebCore {
+
+bool historyContains(String const&)
+{
+ return false;
+}
+
+Vector<String> supportedKeySizes()
+{
+ notImplemented();
+ return Vector<String>();
+}
+
+String signedPublicKeyAndChallengeString(unsigned keySizeIndex, const String &challengeString, const KURL &url)
+{
+ return String();
+}
+
+float userIdleTime()
+{
+ notImplemented();
+ return 0;
+}
+
+void callOnMainThread(void (*)())
+{
+ notImplemented();
+}
+
+PassRefPtr<SharedBuffer> SharedBuffer::createWithContentsOfFile(const String&)
+{
+ notImplemented();
+ return 0;
+}
+
+String KURL::fileSystemPath() const
+{
+ notImplemented();
+ return String();
+}
+
+void getSupportedKeySizes(Vector<String>&)
+{
+ notImplemented();
+}
+
+} // namespace WebCore
+
diff --git a/WebCore/platform/haiku/WidgetHaiku.cpp b/WebCore/platform/haiku/WidgetHaiku.cpp
new file mode 100644
index 0000000..6031fca
--- /dev/null
+++ b/WebCore/platform/haiku/WidgetHaiku.cpp
@@ -0,0 +1,95 @@
+/*
+ * Copyright (C) 2007 Ryan Leavengood <leavengood@gmail.com>
+ *
+ * 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"
+#include <Control.h>
+#include <View.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()
+{
+ if (platformWidget())
+ platformWidget()->MakeFocus();
+}
+
+void Widget::setCursor(const Cursor& cursor)
+{
+ if (platformWidget())
+ platformWidget()->SetViewCursor(cursor.impl());
+}
+
+void Widget::show()
+{
+ if (platformWidget())
+ platformWidget()->Show();
+}
+
+void Widget::hide()
+{
+ if (platformWidget())
+ platformWidget()->Hide();
+}
+
+void Widget::paint(GraphicsContext* p, IntRect const& r)
+{
+ notImplemented();
+}
+
+void Widget::setIsSelected(bool)
+{
+ notImplemented();
+}
+
+} // namespace WebCore
+