1XAllocClassHint(3) XLIB FUNCTIONS XAllocClassHint(3)
2
3
4
6 XAllocClassHint, XSetClassHint, XGetClassHint, XClassHint - allocate
7 class hints structure and set or read a window's WM_CLASS property
8
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
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
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
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
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
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
81 XAllocIconSize(3), XAllocSizeHints(3), XAllocWMHints(3), XFree(3),
82 XSetCommand(3), XSetTransientForHint(3), XSetTextProperty(3), XSetWM‐
83 ClientMachine(3), XSetWMColormapWindows(3), XSetWMIconName(3), XSetWM‐
84 Name(3), XSetWMProperties(3), XSetWMProtocols(3), XStringListTo‐
85 TextProperty(3)
86 Xlib - C Language X Interface
87
88
89
90X Version 11 libX11 1.3.4 XAllocClassHint(3)