XLIB FUNCTIONS XAllocClassHint(3x11)
NAME
XAllocClassHint, XSetClassHint, XGetClassHint, XClassHint -
allocate class hints structure and set or read a window'sWM_CLASS property
SYNTAXcc [ flag... ] file... -lX11 [ library... ]
XClassHint *XAllocClassHint(void);
XSetClassHint(Display *display, Window w, XClassHint
*class_hints);
Status XGetClassHint(Display *display, Window w, XClassHint
*class_hints_return);
ARGUMENTS display Specifies the connection to the X server.class_hints
Specifies the XClassHint structure that is to be
used.class_hints_return
Returns the XClassHint structure.
w Specifies the window.DESCRIPTION
The XAllocClassHint function allocates and returns a pointerto a XClassHint structure. Note that the pointer fields in
the XClassHint structure are initially set to NULL. If
insufficient memory is available, XAllocClassHint returns NULL. To free the memory allocated to this structure, use XFree. The XSetClassHint function sets the class hint for thespecified window. If the strings are not in the Host Port-
able Character Encoding, the result is implementation-
dependent. XSetClassHint can generate BadAlloc and BadWindow errors. The XGetClassHint function returns the class hint of the specified window to the members of the supplied structure. If the data returned by the server is in the Latin Portable Character Encoding, then the returned strings are in the Host Portable Character Encoding. Otherwise, the result isimplementation-dependent. It returns a nonzero status on
success; otherwise, it returns a zero status. To freeres_name and res_class when finished with the strings, use
XFree on each individually. X Version 11 Last change: libX11 1.3.5 1 XLIB FUNCTIONS XAllocClassHint(3x11) XGetClassHint can generate a BadWindow error. PROPERTIESWM_CLASS Set by application programs to allow window and
session managers to obtain the application's resources from the resource database. STRUCTURESThe XClassHint structure contains:
typedef struct {char *res_name;
char *res_class;
} XClassHint;
The res_name member contains the application name, and the
res_class member contains the application class. Note that
the name set in this property may differ from the name setas WM_NAME. That is, WM_NAME specifies what should be
displayed in the title bar and, therefore, can contain tem-
poral information (for example, the name of a file currentlyin an editor's buffer). On the other hand, the name speci-
fied as part of WM_CLASS is the formal name of the applica-
tion that should be used when retrieving the application's resources from the resource database. DIAGNOSTICS BadAlloc The server failed to allocate the requested resource or server memory. BadWindow A value for a Window argument does not name a defined Window.SEE ALSO
XAllocIconSize(3x11), XAllocSizeHints(3x11), XAllocWMHints(3x11), XFree(3x11), XSetCommand(3x11), XSetTransientForHint(3x11), XSetTextProperty(3x11), XSetWMClientMachine(3x11), XSetWMColormapWindows(3x11), XSetWMIconName(3x11), XSetWMName(3x11), XSetWMProperties(3x11), XSetWMProtocols(3x11), XStringListToTextProperty(3x11)Xlib - C Language X Interface
ATTRIBUTES
See attributes(5) for descriptions of the following attri-
butes: X Version 11 Last change: libX11 1.3.5 2 XLIB FUNCTIONS XAllocClassHint(3x11)____________________________________________________________
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
|_____________________________|_____________________________|
| Availability | x11/library/libx11 ||_____________________________|_____________________________|
| Interface Stability | Committed ||_____________________________|_____________________________|
| MT-Level | See XInitThreads(3X11) |
|_____________________________|_____________________________|
X Version 11 Last change: libX11 1.3.5 3