~ubuntu-branches/ubuntu/precise/libavg/precise

« back to all changes in this revision

Viewing changes to src/player/XInput21MTInputDevice.h

  • Committer: Package Import Robot
  • Author(s): OXullo Intersecans
  • Date: 2012-01-29 19:26:37 UTC
  • mfrom: (1.1.7)
  • Revision ID: package-import@ubuntu.com-20120129192637-ck9os7t5x3adl92x
Tags: 1.7.1-0ubuntu1
New upstream release (LP: #923302)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
//
2
 
//  libavg - Media Playback Engine. 
3
 
//  Copyright (C) 2003-2011 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 _XInput21MTInputDevice_H_
23
 
#define _XInput21MTInputDevice_H_
24
 
 
25
 
#include "../api.h"
26
 
#include "MultitouchInputDevice.h"
27
 
#include "Event.h"
28
 
 
29
 
#include "../base/Point.h"
30
 
 
31
 
#include <X11/Xlib.h>
32
 
#include <vector>
33
 
#include <string>
34
 
 
35
 
union SDL_Event;
36
 
 
37
 
namespace avg {
38
 
 
39
 
class AVG_API XInput21MTInputDevice: public MultitouchInputDevice
40
 
{
41
 
public:
42
 
    XInput21MTInputDevice();
43
 
    virtual ~XInput21MTInputDevice();
44
 
    virtual void start();
45
 
 
46
 
    void handleXIEvent(const XEvent& xEvent);
47
 
    std::vector<EventPtr> pollEvents();
48
 
    
49
 
private:
50
 
    void findMTDevice();
51
 
    TouchEventPtr createEvent(int id, Event::Type type, IntPoint pos);
52
 
 
53
 
    static int filterEvent(const SDL_Event * pEvent);
54
 
 
55
 
    int m_LastID;
56
 
 
57
 
    static Display* s_pDisplay;
58
 
    void (*m_SDLLockFunc)(void);
59
 
    void (*m_SDLUnlockFunc)(void);
60
 
 
61
 
    int m_XIOpcode;
62
 
 
63
 
    std::string m_sDeviceName;
64
 
    int m_DeviceID;
65
 
 
66
 
    int m_OldMasterDeviceID;
67
 
};
68
 
 
69
 
typedef boost::shared_ptr<XInput21MTInputDevice> XInput21MTInputDevicePtr;
70
 
 
71
 
}
72
 
 
73
 
#endif
74