summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README12
-rw-r--r--ivi-id-agent-modules/ivi-id-agent/CMakeLists.txt3
-rw-r--r--ivi-id-agent-modules/ivi-id-agent/src/ivi-id-agent.c12
-rw-r--r--ivi-input-modules/ivi-input-controller/src/ivi-input-controller.c40
-rw-r--r--ivi-layermanagement-api/ilmClient/include/ilm_client_platform.h2
-rw-r--r--ivi-layermanagement-api/ilmClient/src/ilm_client_wayland_platform.c2
-rw-r--r--ivi-layermanagement-api/ilmCommon/include/ilm_common_platform.h2
-rw-r--r--ivi-layermanagement-api/ilmCommon/src/ilm_common_wayland_platform.c2
-rw-r--r--ivi-layermanagement-api/ilmControl/CMakeLists.txt2
-rw-r--r--ivi-layermanagement-api/ilmControl/src/bitmap.c1
-rw-r--r--ivi-layermanagement-api/ilmInput/CMakeLists.txt2
-rw-r--r--ivi-layermanagement-examples/EGLWLInputEventExample/CMakeLists.txt10
-rw-r--r--ivi-layermanagement-examples/EGLWLInputEventExample/src/WLContext.cpp21
-rw-r--r--ivi-layermanagement-examples/LayerManagerControl/CMakeLists.txt2
-rw-r--r--ivi-layermanagement-examples/LayerManagerControl/src/sceneio.cpp61
-rw-r--r--ivi-layermanagement-examples/layer-add-surfaces/CMakeLists.txt2
-rw-r--r--ivi-layermanagement-examples/multi-touch-viewer/CMakeLists.txt2
-rw-r--r--ivi-layermanagement-examples/multi-touch-viewer/include/window.h9
-rw-r--r--ivi-layermanagement-examples/multi-touch-viewer/src/multi-touch-viewer.c72
-rw-r--r--ivi-layermanagement-examples/multi-touch-viewer/src/window.c9
-rw-r--r--ivi-layermanagement-examples/simple-weston-client/CMakeLists.txt17
-rw-r--r--ivi-layermanagement-examples/simple-weston-client/src/simple-weston-client.c52
-rw-r--r--protocol/CMakeLists.txt5
-rw-r--r--weston-ivi-shell/src/ivi-controller.c5
-rw-r--r--weston-ivi-shell/src/ivi-controller.h2
25 files changed, 167 insertions, 182 deletions
diff --git a/README b/README
index c188767..fba7797 100644
--- a/README
+++ b/README
@@ -46,17 +46,21 @@ Pre-requisite:
export LD_LIBRARY_PATH=<your installation path>/lib
Start-up Weston:
- Example: <your installation path>/bin/weston
+ Syntax: <your installation path>/bin/weston [wayland_display_to_listen_on]
+ Example: /usr/bin/weston -Swayland-1
Start-up HMI helper:
- Example: <your installation path>/bin/layer-add-surfaces 1000 1
+ Syntax: [wayland_display_to_connect_to] <your installation path>/bin/layer-add-surfaces <layer_id> <surface_count>
+ Example: WAYLAND_DISPLAY=wayland-1 $HOME/bin/layer-add-surfaces 1000 1
EGLWLMockNavigation:
- Example: <your installation path>/bin/EGLWLMockNavigation
+ Syntax: [wayland_display_to_connect_to] <your installation path>/bin/EGLWLMockNavigation
+ Example: WAYLAND_DISPLAY=wayland-1 $HOME/bin/EGLWLMockNavigation
How to test
====================================
1. Build the testsuite by setting BUILD_ILM_API_TESTS option.
Example: cmake -DBUILD_ILM_API_TESTS
2. After starting up Weston run the testsuite.
- Example: <your installation path>/bin/ivi-layermanagement-api-test
+ Syntax: [wayland_display_to_connect_to] <your installation path>/bin/ivi-layermanagement-api-test
+ Example: WAYLAND_DISPLAY=wayland-1 $HOME/bin/ivi-layermanagement-api-test
diff --git a/ivi-id-agent-modules/ivi-id-agent/CMakeLists.txt b/ivi-id-agent-modules/ivi-id-agent/CMakeLists.txt
index 3e604a5..3a1d9c6 100644
--- a/ivi-id-agent-modules/ivi-id-agent/CMakeLists.txt
+++ b/ivi-id-agent-modules/ivi-id-agent/CMakeLists.txt
@@ -25,7 +25,7 @@ find_package(PkgConfig REQUIRED)
pkg_check_modules(WAYLAND_SERVER wayland-server REQUIRED)
pkg_check_modules(WESTON weston>=6.0.0 REQUIRED)
pkg_check_modules(PIXMAN pixman-1 REQUIRED)
-pkg_check_modules(LIBWESTON_DESKTOP libweston-desktop-6 REQUIRED)
+pkg_check_modules(LIBWESTON_DESKTOP libweston-desktop-8 REQUIRED)
find_package(Threads REQUIRED)
@@ -39,6 +39,7 @@ include_directories(
link_directories(
${WAYLAND_SERVER_LIBRARY_DIRS}
${PIXMAN_LIBRARY_DIRS}
+ ${LIBWESTON_DESKTOP_LIBRARY_DIRS}
)
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
index 8f0c199..87df2a3 100644
--- 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
@@ -26,9 +26,9 @@
#include <limits.h>
#include <weston.h>
-#include <libweston-6/libweston-desktop.h>
-#include "config-parser.h"
-#include <weston/ivi-layout-export.h>
+#include <libweston-desktop/libweston-desktop.h>
+#include <libweston/config-parser.h>
+#include <ivi-layout-export.h>
#ifndef INVALID_ID
#define INVALID_ID 0xFFFFFFFF
@@ -365,8 +365,10 @@ 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) {
+ struct db_elem *db_elem, *dl_elem_next;
+ wl_list_for_each_safe(db_elem, dl_elem_next, &ida->app_list, link) {
+ wl_list_remove(&db_elem->link);
+
free(db_elem->cfg_app_id);
free(db_elem->cfg_title);
free(db_elem);
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 680f75d..82900dc 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
@@ -25,13 +25,13 @@
#include <string.h>
#include <weston.h>
-#include <weston/ivi-layout-export.h>
+#include <ivi-layout-export.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
-#include "plugin-registry.h"
+#include <libweston/plugin-registry.h>
#include "ilm_types.h"
#include "ivi-input-server-protocol.h"
@@ -934,18 +934,6 @@ destroy_seat(struct seat_ctx *ctx_seat)
{
struct ivisurface *surf;
struct wl_resource *resource;
- if (ctx_seat->keyboard_grab.keyboard) {
- keyboard_grab_cancel(&ctx_seat->keyboard_grab);
- weston_keyboard_end_grab(ctx_seat->keyboard_grab.keyboard);
- }
- if (ctx_seat->pointer_grab.pointer) {
- pointer_grab_cancel(&ctx_seat->pointer_grab);
- weston_pointer_end_grab(ctx_seat->pointer_grab.pointer);
- }
- if (ctx_seat->touch_grab.touch) {
- touch_grab_cancel(&ctx_seat->touch_grab);
- weston_touch_end_grab(ctx_seat->touch_grab.touch);
- }
/* Remove seat acceptance from surfaces which have input acceptance from
* this seat */
@@ -1088,17 +1076,19 @@ setup_input_focus(struct input_context *ctx, uint32_t surface,
if (NULL != surf) {
wl_list_for_each(st_focus, &surf->accepted_seat_list, link) {
ctx_seat = st_focus->seat_ctx;
- if (device & ILM_INPUT_DEVICE_POINTER) {
- input_ctrl_ptr_set_focus_surf(ctx_seat, surf, enabled);
- }
- if (device & ILM_INPUT_DEVICE_KEYBOARD) {
- input_ctrl_kbd_set_focus_surf(ctx_seat, surf, enabled);
- }
- if (device & ILM_INPUT_DEVICE_TOUCH) {
- /*Touch focus cannot be forced to a particular surface.
- * Preserve the old behaviour by sending it to controller.
- * TODO: Should we just remove focus setting for touch?*/
- send_input_focus(ctx, surf, device, enabled);
+ if (ctx_seat != NULL) {
+ if (device & ILM_INPUT_DEVICE_POINTER) {
+ input_ctrl_ptr_set_focus_surf(ctx_seat, surf, enabled);
+ }
+ if (device & ILM_INPUT_DEVICE_KEYBOARD) {
+ input_ctrl_kbd_set_focus_surf(ctx_seat, surf, enabled);
+ }
+ if (device & ILM_INPUT_DEVICE_TOUCH) {
+ /*Touch focus cannot be forced to a particular surface.
+ * Preserve the old behaviour by sending it to controller.
+ * TODO: Should we just remove focus setting for touch?*/
+ send_input_focus(ctx, surf, device, enabled);
+ }
}
}
}
diff --git a/ivi-layermanagement-api/ilmClient/include/ilm_client_platform.h b/ivi-layermanagement-api/ilmClient/include/ilm_client_platform.h
index 1fb10af..f281c3e 100644
--- a/ivi-layermanagement-api/ilmClient/include/ilm_client_platform.h
+++ b/ivi-layermanagement-api/ilmClient/include/ilm_client_platform.h
@@ -35,7 +35,7 @@ typedef struct _ILM_CLIENT_PLATFORM_FUNC
ilmErrorTypes (*destroy)();
} ILM_CLIENT_PLATFORM_FUNC;
-ILM_CLIENT_PLATFORM_FUNC gIlmClientPlatformFunc;
+extern ILM_CLIENT_PLATFORM_FUNC gIlmClientPlatformFunc;
void init_ilmClientPlatformTable();
diff --git a/ivi-layermanagement-api/ilmClient/src/ilm_client_wayland_platform.c b/ivi-layermanagement-api/ilmClient/src/ilm_client_wayland_platform.c
index 55b1621..12052f8 100644
--- a/ivi-layermanagement-api/ilmClient/src/ilm_client_wayland_platform.c
+++ b/ivi-layermanagement-api/ilmClient/src/ilm_client_wayland_platform.c
@@ -27,6 +27,8 @@
#include "wayland-util.h"
#include "ivi-application-client-protocol.h"
+ILM_CLIENT_PLATFORM_FUNC gIlmClientPlatformFunc;
+
static ilmErrorTypes wayland_surfaceCreate(t_ilm_nativehandle nativehandle,
t_ilm_int width, t_ilm_int height,
ilmPixelFormat pixelFormat,
diff --git a/ivi-layermanagement-api/ilmCommon/include/ilm_common_platform.h b/ivi-layermanagement-api/ilmCommon/include/ilm_common_platform.h
index 4e7b55e..ec49467 100644
--- a/ivi-layermanagement-api/ilmCommon/include/ilm_common_platform.h
+++ b/ivi-layermanagement-api/ilmCommon/include/ilm_common_platform.h
@@ -32,7 +32,7 @@ typedef struct _ILM_COMMON_PLATFORM_FUNC
ilmErrorTypes (*destroy)();
} ILM_COMMON_PLATFORM_FUNC;
-ILM_COMMON_PLATFORM_FUNC gIlmCommonPlatformFunc;
+extern ILM_COMMON_PLATFORM_FUNC gIlmCommonPlatformFunc;
void init_ilmCommonPlatformTable();
diff --git a/ivi-layermanagement-api/ilmCommon/src/ilm_common_wayland_platform.c b/ivi-layermanagement-api/ilmCommon/src/ilm_common_wayland_platform.c
index 7470d0d..eef842d 100644
--- a/ivi-layermanagement-api/ilmCommon/src/ilm_common_wayland_platform.c
+++ b/ivi-layermanagement-api/ilmCommon/src/ilm_common_wayland_platform.c
@@ -32,6 +32,8 @@ static t_ilm_nativedisplay wayland_getNativedisplay(void);
static t_ilm_bool wayland_isInitialized(void);
static ilmErrorTypes wayland_destroy(void);
+ILM_COMMON_PLATFORM_FUNC gIlmCommonPlatformFunc;
+
void init_ilmCommonPlatformTable(void)
{
gIlmCommonPlatformFunc.init = wayland_init;
diff --git a/ivi-layermanagement-api/ilmControl/CMakeLists.txt b/ivi-layermanagement-api/ilmControl/CMakeLists.txt
index f6bc551..b0e6b22 100644
--- a/ivi-layermanagement-api/ilmControl/CMakeLists.txt
+++ b/ivi-layermanagement-api/ilmControl/CMakeLists.txt
@@ -65,7 +65,7 @@ add_custom_command(
include_directories(
include
${ILM_COMMON_INCLUDE_DIRS}
- ${WAYLAND_CLIENT_INCLUDE_DIR}
+ ${WAYLAND_CLIENT_INCLUDE_DIRS}
${CMAKE_CURRENT_BINARY_DIR}
)
diff --git a/ivi-layermanagement-api/ilmControl/src/bitmap.c b/ivi-layermanagement-api/ilmControl/src/bitmap.c
index 79d2a5d..2bbe758 100644
--- a/ivi-layermanagement-api/ilmControl/src/bitmap.c
+++ b/ivi-layermanagement-api/ilmControl/src/bitmap.c
@@ -26,6 +26,7 @@
#include <stdbool.h>
#include <arpa/inet.h>
#include "ivi-wm-client-protocol.h"
+#include <endian.h>
struct __attribute__ ((__packed__)) BITMAPFILEHEADER {
char bfType[2];
diff --git a/ivi-layermanagement-api/ilmInput/CMakeLists.txt b/ivi-layermanagement-api/ilmInput/CMakeLists.txt
index b4c794c..f2ed324 100644
--- a/ivi-layermanagement-api/ilmInput/CMakeLists.txt
+++ b/ivi-layermanagement-api/ilmInput/CMakeLists.txt
@@ -50,7 +50,7 @@ include_directories(
include
${CMAKE_CURRENT_BINARY_DIR}
${ILM_CONTROL_INCLUDE_DIRS}
- ${WAYLAND_CLIENT_INCLUDE_DIR}
+ ${WAYLAND_CLIENT_INCLUDE_DIRS}
)
link_directories(
diff --git a/ivi-layermanagement-examples/EGLWLInputEventExample/CMakeLists.txt b/ivi-layermanagement-examples/EGLWLInputEventExample/CMakeLists.txt
index 76d8def..e8596e8 100644
--- a/ivi-layermanagement-examples/EGLWLInputEventExample/CMakeLists.txt
+++ b/ivi-layermanagement-examples/EGLWLInputEventExample/CMakeLists.txt
@@ -48,11 +48,11 @@ add_custom_command(
)
include_directories(
- ${GLESv2_INCLUDE_DIR}
- ${EGL_INCLUDE_DIR}
- ${WAYLAND_CLIENT_INCLUDE_DIR}
- ${WAYLAND_CURSOR_INCLUDE_DIR}
- ${FFI_INCLUDE_DIR}
+ ${GLESv2_INCLUDE_DIRS}
+ ${EGL_INCLUDE_DIRS}
+ ${WAYLAND_CLIENT_INCLUDE_DIRS}
+ ${WAYLAND_CURSOR_INCLUDE_DIRS}
+ ${FFI_INCLUDE_DIRS}
"include"
${CMAKE_CURRENT_BINARY_DIR}
)
diff --git a/ivi-layermanagement-examples/EGLWLInputEventExample/src/WLContext.cpp b/ivi-layermanagement-examples/EGLWLInputEventExample/src/WLContext.cpp
index ade58f0..edcbaff 100644
--- a/ivi-layermanagement-examples/EGLWLInputEventExample/src/WLContext.cpp
+++ b/ivi-layermanagement-examples/EGLWLInputEventExample/src/WLContext.cpp
@@ -64,6 +64,7 @@ WLContext::~WLContext()
* The following correspondences between file names and cursors was copied
* from: https://bugs.kde.org/attachment.cgi?id=67313
*/
+#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
static const char *left_ptrs[] = {
"left_ptr",
@@ -84,14 +85,13 @@ create_cursors(WLContext* wlContext)
fprintf(stderr, "could not load default theme\n");
return;
}
- wlContext->SetWLCursor((wl_cursor*) malloc(sizeof(wl_cursor)));
- for (j = 0; !cursor && j < 4; ++j)
+ for (j = 0; !cursor && j < ARRAY_SIZE(left_ptrs); ++j)
cursor = wl_cursor_theme_get_cursor(wlContext->GetWLCursorTheme(),
left_ptrs[j]);
if (!cursor)
- fprintf(stderr, "could not load cursor '%s'\n", left_ptrs[j]);
+ fprintf(stderr, "could not load any cursor\n");
wlContext->SetWLCursor(cursor);
}
@@ -170,11 +170,10 @@ WLContext::SeatHandleCapabilities(void* data, struct wl_seat* seat, uint32_t cap
context->ctx->SetPointerSurface(NULL);
}
- if (context->ctx->GetWLCursorTheme())
+ if (context->ctx->GetWLCursorTheme()){
wl_cursor_theme_destroy(context->ctx->GetWLCursorTheme());
-
- if (context->ctx->GetWLCursor())
- free(context->ctx->GetWLCursor());
+ context->ctx->SetWLCursor(NULL);
+ }
}
if ((caps & WL_SEAT_CAPABILITY_KEYBOARD) && !context->wlKeyboard){
@@ -235,11 +234,11 @@ WLContext::DestroyWLContext()
m_pointerSurface = NULL;
}
- if (m_wlCursorTheme)
+ if (m_wlCursorTheme){
wl_cursor_theme_destroy(m_wlCursorTheme);
-
- if (m_wlCursor)
- free(m_wlCursor);
+ m_wlCursorTheme = NULL;
+ m_wlCursor = NULL;
+ }
wl_registry_destroy(m_wlRegistry);
wl_display_flush(m_wlDisplay);
diff --git a/ivi-layermanagement-examples/LayerManagerControl/CMakeLists.txt b/ivi-layermanagement-examples/LayerManagerControl/CMakeLists.txt
index aeb3269..5a01682 100644
--- a/ivi-layermanagement-examples/LayerManagerControl/CMakeLists.txt
+++ b/ivi-layermanagement-examples/LayerManagerControl/CMakeLists.txt
@@ -24,7 +24,7 @@ include_directories(
"${CMAKE_SOURCE_DIR}/ivi-layermanagement-api/ilmCommon/include"
"${CMAKE_SOURCE_DIR}/ivi-layermanagement-api/ilmControl/include"
"${CMAKE_SOURCE_DIR}/ivi-layermanagement-api/ilmInput/include"
- ${WAYLAND_CLIENT_INCLUDE_DIR}
+ ${WAYLAND_CLIENT_INCLUDE_DIRS}
)
link_directories(
diff --git a/ivi-layermanagement-examples/LayerManagerControl/src/sceneio.cpp b/ivi-layermanagement-examples/LayerManagerControl/src/sceneio.cpp
index 6b11c3d..54ecbf1 100644
--- a/ivi-layermanagement-examples/LayerManagerControl/src/sceneio.cpp
+++ b/ivi-layermanagement-examples/LayerManagerControl/src/sceneio.cpp
@@ -175,67 +175,6 @@ void exportSceneToTXTHelper(ostream& stream, StringMapTree* tree, string prefix
stream << prefix + "}";
}
-string decodeEscapesequences(string s)
-{
- map<string, string> code;
- code["\\[\\]"] = "\\";
- code["\\[n]"] = "\n";
- code["\\[t]"] = "\t";
- code["\\[v]"] = "\v";
- code["\\[b]"] = "\b";
- code["\\[f]"] = "\f";
- code["\\[r]"] = "\r";
- return replaceAll(s, code);
-}
-
-void importSceneFromTXTHelper(istream& stream, StringMapTree* node)
-{
- string in;
- //Type
- getline(stream, in);
- int typeSize = in.find(":") - in.find_first_not_of('\t');
- int typeStart = in.find_first_not_of('\t');
- node->mNodeLabel = in.substr(typeStart, typeSize);
- while (true)
- {
- long streamPosition = stream.tellg();
- getline(stream, in);
- in = rtrim(in);
-
- //end of object
- if (in.substr(0, 1) == "}")
- return;
-
- //start of object property
- if (in.substr(0, 1) == "[")
- {
- int startIndex = in.find('[') + 1;
- int endIndex = in.find(":");
- string propertyName = in.substr(startIndex, endIndex - startIndex);
- propertyName = decodeEscapesequences(propertyName);
-
- startIndex = endIndex + 1;
- endIndex = in.find("]");
- string propertyType = in.substr(startIndex, endIndex - startIndex);
- propertyType = decodeEscapesequences(propertyType);
-
- startIndex = in.find('[', endIndex) + 1;
- endIndex = in.find_last_of(']');
- string propertyValue = in.substr(startIndex, endIndex - startIndex);
- propertyValue = decodeEscapesequences(propertyValue);
-
- node->mNodeValues[propertyName] = make_pair(propertyType, propertyValue);
- }
- else
- {
- stream.seekg(streamPosition);
- StringMapTree* child = new StringMapTree;
- node->mChildren.push_back(child);
- importSceneFromTXTHelper(stream, child);
- }
- }
-}
-
string makeValidXMLCharacters(string s)
{
map<string, string> code;
diff --git a/ivi-layermanagement-examples/layer-add-surfaces/CMakeLists.txt b/ivi-layermanagement-examples/layer-add-surfaces/CMakeLists.txt
index f846663..78db1af 100644
--- a/ivi-layermanagement-examples/layer-add-surfaces/CMakeLists.txt
+++ b/ivi-layermanagement-examples/layer-add-surfaces/CMakeLists.txt
@@ -24,7 +24,7 @@ include_directories(
"${CMAKE_SOURCE_DIR}/ivi-layermanagement-api/ilmCommon/include"
"${CMAKE_SOURCE_DIR}/ivi-layermanagement-api/ilmClient/include"
"${CMAKE_SOURCE_DIR}/ivi-layermanagement-api/ilmControl/include"
- ${WAYLAND_CLIENT_INCLUDE_DIR}
+ ${WAYLAND_CLIENT_INCLUDE_DIRS}
)
link_directories(
diff --git a/ivi-layermanagement-examples/multi-touch-viewer/CMakeLists.txt b/ivi-layermanagement-examples/multi-touch-viewer/CMakeLists.txt
index b9036bf..2d0acac 100644
--- a/ivi-layermanagement-examples/multi-touch-viewer/CMakeLists.txt
+++ b/ivi-layermanagement-examples/multi-touch-viewer/CMakeLists.txt
@@ -56,7 +56,7 @@ include_directories(
${CMAKE_CURRENT_BINARY_DIR}
${GLESv2_INCLUDE_DIRS}
${EGL_INCLUDE_DIRS}
- ${WAYLAND_CLIENT_INCLUDE_DIR}
+ ${WAYLAND_CLIENT_INCLUDE_DIRS}
)
link_directories(
diff --git a/ivi-layermanagement-examples/multi-touch-viewer/include/window.h b/ivi-layermanagement-examples/multi-touch-viewer/include/window.h
index 40e2925..d81dda6 100644
--- a/ivi-layermanagement-examples/multi-touch-viewer/include/window.h
+++ b/ivi-layermanagement-examples/multi-touch-viewer/include/window.h
@@ -46,6 +46,12 @@ struct Task
struct wl_list link;
};
+enum TypeOfShell
+{
+ WL_SHELL = 1,
+ IVI_SHELL = 2
+};
+
struct WaylandDisplay
{
struct Task display_task;
@@ -57,6 +63,7 @@ struct WaylandDisplay
EGLDisplay egldisplay;
EGLConfig eglconfig;
EGLContext eglcontext;
+ enum TypeOfShell shell_type;
int running;
int epoll_fd;
@@ -102,7 +109,7 @@ struct WaylandEglWindow
};
struct WaylandDisplay*
-CreateDisplay(int argc, char **argv);
+CreateDisplay(int argc, char **argv, enum TypeOfShell shell_type);
void
DestroyDisplay(struct WaylandDisplay *p_display);
diff --git a/ivi-layermanagement-examples/multi-touch-viewer/src/multi-touch-viewer.c b/ivi-layermanagement-examples/multi-touch-viewer/src/multi-touch-viewer.c
index 6645730..5d97ad4 100644
--- a/ivi-layermanagement-examples/multi-touch-viewer/src/multi-touch-viewer.c
+++ b/ivi-layermanagement-examples/multi-touch-viewer/src/multi-touch-viewer.c
@@ -30,6 +30,7 @@
#include <sys/stat.h>
#include <wayland-client-protocol.h>
#include "multi-touch-viewer.h"
+#include "getopt.h"
#define WINDOW_TITLE "multi_touch_viewer"
#define WINDOW_WIDTH 1080
@@ -69,6 +70,7 @@ static const char *gp_frag_shader_text =
static struct touch_event_test_params *gp_test_params = NULL;
static int g_is_print_log = 0;
+static enum TypeOfShell g_shell_type = IVI_SHELL;
/******************************************************************************/
@@ -587,7 +589,7 @@ setup_signal()
/******************************************************************************/
-int
+static int
touch_event_test_main(struct touch_event_test_params *p_params)
{
struct WaylandDisplay *p_display;
@@ -595,7 +597,7 @@ touch_event_test_main(struct touch_event_test_params *p_params)
setup_signal();
- p_display = CreateDisplay(0, NULL);
+ p_display = CreateDisplay(0, NULL, g_shell_type);
if (NULL == p_display)
{
LOG_ERROR("Failed to create display\n");
@@ -641,39 +643,65 @@ touch_event_test_main(struct touch_event_test_params *p_params)
return 0;
}
-void
+static void
usage(int status)
{
- printf("usage: multi-touch-viewer [OPTION]\n");
- printf(" -p : print received touch point\n");
+ fprintf(stderr, " -h, --help display this help and exit.\n"
+ " -p, --print-log print received touch point.\n"
+ " -s, --shell-type select the type of shell, default is the ivi_shell:\n"
+ " - wl_shell: to using the wl_shell.\n"
+ " - ivi_shell: to using the ivi_shell.\n");
exit(status);
}
-int
-main(int argc, char **argv)
+static void
+parse_options(int argc, char *argv[])
{
- _UNUSED_(argc);
- _UNUSED_(argv);
- struct touch_event_test_params params;
+ int opt = -1, option_index = 0;
+ static const struct option options[] = {
+ { "help", no_argument, NULL, 'h' },
+ { "print-log", no_argument, NULL, 'p' },
+ { "shell-type", required_argument, NULL, 's' },
+ { 0, 0, NULL, 0 }
+ };
- memset(&params, 0x00, sizeof params);
+ while (1) {
+ opt = getopt_long(argc, argv, "hps:", options, NULL);
- if (argc == 2)
- {
- if (0 == strcmp(argv[1], "-p"))
- {
- g_is_print_log = 1;
- }
- else
- {
- usage(EXIT_SUCCESS);
+ if (opt == -1)
+ break;
+
+ switch (opt) {
+ case 'h':
+ usage(0);
+ break;
+ case 'p':
+ g_is_print_log = 1;
+ break;
+ case 's':
+ if (strcmp(optarg, "wl_shell") == 0)
+ g_shell_type = WL_SHELL;
+ break;
+ default:
+ usage(-1);
+ break;
}
}
+ printf("multi-touch-viewer runs with %s and logging %s\n",
+ (g_shell_type == WL_SHELL) ? "wl_shell" : "ivi_shell",
+ (g_is_print_log == 1) ? "enable" : "disable");
+}
- gp_test_params = &params;
+int
+main(int argc, char **argv)
+{
+ parse_options(argc, argv);
- wl_list_init(&params.touch_point_list);
+ struct touch_event_test_params params;
+ memset(&params, 0x00, sizeof params);
+ gp_test_params = &params;
+ wl_list_init(&params.touch_point_list);
log_array_init(&params.log_array, 500);
return touch_event_test_main(&params);
diff --git a/ivi-layermanagement-examples/multi-touch-viewer/src/window.c b/ivi-layermanagement-examples/multi-touch-viewer/src/window.c
index 41b02a9..abd7788 100644
--- a/ivi-layermanagement-examples/multi-touch-viewer/src/window.c
+++ b/ivi-layermanagement-examples/multi-touch-viewer/src/window.c
@@ -79,12 +79,14 @@ registry_handle_global(void *p_data, struct wl_registry *p_registry,
p_display->p_compositor = wl_registry_bind(p_registry, id,
&wl_compositor_interface, 1);
}
- else if (0 == strcmp(p_interface, "wl_shell"))
+ else if ((0 == strcmp(p_interface, "wl_shell")) &&
+ (p_display->shell_type == WL_SHELL))
{
p_display->p_shell = wl_registry_bind(p_registry, id,
&wl_shell_interface, 1);
}
- else if (0 == strcmp(p_interface, "ivi_application"))
+ else if ((0 == strcmp(p_interface, "ivi_application")) &&
+ (p_display->shell_type == IVI_SHELL))
{
p_display->p_ivi_application = wl_registry_bind(p_registry, id,
&ivi_application_interface, 1);
@@ -500,7 +502,7 @@ DisplayAcquireWindowSurface(struct WaylandDisplay *p_display,
}
struct WaylandDisplay *
-CreateDisplay(int argc, char **argv)
+CreateDisplay(int argc, char **argv, enum TypeOfShell shell_type)
{
struct WaylandDisplay *p_display;
@@ -521,6 +523,7 @@ CreateDisplay(int argc, char **argv)
return NULL;
}
+ p_display->shell_type = shell_type;
p_display->epoll_fd = os_epoll_create_cloexec();
p_display->display_fd = wl_display_get_fd(p_display->p_display);
p_display->display_task.run = handle_display_data;
diff --git a/ivi-layermanagement-examples/simple-weston-client/CMakeLists.txt b/ivi-layermanagement-examples/simple-weston-client/CMakeLists.txt
index b34633e..d3bb616 100644
--- a/ivi-layermanagement-examples/simple-weston-client/CMakeLists.txt
+++ b/ivi-layermanagement-examples/simple-weston-client/CMakeLists.txt
@@ -22,14 +22,14 @@ project (simple-weston-client)
find_package(PkgConfig)
pkg_check_modules(WAYLAND_CLIENT wayland-client REQUIRED)
pkg_check_modules(WAYLAND_CURSOR wayland-cursor REQUIRED)
-pkg_check_modules(LIBWESTON_PROTOCOLS libweston-6-protocols QUIET)
+pkg_check_modules(LIBWESTON_PROTOCOLS libweston-8-protocols QUIET)
if(${LIBWESTON_PROTOCOLS_FOUND})
#check for DLT
- pkg_check_modules(DLT automotive-dlt REQUIRED)
+ pkg_check_modules(DLT automotive-dlt QUIET)
#import the pkgdatadir from libweston-protocols pkgconfig file
- execute_process(COMMAND ${PKG_CONFIG_EXECUTABLE} --variable=pkgdatadir libweston-6-protocols
+ execute_process(COMMAND ${PKG_CONFIG_EXECUTABLE} --variable=pkgdatadir libweston-8-protocols
OUTPUT_VARIABLE WestonProtocols_PKGDATADIR)
string(REGEX REPLACE "[\r\n]" "" WestonProtocols_PKGDATADIR "${WestonProtocols_PKGDATADIR}")
SET(LIBWESTON_PROTOCOLS_PKGDATADIR ${WestonProtocols_PKGDATADIR})
@@ -80,10 +80,10 @@ if(${LIBWESTON_PROTOCOLS_FOUND})
endif(${LIBWESTON_PROTOCOLS_FOUND})
include_directories(
- ${WAYLAND_CLIENT_INCLUDE_DIR}
- ${WAYLAND_CURSOR_INCLUDE_DIR}
+ ${WAYLAND_CLIENT_INCLUDE_DIRS}
+ ${WAYLAND_CURSOR_INCLUDE_DIRS}
${CMAKE_CURRENT_BINARY_DIR}
- ${DLT_INCLUDE_DIR}
+ ${DLT_INCLUDE_DIRS}
)
link_directories(
@@ -118,8 +118,13 @@ add_dependencies(${PROJECT_NAME} ${LIBS})
add_definitions(${DLT_CFLAGS})
+if(${DLT_FOUND})
+ add_definitions(-DDLT)
+endif(${DLT_FOUND})
+
if(${LIBWESTON_PROTOCOLS_FOUND})
add_definitions(-DLIBWESTON_DEBUG_PROTOCOL)
+ target_link_libraries(${PROJECT_NAME} pthread)
endif(${LIBWESTON_PROTOCOLS_FOUND})
target_link_libraries(${PROJECT_NAME} ${LIBS})
diff --git a/ivi-layermanagement-examples/simple-weston-client/src/simple-weston-client.c b/ivi-layermanagement-examples/simple-weston-client/src/simple-weston-client.c
index 6b77f01..1434c31 100644
--- a/ivi-layermanagement-examples/simple-weston-client/src/simple-weston-client.c
+++ b/ivi-layermanagement-examples/simple-weston-client/src/simple-weston-client.c
@@ -36,17 +36,18 @@
#include <ivi-application-client-protocol.h>
#ifdef LIBWESTON_DEBUG_PROTOCOL
-#include "dlt_common.h"
-#include "dlt_user.h"
#include "weston-debug-client-protocol.h"
+#define MAXSTRLEN 1024
+#endif
+
+#ifdef DLT
+#include "dlt.h"
#define WESTON_DLT_APP_DESC "messages from weston debug protocol"
#define WESTON_DLT_CONTEXT_DESC "weston debug context"
#define WESTON_DLT_APP "WESN"
#define WESTON_DLT_CONTEXT "WESC"
-
-#define MAXSTRLEN 1024
#endif
#ifndef MIN
@@ -98,6 +99,8 @@ struct debug_stream {
struct weston_debug_stream_v1 *obj;
};
+#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
+
static const char *left_ptrs[] = {
"left_ptr",
"default",
@@ -270,12 +273,12 @@ static int create_cursors(WaylandContextStruct* wlcontext) {
wlcontext->cursor = NULL;
- for (j = 0; !wlcontext->cursor && j < 4; ++j)
+ for (j = 0; !wlcontext->cursor && j < ARRAY_SIZE(left_ptrs); ++j)
wlcontext->cursor = wl_cursor_theme_get_cursor(wlcontext->cursor_theme, left_ptrs[j]);
if (!wlcontext->cursor)
{
- fprintf(stderr, "could not load cursor '%s'\n", left_ptrs[j]);
+ fprintf(stderr, "could not load any cursor\n");
return -1;
}
@@ -700,19 +703,19 @@ static void *
weston_dlt_thread_function(void *data)
{
WaylandContextStruct* wlcontext;
+
+#ifdef DLT
+ /*init dlt*/
char apid[DLT_ID_SIZE];
char ctid[DLT_ID_SIZE];
DLT_DECLARE_CONTEXT(weston_dlt_context)
-
- wlcontext = (WaylandContextStruct*)data;
-
- /*init dlt*/
dlt_set_id(apid, WESTON_DLT_APP);
dlt_set_id(ctid, WESTON_DLT_CONTEXT);
DLT_REGISTER_APP(apid, WESTON_DLT_APP_DESC);
DLT_REGISTER_CONTEXT(weston_dlt_context, ctid, WESTON_DLT_CONTEXT_DESC);
-
+#endif
+ wlcontext = (WaylandContextStruct*)data;
/*make the stdin as read end of the pipe*/
dup2(wlcontext->pipefd[0], STDIN_FILENO);
@@ -730,12 +733,19 @@ weston_dlt_thread_function(void *data)
if (strcmp(str,"")!=0)
{
+#ifdef DLT
DLT_LOG(weston_dlt_context, DLT_LOG_INFO, DLT_STRING(str));
+#else
+ fprintf(stderr,"%s",str);
+#endif
}
}
+#ifdef DLT
DLT_UNREGISTER_CONTEXT(weston_dlt_context);
DLT_UNREGISTER_APP();
+#endif
+
pthread_exit(NULL);
}
#endif
@@ -877,24 +887,8 @@ int main (int argc, const char * argv[])
Error:
#ifdef LIBWESTON_DEBUG_PROTOCOL
- weston_debug_v1_destroy(wlcontext->debug_iface);
-
- while (1) {
- struct debug_stream *stream;
- int empty = 1;
-
- wl_list_for_each(stream, &wlcontext->stream_list, link)
- if (stream->obj) {
- empty = 0;
- break;
- }
-
- if (empty)
- break;
-
- if (wl_display_dispatch(wlcontext->wl_display) < 0)
- break;
- }
+ if(wlcontext->debug_iface)
+ weston_debug_v1_destroy(wlcontext->debug_iface);
destroy_streams(wlcontext);
wl_display_roundtrip(wlcontext->wl_display);
diff --git a/protocol/CMakeLists.txt b/protocol/CMakeLists.txt
index 529f148..548c8ba 100644
--- a/protocol/CMakeLists.txt
+++ b/protocol/CMakeLists.txt
@@ -60,6 +60,11 @@ add_library(${PROJECT_NAME} SHARED
${CMAKE_CURRENT_BINARY_DIR}/ivi-application-protocol.c
)
+target_link_libraries (
+ ${PROJECT_NAME}
+ ${WAYLAND_CLIENT_LIBRARIES}
+)
+
set_target_properties(${PROJECT_NAME} PROPERTIES
COMPILE_FLAGS "-fPIC")
diff --git a/weston-ivi-shell/src/ivi-controller.c b/weston-ivi-shell/src/ivi-controller.c
index 28639a3..c27966a 100644
--- a/weston-ivi-shell/src/ivi-controller.c
+++ b/weston-ivi-shell/src/ivi-controller.c
@@ -87,6 +87,7 @@ struct screenshot_frame_listener {
struct wl_listener frame_listener;
struct wl_listener output_destroyed;
struct wl_resource *screenshot;
+ struct weston_output *output;
};
struct screen_id_info {
@@ -1260,7 +1261,7 @@ controller_screenshot_notify(struct wl_listener *listener, void *data)
struct screenshot_frame_listener *l =
wl_container_of(listener, l, frame_listener);
- struct weston_output *output = data;
+ struct weston_output *output = l->output;
int32_t width = 0;
int32_t height = 0;
int32_t stride = 0;
@@ -1404,6 +1405,8 @@ controller_screen_screenshot(struct wl_client *client,
return;
}
+ l->output = iviscrn->output;
+
wl_resource_set_implementation(l->screenshot, NULL, l,
screenshot_frame_listener_destroy);
l->output_destroyed.notify = screenshot_output_destroyed;
diff --git a/weston-ivi-shell/src/ivi-controller.h b/weston-ivi-shell/src/ivi-controller.h
index 00f5910..16dbe57 100644
--- a/weston-ivi-shell/src/ivi-controller.h
+++ b/weston-ivi-shell/src/ivi-controller.h
@@ -24,7 +24,7 @@
#define WESTON_IVI_SHELL_SRC_IVI_CONTROLLER_H_
#include "ivi-wm-server-protocol.h"
-#include <weston/ivi-layout-export.h>
+#include <ivi-layout-export.h>
/* Convert timespec to milliseconds
*