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>
36 #include "../src/wconfig.h"
38 #include "../WINGs/WINGs.h"
39 #include "../WINGs/WUtil.h"
40 #include "../wrlib/wraster.h"
45 #define WORKSPACE_COUNT (MAX_WORKSPACES+1)
55 Pixmap CurrentPixmap
= None
;
56 char *PixmapPath
= NULL
;
60 typedef struct BackgroundTexture
{
68 Pixmap pixmap
; /* for all textures, including solid */
69 int width
; /* size of the pixmap */
77 loadImage(RContext
*rc
, char *file
)
82 path
= wfindfile(PixmapPath
, file
);
84 wwarning("%s:could not find image file used in texture", file
);
88 image
= RLoadImage(rc
, path
, 0);
90 wwarning("%s:could not load image file used in texture:%s", path
,
91 RMessageForError(RErrorCode
));
101 parseTexture(RContext
*rc
, char *text
)
103 BackgroundTexture
*texture
= NULL
;
110 #define GETSTR(val, str, i) \
111 val = PLGetArrayElement(texarray, i);\
112 if (!PLIsString(val)) {\
113 wwarning("could not parse texture %s", text);\
116 str = PLGetString(val)
119 texarray
= PLGetProplistWithDescription(text
);
120 if (!texarray
|| !PLIsArray(texarray
)
121 || (count
= PLGetNumberOfElements(texarray
)) < 2) {
123 wwarning("could not parse texture %s", text
);
129 texture
= wmalloc(sizeof(BackgroundTexture
));
130 memset(texture
, 0, sizeof(BackgroundTexture
));
132 GETSTR(val
, type
, 0);
134 if (strcasecmp(type
, "solid")==0) {
142 if (!XParseColor(dpy
, DefaultColormap(dpy
, scr
), tmp
, &color
)) {
143 wwarning("could not parse color %s in texture %s", tmp
, text
);
146 XAllocColor(dpy
, DefaultColormap(dpy
, scr
), &color
);
148 pixmap
= XCreatePixmap(dpy
, root
, 32, 32, DefaultDepth(dpy
, scr
));
149 XSetForeground(dpy
, DefaultGC(dpy
, scr
), color
.pixel
);
150 XFillRectangle(dpy
, pixmap
, DefaultGC(dpy
, scr
), 0, 0, 32, 32);
152 texture
->pixmap
= pixmap
;
153 texture
->color
= color
;
155 texture
->height
= 32;
156 } else if (strcasecmp(type
, "vgradient")==0
157 || strcasecmp(type
, "dgradient")==0
158 || strcasecmp(type
, "hgradient")==0) {
160 RColor color1
, color2
;
167 if (!XParseColor(dpy
, DefaultColormap(dpy
, scr
), tmp
, &color
)) {
168 wwarning("could not parse color %s in texture %s", tmp
, text
);
172 color1
.red
= color
.red
>> 8;
173 color1
.green
= color
.green
>> 8;
174 color1
.blue
= color
.blue
>> 8;
178 if (!XParseColor(dpy
, DefaultColormap(dpy
, scr
), tmp
, &color
)) {
179 wwarning("could not parse color %s in texture %s", tmp
, text
);
183 color2
.red
= color
.red
>> 8;
184 color2
.green
= color
.green
>> 8;
185 color2
.blue
= color
.blue
>> 8;
190 gtype
= RHorizontalGradient
;
194 gtype
= RVerticalGradient
;
197 gtype
= RDiagonalGradient
;
201 image
= RRenderGradient(scrWidth
, scrHeight
, &color1
, &color2
, gtype
);
204 wwarning("could not render gradient texture:%s",
205 RMessageForError(RErrorCode
));
209 if (!RConvertImage(rc
, image
, &pixmap
)) {
210 wwarning("could not convert texture:%s",
211 RMessageForError(RErrorCode
));
212 RDestroyImage(image
);
216 texture
->width
= image
->width
;
217 texture
->height
= image
->height
;
218 RDestroyImage(image
);
220 texture
->pixmap
= pixmap
;
221 } else if (strcasecmp(type
, "mvgradient")==0
222 || strcasecmp(type
, "mdgradient")==0
223 || strcasecmp(type
, "mhgradient")==0) {
232 colors
= malloc(sizeof(RColor
*)*(count
-1));
234 wwarning("out of memory while parsing texture");
237 memset(colors
, 0, sizeof(RColor
*)*(count
-1));
239 for (i
= 2; i
< count
; i
++) {
240 val
= PLGetArrayElement(texarray
, i
);
241 if (!PLIsString(val
)) {
242 wwarning("could not parse texture %s", text
);
244 for (j
= 0; colors
[j
]!=NULL
; j
++)
249 tmp
= PLGetString(val
);
251 if (!XParseColor(dpy
, DefaultColormap(dpy
, scr
), tmp
, &color
)) {
252 wwarning("could not parse color %s in texture %s",
255 for (j
= 0; colors
[j
]!=NULL
; j
++)
260 if (!(colors
[i
-2] = malloc(sizeof(RColor
)))) {
261 wwarning("out of memory while parsing texture");
263 for (j
= 0; colors
[j
]!=NULL
; j
++)
269 colors
[i
-2]->red
= color
.red
>> 8;
270 colors
[i
-2]->green
= color
.green
>> 8;
271 colors
[i
-2]->blue
= color
.blue
>> 8;
277 gtype
= RHorizontalGradient
;
281 gtype
= RVerticalGradient
;
284 gtype
= RDiagonalGradient
;
288 image
= RRenderMultiGradient(scrWidth
, scrHeight
, colors
, gtype
);
290 for (j
= 0; colors
[j
]!=NULL
; j
++)
295 wwarning("could not render gradient texture:%s",
296 RMessageForError(RErrorCode
));
300 if (!RConvertImage(rc
, image
, &pixmap
)) {
301 wwarning("could not convert texture:%s",
302 RMessageForError(RErrorCode
));
303 RDestroyImage(image
);
307 texture
->width
= image
->width
;
308 texture
->height
= image
->height
;
309 RDestroyImage(image
);
311 texture
->pixmap
= pixmap
;
312 } else if (strcasecmp(type
, "cpixmap")==0
313 || strcasecmp(type
, "spixmap")==0
314 || strcasecmp(type
, "tpixmap")==0) {
321 image
= loadImage(rc
, tmp
);
328 if (!XParseColor(dpy
, DefaultColormap(dpy
, scr
), tmp
, &color
)) {
329 wwarning("could not parse color %s in texture %s\n", tmp
, text
);
330 RDestroyImage(image
);
336 rcolor
.red
= color
.red
>> 8;
337 rcolor
.green
= color
.green
>> 8;
338 rcolor
.blue
= color
.blue
>> 8;
339 RGetClosestXColor(rc
, &rcolor
, &color
);
344 texture
->width
= image
->width
;
345 texture
->height
= image
->height
;
346 if (!RConvertImage(rc
, image
, &pixmap
)) {
347 wwarning("could not convert texture:%s",
348 RMessageForError(RErrorCode
));
349 RDestroyImage(image
);
359 if (image
->width
*scrHeight
> image
->height
*scrWidth
) {
361 h
= (scrWidth
*image
->height
)/image
->width
;
364 w
= (scrHeight
*image
->width
)/image
->height
;
367 simage
= RScaleImage(image
, w
, h
);
369 wwarning("could not scale image:%s",
370 RMessageForError(RErrorCode
));
371 RDestroyImage(image
);
374 RDestroyImage(image
);
383 if (!RConvertImage(rc
, image
, &pixmap
)) {
384 wwarning("could not convert texture:%s",
385 RMessageForError(RErrorCode
));
386 RDestroyImage(image
);
390 if (image
->width
!= scrWidth
|| image
->height
!= scrHeight
) {
391 int x
, y
, sx
, sy
, w
, h
;
393 cpixmap
= XCreatePixmap(dpy
, root
, scrWidth
, scrHeight
,
394 DefaultDepth(dpy
, scr
));
396 XSetForeground(dpy
, DefaultGC(dpy
, scr
), color
.pixel
);
397 XFillRectangle(dpy
, cpixmap
, DefaultGC(dpy
, scr
),
398 0, 0, scrWidth
, scrHeight
);
400 if (image
->height
< scrHeight
) {
402 y
= (scrHeight
- h
)/2;
405 sy
= (image
->height
- scrHeight
)/2;
409 if (image
->width
< scrWidth
) {
411 x
= (scrWidth
- w
)/2;
414 sx
= (image
->width
- scrWidth
)/2;
419 XCopyArea(dpy
, pixmap
, cpixmap
, DefaultGC(dpy
, scr
),
421 XFreePixmap(dpy
, pixmap
);
424 RDestroyImage(image
);
426 texture
->width
= scrWidth
;
427 texture
->height
= scrHeight
;
432 texture
->pixmap
= pixmap
;
433 texture
->color
= color
;
434 } else if (strcasecmp(type
, "thgradient")==0
435 || strcasecmp(type
, "tvgradient")==0
436 || strcasecmp(type
, "tdgradient")==0) {
438 RColor color1
, color2
;
448 GETSTR(val
, file
, 1);
456 if (!XParseColor(dpy
, DefaultColormap(dpy
, scr
), tmp
, &color
)) {
457 wwarning("could not parse color %s in texture %s", tmp
, text
);
461 color1
.red
= color
.red
>> 8;
462 color1
.green
= color
.green
>> 8;
463 color1
.blue
= color
.blue
>> 8;
467 if (!XParseColor(dpy
, DefaultColormap(dpy
, scr
), tmp
, &color
)) {
468 wwarning("could not parse color %s in texture %s", tmp
, text
);
472 color2
.red
= color
.red
>> 8;
473 color2
.green
= color
.green
>> 8;
474 color2
.blue
= color
.blue
>> 8;
476 image
= loadImage(rc
, file
);
478 RDestroyImage(gradient
);
485 gtype
= RHorizontalGradient
;
487 theight
= image
->height
> scrHeight
? scrHeight
: image
->height
;
491 gtype
= RVerticalGradient
;
492 twidth
= image
->width
> scrWidth
? scrWidth
: image
->width
;
496 gtype
= RDiagonalGradient
;
501 gradient
= RRenderGradient(twidth
, theight
, &color1
, &color2
, gtype
);
504 wwarning("could not render texture:%s",
505 RMessageForError(RErrorCode
));
506 RDestroyImage(gradient
);
510 tiled
= RMakeTiledImage(image
, twidth
, theight
);
512 wwarning("could not render texture:%s",
513 RMessageForError(RErrorCode
));
514 RDestroyImage(gradient
);
515 RDestroyImage(image
);
518 RDestroyImage(image
);
520 RCombineImagesWithOpaqueness(tiled
, gradient
, opaq
);
521 RDestroyImage(gradient
);
523 if (!RConvertImage(rc
, tiled
, &pixmap
)) {
524 wwarning("could not convert texture:%s",
525 RMessageForError(RErrorCode
));
526 RDestroyImage(image
);
529 texture
->width
= tiled
->width
;
530 texture
->height
= tiled
->height
;
532 RDestroyImage(tiled
);
534 texture
->pixmap
= pixmap
;
536 wwarning("invalid texture type %s", text
);
540 texture
->spec
= wstrdup(text
);
555 freeTexture(BackgroundTexture
*texture
)
557 if (texture
->solid
) {
560 pixel
[0] = texture
->color
.pixel
;
561 /* dont free black/white pixels */
562 if (pixel
[0]!=BlackPixelOfScreen(DefaultScreenOfDisplay(dpy
))
563 && pixel
[0]!=WhitePixelOfScreen(DefaultScreenOfDisplay(dpy
)))
564 XFreeColors(dpy
, DefaultColormap(dpy
, scr
), pixel
, 1, 0);
572 setupTexture(RContext
*rc
, BackgroundTexture
**textures
, int *maxTextures
,
573 int workspace
, char *texture
)
575 BackgroundTexture
*newTexture
= NULL
;
578 /* unset the texture */
580 if (textures
[workspace
]!=NULL
) {
581 textures
[workspace
]->refcount
--;
583 if (textures
[workspace
]->refcount
== 0)
584 freeTexture(textures
[workspace
]);
586 textures
[workspace
] = NULL
;
590 if (textures
[workspace
]
591 && strcasecmp(textures
[workspace
]->spec
, texture
)==0) {
592 /* texture did not change */
596 /* check if the same texture is already created */
597 for (i
= 0; i
< *maxTextures
; i
++) {
598 if (textures
[i
] && strcasecmp(textures
[i
]->spec
, texture
)==0) {
599 newTexture
= textures
[i
];
605 /* create the texture */
606 newTexture
= parseTexture(rc
, texture
);
611 if (textures
[workspace
]!=NULL
) {
613 textures
[workspace
]->refcount
--;
615 if (textures
[workspace
]->refcount
== 0)
616 freeTexture(textures
[workspace
]);
619 newTexture
->refcount
++;
620 textures
[workspace
] = newTexture
;
622 if (*maxTextures
< workspace
)
623 *maxTextures
= workspace
;
629 duplicatePixmap(Pixmap pixmap
, int width
, int height
)
634 /* must open a new display or the RetainPermanent will
635 * leave stuff allocated in RContext unallocated after exit */
636 tmpDpy
= XOpenDisplay("");
638 wwarning("could not open display to update background image information");
644 copyP
= XCreatePixmap(tmpDpy
, root
, width
, height
,
645 DefaultDepth(tmpDpy
, scr
));
646 XCopyArea(tmpDpy
, pixmap
, copyP
, DefaultGC(tmpDpy
, scr
),
647 0, 0, width
, height
, 0, 0);
648 XSync(tmpDpy
, False
);
650 XSetCloseDownMode(tmpDpy
, RetainPermanent
);
651 XCloseDisplay(tmpDpy
);
659 setPixmapProperty(Pixmap pixmap
)
661 static Atom prop
= 0;
664 unsigned long length
, after
;
669 prop
= XInternAtom(dpy
, "_XROOTPMAP_ID", False
);
674 /* Clear out the old pixmap */
675 XGetWindowProperty(dpy
, root
, prop
, 0L, 1L, False
, AnyPropertyType
,
676 &type
, &format
, &length
, &after
, &data
);
678 if ((type
== XA_PIXMAP
) && (format
== 32) && (length
== 1)) {
679 XKillClient(dpy
, *((Pixmap
*)data
));
680 mode
= PropModeReplace
;
682 mode
= PropModeAppend
;
685 XChangeProperty(dpy
, root
, prop
, XA_PIXMAP
, 32, mode
,
686 (unsigned char *) &pixmap
, 1);
688 XDeleteProperty(dpy
, root
, prop
);
698 changeTexture(BackgroundTexture
*texture
)
703 if (texture
->solid
) {
704 XSetWindowBackground(dpy
, root
, texture
->color
.pixel
);
706 XSetWindowBackgroundPixmap(dpy
, root
, texture
->pixmap
);
708 XClearWindow(dpy
, root
);
715 pixmap
= duplicatePixmap(texture
->pixmap
, texture
->width
,
718 setPixmapProperty(pixmap
);
724 readmsg(int fd
, unsigned char *buffer
, int size
)
730 count
= read(fd
, buffer
, size
);
744 * sizeSntexture_spec - sets the texture for workspace n
745 * sizeCn - change background texture to the one for workspace n
746 * sizePpath - set the pixmap search path
749 * size = 4 bytes for length of the message data
752 helperLoop(RContext
*rc
)
754 BackgroundTexture
*textures
[WORKSPACE_COUNT
];
756 unsigned char buffer
[2048], buf
[8];
760 memset(textures
, 0, WORKSPACE_COUNT
*sizeof(BackgroundTexture
*));
766 /* get length of message */
767 if (readmsg(0, buffer
, 4) < 0) {
768 wsyserror("error reading message from Window Maker");
776 memcpy(buf
, buffer
, 4);
781 if (readmsg(0, buffer
, size
) < 0) {
782 wsyserror("error reading message from Window Maker");
791 printf("RECEIVED %s\n",buffer
);
793 if (buffer
[0]!='P') {
794 memcpy(buf
, &buffer
[1], 4);
796 workspace
= atoi(buf
);
797 if (workspace
< 0 || workspace
>= WORKSPACE_COUNT
) {
798 wwarning("received message with invalid workspace number %i\n",
807 printf("set texture %s\n", &buffer
[5]);
809 setupTexture(rc
, textures
, &maxTextures
, workspace
, &buffer
[5]);
814 printf("change texture %i\n", workspace
);
816 if (!textures
[workspace
])
817 changeTexture(textures
[0]);
819 changeTexture(textures
[workspace
]);
824 printf("change pixmappath %s\n", &buffer
[1]);
828 PixmapPath
= wstrdup(&buffer
[1]);
833 printf("unset workspace %i\n", workspace
);
835 setupTexture(rc
, textures
, &maxTextures
, workspace
, NULL
);
839 wwarning("unknown message received");
847 updateDomain(char *domain
, int workspace
, char *texture
)
849 char *program
= "wdwrite";
851 execlp(program
, program
, domain
, "WorkspaceBack", texture
, NULL
);
852 wwarning("warning could not run \"%s\"", program
);
858 getDomain(char *domain
)
864 path
= wdefaultspathfordomain(domain
);
866 wwarning("could not locate file for domain %s", domain
);
870 prop
= PLGetProplistWithPath(path
);
872 if (!prop
|| !PLIsDictionary(prop
)) {
873 wwarning("invalid domain file %s", path
);
886 getPixmapPath(proplist_t prop
)
893 key
= PLMakeString("PixmapPath");
894 val
= PLGetDictionaryEntry(prop
, key
);
896 if (!val
|| !PLIsArray(val
)) {
901 count
= PLGetNumberOfElements(val
);
903 for (i
=0; i
<count
; i
++) {
904 d
= PLGetArrayElement(val
, i
);
905 if (!d
|| !PLIsString(d
)) {
908 len
+= strlen(PLGetString(d
))+1;
911 ptr
= data
= wmalloc(len
+1);
914 for (i
=0; i
<count
; i
++) {
915 d
= PLGetArrayElement(val
, i
);
916 if (!d
|| !PLIsString(d
)) {
919 strcpy(ptr
, PLGetString(d
));
921 ptr
+= strlen(PLGetString(d
));
942 print_help(char *ProgName
)
944 printf("usage: %s [-options] image\n", ProgName
);
946 puts(" -d dither image");
947 puts(" -m match colors");
948 puts(" -b <color> background color");
949 puts(" -t tile image");
950 puts(" -e center image");
951 puts(" -s scale image (default)");
952 puts(" -u update WindowMaker domain database");
953 puts(" -D <domain> update <domain> database");
954 puts(" -c <cpc> colors per channel to use");
955 puts(" -p <texture> proplist style texture specification");
956 /* puts(" -w <workspace> update the background for the specified workspace");
963 changeTextureForWorkspace(proplist_t dict
, char *texture
, int workspace
)
972 val
= PLGetProplistWithDescription(texture
);
974 wwarning("could not parse texture %s", texture
);
978 key
= PLMakeString("WorkspaceSpecificBack");
979 array
= PLGetDictionaryEntry(dict
, key
);
981 array
= PLMakeArrayFromElements(NULL
, NULL
);
982 PLInsertDictionaryEntry(dict
, key
, array
);
985 j
= PLGetNumberOfElements(array
);
986 if (workspace
>= j
) {
989 empty
= PLMakeArrayFromElements(NULL
, NULL
);
991 while (j
++ < workspace
) {
992 PLAppendArrayElement(array
, empty
);
994 PLAppendArrayElement(array
, val
);
996 PLRemoveArrayElement(array
, workspace
);
997 PLInsertArrayElement(array
, val
, workspace
);
1005 main(int argc
, char **argv
)
1010 RContextAttributes rattr
;
1011 char *style
= "spixmap";
1012 char *back_color
= "gray20";
1013 char *image_name
= NULL
;
1014 char *domain
= "WindowMaker";
1015 int update
=0, cpc
=4, render_mode
=RM_DITHER
, obey_user
=0;
1016 char *texture
= NULL
;
1018 proplist_t domain_prop
;
1022 signal(SIGINT
, SIG_DFL
);
1023 signal(SIGTERM
, SIG_DFL
);
1024 signal(SIGQUIT
, SIG_DFL
);
1025 signal(SIGSEGV
, SIG_DFL
);
1026 signal(SIGBUS
, SIG_DFL
);
1027 signal(SIGFPE
, SIG_DFL
);
1028 signal(SIGABRT
, SIG_DFL
);
1029 signal(SIGHUP
, SIG_DFL
);
1030 signal(SIGPIPE
, SIG_DFL
);
1031 signal(SIGCHLD
, SIG_DFL
);
1033 WMInitializeApplication("wmsetbg", &argc
, argv
);
1035 for (i
=0; i
<argc
; i
++) {
1036 if (strcmp(argv
[i
], "-helper")==0) {
1038 } else if (strcmp(argv
[i
], "-s")==0) {
1040 } else if (strcmp(argv
[i
], "-t")==0) {
1042 } else if (strcmp(argv
[i
], "-e")==0) {
1044 } else if (strcmp(argv
[i
], "-d")==0) {
1045 render_mode
= RM_DITHER
;
1047 } else if (strcmp(argv
[i
], "-m")==0) {
1048 render_mode
= RM_MATCH
;
1050 } else if (strcmp(argv
[i
], "-u")==0) {
1052 } else if (strcmp(argv
[i
], "-D")==0) {
1056 wfatal("too few arguments for %s\n", argv
[i
-1]);
1059 domain
= wstrdup(argv
[i
]);
1060 } else if (strcmp(argv
[i
], "-c")==0) {
1063 wfatal("too few arguments for %s\n", argv
[i
-1]);
1066 if (sscanf(argv
[i
], "%i", &cpc
)!=1) {
1067 wfatal("bad value for colors per channel: \"%s\"\n", argv
[i
]);
1070 } else if (strcmp(argv
[i
], "-b")==0) {
1073 wfatal("too few arguments for %s\n", argv
[i
-1]);
1076 back_color
= argv
[i
];
1077 } else if (strcmp(argv
[i
], "-p")==0) {
1080 wfatal("too few arguments for %s\n", argv
[i
-1]);
1084 } else if (strcmp(argv
[i
], "-w")==0) {
1087 wfatal("too few arguments for %s\n", argv
[i
-1]);
1090 if (sscanf(argv
[i
], "%i", &workspace
)!=1) {
1091 wfatal("bad value for workspace number: \"%s\"",
1095 } else if (argv
[i
][0] != '-') {
1096 image_name
= argv
[i
];
1098 print_help(argv
[0]);
1103 domain_prop
= getDomain(domain
);
1105 PixmapPath
= getPixmapPath(domain_prop
);
1107 dpy
= XOpenDisplay("");
1109 wfatal("could not open display");
1112 XSynchronize(dpy
, 1);
1114 root
= DefaultRootWindow(dpy
);
1116 scr
= DefaultScreen(dpy
);
1118 scrWidth
= WidthOfScreen(DefaultScreenOfDisplay(dpy
));
1119 scrHeight
= HeightOfScreen(DefaultScreenOfDisplay(dpy
));
1121 if (!obey_user
&& DefaultDepth(dpy
, scr
) <= 8)
1122 render_mode
= RM_DITHER
;
1124 rattr
.flags
= RC_RenderMode
| RC_ColorsPerChannel
| RC_DefaultVisual
;
1125 rattr
.render_mode
= render_mode
;
1126 rattr
.colors_per_channel
= cpc
;
1128 rc
= RCreateContext(dpy
, scr
, &rattr
);
1131 /* lower priority, so that it wont use all the CPU */
1134 PLRelease(domain_prop
);
1138 BackgroundTexture
*tex
;
1142 sprintf(buffer
, "(%s, %s, %s)", style
, image_name
, back_color
);
1143 texture
= (char*)buffer
;
1146 if (update
&& workspace
< 0) {
1147 updateDomain(domain
, workspace
, texture
);
1150 tex
= parseTexture(rc
, texture
);
1157 changeTextureForWorkspace(domain_prop
, texture
, workspace
);