| 1 |
/* |
| 2 |
|
| 3 |
Copyright 1991, 1998 The Open Group |
| 4 |
|
| 5 |
Permission to use, copy, modify, distribute, and sell this software and its |
| 6 |
documentation for any purpose is hereby granted without fee, provided that |
| 7 |
the above copyright notice appear in all copies and that both that |
| 8 |
copyright notice and this permission notice appear in supporting |
| 9 |
documentation. |
| 10 |
|
| 11 |
The above copyright notice and this permission notice shall be included |
| 12 |
in all copies or substantial portions of the Software. |
| 13 |
|
| 14 |
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS |
| 15 |
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
| 16 |
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. |
| 17 |
IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR |
| 18 |
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, |
| 19 |
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR |
| 20 |
OTHER DEALINGS IN THE SOFTWARE. |
| 21 |
|
| 22 |
Except as contained in this notice, the name of The Open Group shall |
| 23 |
not be used in advertising or otherwise to promote the sale, use or |
| 24 |
other dealings in this Software without prior written authorization |
| 25 |
from The Open Group. |
| 26 |
|
| 27 |
*/ |
| 28 |
|
| 29 |
#ifdef HAVE_CONFIG_H |
| 30 |
#include <config.h> |
| 31 |
#endif |
| 32 |
#include <nx-X11/Xlibint.h> |
| 33 |
#include <nx-X11/Xutil.h> |
| 34 |
#include <nx-X11/Xatom.h> |
| 35 |
#include <nx-X11/Xlocale.h> |
| 36 |
|
| 37 |
void |
| 38 |
XmbSetWMProperties ( |
| 39 |
Display *dpy, |
| 40 |
Window w, |
| 41 |
_Xconst char *windowName, |
| 42 |
_Xconst char *iconName, |
| 43 |
char **argv, |
| 44 |
int argc, |
| 45 |
XSizeHints *sizeHints, |
| 46 |
XWMHints *wmHints, |
| 47 |
XClassHint *classHints) |
| 48 |
{ |
| 49 |
XTextProperty wname, iname; |
| 50 |
XTextProperty *wprop = NULL; |
| 51 |
XTextProperty *iprop = NULL; |
| 52 |
|
| 53 |
if (windowName && |
| 54 |
XmbTextListToTextProperty(dpy, (char**)&windowName, 1, |
| 55 |
XStdICCTextStyle, &wname) >= Success) |
| 56 |
wprop = &wname; |
| 57 |
if (iconName && |
| 58 |
XmbTextListToTextProperty(dpy, (char**)&iconName, 1, |
| 59 |
XStdICCTextStyle, &iname) >= Success) |
| 60 |
iprop = &iname; |
| 61 |
XSetWMProperties(dpy, w, wprop, iprop, argv, argc, |
| 62 |
sizeHints, wmHints, classHints); |
| 63 |
if (wprop) |
| 64 |
Xfree(wname.value); |
| 65 |
if (iprop) |
| 66 |
Xfree(iname.value); |
| 67 |
|
| 68 |
/* Note: The WM_LOCALE_NAME property is set by XSetWMProperties. */ |
| 69 |
} |