summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNobuhiko Tanibata <nobuhiko_tanibata@xddp.denso.co.jp>2015-12-04 21:30:00 +0900
committerNobuhiko Tanibata <nobuhiko_tanibata@xddp.denso.co.jp>2015-12-05 00:07:38 +0900
commit4cb5903c1bd74ca02a9b7f9985ee7a0aae095dba (patch)
treeed19321c38fbc00f64cf782fcd2a0cf37ea27290
parentd983ae0193d993210c1a6daa8c93dcd0a112fbc3 (diff)
downloadwayland-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>
-rw-r--r--CMakeLists.txt2
-rw-r--r--ivi-input-controller/README4
-rw-r--r--ivi-input-modules/ivi-input-controller/CMakeLists.txt (renamed from ivi-input-controller/CMakeLists.txt)0
-rw-r--r--ivi-input-modules/ivi-input-controller/README2
-rw-r--r--ivi-input-modules/ivi-input-controller/src/ivi-input-controller.c (renamed from ivi-input-controller/src/ivi-input-controller.c)6
-rwxr-xr-xweston-ivi-shell/src/ivi-extension.c42
6 files changed, 48 insertions, 8 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a75390f..378c428 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -39,7 +39,7 @@ add_subdirectory(ivi-layermanagement-examples)
if(WITH_ILM_INPUT)
add_subdirectory(ivi-input-api/ilmInput)
add_subdirectory(ivi-input-api/test)
- add_subdirectory(ivi-input-controller)
+ add_subdirectory(ivi-input-modules/ivi-input-controller)
endif()
diff --git a/ivi-input-controller/README b/ivi-input-controller/README
deleted file mode 100644
index 1fa9042..0000000
--- a/ivi-input-controller/README
+++ /dev/null
@@ -1,4 +0,0 @@
-This directory contains the ivi-input-controller module.
-To use this, add it to the "ivi-module" entry in your weston.ini.
-Multiple modules may be specified in the same entry by separating
-the modules with commas.
diff --git a/ivi-input-controller/CMakeLists.txt b/ivi-input-modules/ivi-input-controller/CMakeLists.txt
index c5a32c2..c5a32c2 100644
--- a/ivi-input-controller/CMakeLists.txt
+++ b/ivi-input-modules/ivi-input-controller/CMakeLists.txt
diff --git a/ivi-input-modules/ivi-input-controller/README b/ivi-input-modules/ivi-input-controller/README
new file mode 100644
index 0000000..8a7c5ad
--- /dev/null
+++ b/ivi-input-modules/ivi-input-controller/README
@@ -0,0 +1,2 @@
+This directory contains the ivi-input-controller module.
+To use this, add it to the "ivi-input-module" entry in your weston.ini.
diff --git a/ivi-input-controller/src/ivi-input-controller.c b/ivi-input-modules/ivi-input-controller/src/ivi-input-controller.c
index 58f57ae..45f15fd 100644
--- a/ivi-input-controller/src/ivi-input-controller.c
+++ b/ivi-input-modules/ivi-input-controller/src/ivi-input-controller.c
@@ -1037,9 +1037,9 @@ create_input_context(struct weston_compositor *ec,
}
WL_EXPORT int
-controller_module_init(struct weston_compositor *ec, int* argc, char *argv[],
- const struct ivi_controller_interface *interface,
- size_t interface_version)
+input_controller_module_init(struct weston_compositor *ec,
+ const struct ivi_controller_interface *interface,
+ size_t interface_version)
{
struct input_context *ctx = create_input_context(ec, interface);
if (ctx == NULL) {
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;
}