diff options
author | Andrei Popescu <andreip@google.com> | 2009-08-19 14:09:30 +0100 |
---|---|---|
committer | Andrei Popescu <andreip@google.com> | 2009-08-19 14:09:30 +0100 |
commit | 058ccc7ba0a4d59b9f6e92808332aa9895425fc7 (patch) | |
tree | 276aad5a2bbc2fd7d65d21bfca42c9de88b3dd20 /WebCore/platform/haiku | |
parent | 2796dd1bf3b4b01e7e1d96ea91bd3a212f647579 (diff) | |
download | external_webkit-058ccc7ba0a4d59b9f6e92808332aa9895425fc7.zip external_webkit-058ccc7ba0a4d59b9f6e92808332aa9895425fc7.tar.gz external_webkit-058ccc7ba0a4d59b9f6e92808332aa9895425fc7.tar.bz2 |
Revert "Merge WebKit r47420"
This reverts commit d227fc870c7a697500a3c900c31baf05fb9a8524.
Diffstat (limited to 'WebCore/platform/haiku')
-rw-r--r-- | WebCore/platform/haiku/ClipboardHaiku.cpp | 36 | ||||
-rw-r--r-- | WebCore/platform/haiku/ContextMenuHaiku.cpp | 40 | ||||
-rw-r--r-- | WebCore/platform/haiku/CookieJarHaiku.cpp | 19 | ||||
-rw-r--r-- | WebCore/platform/haiku/DragDataHaiku.cpp | 7 | ||||
-rw-r--r-- | WebCore/platform/haiku/LocalizedStringsHaiku.cpp | 346 | ||||
-rw-r--r-- | WebCore/platform/haiku/LoggingHaiku.cpp | 48 | ||||
-rw-r--r-- | WebCore/platform/haiku/RenderThemeHaiku.cpp | 178 | ||||
-rw-r--r-- | WebCore/platform/haiku/RenderThemeHaiku.h | 70 | ||||
-rw-r--r-- | WebCore/platform/haiku/ScrollbarThemeHaiku.cpp | 164 | ||||
-rw-r--r-- | WebCore/platform/haiku/ScrollbarThemeHaiku.h | 55 | ||||
-rw-r--r-- | WebCore/platform/haiku/SharedBufferHaiku.cpp | 55 | ||||
-rw-r--r-- | WebCore/platform/haiku/TemporaryLinkStubs.cpp | 58 |
12 files changed, 105 insertions, 971 deletions
diff --git a/WebCore/platform/haiku/ClipboardHaiku.cpp b/WebCore/platform/haiku/ClipboardHaiku.cpp index a62c30c..845c08c 100644 --- a/WebCore/platform/haiku/ClipboardHaiku.cpp +++ b/WebCore/platform/haiku/ClipboardHaiku.cpp @@ -27,8 +27,8 @@ #include "config.h" #include "ClipboardHaiku.h" -#include "FileList.h" #include "IntPoint.h" +#include "FileList.h" #include "NotImplemented.h" #include "PlatformString.h" #include "StringHash.h" @@ -42,7 +42,7 @@ namespace WebCore { -ClipboardHaiku::ClipboardHaiku(ClipboardAccessPolicy policy, bool forDragging) +ClipboardHaiku::ClipboardHaiku(ClipboardAccessPolicy policy, bool forDragging) : Clipboard(policy, forDragging) { } @@ -61,7 +61,7 @@ void ClipboardHaiku::clearData(const String& type) } } -void ClipboardHaiku::clearAllData() +void ClipboardHaiku::clearAllData() { if (be_clipboard->Lock()) { be_clipboard->Clear(); @@ -70,7 +70,7 @@ void ClipboardHaiku::clearAllData() } } -String ClipboardHaiku::getData(const String& type, bool& success) const +String ClipboardHaiku::getData(const String& type, bool& success) const { BString result; success = false; @@ -88,7 +88,7 @@ String ClipboardHaiku::getData(const String& type, bool& success) const return result; } -bool ClipboardHaiku::setData(const String& type, const String& data) +bool ClipboardHaiku::setData(const String& type, const String& data) { bool result = false; @@ -110,7 +110,7 @@ bool ClipboardHaiku::setData(const String& type, const String& data) } // Extensions beyond IE's API. -HashSet<String> ClipboardHaiku::types() const +HashSet<String> ClipboardHaiku::types() const { HashSet<String> result; @@ -138,27 +138,27 @@ PassRefPtr<FileList> ClipboardHaiku::files() const return 0; } -IntPoint ClipboardHaiku::dragLocation() const -{ +IntPoint ClipboardHaiku::dragLocation() const +{ notImplemented(); return IntPoint(0, 0); } -CachedImage* ClipboardHaiku::dragImage() const +CachedImage* ClipboardHaiku::dragImage() const { notImplemented(); - return 0; + return 0; } -void ClipboardHaiku::setDragImage(CachedImage*, const IntPoint&) +void ClipboardHaiku::setDragImage(CachedImage*, const IntPoint&) { notImplemented(); } -Node* ClipboardHaiku::dragImageElement() +Node* ClipboardHaiku::dragImageElement() { notImplemented(); - return 0; + return 0; } void ClipboardHaiku::setDragImageElement(Node*, const IntPoint&) @@ -167,27 +167,27 @@ void ClipboardHaiku::setDragImageElement(Node*, const IntPoint&) } DragImageRef ClipboardHaiku::createDragImage(IntPoint& dragLocation) const -{ +{ notImplemented(); return 0; } -void ClipboardHaiku::declareAndWriteDragImage(Element*, const KURL&, const String&, Frame*) +void ClipboardHaiku::declareAndWriteDragImage(Element*, const KURL&, const String&, Frame*) { notImplemented(); } -void ClipboardHaiku::writeURL(const KURL&, const String&, Frame*) +void ClipboardHaiku::writeURL(const KURL&, const String&, Frame*) { notImplemented(); } -void ClipboardHaiku::writeRange(Range*, Frame*) +void ClipboardHaiku::writeRange(Range*, Frame*) { notImplemented(); } -bool ClipboardHaiku::hasData() +bool ClipboardHaiku::hasData() { bool result = false; diff --git a/WebCore/platform/haiku/ContextMenuHaiku.cpp b/WebCore/platform/haiku/ContextMenuHaiku.cpp index b978433..03b8978 100644 --- a/WebCore/platform/haiku/ContextMenuHaiku.cpp +++ b/WebCore/platform/haiku/ContextMenuHaiku.cpp @@ -27,27 +27,30 @@ #include "config.h" #include "ContextMenu.h" -#include "ContextMenuController.h" #include "ContextMenuItem.h" -#include "Document.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> -#include <wtf/Assertions.h> namespace WebCore { // FIXME: This class isn't used yet -class ContextMenuReceiver : public BLooper { +class ContextMenuReceiver : public BLooper +{ public: ContextMenuReceiver(ContextMenu* menu) : BLooper("context_menu_receiver") , m_menu(menu) - , m_result(-1) { + m_result = -1; } void HandleMessage(BMessage* msg) @@ -77,8 +80,21 @@ private: ContextMenu::ContextMenu(const HitTestResult& result) : m_hitTestResult(result) - , m_platformDescription(new BMenu("context_menu")) + , 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() @@ -90,9 +106,9 @@ void ContextMenu::appendItem(ContextMenuItem& item) { checkOrEnableIfNeeded(item); - BMenuItem* menuItem = item.releasePlatformDescription(); - if (menuItem) - m_platformDescription->AddItem(menuItem); + BMenuItem* bItem = item.releasePlatformDescription(); + if (bItem) + m_platformDescription->AddItem(bItem); } unsigned ContextMenu::itemCount() const @@ -104,9 +120,9 @@ void ContextMenu::insertItem(unsigned position, ContextMenuItem& item) { checkOrEnableIfNeeded(item); - BMenuItem* menuItem = item.releasePlatformDescription(); - if (menuItem) - m_platformDescription->AddItem(menuItem, position); + BMenuItem* bItem = item.releasePlatformDescription(); + if (bItem) + m_platformDescription->AddItem(bItem, position); } PlatformMenuDescription ContextMenu::platformDescription() const diff --git a/WebCore/platform/haiku/CookieJarHaiku.cpp b/WebCore/platform/haiku/CookieJarHaiku.cpp index 831b379..73519d7 100644 --- a/WebCore/platform/haiku/CookieJarHaiku.cpp +++ b/WebCore/platform/haiku/CookieJarHaiku.cpp @@ -29,7 +29,6 @@ #include "config.h" #include "CookieJar.h" -#include "Cookie.h" #include "KURL.h" #include "PlatformString.h" #include "StringHash.h" @@ -42,33 +41,21 @@ namespace WebCore { // FIXME: Shouldn't this be saved to and restored from disk too? static HashMap<String, String> cookieJar; -void setCookies(Document*, const KURL& url, const String& value) +void setCookies(const KURL& url, const KURL& /*policyURL*/, const String& value) { cookieJar.set(url.string(), value); } -String cookies(const Document*, const KURL& url) +String cookies(const KURL& url) { return cookieJar.get(url.string()); } -bool cookiesEnabled(const Document*) +bool cookiesEnabled() { // FIXME: This should probably be a setting return true; } -bool getRawCookies(const Document*, const KURL&, Vector<Cookie>& rawCookies) -{ - // FIXME: Not yet implemented - rawCookies.clear(); - return false; // return true when implemented -} - -void deleteCookie(const Document*, const KURL&, const String&) -{ - // FIXME: Not yet implemented -} - } // namespace WebCore diff --git a/WebCore/platform/haiku/DragDataHaiku.cpp b/WebCore/platform/haiku/DragDataHaiku.cpp index 4a20147..b42b311 100644 --- a/WebCore/platform/haiku/DragDataHaiku.cpp +++ b/WebCore/platform/haiku/DragDataHaiku.cpp @@ -27,9 +27,10 @@ #include "config.h" #include "DragData.h" -#include "ClipboardHaiku.h" #include "Document.h" #include "DocumentFragment.h" +#include "ClipboardHaiku.h" + #include "NotImplemented.h" @@ -78,7 +79,7 @@ Color DragData::asColor() const WTF::PassRefPtr<Clipboard> DragData::createClipboard(ClipboardAccessPolicy policy) const { - return ClipboardHaiku::create(policy, true); + return new ClipboardHaiku(policy, true); } bool DragData::containsCompatibleContent() const @@ -103,6 +104,6 @@ PassRefPtr<DocumentFragment> DragData::asFragment(Document*) const notImplemented(); return 0; } - + } // namespace WebCore diff --git a/WebCore/platform/haiku/LocalizedStringsHaiku.cpp b/WebCore/platform/haiku/LocalizedStringsHaiku.cpp deleted file mode 100644 index a37ffcc..0000000 --- a/WebCore/platform/haiku/LocalizedStringsHaiku.cpp +++ /dev/null @@ -1,346 +0,0 @@ -/* - * 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 "LocalizedStrings.h" - -#include "PlatformString.h" - - -namespace WebCore { -String submitButtonDefaultLabel() -{ - return "Submit"; -} - -String inputElementAltText() -{ - return String(); -} - -String resetButtonDefaultLabel() -{ - return "Reset"; -} - -String defaultLanguage() -{ - return "en"; -} - -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 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 AXDefinitionListTermText() -{ - return String(); -} - -String AXDefinitionListDefinitionText() -{ - return String(); -} - -} // namespace WebCore - diff --git a/WebCore/platform/haiku/LoggingHaiku.cpp b/WebCore/platform/haiku/LoggingHaiku.cpp deleted file mode 100644 index f09c483..0000000 --- a/WebCore/platform/haiku/LoggingHaiku.cpp +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (C) 2009 Maxime Simon <simon.maxime@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 "Logging.h" - - -namespace WebCore { - -void InitializeLoggingChannelsIfNecessary() -{ - // FIXME: Should read the logging channels from a file. - static bool haveInitializedLoggingChannels = false; - if (haveInitializedLoggingChannels) - return; - - haveInitializedLoggingChannels = true; - - LogEvents.state = WTFLogChannelOn; - LogFrames.state = WTFLogChannelOn; - LogLoading.state = WTFLogChannelOn; - LogPlatformLeaks.state = WTFLogChannelOn; -} - -} // namespace WebCore - diff --git a/WebCore/platform/haiku/RenderThemeHaiku.cpp b/WebCore/platform/haiku/RenderThemeHaiku.cpp deleted file mode 100644 index 4327795..0000000 --- a/WebCore/platform/haiku/RenderThemeHaiku.cpp +++ /dev/null @@ -1,178 +0,0 @@ -/* - * This file is part of the WebKit project. - * - * Copyright (C) 2006 Dirk Mueller <mueller@kde.org> - * 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. - * - * 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 "RenderThemeHaiku.h" - -#include "GraphicsContext.h" -#include "NotImplemented.h" -#include <ControlLook.h> -#include <View.h> - - -namespace WebCore { - -PassRefPtr<RenderTheme> RenderThemeHaiku::create() -{ - return adoptRef(new RenderThemeHaiku()); -} - -PassRefPtr<RenderTheme> RenderTheme::themeForPage(Page*) -{ - static RenderTheme* renderTheme = RenderThemeHaiku::create().releaseRef(); - return renderTheme; -} - -RenderThemeHaiku::RenderThemeHaiku() -{ -} - -RenderThemeHaiku::~RenderThemeHaiku() -{ -} - -static bool supportsFocus(ControlPart appearance) -{ - switch (appearance) { - case PushButtonPart: - case ButtonPart: - case TextFieldPart: - case TextAreaPart: - case SearchFieldPart: - case MenulistPart: - case RadioPart: - case CheckboxPart: - return true; - default: - return false; - } -} - -bool RenderThemeHaiku::supportsFocusRing(const RenderStyle* style) const -{ - return supportsFocus(style->appearance()); -} - -Color RenderThemeHaiku::platformActiveSelectionBackgroundColor() const -{ - return Color(ui_color(B_CONTROL_HIGHLIGHT_COLOR)); -} - -Color RenderThemeHaiku::platformInactiveSelectionBackgroundColor() const -{ - return Color(ui_color(B_CONTROL_HIGHLIGHT_COLOR)); -} - -Color RenderThemeHaiku::platformActiveSelectionForegroundColor() const -{ - return Color(ui_color(B_CONTROL_TEXT_COLOR)); -} - -Color RenderThemeHaiku::platformInactiveSelectionForegroundColor() const -{ - return Color(ui_color(B_CONTROL_TEXT_COLOR)); -} - -Color RenderThemeHaiku::platformTextSearchHighlightColor() const -{ - return Color(ui_color(B_MENU_SELECTED_BACKGROUND_COLOR)); -} - -void RenderThemeHaiku::systemFont(int propId, FontDescription&) const -{ - notImplemented(); -} - -bool RenderThemeHaiku::paintCheckbox(RenderObject*, const RenderObject::PaintInfo& info, const IntRect& intRect) -{ - if (info.context->paintingDisabled()) - return false; - - rgb_color base = ui_color(B_PANEL_BACKGROUND_COLOR); - BRect rect = intRect; - BView* view = info.context->platformContext(); - - if (!be_control_look) - return false; - - be_control_look->DrawCheckBox(view, rect, rect, base); - return true; -} - -void RenderThemeHaiku::setCheckboxSize(RenderStyle* style) const -{ - int size = 10; - - // If the width and height are both specified, then we have nothing to do. - if (!style->width().isIntrinsicOrAuto() && !style->height().isAuto()) - return; - - // FIXME: A hard-coded size of 'size' is used. This is wrong but necessary for now. - if (style->width().isIntrinsicOrAuto()) - style->setWidth(Length(size, Fixed)); - - if (style->height().isAuto()) - style->setHeight(Length(size, Fixed)); -} - -bool RenderThemeHaiku::paintRadio(RenderObject*, const RenderObject::PaintInfo& info, const IntRect& intRect) -{ - if (info.context->paintingDisabled()) - return false; - - rgb_color base = ui_color(B_PANEL_BACKGROUND_COLOR); - BRect rect = intRect; - BView* view = info.context->platformContext(); - - if (!be_control_look) - return false; - - be_control_look->DrawRadioButton(view, rect, rect, base); - return true; -} - -void RenderThemeHaiku::setRadioSize(RenderStyle* style) const -{ - // This is the same as checkboxes. - setCheckboxSize(style); -} - -void RenderThemeHaiku::adjustMenuListStyle(CSSStyleSelector*, RenderStyle* style, Element*) const -{ - // Leave some space for the arrow. - style->setPaddingRight(Length(22, Fixed)); - const int minHeight = 20; - style->setMinHeight(Length(minHeight, Fixed)); -} - -bool RenderThemeHaiku::paintMenuList(RenderObject*, const RenderObject::PaintInfo&, const IntRect&) -{ - notImplemented(); - return false; -} - -} // namespace WebCore diff --git a/WebCore/platform/haiku/RenderThemeHaiku.h b/WebCore/platform/haiku/RenderThemeHaiku.h deleted file mode 100644 index 7daebc4..0000000 --- a/WebCore/platform/haiku/RenderThemeHaiku.h +++ /dev/null @@ -1,70 +0,0 @@ -/* - * This file is part of the WebKit project. - * - * Copyright (C) 2009 Maxime Simon <simon.maxime@gmail.com> - * - * 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., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - * - */ - -#ifndef RenderThemeHaiku_h -#define RenderThemeHaiku_h - -#include "RenderTheme.h" - -namespace WebCore { - - class RenderThemeHaiku : public RenderTheme { - private: - RenderThemeHaiku(); - virtual ~RenderThemeHaiku(); - - public: - static PassRefPtr<RenderTheme> create(); - - // A method asking if the theme's controls actually care about redrawing when hovered. - virtual bool supportsHover(const RenderStyle* style) const { return false; } - - // A method asking if the theme is able to draw the focus ring. - virtual bool supportsFocusRing(const RenderStyle*) const; - - // The platform selection color. - virtual Color platformActiveSelectionBackgroundColor() const; - virtual Color platformInactiveSelectionBackgroundColor() const; - virtual Color platformActiveSelectionForegroundColor() const; - virtual Color platformInactiveSelectionForegroundColor() const; - - virtual Color platformTextSearchHighlightColor() const; - - // System fonts. - virtual void systemFont(int propId, FontDescription&) const; - - protected: - virtual bool paintCheckbox(RenderObject*, const RenderObject::PaintInfo&, const IntRect&); - virtual void setCheckboxSize(RenderStyle*) const; - - virtual bool paintRadio(RenderObject*, const RenderObject::PaintInfo&, const IntRect&); - virtual void setRadioSize(RenderStyle*) const; - - virtual void adjustMenuListStyle(CSSStyleSelector*, RenderStyle*, Element*) const; - virtual bool paintMenuList(RenderObject*, const RenderObject::PaintInfo&, const IntRect&); - }; - -} // namespace WebCore - -#endif // RenderThemeHaiku_h diff --git a/WebCore/platform/haiku/ScrollbarThemeHaiku.cpp b/WebCore/platform/haiku/ScrollbarThemeHaiku.cpp deleted file mode 100644 index 8adab3d..0000000 --- a/WebCore/platform/haiku/ScrollbarThemeHaiku.cpp +++ /dev/null @@ -1,164 +0,0 @@ -/* - * Copyright (C) 2008 Apple Inc. All Rights Reserved. - * Copyright 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 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 "ScrollbarThemeHaiku.h" - -#include "GraphicsContext.h" -#include "Scrollbar.h" -#include <ControlLook.h> -#include <InterfaceDefs.h> - - -int buttonWidth(int scrollbarWidth, int thickness) -{ - return scrollbarWidth < 2 * thickness ? scrollbarWidth / 2 : thickness; -} - -namespace WebCore { - -ScrollbarTheme* ScrollbarTheme::nativeTheme() -{ - static ScrollbarThemeHaiku theme; - return &theme; -} - -ScrollbarThemeHaiku::ScrollbarThemeHaiku() -{ -} - -ScrollbarThemeHaiku::~ScrollbarThemeHaiku() -{ -} - -int ScrollbarThemeHaiku::scrollbarThickness(ScrollbarControlSize controlSize) -{ - // FIXME: Should we make a distinction between a Small and a Regular Scrollbar? - return 16; -} - -bool ScrollbarThemeHaiku::hasButtons(Scrollbar* scrollbar) -{ - return scrollbar->enabled(); -} - -bool ScrollbarThemeHaiku::hasThumb(Scrollbar* scrollbar) -{ - return scrollbar->enabled() && thumbLength(scrollbar) > 0; -} - -IntRect ScrollbarThemeHaiku::backButtonRect(Scrollbar* scrollbar, ScrollbarPart part, bool) -{ - if (part == BackButtonEndPart) - return IntRect(); - - int thickness = scrollbarThickness(); - IntPoint buttonOrigin(scrollbar->x(), scrollbar->y()); - IntSize buttonSize = scrollbar->orientation() == HorizontalScrollbar - ? IntSize(buttonWidth(scrollbar->width(), thickness), thickness) - : IntSize(thickness, buttonWidth(scrollbar->height(), thickness)); - IntRect buttonRect(buttonOrigin, buttonSize); - - return buttonRect; -} - -IntRect ScrollbarThemeHaiku::forwardButtonRect(Scrollbar* scrollbar, ScrollbarPart part, bool) -{ - if (part == BackButtonStartPart) - return IntRect(); - - int thickness = scrollbarThickness(); - if (scrollbar->orientation() == HorizontalScrollbar) { - int width = buttonWidth(scrollbar->width(), thickness); - return IntRect(scrollbar->x() + scrollbar->width() - width, scrollbar->y(), width, thickness); - } - - int height = buttonWidth(scrollbar->height(), thickness); - return IntRect(scrollbar->x(), scrollbar->y() + scrollbar->height() - height, thickness, height); -} - -IntRect ScrollbarThemeHaiku::trackRect(Scrollbar* scrollbar, bool) -{ - int thickness = scrollbarThickness(); - if (scrollbar->orientation() == HorizontalScrollbar) { - if (scrollbar->width() < 2 * thickness) - return IntRect(); - return IntRect(scrollbar->x() + thickness, scrollbar->y(), scrollbar->width() - 2 * thickness, thickness); - } - if (scrollbar->height() < 2 * thickness) - return IntRect(); - return IntRect(scrollbar->x(), scrollbar->y() + thickness, thickness, scrollbar->height() - 2 * thickness); -} - -void ScrollbarThemeHaiku::paintScrollbarBackground(GraphicsContext* context, Scrollbar* scrollbar) -{ - if (!be_control_look) - return; - - BRect rect = trackRect(scrollbar, false); - orientation scrollbarOrientation = scrollbar->orientation() == HorizontalScrollbar ? B_HORIZONTAL : B_VERTICAL; - - be_control_look->DrawScrollBarBackground(context->platformContext(), rect, rect, ui_color(B_PANEL_BACKGROUND_COLOR), 0, scrollbarOrientation); -} - -void ScrollbarThemeHaiku::paintButton(GraphicsContext* context, Scrollbar* scrollbar, const IntRect& rect, ScrollbarPart part) -{ - if (!be_control_look) - return; - - BRect drawRect = BRect(rect); - BView* view = context->platformContext(); - rgb_color panelBgColor = ui_color(B_PANEL_BACKGROUND_COLOR); - rgb_color buttonBgColor = tint_color(panelBgColor, B_LIGHTEN_1_TINT); - - be_control_look->DrawButtonFrame(view, drawRect, drawRect, buttonBgColor, panelBgColor); - be_control_look->DrawButtonBackground(view, drawRect, drawRect, buttonBgColor); - - int arrowDirection; - if (scrollbar->orientation() == VerticalScrollbar) - arrowDirection = part == BackButtonStartPart ? BControlLook::B_UP_ARROW : BControlLook::B_DOWN_ARROW; - else - arrowDirection = part == BackButtonStartPart ? BControlLook::B_LEFT_ARROW : BControlLook::B_RIGHT_ARROW; - - be_control_look->DrawArrowShape(view, drawRect, drawRect, ui_color(B_CONTROL_TEXT_COLOR), arrowDirection); -} - -void ScrollbarThemeHaiku::paintThumb(GraphicsContext* context, Scrollbar*, const IntRect& rect) -{ - if (!be_control_look) - return; - - BRect drawRect = BRect(rect); - BView* view = context->platformContext(); - rgb_color panelBgColor = ui_color(B_PANEL_BACKGROUND_COLOR); - rgb_color buttonBgColor = tint_color(panelBgColor, B_LIGHTEN_1_TINT); - - be_control_look->DrawButtonFrame(view, drawRect, drawRect, buttonBgColor, panelBgColor); - be_control_look->DrawButtonBackground(view, drawRect, drawRect, buttonBgColor); -} - -} - diff --git a/WebCore/platform/haiku/ScrollbarThemeHaiku.h b/WebCore/platform/haiku/ScrollbarThemeHaiku.h deleted file mode 100644 index 18e2cc0..0000000 --- a/WebCore/platform/haiku/ScrollbarThemeHaiku.h +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (C) 2008 Apple Inc. All Rights Reserved. - * Copyright 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 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 ScrollbarThemeHaiku_h -#define ScrollbarThemeHaiku_h - -#include "ScrollbarThemeComposite.h" - -namespace WebCore { - class Scrollbar; - - class ScrollbarThemeHaiku : public ScrollbarThemeComposite { - public: - ScrollbarThemeHaiku(); - virtual ~ScrollbarThemeHaiku(); - - virtual int scrollbarThickness(ScrollbarControlSize = RegularScrollbar); - - virtual bool hasButtons(Scrollbar*); - virtual bool hasThumb(Scrollbar*); - - virtual IntRect backButtonRect(Scrollbar*, ScrollbarPart, bool painting); - virtual IntRect forwardButtonRect(Scrollbar*, ScrollbarPart, bool painting); - virtual IntRect trackRect(Scrollbar*, bool painting); - - virtual void paintScrollbarBackground(GraphicsContext*, Scrollbar*); - virtual void paintButton(GraphicsContext*, Scrollbar*, const IntRect&, ScrollbarPart); - virtual void paintThumb(GraphicsContext*, Scrollbar*, const IntRect&); - }; - -} -#endif diff --git a/WebCore/platform/haiku/SharedBufferHaiku.cpp b/WebCore/platform/haiku/SharedBufferHaiku.cpp deleted file mode 100644 index 113cd2e..0000000 --- a/WebCore/platform/haiku/SharedBufferHaiku.cpp +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (C) 2009 Maxime Simon <simon.maxime@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 "SharedBuffer.h" - -#include <File.h> -#include <String.h> - -namespace WebCore { - -PassRefPtr<SharedBuffer> SharedBuffer::createWithContentsOfFile(const String& fileName) -{ - if (fileName.isEmpty()) - return 0; - - BFile file(BString(fileName).String(), B_READ_ONLY); - if (file.InitCheck() != B_OK) - return 0; - - RefPtr<SharedBuffer> result = SharedBuffer::create(); - - off_t size; - file.GetSize(&size); - result->m_buffer.resize(size); - if (result->m_buffer.size() != size) - return 0; - - file.Read(result->m_buffer.data(), result->m_buffer.size()); - return result.release(); -} - -} // namespace WebCore diff --git a/WebCore/platform/haiku/TemporaryLinkStubs.cpp b/WebCore/platform/haiku/TemporaryLinkStubs.cpp index aa3d538..48380fc 100644 --- a/WebCore/platform/haiku/TemporaryLinkStubs.cpp +++ b/WebCore/platform/haiku/TemporaryLinkStubs.cpp @@ -33,11 +33,40 @@ #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 "PlatformString.h" -#include "SSLKeyGenerator.h" -#include "SystemTime.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; @@ -49,14 +78,20 @@ Vector<char> loadResourceIntoArray(const char*) namespace WebCore { -String signedPublicKeyAndChallengeString(unsigned keySizeIndex, const String &challengeString, const KURL &url) +bool historyContains(String const&) { - return String(); + return false; } -void getSupportedKeySizes(Vector<String>&) +Vector<String> supportedKeySizes() { notImplemented(); + return Vector<String>(); +} + +String signedPublicKeyAndChallengeString(unsigned keySizeIndex, const String &challengeString, const KURL &url) +{ + return String(); } float userIdleTime() @@ -70,11 +105,22 @@ 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 |