diff options
29 files changed, 191 insertions, 101 deletions
@@ -1,3 +1,15 @@ +2005-07-05 + + * src/stock_pixmap.[ch] + src/pixmaps/*.png + src/pixmaps/Makefile.am: replaced pixmaps icons with png images + (most of them are copied from gnome-icon-theme, + stock_mail_receive_all and stock_mail_send_queue are contributed + from Jean-Yves Lefort). + * src/compose.c + src/mainwindow.c: use new png icons. + * src/folderview.c: use special icon for draft folder. + 2005-07-04 * src/procmsg.c: procmsg_read_cache(): mark cache as dirty if open diff --git a/ChangeLog.ja b/ChangeLog.ja index 87bef566..9758429f 100644 --- a/ChangeLog.ja +++ b/ChangeLog.ja @@ -1,3 +1,14 @@ +2005-07-05 + + * src/stock_pixmap.[ch] + src/pixmaps/*.png + src/pixmaps/Makefile.am: pixmaps アイコンを png 画像で置き換えた + (大部分は gnome-icon-theme からコピー。 stock_mail_receive_all + と stock_mail_send_queue は Jean-Yves Lefort さんから提供された)。 + * src/compose.c + src/mainwindow.c: 新しい png アイコンを使用。 + * src/folderview.c: 草稿フォルダに特別なアイコンを使用。 + 2005-07-04 * src/procmsg.c: procmsg_read_cache(): オープンに失敗したらキャッシュ diff --git a/configure.in b/configure.in index 77f2dc0a..28680233 100644 --- a/configure.in +++ b/configure.in @@ -330,6 +330,7 @@ ac/Makefile po/Makefile.in src/version.h src/Makefile +src/pixmaps/Makefile faq/Makefile faq/de/Makefile faq/en/Makefile diff --git a/src/Makefile.am b/src/Makefile.am index 230c2be7..4030673b 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,3 +1,5 @@ +SUBDIRS = pixmaps + bin_PROGRAMS = sylpheed sylpheed_SOURCES = \ diff --git a/src/about.c b/src/about.c index 009e5c96..5374087d 100644 --- a/src/about.c +++ b/src/about.c @@ -101,7 +101,7 @@ static void about_create(void) vbox = gtk_vbox_new(FALSE, 6); gtk_container_add(GTK_CONTAINER(window), vbox); - pixmap = stock_pixmap_widget(window, STOCK_PIXMAP_SYLPHEED_LOGO); + pixmap = stock_pixbuf_widget(window, STOCK_PIXMAP_SYLPHEED_LOGO); gtk_box_pack_start(GTK_BOX(vbox), pixmap, FALSE, FALSE, 0); label = gtk_label_new("version "VERSION); diff --git a/src/compose.c b/src/compose.c index 5967cc0b..d875cbd8 100644 --- a/src/compose.c +++ b/src/compose.c @@ -4350,10 +4350,12 @@ static void compose_toolbar_create(Compose *compose, GtkWidget *container) gtk_toolbar_set_orientation(GTK_TOOLBAR(toolbar), GTK_ORIENTATION_HORIZONTAL); gtk_toolbar_set_style(GTK_TOOLBAR(toolbar), GTK_TOOLBAR_BOTH); + gtk_toolbar_set_icon_size(GTK_TOOLBAR(toolbar), + GTK_ICON_SIZE_LARGE_TOOLBAR); gtk_container_add(GTK_CONTAINER(container), toolbar); gtk_widget_set_size_request(toolbar, 1, -1); - icon_wid = stock_pixmap_widget(container, STOCK_PIXMAP_MAIL_SEND); + icon_wid = stock_pixbuf_widget(container, STOCK_PIXMAP_MAIL_SEND); send_btn = gtk_toolbar_append_item(GTK_TOOLBAR(toolbar), _("Send"), _("Send message"), @@ -4362,7 +4364,7 @@ static void compose_toolbar_create(Compose *compose, GtkWidget *container) G_CALLBACK(toolbar_send_cb), compose); - icon_wid = stock_pixmap_widget(container, STOCK_PIXMAP_MAIL_SEND_QUEUE); + icon_wid = stock_pixbuf_widget(container, STOCK_PIXMAP_MAIL_SEND_QUEUE); sendl_btn = gtk_toolbar_append_item(GTK_TOOLBAR(toolbar), _("Send later"), _("Put into queue folder and send later"), @@ -4371,7 +4373,7 @@ static void compose_toolbar_create(Compose *compose, GtkWidget *container) G_CALLBACK(toolbar_send_later_cb), compose); - icon_wid = stock_pixmap_widget(container, STOCK_PIXMAP_MAIL); + icon_wid = stock_pixbuf_widget(container, STOCK_PIXMAP_MAIL); draft_btn = gtk_toolbar_append_item(GTK_TOOLBAR(toolbar), _("Draft"), _("Save to draft folder"), @@ -4382,7 +4384,7 @@ static void compose_toolbar_create(Compose *compose, GtkWidget *container) gtk_toolbar_append_space(GTK_TOOLBAR(toolbar)); - icon_wid = stock_pixmap_widget(container, STOCK_PIXMAP_PASTE); + icon_wid = stock_pixbuf_widget(container, STOCK_PIXMAP_PASTE); insert_btn = gtk_toolbar_append_item(GTK_TOOLBAR(toolbar), _("Insert"), _("Insert file"), @@ -4391,7 +4393,7 @@ static void compose_toolbar_create(Compose *compose, GtkWidget *container) G_CALLBACK(toolbar_insert_cb), compose); - icon_wid = stock_pixmap_widget(container, STOCK_PIXMAP_MAIL_ATTACH); + icon_wid = stock_pixbuf_widget(container, STOCK_PIXMAP_MAIL_ATTACH); attach_btn = gtk_toolbar_append_item(GTK_TOOLBAR(toolbar), _("Attach"), _("Attach file"), @@ -4402,7 +4404,7 @@ static void compose_toolbar_create(Compose *compose, GtkWidget *container) gtk_toolbar_append_space(GTK_TOOLBAR(toolbar)); - icon_wid = stock_pixmap_widget(container, STOCK_PIXMAP_MAIL); + icon_wid = stock_pixbuf_widget(container, STOCK_PIXMAP_MAIL); sig_btn = gtk_toolbar_append_item(GTK_TOOLBAR(toolbar), _("Signature"), _("Insert signature"), @@ -4412,7 +4414,7 @@ static void compose_toolbar_create(Compose *compose, GtkWidget *container) gtk_toolbar_append_space(GTK_TOOLBAR(toolbar)); - icon_wid = stock_pixmap_widget(container, STOCK_PIXMAP_MAIL_COMPOSE); + icon_wid = stock_pixbuf_widget(container, STOCK_PIXMAP_MAIL_COMPOSE); exteditor_btn = gtk_toolbar_append_item(GTK_TOOLBAR(toolbar), _("Editor"), _("Edit with external editor"), @@ -4421,7 +4423,7 @@ static void compose_toolbar_create(Compose *compose, GtkWidget *container) G_CALLBACK(toolbar_ext_editor_cb), compose); - icon_wid = stock_pixmap_widget(container, STOCK_PIXMAP_LINEWRAP); + icon_wid = stock_pixbuf_widget(container, STOCK_PIXMAP_LINEWRAP); linewrap_btn = gtk_toolbar_append_item(GTK_TOOLBAR(toolbar), _("Linewrap"), _("Wrap all long lines"), @@ -4432,7 +4434,7 @@ static void compose_toolbar_create(Compose *compose, GtkWidget *container) gtk_toolbar_append_space(GTK_TOOLBAR(toolbar)); - icon_wid = stock_pixmap_widget(container, STOCK_PIXMAP_ADDRESS_BOOK); + icon_wid = stock_pixbuf_widget(container, STOCK_PIXMAP_ADDRESS_BOOK); addrbook_btn = gtk_toolbar_append_item(GTK_TOOLBAR(toolbar), _("Address"), _("Address book"), diff --git a/src/folderview.c b/src/folderview.c index eff37d90..6cee00af 100644 --- a/src/folderview.c +++ b/src/folderview.c @@ -102,6 +102,7 @@ static GdkPixbuf *outbox_pixbuf; static GdkPixbuf *folder_pixbuf; static GdkPixbuf *folderopen_pixbuf; static GdkPixbuf *foldernoselect_pixbuf; +static GdkPixbuf *draft_pixbuf; static GdkPixbuf *trash_pixbuf; static void folderview_select_row (FolderView *folderview, @@ -502,6 +503,7 @@ void folderview_init(FolderView *folderview) stock_pixbuf_gdk(treeview, STOCK_PIXMAP_DIR_OPEN, &folderopen_pixbuf); stock_pixbuf_gdk(treeview, STOCK_PIXMAP_DIR_NOSELECT, &foldernoselect_pixbuf); + stock_pixbuf_gdk(treeview, STOCK_PIXMAP_DRAFT, &draft_pixbuf); stock_pixbuf_gdk(treeview, STOCK_PIXMAP_TRASH, &trash_pixbuf); } @@ -1086,8 +1088,7 @@ static void folderview_update_row(FolderView *folderview, GtkTreeIter *iter) item->name); break; case F_DRAFT: - pixbuf = folder_pixbuf; - open_pixbuf = folderopen_pixbuf; + pixbuf = open_pixbuf = draft_pixbuf; name = g_strdup(FOLDER_IS_LOCAL(item->folder) && !strcmp2(item->name, DRAFT_DIR) ? _("Drafts") : item->name); diff --git a/src/mainwindow.c b/src/mainwindow.c index 98180364..c11cc574 100644 --- a/src/mainwindow.c +++ b/src/mainwindow.c @@ -883,8 +883,8 @@ MainWindow *main_window_create(SeparateType type) online_hbox = gtk_hbox_new(FALSE, 0); - online_pixmap = stock_pixmap_widget(statusbar, STOCK_PIXMAP_ONLINE); - offline_pixmap = stock_pixmap_widget(statusbar, STOCK_PIXMAP_OFFLINE); + online_pixmap = stock_pixbuf_widget(statusbar, STOCK_PIXMAP_ONLINE); + offline_pixmap = stock_pixbuf_widget(statusbar, STOCK_PIXMAP_OFFLINE); gtk_box_pack_start(GTK_BOX(online_hbox), online_pixmap, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(online_hbox), offline_pixmap, @@ -2196,11 +2196,11 @@ static void main_window_toolbar_create(MainWindow *mainwin, GTK_ORIENTATION_HORIZONTAL); gtk_toolbar_set_style(GTK_TOOLBAR(toolbar), GTK_TOOLBAR_BOTH); gtk_toolbar_set_icon_size(GTK_TOOLBAR(toolbar), - GTK_ICON_SIZE_SMALL_TOOLBAR); + GTK_ICON_SIZE_LARGE_TOOLBAR); gtk_container_add(GTK_CONTAINER(container), toolbar); gtk_widget_set_size_request(toolbar, 1, -1); - icon_wid = stock_pixmap_widget(container, STOCK_PIXMAP_MAIL_RECEIVE); + icon_wid = stock_pixbuf_widget(container, STOCK_PIXMAP_MAIL_RECEIVE); get_btn = gtk_toolbar_append_item(GTK_TOOLBAR(toolbar), _("Get"), _("Incorporate new mail"), @@ -2208,7 +2208,7 @@ static void main_window_toolbar_create(MainWindow *mainwin, icon_wid, G_CALLBACK(toolbar_inc_cb), mainwin); - icon_wid = stock_pixmap_widget(container, STOCK_PIXMAP_MAIL_RECEIVE_ALL); + icon_wid = stock_pixbuf_widget(container, STOCK_PIXMAP_MAIL_RECEIVE_ALL); getall_btn = gtk_toolbar_append_item(GTK_TOOLBAR(toolbar), _("Get all"), _("Incorporate new mail of all accounts"), @@ -2219,7 +2219,7 @@ static void main_window_toolbar_create(MainWindow *mainwin, gtk_toolbar_append_space(GTK_TOOLBAR(toolbar)); - icon_wid = stock_pixmap_widget(container, STOCK_PIXMAP_MAIL_SEND); + icon_wid = stock_pixbuf_widget(container, STOCK_PIXMAP_MAIL_SEND); send_btn = gtk_toolbar_append_item(GTK_TOOLBAR(toolbar), _("Send"), _("Send queued message(s)"), @@ -2230,7 +2230,7 @@ static void main_window_toolbar_create(MainWindow *mainwin, gtk_toolbar_append_space(GTK_TOOLBAR(toolbar)); - icon_wid = stock_pixmap_widget(container, STOCK_PIXMAP_MAIL_COMPOSE); + icon_wid = stock_pixbuf_widget(container, STOCK_PIXMAP_MAIL_COMPOSE); compose_btn = gtk_toolbar_append_item(GTK_TOOLBAR(toolbar), _("Compose"), _("Compose new message"), @@ -2239,7 +2239,7 @@ static void main_window_toolbar_create(MainWindow *mainwin, G_CALLBACK(toolbar_compose_cb), mainwin); - icon_wid = stock_pixmap_widget(container, STOCK_PIXMAP_MAIL_REPLY); + icon_wid = stock_pixbuf_widget(container, STOCK_PIXMAP_MAIL_REPLY); reply_btn = gtk_toolbar_append_item(GTK_TOOLBAR(toolbar), _("Reply"), _("Reply to the message"), @@ -2257,7 +2257,7 @@ static void main_window_toolbar_create(MainWindow *mainwin, GTK_WIDGET_PTR(reply_combo), _("Reply to the message"), "Reply"); - icon_wid = stock_pixmap_widget + icon_wid = stock_pixbuf_widget (container, STOCK_PIXMAP_MAIL_REPLY_TO_ALL); replyall_btn = gtk_toolbar_append_item(GTK_TOOLBAR(toolbar), _("Reply all"), @@ -2267,7 +2267,7 @@ static void main_window_toolbar_create(MainWindow *mainwin, G_CALLBACK(toolbar_reply_to_all_cb), mainwin); - icon_wid = stock_pixmap_widget(container, STOCK_PIXMAP_MAIL_FORWARD); + icon_wid = stock_pixbuf_widget(container, STOCK_PIXMAP_MAIL_FORWARD); fwd_btn = gtk_toolbar_append_item(GTK_TOOLBAR(toolbar), _("Forward"), _("Forward the message"), @@ -2287,8 +2287,7 @@ static void main_window_toolbar_create(MainWindow *mainwin, gtk_toolbar_append_space(GTK_TOOLBAR(toolbar)); - icon_wid = gtk_image_new_from_stock(GTK_STOCK_DELETE, - GTK_ICON_SIZE_SMALL_TOOLBAR); + icon_wid = stock_pixbuf_widget(container, STOCK_PIXMAP_DELETE); delete_btn = gtk_toolbar_append_item(GTK_TOOLBAR(toolbar), _("Delete"), _("Delete the message"), @@ -2297,8 +2296,7 @@ static void main_window_toolbar_create(MainWindow *mainwin, G_CALLBACK(toolbar_delete_cb), mainwin); - icon_wid = gtk_image_new_from_stock(GTK_STOCK_CANCEL, - GTK_ICON_SIZE_SMALL_TOOLBAR); + icon_wid = stock_pixbuf_widget(container, STOCK_PIXMAP_SPAM); junk_btn = gtk_toolbar_append_item(GTK_TOOLBAR(toolbar), _("Junk"), _("Set as junk mail"), @@ -2308,7 +2306,7 @@ static void main_window_toolbar_create(MainWindow *mainwin, mainwin); icon_wid = gtk_image_new_from_stock(GTK_STOCK_EXECUTE, - GTK_ICON_SIZE_SMALL_TOOLBAR); + GTK_ICON_SIZE_LARGE_TOOLBAR); exec_btn = gtk_toolbar_append_item(GTK_TOOLBAR(toolbar), _("Execute"), _("Execute marked process"), @@ -2318,7 +2316,7 @@ static void main_window_toolbar_create(MainWindow *mainwin, mainwin); icon_wid = gtk_image_new_from_stock(GTK_STOCK_GO_DOWN, - GTK_ICON_SIZE_SMALL_TOOLBAR); + GTK_ICON_SIZE_LARGE_TOOLBAR); next_btn = gtk_toolbar_append_item(GTK_TOOLBAR(toolbar), _("Next"), _("Next unread message"), @@ -2330,7 +2328,7 @@ static void main_window_toolbar_create(MainWindow *mainwin, #if 0 gtk_toolbar_append_space(GTK_TOOLBAR(toolbar)); - icon_wid = stock_pixmap_widget(container, STOCK_PIXMAP_PREFERENCES); + icon_wid = stock_pixbuf_widget(container, STOCK_PIXMAP_PREFERENCES); prefs_btn = gtk_toolbar_append_item(GTK_TOOLBAR(toolbar), _("Prefs"), _("Common preferences"), @@ -2338,7 +2336,7 @@ static void main_window_toolbar_create(MainWindow *mainwin, icon_wid, G_CALLBACK(toolbar_prefs_cb), mainwin); - icon_wid = stock_pixmap_widget(container, STOCK_PIXMAP_PROPERTIES); + icon_wid = stock_pixbuf_widget(container, STOCK_PIXMAP_PROPERTIES); account_btn = gtk_toolbar_append_item(GTK_TOOLBAR(toolbar), _("Account"), _("Account setting"), diff --git a/src/pixmaps/Makefile.am b/src/pixmaps/Makefile.am new file mode 100644 index 00000000..ef296b7b --- /dev/null +++ b/src/pixmaps/Makefile.am @@ -0,0 +1,45 @@ +BUILT_SOURCES = \ + stock_mail_receive_all.h \ + stock_mail_send_queue.h \ + stock_addressbook.h \ + stock_attach.h \ + stock_delete.h \ + stock_delete_16.h \ + stock_inbox.h \ + stock_insert-file.h \ + stock_mail-compose.h \ + stock_mail-compose_16.h \ + stock_mail-forward.h \ + stock_mail-receive.h \ + stock_mail-reply-to-all.h \ + stock_mail-reply.h \ + stock_mail-send.h \ + stock_mail.h \ + stock_outbox.h \ + stock_spam.h + +EXTRA_DIST = \ + stock_mail_receive_all.png \ + stock_mail_send_queue.png \ + stock_addressbook.png \ + stock_attach.png \ + stock_delete.png \ + stock_delete_16.png \ + stock_inbox.png \ + stock_insert-file.png \ + stock_mail-compose.png \ + stock_mail-compose_16.png \ + stock_mail-forward.png \ + stock_mail-receive.png \ + stock_mail-reply-to-all.png \ + stock_mail-reply.png \ + stock_mail-send.png \ + stock_mail.png \ + stock_outbox.png \ + stock_spam.png + +%.h: %.png + gdk-pixbuf-csource --name=`echo $(*F)|sed s/-/_/g` $< > $@ + +clean: + rm -f $(BUILT_SOURCES) diff --git a/src/pixmaps/stock_addressbook.png b/src/pixmaps/stock_addressbook.png Binary files differnew file mode 100644 index 00000000..e3d953af --- /dev/null +++ b/src/pixmaps/stock_addressbook.png diff --git a/src/pixmaps/stock_attach.png b/src/pixmaps/stock_attach.png Binary files differnew file mode 100644 index 00000000..4e064b35 --- /dev/null +++ b/src/pixmaps/stock_attach.png diff --git a/src/pixmaps/stock_delete.png b/src/pixmaps/stock_delete.png Binary files differnew file mode 100644 index 00000000..6b638c59 --- /dev/null +++ b/src/pixmaps/stock_delete.png diff --git a/src/pixmaps/stock_delete_16.png b/src/pixmaps/stock_delete_16.png Binary files differnew file mode 100644 index 00000000..af10be03 --- /dev/null +++ b/src/pixmaps/stock_delete_16.png diff --git a/src/pixmaps/stock_inbox.png b/src/pixmaps/stock_inbox.png Binary files differnew file mode 100644 index 00000000..3afaeb6d --- /dev/null +++ b/src/pixmaps/stock_inbox.png diff --git a/src/pixmaps/stock_insert-file.png b/src/pixmaps/stock_insert-file.png Binary files differnew file mode 100644 index 00000000..34aed99d --- /dev/null +++ b/src/pixmaps/stock_insert-file.png diff --git a/src/pixmaps/stock_mail-compose.png b/src/pixmaps/stock_mail-compose.png Binary files differnew file mode 100644 index 00000000..b0d4e136 --- /dev/null +++ b/src/pixmaps/stock_mail-compose.png diff --git a/src/pixmaps/stock_mail-compose_16.png b/src/pixmaps/stock_mail-compose_16.png Binary files differnew file mode 100644 index 00000000..7c7d597d --- /dev/null +++ b/src/pixmaps/stock_mail-compose_16.png diff --git a/src/pixmaps/stock_mail-forward.png b/src/pixmaps/stock_mail-forward.png Binary files differnew file mode 100644 index 00000000..f848a60f --- /dev/null +++ b/src/pixmaps/stock_mail-forward.png diff --git a/src/pixmaps/stock_mail-receive.png b/src/pixmaps/stock_mail-receive.png Binary files differnew file mode 100644 index 00000000..20580e03 --- /dev/null +++ b/src/pixmaps/stock_mail-receive.png diff --git a/src/pixmaps/stock_mail-reply-to-all.png b/src/pixmaps/stock_mail-reply-to-all.png Binary files differnew file mode 100644 index 00000000..e2685771 --- /dev/null +++ b/src/pixmaps/stock_mail-reply-to-all.png diff --git a/src/pixmaps/stock_mail-reply.png b/src/pixmaps/stock_mail-reply.png Binary files differnew file mode 100644 index 00000000..47eecc61 --- /dev/null +++ b/src/pixmaps/stock_mail-reply.png diff --git a/src/pixmaps/stock_mail-send.png b/src/pixmaps/stock_mail-send.png Binary files differnew file mode 100644 index 00000000..e1fa1519 --- /dev/null +++ b/src/pixmaps/stock_mail-send.png diff --git a/src/pixmaps/stock_mail.png b/src/pixmaps/stock_mail.png Binary files differnew file mode 100644 index 00000000..5f8922e1 --- /dev/null +++ b/src/pixmaps/stock_mail.png diff --git a/src/pixmaps/stock_mail_receive_all.png b/src/pixmaps/stock_mail_receive_all.png Binary files differnew file mode 100644 index 00000000..0004bf23 --- /dev/null +++ b/src/pixmaps/stock_mail_receive_all.png diff --git a/src/pixmaps/stock_mail_send_queue.png b/src/pixmaps/stock_mail_send_queue.png Binary files differnew file mode 100644 index 00000000..8754c5d8 --- /dev/null +++ b/src/pixmaps/stock_mail_send_queue.png diff --git a/src/pixmaps/stock_outbox.png b/src/pixmaps/stock_outbox.png Binary files differnew file mode 100644 index 00000000..0455a35c --- /dev/null +++ b/src/pixmaps/stock_outbox.png diff --git a/src/pixmaps/stock_spam.png b/src/pixmaps/stock_spam.png Binary files differnew file mode 100644 index 00000000..52364ab2 --- /dev/null +++ b/src/pixmaps/stock_spam.png diff --git a/src/stock_pixmap.c b/src/stock_pixmap.c index 64664928..eef84a4f 100644 --- a/src/stock_pixmap.c +++ b/src/stock_pixmap.c @@ -21,6 +21,7 @@ #include <gtk/gtkwidget.h> #include <gtk/gtkpixmap.h> #include <gtk/gtkimage.h> +#include <gtk/gtkicontheme.h> #include "stock_pixmap.h" #include "gtkutils.h" @@ -28,8 +29,6 @@ #include "pixmaps/address.xpm" #include "pixmaps/book.xpm" #include "pixmaps/category.xpm" -#include "pixmaps/checkbox_off.xpm" -#include "pixmaps/checkbox_on.xpm" #include "pixmaps/clip.xpm" #include "pixmaps/complete.xpm" #include "pixmaps/continue.xpm" @@ -40,39 +39,40 @@ #include "pixmaps/error.xpm" #include "pixmaps/forwarded.xpm" #include "pixmaps/group.xpm" -#include "pixmaps/inbox.xpm" +#include "pixmaps/stock_inbox.h" #include "pixmaps/interface.xpm" #include "pixmaps/jpilot.xpm" #include "pixmaps/ldap.xpm" #include "pixmaps/linewrap.xpm" #include "pixmaps/mark.xpm" #include "pixmaps/new.xpm" -#include "pixmaps/outbox.xpm" +#include "pixmaps/stock_outbox.h" #include "pixmaps/replied.xpm" #include "pixmaps/stock_close.xpm" #include "pixmaps/stock_down_arrow.xpm" #include "pixmaps/stock_exec.xpm" -#include "pixmaps/stock_mail.xpm" -#include "pixmaps/stock_mail_attach.xpm" -#include "pixmaps/stock_mail_compose.xpm" -#include "pixmaps/stock_mail_forward.xpm" -#include "pixmaps/stock_mail_receive.xpm" -#include "pixmaps/stock_mail_receive_all.xpm" -#include "pixmaps/stock_mail_reply.xpm" -#include "pixmaps/stock_mail_reply_to_all.xpm" -#include "pixmaps/stock_mail_send.xpm" -#include "pixmaps/stock_mail_send_queue.xpm" -#include "pixmaps/stock_paste.xpm" -#include "pixmaps/stock_preferences.xpm" -#include "pixmaps/stock_properties.xpm" +#include "pixmaps/stock_mail.h" +#include "pixmaps/stock_attach.h" +#include "pixmaps/stock_mail-compose.h" +#include "pixmaps/stock_mail-compose_16.h" +#include "pixmaps/stock_mail-forward.h" +#include "pixmaps/stock_mail-receive.h" +#include "pixmaps/stock_mail_receive_all.h" +#include "pixmaps/stock_mail-reply.h" +#include "pixmaps/stock_mail-reply-to-all.h" +#include "pixmaps/stock_mail-send.h" +#include "pixmaps/stock_mail_send_queue.h" +#include "pixmaps/stock_insert-file.h" #include "pixmaps/sylpheed-logo.xpm" -#include "pixmaps/tb_address_book.xpm" -#include "pixmaps/trash.xpm" +#include "pixmaps/stock_addressbook.h" +#include "pixmaps/stock_delete.h" +#include "pixmaps/stock_delete_16.h" #include "pixmaps/unread.xpm" #include "pixmaps/vcard.xpm" #include "pixmaps/online.xpm" #include "pixmaps/offline.xpm" #include "pixmaps/mail.xpm" +#include "pixmaps/stock_spam.h" typedef struct _StockPixmapData StockPixmapData; @@ -82,58 +82,63 @@ struct _StockPixmapData GdkPixmap *pixmap; GdkBitmap *mask; GdkPixbuf *pixbuf; + const guint8 *pixbuf_data; + gint pixbuf_data_len; + gchar *icon_name; + gint size; }; static StockPixmapData pixmaps[] = { - {address_xpm , NULL, NULL}, - {book_xpm , NULL, NULL}, - {category_xpm , NULL, NULL}, - {checkbox_off_xpm , NULL, NULL}, - {checkbox_on_xpm , NULL, NULL}, - {clip_xpm , NULL, NULL}, - {complete_xpm , NULL, NULL}, - {continue_xpm , NULL, NULL}, - {deleted_xpm , NULL, NULL}, - {dir_close_xpm , NULL, NULL}, - {dir_open_xpm , NULL, NULL}, - {dir_noselect_xpm , NULL, NULL}, - {error_xpm , NULL, NULL}, - {forwarded_xpm , NULL, NULL}, - {group_xpm , NULL, NULL}, - {inbox_xpm , NULL, NULL}, - {interface_xpm , NULL, NULL}, - {jpilot_xpm , NULL, NULL}, - {ldap_xpm , NULL, NULL}, - {linewrap_xpm , NULL, NULL}, - {mark_xpm , NULL, NULL}, - {new_xpm , NULL, NULL}, - {outbox_xpm , NULL, NULL}, - {replied_xpm , NULL, NULL}, - {stock_close_xpm , NULL, NULL}, - {stock_down_arrow_xpm , NULL, NULL}, - {stock_exec_xpm , NULL, NULL}, - {stock_mail_xpm , NULL, NULL}, - {stock_mail_attach_xpm , NULL, NULL}, - {stock_mail_compose_xpm , NULL, NULL}, - {stock_mail_forward_xpm , NULL, NULL}, - {stock_mail_receive_xpm , NULL, NULL}, - {stock_mail_receive_all_xpm , NULL, NULL}, - {stock_mail_reply_xpm , NULL, NULL}, - {stock_mail_reply_to_all_xpm , NULL, NULL}, - {stock_mail_send_xpm , NULL, NULL}, - {stock_mail_send_queue_xpm , NULL, NULL}, - {stock_paste_xpm , NULL, NULL}, - {stock_preferences_xpm , NULL, NULL}, - {stock_properties_xpm , NULL, NULL}, - {sylpheed_logo_xpm , NULL, NULL}, - {tb_address_book_xpm , NULL, NULL}, - {trash_xpm , NULL, NULL}, - {unread_xpm , NULL, NULL}, - {vcard_xpm , NULL, NULL}, - {online_xpm , NULL, NULL}, - {offline_xpm , NULL, NULL}, - {mail_xpm , NULL, NULL}, + {address_xpm , NULL, NULL}, + {book_xpm , NULL, NULL}, + {category_xpm , NULL, NULL}, + {clip_xpm , NULL, NULL}, + {complete_xpm , NULL, NULL}, + {continue_xpm , NULL, NULL}, + {deleted_xpm , NULL, NULL}, + {dir_close_xpm , NULL, NULL}, + {dir_open_xpm , NULL, NULL}, + {dir_noselect_xpm, NULL, NULL}, + {error_xpm , NULL, NULL}, + {forwarded_xpm , NULL, NULL}, + {group_xpm , NULL, NULL}, + {NULL , NULL, NULL, NULL, stock_inbox, sizeof(stock_inbox), "stock_inbox", 16}, + {interface_xpm , NULL, NULL}, + {jpilot_xpm , NULL, NULL}, + {ldap_xpm , NULL, NULL}, + {linewrap_xpm , NULL, NULL}, + {mark_xpm , NULL, NULL}, + {new_xpm , NULL, NULL}, + {NULL , NULL, NULL, NULL, stock_outbox, sizeof(stock_outbox), "stock_outbox", 16}, + {replied_xpm , NULL, NULL}, + {stock_close_xpm, NULL, NULL}, + {stock_down_arrow_xpm, NULL, NULL}, + {stock_exec_xpm , NULL, NULL}, + {NULL , NULL, NULL, NULL, stock_mail, sizeof(stock_mail), "stock_mail", 24}, + {NULL , NULL, NULL, NULL, stock_attach, sizeof(stock_attach), "stock_attach", 24}, + {NULL , NULL, NULL, NULL, stock_mail_compose, sizeof(stock_mail_compose), "stock_mail-compose", 24}, + {NULL , NULL, NULL, NULL, stock_mail_forward, sizeof(stock_mail_forward), "stock_mail-forward", 24}, + {NULL , NULL, NULL, NULL, stock_mail_receive, sizeof(stock_mail_receive), "stock_mail-receive", 24}, + {NULL , NULL, NULL, NULL, stock_mail_receive_all, sizeof(stock_mail_receive_all), NULL, 0}, + {NULL , NULL, NULL, NULL, stock_mail_reply, sizeof(stock_mail_reply), "stock_mail-reply", 24}, + {NULL , NULL, NULL, NULL, stock_mail_reply_to_all, sizeof(stock_mail_reply_to_all), "stock_mail-reply-to-all", 24}, + {NULL , NULL, NULL, NULL, stock_mail_send, sizeof(stock_mail_send), "stock_mail-send", 24}, + {NULL , NULL, NULL, NULL, stock_mail_send_queue, sizeof(stock_mail_send_queue), NULL, 0}, + {NULL , NULL, NULL, NULL, stock_insert_file, sizeof(stock_insert_file), "stock_insert-file", 24}, + {NULL , NULL, NULL, NULL, NULL, 0, GTK_STOCK_PREFERENCES, 24}, + {NULL , NULL, NULL, NULL, NULL, 0, GTK_STOCK_PROPERTIES, 24}, + {sylpheed_logo_xpm, NULL, NULL}, + {NULL , NULL, NULL, NULL, stock_addressbook, sizeof(stock_addressbook), "stock_addressbook", 24}, + {NULL , NULL, NULL, NULL, stock_mail_compose_16, sizeof(stock_mail_compose_16), "stock_mail-compose", 16}, + {NULL , NULL, NULL, NULL, stock_delete_16, sizeof(stock_delete_16), GTK_STOCK_DELETE, 16}, + {unread_xpm , NULL, NULL}, + {vcard_xpm , NULL, NULL}, + {online_xpm , NULL, NULL}, + {offline_xpm , NULL, NULL}, + {mail_xpm , NULL, NULL}, + {NULL , NULL, NULL, NULL, stock_delete, sizeof(stock_delete), GTK_STOCK_DELETE, 24}, + {NULL , NULL, NULL, NULL, stock_spam, sizeof(stock_spam), "stock_spam", 24} }; /* return newly constructed GtkPixmap from GdkPixmap */ @@ -174,6 +179,8 @@ gint stock_pixmap_gdk(GtkWidget *window, StockPixmap icon, pix_d = &pixmaps[icon]; + g_return_val_if_fail(pix_d->data != NULL, -1); + if (!pix_d->pixmap) { PIXMAP_CREATE(window, pix_d->pixmap, pix_d->mask, pix_d->data); @@ -197,11 +204,21 @@ gint stock_pixbuf_gdk(GtkWidget *window, StockPixmap icon, GdkPixbuf **pixbuf) pix_d = &pixmaps[icon]; - if (!pix_d->pixbuf) + if (!pix_d->pixbuf && pix_d->pixbuf_data) + pix_d->pixbuf = gdk_pixbuf_new_from_inline + (pix_d->pixbuf_data_len, pix_d->pixbuf_data, + FALSE, NULL); + if (!pix_d->pixbuf && pix_d->icon_name) + pix_d->pixbuf = gtk_icon_theme_load_icon + (gtk_icon_theme_get_default(), + pix_d->icon_name, pix_d->size, 0, NULL); + if (!pix_d->pixbuf && pix_d->data) pix_d->pixbuf = gdk_pixbuf_new_from_xpm_data ((const gchar **)pix_d->data); - if (!pix_d->pixbuf) + if (!pix_d->pixbuf) { + g_warning("can't read image %d\n", icon); return -1; + } if (pixbuf) *pixbuf = pix_d->pixbuf; diff --git a/src/stock_pixmap.h b/src/stock_pixmap.h index efa402bb..8430ddd2 100644 --- a/src/stock_pixmap.h +++ b/src/stock_pixmap.h @@ -28,8 +28,6 @@ typedef enum STOCK_PIXMAP_ADDRESS, STOCK_PIXMAP_BOOK, STOCK_PIXMAP_CATEGORY, - STOCK_PIXMAP_CHECKBOX_OFF, - STOCK_PIXMAP_CHECKBOX_ON, STOCK_PIXMAP_CLIP, STOCK_PIXMAP_COMPLETE, STOCK_PIXMAP_CONTINUE, @@ -67,12 +65,15 @@ typedef enum STOCK_PIXMAP_PROPERTIES, STOCK_PIXMAP_SYLPHEED_LOGO, STOCK_PIXMAP_ADDRESS_BOOK, + STOCK_PIXMAP_DRAFT, STOCK_PIXMAP_TRASH, STOCK_PIXMAP_UNREAD, STOCK_PIXMAP_VCARD, STOCK_PIXMAP_ONLINE, STOCK_PIXMAP_OFFLINE, STOCK_PIXMAP_MAIL_SMALL, + STOCK_PIXMAP_DELETE, + STOCK_PIXMAP_SPAM, N_STOCK_PIXMAPS } StockPixmap; |