If the style didn't include symbolic colors for either success,
warning or error, gtk_icon_info_load_symbolic_for_style() would crash.
Instead, make sure we don't try to use the colors if they're not
available, and fallback on default colors inside
_gtk_icon_info_load_symbolic_internal().
Add gtk_icon_info_load_symbolic() to load symbolic icons, and
theme their background/foreground colours to match the
colours used in the theme.
Adds the gtk_icon_info_load_symbolic() function, explicit
support in GtkImage and GtkCellRendererPixbuf, and test cases
for those 2 widgets.
With help from Bastien Nocera <hadess@hadess.net>
https://bugzilla.gnome.org/show_bug.cgi?id=614711
This commit was created using a script that searched for all docstrings
containing a parameter and the string 'or %NULL'.
Gdk backends and demos excluded as they are not part of a public API
https://bugzilla.gnome.org/show_bug.cgi?id=610474
The Gtk-custom.c file in gir-repository contained a number of
introspection annotations. Merge those into the GTK source files.
Some documentation was moved from the tmpl/ files to accomodate
the addition of annotations.
2009-01-22 Michael Natterer <mitch@imendio.com>
* gtk/gtkicontheme.c (gtk_icon_theme_has_icon): g_return_if_fail()
on icon_name != NULL so we get a warning instead of a crash here.
svn path=/trunk/; revision=22174
2008-10-20 Christian Persch <chpe@gnome.org>
Bug 557059 – crash when compositing emblems with icon
* gtk/gtkicontheme.c: (apply_emblems): Copy the pixbuf before using it
with gtk_pixbuf_composite, in case its pixdata is read-only (mmaped
from icon cache or builtins).
svn path=/trunk/; revision=21690
2008-08-07 Michael Natterer <mitch@imendio.com>
* gtk/gtkicontheme.c (apply_emblems): move variables to local
scopes, fix indentation and silence bogus warning about using
uninitialized variables.
svn path=/trunk/; revision=21031
2008-06-16 Tor Lillqvist <tml@novell.com>
Bug 538362 - Get Win32 icons back in the file chooser
* gtk/gtkicontheme.c (choose_icon): Check if the icon name is a
reference to an icon resource in a DLL or .EXE as in the
Registry. In that case, extract the icon and convert to a
GdkPixbuf. Patch by Hans Breuer.
svn path=/trunk/; revision=20398
2008-05-27 Matthias Clasen <mclasen@redhat.com>
Bug 522084 – GIcon support for GtkIconTheme & GtkImage
* gtk/gtkicontheme.[hc]: Add support for GIcon based lookups.
* gtk/gtkimage.[hc]: Allow setting an image from a GIcon.
* gtk/gtk.symbols: Additions
* tests/testimage.c: Add a GIcon test
svn path=/trunk/; revision=20236
2007-12-03 Matthias Clasen <mclasen@redhat.com>
Two optimizations for icon cache lookups.
* gtk/gtkiconcache.[hc]:
* gtk/gtkicontheme.c: Remember the directory index for
subdirectories, instead of running over the directory list
again and again.
* gtk/gtkiconcache.c (find_image_offset): Remember the last
chain and try it first; this helps with the the usage patterns
in gtkicontheme.c, where the same icon is queried for a lot
of subdirectories.
svn path=/trunk/; revision=19099
* gtk/gtkicontheme.c (choose_icon): Initialize unthemed_icon to NULL
to avoid accessing uninitialized memory when
gtk_icon_theme_choose_icon() is called with an empty names list.
svn path=/trunk/; revision=18018
2007-05-18 Matthias Clasen <mclasen@redhat.com>
* gtk/gtk.symbols:
* gtk/gtkicontheme.h:
* gtk/gtkicontheme.c: Add a function to look up an icon from
a list of icon names. (#396901, Luca Ferretti)
svn path=/trunk/; revision=17868
2007-04-25 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkicontheme.c (theme_lookup_icon): Set the filename to
NULL for builtin icons, sinc gtk_icon_info_get_builtin_pixbuf()
depends on it.
* tests/testicontheme.c: Report builtin icons.
svn path=/trunk/; revision=17638
2007-04-24 Chris Wilson <chris@chris-wilson.co.uk>
* gtk/gtkicontheme.c (scan_directory): Ensure the
icon_theme->all_icons and dir->icons hash tables use the same string
as their keys. (#418531)
svn path=/trunk/; revision=17626
2007-03-21 Rodney Dawes <dobey@novell.com>
* gtk/gtk.symbols:
* gtk/gtkicontheme.[ch]:
* docs/reference/gtk/gtk-sections.txt:
* tests/testicontheme.c:
Add a new API call gtk_icon_theme_list_contexts so that one can
choose icons from a theme by context (#420719)
svn path=/trunk/; revision=17550