(svn r17997) -Codechange: Introduce functions for querying top and bottom of the main view.

This commit is contained in:
alberth
2009-11-07 17:24:04 +00:00
parent 0fa6870eca
commit c7ca4691c4
4 changed files with 31 additions and 17 deletions

View File

@@ -1602,6 +1602,26 @@ void ResizeWindow(Window *w, int delta_x, int delta_y)
w->SetDirty();
}
/** Return the top of the main view available for general use.
* @return Uppermost vertical coordinate available.
* @note Above the upper y coordinate is often the main toolbar.
*/
int GetMainViewTop()
{
Window *w = FindWindowById(WC_MAIN_TOOLBAR, 0);
return (w == NULL) ? 0 : w->top + w->height;
}
/** Return the bottom of the main view available for general use.
* @return The vertical coordinate of the first unusable row, so 'top + height <= bottom' gives the correct result.
* @note At and below the bottom y coordinate is often the status bar.
*/
int GetMainViewBottom()
{
Window *w = FindWindowById(WC_STATUS_BAR, 0);
return (w == NULL) ? _screen.height : w->top;
}
/** The minimum number of pixels of the title bar must be visible in both the X or Y direction */
static const int MIN_VISIBLE_TITLE_BAR = 13;