Esempio n. 1
0
/*************************************<->*************************************
 *
 *  unsigned int BaseWindowHeight (pcd)
 *
 *
 *  Description:
 *  -----------
 *  Returns the height of the base window
 *
 *  Inputs:
 *  ------
 *  pcd			- pointer to client data record
 *
 *  Outputs:
 *  -------
 *  BaseWindowHeight
 *
 *  Comments:
 *  --------
 *  o Based on code taken out of FrameHeight to make it a little
 *    more efficient.
 *
 *************************************<->***********************************/
unsigned int BaseWindowHeight (ClientData *pcd)
{
    unsigned int rval;

    if (pcd->decor & (MWM_DECOR_RESIZEH | MWM_DECOR_BORDER))
    {

        /*
         *  rval = FrameHeight(pcd) - LowerBorderWidth(pcd) -
         *             UpperBorderWidth(pcd) - TitleBarHeight(pcd);
         */

        rval = ((pcd->maxConfig) ? pcd->maxHeight : pcd->clientHeight) +
               2*pcd->matteWidth;
    }
    else
    {
        /*
         *  rval = FrameHeight(pcd) - TitleBarHeight(pcd);
         */

        rval = ((pcd->maxConfig) ? pcd->maxHeight : pcd->clientHeight) +
               2*pcd->matteWidth + 2*LowerBorderWidth (pcd);
    }

    return (rval);
}
Esempio n. 2
0
/*************************************<->*************************************
 *
 *  int FrameX (pcd)
 *
 *
 *  Description:
 *  -----------
 *  Returns the X-coordinate of the frame for the window
 *
 *  Inputs:
 *  ------
 *  pcd			- pointer to client data record
 * 
 *  Outputs:
 *  -------
 *  FrameX		- X position of frame
 *
 *  Comments:
 *  --------
 * 
 *************************************<->***********************************/
int FrameX (ClientData *pcd)
{
    int frameX;

    frameX = ((pcd->maxConfig) ? pcd->maxX : pcd->clientX)
	     - LowerBorderWidth (pcd)  - pcd->matteWidth;

    return (frameX);
}
Esempio n. 3
0
/*************************************<->*************************************
 *
 *  unsigned int FrameWidth (pcd)
 *
 *
 *  Description:
 *  -----------
 *  Returns the width of the frame
 *
 *  Inputs:
 *  ------
 *  pcd			- pointer to client data record
 * 
 *  Outputs:
 *  -------
 *  FrameWidth	- width of frame
 *
 *  Comments:
 *  --------
 * 
 *************************************<->***********************************/
unsigned int FrameWidth (ClientData *pcd)
{
    unsigned int frameWidth;

    frameWidth = ((pcd->maxConfig) ? pcd->maxWidth : pcd->clientWidth) +
		  2*pcd->matteWidth + 2*LowerBorderWidth (pcd);

    return (frameWidth);
}
Esempio n. 4
0
/*************************************<->*************************************
 *
 *  int BaseWindowX (pcd)
 *
 *
 *  Description:
 *  -----------
 *  Returns the X coord of the base window in the frame
 *
 *  Inputs:
 *  ------
 *  pcd			- pointer to client data record
 * 
 *  Outputs:
 *  -------
 *  BaseWindowX
 *
 *  Comments:
 *  --------
 * 
 *************************************<->***********************************/
int BaseWindowX (ClientData *pcd)
{
    int rval;

    if (pcd->decor & (MWM_DECOR_RESIZEH | MWM_DECOR_BORDER))
	rval = LowerBorderWidth(pcd);
    else
	rval = 0;
    
    return (rval);
}
Esempio n. 5
0
/*************************************<->*************************************
 *
 *  unsigned int FrameHeight (pcd)
 *
 *
 *  Description:
 *  -----------
 *  Returns the height of the frame
 *
 *  Inputs:
 *  ------
 *  pcd			- pointer to client data record
 * 
 *  Outputs:
 *  -------
 *  FrameHeight	-  position of frame
 *
 *  Comments:
 *  --------
 * 
 *************************************<->***********************************/
