compositor: Propagate errors from module_init

load_modules currently ignores errors signalled by both
weston_load_module and module_init, and instead always returns 0. Its
return value appears to be checked in callers, so we most likely want to
propagate any errors.

Signed-off-by: Ondřej Majerech <majerech.o@gmail.com>
Reviewed-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
ivi-shell: Say something when configuration is missing

When ivi-module is not set in weston.conf, we probably want to tell the
user about their error instead of just dying.

Signed-off-by: Ondřej Majerech <majerech.o@gmail.com>
[Pekka: include Tanibata's suggestion, fix file name, fix surrounding
coding style]
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
ivi-shell: clean-up transition animation code.

ivi_layout_transition_layer_render_order is not necesary called. Remove
the method and methods called by it.

Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
ivi-shell: clean up unnecesary header

Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
ivi-shell: reordering method in ivi_layout.c

In the future, re-alignmenet of WL_EXPORT per method should be done.
For that work, re-ordering is required to be used by another method.

Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Acked-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
ivi-shell: several ivi-layout interfaces moved accross source.

Interfaces for properties setting shall be implemented in ivi-layout.

Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Acked-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
ivi-shell: make ivi-layout.c as a part of ivi-shell.so

ivi-layout.so is separately built and loaded by using dlopen with
RTLD_GLOBAL. This was because these apis defined in ivi-layout.so shall
be used by ivi-modules; e.g. hmi-controller. This shall be improved that
a struct ivi_layout_api contains the whole exported API as function
pointers to be exposed as module_init.

This patch alone builds, but loading controller modules at runtime
failes. This failure will be fixed by following patches.

Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
ivi-shell: rewrite controller API

This fixes the breakage caused by "ivi-shell: make ivi-layout.c as a
part of ivi-shell.so"

hmi-controller.c:
A reference implementation of controller module does not use the layout
functions directly. This get function pointers at controller_module_init
which called by ivi-shell.

ivi-layout-export.h:
Definition of interfaces in a struction: ivi_controller_interface.
function pointers are set at ivi-layout.c.

ivi-layout-private.h:
Definition of some interfaces are remove bucause it is implemented in
ivi-layout.c and set it as function pointer. Several interfaces are kept
here because they are implemented in ivi-layout.c/transition.c but used
in other files.

ivi-layout-transition.c:
remove WL_EXPORT because export is not needed anymore.
remove unnesesary unsed method.

ivi-shell.c:
call controller_module_init of hmi-controller to init it and set
function pointers. If the interface_version is equal or
greater than what hmi_controller was built with, things are pass.
If the interface_version is smaller than what the controller expects,
it has to fail because it cannot work. This is followed the manner,

- never remove a function pointer
- never modify an existing function signature
- additions are allowed at the end of struct ivi_controller_interface
- all function pointers must always be populated and working in
  ivi-shell.so (ivi-layout.c etc.)

Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA@xddp.denso.co.jp>
Acked-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>
text: Fix some typos

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
text: Fix coding style

Put the return type on a separate line in function declarations.

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
text: Remove unused linked list from input_method_context

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
text: Use bool for input_panel_visible

Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
input: swallow the key press event when running a compositor key binding

Reviewed-by: Daniel Stone <daniel.stone@collabora.com>
compositor: introduce struct weston_backend

This is a preliminary change for libweston, with no functional modifications.
Separate the backends and the core weston_compositor struct, by creating
the weston_compositor in the main(), and having the various backends extend
the weston_backend struct, an instance of which is returned by the backend
entry point.
don't use weston_config in the backends code

This is to make them usable by future libweston users, since they will
not use weston_config.
weston_config is still used in the backends entry points, which will
later on live in their own files.
compositor: remove the weston_config field from weston_compositor

Instead of the central weston_config pointer we now store it in some
module-specific pointers. This way we can remove them one by one.
compositor: add API to manage compositor instances
compositor: move the main() to a new weston.c file
build a libweston.so used by the weston binary
libweston: allow compositors to define the logging behavior