
/*
 *	Function	MaxLinesForScreen
 *	Programmer	N.d'Alterio
 *	Date		24/09/95
 *
 *  Synopsis:   This function calculates the number of text lines
 *              that the window can hold given the screen size
 *              as a limit on the maximum window size.
 *
 *  Arguments:  struct Window *win              Pointer to window.
 *
 *  Returns:    max_screen_lines                Maximum number of line
 *                                              that can be put in window.
 *
 *  Variables:  max_text_size                   Maximum area avialable for text.
 *
 *  $Id: MaxLinesForScreen.c 1.3 1995/09/27 20:58:36 daltern Exp $
 *
 */

#include "SpoolWatch.h"

int MaxLinesForScreen( struct Window *win, struct Gadget *gad  )

{

  int max_text_size;
  int max_screen_lines;

  max_text_size = win->WScreen->Height -  
                  gad->Height - 
                  15 - 
                  (win->BorderTop + win->BorderBottom);
 
  max_screen_lines = max_text_size / win->RPort->Font->tf_YSize;
 
  return (max_screen_lines-2);

}   /* end function MaxLinesForScreen */

/*========================================================================*
                        END FUNCTION MaxLinesForScreen
 *========================================================================*/
