2014-05-23 14:35:08 +00:00
|
|
|
#include <gtk/gtk.h>
|
|
|
|
|
|
|
|
static char *icon_names[] = {
|
2014-05-24 15:16:35 +00:00
|
|
|
/*** stock icons, from gtkiconfactory.c:get_default_icons() ***/
|
2018-07-27 11:11:51 +00:00
|
|
|
"application-exit",
|
2014-05-23 14:35:08 +00:00
|
|
|
"dialog-error",
|
|
|
|
"dialog-information",
|
2018-07-27 11:11:51 +00:00
|
|
|
"dialog-password",
|
2014-05-23 14:35:08 +00:00
|
|
|
"dialog-question",
|
|
|
|
"dialog-warning",
|
|
|
|
"document-new",
|
|
|
|
"document-open",
|
|
|
|
"document-print",
|
2014-09-22 03:14:56 +00:00
|
|
|
"document-print-preview",
|
2014-05-23 14:35:08 +00:00
|
|
|
"document-properties",
|
|
|
|
"document-revert",
|
|
|
|
"document-save",
|
|
|
|
"document-save-as",
|
2018-07-27 11:11:51 +00:00
|
|
|
"drive-harddisk",
|
|
|
|
"edit-clear",
|
|
|
|
"edit-copy",
|
|
|
|
"edit-cut",
|
|
|
|
"edit-delete",
|
2014-05-23 14:35:08 +00:00
|
|
|
"edit-find",
|
|
|
|
"edit-find-replace",
|
2018-07-27 11:11:51 +00:00
|
|
|
"edit-paste",
|
|
|
|
"edit-redo",
|
|
|
|
"edit-select-all",
|
|
|
|
"edit-undo",
|
|
|
|
"folder",
|
|
|
|
"format-indent-less",
|
|
|
|
"format-indent-more",
|
|
|
|
"format-justify-center",
|
|
|
|
"format-justify-fill",
|
|
|
|
"format-justify-left",
|
|
|
|
"format-justify-right",
|
2014-05-23 14:35:08 +00:00
|
|
|
"format-text-bold",
|
|
|
|
"format-text-italic",
|
|
|
|
"format-text-strikethrough",
|
|
|
|
"format-text-underline",
|
2018-07-27 11:11:51 +00:00
|
|
|
"go-bottom",
|
|
|
|
"go-down",
|
|
|
|
"go-first",
|
|
|
|
"go-home",
|
|
|
|
"go-jump",
|
2014-05-23 14:35:08 +00:00
|
|
|
"go-top",
|
|
|
|
"go-up",
|
2018-07-27 11:11:51 +00:00
|
|
|
"go-last",
|
|
|
|
"go-next",
|
|
|
|
"go-previous",
|
2014-05-23 14:35:08 +00:00
|
|
|
"help-about",
|
2018-07-27 11:11:51 +00:00
|
|
|
"help-contents",
|
|
|
|
"image-missing",
|
|
|
|
"list-add",
|
|
|
|
"list-remove",
|
|
|
|
"media-floppy",
|
|
|
|
"media-optical",
|
2014-05-23 14:35:08 +00:00
|
|
|
"media-playback-pause",
|
|
|
|
"media-playback-start",
|
2018-07-27 11:11:51 +00:00
|
|
|
"media-playback-stop",
|
2014-05-23 14:35:08 +00:00
|
|
|
"media-record",
|
|
|
|
"media-seek-backward",
|
2018-07-27 17:37:00 +00:00
|
|
|
"media-seek-forward",
|
|
|
|
"media-skip-backward",
|
|
|
|
"media-skip-forward",
|
2018-07-27 11:11:51 +00:00
|
|
|
"network-idle",
|
|
|
|
"printer-error",
|
|
|
|
"process-stop",
|
|
|
|
"system-run",
|
|
|
|
"text-x-generic",
|
|
|
|
"tools-check-spelling",
|
|
|
|
"view-fullscreen",
|
|
|
|
"view-sort-ascending",
|
|
|
|
"view-sort-descending",
|
|
|
|
"view-refresh",
|
|
|
|
"view-restore",
|
|
|
|
"window-close",
|
|
|
|
"zoom-fit-best",
|
2014-05-23 14:35:08 +00:00
|
|
|
"zoom-in",
|
2018-07-27 11:11:51 +00:00
|
|
|
"zoom-original",
|
2014-05-23 14:35:08 +00:00
|
|
|
"zoom-out",
|
2014-05-24 15:16:35 +00:00
|
|
|
|
|
|
|
/*** Icons used in code or templates, sorted alphabetically ***/
|
2014-05-23 15:52:12 +00:00
|
|
|
"audio-volume-high",
|
|
|
|
"audio-volume-high-symbolic",
|
2014-05-24 15:16:35 +00:00
|
|
|
"audio-volume-low",
|
2014-05-23 15:52:12 +00:00
|
|
|
"audio-volume-low-symbolic",
|
2014-05-24 15:16:35 +00:00
|
|
|
"audio-volume-medium",
|
2014-05-23 16:17:56 +00:00
|
|
|
"audio-volume-medium-symbolic",
|
2014-05-24 15:16:35 +00:00
|
|
|
"audio-volume-muted",
|
|
|
|
"audio-volume-muted-symbolic",
|
2018-07-27 17:37:00 +00:00
|
|
|
"application-x-executable-symbolic",
|
|
|
|
"applications-other",
|
|
|
|
"appointment-soon-symbolic",
|
2014-05-24 15:16:35 +00:00
|
|
|
"changes-allow-symbolic",
|
|
|
|
"changes-prevent-symbolic",
|
|
|
|
"dialog-password-symbolic",
|
|
|
|
"dialog-warning-symbolic",
|
2014-05-23 16:17:56 +00:00
|
|
|
"document-open-symbolic",
|
2018-07-27 17:37:00 +00:00
|
|
|
"document-save-as-symbolic",
|
|
|
|
"document-save-symbolic",
|
2014-05-23 16:17:56 +00:00
|
|
|
"edit-clear-symbolic",
|
2018-07-27 17:37:00 +00:00
|
|
|
"edit-clear-all-symbolic",
|
|
|
|
"edit-cut-symbolic",
|
|
|
|
"edit-delete-symbolic",
|
2014-05-24 15:16:35 +00:00
|
|
|
"edit-find-symbolic",
|
2018-07-27 17:37:00 +00:00
|
|
|
"edit-paste-symbolic",
|
|
|
|
"emblem-important-symbolic",
|
|
|
|
"emblem-system-symbolic",
|
2018-07-19 21:24:54 +00:00
|
|
|
"emoji-activities-symbolic",
|
|
|
|
"emoji-body-symbolic",
|
|
|
|
"emoji-flags-symbolic",
|
|
|
|
"emoji-food-symbolic",
|
|
|
|
"emoji-nature-symbolic",
|
|
|
|
"emoji-objects-symbolic",
|
|
|
|
"emoji-people-symbolic",
|
|
|
|
"emoji-recent-symbolic",
|
|
|
|
"emoji-symbols-symbolic",
|
|
|
|
"emoji-travel-symbolic",
|
2018-07-27 17:37:00 +00:00
|
|
|
"face-cool-symbolic",
|
|
|
|
"face-laugh-symbolic",
|
|
|
|
"find-location-symbolic",
|
|
|
|
"folder-new-symbolic",
|
|
|
|
"folder-pictures-symbolic",
|
|
|
|
"go-down-symbolic",
|
|
|
|
"go-up-symbolic",
|
|
|
|
"gtk-orientation-landscape",
|
|
|
|
"gtk-orientation-portrait",
|
|
|
|
"gtk-orientation-reverse-landscape",
|
|
|
|
"gtk-orientation-reverse-portrait",
|
|
|
|
"insert-image",
|
|
|
|
"insert-object-symbolic",
|
2014-05-23 16:17:56 +00:00
|
|
|
"list-add-symbolic",
|
|
|
|
"list-remove-symbolic",
|
2018-07-27 17:37:00 +00:00
|
|
|
"media-eject-symbolic",
|
|
|
|
"media-playback-pause-symbolic",
|
|
|
|
"media-playback-start-symbolic",
|
|
|
|
"media-playlist-repeat",
|
|
|
|
"media-record-symbolic",
|
|
|
|
"network-server-symbolic",
|
|
|
|
"object-select-symbolic",
|
2014-07-09 12:03:57 +00:00
|
|
|
"open-menu-symbolic",
|
2014-05-24 15:16:35 +00:00
|
|
|
"pan-down-symbolic",
|
|
|
|
"pan-end-symbolic",
|
|
|
|
"pan-start-symbolic",
|
|
|
|
"pan-up-symbolic",
|
2018-07-27 17:37:00 +00:00
|
|
|
"preferences-desktop-font",
|
|
|
|
"preferences-desktop-locale-symbolic",
|
|
|
|
"send-to-symbolic",
|
|
|
|
"star-new-symbolic",
|
2014-05-24 15:16:35 +00:00
|
|
|
"user-trash-full-symbolic",
|
2014-05-24 02:59:22 +00:00
|
|
|
"user-trash-symbolic",
|
2018-07-27 17:37:00 +00:00
|
|
|
"view-fullscreen-symbolic",
|
|
|
|
"view-grid-symbolic",
|
|
|
|
"view-list-symbolic",
|
|
|
|
"view-refresh-symbolic",
|
2014-05-24 15:16:35 +00:00
|
|
|
"window-close-symbolic",
|
|
|
|
"window-maximize-symbolic",
|
|
|
|
"window-minimize-symbolic",
|
2018-07-27 17:37:00 +00:00
|
|
|
"window-restore-symbolic",
|
|
|
|
"zoom-in-symbolic",
|
|
|
|
"zoom-original-symbolic",
|
|
|
|
"zoom-out-symbolic"
|
2014-05-23 14:35:08 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static void
|
|
|
|
test_icon_existence (gconstpointer icon_name)
|
|
|
|
{
|
|
|
|
GtkIconInfo *info;
|
|
|
|
|
|
|
|
/* Not using generic fallback and builtins here, as we explicitly want to check the
|
|
|
|
* icon theme.
|
|
|
|
* The icon size is randomly chosen.
|
|
|
|
*/
|
2014-09-22 03:14:56 +00:00
|
|
|
info = gtk_icon_theme_lookup_icon (gtk_icon_theme_get_default (), icon_name, 16, GTK_ICON_LOOKUP_DIR_LTR);
|
2014-05-23 14:35:08 +00:00
|
|
|
if (info == NULL)
|
|
|
|
{
|
|
|
|
g_test_message ("Failed to look up icon for \"%s\"", (char *) icon_name);
|
|
|
|
g_test_fail ();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
g_object_unref (info);
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
main (int argc, char *argv[])
|
|
|
|
{
|
|
|
|
guint i;
|
|
|
|
char *test_name;
|
2014-09-21 20:29:48 +00:00
|
|
|
char *theme;
|
2014-05-23 14:35:08 +00:00
|
|
|
|
|
|
|
gtk_test_init (&argc, &argv);
|
|
|
|
|
2014-09-21 20:29:48 +00:00
|
|
|
g_object_get (gtk_settings_get_default (), "gtk-icon-theme-name", &theme, NULL);
|
|
|
|
g_test_message ("Testing icon theme: %s", theme);
|
|
|
|
g_free (theme);
|
|
|
|
|
2014-05-23 14:35:08 +00:00
|
|
|
for (i = 0; i < G_N_ELEMENTS (icon_names); i++)
|
|
|
|
{
|
|
|
|
test_name = g_strdup_printf ("/check-icon-names/%s", icon_names[i]);
|
|
|
|
g_test_add_data_func (test_name, icon_names[i], test_icon_existence);
|
|
|
|
g_free (test_name);
|
|
|
|
}
|
|
|
|
|
|
|
|
return g_test_run();
|
|
|
|
}
|