From 6b4fed1d98628b32a92b39e3af7159b3e6ae403f Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Sun, 25 Oct 2009 04:25:56 +0000 Subject: added Unregister for sake of being proper svn path=/trunk/externals/apple/; revision=12670 --- MultitouchSupport.h | 28 ++++++++++++++++++++++++++++ multitouch.c | 3 ++- 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/MultitouchSupport.h b/MultitouchSupport.h index 835c1a4..1acef9b 100644 --- a/MultitouchSupport.h +++ b/MultitouchSupport.h @@ -1,3 +1,30 @@ +/* --------------------------------------------------------------------------*/ +/* */ +/* get info from the multitouch trackpad on Apple Mac OS X */ +/* based on 'fingerpinger' and other things */ +/* */ +/* Copyright (c) 2009 Hans-Christoph Steiner */ +/* Copyright (c) 2009 Michael & Max Egger */ +/* Copyright (c) 2008 Steike */ +/* */ +/* This program is free software; you can redistribute it and/or */ +/* modify it under the terms of the GNU General Public License */ +/* as published by the Free Software Foundation; either version 3 */ +/* of the License, or (at your option) any later version. */ +/* */ +/* See file LICENSE for further informations on licensing terms. */ +/* */ +/* This program is distributed in the hope that it will be useful, */ +/* but WITHOUT ANY WARRANTY; without even the implied warranty of */ +/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */ +/* GNU General Public License for more details. */ +/* */ +/* You should have received a copy of the GNU General Public License */ +/* along with this program; if not, write to the Free Software Foundation, */ +/* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA */ +/* */ +/* --------------------------------------------------------------------------*/ + #ifndef _MULTITOUCHSUPPORT_H_ #define _MULTITOUCHSUPPORT_H_ @@ -28,6 +55,7 @@ typedef int (*MTContactCallbackFunction)(int,Finger*,int,double,int); MTDeviceRef MTDeviceCreateDefault(); void MTRegisterContactFrameCallback(MTDeviceRef, MTContactCallbackFunction); +void MTUnregisterContactFrameCallback(MTDeviceRef, MTContactCallbackFunction); void MTDeviceStart(MTDeviceRef, int); void MTDeviceStop(MTDeviceRef); void MTDeviceRelease(MTDeviceRef); diff --git a/multitouch.c b/multitouch.c index 3118d8c..0b9b0a7 100644 --- a/multitouch.c +++ b/multitouch.c @@ -27,9 +27,9 @@ #include #include +#include #include #include -#include #include "MultitouchSupport.h" #include @@ -109,6 +109,7 @@ static void multitouch_float(t_multitouch* x, t_float f) /* if I am the last instance, clean up the callback stuff */ if (polling == 0) { MTDeviceStop(dev); + MTUnregisterContactFrameCallback(dev, callback); MTDeviceRelease(dev); dev = NULL; } -- cgit v1.2.1