2007-10-08 [paul] 3.0.2cvs32
[claws.git] / src / stock_pixmap.c
index 4a28da9fd248a2865000815d656d3666329f7127..33addfe21383685a49dd7f06b3405b69b87037cf 100644 (file)
@@ -45,6 +45,7 @@
 #include "pixmaps/edit_extern.xpm"
 #include "pixmaps/forwarded.xpm"
 #include "pixmaps/group.xpm"
+#include "pixmaps/insert_file.xpm"
 #include "pixmaps/interface.xpm"
 #include "pixmaps/jpilot.xpm"
 #include "pixmaps/key.xpm"
 #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"
 #include "pixmaps/moved.xpm"
 #include "pixmaps/copied.xpm"
 #include "pixmaps/selection.xpm"
+#include "pixmaps/watchthread.xpm"
 #include "pixmaps/empty.xpm"
 
 typedef struct _StockPixmapData        StockPixmapData;
@@ -196,6 +202,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);
@@ -243,7 +250,7 @@ static StockPixmapData pixmaps[] =
        {inbox_close_hrm_mark_xpm               , NULL, NULL, "inbox_close_hrm_mark", NULL},
        {inbox_open_mark_xpm                    , NULL, NULL, "inbox_open_mark", NULL},
        {inbox_open_hrm_mark_xpm                , NULL, NULL, "inbox_open_hrm_mark", NULL},
-       {paste_xpm                              , NULL, NULL, "insert_file", NULL},
+       {insert_file_xpm                        , NULL, NULL, "insert_file", NULL},
        {interface_xpm                          , NULL, NULL, "interface", NULL},
        {jpilot_xpm                             , NULL, NULL, "jpilot", NULL},
        {key_xpm                                , NULL, NULL, "key", NULL},
@@ -336,7 +343,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},
@@ -344,6 +355,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}
 };
 
@@ -491,7 +503,7 @@ static void stock_pixmap_find_themes_in_dir(GList **list, const gchar *dirname)
        DIR *dp;
        
        if ((dp = opendir(dirname)) == NULL) {
-               debug_print("dir %s not found, skipping theme scan", dirname);
+               debug_print("dir %s not found, skipping theme scan", dirname?dirname:"(null)");
                return;
        }
        
@@ -532,7 +544,7 @@ GList *stock_pixmap_themes_list_new(void)
        
        defaulttheme = g_strdup(DEFAULT_PIXMAP_THEME);
        userthemes   = g_strconcat(get_home_dir(), G_DIR_SEPARATOR_S,
-                                  RC_DIR, G_DIR_SEPARATOR_S, 
+                                  get_rc_dir(), G_DIR_SEPARATOR_S, 
                                   PIXMAP_THEME_DIR, NULL);
        systemthemes = g_strconcat(PACKAGE_DATA_DIR, G_DIR_SEPARATOR_S,
                                   PIXMAP_THEME_DIR, NULL);
@@ -591,6 +603,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);
@@ -728,6 +757,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, 
@@ -736,6 +766,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;
 
 }