Commit 451c0992 authored by kevino's avatar kevino

Adding wx sources and changes to wxWebKit branch.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@20893 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 95d2be07
/*
* Copyright (C) 2007 Kevin Ollivier <kevino@theolliviers.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 "HashTable.h"
#include "ClipboardWx.h"
#include "IntPoint.h"
#include "PlatformString.h"
#include "StringHash.h"
#include "Pasteboard.h"
#define notImplemented() do { fprintf(stderr, "FIXME: UNIMPLEMENTED: %s:%d (%s)\n", __FILE__, __LINE__, __FUNCTION__); } while(0)
namespace WebCore {
ClipboardWx::ClipboardWx(ClipboardAccessPolicy policy, bool forDragging)
: Clipboard(policy, forDragging)
{
}
void ClipboardWx::clearData(const String& type)
{
notImplemented();
}
void ClipboardWx::clearAllData()
{
Pasteboard::generalPasteboard()->clear();
}
String ClipboardWx::getData(const String& type, bool& success) const
{
notImplemented();
return "";
}
bool ClipboardWx::setData(const String& type, const String& data)
{
notImplemented();
return false;
}
// extensions beyond IE's API
HashSet<String> ClipboardWx::types() const
{
notImplemented();
HashSet<String> result;
return result;
}
IntPoint ClipboardWx::dragLocation() const
{
notImplemented();
return IntPoint(0,0);
}
CachedImage* ClipboardWx::dragImage() const
{
notImplemented();
return 0;
}
void ClipboardWx::setDragImage(CachedImage*, const IntPoint&)
{
notImplemented();
}
Node* ClipboardWx::dragImageElement()
{
notImplemented();
return 0;
}
void ClipboardWx::setDragImageElement(Node*, const IntPoint&)
{
notImplemented();
}
DragImageRef ClipboardWx::createDragImage(IntPoint& dragLoc) const
{
notImplemented();
return 0;
}
void ClipboardWx::declareAndWriteDragImage(Element*, const KURL&, const String&, Frame*)
{
notImplemented();
}
void ClipboardWx::writeURL(const KURL& url, const String& string, Frame* frame)
{
Pasteboard::generalPasteboard()->writeURL(url, string, frame);
}
void ClipboardWx::writeRange(Range*, Frame*)
{
notImplemented();
}
bool ClipboardWx::hasData()
{
notImplemented();
return false;
}
}
/*
* Copyright (C) 2007 Kevin Ollivier <kevino@theolliviers.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 ClipboardWx_h
#define ClipboardWx_h
#include "Clipboard.h"
namespace WebCore {
class CachedImage;
// State available during IE's events for drag and drop and copy/paste
class ClipboardWx : public Clipboard {
public:
ClipboardWx(ClipboardAccessPolicy policy, bool forDragging);
~ClipboardWx() { }
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;
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();
};
}
#endif // ClipboardWx_h
/*
* Copyright (C) 2007 Kevin Ollivier <kevino@theolliviers.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 "Cursor.h"
#include <wx/defs.h>
#include <wx/cursor.h>
namespace WebCore {
Cursor::Cursor(const Cursor& other)
: m_impl(other.m_impl)
{
}
Cursor::Cursor(Image*, const IntPoint&) { }
Cursor::~Cursor()
{
}
Cursor& Cursor::operator=(const Cursor& other)
{
m_impl = other.m_impl;
return *this;
}
Cursor::Cursor(wxCursor* c)
: m_impl(c)
{
}
const Cursor& pointerCursor()
{
static Cursor c = new wxCursor(wxCURSOR_ARROW);
return c;
}
const Cursor& crossCursor()
{
static Cursor c = new wxCursor(wxCURSOR_CROSS);
return c;
}
const Cursor& handCursor()
{
static Cursor c = new wxCursor(wxCURSOR_HAND);
return c;
}
const Cursor& iBeamCursor()
{
static Cursor c = new wxCursor(wxCURSOR_IBEAM);
return c;
}
const Cursor& waitCursor()
{
static Cursor c = new wxCursor(wxCURSOR_WAIT);
return c;
}
const Cursor& helpCursor()
{
static Cursor c = new wxCursor(wxCURSOR_QUESTION_ARROW);
return c;
}
const Cursor& eastResizeCursor()
{
static Cursor c = new wxCursor(wxCURSOR_SIZEWE);
return c;
}
const Cursor& northResizeCursor()
{
static Cursor c = new wxCursor(wxCURSOR_SIZENS);
return c;
}
const Cursor& northEastResizeCursor()
{
static Cursor c = new wxCursor(wxCURSOR_SIZENESW);
return c;
}
const Cursor& northWestResizeCursor()
{
static Cursor c = new wxCursor(wxCURSOR_SIZENWSE);
return c;
}
const Cursor& southResizeCursor()
{
static Cursor c = northResizeCursor();
return c;
}
const Cursor& southEastResizeCursor()
{
static Cursor c = northWestResizeCursor();
return c;
}
const Cursor& southWestResizeCursor()
{
static Cursor c = northEastResizeCursor();
return c;
}
const Cursor& westResizeCursor()
{
static Cursor c = eastResizeCursor();
return c;
}
const Cursor& northSouthResizeCursor()
{
static Cursor c = northResizeCursor();
return c;
}
const Cursor& eastWestResizeCursor()
{
static Cursor c = eastResizeCursor();
return c;
}
const Cursor& northEastSouthWestResizeCursor()
{
static Cursor c = northEastResizeCursor();
return c;
}
const Cursor& northWestSouthEastResizeCursor()
{
static Cursor c = northWestResizeCursor();
return c;
}
const Cursor& columnResizeCursor()
{
// FIXME: Windows does not have a standard column resize cursor
static Cursor c = new wxCursor(wxCURSOR_SIZING);
return c;
}
const Cursor& rowResizeCursor()
{
// FIXME: Windows does not have a standard row resize cursor
static Cursor c = new wxCursor(wxCURSOR_SIZING);
return c;
}
const Cursor& verticalTextCursor()
{
return iBeamCursor();
}
const Cursor& cellCursor()
{
return pointerCursor();
}
const Cursor& contextMenuCursor()
{
return handCursor();
}
const Cursor& noDropCursor()
{
return pointerCursor();
}
const Cursor& progressCursor()
{
return waitCursor();
}
const Cursor& aliasCursor()
{
return pointerCursor();
}
const Cursor& copyCursor()
{
return pointerCursor();
}
const Cursor& noneCursor()
{
// fix me
return NULL;
}
const Cursor& notAllowedCursor()
{
static Cursor c = new wxCursor(wxCURSOR_NO_ENTRY);
return c;
}
}
/*
* Copyright (C) 2007 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "config.h"
#include "DragData.h"
#include "Document.h"
#include "DocumentFragment.h"
namespace WebCore {
bool DragData::canSmartReplace() const
{
return false;
}
bool DragData::containsColor() const
{
return false;
}
bool DragData::containsPlainText() const
{
return false;
}
String DragData::asPlainText() const
{
return String();
}
Color DragData::asColor() const
{
return Color();
}
Clipboard* DragData::createClipboard(ClipboardAccessPolicy) const
{
return 0;
}
bool DragData::containsCompatibleContent() const
{
return false;
}
bool DragData::containsURL() const
{
return false;
}
String DragData::asURL(String* title) const
{
return String();
}
PassRefPtr<DocumentFragment> DragData::asFragment(Document*) const
{
return 0;
}
}
/*
* Copyright (C) 2007 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
* OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "config.h"
#include "DragImage.h"
#include "CachedImage.h"
#include "Image.h"
namespace WebCore {
IntSize dragImageSize(DragImageRef)
{
return IntSize(0, 0);
}
void deleteDragImage(DragImageRef)
{
}
DragImageRef scaleDragImage(DragImageRef image, float)
{
return image;
}
DragImageRef dissolveDragImageToFraction(DragImageRef image, float)
{
return image;
}
DragImageRef createDragImageFromImage(Image*)
{
return 0;
}
DragImageRef createDragImageIconForCachedImage(CachedImage*)
{
return 0;
}
}
/*
* Copyright (C) 2006 Apple Computer, Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
* its contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "config.h"
#include "FontCache.h"
#include "FontPlatformData.h"
#include "Font.h"
#include "FontData.h"
namespace WebCore
{
void FontCache::platformInit()
{
}
const FontData* FontCache::getFontDataForCharacters(const Font& font, const UChar* characters, int length)
{
FontData* fontData = 0;
fontData = new FontData(FontPlatformData(font.fontDescription(), font.family().family()));
return fontData;
}
FontPlatformData* FontCache::getSimilarFontPlatformData(const Font& font)
{
return new FontPlatformData(font.fontDescription(), font.family().family());
}
FontPlatformData* FontCache::getLastResortFallbackFont(const Font& font)
{
// FIXME: Would be even better to somehow get the user's default font here. For now we'll pick
// the default that the user would get without changing any prefs.
static AtomicString timesStr("systemfont");
return getCachedFontPlatformData(font.fontDescription(), timesStr);
}
FontPlatformData* FontCache::createFontPlatformData(const FontDescription& fontDescription, const AtomicString& family)
{
return new FontPlatformData(fontDescription,family);
}
}
/*
* Copyright (C) 2006 Apple Computer, Inc. All rights reserved.
*