1
/*****************************************************************************
3
* frame - Touch Frame Library
5
* Copyright (C) 2011-2012 Canonical Ltd.
7
* This library is free software: you can redistribute it and/or modify it
8
* under the terms of the GNU Lesser General Public License version 3
9
* as published by the Free Software Foundation.
11
* This library is distributed in the hope that it will be useful, but
12
* WITHOUT ANY WARRANTY; without even the implied warranties of
13
* MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR
14
* PURPOSE. See the GNU Lesser General Public License for more details.
16
* You should have received a copy of the GNU Lesser General Public License
17
* along with this library. If not, see <http://www.gnu.org/licenses/>.
19
****************************************************************************/
21
#ifndef FRAME_DEVICE_X11_H_
22
#define FRAME_DEVICE_X11_H_
27
#include <X11/extensions/XInput2.h>
29
#include "oif/frame.h"
38
public std::enable_shared_from_this<UFDeviceX11> {
40
UFDeviceX11(Display* display, const XIDeviceInfo& info);
42
int master_id() const { return master_id_; }
43
const std::map<int, UFAxisType>& axis_map() const { return axis_map_; }
45
bool HandleDeviceEvent(const XIDeviceEvent* event, SharedUFFrame* frame);
46
bool HandleOwnershipEvent(const XITouchOwnershipEvent* event,
47
SharedUFFrame* frame);
48
UFStatus AcceptTouch(::Window window_id, UFTouchId touch_id) const;
49
UFStatus RejectTouch(::Window window_id, UFTouchId touch_id) const;
52
UFDeviceX11(const UFDeviceX11&) = delete;
53
UFDeviceX11& operator=(const UFDeviceX11&) = delete;
58
std::map<int, UFAxisType> axis_map_;
59
std::map< ::Window, SharedWindow> windows_;
65
#endif // FRAME_DEVICE_X11_H_