Re: Proposed new API for libgnomeui



On 18 Sep 2002, Michael Meeks wrote:

> Hi Alex,
> 
> 	Uncontroversial as the API is; we should do a quick GEP on it before
> folding it into libgnomeui IMHO, since it's a good few new API entry
> points. That gives a week or so delay but, it's the principle of the
> thing :-)
> 
> On Tue, 2002-09-17 at 16:48, Alexander Larsson wrote:
> > I've been working on the new NautilusIconFactory in the 
> > new-icon-factory-branch branch of nautilus. It now uses GnomeIconLoader 
> > from libgnomedesktop to do the theming instead of the nautilus icon 
> > theming crap.
> 
> 	Great; I didn't understand a few bits:
> 
> > char *gnome_icon_lookup      (GnomeIconLoader            *icon_loader,
> > 			      GnomeThumbnailFactory      *thumbnail_factory,
> > 			      const char                 *file_uri,
> > 			      const char                 *custom_icon,
> > 			      GnomeVFSFileInfo           *file_info,
> > 			      const char                 *mime_type,
> > 			      GnomeIconLookupFlags        flags,
> > 			      GnomeIconLookupResultFlags *result);
> 
> 	Why do we not handle the 'custom_icon' stuff centrally as well ? since
> we have the file_uri ? - perhaps that creates more complexity - but it
> ties into my next question:

Custom icon is currently done using nautilus metadata. It's extremely 
complex of course :). The gnome-vfs people have been talking about doing 
metadata in gnome-vfs though, so someone may still do it.
 
> 	How do we do sizing ? AFAIR we had different filenames available for
> different sizes; does this still allow us that degree of pixel
> perfection ? indeed, is that even merited ?

The return value is normally an icon name (unless it picked a thumbnail or 
something) that you then pass to the GnomeIconLoader to get a sized icon.
 
> > It's basically one function (with a sync variant that loads data from 
> > the disk) that returns an icon name or a full absolute pathname.
> > You can optionally pass it a GnomeThumbnailFactory if you want to be able 
> > to read already exisitng thumbnails.
> 
> 	The Thumbnail factory is a compatibility thing ?

No. It's what you use if you want to load or generate thumbnails. It's 
needed to keep around some state to make it not suck performancewise.
 
> > GdkPixbuf *gnome_thumbnail_load_pixbuf       (const char         *uri);
> 
> 	I'm slightly confused as to which bit of API actually causes the
> creation of the thumbnails, and whether that is asynchronous, but I'll
> look again when it goes into HEAD nautilus.

I'll write docs. It's not asynchronous itself, that is up to the 
thumbnailing app. Nautilus does it in a thread, so GnomeThumbnailFactory 
is thread safe.

-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Alexander Larsson                                            Red Hat, Inc 
                   alexl redhat com    alla lysator liu se 
He's a lounge-singing Republican vagrant who hides his scarred face behind a 
mask. She's an orphaned mutant detective on the trail of a serial killer. They 
fight crime! 




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