mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-24 23:22:30 +01:00
Remove texture plugins
- leave a note for the unlikely case of such configuration being found, the user is notified properly
This commit is contained in:
committed by
Carlos R. Mafra
parent
61a96e79c4
commit
1a0c8afa80
@@ -117,8 +117,7 @@ wmaker_LDADD = \
|
||||
@XLFLAGS@ \
|
||||
@XFTLIBS@ \
|
||||
@XLIBS@ \
|
||||
@INTLIBS@ \
|
||||
@DLLIBS@
|
||||
@INTLIBS@
|
||||
|
||||
LIBTOOL = $(SHELL) $(top_srcdir)/libtool $(LIBTOOL_ARG)
|
||||
|
||||
|
||||
@@ -36,10 +36,6 @@
|
||||
#include <limits.h>
|
||||
#include <signal.h>
|
||||
|
||||
#ifdef HAVE_DLFCN_H
|
||||
# include <dlfcn.h>
|
||||
#endif
|
||||
|
||||
#ifndef PATH_MAX
|
||||
#define PATH_MAX DEFAULT_PATH_MAX
|
||||
#endif
|
||||
@@ -1792,64 +1788,12 @@ static WTexture *parse_texture(WScreen * scr, WMPropList * pl)
|
||||
val = WMGetFromPLString(elem);
|
||||
|
||||
texture = (WTexture *) wTextureMakeTGradient(scr, style, &color1, &color2, val, opacity);
|
||||
}
|
||||
#ifdef TEXTURE_PLUGIN
|
||||
else if (strcasecmp(val, "function") == 0) {
|
||||
WTexFunction *function;
|
||||
void (*initFunc) (Display *, Colormap);
|
||||
char *lib, *func, **argv;
|
||||
int i, argc;
|
||||
|
||||
if (nelem < 3)
|
||||
return NULL;
|
||||
|
||||
/* get the library name */
|
||||
elem = WMGetFromPLArray(pl, 1);
|
||||
if (!elem || !WMIsPLString(elem)) {
|
||||
return NULL;
|
||||
}
|
||||
lib = WMGetFromPLString(elem);
|
||||
|
||||
/* get the function name */
|
||||
elem = WMGetFromPLArray(pl, 2);
|
||||
if (!elem || !WMIsPLString(elem)) {
|
||||
return NULL;
|
||||
}
|
||||
func = WMGetFromPLString(elem);
|
||||
|
||||
argc = nelem - 2;
|
||||
argv = (char **)wmalloc(argc * sizeof(char *));
|
||||
|
||||
/* get the parameters */
|
||||
argv[0] = wstrdup(func);
|
||||
for (i = 0; i < argc - 1; i++) {
|
||||
elem = WMGetFromPLArray(pl, 3 + i);
|
||||
if (!elem || !WMIsPLString(elem)) {
|
||||
wfree(argv);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
argv[i + 1] = wstrdup(WMGetFromPLString(elem));
|
||||
}
|
||||
|
||||
function = wTextureMakeFunction(scr, lib, func, argc, argv);
|
||||
|
||||
#ifdef HAVE_DLFCN_H
|
||||
if (function) {
|
||||
initFunc = dlsym(function->handle, "initWindowMaker");
|
||||
if (initFunc) {
|
||||
initFunc(dpy, scr->w_colormap);
|
||||
} else {
|
||||
wwarning(_("could not initialize library %s"), lib);
|
||||
}
|
||||
} else {
|
||||
wwarning(_("could not find function %s::%s"), lib, func);
|
||||
}
|
||||
#endif /* HAVE_DLFCN_H */
|
||||
texture = (WTexture *) function;
|
||||
}
|
||||
#endif /* TEXTURE_PLUGIN */
|
||||
else {
|
||||
} else if (strcasecmp(val, "function") == 0) {
|
||||
/* Leave this in to handle the unlikely case of
|
||||
* someone actually having function textures configured */
|
||||
wwarning("function texture support has been removed");
|
||||
return NULL;
|
||||
} else {
|
||||
wwarning(_("invalid texture type %s"), val);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -24,12 +24,6 @@
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Xutil.h>
|
||||
|
||||
#ifdef TEXTURE_PLUGIN
|
||||
# ifdef HAVE_DLFCN_H
|
||||
# include <dlfcn.h>
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
@@ -160,21 +154,8 @@ void wTextureDestroy(WScreen * scr, WTexture * texture)
|
||||
case WTEX_TDGRADIENT:
|
||||
RReleaseImage(texture->tgradient.pixmap);
|
||||
break;
|
||||
|
||||
#ifdef TEXTURE_PLUGIN
|
||||
case WTEX_FUNCTION:
|
||||
#ifdef HAVE_DLFCN_H
|
||||
if (texture->function.handle) {
|
||||
dlclose(texture->function.handle);
|
||||
}
|
||||
#endif
|
||||
for (i = 0; i < texture->function.argc; i++) {
|
||||
wfree(texture->function.argv[i]);
|
||||
}
|
||||
wfree(texture->function.argv);
|
||||
break;
|
||||
#endif /* TEXTURE_PLUGIN */
|
||||
}
|
||||
|
||||
if (CANFREE(texture->any.color.pixel))
|
||||
colors[count++] = texture->any.color.pixel;
|
||||
if (count > 0) {
|
||||
@@ -361,58 +342,6 @@ WTexTGradient *wTextureMakeTGradient(WScreen * scr, int style, RColor * from, RC
|
||||
return texture;
|
||||
}
|
||||
|
||||
#ifdef TEXTURE_PLUGIN
|
||||
WTexFunction *wTextureMakeFunction(WScreen * scr, char *lib, char *func, int argc, char **argv)
|
||||
{
|
||||
XColor fallbackColor;
|
||||
XGCValues gcv;
|
||||
WTexFunction *texture;
|
||||
|
||||
texture = wmalloc(sizeof(WTexture));
|
||||
memset(&fallbackColor, 0, sizeof(fallbackColor));
|
||||
|
||||
texture->type = WTEX_FUNCTION;
|
||||
texture->handle = NULL;
|
||||
texture->render = 0;
|
||||
texture->argc = argc;
|
||||
texture->argv = argv;
|
||||
|
||||
fallbackColor.red = 0x8000;
|
||||
fallbackColor.green = 0x8000;
|
||||
fallbackColor.blue = 0x8000;
|
||||
|
||||
gcv.background = gcv.foreground = fallbackColor.pixel;
|
||||
gcv.graphics_exposures = False;
|
||||
texture->normal_gc = XCreateGC(dpy, scr->w_win, GCForeground | GCBackground | GCGraphicsExposures, &gcv);
|
||||
|
||||
# ifdef HAVE_DLFCN_H
|
||||
/* open the library */
|
||||
texture->handle = dlopen(lib, RTLD_LAZY);
|
||||
if (!texture->handle) {
|
||||
wwarning(_("library \"%s\" cound not be opened."), lib);
|
||||
wfree(argv);
|
||||
wfree(texture);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* find the function */
|
||||
texture->render = dlsym(texture->handle, func);
|
||||
if (!texture->render) {
|
||||
wwarning(_("function \"%s\" not found in library \"%s\""), func, lib);
|
||||
wfree(argv);
|
||||
dlclose(texture->handle);
|
||||
wfree(texture);
|
||||
return NULL;
|
||||
}
|
||||
# else
|
||||
wwarning(_("function textures not supported on this system, sorry."));
|
||||
# endif
|
||||
|
||||
/* success! */
|
||||
return texture;
|
||||
}
|
||||
#endif /* TEXTURE_PLUGIN */
|
||||
|
||||
RImage *wTextureRenderImage(WTexture * texture, int width, int height, int relief)
|
||||
{
|
||||
RImage *image = NULL;
|
||||
@@ -513,21 +442,6 @@ RImage *wTextureRenderImage(WTexture * texture, int width, int height, int relie
|
||||
RReleaseImage(grad);
|
||||
}
|
||||
break;
|
||||
|
||||
#ifdef TEXTURE_PLUGIN
|
||||
case WTEX_FUNCTION:
|
||||
#ifdef HAVE_DLFCN_H
|
||||
if (texture->function.render) {
|
||||
image = texture->function.render(texture->function.argc, texture->function.argv,
|
||||
width, height, relief);
|
||||
}
|
||||
#endif
|
||||
if (!image) {
|
||||
RErrorCode = RERR_INTERNAL;
|
||||
}
|
||||
break;
|
||||
#endif /* TEXTURE_PLUGIN */
|
||||
|
||||
default:
|
||||
puts("ERROR in wTextureRenderImage()");
|
||||
image = NULL;
|
||||
|
||||
@@ -166,9 +166,6 @@ WTexTGradient *wTextureMakeTGradient(WScreen*, int, RColor*, RColor*, char *, in
|
||||
WTexIGradient *wTextureMakeIGradient(WScreen*, int, RColor[], int, RColor[]);
|
||||
WTexPixmap *wTextureMakePixmap(WScreen *scr, int style, char *pixmap_file,
|
||||
XColor *color);
|
||||
#ifdef TEXTURE_PLUGIN
|
||||
WTexFunction *wTextureMakeFunction(WScreen*, char *, char *, int, char **);
|
||||
#endif
|
||||
void wTextureDestroy(WScreen*, WTexture*);
|
||||
void wTexturePaint(WTexture *, Pixmap *, WCoreWindow*, int, int);
|
||||
void wTextureRender(WScreen*, WTexture*, Pixmap*, int, int, int);
|
||||
|
||||
@@ -32,12 +32,6 @@
|
||||
* Also check the features you can enable through configure.
|
||||
*/
|
||||
|
||||
/*
|
||||
* #undefine if you dont want texture plugin support or your system have
|
||||
* some sort of problem with them.
|
||||
*/
|
||||
#define TEXTURE_PLUGIN
|
||||
|
||||
/* If you want animations for iconification, shading, icon arrangement etc. */
|
||||
#define ANIMATIONS
|
||||
|
||||
|
||||
Reference in New Issue
Block a user