1 /* wmsetbg.c- sets root window background image and also works as
2 * workspace background setting helper for wmaker
4 * WindowMaker window manager
6 * Copyright (c) 1998, 1999 Alfredo K. Kojima
7 * Copyright (c) 1998 Dan Pascu
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
29 #include <X11/Xutil.h>
30 #include <X11/Xatom.h>
34 #include <sys/types.h>
37 #include "../src/wconfig.h"
39 #include "../WINGs/WINGs.h"
40 #include "../WINGs/WUtil.h"
41 #include "../wrlib/wraster.h"
46 #define WORKSPACE_COUNT (MAX_WORKSPACES+1)
56 Pixmap CurrentPixmap
= None
;
57 char *PixmapPath
= NULL
;
61 typedef struct BackgroundTexture
{
69 Pixmap pixmap
; /* for all textures, including solid */
70 int width
; /* size of the pixmap */
78 loadImage(RContext
*rc
, char *file
)
83 path
= wfindfile(PixmapPath
, file
);
85 wwarning("%s:could not find image file used in texture", file
);
89 image
= RLoadImage(rc
, path
, 0);
91 wwarning("%s:could not load image file used in texture:%s", path
,
92 RMessageForError(RErrorCode
));
102 parseTexture(RContext
*rc
, char *text
)
104 BackgroundTexture
*texture
= NULL
;
111 #define GETSTR(val, str, i) \
112 val = PLGetArrayElement(texarray, i);\
113 if (!PLIsString(val)) {\
114 wwarning("could not parse texture %s", text);\
117 str = PLGetString(val)
120 texarray
= PLGetProplistWithDescription(text
);
121 if (!texarray
|| !PLIsArray(texarray
)
122 || (count
= PLGetNumberOfElements(texarray
)) < 2) {
124 wwarning("could not parse texture %s", text
);
130 texture
= wmalloc(sizeof(BackgroundTexture
));
131 memset(texture
, 0, sizeof(BackgroundTexture
));
133 GETSTR(val
, type
, 0);
135 if (strcasecmp(type
, "solid")==0) {
143 if (!XParseColor(dpy
, DefaultColormap(dpy
, scr
), tmp
, &color
)) {
144 wwarning("could not parse color %s in texture %s", tmp
, text
);
147 XAllocColor(dpy
, DefaultColormap(dpy
, scr
), &color
);
149 pixmap
= XCreatePixmap(dpy
, root
, 32, 32, DefaultDepth(dpy
, scr
));
150 XSetForeground(dpy
, DefaultGC(dpy
, scr
), color
.pixel
);
151 XFillRectangle(dpy
, pixmap
, DefaultGC(dpy
, scr
), 0, 0, 32, 32);
153 texture
->pixmap
= pixmap
;
154 texture
->color
= color
;
156 texture
->height
= 32;
157 } else if (strcasecmp(type
, "vgradient")==0
158 || strcasecmp(type
, "dgradient")==0
159 || strcasecmp(type
, "hgradient")==0) {
161 RColor color1
, color2
;
168 if (!XParseColor(dpy
, DefaultColormap(dpy
, scr
), tmp
, &color
)) {
169 wwarning("could not parse color %s in texture %s", tmp
, text
);
173 color1
.red
= color
.red
>> 8;
174 color1
.green
= color
.green
>> 8;
175 color1
.blue
= color
.blue
>> 8;
179 if (!XParseColor(dpy
, DefaultColormap(dpy
, scr
), tmp
, &color
)) {
180 wwarning("could not parse color %s in texture %s", tmp
, text
);
184 color2
.red
= color
.red
>> 8;
185 color2
.green
= color
.green
>> 8;
186 color2
.blue
= color
.blue
>> 8;
191 gtype
= RHorizontalGradient
;
195 gtype
= RVerticalGradient
;
198 gtype
= RDiagonalGradient
;
202 image
= RRenderGradient(scrWidth
, scrHeight
, &color1
, &color2
, gtype
);
205 wwarning("could not render gradient texture:%s",
206 RMessageForError(RErrorCode
));
210 if (!RConvertImage(rc
, image
, &pixmap
)) {
211 wwarning("could not convert texture:%s",
212 RMessageForError(RErrorCode
));
213 RDestroyImage(image
);
217 texture
->width
= image
->width
;
218 texture
->height
= image
->height
;
219 RDestroyImage(image
);
221 texture
->pixmap
= pixmap
;
222 } else if (strcasecmp(type
, "mvgradient")==0
223 || strcasecmp(type
, "mdgradient")==0
224 || strcasecmp(type
, "mhgradient")==0) {
233 colors
= malloc(sizeof(RColor
*)*(count
-1));
235 wwarning("out of memory while parsing texture");
238 memset(colors
, 0, sizeof(RColor
*)*(count
-1));
240 for (i
= 2; i
< count
; i
++) {
241 val
= PLGetArrayElement(texarray
, i
);
242 if (!PLIsString(val
)) {
243 wwarning("could not parse texture %s", text
);
245 for (j
= 0; colors
[j
]!=NULL
; j
++)
250 tmp
= PLGetString(val
);
252 if (!XParseColor(dpy
, DefaultColormap(dpy
, scr
), tmp
, &color
)) {
253 wwarning("could not parse color %s in texture %s",
256 for (j
= 0; colors
[j
]!=NULL
; j
++)
261 if (!(colors
[i
-2] = malloc(sizeof(RColor
)))) {
262 wwarning("out of memory while parsing texture");
264 for (j
= 0; colors
[j
]!=NULL
; j
++)
270 colors
[i
-2]->red
= color
.red
>> 8;
271 colors
[i
-2]->green
= color
.green
>> 8;
272 colors
[i
-2]->blue
= color
.blue
>> 8;
278 gtype
= RHorizontalGradient
;
282 gtype
= RVerticalGradient
;
285 gtype
= RDiagonalGradient
;
289 image
= RRenderMultiGradient(scrWidth
, scrHeight
, colors
, gtype
);
291 for (j
= 0; colors
[j
]!=NULL
; j
++)
296 wwarning("could not render gradient texture:%s",
297 RMessageForError(RErrorCode
));
301 if (!RConvertImage(rc
, image
, &pixmap
)) {
302 wwarning("could not convert texture:%s",
303 RMessageForError(RErrorCode
));
304 RDestroyImage(image
);
308 texture
->width
= image
->width
;
309 texture
->height
= image
->height
;
310 RDestroyImage(image
);
312 texture
->pixmap
= pixmap
;
313 } else if (strcasecmp(type
, "cpixmap")==0
314 || strcasecmp(type
, "spixmap")==0
315 || strcasecmp(type
, "mpixmap")==0
316 || strcasecmp(type
, "tpixmap")==0) {
324 image
= loadImage(rc
, tmp
);
331 if (!XParseColor(dpy
, DefaultColormap(dpy
, scr
), tmp
, &color
)) {
332 wwarning("could not parse color %s in texture %s\n", tmp
, text
);
333 RDestroyImage(image
);
339 rcolor
.red
= color
.red
>> 8;
340 rcolor
.green
= color
.green
>> 8;
341 rcolor
.blue
= color
.blue
>> 8;
342 RGetClosestXColor(rc
, &rcolor
, &color
);
344 switch (toupper(type
[0])) {
346 texture
->width
= image
->width
;
347 texture
->height
= image
->height
;
348 if (!RConvertImage(rc
, image
, &pixmap
)) {
349 wwarning("could not convert texture:%s",
350 RMessageForError(RErrorCode
));
351 RDestroyImage(image
);
357 if (toupper(type
[0])=='S') {
361 if (image
->width
*scrHeight
> image
->height
*scrWidth
) {
363 h
= (scrWidth
*image
->height
)/image
->width
;
366 w
= (scrHeight
*image
->width
)/image
->height
;
372 simage
= RScaleImage(image
, w
, h
);
374 wwarning("could not scale image:%s",
375 RMessageForError(RErrorCode
));
376 RDestroyImage(image
);
379 RDestroyImage(image
);
388 if (!RConvertImage(rc
, image
, &pixmap
)) {
389 wwarning("could not convert texture:%s",
390 RMessageForError(RErrorCode
));
391 RDestroyImage(image
);
395 if (image
->width
!= scrWidth
|| image
->height
!= scrHeight
) {
396 int x
, y
, sx
, sy
, w
, h
;
398 cpixmap
= XCreatePixmap(dpy
, root
, scrWidth
, scrHeight
,
399 DefaultDepth(dpy
, scr
));
401 XSetForeground(dpy
, DefaultGC(dpy
, scr
), color
.pixel
);
402 XFillRectangle(dpy
, cpixmap
, DefaultGC(dpy
, scr
),
403 0, 0, scrWidth
, scrHeight
);
405 if (image
->height
< scrHeight
) {
407 y
= (scrHeight
- h
)/2;
410 sy
= (image
->height
- scrHeight
)/2;
414 if (image
->width
< scrWidth
) {
416 x
= (scrWidth
- w
)/2;
419 sx
= (image
->width
- scrWidth
)/2;
424 XCopyArea(dpy
, pixmap
, cpixmap
, DefaultGC(dpy
, scr
),
426 XFreePixmap(dpy
, pixmap
);
429 RDestroyImage(image
);
431 texture
->width
= scrWidth
;
432 texture
->height
= scrHeight
;
437 texture
->pixmap
= pixmap
;
438 texture
->color
= color
;
439 } else if (strcasecmp(type
, "thgradient")==0
440 || strcasecmp(type
, "tvgradient")==0
441 || strcasecmp(type
, "tdgradient")==0) {
443 RColor color1
, color2
;
453 GETSTR(val
, file
, 1);
461 if (!XParseColor(dpy
, DefaultColormap(dpy
, scr
), tmp
, &color
)) {
462 wwarning("could not parse color %s in texture %s", tmp
, text
);
466 color1
.red
= color
.red
>> 8;
467 color1
.green
= color
.green
>> 8;
468 color1
.blue
= color
.blue
>> 8;
472 if (!XParseColor(dpy
, DefaultColormap(dpy
, scr
), tmp
, &color
)) {
473 wwarning("could not parse color %s in texture %s", tmp
, text
);
477 color2
.red
= color
.red
>> 8;
478 color2
.green
= color
.green
>> 8;
479 color2
.blue
= color
.blue
>> 8;
481 image
= loadImage(rc
, file
);
483 RDestroyImage(gradient
);
490 gtype
= RHorizontalGradient
;
492 theight
= image
->height
> scrHeight
? scrHeight
: image
->height
;
496 gtype
= RVerticalGradient
;
497 twidth
= image
->width
> scrWidth
? scrWidth
: image
->width
;
501 gtype
= RDiagonalGradient
;
506 gradient
= RRenderGradient(twidth
, theight
, &color1
, &color2
, gtype
);
509 wwarning("could not render texture:%s",
510 RMessageForError(RErrorCode
));
511 RDestroyImage(gradient
);
515 tiled
= RMakeTiledImage(image
, twidth
, theight
);
517 wwarning("could not render texture:%s",
518 RMessageForError(RErrorCode
));
519 RDestroyImage(gradient
);
520 RDestroyImage(image
);
523 RDestroyImage(image
);
525 RCombineImagesWithOpaqueness(tiled
, gradient
, opaq
);
526 RDestroyImage(gradient
);
528 if (!RConvertImage(rc
, tiled
, &pixmap
)) {
529 wwarning("could not convert texture:%s",
530 RMessageForError(RErrorCode
));
531 RDestroyImage(image
);
534 texture
->width
= tiled
->width
;
535 texture
->height
= tiled
->height
;
537 RDestroyImage(tiled
);
539 texture
->pixmap
= pixmap
;
541 wwarning("invalid texture type %s", text
);
545 texture
->spec
= wstrdup(text
);
560 freeTexture(BackgroundTexture
*texture
)
562 if (texture
->solid
) {
565 pixel
[0] = texture
->color
.pixel
;
566 /* dont free black/white pixels */
567 if (pixel
[0]!=BlackPixelOfScreen(DefaultScreenOfDisplay(dpy
))
568 && pixel
[0]!=WhitePixelOfScreen(DefaultScreenOfDisplay(dpy
)))
569 XFreeColors(dpy
, DefaultColormap(dpy
, scr
), pixel
, 1, 0);
577 setupTexture(RContext
*rc
, BackgroundTexture
**textures
, int *maxTextures
,
578 int workspace
, char *texture
)
580 BackgroundTexture
*newTexture
= NULL
;
583 /* unset the texture */
585 if (textures
[workspace
]!=NULL
) {
586 textures
[workspace
]->refcount
--;
588 if (textures
[workspace
]->refcount
== 0)
589 freeTexture(textures
[workspace
]);
591 textures
[workspace
] = NULL
;
595 if (textures
[workspace
]
596 && strcasecmp(textures
[workspace
]->spec
, texture
)==0) {
597 /* texture did not change */
601 /* check if the same texture is already created */
602 for (i
= 0; i
< *maxTextures
; i
++) {
603 if (textures
[i
] && strcasecmp(textures
[i
]->spec
, texture
)==0) {
604 newTexture
= textures
[i
];
610 /* create the texture */
611 newTexture
= parseTexture(rc
, texture
);
616 if (textures
[workspace
]!=NULL
) {
618 textures
[workspace
]->refcount
--;
620 if (textures
[workspace
]->refcount
== 0)
621 freeTexture(textures
[workspace
]);
624 newTexture
->refcount
++;
625 textures
[workspace
] = newTexture
;
627 if (*maxTextures
< workspace
)
628 *maxTextures
= workspace
;
634 duplicatePixmap(Pixmap pixmap
, int width
, int height
)
639 /* must open a new display or the RetainPermanent will
640 * leave stuff allocated in RContext unallocated after exit */
641 tmpDpy
= XOpenDisplay("");
643 wwarning("could not open display to update background image information");
649 copyP
= XCreatePixmap(tmpDpy
, root
, width
, height
,
650 DefaultDepth(tmpDpy
, scr
));
651 XCopyArea(tmpDpy
, pixmap
, copyP
, DefaultGC(tmpDpy
, scr
),
652 0, 0, width
, height
, 0, 0);
653 XSync(tmpDpy
, False
);
655 XSetCloseDownMode(tmpDpy
, RetainPermanent
);
656 XCloseDisplay(tmpDpy
);
664 setPixmapProperty(Pixmap pixmap
)
666 static Atom prop
= 0;
669 unsigned long length
, after
;
674 prop
= XInternAtom(dpy
, "_XROOTPMAP_ID", False
);
679 /* Clear out the old pixmap */
680 XGetWindowProperty(dpy
, root
, prop
, 0L, 1L, False
, AnyPropertyType
,
681 &type
, &format
, &length
, &after
, &data
);
683 if ((type
== XA_PIXMAP
) && (format
== 32) && (length
== 1)) {
684 XKillClient(dpy
, *((Pixmap
*)data
));
685 mode
= PropModeReplace
;
687 mode
= PropModeAppend
;
690 XChangeProperty(dpy
, root
, prop
, XA_PIXMAP
, 32, mode
,
691 (unsigned char *) &pixmap
, 1);
693 XDeleteProperty(dpy
, root
, prop
);
703 changeTexture(BackgroundTexture
*texture
)
708 if (texture
->solid
) {
709 XSetWindowBackground(dpy
, root
, texture
->color
.pixel
);
711 XSetWindowBackgroundPixmap(dpy
, root
, texture
->pixmap
);
713 XClearWindow(dpy
, root
);
720 pixmap
= duplicatePixmap(texture
->pixmap
, texture
->width
,
723 setPixmapProperty(pixmap
);
729 readmsg(int fd
, unsigned char *buffer
, int size
)
735 count
= read(fd
, buffer
, size
);
749 * sizeSntexture_spec - sets the texture for workspace n
750 * sizeCn - change background texture to the one for workspace n
751 * sizePpath - set the pixmap search path
754 * size = 4 bytes for length of the message data
757 helperLoop(RContext
*rc
)
759 BackgroundTexture
*textures
[WORKSPACE_COUNT
];
761 unsigned char buffer
[2048], buf
[8];
765 memset(textures
, 0, WORKSPACE_COUNT
*sizeof(BackgroundTexture
*));
771 /* get length of message */
772 if (readmsg(0, buffer
, 4) < 0) {
773 wsyserror("error reading message from Window Maker");
781 memcpy(buf
, buffer
, 4);
786 if (readmsg(0, buffer
, size
) < 0) {
787 wsyserror("error reading message from Window Maker");
796 printf("RECEIVED %s\n",buffer
);
798 if (buffer
[0]!='P') {
799 memcpy(buf
, &buffer
[1], 4);
801 workspace
= atoi(buf
);
802 if (workspace
< 0 || workspace
>= WORKSPACE_COUNT
) {
803 wwarning("received message with invalid workspace number %i\n",
812 printf("set texture %s\n", &buffer
[5]);
814 setupTexture(rc
, textures
, &maxTextures
, workspace
, &buffer
[5]);
819 printf("change texture %i\n", workspace
);
821 if (!textures
[workspace
])
822 changeTexture(textures
[0]);
824 changeTexture(textures
[workspace
]);
829 printf("change pixmappath %s\n", &buffer
[1]);
833 PixmapPath
= wstrdup(&buffer
[1]);
838 printf("unset workspace %i\n", workspace
);
840 setupTexture(rc
, textures
, &maxTextures
, workspace
, NULL
);
845 printf("exit command\n");
850 wwarning("unknown message received");
858 updateDomain(char *domain
, int workspace
, char *texture
)
860 char *program
= "wdwrite";
862 execlp(program
, program
, domain
, "WorkspaceBack", texture
, NULL
);
863 wwarning("warning could not run \"%s\"", program
);
869 getDomain(char *domain
)
875 path
= wdefaultspathfordomain(domain
);
877 wwarning("could not locate file for domain %s", domain
);
881 prop
= PLGetProplistWithPath(path
);
883 if (!prop
|| !PLIsDictionary(prop
)) {
884 wwarning("invalid domain file %s", path
);
897 getPixmapPath(proplist_t prop
)
904 key
= PLMakeString("PixmapPath");
905 val
= PLGetDictionaryEntry(prop
, key
);
907 if (!val
|| !PLIsArray(val
)) {
912 count
= PLGetNumberOfElements(val
);
914 for (i
=0; i
<count
; i
++) {
915 d
= PLGetArrayElement(val
, i
);
916 if (!d
|| !PLIsString(d
)) {
919 len
+= strlen(PLGetString(d
))+1;
922 ptr
= data
= wmalloc(len
+1);
925 for (i
=0; i
<count
; i
++) {
926 d
= PLGetArrayElement(val
, i
);
927 if (!d
|| !PLIsString(d
)) {
930 strcpy(ptr
, PLGetString(d
));
932 ptr
+= strlen(PLGetString(d
));
953 print_help(char *ProgName
)
955 printf("usage: %s [-options] image\n", ProgName
);
957 puts(" -d dither image");
958 puts(" -m match colors");
959 puts(" -b <color> background color");
960 puts(" -t tile image");
961 puts(" -e center image");
962 puts(" -s scale image (default)");
963 puts(" -a scale image and keep aspect ratio");
964 puts(" -u update WindowMaker domain database");
965 puts(" -D <domain> update <domain> database");
966 puts(" -c <cpc> colors per channel to use");
967 puts(" -p <texture> proplist style texture specification");
968 /* puts(" -w <workspace> update the background for the specified workspace");
975 changeTextureForWorkspace(proplist_t dict
, char *texture
, int workspace
)
984 val
= PLGetProplistWithDescription(texture
);
986 wwarning("could not parse texture %s", texture
);
990 key
= PLMakeString("WorkspaceSpecificBack");
991 array
= PLGetDictionaryEntry(dict
, key
);
993 array
= PLMakeArrayFromElements(NULL
, NULL
);
994 PLInsertDictionaryEntry(dict
, key
, array
);
997 j
= PLGetNumberOfElements(array
);
998 if (workspace
>= j
) {
1001 empty
= PLMakeArrayFromElements(NULL
, NULL
);
1003 while (j
++ < workspace
) {
1004 PLAppendArrayElement(array
, empty
);
1006 PLAppendArrayElement(array
, val
);
1008 PLRemoveArrayElement(array
, workspace
);
1009 PLInsertArrayElement(array
, val
, workspace
);
1017 main(int argc
, char **argv
)
1022 RContextAttributes rattr
;
1023 char *style
= "spixmap";
1024 char *back_color
= "gray20";
1025 char *image_name
= NULL
;
1026 char *domain
= "WindowMaker";
1027 int update
=0, cpc
=4, render_mode
=RM_DITHER
, obey_user
=0;
1028 char *texture
= NULL
;
1030 proplist_t domain_prop
;
1034 signal(SIGINT
, SIG_DFL
);
1035 signal(SIGTERM
, SIG_DFL
);
1036 signal(SIGQUIT
, SIG_DFL
);
1037 signal(SIGSEGV
, SIG_DFL
);
1038 signal(SIGBUS
, SIG_DFL
);
1039 signal(SIGFPE
, SIG_DFL
);
1040 signal(SIGABRT
, SIG_DFL
);
1041 signal(SIGHUP
, SIG_DFL
);
1042 signal(SIGPIPE
, SIG_DFL
);
1043 signal(SIGCHLD
, SIG_DFL
);
1045 WMInitializeApplication("wmsetbg", &argc
, argv
);
1047 for (i
=0; i
<argc
; i
++) {
1048 if (strcmp(argv
[i
], "-helper")==0) {
1050 } else if (strcmp(argv
[i
], "-s")==0) {
1052 } else if (strcmp(argv
[i
], "-t")==0) {
1054 } else if (strcmp(argv
[i
], "-e")==0) {
1056 } else if (strcmp(argv
[i
], "-a")==0) {
1058 } else if (strcmp(argv
[i
], "-d")==0) {
1059 render_mode
= RM_DITHER
;
1061 } else if (strcmp(argv
[i
], "-m")==0) {
1062 render_mode
= RM_MATCH
;
1064 } else if (strcmp(argv
[i
], "-u")==0) {
1066 } else if (strcmp(argv
[i
], "-D")==0) {
1070 wfatal("too few arguments for %s\n", argv
[i
-1]);
1073 domain
= wstrdup(argv
[i
]);
1074 } else if (strcmp(argv
[i
], "-c")==0) {
1077 wfatal("too few arguments for %s\n", argv
[i
-1]);
1080 if (sscanf(argv
[i
], "%i", &cpc
)!=1) {
1081 wfatal("bad value for colors per channel: \"%s\"\n", argv
[i
]);
1084 } else if (strcmp(argv
[i
], "-b")==0) {
1087 wfatal("too few arguments for %s\n", argv
[i
-1]);
1090 back_color
= argv
[i
];
1091 } else if (strcmp(argv
[i
], "-p")==0) {
1094 wfatal("too few arguments for %s\n", argv
[i
-1]);
1098 } else if (strcmp(argv
[i
], "-w")==0) {
1101 wfatal("too few arguments for %s\n", argv
[i
-1]);
1104 if (sscanf(argv
[i
], "%i", &workspace
)!=1) {
1105 wfatal("bad value for workspace number: \"%s\"",
1109 } else if (argv
[i
][0] != '-') {
1110 image_name
= argv
[i
];
1112 print_help(argv
[0]);
1117 domain_prop
= getDomain(domain
);
1119 PixmapPath
= getPixmapPath(domain_prop
);
1121 dpy
= XOpenDisplay("");
1123 wfatal("could not open display");
1126 XSynchronize(dpy
, 1);
1128 root
= DefaultRootWindow(dpy
);
1130 scr
= DefaultScreen(dpy
);
1132 scrWidth
= WidthOfScreen(DefaultScreenOfDisplay(dpy
));
1133 scrHeight
= HeightOfScreen(DefaultScreenOfDisplay(dpy
));
1135 if (!obey_user
&& DefaultDepth(dpy
, scr
) <= 8)
1136 render_mode
= RM_DITHER
;
1138 rattr
.flags
= RC_RenderMode
| RC_ColorsPerChannel
| RC_DefaultVisual
;
1139 rattr
.render_mode
= render_mode
;
1140 rattr
.colors_per_channel
= cpc
;
1142 rc
= RCreateContext(dpy
, scr
, &rattr
);
1145 /* lower priority, so that it wont use all the CPU */
1148 PLRelease(domain_prop
);
1152 BackgroundTexture
*tex
;
1156 sprintf(buffer
, "(%s, %s, %s)", style
, image_name
, back_color
);
1157 texture
= (char*)buffer
;
1160 if (update
&& workspace
< 0) {
1161 updateDomain(domain
, workspace
, texture
);
1164 tex
= parseTexture(rc
, texture
);
1171 changeTextureForWorkspace(domain_prop
, texture
, workspace
);