st/icon-theme: Remove Win32 compatibility

gnome-shell does not run on Windows, and if someone was crazy enough
to try to make it work, the icon theme support would be the least
of their worries.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2620>
This commit is contained in:
Florian Müllner 2023-01-26 01:41:32 +01:00 committed by Marge Bot
parent 88b26996ec
commit 0919932f4b
2 changed files with 0 additions and 58 deletions

View File

@ -28,9 +28,6 @@
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef G_OS_WIN32
#include <io.h>
#endif
#include <fcntl.h>
#include <sys/types.h>
#include <sys/stat.h>
@ -104,20 +101,6 @@ _gtk_icon_cache_new_for_path (const char *path)
if (fd < 0)
goto done;
#ifdef G_OS_WIN32
/* Bug 660730: _fstat32 is only defined in msvcrt80.dll+/VS 2005+ */
/* or possibly in the msvcrt.dll linked to by the Windows DDK */
/* (will need to check on the Windows DDK part later) */
#if ((_MSC_VER >= 1400 || __MSVCRT_VERSION__ >= 0x0800) || defined (__MINGW64_VERSION_MAJOR)) && !defined(_WIN64)
#undef fstat /* Just in case */
#define fstat _fstat32
#elif defined(__MINGW64_VERSION_MAJOR) && defined(_WIN64)
#undef fstat
#define fstat _fstat64
#endif
#endif
if (fstat (fd, &st) < 0 || st.st_size < 4)
goto done;

View File

@ -19,25 +19,13 @@
#include <sys/types.h>
#include <sys/stat.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <glib.h>
#include <glib/gstdio.h>
#ifdef G_OS_WIN32
#ifndef S_ISDIR
#define S_ISDIR(mode) ((mode)&_S_IFDIR)
#endif
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <shellapi.h>
#include "win32/gdkwin32.h"
#endif /* G_OS_WIN32 */
#include "st-icon-theme.h"
#include "gtkcsspalettevalueprivate.h"
#include "gtkcssrgbavalueprivate.h"
@ -55,11 +43,6 @@
#include "deprecated/gtkstyle.h"
/* this is in case round() is not provided by the compiler,
* such as in the case of C89 compilers, like MSVC
*/
#include "fallback-c89.c"
#define DEFAULT_ICON_THEME "Adwaita"
/**
@ -1768,30 +1751,6 @@ real_choose_icon (GtkIconTheme *icon_theme,
if (unthemed_icon)
break;
}
#ifdef G_OS_WIN32
/* Still not found an icon, check if reference to a Win32 resource */
if (!unthemed_icon)
{
char **resources;
HICON hIcon = NULL;
resources = g_strsplit (icon_names[0], ",", 0);
if (resources[0])
{
wchar_t *wfile = g_utf8_to_utf16 (resources[0], -1, NULL, NULL, NULL);
ExtractIconExW (wfile, resources[1] ? atoi (resources[1]) : 0, &hIcon, NULL, 1);
g_free (wfile);
}
if (hIcon)
{
icon_info = icon_info_new (ICON_THEME_DIR_UNTHEMED, size, 1);
icon_info->cache_pixbuf = gdk_win32_icon_to_pixbuf_libgtk_only (hIcon, NULL, NULL);
DestroyIcon (hIcon);
}
g_strfreev (resources);
}
#endif
if (unthemed_icon)
{