Changeset 246374 in webkit


Ignore:
Timestamp:
Jun 12, 2019 1:43:36 PM (5 years ago)
Author:
commit-queue@webkit.org
Message:

[GTK] GTK_STOCK_* types have been deprecated since GTK 3.10
https://bugs.webkit.org/show_bug.cgi?id=198787

Patch by Ludovico de Nittis <ludovico.denittis@collabora.com> on 2019-06-12
Reviewed by Michael Catanzaro.

Source/WebCore:

No behaviour changes.

  • platform/graphics/gtk/IconGtk.cpp:

(WebCore::lookupIconName):

  • platform/graphics/gtk/ImageGtk.cpp:

(WebCore::loadMissingImageIconFromTheme):

Source/WebKit:

We completely remove the gtkStockIDFromContextMenuAction function in order to get rid of the stock items.
This function was used only in "createActionIfNeeded" where now we pass a nullptr as a stock_id variable.

  • Shared/glib/WebContextMenuItemGlib.cpp:

(WebKit::gtkStockIDFromContextMenuAction):

Location:
trunk/Source
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r246367 r246374  
     12019-06-12  Ludovico de Nittis  <ludovico.denittis@collabora.com>
     2
     3        [GTK] GTK_STOCK_* types have been deprecated since GTK 3.10
     4        https://bugs.webkit.org/show_bug.cgi?id=198787
     5
     6        Reviewed by Michael Catanzaro.
     7
     8        No behaviour changes.
     9
     10        * platform/graphics/gtk/IconGtk.cpp:
     11        (WebCore::lookupIconName):
     12        * platform/graphics/gtk/ImageGtk.cpp:
     13        (WebCore::loadMissingImageIconFromTheme):
     14
    1152019-06-12  Antti Koivisto  <antti@apple.com>
    216
  • trunk/Source/WebCore/platform/graphics/gtk/IconGtk.cpp

    r216833 r246374  
    8787            return iconName;
    8888    }
    89     return GTK_STOCK_FILE;
     89    return "text-x-generic";
    9090}
    9191
  • trunk/Source/WebCore/platform/graphics/gtk/ImageGtk.cpp

    r243163 r246374  
    6565    int iconSize = g_str_has_suffix(name, "@2x") ? 32 : 16;
    6666    auto icon = BitmapImage::create();
    67     GUniquePtr<GtkIconInfo> iconInfo(gtk_icon_theme_lookup_icon(gtk_icon_theme_get_default(), GTK_STOCK_MISSING_IMAGE, iconSize, GTK_ICON_LOOKUP_NO_SVG));
     67    GUniquePtr<GtkIconInfo> iconInfo(gtk_icon_theme_lookup_icon(gtk_icon_theme_get_default(), "image-missing", iconSize, GTK_ICON_LOOKUP_NO_SVG));
    6868    if (iconInfo) {
    6969        auto buffer = loadResourceSharedBuffer(gtk_icon_info_get_filename(iconInfo.get()));
  • trunk/Source/WebKit/ChangeLog

    r246370 r246374  
     12019-06-12  Ludovico de Nittis  <ludovico.denittis@collabora.com>
     2
     3        [GTK] GTK_STOCK_* types have been deprecated since GTK 3.10
     4        https://bugs.webkit.org/show_bug.cgi?id=198787
     5
     6        Reviewed by Michael Catanzaro.
     7
     8        We completely remove the gtkStockIDFromContextMenuAction function in order to get rid of the stock items.
     9        This function was used only in "createActionIfNeeded" where now we pass a nullptr as a stock_id variable.
     10
     11        * Shared/glib/WebContextMenuItemGlib.cpp:
     12        (WebKit::gtkStockIDFromContextMenuAction):
     13
    1142019-06-12  Brent Fulgham  <bfulgham@apple.com>
    215
  • trunk/Source/WebKit/Shared/glib/WebContextMenuItemGlib.cpp

    r228373 r246374  
    3636namespace WebKit {
    3737using namespace WebCore;
    38 
    39 #if PLATFORM(GTK)
    40 static const char* gtkStockIDFromContextMenuAction(ContextMenuAction action)
    41 {
    42     switch (action) {
    43     case ContextMenuItemTagCopyLinkToClipboard:
    44     case ContextMenuItemTagCopyImageToClipboard:
    45     case ContextMenuItemTagCopyMediaLinkToClipboard:
    46     case ContextMenuItemTagCopy:
    47         return GTK_STOCK_COPY;
    48     case ContextMenuItemTagOpenLinkInNewWindow:
    49     case ContextMenuItemTagOpenImageInNewWindow:
    50     case ContextMenuItemTagOpenFrameInNewWindow:
    51     case ContextMenuItemTagOpenMediaInNewWindow:
    52         return GTK_STOCK_OPEN;
    53     case ContextMenuItemTagDownloadLinkToDisk:
    54     case ContextMenuItemTagDownloadImageToDisk:
    55         return GTK_STOCK_SAVE;
    56     case ContextMenuItemTagGoBack:
    57         return GTK_STOCK_GO_BACK;
    58     case ContextMenuItemTagGoForward:
    59         return GTK_STOCK_GO_FORWARD;
    60     case ContextMenuItemTagStop:
    61         return GTK_STOCK_STOP;
    62     case ContextMenuItemTagReload:
    63         return GTK_STOCK_REFRESH;
    64     case ContextMenuItemTagCut:
    65         return GTK_STOCK_CUT;
    66     case ContextMenuItemTagPaste:
    67         return GTK_STOCK_PASTE;
    68     case ContextMenuItemTagDelete:
    69         return GTK_STOCK_DELETE;
    70     case ContextMenuItemTagSelectAll:
    71         return GTK_STOCK_SELECT_ALL;
    72     case ContextMenuItemTagSpellingGuess:
    73         return nullptr;
    74     case ContextMenuItemTagIgnoreSpelling:
    75         return GTK_STOCK_NO;
    76     case ContextMenuItemTagLearnSpelling:
    77         return GTK_STOCK_OK;
    78     case ContextMenuItemTagOther:
    79         return GTK_STOCK_MISSING_IMAGE;
    80     case ContextMenuItemTagSearchInSpotlight:
    81         return GTK_STOCK_FIND;
    82     case ContextMenuItemTagSearchWeb:
    83         return GTK_STOCK_FIND;
    84     case ContextMenuItemTagOpenWithDefaultApplication:
    85         return GTK_STOCK_OPEN;
    86     case ContextMenuItemPDFZoomIn:
    87         return GTK_STOCK_ZOOM_IN;
    88     case ContextMenuItemPDFZoomOut:
    89         return GTK_STOCK_ZOOM_OUT;
    90     case ContextMenuItemPDFAutoSize:
    91         return GTK_STOCK_ZOOM_FIT;
    92     case ContextMenuItemPDFNextPage:
    93         return GTK_STOCK_GO_FORWARD;
    94     case ContextMenuItemPDFPreviousPage:
    95         return GTK_STOCK_GO_BACK;
    96     // New tags, not part of API
    97     case ContextMenuItemTagOpenLink:
    98         return GTK_STOCK_OPEN;
    99     case ContextMenuItemTagCheckSpelling:
    100         return GTK_STOCK_SPELL_CHECK;
    101     case ContextMenuItemTagFontMenu:
    102         return GTK_STOCK_SELECT_FONT;
    103     case ContextMenuItemTagShowFonts:
    104         return GTK_STOCK_SELECT_FONT;
    105     case ContextMenuItemTagBold:
    106         return GTK_STOCK_BOLD;
    107     case ContextMenuItemTagItalic:
    108         return GTK_STOCK_ITALIC;
    109     case ContextMenuItemTagUnderline:
    110         return GTK_STOCK_UNDERLINE;
    111     case ContextMenuItemTagShowColors:
    112         return GTK_STOCK_SELECT_COLOR;
    113     case ContextMenuItemTagToggleMediaControls:
    114     case ContextMenuItemTagToggleMediaLoop:
    115     case ContextMenuItemTagCopyImageUrlToClipboard:
    116         // No icon for this.
    117         return nullptr;
    118     case ContextMenuItemTagEnterVideoFullscreen:
    119         return GTK_STOCK_FULLSCREEN;
    120     default:
    121         return nullptr;
    122     }
    123 }
    124 #endif // PLATFORM(GTK)
    12538
    12639WebContextMenuItemGlib::WebContextMenuItemGlib(ContextMenuItemType type, ContextMenuAction action, const String& title, bool enabled, bool checked)
     
    208121    if (!m_gtkAction) {
    209122        if (type() == CheckableActionType) {
    210             m_gtkAction = GTK_ACTION(gtk_toggle_action_new(g_action_get_name(m_gAction.get()), title().utf8().data(), nullptr, gtkStockIDFromContextMenuAction(action())));
     123            m_gtkAction = GTK_ACTION(gtk_toggle_action_new(g_action_get_name(m_gAction.get()), title().utf8().data(), nullptr, nullptr));
    211124            gtk_toggle_action_set_active(GTK_TOGGLE_ACTION(m_gtkAction), checked());
    212125        } else
    213             m_gtkAction = gtk_action_new(g_action_get_name(m_gAction.get()), title().utf8().data(), 0, gtkStockIDFromContextMenuAction(action()));
     126            m_gtkAction = gtk_action_new(g_action_get_name(m_gAction.get()), title().utf8().data(), 0, nullptr);
    214127        gtk_action_set_sensitive(m_gtkAction, enabled());
    215128        g_object_set_data_full(G_OBJECT(m_gAction.get()), "webkit-gtk-action", m_gtkAction, g_object_unref);
Note: See TracChangeset for help on using the changeset viewer.