2007-02-20 [colin] 2.7.2cvs58
[claws.git] / src / stock_pixmap.c
index 4524d10caf74aa8e006422e0bbeab6f4d6b43d6d..5d3a0e5ced93dc433c7ba3b57f5993041b9dc3d0 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999-2001 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2007 Hiroyuki Yamamoto and the Claws Mail team
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -14,7 +14,7 @@
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  */
 
 #include "defs.h"
@@ -29,6 +29,8 @@
 #include "utils.h"
 #include "prefs_common.h"
 
+#include "pixmaps/addr_one.xpm"
+#include "pixmaps/addr_two.xpm"
 #include "pixmaps/address.xpm"
 #include "pixmaps/book.xpm"
 #include "pixmaps/category.xpm"
@@ -71,8 +73,8 @@
 #include "pixmaps/paste.xpm"
 #include "pixmaps/preferences.xpm"
 #include "pixmaps/properties.xpm"
-#include "pixmaps/sylpheed_icon.xpm"
-#include "pixmaps/sylpheed_logo.xpm"
+#include "pixmaps/claws-mail_icon.xpm"
+#include "pixmaps/claws-mail_logo.xpm"
 #include "pixmaps/address_book.xpm"
 #include "pixmaps/unread.xpm"
 #include "pixmaps/read.xpm"
 #include "pixmaps/mime_audio.xpm"
 #include "pixmaps/mime_text_enriched.xpm"
 #include "pixmaps/mime_unknown.xpm"
+#include "pixmaps/mime_pdf.xpm"
+#include "pixmaps/mime_ps.xpm"
+#include "pixmaps/mime_calendar.xpm"
+#include "pixmaps/mime_pgpsig.xpm"
 #include "pixmaps/privacy_signed.xpm"
 #include "pixmaps/privacy_passed.xpm"
 #include "pixmaps/privacy_failed.xpm"
 #include "pixmaps/outbox.xpm"
 #include "pixmaps/outbox_hrm.xpm"
 #include "pixmaps/trash.xpm"
+#include "pixmaps/trash_btn.xpm"
 #include "pixmaps/trash_hrm.xpm"
 #include "pixmaps/drafts_close.xpm"
 #include "pixmaps/drafts_open.xpm"
 #include "pixmaps/drafts_close_mark.xpm"
 #include "pixmaps/drafts_open_mark.xpm"
 #include "pixmaps/dir_noselect.xpm"
+#include "pixmaps/spam.xpm"
+#include "pixmaps/spam_btn.xpm"
+#include "pixmaps/ham_btn.xpm"
+#include "pixmaps/moved.xpm"
+#include "pixmaps/copied.xpm"
+#include "pixmaps/active.xpm"
+#include "pixmaps/inactive.xpm"
+#include "pixmaps/empty.xpm"
 
 typedef struct _StockPixmapData        StockPixmapData;
 
@@ -165,6 +180,8 @@ static void stock_pixmap_find_themes_in_dir(GList **list, const gchar *dirname);
 
 static StockPixmapData pixmaps[] =
 {
+       {addr_one_xpm                           , NULL, NULL, "addr_one", NULL},
+       {addr_two_xpm                           , NULL, NULL, "addr_two", NULL},
        {address_xpm                            , NULL, NULL, "address", NULL},
        {address_book_xpm                       , NULL, NULL, "address_book", NULL},
        {address_search_xpm                     , NULL, NULL, "address_search", NULL},
@@ -275,6 +292,10 @@ static StockPixmapData pixmaps[] =
        {mime_audio_xpm                         , NULL, NULL, "mime_audio", NULL},
        {mime_text_enriched_xpm                 , NULL, NULL, "mime_text_enriched", NULL},
        {mime_unknown_xpm                       , NULL, NULL, "mime_unknown", NULL},    
+       {mime_pdf_xpm                           , NULL, NULL, "mime_pdf", NULL},        
+       {mime_ps_xpm                            , NULL, NULL, "mime_ps", NULL}, 
+       {mime_calendar_xpm                      , NULL, NULL, "mime_calendar", NULL},   
+       {mime_pgpsig_xpm                        , NULL, NULL, "mime_pgpsig", NULL},     
        {privacy_signed_xpm                     , NULL, NULL, "privacy_signed", NULL},
        {privacy_passed_xpm                     , NULL, NULL, "privacy_passed", NULL},
        {privacy_failed_xpm                     , NULL, NULL, "privacy_failed", NULL},  
@@ -287,10 +308,19 @@ static StockPixmapData pixmaps[] =
        {privacy_emblem_failed_xpm              , NULL, NULL, "privacy_emblem_failed", NULL},   
        {privacy_emblem_warn_xpm                , NULL, NULL, "privacy_emblem_warn", NULL},
        {mime_message_xpm                       , NULL, NULL, "mime_message", NULL},
-       {sylpheed_icon_xpm                      , NULL, NULL, "sylpheed_icon", NULL},
+       {claws_mail_icon_xpm                    , NULL, NULL, "claws_mail_icon", NULL},
        {read_xpm                               , NULL, NULL, "read", NULL},
-       {sylpheed_logo_xpm                      , NULL, NULL, "sylpheed_logo", NULL},
-        {dir_noselect_xpm                       , NULL, NULL, "dir_noselect" , NULL}
+       {trash_btn_xpm                          , NULL, NULL, "trash_btn", NULL},
+       {claws_mail_logo_xpm                    , NULL, NULL, "claws_mail_logo", NULL},
+        {dir_noselect_xpm                       , NULL, NULL, "dir_noselect" , NULL},
+        {spam_xpm                               , NULL, NULL, "spam" , NULL},
+        {spam_btn_xpm                           , NULL, NULL, "spam_btn" , NULL},
+        {ham_btn_xpm                            , NULL, NULL, "ham_btn" , NULL},
+       {moved_xpm                              , NULL, NULL, "moved", NULL},
+       {copied_xpm                             , NULL, NULL, "copied", NULL},
+       {active_xpm                             , NULL, NULL, "active", NULL},
+       {inactive_xpm                           , NULL, NULL, "inactive", NULL},
+        {empty_xpm                              , NULL, NULL, "empty" , NULL}
 };
 
 /* return newly constructed GtkPixmap from GdkPixmap */
