[GTK] Rename WebContextMenuItemGtk as WebContextMenuItemGlib
authorcarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 17 Jun 2017 07:21:03 +0000 (07:21 +0000)
committercarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 17 Jun 2017 07:21:03 +0000 (07:21 +0000)
https://bugs.webkit.org/show_bug.cgi?id=173469

Reviewed by Michael Catanzaro.

Now that we switched to GAction this is actually a glib implementation, we keep the GtkAction support only for
backwards compatibility. We could rename the file and make the GtkAction action conditional to the GTK+ port.

* PlatformGTK.cmake:
* Shared/glib/WebContextMenuItemGlib.cpp: Renamed from Source/WebKit2/Shared/gtk/WebContextMenuItemGtk.cpp.
(WebKit::gtkStockIDFromContextMenuAction):
(WebKit::WebContextMenuItemGlib::WebContextMenuItemGlib):
(WebKit::WebContextMenuItemGlib::~WebContextMenuItemGlib):
(WebKit::WebContextMenuItemGlib::buildActionName):
(WebKit::WebContextMenuItemGlib::createActionIfNeeded):
* Shared/glib/WebContextMenuItemGlib.h: Renamed from Source/WebKit2/Shared/gtk/WebContextMenuItemGtk.h.
* UIProcess/API/gtk/WebKitContextMenu.cpp:
(webkitContextMenuPopulate):
* UIProcess/API/gtk/WebKitContextMenuActions.cpp:
(webkitContextMenuActionGetForContextMenuItem):
* UIProcess/API/gtk/WebKitContextMenuActionsPrivate.h:
* UIProcess/API/gtk/WebKitContextMenuItem.cpp:
(webkitContextMenuItemCreate):
(webkitContextMenuItemToWebContextMenuItemGlib):
(webkit_context_menu_item_new):
(webkit_context_menu_item_new_from_gaction):
(webkit_context_menu_item_new_from_stock_action):
(webkit_context_menu_item_new_from_stock_action_with_label):
(webkit_context_menu_item_new_with_submenu):
(webkit_context_menu_item_new_separator):
* UIProcess/API/gtk/WebKitContextMenuItemPrivate.h:
* UIProcess/API/gtk/WebKitContextMenuPrivate.h:
* UIProcess/API/gtk/WebKitWebView.cpp:
(webkitWebViewPopulateContextMenu):
* UIProcess/gtk/WebContextMenuProxyGtk.cpp:
(WebKit::WebContextMenuProxyGtk::append):
(WebKit::WebContextMenuProxyGtk::buildMenu):
(WebKit::WebContextMenuProxyGtk::populate):
* UIProcess/gtk/WebContextMenuProxyGtk.h:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@218445 268f45cc-cd09-0410-ab3c-d52691b4dbfc

13 files changed:
Source/WebKit2/ChangeLog
Source/WebKit2/PlatformGTK.cmake
Source/WebKit2/Shared/glib/WebContextMenuItemGlib.cpp [moved from Source/WebKit2/Shared/gtk/WebContextMenuItemGtk.cpp with 85% similarity]
Source/WebKit2/Shared/glib/WebContextMenuItemGlib.h [moved from Source/WebKit2/Shared/gtk/WebContextMenuItemGtk.h with 71% similarity]
Source/WebKit2/UIProcess/API/gtk/WebKitContextMenu.cpp
Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuActions.cpp
Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuActionsPrivate.h
Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuItem.cpp
Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuItemPrivate.h
Source/WebKit2/UIProcess/API/gtk/WebKitContextMenuPrivate.h
Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp
Source/WebKit2/UIProcess/gtk/WebContextMenuProxyGtk.cpp
Source/WebKit2/UIProcess/gtk/WebContextMenuProxyGtk.h