unsigned int FrameHeight (ClientData *pcd)
{
    unsigned int frameHeight;

    if (pcd->decor & (MWM_DECOR_RESIZEH | MWM_DECOR_BORDER))
    {
	frameHeight = ((pcd->maxConfig) ? 
			  pcd->maxHeight : pcd->clientHeight) +
		      2*pcd->matteWidth + LowerBorderWidth (pcd) + 
		      UpperBorderWidth (pcd) + TitleBarHeight(pcd);
    }
    else 
    {
	frameHeight = ((pcd->maxConfig) ? 
			  pcd->maxHeight : pcd->clientHeight) +
		      2*pcd->matteWidth + 2*LowerBorderWidth (pcd) + 
		      TitleBarHeight(pcd);
    }

    return (frameHeight);
}
Esempio n. 6
0
/*************************************<->*************************************
 *
 *  SetFrameInfo (pcd)
 *
 *
 *  Description:
 *  -----------
 *  Sets frame information into client data structure for easy access.
 *
 *
 *  Inputs:
 *  ------
 *  pcd		- pointer to client data
 * 
 *  Outputs:
 *  -------
 *
 *  Comments:
 *  --------
 *  o Sets values into the FrameInfo component of the client data structure
 * 
 *************************************<->***********************************/
void SetFrameInfo (ClientData *pcd)
{

    /*
     * The title bar height value stored in pcd->frameInfo is used by the
     * macro TitleBarHeight(pcd).
     */

    pcd->frameInfo.titleBarHeight = InitTitleBarHeight (pcd);

    pcd->frameInfo.x = FrameX (pcd);
    pcd->frameInfo.y = FrameY (pcd);
    pcd->frameInfo.width = FrameWidth (pcd);
    pcd->frameInfo.height = FrameHeight (pcd);
    pcd->frameInfo.upperBorderWidth = UpperBorderWidth (pcd);
    pcd->frameInfo.lowerBorderWidth = LowerBorderWidth (pcd);
    pcd->frameInfo.cornerWidth = CornerWidth (pcd);
    pcd->frameInfo.cornerHeight = CornerHeight (pcd);

    /* set client offset */
     
    if ( (pcd->decor & (MWM_DECOR_RESIZEH | MWM_DECOR_BORDER)) ||
         (pcd->matteWidth > 0) )
    {
	/*
	 *  The window has a window manager border.
	 */
	pcd->clientOffset.x = pcd->frameInfo.lowerBorderWidth + 
			          pcd->matteWidth;
	pcd->clientOffset.y = pcd->frameInfo.upperBorderWidth + 
				  pcd->frameInfo.titleBarHeight + 
			          pcd->matteWidth;
    }
    else 
    {
	/*
	 * No window manager border, the original X border is showing
	 * through.
	 */
	pcd->clientOffset.x =  pcd->xBorderWidth + pcd->matteWidth;
	pcd->clientOffset.y =  pcd->xBorderWidth + 
				   pcd->frameInfo.titleBarHeight + 
				   pcd->matteWidth;
    }

}
Esempio n. 7
0
/*************************************<->*************************************
 *
 *  unsigned int BaseWindowWidth (pcd)
 *
 *
 *  Description:
 *  -----------
 *  Returns the width of the base window 
 *
 *  Inputs:
 *  ------
 *  pcd			- pointer to client data record
 * 
 *  Outputs:
 *  -------
 *  BaseWindowWidth
 *
 *  Comments:
 *  --------
 *  o Based on code taken out of FrameWidth to make it a little 
 *    more efficient.
 * 
 *************************************<->***********************************/
unsigned int BaseWindowWidth (ClientData *pcd)
{
    unsigned int rval;

    if (pcd->decor & (MWM_DECOR_RESIZEH | MWM_DECOR_BORDER))
    {
	/*
	 *  rval = FrameWidth(pcd) - 2*LowerBorderWidth(pcd);
	 */

	rval = ((pcd->maxConfig) ? pcd->maxWidth : pcd->clientWidth) +
		  2*pcd->matteWidth;
    }
    else
    {
	/*
	 *  rval = FrameWidth(pcd);
	 */
	rval = ((pcd->maxConfig) ? pcd->maxWidth : pcd->clientWidth) +
		  2*pcd->matteWidth + 2*LowerBorderWidth (pcd);
    }
    
    return (rval);
}