diff --git a/ChangeLog b/ChangeLog index 7b7ecbe6..a9cea3e4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Changes since version 0.52.0: +............................. + +- patched wmsetbg to work with dynamically loadable texture renderer code +- added libwmfun to distribution (forgot to do so in 0.52.0) + + Changes since version 0.51.2: ............................. @@ -14,7 +21,8 @@ Changes since version 0.51.2: - enhancements to the modelock patch (id@windowmaker.org) - show kbd mode for modelock (id@windowmaker.org) - enhanced positioning of transient windows -- added dynamically loadable texture renderer code (from ?) +- added dynamically loadable texture renderer code + from Tobias Gloth - added DisableMiniwindows option - kde: miniaturize animation will match the taskbar icon (KWM_WIN_ICON_GEOMETRY) - miniwindows show the title of the window if there is none set for it diff --git a/libwmfun-0.0.0.tar.gz b/libwmfun-0.0.0.tar.gz deleted file mode 100644 index 1dbb8423..00000000 Binary files a/libwmfun-0.0.0.tar.gz and /dev/null differ diff --git a/libwmfun-0.0.1.tar.gz b/libwmfun-0.0.1.tar.gz new file mode 100644 index 00000000..8ad7772d Binary files /dev/null and b/libwmfun-0.0.1.tar.gz differ diff --git a/util/Makefile.am b/util/Makefile.am index 1f378ece..6b1bb10c 100644 --- a/util/Makefile.am +++ b/util/Makefile.am @@ -35,7 +35,7 @@ wmsetbg_LDADD = \ $(top_builddir)/wrlib/libwraster.la \ @LIBRARY_SEARCH_PATH@ \ @LIBPL@ \ - @GFXLIBS@ @XLIBS@ -lm + @GFXLIBS@ @XLIBS@ @DLLIBS@ -lm getstyle_SOURCES = getstyle.c diff --git a/util/Makefile.in b/util/Makefile.in index da9e1885..42167de5 100644 --- a/util/Makefile.in +++ b/util/Makefile.in @@ -116,7 +116,7 @@ seticons_LDADD = $(liblist) geticonset_LDADD = $(liblist) -wmsetbg_LDADD = $(top_builddir)/WINGs/libWINGs.a $(top_builddir)/wrlib/libwraster.la @LIBRARY_SEARCH_PATH@ @LIBPL@ @GFXLIBS@ @XLIBS@ -lm +wmsetbg_LDADD = $(top_builddir)/WINGs/libWINGs.a $(top_builddir)/wrlib/libwraster.la @LIBRARY_SEARCH_PATH@ @LIBPL@ @GFXLIBS@ @XLIBS@ @DLLIBS@ -lm getstyle_SOURCES = getstyle.c diff --git a/util/wmsetbg.c b/util/wmsetbg.c index 7c5e64bb..c61c2c2a 100644 --- a/util/wmsetbg.c +++ b/util/wmsetbg.c @@ -38,6 +38,12 @@ #include #include +#include "../src/config.h" + +#ifdef HAVE_DLFCN_H +#include +#endif + #include "../src/wconfig.h" #include "../WINGs/WINGs.h" @@ -118,15 +124,14 @@ parseTexture(RContext *rc, char *text) char *tmp; char *type; -#define GETSTR(val, str, i) \ +#define GETSTRORGOTO(val, str, i, label) \ val = PLGetArrayElement(texarray, i);\ if (!PLIsString(val)) {\ wwarning("could not parse texture %s", text);\ - goto error;\ + goto label;\ }\ str = PLGetString(val) - texarray = PLGetProplistWithDescription(text); if (!texarray || !PLIsArray(texarray) || (count = PLGetNumberOfElements(texarray)) < 2) { @@ -140,7 +145,7 @@ parseTexture(RContext *rc, char *text) texture = wmalloc(sizeof(BackgroundTexture)); memset(texture, 0, sizeof(BackgroundTexture)); - GETSTR(val, type, 0); + GETSTRORGOTO(val, type, 0, error); if (strcasecmp(type, "solid")==0) { XColor color; @@ -148,7 +153,7 @@ parseTexture(RContext *rc, char *text) texture->solid = 1; - GETSTR(val, tmp, 1); + GETSTRORGOTO(val, tmp, 1, error); if (!XParseColor(dpy, DefaultColormap(dpy, scr), tmp, &color)) { wwarning("could not parse color %s in texture %s", tmp, text); @@ -174,7 +179,7 @@ parseTexture(RContext *rc, char *text) int gtype; int iwidth, iheight; - GETSTR(val, tmp, 1); + GETSTRORGOTO(val, tmp, 1, error); if (!XParseColor(dpy, DefaultColormap(dpy, scr), tmp, &color)) { wwarning("could not parse color %s in texture %s", tmp, text); @@ -185,7 +190,7 @@ parseTexture(RContext *rc, char *text) color1.green = color.green >> 8; color1.blue = color.blue >> 8; - GETSTR(val, tmp, 2); + GETSTRORGOTO(val, tmp, 2, error); if (!XParseColor(dpy, DefaultColormap(dpy, scr), tmp, &color)) { wwarning("could not parse color %s in texture %s", tmp, text); @@ -343,7 +348,7 @@ parseTexture(RContext *rc, char *text) int w, h; int iwidth, iheight; - GETSTR(val, tmp, 1); + GETSTRORGOTO(val, tmp, 1, error); /* if (toupper(type[0]) == 'T' || toupper(type[0]) == 'C') pixmap = LoadJPEG(rc, tmp, &iwidth, &iheight); @@ -358,7 +363,7 @@ parseTexture(RContext *rc, char *text) iheight = image->height; } - GETSTR(val, tmp, 2); + GETSTRORGOTO(val, tmp, 2, error); if (!XParseColor(dpy, DefaultColormap(dpy, scr), tmp, &color)) { wwarning("could not parse color %s in texture %s\n", tmp, text); @@ -486,13 +491,13 @@ parseTexture(RContext *rc, char *text) int gtype; int twidth, theight; - GETSTR(val, file, 1); + GETSTRORGOTO(val, file, 1, error); - GETSTR(val, tmp, 2); + GETSTRORGOTO(val, tmp, 2, error); opaq = atoi(tmp); - GETSTR(val, tmp, 3); + GETSTRORGOTO(val, tmp, 3, error); if (!XParseColor(dpy, DefaultColormap(dpy, scr), tmp, &color)) { wwarning("could not parse color %s in texture %s", tmp, text); @@ -503,7 +508,7 @@ parseTexture(RContext *rc, char *text) color1.green = color.green >> 8; color1.blue = color.blue >> 8; - GETSTR(val, tmp, 4); + GETSTRORGOTO(val, tmp, 4, error); if (!XParseColor(dpy, DefaultColormap(dpy, scr), tmp, &color)) { wwarning("could not parse color %s in texture %s", tmp, text); @@ -573,6 +578,86 @@ parseTexture(RContext *rc, char *text) RDestroyImage(tiled); texture->pixmap = pixmap; + } else if (strcasecmp(type, "function")==0) { +#ifdef HAVE_DLFCN_H + void (*initFunc) (Display*, Colormap); + RImage* (*mainFunc) (int, char**, int, int, int); + Pixmap pixmap; + RImage *image = 0; + int success = 0; + char *lib, *func, **argv = 0; + void *handle = 0; + int i, argc; + + if (count < 3) + goto function_cleanup; + + /* get the library name */ + GETSTRORGOTO(val, lib, 1, function_cleanup); + + /* get the function name */ + GETSTRORGOTO(val, func, 2, function_cleanup); + + argc = count - 2; + argv = (char**)wmalloc(argc * sizeof(char*)); + + /* get the parameters */ + argv[0] = func; + for (i=0; iwidth = scrWidth; + texture->height = scrHeight; + texture->pixmap = pixmap; + success = 1; + +function_cleanup: + if (argv) { + int i; + for (i=0; i