icon sizes




Is this worth adding to Gdk?

typedef struct _GdkIconSize GdkIconSize;

struct _GdkIconSize {
  gint min_width;
  gint min_height;
  gint max_width;
  gint max_height;
  gint width_inc;
  gint height_inc;
};

void
gdk_get_icon_sizes(GdkIconSize** size_list, guint* count)
{
  XIconSize* xsizes;
  int xcount;

  if (XGetIconSizes (gdk_display, gdk_root_window, &xsizes, &xcount))
    {
      int i;

      g_assert (xcount > 0);

      *size_list = g_new (GdkIconSize, xcount);
      *count = (guint)xcount;

      i = 0;
      while (i < xcount)
        {
          (*size_list)[i].min_width  = xsizes[i].min_width;
          (*size_list)[i].min_height = xsizes[i].min_height;
          (*size_list)[i].max_width  = xsizes[i].max_width;
          (*size_list)[i].max_width  = xsizes[i].max_width;
          (*size_list)[i].width_inc  = xsizes[i].width_inc;
          (*size_list)[i].height_inc = xsizes[i].height_inc;

          ++i;
        }
    }
  else
    {
      *size_list = NULL;
      *count = 0;
    }
}



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