Skip to content
  • carlosgc@webkit.org's avatar
    [GTK] Implement unicode submenu items · d45765cb
    carlosgc@webkit.org authored
    https://bugs.webkit.org/show_bug.cgi?id=81117
    
    Reviewed by Martin Robinson.
    
    Source/WebCore:
    
    * loader/EmptyClients.h:
    (WebCore::EmptyEditorClient::shouldShowUnicodeMenu): Just return
    false.
    * page/ContextMenuController.cpp:
    (WebCore::insertUnicodeCharacter): Helper function to insert a
    unicode character.
    (WebCore::ContextMenuController::contextMenuItemSelected):
    Implement unicode menu items using insertUnicodeCharacter() to
    insert the apropriate unicode character.
    (WebCore::ContextMenuController::createAndAppendUnicodeSubMenu):
    Create the unicode submenu.
    (WebCore::ContextMenuController::populate): Add unicode submenu
    item for editable content.
    (WebCore::ContextMenuController::checkOrEnableIfNeeded): Add
    unicode submenu items to the switch.
    * page/ContextMenuController.h:
    * page/EditorClient.h:
    (EditorClient): Add shouldShowUnicodeMenu() for GTK platform.
    * platform/ContextMenuItem.h:
    * platform/LocalizedStrings.h:
    * platform/gtk/LocalizedStringsGtk.cpp:
    (WebCore::contextMenuItemTagUnicodeInsertLRMMark): Add localized
    string for the unicode menu item.
    (WebCore::contextMenuItemTagUnicodeInsertRLMMark): Ditto.
    (WebCore::contextMenuItemTagUnicodeInsertLREMark): Ditto.
    (WebCore::contextMenuItemTagUnicodeInsertRLEMark): Ditto.
    (WebCore::contextMenuItemTagUnicodeInsertLROMark): Ditto.
    (WebCore::contextMenuItemTagUnicodeInsertRLOMark): Ditto.
    (WebCore::contextMenuItemTagUnicodeInsertPDFMark): Ditto.
    (WebCore::contextMenuItemTagUnicodeInsertZWSMark): Ditto.
    (WebCore::contextMenuItemTagUnicodeInsertZWJMark): Ditto.
    (WebCore::contextMenuItemTagUnicodeInsertZWNJMark): Ditto.
    
    Source/WebKit/gtk:
    
    * WebCoreSupport/ContextMenuClientGtk.cpp:
    (WebKit::getUnicodeMenuItemPosition): Helper function to get the
    position of the unicode menu item in the default context menu.
    (WebKit::ContextMenuClient::getCustomMenuFromDefaultItems): Remove
    code to build the unicode menu, since it's now built by WebCore.
    * WebCoreSupport/EditorClientGtk.cpp:
    (WebKit::EditorClient::shouldShowUnicodeMenu): Check whether
    unicode menu should be shown based on gtk-show-unicode-menu GtkSetting.
    * WebCoreSupport/EditorClientGtk.h:
    
    Source/WebKit2:
    
    * WebProcess/WebCoreSupport/WebEditorClient.h:
    * WebProcess/WebCoreSupport/gtk/WebEditorClientGtk.cpp:
    (WebKit::WebEditorClient::shouldShowUnicodeMenu): Implement
    shouldShowUnicodeMenu() returning always true. When ContextMenu
    API is implemented for GTK+ the UI process will decide whether to
    show the unicode menu or not.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@110865 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    d45765cb