* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "defs.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#include "claws-features.h"
+#endif
+
#include <glib.h>
#include <gtk/gtk.h>
+#include <librsvg/rsvg.h>
#include <string.h>
#include <dirent.h>
-#include "config.h"
+#include "defs.h"
#include "stock_pixmap.h"
#include "gtkutils.h"
#include "utils.h"
#include "pixmaps/mime_message.xpm"
#include "pixmaps/address_search.xpm"
#include "pixmaps/check_spelling.xpm"
-
#include "pixmaps/dir_close.xpm"
#include "pixmaps/dir_close_hrm.xpm"
#include "pixmaps/dir_open.xpm"
#include "pixmaps/trash_open.xpm"
#include "pixmaps/trash_close.xpm"
#include "pixmaps/delete_btn.xpm"
+#include "pixmaps/delete_dup_btn.xpm"
#include "pixmaps/cancel.xpm"
#include "pixmaps/trash_btn.xpm"
#include "pixmaps/trash_open_hrm.xpm"
{claws_mail_icon_64_xpm , NULL, NULL, "claws_mail_icon_64", NULL, NULL},
{read_xpm , NULL, NULL, "read", NULL, NULL},
{delete_btn_xpm , NULL, NULL, "delete_btn", NULL, NULL},
+ {delete_dup_btn_xpm , NULL, NULL, "delete_dup_btn", NULL, NULL},
{cancel_xpm , NULL, NULL, "cancel", NULL, NULL},
{trash_btn_xpm , NULL, NULL, "trash_btn", NULL, NULL},
{claws_mail_compose_logo_xpm , NULL, NULL, "claws_mail_compose_logo", NULL, NULL},
{empty_xpm , NULL, NULL, "empty", NULL, NULL}
};
+/* Supported theme extensions */
+static const char *extension[] = {
+ ".png",
+ ".xpm",
+#ifdef HAVE_SVG
+ ".svg",
+#endif
+ NULL
+};
+
+/* return current supported extensions */
+const char **stock_pixmap_theme_extensions(void)
+{
+ return extension;
+}
+
/* return newly constructed GtkPixmap from GdkPixmap */
GtkWidget *stock_pixmap_widget(StockPixmap icon)
{
GdkPixbuf *pixbuf;
- cm_return_val_if_fail(icon >= 0 && icon < N_STOCK_PIXMAPS, NULL);
+ cm_return_val_if_fail(icon < N_STOCK_PIXMAPS, NULL);
if (stock_pixbuf_gdk(icon, &pixbuf) != -1)
return gtk_image_new_from_pixbuf(pixbuf);
gint stock_pixbuf_gdk(StockPixmap icon, GdkPixbuf **pixbuf)
{
StockPixmapData *pix_d;
- static const char *extension[]={".png", ".xpm", NULL};
int i = 0;
gboolean theme_changed = FALSE;
if (pixbuf)
*pixbuf = NULL;
- cm_return_val_if_fail(icon >= 0 && icon < N_STOCK_PIXMAPS, -1);
+ cm_return_val_if_fail(icon < N_STOCK_PIXMAPS, -1);
pix_d = &pixmaps[icon];
NULL);
if (is_file_exist(icon_file_name)) {
GError *err = NULL;
+#ifdef HAVE_SVG
+ if (!strncmp(extension[i], ".svg", 4)) {
+ pix = rsvg_pixbuf_from_file(icon_file_name, &err);
+ } else {
+ pix = gdk_pixbuf_new_from_file(icon_file_name, &err);
+ }
+#else
pix = gdk_pixbuf_new_from_file(icon_file_name, &err);
+#endif
if (err) g_error_free(err);
}
if (pix) {
gchar *fullentry;
GDir *dp;
GError *error = NULL;
- static const char *extension[]={".png", ".xpm", NULL};
if ((dp = g_dir_open(dirname, 0, &error)) == NULL) {
debug_print("skipping theme scan, dir %s could not be opened: %s (%d)\n",
gchar *stock_pixmap_get_name (StockPixmap icon)
{
- if (icon < 0 || icon >= N_STOCK_PIXMAPS)
+ if (icon >= N_STOCK_PIXMAPS)
return NULL;
return pixmaps[icon].file;