~alan-griffiths/miral/fix-1645284

« back to all changes in this revision

Viewing changes to miral-qt/demos/qml-demo-shell/pointerposition.h

  • Committer: Alan Griffiths
  • Date: 2016-11-07 17:59:19 UTC
  • mfrom: (436.1.1 miral2)
  • Revision ID: alan@octopull.co.uk-20161107175919-stbb64i7j1htgog2
[miral-qt] delete all as qtmir work on MirAL has shifted to lp:~unity-team/qtmir/miral-qt-integration and this is a needless distration

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * Copyright (C) 2016 Canonical, Ltd.
3
 
 *
4
 
 * This program is free software; you can redistribute it and/or modify
5
 
 * it under the terms of the GNU General Public License as published by
6
 
 * the Free Software Foundation; version 3.
7
 
 *
8
 
 * This program is distributed in the hope that it will be useful,
9
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11
 
 * GNU General Public License for more details.
12
 
 *
13
 
 * You should have received a copy of the GNU General Public License
14
 
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
15
 
 */
16
 
 
17
 
#ifndef POINTERPOSITION_H
18
 
#define POINTERPOSITION_H
19
 
 
20
 
#include <QObject>
21
 
 
22
 
class PointerPosition : public QObject
23
 
{
24
 
    Q_OBJECT
25
 
    Q_PROPERTY(int x READ x NOTIFY xChanged)
26
 
    Q_PROPERTY(int y READ y NOTIFY yChanged)
27
 
 
28
 
public:
29
 
    static PointerPosition *instance();
30
 
 
31
 
    int x() const { return m_x; }
32
 
    int y() const { return m_y; }
33
 
 
34
 
Q_SIGNALS:
35
 
    void xChanged();
36
 
    void yChanged();
37
 
 
38
 
protected:
39
 
    bool eventFilter(QObject *object, QEvent *event);
40
 
 
41
 
private:
42
 
    Q_DISABLE_COPY(PointerPosition)
43
 
    PointerPosition();
44
 
    ~PointerPosition();
45
 
 
46
 
    int m_x{0}, m_y{0};
47
 
};
48
 
 
49
 
#endif // POINTERPOSITION_H