#include "gtkcssimagepaintableprivate.h"
#include "gtkstyleproviderprivate.h"
+#include "gtk/css/gtkcssdataurlprivate.h"
+
G_DEFINE_TYPE (GtkCssImageUrl, _gtk_css_image_url, GTK_TYPE_CSS_IMAGE)
static GtkCssImage *
g_free (resource_path);
g_free (uri);
}
+ else if (g_file_has_uri_scheme (url->file, "data"))
+ {
+ GInputStream *stream;
+ char *uri;
+ GdkPixbuf *pixbuf;
+ GBytes *bytes;
+
+ uri = g_file_get_uri (url->file);
+ texture = NULL;
+
+ bytes = gtk_css_data_url_parse (uri, NULL, &local_error);
+ if (bytes)
+ {
+ stream = g_memory_input_stream_new_from_bytes (bytes);
+ pixbuf = gdk_pixbuf_new_from_stream (stream, NULL, &local_error);
+ g_object_unref (stream);
+ if (pixbuf != NULL)
+ {
+ texture = gdk_texture_new_for_pixbuf (pixbuf);
+ g_object_unref (pixbuf);
+ }
+ }
+
+ g_free (uri);
+ }
else
{
texture = gdk_texture_new_from_file (url->file, &local_error);
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <object class="GtkWindow">
+ <property name="type">popup</property>
+ <child>
+ <object class="GtkPicture">
+ <property name="can-shrink">0</property>
+ <property name="paintable">green-20x20.png</property>
+ </object>
+ </child>
+ </object>
+</interface>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+ <object class="GtkWindow" id="window1">
+ <property name="width_request">20</property>
+ <property name="height_request">20</property>
+ <property name="type">popup</property>
+ </object>
+</interface>
'css-multi-state.css',
'css-multi-state.ref.ui',
'css-multi-state.ui',
+ 'data-url.css',
+ 'data-url.ref.ui',
+ 'data-url.ui',
'fixed-widget-stacking.ref.ui',
'fixed-widget-stacking.ui',
'flipping-icons.ref.ui',