1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /* Stock icons for Evince
4 * Copyright (C) 2003 Martin Kretzschmar
7 * Martin Kretzschmar <Martin.Kretzschmar@inf.tu-dresden.de>
9 * GPdf is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * GPdf is distributed in the hope that it will be useful, but WITHOUT
15 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
16 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
17 * License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
26 #include "ev-stock-icons.h"
28 #include <gtk/gtkiconfactory.h>
29 #include <gtk/gtkstock.h>
30 #include <gdk/gdkpixbuf.h>
32 /* Toolbar icons files */
33 #define STOCK_ZOOM_FIT_WIDTH_FILE "ev-stock-zoom-fit-width.png"
35 #define EV_ADD_STOCK_ICON(id, file, def_id) \
38 GtkIconSet *icon_set = NULL; \
39 pixbuf = gdk_pixbuf_new_from_file (GNOMEICONDIR "/evince/" file, NULL); \
41 icon_set = gtk_icon_set_new_from_pixbuf (pixbuf); \
42 } else if (def_id) { \
43 icon_set = gtk_icon_factory_lookup_default (def_id); \
44 gtk_icon_set_ref (icon_set); \
46 gtk_icon_factory_add (factory, id, icon_set); \
47 gtk_icon_set_unref (icon_set); \
51 ev_stock_icons_init (void)
53 GtkIconFactory *factory;
55 factory = gtk_icon_factory_new ();
56 gtk_icon_factory_add_default (factory);
58 /* fitwidth stock icon */
59 EV_ADD_STOCK_ICON (EV_STOCK_ZOOM_FIT_WIDTH, STOCK_ZOOM_FIT_WIDTH_FILE, GTK_STOCK_ZOOM_FIT);
61 g_object_unref (G_OBJECT (factory));