2011-06-13 Carlos Garcia Campos <cgarcia@igalia.com>
Reviewed by Martin Robinson.
[GTK] Add context menu support for Webkit2
https://bugs.webkit.org/show_bug.cgi?id=54827
* platform/ContextMenuItem.h: Add gtkAction().
* platform/gtk/ContextMenuGtk.cpp:
(WebCore::ContextMenu::ContextMenu): Implement constructor that
receives a platform menu.
(WebCore::ContextMenu::setPlatformDescription): Make sure we don't
destroy the menu if the new context menu is the current one.
(WebCore::contextMenuItemVector): Implement this method to return
the list of menu items in the given context menu, required by WebKit2.
(WebCore::platformMenuDescription): Implement this method to
return a platform menu for the given menu items.
* platform/gtk/ContextMenuItemGtk.cpp:
(WebCore::createPlatformMenuItemDescription): Helper function to
create a platform context menu item.
(WebCore::ContextMenuItem::ContextMenuItem): Use
createPlatformMenuItemDescription().
(WebCore::ContextMenuItem::title): Convert the title from UTF-8.
(WebCore::ContextMenuItem::setTitle): Use gtkAction().
(WebCore::ContextMenuItem::setSubMenu): Implement setSubMenu()
that receives a list of items.
(WebCore::ContextMenuItem::setChecked): Use gtkAction().
(WebCore::ContextMenuItem::checked): Implement this, required by WebKit2.
(WebCore::ContextMenuItem::enabled): Ditto.
(WebCore::ContextMenuItem::setEnabled): Use gtkAction().
(WebCore::ContextMenuItem::gtkAction): Return the GtkAction
associated to the context menu item.
2011-06-13 Carlos Garcia Campos <cgarcia@igalia.com>
Reviewed by Martin Robinson.
[GTK] Add context menu support for Webkit2
https://bugs.webkit.org/show_bug.cgi?id=54827
* GNUmakefile.am: Add new files to compilation.
* UIProcess/API/gtk/PageClientImpl.cpp:
(WebKit::PageClientImpl::createContextMenuProxy): Create a context
menu proxy.
* UIProcess/API/gtk/WebKitWebViewBase.cpp:
(globalPointForClientPoint): Function copied from webkit1 to
convert a point in widget coordinates to global coordinates.
(popupMenuPositionFunction):
(webkitWebViewBaseShowContextMenu): Show the given context menu at
the given position.
* UIProcess/API/gtk/WebKitWebViewBasePrivate.h:
* UIProcess/gtk/WebContextMenuProxyGtk.cpp: Added.
(WebKit::contextMenuItemActivatedCallback):
(WebKit::WebContextMenuProxyGtk::createGtkMenu):
(WebKit::WebContextMenuProxyGtk::showContextMenu):
(WebKit::WebContextMenuProxyGtk::hideContextMenu):
(WebKit::WebContextMenuProxyGtk::WebContextMenuProxyGtk):
(WebKit::WebContextMenuProxyGtk::~WebContextMenuProxyGtk):
* UIProcess/gtk/WebContextMenuProxyGtk.h: Copied from Source/WebKit2/UIProcess/API/gtk/WebKitWebViewBasePrivate.h.
(WebKit::WebContextMenuProxyGtk::create):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@88634
268f45cc-cd09-0410-ab3c-
d52691b4dbfc