aboutsummaryrefslogtreecommitdiffstats
path: root/src/image.c
diff options
context:
space:
mode:
authorYuan Fu2024-12-01 17:52:16 -0800
committerYuan Fu2024-12-01 17:52:16 -0800
commit4afd1eca3662eda052d0017f83b4baa1f6131e8b (patch)
tree10c2a2f0d338b8fb330fbbc9b21f296271b73ee2 /src/image.c
parent676ff9fd7c083598b2955a463774283768d8e209 (diff)
parentcf4f1387a6561be7cd7387b766df4386a0fa472f (diff)
downloademacs-4afd1eca3662eda052d0017f83b4baa1f6131e8b.tar.gz
emacs-4afd1eca3662eda052d0017f83b4baa1f6131e8b.zip
Merge from emacs-30
cf4f1387a65 ; Update tree-sitter manual 3c7687c1dd1 Allow passing nil to treesit-node-match-p (bug#74612) 748b19e56e8 Update to version 2.58 of librsvg API (bug#74606) 4c67f636c08 Fix decoding of non-ASCII email attachments bd8a6f70fb9 Prevent "Selecting deleted buffer" error with dabbrev-expand 0a753603a53 ; (dictionary-search-interface): Fix bug#74511.
Diffstat (limited to 'src/image.c')
-rw-r--r--src/image.c26
1 files changed, 23 insertions, 3 deletions
diff --git a/src/image.c b/src/image.c
index db7f6acd171..88b0f91413e 100644
--- a/src/image.c
+++ b/src/image.c
@@ -11706,7 +11706,11 @@ DEF_DLL_FN (void, rsvg_handle_get_dimensions,
11706DEF_DLL_FN (gboolean, rsvg_handle_set_stylesheet, 11706DEF_DLL_FN (gboolean, rsvg_handle_set_stylesheet,
11707 (RsvgHandle *, const guint8 *, gsize, GError **)); 11707 (RsvgHandle *, const guint8 *, gsize, GError **));
11708# endif 11708# endif
11709# if LIBRSVG_CHECK_VERSION (2, 58, 0)
11710DEF_DLL_FN (GdkPixbuf *, rsvg_handle_get_pixbuf_and_error, (RsvgHandle *, GError **));
11711# else
11709DEF_DLL_FN (GdkPixbuf *, rsvg_handle_get_pixbuf, (RsvgHandle *)); 11712DEF_DLL_FN (GdkPixbuf *, rsvg_handle_get_pixbuf, (RsvgHandle *));
11713# endif
11710DEF_DLL_FN (int, gdk_pixbuf_get_width, (const GdkPixbuf *)); 11714DEF_DLL_FN (int, gdk_pixbuf_get_width, (const GdkPixbuf *));
11711DEF_DLL_FN (int, gdk_pixbuf_get_height, (const GdkPixbuf *)); 11715DEF_DLL_FN (int, gdk_pixbuf_get_height, (const GdkPixbuf *));
11712DEF_DLL_FN (guchar *, gdk_pixbuf_get_pixels, (const GdkPixbuf *)); 11716DEF_DLL_FN (guchar *, gdk_pixbuf_get_pixels, (const GdkPixbuf *));
@@ -11765,8 +11769,11 @@ init_svg_functions (void)
11765#if LIBRSVG_CHECK_VERSION (2, 48, 0) 11769#if LIBRSVG_CHECK_VERSION (2, 48, 0)
11766 LOAD_DLL_FN (library, rsvg_handle_set_stylesheet); 11770 LOAD_DLL_FN (library, rsvg_handle_set_stylesheet);
11767#endif 11771#endif
11772#if LIBRSVG_CHECK_VERSION (2, 58, 0)
11773 LOAD_DLL_FN (library, rsvg_handle_get_pixbuf_and_error);
11774#else
11768 LOAD_DLL_FN (library, rsvg_handle_get_pixbuf); 11775 LOAD_DLL_FN (library, rsvg_handle_get_pixbuf);
11769 11776#endif
11770 LOAD_DLL_FN (gdklib, gdk_pixbuf_get_width); 11777 LOAD_DLL_FN (gdklib, gdk_pixbuf_get_width);
11771 LOAD_DLL_FN (gdklib, gdk_pixbuf_get_height); 11778 LOAD_DLL_FN (gdklib, gdk_pixbuf_get_height);
11772 LOAD_DLL_FN (gdklib, gdk_pixbuf_get_pixels); 11779 LOAD_DLL_FN (gdklib, gdk_pixbuf_get_pixels);
@@ -11811,7 +11818,11 @@ init_svg_functions (void)
11811# if LIBRSVG_CHECK_VERSION (2, 48, 0) 11818# if LIBRSVG_CHECK_VERSION (2, 48, 0)
11812# undef rsvg_handle_set_stylesheet 11819# undef rsvg_handle_set_stylesheet
11813# endif 11820# endif
11814# undef rsvg_handle_get_pixbuf 11821# if LIBRSVG_CHECK_VERSION (2, 58, 0)
11822# undef rsvg_handle_get_pixbuf_and_error
11823# else
11824# undef rsvg_handle_get_pixbuf
11825# endif
11815# if LIBRSVG_CHECK_VERSION (2, 32, 0) 11826# if LIBRSVG_CHECK_VERSION (2, 32, 0)
11816# undef g_file_new_for_path 11827# undef g_file_new_for_path
11817# undef g_memory_input_stream_new_from_data 11828# undef g_memory_input_stream_new_from_data
@@ -11852,7 +11863,11 @@ init_svg_functions (void)
11852# if LIBRSVG_CHECK_VERSION (2, 48, 0) 11863# if LIBRSVG_CHECK_VERSION (2, 48, 0)
11853# define rsvg_handle_set_stylesheet fn_rsvg_handle_set_stylesheet 11864# define rsvg_handle_set_stylesheet fn_rsvg_handle_set_stylesheet
11854# endif 11865# endif
11855# define rsvg_handle_get_pixbuf fn_rsvg_handle_get_pixbuf 11866# if LIBRSVG_CHECK_VERSION (2, 58, 0)
11867# define rsvg_handle_get_pixbuf_and_error fn_rsvg_handle_get_pixbuf_and_error
11868# else
11869# define rsvg_handle_get_pixbuf fn_rsvg_handle_get_pixbuf
11870# endif
11856# if LIBRSVG_CHECK_VERSION (2, 32, 0) 11871# if LIBRSVG_CHECK_VERSION (2, 32, 0)
11857# define g_file_new_for_path fn_g_file_new_for_path 11872# define g_file_new_for_path fn_g_file_new_for_path
11858# define g_memory_input_stream_new_from_data \ 11873# define g_memory_input_stream_new_from_data \
@@ -12357,8 +12372,13 @@ svg_load_image (struct frame *f, struct image *img, char *contents,
12357 12372
12358 /* We can now get a valid pixel buffer from the svg file, if all 12373 /* We can now get a valid pixel buffer from the svg file, if all
12359 went ok. */ 12374 went ok. */
12375#if LIBRSVG_CHECK_VERSION (2, 58, 0)
12376 pixbuf = rsvg_handle_get_pixbuf_and_error (rsvg_handle, &err);
12377 if (err) goto rsvg_error;
12378#else
12360 pixbuf = rsvg_handle_get_pixbuf (rsvg_handle); 12379 pixbuf = rsvg_handle_get_pixbuf (rsvg_handle);
12361 if (!pixbuf) goto rsvg_error; 12380 if (!pixbuf) goto rsvg_error;
12381#endif
12362 g_object_unref (rsvg_handle); 12382 g_object_unref (rsvg_handle);
12363 xfree (wrapped_contents); 12383 xfree (wrapped_contents);
12364 12384