index 7c626ec..9b3d74e 100644 (file)
@@ -1,3 +1,45 @@
+2017-06-17  Carlos Garcia Campos  <cgarcia@igalia.com>
+
+        [GTK] Rename WebContextMenuItemGtk as WebContextMenuItemGlib
+        https://bugs.webkit.org/show_bug.cgi?id=173469
+
+        Reviewed by Michael Catanzaro.
+
+        Now that we switched to GAction this is actually a glib implementation, we keep the GtkAction support only for
+        backwards compatibility. We could rename the file and make the GtkAction action conditional to the GTK+ port.
+
+        * PlatformGTK.cmake:
+        * Shared/glib/WebContextMenuItemGlib.cpp: Renamed from Source/WebKit2/Shared/gtk/WebContextMenuItemGtk.cpp.
+        (WebKit::gtkStockIDFromContextMenuAction):
+        (WebKit::WebContextMenuItemGlib::WebContextMenuItemGlib):
+        (WebKit::WebContextMenuItemGlib::~WebContextMenuItemGlib):
+        (WebKit::WebContextMenuItemGlib::buildActionName):
+        (WebKit::WebContextMenuItemGlib::createActionIfNeeded):
+        * Shared/glib/WebContextMenuItemGlib.h: Renamed from Source/WebKit2/Shared/gtk/WebContextMenuItemGtk.h.
+        * UIProcess/API/gtk/WebKitContextMenu.cpp:
+        (webkitContextMenuPopulate):
+        * UIProcess/API/gtk/WebKitContextMenuActions.cpp:
+        (webkitContextMenuActionGetForContextMenuItem):
+        * UIProcess/API/gtk/WebKitContextMenuActionsPrivate.h:
+        * UIProcess/API/gtk/WebKitContextMenuItem.cpp:
+        (webkitContextMenuItemCreate):
+        (webkitContextMenuItemToWebContextMenuItemGlib):
+        (webkit_context_menu_item_new):
+        (webkit_context_menu_item_new_from_gaction):
+        (webkit_context_menu_item_new_from_stock_action):
+        (webkit_context_menu_item_new_from_stock_action_with_label):
+        (webkit_context_menu_item_new_with_submenu):
+        (webkit_context_menu_item_new_separator):
+        * UIProcess/API/gtk/WebKitContextMenuItemPrivate.h:
+        * UIProcess/API/gtk/WebKitContextMenuPrivate.h:
+        * UIProcess/API/gtk/WebKitWebView.cpp:
+        (webkitWebViewPopulateContextMenu):
+        * UIProcess/gtk/WebContextMenuProxyGtk.cpp:
+        (WebKit::WebContextMenuProxyGtk::append):
+        (WebKit::WebContextMenuProxyGtk::buildMenu):
+        (WebKit::WebContextMenuProxyGtk::populate):
+        * UIProcess/gtk/WebContextMenuProxyGtk.h:
+
 2017-06-16  Dan Bernstein  <mitz@apple.com>
 
         [Cocoa] Some declarations have missing or incorrect availability attributes
