~ubuntu-branches/ubuntu/trusty/libavg/trusty-proposed

« back to all changes in this revision

Viewing changes to src/player/MultitouchEventSource.h

  • Committer: Package Import Robot
  • Author(s): OXullo Intersecans
  • Date: 2011-12-06 22:44:56 UTC
  • mfrom: (1.1.6)
  • Revision ID: package-import@ubuntu.com-20111206224456-qc7250z3ya1vi8s9
Tags: 1.7.0-0ubuntu1
* New upstream release (LP: #899183)
* Remove patches 0002-libav-0.7.patch, 0003-fglrx-segfault-on-startup.patch
  now merged to upstream
* Remove unnecessary .la files
* Update debian/watch file
* Fix debian/copyright dep-5 compliancy
* Update standards to version 3.9.2
* Add man pages for avg_checktouch, avg_checkvsync, avg_showsvg
* Minor debian/rules enhancement
* Add librsvg2-dev, libgdk-pixbuf2.0-dev to Build-Depends
* Proper transition to dh_python2

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
//
2
 
//  libavg - Media Playback Engine. 
3
 
//  Copyright (C) 2003-2008 Ulrich von Zadow
4
 
//
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.
9
 
//
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.
14
 
//
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
18
 
//
19
 
//  Current versions can be found at www.libavg.de
20
 
//
21
 
 
22
 
#ifndef _MultitouchEventSource_H_
23
 
#define _MultitouchEventSource_H_
24
 
 
25
 
#include "../api.h"
26
 
#include "CursorEvent.h"
27
 
#include "IEventSource.h"
28
 
 
29
 
#include <boost/thread.hpp>
30
 
#include <map>
31
 
#include <set>
32
 
 
33
 
typedef boost::shared_ptr<boost::mutex> MutexPtr;
34
 
 
35
 
namespace avg {
36
 
 
37
 
class TouchStatus;
38
 
typedef boost::shared_ptr<class TouchStatus> TouchStatusPtr;
39
 
class TouchEvent;
40
 
typedef boost::shared_ptr<class TouchEvent> TouchEventPtr;
41
 
 
42
 
class AVG_API MultitouchEventSource: public IEventSource
43
 
{
44
 
public:
45
 
    MultitouchEventSource();
46
 
    virtual ~MultitouchEventSource() = 0;
47
 
    virtual void start();
48
 
    
49
 
    std::vector<EventPtr> pollEvents();
50
 
 
51
 
protected:
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();
59
 
 
60
 
private:
61
 
    std::map<int, TouchStatusPtr> m_Touches;
62
 
    DPoint m_WindowSize;
63
 
    MutexPtr m_pMutex;
64
 
};
65
 
 
66
 
typedef boost::shared_ptr<MultitouchEventSource> MultitouchEventSourcePtr;
67
 
 
68
 
}
69
 
 
70
 
#endif