~oif-team/ubuntu/natty/qt4-x11/xi2.1

« back to all changes in this revision

Viewing changes to src/plugins/mousedrivers/tslib/tslibmousehandler.h

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad
  • Date: 2005-08-24 04:09:09 UTC
  • Revision ID: james.westby@ubuntu.com-20050824040909-xmxe9jfr4a0w5671
Tags: upstream-4.0.0
ImportĀ upstreamĀ versionĀ 4.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 
 
3
 Copyright (C) 2003, 2004, 2005 Texas Instruments, Inc.
 
4
 Copyright (C)       2004, 2005 Holger Hans Peter Freyther
 
5
 All rights reserved.
 
6
 
 
7
 Redistribution and use in source and binary forms, with or without
 
8
 modification, are permitted provided that the following conditions are met:
 
9
 
 
10
   Redistributions of source code must retain the above copyright notice,
 
11
   this list of conditions and the following disclaimer.
 
12
 
 
13
   Redistributions in binary form must reproduce the above copyright
 
14
   notice, this list of conditions and the following disclaimer in the
 
15
   documentation and/or other materials provided with the distribution.
 
16
 
 
17
   Neither the name Texas Instruments, Inc nor the names of its
 
18
   contributors may be used to endorse or promote products derived
 
19
   from this software without specific prior written permission.
 
20
 
 
21
 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 
22
 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 
23
 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
 
24
 FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
 
25
 COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
 
26
 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 
27
 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
 
28
 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 
29
 HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
 
30
 STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
 
31
 IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 
32
 POSSIBILITY OF SUCH DAMAGE.
 
33
 
 
34
*/
 
35
 
 
36
#ifndef TSLIB_MOUSE_HANDLER_H
 
37
#define TSLIB_MOUSE_HANDLER_H
 
38
 
 
39
#include <QWSCalibratedMouseHandler>
 
40
 
 
41
class QSocketNotifier;
 
42
class TSLibMouseHandler : public QObject, public QWSCalibratedMouseHandler
 
43
{
 
44
    Q_OBJECT
 
45
public:
 
46
    TSLibMouseHandler();
 
47
    ~TSLibMouseHandler();
 
48
 
 
49
    void clearCalibration();
 
50
    void calibrate( QWSPointerCalibrationData * );
 
51
    void suspend();
 
52
    void resume();
 
53
 
 
54
    static int sortByX( const void*, const void* );
 
55
    static int sortByY( const void*, const void* );
 
56
private:
 
57
    void openTs();
 
58
    void closeTs();
 
59
    void interpolateSample();
 
60
 
 
61
private:
 
62
    bool m_raw : 1;
 
63
    QSocketNotifier *m_notify;
 
64
#ifdef QT_QWS_TSLIB
 
65
    struct tsdev *m_ts;
 
66
#endif
 
67
 
 
68
private slots:
 
69
    void readMouseData();
 
70
};
 
71
 
 
72
#endif