mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-24 23:22:30 +01:00
er.. WPrefs Appearance section update
This commit is contained in:
@@ -115,5 +115,6 @@ wmaker_LDADD = \
|
||||
@GFXLIBS@ \
|
||||
@XLIBS@ \
|
||||
@INTLIBS@ \
|
||||
@DLLIBS@ \
|
||||
-lm
|
||||
|
||||
|
||||
@@ -62,6 +62,7 @@ host_triplet = @host@
|
||||
CC = @CC@
|
||||
CPP_PATH = @CPP_PATH@
|
||||
DFLAGS = @DFLAGS@
|
||||
DLLIBS = @DLLIBS@
|
||||
GFXLIBS = @GFXLIBS@
|
||||
HEADER_SEARCH_PATH = @HEADER_SEARCH_PATH@
|
||||
ICONEXT = @ICONEXT@
|
||||
@@ -103,7 +104,7 @@ CPPFLAGS = @CPPFLAGS@ @DFLAGS@ -DLOCALEDIR=\"$(NLSDIR)\"
|
||||
INCLUDES = -I$(top_srcdir)/wrlib -I$(top_srcdir)/WINGs @HEADER_SEARCH_PATH@
|
||||
|
||||
|
||||
wmaker_LDADD = $(top_builddir)/WINGs/libWINGs.a $(top_builddir)/wrlib/libwraster.la @LIBRARY_SEARCH_PATH@ @LIBPL@ @GFXLIBS@ @XLIBS@ @INTLIBS@ -lm
|
||||
wmaker_LDADD = $(top_builddir)/WINGs/libWINGs.a $(top_builddir)/wrlib/libwraster.la @LIBRARY_SEARCH_PATH@ @LIBPL@ @GFXLIBS@ @XLIBS@ @INTLIBS@ @DLLIBS@ -lm
|
||||
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
|
||||
CONFIG_HEADER = config.h
|
||||
|
||||
@@ -722,7 +722,6 @@ wClientGetNormalHints(WWindow *wwin, XWindowAttributes *wattribs, Bool geometry,
|
||||
wwin->normal_hints->flags &= ~PPosition;
|
||||
#endif
|
||||
if (wwin->normal_hints->flags & (USPosition|PPosition)) {
|
||||
puts("QWEWQEWQ");
|
||||
*x = wwin->normal_hints->x;
|
||||
*y = wwin->normal_hints->y;
|
||||
}
|
||||
|
||||
@@ -148,6 +148,9 @@
|
||||
/* Define if you have the strncasecmp function. */
|
||||
#undef HAVE_STRNCASECMP
|
||||
|
||||
/* Define if you have the <dlfcn.h> header file. */
|
||||
#undef HAVE_DLFCN_H
|
||||
|
||||
/* Define if you have the <fcntl.h> header file. */
|
||||
#undef HAVE_FCNTL_H
|
||||
|
||||
|
||||
@@ -1602,6 +1602,7 @@ getEnum(WScreen *scr, WDefaultEntry *entry, proplist_t value, void *addr,
|
||||
* (thgradient <file> <opaqueness> <color> <color>)
|
||||
* (tvgradient <file> <opaqueness> <color> <color>)
|
||||
* (tdgradient <file> <opaqueness> <color> <color>)
|
||||
* (function <lib> <function> ...)
|
||||
*/
|
||||
|
||||
static WTexture*
|
||||
@@ -1853,7 +1854,47 @@ parse_texture(WScreen *scr, proplist_t pl)
|
||||
|
||||
texture = (WTexture*)wTextureMakeTGradient(scr, style, &color1, &color2,
|
||||
val, opacity);
|
||||
} else {
|
||||
}
|
||||
#ifdef TEXTURE_PLUGIN
|
||||
else if (strcasecmp(val, "function")==0) {
|
||||
|
||||
char *lib, *func, **argv;
|
||||
int i, argc;
|
||||
|
||||
if (nelem < 3)
|
||||
return NULL;
|
||||
|
||||
/* get the library name */
|
||||
elem = PLGetArrayElement(pl, 1);
|
||||
if (!elem || !PLIsString(elem)) {
|
||||
return NULL;
|
||||
}
|
||||
lib = PLGetString(elem);
|
||||
|
||||
/* get the function name */
|
||||
elem = PLGetArrayElement(pl, 2);
|
||||
if (!elem || !PLIsString(elem)) {
|
||||
return NULL;
|
||||
}
|
||||
func = PLGetString(elem);
|
||||
|
||||
argc = nelem - 3;
|
||||
argv = (char **) wmalloc (argc * sizeof (char *));
|
||||
|
||||
/* get the parameters */
|
||||
for (i=0; i<argc; i++) {
|
||||
elem = PLGetArrayElement(pl, 3+i);
|
||||
if (!elem || !PLIsString(elem)) {
|
||||
free (argv);
|
||||
return NULL;
|
||||
}
|
||||
argv[i] = PLGetString(elem);
|
||||
}
|
||||
|
||||
texture = (WTexture*)wTextureMakeFunction(scr, lib, func, argc, argv);
|
||||
}
|
||||
#endif /* TEXTURE_PLUGIN */
|
||||
else {
|
||||
wwarning(_("invalid texture type %s"), val);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -24,6 +24,12 @@
|
||||
#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>
|
||||
@@ -177,6 +183,17 @@ wTextureDestroy(WScreen *scr, WTexture *texture)
|
||||
case WTEX_TDGRADIENT:
|
||||
RDestroyImage(texture->tgradient.pixmap);
|
||||
break;
|
||||
|
||||
#ifdef TEXTURE_PLUGIN
|
||||
case WTEX_FUNCTION:
|
||||
#ifdef HAVE_DLFCN_H
|
||||
if (texture->function.handle) {
|
||||
dlclose (texture->function.handle);
|
||||
}
|
||||
#endif
|
||||
free (texture->function.argv);
|
||||
break;
|
||||
#endif /* TEXTURE_PLUGIN */
|
||||
}
|
||||
if (CANFREE(texture->any.color.pixel))
|
||||
colors[count++] = texture->any.color.pixel;
|
||||
@@ -353,6 +370,46 @@ wTextureMakeTGradient(WScreen *scr, int style, RColor *from, RColor *to,
|
||||
}
|
||||
|
||||
|
||||
#ifdef TEXTURE_PLUGIN
|
||||
WTexFunction*
|
||||
wTextureMakeFunction(WScreen *scr, char *lib, char *func, int argc, char **argv)
|
||||
{
|
||||
WTexFunction *texture;
|
||||
texture = wmalloc(sizeof(WTexture));
|
||||
texture->type = WTEX_FUNCTION;
|
||||
texture->handle = NULL;
|
||||
texture->render = 0;
|
||||
texture->argc = argc;
|
||||
texture->argv = argv;
|
||||
|
||||
#ifdef HAVE_DLFCN_H
|
||||
/* open the library */
|
||||
texture->handle = dlopen(lib, RTLD_LAZY);
|
||||
if (!texture->handle) {
|
||||
wwarning(_("library \"%s\" cound not be opened."), lib);
|
||||
free(argv);
|
||||
free(texture);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* find the function */
|
||||
texture->render = dlsym (texture->handle, func);
|
||||
if (!texture->render) {
|
||||
wwarning(_("function \"%s\" not founf in library \"%s\""), func, lib);
|
||||
free(argv);
|
||||
dlclose(texture->handle);
|
||||
free(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)
|
||||
@@ -453,6 +510,18 @@ wTextureRenderImage(WTexture *texture, int width, int height, int relief)
|
||||
}
|
||||
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
|
||||
break;
|
||||
#endif /* TEXTURE_PLUGIN */
|
||||
|
||||
default:
|
||||
puts("ERROR in wTextureRenderImage()");
|
||||
image = NULL;
|
||||
|
||||
@@ -47,6 +47,7 @@
|
||||
#define WTEX_THGRADIENT ((1<<9)|WREL_BORDER_MASK)
|
||||
#define WTEX_TVGRADIENT ((1<<10)|WREL_BORDER_MASK)
|
||||
#define WTEX_TDGRADIENT ((1<<11)|WREL_BORDER_MASK)
|
||||
#define WTEX_FUNCTION ((1<<12)|WREL_BORDER_MASK)
|
||||
|
||||
/* pixmap subtypes */
|
||||
#define WTP_TILE 2
|
||||
@@ -120,6 +121,18 @@ typedef struct WTexTGradient {
|
||||
int opacity;
|
||||
} WTexTGradient;
|
||||
|
||||
typedef struct WTexFunction {
|
||||
short type;
|
||||
char subtype;
|
||||
XColor normal;
|
||||
GC normal_gc;
|
||||
|
||||
void *handle;
|
||||
RImage *(*render) (int, char**, int, int, int);
|
||||
int argc;
|
||||
char **argv;
|
||||
} WTexFunction;
|
||||
|
||||
typedef union WTexture {
|
||||
WTexAny any;
|
||||
WTexSolid solid;
|
||||
@@ -127,6 +140,7 @@ typedef union WTexture {
|
||||
WTexMGradient mgradient;
|
||||
WTexPixmap pixmap;
|
||||
WTexTGradient tgradient;
|
||||
WTexFunction function;
|
||||
} WTexture;
|
||||
|
||||
|
||||
@@ -136,6 +150,9 @@ WTexMGradient *wTextureMakeMGradient(WScreen*, int, RColor**);
|
||||
WTexTGradient *wTextureMakeTGradient(WScreen*, int, RColor*, RColor*, char *, int);
|
||||
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);
|
||||
|
||||
@@ -209,6 +209,8 @@
|
||||
#undef WINDOW_BIRTH_ZOOM
|
||||
|
||||
|
||||
#define TEXTURE_PLUGIN
|
||||
|
||||
/*
|
||||
*--------------------------------------------------------------------
|
||||
* Default Configuration
|
||||
|
||||
Reference in New Issue
Block a user