#include "pixmaps/replied.xpm"
#include "pixmaps/close.xpm"
#include "pixmaps/down_arrow.xpm"
+#include "pixmaps/up_arrow.xpm"
#include "pixmaps/exec.xpm"
#include "pixmaps/mail.xpm"
#include "pixmaps/mail_attach.xpm"
#include "pixmaps/unread.xpm"
#include "pixmaps/vcard.xpm"
#include "pixmaps/ignorethread.xpm"
+#include "pixmaps/work_online.xpm"
+#include "pixmaps/work_offline.xpm"
+#include "pixmaps/notice_warn.xpm"
+#include "pixmaps/notice_error.xpm"
+#include "pixmaps/notice_note.xpm"
typedef struct _StockPixmapData StockPixmapData;
{dir_open_xpm , NULL, NULL, "dir_open", " "},
{dir_open_hrm_xpm , NULL, NULL, "dir_open_hrm", " "},
{down_arrow_xpm , NULL, NULL, "down_arrow", " "},
+ {up_arrow_xpm , NULL, NULL, "up_arrow", " "},
{mail_compose_xpm , NULL, NULL, "edit_extern", " "},
{error_xpm , NULL, NULL, "error", " "},
{exec_xpm , NULL, NULL, "exec", " "},
{trash_hrm_xpm , NULL, NULL, "trash_close_hrm", " "},
{unread_xpm , NULL, NULL, "unread", " "},
{vcard_xpm , NULL, NULL, "vcard", " "},
+ {work_online_xpm , NULL, NULL, "work_online", " "},
+ {work_offline_xpm , NULL, NULL, "work_offline", " "},
+ {notice_warn_xpm , NULL, NULL, "notice_warn", " "},
+ {notice_error_xpm , NULL, NULL, "notice_error", " "},
+ {notice_note_xpm , NULL, NULL, "notice_note", " "},
};
/* return newly constructed GtkPixmap from GdkPixmap */
static void stock_pixmap_find_themes_in_dir(GList **list, const gchar *dirname)
{
- struct dirent **namelist;
- int n;
-
- if ((n = scandir(dirname, &namelist, 0, alphasort)) <= 0)
+ struct dirent *d;
+ DIR *dp;
+
+ if ((dp = opendir(dirname)) == NULL) {
+ FILE_OP_ERROR(dirname, "opendir");
return;
-
- while (n--) {
+ }
+
+ while ((d = readdir(dp)) != NULL) {
gchar *entry;
gchar *fullentry;
- entry = namelist[n]->d_name;
+ entry = d->d_name;
fullentry = g_strconcat(dirname, G_DIR_SEPARATOR_S, entry, NULL);
if (strcmp(entry, ".") != 0 && strcmp(entry, "..") != 0 && is_dir_exist(fullentry)) {
*list = g_list_append(*list, fullentry);
break;
}
- g_free(filetoexist);
}
+ g_free(filetoexist);
if (i == N_STOCK_PIXMAPS)
g_free(fullentry);
- }
- g_free(namelist[n]);
+ } else
+ g_free(fullentry);
}
- g_free(namelist);
+ closedir(dp);
}
GList *stock_pixmap_themes_list_new(void)
g_list_free(list);
}
+gchar *stock_pixmap_get_name (StockPixmap icon)
+{
+ g_return_val_if_fail(icon >= 0 && icon < N_STOCK_PIXMAPS, NULL);
+
+ return pixmaps[icon].file;
+
+}
+
+StockPixmap stock_pixmap_get_icon (gchar *file)
+{
+ gint i;
+
+ for (i = 0; i < N_STOCK_PIXMAPS; i++) {
+ if (strcmp (pixmaps[i].file, file) == 0)
+ return i;
+ }
+ return -1;
+}
+