WebCore:
authorbdakin <bdakin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 2 Dec 2006 02:35:12 +0000 (02:35 +0000)
committerbdakin <bdakin@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 2 Dec 2006 02:35:12 +0000 (02:35 +0000)
commit71533f21c82d59196f9a4ce6c2c719c05c41ac91
treed5b66c228648f442c3de5ef4d9f20cc73a9c48e1
parent6cbc5d4b1f19eb22918a23f4967d01f865582483
WebCore:
        Reviewed by Adam.

        Support for sub-menus in WebCore context menus. This also re-
        architects the ContextMenuItem class so that it is more like
        ContextMenu in that the class is now really just a wrapper for the
        platformDescription

        * WebCore.exp:
        * WebCore.xcodeproj/project.pbxproj:
        * page/ContextMenuController.cpp:
        (WebCore::ContextMenuController::contextMenuItemSelected): Add
        place-holders for new tags for the sub-menu items. I will flesh
        these out in a separate check-in.
        * platform/ContextMenu.cpp:
        (WebCore::createFontSubMenu):
        (WebCore::createSpellingAndGrammarSubMenu):
        (WebCore::createSpellingSubMenu):
        (WebCore::createSpeechSubMenu):
        (WebCore::createWritingDirectionSubMenu):
        (WebCore::ContextMenu::populate): Call the above functions to add
        the appropriate sub-menus to editing context menus.
        * platform/ContextMenu.h:
        * platform/ContextMenuItem.h:
        (WebCore::): New tags in the ContextMenuAction enumeration.
        (WebCore::ContextMenuItem::parentMenu):
        (WebCore::ContextMenuItem::setType):
        * platform/PlatformMenuDescription.h: Added. This defines
        PlatformMenuDesciption. It needs to be its own header because we
       have to include it from ContextMenu.h and ContextMenuItem.h
        * platform/mac/ContextMenuItemMac.mm: Lots of adjustments here to
        make this class basically just be a wrapper for NSMenuItem.
        (WebCore::ContextMenuItem::ContextMenuItem):
        (WebCore::ContextMenuItem::~ContextMenuItem):
        (WebCore::ContextMenuItem::platformDescription):
        (WebCore::ContextMenuItem::action):
        (WebCore::ContextMenuItem::title):
        (WebCore::ContextMenuItem::platformSubMenu):
        (WebCore::ContextMenuItem::setAction):
        (WebCore::ContextMenuItem::setTitle):
        (WebCore::ContextMenuItem::setSubMenu):
        * platform/mac/ContextMenuMac.mm:
        (WebCore::ContextMenu::ContextMenu):
        (WebCore::getNSMenuItem): Now we only have to get the
        platformDescription of the ContextMenuItem and then set its target
        and action.
        (WebCore::ContextMenu::itemCount):

WebKit:
        Reviewed by Adam.

        Changes to support sub-menus in WebCore ContextMenus.

        * WebCoreSupport/WebContextMenuClient.mm:
        (WebContextMenuClient::contextMenuItemSelected):
        ContextMenuItem::menu() is now called parentMenu()
        * WebView/WebUIDelegatePrivate.h: New not-yet-API tags.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@17984 268f45cc-cd09-0410-ab3c-d52691b4dbfc
13 files changed:
WebCore/ChangeLog
WebCore/WebCore.exp
WebCore/WebCore.xcodeproj/project.pbxproj
WebCore/page/ContextMenuController.cpp
WebCore/platform/ContextMenu.cpp
WebCore/platform/ContextMenu.h
WebCore/platform/ContextMenuItem.h
WebCore/platform/PlatformMenuDescription.h [new file with mode: 0644]
WebCore/platform/mac/ContextMenuItemMac.mm
WebCore/platform/mac/ContextMenuMac.mm
WebKit/ChangeLog
WebKit/WebCoreSupport/WebContextMenuClient.mm
WebKit/WebView/WebUIDelegatePrivate.h