~unity-team/unity/trunk

« back to all changes in this revision

Viewing changes to tests/test-gesture-engine/compiz_mock/core/screen.h

  • Committer: Tarmac
  • Author(s): Daniel d'Andrada
  • Date: 2012-04-06 02:11:51 UTC
  • mfrom: (2198.1.6 lp940612_v2)
  • Revision ID: tarmac-20120406021151-wpjwi2lgqivdl0p3
Fix the three-finger move for unity.. Fixes: https://bugs.launchpad.net/bugs/940612. Approved by Tim Penhey.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright 2012 Canonical Ltd.
 
3
 *
 
4
 * This program is free software: you can redistribute it and/or modify it
 
5
 * under the terms of the GNU General Public License version 3, as published
 
6
 * by the  Free Software Foundation.
 
7
 *
 
8
 * This program is distributed in the hope that it will be useful, but
 
9
 * WITHOUT ANY WARRANTY; without even the implied warranties of
 
10
 * MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR
 
11
 * PURPOSE.  See the GNU General Public License for more details.
 
12
 *
 
13
 * You should have received a copy of the GNU General Public License
 
14
 * version 3 along with this program.  If not, see
 
15
 * <http://www.gnu.org/licenses/>
 
16
 *
 
17
 * Authored by: Daniel d'Andrada <daniel.dandrada@canonical.com>
 
18
 *
 
19
 */
 
20
 
 
21
#ifndef COMPIZ_SCREEN_MOCK_H
 
22
#define COMPIZ_SCREEN_MOCK_H
 
23
 
 
24
#include <X11/Xlib.h>
 
25
#include <vector>
 
26
 
 
27
// The real CompScreen
 
28
#include <core/screen.h>
 
29
 
 
30
typedef std::vector<CompWindowMock*> CompWindowMockVector;
 
31
 
 
32
class CompScreenMock {
 
33
public:
 
34
  typedef int GrabHandle;
 
35
 
 
36
  int width() const {return _width;}
 
37
  int height() const {return _height;}
 
38
 
 
39
  Display *dpy() {return _dpy;}
 
40
 
 
41
  const CompWindowMockVector & clientList(bool stackingOrder = true) {
 
42
    if (stackingOrder)
 
43
      return _client_list_stacking;
 
44
    else
 
45
      return _client_list;
 
46
  }
 
47
 
 
48
  Window root() {return _root;}
 
49
 
 
50
  GrabHandle pushGrab(Cursor cursor, const char *name) {return 0;}
 
51
  void removeGrab(GrabHandle handle, CompPoint *restorePointer) {}
 
52
 
 
53
  Cursor invisibleCursor() {return 1;}
 
54
 
 
55
  int _width;
 
56
  int _height;
 
57
  Display *_dpy;
 
58
  CompWindowMockVector _client_list;
 
59
  CompWindowMockVector _client_list_stacking;
 
60
  Window _root;
 
61
};
 
62
 
 
63
extern CompScreenMock *screen_mock;
 
64
extern int pointerX_mock;
 
65
extern int pointerY_mock;
 
66
 
 
67
#endif
 
68