Merge lp:~sergiusens/frame/update into lp:frame/phablet

Proposed by Sergio Schvezov
Status: Merged
Approved by: Daniel d'Andrada
Approved revision: 112
Merged at revision: 111
Proposed branch: lp:~sergiusens/frame/update
Merge into: lp:frame/phablet
Diff against target: 835 lines (+288/-104)
33 files modified
configure.ac (+1/-1)
debian/changelog (+45/-0)
debian/copyright (+3/-4)
debian/libframe6.symbols (+3/-0)
include/oif/frame.h.in (+39/-2)
include/oif/frame_backend.h (+3/-0)
include/oif/frame_x11.h (+4/-2)
m4/gtest.m4 (+12/-4)
m4/xorg-gtest.m4 (+2/-31)
src/Makefile.am (+3/-2)
src/device.cpp (+28/-0)
src/device.h (+3/-0)
src/libframe.ver (+6/-0)
src/x11/device_x11.cpp (+12/-10)
src/x11/device_x11.h (+2/-2)
test/integration/events.cpp (+2/-3)
test/integration/events.h (+2/-3)
test/integration/x11/device.cpp (+2/-3)
test/integration/x11/dynamic_type_checking.cpp (+2/-3)
test/integration/x11/fixture.cpp (+2/-3)
test/integration/x11/fixture.h (+2/-3)
test/integration/x11/ids.cpp (+2/-3)
test/integration/x11/recording.cpp (+2/-3)
test/regular/Makefile.am (+2/-0)
test/regular/x11-accept-touch.cpp (+86/-0)
tools/Makefile.am (+4/-1)
tools/common/device.c (+2/-3)
tools/common/device.h (+2/-3)
tools/common/frame.c (+2/-3)
tools/common/frame.h (+2/-3)
tools/common/touch.c (+2/-3)
tools/common/touch.h (+2/-3)
tools/frame-test-x11.c (+2/-3)
To merge this branch: bzr merge lp:~sergiusens/frame/update
Reviewer Review Type Date Requested Status
Daniel d'Andrada (community) Approve
Review via email: mp+155024@code.launchpad.net

This proposal supersedes a proposal from 2013-03-22.

Commit message

Merging in trunk and bumping version

To post a comment you must log in.
Revision history for this message
Daniel d'Andrada (dandrader) wrote :

