diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog index 5bf1e14d7249435a66409ddaf6ef2f6f960c329d..218634a57b3c374e8b40e93ee3e40fde256c1216 100644 --- a/WebCore/ChangeLog +++ b/WebCore/ChangeLog @@ -1,3 +1,14 @@ +2009-08-12 Yong Li + + Reviewed by Eric Seidel. + + WINCE PORT: implement Cursor for WINCE. There's no real cursor on most + WinMob devices. We pass the cursor info to application, which so that + can determine what to do. + https://bugs.webkit.org/show_bug.cgi?id=27543 + + * platform/wince/CursorWince.cpp: Added. + 2009-08-12 Yong Li Reviewed by George Staikos. diff --git a/WebCore/platform/wince/CursorWince.cpp b/WebCore/platform/wince/CursorWince.cpp new file mode 100644 index 0000000000000000000000000000000000000000..e35f1f9adc072ee03586402515f53aa349c80987 --- /dev/null +++ b/WebCore/platform/wince/CursorWince.cpp @@ -0,0 +1,109 @@ +/* + * 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_impl(other.m_impl) +{ +} + +Cursor::Cursor(Image* img, const IntPoint& hotspot) +: m_impl(CursorNone) +{ +} + +Cursor::~Cursor() +{ +} + +Cursor& Cursor::operator=(const Cursor& other) +{ + m_impl = other.m_impl; + return *this; +} + +Cursor::Cursor(PlatformCursor c) +: m_impl(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(); } + +}