1XAllocClassHint(3X11)           XLIB FUNCTIONS           XAllocClassHint(3X11)
2
3
4

NAME

6       XAllocClassHint, XSetClassHint, XGetClassHint, XClassHint - allocate
7       class hints structure and set or read a window's WM_CLASS property
8

SYNTAX

10       XClassHint *XAllocClassHint(void);
11
12       XSetClassHint(Display *display, Window w, XClassHint *class_hints);
13
14       Status XGetClassHint(Display *display, Window w, XClassHint
15              *class_hints_return);
16

ARGUMENTS

18       display   Specifies the connection to the X server.
19
20       class_hints
21                 Specifies the XClassHint structure that is to be used.
22
23       class_hints_return
24                 Returns the XClassHint structure.
25
26       w         Specifies the window.
27

DESCRIPTION

29       The XAllocClassHint function allocates and returns a pointer to a
30       XClassHint structure.  Note that the pointer fields in the XClassHint
31       structure are initially set to NULL.  If insufficient memory is avail‐
32       able, XAllocClassHint returns NULL.  To free the memory allocated to
33       this structure, use XFree.
34
35       The XSetClassHint function sets the class hint for the specified win‐
36       dow.  If the strings are not in the Host Portable Character Encoding,
37       the result is implementation-dependent.
38
39       XSetClassHint can generate BadAlloc and BadWindow errors.
40
41       The XGetClassHint function returns the class hint of the specified win‐
42       dow to the members of the supplied structure.  If the data returned by
43       the server is in the Latin Portable Character Encoding, then the
44       returned strings are in the Host Portable Character Encoding.  Other‐
45       wise, the result is implementation-dependent.  It returns a nonzero
46       status on success; otherwise, it returns a zero status.  To free
47       res_name and res_class when finished with the strings, use XFree on
48       each individually.
49
50       XGetClassHint can generate a BadWindow error.
51

PROPERTIES

53       WM_CLASS  Set by application programs to allow window and session man‐
54                 agers to obtain the application's resources from the resource
55                 database.
56

STRUCTURES

58       The XClassHint structure contains:
59
60       typedef struct {
61            char *res_name;
62            char *res_class;
63       } XClassHint;
64
65       The res_name member contains the application name, and the res_class
66       member contains the application class.  Note that the name set in this
67       property may differ from the name set as WM_NAME.  That is, WM_NAME
68       specifies what should be displayed in the title bar and, therefore, can
69       contain temporal information (for example, the name of a file currently
70       in an editor's buffer).  On the other hand, the name specified as part
71       of WM_CLASS is the formal name of the application that should be used
72       when retrieving the application's resources from the resource database.
73

DIAGNOSTICS

75       BadAlloc  The server failed to allocate the requested resource or
76                 server memory.
77
78       BadWindow A value for a Window argument does not name a defined Window.
79

SEE ALSO

81       XAllocIconSize(3X11), XAllocSizeHints(3X11), XAllocWMHints(3X11),
82       XFree(3X11), XSetCommand(3X11), XSetTransientForHint(3X11), XSet‐
83       TextProperty(3X11), XSetWMClientMachine(3X11), XSetWMColormapWin‐
84       dows(3X11), XSetWMIconName(3X11), XSetWMName(3X11), XSetWMProper‐
85       ties(3X11), XSetWMProtocols(3X11), XStringListToTextProperty(3X11)
86       Xlib - C Language X Interface
87
88
89
90X Version 11                     libX11 1.0.3            XAllocClassHint(3X11)
Impressum