2 * Copyright (C) 2001, 2002 Anders Carlsson <andersca@gnu.org>
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License as
6 * published by the Free Software Foundation; either version 2 of the
7 * License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 #include "gconf-stock-icons.h"
26 static const char *icon_theme_items[] =
33 gconf_stock_icons_register (void)
35 GtkIconFactory *icon_factory;
37 GtkIconSource *icon_source;
39 static gboolean initialized = FALSE;
41 if (initialized == TRUE) {
45 icon_factory = gtk_icon_factory_new ();
46 gtk_icon_factory_add_default (icon_factory);
48 for (i = 0; i < (int) G_N_ELEMENTS (icon_theme_items); i++)
50 set = gtk_icon_set_new ();
51 icon_source = gtk_icon_source_new ();
52 gtk_icon_source_set_icon_name (icon_source, icon_theme_items[i]);
53 gtk_icon_set_add_source (set, icon_source);
54 gtk_icon_factory_add (icon_factory, icon_theme_items[i], set);
55 gtk_icon_set_unref (set);
56 gtk_icon_source_free (icon_source);
59 g_object_unref (G_OBJECT (icon_factory));