aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/image.c26
-rw-r--r--src/treesit.c5
2 files changed, 27 insertions, 4 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
diff --git a/src/treesit.c b/src/treesit.c
index 5e1e9b01059..2372944e166 100644
--- a/src/treesit.c
+++ b/src/treesit.c
@@ -4148,7 +4148,8 @@ PREDICATE can be a symbol representing a thing in
4148`treesit-thing-settings', or a predicate, like regexp matching node 4148`treesit-thing-settings', or a predicate, like regexp matching node
4149type, etc. See `treesit-thing-settings' for more details. 4149type, etc. See `treesit-thing-settings' for more details.
4150 4150
4151Return non-nil if NODE matches PREDICATE, nil otherwise. 4151Return non-nil if NODE matches PREDICATE, nil otherwise. If NODE is
4152nil, return nil.
4152 4153
4153Signals `treesit-invalid-predicate' if there's no definition of THING 4154Signals `treesit-invalid-predicate' if there's no definition of THING
4154in `treesit-thing-settings', or if PREDICATE is malformed. If 4155in `treesit-thing-settings', or if PREDICATE is malformed. If
@@ -4156,6 +4157,8 @@ IGNORE-MISSING is non-nil, don't signal an error for missing THING
4156definition, but still signal for malformed PREDICATE. */) 4157definition, but still signal for malformed PREDICATE. */)
4157 (Lisp_Object node, Lisp_Object predicate, Lisp_Object ignore_missing) 4158 (Lisp_Object node, Lisp_Object predicate, Lisp_Object ignore_missing)
4158{ 4159{
4160 if (NILP (node)) return Qnil;
4161
4159 CHECK_TS_NODE (node); 4162 CHECK_TS_NODE (node);
4160 4163
4161 Lisp_Object parser = XTS_NODE (node)->parser; 4164 Lisp_Object parser = XTS_NODE (node)->parser;