1XAllocClassHint(3)              XLIB FUNCTIONS              XAllocClassHint(3)
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 re‐
44       turned strings are in the Host Portable Character Encoding.  Otherwise,
45       the result is implementation-dependent.  It returns a nonzero status on
46       success; otherwise, it returns a zero status.   To  free  res_name  and
47       res_class  when  finished with the strings, use XFree on each individu‐
48       ally.
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,
66       and the res_class member contains the application class.
67       Note that the name set in this property may differ from the name set as WM_NAME.
68       That is, WM_NAME specifies what should be displayed in the title bar and,
69       therefore, can contain temporal information (for example, the name of
70       a file currently in an editor's buffer).
71       On the other hand,
72       the name specified as part of WM_CLASS is the formal name of the application
73       that should be used when retrieving the application's resources from the
74       resource database.
75

DIAGNOSTICS

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

SEE ALSO

83       XAllocIconSize(3), XAllocSizeHints(3), XAllocWMHints(3), XFree(3),
84       XSetCommand(3), XSetTransientForHint(3), XSetTextProperty(3),
85       XSetWMClientMachine(3), XSetWMColormapWindows(3), XSetWMIconName(3),
86       XSetWMName(3), XSetWMProperties(3), XSetWMProtocols(3),
87       XStringListToTextProperty(3)
88       Xlib - C Language X Interface
89
90
91
92X Version 11                    libX11 1.7.3.1              XAllocClassHint(3)
Impressum