Re: Built in themed icons



On 2003.05.11 03:46 Owen Taylor wrote:

Thinking about it, really the answer is just to do things right,
instead of hacking around.


char *gtk_icon_theme_lookup_icon (GtkIconTheme                *theme,
                                  const gchar                 *icon_name,
                                  gint                         size,
                                  GtkIconLookupFlags           flags,
                                  G_CONST_RETURN GtkIconData **icon_data,
                                  gint
*base_size);

Should be redone as:

GtkIconInfo *gtk_icon_theme_lookup_icon (GtkIconTheme       *theme
                                         const gchar        *icon_name,
                                         GtkIconLookupFlags  flags);

With GtkIconInfo a boxed type. (copy()/free())

G_CONST_RETURN gchar *gtk_icon_info_get_filename       (GtkIconInfo
*info);
GdkPixbuf            *gtk_icon_info_get_builtin_pixbuf (GtkIconInfo
*info);
gint                  gtk_icon_info_get_base_size      (GtkIconInfo
*info);

Plus methods for what is currently in GtkIconData
(get_attach_points(), get_embedded_rect(), get_display_name()).

That cleans up the API a bunch and improves future extensibility.

Looks good to me. Have I missed something or has the functionality
changed though - in your first proposal the caller was able to
specify a size and your notes implied that the icon would be
scaled appropriately. I don't see a way of doing that in this
proposed API so presumably the caller would have to scale the
icon themselves.

--
Ali Harlow                              Email: ali avrc city ac uk
Research programmer                     Tel:   (020) 7040 4348
Applied Vision Research Centre          Intl: +44 20 7040 4348
City University                         Fax:   (020) 7040 5515
London                                  Intl: +44 20 7040 5515



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