


XAllocClassHint(3X11)					XAllocClassHint(3X11)
X11R5									X11R5



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

SYNTAX
  XClassHint *XAllocClassHint()

  XSetClassHint(_d_i_s_p_l_a_y, _w, _c_l_a_s_s__h_i_n_t_s)
	Display	*_d_i_s_p_l_a_y;
	Window _w;
	XClassHint *_c_l_a_s_s__h_i_n_t_s;

  Status XGetClassHint(_d_i_s_p_l_a_y,	_w, _c_l_a_s_s__h_i_n_t_s__r_e_t_u_r_n)
	Display	*_d_i_s_p_l_a_y;
	Window _w;
	XClassHint *_c_l_a_s_s__h_i_n_t_s__r_e_t_u_r_n;

ARGUMENTS

  _d_i_s_p_l_a_y   Specifies the connection to	the X server.

  _c_l_a_s_s__h_i_n_t_s
	    Specifies the _X_C_l_a_s_s_H_i_n_t structure that is to be used.

  _c_l_a_s_s__h_i_n_t_s__r_e_t_u_r_n
	    Returns the	_X_C_l_a_s_s_H_i_n_t structure.

  _w	    Specifies the window.

DESCRIPTION
  The _X_A_l_l_o_c_C_l_a_s_s_H_i_n_t function allocates and returns a pointer to a
  _X_C_l_a_s_s_H_i_n_t structure.	 Note that the pointer fields in the _X_C_l_a_s_s_H_i_n_t
  structure are	initially set to NULL.	If insufficient	memory is available,
  _X_A_l_l_o_c_C_l_a_s_s_H_i_n_t returns NULL.	 To free the memory allocated to this struc-
  ture,	use _X_F_r_e_e.

  The _X_S_e_t_C_l_a_s_s_H_i_n_t function sets the class hint for the specified window.
  If the strings are not in the	Host Portable Character	Encoding the result
  is implementation dependent.

  _X_S_e_t_C_l_a_s_s_H_i_n_t	can generate _B_a_d_A_l_l_o_c and _B_a_d_W_i_n_d_o_w errors.

  The _X_G_e_t_C_l_a_s_s_H_i_n_t 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
  is implementation dependent.	It returns nonzero status on success; other-
  wise it returns a zero status.  To free res_name and res_class when fin-
  ished	with the strings, use _X_F_r_e_e on each individually.

  _X_G_e_t_C_l_a_s_s_H_i_n_t	can generate a _B_a_d_W_i_n_d_o_w error.

PROPERTIES

  WM_CLASS  Set	by application programs	to allow window	and session managers
	    to obtain the application's	resources from the resource database.


STRUCTURES
  The _X_C_l_a_s_s_H_i_n_t 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 set as WM_NAME.	That is, WM_NAME specifies what
  should be displayed in the title bar and, therefore, can contain temporal
  information (for example, the	name of	a file currently in an editor's
  buffer).  On the other hand, the name	specified as part of WM_CLASS is the
  formal name of the application that should be	used when retrieving the
  application's	resources from the resource database.

DIAGNOSTICS

  _B_a_d_A_l_l_o_c  The	server failed to allocate the requested	resource or server
	    memory.

  _B_a_d_W_i_n_d_o_w 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)
  _X_l_i_b - _C _L_a_n_g_u_a_g_e _X _I_n_t_e_r_f_a_c_e	delim off


































