11ab64890Smrg/* 21ab64890Smrg 31ab64890SmrgCopyright 1991, 1998 The Open Group 41ab64890Smrg 51ab64890SmrgPermission to use, copy, modify, distribute, and sell this software and its 61ab64890Smrgdocumentation for any purpose is hereby granted without fee, provided that 71ab64890Smrgthe above copyright notice appear in all copies and that both that 81ab64890Smrgcopyright notice and this permission notice appear in supporting 91ab64890Smrgdocumentation. 101ab64890Smrg 111ab64890SmrgThe above copyright notice and this permission notice shall be included 121ab64890Smrgin all copies or substantial portions of the Software. 131ab64890Smrg 141ab64890SmrgTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 151ab64890SmrgOR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 161ab64890SmrgMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 171ab64890SmrgIN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR 181ab64890SmrgOTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 191ab64890SmrgARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 201ab64890SmrgOTHER DEALINGS IN THE SOFTWARE. 211ab64890Smrg 221ab64890SmrgExcept as contained in this notice, the name of The Open Group shall 231ab64890Smrgnot be used in advertising or otherwise to promote the sale, use or 241ab64890Smrgother dealings in this Software without prior written authorization 251ab64890Smrgfrom The Open Group. 261ab64890Smrg 271ab64890Smrg*/ 281ab64890Smrg 291ab64890Smrg#ifdef HAVE_CONFIG_H 301ab64890Smrg#include <config.h> 311ab64890Smrg#endif 321ab64890Smrg#include <X11/Xlibint.h> 331ab64890Smrg#include <X11/Xutil.h> 341ab64890Smrg#include <X11/Xatom.h> 351ab64890Smrg#include <X11/Xlocale.h> 361ab64890Smrg 371ab64890Smrgvoid 381ab64890SmrgXmbSetWMProperties ( 391ab64890Smrg Display *dpy, 401ab64890Smrg Window w, 411ab64890Smrg _Xconst char *windowName, 421ab64890Smrg _Xconst char *iconName, 431ab64890Smrg char **argv, 441ab64890Smrg int argc, 451ab64890Smrg XSizeHints *sizeHints, 461ab64890Smrg XWMHints *wmHints, 471ab64890Smrg XClassHint *classHints) 481ab64890Smrg{ 491ab64890Smrg XTextProperty wname, iname; 501ab64890Smrg XTextProperty *wprop = NULL; 511ab64890Smrg XTextProperty *iprop = NULL; 521ab64890Smrg 531ab64890Smrg if (windowName && 541ab64890Smrg XmbTextListToTextProperty(dpy, (char**)&windowName, 1, 551ab64890Smrg XStdICCTextStyle, &wname) >= Success) 561ab64890Smrg wprop = &wname; 571ab64890Smrg if (iconName && 581ab64890Smrg XmbTextListToTextProperty(dpy, (char**)&iconName, 1, 591ab64890Smrg XStdICCTextStyle, &iname) >= Success) 601ab64890Smrg iprop = &iname; 611ab64890Smrg XSetWMProperties(dpy, w, wprop, iprop, argv, argc, 621ab64890Smrg sizeHints, wmHints, classHints); 631ab64890Smrg if (wprop) 64818534a1Smrg Xfree(wname.value); 651ab64890Smrg if (iprop) 66818534a1Smrg Xfree(iname.value); 671ab64890Smrg 681ab64890Smrg /* Note: The WM_LOCALE_NAME property is set by XSetWMProperties. */ 691ab64890Smrg} 70