Merge lp:~dandrader/frame/release_2.4.3-0ubuntu1 into lp:frame/ubuntu

Proposed by Daniel d'Andrada
Status: Merged
Approved by: Stephen M. Webb
Approved revision: 86
Merged at revision: 86
Proposed branch: lp:~dandrader/frame/release_2.4.3-0ubuntu1
Merge into: lp:frame/ubuntu
Diff against target: 2035 lines (+1137/-190)
35 files modified
INSTALL (+2/-2)
Makefile.in (+2/-2)
aclocal.m4 (+3/-3)
config-aux/ltmain.sh (+2/-2)
configure (+18/-124)
configure.ac (+1/-4)
debian/changelog (+7/-2)
debian/libframe6.symbols (+35/-0)
doc/Makefile.in (+1/-1)
include/oif/frame.h (+1/-0)
include/oif/frame_backend.h (+291/-0)
src/Makefile.am (+1/-2)
src/Makefile.in (+3/-4)
src/device.cpp (+93/-6)
src/device.h (+7/-1)
src/event.cpp (+37/-0)
src/event.h (+1/-0)
src/frame.cpp (+142/-17)
src/frame.h (+12/-3)
src/libframe.ver (+39/-0)
src/touch.cpp (+96/-0)
src/touch.h (+19/-3)
src/window.h (+1/-1)
src/x11/device_x11.cpp (+0/-3)
src/x11/window_x11.cpp (+2/-2)
test/Makefile.in (+1/-1)
test/gtest/Makefile.in (+1/-1)
test/integration/Makefile.in (+1/-1)
test/regular/Makefile.am (+1/-0)
test/regular/Makefile.in (+18/-1)
test/regular/backend.cpp (+289/-0)
test/regular/frame-fixture.cpp (+6/-0)
test/x11_mocks/Makefile.in (+1/-1)
tools/Makefile.in (+1/-1)
tools/frame-test-x11.1 (+2/-2)
To merge this branch: bzr merge lp:~dandrader/frame/release_2.4.3-0ubuntu1
Reviewer Review Type Date Requested Status
Stephen M. Webb (community) Approve
Review via email: mp+133514@code.launchpad.net

Description of the change

Release 2.4.3-0ubuntu1

To post a comment you must log in.
Revision history for this message
Stephen M. Webb (bregma) wrote :

