2
// libavg - Media Playback Engine.
3
// Copyright (C) 2003-2008 Ulrich von Zadow
5
// This library is free software; you can redistribute it and/or
6
// modify it under the terms of the GNU Lesser General Public
7
// License as published by the Free Software Foundation; either
8
// version 2 of the License, or (at your option) any later version.
10
// This library is distributed in the hope that it will be useful,
11
// but WITHOUT ANY WARRANTY; without even the implied warranty of
12
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
// Lesser General Public License for more details.
15
// You should have received a copy of the GNU Lesser General Public
16
// License along with this library; if not, write to the Free Software
17
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19
// Current versions can be found at www.libavg.de
22
#ifndef _MultitouchEventSource_H_
23
#define _MultitouchEventSource_H_
26
#include "CursorEvent.h"
27
#include "IEventSource.h"
29
#include <boost/thread.hpp>
33
typedef boost::shared_ptr<boost::mutex> MutexPtr;
38
typedef boost::shared_ptr<class TouchStatus> TouchStatusPtr;
40
typedef boost::shared_ptr<class TouchEvent> TouchEventPtr;
42
class AVG_API MultitouchEventSource: public IEventSource
45
MultitouchEventSource();
46
virtual ~MultitouchEventSource() = 0;
49
std::vector<EventPtr> pollEvents();
52
const DPoint& getWindowSize() const;
53
// Note that the id used here is not the libavg cursor id but a touch-driver-specific
54
// id handed up from the driver level.
55
TouchStatusPtr getTouchStatus(int id);
56
void addTouchStatus(int id, TouchEventPtr pInitialEvent);
57
void getDeadIDs(const std::set<int>& liveIDs, std::set<int>& deadIDs);
58
boost::mutex& getMutex();
61
std::map<int, TouchStatusPtr> m_Touches;
66
typedef boost::shared_ptr<MultitouchEventSource> MultitouchEventSourcePtr;