Blame demos/testpixbuf.c

Packit 98cdb6
/* testpixbuf -- test program for gdk-pixbuf code
Packit 98cdb6
 * Copyright (C) 1999 Mark Crichton, Larry Ewing
Packit 98cdb6
 *
Packit 98cdb6
 * This library is free software; you can redistribute it and/or
Packit 98cdb6
 * modify it under the terms of the GNU Lesser General Public
Packit 98cdb6
 * License as published by the Free Software Foundation; either
Packit 98cdb6
 * version 2 of the License, or (at your option) any later version.
Packit 98cdb6
 *
Packit 98cdb6
 * This library is distributed in the hope that it will be useful,
Packit 98cdb6
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 98cdb6
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 98cdb6
 * Lesser General Public License for more details.
Packit 98cdb6
 *
Packit 98cdb6
 * You should have received a copy of the GNU Lesser General Public
Packit 98cdb6
 * License along with this library; if not, write to the
Packit 98cdb6
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Packit 98cdb6
 * Boston, MA 02111-1307, USA.
Packit 98cdb6
 */
Packit 98cdb6
Packit 98cdb6
#include "config.h"
Packit 98cdb6
#include <stdio.h>
Packit 98cdb6
#include <stdlib.h>
Packit 98cdb6
#include <unistd.h>
Packit 98cdb6
#include <string.h>
Packit 98cdb6
Packit 98cdb6
#undef GDK_DISABLE_DEPRECATED
Packit 98cdb6
Packit 98cdb6
#include <gtk/gtk.h>
Packit 98cdb6
#include <gdk-pixbuf/gdk-pixbuf.h>
Packit 98cdb6
Packit 98cdb6
#include "test-inline-pixbufs.h"
Packit 98cdb6
Packit 98cdb6
typedef struct {
Packit 98cdb6
	FILE             *imagefile;
Packit 98cdb6
	GdkPixbufLoader  *loader;
Packit 98cdb6
	GtkWidget        **rgbwin;
Packit 98cdb6
	guchar           *buf;
Packit 98cdb6
	guint            timeout;
Packit 98cdb6
	guint            readlen;
Packit 98cdb6
} ProgressFileStatus;
Packit 98cdb6
Packit 98cdb6
Packit 98cdb6
#define DEFAULT_WIDTH  24
Packit 98cdb6
#define DEFAULT_HEIGHT 24
Packit 98cdb6
Packit 98cdb6
static const unsigned char default_image[] = {
Packit 98cdb6
	0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
Packit 98cdb6
	0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
Packit 98cdb6
	0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
Packit 98cdb6
	0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
Packit 98cdb6
	0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
Packit 98cdb6
	0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
Packit 98cdb6
	0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
Packit 98cdb6
	0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
Packit 98cdb6
	0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
Packit 98cdb6
	0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
Packit 98cdb6
	0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
Packit 98cdb6
	0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
Packit 98cdb6
	0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
Packit 98cdb6
	0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
Packit 98cdb6
	0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
Packit 98cdb6
	0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
Packit 98cdb6
	0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
Packit 98cdb6
	0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
Packit 98cdb6
	0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
Packit 98cdb6
	0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
Packit 98cdb6
	0xff, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
Packit 98cdb6
	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff,
Packit 98cdb6
	0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
Packit 98cdb6
	0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
Packit 98cdb6
	0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
Packit 98cdb6
	0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0x00, 0x00, 0x00,
Packit 98cdb6
	0x00, 0x00, 0x00, 0xae, 0xb3, 0xb3, 0xc6, 0xc9, 0xcd, 0xd7, 0xd4, 0xdf,
Packit 98cdb6
	0xec, 0xde, 0xf3, 0xe7, 0xcb, 0xe9, 0xd9, 0xb5, 0xd3, 0x00, 0x00, 0x00,
Packit 98cdb6
	0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
Packit 98cdb6
	0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
Packit 98cdb6
	0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
Packit 98cdb6
	0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0x00, 0x00, 0x00, 0xb1, 0xb7, 0xa5,
Packit 98cdb6
	0xb0, 0xb8, 0xad, 0xb3, 0xb9, 0xb6, 0xc1, 0xc6, 0xc8, 0xd5, 0xd3, 0xdc,
Packit 98cdb6
	0xec, 0xde, 0xf3, 0xe5, 0xca, 0xe6, 0xe0, 0xbb, 0xd7, 0xe1, 0xad, 0xc2,
Packit 98cdb6
	0xe3, 0xac, 0xa3, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
Packit 98cdb6
	0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
Packit 98cdb6
	0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
Packit 98cdb6
	0xff, 0x00, 0xff, 0x00, 0x00, 0x00, 0xca, 0xc1, 0xa4, 0xc5, 0xc7, 0xac,
Packit 98cdb6
	0xb7, 0xbe, 0xaf, 0xad, 0xb4, 0xaf, 0xbd, 0xc2, 0xc3, 0xd1, 0xd0, 0xd8,
Packit 98cdb6
	0xec, 0xde, 0xf3, 0xe5, 0xc7, 0xe4, 0xe0, 0xb6, 0xd1, 0xe7, 0xa9, 0xb4,
Packit 98cdb6
	0xed, 0xcd, 0xb6, 0xd6, 0xcf, 0xae, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff,
Packit 98cdb6
	0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
Packit 98cdb6
	0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
Packit 98cdb6
	0x00, 0x00, 0x00, 0xdf, 0xa7, 0x9f, 0xdd, 0xbf, 0xaa, 0xcf, 0xc5, 0xa9,
Packit 98cdb6
	0xc1, 0xc4, 0xac, 0xb2, 0xba, 0xaf, 0xb6, 0xbb, 0xbb, 0xcd, 0xce, 0xd4,
Packit 98cdb6
	0xec, 0xde, 0xf3, 0xe4, 0xc4, 0xe1, 0xe0, 0xaf, 0xc7, 0xea, 0xbc, 0xae,
Packit 98cdb6
	0xe1, 0xd6, 0xb6, 0xc7, 0xcc, 0xae, 0xa2, 0xab, 0x9a, 0x00, 0x00, 0x00,
Packit 98cdb6
	0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
Packit 98cdb6
	0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
Packit 98cdb6
	0x00, 0x00, 0x00, 0xe3, 0xab, 0xc0, 0xe6, 0xa3, 0xa7, 0xdf, 0xba, 0xa8,
Packit 98cdb6
	0xcf, 0xc5, 0xa9, 0xbd, 0xc2, 0xae, 0xad, 0xb4, 0xaf, 0xc6, 0xc9, 0xcd,
Packit 98cdb6
	0xec, 0xde, 0xf3, 0xe2, 0xbf, 0xdc, 0xe7, 0xa9, 0xb4, 0xe7, 0xd6, 0xb8,
Packit 98cdb6
	0xc7, 0xcc, 0xae, 0xac, 0xb6, 0xa6, 0x9d, 0xa8, 0x9f, 0x00, 0x00, 0x00,
Packit 98cdb6
	0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
Packit 98cdb6
	0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0x00, 0x00, 0x00,
Packit 98cdb6
	0xd9, 0xaf, 0xcf, 0xe1, 0xb4, 0xd2, 0xe2, 0xb0, 0xcb, 0xe4, 0xa9, 0xbb,
Packit 98cdb6
	0xe2, 0xb2, 0xa6, 0xcf, 0xc5, 0xa9, 0x6a, 0x6a, 0x6a, 0x0d, 0x0d, 0x0d,
Packit 98cdb6
	0x0d, 0x0d, 0x0d, 0x6a, 0x6a, 0x6a, 0xed, 0xcd, 0xb6, 0xc7, 0xcc, 0xae,
Packit 98cdb6
	0xa6, 0xb1, 0xa3, 0x98, 0xa2, 0x9c, 0x8f, 0x97, 0x96, 0x7e, 0x84, 0x85,
Packit 98cdb6
	0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
Packit 98cdb6
	0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0x00, 0x00, 0x00,
Packit 98cdb6
	0xe8, 0xc6, 0xe7, 0xe5, 0xc2, 0xe3, 0xe3, 0xbd, 0xdd, 0xe1, 0xb6, 0xd5,
Packit 98cdb6
	0xe2, 0xb0, 0xcb, 0x6a, 0x6a, 0x6a, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff,
Packit 98cdb6
	0xff, 0x00, 0xff, 0x00, 0x00, 0x00, 0x6a, 0x6a, 0x6a, 0x9d, 0xa8, 0x9f,
Packit 98cdb6
	0x8f, 0x97, 0x96, 0x8b, 0x90, 0x92, 0x97, 0x9e, 0xa2, 0xa0, 0xa7, 0xae,
Packit 98cdb6
	0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
Packit 98cdb6
	0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0x00, 0x00, 0x00,
Packit 98cdb6
	0xe7, 0xd3, 0xed, 0xe8, 0xd1, 0xed, 0xe8, 0xce, 0xec, 0xe9, 0xcc, 0xeb,
Packit 98cdb6
	0xe8, 0xc6, 0xe7, 0x0d, 0x0d, 0x0d, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
Packit 98cdb6
	0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0x0d, 0x0d, 0x0d, 0x97, 0x9e, 0xa2,
Packit 98cdb6
	0xa7, 0xae, 0xb7, 0xb2, 0xb6, 0xc5, 0xba, 0xbc, 0xce, 0xbf, 0xbe, 0xd3,
Packit 98cdb6
	0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
Packit 98cdb6
	0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0x00, 0x00, 0x00,
Packit 98cdb6
	0xe9, 0xdf, 0xf0, 0xe9, 0xdf, 0xf0, 0xe9, 0xdf, 0xf0, 0xe9, 0xdf, 0xf0,
Packit 98cdb6
	0xe9, 0xdf, 0xf0, 0x0d, 0x0d, 0x0d, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
Packit 98cdb6
	0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0x0d, 0x0d, 0x0d, 0xe1, 0xd2, 0xf7,
Packit 98cdb6
	0xe1, 0xd2, 0xf7, 0xe1, 0xd2, 0xf7, 0xe1, 0xd2, 0xf7, 0xe1, 0xd2, 0xf7,
Packit 98cdb6
	0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
Packit 98cdb6
	0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0x00, 0x00, 0x00,
Packit 98cdb6
	0xca, 0xc7, 0xd2, 0xc5, 0xc4, 0xcd, 0xbf, 0xbf, 0xc7, 0xb8, 0xb9, 0xc0,
Packit 98cdb6
	0xae, 0xaf, 0xb6, 0x6a, 0x6a, 0x6a, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff,
Packit 98cdb6
	0xff, 0x00, 0xff, 0x00, 0x00, 0x00, 0x6a, 0x6a, 0x6a, 0xd5, 0xa8, 0xe1,
Packit 98cdb6
	0xd8, 0xb2, 0xe9, 0xd9, 0xb8, 0xed, 0xdb, 0xbd, 0xf0, 0xdc, 0xbf, 0xf1,
Packit 98cdb6
	0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
Packit 98cdb6
	0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0x00, 0x00, 0x00,
Packit 98cdb6
	0xa4, 0xa6, 0xac, 0xa8, 0xaa, 0xaf, 0xa0, 0xa6, 0xa8, 0x98, 0x9e, 0x9c,
Packit 98cdb6
	0xa1, 0xa8, 0x9e, 0xb1, 0xb6, 0xa1, 0x6a, 0x6a, 0x6a, 0x0d, 0x0d, 0x0d,
Packit 98cdb6
	0x0d, 0x0d, 0x0d, 0x6a, 0x6a, 0x6a, 0xc0, 0x8c, 0xad, 0xcc, 0x90, 0xb5,
Packit 98cdb6
	0xd3, 0x94, 0xca, 0xd6, 0xa2, 0xdb, 0xd5, 0xa8, 0xe1, 0xcf, 0xa7, 0xdf,
Packit 98cdb6
	0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
Packit 98cdb6
	0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
Packit 98cdb6
	0x00, 0x00, 0x00, 0x98, 0x9f, 0x9b, 0xa1, 0xa8, 0x9e, 0xac, 0xb3, 0xa0,
Packit 98cdb6
	0xb9, 0xb9, 0xa4, 0xd0, 0xb8, 0xa8, 0xc5, 0xb5, 0xb8, 0xb6, 0xbb, 0xad,
Packit 98cdb6
	0xe3, 0xd7, 0xb5, 0xdd, 0xb4, 0xa9, 0xcb, 0x89, 0xac, 0xc0, 0x8c, 0xad,
Packit 98cdb6
	0xc8, 0x91, 0xb5, 0xd1, 0x8d, 0xb7, 0xd3, 0x94, 0xca, 0x00, 0x00, 0x00,
Packit 98cdb6
	0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
Packit 98cdb6
	0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
Packit 98cdb6
	0x00, 0x00, 0x00, 0xa1, 0xa7, 0x98, 0xb1, 0xb6, 0xa1, 0xbd, 0xb9, 0xa5,
Packit 98cdb6
	0xd0, 0xb8, 0xa8, 0xca, 0xb5, 0xb7, 0xb8, 0xb1, 0xb1, 0xc2, 0xc8, 0xb2,
Packit 98cdb6
	0xe3, 0xd7, 0xb5, 0xe1, 0xbf, 0xaf, 0xdb, 0x92, 0x9a, 0xbe, 0x82, 0xa6,
Packit 98cdb6
	0xc0, 0x8c, 0xad, 0xc8, 0x91, 0xb4, 0xc7, 0x8b, 0xb0, 0x00, 0x00, 0x00,
Packit 98cdb6
	0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
Packit 98cdb6
	0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
Packit 98cdb6
	0xff, 0x00, 0xff, 0x00, 0x00, 0x00, 0xbc, 0xb6, 0xa1, 0xd0, 0xb8, 0xa8,
Packit 98cdb6
	0xcd, 0xb6, 0xb7, 0xc0, 0xb4, 0xb5, 0xb1, 0xb1, 0xaa, 0xca, 0xd1, 0xb4,
Packit 98cdb6
	0xe3, 0xd7, 0xb5, 0xe2, 0xc1, 0xb0, 0xdb, 0xa8, 0xa3, 0xd2, 0x8a, 0xa9,
Packit 98cdb6
	0xb7, 0x7e, 0xa2, 0xbd, 0x89, 0xa9, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff,
Packit 98cdb6
	0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
Packit 98cdb6
	0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
Packit 98cdb6
	0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0x00, 0x00, 0x00, 0xc9, 0xaf, 0xaf,
Packit 98cdb6
	0xc5, 0xb5, 0xb8, 0xb8, 0xb1, 0xb1, 0xb6, 0xbb, 0xad, 0xd0, 0xd6, 0xb5,
Packit 98cdb6
	0xe3, 0xd7, 0xb5, 0xe2, 0xbf, 0xaf, 0xdd, 0xb4, 0xa9, 0xdb, 0x92, 0x9a,
Packit 98cdb6
	0xc6, 0x84, 0xa7, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
Packit 98cdb6
	0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
Packit 98cdb6
	0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
Packit 98cdb6
	0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0x00, 0x00, 0x00,
Packit 98cdb6
	0x00, 0x00, 0x00, 0xac, 0xaa, 0xa6, 0xbd, 0xc3, 0xb0, 0xd2, 0xd7, 0xb5,
Packit 98cdb6
	0xe3, 0xd7, 0xb5, 0xe2, 0xbf, 0xae, 0xdb, 0xb6, 0xa8, 0x00, 0x00, 0x00,
Packit 98cdb6
	0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
Packit 98cdb6
	0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
Packit 98cdb6
	0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
Packit 98cdb6
	0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
Packit 98cdb6
	0xff, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
Packit 98cdb6
	0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff,
Packit 98cdb6
	0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
Packit 98cdb6
	0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
Packit 98cdb6
	0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
Packit 98cdb6
	0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
Packit 98cdb6
	0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
Packit 98cdb6
	0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
Packit 98cdb6
	0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
Packit 98cdb6
	0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
Packit 98cdb6
	0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
Packit 98cdb6
	0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
Packit 98cdb6
	0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
Packit 98cdb6
	0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
Packit 98cdb6
	0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
Packit 98cdb6
	0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
Packit 98cdb6
	0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
Packit 98cdb6
	0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
Packit 98cdb6
	0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
Packit 98cdb6
	0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
Packit 98cdb6
	0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
Packit 98cdb6
	0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff
Packit 98cdb6
};
Packit 98cdb6
Packit 98cdb6
Packit 98cdb6
static const char * book_open_xpm[] = {
Packit 98cdb6
"16 16 4 1",
Packit 98cdb6
"       c None s None",
Packit 98cdb6
".      c black",
Packit 98cdb6
"X      c #808080",
Packit 98cdb6
"o      c white",
Packit 98cdb6
"                ",
Packit 98cdb6
"  ..            ",
Packit 98cdb6
" .Xo.    ...    ",
Packit 98cdb6
" .Xoo. ..oo.    ",
Packit 98cdb6
" .Xooo.Xooo...  ",
Packit 98cdb6
" .Xooo.oooo.X.  ",
Packit 98cdb6
" .Xooo.Xooo.X.  ",
Packit 98cdb6
" .Xooo.oooo.X.  ",
Packit 98cdb6
" .Xooo.Xooo.X.  ",
Packit 98cdb6
" .Xooo.oooo.X.  ",
Packit 98cdb6
"  .Xoo.Xoo..X.  ",
Packit 98cdb6
"   .Xo.o..ooX.  ",
Packit 98cdb6
"    .X..XXXXX.  ",
Packit 98cdb6
"    ..X.......  ",
Packit 98cdb6
"     ..         ",
Packit 98cdb6
"                "};
Packit 98cdb6
Packit 98cdb6
static const char * book_closed_xpm[] = {
Packit 98cdb6
"16 16 6 1",
Packit 98cdb6
"       c None s None",
Packit 98cdb6
".      c black",
Packit 98cdb6
"X      c red",
Packit 98cdb6
"o      c yellow",
Packit 98cdb6
"O      c #808080",
Packit 98cdb6
"#      c white",
Packit 98cdb6
"                ",
Packit 98cdb6
"       ..       ",
Packit 98cdb6
"     ..XX.      ",
Packit 98cdb6
"   ..XXXXX.     ",
Packit 98cdb6
" ..XXXXXXXX.    ",
Packit 98cdb6
".ooXXXXXXXXX.   ",
Packit 98cdb6
"..ooXXXXXXXXX.  ",
Packit 98cdb6
".X.ooXXXXXXXXX. ",
Packit 98cdb6
".XX.ooXXXXXX..  ",
Packit 98cdb6
" .XX.ooXXX..#O  ",
Packit 98cdb6
"  .XX.oo..##OO. ",
Packit 98cdb6
"   .XX..##OO..  ",
Packit 98cdb6
"    .X.#OO..    ",
Packit 98cdb6
"     ..O..      ",
Packit 98cdb6
"      ..        ",
Packit 98cdb6
"                "};
Packit 98cdb6
Packit 98cdb6
static const char * mini_page_xpm[] = {
Packit 98cdb6
"16 16 4 1",
Packit 98cdb6
"       c None s None",
Packit 98cdb6
".      c black",
Packit 98cdb6
"X      c white",
Packit 98cdb6
"o      c #808080",
Packit 98cdb6
"                ",
Packit 98cdb6
"   .......      ",
Packit 98cdb6
"   .XXXXX..     ",
Packit 98cdb6
"   .XoooX.X.    ",
Packit 98cdb6
"   .XXXXX....   ",
Packit 98cdb6
"   .XooooXoo.o  ",
Packit 98cdb6
"   .XXXXXXXX.o  ",
Packit 98cdb6
"   .XooooooX.o  ",
Packit 98cdb6
"   .XXXXXXXX.o  ",
Packit 98cdb6
"   .XooooooX.o  ",
Packit 98cdb6
"   .XXXXXXXX.o  ",
Packit 98cdb6
"   .XooooooX.o  ",
Packit 98cdb6
"   .XXXXXXXX.o  ",
Packit 98cdb6
"   ..........o  ",
Packit 98cdb6
"    oooooooooo  ",
Packit 98cdb6
"                "};
Packit 98cdb6
Packit 98cdb6
static const char * gtk_mini_xpm[] = {
Packit 98cdb6
"15 20 17 1",
Packit 98cdb6
"       c None",
Packit 98cdb6
".      c #14121F",
Packit 98cdb6
"+      c #278828",
Packit 98cdb6
"@      c #9B3334",
Packit 98cdb6
"#      c #284C72",
Packit 98cdb6
"$      c #24692A",
Packit 98cdb6
"%      c #69282E",
Packit 98cdb6
"&      c #37C539",
Packit 98cdb6
"*      c #1D2F4D",
Packit 98cdb6
"=      c #6D7076",
Packit 98cdb6
"-      c #7D8482",
Packit 98cdb6
";      c #E24A49",
Packit 98cdb6
">      c #515357",
Packit 98cdb6
",      c #9B9C9B",
Packit 98cdb6
"'      c #2FA232",
Packit 98cdb6
")      c #3CE23D",
Packit 98cdb6
"!      c #3B6CCB",
Packit 98cdb6
"               ",
Packit 98cdb6
"      ***>     ",
Packit 98cdb6
"    >.*!!!*    ",
Packit 98cdb6
"   ***....#*=  ",
Packit 98cdb6
"  *!*.!!!**!!# ",
Packit 98cdb6
" .!!#*!#*!!!!# ",
Packit 98cdb6
" @%#!.##.*!!$& ",
Packit 98cdb6
" @;%*!*.#!#')) ",
Packit 98cdb6
" @;;@%!!*$&)'' ",
Packit 98cdb6
" @%.%@%$'&)$+' ",
Packit 98cdb6
" @;...@$'*'*)+ ",
Packit 98cdb6
" @;%..@$+*.')$ ",
Packit 98cdb6
" @;%%;;$+..$)# ",
Packit 98cdb6
" @;%%;@$$$'.$# ",
Packit 98cdb6
" %;@@;;$$+))&* ",
Packit 98cdb6
"  %;;;@+$&)&*  ",
Packit 98cdb6
"   %;;@'))+>   ",
Packit 98cdb6
"    %;@'&#     ",
Packit 98cdb6
"     >%$$      ",
Packit 98cdb6
"      >=       "};
Packit 98cdb6
Packit 98cdb6
const gchar ** xpms[] = { 
Packit 98cdb6
  book_open_xpm,
Packit 98cdb6
  book_closed_xpm,
Packit 98cdb6
  mini_page_xpm,
Packit 98cdb6
  gtk_mini_xpm,
Packit 98cdb6
  NULL
Packit 98cdb6
};
Packit 98cdb6
Packit 98cdb6
static void
Packit 98cdb6
quit_func (GtkWidget *widget, gpointer dummy)
Packit 98cdb6
{
Packit 98cdb6
	gtk_main_quit ();
Packit 98cdb6
}
Packit 98cdb6
Packit 98cdb6
static void
Packit 98cdb6
expose_func (GtkWidget *drawing_area, GdkEventExpose *event, gpointer data)
Packit 98cdb6
{
Packit 98cdb6
	GdkPixbuf *pixbuf;
Packit 98cdb6
Packit 98cdb6
	pixbuf = (GdkPixbuf *)g_object_get_data (G_OBJECT (drawing_area), "pixbuf");
Packit 98cdb6
Packit 98cdb6
	if (gdk_pixbuf_get_has_alpha (pixbuf)) {
Packit 98cdb6
		GdkPixbuf *dest;
Packit 98cdb6
                cairo_t *cr;
Packit 98cdb6
	  
Packit 98cdb6
		gdk_window_set_back_pixmap (drawing_area->window, NULL, FALSE);
Packit 98cdb6
	  
Packit 98cdb6
		dest = gdk_pixbuf_new (GDK_COLORSPACE_RGB, FALSE, 8, event->area.width, event->area.height);
Packit 98cdb6
		
Packit 98cdb6
		gdk_pixbuf_composite_color (pixbuf, dest,
Packit 98cdb6
					    0, 0, event->area.width, event->area.height,
Packit 98cdb6
					    -event->area.x, -event->area.y,
Packit 98cdb6
					    (double) drawing_area->allocation.width / gdk_pixbuf_get_width (pixbuf),
Packit 98cdb6
					    (double) drawing_area->allocation.height / gdk_pixbuf_get_height (pixbuf),
Packit 98cdb6
					    GDK_INTERP_BILINEAR, 255,
Packit 98cdb6
					    event->area.x, event->area.y, 16, 0xaaaaaa, 0x555555);
Packit 98cdb6
		
Packit 98cdb6
                cr = gdk_cairo_create (drawing_area->window);
Packit 98cdb6
Packit 98cdb6
                gdk_cairo_set_source_pixbuf (cr, dest, 0, 0);
Packit 98cdb6
                gdk_cairo_rectangle (cr, &event->area);
Packit 98cdb6
                cairo_fill (cr);
Packit 98cdb6
Packit 98cdb6
                cairo_destroy (cr);
Packit 98cdb6
		g_object_unref (dest);
Packit 98cdb6
	} else {
Packit 98cdb6
		gdk_draw_rgb_image (drawing_area->window,
Packit 98cdb6
				    drawing_area->style->white_gc,
Packit 98cdb6
				    event->area.x, event->area.y, 
Packit 98cdb6
				    event->area.width, 
Packit 98cdb6
				    event->area.height,
Packit 98cdb6
				    GDK_RGB_DITHER_NORMAL,
Packit 98cdb6
				    gdk_pixbuf_get_pixels (pixbuf)
Packit 98cdb6
				    + (event->area.y * gdk_pixbuf_get_rowstride (pixbuf))
Packit 98cdb6
				    + (event->area.x * gdk_pixbuf_get_n_channels (pixbuf)),
Packit 98cdb6
				    gdk_pixbuf_get_rowstride (pixbuf));
Packit 98cdb6
	}
Packit 98cdb6
}
Packit 98cdb6
Packit 98cdb6
static void
Packit 98cdb6
config_func (GtkWidget *drawing_area, GdkEventConfigure *event, gpointer data)
Packit 98cdb6
{
Packit 98cdb6
#if 0
Packit 98cdb6
	GdkPixbuf *pixbuf;
Packit 98cdb6
    
Packit 98cdb6
	pixbuf = (GdkPixbuf *)g_object_get_data (G_OBJECT (drawing_area), "pixbuf");
Packit 98cdb6
Packit 98cdb6
	if (((event->width) != gdk_pixbuf_get_width (pixbuf)) ||
Packit 98cdb6
	    ((event->height) != gdk_pixbuf_get_height (pixbuf)))
Packit 98cdb6
		gdk_pixbuf_scale (pixbuf, event->width, event->height);
Packit 98cdb6
#endif
Packit 98cdb6
}
Packit 98cdb6
Packit 98cdb6
static GtkWidget*
Packit 98cdb6
new_testrgb_window (GdkPixbuf *pixbuf, gchar *title)
Packit 98cdb6
{
Packit 98cdb6
	GtkWidget *window;
Packit 98cdb6
	GtkWidget *vbox;
Packit 98cdb6
	GtkWidget *temp_box;
Packit 98cdb6
	GtkWidget *button;
Packit 98cdb6
	GtkWidget *drawing_area;
Packit 98cdb6
	gint w, h;
Packit 98cdb6
Packit 98cdb6
        g_return_val_if_fail (pixbuf != NULL, NULL);
Packit 98cdb6
	w = gdk_pixbuf_get_width (pixbuf);
Packit 98cdb6
	h = gdk_pixbuf_get_height (pixbuf);
Packit 98cdb6
Packit 98cdb6
	window = g_object_new (gtk_window_get_type (),
Packit 98cdb6
				 "GtkObject::user_data", NULL,
Packit 98cdb6
				 "GtkWindow::type", GTK_WINDOW_TOPLEVEL,
Packit 98cdb6
				 "GtkWindow::title", title ? title : "testrgb",
Packit 98cdb6
				 "GtkWindow::allow_shrink", TRUE,
Packit 98cdb6
				 NULL);
Packit 98cdb6
	g_signal_connect (window, "destroy",
Packit 98cdb6
			  G_CALLBACK (quit_func), NULL);
Packit 98cdb6
Packit 98cdb6
	vbox = gtk_vbox_new (FALSE, 0);
Packit 98cdb6
Packit 98cdb6
	if (title)
Packit 98cdb6
		gtk_box_pack_start (GTK_BOX (vbox), gtk_label_new (title),
Packit 98cdb6
				    TRUE, TRUE, 0);
Packit 98cdb6
Packit 98cdb6
	drawing_area = gtk_drawing_area_new ();
Packit 98cdb6
Packit 98cdb6
	temp_box = gtk_hbox_new (FALSE, 0);
Packit 98cdb6
	gtk_widget_set_size_request (GTK_WIDGET (drawing_area), w, h);
Packit 98cdb6
	gtk_box_pack_start (GTK_BOX (temp_box), drawing_area, FALSE, FALSE, 0);
Packit 98cdb6
	gtk_box_pack_start (GTK_BOX (vbox), temp_box, FALSE, FALSE, 0);
Packit 98cdb6
	
Packit 98cdb6
Packit 98cdb6
	g_signal_connect (drawing_area, "expose_event",
Packit 98cdb6
			  G_CALLBACK (expose_func), NULL);
Packit 98cdb6
	g_signal_connect (drawing_area, "configure_event",
Packit 98cdb6
			  G_CALLBACK (config_func), NULL);
Packit 98cdb6
Packit 98cdb6
	g_object_set_data (G_OBJECT (drawing_area), "pixbuf", pixbuf);
Packit 98cdb6
Packit 98cdb6
	gtk_widget_show (drawing_area);
Packit 98cdb6
Packit 98cdb6
	button = gtk_button_new_with_label ("Quit");
Packit 98cdb6
	gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
Packit 98cdb6
	g_signal_connect_swapped (button, "clicked",
Packit 98cdb6
				  G_CALLBACK (gtk_widget_destroy), window);
Packit 98cdb6
Packit 98cdb6
	gtk_widget_show (button);
Packit 98cdb6
Packit 98cdb6
	gtk_container_add (GTK_CONTAINER (window), vbox);
Packit 98cdb6
	gtk_widget_show_all (vbox);
Packit 98cdb6
Packit 98cdb6
	gtk_widget_show (window);
Packit 98cdb6
Packit 98cdb6
        return drawing_area;
Packit 98cdb6
}
Packit 98cdb6
Packit 98cdb6
Packit 98cdb6
static gint
Packit 98cdb6
update_timeout (gpointer data)
Packit 98cdb6
{
Packit 98cdb6
        ProgressFileStatus *status = data;
Packit 98cdb6
	gboolean done;
Packit 98cdb6
        GError *error;
Packit 98cdb6
        
Packit 98cdb6
	done = FALSE;
Packit 98cdb6
        error = NULL;
Packit 98cdb6
Packit 98cdb6
	if (!feof (status->imagefile)) {
Packit 98cdb6
		gint nbytes;
Packit 98cdb6
                
Packit 98cdb6
		nbytes = fread (status->buf, 1, status->readlen, 
Packit 98cdb6
			       status->imagefile);
Packit 98cdb6
Packit 98cdb6
Packit 98cdb6
                if (!gdk_pixbuf_loader_write (GDK_PIXBUF_LOADER (status->loader), status->buf, nbytes, &error)) {
Packit 98cdb6
                        g_warning ("Error writing to loader: %s",
Packit 98cdb6
                                   error->message);
Packit 98cdb6
                        g_error_free (error);
Packit 98cdb6
                        done = TRUE;
Packit 98cdb6
                }
Packit 98cdb6
                        
Packit 98cdb6
                        
Packit 98cdb6
        } 
Packit 98cdb6
	else 
Packit 98cdb6
                done = TRUE;
Packit 98cdb6
	  
Packit 98cdb6
	if (done) {
Packit 98cdb6
                /* ignoring errors, we should not do that. */
Packit 98cdb6
		gdk_pixbuf_loader_close (GDK_PIXBUF_LOADER (status->loader), NULL);
Packit 98cdb6
		gtk_widget_queue_draw (*status->rgbwin);
Packit 98cdb6
		g_object_unref (status->loader);
Packit 98cdb6
		fclose (status->imagefile);
Packit 98cdb6
		g_free (status->buf);
Packit 98cdb6
	}
Packit 98cdb6
Packit 98cdb6
	return !done;
Packit 98cdb6
}
Packit 98cdb6
Packit 98cdb6
Packit 98cdb6
static void
Packit 98cdb6
progressive_prepared_callback (GdkPixbufLoader* loader, gpointer data)
Packit 98cdb6
{
Packit 98cdb6
        GtkWidget** retloc = data;
Packit 98cdb6
        GdkPixbuf* pixbuf;
Packit 98cdb6
Packit 98cdb6
        pixbuf = gdk_pixbuf_loader_get_pixbuf (loader);
Packit 98cdb6
Packit 98cdb6
        g_assert (pixbuf != NULL);
Packit 98cdb6
Packit 98cdb6
        g_object_ref (pixbuf); /* for the RGB window */
Packit 98cdb6
Packit 98cdb6
        *retloc = new_testrgb_window (pixbuf, "Progressive");
Packit 98cdb6
Packit 98cdb6
        return;
Packit 98cdb6
}
Packit 98cdb6
Packit 98cdb6
Packit 98cdb6
static void
Packit 98cdb6
progressive_updated_callback (GdkPixbufLoader* loader, guint x, guint y, guint width, guint height, gpointer data)
Packit 98cdb6
{
Packit 98cdb6
        GtkWidget** window_loc = data;
Packit 98cdb6
Packit 98cdb6
        if (*window_loc != NULL)
Packit 98cdb6
                gtk_widget_queue_draw_area (*window_loc,
Packit 98cdb6
					   x, y, width, height);
Packit 98cdb6
        return;
Packit 98cdb6
}
Packit 98cdb6
Packit 98cdb6
static int readlen = 4096;
Packit 98cdb6
Packit 98cdb6
extern void pixbuf_init (void);
Packit 98cdb6
Packit 98cdb6
void size_func (GdkPixbufLoader *loader, gint width, gint height, gpointer data)
Packit 98cdb6
{
Packit 98cdb6
        gdk_pixbuf_loader_set_size (loader, width*2, height*2);
Packit 98cdb6
}
Packit 98cdb6
Packit 98cdb6
Packit 98cdb6
int
Packit 98cdb6
main (int argc, char **argv)
Packit 98cdb6
{
Packit 98cdb6
	int i;
Packit 98cdb6
	int found_valid = FALSE;
Packit 98cdb6
Packit 98cdb6
	GdkPixbuf *pixbuf;
Packit 98cdb6
	GdkPixbufLoader *pixbuf_loader;
Packit 98cdb6
Packit 98cdb6
	pixbuf_init ();
Packit 98cdb6
Packit 98cdb6
	gtk_init (&argc, &argv);
Packit 98cdb6
Packit 98cdb6
	/*	gdk_rgb_set_verbose (TRUE);*/
Packit 98cdb6
Packit 98cdb6
	gtk_widget_set_default_colormap (gdk_rgb_get_colormap ());
Packit 98cdb6
Packit 98cdb6
	{
Packit 98cdb6
		char *tbf_readlen = getenv ("TBF_READLEN");
Packit 98cdb6
		if (tbf_readlen) readlen = atoi (tbf_readlen);
Packit 98cdb6
	}
Packit 98cdb6
Packit 98cdb6
	{
Packit 98cdb6
		char *tbf_bps = getenv ("TBF_KBPS");
Packit 98cdb6
		guint bps;
Packit 98cdb6
Packit 98cdb6
		if (tbf_bps) {
Packit 98cdb6
			bps = atoi (tbf_bps);
Packit 98cdb6
			g_print ("Simulating %d kBytes/sec\n", bps);
Packit 98cdb6
			readlen = (bps*1024)/10;
Packit 98cdb6
		}
Packit 98cdb6
	}
Packit 98cdb6
Packit 98cdb6
	i = 1;
Packit 98cdb6
	if (argc == 1) {
Packit 98cdb6
                const gchar*** xpmp;
Packit 98cdb6
                GError *error = NULL;
Packit 98cdb6
		
Packit 98cdb6
		pixbuf = gdk_pixbuf_new_from_data (default_image, GDK_COLORSPACE_RGB, FALSE, 8,
Packit 98cdb6
						   DEFAULT_WIDTH, DEFAULT_HEIGHT, DEFAULT_WIDTH * 3,
Packit 98cdb6
						   NULL, NULL);
Packit 98cdb6
		new_testrgb_window (pixbuf, NULL);
Packit 98cdb6
Packit 98cdb6
                xpmp = xpms;
Packit 98cdb6
                while (*xpmp) {
Packit 98cdb6
                        pixbuf = gdk_pixbuf_new_from_xpm_data (*xpmp);
Packit 98cdb6
                        new_testrgb_window (pixbuf, NULL);
Packit 98cdb6
                        ++xpmp;
Packit 98cdb6
                }
Packit 98cdb6
Packit 98cdb6
                /* Test loading from inline data. */
Packit 98cdb6
                pixbuf = gdk_pixbuf_new_from_inline (-1, apple_red, FALSE, &error);
Packit 98cdb6
		if (!pixbuf)
Packit 98cdb6
		  {
Packit 98cdb6
		    fprintf (stderr, "failed to construct \"red apple\" pixbuf: %s\n",
Packit 98cdb6
			     error->message);
Packit 98cdb6
		    g_error_free (error);
Packit 98cdb6
		  }
Packit 98cdb6
		else
Packit 98cdb6
		  new_testrgb_window (pixbuf, "Red apple from inlined RLE data");
Packit 98cdb6
Packit 98cdb6
                pixbuf = gdk_pixbuf_new_from_inline (sizeof (gnome_foot), gnome_foot, TRUE, NULL);
Packit 98cdb6
                new_testrgb_window (pixbuf, "GNOME Foot from inlined RLE data");
Packit 98cdb6
                
Packit 98cdb6
		found_valid = TRUE;
Packit 98cdb6
	} else {
Packit 98cdb6
		for (i = 1; i < argc; i++) {
Packit 98cdb6
                        GError *error;
Packit 98cdb6
Packit 98cdb6
                        error = NULL;
Packit 98cdb6
			pixbuf = gdk_pixbuf_new_from_file (argv[i], &error);
Packit 98cdb6
Packit 98cdb6
                        if (pixbuf == NULL) {
Packit 98cdb6
                                g_warning ("Error loading image: %s",
Packit 98cdb6
                                           error->message);
Packit 98cdb6
                                g_error_free (error);
Packit 98cdb6
                        }
Packit 98cdb6
                        
Packit 98cdb6
#if 0
Packit 98cdb6
			pixbuf = gdk_pixbuf_rotate (pixbuf, 10.0);
Packit 98cdb6
#endif
Packit 98cdb6
Packit 98cdb6
			if (pixbuf) {
Packit 98cdb6
				new_testrgb_window (pixbuf, "File");
Packit 98cdb6
				found_valid = TRUE;
Packit 98cdb6
			}
Packit 98cdb6
		}
Packit 98cdb6
#if 1	
Packit 98cdb6
                {
Packit 98cdb6
                        GtkWidget* rgb_window = NULL;
Packit 98cdb6
			ProgressFileStatus   status;
Packit 98cdb6
Packit 98cdb6
                        pixbuf_loader = gdk_pixbuf_loader_new ();
Packit 98cdb6
			status.loader = pixbuf_loader;
Packit 98cdb6
Packit 98cdb6
			status.rgbwin = &rgb_window;
Packit 98cdb6
Packit 98cdb6
			status.buf = g_malloc (readlen);
Packit 98cdb6
Packit 98cdb6
#if 0
Packit 98cdb6
			g_signal_connect (pixbuf_loader, "size_prepared", 
Packit 98cdb6
					  G_CALLBACK (size_func), NULL);
Packit 98cdb6
#endif
Packit 98cdb6
Packit 98cdb6
                        g_signal_connect (pixbuf_loader, "area_prepared",
Packit 98cdb6
					  G_CALLBACK (progressive_prepared_callback),
Packit 98cdb6
					  &rgb_window);
Packit 98cdb6
                        g_signal_connect (pixbuf_loader, "area_updated",
Packit 98cdb6
					  G_CALLBACK (progressive_updated_callback),
Packit 98cdb6
					  &rgb_window);
Packit 98cdb6
			
Packit 98cdb6
                        status.imagefile = fopen (argv[1], "r");
Packit 98cdb6
                        g_assert (status.imagefile != NULL);
Packit 98cdb6
Packit 98cdb6
			status.readlen = readlen;
Packit 98cdb6
Packit 98cdb6
                        status.timeout = gdk_threads_add_timeout (100, update_timeout, &status);
Packit 98cdb6
                }
Packit 98cdb6
#endif
Packit 98cdb6
	}
Packit 98cdb6
Packit 98cdb6
	if (found_valid)
Packit 98cdb6
		gtk_main ();
Packit 98cdb6
Packit 98cdb6
	return 0;
Packit 98cdb6
}