stock icon sizes



Hi,

Having icon sizes be a string is confusing people. Suggest we instead do it
the same way we do types and PangoAttributes; that is, with an enum
that can be extended at runtime by registering new items.

So the proposal is:

    typedef enum
    {
      GTK_ICON_SIZE_INVALID,
      GTK_ICON_SIZE_MENU,
      GTK_ICON_SIZE_SMALL_TOOLBAR,
      GTK_ICON_SIZE_LARGE_TOOLBAR,
      GTK_ICON_SIZE_BUTTON,
      GTK_ICON_SIZE_DIALOG
    } GtkIconSize;

    gboolean              gtk_icon_size_lookup         (GtkIconSize  size,
                                                        gint        *width,
                                                        gint        *height);
    GtkIconSize           gtk_icon_size_register       (const gchar *name,
                                                        gint         width,
                                                        gint         height);
    GtkIconSize           gtk_icon_size_register_alias (const gchar *alias,
                                                        GtkIconSize  target);
    GtkIconSize           gtk_icon_size_from_name      (const gchar *name);
    G_CONST_RETURN gchar* gtk_icon_size_get_name       (GtkIconSize  size);

This simplifies things for users who aren't using custom sizes, and
avoids the memory management issues introduced by strings. Objections?

Havoc
    




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