+
+
+G_MODULE_EXPORT void fill_vtable(GdkPixbufModule* module);
+void fill_vtable(GdkPixbufModule* module) {
+ module->load = gdk_pixbuf_from_svg_file_stream;
+}
+
+G_MODULE_EXPORT void fill_info(GdkPixbufFormat *info);
+void fill_info(GdkPixbufFormat* info) {
+ /* Borrowed from librsvg-2.40.21 */
+ static const GdkPixbufModulePattern signature[] = {
+ { " <svg", "* ", 100 },
+ { " <!DOCTYPE svg", "* ", 100 },
+ { NULL, NULL, 0 }
+ };
+
+ /* I'm not sure if we should support gzipped svg here? */
+ static const gchar *mime_types[] = {
+ "image/svg+xml",
+ "image/svg",
+ "image/svg-xml",
+ "image/vnd.adobe.svg+xml",
+ "text/xml-svg",
+ "image/svg+xml-compressed",
+ NULL
+ };
+
+ static const gchar *extensions[] = {
+ "svg",
+ "svgz",
+ "svg.gz",
+ NULL
+ };
+
+ info->name = "svg";
+ info->signature = (GdkPixbufModulePattern*) signature;
+ info->description = "Scalable Vector Graphics";
+ info->mime_types = (gchar**) mime_types;
+ info->extensions = (gchar**) extensions;
+ info->flags = GDK_PIXBUF_FORMAT_SCALABLE;
+ info->license = "AGPL3";
+}
+