diff options
21 files changed, 105 insertions, 73 deletions
diff --git a/ivi-id-agent-modules/ivi-id-agent/CMakeLists.txt b/ivi-id-agent-modules/ivi-id-agent/CMakeLists.txt index 3e604a5..d4fc24c 100644 --- a/ivi-id-agent-modules/ivi-id-agent/CMakeLists.txt +++ b/ivi-id-agent-modules/ivi-id-agent/CMakeLists.txt @@ -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..0c8b532 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 @@ -28,7 +28,7 @@ #include <weston.h> #include <libweston-6/libweston-desktop.h> #include "config-parser.h" -#include <weston/ivi-layout-export.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 b4d54d1..52fc6ab 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,7 +25,7 @@ #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> 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/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 dedb5a8..edcbaff 100644 --- a/ivi-layermanagement-examples/EGLWLInputEventExample/src/WLContext.cpp +++ b/ivi-layermanagement-examples/EGLWLInputEventExample/src/WLContext.cpp @@ -85,7 +85,6 @@ 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 < ARRAY_SIZE(left_ptrs); ++j) cursor = wl_cursor_theme_get_cursor(wlContext->GetWLCursorTheme(), @@ -171,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){ @@ -236,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/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(¶ms, 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 = ¶ms; +int +main(int argc, char **argv) +{ + parse_options(argc, argv); - wl_list_init(¶ms.touch_point_list); + struct touch_event_test_params params; + memset(¶ms, 0x00, sizeof params); + gp_test_params = ¶ms; + wl_list_init(¶ms.touch_point_list); log_array_init(¶ms.log_array, 500); return touch_event_test_main(¶ms); 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 0c4f5df..a324c84 100644 --- a/ivi-layermanagement-examples/simple-weston-client/CMakeLists.txt +++ b/ivi-layermanagement-examples/simple-weston-client/CMakeLists.txt @@ -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( 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 a0632c7..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 @@ -887,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.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 * |