aboutsummaryrefslogtreecommitdiff
path: root/src/stock_pixmap.c
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2005-03-28 08:43:34 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2005-03-28 08:43:34 +0000
commitd0c14090a0d5e74834fabd896406bfe2cd212449 (patch)
treecbace3b2e15b9022002d3bb2775407d9f5e7907c /src/stock_pixmap.c
parent97379a005b5a462f5773367aaea6d97a7d3d694c (diff)
reimplemented folder selection dialog using GtkTreeView.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@189 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'src/stock_pixmap.c')
-rw-r--r--src/stock_pixmap.c27
1 files changed, 26 insertions, 1 deletions
diff --git a/src/stock_pixmap.c b/src/stock_pixmap.c
index e43cf518..0bd990d7 100644
--- a/src/stock_pixmap.c
+++ b/src/stock_pixmap.c
@@ -1,6 +1,6 @@
/*
* Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2004 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2005 Hiroyuki Yamamoto
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -80,6 +80,7 @@ struct _StockPixmapData
gchar **data;
GdkPixmap *pixmap;
GdkBitmap *mask;
+ GdkPixbuf *pixbuf;
};
static StockPixmapData pixmaps[] =
@@ -171,3 +172,27 @@ gint stock_pixmap_gdk(GtkWidget *window, StockPixmap icon,
return 0;
}
+
+gint stock_pixbuf_gdk(GtkWidget *window, StockPixmap icon, GdkPixbuf **pixbuf)
+{
+ StockPixmapData *pix_d;
+
+ if (pixbuf)
+ *pixbuf = NULL;
+
+ g_return_val_if_fail(window != NULL, -1);
+ g_return_val_if_fail(icon >= 0 && icon < N_STOCK_PIXMAPS, -1);
+
+ pix_d = &pixmaps[icon];
+
+ if (!pix_d->pixbuf)
+ pix_d->pixbuf = gdk_pixbuf_new_from_xpm_data
+ ((const gchar **)pix_d->data);
+ if (!pix_d->pixbuf)
+ return -1;
+
+ if (pixbuf)
+ *pixbuf = pix_d->pixbuf;
+
+ return 0;
+}