Looks good, builds cleanly.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'INSTALL'
--- INSTALL 2012-07-26 18:35:10 +0000
+++ INSTALL 2012-11-08 16:29:22 +0000
@@ -1,7 +1,7 @@
1frame - Touch Frame Library1frame - Touch Frame Library
22
3To build, you need to have the autoconf, libtool, libevemu-dev3To build, you need to have the autoconf, libtool, and x11 developer
4and mtdev-dev packages installed. Then, do4packages installed. Then, do
55
6 ./autogen.sh6 ./autogen.sh
7 ./configure7 ./configure
88
=== modified file 'Makefile.in'
--- Makefile.in 2012-07-26 18:35:10 +0000
+++ Makefile.in 2012-11-08 16:29:22 +0000
@@ -1,4 +1,4 @@
1# Makefile.in generated by automake 1.11.5 from Makefile.am.1# Makefile.in generated by automake 1.11.6 from Makefile.am.
2# @configure_input@2# @configure_input@
33
4# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,4# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -691,7 +691,7 @@
691 *.zip*) \691 *.zip*) \
692 unzip $(distdir).zip ;;\692 unzip $(distdir).zip ;;\
693 esac693 esac
694 chmod -R a-w $(distdir); chmod a+w $(distdir)694 chmod -R a-w $(distdir); chmod u+w $(distdir)
695 mkdir $(distdir)/_build695 mkdir $(distdir)/_build
696 mkdir $(distdir)/_inst696 mkdir $(distdir)/_inst
697 chmod a-w $(distdir)697 chmod a-w $(distdir)
698698
=== modified file 'aclocal.m4'
--- aclocal.m4 2012-07-26 18:35:10 +0000
+++ aclocal.m4 2012-11-08 16:29:22 +0000
@@ -1,4 +1,4 @@
1# generated automatically by aclocal 1.11.5 -*- Autoconf -*-1# generated automatically by aclocal 1.11.6 -*- Autoconf -*-
22
3# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,3# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
4# 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation,4# 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation,
@@ -38,7 +38,7 @@
38[am__api_version='1.11'38[am__api_version='1.11'
39dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to39dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
40dnl require some minimum version. Point them to the right macro.40dnl require some minimum version. Point them to the right macro.
41m4_if([$1], [1.11.5], [],41m4_if([$1], [1.11.6], [],
42 [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl42 [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
43])43])
4444
@@ -54,7 +54,7 @@
54# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.54# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
55# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.55# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
56AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],56AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
57[AM_AUTOMAKE_VERSION([1.11.5])dnl57[AM_AUTOMAKE_VERSION([1.11.6])dnl
58m4_ifndef([AC_AUTOCONF_VERSION],58m4_ifndef([AC_AUTOCONF_VERSION],
59 [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl59 [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
60_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])60_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
6161
=== modified file 'config-aux/ltmain.sh'
--- config-aux/ltmain.sh 2012-01-30 22:35:59 +0000
+++ config-aux/ltmain.sh 2012-11-08 16:29:22 +0000
@@ -70,7 +70,7 @@
70# compiler: $LTCC70# compiler: $LTCC
71# compiler flags: $LTCFLAGS71# compiler flags: $LTCFLAGS
72# linker: $LD (gnu? $with_gnu_ld)72# linker: $LD (gnu? $with_gnu_ld)
73# $progname: (GNU libtool) 2.4.2 Debian-2.4.2-1ubuntu173# $progname: (GNU libtool) 2.4.2 Debian-2.4.2-1ubuntu2
74# automake: $automake_version74# automake: $automake_version
75# autoconf: $autoconf_version75# autoconf: $autoconf_version
76#76#
@@ -80,7 +80,7 @@
8080
81PROGRAM=libtool81PROGRAM=libtool
82PACKAGE=libtool82PACKAGE=libtool
83VERSION="2.4.2 Debian-2.4.2-1ubuntu1"83VERSION="2.4.2 Debian-2.4.2-1ubuntu2"
84TIMESTAMP=""84TIMESTAMP=""
85package_revision=1.333785package_revision=1.3337
8686
8787
=== modified file 'configure'
--- configure 2012-07-26 18:43:01 +0000
+++ configure 2012-11-08 16:29:22 +0000
@@ -1,6 +1,6 @@
1#! /bin/sh1#! /bin/sh
2# Guess values for system-dependent variables and create Makefiles.2# Guess values for system-dependent variables and create Makefiles.
3# Generated by GNU Autoconf 2.69 for Touch Frame Library 2.2.4.3# Generated by GNU Autoconf 2.69 for Touch Frame Library 2.4.3.
4#4#
5#5#
6# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.6# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
@@ -587,8 +587,8 @@
587# Identity of this package.587# Identity of this package.
588PACKAGE_NAME='Touch Frame Library'588PACKAGE_NAME='Touch Frame Library'
589PACKAGE_TARNAME='frame'589PACKAGE_TARNAME='frame'
590PACKAGE_VERSION='2.2.4'590PACKAGE_VERSION='2.4.3'
591PACKAGE_STRING='Touch Frame Library 2.2.4'591PACKAGE_STRING='Touch Frame Library 2.4.3'
592PACKAGE_BUGREPORT=''592PACKAGE_BUGREPORT=''
593PACKAGE_URL=''593PACKAGE_URL=''
594594
@@ -670,6 +670,8 @@
670BASE_CXXFLAGS670BASE_CXXFLAGS
671XORG_GTEST_CPPFLAGS671XORG_GTEST_CPPFLAGS
672XORG_GTEST_SOURCE672XORG_GTEST_SOURCE
673EVEMU_LIBS
674EVEMU_CFLAGS
673X11_LIBS675X11_LIBS
674X11_CFLAGS676X11_CFLAGS
675HAVE_GTEST_FALSE677HAVE_GTEST_FALSE
@@ -682,10 +684,6 @@
682ASCIIDOC684ASCIIDOC
683XINPUT_LIBS685XINPUT_LIBS
684XINPUT_CFLAGS686XINPUT_CFLAGS
685HAVE_EVEMU_FALSE
686HAVE_EVEMU_TRUE
687EVEMU_LIBS
688EVEMU_CFLAGS
689PKG_CONFIG_LIBDIR687PKG_CONFIG_LIBDIR
690PKG_CONFIG_PATH688PKG_CONFIG_PATH
691PKG_CONFIG689PKG_CONFIG
@@ -849,12 +847,12 @@
849PKG_CONFIG847PKG_CONFIG
850PKG_CONFIG_PATH848PKG_CONFIG_PATH
851PKG_CONFIG_LIBDIR849PKG_CONFIG_LIBDIR
852EVEMU_CFLAGS
853EVEMU_LIBS
854XINPUT_CFLAGS850XINPUT_CFLAGS
855XINPUT_LIBS851XINPUT_LIBS
856X11_CFLAGS852X11_CFLAGS
857X11_LIBS'853X11_LIBS
854EVEMU_CFLAGS
855EVEMU_LIBS'
858856
859857
860# Initialize some variables set by options.858# Initialize some variables set by options.
@@ -1395,7 +1393,7 @@
1395 # Omit some internal or obsolete options to make the list less imposing.1393 # Omit some internal or obsolete options to make the list less imposing.
1396 # This message is too long to be a string in the A/UX 3.1 sh.1394 # This message is too long to be a string in the A/UX 3.1 sh.
1397 cat <<_ACEOF1395 cat <<_ACEOF
1398\`configure' configures Touch Frame Library 2.2.4 to adapt to many kinds of systems.1396\`configure' configures Touch Frame Library 2.4.3 to adapt to many kinds of systems.
13991397
1400Usage: $0 [OPTION]... [VAR=VALUE]...1398Usage: $0 [OPTION]... [VAR=VALUE]...
14011399
@@ -1465,7 +1463,7 @@
14651463
1466if test -n "$ac_init_help"; then1464if test -n "$ac_init_help"; then
1467 case $ac_init_help in1465 case $ac_init_help in
1468 short | recursive ) echo "Configuration of Touch Frame Library 2.2.4:";;1466 short | recursive ) echo "Configuration of Touch Frame Library 2.4.3:";;
1469 esac1467 esac
1470 cat <<\_ACEOF1468 cat <<\_ACEOF
14711469
@@ -1528,14 +1526,14 @@
1528 directories to add to pkg-config's search path1526 directories to add to pkg-config's search path
1529 PKG_CONFIG_LIBDIR1527 PKG_CONFIG_LIBDIR
1530 path overriding pkg-config's built-in search path1528 path overriding pkg-config's built-in search path
1531 EVEMU_CFLAGS
1532 C compiler flags for EVEMU, overriding pkg-config
1533 EVEMU_LIBS linker flags for EVEMU, overriding pkg-config
1534 XINPUT_CFLAGS1529 XINPUT_CFLAGS
1535 C compiler flags for XINPUT, overriding pkg-config1530 C compiler flags for XINPUT, overriding pkg-config
1536 XINPUT_LIBS linker flags for XINPUT, overriding pkg-config1531 XINPUT_LIBS linker flags for XINPUT, overriding pkg-config
1537 X11_CFLAGS C compiler flags for X11, overriding pkg-config1532 X11_CFLAGS C compiler flags for X11, overriding pkg-config
1538 X11_LIBS linker flags for X11, overriding pkg-config1533 X11_LIBS linker flags for X11, overriding pkg-config
1534 EVEMU_CFLAGS
1535 C compiler flags for EVEMU, overriding pkg-config
1536 EVEMU_LIBS linker flags for EVEMU, overriding pkg-config
15391537
1540Use these variables to override the choices made by `configure' or to help1538Use these variables to override the choices made by `configure' or to help
1541it to find libraries and programs with nonstandard names/locations.1539it to find libraries and programs with nonstandard names/locations.
@@ -1603,7 +1601,7 @@
1603test -n "$ac_init_help" && exit $ac_status1601test -n "$ac_init_help" && exit $ac_status
1604if $ac_init_version; then1602if $ac_init_version; then
1605 cat <<\_ACEOF1603 cat <<\_ACEOF
1606Touch Frame Library configure 2.2.41604Touch Frame Library configure 2.4.3
1607generated by GNU Autoconf 2.691605generated by GNU Autoconf 2.69
16081606
1609Copyright (C) 2012 Free Software Foundation, Inc.1607Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2048,7 +2046,7 @@
2048This file contains any messages produced by compilers while2046This file contains any messages produced by compilers while
2049running configure, to aid debugging if configure makes a mistake.2047running configure, to aid debugging if configure makes a mistake.
20502048
2051It was created by Touch Frame Library $as_me 2.2.4, which was2049It was created by Touch Frame Library $as_me 2.4.3, which was
2052generated by GNU Autoconf 2.69. Invocation command line was2050generated by GNU Autoconf 2.69. Invocation command line was
20532051
2054 $ $0 $@2052 $ $0 $@
@@ -2869,7 +2867,7 @@
28692867
2870# Define the identity of the package.2868# Define the identity of the package.
2871 PACKAGE='frame'2869 PACKAGE='frame'
2872 VERSION='2.2.4'2870 VERSION='2.4.3'
28732871
28742872
2875cat >>confdefs.h <<_ACEOF2873cat >>confdefs.h <<_ACEOF
@@ -15946,106 +15944,6 @@
15946fi15944fi
1594715945
15948pkg_failed=no15946pkg_failed=no
15949{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVEMU" >&5
15950$as_echo_n "checking for EVEMU... " >&6; }
15951
15952if test -n "$EVEMU_CFLAGS"; then
15953 pkg_cv_EVEMU_CFLAGS="$EVEMU_CFLAGS"
15954 elif test -n "$PKG_CONFIG"; then
15955 if test -n "$PKG_CONFIG" && \
15956 { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"evemu >= 1.0.5\""; } >&5
15957 ($PKG_CONFIG --exists --print-errors "evemu >= 1.0.5") 2>&5
15958 ac_status=$?
15959 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
15960 test $ac_status = 0; }; then
15961 pkg_cv_EVEMU_CFLAGS=`$PKG_CONFIG --cflags "evemu >= 1.0.5" 2>/dev/null`
15962 test "x$?" != "x0" && pkg_failed=yes
15963else
15964 pkg_failed=yes
15965fi
15966 else
15967 pkg_failed=untried
15968fi
15969if test -n "$EVEMU_LIBS"; then
15970 pkg_cv_EVEMU_LIBS="$EVEMU_LIBS"
15971 elif test -n "$PKG_CONFIG"; then
15972 if test -n "$PKG_CONFIG" && \
15973 { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"evemu >= 1.0.5\""; } >&5
15974 ($PKG_CONFIG --exists --print-errors "evemu >= 1.0.5") 2>&5
15975 ac_status=$?
15976 $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
15977 test $ac_status = 0; }; then
15978 pkg_cv_EVEMU_LIBS=`$PKG_CONFIG --libs "evemu >= 1.0.5" 2>/dev/null`
15979 test "x$?" != "x0" && pkg_failed=yes
15980else
15981 pkg_failed=yes
15982fi
15983 else
15984 pkg_failed=untried
15985fi
15986
15987
15988
15989if test $pkg_failed = yes; then
15990 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
15991$as_echo "no" >&6; }
15992
15993if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
15994 _pkg_short_errors_supported=yes
15995else
15996 _pkg_short_errors_supported=no
15997fi
15998 if test $_pkg_short_errors_supported = yes; then
15999 EVEMU_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "evemu >= 1.0.5" 2>&1`
16000 else
16001 EVEMU_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "evemu >= 1.0.5" 2>&1`
16002 fi
16003 # Put the nasty error message in config.log where it belongs
16004 echo "$EVEMU_PKG_ERRORS" >&5
16005
16006 as_fn_error $? "Package requirements (evemu >= 1.0.5) were not met:
16007
16008$EVEMU_PKG_ERRORS
16009
16010Consider adjusting the PKG_CONFIG_PATH environment variable if you
16011installed software in a non-standard prefix.
16012
16013Alternatively, you may set the environment variables EVEMU_CFLAGS
16014and EVEMU_LIBS to avoid the need to call pkg-config.
16015See the pkg-config man page for more details." "$LINENO" 5
16016elif test $pkg_failed = untried; then
16017 { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
16018$as_echo "no" >&6; }
16019 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
16020$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
16021as_fn_error $? "The pkg-config script could not be found or is too old. Make sure it
16022is in your PATH or set the PKG_CONFIG environment variable to the full
16023path to pkg-config.
16024
16025Alternatively, you may set the environment variables EVEMU_CFLAGS
16026and EVEMU_LIBS to avoid the need to call pkg-config.
16027See the pkg-config man page for more details.
16028
16029To get pkg-config, see <http://pkg-config.freedesktop.org/>.
16030See \`config.log' for more details" "$LINENO" 5; }
16031else
16032 EVEMU_CFLAGS=$pkg_cv_EVEMU_CFLAGS
16033 EVEMU_LIBS=$pkg_cv_EVEMU_LIBS
16034 { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
16035$as_echo "yes" >&6; }
16036 have_evemu=yes
16037fi
16038 if test "x$have_evemu" = xyes; then
16039 HAVE_EVEMU_TRUE=
16040 HAVE_EVEMU_FALSE='#'
16041else
16042 HAVE_EVEMU_TRUE='#'
16043 HAVE_EVEMU_FALSE=
16044fi
16045
16046
16047
16048pkg_failed=no
16049{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for XINPUT" >&515947{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for XINPUT" >&5
16050$as_echo_n "checking for XINPUT... " >&6; }15948$as_echo_n "checking for XINPUT... " >&6; }
1605115949
@@ -22245,10 +22143,6 @@
22245 as_fn_error $? "conditional \"am__fastdepCXX\" was never defined.22143 as_fn_error $? "conditional \"am__fastdepCXX\" was never defined.
22246Usually this means the macro was only invoked conditionally." "$LINENO" 522144Usually this means the macro was only invoked conditionally." "$LINENO" 5
22247fi22145fi
22248if test -z "${HAVE_EVEMU_TRUE}" && test -z "${HAVE_EVEMU_FALSE}"; then
22249 as_fn_error $? "conditional \"HAVE_EVEMU\" was never defined.
22250Usually this means the macro was only invoked conditionally." "$LINENO" 5
22251fi
22252if test -z "${HAVE_DOCTOOLS_TRUE}" && test -z "${HAVE_DOCTOOLS_FALSE}"; then22146if test -z "${HAVE_DOCTOOLS_TRUE}" && test -z "${HAVE_DOCTOOLS_FALSE}"; then
22253 as_fn_error $? "conditional \"HAVE_DOCTOOLS\" was never defined.22147 as_fn_error $? "conditional \"HAVE_DOCTOOLS\" was never defined.
22254Usually this means the macro was only invoked conditionally." "$LINENO" 522148Usually this means the macro was only invoked conditionally." "$LINENO" 5
@@ -22662,7 +22556,7 @@
22662# report actual input values of CONFIG_FILES etc. instead of their22556# report actual input values of CONFIG_FILES etc. instead of their
22663# values after options handling.22557# values after options handling.
22664ac_log="22558ac_log="
22665This file was extended by Touch Frame Library $as_me 2.2.4, which was22559This file was extended by Touch Frame Library $as_me 2.4.3, which was
22666generated by GNU Autoconf 2.69. Invocation command line was22560generated by GNU Autoconf 2.69. Invocation command line was
2266722561
22668 CONFIG_FILES = $CONFIG_FILES22562 CONFIG_FILES = $CONFIG_FILES
@@ -22728,7 +22622,7 @@
22728cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=122622cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
22729ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"22623ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
22730ac_cs_version="\\22624ac_cs_version="\\
22731Touch Frame Library config.status 2.2.422625Touch Frame Library config.status 2.4.3
22732configured by $0, generated by GNU Autoconf 2.69,22626configured by $0, generated by GNU Autoconf 2.69,
22733 with options \\"\$ac_cs_config\\"22627 with options \\"\$ac_cs_config\\"
2273422628
2273522629
=== modified file 'configure.ac'
--- configure.ac 2012-07-26 18:35:10 +0000
+++ configure.ac 2012-11-08 16:29: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.2.4],4 [2.4.3],
5 [],5 [],
6 [frame])6 [frame])
7AC_CONFIG_SRCDIR([Makefile.am])7AC_CONFIG_SRCDIR([Makefile.am])
@@ -25,9 +25,6 @@
25AC_PROG_CXX25AC_PROG_CXX
26AC_PROG_INSTALL26AC_PROG_INSTALL
2727
28PKG_CHECK_MODULES([EVEMU], [evemu >= 1.0.5], [have_evemu=yes])
29AM_CONDITIONAL([HAVE_EVEMU], [test "x$have_evemu" = xyes])
30
31PKG_CHECK_MODULES(XINPUT, x11 xext xorg-server [xi >= 1.5.99.1] [inputproto >= 2.1.99.6])28PKG_CHECK_MODULES(XINPUT, x11 xext xorg-server [xi >= 1.5.99.1] [inputproto >= 2.1.99.6])
3229
33AC_CHECK_PROG([ASCIIDOC], [a2x], [a2x])30AC_CHECK_PROG([ASCIIDOC], [a2x], [a2x])
3431
=== modified file 'debian/changelog'
--- debian/changelog 2012-08-29 21:32:21 +0000
+++ debian/changelog 2012-11-08 16:29:22 +0000
@@ -1,9 +1,14 @@
1frame (2.2.4-0ubuntu2) UNRELEASED; urgency=low1frame (2.4.3-0ubuntu1) raring; urgency=low
22
3 [ Chase Douglas ]
3 * Remove patches, both have been merged upstream4 * Remove patches, both have been merged upstream
4 * Replace wrong "Multi-arch" with correct "Multi-Arch" in debian/control5 * Replace wrong "Multi-arch" with correct "Multi-Arch" in debian/control
56
6 -- Chase Douglas <chase.douglas@ubuntu.com> Wed, 29 Aug 2012 21:31:11 +00007 [ Daniel d'Andrada ]
8 * New upstream release.
9 * Updated libframe6.symbols with the new symbols from version 2.4
10
11 -- Daniel d'Andrada <daniel.dandrada@canonical.com> Thu, 08 Nov 2012 14:14:13 -0200
712
8frame (2.2.4-0ubuntu1) quantal; urgency=low13frame (2.2.4-0ubuntu1) quantal; urgency=low
914
1015
=== modified file 'debian/libframe6.symbols'
--- debian/libframe6.symbols 2012-07-26 18:56:37 +0000
+++ debian/libframe6.symbols 2012-11-08 16:29:22 +0000
@@ -1,9 +1,39 @@
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.3
3 frame_axis_get_maximum@FRAME_2.2 2.2.44 frame_axis_get_maximum@FRAME_2.2 2.2.4
4 frame_axis_get_minimum@FRAME_2.2 2.2.45 frame_axis_get_minimum@FRAME_2.2 2.2.4
5 frame_axis_get_resolution@FRAME_2.2 2.2.46 frame_axis_get_resolution@FRAME_2.2 2.2.4
6 frame_axis_get_type@FRAME_2.2 2.2.47 frame_axis_get_type@FRAME_2.2 2.2.4
8 frame_backend_device_add_axis@FRAME_2.4 2.4.3
9 frame_backend_device_delete@FRAME_2.4 2.4.3
10 frame_backend_device_get_device@FRAME_2.4 2.4.3
11 frame_backend_device_new@FRAME_2.4 2.4.3
12 frame_backend_device_set_direct@FRAME_2.4 2.4.3
13 frame_backend_device_set_independent@FRAME_2.4 2.4.3
14 frame_backend_device_set_max_touches@FRAME_2.4 2.4.3
15 frame_backend_device_set_name@FRAME_2.4 2.4.3
16 frame_backend_device_set_semi_mt@FRAME_2.4 2.4.3
17 frame_backend_device_set_window_resolution@FRAME_2.4 2.4.3
18 frame_backend_frame_borrow_touch_by_id@FRAME_2.4 2.4.3
19 frame_backend_frame_create_next@FRAME_2.4 2.4.3
20 frame_backend_frame_delete@FRAME_2.4 2.4.3
21 frame_backend_frame_get_frame@FRAME_2.4 2.4.3
22 frame_backend_frame_give_touch@FRAME_2.4 2.4.3
23 frame_backend_frame_new@FRAME_2.4 2.4.3
24 frame_backend_frame_set_active_touches@FRAME_2.4 2.4.3
25 frame_backend_frame_set_device@FRAME_2.4 2.4.3
26 frame_backend_frame_set_window_id@FRAME_2.4 2.4.3
27 frame_backend_touch_get_touch@FRAME_2.4 2.4.3
28 frame_backend_touch_new@FRAME_2.4 2.4.3
29 frame_backend_touch_set_ended@FRAME_2.4 2.4.3
30 frame_backend_touch_set_id@FRAME_2.4 2.4.3
31 frame_backend_touch_set_owned@FRAME_2.4 2.4.3
32 frame_backend_touch_set_pending_end@FRAME_2.4 2.4.3
33 frame_backend_touch_set_start_time@FRAME_2.4 2.4.3
34 frame_backend_touch_set_time@FRAME_2.4 2.4.3
35 frame_backend_touch_set_value@FRAME_2.4 2.4.3
36 frame_backend_touch_set_window_pos@FRAME_2.4 2.4.3
7 frame_device_get_axis_by_index@FRAME_2.2 2.2.437 frame_device_get_axis_by_index@FRAME_2.2 2.2.4
8 frame_device_get_axis_by_type@FRAME_2.2 2.2.438 frame_device_get_axis_by_type@FRAME_2.2 2.2.4
9 frame_device_get_num_axes@FRAME_2.2 2.2.439 frame_device_get_num_axes@FRAME_2.2 2.2.4
@@ -20,7 +50,12 @@
20 frame_event_get_property_uint64_@FRAME_2.2 2.2.450 frame_event_get_property_uint64_@FRAME_2.2 2.2.4
21 frame_event_get_time@FRAME_2.2 2.2.451 frame_event_get_time@FRAME_2.2 2.2.4
22 frame_event_get_type@FRAME_2.2 2.2.452 frame_event_get_type@FRAME_2.2 2.2.4
53 frame_event_new@FRAME_2.4 2.4.3
23 frame_event_ref@FRAME_2.2 2.2.454 frame_event_ref@FRAME_2.2 2.2.4
55 frame_event_set_device@FRAME_2.4 2.4.3
56 frame_event_set_frame@FRAME_2.4 2.4.3
57 frame_event_set_time@FRAME_2.4 2.4.3
58 frame_event_set_type@FRAME_2.4 2.4.3
24 frame_event_unref@FRAME_2.2 2.2.459 frame_event_unref@FRAME_2.2 2.2.4
25 frame_frame_get_device@FRAME_2.2 2.2.460 frame_frame_get_device@FRAME_2.2 2.2.4
26 frame_frame_get_num_touches@FRAME_2.2 2.2.461 frame_frame_get_num_touches@FRAME_2.2 2.2.4
2762
=== modified file 'doc/Makefile.in'
--- doc/Makefile.in 2012-07-26 18:35:10 +0000
+++ doc/Makefile.in 2012-11-08 16:29:22 +0000
@@ -1,4 +1,4 @@
1# Makefile.in generated by automake 1.11.5 from Makefile.am.1# Makefile.in generated by automake 1.11.6 from Makefile.am.
2# @configure_input@2# @configure_input@
33
4# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,4# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
55
=== modified file 'include/oif/frame.h'
--- include/oif/frame.h 2012-07-24 21:36:05 +0000
+++ include/oif/frame.h 2012-11-08 16:29:22 +0000
@@ -89,6 +89,7 @@
89 UFStatusErrorInvalidType, /**< The variable type passed as a void pointer into89 UFStatusErrorInvalidType, /**< The variable type passed as a void pointer into
90 a property getter is invalid for the property90 a property getter is invalid for the property
91 */91 */
92 UFStatusErrorTouchIdExists, /**< A touch with the same ID already exists */
92} UFStatus;93} UFStatus;
9394
94/** Properties of a device */95/** Properties of a device */
9596
=== added file 'include/oif/frame_backend.h'
--- include/oif/frame_backend.h 1970-01-01 00:00:00 +0000
+++ include/oif/frame_backend.h 2012-11-08 16:29:22 +0000
@@ -0,0 +1,291 @@
1/**
2 * @file oif/frame_backend.h
3 * API for creating objects.
4 */
5
6#ifndef FRAME_OIF_FRAME_BACKEND_H_
7#define FRAME_OIF_FRAME_BACKEND_H_
8
9/* front end definitions */
10#include <oif/frame.h>
11
12#ifdef __cplusplus
13extern "C" {
14#endif
15
16/** Handle for a device to be used on the backend API */
17typedef struct UFBackendDevice_* UFBackendDevice;
18
19/** Handle for a frame to be used on the backend API */
20typedef struct UFBackendFrame_* UFBackendFrame;
21
22/** Handle for a touch to be used on the backend API */
23typedef struct UFBackendTouch_* UFBackendTouch;
24
25/********************************************************************
26 * Event
27 ********************************************************************/
28
29/**
30 * Creates a new event with a reference count of one.
31 */
32FRAME_PUBLIC
33UFEvent frame_event_new();
34
35/**
36 * Sets the type of the given event
37 */
38FRAME_PUBLIC
39void frame_event_set_type(UFEvent event, UFEventType type);
40
41/**
42 * Sets the device property of the given event
43 *
44 * It increases the reference count of the corresponding UFDevice by one.
45 */
46FRAME_PUBLIC
47void frame_event_set_device(UFEvent event, UFBackendDevice device);
48
49/**
50 * Sets the frame property of the given event
51 *
52 * It increases the reference count of the corresponding UFFrame by one.
53 */
54FRAME_PUBLIC
55void frame_event_set_frame(UFEvent event, UFBackendFrame frame);
56
57/**
58 * Sets the time of the given event
59 */
60FRAME_PUBLIC
61void frame_event_set_time(UFEvent event, uint64_t time);
62
63/********************************************************************
64 * Device
65 ********************************************************************/
66
67/**
68 * Creates a new UFDevice and returns its backend handle.
69 */
70FRAME_PUBLIC
71UFBackendDevice frame_backend_device_new();
72
73/**
74 * Returns a UFDevice instance given its backend handle.
75 */
76FRAME_PUBLIC
77UFDevice frame_backend_device_get_device(UFBackendDevice device);
78
79/**
80 * Sets the "Name" property of the given device
81 */
82FRAME_PUBLIC
83void frame_backend_device_set_name(UFBackendDevice device, const char *name);
84
85/**
86 * Sets the "Direct" property of the given device
87 */
88FRAME_PUBLIC
89void frame_backend_device_set_direct(UFBackendDevice device, int direct);
90
91/**
92 * Sets the "Independent" property of the given device
93 */
94FRAME_PUBLIC
95void frame_backend_device_set_independent(UFBackendDevice device, int independent);
96
97/**
98 * Sets the "SemiMT" property of the given device
99 */
100FRAME_PUBLIC
101void frame_backend_device_set_semi_mt(UFBackendDevice device, int semi_mt);
102
103/**
104 * Sets the "MaxTouches" property of the given device
105 */
106FRAME_PUBLIC
107void frame_backend_device_set_max_touches(UFBackendDevice device, unsigned int max_touches);
108
109/**
110 * Sets the "WindowResolutionX" and "WindowResolutionY" properties of the
111 * given device.
112 */
113FRAME_PUBLIC
114void frame_backend_device_set_window_resolution(UFBackendDevice device, float x, float y);
115
116/**
117 * Adds an axis to the device
118 */
119FRAME_PUBLIC
120void frame_backend_device_add_axis(UFBackendDevice device,
121 UFAxisType type,
122 float min, float max, float resolution);
123
124/**
125 * Deletes the backend handle of a UFDevice, decreasing its reference count by one.
126 */
127FRAME_PUBLIC
128void frame_backend_device_delete(UFBackendDevice device);
129
130/********************************************************************
131 * Frame
132 ********************************************************************/
133
134/**
135 * Creates a new, empty, UFFrame and returns its backend handle.
136 *
137 * Usually you will use this method only for the very first frame. For all
138 * subsequent ones it will be safer and more convinent to use
139 * frame_backend_frame_create_next().
140 */
141FRAME_PUBLIC
142UFBackendFrame frame_backend_frame_new();
143
144/**
145 * Creates a new UFFrame that is a continuation of the given one.
146 *
147 * Touches that had a "begin" state on the given frame will be hard-copied and
148 * have an "update" state on the new frame.
149 *
150 * Touches that had an "update" state will be lazily copied to the new frame.
151 *
152 * Touches that had a "end" state on the given frame won't be present
153 * on the new frame.
154 */
155FRAME_PUBLIC
156UFBackendFrame frame_backend_frame_create_next(UFBackendFrame frame);
157
158/**
159 * Returns a UFFrame instance given its backend handle.
160 */
161FRAME_PUBLIC
162UFFrame frame_backend_frame_get_frame(UFBackendFrame frame);
163
164/**
165 * Gets a UFBackendTouch for the UFTouch that has the given id.
166 *
167 * The underlying UFTouch is moved from the given frame to the returned UFBackendTouch.
168 * Once done modifying the touch you're expected to return it to the frame via
169 * frame_backend_frame_give_touch().
170 *
171 * If the underlying UFTouch is a lazy copy (likely from a touch in the previous frame), a hard copy
172 * will be made upon the first change made to it.
173 *
174 * Possible errors: UFStatusErrorInvalidTouch
175 */
176FRAME_PUBLIC
177UFStatus frame_backend_frame_borrow_touch_by_id(UFBackendFrame frame,
178 UFTouchId id,
179 UFBackendTouch *touch);
180
181/**
182 * Sets the "Device" property of the given frame
183 */
184FRAME_PUBLIC
185void frame_backend_frame_set_device(UFBackendFrame frame, UFBackendDevice device);
186
187/**
188 * Sets the "WindowId" property of the given frame
189 */
190FRAME_PUBLIC
191void frame_backend_frame_set_window_id(UFBackendFrame frame, UFWindowId window_id);
192
193/**
194 * Sets the "ActiveTouches" property of the given frame
195 *
196 * If unset this property returns the number of touches.
197 */
198FRAME_PUBLIC
199void frame_backend_frame_set_active_touches(UFBackendFrame frame, unsigned int active_touches);
200
201/**
202 * Gives a UFTouch to the specified frame.
203 *
204 * Gives the underlying UFTouch to the specified frame. The UFBackendTouch
205 * is deleted and no longer valid after this call.
206 *
207 * Possible errors: UFStatusErrorTouchIdExists
208 */
209FRAME_PUBLIC
210UFStatus frame_backend_frame_give_touch(UFBackendFrame frame, UFBackendTouch *touch);
211
212/**
213 * Deletes the backend handle of a UFFrame,
214 * decreasing its reference count by one.
215 */
216FRAME_PUBLIC
217void frame_backend_frame_delete(UFBackendFrame frame);
218
219/********************************************************************
220 * Touch
221 ********************************************************************/
222
223/**
224 * Creates a new UFTouch and returns its backend handle.
225 *
226 * Its state will be set to "Begin".
227 *
228 * After filled out, it should be given to a frame via frame_backend_frame_give_touch()
229 */
230FRAME_PUBLIC
231UFBackendTouch frame_backend_touch_new();
232
233/**
234 * Returns a UFTouch instance given its backend handle.
235 */
236FRAME_PUBLIC
237UFTouch frame_backend_touch_get_touch(UFBackendTouch touch);
238
239/**
240 * Sets the "Id" property of the given touch
241 */
242FRAME_PUBLIC
243void frame_backend_touch_set_id(UFBackendTouch touch, UFTouchId id);
244
245/**
246 * Sets the "State" property of the given touch to "End"
247 */
248FRAME_PUBLIC
249void frame_backend_touch_set_ended(UFBackendTouch touch);
250
251/**
252 * Sets the "WindowX" and "WindowY" properties of the given touch
253 */
254FRAME_PUBLIC
255void frame_backend_touch_set_window_pos(UFBackendTouch touch, float x, float y);
256
257/**
258 * Sets the "Time" property of the given touch
259 */
260FRAME_PUBLIC
261void frame_backend_touch_set_time(UFBackendTouch touch, uint64_t time);
262
263/**
264 * Sets the "StartTime" property of the given touch
265 */
266FRAME_PUBLIC
267void frame_backend_touch_set_start_time(UFBackendTouch touch, uint64_t start_time);
268
269/**
270 * Sets the "Owned" property of the given touch
271 */
272FRAME_PUBLIC
273void frame_backend_touch_set_owned(UFBackendTouch touch, int owned);
274
275/**
276 * Sets the "PendingEnd" property of the given touch
277 */
278FRAME_PUBLIC
279void frame_backend_touch_set_pending_end(UFBackendTouch touch, int pending_end);
280
281/**
282 * Sets the value of an axis of the given touch
283 */
284FRAME_PUBLIC
285void frame_backend_touch_set_value(UFBackendTouch touch, UFAxisType type, float value);
286
287#ifdef __cplusplus
288}
289#endif
290
291#endif /* FRAME_OIF_FRAME_BACKEND_H_ */
0292
=== modified file 'src/Makefile.am'
--- src/Makefile.am 2012-06-21 19:41:40 +0000
+++ src/Makefile.am 2012-11-08 16:29:22 +0000
@@ -9,8 +9,6 @@
99
10libframe_la_LIBADD = \10libframe_la_LIBADD = \
11 -lm \11 -lm \
12 $(EVEMU_LIBS) \
13 $(MTDEV_LIBS) \
14 $(COVERAGE_LIBS) \12 $(COVERAGE_LIBS) \
15 $(XINPUT_LIBS) \13 $(XINPUT_LIBS) \
16 $(CXX_LIBS)14 $(CXX_LIBS)
@@ -32,6 +30,7 @@
32libframeincludedir = $(includedir)/oif30libframeincludedir = $(includedir)/oif
33libframeinclude_HEADERS = \31libframeinclude_HEADERS = \
34 $(top_srcdir)/include/oif/frame.h \32 $(top_srcdir)/include/oif/frame.h \
33 $(top_srcdir)/include/oif/frame_backend.h \
35 $(top_srcdir)/include/oif/frame_internal.h \34 $(top_srcdir)/include/oif/frame_internal.h \
36 $(top_srcdir)/include/oif/frame_x11.h35 $(top_srcdir)/include/oif/frame_x11.h
3736
3837
=== modified file 'src/Makefile.in'
--- src/Makefile.in 2012-07-26 18:35:10 +0000
+++ src/Makefile.in 2012-11-08 16:29:22 +0000
@@ -1,4 +1,4 @@
1# Makefile.in generated by automake 1.11.5 from Makefile.am.1# Makefile.in generated by automake 1.11.6 from Makefile.am.
2# @configure_input@2# @configure_input@
33
4# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,4# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -100,7 +100,7 @@
100LTLIBRARIES = $(lib_LTLIBRARIES)100LTLIBRARIES = $(lib_LTLIBRARIES)
101am__DEPENDENCIES_1 =101am__DEPENDENCIES_1 =
102libframe_la_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \102libframe_la_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
103 $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)103 $(am__DEPENDENCIES_1)
104am_libframe_la_OBJECTS = axis.lo device.lo event.lo frame.lo handle.lo \104am_libframe_la_OBJECTS = axis.lo device.lo event.lo frame.lo handle.lo \
105 touch.lo value.lo window.lo device_x11.lo frame_x11.lo \105 touch.lo value.lo window.lo device_x11.lo frame_x11.lo \
106 handle_x11.lo window_x11.lo106 handle_x11.lo window_x11.lo
@@ -340,8 +340,6 @@
340340
341libframe_la_LIBADD = \341libframe_la_LIBADD = \
342 -lm \342 -lm \
343 $(EVEMU_LIBS) \
344 $(MTDEV_LIBS) \
345 $(COVERAGE_LIBS) \343 $(COVERAGE_LIBS) \
346 $(XINPUT_LIBS) \344 $(XINPUT_LIBS) \
347 $(CXX_LIBS)345 $(CXX_LIBS)
@@ -362,6 +360,7 @@
362libframeincludedir = $(includedir)/oif360libframeincludedir = $(includedir)/oif
363libframeinclude_HEADERS = \361libframeinclude_HEADERS = \
364 $(top_srcdir)/include/oif/frame.h \362 $(top_srcdir)/include/oif/frame.h \
363 $(top_srcdir)/include/oif/frame_backend.h \
365 $(top_srcdir)/include/oif/frame_internal.h \364 $(top_srcdir)/include/oif/frame_internal.h \
366 $(top_srcdir)/include/oif/frame_x11.h365 $(top_srcdir)/include/oif/frame_x11.h
367366
368367
=== modified file 'src/device.cpp'
--- src/device.cpp 2012-06-21 19:41:40 +0000
+++ src/device.cpp 2012-11-08 16:29:22 +0000
@@ -24,6 +24,8 @@
2424
25#include "axis.h"25#include "axis.h"
2626
27#include <oif/frame_backend.h>
28
27namespace oif {29namespace oif {
28namespace frame {30namespace frame {
2931
@@ -75,18 +77,30 @@
75UFStatus frame_device_get_property_unsigned_int_(UFDevice device,77UFStatus frame_device_get_property_unsigned_int_(UFDevice device,
76 UFDeviceProperty property,78 UFDeviceProperty property,
77 unsigned int *value) {79 unsigned int *value) {
78 return static_cast<const oif::frame::UFDevice*>(device)->GetProperty(80
79 property,81 if (property == UFDevicePropertyNumAxes) {
80 value);82 *value = static_cast<const oif::frame::UFDevice*>(device)->axes_.size();
83 return UFStatusSuccess;
84 } else {
85 return static_cast<const oif::frame::UFDevice*>(device)->GetProperty(
86 property,
87 value);
88 }
81}89}
8290
83#undef frame_device_get_property /* Override C11 generic selections macro */91#undef frame_device_get_property /* Override C11 generic selections macro */
84FRAME_PUBLIC92FRAME_PUBLIC
85UFStatus frame_device_get_property(UFDevice device, UFDeviceProperty property,93UFStatus frame_device_get_property(UFDevice device, UFDeviceProperty property,
86 void *value) {94 void *value) {
87 return static_cast<const oif::frame::UFDevice*>(device)->GetProperty(95 if (property == UFDevicePropertyNumAxes) {
88 property,96 *reinterpret_cast<unsigned int *>(value) =
89 value);97 static_cast<const oif::frame::UFDevice*>(device)->axes_.size();
98 return UFStatusSuccess;
99 } else {
100 return static_cast<const oif::frame::UFDevice*>(device)->GetProperty(
101 property,
102 value);
103 }
90}104}
91105
92UFStatus frame_device_get_axis_by_index(UFDevice device, unsigned int index,106UFStatus frame_device_get_axis_by_index(UFDevice device, unsigned int index,
@@ -129,4 +143,77 @@
129 return resolution;143 return resolution;
130}144}
131145
146UFBackendDevice frame_backend_device_new()
147{
148 return new UFBackendDevice_(new oif::frame::UFDevice);
149}
150
151UFDevice frame_backend_device_get_device(UFBackendDevice device)
152{
153 return device->shared_ptr.get();
154}
155
156void frame_backend_device_delete(UFBackendDevice device)
157{
158 delete device;
159}
160
161void frame_backend_device_set_name(UFBackendDevice device, const char *name)
162{
163 static_cast<oif::frame::UFDevice*>(device->shared_ptr.get())->
164 InsertProperty(UFDevicePropertyName,
165 new oif::frame::Value(name));
166}
167
168void frame_backend_device_set_direct(UFBackendDevice device, int direct)
169{
170 static_cast<oif::frame::UFDevice*>(device->shared_ptr.get())->
171 InsertProperty(UFDevicePropertyDirect,
172 new oif::frame::Value(direct));
173}
174
175void frame_backend_device_set_independent(UFBackendDevice device, int independent)
176{
177 static_cast<oif::frame::UFDevice*>(device->shared_ptr.get())->
178 InsertProperty(UFDevicePropertyIndependent,
179 new oif::frame::Value(independent));
180}
181
182void frame_backend_device_set_semi_mt(UFBackendDevice device, int semi_mt)
183{
184 static_cast<oif::frame::UFDevice*>(device->shared_ptr.get())->
185 InsertProperty(UFDevicePropertySemiMT,
186 new oif::frame::Value(semi_mt));
187}
188
189void frame_backend_device_set_max_touches(UFBackendDevice device, unsigned int max_touches)
190{
191 static_cast<oif::frame::UFDevice*>(device->shared_ptr.get())->
192 InsertProperty(UFDevicePropertyMaxTouches,
193 new oif::frame::Value(max_touches));
194}
195
196void frame_backend_device_set_window_resolution(UFBackendDevice device, float x, float y)
197{
198 static_cast<oif::frame::UFDevice*>(device->shared_ptr.get())->
199 InsertProperty(UFDevicePropertyWindowResolutionX,
200 new oif::frame::Value(x));
201
202 static_cast<oif::frame::UFDevice*>(device->shared_ptr.get())->
203 InsertProperty(UFDevicePropertyWindowResolutionY,
204 new oif::frame::Value(y));
205}
206
207void frame_backend_device_add_axis(UFBackendDevice device,
208 UFAxisType type,
209 float min, float max, float resolution)
210{
211 using oif::frame::UFAxis;
212
213 UFAxis_* axis = new UFAxis(type, min, max, resolution);
214
215 static_cast<oif::frame::UFDevice*>(device->shared_ptr.get())->
216 axes_[type] = std::unique_ptr<UFAxis>(static_cast<UFAxis*>(axis));
217}
218
132} // extern "C"219} // extern "C"
133220
=== modified file 'src/device.h'
--- src/device.h 2012-06-21 19:41:40 +0000
+++ src/device.h 2012-11-08 16:29:22 +0000
@@ -32,6 +32,13 @@
32 virtual ~UFDevice_() {};32 virtual ~UFDevice_() {};
33};33};
3434
35struct UFBackendDevice_ {
36 UFBackendDevice_(oif::frame::UFDevice* device)
37 : shared_ptr(device) {}
38
39 oif::frame::SharedUFDevice shared_ptr;
40};
41
35namespace oif {42namespace oif {
36namespace frame {43namespace frame {
3744
@@ -45,7 +52,6 @@
45 UFDevice(const UFDevice&) = delete;52 UFDevice(const UFDevice&) = delete;
46 UFDevice& operator=(const UFDevice&) = delete;53 UFDevice& operator=(const UFDevice&) = delete;
4754
48 protected:
49 typedef std::unique_ptr<UFAxis> UniqueUFAxis;55 typedef std::unique_ptr<UFAxis> UniqueUFAxis;
5056
51 std::map<UFAxisType, UniqueUFAxis> axes_;57 std::map<UFAxisType, UniqueUFAxis> axes_;
5258
=== modified file 'src/event.cpp'
--- src/event.cpp 2012-06-21 19:41:40 +0000
+++ src/event.cpp 2012-11-08 16:29:22 +0000
@@ -22,10 +22,17 @@
2222
23#include "event.h"23#include "event.h"
24#include "frame.h"24#include "frame.h"
25#include "device.h"
26
27#include <oif/frame_backend.h>
2528
26namespace oif {29namespace oif {
27namespace frame {30namespace frame {
2831
32UFEvent::UFEvent()
33 : ref_count_(1) {
34}
35
29UFEvent::UFEvent(UFEventType type, const Value* data, uint64_t time)36UFEvent::UFEvent(UFEventType type, const Value* data, uint64_t time)
30 : ref_count_(1) {37 : ref_count_(1) {
31 const Value* value;38 const Value* value;
@@ -70,6 +77,10 @@
7077
71extern "C" {78extern "C" {
7279
80UFEvent frame_event_new() {
81 return new oif::frame::UFEvent;
82}
83
73void frame_event_ref(UFEvent event) {84void frame_event_ref(UFEvent event) {
74 static_cast<oif::frame::UFEvent*>(event)->Ref();85 static_cast<oif::frame::UFEvent*>(event)->Ref();
75}86}
@@ -140,4 +151,30 @@
140 return time;151 return time;
141}152}
142153
154void frame_event_set_type(UFEvent event, UFEventType type)
155{
156 static_cast<oif::frame::UFEvent*>(event)->
157 InsertProperty(UFEventPropertyType, new oif::frame::Value(type));
158}
159
160void frame_event_set_device(UFEvent event, UFBackendDevice device)
161{
162 static_cast<oif::frame::UFEvent*>(event)->
163 InsertProperty(UFEventPropertyDevice,
164 new oif::frame::Value(device->shared_ptr));
165}
166
167void frame_event_set_frame(UFEvent event, UFBackendFrame frame)
168{
169 static_cast<oif::frame::UFEvent*>(event)->
170 InsertProperty(UFEventPropertyFrame,
171 new oif::frame::Value(frame->shared_ptr));
172}
173
174void frame_event_set_time(UFEvent event, uint64_t time)
175{
176 static_cast<oif::frame::UFEvent*>(event)->
177 InsertProperty(UFEventPropertyTime, new oif::frame::Value(time));
178}
179
143} // extern "C"180} // extern "C"
144181
=== modified file 'src/event.h'
--- src/event.h 2012-06-21 19:41:40 +0000
+++ src/event.h 2012-11-08 16:29:22 +0000
@@ -37,6 +37,7 @@
3737
38class UFEvent : public UFEvent_, public Property<UFEventProperty> {38class UFEvent : public UFEvent_, public Property<UFEventProperty> {
39 public:39 public:
40 UFEvent();
40 UFEvent(UFEventType type, const Value* data, uint64_t time);41 UFEvent(UFEventType type, const Value* data, uint64_t time);
41 ~UFEvent();42 ~UFEvent();
4243
4344
=== modified file 'src/frame.cpp'
--- src/frame.cpp 2012-06-21 19:41:40 +0000
+++ src/frame.cpp 2012-11-08 16:29:22 +0000
@@ -23,15 +23,16 @@
23#include <assert.h>23#include <assert.h>
24#include <stdio.h>24#include <stdio.h>
2525
26#include "device.h"
26#include "touch.h"27#include "touch.h"
27#include "window.h"28
29#include <oif/frame_backend.h>
2830
29namespace oif {31namespace oif {
30namespace frame {32namespace frame {
3133
32UFFrame::UFFrame(const SharedWindow& window, const SharedUFFrame& prev)34UFFrame::UFFrame(const SharedUFFrame& prev)
33 : prev_(prev),35 : prev_(prev),
34 window_(window),
35 touches_array_(),36 touches_array_(),
36 touches_map_() {37 touches_map_() {
37 for (const SharedUFTouch& prev_touch : prev_->touches_array_) {38 for (const SharedUFTouch& prev_touch : prev_->touches_array_) {
@@ -93,6 +94,30 @@
9394
94} // namespace95} // namespace
9596
97UFStatus UFFrame::GiveTouch(SharedUFTouch& touch) {
98 auto map_it = touches_map_.find(touch->id());
99 if (map_it != touches_map_.end()) {
100 /* A loan is being returned */
101
102 SharedUFTouch &our_touch = touches_array_[map_it->second];
103
104 /* we shouldn't be referencing to any UFTouch here.
105 If we are, it's a programming error by the API user. */
106 if (our_touch.get() != NULL) {
107 return UFStatusErrorTouchIdExists;
108 }
109
110 /* take back our UFtouch */
111 our_touch.swap(touch);
112 } else {
113 touches_map_[touch->id()] = touches_array_.size();
114 touches_array_.push_back(touch);
115 touch.reset();
116 }
117
118 return UFStatusSuccess;
119}
120
96void UFFrame::UpdateTouch(const SharedUFTouch& touch) {121void UFFrame::UpdateTouch(const SharedUFTouch& touch) {
97 auto map_it = touches_map_.find(touch->id());122 auto map_it = touches_map_.find(touch->id());
98123
@@ -104,12 +129,6 @@
104 } else {129 } else {
105 touches_map_[touch->id()] = touches_array_.size();130 touches_map_[touch->id()] = touches_array_.size();
106 touches_array_.push_back(touch);131 touches_array_.push_back(touch);
107
108 const Value *value;
109 value = new Value(static_cast<unsigned int>(touches_map_.size()));
110 InsertProperty(UFFramePropertyNumTouches, value);
111 value = new Value(static_cast<unsigned int>(touches_map_.size()));
112 InsertProperty(UFFramePropertyActiveTouches, value);
113 }132 }
114 break;133 break;
115134
@@ -169,6 +188,14 @@
169 return UFStatusSuccess;188 return UFStatusSuccess;
170}189}
171190
191SharedUFTouch* UFFrame::GetSharedTouchById(UFTouchId touch_id) {
192 auto it = touches_map_.find(touch_id);
193 if (it == touches_map_.end())
194 return nullptr;
195 else
196 return &(touches_array_[it->second]);
197}
198
172UFStatus UFFrame::GetTouchById(UFTouchId touch_id, ::UFTouch* touch) const {199UFStatus UFFrame::GetTouchById(UFTouchId touch_id, ::UFTouch* touch) const {
173 auto it = touches_map_.find(touch_id);200 auto it = touches_map_.find(touch_id);
174 if (it == touches_map_.end())201 if (it == touches_map_.end())
@@ -211,8 +238,21 @@
211 UFFrameProperty property,238 UFFrameProperty property,
212 unsigned int *value) {239 unsigned int *value) {
213 const oif::frame::UFFrame* ufframe =240 const oif::frame::UFFrame* ufframe =
214 static_cast<const oif::frame::UFFrame*>(frame);241 static_cast<const oif::frame::UFFrame*>(frame);
215 return ufframe->GetProperty(property, value);242
243 if (property == UFFramePropertyNumTouches) {
244 *value = ufframe->GetNumTouches();
245 return UFStatusSuccess;
246 } else if (property == UFFramePropertyActiveTouches) {
247 UFStatus status = ufframe->GetProperty(property, value);
248 if (status != UFStatusSuccess) {
249 *value = ufframe->GetNumTouches();
250 status = UFStatusSuccess;
251 }
252 return status;
253 } else {
254 return ufframe->GetProperty(property, value);
255 }
216}256}
217257
218#undef frame_frame_get_property /* Override C11 generic selections macro */258#undef frame_frame_get_property /* Override C11 generic selections macro */
@@ -221,7 +261,20 @@
221 void *value) {261 void *value) {
222 const oif::frame::UFFrame* ufframe =262 const oif::frame::UFFrame* ufframe =
223 static_cast<const oif::frame::UFFrame*>(frame);263 static_cast<const oif::frame::UFFrame*>(frame);
224 return ufframe->GetProperty(property, value);264
265 if (property == UFFramePropertyNumTouches) {
266 *reinterpret_cast<unsigned int *>(value) = ufframe->GetNumTouches();
267 return UFStatusSuccess;
268 } else if (property == UFFramePropertyActiveTouches) {
269 UFStatus status = ufframe->GetProperty(property, value);
270 if (status != UFStatusSuccess) {
271 *reinterpret_cast<unsigned int *>(value) = ufframe->GetNumTouches();
272 status = UFStatusSuccess;
273 }
274 return status;
275 } else {
276 return ufframe->GetProperty(property, value);
277 }
225}278}
226279
227UFStatus frame_frame_get_touch_by_index(UFFrame frame, unsigned int index,280UFStatus frame_frame_get_touch_by_index(UFFrame frame, unsigned int index,
@@ -269,13 +322,9 @@
269}322}
270323
271uint32_t frame_frame_get_num_touches(UFFrame frame) {324uint32_t frame_frame_get_num_touches(UFFrame frame) {
272 unsigned int num_touches;
273 const oif::frame::UFFrame* ufframe =325 const oif::frame::UFFrame* ufframe =
274 static_cast<const oif::frame::UFFrame*>(frame);326 static_cast<const oif::frame::UFFrame*>(frame);
275 UFStatus status = ufframe->GetProperty(UFFramePropertyNumTouches,327 return ufframe->GetNumTouches();
276 &num_touches);
277 assert(status == UFStatusSuccess);
278 return num_touches;
279}328}
280329
281UFDevice frame_frame_get_device(UFFrame frame) {330UFDevice frame_frame_get_device(UFFrame frame) {
@@ -287,4 +336,80 @@
287 return device;336 return device;
288}337}
289338
339UFBackendFrame frame_backend_frame_new()
340{
341 return new UFBackendFrame_(new oif::frame::UFFrame);
342}
343
344UFBackendFrame frame_backend_frame_create_next(UFBackendFrame frame)
345{
346 return new UFBackendFrame_(new oif::frame::UFFrame(frame->shared_ptr));
347}
348
349UFFrame frame_backend_frame_get_frame(UFBackendFrame frame)
350{
351 return frame->shared_ptr.get();
352}
353
354UFStatus frame_backend_frame_borrow_touch_by_id(UFBackendFrame frame,
355 UFTouchId id,
356 UFBackendTouch *touch)
357{
358 oif::frame::UFFrame* ufframe =
359 static_cast<oif::frame::UFFrame*>(frame->shared_ptr.get());
360
361 oif::frame::SharedUFTouch *shared_touch = ufframe->GetSharedTouchById(id);
362 if (shared_touch) {
363 *touch = new UFBackendTouch_(*shared_touch);
364 return UFStatusSuccess;
365 } else {
366 return UFStatusErrorInvalidTouch;
367 }
368}
369
370void frame_backend_frame_set_device(UFBackendFrame frame, UFBackendDevice device)
371{
372 static_cast<oif::frame::UFFrame*>(frame->shared_ptr.get())->
373 InsertProperty(UFFramePropertyDevice,
374 new oif::frame::Value(device->shared_ptr));
375}
376
377void frame_backend_frame_set_window_id(UFBackendFrame frame, UFWindowId window_id)
378{
379 static_cast<oif::frame::UFFrame*>(frame->shared_ptr.get())->
380 InsertProperty(UFFramePropertyWindowId,
381 new oif::frame::Value(window_id));
382}
383
384void frame_backend_frame_set_active_touches(UFBackendFrame frame, unsigned int active_touches)
385{
386 static_cast<oif::frame::UFFrame*>(frame->shared_ptr.get())->
387 InsertProperty(UFFramePropertyActiveTouches,
388 new oif::frame::Value(active_touches));
389}
390
391UFStatus frame_backend_frame_give_touch(UFBackendFrame frame, UFBackendTouch *touch)
392{
393 UFStatus status;
394
395 /* the touch backend must be carrying a UFtouch */
396 assert((*touch)->shared_ptr);
397
398 status = static_cast<oif::frame::UFFrame*>(frame->shared_ptr.get())->
399 GiveTouch((*touch)->shared_ptr);
400
401 /* frame must have taken the touch */
402 assert(!(*touch)->shared_ptr);
403
404 delete (*touch);
405 *touch = nullptr;
406
407 return status;
408}
409
410void frame_backend_frame_delete(UFBackendFrame frame)
411{
412 delete frame;
413}
414
290} // extern "C"415} // extern "C"
291416
=== modified file 'src/frame.h'
--- src/frame.h 2012-06-21 19:41:40 +0000
+++ src/frame.h 2012-11-08 16:29:22 +0000
@@ -33,23 +33,33 @@
33 virtual ~UFFrame_() {}33 virtual ~UFFrame_() {}
34};34};
3535
36struct UFBackendFrame_ {
37 UFBackendFrame_(oif::frame::UFFrame* frame)
38 : shared_ptr(frame) {}
39
40 oif::frame::SharedUFFrame shared_ptr;
41};
42
36namespace oif {43namespace oif {
37namespace frame {44namespace frame {
3845
39class UFFrame : public UFFrame_, public Property<UFFrameProperty> {46class UFFrame : public UFFrame_, public Property<UFFrameProperty> {
40 public:47 public:
41 UFFrame() : prev_(), window_(), touches_array_(), touches_map_() {}48 UFFrame() : prev_(), touches_array_(), touches_map_() {}
42 UFFrame(const SharedWindow& window, const SharedUFFrame& prev);49 UFFrame(const SharedUFFrame& prev);
4350
44 UFTouch* CopyTouch(UFTouchId touchid, UFTouchState new_state) const;51 UFTouch* CopyTouch(UFTouchId touchid, UFTouchState new_state) const;
45 bool IsTouchOwned(UFTouchId touchid);52 bool IsTouchOwned(UFTouchId touchid);
53 UFStatus GiveTouch(SharedUFTouch& touch);
46 void UpdateTouch(const SharedUFTouch& touch);54 void UpdateTouch(const SharedUFTouch& touch);
47 bool IsEnded() const;55 bool IsEnded() const;
56 unsigned int GetNumTouches() const { return touches_array_.size(); }
48 UFStatus GetPreviousTouchValue(const UFTouch* touch, UFAxisType type,57 UFStatus GetPreviousTouchValue(const UFTouch* touch, UFAxisType type,
49 float* value) const;58 float* value) const;
50 UFStatus GetPreviousTouchProperty(const UFTouch* touch,59 UFStatus GetPreviousTouchProperty(const UFTouch* touch,
51 UFTouchProperty property, void* value) const;60 UFTouchProperty property, void* value) const;
52 UFStatus GetTouchByIndex(unsigned int index, ::UFTouch* touch) const;61 UFStatus GetTouchByIndex(unsigned int index, ::UFTouch* touch) const;
62 SharedUFTouch* GetSharedTouchById(UFTouchId touch_id);
53 UFStatus GetTouchById(UFTouchId touch_id, ::UFTouch* touch) const;63 UFStatus GetTouchById(UFTouchId touch_id, ::UFTouch* touch) const;
54 void ReleasePreviousFrame();64 void ReleasePreviousFrame();
5565
@@ -58,7 +68,6 @@
5868
59 private:69 private:
60 SharedUFFrame prev_;70 SharedUFFrame prev_;
61 SharedWindow window_;
62 std::vector<SharedUFTouch> touches_array_;71 std::vector<SharedUFTouch> touches_array_;
63 std::map<UFTouchId, unsigned int> touches_map_;72 std::map<UFTouchId, unsigned int> touches_map_;
64};73};
6574
=== modified file 'src/libframe.ver'
--- src/libframe.ver 2012-06-21 19:41:40 +0000
+++ src/libframe.ver 2012-11-08 16:29:22 +0000
@@ -64,3 +64,42 @@
64 local:64 local:
65 *;65 *;
66};66};
67
68FRAME_2.4 {
69 global:
70 frame_backend_device_new;
71 frame_backend_device_get_device;
72 frame_backend_device_delete;
73 frame_backend_device_set_name;
74 frame_backend_device_set_direct;
75 frame_backend_device_set_independent;
76 frame_backend_device_set_semi_mt;
77 frame_backend_device_set_max_touches;
78 frame_backend_device_set_window_resolution;
79 frame_backend_device_add_axis;
80 frame_backend_frame_new;
81 frame_backend_frame_create_next;
82 frame_backend_frame_get_frame;
83 frame_backend_frame_borrow_touch_by_id;
84 frame_backend_frame_set_device;
85 frame_backend_frame_set_window_id;
86 frame_backend_frame_set_active_touches;
87 frame_backend_frame_give_touch;
88 frame_backend_frame_delete;
89 frame_backend_touch_new;
90 frame_backend_touch_get_touch;
91 frame_backend_touch_set_id;
92 frame_backend_touch_set_ended;
93 frame_backend_touch_set_window_pos;
94 frame_backend_touch_set_time;
95 frame_backend_touch_set_start_time;
96 frame_backend_touch_set_owned;
97 frame_backend_touch_set_pending_end;
98 frame_backend_touch_set_value;
99
100 frame_event_new;
101 frame_event_set_type;
102 frame_event_set_device;
103 frame_event_set_frame;
104 frame_event_set_time;
105} FRAME_2.2;
67106
=== modified file 'src/touch.cpp'
--- src/touch.cpp 2012-06-21 19:41:40 +0000
+++ src/touch.cpp 2012-11-08 16:29:22 +0000
@@ -24,9 +24,34 @@
2424
25#include "frame.h"25#include "frame.h"
2626
27#include <oif/frame_backend.h>
28
29oif::frame::UFTouch* UFBackendTouch_::GetModifiableTouch() {
30 if (shared_ptr.unique()) {
31 return static_cast<oif::frame::UFTouch*>(shared_ptr.get());
32 } else {
33 /* Make a hard-copy. We don't want other holders of that UFTouch (like frames
34 from previous but still existing events) to get the changes about to be
35 made through this UFBackendTouch. */
36 oif::frame::UFTouch *old_touch =
37 static_cast<oif::frame::UFTouch*>(shared_ptr.get());
38 oif::frame::UFTouch *new_touch = new oif::frame::UFTouch(*old_touch);
39 shared_ptr.reset(new_touch);
40 return new_touch;
41 }
42}
43
27namespace oif {44namespace oif {
28namespace frame {45namespace frame {
2946
47UFTouch::UFTouch()
48 : state_(UFTouchStateBegin) {
49 const Value* value;
50
51 value = new Value(state_);
52 InsertProperty(UFTouchPropertyState, value);
53}
54
30UFTouch::UFTouch(UFTouchState state, UFTouchId id, float x, float y,55UFTouch::UFTouch(UFTouchState state, UFTouchId id, float x, float y,
31 uint64_t time)56 uint64_t time)
32 : id_(id),57 : id_(id),
@@ -205,4 +230,75 @@
205 return start_time;230 return start_time;
206}231}
207232
233UFBackendTouch frame_backend_touch_new()
234{
235 return new UFBackendTouch_(new oif::frame::UFTouch);
236}
237
238UFTouch frame_backend_touch_get_touch(UFBackendTouch touch)
239{
240 return touch->shared_ptr.get();
241}
242
243void frame_backend_touch_set_id(UFBackendTouch touch_backend, UFTouchId id)
244{
245 oif::frame::UFTouch *touch = touch_backend->GetModifiableTouch();
246
247 touch->InsertProperty(UFTouchPropertyId, new oif::frame::Value(id));
248 touch->SetId(id);
249}
250
251void frame_backend_touch_set_ended(UFBackendTouch touch_backend)
252{
253 oif::frame::UFTouch *touch = touch_backend->GetModifiableTouch();
254
255 touch->InsertProperty(UFTouchPropertyState, new oif::frame::Value(UFTouchStateEnd));
256 touch->SetState(UFTouchStateEnd);
257}
258
259void frame_backend_touch_set_window_pos(UFBackendTouch touch_backend, float x, float y)
260{
261 oif::frame::UFTouch *touch = touch_backend->GetModifiableTouch();
262
263 touch->InsertProperty(UFTouchPropertyWindowX, new oif::frame::Value(x));
264 touch->InsertProperty(UFTouchPropertyWindowY, new oif::frame::Value(y));
265}
266
267void frame_backend_touch_set_time(UFBackendTouch touch_backend, uint64_t time)
268{
269 oif::frame::UFTouch *touch = touch_backend->GetModifiableTouch();
270
271 touch->InsertProperty(UFTouchPropertyTime, new oif::frame::Value(time));
272}
273
274void frame_backend_touch_set_start_time(UFBackendTouch touch_backend,
275 uint64_t start_time)
276{
277 oif::frame::UFTouch *touch = touch_backend->GetModifiableTouch();
278
279 touch->InsertProperty(UFTouchPropertyStartTime, new oif::frame::Value(start_time));
280}
281
282void frame_backend_touch_set_owned(UFBackendTouch touch_backend, int owned)
283{
284 oif::frame::UFTouch *touch = touch_backend->GetModifiableTouch();
285
286 touch->InsertProperty(UFTouchPropertyOwned, new oif::frame::Value(owned));
287}
288
289void frame_backend_touch_set_pending_end(UFBackendTouch touch_backend, int pending_end)
290{
291 oif::frame::UFTouch *touch = touch_backend->GetModifiableTouch();
292
293 touch->InsertProperty(UFTouchPropertyPendingEnd, new oif::frame::Value(pending_end));
294}
295
296void frame_backend_touch_set_value(UFBackendTouch touch_backend,
297 UFAxisType type, float value)
298{
299 oif::frame::UFTouch *touch = touch_backend->GetModifiableTouch();
300
301 touch->SetValue(type, value);
302}
303
208} // extern "C"304} // extern "C"
209305
=== modified file 'src/touch.h'
--- src/touch.h 2012-06-21 19:41:40 +0000
+++ src/touch.h 2012-11-08 16:29:22 +0000
@@ -34,27 +34,43 @@
34 virtual ~UFTouch_() {}34 virtual ~UFTouch_() {}
35};35};
3636
37struct UFBackendTouch_ {
38 UFBackendTouch_(oif::frame::UFTouch* touch)
39 : shared_ptr(touch) {}
40
41 UFBackendTouch_(oif::frame::SharedUFTouch &shared_touch) {
42 shared_ptr.swap(shared_touch);
43 }
44
45 oif::frame::UFTouch* GetModifiableTouch();
46
47 oif::frame::SharedUFTouch shared_ptr;
48};
49
37namespace oif {50namespace oif {
38namespace frame {51namespace frame {
3952
40class UFTouch : public UFTouch_, public Property<UFTouchProperty> {53class UFTouch : public UFTouch_, public Property<UFTouchProperty> {
41 public:54 public:
55 UFTouch();
42 UFTouch(UFTouchState state, UFTouchId id, float x, float y,56 UFTouch(UFTouchState state, UFTouchId id, float x, float y,
43 uint64_t time);57 uint64_t time);
44 UFTouch(const UFTouch& touch, UFTouchState new_state);58 UFTouch(const UFTouch& touch, UFTouchState new_state);
4559
60 void SetId(UFTouchId id) { id_ = id; }
46 UFTouchId id() const { return id_; }61 UFTouchId id() const { return id_; }
62
63 void SetState(UFTouchState state) { state_ = state; }
47 UFTouchState state() const { return state_; }64 UFTouchState state() const { return state_; }
4865
49 void SetValue(UFAxisType type, float value);66 void SetValue(UFAxisType type, float value);
50 UFStatus GetValue(UFAxisType type, float* value) const;67 UFStatus GetValue(UFAxisType type, float* value) const;
5168
52 UFTouch(const UFTouch&) = delete;
53 UFTouch& operator=(const UFTouch&) = delete;69 UFTouch& operator=(const UFTouch&) = delete;
5470
55 private:71 private:
56 const UFTouchId id_;72 UFTouchId id_;
57 const UFTouchState state_;73 UFTouchState state_;
58 std::map<UFAxisType, float> values_;74 std::map<UFAxisType, float> values_;
59};75};
6076
6177
=== modified file 'src/window.h'
--- src/window.h 2012-06-21 19:41:40 +0000
+++ src/window.h 2012-11-08 16:29:22 +0000
@@ -31,7 +31,7 @@
31namespace oif{31namespace oif{
32namespace frame {32namespace frame {
3333
34class Window : public std::enable_shared_from_this<Window> {34class Window {
35 public:35 public:
36 Window();36 Window();
37 virtual ~Window() {};37 virtual ~Window() {};
3838
=== modified file 'src/x11/device_x11.cpp'
--- src/x11/device_x11.cpp 2012-06-21 19:41:40 +0000
+++ src/x11/device_x11.cpp 2012-11-08 16:29:22 +0000
@@ -135,9 +135,6 @@
135 }135 }
136 }136 }
137137
138 value = new Value(static_cast<unsigned int>(axes_.size()));
139 InsertProperty(UFDevicePropertyNumAxes, value);
140
141 /* X11 doesn't provide us the real physical resolution of the display */138 /* X11 doesn't provide us the real physical resolution of the display */
142 value = new Value(0.f);139 value = new Value(0.f);
143 InsertProperty(UFDevicePropertyWindowResolutionX, value);140 InsertProperty(UFDevicePropertyWindowResolutionX, value);
144141
=== modified file 'src/x11/window_x11.cpp'
--- src/x11/window_x11.cpp 2012-07-24 20:47:15 +0000
+++ src/x11/window_x11.cpp 2012-11-08 16:29:22 +0000
@@ -76,7 +76,7 @@
76 return false;76 return false;
77 }77 }
7878
79 *frame = SharedUFFrame(new UFFrame(shared_from_this(), current_frame_));79 *frame = SharedUFFrame(new UFFrame(current_frame_));
8080
81 const Value* value = new Value(frame_x11_create_window_id(window_));81 const Value* value = new Value(frame_x11_create_window_id(window_));
82 (*frame)->InsertProperty(UFFramePropertyWindowId, value);82 (*frame)->InsertProperty(UFFramePropertyWindowId, value);
@@ -145,7 +145,7 @@
145145
146bool WindowX11::HandleOwnershipEvent(const XITouchOwnershipEvent* event,146bool WindowX11::HandleOwnershipEvent(const XITouchOwnershipEvent* event,
147 SharedUFFrame* frame) {147 SharedUFFrame* frame) {
148 *frame = SharedUFFrame(new UFFrame(shared_from_this(), current_frame_));148 *frame = SharedUFFrame(new UFFrame(current_frame_));
149149
150 const Value* value = new Value(frame_x11_create_window_id(window_));150 const Value* value = new Value(frame_x11_create_window_id(window_));
151 (*frame)->InsertProperty(UFFramePropertyWindowId, value);151 (*frame)->InsertProperty(UFFramePropertyWindowId, value);
152152
=== modified file 'test/Makefile.in'
--- test/Makefile.in 2012-07-26 18:35:10 +0000
+++ test/Makefile.in 2012-11-08 16:29:22 +0000
@@ -1,4 +1,4 @@
1# Makefile.in generated by automake 1.11.5 from Makefile.am.1# Makefile.in generated by automake 1.11.6 from Makefile.am.
2# @configure_input@2# @configure_input@
33
4# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,4# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
55
=== modified file 'test/gtest/Makefile.in'
--- test/gtest/Makefile.in 2012-07-26 18:35:10 +0000
+++ test/gtest/Makefile.in 2012-11-08 16:29:22 +0000
@@ -1,4 +1,4 @@
1# Makefile.in generated by automake 1.11.5 from Makefile.am.1# Makefile.in generated by automake 1.11.6 from Makefile.am.
2# @configure_input@2# @configure_input@
33
4# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,4# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
55
=== modified file 'test/integration/Makefile.in'
--- test/integration/Makefile.in 2012-07-26 18:35:10 +0000
+++ test/integration/Makefile.in 2012-11-08 16:29:22 +0000
@@ -1,4 +1,4 @@
1# Makefile.in generated by automake 1.11.5 from Makefile.am.1# Makefile.in generated by automake 1.11.6 from Makefile.am.
2# @configure_input@2# @configure_input@
33
4# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,4# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
55
=== modified file 'test/regular/Makefile.am'
--- test/regular/Makefile.am 2012-07-25 22:36:11 +0000
+++ test/regular/Makefile.am 2012-11-08 16:29:22 +0000
@@ -38,6 +38,7 @@
3838
39check_regular_SOURCES = \39check_regular_SOURCES = \
40 accept-ended-touch.cpp \40 accept-ended-touch.cpp \
41 backend.cpp \
41 frame-fixture.cpp \42 frame-fixture.cpp \
42 frame-fixture.h43 frame-fixture.h
4344
4445
=== modified file 'test/regular/Makefile.in'
--- test/regular/Makefile.in 2012-07-26 18:35:10 +0000
+++ test/regular/Makefile.in 2012-11-08 16:29:22 +0000
@@ -1,4 +1,4 @@
1# Makefile.in generated by automake 1.11.5 from Makefile.am.1# Makefile.in generated by automake 1.11.6 from Makefile.am.
2# @configure_input@2# @configure_input@
33
4# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,4# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
@@ -84,6 +84,7 @@
84check_cxx_compile_DEPENDENCIES = $(top_builddir)/src/libframe.la \84check_cxx_compile_DEPENDENCIES = $(top_builddir)/src/libframe.la \
85 $(am__DEPENDENCIES_1)85 $(am__DEPENDENCIES_1)
86am_check_regular_OBJECTS = check_regular-accept-ended-touch.$(OBJEXT) \86am_check_regular_OBJECTS = check_regular-accept-ended-touch.$(OBJEXT) \
87 check_regular-backend.$(OBJEXT) \
87 check_regular-frame-fixture.$(OBJEXT)88 check_regular-frame-fixture.$(OBJEXT)
88check_regular_OBJECTS = $(am_check_regular_OBJECTS)89check_regular_OBJECTS = $(am_check_regular_OBJECTS)
89check_regular_DEPENDENCIES = $(top_builddir)/src/.libs/libframe.a \90check_regular_DEPENDENCIES = $(top_builddir)/src/.libs/libframe.a \
@@ -340,6 +341,7 @@
340### check-regular341### check-regular
341check_regular_SOURCES = \342check_regular_SOURCES = \
342 accept-ended-touch.cpp \343 accept-ended-touch.cpp \
344 backend.cpp \
343 frame-fixture.cpp \345 frame-fixture.cpp \
344 frame-fixture.h346 frame-fixture.h
345347
@@ -426,6 +428,7 @@
426@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check-cxx-compile.Po@am__quote@428@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check-cxx-compile.Po@am__quote@
427@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check-static-type-checking.Po@am__quote@429@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check-static-type-checking.Po@am__quote@
428@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_regular-accept-ended-touch.Po@am__quote@430@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_regular-accept-ended-touch.Po@am__quote@
431@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_regular-backend.Po@am__quote@
429@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_regular-frame-fixture.Po@am__quote@432@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/check_regular-frame-fixture.Po@am__quote@
430433
431.c.o:434.c.o:
@@ -484,6 +487,20 @@
484@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@487@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
485@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(check_regular_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o check_regular-accept-ended-touch.obj `if test -f 'accept-ended-touch.cpp'; then $(CYGPATH_W) 'accept-ended-touch.cpp'; else $(CYGPATH_W) '$(srcdir)/accept-ended-touch.cpp'; fi`488@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(check_regular_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o check_regular-accept-ended-touch.obj `if test -f 'accept-ended-touch.cpp'; then $(CYGPATH_W) 'accept-ended-touch.cpp'; else $(CYGPATH_W) '$(srcdir)/accept-ended-touch.cpp'; fi`
486489
490check_regular-backend.o: backend.cpp
491@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(check_regular_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT check_regular-backend.o -MD -MP -MF $(DEPDIR)/check_regular-backend.Tpo -c -o check_regular-backend.o `test -f 'backend.cpp' || echo '$(srcdir)/'`backend.cpp
492@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/check_regular-backend.Tpo $(DEPDIR)/check_regular-backend.Po
493@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='backend.cpp' object='check_regular-backend.o' libtool=no @AMDEPBACKSLASH@
494@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
495@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(check_regular_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o check_regular-backend.o `test -f 'backend.cpp' || echo '$(srcdir)/'`backend.cpp
496
497check_regular-backend.obj: backend.cpp
498@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(check_regular_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT check_regular-backend.obj -MD -MP -MF $(DEPDIR)/check_regular-backend.Tpo -c -o check_regular-backend.obj `if test -f 'backend.cpp'; then $(CYGPATH_W) 'backend.cpp'; else $(CYGPATH_W) '$(srcdir)/backend.cpp'; fi`
499@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/check_regular-backend.Tpo $(DEPDIR)/check_regular-backend.Po
500@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='backend.cpp' object='check_regular-backend.obj' libtool=no @AMDEPBACKSLASH@
501@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
502@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(check_regular_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o check_regular-backend.obj `if test -f 'backend.cpp'; then $(CYGPATH_W) 'backend.cpp'; else $(CYGPATH_W) '$(srcdir)/backend.cpp'; fi`
503
487check_regular-frame-fixture.o: frame-fixture.cpp504check_regular-frame-fixture.o: frame-fixture.cpp
488@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(check_regular_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT check_regular-frame-fixture.o -MD -MP -MF $(DEPDIR)/check_regular-frame-fixture.Tpo -c -o check_regular-frame-fixture.o `test -f 'frame-fixture.cpp' || echo '$(srcdir)/'`frame-fixture.cpp505@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(check_regular_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT check_regular-frame-fixture.o -MD -MP -MF $(DEPDIR)/check_regular-frame-fixture.Tpo -c -o check_regular-frame-fixture.o `test -f 'frame-fixture.cpp' || echo '$(srcdir)/'`frame-fixture.cpp
489@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/check_regular-frame-fixture.Tpo $(DEPDIR)/check_regular-frame-fixture.Po506@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/check_regular-frame-fixture.Tpo $(DEPDIR)/check_regular-frame-fixture.Po
490507
=== added file 'test/regular/backend.cpp'
--- test/regular/backend.cpp 1970-01-01 00:00:00 +0000
+++ test/regular/backend.cpp 2012-11-08 16:29:22 +0000
@@ -0,0 +1,289 @@
1#include <gtest/gtest.h>
2#include "oif/frame_backend.h"
3
4TEST(Backend, Touch)
5{
6 UFStatus status;
7
8 UFBackendTouch touch_backend = frame_backend_touch_new();
9 ASSERT_TRUE(touch_backend != nullptr);
10
11 UFTouch touch = frame_backend_touch_get_touch(touch_backend);
12 ASSERT_TRUE(touch != nullptr);
13
14 ASSERT_EQ(UFTouchStateBegin, frame_touch_get_state(touch));
15
16 frame_backend_touch_set_id(touch_backend, 123);
17 ASSERT_EQ(123, frame_touch_get_id(touch));
18
19 frame_backend_touch_set_ended(touch_backend);
20 ASSERT_EQ(UFTouchStateEnd, frame_touch_get_state(touch));
21
22 frame_backend_touch_set_window_pos(touch_backend, 1.2f, 3.4f);
23 ASSERT_EQ(1.2f, frame_touch_get_window_x(touch));
24 ASSERT_EQ(3.4f, frame_touch_get_window_y(touch));
25
26 frame_backend_touch_set_time(touch_backend, 852);
27 ASSERT_EQ(852, frame_touch_get_time(touch));
28
29 frame_backend_touch_set_start_time(touch_backend, 555);
30 ASSERT_EQ(555, frame_touch_get_start_time(touch));
31
32 frame_backend_touch_set_owned(touch_backend, 1);
33 int owned = 0;
34 status = frame_touch_get_property(touch, UFTouchPropertyOwned, &owned);
35 ASSERT_EQ(UFStatusSuccess, status);
36 ASSERT_EQ(1, owned);
37
38 frame_backend_touch_set_pending_end(touch_backend, 1);
39 int pending_end = 0;
40 status = frame_touch_get_property(touch, UFTouchPropertyPendingEnd, &pending_end);
41 ASSERT_EQ(UFStatusSuccess, status);
42 ASSERT_EQ(1, pending_end);
43
44 frame_backend_touch_set_value(touch_backend, UFAxisTypeTouchMajor, 987.6f);
45 float touch_major = 0.0f;
46 status = frame_touch_get_value(touch, UFAxisTypeTouchMajor, &touch_major);
47 ASSERT_EQ(UFStatusSuccess, status);
48 ASSERT_EQ(987.6f, touch_major);
49
50 /* clean up */
51 UFBackendFrame frame = frame_backend_frame_new();
52 frame_backend_frame_give_touch(frame, &touch_backend);
53 frame_backend_frame_delete(frame);
54}
55
56TEST(Backend, Device)
57{
58 UFStatus status;
59
60 UFBackendDevice device_backend = frame_backend_device_new();
61 ASSERT_NE(nullptr, device_backend);
62
63 UFDevice device = frame_backend_device_get_device(device_backend);
64 ASSERT_NE(nullptr, device);
65
66 const char *name = nullptr;
67 status = frame_device_get_property(device, UFDevicePropertyName, &name);
68 ASSERT_EQ(UFStatusErrorUnknownProperty, status);
69 frame_backend_device_set_name(device_backend, "Hello World");
70 status = frame_device_get_property(device, UFDevicePropertyName, &name);
71 ASSERT_EQ(UFStatusSuccess, status);
72 ASSERT_STREQ("Hello World", name);
73
74 int direct = 0;
75 status = frame_device_get_property(device, UFDevicePropertyDirect, &direct);
76 ASSERT_EQ(UFStatusErrorUnknownProperty, status);
77 frame_backend_device_set_direct(device_backend, 1);
78 status = frame_device_get_property(device, UFDevicePropertyDirect, &direct);
79 ASSERT_EQ(UFStatusSuccess, status);
80 ASSERT_EQ(1, direct);
81
82 int independent = 0;
83 status = frame_device_get_property(device, UFDevicePropertyIndependent, &independent);
84 ASSERT_EQ(UFStatusErrorUnknownProperty, status);
85 frame_backend_device_set_independent(device_backend, 1);
86 status = frame_device_get_property(device, UFDevicePropertyIndependent, &independent);
87 ASSERT_EQ(UFStatusSuccess, status);
88 ASSERT_EQ(1, independent);
89
90 int semi_mt = 0;
91 status = frame_device_get_property(device, UFDevicePropertySemiMT, &semi_mt);
92 ASSERT_EQ(UFStatusErrorUnknownProperty, status);
93 frame_backend_device_set_semi_mt(device_backend, 1);
94 status = frame_device_get_property(device, UFDevicePropertySemiMT, &semi_mt);
95 ASSERT_EQ(UFStatusSuccess, status);
96 ASSERT_EQ(1, semi_mt);
97
98 unsigned int max_touches = 0;
99 status = frame_device_get_property(device, UFDevicePropertyMaxTouches, &max_touches);
100 ASSERT_EQ(UFStatusErrorUnknownProperty, status);
101 frame_backend_device_set_max_touches(device_backend, 5);
102 status = frame_device_get_property(device, UFDevicePropertyMaxTouches, &max_touches);
103 ASSERT_EQ(UFStatusSuccess, status);
104 ASSERT_EQ(5, max_touches);
105
106 frame_backend_device_set_window_resolution(device_backend, 1024.0f, 768.0f);
107 ASSERT_EQ(1024.0f, frame_device_get_window_resolution_x(device));
108 ASSERT_EQ(768.0f, frame_device_get_window_resolution_y(device));
109
110 unsigned int num_axes = 0;
111 status = frame_device_get_property(device, UFDevicePropertyNumAxes, &num_axes);
112 ASSERT_EQ(UFStatusSuccess, status);
113 ASSERT_EQ(0, num_axes);
114 frame_backend_device_add_axis(device_backend,
115 UFAxisTypePressure, 1.0f, 1000.0f, 3.5f);
116 status = frame_device_get_property(device, UFDevicePropertyNumAxes, &num_axes);
117 ASSERT_EQ(UFStatusSuccess, status);
118 ASSERT_EQ(1, num_axes);
119 UFAxis axis = nullptr;
120 status = frame_device_get_axis_by_type(device, UFAxisTypePressure, &axis);
121 ASSERT_EQ(UFStatusSuccess, status);
122 ASSERT_NE(nullptr, axis);
123 ASSERT_EQ(UFAxisTypePressure, frame_axis_get_type(axis));
124 ASSERT_EQ(1.0f, frame_axis_get_minimum(axis));
125 ASSERT_EQ(1000.0f, frame_axis_get_maximum(axis));
126 ASSERT_EQ(3.5f, frame_axis_get_resolution(axis));
127
128 frame_backend_device_delete(device_backend);
129}
130
131TEST(Backend, Frame)
132{
133 UFStatus status;
134
135 UFBackendFrame frame_backend = frame_backend_frame_new();
136 ASSERT_NE(nullptr, frame_backend);
137
138 UFFrame frame = frame_backend_frame_get_frame(frame_backend);
139 ASSERT_NE(nullptr, frame);
140
141 UFBackendDevice device_backend = frame_backend_device_new();
142 UFDevice device = frame_backend_device_get_device(device_backend);
143
144 frame_backend_frame_set_device(frame_backend, device_backend);
145 ASSERT_EQ(device, frame_frame_get_device(frame));
146
147 frame_backend_frame_set_window_id(frame_backend, 123);
148 ASSERT_EQ(123, frame_frame_get_window_id(frame));
149
150
151 unsigned int active_touches = 0;
152 UFBackendTouch touch_backend = frame_backend_touch_new();
153 UFTouch touch = frame_backend_touch_get_touch(touch_backend);
154 frame_backend_touch_set_id(touch_backend, 10);
155 UFTouch touch_retrieved = nullptr;
156 ASSERT_EQ(0, frame_frame_get_num_touches(frame));
157 status = frame_frame_get_property(frame, UFFramePropertyActiveTouches, &active_touches);
158 ASSERT_EQ(UFStatusSuccess, status);
159 ASSERT_EQ(0, active_touches);
160 status = frame_backend_frame_give_touch(frame_backend, &touch_backend);
161 ASSERT_EQ(UFStatusSuccess, status);
162 ASSERT_EQ(nullptr, touch_backend);
163 ASSERT_EQ(1, frame_frame_get_num_touches(frame));
164 status = frame_frame_get_property(frame, UFFramePropertyActiveTouches, &active_touches);
165 ASSERT_EQ(UFStatusSuccess, status);
166 ASSERT_EQ(1, active_touches);
167 status = frame_frame_get_touch_by_id(frame, 10, &touch_retrieved);
168 ASSERT_EQ(UFStatusSuccess, status);
169 ASSERT_EQ(touch, touch_retrieved);
170
171 frame_backend_frame_set_active_touches(frame_backend, 3);
172 status = frame_frame_get_property(frame, UFFramePropertyActiveTouches, &active_touches);
173 ASSERT_EQ(UFStatusSuccess, status);
174 ASSERT_EQ(3, active_touches);
175
176 frame_backend_frame_delete(frame_backend);
177 frame_backend_device_delete(device_backend);
178}
179
180TEST(Backend, FrameBorrowInexistentTouch)
181{
182 UFStatus status;
183
184 UFBackendFrame frame_backend = frame_backend_frame_new();
185
186 UFBackendTouch touch_backend;
187 status = frame_backend_frame_borrow_touch_by_id(frame_backend, 123, &touch_backend);
188 ASSERT_EQ(UFStatusErrorInvalidTouch, status);
189
190 /* clean up */
191 frame_backend_frame_delete(frame_backend);
192}
193
194TEST(Backend, FrameCreateNext)
195{
196 UFStatus status;
197
198 /* frame 1 */
199 UFBackendTouch touch_backend = frame_backend_touch_new();
200 frame_backend_touch_set_id(touch_backend, 1);
201 UFTouch frame1_touch = frame_backend_touch_get_touch(touch_backend);
202
203 UFBackendFrame frame1_backend = frame_backend_frame_new();
204 status = frame_backend_frame_give_touch(frame1_backend, &touch_backend);
205 ASSERT_EQ(UFStatusSuccess, status);
206
207 /* frame 2 */
208 UFBackendFrame frame2_backend = frame_backend_frame_create_next(frame1_backend);
209 UFFrame frame2 = frame_backend_frame_get_frame(frame2_backend);
210
211 UFTouch frame2_touch;
212 status = frame_frame_get_touch_by_id(frame2, 1, &frame2_touch);
213 ASSERT_EQ(UFStatusSuccess, status);
214
215 /* frame 3 */
216 UFBackendFrame frame3_backend = frame_backend_frame_create_next(frame2_backend);
217 UFFrame frame3 = frame_backend_frame_get_frame(frame3_backend);
218
219 UFTouch frame3_touch;
220 status = frame_frame_get_touch_by_id(frame3, 1, &frame3_touch);
221 ASSERT_EQ(UFStatusSuccess, status);
222
223 /* frame 4 */
224 UFBackendFrame frame4_backend = frame_backend_frame_create_next(frame3_backend);
225
226 status = frame_backend_frame_borrow_touch_by_id(frame4_backend, 1, &touch_backend);
227 ASSERT_EQ(UFStatusSuccess, status);
228 frame_backend_touch_set_ended(touch_backend);
229 status = frame_backend_frame_give_touch(frame4_backend, &touch_backend);
230 ASSERT_EQ(UFStatusSuccess, status);
231
232 UFFrame frame4 = frame_backend_frame_get_frame(frame4_backend);
233 UFTouch frame4_touch;
234 status = frame_frame_get_touch_by_id(frame4, 1, &frame4_touch);
235 ASSERT_EQ(UFStatusSuccess, status);
236
237 /* frame 5 */
238 UFBackendFrame frame5_backend = frame_backend_frame_create_next(frame4_backend);
239 UFFrame frame5 = frame_backend_frame_get_frame(frame5_backend);
240
241 /* Test the status of touch 1 throughout all frames */
242 ASSERT_EQ(UFTouchStateBegin, frame_touch_get_state(frame1_touch));
243 ASSERT_EQ(UFTouchStateUpdate, frame_touch_get_state(frame2_touch));
244 ASSERT_EQ(UFTouchStateUpdate, frame_touch_get_state(frame3_touch));
245 ASSERT_EQ(frame2_touch, frame3_touch);
246 ASSERT_EQ(UFTouchStateEnd, frame_touch_get_state(frame4_touch));
247 ASSERT_EQ(0, frame_frame_get_num_touches(frame5));
248
249 /* clean up */
250 frame_backend_frame_delete(frame1_backend);
251 frame_backend_frame_delete(frame2_backend);
252 frame_backend_frame_delete(frame3_backend);
253 frame_backend_frame_delete(frame4_backend);
254 frame_backend_frame_delete(frame5_backend);
255}
256
257TEST(Backend, Event)
258{
259 UFStatus status;
260
261 UFEvent event = frame_event_new();
262 ASSERT_NE(nullptr, event);
263
264 frame_event_set_type(event, UFEventTypeDeviceRemoved);
265 ASSERT_EQ(UFEventTypeDeviceRemoved, frame_event_get_type(event));
266
267 UFBackendDevice device_backend = frame_backend_device_new();
268 UFDevice device = frame_backend_device_get_device(device_backend);
269 UFDevice device_retrieved = nullptr;
270 frame_event_set_device(event, device_backend);
271 status = frame_event_get_property(event, UFEventPropertyDevice, &device_retrieved);
272 ASSERT_EQ(UFStatusSuccess, status);
273 ASSERT_EQ(device, device_retrieved);
274
275 UFBackendFrame frame_backend = frame_backend_frame_new();
276 UFFrame frame = frame_backend_frame_get_frame(frame_backend);
277 UFFrame frame_retrieved = nullptr;
278 frame_event_set_frame(event, frame_backend);
279 status = frame_event_get_property(event, UFEventPropertyFrame, &frame_retrieved);
280 ASSERT_EQ(UFStatusSuccess, status);
281 ASSERT_EQ(frame, frame_retrieved);
282
283 frame_event_set_time(event, 1234);
284 ASSERT_EQ(1234, frame_event_get_time(event));
285
286 frame_event_unref(event);
287 frame_backend_device_delete(device_backend);
288 frame_backend_frame_delete(frame_backend);
289}
0290
=== modified file 'test/regular/frame-fixture.cpp'
--- test/regular/frame-fixture.cpp 2012-07-17 14:27:23 +0000
+++ test/regular/frame-fixture.cpp 2012-11-08 16:29:22 +0000
@@ -106,6 +106,10 @@
106106
107 status = frame_x11_process_event(frame_handle, &xcookie);107 status = frame_x11_process_event(frame_handle, &xcookie);
108 ASSERT_EQ(UFStatusSuccess, status);108 ASSERT_EQ(UFStatusSuccess, status);
109
110 free(device_event->valuators.mask);
111 free(device_event->valuators.values);
112 free(device_event);
109}113}
110114
111void FrameFixture::SendTouchOwnershipEvent(int touch_id)115void FrameFixture::SendTouchOwnershipEvent(int touch_id)
@@ -133,6 +137,8 @@
133137
134 status = frame_x11_process_event(frame_handle, &xcookie);138 status = frame_x11_process_event(frame_handle, &xcookie);
135 ASSERT_EQ(UFStatusSuccess, status);139 ASSERT_EQ(UFStatusSuccess, status);
140
141 free(ownership_event);
136}142}
137143
138void FrameFixture::FetchDeviceAddedEvent(UFDevice *device)144void FrameFixture::FetchDeviceAddedEvent(UFDevice *device)
139145
=== modified file 'test/x11_mocks/Makefile.in'
--- test/x11_mocks/Makefile.in 2012-07-26 18:35:10 +0000
+++ test/x11_mocks/Makefile.in 2012-11-08 16:29:22 +0000
@@ -1,4 +1,4 @@
1# Makefile.in generated by automake 1.11.5 from Makefile.am.1# Makefile.in generated by automake 1.11.6 from Makefile.am.
2# @configure_input@2# @configure_input@
33
4# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,4# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
55
=== modified file 'tools/Makefile.in'
--- tools/Makefile.in 2012-07-26 18:43:01 +0000
+++ tools/Makefile.in 2012-11-08 16:29:22 +0000
@@ -1,4 +1,4 @@
1# Makefile.in generated by automake 1.11.5 from Makefile.am.1# Makefile.in generated by automake 1.11.6 from Makefile.am.
2# @configure_input@2# @configure_input@
33
4# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,4# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
55
=== modified file 'tools/frame-test-x11.1'
--- tools/frame-test-x11.1 2012-07-26 18:35:10 +0000
+++ tools/frame-test-x11.1 2012-11-08 16:29:22 +0000
@@ -2,12 +2,12 @@
2.\" Title: frame-test-x112.\" Title: frame-test-x11
3.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]3.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
4.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>4.\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
5.\" Date: 07/25/20125.\" Date: 11/08/2012
6.\" Manual: \ \&6.\" Manual: \ \&
7.\" Source: \ \&7.\" Source: \ \&
8.\" Language: English8.\" Language: English
9.\"9.\"
10.TH "FRAME\-TEST\-X11" "1" "07/25/2012" "\ \&" "\ \&"10.TH "FRAME\-TEST\-X11" "1" "11/08/2012" "\ \&" "\ \&"
11.\" -----------------------------------------------------------------11.\" -----------------------------------------------------------------
12.\" * Define some portability stuff12.\" * Define some portability stuff
13.\" -----------------------------------------------------------------13.\" -----------------------------------------------------------------

Subscribers

People subscribed via source and target branches