2 * Window Maker window manager
4 * Copyright (c) 1997-2002 Alfredo K. Kojima
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
24 #include <X11/Xutil.h>
25 #include <X11/Xatom.h>
36 #include <WINGs/WUtil.h>
40 #include "WindowMaker.h"
50 #include "xmodifier.h"
53 /**** global variables *****/
55 extern char *DisplayName
;
57 extern WPreferences wPreferences
;
59 extern Time LastTimestamp
;
62 extern Atom _XA_DND_SELECTION
;
68 putdef(char *line
, char *name
, char *value
)
71 wwarning(_("could not define value for %s for cpp"), name
);
81 putidef(char *line
, char *name
, int value
)
84 snprintf(tmp
, sizeof(tmp
), "%i", value
);
99 user
= getpwuid(getuid());
101 wsyserror(_("could not get password entry for UID %i"), getuid());
104 if (!user
->pw_name
) {
107 return user
->pw_name
;
114 MakeCPPArgs(char *path
)
117 char buffer
[MAXLINE
], *buf
, *line
;
121 line
= wmalloc(MAXLINE
);
124 if ((buf
=getenv("HOSTNAME"))!=NULL
) {
126 wwarning(_("your machine is misconfigured. HOSTNAME is set to %s"),
129 putdef(line
, " -DHOST=", buf
);
130 } else if ((buf
=getenv("HOST"))!=NULL
) {
132 wwarning(_("your machine is misconfigured. HOST is set to %s"),
135 putdef(line
, " -DHOST=", buf
);
139 putdef(line
, " -DUSER=", buf
);
140 putidef(line
, " -DUID=", getuid());
141 buf
= XDisplayName(DisplayString(dpy
));
142 putdef(line
, " -DDISPLAY=", buf
);
143 putdef(line
, " -DWM_VERSION=", VERSION
);
145 visual
= DefaultVisual(dpy
, DefaultScreen(dpy
));
146 putidef(line
, " -DVISUAL=", visual
->class);
148 putidef(line
, " -DDEPTH=", DefaultDepth(dpy
, DefaultScreen(dpy
)));
150 putidef(line
, " -DSCR_WIDTH=", WidthOfScreen(DefaultScreenOfDisplay(dpy
)));
151 putidef(line
, " -DSCR_HEIGHT=",
152 HeightOfScreen(DefaultScreenOfDisplay(dpy
)));
154 /* put the dir where the menu is being read from to the
158 buf
= strchr(tmp
+1, ' ');
162 buf
= strrchr(tmp
, '/');
164 *buf
= 0; /* trunc filename */
165 putdef(line
, " -I", tmp
);
171 /* this should be done just once, but it works this way */
172 strcpy(buffer
, DEF_CONFIG_PATHS
);
173 buf
= strtok(buffer
, ":");
176 char fullpath
[MAXLINE
];
179 strcpy(fullpath
, buf
);
181 char * wgethomedir();
182 /* home is statically allocated. Don't free it! */
183 char *home
= wgethomedir();
185 strcpy(fullpath
, home
);
186 strcat(fullpath
, &(buf
[1]));
189 putdef(line
, " -I", fullpath
);
191 } while ((buf
= strtok(NULL
, ":"))!=NULL
);
207 * Is win2 below win1?
210 isBelow(WWindow
*win1
, WWindow
*win2
)
215 tmp
= win1
->frame
->core
->stacking
->under
;
217 if (tmp
== win2
->frame
->core
)
219 tmp
= tmp
->stacking
->under
;
222 for (i
=win1
->frame
->core
->stacking
->window_level
-1; i
>=0; i
--) {
223 tmp
= win1
->screen_ptr
->stacking_list
[i
];
225 if (tmp
== win2
->frame
->core
)
227 tmp
= tmp
->stacking
->under
;
241 wFetchName(dpy
, win
, winname
)
246 XTextProperty text_prop
;
250 if (XGetWMName(dpy
, win
, &text_prop
)) {
251 if (text_prop
.value
&& text_prop
.nitems
> 0) {
252 if (text_prop
.encoding
== XA_STRING
) {
253 *winname
= wstrdup((char *)text_prop
.value
);
254 XFree(text_prop
.value
);
256 text_prop
.nitems
= strlen((char *)text_prop
.value
);
257 if (XmbTextPropertyToTextList(dpy
, &text_prop
, &list
, &num
) >=
258 Success
&& num
> 0 && *list
) {
259 XFree(text_prop
.value
);
260 *winname
= wstrdup(*list
);
261 XFreeStringList(list
);
263 *winname
= wstrdup((char *)text_prop
.value
);
264 XFree(text_prop
.value
);
268 /* the title is set, but it was set to none */
269 *winname
= wstrdup("");
273 /* the hint is probably not set */
281 * XGetIconName Wrapper
286 wGetIconName(dpy
, win
, iconname
)
291 XTextProperty text_prop
;
295 if (XGetWMIconName(dpy
, win
, &text_prop
) != 0 && text_prop
.value
296 && text_prop
.nitems
> 0) {
297 if (text_prop
.encoding
== XA_STRING
)
298 *iconname
= (char *)text_prop
.value
;
300 text_prop
.nitems
= strlen((char *)text_prop
.value
);
301 if (XmbTextPropertyToTextList(dpy
, &text_prop
, &list
, &num
) >=
302 Success
&& num
> 0 && *list
) {
303 XFree(text_prop
.value
);
304 *iconname
= wstrdup(*list
);
305 XFreeStringList(list
);
307 *iconname
= (char *)text_prop
.value
;
321 /* compress all expose events into a single one */
323 if (XCheckMaskEvent(dpy
, ExposureMask
, &event
)) {
324 /* ignore other exposure events for this window */
325 while (XCheckWindowEvent(dpy
, event
.xexpose
.window
, ExposureMask
,
327 /* eat exposes for other windows */
330 event
.xexpose
.count
= 0;
331 XPutBackEvent(dpy
, &event
);
337 SlideWindow(Window win
, int from_x
, int from_y
, int to_x
, int to_y
)
339 time_t time0
= time(NULL
);
340 float dx
, dy
, x
=from_x
, y
=from_y
, sx
, sy
, px
, py
;
343 /* animation parameters */
349 {ICON_SLIDE_DELAY_UF
, ICON_SLIDE_STEPS_UF
, ICON_SLIDE_SLOWDOWN_UF
},
350 {ICON_SLIDE_DELAY_F
, ICON_SLIDE_STEPS_F
, ICON_SLIDE_SLOWDOWN_F
},
351 {ICON_SLIDE_DELAY_M
, ICON_SLIDE_STEPS_M
, ICON_SLIDE_SLOWDOWN_M
},
352 {ICON_SLIDE_DELAY_S
, ICON_SLIDE_STEPS_S
, ICON_SLIDE_SLOWDOWN_S
},
353 {ICON_SLIDE_DELAY_US
, ICON_SLIDE_STEPS_US
, ICON_SLIDE_SLOWDOWN_US
}};
357 dx
= (float)(to_x
-from_x
);
358 dy
= (float)(to_y
-from_y
);
359 sx
= (dx
== 0 ? 0 : fabs(dx
)/dx
);
360 sy
= (dy
== 0 ? 0 : fabs(dy
)/dy
);
362 if (fabs(dx
) > fabs(dy
)) {
367 px
= dx
/ apars
[(int)wPreferences
.icon_slide_speed
].slowdown
;
368 if (px
< apars
[(int)wPreferences
.icon_slide_speed
].steps
&& px
> 0)
369 px
= apars
[(int)wPreferences
.icon_slide_speed
].steps
;
370 else if (px
> -apars
[(int)wPreferences
.icon_slide_speed
].steps
&& px
< 0)
371 px
= -apars
[(int)wPreferences
.icon_slide_speed
].steps
;
372 py
= (sx
== 0 ? 0 : px
*dy
/dx
);
374 py
= dy
/ apars
[(int)wPreferences
.icon_slide_speed
].slowdown
;
375 if (py
< apars
[(int)wPreferences
.icon_slide_speed
].steps
&& py
> 0)
376 py
= apars
[(int)wPreferences
.icon_slide_speed
].steps
;
377 else if (py
> -apars
[(int)wPreferences
.icon_slide_speed
].steps
&& py
< 0)
378 py
= -apars
[(int)wPreferences
.icon_slide_speed
].steps
;
379 px
= (sy
== 0 ? 0 : py
*dx
/dy
);
382 while (x
!= to_x
|| y
!= to_y
) {
385 if ((px
<0 && (int)x
< to_x
) || (px
>0 && (int)x
> to_x
))
387 if ((py
<0 && (int)y
< to_y
) || (py
>0 && (int)y
> to_y
))
391 px
= px
* (1.0 - 1/(float)apars
[(int)wPreferences
.icon_slide_speed
].slowdown
);
392 if (px
< apars
[(int)wPreferences
.icon_slide_speed
].steps
&& px
> 0)
393 px
= apars
[(int)wPreferences
.icon_slide_speed
].steps
;
394 else if (px
> -apars
[(int)wPreferences
.icon_slide_speed
].steps
&& px
< 0)
395 px
= -apars
[(int)wPreferences
.icon_slide_speed
].steps
;
396 py
= (sx
== 0 ? 0 : px
*dy
/dx
);
398 py
= py
* (1.0 - 1/(float)apars
[(int)wPreferences
.icon_slide_speed
].slowdown
);
399 if (py
< apars
[(int)wPreferences
.icon_slide_speed
].steps
&& py
> 0)
400 py
= apars
[(int)wPreferences
.icon_slide_speed
].steps
;
401 else if (py
> -apars
[(int)wPreferences
.icon_slide_speed
].steps
&& py
< 0)
402 py
= -apars
[(int)wPreferences
.icon_slide_speed
].steps
;
403 px
= (sy
== 0 ? 0 : py
*dx
/dy
);
406 XMoveWindow(dpy
, win
, (int)x
, (int)y
);
408 if (apars
[(int)wPreferences
.icon_slide_speed
].delay
> 0) {
409 wusleep(apars
[(int)wPreferences
.icon_slide_speed
].delay
*1000L);
413 if (time(NULL
) - time0
> MAX_ANIMATION_TIME
)
416 XMoveWindow(dpy
, win
, to_x
, to_y
);
419 /* compress expose events */
425 ShrinkString(WMFont
*font
, char *string
, int width
)
433 if (wPreferences
.multi_byte_text
)
434 return wstrdup(string
);
437 w
= WMWidthOfString(font
, string
, p
);
438 text
= wmalloc(strlen(string
)+8);
439 strcpy(text
, string
);
443 pos
= strchr(text
, ' ');
445 pos
= strchr(text
, ':');
450 w1
= WMWidthOfString(font
, text
, p
);
467 width
-= WMWidthOfString(font
, "...", 3);
472 while (p2
>p1
&& p1
!=t
) {
473 w
= WMWidthOfString(font
, &string
[p
-t
], t
);
477 } else if (w
<width
) {
483 strcat(text
, &string
[p
-p1
]);
490 FindImage(char *paths
, char *file
)
494 tmp
= strrchr(file
, ':');
497 path
= wfindfile(paths
, file
);
501 path
= wfindfile(paths
, file
);
509 timeoutHandler(void *data
)
516 getTextSelection(WScreen
*screen
, Atom selection
)
550 data
= XFetchBuffer(dpy
, &size
, buffer
);
557 unsigned long len
, bytes
;
561 static Atom clipboard
= 0;
564 clipboard
= XInternAtom(dpy
, "CLIPBOARD", False
);
566 XDeleteProperty(dpy
, screen
->info_window
, clipboard
);
568 XConvertSelection(dpy
, selection
, XA_STRING
,
569 clipboard
, screen
->info_window
,
572 timer
= WMAddTimerHandler(1000, timeoutHandler
, &timeout
);
574 while (!XCheckTypedWindowEvent(dpy
, screen
->info_window
,
575 SelectionNotify
, &ev
) && !timeout
);
578 WMDeleteTimerHandler(timer
);
580 wwarning("selection retrieval timed out");
584 /* nobody owns the selection or the current owner has
585 * nothing to do with what we need */
586 if (ev
.xselection
.property
== None
) {
590 if (XGetWindowProperty(dpy
, screen
->info_window
,
592 False
, XA_STRING
, &rtype
, &bits
, &len
,
593 &bytes
, (unsigned char**)&data
)!=Success
) {
596 if (rtype
!=XA_STRING
|| bits
!=8) {
597 wwarning("invalid data in text selection");
607 getselection(WScreen
*scr
)
611 tmp
= getTextSelection(scr
, XA_PRIMARY
);
613 tmp
= getTextSelection(scr
, XA_CUT_BUFFER0
);
619 getuserinput(WScreen
*scr
, char *line
, int *ptr
)
627 char tbuffer
[BUFSIZE
], pbuffer
[BUFSIZE
];
630 title
= _("Program Arguments");
631 prompt
= _("Enter command arguments:");
641 for (; line
[*ptr
]!=0 && state
!=_DONE
; (*ptr
)++) {
644 if (line
[*ptr
]=='(') {
653 if (j
<= 0 && line
[*ptr
]==',') {
657 strncpy(tbuffer
, &line
[begin
], WMIN(*ptr
-begin
, BUFSIZE
));
658 tbuffer
[WMIN(*ptr
-begin
, BUFSIZE
)] = 0;
659 title
= (char*)tbuffer
;
664 } else if (j
<= 0 && line
[*ptr
]==')') {
667 strncpy(tbuffer
, &line
[begin
], WMIN(*ptr
-begin
, BUFSIZE
));
668 tbuffer
[WMIN(*ptr
-begin
, BUFSIZE
)] = 0;
669 title
= (char*)tbuffer
;
673 } else if (line
[*ptr
]=='(') {
675 } else if (line
[*ptr
]==')') {
682 if (line
[*ptr
]==')' && j
==0) {
684 if (*ptr
-begin
> 1) {
685 strncpy(pbuffer
, &line
[begin
], WMIN(*ptr
-begin
, BUFSIZE
));
686 pbuffer
[WMIN(*ptr
-begin
, BUFSIZE
)] = 0;
687 prompt
= (char*)pbuffer
;
690 } else if (line
[*ptr
]=='(')
692 else if (line
[*ptr
]==')')
703 if (!wInputDialog(scr
, title
, prompt
, &ret
))
712 get_dnd_selection(WScreen
*scr
)
714 XTextProperty text_ret
;
720 result
=XGetTextProperty(dpy
, scr
->root_win
, &text_ret
, _XA_DND_SELECTION
);
722 if (result
==0 || text_ret
.value
==NULL
|| text_ret
.encoding
==None
723 || text_ret
.format
==0 || text_ret
.nitems
== 0) {
724 wwarning(_("unable to get dropped data from DND drop"));
728 XTextPropertyToStringList(&text_ret
, &list
, &count
);
730 if (!list
|| count
<1) {
731 XFree(text_ret
.value
);
732 wwarning(_("error getting dropped data from DND drop"));
736 flat_string
= wtokenjoin(list
, count
);
738 wwarning(_("out of memory while getting data from DND drop"));
741 XFreeStringList(list
);
742 XFree(text_ret
.value
);
745 #endif /* OFFIX_DND */
753 * state input new-state output
754 * NORMAL % OPTION <nil>
755 * NORMAL \ ESCAPE <nil>
756 * NORMAL etc. NORMAL <input>
757 * ESCAPE any NORMAL <input>
758 * OPTION s NORMAL <selection buffer>
759 * OPTION w NORMAL <selected window id>
760 * OPTION a NORMAL <input text>
761 * OPTION d NORMAL <OffiX DND selection object>
762 * OPTION W NORMAL <current workspace>
763 * OPTION etc. NORMAL %<input>
765 #define TMPBUFSIZE 64
767 ExpandOptions(WScreen
*scr
, char *cmdline
)
769 int ptr
, optr
, state
, len
, olen
;
771 char *selection
=NULL
;
772 char *user_input
=NULL
;
773 #if defined(OFFIX_DND) || defined(XDND)
774 char *dropped_thing
=NULL
;
776 char tmpbuf
[TMPBUFSIZE
];
779 len
= strlen(cmdline
);
783 wwarning(_("out of memory during expansion of \"%s\""));
787 ptr
= 0; /* input line pointer */
788 optr
= 0; /* output line pointer */
793 switch (cmdline
[ptr
]) {
802 out
[optr
++]=cmdline
[ptr
];
807 switch (cmdline
[ptr
]) {
821 out
[optr
++]=cmdline
[ptr
];
827 switch (cmdline
[ptr
]) {
829 if (scr
->focused_window
830 && scr
->focused_window
->flags
.focused
) {
831 snprintf(tmpbuf
, sizeof(tmpbuf
), "0x%x",
832 (unsigned int)scr
->focused_window
->client_win
);
833 slen
= strlen(tmpbuf
);
835 nout
= realloc(out
,olen
);
837 wwarning(_("out of memory during expansion of \"%w\""));
849 snprintf(tmpbuf
, sizeof(tmpbuf
), "0x%x",
850 (unsigned int)scr
->current_workspace
+ 1);
851 slen
= strlen(tmpbuf
);
853 nout
= realloc(out
,olen
);
855 wwarning(_("out of memory during expansion of \"%W\""));
865 user_input
= getuserinput(scr
, cmdline
, &ptr
);
867 slen
= strlen(user_input
);
869 nout
= realloc(out
,olen
);
871 wwarning(_("out of memory during expansion of \"%a\""));
875 strcat(out
,user_input
);
878 /* Not an error, but user has Canceled the dialog box.
879 * This will make the command to not be performed. */
884 #if defined(OFFIX_DND) || defined(XDND)
888 dropped_thing
= wstrdup(scr
->xdestring
);
891 if (!dropped_thing
) {
892 dropped_thing
= get_dnd_selection(scr
);
894 if (!dropped_thing
) {
895 scr
->flags
.dnd_data_convertion_status
= 1;
898 slen
= strlen(dropped_thing
);
900 nout
= realloc(out
,olen
);
902 wwarning(_("out of memory during expansion of \"%d\""));
906 strcat(out
,dropped_thing
);
909 #endif /* OFFIX_DND */
913 selection
= getselection(scr
);
916 wwarning(_("selection not available"));
919 slen
= strlen(selection
);
921 nout
= realloc(out
,olen
);
923 wwarning(_("out of memory during expansion of \"%s\""));
927 strcat(out
,selection
);
933 out
[optr
++]=cmdline
[ptr
];
952 /* feof doesn't seem to work on pipes */
956 static struct stat stinfo
;
958 fstat(fileno(stream
), &stinfo
);
959 return ((S_ISFIFO(stinfo
.st_dev
) && stinfo
.st_size
== 0) ||
965 ParseWindowName(WMPropList
*value
, char **winstance
, char **wclass
, char *where
)
969 *winstance
= *wclass
= NULL
;
971 if (!WMIsPLString(value
)) {
972 wwarning(_("bad window name value in %s state info"), where
);
976 name
= WMGetFromPLString(value
);
977 if (!name
|| strlen(name
)==0) {
978 wwarning(_("bad window name value in %s state info"), where
);
982 UnescapeWM_CLASS(name
, winstance
, wclass
);
988 keysymToString(KeySym keysym
, unsigned int state
)
991 char *buf
= wmalloc(20);
996 kev
.send_event
= False
;
997 kev
.window
= DefaultRootWindow(dpy
);
998 kev
.root
= DefaultRootWindow(dpy
);
999 kev
.same_screen
= True
;
1000 kev
.subwindow
= kev
.root
;
1001 kev
.serial
= 0x12344321;
1002 kev
.time
= CurrentTime
;
1004 kev
.keycode
= XKeysymToKeycode(dpy
, keysym
);
1005 count
= XLookupString(&kev
, buf
, 19, NULL
, NULL
);
1014 GetShortcutString(char *text
)
1016 char *buffer
= NULL
;
1023 tmp
= text
= wstrdup(text
);
1026 while ((k
= strchr(text
, '+'))!=NULL
) {
1030 mod
= wXModifierFromKey(text
);
1032 return wstrdup("bug");
1037 if (strcasecmp(text
, "Meta")==0) {
1038 buffer
= wstrappend(buffer
, "M+");
1039 } else if (strcasecmp(text
, "Alt")==0) {
1040 buffer
= wstrappend(buffer
, "A+");
1041 } else if (strcasecmp(text
, "Shift")==0) {
1042 buffer
= wstrappend(buffer
, "Sh+");
1043 } else if (strcasecmp(text
, "Mod1")==0) {
1044 buffer
= wstrappend(buffer
, "M1+");
1045 } else if (strcasecmp(text
, "Mod2")==0) {
1046 buffer
= wstrappend(buffer
, "M2+");
1047 } else if (strcasecmp(text
, "Mod3")==0) {
1048 buffer
= wstrappend(buffer
, "M3+");
1049 } else if (strcasecmp(text
, "Mod4")==0) {
1050 buffer
= wstrappend(buffer
, "M4+");
1051 } else if (strcasecmp(text
, "Mod5")==0) {
1052 buffer
= wstrappend(buffer
, "M5+");
1053 } else if (strcasecmp(text
, "Control")==0) {
1056 buffer
= wstrappend(buffer
, text
);
1062 buffer
= wstrappend(buffer
, "^");
1064 buffer
= wstrappend(buffer
, text
);
1067 /* ksym = XStringToKeysym(text);
1068 tmp = keysymToString(ksym, modmask);
1070 buffer = wstrappend(buffer, tmp);
1079 EscapeWM_CLASS(char *name
, char *class)
1082 char *ename
= NULL
, *eclass
= NULL
;
1085 if (!name
&& !class)
1090 ename
= wmalloc(l
*2+1);
1092 for (i
=0; i
<l
; i
++) {
1093 if (name
[i
]=='\\') {
1095 } else if (name
[i
]=='.') {
1098 ename
[j
++] = name
[i
];
1104 eclass
= wmalloc(l
*2+1);
1106 for (i
=0; i
<l
; i
++) {
1107 if (class[i
]=='\\') {
1109 } else if (class[i
]=='.') {
1112 eclass
[j
++] = class[i
];
1117 if (ename
&& eclass
) {
1118 int len
= strlen(ename
)+strlen(eclass
)+4;
1120 snprintf(ret
, len
, "%s.%s", ename
, eclass
);
1124 ret
= wstrdup(ename
);
1127 ret
= wstrdup(eclass
);
1136 UnescapeWM_CLASS(char *str
, char **name
, char **class)
1144 *class = wmalloc(j
);
1147 /* separate string in 2 parts */
1150 for (i
= 0; i
< j
; i
++) {
1154 } else if (str
[i
]=='.') {
1163 /* unescape strings */
1166 for (i
= 0; i
< dot
; i
++) {
1171 (*name
)[k
++] = str
[i
];
1174 (*name
)[k
++] = str
[i
];
1182 for (i
= dot
+1; i
<j
; i
++) {
1187 (*class)[k
++] = str
[i
];
1208 SendHelperMessage(WScreen
*scr
, char type
, int workspace
, char *msg
)
1210 unsigned char *buffer
;
1215 if (!scr
->flags
.backimage_helper_launched
) {
1219 len
= (msg
? strlen(msg
) : 0) + (workspace
>=0 ? 4 : 0) + 1 ;
1220 buffer
= wmalloc(len
+5);
1221 snprintf(buf
, len
, "%4i", len
);
1222 memcpy(buffer
, buf
, 4);
1225 if (workspace
>= 0) {
1226 snprintf(buf
, sizeof(buf
), "%4i", workspace
);
1227 memcpy(&buffer
[i
], buf
, 4);
1232 strcpy(&buffer
[i
], msg
);
1234 if (write(scr
->helper_fd
, buffer
, len
+4) < 0) {
1235 wsyserror(_("could not send message to background image helper"));
1242 UpdateDomainFile(WDDomain
*domain
)
1245 char path
[PATH_MAX
];
1246 WMPropList
*shared_dict
, *dict
;
1247 Bool result
, freeDict
= False
;
1249 dict
= domain
->dictionary
;
1250 if (WMIsPLDictionary(domain
->dictionary
)) {
1251 /* retrieve global system dictionary */
1252 snprintf(path
, sizeof(path
), "%s/WindowMaker/%s",
1253 SYSCONFDIR
, domain
->domain_name
);
1254 if (stat(path
, &stbuf
) >= 0) {
1255 shared_dict
= WMReadPropListFromFile(path
);
1257 if (WMIsPLDictionary(shared_dict
)) {
1259 dict
= WMDeepCopyPropList(domain
->dictionary
);
1260 WMSubtractPLDictionaries(dict
, shared_dict
, True
);
1262 WMReleasePropList(shared_dict
);
1267 result
= WMWritePropListToFile(dict
, domain
->path
, True
);
1270 WMReleasePropList(dict
);
1279 StrConcatDot(char *a
, char *b
)
1289 len
= strlen(a
)+strlen(b
)+4;
1292 snprintf(str
, len
, "%s.%s", a
, b
);