summaryrefslogtreecommitdiff
path: root/tests/testgiconpixbuf.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2020-05-14 19:43:01 -0400
committerMatthias Clasen <mclasen@redhat.com>2020-05-14 19:44:08 -0400
commit52c630d9940fa26f85a328eb2609b76bac33792a (patch)
treeac831d2bf544a10ddd9dfc027e19795aaca8f366 /tests/testgiconpixbuf.c
parentaadd9ae20113234e5697903a70580347803e335c (diff)
downloadgtk+-52c630d9940fa26f85a328eb2609b76bac33792a.tar.gz
tests: Drop testgiconpixbuf
More a pixbuf test, and we don't support emblems anymore. See #2738
Diffstat (limited to 'tests/testgiconpixbuf.c')
-rw-r--r--tests/testgiconpixbuf.c91
1 files changed, 0 insertions, 91 deletions
diff --git a/tests/testgiconpixbuf.c b/tests/testgiconpixbuf.c
deleted file mode 100644
index 16b3c1a991..0000000000
--- a/tests/testgiconpixbuf.c
+++ /dev/null
@@ -1,91 +0,0 @@
-/* testgiconpixbuf.c
- * Copyright (C) 2010 Red Hat, Inc.
- * Authors: Cosimo Cecchi
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library. If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include <gtk/gtk.h>
-#include <glib/gstdio.h>
-
-static void
-quit_cb (GtkWidget *widget,
- gpointer data)
-{
- gboolean *done = data;
-
- *done = TRUE;
-
- g_main_context_wakeup (NULL);
-}
-
-int
-main (int argc,
- char **argv)
-{
- GdkPixbuf *pixbuf, *otherpix;
- GtkWidget *image, *image2, *hbox, *vbox, *label, *toplevel;
- GIcon *emblemed;
- GEmblem *emblem;
- gchar *str;
- gboolean done = FALSE;
-
-#ifdef GTK_SRCDIR
- g_chdir (GTK_SRCDIR);
-#endif
-
- gtk_init ();
-
- pixbuf = gdk_pixbuf_new_from_file ("apple-red.png", NULL);
- toplevel = gtk_window_new ();
- hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
- gtk_window_set_child (GTK_WINDOW (toplevel), hbox);
-
- vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12);
- gtk_box_append (GTK_BOX (hbox), vbox);
-
- image = gtk_image_new_from_gicon (G_ICON (pixbuf));
- gtk_image_set_icon_size (GTK_IMAGE (image), GTK_ICON_SIZE_LARGE);
- gtk_box_append (GTK_BOX (vbox), image);
-
- label = gtk_label_new (NULL);
- str = g_strdup_printf ("Normal icon, hash %u", g_icon_hash (G_ICON (pixbuf)));
- gtk_label_set_label (GTK_LABEL (label), str);
- gtk_box_append (GTK_BOX (vbox), label);
-
- otherpix = gdk_pixbuf_new_from_file ("gnome-textfile.png", NULL);
- emblem = g_emblem_new (G_ICON (otherpix));
- emblemed = g_emblemed_icon_new (G_ICON (pixbuf), emblem);
-
- vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12);
- gtk_box_append (GTK_BOX (hbox), vbox);
-
- image2 = gtk_image_new_from_gicon (emblemed);
- gtk_image_set_icon_size (GTK_IMAGE (image2), GTK_ICON_SIZE_LARGE);
- gtk_box_append (GTK_BOX (vbox), image2);
-
- label = gtk_label_new (NULL);
- str = g_strdup_printf ("Emblemed icon, hash %u", g_icon_hash (emblemed));
- gtk_label_set_label (GTK_LABEL (label), str);
- gtk_box_append (GTK_BOX (vbox), label);
-
- gtk_widget_show (toplevel);
-
- g_signal_connect (toplevel, "destroy", G_CALLBACK (quit_cb), &done);
-
- while (!done)
- g_main_context_iteration (NULL, TRUE);
-
- return 0;
-}