1999-07-19 02:13:34 +00:00
|
|
|
/* testpixbuf -- test program for gdk-pixbuf code
|
|
|
|
* Copyright (C) 1999 Mark Crichton, Larry Ewing
|
1999-07-08 16:04:16 +00:00
|
|
|
*
|
|
|
|
* This library is free software; you can redistribute it and/or
|
2000-07-26 11:33:08 +00:00
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
1999-07-08 16:04:16 +00:00
|
|
|
* 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
|
2000-07-26 11:33:08 +00:00
|
|
|
* Lesser General Public License for more details.
|
1999-07-08 16:04:16 +00:00
|
|
|
*
|
2000-07-26 11:33:08 +00:00
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
1999-07-08 16:04:16 +00:00
|
|
|
* License along with this library; if not, write to the
|
|
|
|
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
|
|
* Boston, MA 02111-1307, USA.
|
|
|
|
*/
|
|
|
|
|
2008-06-22 14:28:52 +00:00
|
|
|
#include "config.h"
|
2000-04-11 07:03:25 +00:00
|
|
|
#include <stdio.h>
|
1999-07-08 16:04:16 +00:00
|
|
|
#include <stdlib.h>
|
|
|
|
#include <unistd.h>
|
|
|
|
#include <string.h>
|
2010-08-07 23:12:06 +00:00
|
|
|
|
|
|
|
#undef GDK_DISABLE_DEPRECATED
|
|
|
|
|
1999-07-08 16:04:16 +00:00
|
|
|
#include <gtk/gtk.h>
|
2008-05-28 12:47:37 +00:00
|
|
|
#include <gdk-pixbuf/gdk-pixbuf.h>
|
1999-07-08 16:04:16 +00:00
|
|
|
|
2000-10-04 16:39:44 +00:00
|
|
|
#include "test-inline-pixbufs.h"
|
|
|
|
|
1999-11-09 23:51:35 +00:00
|
|
|
typedef struct {
|
|
|
|
FILE *imagefile;
|
|
|
|
GdkPixbufLoader *loader;
|
1999-11-10 17:43:49 +00:00
|
|
|
GtkWidget **rgbwin;
|
1999-11-09 23:51:35 +00:00
|
|
|
guchar *buf;
|
|
|
|
guint timeout;
|
|
|
|
guint readlen;
|
|
|
|
} ProgressFileStatus;
|
|
|
|
|
|
|
|
|
1999-10-08 23:01:05 +00:00
|
|
|
#define DEFAULT_WIDTH 24
|
|
|
|
#define DEFAULT_HEIGHT 24
|
|
|
|
|
|
|
|
static const unsigned char default_image[] = {
|
1999-10-18 19:29:45 +00:00
|
|
|
0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
|
|
|
|
0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
|
|
|
|
0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
|
|
|
|
0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
|
|
|
|
0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
|
|
|
|
0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
|
|
|
|
0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
|
|
|
|
0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
|
|
|
|
0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
|
|
|
|
0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
|
|
|
|
0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
|
|
|
|
0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
|
|
|
|
0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
|
|
|
|
0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
|
|
|
|
0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
|
|
|
|
0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
|
|
|
|
0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
|
|
|
|
0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
|
|
|
|
0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
|
|
|
|
0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
|
|
|
|
0xff, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
|
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff,
|
|
|
|
0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
|
|
|
|
0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
|
|
|
|
0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
|
|
|
|
0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0x00, 0x00, 0x00,
|
|
|
|
0x00, 0x00, 0x00, 0xae, 0xb3, 0xb3, 0xc6, 0xc9, 0xcd, 0xd7, 0xd4, 0xdf,
|
|
|
|
0xec, 0xde, 0xf3, 0xe7, 0xcb, 0xe9, 0xd9, 0xb5, 0xd3, 0x00, 0x00, 0x00,
|
|
|
|
0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
|
|
|
|
0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
|
|
|
|
0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
|
|
|
|
0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0x00, 0x00, 0x00, 0xb1, 0xb7, 0xa5,
|
|
|
|
0xb0, 0xb8, 0xad, 0xb3, 0xb9, 0xb6, 0xc1, 0xc6, 0xc8, 0xd5, 0xd3, 0xdc,
|
|
|
|
0xec, 0xde, 0xf3, 0xe5, 0xca, 0xe6, 0xe0, 0xbb, 0xd7, 0xe1, 0xad, 0xc2,
|
|
|
|
0xe3, 0xac, 0xa3, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
|
|
|
|
0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
|
|
|
|
0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
|
|
|
|
0xff, 0x00, 0xff, 0x00, 0x00, 0x00, 0xca, 0xc1, 0xa4, 0xc5, 0xc7, 0xac,
|
|
|
|
0xb7, 0xbe, 0xaf, 0xad, 0xb4, 0xaf, 0xbd, 0xc2, 0xc3, 0xd1, 0xd0, 0xd8,
|
|
|
|
0xec, 0xde, 0xf3, 0xe5, 0xc7, 0xe4, 0xe0, 0xb6, 0xd1, 0xe7, 0xa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ff, 0x00, 0x00, 0x00, 0xc9, 0xaf, 0xaf,
|
|
|
|
0xc5, 0xb5, 0xb8, 0xb8, 0xb1, 0xb1, 0xb6, 0xbb, 0xad, 0xd0, 0xd6, 0xb5,
|
|
|
|
0xe3, 0xd7, 0xb5, 0xe2, 0xbf, 0xaf, 0xdd, 0xb4, 0xa9, 0xdb, 0x92, 0x9a,
|
|
|
|
0xc6, 0x84, 0xa7, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
|
|
|
|
0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
|
|
|
|
0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
|
|
|
|
0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0x00, 0x00, 0x00,
|
|
|
|
0x00, 0x00, 0x00, 0xac, 0xaa, 0xa6, 0xbd, 0xc3, 0xb0, 0xd2, 0xd7, 0xb5,
|
|
|
|
0xe3, 0xd7, 0xb5, 0xe2, 0xbf, 0xae, 0xdb, 0xb6, 0xa8, 0x00, 0x00, 0x00,
|
|
|
|
0x00, 0x00, 0x00, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
|
|
|
|
0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
|
|
|
|
0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
|
|
|
|
0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
|
|
|
|
0xff, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
|
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x00, 0xff,
|
|
|
|
0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
|
|
|
|
0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
|
|
|
|
0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
|
|
|
|
0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
|
|
|
|
0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
|
|
|
|
0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
|
|
|
|
0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
|
|
|
|
0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
|
|
|
|
0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
|
|
|
|
0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
|
|
|
|
0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
|
|
|
|
0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
|
|
|
|
0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
|
|
|
|
0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
|
|
|
|
0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
|
|
|
|
0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
|
|
|
|
0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
|
|
|
|
0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
|
|
|
|
0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff,
|
|
|
|
0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff
|
1999-10-08 23:01:05 +00:00
|
|
|
};
|
|
|
|
|
1999-10-22 23:26:22 +00:00
|
|
|
|
|
|
|
static const char * book_open_xpm[] = {
|
|
|
|
"16 16 4 1",
|
|
|
|
" c None s None",
|
|
|
|
". c black",
|
|
|
|
"X c #808080",
|
|
|
|
"o c white",
|
|
|
|
" ",
|
|
|
|
" .. ",
|
|
|
|
" .Xo. ... ",
|
|
|
|
" .Xoo. ..oo. ",
|
|
|
|
" .Xooo.Xooo... ",
|
|
|
|
" .Xooo.oooo.X. ",
|
|
|
|
" .Xooo.Xooo.X. ",
|
|
|
|
" .Xooo.oooo.X. ",
|
|
|
|
" .Xooo.Xooo.X. ",
|
|
|
|
" .Xooo.oooo.X. ",
|
|
|
|
" .Xoo.Xoo..X. ",
|
|
|
|
" .Xo.o..ooX. ",
|
|
|
|
" .X..XXXXX. ",
|
|
|
|
" ..X....... ",
|
|
|
|
" .. ",
|
|
|
|
" "};
|
|
|
|
|
|
|
|
static const char * book_closed_xpm[] = {
|
|
|
|
"16 16 6 1",
|
|
|
|
" c None s None",
|
|
|
|
". c black",
|
|
|
|
"X c red",
|
|
|
|
"o c yellow",
|
|
|
|
"O c #808080",
|
|
|
|
"# c white",
|
|
|
|
" ",
|
|
|
|
" .. ",
|
|
|
|
" ..XX. ",
|
|
|
|
" ..XXXXX. ",
|
|
|
|
" ..XXXXXXXX. ",
|
|
|
|
".ooXXXXXXXXX. ",
|
|
|
|
"..ooXXXXXXXXX. ",
|
|
|
|
".X.ooXXXXXXXXX. ",
|
|
|
|
".XX.ooXXXXXX.. ",
|
|
|
|
" .XX.ooXXX..#O ",
|
|
|
|
" .XX.oo..##OO. ",
|
|
|
|
" .XX..##OO.. ",
|
|
|
|
" .X.#OO.. ",
|
|
|
|
" ..O.. ",
|
|
|
|
" .. ",
|
|
|
|
" "};
|
|
|
|
|
|
|
|
static const char * mini_page_xpm[] = {
|
|
|
|
"16 16 4 1",
|
|
|
|
" c None s None",
|
|
|
|
". c black",
|
|
|
|
"X c white",
|
|
|
|
"o c #808080",
|
|
|
|
" ",
|
|
|
|
" ....... ",
|
|
|
|
" .XXXXX.. ",
|
|
|
|
" .XoooX.X. ",
|
|
|
|
" .XXXXX.... ",
|
|
|
|
" .XooooXoo.o ",
|
|
|
|
" .XXXXXXXX.o ",
|
|
|
|
" .XooooooX.o ",
|
|
|
|
" .XXXXXXXX.o ",
|
|
|
|
" .XooooooX.o ",
|
|
|
|
" .XXXXXXXX.o ",
|
|
|
|
" .XooooooX.o ",
|
|
|
|
" .XXXXXXXX.o ",
|
|
|
|
" ..........o ",
|
|
|
|
" oooooooooo ",
|
|
|
|
" "};
|
|
|
|
|
|
|
|
static const char * gtk_mini_xpm[] = {
|
|
|
|
"15 20 17 1",
|
|
|
|
" c None",
|
|
|
|
". c #14121F",
|
|
|
|
"+ c #278828",
|
|
|
|
"@ c #9B3334",
|
|
|
|
"# c #284C72",
|
|
|
|
"$ c #24692A",
|
|
|
|
"% c #69282E",
|
|
|
|
"& c #37C539",
|
|
|
|
"* c #1D2F4D",
|
|
|
|
"= c #6D7076",
|
|
|
|
"- c #7D8482",
|
|
|
|
"; c #E24A49",
|
|
|
|
"> c #515357",
|
|
|
|
", c #9B9C9B",
|
|
|
|
"' c #2FA232",
|
|
|
|
") c #3CE23D",
|
|
|
|
"! c #3B6CCB",
|
|
|
|
" ",
|
|
|
|
" ***> ",
|
|
|
|
" >.*!!!* ",
|
|
|
|
" ***....#*= ",
|
|
|
|
" *!*.!!!**!!# ",
|
|
|
|
" .!!#*!#*!!!!# ",
|
|
|
|
" @%#!.##.*!!$& ",
|
|
|
|
" @;%*!*.#!#')) ",
|
|
|
|
" @;;@%!!*$&)'' ",
|
|
|
|
" @%.%@%$'&)$+' ",
|
|
|
|
" @;...@$'*'*)+ ",
|
|
|
|
" @;%..@$+*.')$ ",
|
|
|
|
" @;%%;;$+..$)# ",
|
|
|
|
" @;%%;@$$$'.$# ",
|
|
|
|
" %;@@;;$$+))&* ",
|
|
|
|
" %;;;@+$&)&* ",
|
|
|
|
" %;;@'))+> ",
|
|
|
|
" %;@'&# ",
|
|
|
|
" >%$$ ",
|
|
|
|
" >= "};
|
|
|
|
|
|
|
|
const gchar ** xpms[] = {
|
|
|
|
book_open_xpm,
|
|
|
|
book_closed_xpm,
|
|
|
|
mini_page_xpm,
|
|
|
|
gtk_mini_xpm,
|
|
|
|
NULL
|
|
|
|
};
|
|
|
|
|
1999-07-08 16:04:16 +00:00
|
|
|
static void
|
|
|
|
quit_func (GtkWidget *widget, gpointer dummy)
|
|
|
|
{
|
1999-10-18 19:29:45 +00:00
|
|
|
gtk_main_quit ();
|
1999-07-08 16:04:16 +00:00
|
|
|
}
|
|
|
|
|
1999-10-18 19:29:45 +00:00
|
|
|
static void
|
1999-07-15 04:58:39 +00:00
|
|
|
expose_func (GtkWidget *drawing_area, GdkEventExpose *event, gpointer data)
|
1999-07-08 16:04:16 +00:00
|
|
|
{
|
1999-10-18 19:29:45 +00:00
|
|
|
GdkPixbuf *pixbuf;
|
|
|
|
|
2001-10-20 23:39:32 +00:00
|
|
|
pixbuf = (GdkPixbuf *)g_object_get_data (G_OBJECT (drawing_area), "pixbuf");
|
1999-10-18 19:29:45 +00:00
|
|
|
|
2000-04-11 07:03:25 +00:00
|
|
|
if (gdk_pixbuf_get_has_alpha (pixbuf)) {
|
2002-09-03 23:51:36 +00:00
|
|
|
GdkPixbuf *dest;
|
2010-07-12 14:48:53 +00:00
|
|
|
cairo_t *cr;
|
2002-09-03 23:51:36 +00:00
|
|
|
|
|
|
|
gdk_window_set_back_pixmap (drawing_area->window, NULL, FALSE);
|
|
|
|
|
|
|
|
dest = gdk_pixbuf_new (GDK_COLORSPACE_RGB, FALSE, 8, event->area.width, event->area.height);
|
|
|
|
|
|
|
|
gdk_pixbuf_composite_color (pixbuf, dest,
|
|
|
|
0, 0, event->area.width, event->area.height,
|
|
|
|
-event->area.x, -event->area.y,
|
|
|
|
(double) drawing_area->allocation.width / gdk_pixbuf_get_width (pixbuf),
|
|
|
|
(double) drawing_area->allocation.height / gdk_pixbuf_get_height (pixbuf),
|
|
|
|
GDK_INTERP_BILINEAR, 255,
|
|
|
|
event->area.x, event->area.y, 16, 0xaaaaaa, 0x555555);
|
|
|
|
|
2010-07-12 14:48:53 +00:00
|
|
|
cr = gdk_cairo_create (drawing_area->window);
|
|
|
|
|
|
|
|
gdk_cairo_set_source_pixbuf (cr, dest, 0, 0);
|
|
|
|
gdk_cairo_rectangle (cr, &event->area);
|
|
|
|
cairo_fill (cr);
|
|
|
|
|
|
|
|
cairo_destroy (cr);
|
2002-09-03 23:51:36 +00:00
|
|
|
g_object_unref (dest);
|
1999-10-18 19:29:45 +00:00
|
|
|
} else {
|
|
|
|
gdk_draw_rgb_image (drawing_area->window,
|
|
|
|
drawing_area->style->white_gc,
|
|
|
|
event->area.x, event->area.y,
|
|
|
|
event->area.width,
|
|
|
|
event->area.height,
|
|
|
|
GDK_RGB_DITHER_NORMAL,
|
2000-04-11 07:03:25 +00:00
|
|
|
gdk_pixbuf_get_pixels (pixbuf)
|
|
|
|
+ (event->area.y * gdk_pixbuf_get_rowstride (pixbuf))
|
|
|
|
+ (event->area.x * gdk_pixbuf_get_n_channels (pixbuf)),
|
|
|
|
gdk_pixbuf_get_rowstride (pixbuf));
|
1999-10-18 19:29:45 +00:00
|
|
|
}
|
1999-10-27 20:16:37 +00:00
|
|
|
}
|
1999-07-08 16:04:16 +00:00
|
|
|
|
1999-10-18 19:29:45 +00:00
|
|
|
static void
|
1999-07-16 20:35:21 +00:00
|
|
|
config_func (GtkWidget *drawing_area, GdkEventConfigure *event, gpointer data)
|
|
|
|
{
|
2006-10-08 05:07:55 +00:00
|
|
|
#if 0
|
1999-10-20 21:20:49 +00:00
|
|
|
GdkPixbuf *pixbuf;
|
1999-07-16 20:35:21 +00:00
|
|
|
|
2001-10-20 23:39:32 +00:00
|
|
|
pixbuf = (GdkPixbuf *)g_object_get_data (G_OBJECT (drawing_area), "pixbuf");
|
1999-07-16 20:35:21 +00:00
|
|
|
|
2000-04-11 07:03:25 +00:00
|
|
|
if (((event->width) != gdk_pixbuf_get_width (pixbuf)) ||
|
|
|
|
((event->height) != gdk_pixbuf_get_height (pixbuf)))
|
2001-10-20 23:39:32 +00:00
|
|
|
gdk_pixbuf_scale (pixbuf, event->width, event->height);
|
1999-10-20 21:20:49 +00:00
|
|
|
#endif
|
1999-07-16 20:35:21 +00:00
|
|
|
}
|
|
|
|
|
1999-10-27 19:42:34 +00:00
|
|
|
static GtkWidget*
|
1999-10-29 22:32:47 +00:00
|
|
|
new_testrgb_window (GdkPixbuf *pixbuf, gchar *title)
|
1999-07-08 16:04:16 +00:00
|
|
|
{
|
1999-10-18 19:29:45 +00:00
|
|
|
GtkWidget *window;
|
|
|
|
GtkWidget *vbox;
|
1999-11-03 23:39:58 +00:00
|
|
|
GtkWidget *temp_box;
|
1999-10-18 19:29:45 +00:00
|
|
|
GtkWidget *button;
|
|
|
|
GtkWidget *drawing_area;
|
|
|
|
gint w, h;
|
2000-10-09 17:22:20 +00:00
|
|
|
|
|
|
|
g_return_val_if_fail (pixbuf != NULL, NULL);
|
2000-04-11 07:03:25 +00:00
|
|
|
w = gdk_pixbuf_get_width (pixbuf);
|
|
|
|
h = gdk_pixbuf_get_height (pixbuf);
|
1999-07-08 16:04:16 +00:00
|
|
|
|
Use g_object_new instead of gtk_widget_new
2008-06-19 Johan Dahlin <jdahlin@async.com.br>
* demos/testpixbuf.c (new_testrgb_window):
* gtk/gtkctree.c (gtk_ctree_new_with_titles):
* gtk/gtkitemfactory.c (gtk_item_factory_construct),
(gtk_item_factory_create_item):
* gtk/gtkmenu.c (gtk_menu_set_tearoff_state):
* gtk/gtkprogressbar.c (gtk_progress_bar_new),
(gtk_progress_bar_new_with_adjustment):
* gtk/gtkscrolledwindow.c (gtk_scrolled_window_new):
* gtk/gtktext.c (gtk_text_new):
* gtk/gtkviewport.c (gtk_viewport_new):
* tests/simple.c (main):
* tests/testgtk.c (create_statusbar), (create_get_image),
(create_saved_position), (create_tooltips), (create_cursors),
(create_display_screen), (create_progress_bar), (create_idle_test):
* tests/testmultidisplay.c (make_selection_dialog), (main):
* tests/testmultiscreen.c (main):
* tests/testrgb.c (new_testrgb_window):
Use g_object_new instead of gtk_widget_new
svn path=/trunk/; revision=20462
2008-06-19 12:25:19 +00:00
|
|
|
window = g_object_new (gtk_window_get_type (),
|
1999-10-18 19:29:45 +00:00
|
|
|
"GtkObject::user_data", NULL,
|
|
|
|
"GtkWindow::type", GTK_WINDOW_TOPLEVEL,
|
2000-10-04 16:39:44 +00:00
|
|
|
"GtkWindow::title", title ? title : "testrgb",
|
1999-10-18 19:29:45 +00:00
|
|
|
"GtkWindow::allow_shrink", TRUE,
|
|
|
|
NULL);
|
2001-10-20 23:39:32 +00:00
|
|
|
g_signal_connect (window, "destroy",
|
|
|
|
G_CALLBACK (quit_func), NULL);
|
1999-07-08 16:04:16 +00:00
|
|
|
|
1999-10-18 19:29:45 +00:00
|
|
|
vbox = gtk_vbox_new (FALSE, 0);
|
1999-07-08 16:04:16 +00:00
|
|
|
|
1999-10-29 22:32:47 +00:00
|
|
|
if (title)
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), gtk_label_new (title),
|
|
|
|
TRUE, TRUE, 0);
|
|
|
|
|
1999-10-18 19:29:45 +00:00
|
|
|
drawing_area = gtk_drawing_area_new ();
|
1999-07-08 16:04:16 +00:00
|
|
|
|
1999-11-03 23:39:58 +00:00
|
|
|
temp_box = gtk_hbox_new (FALSE, 0);
|
2001-10-20 23:39:32 +00:00
|
|
|
gtk_widget_set_size_request (GTK_WIDGET (drawing_area), w, h);
|
1999-11-03 23:39:58 +00:00
|
|
|
gtk_box_pack_start (GTK_BOX (temp_box), drawing_area, FALSE, FALSE, 0);
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), temp_box, FALSE, FALSE, 0);
|
|
|
|
|
1999-07-15 04:58:39 +00:00
|
|
|
|
2001-10-20 23:39:32 +00:00
|
|
|
g_signal_connect (drawing_area, "expose_event",
|
|
|
|
G_CALLBACK (expose_func), NULL);
|
|
|
|
g_signal_connect (drawing_area, "configure_event",
|
|
|
|
G_CALLBACK (config_func), NULL);
|
1999-07-16 20:35:21 +00:00
|
|
|
|
2001-10-20 23:39:32 +00:00
|
|
|
g_object_set_data (G_OBJECT (drawing_area), "pixbuf", pixbuf);
|
1999-07-15 04:58:39 +00:00
|
|
|
|
1999-10-18 19:29:45 +00:00
|
|
|
gtk_widget_show (drawing_area);
|
1999-07-08 16:04:16 +00:00
|
|
|
|
1999-10-18 19:29:45 +00:00
|
|
|
button = gtk_button_new_with_label ("Quit");
|
|
|
|
gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
|
2001-10-20 23:39:32 +00:00
|
|
|
g_signal_connect_swapped (button, "clicked",
|
|
|
|
G_CALLBACK (gtk_widget_destroy), window);
|
1999-07-08 16:04:16 +00:00
|
|
|
|
1999-10-18 19:29:45 +00:00
|
|
|
gtk_widget_show (button);
|
1999-07-08 16:04:16 +00:00
|
|
|
|
1999-10-18 19:29:45 +00:00
|
|
|
gtk_container_add (GTK_CONTAINER (window), vbox);
|
1999-10-29 22:32:47 +00:00
|
|
|
gtk_widget_show_all (vbox);
|
1999-07-08 16:04:16 +00:00
|
|
|
|
1999-10-18 19:29:45 +00:00
|
|
|
gtk_widget_show (window);
|
1999-10-27 19:42:34 +00:00
|
|
|
|
2005-01-04 13:44:34 +00:00
|
|
|
return drawing_area;
|
1999-10-27 19:42:34 +00:00
|
|
|
}
|
|
|
|
|
1999-11-09 23:51:35 +00:00
|
|
|
|
1999-10-27 19:42:34 +00:00
|
|
|
static gint
|
2001-10-20 23:39:32 +00:00
|
|
|
update_timeout (gpointer data)
|
1999-10-27 19:42:34 +00:00
|
|
|
{
|
1999-11-09 23:51:35 +00:00
|
|
|
ProgressFileStatus *status = data;
|
2000-10-18 18:42:54 +00:00
|
|
|
gboolean done;
|
|
|
|
GError *error;
|
2000-10-09 17:22:20 +00:00
|
|
|
|
|
|
|
done = FALSE;
|
2003-03-24 02:31:30 +00:00
|
|
|
error = NULL;
|
|
|
|
|
2001-10-20 23:39:32 +00:00
|
|
|
if (!feof (status->imagefile)) {
|
1999-11-09 23:51:35 +00:00
|
|
|
gint nbytes;
|
2000-10-18 18:42:54 +00:00
|
|
|
|
2001-10-20 23:39:32 +00:00
|
|
|
nbytes = fread (status->buf, 1, status->readlen,
|
1999-11-09 23:51:35 +00:00
|
|
|
status->imagefile);
|
1999-11-03 15:57:16 +00:00
|
|
|
|
2000-10-09 17:22:20 +00:00
|
|
|
|
2000-10-18 18:42:54 +00:00
|
|
|
if (!gdk_pixbuf_loader_write (GDK_PIXBUF_LOADER (status->loader), status->buf, nbytes, &error)) {
|
|
|
|
g_warning ("Error writing to loader: %s",
|
|
|
|
error->message);
|
|
|
|
g_error_free (error);
|
|
|
|
done = TRUE;
|
2000-10-09 17:22:20 +00:00
|
|
|
}
|
2000-10-18 18:42:54 +00:00
|
|
|
|
|
|
|
|
2001-08-28 19:06:58 +00:00
|
|
|
}
|
|
|
|
else
|
2003-03-24 02:31:30 +00:00
|
|
|
done = TRUE;
|
2001-08-28 19:06:58 +00:00
|
|
|
|
1999-11-09 23:51:35 +00:00
|
|
|
if (done) {
|
Add built marshaller files to support GdkPixbufLoader signals
2001-01-22 Havoc Pennington <hp@redhat.com>
* Makefile.am: Add built marshaller files to support
GdkPixbufLoader signals
* gdk-pixbuf-io.c (gdk_pixbuf_load_module): have
GDK_PIXBUF_MODULEDIR unconditionally replace the compiled-in
module location, rather than acting as a fallback, because we are
using GDK_PIXBUF_MODULEDIR to use gdk-pixbuf before installing it.
* gdk-pixbuf.h: include gdk-pixbuf-loader.h
* gdk-pixbuf-loader.h, gdk-pixbuf-loader.c: Move back over here
from gtk, and add error to close(), because stop_load may do
parsing of the image.
* pixops/have_mmx.S (_pixops_have_mmx): add newline at end of file
* io-*.c: make individual operations static, and add fill_vtable
functions which are exported. Fix the collection of type warnings
that surfaced, including a number of functions that didn't
properly take a GError and some that weren't
const-correct. Involved adding error handling for a few loaders.
* gdk-pixbuf-io.h: Add error reporting to stop_load function
* gdk-pixbuf-io.c (gdk_pixbuf_load_module): change to just look up
a function that fills in the GdkPixbufModule vtable, instead of
looking up all the image functions individually; this means we
can get type safety within modules for the loader functions.
Also it means you don't have to keep the statically compiled and
GModule versions in sync.
* test-gdk-pixbuf.c (main): remove gdk_pixbuf_init()
* make-inline-pixbuf.c (main): remove call to gdk_pixbuf_init()
* gdk-pixbuf.h: nuke gdk_pixbuf_init()
* gdk-pixbuf-animation.c (gdk_pixbuf_frame_get_type): g_type_init
() here
* gdk-pixbuf.c (gdk_pixbuf_get_type): g_type_init () here
* gdk-pixbuf-animation.c (gdk_pixbuf_animation_get_type):
g_type_init() here
2001-01-22 Havoc Pennington <hp@redhat.com>
* demos/testanimation.c: fix to reflect gdk-pixbuf changes
* demos/testpixbuf.c: fix to reflect gdk-pixbuf changes
* gtk/gdk-pixbuf-loader.c, gtk/gdk-pixbuf-loader.h:
Remove, move back to gdk-pixbuf
* gtk/gtktextiter.c, gtk/gtktextiter.h: add sentence equivalents
to all the word functions
* gtk/gtktextview.c (gtk_text_view_start_cursor_blink): return
before doing anything on NULL layout or if we don't have the focus
* gtk/testtext.c (fill_example_buffer): "justification"
* gtk/gtktexttag.h, gtk/gtktexttag.c: change the tag attribute
to be called "justification" not "justify"
* demos/gtk-demo/textview.c (create_tags): "justification"
* gtk/gtktextlayout.c (set_para_values): Handle char-wise wrapping
2001-01-22 23:09:48 +00:00
|
|
|
/* ignoring errors, we should not do that. */
|
|
|
|
gdk_pixbuf_loader_close (GDK_PIXBUF_LOADER (status->loader), NULL);
|
2001-08-28 19:06:58 +00:00
|
|
|
gtk_widget_queue_draw (*status->rgbwin);
|
2002-09-29 21:24:24 +00:00
|
|
|
g_object_unref (status->loader);
|
1999-11-09 23:51:35 +00:00
|
|
|
fclose (status->imagefile);
|
|
|
|
g_free (status->buf);
|
|
|
|
}
|
|
|
|
|
|
|
|
return !done;
|
1999-10-27 19:42:34 +00:00
|
|
|
}
|
|
|
|
|
1999-11-09 23:51:35 +00:00
|
|
|
|
1999-10-27 19:42:34 +00:00
|
|
|
static void
|
2001-10-20 23:39:32 +00:00
|
|
|
progressive_prepared_callback (GdkPixbufLoader* loader, gpointer data)
|
1999-10-27 19:42:34 +00:00
|
|
|
{
|
|
|
|
GtkWidget** retloc = data;
|
|
|
|
GdkPixbuf* pixbuf;
|
|
|
|
|
2001-10-20 23:39:32 +00:00
|
|
|
pixbuf = gdk_pixbuf_loader_get_pixbuf (loader);
|
2002-09-03 23:51:36 +00:00
|
|
|
|
2001-10-20 23:39:32 +00:00
|
|
|
g_assert (pixbuf != NULL);
|
1999-10-27 19:42:34 +00:00
|
|
|
|
Remove assorted G_OBJECT casts where unnecessary.
2001-12-13 Sebastian Wilhelmi <wilhelmi@ira.uka.de>
* gdk-pixbuf-animation.c, gdk-pixbuf-loader.c, gdk-pixpuf.c,
io-gif-animation.c, io-gif.c, io-tiff.c, test-loaders.c: Remove
assorted G_OBJECT casts where unnecessary.
* gdk-pixbuf-loader.c: Call g_object_ref and g_object_unref
instead of gdk_pixbuf_animation_ref and gdk_pixbuf_animation_unref
resp.
* gdk-pixbuf-csource.c, io-bmp.c, io-gif-animation.c, io-ico.c,
io-jpeg.c, io-png.c, io-pnm.c, io-ras.c, io-tga.c, io-wbmp.c,
io-xbm.c, io-xpm.c, test-gdk-pixbuf.c: Dito for gdk_pixbuf_ref and
gdk_pixbuf_unref.
* Makefile.am, pixops/Makefile.am: Compile everything with
-DG_DISABLE_DEPRECATED -DGDK_PIXBUF_DISABLE_DEPRECATED
* gdk-pixdata.c: Use g_ascii_strup() instead of g_strup().
* io-xpm.c: Use g_ascii_strcasecmp() instead of g_strcasecmp().
* demos/testpixbuf-drawable.c, demos/testpixbuf-save.c,
demos/testpixbuf-scale.c, demos/testpixbuf.c: Call g_object_ref
and g_object_unref instead of gdk_pixbuf_ref and gdk_pixbuf_unref
resp.
2001-12-13 21:22:12 +00:00
|
|
|
g_object_ref (pixbuf); /* for the RGB window */
|
1999-10-29 22:32:47 +00:00
|
|
|
|
2001-10-20 23:39:32 +00:00
|
|
|
*retloc = new_testrgb_window (pixbuf, "Progressive");
|
1999-10-27 19:42:34 +00:00
|
|
|
|
|
|
|
return;
|
1999-07-08 16:04:16 +00:00
|
|
|
}
|
|
|
|
|
1999-11-04 19:22:45 +00:00
|
|
|
|
|
|
|
static void
|
2001-10-20 23:39:32 +00:00
|
|
|
progressive_updated_callback (GdkPixbufLoader* loader, guint x, guint y, guint width, guint height, gpointer data)
|
1999-11-04 19:22:45 +00:00
|
|
|
{
|
1999-11-09 23:51:35 +00:00
|
|
|
GtkWidget** window_loc = data;
|
|
|
|
|
|
|
|
if (*window_loc != NULL)
|
2001-10-20 23:39:32 +00:00
|
|
|
gtk_widget_queue_draw_area (*window_loc,
|
1999-11-09 23:51:35 +00:00
|
|
|
x, y, width, height);
|
1999-11-04 19:22:45 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
1999-11-10 18:54:07 +00:00
|
|
|
static int readlen = 4096;
|
1999-11-02 22:01:43 +00:00
|
|
|
|
2006-10-08 05:07:55 +00:00
|
|
|
extern void pixbuf_init (void);
|
2000-06-21 20:47:22 +00:00
|
|
|
|
2002-09-03 23:51:36 +00:00
|
|
|
void size_func (GdkPixbufLoader *loader, gint width, gint height, gpointer data)
|
|
|
|
{
|
2005-01-04 13:44:34 +00:00
|
|
|
gdk_pixbuf_loader_set_size (loader, width*2, height*2);
|
2002-09-03 23:51:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
1999-07-08 16:04:16 +00:00
|
|
|
int
|
|
|
|
main (int argc, char **argv)
|
|
|
|
{
|
1999-10-18 19:29:45 +00:00
|
|
|
int i;
|
1999-11-02 22:01:43 +00:00
|
|
|
int found_valid = FALSE;
|
1999-10-18 19:29:45 +00:00
|
|
|
|
|
|
|
GdkPixbuf *pixbuf;
|
1999-10-27 18:55:00 +00:00
|
|
|
GdkPixbufLoader *pixbuf_loader;
|
1999-10-18 19:29:45 +00:00
|
|
|
|
2000-06-21 20:47:22 +00:00
|
|
|
pixbuf_init ();
|
2000-06-22 15:36:12 +00:00
|
|
|
|
1999-10-18 19:29:45 +00:00
|
|
|
gtk_init (&argc, &argv);
|
|
|
|
|
2005-02-25 19:28:48 +00:00
|
|
|
/* gdk_rgb_set_verbose (TRUE);*/
|
1999-10-18 19:29:45 +00:00
|
|
|
|
2001-08-23 15:26:49 +00:00
|
|
|
gtk_widget_set_default_colormap (gdk_rgb_get_colormap ());
|
1999-10-18 19:29:45 +00:00
|
|
|
|
1999-11-02 22:01:43 +00:00
|
|
|
{
|
2001-10-20 23:39:32 +00:00
|
|
|
char *tbf_readlen = getenv ("TBF_READLEN");
|
|
|
|
if (tbf_readlen) readlen = atoi (tbf_readlen);
|
1999-11-02 22:01:43 +00:00
|
|
|
}
|
|
|
|
|
1999-11-09 23:51:35 +00:00
|
|
|
{
|
2001-10-20 23:39:32 +00:00
|
|
|
char *tbf_bps = getenv ("TBF_KBPS");
|
1999-11-09 23:51:35 +00:00
|
|
|
guint bps;
|
|
|
|
|
|
|
|
if (tbf_bps) {
|
2001-10-20 23:39:32 +00:00
|
|
|
bps = atoi (tbf_bps);
|
1999-11-10 17:17:17 +00:00
|
|
|
g_print ("Simulating %d kBytes/sec\n", bps);
|
1999-11-09 23:51:35 +00:00
|
|
|
readlen = (bps*1024)/10;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
1999-10-18 19:29:45 +00:00
|
|
|
i = 1;
|
|
|
|
if (argc == 1) {
|
1999-10-22 23:26:22 +00:00
|
|
|
const gchar*** xpmp;
|
2001-06-26 20:56:32 +00:00
|
|
|
GError *error = NULL;
|
|
|
|
|
2000-04-11 07:03:25 +00:00
|
|
|
pixbuf = gdk_pixbuf_new_from_data (default_image, GDK_COLORSPACE_RGB, FALSE, 8,
|
1999-10-20 21:20:49 +00:00
|
|
|
DEFAULT_WIDTH, DEFAULT_HEIGHT, DEFAULT_WIDTH * 3,
|
|
|
|
NULL, NULL);
|
1999-10-29 22:32:47 +00:00
|
|
|
new_testrgb_window (pixbuf, NULL);
|
1999-10-22 23:26:22 +00:00
|
|
|
|
|
|
|
xpmp = xpms;
|
|
|
|
while (*xpmp) {
|
|
|
|
pixbuf = gdk_pixbuf_new_from_xpm_data (*xpmp);
|
1999-10-29 22:32:47 +00:00
|
|
|
new_testrgb_window (pixbuf, NULL);
|
1999-10-22 23:26:22 +00:00
|
|
|
++xpmp;
|
|
|
|
}
|
2000-10-04 16:39:44 +00:00
|
|
|
|
|
|
|
/* Test loading from inline data. */
|
2001-10-10 16:56:54 +00:00
|
|
|
pixbuf = gdk_pixbuf_new_from_inline (-1, apple_red, FALSE, &error);
|
2001-06-26 20:56:32 +00:00
|
|
|
if (!pixbuf)
|
|
|
|
{
|
|
|
|
fprintf (stderr, "failed to construct \"red apple\" pixbuf: %s\n",
|
|
|
|
error->message);
|
|
|
|
g_error_free (error);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
new_testrgb_window (pixbuf, "Red apple from inlined RLE data");
|
|
|
|
|
2001-10-10 16:56:54 +00:00
|
|
|
pixbuf = gdk_pixbuf_new_from_inline (sizeof (gnome_foot), gnome_foot, TRUE, NULL);
|
2001-06-26 20:56:32 +00:00
|
|
|
new_testrgb_window (pixbuf, "GNOME Foot from inlined RLE data");
|
1999-10-22 23:26:22 +00:00
|
|
|
|
1999-10-20 21:20:49 +00:00
|
|
|
found_valid = TRUE;
|
1999-10-18 19:29:45 +00:00
|
|
|
} else {
|
|
|
|
for (i = 1; i < argc; i++) {
|
2000-10-18 18:42:54 +00:00
|
|
|
GError *error;
|
|
|
|
|
|
|
|
error = NULL;
|
|
|
|
pixbuf = gdk_pixbuf_new_from_file (argv[i], &error);
|
1999-10-29 22:32:47 +00:00
|
|
|
|
2000-10-18 18:42:54 +00:00
|
|
|
if (pixbuf == NULL) {
|
|
|
|
g_warning ("Error loading image: %s",
|
|
|
|
error->message);
|
|
|
|
g_error_free (error);
|
|
|
|
}
|
|
|
|
|
1999-10-20 21:20:49 +00:00
|
|
|
#if 0
|
2001-10-20 23:39:32 +00:00
|
|
|
pixbuf = gdk_pixbuf_rotate (pixbuf, 10.0);
|
1999-10-20 21:20:49 +00:00
|
|
|
#endif
|
|
|
|
|
1999-10-18 19:29:45 +00:00
|
|
|
if (pixbuf) {
|
1999-10-29 22:32:47 +00:00
|
|
|
new_testrgb_window (pixbuf, "File");
|
1999-10-18 19:29:45 +00:00
|
|
|
found_valid = TRUE;
|
|
|
|
}
|
|
|
|
}
|
2002-09-03 23:51:36 +00:00
|
|
|
#if 1
|
1999-10-27 19:42:34 +00:00
|
|
|
{
|
|
|
|
GtkWidget* rgb_window = NULL;
|
1999-11-09 23:51:35 +00:00
|
|
|
ProgressFileStatus status;
|
1999-10-29 22:32:47 +00:00
|
|
|
|
1999-10-27 19:42:34 +00:00
|
|
|
pixbuf_loader = gdk_pixbuf_loader_new ();
|
1999-11-09 23:51:35 +00:00
|
|
|
status.loader = pixbuf_loader;
|
1999-10-27 19:42:34 +00:00
|
|
|
|
1999-11-10 17:43:49 +00:00
|
|
|
status.rgbwin = &rgb_window;
|
|
|
|
|
1999-11-09 23:51:35 +00:00
|
|
|
status.buf = g_malloc (readlen);
|
2002-09-03 23:51:36 +00:00
|
|
|
|
2005-01-04 13:44:34 +00:00
|
|
|
#if 0
|
2002-09-03 23:51:36 +00:00
|
|
|
g_signal_connect (pixbuf_loader, "size_prepared",
|
|
|
|
G_CALLBACK (size_func), NULL);
|
2005-01-04 13:44:34 +00:00
|
|
|
#endif
|
2002-09-03 23:51:36 +00:00
|
|
|
|
2001-10-20 23:39:32 +00:00
|
|
|
g_signal_connect (pixbuf_loader, "area_prepared",
|
|
|
|
G_CALLBACK (progressive_prepared_callback),
|
up version to 1.3.7, interface age 0, binary age 0. depend on glib 1.3.7.
Thu Jun 28 17:18:41 2001 Tim Janik <timj@gtk.org>
* configure.in (GTK_MICRO_VERSION): up version to 1.3.7, interface
age 0, binary age 0. depend on glib 1.3.7.
* gtk/gtkcontainer.c: remove g_signal_handlers_disconnect_by_func() hack.
* gtk/gtkmenubar.c: same here.
* gtk/gtkcontainer.c (gtk_container_focus_tab): fix param-spec retrival.
* gtk/gtkcolorsel.c (gtk_color_selection_init): fix connect_data() usage.
* gtk/gtkentry.c (gtk_entry_focus_in): same here.
* gtk/gtkmenubar.c (add_to_window): likewise.
* gtk/gtktextbtree.c: and here...
* gtk/gtktextview.c (gtk_text_view_ensure_layout): same thing.
* gtk/gtktoolbar.c (gtk_toolbar_init): once more.
* gtk/gtktreemodel.c (connect_ref_callbacks): and another time.
* gtk/gtktreeviewcolumn.c:
(_gtk_tree_view_column_set_tree_view): yet again.
* demos/gtk-demo/images.c (progressive_timeout): demonstrate
signal connections without g_signal_connect_data().
* demos/gtk-demo/stock_browser.c (do_stock_browser): second
demo of the matter.
* demos/testpixbuf.c (main): running out of equality phrases for the
ChangeLog, but had to adapt connections here as well.
* demos/testanimation.c (progressive_timeout): and for the fun of it,
tackled this the same way.
* tests/testtext.c (create_view): ok, it's becoming a pain at this
point, but had enough enery for one more fix.
* tests/testtreecolumns.c (main): stand up man, do your work!
* tests/testtreeview.c (set_columns_type): ok, this is the last file i
fix, either that's been all of it or CVS gtk is broken yet again.
2001-06-28 17:12:40 +00:00
|
|
|
&rgb_window);
|
2001-10-20 23:39:32 +00:00
|
|
|
g_signal_connect (pixbuf_loader, "area_updated",
|
|
|
|
G_CALLBACK (progressive_updated_callback),
|
up version to 1.3.7, interface age 0, binary age 0. depend on glib 1.3.7.
Thu Jun 28 17:18:41 2001 Tim Janik <timj@gtk.org>
* configure.in (GTK_MICRO_VERSION): up version to 1.3.7, interface
age 0, binary age 0. depend on glib 1.3.7.
* gtk/gtkcontainer.c: remove g_signal_handlers_disconnect_by_func() hack.
* gtk/gtkmenubar.c: same here.
* gtk/gtkcontainer.c (gtk_container_focus_tab): fix param-spec retrival.
* gtk/gtkcolorsel.c (gtk_color_selection_init): fix connect_data() usage.
* gtk/gtkentry.c (gtk_entry_focus_in): same here.
* gtk/gtkmenubar.c (add_to_window): likewise.
* gtk/gtktextbtree.c: and here...
* gtk/gtktextview.c (gtk_text_view_ensure_layout): same thing.
* gtk/gtktoolbar.c (gtk_toolbar_init): once more.
* gtk/gtktreemodel.c (connect_ref_callbacks): and another time.
* gtk/gtktreeviewcolumn.c:
(_gtk_tree_view_column_set_tree_view): yet again.
* demos/gtk-demo/images.c (progressive_timeout): demonstrate
signal connections without g_signal_connect_data().
* demos/gtk-demo/stock_browser.c (do_stock_browser): second
demo of the matter.
* demos/testpixbuf.c (main): running out of equality phrases for the
ChangeLog, but had to adapt connections here as well.
* demos/testanimation.c (progressive_timeout): and for the fun of it,
tackled this the same way.
* tests/testtext.c (create_view): ok, it's becoming a pain at this
point, but had enough enery for one more fix.
* tests/testtreecolumns.c (main): stand up man, do your work!
* tests/testtreeview.c (set_columns_type): ok, this is the last file i
fix, either that's been all of it or CVS gtk is broken yet again.
2001-06-28 17:12:40 +00:00
|
|
|
&rgb_window);
|
1999-11-09 23:51:35 +00:00
|
|
|
|
|
|
|
status.imagefile = fopen (argv[1], "r");
|
|
|
|
g_assert (status.imagefile != NULL);
|
|
|
|
|
|
|
|
status.readlen = readlen;
|
|
|
|
|
2006-12-22 19:10:43 +00:00
|
|
|
status.timeout = gdk_threads_add_timeout (100, update_timeout, &status);
|
1999-10-27 19:42:34 +00:00
|
|
|
}
|
1999-11-09 23:51:35 +00:00
|
|
|
#endif
|
1999-10-26 20:43:39 +00:00
|
|
|
}
|
|
|
|
|
1999-10-18 19:29:45 +00:00
|
|
|
if (found_valid)
|
|
|
|
gtk_main ();
|
|
|
|
|
|
|
|
return 0;
|
1999-07-08 16:04:16 +00:00
|
|
|
}
|