mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-19 20:38:08 +01:00
wrlib: Fixed and improved NETPBM examples
The tests examples were not compiling because of a missing X11 lib. Signed-off-by: Carlos R. Mafra <crmafra@gmail.com>
This commit is contained in:
committed by
Carlos R. Mafra
parent
8b73356c4f
commit
de1421394c
@@ -8,7 +8,7 @@ EXTRA_DIST = test.png tile.xpm ballot_box.xpm
|
|||||||
|
|
||||||
AM_CPPFLAGS = -I$(srcdir)/.. $(DFLAGS) @HEADER_SEARCH_PATH@
|
AM_CPPFLAGS = -I$(srcdir)/.. $(DFLAGS) @HEADER_SEARCH_PATH@
|
||||||
|
|
||||||
LIBLIST = $(top_builddir)/wrlib/libwraster.la
|
LIBLIST = $(top_builddir)/wrlib/libwraster.la @XLIBS@
|
||||||
|
|
||||||
testdraw_SOURCES = testdraw.c
|
testdraw_SOURCES = testdraw.c
|
||||||
testdraw_LDADD = $(LIBLIST)
|
testdraw_LDADD = $(LIBLIST)
|
||||||
|
|||||||
@@ -562,6 +562,8 @@ int main(int argc, char **argv)
|
|||||||
RContextAttributes attr;
|
RContextAttributes attr;
|
||||||
int visualID = -1;
|
int visualID = -1;
|
||||||
|
|
||||||
|
(void) argc;
|
||||||
|
|
||||||
ProgName = strrchr(argv[0], '/');
|
ProgName = strrchr(argv[0], '/');
|
||||||
if (!ProgName)
|
if (!ProgName)
|
||||||
ProgName = argv[0];
|
ProgName = argv[0];
|
||||||
|
|||||||
@@ -24,8 +24,10 @@ int main(int argc, char **argv)
|
|||||||
attr.colors_per_channel = 4;
|
attr.colors_per_channel = 4;
|
||||||
ctx = RCreateContext(dpy, DefaultScreen(dpy), &attr);
|
ctx = RCreateContext(dpy, DefaultScreen(dpy), &attr);
|
||||||
|
|
||||||
if (argc < 2)
|
if (argc < 2) {
|
||||||
|
printf("using default image as none was provided\n");
|
||||||
img = RGetImageFromXPMData(ctx, image_name);
|
img = RGetImageFromXPMData(ctx, image_name);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
img = RLoadImage(ctx, argv[1], 0);
|
img = RLoadImage(ctx, argv[1], 0);
|
||||||
|
|
||||||
@@ -70,7 +72,7 @@ int main(int argc, char **argv)
|
|||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("%ix%i\n", img->width, img->height);
|
printf("size is %ix%i\n", img->width, img->height);
|
||||||
|
|
||||||
win = XCreateSimpleWindow(dpy, DefaultRootWindow(dpy), 10, 10, img->width, img->height, 0, 0, 0);
|
win = XCreateSimpleWindow(dpy, DefaultRootWindow(dpy), 10, 10, img->width, img->height, 0, 0, 0);
|
||||||
XSetWindowBackgroundPixmap(dpy, win, pix);
|
XSetWindowBackgroundPixmap(dpy, win, pix);
|
||||||
|
|||||||
Reference in New Issue
Block a user