index f21fb0c..6730386 100644 (file)
@@ -74,6 +74,7 @@ list(APPEND WebKit2_SOURCES
 
     Shared/cairo/ShareableBitmapCairo.cpp
 
+    Shared/glib/WebContextMenuItemGlib.cpp
     Shared/glib/WebErrorsGlib.cpp
 
     Shared/gtk/ArgumentCodersGtk.cpp
@@ -83,7 +84,6 @@ list(APPEND WebKit2_SOURCES
     Shared/gtk/NativeWebWheelEventGtk.cpp
     Shared/gtk/PrintInfoGtk.cpp
     Shared/gtk/ProcessExecutablePathGtk.cpp
-    Shared/gtk/WebContextMenuItemGtk.cpp
     Shared/gtk/WebErrorsGtk.cpp
     Shared/gtk/WebEventFactory.cpp
     Shared/gtk/WebSelectionData.cpp
  */
 
 #include "config.h"
-#include "WebContextMenuItemGtk.h"
+#include "WebContextMenuItemGlib.h"
 
+#include "APIObject.h"
+#include <gio/gio.h>
+
+#if PLATFORM(GTK)
 #include <gtk/gtk.h>
-#include <wtf/glib/GUniquePtr.h>
+#endif
 
 using namespace WebCore;
 
 namespace WebKit {
 
+#if PLATFORM(GTK)
 static const char* gtkStockIDFromContextMenuAction(ContextMenuAction action)
 {
     switch (action) {
@@ -66,7 +71,7 @@ static const char* gtkStockIDFromContextMenuAction(ContextMenuAction action)
     case ContextMenuItemTagSelectAll:
         return GTK_STOCK_SELECT_ALL;
     case ContextMenuItemTagSpellingGuess:
-        return 0;
+        return nullptr;
     case ContextMenuItemTagIgnoreSpelling:
         return GTK_STOCK_NO;
     case ContextMenuItemTagLearnSpelling:
@@ -110,41 +115,36 @@ static const char* gtkStockIDFromContextMenuAction(ContextMenuAction action)
     case ContextMenuItemTagToggleMediaLoop:
     case ContextMenuItemTagCopyImageUrlToClipboard:
         // No icon for this.
-        return 0;
+        return nullptr;
     case ContextMenuItemTagEnterVideoFullscreen:
         return GTK_STOCK_FULLSCREEN;
     default:
-        return 0;
+        return nullptr;
     }
 }
+#endif // PLATFORM(GTK)
 
-WebContextMenuItemGtk::WebContextMenuItemGtk(ContextMenuItemType type, ContextMenuAction action, const String& title, bool enabled, bool checked)
+WebContextMenuItemGlib::WebContextMenuItemGlib(ContextMenuItemType type, ContextMenuAction action, const String& title, bool enabled, bool checked)
     : WebContextMenuItemData(type, action, title, enabled, checked)
 {
     ASSERT(type != SubmenuType);
     createActionIfNeeded();
 }
 
-WebContextMenuItemGtk::WebContextMenuItemGtk(const WebContextMenuItemData& data)
+WebContextMenuItemGlib::WebContextMenuItemGlib(const WebContextMenuItemData& data)
     : WebContextMenuItemData(data.type() == SubmenuType ? ActionType : data.type(), data.action(), data.title(), data.enabled(), data.checked())
 {
     createActionIfNeeded();
 }
 
-WebContextMenuItemGtk::WebContextMenuItemGtk(const WebContextMenuItemGtk& data, Vector<WebContextMenuItemGtk>&& submenu)
+WebContextMenuItemGlib::WebContextMenuItemGlib(const WebContextMenuItemGlib& data, Vector<WebContextMenuItemGlib>&& submenu)
     : WebContextMenuItemData(ActionType, data.action(), data.title(), data.enabled(), false)
 {
     m_gAction = data.gAction();
-    m_gtkAction = data.gtkAction();
     m_submenuItems = WTFMove(submenu);
-}
-
-WebContextMenuItemGtk::WebContextMenuItemGtk(GtkAction* action)
-    : WebContextMenuItemData(GTK_IS_TOGGLE_ACTION(action) ? CheckableActionType : ActionType, ContextMenuItemBaseApplicationTag, String::fromUTF8(gtk_action_get_label(action)), gtk_action_get_sensitive(action), GTK_IS_TOGGLE_ACTION(action) ? gtk_toggle_action_get_active(GTK_TOGGLE_ACTION(action)) : false)
-{
-    m_gtkAction = action;
-    createActionIfNeeded();
-    g_object_set_data_full(G_OBJECT(m_gAction.get()), "webkit-gtk-action", g_object_ref(m_gtkAction), g_object_unref);
+#if PLATFORM(GTK)
+    m_gtkAction = data.gtkAction();
+#endif
 }
 
 static bool isGActionChecked(GAction* action)
@@ -157,7 +157,7 @@ static bool isGActionChecked(GAction* action)
     return g_variant_get_boolean(state.get());
 }
 
-WebContextMenuItemGtk::WebContextMenuItemGtk(GAction* action, const String& title, GVariant* target)
+WebContextMenuItemGlib::WebContextMenuItemGlib(GAction* action, const String& title, GVariant* target)
     : WebContextMenuItemData(g_action_get_state_type(action) ? CheckableActionType : ActionType, ContextMenuItemBaseApplicationTag, title, g_action_get_enabled(action), isGActionChecked(action))
     , m_gAction(action)
     , m_gActionTarget(target)
@@ -165,22 +165,38 @@ WebContextMenuItemGtk::WebContextMenuItemGtk(GAction* action, const String& titl
     createActionIfNeeded();
 }
 
-WebContextMenuItemGtk::~WebContextMenuItemGtk()
+#if PLATFORM(GTK)
+WebContextMenuItemGlib::WebContextMenuItemGlib(GtkAction* action)
+    : WebContextMenuItemData(GTK_IS_TOGGLE_ACTION(action) ? CheckableActionType : ActionType, ContextMenuItemBaseApplicationTag, String::fromUTF8(gtk_action_get_label(action)), gtk_action_get_sensitive(action), GTK_IS_TOGGLE_ACTION(action) ? gtk_toggle_action_get_active(GTK_TOGGLE_ACTION(action)) : false)
+{
+    m_gtkAction = action;
+    createActionIfNeeded();
+    g_object_set_data_full(G_OBJECT(m_gAction.get()), "webkit-gtk-action", g_object_ref(m_gtkAction), g_object_unref);
+}
+#endif
+
+WebContextMenuItemGlib::~WebContextMenuItemGlib()
+{
+}
+
+GUniquePtr<char> WebContextMenuItemGlib::buildActionName() const
 {
+#if PLATFORM(GTK)
+    if (m_gtkAction)
+        return GUniquePtr<char>(g_strdup(gtk_action_get_name(m_gtkAction)));
+#endif
+
+    static uint64_t actionID = 0;
+    return GUniquePtr<char>(g_strdup_printf("action-%" PRIu64, ++actionID));
 }
 
-void WebContextMenuItemGtk::createActionIfNeeded()
+void WebContextMenuItemGlib::createActionIfNeeded()
 {
     if (type() == SeparatorType)
         return;
 
-    static uint64_t actionID = 0;
     if (!m_gAction) {
-        GUniquePtr<char> actionName;
-        if (m_gtkAction)
-            actionName.reset(g_strdup(gtk_action_get_name(m_gtkAction)));
-        else
-            actionName.reset(g_strdup_printf("action-%" PRIu64, ++actionID));
+        auto actionName = buildActionName();
         if (type() == CheckableActionType)
             m_gAction = adoptGRef(G_ACTION(g_simple_action_new_stateful(actionName.get(), nullptr, g_variant_new_boolean(checked()))));
         else
@@ -188,6 +204,7 @@ void WebContextMenuItemGtk::createActionIfNeeded()
         g_simple_action_set_enabled(G_SIMPLE_ACTION(m_gAction.get()), enabled());
     }
 
+#if PLATFORM(GTK)
     // Create the GtkAction for backwards compatibility only.
     if (!m_gtkAction) {
         if (type() == CheckableActionType) {
@@ -200,6 +217,7 @@ void WebContextMenuItemGtk::createActionIfNeeded()
     }
 
     g_signal_connect_object(m_gAction.get(), "activate", G_CALLBACK(gtk_action_activate), m_gtkAction, G_CONNECT_SWAPPED);
+#endif
 }
 
 } // namespace WebKit
  * THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-#ifndef WebContextMenuItemGtk_h
-#define WebContextMenuItemGtk_h
+#pragma once
 
-#include "APIObject.h"
 #include "WebContextMenuItemData.h"
 #include <wtf/glib/GRefPtr.h>
+#include <wtf/glib/GUniquePtr.h>
 
 typedef struct _GtkAction GtkAction;
 typedef struct _GAction GAction;
 
 namespace WebKit {
 
-class WebContextMenuItemGtk : public WebContextMenuItemData {
+class WebContextMenuItemGlib final : public WebContextMenuItemData {
     WTF_MAKE_FAST_ALLOCATED;
 public:
-    WebContextMenuItemGtk(WebCore::ContextMenuItemType, WebCore::ContextMenuAction, const String& title, bool enabled = true, bool checked = false);
-    WebContextMenuItemGtk(const WebContextMenuItemData&);
-    WebContextMenuItemGtk(const WebContextMenuItemGtk&, Vector<WebContextMenuItemGtk>&& submenu);
-    WebContextMenuItemGtk(GtkAction*);
-    WebContextMenuItemGtk(GAction*, const String& title, GVariant* target = nullptr);
-    ~WebContextMenuItemGtk();
+    WebContextMenuItemGlib(WebCore::ContextMenuItemType, WebCore::ContextMenuAction, const String& title, bool enabled = true, bool checked = false);
+    WebContextMenuItemGlib(const WebContextMenuItemData&);
+    WebContextMenuItemGlib(const WebContextMenuItemGlib&, Vector<WebContextMenuItemGlib>&& submenu);
+    WebContextMenuItemGlib(GAction*, const String& title, GVariant* target = nullptr);
+#if PLATFORM(GTK)
+    WebContextMenuItemGlib(GtkAction*);
+#endif
+    ~WebContextMenuItemGlib();
 
     // We don't use the SubmenuType internally, so check if we have submenu items.
     WebCore::ContextMenuItemType type() const { return m_submenuItems.isEmpty() ? WebContextMenuItemData::type() : WebCore::SubmenuType; }
-    GtkAction* gtkAction() const { return m_gtkAction; }
     GAction* gAction() const { return m_gAction.get(); }
     GVariant* gActionTarget() const { return m_gActionTarget.get(); }
-    const Vector<WebContextMenuItemGtk>& submenuItems() const { return m_submenuItems; }
+    const Vector<WebContextMenuItemGlib>& submenuItems() const { return m_submenuItems; }
+
+#if PLATFORM(GTK)
+    GtkAction* gtkAction() const { return m_gtkAction; }
+#endif
 
 private:
+    GUniquePtr<char> buildActionName() const;
     void createActionIfNeeded();
 
     GRefPtr<GAction> m_gAction;
     GRefPtr<GVariant> m_gActionTarget;
+    Vector<WebContextMenuItemGlib> m_submenuItems;
+#if PLATFORM(GTK)
     GtkAction* m_gtkAction { nullptr };
-    Vector<WebContextMenuItemGtk> m_submenuItems;
+#endif
 };
 
 } // namespace WebKit
-
-#endif // WebContextMenuItemGtk_h
index c43067a..5ca10af 100644 (file)
@@ -77,11 +77,11 @@ void webkitContextMenuPopulate(WebKitContextMenu* menu, Vector<WebContextMenuIte
     }
 }
 
-void webkitContextMenuPopulate(WebKitContextMenu* menu, Vector<WebContextMenuItemGtk>& contextMenuItems)
+void webkitContextMenuPopulate(WebKitContextMenu* menu, Vector<WebContextMenuItemGlib>& contextMenuItems)
 {
     for (GList* item = menu->priv->items; item; item = g_list_next(item)) {
         WebKitContextMenuItem* menuItem = WEBKIT_CONTEXT_MENU_ITEM(item->data);
-        contextMenuItems.append(webkitContextMenuItemToWebContextMenuItemGtk(menuItem));
+        contextMenuItems.append(webkitContextMenuItemToWebContextMenuItemGlib(menuItem));
     }
 }
 
index cf1ddf9..1cbbe55 100644 (file)
@@ -135,7 +135,7 @@ ContextMenuAction webkitContextMenuActionGetActionTag(WebKitContextMenuAction ac
     return ContextMenuItemBaseApplicationTag;
 }
 
-WebKitContextMenuAction webkitContextMenuActionGetForContextMenuItem(const WebKit::WebContextMenuItemGtk& menuItem)
+WebKitContextMenuAction webkitContextMenuActionGetForContextMenuItem(const WebKit::WebContextMenuItemGlib& menuItem)
 {
     switch (menuItem.action()) {
     case ContextMenuItemTagNoAction:
index e00b8e2..dd7e3f0 100644 (file)
  * Boston, MA 02110-1301, USA.
  */
 
-#ifndef WebKitContextMenuActionsPrivate_h
-#define WebKitContextMenuActionsPrivate_h
+#pragma once
 
-#include "WebContextMenuItemGtk.h"
+#include "WebContextMenuItemGlib.h"
 #include "WebKitContextMenuActions.h"
 
 bool webkitContextMenuActionIsCheckable(WebKitContextMenuAction);
 WebCore::ContextMenuAction webkitContextMenuActionGetActionTag(WebKitContextMenuAction);
-WebKitContextMenuAction webkitContextMenuActionGetForContextMenuItem(const WebKit::WebContextMenuItemGtk&);
+WebKitContextMenuAction webkitContextMenuActionGetForContextMenuItem(const WebKit::WebContextMenuItemGlib&);
 String webkitContextMenuActionGetLabel(WebKitContextMenuAction);
-
-#endif // WebKitPrintOperationPrivate_h
index 39e3fb4..944d046 100644 (file)
@@ -22,7 +22,7 @@
 
 #include "APIArray.h"
 #include "WebContextMenuItem.h"
-#include "WebContextMenuItemGtk.h"
+#include "WebContextMenuItemGlib.h"
 #include "WebKitContextMenuActionsPrivate.h"
 #include "WebKitContextMenuItemPrivate.h"
 #include "WebKitContextMenuPrivate.h"
@@ -57,7 +57,7 @@ struct _WebKitContextMenuItemPrivate {
             webkitContextMenuSetParentItem(subMenu.get(), 0);
     }
 
-    std::unique_ptr<WebContextMenuItemGtk> menuItem;
+    std::unique_ptr<WebContextMenuItemGlib> menuItem;
     GRefPtr<WebKitContextMenu> subMenu;
 };
 
@@ -95,7 +95,7 @@ WebKitContextMenuItem* webkitContextMenuItemCreate(const WebContextMenuItemData&
 {
     WebKitContextMenuItem* item = WEBKIT_CONTEXT_MENU_ITEM(g_object_new(WEBKIT_TYPE_CONTEXT_MENU_ITEM, NULL));
 
-    item->priv->menuItem = std::make_unique<WebContextMenuItemGtk>(itemData);
+    item->priv->menuItem = std::make_unique<WebContextMenuItemGlib>(itemData);
     const Vector<WebContextMenuItemData>& subMenu = itemData.submenu();
     if (!subMenu.isEmpty())
         webkitContextMenuItemSetSubMenu(item, adoptGRef(webkitContextMenuCreate(subMenu)));
@@ -103,12 +103,12 @@ WebKitContextMenuItem* webkitContextMenuItemCreate(const WebContextMenuItemData&
     return item;
 }
 
-WebContextMenuItemGtk webkitContextMenuItemToWebContextMenuItemGtk(WebKitContextMenuItem* item)
+WebContextMenuItemGlib webkitContextMenuItemToWebContextMenuItemGlib(WebKitContextMenuItem* item)
 {
     if (item->priv->subMenu) {
-        Vector<WebContextMenuItemGtk> subMenuItems;
+        Vector<WebContextMenuItemGlib> subMenuItems;
         webkitContextMenuPopulate(item->priv->subMenu.get(), subMenuItems);
-        return WebContextMenuItemGtk(*item->priv->menuItem, WTFMove(subMenuItems));
+        return WebContextMenuItemGlib(*item->priv->menuItem, WTFMove(subMenuItems));
     }
 
     return *item->priv->menuItem;
@@ -140,7 +140,7 @@ WebKitContextMenuItem* webkit_context_menu_item_new(GtkAction* action)
     g_return_val_if_fail(GTK_IS_ACTION(action), nullptr);
 
     WebKitContextMenuItem* item = WEBKIT_CONTEXT_MENU_ITEM(g_object_new(WEBKIT_TYPE_CONTEXT_MENU_ITEM, nullptr));
-    item->priv->menuItem = std::make_unique<WebContextMenuItemGtk>(action);
+    item->priv->menuItem = std::make_unique<WebContextMenuItemGlib>(action);
 
     return item;
 }
@@ -166,7 +166,7 @@ WebKitContextMenuItem* webkit_context_menu_item_new_from_gaction(GAction* action
     g_return_val_if_fail(!target || g_variant_is_of_type(target, g_action_get_parameter_type(action)), nullptr);
 
     WebKitContextMenuItem* item = WEBKIT_CONTEXT_MENU_ITEM(g_object_new(WEBKIT_TYPE_CONTEXT_MENU_ITEM, nullptr));
-    item->priv->menuItem = std::make_unique<WebContextMenuItemGtk>(action, String::fromUTF8(label), target);
+    item->priv->menuItem = std::make_unique<WebContextMenuItemGlib>(action, String::fromUTF8(label), target);
 
     return item;
 }
@@ -193,7 +193,7 @@ WebKitContextMenuItem* webkit_context_menu_item_new_from_stock_action(WebKitCont
 
     WebKitContextMenuItem* item = WEBKIT_CONTEXT_MENU_ITEM(g_object_new(WEBKIT_TYPE_CONTEXT_MENU_ITEM, nullptr));
     ContextMenuItemType type = webkitContextMenuActionIsCheckable(action) ? CheckableActionType : ActionType;
-    item->priv->menuItem = std::make_unique<WebContextMenuItemGtk>(type, webkitContextMenuActionGetActionTag(action), webkitContextMenuActionGetLabel(action));
+    item->priv->menuItem = std::make_unique<WebContextMenuItemGlib>(type, webkitContextMenuActionGetActionTag(action), webkitContextMenuActionGetLabel(action));
 
     return item;
 }
@@ -215,7 +215,7 @@ WebKitContextMenuItem* webkit_context_menu_item_new_from_stock_action_with_label
 
     WebKitContextMenuItem* item = WEBKIT_CONTEXT_MENU_ITEM(g_object_new(WEBKIT_TYPE_CONTEXT_MENU_ITEM, nullptr));
     ContextMenuItemType type = webkitContextMenuActionIsCheckable(action) ? CheckableActionType : ActionType;
-    item->priv->menuItem = std::make_unique<WebContextMenuItemGtk>(type, webkitContextMenuActionGetActionTag(action), String::fromUTF8(label));
+    item->priv->menuItem = std::make_unique<WebContextMenuItemGlib>(type, webkitContextMenuActionGetActionTag(action), String::fromUTF8(label));
 
     return item;
 }
@@ -238,7 +238,7 @@ WebKitContextMenuItem* webkit_context_menu_item_new_with_submenu(const gchar* la
         return nullptr;
 
     WebKitContextMenuItem* item = WEBKIT_CONTEXT_MENU_ITEM(g_object_new(WEBKIT_TYPE_CONTEXT_MENU_ITEM, nullptr));
-    item->priv->menuItem = std::make_unique<WebContextMenuItemGtk>(ActionType, ContextMenuItemBaseApplicationTag, String::fromUTF8(label));
+    item->priv->menuItem = std::make_unique<WebContextMenuItemGlib>(ActionType, ContextMenuItemBaseApplicationTag, String::fromUTF8(label));
     item->priv->subMenu = submenu;
     webkitContextMenuSetParentItem(submenu, item);
 
@@ -255,7 +255,7 @@ WebKitContextMenuItem* webkit_context_menu_item_new_with_submenu(const gchar* la
 WebKitContextMenuItem* webkit_context_menu_item_new_separator(void)
 {
     WebKitContextMenuItem* item = WEBKIT_CONTEXT_MENU_ITEM(g_object_new(WEBKIT_TYPE_CONTEXT_MENU_ITEM, nullptr));
-    item->priv->menuItem = std::make_unique<WebContextMenuItemGtk>(SeparatorType, ContextMenuItemTagNoAction, String());
+    item->priv->menuItem = std::make_unique<WebContextMenuItemGlib>(SeparatorType, ContextMenuItemTagNoAction, String());
 
     return item;
 }
index c49a9ce..63f6a37 100644 (file)
@@ -19,9 +19,9 @@
 
 #pragma once
 
-#include "WebContextMenuItemGtk.h"
+#include "WebContextMenuItemGlib.h"
 #include "WebKitContextMenuItem.h"
 
 WebKitContextMenuItem* webkitContextMenuItemCreate(const WebKit::WebContextMenuItemData&);
-WebKit::WebContextMenuItemGtk webkitContextMenuItemToWebContextMenuItemGtk(WebKitContextMenuItem*);
+WebKit::WebContextMenuItemGlib webkitContextMenuItemToWebContextMenuItemGlib(WebKitContextMenuItem*);
 WebKit::WebContextMenuItemData webkitContextMenuItemToWebContextMenuItemData(WebKitContextMenuItem*);
index e8f647f..e9926ec 100644 (file)
 
 #pragma once
 
-#include "WebContextMenuItemGtk.h"
+#include "WebContextMenuItemGlib.h"
 #include "WebKitContextMenu.h"
 
 WebKitContextMenu* webkitContextMenuCreate(const Vector<WebKit::WebContextMenuItemData>&);
-void webkitContextMenuPopulate(WebKitContextMenu*, Vector<WebKit::WebContextMenuItemGtk>&);
+void webkitContextMenuPopulate(WebKitContextMenu*, Vector<WebKit::WebContextMenuItemGlib>&);
 void webkitContextMenuPopulate(WebKitContextMenu*, Vector<WebKit::WebContextMenuItemData>&);
 void webkitContextMenuSetParentItem(WebKitContextMenu*, WebKitContextMenuItem*);
 WebKitContextMenuItem* webkitContextMenuGetParentItem(WebKitContextMenu*);
index 6786f49..1066f73 100644 (file)
@@ -2182,7 +2182,7 @@ void webkitWebViewPopulateContextMenu(WebKitWebView* webView, const Vector<WebCo
     if (returnValue)
         return;
 
-    Vector<WebContextMenuItemGtk> contextMenuItems;
+    Vector<WebContextMenuItemGlib> contextMenuItems;
     webkitContextMenuPopulate(contextMenu.get(), contextMenuItems);
     contextMenuProxy->populate(contextMenuItems);
 
index 06398ba..59d3a30 100644 (file)
@@ -62,7 +62,7 @@ static void contextMenuItemActivatedCallback(GAction* action, GVariant*, WebPage
     page->contextMenuItemSelected(item);
 }
 
-void WebContextMenuProxyGtk::append(GMenu* menu, const WebContextMenuItemGtk& menuItem)
+void WebContextMenuProxyGtk::append(GMenu* menu, const WebContextMenuItemGlib& menuItem)
 {
     unsigned long signalHandlerId;
     GRefPtr<GMenuItem> gMenuItem;
@@ -102,7 +102,7 @@ void WebContextMenuProxyGtk::append(GMenu* menu, const WebContextMenuItemGtk& me
     g_menu_append_item(menu, gMenuItem.get());
 }
 
-GRefPtr<GMenu> WebContextMenuProxyGtk::buildMenu(const Vector<WebContextMenuItemGtk>& items)
+GRefPtr<GMenu> WebContextMenuProxyGtk::buildMenu(const Vector<WebContextMenuItemGlib>& items)
 {
     GRefPtr<GMenu> menu = adoptGRef(g_menu_new());
     GMenu* sectionMenu = menu.get();
@@ -118,7 +118,7 @@ GRefPtr<GMenu> WebContextMenuProxyGtk::buildMenu(const Vector<WebContextMenuItem
     return menu;
 }
 
-void WebContextMenuProxyGtk::populate(const Vector<WebContextMenuItemGtk>& items)
+void WebContextMenuProxyGtk::populate(const Vector<WebContextMenuItemGlib>& items)
 {
     GRefPtr<GMenu> menu = buildMenu(items);
     gtk_menu_shell_bind_model(GTK_MENU_SHELL(m_menu), G_MENU_MODEL(menu.get()), nullptr, TRUE);
@@ -134,7 +134,7 @@ void WebContextMenuProxyGtk::populate(const Vector<RefPtr<WebContextMenuItem>>&
             g_menu_append_section(menu.get(), nullptr, G_MENU_MODEL(section.get()));
             sectionMenu = section.get();
         } else {
-            WebContextMenuItemGtk menuitem(item->data());
+            WebContextMenuItemGlib menuitem(item->data());
             append(sectionMenu, menuitem);
         }
     }
index 9f46b5d..3a4f34d 100644 (file)
@@ -28,7 +28,7 @@
 
 #if ENABLE(CONTEXT_MENUS)
 
-#include "WebContextMenuItemGtk.h"
+#include "WebContextMenuItemGlib.h"
 #include "WebContextMenuProxy.h"
 #include <WebCore/IntPoint.h>
 #include <wtf/HashMap.h>
@@ -50,15 +50,15 @@ public:
     }
     ~WebContextMenuProxyGtk();
 
-    void populate(const Vector<WebContextMenuItemGtk>&);
+    void populate(const Vector<WebContextMenuItemGlib>&);
     GtkMenu* gtkMenu() const { return m_menu; }
 
 private:
     WebContextMenuProxyGtk(GtkWidget*, WebPageProxy&, const ContextMenuContextData&, const UserData&);
     void show() override;
     void showContextMenuWithItems(const Vector<WebContextMenuItemData>&) override;
-    void append(GMenu*, const WebContextMenuItemGtk&);
-    GRefPtr<GMenu> buildMenu(const Vector<WebContextMenuItemGtk>&);
+    void append(GMenu*, const WebContextMenuItemGlib&);
+    GRefPtr<GMenu> buildMenu(const Vector<WebContextMenuItemGlib>&);
     void populate(const Vector<RefPtr<WebContextMenuItem>>&);
     static void menuPositionFunction(GtkMenu*, gint*, gint*, gboolean*, WebContextMenuProxyGtk*);