summaryrefslogtreecommitdiff
path: root/gtk/gtkiconhelper.c
Commit message (Collapse)AuthorAgeFilesLines
* GtkIconHelper: Short circuit _gtk_icon_helper_get_size in some casesAlexander Larsson2014-08-121-30/+93
| | | | | | | | | | | | _gtk_icon_helper_get_size() is often used during size request and may not necessary mean that the icon will be displayed immediately. In many common cases we know the size without having to ensure a surface. In many cases this means we can avoid loading an icon until needed, and in the case of stateless IconHelpers such as GtkCellRendererPixbuf this is very important as otherwise it will constantly be reloading icons if the displayed set is larger than the in-memory icon cache. https://bugzilla.gnome.org/show_bug.cgi?id=734651
* iconhelper: reset original pixbuf scale on clearCosimo Cecchi2014-07-291-0/+1
| | | | | | | Avoids a previously set value for a different image to accidentally stick around. https://bugzilla.gnome.org/show_bug.cgi?id=733416
* GtkIconHelper: use FORCE_SCALE when force_scale_pixbuf is setMatthias Clasen2014-06-221-1/+1
| | | | | | | When force_scale_pixbuf is set, the icon helper will scale the icon to the requested size (either the pixel size, or the resolved icon size), so we can just as well instruct the icon theme code to do the scaling for us.
* GtkIconHelper: Change setters to return successMatthias Clasen2014-06-091-6/+12
| | | | This makes it easier to avoid redundant notifications in users.
* iconhelper: Respect -gtk-icon-styleBenjamin Otte2014-05-141-3/+9
| | | | | This allows styling of entry icons, treeview pixbufs and images. They can now be forced to be symbolic or regular.
* iconhelper: Simplify codeBenjamin Otte2014-05-111-29/+13
| | | | | | In the GTK_IMAGE_ICON_NAME case, instead of keeping around the icon_name, create a GThemedIcon and use that. This way, we can reuse the code paths for the GTK_IMAGE_GICON case.
* iconhelper: always ensure a stated pixbufCosimo Cecchi2014-04-131-1/+10
| | | | | | Even when we are set a pixbuf itself. https://bugzilla.gnome.org/show_bug.cgi?id=726271
* iconhelper: Fix leak when rendering to cairo surfaceBastien Nocera2013-10-021-0/+1
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=709264
* iconhelper: Use g_clear_* helpersBastien Nocera2013-10-021-17/+4
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=709264
* iconhelper: refactor some code into a single functionCosimo Cecchi2013-08-201-38/+32
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=705443
* iconhelper: clear the surface on invalidationCosimo Cecchi2013-08-031-0/+5
| | | | | This was missed during the pixbuf->surface conversion, so when the state changed we were not recreating a new surface for it.
* Continue the deprecation of GtkIconSetKjell Ahlstedt2013-07-091-0/+2
| | | | | | | Deprecate gtk_icon_set_render_icon_surface() and gtk_image_get_icon_set(), which take parameters of the deprecated GtkIconSet. https://bugzilla.gnome.org/show_bug.cgi?id=703616
* Fix some inconsistent deprecationsKjell Ahlstedt2013-07-091-0/+2
| | | | | | | Some functions had only a deprecation comment in the .c file, or only a deprecation annotation in the .h file. Add the missing parts. https://bugzilla.gnome.org/show_bug.cgi?id=703616
* gtk: Use new macros for defining private dataEmmanuele Bassi2013-07-091-5/+3
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=702996
* Avoid deprecation warningMatthias Clasen2013-07-031-0/+5
| | | | There was one overlooked use of GTK_STOCK_MISSING_IMAGE.
* GtkIconHelper: Convert to using cairo surfaces as base and support scalesAlexander Larsson2013-07-031-24/+455
| | | | | | | | | | | We render the source into a cairo_surface_t so that we can render it with cairo directly, rather than having to convert it from a pixbuf every time. We also specify the target window when creating the cairo surface so that rendering can be faster. Using cairo surfaces also allows us to seamlessly support window scales. We also add a GTK_IMAGE_SURFACE source type.
* GtkIconHelper: Add set_window()Alexander Larsson2013-07-031-0/+14
| | | | | | This is a hint on where the icon will be drawn. It will allow us to pre-allocate cairo surfaces for the right target.
* Deprecate GtkIconFactory, GtkIconSet, GtkIconSourceWilliam Jon McCann2013-06-261-8/+15
| | | | | We want to use GtkIconTheme instead. It is worth noting that the parts that remain undeprecated are GtkIconSize and gtk_icon_size_lookup.
* Start migrating internals away from GtkStockWilliam Jon McCann2013-06-241-5/+10
|
* Fix deprecations for GtkIconInfoJasper St. Pierre2013-02-151-1/+1
|
* iconhelper: small code simplificationSébastien Wilmet2013-01-171-2/+2
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=687025
* iconhelper: treat the empty string as a NULL stock-idMurray Cumming2013-01-041-1/+2
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=687025
* IconHelper: Avoid warnings for non-existing stock idsAlexander Larsson2012-12-131-1/+4
| | | | | | | | | There are some registred stock ids like gtk-discards that have no icons, and you could also pass a non-registred stock id. Both of these means gtk_style_context_lookup_icon_set returns NULL, which causes a critical in gtk_icon_set_render_icon_pixbuf. We avoid this by just making these render as EMPTY.
* Add API to force a GtkIconHelper pixbuf rescalingCarlos Garnacho2012-07-131-2/+52
| | | | | This API is handy in entries and status icons, where the size is limited and independent of the pixbuf size
* Change FSF AddressJavier Jardón2012-02-271-3/+1
|
* iconhelper: treat the empty string as a NULL icon nameCosimo Cecchi2011-12-151-1/+2
| | | | | | | Treat the empty string as if it was a NULL icon name instead of rendering GTK_STOCK_MISSING_IMAGE. This used to be the previous behavior of GtkCellRendererPixbuf and applications might still rely on it.
* icon-helper: remove useless checksCosimo Cecchi2011-11-301-18/+0
| | | | | When we change storage type, we always clear the rest of the object, so these checks do not add any safety.
* icon-helper: don't warn out when the icon size is GTK_ICON_SIZE_INVALIDCosimo Cecchi2011-11-301-2/+9
| | | | | We can call ensure_icon_size() for an empty image; don't warn out in that case, but just return a zero width.
* icon-helper: don't reset pixel_size when clearing the helperCosimo Cecchi2011-11-301-1/+0
| | | | | Don't reset the pixel size when clearing the helper; pixel-size is e.g a property of GtkImage, which is stable unless explicitly set.
* icon-helper: add GtkIconHelper private objectCosimo Cecchi2011-11-301-0/+578
GtkIconHelper is a helper object to easily obtain a pixbuf from different icon sources (e.g. a GIcon, an icon name, a stock id, ...). Code is ported from GtkImage, which will be adapted in the next commit.