2007-07-27 [paul] 2.10.0cvs74
[claws.git] / src / stock_pixmap.c
index 8664a3e699a088ff8b09cd66a434113561e92baa..dda4d16c1666137ec9f7f1ebf999df100881c132 100644 (file)
@@ -4,7 +4,7 @@
  *
  * 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
- * the Free Software Foundation; either version 2 of the License, or
+ * the Free Software Foundation; either version 3 of the License, or
  * (at your option) any later version.
  *
  * This program is distributed in the hope that it will be useful,
@@ -13,8 +13,8 @@
  * GNU General Public License for more details.
  *
  * 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ * 
  */
 
 #include "defs.h"
 #include "pixmaps/queue_open.xpm"
 #include "pixmaps/queue_open_hrm.xpm"
 #include "pixmaps/claws-mail_icon.xpm"
+#ifndef MAEMO
 #include "pixmaps/claws-mail_logo.xpm"
+#else
+#include "pixmaps/claws-mail_logo-small.xpm"
+#endif
 #include "pixmaps/address_book.xpm"
 #include "pixmaps/unread.xpm"
 #include "pixmaps/read.xpm"
@@ -95,6 +99,7 @@
 #include "pixmaps/quicksearch.xpm"
 #include "pixmaps/clip_gpg_signed.xpm"
 #include "pixmaps/gpg_signed.xpm"
+#include "pixmaps/go_folders.xpm"
 #include "pixmaps/mime_text_plain.xpm"
 #include "pixmaps/mime_text_html.xpm"
 #include "pixmaps/mime_application.xpm"
 #include "pixmaps/mime_ps.xpm"
 #include "pixmaps/mime_calendar.xpm"
 #include "pixmaps/mime_pgpsig.xpm"
+#include "pixmaps/printer.xpm"
 #include "pixmaps/privacy_signed.xpm"
 #include "pixmaps/privacy_passed.xpm"
 #include "pixmaps/privacy_failed.xpm"
 #include "pixmaps/moved.xpm"
 #include "pixmaps/copied.xpm"
 #include "pixmaps/selection.xpm"
+#include "pixmaps/watchthread.xpm"
 #include "pixmaps/empty.xpm"
 
 typedef struct _StockPixmapData        StockPixmapData;
@@ -194,6 +201,7 @@ struct _OverlayData
        OverlayPosition position;
        gint border_x;
        gint border_y;
+       gboolean highlight;
 };
 
 static void stock_pixmap_find_themes_in_dir(GList **list, const gchar *dirname);
@@ -302,6 +310,7 @@ static StockPixmapData pixmaps[] =
        {notice_note_xpm                        , NULL, NULL, "notice_note",  NULL},
        {quicksearch_xpm                        , NULL, NULL, "quicksearch",  NULL},
        {gpg_signed_xpm                         , NULL, NULL, "gpg_signed", NULL},
+       {go_folders_xpm                         , NULL, NULL, "go_folders", NULL},
        {drafts_close_xpm                       , NULL, NULL, "drafts_close", NULL},
        {drafts_open_xpm                        , NULL, NULL, "drafts_open", NULL},
        {drafts_close_mark_xpm                  , NULL, NULL, "drafts_close_mark", NULL},
@@ -317,6 +326,7 @@ static StockPixmapData pixmaps[] =
        {mime_ps_xpm                            , NULL, NULL, "mime_ps", NULL}, 
        {mime_calendar_xpm                      , NULL, NULL, "mime_calendar", NULL},   
        {mime_pgpsig_xpm                        , NULL, NULL, "mime_pgpsig", NULL},     
+       {printer_xpm                            , NULL, NULL, "printer", 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},  
@@ -332,7 +342,11 @@ static StockPixmapData pixmaps[] =
        {claws_mail_icon_xpm                    , NULL, NULL, "claws_mail_icon", NULL},
        {read_xpm                               , NULL, NULL, "read", NULL},
        {trash_btn_xpm                          , NULL, NULL, "trash_btn", NULL},
+#ifndef MAEMO
        {claws_mail_logo_xpm                    , NULL, NULL, "claws_mail_logo", NULL},
+#else
+       {claws_mail_logo_small_xpm              , NULL, NULL, "claws_mail_logo_small", NULL},
+#endif
         {dir_noselect_xpm                       , NULL, NULL, "dir_noselect" , NULL},
         {spam_xpm                               , NULL, NULL, "spam" , NULL},
         {spam_btn_xpm                           , NULL, NULL, "spam_btn" , NULL},
@@ -340,6 +354,7 @@ static StockPixmapData pixmaps[] =
        {moved_xpm                              , NULL, NULL, "moved", NULL},
        {copied_xpm                             , NULL, NULL, "copied", NULL},
        {selection_xpm                          , NULL, NULL, "selection", NULL},
+       {watchthread_xpm                        , NULL, NULL, "watchthread", NULL},
         {empty_xpm                              , NULL, NULL, "empty" , NULL}
 };
 
@@ -587,6 +602,23 @@ static gboolean pixmap_with_overlay_expose_event_cb(GtkWidget *widget, GdkEventE
        gdk_window_clear_area (drawable, expose->area.x, expose->area.y,
                               expose->area.width, expose->area.height);
 
+       if (data->highlight) {
+               MainWindow *mw = NULL;
+
+               mw = mainwindow_get_mainwindow();
+               if (mw != NULL && mw->menubar != NULL) {
+                       GdkGC *gc_frame = gdk_gc_new((GdkWindow *)drawable);
+                       GdkColor color = gtk_widget_get_style(mw->menubar)->base[GTK_STATE_SELECTED];
+
+                       gdk_gc_set_foreground(gc_frame, &color);
+                       gdk_gc_set_line_attributes(gc_frame, 1, GDK_LINE_SOLID,
+                                       GDK_CAP_BUTT, GDK_JOIN_BEVEL);
+                       gdk_draw_rectangle(drawable, gc_frame, FALSE, data->border_x-2, data->border_y-2, 
+                                       data->base_width+3, data->base_height+3);
+                       g_object_unref(gc_frame);
+               }
+       }
+
        gdk_gc_set_tile(gc_pix, data->base_pixmap);
        gdk_gc_set_ts_origin(gc_pix, data->border_x, data->border_y);
        gdk_gc_set_clip_mask(gc_pix, data->base_mask);
@@ -724,6 +756,7 @@ GtkWidget *stock_pixmap_widget_with_overlay(GtkWidget *window, StockPixmap icon,
        data->position = pos;
        data->border_x = border_x;
        data->border_y = border_y;
+       data->highlight = FALSE;
 
        widget = gtk_drawing_area_new();
        gtk_drawing_area_size(GTK_DRAWING_AREA(widget), data->base_width + border_x * 2, 
@@ -732,6 +765,7 @@ GtkWidget *stock_pixmap_widget_with_overlay(GtkWidget *window, StockPixmap icon,
                         G_CALLBACK(pixmap_with_overlay_expose_event_cb), data);
        g_signal_connect(G_OBJECT(widget), "destroy",
                         G_CALLBACK(pixmap_with_overlay_destroy_cb), data);
+       g_object_set_data(G_OBJECT(widget), "highlight", &(data->highlight));
        return widget;
 
 }