summaryrefslogtreecommitdiff
path: root/demos/testpixbuf.c
diff options
context:
space:
mode:
authorHavoc Pennington <hp@pobox.com>1999-10-22 23:26:22 +0000
committerHavoc Pennington <hp@src.gnome.org>1999-10-22 23:26:22 +0000
commitc3c9c72281bd78ecb9444cac6297858903c0555d (patch)
tree1375639f99c6036a6b9f7ca36b930d7b727e9ac6 /demos/testpixbuf.c
parent5cf2775f46583682ba7e7112da79a5a6b802b43b (diff)
downloadgdk-pixbuf-c3c9c72281bd78ecb9444cac6297858903c0555d.tar.gz
Clean up stupid increment-inside-array-dereference thing
1999-10-22 Havoc Pennington <hp@pobox.com> * src/io-xpm.c (mem_buffer): Clean up stupid increment-inside-array-dereference thing * src/testpixbuf.c: Add XPM data tests. * src/io-xpm.c: Make the XPM data buffer const, fix const correctness throughout the code.
Diffstat (limited to 'demos/testpixbuf.c')
-rw-r--r--demos/testpixbuf.c130
1 files changed, 130 insertions, 0 deletions
diff --git a/demos/testpixbuf.c b/demos/testpixbuf.c
index 96c20bd63..374354a05 100644
--- a/demos/testpixbuf.c
+++ b/demos/testpixbuf.c
@@ -175,6 +175,126 @@ static const unsigned char default_image[] = {
0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff, 0xff, 0x00, 0xff
};
+
+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
+};
+
static void
quit_func (GtkWidget *widget, gpointer dummy)
{
@@ -299,10 +419,20 @@ main (int argc, char **argv)
i = 1;
if (argc == 1) {
+ const gchar*** xpmp;
+
pixbuf = gdk_pixbuf_new_from_data ((guchar *) default_image, ART_PIX_RGB, FALSE,
DEFAULT_WIDTH, DEFAULT_HEIGHT, DEFAULT_WIDTH * 3,
NULL, NULL);
new_testrgb_window (pixbuf);
+
+ xpmp = xpms;
+ while (*xpmp) {
+ pixbuf = gdk_pixbuf_new_from_xpm_data (*xpmp);
+ new_testrgb_window (pixbuf);
+ ++xpmp;
+ }
+
found_valid = TRUE;
} else {
for (i = 1; i < argc; i++) {