To make the CcBackgroundPaintable fully reusable, it has to know the
desired thumbnail size and the thumbnail factory. We add a width and
height property, and modify the thumbnail retrieval of CcBackgroundItem
to use the scale factor now.
This also allows us to greatly simplify the background sources, so that
they now only do one thing: provide CcBackgroundItems from different
sources.
We keep the fixed thumbnail height and width for the chooser, which
makes more sense now that it is in the chooser code instead of the
background source code.
This is a major rework on how images are loaded and stored.
Unfortunately, this is so entangled that doing each change
as an atomic step is pretty much unfeasible.
The first major change is that BgSource now returns a GListStore
instead of a GtkListStore. This is necessary for us to bind it
to GtkFlowBox, and pretty much signals we're not using any of
the tree/icon views anymore.
Second, the thumbnail factory was moved to BgSource itself. We
only create factories for large thumbnails, so it's not needed
to handle each one of them individually.
At last, switch CcBackgroundChooser to GtkFlowBox, and adjust
the signals we connect to.
We were assuming that setting stock-size would affect the emblems in
GEmblemedIcons, but not the icons themselves. This is a bit weird.
GtkCellRendererPixbuf:gicon is meant to work with
GtkCellRendererPixbuf:stock-size, and this was only working so far
because GTK_ICON_LOOKUP_FORCE_SIZE was not being used when loading
the icon.
Let's composite the emblems ourselves so that we don't have to depend
on this quirky interpretation of stock-size.
Unfortunately, we can not directly use the pixbufs because they are
unaware of the scale factor and GTK+ will scale them on HiDpi
displays. Since our pixbufs already have enough pixels to work well
with such devices, scaling them further will lead to giant, fuzzy
thumbnails. Hence, we use GtkCellRendererPixbuf:surface with the
scale factor codified in it.
https://bugzilla.gnome.org/show_bug.cgi?id=732375
... so that it is possible to override virtual functions and change
the order of the object creation and destruction process without having
to write a bunch of prototypes. Having the class_init below the others
helps us do that.
https://bugzilla.gnome.org/show_bug.cgi?id=731713
This removes an extra g_object_ref when inserting items to GtkListStore:
the list store takes care of incrementing the reference count itself and
the caller doesn't need to do it.
https://bugzilla.gnome.org/show_bug.cgi?id=709453
Now we'd just need gnome-bg to make the jump.
This also fixes unique IDs for the wallpapers source, as
multiple backgrounds can be defined in a single XML file.
It now is a full GObject, will be able to track the original
XML file for a wallpaper, as well as which values are set in it.
This will allow us to restore wallpapers properly, and only offer
editing options when those aren't already hard-coded inside the
item.
Add icon to represent slideshows, always show a name for the
currently set background on startup, show whether a background
is a slideshow, and its pixel size if available.