Merge lp:~sergiusens/frame/update into lp:frame/phablet
- update
- Merge into phablet
Proposed by
Sergio Schvezov
on 2013-03-22
Status: | Merged |
---|---|
Approved by: | Daniel d'Andrada on 2013-03-25 |
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 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Daniel d'Andrada (community) | 2013-03-22 | Approve on 2013-03-25 | |
Review via email:
|
This proposal supersedes a proposal from 2013-03-22.
Commit message
Merging in trunk and bumping version
Description of the change
To post a comment you must log in.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'configure.ac' |
2 | --- configure.ac 2012-11-29 15:30:50 +0000 |
3 | +++ configure.ac 2013-03-22 17:36:22 +0000 |
4 | @@ -1,7 +1,7 @@ |
5 | # Initialize Autoconf |
6 | AC_PREREQ([2.60]) |
7 | AC_INIT([Touch Frame Library], |
8 | - [2.4.4], |
9 | + [2.5.0], |
10 | [], |
11 | [frame]) |
12 | AC_CONFIG_SRCDIR([Makefile.am]) |
13 | |
14 | === modified file 'debian/changelog' |
15 | --- debian/changelog 2012-11-29 21:16:47 +0000 |
16 | +++ debian/changelog 2013-03-22 17:36:22 +0000 |
17 | @@ -1,3 +1,36 @@ |
18 | +frame (2.5.0daily13.03.12-0ubuntu1phablet1) quantal; urgency=low |
19 | + |
20 | + * Merging current branch into phablet series. |
21 | + |
22 | + -- Sergio Schvezov <sergio.schvezov@canonical.com> Fri, 22 Mar 2013 13:25:22 -0300 |
23 | + |
24 | +frame (2.5.0daily13.03.12-0ubuntu1) raring; urgency=low |
25 | + |
26 | + [ Stephen M. Webb ] |
27 | + * frame FTBFS out of source tree (LP: #1152741) |
28 | + |
29 | + [ Ubuntu daily release ] |
30 | + * Automatic snapshot from revision 119 |
31 | + |
32 | + -- Ubuntu daily release <ps-jenkins@lists.canonical.com> Tue, 12 Mar 2013 06:52:59 +0000 |
33 | + |
34 | +frame (2.5.0daily12.12.13-0ubuntu1) raring; urgency=low |
35 | + |
36 | + * Automatic snapshot from revision 117 |
37 | + |
38 | + -- Automatic PS uploader <ps-jenkins@lists.canonical.com> Thu, 13 Dec 2012 02:01:19 +0000 |
39 | + |
40 | +frame (2.5.0daily12.12.07.1-0ubuntu1) raring; urgency=low |
41 | + |
42 | + [ Daniel d'Andrada ] |
43 | + * Relicense under (L)GPL version 3 *only* (no +) |
44 | + * new: frame_accept_touch() and frame_reject_touch() |
45 | + |
46 | + [ Automatic PS uploader ] |
47 | + * Automatic snapshot from revision 115 |
48 | + |
49 | + -- Automatic PS uploader <ps-jenkins@lists.canonical.com> Fri, 07 Dec 2012 06:37:44 +0000 |
50 | + |
51 | frame (2.4.4phablet2) quantal; urgency=low |
52 | |
53 | * Bump for auto CI/land |
54 | @@ -10,6 +43,18 @@ |
55 | |
56 | -- Daniel d'Andrada <daniel.dandrada@canonical.com> Thu, 29 Nov 2012 13:56:37 -0200 |
57 | |
58 | +frame (2.4.4daily12.12.04-0ubuntu1) raring; urgency=low |
59 | + |
60 | + * Automatic snapshot from revision 110 |
61 | + |
62 | + -- Automatic PS uploader <ps-jenkins@lists.canonical.com> Tue, 04 Dec 2012 02:00:43 +0000 |
63 | + |
64 | +frame (2.4.4daily12.12.03-0ubuntu1) raring; urgency=low |
65 | + |
66 | + * Automatic snapshot from revision 108 |
67 | + |
68 | + -- Automatic PS uploader <ps-jenkins@lists.canonical.com> Mon, 03 Dec 2012 02:01:32 +0000 |
69 | + |
70 | frame (2.4.4daily12.11.29.1-0ubuntu1) raring; urgency=low |
71 | |
72 | [ Robert Bruce Park ] |
73 | |
74 | === modified file 'debian/copyright' |
75 | --- debian/copyright 2012-11-22 22:16:27 +0000 |
76 | +++ debian/copyright 2013-03-22 17:36:22 +0000 |
77 | @@ -23,11 +23,10 @@ |
78 | Files: test/* tools/* |
79 | Copyright: 2010-2012, Canonical Ltd. |
80 | 2010, Henrik Rydberg <rydberg@euromail.se> |
81 | -License: GPL-3+ |
82 | +License: GPL-3 |
83 | This program is free software: you can redistribute it and/or modify |
84 | - it under the terms of the GNU General Public License as published by |
85 | - the Free Software Foundation, either version 3 of the License, or |
86 | - (at your option) any later version. |
87 | + it under the terms of the GNU General Public License version 3 as |
88 | + published by the Free Software Foundation. |
89 | . |
90 | This program is distributed in the hope that it will be useful, |
91 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
92 | |
93 | === modified file 'debian/libframe6.symbols' |
94 | --- debian/libframe6.symbols 2012-11-29 16:05:53 +0000 |
95 | +++ debian/libframe6.symbols 2013-03-22 17:36:22 +0000 |
96 | @@ -1,6 +1,9 @@ |
97 | libframe.so.6 libframe6 #MINVER# |
98 | FRAME_2.2@FRAME_2.2 2.2.0 |
99 | FRAME_2.4@FRAME_2.4 2.4.3 |
100 | + FRAME_2.5@FRAME_2.5 2.5.0 |
101 | + frame_accept_touch@FRAME_2.5 2.5.0 |
102 | + frame_reject_touch@FRAME_2.5 2.5.0 |
103 | frame_axis_get_maximum@FRAME_2.2 2.2.4 |
104 | frame_axis_get_minimum@FRAME_2.2 2.2.4 |
105 | frame_axis_get_resolution@FRAME_2.2 2.2.4 |
106 | |
107 | === modified file 'include/oif/frame.h.in' |
108 | --- include/oif/frame.h.in 2012-11-20 14:13:20 +0000 |
109 | +++ include/oif/frame.h.in 2013-03-22 17:36:22 +0000 |
110 | @@ -2,7 +2,7 @@ |
111 | * |
112 | * frame - Touch Frame Library |
113 | * |
114 | - * Copyright (C) 2010-2012 Canonical Ltd. |
115 | + * Copyright (C) 2010-2013 Canonical Ltd. |
116 | * |
117 | * This library is free software: you can redistribute it and/or modify it |
118 | * under the terms of the GNU Lesser General Public License version 3 |
119 | @@ -741,9 +741,46 @@ |
120 | FRAME_PUBLIC |
121 | uint64_t frame_touch_get_start_time(UFTouch touch); |
122 | |
123 | +/** |
124 | + * Accept ownership of a touch |
125 | + * |
126 | + * All touches received should be eventally accepted or rejected. |
127 | + * This decision can come even after they have already ended but |
128 | + * should be done as soon as possible. |
129 | + * |
130 | + * You should accept a touch when you're going to use it and |
131 | + * reject it if you're not interested in it. |
132 | + * |
133 | + * Not all window servers have this concept. Those that do use |
134 | + * this information to pass rejected touches forward to other |
135 | + * clients that might want it. |
136 | + * |
137 | + * @param [in] device The device object for the touch (const) |
138 | + * @param [in] window The window to accept the touch for |
139 | + * @param [in] touch_id The touch ID object for the touch |
140 | + * @return UFStatusSuccess, UFStatusErrorInvalidTouch |
141 | + * @see frame_reject_touch |
142 | + */ |
143 | +FRAME_PUBLIC |
144 | +UFStatus frame_accept_touch(UFDevice device, UFWindowId window, |
145 | + UFTouchId touch_id); |
146 | + |
147 | +/** |
148 | + * Reject ownership of a touch |
149 | + * |
150 | + * @param [in] device The device object for the touch (const) |
151 | + * @param [in] window The window to reject the touch for |
152 | + * @param [in] touch_id The touch ID object for the touch |
153 | + * @return UFStatusSuccess, UFStatusErrorInvalidTouch |
154 | + * @see frame_accept_touch |
155 | + */ |
156 | +FRAME_PUBLIC |
157 | +UFStatus frame_reject_touch(UFDevice device, UFWindowId window, |
158 | + UFTouchId touch_id); |
159 | + |
160 | /** @} */ |
161 | |
162 | -#include "frame_internal.h" |
163 | +#include "oif/frame_internal.h" |
164 | |
165 | #ifdef __cplusplus |
166 | } |
167 | |
168 | === modified file 'include/oif/frame_backend.h' |
169 | --- include/oif/frame_backend.h 2012-11-09 13:07:06 +0000 |
170 | +++ include/oif/frame_backend.h 2013-03-22 17:36:22 +0000 |
171 | @@ -151,6 +151,9 @@ |
172 | * |
173 | * Touches that had a "end" state on the given frame won't be present |
174 | * on the new frame. |
175 | + * |
176 | + * The "ActiveTouches" property is automatically set to match the number |
177 | + * of UFTouches present or remaining. |
178 | */ |
179 | FRAME_PUBLIC |
180 | UFBackendFrame frame_backend_frame_create_next(UFBackendFrame frame); |
181 | |
182 | === modified file 'include/oif/frame_x11.h' |
183 | --- include/oif/frame_x11.h 2012-07-24 21:36:05 +0000 |
184 | +++ include/oif/frame_x11.h 2013-03-22 17:36:22 +0000 |
185 | @@ -2,7 +2,7 @@ |
186 | * |
187 | * frame - Touch Frame Library |
188 | * |
189 | - * Copyright (C) 2010-2012 Canonical Ltd. |
190 | + * Copyright (C) 2010-2013 Canonical Ltd. |
191 | * |
192 | * This library is free software: you can redistribute it and/or modify it |
193 | * under the terms of the GNU Lesser General Public License version 3 |
194 | @@ -21,7 +21,7 @@ |
195 | #ifndef FRAME_OIF_FRAME_X11_H_ |
196 | #define FRAME_OIF_FRAME_X11_H_ |
197 | |
198 | -#include "frame.h" |
199 | +#include "oif/frame.h" |
200 | #include <X11/Xlib.h> |
201 | |
202 | #ifdef __cplusplus |
203 | @@ -71,6 +71,7 @@ |
204 | /** |
205 | * Accept ownership of a touch |
206 | * |
207 | + * @deprecated Use frame_accept_touch instead. |
208 | * @param [in] device The device object for the touch (const) |
209 | * @param [in] window The window to accept the touch for |
210 | * @param [in] touch_id The touch ID object for the touch |
211 | @@ -83,6 +84,7 @@ |
212 | /** |
213 | * Reject ownership of a touch |
214 | * |
215 | + * @deprecated Use frame_reject_touch instead. |
216 | * @param [in] device The device object for the touch (const) |
217 | * @param [in] window The window to reject the touch for |
218 | * @param [in] touch_id The touch ID object for the touch |
219 | |
220 | === modified file 'm4/gtest.m4' |
221 | --- m4/gtest.m4 2012-07-18 12:28:56 +0000 |
222 | +++ m4/gtest.m4 2013-03-22 17:36:22 +0000 |
223 | @@ -38,10 +38,18 @@ |
224 | |
225 | GTEST_CPPFLAGS="$GTEST_CPPFLAGS -I$GTEST_SOURCE" |
226 | |
227 | - AC_CHECK_FILES([$GTEST_SOURCE/src/gtest-all.cc] |
228 | - [$GTEST_SOURCE/src/gtest_main.cc], |
229 | - [have_gtest=yes], |
230 | - [have_gtest=no]) |
231 | + AC_LANG_PUSH(C++) |
232 | + gtest_save_CPPFLAGS=$CPPFLAGS |
233 | + CPPFLAGS="$CPPFLAGS $GTEST_CPPFLAGS" |
234 | + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include "src/gtest-all.cc"]])], |
235 | + [have_gtest=yes], |
236 | + [have_gtest=no]) |
237 | + AS_IF([test "x$have_gtest" = xyes], |
238 | + [AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include "src/gtest_main.cc"]])], |
239 | + [], |
240 | + [have_gtest=no])]) |
241 | + CPPFLAGS=$gtest_save_CPPFLAGS |
242 | + AC_LANG_POP(C++) |
243 | |
244 | AS_IF([test "x$have_gtest" = xyes], |
245 | [GTEST_LIBS=-lpthread |
246 | |
247 | === modified file 'm4/xorg-gtest.m4' |
248 | --- m4/xorg-gtest.m4 2012-06-21 19:41:40 +0000 |
249 | +++ m4/xorg-gtest.m4 2013-03-22 17:36:22 +0000 |
250 | @@ -1,4 +1,4 @@ |
251 | -# serial 2 |
252 | +# serial 3 |
253 | |
254 | # Copyright (C) 2012 Canonical, Ltd. |
255 | # |
256 | @@ -21,35 +21,6 @@ |
257 | # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE |
258 | # SOFTWARE. |
259 | |
260 | -# Checks whether the gtest source is available on the system. Allows for |
261 | -# adjusting the include and source path. Sets have_gtest=yes if the source is |
262 | -# present. Sets GTEST_CPPFLAGS and GTEST_SOURCE to the preprocessor flags and |
263 | -# source location respectively. |
264 | -AC_DEFUN([_CHECK_GTEST], |
265 | -[ |
266 | - AC_ARG_WITH([gtest-source-path], |
267 | - [AS_HELP_STRING([--with-gtest-source-path], |
268 | - [location of the Google test sources, defaults to /usr/src/gtest])], |
269 | - [GTEST_SOURCE="$withval"; GTEST_CPPFLAGS="-I$withval/include"], |
270 | - [GTEST_SOURCE="/usr/src/gtest"]) |
271 | - |
272 | - AC_ARG_WITH([gtest-include-path], |
273 | - [AS_HELP_STRING([--with-gtest-include-path], |
274 | - [location of the Google test headers])], |
275 | - [GTEST_CPPFLAGS="-I$withval"]) |
276 | - |
277 | - GTEST_CPPFLAGS="$GTEST_CPPFLAGS -I$GTEST_SOURCE" |
278 | - |
279 | - AC_CHECK_FILES([$GTEST_SOURCE/src/gtest-all.cc] |
280 | - [$GTEST_SOURCE/src/gtest_main.cc], |
281 | - [have_gtest=yes], |
282 | - [have_gtest=no]) |
283 | - |
284 | - AS_IF([test "x$have_gtest_source" = xyes], |
285 | - [AC_SUBST(GTEST_CPPFLAGS)] |
286 | - [AC_SUBST(GTEST_SOURCE)]) |
287 | -]) # _CHECK_GTEST |
288 | - |
289 | # CHECK_XORG_GTEST([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) |
290 | # |
291 | # Checks whether the xorg-gtest source is available on the system. Allows for |
292 | @@ -61,7 +32,7 @@ |
293 | # Both default actions are no-ops. |
294 | AC_DEFUN([CHECK_XORG_GTEST], |
295 | [ |
296 | - AC_REQUIRE([_CHECK_GTEST]) |
297 | + AC_REQUIRE([CHECK_GTEST]) |
298 | |
299 | PKG_CHECK_EXISTS([xorg-gtest], |
300 | [have_xorg_gtest=yes], |
301 | |
302 | === modified file 'src/Makefile.am' |
303 | --- src/Makefile.am 2012-11-20 14:13:20 +0000 |
304 | +++ src/Makefile.am 2013-03-22 17:36:22 +0000 |
305 | @@ -14,6 +14,7 @@ |
306 | $(CXX_LIBS) |
307 | |
308 | AM_CPPFLAGS = \ |
309 | + -I$(top_builddir)/include \ |
310 | -I$(top_srcdir)/include/ \ |
311 | -I$(top_srcdir)/src \ |
312 | $(WARNING_CPPFLAGS) \ |
313 | @@ -29,7 +30,7 @@ |
314 | |
315 | libframeincludedir = $(includedir)/oif |
316 | libframeinclude_HEADERS = \ |
317 | - $(top_srcdir)/include/oif/frame.h \ |
318 | + $(top_builddir)/include/oif/frame.h \ |
319 | $(top_srcdir)/include/oif/frame_backend.h \ |
320 | $(top_srcdir)/include/oif/frame_internal.h |
321 | |
322 | @@ -69,4 +70,4 @@ |
323 | x11/window_x11.cpp |
324 | endif |
325 | |
326 | -EXTRA_DIST = $(version_script) |
327 | +EXTRA_DIST = $(version_script) |
328 | |
329 | === modified file 'src/device.cpp' |
330 | --- src/device.cpp 2012-08-29 18:53:37 +0000 |
331 | +++ src/device.cpp 2013-03-22 17:36:22 +0000 |
332 | @@ -51,6 +51,20 @@ |
333 | return UFStatusSuccess; |
334 | } |
335 | |
336 | +UFStatus UFDevice::AcceptTouch(UFWindowId window_id, UFTouchId touch_id) |
337 | +{ |
338 | + (void)window_id; |
339 | + (void)touch_id; |
340 | + return UFStatusSuccess; |
341 | +} |
342 | + |
343 | +UFStatus UFDevice::RejectTouch(UFWindowId window_id, UFTouchId touch_id) |
344 | +{ |
345 | + (void)window_id; |
346 | + (void)touch_id; |
347 | + return UFStatusSuccess; |
348 | +} |
349 | + |
350 | } // namespace frame |
351 | } // namespace oif |
352 | |
353 | @@ -143,6 +157,20 @@ |
354 | return resolution; |
355 | } |
356 | |
357 | +UFStatus frame_accept_touch(UFDevice device, UFWindowId window_id, |
358 | + UFTouchId touch_id) |
359 | +{ |
360 | + return static_cast<oif::frame::UFDevice*>(device)-> |
361 | + AcceptTouch(window_id, touch_id); |
362 | +} |
363 | + |
364 | +UFStatus frame_reject_touch(UFDevice device, UFWindowId window_id, |
365 | + UFTouchId touch_id) |
366 | +{ |
367 | + return static_cast<oif::frame::UFDevice*>(device)-> |
368 | + RejectTouch(window_id, touch_id); |
369 | +} |
370 | + |
371 | UFBackendDevice frame_backend_device_new() |
372 | { |
373 | return new UFBackendDevice_(new oif::frame::UFDevice); |
374 | |
375 | === modified file 'src/device.h' |
376 | --- src/device.h 2012-08-28 18:20:51 +0000 |
377 | +++ src/device.h 2013-03-22 17:36:22 +0000 |
378 | @@ -55,6 +55,9 @@ |
379 | typedef std::unique_ptr<UFAxis> UniqueUFAxis; |
380 | |
381 | std::map<UFAxisType, UniqueUFAxis> axes_; |
382 | + |
383 | + virtual UFStatus AcceptTouch(UFWindowId window_id, UFTouchId touch_id); |
384 | + virtual UFStatus RejectTouch(UFWindowId window_id, UFTouchId touch_id); |
385 | }; |
386 | |
387 | } // namespace frame |
388 | |
389 | === modified file 'src/libframe.ver' |
390 | --- src/libframe.ver 2012-11-26 19:55:29 +0000 |
391 | +++ src/libframe.ver 2013-03-22 17:36:22 +0000 |
392 | @@ -103,3 +103,9 @@ |
393 | frame_event_set_frame; |
394 | frame_event_set_time; |
395 | } FRAME_2.2; |
396 | + |
397 | +FRAME_2.5 { |
398 | + global: |
399 | + frame_accept_touch; |
400 | + frame_reject_touch; |
401 | +} FRAME_2.4; |
402 | |
403 | === modified file 'src/x11/device_x11.cpp' |
404 | --- src/x11/device_x11.cpp 2012-08-28 19:25:07 +0000 |
405 | +++ src/x11/device_x11.cpp 2013-03-22 17:36:22 +0000 |
406 | @@ -179,9 +179,10 @@ |
407 | return false; |
408 | } |
409 | |
410 | -UFStatus UFDeviceX11::AcceptTouch(::Window window_id, |
411 | - UFTouchId touch_id) const { |
412 | - auto it = windows_.find(window_id); |
413 | +UFStatus UFDeviceX11::AcceptTouch(UFWindowId window_id, |
414 | + UFTouchId touch_id) { |
415 | + ::Window x11_window_id = frame_x11_get_window_id(window_id); |
416 | + auto it = windows_.find(x11_window_id); |
417 | if (it != windows_.end()) { |
418 | WindowX11* window = static_cast<WindowX11*>(it->second.get()); |
419 | return window->AcceptTouch(touch_id); |
420 | @@ -190,9 +191,10 @@ |
421 | return UFStatusErrorInvalidTouch; |
422 | } |
423 | |
424 | -UFStatus UFDeviceX11::RejectTouch(::Window window_id, |
425 | - UFTouchId touch_id) const { |
426 | - auto it = windows_.find(window_id); |
427 | +UFStatus UFDeviceX11::RejectTouch(UFWindowId window_id, |
428 | + UFTouchId touch_id) { |
429 | + ::Window x11_window_id = frame_x11_get_window_id(window_id); |
430 | + auto it = windows_.find(x11_window_id); |
431 | if (it != windows_.end()) { |
432 | WindowX11* window = static_cast<WindowX11*>(it->second.get()); |
433 | return window->RejectTouch(touch_id); |
434 | @@ -212,18 +214,18 @@ |
435 | |
436 | extern "C" { |
437 | |
438 | -UFStatus frame_x11_accept_touch(UFDevice device, UFWindowId window, |
439 | +UFStatus frame_x11_accept_touch(UFDevice device, UFWindowId window_id, |
440 | UFTouchId touch_id) { |
441 | oif::frame::UFDeviceX11* device_x11 = |
442 | static_cast<oif::frame::UFDeviceX11*>(device); |
443 | - return device_x11->AcceptTouch(frame_x11_get_window_id(window), touch_id); |
444 | + return device_x11->AcceptTouch(window_id, touch_id); |
445 | } |
446 | |
447 | -UFStatus frame_x11_reject_touch(UFDevice device, UFWindowId window, |
448 | +UFStatus frame_x11_reject_touch(UFDevice device, UFWindowId window_id, |
449 | UFTouchId touch_id) { |
450 | oif::frame::UFDeviceX11* device_x11 = |
451 | static_cast<oif::frame::UFDeviceX11*>(device); |
452 | - return device_x11->RejectTouch(frame_x11_get_window_id(window), touch_id); |
453 | + return device_x11->RejectTouch(window_id, touch_id); |
454 | } |
455 | |
456 | } // extern "C" |
457 | |
458 | === modified file 'src/x11/device_x11.h' |
459 | --- src/x11/device_x11.h 2012-06-21 19:41:40 +0000 |
460 | +++ src/x11/device_x11.h 2013-03-22 17:36:22 +0000 |
461 | @@ -45,8 +45,8 @@ |
462 | bool HandleDeviceEvent(const XIDeviceEvent* event, SharedUFFrame* frame); |
463 | bool HandleOwnershipEvent(const XITouchOwnershipEvent* event, |
464 | SharedUFFrame* frame); |
465 | - UFStatus AcceptTouch(::Window window_id, UFTouchId touch_id) const; |
466 | - UFStatus RejectTouch(::Window window_id, UFTouchId touch_id) const; |
467 | + virtual UFStatus AcceptTouch(UFWindowId window_id, UFTouchId touch_id); |
468 | + virtual UFStatus RejectTouch(UFWindowId window_id, UFTouchId touch_id); |
469 | void ReleaseFrames(); |
470 | |
471 | UFDeviceX11(const UFDeviceX11&) = delete; |
472 | |
473 | === modified file 'test/integration/events.cpp' |
474 | --- test/integration/events.cpp 2012-07-24 20:47:15 +0000 |
475 | +++ test/integration/events.cpp 2013-03-22 17:36:22 +0000 |
476 | @@ -5,9 +5,8 @@ |
477 | * Copyright (C) 2011 Canonical Ltd. |
478 | * |
479 | * This program is free software: you can redistribute it and/or modify it |
480 | - * under the terms of the GNU General Public License as published by the |
481 | - * Free Software Foundation, either version 3 of the License, or (at your |
482 | - * option) any later version. |
483 | + * under the terms of the GNU General Public License version 3 as published |
484 | + * by the Free Software Foundation. |
485 | * |
486 | * This program is distributed in the hope that it will be useful, but |
487 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
488 | |
489 | === modified file 'test/integration/events.h' |
490 | --- test/integration/events.h 2012-07-24 20:47:15 +0000 |
491 | +++ test/integration/events.h 2013-03-22 17:36:22 +0000 |
492 | @@ -5,9 +5,8 @@ |
493 | * Copyright (C) 2011 Canonical Ltd. |
494 | * |
495 | * This program is free software: you can redistribute it and/or modify it |
496 | - * under the terms of the GNU General Public License as published by the |
497 | - * Free Software Foundation, either version 3 of the License, or (at your |
498 | - * option) any later version. |
499 | + * under the terms of the GNU General Public License version 3 as published |
500 | + * by the Free Software Foundation. |
501 | * |
502 | * This program is distributed in the hope that it will be useful, but |
503 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
504 | |
505 | === modified file 'test/integration/x11/device.cpp' |
506 | --- test/integration/x11/device.cpp 2012-06-21 19:41:40 +0000 |
507 | +++ test/integration/x11/device.cpp 2013-03-22 17:36:22 +0000 |
508 | @@ -5,9 +5,8 @@ |
509 | * Copyright (C) 2011 Canonical Ltd. |
510 | * |
511 | * This program is free software: you can redistribute it and/or modify it |
512 | - * under the terms of the GNU General Public License as published by the |
513 | - * Free Software Foundation, either version 3 of the License, or (at your |
514 | - * option) any later version. |
515 | + * under the terms of the GNU General Public License version 3 as published |
516 | + * by the Free Software Foundation. |
517 | * |
518 | * This program is distributed in the hope that it will be useful, but |
519 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
520 | |
521 | === modified file 'test/integration/x11/dynamic_type_checking.cpp' |
522 | --- test/integration/x11/dynamic_type_checking.cpp 2012-06-21 19:41:40 +0000 |
523 | +++ test/integration/x11/dynamic_type_checking.cpp 2013-03-22 17:36:22 +0000 |
524 | @@ -5,9 +5,8 @@ |
525 | * Copyright (C) 2011 Canonical Ltd. |
526 | * |
527 | * This program is free software: you can redistribute it and/or modify it |
528 | - * under the terms of the GNU General Public License as published by the |
529 | - * Free Software Foundation, either version 3 of the License, or (at your |
530 | - * option) any later version. |
531 | + * under the terms of the GNU General Public License version 3 as published |
532 | + * by the Free Software Foundation. |
533 | * |
534 | * This program is distributed in the hope that it will be useful, but |
535 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
536 | |
537 | === modified file 'test/integration/x11/fixture.cpp' |
538 | --- test/integration/x11/fixture.cpp 2012-06-21 19:41:40 +0000 |
539 | +++ test/integration/x11/fixture.cpp 2013-03-22 17:36:22 +0000 |
540 | @@ -5,9 +5,8 @@ |
541 | * Copyright (C) 2011 Canonical Ltd. |
542 | * |
543 | * This program is free software: you can redistribute it and/or modify it |
544 | - * under the terms of the GNU General Public License as published by the |
545 | - * Free Software Foundation, either version 3 of the License, or (at your |
546 | - * option) any later version. |
547 | + * under the terms of the GNU General Public License version 3 as published |
548 | + * by the Free Software Foundation. |
549 | * |
550 | * This program is distributed in the hope that it will be useful, but |
551 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
552 | |
553 | === modified file 'test/integration/x11/fixture.h' |
554 | --- test/integration/x11/fixture.h 2012-06-21 19:41:40 +0000 |
555 | +++ test/integration/x11/fixture.h 2013-03-22 17:36:22 +0000 |
556 | @@ -5,9 +5,8 @@ |
557 | * Copyright (C) 2011 Canonical Ltd. |
558 | * |
559 | * This program is free software: you can redistribute it and/or modify it |
560 | - * under the terms of the GNU General Public License as published by the |
561 | - * Free Software Foundation, either version 3 of the License, or (at your |
562 | - * option) any later version. |
563 | + * under the terms of the GNU General Public License version 3 as published |
564 | + * by the Free Software Foundation. |
565 | * |
566 | * This program is distributed in the hope that it will be useful, but |
567 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
568 | |
569 | === modified file 'test/integration/x11/ids.cpp' |
570 | --- test/integration/x11/ids.cpp 2012-06-21 19:41:40 +0000 |
571 | +++ test/integration/x11/ids.cpp 2013-03-22 17:36:22 +0000 |
572 | @@ -5,9 +5,8 @@ |
573 | * Copyright (C) 2011 Canonical Ltd. |
574 | * |
575 | * This program is free software: you can redistribute it and/or modify it |
576 | - * under the terms of the GNU General Public License as published by the |
577 | - * Free Software Foundation, either version 3 of the License, or (at your |
578 | - * option) any later version. |
579 | + * under the terms of the GNU General Public License version 3 as published |
580 | + * by the Free Software Foundation. |
581 | * |
582 | * This program is distributed in the hope that it will be useful, but |
583 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
584 | |
585 | === modified file 'test/integration/x11/recording.cpp' |
586 | --- test/integration/x11/recording.cpp 2012-06-21 19:41:40 +0000 |
587 | +++ test/integration/x11/recording.cpp 2013-03-22 17:36:22 +0000 |
588 | @@ -5,9 +5,8 @@ |
589 | * Copyright (C) 2011 Canonical Ltd. |
590 | * |
591 | * This program is free software: you can redistribute it and/or modify it |
592 | - * under the terms of the GNU General Public License as published by the |
593 | - * Free Software Foundation, either version 3 of the License, or (at your |
594 | - * option) any later version. |
595 | + * under the terms of the GNU General Public License version 3 as published |
596 | + * by the Free Software Foundation. |
597 | * |
598 | * This program is distributed in the hope that it will be useful, but |
599 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
600 | |
601 | === modified file 'test/regular/Makefile.am' |
602 | --- test/regular/Makefile.am 2012-11-20 14:13:20 +0000 |
603 | +++ test/regular/Makefile.am 2013-03-22 17:36:22 +0000 |
604 | @@ -15,6 +15,7 @@ |
605 | $(COVERAGE_CFLAGS) |
606 | |
607 | AM_CPPFLAGS = \ |
608 | + -I$(top_builddir)/include \ |
609 | -I$(top_srcdir)/include \ |
610 | -iquote$(srcdir) |
611 | |
612 | @@ -46,6 +47,7 @@ |
613 | if HAVE_XINPUT |
614 | check_regular_SOURCES += \ |
615 | accept-ended-touch.cpp \ |
616 | + x11-accept-touch.cpp \ |
617 | frame-x11-fixture.cpp \ |
618 | frame-x11-fixture.h |
619 | endif |
620 | |
621 | === added file 'test/regular/x11-accept-touch.cpp' |
622 | --- test/regular/x11-accept-touch.cpp 1970-01-01 00:00:00 +0000 |
623 | +++ test/regular/x11-accept-touch.cpp 2013-03-22 17:36:22 +0000 |
624 | @@ -0,0 +1,86 @@ |
625 | +#include "frame-x11-fixture.h" |
626 | +#include "x11_mocks.h" |
627 | + |
628 | +class X11TouchAcceptance : public FrameX11Fixture |
629 | +{ |
630 | +}; |
631 | + |
632 | +/* |
633 | + Calls frame_accept_touch and check if the corresponding X11 call is made |
634 | + */ |
635 | +TEST_F(X11TouchAcceptance, Accept) |
636 | +{ |
637 | + UFStatus status; |
638 | + UFDevice device; |
639 | + |
640 | + xmock_server_time = 1234; |
641 | + |
642 | + CreateXMockTouchScreenDevice(); |
643 | + |
644 | + Display *display = XOpenDisplay(NULL); |
645 | + |
646 | + status = frame_x11_new(display, &frame_handle); |
647 | + ASSERT_EQ(UFStatusSuccess, status); |
648 | + |
649 | + FetchDeviceAddedEvent(&device); |
650 | + AssertNoMoreEvents(); |
651 | + |
652 | + SendTouchEvent(XI_TouchBegin, 1, 10.0f, 10.0f); |
653 | + SendTouchOwnershipEvent(1); |
654 | + |
655 | + UFWindowId frame_window_id = frame_x11_create_window_id(DefaultRootWindow(display)); |
656 | + status = frame_accept_touch(device, frame_window_id, 1); |
657 | + ASSERT_EQ(UFStatusSuccess, status); |
658 | + |
659 | + ASSERT_EQ(XIAcceptTouch, |
660 | + xmock_get_touch_acceptance(xmock_devices[0].attachment /* device id */, |
661 | + 1 /* touch id */, |
662 | + DefaultRootWindow(display))); |
663 | + |
664 | + frame_x11_delete(frame_handle); |
665 | + frame_handle = nullptr; |
666 | + |
667 | + XCloseDisplay(display); |
668 | + |
669 | + DestroyXMockDevices(); |
670 | +} |
671 | + |
672 | +/* |
673 | + Calls frame_reject_touch and check if the corresponding X11 call is made |
674 | + */ |
675 | +TEST_F(X11TouchAcceptance, Reject) |
676 | +{ |
677 | + UFStatus status; |
678 | + UFDevice device; |
679 | + |
680 | + xmock_server_time = 1234; |
681 | + |
682 | + CreateXMockTouchScreenDevice(); |
683 | + |
684 | + Display *display = XOpenDisplay(NULL); |
685 | + |
686 | + status = frame_x11_new(display, &frame_handle); |
687 | + ASSERT_EQ(UFStatusSuccess, status); |
688 | + |
689 | + FetchDeviceAddedEvent(&device); |
690 | + AssertNoMoreEvents(); |
691 | + |
692 | + SendTouchEvent(XI_TouchBegin, 1, 10.0f, 10.0f); |
693 | + SendTouchOwnershipEvent(1); |
694 | + |
695 | + UFWindowId frame_window_id = frame_x11_create_window_id(DefaultRootWindow(display)); |
696 | + status = frame_reject_touch(device, frame_window_id, 1); |
697 | + ASSERT_EQ(UFStatusSuccess, status); |
698 | + |
699 | + ASSERT_EQ(XIRejectTouch, |
700 | + xmock_get_touch_acceptance(xmock_devices[0].attachment /* device id */, |
701 | + 1 /* touch id */, |
702 | + DefaultRootWindow(display))); |
703 | + |
704 | + frame_x11_delete(frame_handle); |
705 | + frame_handle = nullptr; |
706 | + |
707 | + XCloseDisplay(display); |
708 | + |
709 | + DestroyXMockDevices(); |
710 | +} |
711 | |
712 | === modified file 'tools/Makefile.am' |
713 | --- tools/Makefile.am 2012-06-21 19:41:40 +0000 |
714 | +++ tools/Makefile.am 2013-03-22 17:36:22 +0000 |
715 | @@ -1,4 +1,7 @@ |
716 | -AM_CPPFLAGS = -I$(top_srcdir)/include/ $(WARNING_CPPFLAGS) |
717 | +AM_CPPFLAGS = \ |
718 | + -I$(top_builddir)/include \ |
719 | + -I$(top_srcdir)/include \ |
720 | + $(WARNING_CPPFLAGS) |
721 | |
722 | AM_CFLAGS = $(C11_CFLAGS) $(COVERAGE_CFLAGS) |
723 | |
724 | |
725 | === modified file 'tools/common/device.c' |
726 | --- tools/common/device.c 2012-06-21 19:41:40 +0000 |
727 | +++ tools/common/device.c 2013-03-22 17:36:22 +0000 |
728 | @@ -5,9 +5,8 @@ |
729 | * Copyright (C) 2010-2011 Canonical Ltd. |
730 | * |
731 | * This program is free software: you can redistribute it and/or modify it |
732 | - * under the terms of the GNU General Public License as published by the |
733 | - * Free Software Foundation, either version 3 of the License, or (at your |
734 | - * option) any later version. |
735 | + * under the terms of the GNU General Public License version 3 as published |
736 | + * by the Free Software Foundation. |
737 | * |
738 | * This program is distributed in the hope that it will be useful, but |
739 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
740 | |
741 | === modified file 'tools/common/device.h' |
742 | --- tools/common/device.h 2012-06-21 19:41:40 +0000 |
743 | +++ tools/common/device.h 2013-03-22 17:36:22 +0000 |
744 | @@ -5,9 +5,8 @@ |
745 | * Copyright (C) 2010-2011 Canonical Ltd. |
746 | * |
747 | * This program is free software: you can redistribute it and/or modify it |
748 | - * under the terms of the GNU General Public License as published by the |
749 | - * Free Software Foundation, either version 3 of the License, or (at your |
750 | - * option) any later version. |
751 | + * under the terms of the GNU General Public License version 3 as published |
752 | + * by the Free Software Foundation. |
753 | * |
754 | * This program is distributed in the hope that it will be useful, but |
755 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
756 | |
757 | === modified file 'tools/common/frame.c' |
758 | --- tools/common/frame.c 2012-06-21 19:41:40 +0000 |
759 | +++ tools/common/frame.c 2013-03-22 17:36:22 +0000 |
760 | @@ -5,9 +5,8 @@ |
761 | * Copyright (C) 2010-2011 Canonical Ltd. |
762 | * |
763 | * This program is free software: you can redistribute it and/or modify it |
764 | - * under the terms of the GNU General Public License as published by the |
765 | - * Free Software Foundation, either version 3 of the License, or (at your |
766 | - * option) any later version. |
767 | + * under the terms of the GNU General Public License version 3 as published |
768 | + * by the Free Software Foundation. |
769 | * |
770 | * This program is distributed in the hope that it will be useful, but |
771 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
772 | |
773 | === modified file 'tools/common/frame.h' |
774 | --- tools/common/frame.h 2012-06-21 19:41:40 +0000 |
775 | +++ tools/common/frame.h 2013-03-22 17:36:22 +0000 |
776 | @@ -5,9 +5,8 @@ |
777 | * Copyright (C) 2010-2011 Canonical Ltd. |
778 | * |
779 | * This program is free software: you can redistribute it and/or modify it |
780 | - * under the terms of the GNU General Public License as published by the |
781 | - * Free Software Foundation, either version 3 of the License, or (at your |
782 | - * option) any later version. |
783 | + * under the terms of the GNU General Public License version 3 as published |
784 | + * by the Free Software Foundation. |
785 | * |
786 | * This program is distributed in the hope that it will be useful, but |
787 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
788 | |
789 | === modified file 'tools/common/touch.c' |
790 | --- tools/common/touch.c 2012-06-21 19:41:40 +0000 |
791 | +++ tools/common/touch.c 2013-03-22 17:36:22 +0000 |
792 | @@ -5,9 +5,8 @@ |
793 | * Copyright (C) 2010-2011 Canonical Ltd. |
794 | * |
795 | * This program is free software: you can redistribute it and/or modify it |
796 | - * under the terms of the GNU General Public License as published by the |
797 | - * Free Software Foundation, either version 3 of the License, or (at your |
798 | - * option) any later version. |
799 | + * under the terms of the GNU General Public License version 3 as published |
800 | + * by the Free Software Foundation. |
801 | * |
802 | * This program is distributed in the hope that it will be useful, but |
803 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
804 | |
805 | === modified file 'tools/common/touch.h' |
806 | --- tools/common/touch.h 2012-06-21 19:41:40 +0000 |
807 | +++ tools/common/touch.h 2013-03-22 17:36:22 +0000 |
808 | @@ -5,9 +5,8 @@ |
809 | * Copyright (C) 2010-2011 Canonical Ltd. |
810 | * |
811 | * This program is free software: you can redistribute it and/or modify it |
812 | - * under the terms of the GNU General Public License as published by the |
813 | - * Free Software Foundation, either version 3 of the License, or (at your |
814 | - * option) any later version. |
815 | + * under the terms of the GNU General Public License version 3 as published |
816 | + * by the Free Software Foundation. |
817 | * |
818 | * This program is distributed in the hope that it will be useful, but |
819 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
820 | |
821 | === modified file 'tools/frame-test-x11.c' |
822 | --- tools/frame-test-x11.c 2012-06-21 19:41:40 +0000 |
823 | +++ tools/frame-test-x11.c 2013-03-22 17:36:22 +0000 |
824 | @@ -5,9 +5,8 @@ |
825 | * Copyright (C) 2010-2011 Canonical Ltd. |
826 | * |
827 | * This program is free software: you can redistribute it and/or modify it |
828 | - * under the terms of the GNU General Public License as published by the |
829 | - * Free Software Foundation, either version 3 of the License, or (at your |
830 | - * option) any later version. |
831 | + * under the terms of the GNU General Public License version 3 as published by |
832 | + * the Free Software Foundation. |
833 | * |
834 | * This program is distributed in the hope that it will be useful, but |
835 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
Looks fine.