Looks fine.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'configure.ac'
--- configure.ac 2012-11-29 15:30:50 +0000
+++ configure.ac 2013-03-22 17:36:22 +0000
@@ -1,7 +1,7 @@
1# Initialize Autoconf1# Initialize Autoconf
2AC_PREREQ([2.60])2AC_PREREQ([2.60])
3AC_INIT([Touch Frame Library],3AC_INIT([Touch Frame Library],
4 [2.4.4],4 [2.5.0],
5 [],5 [],
6 [frame])6 [frame])
7AC_CONFIG_SRCDIR([Makefile.am])7AC_CONFIG_SRCDIR([Makefile.am])
88
=== modified file 'debian/changelog'
--- debian/changelog 2012-11-29 21:16:47 +0000
+++ debian/changelog 2013-03-22 17:36:22 +0000
@@ -1,3 +1,36 @@
1frame (2.5.0daily13.03.12-0ubuntu1phablet1) quantal; urgency=low
2
3 * Merging current branch into phablet series.
4
5 -- Sergio Schvezov <sergio.schvezov@canonical.com> Fri, 22 Mar 2013 13:25:22 -0300
6
7frame (2.5.0daily13.03.12-0ubuntu1) raring; urgency=low
8
9 [ Stephen M. Webb ]
10 * frame FTBFS out of source tree (LP: #1152741)
11
12 [ Ubuntu daily release ]
13 * Automatic snapshot from revision 119
14
15 -- Ubuntu daily release <ps-jenkins@lists.canonical.com> Tue, 12 Mar 2013 06:52:59 +0000
16
17frame (2.5.0daily12.12.13-0ubuntu1) raring; urgency=low
18
19 * Automatic snapshot from revision 117
20
21 -- Automatic PS uploader <ps-jenkins@lists.canonical.com> Thu, 13 Dec 2012 02:01:19 +0000
22
23frame (2.5.0daily12.12.07.1-0ubuntu1) raring; urgency=low
24
25 [ Daniel d'Andrada ]
26 * Relicense under (L)GPL version 3 *only* (no +)
27 * new: frame_accept_touch() and frame_reject_touch()
28
29 [ Automatic PS uploader ]
30 * Automatic snapshot from revision 115
31
32 -- Automatic PS uploader <ps-jenkins@lists.canonical.com> Fri, 07 Dec 2012 06:37:44 +0000
33
1frame (2.4.4phablet2) quantal; urgency=low34frame (2.4.4phablet2) quantal; urgency=low
235
3 * Bump for auto CI/land36 * Bump for auto CI/land
@@ -10,6 +43,18 @@
1043
11 -- Daniel d'Andrada <daniel.dandrada@canonical.com> Thu, 29 Nov 2012 13:56:37 -020044 -- Daniel d'Andrada <daniel.dandrada@canonical.com> Thu, 29 Nov 2012 13:56:37 -0200
1245
46frame (2.4.4daily12.12.04-0ubuntu1) raring; urgency=low
47
48 * Automatic snapshot from revision 110
49
50 -- Automatic PS uploader <ps-jenkins@lists.canonical.com> Tue, 04 Dec 2012 02:00:43 +0000
51
52frame (2.4.4daily12.12.03-0ubuntu1) raring; urgency=low
53
54 * Automatic snapshot from revision 108
55
56 -- Automatic PS uploader <ps-jenkins@lists.canonical.com> Mon, 03 Dec 2012 02:01:32 +0000
57
13frame (2.4.4daily12.11.29.1-0ubuntu1) raring; urgency=low58frame (2.4.4daily12.11.29.1-0ubuntu1) raring; urgency=low
1459
15 [ Robert Bruce Park ]60 [ Robert Bruce Park ]
1661
=== modified file 'debian/copyright'
--- debian/copyright 2012-11-22 22:16:27 +0000
+++ debian/copyright 2013-03-22 17:36:22 +0000
@@ -23,11 +23,10 @@
23Files: test/* tools/*23Files: test/* tools/*
24Copyright: 2010-2012, Canonical Ltd.24Copyright: 2010-2012, Canonical Ltd.
25 2010, Henrik Rydberg <rydberg@euromail.se>25 2010, Henrik Rydberg <rydberg@euromail.se>
26License: GPL-3+26License: GPL-3
27 This program is free software: you can redistribute it and/or modify27 This program is free software: you can redistribute it and/or modify
28 it under the terms of the GNU General Public License as published by28 it under the terms of the GNU General Public License version 3 as
29 the Free Software Foundation, either version 3 of the License, or29 published by the Free Software Foundation.
30 (at your option) any later version.
31 .30 .
32 This program is distributed in the hope that it will be useful,31 This program is distributed in the hope that it will be useful,
33 but WITHOUT ANY WARRANTY; without even the implied warranty of32 but WITHOUT ANY WARRANTY; without even the implied warranty of
3433
=== modified file 'debian/libframe6.symbols'
--- debian/libframe6.symbols 2012-11-29 16:05:53 +0000
+++ debian/libframe6.symbols 2013-03-22 17:36:22 +0000
@@ -1,6 +1,9 @@
1libframe.so.6 libframe6 #MINVER#1libframe.so.6 libframe6 #MINVER#
2 FRAME_2.2@FRAME_2.2 2.2.02 FRAME_2.2@FRAME_2.2 2.2.0
3 FRAME_2.4@FRAME_2.4 2.4.33 FRAME_2.4@FRAME_2.4 2.4.3
4 FRAME_2.5@FRAME_2.5 2.5.0
5 frame_accept_touch@FRAME_2.5 2.5.0
6 frame_reject_touch@FRAME_2.5 2.5.0
4 frame_axis_get_maximum@FRAME_2.2 2.2.47 frame_axis_get_maximum@FRAME_2.2 2.2.4
5 frame_axis_get_minimum@FRAME_2.2 2.2.48 frame_axis_get_minimum@FRAME_2.2 2.2.4
6 frame_axis_get_resolution@FRAME_2.2 2.2.49 frame_axis_get_resolution@FRAME_2.2 2.2.4
710
=== modified file 'include/oif/frame.h.in'
--- include/oif/frame.h.in 2012-11-20 14:13:20 +0000
+++ include/oif/frame.h.in 2013-03-22 17:36:22 +0000
@@ -2,7 +2,7 @@
2 *2 *
3 * frame - Touch Frame Library3 * frame - Touch Frame Library
4 *4 *
5 * Copyright (C) 2010-2012 Canonical Ltd.5 * Copyright (C) 2010-2013 Canonical Ltd.
6 *6 *
7 * This library is free software: you can redistribute it and/or modify it 7 * This library is free software: you can redistribute it and/or modify it
8 * under the terms of the GNU Lesser General Public License version 38 * under the terms of the GNU Lesser General Public License version 3
@@ -741,9 +741,46 @@
741FRAME_PUBLIC741FRAME_PUBLIC
742uint64_t frame_touch_get_start_time(UFTouch touch);742uint64_t frame_touch_get_start_time(UFTouch touch);
743743
744/**
745 * Accept ownership of a touch
746 *
747 * All touches received should be eventally accepted or rejected.
748 * This decision can come even after they have already ended but
749 * should be done as soon as possible.
750 *
751 * You should accept a touch when you're going to use it and
752 * reject it if you're not interested in it.
753 *
754 * Not all window servers have this concept. Those that do use
755 * this information to pass rejected touches forward to other
756 * clients that might want it.
757 *
758 * @param [in] device The device object for the touch (const)
759 * @param [in] window The window to accept the touch for
760 * @param [in] touch_id The touch ID object for the touch
761 * @return UFStatusSuccess, UFStatusErrorInvalidTouch
762 * @see frame_reject_touch
763 */
764FRAME_PUBLIC
765UFStatus frame_accept_touch(UFDevice device, UFWindowId window,
766 UFTouchId touch_id);
767
768/**
769 * Reject ownership of a touch
770 *
771 * @param [in] device The device object for the touch (const)
772 * @param [in] window The window to reject the touch for
773 * @param [in] touch_id The touch ID object for the touch
774 * @return UFStatusSuccess, UFStatusErrorInvalidTouch
775 * @see frame_accept_touch
776 */
777FRAME_PUBLIC
778UFStatus frame_reject_touch(UFDevice device, UFWindowId window,
779 UFTouchId touch_id);
780
744/** @} */781/** @} */
745782
746#include "frame_internal.h"783#include "oif/frame_internal.h"
747784
748#ifdef __cplusplus785#ifdef __cplusplus
749}786}
750787
=== modified file 'include/oif/frame_backend.h'
--- include/oif/frame_backend.h 2012-11-09 13:07:06 +0000
+++ include/oif/frame_backend.h 2013-03-22 17:36:22 +0000
@@ -151,6 +151,9 @@
151 *151 *
152 * Touches that had a "end" state on the given frame won't be present152 * Touches that had a "end" state on the given frame won't be present
153 * on the new frame.153 * on the new frame.
154 *
155 * The "ActiveTouches" property is automatically set to match the number
156 * of UFTouches present or remaining.
154 */157 */
155FRAME_PUBLIC158FRAME_PUBLIC
156UFBackendFrame frame_backend_frame_create_next(UFBackendFrame frame);159UFBackendFrame frame_backend_frame_create_next(UFBackendFrame frame);
157160
=== modified file 'include/oif/frame_x11.h'
--- include/oif/frame_x11.h 2012-07-24 21:36:05 +0000
+++ include/oif/frame_x11.h 2013-03-22 17:36:22 +0000
@@ -2,7 +2,7 @@
2 *2 *
3 * frame - Touch Frame Library3 * frame - Touch Frame Library
4 *4 *
5 * Copyright (C) 2010-2012 Canonical Ltd.5 * Copyright (C) 2010-2013 Canonical Ltd.
6 *6 *
7 * This library is free software: you can redistribute it and/or modify it 7 * This library is free software: you can redistribute it and/or modify it
8 * under the terms of the GNU Lesser General Public License version 38 * under the terms of the GNU Lesser General Public License version 3
@@ -21,7 +21,7 @@
21#ifndef FRAME_OIF_FRAME_X11_H_21#ifndef FRAME_OIF_FRAME_X11_H_
22#define FRAME_OIF_FRAME_X11_H_22#define FRAME_OIF_FRAME_X11_H_
2323
24#include "frame.h"24#include "oif/frame.h"
25#include <X11/Xlib.h>25#include <X11/Xlib.h>
2626
27#ifdef __cplusplus27#ifdef __cplusplus
@@ -71,6 +71,7 @@
71/**71/**
72 * Accept ownership of a touch72 * Accept ownership of a touch
73 *73 *
74 * @deprecated Use frame_accept_touch instead.
74 * @param [in] device The device object for the touch (const)75 * @param [in] device The device object for the touch (const)
75 * @param [in] window The window to accept the touch for76 * @param [in] window The window to accept the touch for
76 * @param [in] touch_id The touch ID object for the touch77 * @param [in] touch_id The touch ID object for the touch
@@ -83,6 +84,7 @@
83/**84/**
84 * Reject ownership of a touch85 * Reject ownership of a touch
85 *86 *
87 * @deprecated Use frame_reject_touch instead.
86 * @param [in] device The device object for the touch (const)88 * @param [in] device The device object for the touch (const)
87 * @param [in] window The window to reject the touch for89 * @param [in] window The window to reject the touch for
88 * @param [in] touch_id The touch ID object for the touch90 * @param [in] touch_id The touch ID object for the touch
8991
=== modified file 'm4/gtest.m4'
--- m4/gtest.m4 2012-07-18 12:28:56 +0000
+++ m4/gtest.m4 2013-03-22 17:36:22 +0000
@@ -38,10 +38,18 @@
3838
39 GTEST_CPPFLAGS="$GTEST_CPPFLAGS -I$GTEST_SOURCE"39 GTEST_CPPFLAGS="$GTEST_CPPFLAGS -I$GTEST_SOURCE"
4040
41 AC_CHECK_FILES([$GTEST_SOURCE/src/gtest-all.cc]41 AC_LANG_PUSH(C++)
42 [$GTEST_SOURCE/src/gtest_main.cc],42 gtest_save_CPPFLAGS=$CPPFLAGS
43 [have_gtest=yes],43 CPPFLAGS="$CPPFLAGS $GTEST_CPPFLAGS"
44 [have_gtest=no])44 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include "src/gtest-all.cc"]])],
45 [have_gtest=yes],
46 [have_gtest=no])
47 AS_IF([test "x$have_gtest" = xyes],
48 [AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include "src/gtest_main.cc"]])],
49 [],
50 [have_gtest=no])])
51 CPPFLAGS=$gtest_save_CPPFLAGS
52 AC_LANG_POP(C++)
4553
46 AS_IF([test "x$have_gtest" = xyes],54 AS_IF([test "x$have_gtest" = xyes],
47 [GTEST_LIBS=-lpthread55 [GTEST_LIBS=-lpthread
4856
=== modified file 'm4/xorg-gtest.m4'
--- m4/xorg-gtest.m4 2012-06-21 19:41:40 +0000
+++ m4/xorg-gtest.m4 2013-03-22 17:36:22 +0000
@@ -1,4 +1,4 @@
1# serial 21# serial 3
22
3# Copyright (C) 2012 Canonical, Ltd.3# Copyright (C) 2012 Canonical, Ltd.
4#4#
@@ -21,35 +21,6 @@
21# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE21# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22# SOFTWARE.22# SOFTWARE.
2323
24# Checks whether the gtest source is available on the system. Allows for
25# adjusting the include and source path. Sets have_gtest=yes if the source is
26# present. Sets GTEST_CPPFLAGS and GTEST_SOURCE to the preprocessor flags and
27# source location respectively.
28AC_DEFUN([_CHECK_GTEST],
29[
30 AC_ARG_WITH([gtest-source-path],
31 [AS_HELP_STRING([--with-gtest-source-path],
32 [location of the Google test sources, defaults to /usr/src/gtest])],
33 [GTEST_SOURCE="$withval"; GTEST_CPPFLAGS="-I$withval/include"],
34 [GTEST_SOURCE="/usr/src/gtest"])
35
36 AC_ARG_WITH([gtest-include-path],
37 [AS_HELP_STRING([--with-gtest-include-path],
38 [location of the Google test headers])],
39 [GTEST_CPPFLAGS="-I$withval"])
40
41 GTEST_CPPFLAGS="$GTEST_CPPFLAGS -I$GTEST_SOURCE"
42
43 AC_CHECK_FILES([$GTEST_SOURCE/src/gtest-all.cc]
44 [$GTEST_SOURCE/src/gtest_main.cc],
45 [have_gtest=yes],
46 [have_gtest=no])
47
48 AS_IF([test "x$have_gtest_source" = xyes],
49 [AC_SUBST(GTEST_CPPFLAGS)]
50 [AC_SUBST(GTEST_SOURCE)])
51]) # _CHECK_GTEST
52
53# CHECK_XORG_GTEST([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])24# CHECK_XORG_GTEST([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
54#25#
55# Checks whether the xorg-gtest source is available on the system. Allows for26# Checks whether the xorg-gtest source is available on the system. Allows for
@@ -61,7 +32,7 @@
61# Both default actions are no-ops.32# Both default actions are no-ops.
62AC_DEFUN([CHECK_XORG_GTEST],33AC_DEFUN([CHECK_XORG_GTEST],
63[34[
64 AC_REQUIRE([_CHECK_GTEST])35 AC_REQUIRE([CHECK_GTEST])
6536
66 PKG_CHECK_EXISTS([xorg-gtest],37 PKG_CHECK_EXISTS([xorg-gtest],
67 [have_xorg_gtest=yes],38 [have_xorg_gtest=yes],
6839
=== modified file 'src/Makefile.am'
--- src/Makefile.am 2012-11-20 14:13:20 +0000
+++ src/Makefile.am 2013-03-22 17:36:22 +0000
@@ -14,6 +14,7 @@
14 $(CXX_LIBS)14 $(CXX_LIBS)
1515
16AM_CPPFLAGS = \16AM_CPPFLAGS = \
17 -I$(top_builddir)/include \
17 -I$(top_srcdir)/include/ \18 -I$(top_srcdir)/include/ \
18 -I$(top_srcdir)/src \19 -I$(top_srcdir)/src \
19 $(WARNING_CPPFLAGS) \20 $(WARNING_CPPFLAGS) \
@@ -29,7 +30,7 @@
2930
30libframeincludedir = $(includedir)/oif31libframeincludedir = $(includedir)/oif
31libframeinclude_HEADERS = \32libframeinclude_HEADERS = \
32 $(top_srcdir)/include/oif/frame.h \33 $(top_builddir)/include/oif/frame.h \
33 $(top_srcdir)/include/oif/frame_backend.h \34 $(top_srcdir)/include/oif/frame_backend.h \
34 $(top_srcdir)/include/oif/frame_internal.h35 $(top_srcdir)/include/oif/frame_internal.h
3536
@@ -69,4 +70,4 @@
69 x11/window_x11.cpp70 x11/window_x11.cpp
70endif71endif
7172
72EXTRA_DIST = $(version_script)73EXTRA_DIST = $(version_script)
7374
=== modified file 'src/device.cpp'
--- src/device.cpp 2012-08-29 18:53:37 +0000
+++ src/device.cpp 2013-03-22 17:36:22 +0000
@@ -51,6 +51,20 @@
51 return UFStatusSuccess;51 return UFStatusSuccess;
52}52}
5353
54UFStatus UFDevice::AcceptTouch(UFWindowId window_id, UFTouchId touch_id)
55{
56 (void)window_id;
57 (void)touch_id;
58 return UFStatusSuccess;
59}
60
61UFStatus UFDevice::RejectTouch(UFWindowId window_id, UFTouchId touch_id)
62{
63 (void)window_id;
64 (void)touch_id;
65 return UFStatusSuccess;
66}
67
54} // namespace frame68} // namespace frame
55} // namespace oif69} // namespace oif
5670
@@ -143,6 +157,20 @@
143 return resolution;157 return resolution;
144}158}
145159
160UFStatus frame_accept_touch(UFDevice device, UFWindowId window_id,
161 UFTouchId touch_id)
162{
163 return static_cast<oif::frame::UFDevice*>(device)->
164 AcceptTouch(window_id, touch_id);
165}
166
167UFStatus frame_reject_touch(UFDevice device, UFWindowId window_id,
168 UFTouchId touch_id)
169{
170 return static_cast<oif::frame::UFDevice*>(device)->
171 RejectTouch(window_id, touch_id);
172}
173
146UFBackendDevice frame_backend_device_new()174UFBackendDevice frame_backend_device_new()
147{175{
148 return new UFBackendDevice_(new oif::frame::UFDevice);176 return new UFBackendDevice_(new oif::frame::UFDevice);
149177
=== modified file 'src/device.h'
--- src/device.h 2012-08-28 18:20:51 +0000
+++ src/device.h 2013-03-22 17:36:22 +0000
@@ -55,6 +55,9 @@
55 typedef std::unique_ptr<UFAxis> UniqueUFAxis;55 typedef std::unique_ptr<UFAxis> UniqueUFAxis;
5656
57 std::map<UFAxisType, UniqueUFAxis> axes_;57 std::map<UFAxisType, UniqueUFAxis> axes_;
58
59 virtual UFStatus AcceptTouch(UFWindowId window_id, UFTouchId touch_id);
60 virtual UFStatus RejectTouch(UFWindowId window_id, UFTouchId touch_id);
58};61};
5962
60} // namespace frame63} // namespace frame
6164
=== modified file 'src/libframe.ver'
--- src/libframe.ver 2012-11-26 19:55:29 +0000
+++ src/libframe.ver 2013-03-22 17:36:22 +0000
@@ -103,3 +103,9 @@
103 frame_event_set_frame;103 frame_event_set_frame;
104 frame_event_set_time;104 frame_event_set_time;
105} FRAME_2.2;105} FRAME_2.2;
106
107FRAME_2.5 {
108 global:
109 frame_accept_touch;
110 frame_reject_touch;
111} FRAME_2.4;
106112
=== modified file 'src/x11/device_x11.cpp'
--- src/x11/device_x11.cpp 2012-08-28 19:25:07 +0000
+++ src/x11/device_x11.cpp 2013-03-22 17:36:22 +0000
@@ -179,9 +179,10 @@
179 return false;179 return false;
180}180}
181181
182UFStatus UFDeviceX11::AcceptTouch(::Window window_id,182UFStatus UFDeviceX11::AcceptTouch(UFWindowId window_id,
183 UFTouchId touch_id) const {183 UFTouchId touch_id) {
184 auto it = windows_.find(window_id);184 ::Window x11_window_id = frame_x11_get_window_id(window_id);
185 auto it = windows_.find(x11_window_id);
185 if (it != windows_.end()) {186 if (it != windows_.end()) {
186 WindowX11* window = static_cast<WindowX11*>(it->second.get());187 WindowX11* window = static_cast<WindowX11*>(it->second.get());
187 return window->AcceptTouch(touch_id);188 return window->AcceptTouch(touch_id);
@@ -190,9 +191,10 @@
190 return UFStatusErrorInvalidTouch;191 return UFStatusErrorInvalidTouch;
191}192}
192193
193UFStatus UFDeviceX11::RejectTouch(::Window window_id,194UFStatus UFDeviceX11::RejectTouch(UFWindowId window_id,
194 UFTouchId touch_id) const {195 UFTouchId touch_id) {
195 auto it = windows_.find(window_id);196 ::Window x11_window_id = frame_x11_get_window_id(window_id);
197 auto it = windows_.find(x11_window_id);
196 if (it != windows_.end()) {198 if (it != windows_.end()) {
197 WindowX11* window = static_cast<WindowX11*>(it->second.get());199 WindowX11* window = static_cast<WindowX11*>(it->second.get());
198 return window->RejectTouch(touch_id);200 return window->RejectTouch(touch_id);
@@ -212,18 +214,18 @@
212214
213extern "C" {215extern "C" {
214216
215UFStatus frame_x11_accept_touch(UFDevice device, UFWindowId window,217UFStatus frame_x11_accept_touch(UFDevice device, UFWindowId window_id,
216 UFTouchId touch_id) {218 UFTouchId touch_id) {
217 oif::frame::UFDeviceX11* device_x11 =219 oif::frame::UFDeviceX11* device_x11 =
218 static_cast<oif::frame::UFDeviceX11*>(device);220 static_cast<oif::frame::UFDeviceX11*>(device);
219 return device_x11->AcceptTouch(frame_x11_get_window_id(window), touch_id);221 return device_x11->AcceptTouch(window_id, touch_id);
220}222}
221223
222UFStatus frame_x11_reject_touch(UFDevice device, UFWindowId window,224UFStatus frame_x11_reject_touch(UFDevice device, UFWindowId window_id,
223 UFTouchId touch_id) {225 UFTouchId touch_id) {
224 oif::frame::UFDeviceX11* device_x11 =226 oif::frame::UFDeviceX11* device_x11 =
225 static_cast<oif::frame::UFDeviceX11*>(device);227 static_cast<oif::frame::UFDeviceX11*>(device);
226 return device_x11->RejectTouch(frame_x11_get_window_id(window), touch_id);228 return device_x11->RejectTouch(window_id, touch_id);
227}229}
228230
229} // extern "C"231} // extern "C"
230232
=== modified file 'src/x11/device_x11.h'
--- src/x11/device_x11.h 2012-06-21 19:41:40 +0000
+++ src/x11/device_x11.h 2013-03-22 17:36:22 +0000
@@ -45,8 +45,8 @@
45 bool HandleDeviceEvent(const XIDeviceEvent* event, SharedUFFrame* frame);45 bool HandleDeviceEvent(const XIDeviceEvent* event, SharedUFFrame* frame);
46 bool HandleOwnershipEvent(const XITouchOwnershipEvent* event,46 bool HandleOwnershipEvent(const XITouchOwnershipEvent* event,
47 SharedUFFrame* frame);47 SharedUFFrame* frame);
48 UFStatus AcceptTouch(::Window window_id, UFTouchId touch_id) const;48 virtual UFStatus AcceptTouch(UFWindowId window_id, UFTouchId touch_id);
49 UFStatus RejectTouch(::Window window_id, UFTouchId touch_id) const;49 virtual UFStatus RejectTouch(UFWindowId window_id, UFTouchId touch_id);
50 void ReleaseFrames();50 void ReleaseFrames();
5151
52 UFDeviceX11(const UFDeviceX11&) = delete;52 UFDeviceX11(const UFDeviceX11&) = delete;
5353
=== modified file 'test/integration/events.cpp'
--- test/integration/events.cpp 2012-07-24 20:47:15 +0000
+++ test/integration/events.cpp 2013-03-22 17:36:22 +0000
@@ -5,9 +5,8 @@
5 * Copyright (C) 2011 Canonical Ltd.5 * Copyright (C) 2011 Canonical Ltd.
6 *6 *
7 * This program is free software: you can redistribute it and/or modify it7 * This program is free software: you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the8 * under the terms of the GNU General Public License version 3 as published
9 * Free Software Foundation, either version 3 of the License, or (at your9 * by the Free Software Foundation.
10 * option) any later version.
11 *10 *
12 * This program is distributed in the hope that it will be useful, but11 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of12 * WITHOUT ANY WARRANTY; without even the implied warranty of
1413
=== modified file 'test/integration/events.h'
--- test/integration/events.h 2012-07-24 20:47:15 +0000
+++ test/integration/events.h 2013-03-22 17:36:22 +0000
@@ -5,9 +5,8 @@
5 * Copyright (C) 2011 Canonical Ltd.5 * Copyright (C) 2011 Canonical Ltd.
6 *6 *
7 * This program is free software: you can redistribute it and/or modify it7 * This program is free software: you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the8 * under the terms of the GNU General Public License version 3 as published
9 * Free Software Foundation, either version 3 of the License, or (at your9 * by the Free Software Foundation.
10 * option) any later version.
11 *10 *
12 * This program is distributed in the hope that it will be useful, but11 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of12 * WITHOUT ANY WARRANTY; without even the implied warranty of
1413
=== modified file 'test/integration/x11/device.cpp'
--- test/integration/x11/device.cpp 2012-06-21 19:41:40 +0000
+++ test/integration/x11/device.cpp 2013-03-22 17:36:22 +0000
@@ -5,9 +5,8 @@
5 * Copyright (C) 2011 Canonical Ltd.5 * Copyright (C) 2011 Canonical Ltd.
6 *6 *
7 * This program is free software: you can redistribute it and/or modify it7 * This program is free software: you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the8 * under the terms of the GNU General Public License version 3 as published
9 * Free Software Foundation, either version 3 of the License, or (at your9 * by the Free Software Foundation.
10 * option) any later version.
11 *10 *
12 * This program is distributed in the hope that it will be useful, but11 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of12 * WITHOUT ANY WARRANTY; without even the implied warranty of
1413
=== modified file 'test/integration/x11/dynamic_type_checking.cpp'
--- test/integration/x11/dynamic_type_checking.cpp 2012-06-21 19:41:40 +0000
+++ test/integration/x11/dynamic_type_checking.cpp 2013-03-22 17:36:22 +0000
@@ -5,9 +5,8 @@
5 * Copyright (C) 2011 Canonical Ltd.5 * Copyright (C) 2011 Canonical Ltd.
6 *6 *
7 * This program is free software: you can redistribute it and/or modify it7 * This program is free software: you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the8 * under the terms of the GNU General Public License version 3 as published
9 * Free Software Foundation, either version 3 of the License, or (at your9 * by the Free Software Foundation.
10 * option) any later version.
11 *10 *
12 * This program is distributed in the hope that it will be useful, but11 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of12 * WITHOUT ANY WARRANTY; without even the implied warranty of
1413
=== modified file 'test/integration/x11/fixture.cpp'
--- test/integration/x11/fixture.cpp 2012-06-21 19:41:40 +0000
+++ test/integration/x11/fixture.cpp 2013-03-22 17:36:22 +0000
@@ -5,9 +5,8 @@
5 * Copyright (C) 2011 Canonical Ltd.5 * Copyright (C) 2011 Canonical Ltd.
6 *6 *
7 * This program is free software: you can redistribute it and/or modify it7 * This program is free software: you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the8 * under the terms of the GNU General Public License version 3 as published
9 * Free Software Foundation, either version 3 of the License, or (at your9 * by the Free Software Foundation.
10 * option) any later version.
11 *10 *
12 * This program is distributed in the hope that it will be useful, but11 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of12 * WITHOUT ANY WARRANTY; without even the implied warranty of
1413
=== modified file 'test/integration/x11/fixture.h'
--- test/integration/x11/fixture.h 2012-06-21 19:41:40 +0000
+++ test/integration/x11/fixture.h 2013-03-22 17:36:22 +0000
@@ -5,9 +5,8 @@
5 * Copyright (C) 2011 Canonical Ltd.5 * Copyright (C) 2011 Canonical Ltd.
6 *6 *
7 * This program is free software: you can redistribute it and/or modify it7 * This program is free software: you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the8 * under the terms of the GNU General Public License version 3 as published
9 * Free Software Foundation, either version 3 of the License, or (at your9 * by the Free Software Foundation.
10 * option) any later version.
11 *10 *
12 * This program is distributed in the hope that it will be useful, but11 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of12 * WITHOUT ANY WARRANTY; without even the implied warranty of
1413
=== modified file 'test/integration/x11/ids.cpp'
--- test/integration/x11/ids.cpp 2012-06-21 19:41:40 +0000
+++ test/integration/x11/ids.cpp 2013-03-22 17:36:22 +0000
@@ -5,9 +5,8 @@
5 * Copyright (C) 2011 Canonical Ltd.5 * Copyright (C) 2011 Canonical Ltd.
6 *6 *
7 * This program is free software: you can redistribute it and/or modify it7 * This program is free software: you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the8 * under the terms of the GNU General Public License version 3 as published
9 * Free Software Foundation, either version 3 of the License, or (at your9 * by the Free Software Foundation.
10 * option) any later version.
11 *10 *
12 * This program is distributed in the hope that it will be useful, but11 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of12 * WITHOUT ANY WARRANTY; without even the implied warranty of
1413
=== modified file 'test/integration/x11/recording.cpp'
--- test/integration/x11/recording.cpp 2012-06-21 19:41:40 +0000
+++ test/integration/x11/recording.cpp 2013-03-22 17:36:22 +0000
@@ -5,9 +5,8 @@
5 * Copyright (C) 2011 Canonical Ltd.5 * Copyright (C) 2011 Canonical Ltd.
6 *6 *
7 * This program is free software: you can redistribute it and/or modify it7 * This program is free software: you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the8 * under the terms of the GNU General Public License version 3 as published
9 * Free Software Foundation, either version 3 of the License, or (at your9 * by the Free Software Foundation.
10 * option) any later version.
11 *10 *
12 * This program is distributed in the hope that it will be useful, but11 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of12 * WITHOUT ANY WARRANTY; without even the implied warranty of
1413
=== modified file 'test/regular/Makefile.am'
--- test/regular/Makefile.am 2012-11-20 14:13:20 +0000
+++ test/regular/Makefile.am 2013-03-22 17:36:22 +0000
@@ -15,6 +15,7 @@
15 $(COVERAGE_CFLAGS)15 $(COVERAGE_CFLAGS)
1616
17AM_CPPFLAGS = \17AM_CPPFLAGS = \
18 -I$(top_builddir)/include \
18 -I$(top_srcdir)/include \19 -I$(top_srcdir)/include \
19 -iquote$(srcdir)20 -iquote$(srcdir)
2021
@@ -46,6 +47,7 @@
46if HAVE_XINPUT47if HAVE_XINPUT
47check_regular_SOURCES += \48check_regular_SOURCES += \
48 accept-ended-touch.cpp \49 accept-ended-touch.cpp \
50 x11-accept-touch.cpp \
49 frame-x11-fixture.cpp \51 frame-x11-fixture.cpp \
50 frame-x11-fixture.h52 frame-x11-fixture.h
51endif53endif
5254
=== added file 'test/regular/x11-accept-touch.cpp'
--- test/regular/x11-accept-touch.cpp 1970-01-01 00:00:00 +0000
+++ test/regular/x11-accept-touch.cpp 2013-03-22 17:36:22 +0000
@@ -0,0 +1,86 @@
1#include "frame-x11-fixture.h"
2#include "x11_mocks.h"
3
4class X11TouchAcceptance : public FrameX11Fixture
5{
6};
7
8/*
9 Calls frame_accept_touch and check if the corresponding X11 call is made
10 */
11TEST_F(X11TouchAcceptance, Accept)
12{
13 UFStatus status;
14 UFDevice device;
15
16 xmock_server_time = 1234;
17
18 CreateXMockTouchScreenDevice();
19
20 Display *display = XOpenDisplay(NULL);
21
22 status = frame_x11_new(display, &frame_handle);
23 ASSERT_EQ(UFStatusSuccess, status);
24
25 FetchDeviceAddedEvent(&device);
26 AssertNoMoreEvents();
27
28 SendTouchEvent(XI_TouchBegin, 1, 10.0f, 10.0f);
29 SendTouchOwnershipEvent(1);
30
31 UFWindowId frame_window_id = frame_x11_create_window_id(DefaultRootWindow(display));
32 status = frame_accept_touch(device, frame_window_id, 1);
33 ASSERT_EQ(UFStatusSuccess, status);
34
35 ASSERT_EQ(XIAcceptTouch,
36 xmock_get_touch_acceptance(xmock_devices[0].attachment /* device id */,
37 1 /* touch id */,
38 DefaultRootWindow(display)));
39
40 frame_x11_delete(frame_handle);
41 frame_handle = nullptr;
42
43 XCloseDisplay(display);
44
45 DestroyXMockDevices();
46}
47
48/*
49 Calls frame_reject_touch and check if the corresponding X11 call is made
50 */
51TEST_F(X11TouchAcceptance, Reject)
52{
53 UFStatus status;
54 UFDevice device;
55
56 xmock_server_time = 1234;
57
58 CreateXMockTouchScreenDevice();
59
60 Display *display = XOpenDisplay(NULL);
61
62 status = frame_x11_new(display, &frame_handle);
63 ASSERT_EQ(UFStatusSuccess, status);
64
65 FetchDeviceAddedEvent(&device);
66 AssertNoMoreEvents();
67
68 SendTouchEvent(XI_TouchBegin, 1, 10.0f, 10.0f);
69 SendTouchOwnershipEvent(1);
70
71 UFWindowId frame_window_id = frame_x11_create_window_id(DefaultRootWindow(display));
72 status = frame_reject_touch(device, frame_window_id, 1);
73 ASSERT_EQ(UFStatusSuccess, status);
74
75 ASSERT_EQ(XIRejectTouch,
76 xmock_get_touch_acceptance(xmock_devices[0].attachment /* device id */,
77 1 /* touch id */,
78 DefaultRootWindow(display)));
79
80 frame_x11_delete(frame_handle);
81 frame_handle = nullptr;
82
83 XCloseDisplay(display);
84
85 DestroyXMockDevices();
86}
087
=== modified file 'tools/Makefile.am'
--- tools/Makefile.am 2012-06-21 19:41:40 +0000
+++ tools/Makefile.am 2013-03-22 17:36:22 +0000
@@ -1,4 +1,7 @@
1AM_CPPFLAGS = -I$(top_srcdir)/include/ $(WARNING_CPPFLAGS)1AM_CPPFLAGS = \
2 -I$(top_builddir)/include \
3 -I$(top_srcdir)/include \
4 $(WARNING_CPPFLAGS)
25
3AM_CFLAGS = $(C11_CFLAGS) $(COVERAGE_CFLAGS)6AM_CFLAGS = $(C11_CFLAGS) $(COVERAGE_CFLAGS)
47
58
=== modified file 'tools/common/device.c'
--- tools/common/device.c 2012-06-21 19:41:40 +0000
+++ tools/common/device.c 2013-03-22 17:36:22 +0000
@@ -5,9 +5,8 @@
5 * Copyright (C) 2010-2011 Canonical Ltd.5 * Copyright (C) 2010-2011 Canonical Ltd.
6 *6 *
7 * This program is free software: you can redistribute it and/or modify it7 * This program is free software: you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the8 * under the terms of the GNU General Public License version 3 as published
9 * Free Software Foundation, either version 3 of the License, or (at your9 * by the Free Software Foundation.
10 * option) any later version.
11 *10 *
12 * This program is distributed in the hope that it will be useful, but11 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of12 * WITHOUT ANY WARRANTY; without even the implied warranty of
1413
=== modified file 'tools/common/device.h'
--- tools/common/device.h 2012-06-21 19:41:40 +0000
+++ tools/common/device.h 2013-03-22 17:36:22 +0000
@@ -5,9 +5,8 @@
5 * Copyright (C) 2010-2011 Canonical Ltd.5 * Copyright (C) 2010-2011 Canonical Ltd.
6 *6 *
7 * This program is free software: you can redistribute it and/or modify it7 * This program is free software: you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the8 * under the terms of the GNU General Public License version 3 as published
9 * Free Software Foundation, either version 3 of the License, or (at your9 * by the Free Software Foundation.
10 * option) any later version.
11 *10 *
12 * This program is distributed in the hope that it will be useful, but11 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of12 * WITHOUT ANY WARRANTY; without even the implied warranty of
1413
=== modified file 'tools/common/frame.c'
--- tools/common/frame.c 2012-06-21 19:41:40 +0000
+++ tools/common/frame.c 2013-03-22 17:36:22 +0000
@@ -5,9 +5,8 @@
5 * Copyright (C) 2010-2011 Canonical Ltd.5 * Copyright (C) 2010-2011 Canonical Ltd.
6 *6 *
7 * This program is free software: you can redistribute it and/or modify it7 * This program is free software: you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the8 * under the terms of the GNU General Public License version 3 as published
9 * Free Software Foundation, either version 3 of the License, or (at your9 * by the Free Software Foundation.
10 * option) any later version.
11 *10 *
12 * This program is distributed in the hope that it will be useful, but11 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of12 * WITHOUT ANY WARRANTY; without even the implied warranty of
1413
=== modified file 'tools/common/frame.h'
--- tools/common/frame.h 2012-06-21 19:41:40 +0000
+++ tools/common/frame.h 2013-03-22 17:36:22 +0000
@@ -5,9 +5,8 @@
5 * Copyright (C) 2010-2011 Canonical Ltd.5 * Copyright (C) 2010-2011 Canonical Ltd.
6 *6 *
7 * This program is free software: you can redistribute it and/or modify it7 * This program is free software: you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the8 * under the terms of the GNU General Public License version 3 as published
9 * Free Software Foundation, either version 3 of the License, or (at your9 * by the Free Software Foundation.
10 * option) any later version.
11 *10 *
12 * This program is distributed in the hope that it will be useful, but11 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of12 * WITHOUT ANY WARRANTY; without even the implied warranty of
1413
=== modified file 'tools/common/touch.c'
--- tools/common/touch.c 2012-06-21 19:41:40 +0000
+++ tools/common/touch.c 2013-03-22 17:36:22 +0000
@@ -5,9 +5,8 @@
5 * Copyright (C) 2010-2011 Canonical Ltd.5 * Copyright (C) 2010-2011 Canonical Ltd.
6 *6 *
7 * This program is free software: you can redistribute it and/or modify it7 * This program is free software: you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the8 * under the terms of the GNU General Public License version 3 as published
9 * Free Software Foundation, either version 3 of the License, or (at your9 * by the Free Software Foundation.
10 * option) any later version.
11 *10 *
12 * This program is distributed in the hope that it will be useful, but11 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of12 * WITHOUT ANY WARRANTY; without even the implied warranty of
1413
=== modified file 'tools/common/touch.h'
--- tools/common/touch.h 2012-06-21 19:41:40 +0000
+++ tools/common/touch.h 2013-03-22 17:36:22 +0000
@@ -5,9 +5,8 @@
5 * Copyright (C) 2010-2011 Canonical Ltd.5 * Copyright (C) 2010-2011 Canonical Ltd.
6 *6 *
7 * This program is free software: you can redistribute it and/or modify it7 * This program is free software: you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the8 * under the terms of the GNU General Public License version 3 as published
9 * Free Software Foundation, either version 3 of the License, or (at your9 * by the Free Software Foundation.
10 * option) any later version.
11 *10 *
12 * This program is distributed in the hope that it will be useful, but11 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of12 * WITHOUT ANY WARRANTY; without even the implied warranty of
1413
=== modified file 'tools/frame-test-x11.c'
--- tools/frame-test-x11.c 2012-06-21 19:41:40 +0000
+++ tools/frame-test-x11.c 2013-03-22 17:36:22 +0000
@@ -5,9 +5,8 @@
5 * Copyright (C) 2010-2011 Canonical Ltd.5 * Copyright (C) 2010-2011 Canonical Ltd.
6 *6 *
7 * This program is free software: you can redistribute it and/or modify it7 * This program is free software: you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the8 * under the terms of the GNU General Public License version 3 as published by
9 * Free Software Foundation, either version 3 of the License, or (at your9 * the Free Software Foundation.
10 * option) any later version.
11 *10 *
12 * This program is distributed in the hope that it will be useful, but11 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of12 * WITHOUT ANY WARRANTY; without even the implied warranty of

Subscribers

People subscribed via source and target branches