aboutsummaryrefslogtreecommitdiffstats
path: root/meta-agl-profile-graphical/recipes-graphics/wayland
diff options
context:
space:
mode:
Diffstat (limited to 'meta-agl-profile-graphical/recipes-graphics/wayland')
-rw-r--r--meta-agl-profile-graphical/recipes-graphics/wayland/wayland-ivi-extension/0001-Added-ivi-id-agent-to-CMake.patch35
-rw-r--r--meta-agl-profile-graphical/recipes-graphics/wayland/wayland-ivi-extension/0001-Resolve-weston-crush-when-repeat-touching-very-quick.patch31
-rw-r--r--meta-agl-profile-graphical/recipes-graphics/wayland/wayland-ivi-extension/0001-simple-id-agent-for-2.0.2.patch294
-rw-r--r--meta-agl-profile-graphical/recipes-graphics/wayland/wayland-ivi-extension/0001-simple-id-agent-initial-commit.patch264
-rw-r--r--meta-agl-profile-graphical/recipes-graphics/wayland/wayland-ivi-extension/0002-ivi-controller-load-id-agent-module.patch69
-rw-r--r--meta-agl-profile-graphical/recipes-graphics/wayland/wayland-ivi-extension/0002-ivi-id-agent-added-ivi-id-agent.patch538
-rw-r--r--meta-agl-profile-graphical/recipes-graphics/wayland/wayland-ivi-extension/0003-ivi-controller-add-resize-setting-suit-to-surface-si.patch62
-rw-r--r--meta-agl-profile-graphical/recipes-graphics/wayland/wayland-ivi-extension/0003-ivi-controller-load-id-agent-module.patch70
-rw-r--r--meta-agl-profile-graphical/recipes-graphics/wayland/wayland-ivi-extension/cmake-find-gtest.patch22
-rw-r--r--meta-agl-profile-graphical/recipes-graphics/wayland/wayland-ivi-extension/disable-sanitizer-tests.patch13
-rw-r--r--meta-agl-profile-graphical/recipes-graphics/wayland/wayland-ivi-extension/test-path.patch55
-rw-r--r--meta-agl-profile-graphical/recipes-graphics/wayland/wayland-ivi-extension_1.1%.bbappend27
-rw-r--r--meta-agl-profile-graphical/recipes-graphics/wayland/wayland-ivi-extension_1.13.0.bb33
-rw-r--r--meta-agl-profile-graphical/recipes-graphics/wayland/wayland-ivi-extension_2.0.2.bb4
14 files changed, 646 insertions, 871 deletions
diff --git a/meta-agl-profile-graphical/recipes-graphics/wayland/wayland-ivi-extension/0001-Added-ivi-id-agent-to-CMake.patch b/meta-agl-profile-graphical/recipes-graphics/wayland/wayland-ivi-extension/0001-Added-ivi-id-agent-to-CMake.patch
new file mode 100644
index 000000000..feeef0e22
--- /dev/null
+++ b/meta-agl-profile-graphical/recipes-graphics/wayland/wayland-ivi-extension/0001-Added-ivi-id-agent-to-CMake.patch
@@ -0,0 +1,35 @@
+From 48977cb77410247df547063d9d7bcd381fb13cde Mon Sep 17 00:00:00 2001
+From: Michael Teyfel <mteyfel@de.adit-jv.com>
+Date: Fri, 12 Oct 2018 17:12:24 +0200
+Subject: [PATCH 1/3] Added ivi-id-agent to CMake
+
+Signed-off-by: Michael Teyfel <mteyfel@de.adit-jv.com>
+---
+ CMakeLists.txt | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index c82136e..33662b9 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -23,6 +23,9 @@ SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules)
+
+ project(wayland-ivi-extension)
+
++find_package(PkgConfig REQUIRED)
++pkg_check_modules(WESTON weston>=2.0.0 REQUIRED)
++
+ SET(IVI_EXTENSION_VERSION 2.0.2)
+ SET(ILM_API_VERSION 2.0.2)
+
+@@ -35,6 +38,7 @@ add_subdirectory(ivi-layermanagement-api/ilmClient)
+ add_subdirectory(ivi-layermanagement-api/ilmControl)
+ add_subdirectory(ivi-layermanagement-api/test)
+ add_subdirectory(ivi-layermanagement-examples)
++add_subdirectory(ivi-id-agent-modules/ivi-id-agent)
+
+ if(WITH_ILM_INPUT)
+ add_subdirectory(ivi-input-api/ilmInput)
+--
+2.7.4
+
diff --git a/meta-agl-profile-graphical/recipes-graphics/wayland/wayland-ivi-extension/0001-Resolve-weston-crush-when-repeat-touching-very-quick.patch b/meta-agl-profile-graphical/recipes-graphics/wayland/wayland-ivi-extension/0001-Resolve-weston-crush-when-repeat-touching-very-quick.patch
deleted file mode 100644
index 636ecf1b9..000000000
--- a/meta-agl-profile-graphical/recipes-graphics/wayland/wayland-ivi-extension/0001-Resolve-weston-crush-when-repeat-touching-very-quick.patch
+++ /dev/null
@@ -1,31 +0,0 @@
-From 97af4843a4705cd7d5b6b69abb9002fd974a5b94 Mon Sep 17 00:00:00 2001
-From: Tadao Tanikawa <tanikawa.tadao@jp.panasonic.com>
-Date: Fri, 12 Jan 2018 01:53:01 +0900
-Subject: [PATCH] Resolve weston cursh when repeat touching very quickly
-
-Weston sometimes crush while the user repeat touching very
-quickly icons/shortcuts on HomeScreen.
-
-Signed-off-by: Tadao Tanikawa <tanikawa.tadao@jp.panasonic.com>
----
- ivi-input-modules/ivi-input-controller/src/ivi-input-controller.c | 4 ++++
- 1 file changed, 4 insertions(+)
-
-diff --git a/ivi-input-modules/ivi-input-controller/src/ivi-input-controller.c b/ivi-input-modules/ivi-input-controller/src/ivi-input-controller.c
-index b0fe37d..f1a31d0 100644
---- a/ivi-input-modules/ivi-input-controller/src/ivi-input-controller.c
-+++ b/ivi-input-modules/ivi-input-controller/src/ivi-input-controller.c
-@@ -557,6 +557,10 @@ touch_grab_up(struct weston_touch_grab *grab, uint32_t time, int touch_id)
- const struct ivi_layout_interface *interface =
- seat->input_ctx->ivi_layout_interface;
-
-+ /* if touch device has no focused view, there is nothing to do*/
-+ if (grab->touch->focus == NULL)
-+ return;
-+
- /* For each surface_ctx, check for focus and send */
- wl_list_for_each(surf_ctx, &seat->input_ctx->surface_list, link) {
- struct weston_surface *surf, *send_surf;
---
-2.7.4
-
diff --git a/meta-agl-profile-graphical/recipes-graphics/wayland/wayland-ivi-extension/0001-simple-id-agent-for-2.0.2.patch b/meta-agl-profile-graphical/recipes-graphics/wayland/wayland-ivi-extension/0001-simple-id-agent-for-2.0.2.patch
deleted file mode 100644
index 24bf8394f..000000000
--- a/meta-agl-profile-graphical/recipes-graphics/wayland/wayland-ivi-extension/0001-simple-id-agent-for-2.0.2.patch
+++ /dev/null
@@ -1,294 +0,0 @@
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index c82136e..eeed7a6 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -35,6 +35,7 @@ add_subdirectory(ivi-layermanagement-api/ilmClient)
- add_subdirectory(ivi-layermanagement-api/ilmControl)
- add_subdirectory(ivi-layermanagement-api/test)
- add_subdirectory(ivi-layermanagement-examples)
-+add_subdirectory(id-agent-modules/simple-id-agent)
-
- if(WITH_ILM_INPUT)
- add_subdirectory(ivi-input-api/ilmInput)
-diff --git a/id-agent-modules/simple-id-agent/CMakeLists.txt b/id-agent-modules/simple-id-agent/CMakeLists.txt
-new file mode 100644
-index 0000000..8290722
---- /dev/null
-+++ b/id-agent-modules/simple-id-agent/CMakeLists.txt
-@@ -0,0 +1,72 @@
-+############################################################################
-+#
-+# Copyright (C) 2013 DENSO CORPORATION
-+# Copyright 2014 BMW Car IT GmbH
-+#
-+#
-+# Licensed under the Apache License, Version 2.0 (the "License");
-+# you may not use this file except in compliance with the License.
-+# You may obtain a copy of the License at
-+#
-+# http://www.apache.org/licenses/LICENSE-2.0
-+#
-+# Unless required by applicable law or agreed to in writing, software
-+# distributed under the License is distributed on an "AS IS" BASIS,
-+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-+# See the License for the specific language governing permissions and
-+# limitations under the License.
-+#
-+############################################################################
-+
-+cmake_minimum_required (VERSION 2.6)
-+
-+project(simple-id-agent)
-+
-+find_package(PkgConfig REQUIRED)
-+pkg_check_modules(WAYLAND_SERVER wayland-server>=1.13.0 REQUIRED)
-+pkg_check_modules(WESTON weston>=2.0.0 REQUIRED)
-+pkg_check_modules(PIXMAN pixman-1 REQUIRED)
-+
-+find_package(Threads REQUIRED)
-+
-+GET_TARGET_PROPERTY(IVI_EXTENSION_INCLUDE_DIRS ivi-extension-protocol INCLUDE_DIRECTORIES)
-+
-+include_directories(
-+ src
-+ ${IVI_EXTENSION_INCLUDE_DIRS}
-+ ${WAYLAND_SERVER_INCLUDE_DIRS}
-+ ${WESTON_INCLUDE_DIRS}
-+ ${PIXMAN_INCLUDE_DIRS}
-+)
-+
-+link_directories(
-+ ${WAYLAND_SERVER_LIBRARY_DIRS}
-+ ${PIXMAN_LIBRARY_DIRS}
-+)
-+
-+add_library(${PROJECT_NAME} MODULE
-+ src/simple-id-agent.c
-+)
-+
-+set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "")
-+
-+add_dependencies(${PROJECT_NAME}
-+ ivi-extension-protocol
-+ ${WAYLAND_SERVER_LIBRARIES}
-+ ${PIXMAN_LIBRARIES}
-+)
-+
-+set(LIBS
-+ ${LIBS}
-+ ivi-extension-protocol
-+ ${WAYLAND_SERVER_LIBRARIES}
-+)
-+
-+set(CMAKE_C_LDFLAGS "-module -avoid-version")
-+
-+target_link_libraries(${PROJECT_NAME} ${LIBS})
-+
-+install (
-+ TARGETS ${PROJECT_NAME}
-+ LIBRARY DESTINATION lib${LIB_SUFFIX}/weston
-+)
-diff --git a/id-agent-modules/simple-id-agent/src/simple-id-agent.c b/id-agent-modules/simple-id-agent/src/simple-id-agent.c
-new file mode 100644
-index 0000000..3c9e989
---- /dev/null
-+++ b/id-agent-modules/simple-id-agent/src/simple-id-agent.c
-@@ -0,0 +1,124 @@
-+/*
-+ * Copyright (C) 2017 Advanced Driver Information Technology Joint Venture GmbH
-+ *
-+ * Permission to use, copy, modify, distribute, and sell this software and
-+ * its documentation for any purpose is hereby granted without fee, provided
-+ * that the above copyright notice appear in all copies and that both that
-+ * copyright notice and this permission notice appear in supporting
-+ * documentation, and that the name of the copyright holders not be used in
-+ * advertising or publicity pertaining to distribution of the software
-+ * without specific, written prior permission. The copyright holders make
-+ * no representations about the suitability of this software for any
-+ * purpose. It is provided "as is" without express or implied warranty.
-+ *
-+ * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
-+ * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
-+ * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
-+ * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
-+ * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
-+ * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
-+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-+ */
-+
-+#include <stdlib.h>
-+#include <stdio.h>
-+#include <string.h>
-+#include <limits.h>
-+
-+#include <weston.h>
-+#include <weston/ivi-layout-export.h>
-+
-+struct ivi_id_agent
-+{
-+ uint32_t default_id_offset;
-+ uint32_t last_assigned_id;
-+ struct weston_compositor *compositor;
-+ const struct ivi_layout_interface *interface;
-+ struct wl_listener desktop_surface_configured;
-+};
-+
-+static void
-+desktop_surface_event_configure(struct wl_listener *listener,
-+ void *data)
-+{
-+ struct ivi_id_agent *ida = wl_container_of(listener, ida,
-+ desktop_surface_configured);
-+ struct ivi_layout_surface *layout_surface =
-+ (struct ivi_layout_surface *) data;
-+ uint32_t tmp_id;
-+
-+ tmp_id = ++ida->last_assigned_id;
-+
-+ /* Find an unused id */
-+ while(ida->interface->get_surface_from_id(tmp_id)) {
-+ weston_log("simple-id-agent: surface id: %d is already used\n", tmp_id);
-+ tmp_id++;
-+ }
-+
-+ ida->last_assigned_id = tmp_id;
-+
-+ if (ida->interface->surface_set_id(layout_surface, ida->last_assigned_id) != 0)
-+ weston_log("simple-id-agent: failed to set surface id :%d\n", ida->last_assigned_id);
-+}
-+
-+static void
-+deinit(struct ivi_id_agent *ida)
-+{
-+ wl_list_remove(&ida->desktop_surface_configured.link);
-+ free(ida);
-+}
-+
-+static int32_t
-+read_config(struct ivi_id_agent *ida)
-+{
-+ struct weston_config *config = NULL;
-+ struct weston_config_section *section = NULL;
-+ const char *name = NULL;
-+
-+ config = wet_get_config(ida->compositor);
-+ if (!config)
-+ return -1;
-+
-+ section = weston_config_get_section(config, "id-agent", NULL, NULL);
-+
-+ if (section) {
-+
-+ weston_config_section_get_uint(section, "default-id-offset",
-+ &ida->default_id_offset, 0);
-+
-+ } else {
-+ ida->default_id_offset = 0;
-+ }
-+
-+ return 0;
-+}
-+
-+WL_EXPORT int32_t
-+id_agent_module_init(struct weston_compositor *ec,
-+ const struct ivi_layout_interface *interface,
-+ size_t interface_version)
-+{
-+ struct ivi_id_agent *ida;
-+
-+ ida = calloc(1, sizeof *ida);
-+ if (ida == NULL) {
-+ weston_log("failed to allocate ivi_id_agent\n");
-+ return -1;
-+ }
-+
-+ ida->compositor = ec;
-+ ida->interface = interface;
-+ ida->desktop_surface_configured.notify = desktop_surface_event_configure;
-+ ida->interface->add_listener_configure_desktop_surface(&ida->desktop_surface_configured);
-+
-+ if(read_config(ida) != 0) {
-+ deinit(ida);
-+ return -1;
-+ }
-+
-+ ida->last_assigned_id = ida->default_id_offset;
-+
-+ weston_log("id_agent_module_init: success\n");
-+
-+ return 0;
-+}
-diff --git a/id-agent-modules/simple-id-agent/weston.ini.in b/id-agent-modules/simple-id-agent/weston.ini.in
-new file mode 100644
-index 0000000..b5e5fa1
---- /dev/null
-+++ b/id-agent-modules/simple-id-agent/weston.ini.in
-@@ -0,0 +1,11 @@
-+[core]
-+shell=ivi-shell.so
-+require-input=false
-+
-+[ivi-shell]
-+ivi-module=ivi-controller.so
-+ivi-input-module=ivi-input-controller.so
-+id-agent-module=simple-id-agent.so
-+
-+[id-agent]
-+default-id-offset=10
-diff --git a/weston-ivi-shell/src/ivi-controller.c b/weston-ivi-shell/src/ivi-controller.c
-index 6d95c88..5e61e76 100644
---- a/weston-ivi-shell/src/ivi-controller.c
-+++ b/weston-ivi-shell/src/ivi-controller.c
-@@ -2164,6 +2164,40 @@ load_input_module(struct ivishell *shell)
- return 0;
- }
-
-+static int load_id_agent_module(struct weston_compositor *ec,
-+ const struct ivi_layout_interface *interface,
-+ size_t interface_version)
-+{
-+ struct weston_config *config = wet_get_config(ec);
-+ struct weston_config_section *section;
-+ char *id_agent_module = NULL;
-+
-+ int (*id_agent_module_init)(struct weston_compositor *ec,
-+ const struct ivi_layout_interface *interface,
-+ size_t interface_version);
-+
-+ section = weston_config_get_section(config, "ivi-shell", NULL, NULL);
-+
-+ if (weston_config_section_get_string(section, "id-agent-module",
-+ &id_agent_module, NULL) < 0) {
-+ weston_log("ivi-controller: No id-agent-module set\n");
-+ return 0;
-+ }
-+
-+ id_agent_module_init = wet_load_module_entrypoint(id_agent_module, "id_agent_module_init");
-+ if (!id_agent_module_init)
-+ return -1;
-+
-+ if (id_agent_module_init(ec, interface,
-+ sizeof(struct ivi_layout_interface)) != 0) {
-+ weston_log("ivi-controller: Initialization of id agent module fails\n");
-+ return -1;
-+ }
-+
-+ free(id_agent_module);
-+ return 0;
-+}
-+
- static void
- launch_client_process(void *data)
- {
-@@ -2229,6 +2263,11 @@ controller_module_init(struct weston_compositor *compositor,
- return -1;
- }
-
-+ if (load_id_agent_module(compositor, interface, interface_version) < 0) {
-+ free(shell);
-+ return -1;
-+ }
-+
- if (shell->bkgnd_surface_id && shell->ivi_client_name) {
- loop = wl_display_get_event_loop(compositor->wl_display);
- wl_event_loop_add_idle(loop, launch_client_process, shell);
diff --git a/meta-agl-profile-graphical/recipes-graphics/wayland/wayland-ivi-extension/0001-simple-id-agent-initial-commit.patch b/meta-agl-profile-graphical/recipes-graphics/wayland/wayland-ivi-extension/0001-simple-id-agent-initial-commit.patch
deleted file mode 100644
index 9e95167ed..000000000
--- a/meta-agl-profile-graphical/recipes-graphics/wayland/wayland-ivi-extension/0001-simple-id-agent-initial-commit.patch
+++ /dev/null
@@ -1,264 +0,0 @@
-From 8f67f40f7c6b6f62e094f0bdc5044793ae76b1c7 Mon Sep 17 00:00:00 2001
-From: Emre Ucan <eucan@de.adit-jv.com>
-Date: Fri, 24 Nov 2017 16:24:51 +0100
-Subject: [PATCH 1/2] simple-id-agent: initial commit
-
-it is a very simple id-agent plugin.
-It is possible to configure default surface id
-offset. Assigned ids would start
-from the given id offset.
-
-Please check the example weston.ini for loading
-and configuring the simple-id-agent
-
-Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
----
- CMakeLists.txt | 1 +
- id-agent-modules/simple-id-agent/CMakeLists.txt | 72 ++++++++++++
- .../simple-id-agent/src/simple-id-agent.c | 124 +++++++++++++++++++++
- id-agent-modules/simple-id-agent/weston.ini.in | 11 ++
- 4 files changed, 208 insertions(+)
- create mode 100644 id-agent-modules/simple-id-agent/CMakeLists.txt
- create mode 100644 id-agent-modules/simple-id-agent/src/simple-id-agent.c
- create mode 100644 id-agent-modules/simple-id-agent/weston.ini.in
-
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index bad85df..d07abf5 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -35,6 +35,7 @@ add_subdirectory(ivi-layermanagement-api/ilmClient)
- add_subdirectory(ivi-layermanagement-api/ilmControl)
- add_subdirectory(ivi-layermanagement-api/test)
- add_subdirectory(ivi-layermanagement-examples)
-+add_subdirectory(id-agent-modules/simple-id-agent)
-
- if(WITH_ILM_INPUT)
- add_subdirectory(ivi-input-api/ilmInput)
-diff --git a/id-agent-modules/simple-id-agent/CMakeLists.txt b/id-agent-modules/simple-id-agent/CMakeLists.txt
-new file mode 100644
-index 0000000..8290722
---- /dev/null
-+++ b/id-agent-modules/simple-id-agent/CMakeLists.txt
-@@ -0,0 +1,72 @@
-+############################################################################
-+#
-+# Copyright (C) 2013 DENSO CORPORATION
-+# Copyright 2014 BMW Car IT GmbH
-+#
-+#
-+# Licensed under the Apache License, Version 2.0 (the "License");
-+# you may not use this file except in compliance with the License.
-+# You may obtain a copy of the License at
-+#
-+# http://www.apache.org/licenses/LICENSE-2.0
-+#
-+# Unless required by applicable law or agreed to in writing, software
-+# distributed under the License is distributed on an "AS IS" BASIS,
-+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-+# See the License for the specific language governing permissions and
-+# limitations under the License.
-+#
-+############################################################################
-+
-+cmake_minimum_required (VERSION 2.6)
-+
-+project(simple-id-agent)
-+
-+find_package(PkgConfig REQUIRED)
-+pkg_check_modules(WAYLAND_SERVER wayland-server>=1.13.0 REQUIRED)
-+pkg_check_modules(WESTON weston>=2.0.0 REQUIRED)
-+pkg_check_modules(PIXMAN pixman-1 REQUIRED)
-+
-+find_package(Threads REQUIRED)
-+
-+GET_TARGET_PROPERTY(IVI_EXTENSION_INCLUDE_DIRS ivi-extension-protocol INCLUDE_DIRECTORIES)
-+
-+include_directories(
-+ src
-+ ${IVI_EXTENSION_INCLUDE_DIRS}
-+ ${WAYLAND_SERVER_INCLUDE_DIRS}
-+ ${WESTON_INCLUDE_DIRS}
-+ ${PIXMAN_INCLUDE_DIRS}
-+)
-+
-+link_directories(
-+ ${WAYLAND_SERVER_LIBRARY_DIRS}
-+ ${PIXMAN_LIBRARY_DIRS}
-+)
-+
-+add_library(${PROJECT_NAME} MODULE
-+ src/simple-id-agent.c
-+)
-+
-+set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "")
-+
-+add_dependencies(${PROJECT_NAME}
-+ ivi-extension-protocol
-+ ${WAYLAND_SERVER_LIBRARIES}
-+ ${PIXMAN_LIBRARIES}
-+)
-+
-+set(LIBS
-+ ${LIBS}
-+ ivi-extension-protocol
-+ ${WAYLAND_SERVER_LIBRARIES}
-+)
-+
-+set(CMAKE_C_LDFLAGS "-module -avoid-version")
-+
-+target_link_libraries(${PROJECT_NAME} ${LIBS})
-+
-+install (
-+ TARGETS ${PROJECT_NAME}
-+ LIBRARY DESTINATION lib${LIB_SUFFIX}/weston
-+)
-diff --git a/id-agent-modules/simple-id-agent/src/simple-id-agent.c b/id-agent-modules/simple-id-agent/src/simple-id-agent.c
-new file mode 100644
-index 0000000..3c9e989
---- /dev/null
-+++ b/id-agent-modules/simple-id-agent/src/simple-id-agent.c
-@@ -0,0 +1,124 @@
-+/*
-+ * Copyright (C) 2017 Advanced Driver Information Technology Joint Venture GmbH
-+ *
-+ * Permission to use, copy, modify, distribute, and sell this software and
-+ * its documentation for any purpose is hereby granted without fee, provided
-+ * that the above copyright notice appear in all copies and that both that
-+ * copyright notice and this permission notice appear in supporting
-+ * documentation, and that the name of the copyright holders not be used in
-+ * advertising or publicity pertaining to distribution of the software
-+ * without specific, written prior permission. The copyright holders make
-+ * no representations about the suitability of this software for any
-+ * purpose. It is provided "as is" without express or implied warranty.
-+ *
-+ * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
-+ * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
-+ * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
-+ * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
-+ * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
-+ * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
-+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-+ */
-+
-+#include <stdlib.h>
-+#include <stdio.h>
-+#include <string.h>
-+#include <limits.h>
-+
-+#include <weston.h>
-+#include <weston/ivi-layout-export.h>
-+
-+struct ivi_id_agent
-+{
-+ uint32_t default_id_offset;
-+ uint32_t last_assigned_id;
-+ struct weston_compositor *compositor;
-+ const struct ivi_layout_interface *interface;
-+ struct wl_listener desktop_surface_configured;
-+};
-+
-+static void
-+desktop_surface_event_configure(struct wl_listener *listener,
-+ void *data)
-+{
-+ struct ivi_id_agent *ida = wl_container_of(listener, ida,
-+ desktop_surface_configured);
-+ struct ivi_layout_surface *layout_surface =
-+ (struct ivi_layout_surface *) data;
-+ uint32_t tmp_id;
-+
-+ tmp_id = ++ida->last_assigned_id;
-+
-+ /* Find an unused id */
-+ while(ida->interface->get_surface_from_id(tmp_id)) {
-+ weston_log("simple-id-agent: surface id: %d is already used\n", tmp_id);
-+ tmp_id++;
-+ }
-+
-+ ida->last_assigned_id = tmp_id;
-+
-+ if (ida->interface->surface_set_id(layout_surface, ida->last_assigned_id) != 0)
-+ weston_log("simple-id-agent: failed to set surface id :%d\n", ida->last_assigned_id);
-+}
-+
-+static void
-+deinit(struct ivi_id_agent *ida)
-+{
-+ wl_list_remove(&ida->desktop_surface_configured.link);
-+ free(ida);
-+}
-+
-+static int32_t
-+read_config(struct ivi_id_agent *ida)
-+{
-+ struct weston_config *config = NULL;
-+ struct weston_config_section *section = NULL;
-+ const char *name = NULL;
-+
-+ config = wet_get_config(ida->compositor);
-+ if (!config)
-+ return -1;
-+
-+ section = weston_config_get_section(config, "id-agent", NULL, NULL);
-+
-+ if (section) {
-+
-+ weston_config_section_get_uint(section, "default-id-offset",
-+ &ida->default_id_offset, 0);
-+
-+ } else {
-+ ida->default_id_offset = 0;
-+ }
-+
-+ return 0;
-+}
-+
-+WL_EXPORT int32_t
-+id_agent_module_init(struct weston_compositor *ec,
-+ const struct ivi_layout_interface *interface,
-+ size_t interface_version)
-+{
-+ struct ivi_id_agent *ida;
-+
-+ ida = calloc(1, sizeof *ida);
-+ if (ida == NULL) {
-+ weston_log("failed to allocate ivi_id_agent\n");
-+ return -1;
-+ }
-+
-+ ida->compositor = ec;
-+ ida->interface = interface;
-+ ida->desktop_surface_configured.notify = desktop_surface_event_configure;
-+ ida->interface->add_listener_configure_desktop_surface(&ida->desktop_surface_configured);
-+
-+ if(read_config(ida) != 0) {
-+ deinit(ida);
-+ return -1;
-+ }
-+
-+ ida->last_assigned_id = ida->default_id_offset;
-+
-+ weston_log("id_agent_module_init: success\n");
-+
-+ return 0;
-+}
-diff --git a/id-agent-modules/simple-id-agent/weston.ini.in b/id-agent-modules/simple-id-agent/weston.ini.in
-new file mode 100644
-index 0000000..b5e5fa1
---- /dev/null
-+++ b/id-agent-modules/simple-id-agent/weston.ini.in
-@@ -0,0 +1,11 @@
-+[core]
-+shell=ivi-shell.so
-+require-input=false
-+
-+[ivi-shell]
-+ivi-module=ivi-controller.so
-+ivi-input-module=ivi-input-controller.so
-+id-agent-module=simple-id-agent.so
-+
-+[id-agent]
-+default-id-offset=10
---
-2.13.6
-
diff --git a/meta-agl-profile-graphical/recipes-graphics/wayland/wayland-ivi-extension/0002-ivi-controller-load-id-agent-module.patch b/meta-agl-profile-graphical/recipes-graphics/wayland/wayland-ivi-extension/0002-ivi-controller-load-id-agent-module.patch
deleted file mode 100644
index f44786a36..000000000
--- a/meta-agl-profile-graphical/recipes-graphics/wayland/wayland-ivi-extension/0002-ivi-controller-load-id-agent-module.patch
+++ /dev/null
@@ -1,69 +0,0 @@
-From 26f2f7ce78ba2002809048b227ad9c35921a9cd8 Mon Sep 17 00:00:00 2001
-From: Emre Ucan <eucan@de.adit-jv.com>
-Date: Fri, 24 Nov 2017 16:27:01 +0100
-Subject: [PATCH 2/2] ivi-controller: load id-agent module
-
-Signed-off-by: Emre Ucan <eucan@de.adit-jv.com>
----
- weston-ivi-shell/src/ivi-controller.c | 39 +++++++++++++++++++++++++++++++++++
- 1 file changed, 39 insertions(+)
-
-diff --git a/weston-ivi-shell/src/ivi-controller.c b/weston-ivi-shell/src/ivi-controller.c
-index 312a978..47b6de2 100644
---- a/weston-ivi-shell/src/ivi-controller.c
-+++ b/weston-ivi-shell/src/ivi-controller.c
-@@ -1518,6 +1518,40 @@ load_input_module(struct weston_compositor *ec,
- return 0;
- }
-
-+static int load_id_agent_module(struct weston_compositor *ec,
-+ const struct ivi_layout_interface *interface,
-+ size_t interface_version)
-+{
-+ struct weston_config *config = wet_get_config(ec);
-+ struct weston_config_section *section;
-+ char *id_agent_module = NULL;
-+
-+ int (*id_agent_module_init)(struct weston_compositor *ec,
-+ const struct ivi_layout_interface *interface,
-+ size_t interface_version);
-+
-+ section = weston_config_get_section(config, "ivi-shell", NULL, NULL);
-+
-+ if (weston_config_section_get_string(section, "id-agent-module",
-+ &id_agent_module, NULL) < 0) {
-+ weston_log("ivi-controller: No id-agent-module set\n");
-+ return 0;
-+ }
-+
-+ id_agent_module_init = wet_load_module_entrypoint(id_agent_module, "id_agent_module_init");
-+ if (!id_agent_module_init)
-+ return -1;
-+
-+ if (id_agent_module_init(ec, interface,
-+ sizeof(struct ivi_layout_interface)) != 0) {
-+ weston_log("ivi-controller: Initialization of id agent module fails\n");
-+ return -1;
-+ }
-+
-+ free(id_agent_module);
-+ return 0;
-+}
-+
- WL_EXPORT int
- controller_module_init(struct weston_compositor *compositor,
- int *argc, char *argv[],
-@@ -1555,5 +1589,10 @@ controller_module_init(struct weston_compositor *compositor,
- return -1;
- }
-
-+ if (load_id_agent_module(compositor, interface, interface_version) < 0) {
-+ free(shell);
-+ return -1;
-+ }
-+
- return 0;
- }
---
-2.13.6
-
diff --git a/meta-agl-profile-graphical/recipes-graphics/wayland/wayland-ivi-extension/0002-ivi-id-agent-added-ivi-id-agent.patch b/meta-agl-profile-graphical/recipes-graphics/wayland/wayland-ivi-extension/0002-ivi-id-agent-added-ivi-id-agent.patch
new file mode 100644
index 000000000..2b78357fe
--- /dev/null
+++ b/meta-agl-profile-graphical/recipes-graphics/wayland/wayland-ivi-extension/0002-ivi-id-agent-added-ivi-id-agent.patch
@@ -0,0 +1,538 @@
+From 42fc715a430068cdb4484e2cb119418da8ac4e6f Mon Sep 17 00:00:00 2001
+From: Michael Teyfel <mteyfel@de.adit-jv.com>
+Date: Fri, 12 Oct 2018 16:46:57 +0200
+Subject: [PATCH 2/3] ivi-id-agent: added ivi-id-agent
+
+This is a reference implementation of an ivi-id-agent plugin. It
+creates surface-ids for desktop-surfaces depending on the configuration
+provided in "weston.ini". For more please refer to the reference
+implementation in this commit.
+
+The only public interface available is the "id_agent_module_init"
+function. It is responsible for initialization of structs and reading
+the configuration.
+
+In the reference "weston.ini" two types of configurations can be found:
+
+[desktop-app] is used to configure a particular application. Therefore
+the desired surface-id must be provided. Moreover "app-title" is the
+title that is provided by the desktop application (xdg-protocol).
+"app-id" behaves accordingly. Although both parameters can be set, it
+is not mandatory. Finally at least one has to be set.
+
+[desktop-app-default] enables the id-agent to generate generic
+surface-ids for unconfigured applications, e.g. for development. This
+tag is optional. To generate the id an interval starting from
+"default-surface-id" to "default-surface-id-max" is used. The id is
+incremented until the interval is exceeded.
+
+In the function "get_id" a surface-id is assigned by means of the
+configuration. It can be adjusted, if another behavior is desired.
+In this plugin the parameters, that are described above, are evaluated.
+
+To use these patches please also apply the dedicated patches for
+weston: https://github.com/mtey/weston/tree/xdg_support_ivi_id_agent
+Since libweston-desktop is used to introduce desktop-surface support,
+xdg-protocol is supported.
+
+Signed-off-by: Michael Teyfel <mteyfel@de.adit-jv.com>
+---
+ ivi-id-agent-modules/ivi-id-agent/CMakeLists.txt | 69 ++++
+ .../ivi-id-agent/src/ivi-id-agent.c | 381 +++++++++++++++++++++
+ ivi-id-agent-modules/ivi-id-agent/weston.ini.in | 20 ++
+ 3 files changed, 470 insertions(+)
+ create mode 100644 ivi-id-agent-modules/ivi-id-agent/CMakeLists.txt
+ create mode 100644 ivi-id-agent-modules/ivi-id-agent/src/ivi-id-agent.c
+ create mode 100644 ivi-id-agent-modules/ivi-id-agent/weston.ini.in
+
+diff --git a/ivi-id-agent-modules/ivi-id-agent/CMakeLists.txt b/ivi-id-agent-modules/ivi-id-agent/CMakeLists.txt
+new file mode 100644
+index 0000000..2def105
+--- /dev/null
++++ b/ivi-id-agent-modules/ivi-id-agent/CMakeLists.txt
+@@ -0,0 +1,69 @@
++###############################################################################
++#
++# Copyright (C) 2017 Advanced Driver Information Technology Joint Venture GmbH
++#
++#
++# Licensed under the Apache License, Version 2.0 (the "License");
++# you may not use this file except in compliance with the License.
++# You may obtain a copy of the License at
++#
++# http://www.apache.org/licenses/LICENSE-2.0
++#
++# Unless required by applicable law or agreed to in writing, software
++# distributed under the License is distributed on an "AS IS" BASIS,
++# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
++# See the License for the specific language governing permissions and
++# limitations under the License.
++#
++###############################################################################
++
++cmake_minimum_required (VERSION 2.6)
++
++project(ivi-id-agent)
++
++find_package(PkgConfig REQUIRED)
++pkg_check_modules(WAYLAND_SERVER wayland-server REQUIRED)
++pkg_check_modules(WESTON weston>=2.0.0 REQUIRED)
++pkg_check_modules(PIXMAN pixman-1 REQUIRED)
++pkg_check_modules(LIBWESTON_DESKTOP libweston-desktop-2 REQUIRED)
++
++find_package(Threads REQUIRED)
++
++include_directories(
++ src
++ ${WAYLAND_SERVER_INCLUDE_DIRS}
++ ${WESTON_INCLUDE_DIRS}
++ ${PIXMAN_INCLUDE_DIRS}
++)
++
++link_directories(
++ ${WAYLAND_SERVER_LIBRARY_DIRS}
++ ${PIXMAN_LIBRARY_DIRS}
++)
++
++
++add_library(${PROJECT_NAME} MODULE
++ src/ivi-id-agent.c
++)
++
++set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "")
++
++add_dependencies(${PROJECT_NAME}
++ ${WAYLAND_SERVER_LIBRARIES}
++ ${PIXMAN_LIBRARIES}
++)
++
++set(LIBS
++ ${LIBS}
++ ${WAYLAND_SERVER_LIBRARIES}
++ ${LIBWESTON_DESKTOP_LIBRARIES}
++)
++
++set(CMAKE_C_LDFLAGS "-module -avoid-version")
++
++target_link_libraries(${PROJECT_NAME} ${LIBS})
++
++install (
++ TARGETS ${PROJECT_NAME}
++ LIBRARY DESTINATION lib${LIB_SUFFIX}/weston
++)
+diff --git a/ivi-id-agent-modules/ivi-id-agent/src/ivi-id-agent.c b/ivi-id-agent-modules/ivi-id-agent/src/ivi-id-agent.c
+new file mode 100644
+index 0000000..9bc115d
+--- /dev/null
++++ b/ivi-id-agent-modules/ivi-id-agent/src/ivi-id-agent.c
+@@ -0,0 +1,381 @@
++/*
++ * Copyright (C) 2017 Advanced Driver Information Technology Joint Venture GmbH
++ *
++ * Permission to use, copy, modify, distribute, and sell this software and
++ * its documentation for any purpose is hereby granted without fee, provided
++ * that the above copyright notice appear in all copies and that both that
++ * copyright notice and this permission notice appear in supporting
++ * documentation, and that the name of the copyright holders not be used in
++ * advertising or publicity pertaining to distribution of the software
++ * without specific, written prior permission. The copyright holders make
++ * no representations about the suitability of this software for any
++ * purpose. It is provided "as is" without express or implied warranty.
++ *
++ * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
++ * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
++ * FITNESS, IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY
++ * SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
++ * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
++ * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
++ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
++ */
++
++#include <stdlib.h>
++#include <stdio.h>
++#include <string.h>
++#include <limits.h>
++
++#include <weston.h>
++#include <libweston-desktop.h>
++#include "config-parser.h"
++#include <weston/ivi-layout-export.h>
++
++#ifndef INVALID_ID
++#define INVALID_ID 0xFFFFFFFF
++#endif
++
++struct db_elem
++{
++ struct wl_list link;
++ uint32_t surface_id;
++ char *cfg_app_id;
++ char *cfg_title;
++ struct ivi_layout_surface *layout_surface;
++};
++
++struct ivi_id_agent
++{
++ uint32_t default_behavior_set;
++ uint32_t default_surface_id;
++ uint32_t default_surface_id_max;
++ struct wl_list app_list;
++ struct weston_compositor *compositor;
++ const struct ivi_layout_interface *interface;
++
++ struct wl_listener desktop_surface_configured;
++ struct wl_listener destroy_listener;
++ struct wl_listener surface_removed;
++};
++
++static int32_t
++check_config_parameter(char *cfg_val, char *val)
++{
++ if (cfg_val == NULL)
++ return IVI_SUCCEEDED;
++ else if (val == NULL || strcmp(cfg_val, val) != 0)
++ return IVI_FAILED;
++
++ return IVI_SUCCEEDED;
++}
++
++static int32_t
++get_id_from_config(struct ivi_id_agent *ida, struct ivi_layout_surface
++ *layout_surface) {
++ struct db_elem *db_elem;
++ char *temp_app_id = NULL;
++ char *temp_title = NULL;
++ int ret = IVI_FAILED;
++
++ struct weston_surface *weston_surface =
++ ida->interface->surface_get_weston_surface(layout_surface);
++
++ /* Get app id and title */
++ struct weston_desktop_surface *wds = weston_surface_get_desktop_surface(
++ weston_surface);
++
++ if (weston_desktop_surface_get_app_id(wds) != NULL)
++ temp_app_id = strdup(weston_desktop_surface_get_app_id(wds));
++
++ if (weston_desktop_surface_get_title(wds) != NULL)
++ temp_title = strdup(weston_desktop_surface_get_title(wds));
++
++ /*
++ * Check for every config parameter to be fulfilled. This part must be
++ * extended, if additional attributes are desired to be checked.
++ */
++ wl_list_for_each(db_elem, &ida->app_list, link)
++ {
++ if (check_config_parameter(db_elem->cfg_app_id, temp_app_id) == 0) {
++ if (check_config_parameter(db_elem->cfg_title, temp_title) == 0) {
++ /* Found configuration for application. */
++ int res = ida->interface->surface_set_id(layout_surface,
++ db_elem->surface_id);
++ if (res)
++ continue;
++
++ db_elem->layout_surface = layout_surface;
++ ret = IVI_SUCCEEDED;
++
++ break;
++ }
++ }
++ }
++
++ free(temp_app_id);
++ free(temp_title);
++
++ return ret;
++}
++
++/*
++ * This function generates the id of a surface in regard to the desired
++ * parameters. For implementation of different behavior in id generation please
++ * adjust this function.
++ * In this implementation the app_id and/or title of the application is used for
++ * identification. It is also possible to use the pid, uid or gid for example.
++ */
++static int32_t
++get_id(struct ivi_id_agent *ida, struct ivi_layout_surface *layout_surface)
++{
++ if (get_id_from_config(ida, layout_surface) == IVI_SUCCEEDED)
++ return IVI_SUCCEEDED;
++
++ /* No default layer available */
++ if (ida->default_behavior_set == 0) {
++ weston_log("ivi-id-agent: Could not find configuration for application\n");
++ goto ivi_failed;
++
++ /* Default behavior for unknown applications */
++ } else if (ida->default_surface_id < ida->default_surface_id_max) {
++ weston_log("ivi-id-agent: No configuration for application adding to "
++ "default layer\n");
++
++ /*
++ * Check if ivi-shell application already created an application with
++ * desired surface_id
++ */
++ struct ivi_layout_surface *temp_layout_surf =
++ ida->interface->get_surface_from_id(
++ ida->default_surface_id);
++ if ((temp_layout_surf != NULL) && (temp_layout_surf != layout_surface)) {
++ weston_log("ivi-id-agent: surface_id already used by an ivi-shell "
++ "application\n");
++ goto ivi_failed;
++ }
++
++ ida->interface->surface_set_id(layout_surface,
++ ida->default_surface_id);
++ ida->default_surface_id++;
++
++ } else {
++ weston_log("ivi-id-agent: Interval for default surface_id generation "
++ "exceeded\n");
++ goto ivi_failed;
++ }
++
++ return IVI_SUCCEEDED;
++
++ivi_failed:
++ return IVI_FAILED;
++}
++
++static void
++desktop_surface_event_configure(struct wl_listener *listener,
++ void *data)
++{
++ struct ivi_id_agent *ida = wl_container_of(listener, ida,
++ desktop_surface_configured);
++
++ struct ivi_layout_surface *layout_surface =
++ (struct ivi_layout_surface *) data;
++
++ if (get_id(ida, layout_surface) == IVI_FAILED)
++ weston_log("ivi-id-agent: Could not create surface_id for application\n");
++}
++
++static void
++surface_event_remove(struct wl_listener *listener, void *data) {
++ struct ivi_id_agent *ida = wl_container_of(listener, ida,
++ surface_removed);
++ struct ivi_layout_surface *layout_surface =
++ (struct ivi_layout_surface *) data;
++ struct db_elem *db_elem = NULL;
++
++ wl_list_for_each(db_elem, &ida->app_list, link)
++ {
++ if(db_elem->layout_surface == layout_surface) {
++ db_elem->layout_surface = NULL;
++ break;
++ }
++ }
++}
++
++static int32_t deinit(struct ivi_id_agent *ida);
++
++static void
++id_agent_module_deinit(struct wl_listener *listener, void *data) {
++ (void)data;
++ struct ivi_id_agent *ida = wl_container_of(listener, ida, destroy_listener);
++
++ deinit(ida);
++}
++
++static int32_t
++check_config(struct db_elem *curr_db_elem, struct ivi_id_agent *ida)
++{
++ struct db_elem *db_elem;
++
++ if (ida->default_surface_id <= curr_db_elem->surface_id
++ && curr_db_elem->surface_id <= ida->default_surface_id_max) {
++ weston_log("ivi-id-agent: surface_id: %d in default id interval "
++ "[%d, %d] (CONFIG ERROR)\n", curr_db_elem->surface_id,
++ ida->default_surface_id, ida->default_surface_id_max);
++ goto ivi_failed;
++ }
++
++ wl_list_for_each(db_elem, &ida->app_list, link)
++ {
++ if(curr_db_elem == db_elem)
++ continue;
++
++ if (db_elem->surface_id == curr_db_elem->surface_id) {
++ weston_log("ivi-id-agent: Duplicate surface_id: %d (CONFIG ERROR)\n",
++ curr_db_elem->surface_id);
++ goto ivi_failed;
++ }
++ }
++
++ return IVI_SUCCEEDED;
++
++ivi_failed:
++ return IVI_FAILED;
++}
++
++static int32_t
++read_config(struct ivi_id_agent *ida)
++{
++ struct weston_config *config = NULL;
++ struct weston_config_section *section = NULL;
++ const char *name = NULL;
++
++ config = wet_get_config(ida->compositor);
++ if (!config)
++ goto ivi_failed;
++
++ section = weston_config_get_section(config, "desktop-app-default", NULL,
++ NULL);
++
++ if (section) {
++ weston_log("ivi-id-agent: Default behavior for unknown applications is "
++ "set\n");
++ ida->default_behavior_set = 1;
++
++ weston_config_section_get_uint(section, "default-surface-id",
++ &ida->default_surface_id, INVALID_ID);
++ weston_config_section_get_uint(section, "default-surface-id-max",
++ &ida->default_surface_id_max, INVALID_ID);
++
++ if (ida->default_surface_id == INVALID_ID ||
++ ida->default_surface_id_max == INVALID_ID) {
++ weston_log("ivi-id-agent: Missing configuration for default "
++ "behavior\n");
++ ida->default_behavior_set = 0;
++ }
++ } else {
++ ida->default_behavior_set = 0;
++ }
++
++ section = NULL;
++ while (weston_config_next_section(config, &section, &name)) {
++ struct db_elem *db_elem = NULL;
++
++ if (strcmp(name, "desktop-app") != 0)
++ continue;
++
++ db_elem = calloc(1, sizeof *db_elem);
++ if (db_elem == NULL) {
++ weston_log("ivi-id-agent: No memory to allocate\n");
++ goto ivi_failed;
++ }
++
++ wl_list_insert(&ida->app_list, &db_elem->link);
++
++ weston_config_section_get_uint(section, "surface-id",
++ &db_elem->surface_id, INVALID_ID);
++
++ if (db_elem->surface_id == INVALID_ID) {
++ weston_log("ivi-id-agent: surface-id is not set in configuration\n");
++ goto ivi_failed;
++ }
++
++ weston_config_section_get_string(section, "app-id",
++ &db_elem->cfg_app_id, NULL);
++ weston_config_section_get_string(section, "app-title",
++ &db_elem->cfg_title, NULL);
++
++ if (db_elem->cfg_app_id == NULL && db_elem->cfg_title == NULL) {
++ weston_log("ivi-id-agent: Every parameter is NULL in app "
++ "configuration\n");
++ goto ivi_failed;
++ }
++
++ if (check_config(db_elem, ida) == IVI_FAILED) {
++ weston_log("ivi-id-agent: No valid config found, deinit...\n");
++ goto ivi_failed;
++ }
++ }
++
++ if(ida->default_behavior_set == 0 && wl_list_empty(&ida->app_list)) {
++ weston_log("ivi-id-agent: No valid config found, deinit...\n");
++ goto ivi_failed;
++ }
++
++ return IVI_SUCCEEDED;
++
++ivi_failed:
++ return IVI_FAILED;
++}
++
++WL_EXPORT int32_t
++id_agent_module_init(struct weston_compositor *compositor,
++ const struct ivi_layout_interface *interface)
++{
++ struct ivi_id_agent *ida = NULL;
++
++ ida = calloc(1, sizeof *ida);
++ if (ida == NULL) {
++ weston_log("failed to allocate ivi_id_agent\n");
++ goto ivi_failed;
++ }
++
++ ida->compositor = compositor;
++ ida->interface = interface;
++ ida->desktop_surface_configured.notify = desktop_surface_event_configure;
++ ida->destroy_listener.notify = id_agent_module_deinit;
++ ida->surface_removed.notify = surface_event_remove;
++
++ wl_signal_add(&compositor->destroy_signal, &ida->destroy_listener);
++ ida->interface->add_listener_configure_desktop_surface(
++ &ida->desktop_surface_configured);
++ interface->add_listener_remove_surface(&ida->surface_removed);
++
++ wl_list_init(&ida->app_list);
++ if(read_config(ida) != 0) {
++ weston_log("ivi-id-agent: Read config failed\n");
++ deinit(ida);
++ goto ivi_failed;
++ }
++
++ return IVI_SUCCEEDED;
++
++ivi_failed:
++ return IVI_FAILED;
++}
++
++static int32_t
++deinit(struct ivi_id_agent *ida)
++{
++ struct db_elem *db_elem;
++ wl_list_for_each(db_elem, &ida->app_list, link) {
++ free(db_elem->cfg_app_id);
++ free(db_elem->cfg_title);
++ free(db_elem);
++ }
++
++ wl_list_remove(&ida->desktop_surface_configured.link);
++ wl_list_remove(&ida->destroy_listener.link);
++ wl_list_remove(&ida->surface_removed.link);
++ free(ida);
++
++ return IVI_SUCCEEDED;
++}
+diff --git a/ivi-id-agent-modules/ivi-id-agent/weston.ini.in b/ivi-id-agent-modules/ivi-id-agent/weston.ini.in
+new file mode 100644
+index 0000000..48a196c
+--- /dev/null
++++ b/ivi-id-agent-modules/ivi-id-agent/weston.ini.in
+@@ -0,0 +1,20 @@
++[core]
++shell=ivi-shell.so
++require-input=false
++
++[ivi-shell]
++ivi-module=ivi-controller.so
++ivi-input-module=ivi-input-controller.so
++ivi-id-agent-module=ivi-id-agent.so
++
++[desktop-app]
++surface-id=111
++app-title=Flower
++
++[desktop-app]
++surface-id=251
++app-title=Flower
++
++[desktop-app-default]
++default-surface-id=2000000
++default-surface-id-max=2001000
+--
+2.7.4
+
diff --git a/meta-agl-profile-graphical/recipes-graphics/wayland/wayland-ivi-extension/0003-ivi-controller-add-resize-setting-suit-to-surface-si.patch b/meta-agl-profile-graphical/recipes-graphics/wayland/wayland-ivi-extension/0003-ivi-controller-add-resize-setting-suit-to-surface-si.patch
deleted file mode 100644
index d2d027256..000000000
--- a/meta-agl-profile-graphical/recipes-graphics/wayland/wayland-ivi-extension/0003-ivi-controller-add-resize-setting-suit-to-surface-si.patch
+++ /dev/null
@@ -1,62 +0,0 @@
-From 525b5bf65303d661f44c01b11bafd5ba90976850 Mon Sep 17 00:00:00 2001
-From: Wataru Mizuno <wmizuno@jp.adit-jv.com>
-Date: Wed, 6 Dec 2017 19:35:51 +0900
-Subject: [PATCH] ivi-controller: add resize setting suit to surface size
-
-The ivi-controller resizes surface size like desktop usecase.
-
-When window manager swicths the half size window to full size,
-resize was not working correctly.
-This patch fixs this issue by changing surface source region at
-the same timing of destination region is changed.
-
-This patch is not necessary later version of wayland-ivi-extension
-2.0 since this resize function has already been implemented by
-appropriate manner.
-
-Signed-off-by: Wataru Mizuno <wmizuno@jp.adit-jv.com>
----
- weston-ivi-shell/src/ivi-controller.c | 17 ++++++++++++++---
- 1 file changed, 14 insertions(+), 3 deletions(-)
-
-diff --git a/weston-ivi-shell/src/ivi-controller.c b/weston-ivi-shell/src/ivi-controller.c
-index 312a978..9450cf2 100644
---- a/weston-ivi-shell/src/ivi-controller.c
-+++ b/weston-ivi-shell/src/ivi-controller.c
-@@ -1334,7 +1334,7 @@ surface_event_configure(struct wl_listener *listener, void *data)
- struct ivisurface *ivisurf = NULL;
- struct ivi_layout_surface *layout_surface =
- (struct ivi_layout_surface *) data;
-- const struct ivi_layout_surface_properties *prop;
-+ struct weston_surface *w_surface;
-
- ivisurf = get_surface(&shell->list_surface, layout_surface);
- if (ivisurf == NULL) {
-@@ -1342,11 +1342,22 @@ surface_event_configure(struct wl_listener *listener, void *data)
- return;
- }
-
-- prop = lyt->get_properties_of_surface(layout_surface);
-+ w_surface = lyt->surface_get_weston_surface(layout_surface);
-+ lyt->surface_set_destination_rectangle(layout_surface,
-+ ivisurf->prop->dest_x,
-+ ivisurf->prop->dest_y,
-+ w_surface->width,
-+ w_surface->height);
-+ lyt->surface_set_source_rectangle(layout_surface,
-+ 0,
-+ 0,
-+ w_surface->width,
-+ w_surface->height);
-+ lyt->commit_changes();
-
- wl_resource_for_each(resource, &ivisurf->resource_list) {
- send_surface_event(resource, ivisurf,
-- prop, IVI_NOTIFICATION_CONFIGURE);
-+ ivisurf->prop, IVI_NOTIFICATION_CONFIGURE);
- }
- }
-
---
-2.7.4
-
diff --git a/meta-agl-profile-graphical/recipes-graphics/wayland/wayland-ivi-extension/0003-ivi-controller-load-id-agent-module.patch b/meta-agl-profile-graphical/recipes-graphics/wayland/wayland-ivi-extension/0003-ivi-controller-load-id-agent-module.patch
new file mode 100644
index 000000000..06fe7843a
--- /dev/null
+++ b/meta-agl-profile-graphical/recipes-graphics/wayland/wayland-ivi-extension/0003-ivi-controller-load-id-agent-module.patch
@@ -0,0 +1,70 @@
+From 5fed5c51ca8c1574804362bfdea4930c16457d34 Mon Sep 17 00:00:00 2001
+From: Michael Teyfel <mteyfel@de.adit-jv.com>
+Date: Fri, 12 Oct 2018 16:57:24 +0200
+Subject: [PATCH 3/3] ivi-controller: load id-agent module
+
+Signed-off-by: Michael Teyfel <mteyfel@de.adit-jv.com>
+---
+ weston-ivi-shell/src/ivi-controller.c | 39 +++++++++++++++++++++++++++++++++++
+ 1 file changed, 39 insertions(+)
+
+diff --git a/weston-ivi-shell/src/ivi-controller.c b/weston-ivi-shell/src/ivi-controller.c
+index 6d95c88..f6ac174 100644
+--- a/weston-ivi-shell/src/ivi-controller.c
++++ b/weston-ivi-shell/src/ivi-controller.c
+@@ -2164,6 +2164,41 @@ load_input_module(struct ivishell *shell)
+ return 0;
+ }
+
++static int load_id_agent_module(struct ivishell *shell)
++{
++ struct weston_config *config = wet_get_config(shell->compositor);
++ struct weston_config_section *section;
++ char *id_agent_module = NULL;
++
++ int (*id_agent_module_init)(struct weston_compositor *compositor,
++ const struct ivi_layout_interface *interface);
++
++ section = weston_config_get_section(config, "ivi-shell", NULL, NULL);
++
++ if (weston_config_section_get_string(section, "ivi-id-agent-module",
++ &id_agent_module, NULL) < 0) {
++ /* input events are handled by weston's default grabs */
++ weston_log("ivi-controller: No ivi-id-agent-module set\n");
++ return 0;
++ }
++
++ id_agent_module_init = wet_load_module_entrypoint(id_agent_module, "id_agent_module_init");
++ if (!id_agent_module_init) {
++ free(id_agent_module);
++ return -1;
++ }
++
++ if (id_agent_module_init(shell->compositor, shell->interface) != 0) {
++ weston_log("ivi-controller: Initialization of id-agent module failed\n");
++ free(id_agent_module);
++ return -1;
++ }
++
++ free(id_agent_module);
++
++ return 0;
++}
++
+ static void
+ launch_client_process(void *data)
+ {
+@@ -2229,6 +2264,10 @@ controller_module_init(struct weston_compositor *compositor,
+ return -1;
+ }
+
++ if (load_id_agent_module(shell) < 0) {
++ weston_log("ivi-controller: id-agent module not loaded\n");
++ }
++
+ if (shell->bkgnd_surface_id && shell->ivi_client_name) {
+ loop = wl_display_get_event_loop(compositor->wl_display);
+ wl_event_loop_add_idle(loop, launch_client_process, shell);
+--
+2.7.4
+
diff --git a/meta-agl-profile-graphical/recipes-graphics/wayland/wayland-ivi-extension/cmake-find-gtest.patch b/meta-agl-profile-graphical/recipes-graphics/wayland/wayland-ivi-extension/cmake-find-gtest.patch
deleted file mode 100644
index 5371174d5..000000000
--- a/meta-agl-profile-graphical/recipes-graphics/wayland/wayland-ivi-extension/cmake-find-gtest.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-diff -Naur old/ivi-input-api/test/CMakeLists.txt new/ivi-input-api/test/CMakeLists.txt
---- old/ivi-input-api/test/CMakeLists.txt 2015-10-19 23:31:13.000000000 +1000
-+++ new/ivi-input-api/test/CMakeLists.txt 2015-10-19 23:30:32.000000000 +1000
-@@ -18,6 +18,7 @@
- ############################################################################
-
- CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
-+SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/modules)
-
- FIND_PACKAGE(gtest)
-
-diff -Naur old/ivi-layermanagement-api/test/CMakeLists.txt new/ivi-layermanagement-api/test/CMakeLists.txt
---- old/ivi-layermanagement-api/test/CMakeLists.txt 2015-10-19 23:31:20.000000000 +1000
-+++ new/ivi-layermanagement-api/test/CMakeLists.txt 2015-10-19 23:30:48.000000000 +1000
-@@ -18,6 +18,7 @@
- ############################################################################
-
- CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
-+SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/modules)
-
- FIND_PACKAGE(gtest)
-
diff --git a/meta-agl-profile-graphical/recipes-graphics/wayland/wayland-ivi-extension/disable-sanitizer-tests.patch b/meta-agl-profile-graphical/recipes-graphics/wayland/wayland-ivi-extension/disable-sanitizer-tests.patch
deleted file mode 100644
index df5d616fd..000000000
--- a/meta-agl-profile-graphical/recipes-graphics/wayland/wayland-ivi-extension/disable-sanitizer-tests.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-Index: git/ivi-layermanagement-api/test/CMakeLists.txt
-===================================================================
---- git.orig/ivi-layermanagement-api/test/CMakeLists.txt
-+++ git/ivi-layermanagement-api/test/CMakeLists.txt
-@@ -58,7 +58,7 @@ IF(BUILD_ILM_API_TESTS)
- )
-
- SET(GCC_SANITIZER_COMPILE_FLAGS "-fsanitize=address -fsanitize=undefined -fno-sanitize-recover -fstack-protector-all")
-- SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GCC_SANITIZER_COMPILE_FLAGS}" )
-+ SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}" )
- SET( CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} -static-libasan -static-libubsan" )
-
- ADD_EXECUTABLE(${PROJECT_NAME} ${SRC_FILES})
diff --git a/meta-agl-profile-graphical/recipes-graphics/wayland/wayland-ivi-extension/test-path.patch b/meta-agl-profile-graphical/recipes-graphics/wayland/wayland-ivi-extension/test-path.patch
deleted file mode 100644
index 251bc58f0..000000000
--- a/meta-agl-profile-graphical/recipes-graphics/wayland/wayland-ivi-extension/test-path.patch
+++ /dev/null
@@ -1,55 +0,0 @@
-From fbe0d0fd35ff79561dc2da853f1b0903bfde428d Mon Sep 17 00:00:00 2001
-From: Changhyeok Bae <changhyeok.bae@gmail.com>
-Date: Thu, 1 Jun 2017 07:45:20 +0000
-Subject: [PATCH] test patch
-
----
- ivi-input-api/test/CMakeLists.txt | 9 +++++----
- ivi-layermanagement-api/test/CMakeLists.txt | 7 ++++---
- 2 files changed, 9 insertions(+), 7 deletions(-)
-
-diff --git a/ivi-input-api/test/CMakeLists.txt b/ivi-input-api/test/CMakeLists.txt
-index db05d0f..db3b745 100644
---- a/ivi-input-api/test/CMakeLists.txt
-+++ b/ivi-input-api/test/CMakeLists.txt
-@@ -65,12 +65,13 @@ IF(BUILD_ILM_API_TESTS)
-
- ADD_DEPENDENCIES(${PROJECT_NAME} ${LIBS})
-
-- INSTALL(TARGETS ${PROJECT_NAME} DESTINATION bin)
-+ INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}/test)
-+ INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/CTestTestfile.cmake DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}/test/ivi-layermanagement-api)
-
- # use CTest
- ENABLE_TESTING()
-- ADD_TEST(ilmCommon ${PROJECT_NAME})
-- ADD_TEST(ilmControl ${PROJECT_NAME})
-- ADD_TEST(ilmInput ${PROJECT_NAME})
-+ ADD_TEST(ilmCommon {CMAKE_INSTALL_LIBEXECDIR}/test/${PROJECT_NAME})
-+ ADD_TEST(ilmControl {CMAKE_INSTALL_LIBEXECDIR}/test/${PROJECT_NAME})
-+ ADD_TEST(ilmInput {CMAKE_INSTALL_LIBEXECDIR}/test/${PROJECT_NAME})
-
- ENDIF()
-diff --git a/ivi-layermanagement-api/test/CMakeLists.txt b/ivi-layermanagement-api/test/CMakeLists.txt
-index fe9a0a4..090d734 100644
---- a/ivi-layermanagement-api/test/CMakeLists.txt
-+++ b/ivi-layermanagement-api/test/CMakeLists.txt
-@@ -63,11 +63,12 @@ IF(BUILD_ILM_API_TESTS)
-
- ADD_DEPENDENCIES(${PROJECT_NAME} ${LIBS})
-
-- INSTALL(TARGETS ${PROJECT_NAME} DESTINATION bin)
-+ INSTALL(TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}/test)
-+ INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/CTestTestfile.cmake DESTINATION ${CMAKE_INSTALL_LIBEXECDIR}/test/ivi-layermanagement-api)
-
- # use CTest
- ENABLE_TESTING()
-- ADD_TEST(ilmCommon ${PROJECT_NAME})
-- ADD_TEST(ilmControl ${PROJECT_NAME})
-+ ADD_TEST(ilmCommon ${CMAKE_INSTALL_LIBEXECDIR}/test/${PROJECT_NAME})
-+ ADD_TEST(ilmControl ${CMAKE_INSTALL_LIBEXECDIR}/test/${PROJECT_NAME})
-
- ENDIF()
---
-2.7.4
-
diff --git a/meta-agl-profile-graphical/recipes-graphics/wayland/wayland-ivi-extension_1.1%.bbappend b/meta-agl-profile-graphical/recipes-graphics/wayland/wayland-ivi-extension_1.1%.bbappend
deleted file mode 100644
index 9c29dee47..000000000
--- a/meta-agl-profile-graphical/recipes-graphics/wayland/wayland-ivi-extension_1.1%.bbappend
+++ /dev/null
@@ -1,27 +0,0 @@
-FILESEXTRAPATHS_append := ":${THISDIR}/${PN}"
-
-ENABLE_TEST = "-DBUILD_ILM_API_TESTS:BOOL=TRUE \
- -DINSTALL_ILM_API_TESTS:BOOL=TRUE \
- "
-
-DISABLE_TEST = "-DBUILD_ILM_API_TESTS:BOOL=FALSE \
- -DINSTALL_ILM_API_TESTS:BOOL=FALSE \
- "
-
-PACKAGECONFIG ??= "test"
-PACKAGECONFIG[test] = "${ENABLE_TEST},${DISABLE_TEST},gtest"
-
-SRC_URI_append = "\
- file://cmake-find-gtest.patch \
- file://test-path.patch \
- "
-
-PACKAGES =+ "${PN}-test"
-
-FILES_${PN}-test = "${libdir}/${PN}/test/*/CTestTestfile.cmake \
- ${libdir}/${PN}/test/ivi-layermanagement-api-test \
- ${libdir}/${PN}/test/ivi-input-api-test \
- "
-FILES_${PN}-dbg += "${libdir}/${PN}/test/.debug"
-
-RDEPENDS_${PN}-test += "cmake"
diff --git a/meta-agl-profile-graphical/recipes-graphics/wayland/wayland-ivi-extension_1.13.0.bb b/meta-agl-profile-graphical/recipes-graphics/wayland/wayland-ivi-extension_1.13.0.bb
deleted file mode 100644
index 68e92adb5..000000000
--- a/meta-agl-profile-graphical/recipes-graphics/wayland/wayland-ivi-extension_1.13.0.bb
+++ /dev/null
@@ -1,33 +0,0 @@
-SUMMARY = "Wayland IVI Extension"
-DESCRIPTION = "GENIVI Layer Management API based on Wayland IVI Extension"
-HOMEPAGE = "http://projects.genivi.org/wayland-ivi-extension"
-BUGTRACKER = "http://bugs.genivi.org/enter_bug.cgi?product=Wayland%20IVI%20Extension"
-LICENSE = "Apache-2.0"
-LIC_FILES_CHKSUM = "file://LICENSE;md5=1f1a56bb2dadf5f2be8eb342acf4ed79"
-
-SRCREV = "ede33c1c898eeaf673dd2c275e92763a5aabd066"
-SRC_URI = "git://github.com/GENIVI/${BPN}.git;protocol=http \
- file://0001-simple-id-agent-initial-commit.patch;patch=1 \
- file://0002-ivi-controller-load-id-agent-module.patch;patch=1 \
- file://0003-ivi-controller-add-resize-setting-suit-to-surface-si.patch \
- file://0001-Resolve-weston-crush-when-repeat-touching-very-quick.patch \
-"
-S = "${WORKDIR}/git"
-
-DEPENDS = "weston virtual/libgles2 pixman wayland-native"
-
-inherit cmake
-
-EXTRA_OECMAKE := "-DWITH_ILM_INPUT=1"
-
-FILES_${PN} += "${libdir}/weston/*"
-FILES_${PN}-dbg += "${libdir}/weston/.debug/*"
-
-EXTRA_OECMAKE += "-DLIB_SUFFIX=${@d.getVar('baselib', True).replace('lib', '')}"
-
-FILESEXTRAPATHS_prepend := ":${THISDIR}/wayland-ivi-extension:"
-
-SRC_URI_append_wandboard = " file://wandboard_fix_build.patch"
-
-# workaround paralellism issue:
-PARALLEL_MAKE = ""
diff --git a/meta-agl-profile-graphical/recipes-graphics/wayland/wayland-ivi-extension_2.0.2.bb b/meta-agl-profile-graphical/recipes-graphics/wayland/wayland-ivi-extension_2.0.2.bb
index 1a09c7c32..3f0e34f4b 100644
--- a/meta-agl-profile-graphical/recipes-graphics/wayland/wayland-ivi-extension_2.0.2.bb
+++ b/meta-agl-profile-graphical/recipes-graphics/wayland/wayland-ivi-extension_2.0.2.bb
@@ -7,7 +7,9 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=1f1a56bb2dadf5f2be8eb342acf4ed79"
SRCREV = "ff067a640451de46836200624ece7ac777977c30"
SRC_URI = "git://github.com/GENIVI/${BPN}.git;branch=2.0;protocol=http \
- file://0001-simple-id-agent-for-2.0.2.patch \
+ file://0001-Added-ivi-id-agent-to-CMake.patch \
+ file://0002-ivi-id-agent-added-ivi-id-agent.patch \
+ file://0003-ivi-controller-load-id-agent-module.patch \
"
SRC_URI_append_wandboard = " file://wandboard_fix_build.patch"