]> git.tuebingen.mpg.de Git - paraslash.git/commit
gui: Remove ->cols and ->lines of struct gui_window.
authorAndre Noll <maan@systemlinux.org>
Thu, 9 Jan 2014 23:34:11 +0000 (23:34 +0000)
committerAndre Noll <maan@systemlinux.org>
Sun, 4 May 2014 13:48:54 +0000 (15:48 +0200)
commitbf6e508841396f203b9b47552029a90f8709969e
tree5922a0eec9e50a7bc412939f9cd2833a97546318
parent77a2aba5465a10dbe3d9fdb4bf306d1546a31ffa
gui: Remove ->cols and ->lines of struct gui_window.

The curses library provides the getmaxyx() macro to obtain the window
geometry. It's better to use these instead of storing the number of
lines and columns in the gui_window structure because with getmaxyx()
there is no risk to have stale values gui_window structure.

While the ncurses implementation provides getmaxx() and getmaxy()
to get only the number of lines or columns, respectively, only
getmaxyx() is described in the XSI Curses standard. Hence we provide
our own version of the former two functions. These call getmaxyx()
and return one of the two numbers.

With the ->cols and ->lines fields of struct gui_window gone, all
callers had to be adjusted to use either getmaxyx() or one of the
new functions.
gui.c