@@ -340,7 +370,7 @@ gint stock_pixbuf_gdk(GtkWidget *window, StockPixmap icon, GdkPixbuf **pixbuf)
                                        if (err) g_error_free(err);
                                }                                       
                                if (pix) {
-                                       if (pix_d->icon_path != NULL) g_free(pix_d->icon_path);
+                                       g_free(pix_d->icon_path);
                                        pix_d->icon_path = g_strdup(prefs_common.pixmap_theme_path);
                                }
                                g_free(icon_file_name);
@@ -356,7 +386,7 @@ gint stock_pixbuf_gdk(GtkWidget *window, StockPixmap icon, GdkPixbuf **pixbuf)
        if (!pix_d->pixbuf) {
                pix_d->pixbuf = gdk_pixbuf_new_from_xpm_data((const gchar **) pix_d->data);
                if (pix_d->pixbuf) {
-                       if (pix_d->icon_path != NULL) g_free(pix_d->icon_path);
+                       g_free(pix_d->icon_path);
                        pix_d->icon_path = g_strdup(DEFAULT_PIXMAP_THEME);      
                }
        }
@@ -400,7 +430,7 @@ gint stock_pixmap_gdk(GtkWidget *window, StockPixmap icon,
                                if (is_file_exist(icon_file_name))
                                        PIXMAP_CREATE_FROM_FILE(window, pix, pix_d->mask, icon_file_name);
                                if (pix) {
-                                       if (pix_d->icon_path != NULL) g_free(pix_d->icon_path);
+                                       g_free(pix_d->icon_path);
                                        pix_d->icon_path = g_strdup(prefs_common.pixmap_theme_path);
                                }
                                g_free(icon_file_name);
@@ -416,7 +446,7 @@ gint stock_pixmap_gdk(GtkWidget *window, StockPixmap icon,
        if (!pix_d->pixmap) {
                PIXMAP_CREATE(window, pix_d->pixmap, pix_d->mask, pix_d->data);
                if (pix_d->pixmap) {
-                       if (pix_d->icon_path != NULL) g_free(pix_d->icon_path);
+                       g_free(pix_d->icon_path);
                        pix_d->icon_path = g_strdup(DEFAULT_PIXMAP_THEME);      
                }
        }
@@ -456,10 +486,11 @@ static void stock_pixmap_find_themes_in_dir(GList **list, const gchar *dirname)
                                filetoexist = g_strconcat(fullentry, G_DIR_SEPARATOR_S, pixmaps[i].file, ".xpm", NULL);
                                if (is_file_exist(filetoexist)) {
                                        *list = g_list_append(*list, fullentry);
+                                       g_free(filetoexist);
                                        break;
                                }
+                               g_free(filetoexist);
                        }
-                       g_free(filetoexist);
                        if (i == N_STOCK_PIXMAPS) 
                                g_free(fullentry);
                } else 
@@ -497,8 +528,7 @@ void stock_pixmap_themes_list_free(GList *list)
        GList *ptr;
 
        for (ptr = g_list_first(list); ptr != NULL; ptr = g_list_next(ptr)) 
-               if (ptr->data)
-                       g_free(ptr->data);
+               g_free(ptr->data);
        g_list_free(list);              
 }