#include "defs.h"
#include <glib.h>
-#include <gtk/gtkwidget.h>
-#include <gtk/gtkimage.h>
+#include <gtk/gtk.h>
#include <string.h>
#include <dirent.h>
#include "pixmaps/interface.xpm"
#include "pixmaps/jpilot.xpm"
#include "pixmaps/key.xpm"
+#include "pixmaps/key_gpg_signed.xpm"
#include "pixmaps/ldap.xpm"
#include "pixmaps/linewrap.xpm"
#include "pixmaps/linewrapcurrent.xpm"
{interface_xpm , NULL, NULL, "interface", NULL},
{jpilot_xpm , NULL, NULL, "jpilot", NULL},
{key_xpm , NULL, NULL, "key", NULL},
+ {key_gpg_signed_xpm , NULL, NULL, "key_gpg_signed_xpm", NULL},
{ldap_xpm , NULL, NULL, "ldap", NULL},
{linewrapcurrent_xpm , NULL, NULL, "linewrapcurrent", NULL},
{linewrap_xpm , NULL, NULL, "linewrap", NULL},
{claws_mail_icon_xpm , NULL, NULL, "claws_mail_icon", NULL},
{read_xpm , NULL, NULL, "read", NULL},
{delete_btn_xpm , NULL, NULL, "delete_btn", NULL},
- {cancel_xpm , NULL, NULL, "cancel_btn", NULL},
+ {cancel_xpm , NULL, NULL, "cancel", NULL},
{trash_btn_xpm , NULL, NULL, "trash_btn", NULL},
#ifndef GENERIC_UMPC
{claws_mail_logo_xpm , NULL, NULL, "claws_mail_logo", NULL},
{copied_xpm , NULL, NULL, "copied", NULL},
{selection_xpm , NULL, NULL, "selection", NULL},
{watchthread_xpm , NULL, NULL, "watchthread", NULL},
- {tray_newmail_offline_xpm , NULL, NULL, "tray_newmail_offline", NULL},
+ {tray_newmail_offline_xpm , NULL, NULL, "tray_newmail.offline", NULL},
{tray_newmail_xpm , NULL, NULL, "tray_newmail", NULL},
- {tray_newmarkedmail_offline_xpm , NULL, NULL, "tray_newmarkedmail_offline", NULL},
+ {tray_newmarkedmail_offline_xpm , NULL, NULL, "tray_newmarkedmail.offline", NULL},
{tray_newmarkedmail_xpm , NULL, NULL, "tray_newmarkedmail", NULL},
- {tray_nomail_offline_xpm , NULL, NULL, "tray_nomail_offline", NULL},
+ {tray_nomail_offline_xpm , NULL, NULL, "tray_nomail.offline", NULL},
{tray_nomail_xpm , NULL, NULL, "tray_nomail", NULL},
- {tray_unreadmail_offline_xpm , NULL, NULL, "tray_unreadmail_offline", NULL},
+ {tray_unreadmail_offline_xpm , NULL, NULL, "tray_unreadmail.offline", NULL},
{tray_unreadmail_xpm , NULL, NULL, "tray_unreadmail", NULL},
- {tray_unreadmarkedmail_offline_xpm , NULL, NULL, "tray_unreadmarkedmail_offline", NULL},
+ {tray_unreadmarkedmail_offline_xpm , NULL, NULL, "tray_unreadmarkedmail.offline", NULL},
{tray_unreadmarkedmail_xpm , NULL, NULL, "tray_unreadmarkedmail", NULL},
{empty_xpm , NULL, NULL, "empty" , NULL}
};
return 0;
}
-/* create GdkPixmap if it has not created yet */
-gint stock_pixmap_gdk(GtkWidget *window, StockPixmap icon,
- GdkPixmap **pixmap, GdkBitmap **mask)
-{
- StockPixmapData *pix_d;
- static const char *extension[]={".png", ".xpm", NULL};
- int i = 0;
- gboolean theme_changed = FALSE;
-
- if (pixmap) *pixmap = NULL;
- if (mask) *mask = NULL;
-
- g_return_val_if_fail(window != NULL, -1);
- g_return_val_if_fail(icon >= 0 && icon < N_STOCK_PIXMAPS, -1);
-
- pix_d = &pixmaps[icon];
-
- theme_changed = (strcmp2(pix_d->icon_path, prefs_common.pixmap_theme_path) != 0);
- if (!pix_d->pixmap || theme_changed) {
- GdkPixmap *pix = NULL;
-
- if (theme_changed && pix_d->pixbuf) {
- g_object_unref(pix_d->pixbuf);
- pix_d->pixbuf = NULL;
- }
-
- if (strcmp(prefs_common.pixmap_theme_path, DEFAULT_PIXMAP_THEME) != 0) {
- if ( is_dir_exist(prefs_common.pixmap_theme_path) ) {
- char *icon_file_name;
-try_next_extension:
- icon_file_name = g_strconcat(prefs_common.pixmap_theme_path,
- G_DIR_SEPARATOR_S,
- pix_d->file,
- extension[i],
- NULL);
- if (is_file_exist(icon_file_name))
- PIXMAP_CREATE_FROM_FILE(window, pix, pix_d->mask, icon_file_name);
- if (pix) {
- g_free(pix_d->icon_path);
- pix_d->icon_path = g_strdup(prefs_common.pixmap_theme_path);
- }
- g_free(icon_file_name);
- if (!pix) {
- i++;
- if (extension[i])
- goto try_next_extension;
- }
- } else {
- /* even the path does not exist (deleted between two sessions), so
- set the preferences to the internal theme */
- prefs_common.pixmap_theme_path = g_strdup(DEFAULT_PIXMAP_THEME);
- }
- }
- pix_d->pixmap = pix;
- }
-
- if (!pix_d->pixmap) {
- PIXMAP_CREATE(window, pix_d->pixmap, pix_d->mask, pix_d->data);
- if (pix_d->pixmap) {
- g_free(pix_d->icon_path);
- pix_d->icon_path = g_strdup(DEFAULT_PIXMAP_THEME);
- }
- }
-
- g_return_val_if_fail(pix_d->pixmap != NULL, -1);
-
- if (pixmap)
- *pixmap = pix_d->pixmap;
- if (mask)
- *mask = pix_d->mask;
-
- return 0;
-}
-
static void stock_pixmap_find_themes_in_dir(GList **list, const gchar *dirname)
{
struct dirent *d;
closedir(dp);
}
+gchar *stock_pixmap_get_system_theme_dir_for_theme(const gchar *theme)
+{
+ const gchar *sep = NULL;
+ if (theme && *theme)
+ sep = G_DIR_SEPARATOR_S;
+#ifndef G_OS_WIN32
+ return g_strconcat(PACKAGE_DATA_DIR, G_DIR_SEPARATOR_S,
+ PIXMAP_THEME_DIR, sep, theme, NULL);
+#else
+ return g_strconcat(get_themes_dir(), sep, theme, NULL);
+#endif
+}
+
GList *stock_pixmap_themes_list_new(void)
{
gchar *defaulttheme;
defaulttheme = g_strdup(DEFAULT_PIXMAP_THEME);
userthemes = g_strconcat(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);
+ systemthemes = stock_pixmap_get_system_theme_dir_for_theme(NULL);
list = g_list_append(list, defaulttheme);
-
stock_pixmap_find_themes_in_dir(&list, userthemes);
stock_pixmap_find_themes_in_dir(&list, systemthemes);
data->highlight = FALSE;
widget = gtk_drawing_area_new();
- gtk_drawing_area_size(GTK_DRAWING_AREA(widget), data->base_width + border_x * 2,
+ gtk_widget_set_size_request(widget, data->base_width + border_x * 2,
data->base_height + border_y * 2);
g_signal_connect(G_OBJECT(widget), "expose_event",
G_CALLBACK(pixmap_with_overlay_expose_event_cb), data);