2 * (GLABELS) Label and Business Card Creation program for GNOME
4 * stock.h: Stock image module header file
6 * Copyright (C) 2001-2002 Jim Evins <evins@snaught.com>.
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
25 #include <gdk-pixbuf/gdk-pixdata.h>
27 #include "stock-pixmaps/stockpixbufs.h"
33 GtkIconFactory *factory;
37 static GtkStockItem items[] = {
38 { GL_STOCK_ARROW, "Arrow", 0, 0, NULL },
39 { GL_STOCK_TEXT, "Text", 0, 0, NULL },
40 { GL_STOCK_LINE, "Line", 0, 0, NULL },
41 { GL_STOCK_BOX, "Box", 0, 0, NULL },
42 { GL_STOCK_ELLIPSE, "Ellipse", 0, 0, NULL },
43 { GL_STOCK_IMAGE, "Image", 0, 0, NULL },
44 { GL_STOCK_BARCODE, "Barcode", 0, 0, NULL },
45 { GL_STOCK_MERGE, "Merge", 0, 0, NULL },
48 gtk_stock_add (items, G_N_ELEMENTS (items));
50 factory = gtk_icon_factory_new ();
51 gtk_icon_factory_add_default (factory);
53 pixdata = g_new0 (GdkPixdata, 1);
56 gdk_pixdata_deserialize (pixdata,
57 sizeof(stock_arrow_24), stock_arrow_24,
59 pixbuf = gdk_pixbuf_from_pixdata (pixdata, FALSE, NULL);
60 icon_set = gtk_icon_set_new_from_pixbuf (pixbuf);
61 gtk_icon_factory_add (factory, GL_STOCK_ARROW, icon_set);
62 gtk_icon_set_unref (icon_set);
63 g_object_unref (G_OBJECT(pixbuf));
66 gdk_pixdata_deserialize (pixdata,
67 sizeof(stock_text_24), stock_text_24,
69 pixbuf = gdk_pixbuf_from_pixdata (pixdata, FALSE, NULL);
70 icon_set = gtk_icon_set_new_from_pixbuf (pixbuf);
71 gtk_icon_factory_add (factory, GL_STOCK_TEXT, icon_set);
72 gtk_icon_set_unref (icon_set);
73 g_object_unref (G_OBJECT(pixbuf));
76 gdk_pixdata_deserialize (pixdata,
77 sizeof(stock_line_24), stock_line_24,
79 pixbuf = gdk_pixbuf_from_pixdata (pixdata, FALSE, NULL);
80 icon_set = gtk_icon_set_new_from_pixbuf (pixbuf);
81 gtk_icon_factory_add (factory, GL_STOCK_LINE, icon_set);
82 gtk_icon_set_unref (icon_set);
83 g_object_unref (G_OBJECT(pixbuf));
86 gdk_pixdata_deserialize (pixdata,
87 sizeof(stock_box_24), stock_box_24,
89 pixbuf = gdk_pixbuf_from_pixdata (pixdata, FALSE, NULL);
90 icon_set = gtk_icon_set_new_from_pixbuf (pixbuf);
91 gtk_icon_factory_add (factory, GL_STOCK_BOX, icon_set);
92 gtk_icon_set_unref (icon_set);
93 g_object_unref (G_OBJECT(pixbuf));
96 gdk_pixdata_deserialize (pixdata,
97 sizeof(stock_ellipse_24), stock_ellipse_24,
99 pixbuf = gdk_pixbuf_from_pixdata (pixdata, FALSE, NULL);
100 icon_set = gtk_icon_set_new_from_pixbuf (pixbuf);
101 gtk_icon_factory_add (factory, GL_STOCK_ELLIPSE, icon_set);
102 gtk_icon_set_unref (icon_set);
103 g_object_unref (G_OBJECT(pixbuf));
106 gdk_pixdata_deserialize (pixdata,
107 sizeof(stock_image_24), stock_image_24,
109 pixbuf = gdk_pixbuf_from_pixdata (pixdata, FALSE, NULL);
110 icon_set = gtk_icon_set_new_from_pixbuf (pixbuf);
111 gtk_icon_factory_add (factory, GL_STOCK_IMAGE, icon_set);
112 gtk_icon_set_unref (icon_set);
113 g_object_unref (G_OBJECT(pixbuf));
116 gdk_pixdata_deserialize (pixdata,
117 sizeof(stock_barcode_24), stock_barcode_24,
119 pixbuf = gdk_pixbuf_from_pixdata (pixdata, FALSE, NULL);
120 icon_set = gtk_icon_set_new_from_pixbuf (pixbuf);
121 gtk_icon_factory_add (factory, GL_STOCK_BARCODE, icon_set);
122 gtk_icon_set_unref (icon_set);
123 g_object_unref (G_OBJECT(pixbuf));
126 gdk_pixdata_deserialize (pixdata,
127 sizeof(stock_merge_24), stock_merge_24,
129 pixbuf = gdk_pixbuf_from_pixdata (pixdata, FALSE, NULL);
130 icon_set = gtk_icon_set_new_from_pixbuf (pixbuf);
131 gtk_icon_factory_add (factory, GL_STOCK_MERGE, icon_set);
132 gtk_icon_set_unref (icon_set);
133 g_object_unref (G_OBJECT(pixbuf));
136 g_object_unref (G_OBJECT(factory));