~unity-2d-team/unity-2d/shortcut-hint-overlay

« back to all changes in this revision

Viewing changes to libunity-2d-private/src/pointerbarriermanager.h

  • Committer: Tiago Salem Herrmann
  • Date: 2012-03-19 15:28:41 UTC
  • mfrom: (771.40.182 unity-2d)
  • Revision ID: tiago.herrmann@canonical.com-20120319152841-2hfflo67muks7gca
merge trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (C) 2012 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 POINTERBARRIERMANAGER_H
 
18
#define POINTERBARRIERMANAGER_H
 
19
 
 
20
#include "unity2dapplication.h"
 
21
 
 
22
class PointerBarrierWrapper;
 
23
 
 
24
class PointerBarrierManager : protected AbstractX11EventFilter
 
25
{
 
26
public:
 
27
    static PointerBarrierManager *instance();
 
28
 
 
29
    void addBarrier(PointerBarrierWrapper *barrier);
 
30
    void removeBarrier(PointerBarrierWrapper *barrier);
 
31
 
 
32
protected:
 
33
    bool x11EventFilter(XEvent* event);
 
34
 
 
35
private:
 
36
    Q_DISABLE_COPY(PointerBarrierManager);
 
37
 
 
38
    PointerBarrierManager();
 
39
    QSet<PointerBarrierWrapper*> m_barriers;
 
40
    int m_eventBase;
 
41
    int m_errorBase;
 
42
};
 
43
 
 
44
#endif // POINTERBARRIERMANAGER_H