perf ui browser: Add ->rows to disambiguate from ->height
commit62c95ae33f64ecf398f490886f026a6132fb1520
authorArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 1 Jul 2014 14:07:54 +0000 (1 11:07 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 7 Jul 2014 15:36:54 +0000 (7 12:36 -0300)
tree701435d99b2a87faf900325902dbaa38ee03f0c6
parent8b5b584daf3b92fc5cdc83919e64231817d2f5a7
perf ui browser: Add ->rows to disambiguate from ->height

The ui_browser->height is about the whole browser "window", including
any header, status lines or any other space needed for some "Yes", "No",
etc buttons a descendent browser, like hist_browser, may have.

Since the navigation is done mostly on the ui_browser methods, it needs
to know how many rows are on the screen, while details about what other
components are, say, if a header (that may be composed of multiple
lines, etc) is present.

Besides this we'll need to add a ui_browser->refresh_dimensions() hook
so that browsers like hist_browser can update ->rows in response to
screen resizes, this will come in a follow up patch.

This patch just adds ->rows and updates it when updating ->height, keeps
using ->height for the only other widget that can come with ui_browser,
the scrollbar, that goes on using all the height on the rightmost column
in the screen, using ->rows for the keyboard navigation needs.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Don Zickus <dzickus@redhat.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/n/tip-xexmwg1mv7u03j5imn66jdak@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/ui/browser.c
tools/perf/ui/browser.h
tools/perf/ui/browsers/hists.c