From aa224d89c13c08084e33bd4f45d7caeed30aafc0 Mon Sep 17 00:00:00 2001 From: Hayato Nakamura Date: Tue, 8 Oct 2013 10:22:25 +0900 Subject: [PATCH] Notice of the operation event to application except the application history flick operation at HomeScreen. Change-Id: I2152e60f19d65776c87acefce5dfd31044f6394a Signed-off-by: Hayato Nakamura --- configure.ac | 2 +- packaging/ico-uxf-weston-plugin.changes | 5 ++ packaging/ico-uxf-weston-plugin.spec | 2 +- protocol/ico_window_mgr.xml | 3 +- src/ico_input_mgr.c | 87 +++++++++++++++++++++++++++------ src/ico_window_mgr.c | 46 +++++++++++++++++ src/ico_window_mgr.h | 2 + tests/testdata/hs_inputtest.dat | 8 +-- 8 files changed, 132 insertions(+), 23 deletions(-) diff --git a/configure.ac b/configure.ac index 3715b44..db1d5d9 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,6 @@ AC_PREREQ([2.68]) AC_INIT([ico-uxf-weston-plugin], - [0.7.03], + [0.9.06], [https://BUG-REPORT-ADDRESS]) AC_CONFIG_HEADERS([config.h]) diff --git a/packaging/ico-uxf-weston-plugin.changes b/packaging/ico-uxf-weston-plugin.changes index 2f530c9..a984331 100644 --- a/packaging/ico-uxf-weston-plugin.changes +++ b/packaging/ico-uxf-weston-plugin.changes @@ -1,3 +1,8 @@ +* Tue Oct 08 2013 Shibata Makoto accepted/tizen/20131004.165200@60ccba2 +- 0.9.06 release. +-- addition: Notice of the operation event to application except the application history flick operation at HomeScreen. + + * Thu Sep 26 2013 Shibata Makoto accepted/tizen/20130919.204240@80cee2e - 0.9.05 release -- fix for - surface of the fullscreen is not displayed. diff --git a/packaging/ico-uxf-weston-plugin.spec b/packaging/ico-uxf-weston-plugin.spec index 04b15e5..e00ff9a 100644 --- a/packaging/ico-uxf-weston-plugin.spec +++ b/packaging/ico-uxf-weston-plugin.spec @@ -1,6 +1,6 @@ Name: ico-uxf-weston-plugin Summary: Weston Plugins for IVI -Version: 0.9.05 +Version: 0.9.06 Release: 1.1 Group: Graphics & UI Framework/Automotive UI License: MIT diff --git a/protocol/ico_window_mgr.xml b/protocol/ico_window_mgr.xml index 26ae3ac..7538eb6 100644 --- a/protocol/ico_window_mgr.xml +++ b/protocol/ico_window_mgr.xml @@ -11,8 +11,9 @@ - + + diff --git a/src/ico_input_mgr.c b/src/ico_input_mgr.c index 3aaea7f..178fd9a 100644 --- a/src/ico_input_mgr.c +++ b/src/ico_input_mgr.c @@ -447,11 +447,15 @@ ico_mgr_send_input_event(struct wl_client *client, struct wl_resource *resource, int event; /* event flag */ wl_fixed_t fix_x; /* wayland X coordinate */ wl_fixed_t fix_y; /* wayland Y coordinate */ + wl_fixed_t dx, dy; /* relative coordinate (dummy) */ + struct weston_surface *grabnew; /* new grab surface */ + struct weston_surface *grabsave; /* real grab surface */ int keyboard_active; /* keyborad active surface flag */ uifw_trace("ico_mgr_send_input_event: Enter(target=%s surf=%x dev=%d.%d " - "code=%x value=%d)", - target ? target : "(NULL)", surfaceid, type, deviceno, code, value); + "time=%d code=%x value=%d)", + target ? target : "(NULL)", surfaceid, type, deviceno, + time, code, value); /* search pseudo input device */ wl_list_for_each (dev, &pInputMgr->dev_list, link) { @@ -594,36 +598,85 @@ ico_mgr_send_input_event(struct wl_client *client, struct wl_resource *resource, if ((surfaceid == 0) && ((target == NULL) || (*target == 0) || (*target == ' '))) { /* send event to surface via weston */ - /* disable the event transmission to a touch layer */ - ico_window_mgr_restack_layer(NULL, TRUE); + /* disable the event transmission to a input layer */ + if (type == ICO_INPUT_MGR_DEVICE_TYPE_TOUCH) { + ico_window_mgr_input_layer(TRUE); + } + + if ((event == EVENT_TOUCH) && (pInputMgr->seat->touch == NULL)) { + /* system has no touch, change to pointer event */ + if (pInputMgr->seat->pointer == NULL) { + uifw_trace("ico_mgr_send_input_event: Leave(no touch & no pointerr)"); + return; + } + event = EVENT_BUTTON; + code = BTN_LEFT; + } + else if ((event == EVENT_BUTTON) && (pInputMgr->seat->pointer == NULL)) { + /* system has no pointer, change to touch event */ + if (pInputMgr->seat->touch == NULL) { + uifw_trace("ico_mgr_send_input_event: Leave(no touch & no pointerr)"); + return; + } + event = EVENT_TOUCH; + } switch (event) { case EVENT_MOTION: - if (type == ICO_INPUT_MGR_DEVICE_TYPE_TOUCH) { - uifw_trace("ico_mgr_send_input_event: notify_touch(%d,%d)", fix_x, fix_y); + if ((type == ICO_INPUT_MGR_DEVICE_TYPE_TOUCH) && + (pInputMgr->seat->touch)) { + uifw_trace("ico_mgr_send_input_event: notify_touch(MOTION=%d/%d)", + fix_x/256, fix_y/256); + grabsave = pInputMgr->seat->touch->focus; + weston_touch_set_focus(pInputMgr->seat, + weston_compositor_pick_surface( + pInputMgr->compositor, fix_x, fix_y, &dx, &dy)); notify_touch(pInputMgr->seat, ctime, 0, fix_x, fix_y, WL_TOUCH_MOTION); + weston_touch_set_focus(pInputMgr->seat, grabsave); } - else { - uifw_trace("ico_mgr_send_input_event: notify_motion_absolute(%d,%d)", - fix_x, fix_y); + else if (pInputMgr->seat->pointer) { + uifw_trace("ico_mgr_send_input_event: notify_motion_absolute(%d/%d)", + fix_x/256, fix_y/256); + grabsave = pInputMgr->seat->pointer->focus; + grabnew = weston_compositor_pick_surface( + pInputMgr->compositor, fix_x, fix_y, &dx, &dy); + weston_pointer_set_focus(pInputMgr->seat->pointer, grabnew, dx, dy); notify_motion_absolute(pInputMgr->seat, ctime, fix_x, fix_y); + weston_pointer_set_focus(pInputMgr->seat->pointer, grabsave, dx, dy); } break; case EVENT_BUTTON: uifw_trace("ico_mgr_send_input_event: notify_button(%d,%d)", code, value); - notify_button(pInputMgr->seat, ctime, code, - value ? WL_POINTER_BUTTON_STATE_PRESSED : - WL_POINTER_BUTTON_STATE_RELEASED); + if (pInputMgr->seat->pointer) { + grabsave = pInputMgr->seat->pointer->focus; + grabnew = weston_compositor_pick_surface( + pInputMgr->compositor, fix_x, fix_y, &dx, &dy); + weston_pointer_set_focus(pInputMgr->seat->pointer, grabnew, dx, dy); + notify_button(pInputMgr->seat, ctime, code, + value ? WL_POINTER_BUTTON_STATE_PRESSED : + WL_POINTER_BUTTON_STATE_RELEASED); + weston_pointer_set_focus(pInputMgr->seat->pointer, grabsave, dx, dy); + } break; case EVENT_TOUCH: if (value) { - uifw_trace("ico_mgr_send_input_event: notify_touch(%d,%d,DOWN)", - fix_x, fix_y); + uifw_trace("ico_mgr_send_input_event: notify_touch(DOWN=%d/%d)", + fix_x/256, fix_y/256); + grabsave = pInputMgr->seat->touch->focus; + weston_touch_set_focus(pInputMgr->seat, + weston_compositor_pick_surface( + pInputMgr->compositor, fix_x, fix_y, &dx, &dy)); notify_touch(pInputMgr->seat, ctime, 0, fix_x, fix_y, WL_TOUCH_DOWN); + weston_touch_set_focus(pInputMgr->seat, grabsave); } else { uifw_trace("ico_mgr_send_input_event: notify_touch(UP)"); + grabsave = pInputMgr->seat->touch->focus; + weston_touch_set_focus(pInputMgr->seat, + weston_compositor_pick_surface( + pInputMgr->compositor, fix_x, fix_y, &dx, &dy)); notify_touch(pInputMgr->seat, ctime, 0, 0, 0, WL_TOUCH_UP); + weston_touch_set_focus(pInputMgr->seat, grabsave); } break; case EVENT_KEY: @@ -636,8 +689,10 @@ ico_mgr_send_input_event(struct wl_client *client, struct wl_resource *resource, uifw_trace("ico_mgr_send_input_event: unknown event=%d", event); break; } - /* enable the event transmission to a touch layer */ - ico_window_mgr_restack_layer(NULL, FALSE); + /* enable the event transmission to a input layer */ + if (type == ICO_INPUT_MGR_DEVICE_TYPE_TOUCH) { + ico_window_mgr_input_layer(FALSE); + } } else { if ((target != NULL) && (*target != 0) && (*target != ' ')) { diff --git a/src/ico_window_mgr.c b/src/ico_window_mgr.c index fe97775..6ff4db3 100644 --- a/src/ico_window_mgr.c +++ b/src/ico_window_mgr.c @@ -147,6 +147,8 @@ struct ico_win_mgr { struct wl_list manager_list; /* Manager(ex.HomeScreen) list */ int num_manager; /* Number of managers */ struct wl_list ivi_layer_list; /* Layer management table list */ + struct uifw_win_layer *input_layer; /* layer table for input layer */ + struct uifw_win_layer *cursor_layer; /* layer table for cursor layer */ struct wl_list map_list; /* surface map list */ struct uifw_surface_map *free_maptable; /* free maped surface table list */ struct weston_animation map_animation[ICO_IVI_MAX_DISPLAY]; @@ -1257,6 +1259,42 @@ ico_window_mgr_restack_layer(struct uifw_win_surface *usurf, const int omit_touc /*--------------------------------------------------------------------------*/ /** + * @brief ico_window_mgr_input_layer: input layer control + * + * @param[in] omit omit input layer flag (TRUE=omit/FALSE=not omit) + * @return none + */ +/*--------------------------------------------------------------------------*/ +WL_EXPORT void +ico_window_mgr_input_layer(int omit) +{ + struct uifw_win_surface *eu; + + /* check current input layer mode */ + if ((_ico_win_mgr->input_layer == NULL) || + ((omit != FALSE) && (_ico_win_mgr->input_layer->visible == FALSE))) { + uifw_trace("ico_window_mgr_input_layer: input layer not exist or hide"); + return; + } + + wl_list_for_each (eu, &_ico_win_mgr->input_layer->surface_list, ivi_layer) { + if ((eu->surface == NULL) || (eu->mapped == 0)) continue; + + if (omit != FALSE) { + eu->animation.pos_x = (int)eu->surface->geometry.x; + eu->animation.pos_y = (int)eu->surface->geometry.y; + eu->surface->geometry.x = (float)(ICO_IVI_MAX_COORDINATE+1); + eu->surface->geometry.y = (float)(ICO_IVI_MAX_COORDINATE+1); + } + else { + eu->surface->geometry.x = (float)eu->animation.pos_x; + eu->surface->geometry.y = (float)eu->animation.pos_y; + } + } +} + +/*--------------------------------------------------------------------------*/ +/** * @brief win_mgr_create_layer: create new layer * * @param[in] usurf UIFW surface, (if need) @@ -1285,9 +1323,11 @@ win_mgr_create_layer(struct uifw_win_surface *usurf, const uint32_t layer) } else if ((int)layer == _ico_ivi_input_layer ) { new_el->layer_type = ICO_WINDOW_MGR_LAYER_TYPE_INPUT; + _ico_win_mgr->input_layer = new_el; } else if ((int)layer == _ico_ivi_cursor_layer ) { new_el->layer_type = ICO_WINDOW_MGR_LAYER_TYPE_CURSOR; + _ico_win_mgr->cursor_layer = new_el; } else { new_el->layer_type = ICO_WINDOW_MGR_LAYER_TYPE_NORMAL; @@ -1566,6 +1606,9 @@ uifw_set_window_layer(struct wl_client *client, struct wl_resource *resource, else if (layer == ICO_WINDOW_MGR_V_LAYER_CURSOR) { layer = _ico_ivi_cursor_layer; } + else if (layer == ICO_WINDOW_MGR_V_LAYER_STARTUP) { + layer = _ico_ivi_startup_layer; + } uifw_trace("uifw_set_window_layer: Enter res=%08x surfaceid=%08x layer=%d", (int)resource, surfaceid, layer); @@ -2206,6 +2249,9 @@ uifw_set_layer_visible(struct wl_client *client, struct wl_resource *resource, else if (layer == ICO_WINDOW_MGR_V_LAYER_CURSOR) { layer = _ico_ivi_cursor_layer; } + else if (layer == ICO_WINDOW_MGR_V_LAYER_STARTUP) { + layer = _ico_ivi_startup_layer; + } uifw_trace("uifw_set_layer_visible: Enter(layer=%d, visilbe=%d)", layer, visible); diff --git a/src/ico_window_mgr.h b/src/ico_window_mgr.h index 06a11bd..44b6a4e 100644 --- a/src/ico_window_mgr.h +++ b/src/ico_window_mgr.h @@ -217,6 +217,8 @@ struct uifw_win_surface *ico_window_mgr_get_usurf_client(const uint32_t surfacei struct uifw_win_surface *ico_window_mgr_get_client_usurf(const char *target); /* rebuild surface layer list */ void ico_window_mgr_restack_layer(struct uifw_win_surface *usurf, const int omit_touch); + /* input layer ccontrol for input manager*/ +void ico_window_mgr_input_layer(int omit); /* chek surface visibility */ int ico_window_mgr_is_visible(struct uifw_win_surface *usurf); /* set window animation hook */ diff --git a/tests/testdata/hs_inputtest.dat b/tests/testdata/hs_inputtest.dat index 53e3acb..040a99b 100644 --- a/tests/testdata/hs_inputtest.dat +++ b/tests/testdata/hs_inputtest.dat @@ -3,19 +3,19 @@ # # 1. Input test (touch each window) launch ../tests/test-client @1 -color=0xffff2020 -postsleep=90 < ../tests/testdata/cl_surface3.dat 2> ../tests/testlog/test-client1.log -sleep 0.5 +waitcreate 2 layer test-client@1 101 move test-client@1 100 200 show test-client@1 launch ../tests/test-client @2 -color=0xff20ff20 -postsleep=90 < ../tests/testdata/cl_surface3.dat 2> ../tests/testlog/test-client2.log -sleep 0.5 +waitcreate 2 layer test-client@2 101 move test-client@2 250 300 show test-client@2 launch ../tests/test-client @3 -color=0xff2020ff -postsleep=90 < ../tests/testdata/cl_surface3.dat 2> ../tests/testlog/test-client3.log -sleep 0.5 +waitcreate 2 layer test-client@3 101 move test-client@3 400 400 show test-client@3 @@ -107,7 +107,7 @@ kill test-client@1 sleep 0.5 # launch ../tests/test-client @1 -color=0xffff2020 -postsleep=90 < ../tests/testdata/cl_surface3.dat 2> ../tests/testlog/test-client4.log -sleep 0.5 +waitcreate 2 layer test-client@1 101 move test-client@1 100 200 show test-client@1 -- 2.7.4