4 * (c) 1998-2004 Alexey Vyskubov <alexey@mawhrin.net>
7 #include <stdio.h> /* puts() */
18 /* Let us make lint happy! */
19 #define lputs(x) (void)(puts(x))
24 static XImage
*stupid_picture
[5]; /* Icons for fookb */
34 static int get_one_image(char *name
, int index
, Display
*dpy
)
38 foo
= XpmReadFileToImage(dpy
, name
, &stupid_picture
[index
],
45 w
= stupid_picture
[index
]->width
;
47 lputs("FATAL: Icon1 has zero width!");
51 lputs("Warning: Icon width is more than 64. Strange things may happen if using Window Maker.");
56 h
= stupid_picture
[index
]->height
;
58 lputs("FATAL: Icon1 had zero height!");
62 lputs("Warning: Icon height is more than 64. Strange things may happen if using Window Maker.");
66 if (w
!= stupid_picture
[index
]->width
) {
67 lputs("FATAL: Not all icons are of the same width!");
71 if (h
!= stupid_picture
[index
]->height
) {
72 lputs("FATAL: Not all iconse are of the same height!");
78 void read_images(Display
*dpy
)
84 for (i
= 0; i
< 5; i
++) {
88 res
= get_one_image(read_param("Icon1"), 0, dpy
);
91 res
= get_one_image(read_param("Icon2"), 1, dpy
);
94 res
= get_one_image(read_param("Icon3"), 2, dpy
);
97 res
= get_one_image(read_param("Icon4"), 3, dpy
);
100 res
= get_one_image(read_param("IconBoom"), 4, dpy
);
106 lputs("Xpm file open failed:");
110 lputs("Xpm file is invalid:");
114 lputs("No memory for open xpm file:");
121 if (!(status
== 0)) {
125 lputs(read_param("Icon1"));
128 lputs(read_param("Icon2"));
131 lputs(read_param("Icon3"));
134 lputs(read_param("Icon4"));
137 lputs(read_param("IconBoom"));
140 lputs("UNKNOWN ERROR! PLEASE REPORT!!!");
149 void update_window(Drawable win
, GC gc
, unsigned int whattodo
, Display
*dpy
)
153 err
= XPutImage(dpy
, win
, gc
, stupid_picture
[whattodo
],
156 if (0 == err
) return;
160 lputs("Fatal error, XPutImage returns BadDrawable. "
164 lputs("Fatal error, XPutImage returns BadGC. "
168 lputs("Fatal error, XPutImage returns BadMatch. "
172 lputs("Fatal error, XPutImage returns BadValue. "
176 lputs("Fatal error, XPutImage returns unknown error. "
177 "Please report, but probably "
178 "it is a bug in X.");