Commit 60fc771a authored by Eli Zaretskii's avatar Eli Zaretskii

Resurrect SVG support on MS-Windows

* src/image.c (syms_of_image) <Qgio> [HAVE_NTGUI]: New DEFSYM.
(init_svg_functions) [LIBRSVG_CHECK_VERSION >= 2.32.0]: Load
g_file_new_for_path and g_memory_input_stream_new_from_data
from libgio, not from libglib.  (Bug#35548)

* lisp/term/w32-win.el (dynamic-library-alist): Add the libgio
DLL.
parent 2581513a
Pipeline #2366 passed with stage
in 63 minutes and 50 seconds
...@@ -279,6 +279,7 @@ See the documentation of `create-fontset-from-fontset-spec' for the format.") ...@@ -279,6 +279,7 @@ See the documentation of `create-fontset-from-fontset-spec' for the format.")
'(svg "librsvg-2-2.dll") '(svg "librsvg-2-2.dll")
'(gdk-pixbuf "libgdk_pixbuf-2.0-0.dll") '(gdk-pixbuf "libgdk_pixbuf-2.0-0.dll")
'(glib "libglib-2.0-0.dll") '(glib "libglib-2.0-0.dll")
'(gio "libgio-2.0-0.dll")
'(gobject "libgobject-2.0-0.dll") '(gobject "libgobject-2.0-0.dll")
(if (>= libgnutls-version 30400) (if (>= libgnutls-version 30400)
'(gnutls "libgnutls-30.dll") '(gnutls "libgnutls-30.dll")
......
...@@ -9336,22 +9336,26 @@ DEF_DLL_FN (void, g_clear_error, (GError **)); ...@@ -9336,22 +9336,26 @@ DEF_DLL_FN (void, g_clear_error, (GError **));
static bool static bool
init_svg_functions (void) init_svg_functions (void)
{ {
HMODULE library, gdklib = NULL, glib = NULL, gobject = NULL; HMODULE library, gdklib = NULL, glib = NULL, gobject = NULL, giolib = NULL;
if (!(glib = w32_delayed_load (Qglib)) if (!(glib = w32_delayed_load (Qglib))
|| !(gobject = w32_delayed_load (Qgobject)) || !(gobject = w32_delayed_load (Qgobject))
# if LIBRSVG_CHECK_VERSION (2, 32, 0)
|| !(giolib = w32_delayed_load (Qgio))
# endif
|| !(gdklib = w32_delayed_load (Qgdk_pixbuf)) || !(gdklib = w32_delayed_load (Qgdk_pixbuf))
|| !(library = w32_delayed_load (Qsvg))) || !(library = w32_delayed_load (Qsvg)))
{ {
if (gdklib) FreeLibrary (gdklib); if (gdklib) FreeLibrary (gdklib);
if (giolib) FreeLibrary (giolib);
if (gobject) FreeLibrary (gobject); if (gobject) FreeLibrary (gobject);
if (glib) FreeLibrary (glib); if (glib) FreeLibrary (glib);
return 0; return 0;
} }
#if LIBRSVG_CHECK_VERSION (2, 32, 0) #if LIBRSVG_CHECK_VERSION (2, 32, 0)
LOAD_DLL_FN (glib, g_file_new_for_path); LOAD_DLL_FN (giolib, g_file_new_for_path);
LOAD_DLL_FN (glib, g_memory_input_stream_new_from_data); LOAD_DLL_FN (giolib, g_memory_input_stream_new_from_data);
LOAD_DLL_FN (library, rsvg_handle_new_from_stream_sync); LOAD_DLL_FN (library, rsvg_handle_new_from_stream_sync);
#else #else
LOAD_DLL_FN (library, rsvg_handle_new); LOAD_DLL_FN (library, rsvg_handle_new);
...@@ -10229,6 +10233,9 @@ non-numeric, there is no explicit limit on the size of images. */); ...@@ -10229,6 +10233,9 @@ non-numeric, there is no explicit limit on the size of images. */);
/* Other libraries used directly by svg code. */ /* Other libraries used directly by svg code. */
DEFSYM (Qgdk_pixbuf, "gdk-pixbuf"); DEFSYM (Qgdk_pixbuf, "gdk-pixbuf");
DEFSYM (Qglib, "glib"); DEFSYM (Qglib, "glib");
# if LIBRSVG_CHECK_VERSION (2, 32, 0)
DEFSYM (Qgio, "gio");
# endif
DEFSYM (Qgobject, "gobject"); DEFSYM (Qgobject, "gobject");
#endif /* HAVE_NTGUI */ #endif /* HAVE_NTGUI */
#endif /* HAVE_RSVG */ #endif /* HAVE_RSVG */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment