10 #include <glib/gi18n.h>
12 #include "gnc-icons.h"
16 static GtkStockItem items[] =
18 { GNC_STOCK_ACCOUNT, N_(
"Account"), 0, 0, NULL },
19 { GNC_STOCK_DELETE_ACCOUNT, N_(
"_Delete Account"), 0, 0, NULL },
20 { GNC_STOCK_EDIT_ACCOUNT, N_(
"_Edit Account"), 0, 0, NULL },
21 { GNC_STOCK_NEW_ACCOUNT, N_(
"_New Account"), 0, 0, NULL },
22 { GNC_STOCK_OPEN_ACCOUNT, N_(
"_Open Account"), 0, 0, NULL },
23 { GNC_STOCK_TRANSFER, N_(
"_Transfer..."), 0, 0, NULL },
24 { GNC_STOCK_SPLIT_TRANS, N_(
"S_plit Transaction"), 0, 0, NULL },
25 { GNC_STOCK_JUMP_TO, N_(
"_Jump"), 0, 0, NULL },
30 const gchar *stock_name;
31 const gchar *filename_lg;
32 const gchar *filename_sm;
37 { GNC_STOCK_ACCOUNT,
"gnc-account.png",
"gnc-account-16.png"},
38 { GNC_STOCK_DELETE_ACCOUNT,
"gnc-account-delete.png",
"gnc-account-delete-16.png"},
39 { GNC_STOCK_EDIT_ACCOUNT,
"gnc-account-edit.png",
"gnc-account-edit-16.png"},
40 { GNC_STOCK_NEW_ACCOUNT,
"gnc-account-new.png",
"gnc-account-new-16.png"},
41 { GNC_STOCK_OPEN_ACCOUNT,
"gnc-account-open.png",
"gnc-account-open-16.png"},
42 { GNC_STOCK_TRANSFER,
"gnc-transfer.png",
"gnc-transfer-16.png"},
43 { GNC_STOCK_SCHEDULE,
"gnc-sx-new.png",
"gnc-sx-new-16.png"},
44 { GNC_STOCK_SPLIT_TRANS,
"gnc-split-trans.png",
"gnc-split-trans-16.png"},
45 { GNC_STOCK_JUMP_TO,
"gnc-jumpto.png",
"gnc-jumpto-16.png"},
46 { GNC_STOCK_INVOICE,
"gnc-invoice.png",
"gnc-invoice-16.png"},
47 { GNC_STOCK_INVOICE_PAY,
"gnc-invoice-pay.png",
"gnc-invoice-pay-16.png"},
48 { GNC_STOCK_INVOICE_POST,
"gnc-invoice-post.png",
"gnc-invoice-post-16.png"},
49 { GNC_STOCK_INVOICE_UNPOST,
"gnc-invoice-unpost.png",
"gnc-invoice-unpost-16.png"},
50 { GNC_STOCK_INVOICE_NEW,
"gnc-invoice-new.png",
"gnc-invoice-new-16.png"},
51 { GNC_STOCK_INVOICE_EDIT,
"gnc-invoice-edit.png",
"gnc-invoice-edit-16.png"},
52 { GNC_STOCK_INVOICE_DUPLICATE,
"gnc-invoice-duplicate.png",
"gnc-invoice-duplicate-16.png"},
53 { GNC_STOCK_PDF_EXPORT,
"gnc-gnome-pdf-24.png",
"gnc-gnome-pdf-16.png"},
58 gnc_add_stock_icon_pair (GtkIconFactory *factory,
60 const char *filename1,
61 const char *filename2)
64 GtkIconSource *source;
65 GdkPixbuf *pixbuf1, *pixbuf2;
66 char *fullname1, *fullname2;
71 g_assert (fullname1 && fullname2);
76 g_assert (pixbuf1 && pixbuf2);
79 set = gtk_icon_set_new ();
80 source = gtk_icon_source_new ();
81 gtk_icon_source_set_filename (source, fullname1);
82 gtk_icon_source_set_pixbuf (source, pixbuf1);
83 gtk_icon_set_add_source (set, source);
84 gtk_icon_source_free(source);
86 source = gtk_icon_source_new ();
87 gtk_icon_source_set_filename (source, fullname2);
88 gtk_icon_source_set_pixbuf (source, pixbuf2);
89 gtk_icon_source_set_size (source, GTK_ICON_SIZE_MENU);
90 gtk_icon_source_set_size_wildcarded (source, FALSE);
91 gtk_icon_set_add_source (set, source);
92 gtk_icon_source_free(source);
95 gtk_icon_factory_add (factory, stock, set);
98 g_object_unref (pixbuf2);
99 g_object_unref (pixbuf1);
102 gtk_icon_set_unref (set);
106 gnc_load_stock_icons (
void)
108 GtkIconFactory *factory;
112 gtk_stock_add (items, G_N_ELEMENTS (items));
115 factory = gtk_icon_factory_new ();
116 for (file = item_files; file->stock_name; file++)
118 gnc_add_stock_icon_pair (factory, file->stock_name,
119 file->filename_lg, file->filename_sm);
122 gtk_icon_factory_add_default (factory);
Gnome specific utility functions.
gchar * gnc_filepath_locate_pixmap(const gchar *name)
GdkPixbuf * gnc_gnome_get_gdkpixbuf(const char *name)
File path resolution utility functions.