Re: GtkImage changes



Federico Mena Quintero <federico@helixcode.com> writes: 
> If the structure is made opaque, then people won't do the horrible
> hack of loading an image widget and then fetching a pixmap from it.
> 

This topic seems to have been covered, so I'm skipping it. ;-)
 
> Can we please make it a plain GtkWidget instead of a misc?  If people
> need fancy positioning, they can wrap things in a GtkAlignment.
> 
> (Computing a misc's alignment offsets inside the code is a minor but
> painful pain, and makes the widget harder to maintain).
>

I already wrote the Misc stuff, and GtkImage was already a Misc, so it
may as well be a Misc.
 
> You should be able to get the type of thing you set.  Did I set a
> pixbuf or an icon set?
>

Added.
 
> And do we really need set_image()?  People who create GdkImages by
> hand should maybe also be put in a mental institution :-)
>

I'm just trying to be compatible with the old GtkImage (even though
there are exactly zero uses of it in CVS...)
 
> Ugh.  Can we do something fancier if we can get the theme's background
> pixbuf?  It would rock to be able to composite the actual pixbuf on
> the widget's background.
> 

Yes, we just have to implement GDK_PIXBUF_ALPHA_FULL. The background
of the target drawable will already be clear when we enter our expose
event, so we can get that background and then composite against it.

The tricky thing is that gdk_pixbuf_get_from_drawable() is currently a
bit busted in GTK 2.0. The reason is that all GdkWindow have a backing
pixmap, and in our expose event the clear background is in the backing
pixmap, not yet rendered to the window itself. 

What we have to do is get the contents of the backing pixmap for all
regions that have a backing pixmap, and then get the contents of the
actual X window for un-backing-pixmapped regions, if that makes sense.
(There's a stack of backing pixmaps, not a single backing pixmap, and
the backing pixmaps don't have to cover the entire X window.)

I assume this is how the panel does its alpha icons (if not, maybe we
can get some ideas from there).

Havoc




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]