Commit d6b8e53a authored by staikos@webkit.org's avatar staikos@webkit.org

2009-07-30 Yong Li <yong.li@torchmobile.com>

        Reviewed by George Staikos.

        WINCE PORT: some files modified to build for WINCE
        https://bugs.webkit.org/show_bug.cgi?id=27816


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@46591 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 12821597
2009-07-30 Yong Li <yong.li@torchmobile.com>
Reviewed by George Staikos.
WINCE PORT: some files modified to build for WINCE
https://bugs.webkit.org/show_bug.cgi?id=27816
* accessibility/AccessibilityObject.h:
* page/win/EventHandlerWin.cpp:
(WebCore::EventHandler::createDraggingClipboard):
* platform/win/PlatformMouseEventWin.cpp:
(WebCore::messageToEventType):
(WebCore::PlatformMouseEvent::PlatformMouseEvent):
* platform/win/PlatformScreenWin.cpp:
(WebCore::deviceInfoForWidget):
(WebCore::screenIsMonochrome):
* platform/win/PopupMenuWin.cpp:
(WebCore::PopupMenu::show):
(WebCore::PopupMenu::paint):
(WebCore::registerPopup):
(WebCore::PopupWndProc):
2009-07-30 Yong Li <yong.li@torchmobile.com>
Reviewed by George Staikos.
......
......@@ -40,7 +40,7 @@
#if PLATFORM(MAC)
#include <wtf/RetainPtr.h>
#elif PLATFORM(WIN)
#elif PLATFORM(WIN) && !PLATFORM(WINCE)
#include "AccessibilityObjectWrapperWin.h"
#include "COMPtr.h"
#elif PLATFORM(CHROMIUM)
......@@ -428,7 +428,7 @@ protected:
#if PLATFORM(MAC)
RetainPtr<AccessibilityObjectWrapper> m_wrapper;
#elif PLATFORM(WIN)
#elif PLATFORM(WIN) && !PLATFORM(WINCE)
COMPtr<AccessibilityObjectWrapper> m_wrapper;
#elif PLATFORM(GTK)
AtkObject* m_wrapper;
......
/*
* Copyright (C) 2006, 2007, 2008 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
......@@ -87,9 +88,13 @@ bool EventHandler::eventActivatedView(const PlatformMouseEvent& event) const
PassRefPtr<Clipboard> EventHandler::createDraggingClipboard() const
{
#if PLATFORM(WINCE)
return 0;
#else
COMPtr<WCDataObject> dataObject;
WCDataObject::createInstance(&dataObject);
return ClipboardWin::create(true, dataObject.get(), ClipboardWritable);
#endif
}
void EventHandler::focusDocumentView()
......
/*
* Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
* Copyright (C) 2007-2008 Torch Mobile Inc.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
......@@ -63,7 +64,9 @@ static MouseEventType messageToEventType(UINT message)
case WM_MBUTTONUP:
return MouseEventReleased;
#if !PLATFORM(WINCE)
case WM_MOUSELEAVE:
#endif
case WM_MOUSEMOVE:
return MouseEventMoved;
......@@ -104,7 +107,9 @@ PlatformMouseEvent::PlatformMouseEvent(HWND hWnd, UINT message, WPARAM wParam, L
m_button = MiddleButton;
break;
case WM_MOUSEMOVE:
#if !PLATFORM(WINCE)
case WM_MOUSELEAVE:
#endif
if (wParam & MK_LBUTTON)
m_button = LeftButton;
else if (wParam & MK_MBUTTON)
......
/*
* Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
* Copyright (C) 2009 Torch Mobile, Inc.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
......@@ -49,12 +50,16 @@ static MONITORINFOEX monitorInfoForWidget(Widget* widget)
static DEVMODE deviceInfoForWidget(Widget* widget)
{
MONITORINFOEX monitorInfo = monitorInfoForWidget(widget);
DEVMODE deviceInfo;
deviceInfo.dmSize = sizeof(DEVMODE);
deviceInfo.dmDriverExtra = 0;
#if PLATFORM(WINCE)
if (!EnumDisplaySettings(0, ENUM_CURRENT_SETTINGS, &deviceInfo))
deviceInfo.dmBitsPerPel = 16;
#else
MONITORINFOEX monitorInfo = monitorInfoForWidget(widget);
EnumDisplaySettings(monitorInfo.szDevice, ENUM_CURRENT_SETTINGS, &deviceInfo);
#endif
return deviceInfo;
}
......@@ -74,8 +79,13 @@ int screenDepthPerComponent(Widget* widget)
bool screenIsMonochrome(Widget* widget)
{
#if PLATFORM(WINCE)
// EnumDisplaySettings doesn't set dmColor in DEVMODE.
return false;
#else
DEVMODE deviceInfo = deviceInfoForWidget(widget);
return deviceInfo.dmColor == DMCOLOR_MONOCHROME;
#endif
}
FloatRect screenRect(Widget* widget)
......
/*
* Copyright (C) 2006, 2007, 2008 Apple Inc. All rights reserved.
* Copyright (C) 2007-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
......@@ -39,6 +40,10 @@
#include "SimpleFontData.h"
#include <tchar.h>
#include <windows.h>
#if PLATFORM(WINCE)
#include <ResDefCE.h>
#define MAKEPOINTS(l) (*((POINTS FAR *)&(l)))
#endif
using std::min;
......@@ -110,7 +115,11 @@ void PopupMenu::show(const IntRect& r, FrameView* v, int index)
if (!m_popup)
return;
#if PLATFORM(WINCE)
::SetWindowLong(m_popup, 0, (LONG)this);
#else
::SetWindowLongPtr(m_popup, 0, (LONG_PTR)this);
#endif
}
if (!m_scrollbar)
......@@ -124,6 +133,7 @@ void PopupMenu::show(const IntRect& r, FrameView* v, int index)
// Determine whether we should animate our popups
// Note: Must use 'BOOL' and 'FALSE' instead of 'bool' and 'false' to avoid stack corruption with SystemParametersInfo
BOOL shouldAnimate = FALSE;
#if !PLATFORM(WINCE)
::SystemParametersInfo(SPI_GETCOMBOBOXANIMATION, 0, &shouldAnimate, 0);
if (shouldAnimate) {
......@@ -138,6 +148,7 @@ void PopupMenu::show(const IntRect& r, FrameView* v, int index)
::AnimateWindow(m_popup, defaultAnimationDuration, AW_SLIDE | slideDirection | AW_ACTIVATE);
}
} else
#endif
::ShowWindow(m_popup, SW_SHOWNORMAL);
::SetCapture(m_popup);
......@@ -452,8 +463,11 @@ void PopupMenu::paint(const IntRect& damageRect, HDC hdc)
}
}
if (!m_bmp) {
#if PLATFORM(WINCE)
BitmapInfo bitmapInfo(true, clientRect().width(), clientRect().height());
#else
BitmapInfo bitmapInfo = BitmapInfo::createBottomUp(clientRect().size());
#endif
void* pixels = 0;
m_bmp = ::CreateDIBSection(m_DC, &bitmapInfo, DIB_RGB_COLORS, &pixels, 0, 0);
if (!m_bmp)
......@@ -584,11 +598,15 @@ static ATOM registerPopup()
if (haveRegisteredWindowClass)
return true;
#if PLATFORM(WINCE)
WNDCLASS wcex;
#else
WNDCLASSEX wcex;
wcex.cbSize = sizeof(WNDCLASSEX);
wcex.hIconSm = 0;
wcex.style = CS_DROPSHADOW;
#endif
wcex.lpfnWndProc = PopupWndProc;
wcex.cbClsExtra = 0;
wcex.cbWndExtra = sizeof(PopupMenu*); // For the PopupMenu pointer
......@@ -598,18 +616,25 @@ static ATOM registerPopup()
wcex.hbrBackground = 0;
wcex.lpszMenuName = 0;
wcex.lpszClassName = kPopupWindowClassName;
wcex.hIconSm = 0;
haveRegisteredWindowClass = true;
#if PLATFORM(WINCE)
return ::RegisterClass(&wcex);
#else
return ::RegisterClassEx(&wcex);
#endif
}
const int smoothScrollAnimationDuration = 5000;
static LRESULT CALLBACK PopupWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
LRESULT lResult = 0;
#if PLATFORM(WINCE)
LONG longPtr = GetWindowLong(hWnd, 0);
#else
LONG_PTR longPtr = GetWindowLongPtr(hWnd, 0);
#endif
PopupMenu* popup = reinterpret_cast<PopupMenu*>(longPtr);
switch (message) {
......@@ -726,7 +751,9 @@ static LRESULT CALLBACK PopupWndProc(HWND hWnd, UINT message, WPARAM wParam, LPA
}
BOOL shouldHotTrack = FALSE;
#if !PLATFORM(WINCE)
::SystemParametersInfo(SPI_GETHOTTRACKING, 0, &shouldHotTrack, 0);
#endif
RECT bounds;
GetClientRect(popup->popupHandle(), &bounds);
......@@ -811,10 +838,12 @@ static LRESULT CALLBACK PopupWndProc(HWND hWnd, UINT message, WPARAM wParam, LPA
lResult = 0;
}
break;
#if !PLATFORM(WINCE)
case WM_PRINTCLIENT:
if (popup)
popup->paint(popup->clientRect(), (HDC)wParam);
break;
#endif
default:
lResult = DefWindowProc(hWnd, message, wParam, lParam);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment