Commit Graph

21 Commits

Author SHA1 Message Date
Matthias Clasen
0fe468c789 Emit an error if image loading fails
Instead of spamming stderr with g_warning, use the new
emit_error method of the GtkStyleProviderPrivate interface
to emit an error if loading an image fails.
2016-01-30 00:29:04 -05:00
Benjamin Otte
da25771e58 cssvalue: Remove GtkCssDependencies
They are not used anymore.
2015-03-18 15:23:31 +01:00
Benjamin Otte
1116914ea0 css: Move scale to GtkStyleProviderPrivate
This way, we can remove it as a separate argument from
gtk_css_value_compute() and allow computation to only depend on one
thing: the style provider.
2015-02-06 11:26:31 +01:00
Benjamin Otte
572f46067f cssstyle: Rename GtkCssComputedValues => GtkCssStyle
This is literally just renaming of the object (and the associated source
files). No other changes are in there.
2015-01-07 14:26:46 +01:00
Benjamin Otte
20696b1057 cssimage: Report filename of file failing to load 2013-09-18 17:07:41 +02:00
Alexander Larsson
af2c40bd54 css: Add a scale argument to css-value compute vfunc
We need to be able to compute different GtkCssImage values
depending on the scale, and we need this at compute time so that
we don't need to read any images other than the scale in used (to
e.g. calculate the image size). GtkStyleProviderPrivate is shared
for all style contexts, so its not right.
2013-07-03 14:39:25 +02:00
Benjamin Otte
e6b3cbe7d2 cssimage: Only load image data when needed
Saves ~6MB of memory per application in the Adwaita I am using - at
least until the app starts using all the images in the theme, because
the code doesn't discard images yet once they were loaded.

https://bugzilla.gnome.org/show_bug.cgi?id=692934
2013-02-02 01:44:17 +01:00
Benjamin Otte
b2e1b1124f cssimage: Add a getter
This will be needed in the next commit.

https://bugzilla.gnome.org/show_bug.cgi?id=692934
2013-02-02 01:44:13 +01:00
Benjamin Otte
e3cd958e36 cssimage: Return the loaded image from compute()
This way, we don't keep the indirection when actually rendering the
image.

https://bugzilla.gnome.org/show_bug.cgi?id=692934
2013-02-02 01:43:37 +01:00
Benjamin Otte
18ca907c4c css: Split out GtkCssImageSurface
This is essentially a GtkCssImage for a cairo_surface_t and is a pretty
much straight up copy of GtkCssImageUrl. But we want to implement lazy
loading and animations, so GtkCssImageUrl is going to gain new
features...

https://bugzilla.gnome.org/show_bug.cgi?id=692934
2013-02-02 01:43:30 +01:00
Benjamin Otte
6348ded15d cssimage: Store the URI we're loaded from
I'd like to use it when printing the value, but I haven't found a way to
do that sanely yet, as I'd need to be able to print relative paths for
make check to work (otherwise the srcdir would blow things up). And we
use a GString to output to, so there's no way to attach a base dir to
that.

If anyone has an idea how to achieve that, poke me. Having the real
filename in debug prints sounds like a very good idea to me.

https://bugzilla.gnome.org/show_bug.cgi?id=692934
2013-02-02 01:42:48 +01:00
Benjamin Otte
c9f01ffb43 cssimage: No need to pass base file anymore
The file is now part of the GtkCssParser
2012-05-11 16:42:12 +02:00
Benjamin Otte
e1317268a3 cssparser: Change APIs that work with files
Now that we keep track of the parser's file, we don't require it to be
passed anymore.
2012-05-11 16:42:12 +02:00
Javier Jardón
9d0febc9a6 Change FSF Address 2012-02-27 17:06:11 +00:00
Alexander Larsson
cb625d21b4 Fix leak when parsing image urls 2012-02-06 15:06:29 +01:00
Alexander Larsson
6b2f10321f Remove accidental leftover spew 2012-02-03 16:27:32 +01:00
Alexander Larsson
610ea728b2 Special case resource pixbuf files loading
This means we can share the pixbuf data when using GdkPixdata
images in the resource.
2012-02-03 15:51:55 +01:00
Alexander Larsson
e46971306a Ensure we can load images via resource:// uris from CSS 2012-01-16 14:19:19 +01:00
Paolo Borelli
9ad78370eb Destroy cairo context after painting css image url 2012-01-14 11:52:48 +01:00
Cosimo Cecchi
d1f3fe4342 parser: remove a duplicate copy of gtk_css_parse_url()
Move the function to gtkcssparser.c and use it in both places.
2012-01-13 17:55:53 -05:00
Benjamin Otte
11ec705133 css: Add image implementation for urls 2012-01-09 18:37:56 +01:00