After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 541385 - Allowing Theme Engines to draw images or icons
Allowing Theme Engines to draw images or icons
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: .General
2.13.x
Other All
: Normal enhancement
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2008-07-03 12:21 UTC by Varun
Modified: 2011-06-01 03:32 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement


Attachments
Changes introduced in GtkIconFactory.c for GtkIconSource (6.54 KB, text/plain)
2008-07-03 12:24 UTC, Varun
  Details
Changes introduced in GtkIconFactory.c for GtkIconSource (8.38 KB, patch)
2008-07-04 12:45 UTC, Varun
none Details | Review
Aurora theme engine patch (4.36 KB, patch)
2008-07-04 12:46 UTC, Varun
none Details | Review
test application (24.13 KB, application/x-gzip)
2008-07-04 12:48 UTC, Varun
  Details
Aurora midnight gtkrc file (9.81 KB, text/plain)
2008-07-04 12:49 UTC, Varun
  Details

Description Varun 2008-07-03 12:21:47 UTC
Widgets like GtkImage or GtkCellRendererPixbuf Object draws images or icons by themselves. They should actually allow the theme engine to draw.
I found gtk_style_render_icon is being just used to transform an image and return a state transformed pixbuf. As it requires a GtkIconSource object as its argument, making few changes in GtkIconSource, we can actually ask theme engine to draw instead of widgets themselves.

The main intention for introducing this feature is to allow theme engine to do some theming (like animation or decoration) on the icons and images
Comment 1 Varun 2008-07-03 12:24:21 UTC
Created attachment 113917 [details]
Changes introduced in GtkIconFactory.c for GtkIconSource
Comment 2 Christian Dywan 2008-07-03 12:40:36 UTC
(In reply to comment #1)
> Created an attachment (id=113917) [edit]
> Changes introduced in GtkIconFactory.c for GtkIconSource

Comments from a quick look:

You introduced API without Since tags.

> -
> +/*

You seem to uncomment quite a bit of code. You should rather remove code, since a) uncommented code is rarely helpful to keep and b) it makes patches much more readable without looking at the actual sources.

It would be nice if you could also poste a test case, maybe a patch for a theme engine that would make use of this enhancement. Then it would be much easier to see how useful this actually is.
Comment 3 Michael Natterer 2008-07-03 13:17:51 UTC
If you looked a bit at how the code around looks, you would notice
that every single line of code you add breaks the coding style.
Comment 4 Varun 2008-07-03 13:25:40 UTC
Christian
oh sure, i am currently working on that and will attach the same as soon as i am done.

Michael
yes i will look into it.
Comment 5 Varun 2008-07-04 12:45:46 UTC
Created attachment 113983 [details] [review]
Changes introduced in GtkIconFactory.c for GtkIconSource
Comment 6 Varun 2008-07-04 12:46:54 UTC
Created attachment 113984 [details] [review]
Aurora theme engine patch
Comment 7 Varun 2008-07-04 12:48:24 UTC
Created attachment 113985 [details]
test application
Comment 8 Varun 2008-07-04 12:49:37 UTC
Created attachment 113986 [details]
Aurora midnight gtkrc file
Comment 9 Varun 2008-07-04 12:50:17 UTC
Attaching a new patch for GtkIconSource

Attaching a patch for aurora theme engine
>> aurora theme engine downloaded from http://www.gnome-look.org/CONTENT/content-files/56438-Aurora-1.4.tar.bz2

Attaching a test application and a gtkrc file
Comment 10 Milan Bouchet-Valat 2008-12-22 21:07:08 UTC
No news on this? I've just bumped into this custom icon rendering in GtkCellRendererPixbuf, and I was thinking about improving this the very same way. This will not only clean the code, but will allow for nice theme effects.

Is there anything I can do to help? For me, Varun has provided about everything needed - and even a patch for Aurora!
Comment 11 Matthias Clasen 2011-06-01 03:32:01 UTC

gtk_theming_engine_render_icon_pixbuf does allow theming engines to override icon drawing in GTK+ 3.x