Diff
Modified: trunk/Source/WTF/ChangeLog (152565 => 152566)
--- trunk/Source/WTF/ChangeLog 2013-07-11 11:19:20 UTC (rev 152565)
+++ trunk/Source/WTF/ChangeLog 2013-07-11 11:43:53 UTC (rev 152566)
@@ -1,3 +1,14 @@
+2013-07-11 Patrick Gansterer <par...@webkit.org>
+
+ Remove unused Windows CE files
+ https://bugs.webkit.org/show_bug.cgi?id=118557
+
+ Reviewed by Andreas Kling.
+
+ * wtf/wince/FastMallocWinCE.h: Removed.
+ * wtf/wince/MemoryManager.cpp: Removed.
+ * wtf/wince/MemoryManager.h: Removed.
+
2013-07-10 Michael BrĂ¼ning <michael.brun...@digia.com>
Workaround for x86 optimizer bug in MSVC 2012.
Deleted: trunk/Source/WTF/wtf/wince/FastMallocWinCE.h (152565 => 152566)
--- trunk/Source/WTF/wtf/wince/FastMallocWinCE.h 2013-07-11 11:19:20 UTC (rev 152565)
+++ trunk/Source/WTF/wtf/wince/FastMallocWinCE.h 2013-07-11 11:43:53 UTC (rev 152566)
@@ -1,175 +0,0 @@
-/*
- * Copyright (C) 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
- * Copyright (C) 2007-2009 Torch Mobile, Inc. All rights reserved
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef WTF_FastMallocWinCE_h
-#define WTF_FastMallocWinCE_h
-
-#include <new.h>
-
-#ifdef __cplusplus
-#include <new>
-#include <wtf/wince/MemoryManager.h>
-extern "C" {
-#endif
-
-void* fastMalloc(size_t n);
-void* fastCalloc(size_t n_elements, size_t element_size);
-void fastFree(void* p);
-void* fastRealloc(void* p, size_t n);
-void* fastZeroedMalloc(size_t n);
-// These functions return 0 if an allocation fails.
-void* tryFastMalloc(size_t n);
-void* tryFastZeroedMalloc(size_t n);
-void* tryFastCalloc(size_t n_elements, size_t element_size);
-void* tryFastRealloc(void* p, size_t n);
-char* fastStrDup(const char*);
-
-#ifndef NDEBUG
-void fastMallocForbid();
-void fastMallocAllow();
-#endif
-
-#if !defined(USE_SYSTEM_MALLOC) || !USE_SYSTEM_MALLOC
-
-#define malloc(n) fastMalloc(n)
-#define calloc(n_elements, element_size) fastCalloc(n_elements, element_size)
-#define realloc(p, n) fastRealloc(p, n)
-#define free(p) fastFree(p)
-#define strdup(p) fastStrDup(p)
-
-#else
-
-#define strdup(p) _strdup(p)
-
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#ifdef __cplusplus
-#if !defined(USE_SYSTEM_MALLOC) || !USE_SYSTEM_MALLOC
-static inline void* __cdecl operator new(size_t s) { return fastMalloc(s); }
-static inline void __cdecl operator delete(void* p) { fastFree(p); }
-static inline void* __cdecl operator new[](size_t s) { return fastMalloc(s); }
-static inline void __cdecl operator delete[](void* p) { fastFree(p); }
-static inline void* operator new(size_t s, const std::nothrow_t&) throw() { return fastMalloc(s); }
-static inline void operator delete(void* p, const std::nothrow_t&) throw() { fastFree(p); }
-static inline void* operator new[](size_t s, const std::nothrow_t&) throw() { return fastMalloc(s); }
-static inline void operator delete[](void* p, const std::nothrow_t&) throw() { fastFree(p); }
-#endif
-
-namespace WTF {
- // This defines a type which holds an unsigned integer and is the same
- // size as the minimally aligned memory allocation.
- typedef unsigned long long AllocAlignmentInteger;
-
- namespace Internal {
- enum AllocType { // Start with an unusual number instead of zero, because zero is common.
- AllocTypeMalloc = 0x375d6750, // Encompasses fastMalloc, fastZeroedMalloc, fastCalloc, fastRealloc.
- AllocTypeClassNew, // Encompasses class operator new from FastAllocBase.
- AllocTypeClassNewArray, // Encompasses class operator new[] from FastAllocBase.
- AllocTypeFastNew, // Encompasses fastNew.
- AllocTypeFastNewArray, // Encompasses fastNewArray.
- AllocTypeNew, // Encompasses global operator new.
- AllocTypeNewArray // Encompasses global operator new[].
- };
- }
-
-
-#if ENABLE(FAST_MALLOC_MATCH_VALIDATION)
-
- // Malloc validation is a scheme whereby a tag is attached to an
- // allocation which identifies how it was originally allocated.
- // This allows us to verify that the freeing operation matches the
- // allocation operation. If memory is allocated with operator new[]
- // but freed with free or delete, this system would detect that.
- // In the implementation here, the tag is an integer prepended to
- // the allocation memory which is assigned one of the AllocType
- // enumeration values. An alternative implementation of this
- // scheme could store the tag somewhere else or ignore it.
- // Users of FastMalloc don't need to know or care how this tagging
- // is implemented.
-
- namespace Internal {
-
- // Return the AllocType tag associated with the allocated block p.
- inline AllocType fastMallocMatchValidationType(const void* p)
- {
- const AllocAlignmentInteger* type = static_cast<const AllocAlignmentInteger*>(p) - 1;
- return static_cast<AllocType>(*type);
- }
-
- // Return the address of the AllocType tag associated with the allocated block p.
- inline AllocAlignmentInteger* fastMallocMatchValidationValue(void* p)
- {
- return reinterpret_cast<AllocAlignmentInteger*>(static_cast<char*>(p) - sizeof(AllocAlignmentInteger));
- }
-
- // Set the AllocType tag to be associaged with the allocated block p.
- inline void setFastMallocMatchValidationType(void* p, AllocType allocType)
- {
- AllocAlignmentInteger* type = static_cast<AllocAlignmentInteger*>(p) - 1;
- *type = static_cast<AllocAlignmentInteger>(allocType);
- }
-
- // Handle a detected alloc/free mismatch. By default this calls CRASH().
- void fastMallocMatchFailed(void* p);
-
- } // namespace Internal
-
- // This is a higher level function which is used by FastMalloc-using code.
- inline void fastMallocMatchValidateMalloc(void* p, Internal::AllocType allocType)
- {
- if (!p)
- return;
-
- Internal::setFastMallocMatchValidationType(p, allocType);
- }
-
- // This is a higher level function which is used by FastMalloc-using code.
- inline void fastMallocMatchValidateFree(void* p, Internal::AllocType allocType)
- {
- if (!p)
- return;
-
- if (Internal::fastMallocMatchValidationType(p) != allocType)
- Internal::fastMallocMatchFailed(p);
- Internal::setFastMallocMatchValidationType(p, Internal::AllocTypeMalloc); // Set it to this so that fastFree thinks it's OK.
- }
-
-#else
-
- inline void fastMallocMatchValidateMalloc(void*, Internal::AllocType)
- {
- }
-
- inline void fastMallocMatchValidateFree(void*, Internal::AllocType)
- {
- }
-
-#endif
-
-} // namespace WTF
-
-#endif
-
-#endif // WTF_FastMallocWinCE_h
Deleted: trunk/Source/WTF/wtf/wince/MemoryManager.cpp (152565 => 152566)
--- trunk/Source/WTF/wtf/wince/MemoryManager.cpp 2013-07-11 11:19:20 UTC (rev 152565)
+++ trunk/Source/WTF/wtf/wince/MemoryManager.cpp 2013-07-11 11:43:53 UTC (rev 152566)
@@ -1,171 +0,0 @@
-/*
- * Copyright (C) 2008-2009 Torch Mobile Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#include "config.h"
-#include "MemoryManager.h"
-
-#undef malloc
-#undef calloc
-#undef realloc
-#undef free
-#undef strdup
-#undef _strdup
-#undef VirtualAlloc
-#undef VirtualFree
-
-#include <malloc.h>
-#include <windows.h>
-
-namespace WTF {
-
-MemoryManager* memoryManager()
-{
- static MemoryManager mm;
- return &mm;
-}
-
-MemoryManager::MemoryManager()
-: m_allocationCanFail(false)
-{
-}
-
-MemoryManager::~MemoryManager()
-{
-}
-
-HBITMAP MemoryManager::createCompatibleBitmap(HDC hdc, int width, int height)
-{
- return ::CreateCompatibleBitmap(hdc, width, height);
-}
-
-HBITMAP MemoryManager::createDIBSection(const BITMAPINFO* pbmi, void** ppvBits)
-{
- return ::CreateDIBSection(0, pbmi, DIB_RGB_COLORS, ppvBits, 0, 0);
-}
-
-void* MemoryManager::m_malloc(size_t size)
-{
- return malloc(size);
-}
-
-void* MemoryManager::m_calloc(size_t num, size_t size)
-{
- return calloc(num, size);
-}
-
-void* MemoryManager::m_realloc(void* p, size_t size)
-{
- return realloc(p, size);
-}
-
-void MemoryManager::m_free(void* p)
-{
- return free(p);
-}
-
-bool MemoryManager::resizeMemory(void*, size_t)
-{
- return false;
-}
-
-void* MemoryManager::allocate64kBlock()
-{
- return VirtualAlloc(0, 65536, MEM_COMMIT | MEM_RESERVE, PAGE_READWRITE);
-}
-
-void MemoryManager::free64kBlock(void* p)
-{
- VirtualFree(p, 65536, MEM_RELEASE);
-}
-
-bool MemoryManager::onIdle(DWORD& timeLimitMs)
-{
- return false;
-}
-
-LPVOID MemoryManager::virtualAlloc(LPVOID lpAddress, DWORD dwSize, DWORD flAllocationType, DWORD flProtect)
-{
- return ::VirtualAlloc(lpAddress, dwSize, flAllocationType, flProtect);
-}
-
-BOOL MemoryManager::virtualFree(LPVOID lpAddress, DWORD dwSize, DWORD dwFreeType)
-{
- return ::VirtualFree(lpAddress, dwSize, dwFreeType);
-}
-
-
-#if defined(USE_SYSTEM_MALLOC) && USE_SYSTEM_MALLOC
-
-void *fastMalloc(size_t n) { return malloc(n); }
-void *fastCalloc(size_t n_elements, size_t element_size) { return calloc(n_elements, element_size); }
-void fastFree(void* p) { return free(p); }
-void *fastRealloc(void* p, size_t n) { return realloc(p, n); }
-
-#else
-
-void *fastMalloc(size_t n) { return MemoryManager::m_malloc(n); }
-void *fastCalloc(size_t n_elements, size_t element_size) { return MemoryManager::m_calloc(n_elements, element_size); }
-void fastFree(void* p) { return MemoryManager::m_free(p); }
-void *fastRealloc(void* p, size_t n) { return MemoryManager::m_realloc(p, n); }
-
-#endif
-
-#ifndef NDEBUG
-void fastMallocForbid() {}
-void fastMallocAllow() {}
-#endif
-
-void* fastZeroedMalloc(size_t n)
-{
- void* p = fastMalloc(n);
- if (p)
- memset(p, 0, n);
- return p;
-}
-
-TryMallocReturnValue tryFastMalloc(size_t n)
-{
- MemoryAllocationCanFail canFail;
- return fastMalloc(n);
-}
-
-TryMallocReturnValue tryFastZeroedMalloc(size_t n)
-{
- MemoryAllocationCanFail canFail;
- return fastZeroedMalloc(n);
-}
-
-TryMallocReturnValue tryFastCalloc(size_t n_elements, size_t element_size)
-{
- MemoryAllocationCanFail canFail;
- return fastCalloc(n_elements, element_size);
-}
-
-TryMallocReturnValue tryFastRealloc(void* p, size_t n)
-{
- MemoryAllocationCanFail canFail;
- return fastRealloc(p, n);
-}
-
-char* fastStrDup(const char* str)
-{
- return _strdup(str);
-}
-
-}
\ No newline at end of file
Deleted: trunk/Source/WTF/wtf/wince/MemoryManager.h (152565 => 152566)
--- trunk/Source/WTF/wtf/wince/MemoryManager.h 2013-07-11 11:19:20 UTC (rev 152565)
+++ trunk/Source/WTF/wtf/wince/MemoryManager.h 2013-07-11 11:43:53 UTC (rev 152566)
@@ -1,80 +0,0 @@
-/*
- * Copyright (C) 2008-2009 Torch Mobile Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#pragma once
-
-#include <winbase.h>
-
-typedef struct HBITMAP__* HBITMAP;
-typedef struct HDC__* HDC;
-typedef void *HANDLE;
-typedef struct tagBITMAPINFO BITMAPINFO;
-
-namespace WTF {
-
- class MemoryManager {
- public:
- MemoryManager();
- ~MemoryManager();
-
- bool allocationCanFail() const { return m_allocationCanFail; }
- void setAllocationCanFail(bool c) { m_allocationCanFail = c; }
-
- static HBITMAP createCompatibleBitmap(HDC hdc, int width, int height);
- static HBITMAP createDIBSection(const BITMAPINFO* pbmi, void** ppvBits);
- static void* m_malloc(size_t size);
- static void* m_calloc(size_t num, size_t size);
- static void* m_realloc(void* p, size_t size);
- static void m_free(void*);
- static bool resizeMemory(void* p, size_t newSize);
- static void* allocate64kBlock();
- static void free64kBlock(void*);
- static bool onIdle(DWORD& timeLimitMs);
- static LPVOID virtualAlloc(LPVOID lpAddress, DWORD dwSize, DWORD flAllocationType, DWORD flProtect);
- static BOOL virtualFree(LPVOID lpAddress, DWORD dwSize, DWORD dwFreeType);
-
- private:
- friend MemoryManager* memoryManager();
-
- bool m_allocationCanFail;
- };
-
- MemoryManager* memoryManager();
-
- class MemoryAllocationCanFail {
- public:
- MemoryAllocationCanFail() : m_old(memoryManager()->allocationCanFail()) { memoryManager()->setAllocationCanFail(true); }
- ~MemoryAllocationCanFail() { memoryManager()->setAllocationCanFail(m_old); }
- private:
- bool m_old;
- };
-
- class MemoryAllocationCannotFail {
- public:
- MemoryAllocationCannotFail() : m_old(memoryManager()->allocationCanFail()) { memoryManager()->setAllocationCanFail(false); }
- ~MemoryAllocationCannotFail() { memoryManager()->setAllocationCanFail(m_old); }
- private:
- bool m_old;
- };
-}
-
-using WTF::MemoryManager;
-using WTF::memoryManager;
-using WTF::MemoryAllocationCanFail;
-using WTF::MemoryAllocationCannotFail;
Modified: trunk/Source/WebCore/ChangeLog (152565 => 152566)
--- trunk/Source/WebCore/ChangeLog 2013-07-11 11:19:20 UTC (rev 152565)
+++ trunk/Source/WebCore/ChangeLog 2013-07-11 11:43:53 UTC (rev 152566)
@@ -1,3 +1,14 @@
+2013-07-11 Patrick Gansterer <par...@webkit.org>
+
+ Remove unused Windows CE files
+ https://bugs.webkit.org/show_bug.cgi?id=118557
+
+ Reviewed by Andreas Kling.
+
+ * platform/wince/CursorWinCE.cpp: Removed.
+ * platform/wince/PasteboardWinCE.cpp: Removed.
+ * platform/wince/SearchPopupMenuWinCE.cpp: Removed.
+
2013-07-11 Christophe Dumez <ch.du...@sisa.samsung.com>
Get rid of SVGPathSeg* special casing in the bindings generator
Deleted: trunk/Source/WebCore/platform/wince/CursorWinCE.cpp (152565 => 152566)
--- trunk/Source/WebCore/platform/wince/CursorWinCE.cpp 2013-07-11 11:19:20 UTC (rev 152565)
+++ trunk/Source/WebCore/platform/wince/CursorWinCE.cpp 2013-07-11 11:43:53 UTC (rev 152566)
@@ -1,109 +0,0 @@
-/*
- * Copyright (C) 2008-2009 Torch Mobile Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#include "config.h"
-#include "Cursor.h"
-
-namespace WebCore {
-
-struct AllCursors {
- AllCursors()
- {
- for (int i = 0; i < NumCursorTypes; ++i)
- m_cursors[i] = (CursorType) i;
- }
- Cursor m_cursors[NumCursorTypes];
-};
-
-static const Cursor& getCursor(CursorType type)
-{
- static AllCursors allCursors;
- return allCursors.m_cursors[type];
-}
-
-Cursor::Cursor(const Cursor& other)
-: m_platformCursor(other.m_platformCursor)
-{
-}
-
-Cursor::Cursor(Image* img, const IntPoint& hotspot)
-: m_platformCursor(CursorNone)
-{
-}
-
-Cursor::~Cursor()
-{
-}
-
-Cursor& Cursor::operator=(const Cursor& other)
-{
- m_platformCursor = other.m_platformCursor;
- return *this;
-}
-
-Cursor::Cursor(PlatformCursor c)
-: m_platformCursor(c)
-{
-}
-
-const Cursor& noneCursor() { return getCursor(CursorNone); }
-const Cursor& pointerCursor() { return getCursor(CursorPointer); }
-const Cursor& crossCursor() { return getCursor(CursorCross); }
-const Cursor& handCursor() { return getCursor(CursorHand); }
-const Cursor& iBeamCursor() { return getCursor(CursorBeam); }
-const Cursor& waitCursor() { return getCursor(CursorWait); }
-const Cursor& helpCursor() { return getCursor(CursorHelp); }
-const Cursor& moveCursor() { return getCursor(CursorMove); }
-const Cursor& eastResizeCursor() { return getCursor(CursorEastResize); }
-const Cursor& northResizeCursor() { return getCursor(CursorNorthResize); }
-const Cursor& northEastResizeCursor() { return getCursor(CursorNorthEastResize); }
-const Cursor& northWestResizeCursor() { return getCursor(CursorNorthWestResize); }
-const Cursor& southResizeCursor() { return getCursor(CursorSouthResize); }
-const Cursor& southEastResizeCursor() { return getCursor(CursorSouthEastResize); }
-const Cursor& southWestResizeCursor() { return getCursor(CursorSouthWestResize); }
-const Cursor& westResizeCursor() { return getCursor(CursorWestResize); }
-const Cursor& northSouthResizeCursor() { return getCursor(CursorNorthSouthResize); }
-const Cursor& eastWestResizeCursor() { return getCursor(CursorEastWestResize); }
-const Cursor& northEastSouthWestResizeCursor() { return getCursor(CursorNorthEastSouthWestResize); }
-const Cursor& northWestSouthEastResizeCursor() { return getCursor(CursorNorthWestSouthEastResize); }
-const Cursor& columnResizeCursor() { return getCursor(CursorColumnResize); }
-const Cursor& rowResizeCursor() { return getCursor(CursorRowResize); }
-const Cursor& verticalTextCursor() { return getCursor(CursorVerticalText); }
-const Cursor& cellCursor() { return getCursor(CursorCell); }
-const Cursor& contextMenuCursor() { return getCursor(CursorContextMenu); }
-const Cursor& noDropCursor() { return getCursor(CursorNoDrop); }
-const Cursor& notAllowedCursor() { return getCursor(CursorNotAllowed); }
-const Cursor& progressCursor() { return getCursor(CursorProgress); }
-const Cursor& aliasCursor() { return getCursor(CursorAlias); }
-const Cursor& zoomInCursor() { return getCursor(CursorZoomIn); }
-const Cursor& zoomOutCursor() { return getCursor(CursorZoomOut); }
-const Cursor& copyCursor() { return getCursor(CursorCopy); }
-const Cursor& middlePanningCursor() { return crossCursor(); }
-const Cursor& eastPanningCursor() { return crossCursor(); }
-const Cursor& northPanningCursor() { return crossCursor(); }
-const Cursor& northEastPanningCursor() { return crossCursor(); }
-const Cursor& northWestPanningCursor() { return crossCursor(); }
-const Cursor& southPanningCursor() { return crossCursor(); }
-const Cursor& southEastPanningCursor() { return crossCursor(); }
-const Cursor& southWestPanningCursor() { return crossCursor(); }
-const Cursor& westPanningCursor() { return crossCursor(); }
-const Cursor& grabbingCursor() { return moveCursor(); }
-const Cursor& grabCursor() { return moveCursor(); }
-
-} // namespace WebCore
Deleted: trunk/Source/WebCore/platform/wince/PasteboardWinCE.cpp (152565 => 152566)
--- trunk/Source/WebCore/platform/wince/PasteboardWinCE.cpp 2013-07-11 11:19:20 UTC (rev 152565)
+++ trunk/Source/WebCore/platform/wince/PasteboardWinCE.cpp 2013-07-11 11:43:53 UTC (rev 152566)
@@ -1,348 +0,0 @@
-/*
- * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
- * Copyright (C) 2007-2009 Torch Mobile, Inc.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-
-#include "config.h"
-#include "Pasteboard.h"
-
-#include "ClipboardUtilitiesWin.h"
-#include "Document.h"
-#include "DocumentFragment.h"
-#include "Element.h"
-#include "Frame.h"
-#include "HitTestResult.h"
-#include "Image.h"
-#include "KURL.h"
-#include "NotImplemented.h"
-#include "Page.h"
-#include "Range.h"
-#include "RenderImage.h"
-#include "TextEncoding.h"
-#include "WebCoreInstanceHandle.h"
-#include "markup.h"
-#include <wtf/text/CString.h>
-
-namespace WebCore {
-
-static UINT HTMLClipboardFormat = 0;
-static UINT BookmarkClipboardFormat = 0;
-static UINT WebSmartPasteFormat = 0;
-
-extern HDC hScreenDC;
-
-static LRESULT CALLBACK PasteboardOwnerWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
-{
- LRESULT lresult = 0;
- LONG longPtr = GetWindowLong(hWnd, 0);
-
- switch (message) {
- case WM_RENDERFORMAT:
- // This message comes when SetClipboardData was sent a null data handle
- // and now it's come time to put the data on the clipboard.
- break;
- case WM_RENDERALLFORMATS:
- // This message comes when SetClipboardData was sent a null data handle
- // and now this application is about to quit, so it must put data on
- // the clipboard before it exits.
- break;
- case WM_DESTROY:
- break;
- default:
- lresult = DefWindowProc(hWnd, message, wParam, lParam);
- break;
- }
- return lresult;
-}
-
-Pasteboard* Pasteboard::generalPasteboard()
-{
- static Pasteboard* pasteboard = new Pasteboard;
- return pasteboard;
-}
-
-Pasteboard::Pasteboard()
-{
- // make a dummy HWND to be the Windows clipboard's owner
- WNDCLASS wc = {0};
- memset(&wc, 0, sizeof(wc));
- wc.lpfnWndProc = PasteboardOwnerWndProc;
- wc.hInstance = WebCore::instanceHandle();
- wc.lpszClassName = L"PasteboardOwnerWindowClass";
- ::RegisterClass(&wc);
-
- m_owner = ::CreateWindow(L"PasteboardOwnerWindowClass", L"PasteboardOwnerWindow", 0, 0, 0, 0, 0,
- HWND_MESSAGE, 0, 0, 0);
-
- HTMLClipboardFormat = ::RegisterClipboardFormat(L"HTML Format");
- BookmarkClipboardFormat = ::RegisterClipboardFormat(L"UniformResourceLocatorW");
- WebSmartPasteFormat = ::RegisterClipboardFormat(L"WebKit Smart Paste Format");
-}
-
-void Pasteboard::clear()
-{
- if (::OpenClipboard(m_owner)) {
- ::EmptyClipboard();
- ::CloseClipboard();
- }
-}
-
-void Pasteboard::writeSelection(Range* selectedRange, bool canSmartCopyOrDelete, Frame* frame, ShouldSerializeSelectedTextForClipboard shouldSerializeSelectedTextForClipboard)
-{
- clear();
-
- // Put CF_HTML format on the pasteboard
- if (::OpenClipboard(m_owner)) {
- Vector<char> data;
- markupToCF_HTML(createMarkup(selectedRange, 0, AnnotateForInterchange), selectedRange->startContainer()->document()->url(), data);
- HGLOBAL cbData = createGlobalData(data);
- if (!::SetClipboardData(HTMLClipboardFormat, cbData))
- ::GlobalFree(cbData);
- ::CloseClipboard();
- }
-
- // Put plain string on the pasteboard. CF_UNICODETEXT covers CF_TEXT as well
- String str = shouldSerializeSelectedTextForClipboard == IncludeImageAltTextForClipboard ? frame->editor()->selectedTextForClipboard() : frame->editor()->selectedText();
- replaceNewlinesWithWindowsStyleNewlines(str);
- replaceNBSPWithSpace(str);
- if (::OpenClipboard(m_owner)) {
- HGLOBAL cbData = createGlobalData(str);
- if (!::SetClipboardData(CF_UNICODETEXT, cbData))
- ::GlobalFree(cbData);
- ::CloseClipboard();
- }
-
- // enable smart-replacing later on by putting dummy data on the pasteboard
- if (canSmartCopyOrDelete) {
- if (::OpenClipboard(m_owner)) {
- ::SetClipboardData(WebSmartPasteFormat, 0);
- ::CloseClipboard();
- }
- }
-}
-
-void Pasteboard::writePlainText(const String& text, SmartReplaceOption smartReplaceOption)
-{
- clear();
-
- // Put plain string on the pasteboard. CF_UNICODETEXT covers CF_TEXT as well
- String str = text;
- replaceNewlinesWithWindowsStyleNewlines(str);
- if (::OpenClipboard(m_owner)) {
- HGLOBAL cbData = createGlobalData(str);
- if (!::SetClipboardData(CF_UNICODETEXT, cbData))
- ::GlobalFree(cbData);
- ::CloseClipboard();
- }
-
- // enable smart-replacing later on by putting dummy data on the pasteboard
- if (smartReplaceOption == CanSmartReplace) {
- if (::OpenClipboard(m_owner)) {
- ::SetClipboardData(WebSmartPasteFormat, 0);
- ::CloseClipboard();
- }
- }
-}
-
-void Pasteboard::writeURL(const KURL& url, const String& titleStr, Frame* frame)
-{
- ASSERT(!url.isEmpty());
-
- clear();
-
- String title(titleStr);
- if (title.isEmpty()) {
- title = url.lastPathComponent();
- if (title.isEmpty())
- title = url.host();
- }
-
- // write to clipboard in format com.apple.safari.bookmarkdata to be able to paste into the bookmarks view with appropriate title
- if (::OpenClipboard(m_owner)) {
- HGLOBAL cbData = createGlobalData(url, title);
- if (!::SetClipboardData(BookmarkClipboardFormat, cbData))
- ::GlobalFree(cbData);
- ::CloseClipboard();
- }
-
- // write to clipboard in format CF_HTML to be able to paste into contenteditable areas as a link
- if (::OpenClipboard(m_owner)) {
- Vector<char> data;
- markupToCF_HTML(urlToMarkup(url, title), "", data);
- HGLOBAL cbData = createGlobalData(data);
- if (!::SetClipboardData(HTMLClipboardFormat, cbData))
- ::GlobalFree(cbData);
- ::CloseClipboard();
- }
-
- // bare-bones CF_UNICODETEXT support
- if (::OpenClipboard(m_owner)) {
- HGLOBAL cbData = createGlobalData(url.string());
- if (!::SetClipboardData(CF_UNICODETEXT, cbData))
- ::GlobalFree(cbData);
- ::CloseClipboard();
- }
-}
-
-void Pasteboard::writeImage(Node* node, const KURL&, const String&)
-{
- ASSERT(node);
-
- if (!(node->renderer() && node->renderer()->isImage()))
- return;
-
- RenderImage* renderer = static_cast<RenderImage*>(node->renderer());
- CachedImage* cachedImage = static_cast<CachedImage*>(renderer->cachedImage());
- ASSERT(cachedImage);
- Image* image = cachedImage->imageForRenderer(renderer);
- ASSERT(image);
-
- clear();
-
- RefPtr<SharedBitmap> sourceBmp = image->nativeImageForCurrentFrame();
- if (!sourceBmp)
- return;
-
- IntRect rect(0, 0, sourceBmp->width(), sourceBmp->height());
- BitmapInfo bmpInfo;
- void* pixels;
- HBITMAP resultBitmap = sourceBmp->clipBitmap(rect, true, bmpInfo, pixels);
- if (!resultBitmap)
- return;
-
- if (::OpenClipboard(m_owner)) {
- ::SetClipboardData(CF_BITMAP, resultBitmap);
- ::CloseClipboard();
- } else
- DeleteObject(resultBitmap);
-}
-
-void Pasteboard::writeClipboard(Clipboard*)
-{
- notImplemented();
-}
-
-bool Pasteboard::canSmartReplace()
-{
- return ::IsClipboardFormatAvailable(WebSmartPasteFormat);
-}
-
-String Pasteboard::plainText(Frame* frame)
-{
- if (::IsClipboardFormatAvailable(CF_UNICODETEXT) && ::OpenClipboard(m_owner)) {
- HANDLE cbData = ::GetClipboardData(CF_UNICODETEXT);
- if (cbData) {
- UChar* buffer = (UChar*)GlobalLock(cbData);
- String fromClipboard(buffer);
- GlobalUnlock(cbData);
- CloseClipboard();
- return fromClipboard;
- } else
- CloseClipboard();
- }
-
- if (::IsClipboardFormatAvailable(CF_TEXT) && ::OpenClipboard(m_owner)) {
- HANDLE cbData = ::GetClipboardData(CF_TEXT);
- if (cbData) {
- char* buffer = (char*)GlobalLock(cbData);
- String fromClipboard(buffer);
- GlobalUnlock(cbData);
- CloseClipboard();
- return fromClipboard;
- } else
- CloseClipboard();
- }
-
- return String();
-}
-
-PassRefPtr<DocumentFragment> Pasteboard::documentFragment(Frame* frame, PassRefPtr<Range> context, bool allowPlainText, bool& chosePlainText)
-{
- chosePlainText = false;
-
- if (::IsClipboardFormatAvailable(HTMLClipboardFormat) && ::OpenClipboard(m_owner)) {
- // get data off of clipboard
- HANDLE cbData = ::GetClipboardData(HTMLClipboardFormat);
- if (cbData) {
- SIZE_T dataSize = ::GlobalSize(cbData);
- String cf_html(UTF8Encoding().decode((char*)GlobalLock(cbData), dataSize));
- GlobalUnlock(cbData);
- CloseClipboard();
-
- PassRefPtr<DocumentFragment> fragment = fragmentFromCF_HTML(frame->document(), cf_html);
- if (fragment)
- return fragment;
- } else
- CloseClipboard();
- }
-
- if (allowPlainText && IsClipboardFormatAvailable(CF_UNICODETEXT)) {
- chosePlainText = true;
- if (OpenClipboard(m_owner)) {
- HANDLE cbData = GetClipboardData(CF_UNICODETEXT);
- if (cbData) {
- UChar* buffer = (UChar*)GlobalLock(cbData);
- String str(buffer);
- GlobalUnlock(cbData);
- CloseClipboard();
- RefPtr<DocumentFragment> fragment = createFragmentFromText(context.get(), str);
- if (fragment)
- return fragment.release();
- } else
- CloseClipboard();
- }
- }
-
- if (allowPlainText && ::IsClipboardFormatAvailable(CF_TEXT)) {
- chosePlainText = true;
- if (::OpenClipboard(m_owner)) {
- HANDLE cbData = ::GetClipboardData(CF_TEXT);
- if (cbData) {
- char* buffer = (char*)GlobalLock(cbData);
- String str(buffer);
- GlobalUnlock(cbData);
- CloseClipboard();
- RefPtr<DocumentFragment> fragment = createFragmentFromText(context.get(), str);
- if (fragment)
- return fragment.release();
- } else
- CloseClipboard();
- }
- }
-
- return 0;
-}
-
-bool Pasteboard::hasData()
-{
- return hasDataInFormat(CF_UNICODETEXT) || hasDataInFormat(CF_TEXT);
-}
-
-bool Pasteboard::hasDataInFormat(unsigned int format)
-{
- return ::IsClipboardFormatAvailable(format);
-}
-
-} // namespace WebCore
Deleted: trunk/Source/WebCore/platform/wince/SearchPopupMenuWinCE.cpp (152565 => 152566)
--- trunk/Source/WebCore/platform/wince/SearchPopupMenuWinCE.cpp 2013-07-11 11:19:20 UTC (rev 152565)
+++ trunk/Source/WebCore/platform/wince/SearchPopupMenuWinCE.cpp 2013-07-11 11:43:53 UTC (rev 152566)
@@ -1,54 +0,0 @@
-/*
- * Copyright (C) 2009 Torch Mobile Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#include "config.h"
-#include "SearchPopupMenu.h"
-
-#include "NotImplemented.h"
-#include <wtf/text/AtomicString.h>
-
-namespace WebCore {
-
-SearchPopupMenu::SearchPopupMenu(PopupMenuClient* client)
-: PopupMenu(client)
-{
-}
-
-bool SearchPopupMenu::enabled()
-{
- return false;
-}
-
-void SearchPopupMenu::saveRecentSearches(const AtomicString& name, const Vector<String>& searchItems)
-{
- if (name.isEmpty())
- return;
-
- notImplemented();
-}
-
-void SearchPopupMenu::loadRecentSearches(const AtomicString& name, Vector<String>& searchItems)
-{
- if (name.isEmpty())
- return;
-
- notImplemented();
-}
-
-} // namespace WebCore