Re: revised image prop, icon patch



Havoc Pennington <hp redhat com> writes:

> Owen Taylor <otaylor redhat com> writes: 
> > Is this still necessary? It means that you can have a pixmap storage
> > type with a null pixmap, which seems like a bad idea to me. Avoiding
> > this for icon-size is why I suggested the storage change, really.
> > 
> > I guess the downside is that if you had pixmap/mask and switched
> > to pixbuf without freeing the mask, the mask wouldnt' be freed.
> > I don't think this really matters ... people won't be changing
> > the storage type of GtkImage widgets at all often, if ever.
> 
> I ended up doing it somewhat differently... we can sort it out
> tomorrow.
> 
> I don't like breaking the invariant that the mask is part of the
> PIXMAP or IMAGE types, i.e. it should always be NULL if you are a
> PIXBUF type. So instead I changed it so that the mask and icon size
> are allowed to exist in EMPTY images, but get deleted/reset if you
> switch to PIXBUF or something. If you set the "mask" property while
> not in pixmap/image mode, then you get a GTK_IMAGE_EMPTY with a
> mask. Saving the mask in EMPTY is a hidden property-system-only
> feature, there's no C API to retrieve it.

This doesn't seem to be exactly the behavior you implemented
looking at what you checked in ... I see no code to switch to 
GTK_IMAGE_EMPTY.

> Anyhow, this ensures that pixmap != NULL if storage_type ==
> GTK_IMAGE_PIXMAP, but also frees the mask if you switch to another
> storage type.

Well, I think it's rather silly to add inter-property dependencies
when they could be avoided, but it's not a huge deal.

Regards,
                                        Owen
 





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