Commit d371891d authored by paroga@webkit.org's avatar paroga@webkit.org

2010-12-29 Patrick Gansterer <paroga@webkit.org>

        Unreviewed build fix for WinCE after r73802.

        Reapply parts from r72585:
        Port ContextMenuWin.cpp to WinCE
        https://bugs.webkit.org/show_bug.cgi?id=48408

        * CMakeLists.txt:
        * platform/ContextMenu.h:
        * platform/win/ContextMenuWin.cpp:
        (WebCore::ContextMenu::getContextMenuItems):
        (WebCore::ContextMenu::createNativeMenuFromItems):
2010-12-29  Patrick Gansterer  <paroga@webkit.org>

        Unreviewed build fix for WinCE after r73802.

        * WebCoreSupport/ContextMenuClientWinCE.cpp:
        (WebKit::ContextMenuClientWinCE::customizeMenu):
        * WebCoreSupport/ContextMenuClientWinCE.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@74742 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 09f5ab6f
......@@ -1288,6 +1288,8 @@ SET(WebCore_SOURCES
page/animation/KeyframeAnimation.cpp
platform/Arena.cpp
platform/ContextMenu.cpp
platform/ContextMenuItem.cpp
platform/ContentType.cpp
platform/CrossThreadCopier.cpp
platform/DeprecatedPtrListImpl.cpp
......
2010-12-29 Patrick Gansterer <paroga@webkit.org>
Unreviewed build fix for WinCE after r73802.
Reapply parts from r72585:
Port ContextMenuWin.cpp to WinCE
https://bugs.webkit.org/show_bug.cgi?id=48408
* CMakeLists.txt:
* platform/ContextMenu.h:
* platform/win/ContextMenuWin.cpp:
(WebCore::ContextMenu::getContextMenuItems):
(WebCore::ContextMenu::createNativeMenuFromItems):
2010-12-29 Kent Hansen <kent.hansen@nokia.com>
Reviewed by Simon Hausmann.
......
......@@ -30,6 +30,7 @@
#include "Frame.h"
#include "FrameView.h"
#include "Node.h"
#include "NotImplemented.h"
#include <tchar.h>
#include <windows.h>
#include <wtf/Vector.h>
......@@ -51,6 +52,9 @@ ContextMenu::ContextMenu(HMENU menu)
void ContextMenu::getContextMenuItems(HMENU menu, Vector<ContextMenuItem>& items)
{
#if OS(WINCE)
notImplemented();
#else
int count = ::GetMenuItemCount(menu);
if (count <= 0)
return;
......@@ -76,6 +80,7 @@ void ContextMenu::getContextMenuItems(HMENU menu, Vector<ContextMenuItem>& items
if (::GetMenuItemInfo(menu, i, TRUE, &info))
items.append(ContextMenuItem(info));
}
#endif
}
HMENU ContextMenu::createNativeMenuFromItems(const Vector<ContextMenuItem>& items)
......@@ -87,6 +92,31 @@ HMENU ContextMenu::createNativeMenuFromItems(const Vector<ContextMenuItem>& item
MENUITEMINFO menuItem = item.nativeMenuItem();
#if OS(WINCE)
UINT flags = MF_BYPOSITION;
UINT newItem = 0;
LPCWSTR title = 0;
if (item.type() == SeparatorType)
flags |= MF_SEPARATOR;
else {
flags |= MF_STRING;
flags |= item.checked() ? MF_CHECKED : MF_UNCHECKED;
flags |= item.enabled() ? MF_ENABLED : MF_GRAYED;
title = menuItem.dwTypeData;
menuItem.dwTypeData = 0;
if (menuItem.hSubMenu) {
flags |= MF_POPUP;
newItem = reinterpret_cast<UINT>(menuItem.hSubMenu);
menuItem.hSubMenu = 0;
} else
newItem = menuItem.wID;
}
::InsertMenuW(menu, i, flags, newItem, title);
#else
// ContextMenuItem::nativeMenuItem doesn't set the title of the MENUITEMINFO to make the
// lifetime handling easier for callers.
String itemTitle = item.title();
......@@ -97,6 +127,7 @@ HMENU ContextMenu::createNativeMenuFromItems(const Vector<ContextMenuItem>& item
}
::InsertMenuItem(menu, i, TRUE, &menuItem);
#endif
}
return menu;
......
2010-12-29 Patrick Gansterer <paroga@webkit.org>
Unreviewed build fix for WinCE after r73802.
* WebCoreSupport/ContextMenuClientWinCE.cpp:
(WebKit::ContextMenuClientWinCE::customizeMenu):
* WebCoreSupport/ContextMenuClientWinCE.h:
2010-12-22 Sam Weinig <sam@webkit.org>
Reviewed by Darin Adler.
......
......@@ -42,9 +42,9 @@ void ContextMenuClientWinCE::contextMenuDestroyed()
delete this;
}
PlatformMenuDescription ContextMenuClientWinCE::getCustomMenuFromDefaultItems(ContextMenu* menu)
PassOwnPtr<ContextMenu> ContextMenuClientWinCE::customizeMenu(PassOwnPtr<ContextMenu> menu)
{
return menu->releasePlatformDescription();
return menu;
}
void ContextMenuClientWinCE::contextMenuItemSelected(ContextMenuItem*, const ContextMenu*)
......
......@@ -37,7 +37,7 @@ public:
virtual void contextMenuDestroyed();
virtual WebCore::PlatformMenuDescription getCustomMenuFromDefaultItems(WebCore::ContextMenu*);
virtual PassOwnPtr<WebCore::ContextMenu> customizeMenu(PassOwnPtr<WebCore::ContextMenu>);
virtual void contextMenuItemSelected(WebCore::ContextMenuItem*, const WebCore::ContextMenu*);
virtual void downloadURL(const WebCore::KURL&);
......
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