


XParseGeometry(3X11)					 XParseGeometry(3X11)
X11R5									X11R5



NAME
  XParseGeometry, XWMGeometry -	parse window geometry

SYNTAX
  int XParseGeometry(_p_a_r_s_e_s_t_r_i_n_g, _x__r_e_t_u_r_n, _y__r_e_t_u_r_n, _w_i_d_t_h__r_e_t_u_r_n,
  _h_e_i_g_h_t__r_e_t_u_r_n)
	char *_p_a_r_s_e_s_t_r_i_n_g;
	int *_x__r_e_t_u_r_n, *_y__r_e_t_u_r_n;
	unsigned int *_w_i_d_t_h__r_e_t_u_r_n, *_h_e_i_g_h_t__r_e_t_u_r_n;

  int XWMGeometry(_d_i_s_p_l_a_y, _s_c_r_e_e_n, _u_s_e_r__g_e_o_m, _d_e_f__g_e_o_m,	_b_w_i_d_t_h,	_h_i_n_t_s,
  _x__r_e_t_u_r_n, _y__r_e_t_u_r_n,
		  _w_i_d_t_h__r_e_t_u_r_n,	_h_e_i_g_h_t__r_e_t_u_r_n, _g_r_a_v_i_t_y__r_e_t_u_r_n)
	Display	*_d_i_s_p_l_a_y;
	int _s_c_r_e_e_n;
	char *_u_s_e_r__g_e_o_m;
	char *_d_e_f__g_e_o_m;
	unsigned int _b_w_i_d_t_h;
	XSizeHints *_h_i_n_t_s;
	int *_x__r_e_t_u_r_n, *_y__r_e_t_u_r_n;
	int *_w_i_d_t_h__r_e_t_u_r_n;
	int *_h_e_i_g_h_t__r_e_t_u_r_n;
	int *_g_r_a_v_i_t_y__r_e_t_u_r_n;

ARGUMENTS

  _p_o_s_i_t_i_o_n
  _d_e_f_a_u_l_t__p_o_s_i_t_i_o_n
	    Specify the	geometry specifications.

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

  _f_h_e_i_g_h_t
  _f_w_i_d_t_h    Specify the	font height and	width in pixels	(increment size).

  _p_a_r_s_e_s_t_r_i_n_g
	    Specifies the string you want to parse.

  _s_c_r_e_e_n    Specifies the screen.

  _w_i_d_t_h__r_e_t_u_r_n
  _h_e_i_g_h_t__r_e_t_u_r_n
	    Return the width and height	determined.

  _x_a_d_d_e_r
  _y_a_d_d_e_r    Specify additional interior	padding	needed in the window.

  _x__r_e_t_u_r_n
  _y__r_e_t_u_r_n  Return the x and y offsets.

  _b_w_i_d_t_h    Specifies the border width.

  _h_i_n_t_s	    Specifies the size hints for the window in its normal state.

  _d_e_f__g_e_o_m  Specifies the application's	default	geometry or NULL.

  _g_r_a_v_i_t_y__r_e_t_u_r_n
	    Returns the	window gravity.

  _u_s_e_r__g_e_o_m Specifies the user-specified geometry or NULL.

DESCRIPTION
  By convention, X applications	use a standard string to indicate window size
  and placement.  _X_P_a_r_s_e_G_e_o_m_e_t_r_y makes it easier to conform to this standard
  because it allows you	to parse the standard window geometry.	Specifically,
  this function	lets you parse strings of the form:

  [=][<_w_i_d_t_h>{xX}<_h_e_i_g_h_t>][{+-}<_x_o_f_f_s_e_t>{+-}<_y_o_f_f_s_e_t>]

  The fields map into the arguments associated with this function.  (Items
  enclosed in <> are integers, items in	[] are optional, and items enclosed
  in {}	indicate ``choose one of.'' Note that the brackets should not appear
  in the actual	string.) If the	string is not in the Host Portable Character
  Encoding the result is implementation	dependent.

  The _X_P_a_r_s_e_G_e_o_m_e_t_r_y function returns a	bitmask	that indicates which of	the
  four values (width, height, xoffset, and yoffset) were actually found	in
  the string and whether the x and y values are	negative. By convention, -0
  is not equal to +0, because the user needs to	be able	to say ``position the
  window relative to the right or bottom edge.'' For each value	found, the
  corresponding	argument is updated.  For each value not found,	the argument
  is left unchanged.  The bits are represented by _X_V_a_l_u_e, _Y_V_a_l_u_e, _W_i_d_t_h_V_a_l_u_e,
  _H_e_i_g_h_t_V_a_l_u_e, _X_N_e_g_a_t_i_v_e, or _Y_N_e_g_a_t_i_v_e and are defined in <_X_1_1/_X_u_t_i_l._h>.
  They will be set whenever one	of the values is defined or one	of the signs
  is set.

  If the function returns either the _X_V_a_l_u_e or _Y_V_a_l_u_e flag, you	should place
  the window at	the requested position.

  The _X_W_M_G_e_o_m_e_t_r_y function combines any	geometry information (given in the
  format used by _X_P_a_r_s_e_G_e_o_m_e_t_r_y) specified by the user and by the calling
  program with size hints (usually the ones to be stored in WM_NORMAL_HINTS)
  and returns the position, size, and gravity (_N_o_r_t_h_W_e_s_t_G_r_a_v_i_t_y, _N_o_r_t_h_E_a_s_t_-
  _G_r_a_v_i_t_y, _S_o_u_t_h_E_a_s_t_G_r_a_v_i_t_y, or	_S_o_u_t_h_W_e_s_t_G_r_a_v_i_t_y) that describe	the window.
  If the base size is not set in the _X_S_i_z_e_H_i_n_t_s	structure, the minimum size
  is used if set.  Otherwise, a	base size of zero is assumed.  If no minimum
  size is set in the hints structure, the base size is used.  A	mask (in the
  form returned	by _X_P_a_r_s_e_G_e_o_m_e_t_r_y) that	describes which	values came from the
  user specification and whether or not	the position coordinates are relative
  to the right and bottom edges	is returned.  Note that	these coordinates
  will have already been accounted for in the x_return and y_return values.

  Note that invalid geometry specifications can	cause a	width or height	of
  zero to be returned.	The caller may pass the	address	of the hints
  win_gravity field as gravity_return to update	the hints directly.

SEE ALSO
  XSetWMProperties(3X11)
  _X_l_i_b - _C _L_a_n_g_u_a_g_e _X _I_n_t_e_r_f_a_c_e















