ivi-shell: introduce get_weston_view
authorUcan, Emre (ADITG/SW1) <eucan@de.adit-jv.com>
Fri, 28 Aug 2015 12:59:06 +0000 (12:59 +0000)
committerPekka Paalanen <pekka.paalanen@collabora.co.uk>
Thu, 1 Oct 2015 09:56:32 +0000 (12:56 +0300)
commit64635ee69988b0da28bd8beed282c432eecdc4bc
treec30a511a72a4567423323fab5b91a7763b4f78ef
parent4a18364595bb511f20c5476324af9e5f4b4f3abd
ivi-shell: introduce get_weston_view

The internal API "get_weston_view" is introduced, which returns the
weston_view of the given ivi_layout_surface. The API returns a NULL
pointer, if the ivi_layout_surface does not have any weston_view.

The weston_view is required in many places of ivi-shell implementation.
Therefore, this API will reduce lines of code. Furthermore, it will
increase the maintainability of the ivi-shell implementation.

Old way of getting the weston_view was flawed, because the views list of
the weston_surface is read without controlling the existence of the
weston_surface.  New implementation explicitly throws an error if the
weston_surface does not exist.

Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
Tested-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
[Pekka: Line-wrapped the commit message.]
ivi-shell/ivi-layout.c