diff options
author | Nobuhiko Tanibata <nobuhiko_tanibata@xddp.denso.co.jp> | 2015-12-04 21:30:00 +0900 |
---|---|---|
committer | Nobuhiko Tanibata <nobuhiko_tanibata@xddp.denso.co.jp> | 2015-12-05 00:07:38 +0900 |
commit | 4cb5903c1bd74ca02a9b7f9985ee7a0aae095dba (patch) | |
tree | ed19321c38fbc00f64cf782fcd2a0cf37ea27290 /weston-ivi-shell | |
parent | d983ae0193d993210c1a6daa8c93dcd0a112fbc3 (diff) | |
download | wayland-ivi-extension-4cb5903c1bd74ca02a9b7f9985ee7a0aae095dba.tar.gz |
ivi-input-controller: restructure directory to build and a way to specify the shared library.
ivi-input-controller shall work with ivi-controller.so not solely.
So the patch proposes a way to specify it as a ivi-input-module in
weston.ini. The shared library, ivi-input-controller.so, is loaded by
ivi-controller.so.
Signed-off-by: Nobuhiko Tanibata <ntanibata@jp.adit-jv.com>
Diffstat (limited to 'weston-ivi-shell')
-rwxr-xr-x | weston-ivi-shell/src/ivi-extension.c | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/weston-ivi-shell/src/ivi-extension.c b/weston-ivi-shell/src/ivi-extension.c index bb3b23d..d437c87 100755 --- a/weston-ivi-shell/src/ivi-extension.c +++ b/weston-ivi-shell/src/ivi-extension.c @@ -702,6 +702,43 @@ ivi_extension_layer_set_fade_info(struct ivishell *shell, start_alpha, end_alpha); } +static int +load_input_module(struct weston_compositor *ec, + const struct ivi_controller_interface *interface, + size_t interface_version) +{ + struct weston_config *config = ec->config; + struct weston_config_section *section; + char *input_module = NULL; + + int (*input_module_init)(struct weston_compositor *ec, + const struct ivi_controller_interface *interface, + size_t interface_version); + + section = weston_config_get_section(config, "ivi-shell", NULL, NULL); + + if (weston_config_section_get_string(section, "ivi-input-module", + &input_module, NULL) < 0) { + /* input events are handled by weston's default grabs */ + weston_log("ivi-controller: No ivi-input-module set\n"); + return 0; + } + + input_module_init = weston_load_module(input_module, "input_controller_module_init"); + if (!input_module_init) + return -1; + + if (input_module_init(ec, interface, + sizeof(struct ivi_controller_interface)) != 0) { + weston_log("ivi-controller: Initialization of input module failes"); + return -1; + } + + free(input_module); + + return 0; +} + WL_EXPORT int controller_module_init(struct weston_compositor *compositor, int *argc, char *argv[], @@ -727,5 +764,10 @@ controller_module_init(struct weston_compositor *compositor, return -1; } + if (load_input_module(compositor, interface, interface_version) < 0) { + free(controller_shell); + return -1; + } + return 0; } |