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

« back to all changes in this revision

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